diff --git a/10-es2015.js b/10-es2015.js index 0954cde6c..9e6729ee5 100644 --- a/10-es2015.js +++ b/10-es2015.js @@ -1 +1 @@ -var _g=Object.defineProperty,yg=Object.defineProperties,mg=Object.getOwnPropertyDescriptors,Es=Object.getOwnPropertySymbols,xc=Object.prototype.hasOwnProperty,Sc=Object.prototype.propertyIsEnumerable,Ec=(e,t,n)=>t in e?_g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,or=(e,t)=>{for(var n in t||(t={}))xc.call(t,n)&&Ec(e,n,t[n]);if(Es)for(var n of Es(t))Sc.call(t,n)&&Ec(e,n,t[n]);return e},$i=(e,t)=>yg(e,mg(t)),Nc=(e,t)=>{var n={};for(var r in e)xc.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Es)for(var r of Es(e))t.indexOf(r)<0&&Sc.call(e,r)&&(n[r]=e[r]);return n};!function(){var e={71440:function(e,t,n){var r=n(91052).default;e.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){return i(t[a][1][e]||e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o=void 0,a=0;a0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;su?u:s+a));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function d(e,t,n){for(var r=[],i=t;i>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":4}],6:[function(e,t,n){(function(t){(function(){"use strict";var t=e("base64-js"),r=e("ieee754");n.Buffer=a,n.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},n.INSPECT_MAX_BYTES=50;var i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|f(e,t),r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return C(e).length;default:if(i)return r?-1:P(e).length;t=(""+t).toLowerCase(),i=!0}}function h(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return j(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return E(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function p(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),G(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var d=!0,f=0;fi&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,n,r){return t.fromByteArray(0===n&&r===e.length?e:e.slice(n,r))}function j(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(r.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;rt&&(e+=" ... "),""},a.prototype.compare=function(e,t,n,r,i){if(B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(o,s),c=this.slice(r,i),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return m(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return v(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,i,o){return t=+t,n>>>=0,o||R(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function L(e,t,n,i,o){return t=+t,n>>>=0,o||R(e,0,n,8),r.write(e,t,n,i,52,8),n+8}a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||A(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||A(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||k(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r||k(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);k(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);k(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&0!==r&&(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function C(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(e,t,n){"use strict";t.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce((t,n,r)=>t+(0===r?"":",")+e(void 0===n||"symbol"==typeof n?null:n),"")+"]":"{"+Object.keys(t).sort().reduce((n,r,i)=>void 0===t[r]||"symbol"==typeof t[r]?n:n+(0===n.length?"":",")+e(r)+":"+e(t[r]),"")+"}"}},{}],8:[function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,i,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,o,a;if(c(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,l=y(u,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},{}],9:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},{}],10:[function(e,t,n){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t,n){"use strict";const{isArray:i,isObject:o,isString:a}=e("./types"),{asArray:s}=e("./util"),{prependBase:u}=e("./url"),c=e("./JsonLdError"),l=e("./ResolvedContext");function d(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function f({context:e,base:t}){if(!e)return;const n=e["@context"];if(a(n))e["@context"]=u(t,n);else if(i(n))for(let r=0;r10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(t))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let r,u;s.add(t);try{u=yield n(t),r=u.document||null,a(r)&&(r=JSON.parse(r))}catch(l){throw new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:l})}if(!o(r))throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return r="@context"in r?{"@context":r["@context"]}:{"@context":{}},u.contextUrl&&(i(r["@context"])||(r["@context"]=[r["@context"]]),r["@context"].push(u.contextUrl)),{context:r,remoteDoc:u}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(e,t,n){"use strict";t.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},{}],13:[function(e,t,n){"use strict";t.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],14:[function(e,t,n){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(e,t,n){"use strict";t.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}add(e){var t=this;return r(function*(){let n=t._requests[e];if(n)return Promise.resolve(n);n=t._requests[e]=t._loader(e);try{return yield n}finally{delete t._requests[e]}})()}}},{}],16:[function(e,t,n){"use strict";const r=e("lru-cache");t.exports=class{constructor({document:e}){this.document=e,this.cache=new r({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},{"lru-cache":33}],17:[function(e,t,n){"use strict";const i=e("./JsonLdError"),{isArray:o,isObject:a,isString:s,isUndefined:u}=e("./types"),{isList:c,isValue:l,isGraph:d,isSimpleGraph:f,isSubjectReference:h}=e("./graphTypes"),{expandIri:p,getContextValue:g,isKeyword:y,process:m,processingMode:b}=e("./context"),{removeBase:v,prependBase:_}=e("./url"),{addValue:w,asArray:x,compareShortestLeast:S}=e("./util"),j={};function N(e,t,n){if("@nest"!==p(e,t,{vocab:!0},n))throw new i("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}t.exports=j,j.compact=function(){var e=r(function*({activeCtx:e,activeProperty:t=null,element:n,options:r={},compactionMap:p=(()=>{})}){if(o(n)){let i=[];for(let o=0;o1&&(T=Array.from(T).sort());const I=e;for(const t of T){const n=j.compactIri({activeCtx:I,iri:t,relativeTo:{vocab:!0}}),i=g(S,n,"@context");u(i)||(e=yield m({activeCtx:e,localCtx:i,options:r,propagate:!1}))}const A=Object.keys(n).sort();for(const u of A){const h=n[u];if("@id"!==u)if("@type"!==u)if("@reverse"!==u)if("@preserve"!==u)if("@index"!==u)if("@graph"!==u&&"@list"!==u&&"@included"!==u&&y(u)){const t=j.compactIri({activeCtx:e,iri:u,relativeTo:{vocab:!0}});w(_,t,h)}else{if(!o(h))throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===h.length){const t=j.compactIri({activeCtx:e,iri:u,value:h,relativeTo:{vocab:!0},reverse:v}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let i=_;n&&(N(e,n,r),a(_[n])||(_[n]={}),i=_[n]),w(i,t,h,{propertyIsArray:!0})}for(const t of h){const n=j.compactIri({activeCtx:e,iri:u,value:t,relativeTo:{vocab:!0},reverse:v}),i=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let h=_;i&&(N(e,i,r),a(_[i])||(_[i]={}),h=_[i]);const y=g(e,n,"@container")||[],m=d(t),b=c(t);let S;b?S=t["@list"]:m&&(S=t["@graph"]);let E=yield j.compact({activeCtx:e,activeProperty:n,element:b||m?S:t,options:r,compactionMap:p});if(b){if(o(E)||(E=[E]),y.includes("@list")){w(h,n,E,{valueIsArray:!0,allowDuplicate:!0});continue}E={[j.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:E},"@index"in t&&(E[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(m)if(y.includes("@graph")&&(y.includes("@id")||y.includes("@index")&&f(t))){let i;h.hasOwnProperty(n)?i=h[n]:h[n]=i={};const o=(y.includes("@id")?t["@id"]:t["@index"])||j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(i,o,E,{propertyIsArray:!r.compactArrays||y.includes("@set")})}else y.includes("@graph")&&f(t)?(o(E)&&E.length>1&&(E={"@included":E}),w(h,n,E,{propertyIsArray:!r.compactArrays||y.includes("@set")})):(o(E)&&1===E.length&&r.compactArrays&&(E=E[0]),E={[j.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:E},"@id"in t&&(E[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(E[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(h,n,E,{propertyIsArray:!r.compactArrays||y.includes("@set")}));else if(y.includes("@language")||y.includes("@index")||y.includes("@id")||y.includes("@type")){let i,o;if(h.hasOwnProperty(n)?i=h[n]:h[n]=i={},y.includes("@language"))l(E)&&(E=E["@value"]),o=t["@language"];else if(y.includes("@index")){const r=g(e,n,"@index")||"@index",i=j.compactIri({activeCtx:e,iri:r,relativeTo:{vocab:!0}});if("@index"===r)o=t["@index"],delete E[i];else{let e;if([o,...e]=x(E[r]||[]),s(o))switch(e.length){case 0:delete E[r];break;case 1:E[r]=e[0];break;default:E[r]=e}else o=null}}else if(y.includes("@id")){const t=j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});o=E[t],delete E[t]}else if(y.includes("@type")){const i=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let a;switch([o,...a]=x(E[i]||[]),a.length){case 0:delete E[i];break;case 1:E[i]=a[0];break;default:E[i]=a}1===Object.keys(E).length&&"@id"in t&&(E=yield j.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:r,compactionMap:p}))}o||(o=j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(i,o,E,{propertyIsArray:y.includes("@set")})}else{const e=!r.compactArrays||y.includes("@set")||y.includes("@list")||o(E)&&0===E.length||"@list"===u||"@graph"===u;w(h,n,E,{propertyIsArray:e})}}}else{if((g(e,t,"@container")||[]).includes("@index"))continue;const n=j.compactIri({activeCtx:e,iri:u,relativeTo:{vocab:!0}});w(_,n,h)}else{const n=yield j.compact({activeCtx:e,activeProperty:t,element:h,options:r,compactionMap:p});o(n)&&0===n.length||w(_,u,n)}else{const t=yield j.compact({activeCtx:e,activeProperty:"@reverse",element:h,options:r,compactionMap:p});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const i=t[n],o=(g(e,n,"@container")||[]).includes("@set")||!r.compactArrays;w(_,n,i,{propertyIsArray:o}),delete t[n]}if(Object.keys(t).length>0){const n=j.compactIri({activeCtx:e,iri:u,relativeTo:{vocab:!0}});w(_,n,t)}}else{let t=x(h).map(e=>j.compactIri({activeCtx:S,iri:e,relativeTo:{vocab:!0}}));1===t.length&&(t=t[0]);const n=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),r=(g(e,n,"@container")||[]).includes("@set")&&b(e,1.1)||o(t)&&0===h.length;w(_,n,t,{propertyIsArray:r})}else{let t=x(h).map(t=>j.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:r.base}));1===t.length&&(t=t[0]),_[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return _}return n});return function(t){return e.apply(this,arguments)}}(),j.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:r={vocab:!1},reverse:o=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const u=e.getInverse();if(y(t)&&t in u&&"@none"in u[t]&&"@type"in u[t]["@none"]&&"@none"in u[t]["@none"]["@type"])return u[t]["@none"]["@type"]["@none"];if(r.vocab&&t in u){const r=e["@language"]||"@none",i=[];a(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),a(n)&&"@preserve"in n&&(n=n["@preserve"][0]),d(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):a(n)&&!l(n)&&i.push("@id","@id@set","@type","@set@type");let s="@language",u="@null";if(o)s="@type",u="@reverse",i.push("@set");else if(c(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)s="@any",u="@none";else{let t=0===e.length?r:null,n=null;for(let r=0;re.includes("_"));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const u=e.inverse[t];for(const a of r){if(!(a in u))continue;const e=u[a][i];for(const t of s)if(t in e)return e[t]}return null}(e,t,n,i,s,u);if(null!==f)return f}if(r.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const r=t.substr(n.length);if(!e.mappings.has(r))return r}}let f=null;const h=[];let p=e.fastCurieMap;const g=t.length-1;for(let i=0;i=0;--i){const r=h[i],o=r.terms;for(const i of o){const o=i+":"+t.substr(r.iri.length);e.mappings.get(i)._prefix&&(!e.mappings.has(o)||null===n&&e.mappings.get(o)["@id"]===t)&&(null===f||S(o,f)<0)&&(f=o)}}if(null!==f)return f;for(const[a,c]of e.mappings)if(c&&c._prefix&&t.startsWith(a+":"))throw new i(`Absolute IRI "${t}" confused with prefix "${a}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});return r.vocab?t:"@base"in e?e["@base"]?v(_(s,e["@base"]),t):t:v(s,t)},j.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(l(n)){const r=g(e,t,"@type"),i=g(e,t,"@language"),o=g(e,t,"@direction"),a=g(e,t,"@container")||[],u="@index"in n&&!a.includes("@index");if(!u&&"@none"!==r&&(n["@type"]===r||"@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===o||"@language"in n&&n["@language"]===i||"@direction"in n&&n["@direction"]===o))return n["@value"];const c=Object.keys(n).length,l=1===c||2===c&&"@index"in n&&!u,d="@language"in e,f=s(n["@value"]),h=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(l&&"@none"!==r&&(!d||!f||h))return n["@value"];const p={};return u&&(p[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?p[j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=j.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(p[j.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(p[j.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),p[j.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],p}const i=p(e,t,{vocab:!0},r),o=g(e,t,"@type"),a=j.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===o},base:r.base});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(e,t,n){"use strict";const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";t.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:r,RDF_LIST:r+"List",RDF_FIRST:r+"first",RDF_REST:r+"rest",RDF_NIL:r+"nil",RDF_TYPE:r+"type",RDF_PLAIN_LITERAL:r+"PlainLiteral",RDF_XML_LITERAL:r+"XMLLiteral",RDF_JSON_LITERAL:r+"JSON",RDF_OBJECT:r+"object",RDF_LANGSTRING:r+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}},{}],19:[function(e,t,n){"use strict";const i=e("./util"),o=e("./JsonLdError"),{isArray:a,isObject:s,isString:u,isUndefined:c}=e("./types"),{isAbsolute:l,isRelative:d,prependBase:f}=e("./url"),{asArray:h,compareShortestLeast:p}=e("./util"),g=new Map,y=/^@[a-zA-Z]+$/,m={};function b(e,t,n,r,i,o){if(null===t||!u(t)||m.isKeyword(t))return t;if(t.match(y))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&m.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:o}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(s(n)&&"@id"in n)return n["@id"]}const a=t.indexOf(":");if(a>0){const n=t.substr(0,a),s=t.substr(a+1);if("_"===n||0===s.indexOf("//"))return t;r&&r.hasOwnProperty(n)&&m.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:o});const u=e.mappings.get(n);if(u&&u._prefix)return u["@id"]+s;if(l(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return f(f(o.base,e["@base"]),t)}else if(n.base)return f(o.base,t);return t}function v(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n{if(r.has(n)){if(r.get(n))return;throw new o("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let d;if(r.set(n,!1),t.hasOwnProperty(n)&&(d=t[n]),"@type"===n&&s(d)&&"@set"===(d["@container"]||"@set")&&m.processingMode(e,1.1)){const e=["@container","@id","@protected"],r=Object.keys(d);if(0===r.length||r.some(t=>!e.includes(t)))throw new o("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(m.isKeyword(n))throw new o("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(y))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new o("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const f=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let h=!1;if((u(d)||null===d)&&(h=!0,d={"@id":d}),!s(d))throw new o("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const p={};e.mappings.set(n,p),p.reverse=!1;const g=["@container","@id","@language","@reverse","@type"];m.processingMode(e,1.1)&&g.push("@context","@direction","@index","@nest","@prefix","@protected");for(const a in d)if(!g.includes(a))throw new o("Invalid JSON-LD syntax; a term definition must not contain "+a,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const _=n.indexOf(":");if(p._termHasColon=_>0,"@reverse"in d){if("@id"in d)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in d)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const a=d["@reverse"];if(!u(a))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(!m.isKeyword(a)&&a.match(y))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:a}),void(f?e.mappings.set(n,f):e.mappings.delete(n));const s=b(e,a,{vocab:!0,base:!1},t,r,i);if(!l(s))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});p["@id"]=s,p.reverse=!0}else if("@id"in d){let a=d["@id"];if(a&&!u(a))throw new o("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===a)p["@id"]=null;else{if(!m.isKeyword(a)&&a.match(y))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:a}),void(f?e.mappings.set(n,f):e.mappings.delete(n));if(a!==n){if(a=b(e,a,{vocab:!0,base:!1},t,r,i),!l(a)&&!m.isKeyword(a))throw new o("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)&&b(e,n,{vocab:!0,base:!1},t,new Map(r).set(n,!0),i)!==a)throw new o("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});p["@id"]=a,p._prefix=h&&!p._termHasColon&&a.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in p))if(p._termHasColon){const o=n.substr(0,_);if(t.hasOwnProperty(o)&&m.createTermDefinition({activeCtx:e,localCtx:t,term:o,defined:r,options:i}),e.mappings.has(o)){const t=n.substr(_+1);p["@id"]=e.mappings.get(o)["@id"]+t}else p["@id"]=n}else if("@type"===n)p["@id"]=n;else{if(!("@vocab"in e))throw new o("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});p["@id"]=e["@vocab"]+n}if((!0===d["@protected"]||!0===r.get("@protected")&&!1!==d["@protected"])&&(e.protected[n]=!0,p.protected=!0),r.set(n,!0),"@type"in d){let n=d["@type"];if(!u(n))throw new o("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(m.processingMode(e,1))throw new o(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=b(e,n,{vocab:!0,base:!1},t,r,i),!l(n))throw new o("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new o("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}p["@type"]=n}if("@container"in d){const n=u(d["@container"])?[d["@container"]]:d["@container"]||[],r=["@list","@set","@index","@language"];let i=!0;const s=n.includes("@set");if(m.processingMode(e,1.1)){if(r.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new o("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some(e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e))throw new o("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else i&=n.length<=(s?2:1);if(n.includes("@type")&&(p["@type"]=p["@type"]||"@id",!["@id","@vocab"].includes(p["@type"])))throw new o("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else i&=!a(d["@container"]),i&=n.length<=1;if(i&=n.every(e=>r.includes(e)),i&=!(s&&n.includes("@list")),!i)throw new o("Invalid JSON-LD syntax; @context @container value must be one of the following: "+r.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(p.reverse&&!n.every(e=>["@index","@set"].includes(e)))throw new o("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});p["@container"]=n}if("@index"in d){if(!("@container"in d)||!p["@container"].includes("@index"))throw new o(`Invalid JSON-LD syntax; @index without @index in @container: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!u(d["@index"])||0===d["@index"].indexOf("@"))throw new o(`Invalid JSON-LD syntax; @index must expand to an IRI: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});p["@index"]=d["@index"]}if("@context"in d&&(p["@context"]=d["@context"]),"@language"in d&&!("@type"in d)){let e=d["@language"];if(null!==e&&!u(e))throw new o("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),p["@language"]=e}if("@prefix"in d){if(n.match(/:|\//))throw new o("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(m.isKeyword(p["@id"]))throw new o("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof d["@prefix"])throw new o("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});p._prefix=!0===d["@prefix"]}if("@direction"in d){const e=d["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new o('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});p["@direction"]=e}if("@nest"in d){const e=d["@nest"];if(!u(e)||"@nest"!==e&&0===e.indexOf("@"))throw new o("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});p["@nest"]=e}const w=p["@id"];if("@context"===w||"@preserve"===w)throw new o("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(f&&f.protected&&!c&&(e.protected[n]=!0,p.protected=!0,!v(f,p))){const e=i&&i.protectedMode||"error";if("error"===e)throw new o(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:n});throw new o("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:n,protectedMode:e})}},m.expandIri=(e,t,n,r)=>b(e,t,n,void 0,void 0,r),m.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=g.get(t);if(n)return n;const r={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},r={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],u=e.mappings,c=[...u.keys()].sort(p);for(const o of c){const e=u.get(o);if(null===e)continue;let c=e["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===e["@id"])continue;const l=h(e["@id"]);for(const u of l){let l=t[u];const d=m.isKeyword(u);if(l)!d&&!e._termHasColon&&r[u].push(o);else if(t[u]=l={},!d&&!e._termHasColon){r[u]=[o];const e={iri:u,terms:r[u]};u[0]in n?n[u[0]].push(e):n[u[0]]=[e]}if(l[c]||(l[c]={"@language":{},"@type":{},"@any":{}}),l=l[c],a(o,l["@any"],"@none"),e.reverse)a(o,l["@type"],"@reverse");else if("@none"===e["@type"])a(o,l["@any"],"@none"),a(o,l["@language"],"@none"),a(o,l["@type"],"@none");else if("@type"in e)a(o,l["@type"],e["@type"]);else if("@language"in e&&"@direction"in e){const t=e["@language"],n=e["@direction"];a(o,l["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in e?a(o,l["@language"],(e["@language"]||"@null").toLowerCase()):"@direction"in e?a(o,l["@language"],e["@direction"]?`_${e["@direction"]}`:"@none"):s?(a(o,l["@language"],`_${s}`),a(o,l["@language"],"@none"),a(o,l["@type"],"@none")):(a(o,l["@language"],i),a(o,l["@language"],"@none"),a(o,l["@type"],"@none"))}}for(const a in n)o(n,a,1);return t},clone:function(){const e={};return e.mappings=i.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=i.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===g.size&&g.clear(),g.set(t,r),r;function o(e,t,n){const r=e[t],i=e[t]={};let a,s;for(const o of r)a=o.iri,s=n>=a.length?"":a[n],s in i?i[s].push(o):i[s]=[o];for(const u in i)""!==u&&o(i,u,n+1)}function a(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},m.getContextValue=(e,t,n)=>{if(null===t)return"@context"===n?void 0:null;if(e.mappings.has(t)){const r=e.mappings.get(t);if(c(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},m.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,m.isKeyword=e=>{if(!u(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(e,t,n){"use strict";const{parseLinkHeader:i,buildHeaders:o}=e("../util"),{LINK_HEADER_CONTEXT:a}=e("../constants"),s=e("../JsonLdError"),u=e("../RequestQueue"),{prependBase:c}=e("../url"),l=/(^|(\r\n))link:/i;function d(e,t,n){const r=new(e=e||XMLHttpRequest);return new Promise((e,i)=>{r.onload=()=>e(r),r.onerror=e=>i(e),r.open("GET",t,!0);for(const t in n)r.setRequestHeader(t,n[t]);r.send()})}t.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>{return t=o(t),(new u).wrapLoader(f);function f(e){return h.apply(this,arguments)}function h(){return(h=r(function*(r){if(0!==r.indexOf("http:")&&0!==r.indexOf("https:"))throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:r});if(e&&0!==r.indexOf("https"))throw new s('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:r});let o;try{o=yield d(n,r,t)}catch(y){throw new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:r,cause:y})}if(o.status>=400)throw new s("URL could not be dereferenced: "+o.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:r,httpStatusCode:o.status});let u={contextUrl:null,documentUrl:r,document:o.response},h=null;const p=o.getResponseHeader("Content-Type");let g;if(l.test(o.getAllResponseHeaders())&&(g=o.getResponseHeader("Link")),g&&"application/ld+json"!==p){const e=i(g),t=e[a];if(Array.isArray(t))throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:r});t&&(u.contextUrl=t.target),h=e.alternate,h&&"application/ld+json"==h.type&&!(p||"").match(/^application\/(\w*\+)?json$/)&&(u=yield f(c(r,h.target)))}return u})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(e,t,n){"use strict";const i=e("./JsonLdError"),{isArray:o,isObject:a,isEmptyObject:s,isString:u,isUndefined:c}=e("./types"),{isList:l,isValue:d,isGraph:f,isSubject:h}=e("./graphTypes"),{expandIri:p,getContextValue:g,isKeyword:y,process:m,processingMode:b}=e("./context"),{isAbsolute:v}=e("./url"),{addValue:_,asArray:w,getValues:x,validateTypeValue:S}=e("./util"),j={};t.exports=j;const N=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function E(e){return T.apply(this,arguments)}function T(){return(T=r(function*({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:r,expandedParent:f,options:x={},insideList:T,typeKey:I,typeScopedContext:R,expansionMap:O}){const L=Object.keys(r).sort(),M=[];let D;const P=r[I]&&"@json"===p(e,o(r[I])?r[I][0]:r[I],{vocab:!0},x);for(const E of L){let I,L=r[E];if("@context"===E)continue;let C=p(e,E,{vocab:!0},x);if((null===C||!v(C)&&!y(C))&&(C=O({unmappedProperty:E,activeCtx:e,activeProperty:t,parent:r,options:x,insideList:T,value:L,expandedParent:f}),void 0===C))continue;if(y(C)){if("@reverse"===n)throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:L});if(C in f&&"@included"!==C&&"@type"!==C)throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!u(L)){if(!x.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(a(L)){if(!s(L))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:L})}else{if(!o(L))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:L});if(!L.every(e=>u(e)))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:L})}}_(f,"@id",w(L).map(t=>u(t)?p(e,t,{base:!0},x):t),{propertyIsArray:x.isFrame});continue}if("@type"===C){a(L)&&(L=Object.fromEntries(Object.entries(L).map(([e,t])=>[p(R,e,{vocab:!0}),w(t).map(e=>p(R,e,{base:!0,vocab:!0}))]))),S(L,x.isFrame),_(f,"@type",w(L).map(e=>u(e)?p(R,e,{base:!0,vocab:!0},x):e),{propertyIsArray:x.isFrame});continue}if("@included"===C&&b(e,1.1)){const n=w(yield j.expand({activeCtx:e,activeProperty:t,element:L,options:x,expansionMap:O}));if(!n.every(e=>h(e)))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:L});_(f,"@included",n,{propertyIsArray:!0});continue}if("@graph"===C&&!a(L)&&!o(L))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:L});if("@value"===C){D=L,P&&b(e,1.1)?f["@value"]=L:_(f,"@value",L,{propertyIsArray:x.isFrame});continue}if("@language"===C){if(null===L)continue;if(!u(L)&&!x.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:L});L=w(L).map(e=>u(e)?e.toLowerCase():e);for(const e of L)u(e)&&!e.match(N)&&console.warn(`@language must be valid BCP47: ${e}`);_(f,"@language",L,{propertyIsArray:x.isFrame});continue}if("@direction"===C){if(!u(L)&&!x.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:L});L=w(L);for(const e of L)if(u(e)&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:L});_(f,"@direction",L,{propertyIsArray:x.isFrame});continue}if("@index"===C){if(!u(L))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:L});_(f,"@index",L);continue}if("@reverse"===C){if(!a(L))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:L});if(I=yield j.expand({activeCtx:e,activeProperty:"@reverse",element:L,options:x,expansionMap:O}),"@reverse"in I)for(const e in I["@reverse"])_(f,e,I["@reverse"][e],{propertyIsArray:!0});let t=f["@reverse"]||null;for(const e in I){if("@reverse"===e)continue;null===t&&(t=f["@reverse"]={}),_(t,e,[],{propertyIsArray:!0});const n=I[e];for(let r=0;r"@id"===e||"@index"===e)&&(I=w(I).map(e=>({"@graph":w(e)}))),F.mappings.has(E)&&F.mappings.get(E).reverse){const e=f["@reverse"]=f["@reverse"]||{};I=w(I);for(let t=0;t"@value"===p(e,t,{vocab:!0},x)))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:r});yield E({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:r,expandedParent:f,options:x,insideList:T,typeScopedContext:R,typeKey:I,expansionMap:O})}}})).apply(this,arguments)}function I({activeCtx:e,activeProperty:t,value:n,options:r}){if(null==n)return null;const i=p(e,t,{vocab:!0},r);if("@id"===i)return p(e,n,{base:!0},r);if("@type"===i)return p(e,n,{vocab:!0,base:!0},r);const o=g(e,t,"@type");if(("@id"===o||"@graph"===i)&&u(n))return{"@id":p(e,n,{base:!0},r)};if("@vocab"===o&&u(n))return{"@id":p(e,n,{vocab:!0,base:!0},r)};if(y(i))return n;const a={};if(o&&!["@id","@vocab","@none"].includes(o))a["@type"]=o;else if(u(n)){const n=g(e,t,"@language");null!==n&&(a["@language"]=n);const r=g(e,t,"@direction");null!==r&&(a["@direction"]=r)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),a["@value"]=n,a}function A(e,t,n,r){const a=[],s=Object.keys(t).sort();for(const c of s){const s=p(e,c,{vocab:!0},r);let l=t[c];o(l)||(l=[l]);for(const e of l){if(null===e)continue;if(!u(e))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const r={"@value":e};"@none"!==s&&(r["@language"]=c.toLowerCase()),n&&(r["@direction"]=n),a.push(r)}}return a}function k(e){return R.apply(this,arguments)}function R(){return(R=r(function*({activeCtx:e,options:t,activeProperty:n,value:r,expansionMap:a,asGraph:s,indexKey:u,propertyIndex:l}){const h=[],y=Object.keys(r).sort(),b="@type"===u;for(let v of y){if(b){const n=g(e,v,"@context");c(n)||(e=yield m({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let y,w=r[v];o(w)||(w=[w]),w=yield j.expand({activeCtx:e,activeProperty:n,element:w,options:t,insideList:!1,insideIndex:!0,expansionMap:a}),y=l?"@none"===v?"@none":I({activeCtx:e,activeProperty:u,value:v,options:t}):p(e,v,{vocab:!0},t),"@id"===u?v=p(e,v,{base:!0},t):b&&(v=y);for(let e of w){if(s&&!f(e)&&(e={"@graph":[e]}),"@type"===u)"@none"===y||(e["@type"]=e["@type"]?[v].concat(e["@type"]):[v]);else{if(d(e)&&!["@language","@type","@index"].includes(u))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${u}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});l?"@none"!==y&&_(e,l,y,{propertyIsArray:!0,prependValue:!0}):"@none"!==y&&!(u in e)&&(e[u]=v)}h.push(e)}}return h})).apply(this,arguments)}j.expand=function(){var e=r(function*({activeCtx:e,activeProperty:t=null,element:n,options:r={},insideList:l=!1,insideIndex:d=!1,typeScopedContext:f=null,expansionMap:h=(()=>{})}){if(null==n)return null;if("@default"===t&&(r=Object.assign({},r,{isFrame:!1})),!o(n)&&!a(n)){if(!l&&(null===t||"@graph"===p(e,t,{vocab:!0},r))){const i=yield h({unmappedValue:n,activeCtx:e,activeProperty:t,options:r,insideList:l});return void 0===i?null:i}return I({activeCtx:e,activeProperty:t,value:n,options:r})}if(o(n)){let i=[];const a=g(e,t,"@container")||[];l=l||a.includes("@list");for(let s=0;s1?t.slice().sort():t:[t];for(const n of o){const t=g(f,n,"@context");c(t)||(e=yield m({activeCtx:e,localCtx:t,options:r,propagate:!1}))}}let A={};yield E({activeCtx:e,activeProperty:t,expandedActiveProperty:y,element:n,expandedParent:A,options:r,insideList:l,typeKey:T,typeScopedContext:f,expansionMap:h}),S=Object.keys(A);let k=S.length;if("@value"in A){if("@type"in A&&("@language"in A||"@direction"in A))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:A});let o=k-1;if("@type"in A&&(o-=1),"@index"in A&&(o-=1),"@language"in A&&(o-=1),"@direction"in A&&(o-=1),0!==o)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:A});const a=null===A["@value"]?[]:w(A["@value"]),c=x(A,"@type");if(!b(e,1.1)||!c.includes("@json")||1!==c.length)if(0===a.length){const i=yield h({unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:r,insideList:l});A=void 0!==i?i:null}else{if(!a.every(e=>u(e)||s(e))&&"@language"in A)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:A});if(!c.every(e=>v(e)&&!(u(e)&&0===e.indexOf("_:"))||s(e)))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:A})}}else if("@type"in A&&!o(A["@type"]))A["@type"]=[A["@type"]];else if("@set"in A||"@list"in A){if(k>1&&(2!==k||!("@index"in A)))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:A});"@set"in A&&(A=A["@set"],S=Object.keys(A),k=S.length)}else if(1===k&&"@language"in A){const i=yield h(A,{unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:r,insideList:l});A=void 0!==i?i:null}if(a(A)&&!r.keepFreeFloatingNodes&&!l&&(null===t||"@graph"===y)&&(0===k||"@value"in A||"@list"in A||1===k&&"@id"in A)){const i=yield h({unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:r,insideList:l});A=void 0!==i?i:null}return A});return function(t){return e.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(e,t,n){"use strict";const{isSubjectReference:r}=e("./graphTypes"),{createMergedNodeMap:i}=e("./nodeMap"),o={};t.exports=o,o.flatten=e=>{const t=i(e),n=[],o=Object.keys(t).sort();for(let i=0;i=0;--r){const i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,n){const r="@"+n;let i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new u("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new u("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of a.asArray(e[0]["@id"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new u("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of a.asArray(e[0]["@type"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new u("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,n,s){let u=!0,c=!1;for(const l in n){let d=!1;const f=a.getValues(t,l),h=0===a.getValues(n,l).length;if("@id"===l){if(o.isEmptyObject(n["@id"][0]||{})?d=!0:n["@id"].length>=0&&(d=n["@id"].includes(f[0])),!s.requireAll)return d}else if("@type"===l){if(u=!1,h){if(f.length>0)return!1;d=!0}else if(1===n["@type"].length&&o.isEmptyObject(n["@type"][0]))d=f.length>0;else for(const e of n["@type"])d=!(!o.isObject(e)||!("@default"in e))||d||f.some(t=>t===e);if(!s.requireAll)return d}else{if(r(l))continue;{const t=a.getValues(n,l)[0];let r=!1;if(t&&(g([t]),r="@default"in t),u=!1,0===f.length&&r)continue;if(f.length>0&&h)return!1;if(void 0===t){if(f.length>0)return!1;d=!0}else if(i.isList(t)){const n=t["@list"][0];if(i.isList(f[0])){const t=f[0]["@list"];i.isValue(n)?d=t.some(e=>w(n,e)):(i.isSubject(n)||i.isSubjectReference(n))&&(d=t.some(t=>_(e,n,t,s)))}}else d=i.isValue(t)?f.some(e=>w(t,e)):i.isSubjectReference(t)?f.some(n=>_(e,t,n,s)):!!o.isObject(t)&&f.length>0}}if(!d&&s.requireAll)return!1;c=c||d}return u||c}function m(e,t){const n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,s=r.property,u={"@id":t};if(o.isArray(i)){for(let e=0;e{const t=Object.keys(n);for(const r of t)r in n&&o.isObject(n[r].parent)&&n[r].parent["@id"]===e&&(delete n[r],c(r))};c(t)}function b(e,t){if(o.isArray(e))return e.map(e=>b(e,t));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=b(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=b(e[n],t)}return e}function v(e,t,n){o.isObject(e)?a.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function _(e,t,n,r){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&y(e,i,t,r)}function w(e,t){const n=t["@value"],r=t["@type"],i=t["@language"],a=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],u=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===a.length&&0===s.length&&0===u.length||!(!a.includes(n)&&!o.isEmptyObject(a[0])||!(!r&&0===s.length||s.includes(r)||r&&o.isEmptyObject(s[0]))||!(!i&&0===u.length||u.includes(i)||i&&o.isEmptyObject(u[0])))}t.exports=d,d.frameMergedOrDefault=(e,t,n)=>{const r={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new a.IdentifierIssuer("_:b");c(e,r.graphMap,"@default",i),n.merged&&(r.graphMap["@merged"]=l(r.graphMap),r.graph="@merged"),r.subjects=r.graphMap[r.graph];const o=[];return d.frame(r,Object.keys(r.subjects).sort(),t,o),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter(e=>1===r.bnodeMap[e].length)),n.link={},b(o,n)},d.frame=(e,t,n,s,c=null)=>{g(n);const l=e.options,b={embed:p(n=n[0],l,"embed"),explicit:p(n,l,"explicit"),requireAll:p(n,l,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const _=e.link[e.graph],x=function(e,t,n,r){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,n,r)&&(i[o]=t)}return i}(e,t,n,b),S=Object.keys(x).sort();for(const g of S){const y=x[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===b.embed&&g in _){v(s,c,_[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&a.addValue(e.bnodeMap,g,S,{propertyIsArray:!0}),_[g]=S,("@first"===b.embed||"@last"===b.embed)&&e.is11)throw new u("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if(e.embedded&&("@never"===b.embed||h(y,e.graph,e.subjectStack))){v(s,c,S);continue}if(e.embedded&&("@first"==b.embed||"@once"==b.embed)&&e.uniqueEmbeds[e.graph].hasOwnProperty(g)){v(s,c,S);continue}if("@last"===b.embed&&g in e.uniqueEmbeds[e.graph]&&m(e,g),e.uniqueEmbeds[e.graph][g]={parent:s,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,r=null;"@graph"in n?(r=n["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(r)||(r={})):(t="@merged"!==e.graph,r={}),t&&d.frame($i(or({},e),{graph:g,embedded:!1}),Object.keys(e.graphMap[g]).sort(),[r],S,"@graph")}"@included"in n&&d.frame($i(or({},e),{embedded:!1}),t,n["@included"],S,"@included");for(const t of Object.keys(y).sort())if(r(t)){if(S[t]=a.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&a.addValue(e.bnodeMap,t,S,{propertyIsArray:!0})}else if(!b.explicit||t in n)for(const r of y[t]){const o=t in n?n[t]:f(b);if(i.isList(r)){const o=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:f(b),s={"@list":[]};v(S,t,s);const u=r["@list"];for(const t of u)i.isSubjectReference(t)?d.frame($i(or({},e),{embedded:!0}),[t["@id"]],o,s,"@list"):v(s,"@list",a.clone(t))}else i.isSubjectReference(r)?d.frame($i(or({},e),{embedded:!0}),[r["@id"]],o,S,t):w(o[0],r)&&v(S,t,a.clone(r))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!o.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(r(e))continue;const t=n[e][0]||{};if(!p(t,l,"omitDefault")&&!(e in S)){let n="@null";"@default"in t&&(n=a.clone(t["@default"])),o.isArray(n)||(n=[n]),S[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const r=n["@reverse"][t];for(const n of Object.keys(e.subjects))a.getValues(e.subjects[n],t).some(e=>e["@id"]===g)&&(S["@reverse"]=S["@reverse"]||{},a.addValue(S["@reverse"],t,[],{propertyIsArray:!0}),d.frame($i(or({},e),{embedded:!0}),[n],r,S["@reverse"][t],c))}v(s,c,S),e.subjectStack.pop()}}},d.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map(e=>d.cleanupNull(e,t)).filter(e=>e);if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=d.cleanupNull(e[n],t)}return e}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(e,t,n){"use strict";const i=e("./JsonLdError"),o=e("./graphTypes"),a=e("./types"),s=e("./util"),{RDF_LIST:u,RDF_FIRST:c,RDF_REST:l,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:h,XSD_BOOLEAN:p,XSD_DOUBLE:g,XSD_INTEGER:y,XSD_STRING:m}=e("./constants"),b=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,v={};function _(e,t,n){if(e.termType.endsWith("Node"))return{"@id":e.value};const r={"@value":e.value};if(e.language)r["@language"]=e.language;else{let s=e.datatype.value;if(s||(s=m),s===h){s="@json";try{r["@value"]=JSON.parse(r["@value"])}catch(o){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:r["@value"],cause:o})}}if(t){if(s===p)"true"===r["@value"]?r["@value"]=!0:"false"===r["@value"]&&(r["@value"]=!1);else if(a.isNumeric(r["@value"]))if(s===y){const e=parseInt(r["@value"],10);e.toFixed(0)===r["@value"]&&(r["@value"]=e)}else s===g&&(r["@value"]=parseFloat(r["@value"]));[p,y,g,m].includes(s)||(r["@type"]=s)}else if("i18n-datatype"===n&&s.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=s.split(/[#_]/);e.length>0&&(r["@language"]=e,e.match(b)||console.warn(`@language must be valid BCP47: ${e}`)),r["@direction"]=t}else s!==m&&(r["@type"]=s)}return r}t.exports=v,v.fromRDF=function(){var e=r(function*(e,{useRdfType:t=!1,useNativeTypes:n=!1,rdfDirection:r=null}){const i={},h={"@default":i},p={};for(const o of e){const e="DefaultGraph"===o.graph.termType?"@default":o.graph.value;e in h||(h[e]={}),"@default"!==e&&!(e in i)&&(i[e]={"@id":e});const a=h[e],u=o.subject.value,c=o.predicate.value,l=o.object;u in a||(a[u]={"@id":u});const g=a[u],y=l.termType.endsWith("Node");if(y&&!(l.value in a)&&(a[l.value]={"@id":l.value}),c===f&&!t&&y){s.addValue(g,"@type",l.value,{propertyIsArray:!0});continue}const m=_(l,n,r);if(s.addValue(g,c,m,{propertyIsArray:!0}),y)if(l.value===d){const e=a[l.value];"usages"in e||(e.usages=[]),e.usages.push({node:g,property:c,value:m})}else p[l.value]=!(l.value in p)&&{node:g,property:c,value:m}}for(const s in h){const e=h[s];if(!(d in e))continue;const t=e[d];if(t.usages){for(let n of t.usages){let t=n.node,r=n.property,i=n.value;const s=[],d=[];let f=Object.keys(t).length;for(;r===l&&a.isObject(p[t["@id"]])&&a.isArray(t[c])&&1===t[c].length&&a.isArray(t[l])&&1===t[l].length&&(3===f||4===f&&a.isArray(t["@type"])&&1===t["@type"].length&&t["@type"][0]===u)&&(s.push(t[c][0]),d.push(t["@id"]),n=p[t["@id"]],t=n.node,r=n.property,i=n.value,f=Object.keys(t).length,o.isBlankNode(t)););delete i["@id"],i["@list"]=s.reverse();for(const n of d)delete e[n]}delete t.usages}}const g=[],y=Object.keys(i).sort();for(const a of y){const e=i[a];if(a in h){const t=e["@graph"]=[],n=h[a],r=Object.keys(n).sort();for(const e of r){const r=n[e];o.isSubjectReference(r)||t.push(r)}}o.isSubjectReference(e)||g.push(e)}return g});return function(t,n){return e.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(e,t,n){"use strict";const r=e("./types"),i={};t.exports=i,i.isSubject=e=>!(!r.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>r.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>r.isObject(e)&&"@value"in e,i.isList=e=>r.isObject(e)&&"@list"in e,i.isGraph=e=>r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(e=>"@id"!==e&&"@index"!==e).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>!!r.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))},{"./types":30}],26:[function(e,t,n){const i=e("rdf-canonize"),o=e("./platform"),a=e("./util"),s=e("./ContextResolver"),u=a.IdentifierIssuer,c=e("./JsonLdError"),l=e("lru-cache"),d=e("./NQuads"),{expand:f}=e("./expand"),{flatten:h}=e("./flatten"),{fromRDF:p}=e("./fromRdf"),{toRDF:g}=e("./toRdf"),{frameMergedOrDefault:y,cleanupNull:m}=e("./frame"),{isArray:b,isObject:v,isString:_}=e("./types"),{isSubjectReference:w}=e("./graphTypes"),{expandIri:x,getInitialContext:S,process:j,processingMode:N}=e("./context"),{compact:E,compactIri:T}=e("./compact"),{createNodeMap:I,createMergedNodeMap:A,mergeNodeMaps:k}=e("./nodeMap"),R=function(t){const n={},R=new l({max:100});function O(e,n){var r=n,{documentLoader:i=t.documentLoader}=r,o=Nc(r,["documentLoader"]);return Object.assign({},{documentLoader:i},o,e)}return t.compact=function(){var e=r(function*(e,n,r){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===e)return null;let i;(r=O(r,{base:_(e)?e:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new u("_:b"),contextResolver:new s({sharedCache:R})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,i=r.skipExpansion?e:yield t.expand(e,r);const o=yield t.processContext(S(r),n,r);let l=yield E({activeCtx:o,element:i,options:r,compactionMap:r.compactionMap});r.compactArrays&&!r.graph&&b(l)?1===l.length?l=l[0]:0===l.length&&(l={}):r.graph&&v(l)&&(l=[l]),v(n)&&"@context"in n&&(n=n["@context"]),n=a.clone(n),b(n)||(n=[n]);const d=n;n=[];for(let t=0;t0)&&n.push(d[t]);const f=n.length>0;if(1===n.length&&(n=n[0]),b(l)){const e=T({activeCtx:o,iri:"@graph",relativeTo:{vocab:!0}}),t=l;l={},f&&(l["@context"]=n),l[e]=t}else if(v(l)&&f){const e=l;l={"@context":n};for(const t in e)l[t]=e[t]}return l});return function(t,n,r){return e.apply(this,arguments)}}(),t.expand=function(){var e=r(function*(e,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=O(n,{keepFreeFloatingNodes:!1,contextResolver:new s({sharedCache:R})})).expansionMap&&(n.expansionMap=void 0);const r={},i=[];if("expandContext"in n){const e=a.clone(n.expandContext);r.expandContext=v(e)&&"@context"in e?e:{"@context":e},i.push(r.expandContext)}let o;if(_(e)){const a=yield t.get(e,n);o=a.documentUrl,r.input=a.document,a.contextUrl&&(r.remoteContext={"@context":a.contextUrl},i.push(r.remoteContext))}else r.input=a.clone(e);"base"in n||(n.base=o||"");let u=S(n);for(const t of i)u=yield j({activeCtx:u,localCtx:t,options:n});let c=yield f({activeCtx:u,element:r.input,options:n,expansionMap:n.expansionMap});return v(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),b(c)||(c=[c]),c});return function(t,n){return e.apply(this,arguments)}}(),t.flatten=function(){var e=r(function*(e,n,r){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,r=O(r,{base:_(e)?e:"",contextResolver:new s({sharedCache:R})});const i=yield t.expand(e,r),o=h(i);return null===n?o:(r.graph=!0,r.skipExpansion=!0,yield t.compact(o,n,r))});return function(t,n,r){return e.apply(this,arguments)}}(),t.frame=function(){var e=r(function*(e,n,r){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(r=O(r,{base:_(e)?e:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new s({sharedCache:R})}),_(n)){const e=yield t.get(n,r);if(n=e.document,e.contextUrl){let t=n["@context"];t?b(t)?t.push(e.contextUrl):t=[t,e.contextUrl]:t=e.contextUrl,n["@context"]=t}}const i=n&&n["@context"]||{},o=yield t.processContext(S(r),i,r);r.hasOwnProperty("omitGraph")||(r.omitGraph=N(o,1.1)),r.hasOwnProperty("pruneBlankNodeIdentifiers")||(r.pruneBlankNodeIdentifiers=N(o,1.1));const a=yield t.expand(e,r),u=or({},r);u.isFrame=!0,u.keepFreeFloatingNodes=!0;const c=yield t.expand(n,u),l=Object.keys(n).map(e=>x(o,e,{vocab:!0}));u.merged=!l.includes("@graph"),u.is11=N(o,1.1);const d=y(a,c,u);u.graph=!r.omitGraph,u.skipExpansion=!0,u.link={},u.framing=!0;let f=yield t.compact(d,i,u);return u.link={},f=m(f,u),f});return function(t,n,r){return e.apply(this,arguments)}}(),t.link=function(){var e=r(function*(e,n,r){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",t.frame(e,i,r)});return function(t,n,r){return e.apply(this,arguments)}}(),t.normalize=t.canonize=function(){var e=r(function*(e,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=O(n,{base:_(e)?e:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new s({sharedCache:R})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const t=d.parse(e);return i.canonize(t,n)}const r=or({},n);delete r.format,r.produceGeneralizedRdf=!1;const o=yield t.toRDF(e,r);return i.canonize(o,n)});return function(t,n){return e.apply(this,arguments)}}(),t.fromRDF=function(){var e=r(function*(e,t){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");t=O(t,{format:_(e)?"application/n-quads":void 0});const{format:r}=t;let{rdfParser:i}=t;if(r){if(i=i||n[r],!i)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:r})}else i=()=>e;const o=yield i(e);return p(o,t)});return function(t,n){return e.apply(this,arguments)}}(),t.toRDF=function(){var e=r(function*(e,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let r;r=(n=O(n,{base:_(e)?e:"",skipExpansion:!1,contextResolver:new s({sharedCache:R})})).skipExpansion?e:yield t.expand(e,n);const i=g(r,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return d.serialize(i);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i});return function(t,n){return e.apply(this,arguments)}}(),t.createNodeMap=function(){var e=r(function*(e,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=O(n,{base:_(e)?e:"",contextResolver:new s({sharedCache:R})});const r=yield t.expand(e,n);return A(r,n)});return function(t,n){return e.apply(this,arguments)}}(),t.merge=function(){var e=r(function*(e,n,r){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!b(e))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,r=O(r,{contextResolver:new s({sharedCache:R})});const i=yield Promise.all(e.map(e=>{const n=or({},r);return t.expand(e,n)}));let o=!0;"mergeNodes"in r&&(o=r.mergeNodes);const c=r.issuer||new u("_:b"),l={"@default":{}};for(let t=0;tt._documentLoader,set:e=>t._documentLoader=e}),t.documentLoader=function(){var e=r(function*(e){throw new c("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})});return function(t){return e.apply(this,arguments)}}(),t.get=function(){var e=r(function*(e,n){let r;r="function"==typeof n.documentLoader?n.documentLoader:t.documentLoader;const i=yield r(e);try{if(!i.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");_(i.document)&&(i.document=JSON.parse(i.document))}catch(o){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:o,remoteDoc:i})}return i});return function(t,n){return e.apply(this,arguments)}}(),t.processContext=function(){var e=r(function*(e,t,n){return n=O(n,{base:"",contextResolver:new s({sharedCache:R})}),null===t?S(n):(t=a.clone(t),v(t)&&"@context"in t||(t={"@context":t}),j({activeCtx:e,localCtx:t,options:n}))});return function(t,n,r){return e.apply(this,arguments)}}(),t.getContextValue=e("./context").getContextValue,t.documentLoaders={},t.useDocumentLoader=function(e){if(!(e in t.documentLoaders))throw new c('Unknown document loader type: "'+e+'"',"jsonld.UnknownDocumentLoader",{type:e});t.documentLoader=t.documentLoaders[e].apply(t,Array.prototype.slice.call(arguments,1))},t.registerRDFParser=function(e,t){n[e]=t},t.unregisterRDFParser=function(e){delete n[e]},t.registerRDFParser("application/n-quads",d.parse),t.registerRDFParser("application/nquads",d.parse),t.url=e("./url"),t.util=a,Object.assign(t,a),t.promises=t,t.RequestQueue=e("./RequestQueue"),t.JsonLdProcessor=e("./JsonLdProcessor")(t),o.setupGlobals(t),o.setupDocumentLoaders(t),t},O=function(){return R(function(){return O()})};R(O),t.exports=O},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(e,t,n){"use strict";const{isKeyword:r}=e("./context"),i=e("./graphTypes"),o=e("./types"),a=e("./util"),s=e("./JsonLdError"),u={};t.exports=u,u.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new a.IdentifierIssuer("_:b"),r={"@default":{}};return u.createNodeMap(e,r,"@default",n),u.mergeNodeMaps(r)},u.createNodeMap=(e,t,n,c,l,d)=>{if(o.isArray(e)){for(const r of e)u.createNodeMap(r,t,n,c,void 0,d);return}if(!o.isObject(e))return void(d&&d.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(d&&d.push(e))}if(d&&i.isList(e)){const r=[];return u.createNodeMap(e["@list"],t,n,c,l,r),void d.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(l)&&(l=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),d&&d.push({"@id":l});const f=t[n],h=f[l]=f[l]||{};h["@id"]=l;const p=Object.keys(e).sort();for(let o of p){if("@id"===o)continue;if("@reverse"===o){const r={"@id":l},o=e["@reverse"];for(const e in o){const s=o[e];for(const o of s){let s=o["@id"];i.isBlankNode(o)&&(s=c.getId(s)),u.createNodeMap(o,t,n,c,s),a.addValue(f[s],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){l in t||(t[l]={}),u.createNodeMap(e[o],t,l,c);continue}if("@included"===o){u.createNodeMap(e[o],t,n,c);continue}if("@type"!==o&&r(o)){if("@index"===o&&o in h&&(e[o]!==h[o]||e[o]["@id"]!==h[o]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:h});h[o]=e[o];continue}const d=e[o];if(0===o.indexOf("_:")&&(o=c.getId(o)),0!==d.length)for(let e of d)if("@type"===o&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const r=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];a.addValue(h,o,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),u.createNodeMap(e,t,n,c,r)}else if(i.isValue(e))a.addValue(h,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];u.createNodeMap(e["@list"],t,n,c,l,r),e={"@list":r},a.addValue(h,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else u.createNodeMap(e,t,n,c,l),a.addValue(h,o,e,{propertyIsArray:!0,allowDuplicate:!1});else a.addValue(h,o,[],{propertyIsArray:!0})}},u.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const o=e[n][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(o).sort())if(r(e)&&"@type"!==e)s[e]=a.clone(o[e]);else for(const t of o[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},u.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if("@default"===r)continue;const n=e[r];let o=t[r];o?"@graph"in o||(o["@graph"]=[]):t[r]=o={"@id":r,"@graph":[]};const a=o["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||a.push(t)}}return t}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(e,t,n){"use strict";const r=e("./documentLoaders/xhr"),i={};t.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=r,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(e,t,n){"use strict";const{createNodeMap:r}=e("./nodeMap"),{isKeyword:i}=e("./context"),o=e("./graphTypes"),a=e("canonicalize"),s=e("./types"),u=e("./util"),{RDF_FIRST:c,RDF_REST:l,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:h,RDF_LANGSTRING:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:m,XSD_STRING:b}=e("./constants"),{isAbsolute:v}=e("./url"),_={};function w(e,t,n,r,o){const a=Object.keys(t).sort();for(const s of a){const a=t[s],u=Object.keys(a).sort();for(let t of u){const u=a[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of u){const a={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!v(s))continue;const u={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!v(t)||"BlankNode"===u.termType&&!o.produceGeneralizedRdf)continue;const c=x(i,r,e,n,o.rdfDirection);c&&e.push({subject:a,predicate:u,object:c,graph:n})}}}}function x(e,t,n,r,i){const u={};if(o.isValue(e)){u.termType="Literal",u.value=void 0,u.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;"@json"===n?(u.value=a(t),u.datatype.value=h):s.isBoolean(t)?(u.value=t.toString(),u.datatype.value=n||g):s.isDouble(t)||n===y?(s.isDouble(t)||(t=parseFloat(t)),u.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),u.datatype.value=n||y):s.isNumber(t)?(u.value=t.toFixed(0),u.datatype.value=n||m):"i18n-datatype"===i&&"@direction"in e?(u.datatype.value="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`,u.value=t):"@language"in e?(u.value=t,u.datatype.value=n||p,u.language=e["@language"]):(u.value=t,u.datatype.value=n||b)}else if(o.isList(e)){const o=function(e,t,n,r,i){const o={termType:"NamedNode",value:c},a={termType:"NamedNode",value:l},s={termType:"NamedNode",value:d},u=e.pop(),f=u?{termType:"BlankNode",value:t.getId()}:s;let h=f;for(const c of e){const e=x(c,t,n,r,i),s={termType:"BlankNode",value:t.getId()};n.push({subject:h,predicate:o,object:e,graph:r}),n.push({subject:h,predicate:a,object:s,graph:r}),h=s}if(u){const e=x(u,t,n,r,i);n.push({subject:h,predicate:o,object:e,graph:r}),n.push({subject:h,predicate:a,object:s,graph:r})}return f}(e["@list"],t,n,r,i);u.termType=o.termType,u.value=o.value}else{const t=s.isObject(e)?e["@id"]:e;u.termType=t.startsWith("_:")?"BlankNode":"NamedNode",u.value=t}return"NamedNode"!==u.termType||v(u.value)?u:null}t.exports=_,_.toRDF=(e,t)=>{const n=new u.IdentifierIssuer("_:b"),i={"@default":{}};r(e,i,"@default",n);const o=[],a=Object.keys(i).sort();for(const r of a){let e;if("@default"===r)e={termType:"DefaultGraph",value:""};else{if(!v(r))continue;e=r.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},e.value=r}w(o,i[r],e,n,t)}return o}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(e,t,n){"use strict";const r={};t.exports=r,r.isArray=Array.isArray,r.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),r.isDouble=e=>r.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),r.isEmptyObject=e=>r.isObject(e)&&0===Object.keys(e).length,r.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),r.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),r.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),r.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),r.isUndefined=e=>void 0===e},{}],31:[function(e,t,n){"use strict";const r=e("./types"),i={};t.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},r=i.parsers[t||"full"],o=r.regex.exec(e);let a=r.keys.length;for(;a--;)n[r.keys[a]]=void 0===o[a]?null:o[a];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e||i.isAbsolute(t))return t;(!e||r.isString(e))&&(e=i.parse(e||""));const n=i.parse(t),o={protocol:e.protocol||""};if(null!==n.authority)o.authority=n.authority,o.path=n.path,o.query=n.query;else if(o.authority=e.authority,""===n.path)o.path=e.path,o.query=null!==n.query?n.query:e.query;else{if(0===n.path.indexOf("/"))o.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,o.path=t}o.query=n.query}""!==n.path&&(o.path=i.removeDotSegments(o.path));let a=o.protocol;return null!==o.authority&&(a+="//"+o.authority),a+=o.path,null!==o.query&&(a+="?"+o.query),null!==n.fragment&&(a+="#"+n.fragment),""===a&&(a="./"),a},i.removeBase=(e,t)=>{if(null===e)return t;(!e||r.isString(e))&&(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const o=i.parse(t.substr(n.length)),a=e.normalizedPath.split("/"),s=o.normalizedPath.split("/"),u=o.fragment||o.query?0:1;for(;a.length>0&&s.length>u&&a[0]===s[0];)a.shift(),s.shift();let c="";if(a.length>0){a.pop();for(let e=0;e{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),r=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>r.isString(e)&&o.test(e),i.isRelative=e=>r.isString(e)},{"./types":30}],32:[function(e,t,n){"use strict";const r=e("./graphTypes"),i=e("./types"),o=e("rdf-canonize").IdentifierIssuer,a=e("./JsonLdError"),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,u=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l={accept:"application/ld+json, application/json"},d={};function f(e,t){if(i.isArray(t))for(let n=0;n{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+l.accept+'" is supported.');return Object.assign({Accept:l.accept},e)},d.parseLinkHeader=e=>{const t={},n=e.match(s);for(let r=0;r{if(!(i.isString(e)||i.isArray(e)&&e.every(e=>i.isString(e)))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&d.asArray(e["@default"]).every(e=>i.isString(e)))return}throw new a('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},d.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},d.hasValue=(e,t,n)=>{if(d.hasProperty(e,t)){let o=e[t];const a=r.isList(o);if(i.isArray(o)||a){a&&(o=o["@list"]);for(let e=0;e{if("propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1),"valueIsArray"in r||(r.valueIsArray=!1),"allowDuplicate"in r||(r.allowDuplicate=!0),"prependValue"in r||(r.prependValue=!1),r.valueIsArray)e[t]=n;else if(i.isArray(n)){0===n.length&&r.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),r.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i[].concat(e[t]||[]),d.removeProperty=(e,t)=>{delete e[t]},d.removeValue=(e,t,n,r)=>{"propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1);const i=d.getValues(e,t).filter(e=>!d.compareValues(e,n));0===i.length?d.removeProperty(e,t):e[t]=1!==i.length||r.propertyIsArray?i:i[0]},d.relabelBlankNodes=(e,t)=>f((t=t||{}).issuer||new o("_:b"),e),d.compareValues=(e,t)=>!!(e===t||r.isValue(e)&&r.isValue(t)&&e["@value"]===t["@value"]&&e["@type"]===t["@type"]&&e["@language"]===t["@language"]&&e["@index"]===t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],d.compareShortestLeast=(e,t)=>e.length1;const g=(e,t,n)=>{const r=e[f].get(t);if(r){const t=r.value;if(y(e,t)){if(b(e,r),!e[s])return}else n&&(e[h]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[u])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[u]&&n>e[u]},m=e=>{if(e[o]>e[i])for(let t=e[d].tail;e[o]>e[i]&&null!==t;){const n=t.prev;b(e,t),t=n}},b=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[o]-=n.length,e[f].delete(n.key),e[d].removeNode(t)}};class v{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const _=(e,t,n,r)=>{let i=n.value;y(e,i)&&(b(e,n),e[s]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};t.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[a]="function"!=typeof t?p:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[u]=e.maxAge||0,this[c]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,m(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,m(this)}get maxAge(){return this[u]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[o]=0,this[d].forEach(e=>{e.length=this[a](e.value,e.key),this[o]+=e.length})),m(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;_(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;_(this,e,n,t),n=r}}keys(){return this[d].toArray().map(e=>e.key)}values(){return this[d].toArray().map(e=>e.value)}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach(e=>this[c](e.key,e.value)),this[f]=new Map,this[d]=new r,this[o]=0}dump(){return this[d].map(e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[u])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[i])return b(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[c]&&(this[l]||this[c](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),m(this),!0}const h=new v(e,t,s,r,n);return h.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=h.length,this[d].unshift(h),this[f].set(e,this[d].head),m(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[d].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[f].forEach((e,t)=>g(this,t,!1))}}},{yallist:92}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",o="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:`${i}decimal`,boolean:`${i}boolean`,double:`${i}double`,integer:`${i}integer`,string:`${i}string`},rdf:{type:`${r}type`,nil:`${r}nil`,first:`${r}first`,rest:`${r}rest`,langString:`${r}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${o}reify#forSome`,forAll:`${o}reify#forAll`},log:{implies:`${o}log#implies`}}},{}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function e(t,n){if(n=n||f,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===f)return new g(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));const r=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,r-1),"@"===t[r+1]?t.substr(r+2):n.namedNode(t.substr(r+3)));case"<":const i=d.exec(t);return n.quad(e(w(i[1]),n),e(w(i[2]),n),e(w(i[3]),n),i[4]&&e(w(i[4]),n));default:return n.namedNode(t)}},n.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof h&&"Quad"!==t.termType)return t.id;if(!t)return u.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return`_:${t.value}`;case"Variable":return`?${t.value}`;case"DefaultGraph":return"";case"Literal":return`"${t.value}"${t.language?`@${t.language}`:t.datatype&&t.datatype.value!==s.string?`^^${t.datatype.value}`:""}`;case"Quad":return`<<${_(e(t.subject))} ${_(e(t.predicate))} ${_(e(t.object))}${(0,o.isDefaultGraph)(t.graph)?"":` ${e(t.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${t.termType}`)}},n.escapeQuotes=_,n.unescapeQuotes=w,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var r,i=(r=e("./IRIs"))&&r.__esModule?r:{default:r},o=e("./N3Util");const{rdf:a,xsd:s}=i.default;let u,c=0;const l=/^"(.*".*)(?="[^"]*$)/,d=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,f={namedNode:function(e){return new p(e)},blankNode:function(e){return new y(e||"n3-"+c++)},variable:function(e){return new m(e)},literal:function(e,t){if("string"==typeof t)return new g(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";return""===n&&("boolean"==typeof e?n=s.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?s.integer:s.double:(n=s.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new g(""===n||n===s.string?`"${e}"`:`"${e}"^^${n}`)},defaultGraph:function(){return u},quad:x,triple:x};n.default=f;class h{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof h?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}toJSON(){return{termType:this.termType,value:this.value}}}n.Term=h;class p extends h{get termType(){return"NamedNode"}}n.NamedNode=p;class g extends h{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`"${t.replace(/"/g,'""')}`)}function w(e){return e.replace(l,(e,t)=>`"${t.replace(/""/g,'"')}`)}function x(e,t,n,r){return new v(e,t,n,r)}n.Triple=n.Quad=v},{"./IRIs":34,"./N3Util":41}],36:[function(e,t,n){(function(t){(function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./IRIs")),i=o(e("queue-microtask"));function o(e){return e&&e.__esModule?e:{default:e}}const{xsd:a}=r.default,s=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,u={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},c=/[\x00-\x20<>\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},d=/$0^/;n.default=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._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]*)?$/,this._lineMode=!!(e=e||{}).lineMode){this._n3Mode=!1;for(const e in this)!(e in l)&&this[e]instanceof RegExp&&(this[e]=d)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input;const r=this._comments;for(;;){let o,s;for(;o=this._newline.exec(n);)r&&(s=this._comment.exec(o[0]))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),n=n.substr(o[0].length,n.length),this._line++;if(!o&&(o=this._whitespace.exec(n))&&(n=n.substr(o[0].length,n.length)),this._endOfFile.test(n))return t&&(r&&(s=this._comment.exec(n))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),e(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;const u=this._line,l=n[0];let d="",f="",h="",p=null,g=0,y=!1;switch(l){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(g=1,d="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){y=!0;break}case"<":if(p=this._unescapedIri.exec(n))d="IRI",f=p[1];else if(p=this._iri.exec(n)){if(f=this._unescape(p[1]),null===f||c.test(f))return i(this);d="IRI"}else n.length>1&&"<"===n[1]?(d="<<",g=2):this._n3Mode&&n.length>1&&"="===n[1]&&(d="inverse",g=2,f=">");break;case">":n.length>1&&">"===n[1]&&(d=">>",g=2);break;case"_":((p=this._blank.exec(n))||t&&(p=this._blank.exec(`${n} `)))&&(d="blank",h="_",f=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(n))f=p[1];else if(({value:f,matchLength:g}=this._parseLiteral(n)),null===f)return i(this);(null!==p||0!==g)&&(d="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(p=this._simpleApostropheString.exec(n))f=p[1];else if(({value:f,matchLength:g}=this._parseLiteral(n)),null===f)return i(this);(null!==p||0!==g)&&(d="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(n))&&(d="var",f=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(n))?(d="langcode",f=p[1]):(p=this._keyword.exec(n))&&(d=p[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){d=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(n)||t&&(p=this._number.exec(`${n} `)))&&(d="literal",f=p[0],h="string"==typeof p[1]?a.double:"string"==typeof p[2]?a.decimal:a.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(n))?d=p[0].toUpperCase():y=!0;break;case"f":case"t":(p=this._boolean.exec(n))?(d="literal",f=p[0],h=a.boolean):y=!0;break;case"a":(p=this._shortPredicates.exec(n))?(d="abbreviation",f="a"):y=!0;break;case"=":this._n3Mode&&n.length>1&&(d="abbreviation",">"!==n[1]?(g=1,f="="):(g=2,f=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(g=1,d=l);break;default:y=!0}if(y&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(n))?((p=this._prefixed.exec(n))||t&&(p=this._prefixed.exec(`${n} `)))&&(d="prefixed",h=p[1]||"",f=this._unescape(p[2])):(d="prefix",f=p[1]||"")),"^^"===this._previousMarker)switch(d){case"prefixed":d="type";break;case"IRI":d="typeIRI";break;default:d=""}if(!d)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?i(this):this._input=n;const m={line:u,type:d,value:f,prefix:h};e(null,m),this.previousToken=m,this._previousMarker=d,n=n.substr(g||p[0].length,n.length)}function i(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(s,(e,n,r,i)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in u?u[i]:(t=!0,"")});return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;"\\"===e[r-t-1];)t++;if(t%2==0){const t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,o=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,n){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof n){const e=[];let t;if(this._tokenizeToEnd((n,r)=>n?t=n:e.push(r),!0),t)throw t;return e}(0,i.default)(()=>this._tokenizeToEnd(n,!0))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=t.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(n,!1)))}),e.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(n,!0)}),e.on("error",n)}}}).call(this)}).call(this,e("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("./N3Lexer")),i=a(e("./N3DataFactory")),o=a(e("./IRIs"));function a(e){return e&&e.__esModule?e:{default:e}}let s=0;class u{constructor(e){this._contextStack=[],this._graph=null,this._setBase((e=e||{}).baseIRI),e.factory&&l(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),i=/trig/.test(t),o=/triple/.test(t),a=/quad/.test(t),s=this._n3Mode=/n3/.test(t),u=o||a;(this._supportsNamedGraphs=!(n||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||o||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),u&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new r.default({lineMode:u,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){s=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,n,r,i){const o=this._n3Mode;this._contextStack.push({subject:n,predicate:r,object:i,graph:t,type:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);n=this._namedNode(t);break;case"type":case"prefixed":const r=this._prefixes[e.prefix];if(void 0===r)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._namedNode(r+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,r=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),r=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),r=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===i?null===a.predicate?a.subject=n:a.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return r}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const r=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==r){const e=this._predicate,t=this._object;i?this._emit(t,e,r,n):this._emit(r,e,t,n)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){const e=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n;const r=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let n,r;if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(r=this._subject,this._subject=t):(r=this._object,this._object=t),this._emit(t,n,r,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,r){this._callback(null,this._quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let n="",r=-1,i=-1,o=0,a="/";for(;r=i&&(n=n.substr(0,o)),"/"!==a)return`${n}/${e.substr(r+1)}`;o=r+1}}}a=e[++r]}return n+e.substring(o)}parse(e,t,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${s++}_`,this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let n;if(this._callback=(e,r)=>{e?n=e:r&&t.push(r)},this._lexer.tokenize(e).every(e=>this._readCallback=this._readCallback(e)),n)throw n;return t}this._callback=t,this._lexer.tokenize(e,(e,t)=>{null!==e?(this._callback(e),this._callback=c):this._readCallback&&(this._readCallback=this._readCallback(t))})}}function c(){}function l(e,t){const n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(o.default.rdf.first),e.RDF_REST=n(o.default.rdf.rest),e.RDF_NIL=n(o.default.rdf.nil),e.N3_FORALL=n(o.default.r.forAll),e.N3_FORSOME=n(o.default.r.forSome),e.ABBREVIATIONS={a:n(o.default.rdf.type),"=":n(o.default.owl.sameAs),">":n(o.default.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=u,l(u.prototype,i.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(e("./N3DataFactory")),o=e("readable-stream"),a=(r=e("./IRIs"))&&r.__esModule?r:{default:r};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u{constructor(e,t){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!t&&e&&!e[0]&&(t=e,e=null),this._factory=(t=t||{}).factory||i.default,e&&this.addQuads(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let n,r;for(const i in t)for(const o in n=t[i].subjects)for(const t in r=n[o])e+=Object.keys(r[t]).length;return this._size=e}_addToIndex(e,t,n,r){const i=e[t]||(e[t]={}),o=i[n]||(i[n]={}),a=r in o;return a||(o[r]=null),!a}_removeFromIndex(e,t,n,r){const i=e[t],o=i[n];delete o[r];for(const a in o)return;delete i[n];for(const a in i)return;delete e[t]}_findInIndex(e,t,n,r,o,a,s,u,c,l){let d,f,h;const p=!t+!n+!r>1?Object.keys(this._ids):this._entities;t&&((d=e,e={})[t]=d[t]);for(const g in e){const t=p[g];if(f=e[g]){n&&((d=f,f={})[n]=d[n]);for(const e in f){const n=p[e];if(h=f[e]){const e=r?r in h?[r]:[]:Object.keys(h);for(let r=0;r{n in t||(t[n]=!0,e((0,i.termFromId)(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),e=(0,i.termToId)(e),t=(0,i.termToId)(t),n=(0,i.termToId)(n),r=(0,i.termToId)(r);let o=this._graphs[r];o||(o=this._graphs[r]={subjects:{},predicates:{},objects:{}},Object.freeze(o));const a=this._ids,s=this._entities;e=a[e]||(a[s[++this._id]=e]=this._id),t=a[t]||(a[s[++this._id]=t]=this._id),n=a[n]||(a[s[++this._id]=n]=this._id);const u=this._addToIndex(o.subjects,e,t,n);return this._addToIndex(o.predicates,t,n,e),this._addToIndex(o.objects,n,e,t),this._size=null,u}addQuads(e){for(let t=0;t{this.addQuad(e)}),e}removeQuad(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),e=(0,i.termToId)(e),t=(0,i.termToId)(t),n=(0,i.termToId)(n),r=(0,i.termToId)(r);const o=this._ids,a=this._graphs;let s,u,c;if(!((e=o[e])&&(t=o[t])&&(n=o[n])&&(s=a[r])&&(u=s.subjects[e])&&(c=u[t])&&n in c))return!1;for(e in this._removeFromIndex(s.subjects,e,t,n),this._removeFromIndex(s.predicates,t,n,e),this._removeFromIndex(s.objects,n,e,t),null!==this._size&&this._size--,s.subjects)return!0;return delete a[r],!0}removeQuads(e){for(let t=0;t{this.removeQuad(e)}),e}removeMatches(e,t,n,r){const i=new o.Readable({objectMode:!0});return i._read=()=>{for(const o of this.getQuads(e,t,n,r))i.push(o);i.push(null)},this.remove(i)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,r){e=e&&(0,i.termToId)(e),t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=[],a=this._getGraphs(r),s=this._ids;let u,l,d,f;if(c(e)&&!(l=s[e])||c(t)&&!(d=s[t])||c(n)&&!(f=s[n]))return o;for(const i in a)(u=a[i])&&(l?f?this._findInIndex(u.objects,f,l,d,"object","subject","predicate",i,null,o):this._findInIndex(u.subjects,l,d,null,"subject","predicate","object",i,null,o):d?this._findInIndex(u.predicates,d,f,null,"predicate","object","subject",i,null,o):f?this._findInIndex(u.objects,f,null,null,"object","subject","predicate",i,null,o):this._findInIndex(u.subjects,null,null,null,"subject","predicate","object",i,null,o));return o}match(e,t,n,r){return new l(this,e,t,n,r)}countQuads(e,t,n,r){e=e&&(0,i.termToId)(e),t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=this._getGraphs(r),a=this._ids;let s,u,l,d,f=0;if(c(e)&&!(u=a[e])||c(t)&&!(l=a[t])||c(n)&&!(d=a[n]))return 0;for(const i in o)(s=o[i])&&(f+=e?n?this._countInIndex(s.objects,d,u,l):this._countInIndex(s.subjects,u,l,d):t?this._countInIndex(s.predicates,l,d,u):this._countInIndex(s.objects,d,u,l));return f}forEach(e,t,n,r,i){this.some(t=>(e(t),!1),t,n,r,i)}every(e,t,n,r,i){let o=!1;const a=!this.some(t=>(o=!0,!e(t)),t,n,r,i);return o&&a}some(e,t,n,r,o){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r),o=o&&(0,i.termToId)(o);const a=this._getGraphs(o),s=this._ids;let u,l,d,f;if(c(t)&&!(l=s[t])||c(n)&&!(d=s[n])||c(r)&&!(f=s[r]))return!1;for(const i in a)if(u=a[i])if(l){if(f){if(this._findInIndex(u.objects,f,l,d,"object","subject","predicate",i,e,null))return!0}else if(this._findInIndex(u.subjects,l,d,null,"subject","predicate","object",i,e,null))return!0}else if(d){if(this._findInIndex(u.predicates,d,f,null,"predicate","object","subject",i,e,null))return!0}else if(f){if(this._findInIndex(u.objects,f,null,null,"object","subject","predicate",i,e,null))return!0}else if(this._findInIndex(u.subjects,null,null,null,"subject","predicate","object",i,e,null))return!0;return!1}getSubjects(e,t,n){const r=[];return this.forSubjects(e=>{r.push(e)},e,t,n),r}forSubjects(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=this._ids,a=this._getGraphs(r);let s,u,l;if(e=this._uniqueEntities(e),!(c(t)&&!(u=o[t])||c(n)&&!(l=o[n])))for(r in a)(s=a[r])&&(u?l?this._loopBy2Keys(s.predicates,u,l,e):this._loopByKey1(s.subjects,u,e):l?this._loopByKey0(s.objects,l,e):this._loop(s.subjects,e))}getPredicates(e,t,n){const r=[];return this.forPredicates(e=>{r.push(e)},e,t,n),r}forPredicates(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=this._ids,a=this._getGraphs(r);let s,u,l;if(e=this._uniqueEntities(e),!(c(t)&&!(u=o[t])||c(n)&&!(l=o[n])))for(r in a)(s=a[r])&&(u?l?this._loopBy2Keys(s.objects,l,u,e):this._loopByKey0(s.subjects,u,e):l?this._loopByKey1(s.predicates,l,e):this._loop(s.predicates,e))}getObjects(e,t,n){const r=[];return this.forObjects(e=>{r.push(e)},e,t,n),r}forObjects(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=this._ids,a=this._getGraphs(r);let s,u,l;if(e=this._uniqueEntities(e),!(c(t)&&!(u=o[t])||c(n)&&!(l=o[n])))for(r in a)(s=a[r])&&(u?l?this._loopBy2Keys(s.subjects,u,l,e):this._loopByKey1(s.objects,u,e):l?this._loopByKey0(s.predicates,l,e):this._loop(s.objects,e))}getGraphs(e,t,n){const r=[];return this.forGraphs(e=>{r.push(e)},e,t,n),r}forGraphs(e,t,n,r){for(const i in this._graphs)this.some(t=>(e(t.graph),!0),t,n,r,i)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const n={},r=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,a.default.rdf.rest,a.default.rdf.nil,null),o=e?[...i]:[];return i.forEach(t=>{const i=[];let s,u,c=!1;const l=t.graph;let d=t.subject;for(;d&&!c;){const e=this.getQuads(null,null,d,null),t=this.getQuads(d,null,null,null);let n,f=null,h=null,p=null;for(let i=0;i{switch(e){case"data":t=r;break;case"end":n=r}}},(e,t)=>{e&&this.emit("error",e)||t&&this.push(t)},(e,t)=>{this.emit("prefix",e,t)}),this._transform=(e,n,r)=>{t(e),r()},this._flush=e=>{n(),e()}}import(e){return e.on("data",e=>{this.write(e)}),e.on("end",()=>{this.end()}),e.on("error",e=>{this.emit("error",e)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=e("readable-stream"),o=(r=e("./N3Writer"))&&r.__esModule?r:{default:r};n.default=class extends i.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0});const t=this._writer=new o.default({write:(e,t,n)=>{this.push(e),n&&n()},end:e=>{this.push(null),e&&e()}},e);this._transform=(e,n,r)=>{t.addQuad(e,r)},this._flush=e=>{t.end(e)}}import(e){return e.on("data",e=>{this.write(e)}),e.on("end",()=>{this.end()}),e.on("error",e=>{this.emit("error",e)}),e.on("prefix",(e,t)=>{this._writer.addPrefix(e,t)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isNamedNode=function(e){return!!e&&"NamedNode"===e.termType},n.isBlankNode=function(e){return!!e&&"BlankNode"===e.termType},n.isLiteral=function(e){return!!e&&"Literal"===e.termType},n.isVariable=function(e){return!!e&&"Variable"===e.termType},n.isDefaultGraph=o,n.inDefaultGraph=function(e){return o(e.graph)},n.prefix=function(e,t){return a({"":e},t)("")},n.prefixes=a;var r,i=(r=e("./N3DataFactory"))&&r.__esModule?r:{default:r};function o(e){return!!e&&"DefaultGraph"===e.termType}function a(e,t){const n=Object.create(null);for(const i in e)r(i,e[i]);function r(e,r){if("string"==typeof r){const i=Object.create(null);n[e]=e=>i[e]||(i[e]=t.namedNode(r+e))}else if(!(e in n))throw new Error(`Unknown prefix: ${e}`);return n[e]}return t=t||i.default,r}},{"./N3DataFactory":35}],42:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=(r=e("./IRIs"))&&r.__esModule?r:{default:r},o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(e("./N3DataFactory")),a=e("./N3Util");function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const u=o.default.defaultGraph(),{rdf:c,xsd:l}=i.default,d=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,f=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,h={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class p extends o.Term{equals(){return!1}}function g(e){let t=h[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}n.default=class{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),this._lists=(t=t||{}).lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,n,r){e+=t,r&&r()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=u,this._baseIRI=t.baseIRI,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes))}get _inDefaultGraph(){return u.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,n,r,i){try{r.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(u.equals(r)?"":`${this._encodeIriOrBlank(r)} {\n`)),this._graph=r,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i)}catch(o){i&&i(o)}}_writeQuadLine(e,t,n,r,i){delete this._prefixMatch,this._write(this.quadToString(e,t,n,r),i)}quadToString(e,t,n,r){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${r&&r.value?` ${this._encodeIriOrBlank(r)} .\n`:" .\n"}`}quadsToString(e){return e.map(e=>this.quadToString(e.subject,e.predicate,e.object,e.graph)).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseIRI&&t.startsWith(this._baseIRI)&&(t=t.substr(this._baseIRI.length)),d.test(t)&&(t=t.replace(f,g));const n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(d.test(t)&&(t=t.replace(f,g)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===l.string)return`"${t}"`}else switch(e.datatype.value){case l.string:return`"${t}"`;case l.boolean:if("true"===t||"false"===t)return t;break;case l.integer:if(/^[+-]?\d+$/.test(t))return t;break;case l.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case l.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===c.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:n,graph:r}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${(0,a.isDefaultGraph)(r)?"":` ${this._encodeIriOrBlank(r)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,u,r):this._writeQuad(e,t,n,r||u,i)}addQuads(e){for(let t=0;t.\n`)}if(n){let e="",t="";for(const n in this._prefixIRIs)e+=e?`|${n}`:n,t+=(t?"|":"")+this._prefixIRIs[n];e=e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",t)}blank(e,t){let n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new p("[]");case 1:if(n=i[0],!(n.object instanceof p))return new p(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let t="[";for(let o=0;o{t=null,e(n,r)});if(this._endStream)try{return this._outputStream.end(t)}catch(n){}t&&t()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"Writer",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"Store",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"StreamParser",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"StreamWriter",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"DataFactory",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"Term",{enumerable:!0,get:function(){return l.Term}}),Object.defineProperty(n,"NamedNode",{enumerable:!0,get:function(){return l.NamedNode}}),Object.defineProperty(n,"Literal",{enumerable:!0,get:function(){return l.Literal}}),Object.defineProperty(n,"BlankNode",{enumerable:!0,get:function(){return l.BlankNode}}),Object.defineProperty(n,"Variable",{enumerable:!0,get:function(){return l.Variable}}),Object.defineProperty(n,"DefaultGraph",{enumerable:!0,get:function(){return l.DefaultGraph}}),Object.defineProperty(n,"Quad",{enumerable:!0,get:function(){return l.Quad}}),Object.defineProperty(n,"Triple",{enumerable:!0,get:function(){return l.Triple}}),Object.defineProperty(n,"termFromId",{enumerable:!0,get:function(){return l.termFromId}}),Object.defineProperty(n,"termToId",{enumerable:!0,get:function(){return l.termToId}}),n.Util=void 0;var r=h(e("./N3Lexer")),i=h(e("./N3Parser")),o=h(e("./N3Writer")),a=h(e("./N3Store")),s=h(e("./N3StreamParser")),u=h(e("./N3StreamWriter")),c=f(e("./N3Util"));n.Util=c;var l=f(e("./N3DataFactory"));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function h(e){return e&&e.__esModule?e:{default:e}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(e,t,n){var r,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(n){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,l=[],d=!1,f=-1;function h(){!d||!c||(d=!1,c.length?l=c.concat(l):f=-1,l.length&&p())}function p(){if(!d){var e=u(h);d=!0;for(var t=l.length;t;){for(c=l,l=[];++f1)for(var n=1;n(n||(n=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(e,t,n){t.exports=e("./lib")},{"./lib":55}],47:[function(e,t,n){"use strict";t.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:r}=this;return new e(t,new Map(n),r)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(e,t,n){"use strict";e("setimmediate");const i=self.crypto||self.msCrypto;t.exports=class{constructor(e){if(!i||!i.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupport algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}digest(){var e=this;return r(function*(){const t=(new TextEncoder).encode(e._content),n=new Uint8Array(yield i.subtle.digest(e.algorithm,t));let r="";for(let e=0;e{const e="[ \\t]*";c.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,c.empty=new RegExp("^"+e+"$"),c.quad=new RegExp("^"+e+'(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))'+e+"$")})(),t.exports=class e{static parse(e){const t=[],n={},d=e.split(c.eoln);let h=0;for(const p of d){if(h++,c.empty.test(p))continue;const e=p.match(c.quad);if(null===e)throw new Error("N-Quads parse error on line "+h+".");const d={subject:null,predicate:null,object:null,graph:null};if(d.subject=void 0!==e[1]?{termType:o,value:e[1]}:{termType:a,value:e[2]},d.predicate={termType:o,value:e[3]},void 0!==e[4]?d.object={termType:o,value:e[4]}:void 0!==e[5]?d.object={termType:a,value:e[5]}:(d.object={termType:s,value:void 0,datatype:{termType:o}},void 0!==e[7]?d.object.datatype.value=e[7]:void 0!==e[8]?(d.object.datatype.value=r,d.object.language=e[8]):d.object.datatype.value=i,d.object.value=e[6].replace(f,function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")})),d.graph=void 0!==e[9]?{termType:o,value:e[9]}:void 0!==e[10]?{termType:a,value:e[10]}:{termType:u,value:""},d.graph.value in n){let e=!0;const r=n[d.graph.value];for(const t of r)if(l(t,d)){e=!1;break}e&&(r.push(d),t.push(d))}else n[d.graph.value]=[d],t.push(d)}return t}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const r of t)n.push(e.serializeQuad(r));return n.sort().join("")}static serializeQuad(e){const t=e.subject,n=e.object,s=e.graph;let u="";return u+=t.termType===o?`<${t.value}>`:`${t.value}`,u+=` <${e.predicate.value}> `,n.termType===o?u+=`<${n.value}>`:n.termType===a?u+=n.value:(u+=`"${c=n.value,c.replace(d,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,n.datatype.value===r?n.language&&(u+=`@${n.language}`):n.datatype.value!==i&&(u+=`^^<${n.datatype.value}>`)),s.termType===o?u+=` <${s.value}>`:s.termType===a&&(u+=` ${s.value}`),u+=" .\n",u;var c}static legacyDatasetToQuads(e){const t=[],n={"blank node":a,IRI:o,literal:s};for(const c in e)e[c].forEach(e=>{const l={};for(const t in e){const a=e[t],u={termType:n[a.type],value:a.value};u.termType===s&&(u.datatype={termType:o},"datatype"in a&&(u.datatype.value=a.datatype),"language"in a?("datatype"in a||(u.datatype.value=r),u.language=a.language):"datatype"in a||(u.datatype.value=i)),l[t]=u}l.graph="@default"===c?{termType:u,value:""}:{termType:c.startsWith("_:")?a:o,value:c},t.push(l)});return t}};const d=/["\\\n\r]/g;const f=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(e,t,n){"use strict";t.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;tr)&&(s&&a>0&&n>e[a-1]||!s&&ae[a+1])&&(r=n,i=a)}if(null===r)this.done=!0;else{const n=t.get(r)?i-1:i+1;e[i]=e[n],e[n]=r;for(const i of e)i>r&&t.set(i,!t.get(i))}return n}}},{}],51:[function(e,t,n){(function(n){(function(){"use strict";const i=e("./IdentifierIssuer"),o=e("./MessageDigest"),a=e("./Permuter"),s=e("./NQuads");function u(e,t){return e.hasht.hash?1:0}t.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(e){var t=this;return r(function*(){t.quads=e;for(const i of e)t._addBlankNodeQuadInfo({quad:i,component:i.subject}),t._addBlankNodeQuadInfo({quad:i,component:i.object}),t._addBlankNodeQuadInfo({quad:i,component:i.graph});const n=new Map,r=[...t.blankNodeInfo.keys()];let o=0;for(const e of r)++o%100==0&&(yield t._yield()),yield t._hashAndTrackBlankNode({id:e,hashToBlankNodes:n});const a=[...n.keys()].sort(),c=[];for(const e of a){const r=n.get(e);r.length>1?c.push(r):t.canonicalIssuer.getId(r[0])}for(const e of c){const n=[];for(const r of e){if(t.canonicalIssuer.hasId(r))continue;const e=new i("_:b");e.getId(r);const o=yield t.hashNDegreeQuads(r,e);n.push(o)}n.sort(u);for(const e of n){const n=e.issuer.getOldIds();for(const e of n)t.canonicalIssuer.getId(e)}}const l=[];for(const e of t.quads){const n=or({},e);n.subject=t._useCanonicalId({component:n.subject}),n.object=t._useCanonicalId({component:n.object}),n.graph=t._useCanonicalId({component:n.graph}),l.push(s.serializeQuad(n))}return l.sort(),l.join("")})()}hashFirstDegreeQuads(e){var t=this;return r(function*(){const n=[],r=t.blankNodeInfo.get(e),i=r.quads;for(const o of i){const r={subject:null,predicate:o.predicate,object:null,graph:null};r.subject=t.modifyFirstDegreeComponent(e,o.subject,"subject"),r.object=t.modifyFirstDegreeComponent(e,o.object,"object"),r.graph=t.modifyFirstDegreeComponent(e,o.graph,"graph"),n.push(s.serializeQuad(r))}n.sort();const a=new o(t.hashAlgorithm);for(const e of n)a.update(e);return r.hash=yield a.digest(),r.hash})()}hashRelatedBlankNode(e,t,n,i){var a=this;return r(function*(){let r;r=a.canonicalIssuer.hasId(e)?a.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):a.blankNodeInfo.get(e).hash;const s=new o(a.hashAlgorithm);return s.update(i),"g"!==i&&s.update(a.getRelatedPredicate(t)),s.update(r),s.digest()})()}hashNDegreeQuads(e,t){var n=this;return r(function*(){const r=new o(n.hashAlgorithm),i=yield n.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){r.update(e);let o,s="";const u=new a(i.get(e));let c=0;for(;u.hasNext();){const e=u.next();++c%3==0&&(yield n._yield());let r=t.clone(),i="";const a=[];let l=!1;for(const t of e)if(n.canonicalIssuer.hasId(t)?i+=n.canonicalIssuer.getId(t):(r.hasId(t)||a.push(t),i+=r.getId(t)),0!==s.length&&i>s){l=!0;break}if(!l){for(const e of a){const t=yield n.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==s.length&&i>s){l=!0;break}}l||(0===s.length||i`}createHashToRelated(e,t){var n=this;return r(function*(){const r=new Map,i=n.blankNodeInfo.get(e).quads;let o=0;for(const a of i)++o%100==0&&(yield n._yield()),yield Promise.all([n._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:e,issuer:t,hashToRelated:r}),n._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:e,issuer:t,hashToRelated:r}),n._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r})()}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){var n=this;return r(function*(){const r=yield n.hashFirstDegreeQuads(e),i=t.get(r);i?i.push(e):t.set(r,[e])})()}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:i,issuer:o,hashToRelated:a}){var s=this;return r(function*(){if("BlankNode"!==t.termType||t.value===i)return;const r=t.value,u=yield s.hashRelatedBlankNode(r,e,o,n),c=a.get(u);c?c.push(r):a.set(u,[r])})()}_useCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}_yield(){return r(function*(){return new Promise(e=>n(e))})()}}}).call(this)}).call(this,e("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(e,t,n){"use strict";const r=e("./IdentifierIssuer"),i=e("./MessageDigest"),o=e("./Permuter"),a=e("./NQuads");function s(e,t){return e.hasht.hash?1:0}t.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(e){this.quads=e;for(const r of e)this._addBlankNodeQuadInfo({quad:r,component:r.subject}),this._addBlankNodeQuadInfo({quad:r,component:r.object}),this._addBlankNodeQuadInfo({quad:r,component:r.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const r of n)this._hashAndTrackBlankNode({id:r,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const r of i){const e=t.get(r);e.length>1?o.push(e):this.canonicalIssuer.getId(e[0])}for(const a of o){const e=[];for(const t of a){if(this.canonicalIssuer.hasId(t))continue;const n=new r("_:b");n.getId(t);const i=this.hashNDegreeQuads(t,n);e.push(i)}e.sort(s);for(const t of e){const e=t.issuer.getOldIds();for(const t of e)this.canonicalIssuer.getId(t)}}const u=[];for(const r of this.quads){const e=or({},r);e.subject=this._useCanonicalId({component:e.subject}),e.object=this._useCanonicalId({component:e.object}),e.graph=this._useCanonicalId({component:e.graph}),u.push(a.serializeQuad(e))}return u.sort(),u.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const i of r){const n={subject:null,predicate:i.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,i.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,i.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,i.graph,"graph"),t.push(a.serializeQuad(n))}t.sort();const o=new i(this.hashAlgorithm);for(const i of t)o.update(i);return n.hash=o.digest(),n.hash}hashRelatedBlankNode(e,t,n,r){let o;o=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const a=new i(this.hashAlgorithm);return a.update(r),"g"!==r&&a.update(this.getRelatedPredicate(t)),a.update(o),a.digest()}hashNDegreeQuads(e,t){const n=new i(this.hashAlgorithm),r=this.createHashToRelated(e,t),a=[...r.keys()].sort();for(const i of a){n.update(i);let e,a="";const s=new o(r.get(i));for(;s.hasNext();){const n=s.next();let r=t.clone(),i="";const o=[];let u=!1;for(const e of n)if(this.canonicalIssuer.hasId(e)?i+=this.canonicalIssuer.getId(e):(r.hasId(e)||o.push(e),i+=r.getId(e)),0!==a.length&&i>a){u=!0;break}if(!u){for(const e of o){const t=this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==a.length&&i>a){u=!0;break}}u||(0===a.length||i`}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===r)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,i,n),u=o.get(s);u?u.push(a):o.set(s,[a])}_useCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(e,t,n){"use strict";const i=e("./URDNA2015");t.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){var n=this;return r(function*(){const r=new Map,i=n.blankNodeInfo.get(e).quads;let o=0;for(const a of i){let i,s;if("BlankNode"===a.subject.termType&&a.subject.value!==e)s=a.subject.value,i="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;s=a.object.value,i="r"}++o%100==0&&(yield n._yield());const u=yield n.hashRelatedBlankNode(s,a,t,i),c=r.get(u);c?c.push(s):r.set(u,[s])}return r})()}}},{"./URDNA2015":51}],54:[function(e,t,n){"use strict";const r=e("./URDNA2015Sync");t.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r){let r,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,r="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,r="r"}const a=this.hashRelatedBlankNode(o,i,t,r),s=n.get(a);s?s.push(o):n.set(a,[o])}return n}}},{"./URDNA2015Sync":52}],55:[function(e,t,n){"use strict";const i=e("./URDNA2015"),o=e("./URGNA2012"),a=e("./URDNA2015Sync"),s=e("./URGNA2012Sync");let u;try{u=e("rdf-canonize-native")}catch(l){}const c={};t.exports=c,c.NQuads=e("./NQuads"),c.IdentifierIssuer=e("./IdentifierIssuer"),c._rdfCanonizeNative=function(e){return e&&(u=e),u},c.canonize=function(){var e=r(function*(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(!u)throw new Error("rdf-canonize-native not available");return new Promise((n,r)=>u.canonize(e,t,(e,t)=>e?r(e):n(t)))}if("URDNA2015"===t.algorithm)return new i(t).main(e);if("URGNA2012"===t.algorithm)return new o(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(t,n){return e.apply(this,arguments)}}(),c._canonizeSync=function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(u)return u.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new a(t).main(e);if("URGNA2012"===t.algorithm)return new s(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),i(e("./lib/BlankNode"),n),i(e("./lib/DataFactory"),n),i(e("./lib/DefaultGraph"),n),i(e("./lib/Literal"),n),i(e("./lib/NamedNode"),n),i(e("./lib/Quad"),n),i(e("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0;n.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},{}],58:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;const r=e("./BlankNode"),i=e("./DefaultGraph"),o=e("./Literal"),a=e("./NamedNode"),s=e("./Quad"),u=e("./Variable");let c=0;n.DataFactory=class{constructor(e){this.blankNodeCounter=0,this.blankNodePrefix=(e=e||{}).blankNodePrefix||`df_${c++}_`}namedNode(e){return new a.NamedNode(e)}blankNode(e){return new r.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new o.Literal(e,t)}variable(e){return new u.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,n,r){return new s.Quad(e,t,n,r||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(o.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;class r{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}n.DefaultGraph=r,r.INSTANCE=new r},{}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;const r=e("./NamedNode");class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=i.XSD_STRING)}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}n.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0;n.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},{}],62:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0;n.Quad=class{constructor(e,t,n,r){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},{}],63:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0;n.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},{}],64:[function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),i(e("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;class r extends Error{constructor(e,t){const n=e.saxStream._parser;super(e.trackPosition?`Line ${n.line+1} column ${n.column+1}: ${t}`:t)}}n.ParseError=r},{}],66:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;const r=e("relative-to-absolute-iri"),i=e("sax"),o=e("stream"),a=e("./ParseError"),s=e("rdf-data-factory");class u extends o.Transform{constructor(e){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},e&&(Object.assign(this,e),this.options=e),this.dataFactory||(this.dataFactory=new s.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=i.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(e,t){const n={};let r=!1;for(const o in e.attributes)o.startsWith("xmlns")&&(5===o.length?(r=!0,n[""]=e.attributes[o]):":"===o.charAt(5)&&(r=!0,n[o.substr(6)]=e.attributes[o]));const i=t&&t.ns?t.ns:[u.DEFAULT_NS];return r?i.concat([n]):i}static expandPrefixedTerm(e,t,n){const r=e.indexOf(":");let i,o;r>=0?(i=e.substr(0,r),o=e.substr(r+1)):(i="",o=e);let s=null,u=null;for(let a=t.length-1;a>=0;a--){const e=t[a][i];if(e){s=e;break}u||(u=t[a][""])}if(!s){if(i&&"xmlns"!==i)throw new a.ParseError(n,`The prefix '${i}' in term '${e}' was not bound.`);s=u||""}return{prefix:i,local:o,uri:s}}static isValidIri(e){return u.IRI_REGEX.test(e)}import(e){const t=new o.PassThrough({readableObjectMode:!0});e.on("error",e=>n.emit("error",e)),e.on("data",e=>t.push(e)),e.on("end",()=>t.push(null));const n=t.pipe(new u(this.options));return n}_transform(e,t,n){try{this.saxStream.write(e,t)}catch(r){return n(r)}n()}newParseError(e){return new a.ParseError(this,e)}valueToUri(e,t){return this.uriToNamedNode(r.resolve(e,t.baseIRI))}uriToNamedNode(e){if(!u.isValidIri(e))throw this.newParseError(`Invalid URI: ${e}`);return this.dataFactory.namedNode(e)}validateNcname(e){if(!u.NCNAME_MATCHER.test(e))throw this.newParseError(`Not a valid NCName: ${e}`)}attachSaxListeners(){this.saxStream.on("error",e=>this.emit("error",e)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(e){const t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let n=c.RESOURCE;if(t&&(t.hadChildren=!0,n=t.childrenParseType),t&&t.childrenStringTags){const n=e.name;let r="";for(const t in e.attributes)r+=` ${t}="${e.attributes[t]}"`;t.childrenStringTags.push(`<${n}${r}>`);const i={childrenStringTags:t.childrenStringTags};return i.childrenStringEmitClosingTag=``,void this.activeTagStack.push(i)}const r={};t?(r.language=t.language,r.baseIRI=t.baseIRI):r.baseIRI=this.baseIRI,this.activeTagStack.push(r),r.ns=u.parseNamespace(e,t),n===c.RESOURCE?this.onTagResource(e,r,t,!t):this.onTagProperty(e,r,t)}onTagResource(e,t,n,i){const o=u.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=c.PROPERTY;let a=!0;if(o.uri===u.RDF){if(!i&&u.FORBIDDEN_NODE_ELEMENTS.indexOf(o.local)>=0)throw this.newParseError(`Illegal node element name: ${o.local}`);switch(o.local){case"RDF":t.childrenParseType=c.RESOURCE;case"Description":a=!1}}const s=[],l=[];let d=null,f=!1,h=!1,p=null;for(const c in e.attributes){const i=e.attributes[c],o=u.expandPrefixedTerm(c,t.ns,this);if(n&&o.uri===u.RDF)switch(o.local){case"about":if(d)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${d} where found.`);d=i;continue;case"ID":if(d)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${d} where found.`);this.validateNcname(i),d="#"+i,f=!0;continue;case"nodeID":if(d)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${d} where found.`);this.validateNcname(i),d=i,h=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=i;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(o.uri===u.XML){if("lang"===o.local){t.language=""===i?null:i.toLowerCase();continue}if("base"===o.local){t.baseIRI=r.resolve(i,t.baseIRI);continue}}"xml"!==o.prefix&&o.uri&&(s.push(this.uriToNamedNode(o.uri+o.local)),l.push(i))}if(null!==d&&(t.subject=h?this.dataFactory.blankNode(d):this.valueToUri(d,t),f&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),a){const e=this.uriToNamedNode(o.uri+o.local);this.emitTriple(t.subject,this.dataFactory.namedNode(u.RDF+"type"),e,n?n.reifiedStatementId:null)}if(n){if(n.predicate)if(n.childrenCollectionSubject){const e=this.dataFactory.blankNode();this.emitTriple(n.childrenCollectionSubject,n.childrenCollectionPredicate,e,n.reifiedStatementId),this.emitTriple(e,this.dataFactory.namedNode(u.RDF+"first"),t.subject,t.reifiedStatementId),n.childrenCollectionSubject=e,n.childrenCollectionPredicate=this.dataFactory.namedNode(u.RDF+"rest")}else{this.emitTriple(n.subject,n.predicate,t.subject,n.reifiedStatementId);for(let e=0;e=0)throw this.newParseError(`Illegal property element name: ${r.local}`);t.predicateSubPredicates=[],t.predicateSubObjects=[];let i=!1,o=!1,a=null,s=!0;const l=[],d=[];for(const f in e.attributes){const n=e.attributes[f],r=u.expandPrefixedTerm(f,t.ns,this);if(r.uri===u.RDF)switch(r.local){case"resource":if(a)throw this.newParseError(`Found both rdf:resource (${n}) and rdf:nodeID (${a}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${n})`);t.hadChildren=!0,a=n,s=!1;continue;case"datatype":if(o)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${n}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${n})`);t.datatype=this.valueToUri(n,t);continue;case"nodeID":if(o)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${n}).`);if(t.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${n}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${n})`);this.validateNcname(n),t.hadChildren=!0,a=n,s=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(o)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${t.datatype.value})`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${a})`);if("Resource"===n){i=!0,t.childrenParseType=c.PROPERTY;const e=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,e,t.reifiedStatementId),t.subject=e,t.predicate=null}else"Collection"===n?(i=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,s=!1):"Literal"===n&&(i=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(n),t.reifiedStatementId=this.valueToUri("#"+n,t),this.claimNodeId(t.reifiedStatementId);continue}else if(r.uri===u.XML&&"lang"===r.local){t.language=""===n?null:n.toLowerCase();continue}if("xml"!==r.prefix&&"xmlns"!==r.prefix&&r.uri){if(i||t.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${n}`);t.hadChildren=!0,o=!0,l.push(this.uriToNamedNode(r.uri+r.local)),d.push(this.dataFactory.literal(n,t.datatype||t.language))}}if(null!==a){const e=t.subject;t.subject=s?this.dataFactory.blankNode(a):this.valueToUri(a,t),this.emitTriple(e,t.predicate,t.subject,t.reifiedStatementId);for(let n=0;n/g,(e,t,n)=>(this.saxStream._parser.ENTITIES[t]=n,""))}}var c,l;n.RdfXmlParser=u,u.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,u.MIME_TYPE="application/rdf+xml",u.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",u.XML="http://www.w3.org/XML/1998/namespace",u.XMLNS="http://www.w3.org/2000/xmlns/",u.DEFAULT_NS={xml:u.XML},u.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],u.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],u.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,(l=c=n.ParseType||(n.ParseType={}))[l.RESOURCE=0]="RESOURCE",l[l.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(e,t,n){"use strict";var r={};function i(e,t,n){n||(n=Error);var i=function(e){function n(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(n,e),n}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function o(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,n){var r,i;if("string"==typeof t&&function(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))i="The ".concat(e," ").concat(r," ").concat(o(t,"type"));else{var a=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(a," ").concat(r," ").concat(o(t,"type"))}return i+". Received type ".concat(typeof n)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},{}],68:[function(e,t,n){(function(n){(function(){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var i=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(c,i);for(var a=r(o.prototype),s=0;s0)if("string"!=typeof t&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype&&(t=function(e){return s.from(e)}(t)),r)a.endEmitted?x(e,new w):T(e,a,t,!0);else if(a.ended)x(e,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?T(e,a,t,!1):O(e,a)):T(e,a,t,!1)}else r||(a.reading=!1,O(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(R,e))}function R(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function O(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){c("readable nexttick read 0"),e.read(0)}function P(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(G,t,e))}function G(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function U(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):k(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&B(this),null;var r,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),null!==r&&this.emit("data",r),r},N.prototype._read=function(e){x(this,new _("_read()"))},N.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=t&&!1===t.end||e===n.stdout||e===n.stderr?y:u;function s(t,n){c("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",f),d=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&l())}function u(){c("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,C(e))}}(r);e.on("drain",l);var d=!1;function f(t){c("ondata");var n=e.write(t);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!d&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){c("onerror",t),y(),e.removeListener("error",h),0===o(e,"error")&&x(e,t)}function p(){e.removeListener("finish",g),y()}function g(){c("onfinish"),e.removeListener("close",p),y()}function y(){c("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",g),e.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),e},N.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?k(this):i.reading||n.nextTick(D,this)),r},N.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(M,this),r},N.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(M,this),t},N.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(P,e,t))}(this,e)),e.paused=!1,this},N.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},N.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(c("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){c("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||!(n.objectMode||i&&i.length)||t.push(i)||(r=!0,e.pause())}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(N.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),N.prototype._write=function(e,t,n){n(new g("_write()"))},N.prototype._writev=null,N.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,O(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(N.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(N.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}}),N.prototype.destroy=d.destroy,N.prototype._undestroy=d.undestroy,N.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(e,t,n){(function(n){(function(){"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=e("./end-of-stream"),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[f].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(h(n,!1)))}}function g(e){n.nextTick(p,e)}var y=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((i(r={get stream(){return this[f]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(t,r){n.nextTick(function(){e[u]?r(e[u]):t(h(void 0,!0))})});var r,i=this[l];if(i)r=new Promise(function(e,t){return function(n,r){e.then(function(){t[c]?n(h(void 0,!0)):t[d](n,r)},r)}}(i,this));else{var o=this[f].read();if(null!==o)return Promise.resolve(h(o,!1));r=new Promise(this[d])}return this[l]=r,r}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[f].destroy(null,function(e){e?n(e):t(h(void 0,!0))})})}),r),y);t.exports=function(e){var t,n=Object.create(m,(i(t={},f,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var r=n[f].read();r?(n[l]=null,n[a]=null,n[s]=null,e(h(r,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[l]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[l]=null,n[a]=null,n[s]=null,t(e)),void(n[u]=e)}var r=n[a];null!==r&&(n[l]=null,n[a]=null,n[s]=null,r(h(void 0,!0))),n[c]=!0}),e.on("readable",g.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":76,_process:44}],74:[function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),n=this.head,r=0;n;)c(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(r+=o===i.length?i:i.slice(0,e),0==(e-=o)){o===i.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t0,function(e){i||(i=e),e&&a.forEach(c),!o&&(a.forEach(c),r(i))})});return t.reduce(l)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(e,t,n){"use strict";var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":67}],80:[function(e,t,n){t.exports=e("events").EventEmitter},{events:8}],81:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(e,t,n){"use strict";function r(e){const t=[];let n=0;for(;ne.join("")).join("/")}function i(e,t){let n=t+1;t>=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);const i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function o(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(e,t){const n=(t=t||"").indexOf("#");if(n>0&&(t=t.substr(0,n)),!e.length){if(t.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith("?")){const n=t.indexOf("?");return n>0&&(t=t.substr(0,n)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){const t=e.indexOf(":");if(t<0)throw new Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return i(e,t)}const o=e.indexOf(":");if(o>=0)return i(e,o);const a=t.indexOf(":");if(a<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);const s=t.substr(0,a+1);if(0===e.indexOf("//"))return s+i(e,o);let u;if(t.indexOf("//",a)===a+1){if(u=t.indexOf("/",a+3),u<0)return t.length>a+3?t+"/"+i(e,o):s+i(e,o)}else if(u=t.indexOf("/",a+1),u<0)return s+i(e,o);if(0===e.indexOf("/"))return t.substr(0,u)+r(e);let c=t.substr(u);const l=c.lastIndexOf("/");return l>=0&&l"===o?(E(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=S.TEXT):(y(o)&&(t.state=S.SGML_DECL_QUOTED),t.sgmlDecl+=o);continue;case S.SGML_DECL_QUOTED:o===t.q&&(t.state=S.SGML_DECL,t.q=""),t.sgmlDecl+=o;continue;case S.DOCTYPE:">"===o?(t.state=S.TEXT,E(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=o,"["===o?t.state=S.DOCTYPE_DTD:y(o)&&(t.state=S.DOCTYPE_QUOTED,t.q=o));continue;case S.DOCTYPE_QUOTED:t.doctype+=o,o===t.q&&(t.q="",t.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:t.doctype+=o,"]"===o?t.state=S.DOCTYPE:y(o)&&(t.state=S.DOCTYPE_DTD_QUOTED,t.q=o);continue;case S.DOCTYPE_DTD_QUOTED:t.doctype+=o,o===t.q&&(t.state=S.DOCTYPE_DTD,t.q="");continue;case S.COMMENT:"-"===o?t.state=S.COMMENT_ENDING:t.comment+=o;continue;case S.COMMENT_ENDING:"-"===o?(t.state=S.COMMENT_ENDED,t.comment=I(t.opt,t.comment),t.comment&&E(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+o,t.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==o?(R(t,"Malformed comment"),t.comment+="--"+o,t.state=S.COMMENT):t.state=S.TEXT;continue;case S.CDATA:"]"===o?t.state=S.CDATA_ENDING:t.cdata+=o;continue;case S.CDATA_ENDING:"]"===o?t.state=S.CDATA_ENDING_2:(t.cdata+="]"+o,t.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===o?(t.cdata&&E(t,"oncdata",t.cdata),E(t,"onclosecdata"),t.cdata="",t.state=S.TEXT):"]"===o?t.cdata+="]":(t.cdata+="]]"+o,t.state=S.CDATA);continue;case S.PROC_INST:"?"===o?t.state=S.PROC_INST_ENDING:g(o)?t.state=S.PROC_INST_BODY:t.procInstName+=o;continue;case S.PROC_INST_BODY:if(!t.procInstBody&&g(o))continue;"?"===o?t.state=S.PROC_INST_ENDING:t.procInstBody+=o;continue;case S.PROC_INST_ENDING:">"===o?(E(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=S.TEXT):(t.procInstBody+="?"+o,t.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:b(f,o)?t.tagName+=o:(O(t),">"===o?D(t):"/"===o?t.state=S.OPEN_TAG_SLASH:(g(o)||R(t,"Invalid character in tag name"),t.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===o?(D(t,!0),P(t)):(R(t,"Forward-slash in opening tag not followed by >"),t.state=S.ATTRIB);continue;case S.ATTRIB:if(g(o))continue;">"===o?D(t):"/"===o?t.state=S.OPEN_TAG_SLASH:b(d,o)?(t.attribName=o,t.attribValue="",t.state=S.ATTRIB_NAME):R(t,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===o?t.state=S.ATTRIB_VALUE:">"===o?(R(t,"Attribute without value"),t.attribValue=t.attribName,M(t),D(t)):g(o)?t.state=S.ATTRIB_NAME_SAW_WHITE:b(f,o)?t.attribName+=o:R(t,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===o)t.state=S.ATTRIB_VALUE;else{if(g(o))continue;R(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",E(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===o?D(t):b(d,o)?(t.attribName=o,t.state=S.ATTRIB_NAME):(R(t,"Invalid attribute name"),t.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(g(o))continue;y(o)?(t.q=o,t.state=S.ATTRIB_VALUE_QUOTED):(R(t,"Unquoted attribute value"),t.state=S.ATTRIB_VALUE_UNQUOTED,t.attribValue=o);continue;case S.ATTRIB_VALUE_QUOTED:if(o!==t.q){"&"===o?t.state=S.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=o;continue}M(t),t.q="",t.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:g(o)?t.state=S.ATTRIB:">"===o?D(t):"/"===o?t.state=S.OPEN_TAG_SLASH:b(d,o)?(R(t,"No whitespace between attributes"),t.attribName=o,t.attribValue="",t.state=S.ATTRIB_NAME):R(t,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!m(o)){"&"===o?t.state=S.ATTRIB_VALUE_ENTITY_U:t.attribValue+=o;continue}M(t),">"===o?D(t):t.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(t.tagName)">"===o?P(t):b(f,o)?t.tagName+=o:t.script?(t.script+=""===o?P(t):R(t,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var s,u;switch(t.state){case S.TEXT_ENTITY:s=S.TEXT,u="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:s=S.ATTRIB_VALUE_QUOTED,u="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:s=S.ATTRIB_VALUE_UNQUOTED,u="attribValue"}";"===o?(t[u]+=C(t),t.entity="",t.state=s):b(t.entity.length?p:h,o)?t.entity+=o:(R(t,"Invalid character in entity name"),t[u]+="&"+t.entity+o,t.entity="",t.state=s);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&function(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),r=0,o=0,a=i.length;ot)switch(i[o]){case"textNode":T(e);break;case"cdata":E(e,"oncdata",e.cdata),e.cdata="";break;case"script":E(e,"onscript",e.script),e.script="";break;default:A(e,"Max buffer length exceeded: "+i[o])}r=Math.max(r,s)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-r+e.position}(t),t},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(e){T(e),""!==e.cdata&&(E(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(E(e,"onscript",e.script),e.script="")}(this)}};try{r=e("stream").Stream}catch(_){r=function(){}}var a=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function s(e,t){if(!(this instanceof s))return new s(e,t);r.apply(this),this._parser=new o(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,a.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})})}(s.prototype=Object.create(r.prototype,{constructor:{value:s}})).write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var r=e("string_decoder").StringDecoder;this._decoder=new r("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var n=this;return!n._parser["on"+e]&&-1!==a.indexOf(e)&&(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var u="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",l={xml:u,xmlns:c},d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,h=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function y(e){return'"'===e||"'"===e}function m(e){return">"===e||g(e)}function b(e,t){return e.test(t)}function v(e,t){return!b(e,t)}var _,w,x,S=0;for(var j in n.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],r="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=r}),n.STATE)n.STATE[n.STATE[j]]=j;function N(e,t,n){e[t]&&e[t](n)}function E(e,t,n){e.textNode&&T(e),N(e,t,n)}function T(e){e.textNode=I(e.opt,e.textNode),e.textNode&&N(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function A(e,t){return T(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,N(e,"onerror",t),e}function k(e){return e.sawRoot&&!e.closedRoot&&R(e,"Unclosed root tag"),e.state!==S.BEGIN&&e.state!==S.BEGIN_WHITESPACE&&e.state!==S.TEXT&&A(e,"Unexpected end"),T(e),e.c="",e.closed=!0,N(e,"onend"),o.call(e,e.strict,e.opt),e}function R(e,t){if("object"!=typeof e||!(e instanceof o))throw new Error("bad call to strictFail");e.strict&&A(e,t)}function O(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,E(e,"onopentagstart",n)}function L(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function M(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=L(e.attribName,!0),n=t.local;if("xmlns"===t.prefix)if("xml"===n&&e.attribValue!==u)R(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==c)R(e,"xmlns: prefix must be bound to "+c+"\nActual: "+e.attribValue);else{var r=e.tag,i=e.tags[e.tags.length-1]||e;r.ns===i.ns&&(r.ns=Object.create(i.ns)),r.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,E(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function D(e,t){if(e.opt.xmlns){var n=e.tag,r=L(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(R(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix),n.ns&&(e.tags[e.tags.length-1]||e).ns!==n.ns&&Object.keys(n.ns).forEach(function(t){E(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var i=0,o=e.attribList.length;i",e.tagName="",void(e.state=S.SCRIPT);E(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)R(e,"Unexpected close tag");if(t<0)return R(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=S.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,E(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];e.opt.xmlns&&o.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(o.ns).forEach(function(t){E(e,"onclosenamespace",{prefix:t,uri:o.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=S.TEXT}function C(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==n?(R(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function F(e,t){"<"===t?(e.state=S.OPEN_WAKA,e.startTagPosition=e.position):g(t)||(R(e,"Non-whitespace before first tag."),e.textNode=t,e.state=S.TEXT)}function B(e,t){var n="";return t1114111||w(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?t.push(o):t.push(55296+((o-=65536)>>10),o%1024+56320),(n+1===r||t.length>e)&&(i+=_.apply(null,t),t.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:x,configurable:!0,writable:!0}):String.fromCodePoint=x)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,e("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(e,t,n){(function(e,t){(function(){!function(t,n){"use strict";if(!t.setImmediate){var r,i=1,o={},a=!1,s=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){f(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(c="setImmediate$"+Math.random()+"$",l=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(c)&&f(+e.data.slice(c.length))},t.addEventListener?t.addEventListener("message",l,!1):t.attachEvent("onmessage",l),r=function(e){t.postMessage(c+e,"*")}):t.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){f(e.data)},r=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;r=function(t){var n=s.createElement("script");n.onreadystatechange=function(){f(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():r=function(e){setTimeout(f,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=u++,r=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,i(function(){s[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof r?r:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(e,t,n){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(r){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(e,t,n){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},{}],92:[function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;null!==o&&r0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,console&&console.warn&&console.warn(s)}return e}function E(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function T(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=E.bind(r);return i.listener=n,r.wrapFn=i,i}function I(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)v(s,this,t);else{var u=s.length,c=k(s,u);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},w.prototype.listeners=function(e){return I(this,e,!0)},w.prototype.rawListeners=function(e){return I(this,e,!1)},w.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):A.call(e,t)},w.prototype.listenerCount=A,w.prototype.eventNames=function(){return this._eventsCount>0?y(this._events):[]},O.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(O.prototype[Symbol.iterator]=function(){return this}),O.of=function(){var e=arguments,t=e.length,n=0;return new O(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},O.empty=function(){var e=new O(null);return e.done=!0,e},O.is=function(e){return e instanceof O||"object"==typeof e&&null!==e&&"function"==typeof e.next};var L=O,M=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],o=0;;){if(o===r)return i;if((n=e.next()).done)return o!==t?i.slice(0,o):i;i[o++]=n.value}},D=function(e){function n(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return t(n,e),n}(a(Error)),P=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(D),C=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(D),F=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(D);function B(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function G(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function U(e,t){this.key=e,this.attributes=t,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function V(e,t,n,r,i,o){this.key=t,this.attributes=o,this.undirected=e,this.source=r,this.target=i,this.generatedKey=n}function $(e,t,n,r,i,o,a){var s,u,c="out",l="in";if(t&&(c=l="undirected"),e.multi){if(void 0===(u=(s=o[c])[i])&&(u=new Set,s[i]=u),u.add(n),r===i&&t)return;void 0===(s=a[l])[r]&&(s[r]=u)}else{if(o[c][i]=n,r===i&&t)return;a[l][r]=n}}function z(e,t,n){var r=e.multi,i=n.source,o=n.target,a=i.key,s=o.key,u=i[t?"undirected":"out"],c=t?"undirected":"in";if(s in u)if(r){var l=u[s];1===l.size?(delete u[s],delete o[c][a]):l.delete(n)}else delete u[s];r||delete o[c][a]}G.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},U.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var q=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes[r]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+e,o=""+arguments[1];if(!(r=c(this,i,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(i,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes.hasOwnProperty(r)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+r;if(r=arguments[2],i=arguments[3],!(o=c(this,a,s,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&o.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[r]=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+r;if(r=arguments[2],i=arguments[3],!(o=c(this,a,s,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof i)throw new P("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&o.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[r]=i(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete i.attributes[r],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:r}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!d(r))throw new P("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes=r,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!d(r))throw new P("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return u(i.attributes,r),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:r}),this}}}],K=L,H=function(){var e,t=arguments,n=-1;return new K(function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i})},W=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function J(e,t){for(var n in t)e.push(t[n].key)}function Q(e,t){for(var n in t)t[n].forEach(function(t){return e.push(t.key)})}function X(e,t,n){for(var r in e)if(r!==n){var i=e[r];t(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected,i.generatedKey)}}function Y(e,t,n){for(var r in e)r!==n&&e[r].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function Z(e,t,n){for(var r in e)if(r!==n){var i=e[r];if(t(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected,i.generatedKey))return!0}return!1}function ee(e,t,n){var r,i,o,a,s;for(var u in e)if(u!==n)for(r=e[u].values();!0!==(i=r.next()).done;)if(a=(o=i.value).source,t(o.key,o.attributes,a.key,(s=o.target).key,a.attributes,s.attributes,o.undirected,o.generatedKey))return!0;return!1}function te(e,t){var n=Object.keys(e),r=n.length,i=null,o=0;return new L(function a(){var s;if(i){var u=i.next();if(u.done)return i=null,o++,a();s=u.value}else{if(o>=r)return{done:!0};var c=n[o];if(c===t)return o++,a();if((s=e[c])instanceof Set)return i=s.values(),a();o++}return{done:!1,value:[s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes]}})}function ne(e,t,n){var r=t[n];r&&e.push(r.key)}function re(e,t,n){var r=t[n];r&&r.forEach(function(t){return e.push(t.key)})}function ie(e,t,n){var r=e[t];if(r){var i=r.source,o=r.target;n(r.key,r.attributes,i.key,o.key,i.attributes,o.attributes,r.undirected,r.generatedKey)}}function oe(e,t,n){var r=e[t];r&&r.forEach(function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function ae(e,t,n){var r=e[t];if(r){var i=r.source,o=r.target;return n(r.key,r.attributes,i.key,o.key,i.attributes,o.attributes,r.undirected,r.generatedKey)}}function se(e,t,n){var r=e[t];if(r){for(var i,o,a=r.values();!0!==(i=a.next()).done;)if(n((o=i.value).key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected,o.generatedKey))return!0;return!1}}function ue(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new L(function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return L.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ce(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return"function"==typeof Array.from?Array.from(e._edges.keys()):M(e._edges.keys(),e._edges.size);for(var n,r,i=new Array("undirected"===t?e.undirectedSize:e.directedSize),o="undirected"===t,a=e._edges.values(),s=0;!0!==(n=a.next()).done;)(r=n.value).undirected===o&&(i[s++]=r.key);return i}function le(e,t,n){if(0!==e.size)for(var r,i,o="mixed"!==t&&t!==e.type,a="undirected"===t,s=e._edges.values();!0!==(r=s.next()).done;)if(i=r.value,!o||i.undirected===a){var u=i.source,c=i.target;n(i.key,i.attributes,u.key,c.key,u.attributes,c.attributes,i.undirected,i.generatedKey)}}function de(e,t,n){if(0!==e.size)for(var r,i,o="mixed"!==t&&t!==e.type,a="undirected"===t,s=e._edges.values();!0!==(r=s.next()).done;)if(i=r.value,!o||i.undirected===a){var u=i.source,c=i.target;if(n(i.key,i.attributes,u.key,c.key,u.attributes,c.attributes,i.undirected,i.generatedKey))break}}function fe(e,t){if(0===e.size)return L.empty();var n="mixed"!==t&&t!==e.type,r="undirected"===t,i=e._edges.values();return new L(function(){for(var e,t;;){if((e=i.next()).done)return e;if(t=e.value,!n||t.undirected===r)break}return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})}function he(e,t,n,r){var i=[],o=e?Q:J;return"undirected"!==t&&("out"!==n&&o(i,r.in),"in"!==n&&o(i,r.out),!n&&r.directedSelfLoops>0&&i.splice(i.lastIndexOf(r.key),1)),"directed"!==t&&o(i,r.undirected),i}function pe(e,t,n,r,i){var o=e?Y:X;"undirected"!==t&&("out"!==n&&o(r.in,i),"in"!==n&&o(r.out,i,n?null:r.key)),"directed"!==t&&o(r.undirected,i)}function ge(e,t,n,r,i){var o=e?ee:Z;"undirected"!==t&&("out"!==n&&o(r.in,i)||"in"!==n&&o(r.out,i,n?null:r.key))||"directed"===t||o(r.undirected,i)}function ye(e,t,n){var r=L.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=H(r,te(n.in))),"in"!==t&&void 0!==n.out&&(r=H(r,te(n.out,t?null:n.key)))),"directed"!==e&&void 0!==n.undirected&&(r=H(r,te(n.undirected))),r}function me(e,t,n,r,i){var o=t?re:ne,a=[];return"undirected"!==e&&(void 0!==r.in&&"out"!==n&&o(a,r.in,i),void 0!==r.out&&"in"!==n&&o(a,r.out,i),!n&&r.directedSelfLoops>0&&a.splice(a.lastIndexOf(r.key),1)),"directed"!==e&&void 0!==r.undirected&&o(a,r.undirected,i),a}function be(e,t,n,r,i,o){var a=t?oe:ie;"undirected"!==e&&(void 0!==r.in&&"out"!==n&&a(r.in,i,o),r.key!==i&&void 0!==r.out&&"in"!==n&&a(r.out,i,o)),"directed"!==e&&void 0!==r.undirected&&a(r.undirected,i,o)}function ve(e,t,n,r,i,o){var a=t?se:ae;"undirected"!==e&&(void 0!==r.in&&"out"!==n&&a(r.in,i,o)||r.key!==i&&void 0!==r.out&&"in"!==n&&a(r.out,i,o,n?null:r.key))||"directed"===e||void 0===r.undirected||a(r.undirected,i,o)}function _e(e,t,n,r){var i=L.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=H(i,ue(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=H(i,ue(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=H(i,ue(n.undirected,r))),i}var we=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xe(e,t){if(void 0!==t)for(var n in t)e.add(n)}function Se(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&xe(r,n.in),"in"!==t&&xe(r,n.out)),"directed"!==e&&xe(r,n.undirected),M(r.values(),r.size)}function je(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=o===e?i.target:o;n(a.key,a.attributes)}}function Ne(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;e.has(s.key)||(e.add(s.key),r(s.key,s.attributes))}}function Ee(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=o===e?i.target:o;if(n(a.key,a.attributes))return!0}return!1}function Te(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;if(!e.has(s.key)&&(e.add(s.key),r(s.key,s.attributes)))return!0}return!1}function Ie(e,t){var n=Object.keys(t),r=n.length,i=0;return new L(function(){if(i>=r)return{done:!0};var o=t[n[i++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===e?o.target:a;return{done:!1,value:[s.key,s.attributes]}})}function Ae(e,t,n){var r=Object.keys(n),i=r.length,o=0;return new L(function a(){if(o>=i)return{done:!0};var s=n[r[o++]];s instanceof Set&&(s=s.values().next().value);var u=s.source,c=u===t?s.target:u;return e.has(c.key)?a():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function ke(e,t,n,r,i){var o=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===i)return!0;if("in"!==n&&void 0!==o.out)for(var s in o.out)if(s===i)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===i)return!0;return!1}function Re(e,t,n){for(var r,i,o,a,s,u,c,l=t._nodes.values(),d=t.type;!0!==(r=l.next()).done;){if(i=r.value,"undirected"!==d)for(o in a=i.out)if(u=(s=a[o]).target,c=n(i.key,u.key,i.attributes,u.attributes,s.key,s.attributes,s.undirected,s.generatedKey),e&&c)return;if("directed"!==d)for(o in a=i.undirected)if((u=(s=a[o]).target).key!==o&&(u=s.source),c=n(i.key,u.key,i.attributes,u.attributes,s.key,s.attributes,s.undirected,s.generatedKey),e&&c)return}}function Oe(e,t,n){for(var r,i,o,a,s,u,c,l,d,f=t._nodes.values(),h=t.type;!0!==(r=f.next()).done;){if(i=r.value,"undirected"!==h)for(o in u=i.out)for(a=u[o].values();!0!==(s=a.next()).done;)if(l=(c=s.value).target,d=n(i.key,l.key,i.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&d)return;if("directed"!==h)for(o in u=i.undirected)for(a=u[o].values();!0!==(s=a.next()).done;)if((l=(c=s.value).target).key!==o&&(l=c.source),d=n(i.key,l.key,i.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&d)return}}function Le(e,t){var n={key:e};return f(t.attributes)||(n.attributes=u({},t.attributes)),n}function Me(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),f(t.attributes)||(n.attributes=u({},t.attributes)),t.undirected&&(n.undirected=!0),n}function De(e){return d(e)?"key"in e?!("attributes"in e)||d(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function Pe(e){return d(e)?"source"in e?"target"in e?!("attributes"in e)||d(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Ce=new Set(["directed","undirected","mixed"]),Fe=new Set(["domain","_events","_eventsCount","_maxListeners"]),Be={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Ge(e,t,n){var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function Ue(e,t,n,r,i,o,a,s){if(!r&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!d(s))throw new P("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!e.allowSelfLoops&&o===a)throw new F("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=e._nodes.get(o),c=e._nodes.get(a);if(!u)throw new C("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!c)throw new C("Graph.".concat(t,': target node "').concat(a,'" not found.'));var l={key:null,undirected:r,source:o,target:a,attributes:s};if(n&&(i=e._edgeKeyGenerator(l)),e._edges.has(i=""+i))throw new F("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==u.undirected[a]:void 0!==u.out[a]))throw new F("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var f=new V(r,i,n,u,c,s);return e._edges.set(i,f),o===a?r?(u.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(u.directedSelfLoops++,e._directedSelfLoopCount++):r?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),$(e,r,f,o,a,u,c),r?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function Ve(e,t,n,r,i,o,a,s,c){if(!r&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s)if(c){if("function"!=typeof s)throw new P("Graph.".concat(t,': invalid updater function. Expecting a function but got "').concat(s,'"'))}else if(!d(s))throw new P("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));var l;if(o=""+o,a=""+a,c&&(l=s,s=void 0),!e.allowSelfLoops&&o===a)throw new F("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var f,h,p=e._nodes.get(o),g=e._nodes.get(a);if(!n&&(f=e._edges.get(i))){if(f.source.key!==o||f.target.key!==a||r&&(f.source.key!==a||f.target.key!==o))throw new F("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(f.source.key,'", "').concat(f.target.key,'").'));h=f}if(h||e.multi||!p||(h=r?p.undirected[a]:p.out[a]),h)return(c?l:s)?(c?(h.attributes=l(h.attributes),e.emit("edgeAttributesUpdated",{type:"replace",key:h.key,attributes:h.attributes})):(u(h.attributes,s),e.emit("edgeAttributesUpdated",{type:"merge",key:h.key,attributes:h.attributes,data:s})),h.key):h.key;s=s||{},c&&l&&(s=l(s));var y={key:null,undirected:r,source:o,target:a,attributes:s};if(n&&(i=e._edgeKeyGenerator(y)),e._edges.has(i=""+i))throw new F("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return p||(p=Ge(e,o,{}),o===a&&(g=p)),g||(g=Ge(e,a,{})),f=new V(r,i,n,p,g,s),e._edges.set(i,f),o===a?r?(p.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(p.directedSelfLoops++,e._directedSelfLoopCount++):r?(p.undirectedDegree++,g.undirectedDegree++):(p.outDegree++,g.inDegree++),$(e,r,f,o,a,p,g),r?e._undirectedSize++:e._directedSize++,y.key=i,e.emit("edgeAdded",y),i}var $e,ze=function(e){function n(t){var n;if(n=e.call(this)||this,(t=u({},Be,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new P("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new P("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!Ce.has(t.type))throw new P('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new P("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r,i="mixed"===t.type?B:"directed"===t.type?G:U;return h(s(n),"NodeDataClass",i),h(s(n),"_attributes",{}),h(s(n),"_nodes",new Map),h(s(n),"_edges",new Map),h(s(n),"_directedSize",0),h(s(n),"_undirectedSize",0),h(s(n),"_directedSelfLoopCount",0),h(s(n),"_undirectedSelfLoopCount",0),h(s(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(r=0,function(){return r++})),h(s(n),"_options",t),Fe.forEach(function(e){return h(s(n),e,n[e])}),p(s(n),"order",function(){return n._nodes.size}),p(s(n),"size",function(){return n._edges.size}),p(s(n),"directedSize",function(){return n._directedSize}),p(s(n),"undirectedSize",function(){return n._undirectedSize}),p(s(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),p(s(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),p(s(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),p(s(n),"multi",n._options.multi),p(s(n),"type",n._options.type),p(s(n),"allowSelfLoops",n._options.allowSelfLoops),p(s(n),"implementation",function(){return"graphology"}),n}t(n,e);var r=n.prototype;return r.hasNode=function(e){return this._nodes.has(""+e)},r.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&!n.undirected}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.out[t];return!(!i||this.multi&&!i.size)}throw new P("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n.undirected}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.undirected[t];return!(!i||this.multi&&!i.size)}throw new P("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var r=void 0!==n.out&&n.out[t];return r||(r=void 0!==n.undirected&&n.undirected[t]),!(!r||this.multi&&!r.size)}throw new P("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new C('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},r.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new C('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},r.edge=function(e,t){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},r.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(t?n.directedSelfLoops:0)},r.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(t?n.directedSelfLoops:0)},r.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.inDegree+r+(n.outDegree+r)},r.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(t?n.undirectedSelfLoops:0)},r.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var r=0,i=0;return"directed"!==this.type&&(t&&(i=n.undirectedSelfLoops),r+=n.undirectedDegree+2*i),"undirected"!==this.type&&(t&&(i=n.directedSelfLoops),r+=n.inDegree+n.outDegree+2*i),r},r.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},r.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},r.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},r.opposite=function(e,t){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new C('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(e!==r&&e!==i)throw new C('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(i,")."));return e===r?i:r},r.hasExtremity=function(e,t){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new C('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return n.source.key===t||n.target.key===t},r.isUndirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},r.isDirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},r.isSelfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},r.hasGeneratedKey=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.hasGeneratedKey: could not find the "'.concat(e,'" edge in the graph.'));return t.generatedKey},r.addNode=function(e,t){return function(e,t,n){if(n&&!d(n))throw new P('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},e._nodes.has(t=""+t))throw new F('Graph.addNode: the "'.concat(t,'" node already exist in the graph.'));var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}(this,e,t).key},r.mergeNode=function(e,t){if(t&&!d(t))throw new P('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var n=this._nodes.get(e=""+e);return n?(t&&(u(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},r.updateNode=function(e,t){if(t&&"function"!=typeof t)throw new P('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));var n=this._nodes.get(e=""+e);if(n)return t&&(n.attributes=t(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})),e;var r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:r}),e},r.dropNode=function(e){var t=this,n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));this.forEachEdge(e,function(e){t.dropEdge(e)}),this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},r.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=c(this,n,r,this.type)))throw new C('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new C('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t.source,o=t.target,a=t.attributes,s=t.undirected;return i===o?s?(i.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(i.directedSelfLoops--,this._directedSelfLoopCount--):s?(i.undirectedDegree--,o.undirectedDegree--):(i.outDegree--,o.inDegree--),z(this,s,t),s?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:a,source:i.key,target:o.key,undirected:s}),this},r.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},r.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},r.getAttribute=function(e){return this._attributes[e]},r.getAttributes=function(){return this._attributes},r.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},r.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.updateAttribute=function(e,t){if("function"!=typeof t)throw new P("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},r.replaceAttributes=function(e){if(!d(e))throw new P("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},r.mergeAttributes=function(e){if(!d(e))throw new P("Graph.mergeAttributes: provided attributes are not a plain object.");return u(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},r.getNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},r.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new C('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},r.hasNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},r.setNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new C('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new P("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:r.attributes,name:t}),this},r.updateNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new C('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new P("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new P("Graph.updateAttribute: updater should be a function.");var i=r.attributes,o=n(i[t]);return i[t]=o,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:r.attributes,name:t}),this},r.removeNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",attributes:n.attributes,name:t}),this},r.replaceNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!d(t))throw new P("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",attributes:n.attributes}),this},r.mergeNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!d(t))throw new P("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return u(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",attributes:n.attributes,data:t}),this},r.updateEachNodeAttributes=function(e,t){if("function"!=typeof e)throw new P("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!g(t))throw new P("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._nodes.values();!0!==(n=i.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},r.updateEachEdgeAttributes=function(e,t){if("function"!=typeof e)throw new P("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!g(t))throw new P("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._edges.values();!0!==(n=i.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},r.forEach=function(e){if("function"!=typeof e)throw new P("Graph.forEach: expecting a callback.");this.multi?Oe(!1,this,e):Re(!1,this,e)},r.forEachUntil=function(e){if("function"!=typeof e)throw new P("Graph.forEach: expecting a callback.");this.multi?Oe(!0,this,e):Re(!0,this,e)},r.adjacency=function(){return this.multi?(h=(u=this)._nodes.values(),p=u.type,g="outer",y=null,new L(function e(){var t;if("outer"===g)return!0===(t=h.next()).done?t:(c=t.value,g="directed",e());if("directed"===g)return"undirected"===p?(g="undirected",e()):(d=c.out,l=Object.keys(c.out),f=0,g="inner-directed",e());if("undirected"===g){if("directed"===p)return g="outer",e();d=c.undirected,l=Object.keys(c.undirected),f=0,g="inner-undirected"}if(!y&&f>=l.length)return g="inner-undirected"===g?"outer":"undirected",e();if(!y){var n=l[f++];return y=d[n].values(),e()}if((t=y.next()).done)return y=null,e();var r=t.value,i=r.target;return"inner-undirected"===g&&i.key===c.key&&(i=r.source),{done:!1,value:[c.key,i.key,c.attributes,i.attributes,r.key,r.attributes]}})):(o=(e=this)._nodes.values(),a=e.type,s="outer",new L(function e(){var u;if("outer"===s)return!0===(u=o.next()).done?u:(t=u.value,s="directed",e());if("directed"===s)return"undirected"===a?(s="undirected",e()):(r=t.out,n=Object.keys(t.out),i=0,s="inner-directed",e());if("undirected"===s){if("directed"===a)return s="outer",e();r=t.undirected,n=Object.keys(t.undirected),i=0,s="inner-undirected"}if(i>=n.length)return s="inner-undirected"===s?"outer":"undirected",e();var c=n[i++],l=r[c],d=l.target;return"inner-undirected"===s&&d.key===t.key&&(d=l.source),{done:!1,value:[t.key,d.key,t.attributes,d.attributes,l.key,l.attributes]}}));var e,t,n,r,i,o,a,s,u,c,l,d,f,h,p,g,y},r.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):M(this._nodes.keys(),this._nodes.size)},r.forEachNode=function(e){if("function"!=typeof e)throw new P("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,n){e(n,t.attributes)})},r.forEachNodeUntil=function(e){if("function"!=typeof e)throw new P("Graph.forEachNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next())&&!e((n=t.value).key,n.attributes););},r.nodeEntries=function(){var e=this._nodes.values();return new L(function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}})},r.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new C('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return Le(e,t)},r.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return Me(e,t)},r.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(n,r){e[t++]=Le(r,n)});var n=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,r){n[t++]=Me(r,e)}),{attributes:this.getAttributes(),nodes:e,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},r.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=De(e);if(n){if("not-object"===n)throw new P('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new P("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new P("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,o=void 0===i?{}:i;return t?this.mergeNode(r,o):this.addNode(r,o),this},r.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Pe(e);if(n){if("not-object"===n)throw new P('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new P("Graph.importEdge: missing souce.");if("no-target"===n)throw new P("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new P("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new P("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,o=e.attributes,a=void 0===o?{}:o,s=e.undirected,u=void 0!==s&&s;return"key"in e?(t?u?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:u?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,a):(t?u?this.mergeUndirectedEdge:this.mergeDirectedEdge:u?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,a),this},r.import=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),i),this;if(!d(e))throw new P("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!d(e.attributes))throw new P("Graph.import: invalid attributes. Expecting a plain object.");i?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}if(e.nodes){if(r=e.nodes,!Array.isArray(r))throw new P("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=r.length;tn)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this;var e},r.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},r.toJSON=function(){return this.export()},r.toString=function(){return"[object Graph]"},r.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,n){t[n]=e.attributes});var n={},r={};this._edges.forEach(function(t,i){var o=t.undirected?"--":"->",a="",s="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[s]?r[s]=0:r[s]++,a+="".concat(r[s],". ")):a+="[".concat(i,"]: "),n[a+=s]=t.attributes});var i={};for(var o in this)this.hasOwnProperty(o)&&!Fe.has(o)&&"function"!=typeof this[o]&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,h(i,"constructor",this.constructor),i},n}(m.exports.EventEmitter);"undefined"!=typeof Symbol&&(ze.prototype[Symbol.for("nodejs.util.inspect.custom")]=ze.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge","update"].forEach(function(t){var n=e.name(t),r="add"===t?Ue:Ve;ze.prototype[n]=e.generateKey?function(i,o,a){return r(this,n,!0,"undirected"===(e.type||this.type),null,i,o,a,"update"===t)}:function(i,o,a,s){return r(this,n,!1,"undirected"===(e.type||this.type),i,o,a,s,"update"===t)}})}),"undefined"!=typeof Symbol&&(ze.prototype[Symbol.iterator]=ze.prototype.adjacency),$e=ze,q.forEach(function(e){var t=e.name,n=e.attacher;n($e,t("Edge"),"mixed"),n($e,t("DirectedEdge"),"directed"),n($e,t("UndirectedEdge"),"undirected")}),function(e){W.forEach(function(t){var n,r,i,o;i=(n=t).type,o=n.direction,e.prototype[r=n.name]=function(e,t){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];if(!arguments.length)return ce(this,i);if(1===arguments.length){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return he(this.multi,"mixed"===i?this.type:i,o,n)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(r,': could not find the "').concat(t,'" target node in the graph.'));return me(i,this.multi,o,a,t)}throw new P("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return le(this,r,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return pe(this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return be(r,this.multi,i,s,t,n)}throw new P("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return de(this,r,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return ge(this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return ve(r,this.multi,i,s,t,n)}throw new P("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return L.empty();if(!arguments.length)return fe(this,n);if(1===arguments.length){var o=this._nodes.get(e=""+e);if(!o)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return ye(n,r,o)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return _e(n,r,a,t)}throw new P("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(ze),function(e){we.forEach(function(t){var n,r,i,o;i=(n=t).type,o=n.direction,e.prototype[r=n.name]=function(e){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(t))throw new C("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(n))throw new C("Graph.".concat(r,': could not find the "').concat(n,'" node in the graph.'));return ke(this,i,o,t,n)}if(1===arguments.length){var a=this._nodes.get(e=""+e);if(void 0===a)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return Se("mixed"===i?this.type:i,o,a)}throw new P("Graph.".concat(r,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return je(n,n.undirected,r);if("string"==typeof t)return je(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&Ne(i,n,n.in,r),"in"!==t&&Ne(i,n,n.out,r)),"directed"!==e&&Ne(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return Ee(n,n.undirected,r);if("string"==typeof t)return Ee(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&Te(i,n,n.in,r)||"in"!==t&&Te(i,n,n.out,r))||"directed"===e||Te(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return L.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return Ie(n,n.undirected);if("string"==typeof t)return Ie(n,n[t])}var r=L.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=H(r,Ae(i,n,n.in))),"in"!==t&&(r=H(r,Ae(i,n,n.out)))),"directed"!==e&&(r=H(r,Ae(i,n,n.undirected))),r}("mixed"===n?this.type:n,r,t)}}(e,t)})}(ze);var qe=function(e){function n(t){var n=u({type:"directed"},t);if("multi"in n&&!1!==n.multi)throw new P("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new P('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(ze),Ke=function(e){function n(t){var n=u({type:"undirected"},t);if("multi"in n&&!1!==n.multi)throw new P("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new P('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(ze),He=function(e){function n(t){var n=u({multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return e.call(this,n)||this}return t(n,e),n}(ze),We=function(e){function n(t){var n=u({type:"directed",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new P('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(ze),Je=function(e){function n(t){var n=u({type:"undirected",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new P('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(ze);function Qe(e){e.from=function(t,n){var r=u({},t.options,n),i=new e(r);return i.import(t),i}}return Qe(ze),Qe(qe),Qe(Ke),Qe(He),Qe(We),Qe(Je),ze.Graph=ze,ze.DirectedGraph=qe,ze.UndirectedGraph=Ke,ze.MultiGraph=He,ze.MultiDirectedGraph=We,ze.MultiUndirectedGraph=Je,ze.InvalidArgumentsGraphError=P,ze.NotFoundGraphError=C,ze.UsageGraphError=F,ze}()},23815:function(e,t,n){var r;e=n.nmd(e),(function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=32,c=128,l=1/0,d=9007199254740991,f=NaN,h=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],g="[object Arguments]",y="[object Array]",m="[object Boolean]",b="[object Date]",v="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",S="[object Number]",j="[object Object]",N="[object Promise]",E="[object RegExp]",T="[object Set]",I="[object String]",A="[object Symbol]",k="[object WeakMap]",R="[object ArrayBuffer]",O="[object DataView]",L="[object Float32Array]",M="[object Float64Array]",D="[object Int8Array]",P="[object Int16Array]",C="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",G="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,H=RegExp(q.source),W=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",je="a-z\\xdf-\\xf6\\xf8-\\xff",Ne="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="["+we+"]",Ae="["+Te+"]",ke="["+xe+"]",Re="\\d+",Oe="["+Se+"]",Le="["+je+"]",Me="[^"+we+Te+Re+Se+je+Ne+"]",De="\\ud83c[\\udffb-\\udfff]",Pe="[^"+we+"]",Ce="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Be="["+Ne+"]",Ge="(?:"+Le+"|"+Me+")",Ue="(?:"+Be+"|"+Me+")",Ve="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",$e="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",ze="(?:"+ke+"|"+De+")?",qe="["+Ee+"]?",Ke=qe+ze+"(?:\\u200d(?:"+[Pe,Ce,Fe].join("|")+")"+qe+ze+")*",He="(?:"+[Oe,Ce,Fe].join("|")+")"+Ke,We="(?:"+[Pe+ke+"?",ke,Ce,Fe,Ie].join("|")+")",Je=RegExp("['\u2019]","g"),Qe=RegExp(ke,"g"),Xe=RegExp(De+"(?="+De+")|"+We+Ke,"g"),Ye=RegExp([Be+"?"+Le+"+"+Ve+"(?="+[Ae,Be,"$"].join("|")+")",Ue+"+"+$e+"(?="+[Ae,Be+Ge,"$"].join("|")+")",Be+"?"+Ge+"+"+Ve,Be+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,He].join("|"),"g"),Ze=RegExp("[\\u200d"+we+xe+Ee+"]"),et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,rt={};rt[L]=rt[M]=rt[D]=rt[P]=rt[C]=rt[F]=rt[B]=rt[G]=rt[U]=!0,rt[g]=rt[y]=rt[R]=rt[m]=rt[O]=rt[b]=rt[v]=rt[_]=rt[x]=rt[S]=rt[j]=rt[E]=rt[T]=rt[I]=rt[k]=!1;var it={};it[g]=it[y]=it[R]=it[O]=it[m]=it[b]=it[L]=it[M]=it[D]=it[P]=it[C]=it[x]=it[S]=it[j]=it[E]=it[T]=it[I]=it[A]=it[F]=it[B]=it[G]=it[U]=!0,it[v]=it[_]=it[k]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,st=parseInt,ut="object"==typeof global&&global&&global.Object===Object&&global,ct="object"==typeof self&&self&&self.Object===Object&&self,lt=ut||ct||Function("return this")(),dt=t&&!t.nodeType&&t,ft=dt&&e&&!e.nodeType&&e,ht=ft&&ft.exports===dt,pt=ht&&ut.process,gt=function(){try{return ft&&ft.require&&ft.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),yt=gt&>.isArrayBuffer,mt=gt&>.isDate,bt=gt&>.isMap,vt=gt&>.isRegExp,_t=gt&>.isSet,wt=gt&>.isTypedArray;function xt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function St(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function At(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Yt(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function Zt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var en=$t({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),tn=$t({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+ot[e]}function rn(e){return Ze.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function an(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"}),hn=function e(t){var n,r=(t=null==t?lt:hn.defaults(lt.Object(),t,hn.pick(lt,tt))).Array,ie=t.Date,we=t.Error,xe=t.Function,Se=t.Math,je=t.Object,Ne=t.RegExp,Ee=t.String,Te=t.TypeError,Ie=r.prototype,Ae=je.prototype,ke=t["__core-js_shared__"],Re=xe.prototype.toString,Oe=Ae.hasOwnProperty,Le=0,Me=(n=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=Ae.toString,Pe=Re.call(je),Ce=lt._,Fe=Ne("^"+Re.call(Oe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ht?t.Buffer:i,Ge=t.Symbol,Ue=t.Uint8Array,Ve=Be?Be.allocUnsafe:i,$e=an(je.getPrototypeOf,je),ze=je.create,qe=Ae.propertyIsEnumerable,Ke=Ie.splice,He=Ge?Ge.isConcatSpreadable:i,We=Ge?Ge.iterator:i,Xe=Ge?Ge.toStringTag:i,Ze=function(){try{var e=so(je,"defineProperty");return e({},"",{}),e}catch(Lo){}}(),ot=t.clearTimeout!==lt.clearTimeout&&t.clearTimeout,ut=ie&&ie.now!==lt.Date.now&&ie.now,ct=t.setTimeout!==lt.setTimeout&&t.setTimeout,dt=Se.ceil,ft=Se.floor,pt=je.getOwnPropertySymbols,gt=Be?Be.isBuffer:i,Dt=t.isFinite,$t=Ie.join,pn=an(je.keys,je),gn=Se.max,yn=Se.min,mn=ie.now,bn=t.parseInt,vn=Se.random,_n=Ie.reverse,wn=so(t,"DataView"),xn=so(t,"Map"),Sn=so(t,"Promise"),jn=so(t,"Set"),Nn=so(t,"WeakMap"),En=so(je,"create"),Tn=Nn&&new Nn,In={},An=Co(wn),kn=Co(xn),Rn=Co(Sn),On=Co(jn),Ln=Co(Nn),Mn=Ge?Ge.prototype:i,Dn=Mn?Mn.valueOf:i,Pn=Mn?Mn.toString:i;function Cn(e){if(es(e)&&!$a(e)&&!(e instanceof Un)){if(e instanceof Gn)return e;if(Oe.call(e,"__wrapped__"))return Fo(e)}return new Gn(e)}var Fn=function(){function e(){}return function(t){if(!Za(t))return{};if(ze)return ze(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Bn(){}function Gn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function or(e,t,n,r,o,a){var s,u=1&t,c=2&t,l=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!Za(e))return e;var d=$a(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return Ni(e,s)}else{var f=lo(e),h=f==_||f==w;if(Ha(e))return vi(e,u);if(f==j||f==g||h&&!o){if(s=c||h?{}:ho(e),!u)return c?function(e,t){return Ei(e,co(e),t)}(e,function(e,t){return e&&Ei(t,Rs(t),e)}(s,e)):function(e,t){return Ei(e,uo(e),t)}(e,tr(s,e))}else{if(!it[f])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case R:return _i(e);case m:case b:return new r(+e);case O:return function(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case M:case D:case P:case C:case F:case B:case G:case U:return wi(e,n);case x:return new r;case S:case I:return new r(e);case E:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new r;case A:return function(e){return Dn?je(Dn.call(e)):{}}(e)}}(e,f,u)}}a||(a=new Kn);var p=a.get(e);if(p)return p;a.set(e,s),os(e)?e.forEach(function(r){s.add(or(r,t,n,r,e,a))}):ts(e)&&e.forEach(function(r,i){s.set(i,or(r,t,n,i,e,a))});var y=d?i:(l?c?eo:Zi:c?Rs:ks)(e);return jt(y||e,function(r,i){y&&(r=e[i=r]),Yn(s,i,or(r,t,n,i,e,a))}),s}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var o=n[r],a=e[o];if(a===i&&!(o in e)||!(0,t[o])(a))return!1}return!0}function sr(e,t,n){if("function"!=typeof e)throw new Te(o);return Io(function(){e.apply(i,n)},t)}function ur(e,t,n,r){var i=-1,o=It,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=kt(t,Wt(n))),r?(o=At,a=!1):t.length>=200&&(o=Qt,a=!1,t=new qn(t));e:for(;++i-1},$n.prototype.set=function(e,t){var n=this.__data__,r=Zn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(xn||$n),string:new Vn}},zn.prototype.delete=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},zn.prototype.get=function(e){return oo(this,e).get(e)},zn.prototype.has=function(e){return oo(this,e).has(e)},zn.prototype.set=function(e,t){var n=oo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(e){return this.__data__.set(e,a),this},qn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new $n,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof $n){var r=n.__data__;if(!xn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new zn(r)}return n.set(e,t),this.size=n.size,this};var cr=Ai(mr),lr=Ai(br,!0);function dr(e,t){var n=!0;return cr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function fr(e,t,n){for(var r=-1,o=e.length;++r0&&n(s)?t>1?pr(s,t-1,n,r,i):Rt(i,s):r||(i[i.length]=s)}return i}var gr=ki(),yr=ki(!0);function mr(e,t){return e&&gr(e,t,ks)}function br(e,t){return e&&yr(e,t,ks)}function vr(e,t){return Tt(t,function(t){return Qa(e[t])})}function _r(e,t){for(var n=0,r=(t=gi(t,e)).length;null!=e&&nt}function jr(e,t){return null!=e&&Oe.call(e,t)}function Nr(e,t){return null!=e&&t in je(e)}function Er(e,t,n){for(var o=n?At:It,a=e[0].length,s=e.length,u=s,c=r(s),l=1/0,d=[];u--;){var f=e[u];u&&t&&(f=kt(f,Wt(t))),l=yn(f.length,l),c[u]=!n&&(t||a>=120&&f.length>=120)?new qn(u&&f):i}f=e[0];var h=-1,p=c[0];e:for(;++h=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Dr(e,function(e,n,i){return{criteria:kt(t,function(t){return t(e)}),index:++r,value:e}}))}function Ur(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Ke.call(s,u,1),Ke.call(e,u,1);return e}function $r(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;go(i)?Ke.call(e,i,1):si(e,i)}}return e}function zr(e,t){return e+ft(vn()*(t-e+1))}function qr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=ft(t/2))&&(e+=e)}while(t);return n}function Kr(e,t){return Ao(So(e,t,nu),e+"")}function Hr(e){return Wn(Bs(e))}function Wr(e,t){var n=Bs(e);return Oo(n,ir(t,0,n.length))}function Jr(e,t,n,r){if(!Za(e))return e;for(var o=-1,a=(t=gi(t,e)).length,s=a-1,u=e;null!=u&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!ss(a)&&(n?a<=t:a=200){var c=t?null:qi(e);if(c)return un(c);a=!1,i=Qt,u=new qn}else u=t?[]:s;e:for(;++r=r?e:Zr(e,t,n)}var bi=ot||function(e){return lt.clearTimeout(e)};function vi(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function _i(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function wi(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function xi(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=ss(e),s=t!==i,u=null===t,c=t==t,l=ss(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!l&&e1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&yo(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=je(t);++r-1?o[a?t[s]:s]:i}}function Di(e){return Yi(function(t){var n=t.length,r=n,a=Gn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Te(o);if(a&&!u&&"wrapper"==no(s))var u=new Gn([],!0)}for(r=u?r:n;++r1&&v.reverse(),h&&du))return!1;var l=a.get(e),d=a.get(t);if(l&&d)return l==t&&d==e;var f=-1,h=!0,p=2&n?new qn:i;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(p,function(n){var r="_."+n[0];t&n[1]&&!It(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(se):[]}(r),n)))}function Ro(e){var t=0,n=0;return function(){var r=mn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Oo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,ia(e,n)});function da(e){var t=Cn(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var ha=Yi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return rr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Un&&go(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new Gn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(i),e})):this.thru(o)}),pa=Ti(function(e,t,n){Oe.call(e,n)?++e[n]:nr(e,n,1)}),ga=Mi(Vo),ya=Mi($o);function ma(e,t){return($a(e)?jt:cr)(e,io(t,3))}function ba(e,t){return($a(e)?Nt:lr)(e,io(t,3))}var va=Ti(function(e,t,n){Oe.call(e,n)?e[n].push(t):nr(e,n,[t])}),_a=Kr(function(e,t,n){var i=-1,o="function"==typeof t,a=qa(e)?r(e.length):[];return cr(e,function(e){a[++i]=o?xt(t,e,n):Tr(e,t,n)}),a}),wa=Ti(function(e,t,n){nr(e,n,t)});function xa(e,t){return($a(e)?kt:Dr)(e,io(t,3))}var Sa=Ti(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ja=Kr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,pr(t,1),[])}),Na=ut||function(){return lt.Date.now()};function Ea(e,t,n){return t=n?i:t,Hi(e,c,i,i,i,i,t=e&&null==t?e.length:t)}function Ta(e,t){var n;if("function"!=typeof t)throw new Te(o);return e=hs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ia=Kr(function(e,t,n){var r=1;if(n.length){var i=sn(n,ro(Ia));r|=u}return Hi(e,r,t,n,i)}),Aa=Kr(function(e,t,n){var r=3;if(n.length){var i=sn(n,ro(Aa));r|=u}return Hi(t,r,e,n,i)});function ka(e,t,n){var r,a,s,u,c,l,d=0,f=!1,h=!1,p=!0;if("function"!=typeof e)throw new Te(o);function g(t){var n=r,o=a;return r=a=i,d=t,u=e.apply(o,n)}function y(e){return d=e,c=Io(b,t),f?g(e):u}function m(e){var n=e-l;return l===i||n>=t||n<0||h&&e-d>=s}function b(){var e=Na();if(m(e))return v(e);c=Io(b,function(e){var n=t-(e-l);return h?yn(n,s-(e-d)):n}(e))}function v(e){return c=i,p&&r?g(e):(r=a=i,u)}function _(){var e=Na(),n=m(e);if(r=arguments,a=this,l=e,n){if(c===i)return y(l);if(h)return bi(c),c=Io(b,t),g(l)}return c===i&&(c=Io(b,t)),u}return t=gs(t)||0,Za(n)&&(f=!!n.leading,s=(h="maxWait"in n)?gn(gs(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==i&&bi(c),d=0,r=l=a=c=i},_.flush=function(){return c===i?u:v(Na())},_}var Ra=Kr(function(e,t){return sr(e,1,t)}),Oa=Kr(function(e,t,n){return sr(e,gs(t)||0,n)});function La(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(La.Cache||zn),n}function Ma(e){if("function"!=typeof e)throw new Te(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}La.Cache=zn;var Da=yi(function(e,t){var n=(t=1==t.length&&$a(t[0])?kt(t[0],Wt(io())):kt(pr(t,1),Wt(io()))).length;return Kr(function(r){for(var i=-1,o=yn(r.length,n);++i=t}),Va=Ir(function(){return arguments}())?Ir:function(e){return es(e)&&Oe.call(e,"callee")&&!qe.call(e,"callee")},$a=r.isArray,za=yt?Wt(yt):function(e){return es(e)&&xr(e)==R};function qa(e){return null!=e&&Ya(e.length)&&!Qa(e)}function Ka(e){return es(e)&&qa(e)}var Ha=gt||gu,Wa=mt?Wt(mt):function(e){return es(e)&&xr(e)==b};function Ja(e){if(!es(e))return!1;var t=xr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function Qa(e){if(!Za(e))return!1;var t=xr(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xa(e){return"number"==typeof e&&e==hs(e)}function Ya(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Wt(bt):function(e){return es(e)&&lo(e)==x};function ns(e){return"number"==typeof e||es(e)&&xr(e)==S}function rs(e){if(!es(e)||xr(e)!=j)return!1;var t=$e(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Re.call(n)==Pe}var is=vt?Wt(vt):function(e){return es(e)&&xr(e)==E},os=_t?Wt(_t):function(e){return es(e)&&lo(e)==T};function as(e){return"string"==typeof e||!$a(e)&&es(e)&&xr(e)==I}function ss(e){return"symbol"==typeof e||es(e)&&xr(e)==A}var us=wt?Wt(wt):function(e){return es(e)&&Ya(e.length)&&!!rt[xr(e)]},cs=Vi(Mr),ls=Vi(function(e,t){return e<=t});function ds(e){if(!e)return[];if(qa(e))return as(e)?ln(e):Ni(e);if(We&&e[We])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[We]());var t=lo(e);return(t==x?on:t==T?un:Bs)(e)}function fs(e){return e?(e=gs(e))===l||e===-l?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function hs(e){var t=fs(e),n=t%1;return t==t?n?t-n:t:0}function ps(e){return e?ir(hs(e),0,h):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return f;if(Za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ht(e);var n=pe.test(e);return n||ye.test(e)?st(e.slice(2),n?2:8):he.test(e)?f:+e}function ys(e){return Ei(e,Rs(e))}function ms(e){return null==e?"":oi(e)}var bs=Ii(function(e,t){if(_o(t)||qa(t))Ei(t,ks(t),e);else for(var n in t)Oe.call(t,n)&&Yn(e,n,t[n])}),vs=Ii(function(e,t){Ei(t,Rs(t),e)}),_s=Ii(function(e,t,n,r){Ei(t,Rs(t),e,r)}),ws=Ii(function(e,t,n,r){Ei(t,ks(t),e,r)}),xs=Yi(rr),Ss=Kr(function(e,t){e=je(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n1),t}),Ei(e,eo(e),n),r&&(n=or(n,7,Qi));for(var i=t.length;i--;)si(n,t[i]);return n}),Ds=Yi(function(e,t){return null==e?{}:function(e,t){return Ur(e,t,function(t,n){return Es(e,n)})}(e,t)});function Ps(e,t){if(null==e)return{};var n=kt(eo(e),function(e){return[e]});return t=io(t),Ur(e,n,function(e,n){return t(e,n[0])})}var Cs=Ki(ks),Fs=Ki(Rs);function Bs(e){return null==e?[]:Jt(e,ks(e))}var Gs=Oi(function(e,t,n){return t=t.toLowerCase(),e+(n?Us(t):t)});function Us(e){return Js(ms(e).toLowerCase())}function Vs(e){return(e=ms(e))&&e.replace(be,en).replace(Qe,"")}var $s=Oi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),zs=Oi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qs=Ri("toLowerCase"),Ks=Oi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Hs=Oi(function(e,t,n){return e+(n?" ":"")+Js(t)}),Ws=Oi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Js=Ri("toUpperCase");function Qs(e,t,n){return e=ms(e),(t=n?i:t)===i?function(e){return et.test(e)}(e)?function(e){return e.match(Ye)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Xs=Kr(function(e,t){try{return xt(e,i,t)}catch(Mo){return Ja(Mo)?Mo:new we(Mo)}}),Ys=Yi(function(e,t){return jt(t,function(t){t=Po(t),nr(e,t,Ia(e[t],e))}),e});function Zs(e){return function(){return e}}var eu=Di(),tu=Di(!0);function nu(e){return e}function ru(e){return Or("function"==typeof e?e:or(e,1))}var iu=Kr(function(e,t){return function(n){return Tr(n,e,t)}}),ou=Kr(function(e,t){return function(n){return Tr(e,n,t)}});function au(e,t,n){var r=ks(t),i=vr(t,r);null==n&&(!Za(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=vr(t,ks(t)));var o=!(Za(n)&&"chain"in n&&!n.chain),a=Qa(e);return jt(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Ni(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Rt([this.value()],arguments))})}),e}function su(){}var uu=Bi(kt),cu=Bi(Et),lu=Bi(Mt);function du(e){return mo(e)?Vt(Po(e)):function(e){return function(t){return _r(t,e)}}(e)}var fu=Ui(),hu=Ui(!0);function pu(){return[]}function gu(){return!1}var yu=Fi(function(e,t){return e+t},0),mu=zi("ceil"),bu=Fi(function(e,t){return e/t},1),vu=zi("floor"),_u=Fi(function(e,t){return e*t},1),wu=zi("round"),xu=Fi(function(e,t){return e-t},0);return Cn.after=function(e,t){if("function"!=typeof t)throw new Te(o);return e=hs(e),function(){if(--e<1)return t.apply(this,arguments)}},Cn.ary=Ea,Cn.assign=bs,Cn.assignIn=vs,Cn.assignInWith=_s,Cn.assignWith=ws,Cn.at=xs,Cn.before=Ta,Cn.bind=Ia,Cn.bindAll=Ys,Cn.bindKey=Aa,Cn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $a(e)?e:[e]},Cn.chain=da,Cn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:gn(hs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,u=r(dt(o/t));ao?0:o+n),(r=r===i||r>o?o:hs(r))<0&&(r+=o),r=n>r?0:ps(r);n>>0)?(e=ms(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=oi(t))&&rn(e)?mi(ln(e),0,n):e.split(t,n):[]},Cn.spread=function(e,t){if("function"!=typeof e)throw new Te(o);return t=null==t?0:gn(hs(t),0),Kr(function(n){var r=n[t],i=mi(n,0,t);return r&&Rt(i,r),xt(e,this,i)})},Cn.tail=function(e){var t=null==e?0:e.length;return t?Zr(e,1,t):[]},Cn.take=function(e,t,n){return e&&e.length?Zr(e,0,(t=n||t===i?1:hs(t))<0?0:t):[]},Cn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Zr(e,(t=r-(t=n||t===i?1:hs(t)))<0?0:t,r):[]},Cn.takeRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!1,!0):[]},Cn.takeWhile=function(e,t){return e&&e.length?ci(e,io(t,3)):[]},Cn.tap=function(e,t){return t(e),e},Cn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Te(o);return Za(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ka(e,t,{leading:r,maxWait:t,trailing:i})},Cn.thru=fa,Cn.toArray=ds,Cn.toPairs=Cs,Cn.toPairsIn=Fs,Cn.toPath=function(e){return $a(e)?kt(e,Po):ss(e)?[e]:Ni(Do(ms(e)))},Cn.toPlainObject=ys,Cn.transform=function(e,t,n){var r=$a(e),i=r||Ha(e)||us(e);if(t=io(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Za(e)&&Qa(o)?Fn($e(e)):{}}return(i?jt:mr)(e,function(e,r,i){return t(n,e,r,i)}),n},Cn.unary=function(e){return Ea(e,1)},Cn.union=ea,Cn.unionBy=ta,Cn.unionWith=na,Cn.uniq=function(e){return e&&e.length?ai(e):[]},Cn.uniqBy=function(e,t){return e&&e.length?ai(e,io(t,2)):[]},Cn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Cn.unset=function(e,t){return null==e||si(e,t)},Cn.unzip=ra,Cn.unzipWith=ia,Cn.update=function(e,t,n){return null==e?e:ui(e,t,pi(n))},Cn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ui(e,t,pi(n),r)},Cn.values=Bs,Cn.valuesIn=function(e){return null==e?[]:Jt(e,Rs(e))},Cn.without=oa,Cn.words=Qs,Cn.wrap=function(e,t){return Pa(pi(t),e)},Cn.xor=aa,Cn.xorBy=sa,Cn.xorWith=ua,Cn.zip=ca,Cn.zipObject=function(e,t){return fi(e||[],t||[],Yn)},Cn.zipObjectDeep=function(e,t){return fi(e||[],t||[],Jr)},Cn.zipWith=la,Cn.entries=Cs,Cn.entriesIn=Fs,Cn.extend=vs,Cn.extendWith=_s,au(Cn,Cn),Cn.add=yu,Cn.attempt=Xs,Cn.camelCase=Gs,Cn.capitalize=Us,Cn.ceil=mu,Cn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=gs(n))==n?n:0),t!==i&&(t=(t=gs(t))==t?t:0),ir(gs(e),t,n)},Cn.clone=function(e){return or(e,4)},Cn.cloneDeep=function(e){return or(e,5)},Cn.cloneDeepWith=function(e,t){return or(e,5,t="function"==typeof t?t:i)},Cn.cloneWith=function(e,t){return or(e,4,t="function"==typeof t?t:i)},Cn.conformsTo=function(e,t){return null==t||ar(e,t,ks(t))},Cn.deburr=Vs,Cn.defaultTo=function(e,t){return null==e||e!=e?t:e},Cn.divide=bu,Cn.endsWith=function(e,t,n){e=ms(e),t=oi(t);var r=e.length,o=n=n===i?r:ir(hs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Cn.eq=Ba,Cn.escape=function(e){return(e=ms(e))&&W.test(e)?e.replace(K,tn):e},Cn.escapeRegExp=function(e){return(e=ms(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Cn.every=function(e,t,n){var r=$a(e)?Et:dr;return n&&yo(e,t,n)&&(t=i),r(e,io(t,3))},Cn.find=ga,Cn.findIndex=Vo,Cn.findKey=function(e,t){return Pt(e,io(t,3),mr)},Cn.findLast=ya,Cn.findLastIndex=$o,Cn.findLastKey=function(e,t){return Pt(e,io(t,3),br)},Cn.floor=vu,Cn.forEach=ma,Cn.forEachRight=ba,Cn.forIn=function(e,t){return null==e?e:gr(e,io(t,3),Rs)},Cn.forInRight=function(e,t){return null==e?e:yr(e,io(t,3),Rs)},Cn.forOwn=function(e,t){return e&&mr(e,io(t,3))},Cn.forOwnRight=function(e,t){return e&&br(e,io(t,3))},Cn.get=Ns,Cn.gt=Ga,Cn.gte=Ua,Cn.has=function(e,t){return null!=e&&fo(e,t,jr)},Cn.hasIn=Es,Cn.head=qo,Cn.identity=nu,Cn.includes=function(e,t,n,r){e=qa(e)?e:Bs(e),n=n&&!r?hs(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),as(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Cn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:hs(n);return i<0&&(i=gn(r+i,0)),Ft(e,t,i)},Cn.inRange=function(e,t,n){return t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n){return e>=yn(t,n)&&e=-d&&e<=d},Cn.isSet=os,Cn.isString=as,Cn.isSymbol=ss,Cn.isTypedArray=us,Cn.isUndefined=function(e){return e===i},Cn.isWeakMap=function(e){return es(e)&&lo(e)==k},Cn.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==xr(e)},Cn.join=function(e,t){return null==e?"":$t.call(e,t)},Cn.kebabCase=$s,Cn.last=Jo,Cn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=hs(n))<0?gn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ct(e,Gt,o,!0)},Cn.lowerCase=zs,Cn.lowerFirst=qs,Cn.lt=cs,Cn.lte=ls,Cn.max=function(e){return e&&e.length?fr(e,nu,Sr):i},Cn.maxBy=function(e,t){return e&&e.length?fr(e,io(t,2),Sr):i},Cn.mean=function(e){return Ut(e,nu)},Cn.meanBy=function(e,t){return Ut(e,io(t,2))},Cn.min=function(e){return e&&e.length?fr(e,nu,Mr):i},Cn.minBy=function(e,t){return e&&e.length?fr(e,io(t,2),Mr):i},Cn.stubArray=pu,Cn.stubFalse=gu,Cn.stubObject=function(){return{}},Cn.stubString=function(){return""},Cn.stubTrue=function(){return!0},Cn.multiply=_u,Cn.nth=function(e,t){return e&&e.length?Br(e,hs(t)):i},Cn.noConflict=function(){return lt._===this&&(lt._=Ce),this},Cn.noop=su,Cn.now=Na,Cn.pad=function(e,t,n){e=ms(e);var r=(t=hs(t))?cn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(ft(i),n)+e+Gi(dt(i),n)},Cn.padEnd=function(e,t,n){e=ms(e);var r=(t=hs(t))?cn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=vn();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return zr(e,t)},Cn.reduce=function(e,t,n){var r=$a(e)?Ot:zt,i=arguments.length<3;return r(e,io(t,4),n,i,cr)},Cn.reduceRight=function(e,t,n){var r=$a(e)?Lt:zt,i=arguments.length<3;return r(e,io(t,4),n,i,lr)},Cn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:hs(t),qr(ms(e),t)},Cn.replace=function(){var e=arguments,t=ms(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Cn.result=function(e,t,n){var r=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=i);++rd)return[];var n=h,r=yn(e,h);t=io(t),e-=h;for(var i=Kt(r,t);++n=a)return e;var u=n-cn(r);if(u<1)return r;var c=s?mi(s,0,u).join(""):e.slice(0,u);if(o===i)return c+r;if(s&&(u+=c.length-u),is(o)){if(e.slice(u).search(o)){var l,d=c;for(o.global||(o=Ne(o.source,ms(fe.exec(o))+"g")),o.lastIndex=0;l=o.exec(d);)var f=l.index;c=c.slice(0,f===i?u:f)}}else if(e.indexOf(oi(o),u)!=u){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+r},Cn.unescape=function(e){return(e=ms(e))&&H.test(e)?e.replace(q,fn):e},Cn.uniqueId=function(e){var t=++Le;return ms(e)+t},Cn.upperCase=Ws,Cn.upperFirst=Js,Cn.each=ma,Cn.eachRight=ba,Cn.first=qo,au(Cn,function(){var e={};return mr(Cn,function(t,n){Oe.call(Cn.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),Cn.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Cn[e].placeholder=Cn}),jt(["drop","take"],function(e,t){Un.prototype[e]=function(n){n=n===i?1:gn(hs(n),0);var r=this.__filtered__&&!t?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,h),type:e+(r.__dir__<0?"Right":"")}),r},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),jt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),jt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}}),jt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}}),Un.prototype.compact=function(){return this.filter(nu)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Kr(function(e,t){return"function"==typeof e?new Un(this):this.map(function(n){return Tr(n,e,t)})}),Un.prototype.reject=function(e){return this.filter(Ma(io(e)))},Un.prototype.slice=function(e,t){e=hs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Un(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=hs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(h)},mr(Un.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Cn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);!o||(Cn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,u=t instanceof Un,c=s[0],l=u||$a(t),d=function(e){var t=o.apply(Cn,Rt([e],s));return r&&f?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var f=this.__chain__,h=!!this.__actions__.length,p=a&&!f,g=u&&!h;if(!a&&l){t=g?t:new Un(this);var y=e.apply(t,s);return y.__actions__.push({func:fa,args:[d],thisArg:i}),new Gn(y,f)}return p&&g?e.apply(this,s):(y=this.thru(d),p?r?y.value()[0]:y.value():y)})}),jt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ie[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Cn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply($a(i)?i:[],e)}return this[n](function(n){return t.apply($a(n)?n:[],e)})}}),mr(Un.prototype,function(e,t){var n=Cn[t];if(n){var r=n.name+"";Oe.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}}),In[Pi(i,2).name]=[{name:"wrapper",func:i}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=Ni(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ni(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ni(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=$a(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Cn.prototype.plant=function(e){for(var t,n=this;n instanceof Bn;){var r=Fo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Cn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:fa,args:[Zo],thisArg:i}),new Gn(t,this.__chain__)}return this.thru(Zo)},Cn.prototype.toJSON=Cn.prototype.valueOf=Cn.prototype.value=function(){return li(this.__wrapped__,this.__actions__)},Cn.prototype.first=Cn.prototype.head,We&&(Cn.prototype[We]=function(){return this}),Cn}();lt._=hn,(r=(function(){return hn}).call(t,n,t,e))!==i&&(e.exports=r)}).call(this)},29369:function(e,t,n){var r=n(56284),i=n(67830);function o(){this.clear()}o.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},o.prototype.enqueue=function(e){return this.items.push(e),++this.size},o.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},o.prototype.peek=function(){if(this.size)return this.items[this.offset]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.offset,r=0,i=this.items.length;n=e.length)return{done:!0};var n=e[t];return t++,{value:n,done:!1}})},o.prototype.entries=function(){var e=this.items,t=this.offset,n=0;return new r(function(){if(t>=e.length)return{done:!0};var r=e[t];return t++,{value:[n++,r],done:!1}})},"undefined"!=typeof Symbol&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(",")},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:o,enumerable:!1}),e},"undefined"!=typeof Symbol&&(o.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.prototype.inspect),o.from=function(e){var t=new o;return i(e,function(e){t.enqueue(e)}),t},o.of=function(){return o.from(arguments)},e.exports=o},67830:function(e){var t="undefined"!=typeof ArrayBuffer,n="undefined"!=typeof Symbol;function r(e,r){var i,o,a,s,u;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a=n?{done:!0}:{done:!1,value:e[r++]}})},t.empty=function(){var e=new t(null);return e.done=!0,e},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},86991:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(14180),t),i(n(75103),t),i(n(48965),t),i(n(32595),t),i(n(82417),t),i(n(92451),t),i(n(17735),t)},14180:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},75103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;const r=n(14180),i=n(48965),o=n(32595),a=n(82417),s=n(92451),u=n(17735);let c=0;t.DataFactory=class{constructor(e){this.blankNodeCounter=0,this.blankNodePrefix=(e=e||{}).blankNodePrefix||`df_${c++}_`}namedNode(e){return new a.NamedNode(e)}blankNode(e){return new r.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new o.Literal(e,t)}variable(e){return new u.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,n,r){return new s.Quad(e,t,n,r||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(o.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},48965:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}t.DefaultGraph=n,n.INSTANCE=new n},32595:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;const r=n(82417);class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=i.XSD_STRING)}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}t.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},92451:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=class{constructor(e,t,n,r){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},17735:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},31609:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedJavaScriptPrimitives=t.getSupportedRdfDatatypes=t.getTermRaw=t.toRdf=t.fromRdf=void 0;const o=n(86991),a=n(9938),s=n(66060);i(n(9938),t),i(n(88871),t),i(n(66060),t);const u=new o.DataFactory,c=new s.Translator;function l(e,t){return c.fromRdf(e,t)}c.registerHandler(new a.TypeHandlerString,a.TypeHandlerString.TYPES.map(e=>u.namedNode(e)),["string"]),c.registerHandler(new a.TypeHandlerBoolean,[a.TypeHandlerBoolean.TYPE].map(e=>u.namedNode(e)),["boolean"]),c.registerHandler(new a.TypeHandlerNumberDouble,a.TypeHandlerNumberDouble.TYPES.map(e=>u.namedNode(e)),["number"]),c.registerHandler(new a.TypeHandlerNumberInteger,a.TypeHandlerNumberInteger.TYPES.map(e=>u.namedNode(e)),["number"]),c.registerHandler(new a.TypeHandlerDate,a.TypeHandlerDate.TYPES.map(e=>u.namedNode(e)),["object"]),t.fromRdf=l,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=u),c.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?l(e,t):e.value},t.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66060:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw new Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,n){for(const r of t)this.supportedRdfDatatypes.push(r),this.fromRdfHandlers[r.value]=e;for(const r of n){let t=this.toRdfHandlers[r];t||(this.toRdfHandlers[r]=t=[]),t.push(e)}}fromRdf(e,t){const n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}toRdf(e,t){const n=this.toRdfHandlers[typeof e];if(n)for(const r of n){const n=r.toRdf(e,t);if(n)return n}throw new Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},80727:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;const r=n(66060);class i{fromRdf(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&r.Translator.incorrectRdfDataType(e),!1}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e?"true":"false",t||n.namedNode(i.TYPE))}}t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;const r=n(66060);class i{fromRdf(e,t){switch(t&&!e.value.match(i.VALIDATORS[e.datatype.value.substr(33,e.datatype.value.length)])&&r.Translator.incorrectRdfDataType(e),e.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(e.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const t=e.value.split("-");return new Date(0,parseInt(t[0],10)-1,parseInt(t[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(e.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(e.value+"-01");default:return new Date(e.value)}}toRdf(e,{datatype:t,dataFactory:n}){if(t=t||n.namedNode(i.TYPES[0]),!(e instanceof Date))return null;const r=e;let o;switch(t.value){case"http://www.w3.org/2001/XMLSchema#gDay":o=String(r.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":o=r.getUTCMonth()+1+"-"+r.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":o=String(r.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":o=r.getUTCFullYear()+"-"+(r.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":o=r.toISOString().replace(/T.*$/,"");break;default:o=r.toISOString()}return n.literal(o,t)}}t.TypeHandlerDate=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}},38554:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;const r=n(66060);class i{fromRdf(e,t){const n=parseFloat(e.value);return t&&isNaN(n)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return t=t||n.namedNode(i.TYPES[0]),isNaN(e)?n.literal("NaN",t):isFinite(e)?e%1==0?null:n.literal(e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),t):n.literal(e>0?"INF":"-INF",t)}}t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;const r=n(66060);class i{fromRdf(e,t){const n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(String(e),t||n.namedNode(e<=i.MAX_INT&&e>=i.MIN_INT?i.TYPES[0]:i.TYPES[1]))}}t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},14608:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;class n{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e,t)}}t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(80727),t),i(n(52525),t),i(n(38554),t),i(n(37750),t),i(n(14608),t)},91052:function(e){function t(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)})}},e.exports.default=e.exports,e.exports.__esModule=!0}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";function e(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())})}function t(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}let r;function i(){return r||(r=function(e,n){const r=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const n=()=>indexedDB.databases().finally(t);e=setInterval(n,100),n()}).finally(()=>clearInterval(e))}().then(()=>{const e=indexedDB.open("keyval-store");return e.onupgradeneeded=()=>e.result.createObjectStore(n),t(e)});return(e,t)=>r.then(r=>t(r.transaction(n,e).objectStore(n)))}(0,"keyval")),r}function o(e,n=i()){return n("readonly",n=>t(n.get(e)))}var a=n(71440);Math;const s=1/180*Math.PI,u={};function c(e,{precision:t=u.precision||4}={}){return e=function(e){return Math.round(e/u.EPSILON)*u.EPSILON}(e),`${parseFloat(e.toPrecision(t))}`}function l(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function d(e){return function(e,t){return function(e,t,n){if(l(e)){n=n||function(e){return e.clone?e.clone():new Array(e.length)}(e);for(let r=0;re*s,void 0)}(e)}function f(e,t,n){const r=u.EPSILON;n&&(u.EPSILON=n);try{if(e===t)return!0;if(l(e)&&l(t)){if(e.length!==t.length)return!1;for(let n=0;n0?", ":"")+c(this[n],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t2*Math.PI)throw Error("radians");const o=n*Math.tan(e/2),a=o*t;return(new T).ortho({left:-a,right:a,bottom:-o,top:o,near:r,far:i})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:i=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return function(e,t,n,r,i){var o,a=1/Math.tan(t/2);e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+r)*(o=1/(r-i)),e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r)}(this,e,n,r,i),this.check()}determinant(){return function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],d=e[10],f=e[11],h=e[12],p=e[13],g=e[14],y=e[15];return(t*a-n*o)*(d*y-f*g)-(t*s-r*o)*(l*y-f*p)+(t*u-i*o)*(l*g-d*p)+(n*s-r*a)*(c*y-f*h)-(n*u-i*a)*(c*g-d*h)+(r*u-i*s)*(c*p-l*h)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*i,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*i,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*i,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*i,e[8]=this[10]*o,e}transpose(){return function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}invert(){return function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],d=t[9],f=t[10],h=t[11],p=t[12],g=t[13],y=t[14],m=t[15],b=n*s-r*a,v=n*u-i*a,_=n*c-o*a,w=r*u-i*s,x=r*c-o*s,S=i*c-o*u,j=l*g-d*p,N=l*y-f*p,E=l*m-h*p,T=d*y-f*g,I=d*m-h*g,A=f*m-h*y,k=b*A-v*I+_*T+w*E-x*N+S*j;k&&(e[0]=(s*A-u*I+c*T)*(k=1/k),e[1]=(i*I-r*A-o*T)*k,e[2]=(g*S-y*x+m*w)*k,e[3]=(f*x-d*S-h*w)*k,e[4]=(u*E-a*A-c*N)*k,e[5]=(n*A-i*E+o*N)*k,e[6]=(y*_-p*S-m*v)*k,e[7]=(l*S-f*_+h*v)*k,e[8]=(a*I-s*E+c*j)*k,e[9]=(r*E-n*I-o*j)*k,e[10]=(p*x-g*_+m*b)*k,e[11]=(d*_-l*x-h*b)*k,e[12]=(s*N-a*T-u*j)*k,e[13]=(n*T-r*N+i*j)*k,e[14]=(g*v-p*w-y*b)*k,e[15]=(l*w-d*v+f*b)*k)}(this,this),this.check()}multiplyLeft(e){return w(this,e,this),this.check()}multiplyRight(e){return w(this,this,e),this.check()}rotateX(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],d=t[10],f=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*r,e[5]=a*i+l*r,e[6]=s*i+d*r,e[7]=u*i+f*r,e[8]=c*i-o*r,e[9]=l*i-a*r,e[10]=d*i-s*r,e[11]=f*i-u*r}(this,this,e),this.check()}rotateY(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[8],l=t[9],d=t[10],f=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*r,e[1]=a*i-l*r,e[2]=s*i-d*r,e[3]=u*i-f*r,e[8]=o*r+c*i,e[9]=a*r+l*i,e[10]=s*r+d*i,e[11]=u*r+f*i}(this,this,e),this.check()}rotateZ(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[4],l=t[5],d=t[6],f=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*r,e[1]=a*i+l*r,e[2]=s*i+d*r,e[3]=u*i+f*r,e[4]=c*i-o*r,e[5]=l*i-a*r,e[6]=d*i-s*r,e[7]=f*i-u*r}(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return function(e,t,n,r){var i,o,a,s,u,c,l,d,f,h,p,g,y,m,b,_,w,x,S,j,N,E,T,I,A=r[0],k=r[1],R=r[2],O=Math.hypot(A,k,R);O{t[n.id]=e}),t}const V={spatialObjectReference:U(F.spatialObjectReference),spatialEntity:U(F.spatialEntity),spatialPlacement:U(F.spatialPlacement)};function $(e,t,n,r){const i={"@id":t,"@type":n};return e.some(e=>{const t=r[e.predicate.id];if(t){const n="Literal"===e.object.termType?(0,O.fromRdf)(e.object):e.object.id;(0,R.set)(i,t,n)}return!1},a.DataFactory.namedNode(t),null,null,null),i}const z=(0,R.memoize)(function(e,t){return $(e,t,"SpatialObjectReference",V.spatialObjectReference)},(e,t)=>t),q=(0,R.memoize)(function(e,t){const n=$(e,t,"ExtractionSet",V.spatialEntity);return n.extractionSites=(0,R.sortBy)(e.getSubjects(F.spatialEntity.extraction_set,t,null).map(t=>J(e,t.id)),["rui_rank"]),n},(e,t)=>t),K=(0,R.memoize)(function(e,t){return(0,R.sortBy)(e.getSubjects(F.spatialEntity.extraction_set_for,t,null).map(t=>q(e,t.id)),["rui_rank"])},(e,t)=>t),H=(0,R.memoize)(function(e,t){return(0,R.sortBy)(e.getSubjects(F.spatialEntity.reference_organ,t,null).map(t=>J(e,t.id)).filter(e=>e["@id"]!==t),["rui_rank"])},(e,t)=>t),W=(0,R.memoize)(function(e){const t=[];return e.forEach(n=>{n.subject.id===n.object.id&&t.push(J(e,n.subject.id))},null,F.spatialEntity.reference_organ,null,null),(0,R.sortBy)(t,["rui_rank"])}),J=(0,R.memoize)(function(e,t){const n=$(e,t,"SpatialEntity",V.spatialEntity);return n.object&&(n.object=z(e,n.object)),n.ccf_annotations&&(n.ccf_annotations=e.getObjects(t,F.spatialEntity.ccf_annotations,null).map(e=>e.id)),e.forSubjects(e=>n.entityId=e.id,P.spatialEntity,t,null),n},(e,t)=>t),Q=(0,R.memoize)(function(e,t){const n=$(e,t,"SpatialPlacement",V.spatialPlacement);return n.source&&(n.source=J(e,n.source)),n.target&&(n.target=J(e,n.target)),n},(e,t)=>t),X=(0,R.memoize)(function(e,t){const n=e.getObjects(a.DataFactory.namedNode(t),P.spatialEntity,null);if(n.length>0)return J(e,n[0].id)},(e,t)=>t);function Y(e,t){const n=t;let r;switch(n.translation_units){case"centimeter":r=.01;break;case"millimeter":r=.001;break;case"meter":default:r=1}const i=[n.x_translation,n.y_translation,n.z_translation].map(e=>e*r),o=[n.x_rotation,n.y_rotation,n.z_rotation].map(d),a=[n.x_scaling,n.y_scaling,n.z_scaling];return e.translate(i).rotateXYZ(o).scale(a)}class Z{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new I.DirectedGraph;const e=this.db.store;e.forSubjects(e=>{this.addNode(e.id,"SpatialObjectReference")},M.type,F.SpatialObjectReference,null),e.forSubjects(e=>{this.addNode(e.id,"SpatialEntity")},M.type,F.SpatialEntity,null);const t={};e.some(e=>(t[e.subject.id]=e.object.id,!1),null,F.spatialPlacement.source,null,null),e.some(e=>{const n=t[e.subject.id];return n&&this.addEdge(e.subject.id,n,e.object.id,"SpatialPlacement"),!1},null,F.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,n,r){this.graph.mergeDirectedEdge(t,n,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new T(T.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const n=this.db.store,r=new T(T.IDENTITY),i=k()(this.graph,e,t);if(i&&i.length>0){i.reverse();let e="";for(const t of i){if(e){const i=this.graph.getEdgeAttribute(t,e,"id");Y(r,Q(n,i))}e=t}return r}}}class ee{constructor(e){this.db=e}getSpatialEntity(e){return J(this.db.store,e)}getExtractionSets(e){return K(this.db.store,e)}getExtractionSet(e){return q(this.db.store,e)}getAnatomicalStructures(e){return H(this.db.store,e)}getReferenceOrgans(){return W(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=F.spatial.Male.id;break;case"Female":t=F.spatial.Female.id;break;case"Both":default:t=F.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(e=>"Male"===e.sex);break;case"Female":t=t.filter(e=>"Female"===e.sex)}return(null==e?void 0:e.debug)&&(t=t.map(e=>[[e],this.getAnatomicalStructures(e["@id"])]).reduce((e,[t,n])=>e.concat(n.length>0?n:t),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let n=[...this.getReferenceOrganSets(e).map(e=>{const n="http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of;return this.getSceneNode(e,t,{color:[255,255,255,255],opacity:n?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!n})})];return(null==e?void 0:e.debug)&&(n=n.concat([this.getSceneNode(this.getSpatialEntity(F.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(F.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(F.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(F.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(F.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),n.filter(e=>void 0!==e)}getReferenceOrganScene(e,t){var n,r;const i=null!==(n=void 0!==(null==t?void 0:t.sex))&&void 0!==n&&n,o=this.getReferenceOrgans().filter(n=>n.representation_of===e&&(!i||n.sex===(null==t?void 0:t.sex)));if(o.length>0){const e=o[0],n=this.getSceneNode(e,e,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),i=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(t=>this.getSceneNode(t,e,{color:[255,255,255,229.5]}));return[n].concat(i).filter(e=>void 0!==e)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(e=>this.getSceneNode(e,t,{color:[255,255,255,229.5]})).filter(e=>void 0!==e)}getSceneNode(e,t,n={}){var r,i,o,a;const s=null===(i=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===i?void 0:i.startsWith("model/gltf");let u=this.db.graph.getTransformationMatrix(s&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(s)u=new T(T.IDENTITY).rotateX(d(90)).multiplyLeft(u);else{let t;switch(e.dimension_units){case"centimeter":t=.01;break;case"millimeter":t=.001;break;case"meter":default:t=1}const n=[e.x_dimension,e.y_dimension,e.z_dimension].map(e=>e*t/2);u.scale(n)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:s?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:s?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:u,tooltip:e.label},n)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const te="https://entity.api.hubmapconsortium.org/entities/",ne=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),re={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},ie={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},oe=function(){const e={};return Object.entries(G).forEach(([t,n])=>e[t]=n.id),e}(),ae={BL:[oe.body,oe.bladder],RK:[oe.body,oe.kidney,oe.right_kidney],LK:[oe.body,oe.kidney,oe.left_kidney],HT:[oe.body,oe.heart],LI:[oe.body,oe.large_intestine,oe.colon],SI:[oe.body,oe.small_instestine],LL:[oe.body,oe.respiratory_system,oe.lung,oe.left_lung],RL:[oe.body,oe.respiratory_system,oe.lung,oe.right_lung],LY:[oe.body,oe.lymph_node],SP:[oe.body,oe.spleen],TH:[oe.body,oe.thymus],UR:[oe.body,oe.ureter],LV:[oe.body,oe.liver],OT:[oe.body]},se={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class ue{constructor(e,t="",n="",r){var i,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const a=this.data.descendants||[],s=(this.data.ancestors||[]).find(e=>"Donor"===e.entity_type);this.donor=this.getDonor(s,n);const u=this.getRuiLocation(e,this.donor);u?this.rui_location=u:this.bad=!0;const c=new Date(e.last_modified_timestamp).toLocaleDateString(),l=ie[e.group_uuid]||e.group_name,d=e.created_by_user_displayname;this["@id"]=te+e.uuid,this.label=`Registered ${c}, ${d}, ${l}`,this.link=`${n}browse/sample/${e.uuid}`;const f={},h=[];this.sections=h;const p=[];this.datasets=p;for(const v of a.filter(e=>"Sample"===e.entity_type)){const t=this.getSection(v,e,n);f[v.submission_id]=t,h.push(t),t.section_number=null!==(i=t.section_number)&&void 0!==i?i:h.length}for(const v of a)if("Dataset"===v.entity_type){const e=this.getDataset(v,t,n,r),i=(0,R.get)(v,["ingest_metadata","metadata","tissue_id"]);f[i]?null===(o=f[i].datasets)||void 0===o||o.push(e):p.push(e)}const g=null!=u?u:{},y=`${g.x_dimension} x ${g.y_dimension} x ${g.z_dimension} ${g.dimension_units}`;this.section_count=g.slice_count||h.length;const m=parseFloat((g.slice_thickness||(g.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=m;const b=g.dimension_units||"millimeter";this.section_units=b,this.description=`${y}, ${m} ${b}, ${e.specimen_type}, ${this.section_count} Sections`,h.forEach((e,t)=>{e.description=`${g.x_dimension} x ${g.y_dimension} x ${m} ${b}, ${m} ${b}, ${e.description}`,e.section_number=t+1})}getSection(e,t,n){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":te+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${ie[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${n}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",n="",r){var i;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=ie[e.group_uuid]||e.group_name,s=e.created_by_user_displayname,u=[...e.data_types,(0,R.get)(e,["ingest_metadata","metadata","assay_type"],"")],c=u.join("|").toLowerCase();let l,d="assets/icons/ico-unknown.svg";return-1!==c.indexOf("10x")?(l="10x",d="assets/icons/ico-bulk-10x.svg"):-1!==c.indexOf("af")?(l="AF",d="assets/icons/ico-spatial-af.svg"):-1!==c.indexOf("codex")?(l="CODEX",d="assets/icons/ico-spatial-codex.svg"):-1!==c.indexOf("imc")?(l="IMC",d="assets/icons/ico-spatial-imc.svg"):-1!==c.indexOf("lc")&&-1===c.indexOf("af")?(l="LC",d="assets/icons/ico-bulk-lc.svg"):l=-1!==c.indexOf("maldi")?"MALDI":-1!==c.indexOf("pas")?"PAS":"OTHER",d=null!==(i=this.getDatasetThumbnail(e,t,r))&&void 0!==i?i:d,{"@id":te+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${s}, ${a}`,description:`Data/Assay Types: ${u.join(", ")}`,link:`${n}browse/dataset/${e.uuid}`,technology:l,thumbnail:d}}getDatasetThumbnail(e,t,n){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(n?`?token=${n}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,R.get)(e,"metadata.files",[]).filter(e=>/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)).filter(e=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(e.rel_path)).filter(e=>ne.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(r=>`${t}/${e.uuid}/${r.rel_path}`+(n?`?token=${n}`:""));if(r.length>0){const e=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(ne.has(e))return`assets/thumbnails/TMC-Vanderbilt/DR1/${e}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const t=re[e.hubmap_id];if(t)return`assets/thumbnails/TMC-Florida/${t}`}}getDonor(e,t){const n=(e.description||"").toLowerCase();let r;n.includes("female")?r="Female":n.includes("male")&&(r="Male");const i=n.match(/age ([0-9]+)/);let o,a;i&&(o=(0,R.toNumber)(i[1]));for(const l of(0,R.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===l.preferred_term||"Female"===l.preferred_term?r="Female":"Masculine gender"===l.preferred_term||"Male"===l.preferred_term?r="Male":"Current chronological age"===l.preferred_term||"Age"===l.preferred_term?o=(0,R.toNumber)(l.data_value):"Body mass index"===l.preferred_term&&(a=(0,R.toNumber)(l.data_value));let s="";r&&o&&(s+=`${r}, Age ${o}`,a&&(s+=`, BMI ${a.toFixed(1)}`));const u=new Date(e.last_modified_timestamp).toLocaleDateString(),c=ie[e.group_uuid]||e.group_name;return{"@id":te+e.uuid,"@type":"Donor",label:s,description:`Entered ${u}, ${e.created_by_user_displayname}, ${c}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:c,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var n;const r=(e.ancestors||[]).find(e=>"Sample"===e.entity_type&&"organ"===e.specimen_type),i=ae[null==r?void 0:r.organ]||[oe.body];let o,a=e.rui_location;if(a&&("string"==typeof a&&(a=JSON.parse(a)),a.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):a["@id"]&&(o=a)),o){o.ccf_annotations=i.concat(o.ccf_annotations||[]);const e=null!==(n=(0,R.get)(o,["placement","target"]))&&void 0!==n?n:"";e.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,R.set)(o,["placement","target"],e.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===e||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===e)&&(0,R.set)(o,["placement","target"],"Male"===t.sex?e.replace("#VH","#VHM")+"_Patch":e.replace("#VH","#VHF")+"_Patch")}return o}getTissueBlock(){return(0,R.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function ce(t,n,r,i,o="",a=""){return e(this,void 0,void 0,function*(){let e;if("static"===n)e=yield fetch(t).then(e=>e.ok?e.json():void 0).catch(()=>{});else if("search-api"===n){const n={"Content-type":"application/json"};i&&i.length>0&&(n.Authorization=`Bearer ${i}`),e=yield fetch(t,{method:"POST",headers:n,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=r?r:{exists:{field:"rui_location"}}})}).then(e=>e.ok?e.json():void 0).catch(()=>{})}if(e)return function(e,t="",n="",r,i=!1){const o={},a=(0,R.get)(e,"hits.hits",[]).map(e=>(0,R.get)(e,"_source",{})).map(e=>new ue(e,t,n,r).toJsonLd());for(const u of a){const e=u["@id"];o[e]?o[e].samples.push(u.samples[0]):o[e]=u}const s=Object.values(o);return i&&(function(e){let t=[],n=0;for(const r of e.filter(e=>e.samples.length>1)){const e=r.samples;for(let r=0;re["@id"]===i)&&(e[r].deleteMe=!0,n++)}r.samples=e.filter(e=>!0!==e.deleteMe)}n>0&&console.log(`\u26a0 ${n} sections identified as blocks`)}(s),console.log(s.map(e=>Object.assign({"@context":se},e)))),{"@context":se,"@graph":s}}(e,o,a,i);console.warn(`Unable to load ${t} as HuBMAP Data`)})}function le(e,t,n){var r;const i=new Map,o=new Set;e.some(e=>{var n;return t.has(e.subject.id)&&(o.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,P.donor,null,null);const a=n(o),s=new Set;for(const u of a)for(const e of null!==(r=i.get(u))&&void 0!==r?r:[])s.add(e);return s}function de(e,t){return n=>e.has(n.id)?t.add(n.id):void 0}const fe={[F.ontologyNode.label.id]:"label",[F.ontologyNode.parent.id]:"parent",[F.ontologyNode.synonymLabels.id]:"synonymLabels"};function he(e,t){const n=a.DataFactory.namedNode(t),r={"@id":t,"@type":"OntologyTreeNode",id:t,parent:"",children:[],synonymLabels:[],label:""};return e.some(e=>{const t=fe[e.predicate.id];if(t){const n="Literal"===e.object.termType?(0,O.fromRdf)(e.object):e.object.id;"synonymLabels"===t?r.synonymLabels.push(n):(0,R.set)(r,t,n)}return!1},n,null,null,null),r.children=e.getSubjects(F.ontologyNode.children,n,null).map(e=>e.id),r}const pe={[P.label.id]:"label",[P.description.id]:"description",[P.link.id]:"link"},ge=Object.assign(Object.assign({},pe),{[P.providerName.id]:"providerName"}),ye=Object.assign(Object.assign({},pe),{[P.technology.id]:"technology",[P.thumbnail.id]:"thumbnail"}),me=Object.assign(Object.assign({},pe),{[P.sampleType.id]:"sampleType",[P.sectionNumber.id]:"sectionNumber",[P.datasets.id]:"datasets"}),be=Object.assign(Object.assign({},pe),{[P.sampleType.id]:"sampleType",[P.sectionCount.id]:"sectionCount",[P.sectionSize.id]:"sectionSize",[P.sectionUnits.id]:"sectionUnits",[P.donor.id]:"donor",[P.spatialEntity.id]:"spatialEntityId",[P.sections.id]:"sections",[P.datasets.id]:"datasets"}),ve=(0,R.memoize)(function(e,t){const n={"@id":t,"@type":"Donor"};return e.some(e=>{const t=ge[e.predicate.id];if(t){const r="Literal"===e.object.termType?(0,O.fromRdf)(e.object):e.object.id;(0,R.set)(n,t,r)}return!1},a.DataFactory.namedNode(t),null,null,null),n},(e,t)=>t);function _e(e,t){const n={"@id":t,"@type":"Dataset"};return e.some(e=>{const t=ye[e.predicate.id];if(t){const r="Literal"===e.object.termType?(0,O.fromRdf)(e.object):e.object.id;(0,R.set)(n,t,r)}return!1},a.DataFactory.namedNode(t),null,null,null),n}const we=(0,R.memoize)(function(e,t){const n={"@id":t,"@type":"Sample",sections:[],datasets:[]};return e.some(t=>{const r=be[t.predicate.id];if(r){const i="Literal"===t.object.termType?(0,O.fromRdf)(t.object):t.object.id;if("sections"===r){const t=function(e,t){const n={"@id":t,"@type":"Sample",datasets:[]};return e.some(t=>{const r=me[t.predicate.id];if(r){const i="Literal"===t.object.termType?(0,O.fromRdf)(t.object):t.object.id;if("datasets"===r){const t=_e(e,i);n[r].push(t)}else(0,R.set)(n,r,i)}return!1},a.DataFactory.namedNode(t),null,null,null),n}(e,i);n[r].push(t)}else if("datasets"===r){const t=_e(e,i);n[r].push(t)}else"donor"===r?n[r]=ve(e,i):(0,R.set)(n,r,i)}return!1},a.DataFactory.namedNode(t),null,null,null),n},(e,t)=>t),xe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},Se=Symbol("Comlink.proxy"),je=Symbol("Comlink.endpoint"),Ne=Symbol("Comlink.releaseProxy"),Ee=Symbol("Comlink.thrown"),Te=e=>"object"==typeof e&&null!==e||"function"==typeof e,Ie=new Map([["proxy",{canHandle:e=>Te(e)&&e[Se],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Ae(e,t),[n,[n]]},deserialize:e=>(e.start(),function(e,t){return Oe(e,[],void 0)}(e))}],["throw",{canHandle:e=>Te(e)&&Ee in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}}]]);function Ae(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;const{id:i,type:o,path:a}=Object.assign({path:[]},r.data),s=(r.data.argumentList||[]).map(Ce);let u;try{const t=a.slice(0,-1).reduce((e,t)=>e[t],e),n=a.reduce((e,t)=>e[t],e);switch(o){case"GET":u=n;break;case"SET":t[a.slice(-1)[0]]=Ce(r.data.value),u=!0;break;case"APPLY":u=n.apply(t,s);break;case"CONSTRUCT":u=function(e){return Object.assign(e,{[Se]:!0})}(new n(...s));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;Ae(e,n),u=function(e,t){return De.set(e,t),e}(t,[t])}break;case"RELEASE":u=void 0;break;default:return}}catch(c){u={value:c,[Ee]:0}}Promise.resolve(u).catch(e=>({value:e,[Ee]:0})).then(e=>{const[r,a]=Pe(e);t.postMessage(Object.assign(Object.assign({},r),{id:i}),a),"RELEASE"===o&&(t.removeEventListener("message",n),ke(t))})}),t.start&&t.start()}function ke(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function Re(e){if(e)throw new Error("Proxy has been released and is not useable")}function Oe(e,t=[],n=function(){}){let r=!1;const i=new Proxy(n,{get(n,o){if(Re(r),o===Ne)return()=>Fe(e,{type:"RELEASE",path:t.map(e=>e.toString())}).then(()=>{ke(e),r=!0});if("then"===o){if(0===t.length)return{then:()=>i};const n=Fe(e,{type:"GET",path:t.map(e=>e.toString())}).then(Ce);return n.then.bind(n)}return Oe(e,[...t,o])},set(n,i,o){Re(r);const[a,s]=Pe(o);return Fe(e,{type:"SET",path:[...t,i].map(e=>e.toString()),value:a},s).then(Ce)},apply(n,i,o){Re(r);const a=t[t.length-1];if(a===je)return Fe(e,{type:"ENDPOINT"}).then(Ce);if("bind"===a)return Oe(e,t.slice(0,-1));const[s,u]=Me(o);return Fe(e,{type:"APPLY",path:t.map(e=>e.toString()),argumentList:s},u).then(Ce)},construct(n,i){Re(r);const[o,a]=Me(i);return Fe(e,{type:"CONSTRUCT",path:t.map(e=>e.toString()),argumentList:o},a).then(Ce)}});return i}function Le(e){return Array.prototype.concat.apply([],e)}function Me(e){const t=e.map(Pe);return[t.map(e=>e[0]),Le(t.map(e=>e[1]))]}const De=new WeakMap;function Pe(e){for(const[t,n]of Ie)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:e},De.get(e)||[]]}function Ce(e){switch(e.type){case"HANDLER":return Ie.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Fe(e,t,n){return new Promise(r=>{const i=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.addEventListener("message",function t(n){!n.data||!n.data.id||n.data.id!==i||(e.removeEventListener("message",t),r(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}Ae(new class{constructor(e=xe){this.options=e,this.store=new a.Store(void 0,{factory:a.DataFactory}),this.graph=new Z(this),this.scene=new ee(this)}connect(t,n=!1){return e(this,void 0,void 0,function*(){return t&&(this.options=t),this.initializing||(this.initializing=n?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return e(this,void 0,void 0,function*(){const e=(new Date).getTime(),n="ccf-database.last_modified",r="ccf-database",a=yield o(n).catch(()=>{});let s;a&&e-new Date(+a).getTime()>36e5?yield function(e,n=i()){return n("readwrite",n=>(e.forEach(e=>n.delete(e)),t(n.transaction)))}([r,n]).catch(()=>{}):s=yield o(r).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(e,n=i()){return n("readwrite",n=>(e.forEach(e=>n.put(e[1],e[0])),t(n.transaction)))}([[r,this.serialize()],[n,""+e]]).catch(()=>{}))})}doConnect(){var t,n;return e(this,void 0,void 0,function*(){const e=[],r=null!==(n=null===(t=this.options.dataSources)||void 0===t?void 0:t.concat())&&void 0!==n?n:[],i=this.options.ccfOwlUrl;if(i.endsWith(".n3store.json")){const e=yield fetch(i).then(e=>e.text()).catch(()=>console.log("Couldn't locate serialized store."));e&&(this.store=(0,a.deserializeN3Store)(e,a.DataFactory))}else(null==i?void 0:i.length)>0&&r.push(i);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):e.push(ce(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(e=>{if(e)return this.addDataSources([e])}))),e.push(this.addDataSources(r)),yield Promise.all(e),yield this.synchronize()})}addDataSources(t,n){return e(this,void 0,void 0,function*(){const r=null!=n?n:this.store;return yield Promise.all(t.map(t=>e(this,void 0,void 0,function*(){"string"==typeof t?t.endsWith("jsonld")?yield(0,a.addJsonLdToStore)(t,r):t.endsWith("n3")?yield(0,a.addN3ToStore)(t,r):(t.endsWith("rdf")||t.endsWith("owl")||t.endsWith("xml"))&&(yield(0,a.addRdfXmlToStore)(t,r)):yield(0,a.addJsonLdToStore)(t,r)}))),this})}synchronize(){return e(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,a.serializeN3Store)(this.store)}deserialize(t){return e(this,void 0,void 0,function*(){this.store=(0,a.deserializeN3Store)(t,a.DataFactory),this.graph=new Z(this),this.scene=new ee(this),yield new Promise(e=>{setTimeout(e,10)})})}getIds(e={}){return function(e,t){var n,r,i,o,s;let u=function(e){const t=new Set;return e.forSubjects(e=>t.add(e.id),P.spatialEntity,null,null),t}(e);if(u.size>0&&(u=function(e,t,n=!0){const r=new Set;if(e.forSubjects(de(t,r),P.spatialEntity,null,null),!n){const e=new Set;return t.forEach(t=>r.has(t)?void 0:e.add(t)),e}return r}(e,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const n=t.sex;u=le(e,u,t=>function(e,t,n){const r=new Set;return e.forSubjects(de(t,r),P.sex,P[n],null),r}(e,t,n))}if(u.size>0&&(null===(n=t.tmc)||void 0===n?void 0:n.length)>0&&(u=le(e,u,n=>function(e,t,n){const r=new Set;for(const i of n){const n=a.DataFactory.literal(i);e.forSubjects(de(t,r),P.providerName,n,null)}return r}(e,n,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(e,t,n){var r;const i=new Map,o=new Set,a=new Set;e.some(e=>(t.has(e.subject.id)&&a.add(e.object.id),!1),null,P.sections,null,null),e.some(e=>{var n;return(t.has(e.subject.id)||a.has(e.subject.id))&&(o.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,P.datasets,null,null);const s=n(o),u=new Set;for(const c of s)for(const e of null!==(r=i.get(c))&&void 0!==r?r:[])u.add(e);return u}(e,u,n=>function(e,t,n){const r=new Set;for(const i of n){const n=a.DataFactory.literal(i);e.forSubjects(de(t,r),P.technology,n,null)}return r}(e,n,t.technologies))),u.size>0&&(null===(i=t.ontologyTerms)||void 0===i?void 0:i.length)>0&&(u=function(e,t,n){var r;const i=new Map,o=new Set;e.some(e=>{var n;return t.has(e.subject.id)&&(o.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,P.spatialEntity,null,null);const a=n(o),s=new Set;for(const u of a)for(const e of null!==(r=i.get(u))&&void 0!==r?r:[])s.add(e);return s}(e,u,n=>function(e,t,n){const r=new Set;for(const i of n){const n=a.DataFactory.namedNode(i);e.forSubjects(de(t,r),F.spatialEntity.ccf_annotations,n,null)}return r}(e,n,t.ontologyTerms))),u.size>0&&2===(null===(o=t.ageRange)||void 0===o?void 0:o.length)&&(0,R.isFinite)(t.ageRange[0])&&(0,R.isFinite)(t.ageRange[1])){const n=Math.max(...t.ageRange),r=Math.min(...t.ageRange);1===r&&110===n||(u=le(e,u,t=>function(e,t,n,r){const i=new Set;return e.some(e=>{if(t.has(e.subject.id)){const t=(0,O.fromRdf)(e.object);t>=n&&t<=r&&i.add(e.subject.id)}return!1},null,P.age,null,null),i}(e,t,r,n)))}if(u.size>0&&2===(null===(s=t.bmiRange)||void 0===s?void 0:s.length)&&(0,R.isFinite)(t.bmiRange[0])&&(0,R.isFinite)(t.bmiRange[1])){const n=Math.max(...t.bmiRange),r=Math.min(...t.bmiRange);13===r&&83===n||(u=le(e,u,t=>function(e,t,n,r){const i=new Set;return e.some(e=>{if(t.has(e.subject.id)){const t=(0,O.fromRdf)(e.object);t>=n&&t<=r&&i.add(e.subject.id)}return!1},null,P.bmi,null,null),i}(e,t,r,n)))}return u}(this.store,e)}get(e){return this.store.getQuads(a.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(e=>this.get(e))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(e=>X(this.store,e))}getDatasetTechnologyNames(){return e(this,void 0,void 0,function*(){return function(e){const t=new Set;return e.some(e=>(t.add(e.object.value),!1),null,P.technology,null,null),Array.from(t).sort()}(this.store)})}getProviderNames(){return e(this,void 0,void 0,function*(){return function(e){const t=new Set;return e.some(e=>(t.add(e.object.value),!1),null,P.providerName,null,null),Array.from(t).sort()}(this.store)})}getTissueBlockResults(t){return e(this,void 0,void 0,function*(){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(e=>we(this.store,e))})}getAggregateResults(t){return e(this,void 0,void 0,function*(){return function(e,t){const n=new Set;t.some(t=>(e.has(t.subject.id)&&n.add(t.object.id),!1),null,P.donor,null,null);const r=new Set;t.some(e=>(n.has(e.subject.id)&&r.add(e.object.id),!1),null,P.providerUUID,null,null);const i=new Set;t.forSubjects(t=>{e.has(t.id)&&i.add(t.id)},P.spatialEntity,null,null);const o=new Set;t.some(e=>(i.has(e.subject.id)&&o.add(e.object.id),!1),null,P.sections,null,null);const a=new Set;return t.some(e=>{const t=e.subject;return(i.has(t.id)||o.has(t.id))&&a.add(e.object.id),!1},null,P.datasets,null,null),Object.entries({"Tissue Data Providers":r.size,Donors:n.size,"Tissue Blocks":i.size,"Tissue Sections":o.size,"Tissue Datasets":a.size}).map(([e,t])=>({label:e,count:t}))}(this.getIds(t),this.store)})}getOntologyTermOccurences(t){return e(this,void 0,void 0,function*(){return function(e,t){const n=new Map;t.some(t=>(e.has(t.subject.id)&&(n.has(t.object.id)?n.get(t.object.id).push(t.subject.id):n.set(t.object.id,[t.subject.id])),!1),null,P.spatialEntity,null,null);const r={};return t.some(e=>{var t,i;if(n.has(e.subject.id)){const o=null!==(i=null===(t=n.get(e.subject.id))||void 0===t?void 0:t.length)&&void 0!==i?i:0;r[e.object.id]=o+(r[e.object.id]||0)}return!1},null,F.spatialEntity.ccf_annotations,null,null),r}(this.getIds(t),this.store)})}getOntologyTreeModel(){return e(this,void 0,void 0,function*(){return function(e){const t={root:G.body.id,nodes:{}},n=new Set;e.some(e=>(n.add(e.subject.id),n.add(e.predicate.id),!1),null,F.ontologyNode.parent,null,null);for(const r of n)t.nodes[r]=he(e,r);return t}(this.store)})}getReferenceOrgans(){return e(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(t){return e(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(t)})}getReferenceOrganScene(t,n){return e(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(t,n)})}})}()}(); \ No newline at end of file +var _g=Object.defineProperty,yg=Object.defineProperties,mg=Object.getOwnPropertyDescriptors,Es=Object.getOwnPropertySymbols,xc=Object.prototype.hasOwnProperty,Sc=Object.prototype.propertyIsEnumerable,Ec=(e,t,n)=>t in e?_g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,or=(e,t)=>{for(var n in t||(t={}))xc.call(t,n)&&Ec(e,n,t[n]);if(Es)for(var n of Es(t))Sc.call(t,n)&&Ec(e,n,t[n]);return e},$i=(e,t)=>yg(e,mg(t)),Nc=(e,t)=>{var n={};for(var r in e)xc.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Es)for(var r of Es(e))t.indexOf(r)<0&&Sc.call(e,r)&&(n[r]=e[r]);return n};!function(){var e={71440:function(e,t,n){var r=n(91052).default;e.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){return i(t[a][1][e]||e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o=void 0,a=0;a0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;su?u:s+a));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function d(e,t,n){for(var r=[],i=t;i>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":4}],6:[function(e,t,n){(function(t){(function(){"use strict";var t=e("base64-js"),r=e("ieee754");n.Buffer=a,n.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},n.INSPECT_MAX_BYTES=50;var i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|f(e,t),r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return C(e).length;default:if(i)return r?-1:P(e).length;t=(""+t).toLowerCase(),i=!0}}function h(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return j(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return E(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function p(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),G(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var d=!0,f=0;fi&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,n,r){return t.fromByteArray(0===n&&r===e.length?e:e.slice(n,r))}function j(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(r.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;rt&&(e+=" ... "),""},a.prototype.compare=function(e,t,n,r,i){if(B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(o,s),c=this.slice(r,i),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return m(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return v(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,i,o){return t=+t,n>>>=0,o||R(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function L(e,t,n,i,o){return t=+t,n>>>=0,o||R(e,0,n,8),r.write(e,t,n,i,52,8),n+8}a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||A(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||A(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||k(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r||k(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);k(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);k(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&0!==r&&(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function C(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(e,t,n){"use strict";t.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce((t,n,r)=>t+(0===r?"":",")+e(void 0===n||"symbol"==typeof n?null:n),"")+"]":"{"+Object.keys(t).sort().reduce((n,r,i)=>void 0===t[r]||"symbol"==typeof t[r]?n:n+(0===n.length?"":",")+e(r)+":"+e(t[r]),"")+"}"}},{}],8:[function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,i,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,o,a;if(c(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,l=y(u,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},{}],9:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},{}],10:[function(e,t,n){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t,n){"use strict";const{isArray:i,isObject:o,isString:a}=e("./types"),{asArray:s}=e("./util"),{prependBase:u}=e("./url"),c=e("./JsonLdError"),l=e("./ResolvedContext");function d(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function f({context:e,base:t}){if(!e)return;const n=e["@context"];if(a(n))e["@context"]=u(t,n);else if(i(n))for(let r=0;r10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(t))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let r,u;s.add(t);try{u=yield n(t),r=u.document||null,a(r)&&(r=JSON.parse(r))}catch(l){throw new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:l})}if(!o(r))throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return r="@context"in r?{"@context":r["@context"]}:{"@context":{}},u.contextUrl&&(i(r["@context"])||(r["@context"]=[r["@context"]]),r["@context"].push(u.contextUrl)),{context:r,remoteDoc:u}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(e,t,n){"use strict";t.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},{}],13:[function(e,t,n){"use strict";t.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],14:[function(e,t,n){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(e,t,n){"use strict";t.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}add(e){var t=this;return r(function*(){let n=t._requests[e];if(n)return Promise.resolve(n);n=t._requests[e]=t._loader(e);try{return yield n}finally{delete t._requests[e]}})()}}},{}],16:[function(e,t,n){"use strict";const r=e("lru-cache");t.exports=class{constructor({document:e}){this.document=e,this.cache=new r({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},{"lru-cache":33}],17:[function(e,t,n){"use strict";const i=e("./JsonLdError"),{isArray:o,isObject:a,isString:s,isUndefined:u}=e("./types"),{isList:c,isValue:l,isGraph:d,isSimpleGraph:f,isSubjectReference:h}=e("./graphTypes"),{expandIri:p,getContextValue:g,isKeyword:y,process:m,processingMode:b}=e("./context"),{removeBase:v,prependBase:_}=e("./url"),{addValue:w,asArray:x,compareShortestLeast:S}=e("./util"),j={};function N(e,t,n){if("@nest"!==p(e,t,{vocab:!0},n))throw new i("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}t.exports=j,j.compact=function(){var e=r(function*({activeCtx:e,activeProperty:t=null,element:n,options:r={},compactionMap:p=(()=>{})}){if(o(n)){let i=[];for(let o=0;o1&&(T=Array.from(T).sort());const I=e;for(const t of T){const n=j.compactIri({activeCtx:I,iri:t,relativeTo:{vocab:!0}}),i=g(S,n,"@context");u(i)||(e=yield m({activeCtx:e,localCtx:i,options:r,propagate:!1}))}const A=Object.keys(n).sort();for(const u of A){const h=n[u];if("@id"!==u)if("@type"!==u)if("@reverse"!==u)if("@preserve"!==u)if("@index"!==u)if("@graph"!==u&&"@list"!==u&&"@included"!==u&&y(u)){const t=j.compactIri({activeCtx:e,iri:u,relativeTo:{vocab:!0}});w(_,t,h)}else{if(!o(h))throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===h.length){const t=j.compactIri({activeCtx:e,iri:u,value:h,relativeTo:{vocab:!0},reverse:v}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let i=_;n&&(N(e,n,r),a(_[n])||(_[n]={}),i=_[n]),w(i,t,h,{propertyIsArray:!0})}for(const t of h){const n=j.compactIri({activeCtx:e,iri:u,value:t,relativeTo:{vocab:!0},reverse:v}),i=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let h=_;i&&(N(e,i,r),a(_[i])||(_[i]={}),h=_[i]);const y=g(e,n,"@container")||[],m=d(t),b=c(t);let S;b?S=t["@list"]:m&&(S=t["@graph"]);let E=yield j.compact({activeCtx:e,activeProperty:n,element:b||m?S:t,options:r,compactionMap:p});if(b){if(o(E)||(E=[E]),y.includes("@list")){w(h,n,E,{valueIsArray:!0,allowDuplicate:!0});continue}E={[j.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:E},"@index"in t&&(E[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(m)if(y.includes("@graph")&&(y.includes("@id")||y.includes("@index")&&f(t))){let i;h.hasOwnProperty(n)?i=h[n]:h[n]=i={};const o=(y.includes("@id")?t["@id"]:t["@index"])||j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(i,o,E,{propertyIsArray:!r.compactArrays||y.includes("@set")})}else y.includes("@graph")&&f(t)?(o(E)&&E.length>1&&(E={"@included":E}),w(h,n,E,{propertyIsArray:!r.compactArrays||y.includes("@set")})):(o(E)&&1===E.length&&r.compactArrays&&(E=E[0]),E={[j.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:E},"@id"in t&&(E[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(E[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(h,n,E,{propertyIsArray:!r.compactArrays||y.includes("@set")}));else if(y.includes("@language")||y.includes("@index")||y.includes("@id")||y.includes("@type")){let i,o;if(h.hasOwnProperty(n)?i=h[n]:h[n]=i={},y.includes("@language"))l(E)&&(E=E["@value"]),o=t["@language"];else if(y.includes("@index")){const r=g(e,n,"@index")||"@index",i=j.compactIri({activeCtx:e,iri:r,relativeTo:{vocab:!0}});if("@index"===r)o=t["@index"],delete E[i];else{let e;if([o,...e]=x(E[r]||[]),s(o))switch(e.length){case 0:delete E[r];break;case 1:E[r]=e[0];break;default:E[r]=e}else o=null}}else if(y.includes("@id")){const t=j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});o=E[t],delete E[t]}else if(y.includes("@type")){const i=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let a;switch([o,...a]=x(E[i]||[]),a.length){case 0:delete E[i];break;case 1:E[i]=a[0];break;default:E[i]=a}1===Object.keys(E).length&&"@id"in t&&(E=yield j.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:r,compactionMap:p}))}o||(o=j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(i,o,E,{propertyIsArray:y.includes("@set")})}else{const e=!r.compactArrays||y.includes("@set")||y.includes("@list")||o(E)&&0===E.length||"@list"===u||"@graph"===u;w(h,n,E,{propertyIsArray:e})}}}else{if((g(e,t,"@container")||[]).includes("@index"))continue;const n=j.compactIri({activeCtx:e,iri:u,relativeTo:{vocab:!0}});w(_,n,h)}else{const n=yield j.compact({activeCtx:e,activeProperty:t,element:h,options:r,compactionMap:p});o(n)&&0===n.length||w(_,u,n)}else{const t=yield j.compact({activeCtx:e,activeProperty:"@reverse",element:h,options:r,compactionMap:p});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const i=t[n],o=(g(e,n,"@container")||[]).includes("@set")||!r.compactArrays;w(_,n,i,{propertyIsArray:o}),delete t[n]}if(Object.keys(t).length>0){const n=j.compactIri({activeCtx:e,iri:u,relativeTo:{vocab:!0}});w(_,n,t)}}else{let t=x(h).map(e=>j.compactIri({activeCtx:S,iri:e,relativeTo:{vocab:!0}}));1===t.length&&(t=t[0]);const n=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),r=(g(e,n,"@container")||[]).includes("@set")&&b(e,1.1)||o(t)&&0===h.length;w(_,n,t,{propertyIsArray:r})}else{let t=x(h).map(t=>j.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:r.base}));1===t.length&&(t=t[0]),_[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return _}return n});return function(t){return e.apply(this,arguments)}}(),j.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:r={vocab:!1},reverse:o=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const u=e.getInverse();if(y(t)&&t in u&&"@none"in u[t]&&"@type"in u[t]["@none"]&&"@none"in u[t]["@none"]["@type"])return u[t]["@none"]["@type"]["@none"];if(r.vocab&&t in u){const r=e["@language"]||"@none",i=[];a(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),a(n)&&"@preserve"in n&&(n=n["@preserve"][0]),d(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):a(n)&&!l(n)&&i.push("@id","@id@set","@type","@set@type");let s="@language",u="@null";if(o)s="@type",u="@reverse",i.push("@set");else if(c(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)s="@any",u="@none";else{let t=0===e.length?r:null,n=null;for(let r=0;re.includes("_"));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const u=e.inverse[t];for(const a of r){if(!(a in u))continue;const e=u[a][i];for(const t of s)if(t in e)return e[t]}return null}(e,t,n,i,s,u);if(null!==f)return f}if(r.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const r=t.substr(n.length);if(!e.mappings.has(r))return r}}let f=null;const h=[];let p=e.fastCurieMap;const g=t.length-1;for(let i=0;i=0;--i){const r=h[i],o=r.terms;for(const i of o){const o=i+":"+t.substr(r.iri.length);e.mappings.get(i)._prefix&&(!e.mappings.has(o)||null===n&&e.mappings.get(o)["@id"]===t)&&(null===f||S(o,f)<0)&&(f=o)}}if(null!==f)return f;for(const[a,c]of e.mappings)if(c&&c._prefix&&t.startsWith(a+":"))throw new i(`Absolute IRI "${t}" confused with prefix "${a}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});return r.vocab?t:"@base"in e?e["@base"]?v(_(s,e["@base"]),t):t:v(s,t)},j.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(l(n)){const r=g(e,t,"@type"),i=g(e,t,"@language"),o=g(e,t,"@direction"),a=g(e,t,"@container")||[],u="@index"in n&&!a.includes("@index");if(!u&&"@none"!==r&&(n["@type"]===r||"@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===o||"@language"in n&&n["@language"]===i||"@direction"in n&&n["@direction"]===o))return n["@value"];const c=Object.keys(n).length,l=1===c||2===c&&"@index"in n&&!u,d="@language"in e,f=s(n["@value"]),h=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(l&&"@none"!==r&&(!d||!f||h))return n["@value"];const p={};return u&&(p[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?p[j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=j.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(p[j.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(p[j.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),p[j.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],p}const i=p(e,t,{vocab:!0},r),o=g(e,t,"@type"),a=j.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===o},base:r.base});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(e,t,n){"use strict";const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";t.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:r,RDF_LIST:r+"List",RDF_FIRST:r+"first",RDF_REST:r+"rest",RDF_NIL:r+"nil",RDF_TYPE:r+"type",RDF_PLAIN_LITERAL:r+"PlainLiteral",RDF_XML_LITERAL:r+"XMLLiteral",RDF_JSON_LITERAL:r+"JSON",RDF_OBJECT:r+"object",RDF_LANGSTRING:r+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}},{}],19:[function(e,t,n){"use strict";const i=e("./util"),o=e("./JsonLdError"),{isArray:a,isObject:s,isString:u,isUndefined:c}=e("./types"),{isAbsolute:l,isRelative:d,prependBase:f}=e("./url"),{asArray:h,compareShortestLeast:p}=e("./util"),g=new Map,y=/^@[a-zA-Z]+$/,m={};function b(e,t,n,r,i,o){if(null===t||!u(t)||m.isKeyword(t))return t;if(t.match(y))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&m.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:o}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(s(n)&&"@id"in n)return n["@id"]}const a=t.indexOf(":");if(a>0){const n=t.substr(0,a),s=t.substr(a+1);if("_"===n||0===s.indexOf("//"))return t;r&&r.hasOwnProperty(n)&&m.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:o});const u=e.mappings.get(n);if(u&&u._prefix)return u["@id"]+s;if(l(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return f(f(o.base,e["@base"]),t)}else if(n.base)return f(o.base,t);return t}function v(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n{if(r.has(n)){if(r.get(n))return;throw new o("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let d;if(r.set(n,!1),t.hasOwnProperty(n)&&(d=t[n]),"@type"===n&&s(d)&&"@set"===(d["@container"]||"@set")&&m.processingMode(e,1.1)){const e=["@container","@id","@protected"],r=Object.keys(d);if(0===r.length||r.some(t=>!e.includes(t)))throw new o("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(m.isKeyword(n))throw new o("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(y))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new o("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const f=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let h=!1;if((u(d)||null===d)&&(h=!0,d={"@id":d}),!s(d))throw new o("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const p={};e.mappings.set(n,p),p.reverse=!1;const g=["@container","@id","@language","@reverse","@type"];m.processingMode(e,1.1)&&g.push("@context","@direction","@index","@nest","@prefix","@protected");for(const a in d)if(!g.includes(a))throw new o("Invalid JSON-LD syntax; a term definition must not contain "+a,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const _=n.indexOf(":");if(p._termHasColon=_>0,"@reverse"in d){if("@id"in d)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in d)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const a=d["@reverse"];if(!u(a))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(!m.isKeyword(a)&&a.match(y))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:a}),void(f?e.mappings.set(n,f):e.mappings.delete(n));const s=b(e,a,{vocab:!0,base:!1},t,r,i);if(!l(s))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});p["@id"]=s,p.reverse=!0}else if("@id"in d){let a=d["@id"];if(a&&!u(a))throw new o("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===a)p["@id"]=null;else{if(!m.isKeyword(a)&&a.match(y))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:a}),void(f?e.mappings.set(n,f):e.mappings.delete(n));if(a!==n){if(a=b(e,a,{vocab:!0,base:!1},t,r,i),!l(a)&&!m.isKeyword(a))throw new o("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)&&b(e,n,{vocab:!0,base:!1},t,new Map(r).set(n,!0),i)!==a)throw new o("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});p["@id"]=a,p._prefix=h&&!p._termHasColon&&a.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in p))if(p._termHasColon){const o=n.substr(0,_);if(t.hasOwnProperty(o)&&m.createTermDefinition({activeCtx:e,localCtx:t,term:o,defined:r,options:i}),e.mappings.has(o)){const t=n.substr(_+1);p["@id"]=e.mappings.get(o)["@id"]+t}else p["@id"]=n}else if("@type"===n)p["@id"]=n;else{if(!("@vocab"in e))throw new o("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});p["@id"]=e["@vocab"]+n}if((!0===d["@protected"]||!0===r.get("@protected")&&!1!==d["@protected"])&&(e.protected[n]=!0,p.protected=!0),r.set(n,!0),"@type"in d){let n=d["@type"];if(!u(n))throw new o("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(m.processingMode(e,1))throw new o(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=b(e,n,{vocab:!0,base:!1},t,r,i),!l(n))throw new o("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new o("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}p["@type"]=n}if("@container"in d){const n=u(d["@container"])?[d["@container"]]:d["@container"]||[],r=["@list","@set","@index","@language"];let i=!0;const s=n.includes("@set");if(m.processingMode(e,1.1)){if(r.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new o("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some(e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e))throw new o("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else i&=n.length<=(s?2:1);if(n.includes("@type")&&(p["@type"]=p["@type"]||"@id",!["@id","@vocab"].includes(p["@type"])))throw new o("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else i&=!a(d["@container"]),i&=n.length<=1;if(i&=n.every(e=>r.includes(e)),i&=!(s&&n.includes("@list")),!i)throw new o("Invalid JSON-LD syntax; @context @container value must be one of the following: "+r.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(p.reverse&&!n.every(e=>["@index","@set"].includes(e)))throw new o("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});p["@container"]=n}if("@index"in d){if(!("@container"in d)||!p["@container"].includes("@index"))throw new o(`Invalid JSON-LD syntax; @index without @index in @container: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!u(d["@index"])||0===d["@index"].indexOf("@"))throw new o(`Invalid JSON-LD syntax; @index must expand to an IRI: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});p["@index"]=d["@index"]}if("@context"in d&&(p["@context"]=d["@context"]),"@language"in d&&!("@type"in d)){let e=d["@language"];if(null!==e&&!u(e))throw new o("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),p["@language"]=e}if("@prefix"in d){if(n.match(/:|\//))throw new o("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(m.isKeyword(p["@id"]))throw new o("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof d["@prefix"])throw new o("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});p._prefix=!0===d["@prefix"]}if("@direction"in d){const e=d["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new o('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});p["@direction"]=e}if("@nest"in d){const e=d["@nest"];if(!u(e)||"@nest"!==e&&0===e.indexOf("@"))throw new o("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});p["@nest"]=e}const w=p["@id"];if("@context"===w||"@preserve"===w)throw new o("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(f&&f.protected&&!c&&(e.protected[n]=!0,p.protected=!0,!v(f,p))){const e=i&&i.protectedMode||"error";if("error"===e)throw new o(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:n});throw new o("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:n,protectedMode:e})}},m.expandIri=(e,t,n,r)=>b(e,t,n,void 0,void 0,r),m.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=g.get(t);if(n)return n;const r={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},r={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],u=e.mappings,c=[...u.keys()].sort(p);for(const o of c){const e=u.get(o);if(null===e)continue;let c=e["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===e["@id"])continue;const l=h(e["@id"]);for(const u of l){let l=t[u];const d=m.isKeyword(u);if(l)!d&&!e._termHasColon&&r[u].push(o);else if(t[u]=l={},!d&&!e._termHasColon){r[u]=[o];const e={iri:u,terms:r[u]};u[0]in n?n[u[0]].push(e):n[u[0]]=[e]}if(l[c]||(l[c]={"@language":{},"@type":{},"@any":{}}),l=l[c],a(o,l["@any"],"@none"),e.reverse)a(o,l["@type"],"@reverse");else if("@none"===e["@type"])a(o,l["@any"],"@none"),a(o,l["@language"],"@none"),a(o,l["@type"],"@none");else if("@type"in e)a(o,l["@type"],e["@type"]);else if("@language"in e&&"@direction"in e){const t=e["@language"],n=e["@direction"];a(o,l["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in e?a(o,l["@language"],(e["@language"]||"@null").toLowerCase()):"@direction"in e?a(o,l["@language"],e["@direction"]?`_${e["@direction"]}`:"@none"):s?(a(o,l["@language"],`_${s}`),a(o,l["@language"],"@none"),a(o,l["@type"],"@none")):(a(o,l["@language"],i),a(o,l["@language"],"@none"),a(o,l["@type"],"@none"))}}for(const a in n)o(n,a,1);return t},clone:function(){const e={};return e.mappings=i.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=i.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===g.size&&g.clear(),g.set(t,r),r;function o(e,t,n){const r=e[t],i=e[t]={};let a,s;for(const o of r)a=o.iri,s=n>=a.length?"":a[n],s in i?i[s].push(o):i[s]=[o];for(const u in i)""!==u&&o(i,u,n+1)}function a(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},m.getContextValue=(e,t,n)=>{if(null===t)return"@context"===n?void 0:null;if(e.mappings.has(t)){const r=e.mappings.get(t);if(c(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},m.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,m.isKeyword=e=>{if(!u(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(e,t,n){"use strict";const{parseLinkHeader:i,buildHeaders:o}=e("../util"),{LINK_HEADER_CONTEXT:a}=e("../constants"),s=e("../JsonLdError"),u=e("../RequestQueue"),{prependBase:c}=e("../url"),l=/(^|(\r\n))link:/i;function d(e,t,n){const r=new(e=e||XMLHttpRequest);return new Promise((e,i)=>{r.onload=()=>e(r),r.onerror=e=>i(e),r.open("GET",t,!0);for(const t in n)r.setRequestHeader(t,n[t]);r.send()})}t.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>{return t=o(t),(new u).wrapLoader(f);function f(e){return h.apply(this,arguments)}function h(){return(h=r(function*(r){if(0!==r.indexOf("http:")&&0!==r.indexOf("https:"))throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:r});if(e&&0!==r.indexOf("https"))throw new s('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:r});let o;try{o=yield d(n,r,t)}catch(y){throw new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:r,cause:y})}if(o.status>=400)throw new s("URL could not be dereferenced: "+o.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:r,httpStatusCode:o.status});let u={contextUrl:null,documentUrl:r,document:o.response},h=null;const p=o.getResponseHeader("Content-Type");let g;if(l.test(o.getAllResponseHeaders())&&(g=o.getResponseHeader("Link")),g&&"application/ld+json"!==p){const e=i(g),t=e[a];if(Array.isArray(t))throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:r});t&&(u.contextUrl=t.target),h=e.alternate,h&&"application/ld+json"==h.type&&!(p||"").match(/^application\/(\w*\+)?json$/)&&(u=yield f(c(r,h.target)))}return u})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(e,t,n){"use strict";const i=e("./JsonLdError"),{isArray:o,isObject:a,isEmptyObject:s,isString:u,isUndefined:c}=e("./types"),{isList:l,isValue:d,isGraph:f,isSubject:h}=e("./graphTypes"),{expandIri:p,getContextValue:g,isKeyword:y,process:m,processingMode:b}=e("./context"),{isAbsolute:v}=e("./url"),{addValue:_,asArray:w,getValues:x,validateTypeValue:S}=e("./util"),j={};t.exports=j;const N=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function E(e){return T.apply(this,arguments)}function T(){return(T=r(function*({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:r,expandedParent:f,options:x={},insideList:T,typeKey:I,typeScopedContext:R,expansionMap:O}){const L=Object.keys(r).sort(),M=[];let D;const P=r[I]&&"@json"===p(e,o(r[I])?r[I][0]:r[I],{vocab:!0},x);for(const E of L){let I,L=r[E];if("@context"===E)continue;let C=p(e,E,{vocab:!0},x);if((null===C||!v(C)&&!y(C))&&(C=O({unmappedProperty:E,activeCtx:e,activeProperty:t,parent:r,options:x,insideList:T,value:L,expandedParent:f}),void 0===C))continue;if(y(C)){if("@reverse"===n)throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:L});if(C in f&&"@included"!==C&&"@type"!==C)throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!u(L)){if(!x.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(a(L)){if(!s(L))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:L})}else{if(!o(L))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:L});if(!L.every(e=>u(e)))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:L})}}_(f,"@id",w(L).map(t=>u(t)?p(e,t,{base:!0},x):t),{propertyIsArray:x.isFrame});continue}if("@type"===C){a(L)&&(L=Object.fromEntries(Object.entries(L).map(([e,t])=>[p(R,e,{vocab:!0}),w(t).map(e=>p(R,e,{base:!0,vocab:!0}))]))),S(L,x.isFrame),_(f,"@type",w(L).map(e=>u(e)?p(R,e,{base:!0,vocab:!0},x):e),{propertyIsArray:x.isFrame});continue}if("@included"===C&&b(e,1.1)){const n=w(yield j.expand({activeCtx:e,activeProperty:t,element:L,options:x,expansionMap:O}));if(!n.every(e=>h(e)))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:L});_(f,"@included",n,{propertyIsArray:!0});continue}if("@graph"===C&&!a(L)&&!o(L))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:L});if("@value"===C){D=L,P&&b(e,1.1)?f["@value"]=L:_(f,"@value",L,{propertyIsArray:x.isFrame});continue}if("@language"===C){if(null===L)continue;if(!u(L)&&!x.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:L});L=w(L).map(e=>u(e)?e.toLowerCase():e);for(const e of L)u(e)&&!e.match(N)&&console.warn(`@language must be valid BCP47: ${e}`);_(f,"@language",L,{propertyIsArray:x.isFrame});continue}if("@direction"===C){if(!u(L)&&!x.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:L});L=w(L);for(const e of L)if(u(e)&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:L});_(f,"@direction",L,{propertyIsArray:x.isFrame});continue}if("@index"===C){if(!u(L))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:L});_(f,"@index",L);continue}if("@reverse"===C){if(!a(L))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:L});if(I=yield j.expand({activeCtx:e,activeProperty:"@reverse",element:L,options:x,expansionMap:O}),"@reverse"in I)for(const e in I["@reverse"])_(f,e,I["@reverse"][e],{propertyIsArray:!0});let t=f["@reverse"]||null;for(const e in I){if("@reverse"===e)continue;null===t&&(t=f["@reverse"]={}),_(t,e,[],{propertyIsArray:!0});const n=I[e];for(let r=0;r"@id"===e||"@index"===e)&&(I=w(I).map(e=>({"@graph":w(e)}))),F.mappings.has(E)&&F.mappings.get(E).reverse){const e=f["@reverse"]=f["@reverse"]||{};I=w(I);for(let t=0;t"@value"===p(e,t,{vocab:!0},x)))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:r});yield E({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:r,expandedParent:f,options:x,insideList:T,typeScopedContext:R,typeKey:I,expansionMap:O})}}})).apply(this,arguments)}function I({activeCtx:e,activeProperty:t,value:n,options:r}){if(null==n)return null;const i=p(e,t,{vocab:!0},r);if("@id"===i)return p(e,n,{base:!0},r);if("@type"===i)return p(e,n,{vocab:!0,base:!0},r);const o=g(e,t,"@type");if(("@id"===o||"@graph"===i)&&u(n))return{"@id":p(e,n,{base:!0},r)};if("@vocab"===o&&u(n))return{"@id":p(e,n,{vocab:!0,base:!0},r)};if(y(i))return n;const a={};if(o&&!["@id","@vocab","@none"].includes(o))a["@type"]=o;else if(u(n)){const n=g(e,t,"@language");null!==n&&(a["@language"]=n);const r=g(e,t,"@direction");null!==r&&(a["@direction"]=r)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),a["@value"]=n,a}function A(e,t,n,r){const a=[],s=Object.keys(t).sort();for(const c of s){const s=p(e,c,{vocab:!0},r);let l=t[c];o(l)||(l=[l]);for(const e of l){if(null===e)continue;if(!u(e))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const r={"@value":e};"@none"!==s&&(r["@language"]=c.toLowerCase()),n&&(r["@direction"]=n),a.push(r)}}return a}function k(e){return R.apply(this,arguments)}function R(){return(R=r(function*({activeCtx:e,options:t,activeProperty:n,value:r,expansionMap:a,asGraph:s,indexKey:u,propertyIndex:l}){const h=[],y=Object.keys(r).sort(),b="@type"===u;for(let v of y){if(b){const n=g(e,v,"@context");c(n)||(e=yield m({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let y,w=r[v];o(w)||(w=[w]),w=yield j.expand({activeCtx:e,activeProperty:n,element:w,options:t,insideList:!1,insideIndex:!0,expansionMap:a}),y=l?"@none"===v?"@none":I({activeCtx:e,activeProperty:u,value:v,options:t}):p(e,v,{vocab:!0},t),"@id"===u?v=p(e,v,{base:!0},t):b&&(v=y);for(let e of w){if(s&&!f(e)&&(e={"@graph":[e]}),"@type"===u)"@none"===y||(e["@type"]=e["@type"]?[v].concat(e["@type"]):[v]);else{if(d(e)&&!["@language","@type","@index"].includes(u))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${u}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});l?"@none"!==y&&_(e,l,y,{propertyIsArray:!0,prependValue:!0}):"@none"!==y&&!(u in e)&&(e[u]=v)}h.push(e)}}return h})).apply(this,arguments)}j.expand=function(){var e=r(function*({activeCtx:e,activeProperty:t=null,element:n,options:r={},insideList:l=!1,insideIndex:d=!1,typeScopedContext:f=null,expansionMap:h=(()=>{})}){if(null==n)return null;if("@default"===t&&(r=Object.assign({},r,{isFrame:!1})),!o(n)&&!a(n)){if(!l&&(null===t||"@graph"===p(e,t,{vocab:!0},r))){const i=yield h({unmappedValue:n,activeCtx:e,activeProperty:t,options:r,insideList:l});return void 0===i?null:i}return I({activeCtx:e,activeProperty:t,value:n,options:r})}if(o(n)){let i=[];const a=g(e,t,"@container")||[];l=l||a.includes("@list");for(let s=0;s1?t.slice().sort():t:[t];for(const n of o){const t=g(f,n,"@context");c(t)||(e=yield m({activeCtx:e,localCtx:t,options:r,propagate:!1}))}}let A={};yield E({activeCtx:e,activeProperty:t,expandedActiveProperty:y,element:n,expandedParent:A,options:r,insideList:l,typeKey:T,typeScopedContext:f,expansionMap:h}),S=Object.keys(A);let k=S.length;if("@value"in A){if("@type"in A&&("@language"in A||"@direction"in A))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:A});let o=k-1;if("@type"in A&&(o-=1),"@index"in A&&(o-=1),"@language"in A&&(o-=1),"@direction"in A&&(o-=1),0!==o)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:A});const a=null===A["@value"]?[]:w(A["@value"]),c=x(A,"@type");if(!b(e,1.1)||!c.includes("@json")||1!==c.length)if(0===a.length){const i=yield h({unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:r,insideList:l});A=void 0!==i?i:null}else{if(!a.every(e=>u(e)||s(e))&&"@language"in A)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:A});if(!c.every(e=>v(e)&&!(u(e)&&0===e.indexOf("_:"))||s(e)))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:A})}}else if("@type"in A&&!o(A["@type"]))A["@type"]=[A["@type"]];else if("@set"in A||"@list"in A){if(k>1&&(2!==k||!("@index"in A)))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:A});"@set"in A&&(A=A["@set"],S=Object.keys(A),k=S.length)}else if(1===k&&"@language"in A){const i=yield h(A,{unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:r,insideList:l});A=void 0!==i?i:null}if(a(A)&&!r.keepFreeFloatingNodes&&!l&&(null===t||"@graph"===y)&&(0===k||"@value"in A||"@list"in A||1===k&&"@id"in A)){const i=yield h({unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:r,insideList:l});A=void 0!==i?i:null}return A});return function(t){return e.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(e,t,n){"use strict";const{isSubjectReference:r}=e("./graphTypes"),{createMergedNodeMap:i}=e("./nodeMap"),o={};t.exports=o,o.flatten=e=>{const t=i(e),n=[],o=Object.keys(t).sort();for(let i=0;i=0;--r){const i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,n){const r="@"+n;let i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new u("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new u("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of a.asArray(e[0]["@id"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new u("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of a.asArray(e[0]["@type"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new u("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,n,s){let u=!0,c=!1;for(const l in n){let d=!1;const f=a.getValues(t,l),h=0===a.getValues(n,l).length;if("@id"===l){if(o.isEmptyObject(n["@id"][0]||{})?d=!0:n["@id"].length>=0&&(d=n["@id"].includes(f[0])),!s.requireAll)return d}else if("@type"===l){if(u=!1,h){if(f.length>0)return!1;d=!0}else if(1===n["@type"].length&&o.isEmptyObject(n["@type"][0]))d=f.length>0;else for(const e of n["@type"])d=!(!o.isObject(e)||!("@default"in e))||d||f.some(t=>t===e);if(!s.requireAll)return d}else{if(r(l))continue;{const t=a.getValues(n,l)[0];let r=!1;if(t&&(g([t]),r="@default"in t),u=!1,0===f.length&&r)continue;if(f.length>0&&h)return!1;if(void 0===t){if(f.length>0)return!1;d=!0}else if(i.isList(t)){const n=t["@list"][0];if(i.isList(f[0])){const t=f[0]["@list"];i.isValue(n)?d=t.some(e=>w(n,e)):(i.isSubject(n)||i.isSubjectReference(n))&&(d=t.some(t=>_(e,n,t,s)))}}else d=i.isValue(t)?f.some(e=>w(t,e)):i.isSubjectReference(t)?f.some(n=>_(e,t,n,s)):!!o.isObject(t)&&f.length>0}}if(!d&&s.requireAll)return!1;c=c||d}return u||c}function m(e,t){const n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,s=r.property,u={"@id":t};if(o.isArray(i)){for(let e=0;e{const t=Object.keys(n);for(const r of t)r in n&&o.isObject(n[r].parent)&&n[r].parent["@id"]===e&&(delete n[r],c(r))};c(t)}function b(e,t){if(o.isArray(e))return e.map(e=>b(e,t));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=b(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=b(e[n],t)}return e}function v(e,t,n){o.isObject(e)?a.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function _(e,t,n,r){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&y(e,i,t,r)}function w(e,t){const n=t["@value"],r=t["@type"],i=t["@language"],a=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],u=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===a.length&&0===s.length&&0===u.length||!(!a.includes(n)&&!o.isEmptyObject(a[0])||!(!r&&0===s.length||s.includes(r)||r&&o.isEmptyObject(s[0]))||!(!i&&0===u.length||u.includes(i)||i&&o.isEmptyObject(u[0])))}t.exports=d,d.frameMergedOrDefault=(e,t,n)=>{const r={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new a.IdentifierIssuer("_:b");c(e,r.graphMap,"@default",i),n.merged&&(r.graphMap["@merged"]=l(r.graphMap),r.graph="@merged"),r.subjects=r.graphMap[r.graph];const o=[];return d.frame(r,Object.keys(r.subjects).sort(),t,o),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter(e=>1===r.bnodeMap[e].length)),n.link={},b(o,n)},d.frame=(e,t,n,s,c=null)=>{g(n);const l=e.options,b={embed:p(n=n[0],l,"embed"),explicit:p(n,l,"explicit"),requireAll:p(n,l,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const _=e.link[e.graph],x=function(e,t,n,r){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,n,r)&&(i[o]=t)}return i}(e,t,n,b),S=Object.keys(x).sort();for(const g of S){const y=x[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===b.embed&&g in _){v(s,c,_[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&a.addValue(e.bnodeMap,g,S,{propertyIsArray:!0}),_[g]=S,("@first"===b.embed||"@last"===b.embed)&&e.is11)throw new u("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if(e.embedded&&("@never"===b.embed||h(y,e.graph,e.subjectStack))){v(s,c,S);continue}if(e.embedded&&("@first"==b.embed||"@once"==b.embed)&&e.uniqueEmbeds[e.graph].hasOwnProperty(g)){v(s,c,S);continue}if("@last"===b.embed&&g in e.uniqueEmbeds[e.graph]&&m(e,g),e.uniqueEmbeds[e.graph][g]={parent:s,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,r=null;"@graph"in n?(r=n["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(r)||(r={})):(t="@merged"!==e.graph,r={}),t&&d.frame($i(or({},e),{graph:g,embedded:!1}),Object.keys(e.graphMap[g]).sort(),[r],S,"@graph")}"@included"in n&&d.frame($i(or({},e),{embedded:!1}),t,n["@included"],S,"@included");for(const t of Object.keys(y).sort())if(r(t)){if(S[t]=a.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&a.addValue(e.bnodeMap,t,S,{propertyIsArray:!0})}else if(!b.explicit||t in n)for(const r of y[t]){const o=t in n?n[t]:f(b);if(i.isList(r)){const o=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:f(b),s={"@list":[]};v(S,t,s);const u=r["@list"];for(const t of u)i.isSubjectReference(t)?d.frame($i(or({},e),{embedded:!0}),[t["@id"]],o,s,"@list"):v(s,"@list",a.clone(t))}else i.isSubjectReference(r)?d.frame($i(or({},e),{embedded:!0}),[r["@id"]],o,S,t):w(o[0],r)&&v(S,t,a.clone(r))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!o.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(r(e))continue;const t=n[e][0]||{};if(!p(t,l,"omitDefault")&&!(e in S)){let n="@null";"@default"in t&&(n=a.clone(t["@default"])),o.isArray(n)||(n=[n]),S[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const r=n["@reverse"][t];for(const n of Object.keys(e.subjects))a.getValues(e.subjects[n],t).some(e=>e["@id"]===g)&&(S["@reverse"]=S["@reverse"]||{},a.addValue(S["@reverse"],t,[],{propertyIsArray:!0}),d.frame($i(or({},e),{embedded:!0}),[n],r,S["@reverse"][t],c))}v(s,c,S),e.subjectStack.pop()}}},d.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map(e=>d.cleanupNull(e,t)).filter(e=>e);if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=d.cleanupNull(e[n],t)}return e}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(e,t,n){"use strict";const i=e("./JsonLdError"),o=e("./graphTypes"),a=e("./types"),s=e("./util"),{RDF_LIST:u,RDF_FIRST:c,RDF_REST:l,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:h,XSD_BOOLEAN:p,XSD_DOUBLE:g,XSD_INTEGER:y,XSD_STRING:m}=e("./constants"),b=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,v={};function _(e,t,n){if(e.termType.endsWith("Node"))return{"@id":e.value};const r={"@value":e.value};if(e.language)r["@language"]=e.language;else{let s=e.datatype.value;if(s||(s=m),s===h){s="@json";try{r["@value"]=JSON.parse(r["@value"])}catch(o){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:r["@value"],cause:o})}}if(t){if(s===p)"true"===r["@value"]?r["@value"]=!0:"false"===r["@value"]&&(r["@value"]=!1);else if(a.isNumeric(r["@value"]))if(s===y){const e=parseInt(r["@value"],10);e.toFixed(0)===r["@value"]&&(r["@value"]=e)}else s===g&&(r["@value"]=parseFloat(r["@value"]));[p,y,g,m].includes(s)||(r["@type"]=s)}else if("i18n-datatype"===n&&s.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=s.split(/[#_]/);e.length>0&&(r["@language"]=e,e.match(b)||console.warn(`@language must be valid BCP47: ${e}`)),r["@direction"]=t}else s!==m&&(r["@type"]=s)}return r}t.exports=v,v.fromRDF=function(){var e=r(function*(e,{useRdfType:t=!1,useNativeTypes:n=!1,rdfDirection:r=null}){const i={},h={"@default":i},p={};for(const o of e){const e="DefaultGraph"===o.graph.termType?"@default":o.graph.value;e in h||(h[e]={}),"@default"!==e&&!(e in i)&&(i[e]={"@id":e});const a=h[e],u=o.subject.value,c=o.predicate.value,l=o.object;u in a||(a[u]={"@id":u});const g=a[u],y=l.termType.endsWith("Node");if(y&&!(l.value in a)&&(a[l.value]={"@id":l.value}),c===f&&!t&&y){s.addValue(g,"@type",l.value,{propertyIsArray:!0});continue}const m=_(l,n,r);if(s.addValue(g,c,m,{propertyIsArray:!0}),y)if(l.value===d){const e=a[l.value];"usages"in e||(e.usages=[]),e.usages.push({node:g,property:c,value:m})}else p[l.value]=!(l.value in p)&&{node:g,property:c,value:m}}for(const s in h){const e=h[s];if(!(d in e))continue;const t=e[d];if(t.usages){for(let n of t.usages){let t=n.node,r=n.property,i=n.value;const s=[],d=[];let f=Object.keys(t).length;for(;r===l&&a.isObject(p[t["@id"]])&&a.isArray(t[c])&&1===t[c].length&&a.isArray(t[l])&&1===t[l].length&&(3===f||4===f&&a.isArray(t["@type"])&&1===t["@type"].length&&t["@type"][0]===u)&&(s.push(t[c][0]),d.push(t["@id"]),n=p[t["@id"]],t=n.node,r=n.property,i=n.value,f=Object.keys(t).length,o.isBlankNode(t)););delete i["@id"],i["@list"]=s.reverse();for(const n of d)delete e[n]}delete t.usages}}const g=[],y=Object.keys(i).sort();for(const a of y){const e=i[a];if(a in h){const t=e["@graph"]=[],n=h[a],r=Object.keys(n).sort();for(const e of r){const r=n[e];o.isSubjectReference(r)||t.push(r)}}o.isSubjectReference(e)||g.push(e)}return g});return function(t,n){return e.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(e,t,n){"use strict";const r=e("./types"),i={};t.exports=i,i.isSubject=e=>!(!r.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>r.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>r.isObject(e)&&"@value"in e,i.isList=e=>r.isObject(e)&&"@list"in e,i.isGraph=e=>r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(e=>"@id"!==e&&"@index"!==e).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>!!r.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))},{"./types":30}],26:[function(e,t,n){const i=e("rdf-canonize"),o=e("./platform"),a=e("./util"),s=e("./ContextResolver"),u=a.IdentifierIssuer,c=e("./JsonLdError"),l=e("lru-cache"),d=e("./NQuads"),{expand:f}=e("./expand"),{flatten:h}=e("./flatten"),{fromRDF:p}=e("./fromRdf"),{toRDF:g}=e("./toRdf"),{frameMergedOrDefault:y,cleanupNull:m}=e("./frame"),{isArray:b,isObject:v,isString:_}=e("./types"),{isSubjectReference:w}=e("./graphTypes"),{expandIri:x,getInitialContext:S,process:j,processingMode:N}=e("./context"),{compact:E,compactIri:T}=e("./compact"),{createNodeMap:I,createMergedNodeMap:A,mergeNodeMaps:k}=e("./nodeMap"),R=function(t){const n={},R=new l({max:100});function O(e,n){var r=n,{documentLoader:i=t.documentLoader}=r,o=Nc(r,["documentLoader"]);return Object.assign({},{documentLoader:i},o,e)}return t.compact=function(){var e=r(function*(e,n,r){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===e)return null;let i;(r=O(r,{base:_(e)?e:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new u("_:b"),contextResolver:new s({sharedCache:R})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,i=r.skipExpansion?e:yield t.expand(e,r);const o=yield t.processContext(S(r),n,r);let l=yield E({activeCtx:o,element:i,options:r,compactionMap:r.compactionMap});r.compactArrays&&!r.graph&&b(l)?1===l.length?l=l[0]:0===l.length&&(l={}):r.graph&&v(l)&&(l=[l]),v(n)&&"@context"in n&&(n=n["@context"]),n=a.clone(n),b(n)||(n=[n]);const d=n;n=[];for(let t=0;t0)&&n.push(d[t]);const f=n.length>0;if(1===n.length&&(n=n[0]),b(l)){const e=T({activeCtx:o,iri:"@graph",relativeTo:{vocab:!0}}),t=l;l={},f&&(l["@context"]=n),l[e]=t}else if(v(l)&&f){const e=l;l={"@context":n};for(const t in e)l[t]=e[t]}return l});return function(t,n,r){return e.apply(this,arguments)}}(),t.expand=function(){var e=r(function*(e,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=O(n,{keepFreeFloatingNodes:!1,contextResolver:new s({sharedCache:R})})).expansionMap&&(n.expansionMap=void 0);const r={},i=[];if("expandContext"in n){const e=a.clone(n.expandContext);r.expandContext=v(e)&&"@context"in e?e:{"@context":e},i.push(r.expandContext)}let o;if(_(e)){const a=yield t.get(e,n);o=a.documentUrl,r.input=a.document,a.contextUrl&&(r.remoteContext={"@context":a.contextUrl},i.push(r.remoteContext))}else r.input=a.clone(e);"base"in n||(n.base=o||"");let u=S(n);for(const t of i)u=yield j({activeCtx:u,localCtx:t,options:n});let c=yield f({activeCtx:u,element:r.input,options:n,expansionMap:n.expansionMap});return v(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),b(c)||(c=[c]),c});return function(t,n){return e.apply(this,arguments)}}(),t.flatten=function(){var e=r(function*(e,n,r){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,r=O(r,{base:_(e)?e:"",contextResolver:new s({sharedCache:R})});const i=yield t.expand(e,r),o=h(i);return null===n?o:(r.graph=!0,r.skipExpansion=!0,yield t.compact(o,n,r))});return function(t,n,r){return e.apply(this,arguments)}}(),t.frame=function(){var e=r(function*(e,n,r){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(r=O(r,{base:_(e)?e:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new s({sharedCache:R})}),_(n)){const e=yield t.get(n,r);if(n=e.document,e.contextUrl){let t=n["@context"];t?b(t)?t.push(e.contextUrl):t=[t,e.contextUrl]:t=e.contextUrl,n["@context"]=t}}const i=n&&n["@context"]||{},o=yield t.processContext(S(r),i,r);r.hasOwnProperty("omitGraph")||(r.omitGraph=N(o,1.1)),r.hasOwnProperty("pruneBlankNodeIdentifiers")||(r.pruneBlankNodeIdentifiers=N(o,1.1));const a=yield t.expand(e,r),u=or({},r);u.isFrame=!0,u.keepFreeFloatingNodes=!0;const c=yield t.expand(n,u),l=Object.keys(n).map(e=>x(o,e,{vocab:!0}));u.merged=!l.includes("@graph"),u.is11=N(o,1.1);const d=y(a,c,u);u.graph=!r.omitGraph,u.skipExpansion=!0,u.link={},u.framing=!0;let f=yield t.compact(d,i,u);return u.link={},f=m(f,u),f});return function(t,n,r){return e.apply(this,arguments)}}(),t.link=function(){var e=r(function*(e,n,r){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",t.frame(e,i,r)});return function(t,n,r){return e.apply(this,arguments)}}(),t.normalize=t.canonize=function(){var e=r(function*(e,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=O(n,{base:_(e)?e:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new s({sharedCache:R})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const t=d.parse(e);return i.canonize(t,n)}const r=or({},n);delete r.format,r.produceGeneralizedRdf=!1;const o=yield t.toRDF(e,r);return i.canonize(o,n)});return function(t,n){return e.apply(this,arguments)}}(),t.fromRDF=function(){var e=r(function*(e,t){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");t=O(t,{format:_(e)?"application/n-quads":void 0});const{format:r}=t;let{rdfParser:i}=t;if(r){if(i=i||n[r],!i)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:r})}else i=()=>e;const o=yield i(e);return p(o,t)});return function(t,n){return e.apply(this,arguments)}}(),t.toRDF=function(){var e=r(function*(e,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let r;r=(n=O(n,{base:_(e)?e:"",skipExpansion:!1,contextResolver:new s({sharedCache:R})})).skipExpansion?e:yield t.expand(e,n);const i=g(r,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return d.serialize(i);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i});return function(t,n){return e.apply(this,arguments)}}(),t.createNodeMap=function(){var e=r(function*(e,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=O(n,{base:_(e)?e:"",contextResolver:new s({sharedCache:R})});const r=yield t.expand(e,n);return A(r,n)});return function(t,n){return e.apply(this,arguments)}}(),t.merge=function(){var e=r(function*(e,n,r){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!b(e))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,r=O(r,{contextResolver:new s({sharedCache:R})});const i=yield Promise.all(e.map(e=>{const n=or({},r);return t.expand(e,n)}));let o=!0;"mergeNodes"in r&&(o=r.mergeNodes);const c=r.issuer||new u("_:b"),l={"@default":{}};for(let t=0;tt._documentLoader,set:e=>t._documentLoader=e}),t.documentLoader=function(){var e=r(function*(e){throw new c("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})});return function(t){return e.apply(this,arguments)}}(),t.get=function(){var e=r(function*(e,n){let r;r="function"==typeof n.documentLoader?n.documentLoader:t.documentLoader;const i=yield r(e);try{if(!i.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");_(i.document)&&(i.document=JSON.parse(i.document))}catch(o){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:o,remoteDoc:i})}return i});return function(t,n){return e.apply(this,arguments)}}(),t.processContext=function(){var e=r(function*(e,t,n){return n=O(n,{base:"",contextResolver:new s({sharedCache:R})}),null===t?S(n):(t=a.clone(t),v(t)&&"@context"in t||(t={"@context":t}),j({activeCtx:e,localCtx:t,options:n}))});return function(t,n,r){return e.apply(this,arguments)}}(),t.getContextValue=e("./context").getContextValue,t.documentLoaders={},t.useDocumentLoader=function(e){if(!(e in t.documentLoaders))throw new c('Unknown document loader type: "'+e+'"',"jsonld.UnknownDocumentLoader",{type:e});t.documentLoader=t.documentLoaders[e].apply(t,Array.prototype.slice.call(arguments,1))},t.registerRDFParser=function(e,t){n[e]=t},t.unregisterRDFParser=function(e){delete n[e]},t.registerRDFParser("application/n-quads",d.parse),t.registerRDFParser("application/nquads",d.parse),t.url=e("./url"),t.util=a,Object.assign(t,a),t.promises=t,t.RequestQueue=e("./RequestQueue"),t.JsonLdProcessor=e("./JsonLdProcessor")(t),o.setupGlobals(t),o.setupDocumentLoaders(t),t},O=function(){return R(function(){return O()})};R(O),t.exports=O},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(e,t,n){"use strict";const{isKeyword:r}=e("./context"),i=e("./graphTypes"),o=e("./types"),a=e("./util"),s=e("./JsonLdError"),u={};t.exports=u,u.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new a.IdentifierIssuer("_:b"),r={"@default":{}};return u.createNodeMap(e,r,"@default",n),u.mergeNodeMaps(r)},u.createNodeMap=(e,t,n,c,l,d)=>{if(o.isArray(e)){for(const r of e)u.createNodeMap(r,t,n,c,void 0,d);return}if(!o.isObject(e))return void(d&&d.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(d&&d.push(e))}if(d&&i.isList(e)){const r=[];return u.createNodeMap(e["@list"],t,n,c,l,r),void d.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(l)&&(l=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),d&&d.push({"@id":l});const f=t[n],h=f[l]=f[l]||{};h["@id"]=l;const p=Object.keys(e).sort();for(let o of p){if("@id"===o)continue;if("@reverse"===o){const r={"@id":l},o=e["@reverse"];for(const e in o){const s=o[e];for(const o of s){let s=o["@id"];i.isBlankNode(o)&&(s=c.getId(s)),u.createNodeMap(o,t,n,c,s),a.addValue(f[s],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){l in t||(t[l]={}),u.createNodeMap(e[o],t,l,c);continue}if("@included"===o){u.createNodeMap(e[o],t,n,c);continue}if("@type"!==o&&r(o)){if("@index"===o&&o in h&&(e[o]!==h[o]||e[o]["@id"]!==h[o]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:h});h[o]=e[o];continue}const d=e[o];if(0===o.indexOf("_:")&&(o=c.getId(o)),0!==d.length)for(let e of d)if("@type"===o&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const r=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];a.addValue(h,o,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),u.createNodeMap(e,t,n,c,r)}else if(i.isValue(e))a.addValue(h,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];u.createNodeMap(e["@list"],t,n,c,l,r),e={"@list":r},a.addValue(h,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else u.createNodeMap(e,t,n,c,l),a.addValue(h,o,e,{propertyIsArray:!0,allowDuplicate:!1});else a.addValue(h,o,[],{propertyIsArray:!0})}},u.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const o=e[n][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(o).sort())if(r(e)&&"@type"!==e)s[e]=a.clone(o[e]);else for(const t of o[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},u.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if("@default"===r)continue;const n=e[r];let o=t[r];o?"@graph"in o||(o["@graph"]=[]):t[r]=o={"@id":r,"@graph":[]};const a=o["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||a.push(t)}}return t}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(e,t,n){"use strict";const r=e("./documentLoaders/xhr"),i={};t.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=r,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(e,t,n){"use strict";const{createNodeMap:r}=e("./nodeMap"),{isKeyword:i}=e("./context"),o=e("./graphTypes"),a=e("canonicalize"),s=e("./types"),u=e("./util"),{RDF_FIRST:c,RDF_REST:l,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:h,RDF_LANGSTRING:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:m,XSD_STRING:b}=e("./constants"),{isAbsolute:v}=e("./url"),_={};function w(e,t,n,r,o){const a=Object.keys(t).sort();for(const s of a){const a=t[s],u=Object.keys(a).sort();for(let t of u){const u=a[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of u){const a={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!v(s))continue;const u={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!v(t)||"BlankNode"===u.termType&&!o.produceGeneralizedRdf)continue;const c=x(i,r,e,n,o.rdfDirection);c&&e.push({subject:a,predicate:u,object:c,graph:n})}}}}function x(e,t,n,r,i){const u={};if(o.isValue(e)){u.termType="Literal",u.value=void 0,u.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;"@json"===n?(u.value=a(t),u.datatype.value=h):s.isBoolean(t)?(u.value=t.toString(),u.datatype.value=n||g):s.isDouble(t)||n===y?(s.isDouble(t)||(t=parseFloat(t)),u.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),u.datatype.value=n||y):s.isNumber(t)?(u.value=t.toFixed(0),u.datatype.value=n||m):"i18n-datatype"===i&&"@direction"in e?(u.datatype.value="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`,u.value=t):"@language"in e?(u.value=t,u.datatype.value=n||p,u.language=e["@language"]):(u.value=t,u.datatype.value=n||b)}else if(o.isList(e)){const o=function(e,t,n,r,i){const o={termType:"NamedNode",value:c},a={termType:"NamedNode",value:l},s={termType:"NamedNode",value:d},u=e.pop(),f=u?{termType:"BlankNode",value:t.getId()}:s;let h=f;for(const c of e){const e=x(c,t,n,r,i),s={termType:"BlankNode",value:t.getId()};n.push({subject:h,predicate:o,object:e,graph:r}),n.push({subject:h,predicate:a,object:s,graph:r}),h=s}if(u){const e=x(u,t,n,r,i);n.push({subject:h,predicate:o,object:e,graph:r}),n.push({subject:h,predicate:a,object:s,graph:r})}return f}(e["@list"],t,n,r,i);u.termType=o.termType,u.value=o.value}else{const t=s.isObject(e)?e["@id"]:e;u.termType=t.startsWith("_:")?"BlankNode":"NamedNode",u.value=t}return"NamedNode"!==u.termType||v(u.value)?u:null}t.exports=_,_.toRDF=(e,t)=>{const n=new u.IdentifierIssuer("_:b"),i={"@default":{}};r(e,i,"@default",n);const o=[],a=Object.keys(i).sort();for(const r of a){let e;if("@default"===r)e={termType:"DefaultGraph",value:""};else{if(!v(r))continue;e=r.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},e.value=r}w(o,i[r],e,n,t)}return o}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(e,t,n){"use strict";const r={};t.exports=r,r.isArray=Array.isArray,r.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),r.isDouble=e=>r.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),r.isEmptyObject=e=>r.isObject(e)&&0===Object.keys(e).length,r.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),r.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),r.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),r.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),r.isUndefined=e=>void 0===e},{}],31:[function(e,t,n){"use strict";const r=e("./types"),i={};t.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},r=i.parsers[t||"full"],o=r.regex.exec(e);let a=r.keys.length;for(;a--;)n[r.keys[a]]=void 0===o[a]?null:o[a];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e||i.isAbsolute(t))return t;(!e||r.isString(e))&&(e=i.parse(e||""));const n=i.parse(t),o={protocol:e.protocol||""};if(null!==n.authority)o.authority=n.authority,o.path=n.path,o.query=n.query;else if(o.authority=e.authority,""===n.path)o.path=e.path,o.query=null!==n.query?n.query:e.query;else{if(0===n.path.indexOf("/"))o.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,o.path=t}o.query=n.query}""!==n.path&&(o.path=i.removeDotSegments(o.path));let a=o.protocol;return null!==o.authority&&(a+="//"+o.authority),a+=o.path,null!==o.query&&(a+="?"+o.query),null!==n.fragment&&(a+="#"+n.fragment),""===a&&(a="./"),a},i.removeBase=(e,t)=>{if(null===e)return t;(!e||r.isString(e))&&(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const o=i.parse(t.substr(n.length)),a=e.normalizedPath.split("/"),s=o.normalizedPath.split("/"),u=o.fragment||o.query?0:1;for(;a.length>0&&s.length>u&&a[0]===s[0];)a.shift(),s.shift();let c="";if(a.length>0){a.pop();for(let e=0;e{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),r=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>r.isString(e)&&o.test(e),i.isRelative=e=>r.isString(e)},{"./types":30}],32:[function(e,t,n){"use strict";const r=e("./graphTypes"),i=e("./types"),o=e("rdf-canonize").IdentifierIssuer,a=e("./JsonLdError"),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,u=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l={accept:"application/ld+json, application/json"},d={};function f(e,t){if(i.isArray(t))for(let n=0;n{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+l.accept+'" is supported.');return Object.assign({Accept:l.accept},e)},d.parseLinkHeader=e=>{const t={},n=e.match(s);for(let r=0;r{if(!(i.isString(e)||i.isArray(e)&&e.every(e=>i.isString(e)))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&d.asArray(e["@default"]).every(e=>i.isString(e)))return}throw new a('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},d.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},d.hasValue=(e,t,n)=>{if(d.hasProperty(e,t)){let o=e[t];const a=r.isList(o);if(i.isArray(o)||a){a&&(o=o["@list"]);for(let e=0;e{if("propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1),"valueIsArray"in r||(r.valueIsArray=!1),"allowDuplicate"in r||(r.allowDuplicate=!0),"prependValue"in r||(r.prependValue=!1),r.valueIsArray)e[t]=n;else if(i.isArray(n)){0===n.length&&r.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),r.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i[].concat(e[t]||[]),d.removeProperty=(e,t)=>{delete e[t]},d.removeValue=(e,t,n,r)=>{"propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1);const i=d.getValues(e,t).filter(e=>!d.compareValues(e,n));0===i.length?d.removeProperty(e,t):e[t]=1!==i.length||r.propertyIsArray?i:i[0]},d.relabelBlankNodes=(e,t)=>f((t=t||{}).issuer||new o("_:b"),e),d.compareValues=(e,t)=>!!(e===t||r.isValue(e)&&r.isValue(t)&&e["@value"]===t["@value"]&&e["@type"]===t["@type"]&&e["@language"]===t["@language"]&&e["@index"]===t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],d.compareShortestLeast=(e,t)=>e.length1;const g=(e,t,n)=>{const r=e[f].get(t);if(r){const t=r.value;if(y(e,t)){if(b(e,r),!e[s])return}else n&&(e[h]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[u])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[u]&&n>e[u]},m=e=>{if(e[o]>e[i])for(let t=e[d].tail;e[o]>e[i]&&null!==t;){const n=t.prev;b(e,t),t=n}},b=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[o]-=n.length,e[f].delete(n.key),e[d].removeNode(t)}};class v{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const _=(e,t,n,r)=>{let i=n.value;y(e,i)&&(b(e,n),e[s]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};t.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[a]="function"!=typeof t?p:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[u]=e.maxAge||0,this[c]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,m(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,m(this)}get maxAge(){return this[u]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[o]=0,this[d].forEach(e=>{e.length=this[a](e.value,e.key),this[o]+=e.length})),m(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;_(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;_(this,e,n,t),n=r}}keys(){return this[d].toArray().map(e=>e.key)}values(){return this[d].toArray().map(e=>e.value)}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach(e=>this[c](e.key,e.value)),this[f]=new Map,this[d]=new r,this[o]=0}dump(){return this[d].map(e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[u])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[i])return b(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[c]&&(this[l]||this[c](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),m(this),!0}const h=new v(e,t,s,r,n);return h.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=h.length,this[d].unshift(h),this[f].set(e,this[d].head),m(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[d].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[f].forEach((e,t)=>g(this,t,!1))}}},{yallist:92}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",o="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:`${i}decimal`,boolean:`${i}boolean`,double:`${i}double`,integer:`${i}integer`,string:`${i}string`},rdf:{type:`${r}type`,nil:`${r}nil`,first:`${r}first`,rest:`${r}rest`,langString:`${r}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${o}reify#forSome`,forAll:`${o}reify#forAll`},log:{implies:`${o}log#implies`}}},{}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function e(t,n){if(n=n||f,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===f)return new g(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));const r=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,r-1),"@"===t[r+1]?t.substr(r+2):n.namedNode(t.substr(r+3)));case"<":const i=d.exec(t);return n.quad(e(w(i[1]),n),e(w(i[2]),n),e(w(i[3]),n),i[4]&&e(w(i[4]),n));default:return n.namedNode(t)}},n.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof h&&"Quad"!==t.termType)return t.id;if(!t)return u.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return`_:${t.value}`;case"Variable":return`?${t.value}`;case"DefaultGraph":return"";case"Literal":return`"${t.value}"${t.language?`@${t.language}`:t.datatype&&t.datatype.value!==s.string?`^^${t.datatype.value}`:""}`;case"Quad":return`<<${_(e(t.subject))} ${_(e(t.predicate))} ${_(e(t.object))}${(0,o.isDefaultGraph)(t.graph)?"":` ${e(t.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${t.termType}`)}},n.escapeQuotes=_,n.unescapeQuotes=w,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var r,i=(r=e("./IRIs"))&&r.__esModule?r:{default:r},o=e("./N3Util");const{rdf:a,xsd:s}=i.default;let u,c=0;const l=/^"(.*".*)(?="[^"]*$)/,d=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,f={namedNode:function(e){return new p(e)},blankNode:function(e){return new y(e||"n3-"+c++)},variable:function(e){return new m(e)},literal:function(e,t){if("string"==typeof t)return new g(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";return""===n&&("boolean"==typeof e?n=s.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?s.integer:s.double:(n=s.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new g(""===n||n===s.string?`"${e}"`:`"${e}"^^${n}`)},defaultGraph:function(){return u},quad:x,triple:x};n.default=f;class h{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof h?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}toJSON(){return{termType:this.termType,value:this.value}}}n.Term=h;class p extends h{get termType(){return"NamedNode"}}n.NamedNode=p;class g extends h{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`"${t.replace(/"/g,'""')}`)}function w(e){return e.replace(l,(e,t)=>`"${t.replace(/""/g,'"')}`)}function x(e,t,n,r){return new v(e,t,n,r)}n.Triple=n.Quad=v},{"./IRIs":34,"./N3Util":41}],36:[function(e,t,n){(function(t){(function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./IRIs")),i=o(e("queue-microtask"));function o(e){return e&&e.__esModule?e:{default:e}}const{xsd:a}=r.default,s=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,u={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},c=/[\x00-\x20<>\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},d=/$0^/;n.default=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._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]*)?$/,this._lineMode=!!(e=e||{}).lineMode){this._n3Mode=!1;for(const e in this)!(e in l)&&this[e]instanceof RegExp&&(this[e]=d)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input;const r=this._comments;for(;;){let o,s;for(;o=this._newline.exec(n);)r&&(s=this._comment.exec(o[0]))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),n=n.substr(o[0].length,n.length),this._line++;if(!o&&(o=this._whitespace.exec(n))&&(n=n.substr(o[0].length,n.length)),this._endOfFile.test(n))return t&&(r&&(s=this._comment.exec(n))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),e(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;const u=this._line,l=n[0];let d="",f="",h="",p=null,g=0,y=!1;switch(l){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(g=1,d="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){y=!0;break}case"<":if(p=this._unescapedIri.exec(n))d="IRI",f=p[1];else if(p=this._iri.exec(n)){if(f=this._unescape(p[1]),null===f||c.test(f))return i(this);d="IRI"}else n.length>1&&"<"===n[1]?(d="<<",g=2):this._n3Mode&&n.length>1&&"="===n[1]&&(d="inverse",g=2,f=">");break;case">":n.length>1&&">"===n[1]&&(d=">>",g=2);break;case"_":((p=this._blank.exec(n))||t&&(p=this._blank.exec(`${n} `)))&&(d="blank",h="_",f=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(n))f=p[1];else if(({value:f,matchLength:g}=this._parseLiteral(n)),null===f)return i(this);(null!==p||0!==g)&&(d="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(p=this._simpleApostropheString.exec(n))f=p[1];else if(({value:f,matchLength:g}=this._parseLiteral(n)),null===f)return i(this);(null!==p||0!==g)&&(d="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(n))&&(d="var",f=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(n))?(d="langcode",f=p[1]):(p=this._keyword.exec(n))&&(d=p[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){d=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(n)||t&&(p=this._number.exec(`${n} `)))&&(d="literal",f=p[0],h="string"==typeof p[1]?a.double:"string"==typeof p[2]?a.decimal:a.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(n))?d=p[0].toUpperCase():y=!0;break;case"f":case"t":(p=this._boolean.exec(n))?(d="literal",f=p[0],h=a.boolean):y=!0;break;case"a":(p=this._shortPredicates.exec(n))?(d="abbreviation",f="a"):y=!0;break;case"=":this._n3Mode&&n.length>1&&(d="abbreviation",">"!==n[1]?(g=1,f="="):(g=2,f=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(g=1,d=l);break;default:y=!0}if(y&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(n))?((p=this._prefixed.exec(n))||t&&(p=this._prefixed.exec(`${n} `)))&&(d="prefixed",h=p[1]||"",f=this._unescape(p[2])):(d="prefix",f=p[1]||"")),"^^"===this._previousMarker)switch(d){case"prefixed":d="type";break;case"IRI":d="typeIRI";break;default:d=""}if(!d)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?i(this):this._input=n;const m={line:u,type:d,value:f,prefix:h};e(null,m),this.previousToken=m,this._previousMarker=d,n=n.substr(g||p[0].length,n.length)}function i(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(s,(e,n,r,i)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in u?u[i]:(t=!0,"")});return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;"\\"===e[r-t-1];)t++;if(t%2==0){const t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,o=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,n){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof n){const e=[];let t;if(this._tokenizeToEnd((n,r)=>n?t=n:e.push(r),!0),t)throw t;return e}(0,i.default)(()=>this._tokenizeToEnd(n,!0))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=t.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(n,!1)))}),e.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(n,!0)}),e.on("error",n)}}}).call(this)}).call(this,e("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("./N3Lexer")),i=a(e("./N3DataFactory")),o=a(e("./IRIs"));function a(e){return e&&e.__esModule?e:{default:e}}let s=0;class u{constructor(e){this._contextStack=[],this._graph=null,this._setBase((e=e||{}).baseIRI),e.factory&&l(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),i=/trig/.test(t),o=/triple/.test(t),a=/quad/.test(t),s=this._n3Mode=/n3/.test(t),u=o||a;(this._supportsNamedGraphs=!(n||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||o||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),u&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new r.default({lineMode:u,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){s=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,n,r,i){const o=this._n3Mode;this._contextStack.push({subject:n,predicate:r,object:i,graph:t,type:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);n=this._namedNode(t);break;case"type":case"prefixed":const r=this._prefixes[e.prefix];if(void 0===r)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._namedNode(r+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,r=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),r=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),r=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===i?null===a.predicate?a.subject=n:a.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return r}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const r=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==r){const e=this._predicate,t=this._object;i?this._emit(t,e,r,n):this._emit(r,e,t,n)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){const e=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n;const r=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let n,r;if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(r=this._subject,this._subject=t):(r=this._object,this._object=t),this._emit(t,n,r,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,r){this._callback(null,this._quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let n="",r=-1,i=-1,o=0,a="/";for(;r=i&&(n=n.substr(0,o)),"/"!==a)return`${n}/${e.substr(r+1)}`;o=r+1}}}a=e[++r]}return n+e.substring(o)}parse(e,t,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${s++}_`,this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let n;if(this._callback=(e,r)=>{e?n=e:r&&t.push(r)},this._lexer.tokenize(e).every(e=>this._readCallback=this._readCallback(e)),n)throw n;return t}this._callback=t,this._lexer.tokenize(e,(e,t)=>{null!==e?(this._callback(e),this._callback=c):this._readCallback&&(this._readCallback=this._readCallback(t))})}}function c(){}function l(e,t){const n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(o.default.rdf.first),e.RDF_REST=n(o.default.rdf.rest),e.RDF_NIL=n(o.default.rdf.nil),e.N3_FORALL=n(o.default.r.forAll),e.N3_FORSOME=n(o.default.r.forSome),e.ABBREVIATIONS={a:n(o.default.rdf.type),"=":n(o.default.owl.sameAs),">":n(o.default.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=u,l(u.prototype,i.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(e("./N3DataFactory")),o=e("readable-stream"),a=(r=e("./IRIs"))&&r.__esModule?r:{default:r};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u{constructor(e,t){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!t&&e&&!e[0]&&(t=e,e=null),this._factory=(t=t||{}).factory||i.default,e&&this.addQuads(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let n,r;for(const i in t)for(const o in n=t[i].subjects)for(const t in r=n[o])e+=Object.keys(r[t]).length;return this._size=e}_addToIndex(e,t,n,r){const i=e[t]||(e[t]={}),o=i[n]||(i[n]={}),a=r in o;return a||(o[r]=null),!a}_removeFromIndex(e,t,n,r){const i=e[t],o=i[n];delete o[r];for(const a in o)return;delete i[n];for(const a in i)return;delete e[t]}_findInIndex(e,t,n,r,o,a,s,u,c,l){let d,f,h;const p=!t+!n+!r>1?Object.keys(this._ids):this._entities;t&&((d=e,e={})[t]=d[t]);for(const g in e){const t=p[g];if(f=e[g]){n&&((d=f,f={})[n]=d[n]);for(const e in f){const n=p[e];if(h=f[e]){const e=r?r in h?[r]:[]:Object.keys(h);for(let r=0;r{n in t||(t[n]=!0,e((0,i.termFromId)(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),e=(0,i.termToId)(e),t=(0,i.termToId)(t),n=(0,i.termToId)(n),r=(0,i.termToId)(r);let o=this._graphs[r];o||(o=this._graphs[r]={subjects:{},predicates:{},objects:{}},Object.freeze(o));const a=this._ids,s=this._entities;e=a[e]||(a[s[++this._id]=e]=this._id),t=a[t]||(a[s[++this._id]=t]=this._id),n=a[n]||(a[s[++this._id]=n]=this._id);const u=this._addToIndex(o.subjects,e,t,n);return this._addToIndex(o.predicates,t,n,e),this._addToIndex(o.objects,n,e,t),this._size=null,u}addQuads(e){for(let t=0;t{this.addQuad(e)}),e}removeQuad(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),e=(0,i.termToId)(e),t=(0,i.termToId)(t),n=(0,i.termToId)(n),r=(0,i.termToId)(r);const o=this._ids,a=this._graphs;let s,u,c;if(!((e=o[e])&&(t=o[t])&&(n=o[n])&&(s=a[r])&&(u=s.subjects[e])&&(c=u[t])&&n in c))return!1;for(e in this._removeFromIndex(s.subjects,e,t,n),this._removeFromIndex(s.predicates,t,n,e),this._removeFromIndex(s.objects,n,e,t),null!==this._size&&this._size--,s.subjects)return!0;return delete a[r],!0}removeQuads(e){for(let t=0;t{this.removeQuad(e)}),e}removeMatches(e,t,n,r){const i=new o.Readable({objectMode:!0});return i._read=()=>{for(const o of this.getQuads(e,t,n,r))i.push(o);i.push(null)},this.remove(i)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,r){e=e&&(0,i.termToId)(e),t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=[],a=this._getGraphs(r),s=this._ids;let u,l,d,f;if(c(e)&&!(l=s[e])||c(t)&&!(d=s[t])||c(n)&&!(f=s[n]))return o;for(const i in a)(u=a[i])&&(l?f?this._findInIndex(u.objects,f,l,d,"object","subject","predicate",i,null,o):this._findInIndex(u.subjects,l,d,null,"subject","predicate","object",i,null,o):d?this._findInIndex(u.predicates,d,f,null,"predicate","object","subject",i,null,o):f?this._findInIndex(u.objects,f,null,null,"object","subject","predicate",i,null,o):this._findInIndex(u.subjects,null,null,null,"subject","predicate","object",i,null,o));return o}match(e,t,n,r){return new l(this,e,t,n,r)}countQuads(e,t,n,r){e=e&&(0,i.termToId)(e),t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=this._getGraphs(r),a=this._ids;let s,u,l,d,f=0;if(c(e)&&!(u=a[e])||c(t)&&!(l=a[t])||c(n)&&!(d=a[n]))return 0;for(const i in o)(s=o[i])&&(f+=e?n?this._countInIndex(s.objects,d,u,l):this._countInIndex(s.subjects,u,l,d):t?this._countInIndex(s.predicates,l,d,u):this._countInIndex(s.objects,d,u,l));return f}forEach(e,t,n,r,i){this.some(t=>(e(t),!1),t,n,r,i)}every(e,t,n,r,i){let o=!1;const a=!this.some(t=>(o=!0,!e(t)),t,n,r,i);return o&&a}some(e,t,n,r,o){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r),o=o&&(0,i.termToId)(o);const a=this._getGraphs(o),s=this._ids;let u,l,d,f;if(c(t)&&!(l=s[t])||c(n)&&!(d=s[n])||c(r)&&!(f=s[r]))return!1;for(const i in a)if(u=a[i])if(l){if(f){if(this._findInIndex(u.objects,f,l,d,"object","subject","predicate",i,e,null))return!0}else if(this._findInIndex(u.subjects,l,d,null,"subject","predicate","object",i,e,null))return!0}else if(d){if(this._findInIndex(u.predicates,d,f,null,"predicate","object","subject",i,e,null))return!0}else if(f){if(this._findInIndex(u.objects,f,null,null,"object","subject","predicate",i,e,null))return!0}else if(this._findInIndex(u.subjects,null,null,null,"subject","predicate","object",i,e,null))return!0;return!1}getSubjects(e,t,n){const r=[];return this.forSubjects(e=>{r.push(e)},e,t,n),r}forSubjects(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=this._ids,a=this._getGraphs(r);let s,u,l;if(e=this._uniqueEntities(e),!(c(t)&&!(u=o[t])||c(n)&&!(l=o[n])))for(r in a)(s=a[r])&&(u?l?this._loopBy2Keys(s.predicates,u,l,e):this._loopByKey1(s.subjects,u,e):l?this._loopByKey0(s.objects,l,e):this._loop(s.subjects,e))}getPredicates(e,t,n){const r=[];return this.forPredicates(e=>{r.push(e)},e,t,n),r}forPredicates(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=this._ids,a=this._getGraphs(r);let s,u,l;if(e=this._uniqueEntities(e),!(c(t)&&!(u=o[t])||c(n)&&!(l=o[n])))for(r in a)(s=a[r])&&(u?l?this._loopBy2Keys(s.objects,l,u,e):this._loopByKey0(s.subjects,u,e):l?this._loopByKey1(s.predicates,l,e):this._loop(s.predicates,e))}getObjects(e,t,n){const r=[];return this.forObjects(e=>{r.push(e)},e,t,n),r}forObjects(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);const o=this._ids,a=this._getGraphs(r);let s,u,l;if(e=this._uniqueEntities(e),!(c(t)&&!(u=o[t])||c(n)&&!(l=o[n])))for(r in a)(s=a[r])&&(u?l?this._loopBy2Keys(s.subjects,u,l,e):this._loopByKey1(s.objects,u,e):l?this._loopByKey0(s.predicates,l,e):this._loop(s.objects,e))}getGraphs(e,t,n){const r=[];return this.forGraphs(e=>{r.push(e)},e,t,n),r}forGraphs(e,t,n,r){for(const i in this._graphs)this.some(t=>(e(t.graph),!0),t,n,r,i)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const n={},r=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,a.default.rdf.rest,a.default.rdf.nil,null),o=e?[...i]:[];return i.forEach(t=>{const i=[];let s,u,c=!1;const l=t.graph;let d=t.subject;for(;d&&!c;){const e=this.getQuads(null,null,d,null),t=this.getQuads(d,null,null,null);let n,f=null,h=null,p=null;for(let i=0;i{switch(e){case"data":t=r;break;case"end":n=r}}},(e,t)=>{e&&this.emit("error",e)||t&&this.push(t)},(e,t)=>{this.emit("prefix",e,t)}),this._transform=(e,n,r)=>{t(e),r()},this._flush=e=>{n(),e()}}import(e){return e.on("data",e=>{this.write(e)}),e.on("end",()=>{this.end()}),e.on("error",e=>{this.emit("error",e)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=e("readable-stream"),o=(r=e("./N3Writer"))&&r.__esModule?r:{default:r};n.default=class extends i.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0});const t=this._writer=new o.default({write:(e,t,n)=>{this.push(e),n&&n()},end:e=>{this.push(null),e&&e()}},e);this._transform=(e,n,r)=>{t.addQuad(e,r)},this._flush=e=>{t.end(e)}}import(e){return e.on("data",e=>{this.write(e)}),e.on("end",()=>{this.end()}),e.on("error",e=>{this.emit("error",e)}),e.on("prefix",(e,t)=>{this._writer.addPrefix(e,t)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isNamedNode=function(e){return!!e&&"NamedNode"===e.termType},n.isBlankNode=function(e){return!!e&&"BlankNode"===e.termType},n.isLiteral=function(e){return!!e&&"Literal"===e.termType},n.isVariable=function(e){return!!e&&"Variable"===e.termType},n.isDefaultGraph=o,n.inDefaultGraph=function(e){return o(e.graph)},n.prefix=function(e,t){return a({"":e},t)("")},n.prefixes=a;var r,i=(r=e("./N3DataFactory"))&&r.__esModule?r:{default:r};function o(e){return!!e&&"DefaultGraph"===e.termType}function a(e,t){const n=Object.create(null);for(const i in e)r(i,e[i]);function r(e,r){if("string"==typeof r){const i=Object.create(null);n[e]=e=>i[e]||(i[e]=t.namedNode(r+e))}else if(!(e in n))throw new Error(`Unknown prefix: ${e}`);return n[e]}return t=t||i.default,r}},{"./N3DataFactory":35}],42:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=(r=e("./IRIs"))&&r.__esModule?r:{default:r},o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(e("./N3DataFactory")),a=e("./N3Util");function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const u=o.default.defaultGraph(),{rdf:c,xsd:l}=i.default,d=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,f=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,h={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class p extends o.Term{equals(){return!1}}function g(e){let t=h[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}n.default=class{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),this._lists=(t=t||{}).lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,n,r){e+=t,r&&r()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=u,this._baseIRI=t.baseIRI,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes))}get _inDefaultGraph(){return u.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,n,r,i){try{r.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(u.equals(r)?"":`${this._encodeIriOrBlank(r)} {\n`)),this._graph=r,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i)}catch(o){i&&i(o)}}_writeQuadLine(e,t,n,r,i){delete this._prefixMatch,this._write(this.quadToString(e,t,n,r),i)}quadToString(e,t,n,r){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${r&&r.value?` ${this._encodeIriOrBlank(r)} .\n`:" .\n"}`}quadsToString(e){return e.map(e=>this.quadToString(e.subject,e.predicate,e.object,e.graph)).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseIRI&&t.startsWith(this._baseIRI)&&(t=t.substr(this._baseIRI.length)),d.test(t)&&(t=t.replace(f,g));const n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(d.test(t)&&(t=t.replace(f,g)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===l.string)return`"${t}"`}else switch(e.datatype.value){case l.string:return`"${t}"`;case l.boolean:if("true"===t||"false"===t)return t;break;case l.integer:if(/^[+-]?\d+$/.test(t))return t;break;case l.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case l.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===c.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:n,graph:r}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${(0,a.isDefaultGraph)(r)?"":` ${this._encodeIriOrBlank(r)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,u,r):this._writeQuad(e,t,n,r||u,i)}addQuads(e){for(let t=0;t.\n`)}if(n){let e="",t="";for(const n in this._prefixIRIs)e+=e?`|${n}`:n,t+=(t?"|":"")+this._prefixIRIs[n];e=e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",t)}blank(e,t){let n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new p("[]");case 1:if(n=i[0],!(n.object instanceof p))return new p(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let t="[";for(let o=0;o{t=null,e(n,r)});if(this._endStream)try{return this._outputStream.end(t)}catch(n){}t&&t()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"Writer",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"Store",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"StreamParser",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"StreamWriter",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"DataFactory",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"Term",{enumerable:!0,get:function(){return l.Term}}),Object.defineProperty(n,"NamedNode",{enumerable:!0,get:function(){return l.NamedNode}}),Object.defineProperty(n,"Literal",{enumerable:!0,get:function(){return l.Literal}}),Object.defineProperty(n,"BlankNode",{enumerable:!0,get:function(){return l.BlankNode}}),Object.defineProperty(n,"Variable",{enumerable:!0,get:function(){return l.Variable}}),Object.defineProperty(n,"DefaultGraph",{enumerable:!0,get:function(){return l.DefaultGraph}}),Object.defineProperty(n,"Quad",{enumerable:!0,get:function(){return l.Quad}}),Object.defineProperty(n,"Triple",{enumerable:!0,get:function(){return l.Triple}}),Object.defineProperty(n,"termFromId",{enumerable:!0,get:function(){return l.termFromId}}),Object.defineProperty(n,"termToId",{enumerable:!0,get:function(){return l.termToId}}),n.Util=void 0;var r=h(e("./N3Lexer")),i=h(e("./N3Parser")),o=h(e("./N3Writer")),a=h(e("./N3Store")),s=h(e("./N3StreamParser")),u=h(e("./N3StreamWriter")),c=f(e("./N3Util"));n.Util=c;var l=f(e("./N3DataFactory"));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function h(e){return e&&e.__esModule?e:{default:e}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(e,t,n){var r,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(n){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,l=[],d=!1,f=-1;function h(){!d||!c||(d=!1,c.length?l=c.concat(l):f=-1,l.length&&p())}function p(){if(!d){var e=u(h);d=!0;for(var t=l.length;t;){for(c=l,l=[];++f1)for(var n=1;n(n||(n=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(e,t,n){t.exports=e("./lib")},{"./lib":55}],47:[function(e,t,n){"use strict";t.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:r}=this;return new e(t,new Map(n),r)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(e,t,n){"use strict";e("setimmediate");const i=self.crypto||self.msCrypto;t.exports=class{constructor(e){if(!i||!i.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupport algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}digest(){var e=this;return r(function*(){const t=(new TextEncoder).encode(e._content),n=new Uint8Array(yield i.subtle.digest(e.algorithm,t));let r="";for(let e=0;e{const e="[ \\t]*";c.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,c.empty=new RegExp("^"+e+"$"),c.quad=new RegExp("^"+e+'(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))'+e+"$")})(),t.exports=class e{static parse(e){const t=[],n={},d=e.split(c.eoln);let h=0;for(const p of d){if(h++,c.empty.test(p))continue;const e=p.match(c.quad);if(null===e)throw new Error("N-Quads parse error on line "+h+".");const d={subject:null,predicate:null,object:null,graph:null};if(d.subject=void 0!==e[1]?{termType:o,value:e[1]}:{termType:a,value:e[2]},d.predicate={termType:o,value:e[3]},void 0!==e[4]?d.object={termType:o,value:e[4]}:void 0!==e[5]?d.object={termType:a,value:e[5]}:(d.object={termType:s,value:void 0,datatype:{termType:o}},void 0!==e[7]?d.object.datatype.value=e[7]:void 0!==e[8]?(d.object.datatype.value=r,d.object.language=e[8]):d.object.datatype.value=i,d.object.value=e[6].replace(f,function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")})),d.graph=void 0!==e[9]?{termType:o,value:e[9]}:void 0!==e[10]?{termType:a,value:e[10]}:{termType:u,value:""},d.graph.value in n){let e=!0;const r=n[d.graph.value];for(const t of r)if(l(t,d)){e=!1;break}e&&(r.push(d),t.push(d))}else n[d.graph.value]=[d],t.push(d)}return t}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const r of t)n.push(e.serializeQuad(r));return n.sort().join("")}static serializeQuad(e){const t=e.subject,n=e.object,s=e.graph;let u="";return u+=t.termType===o?`<${t.value}>`:`${t.value}`,u+=` <${e.predicate.value}> `,n.termType===o?u+=`<${n.value}>`:n.termType===a?u+=n.value:(u+=`"${c=n.value,c.replace(d,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,n.datatype.value===r?n.language&&(u+=`@${n.language}`):n.datatype.value!==i&&(u+=`^^<${n.datatype.value}>`)),s.termType===o?u+=` <${s.value}>`:s.termType===a&&(u+=` ${s.value}`),u+=" .\n",u;var c}static legacyDatasetToQuads(e){const t=[],n={"blank node":a,IRI:o,literal:s};for(const c in e)e[c].forEach(e=>{const l={};for(const t in e){const a=e[t],u={termType:n[a.type],value:a.value};u.termType===s&&(u.datatype={termType:o},"datatype"in a&&(u.datatype.value=a.datatype),"language"in a?("datatype"in a||(u.datatype.value=r),u.language=a.language):"datatype"in a||(u.datatype.value=i)),l[t]=u}l.graph="@default"===c?{termType:u,value:""}:{termType:c.startsWith("_:")?a:o,value:c},t.push(l)});return t}};const d=/["\\\n\r]/g;const f=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(e,t,n){"use strict";t.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;tr)&&(s&&a>0&&n>e[a-1]||!s&&ae[a+1])&&(r=n,i=a)}if(null===r)this.done=!0;else{const n=t.get(r)?i-1:i+1;e[i]=e[n],e[n]=r;for(const i of e)i>r&&t.set(i,!t.get(i))}return n}}},{}],51:[function(e,t,n){(function(n){(function(){"use strict";const i=e("./IdentifierIssuer"),o=e("./MessageDigest"),a=e("./Permuter"),s=e("./NQuads");function u(e,t){return e.hasht.hash?1:0}t.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(e){var t=this;return r(function*(){t.quads=e;for(const i of e)t._addBlankNodeQuadInfo({quad:i,component:i.subject}),t._addBlankNodeQuadInfo({quad:i,component:i.object}),t._addBlankNodeQuadInfo({quad:i,component:i.graph});const n=new Map,r=[...t.blankNodeInfo.keys()];let o=0;for(const e of r)++o%100==0&&(yield t._yield()),yield t._hashAndTrackBlankNode({id:e,hashToBlankNodes:n});const a=[...n.keys()].sort(),c=[];for(const e of a){const r=n.get(e);r.length>1?c.push(r):t.canonicalIssuer.getId(r[0])}for(const e of c){const n=[];for(const r of e){if(t.canonicalIssuer.hasId(r))continue;const e=new i("_:b");e.getId(r);const o=yield t.hashNDegreeQuads(r,e);n.push(o)}n.sort(u);for(const e of n){const n=e.issuer.getOldIds();for(const e of n)t.canonicalIssuer.getId(e)}}const l=[];for(const e of t.quads){const n=or({},e);n.subject=t._useCanonicalId({component:n.subject}),n.object=t._useCanonicalId({component:n.object}),n.graph=t._useCanonicalId({component:n.graph}),l.push(s.serializeQuad(n))}return l.sort(),l.join("")})()}hashFirstDegreeQuads(e){var t=this;return r(function*(){const n=[],r=t.blankNodeInfo.get(e),i=r.quads;for(const o of i){const r={subject:null,predicate:o.predicate,object:null,graph:null};r.subject=t.modifyFirstDegreeComponent(e,o.subject,"subject"),r.object=t.modifyFirstDegreeComponent(e,o.object,"object"),r.graph=t.modifyFirstDegreeComponent(e,o.graph,"graph"),n.push(s.serializeQuad(r))}n.sort();const a=new o(t.hashAlgorithm);for(const e of n)a.update(e);return r.hash=yield a.digest(),r.hash})()}hashRelatedBlankNode(e,t,n,i){var a=this;return r(function*(){let r;r=a.canonicalIssuer.hasId(e)?a.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):a.blankNodeInfo.get(e).hash;const s=new o(a.hashAlgorithm);return s.update(i),"g"!==i&&s.update(a.getRelatedPredicate(t)),s.update(r),s.digest()})()}hashNDegreeQuads(e,t){var n=this;return r(function*(){const r=new o(n.hashAlgorithm),i=yield n.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){r.update(e);let o,s="";const u=new a(i.get(e));let c=0;for(;u.hasNext();){const e=u.next();++c%3==0&&(yield n._yield());let r=t.clone(),i="";const a=[];let l=!1;for(const t of e)if(n.canonicalIssuer.hasId(t)?i+=n.canonicalIssuer.getId(t):(r.hasId(t)||a.push(t),i+=r.getId(t)),0!==s.length&&i>s){l=!0;break}if(!l){for(const e of a){const t=yield n.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==s.length&&i>s){l=!0;break}}l||(0===s.length||i`}createHashToRelated(e,t){var n=this;return r(function*(){const r=new Map,i=n.blankNodeInfo.get(e).quads;let o=0;for(const a of i)++o%100==0&&(yield n._yield()),yield Promise.all([n._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:e,issuer:t,hashToRelated:r}),n._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:e,issuer:t,hashToRelated:r}),n._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r})()}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){var n=this;return r(function*(){const r=yield n.hashFirstDegreeQuads(e),i=t.get(r);i?i.push(e):t.set(r,[e])})()}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:i,issuer:o,hashToRelated:a}){var s=this;return r(function*(){if("BlankNode"!==t.termType||t.value===i)return;const r=t.value,u=yield s.hashRelatedBlankNode(r,e,o,n),c=a.get(u);c?c.push(r):a.set(u,[r])})()}_useCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}_yield(){return r(function*(){return new Promise(e=>n(e))})()}}}).call(this)}).call(this,e("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(e,t,n){"use strict";const r=e("./IdentifierIssuer"),i=e("./MessageDigest"),o=e("./Permuter"),a=e("./NQuads");function s(e,t){return e.hasht.hash?1:0}t.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(e){this.quads=e;for(const r of e)this._addBlankNodeQuadInfo({quad:r,component:r.subject}),this._addBlankNodeQuadInfo({quad:r,component:r.object}),this._addBlankNodeQuadInfo({quad:r,component:r.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const r of n)this._hashAndTrackBlankNode({id:r,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const r of i){const e=t.get(r);e.length>1?o.push(e):this.canonicalIssuer.getId(e[0])}for(const a of o){const e=[];for(const t of a){if(this.canonicalIssuer.hasId(t))continue;const n=new r("_:b");n.getId(t);const i=this.hashNDegreeQuads(t,n);e.push(i)}e.sort(s);for(const t of e){const e=t.issuer.getOldIds();for(const t of e)this.canonicalIssuer.getId(t)}}const u=[];for(const r of this.quads){const e=or({},r);e.subject=this._useCanonicalId({component:e.subject}),e.object=this._useCanonicalId({component:e.object}),e.graph=this._useCanonicalId({component:e.graph}),u.push(a.serializeQuad(e))}return u.sort(),u.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const i of r){const n={subject:null,predicate:i.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,i.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,i.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,i.graph,"graph"),t.push(a.serializeQuad(n))}t.sort();const o=new i(this.hashAlgorithm);for(const i of t)o.update(i);return n.hash=o.digest(),n.hash}hashRelatedBlankNode(e,t,n,r){let o;o=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const a=new i(this.hashAlgorithm);return a.update(r),"g"!==r&&a.update(this.getRelatedPredicate(t)),a.update(o),a.digest()}hashNDegreeQuads(e,t){const n=new i(this.hashAlgorithm),r=this.createHashToRelated(e,t),a=[...r.keys()].sort();for(const i of a){n.update(i);let e,a="";const s=new o(r.get(i));for(;s.hasNext();){const n=s.next();let r=t.clone(),i="";const o=[];let u=!1;for(const e of n)if(this.canonicalIssuer.hasId(e)?i+=this.canonicalIssuer.getId(e):(r.hasId(e)||o.push(e),i+=r.getId(e)),0!==a.length&&i>a){u=!0;break}if(!u){for(const e of o){const t=this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==a.length&&i>a){u=!0;break}}u||(0===a.length||i`}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===r)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,i,n),u=o.get(s);u?u.push(a):o.set(s,[a])}_useCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(e,t,n){"use strict";const i=e("./URDNA2015");t.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){var n=this;return r(function*(){const r=new Map,i=n.blankNodeInfo.get(e).quads;let o=0;for(const a of i){let i,s;if("BlankNode"===a.subject.termType&&a.subject.value!==e)s=a.subject.value,i="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;s=a.object.value,i="r"}++o%100==0&&(yield n._yield());const u=yield n.hashRelatedBlankNode(s,a,t,i),c=r.get(u);c?c.push(s):r.set(u,[s])}return r})()}}},{"./URDNA2015":51}],54:[function(e,t,n){"use strict";const r=e("./URDNA2015Sync");t.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r){let r,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,r="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,r="r"}const a=this.hashRelatedBlankNode(o,i,t,r),s=n.get(a);s?s.push(o):n.set(a,[o])}return n}}},{"./URDNA2015Sync":52}],55:[function(e,t,n){"use strict";const i=e("./URDNA2015"),o=e("./URGNA2012"),a=e("./URDNA2015Sync"),s=e("./URGNA2012Sync");let u;try{u=e("rdf-canonize-native")}catch(l){}const c={};t.exports=c,c.NQuads=e("./NQuads"),c.IdentifierIssuer=e("./IdentifierIssuer"),c._rdfCanonizeNative=function(e){return e&&(u=e),u},c.canonize=function(){var e=r(function*(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(!u)throw new Error("rdf-canonize-native not available");return new Promise((n,r)=>u.canonize(e,t,(e,t)=>e?r(e):n(t)))}if("URDNA2015"===t.algorithm)return new i(t).main(e);if("URGNA2012"===t.algorithm)return new o(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(t,n){return e.apply(this,arguments)}}(),c._canonizeSync=function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(u)return u.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new a(t).main(e);if("URGNA2012"===t.algorithm)return new s(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),i(e("./lib/BlankNode"),n),i(e("./lib/DataFactory"),n),i(e("./lib/DefaultGraph"),n),i(e("./lib/Literal"),n),i(e("./lib/NamedNode"),n),i(e("./lib/Quad"),n),i(e("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0;n.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},{}],58:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;const r=e("./BlankNode"),i=e("./DefaultGraph"),o=e("./Literal"),a=e("./NamedNode"),s=e("./Quad"),u=e("./Variable");let c=0;n.DataFactory=class{constructor(e){this.blankNodeCounter=0,this.blankNodePrefix=(e=e||{}).blankNodePrefix||`df_${c++}_`}namedNode(e){return new a.NamedNode(e)}blankNode(e){return new r.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new o.Literal(e,t)}variable(e){return new u.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,n,r){return new s.Quad(e,t,n,r||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(o.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;class r{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}n.DefaultGraph=r,r.INSTANCE=new r},{}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;const r=e("./NamedNode");class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=i.XSD_STRING)}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}n.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0;n.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},{}],62:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0;n.Quad=class{constructor(e,t,n,r){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},{}],63:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0;n.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},{}],64:[function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),i(e("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;class r extends Error{constructor(e,t){const n=e.saxStream._parser;super(e.trackPosition?`Line ${n.line+1} column ${n.column+1}: ${t}`:t)}}n.ParseError=r},{}],66:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;const r=e("relative-to-absolute-iri"),i=e("sax"),o=e("stream"),a=e("./ParseError"),s=e("rdf-data-factory");class u extends o.Transform{constructor(e){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},e&&(Object.assign(this,e),this.options=e),this.dataFactory||(this.dataFactory=new s.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=i.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(e,t){const n={};let r=!1;for(const o in e.attributes)o.startsWith("xmlns")&&(5===o.length?(r=!0,n[""]=e.attributes[o]):":"===o.charAt(5)&&(r=!0,n[o.substr(6)]=e.attributes[o]));const i=t&&t.ns?t.ns:[u.DEFAULT_NS];return r?i.concat([n]):i}static expandPrefixedTerm(e,t,n){const r=e.indexOf(":");let i,o;r>=0?(i=e.substr(0,r),o=e.substr(r+1)):(i="",o=e);let s=null,u=null;for(let a=t.length-1;a>=0;a--){const e=t[a][i];if(e){s=e;break}u||(u=t[a][""])}if(!s){if(i&&"xmlns"!==i)throw new a.ParseError(n,`The prefix '${i}' in term '${e}' was not bound.`);s=u||""}return{prefix:i,local:o,uri:s}}static isValidIri(e){return u.IRI_REGEX.test(e)}import(e){const t=new o.PassThrough({readableObjectMode:!0});e.on("error",e=>n.emit("error",e)),e.on("data",e=>t.push(e)),e.on("end",()=>t.push(null));const n=t.pipe(new u(this.options));return n}_transform(e,t,n){try{this.saxStream.write(e,t)}catch(r){return n(r)}n()}newParseError(e){return new a.ParseError(this,e)}valueToUri(e,t){return this.uriToNamedNode(r.resolve(e,t.baseIRI))}uriToNamedNode(e){if(!u.isValidIri(e))throw this.newParseError(`Invalid URI: ${e}`);return this.dataFactory.namedNode(e)}validateNcname(e){if(!u.NCNAME_MATCHER.test(e))throw this.newParseError(`Not a valid NCName: ${e}`)}attachSaxListeners(){this.saxStream.on("error",e=>this.emit("error",e)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(e){const t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let n=c.RESOURCE;if(t&&(t.hadChildren=!0,n=t.childrenParseType),t&&t.childrenStringTags){const n=e.name;let r="";for(const t in e.attributes)r+=` ${t}="${e.attributes[t]}"`;t.childrenStringTags.push(`<${n}${r}>`);const i={childrenStringTags:t.childrenStringTags};return i.childrenStringEmitClosingTag=``,void this.activeTagStack.push(i)}const r={};t?(r.language=t.language,r.baseIRI=t.baseIRI):r.baseIRI=this.baseIRI,this.activeTagStack.push(r),r.ns=u.parseNamespace(e,t),n===c.RESOURCE?this.onTagResource(e,r,t,!t):this.onTagProperty(e,r,t)}onTagResource(e,t,n,i){const o=u.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=c.PROPERTY;let a=!0;if(o.uri===u.RDF){if(!i&&u.FORBIDDEN_NODE_ELEMENTS.indexOf(o.local)>=0)throw this.newParseError(`Illegal node element name: ${o.local}`);switch(o.local){case"RDF":t.childrenParseType=c.RESOURCE;case"Description":a=!1}}const s=[],l=[];let d=null,f=!1,h=!1,p=null;for(const c in e.attributes){const i=e.attributes[c],o=u.expandPrefixedTerm(c,t.ns,this);if(n&&o.uri===u.RDF)switch(o.local){case"about":if(d)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${d} where found.`);d=i;continue;case"ID":if(d)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${d} where found.`);this.validateNcname(i),d="#"+i,f=!0;continue;case"nodeID":if(d)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${d} where found.`);this.validateNcname(i),d=i,h=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=i;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(o.uri===u.XML){if("lang"===o.local){t.language=""===i?null:i.toLowerCase();continue}if("base"===o.local){t.baseIRI=r.resolve(i,t.baseIRI);continue}}"xml"!==o.prefix&&o.uri&&(s.push(this.uriToNamedNode(o.uri+o.local)),l.push(i))}if(null!==d&&(t.subject=h?this.dataFactory.blankNode(d):this.valueToUri(d,t),f&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),a){const e=this.uriToNamedNode(o.uri+o.local);this.emitTriple(t.subject,this.dataFactory.namedNode(u.RDF+"type"),e,n?n.reifiedStatementId:null)}if(n){if(n.predicate)if(n.childrenCollectionSubject){const e=this.dataFactory.blankNode();this.emitTriple(n.childrenCollectionSubject,n.childrenCollectionPredicate,e,n.reifiedStatementId),this.emitTriple(e,this.dataFactory.namedNode(u.RDF+"first"),t.subject,t.reifiedStatementId),n.childrenCollectionSubject=e,n.childrenCollectionPredicate=this.dataFactory.namedNode(u.RDF+"rest")}else{this.emitTriple(n.subject,n.predicate,t.subject,n.reifiedStatementId);for(let e=0;e=0)throw this.newParseError(`Illegal property element name: ${r.local}`);t.predicateSubPredicates=[],t.predicateSubObjects=[];let i=!1,o=!1,a=null,s=!0;const l=[],d=[];for(const f in e.attributes){const n=e.attributes[f],r=u.expandPrefixedTerm(f,t.ns,this);if(r.uri===u.RDF)switch(r.local){case"resource":if(a)throw this.newParseError(`Found both rdf:resource (${n}) and rdf:nodeID (${a}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${n})`);t.hadChildren=!0,a=n,s=!1;continue;case"datatype":if(o)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${n}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${n})`);t.datatype=this.valueToUri(n,t);continue;case"nodeID":if(o)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${n}).`);if(t.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${n}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${n})`);this.validateNcname(n),t.hadChildren=!0,a=n,s=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(o)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${t.datatype.value})`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${a})`);if("Resource"===n){i=!0,t.childrenParseType=c.PROPERTY;const e=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,e,t.reifiedStatementId),t.subject=e,t.predicate=null}else"Collection"===n?(i=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,s=!1):"Literal"===n&&(i=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(n),t.reifiedStatementId=this.valueToUri("#"+n,t),this.claimNodeId(t.reifiedStatementId);continue}else if(r.uri===u.XML&&"lang"===r.local){t.language=""===n?null:n.toLowerCase();continue}if("xml"!==r.prefix&&"xmlns"!==r.prefix&&r.uri){if(i||t.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${n}`);t.hadChildren=!0,o=!0,l.push(this.uriToNamedNode(r.uri+r.local)),d.push(this.dataFactory.literal(n,t.datatype||t.language))}}if(null!==a){const e=t.subject;t.subject=s?this.dataFactory.blankNode(a):this.valueToUri(a,t),this.emitTriple(e,t.predicate,t.subject,t.reifiedStatementId);for(let n=0;n/g,(e,t,n)=>(this.saxStream._parser.ENTITIES[t]=n,""))}}var c,l;n.RdfXmlParser=u,u.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,u.MIME_TYPE="application/rdf+xml",u.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",u.XML="http://www.w3.org/XML/1998/namespace",u.XMLNS="http://www.w3.org/2000/xmlns/",u.DEFAULT_NS={xml:u.XML},u.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],u.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],u.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,(l=c=n.ParseType||(n.ParseType={}))[l.RESOURCE=0]="RESOURCE",l[l.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(e,t,n){"use strict";var r={};function i(e,t,n){n||(n=Error);var i=function(e){function n(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(n,e),n}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function o(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,n){var r,i;if("string"==typeof t&&function(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))i="The ".concat(e," ").concat(r," ").concat(o(t,"type"));else{var a=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(a," ").concat(r," ").concat(o(t,"type"))}return i+". Received type ".concat(typeof n)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},{}],68:[function(e,t,n){(function(n){(function(){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var i=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(c,i);for(var a=r(o.prototype),s=0;s0)if("string"!=typeof t&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype&&(t=function(e){return s.from(e)}(t)),r)a.endEmitted?x(e,new w):T(e,a,t,!0);else if(a.ended)x(e,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?T(e,a,t,!1):O(e,a)):T(e,a,t,!1)}else r||(a.reading=!1,O(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(R,e))}function R(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function O(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){c("readable nexttick read 0"),e.read(0)}function P(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(G,t,e))}function G(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function U(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):k(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&B(this),null;var r,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),null!==r&&this.emit("data",r),r},N.prototype._read=function(e){x(this,new _("_read()"))},N.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=t&&!1===t.end||e===n.stdout||e===n.stderr?y:u;function s(t,n){c("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",f),d=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&l())}function u(){c("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,C(e))}}(r);e.on("drain",l);var d=!1;function f(t){c("ondata");var n=e.write(t);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!d&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){c("onerror",t),y(),e.removeListener("error",h),0===o(e,"error")&&x(e,t)}function p(){e.removeListener("finish",g),y()}function g(){c("onfinish"),e.removeListener("close",p),y()}function y(){c("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",g),e.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),e},N.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?k(this):i.reading||n.nextTick(D,this)),r},N.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(M,this),r},N.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(M,this),t},N.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(P,e,t))}(this,e)),e.paused=!1,this},N.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},N.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(c("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){c("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||!(n.objectMode||i&&i.length)||t.push(i)||(r=!0,e.pause())}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(N.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),N.prototype._write=function(e,t,n){n(new g("_write()"))},N.prototype._writev=null,N.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,O(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(N.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(N.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}}),N.prototype.destroy=d.destroy,N.prototype._undestroy=d.undestroy,N.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(e,t,n){(function(n){(function(){"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=e("./end-of-stream"),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[f].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(h(n,!1)))}}function g(e){n.nextTick(p,e)}var y=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((i(r={get stream(){return this[f]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(t,r){n.nextTick(function(){e[u]?r(e[u]):t(h(void 0,!0))})});var r,i=this[l];if(i)r=new Promise(function(e,t){return function(n,r){e.then(function(){t[c]?n(h(void 0,!0)):t[d](n,r)},r)}}(i,this));else{var o=this[f].read();if(null!==o)return Promise.resolve(h(o,!1));r=new Promise(this[d])}return this[l]=r,r}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[f].destroy(null,function(e){e?n(e):t(h(void 0,!0))})})}),r),y);t.exports=function(e){var t,n=Object.create(m,(i(t={},f,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var r=n[f].read();r?(n[l]=null,n[a]=null,n[s]=null,e(h(r,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[l]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[l]=null,n[a]=null,n[s]=null,t(e)),void(n[u]=e)}var r=n[a];null!==r&&(n[l]=null,n[a]=null,n[s]=null,r(h(void 0,!0))),n[c]=!0}),e.on("readable",g.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":76,_process:44}],74:[function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),n=this.head,r=0;n;)c(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(r+=o===i.length?i:i.slice(0,e),0==(e-=o)){o===i.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t0,function(e){i||(i=e),e&&a.forEach(c),!o&&(a.forEach(c),r(i))})});return t.reduce(l)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(e,t,n){"use strict";var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":67}],80:[function(e,t,n){t.exports=e("events").EventEmitter},{events:8}],81:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(e,t,n){"use strict";function r(e){const t=[];let n=0;for(;ne.join("")).join("/")}function i(e,t){let n=t+1;t>=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);const i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function o(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(e,t){const n=(t=t||"").indexOf("#");if(n>0&&(t=t.substr(0,n)),!e.length){if(t.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith("?")){const n=t.indexOf("?");return n>0&&(t=t.substr(0,n)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){const t=e.indexOf(":");if(t<0)throw new Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return i(e,t)}const o=e.indexOf(":");if(o>=0)return i(e,o);const a=t.indexOf(":");if(a<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);const s=t.substr(0,a+1);if(0===e.indexOf("//"))return s+i(e,o);let u;if(t.indexOf("//",a)===a+1){if(u=t.indexOf("/",a+3),u<0)return t.length>a+3?t+"/"+i(e,o):s+i(e,o)}else if(u=t.indexOf("/",a+1),u<0)return s+i(e,o);if(0===e.indexOf("/"))return t.substr(0,u)+r(e);let c=t.substr(u);const l=c.lastIndexOf("/");return l>=0&&l"===o?(E(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=S.TEXT):(y(o)&&(t.state=S.SGML_DECL_QUOTED),t.sgmlDecl+=o);continue;case S.SGML_DECL_QUOTED:o===t.q&&(t.state=S.SGML_DECL,t.q=""),t.sgmlDecl+=o;continue;case S.DOCTYPE:">"===o?(t.state=S.TEXT,E(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=o,"["===o?t.state=S.DOCTYPE_DTD:y(o)&&(t.state=S.DOCTYPE_QUOTED,t.q=o));continue;case S.DOCTYPE_QUOTED:t.doctype+=o,o===t.q&&(t.q="",t.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:t.doctype+=o,"]"===o?t.state=S.DOCTYPE:y(o)&&(t.state=S.DOCTYPE_DTD_QUOTED,t.q=o);continue;case S.DOCTYPE_DTD_QUOTED:t.doctype+=o,o===t.q&&(t.state=S.DOCTYPE_DTD,t.q="");continue;case S.COMMENT:"-"===o?t.state=S.COMMENT_ENDING:t.comment+=o;continue;case S.COMMENT_ENDING:"-"===o?(t.state=S.COMMENT_ENDED,t.comment=I(t.opt,t.comment),t.comment&&E(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+o,t.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==o?(R(t,"Malformed comment"),t.comment+="--"+o,t.state=S.COMMENT):t.state=S.TEXT;continue;case S.CDATA:"]"===o?t.state=S.CDATA_ENDING:t.cdata+=o;continue;case S.CDATA_ENDING:"]"===o?t.state=S.CDATA_ENDING_2:(t.cdata+="]"+o,t.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===o?(t.cdata&&E(t,"oncdata",t.cdata),E(t,"onclosecdata"),t.cdata="",t.state=S.TEXT):"]"===o?t.cdata+="]":(t.cdata+="]]"+o,t.state=S.CDATA);continue;case S.PROC_INST:"?"===o?t.state=S.PROC_INST_ENDING:g(o)?t.state=S.PROC_INST_BODY:t.procInstName+=o;continue;case S.PROC_INST_BODY:if(!t.procInstBody&&g(o))continue;"?"===o?t.state=S.PROC_INST_ENDING:t.procInstBody+=o;continue;case S.PROC_INST_ENDING:">"===o?(E(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=S.TEXT):(t.procInstBody+="?"+o,t.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:b(f,o)?t.tagName+=o:(O(t),">"===o?D(t):"/"===o?t.state=S.OPEN_TAG_SLASH:(g(o)||R(t,"Invalid character in tag name"),t.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===o?(D(t,!0),P(t)):(R(t,"Forward-slash in opening tag not followed by >"),t.state=S.ATTRIB);continue;case S.ATTRIB:if(g(o))continue;">"===o?D(t):"/"===o?t.state=S.OPEN_TAG_SLASH:b(d,o)?(t.attribName=o,t.attribValue="",t.state=S.ATTRIB_NAME):R(t,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===o?t.state=S.ATTRIB_VALUE:">"===o?(R(t,"Attribute without value"),t.attribValue=t.attribName,M(t),D(t)):g(o)?t.state=S.ATTRIB_NAME_SAW_WHITE:b(f,o)?t.attribName+=o:R(t,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===o)t.state=S.ATTRIB_VALUE;else{if(g(o))continue;R(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",E(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===o?D(t):b(d,o)?(t.attribName=o,t.state=S.ATTRIB_NAME):(R(t,"Invalid attribute name"),t.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(g(o))continue;y(o)?(t.q=o,t.state=S.ATTRIB_VALUE_QUOTED):(R(t,"Unquoted attribute value"),t.state=S.ATTRIB_VALUE_UNQUOTED,t.attribValue=o);continue;case S.ATTRIB_VALUE_QUOTED:if(o!==t.q){"&"===o?t.state=S.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=o;continue}M(t),t.q="",t.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:g(o)?t.state=S.ATTRIB:">"===o?D(t):"/"===o?t.state=S.OPEN_TAG_SLASH:b(d,o)?(R(t,"No whitespace between attributes"),t.attribName=o,t.attribValue="",t.state=S.ATTRIB_NAME):R(t,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!m(o)){"&"===o?t.state=S.ATTRIB_VALUE_ENTITY_U:t.attribValue+=o;continue}M(t),">"===o?D(t):t.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(t.tagName)">"===o?P(t):b(f,o)?t.tagName+=o:t.script?(t.script+=""===o?P(t):R(t,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var s,u;switch(t.state){case S.TEXT_ENTITY:s=S.TEXT,u="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:s=S.ATTRIB_VALUE_QUOTED,u="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:s=S.ATTRIB_VALUE_UNQUOTED,u="attribValue"}";"===o?(t[u]+=C(t),t.entity="",t.state=s):b(t.entity.length?p:h,o)?t.entity+=o:(R(t,"Invalid character in entity name"),t[u]+="&"+t.entity+o,t.entity="",t.state=s);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&function(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),r=0,o=0,a=i.length;ot)switch(i[o]){case"textNode":T(e);break;case"cdata":E(e,"oncdata",e.cdata),e.cdata="";break;case"script":E(e,"onscript",e.script),e.script="";break;default:A(e,"Max buffer length exceeded: "+i[o])}r=Math.max(r,s)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-r+e.position}(t),t},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(e){T(e),""!==e.cdata&&(E(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(E(e,"onscript",e.script),e.script="")}(this)}};try{r=e("stream").Stream}catch(_){r=function(){}}var a=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function s(e,t){if(!(this instanceof s))return new s(e,t);r.apply(this),this._parser=new o(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,a.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})})}(s.prototype=Object.create(r.prototype,{constructor:{value:s}})).write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var r=e("string_decoder").StringDecoder;this._decoder=new r("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var n=this;return!n._parser["on"+e]&&-1!==a.indexOf(e)&&(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var u="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",l={xml:u,xmlns:c},d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,h=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function y(e){return'"'===e||"'"===e}function m(e){return">"===e||g(e)}function b(e,t){return e.test(t)}function v(e,t){return!b(e,t)}var _,w,x,S=0;for(var j in n.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],r="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=r}),n.STATE)n.STATE[n.STATE[j]]=j;function N(e,t,n){e[t]&&e[t](n)}function E(e,t,n){e.textNode&&T(e),N(e,t,n)}function T(e){e.textNode=I(e.opt,e.textNode),e.textNode&&N(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function A(e,t){return T(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,N(e,"onerror",t),e}function k(e){return e.sawRoot&&!e.closedRoot&&R(e,"Unclosed root tag"),e.state!==S.BEGIN&&e.state!==S.BEGIN_WHITESPACE&&e.state!==S.TEXT&&A(e,"Unexpected end"),T(e),e.c="",e.closed=!0,N(e,"onend"),o.call(e,e.strict,e.opt),e}function R(e,t){if("object"!=typeof e||!(e instanceof o))throw new Error("bad call to strictFail");e.strict&&A(e,t)}function O(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,E(e,"onopentagstart",n)}function L(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function M(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=L(e.attribName,!0),n=t.local;if("xmlns"===t.prefix)if("xml"===n&&e.attribValue!==u)R(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==c)R(e,"xmlns: prefix must be bound to "+c+"\nActual: "+e.attribValue);else{var r=e.tag,i=e.tags[e.tags.length-1]||e;r.ns===i.ns&&(r.ns=Object.create(i.ns)),r.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,E(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function D(e,t){if(e.opt.xmlns){var n=e.tag,r=L(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(R(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix),n.ns&&(e.tags[e.tags.length-1]||e).ns!==n.ns&&Object.keys(n.ns).forEach(function(t){E(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var i=0,o=e.attribList.length;i",e.tagName="",void(e.state=S.SCRIPT);E(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)R(e,"Unexpected close tag");if(t<0)return R(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=S.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,E(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];e.opt.xmlns&&o.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(o.ns).forEach(function(t){E(e,"onclosenamespace",{prefix:t,uri:o.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=S.TEXT}function C(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==n?(R(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function F(e,t){"<"===t?(e.state=S.OPEN_WAKA,e.startTagPosition=e.position):g(t)||(R(e,"Non-whitespace before first tag."),e.textNode=t,e.state=S.TEXT)}function B(e,t){var n="";return t1114111||w(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?t.push(o):t.push(55296+((o-=65536)>>10),o%1024+56320),(n+1===r||t.length>e)&&(i+=_.apply(null,t),t.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:x,configurable:!0,writable:!0}):String.fromCodePoint=x)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,e("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(e,t,n){(function(e,t){(function(){!function(t,n){"use strict";if(!t.setImmediate){var r,i=1,o={},a=!1,s=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){f(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(c="setImmediate$"+Math.random()+"$",l=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(c)&&f(+e.data.slice(c.length))},t.addEventListener?t.addEventListener("message",l,!1):t.attachEvent("onmessage",l),r=function(e){t.postMessage(c+e,"*")}):t.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){f(e.data)},r=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;r=function(t){var n=s.createElement("script");n.onreadystatechange=function(){f(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():r=function(e){setTimeout(f,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=u++,r=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,i(function(){s[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof r?r:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(e,t,n){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(r){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(e,t,n){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},{}],92:[function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;null!==o&&r0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,console&&console.warn&&console.warn(s)}return e}function E(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function T(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=E.bind(r);return i.listener=n,r.wrapFn=i,i}function I(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)v(s,this,t);else{var u=s.length,c=k(s,u);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},w.prototype.listeners=function(e){return I(this,e,!0)},w.prototype.rawListeners=function(e){return I(this,e,!1)},w.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):A.call(e,t)},w.prototype.listenerCount=A,w.prototype.eventNames=function(){return this._eventsCount>0?y(this._events):[]},O.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(O.prototype[Symbol.iterator]=function(){return this}),O.of=function(){var e=arguments,t=e.length,n=0;return new O(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},O.empty=function(){var e=new O(null);return e.done=!0,e},O.is=function(e){return e instanceof O||"object"==typeof e&&null!==e&&"function"==typeof e.next};var L=O,M=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],o=0;;){if(o===r)return i;if((n=e.next()).done)return o!==t?i.slice(0,o):i;i[o++]=n.value}},D=function(e){function n(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return t(n,e),n}(a(Error)),P=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(D),C=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(D),F=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(D);function B(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function G(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function U(e,t){this.key=e,this.attributes=t,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function V(e,t,n,r,i,o){this.key=t,this.attributes=o,this.undirected=e,this.source=r,this.target=i,this.generatedKey=n}function $(e,t,n,r,i,o,a){var s,u,c="out",l="in";if(t&&(c=l="undirected"),e.multi){if(void 0===(u=(s=o[c])[i])&&(u=new Set,s[i]=u),u.add(n),r===i&&t)return;void 0===(s=a[l])[r]&&(s[r]=u)}else{if(o[c][i]=n,r===i&&t)return;a[l][r]=n}}function z(e,t,n){var r=e.multi,i=n.source,o=n.target,a=i.key,s=o.key,u=i[t?"undirected":"out"],c=t?"undirected":"in";if(s in u)if(r){var l=u[s];1===l.size?(delete u[s],delete o[c][a]):l.delete(n)}else delete u[s];r||delete o[c][a]}G.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},U.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var q=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes[r]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+e,o=""+arguments[1];if(!(r=c(this,i,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(i,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes.hasOwnProperty(r)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+r;if(r=arguments[2],i=arguments[3],!(o=c(this,a,s,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&o.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[r]=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+r;if(r=arguments[2],i=arguments[3],!(o=c(this,a,s,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof i)throw new P("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&o.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[r]=i(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete i.attributes[r],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:r}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!d(r))throw new P("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes=r,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+r;if(r=arguments[2],!(i=c(this,o,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!d(r))throw new P("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return u(i.attributes,r),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:r}),this}}}],K=L,H=function(){var e,t=arguments,n=-1;return new K(function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i})},W=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function J(e,t){for(var n in t)e.push(t[n].key)}function Q(e,t){for(var n in t)t[n].forEach(function(t){return e.push(t.key)})}function X(e,t,n){for(var r in e)if(r!==n){var i=e[r];t(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected,i.generatedKey)}}function Y(e,t,n){for(var r in e)r!==n&&e[r].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function Z(e,t,n){for(var r in e)if(r!==n){var i=e[r];if(t(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected,i.generatedKey))return!0}return!1}function ee(e,t,n){var r,i,o,a,s;for(var u in e)if(u!==n)for(r=e[u].values();!0!==(i=r.next()).done;)if(a=(o=i.value).source,t(o.key,o.attributes,a.key,(s=o.target).key,a.attributes,s.attributes,o.undirected,o.generatedKey))return!0;return!1}function te(e,t){var n=Object.keys(e),r=n.length,i=null,o=0;return new L(function a(){var s;if(i){var u=i.next();if(u.done)return i=null,o++,a();s=u.value}else{if(o>=r)return{done:!0};var c=n[o];if(c===t)return o++,a();if((s=e[c])instanceof Set)return i=s.values(),a();o++}return{done:!1,value:[s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes]}})}function ne(e,t,n){var r=t[n];r&&e.push(r.key)}function re(e,t,n){var r=t[n];r&&r.forEach(function(t){return e.push(t.key)})}function ie(e,t,n){var r=e[t];if(r){var i=r.source,o=r.target;n(r.key,r.attributes,i.key,o.key,i.attributes,o.attributes,r.undirected,r.generatedKey)}}function oe(e,t,n){var r=e[t];r&&r.forEach(function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function ae(e,t,n){var r=e[t];if(r){var i=r.source,o=r.target;return n(r.key,r.attributes,i.key,o.key,i.attributes,o.attributes,r.undirected,r.generatedKey)}}function se(e,t,n){var r=e[t];if(r){for(var i,o,a=r.values();!0!==(i=a.next()).done;)if(n((o=i.value).key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected,o.generatedKey))return!0;return!1}}function ue(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new L(function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return L.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ce(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return"function"==typeof Array.from?Array.from(e._edges.keys()):M(e._edges.keys(),e._edges.size);for(var n,r,i=new Array("undirected"===t?e.undirectedSize:e.directedSize),o="undirected"===t,a=e._edges.values(),s=0;!0!==(n=a.next()).done;)(r=n.value).undirected===o&&(i[s++]=r.key);return i}function le(e,t,n){if(0!==e.size)for(var r,i,o="mixed"!==t&&t!==e.type,a="undirected"===t,s=e._edges.values();!0!==(r=s.next()).done;)if(i=r.value,!o||i.undirected===a){var u=i.source,c=i.target;n(i.key,i.attributes,u.key,c.key,u.attributes,c.attributes,i.undirected,i.generatedKey)}}function de(e,t,n){if(0!==e.size)for(var r,i,o="mixed"!==t&&t!==e.type,a="undirected"===t,s=e._edges.values();!0!==(r=s.next()).done;)if(i=r.value,!o||i.undirected===a){var u=i.source,c=i.target;if(n(i.key,i.attributes,u.key,c.key,u.attributes,c.attributes,i.undirected,i.generatedKey))break}}function fe(e,t){if(0===e.size)return L.empty();var n="mixed"!==t&&t!==e.type,r="undirected"===t,i=e._edges.values();return new L(function(){for(var e,t;;){if((e=i.next()).done)return e;if(t=e.value,!n||t.undirected===r)break}return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})}function he(e,t,n,r){var i=[],o=e?Q:J;return"undirected"!==t&&("out"!==n&&o(i,r.in),"in"!==n&&o(i,r.out),!n&&r.directedSelfLoops>0&&i.splice(i.lastIndexOf(r.key),1)),"directed"!==t&&o(i,r.undirected),i}function pe(e,t,n,r,i){var o=e?Y:X;"undirected"!==t&&("out"!==n&&o(r.in,i),"in"!==n&&o(r.out,i,n?null:r.key)),"directed"!==t&&o(r.undirected,i)}function ge(e,t,n,r,i){var o=e?ee:Z;"undirected"!==t&&("out"!==n&&o(r.in,i)||"in"!==n&&o(r.out,i,n?null:r.key))||"directed"===t||o(r.undirected,i)}function ye(e,t,n){var r=L.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=H(r,te(n.in))),"in"!==t&&void 0!==n.out&&(r=H(r,te(n.out,t?null:n.key)))),"directed"!==e&&void 0!==n.undirected&&(r=H(r,te(n.undirected))),r}function me(e,t,n,r,i){var o=t?re:ne,a=[];return"undirected"!==e&&(void 0!==r.in&&"out"!==n&&o(a,r.in,i),void 0!==r.out&&"in"!==n&&o(a,r.out,i),!n&&r.directedSelfLoops>0&&a.splice(a.lastIndexOf(r.key),1)),"directed"!==e&&void 0!==r.undirected&&o(a,r.undirected,i),a}function be(e,t,n,r,i,o){var a=t?oe:ie;"undirected"!==e&&(void 0!==r.in&&"out"!==n&&a(r.in,i,o),r.key!==i&&void 0!==r.out&&"in"!==n&&a(r.out,i,o)),"directed"!==e&&void 0!==r.undirected&&a(r.undirected,i,o)}function ve(e,t,n,r,i,o){var a=t?se:ae;"undirected"!==e&&(void 0!==r.in&&"out"!==n&&a(r.in,i,o)||r.key!==i&&void 0!==r.out&&"in"!==n&&a(r.out,i,o,n?null:r.key))||"directed"===e||void 0===r.undirected||a(r.undirected,i,o)}function _e(e,t,n,r){var i=L.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=H(i,ue(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=H(i,ue(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=H(i,ue(n.undirected,r))),i}var we=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xe(e,t){if(void 0!==t)for(var n in t)e.add(n)}function Se(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&xe(r,n.in),"in"!==t&&xe(r,n.out)),"directed"!==e&&xe(r,n.undirected),M(r.values(),r.size)}function je(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=o===e?i.target:o;n(a.key,a.attributes)}}function Ne(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;e.has(s.key)||(e.add(s.key),r(s.key,s.attributes))}}function Ee(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=o===e?i.target:o;if(n(a.key,a.attributes))return!0}return!1}function Te(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;if(!e.has(s.key)&&(e.add(s.key),r(s.key,s.attributes)))return!0}return!1}function Ie(e,t){var n=Object.keys(t),r=n.length,i=0;return new L(function(){if(i>=r)return{done:!0};var o=t[n[i++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===e?o.target:a;return{done:!1,value:[s.key,s.attributes]}})}function Ae(e,t,n){var r=Object.keys(n),i=r.length,o=0;return new L(function a(){if(o>=i)return{done:!0};var s=n[r[o++]];s instanceof Set&&(s=s.values().next().value);var u=s.source,c=u===t?s.target:u;return e.has(c.key)?a():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function ke(e,t,n,r,i){var o=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===i)return!0;if("in"!==n&&void 0!==o.out)for(var s in o.out)if(s===i)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===i)return!0;return!1}function Re(e,t,n){for(var r,i,o,a,s,u,c,l=t._nodes.values(),d=t.type;!0!==(r=l.next()).done;){if(i=r.value,"undirected"!==d)for(o in a=i.out)if(u=(s=a[o]).target,c=n(i.key,u.key,i.attributes,u.attributes,s.key,s.attributes,s.undirected,s.generatedKey),e&&c)return;if("directed"!==d)for(o in a=i.undirected)if((u=(s=a[o]).target).key!==o&&(u=s.source),c=n(i.key,u.key,i.attributes,u.attributes,s.key,s.attributes,s.undirected,s.generatedKey),e&&c)return}}function Oe(e,t,n){for(var r,i,o,a,s,u,c,l,d,f=t._nodes.values(),h=t.type;!0!==(r=f.next()).done;){if(i=r.value,"undirected"!==h)for(o in u=i.out)for(a=u[o].values();!0!==(s=a.next()).done;)if(l=(c=s.value).target,d=n(i.key,l.key,i.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&d)return;if("directed"!==h)for(o in u=i.undirected)for(a=u[o].values();!0!==(s=a.next()).done;)if((l=(c=s.value).target).key!==o&&(l=c.source),d=n(i.key,l.key,i.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&d)return}}function Le(e,t){var n={key:e};return f(t.attributes)||(n.attributes=u({},t.attributes)),n}function Me(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),f(t.attributes)||(n.attributes=u({},t.attributes)),t.undirected&&(n.undirected=!0),n}function De(e){return d(e)?"key"in e?!("attributes"in e)||d(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function Pe(e){return d(e)?"source"in e?"target"in e?!("attributes"in e)||d(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Ce=new Set(["directed","undirected","mixed"]),Fe=new Set(["domain","_events","_eventsCount","_maxListeners"]),Be={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Ge(e,t,n){var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function Ue(e,t,n,r,i,o,a,s){if(!r&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!d(s))throw new P("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!e.allowSelfLoops&&o===a)throw new F("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=e._nodes.get(o),c=e._nodes.get(a);if(!u)throw new C("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!c)throw new C("Graph.".concat(t,': target node "').concat(a,'" not found.'));var l={key:null,undirected:r,source:o,target:a,attributes:s};if(n&&(i=e._edgeKeyGenerator(l)),e._edges.has(i=""+i))throw new F("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==u.undirected[a]:void 0!==u.out[a]))throw new F("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var f=new V(r,i,n,u,c,s);return e._edges.set(i,f),o===a?r?(u.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(u.directedSelfLoops++,e._directedSelfLoopCount++):r?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),$(e,r,f,o,a,u,c),r?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function Ve(e,t,n,r,i,o,a,s,c){if(!r&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s)if(c){if("function"!=typeof s)throw new P("Graph.".concat(t,': invalid updater function. Expecting a function but got "').concat(s,'"'))}else if(!d(s))throw new P("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));var l;if(o=""+o,a=""+a,c&&(l=s,s=void 0),!e.allowSelfLoops&&o===a)throw new F("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var f,h,p=e._nodes.get(o),g=e._nodes.get(a);if(!n&&(f=e._edges.get(i))){if(f.source.key!==o||f.target.key!==a||r&&(f.source.key!==a||f.target.key!==o))throw new F("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(f.source.key,'", "').concat(f.target.key,'").'));h=f}if(h||e.multi||!p||(h=r?p.undirected[a]:p.out[a]),h)return(c?l:s)?(c?(h.attributes=l(h.attributes),e.emit("edgeAttributesUpdated",{type:"replace",key:h.key,attributes:h.attributes})):(u(h.attributes,s),e.emit("edgeAttributesUpdated",{type:"merge",key:h.key,attributes:h.attributes,data:s})),h.key):h.key;s=s||{},c&&l&&(s=l(s));var y={key:null,undirected:r,source:o,target:a,attributes:s};if(n&&(i=e._edgeKeyGenerator(y)),e._edges.has(i=""+i))throw new F("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return p||(p=Ge(e,o,{}),o===a&&(g=p)),g||(g=Ge(e,a,{})),f=new V(r,i,n,p,g,s),e._edges.set(i,f),o===a?r?(p.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(p.directedSelfLoops++,e._directedSelfLoopCount++):r?(p.undirectedDegree++,g.undirectedDegree++):(p.outDegree++,g.inDegree++),$(e,r,f,o,a,p,g),r?e._undirectedSize++:e._directedSize++,y.key=i,e.emit("edgeAdded",y),i}var $e,ze=function(e){function n(t){var n;if(n=e.call(this)||this,(t=u({},Be,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new P("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new P("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!Ce.has(t.type))throw new P('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new P("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r,i="mixed"===t.type?B:"directed"===t.type?G:U;return h(s(n),"NodeDataClass",i),h(s(n),"_attributes",{}),h(s(n),"_nodes",new Map),h(s(n),"_edges",new Map),h(s(n),"_directedSize",0),h(s(n),"_undirectedSize",0),h(s(n),"_directedSelfLoopCount",0),h(s(n),"_undirectedSelfLoopCount",0),h(s(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(r=0,function(){return r++})),h(s(n),"_options",t),Fe.forEach(function(e){return h(s(n),e,n[e])}),p(s(n),"order",function(){return n._nodes.size}),p(s(n),"size",function(){return n._edges.size}),p(s(n),"directedSize",function(){return n._directedSize}),p(s(n),"undirectedSize",function(){return n._undirectedSize}),p(s(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),p(s(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),p(s(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),p(s(n),"multi",n._options.multi),p(s(n),"type",n._options.type),p(s(n),"allowSelfLoops",n._options.allowSelfLoops),p(s(n),"implementation",function(){return"graphology"}),n}t(n,e);var r=n.prototype;return r.hasNode=function(e){return this._nodes.has(""+e)},r.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&!n.undirected}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.out[t];return!(!i||this.multi&&!i.size)}throw new P("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n.undirected}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.undirected[t];return!(!i||this.multi&&!i.size)}throw new P("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var r=void 0!==n.out&&n.out[t];return r||(r=void 0!==n.undirected&&n.undirected[t]),!(!r||this.multi&&!r.size)}throw new P("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new C('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},r.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new C('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},r.edge=function(e,t){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},r.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(t?n.directedSelfLoops:0)},r.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(t?n.directedSelfLoops:0)},r.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.inDegree+r+(n.outDegree+r)},r.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(t?n.undirectedSelfLoops:0)},r.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var r=0,i=0;return"directed"!==this.type&&(t&&(i=n.undirectedSelfLoops),r+=n.undirectedDegree+2*i),"undirected"!==this.type&&(t&&(i=n.directedSelfLoops),r+=n.inDegree+n.outDegree+2*i),r},r.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},r.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},r.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},r.opposite=function(e,t){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new C('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(e!==r&&e!==i)throw new C('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(i,")."));return e===r?i:r},r.hasExtremity=function(e,t){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new C('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return n.source.key===t||n.target.key===t},r.isUndirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},r.isDirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},r.isSelfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},r.hasGeneratedKey=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.hasGeneratedKey: could not find the "'.concat(e,'" edge in the graph.'));return t.generatedKey},r.addNode=function(e,t){return function(e,t,n){if(n&&!d(n))throw new P('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},e._nodes.has(t=""+t))throw new F('Graph.addNode: the "'.concat(t,'" node already exist in the graph.'));var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}(this,e,t).key},r.mergeNode=function(e,t){if(t&&!d(t))throw new P('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var n=this._nodes.get(e=""+e);return n?(t&&(u(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},r.updateNode=function(e,t){if(t&&"function"!=typeof t)throw new P('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));var n=this._nodes.get(e=""+e);if(n)return t&&(n.attributes=t(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})),e;var r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:r}),e},r.dropNode=function(e){var t=this,n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));this.forEachEdge(e,function(e){t.dropEdge(e)}),this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},r.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=c(this,n,r,this.type)))throw new C('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new C('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t.source,o=t.target,a=t.attributes,s=t.undirected;return i===o?s?(i.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(i.directedSelfLoops--,this._directedSelfLoopCount--):s?(i.undirectedDegree--,o.undirectedDegree--):(i.outDegree--,o.inDegree--),z(this,s,t),s?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:a,source:i.key,target:o.key,undirected:s}),this},r.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},r.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},r.getAttribute=function(e){return this._attributes[e]},r.getAttributes=function(){return this._attributes},r.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},r.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.updateAttribute=function(e,t){if("function"!=typeof t)throw new P("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},r.replaceAttributes=function(e){if(!d(e))throw new P("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},r.mergeAttributes=function(e){if(!d(e))throw new P("Graph.mergeAttributes: provided attributes are not a plain object.");return u(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},r.getNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},r.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new C('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},r.hasNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},r.setNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new C('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new P("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:r.attributes,name:t}),this},r.updateNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new C('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new P("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new P("Graph.updateAttribute: updater should be a function.");var i=r.attributes,o=n(i[t]);return i[t]=o,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:r.attributes,name:t}),this},r.removeNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",attributes:n.attributes,name:t}),this},r.replaceNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!d(t))throw new P("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",attributes:n.attributes}),this},r.mergeNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!d(t))throw new P("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return u(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",attributes:n.attributes,data:t}),this},r.updateEachNodeAttributes=function(e,t){if("function"!=typeof e)throw new P("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!g(t))throw new P("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._nodes.values();!0!==(n=i.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},r.updateEachEdgeAttributes=function(e,t){if("function"!=typeof e)throw new P("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!g(t))throw new P("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._edges.values();!0!==(n=i.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},r.forEach=function(e){if("function"!=typeof e)throw new P("Graph.forEach: expecting a callback.");this.multi?Oe(!1,this,e):Re(!1,this,e)},r.forEachUntil=function(e){if("function"!=typeof e)throw new P("Graph.forEach: expecting a callback.");this.multi?Oe(!0,this,e):Re(!0,this,e)},r.adjacency=function(){return this.multi?(h=(u=this)._nodes.values(),p=u.type,g="outer",y=null,new L(function e(){var t;if("outer"===g)return!0===(t=h.next()).done?t:(c=t.value,g="directed",e());if("directed"===g)return"undirected"===p?(g="undirected",e()):(d=c.out,l=Object.keys(c.out),f=0,g="inner-directed",e());if("undirected"===g){if("directed"===p)return g="outer",e();d=c.undirected,l=Object.keys(c.undirected),f=0,g="inner-undirected"}if(!y&&f>=l.length)return g="inner-undirected"===g?"outer":"undirected",e();if(!y){var n=l[f++];return y=d[n].values(),e()}if((t=y.next()).done)return y=null,e();var r=t.value,i=r.target;return"inner-undirected"===g&&i.key===c.key&&(i=r.source),{done:!1,value:[c.key,i.key,c.attributes,i.attributes,r.key,r.attributes]}})):(o=(e=this)._nodes.values(),a=e.type,s="outer",new L(function e(){var u;if("outer"===s)return!0===(u=o.next()).done?u:(t=u.value,s="directed",e());if("directed"===s)return"undirected"===a?(s="undirected",e()):(r=t.out,n=Object.keys(t.out),i=0,s="inner-directed",e());if("undirected"===s){if("directed"===a)return s="outer",e();r=t.undirected,n=Object.keys(t.undirected),i=0,s="inner-undirected"}if(i>=n.length)return s="inner-undirected"===s?"outer":"undirected",e();var c=n[i++],l=r[c],d=l.target;return"inner-undirected"===s&&d.key===t.key&&(d=l.source),{done:!1,value:[t.key,d.key,t.attributes,d.attributes,l.key,l.attributes]}}));var e,t,n,r,i,o,a,s,u,c,l,d,f,h,p,g,y},r.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):M(this._nodes.keys(),this._nodes.size)},r.forEachNode=function(e){if("function"!=typeof e)throw new P("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,n){e(n,t.attributes)})},r.forEachNodeUntil=function(e){if("function"!=typeof e)throw new P("Graph.forEachNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next())&&!e((n=t.value).key,n.attributes););},r.nodeEntries=function(){var e=this._nodes.values();return new L(function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}})},r.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new C('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return Le(e,t)},r.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return Me(e,t)},r.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(n,r){e[t++]=Le(r,n)});var n=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,r){n[t++]=Me(r,e)}),{attributes:this.getAttributes(),nodes:e,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},r.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=De(e);if(n){if("not-object"===n)throw new P('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new P("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new P("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,o=void 0===i?{}:i;return t?this.mergeNode(r,o):this.addNode(r,o),this},r.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Pe(e);if(n){if("not-object"===n)throw new P('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new P("Graph.importEdge: missing souce.");if("no-target"===n)throw new P("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new P("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new P("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,o=e.attributes,a=void 0===o?{}:o,s=e.undirected,u=void 0!==s&&s;return"key"in e?(t?u?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:u?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,a):(t?u?this.mergeUndirectedEdge:this.mergeDirectedEdge:u?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,a),this},r.import=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),i),this;if(!d(e))throw new P("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!d(e.attributes))throw new P("Graph.import: invalid attributes. Expecting a plain object.");i?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}if(e.nodes){if(r=e.nodes,!Array.isArray(r))throw new P("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=r.length;tn)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this;var e},r.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},r.toJSON=function(){return this.export()},r.toString=function(){return"[object Graph]"},r.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,n){t[n]=e.attributes});var n={},r={};this._edges.forEach(function(t,i){var o=t.undirected?"--":"->",a="",s="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[s]?r[s]=0:r[s]++,a+="".concat(r[s],". ")):a+="[".concat(i,"]: "),n[a+=s]=t.attributes});var i={};for(var o in this)this.hasOwnProperty(o)&&!Fe.has(o)&&"function"!=typeof this[o]&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,h(i,"constructor",this.constructor),i},n}(m.exports.EventEmitter);"undefined"!=typeof Symbol&&(ze.prototype[Symbol.for("nodejs.util.inspect.custom")]=ze.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge","update"].forEach(function(t){var n=e.name(t),r="add"===t?Ue:Ve;ze.prototype[n]=e.generateKey?function(i,o,a){return r(this,n,!0,"undirected"===(e.type||this.type),null,i,o,a,"update"===t)}:function(i,o,a,s){return r(this,n,!1,"undirected"===(e.type||this.type),i,o,a,s,"update"===t)}})}),"undefined"!=typeof Symbol&&(ze.prototype[Symbol.iterator]=ze.prototype.adjacency),$e=ze,q.forEach(function(e){var t=e.name,n=e.attacher;n($e,t("Edge"),"mixed"),n($e,t("DirectedEdge"),"directed"),n($e,t("UndirectedEdge"),"undirected")}),function(e){W.forEach(function(t){var n,r,i,o;i=(n=t).type,o=n.direction,e.prototype[r=n.name]=function(e,t){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];if(!arguments.length)return ce(this,i);if(1===arguments.length){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return he(this.multi,"mixed"===i?this.type:i,o,n)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(r,': could not find the "').concat(t,'" target node in the graph.'));return me(i,this.multi,o,a,t)}throw new P("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return le(this,r,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return pe(this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return be(r,this.multi,i,s,t,n)}throw new P("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return de(this,r,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return ge(this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return ve(r,this.multi,i,s,t,n)}throw new P("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return L.empty();if(!arguments.length)return fe(this,n);if(1===arguments.length){var o=this._nodes.get(e=""+e);if(!o)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return ye(n,r,o)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return _e(n,r,a,t)}throw new P("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(ze),function(e){we.forEach(function(t){var n,r,i,o;i=(n=t).type,o=n.direction,e.prototype[r=n.name]=function(e){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(t))throw new C("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(n))throw new C("Graph.".concat(r,': could not find the "').concat(n,'" node in the graph.'));return ke(this,i,o,t,n)}if(1===arguments.length){var a=this._nodes.get(e=""+e);if(void 0===a)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return Se("mixed"===i?this.type:i,o,a)}throw new P("Graph.".concat(r,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return je(n,n.undirected,r);if("string"==typeof t)return je(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&Ne(i,n,n.in,r),"in"!==t&&Ne(i,n,n.out,r)),"directed"!==e&&Ne(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return Ee(n,n.undirected,r);if("string"==typeof t)return Ee(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&Te(i,n,n.in,r)||"in"!==t&&Te(i,n,n.out,r))||"directed"===e||Te(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return L.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return Ie(n,n.undirected);if("string"==typeof t)return Ie(n,n[t])}var r=L.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=H(r,Ae(i,n,n.in))),"in"!==t&&(r=H(r,Ae(i,n,n.out)))),"directed"!==e&&(r=H(r,Ae(i,n,n.undirected))),r}("mixed"===n?this.type:n,r,t)}}(e,t)})}(ze);var qe=function(e){function n(t){var n=u({type:"directed"},t);if("multi"in n&&!1!==n.multi)throw new P("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new P('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(ze),Ke=function(e){function n(t){var n=u({type:"undirected"},t);if("multi"in n&&!1!==n.multi)throw new P("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new P('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(ze),He=function(e){function n(t){var n=u({multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return e.call(this,n)||this}return t(n,e),n}(ze),We=function(e){function n(t){var n=u({type:"directed",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new P('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(ze),Je=function(e){function n(t){var n=u({type:"undirected",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new P('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(ze);function Qe(e){e.from=function(t,n){var r=u({},t.options,n),i=new e(r);return i.import(t),i}}return Qe(ze),Qe(qe),Qe(Ke),Qe(He),Qe(We),Qe(Je),ze.Graph=ze,ze.DirectedGraph=qe,ze.UndirectedGraph=Ke,ze.MultiGraph=He,ze.MultiDirectedGraph=We,ze.MultiUndirectedGraph=Je,ze.InvalidArgumentsGraphError=P,ze.NotFoundGraphError=C,ze.UsageGraphError=F,ze}()},23815:function(e,t,n){var r;e=n.nmd(e),(function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=32,c=128,l=1/0,d=9007199254740991,f=NaN,h=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],g="[object Arguments]",y="[object Array]",m="[object Boolean]",b="[object Date]",v="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",S="[object Number]",j="[object Object]",N="[object Promise]",E="[object RegExp]",T="[object Set]",I="[object String]",A="[object Symbol]",k="[object WeakMap]",R="[object ArrayBuffer]",O="[object DataView]",L="[object Float32Array]",M="[object Float64Array]",D="[object Int8Array]",P="[object Int16Array]",C="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",G="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,H=RegExp(q.source),W=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",je="a-z\\xdf-\\xf6\\xf8-\\xff",Ne="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="["+we+"]",Ae="["+Te+"]",ke="["+xe+"]",Re="\\d+",Oe="["+Se+"]",Le="["+je+"]",Me="[^"+we+Te+Re+Se+je+Ne+"]",De="\\ud83c[\\udffb-\\udfff]",Pe="[^"+we+"]",Ce="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Be="["+Ne+"]",Ge="(?:"+Le+"|"+Me+")",Ue="(?:"+Be+"|"+Me+")",Ve="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",$e="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",ze="(?:"+ke+"|"+De+")?",qe="["+Ee+"]?",Ke=qe+ze+"(?:\\u200d(?:"+[Pe,Ce,Fe].join("|")+")"+qe+ze+")*",He="(?:"+[Oe,Ce,Fe].join("|")+")"+Ke,We="(?:"+[Pe+ke+"?",ke,Ce,Fe,Ie].join("|")+")",Je=RegExp("['\u2019]","g"),Qe=RegExp(ke,"g"),Xe=RegExp(De+"(?="+De+")|"+We+Ke,"g"),Ye=RegExp([Be+"?"+Le+"+"+Ve+"(?="+[Ae,Be,"$"].join("|")+")",Ue+"+"+$e+"(?="+[Ae,Be+Ge,"$"].join("|")+")",Be+"?"+Ge+"+"+Ve,Be+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,He].join("|"),"g"),Ze=RegExp("[\\u200d"+we+xe+Ee+"]"),et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,rt={};rt[L]=rt[M]=rt[D]=rt[P]=rt[C]=rt[F]=rt[B]=rt[G]=rt[U]=!0,rt[g]=rt[y]=rt[R]=rt[m]=rt[O]=rt[b]=rt[v]=rt[_]=rt[x]=rt[S]=rt[j]=rt[E]=rt[T]=rt[I]=rt[k]=!1;var it={};it[g]=it[y]=it[R]=it[O]=it[m]=it[b]=it[L]=it[M]=it[D]=it[P]=it[C]=it[x]=it[S]=it[j]=it[E]=it[T]=it[I]=it[A]=it[F]=it[B]=it[G]=it[U]=!0,it[v]=it[_]=it[k]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,st=parseInt,ut="object"==typeof global&&global&&global.Object===Object&&global,ct="object"==typeof self&&self&&self.Object===Object&&self,lt=ut||ct||Function("return this")(),dt=t&&!t.nodeType&&t,ft=dt&&e&&!e.nodeType&&e,ht=ft&&ft.exports===dt,pt=ht&&ut.process,gt=function(){try{return ft&&ft.require&&ft.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),yt=gt&>.isArrayBuffer,mt=gt&>.isDate,bt=gt&>.isMap,vt=gt&>.isRegExp,_t=gt&>.isSet,wt=gt&>.isTypedArray;function xt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function St(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function At(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Yt(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function Zt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var en=$t({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),tn=$t({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+ot[e]}function rn(e){return Ze.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function an(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"}),hn=function e(t){var n,r=(t=null==t?lt:hn.defaults(lt.Object(),t,hn.pick(lt,tt))).Array,ie=t.Date,we=t.Error,xe=t.Function,Se=t.Math,je=t.Object,Ne=t.RegExp,Ee=t.String,Te=t.TypeError,Ie=r.prototype,Ae=je.prototype,ke=t["__core-js_shared__"],Re=xe.prototype.toString,Oe=Ae.hasOwnProperty,Le=0,Me=(n=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=Ae.toString,Pe=Re.call(je),Ce=lt._,Fe=Ne("^"+Re.call(Oe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ht?t.Buffer:i,Ge=t.Symbol,Ue=t.Uint8Array,Ve=Be?Be.allocUnsafe:i,$e=an(je.getPrototypeOf,je),ze=je.create,qe=Ae.propertyIsEnumerable,Ke=Ie.splice,He=Ge?Ge.isConcatSpreadable:i,We=Ge?Ge.iterator:i,Xe=Ge?Ge.toStringTag:i,Ze=function(){try{var e=so(je,"defineProperty");return e({},"",{}),e}catch(Lo){}}(),ot=t.clearTimeout!==lt.clearTimeout&&t.clearTimeout,ut=ie&&ie.now!==lt.Date.now&&ie.now,ct=t.setTimeout!==lt.setTimeout&&t.setTimeout,dt=Se.ceil,ft=Se.floor,pt=je.getOwnPropertySymbols,gt=Be?Be.isBuffer:i,Dt=t.isFinite,$t=Ie.join,pn=an(je.keys,je),gn=Se.max,yn=Se.min,mn=ie.now,bn=t.parseInt,vn=Se.random,_n=Ie.reverse,wn=so(t,"DataView"),xn=so(t,"Map"),Sn=so(t,"Promise"),jn=so(t,"Set"),Nn=so(t,"WeakMap"),En=so(je,"create"),Tn=Nn&&new Nn,In={},An=Co(wn),kn=Co(xn),Rn=Co(Sn),On=Co(jn),Ln=Co(Nn),Mn=Ge?Ge.prototype:i,Dn=Mn?Mn.valueOf:i,Pn=Mn?Mn.toString:i;function Cn(e){if(es(e)&&!$a(e)&&!(e instanceof Un)){if(e instanceof Gn)return e;if(Oe.call(e,"__wrapped__"))return Fo(e)}return new Gn(e)}var Fn=function(){function e(){}return function(t){if(!Za(t))return{};if(ze)return ze(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Bn(){}function Gn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function or(e,t,n,r,o,a){var s,u=1&t,c=2&t,l=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!Za(e))return e;var d=$a(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return Ni(e,s)}else{var f=lo(e),h=f==_||f==w;if(Ha(e))return vi(e,u);if(f==j||f==g||h&&!o){if(s=c||h?{}:ho(e),!u)return c?function(e,t){return Ei(e,co(e),t)}(e,function(e,t){return e&&Ei(t,Rs(t),e)}(s,e)):function(e,t){return Ei(e,uo(e),t)}(e,tr(s,e))}else{if(!it[f])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case R:return _i(e);case m:case b:return new r(+e);case O:return function(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case M:case D:case P:case C:case F:case B:case G:case U:return wi(e,n);case x:return new r;case S:case I:return new r(e);case E:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new r;case A:return function(e){return Dn?je(Dn.call(e)):{}}(e)}}(e,f,u)}}a||(a=new Kn);var p=a.get(e);if(p)return p;a.set(e,s),os(e)?e.forEach(function(r){s.add(or(r,t,n,r,e,a))}):ts(e)&&e.forEach(function(r,i){s.set(i,or(r,t,n,i,e,a))});var y=d?i:(l?c?eo:Zi:c?Rs:ks)(e);return jt(y||e,function(r,i){y&&(r=e[i=r]),Yn(s,i,or(r,t,n,i,e,a))}),s}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var o=n[r],a=e[o];if(a===i&&!(o in e)||!(0,t[o])(a))return!1}return!0}function sr(e,t,n){if("function"!=typeof e)throw new Te(o);return Io(function(){e.apply(i,n)},t)}function ur(e,t,n,r){var i=-1,o=It,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=kt(t,Wt(n))),r?(o=At,a=!1):t.length>=200&&(o=Qt,a=!1,t=new qn(t));e:for(;++i-1},$n.prototype.set=function(e,t){var n=this.__data__,r=Zn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(xn||$n),string:new Vn}},zn.prototype.delete=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},zn.prototype.get=function(e){return oo(this,e).get(e)},zn.prototype.has=function(e){return oo(this,e).has(e)},zn.prototype.set=function(e,t){var n=oo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(e){return this.__data__.set(e,a),this},qn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new $n,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof $n){var r=n.__data__;if(!xn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new zn(r)}return n.set(e,t),this.size=n.size,this};var cr=Ai(mr),lr=Ai(br,!0);function dr(e,t){var n=!0;return cr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function fr(e,t,n){for(var r=-1,o=e.length;++r0&&n(s)?t>1?pr(s,t-1,n,r,i):Rt(i,s):r||(i[i.length]=s)}return i}var gr=ki(),yr=ki(!0);function mr(e,t){return e&&gr(e,t,ks)}function br(e,t){return e&&yr(e,t,ks)}function vr(e,t){return Tt(t,function(t){return Qa(e[t])})}function _r(e,t){for(var n=0,r=(t=gi(t,e)).length;null!=e&&nt}function jr(e,t){return null!=e&&Oe.call(e,t)}function Nr(e,t){return null!=e&&t in je(e)}function Er(e,t,n){for(var o=n?At:It,a=e[0].length,s=e.length,u=s,c=r(s),l=1/0,d=[];u--;){var f=e[u];u&&t&&(f=kt(f,Wt(t))),l=yn(f.length,l),c[u]=!n&&(t||a>=120&&f.length>=120)?new qn(u&&f):i}f=e[0];var h=-1,p=c[0];e:for(;++h=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Dr(e,function(e,n,i){return{criteria:kt(t,function(t){return t(e)}),index:++r,value:e}}))}function Ur(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Ke.call(s,u,1),Ke.call(e,u,1);return e}function $r(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;go(i)?Ke.call(e,i,1):si(e,i)}}return e}function zr(e,t){return e+ft(vn()*(t-e+1))}function qr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=ft(t/2))&&(e+=e)}while(t);return n}function Kr(e,t){return Ao(So(e,t,nu),e+"")}function Hr(e){return Wn(Bs(e))}function Wr(e,t){var n=Bs(e);return Oo(n,ir(t,0,n.length))}function Jr(e,t,n,r){if(!Za(e))return e;for(var o=-1,a=(t=gi(t,e)).length,s=a-1,u=e;null!=u&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!ss(a)&&(n?a<=t:a=200){var c=t?null:qi(e);if(c)return un(c);a=!1,i=Qt,u=new qn}else u=t?[]:s;e:for(;++r=r?e:Zr(e,t,n)}var bi=ot||function(e){return lt.clearTimeout(e)};function vi(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function _i(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function wi(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function xi(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=ss(e),s=t!==i,u=null===t,c=t==t,l=ss(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!l&&e1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&yo(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=je(t);++r-1?o[a?t[s]:s]:i}}function Di(e){return Yi(function(t){var n=t.length,r=n,a=Gn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Te(o);if(a&&!u&&"wrapper"==no(s))var u=new Gn([],!0)}for(r=u?r:n;++r1&&v.reverse(),h&&du))return!1;var l=a.get(e),d=a.get(t);if(l&&d)return l==t&&d==e;var f=-1,h=!0,p=2&n?new qn:i;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(p,function(n){var r="_."+n[0];t&n[1]&&!It(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(se):[]}(r),n)))}function Ro(e){var t=0,n=0;return function(){var r=mn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Oo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,ia(e,n)});function da(e){var t=Cn(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var ha=Yi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return rr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Un&&go(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new Gn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(i),e})):this.thru(o)}),pa=Ti(function(e,t,n){Oe.call(e,n)?++e[n]:nr(e,n,1)}),ga=Mi(Vo),ya=Mi($o);function ma(e,t){return($a(e)?jt:cr)(e,io(t,3))}function ba(e,t){return($a(e)?Nt:lr)(e,io(t,3))}var va=Ti(function(e,t,n){Oe.call(e,n)?e[n].push(t):nr(e,n,[t])}),_a=Kr(function(e,t,n){var i=-1,o="function"==typeof t,a=qa(e)?r(e.length):[];return cr(e,function(e){a[++i]=o?xt(t,e,n):Tr(e,t,n)}),a}),wa=Ti(function(e,t,n){nr(e,n,t)});function xa(e,t){return($a(e)?kt:Dr)(e,io(t,3))}var Sa=Ti(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ja=Kr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,pr(t,1),[])}),Na=ut||function(){return lt.Date.now()};function Ea(e,t,n){return t=n?i:t,Hi(e,c,i,i,i,i,t=e&&null==t?e.length:t)}function Ta(e,t){var n;if("function"!=typeof t)throw new Te(o);return e=hs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ia=Kr(function(e,t,n){var r=1;if(n.length){var i=sn(n,ro(Ia));r|=u}return Hi(e,r,t,n,i)}),Aa=Kr(function(e,t,n){var r=3;if(n.length){var i=sn(n,ro(Aa));r|=u}return Hi(t,r,e,n,i)});function ka(e,t,n){var r,a,s,u,c,l,d=0,f=!1,h=!1,p=!0;if("function"!=typeof e)throw new Te(o);function g(t){var n=r,o=a;return r=a=i,d=t,u=e.apply(o,n)}function y(e){return d=e,c=Io(b,t),f?g(e):u}function m(e){var n=e-l;return l===i||n>=t||n<0||h&&e-d>=s}function b(){var e=Na();if(m(e))return v(e);c=Io(b,function(e){var n=t-(e-l);return h?yn(n,s-(e-d)):n}(e))}function v(e){return c=i,p&&r?g(e):(r=a=i,u)}function _(){var e=Na(),n=m(e);if(r=arguments,a=this,l=e,n){if(c===i)return y(l);if(h)return bi(c),c=Io(b,t),g(l)}return c===i&&(c=Io(b,t)),u}return t=gs(t)||0,Za(n)&&(f=!!n.leading,s=(h="maxWait"in n)?gn(gs(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==i&&bi(c),d=0,r=l=a=c=i},_.flush=function(){return c===i?u:v(Na())},_}var Ra=Kr(function(e,t){return sr(e,1,t)}),Oa=Kr(function(e,t,n){return sr(e,gs(t)||0,n)});function La(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(La.Cache||zn),n}function Ma(e){if("function"!=typeof e)throw new Te(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}La.Cache=zn;var Da=yi(function(e,t){var n=(t=1==t.length&&$a(t[0])?kt(t[0],Wt(io())):kt(pr(t,1),Wt(io()))).length;return Kr(function(r){for(var i=-1,o=yn(r.length,n);++i=t}),Va=Ir(function(){return arguments}())?Ir:function(e){return es(e)&&Oe.call(e,"callee")&&!qe.call(e,"callee")},$a=r.isArray,za=yt?Wt(yt):function(e){return es(e)&&xr(e)==R};function qa(e){return null!=e&&Ya(e.length)&&!Qa(e)}function Ka(e){return es(e)&&qa(e)}var Ha=gt||gu,Wa=mt?Wt(mt):function(e){return es(e)&&xr(e)==b};function Ja(e){if(!es(e))return!1;var t=xr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function Qa(e){if(!Za(e))return!1;var t=xr(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xa(e){return"number"==typeof e&&e==hs(e)}function Ya(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Wt(bt):function(e){return es(e)&&lo(e)==x};function ns(e){return"number"==typeof e||es(e)&&xr(e)==S}function rs(e){if(!es(e)||xr(e)!=j)return!1;var t=$e(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Re.call(n)==Pe}var is=vt?Wt(vt):function(e){return es(e)&&xr(e)==E},os=_t?Wt(_t):function(e){return es(e)&&lo(e)==T};function as(e){return"string"==typeof e||!$a(e)&&es(e)&&xr(e)==I}function ss(e){return"symbol"==typeof e||es(e)&&xr(e)==A}var us=wt?Wt(wt):function(e){return es(e)&&Ya(e.length)&&!!rt[xr(e)]},cs=Vi(Mr),ls=Vi(function(e,t){return e<=t});function ds(e){if(!e)return[];if(qa(e))return as(e)?ln(e):Ni(e);if(We&&e[We])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[We]());var t=lo(e);return(t==x?on:t==T?un:Bs)(e)}function fs(e){return e?(e=gs(e))===l||e===-l?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function hs(e){var t=fs(e),n=t%1;return t==t?n?t-n:t:0}function ps(e){return e?ir(hs(e),0,h):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return f;if(Za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ht(e);var n=pe.test(e);return n||ye.test(e)?st(e.slice(2),n?2:8):he.test(e)?f:+e}function ys(e){return Ei(e,Rs(e))}function ms(e){return null==e?"":oi(e)}var bs=Ii(function(e,t){if(_o(t)||qa(t))Ei(t,ks(t),e);else for(var n in t)Oe.call(t,n)&&Yn(e,n,t[n])}),vs=Ii(function(e,t){Ei(t,Rs(t),e)}),_s=Ii(function(e,t,n,r){Ei(t,Rs(t),e,r)}),ws=Ii(function(e,t,n,r){Ei(t,ks(t),e,r)}),xs=Yi(rr),Ss=Kr(function(e,t){e=je(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n1),t}),Ei(e,eo(e),n),r&&(n=or(n,7,Qi));for(var i=t.length;i--;)si(n,t[i]);return n}),Ds=Yi(function(e,t){return null==e?{}:function(e,t){return Ur(e,t,function(t,n){return Es(e,n)})}(e,t)});function Ps(e,t){if(null==e)return{};var n=kt(eo(e),function(e){return[e]});return t=io(t),Ur(e,n,function(e,n){return t(e,n[0])})}var Cs=Ki(ks),Fs=Ki(Rs);function Bs(e){return null==e?[]:Jt(e,ks(e))}var Gs=Oi(function(e,t,n){return t=t.toLowerCase(),e+(n?Us(t):t)});function Us(e){return Js(ms(e).toLowerCase())}function Vs(e){return(e=ms(e))&&e.replace(be,en).replace(Qe,"")}var $s=Oi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),zs=Oi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qs=Ri("toLowerCase"),Ks=Oi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Hs=Oi(function(e,t,n){return e+(n?" ":"")+Js(t)}),Ws=Oi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Js=Ri("toUpperCase");function Qs(e,t,n){return e=ms(e),(t=n?i:t)===i?function(e){return et.test(e)}(e)?function(e){return e.match(Ye)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Xs=Kr(function(e,t){try{return xt(e,i,t)}catch(Mo){return Ja(Mo)?Mo:new we(Mo)}}),Ys=Yi(function(e,t){return jt(t,function(t){t=Po(t),nr(e,t,Ia(e[t],e))}),e});function Zs(e){return function(){return e}}var eu=Di(),tu=Di(!0);function nu(e){return e}function ru(e){return Or("function"==typeof e?e:or(e,1))}var iu=Kr(function(e,t){return function(n){return Tr(n,e,t)}}),ou=Kr(function(e,t){return function(n){return Tr(e,n,t)}});function au(e,t,n){var r=ks(t),i=vr(t,r);null==n&&(!Za(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=vr(t,ks(t)));var o=!(Za(n)&&"chain"in n&&!n.chain),a=Qa(e);return jt(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Ni(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Rt([this.value()],arguments))})}),e}function su(){}var uu=Bi(kt),cu=Bi(Et),lu=Bi(Mt);function du(e){return mo(e)?Vt(Po(e)):function(e){return function(t){return _r(t,e)}}(e)}var fu=Ui(),hu=Ui(!0);function pu(){return[]}function gu(){return!1}var yu=Fi(function(e,t){return e+t},0),mu=zi("ceil"),bu=Fi(function(e,t){return e/t},1),vu=zi("floor"),_u=Fi(function(e,t){return e*t},1),wu=zi("round"),xu=Fi(function(e,t){return e-t},0);return Cn.after=function(e,t){if("function"!=typeof t)throw new Te(o);return e=hs(e),function(){if(--e<1)return t.apply(this,arguments)}},Cn.ary=Ea,Cn.assign=bs,Cn.assignIn=vs,Cn.assignInWith=_s,Cn.assignWith=ws,Cn.at=xs,Cn.before=Ta,Cn.bind=Ia,Cn.bindAll=Ys,Cn.bindKey=Aa,Cn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $a(e)?e:[e]},Cn.chain=da,Cn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:gn(hs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,u=r(dt(o/t));ao?0:o+n),(r=r===i||r>o?o:hs(r))<0&&(r+=o),r=n>r?0:ps(r);n>>0)?(e=ms(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=oi(t))&&rn(e)?mi(ln(e),0,n):e.split(t,n):[]},Cn.spread=function(e,t){if("function"!=typeof e)throw new Te(o);return t=null==t?0:gn(hs(t),0),Kr(function(n){var r=n[t],i=mi(n,0,t);return r&&Rt(i,r),xt(e,this,i)})},Cn.tail=function(e){var t=null==e?0:e.length;return t?Zr(e,1,t):[]},Cn.take=function(e,t,n){return e&&e.length?Zr(e,0,(t=n||t===i?1:hs(t))<0?0:t):[]},Cn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Zr(e,(t=r-(t=n||t===i?1:hs(t)))<0?0:t,r):[]},Cn.takeRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!1,!0):[]},Cn.takeWhile=function(e,t){return e&&e.length?ci(e,io(t,3)):[]},Cn.tap=function(e,t){return t(e),e},Cn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Te(o);return Za(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ka(e,t,{leading:r,maxWait:t,trailing:i})},Cn.thru=fa,Cn.toArray=ds,Cn.toPairs=Cs,Cn.toPairsIn=Fs,Cn.toPath=function(e){return $a(e)?kt(e,Po):ss(e)?[e]:Ni(Do(ms(e)))},Cn.toPlainObject=ys,Cn.transform=function(e,t,n){var r=$a(e),i=r||Ha(e)||us(e);if(t=io(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Za(e)&&Qa(o)?Fn($e(e)):{}}return(i?jt:mr)(e,function(e,r,i){return t(n,e,r,i)}),n},Cn.unary=function(e){return Ea(e,1)},Cn.union=ea,Cn.unionBy=ta,Cn.unionWith=na,Cn.uniq=function(e){return e&&e.length?ai(e):[]},Cn.uniqBy=function(e,t){return e&&e.length?ai(e,io(t,2)):[]},Cn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Cn.unset=function(e,t){return null==e||si(e,t)},Cn.unzip=ra,Cn.unzipWith=ia,Cn.update=function(e,t,n){return null==e?e:ui(e,t,pi(n))},Cn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ui(e,t,pi(n),r)},Cn.values=Bs,Cn.valuesIn=function(e){return null==e?[]:Jt(e,Rs(e))},Cn.without=oa,Cn.words=Qs,Cn.wrap=function(e,t){return Pa(pi(t),e)},Cn.xor=aa,Cn.xorBy=sa,Cn.xorWith=ua,Cn.zip=ca,Cn.zipObject=function(e,t){return fi(e||[],t||[],Yn)},Cn.zipObjectDeep=function(e,t){return fi(e||[],t||[],Jr)},Cn.zipWith=la,Cn.entries=Cs,Cn.entriesIn=Fs,Cn.extend=vs,Cn.extendWith=_s,au(Cn,Cn),Cn.add=yu,Cn.attempt=Xs,Cn.camelCase=Gs,Cn.capitalize=Us,Cn.ceil=mu,Cn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=gs(n))==n?n:0),t!==i&&(t=(t=gs(t))==t?t:0),ir(gs(e),t,n)},Cn.clone=function(e){return or(e,4)},Cn.cloneDeep=function(e){return or(e,5)},Cn.cloneDeepWith=function(e,t){return or(e,5,t="function"==typeof t?t:i)},Cn.cloneWith=function(e,t){return or(e,4,t="function"==typeof t?t:i)},Cn.conformsTo=function(e,t){return null==t||ar(e,t,ks(t))},Cn.deburr=Vs,Cn.defaultTo=function(e,t){return null==e||e!=e?t:e},Cn.divide=bu,Cn.endsWith=function(e,t,n){e=ms(e),t=oi(t);var r=e.length,o=n=n===i?r:ir(hs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Cn.eq=Ba,Cn.escape=function(e){return(e=ms(e))&&W.test(e)?e.replace(K,tn):e},Cn.escapeRegExp=function(e){return(e=ms(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Cn.every=function(e,t,n){var r=$a(e)?Et:dr;return n&&yo(e,t,n)&&(t=i),r(e,io(t,3))},Cn.find=ga,Cn.findIndex=Vo,Cn.findKey=function(e,t){return Pt(e,io(t,3),mr)},Cn.findLast=ya,Cn.findLastIndex=$o,Cn.findLastKey=function(e,t){return Pt(e,io(t,3),br)},Cn.floor=vu,Cn.forEach=ma,Cn.forEachRight=ba,Cn.forIn=function(e,t){return null==e?e:gr(e,io(t,3),Rs)},Cn.forInRight=function(e,t){return null==e?e:yr(e,io(t,3),Rs)},Cn.forOwn=function(e,t){return e&&mr(e,io(t,3))},Cn.forOwnRight=function(e,t){return e&&br(e,io(t,3))},Cn.get=Ns,Cn.gt=Ga,Cn.gte=Ua,Cn.has=function(e,t){return null!=e&&fo(e,t,jr)},Cn.hasIn=Es,Cn.head=qo,Cn.identity=nu,Cn.includes=function(e,t,n,r){e=qa(e)?e:Bs(e),n=n&&!r?hs(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),as(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Cn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:hs(n);return i<0&&(i=gn(r+i,0)),Ft(e,t,i)},Cn.inRange=function(e,t,n){return t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n){return e>=yn(t,n)&&e=-d&&e<=d},Cn.isSet=os,Cn.isString=as,Cn.isSymbol=ss,Cn.isTypedArray=us,Cn.isUndefined=function(e){return e===i},Cn.isWeakMap=function(e){return es(e)&&lo(e)==k},Cn.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==xr(e)},Cn.join=function(e,t){return null==e?"":$t.call(e,t)},Cn.kebabCase=$s,Cn.last=Jo,Cn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=hs(n))<0?gn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ct(e,Gt,o,!0)},Cn.lowerCase=zs,Cn.lowerFirst=qs,Cn.lt=cs,Cn.lte=ls,Cn.max=function(e){return e&&e.length?fr(e,nu,Sr):i},Cn.maxBy=function(e,t){return e&&e.length?fr(e,io(t,2),Sr):i},Cn.mean=function(e){return Ut(e,nu)},Cn.meanBy=function(e,t){return Ut(e,io(t,2))},Cn.min=function(e){return e&&e.length?fr(e,nu,Mr):i},Cn.minBy=function(e,t){return e&&e.length?fr(e,io(t,2),Mr):i},Cn.stubArray=pu,Cn.stubFalse=gu,Cn.stubObject=function(){return{}},Cn.stubString=function(){return""},Cn.stubTrue=function(){return!0},Cn.multiply=_u,Cn.nth=function(e,t){return e&&e.length?Br(e,hs(t)):i},Cn.noConflict=function(){return lt._===this&&(lt._=Ce),this},Cn.noop=su,Cn.now=Na,Cn.pad=function(e,t,n){e=ms(e);var r=(t=hs(t))?cn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(ft(i),n)+e+Gi(dt(i),n)},Cn.padEnd=function(e,t,n){e=ms(e);var r=(t=hs(t))?cn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=vn();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return zr(e,t)},Cn.reduce=function(e,t,n){var r=$a(e)?Ot:zt,i=arguments.length<3;return r(e,io(t,4),n,i,cr)},Cn.reduceRight=function(e,t,n){var r=$a(e)?Lt:zt,i=arguments.length<3;return r(e,io(t,4),n,i,lr)},Cn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:hs(t),qr(ms(e),t)},Cn.replace=function(){var e=arguments,t=ms(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Cn.result=function(e,t,n){var r=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=i);++rd)return[];var n=h,r=yn(e,h);t=io(t),e-=h;for(var i=Kt(r,t);++n=a)return e;var u=n-cn(r);if(u<1)return r;var c=s?mi(s,0,u).join(""):e.slice(0,u);if(o===i)return c+r;if(s&&(u+=c.length-u),is(o)){if(e.slice(u).search(o)){var l,d=c;for(o.global||(o=Ne(o.source,ms(fe.exec(o))+"g")),o.lastIndex=0;l=o.exec(d);)var f=l.index;c=c.slice(0,f===i?u:f)}}else if(e.indexOf(oi(o),u)!=u){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+r},Cn.unescape=function(e){return(e=ms(e))&&H.test(e)?e.replace(q,fn):e},Cn.uniqueId=function(e){var t=++Le;return ms(e)+t},Cn.upperCase=Ws,Cn.upperFirst=Js,Cn.each=ma,Cn.eachRight=ba,Cn.first=qo,au(Cn,function(){var e={};return mr(Cn,function(t,n){Oe.call(Cn.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),Cn.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Cn[e].placeholder=Cn}),jt(["drop","take"],function(e,t){Un.prototype[e]=function(n){n=n===i?1:gn(hs(n),0);var r=this.__filtered__&&!t?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,h),type:e+(r.__dir__<0?"Right":"")}),r},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),jt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),jt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}}),jt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}}),Un.prototype.compact=function(){return this.filter(nu)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Kr(function(e,t){return"function"==typeof e?new Un(this):this.map(function(n){return Tr(n,e,t)})}),Un.prototype.reject=function(e){return this.filter(Ma(io(e)))},Un.prototype.slice=function(e,t){e=hs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Un(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=hs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(h)},mr(Un.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Cn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);!o||(Cn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,u=t instanceof Un,c=s[0],l=u||$a(t),d=function(e){var t=o.apply(Cn,Rt([e],s));return r&&f?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var f=this.__chain__,h=!!this.__actions__.length,p=a&&!f,g=u&&!h;if(!a&&l){t=g?t:new Un(this);var y=e.apply(t,s);return y.__actions__.push({func:fa,args:[d],thisArg:i}),new Gn(y,f)}return p&&g?e.apply(this,s):(y=this.thru(d),p?r?y.value()[0]:y.value():y)})}),jt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ie[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Cn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply($a(i)?i:[],e)}return this[n](function(n){return t.apply($a(n)?n:[],e)})}}),mr(Un.prototype,function(e,t){var n=Cn[t];if(n){var r=n.name+"";Oe.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}}),In[Pi(i,2).name]=[{name:"wrapper",func:i}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=Ni(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ni(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ni(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=$a(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Cn.prototype.plant=function(e){for(var t,n=this;n instanceof Bn;){var r=Fo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Cn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:fa,args:[Zo],thisArg:i}),new Gn(t,this.__chain__)}return this.thru(Zo)},Cn.prototype.toJSON=Cn.prototype.valueOf=Cn.prototype.value=function(){return li(this.__wrapped__,this.__actions__)},Cn.prototype.first=Cn.prototype.head,We&&(Cn.prototype[We]=function(){return this}),Cn}();lt._=hn,(r=(function(){return hn}).call(t,n,t,e))!==i&&(e.exports=r)}).call(this)},29369:function(e,t,n){var r=n(56284),i=n(67830);function o(){this.clear()}o.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},o.prototype.enqueue=function(e){return this.items.push(e),++this.size},o.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},o.prototype.peek=function(){if(this.size)return this.items[this.offset]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.offset,r=0,i=this.items.length;n=e.length)return{done:!0};var n=e[t];return t++,{value:n,done:!1}})},o.prototype.entries=function(){var e=this.items,t=this.offset,n=0;return new r(function(){if(t>=e.length)return{done:!0};var r=e[t];return t++,{value:[n++,r],done:!1}})},"undefined"!=typeof Symbol&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(",")},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:o,enumerable:!1}),e},"undefined"!=typeof Symbol&&(o.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.prototype.inspect),o.from=function(e){var t=new o;return i(e,function(e){t.enqueue(e)}),t},o.of=function(){return o.from(arguments)},e.exports=o},67830:function(e){var t="undefined"!=typeof ArrayBuffer,n="undefined"!=typeof Symbol;function r(e,r){var i,o,a,s,u;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a=n?{done:!0}:{done:!1,value:e[r++]}})},t.empty=function(){var e=new t(null);return e.done=!0,e},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},86991:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(14180),t),i(n(75103),t),i(n(48965),t),i(n(32595),t),i(n(82417),t),i(n(92451),t),i(n(17735),t)},14180:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},75103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;const r=n(14180),i=n(48965),o=n(32595),a=n(82417),s=n(92451),u=n(17735);let c=0;t.DataFactory=class{constructor(e){this.blankNodeCounter=0,this.blankNodePrefix=(e=e||{}).blankNodePrefix||`df_${c++}_`}namedNode(e){return new a.NamedNode(e)}blankNode(e){return new r.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new o.Literal(e,t)}variable(e){return new u.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,n,r){return new s.Quad(e,t,n,r||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(o.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},48965:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}t.DefaultGraph=n,n.INSTANCE=new n},32595:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;const r=n(82417);class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=i.XSD_STRING)}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}t.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},92451:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=class{constructor(e,t,n,r){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},17735:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},31609:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedJavaScriptPrimitives=t.getSupportedRdfDatatypes=t.getTermRaw=t.toRdf=t.fromRdf=void 0;const o=n(86991),a=n(9938),s=n(66060);i(n(9938),t),i(n(88871),t),i(n(66060),t);const u=new o.DataFactory,c=new s.Translator;function l(e,t){return c.fromRdf(e,t)}c.registerHandler(new a.TypeHandlerString,a.TypeHandlerString.TYPES.map(e=>u.namedNode(e)),["string"]),c.registerHandler(new a.TypeHandlerBoolean,[a.TypeHandlerBoolean.TYPE].map(e=>u.namedNode(e)),["boolean"]),c.registerHandler(new a.TypeHandlerNumberDouble,a.TypeHandlerNumberDouble.TYPES.map(e=>u.namedNode(e)),["number"]),c.registerHandler(new a.TypeHandlerNumberInteger,a.TypeHandlerNumberInteger.TYPES.map(e=>u.namedNode(e)),["number"]),c.registerHandler(new a.TypeHandlerDate,a.TypeHandlerDate.TYPES.map(e=>u.namedNode(e)),["object"]),t.fromRdf=l,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=u),c.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?l(e,t):e.value},t.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66060:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw new Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,n){for(const r of t)this.supportedRdfDatatypes.push(r),this.fromRdfHandlers[r.value]=e;for(const r of n){let t=this.toRdfHandlers[r];t||(this.toRdfHandlers[r]=t=[]),t.push(e)}}fromRdf(e,t){const n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}toRdf(e,t){const n=this.toRdfHandlers[typeof e];if(n)for(const r of n){const n=r.toRdf(e,t);if(n)return n}throw new Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},80727:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;const r=n(66060);class i{fromRdf(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&r.Translator.incorrectRdfDataType(e),!1}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e?"true":"false",t||n.namedNode(i.TYPE))}}t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;const r=n(66060);class i{fromRdf(e,t){switch(t&&!e.value.match(i.VALIDATORS[e.datatype.value.substr(33,e.datatype.value.length)])&&r.Translator.incorrectRdfDataType(e),e.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(e.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const t=e.value.split("-");return new Date(0,parseInt(t[0],10)-1,parseInt(t[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(e.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(e.value+"-01");default:return new Date(e.value)}}toRdf(e,{datatype:t,dataFactory:n}){if(t=t||n.namedNode(i.TYPES[0]),!(e instanceof Date))return null;const r=e;let o;switch(t.value){case"http://www.w3.org/2001/XMLSchema#gDay":o=String(r.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":o=r.getUTCMonth()+1+"-"+r.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":o=String(r.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":o=r.getUTCFullYear()+"-"+(r.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":o=r.toISOString().replace(/T.*$/,"");break;default:o=r.toISOString()}return n.literal(o,t)}}t.TypeHandlerDate=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}},38554:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;const r=n(66060);class i{fromRdf(e,t){const n=parseFloat(e.value);return t&&isNaN(n)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return t=t||n.namedNode(i.TYPES[0]),isNaN(e)?n.literal("NaN",t):isFinite(e)?e%1==0?null:n.literal(e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),t):n.literal(e>0?"INF":"-INF",t)}}t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;const r=n(66060);class i{fromRdf(e,t){const n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(String(e),t||n.namedNode(e<=i.MAX_INT&&e>=i.MIN_INT?i.TYPES[0]:i.TYPES[1]))}}t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},14608:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;class n{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e,t)}}t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(80727),t),i(n(52525),t),i(n(38554),t),i(n(37750),t),i(n(14608),t)},91052:function(e){function t(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)})}},e.exports.default=e.exports,e.exports.__esModule=!0}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";function e(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())})}function t(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}let r;function i(){return r||(r=function(e,n){const r=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const n=()=>indexedDB.databases().finally(t);e=setInterval(n,100),n()}).finally(()=>clearInterval(e))}().then(()=>{const e=indexedDB.open("keyval-store");return e.onupgradeneeded=()=>e.result.createObjectStore(n),t(e)});return(e,t)=>r.then(r=>t(r.transaction(n,e).objectStore(n)))}(0,"keyval")),r}function o(e,n=i()){return n("readonly",n=>t(n.get(e)))}var a=n(71440);Math;const s=1/180*Math.PI,u={};function c(e,{precision:t=u.precision||4}={}){return e=function(e){return Math.round(e/u.EPSILON)*u.EPSILON}(e),`${parseFloat(e.toPrecision(t))}`}function l(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function d(e){return function(e,t){return function(e,t,n){if(l(e)){n=n||function(e){return e.clone?e.clone():new Array(e.length)}(e);for(let r=0;re*s,void 0)}(e)}function f(e,t,n){const r=u.EPSILON;n&&(u.EPSILON=n);try{if(e===t)return!0;if(l(e)&&l(t)){if(e.length!==t.length)return!1;for(let n=0;n0?", ":"")+c(this[n],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t2*Math.PI)throw Error("radians");const o=n*Math.tan(e/2),a=o*t;return(new T).ortho({left:-a,right:a,bottom:-o,top:o,near:r,far:i})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:i=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return function(e,t,n,r,i){var o,a=1/Math.tan(t/2);e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+r)*(o=1/(r-i)),e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r)}(this,e,n,r,i),this.check()}determinant(){return function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],d=e[10],f=e[11],h=e[12],p=e[13],g=e[14],y=e[15];return(t*a-n*o)*(d*y-f*g)-(t*s-r*o)*(l*y-f*p)+(t*u-i*o)*(l*g-d*p)+(n*s-r*a)*(c*y-f*h)-(n*u-i*a)*(c*g-d*h)+(r*u-i*s)*(c*p-l*h)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*i,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*i,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*i,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*i,e[8]=this[10]*o,e}transpose(){return function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}invert(){return function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],d=t[9],f=t[10],h=t[11],p=t[12],g=t[13],y=t[14],m=t[15],b=n*s-r*a,v=n*u-i*a,_=n*c-o*a,w=r*u-i*s,x=r*c-o*s,S=i*c-o*u,j=l*g-d*p,N=l*y-f*p,E=l*m-h*p,T=d*y-f*g,I=d*m-h*g,A=f*m-h*y,k=b*A-v*I+_*T+w*E-x*N+S*j;k&&(e[0]=(s*A-u*I+c*T)*(k=1/k),e[1]=(i*I-r*A-o*T)*k,e[2]=(g*S-y*x+m*w)*k,e[3]=(f*x-d*S-h*w)*k,e[4]=(u*E-a*A-c*N)*k,e[5]=(n*A-i*E+o*N)*k,e[6]=(y*_-p*S-m*v)*k,e[7]=(l*S-f*_+h*v)*k,e[8]=(a*I-s*E+c*j)*k,e[9]=(r*E-n*I-o*j)*k,e[10]=(p*x-g*_+m*b)*k,e[11]=(d*_-l*x-h*b)*k,e[12]=(s*N-a*T-u*j)*k,e[13]=(n*T-r*N+i*j)*k,e[14]=(g*v-p*w-y*b)*k,e[15]=(l*w-d*v+f*b)*k)}(this,this),this.check()}multiplyLeft(e){return w(this,e,this),this.check()}multiplyRight(e){return w(this,this,e),this.check()}rotateX(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],d=t[10],f=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*r,e[5]=a*i+l*r,e[6]=s*i+d*r,e[7]=u*i+f*r,e[8]=c*i-o*r,e[9]=l*i-a*r,e[10]=d*i-s*r,e[11]=f*i-u*r}(this,this,e),this.check()}rotateY(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[8],l=t[9],d=t[10],f=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*r,e[1]=a*i-l*r,e[2]=s*i-d*r,e[3]=u*i-f*r,e[8]=o*r+c*i,e[9]=a*r+l*i,e[10]=s*r+d*i,e[11]=u*r+f*i}(this,this,e),this.check()}rotateZ(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[4],l=t[5],d=t[6],f=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*r,e[1]=a*i+l*r,e[2]=s*i+d*r,e[3]=u*i+f*r,e[4]=c*i-o*r,e[5]=l*i-a*r,e[6]=d*i-s*r,e[7]=f*i-u*r}(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return function(e,t,n,r){var i,o,a,s,u,c,l,d,f,h,p,g,y,m,b,_,w,x,S,j,N,E,T,I,A=r[0],k=r[1],R=r[2],O=Math.hypot(A,k,R);O{t[n.id]=e}),t}const V={spatialObjectReference:U(F.spatialObjectReference),spatialEntity:U(F.spatialEntity),spatialPlacement:U(F.spatialPlacement)};function $(e,t,n,r){const i={"@id":t,"@type":n};return e.some(e=>{const t=r[e.predicate.id];if(t){const n="Literal"===e.object.termType?(0,O.fromRdf)(e.object):e.object.id;(0,R.set)(i,t,n)}return!1},a.DataFactory.namedNode(t),null,null,null),i}const z=(0,R.memoize)(function(e,t){return $(e,t,"SpatialObjectReference",V.spatialObjectReference)},(e,t)=>t),q=(0,R.memoize)(function(e,t){const n=$(e,t,"ExtractionSet",V.spatialEntity);return n.extractionSites=(0,R.sortBy)(e.getSubjects(F.spatialEntity.extraction_set,t,null).map(t=>J(e,t.id)),["rui_rank"]),n},(e,t)=>t),K=(0,R.memoize)(function(e,t){return(0,R.sortBy)(e.getSubjects(F.spatialEntity.extraction_set_for,t,null).map(t=>q(e,t.id)),["rui_rank"])},(e,t)=>t),H=(0,R.memoize)(function(e,t){return(0,R.sortBy)(e.getSubjects(F.spatialEntity.reference_organ,t,null).map(t=>J(e,t.id)).filter(e=>e["@id"]!==t),["rui_rank"])},(e,t)=>t),W=(0,R.memoize)(function(e){const t=[];return e.forEach(n=>{n.subject.id===n.object.id&&t.push(J(e,n.subject.id))},null,F.spatialEntity.reference_organ,null,null),(0,R.sortBy)(t,["rui_rank"])}),J=(0,R.memoize)(function(e,t){const n=$(e,t,"SpatialEntity",V.spatialEntity);return n.object&&(n.object=z(e,n.object)),n.ccf_annotations&&(n.ccf_annotations=e.getObjects(t,F.spatialEntity.ccf_annotations,null).map(e=>e.id)),e.forSubjects(e=>n.entityId=e.id,P.spatialEntity,t,null),n},(e,t)=>t),Q=(0,R.memoize)(function(e,t){const n=$(e,t,"SpatialPlacement",V.spatialPlacement);return n.source&&(n.source=J(e,n.source)),n.target&&(n.target=J(e,n.target)),n},(e,t)=>t),X=(0,R.memoize)(function(e,t){const n=e.getObjects(a.DataFactory.namedNode(t),P.spatialEntity,null);if(n.length>0)return J(e,n[0].id)},(e,t)=>t);function Y(e,t){const n=t;let r;switch(n.translation_units){case"centimeter":r=.01;break;case"millimeter":r=.001;break;case"meter":default:r=1}const i=[n.x_translation,n.y_translation,n.z_translation].map(e=>e*r),o=[n.x_rotation,n.y_rotation,n.z_rotation].map(d),a=[n.x_scaling,n.y_scaling,n.z_scaling];return e.translate(i).rotateXYZ(o).scale(a)}class Z{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new I.DirectedGraph;const e=this.db.store;e.forSubjects(e=>{this.addNode(e.id,"SpatialObjectReference")},M.type,F.SpatialObjectReference,null),e.forSubjects(e=>{this.addNode(e.id,"SpatialEntity")},M.type,F.SpatialEntity,null);const t={};e.some(e=>(t[e.subject.id]=e.object.id,!1),null,F.spatialPlacement.source,null,null),e.some(e=>{const n=t[e.subject.id];return n&&this.addEdge(e.subject.id,n,e.object.id,"SpatialPlacement"),!1},null,F.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,n,r){this.graph.mergeDirectedEdge(t,n,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new T(T.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const n=this.db.store,r=new T(T.IDENTITY),i=k()(this.graph,e,t);if(i&&i.length>0){i.reverse();let e="";for(const t of i){if(e){const i=this.graph.getEdgeAttribute(t,e,"id");Y(r,Q(n,i))}e=t}return r}}}class ee{constructor(e){this.db=e}getSpatialEntity(e){return J(this.db.store,e)}getExtractionSets(e){return K(this.db.store,e)}getExtractionSet(e){return q(this.db.store,e)}getAnatomicalStructures(e){return H(this.db.store,e)}getReferenceOrgans(){return W(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=F.spatial.Male.id;break;case"Female":t=F.spatial.Female.id;break;case"Both":default:t=F.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(e=>"Male"===e.sex);break;case"Female":t=t.filter(e=>"Female"===e.sex)}return(null==e?void 0:e.debug)&&(t=t.map(e=>[[e],this.getAnatomicalStructures(e["@id"])]).reduce((e,[t,n])=>e.concat(n.length>0?n:t),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let n=[...this.getReferenceOrganSets(e).map(e=>{const n="http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of;return this.getSceneNode(e,t,{color:[255,255,255,255],opacity:n?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!n})})];return(null==e?void 0:e.debug)&&(n=n.concat([this.getSceneNode(this.getSpatialEntity(F.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(F.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(F.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(F.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(F.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),n.filter(e=>void 0!==e)}getReferenceOrganScene(e,t){var n,r;const i=null!==(n=void 0!==(null==t?void 0:t.sex))&&void 0!==n&&n,o=this.getReferenceOrgans().filter(n=>n.representation_of===e&&(!i||n.sex===(null==t?void 0:t.sex)));if(o.length>0){const e=o[0],n=this.getSceneNode(e,e,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),i=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(t=>this.getSceneNode(t,e,{color:[255,255,255,229.5]}));return[n].concat(i).filter(e=>void 0!==e)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(e=>this.getSceneNode(e,t,{color:[255,255,255,229.5]})).filter(e=>void 0!==e)}getSceneNode(e,t,n={}){var r,i,o,a;const s=null===(i=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===i?void 0:i.startsWith("model/gltf");let u=this.db.graph.getTransformationMatrix(s&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(s)u=new T(T.IDENTITY).rotateX(d(90)).multiplyLeft(u);else{let t;switch(e.dimension_units){case"centimeter":t=.01;break;case"millimeter":t=.001;break;case"meter":default:t=1}const n=[e.x_dimension,e.y_dimension,e.z_dimension].map(e=>e*t/2);u.scale(n)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:s?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:s?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:u,tooltip:e.label},n)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const te="https://entity.api.hubmapconsortium.org/entities/",ne=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),re={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},ie={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},oe=function(){const e={};return Object.entries(G).forEach(([t,n])=>e[t]=n.id),e}(),ae={BL:[oe.body,oe.bladder],RK:[oe.body,oe.kidney,oe.right_kidney],LK:[oe.body,oe.kidney,oe.left_kidney],HT:[oe.body,oe.heart],LI:[oe.body,oe.large_intestine,oe.colon],SI:[oe.body,oe.small_instestine],LL:[oe.body,oe.respiratory_system,oe.lung,oe.left_lung],RL:[oe.body,oe.respiratory_system,oe.lung,oe.right_lung],LY:[oe.body,oe.lymph_node],SP:[oe.body,oe.spleen],TH:[oe.body,oe.thymus],UR:[oe.body,oe.ureter],LV:[oe.body,oe.liver],OT:[oe.body]},se={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class ue{constructor(e,t="",n="",r){var i,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const a=this.data.descendants||[],s=(this.data.ancestors||[]).find(e=>"Donor"===e.entity_type);this.donor=this.getDonor(s,n);const u=this.getRuiLocation(e,this.donor);u?this.rui_location=u:this.bad=!0;const c=new Date(e.last_modified_timestamp).toLocaleDateString(),l=ie[e.group_uuid]||e.group_name,d=e.created_by_user_displayname;this["@id"]=te+e.uuid,this.label=`Registered ${c}, ${d}, ${l}`,this.link=`${n}browse/sample/${e.uuid}`;const f={},h=[];this.sections=h;const p=[];this.datasets=p;for(const v of a.filter(e=>"Sample"===e.entity_type)){const t=this.getSection(v,e,n);f[v.submission_id]=t,h.push(t),t.section_number=null!==(i=t.section_number)&&void 0!==i?i:h.length}for(const v of a)if("Dataset"===v.entity_type){const e=this.getDataset(v,t,n,r),i=(0,R.get)(v,["ingest_metadata","metadata","tissue_id"]);f[i]?null===(o=f[i].datasets)||void 0===o||o.push(e):p.push(e)}const g=null!=u?u:{},y=`${g.x_dimension} x ${g.y_dimension} x ${g.z_dimension} ${g.dimension_units}`;this.section_count=g.slice_count||h.length;const m=parseFloat((g.slice_thickness||(g.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=m;const b=g.dimension_units||"millimeter";this.section_units=b,this.description=`${y}, ${m} ${b}, ${e.specimen_type}, ${this.section_count} Sections`,h.forEach((e,t)=>{e.description=`${g.x_dimension} x ${g.y_dimension} x ${m} ${b}, ${m} ${b}, ${e.description}`,e.section_number=t+1})}getSection(e,t,n){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":te+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${ie[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${n}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",n="",r){var i;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=ie[e.group_uuid]||e.group_name,s=e.created_by_user_displayname,u=[...e.data_types,(0,R.get)(e,["ingest_metadata","metadata","assay_type"],"")],c=u.join("|").toLowerCase();let l,d="assets/icons/ico-unknown.svg";return-1!==c.indexOf("10x")?(l="10x",d="assets/icons/ico-bulk-10x.svg"):-1!==c.indexOf("af")?(l="AF",d="assets/icons/ico-spatial-af.svg"):-1!==c.indexOf("codex")?(l="CODEX",d="assets/icons/ico-spatial-codex.svg"):-1!==c.indexOf("imc")?(l="IMC",d="assets/icons/ico-spatial-imc.svg"):-1!==c.indexOf("lc")&&-1===c.indexOf("af")?(l="LC",d="assets/icons/ico-bulk-lc.svg"):l=-1!==c.indexOf("maldi")?"MALDI":-1!==c.indexOf("pas")?"PAS":"OTHER",d=null!==(i=this.getDatasetThumbnail(e,t,r))&&void 0!==i?i:d,{"@id":te+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${s}, ${a}`,description:`Data/Assay Types: ${u.join(", ")}`,link:`${n}browse/dataset/${e.uuid}`,technology:l,thumbnail:d}}getDatasetThumbnail(e,t,n){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(n?`?token=${n}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,R.get)(e,"metadata.files",[]).filter(e=>/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)).filter(e=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(e.rel_path)).filter(e=>ne.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(r=>`${t}/${e.uuid}/${r.rel_path}`+(n?`?token=${n}`:""));if(r.length>0){const e=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(ne.has(e))return`assets/thumbnails/TMC-Vanderbilt/DR1/${e}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const t=re[e.hubmap_id];if(t)return`assets/thumbnails/TMC-Florida/${t}`}}getDonor(e,t){const n=(e.description||"").toLowerCase();let r;n.includes("female")?r="Female":n.includes("male")&&(r="Male");const i=n.match(/age ([0-9]+)/);let o,a;i&&(o=(0,R.toNumber)(i[1]));for(const l of(0,R.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===l.preferred_term||"Female"===l.preferred_term?r="Female":"Masculine gender"===l.preferred_term||"Male"===l.preferred_term?r="Male":"Current chronological age"===l.preferred_term||"Age"===l.preferred_term?o=(0,R.toNumber)(l.data_value):"Body mass index"===l.preferred_term&&(a=(0,R.toNumber)(l.data_value));let s="";r&&o&&(s+=`${r}, Age ${o}`,a&&(s+=`, BMI ${a.toFixed(1)}`));const u=new Date(e.last_modified_timestamp).toLocaleDateString(),c=ie[e.group_uuid]||e.group_name;return{"@id":te+e.uuid,"@type":"Donor",label:s,description:`Entered ${u}, ${e.created_by_user_displayname}, ${c}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:c,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var n;const r=(e.ancestors||[]).find(e=>"Sample"===e.entity_type&&"organ"===e.specimen_type),i=ae[null==r?void 0:r.organ]||[oe.body];let o,a=e.rui_location;if(a&&("string"==typeof a&&(a=JSON.parse(a)),a.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):a["@id"]&&(o=a)),o){o.ccf_annotations=i.concat(o.ccf_annotations||[]);const e=null!==(n=(0,R.get)(o,["placement","target"]))&&void 0!==n?n:"";e.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,R.set)(o,["placement","target"],e.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===e||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===e)&&(0,R.set)(o,["placement","target"],"Male"===t.sex?e.replace("#VH","#VHM")+"_Patch":e.replace("#VH","#VHF")+"_Patch")}return o}getTissueBlock(){return(0,R.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function ce(t,n,r,i,o="",a=""){return e(this,void 0,void 0,function*(){let e;if("static"===n)e=yield fetch(t).then(e=>e.ok?e.json():void 0).catch(()=>{});else if("search-api"===n){const n={"Content-type":"application/json"};i&&i.length>0&&(n.Authorization=`Bearer ${i}`),e=yield fetch(t,{method:"POST",headers:n,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=r?r:{exists:{field:"rui_location"}}})}).then(e=>e.ok?e.json():void 0).catch(()=>{})}if(e)return function(e,t="",n="",r,i=!1){const o={},a=(0,R.get)(e,"hits.hits",[]).map(e=>(0,R.get)(e,"_source",{})).map(e=>new ue(e,t,n,r).toJsonLd());for(const u of a){const e=u["@id"];o[e]?o[e].samples.push(u.samples[0]):o[e]=u}const s=Object.values(o);return i&&(function(e){let t=[],n=0;for(const r of e.filter(e=>e.samples.length>1)){const e=r.samples;for(let r=0;re["@id"]===i)&&(e[r].deleteMe=!0,n++)}r.samples=e.filter(e=>!0!==e.deleteMe)}n>0&&console.log(`\u26a0 ${n} sections identified as blocks`)}(s),console.log(s.map(e=>Object.assign({"@context":se},e)))),{"@context":se,"@graph":s}}(e,o,a,i);console.warn(`Unable to load ${t} as HuBMAP Data`)})}function le(e,t,n){var r;const i=new Map,o=new Set;e.some(e=>{var n;return t.has(e.subject.id)&&(o.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,P.donor,null,null);const a=n(o),s=new Set;for(const u of a)for(const e of null!==(r=i.get(u))&&void 0!==r?r:[])s.add(e);return s}function de(e,t){return n=>e.has(n.id)?t.add(n.id):void 0}const fe={[F.ontologyNode.label.id]:"label",[F.ontologyNode.parent.id]:"parent",[F.ontologyNode.synonymLabels.id]:"synonymLabels"};function he(e,t){const n=a.DataFactory.namedNode(t),r={"@id":t,"@type":"OntologyTreeNode",id:t,parent:"",children:[],synonymLabels:[],label:""};return e.some(e=>{const t=fe[e.predicate.id];if(t){const n="Literal"===e.object.termType?(0,O.fromRdf)(e.object):e.object.id;"synonymLabels"===t?r.synonymLabels.push(n):(0,R.set)(r,t,n)}return!1},n,null,null,null),r.children=e.getSubjects(F.ontologyNode.children,n,null).map(e=>e.id),r}const pe={[P.label.id]:"label",[P.description.id]:"description",[P.link.id]:"link"},ge=Object.assign(Object.assign({},pe),{[P.providerName.id]:"providerName"}),ye=Object.assign(Object.assign({},pe),{[P.technology.id]:"technology",[P.thumbnail.id]:"thumbnail"}),me=Object.assign(Object.assign({},pe),{[P.sampleType.id]:"sampleType",[P.sectionNumber.id]:"sectionNumber",[P.datasets.id]:"datasets"}),be=Object.assign(Object.assign({},pe),{[P.sampleType.id]:"sampleType",[P.sectionCount.id]:"sectionCount",[P.sectionSize.id]:"sectionSize",[P.sectionUnits.id]:"sectionUnits",[P.donor.id]:"donor",[P.spatialEntity.id]:"spatialEntityId",[P.sections.id]:"sections",[P.datasets.id]:"datasets"}),ve=(0,R.memoize)(function(e,t){const n={"@id":t,"@type":"Donor"};return e.some(e=>{const t=ge[e.predicate.id];if(t){const r="Literal"===e.object.termType?(0,O.fromRdf)(e.object):e.object.id;(0,R.set)(n,t,r)}return!1},a.DataFactory.namedNode(t),null,null,null),n},(e,t)=>t);function _e(e,t){const n={"@id":t,"@type":"Dataset"};return e.some(e=>{const t=ye[e.predicate.id];if(t){const r="Literal"===e.object.termType?(0,O.fromRdf)(e.object):e.object.id;(0,R.set)(n,t,r)}return!1},a.DataFactory.namedNode(t),null,null,null),n}const we=(0,R.memoize)(function(e,t){const n={"@id":t,"@type":"Sample",sections:[],datasets:[]};return e.some(t=>{const r=be[t.predicate.id];if(r){const i="Literal"===t.object.termType?(0,O.fromRdf)(t.object):t.object.id;if("sections"===r){const t=function(e,t){const n={"@id":t,"@type":"Sample",datasets:[]};return e.some(t=>{const r=me[t.predicate.id];if(r){const i="Literal"===t.object.termType?(0,O.fromRdf)(t.object):t.object.id;if("datasets"===r){const t=_e(e,i);n[r].push(t)}else(0,R.set)(n,r,i)}return!1},a.DataFactory.namedNode(t),null,null,null),n}(e,i);n[r].push(t)}else if("datasets"===r){const t=_e(e,i);n[r].push(t)}else"donor"===r?n[r]=ve(e,i):(0,R.set)(n,r,i)}return!1},a.DataFactory.namedNode(t),null,null,null),n},(e,t)=>t),xe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},Se=Symbol("Comlink.proxy"),je=Symbol("Comlink.endpoint"),Ne=Symbol("Comlink.releaseProxy"),Ee=Symbol("Comlink.thrown"),Te=e=>"object"==typeof e&&null!==e||"function"==typeof e,Ie=new Map([["proxy",{canHandle:e=>Te(e)&&e[Se],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Ae(e,t),[n,[n]]},deserialize:e=>(e.start(),function(e,t){return Oe(e,[],void 0)}(e))}],["throw",{canHandle:e=>Te(e)&&Ee in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}}]]);function Ae(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;const{id:i,type:o,path:a}=Object.assign({path:[]},r.data),s=(r.data.argumentList||[]).map(Ce);let u;try{const t=a.slice(0,-1).reduce((e,t)=>e[t],e),n=a.reduce((e,t)=>e[t],e);switch(o){case"GET":u=n;break;case"SET":t[a.slice(-1)[0]]=Ce(r.data.value),u=!0;break;case"APPLY":u=n.apply(t,s);break;case"CONSTRUCT":u=function(e){return Object.assign(e,{[Se]:!0})}(new n(...s));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;Ae(e,n),u=function(e,t){return De.set(e,t),e}(t,[t])}break;case"RELEASE":u=void 0;break;default:return}}catch(c){u={value:c,[Ee]:0}}Promise.resolve(u).catch(e=>({value:e,[Ee]:0})).then(e=>{const[r,a]=Pe(e);t.postMessage(Object.assign(Object.assign({},r),{id:i}),a),"RELEASE"===o&&(t.removeEventListener("message",n),ke(t))})}),t.start&&t.start()}function ke(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function Re(e){if(e)throw new Error("Proxy has been released and is not useable")}function Oe(e,t=[],n=function(){}){let r=!1;const i=new Proxy(n,{get(n,o){if(Re(r),o===Ne)return()=>Fe(e,{type:"RELEASE",path:t.map(e=>e.toString())}).then(()=>{ke(e),r=!0});if("then"===o){if(0===t.length)return{then:()=>i};const n=Fe(e,{type:"GET",path:t.map(e=>e.toString())}).then(Ce);return n.then.bind(n)}return Oe(e,[...t,o])},set(n,i,o){Re(r);const[a,s]=Pe(o);return Fe(e,{type:"SET",path:[...t,i].map(e=>e.toString()),value:a},s).then(Ce)},apply(n,i,o){Re(r);const a=t[t.length-1];if(a===je)return Fe(e,{type:"ENDPOINT"}).then(Ce);if("bind"===a)return Oe(e,t.slice(0,-1));const[s,u]=Me(o);return Fe(e,{type:"APPLY",path:t.map(e=>e.toString()),argumentList:s},u).then(Ce)},construct(n,i){Re(r);const[o,a]=Me(i);return Fe(e,{type:"CONSTRUCT",path:t.map(e=>e.toString()),argumentList:o},a).then(Ce)}});return i}function Le(e){return Array.prototype.concat.apply([],e)}function Me(e){const t=e.map(Pe);return[t.map(e=>e[0]),Le(t.map(e=>e[1]))]}const De=new WeakMap;function Pe(e){for(const[t,n]of Ie)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:e},De.get(e)||[]]}function Ce(e){switch(e.type){case"HANDLER":return Ie.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Fe(e,t,n){return new Promise(r=>{const i=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.addEventListener("message",function t(n){!n.data||!n.data.id||n.data.id!==i||(e.removeEventListener("message",t),r(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}Ae(new class{constructor(e=xe){this.options=e,this.store=new a.Store(void 0,{factory:a.DataFactory}),this.graph=new Z(this),this.scene=new ee(this)}connect(t,n=!1){return e(this,void 0,void 0,function*(){return t&&(this.options=t),this.initializing||(this.initializing=n?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return e(this,void 0,void 0,function*(){const e=(new Date).getTime(),n="ccf-database.last_modified",r="ccf-database",a=yield o(n).catch(()=>{});let s;a&&e-new Date(+a).getTime()>36e5?yield function(e,n=i()){return n("readwrite",n=>(e.forEach(e=>n.delete(e)),t(n.transaction)))}([r,n]).catch(()=>{}):s=yield o(r).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(e,n=i()){return n("readwrite",n=>(e.forEach(e=>n.put(e[1],e[0])),t(n.transaction)))}([[r,this.serialize()],[n,""+e]]).catch(()=>{}))})}doConnect(){var t,n;return e(this,void 0,void 0,function*(){const e=[],r=null!==(n=null===(t=this.options.dataSources)||void 0===t?void 0:t.concat())&&void 0!==n?n:[],i=this.options.ccfOwlUrl;if(i.endsWith(".n3store.json")){const e=yield fetch(i).then(e=>e.text()).catch(()=>console.log("Couldn't locate serialized store."));e&&(this.store=(0,a.deserializeN3Store)(e,a.DataFactory))}else(null==i?void 0:i.length)>0&&r.push(i);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):e.push(ce(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(e=>{if(e)return this.addDataSources([e])}))),e.push(this.addDataSources(r)),yield Promise.all(e),yield this.synchronize()})}addDataSources(t,n){return e(this,void 0,void 0,function*(){const r=null!=n?n:this.store;return yield Promise.all(t.map(t=>e(this,void 0,void 0,function*(){"string"==typeof t?t.endsWith("jsonld")?yield(0,a.addJsonLdToStore)(t,r):t.endsWith("n3")?yield(0,a.addN3ToStore)(t,r):t.endsWith("rdf")||t.endsWith("owl")||t.endsWith("xml")?yield(0,a.addRdfXmlToStore)(t,r):yield(0,a.addJsonLdToStore)(t,r):yield(0,a.addJsonLdToStore)(t,r)}))),this})}synchronize(){return e(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,a.serializeN3Store)(this.store)}deserialize(t){return e(this,void 0,void 0,function*(){this.store=(0,a.deserializeN3Store)(t,a.DataFactory),this.graph=new Z(this),this.scene=new ee(this),yield new Promise(e=>{setTimeout(e,10)})})}getIds(e={}){return function(e,t){var n,r,i,o,s;let u=function(e){const t=new Set;return e.forSubjects(e=>t.add(e.id),P.spatialEntity,null,null),t}(e);if(u.size>0&&(u=function(e,t,n=!0){const r=new Set;if(e.forSubjects(de(t,r),P.spatialEntity,null,null),!n){const e=new Set;return t.forEach(t=>r.has(t)?void 0:e.add(t)),e}return r}(e,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const n=t.sex;u=le(e,u,t=>function(e,t,n){const r=new Set;return e.forSubjects(de(t,r),P.sex,P[n],null),r}(e,t,n))}if(u.size>0&&(null===(n=t.tmc)||void 0===n?void 0:n.length)>0&&(u=le(e,u,n=>function(e,t,n){const r=new Set;for(const i of n){const n=a.DataFactory.literal(i);e.forSubjects(de(t,r),P.providerName,n,null)}return r}(e,n,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(e,t,n){var r;const i=new Map,o=new Set,a=new Set;e.some(e=>(t.has(e.subject.id)&&a.add(e.object.id),!1),null,P.sections,null,null),e.some(e=>{var n;return(t.has(e.subject.id)||a.has(e.subject.id))&&(o.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,P.datasets,null,null);const s=n(o),u=new Set;for(const c of s)for(const e of null!==(r=i.get(c))&&void 0!==r?r:[])u.add(e);return u}(e,u,n=>function(e,t,n){const r=new Set;for(const i of n){const n=a.DataFactory.literal(i);e.forSubjects(de(t,r),P.technology,n,null)}return r}(e,n,t.technologies))),u.size>0&&(null===(i=t.ontologyTerms)||void 0===i?void 0:i.length)>0&&(u=function(e,t,n){var r;const i=new Map,o=new Set;e.some(e=>{var n;return t.has(e.subject.id)&&(o.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,P.spatialEntity,null,null);const a=n(o),s=new Set;for(const u of a)for(const e of null!==(r=i.get(u))&&void 0!==r?r:[])s.add(e);return s}(e,u,n=>function(e,t,n){const r=new Set;for(const i of n){const n=a.DataFactory.namedNode(i);e.forSubjects(de(t,r),F.spatialEntity.ccf_annotations,n,null)}return r}(e,n,t.ontologyTerms))),u.size>0&&2===(null===(o=t.ageRange)||void 0===o?void 0:o.length)&&(0,R.isFinite)(t.ageRange[0])&&(0,R.isFinite)(t.ageRange[1])){const n=Math.max(...t.ageRange),r=Math.min(...t.ageRange);1===r&&110===n||(u=le(e,u,t=>function(e,t,n,r){const i=new Set;return e.some(e=>{if(t.has(e.subject.id)){const t=(0,O.fromRdf)(e.object);t>=n&&t<=r&&i.add(e.subject.id)}return!1},null,P.age,null,null),i}(e,t,r,n)))}if(u.size>0&&2===(null===(s=t.bmiRange)||void 0===s?void 0:s.length)&&(0,R.isFinite)(t.bmiRange[0])&&(0,R.isFinite)(t.bmiRange[1])){const n=Math.max(...t.bmiRange),r=Math.min(...t.bmiRange);13===r&&83===n||(u=le(e,u,t=>function(e,t,n,r){const i=new Set;return e.some(e=>{if(t.has(e.subject.id)){const t=(0,O.fromRdf)(e.object);t>=n&&t<=r&&i.add(e.subject.id)}return!1},null,P.bmi,null,null),i}(e,t,r,n)))}return u}(this.store,e)}get(e){return this.store.getQuads(a.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(e=>this.get(e))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(e=>X(this.store,e))}getDatasetTechnologyNames(){return e(this,void 0,void 0,function*(){return function(e){const t=new Set;return e.some(e=>(t.add(e.object.value),!1),null,P.technology,null,null),Array.from(t).sort()}(this.store)})}getProviderNames(){return e(this,void 0,void 0,function*(){return function(e){const t=new Set;return e.some(e=>(t.add(e.object.value),!1),null,P.providerName,null,null),Array.from(t).sort()}(this.store)})}getTissueBlockResults(t){return e(this,void 0,void 0,function*(){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(e=>we(this.store,e))})}getAggregateResults(t){return e(this,void 0,void 0,function*(){return function(e,t){const n=new Set;t.some(t=>(e.has(t.subject.id)&&n.add(t.object.id),!1),null,P.donor,null,null);const r=new Set;t.some(e=>(n.has(e.subject.id)&&r.add(e.object.id),!1),null,P.providerUUID,null,null);const i=new Set;t.forSubjects(t=>{e.has(t.id)&&i.add(t.id)},P.spatialEntity,null,null);const o=new Set;t.some(e=>(i.has(e.subject.id)&&o.add(e.object.id),!1),null,P.sections,null,null);const a=new Set;return t.some(e=>{const t=e.subject;return(i.has(t.id)||o.has(t.id))&&a.add(e.object.id),!1},null,P.datasets,null,null),Object.entries({"Tissue Data Providers":r.size,Donors:n.size,"Tissue Blocks":i.size,"Tissue Sections":o.size,"Tissue Datasets":a.size}).map(([e,t])=>({label:e,count:t}))}(this.getIds(t),this.store)})}getOntologyTermOccurences(t){return e(this,void 0,void 0,function*(){return function(e,t){const n=new Map;t.some(t=>(e.has(t.subject.id)&&(n.has(t.object.id)?n.get(t.object.id).push(t.subject.id):n.set(t.object.id,[t.subject.id])),!1),null,P.spatialEntity,null,null);const r={};return t.some(e=>{var t,i;if(n.has(e.subject.id)){const o=null!==(i=null===(t=n.get(e.subject.id))||void 0===t?void 0:t.length)&&void 0!==i?i:0;r[e.object.id]=o+(r[e.object.id]||0)}return!1},null,F.spatialEntity.ccf_annotations,null,null),r}(this.getIds(t),this.store)})}getOntologyTreeModel(){return e(this,void 0,void 0,function*(){return function(e){const t={root:G.body.id,nodes:{}},n=new Set;e.some(e=>(n.add(e.subject.id),n.add(e.predicate.id),!1),null,F.ontologyNode.parent,null,null);for(const r of n)t.nodes[r]=he(e,r);return t}(this.store)})}getReferenceOrgans(){return e(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(t){return e(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(t)})}getReferenceOrganScene(t,n){return e(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(t,n)})}})}()}(); \ No newline at end of file diff --git a/10-es5.js b/10-es5.js index 18bb72414..e86666dd0 100644 --- a/10-es5.js +++ b/10-es5.js @@ -1 +1 @@ -!function(){function e(e,t){return r(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,a=[],o=!0,u=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(s){u=!0,i=s}finally{try{o||null==n.return||n.return()}finally{if(u)throw i}}return a}(e,t)||_(e,t)||n()}function t(e){return r(e)||v(e)||_(e)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(e){if(Array.isArray(e))return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function o(e){var t=f();return function(){var n,r=h(e);if(t){var i=h(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return l(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),d(r,e)})(e)}function l(e,t,n){return(l=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&d(i,n.prototype),i}).apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){return function(e){if(Array.isArray(e))return w(e)}(e)||v(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function _(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0?o-4:o;for(n=0;n>16&255,s[l++]=t>>8&255,s[l++]=255&t;return 2===u&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,s[l++]=255&t),1===u&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,s[l++]=t>>8&255,s[l++]=255&t),s},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,u=0,s=n-i;us?s:u+o));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=o.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function f(e,t,n){for(var r=[],i=t;i>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}n.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":4}],6:[function(e,t,n){(function(t){(function(){"use strict";var t=e("base64-js"),r=e("ieee754");n.Buffer=o,n.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},n.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|d(e,t),r=a(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function d(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return C(e).length;default:if(i)return r?-1:P(e).length;t=(""+t).toLowerCase(),i=!0}}function h(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return j(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function p(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),G(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){var a,o=1,u=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=n;au&&(n=u-s),a=n;a>=0;a--){for(var f=!0,d=0;di&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,n,r){return t.fromByteArray(0===n&&r===e.length?e:e.slice(n,r))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(s=(31&c)<<6|63&a)>127&&(l=s);break;case 3:o=e[i+2],128==(192&(a=e[i+1]))&&128==(192&o)&&(s=(15&c)<<12|(63&a)<<6|63&o)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:o=e[i+2],u=e[i+3],128==(192&(a=e[i+1]))&&128==(192&o)&&128==(192&u)&&(s=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,f=1):l>65535&&(r.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function A(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,i,a){return t=+t,n>>>=0,a||A(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function L(e,t,n,i,a){return t=+t,n>>>=0,a||A(e,0,n,8),r.write(e,t,n,i,52,8),n+8}n.kMaxLength=i,!(o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}())&&"undefined"!=typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.poolSize=8192,o.from=function(e,t,n){return u(e,t,n)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,o.alloc=function(e,t,n){return function(e,t,n){return s(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(B(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),B(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);it&&(e+=" ... "),""},o.prototype.compare=function(e,t,n,r,i){if(B(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),u=(n>>>=0)-(t>>>=0),s=Math.min(a,u),c=this.slice(r,i),l=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return m(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e],i=1,a=0;++a>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||I(e,4,this.length),r.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),r.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),r.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),r.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var a=0,o=1,u=0;for(this[t]=255&e;++a>0)-u&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var a=n-1,o=1,u=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===u&&0!==this[t+a+1]&&(u=1),this[t+a]=(e/o>>0)-u&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&0!==r&&(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function C(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(e,t,n){"use strict";t.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(function(t,n,r){return t+(0===r?"":",")+e(void 0===n||"symbol"==typeof n?null:n)},"")+"]":"{"+Object.keys(t).sort().reduce(function(n,r,i){return void 0===t[r]||"symbol"==typeof t[r]?n:n+(0===n.length?"":",")+e(r)+":"+e(t[r])},"")+"}"}},{}],8:[function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)})},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var s=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,a,o;if(c(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,function(e){console&&console.warn&&console.warn(e)}(u)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw u.context=o,u}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)a(s,this,t);else{var c=s.length,l=g(s,c);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return p(this,e,!0)},u.prototype.rawListeners=function(e){return p(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},{}],9:[function(e,t,n){n.read=function(e,t,n,r,i){var a,o,u=8*i-r-1,s=(1<>1,l=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-l)-1,h>>=-l,l+=u;l>0;a=256*a+e[t+f],f+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===s)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=c}return(h?-1:1)*o*Math.pow(2,a-r)},n.write=function(e,t,n,r,i,a){var o,u,s,c=8*a-i-1,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-o))<1&&(o--,s*=2),(t+=o+f>=1?d/s:d*Math.pow(2,1-f))*s>=2&&(o++,s/=2),o+f>=l?(u=0,o=l):o+f>=1?(u=(t*s-1)*Math.pow(2,i),o+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&u,h+=p,u/=256,i-=8);for(o=o<0;e[n+h]=255&o,h+=p,o/=256,c-=8);e[n+h-p]|=128*v}},{}],10:[function(e,t,n){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t,n){"use strict";var r=e("./types"),i=r.isArray,a=r.isObject,o=r.isString,u=e("./util").asArray,s=e("./url").prependBase,c=e("./JsonLdError"),l=e("./ResolvedContext");function d(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function h(e){var t=e.context,n=e.base;if(t){var r=t["@context"];if(o(r))t["@context"]=s(n,r);else if(i(r))for(var u=0;u10)){e.next=2;break}throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});case 2:if(!u.has(n)){e.next=4;break}throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:n});case 4:return u.add(n),e.prev=5,e.next=8,r(n);case 8:l=e.sent,s=l.document||null,o(s)&&(s=JSON.parse(s)),e.next=16;break;case 13:throw e.prev=13,e.t0=e.catch(5),new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:n,cause:e.t0});case 16:if(a(s)){e.next=18;break}throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:n});case 18:return e.abrupt("return",(s="@context"in s?{"@context":s["@context"]}:{"@context":{}},l.contextUrl&&(i(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(l.contextUrl)),{context:s,remoteDoc:l}));case 19:case"end":return e.stop()}},e,null,[[5,13]])}))()}}]),e}()},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(e,t,n){"use strict";t.exports=function(e){a(n,e);var t=o(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"An unspecified JSON-LD error occurred.",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"jsonld.Error",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return g(this,n),(e=t.call(this,r)).name=i,e.message=r,e.details=a,e}return n}(c(Error))},{}],13:[function(e,t,n){"use strict";t.exports=function(e){var t=function(){function e(){g(this,e)}return b(e,[{key:"toString",value:function(){return"[object JsonLdProcessor]"}}]),e}();return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],14:[function(e,t,n){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(e,t,n){"use strict";t.exports=function(){function e(){g(this,e),this._requests={}}return b(e,[{key:"wrapLoader",value:function(e){var t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}},{key:"add",value:function(e){var t=this;return f(regeneratorRuntime.mark(function n(){var r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!(r=t._requests[e])){n.next=3;break}return n.abrupt("return",Promise.resolve(r));case 3:return r=t._requests[e]=t._loader(e),n.prev=4,n.next=7,r;case 7:return n.abrupt("return",n.sent);case 8:return n.prev=8,delete t._requests[e],n.finish(8);case 11:case"end":return n.stop()}},n,null,[[4,,8,11]])}))()}}]),e}()},{}],16:[function(e,t,n){"use strict";var r=e("lru-cache");t.exports=function(){function e(t){var n=t.document;g(this,e),this.document=n,this.cache=new r({max:10})}return b(e,[{key:"getProcessed",value:function(e){return this.cache.get(e)}},{key:"setProcessed",value:function(e,t){this.cache.set(e,t)}}]),e}()},{"lru-cache":33}],17:[function(n,r,a){"use strict";var o,u=n("./JsonLdError"),s=n("./types"),c=s.isArray,l=s.isObject,d=s.isString,h=s.isUndefined,p=n("./graphTypes"),v=p.isList,g=p.isValue,y=p.isGraph,b=p.isSimpleGraph,_=p.isSubjectReference,w=n("./context"),x=w.expandIri,k=w.getContextValue,S=w.isKeyword,j=w.process,N=w.processingMode,E=n("./url"),T=E.removeBase,I=E.prependBase,R=n("./util"),A=R.addValue,O=R.asArray,L=R.compareShortestLeast,M={};function D(e,t,n){if("@nest"!==x(e,t,{vocab:!0},n))throw new u("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}r.exports=M,M.compact=(o=f(regeneratorRuntime.mark(function e(n){var r,a,o,s,f,p,w,x,E,T,I,R,L;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.activeCtx,a=n.activeProperty,o=void 0===a?null:a,s=n.element,f=n.options,p=void 0===f?{}:f,w=n.compactionMap,x=void 0===w?function(){}:w,!c(s)){e.next=21;break}E=[],T=0;case 4:if(!(T1&&(P=Array.from(P).sort()),C=r,F=m(P),e.prev=27,F.s();case 29:if((B=F.n()).done){e.next=39;break}if(G=B.value,U=M.compactIri({activeCtx:C,iri:G,relativeTo:{vocab:!0}}),V=k(R,U,"@context"),e.t1=h(V),e.t1){e.next=37;break}return e.next=36,j({activeCtx:r,localCtx:V,options:p,propagate:!1});case 36:r=e.sent;case 37:e.next=29;break;case 39:e.next=44;break;case 41:e.prev=41,e.t2=e.catch(27),F.e(e.t2);case 44:return e.prev=44,F.f(),e.finish(44);case 47:z=Object.keys(s).sort(),q=m(z),e.prev=49,q.s();case 51:if((K=q.n()).done){e.next=184;break}if(H=K.value,W=s[H],"@id"===H){e.next=180;break}if("@type"===H){e.next=174;break}if("@reverse"===H){e.next=167;break}if("@preserve"===H){e.next=161;break}if("@index"===H){e.next=155;break}if("@graph"===H||"@list"===H||"@included"===H||!S(H)){e.next=64;break}J=M.compactIri({activeCtx:r,iri:H,relativeTo:{vocab:!0}}),A(I,J,W),e.next=153;break;case 64:if(c(W)){e.next=66;break}throw new u("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");case 66:0===W.length&&(Q=M.compactIri({activeCtx:r,iri:H,value:W,relativeTo:{vocab:!0},reverse:T}),X=r.mappings.has(Q)?r.mappings.get(Q)["@nest"]:null,Y=I,X&&(D(r,X,p),l(I[X])||(I[X]={}),Y=I[X]),A(Y,Q,W,{propertyIsArray:!0})),Z=m(W),e.prev=68,Z.s();case 70:if(($=Z.n()).done){e.next=145;break}return ee=$.value,te=M.compactIri({activeCtx:r,iri:H,value:ee,relativeTo:{vocab:!0},reverse:T}),ne=r.mappings.has(te)?r.mappings.get(te)["@nest"]:null,re=I,ne&&(D(r,ne,p),l(I[ne])||(I[ne]={}),re=I[ne]),ie=k(r,te,"@container")||[],ae=y(ee),oe=v(ee),ue=void 0,oe?ue=ee["@list"]:ae&&(ue=ee["@graph"]),e.next=80,M.compact({activeCtx:r,activeProperty:te,element:oe||ae?ue:ee,options:p,compactionMap:x});case 80:if(se=e.sent,!oe){e.next=86;break}if(c(se)||(se=[se]),!ie.includes("@list")){e.next=85;break}return A(re,te,se,{valueIsArray:!0,allowDuplicate:!0}),e.abrupt("continue",143);case 85:se=i({},M.compactIri({activeCtx:r,iri:"@list",relativeTo:{vocab:!0}}),se),"@index"in ee&&(se[M.compactIri({activeCtx:r,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]);case 86:if(!ae){e.next=90;break}ie.includes("@graph")&&(ie.includes("@id")||ie.includes("@index")&&b(ee))?(ce=void 0,re.hasOwnProperty(te)?ce=re[te]:re[te]=ce={},le=(ie.includes("@id")?ee["@id"]:ee["@index"])||M.compactIri({activeCtx:r,iri:"@none",relativeTo:{vocab:!0}}),A(ce,le,se,{propertyIsArray:!p.compactArrays||ie.includes("@set")})):ie.includes("@graph")&&b(ee)?(c(se)&&se.length>1&&(se={"@included":se}),A(re,te,se,{propertyIsArray:!p.compactArrays||ie.includes("@set")})):(c(se)&&1===se.length&&p.compactArrays&&(se=se[0]),se=i({},M.compactIri({activeCtx:r,iri:"@graph",relativeTo:{vocab:!0}}),se),"@id"in ee&&(se[M.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}})]=ee["@id"]),"@index"in ee&&(se[M.compactIri({activeCtx:r,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]),A(re,te,se,{propertyIsArray:!p.compactArrays||ie.includes("@set")})),e.next=143;break;case 90:if(!(ie.includes("@language")||ie.includes("@index")||ie.includes("@id")||ie.includes("@type"))){e.next=141;break}if(fe=void 0,de=void 0,re.hasOwnProperty(te)?fe=re[te]:re[te]=fe={},!ie.includes("@language")){e.next=96;break}g(se)&&(se=se["@value"]),de=ee["@language"],e.next=138;break;case 96:if(!ie.includes("@index")){e.next=117;break}if(he=k(r,te,"@index")||"@index",pe=M.compactIri({activeCtx:r,iri:he,relativeTo:{vocab:!0}}),"@index"!==he){e.next=102;break}de=ee["@index"],delete se[pe],e.next=115;break;case 102:if(ye=void 0,ve=O(se[he]||[]),ge=t(ve),de=ge[0],ye=ge.slice(1),!d(de)){e.next=114;break}e.t3=ye.length,e.next=0===e.t3?107:1===e.t3?109:111;break;case 107:return delete se[he],e.abrupt("break",112);case 109:return se[he]=ye[0],e.abrupt("break",112);case 111:se[he]=ye;case 112:e.next=115;break;case 114:de=null;case 115:e.next=138;break;case 117:if(!ie.includes("@id")){e.next=122;break}be=M.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}}),de=se[be],delete se[be],e.next=138;break;case 122:if(!ie.includes("@type")){e.next=138;break}me=M.compactIri({activeCtx:r,iri:"@type",relativeTo:{vocab:!0}}),_e=void 0,e.t4=(n=O(se[me]||[]),a=t(n),de=a[0],(_e=a.slice(1)).length),e.next=0===e.t4?128:1===e.t4?130:132;break;case 128:return delete se[me],e.abrupt("break",133);case 130:return se[me]=_e[0],e.abrupt("break",133);case 132:se[me]=_e;case 133:if(e.t5=1===Object.keys(se).length&&"@id"in ee,!e.t5){e.next=138;break}return e.next=137,M.compact({activeCtx:r,activeProperty:te,element:{"@id":ee["@id"]},options:p,compactionMap:x});case 137:se=e.sent;case 138:de||(de=M.compactIri({activeCtx:r,iri:"@none",relativeTo:{vocab:!0}})),A(fe,de,se,{propertyIsArray:ie.includes("@set")}),e.next=143;break;case 141:we=!p.compactArrays||ie.includes("@set")||ie.includes("@list")||c(se)&&0===se.length||"@list"===H||"@graph"===H,A(re,te,se,{propertyIsArray:we});case 143:e.next=70;break;case 145:e.next=150;break;case 147:e.prev=147,e.t6=e.catch(68),Z.e(e.t6);case 150:return e.prev=150,Z.f(),e.finish(150);case 153:e.next=159;break;case 155:if(!(k(r,o,"@container")||[]).includes("@index")){e.next=157;break}return e.abrupt("continue",182);case 157:xe=M.compactIri({activeCtx:r,iri:H,relativeTo:{vocab:!0}}),A(I,xe,W);case 159:e.next=165;break;case 161:return e.next=163,M.compact({activeCtx:r,activeProperty:o,element:W,options:p,compactionMap:x});case 163:ke=e.sent,c(ke)&&0===ke.length||A(I,H,ke);case 165:e.next=172;break;case 167:return e.next=169,M.compact({activeCtx:r,activeProperty:"@reverse",element:W,options:p,compactionMap:x});case 169:for(je in Se=e.sent)r.mappings.has(je)&&r.mappings.get(je).reverse&&(Ne=Se[je],Ee=(k(r,je,"@container")||[]).includes("@set")||!p.compactArrays,A(I,je,Ne,{propertyIsArray:Ee}),delete Se[je]);Object.keys(Se).length>0&&(Te=M.compactIri({activeCtx:r,iri:H,relativeTo:{vocab:!0}}),A(I,Te,Se));case 172:e.next=178;break;case 174:1===(Ie=O(W).map(function(e){return M.compactIri({activeCtx:R,iri:e,relativeTo:{vocab:!0}})})).length&&(Ie=Ie[0]),Re=M.compactIri({activeCtx:r,iri:"@type",relativeTo:{vocab:!0}}),Ae=(k(r,Re,"@container")||[]).includes("@set")&&N(r,1.1)||c(Ie)&&0===W.length,A(I,Re,Ie,{propertyIsArray:Ae});case 178:e.next=182;break;case 180:1===(Oe=O(W).map(function(e){return M.compactIri({activeCtx:r,iri:e,relativeTo:{vocab:!1},base:p.base})})).length&&(Oe=Oe[0]),I[M.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}})]=Oe;case 182:e.next=51;break;case 184:e.next=189;break;case 186:e.prev=186,e.t7=e.catch(49),q.e(e.t7);case 189:return e.prev=189,q.f(),e.finish(189);case 192:return e.abrupt("return",{v:I});case 193:case"end":return e.stop()}},e,null,[[27,41,44,47],[49,186,189,192],[68,147,150,153]])})(),"t3",29);case 29:if("object"!=typeof(L=e.t3)){e.next=32;break}return e.abrupt("return",L.v);case 32:return e.abrupt("return",s);case 33:case"end":return e.stop()}},e)})),function(e){return o.apply(this,arguments)}),M.compactIri=function(t){var n=t.activeCtx,r=t.iri,i=t.value,a=void 0===i?null:i,o=t.relativeTo,s=void 0===o?{vocab:!1}:o,c=t.reverse,f=void 0!==c&&c,d=t.base,h=void 0===d?null:d;if(null===r)return r;n.isPropertyTermScoped&&n.previousContext&&(n=n.previousContext);var p=n.getInverse();if(S(r)&&r in p&&"@none"in p[r]&&"@type"in p[r]["@none"]&&"@none"in p[r]["@none"]["@type"])return p[r]["@none"]["@type"]["@none"];if(s.vocab&&r in p){var b=n["@language"]||"@none",_=[];l(a)&&"@index"in a&&!("@graph"in a)&&_.push("@index","@index@set"),l(a)&&"@preserve"in a&&(a=a["@preserve"][0]),y(a)?("@index"in a&&_.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in a&&_.push("@graph@id","@graph@id@set"),_.push("@graph","@graph@set","@set"),"@index"in a||_.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in a||_.push("@graph@id","@graph@id@set")):l(a)&&!g(a)&&_.push("@id","@id@set","@type","@set@type");var w="@language",x="@null";if(f)w="@type",x="@reverse",_.push("@set");else if(v(a)){"@index"in a||_.push("@list");var k=a["@list"];if(0===k.length)w="@any",x="@none";else{for(var j=0===k.length?b:null,N=null,E=0;E=0;--q){var K,H=G[q],W=m(H.terms);try{for(W.s();!(K=W.n()).done;){var J=K.value,Q=J+":"+r.substr(H.iri.length);n.mappings.get(J)._prefix&&(!n.mappings.has(Q)||null===a&&n.mappings.get(Q)["@id"]===r)&&(null===B||L(Q,B)<0)&&(B=Q)}}catch(te){W.e(te)}finally{W.f()}}if(null!==B)return B;var X,Y=m(n.mappings);try{for(Y.s();!(X=Y.n()).done;){var Z=e(X.value,2),$=Z[0],ee=Z[1];if(ee&&ee._prefix&&r.startsWith($+":"))throw new u('Absolute IRI "'.concat(r,'" confused with prefix "').concat($,'".'),"jsonld.SyntaxError",{code:"IRI confused with prefix",context:n})}}catch(te){Y.e(te)}finally{Y.f()}return s.vocab?r:"@base"in n?n["@base"]?T(I(h,n["@base"]),r):r:T(h,r)},M.compactValue=function(e){var t=e.activeCtx,n=e.activeProperty,r=e.value,a=e.options;if(g(r)){var o=k(t,n,"@type"),u=k(t,n,"@language"),s=k(t,n,"@direction"),c=k(t,n,"@container")||[],l="@index"in r&&!c.includes("@index");if(!l&&"@none"!==o&&(r["@type"]===o||"@language"in r&&r["@language"]===u&&"@direction"in r&&r["@direction"]===s||"@language"in r&&r["@language"]===u||"@direction"in r&&r["@direction"]===s))return r["@value"];var f=Object.keys(r).length,h=1===f||2===f&&"@index"in r&&!l,p="@language"in t,v=d(r["@value"]),y=t.mappings.has(n)&&null===t.mappings.get(n)["@language"];if(h&&"@none"!==o&&(!p||!v||y))return r["@value"];var b={};return l&&(b[M.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?b[M.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=M.compactIri({activeCtx:t,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(b[M.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(b[M.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),b[M.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],b}var m=x(t,n,{vocab:!0},a),_=k(t,n,"@type"),w=M.compactIri({activeCtx:t,iri:r["@id"],relativeTo:{vocab:"@vocab"===_},base:a.base});return"@id"===_||"@vocab"===_||"@graph"===m?w:i({},M.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}}),w)}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(e,t,n){"use strict";var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";t.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:r,RDF_LIST:r+"List",RDF_FIRST:r+"first",RDF_REST:r+"rest",RDF_NIL:r+"nil",RDF_TYPE:r+"type",RDF_PLAIN_LITERAL:r+"PlainLiteral",RDF_XML_LITERAL:r+"XMLLiteral",RDF_JSON_LITERAL:r+"JSON",RDF_OBJECT:r+"object",RDF_LANGSTRING:r+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}},{}],19:[function(t,n,r){"use strict";var i,a=t("./util"),o=t("./JsonLdError"),u=t("./types"),s=u.isArray,c=u.isObject,l=u.isString,d=u.isUndefined,h=t("./url"),v=h.isAbsolute,g=h.isRelative,y=h.prependBase,b=t("./util"),_=b.asArray,w=b.compareShortestLeast,x=new Map,k=/^@[a-zA-Z]+$/,S={};function j(e,t,n,r,i,a){if(null===t||!l(t)||S.isKeyword(t))return t;if(t.match(k))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&S.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:a}),(n=n||{}).vocab){var o=e.mappings.get(t);if(null===o)return null;if(c(o)&&"@id"in o)return o["@id"]}var u=t.indexOf(":");if(u>0){var s=t.substr(0,u),f=t.substr(u+1);if("_"===s||0===f.indexOf("//"))return t;r&&r.hasOwnProperty(s)&&S.createTermDefinition({activeCtx:e,localCtx:r,term:s,defined:i,options:a});var d=e.mappings.get(s);if(d&&d._prefix)return d["@id"]+f;if(v(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return y(y(a.base,e["@base"]),t)}else if(n.base)return y(a.base,t);return t}function N(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;var n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(var r=0;r0,"@reverse"in t){if("@id"in t)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:r});if("@nest"in t)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:r});var x=t["@reverse"];if(!l(x))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:r});if(!S.isKeyword(x)&&x.match(k))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:x}),void(g?n.mappings.set(i,g):n.mappings.delete(i));var E=j(n,x,{vocab:!0,base:!1},r,a,u);if(!v(E))throw new o("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:r});b["@id"]=E,b.reverse=!0}else if("@id"in t){var T=t["@id"];if(T&&!l(T))throw new o("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:r});if(null===T)b["@id"]=null;else{if(!S.isKeyword(T)&&T.match(k))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:T}),void(g?n.mappings.set(i,g):n.mappings.delete(i));if(T!==i){if(T=j(n,T,{vocab:!0,base:!1},r,a,u),!v(T)&&!S.isKeyword(T))throw new o("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:r});if(i.match(/(?::[^:])|\//)&&j(n,i,{vocab:!0,base:!1},r,new Map(a).set(i,!0),u)!==T)throw new o("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:r});b["@id"]=T,b._prefix=y&&!b._termHasColon&&T.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in b))if(b._termHasColon){var I=i.substr(0,w);if(r.hasOwnProperty(I)&&S.createTermDefinition({activeCtx:n,localCtx:r,term:I,defined:a,options:u}),n.mappings.has(I)){var R=i.substr(w+1);b["@id"]=n.mappings.get(I)["@id"]+R}else b["@id"]=i}else if("@type"===i)b["@id"]=i;else{if(!("@vocab"in n))throw new o("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:r,term:i});b["@id"]=n["@vocab"]+i}if((!0===t["@protected"]||!0===a.get("@protected")&&!1!==t["@protected"])&&(n.protected[i]=!0,b.protected=!0),a.set(i,!0),"@type"in t){var A=t["@type"];if(!l(A))throw new o("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:r});if("@json"===A||"@none"===A){if(S.processingMode(n,1))throw new o('Invalid JSON-LD syntax; an @context @type value must not be "'.concat(A,'" in JSON-LD 1.0 mode.'),"jsonld.SyntaxError",{code:"invalid type mapping",context:r})}else if("@id"!==A&&"@vocab"!==A){if(A=j(n,A,{vocab:!0,base:!1},r,a,u),!v(A))throw new o("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:r});if(0===A.indexOf("_:"))throw new o("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:r})}b["@type"]=A}if("@container"in t){var O=l(t["@container"])?[t["@container"]]:t["@container"]||[],L=["@list","@set","@index","@language"],M=!0,D=O.includes("@set");if(S.processingMode(n,1.1)){if(L.push("@graph","@id","@type"),O.includes("@list")){if(1!==O.length)throw new o("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:r})}else if(O.includes("@graph")){if(O.some(function(e){return"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e}))throw new o("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:r})}else M&=O.length<=(D?2:1);if(O.includes("@type")&&(b["@type"]=b["@type"]||"@id",!["@id","@vocab"].includes(b["@type"])))throw new o("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:r})}else M&=!s(t["@container"]),M&=O.length<=1;if(M&=O.every(function(e){return L.includes(e)}),!(M&=!(D&&O.includes("@list"))))throw new o("Invalid JSON-LD syntax; @context @container value must be one of the following: "+L.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:r});if(b.reverse&&!O.every(function(e){return["@index","@set"].includes(e)}))throw new o("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:r});b["@container"]=O}if("@index"in t){if(!("@container"in t)||!b["@container"].includes("@index"))throw new o('Invalid JSON-LD syntax; @index without @index in @container: "'.concat(t["@index"],'" on term "').concat(i,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:r});if(!l(t["@index"])||0===t["@index"].indexOf("@"))throw new o('Invalid JSON-LD syntax; @index must expand to an IRI: "'.concat(t["@index"],'" on term "').concat(i,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:r});b["@index"]=t["@index"]}if("@context"in t&&(b["@context"]=t["@context"]),"@language"in t&&!("@type"in t)){var P=t["@language"];if(null!==P&&!l(P))throw new o("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:r});null!==P&&(P=P.toLowerCase()),b["@language"]=P}if("@prefix"in t){if(i.match(/:|\//))throw new o("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:r});if(S.isKeyword(b["@id"]))throw new o("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:r});if("boolean"!=typeof t["@prefix"])throw new o("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:r});b._prefix=!0===t["@prefix"]}if("@direction"in t){var C=t["@direction"];if(null!==C&&"ltr"!==C&&"rtl"!==C)throw new o('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:r});b["@direction"]=C}if("@nest"in t){var F=t["@nest"];if(!l(F)||"@nest"!==F&&0===F.indexOf("@"))throw new o("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:r});b["@nest"]=F}var B=b["@id"];if("@context"===B||"@preserve"===B)throw new o("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:r});if(g&&g.protected&&!d&&(n.protected[i]=!0,b.protected=!0,!N(g,b))){var G=u&&u.protectedMode||"error";if("error"===G)throw new o('Invalid JSON-LD syntax; tried to redefine "'.concat(i,'" which is a protected term.'),"jsonld.SyntaxError",{code:"protected term redefinition",context:r,term:i});if("warn"===G)return void console.warn("WARNING: protected term redefinition",{term:i});throw new o("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:r,term:i,protectedMode:G})}},S.expandIri=function(e,t,n,r){return j(e,t,n,void 0,void 0,r)},S.getInitialContext=function(e){var t=JSON.stringify({processingMode:e.processingMode}),n=x.get(t);if(n)return n;var r={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){var e=this;if(e.inverse)return e.inverse;var t,n=e.inverse={},r=e.fastCurieMap={},a={},u=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],c=e.mappings,l=m(p(c.keys()).sort(w));try{for(l.s();!(t=l.n()).done;){var f=t.value,d=c.get(f);if(null!==d){var h=d["@container"]||"@none";if(h=[].concat(h).sort().join(""),null!==d["@id"]){var v,g=m(_(d["@id"]));try{for(g.s();!(v=g.n()).done;){var y=v.value,b=n[y],x=S.isKeyword(y);if(b)!x&&!d._termHasColon&&a[y].push(f);else if(n[y]=b={},!x&&!d._termHasColon){a[y]=[f];var k={iri:y,terms:a[y]};y[0]in r?r[y[0]].push(k):r[y[0]]=[k]}if(b[h]||(b[h]={"@language":{},"@type":{},"@any":{}}),o(f,(b=b[h])["@any"],"@none"),d.reverse)o(f,b["@type"],"@reverse");else if("@none"===d["@type"])o(f,b["@any"],"@none"),o(f,b["@language"],"@none"),o(f,b["@type"],"@none");else if("@type"in d)o(f,b["@type"],d["@type"]);else if("@language"in d&&"@direction"in d){var j=d["@language"],N=d["@direction"];o(f,b["@language"],j&&N?"".concat(j,"_").concat(N).toLowerCase():j?j.toLowerCase():N?"_".concat(N):"@null")}else"@language"in d?o(f,b["@language"],(d["@language"]||"@null").toLowerCase()):"@direction"in d?o(f,b["@language"],d["@direction"]?"_".concat(d["@direction"]):"@none"):s?(o(f,b["@language"],"_".concat(s)),o(f,b["@language"],"@none"),o(f,b["@type"],"@none")):(o(f,b["@language"],u),o(f,b["@language"],"@none"),o(f,b["@type"],"@none"))}}catch(T){g.e(T)}finally{g.f()}}}}}catch(T){l.e(T)}finally{l.f()}for(var E in r)i(r,E,1);return n},clone:function(){var e={};return e.mappings=a.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=a.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===x.size&&x.clear(),x.set(t,r),r;function i(e,t,n){var r,a,o,u=e[t],s=e[t]={},c=m(u);try{for(c.s();!(o=c.n()).done;){var l=o.value;(a=n>=(r=l.iri).length?"":r[n])in s?s[a].push(l):s[a]=[l]}}catch(d){c.e(d)}finally{c.f()}for(var f in s)""!==f&&i(s,f,n+1)}function o(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},S.getContextValue=function(e,t,n){if(null===t)return"@context"===n?void 0:null;if(e.mappings.has(t)){var r=e.mappings.get(t);if(d(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},S.processingMode=function(e,t){return t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode},S.isKeyword=function(e){if(!l(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(e,t,n){"use strict";var r=e("../util"),i=r.parseLinkHeader,a=r.buildHeaders,o=e("../constants").LINK_HEADER_CONTEXT,u=e("../JsonLdError"),s=e("../RequestQueue"),c=e("../url").prependBase,l=/(^|(\r\n))link:/i;function d(e,t,n){var r=new(e=e||XMLHttpRequest);return new Promise(function(e,i){for(var a in r.onload=function(){return e(r)},r.onerror=function(e){return i(e)},r.open("GET",t,!0),n)r.setRequestHeader(a,n[a]);r.send()})}t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{headers:{}},t=e.secure,n=e.headers,r=void 0===n?{}:n,h=e.xhr;return r=a(r),(new s).wrapLoader(p);function p(e){return v.apply(this,arguments)}function v(){return(v=f(regeneratorRuntime.mark(function e(n){var a,s,f,v,g,y,b;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===n.indexOf("http:")||0===n.indexOf("https:")){e.next=2;break}throw new u('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n});case 2:if(!t||0===n.indexOf("https")){e.next=4;break}throw new u('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n});case 4:return e.prev=4,e.next=7,d(h,n,r);case 7:a=e.sent,e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),new u("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n,cause:e.t0});case 13:if(!(a.status>=400)){e.next=15;break}throw new u("URL could not be dereferenced: "+a.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:n,httpStatusCode:a.status});case 15:if(s={contextUrl:null,documentUrl:n,document:a.response},f=null,v=a.getResponseHeader("Content-Type"),l.test(a.getAllResponseHeaders())&&(g=a.getResponseHeader("Link")),!g||"application/ld+json"===v){e.next=28;break}if(y=i(g),b=y[o],!Array.isArray(b)){e.next=21;break}throw new u("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n});case 21:if(b&&(s.contextUrl=b.target),f=y.alternate,e.t1=f&&"application/ld+json"==f.type&&!(v||"").match(/^application\/(\w*\+)?json$/),!e.t1){e.next=28;break}return e.next=27,p(c(n,f.target));case 27:s=e.sent;case 28:return e.abrupt("return",s);case 29:case"end":return e.stop()}},e,null,[[4,10]])}))).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(t,n,r){"use strict";var i=t("./JsonLdError"),a=t("./types"),o=a.isArray,u=a.isObject,s=a.isEmptyObject,c=a.isString,l=a.isUndefined,d=t("./graphTypes"),h=d.isList,p=d.isValue,v=d.isGraph,g=d.isSubject,y=t("./context"),b=y.expandIri,_=y.getContextValue,w=y.isKeyword,x=y.process,k=y.processingMode,S=t("./url").isAbsolute,j=t("./util"),N=j.addValue,E=j.asArray,T=j.getValues,I=j.validateTypeValue,R={};n.exports=R;var A,O=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function L(e){return M.apply(this,arguments)}function M(){return(M=f(regeneratorRuntime.mark(function t(n){var r,a,f,d,v,y,j,T,A,M,D,F,B,G,U,V,z,q,K,H,W,J,Q,X,Y,Z,$,ee,te,ne,re,ie,ae,oe,ue,se,ce,le,fe,de,he,pe,ve,ge,ye,be,me,_e,we,xe,ke,Se,je;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=n.activeCtx,a=n.activeProperty,f=n.expandedActiveProperty,d=n.element,v=n.expandedParent,y=n.options,j=void 0===y?{}:y,T=n.insideList,A=n.typeKey,M=n.typeScopedContext,D=n.expansionMap,F=Object.keys(d).sort(),B=[],U=d[A]&&"@json"===b(r,o(d[A])?d[A][0]:d[A],{vocab:!0},j),V=m(F),t.prev=4,V.s();case 6:if((z=V.n()).done){t.next=187;break}if(q=z.value,K=void 0,H=d[q],"@context"!==q){t.next=11;break}return t.abrupt("continue",185);case 11:if(null!==(W=b(r,q,{vocab:!0},j))&&(S(W)||w(W))||void 0!==(W=D({unmappedProperty:q,activeCtx:r,activeProperty:a,parent:d,options:j,insideList:T,value:H,expandedParent:v}))){t.next=14;break}return t.abrupt("continue",185);case 14:if(!w(W)){t.next=19;break}if("@reverse"!==f){t.next=17;break}throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:H});case 17:if(!(W in v)||"@included"===W||"@type"===W){t.next=19;break}throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:W});case 19:if("@id"!==W){t.next=34;break}if(c(H)){t.next=32;break}if(j.isFrame){t.next=23;break}throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:H});case 23:if(!u(H)){t.next=28;break}if(s(H)){t.next=26;break}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:H});case 26:t.next=32;break;case 28:if(o(H)){t.next=30;break}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:H});case 30:if(H.every(function(e){return c(e)})){t.next=32;break}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:H});case 32:return N(v,"@id",E(H).map(function(e){return c(e)?b(r,e,{base:!0},j):e}),{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 34:if("@type"!==W){t.next=37;break}return u(H)&&(H=Object.fromEntries(Object.entries(H).map(function(t){var n=e(t,2),r=n[0],i=n[1];return[b(M,r,{vocab:!0}),E(i).map(function(e){return b(M,e,{base:!0,vocab:!0})})]}))),I(H,j.isFrame),N(v,"@type",E(H).map(function(e){return c(e)?b(M,e,{base:!0,vocab:!0},j):e}),{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 37:if("@included"!==W||!k(r,1.1)){t.next=47;break}return t.t0=E,t.next=41,R.expand({activeCtx:r,activeProperty:a,element:H,options:j,expansionMap:D});case 41:if(t.t1=t.sent,(J=(0,t.t0)(t.t1)).every(function(e){return g(e)})){t.next=45;break}throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:H});case 45:return N(v,"@included",J,{propertyIsArray:!0}),t.abrupt("continue",185);case 47:if("@graph"!==W||u(H)||o(H)){t.next=49;break}throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:H});case 49:if("@value"!==W){t.next=52;break}return G=H,U&&k(r,1.1)?v["@value"]=H:N(v,"@value",H,{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 52:if("@language"!==W){t.next=62;break}if(null!==H){t.next=55;break}return t.abrupt("continue",185);case 55:if(c(H)||j.isFrame){t.next=57;break}throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:H});case 57:H=E(H).map(function(e){return c(e)?e.toLowerCase():e}),Q=m(H);try{for(Q.s();!(X=Q.n()).done;)Y=X.value,c(Y)&&!Y.match(O)&&console.warn("@language must be valid BCP47: ".concat(Y))}catch(Ne){Q.e(Ne)}finally{Q.f()}return N(v,"@language",H,{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 62:if("@direction"!==W){t.next=85;break}if(c(H)||j.isFrame){t.next=65;break}throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:H});case 65:H=E(H),Z=m(H),t.prev=67,Z.s();case 69:if(($=Z.n()).done){t.next=75;break}if(ee=$.value,!c(ee)||"ltr"===ee||"rtl"===ee){t.next=73;break}throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:H});case 73:t.next=69;break;case 75:t.next=80;break;case 77:t.prev=77,t.t2=t.catch(67),Z.e(t.t2);case 80:return t.prev=80,Z.f(),t.finish(80);case 83:return N(v,"@direction",H,{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 85:if("@index"!==W){t.next=90;break}if(c(H)){t.next=88;break}throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:H});case 88:return N(v,"@index",H),t.abrupt("continue",185);case 90:if("@reverse"!==W){t.next=118;break}if(u(H)){t.next=93;break}throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:H});case 93:return t.next=95,R.expand({activeCtx:r,activeProperty:"@reverse",element:H,options:j,expansionMap:D});case 95:if(!("@reverse"in(K=t.sent))){t.next=98;break}for(te in K["@reverse"])N(v,te,K["@reverse"][te],{propertyIsArray:!0});case 98:ne=v["@reverse"]||null,t.t3=regeneratorRuntime.keys(K);case 100:if((t.t4=t.t3()).done){t.next=117;break}if("@reverse"!==(re=t.t4.value)){t.next=104;break}return t.abrupt("continue",100);case 104:null===ne&&(ne=v["@reverse"]={}),N(ne,re,[],{propertyIsArray:!0}),ie=K[re],ae=0;case 107:if(!(ae1?X.slice().sort():X:[X],Z=m(Y),e.prev=81,Z.s();case 83:if(($=Z.n()).done){e.next=93;break}if(ee=$.value,te=_(j,ee,"@context"),e.t5=l(te),e.t5){e.next=91;break}return e.next=90,x({activeCtx:n,localCtx:te,options:h,propagate:!1});case 90:n=e.sent;case 91:e.next=83;break;case 93:e.next=98;break;case 95:e.prev=95,e.t6=e.catch(81),Z.e(e.t6);case 98:return e.prev=98,Z.f(),e.finish(98);case 101:e.next=75;break;case 103:e.next=108;break;case 105:e.prev=105,e.t7=e.catch(73),W.e(e.t7);case 108:return e.prev=108,W.f(),e.finish(108);case 111:return ne={},e.next=114,L({activeCtx:n,activeProperty:a,expandedActiveProperty:F,element:f,expandedParent:ne,options:h,insideList:v,typeKey:H,typeScopedContext:j,expansionMap:I});case 114:if(G=Object.keys(ne),re=G.length,!("@value"in ne)){e.next=137;break}if(!("@type"in ne)||!("@language"in ne)&&!("@direction"in ne)){e.next=119;break}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:ne});case 119:if(ie=re-1,"@type"in ne&&(ie-=1),"@index"in ne&&(ie-=1),"@language"in ne&&(ie-=1),"@direction"in ne&&(ie-=1),0===ie){e.next=122;break}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:ne});case 122:if(ae=null===ne["@value"]?[]:E(ne["@value"]),oe=T(ne,"@type"),k(n,1.1)&&oe.includes("@json")&&1===oe.length){e.next=135;break}if(0!==ae.length){e.next=131;break}return e.next=127,I({unmappedValue:ne,activeCtx:n,activeProperty:a,element:f,options:h,insideList:v});case 127:ue=e.sent,ne=void 0!==ue?ue:null,e.next=135;break;case 131:if(ae.every(function(e){return c(e)||s(e)})||!("@language"in ne)){e.next=133;break}throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:ne});case 133:if(oe.every(function(e){return S(e)&&!(c(e)&&0===e.indexOf("_:"))||s(e)})){e.next=135;break}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:ne});case 135:e.next=152;break;case 137:if(!("@type"in ne)||o(ne["@type"])){e.next=141;break}ne["@type"]=[ne["@type"]],e.next=152;break;case 141:if(!("@set"in ne)&&!("@list"in ne)){e.next=147;break}if(!(re>1)||2===re&&"@index"in ne){e.next=144;break}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:ne});case 144:"@set"in ne&&(ne=ne["@set"],G=Object.keys(ne),re=G.length),e.next=152;break;case 147:if(1!==re||!("@language"in ne)){e.next=152;break}return e.next=150,I(ne,{unmappedValue:ne,activeCtx:n,activeProperty:a,element:f,options:h,insideList:v});case 150:se=e.sent,ne=void 0!==se?se:null;case 152:if(!u(ne)||h.keepFreeFloatingNodes||v||null!==a&&"@graph"!==F||!(0===re||"@value"in ne||"@list"in ne||1===re&&"@id"in ne)){e.next=157;break}return e.next=155,I({unmappedValue:ne,activeCtx:n,activeProperty:a,element:f,options:h,insideList:v});case 155:ce=e.sent,ne=void 0!==ce?ce:null;case 157:return e.abrupt("return",ne);case 158:case"end":return e.stop()}},e,null,[[38,53,56,59],[73,105,108,111],[81,95,98,101]])})),function(e){return A.apply(this,arguments)})},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(e,t,n){"use strict";var r=e("./graphTypes").isSubjectReference,i=e("./nodeMap").createMergedNodeMap,a={};t.exports=a,a.flatten=function(e){for(var t=i(e),n=[],a=Object.keys(t).sort(),o=0;o=0;--r){var i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function g(e,t,n){var r="@"+n,i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function y(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new c("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0]){var t,n=m(u.asArray(e[0]["@id"]));try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!o.isObject(r)&&!s.isAbsolute(r)||o.isString(r)&&0===r.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(f){n.e(f)}finally{n.f()}}if("@type"in e[0]){var i,a=m(u.asArray(e[0]["@type"]));try{for(a.s();!(i=a.n()).done;){var l=i.value;if(!o.isObject(l)&&!s.isAbsolute(l)||o.isString(l)&&0===l.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(f){a.e(f)}finally{a.f()}}}function b(e,t,n,i){var s=!0,c=!1;for(var l in n){var f=!1,d=u.getValues(t,l),h=0===u.getValues(n,l).length;if("@id"===l){if(o.isEmptyObject(n["@id"][0]||{})?f=!0:n["@id"].length>=0&&(f=n["@id"].includes(d[0])),!i.requireAll)return f}else if("@type"===l){if(s=!1,h){if(d.length>0)return!1;f=!0}else if(1===n["@type"].length&&o.isEmptyObject(n["@type"][0]))f=d.length>0;else{var p,v=m(n["@type"]);try{var g=function(){var e=p.value;f=!(!o.isObject(e)||!("@default"in e))||f||d.some(function(t){return t===e})};for(v.s();!(p=v.n()).done;)g()}catch(_){v.e(_)}finally{v.f()}}if(!i.requireAll)return f}else{if(r(l))continue;var b=function(){var t=u.getValues(n,l)[0],r=!1;if(t&&(y([t]),r="@default"in t),s=!1,0===d.length&&r)return"continue";if(d.length>0&&h)return{v:!1};if(void 0===t){if(d.length>0)return{v:!1};f=!0}else if(a.isList(t)){var c=t["@list"][0];if(a.isList(d[0])){var p=d[0]["@list"];a.isValue(c)?f=p.some(function(e){return S(c,e)}):(a.isSubject(c)||a.isSubjectReference(c))&&(f=p.some(function(t){return k(e,c,t,i)}))}}else f=a.isValue(t)?d.some(function(e){return S(t,e)}):a.isSubjectReference(t)?d.some(function(n){return k(e,t,n,i)}):!!o.isObject(t)&&d.length>0}();if("continue"===b)continue;if("object"==typeof b)return b.v}if(!f&&i.requireAll)return!1;c=c||f}return s||c}function _(e,t){var n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,a=r.property,s={"@id":t};if(o.isArray(i)){for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:null;y(n);var f=e.options,d={embed:g(n=n[0],f,"embed"),explicit:g(n,f,"explicit"),requireAll:g(n,f,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});var w,k=e.link[e.graph],j=function(e,t,n,r){var i,a={},o=m(t);try{for(o.s();!(i=o.n()).done;){var u=i.value,s=e.graphMap[e.graph][u];b(e,s,n,r)&&(a[u]=s)}}catch(c){o.e(c)}finally{o.f()}return a}(e,t,n,d),N=Object.keys(j).sort(),E=m(N);try{var T=function(){var y=w.value,b=j[y];if(null===l?e.uniqueEmbeds=i({},e.graph,{}):e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===d.embed&&y in k)return x(s,l,k[y]),"continue";var N={"@id":y};if(0===y.indexOf("_:")&&u.addValue(e.bnodeMap,y,N,{propertyIsArray:!0}),k[y]=N,("@first"===d.embed||"@last"===d.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(y)){if(e.embedded&&("@never"===d.embed||v(b,e.graph,e.subjectStack)))return x(s,l,N),"continue";if(e.embedded&&("@first"==d.embed||"@once"==d.embed)&&e.uniqueEmbeds[e.graph].hasOwnProperty(y))return x(s,l,N),"continue";if("@last"===d.embed&&y in e.uniqueEmbeds[e.graph]&&_(e,y),e.uniqueEmbeds[e.graph][y]={parent:s,property:l},e.subjectStack.push({subject:b,graph:e.graph}),y in e.graphMap){var E=!1,T=null;"@graph"in n?(T=n["@graph"][0],E=!("@merged"===y||"@default"===y),o.isObject(T)||(T={})):(E="@merged"!==e.graph,T={}),E&&h.frame(R(I({},e),{graph:y,embedded:!1}),Object.keys(e.graphMap[y]).sort(),[T],N,"@graph")}"@included"in n&&h.frame(R(I({},e),{embedded:!1}),t,n["@included"],N,"@included");var A,O=m(Object.keys(b).sort());try{for(O.s();!(A=O.n()).done;){var L=A.value;if(r(L)){if(N[L]=u.clone(b[L]),"@type"===L){var M,D=m(b["@type"]);try{for(D.s();!(M=D.n()).done;){var P=M.value;0===P.indexOf("_:")&&u.addValue(e.bnodeMap,P,N,{propertyIsArray:!0})}}catch(ie){D.e(ie)}finally{D.f()}}}else if(!d.explicit||L in n){var C,F=m(b[L]);try{for(F.s();!(C=F.n()).done;){var B=C.value,G=L in n?n[L]:p(d);if(a.isList(B)){var U=n[L]&&n[L][0]&&n[L][0]["@list"]?n[L][0]["@list"]:p(d),V={"@list":[]};x(N,L,V);var z,q=m(B["@list"]);try{for(q.s();!(z=q.n()).done;){var K=z.value;a.isSubjectReference(K)?h.frame(R(I({},e),{embedded:!0}),[K["@id"]],U,V,"@list"):x(V,"@list",u.clone(K))}}catch(ie){q.e(ie)}finally{q.f()}}else a.isSubjectReference(B)?h.frame(R(I({},e),{embedded:!0}),[B["@id"]],G,N,L):S(G[0],B)&&x(N,L,u.clone(B))}}catch(ie){F.e(ie)}finally{F.f()}}}}catch(ie){O.e(ie)}finally{O.f()}var H,W=m(Object.keys(n).sort());try{for(W.s();!(H=W.n()).done;){var J=H.value;if("@type"===J){if(!o.isObject(n[J][0])||!("@default"in n[J][0]))continue}else if(r(J))continue;var Q=n[J][0]||{};if(!g(Q,f,"omitDefault")&&!(J in N)){var X="@null";"@default"in Q&&(X=u.clone(Q["@default"])),o.isArray(X)||(X=[X]),N[J]=[{"@preserve":X}]}}}catch(ie){W.e(ie)}finally{W.f()}var Y,Z=m(Object.keys(n["@reverse"]||{}).sort());try{for(Z.s();!(Y=Z.n()).done;)for(var $=Y.value,ee=n["@reverse"][$],te=0,ne=Object.keys(e.subjects);te0&&(i["@language"]=l,l.match(x)||console.warn("@language must be valid BCP47: ".concat(l))),i["@direction"]=f}else o!==w&&(i["@type"]=o)}return i}n.exports=k,k.fromRDF=(i=f(regeneratorRuntime.mark(function e(t,n){var r,i,a,c,f,g,y,b,_,w,x,k,j,N,E,T,I,R,A,O,L,M,D,P,C,F,B,G,U,V,z,q,K,H,W,J,Q,X,Y,Z,$,ee,te,ne,re,ie,ae,oe,ue;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=n.useRdfType,i=void 0!==r&&r,a=n.useNativeTypes,c=void 0!==a&&a,f=n.rdfDirection,g=void 0===f?null:f,b={"@default":y={}},_={},w=m(t),e.prev=3,w.s();case 5:if((x=w.n()).done){e.next=19;break}if(k=x.value,(j="DefaultGraph"===k.graph.termType?"@default":k.graph.value)in b||(b[j]={}),"@default"!==j&&!(j in y)&&(y[j]={"@id":j}),N=b[j],E=k.subject.value,T=k.predicate.value,I=k.object,E in N||(N[E]={"@id":E}),R=N[E],(A=I.termType.endsWith("Node"))&&!(I.value in N)&&(N[I.value]={"@id":I.value}),T!==v||i||!A){e.next=15;break}return s.addValue(R,"@type",I.value,{propertyIsArray:!0}),e.abrupt("continue",17);case 15:O=S(I,c,g),s.addValue(R,T,O,{propertyIsArray:!0}),A&&(I.value===p?("usages"in(L=N[I.value])||(L.usages=[]),L.usages.push({node:R,property:T,value:O})):_[I.value]=!(I.value in _)&&{node:R,property:T,value:O});case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(3),w.e(e.t0);case 24:return e.prev=24,w.f(),e.finish(24);case 27:e.t1=regeneratorRuntime.keys(b);case 28:if((e.t2=e.t1()).done){e.next=37;break}if(M=e.t2.value,D=b[M],p in D){e.next=33;break}return e.abrupt("continue",28);case 33:if((P=D[p]).usages){C=m(P.usages);try{for(C.s();!(F=C.n()).done;){for(B=F.value,G=B.node,U=B.property,V=B.value,z=[],q=[],K=Object.keys(G).length;U===h&&u.isObject(_[G["@id"]])&&u.isArray(G[d])&&1===G[d].length&&u.isArray(G[h])&&1===G[h].length&&(3===K||4===K&&u.isArray(G["@type"])&&1===G["@type"].length&&G["@type"][0]===l)&&(z.push(G[d][0]),q.push(G["@id"]),B=_[G["@id"]],G=B.node,U=B.property,V=B.value,K=Object.keys(G).length,o.isBlankNode(G)););for(delete V["@id"],V["@list"]=z.reverse(),H=0,W=q;H1||!("@id"in e))},i.isSubjectReference=function(e){return r.isObject(e)&&1===Object.keys(e).length&&"@id"in e},i.isValue=function(e){return r.isObject(e)&&"@value"in e},i.isList=function(e){return r.isObject(e)&&"@list"in e},i.isGraph=function(e){return r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(function(e){return"@id"!==e&&"@index"!==e}).length},i.isSimpleGraph=function(e){return i.isGraph(e)&&!("@id"in e)},i.isBlankNode=function(e){return!!r.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))}},{"./types":30}],26:[function(e,t,n){var r=e("rdf-canonize"),i=e("./platform"),a=e("./util"),o=e("./ContextResolver"),u=a.IdentifierIssuer,s=e("./JsonLdError"),c=e("lru-cache"),l=e("./NQuads"),d=e("./expand").expand,h=e("./flatten").flatten,p=e("./fromRdf").fromRDF,v=e("./toRdf").toRDF,g=e("./frame"),y=g.frameMergedOrDefault,b=g.cleanupNull,_=e("./types"),w=_.isArray,x=_.isObject,k=_.isString,S=e("./graphTypes").isSubjectReference,T=e("./context"),R=T.expandIri,A=T.getInitialContext,O=T.process,L=T.processingMode,M=e("./compact"),D=M.compact,P=M.compactIri,C=e("./nodeMap"),F=C.createNodeMap,B=C.createMergedNodeMap,G=C.mergeNodeMaps,U=function(t){var n,g={},_=new c({max:100});function T(e,n){var r=n,i=r.documentLoader,a=void 0===i?t.documentLoader:i,o=function(e,t){var n={};for(var r in e)N.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&j){var i,a=m(j(e));try{for(a.s();!(i=a.n()).done;)r=i.value,t.indexOf(r)<0&&E.call(e,r)&&(n[r]=e[r])}catch(o){a.e(o)}finally{a.f()}}return n}(r,["documentLoader"]);return Object.assign({},{documentLoader:a},o,e)}return t.compact=(n=f(regeneratorRuntime.mark(function e(n,r,i){var c,l,f,d,h,p,v,g,y,b,m=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.length<2)){e.next=2;break}throw new TypeError("Could not compact, too few arguments.");case 2:if(null!==r){e.next=4;break}throw new s("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});case 4:if(null!==n){e.next=6;break}return e.abrupt("return",null);case 6:if((i=T(i,{base:k(n)?n:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new u("_:b"),contextResolver:new o({sharedCache:_})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,!i.skipExpansion){e.next=12;break}e.t0=n,e.next=15;break;case 12:return e.next=14,t.expand(n,i);case 14:e.t0=e.sent;case 15:return c=e.t0,e.next=18,t.processContext(A(i),r,i);case 18:return l=e.sent,e.next=21,D({activeCtx:l,element:c,options:i,compactionMap:i.compactionMap});case 21:f=e.sent,i.compactArrays&&!i.graph&&w(f)?1===f.length?f=f[0]:0===f.length&&(f={}):i.graph&&x(f)&&(f=[f]),x(r)&&"@context"in r&&(r=r["@context"]),r=a.clone(r),w(r)||(r=[r]),d=r,r=[];for(h=0;h0)&&r.push(d[h]);if(p=r.length>0,1===r.length&&(r=r[0]),w(f))v=P({activeCtx:l,iri:"@graph",relativeTo:{vocab:!0}}),g=f,f={},p&&(f["@context"]=r),f[v]=g;else if(x(f)&&p)for(b in y=f,f={"@context":r},y)f[b]=y[b];return e.abrupt("return",f);case 29:case"end":return e.stop()}},e)})),function(e,t,r){return n.apply(this,arguments)}),t.expand=function(){var e=f(regeneratorRuntime.mark(function e(n,r){var i,u,s,c,l,f,h,p,v,g,y=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(y.length<1)){e.next=2;break}throw new TypeError("Could not expand, too few arguments.");case 2:if(!1===(r=T(r,{keepFreeFloatingNodes:!1,contextResolver:new o({sharedCache:_})})).expansionMap&&(r.expansionMap=void 0),i={},u=[],"expandContext"in r&&(s=a.clone(r.expandContext),i.expandContext=x(s)&&"@context"in s?s:{"@context":s},u.push(i.expandContext)),!k(n)){e.next=12;break}return e.next=8,t.get(n,r);case 8:l=e.sent,c=l.documentUrl,i.input=l.document,l.contextUrl&&(i.remoteContext={"@context":l.contextUrl},u.push(i.remoteContext)),e.next=13;break;case 12:i.input=a.clone(n);case 13:"base"in r||(r.base=c||""),f=A(r),h=0,p=u;case 16:if(!(h=1e21)},r.isEmptyObject=function(e){return r.isObject(e)&&0===Object.keys(e).length},r.isNumber=function(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)},r.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},r.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},r.isString=function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},r.isUndefined=function(e){return void 0===e}},{}],31:[function(e,t,n){"use strict";var r=e("./types"),i={};t.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=function(e,t){for(var n={},r=i.parsers[t||"full"],a=r.regex.exec(e),o=r.keys.length;o--;)n[r.keys[o]]=void 0===a[o]?null:a[o];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=function(e,t){if(null===e||i.isAbsolute(t))return t;(!e||r.isString(e))&&(e=i.parse(e||""));var n=i.parse(t),a={protocol:e.protocol||""};if(null!==n.authority)a.authority=n.authority,a.path=n.path,a.query=n.query;else if(a.authority=e.authority,""===n.path)a.path=e.path,a.query=null!==n.query?n.query:e.query;else{if(0===n.path.indexOf("/"))a.path=n.path;else{var o=e.path;((o=o.substr(0,o.lastIndexOf("/")+1)).length>0||e.authority)&&"/"!==o.substr(-1)&&(o+="/"),o+=n.path,a.path=o}a.query=n.query}""!==n.path&&(a.path=i.removeDotSegments(a.path));var u=a.protocol;return null!==a.authority&&(u+="//"+a.authority),u+=a.path,null!==a.query&&(u+="?"+a.query),null!==n.fragment&&(u+="#"+n.fragment),""===u&&(u="./"),u},i.removeBase=function(e,t){if(null===e)return t;(!e||r.isString(e))&&(e=i.parse(e||""));var n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;for(var a=i.parse(t.substr(n.length)),o=e.normalizedPath.split("/"),u=a.normalizedPath.split("/"),s=a.fragment||a.query?0:1;o.length>0&&u.length>s&&o[0]===u[0];)o.shift(),u.shift();var c="";if(o.length>0){o.pop();for(var l=0;l0;){var r=t.shift(),i=0===t.length;"."!==r?".."!==r?n.push(r):(n.pop(),i&&n.push("")):i&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};var a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=function(e){return r.isString(e)&&a.test(e)},i.isRelative=function(e){return r.isString(e)}},{"./types":30}],32:[function(t,n,r){"use strict";var i=t("./graphTypes"),a=t("./types"),o=t("rdf-canonize").IdentifierIssuer,u=t("./JsonLdError"),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,l=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,f="application/ld+json, application/json",d={};function h(e,t){if(a.isArray(t))for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(Object.keys(e).some(function(e){return"accept"===e.toLowerCase()}))throw new RangeError('Accept header may not be specified; only "'+f+'" is supported.');return Object.assign({Accept:f},e)},d.parseLinkHeader=function(e){for(var t={},n=e.match(s),r=0;r0}return!1},d.hasValue=function(e,t,n){if(d.hasProperty(e,t)){var r=e[t],o=i.isList(r);if(a.isArray(r)||o){o&&(r=r["@list"]);for(var u=0;ut.maxAge:e[s]&&n>e[s]},m=function(e){if(e[a]>e[i])for(var t=e[f].tail;e[a]>e[i]&&null!==t;){var n=t.prev;_(e,t),t=n}},_=function(e,t){if(t){var n=t.value;e[c]&&e[c](n.key,n.value),e[a]-=n.length,e[d].delete(n.key),e[f].removeNode(t)}},w=function e(t,n,r,i,a){g(this,e),this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=a||0},x=function(e,t,n,r){var i=n.value;y(e,i)&&(_(e,n),e[u]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};t.exports=function(){function e(t){if(g(this,e),"number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;var n=t.length||p;if(this[o]="function"!=typeof n?p:n,this[u]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[s]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[h]=t.updateAgeOnGet||!1,this.reset()}return b(e,[{key:"max",get:function(){return this[i]},set:function(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,m(this)}},{key:"allowStale",get:function(){return this[u]},set:function(e){this[u]=!!e}},{key:"maxAge",get:function(){return this[s]},set:function(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[s]=e,m(this)}},{key:"lengthCalculator",get:function(){return this[o]},set:function(e){var t=this;"function"!=typeof e&&(e=p),e!==this[o]&&(this[o]=e,this[a]=0,this[f].forEach(function(e){e.length=t[o](e.value,e.key),t[a]+=e.length})),m(this)}},{key:"length",get:function(){return this[a]}},{key:"itemCount",get:function(){return this[f].length}},{key:"rforEach",value:function(e,t){t=t||this;for(var n=this[f].tail;null!==n;){var r=n.prev;x(this,e,n,t),n=r}}},{key:"forEach",value:function(e,t){t=t||this;for(var n=this[f].head;null!==n;){var r=n.next;x(this,e,n,t),n=r}}},{key:"keys",value:function(){return this[f].toArray().map(function(e){return e.key})}},{key:"values",value:function(){return this[f].toArray().map(function(e){return e.value})}},{key:"reset",value:function(){var e=this;this[c]&&this[f]&&this[f].length&&this[f].forEach(function(t){return e[c](t.key,t.value)}),this[d]=new Map,this[f]=new r,this[a]=0}},{key:"dump",value:function(){var e=this;return this[f].map(function(t){return!y(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}}).toArray().filter(function(e){return e})}},{key:"dumpLru",value:function(){return this[f]}},{key:"set",value:function(e,t,n){if((n=n||this[s])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,u=this[o](t,e);if(this[d].has(e)){if(u>this[i])return _(this,this[d].get(e)),!1;var h=this[d].get(e).value;return this[c]&&(this[l]||this[c](e,h.value)),h.now=r,h.maxAge=n,h.value=t,this[a]+=u-h.length,h.length=u,this.get(e),m(this),!0}var p=new w(e,t,u,r,n);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[a]+=p.length,this[f].unshift(p),this[d].set(e,this[f].head),m(this),!0)}},{key:"has",value:function(e){if(!this[d].has(e))return!1;var t=this[d].get(e).value;return!y(this,t)}},{key:"get",value:function(e){return v(this,e,!0)}},{key:"peek",value:function(e){return v(this,e,!1)}},{key:"pop",value:function(){var e=this[f].tail;return e?(_(this,e),e.value):null}},{key:"del",value:function(e){_(this,this[d].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var a=i-t;a>0&&this.set(r.k,r.v,a)}}}},{key:"prune",value:function(){var e=this;this[d].forEach(function(t,n){return v(e,n,!1)})}}]),e}()},{yallist:92}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",a="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:"".concat(i,"decimal"),boolean:"".concat(i,"boolean"),double:"".concat(i,"double"),integer:"".concat(i,"integer"),string:"".concat(i,"string")},rdf:{type:"".concat(r,"type"),nil:"".concat(r,"nil"),first:"".concat(r,"first"),rest:"".concat(r,"rest"),langString:"".concat(r,"langString")},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:"".concat(a,"reify#forSome"),forAll:"".concat(a,"reify#forAll")},log:{implies:"".concat(a,"log#implies")}}},{}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function e(t,n){if(n=n||m,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===m)return new x(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));var r=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,r-1),"@"===t[r+1]?t.substr(r+2):n.namedNode(t.substr(r+3)));case"<":var i=y.exec(t);return n.quad(e(T(i[1]),n),e(T(i[2]),n),e(T(i[3]),n),i[4]&&e(T(i[4]),n));default:return n.namedNode(t)}},n.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof _&&"Quad"!==t.termType)return t.id;if(!t)return i.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return"_:".concat(t.value);case"Variable":return"?".concat(t.value);case"DefaultGraph":return"";case"Literal":return'"'.concat(t.value,'"').concat(t.language?"@".concat(t.language):t.datatype&&t.datatype.value!==h.string?"^^".concat(t.datatype.value):"");case"Quad":return"<<".concat(E(e(t.subject))," ").concat(E(e(t.predicate))," ").concat(E(e(t.object))).concat((0,l.isDefaultGraph)(t.graph)?"":" ".concat(e(t.graph)),">>");default:throw new Error("Unexpected termType: ".concat(t.termType))}},n.escapeQuotes=E,n.unescapeQuotes=T,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var r,i,c=(r=e("./IRIs"))&&r.__esModule?r:{default:r},l=e("./N3Util"),f=c.default,d=f.rdf,h=f.xsd,p=0,v=/^"(.*".*)(?="[^"]*$)/,y=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,m={namedNode:function(e){return new w(e)},blankNode:function(e){return new k(e||"n3-"+p++)},variable:function(e){return new S(e)},literal:function(e,t){if("string"==typeof t)return new x('"'.concat(e,'"@').concat(t.toLowerCase()));var n=t?t.value:"";return""===n&&("boolean"==typeof e?n=h.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?h.integer:h.double:(n=h.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new x(""===n||n===h.string?'"'.concat(e,'"'):'"'.concat(e,'"^^').concat(n))},defaultGraph:function(){return i},quad:I,triple:I};n.default=m;var _=function(){function e(t){g(this,e),this.id=t}return b(e,[{key:"value",get:function(){return this.id}},{key:"equals",value:function(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}},{key:"toJSON",value:function(){return{termType:this.termType,value:this.value}}}]),e}();n.Term=_;var w=function(e){a(n,e);var t=o(n);function n(){return g(this,n),t.apply(this,arguments)}return b(n,[{key:"termType",get:function(){return"NamedNode"}}]),n}(_);n.NamedNode=w;var x=function(e){a(n,e);var t=o(n);function n(){return g(this,n),t.apply(this,arguments)}return b(n,[{key:"termType",get:function(){return"Literal"}},{key:"value",get:function(){return this.id.substring(1,this.id.lastIndexOf('"'))}},{key:"language",get:function(){var e=this.id,t=e.lastIndexOf('"')+1;return t\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},f=/$0^/;n.default=function(){function e(t){if(g(this,e),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]*)?$/,this._lineMode=!!(t=t||{}).lineMode)for(var n in this._n3Mode=!1,this)!(n in l)&&this[n]instanceof RegExp&&(this[n]=f);else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}return b(e,[{key:"_tokenizeToEnd",value:function(e,t){for(var n,r=this._input,i=this._comments;;){for(var a=void 0,u=void 0;a=this._newline.exec(r);)i&&(u=this._comment.exec(a[0]))&&e(null,{line:this._line,type:"comment",value:u[1],prefix:""}),r=r.substr(a[0].length,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&&(i&&(u=this._comment.exec(r))&&e(null,{line:this._line,type:"comment",value:u[1],prefix:""}),e(r=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=r;var s=this._line,l=r[0],f="",d="",h="",p=null,v=0,g=!1;switch(l){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(v=1,f="^");break}if(this._previousMarker="^^","<"!==(r=r.substr(2))[0]){g=!0;break}case"<":if(p=this._unescapedIri.exec(r))f="IRI",d=p[1];else if(p=this._iri.exec(r)){if(null===(d=this._unescape(p[1]))||c.test(d))return m(this);f="IRI"}else r.length>1&&"<"===r[1]?(f="<<",v=2):this._n3Mode&&r.length>1&&"="===r[1]&&(f="inverse",v=2,d=">");break;case">":r.length>1&&">"===r[1]&&(f=">>",v=2);break;case"_":((p=this._blank.exec(r))||t&&(p=this._blank.exec("".concat(r," "))))&&(f="blank",h="_",d=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(r))d=p[1];else if(d=(n=this._parseLiteral(r)).value,v=n.matchLength,null===d)return m(this);(null!==p||0!==v)&&(f="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){var y;if(p=this._simpleApostropheString.exec(r))d=p[1];else if(d=(y=this._parseLiteral(r)).value,v=y.matchLength,null===d)return m(this);(null!==p||0!==v)&&(f="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(r))&&(f="var",d=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(r))?(f="langcode",d=p[1]):(p=this._keyword.exec(r))&&(f=p[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){f=".",v=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(r)||t&&(p=this._number.exec("".concat(r," "))))&&(f="literal",d=p[0],h="string"==typeof p[1]?o.double:"string"==typeof p[2]?o.decimal:o.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(r))?f=p[0].toUpperCase():g=!0;break;case"f":case"t":(p=this._boolean.exec(r))?(f="literal",d=p[0],h=o.boolean):g=!0;break;case"a":(p=this._shortPredicates.exec(r))?(f="abbreviation",d="a"):g=!0;break;case"=":this._n3Mode&&r.length>1&&(f="abbreviation",">"!==r[1]?(v=1,d="="):(v=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(v=1,f=l);break;default:g=!0}if(g&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(r))?((p=this._prefixed.exec(r))||t&&(p=this._prefixed.exec("".concat(r," "))))&&(f="prefixed",h=p[1]||"",d=this._unescape(p[2])):(f="prefix",d=p[1]||"")),"^^"===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)?m(this):this._input=r;var b={line:s,type:f,value:d,prefix:h};e(null,b),this.previousToken=b,this._previousMarker=f,r=r.substr(v||p[0].length,r.length)}function m(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}},{key:"_unescape",value:function(e){var t=!1,n=e.replace(u,function(e,n,r,i){if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){var a=Number.parseInt(r,16);return a<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((a-=65536)>>10),56320+(1023&a))}return i in s?s[i]:(t=!0,"")});return t?null:n}},{key:"_parseLiteral",value:function(e){if(e.length>=3){for(var t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length,r=Math.max(this._literalClosingPos,n);(r=e.indexOf(t,r))>0;){for(var i=0;"\\"===e[r-i-1];)i++;if(i%2==0){var a=e.substring(n,r),o=a.split(/\r\n|\r|\n/).length-1,u=r+n;if(1===n&&0!==o||3===n&&this._lineMode)break;return this._line+=o,{value:this._unescape(a),matchLength:u}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}},{key:"_syntaxError",value:function(e){this._input=null;var t=new Error('Unexpected "'.concat(e,'" on line ').concat(this._line,"."));return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}},{key:"_readStartingBom",value:function(e){return e.startsWith("\ufeff")?e.substr(1):e}},{key:"tokenize",value:function(e,n){var r=this;if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof n){var a,o=[];if(this._tokenizeToEnd(function(e,t){return e?a=e:o.push(t)},!0),a)throw a;return o}(0,i.default)(function(){return r._tokenizeToEnd(n,!0)})}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",function(e){null!==r._input&&0!==e.length&&(r._pendingBuffer&&(e=t.concat([r._pendingBuffer,e]),r._pendingBuffer=null),128&e[e.length-1]?r._pendingBuffer=e:(void 0===r._input?r._input=r._readStartingBom("string"==typeof e?e:e.toString()):r._input+=e,r._tokenizeToEnd(n,!1)))}),e.on("end",function(){"string"==typeof r._input&&r._tokenizeToEnd(n,!0)}),e.on("error",n)}}]),e}()}).call(this)}).call(this,e("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./N3Lexer")),i=o(e("./N3DataFactory")),a=o(e("./IRIs"));function o(e){return e&&e.__esModule?e:{default:e}}var u=0,s=function(){function e(t){g(this,e),this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&l(this,t.factory);var n="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",i=/turtle/.test(n),a=/trig/.test(n),o=/triple/.test(n),u=/quad/.test(n),s=this._n3Mode=/n3/.test(n),c=o||u;(this._supportsNamedGraphs=!(i||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||a||o||s),this._supportsRDFStar=""===n||/star|\*$/.test(n),c&&(this._resolveRelativeIRI=function(e){return null}),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new r.default({lineMode:c,n3:s}),this._explicitQuantifiers=!!t.explicitQuantifiers}return b(e,[{key:"_setBase",value:function(e){if(e){var t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}},{key:"_saveContext",value:function(e,t,n,r,i){var a=this._n3Mode;this._contextStack.push({subject:n,predicate:r,object:i,graph:t,type:e,inverse:!!a&&this._inversePredicate,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?"".concat(this._graph.id.substr(2),"."):".",this._quantified=Object.create(this._quantified))}},{key:"_restoreContext",value:function(){var e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}},{key:"_readInTopContext",value:function(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}},{key:"_readEntity",value:function(e,t){var n;switch(e.type){case"IRI":case"typeIRI":var r=this._resolveIRI(e.value);if(null===r)return this._error("Invalid IRI",e);n=this._namedNode(r);break;case"type":case"prefixed":var i=this._prefixes[e.prefix];if(void 0===i)return this._error('Undefined prefix "'.concat(e.prefix,':"'),e);n=this._namedNode(i+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error("Expected entity but got ".concat(e.type),e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}},{key:"_readSubject",value:function(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}},{key:"_readPredicate",value:function(e){var t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected ".concat(t),e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}},{key:"_readObject",value:function(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}},{key:"_readPredicateOrNamedGraph",value:function(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}},{key:"_readGraph",value:function(e){return"{"!==e.type?this._error("Expected graph but got ".concat(e.type),e):(this._graph=this._subject,this._subject=null,this._readSubject)}},{key:"_readBlankNodeHead",value:function(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}},{key:"_readBlankNodeTail",value:function(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);var t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}},{key:"_readPredicateAfterBlank",value:function(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}},{key:"_readListItem",value:function(e){var t=null,n=null,r=this._readListItem,i=this._subject,a=this._contextStack,o=a[a.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),r=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==a.length&&"list"===a[a.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),r=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===i?null===o.predicate?o.subject=n:o.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return r}},{key:"_readDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!1)}},{key:"_readListItemDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!0)}},{key:"_completeLiteral",value:function(e){var t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":var n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}},{key:"_completeSubjectLiteral",value:function(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}},{key:"_completeObjectLiteral",value:function(e,t){var n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}},{key:"_readFormulaTail",value:function(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}},{key:"_readPunctuation",value:function(e){var t,n=this._graph,r=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}if(null!==r){var a=this._predicate,o=this._object;i?this._emit(o,a,r,n):this._emit(r,a,o,n)}return t}},{key:"_readBlankNodePunctuation",value:function(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}},{key:"_readQuadPunctuation",value:function(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}},{key:"_readPrefix",value:function(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}},{key:"_readPrefixIRI",value:function(e){if("IRI"!==e.type)return this._error('Expected IRI to follow prefix "'.concat(this._prefix,':"'),e);var t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}},{key:"_readBaseIRI",value:function(e){var t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}},{key:"_readNamedGraphLabel",value:function(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)}}},{key:"_readNamedGraphBlankLabel",value:function(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}},{key:"_readDeclarationPunctuation",value:function(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}},{key:"_readQuantifierList",value:function(e){var t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error("Unexpected ".concat(e.type),e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}},{key:"_readQuantifierPunctuation",value:function(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))}},{key:"_getPathReader",value:function(e){return this._afterPath=e,this._readPath}},{key:"_readPath",value:function(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){var r=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,r,this._graph)}return this._afterPath(e)}}},{key:"_readForwardPath",value:function(e){var t,n,r=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}},{key:"_readBackwardPath",value:function(e){var t,n,r=this._blankNode();if(void 0!==(t=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=r):(n=this._object,this._object=r),this._emit(r,t,n,this._graph),this._readPath}},{key:"_readRDFStarTailOrGraph",value:function(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error('Expected >> to follow "'.concat(this._object.id,'"'),e):this._readRDFStarTail(e)}},{key:"_readRDFStarTail",value:function(e){if(">>"!==e.type)return this._error("Expected >> but got ".concat(e.type),e);var t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}},{key:"_getContextEndReader",value:function(){var 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}}},{key:"_emit",value:function(e,t,n,r){this._callback(null,this._quad(e,t,n,r||this.DEFAULTGRAPH))}},{key:"_error",value:function(e,t){var n=new Error("".concat(e," on line ").concat(t.line,"."));n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}},{key:"_resolveIRI",value:function(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}},{key:"_resolveRelativeIRI",value:function(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)}}},{key:"_removeDotSegments",value:function(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;for(var t=e.length,n="",r=-1,i=-1,a=0,o="/";r=i&&(n=n.substr(0,a)),"/"!==o)return"".concat(n,"/").concat(e.substr(r+1));a=r+1}}}o=e[++r]}return n+e.substring(a)}},{key:"parse",value:function(e,t,n){var r=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):"b".concat(u++,"_"),this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){var i,a=[];if(this._callback=function(e,t){e?i=e:t&&a.push(t)},this._lexer.tokenize(e).every(function(e){return r._readCallback=r._readCallback(e)}),i)throw i;return a}this._callback=t,this._lexer.tokenize(e,function(e,t){null!==e?(r._callback(e),r._callback=c):r._readCallback&&(r._readCallback=r._readCallback(t))})}}],[{key:"_resetBlankNodePrefix",value:function(){u=0}}]),e}();function c(){}function l(e,t){var n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(a.default.rdf.first),e.RDF_REST=n(a.default.rdf.rest),e.RDF_NIL=n(a.default.rdf.nil),e.N3_FORALL=n(a.default.r.forAll),e.N3_FORSOME=n(a.default.r.forSome),e.ABBREVIATIONS={a:n(a.default.rdf.type),"=":n(a.default.owl.sameAs),">":n(a.default.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=s,l(s.prototype,i.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(e("./N3DataFactory")),u=e("readable-stream"),c=(r=e("./IRIs"))&&r.__esModule?r:{default:r};function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}var f=function(e){function t(e,n){g(this,t),this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!n&&e&&!e[0]&&(n=e,e=null),this._factory=(n=n||{}).factory||i.default,e&&this.addQuads(e)}return b(t,[{key:"size",get:function(){var e=this._size;if(null!==e)return e;e=0;var t,n,r=this._graphs;for(var i in r)for(var a in t=r[i].subjects)for(var o in n=t[a])e+=Object.keys(n[o]).length;return this._size=e}},{key:"_addToIndex",value:function(e,t,n,r){var i=e[t]||(e[t]={}),a=i[n]||(i[n]={}),o=r in a;return o||(a[r]=null),!o}},{key:"_removeFromIndex",value:function(e,t,n,r){var i=e[t],a=i[n];for(var o in delete a[r],a)return;for(var u in delete i[n],i)return;delete e[t]}},{key:"_findInIndex",value:function(e,t,n,r,a,o,u,s,c,l){var f,d,h,p=!t+!n+!r>1?Object.keys(this._ids):this._entities;for(var v in t&&((f=e,e={})[t]=f[t]),e){var g=p[v];if(d=e[v])for(var y in n&&((f=d,d={})[n]=f[n]),d){var b=p[y];if(h=d[y])for(var m=(r?r in h?[r]:[]:Object.keys(h)),_=0;_0&&void 0!==arguments[0]?arguments[0]:{},n=t.remove,r=void 0!==n&&n,i=t.ignoreErrors,a=void 0!==i&&i,o={},u=a?function(){return!0}:function(e,t){throw new Error("".concat(e.value," ").concat(t))},s=this.getQuads(null,c.default.rdf.rest,c.default.rdf.nil,null),l=r?p(s):[];return s.forEach(function(t){for(var n,i,a=[],s=!1,f=t.graph,d=t.subject;d&&!s;){for(var h=e.getQuads(null,null,d,null),p=e.getQuads(d,null,null,null),v=void 0,g=null,y=null,b=null,m=0;m")}},{key:"_encodeLiteral",value:function(e){var t=e.value;if(p.test(t)&&(t=t.replace(v,_)),e.language)return'"'.concat(t,'"@').concat(e.language);if(this._lineMode){if(e.datatype.value===h.string)return'"'.concat(t,'"')}else switch(e.datatype.value){case h.string:return'"'.concat(t,'"');case h.boolean:if("true"===t||"false"===t)return t;break;case h.integer:if(/^[+-]?\d+$/.test(t))return t;break;case h.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case h.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return'"'.concat(t,'"^^').concat(this._encodeIriOrBlank(e.datatype))}},{key:"_encodePredicate",value:function(e){return e.value===d.type?"a":this._encodeIriOrBlank(e)}},{key:"_encodeObject",value:function(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}},{key:"_encodeQuad",value:function(e){var t=e.subject,n=e.predicate,r=e.object,i=e.graph;return"<<".concat(this._encodeSubject(t)," ").concat(this._encodePredicate(n)," ").concat(this._encodeObject(r)).concat((0,s.isDefaultGraph)(i)?"":" ".concat(this._encodeIriOrBlank(i)),">>")}},{key:"_blockedWrite",value:function(){throw new Error("Cannot write because the writer has been closed.")}},{key:"addQuad",value:function(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,l,r):this._writeQuad(e,t,n,r||l,i)}},{key:"addQuads",value:function(e){for(var t=0;t.\n"))}if(n){var a="",o="";for(var u in this._prefixIRIs)a+=a?"|".concat(u):u,o+=(o?"|":"")+this._prefixIRIs[u];a=a.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:".concat(o,")[^/]*$|^(").concat(a,")([a-zA-Z][\\-_a-zA-Z0-9]*)$"))}this._write(n?"\n":"",t)}},{key:"blank",value:function(e,t){var n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new m("[]");case 1:if(!((n=i[0]).object instanceof m))return new m("[ ".concat(this._encodePredicate(n.predicate)," ").concat(this._encodeObject(n.object)," ]"));default:for(var a="[",o=0;o1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:new Map,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;g(this,e),this.prefix=t,this._existing=n,this.counter=r}return b(e,[{key:"clone",value:function(){var t=this.prefix,n=this._existing,r=this.counter;return new e(t,new Map(n),r)}},{key:"getId",value:function(e){var t=e&&this._existing.get(e);if(t)return t;var n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}},{key:"hasId",value:function(e){return this._existing.has(e)}},{key:"getOldIds",value:function(){return p(this._existing.keys())}}]),e}()},{}],48:[function(e,t,n){"use strict";e("setimmediate");var r=self.crypto||self.msCrypto;t.exports=function(){function e(t){if(g(this,e),!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error('Unsupport algorithm "'.concat(t,'".'));this.algorithm={name:"SHA-1"}}this._content=""}return b(e,[{key:"update",value:function(e){this._content+=e}},{key:"digest",value:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var n,i,a,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(new TextEncoder).encode(e._content),t.t0=Uint8Array,t.next=4,r.subtle.digest(e.algorithm,n);case 4:for(t.t1=t.sent,i=new t.t0(t.t1),a="",o=0;o]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))'+r+"$"),t.exports=function(){function e(){g(this,e)}return b(e,null,[{key:"parse",value:function(e){var t,n=[],r={},d=0,p=m(e.split(l.eoln));try{for(p.s();!(t=p.n()).done;){var v=t.value;if(d++,!l.empty.test(v)){var g=v.match(l.quad);if(null===g)throw new Error("N-Quads parse error on line "+d+".");var y={subject:null,predicate:null,object:null,graph:null};if(y.subject=void 0!==g[1]?{termType:o,value:g[1]}:{termType:u,value:g[2]},y.predicate={termType:o,value:g[3]},void 0!==g[4]?y.object={termType:o,value:g[4]}:void 0!==g[5]?y.object={termType:u,value:g[5]}:(y.object={termType:s,value:void 0,datatype:{termType:o}},void 0!==g[7]?y.object.datatype.value=g[7]:void 0!==g[8]?(y.object.datatype.value=i,y.object.language=g[8]):y.object.datatype.value=a,y.object.value=g[6].replace(h,function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")})),y.graph=void 0!==g[9]?{termType:o,value:g[9]}:void 0!==g[10]?{termType:u,value:g[10]}:{termType:c,value:""},y.graph.value in r){var b,_=!0,w=r[y.graph.value],x=m(w);try{for(x.s();!(b=x.n()).done;){if(f(b.value,y)){_=!1;break}}}catch(k){x.e(k)}finally{x.f()}_&&(w.push(y),n.push(y))}else r[y.graph.value]=[y],n.push(y)}}}catch(k){p.e(k)}finally{p.f()}return n}},{key:"serialize",value:function(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));var n,r=[],i=m(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(e.serializeQuad(a))}}catch(o){i.e(o)}finally{i.f()}return r.sort().join("")}},{key:"serializeQuad",value:function(e){var t=e.subject,n=e.object,r=e.graph,s="";return s+=t.termType===o?"<".concat(t.value,">"):"".concat(t.value),s+=" <".concat(e.predicate.value,"> "),n.termType===o?s+="<".concat(n.value,">"):n.termType===u?s+=n.value:(s+='"'.concat(n.value.replace(d,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}),'"'),n.datatype.value===i?n.language&&(s+="@".concat(n.language)):n.datatype.value!==a&&(s+="^^<".concat(n.datatype.value,">"))),r.termType===o?s+=" <".concat(r.value,">"):r.termType===u&&(s+=" ".concat(r.value)),s+=" .\n"}},{key:"legacyDatasetToQuads",value:function(e){var t=[],n={"blank node":u,IRI:o,literal:s},r=function(r){e[r].forEach(function(e){var l={};for(var f in e){var d=e[f],h={termType:n[d.type],value:d.value};h.termType===s&&(h.datatype={termType:o},"datatype"in d&&(h.datatype.value=d.datatype),"language"in d?("datatype"in d||(h.datatype.value=i),h.language=d.language):"datatype"in d||(h.datatype.value=a)),l[f]=h}l.graph="@default"===r?{termType:c,value:""}:{termType:r.startsWith("_:")?u:o,value:r},t.push(l)})};for(var l in e)r(l);return t}}]),e}();var d=/["\\\n\r]/g,h=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(e,t,n){"use strict";t.exports=function(){function e(t){g(this,e),this.current=t.sort(),this.done=!1,this.dir=new Map;for(var n=0;nr)&&(s&&o>0&&u>e[o-1]||!s&&oe[o+1])&&(r=u,i=o)}if(null===r)this.done=!0;else{var c=t.get(r)?i-1:i+1;e[i]=e[c],e[c]=r;var l,f=m(e);try{for(f.s();!(l=f.n()).done;){var d=l.value;d>r&&t.set(d,!t.get(d))}}catch(h){f.e(h)}finally{f.f()}}return n}}]),e}()},{}],51:[function(e,t,n){(function(n){(function(){"use strict";var r=e("./IdentifierIssuer"),i=e("./MessageDigest"),a=e("./Permuter"),o=e("./NQuads");function u(e,t){return e.hasht.hash?1:0}t.exports=function(){function e(){g(this,e),this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}return b(e,[{key:"main",value:function(e){var t=this;return f(regeneratorRuntime.mark(function n(){var i,a,s,c,l,f,d,h,v,g,y,b,_,w,x,k,S,j,N,E,T,R,A,O,L,M,D,P,C,F,B,G,U,V,z,q;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:t.quads=e,i=m(e);try{for(i.s();!(a=i.n()).done;)s=a.value,t._addBlankNodeQuadInfo({quad:s,component:s.subject}),t._addBlankNodeQuadInfo({quad:s,component:s.object}),t._addBlankNodeQuadInfo({quad:s,component:s.graph})}catch(K){i.e(K)}finally{i.f()}c=new Map,l=p(t.blankNodeInfo.keys()),f=0,d=m(l),n.prev=6,d.s();case 8:if((h=d.n()).done){n.next=18;break}if(v=h.value,n.t0=++f%100==0,!n.t0){n.next=14;break}return n.next=14,t._yield();case 14:return n.next=16,t._hashAndTrackBlankNode({id:v,hashToBlankNodes:c});case 16:n.next=8;break;case 18:n.next=23;break;case 20:n.prev=20,n.t1=n.catch(6),d.e(n.t1);case 23:return n.prev=23,d.f(),n.finish(23);case 26:g=p(c.keys()).sort(),y=[],b=m(g);try{for(b.s();!(_=b.n()).done;)w=_.value,(x=c.get(w)).length>1?y.push(x):t.canonicalIssuer.getId(x[0])}catch(K){b.e(K)}finally{b.f()}k=0,S=y;case 30:if(!(kh)){r.next=31;break}return x=!0,r.abrupt("break",33);case 31:r.next=26;break;case 33:r.next=38;break;case 35:r.prev=35,r.t1=r.catch(24),k.e(r.t1);case 38:return r.prev=38,k.f(),r.finish(38);case 41:if(x){r.next=64;break}N=m(w),r.prev=43,N.s();case 45:if((E=N.n()).done){r.next=55;break}return T=E.value,r.next=49,n.hashNDegreeQuads(T,b);case 49:if(I=r.sent,_+=b.getId(T),_+="<".concat(I.hash,">"),b=I.issuer,!(0!==h.length&&_>h)){r.next=53;break}return x=!0,r.abrupt("break",55);case 53:r.next=45;break;case 55:r.next=60;break;case 57:r.prev=57,r.t2=r.catch(43),N.e(r.t2);case 60:return r.prev=60,N.f(),r.finish(60);case 63:x||(0===h.length||_")}},{key:"createHashToRelated",value:function(e,t){var n=this;return f(regeneratorRuntime.mark(function r(){var i,a,o,u,s,c;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=new Map,a=n.blankNodeInfo.get(e).quads,o=0,u=m(a),r.prev=3,u.s();case 5:if((s=u.n()).done){r.next=15;break}if(c=s.value,r.t0=++o%100==0,!r.t0){r.next=11;break}return r.next=11,n._yield();case 11:return r.next=13,Promise.all([n._addRelatedBlankNodeHash({quad:c,component:c.subject,position:"s",id:e,issuer:t,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:c,component:c.object,position:"o",id:e,issuer:t,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:c,component:c.graph,position:"g",id:e,issuer:t,hashToRelated:i})]);case 13:r.next=5;break;case 15:r.next=20;break;case 17:r.prev=17,r.t1=r.catch(3),u.e(r.t1);case 20:return r.prev=20,u.f(),r.finish(20);case 23:return r.abrupt("return",i);case 24:case"end":return r.stop()}},r,null,[[3,17,20,23]])}))()}},{key:"_hashAndTrackBlankNode",value:function(e){var t=e.id,n=e.hashToBlankNodes,r=this;return f(regeneratorRuntime.mark(function e(){var i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.hashFirstDegreeQuads(t);case 2:i=e.sent,(a=n.get(i))?a.push(t):n.set(i,[t]);case 5:case"end":return e.stop()}},e)}))()}},{key:"_addBlankNodeQuadInfo",value:function(e){var t=e.quad,n=e.component;if("BlankNode"===n.termType){var r=n.value,i=this.blankNodeInfo.get(r);i?i.quads.add(t):this.blankNodeInfo.set(r,{quads:new Set([t]),hash:null})}}},{key:"_addRelatedBlankNodeHash",value:function(e){var t=e.quad,n=e.component,r=e.position,i=e.id,a=e.issuer,o=e.hashToRelated,u=this;return f(regeneratorRuntime.mark(function e(){var s,c,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("BlankNode"===n.termType&&n.value!==i){e.next=2;break}return e.abrupt("return");case 2:return s=n.value,e.next=5,u.hashRelatedBlankNode(s,t,a,r);case 5:c=e.sent,(l=o.get(c))?l.push(s):o.set(c,[s]);case 8:case"end":return e.stop()}},e)}))()}},{key:"_useCanonicalId",value:function(e){var t=e.component;return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}},{key:"_yield",value:function(){return f(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){return n(e)}));case 1:case"end":return e.stop()}},e)}))()}}]),e}()}).call(this)}).call(this,e("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(e,t,n){"use strict";var r=e("./IdentifierIssuer"),i=e("./MessageDigest"),a=e("./Permuter"),o=e("./NQuads");function u(e,t){return e.hasht.hash?1:0}t.exports=function(){function e(){g(this,e),this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}return b(e,[{key:"main",value:function(e){this.quads=e;var t,n=m(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this._addBlankNodeQuadInfo({quad:i,component:i.subject}),this._addBlankNodeQuadInfo({quad:i,component:i.object}),this._addBlankNodeQuadInfo({quad:i,component:i.graph})}}catch(C){n.e(C)}finally{n.f()}var a,s=new Map,c=m(p(this.blankNodeInfo.keys()));try{for(c.s();!(a=c.n()).done;){var l=a.value;this._hashAndTrackBlankNode({id:l,hashToBlankNodes:s})}}catch(C){c.e(C)}finally{c.f()}var f,d=[],h=m(p(s.keys()).sort());try{for(h.s();!(f=h.n()).done;){var v=f.value,g=s.get(v);g.length>1?d.push(g):this.canonicalIssuer.getId(g[0])}}catch(C){h.e(C)}finally{h.f()}for(var y=0,b=d;yl){b=!0;break}}}catch(N){_.e(N)}finally{_.f()}if(!b){var x,k=m(y);try{for(k.s();!(x=k.n()).done;){var S=x.value,j=this.hashNDegreeQuads(S,v);if(g+=v.getId(S),g+="<".concat(j.hash,">"),v=j.issuer,0!==l.length&&g>l){b=!0;break}}}catch(N){k.e(N)}finally{k.f()}b||(0===l.length||g")}},{key:"createHashToRelated",value:function(e,t){var n,r=new Map,i=m(this.blankNodeInfo.get(e).quads);try{for(i.s();!(n=i.n()).done;){var a=n.value;this._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:e,issuer:t,hashToRelated:r})}}catch(o){i.e(o)}finally{i.f()}return r}},{key:"_hashAndTrackBlankNode",value:function(e){var t=e.id,n=e.hashToBlankNodes,r=this.hashFirstDegreeQuads(t),i=n.get(r);i?i.push(t):n.set(r,[t])}},{key:"_addBlankNodeQuadInfo",value:function(e){var t=e.quad,n=e.component;if("BlankNode"===n.termType){var r=n.value,i=this.blankNodeInfo.get(r);i?i.quads.add(t):this.blankNodeInfo.set(r,{quads:new Set([t]),hash:null})}}},{key:"_addRelatedBlankNodeHash",value:function(e){var t=e.quad,n=e.component,r=e.position,i=e.id,a=e.issuer,o=e.hashToRelated;if("BlankNode"===n.termType&&n.value!==i){var u=n.value,s=this.hashRelatedBlankNode(u,t,a,r),c=o.get(s);c?c.push(u):o.set(s,[u])}}},{key:"_useCanonicalId",value:function(e){var t=e.component;return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}]),e}()},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(e,t,n){"use strict";var r=e("./URDNA2015");t.exports=function(e){a(n,e);var t=o(n);function n(){var e;return g(this,n),(e=t.call(this)).name="URGNA2012",e.hashAlgorithm="sha1",e}return b(n,[{key:"modifyFirstDegreeComponent",value:function(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}},{key:"getRelatedPredicate",value:function(e){return e.predicate.value}},{key:"createHashToRelated",value:function(e,t){var n=this;return f(regeneratorRuntime.mark(function r(){var i,a,o,u,s,c,l,f,d,h;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=new Map,a=n.blankNodeInfo.get(e).quads,o=0,u=m(a),r.prev=3,u.s();case 5:if((s=u.n()).done){r.next=26;break}if(c=s.value,l=void 0,f=void 0,"BlankNode"!==c.subject.termType||c.subject.value===e){r.next=12;break}f=c.subject.value,l="p",r.next=15;break;case 12:if("BlankNode"===c.object.termType&&c.object.value!==e){r.next=14;break}return r.abrupt("continue",24);case 14:f=c.object.value,l="r";case 15:if(r.t0=++o%100==0,!r.t0){r.next=19;break}return r.next=19,n._yield();case 19:return r.next=21,n.hashRelatedBlankNode(f,c,t,l);case 21:d=r.sent,(h=i.get(d))?h.push(f):i.set(d,[f]);case 24:r.next=5;break;case 26:r.next=31;break;case 28:r.prev=28,r.t1=r.catch(3),u.e(r.t1);case 31:return r.prev=31,u.f(),r.finish(31);case 34:return r.abrupt("return",i);case 35:case"end":return r.stop()}},r,null,[[3,28,31,34]])}))()}}]),n}(r)},{"./URDNA2015":51}],54:[function(e,t,n){"use strict";var r=e("./URDNA2015Sync");t.exports=function(e){a(n,e);var t=o(n);function n(){var e;return g(this,n),(e=t.call(this)).name="URGNA2012",e.hashAlgorithm="sha1",e}return b(n,[{key:"modifyFirstDegreeComponent",value:function(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}},{key:"getRelatedPredicate",value:function(e){return e.predicate.value}},{key:"createHashToRelated",value:function(e,t){var n,r=new Map,i=m(this.blankNodeInfo.get(e).quads);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=void 0,u=void 0;if("BlankNode"===a.subject.termType&&a.subject.value!==e)u=a.subject.value,o="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;u=a.object.value,o="r"}var s=this.hashRelatedBlankNode(u,a,t,o),c=r.get(s);c?c.push(u):r.set(s,[u])}}catch(l){i.e(l)}finally{i.f()}return r}}]),n}(r)},{"./URDNA2015Sync":52}],55:[function(e,t,n){"use strict";var r,i=e("./URDNA2015"),a=e("./URGNA2012"),o=e("./URDNA2015Sync"),u=e("./URGNA2012Sync");try{r=e("rdf-canonize-native")}catch(s){}var s,c={};t.exports=c,c.NQuads=e("./NQuads"),c.IdentifierIssuer=e("./IdentifierIssuer"),c._rdfCanonizeNative=function(e){return e&&(r=e),r},c.canonize=(s=f(regeneratorRuntime.mark(function e(t,n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),!n.useNative){e.next=4;break}if(r){e.next=3;break}throw new Error("rdf-canonize-native not available");case 3:return e.abrupt("return",new Promise(function(e,i){return r.canonize(t,n,function(t,n){return t?i(t):e(n)})}));case 4:if("URDNA2015"!==n.algorithm){e.next=6;break}return e.abrupt("return",new i(n).main(t));case 6:if("URGNA2012"!==n.algorithm){e.next=8;break}return e.abrupt("return",new a(n).main(t));case 8:throw"algorithm"in n?new Error("Invalid RDF Dataset Canonicalization algorithm: "+n.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.");case 9:case"end":return e.stop()}},e)})),function(e,t){return s.apply(this,arguments)}),c._canonizeSync=function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(r)return r.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new o(t).main(e);if("URGNA2012"===t.algorithm)return new u(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),i(e("./lib/BlankNode"),n),i(e("./lib/DataFactory"),n),i(e("./lib/DefaultGraph"),n),i(e("./lib/Literal"),n),i(e("./lib/NamedNode"),n),i(e("./lib/Quad"),n),i(e("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0,n.BlankNode=function(){function e(t){g(this,e),this.termType="BlankNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}]),e}()},{}],58:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;var r=e("./BlankNode"),i=e("./DefaultGraph"),a=e("./Literal"),o=e("./NamedNode"),u=e("./Quad"),s=e("./Variable"),c=0;n.DataFactory=function(){function e(t){g(this,e),this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||"df_".concat(c++,"_")}return b(e,[{key:"namedNode",value:function(e){return new o.NamedNode(e)}},{key:"blankNode",value:function(e){return new r.BlankNode(e||"".concat(this.blankNodePrefix).concat(this.blankNodeCounter++))}},{key:"literal",value:function(e,t){return new a.Literal(e,t)}},{key:"variable",value:function(e){return new s.Variable(e)}},{key:"defaultGraph",value:function(){return i.DefaultGraph.INSTANCE}},{key:"quad",value:function(e,t,n,r){return new u.Quad(e,t,n,r||this.defaultGraph())}},{key:"fromTerm",value:function(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(a.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}},{key:"fromQuad",value:function(e){return this.fromTerm(e)}},{key:"resetBlankNodeCounter",value:function(){this.blankNodeCounter=0}}]),e}()},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;var r=function(){function e(){g(this,e),this.termType="DefaultGraph",this.value=""}return b(e,[{key:"equals",value:function(e){return!!e&&"DefaultGraph"===e.termType}}]),e}();n.DefaultGraph=r,r.INSTANCE=new r},{}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;var r=e("./NamedNode"),i=function(){function e(t,n){g(this,e),this.termType="Literal",this.value=t,"string"==typeof n?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING):n?(this.language="",this.datatype=n):(this.language="",this.datatype=e.XSD_STRING)}return b(e,[{key:"equals",value:function(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}]),e}();n.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0,n.NamedNode=function(){function e(t){g(this,e),this.termType="NamedNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}]),e}()},{}],62:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0,n.Quad=function(){function e(t,n,r,i){g(this,e),this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=r,this.graph=i}return b(e,[{key:"equals",value:function(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}]),e}()},{}],63:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0,n.Variable=function(){function e(t){g(this,e),this.termType="Variable",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}]),e}()},{}],64:[function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),i(e("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;var r=function(e){a(n,e);var t=o(n);function n(e,r){g(this,n);var i=e.saxStream._parser;return t.call(this,e.trackPosition?"Line ".concat(i.line+1," column ").concat(i.column+1,": ").concat(r):r)}return n}(c(Error));n.ParseError=r},{}],66:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;var r,i,u=e("relative-to-absolute-iri"),c=e("sax"),l=e("stream"),f=e("./ParseError"),d=e("rdf-data-factory"),h=function(e){a(n,e);var t=o(n);function n(e){var r;return g(this,n),(r=t.call(this,{readableObjectMode:!0})).activeTagStack=[],r.nodeIds={},e&&(Object.assign(s(r),e),r.options=e),r.dataFactory||(r.dataFactory=new d.DataFactory),r.baseIRI||(r.baseIRI=""),r.defaultGraph||(r.defaultGraph=r.dataFactory.defaultGraph()),r.saxStream=c.createStream(r.strict,{xmlns:!1,position:r.trackPosition}),r.strict||(r.saxStream._parser.looseCase="toString"),r.attachSaxListeners(),r}return b(n,[{key:"import",value:function(e){var t=new l.PassThrough({readableObjectMode:!0});e.on("error",function(e){return r.emit("error",e)}),e.on("data",function(e){return t.push(e)}),e.on("end",function(){return t.push(null)});var r=t.pipe(new n(this.options));return r}},{key:"_transform",value:function(e,t,n){try{this.saxStream.write(e,t)}catch(r){return n(r)}n()}},{key:"newParseError",value:function(e){return new f.ParseError(this,e)}},{key:"valueToUri",value:function(e,t){return this.uriToNamedNode(u.resolve(e,t.baseIRI))}},{key:"uriToNamedNode",value:function(e){if(!n.isValidIri(e))throw this.newParseError("Invalid URI: ".concat(e));return this.dataFactory.namedNode(e)}},{key:"validateNcname",value:function(e){if(!n.NCNAME_MATCHER.test(e))throw this.newParseError("Not a valid NCName: ".concat(e))}},{key:"attachSaxListeners",value:function(){var e=this;this.saxStream.on("error",function(t){return e.emit("error",t)}),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}},{key:"onTag",value:function(e){var t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null,i=r.RESOURCE;if(t&&(t.hadChildren=!0,i=t.childrenParseType),t&&t.childrenStringTags){var a=e.name,o="";for(var u in e.attributes)o+=" ".concat(u,'="').concat(e.attributes[u],'"');t.childrenStringTags.push("<".concat(a).concat(o,">"));var s={childrenStringTags:t.childrenStringTags};return s.childrenStringEmitClosingTag=""),void this.activeTagStack.push(s)}var c={};t?(c.language=t.language,c.baseIRI=t.baseIRI):c.baseIRI=this.baseIRI,this.activeTagStack.push(c),c.ns=n.parseNamespace(e,t),i===r.RESOURCE?this.onTagResource(e,c,t,!t):this.onTagProperty(e,c,t)}},{key:"onTagResource",value:function(e,t,i,a){var o=n.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=r.PROPERTY;var s=!0;if(o.uri===n.RDF){if(!a&&n.FORBIDDEN_NODE_ELEMENTS.indexOf(o.local)>=0)throw this.newParseError("Illegal node element name: ".concat(o.local));switch(o.local){case"RDF":t.childrenParseType=r.RESOURCE;case"Description":s=!1}}var c=[],l=[],f=null,d=!1,h=!1,p=null;for(var v in e.attributes){var g=e.attributes[v],y=n.expandPrefixedTerm(v,t.ns,this);if(i&&y.uri===n.RDF)switch(y.local){case"about":if(f)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(f," where found."));f=g;continue;case"ID":if(f)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(f," where found."));this.validateNcname(g),f="#"+g,d=!0;continue;case"nodeID":if(f)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(f," where found."));this.validateNcname(g),f=g,h=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=g;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(y.uri===n.XML){if("lang"===y.local){t.language=""===g?null:g.toLowerCase();continue}if("base"===y.local){t.baseIRI=u.resolve(g,t.baseIRI);continue}}"xml"!==y.prefix&&y.uri&&(c.push(this.uriToNamedNode(y.uri+y.local)),l.push(g))}if(null!==f&&(t.subject=h?this.dataFactory.blankNode(f):this.valueToUri(f,t),d&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),s){var b=this.uriToNamedNode(o.uri+o.local);this.emitTriple(t.subject,this.dataFactory.namedNode(n.RDF+"type"),b,i?i.reifiedStatementId:null)}if(i){if(i.predicate)if(i.childrenCollectionSubject){var m=this.dataFactory.blankNode();this.emitTriple(i.childrenCollectionSubject,i.childrenCollectionPredicate,m,i.reifiedStatementId),this.emitTriple(m,this.dataFactory.namedNode(n.RDF+"first"),t.subject,t.reifiedStatementId),i.childrenCollectionSubject=m,i.childrenCollectionPredicate=this.dataFactory.namedNode(n.RDF+"rest")}else{this.emitTriple(i.subject,i.predicate,t.subject,i.reifiedStatementId);for(var _=0;_=0)throw this.newParseError("Illegal property element name: ".concat(a.local));t.predicateSubPredicates=[],t.predicateSubObjects=[];var o=!1,u=!1,s=null,c=!0,l=[],f=[];for(var d in e.attributes){var h=e.attributes[d],p=n.expandPrefixedTerm(d,t.ns,this);if(p.uri===n.RDF)switch(p.local){case"resource":if(s)throw this.newParseError("Found both rdf:resource (".concat(h,") and rdf:nodeID (").concat(s,")."));if(o)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:resource (".concat(h,")"));t.hadChildren=!0,s=h,c=!1;continue;case"datatype":if(u)throw this.newParseError("Found both non-rdf:* property attributes and rdf:datatype (".concat(h,")."));if(o)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(h,")"));t.datatype=this.valueToUri(h,t);continue;case"nodeID":if(u)throw this.newParseError("Found both non-rdf:* property attributes and rdf:nodeID (".concat(h,")."));if(t.hadChildren)throw this.newParseError("Found both rdf:resource and rdf:nodeID (".concat(h,")."));if(o)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID (".concat(h,")"));this.validateNcname(h),t.hadChildren=!0,s=h,c=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(u)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(t.datatype.value,")"));if(s)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (".concat(s,")"));if("Resource"===h){o=!0,t.childrenParseType=r.PROPERTY;var v=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,v,t.reifiedStatementId),t.subject=v,t.predicate=null}else"Collection"===h?(o=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,c=!1):"Literal"===h&&(o=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(h),t.reifiedStatementId=this.valueToUri("#"+h,t),this.claimNodeId(t.reifiedStatementId);continue}else if(p.uri===n.XML&&"lang"===p.local){t.language=""===h?null:h.toLowerCase();continue}if("xml"!==p.prefix&&"xmlns"!==p.prefix&&p.uri){if(o||t.datatype)throw this.newParseError("Found illegal rdf:* properties on property element with attribute: ".concat(h));t.hadChildren=!0,u=!0,l.push(this.uriToNamedNode(p.uri+p.local)),f.push(this.dataFactory.literal(h,t.datatype||t.language))}}if(null!==s){var g=t.subject;t.subject=c?this.dataFactory.blankNode(s):this.valueToUri(s,t),this.emitTriple(g,t.predicate,t.subject,t.reifiedStatementId);for(var y=0;y/g,function(e,n,r){return t.saxStream._parser.ENTITIES[n]=r,""})}}],[{key:"parseNamespace",value:function(e,t){var r={},i=!1;for(var a in e.attributes)a.startsWith("xmlns")&&(5===a.length?(i=!0,r[""]=e.attributes[a]):":"===a.charAt(5)&&(i=!0,r[a.substr(6)]=e.attributes[a]));var o=t&&t.ns?t.ns:[n.DEFAULT_NS];return i?o.concat([r]):o}},{key:"expandPrefixedTerm",value:function(e,t,n){var r,i,a=e.indexOf(":");a>=0?(r=e.substr(0,a),i=e.substr(a+1)):(r="",i=e);for(var o=null,u=null,s=t.length-1;s>=0;s--){var c=t[s][r];if(c){o=c;break}u||(u=t[s][""])}if(!o){if(r&&"xmlns"!==r)throw new f.ParseError(n,"The prefix '".concat(r,"' in term '").concat(e,"' was not bound."));o=u||""}return{prefix:r,local:i,uri:o}}},{key:"isValidIri",value:function(e){return n.IRI_REGEX.test(e)}}]),n}(l.Transform);n.RdfXmlParser=h,h.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,h.MIME_TYPE="application/rdf+xml",h.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",h.XML="http://www.w3.org/XML/1998/namespace",h.XMLNS="http://www.w3.org/2000/xmlns/",h.DEFAULT_NS={xml:h.XML},h.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],h.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],h.NCNAME_MATCHER=/^((?:[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]))((?:[#\x2D\.0-9A-Z_a-z\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]))*$/,(i=r=n.ParseType||(n.ParseType={}))[i.RESOURCE=0]="RESOURCE",i[i.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(e,t,n){"use strict";var r={};function i(e,t,n){n||(n=Error);var i=function(e){function n(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(n,e),n}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function a(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,n){var r,i;if("string"==typeof t&&function(e,t,n){return e.substr(0,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))i="The ".concat(e," ").concat(r," ").concat(a(t,"type"));else{var o=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(a(t,"type"))}return i+". Received type ".concat(typeof n)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},{}],68:[function(e,t,n){(function(n){(function(){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var i=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(c,i);for(var o=r(a.prototype),u=0;u0)if("string"!=typeof t&&!u.objectMode&&Object.getPrototypeOf(t)!==s.prototype&&(t=function(e){return s.from(e)}(t)),r)u.endEmitted?x(e,new w):E(e,u,t,!0);else if(u.ended)x(e,new m);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?E(e,u,t,!1):O(e,u)):E(e,u,t,!1)}else r||(u.reading=!1,O(e,u));return!u.ended&&(u.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(A,e))}function A(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function O(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){a("readable nexttick read 0"),e.read(0)}function P(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(G,t,e))}function G(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function U(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):R(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&B(this),null;var r,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),null!==r&&this.emit("data",r),r},j.prototype._read=function(e){x(this,new _("_read()"))},j.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,a("pipe count=%d opts=%j",i.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?v:s;function s(){a("onend"),e.end()}i.endEmitted?n.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,o){a("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,a("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",v),r.removeListener("data",f),l=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c())});var c=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,C(e))}}(r);e.on("drain",c);var l=!1;function f(t){a("ondata");var n=e.write(t);a("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!l&&(a("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(t){a("onerror",t),v(),e.removeListener("error",d),0===o(e,"error")&&x(e,t)}function h(){e.removeListener("finish",p),v()}function p(){a("onfinish"),e.removeListener("close",h),v()}function v(){a("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",r),i.flowing||(a("pipe resume"),r.resume()),e},j.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===e&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?R(this):i.reading||n.nextTick(D,this)),r},j.prototype.removeListener=function(e,t){var r=u.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(M,this),r},j.prototype.removeAllListeners=function(e){var t=u.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(M,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(P,e,t))}(this,e)),e.paused=!1,this},j.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(a("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){a("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||!(n.objectMode||i&&i.length)||t.push(i)||(r=!0,e.pause())}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(e,t,n){n(new v("_write()"))},j.prototype._writev=null,j.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}}),j.prototype.destroy=f.destroy,j.prototype._undestroy=f.undestroy,j.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(e,t,n){(function(n){(function(){"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=e("./end-of-stream"),o=Symbol("lastResolve"),u=Symbol("lastReject"),s=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var n=e[d].read();null!==n&&(e[l]=null,e[o]=null,e[u]=null,t(h(n,!1)))}}function v(e){n.nextTick(p,e)}var g=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((i(r={get stream(){return this[d]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(t,r){n.nextTick(function(){e[s]?r(e[s]):t(h(void 0,!0))})});var r,i=this[l];if(i)r=new Promise(function(e,t){return function(n,r){e.then(function(){t[c]?n(h(void 0,!0)):t[f](n,r)},r)}}(i,this));else{var a=this[d].read();if(null!==a)return Promise.resolve(h(a,!1));r=new Promise(this[f])}return this[l]=r,r}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[d].destroy(null,function(e){e?n(e):t(h(void 0,!0))})})}),r),g);t.exports=function(e){var t,n=Object.create(y,(i(t={},d,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var r=n[d].read();r?(n[l]=null,n[o]=null,n[u]=null,e(h(r,!1))):(n[o]=e,n[u]=t)},writable:!0}),t));return n[l]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[u];return null!==t&&(n[l]=null,n[o]=null,n[u]=null,t(e)),void(n[s]=e)}var r=n[o];null!==r&&(n[l]=null,n[o]=null,n[u]=null,r(h(void 0,!0))),n[c]=!0}),e.on("readable",v.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":76,_process:44}],74:[function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t=o.allocUnsafe(e>>>0),n=this.head,r=0;n;)c(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(r+=a===i.length?i:i.slice(0,e),0==(e-=a)){a===i.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++r,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:s,value:function(e,t){return u(this,function(e){for(var t=1;t0,function(e){i||(i=e),e&&o.forEach(c),!a&&(o.forEach(c),r(i))})});return t.reduce(l)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(e,t,n){"use strict";var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":67}],80:[function(e,t,n){t.exports=e("events").EventEmitter},{events:8}],81:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(e,t,n){"use strict";function r(e){for(var t=[],n=0;n=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);var i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function a(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(e,t){var n=(t=t||"").indexOf("#");if(n>0&&(t=t.substr(0,n)),!e.length){if(t.indexOf(":")<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));return t}if(e.startsWith("?")){var a=t.indexOf("?");return a>0&&(t=t.substr(0,a)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){var o=e.indexOf(":");if(o<0)throw new Error("Found invalid relative IRI '".concat(e,"' for a missing baseIRI"));return i(e,o)}var u=e.indexOf(":");if(u>=0)return i(e,u);var s=t.indexOf(":");if(s<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));var c,l=t.substr(0,s+1);if(0===e.indexOf("//"))return l+i(e,u);if(t.indexOf("//",s)===s+1){if((c=t.indexOf("/",s+3))<0)return t.length>s+3?t+"/"+i(e,u):l+i(e,u)}else if((c=t.indexOf("/",s+1))<0)return l+i(e,u);if(0===e.indexOf("/"))return t.substr(0,c)+r(e);var f=t.substr(c),d=f.lastIndexOf("/");return d>=0&&d"===a?(N(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=k.TEXT):(g(a)&&(t.state=k.SGML_DECL_QUOTED),t.sgmlDecl+=a);continue;case k.SGML_DECL_QUOTED:a===t.q&&(t.state=k.SGML_DECL,t.q=""),t.sgmlDecl+=a;continue;case k.DOCTYPE:">"===a?(t.state=k.TEXT,N(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=a,"["===a?t.state=k.DOCTYPE_DTD:g(a)&&(t.state=k.DOCTYPE_QUOTED,t.q=a));continue;case k.DOCTYPE_QUOTED:t.doctype+=a,a===t.q&&(t.q="",t.state=k.DOCTYPE);continue;case k.DOCTYPE_DTD:t.doctype+=a,"]"===a?t.state=k.DOCTYPE:g(a)&&(t.state=k.DOCTYPE_DTD_QUOTED,t.q=a);continue;case k.DOCTYPE_DTD_QUOTED:t.doctype+=a,a===t.q&&(t.state=k.DOCTYPE_DTD,t.q="");continue;case k.COMMENT:"-"===a?t.state=k.COMMENT_ENDING:t.comment+=a;continue;case k.COMMENT_ENDING:"-"===a?(t.state=k.COMMENT_ENDED,t.comment=T(t.opt,t.comment),t.comment&&N(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+a,t.state=k.COMMENT);continue;case k.COMMENT_ENDED:">"!==a?(A(t,"Malformed comment"),t.comment+="--"+a,t.state=k.COMMENT):t.state=k.TEXT;continue;case k.CDATA:"]"===a?t.state=k.CDATA_ENDING:t.cdata+=a;continue;case k.CDATA_ENDING:"]"===a?t.state=k.CDATA_ENDING_2:(t.cdata+="]"+a,t.state=k.CDATA);continue;case k.CDATA_ENDING_2:">"===a?(t.cdata&&N(t,"oncdata",t.cdata),N(t,"onclosecdata"),t.cdata="",t.state=k.TEXT):"]"===a?t.cdata+="]":(t.cdata+="]]"+a,t.state=k.CDATA);continue;case k.PROC_INST:"?"===a?t.state=k.PROC_INST_ENDING:v(a)?t.state=k.PROC_INST_BODY:t.procInstName+=a;continue;case k.PROC_INST_BODY:if(!t.procInstBody&&v(a))continue;"?"===a?t.state=k.PROC_INST_ENDING:t.procInstBody+=a;continue;case k.PROC_INST_ENDING:">"===a?(N(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=k.TEXT):(t.procInstBody+="?"+a,t.state=k.PROC_INST_BODY);continue;case k.OPEN_TAG:b(d,a)?t.tagName+=a:(O(t),">"===a?D(t):"/"===a?t.state=k.OPEN_TAG_SLASH:(v(a)||A(t,"Invalid character in tag name"),t.state=k.ATTRIB));continue;case k.OPEN_TAG_SLASH:">"===a?(D(t,!0),P(t)):(A(t,"Forward-slash in opening tag not followed by >"),t.state=k.ATTRIB);continue;case k.ATTRIB:if(v(a))continue;">"===a?D(t):"/"===a?t.state=k.OPEN_TAG_SLASH:b(f,a)?(t.attribName=a,t.attribValue="",t.state=k.ATTRIB_NAME):A(t,"Invalid attribute name");continue;case k.ATTRIB_NAME:"="===a?t.state=k.ATTRIB_VALUE:">"===a?(A(t,"Attribute without value"),t.attribValue=t.attribName,M(t),D(t)):v(a)?t.state=k.ATTRIB_NAME_SAW_WHITE:b(d,a)?t.attribName+=a:A(t,"Invalid attribute name");continue;case k.ATTRIB_NAME_SAW_WHITE:if("="===a)t.state=k.ATTRIB_VALUE;else{if(v(a))continue;A(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",N(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===a?D(t):b(f,a)?(t.attribName=a,t.state=k.ATTRIB_NAME):(A(t,"Invalid attribute name"),t.state=k.ATTRIB)}continue;case k.ATTRIB_VALUE:if(v(a))continue;g(a)?(t.q=a,t.state=k.ATTRIB_VALUE_QUOTED):(A(t,"Unquoted attribute value"),t.state=k.ATTRIB_VALUE_UNQUOTED,t.attribValue=a);continue;case k.ATTRIB_VALUE_QUOTED:if(a!==t.q){"&"===a?t.state=k.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=a;continue}M(t),t.q="",t.state=k.ATTRIB_VALUE_CLOSED;continue;case k.ATTRIB_VALUE_CLOSED:v(a)?t.state=k.ATTRIB:">"===a?D(t):"/"===a?t.state=k.OPEN_TAG_SLASH:b(f,a)?(A(t,"No whitespace between attributes"),t.attribName=a,t.attribValue="",t.state=k.ATTRIB_NAME):A(t,"Invalid attribute name");continue;case k.ATTRIB_VALUE_UNQUOTED:if(!y(a)){"&"===a?t.state=k.ATTRIB_VALUE_ENTITY_U:t.attribValue+=a;continue}M(t),">"===a?D(t):t.state=k.ATTRIB;continue;case k.CLOSE_TAG:if(t.tagName)">"===a?P(t):b(d,a)?t.tagName+=a:t.script?(t.script+=""===a?P(t):A(t,"Invalid characters in closing tag");continue;case k.TEXT_ENTITY:case k.ATTRIB_VALUE_ENTITY_Q:case k.ATTRIB_VALUE_ENTITY_U:var u,s;switch(t.state){case k.TEXT_ENTITY:u=k.TEXT,s="textNode";break;case k.ATTRIB_VALUE_ENTITY_Q:u=k.ATTRIB_VALUE_QUOTED,s="attribValue";break;case k.ATTRIB_VALUE_ENTITY_U:u=k.ATTRIB_VALUE_UNQUOTED,s="attribValue"}";"===a?(t[s]+=C(t),t.entity="",t.state=u):b(t.entity.length?p:h,a)?t.entity+=a:(A(t,"Invalid character in entity name"),t[s]+="&"+t.entity+a,t.entity="",t.state=u);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&function(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),r=0,a=0,o=i.length;at)switch(i[a]){case"textNode":E(e);break;case"cdata":N(e,"oncdata",e.cdata),e.cdata="";break;case"script":N(e,"onscript",e.script),e.script="";break;default:I(e,"Max buffer length exceeded: "+i[a])}r=Math.max(r,u)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-r+e.position}(t),t},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(e){E(e),""!==e.cdata&&(N(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(N(e,"onscript",e.script),e.script="")}(this)}};try{r=e("stream").Stream}catch(_){r=function(){}}var o=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function u(e,t){if(!(this instanceof u))return new u(e,t);r.apply(this),this._parser=new a(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,o.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})})}(u.prototype=Object.create(r.prototype,{constructor:{value:u}})).write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var r=e("string_decoder").StringDecoder;this._decoder=new r("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},u.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},u.prototype.on=function(e,t){var n=this;return!n._parser["on"+e]&&-1!==o.indexOf(e)&&(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var s="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",l={xml:s,xmlns:c},f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,h=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function v(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function g(e){return'"'===e||"'"===e}function y(e){return">"===e||v(e)}function b(e,t){return e.test(t)}function m(e,t){return!b(e,t)}var _,w,x,k=0;for(var S in n.STATE={BEGIN:k++,BEGIN_WHITESPACE:k++,TEXT:k++,TEXT_ENTITY:k++,OPEN_WAKA:k++,SGML_DECL:k++,SGML_DECL_QUOTED:k++,DOCTYPE:k++,DOCTYPE_QUOTED:k++,DOCTYPE_DTD:k++,DOCTYPE_DTD_QUOTED:k++,COMMENT_STARTING:k++,COMMENT:k++,COMMENT_ENDING:k++,COMMENT_ENDED:k++,CDATA:k++,CDATA_ENDING:k++,CDATA_ENDING_2:k++,PROC_INST:k++,PROC_INST_BODY:k++,PROC_INST_ENDING:k++,OPEN_TAG:k++,OPEN_TAG_SLASH:k++,ATTRIB:k++,ATTRIB_NAME:k++,ATTRIB_NAME_SAW_WHITE:k++,ATTRIB_VALUE:k++,ATTRIB_VALUE_QUOTED:k++,ATTRIB_VALUE_CLOSED:k++,ATTRIB_VALUE_UNQUOTED:k++,ATTRIB_VALUE_ENTITY_Q:k++,ATTRIB_VALUE_ENTITY_U:k++,CLOSE_TAG:k++,CLOSE_TAG_SAW_WHITE:k++,SCRIPT:k++,SCRIPT_ENDING:k++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],r="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=r}),n.STATE)n.STATE[n.STATE[S]]=S;function j(e,t,n){e[t]&&e[t](n)}function N(e,t,n){e.textNode&&E(e),j(e,t,n)}function E(e){e.textNode=T(e.opt,e.textNode),e.textNode&&j(e,"ontext",e.textNode),e.textNode=""}function T(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function I(e,t){return E(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,j(e,"onerror",t),e}function R(e){return e.sawRoot&&!e.closedRoot&&A(e,"Unclosed root tag"),e.state!==k.BEGIN&&e.state!==k.BEGIN_WHITESPACE&&e.state!==k.TEXT&&I(e,"Unexpected end"),E(e),e.c="",e.closed=!0,j(e,"onend"),a.call(e,e.strict,e.opt),e}function A(e,t){if("object"!=typeof e||!(e instanceof a))throw new Error("bad call to strictFail");e.strict&&I(e,t)}function O(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,N(e,"onopentagstart",n)}function L(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function M(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=L(e.attribName,!0),n=t.local;if("xmlns"===t.prefix)if("xml"===n&&e.attribValue!==s)A(e,"xml: prefix must be bound to "+s+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==c)A(e,"xmlns: prefix must be bound to "+c+"\nActual: "+e.attribValue);else{var r=e.tag,i=e.tags[e.tags.length-1]||e;r.ns===i.ns&&(r.ns=Object.create(i.ns)),r.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,N(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function D(e,t){if(e.opt.xmlns){var n=e.tag,r=L(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(A(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix),n.ns&&(e.tags[e.tags.length-1]||e).ns!==n.ns&&Object.keys(n.ns).forEach(function(t){N(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var i=0,a=e.attribList.length;i",e.tagName="",void(e.state=k.SCRIPT);N(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)A(e,"Unexpected close tag");if(t<0)return A(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=k.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,N(e,"onclosetag",e.tagName);var o={};for(var u in a.ns)o[u]=a.ns[u];e.opt.xmlns&&a.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(a.ns).forEach(function(t){N(e,"onclosenamespace",{prefix:t,uri:a.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=k.TEXT}function C(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==n?(A(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function F(e,t){"<"===t?(e.state=k.OPEN_WAKA,e.startTagPosition=e.position):v(t)||(A(e,"Non-whitespace before first tag."),e.textNode=t,e.state=k.TEXT)}function B(e,t){var n="";return t1114111||w(a)!==a)throw RangeError("Invalid code point: "+a);a<=65535?t.push(a):t.push(55296+((a-=65536)>>10),a%1024+56320),(n+1===r||t.length>e)&&(i+=_.apply(null,t),t.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:x,configurable:!0,writable:!0}):String.fromCodePoint=x)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,e("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(e,t,n){(function(e,t){(function(){!function(t,n){"use strict";if(!t.setImmediate){var r,i=1,a={},o=!1,u=t.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(t);s=s&&s.setTimeout?s:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){d(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(c="setImmediate$"+Math.random()+"$",l=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(c)&&d(+e.data.slice(c.length))},t.addEventListener?t.addEventListener("message",l,!1):t.attachEvent("onmessage",l),r=function(e){t.postMessage(c+e,"*")}):t.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){d(e.data)},r=function(t){e.port2.postMessage(t)}}():u&&"onreadystatechange"in u.createElement("script")?function(){var e=u.documentElement;r=function(t){var n=u.createElement("script");n.onreadystatechange=function(){d(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():r=function(e){setTimeout(d,0,e)},s.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=s++,r=!(arguments.length<2)&&o.call(arguments,1);return u[t]=!0,i(function(){u[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(e,t,n){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(r){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(e,t,n){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}},e,this)})}},{}],92:[function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,a=this.head;null!==a&&ithis.length&&(t=this.length);for(var i=this.length,a=this.tail;null!==a&&i>t;i--)a=a.prev;for(;null!==a&&i>e;i--,a=a.prev)n.push(a.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,console&&console.warn&&console.warn(u)}return e}function N(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=N.bind(r);return i.listener=n,r.wrapFn=i,i}function T(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)m(u,this,t);else{var s=u.length,c=R(u,s);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},w.prototype.listeners=function(e){return T(this,e,!0)},w.prototype.rawListeners=function(e){return T(this,e,!1)},w.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):I.call(e,t)},w.prototype.listenerCount=I,w.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]},O.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(O.prototype[Symbol.iterator]=function(){return this}),O.of=function(){var e=arguments,t=e.length,n=0;return new O(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},O.empty=function(){var e=new O(null);return e.done=!0,e},O.is=function(e){return e instanceof O||"object"==typeof e&&null!==e&&"function"==typeof e.next};var L=O,M=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],a=0;;){if(a===r)return i;if((n=e.next()).done)return a!==t?i.slice(0,a):i;i[a++]=n.value}},D=function(e){function n(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return t(n,e),n}(o(Error)),P=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(i),n.prototype.constructor),i}return t(n,e),n}(D),C=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(i),n.prototype.constructor),i}return t(n,e),n}(D),F=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(i),n.prototype.constructor),i}return t(n,e),n}(D);function B(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function G(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function U(e,t){this.key=e,this.attributes=t,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function V(e,t,n,r,i,a){this.key=t,this.attributes=a,this.undirected=e,this.source=r,this.target=i,this.generatedKey=n}function z(e,t,n,r,i,a,o){var u,s,c="out",l="in";if(t&&(c=l="undirected"),e.multi){if(void 0===(s=(u=a[c])[i])&&(s=new Set,u[i]=s),s.add(n),r===i&&t)return;void 0===(u=o[l])[r]&&(u[r]=s)}else{if(a[c][i]=n,r===i&&t)return;o[l][r]=n}}function q(e,t,n){var r=e.multi,i=n.source,a=n.target,o=i.key,u=a.key,s=i[t?"undirected":"out"],c=t?"undirected":"in";if(u in s)if(r){var l=s[u];1===l.size?(delete s[u],delete a[c][o]):l.delete(n)}else delete s[u];r||delete a[c][o]}G.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},U.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var K=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes[r]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+e,a=""+arguments[1];if(!(r=c(this,i,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(i,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes.hasOwnProperty(r)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,i){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,u=""+r;if(r=arguments[2],i=arguments[3],!(a=c(this,o,u,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(u,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&a.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[r]=i,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,i){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,u=""+r;if(r=arguments[2],i=arguments[3],!(a=c(this,o,u,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(u,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof i)throw new P("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&a.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[r]=i(a.attributes[r]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete i.attributes[r],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:r}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!f(r))throw new P("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes=r,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!f(r))throw new P("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return s(i.attributes,r),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:r}),this}}}],H=L,W=function(){var e,t=arguments,n=-1;return new H(function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i})},J=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Q(e,t){for(var n in t)e.push(t[n].key)}function X(e,t){for(var n in t)t[n].forEach(function(t){return e.push(t.key)})}function Y(e,t,n){for(var r in e)if(r!==n){var i=e[r];t(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected,i.generatedKey)}}function Z(e,t,n){for(var r in e)r!==n&&e[r].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function $(e,t,n){for(var r in e)if(r!==n){var i=e[r];if(t(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected,i.generatedKey))return!0}return!1}function ee(e,t,n){var r,i,a,o,u;for(var s in e)if(s!==n)for(r=e[s].values();!0!==(i=r.next()).done;)if(o=(a=i.value).source,t(a.key,a.attributes,o.key,(u=a.target).key,o.attributes,u.attributes,a.undirected,a.generatedKey))return!0;return!1}function te(e,t){var n=Object.keys(e),r=n.length,i=null,a=0;return new L(function o(){var u;if(i){var s=i.next();if(s.done)return i=null,a++,o();u=s.value}else{if(a>=r)return{done:!0};var c=n[a];if(c===t)return a++,o();if((u=e[c])instanceof Set)return i=u.values(),o();a++}return{done:!1,value:[u.key,u.attributes,u.source.key,u.target.key,u.source.attributes,u.target.attributes]}})}function ne(e,t,n){var r=t[n];r&&e.push(r.key)}function re(e,t,n){var r=t[n];r&&r.forEach(function(t){return e.push(t.key)})}function ie(e,t,n){var r=e[t];if(r){var i=r.source,a=r.target;n(r.key,r.attributes,i.key,a.key,i.attributes,a.attributes,r.undirected,r.generatedKey)}}function ae(e,t,n){var r=e[t];r&&r.forEach(function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function oe(e,t,n){var r=e[t];if(r){var i=r.source,a=r.target;return n(r.key,r.attributes,i.key,a.key,i.attributes,a.attributes,r.undirected,r.generatedKey)}}function ue(e,t,n){var r=e[t];if(r){for(var i,a,o=r.values();!0!==(i=o.next()).done;)if(n((a=i.value).key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected,a.generatedKey))return!0;return!1}}function se(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new L(function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return L.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ce(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return"function"==typeof Array.from?Array.from(e._edges.keys()):M(e._edges.keys(),e._edges.size);for(var n,r,i=new Array("undirected"===t?e.undirectedSize:e.directedSize),a="undirected"===t,o=e._edges.values(),u=0;!0!==(n=o.next()).done;)(r=n.value).undirected===a&&(i[u++]=r.key);return i}function le(e,t,n){if(0!==e.size)for(var r,i,a="mixed"!==t&&t!==e.type,o="undirected"===t,u=e._edges.values();!0!==(r=u.next()).done;)if(i=r.value,!a||i.undirected===o){var s=i.source,c=i.target;n(i.key,i.attributes,s.key,c.key,s.attributes,c.attributes,i.undirected,i.generatedKey)}}function fe(e,t,n){if(0!==e.size)for(var r,i,a="mixed"!==t&&t!==e.type,o="undirected"===t,u=e._edges.values();!0!==(r=u.next()).done;)if(i=r.value,!a||i.undirected===o){var s=i.source,c=i.target;if(n(i.key,i.attributes,s.key,c.key,s.attributes,c.attributes,i.undirected,i.generatedKey))break}}function de(e,t){if(0===e.size)return L.empty();var n="mixed"!==t&&t!==e.type,r="undirected"===t,i=e._edges.values();return new L(function(){for(var e,t;;){if((e=i.next()).done)return e;if(t=e.value,!n||t.undirected===r)break}return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})}function he(e,t,n,r){var i=[],a=e?X:Q;return"undirected"!==t&&("out"!==n&&a(i,r.in),"in"!==n&&a(i,r.out),!n&&r.directedSelfLoops>0&&i.splice(i.lastIndexOf(r.key),1)),"directed"!==t&&a(i,r.undirected),i}function pe(e,t,n,r,i){var a=e?Z:Y;"undirected"!==t&&("out"!==n&&a(r.in,i),"in"!==n&&a(r.out,i,n?null:r.key)),"directed"!==t&&a(r.undirected,i)}function ve(e,t,n,r,i){var a=e?ee:$;"undirected"!==t&&("out"!==n&&a(r.in,i)||"in"!==n&&a(r.out,i,n?null:r.key))||"directed"===t||a(r.undirected,i)}function ge(e,t,n){var r=L.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=W(r,te(n.in))),"in"!==t&&void 0!==n.out&&(r=W(r,te(n.out,t?null:n.key)))),"directed"!==e&&void 0!==n.undirected&&(r=W(r,te(n.undirected))),r}function ye(e,t,n,r,i){var a=t?re:ne,o=[];return"undirected"!==e&&(void 0!==r.in&&"out"!==n&&a(o,r.in,i),void 0!==r.out&&"in"!==n&&a(o,r.out,i),!n&&r.directedSelfLoops>0&&o.splice(o.lastIndexOf(r.key),1)),"directed"!==e&&void 0!==r.undirected&&a(o,r.undirected,i),o}function be(e,t,n,r,i,a){var o=t?ae:ie;"undirected"!==e&&(void 0!==r.in&&"out"!==n&&o(r.in,i,a),r.key!==i&&void 0!==r.out&&"in"!==n&&o(r.out,i,a)),"directed"!==e&&void 0!==r.undirected&&o(r.undirected,i,a)}function me(e,t,n,r,i,a){var o=t?ue:oe;"undirected"!==e&&(void 0!==r.in&&"out"!==n&&o(r.in,i,a)||r.key!==i&&void 0!==r.out&&"in"!==n&&o(r.out,i,a,n?null:r.key))||"directed"===e||void 0===r.undirected||o(r.undirected,i,a)}function _e(e,t,n,r){var i=L.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=W(i,se(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=W(i,se(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=W(i,se(n.undirected,r))),i}var we=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xe(e,t){if(void 0!==t)for(var n in t)e.add(n)}function ke(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&xe(r,n.in),"in"!==t&&xe(r,n.out)),"directed"!==e&&xe(r,n.undirected),M(r.values(),r.size)}function Se(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var a=i.source,o=a===e?i.target:a;n(o.key,o.attributes)}}function je(e,t,n,r){for(var i in n){var a=n[i];a instanceof Set&&(a=a.values().next().value);var o=a.source,u=o===t?a.target:o;e.has(u.key)||(e.add(u.key),r(u.key,u.attributes))}}function Ne(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var a=i.source,o=a===e?i.target:a;if(n(o.key,o.attributes))return!0}return!1}function Ee(e,t,n,r){for(var i in n){var a=n[i];a instanceof Set&&(a=a.values().next().value);var o=a.source,u=o===t?a.target:o;if(!e.has(u.key)&&(e.add(u.key),r(u.key,u.attributes)))return!0}return!1}function Te(e,t){var n=Object.keys(t),r=n.length,i=0;return new L(function(){if(i>=r)return{done:!0};var a=t[n[i++]];a instanceof Set&&(a=a.values().next().value);var o=a.source,u=o===e?a.target:o;return{done:!1,value:[u.key,u.attributes]}})}function Ie(e,t,n){var r=Object.keys(n),i=r.length,a=0;return new L(function o(){if(a>=i)return{done:!0};var u=n[r[a++]];u instanceof Set&&(u=u.values().next().value);var s=u.source,c=s===t?u.target:s;return e.has(c.key)?o():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function Re(e,t,n,r,i){var a=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==a.in)for(var o in a.in)if(o===i)return!0;if("in"!==n&&void 0!==a.out)for(var u in a.out)if(u===i)return!0}if("directed"!==t&&void 0!==a.undirected)for(var s in a.undirected)if(s===i)return!0;return!1}function Ae(e,t,n){for(var r,i,a,o,u,s,c,l=t._nodes.values(),f=t.type;!0!==(r=l.next()).done;){if(i=r.value,"undirected"!==f)for(a in o=i.out)if(s=(u=o[a]).target,c=n(i.key,s.key,i.attributes,s.attributes,u.key,u.attributes,u.undirected,u.generatedKey),e&&c)return;if("directed"!==f)for(a in o=i.undirected)if((s=(u=o[a]).target).key!==a&&(s=u.source),c=n(i.key,s.key,i.attributes,s.attributes,u.key,u.attributes,u.undirected,u.generatedKey),e&&c)return}}function Oe(e,t,n){for(var r,i,a,o,u,s,c,l,f,d=t._nodes.values(),h=t.type;!0!==(r=d.next()).done;){if(i=r.value,"undirected"!==h)for(a in s=i.out)for(o=s[a].values();!0!==(u=o.next()).done;)if(l=(c=u.value).target,f=n(i.key,l.key,i.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&f)return;if("directed"!==h)for(a in s=i.undirected)for(o=s[a].values();!0!==(u=o.next()).done;)if((l=(c=u.value).target).key!==a&&(l=c.source),f=n(i.key,l.key,i.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&f)return}}function Le(e,t){var n={key:e};return d(t.attributes)||(n.attributes=s({},t.attributes)),n}function Me(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),d(t.attributes)||(n.attributes=s({},t.attributes)),t.undirected&&(n.undirected=!0),n}function De(e){return f(e)?"key"in e?!("attributes"in e)||f(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function Pe(e){return f(e)?"source"in e?"target"in e?!("attributes"in e)||f(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Ce=new Set(["directed","undirected","mixed"]),Fe=new Set(["domain","_events","_eventsCount","_maxListeners"]),Be={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Ge(e,t,n){var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function Ue(e,t,n,r,i,a,o,u){if(!r&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(u&&!f(u))throw new P("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(u,'"'));if(a=""+a,o=""+o,u=u||{},!e.allowSelfLoops&&a===o)throw new F("Graph.".concat(t,': source & target are the same ("').concat(a,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var s=e._nodes.get(a),c=e._nodes.get(o);if(!s)throw new C("Graph.".concat(t,': source node "').concat(a,'" not found.'));if(!c)throw new C("Graph.".concat(t,': target node "').concat(o,'" not found.'));var l={key:null,undirected:r,source:a,target:o,attributes:u};if(n&&(i=e._edgeKeyGenerator(l)),e._edges.has(i=""+i))throw new F("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==s.undirected[o]:void 0!==s.out[o]))throw new F("Graph.".concat(t,': an edge linking "').concat(a,'" to "').concat(o,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var d=new V(r,i,n,s,c,u);return e._edges.set(i,d),a===o?r?(s.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(s.directedSelfLoops++,e._directedSelfLoopCount++):r?(s.undirectedDegree++,c.undirectedDegree++):(s.outDegree++,c.inDegree++),z(e,r,d,a,o,s,c),r?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function Ve(e,t,n,r,i,a,o,u,c){if(!r&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(u)if(c){if("function"!=typeof u)throw new P("Graph.".concat(t,': invalid updater function. Expecting a function but got "').concat(u,'"'))}else if(!f(u))throw new P("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(u,'"'));var l;if(a=""+a,o=""+o,c&&(l=u,u=void 0),!e.allowSelfLoops&&a===o)throw new F("Graph.".concat(t,': source & target are the same ("').concat(a,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,h,p=e._nodes.get(a),v=e._nodes.get(o);if(!n&&(d=e._edges.get(i))){if(d.source.key!==a||d.target.key!==o||r&&(d.source.key!==o||d.target.key!==a))throw new F("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(a,'" source & "').concat(o,'" target vs. ("').concat(d.source.key,'", "').concat(d.target.key,'").'));h=d}if(h||e.multi||!p||(h=r?p.undirected[o]:p.out[o]),h)return(c?l:u)?(c?(h.attributes=l(h.attributes),e.emit("edgeAttributesUpdated",{type:"replace",key:h.key,attributes:h.attributes})):(s(h.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:h.key,attributes:h.attributes,data:u})),h.key):h.key;u=u||{},c&&l&&(u=l(u));var g={key:null,undirected:r,source:a,target:o,attributes:u};if(n&&(i=e._edgeKeyGenerator(g)),e._edges.has(i=""+i))throw new F("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return p||(p=Ge(e,a,{}),a===o&&(v=p)),v||(v=Ge(e,o,{})),d=new V(r,i,n,p,v,u),e._edges.set(i,d),a===o?r?(p.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(p.directedSelfLoops++,e._directedSelfLoopCount++):r?(p.undirectedDegree++,v.undirectedDegree++):(p.outDegree++,v.inDegree++),z(e,r,d,a,o,p,v),r?e._undirectedSize++:e._directedSize++,g.key=i,e.emit("edgeAdded",g),i}var ze,qe=function(e){function n(t){var n;if(n=e.call(this)||this,(t=s({},Be,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new P("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new P("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!Ce.has(t.type))throw new P('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new P("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r,i="mixed"===t.type?B:"directed"===t.type?G:U;return h(u(n),"NodeDataClass",i),h(u(n),"_attributes",{}),h(u(n),"_nodes",new Map),h(u(n),"_edges",new Map),h(u(n),"_directedSize",0),h(u(n),"_undirectedSize",0),h(u(n),"_directedSelfLoopCount",0),h(u(n),"_undirectedSelfLoopCount",0),h(u(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(r=0,function(){return r++})),h(u(n),"_options",t),Fe.forEach(function(e){return h(u(n),e,n[e])}),p(u(n),"order",function(){return n._nodes.size}),p(u(n),"size",function(){return n._edges.size}),p(u(n),"directedSize",function(){return n._directedSize}),p(u(n),"undirectedSize",function(){return n._undirectedSize}),p(u(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),p(u(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),p(u(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),p(u(n),"multi",n._options.multi),p(u(n),"type",n._options.type),p(u(n),"allowSelfLoops",n._options.allowSelfLoops),p(u(n),"implementation",function(){return"graphology"}),n}t(n,e);var r=n.prototype;return r.hasNode=function(e){return this._nodes.has(""+e)},r.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&!n.undirected}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.out[t];return!(!i||this.multi&&!i.size)}throw new P("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n.undirected}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.undirected[t];return!(!i||this.multi&&!i.size)}throw new P("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var r=void 0!==n.out&&n.out[t];return r||(r=void 0!==n.undirected&&n.undirected[t]),!(!r||this.multi&&!r.size)}throw new P("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new C('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},r.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new C('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},r.edge=function(e,t){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},r.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(t?n.directedSelfLoops:0)},r.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(t?n.directedSelfLoops:0)},r.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.inDegree+r+(n.outDegree+r)},r.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(t?n.undirectedSelfLoops:0)},r.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var r=0,i=0;return"directed"!==this.type&&(t&&(i=n.undirectedSelfLoops),r+=n.undirectedDegree+2*i),"undirected"!==this.type&&(t&&(i=n.directedSelfLoops),r+=n.inDegree+n.outDegree+2*i),r},r.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},r.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},r.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},r.opposite=function(e,t){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new C('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(e!==r&&e!==i)throw new C('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(i,")."));return e===r?i:r},r.hasExtremity=function(e,t){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new C('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return n.source.key===t||n.target.key===t},r.isUndirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},r.isDirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},r.isSelfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},r.hasGeneratedKey=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.hasGeneratedKey: could not find the "'.concat(e,'" edge in the graph.'));return t.generatedKey},r.addNode=function(e,t){return function(e,t,n){if(n&&!f(n))throw new P('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},e._nodes.has(t=""+t))throw new F('Graph.addNode: the "'.concat(t,'" node already exist in the graph.'));var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}(this,e,t).key},r.mergeNode=function(e,t){if(t&&!f(t))throw new P('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var n=this._nodes.get(e=""+e);return n?(t&&(s(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},r.updateNode=function(e,t){if(t&&"function"!=typeof t)throw new P('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));var n=this._nodes.get(e=""+e);if(n)return t&&(n.attributes=t(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})),e;var r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:r}),e},r.dropNode=function(e){var t=this,n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));this.forEachEdge(e,function(e){t.dropEdge(e)}),this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},r.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=c(this,n,r,this.type)))throw new C('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new C('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t.source,a=t.target,o=t.attributes,u=t.undirected;return i===a?u?(i.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(i.directedSelfLoops--,this._directedSelfLoopCount--):u?(i.undirectedDegree--,a.undirectedDegree--):(i.outDegree--,a.inDegree--),q(this,u,t),u?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:o,source:i.key,target:a.key,undirected:u}),this},r.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},r.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},r.getAttribute=function(e){return this._attributes[e]},r.getAttributes=function(){return this._attributes},r.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},r.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.updateAttribute=function(e,t){if("function"!=typeof t)throw new P("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},r.replaceAttributes=function(e){if(!f(e))throw new P("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},r.mergeAttributes=function(e){if(!f(e))throw new P("Graph.mergeAttributes: provided attributes are not a plain object.");return s(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},r.getNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},r.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new C('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},r.hasNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},r.setNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new C('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new P("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:r.attributes,name:t}),this},r.updateNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new C('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new P("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new P("Graph.updateAttribute: updater should be a function.");var i=r.attributes,a=n(i[t]);return i[t]=a,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:r.attributes,name:t}),this},r.removeNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",attributes:n.attributes,name:t}),this},r.replaceNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!f(t))throw new P("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",attributes:n.attributes}),this},r.mergeNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!f(t))throw new P("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return s(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",attributes:n.attributes,data:t}),this},r.updateEachNodeAttributes=function(e,t){if("function"!=typeof e)throw new P("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!v(t))throw new P("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._nodes.values();!0!==(n=i.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},r.updateEachEdgeAttributes=function(e,t){if("function"!=typeof e)throw new P("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!v(t))throw new P("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._edges.values();!0!==(n=i.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},r.forEach=function(e){if("function"!=typeof e)throw new P("Graph.forEach: expecting a callback.");this.multi?Oe(!1,this,e):Ae(!1,this,e)},r.forEachUntil=function(e){if("function"!=typeof e)throw new P("Graph.forEach: expecting a callback.");this.multi?Oe(!0,this,e):Ae(!0,this,e)},r.adjacency=function(){return this.multi?(h=(s=this)._nodes.values(),p=s.type,v="outer",g=null,new L(function e(){var t;if("outer"===v)return!0===(t=h.next()).done?t:(c=t.value,v="directed",e());if("directed"===v)return"undirected"===p?(v="undirected",e()):(f=c.out,l=Object.keys(c.out),d=0,v="inner-directed",e());if("undirected"===v){if("directed"===p)return v="outer",e();f=c.undirected,l=Object.keys(c.undirected),d=0,v="inner-undirected"}if(!g&&d>=l.length)return v="inner-undirected"===v?"outer":"undirected",e();if(!g){var n=l[d++];return g=f[n].values(),e()}if((t=g.next()).done)return g=null,e();var r=t.value,i=r.target;return"inner-undirected"===v&&i.key===c.key&&(i=r.source),{done:!1,value:[c.key,i.key,c.attributes,i.attributes,r.key,r.attributes]}})):(a=(e=this)._nodes.values(),o=e.type,u="outer",new L(function e(){var s;if("outer"===u)return!0===(s=a.next()).done?s:(t=s.value,u="directed",e());if("directed"===u)return"undirected"===o?(u="undirected",e()):(r=t.out,n=Object.keys(t.out),i=0,u="inner-directed",e());if("undirected"===u){if("directed"===o)return u="outer",e();r=t.undirected,n=Object.keys(t.undirected),i=0,u="inner-undirected"}if(i>=n.length)return u="inner-undirected"===u?"outer":"undirected",e();var c=n[i++],l=r[c],f=l.target;return"inner-undirected"===u&&f.key===t.key&&(f=l.source),{done:!1,value:[t.key,f.key,t.attributes,f.attributes,l.key,l.attributes]}}));var e,t,n,r,i,a,o,u,s,c,l,f,d,h,p,v,g},r.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):M(this._nodes.keys(),this._nodes.size)},r.forEachNode=function(e){if("function"!=typeof e)throw new P("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,n){e(n,t.attributes)})},r.forEachNodeUntil=function(e){if("function"!=typeof e)throw new P("Graph.forEachNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next())&&!e((n=t.value).key,n.attributes););},r.nodeEntries=function(){var e=this._nodes.values();return new L(function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}})},r.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new C('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return Le(e,t)},r.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return Me(e,t)},r.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(n,r){e[t++]=Le(r,n)});var n=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,r){n[t++]=Me(r,e)}),{attributes:this.getAttributes(),nodes:e,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},r.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=De(e);if(n){if("not-object"===n)throw new P('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new P("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new P("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,a=void 0===i?{}:i;return t?this.mergeNode(r,a):this.addNode(r,a),this},r.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Pe(e);if(n){if("not-object"===n)throw new P('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new P("Graph.importEdge: missing souce.");if("no-target"===n)throw new P("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new P("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new P("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,a=e.attributes,o=void 0===a?{}:a,u=e.undirected,s=void 0!==u&&u;return"key"in e?(t?s?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:s?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,o):(t?s?this.mergeUndirectedEdge:this.mergeDirectedEdge:s?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,o),this},r.import=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),i),this;if(!f(e))throw new P("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!f(e.attributes))throw new P("Graph.import: invalid attributes. Expecting a plain object.");i?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}if(e.nodes){if(r=e.nodes,!Array.isArray(r))throw new P("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=r.length;tn)){var o=new Set;o.add(t.undirected[a]),t.undirected[a]=o,e._nodes.get(a).undirected[n]=o}})),this;var e},r.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},r.toJSON=function(){return this.export()},r.toString=function(){return"[object Graph]"},r.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,n){t[n]=e.attributes});var n={},r={};this._edges.forEach(function(t,i){var a=t.undirected?"--":"->",o="",u="(".concat(t.source.key,")").concat(a,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[u]?r[u]=0:r[u]++,o+="".concat(r[u],". ")):o+="[".concat(i,"]: "),n[o+=u]=t.attributes});var i={};for(var a in this)this.hasOwnProperty(a)&&!Fe.has(a)&&"function"!=typeof this[a]&&(i[a]=this[a]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,h(i,"constructor",this.constructor),i},n}(y.exports.EventEmitter);"undefined"!=typeof Symbol&&(qe.prototype[Symbol.for("nodejs.util.inspect.custom")]=qe.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge","update"].forEach(function(t){var n=e.name(t),r="add"===t?Ue:Ve;qe.prototype[n]=e.generateKey?function(i,a,o){return r(this,n,!0,"undirected"===(e.type||this.type),null,i,a,o,"update"===t)}:function(i,a,o,u){return r(this,n,!1,"undirected"===(e.type||this.type),i,a,o,u,"update"===t)}})}),"undefined"!=typeof Symbol&&(qe.prototype[Symbol.iterator]=qe.prototype.adjacency),ze=qe,K.forEach(function(e){var t=e.name,n=e.attacher;n(ze,t("Edge"),"mixed"),n(ze,t("DirectedEdge"),"directed"),n(ze,t("UndirectedEdge"),"undirected")}),function(e){J.forEach(function(t){var n,r,i,a;i=(n=t).type,a=n.direction,e.prototype[r=n.name]=function(e,t){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];if(!arguments.length)return ce(this,i);if(1===arguments.length){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return he(this.multi,"mixed"===i?this.type:i,a,n)}if(2===arguments.length){t=""+t;var o=this._nodes.get(e=""+e);if(!o)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(r,': could not find the "').concat(t,'" target node in the graph.'));return ye(i,this.multi,a,o,t)}throw new P("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,r=t.type,i=t.direction,a="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return le(this,r,n=e);if(2===arguments.length){n=t;var o=this._nodes.get(e=""+e);if(void 0===o)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return pe(this.multi,"mixed"===r?this.type:r,i,o,n)}if(3===arguments.length){t=""+t;var u=this._nodes.get(e=""+e);if(!u)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return be(r,this.multi,i,u,t,n)}throw new P("Graph.".concat(a,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,a="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[a]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return fe(this,r,n=e);if(2===arguments.length){n=t;var o=this._nodes.get(e=""+e);if(void 0===o)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return ve(this.multi,"mixed"===r?this.type:r,i,o,n)}if(3===arguments.length){t=""+t;var u=this._nodes.get(e=""+e);if(!u)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return me(r,this.multi,i,u,t,n)}throw new P("Graph.".concat(a,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return L.empty();if(!arguments.length)return de(this,n);if(1===arguments.length){var a=this._nodes.get(e=""+e);if(!a)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return ge(n,r,a)}if(2===arguments.length){t=""+t;var o=this._nodes.get(e=""+e);if(!o)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return _e(n,r,o,t)}throw new P("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(qe),function(e){we.forEach(function(t){var n,r,i,a;i=(n=t).type,a=n.direction,e.prototype[r=n.name]=function(e){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(t))throw new C("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(n))throw new C("Graph.".concat(r,': could not find the "').concat(n,'" node in the graph.'));return Re(this,i,a,t,n)}if(1===arguments.length){var o=this._nodes.get(e=""+e);if(void 0===o)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return ke("mixed"===i?this.type:i,a,o)}throw new P("Graph.".concat(r,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,r=t.type,i=t.direction,a="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return Se(n,n.undirected,r);if("string"==typeof t)return Se(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&je(i,n,n.in,r),"in"!==t&&je(i,n,n.out,r)),"directed"!==e&&je(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,a="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[a]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return Ne(n,n.undirected,r);if("string"==typeof t)return Ne(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&Ee(i,n,n.in,r)||"in"!==t&&Ee(i,n,n.out,r))||"directed"===e||Ee(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return L.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return Te(n,n.undirected);if("string"==typeof t)return Te(n,n[t])}var r=L.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=W(r,Ie(i,n,n.in))),"in"!==t&&(r=W(r,Ie(i,n,n.out)))),"directed"!==e&&(r=W(r,Ie(i,n,n.undirected))),r}("mixed"===n?this.type:n,r,t)}}(e,t)})}(qe);var Ke=function(e){function n(t){var n=s({type:"directed"},t);if("multi"in n&&!1!==n.multi)throw new P("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new P('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(qe),He=function(e){function n(t){var n=s({type:"undirected"},t);if("multi"in n&&!1!==n.multi)throw new P("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new P('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(qe),We=function(e){function n(t){var n=s({multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return e.call(this,n)||this}return t(n,e),n}(qe),Je=function(e){function n(t){var n=s({type:"directed",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new P('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(qe),Qe=function(e){function n(t){var n=s({type:"undirected",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new P('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(qe);function Xe(e){e.from=function(t,n){var r=s({},t.options,n),i=new e(r);return i.import(t),i}}return Xe(qe),Xe(Ke),Xe(He),Xe(We),Xe(Je),Xe(Qe),qe.Graph=qe,qe.DirectedGraph=Ke,qe.UndirectedGraph=He,qe.MultiGraph=We,qe.MultiDirectedGraph=Je,qe.MultiUndirectedGraph=Qe,qe.InvalidArgumentsGraphError=P,qe.NotFoundGraphError=C,qe.UsageGraphError=F,qe}()},23815:function(e,t,n){var r;e=n.nmd(e),(function(){var i,a="Expected a function",o="__lodash_hash_undefined__",u="__lodash_placeholder__",s=32,c=128,l=1/0,f=9007199254740991,d=NaN,h=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",b="[object Date]",m="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",k="[object Number]",S="[object Object]",j="[object Promise]",N="[object RegExp]",E="[object Set]",T="[object String]",I="[object Symbol]",R="[object WeakMap]",A="[object ArrayBuffer]",O="[object DataView]",L="[object Float32Array]",M="[object Float64Array]",D="[object Int8Array]",P="[object Int16Array]",C="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",G="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,W=RegExp(K.source),J=RegExp(H.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,me=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ne="\\ufe0e\\ufe0f",Ee="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Te="["+we+"]",Ie="["+Ee+"]",Re="["+xe+"]",Ae="\\d+",Oe="["+ke+"]",Le="["+Se+"]",Me="[^"+we+Ee+Ae+ke+Se+je+"]",De="\\ud83c[\\udffb-\\udfff]",Pe="[^"+we+"]",Ce="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Be="["+je+"]",Ge="(?:"+Le+"|"+Me+")",Ue="(?:"+Be+"|"+Me+")",Ve="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ze="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Re+"|"+De+")?",Ke="["+Ne+"]?",He=Ke+qe+"(?:\\u200d(?:"+[Pe,Ce,Fe].join("|")+")"+Ke+qe+")*",We="(?:"+[Oe,Ce,Fe].join("|")+")"+He,Je="(?:"+[Pe+Re+"?",Re,Ce,Fe,Te].join("|")+")",Qe=RegExp("['\u2019]","g"),Xe=RegExp(Re,"g"),Ye=RegExp(De+"(?="+De+")|"+Je+He,"g"),Ze=RegExp([Be+"?"+Le+"+"+Ve+"(?="+[Ie,Be,"$"].join("|")+")",Ue+"+"+ze+"(?="+[Ie,Be+Ge,"$"].join("|")+")",Be+"?"+Ge+"+"+Ve,Be+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,We].join("|"),"g"),$e=RegExp("[\\u200d"+we+xe+Ne+"]"),et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,rt={};rt[L]=rt[M]=rt[D]=rt[P]=rt[C]=rt[F]=rt[B]=rt[G]=rt[U]=!0,rt[v]=rt[g]=rt[A]=rt[y]=rt[O]=rt[b]=rt[m]=rt[_]=rt[x]=rt[k]=rt[S]=rt[N]=rt[E]=rt[T]=rt[R]=!1;var it={};it[v]=it[g]=it[A]=it[O]=it[y]=it[b]=it[L]=it[M]=it[D]=it[P]=it[C]=it[x]=it[k]=it[S]=it[N]=it[E]=it[T]=it[I]=it[F]=it[B]=it[G]=it[U]=!0,it[m]=it[_]=it[R]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,ut=parseInt,st="object"==typeof global&&global&&global.Object===Object&&global,ct="object"==typeof self&&self&&self.Object===Object&&self,lt=st||ct||Function("return this")(),ft=t&&!t.nodeType&&t,dt=ft&&e&&!e.nodeType&&e,ht=dt&&dt.exports===ft,pt=ht&&st.process,vt=function(){try{return dt&&dt.require&&dt.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),gt=vt&&vt.isArrayBuffer,yt=vt&&vt.isDate,bt=vt&&vt.isMap,mt=vt&&vt.isRegExp,_t=vt&&vt.isSet,wt=vt&&vt.isTypedArray;function xt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function kt(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Zt(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function $t(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var en=zt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),tn=zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+at[e]}function rn(e){return $e.test(e)}function an(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function on(e,t){return function(n){return e(t(n))}}function un(e,t){for(var n=-1,r=e.length,i=0,a=[];++n",""":'"',"'":"'"}),hn=function e(t){var n,r=(t=null==t?lt:hn.defaults(lt.Object(),t,hn.pick(lt,tt))).Array,ie=t.Date,we=t.Error,xe=t.Function,ke=t.Math,Se=t.Object,je=t.RegExp,Ne=t.String,Ee=t.TypeError,Te=r.prototype,Ie=Se.prototype,Re=t["__core-js_shared__"],Ae=xe.prototype.toString,Oe=Ie.hasOwnProperty,Le=0,Me=(n=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=Ie.toString,Pe=Ae.call(Se),Ce=lt._,Fe=je("^"+Ae.call(Oe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ht?t.Buffer:i,Ge=t.Symbol,Ue=t.Uint8Array,Ve=Be?Be.allocUnsafe:i,ze=on(Se.getPrototypeOf,Se),qe=Se.create,Ke=Ie.propertyIsEnumerable,He=Te.splice,We=Ge?Ge.isConcatSpreadable:i,Je=Ge?Ge.iterator:i,Ye=Ge?Ge.toStringTag:i,$e=function(){try{var e=ua(Se,"defineProperty");return e({},"",{}),e}catch(Oa){}}(),at=t.clearTimeout!==lt.clearTimeout&&t.clearTimeout,st=ie&&ie.now!==lt.Date.now&&ie.now,ct=t.setTimeout!==lt.setTimeout&&t.setTimeout,ft=ke.ceil,dt=ke.floor,pt=Se.getOwnPropertySymbols,vt=Be?Be.isBuffer:i,Dt=t.isFinite,zt=Te.join,pn=on(Se.keys,Se),vn=ke.max,gn=ke.min,yn=ie.now,bn=t.parseInt,mn=ke.random,_n=Te.reverse,wn=ua(t,"DataView"),xn=ua(t,"Map"),kn=ua(t,"Promise"),Sn=ua(t,"Set"),jn=ua(t,"WeakMap"),Nn=ua(Se,"create"),En=jn&&new jn,Tn={},In=Pa(wn),Rn=Pa(xn),An=Pa(kn),On=Pa(Sn),Ln=Pa(jn),Mn=Ge?Ge.prototype:i,Dn=Mn?Mn.valueOf:i,Pn=Mn?Mn.toString:i;function Cn(e){if(eu(e)&&!zo(e)&&!(e instanceof Un)){if(e instanceof Gn)return e;if(Oe.call(e,"__wrapped__"))return Ca(e)}return new Gn(e)}var Fn=function(){function e(){}return function(t){if(!$o(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Bn(){}function Gn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ar(e,t,n,r,a,o){var u,s=1&t,c=2&t,l=4&t;if(n&&(u=a?n(e,r,a,o):n(e)),u!==i)return u;if(!$o(e))return e;var f=zo(e);if(f){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return ji(e,u)}else{var d=la(e),h=d==_||d==w;if(Wo(e))return mi(e,s);if(d==S||d==v||h&&!a){if(u=c||h?{}:da(e),!s)return c?function(e,t){return Ni(e,ca(e),t)}(e,function(e,t){return e&&Ni(t,Au(t),e)}(u,e)):function(e,t){return Ni(e,sa(e),t)}(e,tr(u,e))}else{if(!it[d])return a?e:{};u=function(e,t,n){var r=e.constructor;switch(t){case A:return _i(e);case y:case b:return new r(+e);case O:return function(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case M:case D:case P:case C:case F:case B:case G:case U:return wi(e,n);case x:return new r;case k:case T:return new r(e);case N:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new r;case I:return function(e){return Dn?Se(Dn.call(e)):{}}(e)}}(e,d,s)}}o||(o=new Hn);var p=o.get(e);if(p)return p;o.set(e,u),au(e)?e.forEach(function(r){u.add(ar(r,t,n,r,e,o))}):tu(e)&&e.forEach(function(r,i){u.set(i,ar(r,t,n,i,e,o))});var g=f?i:(l?c?ea:$i:c?Au:Ru)(e);return St(g||e,function(r,i){g&&(r=e[i=r]),Zn(u,i,ar(r,t,n,i,e,o))}),u}function or(e,t,n){var r=n.length;if(null==e)return!r;for(e=Se(e);r--;){var a=n[r],o=e[a];if(o===i&&!(a in e)||!(0,t[a])(o))return!1}return!0}function ur(e,t,n){if("function"!=typeof e)throw new Ee(a);return Ea(function(){e.apply(i,n)},t)}function sr(e,t,n,r){var i=-1,a=Tt,o=!0,u=e.length,s=[],c=t.length;if(!u)return s;n&&(t=Rt(t,Jt(n))),r?(a=It,o=!1):t.length>=200&&(a=Xt,o=!1,t=new Kn(t));e:for(;++i-1},zn.prototype.set=function(e,t){var n=this.__data__,r=$n(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(xn||zn),string:new Vn}},qn.prototype.delete=function(e){var t=aa(this,e).delete(e);return this.size-=t?1:0,t},qn.prototype.get=function(e){return aa(this,e).get(e)},qn.prototype.has=function(e){return aa(this,e).has(e)},qn.prototype.set=function(e,t){var n=aa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,o),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Hn.prototype.clear=function(){this.__data__=new zn,this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Hn.prototype.get=function(e){return this.__data__.get(e)},Hn.prototype.has=function(e){return this.__data__.has(e)},Hn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof zn){var r=n.__data__;if(!xn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(e,t),this.size=n.size,this};var cr=Ii(yr),lr=Ii(br,!0);function fr(e,t){var n=!0;return cr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function dr(e,t,n){for(var r=-1,a=e.length;++r0&&n(u)?t>1?pr(u,t-1,n,r,i):At(i,u):r||(i[i.length]=u)}return i}var vr=Ri(),gr=Ri(!0);function yr(e,t){return e&&vr(e,t,Ru)}function br(e,t){return e&&gr(e,t,Ru)}function mr(e,t){return Et(t,function(t){return Xo(e[t])})}function _r(e,t){for(var n=0,r=(t=vi(t,e)).length;null!=e&&nt}function Sr(e,t){return null!=e&&Oe.call(e,t)}function jr(e,t){return null!=e&&t in Se(e)}function Nr(e,t,n){for(var a=n?It:Tt,o=e[0].length,u=e.length,s=u,c=r(u),l=1/0,f=[];s--;){var d=e[s];s&&t&&(d=Rt(d,Jt(t))),l=gn(d.length,l),c[s]=!n&&(t||o>=120&&d.length>=120)?new Kn(s&&d):i}d=e[0];var h=-1,p=c[0];e:for(;++h=u?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Dr(e,function(e,n,i){return{criteria:Rt(t,function(t){return t(e)}),index:++r,value:e}}))}function Ur(e,t,n){for(var r=-1,i=t.length,a={};++r-1;)u!==e&&He.call(u,s,1),He.call(e,s,1);return e}function zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;pa(i)?He.call(e,i,1):ui(e,i)}}return e}function qr(e,t){return e+dt(mn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=dt(t/2))&&(e+=e)}while(t);return n}function Hr(e,t){return Ta(xa(e,t,ns),e+"")}function Wr(e){return Jn(Bu(e))}function Jr(e,t){var n=Bu(e);return Aa(n,ir(t,0,n.length))}function Qr(e,t,n,r){if(!$o(e))return e;for(var a=-1,o=(t=vi(t,e)).length,u=o-1,s=e;null!=s&&++aa?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=r(a);++i>>1,o=e[a];null!==o&&!uu(o)&&(n?o<=t:o=200){var c=t?null:Ki(e);if(c)return sn(c);o=!1,i=Xt,s=new Kn}else s=t?[]:u;e:for(;++r=r?e:$r(e,t,n)}var bi=at||function(e){return lt.clearTimeout(e)};function mi(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function _i(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function wi(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function xi(e,t){if(e!==t){var n=e!==i,r=null===e,a=e==e,o=uu(e),u=t!==i,s=null===t,c=t==t,l=uu(t);if(!s&&!l&&!o&&e>t||o&&u&&c&&!s&&!l||r&&u&&c||!n&&c||!a)return 1;if(!r&&!o&&!l&&e1?n[a-1]:i,u=a>2?n[2]:i;for(o=e.length>3&&"function"==typeof o?(a--,o):i,u&&va(n[0],n[1],u)&&(o=a<3?i:o,a=1),t=Se(t);++r-1?a[o?t[u]:u]:i}}function Di(e){return Zi(function(t){var n=t.length,r=n,o=Gn.prototype.thru;for(e&&t.reverse();r--;){var u=t[r];if("function"!=typeof u)throw new Ee(a);if(o&&!s&&"wrapper"==na(u))var s=new Gn([],!0)}for(r=s?r:n;++r1&&m.reverse(),h&&fs))return!1;var l=o.get(e),f=o.get(t);if(l&&f)return l==t&&f==e;var d=-1,h=!0,p=2&n?new Kn:i;for(o.set(e,t),o.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return St(p,function(n){var r="_."+n[0];t&n[1]&&!Tt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ue):[]}(r),n)))}function Ra(e){var t=0,n=0;return function(){var r=yn(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Aa(e,t){var n=-1,r=e.length,a=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,ro(e,n)});function lo(e){var t=Cn(e);return t.__chain__=!0,t}function fo(e,t){return t(e)}var ho=Zi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,a=function(t){return rr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Un&&pa(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fo,args:[a],thisArg:i}),new Gn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(i),e})):this.thru(a)}),po=Ei(function(e,t,n){Oe.call(e,n)?++e[n]:nr(e,n,1)}),vo=Mi(Ua),go=Mi(Va);function yo(e,t){return(zo(e)?St:cr)(e,ia(t,3))}function bo(e,t){return(zo(e)?jt:lr)(e,ia(t,3))}var mo=Ei(function(e,t,n){Oe.call(e,n)?e[n].push(t):nr(e,n,[t])}),_o=Hr(function(e,t,n){var i=-1,a="function"==typeof t,o=Ko(e)?r(e.length):[];return cr(e,function(e){o[++i]=a?xt(t,e,n):Er(e,t,n)}),o}),wo=Ei(function(e,t,n){nr(e,n,t)});function xo(e,t){return(zo(e)?Rt:Dr)(e,ia(t,3))}var ko=Ei(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),So=Hr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&va(e,t[0],t[1])?t=[]:n>2&&va(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,pr(t,1),[])}),jo=st||function(){return lt.Date.now()};function No(e,t,n){return t=n?i:t,Wi(e,c,i,i,i,i,t=e&&null==t?e.length:t)}function Eo(e,t){var n;if("function"!=typeof t)throw new Ee(a);return e=hu(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var To=Hr(function(e,t,n){var r=1;if(n.length){var i=un(n,ra(To));r|=s}return Wi(e,r,t,n,i)}),Io=Hr(function(e,t,n){var r=3;if(n.length){var i=un(n,ra(Io));r|=s}return Wi(t,r,e,n,i)});function Ro(e,t,n){var r,o,u,s,c,l,f=0,d=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ee(a);function v(t){var n=r,a=o;return r=o=i,f=t,s=e.apply(a,n)}function g(e){return f=e,c=Ea(b,t),d?v(e):s}function y(e){var n=e-l;return l===i||n>=t||n<0||h&&e-f>=u}function b(){var e=jo();if(y(e))return m(e);c=Ea(b,function(e){var n=t-(e-l);return h?gn(n,u-(e-f)):n}(e))}function m(e){return c=i,p&&r?v(e):(r=o=i,s)}function _(){var e=jo(),n=y(e);if(r=arguments,o=this,l=e,n){if(c===i)return g(l);if(h)return bi(c),c=Ea(b,t),v(l)}return c===i&&(c=Ea(b,t)),s}return t=vu(t)||0,$o(n)&&(d=!!n.leading,u=(h="maxWait"in n)?vn(vu(n.maxWait)||0,t):u,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==i&&bi(c),f=0,r=l=o=c=i},_.flush=function(){return c===i?s:m(jo())},_}var Ao=Hr(function(e,t){return ur(e,1,t)}),Oo=Hr(function(e,t,n){return ur(e,vu(t)||0,n)});function Lo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(a);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Lo.Cache||qn),n}function Mo(e){if("function"!=typeof e)throw new Ee(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Lo.Cache=qn;var Do=gi(function(e,t){var n=(t=1==t.length&&zo(t[0])?Rt(t[0],Jt(ia())):Rt(pr(t,1),Jt(ia()))).length;return Hr(function(r){for(var i=-1,a=gn(r.length,n);++i=t}),Vo=Tr(function(){return arguments}())?Tr:function(e){return eu(e)&&Oe.call(e,"callee")&&!Ke.call(e,"callee")},zo=r.isArray,qo=gt?Jt(gt):function(e){return eu(e)&&xr(e)==A};function Ko(e){return null!=e&&Zo(e.length)&&!Xo(e)}function Ho(e){return eu(e)&&Ko(e)}var Wo=vt||vs,Jo=yt?Jt(yt):function(e){return eu(e)&&xr(e)==b};function Qo(e){if(!eu(e))return!1;var t=xr(e);return t==m||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ru(e)}function Xo(e){if(!$o(e))return!1;var t=xr(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Yo(e){return"number"==typeof e&&e==hu(e)}function Zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function $o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eu(e){return null!=e&&"object"==typeof e}var tu=bt?Jt(bt):function(e){return eu(e)&&la(e)==x};function nu(e){return"number"==typeof e||eu(e)&&xr(e)==k}function ru(e){if(!eu(e)||xr(e)!=S)return!1;var t=ze(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ae.call(n)==Pe}var iu=mt?Jt(mt):function(e){return eu(e)&&xr(e)==N},au=_t?Jt(_t):function(e){return eu(e)&&la(e)==E};function ou(e){return"string"==typeof e||!zo(e)&&eu(e)&&xr(e)==T}function uu(e){return"symbol"==typeof e||eu(e)&&xr(e)==I}var su=wt?Jt(wt):function(e){return eu(e)&&Zo(e.length)&&!!rt[xr(e)]},cu=Vi(Mr),lu=Vi(function(e,t){return e<=t});function fu(e){if(!e)return[];if(Ko(e))return ou(e)?ln(e):ji(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=la(e);return(t==x?an:t==E?sn:Bu)(e)}function du(e){return e?(e=vu(e))===l||e===-l?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function hu(e){var t=du(e),n=t%1;return t==t?n?t-n:t:0}function pu(e){return e?ir(hu(e),0,h):0}function vu(e){if("number"==typeof e)return e;if(uu(e))return d;if($o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Wt(e);var n=pe.test(e);return n||ge.test(e)?ut(e.slice(2),n?2:8):he.test(e)?d:+e}function gu(e){return Ni(e,Au(e))}function yu(e){return null==e?"":ai(e)}var bu=Ti(function(e,t){if(ma(t)||Ko(t))Ni(t,Ru(t),e);else for(var n in t)Oe.call(t,n)&&Zn(e,n,t[n])}),mu=Ti(function(e,t){Ni(t,Au(t),e)}),_u=Ti(function(e,t,n,r){Ni(t,Au(t),e,r)}),wu=Ti(function(e,t,n,r){Ni(t,Ru(t),e,r)}),xu=Zi(rr),ku=Hr(function(e,t){e=Se(e);var n=-1,r=t.length,a=r>2?t[2]:i;for(a&&va(t[0],t[1],a)&&(r=1);++n1),t}),Ni(e,ea(e),n),r&&(n=ar(n,7,Xi));for(var i=t.length;i--;)ui(n,t[i]);return n}),Du=Zi(function(e,t){return null==e?{}:function(e,t){return Ur(e,t,function(t,n){return Nu(e,n)})}(e,t)});function Pu(e,t){if(null==e)return{};var n=Rt(ea(e),function(e){return[e]});return t=ia(t),Ur(e,n,function(e,n){return t(e,n[0])})}var Cu=Hi(Ru),Fu=Hi(Au);function Bu(e){return null==e?[]:Qt(e,Ru(e))}var Gu=Oi(function(e,t,n){return t=t.toLowerCase(),e+(n?Uu(t):t)});function Uu(e){return Qu(yu(e).toLowerCase())}function Vu(e){return(e=yu(e))&&e.replace(be,en).replace(Xe,"")}var zu=Oi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),qu=Oi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ku=Ai("toLowerCase"),Hu=Oi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Wu=Oi(function(e,t,n){return e+(n?" ":"")+Qu(t)}),Ju=Oi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Qu=Ai("toUpperCase");function Xu(e,t,n){return e=yu(e),(t=n?i:t)===i?function(e){return et.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Yu=Hr(function(e,t){try{return xt(e,i,t)}catch(La){return Qo(La)?La:new we(La)}}),Zu=Zi(function(e,t){return St(t,function(t){t=Da(t),nr(e,t,To(e[t],e))}),e});function $u(e){return function(){return e}}var es=Di(),ts=Di(!0);function ns(e){return e}function rs(e){return Or("function"==typeof e?e:ar(e,1))}var is=Hr(function(e,t){return function(n){return Er(n,e,t)}}),as=Hr(function(e,t){return function(n){return Er(e,n,t)}});function os(e,t,n){var r=Ru(t),i=mr(t,r);null==n&&(!$o(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=mr(t,Ru(t)));var a=!($o(n)&&"chain"in n&&!n.chain),o=Xo(e);return St(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__),i=n.__actions__=ji(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,At([this.value()],arguments))})}),e}function us(){}var ss=Bi(Rt),cs=Bi(Nt),ls=Bi(Mt);function fs(e){return ga(e)?Vt(Da(e)):function(e){return function(t){return _r(t,e)}}(e)}var ds=Ui(),hs=Ui(!0);function ps(){return[]}function vs(){return!1}var gs=Fi(function(e,t){return e+t},0),ys=qi("ceil"),bs=Fi(function(e,t){return e/t},1),ms=qi("floor"),_s=Fi(function(e,t){return e*t},1),ws=qi("round"),xs=Fi(function(e,t){return e-t},0);return Cn.after=function(e,t){if("function"!=typeof t)throw new Ee(a);return e=hu(e),function(){if(--e<1)return t.apply(this,arguments)}},Cn.ary=No,Cn.assign=bu,Cn.assignIn=mu,Cn.assignInWith=_u,Cn.assignWith=wu,Cn.at=xu,Cn.before=Eo,Cn.bind=To,Cn.bindAll=Zu,Cn.bindKey=Io,Cn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return zo(e)?e:[e]},Cn.chain=lo,Cn.chunk=function(e,t,n){t=(n?va(e,t,n):t===i)?1:vn(hu(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var o=0,u=0,s=r(ft(a/t));oa?0:a+n),(r=r===i||r>a?a:hu(r))<0&&(r+=a),r=n>r?0:pu(r);n>>0)?(e=yu(e))&&("string"==typeof t||null!=t&&!iu(t))&&!(t=ai(t))&&rn(e)?yi(ln(e),0,n):e.split(t,n):[]},Cn.spread=function(e,t){if("function"!=typeof e)throw new Ee(a);return t=null==t?0:vn(hu(t),0),Hr(function(n){var r=n[t],i=yi(n,0,t);return r&&At(i,r),xt(e,this,i)})},Cn.tail=function(e){var t=null==e?0:e.length;return t?$r(e,1,t):[]},Cn.take=function(e,t,n){return e&&e.length?$r(e,0,(t=n||t===i?1:hu(t))<0?0:t):[]},Cn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?$r(e,(t=r-(t=n||t===i?1:hu(t)))<0?0:t,r):[]},Cn.takeRightWhile=function(e,t){return e&&e.length?ci(e,ia(t,3),!1,!0):[]},Cn.takeWhile=function(e,t){return e&&e.length?ci(e,ia(t,3)):[]},Cn.tap=function(e,t){return t(e),e},Cn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ee(a);return $o(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ro(e,t,{leading:r,maxWait:t,trailing:i})},Cn.thru=fo,Cn.toArray=fu,Cn.toPairs=Cu,Cn.toPairsIn=Fu,Cn.toPath=function(e){return zo(e)?Rt(e,Da):uu(e)?[e]:ji(Ma(yu(e)))},Cn.toPlainObject=gu,Cn.transform=function(e,t,n){var r=zo(e),i=r||Wo(e)||su(e);if(t=ia(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:$o(e)&&Xo(a)?Fn(ze(e)):{}}return(i?St:yr)(e,function(e,r,i){return t(n,e,r,i)}),n},Cn.unary=function(e){return No(e,1)},Cn.union=$a,Cn.unionBy=eo,Cn.unionWith=to,Cn.uniq=function(e){return e&&e.length?oi(e):[]},Cn.uniqBy=function(e,t){return e&&e.length?oi(e,ia(t,2)):[]},Cn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?oi(e,i,t):[]},Cn.unset=function(e,t){return null==e||ui(e,t)},Cn.unzip=no,Cn.unzipWith=ro,Cn.update=function(e,t,n){return null==e?e:si(e,t,pi(n))},Cn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:si(e,t,pi(n),r)},Cn.values=Bu,Cn.valuesIn=function(e){return null==e?[]:Qt(e,Au(e))},Cn.without=io,Cn.words=Xu,Cn.wrap=function(e,t){return Po(pi(t),e)},Cn.xor=ao,Cn.xorBy=oo,Cn.xorWith=uo,Cn.zip=so,Cn.zipObject=function(e,t){return di(e||[],t||[],Zn)},Cn.zipObjectDeep=function(e,t){return di(e||[],t||[],Qr)},Cn.zipWith=co,Cn.entries=Cu,Cn.entriesIn=Fu,Cn.extend=mu,Cn.extendWith=_u,os(Cn,Cn),Cn.add=gs,Cn.attempt=Yu,Cn.camelCase=Gu,Cn.capitalize=Uu,Cn.ceil=ys,Cn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=vu(n))==n?n:0),t!==i&&(t=(t=vu(t))==t?t:0),ir(vu(e),t,n)},Cn.clone=function(e){return ar(e,4)},Cn.cloneDeep=function(e){return ar(e,5)},Cn.cloneDeepWith=function(e,t){return ar(e,5,t="function"==typeof t?t:i)},Cn.cloneWith=function(e,t){return ar(e,4,t="function"==typeof t?t:i)},Cn.conformsTo=function(e,t){return null==t||or(e,t,Ru(t))},Cn.deburr=Vu,Cn.defaultTo=function(e,t){return null==e||e!=e?t:e},Cn.divide=bs,Cn.endsWith=function(e,t,n){e=yu(e),t=ai(t);var r=e.length,a=n=n===i?r:ir(hu(n),0,r);return(n-=t.length)>=0&&e.slice(n,a)==t},Cn.eq=Bo,Cn.escape=function(e){return(e=yu(e))&&J.test(e)?e.replace(H,tn):e},Cn.escapeRegExp=function(e){return(e=yu(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Cn.every=function(e,t,n){var r=zo(e)?Nt:fr;return n&&va(e,t,n)&&(t=i),r(e,ia(t,3))},Cn.find=vo,Cn.findIndex=Ua,Cn.findKey=function(e,t){return Pt(e,ia(t,3),yr)},Cn.findLast=go,Cn.findLastIndex=Va,Cn.findLastKey=function(e,t){return Pt(e,ia(t,3),br)},Cn.floor=ms,Cn.forEach=yo,Cn.forEachRight=bo,Cn.forIn=function(e,t){return null==e?e:vr(e,ia(t,3),Au)},Cn.forInRight=function(e,t){return null==e?e:gr(e,ia(t,3),Au)},Cn.forOwn=function(e,t){return e&&yr(e,ia(t,3))},Cn.forOwnRight=function(e,t){return e&&br(e,ia(t,3))},Cn.get=ju,Cn.gt=Go,Cn.gte=Uo,Cn.has=function(e,t){return null!=e&&fa(e,t,Sr)},Cn.hasIn=Nu,Cn.head=qa,Cn.identity=ns,Cn.includes=function(e,t,n,r){e=Ko(e)?e:Bu(e),n=n&&!r?hu(n):0;var i=e.length;return n<0&&(n=vn(i+n,0)),ou(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Cn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:hu(n);return i<0&&(i=vn(r+i,0)),Ft(e,t,i)},Cn.inRange=function(e,t,n){return t=du(t),n===i?(n=t,t=0):n=du(n),function(e,t,n){return e>=gn(t,n)&&e=-f&&e<=f},Cn.isSet=au,Cn.isString=ou,Cn.isSymbol=uu,Cn.isTypedArray=su,Cn.isUndefined=function(e){return e===i},Cn.isWeakMap=function(e){return eu(e)&&la(e)==R},Cn.isWeakSet=function(e){return eu(e)&&"[object WeakSet]"==xr(e)},Cn.join=function(e,t){return null==e?"":zt.call(e,t)},Cn.kebabCase=zu,Cn.last=Ja,Cn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var a=r;return n!==i&&(a=(a=hu(n))<0?vn(r+a,0):gn(a,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,a):Ct(e,Gt,a,!0)},Cn.lowerCase=qu,Cn.lowerFirst=Ku,Cn.lt=cu,Cn.lte=lu,Cn.max=function(e){return e&&e.length?dr(e,ns,kr):i},Cn.maxBy=function(e,t){return e&&e.length?dr(e,ia(t,2),kr):i},Cn.mean=function(e){return Ut(e,ns)},Cn.meanBy=function(e,t){return Ut(e,ia(t,2))},Cn.min=function(e){return e&&e.length?dr(e,ns,Mr):i},Cn.minBy=function(e,t){return e&&e.length?dr(e,ia(t,2),Mr):i},Cn.stubArray=ps,Cn.stubFalse=vs,Cn.stubObject=function(){return{}},Cn.stubString=function(){return""},Cn.stubTrue=function(){return!0},Cn.multiply=_s,Cn.nth=function(e,t){return e&&e.length?Br(e,hu(t)):i},Cn.noConflict=function(){return lt._===this&&(lt._=Ce),this},Cn.noop=us,Cn.now=jo,Cn.pad=function(e,t,n){e=yu(e);var r=(t=hu(t))?cn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(dt(i),n)+e+Gi(ft(i),n)},Cn.padEnd=function(e,t,n){e=yu(e);var r=(t=hu(t))?cn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var a=mn();return gn(e+a*(t-e+ot("1e-"+((a+"").length-1))),t)}return qr(e,t)},Cn.reduce=function(e,t,n){var r=zo(e)?Ot:qt,i=arguments.length<3;return r(e,ia(t,4),n,i,cr)},Cn.reduceRight=function(e,t,n){var r=zo(e)?Lt:qt,i=arguments.length<3;return r(e,ia(t,4),n,i,lr)},Cn.repeat=function(e,t,n){return t=(n?va(e,t,n):t===i)?1:hu(t),Kr(yu(e),t)},Cn.replace=function(){var e=arguments,t=yu(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Cn.result=function(e,t,n){var r=-1,a=(t=vi(t,e)).length;for(a||(a=1,e=i);++rf)return[];var n=h,r=gn(e,h);t=ia(t),e-=h;for(var i=Ht(r,t);++n=o)return e;var s=n-cn(r);if(s<1)return r;var c=u?yi(u,0,s).join(""):e.slice(0,s);if(a===i)return c+r;if(u&&(s+=c.length-s),iu(a)){if(e.slice(s).search(a)){var l,f=c;for(a.global||(a=je(a.source,yu(de.exec(a))+"g")),a.lastIndex=0;l=a.exec(f);)var d=l.index;c=c.slice(0,d===i?s:d)}}else if(e.indexOf(ai(a),s)!=s){var h=c.lastIndexOf(a);h>-1&&(c=c.slice(0,h))}return c+r},Cn.unescape=function(e){return(e=yu(e))&&W.test(e)?e.replace(K,dn):e},Cn.uniqueId=function(e){var t=++Le;return yu(e)+t},Cn.upperCase=Ju,Cn.upperFirst=Qu,Cn.each=yo,Cn.eachRight=bo,Cn.first=qa,os(Cn,function(){var e={};return yr(Cn,function(t,n){Oe.call(Cn.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),Cn.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Cn[e].placeholder=Cn}),St(["drop","take"],function(e,t){Un.prototype[e]=function(n){n=n===i?1:vn(hu(n),0);var r=this.__filtered__&&!t?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=gn(n,r.__takeCount__):r.__views__.push({size:gn(n,h),type:e+(r.__dir__<0?"Right":"")}),r},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),St(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ia(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),St(["head","last"],function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}}),St(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}}),Un.prototype.compact=function(){return this.filter(ns)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Hr(function(e,t){return"function"==typeof e?new Un(this):this.map(function(n){return Er(n,e,t)})}),Un.prototype.reject=function(e){return this.filter(Mo(ia(e)))},Un.prototype.slice=function(e,t){e=hu(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Un(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=hu(t))<0?n.dropRight(-t):n.take(t-e)),n)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(h)},yr(Un.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),a=Cn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);!a||(Cn.prototype[t]=function(){var t=this.__wrapped__,u=r?[1]:arguments,s=t instanceof Un,c=u[0],l=s||zo(t),f=function(e){var t=a.apply(Cn,At([e],u));return r&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(s=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=o&&!d,v=s&&!h;if(!o&&l){t=v?t:new Un(this);var g=e.apply(t,u);return g.__actions__.push({func:fo,args:[f],thisArg:i}),new Gn(g,d)}return p&&v?e.apply(this,u):(g=this.thru(f),p?r?g.value()[0]:g.value():g)})}),St(["pop","push","shift","sort","splice","unshift"],function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Cn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(zo(i)?i:[],e)}return this[n](function(n){return t.apply(zo(n)?n:[],e)})}}),yr(Un.prototype,function(e,t){var n=Cn[t];if(n){var r=n.name+"";Oe.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:t,func:n})}}),Tn[Pi(i,2).name]=[{name:"wrapper",func:i}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=ji(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ji(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ji(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=zo(e),r=t<0,i=n?e.length:0,a=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Cn.prototype.plant=function(e){for(var t,n=this;n instanceof Bn;){var r=Ca(n);r.__index__=0,r.__values__=i,t?a.__wrapped__=r:t=r;var a=r;n=n.__wrapped__}return a.__wrapped__=e,t},Cn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:fo,args:[Za],thisArg:i}),new Gn(t,this.__chain__)}return this.thru(Za)},Cn.prototype.toJSON=Cn.prototype.valueOf=Cn.prototype.value=function(){return li(this.__wrapped__,this.__actions__)},Cn.prototype.first=Cn.prototype.head,Je&&(Cn.prototype[Je]=function(){return this}),Cn}();lt._=hn,(r=(function(){return hn}).call(t,n,t,e))!==i&&(e.exports=r)}).call(this)},29369:function(e,t,n){var r=n(56284),i=n(67830);function a(){this.clear()}a.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},a.prototype.enqueue=function(e){return this.items.push(e),++this.size},a.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},a.prototype.peek=function(){if(this.size)return this.items[this.offset]},a.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.offset,r=0,i=this.items.length;n=e.length)return{done:!0};var n=e[t];return t++,{value:n,done:!1}})},a.prototype.entries=function(){var e=this.items,t=this.offset,n=0;return new r(function(){if(t>=e.length)return{done:!0};var r=e[t];return t++,{value:[n++,r],done:!1}})},"undefined"!=typeof Symbol&&(a.prototype[Symbol.iterator]=a.prototype.values),a.prototype.toString=function(){return this.toArray().join(",")},a.prototype.toJSON=function(){return this.toArray()},a.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:a,enumerable:!1}),e},"undefined"!=typeof Symbol&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.from=function(e){var t=new a;return i(e,function(e){t.enqueue(e)}),t},a.of=function(){return a.from(arguments)},e.exports=a},67830:function(e){var t="undefined"!=typeof ArrayBuffer,n="undefined"!=typeof Symbol;function r(e,r){var i,a,o,u,s;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(o=0,u=e.length;o=n?{done:!0}:{done:!1,value:e[r++]}})},t.empty=function(){var e=new t(null);return e.done=!0,e},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},86991:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(14180),t),i(n(75103),t),i(n(48965),t),i(n(32595),t),i(n(82417),t),i(n(92451),t),i(n(17735),t)},14180:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=function(){function e(t){g(this,e),this.termType="BlankNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}]),e}()},75103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;var r=n(14180),i=n(48965),a=n(32595),o=n(82417),u=n(92451),s=n(17735),c=0;t.DataFactory=function(){function e(t){g(this,e),this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||"df_".concat(c++,"_")}return b(e,[{key:"namedNode",value:function(e){return new o.NamedNode(e)}},{key:"blankNode",value:function(e){return new r.BlankNode(e||"".concat(this.blankNodePrefix).concat(this.blankNodeCounter++))}},{key:"literal",value:function(e,t){return new a.Literal(e,t)}},{key:"variable",value:function(e){return new s.Variable(e)}},{key:"defaultGraph",value:function(){return i.DefaultGraph.INSTANCE}},{key:"quad",value:function(e,t,n,r){return new u.Quad(e,t,n,r||this.defaultGraph())}},{key:"fromTerm",value:function(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(a.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}},{key:"fromQuad",value:function(e){return this.fromTerm(e)}},{key:"resetBlankNodeCounter",value:function(){this.blankNodeCounter=0}}]),e}()},48965:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;var n=function(){function e(){g(this,e),this.termType="DefaultGraph",this.value=""}return b(e,[{key:"equals",value:function(e){return!!e&&"DefaultGraph"===e.termType}}]),e}();t.DefaultGraph=n,n.INSTANCE=new n},32595:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;var r=n(82417),i=function(){function e(t,n){g(this,e),this.termType="Literal",this.value=t,"string"==typeof n?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING):n?(this.language="",this.datatype=n):(this.language="",this.datatype=e.XSD_STRING)}return b(e,[{key:"equals",value:function(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}]),e}();t.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=function(){function e(t){g(this,e),this.termType="NamedNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}]),e}()},92451:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=function(){function e(t,n,r,i){g(this,e),this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=r,this.graph=i}return b(e,[{key:"equals",value:function(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}]),e}()},17735:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=function(){function e(t){g(this,e),this.termType="Variable",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}]),e}()},31609:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedJavaScriptPrimitives=t.getSupportedRdfDatatypes=t.getTermRaw=t.toRdf=t.fromRdf=void 0;var a=n(86991),o=n(9938),u=n(66060);i(n(9938),t),i(n(88871),t),i(n(66060),t);var s=new a.DataFactory,c=new u.Translator;function l(e,t){return c.fromRdf(e,t)}c.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map(function(e){return s.namedNode(e)}),["string"]),c.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map(function(e){return s.namedNode(e)}),["boolean"]),c.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map(function(e){return s.namedNode(e)}),["number"]),c.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map(function(e){return s.namedNode(e)}),["number"]),c.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map(function(e){return s.namedNode(e)}),["object"]),t.fromRdf=l,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=s),c.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?l(e,t):e.value},t.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66060:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=function(){function e(){g(this,e),this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}return b(e,[{key:"registerHandler",value:function(e,t,n){var r,i=m(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;this.supportedRdfDatatypes.push(a),this.fromRdfHandlers[a.value]=e}}catch(l){i.e(l)}finally{i.f()}var o,u=m(n);try{for(u.s();!(o=u.n()).done;){var s=o.value,c=this.toRdfHandlers[s];c||(this.toRdfHandlers[s]=c=[]),c.push(e)}}catch(l){u.e(l)}finally{u.f()}}},{key:"fromRdf",value:function(e,t){var n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}},{key:"toRdf",value:function(e,t){var n=this.toRdfHandlers[typeof e];if(n){var r,i=m(n);try{for(i.s();!(r=i.n()).done;){var a=r.value.toRdf(e,t);if(a)return a}}catch(o){i.e(o)}finally{i.f()}}throw new Error("Invalid JavaScript value: '".concat(e,"'"))}},{key:"getSupportedRdfDatatypes",value:function(){return this.supportedRdfDatatypes}},{key:"getSupportedJavaScriptPrimitives",value:function(){return Object.keys(this.toRdfHandlers)}}],[{key:"incorrectRdfDataType",value:function(e){throw new Error("Invalid RDF ".concat(e.datatype.value," value: '").concat(e.value,"'"))}}]),e}()},80727:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;var r=n(66060),i=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&r.Translator.incorrectRdfDataType(e),!1}},{key:"toRdf",value:function(t,n){var r=n.datatype,i=n.dataFactory;return i.literal(t?"true":"false",r||i.namedNode(e.TYPE))}}]),e}();t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;var r=n(66060),i=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(t,n){switch(n&&!t.value.match(e.VALIDATORS[t.datatype.value.substr(33,t.datatype.value.length)])&&r.Translator.incorrectRdfDataType(t),t.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(t.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":var i=t.value.split("-");return new Date(0,parseInt(i[0],10)-1,parseInt(i[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(t.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(t.value+"-01");default:return new Date(t.value)}}},{key:"toRdf",value:function(t,n){var r=n.datatype,i=n.dataFactory;if(r=r||i.namedNode(e.TYPES[0]),!(t instanceof Date))return null;var a,o=t;switch(r.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 i.literal(a,r)}}]),e}();t.TypeHandlerDate=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}},38554:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;var r=n(66060),i=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){var n=parseFloat(e.value);return t&&isNaN(n)&&r.Translator.incorrectRdfDataType(e),n}},{key:"toRdf",value:function(t,n){var r=n.datatype,i=n.dataFactory;return r=r||i.namedNode(e.TYPES[0]),isNaN(t)?i.literal("NaN",r):isFinite(t)?t%1==0?null:i.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),r):i.literal(t>0?"INF":"-INF",r)}}]),e}();t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;var r=n(66060),i=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){var n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(e),n}},{key:"toRdf",value:function(t,n){var r=n.datatype,i=n.dataFactory;return i.literal(String(t),r||i.namedNode(t<=e.MAX_INT&&t>=e.MIN_INT?e.TYPES[0]:e.TYPES[1]))}}]),e}();t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},14608:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;var n=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(e){return e.value}},{key:"toRdf",value:function(e,t){var n=t.datatype;return t.dataFactory.literal(e,n)}}]),e}();t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(80727),t),i(n(52525),t),i(n(38554),t),i(n(37750),t),i(n(14608),t)},91052:function(e){function t(e,t,n,r,i,a,o){try{var u=e[a](o),s=u.value}catch(c){return void n(c)}u.done?t(s):Promise.resolve(s).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function u(e){t(o,i,a,u,s,"next",e)}function s(e){t(o,i,a,u,s,"throw",e)}u(void 0)})}},e.exports.default=e.exports,e.exports.__esModule=!0}},r={};function f(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,f),i.loaded=!0,i.exports}f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";var t,n,r,u,s,c;function d(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{s(r.next(e))}catch(t){a(t)}}function u(e){try{s(r.throw(e))}catch(t){a(t)}}function s(e){e.done?i(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(o,u)}s((r=r.apply(e,t||[])).next())})}function h(e){return new Promise(function(t,n){e.oncomplete=e.onsuccess=function(){return t(e.result)},e.onabort=e.onerror=function(){return n(e.error)}})}function v(){return c||(e="keyval",t=function(){return navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases?Promise.resolve():new Promise(function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()}).finally(function(){return clearInterval(e)});var e}().then(function(){var t=indexedDB.open("keyval-store");return t.onupgradeneeded=function(){return t.result.createObjectStore(e)},h(t)}),c=function(n,r){return t.then(function(t){return r(t.transaction(e,n).objectStore(e))})}),c;var e,t}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v();return t("readonly",function(t){return h(t.get(e))})}var _=f(71440);Math;var w=1/180*Math.PI,x={};function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,r=void 0===n?x.precision||4:n;return e=function(e){return Math.round(e/x.EPSILON)*x.EPSILON}(e),"".concat(parseFloat(e.toPrecision(r)))}function S(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function j(e){return function(e,t){return function(e,t,n){if(S(e)){n=n||function(e){return e.clone?e.clone():new Array(e.length)}(e);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";if(x.debug&&!function(e,t){if(e.length!==t)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=e*this.RANK,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+k(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t2*Math.PI)throw Error("radians");var d=u*Math.tan(n/2),h=d*a;return(new r).ortho({left:-h,right:h,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,r=void 0===n?45*Math.PI/180:n,i=e.aspect,a=void 0===i?1:i,o=e.near,u=void 0===o?.1:o,s=e.far,c=void 0===s?500:s;if((t=t||r)>2*Math.PI)throw Error("radians");return function(e,t,n,r,i){var a,o=1/Math.tan(t/2);e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+r)*(a=1/(r-i)),e[14]=2*i*r*a):(e[10]=-1,e[14]=-2*r)}(this,t,a,u,c),this.check()}},{key:"determinant",value:function(){return function(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],u=e[6],s=e[7],c=e[8],l=e[9],f=e[10],d=e[11],h=e[12],p=e[13],v=e[14],g=e[15];return(t*o-n*a)*(f*g-d*v)-(t*u-r*a)*(l*g-d*p)+(t*s-i*a)*(l*v-f*p)+(n*u-r*o)*(c*g-d*h)-(n*s-i*o)*(c*v-f*h)+(r*s-i*u)*(c*p-l*h)}(this)}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],a=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],a=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*r,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*r,e[7]=this[9]*i,e[8]=this[10]*a,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=u}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],l=t[8],f=t[9],d=t[10],h=t[11],p=t[12],v=t[13],g=t[14],y=t[15],b=n*u-r*o,m=n*s-i*o,_=n*c-a*o,w=r*s-i*u,x=r*c-a*u,k=i*c-a*s,S=l*v-f*p,j=l*g-d*p,N=l*y-h*p,E=f*g-d*v,T=f*y-h*v,I=d*y-h*g,R=b*I-m*T+_*E+w*N-x*j+k*S;R&&(e[0]=(u*I-s*T+c*E)*(R=1/R),e[1]=(i*T-r*I-a*E)*R,e[2]=(v*k-g*x+y*w)*R,e[3]=(d*x-f*k-h*w)*R,e[4]=(s*N-o*I-c*j)*R,e[5]=(n*I-i*N+a*j)*R,e[6]=(g*_-p*k-y*m)*R,e[7]=(l*k-d*_+h*m)*R,e[8]=(o*T-u*N+c*S)*R,e[9]=(r*N-n*T-a*S)*R,e[10]=(p*x-v*_+y*b)*R,e[11]=(f*_-l*x-h*b)*R,e[12]=(u*j-o*E-s*S)*R,e[13]=(n*E-r*j+i*S)*R,e[14]=(v*m-p*w-g*b)*R,e[15]=(l*w-f*m+d*b)*R)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return D(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return D(this,this,e),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],u=t[6],s=t[7],c=t[8],l=t[9],f=t[10],d=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*r,e[5]=o*i+l*r,e[6]=u*i+f*r,e[7]=s*i+d*r,e[8]=c*i-a*r,e[9]=l*i-o*r,e[10]=f*i-u*r,e[11]=d*i-s*r}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],u=t[2],s=t[3],c=t[8],l=t[9],f=t[10],d=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*r,e[1]=o*i-l*r,e[2]=u*i-f*r,e[3]=s*i-d*r,e[8]=a*r+c*i,e[9]=o*r+l*i,e[10]=u*r+f*i,e[11]=s*r+d*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],u=t[2],s=t[3],c=t[4],l=t[5],f=t[6],d=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*r,e[1]=o*i+l*r,e[2]=u*i+f*r,e[3]=s*i+d*r,e[4]=c*i-a*r,e[5]=l*i-o*r,e[6]=f*i-u*r,e[7]=d*i-s*r}(this,this,e),this.check()}},{key:"rotateXYZ",value:function(t){var n=e(t,3),r=n[0],i=n[1],a=n[2];return this.rotateX(r).rotateY(i).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return function(e,t,n,r){var i,a,o,u,s,c,l,f,d,h,p,v,g,y,b,m,_,w,x,k,S,j,N,E,T=r[0],I=r[1],R=r[2],A=Math.hypot(T,I,R);A0)return ce(e,n[0].id)},function(e,t){return t});function de(e,t){var n,r=t;switch(r.translation_units){case"centimeter":n=.01;break;case"millimeter":n=.001;break;case"meter":default:n=1}var i=[r.x_translation,r.y_translation,r.z_translation].map(function(e){return e*n}),a=[r.x_rotation,r.y_rotation,r.z_rotation].map(j),o=[r.x_scaling,r.y_scaling,r.z_scaling];return e.translate(i).rotateXYZ(a).scale(o)}var he=function(){function e(t){g(this,e),this.db=t,this.createGraph()}return b(e,[{key:"createGraph",value:function(){var e=this;this.graph=new V.DirectedGraph;var t=this.db.store;t.forSubjects(function(t){e.addNode(t.id,"SpatialObjectReference")},J.type,Z.SpatialObjectReference,null),t.forSubjects(function(t){e.addNode(t.id,"SpatialEntity")},J.type,Z.SpatialEntity,null);var n={};t.some(function(e){return n[e.subject.id]=e.object.id,!1},null,Z.spatialPlacement.source,null,null),t.some(function(t){var r=n[t.subject.id];return r&&e.addEdge(t.subject.id,r,t.object.id,"SpatialPlacement"),!1},null,Z.spatialPlacement.target,null,null)}},{key:"addNode",value:function(e,t){this.graph.mergeNode(e,{type:t})}},{key:"addEdge",value:function(e,t,n,r){this.graph.mergeDirectedEdge(t,n,{type:r,id:e})}},{key:"getTransformationMatrix",value:function(e,t){if(e===t)return new U(U.IDENTITY);if(this.graph.hasNode(e)&&this.graph.hasNode(t)){var n=this.db.store,r=new U(U.IDENTITY),i=q()(this.graph,e,t);if(i&&i.length>0){i.reverse();var a,o="",u=m(i);try{for(u.s();!(a=u.n()).done;){var s=a.value;if(o){var c=this.graph.getEdgeAttribute(s,o,"id");de(r,le(n,c))}o=s}}catch(l){u.e(l)}finally{u.f()}return r}}}}]),e}(),pe=function(){function t(e){g(this,t),this.db=e}return b(t,[{key:"getSpatialEntity",value:function(e){return ce(this.db.store,e)}},{key:"getExtractionSets",value:function(e){return oe(this.db.store,e)}},{key:"getExtractionSet",value:function(e){return ae(this.db.store,e)}},{key:"getAnatomicalStructures",value:function(e){return ue(this.db.store,e)}},{key:"getReferenceOrgans",value:function(){return se(this.db.store)}},{key:"getReferenceBody",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=Z.spatial.Male.id;break;case"Female":t=Z.spatial.Female.id;break;case"Both":default:t=Z.spatial.BothSexes.id}return this.getSpatialEntity(t)}},{key:"getReferenceOrganSets",value:function(t){var n=this,r=this.getReferenceOrgans();switch(null==t?void 0:t.sex){case"Male":r=r.filter(function(e){return"Male"===e.sex});break;case"Female":r=r.filter(function(e){return"Female"===e.sex})}return(null==t?void 0:t.debug)&&(r=r.map(function(e){return[[e],n.getAnatomicalStructures(e["@id"])]}).reduce(function(t,n){var r=e(n,2),i=r[0],a=r[1];return t.concat(a.length>0?a:i)},[])),r}},{key:"getReferenceSceneNodes",value:function(e){var t=this,n=this.getReferenceBody(e),r=p(this.getReferenceOrganSets(e).map(function(e){var r="http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of;return t.getSceneNode(e,n,{color:[255,255,255,255],opacity:r?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!r})}));return(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(Z.x("VHRightKidney").id),n,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(Z.x("VHLeftKidney").id),n,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(Z.x("VHSpleenCC1").id),n,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(Z.x("VHSpleenCC2").id),n,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(Z.x("VHSpleenCC3").id),n,{color:[0,255,0,127.5],wireframe:!0})])),r.filter(function(e){return void 0!==e})}},{key:"getReferenceOrganScene",value:function(e,t){var n,r,i=this,a=null!==(n=void 0!==(null==t?void 0:t.sex))&&void 0!==n&&n,o=this.getReferenceOrgans().filter(function(n){return n.representation_of===e&&(!a||n.sex===(null==t?void 0:t.sex))});if(o.length>0){var u=o[0],s=this.getSceneNode(u,u,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===u.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),c=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(function(e){return i.getSceneNode(e,u,{color:[255,255,255,229.5]})});return[s].concat(c).filter(function(e){return void 0!==e})}return[]}},{key:"getEntitySceneNodes",value:function(e){var t=this,n=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(function(e){return t.getSceneNode(e,n,{color:[255,255,255,229.5]})}).filter(function(e){return void 0!==e})}},{key:"getSceneNode",value:function(e,t){var n,r,i,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=null===(r=null===(n=null==e?void 0:e.object)||void 0===n?void 0:n.file_format)||void 0===r?void 0:r.startsWith("model/gltf"),s=this.db.graph.getTransformationMatrix(u&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(s){if(u)s=new U(U.IDENTITY).rotateX(j(90)).multiplyLeft(s);else{var c;switch(e.dimension_units){case"centimeter":c=.01;break;case"millimeter":c=.001;break;case"meter":default:c=1}var l=[e.x_dimension,e.y_dimension,e.z_dimension].map(function(e){return e*c/2});s.scale(l)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:u?null===(i=e.object)||void 0===i?void 0:i.file:void 0,scenegraphNode:u?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:s,tooltip:e.label},o)}}},{key:"getScene",value:function(e){return[].concat(p(this.getReferenceSceneNodes(e)),p(this.getEntitySceneNodes(e)))}}]),t}(),ve="https://entity.api.hubmapconsortium.org/entities/",ge=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),ye={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},be={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},me=function(){var t={};return Object.entries(ee).forEach(function(n){var r=e(n,2),i=r[0],a=r[1];return t[i]=a.id}),t}(),_e={BL:[me.body,me.bladder],RK:[me.body,me.kidney,me.right_kidney],LK:[me.body,me.kidney,me.left_kidney],HT:[me.body,me.heart],LI:[me.body,me.large_intestine,me.colon],SI:[me.body,me.small_instestine],LL:[me.body,me.respiratory_system,me.lung,me.left_lung],RL:[me.body,me.respiratory_system,me.lung,me.right_lung],LY:[me.body,me.lymph_node],SP:[me.body,me.spleen],TH:[me.body,me.thymus],UR:[me.body,me.ureter],LV:[me.body,me.liver],OT:[me.body]},we={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}},xe=function(){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;if(g(this,e),this.data=t,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"===this.data.entity_type){var u=this.data.descendants||[],s=(this.data.ancestors||[]).find(function(e){return"Donor"===e.entity_type});this.donor=this.getDonor(s,a);var c=this.getRuiLocation(t,this.donor);c?this.rui_location=c:this.bad=!0;var l=new Date(t.last_modified_timestamp).toLocaleDateString(),f=be[t.group_uuid]||t.group_name,d=t.created_by_user_displayname;this["@id"]=ve+t.uuid,this.label="Registered ".concat(l,", ").concat(d,", ").concat(f),this.link="".concat(a,"browse/sample/").concat(t.uuid);var h={},p=[];this.sections=p;var v=[];this.datasets=v;var y,b=m(u.filter(function(e){return"Sample"===e.entity_type}));try{for(b.s();!(y=b.n()).done;){var _=y.value,w=this.getSection(_,t,a);h[_.submission_id]=w,p.push(w),w.section_number=null!==(n=w.section_number)&&void 0!==n?n:p.length}}catch(A){b.e(A)}finally{b.f()}var x,k=m(u);try{for(k.s();!(x=k.n()).done;){var S=x.value;if("Dataset"===S.entity_type){var j=this.getDataset(S,i,a,o),N=(0,K.get)(S,["ingest_metadata","metadata","tissue_id"]);h[N]?null===(r=h[N].datasets)||void 0===r||r.push(j):v.push(j)}}}catch(A){k.e(A)}finally{k.f()}var E=null!=c?c:{},T="".concat(E.x_dimension," x ").concat(E.y_dimension," x ").concat(E.z_dimension," ").concat(E.dimension_units);this.section_count=E.slice_count||p.length;var I=parseFloat((E.slice_thickness||(E.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=I;var R=E.dimension_units||"millimeter";this.section_units=R,this.description="".concat(T,", ").concat(I," ").concat(R,", ").concat(t.specimen_type,", ").concat(this.section_count," Sections"),p.forEach(function(e,t){e.description="".concat(E.x_dimension," x ").concat(E.y_dimension," x ").concat(I," ").concat(R,", ").concat(I," ").concat(R,", ").concat(e.description),e.section_number=t+1})}else this.bad=!0}return b(e,[{key:"getSection",value:function(e,t,n){var r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":ve+e.uuid,"@type":"Sample",label:"Registered ".concat(r,", ").concat(e.created_by_user_displayname,", ").concat(be[e.group_uuid]||e.group_name),description:"".concat(t.specimen_type),link:"".concat(n,"browse/sample/").concat(e.uuid),sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}},{key:"getDataset",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0,o=new Date(e.last_modified_timestamp).toLocaleDateString(),u=be[e.group_uuid]||e.group_name,s=e.created_by_user_displayname,c=[].concat(p(e.data_types),[(0,K.get)(e,["ingest_metadata","metadata","assay_type"],"")]),l=c.join("|").toLowerCase(),f="assets/icons/ico-unknown.svg";return-1!==l.indexOf("10x")?(n="10x",f="assets/icons/ico-bulk-10x.svg"):-1!==l.indexOf("af")?(n="AF",f="assets/icons/ico-spatial-af.svg"):-1!==l.indexOf("codex")?(n="CODEX",f="assets/icons/ico-spatial-codex.svg"):-1!==l.indexOf("imc")?(n="IMC",f="assets/icons/ico-spatial-imc.svg"):-1!==l.indexOf("lc")&&-1===l.indexOf("af")?(n="LC",f="assets/icons/ico-bulk-lc.svg"):n=-1!==l.indexOf("maldi")?"MALDI":-1!==l.indexOf("pas")?"PAS":"OTHER",f=null!==(t=this.getDatasetThumbnail(e,r,a))&&void 0!==t?t:f,{"@id":ve+e.uuid,"@type":"Dataset",label:"Registered ".concat(o,", ").concat(s,", ").concat(u),description:"Data/Assay Types: ".concat(c.join(", ")),link:"".concat(i,"browse/dataset/").concat(e.uuid),technology:n,thumbnail:f}}},{key:"getDatasetThumbnail",value:function(e,t,n){if(e.thumbnail_file){var r=e.thumbnail_file;return"".concat(t,"/").concat(r.file_uuid,"/").concat(r.filename)+(n?"?token=".concat(n):"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){var i=(0,K.get)(e,"metadata.files",[]).filter(function(e){return/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)}).filter(function(e){return!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(e.rel_path)}).filter(function(e){return ge.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))}).map(function(r){return"".concat(t,"/").concat(e.uuid,"/").concat(r.rel_path)+(n?"?token=".concat(n):"")});if(i.length>0){var a=i[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(ge.has(a))return"assets/thumbnails/TMC-Vanderbilt/DR1/".concat(a)}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){var o=ye[e.hubmap_id];if(o)return"assets/thumbnails/TMC-Florida/".concat(o)}}},{key:"getDonor",value:function(e,t){var n,r=(e.description||"").toLowerCase();r.includes("female")?n="Female":r.includes("male")&&(n="Male");var i,a,o=r.match(/age ([0-9]+)/);o&&(i=(0,K.toNumber)(o[1]));var u,s=m((0,K.get)(e,"metadata.organ_donor_data",[]));try{for(s.s();!(u=s.n()).done;){var c=u.value;"Feminine gender"===c.preferred_term||"Female"===c.preferred_term?n="Female":"Masculine gender"===c.preferred_term||"Male"===c.preferred_term?n="Male":"Current chronological age"===c.preferred_term||"Age"===c.preferred_term?i=(0,K.toNumber)(c.data_value):"Body mass index"===c.preferred_term&&(a=(0,K.toNumber)(c.data_value))}}catch(h){s.e(h)}finally{s.f()}var l="";n&&i&&(l+="".concat(n,", Age ").concat(i),a&&(l+=", BMI ".concat(a.toFixed(1))));var f=new Date(e.last_modified_timestamp).toLocaleDateString(),d=be[e.group_uuid]||e.group_name;return{"@id":ve+e.uuid,"@type":"Donor",label:l,description:"Entered ".concat(f,", ").concat(e.created_by_user_displayname,", ").concat(d),link:"".concat(t,"browse/donor/").concat(e.uuid),age:i,sex:n,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}},{key:"getRuiLocation",value:function(e,t){var n,r,i=(e.ancestors||[]).find(function(e){return"Sample"===e.entity_type&&"organ"===e.specimen_type}),a=_e[null==i?void 0:i.organ]||[me.body],o=e.rui_location;if(o&&("string"==typeof o&&(o=JSON.parse(o)),o.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):o["@id"]&&(r=o)),r){r.ccf_annotations=a.concat(r.ccf_annotations||[]);var u=null!==(n=(0,K.get)(r,["placement","target"]))&&void 0!==n?n:"";u.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,K.set)(r,["placement","target"],u.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===u||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===u)&&(0,K.set)(r,["placement","target"],"Male"===t.sex?u.replace("#VH","#VHM")+"_Patch":u.replace("#VH","#VHF")+"_Patch")}return r}},{key:"getTissueBlock",value:function(){return(0,K.omit)(Object.assign({},this),["data","bad","donor"])}},{key:"toJsonLd",value:function(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}]),e}();function ke(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return d(this,void 0,void 0,regeneratorRuntime.mark(function o(){var u,s;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if("static"!==t){o.next=6;break}return o.next=3,fetch(e).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 3:u=o.sent,o.next=12;break;case 6:if("search-api"!==t){o.next=12;break}return s={"Content-type":"application/json"},r&&r.length>0&&(s.Authorization="Bearer ".concat(r)),o.next=11,fetch(e,{method:"POST",headers:s,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:{exists:{field:"rui_location"}}})}).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 11:u=o.sent;case 12:if(!u){o.next=14;break}return o.abrupt("return",function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={},u=(0,K.get)(e,"hits.hits",[]).map(function(e){return(0,K.get)(e,"_source",{})}).map(function(e){return new xe(e,n,r,i).toJsonLd()}),s=m(u);try{for(s.s();!(t=s.n()).done;){var c=t.value,l=c["@id"];o[l]?o[l].samples.push(c.samples[0]):o[l]=c}}catch(d){s.e(d)}finally{s.f()}var f=Object.values(o);return a&&(function(e){var t,n=[],r=0,i=m(e.filter(function(e){return e.samples.length>1}));try{for(i.s();!(t=i.n()).done;){for(var a=t.value,o=a.samples,u=function(e){var t=o[e]["@id"];n=n.concat(o[e].datasets);var i,a=m(o[e].sections);try{for(a.s();!(i=a.n()).done;){var u=i.value;n=n.concat(u.datasets)}}catch(d){a.e(d)}finally{a.f()}for(var s=e+1;s0&&console.log("\u26a0 ".concat(r," sections identified as blocks"))}(f),console.log(f.map(function(e){return Object.assign({"@context":we},e)}))),{"@context":we,"@graph":f}}(u,i,a,r));case 14:console.warn("Unable to load ".concat(e," as HuBMAP Data"));case 15:case"end":return o.stop()}},o)}))}function Se(e,t,n){var r,i=new Map,a=new Set;e.some(function(e){var n;return t.has(e.subject.id)&&(a.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,X.donor,null,null);var o,u=n(a),s=new Set,c=m(u);try{for(c.s();!(o=c.n()).done;){var l,f=o.value,d=m(null!==(r=i.get(f))&&void 0!==r?r:[]);try{for(d.s();!(l=d.n()).done;){var h=l.value;s.add(h)}}catch(p){d.e(p)}finally{d.f()}}}catch(p){c.e(p)}finally{c.f()}return s}function je(e,t){return function(n){return e.has(n.id)?t.add(n.id):void 0}}var Ne=(i(t={},Z.ontologyNode.label.id,"label"),i(t,Z.ontologyNode.parent.id,"parent"),i(t,Z.ontologyNode.synonymLabels.id,"synonymLabels"),t);function Ee(e,t){var n=_.DataFactory.namedNode(t),r={"@id":t,"@type":"OntologyTreeNode",id:t,parent:"",children:[],synonymLabels:[],label:""};return e.some(function(e){var t=Ne[e.predicate.id];if(t){var n="Literal"===e.object.termType?(0,H.fromRdf)(e.object):e.object.id;"synonymLabels"===t?r.synonymLabels.push(n):(0,K.set)(r,t,n)}return!1},n,null,null,null),r.children=e.getSubjects(Z.ontologyNode.children,n,null).map(function(e){return e.id}),r}var Te=(i(n={},X.label.id,"label"),i(n,X.description.id,"description"),i(n,X.link.id,"link"),n),Ie=Object.assign(Object.assign({},Te),i({},X.providerName.id,"providerName")),Re=Object.assign(Object.assign({},Te),(i(r={},X.technology.id,"technology"),i(r,X.thumbnail.id,"thumbnail"),r)),Ae=Object.assign(Object.assign({},Te),(i(u={},X.sampleType.id,"sampleType"),i(u,X.sectionNumber.id,"sectionNumber"),i(u,X.datasets.id,"datasets"),u)),Oe=Object.assign(Object.assign({},Te),(i(s={},X.sampleType.id,"sampleType"),i(s,X.sectionCount.id,"sectionCount"),i(s,X.sectionSize.id,"sectionSize"),i(s,X.sectionUnits.id,"sectionUnits"),i(s,X.donor.id,"donor"),i(s,X.spatialEntity.id,"spatialEntityId"),i(s,X.sections.id,"sections"),i(s,X.datasets.id,"datasets"),s)),Le=(0,K.memoize)(function(e,t){var n={"@id":t,"@type":"Donor"};return e.some(function(e){var t=Ie[e.predicate.id];if(t){var r="Literal"===e.object.termType?(0,H.fromRdf)(e.object):e.object.id;(0,K.set)(n,t,r)}return!1},_.DataFactory.namedNode(t),null,null,null),n},function(e,t){return t});function Me(e,t){var n={"@id":t,"@type":"Dataset"};return e.some(function(e){var t=Re[e.predicate.id];if(t){var r="Literal"===e.object.termType?(0,H.fromRdf)(e.object):e.object.id;(0,K.set)(n,t,r)}return!1},_.DataFactory.namedNode(t),null,null,null),n}var De=(0,K.memoize)(function(e,t){var n={"@id":t,"@type":"Sample",sections:[],datasets:[]};return e.some(function(t){var r=Oe[t.predicate.id];if(r){var i="Literal"===t.object.termType?(0,H.fromRdf)(t.object):t.object.id;if("sections"===r){var a=function(e,t){var n={"@id":t,"@type":"Sample",datasets:[]};return e.some(function(t){var r=Ae[t.predicate.id];if(r){var i="Literal"===t.object.termType?(0,H.fromRdf)(t.object):t.object.id;if("datasets"===r){var a=Me(e,i);n[r].push(a)}else(0,K.set)(n,r,i)}return!1},_.DataFactory.namedNode(t),null,null,null),n}(e,i);n[r].push(a)}else if("datasets"===r){var o=Me(e,i);n[r].push(o)}else"donor"===r?n[r]=Le(e,i):(0,K.set)(n,r,i)}return!1},_.DataFactory.namedNode(t),null,null,null),n},function(e,t){return t}),Pe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},Ce=Symbol("Comlink.proxy"),Fe=Symbol("Comlink.endpoint"),Be=Symbol("Comlink.releaseProxy"),Ge=Symbol("Comlink.thrown"),Ue=function(e){return"object"==typeof e&&null!==e||"function"==typeof e},Ve=new Map([["proxy",{canHandle:function(e){return Ue(e)&&e[Ce]},serialize:function(e){var t=new MessageChannel,n=t.port1,r=t.port2;return ze(e,n),[r,[r]]},deserialize:function(e){return e.start(),function(e,t){return He(e,[],void 0)}(e)}}],["throw",{canHandle:function(e){return Ue(e)&&Ge in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}}]]);function ze(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;n.addEventListener("message",function r(a){if(a&&a.data){var o,u=Object.assign({path:[]},a.data),s=u.id,c=u.type,f=u.path,d=(a.data.argumentList||[]).map(Ye);try{var h=f.slice(0,-1).reduce(function(e,t){return e[t]},t),v=f.reduce(function(e,t){return e[t]},t);switch(c){case"GET":o=v;break;case"SET":h[f.slice(-1)[0]]=Ye(a.data.value),o=!0;break;case"APPLY":o=v.apply(h,d);break;case"CONSTRUCT":o=function(e){return Object.assign(e,i({},Ce,!0))}(l(v,p(d)));break;case"ENDPOINT":var g=new MessageChannel,y=g.port1,b=g.port2;ze(t,b),o=function(e,t){return Qe.set(e,t),e}(y,[y]);break;case"RELEASE":o=void 0;break;default:return}}catch(h){o=i({value:h},Ge,0)}Promise.resolve(o).catch(function(e){return i({value:e},Ge,0)}).then(function(t){var i=e(Xe(t),2),a=i[0],o=i[1];n.postMessage(Object.assign(Object.assign({},a),{id:s}),o),"RELEASE"===c&&(n.removeEventListener("message",r),qe(n))})}}),n.start&&n.start()}function qe(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function Ke(e){if(e)throw new Error("Proxy has been released and is not useable")}function He(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=!1,a=new Proxy(r,{get:function(e,r){if(Ke(i),r===Be)return function(){return Ze(t,{type:"RELEASE",path:n.map(function(e){return e.toString()})}).then(function(){qe(t),i=!0})};if("then"===r){if(0===n.length)return{then:function(){return a}};var o=Ze(t,{type:"GET",path:n.map(function(e){return e.toString()})}).then(Ye);return o.then.bind(o)}return He(t,[].concat(p(n),[r]))},set:function(r,a,o){Ke(i);var u=e(Xe(o),2),s=u[0],c=u[1];return Ze(t,{type:"SET",path:[].concat(p(n),[a]).map(function(e){return e.toString()}),value:s},c).then(Ye)},apply:function(r,a,o){Ke(i);var u=n[n.length-1];if(u===Fe)return Ze(t,{type:"ENDPOINT"}).then(Ye);if("bind"===u)return He(t,n.slice(0,-1));var s=e(Je(o),2),c=s[0],l=s[1];return Ze(t,{type:"APPLY",path:n.map(function(e){return e.toString()}),argumentList:c},l).then(Ye)},construct:function(r,a){Ke(i);var o=e(Je(a),2),u=o[0],s=o[1];return Ze(t,{type:"CONSTRUCT",path:n.map(function(e){return e.toString()}),argumentList:u},s).then(Ye)}});return a}function We(e){return Array.prototype.concat.apply([],e)}function Je(e){var t=e.map(Xe);return[t.map(function(e){return e[0]}),We(t.map(function(e){return e[1]}))]}var Qe=new WeakMap;function Xe(t){var n,r=m(Ve);try{for(r.s();!(n=r.n()).done;){var i=e(n.value,2),a=i[0],o=i[1];if(o.canHandle(t)){var u=e(o.serialize(t),2);return[{type:"HANDLER",name:a,value:u[0]},u[1]]}}}catch(s){r.e(s)}finally{r.f()}return[{type:"RAW",value:t},Qe.get(t)||[]]}function Ye(e){switch(e.type){case"HANDLER":return Ve.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Ze(e,t,n){return new Promise(function(r){var i=new Array(4).fill(0).map(function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}).join("-");e.addEventListener("message",function t(n){!n.data||!n.data.id||n.data.id!==i||(e.removeEventListener("message",t),r(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}ze(new(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe;g(this,t),this.options=e,this.store=new _.Store(void 0,{factory:_.DataFactory}),this.graph=new he(this),this.scene=new pe(this)}return b(t,[{key:"connect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),n.next=4,this.initializing;case 4:return n.abrupt("return",this.store.size>0);case 5:case"end":return n.stop()}},n,this)}))}},{key:"cachedConnect",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,n,r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(new Date).getTime(),n="ccf-database.last_modified",r="ccf-database",e.next=5,y(n).catch(function(){});case 5:if(!((i=e.sent)&&t-new Date(+i).getTime()>36e5)){e.next=11;break}return e.next=9,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v();return t("readwrite",function(t){return e.forEach(function(e){return t.delete(e)}),h(t.transaction)})}([r,n]).catch(function(){});case 9:e.next=14;break;case 11:return e.next=13,y(r).catch(function(){});case 13:a=e.sent;case 14:if(!a){e.next=19;break}return e.next=17,this.deserialize(a);case 17:e.next=22;break;case 19:return e.next=21,this.doConnect();case 21:(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v();return t("readwrite",function(t){return e.forEach(function(e){return t.put(e[1],e[0])}),h(t.transaction)})})([[r,this.serialize()],[n,""+t]]).catch(function(){});case 22:case"end":return e.stop()}},e,this)}))}},{key:"doConnect",value:function(){var e,t;return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i,a,o,u=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(r=[],i=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],!(a=this.options.ccfOwlUrl).endsWith(".n3store.json")){n.next=8;break}return n.next=4,fetch(a).then(function(e){return e.text()}).catch(function(){return console.log("Couldn't locate serialized store.")});case 4:(o=n.sent)&&(this.store=(0,_.deserializeN3Store)(o,_.DataFactory)),n.next=9;break;case 8:(null==a?void 0:a.length)>0&&i.push(a);case 9:return this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?i.push(this.options.hubmapDataUrl):r.push(ke(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(function(e){if(e)return u.addDataSources([e])}))),r.push(this.addDataSources(i)),n.next=13,Promise.all(r);case 13:return n.next=15,this.synchronize();case 15:case"end":return n.stop()}},n,this)}))}},{key:"addDataSources",value:function(e,t){return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=null!=t?t:this.store,n.next=3,Promise.all(e.map(function(e){return d(i,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!=typeof e){t.next=17;break}if(!e.endsWith("jsonld")){t.next=6;break}return t.next=4,(0,_.addJsonLdToStore)(e,r);case 4:t.next=15;break;case 6:if(!e.endsWith("n3")){t.next=11;break}return t.next=9,(0,_.addN3ToStore)(e,r);case 9:t.next=15;break;case 11:if(t.t0=e.endsWith("rdf")||e.endsWith("owl")||e.endsWith("xml"),!t.t0){t.next=15;break}return t.next=15,(0,_.addRdfXmlToStore)(e,r);case 15:t.next=19;break;case 17:return t.next=19,(0,_.addJsonLdToStore)(e,r);case 19:case"end":return t.stop()}},t)}))}));case 3:return n.abrupt("return",this);case 4:case"end":return n.stop()}},n,this)}))}},{key:"synchronize",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise(function(e){setTimeout(e,500)});case 2:return this.graph.createGraph(),e.abrupt("return",this);case 4:case"end":return e.stop()}},e,this)}))}},{key:"serialize",value:function(){return(0,_.serializeN3Store)(this.store)}},{key:"deserialize",value:function(e){return d(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.store=(0,_.deserializeN3Store)(e,_.DataFactory),this.graph=new he(this),this.scene=new pe(this),t.next=5,new Promise(function(e){setTimeout(e,10)});case 5:case"end":return t.stop()}},t,this)}))}},{key:"getIds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){var n,r,i,a,o,u=function(e){var t=new Set;return e.forSubjects(function(e){return t.add(e.id)},X.spatialEntity,null,null),t}(e);if(u.size>0&&(u=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=new Set;if(e.forSubjects(je(t,r),X.spatialEntity,null,null),!n){var i=new Set;return t.forEach(function(e){return r.has(e)?void 0:i.add(e)}),i}return r}(e,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){var s=t.sex;u=Se(e,u,function(t){return function(e,t,n){var r=new Set;return e.forSubjects(je(t,r),X.sex,X[n],null),r}(e,t,s)})}if(u.size>0&&(null===(n=t.tmc)||void 0===n?void 0:n.length)>0&&(u=Se(e,u,function(n){return function(e,t,n){var r,i=new Set,a=m(n);try{for(a.s();!(r=a.n()).done;){var o=r.value,u=_.DataFactory.literal(o);e.forSubjects(je(t,i),X.providerName,u,null)}}catch(s){a.e(s)}finally{a.f()}return i}(e,n,t.tmc)})),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(e,t,n){var r,i=new Map,a=new Set,o=new Set;e.some(function(e){return t.has(e.subject.id)&&o.add(e.object.id),!1},null,X.sections,null,null),e.some(function(e){var n;return(t.has(e.subject.id)||o.has(e.subject.id))&&(a.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,X.datasets,null,null);var u,s=n(a),c=new Set,l=m(s);try{for(l.s();!(u=l.n()).done;){var f,d=u.value,h=m(null!==(r=i.get(d))&&void 0!==r?r:[]);try{for(h.s();!(f=h.n()).done;){var p=f.value;c.add(p)}}catch(v){h.e(v)}finally{h.f()}}}catch(v){l.e(v)}finally{l.f()}return c}(e,u,function(n){return function(e,t,n){var r,i=new Set,a=m(n);try{for(a.s();!(r=a.n()).done;){var o=r.value,u=_.DataFactory.literal(o);e.forSubjects(je(t,i),X.technology,u,null)}}catch(s){a.e(s)}finally{a.f()}return i}(e,n,t.technologies)})),u.size>0&&(null===(i=t.ontologyTerms)||void 0===i?void 0:i.length)>0&&(u=function(e,t,n){var r,i=new Map,a=new Set;e.some(function(e){var n;return t.has(e.subject.id)&&(a.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,X.spatialEntity,null,null);var o,u=n(a),s=new Set,c=m(u);try{for(c.s();!(o=c.n()).done;){var l,f=o.value,d=m(null!==(r=i.get(f))&&void 0!==r?r:[]);try{for(d.s();!(l=d.n()).done;){var h=l.value;s.add(h)}}catch(p){d.e(p)}finally{d.f()}}}catch(p){c.e(p)}finally{c.f()}return s}(e,u,function(n){return function(e,t,n){var r,i=new Set,a=m(n);try{for(a.s();!(r=a.n()).done;){var o=r.value,u=_.DataFactory.namedNode(o);e.forSubjects(je(t,i),Z.spatialEntity.ccf_annotations,u,null)}}catch(s){a.e(s)}finally{a.f()}return i}(e,n,t.ontologyTerms)})),u.size>0&&2===(null===(a=t.ageRange)||void 0===a?void 0:a.length)&&(0,K.isFinite)(t.ageRange[0])&&(0,K.isFinite)(t.ageRange[1])){var c=Math.max.apply(Math,p(t.ageRange)),l=Math.min.apply(Math,p(t.ageRange));1===l&&110===c||(u=Se(e,u,function(t){return function(e,t,n,r){var i=new Set;return e.some(function(e){if(t.has(e.subject.id)){var a=(0,H.fromRdf)(e.object);a>=n&&a<=r&&i.add(e.subject.id)}return!1},null,X.age,null,null),i}(e,t,l,c)}))}if(u.size>0&&2===(null===(o=t.bmiRange)||void 0===o?void 0:o.length)&&(0,K.isFinite)(t.bmiRange[0])&&(0,K.isFinite)(t.bmiRange[1])){var f=Math.max.apply(Math,p(t.bmiRange)),d=Math.min.apply(Math,p(t.bmiRange));13===d&&83===f||(u=Se(e,u,function(t){return function(e,t,n,r){var i=new Set;return e.some(function(e){if(t.has(e.subject.id)){var a=(0,H.fromRdf)(e.object);a>=n&&a<=r&&i.add(e.subject.id)}return!1},null,X.bmi,null,null),i}(e,t,d,f)}))}return u}(this.store,e)}},{key:"get",value:function(e){return this.store.getQuads(_.DataFactory.namedNode(e),null,null,null)}},{key:"search",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p(this.getIds(t)).map(function(t){return e.get(t)})}},{key:"getSpatialEntities",value:function(e){var t=this;return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),p(this.getIds(e)).map(function(e){return fe(t.store,e)})}},{key:"getDatasetTechnologyNames",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t=new Set;return e.some(function(e){return t.add(e.object.value),!1},null,X.technology,null,null),Array.from(t).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getProviderNames",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t=new Set;return e.some(function(e){return t.add(e.object.value),!1},null,X.providerName,null,null),Array.from(t).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getTissueBlockResults",value:function(e){return d(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),p(this.getIds(e)).map(function(e){return De(n.store,e)})));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getAggregateResults",value:function(t){return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",function(t,n){var r=new Set;n.some(function(e){return t.has(e.subject.id)&&r.add(e.object.id),!1},null,X.donor,null,null);var i=new Set;n.some(function(e){return r.has(e.subject.id)&&i.add(e.object.id),!1},null,X.providerUUID,null,null);var a=new Set;n.forSubjects(function(e){t.has(e.id)&&a.add(e.id)},X.spatialEntity,null,null);var o=new Set;n.some(function(e){return a.has(e.subject.id)&&o.add(e.object.id),!1},null,X.sections,null,null);var u=new Set;return n.some(function(e){var t=e.subject;return(a.has(t.id)||o.has(t.id))&&u.add(e.object.id),!1},null,X.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:r.size,"Tissue Blocks":a.size,"Tissue Sections":o.size,"Tissue Datasets":u.size}).map(function(t){var n=e(t,2);return{label:n[0],count:n[1]}})}(this.getIds(t),this.store));case 1:case"end":return n.stop()}},n,this)}))}},{key:"getOntologyTermOccurences",value:function(e){return d(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var n=new Map;t.some(function(t){return e.has(t.subject.id)&&(n.has(t.object.id)?n.get(t.object.id).push(t.subject.id):n.set(t.object.id,[t.subject.id])),!1},null,X.spatialEntity,null,null);var r={};return t.some(function(e){var t,i;if(n.has(e.subject.id)){var a=null!==(i=null===(t=n.get(e.subject.id))||void 0===t?void 0:t.length)&&void 0!==i?i:0;r[e.object.id]=a+(r[e.object.id]||0)}return!1},null,Z.spatialEntity.ccf_annotations,null,null),r}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getOntologyTreeModel",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t={root:ee.body.id,nodes:{}},n=new Set;e.some(function(e){return n.add(e.subject.id),n.add(e.predicate.id),!1},null,Z.ontologyNode.parent,null,null);var r,i=m(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;t.nodes[a]=Ee(e,a)}}catch(o){i.e(o)}finally{i.f()}return t}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getReferenceOrgans",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.scene.getReferenceOrgans());case 1:case"end":return e.stop()}},e,this)}))}},{key:"getScene",value:function(e){return d(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(this.graph.createGraph(),this.scene.getScene(e)));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getReferenceOrganScene",value:function(e,t){return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)));case 1:case"end":return n.stop()}},n,this)}))}}]),t}()))}()}()}(); \ No newline at end of file +!function(){function e(e,t){return r(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,a=[],o=!0,u=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(s){u=!0,i=s}finally{try{o||null==n.return||n.return()}finally{if(u)throw i}}return a}(e,t)||_(e,t)||n()}function t(e){return r(e)||v(e)||_(e)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(e){if(Array.isArray(e))return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function o(e){var t=f();return function(){var n,r=h(e);if(t){var i=h(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return l(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),d(r,e)})(e)}function l(e,t,n){return(l=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&d(i,n.prototype),i}).apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){return function(e){if(Array.isArray(e))return w(e)}(e)||v(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function _(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0?o-4:o;for(n=0;n>16&255,s[l++]=t>>8&255,s[l++]=255&t;return 2===u&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,s[l++]=255&t),1===u&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,s[l++]=t>>8&255,s[l++]=255&t),s},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,u=0,s=n-i;us?s:u+o));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=o.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function f(e,t,n){for(var r=[],i=t;i>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}n.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":4}],6:[function(e,t,n){(function(t){(function(){"use strict";var t=e("base64-js"),r=e("ieee754");n.Buffer=o,n.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},n.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|d(e,t),r=a(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function d(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return C(e).length;default:if(i)return r?-1:P(e).length;t=(""+t).toLowerCase(),i=!0}}function h(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return j(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function p(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),G(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){var a,o=1,u=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=n;au&&(n=u-s),a=n;a>=0;a--){for(var f=!0,d=0;di&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,n,r){return t.fromByteArray(0===n&&r===e.length?e:e.slice(n,r))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(s=(31&c)<<6|63&a)>127&&(l=s);break;case 3:o=e[i+2],128==(192&(a=e[i+1]))&&128==(192&o)&&(s=(15&c)<<12|(63&a)<<6|63&o)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:o=e[i+2],u=e[i+3],128==(192&(a=e[i+1]))&&128==(192&o)&&128==(192&u)&&(s=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,f=1):l>65535&&(r.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function A(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,i,a){return t=+t,n>>>=0,a||A(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function L(e,t,n,i,a){return t=+t,n>>>=0,a||A(e,0,n,8),r.write(e,t,n,i,52,8),n+8}n.kMaxLength=i,!(o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}())&&"undefined"!=typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.poolSize=8192,o.from=function(e,t,n){return u(e,t,n)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,o.alloc=function(e,t,n){return function(e,t,n){return s(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(B(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),B(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);it&&(e+=" ... "),""},o.prototype.compare=function(e,t,n,r,i){if(B(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),u=(n>>>=0)-(t>>>=0),s=Math.min(a,u),c=this.slice(r,i),l=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return m(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e],i=1,a=0;++a>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||I(e,4,this.length),r.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),r.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),r.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),r.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var a=0,o=1,u=0;for(this[t]=255&e;++a>0)-u&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var a=n-1,o=1,u=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===u&&0!==this[t+a+1]&&(u=1),this[t+a]=(e/o>>0)-u&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&0!==r&&(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function C(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(e,t,n){"use strict";t.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(function(t,n,r){return t+(0===r?"":",")+e(void 0===n||"symbol"==typeof n?null:n)},"")+"]":"{"+Object.keys(t).sort().reduce(function(n,r,i){return void 0===t[r]||"symbol"==typeof t[r]?n:n+(0===n.length?"":",")+e(r)+":"+e(t[r])},"")+"}"}},{}],8:[function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)})},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var s=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,a,o;if(c(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,function(e){console&&console.warn&&console.warn(e)}(u)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw u.context=o,u}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)a(s,this,t);else{var c=s.length,l=g(s,c);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return p(this,e,!0)},u.prototype.rawListeners=function(e){return p(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},{}],9:[function(e,t,n){n.read=function(e,t,n,r,i){var a,o,u=8*i-r-1,s=(1<>1,l=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-l)-1,h>>=-l,l+=u;l>0;a=256*a+e[t+f],f+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===s)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=c}return(h?-1:1)*o*Math.pow(2,a-r)},n.write=function(e,t,n,r,i,a){var o,u,s,c=8*a-i-1,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-o))<1&&(o--,s*=2),(t+=o+f>=1?d/s:d*Math.pow(2,1-f))*s>=2&&(o++,s/=2),o+f>=l?(u=0,o=l):o+f>=1?(u=(t*s-1)*Math.pow(2,i),o+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&u,h+=p,u/=256,i-=8);for(o=o<0;e[n+h]=255&o,h+=p,o/=256,c-=8);e[n+h-p]|=128*v}},{}],10:[function(e,t,n){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t,n){"use strict";var r=e("./types"),i=r.isArray,a=r.isObject,o=r.isString,u=e("./util").asArray,s=e("./url").prependBase,c=e("./JsonLdError"),l=e("./ResolvedContext");function d(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function h(e){var t=e.context,n=e.base;if(t){var r=t["@context"];if(o(r))t["@context"]=s(n,r);else if(i(r))for(var u=0;u10)){e.next=2;break}throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});case 2:if(!u.has(n)){e.next=4;break}throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:n});case 4:return u.add(n),e.prev=5,e.next=8,r(n);case 8:l=e.sent,s=l.document||null,o(s)&&(s=JSON.parse(s)),e.next=16;break;case 13:throw e.prev=13,e.t0=e.catch(5),new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:n,cause:e.t0});case 16:if(a(s)){e.next=18;break}throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:n});case 18:return e.abrupt("return",(s="@context"in s?{"@context":s["@context"]}:{"@context":{}},l.contextUrl&&(i(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(l.contextUrl)),{context:s,remoteDoc:l}));case 19:case"end":return e.stop()}},e,null,[[5,13]])}))()}}]),e}()},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(e,t,n){"use strict";t.exports=function(e){a(n,e);var t=o(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"An unspecified JSON-LD error occurred.",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"jsonld.Error",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return g(this,n),(e=t.call(this,r)).name=i,e.message=r,e.details=a,e}return n}(c(Error))},{}],13:[function(e,t,n){"use strict";t.exports=function(e){var t=function(){function e(){g(this,e)}return b(e,[{key:"toString",value:function(){return"[object JsonLdProcessor]"}}]),e}();return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],14:[function(e,t,n){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(e,t,n){"use strict";t.exports=function(){function e(){g(this,e),this._requests={}}return b(e,[{key:"wrapLoader",value:function(e){var t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}},{key:"add",value:function(e){var t=this;return f(regeneratorRuntime.mark(function n(){var r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!(r=t._requests[e])){n.next=3;break}return n.abrupt("return",Promise.resolve(r));case 3:return r=t._requests[e]=t._loader(e),n.prev=4,n.next=7,r;case 7:return n.abrupt("return",n.sent);case 8:return n.prev=8,delete t._requests[e],n.finish(8);case 11:case"end":return n.stop()}},n,null,[[4,,8,11]])}))()}}]),e}()},{}],16:[function(e,t,n){"use strict";var r=e("lru-cache");t.exports=function(){function e(t){var n=t.document;g(this,e),this.document=n,this.cache=new r({max:10})}return b(e,[{key:"getProcessed",value:function(e){return this.cache.get(e)}},{key:"setProcessed",value:function(e,t){this.cache.set(e,t)}}]),e}()},{"lru-cache":33}],17:[function(n,r,a){"use strict";var o,u=n("./JsonLdError"),s=n("./types"),c=s.isArray,l=s.isObject,d=s.isString,h=s.isUndefined,p=n("./graphTypes"),v=p.isList,g=p.isValue,y=p.isGraph,b=p.isSimpleGraph,_=p.isSubjectReference,w=n("./context"),x=w.expandIri,k=w.getContextValue,S=w.isKeyword,j=w.process,N=w.processingMode,E=n("./url"),T=E.removeBase,I=E.prependBase,R=n("./util"),A=R.addValue,O=R.asArray,L=R.compareShortestLeast,M={};function D(e,t,n){if("@nest"!==x(e,t,{vocab:!0},n))throw new u("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}r.exports=M,M.compact=(o=f(regeneratorRuntime.mark(function e(n){var r,a,o,s,f,p,w,x,E,T,I,R,L;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.activeCtx,a=n.activeProperty,o=void 0===a?null:a,s=n.element,f=n.options,p=void 0===f?{}:f,w=n.compactionMap,x=void 0===w?function(){}:w,!c(s)){e.next=21;break}E=[],T=0;case 4:if(!(T1&&(P=Array.from(P).sort()),C=r,F=m(P),e.prev=27,F.s();case 29:if((B=F.n()).done){e.next=39;break}if(G=B.value,U=M.compactIri({activeCtx:C,iri:G,relativeTo:{vocab:!0}}),V=k(R,U,"@context"),e.t1=h(V),e.t1){e.next=37;break}return e.next=36,j({activeCtx:r,localCtx:V,options:p,propagate:!1});case 36:r=e.sent;case 37:e.next=29;break;case 39:e.next=44;break;case 41:e.prev=41,e.t2=e.catch(27),F.e(e.t2);case 44:return e.prev=44,F.f(),e.finish(44);case 47:z=Object.keys(s).sort(),q=m(z),e.prev=49,q.s();case 51:if((K=q.n()).done){e.next=184;break}if(H=K.value,W=s[H],"@id"===H){e.next=180;break}if("@type"===H){e.next=174;break}if("@reverse"===H){e.next=167;break}if("@preserve"===H){e.next=161;break}if("@index"===H){e.next=155;break}if("@graph"===H||"@list"===H||"@included"===H||!S(H)){e.next=64;break}J=M.compactIri({activeCtx:r,iri:H,relativeTo:{vocab:!0}}),A(I,J,W),e.next=153;break;case 64:if(c(W)){e.next=66;break}throw new u("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");case 66:0===W.length&&(Q=M.compactIri({activeCtx:r,iri:H,value:W,relativeTo:{vocab:!0},reverse:T}),X=r.mappings.has(Q)?r.mappings.get(Q)["@nest"]:null,Y=I,X&&(D(r,X,p),l(I[X])||(I[X]={}),Y=I[X]),A(Y,Q,W,{propertyIsArray:!0})),Z=m(W),e.prev=68,Z.s();case 70:if(($=Z.n()).done){e.next=145;break}return ee=$.value,te=M.compactIri({activeCtx:r,iri:H,value:ee,relativeTo:{vocab:!0},reverse:T}),ne=r.mappings.has(te)?r.mappings.get(te)["@nest"]:null,re=I,ne&&(D(r,ne,p),l(I[ne])||(I[ne]={}),re=I[ne]),ie=k(r,te,"@container")||[],ae=y(ee),oe=v(ee),ue=void 0,oe?ue=ee["@list"]:ae&&(ue=ee["@graph"]),e.next=80,M.compact({activeCtx:r,activeProperty:te,element:oe||ae?ue:ee,options:p,compactionMap:x});case 80:if(se=e.sent,!oe){e.next=86;break}if(c(se)||(se=[se]),!ie.includes("@list")){e.next=85;break}return A(re,te,se,{valueIsArray:!0,allowDuplicate:!0}),e.abrupt("continue",143);case 85:se=i({},M.compactIri({activeCtx:r,iri:"@list",relativeTo:{vocab:!0}}),se),"@index"in ee&&(se[M.compactIri({activeCtx:r,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]);case 86:if(!ae){e.next=90;break}ie.includes("@graph")&&(ie.includes("@id")||ie.includes("@index")&&b(ee))?(ce=void 0,re.hasOwnProperty(te)?ce=re[te]:re[te]=ce={},le=(ie.includes("@id")?ee["@id"]:ee["@index"])||M.compactIri({activeCtx:r,iri:"@none",relativeTo:{vocab:!0}}),A(ce,le,se,{propertyIsArray:!p.compactArrays||ie.includes("@set")})):ie.includes("@graph")&&b(ee)?(c(se)&&se.length>1&&(se={"@included":se}),A(re,te,se,{propertyIsArray:!p.compactArrays||ie.includes("@set")})):(c(se)&&1===se.length&&p.compactArrays&&(se=se[0]),se=i({},M.compactIri({activeCtx:r,iri:"@graph",relativeTo:{vocab:!0}}),se),"@id"in ee&&(se[M.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}})]=ee["@id"]),"@index"in ee&&(se[M.compactIri({activeCtx:r,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]),A(re,te,se,{propertyIsArray:!p.compactArrays||ie.includes("@set")})),e.next=143;break;case 90:if(!(ie.includes("@language")||ie.includes("@index")||ie.includes("@id")||ie.includes("@type"))){e.next=141;break}if(fe=void 0,de=void 0,re.hasOwnProperty(te)?fe=re[te]:re[te]=fe={},!ie.includes("@language")){e.next=96;break}g(se)&&(se=se["@value"]),de=ee["@language"],e.next=138;break;case 96:if(!ie.includes("@index")){e.next=117;break}if(he=k(r,te,"@index")||"@index",pe=M.compactIri({activeCtx:r,iri:he,relativeTo:{vocab:!0}}),"@index"!==he){e.next=102;break}de=ee["@index"],delete se[pe],e.next=115;break;case 102:if(ye=void 0,ve=O(se[he]||[]),ge=t(ve),de=ge[0],ye=ge.slice(1),!d(de)){e.next=114;break}e.t3=ye.length,e.next=0===e.t3?107:1===e.t3?109:111;break;case 107:return delete se[he],e.abrupt("break",112);case 109:return se[he]=ye[0],e.abrupt("break",112);case 111:se[he]=ye;case 112:e.next=115;break;case 114:de=null;case 115:e.next=138;break;case 117:if(!ie.includes("@id")){e.next=122;break}be=M.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}}),de=se[be],delete se[be],e.next=138;break;case 122:if(!ie.includes("@type")){e.next=138;break}me=M.compactIri({activeCtx:r,iri:"@type",relativeTo:{vocab:!0}}),_e=void 0,e.t4=(n=O(se[me]||[]),a=t(n),de=a[0],(_e=a.slice(1)).length),e.next=0===e.t4?128:1===e.t4?130:132;break;case 128:return delete se[me],e.abrupt("break",133);case 130:return se[me]=_e[0],e.abrupt("break",133);case 132:se[me]=_e;case 133:if(e.t5=1===Object.keys(se).length&&"@id"in ee,!e.t5){e.next=138;break}return e.next=137,M.compact({activeCtx:r,activeProperty:te,element:{"@id":ee["@id"]},options:p,compactionMap:x});case 137:se=e.sent;case 138:de||(de=M.compactIri({activeCtx:r,iri:"@none",relativeTo:{vocab:!0}})),A(fe,de,se,{propertyIsArray:ie.includes("@set")}),e.next=143;break;case 141:we=!p.compactArrays||ie.includes("@set")||ie.includes("@list")||c(se)&&0===se.length||"@list"===H||"@graph"===H,A(re,te,se,{propertyIsArray:we});case 143:e.next=70;break;case 145:e.next=150;break;case 147:e.prev=147,e.t6=e.catch(68),Z.e(e.t6);case 150:return e.prev=150,Z.f(),e.finish(150);case 153:e.next=159;break;case 155:if(!(k(r,o,"@container")||[]).includes("@index")){e.next=157;break}return e.abrupt("continue",182);case 157:xe=M.compactIri({activeCtx:r,iri:H,relativeTo:{vocab:!0}}),A(I,xe,W);case 159:e.next=165;break;case 161:return e.next=163,M.compact({activeCtx:r,activeProperty:o,element:W,options:p,compactionMap:x});case 163:ke=e.sent,c(ke)&&0===ke.length||A(I,H,ke);case 165:e.next=172;break;case 167:return e.next=169,M.compact({activeCtx:r,activeProperty:"@reverse",element:W,options:p,compactionMap:x});case 169:for(je in Se=e.sent)r.mappings.has(je)&&r.mappings.get(je).reverse&&(Ne=Se[je],Ee=(k(r,je,"@container")||[]).includes("@set")||!p.compactArrays,A(I,je,Ne,{propertyIsArray:Ee}),delete Se[je]);Object.keys(Se).length>0&&(Te=M.compactIri({activeCtx:r,iri:H,relativeTo:{vocab:!0}}),A(I,Te,Se));case 172:e.next=178;break;case 174:1===(Ie=O(W).map(function(e){return M.compactIri({activeCtx:R,iri:e,relativeTo:{vocab:!0}})})).length&&(Ie=Ie[0]),Re=M.compactIri({activeCtx:r,iri:"@type",relativeTo:{vocab:!0}}),Ae=(k(r,Re,"@container")||[]).includes("@set")&&N(r,1.1)||c(Ie)&&0===W.length,A(I,Re,Ie,{propertyIsArray:Ae});case 178:e.next=182;break;case 180:1===(Oe=O(W).map(function(e){return M.compactIri({activeCtx:r,iri:e,relativeTo:{vocab:!1},base:p.base})})).length&&(Oe=Oe[0]),I[M.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}})]=Oe;case 182:e.next=51;break;case 184:e.next=189;break;case 186:e.prev=186,e.t7=e.catch(49),q.e(e.t7);case 189:return e.prev=189,q.f(),e.finish(189);case 192:return e.abrupt("return",{v:I});case 193:case"end":return e.stop()}},e,null,[[27,41,44,47],[49,186,189,192],[68,147,150,153]])})(),"t3",29);case 29:if("object"!=typeof(L=e.t3)){e.next=32;break}return e.abrupt("return",L.v);case 32:return e.abrupt("return",s);case 33:case"end":return e.stop()}},e)})),function(e){return o.apply(this,arguments)}),M.compactIri=function(t){var n=t.activeCtx,r=t.iri,i=t.value,a=void 0===i?null:i,o=t.relativeTo,s=void 0===o?{vocab:!1}:o,c=t.reverse,f=void 0!==c&&c,d=t.base,h=void 0===d?null:d;if(null===r)return r;n.isPropertyTermScoped&&n.previousContext&&(n=n.previousContext);var p=n.getInverse();if(S(r)&&r in p&&"@none"in p[r]&&"@type"in p[r]["@none"]&&"@none"in p[r]["@none"]["@type"])return p[r]["@none"]["@type"]["@none"];if(s.vocab&&r in p){var b=n["@language"]||"@none",_=[];l(a)&&"@index"in a&&!("@graph"in a)&&_.push("@index","@index@set"),l(a)&&"@preserve"in a&&(a=a["@preserve"][0]),y(a)?("@index"in a&&_.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in a&&_.push("@graph@id","@graph@id@set"),_.push("@graph","@graph@set","@set"),"@index"in a||_.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in a||_.push("@graph@id","@graph@id@set")):l(a)&&!g(a)&&_.push("@id","@id@set","@type","@set@type");var w="@language",x="@null";if(f)w="@type",x="@reverse",_.push("@set");else if(v(a)){"@index"in a||_.push("@list");var k=a["@list"];if(0===k.length)w="@any",x="@none";else{for(var j=0===k.length?b:null,N=null,E=0;E=0;--q){var K,H=G[q],W=m(H.terms);try{for(W.s();!(K=W.n()).done;){var J=K.value,Q=J+":"+r.substr(H.iri.length);n.mappings.get(J)._prefix&&(!n.mappings.has(Q)||null===a&&n.mappings.get(Q)["@id"]===r)&&(null===B||L(Q,B)<0)&&(B=Q)}}catch(te){W.e(te)}finally{W.f()}}if(null!==B)return B;var X,Y=m(n.mappings);try{for(Y.s();!(X=Y.n()).done;){var Z=e(X.value,2),$=Z[0],ee=Z[1];if(ee&&ee._prefix&&r.startsWith($+":"))throw new u('Absolute IRI "'.concat(r,'" confused with prefix "').concat($,'".'),"jsonld.SyntaxError",{code:"IRI confused with prefix",context:n})}}catch(te){Y.e(te)}finally{Y.f()}return s.vocab?r:"@base"in n?n["@base"]?T(I(h,n["@base"]),r):r:T(h,r)},M.compactValue=function(e){var t=e.activeCtx,n=e.activeProperty,r=e.value,a=e.options;if(g(r)){var o=k(t,n,"@type"),u=k(t,n,"@language"),s=k(t,n,"@direction"),c=k(t,n,"@container")||[],l="@index"in r&&!c.includes("@index");if(!l&&"@none"!==o&&(r["@type"]===o||"@language"in r&&r["@language"]===u&&"@direction"in r&&r["@direction"]===s||"@language"in r&&r["@language"]===u||"@direction"in r&&r["@direction"]===s))return r["@value"];var f=Object.keys(r).length,h=1===f||2===f&&"@index"in r&&!l,p="@language"in t,v=d(r["@value"]),y=t.mappings.has(n)&&null===t.mappings.get(n)["@language"];if(h&&"@none"!==o&&(!p||!v||y))return r["@value"];var b={};return l&&(b[M.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?b[M.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=M.compactIri({activeCtx:t,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(b[M.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(b[M.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),b[M.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],b}var m=x(t,n,{vocab:!0},a),_=k(t,n,"@type"),w=M.compactIri({activeCtx:t,iri:r["@id"],relativeTo:{vocab:"@vocab"===_},base:a.base});return"@id"===_||"@vocab"===_||"@graph"===m?w:i({},M.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}}),w)}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(e,t,n){"use strict";var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";t.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:r,RDF_LIST:r+"List",RDF_FIRST:r+"first",RDF_REST:r+"rest",RDF_NIL:r+"nil",RDF_TYPE:r+"type",RDF_PLAIN_LITERAL:r+"PlainLiteral",RDF_XML_LITERAL:r+"XMLLiteral",RDF_JSON_LITERAL:r+"JSON",RDF_OBJECT:r+"object",RDF_LANGSTRING:r+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}},{}],19:[function(t,n,r){"use strict";var i,a=t("./util"),o=t("./JsonLdError"),u=t("./types"),s=u.isArray,c=u.isObject,l=u.isString,d=u.isUndefined,h=t("./url"),v=h.isAbsolute,g=h.isRelative,y=h.prependBase,b=t("./util"),_=b.asArray,w=b.compareShortestLeast,x=new Map,k=/^@[a-zA-Z]+$/,S={};function j(e,t,n,r,i,a){if(null===t||!l(t)||S.isKeyword(t))return t;if(t.match(k))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&S.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:a}),(n=n||{}).vocab){var o=e.mappings.get(t);if(null===o)return null;if(c(o)&&"@id"in o)return o["@id"]}var u=t.indexOf(":");if(u>0){var s=t.substr(0,u),f=t.substr(u+1);if("_"===s||0===f.indexOf("//"))return t;r&&r.hasOwnProperty(s)&&S.createTermDefinition({activeCtx:e,localCtx:r,term:s,defined:i,options:a});var d=e.mappings.get(s);if(d&&d._prefix)return d["@id"]+f;if(v(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return y(y(a.base,e["@base"]),t)}else if(n.base)return y(a.base,t);return t}function N(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;var n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(var r=0;r0,"@reverse"in t){if("@id"in t)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:r});if("@nest"in t)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:r});var x=t["@reverse"];if(!l(x))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:r});if(!S.isKeyword(x)&&x.match(k))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:x}),void(g?n.mappings.set(i,g):n.mappings.delete(i));var E=j(n,x,{vocab:!0,base:!1},r,a,u);if(!v(E))throw new o("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:r});b["@id"]=E,b.reverse=!0}else if("@id"in t){var T=t["@id"];if(T&&!l(T))throw new o("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:r});if(null===T)b["@id"]=null;else{if(!S.isKeyword(T)&&T.match(k))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:T}),void(g?n.mappings.set(i,g):n.mappings.delete(i));if(T!==i){if(T=j(n,T,{vocab:!0,base:!1},r,a,u),!v(T)&&!S.isKeyword(T))throw new o("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:r});if(i.match(/(?::[^:])|\//)&&j(n,i,{vocab:!0,base:!1},r,new Map(a).set(i,!0),u)!==T)throw new o("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:r});b["@id"]=T,b._prefix=y&&!b._termHasColon&&T.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in b))if(b._termHasColon){var I=i.substr(0,w);if(r.hasOwnProperty(I)&&S.createTermDefinition({activeCtx:n,localCtx:r,term:I,defined:a,options:u}),n.mappings.has(I)){var R=i.substr(w+1);b["@id"]=n.mappings.get(I)["@id"]+R}else b["@id"]=i}else if("@type"===i)b["@id"]=i;else{if(!("@vocab"in n))throw new o("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:r,term:i});b["@id"]=n["@vocab"]+i}if((!0===t["@protected"]||!0===a.get("@protected")&&!1!==t["@protected"])&&(n.protected[i]=!0,b.protected=!0),a.set(i,!0),"@type"in t){var A=t["@type"];if(!l(A))throw new o("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:r});if("@json"===A||"@none"===A){if(S.processingMode(n,1))throw new o('Invalid JSON-LD syntax; an @context @type value must not be "'.concat(A,'" in JSON-LD 1.0 mode.'),"jsonld.SyntaxError",{code:"invalid type mapping",context:r})}else if("@id"!==A&&"@vocab"!==A){if(A=j(n,A,{vocab:!0,base:!1},r,a,u),!v(A))throw new o("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:r});if(0===A.indexOf("_:"))throw new o("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:r})}b["@type"]=A}if("@container"in t){var O=l(t["@container"])?[t["@container"]]:t["@container"]||[],L=["@list","@set","@index","@language"],M=!0,D=O.includes("@set");if(S.processingMode(n,1.1)){if(L.push("@graph","@id","@type"),O.includes("@list")){if(1!==O.length)throw new o("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:r})}else if(O.includes("@graph")){if(O.some(function(e){return"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e}))throw new o("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:r})}else M&=O.length<=(D?2:1);if(O.includes("@type")&&(b["@type"]=b["@type"]||"@id",!["@id","@vocab"].includes(b["@type"])))throw new o("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:r})}else M&=!s(t["@container"]),M&=O.length<=1;if(M&=O.every(function(e){return L.includes(e)}),!(M&=!(D&&O.includes("@list"))))throw new o("Invalid JSON-LD syntax; @context @container value must be one of the following: "+L.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:r});if(b.reverse&&!O.every(function(e){return["@index","@set"].includes(e)}))throw new o("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:r});b["@container"]=O}if("@index"in t){if(!("@container"in t)||!b["@container"].includes("@index"))throw new o('Invalid JSON-LD syntax; @index without @index in @container: "'.concat(t["@index"],'" on term "').concat(i,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:r});if(!l(t["@index"])||0===t["@index"].indexOf("@"))throw new o('Invalid JSON-LD syntax; @index must expand to an IRI: "'.concat(t["@index"],'" on term "').concat(i,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:r});b["@index"]=t["@index"]}if("@context"in t&&(b["@context"]=t["@context"]),"@language"in t&&!("@type"in t)){var P=t["@language"];if(null!==P&&!l(P))throw new o("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:r});null!==P&&(P=P.toLowerCase()),b["@language"]=P}if("@prefix"in t){if(i.match(/:|\//))throw new o("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:r});if(S.isKeyword(b["@id"]))throw new o("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:r});if("boolean"!=typeof t["@prefix"])throw new o("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:r});b._prefix=!0===t["@prefix"]}if("@direction"in t){var C=t["@direction"];if(null!==C&&"ltr"!==C&&"rtl"!==C)throw new o('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:r});b["@direction"]=C}if("@nest"in t){var F=t["@nest"];if(!l(F)||"@nest"!==F&&0===F.indexOf("@"))throw new o("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:r});b["@nest"]=F}var B=b["@id"];if("@context"===B||"@preserve"===B)throw new o("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:r});if(g&&g.protected&&!d&&(n.protected[i]=!0,b.protected=!0,!N(g,b))){var G=u&&u.protectedMode||"error";if("error"===G)throw new o('Invalid JSON-LD syntax; tried to redefine "'.concat(i,'" which is a protected term.'),"jsonld.SyntaxError",{code:"protected term redefinition",context:r,term:i});if("warn"===G)return void console.warn("WARNING: protected term redefinition",{term:i});throw new o("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:r,term:i,protectedMode:G})}},S.expandIri=function(e,t,n,r){return j(e,t,n,void 0,void 0,r)},S.getInitialContext=function(e){var t=JSON.stringify({processingMode:e.processingMode}),n=x.get(t);if(n)return n;var r={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){var e=this;if(e.inverse)return e.inverse;var t,n=e.inverse={},r=e.fastCurieMap={},a={},u=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],c=e.mappings,l=m(p(c.keys()).sort(w));try{for(l.s();!(t=l.n()).done;){var f=t.value,d=c.get(f);if(null!==d){var h=d["@container"]||"@none";if(h=[].concat(h).sort().join(""),null!==d["@id"]){var v,g=m(_(d["@id"]));try{for(g.s();!(v=g.n()).done;){var y=v.value,b=n[y],x=S.isKeyword(y);if(b)!x&&!d._termHasColon&&a[y].push(f);else if(n[y]=b={},!x&&!d._termHasColon){a[y]=[f];var k={iri:y,terms:a[y]};y[0]in r?r[y[0]].push(k):r[y[0]]=[k]}if(b[h]||(b[h]={"@language":{},"@type":{},"@any":{}}),o(f,(b=b[h])["@any"],"@none"),d.reverse)o(f,b["@type"],"@reverse");else if("@none"===d["@type"])o(f,b["@any"],"@none"),o(f,b["@language"],"@none"),o(f,b["@type"],"@none");else if("@type"in d)o(f,b["@type"],d["@type"]);else if("@language"in d&&"@direction"in d){var j=d["@language"],N=d["@direction"];o(f,b["@language"],j&&N?"".concat(j,"_").concat(N).toLowerCase():j?j.toLowerCase():N?"_".concat(N):"@null")}else"@language"in d?o(f,b["@language"],(d["@language"]||"@null").toLowerCase()):"@direction"in d?o(f,b["@language"],d["@direction"]?"_".concat(d["@direction"]):"@none"):s?(o(f,b["@language"],"_".concat(s)),o(f,b["@language"],"@none"),o(f,b["@type"],"@none")):(o(f,b["@language"],u),o(f,b["@language"],"@none"),o(f,b["@type"],"@none"))}}catch(T){g.e(T)}finally{g.f()}}}}}catch(T){l.e(T)}finally{l.f()}for(var E in r)i(r,E,1);return n},clone:function(){var e={};return e.mappings=a.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=a.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===x.size&&x.clear(),x.set(t,r),r;function i(e,t,n){var r,a,o,u=e[t],s=e[t]={},c=m(u);try{for(c.s();!(o=c.n()).done;){var l=o.value;(a=n>=(r=l.iri).length?"":r[n])in s?s[a].push(l):s[a]=[l]}}catch(d){c.e(d)}finally{c.f()}for(var f in s)""!==f&&i(s,f,n+1)}function o(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},S.getContextValue=function(e,t,n){if(null===t)return"@context"===n?void 0:null;if(e.mappings.has(t)){var r=e.mappings.get(t);if(d(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},S.processingMode=function(e,t){return t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode},S.isKeyword=function(e){if(!l(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(e,t,n){"use strict";var r=e("../util"),i=r.parseLinkHeader,a=r.buildHeaders,o=e("../constants").LINK_HEADER_CONTEXT,u=e("../JsonLdError"),s=e("../RequestQueue"),c=e("../url").prependBase,l=/(^|(\r\n))link:/i;function d(e,t,n){var r=new(e=e||XMLHttpRequest);return new Promise(function(e,i){for(var a in r.onload=function(){return e(r)},r.onerror=function(e){return i(e)},r.open("GET",t,!0),n)r.setRequestHeader(a,n[a]);r.send()})}t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{headers:{}},t=e.secure,n=e.headers,r=void 0===n?{}:n,h=e.xhr;return r=a(r),(new s).wrapLoader(p);function p(e){return v.apply(this,arguments)}function v(){return(v=f(regeneratorRuntime.mark(function e(n){var a,s,f,v,g,y,b;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===n.indexOf("http:")||0===n.indexOf("https:")){e.next=2;break}throw new u('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n});case 2:if(!t||0===n.indexOf("https")){e.next=4;break}throw new u('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n});case 4:return e.prev=4,e.next=7,d(h,n,r);case 7:a=e.sent,e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),new u("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n,cause:e.t0});case 13:if(!(a.status>=400)){e.next=15;break}throw new u("URL could not be dereferenced: "+a.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:n,httpStatusCode:a.status});case 15:if(s={contextUrl:null,documentUrl:n,document:a.response},f=null,v=a.getResponseHeader("Content-Type"),l.test(a.getAllResponseHeaders())&&(g=a.getResponseHeader("Link")),!g||"application/ld+json"===v){e.next=28;break}if(y=i(g),b=y[o],!Array.isArray(b)){e.next=21;break}throw new u("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n});case 21:if(b&&(s.contextUrl=b.target),f=y.alternate,e.t1=f&&"application/ld+json"==f.type&&!(v||"").match(/^application\/(\w*\+)?json$/),!e.t1){e.next=28;break}return e.next=27,p(c(n,f.target));case 27:s=e.sent;case 28:return e.abrupt("return",s);case 29:case"end":return e.stop()}},e,null,[[4,10]])}))).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(t,n,r){"use strict";var i=t("./JsonLdError"),a=t("./types"),o=a.isArray,u=a.isObject,s=a.isEmptyObject,c=a.isString,l=a.isUndefined,d=t("./graphTypes"),h=d.isList,p=d.isValue,v=d.isGraph,g=d.isSubject,y=t("./context"),b=y.expandIri,_=y.getContextValue,w=y.isKeyword,x=y.process,k=y.processingMode,S=t("./url").isAbsolute,j=t("./util"),N=j.addValue,E=j.asArray,T=j.getValues,I=j.validateTypeValue,R={};n.exports=R;var A,O=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function L(e){return M.apply(this,arguments)}function M(){return(M=f(regeneratorRuntime.mark(function t(n){var r,a,f,d,v,y,j,T,A,M,D,F,B,G,U,V,z,q,K,H,W,J,Q,X,Y,Z,$,ee,te,ne,re,ie,ae,oe,ue,se,ce,le,fe,de,he,pe,ve,ge,ye,be,me,_e,we,xe,ke,Se,je;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=n.activeCtx,a=n.activeProperty,f=n.expandedActiveProperty,d=n.element,v=n.expandedParent,y=n.options,j=void 0===y?{}:y,T=n.insideList,A=n.typeKey,M=n.typeScopedContext,D=n.expansionMap,F=Object.keys(d).sort(),B=[],U=d[A]&&"@json"===b(r,o(d[A])?d[A][0]:d[A],{vocab:!0},j),V=m(F),t.prev=4,V.s();case 6:if((z=V.n()).done){t.next=187;break}if(q=z.value,K=void 0,H=d[q],"@context"!==q){t.next=11;break}return t.abrupt("continue",185);case 11:if(null!==(W=b(r,q,{vocab:!0},j))&&(S(W)||w(W))||void 0!==(W=D({unmappedProperty:q,activeCtx:r,activeProperty:a,parent:d,options:j,insideList:T,value:H,expandedParent:v}))){t.next=14;break}return t.abrupt("continue",185);case 14:if(!w(W)){t.next=19;break}if("@reverse"!==f){t.next=17;break}throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:H});case 17:if(!(W in v)||"@included"===W||"@type"===W){t.next=19;break}throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:W});case 19:if("@id"!==W){t.next=34;break}if(c(H)){t.next=32;break}if(j.isFrame){t.next=23;break}throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:H});case 23:if(!u(H)){t.next=28;break}if(s(H)){t.next=26;break}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:H});case 26:t.next=32;break;case 28:if(o(H)){t.next=30;break}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:H});case 30:if(H.every(function(e){return c(e)})){t.next=32;break}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:H});case 32:return N(v,"@id",E(H).map(function(e){return c(e)?b(r,e,{base:!0},j):e}),{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 34:if("@type"!==W){t.next=37;break}return u(H)&&(H=Object.fromEntries(Object.entries(H).map(function(t){var n=e(t,2),r=n[0],i=n[1];return[b(M,r,{vocab:!0}),E(i).map(function(e){return b(M,e,{base:!0,vocab:!0})})]}))),I(H,j.isFrame),N(v,"@type",E(H).map(function(e){return c(e)?b(M,e,{base:!0,vocab:!0},j):e}),{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 37:if("@included"!==W||!k(r,1.1)){t.next=47;break}return t.t0=E,t.next=41,R.expand({activeCtx:r,activeProperty:a,element:H,options:j,expansionMap:D});case 41:if(t.t1=t.sent,(J=(0,t.t0)(t.t1)).every(function(e){return g(e)})){t.next=45;break}throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:H});case 45:return N(v,"@included",J,{propertyIsArray:!0}),t.abrupt("continue",185);case 47:if("@graph"!==W||u(H)||o(H)){t.next=49;break}throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:H});case 49:if("@value"!==W){t.next=52;break}return G=H,U&&k(r,1.1)?v["@value"]=H:N(v,"@value",H,{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 52:if("@language"!==W){t.next=62;break}if(null!==H){t.next=55;break}return t.abrupt("continue",185);case 55:if(c(H)||j.isFrame){t.next=57;break}throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:H});case 57:H=E(H).map(function(e){return c(e)?e.toLowerCase():e}),Q=m(H);try{for(Q.s();!(X=Q.n()).done;)Y=X.value,c(Y)&&!Y.match(O)&&console.warn("@language must be valid BCP47: ".concat(Y))}catch(Ne){Q.e(Ne)}finally{Q.f()}return N(v,"@language",H,{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 62:if("@direction"!==W){t.next=85;break}if(c(H)||j.isFrame){t.next=65;break}throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:H});case 65:H=E(H),Z=m(H),t.prev=67,Z.s();case 69:if(($=Z.n()).done){t.next=75;break}if(ee=$.value,!c(ee)||"ltr"===ee||"rtl"===ee){t.next=73;break}throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:H});case 73:t.next=69;break;case 75:t.next=80;break;case 77:t.prev=77,t.t2=t.catch(67),Z.e(t.t2);case 80:return t.prev=80,Z.f(),t.finish(80);case 83:return N(v,"@direction",H,{propertyIsArray:j.isFrame}),t.abrupt("continue",185);case 85:if("@index"!==W){t.next=90;break}if(c(H)){t.next=88;break}throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:H});case 88:return N(v,"@index",H),t.abrupt("continue",185);case 90:if("@reverse"!==W){t.next=118;break}if(u(H)){t.next=93;break}throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:H});case 93:return t.next=95,R.expand({activeCtx:r,activeProperty:"@reverse",element:H,options:j,expansionMap:D});case 95:if(!("@reverse"in(K=t.sent))){t.next=98;break}for(te in K["@reverse"])N(v,te,K["@reverse"][te],{propertyIsArray:!0});case 98:ne=v["@reverse"]||null,t.t3=regeneratorRuntime.keys(K);case 100:if((t.t4=t.t3()).done){t.next=117;break}if("@reverse"!==(re=t.t4.value)){t.next=104;break}return t.abrupt("continue",100);case 104:null===ne&&(ne=v["@reverse"]={}),N(ne,re,[],{propertyIsArray:!0}),ie=K[re],ae=0;case 107:if(!(ae1?X.slice().sort():X:[X],Z=m(Y),e.prev=81,Z.s();case 83:if(($=Z.n()).done){e.next=93;break}if(ee=$.value,te=_(j,ee,"@context"),e.t5=l(te),e.t5){e.next=91;break}return e.next=90,x({activeCtx:n,localCtx:te,options:h,propagate:!1});case 90:n=e.sent;case 91:e.next=83;break;case 93:e.next=98;break;case 95:e.prev=95,e.t6=e.catch(81),Z.e(e.t6);case 98:return e.prev=98,Z.f(),e.finish(98);case 101:e.next=75;break;case 103:e.next=108;break;case 105:e.prev=105,e.t7=e.catch(73),W.e(e.t7);case 108:return e.prev=108,W.f(),e.finish(108);case 111:return ne={},e.next=114,L({activeCtx:n,activeProperty:a,expandedActiveProperty:F,element:f,expandedParent:ne,options:h,insideList:v,typeKey:H,typeScopedContext:j,expansionMap:I});case 114:if(G=Object.keys(ne),re=G.length,!("@value"in ne)){e.next=137;break}if(!("@type"in ne)||!("@language"in ne)&&!("@direction"in ne)){e.next=119;break}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:ne});case 119:if(ie=re-1,"@type"in ne&&(ie-=1),"@index"in ne&&(ie-=1),"@language"in ne&&(ie-=1),"@direction"in ne&&(ie-=1),0===ie){e.next=122;break}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:ne});case 122:if(ae=null===ne["@value"]?[]:E(ne["@value"]),oe=T(ne,"@type"),k(n,1.1)&&oe.includes("@json")&&1===oe.length){e.next=135;break}if(0!==ae.length){e.next=131;break}return e.next=127,I({unmappedValue:ne,activeCtx:n,activeProperty:a,element:f,options:h,insideList:v});case 127:ue=e.sent,ne=void 0!==ue?ue:null,e.next=135;break;case 131:if(ae.every(function(e){return c(e)||s(e)})||!("@language"in ne)){e.next=133;break}throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:ne});case 133:if(oe.every(function(e){return S(e)&&!(c(e)&&0===e.indexOf("_:"))||s(e)})){e.next=135;break}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:ne});case 135:e.next=152;break;case 137:if(!("@type"in ne)||o(ne["@type"])){e.next=141;break}ne["@type"]=[ne["@type"]],e.next=152;break;case 141:if(!("@set"in ne)&&!("@list"in ne)){e.next=147;break}if(!(re>1)||2===re&&"@index"in ne){e.next=144;break}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:ne});case 144:"@set"in ne&&(ne=ne["@set"],G=Object.keys(ne),re=G.length),e.next=152;break;case 147:if(1!==re||!("@language"in ne)){e.next=152;break}return e.next=150,I(ne,{unmappedValue:ne,activeCtx:n,activeProperty:a,element:f,options:h,insideList:v});case 150:se=e.sent,ne=void 0!==se?se:null;case 152:if(!u(ne)||h.keepFreeFloatingNodes||v||null!==a&&"@graph"!==F||!(0===re||"@value"in ne||"@list"in ne||1===re&&"@id"in ne)){e.next=157;break}return e.next=155,I({unmappedValue:ne,activeCtx:n,activeProperty:a,element:f,options:h,insideList:v});case 155:ce=e.sent,ne=void 0!==ce?ce:null;case 157:return e.abrupt("return",ne);case 158:case"end":return e.stop()}},e,null,[[38,53,56,59],[73,105,108,111],[81,95,98,101]])})),function(e){return A.apply(this,arguments)})},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(e,t,n){"use strict";var r=e("./graphTypes").isSubjectReference,i=e("./nodeMap").createMergedNodeMap,a={};t.exports=a,a.flatten=function(e){for(var t=i(e),n=[],a=Object.keys(t).sort(),o=0;o=0;--r){var i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function g(e,t,n){var r="@"+n,i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function y(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new c("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0]){var t,n=m(u.asArray(e[0]["@id"]));try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!o.isObject(r)&&!s.isAbsolute(r)||o.isString(r)&&0===r.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(f){n.e(f)}finally{n.f()}}if("@type"in e[0]){var i,a=m(u.asArray(e[0]["@type"]));try{for(a.s();!(i=a.n()).done;){var l=i.value;if(!o.isObject(l)&&!s.isAbsolute(l)||o.isString(l)&&0===l.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(f){a.e(f)}finally{a.f()}}}function b(e,t,n,i){var s=!0,c=!1;for(var l in n){var f=!1,d=u.getValues(t,l),h=0===u.getValues(n,l).length;if("@id"===l){if(o.isEmptyObject(n["@id"][0]||{})?f=!0:n["@id"].length>=0&&(f=n["@id"].includes(d[0])),!i.requireAll)return f}else if("@type"===l){if(s=!1,h){if(d.length>0)return!1;f=!0}else if(1===n["@type"].length&&o.isEmptyObject(n["@type"][0]))f=d.length>0;else{var p,v=m(n["@type"]);try{var g=function(){var e=p.value;f=!(!o.isObject(e)||!("@default"in e))||f||d.some(function(t){return t===e})};for(v.s();!(p=v.n()).done;)g()}catch(_){v.e(_)}finally{v.f()}}if(!i.requireAll)return f}else{if(r(l))continue;var b=function(){var t=u.getValues(n,l)[0],r=!1;if(t&&(y([t]),r="@default"in t),s=!1,0===d.length&&r)return"continue";if(d.length>0&&h)return{v:!1};if(void 0===t){if(d.length>0)return{v:!1};f=!0}else if(a.isList(t)){var c=t["@list"][0];if(a.isList(d[0])){var p=d[0]["@list"];a.isValue(c)?f=p.some(function(e){return S(c,e)}):(a.isSubject(c)||a.isSubjectReference(c))&&(f=p.some(function(t){return k(e,c,t,i)}))}}else f=a.isValue(t)?d.some(function(e){return S(t,e)}):a.isSubjectReference(t)?d.some(function(n){return k(e,t,n,i)}):!!o.isObject(t)&&d.length>0}();if("continue"===b)continue;if("object"==typeof b)return b.v}if(!f&&i.requireAll)return!1;c=c||f}return s||c}function _(e,t){var n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,a=r.property,s={"@id":t};if(o.isArray(i)){for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:null;y(n);var f=e.options,d={embed:g(n=n[0],f,"embed"),explicit:g(n,f,"explicit"),requireAll:g(n,f,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});var w,k=e.link[e.graph],j=function(e,t,n,r){var i,a={},o=m(t);try{for(o.s();!(i=o.n()).done;){var u=i.value,s=e.graphMap[e.graph][u];b(e,s,n,r)&&(a[u]=s)}}catch(c){o.e(c)}finally{o.f()}return a}(e,t,n,d),N=Object.keys(j).sort(),E=m(N);try{var T=function(){var y=w.value,b=j[y];if(null===l?e.uniqueEmbeds=i({},e.graph,{}):e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===d.embed&&y in k)return x(s,l,k[y]),"continue";var N={"@id":y};if(0===y.indexOf("_:")&&u.addValue(e.bnodeMap,y,N,{propertyIsArray:!0}),k[y]=N,("@first"===d.embed||"@last"===d.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(y)){if(e.embedded&&("@never"===d.embed||v(b,e.graph,e.subjectStack)))return x(s,l,N),"continue";if(e.embedded&&("@first"==d.embed||"@once"==d.embed)&&e.uniqueEmbeds[e.graph].hasOwnProperty(y))return x(s,l,N),"continue";if("@last"===d.embed&&y in e.uniqueEmbeds[e.graph]&&_(e,y),e.uniqueEmbeds[e.graph][y]={parent:s,property:l},e.subjectStack.push({subject:b,graph:e.graph}),y in e.graphMap){var E=!1,T=null;"@graph"in n?(T=n["@graph"][0],E=!("@merged"===y||"@default"===y),o.isObject(T)||(T={})):(E="@merged"!==e.graph,T={}),E&&h.frame(R(I({},e),{graph:y,embedded:!1}),Object.keys(e.graphMap[y]).sort(),[T],N,"@graph")}"@included"in n&&h.frame(R(I({},e),{embedded:!1}),t,n["@included"],N,"@included");var A,O=m(Object.keys(b).sort());try{for(O.s();!(A=O.n()).done;){var L=A.value;if(r(L)){if(N[L]=u.clone(b[L]),"@type"===L){var M,D=m(b["@type"]);try{for(D.s();!(M=D.n()).done;){var P=M.value;0===P.indexOf("_:")&&u.addValue(e.bnodeMap,P,N,{propertyIsArray:!0})}}catch(ie){D.e(ie)}finally{D.f()}}}else if(!d.explicit||L in n){var C,F=m(b[L]);try{for(F.s();!(C=F.n()).done;){var B=C.value,G=L in n?n[L]:p(d);if(a.isList(B)){var U=n[L]&&n[L][0]&&n[L][0]["@list"]?n[L][0]["@list"]:p(d),V={"@list":[]};x(N,L,V);var z,q=m(B["@list"]);try{for(q.s();!(z=q.n()).done;){var K=z.value;a.isSubjectReference(K)?h.frame(R(I({},e),{embedded:!0}),[K["@id"]],U,V,"@list"):x(V,"@list",u.clone(K))}}catch(ie){q.e(ie)}finally{q.f()}}else a.isSubjectReference(B)?h.frame(R(I({},e),{embedded:!0}),[B["@id"]],G,N,L):S(G[0],B)&&x(N,L,u.clone(B))}}catch(ie){F.e(ie)}finally{F.f()}}}}catch(ie){O.e(ie)}finally{O.f()}var H,W=m(Object.keys(n).sort());try{for(W.s();!(H=W.n()).done;){var J=H.value;if("@type"===J){if(!o.isObject(n[J][0])||!("@default"in n[J][0]))continue}else if(r(J))continue;var Q=n[J][0]||{};if(!g(Q,f,"omitDefault")&&!(J in N)){var X="@null";"@default"in Q&&(X=u.clone(Q["@default"])),o.isArray(X)||(X=[X]),N[J]=[{"@preserve":X}]}}}catch(ie){W.e(ie)}finally{W.f()}var Y,Z=m(Object.keys(n["@reverse"]||{}).sort());try{for(Z.s();!(Y=Z.n()).done;)for(var $=Y.value,ee=n["@reverse"][$],te=0,ne=Object.keys(e.subjects);te0&&(i["@language"]=l,l.match(x)||console.warn("@language must be valid BCP47: ".concat(l))),i["@direction"]=f}else o!==w&&(i["@type"]=o)}return i}n.exports=k,k.fromRDF=(i=f(regeneratorRuntime.mark(function e(t,n){var r,i,a,c,f,g,y,b,_,w,x,k,j,N,E,T,I,R,A,O,L,M,D,P,C,F,B,G,U,V,z,q,K,H,W,J,Q,X,Y,Z,$,ee,te,ne,re,ie,ae,oe,ue;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=n.useRdfType,i=void 0!==r&&r,a=n.useNativeTypes,c=void 0!==a&&a,f=n.rdfDirection,g=void 0===f?null:f,b={"@default":y={}},_={},w=m(t),e.prev=3,w.s();case 5:if((x=w.n()).done){e.next=19;break}if(k=x.value,(j="DefaultGraph"===k.graph.termType?"@default":k.graph.value)in b||(b[j]={}),"@default"!==j&&!(j in y)&&(y[j]={"@id":j}),N=b[j],E=k.subject.value,T=k.predicate.value,I=k.object,E in N||(N[E]={"@id":E}),R=N[E],(A=I.termType.endsWith("Node"))&&!(I.value in N)&&(N[I.value]={"@id":I.value}),T!==v||i||!A){e.next=15;break}return s.addValue(R,"@type",I.value,{propertyIsArray:!0}),e.abrupt("continue",17);case 15:O=S(I,c,g),s.addValue(R,T,O,{propertyIsArray:!0}),A&&(I.value===p?("usages"in(L=N[I.value])||(L.usages=[]),L.usages.push({node:R,property:T,value:O})):_[I.value]=!(I.value in _)&&{node:R,property:T,value:O});case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(3),w.e(e.t0);case 24:return e.prev=24,w.f(),e.finish(24);case 27:e.t1=regeneratorRuntime.keys(b);case 28:if((e.t2=e.t1()).done){e.next=37;break}if(M=e.t2.value,D=b[M],p in D){e.next=33;break}return e.abrupt("continue",28);case 33:if((P=D[p]).usages){C=m(P.usages);try{for(C.s();!(F=C.n()).done;){for(B=F.value,G=B.node,U=B.property,V=B.value,z=[],q=[],K=Object.keys(G).length;U===h&&u.isObject(_[G["@id"]])&&u.isArray(G[d])&&1===G[d].length&&u.isArray(G[h])&&1===G[h].length&&(3===K||4===K&&u.isArray(G["@type"])&&1===G["@type"].length&&G["@type"][0]===l)&&(z.push(G[d][0]),q.push(G["@id"]),B=_[G["@id"]],G=B.node,U=B.property,V=B.value,K=Object.keys(G).length,o.isBlankNode(G)););for(delete V["@id"],V["@list"]=z.reverse(),H=0,W=q;H1||!("@id"in e))},i.isSubjectReference=function(e){return r.isObject(e)&&1===Object.keys(e).length&&"@id"in e},i.isValue=function(e){return r.isObject(e)&&"@value"in e},i.isList=function(e){return r.isObject(e)&&"@list"in e},i.isGraph=function(e){return r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(function(e){return"@id"!==e&&"@index"!==e}).length},i.isSimpleGraph=function(e){return i.isGraph(e)&&!("@id"in e)},i.isBlankNode=function(e){return!!r.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))}},{"./types":30}],26:[function(e,t,n){var r=e("rdf-canonize"),i=e("./platform"),a=e("./util"),o=e("./ContextResolver"),u=a.IdentifierIssuer,s=e("./JsonLdError"),c=e("lru-cache"),l=e("./NQuads"),d=e("./expand").expand,h=e("./flatten").flatten,p=e("./fromRdf").fromRDF,v=e("./toRdf").toRDF,g=e("./frame"),y=g.frameMergedOrDefault,b=g.cleanupNull,_=e("./types"),w=_.isArray,x=_.isObject,k=_.isString,S=e("./graphTypes").isSubjectReference,T=e("./context"),R=T.expandIri,A=T.getInitialContext,O=T.process,L=T.processingMode,M=e("./compact"),D=M.compact,P=M.compactIri,C=e("./nodeMap"),F=C.createNodeMap,B=C.createMergedNodeMap,G=C.mergeNodeMaps,U=function(t){var n,g={},_=new c({max:100});function T(e,n){var r=n,i=r.documentLoader,a=void 0===i?t.documentLoader:i,o=function(e,t){var n={};for(var r in e)N.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&j){var i,a=m(j(e));try{for(a.s();!(i=a.n()).done;)r=i.value,t.indexOf(r)<0&&E.call(e,r)&&(n[r]=e[r])}catch(o){a.e(o)}finally{a.f()}}return n}(r,["documentLoader"]);return Object.assign({},{documentLoader:a},o,e)}return t.compact=(n=f(regeneratorRuntime.mark(function e(n,r,i){var c,l,f,d,h,p,v,g,y,b,m=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.length<2)){e.next=2;break}throw new TypeError("Could not compact, too few arguments.");case 2:if(null!==r){e.next=4;break}throw new s("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});case 4:if(null!==n){e.next=6;break}return e.abrupt("return",null);case 6:if((i=T(i,{base:k(n)?n:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new u("_:b"),contextResolver:new o({sharedCache:_})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,!i.skipExpansion){e.next=12;break}e.t0=n,e.next=15;break;case 12:return e.next=14,t.expand(n,i);case 14:e.t0=e.sent;case 15:return c=e.t0,e.next=18,t.processContext(A(i),r,i);case 18:return l=e.sent,e.next=21,D({activeCtx:l,element:c,options:i,compactionMap:i.compactionMap});case 21:f=e.sent,i.compactArrays&&!i.graph&&w(f)?1===f.length?f=f[0]:0===f.length&&(f={}):i.graph&&x(f)&&(f=[f]),x(r)&&"@context"in r&&(r=r["@context"]),r=a.clone(r),w(r)||(r=[r]),d=r,r=[];for(h=0;h0)&&r.push(d[h]);if(p=r.length>0,1===r.length&&(r=r[0]),w(f))v=P({activeCtx:l,iri:"@graph",relativeTo:{vocab:!0}}),g=f,f={},p&&(f["@context"]=r),f[v]=g;else if(x(f)&&p)for(b in y=f,f={"@context":r},y)f[b]=y[b];return e.abrupt("return",f);case 29:case"end":return e.stop()}},e)})),function(e,t,r){return n.apply(this,arguments)}),t.expand=function(){var e=f(regeneratorRuntime.mark(function e(n,r){var i,u,s,c,l,f,h,p,v,g,y=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(y.length<1)){e.next=2;break}throw new TypeError("Could not expand, too few arguments.");case 2:if(!1===(r=T(r,{keepFreeFloatingNodes:!1,contextResolver:new o({sharedCache:_})})).expansionMap&&(r.expansionMap=void 0),i={},u=[],"expandContext"in r&&(s=a.clone(r.expandContext),i.expandContext=x(s)&&"@context"in s?s:{"@context":s},u.push(i.expandContext)),!k(n)){e.next=12;break}return e.next=8,t.get(n,r);case 8:l=e.sent,c=l.documentUrl,i.input=l.document,l.contextUrl&&(i.remoteContext={"@context":l.contextUrl},u.push(i.remoteContext)),e.next=13;break;case 12:i.input=a.clone(n);case 13:"base"in r||(r.base=c||""),f=A(r),h=0,p=u;case 16:if(!(h=1e21)},r.isEmptyObject=function(e){return r.isObject(e)&&0===Object.keys(e).length},r.isNumber=function(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)},r.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},r.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},r.isString=function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},r.isUndefined=function(e){return void 0===e}},{}],31:[function(e,t,n){"use strict";var r=e("./types"),i={};t.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=function(e,t){for(var n={},r=i.parsers[t||"full"],a=r.regex.exec(e),o=r.keys.length;o--;)n[r.keys[o]]=void 0===a[o]?null:a[o];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=function(e,t){if(null===e||i.isAbsolute(t))return t;(!e||r.isString(e))&&(e=i.parse(e||""));var n=i.parse(t),a={protocol:e.protocol||""};if(null!==n.authority)a.authority=n.authority,a.path=n.path,a.query=n.query;else if(a.authority=e.authority,""===n.path)a.path=e.path,a.query=null!==n.query?n.query:e.query;else{if(0===n.path.indexOf("/"))a.path=n.path;else{var o=e.path;((o=o.substr(0,o.lastIndexOf("/")+1)).length>0||e.authority)&&"/"!==o.substr(-1)&&(o+="/"),o+=n.path,a.path=o}a.query=n.query}""!==n.path&&(a.path=i.removeDotSegments(a.path));var u=a.protocol;return null!==a.authority&&(u+="//"+a.authority),u+=a.path,null!==a.query&&(u+="?"+a.query),null!==n.fragment&&(u+="#"+n.fragment),""===u&&(u="./"),u},i.removeBase=function(e,t){if(null===e)return t;(!e||r.isString(e))&&(e=i.parse(e||""));var n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;for(var a=i.parse(t.substr(n.length)),o=e.normalizedPath.split("/"),u=a.normalizedPath.split("/"),s=a.fragment||a.query?0:1;o.length>0&&u.length>s&&o[0]===u[0];)o.shift(),u.shift();var c="";if(o.length>0){o.pop();for(var l=0;l0;){var r=t.shift(),i=0===t.length;"."!==r?".."!==r?n.push(r):(n.pop(),i&&n.push("")):i&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};var a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=function(e){return r.isString(e)&&a.test(e)},i.isRelative=function(e){return r.isString(e)}},{"./types":30}],32:[function(t,n,r){"use strict";var i=t("./graphTypes"),a=t("./types"),o=t("rdf-canonize").IdentifierIssuer,u=t("./JsonLdError"),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,l=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,f="application/ld+json, application/json",d={};function h(e,t){if(a.isArray(t))for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(Object.keys(e).some(function(e){return"accept"===e.toLowerCase()}))throw new RangeError('Accept header may not be specified; only "'+f+'" is supported.');return Object.assign({Accept:f},e)},d.parseLinkHeader=function(e){for(var t={},n=e.match(s),r=0;r0}return!1},d.hasValue=function(e,t,n){if(d.hasProperty(e,t)){var r=e[t],o=i.isList(r);if(a.isArray(r)||o){o&&(r=r["@list"]);for(var u=0;ut.maxAge:e[s]&&n>e[s]},m=function(e){if(e[a]>e[i])for(var t=e[f].tail;e[a]>e[i]&&null!==t;){var n=t.prev;_(e,t),t=n}},_=function(e,t){if(t){var n=t.value;e[c]&&e[c](n.key,n.value),e[a]-=n.length,e[d].delete(n.key),e[f].removeNode(t)}},w=function e(t,n,r,i,a){g(this,e),this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=a||0},x=function(e,t,n,r){var i=n.value;y(e,i)&&(_(e,n),e[u]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};t.exports=function(){function e(t){if(g(this,e),"number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;var n=t.length||p;if(this[o]="function"!=typeof n?p:n,this[u]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[s]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[h]=t.updateAgeOnGet||!1,this.reset()}return b(e,[{key:"max",get:function(){return this[i]},set:function(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,m(this)}},{key:"allowStale",get:function(){return this[u]},set:function(e){this[u]=!!e}},{key:"maxAge",get:function(){return this[s]},set:function(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[s]=e,m(this)}},{key:"lengthCalculator",get:function(){return this[o]},set:function(e){var t=this;"function"!=typeof e&&(e=p),e!==this[o]&&(this[o]=e,this[a]=0,this[f].forEach(function(e){e.length=t[o](e.value,e.key),t[a]+=e.length})),m(this)}},{key:"length",get:function(){return this[a]}},{key:"itemCount",get:function(){return this[f].length}},{key:"rforEach",value:function(e,t){t=t||this;for(var n=this[f].tail;null!==n;){var r=n.prev;x(this,e,n,t),n=r}}},{key:"forEach",value:function(e,t){t=t||this;for(var n=this[f].head;null!==n;){var r=n.next;x(this,e,n,t),n=r}}},{key:"keys",value:function(){return this[f].toArray().map(function(e){return e.key})}},{key:"values",value:function(){return this[f].toArray().map(function(e){return e.value})}},{key:"reset",value:function(){var e=this;this[c]&&this[f]&&this[f].length&&this[f].forEach(function(t){return e[c](t.key,t.value)}),this[d]=new Map,this[f]=new r,this[a]=0}},{key:"dump",value:function(){var e=this;return this[f].map(function(t){return!y(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}}).toArray().filter(function(e){return e})}},{key:"dumpLru",value:function(){return this[f]}},{key:"set",value:function(e,t,n){if((n=n||this[s])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,u=this[o](t,e);if(this[d].has(e)){if(u>this[i])return _(this,this[d].get(e)),!1;var h=this[d].get(e).value;return this[c]&&(this[l]||this[c](e,h.value)),h.now=r,h.maxAge=n,h.value=t,this[a]+=u-h.length,h.length=u,this.get(e),m(this),!0}var p=new w(e,t,u,r,n);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[a]+=p.length,this[f].unshift(p),this[d].set(e,this[f].head),m(this),!0)}},{key:"has",value:function(e){if(!this[d].has(e))return!1;var t=this[d].get(e).value;return!y(this,t)}},{key:"get",value:function(e){return v(this,e,!0)}},{key:"peek",value:function(e){return v(this,e,!1)}},{key:"pop",value:function(){var e=this[f].tail;return e?(_(this,e),e.value):null}},{key:"del",value:function(e){_(this,this[d].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var a=i-t;a>0&&this.set(r.k,r.v,a)}}}},{key:"prune",value:function(){var e=this;this[d].forEach(function(t,n){return v(e,n,!1)})}}]),e}()},{yallist:92}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",a="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:"".concat(i,"decimal"),boolean:"".concat(i,"boolean"),double:"".concat(i,"double"),integer:"".concat(i,"integer"),string:"".concat(i,"string")},rdf:{type:"".concat(r,"type"),nil:"".concat(r,"nil"),first:"".concat(r,"first"),rest:"".concat(r,"rest"),langString:"".concat(r,"langString")},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:"".concat(a,"reify#forSome"),forAll:"".concat(a,"reify#forAll")},log:{implies:"".concat(a,"log#implies")}}},{}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function e(t,n){if(n=n||m,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===m)return new x(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));var r=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,r-1),"@"===t[r+1]?t.substr(r+2):n.namedNode(t.substr(r+3)));case"<":var i=y.exec(t);return n.quad(e(T(i[1]),n),e(T(i[2]),n),e(T(i[3]),n),i[4]&&e(T(i[4]),n));default:return n.namedNode(t)}},n.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof _&&"Quad"!==t.termType)return t.id;if(!t)return i.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return"_:".concat(t.value);case"Variable":return"?".concat(t.value);case"DefaultGraph":return"";case"Literal":return'"'.concat(t.value,'"').concat(t.language?"@".concat(t.language):t.datatype&&t.datatype.value!==h.string?"^^".concat(t.datatype.value):"");case"Quad":return"<<".concat(E(e(t.subject))," ").concat(E(e(t.predicate))," ").concat(E(e(t.object))).concat((0,l.isDefaultGraph)(t.graph)?"":" ".concat(e(t.graph)),">>");default:throw new Error("Unexpected termType: ".concat(t.termType))}},n.escapeQuotes=E,n.unescapeQuotes=T,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var r,i,c=(r=e("./IRIs"))&&r.__esModule?r:{default:r},l=e("./N3Util"),f=c.default,d=f.rdf,h=f.xsd,p=0,v=/^"(.*".*)(?="[^"]*$)/,y=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,m={namedNode:function(e){return new w(e)},blankNode:function(e){return new k(e||"n3-"+p++)},variable:function(e){return new S(e)},literal:function(e,t){if("string"==typeof t)return new x('"'.concat(e,'"@').concat(t.toLowerCase()));var n=t?t.value:"";return""===n&&("boolean"==typeof e?n=h.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?h.integer:h.double:(n=h.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new x(""===n||n===h.string?'"'.concat(e,'"'):'"'.concat(e,'"^^').concat(n))},defaultGraph:function(){return i},quad:I,triple:I};n.default=m;var _=function(){function e(t){g(this,e),this.id=t}return b(e,[{key:"value",get:function(){return this.id}},{key:"equals",value:function(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}},{key:"toJSON",value:function(){return{termType:this.termType,value:this.value}}}]),e}();n.Term=_;var w=function(e){a(n,e);var t=o(n);function n(){return g(this,n),t.apply(this,arguments)}return b(n,[{key:"termType",get:function(){return"NamedNode"}}]),n}(_);n.NamedNode=w;var x=function(e){a(n,e);var t=o(n);function n(){return g(this,n),t.apply(this,arguments)}return b(n,[{key:"termType",get:function(){return"Literal"}},{key:"value",get:function(){return this.id.substring(1,this.id.lastIndexOf('"'))}},{key:"language",get:function(){var e=this.id,t=e.lastIndexOf('"')+1;return t\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},f=/$0^/;n.default=function(){function e(t){if(g(this,e),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]*)?$/,this._lineMode=!!(t=t||{}).lineMode)for(var n in this._n3Mode=!1,this)!(n in l)&&this[n]instanceof RegExp&&(this[n]=f);else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}return b(e,[{key:"_tokenizeToEnd",value:function(e,t){for(var n,r=this._input,i=this._comments;;){for(var a=void 0,u=void 0;a=this._newline.exec(r);)i&&(u=this._comment.exec(a[0]))&&e(null,{line:this._line,type:"comment",value:u[1],prefix:""}),r=r.substr(a[0].length,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&&(i&&(u=this._comment.exec(r))&&e(null,{line:this._line,type:"comment",value:u[1],prefix:""}),e(r=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=r;var s=this._line,l=r[0],f="",d="",h="",p=null,v=0,g=!1;switch(l){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(v=1,f="^");break}if(this._previousMarker="^^","<"!==(r=r.substr(2))[0]){g=!0;break}case"<":if(p=this._unescapedIri.exec(r))f="IRI",d=p[1];else if(p=this._iri.exec(r)){if(null===(d=this._unescape(p[1]))||c.test(d))return m(this);f="IRI"}else r.length>1&&"<"===r[1]?(f="<<",v=2):this._n3Mode&&r.length>1&&"="===r[1]&&(f="inverse",v=2,d=">");break;case">":r.length>1&&">"===r[1]&&(f=">>",v=2);break;case"_":((p=this._blank.exec(r))||t&&(p=this._blank.exec("".concat(r," "))))&&(f="blank",h="_",d=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(r))d=p[1];else if(d=(n=this._parseLiteral(r)).value,v=n.matchLength,null===d)return m(this);(null!==p||0!==v)&&(f="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){var y;if(p=this._simpleApostropheString.exec(r))d=p[1];else if(d=(y=this._parseLiteral(r)).value,v=y.matchLength,null===d)return m(this);(null!==p||0!==v)&&(f="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(r))&&(f="var",d=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(r))?(f="langcode",d=p[1]):(p=this._keyword.exec(r))&&(f=p[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){f=".",v=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(r)||t&&(p=this._number.exec("".concat(r," "))))&&(f="literal",d=p[0],h="string"==typeof p[1]?o.double:"string"==typeof p[2]?o.decimal:o.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(r))?f=p[0].toUpperCase():g=!0;break;case"f":case"t":(p=this._boolean.exec(r))?(f="literal",d=p[0],h=o.boolean):g=!0;break;case"a":(p=this._shortPredicates.exec(r))?(f="abbreviation",d="a"):g=!0;break;case"=":this._n3Mode&&r.length>1&&(f="abbreviation",">"!==r[1]?(v=1,d="="):(v=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(v=1,f=l);break;default:g=!0}if(g&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(r))?((p=this._prefixed.exec(r))||t&&(p=this._prefixed.exec("".concat(r," "))))&&(f="prefixed",h=p[1]||"",d=this._unescape(p[2])):(f="prefix",d=p[1]||"")),"^^"===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)?m(this):this._input=r;var b={line:s,type:f,value:d,prefix:h};e(null,b),this.previousToken=b,this._previousMarker=f,r=r.substr(v||p[0].length,r.length)}function m(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}},{key:"_unescape",value:function(e){var t=!1,n=e.replace(u,function(e,n,r,i){if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){var a=Number.parseInt(r,16);return a<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((a-=65536)>>10),56320+(1023&a))}return i in s?s[i]:(t=!0,"")});return t?null:n}},{key:"_parseLiteral",value:function(e){if(e.length>=3){for(var t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length,r=Math.max(this._literalClosingPos,n);(r=e.indexOf(t,r))>0;){for(var i=0;"\\"===e[r-i-1];)i++;if(i%2==0){var a=e.substring(n,r),o=a.split(/\r\n|\r|\n/).length-1,u=r+n;if(1===n&&0!==o||3===n&&this._lineMode)break;return this._line+=o,{value:this._unescape(a),matchLength:u}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}},{key:"_syntaxError",value:function(e){this._input=null;var t=new Error('Unexpected "'.concat(e,'" on line ').concat(this._line,"."));return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}},{key:"_readStartingBom",value:function(e){return e.startsWith("\ufeff")?e.substr(1):e}},{key:"tokenize",value:function(e,n){var r=this;if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof n){var a,o=[];if(this._tokenizeToEnd(function(e,t){return e?a=e:o.push(t)},!0),a)throw a;return o}(0,i.default)(function(){return r._tokenizeToEnd(n,!0)})}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",function(e){null!==r._input&&0!==e.length&&(r._pendingBuffer&&(e=t.concat([r._pendingBuffer,e]),r._pendingBuffer=null),128&e[e.length-1]?r._pendingBuffer=e:(void 0===r._input?r._input=r._readStartingBom("string"==typeof e?e:e.toString()):r._input+=e,r._tokenizeToEnd(n,!1)))}),e.on("end",function(){"string"==typeof r._input&&r._tokenizeToEnd(n,!0)}),e.on("error",n)}}]),e}()}).call(this)}).call(this,e("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./N3Lexer")),i=o(e("./N3DataFactory")),a=o(e("./IRIs"));function o(e){return e&&e.__esModule?e:{default:e}}var u=0,s=function(){function e(t){g(this,e),this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&l(this,t.factory);var n="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",i=/turtle/.test(n),a=/trig/.test(n),o=/triple/.test(n),u=/quad/.test(n),s=this._n3Mode=/n3/.test(n),c=o||u;(this._supportsNamedGraphs=!(i||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||a||o||s),this._supportsRDFStar=""===n||/star|\*$/.test(n),c&&(this._resolveRelativeIRI=function(e){return null}),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new r.default({lineMode:c,n3:s}),this._explicitQuantifiers=!!t.explicitQuantifiers}return b(e,[{key:"_setBase",value:function(e){if(e){var t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}},{key:"_saveContext",value:function(e,t,n,r,i){var a=this._n3Mode;this._contextStack.push({subject:n,predicate:r,object:i,graph:t,type:e,inverse:!!a&&this._inversePredicate,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?"".concat(this._graph.id.substr(2),"."):".",this._quantified=Object.create(this._quantified))}},{key:"_restoreContext",value:function(){var e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}},{key:"_readInTopContext",value:function(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}},{key:"_readEntity",value:function(e,t){var n;switch(e.type){case"IRI":case"typeIRI":var r=this._resolveIRI(e.value);if(null===r)return this._error("Invalid IRI",e);n=this._namedNode(r);break;case"type":case"prefixed":var i=this._prefixes[e.prefix];if(void 0===i)return this._error('Undefined prefix "'.concat(e.prefix,':"'),e);n=this._namedNode(i+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error("Expected entity but got ".concat(e.type),e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}},{key:"_readSubject",value:function(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}},{key:"_readPredicate",value:function(e){var t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected ".concat(t),e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}},{key:"_readObject",value:function(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}},{key:"_readPredicateOrNamedGraph",value:function(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}},{key:"_readGraph",value:function(e){return"{"!==e.type?this._error("Expected graph but got ".concat(e.type),e):(this._graph=this._subject,this._subject=null,this._readSubject)}},{key:"_readBlankNodeHead",value:function(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}},{key:"_readBlankNodeTail",value:function(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);var t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}},{key:"_readPredicateAfterBlank",value:function(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}},{key:"_readListItem",value:function(e){var t=null,n=null,r=this._readListItem,i=this._subject,a=this._contextStack,o=a[a.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),r=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==a.length&&"list"===a[a.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),r=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===i?null===o.predicate?o.subject=n:o.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return r}},{key:"_readDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!1)}},{key:"_readListItemDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!0)}},{key:"_completeLiteral",value:function(e){var t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":var n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}},{key:"_completeSubjectLiteral",value:function(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}},{key:"_completeObjectLiteral",value:function(e,t){var n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}},{key:"_readFormulaTail",value:function(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}},{key:"_readPunctuation",value:function(e){var t,n=this._graph,r=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}if(null!==r){var a=this._predicate,o=this._object;i?this._emit(o,a,r,n):this._emit(r,a,o,n)}return t}},{key:"_readBlankNodePunctuation",value:function(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}},{key:"_readQuadPunctuation",value:function(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}},{key:"_readPrefix",value:function(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}},{key:"_readPrefixIRI",value:function(e){if("IRI"!==e.type)return this._error('Expected IRI to follow prefix "'.concat(this._prefix,':"'),e);var t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}},{key:"_readBaseIRI",value:function(e){var t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}},{key:"_readNamedGraphLabel",value:function(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)}}},{key:"_readNamedGraphBlankLabel",value:function(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}},{key:"_readDeclarationPunctuation",value:function(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}},{key:"_readQuantifierList",value:function(e){var t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error("Unexpected ".concat(e.type),e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}},{key:"_readQuantifierPunctuation",value:function(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))}},{key:"_getPathReader",value:function(e){return this._afterPath=e,this._readPath}},{key:"_readPath",value:function(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){var r=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,r,this._graph)}return this._afterPath(e)}}},{key:"_readForwardPath",value:function(e){var t,n,r=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}},{key:"_readBackwardPath",value:function(e){var t,n,r=this._blankNode();if(void 0!==(t=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=r):(n=this._object,this._object=r),this._emit(r,t,n,this._graph),this._readPath}},{key:"_readRDFStarTailOrGraph",value:function(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error('Expected >> to follow "'.concat(this._object.id,'"'),e):this._readRDFStarTail(e)}},{key:"_readRDFStarTail",value:function(e){if(">>"!==e.type)return this._error("Expected >> but got ".concat(e.type),e);var t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}},{key:"_getContextEndReader",value:function(){var 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}}},{key:"_emit",value:function(e,t,n,r){this._callback(null,this._quad(e,t,n,r||this.DEFAULTGRAPH))}},{key:"_error",value:function(e,t){var n=new Error("".concat(e," on line ").concat(t.line,"."));n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}},{key:"_resolveIRI",value:function(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}},{key:"_resolveRelativeIRI",value:function(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)}}},{key:"_removeDotSegments",value:function(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;for(var t=e.length,n="",r=-1,i=-1,a=0,o="/";r=i&&(n=n.substr(0,a)),"/"!==o)return"".concat(n,"/").concat(e.substr(r+1));a=r+1}}}o=e[++r]}return n+e.substring(a)}},{key:"parse",value:function(e,t,n){var r=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):"b".concat(u++,"_"),this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){var i,a=[];if(this._callback=function(e,t){e?i=e:t&&a.push(t)},this._lexer.tokenize(e).every(function(e){return r._readCallback=r._readCallback(e)}),i)throw i;return a}this._callback=t,this._lexer.tokenize(e,function(e,t){null!==e?(r._callback(e),r._callback=c):r._readCallback&&(r._readCallback=r._readCallback(t))})}}],[{key:"_resetBlankNodePrefix",value:function(){u=0}}]),e}();function c(){}function l(e,t){var n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(a.default.rdf.first),e.RDF_REST=n(a.default.rdf.rest),e.RDF_NIL=n(a.default.rdf.nil),e.N3_FORALL=n(a.default.r.forAll),e.N3_FORSOME=n(a.default.r.forSome),e.ABBREVIATIONS={a:n(a.default.rdf.type),"=":n(a.default.owl.sameAs),">":n(a.default.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=s,l(s.prototype,i.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(e("./N3DataFactory")),u=e("readable-stream"),c=(r=e("./IRIs"))&&r.__esModule?r:{default:r};function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}var f=function(e){function t(e,n){g(this,t),this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!n&&e&&!e[0]&&(n=e,e=null),this._factory=(n=n||{}).factory||i.default,e&&this.addQuads(e)}return b(t,[{key:"size",get:function(){var e=this._size;if(null!==e)return e;e=0;var t,n,r=this._graphs;for(var i in r)for(var a in t=r[i].subjects)for(var o in n=t[a])e+=Object.keys(n[o]).length;return this._size=e}},{key:"_addToIndex",value:function(e,t,n,r){var i=e[t]||(e[t]={}),a=i[n]||(i[n]={}),o=r in a;return o||(a[r]=null),!o}},{key:"_removeFromIndex",value:function(e,t,n,r){var i=e[t],a=i[n];for(var o in delete a[r],a)return;for(var u in delete i[n],i)return;delete e[t]}},{key:"_findInIndex",value:function(e,t,n,r,a,o,u,s,c,l){var f,d,h,p=!t+!n+!r>1?Object.keys(this._ids):this._entities;for(var v in t&&((f=e,e={})[t]=f[t]),e){var g=p[v];if(d=e[v])for(var y in n&&((f=d,d={})[n]=f[n]),d){var b=p[y];if(h=d[y])for(var m=(r?r in h?[r]:[]:Object.keys(h)),_=0;_0&&void 0!==arguments[0]?arguments[0]:{},n=t.remove,r=void 0!==n&&n,i=t.ignoreErrors,a=void 0!==i&&i,o={},u=a?function(){return!0}:function(e,t){throw new Error("".concat(e.value," ").concat(t))},s=this.getQuads(null,c.default.rdf.rest,c.default.rdf.nil,null),l=r?p(s):[];return s.forEach(function(t){for(var n,i,a=[],s=!1,f=t.graph,d=t.subject;d&&!s;){for(var h=e.getQuads(null,null,d,null),p=e.getQuads(d,null,null,null),v=void 0,g=null,y=null,b=null,m=0;m")}},{key:"_encodeLiteral",value:function(e){var t=e.value;if(p.test(t)&&(t=t.replace(v,_)),e.language)return'"'.concat(t,'"@').concat(e.language);if(this._lineMode){if(e.datatype.value===h.string)return'"'.concat(t,'"')}else switch(e.datatype.value){case h.string:return'"'.concat(t,'"');case h.boolean:if("true"===t||"false"===t)return t;break;case h.integer:if(/^[+-]?\d+$/.test(t))return t;break;case h.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case h.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return'"'.concat(t,'"^^').concat(this._encodeIriOrBlank(e.datatype))}},{key:"_encodePredicate",value:function(e){return e.value===d.type?"a":this._encodeIriOrBlank(e)}},{key:"_encodeObject",value:function(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}},{key:"_encodeQuad",value:function(e){var t=e.subject,n=e.predicate,r=e.object,i=e.graph;return"<<".concat(this._encodeSubject(t)," ").concat(this._encodePredicate(n)," ").concat(this._encodeObject(r)).concat((0,s.isDefaultGraph)(i)?"":" ".concat(this._encodeIriOrBlank(i)),">>")}},{key:"_blockedWrite",value:function(){throw new Error("Cannot write because the writer has been closed.")}},{key:"addQuad",value:function(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,l,r):this._writeQuad(e,t,n,r||l,i)}},{key:"addQuads",value:function(e){for(var t=0;t.\n"))}if(n){var a="",o="";for(var u in this._prefixIRIs)a+=a?"|".concat(u):u,o+=(o?"|":"")+this._prefixIRIs[u];a=a.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:".concat(o,")[^/]*$|^(").concat(a,")([a-zA-Z][\\-_a-zA-Z0-9]*)$"))}this._write(n?"\n":"",t)}},{key:"blank",value:function(e,t){var n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new m("[]");case 1:if(!((n=i[0]).object instanceof m))return new m("[ ".concat(this._encodePredicate(n.predicate)," ").concat(this._encodeObject(n.object)," ]"));default:for(var a="[",o=0;o1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:new Map,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;g(this,e),this.prefix=t,this._existing=n,this.counter=r}return b(e,[{key:"clone",value:function(){var t=this.prefix,n=this._existing,r=this.counter;return new e(t,new Map(n),r)}},{key:"getId",value:function(e){var t=e&&this._existing.get(e);if(t)return t;var n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}},{key:"hasId",value:function(e){return this._existing.has(e)}},{key:"getOldIds",value:function(){return p(this._existing.keys())}}]),e}()},{}],48:[function(e,t,n){"use strict";e("setimmediate");var r=self.crypto||self.msCrypto;t.exports=function(){function e(t){if(g(this,e),!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error('Unsupport algorithm "'.concat(t,'".'));this.algorithm={name:"SHA-1"}}this._content=""}return b(e,[{key:"update",value:function(e){this._content+=e}},{key:"digest",value:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var n,i,a,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(new TextEncoder).encode(e._content),t.t0=Uint8Array,t.next=4,r.subtle.digest(e.algorithm,n);case 4:for(t.t1=t.sent,i=new t.t0(t.t1),a="",o=0;o]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))'+r+"$"),t.exports=function(){function e(){g(this,e)}return b(e,null,[{key:"parse",value:function(e){var t,n=[],r={},d=0,p=m(e.split(l.eoln));try{for(p.s();!(t=p.n()).done;){var v=t.value;if(d++,!l.empty.test(v)){var g=v.match(l.quad);if(null===g)throw new Error("N-Quads parse error on line "+d+".");var y={subject:null,predicate:null,object:null,graph:null};if(y.subject=void 0!==g[1]?{termType:o,value:g[1]}:{termType:u,value:g[2]},y.predicate={termType:o,value:g[3]},void 0!==g[4]?y.object={termType:o,value:g[4]}:void 0!==g[5]?y.object={termType:u,value:g[5]}:(y.object={termType:s,value:void 0,datatype:{termType:o}},void 0!==g[7]?y.object.datatype.value=g[7]:void 0!==g[8]?(y.object.datatype.value=i,y.object.language=g[8]):y.object.datatype.value=a,y.object.value=g[6].replace(h,function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")})),y.graph=void 0!==g[9]?{termType:o,value:g[9]}:void 0!==g[10]?{termType:u,value:g[10]}:{termType:c,value:""},y.graph.value in r){var b,_=!0,w=r[y.graph.value],x=m(w);try{for(x.s();!(b=x.n()).done;){if(f(b.value,y)){_=!1;break}}}catch(k){x.e(k)}finally{x.f()}_&&(w.push(y),n.push(y))}else r[y.graph.value]=[y],n.push(y)}}}catch(k){p.e(k)}finally{p.f()}return n}},{key:"serialize",value:function(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));var n,r=[],i=m(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(e.serializeQuad(a))}}catch(o){i.e(o)}finally{i.f()}return r.sort().join("")}},{key:"serializeQuad",value:function(e){var t=e.subject,n=e.object,r=e.graph,s="";return s+=t.termType===o?"<".concat(t.value,">"):"".concat(t.value),s+=" <".concat(e.predicate.value,"> "),n.termType===o?s+="<".concat(n.value,">"):n.termType===u?s+=n.value:(s+='"'.concat(n.value.replace(d,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}),'"'),n.datatype.value===i?n.language&&(s+="@".concat(n.language)):n.datatype.value!==a&&(s+="^^<".concat(n.datatype.value,">"))),r.termType===o?s+=" <".concat(r.value,">"):r.termType===u&&(s+=" ".concat(r.value)),s+=" .\n"}},{key:"legacyDatasetToQuads",value:function(e){var t=[],n={"blank node":u,IRI:o,literal:s},r=function(r){e[r].forEach(function(e){var l={};for(var f in e){var d=e[f],h={termType:n[d.type],value:d.value};h.termType===s&&(h.datatype={termType:o},"datatype"in d&&(h.datatype.value=d.datatype),"language"in d?("datatype"in d||(h.datatype.value=i),h.language=d.language):"datatype"in d||(h.datatype.value=a)),l[f]=h}l.graph="@default"===r?{termType:c,value:""}:{termType:r.startsWith("_:")?u:o,value:r},t.push(l)})};for(var l in e)r(l);return t}}]),e}();var d=/["\\\n\r]/g,h=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(e,t,n){"use strict";t.exports=function(){function e(t){g(this,e),this.current=t.sort(),this.done=!1,this.dir=new Map;for(var n=0;nr)&&(s&&o>0&&u>e[o-1]||!s&&oe[o+1])&&(r=u,i=o)}if(null===r)this.done=!0;else{var c=t.get(r)?i-1:i+1;e[i]=e[c],e[c]=r;var l,f=m(e);try{for(f.s();!(l=f.n()).done;){var d=l.value;d>r&&t.set(d,!t.get(d))}}catch(h){f.e(h)}finally{f.f()}}return n}}]),e}()},{}],51:[function(e,t,n){(function(n){(function(){"use strict";var r=e("./IdentifierIssuer"),i=e("./MessageDigest"),a=e("./Permuter"),o=e("./NQuads");function u(e,t){return e.hasht.hash?1:0}t.exports=function(){function e(){g(this,e),this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}return b(e,[{key:"main",value:function(e){var t=this;return f(regeneratorRuntime.mark(function n(){var i,a,s,c,l,f,d,h,v,g,y,b,_,w,x,k,S,j,N,E,T,R,A,O,L,M,D,P,C,F,B,G,U,V,z,q;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:t.quads=e,i=m(e);try{for(i.s();!(a=i.n()).done;)s=a.value,t._addBlankNodeQuadInfo({quad:s,component:s.subject}),t._addBlankNodeQuadInfo({quad:s,component:s.object}),t._addBlankNodeQuadInfo({quad:s,component:s.graph})}catch(K){i.e(K)}finally{i.f()}c=new Map,l=p(t.blankNodeInfo.keys()),f=0,d=m(l),n.prev=6,d.s();case 8:if((h=d.n()).done){n.next=18;break}if(v=h.value,n.t0=++f%100==0,!n.t0){n.next=14;break}return n.next=14,t._yield();case 14:return n.next=16,t._hashAndTrackBlankNode({id:v,hashToBlankNodes:c});case 16:n.next=8;break;case 18:n.next=23;break;case 20:n.prev=20,n.t1=n.catch(6),d.e(n.t1);case 23:return n.prev=23,d.f(),n.finish(23);case 26:g=p(c.keys()).sort(),y=[],b=m(g);try{for(b.s();!(_=b.n()).done;)w=_.value,(x=c.get(w)).length>1?y.push(x):t.canonicalIssuer.getId(x[0])}catch(K){b.e(K)}finally{b.f()}k=0,S=y;case 30:if(!(kh)){r.next=31;break}return x=!0,r.abrupt("break",33);case 31:r.next=26;break;case 33:r.next=38;break;case 35:r.prev=35,r.t1=r.catch(24),k.e(r.t1);case 38:return r.prev=38,k.f(),r.finish(38);case 41:if(x){r.next=64;break}N=m(w),r.prev=43,N.s();case 45:if((E=N.n()).done){r.next=55;break}return T=E.value,r.next=49,n.hashNDegreeQuads(T,b);case 49:if(I=r.sent,_+=b.getId(T),_+="<".concat(I.hash,">"),b=I.issuer,!(0!==h.length&&_>h)){r.next=53;break}return x=!0,r.abrupt("break",55);case 53:r.next=45;break;case 55:r.next=60;break;case 57:r.prev=57,r.t2=r.catch(43),N.e(r.t2);case 60:return r.prev=60,N.f(),r.finish(60);case 63:x||(0===h.length||_")}},{key:"createHashToRelated",value:function(e,t){var n=this;return f(regeneratorRuntime.mark(function r(){var i,a,o,u,s,c;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=new Map,a=n.blankNodeInfo.get(e).quads,o=0,u=m(a),r.prev=3,u.s();case 5:if((s=u.n()).done){r.next=15;break}if(c=s.value,r.t0=++o%100==0,!r.t0){r.next=11;break}return r.next=11,n._yield();case 11:return r.next=13,Promise.all([n._addRelatedBlankNodeHash({quad:c,component:c.subject,position:"s",id:e,issuer:t,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:c,component:c.object,position:"o",id:e,issuer:t,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:c,component:c.graph,position:"g",id:e,issuer:t,hashToRelated:i})]);case 13:r.next=5;break;case 15:r.next=20;break;case 17:r.prev=17,r.t1=r.catch(3),u.e(r.t1);case 20:return r.prev=20,u.f(),r.finish(20);case 23:return r.abrupt("return",i);case 24:case"end":return r.stop()}},r,null,[[3,17,20,23]])}))()}},{key:"_hashAndTrackBlankNode",value:function(e){var t=e.id,n=e.hashToBlankNodes,r=this;return f(regeneratorRuntime.mark(function e(){var i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.hashFirstDegreeQuads(t);case 2:i=e.sent,(a=n.get(i))?a.push(t):n.set(i,[t]);case 5:case"end":return e.stop()}},e)}))()}},{key:"_addBlankNodeQuadInfo",value:function(e){var t=e.quad,n=e.component;if("BlankNode"===n.termType){var r=n.value,i=this.blankNodeInfo.get(r);i?i.quads.add(t):this.blankNodeInfo.set(r,{quads:new Set([t]),hash:null})}}},{key:"_addRelatedBlankNodeHash",value:function(e){var t=e.quad,n=e.component,r=e.position,i=e.id,a=e.issuer,o=e.hashToRelated,u=this;return f(regeneratorRuntime.mark(function e(){var s,c,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("BlankNode"===n.termType&&n.value!==i){e.next=2;break}return e.abrupt("return");case 2:return s=n.value,e.next=5,u.hashRelatedBlankNode(s,t,a,r);case 5:c=e.sent,(l=o.get(c))?l.push(s):o.set(c,[s]);case 8:case"end":return e.stop()}},e)}))()}},{key:"_useCanonicalId",value:function(e){var t=e.component;return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}},{key:"_yield",value:function(){return f(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){return n(e)}));case 1:case"end":return e.stop()}},e)}))()}}]),e}()}).call(this)}).call(this,e("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(e,t,n){"use strict";var r=e("./IdentifierIssuer"),i=e("./MessageDigest"),a=e("./Permuter"),o=e("./NQuads");function u(e,t){return e.hasht.hash?1:0}t.exports=function(){function e(){g(this,e),this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}return b(e,[{key:"main",value:function(e){this.quads=e;var t,n=m(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this._addBlankNodeQuadInfo({quad:i,component:i.subject}),this._addBlankNodeQuadInfo({quad:i,component:i.object}),this._addBlankNodeQuadInfo({quad:i,component:i.graph})}}catch(C){n.e(C)}finally{n.f()}var a,s=new Map,c=m(p(this.blankNodeInfo.keys()));try{for(c.s();!(a=c.n()).done;){var l=a.value;this._hashAndTrackBlankNode({id:l,hashToBlankNodes:s})}}catch(C){c.e(C)}finally{c.f()}var f,d=[],h=m(p(s.keys()).sort());try{for(h.s();!(f=h.n()).done;){var v=f.value,g=s.get(v);g.length>1?d.push(g):this.canonicalIssuer.getId(g[0])}}catch(C){h.e(C)}finally{h.f()}for(var y=0,b=d;yl){b=!0;break}}}catch(N){_.e(N)}finally{_.f()}if(!b){var x,k=m(y);try{for(k.s();!(x=k.n()).done;){var S=x.value,j=this.hashNDegreeQuads(S,v);if(g+=v.getId(S),g+="<".concat(j.hash,">"),v=j.issuer,0!==l.length&&g>l){b=!0;break}}}catch(N){k.e(N)}finally{k.f()}b||(0===l.length||g")}},{key:"createHashToRelated",value:function(e,t){var n,r=new Map,i=m(this.blankNodeInfo.get(e).quads);try{for(i.s();!(n=i.n()).done;){var a=n.value;this._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:e,issuer:t,hashToRelated:r})}}catch(o){i.e(o)}finally{i.f()}return r}},{key:"_hashAndTrackBlankNode",value:function(e){var t=e.id,n=e.hashToBlankNodes,r=this.hashFirstDegreeQuads(t),i=n.get(r);i?i.push(t):n.set(r,[t])}},{key:"_addBlankNodeQuadInfo",value:function(e){var t=e.quad,n=e.component;if("BlankNode"===n.termType){var r=n.value,i=this.blankNodeInfo.get(r);i?i.quads.add(t):this.blankNodeInfo.set(r,{quads:new Set([t]),hash:null})}}},{key:"_addRelatedBlankNodeHash",value:function(e){var t=e.quad,n=e.component,r=e.position,i=e.id,a=e.issuer,o=e.hashToRelated;if("BlankNode"===n.termType&&n.value!==i){var u=n.value,s=this.hashRelatedBlankNode(u,t,a,r),c=o.get(s);c?c.push(u):o.set(s,[u])}}},{key:"_useCanonicalId",value:function(e){var t=e.component;return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}]),e}()},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(e,t,n){"use strict";var r=e("./URDNA2015");t.exports=function(e){a(n,e);var t=o(n);function n(){var e;return g(this,n),(e=t.call(this)).name="URGNA2012",e.hashAlgorithm="sha1",e}return b(n,[{key:"modifyFirstDegreeComponent",value:function(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}},{key:"getRelatedPredicate",value:function(e){return e.predicate.value}},{key:"createHashToRelated",value:function(e,t){var n=this;return f(regeneratorRuntime.mark(function r(){var i,a,o,u,s,c,l,f,d,h;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=new Map,a=n.blankNodeInfo.get(e).quads,o=0,u=m(a),r.prev=3,u.s();case 5:if((s=u.n()).done){r.next=26;break}if(c=s.value,l=void 0,f=void 0,"BlankNode"!==c.subject.termType||c.subject.value===e){r.next=12;break}f=c.subject.value,l="p",r.next=15;break;case 12:if("BlankNode"===c.object.termType&&c.object.value!==e){r.next=14;break}return r.abrupt("continue",24);case 14:f=c.object.value,l="r";case 15:if(r.t0=++o%100==0,!r.t0){r.next=19;break}return r.next=19,n._yield();case 19:return r.next=21,n.hashRelatedBlankNode(f,c,t,l);case 21:d=r.sent,(h=i.get(d))?h.push(f):i.set(d,[f]);case 24:r.next=5;break;case 26:r.next=31;break;case 28:r.prev=28,r.t1=r.catch(3),u.e(r.t1);case 31:return r.prev=31,u.f(),r.finish(31);case 34:return r.abrupt("return",i);case 35:case"end":return r.stop()}},r,null,[[3,28,31,34]])}))()}}]),n}(r)},{"./URDNA2015":51}],54:[function(e,t,n){"use strict";var r=e("./URDNA2015Sync");t.exports=function(e){a(n,e);var t=o(n);function n(){var e;return g(this,n),(e=t.call(this)).name="URGNA2012",e.hashAlgorithm="sha1",e}return b(n,[{key:"modifyFirstDegreeComponent",value:function(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}},{key:"getRelatedPredicate",value:function(e){return e.predicate.value}},{key:"createHashToRelated",value:function(e,t){var n,r=new Map,i=m(this.blankNodeInfo.get(e).quads);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=void 0,u=void 0;if("BlankNode"===a.subject.termType&&a.subject.value!==e)u=a.subject.value,o="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;u=a.object.value,o="r"}var s=this.hashRelatedBlankNode(u,a,t,o),c=r.get(s);c?c.push(u):r.set(s,[u])}}catch(l){i.e(l)}finally{i.f()}return r}}]),n}(r)},{"./URDNA2015Sync":52}],55:[function(e,t,n){"use strict";var r,i=e("./URDNA2015"),a=e("./URGNA2012"),o=e("./URDNA2015Sync"),u=e("./URGNA2012Sync");try{r=e("rdf-canonize-native")}catch(s){}var s,c={};t.exports=c,c.NQuads=e("./NQuads"),c.IdentifierIssuer=e("./IdentifierIssuer"),c._rdfCanonizeNative=function(e){return e&&(r=e),r},c.canonize=(s=f(regeneratorRuntime.mark(function e(t,n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),!n.useNative){e.next=4;break}if(r){e.next=3;break}throw new Error("rdf-canonize-native not available");case 3:return e.abrupt("return",new Promise(function(e,i){return r.canonize(t,n,function(t,n){return t?i(t):e(n)})}));case 4:if("URDNA2015"!==n.algorithm){e.next=6;break}return e.abrupt("return",new i(n).main(t));case 6:if("URGNA2012"!==n.algorithm){e.next=8;break}return e.abrupt("return",new a(n).main(t));case 8:throw"algorithm"in n?new Error("Invalid RDF Dataset Canonicalization algorithm: "+n.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.");case 9:case"end":return e.stop()}},e)})),function(e,t){return s.apply(this,arguments)}),c._canonizeSync=function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(r)return r.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new o(t).main(e);if("URGNA2012"===t.algorithm)return new u(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),i(e("./lib/BlankNode"),n),i(e("./lib/DataFactory"),n),i(e("./lib/DefaultGraph"),n),i(e("./lib/Literal"),n),i(e("./lib/NamedNode"),n),i(e("./lib/Quad"),n),i(e("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0,n.BlankNode=function(){function e(t){g(this,e),this.termType="BlankNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}]),e}()},{}],58:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;var r=e("./BlankNode"),i=e("./DefaultGraph"),a=e("./Literal"),o=e("./NamedNode"),u=e("./Quad"),s=e("./Variable"),c=0;n.DataFactory=function(){function e(t){g(this,e),this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||"df_".concat(c++,"_")}return b(e,[{key:"namedNode",value:function(e){return new o.NamedNode(e)}},{key:"blankNode",value:function(e){return new r.BlankNode(e||"".concat(this.blankNodePrefix).concat(this.blankNodeCounter++))}},{key:"literal",value:function(e,t){return new a.Literal(e,t)}},{key:"variable",value:function(e){return new s.Variable(e)}},{key:"defaultGraph",value:function(){return i.DefaultGraph.INSTANCE}},{key:"quad",value:function(e,t,n,r){return new u.Quad(e,t,n,r||this.defaultGraph())}},{key:"fromTerm",value:function(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(a.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}},{key:"fromQuad",value:function(e){return this.fromTerm(e)}},{key:"resetBlankNodeCounter",value:function(){this.blankNodeCounter=0}}]),e}()},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;var r=function(){function e(){g(this,e),this.termType="DefaultGraph",this.value=""}return b(e,[{key:"equals",value:function(e){return!!e&&"DefaultGraph"===e.termType}}]),e}();n.DefaultGraph=r,r.INSTANCE=new r},{}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;var r=e("./NamedNode"),i=function(){function e(t,n){g(this,e),this.termType="Literal",this.value=t,"string"==typeof n?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING):n?(this.language="",this.datatype=n):(this.language="",this.datatype=e.XSD_STRING)}return b(e,[{key:"equals",value:function(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}]),e}();n.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0,n.NamedNode=function(){function e(t){g(this,e),this.termType="NamedNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}]),e}()},{}],62:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0,n.Quad=function(){function e(t,n,r,i){g(this,e),this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=r,this.graph=i}return b(e,[{key:"equals",value:function(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}]),e}()},{}],63:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0,n.Variable=function(){function e(t){g(this,e),this.termType="Variable",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}]),e}()},{}],64:[function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),i(e("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;var r=function(e){a(n,e);var t=o(n);function n(e,r){g(this,n);var i=e.saxStream._parser;return t.call(this,e.trackPosition?"Line ".concat(i.line+1," column ").concat(i.column+1,": ").concat(r):r)}return n}(c(Error));n.ParseError=r},{}],66:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;var r,i,u=e("relative-to-absolute-iri"),c=e("sax"),l=e("stream"),f=e("./ParseError"),d=e("rdf-data-factory"),h=function(e){a(n,e);var t=o(n);function n(e){var r;return g(this,n),(r=t.call(this,{readableObjectMode:!0})).activeTagStack=[],r.nodeIds={},e&&(Object.assign(s(r),e),r.options=e),r.dataFactory||(r.dataFactory=new d.DataFactory),r.baseIRI||(r.baseIRI=""),r.defaultGraph||(r.defaultGraph=r.dataFactory.defaultGraph()),r.saxStream=c.createStream(r.strict,{xmlns:!1,position:r.trackPosition}),r.strict||(r.saxStream._parser.looseCase="toString"),r.attachSaxListeners(),r}return b(n,[{key:"import",value:function(e){var t=new l.PassThrough({readableObjectMode:!0});e.on("error",function(e){return r.emit("error",e)}),e.on("data",function(e){return t.push(e)}),e.on("end",function(){return t.push(null)});var r=t.pipe(new n(this.options));return r}},{key:"_transform",value:function(e,t,n){try{this.saxStream.write(e,t)}catch(r){return n(r)}n()}},{key:"newParseError",value:function(e){return new f.ParseError(this,e)}},{key:"valueToUri",value:function(e,t){return this.uriToNamedNode(u.resolve(e,t.baseIRI))}},{key:"uriToNamedNode",value:function(e){if(!n.isValidIri(e))throw this.newParseError("Invalid URI: ".concat(e));return this.dataFactory.namedNode(e)}},{key:"validateNcname",value:function(e){if(!n.NCNAME_MATCHER.test(e))throw this.newParseError("Not a valid NCName: ".concat(e))}},{key:"attachSaxListeners",value:function(){var e=this;this.saxStream.on("error",function(t){return e.emit("error",t)}),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}},{key:"onTag",value:function(e){var t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null,i=r.RESOURCE;if(t&&(t.hadChildren=!0,i=t.childrenParseType),t&&t.childrenStringTags){var a=e.name,o="";for(var u in e.attributes)o+=" ".concat(u,'="').concat(e.attributes[u],'"');t.childrenStringTags.push("<".concat(a).concat(o,">"));var s={childrenStringTags:t.childrenStringTags};return s.childrenStringEmitClosingTag=""),void this.activeTagStack.push(s)}var c={};t?(c.language=t.language,c.baseIRI=t.baseIRI):c.baseIRI=this.baseIRI,this.activeTagStack.push(c),c.ns=n.parseNamespace(e,t),i===r.RESOURCE?this.onTagResource(e,c,t,!t):this.onTagProperty(e,c,t)}},{key:"onTagResource",value:function(e,t,i,a){var o=n.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=r.PROPERTY;var s=!0;if(o.uri===n.RDF){if(!a&&n.FORBIDDEN_NODE_ELEMENTS.indexOf(o.local)>=0)throw this.newParseError("Illegal node element name: ".concat(o.local));switch(o.local){case"RDF":t.childrenParseType=r.RESOURCE;case"Description":s=!1}}var c=[],l=[],f=null,d=!1,h=!1,p=null;for(var v in e.attributes){var g=e.attributes[v],y=n.expandPrefixedTerm(v,t.ns,this);if(i&&y.uri===n.RDF)switch(y.local){case"about":if(f)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(f," where found."));f=g;continue;case"ID":if(f)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(f," where found."));this.validateNcname(g),f="#"+g,d=!0;continue;case"nodeID":if(f)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(f," where found."));this.validateNcname(g),f=g,h=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=g;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(y.uri===n.XML){if("lang"===y.local){t.language=""===g?null:g.toLowerCase();continue}if("base"===y.local){t.baseIRI=u.resolve(g,t.baseIRI);continue}}"xml"!==y.prefix&&y.uri&&(c.push(this.uriToNamedNode(y.uri+y.local)),l.push(g))}if(null!==f&&(t.subject=h?this.dataFactory.blankNode(f):this.valueToUri(f,t),d&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),s){var b=this.uriToNamedNode(o.uri+o.local);this.emitTriple(t.subject,this.dataFactory.namedNode(n.RDF+"type"),b,i?i.reifiedStatementId:null)}if(i){if(i.predicate)if(i.childrenCollectionSubject){var m=this.dataFactory.blankNode();this.emitTriple(i.childrenCollectionSubject,i.childrenCollectionPredicate,m,i.reifiedStatementId),this.emitTriple(m,this.dataFactory.namedNode(n.RDF+"first"),t.subject,t.reifiedStatementId),i.childrenCollectionSubject=m,i.childrenCollectionPredicate=this.dataFactory.namedNode(n.RDF+"rest")}else{this.emitTriple(i.subject,i.predicate,t.subject,i.reifiedStatementId);for(var _=0;_=0)throw this.newParseError("Illegal property element name: ".concat(a.local));t.predicateSubPredicates=[],t.predicateSubObjects=[];var o=!1,u=!1,s=null,c=!0,l=[],f=[];for(var d in e.attributes){var h=e.attributes[d],p=n.expandPrefixedTerm(d,t.ns,this);if(p.uri===n.RDF)switch(p.local){case"resource":if(s)throw this.newParseError("Found both rdf:resource (".concat(h,") and rdf:nodeID (").concat(s,")."));if(o)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:resource (".concat(h,")"));t.hadChildren=!0,s=h,c=!1;continue;case"datatype":if(u)throw this.newParseError("Found both non-rdf:* property attributes and rdf:datatype (".concat(h,")."));if(o)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(h,")"));t.datatype=this.valueToUri(h,t);continue;case"nodeID":if(u)throw this.newParseError("Found both non-rdf:* property attributes and rdf:nodeID (".concat(h,")."));if(t.hadChildren)throw this.newParseError("Found both rdf:resource and rdf:nodeID (".concat(h,")."));if(o)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID (".concat(h,")"));this.validateNcname(h),t.hadChildren=!0,s=h,c=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(u)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(t.datatype.value,")"));if(s)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (".concat(s,")"));if("Resource"===h){o=!0,t.childrenParseType=r.PROPERTY;var v=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,v,t.reifiedStatementId),t.subject=v,t.predicate=null}else"Collection"===h?(o=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,c=!1):"Literal"===h&&(o=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(h),t.reifiedStatementId=this.valueToUri("#"+h,t),this.claimNodeId(t.reifiedStatementId);continue}else if(p.uri===n.XML&&"lang"===p.local){t.language=""===h?null:h.toLowerCase();continue}if("xml"!==p.prefix&&"xmlns"!==p.prefix&&p.uri){if(o||t.datatype)throw this.newParseError("Found illegal rdf:* properties on property element with attribute: ".concat(h));t.hadChildren=!0,u=!0,l.push(this.uriToNamedNode(p.uri+p.local)),f.push(this.dataFactory.literal(h,t.datatype||t.language))}}if(null!==s){var g=t.subject;t.subject=c?this.dataFactory.blankNode(s):this.valueToUri(s,t),this.emitTriple(g,t.predicate,t.subject,t.reifiedStatementId);for(var y=0;y/g,function(e,n,r){return t.saxStream._parser.ENTITIES[n]=r,""})}}],[{key:"parseNamespace",value:function(e,t){var r={},i=!1;for(var a in e.attributes)a.startsWith("xmlns")&&(5===a.length?(i=!0,r[""]=e.attributes[a]):":"===a.charAt(5)&&(i=!0,r[a.substr(6)]=e.attributes[a]));var o=t&&t.ns?t.ns:[n.DEFAULT_NS];return i?o.concat([r]):o}},{key:"expandPrefixedTerm",value:function(e,t,n){var r,i,a=e.indexOf(":");a>=0?(r=e.substr(0,a),i=e.substr(a+1)):(r="",i=e);for(var o=null,u=null,s=t.length-1;s>=0;s--){var c=t[s][r];if(c){o=c;break}u||(u=t[s][""])}if(!o){if(r&&"xmlns"!==r)throw new f.ParseError(n,"The prefix '".concat(r,"' in term '").concat(e,"' was not bound."));o=u||""}return{prefix:r,local:i,uri:o}}},{key:"isValidIri",value:function(e){return n.IRI_REGEX.test(e)}}]),n}(l.Transform);n.RdfXmlParser=h,h.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,h.MIME_TYPE="application/rdf+xml",h.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",h.XML="http://www.w3.org/XML/1998/namespace",h.XMLNS="http://www.w3.org/2000/xmlns/",h.DEFAULT_NS={xml:h.XML},h.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],h.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],h.NCNAME_MATCHER=/^((?:[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]))((?:[#\x2D\.0-9A-Z_a-z\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]))*$/,(i=r=n.ParseType||(n.ParseType={}))[i.RESOURCE=0]="RESOURCE",i[i.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(e,t,n){"use strict";var r={};function i(e,t,n){n||(n=Error);var i=function(e){function n(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(n,e),n}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function a(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,n){var r,i;if("string"==typeof t&&function(e,t,n){return e.substr(0,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))i="The ".concat(e," ").concat(r," ").concat(a(t,"type"));else{var o=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(a(t,"type"))}return i+". Received type ".concat(typeof n)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},{}],68:[function(e,t,n){(function(n){(function(){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var i=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(c,i);for(var o=r(a.prototype),u=0;u0)if("string"!=typeof t&&!u.objectMode&&Object.getPrototypeOf(t)!==s.prototype&&(t=function(e){return s.from(e)}(t)),r)u.endEmitted?x(e,new w):E(e,u,t,!0);else if(u.ended)x(e,new m);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?E(e,u,t,!1):O(e,u)):E(e,u,t,!1)}else r||(u.reading=!1,O(e,u));return!u.ended&&(u.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(A,e))}function A(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function O(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){a("readable nexttick read 0"),e.read(0)}function P(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(G,t,e))}function G(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function U(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):R(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&B(this),null;var r,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),null!==r&&this.emit("data",r),r},j.prototype._read=function(e){x(this,new _("_read()"))},j.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,a("pipe count=%d opts=%j",i.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?v:s;function s(){a("onend"),e.end()}i.endEmitted?n.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,o){a("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,a("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",v),r.removeListener("data",f),l=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c())});var c=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,C(e))}}(r);e.on("drain",c);var l=!1;function f(t){a("ondata");var n=e.write(t);a("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!l&&(a("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(t){a("onerror",t),v(),e.removeListener("error",d),0===o(e,"error")&&x(e,t)}function h(){e.removeListener("finish",p),v()}function p(){a("onfinish"),e.removeListener("close",h),v()}function v(){a("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",r),i.flowing||(a("pipe resume"),r.resume()),e},j.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===e&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?R(this):i.reading||n.nextTick(D,this)),r},j.prototype.removeListener=function(e,t){var r=u.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(M,this),r},j.prototype.removeAllListeners=function(e){var t=u.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(M,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(P,e,t))}(this,e)),e.paused=!1,this},j.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(a("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){a("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||!(n.objectMode||i&&i.length)||t.push(i)||(r=!0,e.pause())}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(e,t,n){n(new v("_write()"))},j.prototype._writev=null,j.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}}),j.prototype.destroy=f.destroy,j.prototype._undestroy=f.undestroy,j.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(e,t,n){(function(n){(function(){"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=e("./end-of-stream"),o=Symbol("lastResolve"),u=Symbol("lastReject"),s=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var n=e[d].read();null!==n&&(e[l]=null,e[o]=null,e[u]=null,t(h(n,!1)))}}function v(e){n.nextTick(p,e)}var g=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((i(r={get stream(){return this[d]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(t,r){n.nextTick(function(){e[s]?r(e[s]):t(h(void 0,!0))})});var r,i=this[l];if(i)r=new Promise(function(e,t){return function(n,r){e.then(function(){t[c]?n(h(void 0,!0)):t[f](n,r)},r)}}(i,this));else{var a=this[d].read();if(null!==a)return Promise.resolve(h(a,!1));r=new Promise(this[f])}return this[l]=r,r}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[d].destroy(null,function(e){e?n(e):t(h(void 0,!0))})})}),r),g);t.exports=function(e){var t,n=Object.create(y,(i(t={},d,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var r=n[d].read();r?(n[l]=null,n[o]=null,n[u]=null,e(h(r,!1))):(n[o]=e,n[u]=t)},writable:!0}),t));return n[l]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[u];return null!==t&&(n[l]=null,n[o]=null,n[u]=null,t(e)),void(n[s]=e)}var r=n[o];null!==r&&(n[l]=null,n[o]=null,n[u]=null,r(h(void 0,!0))),n[c]=!0}),e.on("readable",v.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":76,_process:44}],74:[function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t=o.allocUnsafe(e>>>0),n=this.head,r=0;n;)c(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(r+=a===i.length?i:i.slice(0,e),0==(e-=a)){a===i.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++r,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:s,value:function(e,t){return u(this,function(e){for(var t=1;t0,function(e){i||(i=e),e&&o.forEach(c),!a&&(o.forEach(c),r(i))})});return t.reduce(l)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(e,t,n){"use strict";var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":67}],80:[function(e,t,n){t.exports=e("events").EventEmitter},{events:8}],81:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(e,t,n){"use strict";function r(e){for(var t=[],n=0;n=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);var i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function a(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(e,t){var n=(t=t||"").indexOf("#");if(n>0&&(t=t.substr(0,n)),!e.length){if(t.indexOf(":")<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));return t}if(e.startsWith("?")){var a=t.indexOf("?");return a>0&&(t=t.substr(0,a)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){var o=e.indexOf(":");if(o<0)throw new Error("Found invalid relative IRI '".concat(e,"' for a missing baseIRI"));return i(e,o)}var u=e.indexOf(":");if(u>=0)return i(e,u);var s=t.indexOf(":");if(s<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));var c,l=t.substr(0,s+1);if(0===e.indexOf("//"))return l+i(e,u);if(t.indexOf("//",s)===s+1){if((c=t.indexOf("/",s+3))<0)return t.length>s+3?t+"/"+i(e,u):l+i(e,u)}else if((c=t.indexOf("/",s+1))<0)return l+i(e,u);if(0===e.indexOf("/"))return t.substr(0,c)+r(e);var f=t.substr(c),d=f.lastIndexOf("/");return d>=0&&d"===a?(N(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=k.TEXT):(g(a)&&(t.state=k.SGML_DECL_QUOTED),t.sgmlDecl+=a);continue;case k.SGML_DECL_QUOTED:a===t.q&&(t.state=k.SGML_DECL,t.q=""),t.sgmlDecl+=a;continue;case k.DOCTYPE:">"===a?(t.state=k.TEXT,N(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=a,"["===a?t.state=k.DOCTYPE_DTD:g(a)&&(t.state=k.DOCTYPE_QUOTED,t.q=a));continue;case k.DOCTYPE_QUOTED:t.doctype+=a,a===t.q&&(t.q="",t.state=k.DOCTYPE);continue;case k.DOCTYPE_DTD:t.doctype+=a,"]"===a?t.state=k.DOCTYPE:g(a)&&(t.state=k.DOCTYPE_DTD_QUOTED,t.q=a);continue;case k.DOCTYPE_DTD_QUOTED:t.doctype+=a,a===t.q&&(t.state=k.DOCTYPE_DTD,t.q="");continue;case k.COMMENT:"-"===a?t.state=k.COMMENT_ENDING:t.comment+=a;continue;case k.COMMENT_ENDING:"-"===a?(t.state=k.COMMENT_ENDED,t.comment=T(t.opt,t.comment),t.comment&&N(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+a,t.state=k.COMMENT);continue;case k.COMMENT_ENDED:">"!==a?(A(t,"Malformed comment"),t.comment+="--"+a,t.state=k.COMMENT):t.state=k.TEXT;continue;case k.CDATA:"]"===a?t.state=k.CDATA_ENDING:t.cdata+=a;continue;case k.CDATA_ENDING:"]"===a?t.state=k.CDATA_ENDING_2:(t.cdata+="]"+a,t.state=k.CDATA);continue;case k.CDATA_ENDING_2:">"===a?(t.cdata&&N(t,"oncdata",t.cdata),N(t,"onclosecdata"),t.cdata="",t.state=k.TEXT):"]"===a?t.cdata+="]":(t.cdata+="]]"+a,t.state=k.CDATA);continue;case k.PROC_INST:"?"===a?t.state=k.PROC_INST_ENDING:v(a)?t.state=k.PROC_INST_BODY:t.procInstName+=a;continue;case k.PROC_INST_BODY:if(!t.procInstBody&&v(a))continue;"?"===a?t.state=k.PROC_INST_ENDING:t.procInstBody+=a;continue;case k.PROC_INST_ENDING:">"===a?(N(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=k.TEXT):(t.procInstBody+="?"+a,t.state=k.PROC_INST_BODY);continue;case k.OPEN_TAG:b(d,a)?t.tagName+=a:(O(t),">"===a?D(t):"/"===a?t.state=k.OPEN_TAG_SLASH:(v(a)||A(t,"Invalid character in tag name"),t.state=k.ATTRIB));continue;case k.OPEN_TAG_SLASH:">"===a?(D(t,!0),P(t)):(A(t,"Forward-slash in opening tag not followed by >"),t.state=k.ATTRIB);continue;case k.ATTRIB:if(v(a))continue;">"===a?D(t):"/"===a?t.state=k.OPEN_TAG_SLASH:b(f,a)?(t.attribName=a,t.attribValue="",t.state=k.ATTRIB_NAME):A(t,"Invalid attribute name");continue;case k.ATTRIB_NAME:"="===a?t.state=k.ATTRIB_VALUE:">"===a?(A(t,"Attribute without value"),t.attribValue=t.attribName,M(t),D(t)):v(a)?t.state=k.ATTRIB_NAME_SAW_WHITE:b(d,a)?t.attribName+=a:A(t,"Invalid attribute name");continue;case k.ATTRIB_NAME_SAW_WHITE:if("="===a)t.state=k.ATTRIB_VALUE;else{if(v(a))continue;A(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",N(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===a?D(t):b(f,a)?(t.attribName=a,t.state=k.ATTRIB_NAME):(A(t,"Invalid attribute name"),t.state=k.ATTRIB)}continue;case k.ATTRIB_VALUE:if(v(a))continue;g(a)?(t.q=a,t.state=k.ATTRIB_VALUE_QUOTED):(A(t,"Unquoted attribute value"),t.state=k.ATTRIB_VALUE_UNQUOTED,t.attribValue=a);continue;case k.ATTRIB_VALUE_QUOTED:if(a!==t.q){"&"===a?t.state=k.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=a;continue}M(t),t.q="",t.state=k.ATTRIB_VALUE_CLOSED;continue;case k.ATTRIB_VALUE_CLOSED:v(a)?t.state=k.ATTRIB:">"===a?D(t):"/"===a?t.state=k.OPEN_TAG_SLASH:b(f,a)?(A(t,"No whitespace between attributes"),t.attribName=a,t.attribValue="",t.state=k.ATTRIB_NAME):A(t,"Invalid attribute name");continue;case k.ATTRIB_VALUE_UNQUOTED:if(!y(a)){"&"===a?t.state=k.ATTRIB_VALUE_ENTITY_U:t.attribValue+=a;continue}M(t),">"===a?D(t):t.state=k.ATTRIB;continue;case k.CLOSE_TAG:if(t.tagName)">"===a?P(t):b(d,a)?t.tagName+=a:t.script?(t.script+=""===a?P(t):A(t,"Invalid characters in closing tag");continue;case k.TEXT_ENTITY:case k.ATTRIB_VALUE_ENTITY_Q:case k.ATTRIB_VALUE_ENTITY_U:var u,s;switch(t.state){case k.TEXT_ENTITY:u=k.TEXT,s="textNode";break;case k.ATTRIB_VALUE_ENTITY_Q:u=k.ATTRIB_VALUE_QUOTED,s="attribValue";break;case k.ATTRIB_VALUE_ENTITY_U:u=k.ATTRIB_VALUE_UNQUOTED,s="attribValue"}";"===a?(t[s]+=C(t),t.entity="",t.state=u):b(t.entity.length?p:h,a)?t.entity+=a:(A(t,"Invalid character in entity name"),t[s]+="&"+t.entity+a,t.entity="",t.state=u);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&function(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),r=0,a=0,o=i.length;at)switch(i[a]){case"textNode":E(e);break;case"cdata":N(e,"oncdata",e.cdata),e.cdata="";break;case"script":N(e,"onscript",e.script),e.script="";break;default:I(e,"Max buffer length exceeded: "+i[a])}r=Math.max(r,u)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-r+e.position}(t),t},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(e){E(e),""!==e.cdata&&(N(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(N(e,"onscript",e.script),e.script="")}(this)}};try{r=e("stream").Stream}catch(_){r=function(){}}var o=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function u(e,t){if(!(this instanceof u))return new u(e,t);r.apply(this),this._parser=new a(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,o.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})})}(u.prototype=Object.create(r.prototype,{constructor:{value:u}})).write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var r=e("string_decoder").StringDecoder;this._decoder=new r("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},u.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},u.prototype.on=function(e,t){var n=this;return!n._parser["on"+e]&&-1!==o.indexOf(e)&&(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var s="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",l={xml:s,xmlns:c},f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,h=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function v(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function g(e){return'"'===e||"'"===e}function y(e){return">"===e||v(e)}function b(e,t){return e.test(t)}function m(e,t){return!b(e,t)}var _,w,x,k=0;for(var S in n.STATE={BEGIN:k++,BEGIN_WHITESPACE:k++,TEXT:k++,TEXT_ENTITY:k++,OPEN_WAKA:k++,SGML_DECL:k++,SGML_DECL_QUOTED:k++,DOCTYPE:k++,DOCTYPE_QUOTED:k++,DOCTYPE_DTD:k++,DOCTYPE_DTD_QUOTED:k++,COMMENT_STARTING:k++,COMMENT:k++,COMMENT_ENDING:k++,COMMENT_ENDED:k++,CDATA:k++,CDATA_ENDING:k++,CDATA_ENDING_2:k++,PROC_INST:k++,PROC_INST_BODY:k++,PROC_INST_ENDING:k++,OPEN_TAG:k++,OPEN_TAG_SLASH:k++,ATTRIB:k++,ATTRIB_NAME:k++,ATTRIB_NAME_SAW_WHITE:k++,ATTRIB_VALUE:k++,ATTRIB_VALUE_QUOTED:k++,ATTRIB_VALUE_CLOSED:k++,ATTRIB_VALUE_UNQUOTED:k++,ATTRIB_VALUE_ENTITY_Q:k++,ATTRIB_VALUE_ENTITY_U:k++,CLOSE_TAG:k++,CLOSE_TAG_SAW_WHITE:k++,SCRIPT:k++,SCRIPT_ENDING:k++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],r="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=r}),n.STATE)n.STATE[n.STATE[S]]=S;function j(e,t,n){e[t]&&e[t](n)}function N(e,t,n){e.textNode&&E(e),j(e,t,n)}function E(e){e.textNode=T(e.opt,e.textNode),e.textNode&&j(e,"ontext",e.textNode),e.textNode=""}function T(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function I(e,t){return E(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,j(e,"onerror",t),e}function R(e){return e.sawRoot&&!e.closedRoot&&A(e,"Unclosed root tag"),e.state!==k.BEGIN&&e.state!==k.BEGIN_WHITESPACE&&e.state!==k.TEXT&&I(e,"Unexpected end"),E(e),e.c="",e.closed=!0,j(e,"onend"),a.call(e,e.strict,e.opt),e}function A(e,t){if("object"!=typeof e||!(e instanceof a))throw new Error("bad call to strictFail");e.strict&&I(e,t)}function O(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,N(e,"onopentagstart",n)}function L(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function M(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=L(e.attribName,!0),n=t.local;if("xmlns"===t.prefix)if("xml"===n&&e.attribValue!==s)A(e,"xml: prefix must be bound to "+s+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==c)A(e,"xmlns: prefix must be bound to "+c+"\nActual: "+e.attribValue);else{var r=e.tag,i=e.tags[e.tags.length-1]||e;r.ns===i.ns&&(r.ns=Object.create(i.ns)),r.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,N(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function D(e,t){if(e.opt.xmlns){var n=e.tag,r=L(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(A(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix),n.ns&&(e.tags[e.tags.length-1]||e).ns!==n.ns&&Object.keys(n.ns).forEach(function(t){N(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var i=0,a=e.attribList.length;i",e.tagName="",void(e.state=k.SCRIPT);N(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)A(e,"Unexpected close tag");if(t<0)return A(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=k.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,N(e,"onclosetag",e.tagName);var o={};for(var u in a.ns)o[u]=a.ns[u];e.opt.xmlns&&a.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(a.ns).forEach(function(t){N(e,"onclosenamespace",{prefix:t,uri:a.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=k.TEXT}function C(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==n?(A(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function F(e,t){"<"===t?(e.state=k.OPEN_WAKA,e.startTagPosition=e.position):v(t)||(A(e,"Non-whitespace before first tag."),e.textNode=t,e.state=k.TEXT)}function B(e,t){var n="";return t1114111||w(a)!==a)throw RangeError("Invalid code point: "+a);a<=65535?t.push(a):t.push(55296+((a-=65536)>>10),a%1024+56320),(n+1===r||t.length>e)&&(i+=_.apply(null,t),t.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:x,configurable:!0,writable:!0}):String.fromCodePoint=x)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,e("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(e,t,n){(function(e,t){(function(){!function(t,n){"use strict";if(!t.setImmediate){var r,i=1,a={},o=!1,u=t.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(t);s=s&&s.setTimeout?s:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){d(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(c="setImmediate$"+Math.random()+"$",l=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(c)&&d(+e.data.slice(c.length))},t.addEventListener?t.addEventListener("message",l,!1):t.attachEvent("onmessage",l),r=function(e){t.postMessage(c+e,"*")}):t.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){d(e.data)},r=function(t){e.port2.postMessage(t)}}():u&&"onreadystatechange"in u.createElement("script")?function(){var e=u.documentElement;r=function(t){var n=u.createElement("script");n.onreadystatechange=function(){d(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():r=function(e){setTimeout(d,0,e)},s.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=s++,r=!(arguments.length<2)&&o.call(arguments,1);return u[t]=!0,i(function(){u[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(e,t,n){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(r){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(e,t,n){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}},e,this)})}},{}],92:[function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,a=this.head;null!==a&&ithis.length&&(t=this.length);for(var i=this.length,a=this.tail;null!==a&&i>t;i--)a=a.prev;for(;null!==a&&i>e;i--,a=a.prev)n.push(a.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,console&&console.warn&&console.warn(u)}return e}function N(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=N.bind(r);return i.listener=n,r.wrapFn=i,i}function T(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)m(u,this,t);else{var s=u.length,c=R(u,s);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},w.prototype.listeners=function(e){return T(this,e,!0)},w.prototype.rawListeners=function(e){return T(this,e,!1)},w.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):I.call(e,t)},w.prototype.listenerCount=I,w.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]},O.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(O.prototype[Symbol.iterator]=function(){return this}),O.of=function(){var e=arguments,t=e.length,n=0;return new O(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},O.empty=function(){var e=new O(null);return e.done=!0,e},O.is=function(e){return e instanceof O||"object"==typeof e&&null!==e&&"function"==typeof e.next};var L=O,M=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],a=0;;){if(a===r)return i;if((n=e.next()).done)return a!==t?i.slice(0,a):i;i[a++]=n.value}},D=function(e){function n(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return t(n,e),n}(o(Error)),P=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(i),n.prototype.constructor),i}return t(n,e),n}(D),C=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(i),n.prototype.constructor),i}return t(n,e),n}(D),F=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(i),n.prototype.constructor),i}return t(n,e),n}(D);function B(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function G(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function U(e,t){this.key=e,this.attributes=t,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function V(e,t,n,r,i,a){this.key=t,this.attributes=a,this.undirected=e,this.source=r,this.target=i,this.generatedKey=n}function z(e,t,n,r,i,a,o){var u,s,c="out",l="in";if(t&&(c=l="undirected"),e.multi){if(void 0===(s=(u=a[c])[i])&&(s=new Set,u[i]=s),s.add(n),r===i&&t)return;void 0===(u=o[l])[r]&&(u[r]=s)}else{if(a[c][i]=n,r===i&&t)return;o[l][r]=n}}function q(e,t,n){var r=e.multi,i=n.source,a=n.target,o=i.key,u=a.key,s=i[t?"undirected":"out"],c=t?"undirected":"in";if(u in s)if(r){var l=s[u];1===l.size?(delete s[u],delete a[c][o]):l.delete(n)}else delete s[u];r||delete a[c][o]}G.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},U.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var K=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes[r]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+e,a=""+arguments[1];if(!(r=c(this,i,a,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(i,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes.hasOwnProperty(r)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,i){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,u=""+r;if(r=arguments[2],i=arguments[3],!(a=c(this,o,u,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(u,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&a.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[r]=i,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,i){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,u=""+r;if(r=arguments[2],i=arguments[3],!(a=c(this,o,u,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(u,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof i)throw new P("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&a.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[r]=i(a.attributes[r]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete i.attributes[r],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:r}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!f(r))throw new P("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes=r,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+r;if(r=arguments[2],!(i=c(this,a,o,n)))throw new C("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!f(r))throw new P("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new C("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return s(i.attributes,r),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:r}),this}}}],H=L,W=function(){var e,t=arguments,n=-1;return new H(function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i})},J=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Q(e,t){for(var n in t)e.push(t[n].key)}function X(e,t){for(var n in t)t[n].forEach(function(t){return e.push(t.key)})}function Y(e,t,n){for(var r in e)if(r!==n){var i=e[r];t(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected,i.generatedKey)}}function Z(e,t,n){for(var r in e)r!==n&&e[r].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function $(e,t,n){for(var r in e)if(r!==n){var i=e[r];if(t(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected,i.generatedKey))return!0}return!1}function ee(e,t,n){var r,i,a,o,u;for(var s in e)if(s!==n)for(r=e[s].values();!0!==(i=r.next()).done;)if(o=(a=i.value).source,t(a.key,a.attributes,o.key,(u=a.target).key,o.attributes,u.attributes,a.undirected,a.generatedKey))return!0;return!1}function te(e,t){var n=Object.keys(e),r=n.length,i=null,a=0;return new L(function o(){var u;if(i){var s=i.next();if(s.done)return i=null,a++,o();u=s.value}else{if(a>=r)return{done:!0};var c=n[a];if(c===t)return a++,o();if((u=e[c])instanceof Set)return i=u.values(),o();a++}return{done:!1,value:[u.key,u.attributes,u.source.key,u.target.key,u.source.attributes,u.target.attributes]}})}function ne(e,t,n){var r=t[n];r&&e.push(r.key)}function re(e,t,n){var r=t[n];r&&r.forEach(function(t){return e.push(t.key)})}function ie(e,t,n){var r=e[t];if(r){var i=r.source,a=r.target;n(r.key,r.attributes,i.key,a.key,i.attributes,a.attributes,r.undirected,r.generatedKey)}}function ae(e,t,n){var r=e[t];r&&r.forEach(function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function oe(e,t,n){var r=e[t];if(r){var i=r.source,a=r.target;return n(r.key,r.attributes,i.key,a.key,i.attributes,a.attributes,r.undirected,r.generatedKey)}}function ue(e,t,n){var r=e[t];if(r){for(var i,a,o=r.values();!0!==(i=o.next()).done;)if(n((a=i.value).key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected,a.generatedKey))return!0;return!1}}function se(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new L(function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return L.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ce(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return"function"==typeof Array.from?Array.from(e._edges.keys()):M(e._edges.keys(),e._edges.size);for(var n,r,i=new Array("undirected"===t?e.undirectedSize:e.directedSize),a="undirected"===t,o=e._edges.values(),u=0;!0!==(n=o.next()).done;)(r=n.value).undirected===a&&(i[u++]=r.key);return i}function le(e,t,n){if(0!==e.size)for(var r,i,a="mixed"!==t&&t!==e.type,o="undirected"===t,u=e._edges.values();!0!==(r=u.next()).done;)if(i=r.value,!a||i.undirected===o){var s=i.source,c=i.target;n(i.key,i.attributes,s.key,c.key,s.attributes,c.attributes,i.undirected,i.generatedKey)}}function fe(e,t,n){if(0!==e.size)for(var r,i,a="mixed"!==t&&t!==e.type,o="undirected"===t,u=e._edges.values();!0!==(r=u.next()).done;)if(i=r.value,!a||i.undirected===o){var s=i.source,c=i.target;if(n(i.key,i.attributes,s.key,c.key,s.attributes,c.attributes,i.undirected,i.generatedKey))break}}function de(e,t){if(0===e.size)return L.empty();var n="mixed"!==t&&t!==e.type,r="undirected"===t,i=e._edges.values();return new L(function(){for(var e,t;;){if((e=i.next()).done)return e;if(t=e.value,!n||t.undirected===r)break}return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})}function he(e,t,n,r){var i=[],a=e?X:Q;return"undirected"!==t&&("out"!==n&&a(i,r.in),"in"!==n&&a(i,r.out),!n&&r.directedSelfLoops>0&&i.splice(i.lastIndexOf(r.key),1)),"directed"!==t&&a(i,r.undirected),i}function pe(e,t,n,r,i){var a=e?Z:Y;"undirected"!==t&&("out"!==n&&a(r.in,i),"in"!==n&&a(r.out,i,n?null:r.key)),"directed"!==t&&a(r.undirected,i)}function ve(e,t,n,r,i){var a=e?ee:$;"undirected"!==t&&("out"!==n&&a(r.in,i)||"in"!==n&&a(r.out,i,n?null:r.key))||"directed"===t||a(r.undirected,i)}function ge(e,t,n){var r=L.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=W(r,te(n.in))),"in"!==t&&void 0!==n.out&&(r=W(r,te(n.out,t?null:n.key)))),"directed"!==e&&void 0!==n.undirected&&(r=W(r,te(n.undirected))),r}function ye(e,t,n,r,i){var a=t?re:ne,o=[];return"undirected"!==e&&(void 0!==r.in&&"out"!==n&&a(o,r.in,i),void 0!==r.out&&"in"!==n&&a(o,r.out,i),!n&&r.directedSelfLoops>0&&o.splice(o.lastIndexOf(r.key),1)),"directed"!==e&&void 0!==r.undirected&&a(o,r.undirected,i),o}function be(e,t,n,r,i,a){var o=t?ae:ie;"undirected"!==e&&(void 0!==r.in&&"out"!==n&&o(r.in,i,a),r.key!==i&&void 0!==r.out&&"in"!==n&&o(r.out,i,a)),"directed"!==e&&void 0!==r.undirected&&o(r.undirected,i,a)}function me(e,t,n,r,i,a){var o=t?ue:oe;"undirected"!==e&&(void 0!==r.in&&"out"!==n&&o(r.in,i,a)||r.key!==i&&void 0!==r.out&&"in"!==n&&o(r.out,i,a,n?null:r.key))||"directed"===e||void 0===r.undirected||o(r.undirected,i,a)}function _e(e,t,n,r){var i=L.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=W(i,se(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=W(i,se(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=W(i,se(n.undirected,r))),i}var we=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xe(e,t){if(void 0!==t)for(var n in t)e.add(n)}function ke(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&xe(r,n.in),"in"!==t&&xe(r,n.out)),"directed"!==e&&xe(r,n.undirected),M(r.values(),r.size)}function Se(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var a=i.source,o=a===e?i.target:a;n(o.key,o.attributes)}}function je(e,t,n,r){for(var i in n){var a=n[i];a instanceof Set&&(a=a.values().next().value);var o=a.source,u=o===t?a.target:o;e.has(u.key)||(e.add(u.key),r(u.key,u.attributes))}}function Ne(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var a=i.source,o=a===e?i.target:a;if(n(o.key,o.attributes))return!0}return!1}function Ee(e,t,n,r){for(var i in n){var a=n[i];a instanceof Set&&(a=a.values().next().value);var o=a.source,u=o===t?a.target:o;if(!e.has(u.key)&&(e.add(u.key),r(u.key,u.attributes)))return!0}return!1}function Te(e,t){var n=Object.keys(t),r=n.length,i=0;return new L(function(){if(i>=r)return{done:!0};var a=t[n[i++]];a instanceof Set&&(a=a.values().next().value);var o=a.source,u=o===e?a.target:o;return{done:!1,value:[u.key,u.attributes]}})}function Ie(e,t,n){var r=Object.keys(n),i=r.length,a=0;return new L(function o(){if(a>=i)return{done:!0};var u=n[r[a++]];u instanceof Set&&(u=u.values().next().value);var s=u.source,c=s===t?u.target:s;return e.has(c.key)?o():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function Re(e,t,n,r,i){var a=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==a.in)for(var o in a.in)if(o===i)return!0;if("in"!==n&&void 0!==a.out)for(var u in a.out)if(u===i)return!0}if("directed"!==t&&void 0!==a.undirected)for(var s in a.undirected)if(s===i)return!0;return!1}function Ae(e,t,n){for(var r,i,a,o,u,s,c,l=t._nodes.values(),f=t.type;!0!==(r=l.next()).done;){if(i=r.value,"undirected"!==f)for(a in o=i.out)if(s=(u=o[a]).target,c=n(i.key,s.key,i.attributes,s.attributes,u.key,u.attributes,u.undirected,u.generatedKey),e&&c)return;if("directed"!==f)for(a in o=i.undirected)if((s=(u=o[a]).target).key!==a&&(s=u.source),c=n(i.key,s.key,i.attributes,s.attributes,u.key,u.attributes,u.undirected,u.generatedKey),e&&c)return}}function Oe(e,t,n){for(var r,i,a,o,u,s,c,l,f,d=t._nodes.values(),h=t.type;!0!==(r=d.next()).done;){if(i=r.value,"undirected"!==h)for(a in s=i.out)for(o=s[a].values();!0!==(u=o.next()).done;)if(l=(c=u.value).target,f=n(i.key,l.key,i.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&f)return;if("directed"!==h)for(a in s=i.undirected)for(o=s[a].values();!0!==(u=o.next()).done;)if((l=(c=u.value).target).key!==a&&(l=c.source),f=n(i.key,l.key,i.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&f)return}}function Le(e,t){var n={key:e};return d(t.attributes)||(n.attributes=s({},t.attributes)),n}function Me(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),d(t.attributes)||(n.attributes=s({},t.attributes)),t.undirected&&(n.undirected=!0),n}function De(e){return f(e)?"key"in e?!("attributes"in e)||f(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function Pe(e){return f(e)?"source"in e?"target"in e?!("attributes"in e)||f(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Ce=new Set(["directed","undirected","mixed"]),Fe=new Set(["domain","_events","_eventsCount","_maxListeners"]),Be={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Ge(e,t,n){var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function Ue(e,t,n,r,i,a,o,u){if(!r&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(u&&!f(u))throw new P("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(u,'"'));if(a=""+a,o=""+o,u=u||{},!e.allowSelfLoops&&a===o)throw new F("Graph.".concat(t,': source & target are the same ("').concat(a,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var s=e._nodes.get(a),c=e._nodes.get(o);if(!s)throw new C("Graph.".concat(t,': source node "').concat(a,'" not found.'));if(!c)throw new C("Graph.".concat(t,': target node "').concat(o,'" not found.'));var l={key:null,undirected:r,source:a,target:o,attributes:u};if(n&&(i=e._edgeKeyGenerator(l)),e._edges.has(i=""+i))throw new F("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==s.undirected[o]:void 0!==s.out[o]))throw new F("Graph.".concat(t,': an edge linking "').concat(a,'" to "').concat(o,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var d=new V(r,i,n,s,c,u);return e._edges.set(i,d),a===o?r?(s.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(s.directedSelfLoops++,e._directedSelfLoopCount++):r?(s.undirectedDegree++,c.undirectedDegree++):(s.outDegree++,c.inDegree++),z(e,r,d,a,o,s,c),r?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function Ve(e,t,n,r,i,a,o,u,c){if(!r&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(u)if(c){if("function"!=typeof u)throw new P("Graph.".concat(t,': invalid updater function. Expecting a function but got "').concat(u,'"'))}else if(!f(u))throw new P("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(u,'"'));var l;if(a=""+a,o=""+o,c&&(l=u,u=void 0),!e.allowSelfLoops&&a===o)throw new F("Graph.".concat(t,': source & target are the same ("').concat(a,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,h,p=e._nodes.get(a),v=e._nodes.get(o);if(!n&&(d=e._edges.get(i))){if(d.source.key!==a||d.target.key!==o||r&&(d.source.key!==o||d.target.key!==a))throw new F("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(a,'" source & "').concat(o,'" target vs. ("').concat(d.source.key,'", "').concat(d.target.key,'").'));h=d}if(h||e.multi||!p||(h=r?p.undirected[o]:p.out[o]),h)return(c?l:u)?(c?(h.attributes=l(h.attributes),e.emit("edgeAttributesUpdated",{type:"replace",key:h.key,attributes:h.attributes})):(s(h.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:h.key,attributes:h.attributes,data:u})),h.key):h.key;u=u||{},c&&l&&(u=l(u));var g={key:null,undirected:r,source:a,target:o,attributes:u};if(n&&(i=e._edgeKeyGenerator(g)),e._edges.has(i=""+i))throw new F("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return p||(p=Ge(e,a,{}),a===o&&(v=p)),v||(v=Ge(e,o,{})),d=new V(r,i,n,p,v,u),e._edges.set(i,d),a===o?r?(p.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(p.directedSelfLoops++,e._directedSelfLoopCount++):r?(p.undirectedDegree++,v.undirectedDegree++):(p.outDegree++,v.inDegree++),z(e,r,d,a,o,p,v),r?e._undirectedSize++:e._directedSize++,g.key=i,e.emit("edgeAdded",g),i}var ze,qe=function(e){function n(t){var n;if(n=e.call(this)||this,(t=s({},Be,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new P("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new P("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!Ce.has(t.type))throw new P('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new P("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r,i="mixed"===t.type?B:"directed"===t.type?G:U;return h(u(n),"NodeDataClass",i),h(u(n),"_attributes",{}),h(u(n),"_nodes",new Map),h(u(n),"_edges",new Map),h(u(n),"_directedSize",0),h(u(n),"_undirectedSize",0),h(u(n),"_directedSelfLoopCount",0),h(u(n),"_undirectedSelfLoopCount",0),h(u(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(r=0,function(){return r++})),h(u(n),"_options",t),Fe.forEach(function(e){return h(u(n),e,n[e])}),p(u(n),"order",function(){return n._nodes.size}),p(u(n),"size",function(){return n._edges.size}),p(u(n),"directedSize",function(){return n._directedSize}),p(u(n),"undirectedSize",function(){return n._undirectedSize}),p(u(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),p(u(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),p(u(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),p(u(n),"multi",n._options.multi),p(u(n),"type",n._options.type),p(u(n),"allowSelfLoops",n._options.allowSelfLoops),p(u(n),"implementation",function(){return"graphology"}),n}t(n,e);var r=n.prototype;return r.hasNode=function(e){return this._nodes.has(""+e)},r.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&!n.undirected}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.out[t];return!(!i||this.multi&&!i.size)}throw new P("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n.undirected}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.undirected[t];return!(!i||this.multi&&!i.size)}throw new P("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var r=void 0!==n.out&&n.out[t];return r||(r=void 0!==n.undirected&&n.undirected[t]),!(!r||this.multi&&!r.size)}throw new P("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new C('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},r.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new C('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},r.edge=function(e,t){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},r.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(t?n.directedSelfLoops:0)},r.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(t?n.directedSelfLoops:0)},r.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.inDegree+r+(n.outDegree+r)},r.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(t?n.undirectedSelfLoops:0)},r.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new P('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var r=0,i=0;return"directed"!==this.type&&(t&&(i=n.undirectedSelfLoops),r+=n.undirectedDegree+2*i),"undirected"!==this.type&&(t&&(i=n.directedSelfLoops),r+=n.inDegree+n.outDegree+2*i),r},r.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},r.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},r.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},r.opposite=function(e,t){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new C('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(e!==r&&e!==i)throw new C('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(i,")."));return e===r?i:r},r.hasExtremity=function(e,t){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new C('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return n.source.key===t||n.target.key===t},r.isUndirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},r.isDirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},r.isSelfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},r.hasGeneratedKey=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.hasGeneratedKey: could not find the "'.concat(e,'" edge in the graph.'));return t.generatedKey},r.addNode=function(e,t){return function(e,t,n){if(n&&!f(n))throw new P('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},e._nodes.has(t=""+t))throw new F('Graph.addNode: the "'.concat(t,'" node already exist in the graph.'));var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}(this,e,t).key},r.mergeNode=function(e,t){if(t&&!f(t))throw new P('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var n=this._nodes.get(e=""+e);return n?(t&&(s(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},r.updateNode=function(e,t){if(t&&"function"!=typeof t)throw new P('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));var n=this._nodes.get(e=""+e);if(n)return t&&(n.attributes=t(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})),e;var r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:r}),e},r.dropNode=function(e){var t=this,n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));this.forEachEdge(e,function(e){t.dropEdge(e)}),this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},r.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=c(this,n,r,this.type)))throw new C('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new C('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t.source,a=t.target,o=t.attributes,u=t.undirected;return i===a?u?(i.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(i.directedSelfLoops--,this._directedSelfLoopCount--):u?(i.undirectedDegree--,a.undirectedDegree--):(i.outDegree--,a.inDegree--),q(this,u,t),u?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:o,source:i.key,target:a.key,undirected:u}),this},r.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},r.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},r.getAttribute=function(e){return this._attributes[e]},r.getAttributes=function(){return this._attributes},r.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},r.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.updateAttribute=function(e,t){if("function"!=typeof t)throw new P("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},r.replaceAttributes=function(e){if(!f(e))throw new P("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},r.mergeAttributes=function(e){if(!f(e))throw new P("Graph.mergeAttributes: provided attributes are not a plain object.");return s(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},r.getNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},r.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new C('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},r.hasNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},r.setNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new C('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new P("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:r.attributes,name:t}),this},r.updateNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new C('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new P("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new P("Graph.updateAttribute: updater should be a function.");var i=r.attributes,a=n(i[t]);return i[t]=a,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:r.attributes,name:t}),this},r.removeNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",attributes:n.attributes,name:t}),this},r.replaceNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!f(t))throw new P("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",attributes:n.attributes}),this},r.mergeNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new C('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!f(t))throw new P("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return s(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",attributes:n.attributes,data:t}),this},r.updateEachNodeAttributes=function(e,t){if("function"!=typeof e)throw new P("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!v(t))throw new P("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._nodes.values();!0!==(n=i.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},r.updateEachEdgeAttributes=function(e,t){if("function"!=typeof e)throw new P("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!v(t))throw new P("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._edges.values();!0!==(n=i.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},r.forEach=function(e){if("function"!=typeof e)throw new P("Graph.forEach: expecting a callback.");this.multi?Oe(!1,this,e):Ae(!1,this,e)},r.forEachUntil=function(e){if("function"!=typeof e)throw new P("Graph.forEach: expecting a callback.");this.multi?Oe(!0,this,e):Ae(!0,this,e)},r.adjacency=function(){return this.multi?(h=(s=this)._nodes.values(),p=s.type,v="outer",g=null,new L(function e(){var t;if("outer"===v)return!0===(t=h.next()).done?t:(c=t.value,v="directed",e());if("directed"===v)return"undirected"===p?(v="undirected",e()):(f=c.out,l=Object.keys(c.out),d=0,v="inner-directed",e());if("undirected"===v){if("directed"===p)return v="outer",e();f=c.undirected,l=Object.keys(c.undirected),d=0,v="inner-undirected"}if(!g&&d>=l.length)return v="inner-undirected"===v?"outer":"undirected",e();if(!g){var n=l[d++];return g=f[n].values(),e()}if((t=g.next()).done)return g=null,e();var r=t.value,i=r.target;return"inner-undirected"===v&&i.key===c.key&&(i=r.source),{done:!1,value:[c.key,i.key,c.attributes,i.attributes,r.key,r.attributes]}})):(a=(e=this)._nodes.values(),o=e.type,u="outer",new L(function e(){var s;if("outer"===u)return!0===(s=a.next()).done?s:(t=s.value,u="directed",e());if("directed"===u)return"undirected"===o?(u="undirected",e()):(r=t.out,n=Object.keys(t.out),i=0,u="inner-directed",e());if("undirected"===u){if("directed"===o)return u="outer",e();r=t.undirected,n=Object.keys(t.undirected),i=0,u="inner-undirected"}if(i>=n.length)return u="inner-undirected"===u?"outer":"undirected",e();var c=n[i++],l=r[c],f=l.target;return"inner-undirected"===u&&f.key===t.key&&(f=l.source),{done:!1,value:[t.key,f.key,t.attributes,f.attributes,l.key,l.attributes]}}));var e,t,n,r,i,a,o,u,s,c,l,f,d,h,p,v,g},r.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):M(this._nodes.keys(),this._nodes.size)},r.forEachNode=function(e){if("function"!=typeof e)throw new P("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,n){e(n,t.attributes)})},r.forEachNodeUntil=function(e){if("function"!=typeof e)throw new P("Graph.forEachNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next())&&!e((n=t.value).key,n.attributes););},r.nodeEntries=function(){var e=this._nodes.values();return new L(function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}})},r.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new C('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return Le(e,t)},r.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new C('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return Me(e,t)},r.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(n,r){e[t++]=Le(r,n)});var n=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,r){n[t++]=Me(r,e)}),{attributes:this.getAttributes(),nodes:e,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},r.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=De(e);if(n){if("not-object"===n)throw new P('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new P("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new P("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,a=void 0===i?{}:i;return t?this.mergeNode(r,a):this.addNode(r,a),this},r.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Pe(e);if(n){if("not-object"===n)throw new P('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new P("Graph.importEdge: missing souce.");if("no-target"===n)throw new P("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new P("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new P("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,a=e.attributes,o=void 0===a?{}:a,u=e.undirected,s=void 0!==u&&u;return"key"in e?(t?s?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:s?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,o):(t?s?this.mergeUndirectedEdge:this.mergeDirectedEdge:s?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,o),this},r.import=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),i),this;if(!f(e))throw new P("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!f(e.attributes))throw new P("Graph.import: invalid attributes. Expecting a plain object.");i?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}if(e.nodes){if(r=e.nodes,!Array.isArray(r))throw new P("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=r.length;tn)){var o=new Set;o.add(t.undirected[a]),t.undirected[a]=o,e._nodes.get(a).undirected[n]=o}})),this;var e},r.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},r.toJSON=function(){return this.export()},r.toString=function(){return"[object Graph]"},r.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,n){t[n]=e.attributes});var n={},r={};this._edges.forEach(function(t,i){var a=t.undirected?"--":"->",o="",u="(".concat(t.source.key,")").concat(a,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[u]?r[u]=0:r[u]++,o+="".concat(r[u],". ")):o+="[".concat(i,"]: "),n[o+=u]=t.attributes});var i={};for(var a in this)this.hasOwnProperty(a)&&!Fe.has(a)&&"function"!=typeof this[a]&&(i[a]=this[a]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,h(i,"constructor",this.constructor),i},n}(y.exports.EventEmitter);"undefined"!=typeof Symbol&&(qe.prototype[Symbol.for("nodejs.util.inspect.custom")]=qe.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge","update"].forEach(function(t){var n=e.name(t),r="add"===t?Ue:Ve;qe.prototype[n]=e.generateKey?function(i,a,o){return r(this,n,!0,"undirected"===(e.type||this.type),null,i,a,o,"update"===t)}:function(i,a,o,u){return r(this,n,!1,"undirected"===(e.type||this.type),i,a,o,u,"update"===t)}})}),"undefined"!=typeof Symbol&&(qe.prototype[Symbol.iterator]=qe.prototype.adjacency),ze=qe,K.forEach(function(e){var t=e.name,n=e.attacher;n(ze,t("Edge"),"mixed"),n(ze,t("DirectedEdge"),"directed"),n(ze,t("UndirectedEdge"),"undirected")}),function(e){J.forEach(function(t){var n,r,i,a;i=(n=t).type,a=n.direction,e.prototype[r=n.name]=function(e,t){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];if(!arguments.length)return ce(this,i);if(1===arguments.length){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return he(this.multi,"mixed"===i?this.type:i,a,n)}if(2===arguments.length){t=""+t;var o=this._nodes.get(e=""+e);if(!o)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(r,': could not find the "').concat(t,'" target node in the graph.'));return ye(i,this.multi,a,o,t)}throw new P("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,r=t.type,i=t.direction,a="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return le(this,r,n=e);if(2===arguments.length){n=t;var o=this._nodes.get(e=""+e);if(void 0===o)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return pe(this.multi,"mixed"===r?this.type:r,i,o,n)}if(3===arguments.length){t=""+t;var u=this._nodes.get(e=""+e);if(!u)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return be(r,this.multi,i,u,t,n)}throw new P("Graph.".concat(a,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,a="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[a]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return fe(this,r,n=e);if(2===arguments.length){n=t;var o=this._nodes.get(e=""+e);if(void 0===o)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return ve(this.multi,"mixed"===r?this.type:r,i,o,n)}if(3===arguments.length){t=""+t;var u=this._nodes.get(e=""+e);if(!u)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return me(r,this.multi,i,u,t,n)}throw new P("Graph.".concat(a,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return L.empty();if(!arguments.length)return de(this,n);if(1===arguments.length){var a=this._nodes.get(e=""+e);if(!a)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return ge(n,r,a)}if(2===arguments.length){t=""+t;var o=this._nodes.get(e=""+e);if(!o)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new C("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return _e(n,r,o,t)}throw new P("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(qe),function(e){we.forEach(function(t){var n,r,i,a;i=(n=t).type,a=n.direction,e.prototype[r=n.name]=function(e){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(t))throw new C("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(n))throw new C("Graph.".concat(r,': could not find the "').concat(n,'" node in the graph.'));return Re(this,i,a,t,n)}if(1===arguments.length){var o=this._nodes.get(e=""+e);if(void 0===o)throw new C("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return ke("mixed"===i?this.type:i,a,o)}throw new P("Graph.".concat(r,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,r=t.type,i=t.direction,a="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return Se(n,n.undirected,r);if("string"==typeof t)return Se(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&je(i,n,n.in,r),"in"!==t&&je(i,n,n.out,r)),"directed"!==e&&je(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,a="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[a]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new C("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return Ne(n,n.undirected,r);if("string"==typeof t)return Ne(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&Ee(i,n,n.in,r)||"in"!==t&&Ee(i,n,n.out,r))||"directed"===e||Ee(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return L.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new C("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return Te(n,n.undirected);if("string"==typeof t)return Te(n,n[t])}var r=L.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=W(r,Ie(i,n,n.in))),"in"!==t&&(r=W(r,Ie(i,n,n.out)))),"directed"!==e&&(r=W(r,Ie(i,n,n.undirected))),r}("mixed"===n?this.type:n,r,t)}}(e,t)})}(qe);var Ke=function(e){function n(t){var n=s({type:"directed"},t);if("multi"in n&&!1!==n.multi)throw new P("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new P('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(qe),He=function(e){function n(t){var n=s({type:"undirected"},t);if("multi"in n&&!1!==n.multi)throw new P("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new P('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(qe),We=function(e){function n(t){var n=s({multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return e.call(this,n)||this}return t(n,e),n}(qe),Je=function(e){function n(t){var n=s({type:"directed",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new P('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(qe),Qe=function(e){function n(t){var n=s({type:"undirected",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new P("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new P('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(qe);function Xe(e){e.from=function(t,n){var r=s({},t.options,n),i=new e(r);return i.import(t),i}}return Xe(qe),Xe(Ke),Xe(He),Xe(We),Xe(Je),Xe(Qe),qe.Graph=qe,qe.DirectedGraph=Ke,qe.UndirectedGraph=He,qe.MultiGraph=We,qe.MultiDirectedGraph=Je,qe.MultiUndirectedGraph=Qe,qe.InvalidArgumentsGraphError=P,qe.NotFoundGraphError=C,qe.UsageGraphError=F,qe}()},23815:function(e,t,n){var r;e=n.nmd(e),(function(){var i,a="Expected a function",o="__lodash_hash_undefined__",u="__lodash_placeholder__",s=32,c=128,l=1/0,f=9007199254740991,d=NaN,h=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",b="[object Date]",m="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",k="[object Number]",S="[object Object]",j="[object Promise]",N="[object RegExp]",E="[object Set]",T="[object String]",I="[object Symbol]",R="[object WeakMap]",A="[object ArrayBuffer]",O="[object DataView]",L="[object Float32Array]",M="[object Float64Array]",D="[object Int8Array]",P="[object Int16Array]",C="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",G="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,W=RegExp(K.source),J=RegExp(H.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,me=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ne="\\ufe0e\\ufe0f",Ee="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Te="["+we+"]",Ie="["+Ee+"]",Re="["+xe+"]",Ae="\\d+",Oe="["+ke+"]",Le="["+Se+"]",Me="[^"+we+Ee+Ae+ke+Se+je+"]",De="\\ud83c[\\udffb-\\udfff]",Pe="[^"+we+"]",Ce="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Be="["+je+"]",Ge="(?:"+Le+"|"+Me+")",Ue="(?:"+Be+"|"+Me+")",Ve="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ze="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Re+"|"+De+")?",Ke="["+Ne+"]?",He=Ke+qe+"(?:\\u200d(?:"+[Pe,Ce,Fe].join("|")+")"+Ke+qe+")*",We="(?:"+[Oe,Ce,Fe].join("|")+")"+He,Je="(?:"+[Pe+Re+"?",Re,Ce,Fe,Te].join("|")+")",Qe=RegExp("['\u2019]","g"),Xe=RegExp(Re,"g"),Ye=RegExp(De+"(?="+De+")|"+Je+He,"g"),Ze=RegExp([Be+"?"+Le+"+"+Ve+"(?="+[Ie,Be,"$"].join("|")+")",Ue+"+"+ze+"(?="+[Ie,Be+Ge,"$"].join("|")+")",Be+"?"+Ge+"+"+Ve,Be+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,We].join("|"),"g"),$e=RegExp("[\\u200d"+we+xe+Ne+"]"),et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,rt={};rt[L]=rt[M]=rt[D]=rt[P]=rt[C]=rt[F]=rt[B]=rt[G]=rt[U]=!0,rt[v]=rt[g]=rt[A]=rt[y]=rt[O]=rt[b]=rt[m]=rt[_]=rt[x]=rt[k]=rt[S]=rt[N]=rt[E]=rt[T]=rt[R]=!1;var it={};it[v]=it[g]=it[A]=it[O]=it[y]=it[b]=it[L]=it[M]=it[D]=it[P]=it[C]=it[x]=it[k]=it[S]=it[N]=it[E]=it[T]=it[I]=it[F]=it[B]=it[G]=it[U]=!0,it[m]=it[_]=it[R]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,ut=parseInt,st="object"==typeof global&&global&&global.Object===Object&&global,ct="object"==typeof self&&self&&self.Object===Object&&self,lt=st||ct||Function("return this")(),ft=t&&!t.nodeType&&t,dt=ft&&e&&!e.nodeType&&e,ht=dt&&dt.exports===ft,pt=ht&&st.process,vt=function(){try{return dt&&dt.require&&dt.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),gt=vt&&vt.isArrayBuffer,yt=vt&&vt.isDate,bt=vt&&vt.isMap,mt=vt&&vt.isRegExp,_t=vt&&vt.isSet,wt=vt&&vt.isTypedArray;function xt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function kt(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Zt(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function $t(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var en=zt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),tn=zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+at[e]}function rn(e){return $e.test(e)}function an(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function on(e,t){return function(n){return e(t(n))}}function un(e,t){for(var n=-1,r=e.length,i=0,a=[];++n",""":'"',"'":"'"}),hn=function e(t){var n,r=(t=null==t?lt:hn.defaults(lt.Object(),t,hn.pick(lt,tt))).Array,ie=t.Date,we=t.Error,xe=t.Function,ke=t.Math,Se=t.Object,je=t.RegExp,Ne=t.String,Ee=t.TypeError,Te=r.prototype,Ie=Se.prototype,Re=t["__core-js_shared__"],Ae=xe.prototype.toString,Oe=Ie.hasOwnProperty,Le=0,Me=(n=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=Ie.toString,Pe=Ae.call(Se),Ce=lt._,Fe=je("^"+Ae.call(Oe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ht?t.Buffer:i,Ge=t.Symbol,Ue=t.Uint8Array,Ve=Be?Be.allocUnsafe:i,ze=on(Se.getPrototypeOf,Se),qe=Se.create,Ke=Ie.propertyIsEnumerable,He=Te.splice,We=Ge?Ge.isConcatSpreadable:i,Je=Ge?Ge.iterator:i,Ye=Ge?Ge.toStringTag:i,$e=function(){try{var e=ua(Se,"defineProperty");return e({},"",{}),e}catch(Oa){}}(),at=t.clearTimeout!==lt.clearTimeout&&t.clearTimeout,st=ie&&ie.now!==lt.Date.now&&ie.now,ct=t.setTimeout!==lt.setTimeout&&t.setTimeout,ft=ke.ceil,dt=ke.floor,pt=Se.getOwnPropertySymbols,vt=Be?Be.isBuffer:i,Dt=t.isFinite,zt=Te.join,pn=on(Se.keys,Se),vn=ke.max,gn=ke.min,yn=ie.now,bn=t.parseInt,mn=ke.random,_n=Te.reverse,wn=ua(t,"DataView"),xn=ua(t,"Map"),kn=ua(t,"Promise"),Sn=ua(t,"Set"),jn=ua(t,"WeakMap"),Nn=ua(Se,"create"),En=jn&&new jn,Tn={},In=Pa(wn),Rn=Pa(xn),An=Pa(kn),On=Pa(Sn),Ln=Pa(jn),Mn=Ge?Ge.prototype:i,Dn=Mn?Mn.valueOf:i,Pn=Mn?Mn.toString:i;function Cn(e){if(eu(e)&&!zo(e)&&!(e instanceof Un)){if(e instanceof Gn)return e;if(Oe.call(e,"__wrapped__"))return Ca(e)}return new Gn(e)}var Fn=function(){function e(){}return function(t){if(!$o(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Bn(){}function Gn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ar(e,t,n,r,a,o){var u,s=1&t,c=2&t,l=4&t;if(n&&(u=a?n(e,r,a,o):n(e)),u!==i)return u;if(!$o(e))return e;var f=zo(e);if(f){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return ji(e,u)}else{var d=la(e),h=d==_||d==w;if(Wo(e))return mi(e,s);if(d==S||d==v||h&&!a){if(u=c||h?{}:da(e),!s)return c?function(e,t){return Ni(e,ca(e),t)}(e,function(e,t){return e&&Ni(t,Au(t),e)}(u,e)):function(e,t){return Ni(e,sa(e),t)}(e,tr(u,e))}else{if(!it[d])return a?e:{};u=function(e,t,n){var r=e.constructor;switch(t){case A:return _i(e);case y:case b:return new r(+e);case O:return function(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case M:case D:case P:case C:case F:case B:case G:case U:return wi(e,n);case x:return new r;case k:case T:return new r(e);case N:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new r;case I:return function(e){return Dn?Se(Dn.call(e)):{}}(e)}}(e,d,s)}}o||(o=new Hn);var p=o.get(e);if(p)return p;o.set(e,u),au(e)?e.forEach(function(r){u.add(ar(r,t,n,r,e,o))}):tu(e)&&e.forEach(function(r,i){u.set(i,ar(r,t,n,i,e,o))});var g=f?i:(l?c?ea:$i:c?Au:Ru)(e);return St(g||e,function(r,i){g&&(r=e[i=r]),Zn(u,i,ar(r,t,n,i,e,o))}),u}function or(e,t,n){var r=n.length;if(null==e)return!r;for(e=Se(e);r--;){var a=n[r],o=e[a];if(o===i&&!(a in e)||!(0,t[a])(o))return!1}return!0}function ur(e,t,n){if("function"!=typeof e)throw new Ee(a);return Ea(function(){e.apply(i,n)},t)}function sr(e,t,n,r){var i=-1,a=Tt,o=!0,u=e.length,s=[],c=t.length;if(!u)return s;n&&(t=Rt(t,Jt(n))),r?(a=It,o=!1):t.length>=200&&(a=Xt,o=!1,t=new Kn(t));e:for(;++i-1},zn.prototype.set=function(e,t){var n=this.__data__,r=$n(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(xn||zn),string:new Vn}},qn.prototype.delete=function(e){var t=aa(this,e).delete(e);return this.size-=t?1:0,t},qn.prototype.get=function(e){return aa(this,e).get(e)},qn.prototype.has=function(e){return aa(this,e).has(e)},qn.prototype.set=function(e,t){var n=aa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,o),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Hn.prototype.clear=function(){this.__data__=new zn,this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Hn.prototype.get=function(e){return this.__data__.get(e)},Hn.prototype.has=function(e){return this.__data__.has(e)},Hn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof zn){var r=n.__data__;if(!xn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(e,t),this.size=n.size,this};var cr=Ii(yr),lr=Ii(br,!0);function fr(e,t){var n=!0;return cr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function dr(e,t,n){for(var r=-1,a=e.length;++r0&&n(u)?t>1?pr(u,t-1,n,r,i):At(i,u):r||(i[i.length]=u)}return i}var vr=Ri(),gr=Ri(!0);function yr(e,t){return e&&vr(e,t,Ru)}function br(e,t){return e&&gr(e,t,Ru)}function mr(e,t){return Et(t,function(t){return Xo(e[t])})}function _r(e,t){for(var n=0,r=(t=vi(t,e)).length;null!=e&&nt}function Sr(e,t){return null!=e&&Oe.call(e,t)}function jr(e,t){return null!=e&&t in Se(e)}function Nr(e,t,n){for(var a=n?It:Tt,o=e[0].length,u=e.length,s=u,c=r(u),l=1/0,f=[];s--;){var d=e[s];s&&t&&(d=Rt(d,Jt(t))),l=gn(d.length,l),c[s]=!n&&(t||o>=120&&d.length>=120)?new Kn(s&&d):i}d=e[0];var h=-1,p=c[0];e:for(;++h=u?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Dr(e,function(e,n,i){return{criteria:Rt(t,function(t){return t(e)}),index:++r,value:e}}))}function Ur(e,t,n){for(var r=-1,i=t.length,a={};++r-1;)u!==e&&He.call(u,s,1),He.call(e,s,1);return e}function zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;pa(i)?He.call(e,i,1):ui(e,i)}}return e}function qr(e,t){return e+dt(mn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=dt(t/2))&&(e+=e)}while(t);return n}function Hr(e,t){return Ta(xa(e,t,ns),e+"")}function Wr(e){return Jn(Bu(e))}function Jr(e,t){var n=Bu(e);return Aa(n,ir(t,0,n.length))}function Qr(e,t,n,r){if(!$o(e))return e;for(var a=-1,o=(t=vi(t,e)).length,u=o-1,s=e;null!=s&&++aa?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=r(a);++i>>1,o=e[a];null!==o&&!uu(o)&&(n?o<=t:o=200){var c=t?null:Ki(e);if(c)return sn(c);o=!1,i=Xt,s=new Kn}else s=t?[]:u;e:for(;++r=r?e:$r(e,t,n)}var bi=at||function(e){return lt.clearTimeout(e)};function mi(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function _i(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function wi(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function xi(e,t){if(e!==t){var n=e!==i,r=null===e,a=e==e,o=uu(e),u=t!==i,s=null===t,c=t==t,l=uu(t);if(!s&&!l&&!o&&e>t||o&&u&&c&&!s&&!l||r&&u&&c||!n&&c||!a)return 1;if(!r&&!o&&!l&&e1?n[a-1]:i,u=a>2?n[2]:i;for(o=e.length>3&&"function"==typeof o?(a--,o):i,u&&va(n[0],n[1],u)&&(o=a<3?i:o,a=1),t=Se(t);++r-1?a[o?t[u]:u]:i}}function Di(e){return Zi(function(t){var n=t.length,r=n,o=Gn.prototype.thru;for(e&&t.reverse();r--;){var u=t[r];if("function"!=typeof u)throw new Ee(a);if(o&&!s&&"wrapper"==na(u))var s=new Gn([],!0)}for(r=s?r:n;++r1&&m.reverse(),h&&fs))return!1;var l=o.get(e),f=o.get(t);if(l&&f)return l==t&&f==e;var d=-1,h=!0,p=2&n?new Kn:i;for(o.set(e,t),o.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return St(p,function(n){var r="_."+n[0];t&n[1]&&!Tt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ue):[]}(r),n)))}function Ra(e){var t=0,n=0;return function(){var r=yn(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Aa(e,t){var n=-1,r=e.length,a=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,ro(e,n)});function lo(e){var t=Cn(e);return t.__chain__=!0,t}function fo(e,t){return t(e)}var ho=Zi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,a=function(t){return rr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Un&&pa(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fo,args:[a],thisArg:i}),new Gn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(i),e})):this.thru(a)}),po=Ei(function(e,t,n){Oe.call(e,n)?++e[n]:nr(e,n,1)}),vo=Mi(Ua),go=Mi(Va);function yo(e,t){return(zo(e)?St:cr)(e,ia(t,3))}function bo(e,t){return(zo(e)?jt:lr)(e,ia(t,3))}var mo=Ei(function(e,t,n){Oe.call(e,n)?e[n].push(t):nr(e,n,[t])}),_o=Hr(function(e,t,n){var i=-1,a="function"==typeof t,o=Ko(e)?r(e.length):[];return cr(e,function(e){o[++i]=a?xt(t,e,n):Er(e,t,n)}),o}),wo=Ei(function(e,t,n){nr(e,n,t)});function xo(e,t){return(zo(e)?Rt:Dr)(e,ia(t,3))}var ko=Ei(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),So=Hr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&va(e,t[0],t[1])?t=[]:n>2&&va(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,pr(t,1),[])}),jo=st||function(){return lt.Date.now()};function No(e,t,n){return t=n?i:t,Wi(e,c,i,i,i,i,t=e&&null==t?e.length:t)}function Eo(e,t){var n;if("function"!=typeof t)throw new Ee(a);return e=hu(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var To=Hr(function(e,t,n){var r=1;if(n.length){var i=un(n,ra(To));r|=s}return Wi(e,r,t,n,i)}),Io=Hr(function(e,t,n){var r=3;if(n.length){var i=un(n,ra(Io));r|=s}return Wi(t,r,e,n,i)});function Ro(e,t,n){var r,o,u,s,c,l,f=0,d=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ee(a);function v(t){var n=r,a=o;return r=o=i,f=t,s=e.apply(a,n)}function g(e){return f=e,c=Ea(b,t),d?v(e):s}function y(e){var n=e-l;return l===i||n>=t||n<0||h&&e-f>=u}function b(){var e=jo();if(y(e))return m(e);c=Ea(b,function(e){var n=t-(e-l);return h?gn(n,u-(e-f)):n}(e))}function m(e){return c=i,p&&r?v(e):(r=o=i,s)}function _(){var e=jo(),n=y(e);if(r=arguments,o=this,l=e,n){if(c===i)return g(l);if(h)return bi(c),c=Ea(b,t),v(l)}return c===i&&(c=Ea(b,t)),s}return t=vu(t)||0,$o(n)&&(d=!!n.leading,u=(h="maxWait"in n)?vn(vu(n.maxWait)||0,t):u,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==i&&bi(c),f=0,r=l=o=c=i},_.flush=function(){return c===i?s:m(jo())},_}var Ao=Hr(function(e,t){return ur(e,1,t)}),Oo=Hr(function(e,t,n){return ur(e,vu(t)||0,n)});function Lo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(a);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Lo.Cache||qn),n}function Mo(e){if("function"!=typeof e)throw new Ee(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Lo.Cache=qn;var Do=gi(function(e,t){var n=(t=1==t.length&&zo(t[0])?Rt(t[0],Jt(ia())):Rt(pr(t,1),Jt(ia()))).length;return Hr(function(r){for(var i=-1,a=gn(r.length,n);++i=t}),Vo=Tr(function(){return arguments}())?Tr:function(e){return eu(e)&&Oe.call(e,"callee")&&!Ke.call(e,"callee")},zo=r.isArray,qo=gt?Jt(gt):function(e){return eu(e)&&xr(e)==A};function Ko(e){return null!=e&&Zo(e.length)&&!Xo(e)}function Ho(e){return eu(e)&&Ko(e)}var Wo=vt||vs,Jo=yt?Jt(yt):function(e){return eu(e)&&xr(e)==b};function Qo(e){if(!eu(e))return!1;var t=xr(e);return t==m||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ru(e)}function Xo(e){if(!$o(e))return!1;var t=xr(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Yo(e){return"number"==typeof e&&e==hu(e)}function Zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function $o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eu(e){return null!=e&&"object"==typeof e}var tu=bt?Jt(bt):function(e){return eu(e)&&la(e)==x};function nu(e){return"number"==typeof e||eu(e)&&xr(e)==k}function ru(e){if(!eu(e)||xr(e)!=S)return!1;var t=ze(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ae.call(n)==Pe}var iu=mt?Jt(mt):function(e){return eu(e)&&xr(e)==N},au=_t?Jt(_t):function(e){return eu(e)&&la(e)==E};function ou(e){return"string"==typeof e||!zo(e)&&eu(e)&&xr(e)==T}function uu(e){return"symbol"==typeof e||eu(e)&&xr(e)==I}var su=wt?Jt(wt):function(e){return eu(e)&&Zo(e.length)&&!!rt[xr(e)]},cu=Vi(Mr),lu=Vi(function(e,t){return e<=t});function fu(e){if(!e)return[];if(Ko(e))return ou(e)?ln(e):ji(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=la(e);return(t==x?an:t==E?sn:Bu)(e)}function du(e){return e?(e=vu(e))===l||e===-l?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function hu(e){var t=du(e),n=t%1;return t==t?n?t-n:t:0}function pu(e){return e?ir(hu(e),0,h):0}function vu(e){if("number"==typeof e)return e;if(uu(e))return d;if($o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Wt(e);var n=pe.test(e);return n||ge.test(e)?ut(e.slice(2),n?2:8):he.test(e)?d:+e}function gu(e){return Ni(e,Au(e))}function yu(e){return null==e?"":ai(e)}var bu=Ti(function(e,t){if(ma(t)||Ko(t))Ni(t,Ru(t),e);else for(var n in t)Oe.call(t,n)&&Zn(e,n,t[n])}),mu=Ti(function(e,t){Ni(t,Au(t),e)}),_u=Ti(function(e,t,n,r){Ni(t,Au(t),e,r)}),wu=Ti(function(e,t,n,r){Ni(t,Ru(t),e,r)}),xu=Zi(rr),ku=Hr(function(e,t){e=Se(e);var n=-1,r=t.length,a=r>2?t[2]:i;for(a&&va(t[0],t[1],a)&&(r=1);++n1),t}),Ni(e,ea(e),n),r&&(n=ar(n,7,Xi));for(var i=t.length;i--;)ui(n,t[i]);return n}),Du=Zi(function(e,t){return null==e?{}:function(e,t){return Ur(e,t,function(t,n){return Nu(e,n)})}(e,t)});function Pu(e,t){if(null==e)return{};var n=Rt(ea(e),function(e){return[e]});return t=ia(t),Ur(e,n,function(e,n){return t(e,n[0])})}var Cu=Hi(Ru),Fu=Hi(Au);function Bu(e){return null==e?[]:Qt(e,Ru(e))}var Gu=Oi(function(e,t,n){return t=t.toLowerCase(),e+(n?Uu(t):t)});function Uu(e){return Qu(yu(e).toLowerCase())}function Vu(e){return(e=yu(e))&&e.replace(be,en).replace(Xe,"")}var zu=Oi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),qu=Oi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ku=Ai("toLowerCase"),Hu=Oi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Wu=Oi(function(e,t,n){return e+(n?" ":"")+Qu(t)}),Ju=Oi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Qu=Ai("toUpperCase");function Xu(e,t,n){return e=yu(e),(t=n?i:t)===i?function(e){return et.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Yu=Hr(function(e,t){try{return xt(e,i,t)}catch(La){return Qo(La)?La:new we(La)}}),Zu=Zi(function(e,t){return St(t,function(t){t=Da(t),nr(e,t,To(e[t],e))}),e});function $u(e){return function(){return e}}var es=Di(),ts=Di(!0);function ns(e){return e}function rs(e){return Or("function"==typeof e?e:ar(e,1))}var is=Hr(function(e,t){return function(n){return Er(n,e,t)}}),as=Hr(function(e,t){return function(n){return Er(e,n,t)}});function os(e,t,n){var r=Ru(t),i=mr(t,r);null==n&&(!$o(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=mr(t,Ru(t)));var a=!($o(n)&&"chain"in n&&!n.chain),o=Xo(e);return St(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__),i=n.__actions__=ji(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,At([this.value()],arguments))})}),e}function us(){}var ss=Bi(Rt),cs=Bi(Nt),ls=Bi(Mt);function fs(e){return ga(e)?Vt(Da(e)):function(e){return function(t){return _r(t,e)}}(e)}var ds=Ui(),hs=Ui(!0);function ps(){return[]}function vs(){return!1}var gs=Fi(function(e,t){return e+t},0),ys=qi("ceil"),bs=Fi(function(e,t){return e/t},1),ms=qi("floor"),_s=Fi(function(e,t){return e*t},1),ws=qi("round"),xs=Fi(function(e,t){return e-t},0);return Cn.after=function(e,t){if("function"!=typeof t)throw new Ee(a);return e=hu(e),function(){if(--e<1)return t.apply(this,arguments)}},Cn.ary=No,Cn.assign=bu,Cn.assignIn=mu,Cn.assignInWith=_u,Cn.assignWith=wu,Cn.at=xu,Cn.before=Eo,Cn.bind=To,Cn.bindAll=Zu,Cn.bindKey=Io,Cn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return zo(e)?e:[e]},Cn.chain=lo,Cn.chunk=function(e,t,n){t=(n?va(e,t,n):t===i)?1:vn(hu(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var o=0,u=0,s=r(ft(a/t));oa?0:a+n),(r=r===i||r>a?a:hu(r))<0&&(r+=a),r=n>r?0:pu(r);n>>0)?(e=yu(e))&&("string"==typeof t||null!=t&&!iu(t))&&!(t=ai(t))&&rn(e)?yi(ln(e),0,n):e.split(t,n):[]},Cn.spread=function(e,t){if("function"!=typeof e)throw new Ee(a);return t=null==t?0:vn(hu(t),0),Hr(function(n){var r=n[t],i=yi(n,0,t);return r&&At(i,r),xt(e,this,i)})},Cn.tail=function(e){var t=null==e?0:e.length;return t?$r(e,1,t):[]},Cn.take=function(e,t,n){return e&&e.length?$r(e,0,(t=n||t===i?1:hu(t))<0?0:t):[]},Cn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?$r(e,(t=r-(t=n||t===i?1:hu(t)))<0?0:t,r):[]},Cn.takeRightWhile=function(e,t){return e&&e.length?ci(e,ia(t,3),!1,!0):[]},Cn.takeWhile=function(e,t){return e&&e.length?ci(e,ia(t,3)):[]},Cn.tap=function(e,t){return t(e),e},Cn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ee(a);return $o(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ro(e,t,{leading:r,maxWait:t,trailing:i})},Cn.thru=fo,Cn.toArray=fu,Cn.toPairs=Cu,Cn.toPairsIn=Fu,Cn.toPath=function(e){return zo(e)?Rt(e,Da):uu(e)?[e]:ji(Ma(yu(e)))},Cn.toPlainObject=gu,Cn.transform=function(e,t,n){var r=zo(e),i=r||Wo(e)||su(e);if(t=ia(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:$o(e)&&Xo(a)?Fn(ze(e)):{}}return(i?St:yr)(e,function(e,r,i){return t(n,e,r,i)}),n},Cn.unary=function(e){return No(e,1)},Cn.union=$a,Cn.unionBy=eo,Cn.unionWith=to,Cn.uniq=function(e){return e&&e.length?oi(e):[]},Cn.uniqBy=function(e,t){return e&&e.length?oi(e,ia(t,2)):[]},Cn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?oi(e,i,t):[]},Cn.unset=function(e,t){return null==e||ui(e,t)},Cn.unzip=no,Cn.unzipWith=ro,Cn.update=function(e,t,n){return null==e?e:si(e,t,pi(n))},Cn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:si(e,t,pi(n),r)},Cn.values=Bu,Cn.valuesIn=function(e){return null==e?[]:Qt(e,Au(e))},Cn.without=io,Cn.words=Xu,Cn.wrap=function(e,t){return Po(pi(t),e)},Cn.xor=ao,Cn.xorBy=oo,Cn.xorWith=uo,Cn.zip=so,Cn.zipObject=function(e,t){return di(e||[],t||[],Zn)},Cn.zipObjectDeep=function(e,t){return di(e||[],t||[],Qr)},Cn.zipWith=co,Cn.entries=Cu,Cn.entriesIn=Fu,Cn.extend=mu,Cn.extendWith=_u,os(Cn,Cn),Cn.add=gs,Cn.attempt=Yu,Cn.camelCase=Gu,Cn.capitalize=Uu,Cn.ceil=ys,Cn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=vu(n))==n?n:0),t!==i&&(t=(t=vu(t))==t?t:0),ir(vu(e),t,n)},Cn.clone=function(e){return ar(e,4)},Cn.cloneDeep=function(e){return ar(e,5)},Cn.cloneDeepWith=function(e,t){return ar(e,5,t="function"==typeof t?t:i)},Cn.cloneWith=function(e,t){return ar(e,4,t="function"==typeof t?t:i)},Cn.conformsTo=function(e,t){return null==t||or(e,t,Ru(t))},Cn.deburr=Vu,Cn.defaultTo=function(e,t){return null==e||e!=e?t:e},Cn.divide=bs,Cn.endsWith=function(e,t,n){e=yu(e),t=ai(t);var r=e.length,a=n=n===i?r:ir(hu(n),0,r);return(n-=t.length)>=0&&e.slice(n,a)==t},Cn.eq=Bo,Cn.escape=function(e){return(e=yu(e))&&J.test(e)?e.replace(H,tn):e},Cn.escapeRegExp=function(e){return(e=yu(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Cn.every=function(e,t,n){var r=zo(e)?Nt:fr;return n&&va(e,t,n)&&(t=i),r(e,ia(t,3))},Cn.find=vo,Cn.findIndex=Ua,Cn.findKey=function(e,t){return Pt(e,ia(t,3),yr)},Cn.findLast=go,Cn.findLastIndex=Va,Cn.findLastKey=function(e,t){return Pt(e,ia(t,3),br)},Cn.floor=ms,Cn.forEach=yo,Cn.forEachRight=bo,Cn.forIn=function(e,t){return null==e?e:vr(e,ia(t,3),Au)},Cn.forInRight=function(e,t){return null==e?e:gr(e,ia(t,3),Au)},Cn.forOwn=function(e,t){return e&&yr(e,ia(t,3))},Cn.forOwnRight=function(e,t){return e&&br(e,ia(t,3))},Cn.get=ju,Cn.gt=Go,Cn.gte=Uo,Cn.has=function(e,t){return null!=e&&fa(e,t,Sr)},Cn.hasIn=Nu,Cn.head=qa,Cn.identity=ns,Cn.includes=function(e,t,n,r){e=Ko(e)?e:Bu(e),n=n&&!r?hu(n):0;var i=e.length;return n<0&&(n=vn(i+n,0)),ou(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Cn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:hu(n);return i<0&&(i=vn(r+i,0)),Ft(e,t,i)},Cn.inRange=function(e,t,n){return t=du(t),n===i?(n=t,t=0):n=du(n),function(e,t,n){return e>=gn(t,n)&&e=-f&&e<=f},Cn.isSet=au,Cn.isString=ou,Cn.isSymbol=uu,Cn.isTypedArray=su,Cn.isUndefined=function(e){return e===i},Cn.isWeakMap=function(e){return eu(e)&&la(e)==R},Cn.isWeakSet=function(e){return eu(e)&&"[object WeakSet]"==xr(e)},Cn.join=function(e,t){return null==e?"":zt.call(e,t)},Cn.kebabCase=zu,Cn.last=Ja,Cn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var a=r;return n!==i&&(a=(a=hu(n))<0?vn(r+a,0):gn(a,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,a):Ct(e,Gt,a,!0)},Cn.lowerCase=qu,Cn.lowerFirst=Ku,Cn.lt=cu,Cn.lte=lu,Cn.max=function(e){return e&&e.length?dr(e,ns,kr):i},Cn.maxBy=function(e,t){return e&&e.length?dr(e,ia(t,2),kr):i},Cn.mean=function(e){return Ut(e,ns)},Cn.meanBy=function(e,t){return Ut(e,ia(t,2))},Cn.min=function(e){return e&&e.length?dr(e,ns,Mr):i},Cn.minBy=function(e,t){return e&&e.length?dr(e,ia(t,2),Mr):i},Cn.stubArray=ps,Cn.stubFalse=vs,Cn.stubObject=function(){return{}},Cn.stubString=function(){return""},Cn.stubTrue=function(){return!0},Cn.multiply=_s,Cn.nth=function(e,t){return e&&e.length?Br(e,hu(t)):i},Cn.noConflict=function(){return lt._===this&&(lt._=Ce),this},Cn.noop=us,Cn.now=jo,Cn.pad=function(e,t,n){e=yu(e);var r=(t=hu(t))?cn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(dt(i),n)+e+Gi(ft(i),n)},Cn.padEnd=function(e,t,n){e=yu(e);var r=(t=hu(t))?cn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var a=mn();return gn(e+a*(t-e+ot("1e-"+((a+"").length-1))),t)}return qr(e,t)},Cn.reduce=function(e,t,n){var r=zo(e)?Ot:qt,i=arguments.length<3;return r(e,ia(t,4),n,i,cr)},Cn.reduceRight=function(e,t,n){var r=zo(e)?Lt:qt,i=arguments.length<3;return r(e,ia(t,4),n,i,lr)},Cn.repeat=function(e,t,n){return t=(n?va(e,t,n):t===i)?1:hu(t),Kr(yu(e),t)},Cn.replace=function(){var e=arguments,t=yu(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Cn.result=function(e,t,n){var r=-1,a=(t=vi(t,e)).length;for(a||(a=1,e=i);++rf)return[];var n=h,r=gn(e,h);t=ia(t),e-=h;for(var i=Ht(r,t);++n=o)return e;var s=n-cn(r);if(s<1)return r;var c=u?yi(u,0,s).join(""):e.slice(0,s);if(a===i)return c+r;if(u&&(s+=c.length-s),iu(a)){if(e.slice(s).search(a)){var l,f=c;for(a.global||(a=je(a.source,yu(de.exec(a))+"g")),a.lastIndex=0;l=a.exec(f);)var d=l.index;c=c.slice(0,d===i?s:d)}}else if(e.indexOf(ai(a),s)!=s){var h=c.lastIndexOf(a);h>-1&&(c=c.slice(0,h))}return c+r},Cn.unescape=function(e){return(e=yu(e))&&W.test(e)?e.replace(K,dn):e},Cn.uniqueId=function(e){var t=++Le;return yu(e)+t},Cn.upperCase=Ju,Cn.upperFirst=Qu,Cn.each=yo,Cn.eachRight=bo,Cn.first=qa,os(Cn,function(){var e={};return yr(Cn,function(t,n){Oe.call(Cn.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),Cn.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Cn[e].placeholder=Cn}),St(["drop","take"],function(e,t){Un.prototype[e]=function(n){n=n===i?1:vn(hu(n),0);var r=this.__filtered__&&!t?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=gn(n,r.__takeCount__):r.__views__.push({size:gn(n,h),type:e+(r.__dir__<0?"Right":"")}),r},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),St(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ia(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),St(["head","last"],function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}}),St(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}}),Un.prototype.compact=function(){return this.filter(ns)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Hr(function(e,t){return"function"==typeof e?new Un(this):this.map(function(n){return Er(n,e,t)})}),Un.prototype.reject=function(e){return this.filter(Mo(ia(e)))},Un.prototype.slice=function(e,t){e=hu(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Un(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=hu(t))<0?n.dropRight(-t):n.take(t-e)),n)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(h)},yr(Un.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),a=Cn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);!a||(Cn.prototype[t]=function(){var t=this.__wrapped__,u=r?[1]:arguments,s=t instanceof Un,c=u[0],l=s||zo(t),f=function(e){var t=a.apply(Cn,At([e],u));return r&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(s=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=o&&!d,v=s&&!h;if(!o&&l){t=v?t:new Un(this);var g=e.apply(t,u);return g.__actions__.push({func:fo,args:[f],thisArg:i}),new Gn(g,d)}return p&&v?e.apply(this,u):(g=this.thru(f),p?r?g.value()[0]:g.value():g)})}),St(["pop","push","shift","sort","splice","unshift"],function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Cn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(zo(i)?i:[],e)}return this[n](function(n){return t.apply(zo(n)?n:[],e)})}}),yr(Un.prototype,function(e,t){var n=Cn[t];if(n){var r=n.name+"";Oe.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:t,func:n})}}),Tn[Pi(i,2).name]=[{name:"wrapper",func:i}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=ji(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ji(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ji(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=zo(e),r=t<0,i=n?e.length:0,a=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Cn.prototype.plant=function(e){for(var t,n=this;n instanceof Bn;){var r=Ca(n);r.__index__=0,r.__values__=i,t?a.__wrapped__=r:t=r;var a=r;n=n.__wrapped__}return a.__wrapped__=e,t},Cn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:fo,args:[Za],thisArg:i}),new Gn(t,this.__chain__)}return this.thru(Za)},Cn.prototype.toJSON=Cn.prototype.valueOf=Cn.prototype.value=function(){return li(this.__wrapped__,this.__actions__)},Cn.prototype.first=Cn.prototype.head,Je&&(Cn.prototype[Je]=function(){return this}),Cn}();lt._=hn,(r=(function(){return hn}).call(t,n,t,e))!==i&&(e.exports=r)}).call(this)},29369:function(e,t,n){var r=n(56284),i=n(67830);function a(){this.clear()}a.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},a.prototype.enqueue=function(e){return this.items.push(e),++this.size},a.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},a.prototype.peek=function(){if(this.size)return this.items[this.offset]},a.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.offset,r=0,i=this.items.length;n=e.length)return{done:!0};var n=e[t];return t++,{value:n,done:!1}})},a.prototype.entries=function(){var e=this.items,t=this.offset,n=0;return new r(function(){if(t>=e.length)return{done:!0};var r=e[t];return t++,{value:[n++,r],done:!1}})},"undefined"!=typeof Symbol&&(a.prototype[Symbol.iterator]=a.prototype.values),a.prototype.toString=function(){return this.toArray().join(",")},a.prototype.toJSON=function(){return this.toArray()},a.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:a,enumerable:!1}),e},"undefined"!=typeof Symbol&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.from=function(e){var t=new a;return i(e,function(e){t.enqueue(e)}),t},a.of=function(){return a.from(arguments)},e.exports=a},67830:function(e){var t="undefined"!=typeof ArrayBuffer,n="undefined"!=typeof Symbol;function r(e,r){var i,a,o,u,s;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(o=0,u=e.length;o=n?{done:!0}:{done:!1,value:e[r++]}})},t.empty=function(){var e=new t(null);return e.done=!0,e},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},86991:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(14180),t),i(n(75103),t),i(n(48965),t),i(n(32595),t),i(n(82417),t),i(n(92451),t),i(n(17735),t)},14180:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=function(){function e(t){g(this,e),this.termType="BlankNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}]),e}()},75103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;var r=n(14180),i=n(48965),a=n(32595),o=n(82417),u=n(92451),s=n(17735),c=0;t.DataFactory=function(){function e(t){g(this,e),this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||"df_".concat(c++,"_")}return b(e,[{key:"namedNode",value:function(e){return new o.NamedNode(e)}},{key:"blankNode",value:function(e){return new r.BlankNode(e||"".concat(this.blankNodePrefix).concat(this.blankNodeCounter++))}},{key:"literal",value:function(e,t){return new a.Literal(e,t)}},{key:"variable",value:function(e){return new s.Variable(e)}},{key:"defaultGraph",value:function(){return i.DefaultGraph.INSTANCE}},{key:"quad",value:function(e,t,n,r){return new u.Quad(e,t,n,r||this.defaultGraph())}},{key:"fromTerm",value:function(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(a.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}},{key:"fromQuad",value:function(e){return this.fromTerm(e)}},{key:"resetBlankNodeCounter",value:function(){this.blankNodeCounter=0}}]),e}()},48965:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;var n=function(){function e(){g(this,e),this.termType="DefaultGraph",this.value=""}return b(e,[{key:"equals",value:function(e){return!!e&&"DefaultGraph"===e.termType}}]),e}();t.DefaultGraph=n,n.INSTANCE=new n},32595:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;var r=n(82417),i=function(){function e(t,n){g(this,e),this.termType="Literal",this.value=t,"string"==typeof n?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING):n?(this.language="",this.datatype=n):(this.language="",this.datatype=e.XSD_STRING)}return b(e,[{key:"equals",value:function(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}]),e}();t.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=function(){function e(t){g(this,e),this.termType="NamedNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}]),e}()},92451:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=function(){function e(t,n,r,i){g(this,e),this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=r,this.graph=i}return b(e,[{key:"equals",value:function(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}]),e}()},17735:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=function(){function e(t){g(this,e),this.termType="Variable",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}]),e}()},31609:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedJavaScriptPrimitives=t.getSupportedRdfDatatypes=t.getTermRaw=t.toRdf=t.fromRdf=void 0;var a=n(86991),o=n(9938),u=n(66060);i(n(9938),t),i(n(88871),t),i(n(66060),t);var s=new a.DataFactory,c=new u.Translator;function l(e,t){return c.fromRdf(e,t)}c.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map(function(e){return s.namedNode(e)}),["string"]),c.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map(function(e){return s.namedNode(e)}),["boolean"]),c.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map(function(e){return s.namedNode(e)}),["number"]),c.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map(function(e){return s.namedNode(e)}),["number"]),c.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map(function(e){return s.namedNode(e)}),["object"]),t.fromRdf=l,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=s),c.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?l(e,t):e.value},t.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66060:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=function(){function e(){g(this,e),this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}return b(e,[{key:"registerHandler",value:function(e,t,n){var r,i=m(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;this.supportedRdfDatatypes.push(a),this.fromRdfHandlers[a.value]=e}}catch(l){i.e(l)}finally{i.f()}var o,u=m(n);try{for(u.s();!(o=u.n()).done;){var s=o.value,c=this.toRdfHandlers[s];c||(this.toRdfHandlers[s]=c=[]),c.push(e)}}catch(l){u.e(l)}finally{u.f()}}},{key:"fromRdf",value:function(e,t){var n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}},{key:"toRdf",value:function(e,t){var n=this.toRdfHandlers[typeof e];if(n){var r,i=m(n);try{for(i.s();!(r=i.n()).done;){var a=r.value.toRdf(e,t);if(a)return a}}catch(o){i.e(o)}finally{i.f()}}throw new Error("Invalid JavaScript value: '".concat(e,"'"))}},{key:"getSupportedRdfDatatypes",value:function(){return this.supportedRdfDatatypes}},{key:"getSupportedJavaScriptPrimitives",value:function(){return Object.keys(this.toRdfHandlers)}}],[{key:"incorrectRdfDataType",value:function(e){throw new Error("Invalid RDF ".concat(e.datatype.value," value: '").concat(e.value,"'"))}}]),e}()},80727:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;var r=n(66060),i=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&r.Translator.incorrectRdfDataType(e),!1}},{key:"toRdf",value:function(t,n){var r=n.datatype,i=n.dataFactory;return i.literal(t?"true":"false",r||i.namedNode(e.TYPE))}}]),e}();t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;var r=n(66060),i=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(t,n){switch(n&&!t.value.match(e.VALIDATORS[t.datatype.value.substr(33,t.datatype.value.length)])&&r.Translator.incorrectRdfDataType(t),t.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(t.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":var i=t.value.split("-");return new Date(0,parseInt(i[0],10)-1,parseInt(i[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(t.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(t.value+"-01");default:return new Date(t.value)}}},{key:"toRdf",value:function(t,n){var r=n.datatype,i=n.dataFactory;if(r=r||i.namedNode(e.TYPES[0]),!(t instanceof Date))return null;var a,o=t;switch(r.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 i.literal(a,r)}}]),e}();t.TypeHandlerDate=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}},38554:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;var r=n(66060),i=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){var n=parseFloat(e.value);return t&&isNaN(n)&&r.Translator.incorrectRdfDataType(e),n}},{key:"toRdf",value:function(t,n){var r=n.datatype,i=n.dataFactory;return r=r||i.namedNode(e.TYPES[0]),isNaN(t)?i.literal("NaN",r):isFinite(t)?t%1==0?null:i.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),r):i.literal(t>0?"INF":"-INF",r)}}]),e}();t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;var r=n(66060),i=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){var n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(e),n}},{key:"toRdf",value:function(t,n){var r=n.datatype,i=n.dataFactory;return i.literal(String(t),r||i.namedNode(t<=e.MAX_INT&&t>=e.MIN_INT?e.TYPES[0]:e.TYPES[1]))}}]),e}();t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},14608:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;var n=function(){function e(){g(this,e)}return b(e,[{key:"fromRdf",value:function(e){return e.value}},{key:"toRdf",value:function(e,t){var n=t.datatype;return t.dataFactory.literal(e,n)}}]),e}();t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(80727),t),i(n(52525),t),i(n(38554),t),i(n(37750),t),i(n(14608),t)},91052:function(e){function t(e,t,n,r,i,a,o){try{var u=e[a](o),s=u.value}catch(c){return void n(c)}u.done?t(s):Promise.resolve(s).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function u(e){t(o,i,a,u,s,"next",e)}function s(e){t(o,i,a,u,s,"throw",e)}u(void 0)})}},e.exports.default=e.exports,e.exports.__esModule=!0}},r={};function f(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,f),i.loaded=!0,i.exports}f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";var t,n,r,u,s,c;function d(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{s(r.next(e))}catch(t){a(t)}}function u(e){try{s(r.throw(e))}catch(t){a(t)}}function s(e){e.done?i(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(o,u)}s((r=r.apply(e,t||[])).next())})}function h(e){return new Promise(function(t,n){e.oncomplete=e.onsuccess=function(){return t(e.result)},e.onabort=e.onerror=function(){return n(e.error)}})}function v(){return c||(e="keyval",t=function(){return navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases?Promise.resolve():new Promise(function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()}).finally(function(){return clearInterval(e)});var e}().then(function(){var t=indexedDB.open("keyval-store");return t.onupgradeneeded=function(){return t.result.createObjectStore(e)},h(t)}),c=function(n,r){return t.then(function(t){return r(t.transaction(e,n).objectStore(e))})}),c;var e,t}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v();return t("readonly",function(t){return h(t.get(e))})}var _=f(71440);Math;var w=1/180*Math.PI,x={};function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,r=void 0===n?x.precision||4:n;return e=function(e){return Math.round(e/x.EPSILON)*x.EPSILON}(e),"".concat(parseFloat(e.toPrecision(r)))}function S(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function j(e){return function(e,t){return function(e,t,n){if(S(e)){n=n||function(e){return e.clone?e.clone():new Array(e.length)}(e);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";if(x.debug&&!function(e,t){if(e.length!==t)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=e*this.RANK,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+k(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t2*Math.PI)throw Error("radians");var d=u*Math.tan(n/2),h=d*a;return(new r).ortho({left:-h,right:h,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,r=void 0===n?45*Math.PI/180:n,i=e.aspect,a=void 0===i?1:i,o=e.near,u=void 0===o?.1:o,s=e.far,c=void 0===s?500:s;if((t=t||r)>2*Math.PI)throw Error("radians");return function(e,t,n,r,i){var a,o=1/Math.tan(t/2);e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+r)*(a=1/(r-i)),e[14]=2*i*r*a):(e[10]=-1,e[14]=-2*r)}(this,t,a,u,c),this.check()}},{key:"determinant",value:function(){return function(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],u=e[6],s=e[7],c=e[8],l=e[9],f=e[10],d=e[11],h=e[12],p=e[13],v=e[14],g=e[15];return(t*o-n*a)*(f*g-d*v)-(t*u-r*a)*(l*g-d*p)+(t*s-i*a)*(l*v-f*p)+(n*u-r*o)*(c*g-d*h)-(n*s-i*o)*(c*v-f*h)+(r*s-i*u)*(c*p-l*h)}(this)}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],a=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],a=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*r,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*r,e[7]=this[9]*i,e[8]=this[10]*a,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=u}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],l=t[8],f=t[9],d=t[10],h=t[11],p=t[12],v=t[13],g=t[14],y=t[15],b=n*u-r*o,m=n*s-i*o,_=n*c-a*o,w=r*s-i*u,x=r*c-a*u,k=i*c-a*s,S=l*v-f*p,j=l*g-d*p,N=l*y-h*p,E=f*g-d*v,T=f*y-h*v,I=d*y-h*g,R=b*I-m*T+_*E+w*N-x*j+k*S;R&&(e[0]=(u*I-s*T+c*E)*(R=1/R),e[1]=(i*T-r*I-a*E)*R,e[2]=(v*k-g*x+y*w)*R,e[3]=(d*x-f*k-h*w)*R,e[4]=(s*N-o*I-c*j)*R,e[5]=(n*I-i*N+a*j)*R,e[6]=(g*_-p*k-y*m)*R,e[7]=(l*k-d*_+h*m)*R,e[8]=(o*T-u*N+c*S)*R,e[9]=(r*N-n*T-a*S)*R,e[10]=(p*x-v*_+y*b)*R,e[11]=(f*_-l*x-h*b)*R,e[12]=(u*j-o*E-s*S)*R,e[13]=(n*E-r*j+i*S)*R,e[14]=(v*m-p*w-g*b)*R,e[15]=(l*w-f*m+d*b)*R)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return D(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return D(this,this,e),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],u=t[6],s=t[7],c=t[8],l=t[9],f=t[10],d=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*r,e[5]=o*i+l*r,e[6]=u*i+f*r,e[7]=s*i+d*r,e[8]=c*i-a*r,e[9]=l*i-o*r,e[10]=f*i-u*r,e[11]=d*i-s*r}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],u=t[2],s=t[3],c=t[8],l=t[9],f=t[10],d=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*r,e[1]=o*i-l*r,e[2]=u*i-f*r,e[3]=s*i-d*r,e[8]=a*r+c*i,e[9]=o*r+l*i,e[10]=u*r+f*i,e[11]=s*r+d*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],u=t[2],s=t[3],c=t[4],l=t[5],f=t[6],d=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*r,e[1]=o*i+l*r,e[2]=u*i+f*r,e[3]=s*i+d*r,e[4]=c*i-a*r,e[5]=l*i-o*r,e[6]=f*i-u*r,e[7]=d*i-s*r}(this,this,e),this.check()}},{key:"rotateXYZ",value:function(t){var n=e(t,3),r=n[0],i=n[1],a=n[2];return this.rotateX(r).rotateY(i).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return function(e,t,n,r){var i,a,o,u,s,c,l,f,d,h,p,v,g,y,b,m,_,w,x,k,S,j,N,E,T=r[0],I=r[1],R=r[2],A=Math.hypot(T,I,R);A0)return ce(e,n[0].id)},function(e,t){return t});function de(e,t){var n,r=t;switch(r.translation_units){case"centimeter":n=.01;break;case"millimeter":n=.001;break;case"meter":default:n=1}var i=[r.x_translation,r.y_translation,r.z_translation].map(function(e){return e*n}),a=[r.x_rotation,r.y_rotation,r.z_rotation].map(j),o=[r.x_scaling,r.y_scaling,r.z_scaling];return e.translate(i).rotateXYZ(a).scale(o)}var he=function(){function e(t){g(this,e),this.db=t,this.createGraph()}return b(e,[{key:"createGraph",value:function(){var e=this;this.graph=new V.DirectedGraph;var t=this.db.store;t.forSubjects(function(t){e.addNode(t.id,"SpatialObjectReference")},J.type,Z.SpatialObjectReference,null),t.forSubjects(function(t){e.addNode(t.id,"SpatialEntity")},J.type,Z.SpatialEntity,null);var n={};t.some(function(e){return n[e.subject.id]=e.object.id,!1},null,Z.spatialPlacement.source,null,null),t.some(function(t){var r=n[t.subject.id];return r&&e.addEdge(t.subject.id,r,t.object.id,"SpatialPlacement"),!1},null,Z.spatialPlacement.target,null,null)}},{key:"addNode",value:function(e,t){this.graph.mergeNode(e,{type:t})}},{key:"addEdge",value:function(e,t,n,r){this.graph.mergeDirectedEdge(t,n,{type:r,id:e})}},{key:"getTransformationMatrix",value:function(e,t){if(e===t)return new U(U.IDENTITY);if(this.graph.hasNode(e)&&this.graph.hasNode(t)){var n=this.db.store,r=new U(U.IDENTITY),i=q()(this.graph,e,t);if(i&&i.length>0){i.reverse();var a,o="",u=m(i);try{for(u.s();!(a=u.n()).done;){var s=a.value;if(o){var c=this.graph.getEdgeAttribute(s,o,"id");de(r,le(n,c))}o=s}}catch(l){u.e(l)}finally{u.f()}return r}}}}]),e}(),pe=function(){function t(e){g(this,t),this.db=e}return b(t,[{key:"getSpatialEntity",value:function(e){return ce(this.db.store,e)}},{key:"getExtractionSets",value:function(e){return oe(this.db.store,e)}},{key:"getExtractionSet",value:function(e){return ae(this.db.store,e)}},{key:"getAnatomicalStructures",value:function(e){return ue(this.db.store,e)}},{key:"getReferenceOrgans",value:function(){return se(this.db.store)}},{key:"getReferenceBody",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=Z.spatial.Male.id;break;case"Female":t=Z.spatial.Female.id;break;case"Both":default:t=Z.spatial.BothSexes.id}return this.getSpatialEntity(t)}},{key:"getReferenceOrganSets",value:function(t){var n=this,r=this.getReferenceOrgans();switch(null==t?void 0:t.sex){case"Male":r=r.filter(function(e){return"Male"===e.sex});break;case"Female":r=r.filter(function(e){return"Female"===e.sex})}return(null==t?void 0:t.debug)&&(r=r.map(function(e){return[[e],n.getAnatomicalStructures(e["@id"])]}).reduce(function(t,n){var r=e(n,2),i=r[0],a=r[1];return t.concat(a.length>0?a:i)},[])),r}},{key:"getReferenceSceneNodes",value:function(e){var t=this,n=this.getReferenceBody(e),r=p(this.getReferenceOrganSets(e).map(function(e){var r="http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of;return t.getSceneNode(e,n,{color:[255,255,255,255],opacity:r?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!r})}));return(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(Z.x("VHRightKidney").id),n,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(Z.x("VHLeftKidney").id),n,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(Z.x("VHSpleenCC1").id),n,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(Z.x("VHSpleenCC2").id),n,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(Z.x("VHSpleenCC3").id),n,{color:[0,255,0,127.5],wireframe:!0})])),r.filter(function(e){return void 0!==e})}},{key:"getReferenceOrganScene",value:function(e,t){var n,r,i=this,a=null!==(n=void 0!==(null==t?void 0:t.sex))&&void 0!==n&&n,o=this.getReferenceOrgans().filter(function(n){return n.representation_of===e&&(!a||n.sex===(null==t?void 0:t.sex))});if(o.length>0){var u=o[0],s=this.getSceneNode(u,u,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===u.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),c=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(function(e){return i.getSceneNode(e,u,{color:[255,255,255,229.5]})});return[s].concat(c).filter(function(e){return void 0!==e})}return[]}},{key:"getEntitySceneNodes",value:function(e){var t=this,n=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(function(e){return t.getSceneNode(e,n,{color:[255,255,255,229.5]})}).filter(function(e){return void 0!==e})}},{key:"getSceneNode",value:function(e,t){var n,r,i,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=null===(r=null===(n=null==e?void 0:e.object)||void 0===n?void 0:n.file_format)||void 0===r?void 0:r.startsWith("model/gltf"),s=this.db.graph.getTransformationMatrix(u&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(s){if(u)s=new U(U.IDENTITY).rotateX(j(90)).multiplyLeft(s);else{var c;switch(e.dimension_units){case"centimeter":c=.01;break;case"millimeter":c=.001;break;case"meter":default:c=1}var l=[e.x_dimension,e.y_dimension,e.z_dimension].map(function(e){return e*c/2});s.scale(l)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:u?null===(i=e.object)||void 0===i?void 0:i.file:void 0,scenegraphNode:u?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:s,tooltip:e.label},o)}}},{key:"getScene",value:function(e){return[].concat(p(this.getReferenceSceneNodes(e)),p(this.getEntitySceneNodes(e)))}}]),t}(),ve="https://entity.api.hubmapconsortium.org/entities/",ge=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),ye={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},be={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},me=function(){var t={};return Object.entries(ee).forEach(function(n){var r=e(n,2),i=r[0],a=r[1];return t[i]=a.id}),t}(),_e={BL:[me.body,me.bladder],RK:[me.body,me.kidney,me.right_kidney],LK:[me.body,me.kidney,me.left_kidney],HT:[me.body,me.heart],LI:[me.body,me.large_intestine,me.colon],SI:[me.body,me.small_instestine],LL:[me.body,me.respiratory_system,me.lung,me.left_lung],RL:[me.body,me.respiratory_system,me.lung,me.right_lung],LY:[me.body,me.lymph_node],SP:[me.body,me.spleen],TH:[me.body,me.thymus],UR:[me.body,me.ureter],LV:[me.body,me.liver],OT:[me.body]},we={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}},xe=function(){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;if(g(this,e),this.data=t,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"===this.data.entity_type){var u=this.data.descendants||[],s=(this.data.ancestors||[]).find(function(e){return"Donor"===e.entity_type});this.donor=this.getDonor(s,a);var c=this.getRuiLocation(t,this.donor);c?this.rui_location=c:this.bad=!0;var l=new Date(t.last_modified_timestamp).toLocaleDateString(),f=be[t.group_uuid]||t.group_name,d=t.created_by_user_displayname;this["@id"]=ve+t.uuid,this.label="Registered ".concat(l,", ").concat(d,", ").concat(f),this.link="".concat(a,"browse/sample/").concat(t.uuid);var h={},p=[];this.sections=p;var v=[];this.datasets=v;var y,b=m(u.filter(function(e){return"Sample"===e.entity_type}));try{for(b.s();!(y=b.n()).done;){var _=y.value,w=this.getSection(_,t,a);h[_.submission_id]=w,p.push(w),w.section_number=null!==(n=w.section_number)&&void 0!==n?n:p.length}}catch(A){b.e(A)}finally{b.f()}var x,k=m(u);try{for(k.s();!(x=k.n()).done;){var S=x.value;if("Dataset"===S.entity_type){var j=this.getDataset(S,i,a,o),N=(0,K.get)(S,["ingest_metadata","metadata","tissue_id"]);h[N]?null===(r=h[N].datasets)||void 0===r||r.push(j):v.push(j)}}}catch(A){k.e(A)}finally{k.f()}var E=null!=c?c:{},T="".concat(E.x_dimension," x ").concat(E.y_dimension," x ").concat(E.z_dimension," ").concat(E.dimension_units);this.section_count=E.slice_count||p.length;var I=parseFloat((E.slice_thickness||(E.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=I;var R=E.dimension_units||"millimeter";this.section_units=R,this.description="".concat(T,", ").concat(I," ").concat(R,", ").concat(t.specimen_type,", ").concat(this.section_count," Sections"),p.forEach(function(e,t){e.description="".concat(E.x_dimension," x ").concat(E.y_dimension," x ").concat(I," ").concat(R,", ").concat(I," ").concat(R,", ").concat(e.description),e.section_number=t+1})}else this.bad=!0}return b(e,[{key:"getSection",value:function(e,t,n){var r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":ve+e.uuid,"@type":"Sample",label:"Registered ".concat(r,", ").concat(e.created_by_user_displayname,", ").concat(be[e.group_uuid]||e.group_name),description:"".concat(t.specimen_type),link:"".concat(n,"browse/sample/").concat(e.uuid),sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}},{key:"getDataset",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0,o=new Date(e.last_modified_timestamp).toLocaleDateString(),u=be[e.group_uuid]||e.group_name,s=e.created_by_user_displayname,c=[].concat(p(e.data_types),[(0,K.get)(e,["ingest_metadata","metadata","assay_type"],"")]),l=c.join("|").toLowerCase(),f="assets/icons/ico-unknown.svg";return-1!==l.indexOf("10x")?(n="10x",f="assets/icons/ico-bulk-10x.svg"):-1!==l.indexOf("af")?(n="AF",f="assets/icons/ico-spatial-af.svg"):-1!==l.indexOf("codex")?(n="CODEX",f="assets/icons/ico-spatial-codex.svg"):-1!==l.indexOf("imc")?(n="IMC",f="assets/icons/ico-spatial-imc.svg"):-1!==l.indexOf("lc")&&-1===l.indexOf("af")?(n="LC",f="assets/icons/ico-bulk-lc.svg"):n=-1!==l.indexOf("maldi")?"MALDI":-1!==l.indexOf("pas")?"PAS":"OTHER",f=null!==(t=this.getDatasetThumbnail(e,r,a))&&void 0!==t?t:f,{"@id":ve+e.uuid,"@type":"Dataset",label:"Registered ".concat(o,", ").concat(s,", ").concat(u),description:"Data/Assay Types: ".concat(c.join(", ")),link:"".concat(i,"browse/dataset/").concat(e.uuid),technology:n,thumbnail:f}}},{key:"getDatasetThumbnail",value:function(e,t,n){if(e.thumbnail_file){var r=e.thumbnail_file;return"".concat(t,"/").concat(r.file_uuid,"/").concat(r.filename)+(n?"?token=".concat(n):"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){var i=(0,K.get)(e,"metadata.files",[]).filter(function(e){return/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)}).filter(function(e){return!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(e.rel_path)}).filter(function(e){return ge.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))}).map(function(r){return"".concat(t,"/").concat(e.uuid,"/").concat(r.rel_path)+(n?"?token=".concat(n):"")});if(i.length>0){var a=i[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(ge.has(a))return"assets/thumbnails/TMC-Vanderbilt/DR1/".concat(a)}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){var o=ye[e.hubmap_id];if(o)return"assets/thumbnails/TMC-Florida/".concat(o)}}},{key:"getDonor",value:function(e,t){var n,r=(e.description||"").toLowerCase();r.includes("female")?n="Female":r.includes("male")&&(n="Male");var i,a,o=r.match(/age ([0-9]+)/);o&&(i=(0,K.toNumber)(o[1]));var u,s=m((0,K.get)(e,"metadata.organ_donor_data",[]));try{for(s.s();!(u=s.n()).done;){var c=u.value;"Feminine gender"===c.preferred_term||"Female"===c.preferred_term?n="Female":"Masculine gender"===c.preferred_term||"Male"===c.preferred_term?n="Male":"Current chronological age"===c.preferred_term||"Age"===c.preferred_term?i=(0,K.toNumber)(c.data_value):"Body mass index"===c.preferred_term&&(a=(0,K.toNumber)(c.data_value))}}catch(h){s.e(h)}finally{s.f()}var l="";n&&i&&(l+="".concat(n,", Age ").concat(i),a&&(l+=", BMI ".concat(a.toFixed(1))));var f=new Date(e.last_modified_timestamp).toLocaleDateString(),d=be[e.group_uuid]||e.group_name;return{"@id":ve+e.uuid,"@type":"Donor",label:l,description:"Entered ".concat(f,", ").concat(e.created_by_user_displayname,", ").concat(d),link:"".concat(t,"browse/donor/").concat(e.uuid),age:i,sex:n,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}},{key:"getRuiLocation",value:function(e,t){var n,r,i=(e.ancestors||[]).find(function(e){return"Sample"===e.entity_type&&"organ"===e.specimen_type}),a=_e[null==i?void 0:i.organ]||[me.body],o=e.rui_location;if(o&&("string"==typeof o&&(o=JSON.parse(o)),o.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):o["@id"]&&(r=o)),r){r.ccf_annotations=a.concat(r.ccf_annotations||[]);var u=null!==(n=(0,K.get)(r,["placement","target"]))&&void 0!==n?n:"";u.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,K.set)(r,["placement","target"],u.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===u||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===u)&&(0,K.set)(r,["placement","target"],"Male"===t.sex?u.replace("#VH","#VHM")+"_Patch":u.replace("#VH","#VHF")+"_Patch")}return r}},{key:"getTissueBlock",value:function(){return(0,K.omit)(Object.assign({},this),["data","bad","donor"])}},{key:"toJsonLd",value:function(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}]),e}();function ke(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return d(this,void 0,void 0,regeneratorRuntime.mark(function o(){var u,s;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if("static"!==t){o.next=6;break}return o.next=3,fetch(e).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 3:u=o.sent,o.next=12;break;case 6:if("search-api"!==t){o.next=12;break}return s={"Content-type":"application/json"},r&&r.length>0&&(s.Authorization="Bearer ".concat(r)),o.next=11,fetch(e,{method:"POST",headers:s,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:{exists:{field:"rui_location"}}})}).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 11:u=o.sent;case 12:if(!u){o.next=14;break}return o.abrupt("return",function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={},u=(0,K.get)(e,"hits.hits",[]).map(function(e){return(0,K.get)(e,"_source",{})}).map(function(e){return new xe(e,n,r,i).toJsonLd()}),s=m(u);try{for(s.s();!(t=s.n()).done;){var c=t.value,l=c["@id"];o[l]?o[l].samples.push(c.samples[0]):o[l]=c}}catch(d){s.e(d)}finally{s.f()}var f=Object.values(o);return a&&(function(e){var t,n=[],r=0,i=m(e.filter(function(e){return e.samples.length>1}));try{for(i.s();!(t=i.n()).done;){for(var a=t.value,o=a.samples,u=function(e){var t=o[e]["@id"];n=n.concat(o[e].datasets);var i,a=m(o[e].sections);try{for(a.s();!(i=a.n()).done;){var u=i.value;n=n.concat(u.datasets)}}catch(d){a.e(d)}finally{a.f()}for(var s=e+1;s0&&console.log("\u26a0 ".concat(r," sections identified as blocks"))}(f),console.log(f.map(function(e){return Object.assign({"@context":we},e)}))),{"@context":we,"@graph":f}}(u,i,a,r));case 14:console.warn("Unable to load ".concat(e," as HuBMAP Data"));case 15:case"end":return o.stop()}},o)}))}function Se(e,t,n){var r,i=new Map,a=new Set;e.some(function(e){var n;return t.has(e.subject.id)&&(a.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,X.donor,null,null);var o,u=n(a),s=new Set,c=m(u);try{for(c.s();!(o=c.n()).done;){var l,f=o.value,d=m(null!==(r=i.get(f))&&void 0!==r?r:[]);try{for(d.s();!(l=d.n()).done;){var h=l.value;s.add(h)}}catch(p){d.e(p)}finally{d.f()}}}catch(p){c.e(p)}finally{c.f()}return s}function je(e,t){return function(n){return e.has(n.id)?t.add(n.id):void 0}}var Ne=(i(t={},Z.ontologyNode.label.id,"label"),i(t,Z.ontologyNode.parent.id,"parent"),i(t,Z.ontologyNode.synonymLabels.id,"synonymLabels"),t);function Ee(e,t){var n=_.DataFactory.namedNode(t),r={"@id":t,"@type":"OntologyTreeNode",id:t,parent:"",children:[],synonymLabels:[],label:""};return e.some(function(e){var t=Ne[e.predicate.id];if(t){var n="Literal"===e.object.termType?(0,H.fromRdf)(e.object):e.object.id;"synonymLabels"===t?r.synonymLabels.push(n):(0,K.set)(r,t,n)}return!1},n,null,null,null),r.children=e.getSubjects(Z.ontologyNode.children,n,null).map(function(e){return e.id}),r}var Te=(i(n={},X.label.id,"label"),i(n,X.description.id,"description"),i(n,X.link.id,"link"),n),Ie=Object.assign(Object.assign({},Te),i({},X.providerName.id,"providerName")),Re=Object.assign(Object.assign({},Te),(i(r={},X.technology.id,"technology"),i(r,X.thumbnail.id,"thumbnail"),r)),Ae=Object.assign(Object.assign({},Te),(i(u={},X.sampleType.id,"sampleType"),i(u,X.sectionNumber.id,"sectionNumber"),i(u,X.datasets.id,"datasets"),u)),Oe=Object.assign(Object.assign({},Te),(i(s={},X.sampleType.id,"sampleType"),i(s,X.sectionCount.id,"sectionCount"),i(s,X.sectionSize.id,"sectionSize"),i(s,X.sectionUnits.id,"sectionUnits"),i(s,X.donor.id,"donor"),i(s,X.spatialEntity.id,"spatialEntityId"),i(s,X.sections.id,"sections"),i(s,X.datasets.id,"datasets"),s)),Le=(0,K.memoize)(function(e,t){var n={"@id":t,"@type":"Donor"};return e.some(function(e){var t=Ie[e.predicate.id];if(t){var r="Literal"===e.object.termType?(0,H.fromRdf)(e.object):e.object.id;(0,K.set)(n,t,r)}return!1},_.DataFactory.namedNode(t),null,null,null),n},function(e,t){return t});function Me(e,t){var n={"@id":t,"@type":"Dataset"};return e.some(function(e){var t=Re[e.predicate.id];if(t){var r="Literal"===e.object.termType?(0,H.fromRdf)(e.object):e.object.id;(0,K.set)(n,t,r)}return!1},_.DataFactory.namedNode(t),null,null,null),n}var De=(0,K.memoize)(function(e,t){var n={"@id":t,"@type":"Sample",sections:[],datasets:[]};return e.some(function(t){var r=Oe[t.predicate.id];if(r){var i="Literal"===t.object.termType?(0,H.fromRdf)(t.object):t.object.id;if("sections"===r){var a=function(e,t){var n={"@id":t,"@type":"Sample",datasets:[]};return e.some(function(t){var r=Ae[t.predicate.id];if(r){var i="Literal"===t.object.termType?(0,H.fromRdf)(t.object):t.object.id;if("datasets"===r){var a=Me(e,i);n[r].push(a)}else(0,K.set)(n,r,i)}return!1},_.DataFactory.namedNode(t),null,null,null),n}(e,i);n[r].push(a)}else if("datasets"===r){var o=Me(e,i);n[r].push(o)}else"donor"===r?n[r]=Le(e,i):(0,K.set)(n,r,i)}return!1},_.DataFactory.namedNode(t),null,null,null),n},function(e,t){return t}),Pe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},Ce=Symbol("Comlink.proxy"),Fe=Symbol("Comlink.endpoint"),Be=Symbol("Comlink.releaseProxy"),Ge=Symbol("Comlink.thrown"),Ue=function(e){return"object"==typeof e&&null!==e||"function"==typeof e},Ve=new Map([["proxy",{canHandle:function(e){return Ue(e)&&e[Ce]},serialize:function(e){var t=new MessageChannel,n=t.port1,r=t.port2;return ze(e,n),[r,[r]]},deserialize:function(e){return e.start(),function(e,t){return He(e,[],void 0)}(e)}}],["throw",{canHandle:function(e){return Ue(e)&&Ge in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}}]]);function ze(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;n.addEventListener("message",function r(a){if(a&&a.data){var o,u=Object.assign({path:[]},a.data),s=u.id,c=u.type,f=u.path,d=(a.data.argumentList||[]).map(Ye);try{var h=f.slice(0,-1).reduce(function(e,t){return e[t]},t),v=f.reduce(function(e,t){return e[t]},t);switch(c){case"GET":o=v;break;case"SET":h[f.slice(-1)[0]]=Ye(a.data.value),o=!0;break;case"APPLY":o=v.apply(h,d);break;case"CONSTRUCT":o=function(e){return Object.assign(e,i({},Ce,!0))}(l(v,p(d)));break;case"ENDPOINT":var g=new MessageChannel,y=g.port1,b=g.port2;ze(t,b),o=function(e,t){return Qe.set(e,t),e}(y,[y]);break;case"RELEASE":o=void 0;break;default:return}}catch(h){o=i({value:h},Ge,0)}Promise.resolve(o).catch(function(e){return i({value:e},Ge,0)}).then(function(t){var i=e(Xe(t),2),a=i[0],o=i[1];n.postMessage(Object.assign(Object.assign({},a),{id:s}),o),"RELEASE"===c&&(n.removeEventListener("message",r),qe(n))})}}),n.start&&n.start()}function qe(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function Ke(e){if(e)throw new Error("Proxy has been released and is not useable")}function He(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=!1,a=new Proxy(r,{get:function(e,r){if(Ke(i),r===Be)return function(){return Ze(t,{type:"RELEASE",path:n.map(function(e){return e.toString()})}).then(function(){qe(t),i=!0})};if("then"===r){if(0===n.length)return{then:function(){return a}};var o=Ze(t,{type:"GET",path:n.map(function(e){return e.toString()})}).then(Ye);return o.then.bind(o)}return He(t,[].concat(p(n),[r]))},set:function(r,a,o){Ke(i);var u=e(Xe(o),2),s=u[0],c=u[1];return Ze(t,{type:"SET",path:[].concat(p(n),[a]).map(function(e){return e.toString()}),value:s},c).then(Ye)},apply:function(r,a,o){Ke(i);var u=n[n.length-1];if(u===Fe)return Ze(t,{type:"ENDPOINT"}).then(Ye);if("bind"===u)return He(t,n.slice(0,-1));var s=e(Je(o),2),c=s[0],l=s[1];return Ze(t,{type:"APPLY",path:n.map(function(e){return e.toString()}),argumentList:c},l).then(Ye)},construct:function(r,a){Ke(i);var o=e(Je(a),2),u=o[0],s=o[1];return Ze(t,{type:"CONSTRUCT",path:n.map(function(e){return e.toString()}),argumentList:u},s).then(Ye)}});return a}function We(e){return Array.prototype.concat.apply([],e)}function Je(e){var t=e.map(Xe);return[t.map(function(e){return e[0]}),We(t.map(function(e){return e[1]}))]}var Qe=new WeakMap;function Xe(t){var n,r=m(Ve);try{for(r.s();!(n=r.n()).done;){var i=e(n.value,2),a=i[0],o=i[1];if(o.canHandle(t)){var u=e(o.serialize(t),2);return[{type:"HANDLER",name:a,value:u[0]},u[1]]}}}catch(s){r.e(s)}finally{r.f()}return[{type:"RAW",value:t},Qe.get(t)||[]]}function Ye(e){switch(e.type){case"HANDLER":return Ve.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Ze(e,t,n){return new Promise(function(r){var i=new Array(4).fill(0).map(function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}).join("-");e.addEventListener("message",function t(n){!n.data||!n.data.id||n.data.id!==i||(e.removeEventListener("message",t),r(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}ze(new(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe;g(this,t),this.options=e,this.store=new _.Store(void 0,{factory:_.DataFactory}),this.graph=new he(this),this.scene=new pe(this)}return b(t,[{key:"connect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),n.next=4,this.initializing;case 4:return n.abrupt("return",this.store.size>0);case 5:case"end":return n.stop()}},n,this)}))}},{key:"cachedConnect",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,n,r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(new Date).getTime(),n="ccf-database.last_modified",r="ccf-database",e.next=5,y(n).catch(function(){});case 5:if(!((i=e.sent)&&t-new Date(+i).getTime()>36e5)){e.next=11;break}return e.next=9,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v();return t("readwrite",function(t){return e.forEach(function(e){return t.delete(e)}),h(t.transaction)})}([r,n]).catch(function(){});case 9:e.next=14;break;case 11:return e.next=13,y(r).catch(function(){});case 13:a=e.sent;case 14:if(!a){e.next=19;break}return e.next=17,this.deserialize(a);case 17:e.next=22;break;case 19:return e.next=21,this.doConnect();case 21:(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v();return t("readwrite",function(t){return e.forEach(function(e){return t.put(e[1],e[0])}),h(t.transaction)})})([[r,this.serialize()],[n,""+t]]).catch(function(){});case 22:case"end":return e.stop()}},e,this)}))}},{key:"doConnect",value:function(){var e,t;return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i,a,o,u=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(r=[],i=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],!(a=this.options.ccfOwlUrl).endsWith(".n3store.json")){n.next=8;break}return n.next=4,fetch(a).then(function(e){return e.text()}).catch(function(){return console.log("Couldn't locate serialized store.")});case 4:(o=n.sent)&&(this.store=(0,_.deserializeN3Store)(o,_.DataFactory)),n.next=9;break;case 8:(null==a?void 0:a.length)>0&&i.push(a);case 9:return this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?i.push(this.options.hubmapDataUrl):r.push(ke(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(function(e){if(e)return u.addDataSources([e])}))),r.push(this.addDataSources(i)),n.next=13,Promise.all(r);case 13:return n.next=15,this.synchronize();case 15:case"end":return n.stop()}},n,this)}))}},{key:"addDataSources",value:function(e,t){return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=null!=t?t:this.store,n.next=3,Promise.all(e.map(function(e){return d(i,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!=typeof e){t.next=20;break}if(!e.endsWith("jsonld")){t.next=6;break}return t.next=4,(0,_.addJsonLdToStore)(e,r);case 4:t.next=18;break;case 6:if(!e.endsWith("n3")){t.next=11;break}return t.next=9,(0,_.addN3ToStore)(e,r);case 9:t.next=18;break;case 11:if(!(e.endsWith("rdf")||e.endsWith("owl")||e.endsWith("xml"))){t.next=16;break}return t.next=14,(0,_.addRdfXmlToStore)(e,r);case 14:t.next=18;break;case 16:return t.next=18,(0,_.addJsonLdToStore)(e,r);case 18:t.next=22;break;case 20:return t.next=22,(0,_.addJsonLdToStore)(e,r);case 22:case"end":return t.stop()}},t)}))}));case 3:return n.abrupt("return",this);case 4:case"end":return n.stop()}},n,this)}))}},{key:"synchronize",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise(function(e){setTimeout(e,500)});case 2:return this.graph.createGraph(),e.abrupt("return",this);case 4:case"end":return e.stop()}},e,this)}))}},{key:"serialize",value:function(){return(0,_.serializeN3Store)(this.store)}},{key:"deserialize",value:function(e){return d(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.store=(0,_.deserializeN3Store)(e,_.DataFactory),this.graph=new he(this),this.scene=new pe(this),t.next=5,new Promise(function(e){setTimeout(e,10)});case 5:case"end":return t.stop()}},t,this)}))}},{key:"getIds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){var n,r,i,a,o,u=function(e){var t=new Set;return e.forSubjects(function(e){return t.add(e.id)},X.spatialEntity,null,null),t}(e);if(u.size>0&&(u=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=new Set;if(e.forSubjects(je(t,r),X.spatialEntity,null,null),!n){var i=new Set;return t.forEach(function(e){return r.has(e)?void 0:i.add(e)}),i}return r}(e,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){var s=t.sex;u=Se(e,u,function(t){return function(e,t,n){var r=new Set;return e.forSubjects(je(t,r),X.sex,X[n],null),r}(e,t,s)})}if(u.size>0&&(null===(n=t.tmc)||void 0===n?void 0:n.length)>0&&(u=Se(e,u,function(n){return function(e,t,n){var r,i=new Set,a=m(n);try{for(a.s();!(r=a.n()).done;){var o=r.value,u=_.DataFactory.literal(o);e.forSubjects(je(t,i),X.providerName,u,null)}}catch(s){a.e(s)}finally{a.f()}return i}(e,n,t.tmc)})),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(e,t,n){var r,i=new Map,a=new Set,o=new Set;e.some(function(e){return t.has(e.subject.id)&&o.add(e.object.id),!1},null,X.sections,null,null),e.some(function(e){var n;return(t.has(e.subject.id)||o.has(e.subject.id))&&(a.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,X.datasets,null,null);var u,s=n(a),c=new Set,l=m(s);try{for(l.s();!(u=l.n()).done;){var f,d=u.value,h=m(null!==(r=i.get(d))&&void 0!==r?r:[]);try{for(h.s();!(f=h.n()).done;){var p=f.value;c.add(p)}}catch(v){h.e(v)}finally{h.f()}}}catch(v){l.e(v)}finally{l.f()}return c}(e,u,function(n){return function(e,t,n){var r,i=new Set,a=m(n);try{for(a.s();!(r=a.n()).done;){var o=r.value,u=_.DataFactory.literal(o);e.forSubjects(je(t,i),X.technology,u,null)}}catch(s){a.e(s)}finally{a.f()}return i}(e,n,t.technologies)})),u.size>0&&(null===(i=t.ontologyTerms)||void 0===i?void 0:i.length)>0&&(u=function(e,t,n){var r,i=new Map,a=new Set;e.some(function(e){var n;return t.has(e.subject.id)&&(a.add(e.object.id),i.has(e.object.id)?null===(n=i.get(e.object.id))||void 0===n||n.push(e.subject.id):i.set(e.object.id,[e.subject.id])),!1},null,X.spatialEntity,null,null);var o,u=n(a),s=new Set,c=m(u);try{for(c.s();!(o=c.n()).done;){var l,f=o.value,d=m(null!==(r=i.get(f))&&void 0!==r?r:[]);try{for(d.s();!(l=d.n()).done;){var h=l.value;s.add(h)}}catch(p){d.e(p)}finally{d.f()}}}catch(p){c.e(p)}finally{c.f()}return s}(e,u,function(n){return function(e,t,n){var r,i=new Set,a=m(n);try{for(a.s();!(r=a.n()).done;){var o=r.value,u=_.DataFactory.namedNode(o);e.forSubjects(je(t,i),Z.spatialEntity.ccf_annotations,u,null)}}catch(s){a.e(s)}finally{a.f()}return i}(e,n,t.ontologyTerms)})),u.size>0&&2===(null===(a=t.ageRange)||void 0===a?void 0:a.length)&&(0,K.isFinite)(t.ageRange[0])&&(0,K.isFinite)(t.ageRange[1])){var c=Math.max.apply(Math,p(t.ageRange)),l=Math.min.apply(Math,p(t.ageRange));1===l&&110===c||(u=Se(e,u,function(t){return function(e,t,n,r){var i=new Set;return e.some(function(e){if(t.has(e.subject.id)){var a=(0,H.fromRdf)(e.object);a>=n&&a<=r&&i.add(e.subject.id)}return!1},null,X.age,null,null),i}(e,t,l,c)}))}if(u.size>0&&2===(null===(o=t.bmiRange)||void 0===o?void 0:o.length)&&(0,K.isFinite)(t.bmiRange[0])&&(0,K.isFinite)(t.bmiRange[1])){var f=Math.max.apply(Math,p(t.bmiRange)),d=Math.min.apply(Math,p(t.bmiRange));13===d&&83===f||(u=Se(e,u,function(t){return function(e,t,n,r){var i=new Set;return e.some(function(e){if(t.has(e.subject.id)){var a=(0,H.fromRdf)(e.object);a>=n&&a<=r&&i.add(e.subject.id)}return!1},null,X.bmi,null,null),i}(e,t,d,f)}))}return u}(this.store,e)}},{key:"get",value:function(e){return this.store.getQuads(_.DataFactory.namedNode(e),null,null,null)}},{key:"search",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p(this.getIds(t)).map(function(t){return e.get(t)})}},{key:"getSpatialEntities",value:function(e){var t=this;return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),p(this.getIds(e)).map(function(e){return fe(t.store,e)})}},{key:"getDatasetTechnologyNames",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t=new Set;return e.some(function(e){return t.add(e.object.value),!1},null,X.technology,null,null),Array.from(t).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getProviderNames",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t=new Set;return e.some(function(e){return t.add(e.object.value),!1},null,X.providerName,null,null),Array.from(t).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getTissueBlockResults",value:function(e){return d(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),p(this.getIds(e)).map(function(e){return De(n.store,e)})));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getAggregateResults",value:function(t){return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",function(t,n){var r=new Set;n.some(function(e){return t.has(e.subject.id)&&r.add(e.object.id),!1},null,X.donor,null,null);var i=new Set;n.some(function(e){return r.has(e.subject.id)&&i.add(e.object.id),!1},null,X.providerUUID,null,null);var a=new Set;n.forSubjects(function(e){t.has(e.id)&&a.add(e.id)},X.spatialEntity,null,null);var o=new Set;n.some(function(e){return a.has(e.subject.id)&&o.add(e.object.id),!1},null,X.sections,null,null);var u=new Set;return n.some(function(e){var t=e.subject;return(a.has(t.id)||o.has(t.id))&&u.add(e.object.id),!1},null,X.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:r.size,"Tissue Blocks":a.size,"Tissue Sections":o.size,"Tissue Datasets":u.size}).map(function(t){var n=e(t,2);return{label:n[0],count:n[1]}})}(this.getIds(t),this.store));case 1:case"end":return n.stop()}},n,this)}))}},{key:"getOntologyTermOccurences",value:function(e){return d(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var n=new Map;t.some(function(t){return e.has(t.subject.id)&&(n.has(t.object.id)?n.get(t.object.id).push(t.subject.id):n.set(t.object.id,[t.subject.id])),!1},null,X.spatialEntity,null,null);var r={};return t.some(function(e){var t,i;if(n.has(e.subject.id)){var a=null!==(i=null===(t=n.get(e.subject.id))||void 0===t?void 0:t.length)&&void 0!==i?i:0;r[e.object.id]=a+(r[e.object.id]||0)}return!1},null,Z.spatialEntity.ccf_annotations,null,null),r}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getOntologyTreeModel",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t={root:ee.body.id,nodes:{}},n=new Set;e.some(function(e){return n.add(e.subject.id),n.add(e.predicate.id),!1},null,Z.ontologyNode.parent,null,null);var r,i=m(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;t.nodes[a]=Ee(e,a)}}catch(o){i.e(o)}finally{i.f()}return t}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getReferenceOrgans",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.scene.getReferenceOrgans());case 1:case"end":return e.stop()}},e,this)}))}},{key:"getScene",value:function(e){return d(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(this.graph.createGraph(),this.scene.getScene(e)));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getReferenceOrganScene",value:function(e,t){return d(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)));case 1:case"end":return n.stop()}},n,this)}))}}]),t}()))}()}()}(); \ No newline at end of file diff --git a/404.html b/404.html index df9c48879..fdbc29f20 100644 --- a/404.html +++ b/404.html @@ -5,7 +5,7 @@ - + diff --git a/body-ui/main.js b/body-ui/main.js index 96eb60ce3..87b3941cf 100644 --- a/body-ui/main.js +++ b/body-ui/main.js @@ -1 +1 @@ -var ERe=Object.defineProperty,SRe=Object.defineProperties,xRe=Object.getOwnPropertyDescriptors,A1=Object.getOwnPropertySymbols,A7=Object.prototype.hasOwnProperty,T7=Object.prototype.propertyIsEnumerable,_r=Math.pow,M7=(kt,it,tt)=>it in kt?ERe(kt,it,{enumerable:!0,configurable:!0,writable:!0,value:tt}):kt[it]=tt,ht=(kt,it)=>{for(var tt in it||(it={}))A7.call(it,tt)&&M7(kt,tt,it[tt]);if(A1)for(var tt of A1(it))T7.call(it,tt)&&M7(kt,tt,it[tt]);return kt},Un=(kt,it)=>SRe(kt,xRe(it)),D7=(kt,it)=>{var tt={};for(var gt in kt)A7.call(kt,gt)&&it.indexOf(gt)<0&&(tt[gt]=kt[gt]);if(null!=kt&&A1)for(var gt of A1(kt))it.indexOf(gt)<0&&T7.call(kt,gt)&&(tt[gt]=kt[gt]);return tt};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(kt,it,tt)=>{var gt=tt(52).default;kt.exports=function K(Ae,he,q){function V($,b){if(!he[$]){if(!Ae[$]){if(L)return L($,!0);var O=new Error("Cannot find module '"+$+"'");throw O.code="MODULE_NOT_FOUND",O}var T=he[$]={exports:{}};Ae[$][0].call(T.exports,function(v){return V(Ae[$][1][v]||v)},T,T.exports,K,Ae,he,q)}return he[$].exports}for(var L=void 0,re=0;re0&&z[z.length-1])&&(6===Pe[0]||2===Pe[0])){Ue=0;continue}if(3===Pe[0]&&(!z||Pe[1]>z[0]&&Pe[1]0?Y-4:Y;for(U=0;U>16&255,F[Q++]=I>>8&255,F[Q++]=255&I;return 2===D&&(I=V[j.charCodeAt(U)]<<2|V[j.charCodeAt(U+1)]>>4,F[Q++]=255&I),1===D&&(I=V[j.charCodeAt(U)]<<10|V[j.charCodeAt(U+1)]<<4|V[j.charCodeAt(U+2)]>>2,F[Q++]=I>>8&255,F[Q++]=255&I),F},he.fromByteArray=function(j){for(var I,H=j.length,Y=H%3,D=[],F=16383,Q=0,E=H-Y;QE?E:Q+F));return 1===Y?D.push(q[(I=j[H-1])>>2]+q[I<<4&63]+"=="):2===Y&&D.push(q[(I=(j[H-2]<<8)+j[H-1])>>10]+q[I>>4&63]+q[I<<2&63]+"="),D.join("")};for(var q=[],V=[],L="undefined"!=typeof Uint8Array?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,b=re.length;$0)throw new Error("Invalid string. Length must be a multiple of 4");var H=j.indexOf("=");return-1===H&&(H=I),[H,H===I?0:4-H%4]}function y(j){return q[j>>18&63]+q[j>>12&63]+q[j>>6&63]+q[63&j]}function w(j,I,H){for(var D=[],F=I;F>5==6?2:D>>4==14?3:D>>3==30?4:D>>6==2?-1:-2}function T(D){var F=this.lastTotal-this.lastNeed,Q=function(D,F,Q){if(128!=(192&F[0]))return D.lastNeed=0,"\ufffd";if(D.lastNeed>1&&F.length>1){if(128!=(192&F[1]))return D.lastNeed=1,"\ufffd";if(D.lastNeed>2&&F.length>2&&128!=(192&F[2]))return D.lastNeed=2,"\ufffd"}}(this,D);return void 0!==Q?Q:this.lastNeed<=D.length?(D.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(D.copy(this.lastChar,F,0,D.length),void(this.lastNeed-=D.length))}function w(D,F){if((D.length-F)%2==0){var Q=D.toString("utf16le",F);if(Q){var E=Q.charCodeAt(Q.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],Q.slice(0,-1)}return Q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",F,D.length-1)}function M(D){var F=D&&D.length?this.write(D):"";return this.lastNeed?F+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):F}function j(D,F){var Q=(D.length-F)%3;return 0===Q?D.toString("base64",F):(this.lastNeed=3-Q,this.lastTotal=3,1===Q?this.lastChar[0]=D[D.length-1]:(this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1]),D.toString("base64",F,D.length-Q))}function I(D){var F=D&&D.length?this.write(D):"";return this.lastNeed?F+this.lastChar.toString("base64",0,3-this.lastNeed):F}function H(D){return D.toString(this.encoding)}function Y(D){return D&&D.length?this.write(D):""}he.StringDecoder=$,$.prototype.write=function(D){if(0===D.length)return"";var F,Q;if(this.lastNeed){if(void 0===(F=this.fillLast(D)))return"";Q=this.lastNeed,this.lastNeed=0}else Q=0;return Q=0?(U>0&&(D.lastNeed=U-1),U):--E=0?(U>0&&(D.lastNeed=U-2),U):--E=0?(U>0&&(2===U?U=0:D.lastNeed=U-3),U):0}(this,D,F);if(!this.lastNeed)return D.toString("utf8",F);this.lastTotal=Q;var E=D.length-(Q-this.lastNeed);return D.copy(this.lastChar,0,E),D.toString("utf8",F,E)},$.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length}},{"safe-buffer":4}],6:[function(K,Ae,he){(function(q){(function(){"use strict";var V=K("base64-js"),L=K("ieee754");he.Buffer=S,he.SlowBuffer=function(B){return+B!=B&&(B=0),S.alloc(+B)},he.INSPECT_MAX_BYTES=50;var re=2147483647;function b(B){if(B>re)throw new RangeError('The value "'+B+'" is invalid for option "size"');var R=new Uint8Array(B);return R.__proto__=S.prototype,R}function S(B,R,k){if("number"==typeof B){if("string"==typeof R)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return O(B,R,k)}function O(B,R,k){if("string"==typeof B)return function(B,R){if(("string"!=typeof R||""===R)&&(R="utf8"),!S.isEncoding(R))throw new TypeError("Unknown encoding: "+R);var k=0|D(B,R),Oe=b(k),Xe=Oe.write(B,R);return Xe!==k&&(Oe=Oe.slice(0,Xe)),Oe}(B,R);if(ArrayBuffer.isView(B))return M(B);if(null==B)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(pt(B,ArrayBuffer)||B&&pt(B.buffer,ArrayBuffer))return function(B,R,k){if(R<0||B.byteLength=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return 0|B}function D(B,R){if(S.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||pt(B,ArrayBuffer))return B.byteLength;if("string"!=typeof B)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var k=B.length,Oe=arguments.length>2&&!0===arguments[2];if(!Oe&&0===k)return 0;for(var Xe=!1;;)switch(R){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return X(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Pe(B).length;default:if(Xe)return Oe?-1:X(B).length;R=(""+R).toLowerCase(),Xe=!0}}function F(B,R,k){var Oe=!1;if((void 0===R||R<0)&&(R=0),R>this.length||((void 0===k||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(R>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return Je(this,R,k);case"utf8":case"utf-8":return ye(this,R,k);case"ascii":return nt(this,R,k);case"latin1":case"binary":return Ze(this,R,k);case"base64":return te(this,R,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,R,k);default:if(Oe)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Oe=!0}}function Q(B,R,k){var Oe=B[R];B[R]=B[k],B[k]=Oe}function E(B,R,k,Oe,Xe){if(0===B.length)return-1;if("string"==typeof k?(Oe=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),fe(k=+k)&&(k=Xe?0:B.length-1),k<0&&(k=B.length+k),k>=B.length){if(Xe)return-1;k=B.length-1}else if(k<0){if(!Xe)return-1;k=0}if("string"==typeof R&&(R=S.from(R,Oe)),S.isBuffer(R))return 0===R.length?-1:U(B,R,k,Oe,Xe);if("number"==typeof R)return R&=255,"function"==typeof Uint8Array.prototype.indexOf?Xe?Uint8Array.prototype.indexOf.call(B,R,k):Uint8Array.prototype.lastIndexOf.call(B,R,k):U(B,[R],k,Oe,Xe);throw new TypeError("val must be string, number or Buffer")}function U(B,R,k,Oe,Xe){var Gn,yt=1,It=B.length,Tn=R.length;if(void 0!==Oe&&("ucs2"===(Oe=String(Oe).toLowerCase())||"ucs-2"===Oe||"utf16le"===Oe||"utf-16le"===Oe)){if(B.length<2||R.length<2)return-1;yt=2,It/=2,Tn/=2,k/=2}function Pn(Ns,cs){return 1===yt?Ns[cs]:Ns.readUInt16BE(cs*yt)}if(Xe){var yi=-1;for(Gn=k;GnIt&&(k=It-Tn),Gn=k;Gn>=0;Gn--){for(var hi=!0,Hr=0;HrXe&&(Oe=Xe):Oe=Xe;var yt=R.length;Oe>yt/2&&(Oe=yt/2);for(var It=0;It>8,yt.push(k%256),yt.push(Oe);return yt}(R,B.length-k),B,k,Oe)}function te(B,R,k){return V.fromByteArray(0===R&&k===B.length?B:B.slice(R,k))}function ye(B,R,k){k=Math.min(B.length,k);for(var Oe=[],Xe=R;Xe239?4:yt>223?3:yt>191?2:1;if(Xe+Tn<=k)switch(Tn){case 1:yt<128&&(It=yt);break;case 2:128==(192&(Pn=B[Xe+1]))&&(hi=(31&yt)<<6|63&Pn)>127&&(It=hi);break;case 3:Gn=B[Xe+2],128==(192&(Pn=B[Xe+1]))&&128==(192&Gn)&&(hi=(15&yt)<<12|(63&Pn)<<6|63&Gn)>2047&&(hi<55296||hi>57343)&&(It=hi);break;case 4:Gn=B[Xe+2],yi=B[Xe+3],128==(192&(Pn=B[Xe+1]))&&128==(192&Gn)&&128==(192&yi)&&(hi=(15&yt)<<18|(63&Pn)<<12|(63&Gn)<<6|63&yi)>65535&&hi<1114112&&(It=hi)}null===It?(It=65533,Tn=1):It>65535&&(Oe.push((It-=65536)>>>10&1023|55296),It=56320|1023&It),Oe.push(It),Xe+=Tn}return function(B){var R=B.length;if(R<=4096)return String.fromCharCode.apply(String,B);for(var k="",Oe=0;Oek&&(R+=" ... "),""},S.prototype.compare=function(R,k,Oe,Xe,yt){if(pt(R,Uint8Array)&&(R=S.from(R,R.offset,R.byteLength)),!S.isBuffer(R))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof R);if(void 0===k&&(k=0),void 0===Oe&&(Oe=R?R.length:0),void 0===Xe&&(Xe=0),void 0===yt&&(yt=this.length),k<0||Oe>R.length||Xe<0||yt>this.length)throw new RangeError("out of range index");if(Xe>=yt&&k>=Oe)return 0;if(Xe>=yt)return-1;if(k>=Oe)return 1;if(this===R)return 0;for(var It=(yt>>>=0)-(Xe>>>=0),Tn=(Oe>>>=0)-(k>>>=0),Pn=Math.min(It,Tn),Gn=this.slice(Xe,yt),yi=R.slice(k,Oe),hi=0;hi>>=0,isFinite(Oe)?(Oe>>>=0,void 0===Xe&&(Xe="utf8")):(Xe=Oe,Oe=void 0)}var yt=this.length-k;if((void 0===Oe||Oe>yt)&&(Oe=yt),R.length>0&&(Oe<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");Xe||(Xe="utf8");for(var It=!1;;)switch(Xe){case"hex":return ie(this,R,k,Oe);case"utf8":case"utf-8":return ue(this,R,k,Oe);case"ascii":return ee(this,R,k,Oe);case"latin1":case"binary":return se(this,R,k,Oe);case"base64":return Te(this,R,k,Oe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,R,k,Oe);default:if(It)throw new TypeError("Unknown encoding: "+Xe);Xe=(""+Xe).toLowerCase(),It=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(B,R,k){var Oe="";k=Math.min(B.length,k);for(var Xe=R;XeOe)&&(k=Oe);for(var Xe="",yt=R;ytk)throw new RangeError("Trying to access beyond buffer length")}function Le(B,R,k,Oe,Xe,yt){if(!S.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(R>Xe||RB.length)throw new RangeError("Index out of range")}function Ee(B,R,k,Oe,Xe,yt){if(k+Oe>B.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Re(B,R,k,Oe,Xe){return R=+R,k>>>=0,Xe||Ee(B,0,k,4),L.write(B,R,k,Oe,23,4),k+4}function Ue(B,R,k,Oe,Xe){return R=+R,k>>>=0,Xe||Ee(B,0,k,8),L.write(B,R,k,Oe,52,8),k+8}S.prototype.slice=function(R,k){var Oe=this.length;(R=~~R)<0?(R+=Oe)<0&&(R=0):R>Oe&&(R=Oe),(k=void 0===k?Oe:~~k)<0?(k+=Oe)<0&&(k=0):k>Oe&&(k=Oe),k>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R],yt=1,It=0;++It>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R+--k],yt=1;k>0&&(yt*=256);)Xe+=this[R+--k]*yt;return Xe},S.prototype.readUInt8=function(R,k){return R>>>=0,k||je(R,1,this.length),this[R]},S.prototype.readUInt16LE=function(R,k){return R>>>=0,k||je(R,2,this.length),this[R]|this[R+1]<<8},S.prototype.readUInt16BE=function(R,k){return R>>>=0,k||je(R,2,this.length),this[R]<<8|this[R+1]},S.prototype.readUInt32LE=function(R,k){return R>>>=0,k||je(R,4,this.length),(this[R]|this[R+1]<<8|this[R+2]<<16)+16777216*this[R+3]},S.prototype.readUInt32BE=function(R,k){return R>>>=0,k||je(R,4,this.length),16777216*this[R]+(this[R+1]<<16|this[R+2]<<8|this[R+3])},S.prototype.readIntLE=function(R,k,Oe){R>>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R],yt=1,It=0;++It=(yt*=128)&&(Xe-=Math.pow(2,8*k)),Xe},S.prototype.readIntBE=function(R,k,Oe){R>>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=k,yt=1,It=this[R+--Xe];Xe>0&&(yt*=256);)It+=this[R+--Xe]*yt;return It>=(yt*=128)&&(It-=Math.pow(2,8*k)),It},S.prototype.readInt8=function(R,k){return R>>>=0,k||je(R,1,this.length),128&this[R]?-1*(255-this[R]+1):this[R]},S.prototype.readInt16LE=function(R,k){R>>>=0,k||je(R,2,this.length);var Oe=this[R]|this[R+1]<<8;return 32768&Oe?4294901760|Oe:Oe},S.prototype.readInt16BE=function(R,k){R>>>=0,k||je(R,2,this.length);var Oe=this[R+1]|this[R]<<8;return 32768&Oe?4294901760|Oe:Oe},S.prototype.readInt32LE=function(R,k){return R>>>=0,k||je(R,4,this.length),this[R]|this[R+1]<<8|this[R+2]<<16|this[R+3]<<24},S.prototype.readInt32BE=function(R,k){return R>>>=0,k||je(R,4,this.length),this[R]<<24|this[R+1]<<16|this[R+2]<<8|this[R+3]},S.prototype.readFloatLE=function(R,k){return R>>>=0,k||je(R,4,this.length),L.read(this,R,!0,23,4)},S.prototype.readFloatBE=function(R,k){return R>>>=0,k||je(R,4,this.length),L.read(this,R,!1,23,4)},S.prototype.readDoubleLE=function(R,k){return R>>>=0,k||je(R,8,this.length),L.read(this,R,!0,52,8)},S.prototype.readDoubleBE=function(R,k){return R>>>=0,k||je(R,8,this.length),L.read(this,R,!1,52,8)},S.prototype.writeUIntLE=function(R,k,Oe,Xe){R=+R,k>>>=0,Oe>>>=0,Xe||Le(this,R,k,Oe,Math.pow(2,8*Oe)-1,0);var It=1,Tn=0;for(this[k]=255&R;++Tn>>=0,Oe>>>=0,Xe||Le(this,R,k,Oe,Math.pow(2,8*Oe)-1,0);var It=Oe-1,Tn=1;for(this[k+It]=255&R;--It>=0&&(Tn*=256);)this[k+It]=R/Tn&255;return k+Oe},S.prototype.writeUInt8=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,1,255,0),this[k]=255&R,k+1},S.prototype.writeUInt16LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,65535,0),this[k]=255&R,this[k+1]=R>>>8,k+2},S.prototype.writeUInt16BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,65535,0),this[k]=R>>>8,this[k+1]=255&R,k+2},S.prototype.writeUInt32LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,4294967295,0),this[k+3]=R>>>24,this[k+2]=R>>>16,this[k+1]=R>>>8,this[k]=255&R,k+4},S.prototype.writeUInt32BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,4294967295,0),this[k]=R>>>24,this[k+1]=R>>>16,this[k+2]=R>>>8,this[k+3]=255&R,k+4},S.prototype.writeIntLE=function(R,k,Oe,Xe){if(R=+R,k>>>=0,!Xe){var yt=Math.pow(2,8*Oe-1);Le(this,R,k,Oe,yt-1,-yt)}var It=0,Tn=1,Pn=0;for(this[k]=255&R;++It>0)-Pn&255;return k+Oe},S.prototype.writeIntBE=function(R,k,Oe,Xe){if(R=+R,k>>>=0,!Xe){var yt=Math.pow(2,8*Oe-1);Le(this,R,k,Oe,yt-1,-yt)}var It=Oe-1,Tn=1,Pn=0;for(this[k+It]=255&R;--It>=0&&(Tn*=256);)R<0&&0===Pn&&0!==this[k+It+1]&&(Pn=1),this[k+It]=(R/Tn>>0)-Pn&255;return k+Oe},S.prototype.writeInt8=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,1,127,-128),R<0&&(R=255+R+1),this[k]=255&R,k+1},S.prototype.writeInt16LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,32767,-32768),this[k]=255&R,this[k+1]=R>>>8,k+2},S.prototype.writeInt16BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,32767,-32768),this[k]=R>>>8,this[k+1]=255&R,k+2},S.prototype.writeInt32LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,2147483647,-2147483648),this[k]=255&R,this[k+1]=R>>>8,this[k+2]=R>>>16,this[k+3]=R>>>24,k+4},S.prototype.writeInt32BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,2147483647,-2147483648),R<0&&(R=4294967295+R+1),this[k]=R>>>24,this[k+1]=R>>>16,this[k+2]=R>>>8,this[k+3]=255&R,k+4},S.prototype.writeFloatLE=function(R,k,Oe){return Re(this,R,k,!0,Oe)},S.prototype.writeFloatBE=function(R,k,Oe){return Re(this,R,k,!1,Oe)},S.prototype.writeDoubleLE=function(R,k,Oe){return Ue(this,R,k,!0,Oe)},S.prototype.writeDoubleBE=function(R,k,Oe){return Ue(this,R,k,!1,Oe)},S.prototype.copy=function(R,k,Oe,Xe){if(!S.isBuffer(R))throw new TypeError("argument should be a Buffer");if(Oe||(Oe=0),!Xe&&0!==Xe&&(Xe=this.length),k>=R.length&&(k=R.length),k||(k=0),Xe>0&&Xe=this.length)throw new RangeError("Index out of range");if(Xe<0)throw new RangeError("sourceEnd out of bounds");Xe>this.length&&(Xe=this.length),R.length-k=0;--It)R[It+k]=this[It+Oe];else Uint8Array.prototype.set.call(R,this.subarray(Oe,Xe),k);return yt},S.prototype.fill=function(R,k,Oe,Xe){if("string"==typeof R){if("string"==typeof k?(Xe=k,k=0,Oe=this.length):"string"==typeof Oe&&(Xe=Oe,Oe=this.length),void 0!==Xe&&"string"!=typeof Xe)throw new TypeError("encoding must be a string");if("string"==typeof Xe&&!S.isEncoding(Xe))throw new TypeError("Unknown encoding: "+Xe);if(1===R.length){var yt=R.charCodeAt(0);("utf8"===Xe&&yt<128||"latin1"===Xe)&&(R=yt)}}else"number"==typeof R&&(R&=255);if(k<0||this.length>>=0,Oe=void 0===Oe?this.length:Oe>>>0,R||(R=0),"number"==typeof R)for(It=k;It55295&&k<57344){if(!Xe){if(k>56319){(R-=3)>-1&&yt.push(239,191,189);continue}if(It+1===Oe){(R-=3)>-1&&yt.push(239,191,189);continue}Xe=k;continue}if(k<56320){(R-=3)>-1&&yt.push(239,191,189),Xe=k;continue}k=65536+(Xe-55296<<10|k-56320)}else Xe&&(R-=3)>-1&&yt.push(239,191,189);if(Xe=null,k<128){if((R-=1)<0)break;yt.push(k)}else if(k<2048){if((R-=2)<0)break;yt.push(k>>6|192,63&k|128)}else if(k<65536){if((R-=3)<0)break;yt.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((R-=4)<0)break;yt.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return yt}function Pe(B){return V.toByteArray(function(B){if((B=(B=B.split("=")[0]).trim().replace(qe,"")).length<2)return"";for(;B.length%4!=0;)B+="=";return B}(B))}function wt(B,R,k,Oe){for(var Xe=0;Xe=R.length||Xe>=B.length);++Xe)R[Xe+k]=B[Xe];return Xe}function pt(B,R){return B instanceof R||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===R.name}function fe(B){return B!=B}}).call(this)}).call(this,K("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(K,Ae,he){"use strict";Ae.exports=function q(V){return null===V||"object"!=typeof V||null!=V.toJSON?JSON.stringify(V):Array.isArray(V)?"["+V.reduce((L,re,$)=>L+(0===$?"":",")+q(void 0===re||"symbol"==typeof re?null:re),"")+"]":"{"+Object.keys(V).sort().reduce((L,re,$)=>void 0===V[re]||"symbol"==typeof V[re]?L:L+(0===L.length?"":",")+q(re)+":"+q(V[re]),"")+"}"}},{}],8:[function(K,Ae,he){"use strict";var L,q="object"==typeof Reflect?Reflect:null,V=q&&"function"==typeof q.apply?q.apply:function(U,ie,ue){return Function.prototype.apply.call(U,ie,ue)};L=q&&"function"==typeof q.ownKeys?q.ownKeys:Object.getOwnPropertySymbols?function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:function(U){return Object.getOwnPropertyNames(U)};var $=Number.isNaN||function(U){return U!=U};function b(){b.init.call(this)}Ae.exports=b,Ae.exports.once=function(E,U){return new Promise(function(ie,ue){function ee(Te){E.removeListener(U,se),ue(Te)}function se(){"function"==typeof E.removeListener&&E.removeListener("error",ee),ie([].slice.call(arguments))}Q(E,U,se,{once:!0}),"error"!==U&&function(E,U,ie){"function"==typeof E.on&&Q(E,"error",U,ie)}(E,ee,{once:!0})})},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var S=10;function O(E){if("function"!=typeof E)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function T(E){return void 0===E._maxListeners?b.defaultMaxListeners:E._maxListeners}function v(E,U,ie,ue){var ee,se,Te;if(O(ie),void 0===(se=E._events)?(se=E._events=Object.create(null),E._eventsCount=0):(void 0!==se.newListener&&(E.emit("newListener",U,ie.listener?ie.listener:ie),se=E._events),Te=se[U]),void 0===Te)Te=se[U]=ie,++E._eventsCount;else if("function"==typeof Te?Te=se[U]=ue?[ie,Te]:[Te,ie]:ue?Te.unshift(ie):Te.push(ie),(ee=T(E))>0&&Te.length>ee&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=U,me.count=Te.length,function(E){console&&console.warn&&console.warn(E)}(me)}return E}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(E,U,ie){var ue={fired:!1,wrapFn:void 0,target:E,type:U,listener:ie},ee=y.bind(ue);return ee.listener=ie,ue.wrapFn=ee,ee}function M(E,U,ie){var ue=E._events;if(void 0===ue)return[];var ee=ue[U];return void 0===ee?[]:"function"==typeof ee?ie?[ee.listener||ee]:[ee]:ie?function(E){for(var U=new Array(E.length),ie=0;ie0&&(Te=ie[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var te=se[U];if(void 0===te)return!1;if("function"==typeof te)V(te,this,ie);else{var ye=te.length,De=I(te,ye);for(ue=0;ue=0;Te--)if(ue[Te]===ie||ue[Te].listener===ie){me=ue[Te].listener,se=Te;break}if(se<0)return this;0===se?ue.shift():function(E,U){for(;U+1=0;ee--)this.removeListener(U,ie[ee]);return this},b.prototype.listeners=function(U){return M(this,U,!0)},b.prototype.rawListeners=function(U){return M(this,U,!1)},b.listenerCount=function(E,U){return"function"==typeof E.listenerCount?E.listenerCount(U):j.call(E,U)},b.prototype.listenerCount=j,b.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},{}],9:[function(K,Ae,he){he.read=function(q,V,L,re,$){var b,S,O=8*$-re-1,T=(1<>1,y=-7,w=L?$-1:0,M=L?-1:1,j=q[V+w];for(w+=M,b=j&(1<<-y)-1,j>>=-y,y+=O;y>0;b=256*b+q[V+w],w+=M,y-=8);for(S=b&(1<<-y)-1,b>>=-y,y+=re;y>0;S=256*S+q[V+w],w+=M,y-=8);if(0===b)b=1-v;else{if(b===T)return S?NaN:1/0*(j?-1:1);S+=Math.pow(2,re),b-=v}return(j?-1:1)*S*Math.pow(2,b-re)},he.write=function(q,V,L,re,$,b){var S,O,T,v=8*b-$-1,y=(1<>1,M=23===$?Math.pow(2,-24)-Math.pow(2,-77):0,j=re?0:b-1,I=re?1:-1,H=V<0||0===V&&1/V<0?1:0;for(V=Math.abs(V),isNaN(V)||V===1/0?(O=isNaN(V)?1:0,S=y):(S=Math.floor(Math.log(V)/Math.LN2),V*(T=Math.pow(2,-S))<1&&(S--,T*=2),(V+=S+w>=1?M/T:M*Math.pow(2,1-w))*T>=2&&(S++,T/=2),S+w>=y?(O=0,S=y):S+w>=1?(O=(V*T-1)*Math.pow(2,$),S+=w):(O=V*Math.pow(2,w-1)*Math.pow(2,$),S=0));$>=8;q[L+j]=255&O,j+=I,O/=256,$-=8);for(S=S<<$|O,v+=$;v>0;q[L+j]=255&S,j+=I,S/=256,v-=8);q[L+j-I]|=128*H}},{}],10:[function(K,Ae,he){Ae.exports="function"==typeof Object.create?function(V,L){L&&(V.super_=L,V.prototype=Object.create(L.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}))}:function(V,L){if(L){V.super_=L;var re=function(){};re.prototype=L.prototype,V.prototype=new re,V.prototype.constructor=V}}},{}],11:[function(K,Ae,he){"use strict";const{isArray:q,isObject:V,isString:L}=K("./types"),{asArray:re}=K("./util"),{prependBase:$}=K("./url"),b=K("./JsonLdError"),S=K("./ResolvedContext");function T(y){throw new b("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function v({context:y,base:w}){if(!y)return;const M=y["@context"];if(L(M))y["@context"]=$(w,M);else if(q(M))for(let j=0;j10)throw new b("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"loading remote context failed":"context overflow",max:10});if(I.has(M))throw new b("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"recursive context inclusion":"context overflow",url:M});let H,Y;I.add(M);try{Y=yield j(M),H=Y.document||null,L(H)&&(H=JSON.parse(H))}catch(D){throw new b("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:M,cause:D})}if(!V(H))throw new b("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:M});return H="@context"in H?{"@context":H["@context"]}:{"@context":{}},Y.contextUrl&&(q(H["@context"])||(H["@context"]=[H["@context"]]),H["@context"].push(Y.contextUrl)),{context:H,remoteDoc:Y}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(K,Ae,he){"use strict";Ae.exports=class extends Error{constructor(V="An unspecified JSON-LD error occurred.",L="jsonld.Error",re={}){super(V),this.name=L,this.message=V,this.details=re}}},{}],13:[function(K,Ae,he){"use strict";Ae.exports=q=>{class V{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(V,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(V.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:V}),V.compact=function(L,re){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):q.compact(L,re)},V.expand=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):q.expand(L)},V.flatten=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):q.flatten(L)},V}},{}],14:[function(K,Ae,he){"use strict";Ae.exports=K("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(K,Ae,he){"use strict";Ae.exports=class{constructor(){this._requests={}}wrapLoader(V){const L=this;return L._loader=V,function(){return L.add.apply(L,arguments)}}add(V){var L=this;return gt(function*(){let re=L._requests[V];if(re)return Promise.resolve(re);re=L._requests[V]=L._loader(V);try{return yield re}finally{delete L._requests[V]}})()}}},{}],16:[function(K,Ae,he){"use strict";const q=K("lru-cache");Ae.exports=class{constructor({document:re}){this.document=re,this.cache=new q({max:10})}getProcessed(re){return this.cache.get(re)}setProcessed(re,$){this.cache.set(re,$)}}},{"lru-cache":33}],17:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),{isArray:V,isObject:L,isString:re,isUndefined:$}=K("./types"),{isList:b,isValue:S,isGraph:O,isSimpleGraph:T,isSubjectReference:v}=K("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:M,process:j,processingMode:I}=K("./context"),{removeBase:H,prependBase:Y}=K("./url"),{addValue:D,asArray:F,compareShortestLeast:Q}=K("./util"),E={};function ie(ue,ee,se){if("@nest"!==y(ue,ee,{vocab:!0},se))throw new q("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ae.exports=E,E.compact=function(){var ue=gt(function*({activeCtx:ee,activeProperty:se=null,element:Te,options:me={},compactionMap:te=(()=>{})}){if(V(Te)){let De=[];for(let Ve=0;Ve1&&(Je=Array.from(Je).sort());const Ye=ee;for(const Le of Je){const Ee=E.compactIri({activeCtx:Ye,iri:Le,relativeTo:{vocab:!0}}),Re=w(nt,Ee,"@context");$(Re)||(ee=yield j({activeCtx:ee,localCtx:Re,options:me,propagate:!1}))}const je=Object.keys(Te).sort();for(const Le of je){const Ee=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&M(Le)){const Re=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Re,Ee)}else{if(!V(Ee))throw new q("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ee.length){const Re=E.compactIri({activeCtx:ee,iri:Le,value:Ee,relativeTo:{vocab:!0},reverse:De}),Ue=ee.mappings.has(Re)?ee.mappings.get(Re)["@nest"]:null;let qe=Ve;Ue&&(ie(ee,Ue,me),L(Ve[Ue])||(Ve[Ue]={}),qe=Ve[Ue]),D(qe,Re,Ee,{propertyIsArray:!0})}for(const Re of Ee){const Ue=E.compactIri({activeCtx:ee,iri:Le,value:Re,relativeTo:{vocab:!0},reverse:De}),qe=ee.mappings.has(Ue)?ee.mappings.get(Ue)["@nest"]:null;let Be=Ve;qe&&(ie(ee,qe,me),L(Ve[qe])||(Ve[qe]={}),Be=Ve[qe]);const z=w(ee,Ue,"@container")||[],X=O(Re),be=b(Re);let ce;be?ce=Re["@list"]:X&&(ce=Re["@graph"]);let Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:be||X?ce:Re,options:me,compactionMap:te});if(be){if(V(Pe)||(Pe=[Pe]),z.includes("@list")){D(Be,Ue,Pe,{valueIsArray:!0,allowDuplicate:!0});continue}Pe={[E.compactIri({activeCtx:ee,iri:"@list",relativeTo:{vocab:!0}})]:Pe},"@index"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Re["@index"])}if(X)if(z.includes("@graph")&&(z.includes("@id")||z.includes("@index")&&T(Re))){let wt;Be.hasOwnProperty(Ue)?wt=Be[Ue]:Be[Ue]=wt={};const pt=(z.includes("@id")?Re["@id"]:Re["@index"])||E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}});D(wt,pt,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})}else z.includes("@graph")&&T(Re)?(V(Pe)&&Pe.length>1&&(Pe={"@included":Pe}),D(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})):(V(Pe)&&1===Pe.length&&me.compactArrays&&(Pe=Pe[0]),Pe={[E.compactIri({activeCtx:ee,iri:"@graph",relativeTo:{vocab:!0}})]:Pe},"@id"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Re["@id"]),"@index"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Re["@index"]),D(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")}));else if(z.includes("@language")||z.includes("@index")||z.includes("@id")||z.includes("@type")){let wt,pt;if(Be.hasOwnProperty(Ue)?wt=Be[Ue]:Be[Ue]=wt={},z.includes("@language"))S(Pe)&&(Pe=Pe["@value"]),pt=Re["@language"];else if(z.includes("@index")){const fe=w(ee,Ue,"@index")||"@index",B=E.compactIri({activeCtx:ee,iri:fe,relativeTo:{vocab:!0}});if("@index"===fe)pt=Re["@index"],delete Pe[B];else{let R;if([pt,...R]=F(Pe[fe]||[]),re(pt))switch(R.length){case 0:delete Pe[fe];break;case 1:Pe[fe]=R[0];break;default:Pe[fe]=R}else pt=null}}else if(z.includes("@id")){const fe=E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}});pt=Pe[fe],delete Pe[fe]}else if(z.includes("@type")){const fe=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=F(Pe[fe]||[]),B.length){case 0:delete Pe[fe];break;case 1:Pe[fe]=B[0];break;default:Pe[fe]=B}1===Object.keys(Pe).length&&"@id"in Re&&(Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:{"@id":Re["@id"]},options:me,compactionMap:te}))}pt||(pt=E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}})),D(wt,pt,Pe,{propertyIsArray:z.includes("@set")})}else{const wt=!me.compactArrays||z.includes("@set")||z.includes("@list")||V(Pe)&&0===Pe.length||"@list"===Le||"@graph"===Le;D(Be,Ue,Pe,{propertyIsArray:wt})}}}else{if((w(ee,se,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Ue,Ee)}else{const Re=yield E.compact({activeCtx:ee,activeProperty:se,element:Ee,options:me,compactionMap:te});V(Re)&&0===Re.length||D(Ve,Le,Re)}else{const Re=yield E.compact({activeCtx:ee,activeProperty:"@reverse",element:Ee,options:me,compactionMap:te});for(const Ue in Re)if(ee.mappings.has(Ue)&&ee.mappings.get(Ue).reverse){const qe=Re[Ue],z=(w(ee,Ue,"@container")||[]).includes("@set")||!me.compactArrays;D(Ve,Ue,qe,{propertyIsArray:z}),delete Re[Ue]}if(Object.keys(Re).length>0){const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Ue,Re)}}else{let Re=F(Ee).map(X=>E.compactIri({activeCtx:nt,iri:X,relativeTo:{vocab:!0}}));1===Re.length&&(Re=Re[0]);const Ue=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}}),z=(w(ee,Ue,"@container")||[]).includes("@set")&&I(ee,1.1)||V(Re)&&0===Ee.length;D(Ve,Ue,Re,{propertyIsArray:z})}else{let Re=F(Ee).map(qe=>E.compactIri({activeCtx:ee,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Re.length&&(Re=Re[0]),Ve[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Re}}return Ve}return Te});return function(ee){return ue.apply(this,arguments)}}(),E.compactIri=({activeCtx:ue,iri:ee,value:se=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:te=null})=>{if(null===ee)return ee;ue.isPropertyTermScoped&&ue.previousContext&&(ue=ue.previousContext);const ye=ue.getInverse();if(M(ee)&&ee in ye&&"@none"in ye[ee]&&"@type"in ye[ee]["@none"]&&"@none"in ye[ee]["@none"]["@type"])return ye[ee]["@none"]["@type"]["@none"];if(Te.vocab&&ee in ye){const Je=ue["@language"]||"@none",Ye=[];L(se)&&"@index"in se&&!("@graph"in se)&&Ye.push("@index","@index@set"),L(se)&&"@preserve"in se&&(se=se["@preserve"][0]),O(se)?("@index"in se&&Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se&&Ye.push("@graph@id","@graph@id@set"),Ye.push("@graph","@graph@set","@set"),"@index"in se||Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se||Ye.push("@graph@id","@graph@id@set")):L(se)&&!S(se)&&Ye.push("@id","@id@set","@type","@set@type");let je="@language",Le="@null";if(me)je="@type",Le="@reverse",Ye.push("@set");else if(b(se)){"@index"in se||Ye.push("@list");const Re=se["@list"];if(0===Re.length)je="@any",Le="@none";else{let Ue=0===Re.length?Je:null,qe=null;for(let Be=0;Bent.includes("_"));Ve&&ye.push(Ve.replace(/^[^_]+_/,"_"))}ye.push("@none");const De=ue.inverse[ee];for(const Ve of Te){if(!(Ve in De))continue;const nt=De[Ve][me];for(const Ze of ye)if(Ze in nt)return nt[Ze]}return null}(ue,ee,se,Ye,je,Le);if(null!==Ee)return Ee}if(Te.vocab&&"@vocab"in ue){const Je=ue["@vocab"];if(0===ee.indexOf(Je)&&ee!==Je){const Ye=ee.substr(Je.length);if(!ue.mappings.has(Ye))return Ye}}let De=null;const Ve=[];let nt=ue.fastCurieMap;const Ze=ee.length-1;for(let Je=0;Je=0;--Je){const Ye=Ve[Je],je=Ye.terms;for(const Le of je){const Ee=Le+":"+ee.substr(Ye.iri.length);ue.mappings.get(Le)._prefix&&(!ue.mappings.has(Ee)||null===se&&ue.mappings.get(Ee)["@id"]===ee)&&(null===De||Q(Ee,De)<0)&&(De=Ee)}}if(null!==De)return De;for(const[Je,Ye]of ue.mappings)if(Ye&&Ye._prefix&&ee.startsWith(Je+":"))throw new q(`Absolute IRI "${ee}" confused with prefix "${Je}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ue});return Te.vocab?ee:"@base"in ue?ue["@base"]?H(Y(te,ue["@base"]),ee):ee:H(te,ee)},E.compactValue=({activeCtx:ue,activeProperty:ee,value:se,options:Te})=>{if(S(se)){const De=w(ue,ee,"@type"),Ve=w(ue,ee,"@language"),nt=w(ue,ee,"@direction"),Ze=w(ue,ee,"@container")||[],Je="@index"in se&&!Ze.includes("@index");if(!Je&&"@none"!==De&&(se["@type"]===De||"@language"in se&&se["@language"]===Ve&&"@direction"in se&&se["@direction"]===nt||"@language"in se&&se["@language"]===Ve||"@direction"in se&&se["@direction"]===nt))return se["@value"];const Ye=Object.keys(se).length,je=1===Ye||2===Ye&&"@index"in se&&!Je,Le="@language"in ue,Ee=re(se["@value"]),Re=ue.mappings.has(ee)&&null===ue.mappings.get(ee)["@language"];if(je&&"@none"!==De&&(!Le||!Ee||Re))return se["@value"];const Ue={};return Je&&(Ue[E.compactIri({activeCtx:ue,iri:"@index",relativeTo:{vocab:!0}})]=se["@index"]),"@type"in se?Ue[E.compactIri({activeCtx:ue,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ue,iri:se["@type"],relativeTo:{vocab:!0}}):"@language"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@language",relativeTo:{vocab:!0}})]=se["@language"]),"@direction"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@direction",relativeTo:{vocab:!0}})]=se["@direction"]),Ue[E.compactIri({activeCtx:ue,iri:"@value",relativeTo:{vocab:!0}})]=se["@value"],Ue}const me=y(ue,ee,{vocab:!0},Te),te=w(ue,ee,"@type"),ye=E.compactIri({activeCtx:ue,iri:se["@id"],relativeTo:{vocab:"@vocab"===te},base:Te.base});return"@id"===te||"@vocab"===te||"@graph"===me?ye:{[E.compactIri({activeCtx:ue,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(K,Ae,he){"use strict";const q="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#";Ae.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:q,RDF_LIST:q+"List",RDF_FIRST:q+"first",RDF_REST:q+"rest",RDF_NIL:q+"nil",RDF_TYPE:q+"type",RDF_PLAIN_LITERAL:q+"PlainLiteral",RDF_XML_LITERAL:q+"XMLLiteral",RDF_JSON_LITERAL:q+"JSON",RDF_OBJECT:q+"object",RDF_LANGSTRING:q+"langString",XSD:V,XSD_BOOLEAN:V+"boolean",XSD_DOUBLE:V+"double",XSD_INTEGER:V+"integer",XSD_STRING:V+"string"}},{}],19:[function(K,Ae,he){"use strict";const q=K("./util"),V=K("./JsonLdError"),{isArray:L,isObject:re,isString:$,isUndefined:b}=K("./types"),{isAbsolute:S,isRelative:O,prependBase:T}=K("./url"),{asArray:v,compareShortestLeast:y}=K("./util"),w=new Map,j=/^@[a-zA-Z]+$/,I={};function H(D,F,Q,E,U,ie){if(null===F||!$(F)||I.isKeyword(F))return F;if(F.match(j))return null;if(E&&E.hasOwnProperty(F)&&!0!==U.get(F)&&I.createTermDefinition({activeCtx:D,localCtx:E,term:F,defined:U,options:ie}),(Q=Q||{}).vocab){const ee=D.mappings.get(F);if(null===ee)return null;if(re(ee)&&"@id"in ee)return ee["@id"]}const ue=F.indexOf(":");if(ue>0){const ee=F.substr(0,ue),se=F.substr(ue+1);if("_"===ee||0===se.indexOf("//"))return F;E&&E.hasOwnProperty(ee)&&I.createTermDefinition({activeCtx:D,localCtx:E,term:ee,defined:U,options:ie});const Te=D.mappings.get(ee);if(Te&&Te._prefix)return Te["@id"]+se;if(S(F))return F}if(Q.vocab&&"@vocab"in D)return D["@vocab"]+F;if(Q.base&&"@base"in D){if(D["@base"])return T(T(ie.base,D["@base"]),F)}else if(Q.base)return T(ie.base,F);return F}function Y(D,F){if(!D||"object"!=typeof D||!F||"object"!=typeof F)return D===F;const Q=Array.isArray(D);if(Q!==Array.isArray(F))return!1;if(Q){if(D.length!==F.length)return!1;for(let ie=0;ie{if(E.has(Q)){if(E.get(Q))return;throw new V("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:F,term:Q})}let ue;if(E.set(Q,!1),F.hasOwnProperty(Q)&&(ue=F[Q]),"@type"===Q&&re(ue)&&"@set"===(ue["@container"]||"@set")&&I.processingMode(D,1.1)){const De=["@container","@id","@protected"],Ve=Object.keys(ue);if(0===Ve.length||Ve.some(nt=>!De.includes(nt)))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q})}else{if(I.isKeyword(Q))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q});if(Q.match(j))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:Q});if(""===Q)throw new V("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:F})}const ee=D.mappings.get(Q);D.mappings.has(Q)&&D.mappings.delete(Q);let se=!1;if(($(ue)||null===ue)&&(se=!0,ue={"@id":ue}),!re(ue))throw new V("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:F});const Te={};D.mappings.set(Q,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];I.processingMode(D,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const De in ue)if(!me.includes(De))throw new V("Invalid JSON-LD syntax; a term definition must not contain "+De,"jsonld.SyntaxError",{code:"invalid term definition",context:F});const te=Q.indexOf(":");if(Te._termHasColon=te>0,"@reverse"in ue){if("@id"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});if("@nest"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});const De=ue["@reverse"];if(!$(De))throw new V("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(!I.isKeyword(De)&&De.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:De}),void(ee?D.mappings.set(Q,ee):D.mappings.delete(Q));const Ve=H(D,De,{vocab:!0,base:!1},F,E,U);if(!S(Ve))throw new V("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:F});Te["@id"]=Ve,Te.reverse=!0}else if("@id"in ue){let De=ue["@id"];if(De&&!$(De))throw new V("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(null===De)Te["@id"]=null;else{if(!I.isKeyword(De)&&De.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:De}),void(ee?D.mappings.set(Q,ee):D.mappings.delete(Q));if(De!==Q){if(De=H(D,De,{vocab:!0,base:!1},F,E,U),!S(De)&&!I.isKeyword(De))throw new V("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:F});if(Q.match(/(?::[^:])|\//)&&H(D,Q,{vocab:!0,base:!1},F,new Map(E).set(Q,!0),U)!==De)throw new V("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});Te["@id"]=De,Te._prefix=se&&!Te._termHasColon&&De.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const De=Q.substr(0,te);if(F.hasOwnProperty(De)&&I.createTermDefinition({activeCtx:D,localCtx:F,term:De,defined:E,options:U}),D.mappings.has(De)){const Ve=Q.substr(te+1);Te["@id"]=D.mappings.get(De)["@id"]+Ve}else Te["@id"]=Q}else if("@type"===Q)Te["@id"]=Q;else{if(!("@vocab"in D))throw new V("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F,term:Q});Te["@id"]=D["@vocab"]+Q}if((!0===ue["@protected"]||!0===E.get("@protected")&&!1!==ue["@protected"])&&(D.protected[Q]=!0,Te.protected=!0),E.set(Q,!0),"@type"in ue){let De=ue["@type"];if(!$(De))throw new V("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if("@json"===De||"@none"===De){if(I.processingMode(D,1))throw new V(`Invalid JSON-LD syntax; an @context @type value must not be "${De}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else if("@id"!==De&&"@vocab"!==De){if(De=H(D,De,{vocab:!0,base:!1},F,E,U),!S(De))throw new V("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if(0===De.indexOf("_:"))throw new V("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}Te["@type"]=De}if("@container"in ue){const De=$(ue["@container"])?[ue["@container"]]:ue["@container"]||[],Ve=["@list","@set","@index","@language"];let nt=!0;const Ze=De.includes("@set");if(I.processingMode(D,1.1)){if(Ve.push("@graph","@id","@type"),De.includes("@list")){if(1!==De.length)throw new V("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:F})}else if(De.includes("@graph")){if(De.some(Je=>"@graph"!==Je&&"@id"!==Je&&"@index"!==Je&&"@set"!==Je))throw new V("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:F})}else nt&=De.length<=(Ze?2:1);if(De.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new V("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else nt&=!L(ue["@container"]),nt&=De.length<=1;if(nt&=De.every(Je=>Ve.includes(Je)),nt&=!(Ze&&De.includes("@list")),!nt)throw new V("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ve.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:F});if(Te.reverse&&!De.every(Je=>["@index","@set"].includes(Je)))throw new V("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});Te["@container"]=De}if("@index"in ue){if(!("@container"in ue)||!Te["@container"].includes("@index"))throw new V(`Invalid JSON-LD syntax; @index without @index in @container: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});if(!$(ue["@index"])||0===ue["@index"].indexOf("@"))throw new V(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});Te["@index"]=ue["@index"]}if("@context"in ue&&(Te["@context"]=ue["@context"]),"@language"in ue&&!("@type"in ue)){let De=ue["@language"];if(null!==De&&!$(De))throw new V("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:F});null!==De&&(De=De.toLowerCase()),Te["@language"]=De}if("@prefix"in ue){if(Q.match(/:|\//))throw new V("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:F});if(I.isKeyword(Te["@id"]))throw new V("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:F});if("boolean"!=typeof ue["@prefix"])throw new V("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:F});Te._prefix=!0===ue["@prefix"]}if("@direction"in ue){const De=ue["@direction"];if(null!==De&&"ltr"!==De&&"rtl"!==De)throw new V('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:F});Te["@direction"]=De}if("@nest"in ue){const De=ue["@nest"];if(!$(De)||"@nest"!==De&&0===De.indexOf("@"))throw new V("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:F});Te["@nest"]=De}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new V("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:F});if(ee&&ee.protected&&!ie&&(D.protected[Q]=!0,Te.protected=!0,!Y(ee,Te))){const De=U&&U.protectedMode||"error";if("error"===De)throw new V(`Invalid JSON-LD syntax; tried to redefine "${Q}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:F,term:Q});if("warn"===De)return void console.warn("WARNING: protected term redefinition",{term:Q});throw new V("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:F,term:Q,protectedMode:De})}},I.expandIri=(D,F,Q,E)=>H(D,F,Q,void 0,void 0,E),I.getInitialContext=D=>{const F=JSON.stringify({processingMode:D.processingMode}),Q=w.get(F);if(Q)return Q;const E={processingMode:D.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},te=Te.fastCurieMap={},ye={},De=(Te["@language"]||"@none").toLowerCase(),Ve=Te["@direction"],nt=Te.mappings,Ze=[...nt.keys()].sort(y);for(const Je of Ze){const Ye=nt.get(Je);if(null===Ye)continue;let je=Ye["@container"]||"@none";if(je=[].concat(je).sort().join(""),null===Ye["@id"])continue;const Le=v(Ye["@id"]);for(const Ee of Le){let Re=me[Ee];const Ue=I.isKeyword(Ee);if(Re)!Ue&&!Ye._termHasColon&&ye[Ee].push(Je);else if(me[Ee]=Re={},!Ue&&!Ye._termHasColon){ye[Ee]=[Je];const qe={iri:Ee,terms:ye[Ee]};Ee[0]in te?te[Ee[0]].push(qe):te[Ee[0]]=[qe]}if(Re[je]||(Re[je]={"@language":{},"@type":{},"@any":{}}),Re=Re[je],ue(Je,Re["@any"],"@none"),Ye.reverse)ue(Je,Re["@type"],"@reverse");else if("@none"===Ye["@type"])ue(Je,Re["@any"],"@none"),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none");else if("@type"in Ye)ue(Je,Re["@type"],Ye["@type"]);else if("@language"in Ye&&"@direction"in Ye){const qe=Ye["@language"],Be=Ye["@direction"];ue(Je,Re["@language"],qe&&Be?`${qe}_${Be}`.toLowerCase():qe?qe.toLowerCase():Be?`_${Be}`:"@null")}else"@language"in Ye?ue(Je,Re["@language"],(Ye["@language"]||"@null").toLowerCase()):"@direction"in Ye?ue(Je,Re["@language"],Ye["@direction"]?`_${Ye["@direction"]}`:"@none"):Ve?(ue(Je,Re["@language"],`_${Ve}`),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none")):(ue(Je,Re["@language"],De),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none"))}}for(const Je in te)ie(te,Je,1);return me},clone:function(){const Te={};return Te.mappings=q.clone(this.mappings),Te.clone=this.clone,Te.inverse=null,Te.getInverse=this.getInverse,Te.protected=q.clone(this.protected),this.previousContext&&(Te.previousContext=this.previousContext.clone()),Te.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Te["@base"]=this["@base"]),"@language"in this&&(Te["@language"]=this["@language"]),"@vocab"in this&&(Te["@vocab"]=this["@vocab"]),Te},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===w.size&&w.clear(),w.set(F,E),E;function ie(Te,me,te){const ye=Te[me],De=Te[me]={};let Ve,nt;for(const Ze of ye)Ve=Ze.iri,nt=te>=Ve.length?"":Ve[te],nt in De?De[nt].push(Ze):De[nt]=[Ze];for(const Ze in De)""!==Ze&&ie(De,Ze,te+1)}function ue(Te,me,te){me.hasOwnProperty(te)||(me[te]=Te)}},I.getContextValue=(D,F,Q)=>{if(null===F)return"@context"===Q?void 0:null;if(D.mappings.has(F)){const E=D.mappings.get(F);if(b(Q))return E;if(E.hasOwnProperty(Q))return E[Q]}return"@language"===Q&&Q in D||"@direction"===Q&&Q in D?D[Q]:"@context"!==Q?null:void 0},I.processingMode=(D,F)=>F.toString()>="1.1"?!D.processingMode||D.processingMode>="json-ld-"+F.toString():"json-ld-1.0"===D.processingMode,I.isKeyword=D=>{if(!$(D)||"@"!==D[0])return!1;switch(D){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(K,Ae,he){"use strict";const{parseLinkHeader:q,buildHeaders:V}=K("../util"),{LINK_HEADER_CONTEXT:L}=K("../constants"),re=K("../JsonLdError"),$=K("../RequestQueue"),{prependBase:b}=K("../url"),S=/(^|(\r\n))link:/i;function O(T,v,y){const w=new(T=T||XMLHttpRequest);return new Promise((M,j)=>{w.onload=()=>M(w),w.onerror=I=>j(I),w.open("GET",v,!0);for(const I in y)w.setRequestHeader(I,y[I]);w.send()})}Ae.exports=({secure:T,headers:v={},xhr:y}={headers:{}})=>{return v=V(v),(new $).wrapLoader(M);function M(I){return j.apply(this,arguments)}function j(){return(j=gt(function*(I){if(0!==I.indexOf("http:")&&0!==I.indexOf("https:"))throw new re('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:I});if(T&&0!==I.indexOf("https"))throw new re('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:I});let H;try{H=yield O(y,I,v)}catch(E){throw new re("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:I,cause:E})}if(H.status>=400)throw new re("URL could not be dereferenced: "+H.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:I,httpStatusCode:H.status});let Y={contextUrl:null,documentUrl:I,document:H.response},D=null;const F=H.getResponseHeader("Content-Type");let Q;if(S.test(H.getAllResponseHeaders())&&(Q=H.getResponseHeader("Link")),Q&&"application/ld+json"!==F){const E=q(Q),U=E[L];if(Array.isArray(U))throw new re("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:I});U&&(Y.contextUrl=U.target),D=E.alternate,D&&"application/ld+json"==D.type&&!(F||"").match(/^application\/(\w*\+)?json$/)&&(Y=yield M(b(I,D.target)))}return Y})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),{isArray:V,isObject:L,isEmptyObject:re,isString:$,isUndefined:b}=K("./types"),{isList:S,isValue:O,isGraph:T,isSubject:v}=K("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:M,process:j,processingMode:I}=K("./context"),{isAbsolute:H}=K("./url"),{addValue:Y,asArray:D,getValues:F,validateTypeValue:Q}=K("./util"),E={};Ae.exports=E;const U=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function ie(te){return ue.apply(this,arguments)}function ue(){return(ue=gt(function*({activeCtx:te,activeProperty:ye,expandedActiveProperty:De,element:Ve,expandedParent:nt,options:Ze={},insideList:Je,typeKey:Ye,typeScopedContext:je,expansionMap:Le}){const Ee=Object.keys(Ve).sort(),Re=[];let Ue;const qe=Ve[Ye]&&"@json"===y(te,V(Ve[Ye])?Ve[Ye][0]:Ve[Ye],{vocab:!0},Ze);for(const Be of Ee){let X,z=Ve[Be];if("@context"===Be)continue;let be=y(te,Be,{vocab:!0},Ze);if((null===be||!H(be)&&!M(be))&&(be=Le({unmappedProperty:Be,activeCtx:te,activeProperty:ye,parent:Ve,options:Ze,insideList:Je,value:z,expandedParent:nt}),void 0===be))continue;if(M(be)){if("@reverse"===De)throw new q("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(be in nt&&"@included"!==be&&"@type"!==be)throw new q("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:be})}if("@id"===be){if(!$(z)){if(!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(L(z)){if(!re(z))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!V(z))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(pt=>$(pt)))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}Y(nt,"@id",D(z).map(pt=>$(pt)?y(te,pt,{base:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@type"===be){L(z)&&(z=Object.fromEntries(Object.entries(z).map(([pt,fe])=>[y(je,pt,{vocab:!0}),D(fe).map(B=>y(je,B,{base:!0,vocab:!0}))]))),Q(z,Ze.isFrame),Y(nt,"@type",D(z).map(pt=>$(pt)?y(je,pt,{base:!0,vocab:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@included"===be&&I(te,1.1)){const pt=D(yield E.expand({activeCtx:te,activeProperty:ye,element:z,options:Ze,expansionMap:Le}));if(!pt.every(fe=>v(fe)))throw new q("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});Y(nt,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===be&&!L(z)&&!V(z))throw new q('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if("@value"===be){Ue=z,qe&&I(te,1.1)?nt["@value"]=z:Y(nt,"@value",z,{propertyIsArray:Ze.isFrame});continue}if("@language"===be){if(null===z)continue;if(!$(z)&&!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=D(z).map(pt=>$(pt)?pt.toLowerCase():pt);for(const pt of z)$(pt)&&!pt.match(U)&&console.warn(`@language must be valid BCP47: ${pt}`);Y(nt,"@language",z,{propertyIsArray:Ze.isFrame});continue}if("@direction"===be){if(!$(z)&&!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=D(z);for(const pt of z)if($(pt)&&"ltr"!==pt&&"rtl"!==pt)throw new q('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});Y(nt,"@direction",z,{propertyIsArray:Ze.isFrame});continue}if("@index"===be){if(!$(z))throw new q('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});Y(nt,"@index",z);continue}if("@reverse"===be){if(!L(z))throw new q('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(X=yield E.expand({activeCtx:te,activeProperty:"@reverse",element:z,options:Ze,expansionMap:Le}),"@reverse"in X)for(const fe in X["@reverse"])Y(nt,fe,X["@reverse"][fe],{propertyIsArray:!0});let pt=nt["@reverse"]||null;for(const fe in X){if("@reverse"===fe)continue;null===pt&&(pt=nt["@reverse"]={}),Y(pt,fe,[],{propertyIsArray:!0});const B=X[fe];for(let R=0;R"@id"===pt||"@index"===pt)&&(X=D(X).map(pt=>({"@graph":D(pt)}))),ce.mappings.has(Be)&&ce.mappings.get(Be).reverse){const pt=nt["@reverse"]=nt["@reverse"]||{};X=D(X);for(let fe=0;fe"@value"===y(te,be,{vocab:!0},Ze)))throw new q("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:X});yield ie({activeCtx:te,activeProperty:ye,expandedActiveProperty:De,element:X,expandedParent:nt,options:Ze,insideList:Je,typeScopedContext:je,typeKey:Ye,expansionMap:Le})}}})).apply(this,arguments)}function ee({activeCtx:te,activeProperty:ye,value:De,options:Ve}){if(null==De)return null;const nt=y(te,ye,{vocab:!0},Ve);if("@id"===nt)return y(te,De,{base:!0},Ve);if("@type"===nt)return y(te,De,{vocab:!0,base:!0},Ve);const Ze=w(te,ye,"@type");if(("@id"===Ze||"@graph"===nt)&&$(De))return{"@id":y(te,De,{base:!0},Ve)};if("@vocab"===Ze&&$(De))return{"@id":y(te,De,{vocab:!0,base:!0},Ve)};if(M(nt))return De;const Je={};if(Ze&&!["@id","@vocab","@none"].includes(Ze))Je["@type"]=Ze;else if($(De)){const Ye=w(te,ye,"@language");null!==Ye&&(Je["@language"]=Ye);const je=w(te,ye,"@direction");null!==je&&(Je["@direction"]=je)}return["boolean","number","string"].includes(typeof De)||(De=De.toString()),Je["@value"]=De,Je}function se(te,ye,De,Ve){const nt=[],Ze=Object.keys(ye).sort();for(const Je of Ze){const Ye=y(te,Je,{vocab:!0},Ve);let je=ye[Je];V(je)||(je=[je]);for(const Le of je){if(null===Le)continue;if(!$(Le))throw new q("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ee={"@value":Le};"@none"!==Ye&&(Ee["@language"]=Je.toLowerCase()),De&&(Ee["@direction"]=De),nt.push(Ee)}}return nt}function Te(te){return me.apply(this,arguments)}function me(){return(me=gt(function*({activeCtx:te,options:ye,activeProperty:De,value:Ve,expansionMap:nt,asGraph:Ze,indexKey:Je,propertyIndex:Ye}){const je=[],Le=Object.keys(Ve).sort(),Ee="@type"===Je;for(let Re of Le){if(Ee){const Be=w(te,Re,"@context");b(Be)||(te=yield j({activeCtx:te,localCtx:Be,propagate:!1,options:ye}))}let qe,Ue=Ve[Re];V(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:te,activeProperty:De,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:nt}),qe=Ye?"@none"===Re?"@none":ee({activeCtx:te,activeProperty:Je,value:Re,options:ye}):y(te,Re,{vocab:!0},ye),"@id"===Je?Re=y(te,Re,{base:!0},ye):Ee&&(Re=qe);for(let Be of Ue){if(Ze&&!T(Be)&&(Be={"@graph":[Be]}),"@type"===Je)"@none"===qe||(Be["@type"]=Be["@type"]?[Re].concat(Be["@type"]):[Re]);else{if(O(Be)&&!["@language","@type","@index"].includes(Je))throw new q(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${Je}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Be});Ye?"@none"!==qe&&Y(Be,Ye,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(Je in Be)&&(Be[Je]=Re)}je.push(Be)}}return je})).apply(this,arguments)}E.expand=function(){var te=gt(function*({activeCtx:ye,activeProperty:De=null,element:Ve,options:nt={},insideList:Ze=!1,insideIndex:Je=!1,typeScopedContext:Ye=null,expansionMap:je=(()=>{})}){if(null==Ve)return null;if("@default"===De&&(nt=Object.assign({},nt,{isFrame:!1})),!V(Ve)&&!L(Ve)){if(!Ze&&(null===De||"@graph"===y(ye,De,{vocab:!0},nt))){const X=yield je({unmappedValue:Ve,activeCtx:ye,activeProperty:De,options:nt,insideList:Ze});return void 0===X?null:X}return ee({activeCtx:ye,activeProperty:De,value:Ve,options:nt})}if(V(Ve)){let X=[];const be=w(ye,De,"@container")||[];Ze=Ze||be.includes("@list");for(let ce=0;ce1?ce.slice().sort():ce:[ce];for(const wt of Pe){const pt=w(Ye,wt,"@context");b(pt)||(ye=yield j({activeCtx:ye,localCtx:pt,options:nt,propagate:!1}))}}let Be={};yield ie({activeCtx:ye,activeProperty:De,expandedActiveProperty:Le,element:Ve,expandedParent:Be,options:nt,insideList:Ze,typeKey:qe,typeScopedContext:Ye,expansionMap:je}),Re=Object.keys(Be);let z=Re.length;if("@value"in Be){if("@type"in Be&&("@language"in Be||"@direction"in Be))throw new q('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:Be});let X=z-1;if("@type"in Be&&(X-=1),"@index"in Be&&(X-=1),"@language"in Be&&(X-=1),"@direction"in Be&&(X-=1),0!==X)throw new q('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:Be});const be=null===Be["@value"]?[]:D(Be["@value"]),ce=F(Be,"@type");if(!I(ye,1.1)||!ce.includes("@json")||1!==ce.length)if(0===be.length){const Pe=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==Pe?Pe:null}else{if(!be.every(Pe=>$(Pe)||re(Pe))&&"@language"in Be)throw new q("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Be});if(!ce.every(Pe=>H(Pe)&&!($(Pe)&&0===Pe.indexOf("_:"))||re(Pe)))throw new q('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:Be})}}else if("@type"in Be&&!V(Be["@type"]))Be["@type"]=[Be["@type"]];else if("@set"in Be||"@list"in Be){if(z>1&&(2!==z||!("@index"in Be)))throw new q('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:Be});"@set"in Be&&(Be=Be["@set"],Re=Object.keys(Be),z=Re.length)}else if(1===z&&"@language"in Be){const X=yield je(Be,{unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}if(L(Be)&&!nt.keepFreeFloatingNodes&&!Ze&&(null===De||"@graph"===Le)&&(0===z||"@value"in Be||"@list"in Be||1===z&&"@id"in Be)){const X=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}return Be});return function(ye){return te.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(K,Ae,he){"use strict";const{isSubjectReference:q}=K("./graphTypes"),{createMergedNodeMap:V}=K("./nodeMap"),L={};Ae.exports=L,L.flatten=re=>{const $=V(re),b=[],S=Object.keys($).sort();for(let O=0;O=0;--ue){const ee=ie[ue];if(ee.graph===U&&ee.subject["@id"]===E["@id"])return!0}return!1}function w(E,U,ie){const ue="@"+ie;let ee=ue in E?E[ue][0]:U[ie];if("embed"===ie)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return ee}function M(E){if(!L.isArray(E)||1!==E.length||!L.isObject(E[0]))throw new b("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const U of re.asArray(E[0]["@id"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const U of re.asArray(E[0]["@type"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function I(E,U,ie,ue){let ee=!0,se=!1;for(const Te in ie){let me=!1;const te=re.getValues(U,Te),ye=0===re.getValues(ie,Te).length;if("@id"===Te){if(L.isEmptyObject(ie["@id"][0]||{})?me=!0:ie["@id"].length>=0&&(me=ie["@id"].includes(te[0])),!ue.requireAll)return me}else if("@type"===Te){if(ee=!1,ye){if(te.length>0)return!1;me=!0}else if(1===ie["@type"].length&&L.isEmptyObject(ie["@type"][0]))me=te.length>0;else for(const De of ie["@type"])me=!(!L.isObject(De)||!("@default"in De))||me||te.some(Ve=>Ve===De);if(!ue.requireAll)return me}else{if(q(Te))continue;{const De=re.getValues(ie,Te)[0];let Ve=!1;if(De&&(M([De]),Ve="@default"in De),ee=!1,0===te.length&&Ve)continue;if(te.length>0&&ye)return!1;if(void 0===De){if(te.length>0)return!1;me=!0}else if(V.isList(De)){const nt=De["@list"][0];if(V.isList(te[0])){const Ze=te[0]["@list"];V.isValue(nt)?me=Ze.some(Je=>Q(nt,Je)):(V.isSubject(nt)||V.isSubjectReference(nt))&&(me=Ze.some(Je=>F(E,nt,Je,ue)))}}else me=V.isValue(De)?te.some(nt=>Q(De,nt)):V.isSubjectReference(De)?te.some(nt=>F(E,De,nt,ue)):!!L.isObject(De)&&te.length>0}}if(!me&&ue.requireAll)return!1;se=se||me}return ee||se}function H(E,U){const ie=E.uniqueEmbeds[E.graph],ue=ie[U],ee=ue.parent,se=ue.property,Te={"@id":U};if(L.isArray(ee)){for(let te=0;te{const ye=Object.keys(ie);for(const De of ye)De in ie&&L.isObject(ie[De].parent)&&ie[De].parent["@id"]===te&&(delete ie[De],me(De))};me(U)}function Y(E,U){if(L.isArray(E))return E.map(ie=>Y(ie,U));if(L.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(V.isValue(E))return E;if(V.isList(E))return E["@list"]=Y(E["@list"],U),E;if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)"@id"===ie&&U.bnodesToClear.includes(E[ie])?delete E["@id"]:E[ie]=Y(E[ie],U)}return E}function D(E,U,ie){L.isObject(E)?re.addValue(E,U,ie,{propertyIsArray:!0}):E.push(ie)}function F(E,U,ie,ue){if(!("@id"in ie))return!1;const ee=E.subjects[ie["@id"]];return ee&&I(E,ee,U,ue)}function Q(E,U){const ie=U["@value"],ue=U["@type"],ee=U["@language"],se=E["@value"]?L.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?L.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?L.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===se.length&&0===Te.length&&0===me.length||!(!se.includes(ie)&&!L.isEmptyObject(se[0])||!(!ue&&0===Te.length||Te.includes(ue)||ue&&L.isEmptyObject(Te[0]))||!(!ee&&0===me.length||me.includes(ee)||ee&&L.isEmptyObject(me[0])))}Ae.exports=T,T.frameMergedOrDefault=(E,U,ie)=>{const ue={options:ie,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new re.IdentifierIssuer("_:b");S(E,ue.graphMap,"@default",ee),ie.merged&&(ue.graphMap["@merged"]=O(ue.graphMap),ue.graph="@merged"),ue.subjects=ue.graphMap[ue.graph];const se=[];return T.frame(ue,Object.keys(ue.subjects).sort(),U,se),ie.pruneBlankNodeIdentifiers&&(ie.bnodesToClear=Object.keys(ue.bnodeMap).filter(Te=>1===ue.bnodeMap[Te].length)),ie.link={},Y(se,ie)},T.frame=(E,U,ie,ue,ee=null)=>{M(ie);const se=E.options,Te={embed:w(ie=ie[0],se,"embed"),explicit:w(ie,se,"explicit"),requireAll:w(ie,se,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],te=function(E,U,ie,ue){const ee={};for(const se of U){const Te=E.graphMap[E.graph][se];I(E,Te,ie,ue)&&(ee[se]=Te)}return ee}(E,U,ie,Te),ye=Object.keys(te).sort();for(const De of ye){const Ve=te[De];if(null===ee?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&De in me){D(ue,ee,me[De]);continue}const nt={"@id":De};if(0===De.indexOf("_:")&&re.addValue(E.bnodeMap,De,nt,{propertyIsArray:!0}),me[De]=nt,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:ie});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(De)){if(E.embedded&&("@never"===Te.embed||y(Ve,E.graph,E.subjectStack))){D(ue,ee,nt);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(De)){D(ue,ee,nt);continue}if("@last"===Te.embed&&De in E.uniqueEmbeds[E.graph]&&H(E,De),E.uniqueEmbeds[E.graph][De]={parent:ue,property:ee},E.subjectStack.push({subject:Ve,graph:E.graph}),De in E.graphMap){let Ze=!1,Je=null;"@graph"in ie?(Je=ie["@graph"][0],Ze=!("@merged"===De||"@default"===De),L.isObject(Je)||(Je={})):(Ze="@merged"!==E.graph,Je={}),Ze&&T.frame(Un(ht({},E),{graph:De,embedded:!1}),Object.keys(E.graphMap[De]).sort(),[Je],nt,"@graph")}"@included"in ie&&T.frame(Un(ht({},E),{embedded:!1}),U,ie["@included"],nt,"@included");for(const Ze of Object.keys(Ve).sort())if(q(Ze)){if(nt[Ze]=re.clone(Ve[Ze]),"@type"===Ze)for(const Je of Ve["@type"])0===Je.indexOf("_:")&&re.addValue(E.bnodeMap,Je,nt,{propertyIsArray:!0})}else if(!Te.explicit||Ze in ie)for(const Je of Ve[Ze]){const Ye=Ze in ie?ie[Ze]:v(Te);if(V.isList(Je)){const je=ie[Ze]&&ie[Ze][0]&&ie[Ze][0]["@list"]?ie[Ze][0]["@list"]:v(Te),Le={"@list":[]};D(nt,Ze,Le);const Ee=Je["@list"];for(const Re of Ee)V.isSubjectReference(Re)?T.frame(Un(ht({},E),{embedded:!0}),[Re["@id"]],je,Le,"@list"):D(Le,"@list",re.clone(Re))}else V.isSubjectReference(Je)?T.frame(Un(ht({},E),{embedded:!0}),[Je["@id"]],Ye,nt,Ze):Q(Ye[0],Je)&&D(nt,Ze,re.clone(Je))}for(const Ze of Object.keys(ie).sort()){if("@type"===Ze){if(!L.isObject(ie[Ze][0])||!("@default"in ie[Ze][0]))continue}else if(q(Ze))continue;const Je=ie[Ze][0]||{};if(!w(Je,se,"omitDefault")&&!(Ze in nt)){let je="@null";"@default"in Je&&(je=re.clone(Je["@default"])),L.isArray(je)||(je=[je]),nt[Ze]=[{"@preserve":je}]}}for(const Ze of Object.keys(ie["@reverse"]||{}).sort()){const Je=ie["@reverse"][Ze];for(const Ye of Object.keys(E.subjects))re.getValues(E.subjects[Ye],Ze).some(Le=>Le["@id"]===De)&&(nt["@reverse"]=nt["@reverse"]||{},re.addValue(nt["@reverse"],Ze,[],{propertyIsArray:!0}),T.frame(Un(ht({},E),{embedded:!0}),[Ye],Je,nt["@reverse"][Ze],ee))}D(ue,ee,nt),E.subjectStack.pop()}}},T.cleanupNull=(E,U)=>{if(L.isArray(E))return E.map(ue=>T.cleanupNull(ue,U)).filter(ue=>ue);if("@null"===E)return null;if(L.isObject(E)){if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)E[ie]=T.cleanupNull(E[ie],U)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),V=K("./graphTypes"),L=K("./types"),re=K("./util"),{RDF_LIST:$,RDF_FIRST:b,RDF_REST:S,RDF_NIL:O,RDF_TYPE:T,RDF_JSON_LITERAL:v,XSD_BOOLEAN:y,XSD_DOUBLE:w,XSD_INTEGER:M,XSD_STRING:j}=K("./constants"),I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,H={};function Y(D,F,Q){if(D.termType.endsWith("Node"))return{"@id":D.value};const E={"@value":D.value};if(D.language)E["@language"]=D.language;else{let U=D.datatype.value;if(U||(U=j),U===v){U="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(ie){throw new q("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:ie})}}if(F){if(U===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(L.isNumeric(E["@value"]))if(U===M){const ie=parseInt(E["@value"],10);ie.toFixed(0)===E["@value"]&&(E["@value"]=ie)}else U===w&&(E["@value"]=parseFloat(E["@value"]));[y,M,w,j].includes(U)||(E["@type"]=U)}else if("i18n-datatype"===Q&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,ue]=U.split(/[#_]/);ie.length>0&&(E["@language"]=ie,ie.match(I)||console.warn(`@language must be valid BCP47: ${ie}`)),E["@direction"]=ue}else U!==j&&(E["@type"]=U)}return E}Ae.exports=H,H.fromRDF=function(){var D=gt(function*(F,{useRdfType:Q=!1,useNativeTypes:E=!1,rdfDirection:U=null}){const ie={},ue={"@default":ie},ee={};for(const me of F){const te="DefaultGraph"===me.graph.termType?"@default":me.graph.value;te in ue||(ue[te]={}),"@default"!==te&&!(te in ie)&&(ie[te]={"@id":te});const ye=ue[te],De=me.subject.value,Ve=me.predicate.value,nt=me.object;De in ye||(ye[De]={"@id":De});const Ze=ye[De],Je=nt.termType.endsWith("Node");if(Je&&!(nt.value in ye)&&(ye[nt.value]={"@id":nt.value}),Ve===T&&!Q&&Je){re.addValue(Ze,"@type",nt.value,{propertyIsArray:!0});continue}const Ye=Y(nt,E,U);if(re.addValue(Ze,Ve,Ye,{propertyIsArray:!0}),Je)if(nt.value===O){const je=ye[nt.value];"usages"in je||(je.usages=[]),je.usages.push({node:Ze,property:Ve,value:Ye})}else ee[nt.value]=!(nt.value in ee)&&{node:Ze,property:Ve,value:Ye}}for(const me in ue){const te=ue[me];if(!(O in te))continue;const ye=te[O];if(ye.usages){for(let De of ye.usages){let Ve=De.node,nt=De.property,Ze=De.value;const Je=[],Ye=[];let je=Object.keys(Ve).length;for(;nt===S&&L.isObject(ee[Ve["@id"]])&&L.isArray(Ve[b])&&1===Ve[b].length&&L.isArray(Ve[S])&&1===Ve[S].length&&(3===je||4===je&&L.isArray(Ve["@type"])&&1===Ve["@type"].length&&Ve["@type"][0]===$)&&(Je.push(Ve[b][0]),Ye.push(Ve["@id"]),De=ee[Ve["@id"]],Ve=De.node,nt=De.property,Ze=De.value,je=Object.keys(Ve).length,V.isBlankNode(Ve)););delete Ze["@id"],Ze["@list"]=Je.reverse();for(const Le of Ye)delete te[Le]}delete ye.usages}}const se=[],Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me];if(me in ue){const ye=te["@graph"]=[],De=ue[me],Ve=Object.keys(De).sort();for(const nt of Ve){const Ze=De[nt];V.isSubjectReference(Ze)||ye.push(Ze)}}V.isSubjectReference(te)||se.push(te)}return se});return function(F,Q){return D.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(K,Ae,he){"use strict";const q=K("./types"),V={};Ae.exports=V,V.isSubject=L=>!(!q.isObject(L)||"@value"in L||"@set"in L||"@list"in L)&&(Object.keys(L).length>1||!("@id"in L)),V.isSubjectReference=L=>q.isObject(L)&&1===Object.keys(L).length&&"@id"in L,V.isValue=L=>q.isObject(L)&&"@value"in L,V.isList=L=>q.isObject(L)&&"@list"in L,V.isGraph=L=>q.isObject(L)&&"@graph"in L&&1===Object.keys(L).filter(re=>"@id"!==re&&"@index"!==re).length,V.isSimpleGraph=L=>V.isGraph(L)&&!("@id"in L),V.isBlankNode=L=>!!q.isObject(L)&&("@id"in L?0===L["@id"].indexOf("_:"):0===Object.keys(L).length||!("@value"in L||"@set"in L||"@list"in L))},{"./types":30}],26:[function(K,Ae,he){const q=K("rdf-canonize"),V=K("./platform"),L=K("./util"),re=K("./ContextResolver"),$=L.IdentifierIssuer,b=K("./JsonLdError"),S=K("lru-cache"),O=K("./NQuads"),{expand:T}=K("./expand"),{flatten:v}=K("./flatten"),{fromRDF:y}=K("./fromRdf"),{toRDF:w}=K("./toRdf"),{frameMergedOrDefault:M,cleanupNull:j}=K("./frame"),{isArray:I,isObject:H,isString:Y}=K("./types"),{isSubjectReference:D}=K("./graphTypes"),{expandIri:F,getInitialContext:Q,process:E,processingMode:U}=K("./context"),{compact:ie,compactIri:ue}=K("./compact"),{createNodeMap:ee,createMergedNodeMap:se,mergeNodeMaps:Te}=K("./nodeMap"),me=function(ye){const De={},nt=new S({max:100});function Ze(Je,Le){var Ee=Le,{documentLoader:Ye=ye.documentLoader}=Ee,je=D7(Ee,["documentLoader"]);return Object.assign({},{documentLoader:Ye},je,Je)}return ye.compact=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===je)throw new b("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ye)return null;let Ee;(Le=Ze(Le,{base:Y(Ye)?Ye:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new $("_:b"),contextResolver:new re({sharedCache:nt})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ee=Le.skipExpansion?Ye:yield ye.expand(Ye,Le);const Re=yield ye.processContext(Q(Le),je,Le);let Ue=yield ie({activeCtx:Re,element:Ee,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&I(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&H(Ue)&&(Ue=[Ue]),H(je)&&"@context"in je&&(je=je["@context"]),je=L.clone(je),I(je)||(je=[je]);const qe=je;je=[];for(let z=0;z0)&&je.push(qe[z]);const Be=je.length>0;if(1===je.length&&(je=je[0]),I(Ue)){const z=ue({activeCtx:Re,iri:"@graph",relativeTo:{vocab:!0}}),X=Ue;Ue={},Be&&(Ue["@context"]=je),Ue[z]=X}else if(H(Ue)&&Be){const z=Ue;Ue={"@context":je};for(const X in z)Ue[X]=z[X]}return Ue});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.expand=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(je=Ze(je,{keepFreeFloatingNodes:!1,contextResolver:new re({sharedCache:nt})})).expansionMap&&(je.expansionMap=void 0);const Le={},Ee=[];if("expandContext"in je){const Be=L.clone(je.expandContext);Le.expandContext=H(Be)&&"@context"in Be?Be:{"@context":Be},Ee.push(Le.expandContext)}let Re;if(Y(Ye)){const Be=yield ye.get(Ye,je);Re=Be.documentUrl,Le.input=Be.document,Be.contextUrl&&(Le.remoteContext={"@context":Be.contextUrl},Ee.push(Le.remoteContext))}else Le.input=L.clone(Ye);"base"in je||(je.base=Re||"");let Ue=Q(je);for(const Be of Ee)Ue=yield E({activeCtx:Ue,localCtx:Be,options:je});let qe=yield T({activeCtx:Ue,element:Le.input,options:je,expansionMap:je.expansionMap});return H(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),I(qe)||(qe=[qe]),qe});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.flatten=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");je="function"==typeof je?null:je||null,Le=Ze(Le,{base:Y(Ye)?Ye:"",contextResolver:new re({sharedCache:nt})});const Ee=yield ye.expand(Ye,Le),Re=v(Ee);return null===je?Re:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Re,je,Le))});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.frame=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Ze(Le,{base:Y(Ye)?Ye:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new re({sharedCache:nt})}),Y(je)){const ce=yield ye.get(je,Le);if(je=ce.document,ce.contextUrl){let Pe=je["@context"];Pe?I(Pe)?Pe.push(ce.contextUrl):Pe=[Pe,ce.contextUrl]:Pe=ce.contextUrl,je["@context"]=Pe}}const Ee=je&&je["@context"]||{},Re=yield ye.processContext(Q(Le),Ee,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=U(Re,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=U(Re,1.1));const Ue=yield ye.expand(Ye,Le),qe=ht({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const Be=yield ye.expand(je,qe),z=Object.keys(je).map(ce=>F(Re,ce,{vocab:!0}));qe.merged=!z.includes("@graph"),qe.is11=U(Re,1.1);const X=M(Ue,Be,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let be=yield ye.compact(X,Ee,qe);return qe.link={},be=j(be,qe),be});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.link=function(){var Je=gt(function*(Ye,je,Le){const Ee={};return je&&(Ee["@context"]=je),Ee["@embed"]="@link",ye.frame(Ye,Ee,Le)});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(je=Ze(je,{base:Y(Ye)?Ye:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new re({sharedCache:nt})}))){if("application/n-quads"!==je.inputFormat&&"application/nquads"!==je.inputFormat)throw new b("Unknown canonicalization input format.","jsonld.CanonizeError");const Re=O.parse(Ye);return q.canonize(Re,je)}const Le=ht({},je);delete Le.format,Le.produceGeneralizedRdf=!1;const Ee=yield ye.toRDF(Ye,Le);return q.canonize(Ee,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.fromRDF=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");je=Ze(je,{format:Y(Ye)?"application/n-quads":void 0});const{format:Le}=je;let{rdfParser:Ee}=je;if(Le){if(Ee=Ee||De[Le],!Ee)throw new b("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ee=()=>Ye;const Re=yield Ee(Ye);return y(Re,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.toRDF=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(je=Ze(je,{base:Y(Ye)?Ye:"",skipExpansion:!1,contextResolver:new re({sharedCache:nt})})).skipExpansion?Ye:yield ye.expand(Ye,je);const Ee=w(Le,je);if(je.format){if("application/n-quads"===je.format||"application/nquads"===je.format)return O.serialize(Ee);throw new b("Unknown output format.","jsonld.UnknownFormat",{format:je.format})}return Ee});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.createNodeMap=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");je=Ze(je,{base:Y(Ye)?Ye:"",contextResolver:new re({sharedCache:nt})});const Le=yield ye.expand(Ye,je);return se(Le,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.merge=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!I(Ye))throw new TypeError('Could not merge, "docs" must be an array.');je="function"==typeof je?null:je||null,Le=Ze(Le,{contextResolver:new re({sharedCache:nt})});const Ee=yield Promise.all(Ye.map(ce=>{const Pe=ht({},Le);return ye.expand(ce,Pe)}));let Re=!0;"mergeNodes"in Le&&(Re=Le.mergeNodes);const Ue=Le.issuer||new $("_:b"),qe={"@default":{}};for(let ce=0;ceye._documentLoader,set:Je=>ye._documentLoader=Je}),ye.documentLoader=function(){var Je=gt(function*(Ye){throw new b("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Ye})});return function(Ye){return Je.apply(this,arguments)}}(),ye.get=function(){var Je=gt(function*(Ye,je){let Le;Le="function"==typeof je.documentLoader?je.documentLoader:ye.documentLoader;const Ee=yield Le(Ye);try{if(!Ee.document)throw new b("No remote document found at the given URL.","jsonld.NullRemoteDocument");Y(Ee.document)&&(Ee.document=JSON.parse(Ee.document))}catch(Re){throw new b("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Re,remoteDoc:Ee})}return Ee});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.processContext=function(){var Je=gt(function*(Ye,je,Le){return Le=Ze(Le,{base:"",contextResolver:new re({sharedCache:nt})}),null===je?Q(Le):(je=L.clone(je),H(je)&&"@context"in je||(je={"@context":je}),E({activeCtx:Ye,localCtx:je,options:Le}))});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.getContextValue=K("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(Je){if(!(Je in ye.documentLoaders))throw new b('Unknown document loader type: "'+Je+'"',"jsonld.UnknownDocumentLoader",{type:Je});ye.documentLoader=ye.documentLoaders[Je].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(Je,Ye){De[Je]=Ye},ye.unregisterRDFParser=function(Je){delete De[Je]},ye.registerRDFParser("application/n-quads",O.parse),ye.registerRDFParser("application/nquads",O.parse),ye.url=K("./url"),ye.util=L,Object.assign(ye,L),ye.promises=ye,ye.RequestQueue=K("./RequestQueue"),ye.JsonLdProcessor=K("./JsonLdProcessor")(ye),V.setupGlobals(ye),V.setupDocumentLoaders(ye),ye},te=function(){return me(function(){return te()})};me(te),Ae.exports=te},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(K,Ae,he){"use strict";const{isKeyword:q}=K("./context"),V=K("./graphTypes"),L=K("./types"),re=K("./util"),$=K("./JsonLdError"),b={};Ae.exports=b,b.createMergedNodeMap=(S,O)=>{const T=(O=O||{}).issuer||new re.IdentifierIssuer("_:b"),v={"@default":{}};return b.createNodeMap(S,v,"@default",T),b.mergeNodeMaps(v)},b.createNodeMap=(S,O,T,v,y,w)=>{if(L.isArray(S)){for(const H of S)b.createNodeMap(H,O,T,v,void 0,w);return}if(!L.isObject(S))return void(w&&w.push(S));if(V.isValue(S)){if("@type"in S){let H=S["@type"];0===H.indexOf("_:")&&(S["@type"]=H=v.getId(H))}return void(w&&w.push(S))}if(w&&V.isList(S)){const H=[];return b.createNodeMap(S["@list"],O,T,v,y,H),void w.push({"@list":H})}if("@type"in S){const H=S["@type"];for(const Y of H)0===Y.indexOf("_:")&&v.getId(Y)}L.isUndefined(y)&&(y=V.isBlankNode(S)?v.getId(S["@id"]):S["@id"]),w&&w.push({"@id":y});const M=O[T],j=M[y]=M[y]||{};j["@id"]=y;const I=Object.keys(S).sort();for(let H of I){if("@id"===H)continue;if("@reverse"===H){const D={"@id":y},F=S["@reverse"];for(const Q in F){const E=F[Q];for(const U of E){let ie=U["@id"];V.isBlankNode(U)&&(ie=v.getId(ie)),b.createNodeMap(U,O,T,v,ie),re.addValue(M[ie],Q,D,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===H){y in O||(O[y]={}),b.createNodeMap(S[H],O,y,v);continue}if("@included"===H){b.createNodeMap(S[H],O,T,v);continue}if("@type"!==H&&q(H)){if("@index"===H&&H in j&&(S[H]!==j[H]||S[H]["@id"]!==j[H]["@id"]))throw new $("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:j});j[H]=S[H];continue}const Y=S[H];if(0===H.indexOf("_:")&&(H=v.getId(H)),0!==Y.length)for(let D of Y)if("@type"===H&&(D=0===D.indexOf("_:")?v.getId(D):D),V.isSubject(D)||V.isSubjectReference(D)){if("@id"in D&&!D["@id"])continue;const F=V.isBlankNode(D)?v.getId(D["@id"]):D["@id"];re.addValue(j,H,{"@id":F},{propertyIsArray:!0,allowDuplicate:!1}),b.createNodeMap(D,O,T,v,F)}else if(V.isValue(D))re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1});else if(V.isList(D)){const F=[];b.createNodeMap(D["@list"],O,T,v,y,F),D={"@list":F},re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1})}else b.createNodeMap(D,O,T,v,y),re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1});else re.addValue(j,H,[],{propertyIsArray:!0})}},b.mergeNodeMapGraphs=S=>{const O={};for(const T of Object.keys(S).sort())for(const v of Object.keys(S[T]).sort()){const y=S[T][v];v in O||(O[v]={"@id":v});const w=O[v];for(const M of Object.keys(y).sort())if(q(M)&&"@type"!==M)w[M]=re.clone(y[M]);else for(const j of y[M])re.addValue(w,M,re.clone(j),{propertyIsArray:!0,allowDuplicate:!1})}return O},b.mergeNodeMaps=S=>{const O=S["@default"],T=Object.keys(S).sort();for(const v of T){if("@default"===v)continue;const y=S[v];let w=O[v];w?"@graph"in w||(w["@graph"]=[]):O[v]=w={"@id":v,"@graph":[]};const M=w["@graph"];for(const j of Object.keys(y).sort()){const I=y[j];V.isSubjectReference(I)||M.push(I)}}return O}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(K,Ae,he){"use strict";const q=K("./documentLoaders/xhr"),V={};Ae.exports=V,V.setupDocumentLoaders=function(L){"undefined"!=typeof XMLHttpRequest&&(L.documentLoaders.xhr=q,L.useDocumentLoader("xhr"))},V.setupGlobals=function(L){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:L.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(K,Ae,he){"use strict";const{createNodeMap:q}=K("./nodeMap"),{isKeyword:V}=K("./context"),L=K("./graphTypes"),re=K("canonicalize"),$=K("./types"),b=K("./util"),{RDF_FIRST:S,RDF_REST:O,RDF_NIL:T,RDF_TYPE:v,RDF_JSON_LITERAL:y,RDF_LANGSTRING:w,XSD_BOOLEAN:M,XSD_DOUBLE:j,XSD_INTEGER:I,XSD_STRING:H}=K("./constants"),{isAbsolute:Y}=K("./url"),D={};function F(U,ie,ue,ee,se){const Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me],ye=Object.keys(te).sort();for(let De of ye){const Ve=te[De];if("@type"===De)De=v;else if(V(De))continue;for(const nt of Ve){const Ze={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!Y(me))continue;const Je={termType:De.startsWith("_:")?"BlankNode":"NamedNode",value:De};if(!Y(De)||"BlankNode"===Je.termType&&!se.produceGeneralizedRdf)continue;const Ye=E(nt,ee,U,ue,se.rdfDirection);Ye&&U.push({subject:Ze,predicate:Je,object:Ye,graph:ue})}}}}function E(U,ie,ue,ee,se){const Te={};if(L.isValue(U)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=U["@value"];const te=U["@type"]||null;"@json"===te?(Te.value=re(me),Te.datatype.value=y):$.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=te||M):$.isDouble(me)||te===j?($.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=te||j):$.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=te||I):"i18n-datatype"===se&&"@direction"in U?(Te.datatype.value="https://www.w3.org/ns/i18n#"+(U["@language"]||"")+`_${U["@direction"]}`,Te.value=me):"@language"in U?(Te.value=me,Te.datatype.value=te||w,Te.language=U["@language"]):(Te.value=me,Te.datatype.value=te||H)}else if(L.isList(U)){const me=function(U,ie,ue,ee,se){const Te={termType:"NamedNode",value:S},me={termType:"NamedNode",value:O},te={termType:"NamedNode",value:T},ye=U.pop(),De=ye?{termType:"BlankNode",value:ie.getId()}:te;let Ve=De;for(const nt of U){const Ze=E(nt,ie,ue,ee,se),Je={termType:"BlankNode",value:ie.getId()};ue.push({subject:Ve,predicate:Te,object:Ze,graph:ee}),ue.push({subject:Ve,predicate:me,object:Je,graph:ee}),Ve=Je}if(ye){const nt=E(ye,ie,ue,ee,se);ue.push({subject:Ve,predicate:Te,object:nt,graph:ee}),ue.push({subject:Ve,predicate:me,object:te,graph:ee})}return De}(U["@list"],ie,ue,ee,se);Te.termType=me.termType,Te.value=me.value}else{const me=$.isObject(U)?U["@id"]:U;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||Y(Te.value)?Te:null}Ae.exports=D,D.toRDF=(U,ie)=>{const ue=new b.IdentifierIssuer("_:b"),ee={"@default":{}};q(U,ee,"@default",ue);const se=[],Te=Object.keys(ee).sort();for(const me of Te){let te;if("@default"===me)te={termType:"DefaultGraph",value:""};else{if(!Y(me))continue;te=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},te.value=me}F(se,ee[me],te,ue,ie)}return se}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(K,Ae,he){"use strict";const q={};Ae.exports=q,q.isArray=Array.isArray,q.isBoolean=V=>"boolean"==typeof V||"[object Boolean]"===Object.prototype.toString.call(V),q.isDouble=V=>q.isNumber(V)&&(-1!==String(V).indexOf(".")||Math.abs(V)>=1e21),q.isEmptyObject=V=>q.isObject(V)&&0===Object.keys(V).length,q.isNumber=V=>"number"==typeof V||"[object Number]"===Object.prototype.toString.call(V),q.isNumeric=V=>!isNaN(parseFloat(V))&&isFinite(V),q.isObject=V=>"[object Object]"===Object.prototype.toString.call(V),q.isString=V=>"string"==typeof V||"[object String]"===Object.prototype.toString.call(V),q.isUndefined=V=>void 0===V},{}],31:[function(K,Ae,he){"use strict";const q=K("./types"),V={};Ae.exports=V,V.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},V.parse=(re,$)=>{const b={},S=V.parsers[$||"full"],O=S.regex.exec(re);let T=S.keys.length;for(;T--;)b[S.keys[T]]=void 0===O[T]?null:O[T];return("https"===b.scheme&&"443"===b.port||"http"===b.scheme&&"80"===b.port)&&(b.href=b.href.replace(":"+b.port,""),b.authority=b.authority.replace(":"+b.port,""),b.port=null),b.normalizedPath=V.removeDotSegments(b.path),b},V.prependBase=(re,$)=>{if(null===re||V.isAbsolute($))return $;(!re||q.isString(re))&&(re=V.parse(re||""));const b=V.parse($),S={protocol:re.protocol||""};if(null!==b.authority)S.authority=b.authority,S.path=b.path,S.query=b.query;else if(S.authority=re.authority,""===b.path)S.path=re.path,S.query=null!==b.query?b.query:re.query;else{if(0===b.path.indexOf("/"))S.path=b.path;else{let T=re.path;T=T.substr(0,T.lastIndexOf("/")+1),(T.length>0||re.authority)&&"/"!==T.substr(-1)&&(T+="/"),T+=b.path,S.path=T}S.query=b.query}""!==b.path&&(S.path=V.removeDotSegments(S.path));let O=S.protocol;return null!==S.authority&&(O+="//"+S.authority),O+=S.path,null!==S.query&&(O+="?"+S.query),null!==b.fragment&&(O+="#"+b.fragment),""===O&&(O="./"),O},V.removeBase=(re,$)=>{if(null===re)return $;(!re||q.isString(re))&&(re=V.parse(re||""));let b="";if(""!==re.href?b+=(re.protocol||"")+"//"+(re.authority||""):$.indexOf("//")&&(b+="//"),0!==$.indexOf(b))return $;const S=V.parse($.substr(b.length)),O=re.normalizedPath.split("/"),T=S.normalizedPath.split("/"),v=S.fragment||S.query?0:1;for(;O.length>0&&T.length>v&&O[0]===T[0];)O.shift(),T.shift();let y="";if(O.length>0){O.pop();for(let w=0;w{if(0===re.length)return"";const $=re.split("/"),b=[];for(;$.length>0;){const S=$.shift(),O=0===$.length;"."!==S?".."!==S?b.push(S):(b.pop(),O&&b.push("")):O&&b.push("")}return"/"===re[0]&&b.length>0&&""!==b[0]&&b.unshift(""),1===b.length&&""===b[0]?"/":b.join("/")};const L=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;V.isAbsolute=re=>q.isString(re)&&L.test(re),V.isRelative=re=>q.isString(re)},{"./types":30}],32:[function(K,Ae,he){"use strict";const q=K("./graphTypes"),V=K("./types"),L=K("rdf-canonize").IdentifierIssuer,re=K("./JsonLdError"),$=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,b=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,S=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,O_headers={accept:"application/ld+json, application/json"},T={};function v(y,w){if(V.isArray(w))for(let M=0;M{if(Object.keys(y).some(M=>"accept"===M.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+O_headers.accept+'" is supported.');return Object.assign({Accept:O_headers.accept},y)},T.parseLinkHeader=y=>{const w={},M=y.match($);for(let j=0;j{if(!(V.isString(y)||V.isArray(y)&&y.every(M=>V.isString(M)))){if(w&&V.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&T.asArray(y["@default"]).every(M=>V.isString(M)))return}throw new re('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:y})}},T.hasProperty=(y,w)=>{if(y.hasOwnProperty(w)){const M=y[w];return!V.isArray(M)||M.length>0}return!1},T.hasValue=(y,w,M)=>{if(T.hasProperty(y,w)){let j=y[w];const I=q.isList(j);if(V.isArray(j)||I){I&&(j=j["@list"]);for(let H=0;H{if("propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1),"valueIsArray"in j||(j.valueIsArray=!1),"allowDuplicate"in j||(j.allowDuplicate=!0),"prependValue"in j||(j.prependValue=!1),j.valueIsArray)y[w]=M;else if(V.isArray(M)){0===M.length&&j.propertyIsArray&&!y.hasOwnProperty(w)&&(y[w]=[]),j.prependValue&&(M=M.concat(y[w]),y[w]=[]);for(let I=0;I[].concat(y[w]||[]),T.removeProperty=(y,w)=>{delete y[w]},T.removeValue=(y,w,M,j)=>{"propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1);const I=T.getValues(y,w).filter(H=>!T.compareValues(H,M));0===I.length?T.removeProperty(y,w):y[w]=1!==I.length||j.propertyIsArray?I:I[0]},T.relabelBlankNodes=(y,w)=>v((w=w||{}).issuer||new L("_:b"),y),T.compareValues=(y,w)=>!!(y===w||q.isValue(y)&&q.isValue(w)&&y["@value"]===w["@value"]&&y["@type"]===w["@type"]&&y["@language"]===w["@language"]&&y["@index"]===w["@index"])||!!(V.isObject(y)&&"@id"in y&&V.isObject(w)&&"@id"in w)&&y["@id"]===w["@id"],T.compareShortestLeast=(y,w)=>y.length1;const j=(Q,E,U)=>{const ie=Q[v].get(E);if(ie){const ue=ie.value;if(I(Q,ue)){if(Y(Q,ie),!Q[$])return}else U&&(Q[y]&&(ie.value.now=Date.now()),Q[T].unshiftNode(ie));return ue.value}},I=(Q,E)=>{if(!E||!E.maxAge&&!Q[b])return!1;const U=Date.now()-E.now;return E.maxAge?U>E.maxAge:Q[b]&&U>Q[b]},H=Q=>{if(Q[L]>Q[V])for(let E=Q[T].tail;Q[L]>Q[V]&&null!==E;){const U=E.prev;Y(Q,E),E=U}},Y=(Q,E)=>{if(E){const U=E.value;Q[S]&&Q[S](U.key,U.value),Q[L]-=U.length,Q[v].delete(U.key),Q[T].removeNode(E)}};class D{constructor(E,U,ie,ue,ee){this.key=E,this.value=U,this.length=ie,this.now=ue,this.maxAge=ee||0}}const F=(Q,E,U,ie)=>{let ue=U.value;I(Q,ue)&&(Y(Q,U),Q[$]||(ue=void 0)),ue&&E.call(ie,ue.value,ue.key,Q)};Ae.exports=class{constructor(E){if("number"==typeof E&&(E={max:E}),E||(E={}),E.max&&("number"!=typeof E.max||E.max<0))throw new TypeError("max must be a non-negative number");this[V]=E.max||1/0;const ie=E.length||w;if(this[re]="function"!=typeof ie?w:ie,this[$]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[b]=E.maxAge||0,this[S]=E.dispose,this[O]=E.noDisposeOnSet||!1,this[y]=E.updateAgeOnGet||!1,this.reset()}set max(E){if("number"!=typeof E||E<0)throw new TypeError("max must be a non-negative number");this[V]=E||1/0,H(this)}get max(){return this[V]}set allowStale(E){this[$]=!!E}get allowStale(){return this[$]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[b]=E,H(this)}get maxAge(){return this[b]}set lengthCalculator(E){"function"!=typeof E&&(E=w),E!==this[re]&&(this[re]=E,this[L]=0,this[T].forEach(U=>{U.length=this[re](U.value,U.key),this[L]+=U.length})),H(this)}get lengthCalculator(){return this[re]}get length(){return this[L]}get itemCount(){return this[T].length}rforEach(E,U){U=U||this;for(let ie=this[T].tail;null!==ie;){const ue=ie.prev;F(this,E,ie,U),ie=ue}}forEach(E,U){U=U||this;for(let ie=this[T].head;null!==ie;){const ue=ie.next;F(this,E,ie,U),ie=ue}}keys(){return this[T].toArray().map(E=>E.key)}values(){return this[T].toArray().map(E=>E.value)}reset(){this[S]&&this[T]&&this[T].length&&this[T].forEach(E=>this[S](E.key,E.value)),this[v]=new Map,this[T]=new q,this[L]=0}dump(){return this[T].map(E=>!I(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[T]}set(E,U,ie){if((ie=ie||this[b])&&"number"!=typeof ie)throw new TypeError("maxAge must be a number");const ue=ie?Date.now():0,ee=this[re](U,E);if(this[v].has(E)){if(ee>this[V])return Y(this,this[v].get(E)),!1;const me=this[v].get(E).value;return this[S]&&(this[O]||this[S](E,me.value)),me.now=ue,me.maxAge=ie,me.value=U,this[L]+=ee-me.length,me.length=ee,this.get(E),H(this),!0}const se=new D(E,U,ee,ue,ie);return se.length>this[V]?(this[S]&&this[S](E,U),!1):(this[L]+=se.length,this[T].unshift(se),this[v].set(E,this[T].head),H(this),!0)}has(E){if(!this[v].has(E))return!1;const U=this[v].get(E).value;return!I(this,U)}get(E){return j(this,E,!0)}peek(E){return j(this,E,!1)}pop(){const E=this[T].tail;return E?(Y(this,E),E.value):null}del(E){Y(this,this[v].get(E))}load(E){this.reset();const U=Date.now();for(let ie=E.length-1;ie>=0;ie--){const ue=E[ie],ee=ue.e||0;if(0===ee)this.set(ue.k,ue.v);else{const se=ee-U;se>0&&this.set(ue.k,ue.v,se)}}}prune(){this[v].forEach((E,U)=>j(this,U,!1))}}},{yallist:92}],34:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;const q="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${V}decimal`,boolean:`${V}boolean`,double:`${V}double`,integer:`${V}integer`,string:`${V}string`},rdf:{type:`${q}type`,nil:`${q}nil`,first:`${q}first`,rest:`${q}rest`,langString:`${q}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${L}reify#forSome`,forAll:`${L}reify#forAll`},log:{implies:`${L}log#implies`}}},{}],35:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.termFromId=function D(te,ye){if(ye=ye||v,!te)return ye.defaultGraph();switch(te[0]){case"?":return ye.variable(te.substr(1));case"_":return ye.blankNode(te.substr(2));case'"':if(ye===v)return new j(te);if('"'===te[te.length-1])return ye.literal(te.substr(1,te.length-2));const De=te.lastIndexOf('"',te.length-1);return ye.literal(te.substr(1,De-1),"@"===te[De+1]?te.substr(De+2):ye.namedNode(te.substr(De+3)));case"<":const Ve=T.exec(te);return ye.quad(D(U(Ve[1]),ye),D(U(Ve[2]),ye),D(U(Ve[3]),ye),Ve[4]&&D(U(Ve[4]),ye));default:return ye.namedNode(te)}},he.termToId=function F(te){if("string"==typeof te)return te;if(te instanceof w&&"Quad"!==te.termType)return te.id;if(!te)return b.id;switch(te.termType){case"NamedNode":return te.value;case"BlankNode":return`_:${te.value}`;case"Variable":return`?${te.value}`;case"DefaultGraph":return"";case"Literal":return`"${te.value}"${te.language?`@${te.language}`:te.datatype&&te.datatype.value!==$.string?`^^${te.datatype.value}`:""}`;case"Quad":return`<<${E(F(te.subject))} ${E(F(te.predicate))} ${E(F(te.object))}${(0,V.isDefaultGraph)(te.graph)?"":` ${F(te.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${te.termType}`)}},he.escapeQuotes=E,he.unescapeQuotes=U,he.Triple=he.Quad=he.DefaultGraph=he.Variable=he.BlankNode=he.Literal=he.NamedNode=he.Term=he.default=void 0;var te,q=(te=K("./IRIs"))&&te.__esModule?te:{default:te},V=K("./N3Util");const{rdf:re,xsd:$}=q.default;let b,S=0;const O=/^"(.*".*)(?="[^"]*$)/,T=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,v={namedNode:function(te){return new M(te)},blankNode:function(te){return new I(te||"n3-"+S++)},variable:function(te){return new H(te)},literal:function(te,ye){if("string"==typeof ye)return new j(`"${te}"@${ye.toLowerCase()}`);let De=ye?ye.value:"";return""===De&&("boolean"==typeof te?De=$.boolean:"number"==typeof te&&(Number.isFinite(te)?De=Number.isInteger(te)?$.integer:$.double:(De=$.double,Number.isNaN(te)||(te=te>0?"INF":"-INF")))),new j(""===De||De===$.string?`"${te}"`:`"${te}"^^${De}`)},defaultGraph:function(){return b},quad:me,triple:me};he.default=v;class w{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof w?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=w;class M extends w{get termType(){return"NamedNode"}}he.NamedNode=M;class j extends w{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let De=ye.lastIndexOf('"')+1;return De`"${De.replace(/"/g,'""')}`)}function U(te){return te.replace(O,(ye,De)=>`"${De.replace(/""/g,'"')}`)}function me(te,ye,De,Ve){return new Q(te,ye,De,Ve)}he.Triple=he.Quad=Q},{"./IRIs":34,"./N3Util":41}],36:[function(K,Ae,he){(function(q){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var V=re(K("./IRIs")),L=re(K("queue-microtask"));function re(w){return w&&w.__esModule?w:{default:w}}const{xsd:$}=V.default,b=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,S={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},O=/[\x00-\x20<>\\"\{\}\|\^\`]/,T={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},v=/$0^/;he.default=class{constructor(M){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]*)?$/,this._lineMode=!!(M=M||{}).lineMode){this._n3Mode=!1;for(const j in this)!(j in T)&&this[j]instanceof RegExp&&(this[j]=v)}else this._n3Mode=!1!==M.n3;this._comments=!!M.comments,this._literalClosingPos=0}_tokenizeToEnd(M,j){let I=this._input;const H=this._comments;for(;;){let D,F;for(;D=this._newline.exec(I);)H&&(F=this._comment.exec(D[0]))&&M(null,{line:this._line,type:"comment",value:F[1],prefix:""}),I=I.substr(D[0].length,I.length),this._line++;if(!D&&(D=this._whitespace.exec(I))&&(I=I.substr(D[0].length,I.length)),this._endOfFile.test(I))return j&&(H&&(F=this._comment.exec(I))&&M(null,{line:this._line,type:"comment",value:F[1],prefix:""}),M(I=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=I;const Q=this._line,E=I[0];let U="",ie="",ue="",ee=null,se=0,Te=!1;switch(E){case"^":if(I.length<3)break;if("^"!==I[1]){this._n3Mode&&(se=1,U="^");break}if(this._previousMarker="^^",I=I.substr(2),"<"!==I[0]){Te=!0;break}case"<":if(ee=this._unescapedIri.exec(I))U="IRI",ie=ee[1];else if(ee=this._iri.exec(I)){if(ie=this._unescape(ee[1]),null===ie||O.test(ie))return Y(this);U="IRI"}else I.length>1&&"<"===I[1]?(U="<<",se=2):this._n3Mode&&I.length>1&&"="===I[1]&&(U="inverse",se=2,ie=">");break;case">":I.length>1&&">"===I[1]&&(U=">>",se=2);break;case"_":((ee=this._blank.exec(I))||j&&(ee=this._blank.exec(`${I} `)))&&(U="blank",ue="_",ie=ee[1]);break;case'"':if(ee=this._simpleQuotedString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return Y(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(ee=this._simpleApostropheString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return Y(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(ee=this._variable.exec(I))&&(U="var",ie=ee[0]);break;case"@":"literal"===this._previousMarker&&(ee=this._langcode.exec(I))?(U="langcode",ie=ee[1]):(ee=this._keyword.exec(I))&&(U=ee[0]);break;case".":if(1===I.length?j:I[1]<"0"||I[1]>"9"){U=".",se=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(ee=this._number.exec(I)||j&&(ee=this._number.exec(`${I} `)))&&(U="literal",ie=ee[0],ue="string"==typeof ee[1]?$.double:"string"==typeof ee[2]?$.decimal:$.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(ee=this._sparqlKeyword.exec(I))?U=ee[0].toUpperCase():Te=!0;break;case"f":case"t":(ee=this._boolean.exec(I))?(U="literal",ie=ee[0],ue=$.boolean):Te=!0;break;case"a":(ee=this._shortPredicates.exec(I))?(U="abbreviation",ie="a"):Te=!0;break;case"=":this._n3Mode&&I.length>1&&(U="abbreviation",">"!==I[1]?(se=1,ie="="):(se=2,ie=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(se=1,U=E);break;default:Te=!0}if(Te&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(ee=this._prefix.exec(I))?((ee=this._prefixed.exec(I))||j&&(ee=this._prefixed.exec(`${I} `)))&&(U="prefixed",ue=ee[1]||"",ie=this._unescape(ee[2])):(U="prefix",ie=ee[1]||"")),"^^"===this._previousMarker)switch(U){case"prefixed":U="type";break;case"IRI":U="typeIRI";break;default:U=""}if(!U)return j||!/^'''|^"""/.test(I)&&/\n|\r/.test(I)?Y(this):this._input=I;const me={line:Q,type:U,value:ie,prefix:ue};M(null,me),this.previousToken=me,this._previousMarker=U,I=I.substr(se||ee[0].length,I.length)}function Y(D){M(D._syntaxError(/^\S*/.exec(I)[0]))}}_unescape(M){let j=!1;const I=M.replace(b,(H,Y,D,F)=>{if("string"==typeof Y)return String.fromCharCode(Number.parseInt(Y,16));if("string"==typeof D){let Q=Number.parseInt(D,16);return Q<=65535?String.fromCharCode(Number.parseInt(D,16)):String.fromCharCode(55296+((Q-=65536)>>10),56320+(1023&Q))}return F in S?S[F]:(j=!0,"")});return j?null:I}_parseLiteral(M){if(M.length>=3){const j=M.match(/^(?:"""|"|'''|'|)/)[0],I=j.length;let H=Math.max(this._literalClosingPos,I);for(;(H=M.indexOf(j,H))>0;){let Y=0;for(;"\\"===M[H-Y-1];)Y++;if(Y%2==0){const D=M.substring(I,H),F=D.split(/\r\n|\r|\n/).length-1,Q=H+I;if(1===I&&0!==F||3===I&&this._lineMode)break;return this._line+=F,{value:this._unescape(D),matchLength:Q}}H++}this._literalClosingPos=M.length-I+1}return{value:"",matchLength:0}}_syntaxError(M){this._input=null;const j=new Error(`Unexpected "${M}" on line ${this._line}.`);return j.context={token:void 0,line:this._line,previousToken:this.previousToken},j}_readStartingBom(M){return M.startsWith("\ufeff")?M.substr(1):M}tokenize(M,j){if(this._line=1,"string"==typeof M){if(this._input=this._readStartingBom(M),"function"!=typeof j){const I=[];let H;if(this._tokenizeToEnd((Y,D)=>Y?H=Y:I.push(D),!0),H)throw H;return I}(0,L.default)(()=>this._tokenizeToEnd(j,!0))}else this._pendingBuffer=null,"function"==typeof M.setEncoding&&M.setEncoding("utf8"),M.on("data",I=>{null!==this._input&&0!==I.length&&(this._pendingBuffer&&(I=q.concat([this._pendingBuffer,I]),this._pendingBuffer=null),128&I[I.length-1]?this._pendingBuffer=I:(void 0===this._input?this._input=this._readStartingBom("string"==typeof I?I:I.toString()):this._input+=I,this._tokenizeToEnd(j,!1)))}),M.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(j,!0)}),M.on("error",j)}}}).call(this)}).call(this,K("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var q=re(K("./N3Lexer")),V=re(K("./N3DataFactory")),L=re(K("./IRIs"));function re(T){return T&&T.__esModule?T:{default:T}}let $=0;class b{constructor(v){this._contextStack=[],this._graph=null,this._setBase((v=v||{}).baseIRI),v.factory&&O(this,v.factory);const y="string"==typeof v.format?v.format.match(/\w*$/)[0].toLowerCase():"",w=/turtle/.test(y),M=/trig/.test(y),j=/triple/.test(y),I=/quad/.test(y),H=this._n3Mode=/n3/.test(y),Y=j||I;(this._supportsNamedGraphs=!(w||H))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(w||M||j||H),this._supportsRDFStar=""===y||/star|\*$/.test(y),Y&&(this._resolveRelativeIRI=D=>null),this._blankNodePrefix="string"!=typeof v.blankNodePrefix?"":v.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=v.lexer||new q.default({lineMode:Y,n3:H}),this._explicitQuantifiers=!!v.explicitQuantifiers}static _resetBlankNodePrefix(){$=0}_setBase(v){if(v){const y=v.indexOf("#");y>=0&&(v=v.substr(0,y)),this._base=v,this._basePath=v.indexOf("/")<0?v:v.replace(/[^\/?]*(?:\?.*)?$/,""),v=v.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=v[0],this._baseScheme=v[1]}else this._base="",this._basePath=""}_saveContext(v,y,w,M,j){const I=this._n3Mode;this._contextStack.push({subject:w,predicate:M,object:j,graph:y,type:v,inverse:!!I&&this._inversePredicate,blankPrefix:I?this._prefixes._:"",quantified:I?this._quantified:null}),I&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const v=this._contextStack.pop(),y=this._n3Mode;this._subject=v.subject,this._predicate=v.predicate,this._object=v.object,this._graph=v.graph,y&&(this._inversePredicate=v.inverse,this._prefixes._=v.blankPrefix,this._quantified=v.quantified)}_readInTopContext(v){switch(v.type){case"eof":return null!==this._graph?this._error("Unclosed graph",v):(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(v)}}_readEntity(v,y){let w;switch(v.type){case"IRI":case"typeIRI":const M=this._resolveIRI(v.value);if(null===M)return this._error("Invalid IRI",v);w=this._namedNode(M);break;case"type":case"prefixed":const j=this._prefixes[v.prefix];if(void 0===j)return this._error(`Undefined prefix "${v.prefix}:"`,v);w=this._namedNode(j+v.value);break;case"blank":w=this._blankNode(this._prefixes[v.prefix]+v.value);break;case"var":w=this._variable(v.value.substr(1));break;default:return this._error(`Expected entity but got ${v.type}`,v)}return!y&&this._n3Mode&&w.id in this._quantified&&(w=this._quantified[w.id]),w}_readSubject(v){switch(this._predicate=null,v.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",v);case"}":return this._readPunctuation(v);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',v);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',v);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",v);if(0===v.prefix.length)return this._literalValue=v.value,this._completeSubjectLiteral;this._subject=this._literal(v.value,this._namedNode(v.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._subject=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(v){const y=v.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[v.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,v):(this._subject=null,"]"===y?this._readBlankNodeTail(v):this._readPunctuation(v));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",v);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",v);default:if(void 0===(this._predicate=this._readEntity(v)))return}return this._readObject}_readObject(v){switch(v.type){case"literal":if(0===v.prefix.length)return this._literalValue=v.value,this._readDataTypeOrLang;this._object=this._literal(v.value,this._namedNode(v.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._object=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(v){return"{"===v.type?this._readGraph(v):this._readPredicate(v)}_readGraph(v){return"{"!==v.type?this._error(`Expected graph but got ${v.type}`,v):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(v){return"]"===v.type?(this._subject=null,this._readBlankNodeTail(v)):(this._predicate=null,this._readPredicate(v))}_readBlankNodeTail(v){if("]"!==v.type)return this._readBlankNodePunctuation(v);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null===this._object?y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(v){switch(v.type){case".":case"}":return this._subject=null,this._readPunctuation(v);default:return this._readPredicate(v)}}_readListItem(v){let y=null,w=null,M=this._readListItem;const j=this._subject,I=this._contextStack,H=I[I.length-1];switch(v.type){case"[":this._saveContext("blank",this._graph,w=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),M=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,w=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==I.length&&"list"===I[I.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(M=this._readPredicate,this._subject===this.RDF_NIL)return M}else if(M=this._getContextEndReader(),this._object===this.RDF_NIL)return M;w=this.RDF_NIL;break;case"literal":0===v.prefix.length?(this._literalValue=v.value,M=this._readListItemDataTypeOrLang):(y=this._literal(v.value,this._namedNode(v.prefix)),M=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);default:if(void 0===(y=this._readEntity(v)))return}if(null===w&&(this._subject=w=this._blankNode()),null===j?null===H.predicate?H.subject=w:H.object=w:this._emit(j,this.RDF_REST,w,this._graph),null!==y){if(this._n3Mode&&("IRI"===v.type||"prefixed"===v.type))return this._saveContext("item",this._graph,w,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(w,this.RDF_FIRST,y,this._graph)}return M}_readDataTypeOrLang(v){return this._completeObjectLiteral(v,!1)}_readListItemDataTypeOrLang(v){return this._completeObjectLiteral(v,!0)}_completeLiteral(v){let y=this._literal(this._literalValue);switch(v.type){case"type":case"typeIRI":const w=this._readEntity(v);if(void 0===w)return;y=this._literal(this._literalValue,w),v=null;break;case"langcode":y=this._literal(this._literalValue,v.value),v=null}return{token:v,literal:y}}_completeSubjectLiteral(v){return this._subject=this._completeLiteral(v).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(v,y){const w=this._completeLiteral(v);if(w)return this._object=w.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===w.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(w.token))}_readFormulaTail(v){return"}"!==v.type?this._readPunctuation(v):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(v){let y,w=this._graph;const M=this._subject,j=this._inversePredicate;switch(v.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",v);if(this._n3Mode)return this._readFormulaTail(v);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,j&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(w=this._readEntity(v))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}if(null!==M){const I=this._predicate,H=this._object;j?this._emit(H,I,M,w):this._emit(M,I,H,w)}return y}_readBlankNodePunctuation(v){let y;switch(v.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(v){return"."!==v.type?this._error("Expected dot to follow quad",v):this._readInTopContext}_readPrefix(v){return"prefix"!==v.type?this._error("Expected prefix to follow @prefix",v):(this._prefix=v.value,this._readPrefixIRI)}_readPrefixIRI(v){if("IRI"!==v.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,v);const y=this._readEntity(v);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(v){const y="IRI"===v.type&&this._resolveIRI(v.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",v)}_readNamedGraphLabel(v){switch(v.type){case"IRI":case"blank":case"prefixed":return this._readSubject(v),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",v)}}_readNamedGraphBlankLabel(v){return"]"!==v.type?this._error("Invalid graph label",v):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(v){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(v)):"."!==v.type?this._error("Expected declaration to end with a dot",v):this._readInTopContext}_readQuantifierList(v){let y;switch(v.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(v,!0)))break;default:return this._error(`Unexpected ${v.type}`,v)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,y,this.QUANTIFIERS_GRAPH)):this._quantified[y.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(v){return","===v.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(v))}_getPathReader(v){return this._afterPath=v,this._readPath}_readPath(v){switch(v.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,w=y.length&&y[y.length-1];if(w&&"item"===w.type){const M=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,M,this._graph)}return this._afterPath(v)}}_readForwardPath(v){let y,w;const M=this._blankNode();if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(y=this._subject,this._subject=M):(y=this._object,this._object=M),this._emit(y,w,M,this._graph),this._readPath}_readBackwardPath(v){const y=this._blankNode();let w,M;if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(M=this._subject,this._subject=y):(M=this._object,this._object=y),this._emit(y,w,M,this._graph),this._readPath}_readRDFStarTailOrGraph(v){return">>"!==v.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(v))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,v):this._readRDFStarTail(v)}_readRDFStarTail(v){if(">>"!==v.type)return this._error(`Expected >> but got ${v.type}`,v);const y=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=y,this._readPredicate):(this._object=y,this._getContextEndReader())}_getContextEndReader(){const v=this._contextStack;if(!v.length)return this._readPunctuation;switch(v[v.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(v,y,w,M){this._callback(null,this._quad(v,y,w,M||this.DEFAULTGRAPH))}_error(v,y){const w=new Error(`${v} on line ${y.line}.`);w.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(w),this._callback=S}_resolveIRI(v){return/^[a-z][a-z0-9+.-]*:/i.test(v)?v:this._resolveRelativeIRI(v)}_resolveRelativeIRI(v){if(!v.length)return this._base;switch(v[0]){case"#":return this._base+v;case"?":return this._base.replace(/(?:\?.*)?$/,v);case"/":return("/"===v[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(v);default:return/^[^/:]*:/.test(v)?null:this._removeDotSegments(this._basePath+v)}}_removeDotSegments(v){if(!/(^|\/)\.\.?($|[/#?])/.test(v))return v;const y=v.length;let w="",M=-1,j=-1,I=0,H="/";for(;M=j&&(w=w.substr(0,I)),"/"!==H)return`${w}/${v.substr(M+1)}`;I=M+1}}}H=v[++M]}return w+v.substring(I)}parse(v,y,w){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${$++}_`,this._prefixCallback=w||S,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const M=[];let j;if(this._callback=(I,H)=>{I?j=I:H&&M.push(H)},this._lexer.tokenize(v).every(I=>this._readCallback=this._readCallback(I)),j)throw j;return M}this._callback=y,this._lexer.tokenize(v,(M,j)=>{null!==M?(this._callback(M),this._callback=S):this._readCallback&&(this._readCallback=this._readCallback(j))})}}function S(){}function O(T,v){const y=v.namedNode;T._namedNode=y,T._blankNode=v.blankNode,T._literal=v.literal,T._variable=v.variable,T._quad=v.quad,T.DEFAULTGRAPH=v.defaultGraph(),T.RDF_FIRST=y(L.default.rdf.first),T.RDF_REST=y(L.default.rdf.rest),T.RDF_NIL=y(L.default.rdf.nil),T.N3_FORALL=y(L.default.r.forAll),T.N3_FORSOME=y(L.default.r.forSome),T.ABBREVIATIONS={a:y(L.default.rdf.type),"=":y(L.default.owl.sameAs),">":y(L.default.log.implies)},T.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=b,O(b.prototype,V.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var v,q=function(v,y){if(!y&&v&&v.__esModule)return v;if(null===v||"object"!=typeof v&&"function"!=typeof v)return{default:v};var w=$(y);if(w&&w.has(v))return w.get(v);var M={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in v)if("default"!==I&&Object.prototype.hasOwnProperty.call(v,I)){var H=j?Object.getOwnPropertyDescriptor(v,I):null;H&&(H.get||H.set)?Object.defineProperty(M,I,H):M[I]=v[I]}return M.default=v,w&&w.set(v,M),M}(K("./N3DataFactory")),V=K("readable-stream"),L=(v=K("./IRIs"))&&v.__esModule?v:{default:v};function $(v){if("function"!=typeof WeakMap)return null;var y=new WeakMap,w=new WeakMap;return($=function(M){return M?w:y})(v)}class S{constructor(y,w){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!w&&y&&!y[0]&&(w=y,y=null),this._factory=(w=w||{}).factory||q.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const w=this._graphs;let M,j;for(const I in w)for(const H in M=w[I].subjects)for(const Y in j=M[H])y+=Object.keys(j[Y]).length;return this._size=y}_addToIndex(y,w,M,j){const I=y[w]||(y[w]={}),H=I[M]||(I[M]={}),Y=j in H;return Y||(H[j]=null),!Y}_removeFromIndex(y,w,M,j){const I=y[w],H=I[M];delete H[j];for(const Y in H)return;delete I[M];for(const Y in I)return;delete y[w]}_findInIndex(y,w,M,j,I,H,Y,D,F,Q){let E,U,ie;const ee=!w+!M+!j>1?Object.keys(this._ids):this._entities;w&&((E=y,y={})[w]=E[w]);for(const se in y){const Te=ee[se];if(U=y[se]){M&&((E=U,U={})[M]=E[M]);for(const me in U){const te=ee[me];if(ie=U[me]){const ye=j?j in ie?[j]:[]:Object.keys(ie);for(let De=0;De{M in w||(w[M]=!0,y((0,q.termFromId)(this._entities[M],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,w,M,j){w||(j=y.graph,M=y.object,w=y.predicate,y=y.subject),y=(0,q.termToId)(y),w=(0,q.termToId)(w),M=(0,q.termToId)(M),j=(0,q.termToId)(j);let I=this._graphs[j];I||(I=this._graphs[j]={subjects:{},predicates:{},objects:{}},Object.freeze(I));const H=this._ids,Y=this._entities;y=H[y]||(H[Y[++this._id]=y]=this._id),w=H[w]||(H[Y[++this._id]=w]=this._id),M=H[M]||(H[Y[++this._id]=M]=this._id);const D=this._addToIndex(I.subjects,y,w,M);return this._addToIndex(I.predicates,w,M,y),this._addToIndex(I.objects,M,y,w),this._size=null,D}addQuads(y){for(let w=0;w{this.addQuad(w)}),y}removeQuad(y,w,M,j){w||(j=y.graph,M=y.object,w=y.predicate,y=y.subject),y=(0,q.termToId)(y),w=(0,q.termToId)(w),M=(0,q.termToId)(M),j=(0,q.termToId)(j);const I=this._ids,H=this._graphs;let Y,D,F;if(!((y=I[y])&&(w=I[w])&&(M=I[M])&&(Y=H[j])&&(D=Y.subjects[y])&&(F=D[w])&&M in F))return!1;for(y in this._removeFromIndex(Y.subjects,y,w,M),this._removeFromIndex(Y.predicates,w,M,y),this._removeFromIndex(Y.objects,M,y,w),null!==this._size&&this._size--,Y.subjects)return!0;return delete H[j],!0}removeQuads(y){for(let w=0;w{this.removeQuad(w)}),y}removeMatches(y,w,M,j){const I=new V.Readable({objectMode:!0});return I._read=()=>{for(const H of this.getQuads(y,w,M,j))I.push(H);I.push(null)},this.remove(I)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,w,M,j){y=y&&(0,q.termToId)(y),w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=[],H=this._getGraphs(j),Y=this._ids;let D,F,Q,E;if(O(y)&&!(F=Y[y])||O(w)&&!(Q=Y[w])||O(M)&&!(E=Y[M]))return I;for(const U in H)(D=H[U])&&(F?E?this._findInIndex(D.objects,E,F,Q,"object","subject","predicate",U,null,I):this._findInIndex(D.subjects,F,Q,null,"subject","predicate","object",U,null,I):Q?this._findInIndex(D.predicates,Q,E,null,"predicate","object","subject",U,null,I):E?this._findInIndex(D.objects,E,null,null,"object","subject","predicate",U,null,I):this._findInIndex(D.subjects,null,null,null,"subject","predicate","object",U,null,I));return I}match(y,w,M,j){return new T(this,y,w,M,j)}countQuads(y,w,M,j){y=y&&(0,q.termToId)(y),w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._getGraphs(j),H=this._ids;let D,F,Q,E,Y=0;if(O(y)&&!(F=H[y])||O(w)&&!(Q=H[w])||O(M)&&!(E=H[M]))return 0;for(const U in I)(D=I[U])&&(Y+=y?M?this._countInIndex(D.objects,E,F,Q):this._countInIndex(D.subjects,F,Q,E):w?this._countInIndex(D.predicates,Q,E,F):this._countInIndex(D.objects,E,F,Q));return Y}forEach(y,w,M,j,I){this.some(H=>(y(H),!1),w,M,j,I)}every(y,w,M,j,I){let H=!1;const Y=!this.some(D=>(H=!0,!y(D)),w,M,j,I);return H&&Y}some(y,w,M,j,I){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j),I=I&&(0,q.termToId)(I);const H=this._getGraphs(I),Y=this._ids;let D,F,Q,E;if(O(w)&&!(F=Y[w])||O(M)&&!(Q=Y[M])||O(j)&&!(E=Y[j]))return!1;for(const U in H)if(D=H[U])if(F){if(E){if(this._findInIndex(D.objects,E,F,Q,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(D.subjects,F,Q,null,"subject","predicate","object",U,y,null))return!0}else if(Q){if(this._findInIndex(D.predicates,Q,E,null,"predicate","object","subject",U,y,null))return!0}else if(E){if(this._findInIndex(D.objects,E,null,null,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(D.subjects,null,null,null,"subject","predicate","object",U,y,null))return!0;return!1}getSubjects(y,w,M){const j=[];return this.forSubjects(I=>{j.push(I)},y,w,M),j}forSubjects(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.predicates,D,F,y):this._loopByKey1(Y.subjects,D,y):F?this._loopByKey0(Y.objects,F,y):this._loop(Y.subjects,y))}getPredicates(y,w,M){const j=[];return this.forPredicates(I=>{j.push(I)},y,w,M),j}forPredicates(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.objects,F,D,y):this._loopByKey0(Y.subjects,D,y):F?this._loopByKey1(Y.predicates,F,y):this._loop(Y.predicates,y))}getObjects(y,w,M){const j=[];return this.forObjects(I=>{j.push(I)},y,w,M),j}forObjects(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.subjects,D,F,y):this._loopByKey1(Y.objects,D,y):F?this._loopByKey0(Y.predicates,F,y):this._loop(Y.objects,y))}getGraphs(y,w,M){const j=[];return this.forGraphs(I=>{j.push(I)},y,w,M),j}forGraphs(y,w,M,j){for(const I in this._graphs)this.some(H=>(y(H.graph),!0),w,M,j,I)}createBlankNode(y){let w,M;if(y)for(w=y=`_:${y}`,M=1;this._ids[w];)w=y+M++;else do{w="_:b"+this._blankNodeIndex++}while(this._ids[w]);return this._ids[w]=++this._id,this._entities[this._id]=w,this._factory.blankNode(w.substr(2))}extractLists({remove:y=!1,ignoreErrors:w=!1}={}){const M={},j=w?()=>!0:(Y,D)=>{throw new Error(`${Y.value} ${D}`)},I=this.getQuads(null,L.default.rdf.rest,L.default.rdf.nil,null),H=y?[...I]:[];return I.forEach(Y=>{const D=[];let Q,E,F=!1;const U=Y.graph;let ie=Y.subject;for(;ie&&!F;){const ue=this.getQuads(null,null,ie,null),ee=this.getQuads(ie,null,null,null);let se,Te=null,me=null,te=null;for(let ye=0;ye{switch(v){case"data":O=y;break;case"end":T=y}}},(v,y)=>{v&&this.emit("error",v)||y&&this.push(y)},(v,y)=>{this.emit("prefix",v,y)}),this._transform=(v,y,w)=>{O(v),w()},this._flush=v=>{T(),v()}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var $,q=K("readable-stream"),V=($=K("./N3Writer"))&&$.__esModule?$:{default:$};he.default=class extends q.Transform{constructor(b){super({encoding:"utf8",writableObjectMode:!0});const S=this._writer=new V.default({write:(O,T,v)=>{this.push(O),v&&v()},end:O=>{this.push(null),O&&O()}},b);this._transform=(O,T,v)=>{S.addQuad(O,v)},this._flush=O=>{S.end(O)}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),b.on("prefix",(S,O)=>{this._writer.addPrefix(S,O)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.isDefaultGraph=S,he.inDefaultGraph=function(y){return S(y.graph)},he.prefix=function(y,w){return v({"":y},w)("")},he.prefixes=v;var y,q=(y=K("./N3DataFactory"))&&y.__esModule?y:{default:y};function S(y){return!!y&&"DefaultGraph"===y.termType}function v(y,w){const M=Object.create(null);for(const I in y)j(I,y[I]);function j(I,H){if("string"==typeof H){const Y=Object.create(null);M[I]=D=>Y[D]||(Y[D]=w.namedNode(H+D))}else if(!(I in M))throw new Error(`Unknown prefix: ${I}`);return M[I]}return w=w||q.default,j}},{"./N3DataFactory":35}],42:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,q=(H=K("./IRIs"))&&H.__esModule?H:{default:H},V=function(H,Y){if(!Y&&H&&H.__esModule)return H;if(null===H||"object"!=typeof H&&"function"!=typeof H)return{default:H};var D=re(Y);if(D&&D.has(H))return D.get(H);var F={},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in H)if("default"!==E&&Object.prototype.hasOwnProperty.call(H,E)){var U=Q?Object.getOwnPropertyDescriptor(H,E):null;U&&(U.get||U.set)?Object.defineProperty(F,E,U):F[E]=H[E]}return F.default=H,D&&D.set(H,F),F}(K("./N3DataFactory")),L=K("./N3Util");function re(H){if("function"!=typeof WeakMap)return null;var Y=new WeakMap,D=new WeakMap;return(re=function(F){return F?D:Y})(H)}const S=V.default.defaultGraph(),{rdf:O,xsd:T}=q.default,v=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,w={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class M extends V.Term{equals(){return!1}}function I(H){let Y=w[H];return void 0===Y&&(1===H.length?(Y=H.charCodeAt(0).toString(16),Y="\\u0000".substr(0,6-Y.length)+Y):(Y=(1024*(H.charCodeAt(0)-55296)+H.charCodeAt(1)+9216).toString(16),Y="\\U00000000".substr(0,10-Y.length)+Y)),Y}he.default=class{constructor(Y,D){if(this._prefixRegex=/$0^/,Y&&"function"!=typeof Y.write&&(D=Y,Y=null),this._lists=(D=D||{}).lists,Y)this._outputStream=Y,this._endStream=void 0===D.end||!!D.end;else{let F="";this._outputStream={write(Q,E,U){F+=Q,U&&U()},end:Q=>{Q&&Q(null,F)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(D.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=S,this._baseIRI=D.baseIRI,this._prefixIRIs=Object.create(null),D.prefixes&&this.addPrefixes(D.prefixes))}get _inDefaultGraph(){return S.equals(this._graph)}_write(Y,D){this._outputStream.write(Y,"utf8",D)}_writeQuad(Y,D,F,Q,E){try{Q.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(S.equals(Q)?"":`${this._encodeIriOrBlank(Q)} {\n`)),this._graph=Q,this._subject=null),Y.equals(this._subject)?D.equals(this._predicate)?this._write(`, ${this._encodeObject(F)}`,E):this._write(`;\n ${this._encodePredicate(this._predicate=D)} ${this._encodeObject(F)}`,E):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=Y)} ${this._encodePredicate(this._predicate=D)} ${this._encodeObject(F)}`,E)}catch(U){E&&E(U)}}_writeQuadLine(Y,D,F,Q,E){delete this._prefixMatch,this._write(this.quadToString(Y,D,F,Q),E)}quadToString(Y,D,F,Q){return`${this._encodeSubject(Y)} ${this._encodeIriOrBlank(D)} ${this._encodeObject(F)}${Q&&Q.value?` ${this._encodeIriOrBlank(Q)} .\n`:" .\n"}`}quadsToString(Y){return Y.map(D=>this.quadToString(D.subject,D.predicate,D.object,D.graph)).join("")}_encodeSubject(Y){return"Quad"===Y.termType?this._encodeQuad(Y):this._encodeIriOrBlank(Y)}_encodeIriOrBlank(Y){if("NamedNode"!==Y.termType)return this._lists&&Y.value in this._lists&&(Y=this.list(this._lists[Y.value])),"id"in Y?Y.id:`_:${Y.value}`;let D=Y.value;this._baseIRI&&D.startsWith(this._baseIRI)&&(D=D.substr(this._baseIRI.length)),v.test(D)&&(D=D.replace(y,I));const F=this._prefixRegex.exec(D);return F?F[1]?this._prefixIRIs[F[1]]+F[2]:D:`<${D}>`}_encodeLiteral(Y){let D=Y.value;if(v.test(D)&&(D=D.replace(y,I)),Y.language)return`"${D}"@${Y.language}`;if(this._lineMode){if(Y.datatype.value===T.string)return`"${D}"`}else switch(Y.datatype.value){case T.string:return`"${D}"`;case T.boolean:if("true"===D||"false"===D)return D;break;case T.integer:if(/^[+-]?\d+$/.test(D))return D;break;case T.decimal:if(/^[+-]?\d*\.\d+$/.test(D))return D;break;case T.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(D))return D}return`"${D}"^^${this._encodeIriOrBlank(Y.datatype)}`}_encodePredicate(Y){return Y.value===O.type?"a":this._encodeIriOrBlank(Y)}_encodeObject(Y){switch(Y.termType){case"Quad":return this._encodeQuad(Y);case"Literal":return this._encodeLiteral(Y);default:return this._encodeIriOrBlank(Y)}}_encodeQuad({subject:Y,predicate:D,object:F,graph:Q}){return`<<${this._encodeSubject(Y)} ${this._encodePredicate(D)} ${this._encodeObject(F)}${(0,L.isDefaultGraph)(Q)?"":` ${this._encodeIriOrBlank(Q)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(Y,D,F,Q,E){void 0===F?this._writeQuad(Y.subject,Y.predicate,Y.object,Y.graph,D):"function"==typeof Q?this._writeQuad(Y,D,F,S,Q):this._writeQuad(Y,D,F,Q||S,E)}addQuads(Y){for(let D=0;D.\n`)}if(F){let Q="",E="";for(const U in this._prefixIRIs)Q+=Q?`|${U}`:U,E+=(E?"|":"")+this._prefixIRIs[U];Q=Q.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${E})[^/]*$|^(${Q})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(F?"\n":"",D)}blank(Y,D){let Q,E,F=Y;switch(void 0===Y?F=[]:Y.termType?F=[{predicate:Y,object:D}]:"length"in Y||(F=[Y]),E=F.length){case 0:return new M("[]");case 1:if(Q=F[0],!(Q.object instanceof M))return new M(`[ ${this._encodePredicate(Q.predicate)} ${this._encodeObject(Q.object)} ]`);default:let U="[";for(let ie=0;ie{D=null,Y(F,Q)});if(this._endStream)try{return this._outputStream.end(D)}catch(F){}D&&D()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return O.Term}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return O.NamedNode}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return O.Literal}}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return O.BlankNode}}),Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return O.Variable}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return O.DefaultGraph}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return O.Quad}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return O.Triple}}),Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return O.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return O.termToId}}),he.Util=void 0;var q=y(K("./N3Lexer")),V=y(K("./N3Parser")),L=y(K("./N3Writer")),re=y(K("./N3Store")),$=y(K("./N3StreamParser")),b=y(K("./N3StreamWriter")),S=v(K("./N3Util"));he.Util=S;var O=v(K("./N3DataFactory"));function T(w){if("function"!=typeof WeakMap)return null;var M=new WeakMap,j=new WeakMap;return(T=function(I){return I?j:M})(w)}function v(w,M){if(!M&&w&&w.__esModule)return w;if(null===w||"object"!=typeof w&&"function"!=typeof w)return{default:w};var j=T(M);if(j&&j.has(w))return j.get(w);var I={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Y in w)if("default"!==Y&&Object.prototype.hasOwnProperty.call(w,Y)){var D=H?Object.getOwnPropertyDescriptor(w,Y):null;D&&(D.get||D.set)?Object.defineProperty(I,Y,D):I[Y]=w[Y]}return I.default=w,j&&j.set(w,I),I}function y(w){return w&&w.__esModule?w:{default:w}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(K,Ae,he){var V,L,q=Ae.exports={};function re(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function b(H){if(V===setTimeout)return setTimeout(H,0);if((V===re||!V)&&setTimeout)return V=setTimeout,setTimeout(H,0);try{return V(H,0)}catch(Y){try{return V.call(null,H,0)}catch(D){return V.call(this,H,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:re}catch(H){V=re}try{L="function"==typeof clearTimeout?clearTimeout:$}catch(H){L=$}}();var v,O=[],T=!1,y=-1;function w(){!T||!v||(T=!1,v.length?O=v.concat(O):y=-1,O.length&&M())}function M(){if(!T){var H=b(w);T=!0;for(var Y=O.length;Y;){for(v=O,O=[];++y1)for(var D=1;D(V||(V=Promise.resolve())).then(L).catch(re=>setTimeout(()=>{throw re},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(K,Ae,he){Ae.exports=K("./lib")},{"./lib":55}],47:[function(K,Ae,he){"use strict";Ae.exports=class I7{constructor(V,L=new Map,re=0){this.prefix=V,this._existing=L,this.counter=re}clone(){const{prefix:V,_existing:L,counter:re}=this;return new I7(V,new Map(L),re)}getId(V){const L=V&&this._existing.get(V);if(L)return L;const re=this.prefix+this.counter;return this.counter++,V&&this._existing.set(V,re),re}hasId(V){return this._existing.has(V)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(K,Ae,he){"use strict";K("setimmediate");const q=self.crypto||self.msCrypto;Ae.exports=class{constructor(L){if(!q||!q.subtle)throw new Error("crypto.subtle not found.");if("sha256"===L)this.algorithm={name:"SHA-256"};else{if("sha1"!==L)throw new Error(`Unsupport algorithm "${L}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(L){this._content+=L}digest(){var L=this;return gt(function*(){const re=(new TextEncoder).encode(L._content),$=new Uint8Array(yield q.subtle.digest(L.algorithm,re));let b="";for(let S=0;S<$.length;++S)b+=$[S].toString(16).padStart(2,"0");return b})()}}},{setimmediate:86}],49:[function(K,Ae,he){"use strict";const L="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",re="http://www.w3.org/2001/XMLSchema#string",$="NamedNode",b="BlankNode",S="Literal",O="DefaultGraph",T={};function v(I,H){return I.subject.termType===H.subject.termType&&I.object.termType===H.object.termType&&I.subject.value===H.subject.value&&I.predicate.value===H.predicate.value&&I.object.value===H.object.value&&(I.object.termType!==S||I.object.datatype.termType===H.object.datatype.termType&&I.object.language===H.object.language&&I.object.datatype.value===H.object.datatype.value)}T.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,T.empty=new RegExp("^[ \\t]*$"),T.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),Ae.exports=class SP{static parse(H){const Y=[],D={},F=H.split(T.eoln);let Q=0;for(const E of F){if(Q++,T.empty.test(E))continue;const U=E.match(T.quad);if(null===U)throw new Error("N-Quads parse error on line "+Q+".");const ie={subject:null,predicate:null,object:null,graph:null};if(ie.subject=void 0!==U[1]?{termType:$,value:U[1]}:{termType:b,value:U[2]},ie.predicate={termType:$,value:U[3]},void 0!==U[4]?ie.object={termType:$,value:U[4]}:void 0!==U[5]?ie.object={termType:b,value:U[5]}:(ie.object={termType:S,value:void 0,datatype:{termType:$}},void 0!==U[7]?ie.object.datatype.value=U[7]:void 0!==U[8]?(ie.object.datatype.value=L,ie.object.language=U[8]):ie.object.datatype.value=re,ie.object.value=U[6].replace(M,function(H,Y,D,F){if(Y)switch(Y){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(D)return String.fromCharCode(parseInt(D,16));if(F)throw new Error("Unsupported U escape")})),ie.graph=void 0!==U[9]?{termType:$,value:U[9]}:void 0!==U[10]?{termType:b,value:U[10]}:{termType:O,value:""},ie.graph.value in D){let ue=!0;const ee=D[ie.graph.value];for(const se of ee)if(v(se,ie)){ue=!1;break}ue&&(ee.push(ie),Y.push(ie))}else D[ie.graph.value]=[ie],Y.push(ie)}return Y}static serialize(H){Array.isArray(H)||(H=SP.legacyDatasetToQuads(H));const Y=[];for(const D of H)Y.push(SP.serializeQuad(D));return Y.sort().join("")}static serializeQuad(H){const Y=H.subject,F=H.object,Q=H.graph;let E="";return E+=Y.termType===$?`<${Y.value}>`:`${Y.value}`,E+=` <${H.predicate.value}> `,F.termType===$?E+=`<${F.value}>`:F.termType===b?E+=F.value:(E+=`"${I=F.value,I.replace(y,function(H){switch(H){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,F.datatype.value===L?F.language&&(E+=`@${F.language}`):F.datatype.value!==re&&(E+=`^^<${F.datatype.value}>`)),Q.termType===$?E+=` <${Q.value}>`:Q.termType===b&&(E+=` ${Q.value}`),E+=" .\n",E;var I}static legacyDatasetToQuads(H){const Y=[],D={"blank node":b,IRI:$,literal:S};for(const F in H)H[F].forEach(E=>{const U={};for(const ie in E){const ue=E[ie],ee={termType:D[ue.type],value:ue.value};ee.termType===S&&(ee.datatype={termType:$},"datatype"in ue&&(ee.datatype.value=ue.datatype),"language"in ue?("datatype"in ue||(ee.datatype.value=L),ee.language=ue.language):"datatype"in ue||(ee.datatype.value=re)),U[ie]=ee}U.graph="@default"===F?{termType:O,value:""}:{termType:F.startsWith("_:")?b:$,value:F},Y.push(U)});return Y}};const y=/["\\\n\r]/g;const M=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(K,Ae,he){"use strict";Ae.exports=class{constructor(V){this.current=V.sort(),this.done=!1,this.dir=new Map;for(let L=0;L$)&&(v&&O>0&&T>V[O-1]||!v&&OV[O+1])&&($=T,b=O)}if(null===$)this.done=!0;else{const O=L.get($)?b-1:b+1;V[b]=V[O],V[O]=$;for(const T of V)T>$&&L.set(T,!L.get(T))}return re}}},{}],51:[function(K,Ae,he){(function(q){(function(){"use strict";const V=K("./IdentifierIssuer"),L=K("./MessageDigest"),re=K("./Permuter"),$=K("./NQuads");function b(S,O){return S.hashO.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new V("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(O){var T=this;return gt(function*(){T.quads=O;for(const H of O)T._addBlankNodeQuadInfo({quad:H,component:H.subject}),T._addBlankNodeQuadInfo({quad:H,component:H.object}),T._addBlankNodeQuadInfo({quad:H,component:H.graph});const v=new Map,y=[...T.blankNodeInfo.keys()];let w=0;for(const H of y)++w%100==0&&(yield T._yield()),yield T._hashAndTrackBlankNode({id:H,hashToBlankNodes:v});const M=[...v.keys()].sort(),j=[];for(const H of M){const Y=v.get(H);Y.length>1?j.push(Y):T.canonicalIssuer.getId(Y[0])}for(const H of j){const Y=[];for(const D of H){if(T.canonicalIssuer.hasId(D))continue;const F=new V("_:b");F.getId(D);const Q=yield T.hashNDegreeQuads(D,F);Y.push(Q)}Y.sort(b);for(const D of Y){const F=D.issuer.getOldIds();for(const Q of F)T.canonicalIssuer.getId(Q)}}const I=[];for(const H of T.quads){const Y=ht({},H);Y.subject=T._useCanonicalId({component:Y.subject}),Y.object=T._useCanonicalId({component:Y.object}),Y.graph=T._useCanonicalId({component:Y.graph}),I.push($.serializeQuad(Y))}return I.sort(),I.join("")})()}hashFirstDegreeQuads(O){var T=this;return gt(function*(){const v=[],y=T.blankNodeInfo.get(O),w=y.quads;for(const j of w){const I={subject:null,predicate:j.predicate,object:null,graph:null};I.subject=T.modifyFirstDegreeComponent(O,j.subject,"subject"),I.object=T.modifyFirstDegreeComponent(O,j.object,"object"),I.graph=T.modifyFirstDegreeComponent(O,j.graph,"graph"),v.push($.serializeQuad(I))}v.sort();const M=new L(T.hashAlgorithm);for(const j of v)M.update(j);return y.hash=yield M.digest(),y.hash})()}hashRelatedBlankNode(O,T,v,y){var w=this;return gt(function*(){let M;M=w.canonicalIssuer.hasId(O)?w.canonicalIssuer.getId(O):v.hasId(O)?v.getId(O):w.blankNodeInfo.get(O).hash;const j=new L(w.hashAlgorithm);return j.update(y),"g"!==y&&j.update(w.getRelatedPredicate(T)),j.update(M),j.digest()})()}hashNDegreeQuads(O,T){var v=this;return gt(function*(){const y=new L(v.hashAlgorithm),w=yield v.createHashToRelated(O,T),M=[...w.keys()].sort();for(const j of M){y.update(j);let H,I="";const Y=new re(w.get(j));let D=0;for(;Y.hasNext();){const F=Y.next();++D%3==0&&(yield v._yield());let Q=T.clone(),E="";const U=[];let ie=!1;for(const ue of F)if(v.canonicalIssuer.hasId(ue)?E+=v.canonicalIssuer.getId(ue):(Q.hasId(ue)||U.push(ue),E+=Q.getId(ue)),0!==I.length&&E>I){ie=!0;break}if(!ie){for(const ue of U){const ee=yield v.hashNDegreeQuads(ue,Q);if(E+=Q.getId(ue),E+=`<${ee.hash}>`,Q=ee.issuer,0!==I.length&&E>I){ie=!0;break}}ie||(0===I.length||E`}createHashToRelated(O,T){var v=this;return gt(function*(){const y=new Map,w=v.blankNodeInfo.get(O).quads;let M=0;for(const j of w)++M%100==0&&(yield v._yield()),yield Promise.all([v._addRelatedBlankNodeHash({quad:j,component:j.subject,position:"s",id:O,issuer:T,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.object,position:"o",id:O,issuer:T,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.graph,position:"g",id:O,issuer:T,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:O,hashToBlankNodes:T}){var v=this;return gt(function*(){const y=yield v.hashFirstDegreeQuads(O),w=T.get(y);w?w.push(O):T.set(y,[O])})()}_addBlankNodeQuadInfo({quad:O,component:T}){if("BlankNode"!==T.termType)return;const v=T.value,y=this.blankNodeInfo.get(v);y?y.quads.add(O):this.blankNodeInfo.set(v,{quads:new Set([O]),hash:null})}_addRelatedBlankNodeHash({quad:O,component:T,position:v,id:y,issuer:w,hashToRelated:M}){var j=this;return gt(function*(){if("BlankNode"!==T.termType||T.value===y)return;const I=T.value,H=yield j.hashRelatedBlankNode(I,O,w,v),Y=M.get(H);Y?Y.push(I):M.set(H,[I])})()}_useCanonicalId({component:O}){return"BlankNode"!==O.termType||O.value.startsWith(this.canonicalIssuer.prefix)?O:{termType:"BlankNode",value:this.canonicalIssuer.getId(O.value)}}_yield(){return gt(function*(){return new Promise(O=>q(O))})()}}}).call(this)}).call(this,K("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(K,Ae,he){"use strict";const q=K("./IdentifierIssuer"),V=K("./MessageDigest"),L=K("./Permuter"),re=K("./NQuads");function $(b,S){return b.hashS.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new q("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(S){this.quads=S;for(const M of S)this._addBlankNodeQuadInfo({quad:M,component:M.subject}),this._addBlankNodeQuadInfo({quad:M,component:M.object}),this._addBlankNodeQuadInfo({quad:M,component:M.graph});const O=new Map,T=[...this.blankNodeInfo.keys()];for(const M of T)this._hashAndTrackBlankNode({id:M,hashToBlankNodes:O});const v=[...O.keys()].sort(),y=[];for(const M of v){const j=O.get(M);j.length>1?y.push(j):this.canonicalIssuer.getId(j[0])}for(const M of y){const j=[];for(const I of M){if(this.canonicalIssuer.hasId(I))continue;const H=new q("_:b");H.getId(I);const Y=this.hashNDegreeQuads(I,H);j.push(Y)}j.sort($);for(const I of j){const H=I.issuer.getOldIds();for(const Y of H)this.canonicalIssuer.getId(Y)}}const w=[];for(const M of this.quads){const j=ht({},M);j.subject=this._useCanonicalId({component:j.subject}),j.object=this._useCanonicalId({component:j.object}),j.graph=this._useCanonicalId({component:j.graph}),w.push(re.serializeQuad(j))}return w.sort(),w.join("")}hashFirstDegreeQuads(S){const O=[],T=this.blankNodeInfo.get(S),v=T.quads;for(const w of v){const M={subject:null,predicate:w.predicate,object:null,graph:null};M.subject=this.modifyFirstDegreeComponent(S,w.subject,"subject"),M.object=this.modifyFirstDegreeComponent(S,w.object,"object"),M.graph=this.modifyFirstDegreeComponent(S,w.graph,"graph"),O.push(re.serializeQuad(M))}O.sort();const y=new V(this.hashAlgorithm);for(const w of O)y.update(w);return T.hash=y.digest(),T.hash}hashRelatedBlankNode(S,O,T,v){let y;y=this.canonicalIssuer.hasId(S)?this.canonicalIssuer.getId(S):T.hasId(S)?T.getId(S):this.blankNodeInfo.get(S).hash;const w=new V(this.hashAlgorithm);return w.update(v),"g"!==v&&w.update(this.getRelatedPredicate(O)),w.update(y),w.digest()}hashNDegreeQuads(S,O){const T=new V(this.hashAlgorithm),v=this.createHashToRelated(S,O),y=[...v.keys()].sort();for(const w of y){T.update(w);let j,M="";const I=new L(v.get(w));for(;I.hasNext();){const H=I.next();let Y=O.clone(),D="";const F=[];let Q=!1;for(const E of H)if(this.canonicalIssuer.hasId(E)?D+=this.canonicalIssuer.getId(E):(Y.hasId(E)||F.push(E),D+=Y.getId(E)),0!==M.length&&D>M){Q=!0;break}if(!Q){for(const E of F){const U=this.hashNDegreeQuads(E,Y);if(D+=Y.getId(E),D+=`<${U.hash}>`,Y=U.issuer,0!==M.length&&D>M){Q=!0;break}}Q||(0===M.length||D`}createHashToRelated(S,O){const T=new Map,v=this.blankNodeInfo.get(S).quads;for(const y of v)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:S,issuer:O,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:S,issuer:O,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:S,issuer:O,hashToRelated:T});return T}_hashAndTrackBlankNode({id:S,hashToBlankNodes:O}){const T=this.hashFirstDegreeQuads(S),v=O.get(T);v?v.push(S):O.set(T,[S])}_addBlankNodeQuadInfo({quad:S,component:O}){if("BlankNode"!==O.termType)return;const T=O.value,v=this.blankNodeInfo.get(T);v?v.quads.add(S):this.blankNodeInfo.set(T,{quads:new Set([S]),hash:null})}_addRelatedBlankNodeHash({quad:S,component:O,position:T,id:v,issuer:y,hashToRelated:w}){if("BlankNode"!==O.termType||O.value===v)return;const M=O.value,j=this.hashRelatedBlankNode(M,S,y,T),I=w.get(j);I?I.push(M):w.set(j,[M])}_useCanonicalId({component:S}){return"BlankNode"!==S.termType||S.value.startsWith(this.canonicalIssuer.prefix)?S:{termType:"BlankNode",value:this.canonicalIssuer.getId(S.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(K,Ae,he){"use strict";const q=K("./URDNA2015");Ae.exports=class extends q{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){var $=this;return gt(function*(){const b=new Map,S=$.blankNodeInfo.get(L).quads;let O=0;for(const T of S){let v,y;if("BlankNode"===T.subject.termType&&T.subject.value!==L)y=T.subject.value,v="p";else{if("BlankNode"!==T.object.termType||T.object.value===L)continue;y=T.object.value,v="r"}++O%100==0&&(yield $._yield());const w=yield $.hashRelatedBlankNode(y,T,re,v),M=b.get(w);M?M.push(y):b.set(w,[y])}return b})()}}},{"./URDNA2015":51}],54:[function(K,Ae,he){"use strict";const q=K("./URDNA2015Sync");Ae.exports=class extends q{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){const $=new Map,b=this.blankNodeInfo.get(L).quads;for(const S of b){let O,T;if("BlankNode"===S.subject.termType&&S.subject.value!==L)T=S.subject.value,O="p";else{if("BlankNode"!==S.object.termType||S.object.value===L)continue;T=S.object.value,O="r"}const v=this.hashRelatedBlankNode(T,S,re,O),y=$.get(v);y?y.push(T):$.set(v,[T])}return $}}},{"./URDNA2015Sync":52}],55:[function(K,Ae,he){"use strict";const q=K("./URDNA2015"),V=K("./URGNA2012"),L=K("./URDNA2015Sync"),re=K("./URGNA2012Sync");let $;try{$=K("rdf-canonize-native")}catch(S){}const b={};Ae.exports=b,b.NQuads=K("./NQuads"),b.IdentifierIssuer=K("./IdentifierIssuer"),b._rdfCanonizeNative=function(S){return S&&($=S),$},b.canonize=function(){var S=gt(function*(O,T){if(Array.isArray(O)||(O=b.NQuads.legacyDatasetToQuads(O)),T.useNative){if(!$)throw new Error("rdf-canonize-native not available");return new Promise((v,y)=>$.canonize(O,T,(w,M)=>w?y(w):v(M)))}if("URDNA2015"===T.algorithm)return new q(T).main(O);if("URGNA2012"===T.algorithm)return new V(T).main(O);throw"algorithm"in T?new Error("Invalid RDF Dataset Canonicalization algorithm: "+T.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(O,T){return S.apply(this,arguments)}}(),b._canonizeSync=function(S,O){if(Array.isArray(S)||(S=b.NQuads.legacyDatasetToQuads(S)),O.useNative){if($)return $.canonizeSync(S,O);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===O.algorithm)return new L(O).main(S);if("URGNA2012"===O.algorithm)return new re(O).main(S);throw"algorithm"in O?new Error("Invalid RDF Dataset Canonicalization algorithm: "+O.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(K,Ae,he){"use strict";var q=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&q(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(K("./lib/BlankNode"),he),V(K("./lib/DataFactory"),he),V(K("./lib/DefaultGraph"),he),V(K("./lib/Literal"),he),V(K("./lib/NamedNode"),he),V(K("./lib/Quad"),he),V(K("./lib/Variable"),he)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(L){this.termType="BlankNode",this.value=L}equals(L){return!!L&&"BlankNode"===L.termType&&L.value===this.value}}},{}],58:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const q=K("./BlankNode"),V=K("./DefaultGraph"),L=K("./Literal"),re=K("./NamedNode"),$=K("./Quad"),b=K("./Variable");let S=0;he.DataFactory=class{constructor(v){this.blankNodeCounter=0,this.blankNodePrefix=(v=v||{}).blankNodePrefix||`df_${S++}_`}namedNode(v){return new re.NamedNode(v)}blankNode(v){return new q.BlankNode(v||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(v,y){return new L.Literal(v,y)}variable(v){return new b.Variable(v)}defaultGraph(){return V.DefaultGraph.INSTANCE}quad(v,y,w,M){return new $.Quad(v,y,w,M||this.defaultGraph())}fromTerm(v){switch(v.termType){case"NamedNode":return this.namedNode(v.value);case"BlankNode":return this.blankNode(v.value);case"Literal":return v.language?this.literal(v.value,v.language):v.datatype.equals(L.Literal.XSD_STRING)?this.literal(v.value):this.literal(v.value,this.fromTerm(v.datatype));case"Variable":return this.variable(v.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(v.subject),this.fromTerm(v.predicate),this.fromTerm(v.object),this.fromTerm(v.graph))}}fromQuad(v){return this.fromTerm(v)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class q{constructor(){this.termType="DefaultGraph",this.value=""}equals(L){return!!L&&"DefaultGraph"===L.termType}}he.DefaultGraph=q,q.INSTANCE=new q},{}],60:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const q=K("./NamedNode");class V{constructor(re,$){this.termType="Literal",this.value=re,"string"==typeof $?(this.language=$,this.datatype=V.RDF_LANGUAGE_STRING):$?(this.language="",this.datatype=$):(this.language="",this.datatype=V.XSD_STRING)}equals(re){return!!re&&"Literal"===re.termType&&re.value===this.value&&re.language===this.language&&re.datatype.equals(this.datatype)}}he.Literal=V,V.RDF_LANGUAGE_STRING=new q.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),V.XSD_STRING=new q.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(L){this.termType="NamedNode",this.value=L}equals(L){return!!L&&"NamedNode"===L.termType&&L.value===this.value}}},{}],62:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(L,re,$,b){this.termType="Quad",this.value="",this.subject=L,this.predicate=re,this.object=$,this.graph=b}equals(L){return!!L&&("Quad"===L.termType||!L.termType)&&this.subject.equals(L.subject)&&this.predicate.equals(L.predicate)&&this.object.equals(L.object)&&this.graph.equals(L.graph)}}},{}],63:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(L){this.termType="Variable",this.value=L}equals(L){return!!L&&"Variable"===L.termType&&L.value===this.value}}},{}],64:[function(K,Ae,he){"use strict";var q=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&q(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(K("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class q extends Error{constructor(L,re){const $=L.saxStream._parser;super(L.trackPosition?`Line ${$.line+1} column ${$.column+1}: ${re}`:re)}}he.ParseError=q},{}],66:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const q=K("relative-to-absolute-iri"),V=K("sax"),L=K("stream"),re=K("./ParseError"),$=K("rdf-data-factory");class b extends L.Transform{constructor(T){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},T&&(Object.assign(this,T),this.options=T),this.dataFactory||(this.dataFactory=new $.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=V.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(T,v){const y={};let w=!1;for(const j in T.attributes)j.startsWith("xmlns")&&(5===j.length?(w=!0,y[""]=T.attributes[j]):":"===j.charAt(5)&&(w=!0,y[j.substr(6)]=T.attributes[j]));const M=v&&v.ns?v.ns:[b.DEFAULT_NS];return w?M.concat([y]):M}static expandPrefixedTerm(T,v,y){const w=T.indexOf(":");let M,j;w>=0?(M=T.substr(0,w),j=T.substr(w+1)):(M="",j=T);let I=null,H=null;for(let Y=v.length-1;Y>=0;Y--){const D=v[Y][M];if(D){I=D;break}H||(H=v[Y][""])}if(!I){if(M&&"xmlns"!==M)throw new re.ParseError(y,`The prefix '${M}' in term '${T}' was not bound.`);I=H||""}return{prefix:M,local:j,uri:I}}static isValidIri(T){return b.IRI_REGEX.test(T)}import(T){const v=new L.PassThrough({readableObjectMode:!0});T.on("error",w=>y.emit("error",w)),T.on("data",w=>v.push(w)),T.on("end",()=>v.push(null));const y=v.pipe(new b(this.options));return y}_transform(T,v,y){try{this.saxStream.write(T,v)}catch(w){return y(w)}y()}newParseError(T){return new re.ParseError(this,T)}valueToUri(T,v){return this.uriToNamedNode(q.resolve(T,v.baseIRI))}uriToNamedNode(T){if(!b.isValidIri(T))throw this.newParseError(`Invalid URI: ${T}`);return this.dataFactory.namedNode(T)}validateNcname(T){if(!b.NCNAME_MATCHER.test(T))throw this.newParseError(`Not a valid NCName: ${T}`)}attachSaxListeners(){this.saxStream.on("error",T=>this.emit("error",T)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(T){const v=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=S.RESOURCE;if(v&&(v.hadChildren=!0,y=v.childrenParseType),v&&v.childrenStringTags){const M=T.name;let j="";for(const D in T.attributes)j+=` ${D}="${T.attributes[D]}"`;v.childrenStringTags.push(`<${M}${j}>`);const Y={childrenStringTags:v.childrenStringTags};return Y.childrenStringEmitClosingTag=``,void this.activeTagStack.push(Y)}const w={};v?(w.language=v.language,w.baseIRI=v.baseIRI):w.baseIRI=this.baseIRI,this.activeTagStack.push(w),w.ns=b.parseNamespace(T,v),y===S.RESOURCE?this.onTagResource(T,w,v,!v):this.onTagProperty(T,w,v)}onTagResource(T,v,y,w){const M=b.expandPrefixedTerm(T.name,v.ns,this);v.childrenParseType=S.PROPERTY;let j=!0;if(M.uri===b.RDF){if(!w&&b.FORBIDDEN_NODE_ELEMENTS.indexOf(M.local)>=0)throw this.newParseError(`Illegal node element name: ${M.local}`);switch(M.local){case"RDF":v.childrenParseType=S.RESOURCE;case"Description":j=!1}}const I=[],H=[];let Y=null,D=!1,F=!1,Q=null;for(const E in T.attributes){const U=T.attributes[E],ie=b.expandPrefixedTerm(E,v.ns,this);if(y&&ie.uri===b.RDF)switch(ie.local){case"about":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);Y=U;continue;case"ID":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);this.validateNcname(U),Y="#"+U,D=!0;continue;case"nodeID":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);this.validateNcname(U),Y=U,F=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":Q=U;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(ie.uri===b.XML){if("lang"===ie.local){v.language=""===U?null:U.toLowerCase();continue}if("base"===ie.local){v.baseIRI=q.resolve(U,v.baseIRI);continue}}"xml"!==ie.prefix&&ie.uri&&(I.push(this.uriToNamedNode(ie.uri+ie.local)),H.push(U))}if(null!==Y&&(v.subject=F?this.dataFactory.blankNode(Y):this.valueToUri(Y,v),D&&this.claimNodeId(v.subject)),v.subject||(v.subject=this.dataFactory.blankNode()),j){const E=this.uriToNamedNode(M.uri+M.local);this.emitTriple(v.subject,this.dataFactory.namedNode(b.RDF+"type"),E,y?y.reifiedStatementId:null)}if(y){if(y.predicate)if(y.childrenCollectionSubject){const E=this.dataFactory.blankNode();this.emitTriple(y.childrenCollectionSubject,y.childrenCollectionPredicate,E,y.reifiedStatementId),this.emitTriple(E,this.dataFactory.namedNode(b.RDF+"first"),v.subject,v.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(b.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,v.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${w.local}`);v.predicateSubPredicates=[],v.predicateSubObjects=[];let M=!1,j=!1,I=null,H=!0;const Y=[],D=[];for(const F in T.attributes){const Q=T.attributes[F],E=b.expandPrefixedTerm(F,v.ns,this);if(E.uri===b.RDF)switch(E.local){case"resource":if(I)throw this.newParseError(`Found both rdf:resource (${Q}) and rdf:nodeID (${I}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${Q})`);v.hadChildren=!0,I=Q,H=!1;continue;case"datatype":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${Q}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${Q})`);v.datatype=this.valueToUri(Q,v);continue;case"nodeID":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${Q}).`);if(v.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${Q}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${Q})`);this.validateNcname(Q),v.hadChildren=!0,I=Q,H=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(j)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(v.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${v.datatype.value})`);if(I)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${I})`);if("Resource"===Q){M=!0,v.childrenParseType=S.PROPERTY;const U=this.dataFactory.blankNode();this.emitTriple(v.subject,v.predicate,U,v.reifiedStatementId),v.subject=U,v.predicate=null}else"Collection"===Q?(M=!0,v.hadChildren=!0,v.childrenCollectionSubject=v.subject,v.childrenCollectionPredicate=v.predicate,H=!1):"Literal"===Q&&(M=!0,v.childrenTagsToString=!0,v.childrenStringTags=[]);continue;case"ID":this.validateNcname(Q),v.reifiedStatementId=this.valueToUri("#"+Q,v),this.claimNodeId(v.reifiedStatementId);continue}else if(E.uri===b.XML&&"lang"===E.local){v.language=""===Q?null:Q.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(M||v.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${Q}`);v.hadChildren=!0,j=!0,Y.push(this.uriToNamedNode(E.uri+E.local)),D.push(this.dataFactory.literal(Q,v.datatype||v.language))}}if(null!==I){const F=v.subject;v.subject=H?this.dataFactory.blankNode(I):this.valueToUri(I,v),this.emitTriple(F,v.predicate,v.subject,v.reifiedStatementId);for(let Q=0;Q/g,(v,y,w)=>(this.saxStream._parser.ENTITIES[y]=w,""))}}var S,O;he.RdfXmlParser=b,b.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,b.MIME_TYPE="application/rdf+xml",b.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",b.XML="http://www.w3.org/XML/1998/namespace",b.XMLNS="http://www.w3.org/2000/xmlns/",b.DEFAULT_NS={xml:b.XML},b.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],b.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],b.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,(O=S=he.ParseType||(he.ParseType={}))[O.RESOURCE=0]="RESOURCE",O[O.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(K,Ae,he){"use strict";var V={};function L(O,T,v){v||(v=Error);var w=function(M){function j(I,H,Y){return M.call(this,function(M,j,I){return"string"==typeof T?T:T(M,j,I)}(I,H,Y))||this}return function(O,T){O.prototype=Object.create(T.prototype),O.prototype.constructor=O,O.__proto__=T}(j,M),j}(v);w.prototype.name=v.name,w.prototype.code=O,V[O]=w}function re(O,T){if(Array.isArray(O)){var v=O.length;return O=O.map(function(y){return String(y)}),v>2?"one of ".concat(T," ").concat(O.slice(0,v-1).join(", "),", or ")+O[v-1]:2===v?"one of ".concat(T," ").concat(O[0]," or ").concat(O[1]):"of ".concat(T," ").concat(O[0])}return"of ".concat(T," ").concat(String(O))}L("ERR_INVALID_OPT_VALUE",function(O,T){return'The value "'+T+'" is invalid for option "'+O+'"'},TypeError),L("ERR_INVALID_ARG_TYPE",function(O,T,v){var y,w;if("string"==typeof T&&function(O,T,v){return O.substr(!v||v<0?0:+v,T.length)===T}(T,"not ")?(y="must not be",T=T.replace(/^not /,"")):y="must be",function(O,T,v){return(void 0===v||v>O.length)&&(v=O.length),O.substring(v-T.length,v)===T}(O," argument"))w="The ".concat(O," ").concat(y," ").concat(re(T,"type"));else{var M=function(O,T,v){return"number"!=typeof v&&(v=0),!(v+T.length>O.length)&&-1!==O.indexOf(T,v)}(O,".")?"property":"argument";w='The "'.concat(O,'" ').concat(M," ").concat(y," ").concat(re(T,"type"))}return w+". Received type ".concat(typeof v)},TypeError),L("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),L("ERR_METHOD_NOT_IMPLEMENTED",function(O){return"The "+O+" method is not implemented"}),L("ERR_STREAM_PREMATURE_CLOSE","Premature close"),L("ERR_STREAM_DESTROYED",function(O){return"Cannot call "+O+" after a stream was destroyed"}),L("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),L("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),L("ERR_STREAM_WRITE_AFTER_END","write after end"),L("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),L("ERR_UNKNOWN_ENCODING",function(O){return"Unknown encoding: "+O},TypeError),L("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.exports.codes=V},{}],68:[function(K,Ae,he){(function(q){(function(){"use strict";var V=Object.keys||function(y){var w=[];for(var M in y)w.push(M);return w};Ae.exports=O;var L=K("./_stream_readable"),re=K("./_stream_writable");K("inherits")(O,L);for(var $=V(re.prototype),b=0;b<$.length;b++){var S=$[b];O.prototype[S]||(O.prototype[S]=re.prototype[S])}function O(y){if(!(this instanceof O))return new O(y);L.call(this,y),re.call(this,y),this.allowHalfOpen=!0,y&&(!1===y.readable&&(this.readable=!1),!1===y.writable&&(this.writable=!1),!1===y.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",T)))}function T(){this._writableState.ended||q.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(w){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=w,this._writableState.destroyed=w)}})}).call(this)}).call(this,K("_process"))},{"./_stream_readable":70,"./_stream_writable":72,_process:44,inherits:10}],69:[function(K,Ae,he){"use strict";Ae.exports=V;var q=K("./_stream_transform");function V(L){if(!(this instanceof V))return new V(L);q.call(this,L)}K("inherits")(V,q),V.prototype._transform=function(L,re,$){$(null,L)}},{"./_stream_transform":71,inherits:10}],70:[function(K,Ae,he){(function(q,V){(function(){"use strict";var L;Ae.exports=te,te.ReadableState=me,K("events");var $=function(B,R){return B.listeners(R).length},b=K("./internal/streams/stream"),S=K("buffer").Buffer,O=V.Uint8Array||function(){};var w,y=K("util");w=y&&y.debuglog?y.debuglog("stream"):function(){};var U,ie,ue,M=K("./internal/streams/buffer_list"),j=K("./internal/streams/destroy"),H=K("./internal/streams/state").getHighWaterMark,Y=K("../errors").codes,D=Y.ERR_INVALID_ARG_TYPE,F=Y.ERR_STREAM_PUSH_AFTER_EOF,Q=Y.ERR_METHOD_NOT_IMPLEMENTED,E=Y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;K("inherits")(te,b);var ee=j.errorOrDestroy,se=["error","close","destroy","pause","resume"];function me(fe,B,R){L=L||K("./_stream_duplex"),"boolean"!=typeof R&&(R=B instanceof L),this.objectMode=!!(fe=fe||{}).objectMode,R&&(this.objectMode=this.objectMode||!!fe.readableObjectMode),this.highWaterMark=H(this,fe,"readableHighWaterMark",R),this.buffer=new M,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==fe.emitClose,this.autoDestroy=!!fe.autoDestroy,this.destroyed=!1,this.defaultEncoding=fe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,fe.encoding&&(U||(U=K("string_decoder/").StringDecoder),this.decoder=new U(fe.encoding),this.encoding=fe.encoding)}function te(fe){if(L=L||K("./_stream_duplex"),!(this instanceof te))return new te(fe);this._readableState=new me(fe,this,this instanceof L),this.readable=!0,fe&&("function"==typeof fe.read&&(this._read=fe.read),"function"==typeof fe.destroy&&(this._destroy=fe.destroy)),b.call(this)}function ye(fe,B,R,k,Oe){w("readableAddChunk",B);var yt,Xe=fe._readableState;if(null===B)Xe.reading=!1,function(fe,B){if(w("onEofChunk"),!B.ended){if(B.decoder){var R=B.decoder.end();R&&R.length&&(B.buffer.push(R),B.length+=B.objectMode?1:R.length)}B.ended=!0,B.sync?je(fe):(B.needReadable=!1,B.emittedReadable||(B.emittedReadable=!0,Le(fe)))}}(fe,Xe);else if(Oe||(yt=function(fe,B){var R;return!function(fe){return S.isBuffer(fe)||fe instanceof O}(B)&&"string"!=typeof B&&void 0!==B&&!fe.objectMode&&(R=new D("chunk",["string","Buffer","Uint8Array"],B)),R}(Xe,B)),yt)ee(fe,yt);else if(Xe.objectMode||B&&B.length>0)if("string"!=typeof B&&!Xe.objectMode&&Object.getPrototypeOf(B)!==S.prototype&&(B=function(fe){return S.from(fe)}(B)),k)Xe.endEmitted?ee(fe,new E):De(fe,Xe,B,!0);else if(Xe.ended)ee(fe,new F);else{if(Xe.destroyed)return!1;Xe.reading=!1,Xe.decoder&&!R?(B=Xe.decoder.write(B),Xe.objectMode||0!==B.length?De(fe,Xe,B,!1):Ee(fe,Xe)):De(fe,Xe,B,!1)}else k||(Xe.reading=!1,Ee(fe,Xe));return!Xe.ended&&(Xe.lengthB.highWaterMark&&(B.highWaterMark=function(fe){return fe>=nt?fe=nt:(fe--,fe|=fe>>>1,fe|=fe>>>2,fe|=fe>>>4,fe|=fe>>>8,fe|=fe>>>16,fe++),fe}(fe)),fe<=B.length?fe:B.ended?B.length:(B.needReadable=!0,0))}function je(fe){var B=fe._readableState;w("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(w("emitReadable",B.flowing),B.emittedReadable=!0,q.nextTick(Le,fe))}function Le(fe){var B=fe._readableState;w("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(fe.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,be(fe)}function Ee(fe,B){B.readingMore||(B.readingMore=!0,q.nextTick(Re,fe,B))}function Re(fe,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:fe.listenerCount("data")>0&&fe.resume()}function Be(fe){w("readable nexttick read 0"),fe.read(0)}function X(fe,B){w("resume",B.reading),B.reading||fe.read(0),B.resumeScheduled=!1,fe.emit("resume"),be(fe),B.flowing&&!B.reading&&fe.read(0)}function be(fe){var B=fe._readableState;for(w("flow",B.flowing);B.flowing&&null!==fe.read(););}function ce(fe,B){return 0===B.length?null:(B.objectMode?R=B.buffer.shift():!fe||fe>=B.length?(R=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):R=B.buffer.consume(fe,B.decoder),R);var R}function Pe(fe){var B=fe._readableState;w("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,q.nextTick(wt,B,fe))}function wt(fe,B){if(w("endReadableNT",fe.endEmitted,fe.length),!fe.endEmitted&&0===fe.length&&(fe.endEmitted=!0,B.readable=!1,B.emit("end"),fe.autoDestroy)){var R=B._writableState;(!R||R.autoDestroy&&R.finished)&&B.destroy()}}function pt(fe,B){for(var R=0,k=fe.length;R=B.highWaterMark:B.length>0)||B.ended))return w("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?Pe(this):je(this),null;if(0===(fe=Je(fe,B))&&B.ended)return 0===B.length&&Pe(this),null;var Oe,k=B.needReadable;return w("need readable",k),(0===B.length||B.length-fe0?ce(fe,B):null)?(B.needReadable=B.length<=B.highWaterMark,fe=0):(B.length-=fe,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),R!==fe&&B.ended&&Pe(this)),null!==Oe&&this.emit("data",Oe),Oe},te.prototype._read=function(fe){ee(this,new Q("_read()"))},te.prototype.pipe=function(fe,B){var R=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=fe;break;case 1:k.pipes=[k.pipes,fe];break;default:k.pipes.push(fe)}k.pipesCount+=1,w("pipe count=%d opts=%j",k.pipesCount,B);var Xe=B&&!1===B.end||fe===q.stdout||fe===q.stderr?cs:It;function yt(Ps,Gr){w("onunpipe"),Ps===R&&Gr&&!1===Gr.hasUnpiped&&(Gr.hasUnpiped=!0,w("cleanup"),fe.removeListener("close",Hr),fe.removeListener("finish",Ns),fe.removeListener("drain",Tn),fe.removeListener("error",hi),fe.removeListener("unpipe",yt),R.removeListener("end",It),R.removeListener("end",cs),R.removeListener("data",yi),Pn=!0,k.awaitDrain&&(!fe._writableState||fe._writableState.needDrain)&&Tn())}function It(){w("onend"),fe.end()}k.endEmitted?q.nextTick(Xe):R.once("end",Xe),fe.on("unpipe",yt);var Tn=function(fe){return function(){var R=fe._readableState;w("pipeOnDrain",R.awaitDrain),R.awaitDrain&&R.awaitDrain--,0===R.awaitDrain&&$(fe,"data")&&(R.flowing=!0,be(fe))}}(R);fe.on("drain",Tn);var Pn=!1;function yi(Ps){w("ondata");var Gr=fe.write(Ps);w("dest.write",Gr),!1===Gr&&((1===k.pipesCount&&k.pipes===fe||k.pipesCount>1&&-1!==pt(k.pipes,fe))&&!Pn&&(w("false write response, pause",k.awaitDrain),k.awaitDrain++),R.pause())}function hi(Ps){w("onerror",Ps),cs(),fe.removeListener("error",hi),0===$(fe,"error")&&ee(fe,Ps)}function Hr(){fe.removeListener("finish",Ns),cs()}function Ns(){w("onfinish"),fe.removeListener("close",Hr),cs()}function cs(){w("unpipe"),R.unpipe(fe)}return R.on("data",yi),function(fe,B,R){if("function"==typeof fe.prependListener)return fe.prependListener(B,R);fe._events&&fe._events[B]?Array.isArray(fe._events[B])?fe._events[B].unshift(R):fe._events[B]=[R,fe._events[B]]:fe.on(B,R)}(fe,"error",hi),fe.once("close",Hr),fe.once("finish",Ns),fe.emit("pipe",R),k.flowing||(w("pipe resume"),R.resume()),fe},te.prototype.unpipe=function(fe){var B=this._readableState,R={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return fe&&fe!==B.pipes||(fe||(fe=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,fe&&fe.emit("unpipe",this,R)),this;if(!fe){var k=B.pipes,Oe=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Xe=0;Xe0,!1!==k.flowing&&this.resume()):"readable"===fe&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,w("on readable",k.length,k.reading),k.length?je(this):k.reading||q.nextTick(Be,this)),R},te.prototype.removeListener=function(fe,B){var R=b.prototype.removeListener.call(this,fe,B);return"readable"===fe&&q.nextTick(qe,this),R},te.prototype.removeAllListeners=function(fe){var B=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===fe||void 0===fe)&&q.nextTick(qe,this),B},te.prototype.resume=function(){var fe=this._readableState;return fe.flowing||(w("resume"),fe.flowing=!fe.readableListening,function(fe,B){B.resumeScheduled||(B.resumeScheduled=!0,q.nextTick(X,fe,B))}(this,fe)),fe.paused=!1,this},te.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},te.prototype.wrap=function(fe){var B=this,R=this._readableState,k=!1;for(var Oe in fe.on("end",function(){if(w("wrapped end"),R.decoder&&!R.ended){var yt=R.decoder.end();yt&&yt.length&&B.push(yt)}B.push(null)}),fe.on("data",function(yt){w("wrapped data"),R.decoder&&(yt=R.decoder.write(yt)),R.objectMode&&null==yt||!(R.objectMode||yt&&yt.length)||B.push(yt)||(k=!0,fe.pause())}),fe)void 0===this[Oe]&&"function"==typeof fe[Oe]&&(this[Oe]=function(It){return function(){return fe[It].apply(fe,arguments)}}(Oe));for(var Xe=0;Xe-1))throw new ie(ce);return this._writableState.defaultEncoding=ce,this},Object.defineProperty(me.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(me.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),me.prototype._write=function(be,ce,Pe){Pe(new Y("_write()"))},me.prototype._writev=null,me.prototype.end=function(be,ce,Pe){var wt=this._writableState;return"function"==typeof be?(Pe=be,be=null,ce=null):"function"==typeof ce&&(Pe=ce,ce=null),null!=be&&this.write(be,ce),wt.corked&&(wt.corked=1,this.uncork()),wt.ending||function(be,ce,Pe){ce.ending=!0,Be(be,ce),Pe&&(ce.finished?q.nextTick(Pe):be.once("finish",Pe)),ce.ended=!0,be.writable=!1}(this,wt,Pe),this},Object.defineProperty(me.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(ce){!this._writableState||(this._writableState.destroyed=ce)}}),me.prototype.destroy=w.destroy,me.prototype._undestroy=w.undestroy,me.prototype._destroy=function(be,ce){ce(be)}}).call(this)}).call(this,K("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(K,Ae,he){(function(q){(function(){"use strict";var V;function L(F,Q,E){return Q in F?Object.defineProperty(F,Q,{value:E,enumerable:!0,configurable:!0,writable:!0}):F[Q]=E,F}var re=K("./end-of-stream"),$=Symbol("lastResolve"),b=Symbol("lastReject"),S=Symbol("error"),O=Symbol("ended"),T=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function w(F,Q){return{value:F,done:Q}}function M(F){var Q=F[$];if(null!==Q){var E=F[y].read();null!==E&&(F[T]=null,F[$]=null,F[b]=null,Q(w(E,!1)))}}function j(F){q.nextTick(M,F)}var H=Object.getPrototypeOf(function(){}),Y=Object.setPrototypeOf((L(V={get stream(){return this[y]},next:function(){var Q=this,E=this[S];if(null!==E)return Promise.reject(E);if(this[O])return Promise.resolve(w(void 0,!0));if(this[y].destroyed)return new Promise(function(ee,se){q.nextTick(function(){Q[S]?se(Q[S]):ee(w(void 0,!0))})});var ie,U=this[T];if(U)ie=new Promise(function(F,Q){return function(E,U){F.then(function(){Q[O]?E(w(void 0,!0)):Q[v](E,U)},U)}}(U,this));else{var ue=this[y].read();if(null!==ue)return Promise.resolve(w(ue,!1));ie=new Promise(this[v])}return this[T]=ie,ie}},Symbol.asyncIterator,function(){return this}),L(V,"return",function(){var Q=this;return new Promise(function(E,U){Q[y].destroy(null,function(ie){ie?U(ie):E(w(void 0,!0))})})}),V),H);Ae.exports=function(Q){var E,U=Object.create(Y,(L(E={},y,{value:Q,writable:!0}),L(E,$,{value:null,writable:!0}),L(E,b,{value:null,writable:!0}),L(E,S,{value:null,writable:!0}),L(E,O,{value:Q._readableState.endEmitted,writable:!0}),L(E,v,{value:function(ue,ee){var se=U[y].read();se?(U[T]=null,U[$]=null,U[b]=null,ue(w(se,!1))):(U[$]=ue,U[b]=ee)},writable:!0}),E));return U[T]=null,re(Q,function(ie){if(ie&&"ERR_STREAM_PREMATURE_CLOSE"!==ie.code){var ue=U[b];return null!==ue&&(U[T]=null,U[$]=null,U[b]=null,ue(ie)),void(U[S]=ie)}var ee=U[$];null!==ee&&(U[T]=null,U[$]=null,U[b]=null,ee(w(void 0,!0))),U[O]=!0}),Q.on("readable",j.bind(null,U)),U}}).call(this)}).call(this,K("_process"))},{"./end-of-stream":76,_process:44}],74:[function(K,Ae,he){"use strict";function q(M,j){var I=Object.keys(M);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(M);j&&(H=H.filter(function(Y){return Object.getOwnPropertyDescriptor(M,Y).enumerable})),I.push.apply(I,H)}return I}function L(M,j,I){return j in M?Object.defineProperty(M,j,{value:I,enumerable:!0,configurable:!0,writable:!0}):M[j]=I,M}function $(M,j){for(var I=0;I0?this.tail.next=H:this.head=H,this.tail=H,++this.length}},{key:"unshift",value:function(I){var H={data:I,next:this.head};0===this.length&&(this.tail=H),this.head=H,++this.length}},{key:"shift",value:function(){if(0!==this.length){var I=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,I}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(I){if(0===this.length)return"";for(var H=this.head,Y=""+H.data;H=H.next;)Y+=I+H.data;return Y}},{key:"concat",value:function(I){if(0===this.length)return O.alloc(0);for(var H=O.allocUnsafe(I>>>0),Y=this.head,D=0;Y;)w(Y.data,H,D),D+=Y.data.length,Y=Y.next;return H}},{key:"consume",value:function(I,H){var Y;return IF.length?F.length:I;if(D+=Q===F.length?F:F.slice(0,I),0==(I-=Q)){Q===F.length?(++Y,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=F.slice(Q));break}++Y}return this.length-=Y,D}},{key:"_getBuffer",value:function(I){var H=O.allocUnsafe(I),Y=this.head,D=1;for(Y.data.copy(H),I-=Y.data.length;Y=Y.next;){var F=Y.data,Q=I>F.length?F.length:I;if(F.copy(H,H.length-I,0,Q),0==(I-=Q)){Q===F.length?(++D,this.head=Y.next?Y.next:this.tail=null):(this.head=Y,Y.data=F.slice(Q));break}++D}return this.length-=D,H}},{key:y,value:function(I,H){return v(this,function(M){for(var j=1;j0,function(ie){Y||(Y=ie),ie&&D.forEach(T),!E&&(D.forEach(T),H(Y))})});return j.reduce(v)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(K,Ae,he){"use strict";var q=K("../../../errors").codes.ERR_INVALID_OPT_VALUE;Ae.exports={getHighWaterMark:function(re,$,b,S){var O=function(re,$,b){return null!=re.highWaterMark?re.highWaterMark:$?re[b]:null}($,S,b);if(null!=O){if(!isFinite(O)||Math.floor(O)!==O||O<0)throw new q(S?b:"highWaterMark",O);return Math.floor(O)}return re.objectMode?16:16384}}},{"../../../errors":67}],80:[function(K,Ae,he){Ae.exports=K("events").EventEmitter},{events:8}],81:[function(K,Ae,he){(he=Ae.exports=K("./lib/_stream_readable.js")).Stream=he,he.Readable=he,he.Writable=K("./lib/_stream_writable.js"),he.Duplex=K("./lib/_stream_duplex.js"),he.Transform=K("./lib/_stream_transform.js"),he.PassThrough=K("./lib/_stream_passthrough.js"),he.finished=K("./lib/internal/streams/end-of-stream.js"),he.pipeline=K("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(V){for(var L in V)he.hasOwnProperty(L)||(he[L]=V[L])}(K("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(K,Ae,he){"use strict";function V($){const b=[];let S=0;for(;S<$.length;)switch($[S]){case"/":if("."===$[S+1])if("."===$[S+2]){if(!re($[S+3])){b.push([]),S++;break}b.pop(),$[S+3]||b.push([]),S+=3}else{if(!re($[S+2])){b.push([]),S++;break}$[S+2]||b.push([]),S+=2}else b.push([]),S++;break;case"#":case"?":b.length||b.push([]),b[b.length-1].push($.substr(S)),S=$.length;break;default:b.length||b.push([]),b[b.length-1].push($[S]),S++}return"/"+b.map(O=>O.join("")).join("/")}function L($,b){let S=b+1;b>=0?"/"===$[b+1]&&"/"===$[b+2]&&(S=b+3):"/"===$[0]&&"/"===$[1]&&(S=2);const O=$.indexOf("/",S);return O<0?$:$.substr(0,O)+V($.substr(O))}function re($){return!$||"#"===$||"?"===$||"/"===$}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function($,b){const S=(b=b||"").indexOf("#");if(S>0&&(b=b.substr(0,S)),!$.length){if(b.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);return b}if($.startsWith("?")){const j=b.indexOf("?");return j>0&&(b=b.substr(0,j)),b+$}if($.startsWith("#"))return b+$;if(!b.length){const j=$.indexOf(":");if(j<0)throw new Error(`Found invalid relative IRI '${$}' for a missing baseIRI`);return L($,j)}const O=$.indexOf(":");if(O>=0)return L($,O);const T=b.indexOf(":");if(T<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);const v=b.substr(0,T+1);if(0===$.indexOf("//"))return v+L($,O);let y;if(b.indexOf("//",T)===T+1){if(y=b.indexOf("/",T+3),y<0)return b.length>T+3?b+"/"+L($,O):v+L($,O)}else if(y=b.indexOf("/",T+1),y<0)return v+L($,O);if(0===$.indexOf("/"))return b.substr(0,y)+V($);let w=b.substr(y);const M=w.lastIndexOf("/");return M>=0&&M"===ce?(te(X,"onsgmldeclaration",X.sgmlDecl),X.sgmlDecl="",X.state=se.TEXT):(U(ce)&&(X.state=se.SGML_DECL_QUOTED),X.sgmlDecl+=ce);continue;case se.SGML_DECL_QUOTED:ce===X.q&&(X.state=se.SGML_DECL,X.q=""),X.sgmlDecl+=ce;continue;case se.DOCTYPE:">"===ce?(X.state=se.TEXT,te(X,"ondoctype",X.doctype),X.doctype=!0):(X.doctype+=ce,"["===ce?X.state=se.DOCTYPE_DTD:U(ce)&&(X.state=se.DOCTYPE_QUOTED,X.q=ce));continue;case se.DOCTYPE_QUOTED:X.doctype+=ce,ce===X.q&&(X.q="",X.state=se.DOCTYPE);continue;case se.DOCTYPE_DTD:X.doctype+=ce,"]"===ce?X.state=se.DOCTYPE:U(ce)&&(X.state=se.DOCTYPE_DTD_QUOTED,X.q=ce);continue;case se.DOCTYPE_DTD_QUOTED:X.doctype+=ce,ce===X.q&&(X.state=se.DOCTYPE_DTD,X.q="");continue;case se.COMMENT:"-"===ce?X.state=se.COMMENT_ENDING:X.comment+=ce;continue;case se.COMMENT_ENDING:"-"===ce?(X.state=se.COMMENT_ENDED,X.comment=De(X.opt,X.comment),X.comment&&te(X,"oncomment",X.comment),X.comment=""):(X.comment+="-"+ce,X.state=se.COMMENT);continue;case se.COMMENT_ENDED:">"!==ce?(Ze(X,"Malformed comment"),X.comment+="--"+ce,X.state=se.COMMENT):X.state=se.TEXT;continue;case se.CDATA:"]"===ce?X.state=se.CDATA_ENDING:X.cdata+=ce;continue;case se.CDATA_ENDING:"]"===ce?X.state=se.CDATA_ENDING_2:(X.cdata+="]"+ce,X.state=se.CDATA);continue;case se.CDATA_ENDING_2:">"===ce?(X.cdata&&te(X,"oncdata",X.cdata),te(X,"onclosecdata"),X.cdata="",X.state=se.TEXT):"]"===ce?X.cdata+="]":(X.cdata+="]]"+ce,X.state=se.CDATA);continue;case se.PROC_INST:"?"===ce?X.state=se.PROC_INST_ENDING:E(ce)?X.state=se.PROC_INST_BODY:X.procInstName+=ce;continue;case se.PROC_INST_BODY:if(!X.procInstBody&&E(ce))continue;"?"===ce?X.state=se.PROC_INST_ENDING:X.procInstBody+=ce;continue;case se.PROC_INST_ENDING:">"===ce?(te(X,"onprocessinginstruction",{name:X.procInstName,body:X.procInstBody}),X.procInstName=X.procInstBody="",X.state=se.TEXT):(X.procInstBody+="?"+ce,X.state=se.PROC_INST_BODY);continue;case se.OPEN_TAG:ue(D,ce)?X.tagName+=ce:(Je(X),">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:(E(ce)||Ze(X,"Invalid character in tag name"),X.state=se.ATTRIB));continue;case se.OPEN_TAG_SLASH:">"===ce?(Le(X,!0),Ee(X)):(Ze(X,"Forward-slash in opening tag not followed by >"),X.state=se.ATTRIB);continue;case se.ATTRIB:if(E(ce))continue;">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(Y,ce)?(X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME:"="===ce?X.state=se.ATTRIB_VALUE:">"===ce?(Ze(X,"Attribute without value"),X.attribValue=X.attribName,je(X),Le(X)):E(ce)?X.state=se.ATTRIB_NAME_SAW_WHITE:ue(D,ce)?X.attribName+=ce:Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME_SAW_WHITE:if("="===ce)X.state=se.ATTRIB_VALUE;else{if(E(ce))continue;Ze(X,"Attribute without value"),X.tag.attributes[X.attribName]="",X.attribValue="",te(X,"onattribute",{name:X.attribName,value:""}),X.attribName="",">"===ce?Le(X):ue(Y,ce)?(X.attribName=ce,X.state=se.ATTRIB_NAME):(Ze(X,"Invalid attribute name"),X.state=se.ATTRIB)}continue;case se.ATTRIB_VALUE:if(E(ce))continue;U(ce)?(X.q=ce,X.state=se.ATTRIB_VALUE_QUOTED):(Ze(X,"Unquoted attribute value"),X.state=se.ATTRIB_VALUE_UNQUOTED,X.attribValue=ce);continue;case se.ATTRIB_VALUE_QUOTED:if(ce!==X.q){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_Q:X.attribValue+=ce;continue}je(X),X.q="",X.state=se.ATTRIB_VALUE_CLOSED;continue;case se.ATTRIB_VALUE_CLOSED:E(ce)?X.state=se.ATTRIB:">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(Y,ce)?(Ze(X,"No whitespace between attributes"),X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_VALUE_UNQUOTED:if(!ie(ce)){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_U:X.attribValue+=ce;continue}je(X),">"===ce?Le(X):X.state=se.ATTRIB;continue;case se.CLOSE_TAG:if(X.tagName)">"===ce?Ee(X):ue(D,ce)?X.tagName+=ce:X.script?(X.script+=""===ce?Ee(X):Ze(X,"Invalid characters in closing tag");continue;case se.TEXT_ENTITY:case se.ATTRIB_VALUE_ENTITY_Q:case se.ATTRIB_VALUE_ENTITY_U:var pt,fe;switch(X.state){case se.TEXT_ENTITY:pt=se.TEXT,fe="textNode";break;case se.ATTRIB_VALUE_ENTITY_Q:pt=se.ATTRIB_VALUE_QUOTED,fe="attribValue";break;case se.ATTRIB_VALUE_ENTITY_U:pt=se.ATTRIB_VALUE_UNQUOTED,fe="attribValue"}";"===ce?(X[fe]+=Re(X),X.entity="",X.state=pt):ue(X.entity.length?Q:F,ce)?X.entity+=ce:(Ze(X,"Invalid character in entity name"),X[fe]+="&"+X.entity+ce,X.entity="",X.state=pt);continue;default:throw new Error(X,"Unknown state: "+X.state)}return X.position>=X.bufferCheckPosition&&function(z){for(var X=Math.max(V.MAX_BUFFER_LENGTH,10),be=0,ce=0,Pe=L.length;ceX)switch(L[ce]){case"textNode":ye(z);break;case"cdata":te(z,"oncdata",z.cdata),z.cdata="";break;case"script":te(z,"onscript",z.script),z.script="";break;default:Ve(z,"Max buffer length exceeded: "+L[ce])}be=Math.max(be,wt)}z.bufferCheckPosition=V.MAX_BUFFER_LENGTH-be+z.position}(X),X},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(z){ye(z),""!==z.cdata&&(te(z,"oncdata",z.cdata),z.cdata=""),""!==z.script&&(te(z,"onscript",z.script),z.script="")}(this)}};try{O=K("stream").Stream}catch(z){O=function(){}}var T=V.EVENTS.filter(function(z){return"error"!==z&&"end"!==z});function y(z,X){if(!(this instanceof y))return new y(z,X);O.apply(this),this._parser=new re(z,X),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ce){be.emit("error",ce),be._parser.error=null},this._decoder=null,T.forEach(function(ce){Object.defineProperty(be,"on"+ce,{get:function(){return be._parser["on"+ce]},set:function(Pe){if(!Pe)return be.removeAllListeners(ce),be._parser["on"+ce]=Pe,Pe;be.on(ce,Pe)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(O.prototype,{constructor:{value:y}})).write=function(z){if("function"==typeof q&&"function"==typeof q.isBuffer&&q.isBuffer(z)){if(!this._decoder){var X=K("string_decoder").StringDecoder;this._decoder=new X("utf8")}z=this._decoder.write(z)}return this._parser.write(z.toString()),this.emit("data",z),!0},y.prototype.end=function(z){return z&&z.length&&this.write(z),this._parser.end(),!0},y.prototype.on=function(z,X){var be=this;return!be._parser["on"+z]&&-1!==T.indexOf(z)&&(be._parser["on"+z]=function(){var ce=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ce.splice(0,0,z),be.emit.apply(be,ce)}),O.prototype.on.call(be,z,X)};var j="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",H={xml:j,xmlns:I},Y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(z){return" "===z||"\n"===z||"\r"===z||"\t"===z}function U(z){return'"'===z||"'"===z}function ie(z){return">"===z||E(z)}function ue(z,X){return z.test(X)}function ee(z,X){return!ue(z,X)}var z,X,be,se=0;for(var Te in V.STATE={BEGIN:se++,BEGIN_WHITESPACE:se++,TEXT:se++,TEXT_ENTITY:se++,OPEN_WAKA:se++,SGML_DECL:se++,SGML_DECL_QUOTED:se++,DOCTYPE:se++,DOCTYPE_QUOTED:se++,DOCTYPE_DTD:se++,DOCTYPE_DTD_QUOTED:se++,COMMENT_STARTING:se++,COMMENT:se++,COMMENT_ENDING:se++,COMMENT_ENDED:se++,CDATA:se++,CDATA_ENDING:se++,CDATA_ENDING_2:se++,PROC_INST:se++,PROC_INST_BODY:se++,PROC_INST_ENDING:se++,OPEN_TAG:se++,OPEN_TAG_SLASH:se++,ATTRIB:se++,ATTRIB_NAME:se++,ATTRIB_NAME_SAW_WHITE:se++,ATTRIB_VALUE:se++,ATTRIB_VALUE_QUOTED:se++,ATTRIB_VALUE_CLOSED:se++,ATTRIB_VALUE_UNQUOTED:se++,ATTRIB_VALUE_ENTITY_Q:se++,ATTRIB_VALUE_ENTITY_U:se++,CLOSE_TAG:se++,CLOSE_TAG_SAW_WHITE:se++,SCRIPT:se++,SCRIPT_ENDING:se++},V.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(V.ENTITIES).forEach(function(z){var X=V.ENTITIES[z],be="number"==typeof X?String.fromCharCode(X):X;V.ENTITIES[z]=be}),V.STATE)V.STATE[V.STATE[Te]]=Te;function me(z,X,be){z[X]&&z[X](be)}function te(z,X,be){z.textNode&&ye(z),me(z,X,be)}function ye(z){z.textNode=De(z.opt,z.textNode),z.textNode&&me(z,"ontext",z.textNode),z.textNode=""}function De(z,X){return z.trim&&(X=X.trim()),z.normalize&&(X=X.replace(/\s+/g," ")),X}function Ve(z,X){return ye(z),z.trackPosition&&(X+="\nLine: "+z.line+"\nColumn: "+z.column+"\nChar: "+z.c),X=new Error(X),z.error=X,me(z,"onerror",X),z}function nt(z){return z.sawRoot&&!z.closedRoot&&Ze(z,"Unclosed root tag"),z.state!==se.BEGIN&&z.state!==se.BEGIN_WHITESPACE&&z.state!==se.TEXT&&Ve(z,"Unexpected end"),ye(z),z.c="",z.closed=!0,me(z,"onend"),re.call(z,z.strict,z.opt),z}function Ze(z,X){if("object"!=typeof z||!(z instanceof re))throw new Error("bad call to strictFail");z.strict&&Ve(z,X)}function Je(z){z.strict||(z.tagName=z.tagName[z.looseCase]());var X=z.tags[z.tags.length-1]||z,be=z.tag={name:z.tagName,attributes:{}};z.opt.xmlns&&(be.ns=X.ns),z.attribList.length=0,te(z,"onopentagstart",be)}function Ye(z,X){var ce=z.indexOf(":")<0?["",z]:z.split(":"),Pe=ce[0],wt=ce[1];return X&&"xmlns"===z&&(Pe="xmlns",wt=""),{prefix:Pe,local:wt}}function je(z){if(z.strict||(z.attribName=z.attribName[z.looseCase]()),-1!==z.attribList.indexOf(z.attribName)||z.tag.attributes.hasOwnProperty(z.attribName))z.attribName=z.attribValue="";else{if(z.opt.xmlns){var X=Ye(z.attribName,!0),ce=X.local;if("xmlns"===X.prefix)if("xml"===ce&&z.attribValue!==j)Ze(z,"xml: prefix must be bound to "+j+"\nActual: "+z.attribValue);else if("xmlns"===ce&&z.attribValue!==I)Ze(z,"xmlns: prefix must be bound to "+I+"\nActual: "+z.attribValue);else{var Pe=z.tag,wt=z.tags[z.tags.length-1]||z;Pe.ns===wt.ns&&(Pe.ns=Object.create(wt.ns)),Pe.ns[ce]=z.attribValue}z.attribList.push([z.attribName,z.attribValue])}else z.tag.attributes[z.attribName]=z.attribValue,te(z,"onattribute",{name:z.attribName,value:z.attribValue});z.attribName=z.attribValue=""}}function Le(z,X){if(z.opt.xmlns){var be=z.tag,ce=Ye(z.tagName);be.prefix=ce.prefix,be.local=ce.local,be.uri=be.ns[ce.prefix]||"",be.prefix&&!be.uri&&(Ze(z,"Unbound namespace prefix: "+JSON.stringify(z.tagName)),be.uri=ce.prefix),be.ns&&(z.tags[z.tags.length-1]||z).ns!==be.ns&&Object.keys(be.ns).forEach(function(Tn){te(z,"onopennamespace",{prefix:Tn,uri:be.ns[Tn]})});for(var wt=0,pt=z.attribList.length;wt",z.tagName="",void(z.state=se.SCRIPT);te(z,"onscript",z.script),z.script=""}var X=z.tags.length,be=z.tagName;z.strict||(be=be[z.looseCase]());for(var ce=be;X--&&z.tags[X].name!==ce;)Ze(z,"Unexpected close tag");if(X<0)return Ze(z,"Unmatched closing tag: "+z.tagName),z.textNode+="",void(z.state=se.TEXT);z.tagName=be;for(var wt=z.tags.length;wt-- >X;){var pt=z.tag=z.tags.pop();z.tagName=z.tag.name,te(z,"onclosetag",z.tagName);var fe={};for(var B in pt.ns)fe[B]=pt.ns[B];z.opt.xmlns&&pt.ns!==(z.tags[z.tags.length-1]||z).ns&&Object.keys(pt.ns).forEach(function(k){te(z,"onclosenamespace",{prefix:k,uri:pt.ns[k]})})}0===X&&(z.closedRoot=!0),z.tagName=z.attribValue=z.attribName="",z.attribList.length=0,z.state=se.TEXT}function Re(z){var ce,X=z.entity,be=X.toLowerCase(),Pe="";return z.ENTITIES[X]?z.ENTITIES[X]:z.ENTITIES[be]?z.ENTITIES[be]:("#"===(X=be).charAt(0)&&("x"===X.charAt(1)?(X=X.slice(2),Pe=(ce=parseInt(X,16)).toString(16)):(X=X.slice(1),Pe=(ce=parseInt(X,10)).toString(10))),X=X.replace(/^0+/,""),isNaN(ce)||Pe.toLowerCase()!==X?(Ze(z,"Invalid character entity"),"&"+z.entity+";"):String.fromCodePoint(ce))}function Ue(z,X){"<"===X?(z.state=se.OPEN_WAKA,z.startTagPosition=z.position):E(X)||(Ze(z,"Non-whitespace before first tag."),z.textNode=X,z.state=se.TEXT)}function qe(z,X){var be="";return X1114111||X(k)!==k)throw RangeError("Invalid code point: "+k);k<=65535?Pe.push(k):Pe.push(55296+((k-=65536)>>10),k%1024+56320),(fe+1===B||Pe.length>ce)&&(R+=z.apply(null,Pe),Pe.length=0)}return R},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,K("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(K,Ae,he){(function(q,V){(function(){!function(L,re){"use strict";if(!L.setImmediate){var T,$=1,b={},S=!1,O=L.document,Q=Object.getPrototypeOf&&Object.getPrototypeOf(L);Q=Q&&Q.setTimeout?Q:L,"[object process]"==={}.toString.call(L.process)?T=function(E){q.nextTick(function(){M(E)})}:function(){if(L.postMessage&&!L.importScripts){var E=!0,U=L.onmessage;return L.onmessage=function(){E=!1},L.postMessage("","*"),L.onmessage=U,E}}()?(E="setImmediate$"+Math.random()+"$",U=function(ie){ie.source===L&&"string"==typeof ie.data&&0===ie.data.indexOf(E)&&M(+ie.data.slice(E.length))},L.addEventListener?L.addEventListener("message",U,!1):L.attachEvent("onmessage",U),T=function(ie){L.postMessage(E+ie,"*")}):L.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function(U){M(U.data)},T=function(U){E.port2.postMessage(U)}}():O&&"onreadystatechange"in O.createElement("script")?function(){var E=O.documentElement;T=function(U){var ie=O.createElement("script");ie.onreadystatechange=function(){M(U),ie.onreadystatechange=null,E.removeChild(ie),ie=null},E.appendChild(ie)}}():T=function(E){setTimeout(M,0,E)},Q.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var U=new Array(arguments.length-1),ie=0;ie=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},v))},he.setImmediate="function"==typeof q?q:function(T){var v=S++,y=!(arguments.length<2)&&$.call(arguments,1);return b[v]=!0,L(function(){b[v]&&(y?T.apply(null,y):T.call(null),he.clearImmediate(v))}),v},he.clearImmediate="function"==typeof V?V:function(T){delete b[T]}}).call(this)}).call(this,K("timers").setImmediate,K("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(K,Ae,he){(function(q){(function(){function L(re){try{if(!q.localStorage)return!1}catch(b){return!1}var $=q.localStorage[re];return null!=$&&"true"===String($).toLowerCase()}Ae.exports=function(re,$){if(L("noDeprecation"))return re;var b=!1;return function(){if(!b){if(L("throwDeprecation"))throw new Error($);L("traceDeprecation")?console.trace($):console.warn($),b=!0}return re.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(K,Ae,he){"use strict";Ae.exports=function(q){q.prototype[Symbol.iterator]=function*(){for(let V=this.head;V;V=V.next)yield V.value}}},{}],92:[function(K,Ae,he){"use strict";function q(b){var S=this;if(S instanceof q||(S=new q),S.tail=null,S.head=null,S.length=0,b&&"function"==typeof b.forEach)b.forEach(function(v){S.push(v)});else if(arguments.length>0)for(var O=0,T=arguments.length;O1)O=S;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");T=this.head.next,O=this.head.value}for(var v=0;null!==T;v++)O=b(O,T.value,v),T=T.next;return O},q.prototype.reduceReverse=function(b,S){var O,T=this.tail;if(arguments.length>1)O=S;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");T=this.tail.prev,O=this.tail.value}for(var v=this.length-1;null!==T;v--)O=b(O,T.value,v),T=T.prev;return O},q.prototype.toArray=function(){for(var b=new Array(this.length),S=0,O=this.head;null!==O;S++)b[S]=O.value,O=O.next;return b},q.prototype.toArrayReverse=function(){for(var b=new Array(this.length),S=0,O=this.tail;null!==O;S++)b[S]=O.value,O=O.prev;return b},q.prototype.slice=function(b,S){(S=S||this.length)<0&&(S+=this.length),(b=b||0)<0&&(b+=this.length);var O=new q;if(Sthis.length&&(S=this.length);for(var T=0,v=this.head;null!==v&&Tthis.length&&(S=this.length);for(var T=this.length,v=this.tail;null!==v&&T>S;T--)v=v.prev;for(;null!==v&&T>b;T--,v=v.prev)O.push(v.value);return O},q.prototype.splice=function(b,S,...O){b>this.length&&(b=this.length-1),b<0&&(b=this.length+b);for(var T=0,v=this.head;null!==v&&T{kt.exports=function(tt,gt){var J=gt.length;if(0!==J){var At=tt.length;tt.length+=J;for(var dt=0;dt{"use strict";var gt=(()=>{return(At=gt||(gt={})).typeOfFunction="function",At.boolTrue=!0,gt;var At})();function J(At,dt,K){if(!K||typeof K.value!==gt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:gt.boolTrue,get:function(){var Ae=K.value.bind(this);return Object.defineProperty(this,dt,{value:Ae,configurable:gt.boolTrue,writable:gt.boolTrue}),Ae}}}it.ak=J,it.ZP=J},266:(kt,it,tt)=>{kt.exports={ResizeSensor:tt(835),ElementQueries:tt(845)}},845:function(kt,it,tt){"use strict";var gt,J,At;"undefined"!=typeof window&&window,J=[tt(835)],void 0!==(At="function"==typeof(gt=function(dt){var K=function(){var he,q={},V=[];function L(D){D||(D=document.documentElement);var F=window.getComputedStyle(D,null).fontSize;return parseFloat(F)||16}function $(D,F){var Q=F.split(/\d/),E=Q[Q.length-1];switch(F=parseFloat(F),E){case"px":return F;case"em":return F*L(D);case"rem":return F*L();case"vw":return F*document.documentElement.clientWidth/100;case"vh":return F*document.documentElement.clientHeight/100;case"vmin":case"vmax":var U=document.documentElement.clientWidth/100,ie=document.documentElement.clientHeight/100;return F*(0,Math["vmin"===E?"min":"max"])(U,ie);default:return F}}function b(D,F){this.element=D;var Q,E,U,ie,ue,ee,se,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(Q in U=function(D){if(!D.getBoundingClientRect)return{width:D.offsetWidth,height:D.offsetHeight};var F=D.getBoundingClientRect();return{width:Math.round(F.width),height:Math.round(F.height)}}(this.element),ee={},q[F])!q[F].hasOwnProperty(Q)||(ie=$(this.element,(E=q[F][Q]).value),ue="width"===E.property?U.width:U.height,se="","min"===E.mode&&ue>=ie&&(se+=E.value),"max"===E.mode&&ue<=ie&&(se+=E.value),ee[Te=E.mode+"-"+E.property]||(ee[Te]=""),se&&-1===(" "+ee[Te]+" ").indexOf(" "+se+" ")&&(ee[Te]+=" "+se));for(var te in me)!me.hasOwnProperty(te)||(ee[me[te]]?this.element.setAttribute(me[te],ee[me[te]].substr(1)):this.element.removeAttribute(me[te]))}}function S(D,F){D.elementQueriesSetupInformation||(D.elementQueriesSetupInformation=new b(D,F)),D.elementQueriesSensor||(D.elementQueriesSensor=new dt(D,function(){D.elementQueriesSetupInformation.call()}))}function O(D,F,Q,E){if(void 0===q[D]){q[D]=[];var U=V.length;he.innerHTML+="\n"+D+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+D+" > .resize-sensor {min-width: "+U+"px;}",V.push(D)}q[D].push({mode:F,property:Q,value:E})}function T(D){var F;if(document.querySelectorAll&&(F=D?D.querySelectorAll.bind(D):document.querySelectorAll.bind(document)),!F&&"undefined"!=typeof $$&&(F=$$),!F&&"undefined"!=typeof jQuery&&(F=jQuery),!F)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return F}function y(D){var F=[],Q=[],E=[],U=0,ie=-1,ue=[];for(var ee in D.children)if(D.children.hasOwnProperty(ee)&&D.children[ee].tagName&&"img"===D.children[ee].tagName.toLowerCase()){F.push(D.children[ee]);var se=D.children[ee].getAttribute("min-width")||D.children[ee].getAttribute("data-min-width"),Te=D.children[ee].getAttribute("data-src")||D.children[ee].getAttribute("url");E.push(Te),Q.push({minWidth:se}),se?D.children[ee].style.display="none":(U=F.length-1,D.children[ee].style.display="block")}function te(){var De,ye=!1;for(De in F)!F.hasOwnProperty(De)||Q[De].minWidth&&D.offsetWidth>Q[De].minWidth&&(ye=De);if(ye||(ye=U),ie!==ye)if(ue[ye])F[ie].style.display="none",F[ye].style.display="block",ie=ye;else{var Ve=new Image;Ve.onload=function(){F[ye].src=E[ye],F[ie].style.display="none",F[ye].style.display="block",ue[ye]=!0,ie=ye},Ve.src=E[ye]}else F[ye].src=E[ye]}ie=U,D.resizeSensorInstance=new dt(D,te),te()}var M=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,j=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function I(D){var F,Q,E,U;for(D=D.replace(/'/g,'"');null!==(F=M.exec(D));)for(Q=F[1]+F[3],E=F[2];null!==(U=j.exec(E));)O(Q,U[1],U[2],U[3])}function H(D){var F="";if(D)if("string"==typeof D)(-1!==(D=D.toLowerCase()).indexOf("min-width")||-1!==D.indexOf("max-width"))&&I(D);else for(var Q=0,E=D.length;Q img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",he.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(he),Y=!0);for(var F=0,Q=document.styleSheets.length;F{var gt=tt(910),J=tt(369),At=tt(322);function dt(re,$,b){if(!gt(re))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!re.hasNode($))throw new Error('graphology-shortest-path: the "'+$+'" source node does not exist in the given graph.');if(!re.hasNode(b))throw new Error('graphology-shortest-path: the "'+b+'" target node does not exist in the given graph.');if(($=""+$)==(b=""+b))return[$];var S=re.inboundNeighbors.bind(re),O=re.outboundNeighbors.bind(re),T={},v={};T[$]=null,v[b]=null;var M,j,I,H,Y,D,F,Q,y=[$],w=[b],E=!1;e:for(;y.length&&w.length;)if(y.length<=w.length){for(M=y,y=[],Y=0,F=M.length;Y{kt.exports=function(tt){return null!==tt&&"object"==typeof tt&&"function"==typeof tt.addUndirectedEdgeWithKey&&"function"==typeof tt.dropNode&&"boolean"==typeof tt.multi}},698:function(kt){kt.exports=function(){"use strict";function it(ne){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(de){return typeof de}:function(de){return de&&"function"==typeof Symbol&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de})(ne)}function tt(ne,de){ne.prototype=Object.create(de.prototype),ne.prototype.constructor=ne,J(ne,de)}function gt(ne){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)})(ne)}function J(ne,de){return(J=Object.setPrototypeOf||function(oe,C){return oe.__proto__=C,oe})(ne,de)}function At(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(ne){return!1}}function dt(ne,de,oe){return(dt=At()?Reflect.construct:function(C,P,Z){var we=[null];we.push.apply(we,P);var Fe=new(Function.bind.apply(C,we));return Z&&J(Fe,Z.prototype),Fe}).apply(null,arguments)}function K(ne){var de="function"==typeof Map?new Map:void 0;return(K=function(oe){if(null===oe||-1===Function.toString.call(oe).indexOf("[native code]"))return oe;if("function"!=typeof oe)throw new TypeError("Super expression must either be null or a function");if(void 0!==de){if(de.has(oe))return de.get(oe);de.set(oe,P)}function P(){return dt(oe,arguments,gt(this).constructor)}return P.prototype=Object.create(oe.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),J(P,oe)})(ne)}function Ae(ne){if(void 0===ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ne}var he=function(){for(var ne=arguments[0],de=1,oe=arguments.length;de0&&we.length>P&&!we.warned){we.warned=!0;var et=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(de)+" listeners added. Use emitter.setMaxListeners() to increase limit");et.name="MaxListenersExceededWarning",et.emitter=ne,et.type=de,et.count=we.length,console&&console.warn&&console.warn(et)}return ne}function D(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F(ne,de,oe){var C={fired:!1,wrapFn:void 0,target:ne,type:de,listener:oe},P=D.bind(C);return P.listener=oe,C.wrapFn=P,P}function Q(ne,de,oe){var C=ne._events;if(void 0===C)return[];var P=C[de];return void 0===P?[]:"function"==typeof P?oe?[P.listener||P]:[P]:oe?function(Z){for(var we=new Array(Z.length),Fe=0;Fe0&&(Z=de[0]),Z instanceof Error)throw Z;var we=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw we.context=Z,we}var Fe=P[ne];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,de);else{var et=Fe.length,Dt=U(Fe,et);for(oe=0;oe=0;Z--)if(oe[Z]===de||oe[Z].listener===de){we=oe[Z].listener,P=Z;break}if(P<0)return this;0===P?oe.shift():function(Fe,et){for(;et+1=0;C--)this.removeListener(ne,de[C]);return this},M.prototype.listeners=function(ne){return Q(this,ne,!0)},M.prototype.rawListeners=function(ne){return Q(this,ne,!1)},M.listenerCount=function(ne,de){return"function"==typeof ne.listenerCount?ne.listenerCount(de):E.call(ne,de)},M.prototype.listenerCount=E,M.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]},ue.prototype.next=function(){if(this.done)return{done:!0};var ne=this._next();return ne.done&&(this.done=!0),ne},"undefined"!=typeof Symbol&&(ue.prototype[Symbol.iterator]=function(){return this}),ue.of=function(){var ne=arguments,de=ne.length,oe=0;return new ue(function(){return oe>=de?{done:!0}:{done:!1,value:ne[oe++]}})},ue.empty=function(){var ne=new ue(null);return ne.done=!0,ne},ue.is=function(ne){return ne instanceof ue||"object"==typeof ne&&null!==ne&&"function"==typeof ne.next};var ee=ue,se=function(ne,de){for(var oe,C=arguments.length>1?de:1/0,P=C!==1/0?new Array(C):[],Z=0;;){if(Z===C)return P;if((oe=ne.next()).done)return Z!==de?P.slice(0,Z):P;P[Z++]=oe.value}},Te=function(ne){function de(oe,C){var P;return(P=ne.call(this)||this).name="GraphError",P.message=oe||"",P.data=C||{},P}return tt(de,ne),de}(K(Error)),me=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),te=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),ye=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te);function De(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ve(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function nt(ne,de){this.key=ne,this.attributes=de,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Ze(ne,de,oe,C,P,Z){this.key=de,this.attributes=Z,this.undirected=ne,this.source=C,this.target=P,this.generatedKey=oe}function Je(ne,de,oe,C,P,Z,we){var Fe,et,Dt="out",We="in";if(de&&(Dt=We="undirected"),ne.multi){if(void 0===(et=(Fe=Z[Dt])[P])&&(et=new Set,Fe[P]=et),et.add(oe),C===P&&de)return;void 0===(Fe=we[We])[C]&&(Fe[C]=et)}else{if(Z[Dt][P]=oe,C===P&&de)return;we[We][C]=oe}}function Ye(ne,de,oe){var C=ne.multi,P=oe.source,Z=oe.target,we=P.key,Fe=Z.key,et=P[de?"undirected":"out"],Dt=de?"undirected":"in";if(Fe in et)if(C){var We=et[Fe];1===We.size?(delete et[Fe],delete Z[Dt][we]):We.delete(oe)}else delete et[Fe];C||delete Z[Dt][we]}Ve.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},nt.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var je=[{name:function(ne){return"get".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes[P]}}},{name:function(ne){return"get".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C){var P;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Z=""+C,we=""+arguments[1];if(!(P=q(this,Z,we,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Z,'" - "').concat(we,'").'))}else if(!(P=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&P.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return P.attributes}}},{name:function(ne){return"has".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes.hasOwnProperty(P)}}},{name:function(ne){return"set".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=q(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"update".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=q(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("function"!=typeof Z)throw new me("Graph.".concat(de,": updater should be a function."));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z(we.attributes[P]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"remove".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return delete Z.attributes[P],this.emit("edgeAttributesUpdated",{key:Z.key,type:"remove",attributes:Z.attributes,name:P}),this}}},{name:function(ne){return"replace".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes=P,this.emit("edgeAttributesUpdated",{key:Z.key,type:"replace",attributes:Z.attributes}),this}}},{name:function(ne){return"merge".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return he(Z.attributes,P),this.emit("edgeAttributesUpdated",{key:Z.key,type:"merge",attributes:Z.attributes,data:P}),this}}}],Le=ee,Ee=function(){var ne,de=arguments,oe=-1;return new Le(function C(){if(!ne){if(++oe>=de.length)return{done:!0};ne=de[oe]}var P=ne.next();return P.done?(ne=null,C()):P})},Re=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Ue(ne,de){for(var oe in de)ne.push(de[oe].key)}function qe(ne,de){for(var oe in de)de[oe].forEach(function(C){return ne.push(C.key)})}function Be(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)}}function z(ne,de,oe){for(var C in ne)C!==oe&&ne[C].forEach(function(P){return de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function X(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];if(de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey))return!0}return!1}function be(ne,de,oe){var C,P,Z,we,Fe;for(var et in ne)if(et!==oe)for(C=ne[et].values();!0!==(P=C.next()).done;)if(we=(Z=P.value).source,de(Z.key,Z.attributes,we.key,(Fe=Z.target).key,we.attributes,Fe.attributes,Z.undirected,Z.generatedKey))return!0;return!1}function ce(ne,de){var oe=Object.keys(ne),C=oe.length,P=null,Z=0;return new ee(function we(){var Fe;if(P){var et=P.next();if(et.done)return P=null,Z++,we();Fe=et.value}else{if(Z>=C)return{done:!0};var Dt=oe[Z];if(Dt===de)return Z++,we();if((Fe=ne[Dt])instanceof Set)return P=Fe.values(),we();Z++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function Pe(ne,de,oe){var C=de[oe];C&&ne.push(C.key)}function wt(ne,de,oe){var C=de[oe];C&&C.forEach(function(P){return ne.push(P.key)})}function pt(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function fe(ne,de,oe){var C=ne[de];C&&C.forEach(function(P){return oe(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function B(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;return oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function R(ne,de,oe){var C=ne[de];if(C){for(var P,Z,we=C.values();!0!==(P=we.next()).done;)if(oe((Z=P.value).key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes,Z.undirected,Z.generatedKey))return!0;return!1}}function k(ne,de){var oe=ne[de];if(oe instanceof Set){var C=oe.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{done:!1,value:[Z.key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes]}})}return ee.of([oe.key,oe.attributes,oe.source.key,oe.target.key,oe.source.attributes,oe.target.attributes])}function Oe(ne,de){if(0===ne.size)return[];if("mixed"===de||de===ne.type)return"function"==typeof Array.from?Array.from(ne._edges.keys()):se(ne._edges.keys(),ne._edges.size);for(var oe,C,Z=new Array("undirected"===de?ne.undirectedSize:ne.directedSize),we="undirected"===de,Fe=ne._edges.values(),et=0;!0!==(oe=Fe.next()).done;)(C=oe.value).undirected===we&&(Z[et++]=C.key);return Z}function Xe(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var zt=P.source,Et=P.target;oe(P.key,P.attributes,zt.key,Et.key,zt.attributes,Et.attributes,P.undirected,P.generatedKey)}}function yt(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var zt=P.source,Et=P.target;if(oe(P.key,P.attributes,zt.key,Et.key,zt.attributes,Et.attributes,P.undirected,P.generatedKey))break}}function It(ne,de){if(0===ne.size)return ee.empty();var oe="mixed"!==de&&de!==ne.type,C="undirected"===de,P=ne._edges.values();return new ee(function(){for(var Z,we;;){if((Z=P.next()).done)return Z;if(we=Z.value,!oe||we.undirected===C)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function Tn(ne,de,oe,C){var P=[],Z=ne?qe:Ue;return"undirected"!==de&&("out"!==oe&&Z(P,C.in),"in"!==oe&&Z(P,C.out),!oe&&C.directedSelfLoops>0&&P.splice(P.lastIndexOf(C.key),1)),"directed"!==de&&Z(P,C.undirected),P}function Pn(ne,de,oe,C,P){var Z=ne?z:Be;"undirected"!==de&&("out"!==oe&&Z(C.in,P),"in"!==oe&&Z(C.out,P,oe?null:C.key)),"directed"!==de&&Z(C.undirected,P)}function Gn(ne,de,oe,C,P){var Z=ne?be:X;"undirected"!==de&&("out"!==oe&&Z(C.in,P)||"in"!==oe&&Z(C.out,P,oe?null:C.key))||"directed"===de||Z(C.undirected,P)}function yi(ne,de,oe){var C=ee.empty();return"undirected"!==ne&&("out"!==de&&void 0!==oe.in&&(C=Ee(C,ce(oe.in))),"in"!==de&&void 0!==oe.out&&(C=Ee(C,ce(oe.out,de?null:oe.key)))),"directed"!==ne&&void 0!==oe.undirected&&(C=Ee(C,ce(oe.undirected))),C}function hi(ne,de,oe,C,P){var Z=de?wt:Pe,we=[];return"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&Z(we,C.in,P),void 0!==C.out&&"in"!==oe&&Z(we,C.out,P),!oe&&C.directedSelfLoops>0&&we.splice(we.lastIndexOf(C.key),1)),"directed"!==ne&&void 0!==C.undirected&&Z(we,C.undirected,P),we}function Hr(ne,de,oe,C,P,Z){var we=de?fe:pt;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z),C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z)),"directed"!==ne&&void 0!==C.undirected&&we(C.undirected,P,Z)}function Ns(ne,de,oe,C,P,Z){var we=de?R:B;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z)||C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z,oe?null:C.key))||"directed"===ne||void 0===C.undirected||we(C.undirected,P,Z)}function cs(ne,de,oe,C){var P=ee.empty();return"undirected"!==ne&&(void 0!==oe.in&&"out"!==de&&C in oe.in&&(P=Ee(P,k(oe.in,C))),void 0!==oe.out&&"in"!==de&&C in oe.out&&(P=Ee(P,k(oe.out,C)))),"directed"!==ne&&void 0!==oe.undirected&&C in oe.undirected&&(P=Ee(P,k(oe.undirected,C))),P}var Ps=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Gr(ne,de){if(void 0!==de)for(var oe in de)ne.add(oe)}function qa(ne,de,oe){if("mixed"!==ne){if("undirected"===ne)return Object.keys(oe.undirected);if("string"==typeof de)return Object.keys(oe[de])}var C=new Set;return"undirected"!==ne&&("out"!==de&&Gr(C,oe.in),"in"!==de&&Gr(C,oe.out)),"directed"!==ne&&Gr(C,oe.undirected),se(C.values(),C.size)}function Al(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;oe(Fe.key,Fe.attributes)}}function ua(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;ne.has(et.key)||(ne.add(et.key),C(et.key,et.attributes))}}function ms(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;if(oe(Fe.key,Fe.attributes))return!0}return!1}function Qt(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;if(!ne.has(et.key)&&(ne.add(et.key),C(et.key,et.attributes)))return!0}return!1}function Ka(ne,de){var oe=Object.keys(de),C=oe.length,P=0;return new ee(function(){if(P>=C)return{done:!0};var Z=de[oe[P++]];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===ne?Z.target:we;return{done:!1,value:[et.key,et.attributes]}})}function rt(ne,de,oe){var C=Object.keys(oe),P=C.length,Z=0;return new ee(function we(){if(Z>=P)return{done:!0};var Fe=oe[C[Z++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var et=Fe.source,We=et===de?Fe.target:et;return ne.has(We.key)?we():(ne.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function ot(ne,de,oe,C,P){var Z=ne._nodes.get(C);if("undirected"!==de){if("out"!==oe&&void 0!==Z.in)for(var we in Z.in)if(we===P)return!0;if("in"!==oe&&void 0!==Z.out)for(var Fe in Z.out)if(Fe===P)return!0}if("directed"!==de&&void 0!==Z.undirected)for(var et in Z.undirected)if(et===P)return!0;return!1}function ke(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,We=de._nodes.values(),zt=de.type;!0!==(C=We.next()).done;){if(P=C.value,"undirected"!==zt)for(Z in we=P.out)if(et=(Fe=we[Z]).target,Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return;if("directed"!==zt)for(Z in we=P.undirected)if((et=(Fe=we[Z]).target).key!==Z&&(et=Fe.source),Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return}}function ct(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,We,zt,Et=de._nodes.values(),pn=de.type;!0!==(C=Et.next()).done;){if(P=C.value,"undirected"!==pn)for(Z in et=P.out)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if(We=(Dt=Fe.value).target,zt=oe(P.key,We.key,P.attributes,We.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&zt)return;if("directed"!==pn)for(Z in et=P.undirected)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if((We=(Dt=Fe.value).target).key!==Z&&(We=Dt.source),zt=oe(P.key,We.key,P.attributes,We.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&zt)return}}function Qe(ne,de){var oe={key:ne};return re(de.attributes)||(oe.attributes=he({},de.attributes)),oe}function vt(ne,de){var oe={source:de.source.key,target:de.target.key};return de.generatedKey||(oe.key=ne),re(de.attributes)||(oe.attributes=he({},de.attributes)),de.undirected&&(oe.undirected=!0),oe}function xt(ne){return L(ne)?"key"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?null:"invalid-attributes":"no-key":"not-object"}function Tt(ne){return L(ne)?"source"in ne?"target"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?"undirected"in ne&&"boolean"!=typeof ne.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var $t=new Set(["directed","undirected","mixed"]),jn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ii={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Dn(ne,de,oe){var C=new ne.NodeDataClass(de,oe);return ne._nodes.set(de,C),ne.emit("nodeAdded",{key:de,attributes:oe}),C}function fn(ne,de,oe,C,P,Z,we,Fe){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(Z=""+Z,we=""+we,Fe=Fe||{},!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var et=ne._nodes.get(Z),Dt=ne._nodes.get(we);if(!et)throw new te("Graph.".concat(de,': source node "').concat(Z,'" not found.'));if(!Dt)throw new te("Graph.".concat(de,': target node "').concat(we,'" not found.'));var We={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(We)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));if(!ne.multi&&(C?void 0!==et.undirected[we]:void 0!==et.out[we]))throw new ye("Graph.".concat(de,': an edge linking "').concat(Z,'" to "').concat(we,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var zt=new Ze(C,P,oe,et,Dt,Fe);return ne._edges.set(P,zt),Z===we?C?(et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(et.undirectedDegree++,Dt.undirectedDegree++):(et.outDegree++,Dt.inDegree++),Je(ne,C,zt,Z,we,et,Dt),C?ne._undirectedSize++:ne._directedSize++,We.key=P,ne.emit("edgeAdded",We),P}function zn(ne,de,oe,C,P,Z,we,Fe,et){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(et){if("function"!=typeof Fe)throw new me("Graph.".concat(de,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Dt;if(Z=""+Z,we=""+we,et&&(Dt=Fe,Fe=void 0),!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,zt,Et=ne._nodes.get(Z),pn=ne._nodes.get(we);if(!oe&&(We=ne._edges.get(P))){if(We.source.key!==Z||We.target.key!==we||C&&(We.source.key!==we||We.target.key!==Z))throw new ye("Graph.".concat(de,': inconsistency detected when attempting to merge the "').concat(P,'" edge with "').concat(Z,'" source & "').concat(we,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));zt=We}if(zt||ne.multi||!Et||(zt=C?Et.undirected[we]:Et.out[we]),zt)return(et?Dt:Fe)?(et?(zt.attributes=Dt(zt.attributes),ne.emit("edgeAttributesUpdated",{type:"replace",key:zt.key,attributes:zt.attributes})):(he(zt.attributes,Fe),ne.emit("edgeAttributesUpdated",{type:"merge",key:zt.key,attributes:zt.attributes,data:Fe})),zt.key):zt.key;Fe=Fe||{},et&&Dt&&(Fe=Dt(Fe));var Wr={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(Wr)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));return Et||(Et=Dn(ne,Z,{}),Z===we&&(pn=Et)),pn||(pn=Dn(ne,we,{})),We=new Ze(C,P,oe,Et,pn,Fe),ne._edges.set(P,We),Z===we?C?(Et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(Et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(Et.undirectedDegree++,pn.undirectedDegree++):(Et.outDegree++,pn.inDegree++),Je(ne,C,We,Z,we,Et,pn),C?ne._undirectedSize++:ne._directedSize++,Wr.key=P,ne.emit("edgeAdded",Wr),P}var ne,bn=function(ne){function de(C){var P;if(P=ne.call(this)||this,(C=he({},ii,C)).edgeKeyGenerator&&"function"!=typeof C.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(C.edgeKeyGenerator,'".'));if("boolean"!=typeof C.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(C.multi,'".'));if(!$t.has(C.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(C.type,'".'));if("boolean"!=typeof C.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(C.allowSelfLoops,'".'));var Z,we="mixed"===C.type?De:"directed"===C.type?Ve:nt;return $(Ae(P),"NodeDataClass",we),$(Ae(P),"_attributes",{}),$(Ae(P),"_nodes",new Map),$(Ae(P),"_edges",new Map),$(Ae(P),"_directedSize",0),$(Ae(P),"_undirectedSize",0),$(Ae(P),"_directedSelfLoopCount",0),$(Ae(P),"_undirectedSelfLoopCount",0),$(Ae(P),"_edgeKeyGenerator",C.edgeKeyGenerator||(Z=0,function(){return Z++})),$(Ae(P),"_options",C),jn.forEach(function(Fe){return $(Ae(P),Fe,P[Fe])}),b(Ae(P),"order",function(){return P._nodes.size}),b(Ae(P),"size",function(){return P._edges.size}),b(Ae(P),"directedSize",function(){return P._directedSize}),b(Ae(P),"undirectedSize",function(){return P._undirectedSize}),b(Ae(P),"selfLoopCount",function(){return P._directedSelfLoopCount+P._undirectedSelfLoopCount}),b(Ae(P),"directedSelfLoopCount",function(){return P._directedSelfLoopCount}),b(Ae(P),"undirectedSelfLoopCount",function(){return P._undirectedSelfLoopCount}),b(Ae(P),"multi",P._options.multi),b(Ae(P),"type",P._options.type),b(Ae(P),"allowSelfLoops",P._options.allowSelfLoops),b(Ae(P),"implementation",function(){return"graphology"}),P}tt(de,ne);var oe=de.prototype;return oe.hasNode=function(C){return this._nodes.has(""+C)},oe.hasDirectedEdge=function(C,P){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&!we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.out[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasUndirectedEdge=function(C,P){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.undirected[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasEdge=function(C,P){if(1===arguments.length)return this._edges.has(""+C);if(2===arguments.length){P=""+P;var we=this._nodes.get(C=""+C);if(!we)return!1;var Fe=void 0!==we.out&&we.out[P];return Fe||(Fe=void 0!==we.undirected&&we.undirected[P]),!(!Fe||this.multi&&!Fe.size)}throw new me("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.directedEdge=function(C,P){if("undirected"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.directedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.directedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||void 0;return we?we.key:void 0}},oe.undirectedEdge=function(C,P){if("directed"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.undirectedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.undirectedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.undirected&&Z.undirected[P]||void 0;return we?we.key:void 0}},oe.edge=function(C,P){if(this.multi)throw new ye("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");P=""+P;var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.edge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.edge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||Z.undirected&&Z.undirected[P]||void 0;if(we)return we.key},oe.inDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.inDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.inDegree+(P?Z.directedSelfLoops:0)},oe.outDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.outDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.outDegree+(P?Z.directedSelfLoops:0)},oe.directedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.directedDegree: could not find the "'.concat(C,'" node in the graph.'));if("undirected"===this.type)return 0;var we=P?Z.directedSelfLoops:0;return Z.inDegree+we+(Z.outDegree+we)},oe.undirectedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.undirectedDegree: could not find the "'.concat(C,'" node in the graph.'));return"directed"===this.type?0:Z.undirectedDegree+2*(P?Z.undirectedSelfLoops:0)},oe.degree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.degree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.degree: could not find the "'.concat(C,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(P&&(Fe=Z.undirectedSelfLoops),we+=Z.undirectedDegree+2*Fe),"undirected"!==this.type&&(P&&(Fe=Z.directedSelfLoops),we+=Z.inDegree+Z.outDegree+2*Fe),we},oe.source=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.source: could not find the "'.concat(C,'" edge in the graph.'));return P.source.key},oe.target=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.target: could not find the "'.concat(C,'" edge in the graph.'));return P.target.key},oe.extremities=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.extremities: could not find the "'.concat(C,'" edge in the graph.'));return[P.source.key,P.target.key]},oe.opposite=function(C,P){C=""+C;var Z=this._edges.get(P=""+P);if(!Z)throw new te('Graph.opposite: could not find the "'.concat(P,'" edge in the graph.'));var we=Z.source.key,Fe=Z.target.key;if(C!==we&&C!==Fe)throw new te('Graph.opposite: the "'.concat(C,'" node is not attached to the "').concat(P,'" edge (').concat(we,", ").concat(Fe,")."));return C===we?Fe:we},oe.hasExtremity=function(C,P){P=""+P;var Z=this._edges.get(C=""+C);if(!Z)throw new te('Graph.hasExtremity: could not find the "'.concat(C,'" edge in the graph.'));return Z.source.key===P||Z.target.key===P},oe.isUndirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isUndirected: could not find the "'.concat(C,'" edge in the graph.'));return P.undirected},oe.isDirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isDirected: could not find the "'.concat(C,'" edge in the graph.'));return!P.undirected},oe.isSelfLoop=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isSelfLoop: could not find the "'.concat(C,'" edge in the graph.'));return P.source===P.target},oe.hasGeneratedKey=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.hasGeneratedKey: could not find the "'.concat(C,'" edge in the graph.'));return P.generatedKey},oe.addNode=function(C,P){return function(Z,we,Fe){if(Fe&&!L(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},Z._nodes.has(we=""+we))throw new ye('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var et=new Z.NodeDataClass(we,Fe);return Z._nodes.set(we,et),Z.emit("nodeAdded",{key:we,attributes:Fe}),et}(this,C,P).key},oe.mergeNode=function(C,P){if(P&&!L(P))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(P,'"'));P=P||{};var Z=this._nodes.get(C=""+C);return Z?(P&&(he(Z.attributes,P),this.emit("nodeAttributesUpdated",{type:"merge",key:C,attributes:Z.attributes,data:P})),C):(Z=new this.NodeDataClass(C,P),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:P}),C)},oe.updateNode=function(C,P){if(P&&"function"!=typeof P)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(P,'"'));var Z=this._nodes.get(C=""+C);if(Z)return P&&(Z.attributes=P(Z.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:C,attributes:Z.attributes})),C;var Fe=P?P({}):{};return Z=new this.NodeDataClass(C,Fe),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:Fe}),C},oe.dropNode=function(C){var P=this,Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.dropNode: could not find the "'.concat(C,'" node in the graph.'));this.forEachEdge(C,function(we){P.dropEdge(we)}),this._nodes.delete(C),this.emit("nodeDropped",{key:C,attributes:Z.attributes})},oe.dropEdge=function(C){var P;if(arguments.length>1){var Z=""+arguments[0],we=""+arguments[1];if(!(P=q(this,Z,we,this.type)))throw new te('Graph.dropEdge: could not find the "'.concat(Z,'" -> "').concat(we,'" edge in the graph.'))}else if(!(P=this._edges.get(C=""+C)))throw new te('Graph.dropEdge: could not find the "'.concat(C,'" edge in the graph.'));this._edges.delete(P.key);var et=P.source,Dt=P.target,We=P.attributes,zt=P.undirected;return et===Dt?zt?(et.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(et.directedSelfLoops--,this._directedSelfLoopCount--):zt?(et.undirectedDegree--,Dt.undirectedDegree--):(et.outDegree--,Dt.inDegree--),Ye(this,zt,P),zt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:C,attributes:We,source:et.key,target:Dt.key,undirected:zt}),this},oe.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},oe.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},oe.getAttribute=function(C){return this._attributes[C]},oe.getAttributes=function(){return this._attributes},oe.hasAttribute=function(C){return this._attributes.hasOwnProperty(C)},oe.setAttribute=function(C,P){return this._attributes[C]=P,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.updateAttribute=function(C,P){if("function"!=typeof P)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[C]=P(this._attributes[C]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.removeAttribute=function(C){return delete this._attributes[C],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:C}),this},oe.replaceAttributes=function(C){if(!L(C))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=C,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},oe.mergeAttributes=function(C){if(!L(C))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,C),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:C}),this},oe.getNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.getNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes[P]},oe.getNodeAttributes=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.getNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));return P.attributes},oe.hasNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes.hasOwnProperty(P)},oe.setNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.setNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return we.attributes[P]=Z,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.updateNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.updateNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof Z)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,et=Z(Fe[P]);return Fe[P]=et,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.removeNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return delete Z.attributes[P],this.emit("nodeAttributesUpdated",{key:C,type:"remove",attributes:Z.attributes,name:P}),this},oe.replaceNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.replaceNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return Z.attributes=P,this.emit("nodeAttributesUpdated",{key:C,type:"replace",attributes:Z.attributes}),this},oe.mergeNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.mergeNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(Z.attributes,P),this.emit("nodeAttributesUpdated",{key:C,type:"merge",attributes:Z.attributes,data:P}),this},oe.updateEachNodeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._nodes.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:P||null})},oe.updateEachEdgeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._edges.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:P||null})},oe.forEach=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?ct(!1,this,C):ke(!1,this,C)},oe.forEachUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?ct(!0,this,C):ke(!0,this,C)},oe.adjacency=function(){return this.multi?(et=(C=this)._nodes.values(),Dt=C.type,We="outer",zt=null,new ee(function Et(){var pn;if("outer"===We)return!0===(pn=et.next()).done?pn:(P=pn.value,We="directed",Et());if("directed"===We)return"undirected"===Dt?(We="undirected",Et()):(we=P.out,Z=Object.keys(P.out),Fe=0,We="inner-directed",Et());if("undirected"===We){if("directed"===Dt)return We="outer",Et();we=P.undirected,Z=Object.keys(P.undirected),Fe=0,We="inner-undirected"}if(!zt&&Fe>=Z.length)return We="inner-undirected"===We?"outer":"undirected",Et();if(!zt){var _s=Z[Fe++];return zt=we[_s].values(),Et()}if((pn=zt.next()).done)return zt=null,Et();var Wr=pn.value,Ks=Wr.target;return"inner-undirected"===We&&Ks.key===P.key&&(Ks=Wr.source),{done:!1,value:[P.key,Ks.key,P.attributes,Ks.attributes,Wr.key,Wr.attributes]}})):(Tl=(Et=this)._nodes.values(),oo=Et.type,Pr="outer",new ee(function Fs(){var fc;if("outer"===Pr)return!0===(fc=Tl.next()).done?fc:(pn=fc.value,Pr="directed",Fs());if("directed"===Pr)return"undirected"===oo?(Pr="undirected",Fs()):(Wr=pn.out,_s=Object.keys(pn.out),Ks=0,Pr="inner-directed",Fs());if("undirected"===Pr){if("directed"===oo)return Pr="outer",Fs();Wr=pn.undirected,_s=Object.keys(pn.undirected),Ks=0,Pr="inner-undirected"}if(Ks>=_s.length)return Pr="inner-undirected"===Pr?"outer":"undirected",Fs();var yn=_s[Ks++],ao=Wr[yn],Ml=ao.target;return"inner-undirected"===Pr&&Ml.key===pn.key&&(Ml=ao.source),{done:!1,value:[pn.key,Ml.key,pn.attributes,Ml.attributes,ao.key,ao.attributes]}}));var Et,pn,_s,Wr,Ks,Tl,oo,Pr,C,P,Z,we,Fe,et,Dt,We,zt},oe.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):se(this._nodes.keys(),this._nodes.size)},oe.forEachNode=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(P,Z){C(Z,P.attributes)})},oe.forEachNodeUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");for(var P,Z,we=this._nodes.values();!0!==(P=we.next())&&!C((Z=P.value).key,Z.attributes););},oe.nodeEntries=function(){var C=this._nodes.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{value:[Z.key,Z.attributes],done:!1}})},oe.exportNode=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.exportNode: could not find the "'.concat(C,'" node in the graph.'));return Qe(C,P)},oe.exportEdge=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.exportEdge: could not find the "'.concat(C,'" edge in the graph.'));return vt(C,P)},oe.export=function(){var C=new Array(this._nodes.size),P=0;this._nodes.forEach(function(we,Fe){C[P++]=Qe(Fe,we)});var Z=new Array(this._edges.size);return P=0,this._edges.forEach(function(we,Fe){Z[P++]=vt(Fe,we)}),{attributes:this.getAttributes(),nodes:C,edges:Z,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},oe.importNode=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=xt(C);if(Z){if("not-object"===Z)throw new me('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===Z)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===Z)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=C.key,Fe=C.attributes,et=void 0===Fe?{}:Fe;return P?this.mergeNode(we,et):this.addNode(we,et),this},oe.importEdge=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=Tt(C);if(Z){if("not-object"===Z)throw new me('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===Z)throw new me("Graph.importEdge: missing souce.");if("no-target"===Z)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===Z)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===Z)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=C.source,Fe=C.target,et=C.attributes,Dt=void 0===et?{}:et,We=C.undirected,zt=void 0!==We&&We;return"key"in C?(P?zt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:zt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,C.key,we,Fe,Dt):(P?zt?this.mergeUndirectedEdge:this.mergeDirectedEdge:zt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Dt),this},oe.import=function(C){var P,Z,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V(C))return this.import(C.export(),Fe),this;if(!L(C))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(C.attributes){if(!L(C.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(C.attributes):this.replaceAttributes(C.attributes)}if(C.nodes){if(we=C.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(P=0,Z=we.length;PZ)){var Dt=new Set;Dt.add(P.undirected[et]),P.undirected[et]=Dt,C._nodes.get(et).undirected[Z]=Dt}})),this;var C},oe.clearIndex=function(){return this._nodes.forEach(function(C){void 0!==C.in&&(C.in={},C.out={}),void 0!==C.undirected&&(C.undirected={})}),this},oe.toJSON=function(){return this.export()},oe.toString=function(){return"[object Graph]"},oe.inspect=function(){var C=this,P={};this._nodes.forEach(function(Dt,We){P[We]=Dt.attributes});var Z={},we={};this._edges.forEach(function(Dt,We){var zt=Dt.undirected?"--":"->",Et="",pn="(".concat(Dt.source.key,")").concat(zt,"(").concat(Dt.target.key,")");Dt.generatedKey?C.multi&&(void 0===we[pn]?we[pn]=0:we[pn]++,Et+="".concat(we[pn],". ")):Et+="[".concat(We,"]: "),Z[Et+=pn]=Dt.attributes});var Fe={};for(var et in this)this.hasOwnProperty(et)&&!jn.has(et)&&"function"!=typeof this[et]&&(Fe[et]=this[et]);return Fe.attributes=this._attributes,Fe.nodes=P,Fe.edges=Z,$(Fe,"constructor",this.constructor),Fe},de}(T.exports.EventEmitter);"undefined"!=typeof Symbol&&(bn.prototype[Symbol.for("nodejs.util.inspect.custom")]=bn.prototype.inspect),[{name:function(ne){return"".concat(ne,"Edge")},generateKey:!0},{name:function(ne){return"".concat(ne,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ne){return"".concat(ne,"EdgeWithKey")}},{name:function(ne){return"".concat(ne,"DirectedEdgeWithKey")},type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ne){["add","merge","update"].forEach(function(de){var oe=ne.name(de),C="add"===de?fn:zn;bn.prototype[oe]=ne.generateKey?function(P,Z,we){return C(this,oe,!0,"undirected"===(ne.type||this.type),null,P,Z,we,"update"===de)}:function(P,Z,we,Fe){return C(this,oe,!1,"undirected"===(ne.type||this.type),P,Z,we,Fe,"update"===de)}})}),"undefined"!=typeof Symbol&&(bn.prototype[Symbol.iterator]=bn.prototype.adjacency),ne=bn,je.forEach(function(de){var oe=de.name,C=de.attacher;C(ne,oe("Edge"),"mixed"),C(ne,oe("DirectedEdge"),"directed"),C(ne,oe("UndirectedEdge"),"undirected")}),function(ne){Re.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe,et){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(!arguments.length)return Oe(this,Z);if(1===arguments.length){var Dt=this._nodes.get(Fe=""+Fe);if(void 0===Dt)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return Tn(this.multi,"mixed"===Z?this.type:Z,we,Dt)}if(2===arguments.length){et=""+et;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" target node in the graph.'));return hi(Z,this.multi,we,We,et)}throw new me("Graph.".concat(P,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1);oe.prototype[Fe]=function(et,Dt,We){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return Xe(this,Z,We=et);if(2===arguments.length){We=Dt;var zt=this._nodes.get(et=""+et);if(void 0===zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Pn(this.multi,"mixed"===Z?this.type:Z,we,zt,We)}if(3===arguments.length){Dt=""+Dt;var Et=this._nodes.get(et=""+et);if(!Et)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Hr(Z,this.multi,we,Et,Dt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1)+"Until";oe.prototype[Fe]=function(et,Dt,We){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return yt(this,Z,We=et);if(2===arguments.length){We=Dt;var zt=this._nodes.get(et=""+et);if(void 0===zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Gn(this.multi,"mixed"===Z?this.type:Z,we,zt,We)}if(3===arguments.length){Dt=""+Dt;var Et=this._nodes.get(et=""+et);if(!Et)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Ns(Z,this.multi,we,Et,Dt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var Z=C.type,we=C.direction,Fe=C.name.slice(0,-1)+"Entries";oe.prototype[Fe]=function(et,Dt){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return ee.empty();if(!arguments.length)return It(this,Z);if(1===arguments.length){var We=this._nodes.get(et=""+et);if(!We)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return yi(Z,we,We)}if(2===arguments.length){Dt=""+Dt;var zt=this._nodes.get(et=""+et);if(!zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return cs(Z,we,zt,Dt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ne,de)})}(bn),function(ne){Ps.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(2===arguments.length){var et=""+arguments[0],Dt=""+arguments[1];if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(P,': could not find the "').concat(Dt,'" node in the graph.'));return ot(this,Z,we,et,Dt)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return qa("mixed"===Z?this.type:Z,we,We)}throw new me("Graph.".concat(P,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1);ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,We,zt,Et){if("mixed"!==Dt){if("undirected"===Dt)return Al(zt,zt.undirected,Et);if("string"==typeof We)return Al(zt,zt[We],Et)}var pn=new Set;"undirected"!==Dt&&("out"!==We&&ua(pn,zt,zt.in,Et),"in"!==We&&ua(pn,zt,zt.out,Et)),"directed"!==Dt&&ua(pn,zt,zt.undirected,Et)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1)+"Until";ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,We,zt,Et){if("mixed"!==Dt){if("undirected"===Dt)return ms(zt,zt.undirected,Et);if("string"==typeof We)return ms(zt,zt[We],Et)}var pn=new Set;"undirected"!==Dt&&("out"!==We&&Qt(pn,zt,zt.in,Et)||"in"!==We&&Qt(pn,zt,zt.out,Et))||"directed"===Dt||Qt(pn,zt,zt.undirected,Et)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var C=de.type,P=de.direction,Z=de.name.slice(0,-1)+"Entries";ne.prototype[Z]=function(we){if("mixed"!==C&&"mixed"!==this.type&&C!==this.type)return ee.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));return function(et,Dt,We){if("mixed"!==et){if("undirected"===et)return Ka(We,We.undirected);if("string"==typeof Dt)return Ka(We,We[Dt])}var zt=ee.empty(),Et=new Set;return"undirected"!==et&&("out"!==Dt&&(zt=Ee(zt,rt(Et,We,We.in))),"in"!==Dt&&(zt=Ee(zt,rt(Et,We,We.out)))),"directed"!==et&&(zt=Ee(zt,rt(Et,We,We.undirected))),zt}("mixed"===C?this.type:C,P,Fe)}}(ne,de)})}(bn);var Qi=function(ne){function de(oe){var C=he({type:"directed"},oe);if("multi"in C&&!1!==C.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==C.type)throw new me('DirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),Zi=function(ne){function de(oe){var C=he({type:"undirected"},oe);if("multi"in C&&!1!==C.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==C.type)throw new me('UndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),qn=function(ne){function de(oe){var C=he({multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ne.call(this,C)||this}return tt(de,ne),de}(bn),Pi=function(ne){function de(oe){var C=he({type:"directed",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==C.type)throw new me('MultiDirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),da=function(ne){function de(oe){var C=he({type:"undirected",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==C.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn);function $r(ne){ne.from=function(de,oe){var C=he({},de.options,oe),P=new ne(C);return P.import(de),P}}return $r(bn),$r(Qi),$r(Zi),$r(qn),$r(Pi),$r(da),bn.Graph=bn,bn.DirectedGraph=Qi,bn.UndirectedGraph=Zi,bn.MultiGraph=qn,bn.MultiDirectedGraph=Pi,bn.MultiUndirectedGraph=da,bn.InvalidArgumentsGraphError=me,bn.NotFoundGraphError=te,bn.UsageGraphError=ye,bn}()},524:(kt,it,tt)=>{var gt;!function(J,At,dt,K){"use strict";var T,Ae=["","webkit","Moz","MS","ms","o"],he=At.createElement("div"),V=Math.round,L=Math.abs,re=Date.now;function $(_e,Ce,He){return setTimeout(M(_e,He),Ce)}function b(_e,Ce,He){return!!Array.isArray(_e)&&(S(_e,He[Ce],He),!0)}function S(_e,Ce,He){var mt;if(_e)if(_e.forEach)_e.forEach(Ce,He);else if(_e.length!==K)for(mt=0;mt<_e.length;)Ce.call(He,_e[mt],mt,_e),mt++;else for(mt in _e)_e.hasOwnProperty(mt)&&Ce.call(He,_e[mt],mt,_e)}function O(_e,Ce,He){var mt="DEPRECATED METHOD: "+Ce+"\n"+He+" AT \n";return function(){var jt=new Error("get-stack-trace"),Ht=jt&&jt.stack?jt.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ri=J.console&&(J.console.warn||J.console.log);return ri&&ri.call(J.console,mt,Ht),_e.apply(this,arguments)}}T="function"!=typeof Object.assign?function(Ce){if(Ce===K||null===Ce)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(Ce),mt=1;mt-1}function Q(_e){return _e.trim().split(/\s+/g)}function E(_e,Ce,He){if(_e.indexOf&&!He)return _e.indexOf(Ce);for(var mt=0;mt<_e.length;){if(He&&_e[mt][He]==Ce||!He&&_e[mt]===Ce)return mt;mt++}return-1}function U(_e){return Array.prototype.slice.call(_e,0)}function ie(_e,Ce,He){for(var mt=[],jt=[],Ht=0;Ht<_e.length;){var ri=Ce?_e[Ht][Ce]:_e[Ht];E(jt,ri)<0&&mt.push(_e[Ht]),jt[Ht]=ri,Ht++}return He&&(mt=Ce?mt.sort(function(qr,ys){return qr[Ce]>ys[Ce]}):mt.sort()),mt}function ue(_e,Ce){for(var He,mt,jt=Ce[0].toUpperCase()+Ce.slice(1),Ht=0;Ht1&&!He.firstMultiple?He.firstMultiple=yt(Ce):1===jt&&(He.firstMultiple=!1);var Ht=He.firstInput,ri=He.firstMultiple,Fr=ri?ri.center:Ht.center,qr=Ce.center=It(mt);Ce.timeStamp=re(),Ce.deltaTime=Ce.timeStamp-Ht.timeStamp,Ce.angle=yi(Fr,qr),Ce.distance=Gn(Fr,qr),function(_e,Ce){var He=Ce.center,mt=_e.offsetDelta||{},jt=_e.prevDelta||{},Ht=_e.prevInput||{};(1===Ce.eventType||4===Ht.eventType)&&(jt=_e.prevDelta={x:Ht.deltaX||0,y:Ht.deltaY||0},mt=_e.offsetDelta={x:He.x,y:He.y}),Ce.deltaX=jt.x+(He.x-mt.x),Ce.deltaY=jt.y+(He.y-mt.y)}(He,Ce),Ce.offsetDirection=Pn(Ce.deltaX,Ce.deltaY);var ys=Tn(Ce.deltaTime,Ce.deltaX,Ce.deltaY);Ce.overallVelocityX=ys.x,Ce.overallVelocityY=ys.y,Ce.overallVelocity=L(ys.x)>L(ys.y)?ys.x:ys.y,Ce.scale=ri?function(_e,Ce){return Gn(Ce[0],Ce[1],pt)/Gn(_e[0],_e[1],pt)}(ri.pointers,mt):1,Ce.rotation=ri?function(_e,Ce){return yi(Ce[1],Ce[0],pt)+yi(_e[1],_e[0],pt)}(ri.pointers,mt):0,Ce.maxPointers=He.prevInput?Ce.pointers.length>He.prevInput.maxPointers?Ce.pointers.length:He.prevInput.maxPointers:Ce.pointers.length,function(_e,Ce){var jt,Ht,ri,Fr,He=_e.lastInterval||Ce,mt=Ce.timeStamp-He.timeStamp;if(8!=Ce.eventType&&(mt>25||He.velocity===K)){var qr=Ce.deltaX-He.deltaX,ys=Ce.deltaY-He.deltaY,ti=Tn(mt,qr,ys);Ht=ti.x,ri=ti.y,jt=L(ti.x)>L(ti.y)?ti.x:ti.y,Fr=Pn(qr,ys),_e.lastInterval=Ce}else jt=He.velocity,Ht=He.velocityX,ri=He.velocityY,Fr=He.direction;Ce.velocity=jt,Ce.velocityX=Ht,Ce.velocityY=ri,Ce.direction=Fr}(He,Ce);var ti=_e.element;D(Ce.srcEvent.target,ti)&&(ti=Ce.srcEvent.target),Ce.target=ti}(_e,He),_e.emit("hammer.input",He),_e.recognize(He),_e.session.prevInput=He}function yt(_e){for(var Ce=[],He=0;He<_e.pointers.length;)Ce[He]={clientX:V(_e.pointers[He].clientX),clientY:V(_e.pointers[He].clientY)},He++;return{timeStamp:re(),pointers:Ce,center:It(Ce),deltaX:_e.deltaX,deltaY:_e.deltaY}}function It(_e){var Ce=_e.length;if(1===Ce)return{x:V(_e[0].clientX),y:V(_e[0].clientY)};for(var He=0,mt=0,jt=0;jt=L(Ce)?_e<0?2:4:Ce<0?8:16}function Gn(_e,Ce,He){He||(He=wt);var mt=Ce[He[0]]-_e[He[0]],jt=Ce[He[1]]-_e[He[1]];return Math.sqrt(mt*mt+jt*jt)}function yi(_e,Ce,He){return He||(He=wt),180*Math.atan2(Ce[He[1]]-_e[He[1]],Ce[He[0]]-_e[He[0]])/Math.PI}fe.prototype={handler:function(){},init:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Y(this.element,this.evEl,this.domHandler),this.evTarget&&Y(this.target,this.evTarget,this.domHandler),this.evWin&&Y(Te(this.element),this.evWin,this.domHandler)}};var Ns={mousedown:1,mousemove:2,mouseup:4},cs="mousedown",Ps="mousemove mouseup";function Gr(){this.evEl=cs,this.evWin=Ps,this.pressed=!1,fe.apply(this,arguments)}w(Gr,fe,{handler:function(Ce){var He=Ns[Ce.type];1&He&&0===Ce.button&&(this.pressed=!0),2&He&&1!==Ce.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[Ce],changedPointers:[Ce],pointerType:Ze,srcEvent:Ce}))}});var qa={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Al={2:Ve,3:"pen",4:Ze,5:"kinect"},ua="pointerdown",ms="pointermove pointerup pointercancel";function Qt(){this.evEl=ua,this.evWin=ms,fe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}J.MSPointerEvent&&!J.PointerEvent&&(ua="MSPointerDown",ms="MSPointerMove MSPointerUp MSPointerCancel"),w(Qt,fe,{handler:function(Ce){var He=this.store,mt=!1,jt=Ce.type.toLowerCase().replace("ms",""),Ht=qa[jt],ri=Al[Ce.pointerType]||Ce.pointerType,Fr=ri==Ve,qr=E(He,Ce.pointerId,"pointerId");1&Ht&&(0===Ce.button||Fr)?qr<0&&(He.push(Ce),qr=He.length-1):12&Ht&&(mt=!0),!(qr<0)&&(He[qr]=Ce,this.callback(this.manager,Ht,{pointers:He,changedPointers:[Ce],pointerType:ri,srcEvent:Ce}),mt&&He.splice(qr,1))}});var Ka={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",ot="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=rt,this.evWin=ot,this.started=!1,fe.apply(this,arguments)}function pe(_e,Ce){var He=U(_e.touches),mt=U(_e.changedTouches);return 12&Ce&&(He=ie(He.concat(mt),"identifier",!0)),[He,mt]}w(ut,fe,{handler:function(Ce){var He=Ka[Ce.type];if(1===He&&(this.started=!0),this.started){var mt=pe.call(this,Ce,He);12&He&&mt[0].length-mt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:mt[0],changedPointers:mt[1],pointerType:Ve,srcEvent:Ce})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ke="touchstart touchmove touchend touchcancel";function ct(){this.evTarget=ke,this.targetIds={},fe.apply(this,arguments)}function Qe(_e,Ce){var He=U(_e.touches),mt=this.targetIds;if(3&Ce&&1===He.length)return mt[He[0].identifier]=!0,[He,He];var jt,Ht,ri=U(_e.changedTouches),Fr=[],qr=this.target;if(Ht=He.filter(function(ys){return D(ys.target,qr)}),1===Ce)for(jt=0;jt-1&&mt.splice(Ht,1)},2500)}}function ii(_e){for(var Ce=_e.srcEvent.clientX,He=_e.srcEvent.clientY,mt=0;mt-1&&this.requireFail.splice(Ce,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(_e){return!!this.simultaneous[_e.id]},emit:function(_e){var Ce=this,He=this.state;function mt(jt){Ce.manager.emit(jt,_e)}He<8&&mt(Ce.options.event+We(He)),mt(Ce.options.event),_e.additionalEvent&&mt(_e.additionalEvent),He>=8&&mt(Ce.options.event+We(He))},tryEmit:function(_e){if(this.canEmit())return this.emit(_e);this.state=32},canEmit:function(){for(var _e=0;_eCe.threshold&&jt&Ce.direction},attrTest:function(_e){return pn.prototype.attrTest.call(this,_e)&&(2&this.state||!(2&this.state)&&this.directionTest(_e))},emit:function(_e){this.pX=_e.deltaX,this.pY=_e.deltaY;var Ce=zt(_e.direction);Ce&&(_e.additionalEvent=this.options.event+Ce),this._super.emit.call(this,_e)}}),w(Wr,pn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.scale-1)>this.options.threshold||2&this.state)},emit:function(_e){1!==_e.scale&&(_e.additionalEvent=this.options.event+(_e.scale<1?"in":"out")),this._super.emit.call(this,_e)}}),w(Ks,Dt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(_e){var Ce=this.options,He=_e.pointers.length===Ce.pointers,mt=_e.distanceCe.time;if(this._input=_e,!mt||!He||12&_e.eventType&&!jt)this.reset();else if(1&_e.eventType)this.reset(),this._timer=$(function(){this.state=8,this.tryEmit()},Ce.time,this);else if(4&_e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(_e){8===this.state&&(_e&&4&_e.eventType?this.manager.emit(this.options.event+"up",_e):(this._input.timeStamp=re(),this.manager.emit(this.options.event,this._input)))}}),w(Tl,pn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.rotation)>this.options.threshold||2&this.state)}}),w(oo,pn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _s.prototype.getTouchAction.call(this)},attrTest:function(_e){var He,Ce=this.options.direction;return 30&Ce?He=_e.overallVelocity:6&Ce?He=_e.overallVelocityX:24&Ce&&(He=_e.overallVelocityY),this._super.attrTest.call(this,_e)&&Ce&_e.offsetDirection&&_e.distance>this.options.threshold&&_e.maxPointers==this.options.pointers&&L(He)>this.options.velocity&&4&_e.eventType},emit:function(_e){var Ce=zt(_e.offsetDirection);Ce&&this.manager.emit(this.options.event+Ce,_e),this.manager.emit(this.options.event,_e)}}),w(Pr,Dt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Qi]},process:function(_e){var Ce=this.options,He=_e.pointers.length===Ce.pointers,mt=_e.distance"']/g,ms=RegExp(Al.source),Qt=RegExp(ua.source),Ka=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pe=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,ct=RegExp(ke.source),Qe=/^\s+/,vt=/\s/,xt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tt=/\{\n\/\* \[wrapped with (.+)\] \*/,$t=/,? & /,jn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ii=/[()=,{}\[\]\/\s]/,Dn=/\\(\\)?/g,fn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zn=/\w*$/,bn=/^[-+]0x[0-9a-f]+$/i,Qi=/^0b[01]+$/i,Zi=/^\[object .+?Constructor\]$/,qn=/^0o[0-7]+$/i,Pi=/^(?:0|[1-9]\d*)$/,da=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$r=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,de="\\ud800-\\udfff",Z="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",pn="\\ufe0e\\ufe0f",_s="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ks="["+de+"]",Tl="["+_s+"]",oo="["+Z+"]",Pr="\\d+",Fs="["+we+"]",fc="["+Fe+"]",yn="[^"+de+_s+Pr+we+Fe+Et+"]",ao="\\ud83c[\\udffb-\\udfff]",ha="[^"+de+"]",id="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="["+Et+"]",mt="(?:"+fc+"|"+yn+")",jt="(?:"+Ce+"|"+yn+")",Ht="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ri="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Fr="(?:"+oo+"|"+ao+")?",qr="["+pn+"]?",T1=qr+Fr+"(?:\\u200d(?:"+[ha,id,_e].join("|")+")"+qr+Fr+")*",rd="(?:"+[Fs,id,_e].join("|")+")"+T1,Wi="(?:"+[ha+oo+"?",oo,id,_e,Ks].join("|")+")",Wf=RegExp("['\u2019]","g"),xm=RegExp(oo,"g"),fh=RegExp(ao+"(?="+ao+")|"+Wi+T1,"g"),gv=RegExp([Ce+"?"+fc+"+"+Ht+"(?="+[Tl,Ce,"$"].join("|")+")",jt+"+"+ri+"(?="+[Tl,Ce+mt,"$"].join("|")+")",Ce+"?"+mt+"+"+Ht,Ce+"+"+ri,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pr,rd].join("|"),"g"),M1=RegExp("[\\u200d"+de+Z+pn+"]"),Dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ph=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],D1=-1,wn={};wn[It]=wn[Tn]=wn[Pn]=wn[Gn]=wn[yi]=wn[hi]=wn[Hr]=wn[Ns]=wn[cs]=!0,wn[Ze]=wn[Je]=wn[Xe]=wn[je]=wn[yt]=wn[Le]=wn[Re]=wn[Ue]=wn[Be]=wn[z]=wn[be]=wn[wt]=wn[pt]=wn[fe]=wn[k]=!1;var Ji={};Ji[Ze]=Ji[Je]=Ji[Xe]=Ji[yt]=Ji[je]=Ji[Le]=Ji[It]=Ji[Tn]=Ji[Pn]=Ji[Gn]=Ji[yi]=Ji[Be]=Ji[z]=Ji[be]=Ji[wt]=Ji[pt]=Ji[fe]=Ji[B]=Ji[hi]=Ji[Hr]=Ji[Ns]=Ji[cs]=!0,Ji[Re]=Ji[Ue]=Ji[k]=!1;var gn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},I1=parseFloat,vv=parseInt,Lt="object"==typeof global&&global&&global.Object===Object&&global,Ls="object"==typeof self&&self&&self.Object===Object&&self,Di=Lt||Ls||Function("return this")(),Il=it&&!it.nodeType&&it,fa=Il&&kt&&!kt.nodeType&&kt,xo=fa&&fa.exports===Il,Cm=xo&&Lt.process,yr=function(){try{return fa&&fa.require&&fa.require("util").types||Cm&&Cm.binding&&Cm.binding("util")}catch(Mt){}}(),en=yr&&yr.isArrayBuffer,si=yr&&yr.isDate,sr=yr&&yr.isMap,lo=yr&&yr.isRegExp,pc=yr&&yr.isSet,Jr=yr&&yr.isTypedArray;function es(st,Mt,_t){switch(_t.length){case 0:return st.call(Mt);case 1:return st.call(Mt,_t[0]);case 2:return st.call(Mt,_t[0],_t[1]);case 3:return st.call(Mt,_t[0],_t[1],_t[2])}return st.apply(Mt,_t)}function Lr(st,Mt,_t,sn){for(var xn=-1,Ci=null==st?0:st.length;++xn-1}function gh(st,Mt,_t){for(var sn=-1,xn=null==st?0:st.length;++sn-1;);return _t}function P1(st,Mt){for(var _t=st.length;_t--&&Ya(Mt,st[_t],0)>-1;);return _t}function CP(st,Mt){for(var _t=st.length,sn=0;_t--;)st[_t]===Mt&&++sn;return sn}var AP=Ho({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),TP=Ho({"&":"&","<":"<",">":">",'"':""","'":"'"});function MP(st){return"\\"+gn[st]}function yh(st){return M1.test(st)}function wv(st){var Mt=-1,_t=Array(st.size);return st.forEach(function(sn,xn){_t[++Mt]=[xn,sn]}),_t}function F1(st,Mt){return function(_t){return st(Mt(_t))}}function ou(st,Mt){for(var _t=-1,sn=st.length,xn=0,Ci=[];++_t",""":'"',"'":"'"}),bh=function st(Mt){var u,_t=(Mt=null==Mt?Di:bh.defaults(Di.Object(),Mt,bh.pick(Di,ph))).Array,sn=Mt.Date,xn=Mt.Error,Ci=Mt.Function,Kr=Mt.Math,Bi=Mt.Object,Om=Mt.RegExp,Nm=Mt.String,ma=Mt.TypeError,or=_t.prototype,au=Bi.prototype,Kf=Mt["__core-js_shared__"],vr=Ci.prototype.toString,ji=au.hasOwnProperty,PP=0,wh=(u=/[^.]+$/.exec(Kf&&Kf.keys&&Kf.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ys=au.toString,B1=vr.call(Bi),Pm=Di._,ud=Om("^"+vr.call(ji).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bs=xo?Mt.Buffer:J,Ol=Mt.Symbol,dd=Mt.Uint8Array,xv=Bs?Bs.allocUnsafe:J,_a=F1(Bi.getPrototypeOf,Bi),Fm=Bi.create,Yf=au.propertyIsEnumerable,Ln=or.splice,j1=Ol?Ol.isConcatSpreadable:J,Eh=Ol?Ol.iterator:J,lu=Ol?Ol.toStringTag:J,Xf=function(){try{var u=Ac(Bi,"defineProperty");return u({},"",{}),u}catch(h){}}(),Cv=Mt.clearTimeout!==Di.clearTimeout&&Mt.clearTimeout,V1=sn&&sn.now!==Di.Date.now&&sn.now,U1=Mt.setTimeout!==Di.setTimeout&&Mt.setTimeout,Ft=Kr.ceil,fi=Kr.floor,ya=Bi.getOwnPropertySymbols,ts=Bs?Bs.isBuffer:J,Lm=Mt.isFinite,Sh=or.join,Qa=F1(Bi.keys,Bi),Br=Kr.max,us=Kr.min,FP=sn.now,z1=Mt.parseInt,xh=Kr.random,Qf=or.reverse,bs=Ac(Mt,"DataView"),co=Ac(Mt,"Map"),Zf=Ac(Mt,"Promise"),va=Ac(Mt,"Set"),Ao=Ac(Mt,"WeakMap"),Ch=Ac(Bi,"create"),Ah=Ao&&new Ao,hd={},H1=bu(bs),km=bu(co),Bm=bu(Zf),Av=bu(va),jm=bu(Ao),Jf=Ol?Ol.prototype:J,fd=Jf?Jf.valueOf:J,Th=Jf?Jf.toString:J;function Se(u){if(Er(u)&&!Mn(u)&&!(u instanceof oi)){if(u instanceof To)return u;if(ji.call(u,"__wrapped__"))return Sp(u)}return new To(u)}var cu=function(){function u(){}return function(h){if(!wr(h))return{};if(Fm)return Fm(h);u.prototype=h;var m=new u;return u.prototype=J,m}}();function Mh(){}function To(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=J}function oi(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function uo(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function js(u,h,m,N,ae,xe){var ze,Ke=1&h,lt=2&h,Ot=4&h;if(m&&(ze=ae?m(u,N,ae,xe):m(u)),ze!==J)return ze;if(!wr(u))return u;var Nt=Mn(u);if(Nt){if(ze=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&ji.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!Ke)return Qs(u,ze)}else{var Bt=Us(u),Jt=Bt==Ue||Bt==qe;if(ll(u))return hp(u,Ke);if(Bt==be||Bt==Ze||Jt&&!ae){if(ze=lt||Jt?{}:Qv(u),!Ke)return lt?function(u,h){return xa(u,Kv(u),h)}(u,function(u,h){return u&&xa(h,Js(h),u)}(ze,u)):function(u,h){return xa(u,a_(u),h)}(u,tC(ze,u))}else{if(!Ji[Bt])return ae?u:{};ze=function(u,h,m){var N=u.constructor;switch(h){case Xe:return mu(u);case je:case Le:return new N(+u);case yt:return function(u,h){var m=h?mu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case It:case Tn:case Pn:case Gn:case yi:case hi:case Hr:case Ns:case cs:return n_(u,m);case Be:return new N;case z:case fe:return new N(u);case wt:return function(u){var h=new u.constructor(u.source,zn.exec(u));return h.lastIndex=u.lastIndex,h}(u);case pt:return new N;case B:return function(u){return fd?Bi(fd.call(u)):{}}(u)}}(u,Bt,Ke)}}xe||(xe=new wa);var _n=xe.get(u);if(_n)return _n;xe.set(u,ze),wA(u)?u.forEach(function(kn){ze.add(js(kn,h,m,kn,u,xe))}):_A(u)&&u.forEach(function(kn,ci){ze.set(ci,js(kn,h,m,ci,u,xe))});var li=Nt?J:(Ot?lt?s_:Bl:lt?Js:Cs)(u);return ks(li||u,function(kn,ci){li&&(kn=u[ci=kn]),Ja(ze,ci,js(kn,h,m,ci,u,xe))}),ze}function sp(u,h,m){var N=m.length;if(null==u)return!N;for(u=Bi(u);N--;){var ae=m[N],ze=u[ae];if(ze===J&&!(ae in u)||!(0,h[ae])(ze))return!1}return!0}function Rh(u,h,m){if("function"!=typeof u)throw new ma(Ae);return Bh(function(){u.apply(J,m)},h)}function yc(u,h,m,N){var ae=-1,xe=Rl,ze=!0,Ke=u.length,lt=[],Ot=h.length;if(!Ke)return lt;m&&(h=ki(h,$o(m))),N?(xe=gh,ze=!1):h.length>=200&&(xe=_h,ze=!1,h=new ba(h));e:for(;++ae-1},Nl.prototype.set=function(u,h){var m=this.__data__,N=gd(m,u);return N<0?(++this.size,m.push([u,h])):m[N][1]=h,this},Za.prototype.clear=function(){this.size=0,this.__data__={hash:new uo,map:new(co||Nl),string:new uo}},Za.prototype.delete=function(u){var h=Vs(this,u).delete(u);return this.size-=h?1:0,h},Za.prototype.get=function(u){return Vs(this,u).get(u)},Za.prototype.has=function(u){return Vs(this,u).has(u)},Za.prototype.set=function(u,h){var m=Vs(this,u),N=m.size;return m.set(u,h),this.size+=m.size==N?0:1,this},ba.prototype.add=ba.prototype.push=function(u){return this.__data__.set(u,q),this},ba.prototype.has=function(u){return this.__data__.has(u)},wa.prototype.clear=function(){this.__data__=new Nl,this.size=0},wa.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},wa.prototype.get=function(u){return this.__data__.get(u)},wa.prototype.has=function(u){return this.__data__.has(u)},wa.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Nl){var N=m.__data__;if(!co||N.length<199)return N.push([u,h]),this.size=++m.size,this;m=this.__data__=new Za(N)}return m.set(u,h),this.size=m.size,this};var vc=il(tl),qm=il(op,!0);function Iv(u,h){var m=!0;return vc(u,function(N,ae,xe){return m=!!h(N,ae,xe)}),m}function Oh(u,h,m){for(var N=-1,ae=u.length;++N0&&m(Ke)?h>1?ws(Ke,h-1,m,N,ae):kr(ae,Ke):N||(ae[ae.length]=Ke)}return ae}var md=jv(),_d=jv(!0);function tl(u,h){return u&&md(u,h,Cs)}function op(u,h){return u&&_d(u,h,Cs)}function Nh(u,h){return pa(h,function(m){return ea(u[m])})}function Wo(u,h){for(var m=0,N=(h=Sc(h,u)).length;null!=u&&mh}function yd(u,h){return null!=u&&ji.call(u,h)}function vd(u,h){return null!=u&&h in Bi(u)}function du(u,h,m){for(var N=m?gh:Rl,ae=u[0].length,xe=u.length,ze=xe,Ke=_t(xe),lt=1/0,Ot=[];ze--;){var Nt=u[ze];ze&&h&&(Nt=ki(Nt,$o(h))),lt=us(Nt.length,lt),Ke[ze]=!m&&(h||ae>=120&&Nt.length>=120)?new ba(ze&&Nt):J}Nt=u[0];var Bt=-1,Jt=Ke[0];e:for(;++Bt=Ke?lt:lt*("desc"==m[N]?-1:1)}return u.index-h.index}(xe,ze,m)});_t--;)st[_t]=st[_t].value;return st}(oC(u,function(xe,ze,Ke){return{criteria:ki(h,function(Ot){return Ot(xe)}),index:++N,value:xe}}))}function Fv(u,h,m){for(var N=-1,ae=h.length,xe={};++N-1;)Ke!==u&&Ln.call(Ke,lt,1),Ln.call(u,lt,1);return u}function Fh(u,h){for(var m=u?h.length:0,N=m-1;m--;){var ae=h[m];if(m==N||ae!==xe){var xe=ae;Io(ae)?Ln.call(u,ae,1):fu(u,ae)}}return u}function Pl(u,h){return u+fi(xh()*(h-u+1))}function lp(u,h){var m="";if(!u||h<1||h>Te)return m;do{h%2&&(m+=u),(h=fi(h/2))&&(u+=u)}while(h);return m}function ai(u,h){return Ep(EC(u,h,eo),u+"")}function lC(u){return Hm(kd(u))}function GP(u,h){var m=kd(u);return Md(m,uu(h,0,m.length))}function cp(u,h,m,N){if(!wr(u))return u;for(var ae=-1,xe=(h=Sc(h,u)).length,ze=xe-1,Ke=u;null!=Ke&&++aeae?0:ae+h),(m=m>ae?ae:m)<0&&(m+=ae),ae=h>m?0:m-h>>>0,h>>>=0;for(var xe=_t(ae);++N>>1,ze=u[xe];null!==ze&&!ta(ze)&&(m?ze<=h:ze=200){var Ot=h?null:r_(u);if(Ot)return Dm(Ot);ze=!1,ae=_h,lt=new ba}else lt=h?[]:Ke;e:for(;++N=N?u:Ss(u,h,m)}var dC=Cv||function(u){return Di.clearTimeout(u)};function hp(u,h){if(h)return u.slice();var m=u.length,N=xv?xv(m):new u.constructor(m);return u.copy(N),N}function mu(u){var h=new u.constructor(u.byteLength);return new dd(h).set(new dd(u)),h}function n_(u,h){var m=h?mu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function xc(u,h){if(u!==h){var m=u!==J,N=null===u,ae=u==u,xe=ta(u),ze=h!==J,Ke=null===h,lt=h==h,Ot=ta(h);if(!Ke&&!Ot&&!xe&&u>h||xe&&ze&<&&!Ke&&!Ot||N&&ze&<||!m&<||!ae)return 1;if(!N&&!xe&&!Ot&&u1?m[ae-1]:J,ze=ae>2?m[2]:J;for(xe=u.length>3&&"function"==typeof xe?(ae--,xe):J,ze&&zs(m[0],m[1],ze)&&(xe=ae<3?J:xe,ae=1),h=Bi(h);++N-1?ae[xe?h[ze]:ze]:J}}function yu(u){return rl(function(h){var m=h.length,N=m,ae=To.prototype.thru;for(u&&h.reverse();N--;){var xe=h[N];if("function"!=typeof xe)throw new ma(Ae);if(ae&&!ze&&"wrapper"==vp(xe))var ze=new To([],!0)}for(N=ze?N:m;++N1&&vi.reverse(),Nt&<Ke))return!1;var Ot=xe.get(u),Nt=xe.get(h);if(Ot&&Nt)return Ot==h&&Nt==u;var Bt=-1,Jt=!0,_n=2&m?new ba:J;for(xe.set(u,h),xe.set(h,u);++Bt-1&&u%1==0&&u1?"& ":"")+h[N],h=h.join(m>2?", ":" "),u.replace(xt,"{\n/* [wrapped with "+h+"] */\n")}(N,function(u,h){return ks(nt,function(m){var N="_."+m[0];h&m[1]&&!Rl(u,N)&&u.push(N)}),u.sort()}(function(u){var h=u.match(Tt);return h?h[1].split($t):[]}(N),m)))}function f_(u){var h=0,m=0;return function(){var N=FP(),ae=16-(N-m);if(m=N,ae>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(J,arguments)}}function Md(u,h){var m=-1,N=u.length,ae=N-1;for(h=h===J?N:h;++m1?u[h-1]:J;return m="function"==typeof m?(u.pop(),m):J,qC(u,m)});function S_(u){var h=Se(u);return h.__chain__=!0,h}function Id(u,h){return h(u)}var x_=rl(function(u){var h=u.length,m=h?u[0]:0,N=this.__wrapped__,ae=function(xe){return $m(xe,u)};return!(h>1||this.__actions__.length)&&N instanceof oi&&Io(m)?((N=N.slice(m,+m+(h?1:0))).__actions__.push({func:Id,args:[ae],thisArg:J}),new To(N,this.__chain__).thru(function(xe){return h&&!xe.length&&xe.push(J),xe})):this.thru(ae)}),XC=Yr(function(u,h,m){ji.call(u,m)?++u[m]:el(u,m,1)}),JC=Uv(g_),eA=Uv(m_);function M_(u,h){return(Mn(u)?ks:vc)(u,On(h,3))}function Ap(u,h){return(Mn(u)?sd:qm)(u,On(h,3))}var nA=Yr(function(u,h,m){ji.call(u,m)?u[m].push(h):el(u,m,[h])}),vb=ai(function(u,h,m){var N=-1,ae="function"==typeof h,xe=ho(u)?_t(u.length):[];return vc(u,function(ze){xe[++N]=ae?es(h,ze,m):Sa(ze,h,m)}),xe}),bb=Yr(function(u,h,m){el(u,m,h)});function ol(u,h){return(Mn(u)?ki:oC)(u,On(h,3))}var Eb=Yr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),Mp=ai(function(u,h){if(null==u)return[];var m=h.length;return m>1&&zs(u,h[0],h[1])?h=[]:m>2&&zs(h[0],h[1],h[2])&&(h=[h[0]]),Ph(u,ws(h,1),[])}),wu=V1||function(){return Di.Date.now()};function Dp(u,h,m){return h=m?J:h,kl(u,H,J,J,J,J,h=u&&null==h?u.length:h)}function I_(u,h){var m;if("function"!=typeof h)throw new ma(Ae);return u=Yn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=J),m}}var Hh=ai(function(u,h,m){var N=1;if(m.length){var ae=ou(m,Td(Hh));N|=j}return kl(u,N,h,m,ae)}),Od=ai(function(u,h,m){var N=3;if(m.length){var ae=ou(m,Td(Od));N|=j}return kl(h,N,u,m,ae)});function Db(u,h,m){var N,ae,xe,ze,Ke,lt,Ot=0,Nt=!1,Bt=!1,Jt=!0;if("function"!=typeof u)throw new ma(Ae);function _n(Ri){var dl=N,Ic=ae;return N=ae=J,Ot=Ri,ze=u.apply(Ic,dl)}function Fn(Ri){return Ot=Ri,Ke=Bh(ci,h),Nt?_n(Ri):ze}function kn(Ri){var dl=Ri-lt;return lt===J||dl>=h||dl<0||Bt&&Ri-Ot>=xe}function ci(){var Ri=wu();if(kn(Ri))return vi(Ri);Ke=Bh(ci,function(Ri){var uT=h-(Ri-lt);return Bt?us(uT,xe-(Ri-Ot)):uT}(Ri))}function vi(Ri){return Ke=J,Jt&&N?_n(Ri):(N=ae=J,ze)}function na(){var Ri=wu(),dl=kn(Ri);if(N=arguments,ae=this,lt=Ri,dl){if(Ke===J)return Fn(lt);if(Bt)return dC(Ke),Ke=Bh(ci,h),_n(lt)}return Ke===J&&(Ke=Bh(ci,h)),ze}return h=fo(h)||0,wr(m)&&(Nt=!!m.leading,xe=(Bt="maxWait"in m)?Br(fo(m.maxWait)||0,h):xe,Jt="trailing"in m?!!m.trailing:Jt),na.cancel=function(){Ke!==J&&dC(Ke),Ot=0,N=lt=ae=Ke=J},na.flush=function(){return Ke===J?ze:vi(wu())},na}var oA=ai(function(u,h){return Rh(u,1,h)}),Ib=ai(function(u,h,m){return Rh(u,fo(h)||0,m)});function Gh(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new ma(Ae);var m=function(){var N=arguments,ae=h?h.apply(this,N):N[0],xe=m.cache;if(xe.has(ae))return xe.get(ae);var ze=u.apply(this,N);return m.cache=xe.set(ae,ze)||xe,ze};return m.cache=new(Gh.Cache||Za),m}function N_(u){if("function"!=typeof u)throw new ma(Ae);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}Gh.Cache=Za;var aA=uC(function(u,h){var m=(h=1==h.length&&Mn(h[0])?ki(h[0],$o(On())):ki(ws(h,1),$o(On()))).length;return ai(function(N){for(var ae=-1,xe=us(N.length,m);++ae=h}),al=nC(function(){return arguments}())?nC:function(u){return Er(u)&&ji.call(u,"callee")&&!Yf.call(u,"callee")},Mn=_t.isArray,Lb=en?$o(en):function(u){return Er(u)&&Es(u)==Xe};function ho(u){return null!=u&&F_(u.length)&&!ea(u)}function br(u){return Er(u)&&ho(u)}var ll=ts||ry,kb=si?$o(si):function(u){return Er(u)&&Es(u)==Le};function Aa(u){if(!Er(u))return!1;var h=Es(u);return h==Re||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!Np(u)}function ea(u){if(!wr(u))return!1;var h=Es(u);return h==Ue||h==qe||"[object AsyncFunction]"==h||"[object Proxy]"==h}function Op(u){return"number"==typeof u&&u==Yn(u)}function F_(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Te}function wr(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Er(u){return null!=u&&"object"==typeof u}var _A=sr?$o(sr):function(u){return Er(u)&&Us(u)==Be};function bA(u){return"number"==typeof u||Er(u)&&Es(u)==z}function Np(u){if(!Er(u)||Es(u)!=be)return!1;var h=_a(u);if(null===h)return!0;var m=ji.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&vr.call(m)==B1}var Ub=lo?$o(lo):function(u){return Er(u)&&Es(u)==wt},wA=pc?$o(pc):function(u){return Er(u)&&Us(u)==pt};function k_(u){return"string"==typeof u||!Mn(u)&&Er(u)&&Es(u)==fe}function ta(u){return"symbol"==typeof u||Er(u)&&Es(u)==B}var $h=Jr?$o(Jr):function(u){return Er(u)&&F_(u.length)&&!!wn[Es(u)]},Tc=mp(Pv),B_=mp(function(u,h){return u<=h});function zb(u){if(!u)return[];if(ho(u))return k_(u)?Xa(u):Qs(u);if(Eh&&u[Eh])return function(st){for(var Mt,_t=[];!(Mt=st.next()).done;)_t.push(Mt.value);return _t}(u[Eh]());var h=Us(u);return(h==Be?wv:h==pt?Dm:kd)(u)}function cl(u){return u?(u=fo(u))===se||u===-se?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Yn(u){var h=cl(u),m=h%1;return h==h?m?h-m:h:0}function j_(u){return u?uu(Yn(u),0,ye):0}function fo(u){if("number"==typeof u)return u;if(ta(u))return NaN;if(wr(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=wr(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=bv(u);var m=Qi.test(u);return m||qn.test(u)?vv(u.slice(2),m?2:8):bn.test(u)?NaN:+u}function Hb(u){return xa(u,Js(u))}function Ii(u){return null==u?"":Do(u)}var EA=Fl(function(u,h){if(wp(h)||ho(h))xa(h,Cs(h),u);else for(var m in h)ji.call(h,m)&&Ja(u,m,h[m])}),SA=Fl(function(u,h){xa(h,Js(h),u)}),Nd=Fl(function(u,h,m,N){xa(h,Js(h),u,N)}),xA=Fl(function(u,h,m,N){xa(h,Cs(h),u,N)}),Gb=rl($m),AA=ai(function(u,h){u=Bi(u);var m=-1,N=h.length,ae=N>2?h[2]:J;for(ae&&zs(h[0],h[1],ae)&&(N=1);++m1),xe}),xa(u,s_(u),m),N&&(m=js(m,7,_p));for(var ae=h.length;ae--;)fu(m,h[ae]);return m}),RA=rl(function(u,h){return null==u?{}:function(u,h){return Fv(u,h,function(m,N){return Pp(u,N)})}(u,h)});function Qb(u,h){if(null==u)return{};var m=ki(s_(u),function(N){return[N]});return h=On(h),Fv(u,m,function(N,ae){return h(N,ae[0])})}var OA=vu(Cs),Jb=vu(Js);function kd(u){return null==u?[]:Mm(u,Cs(u))}var kA=Ll(function(u,h,m){return h=h.toLowerCase(),u+(m?H_(h):h)});function H_(u){return kp(Ii(u).toLowerCase())}function G_(u){return(u=Ii(u))&&u.replace(da,AP).replace(xm,"")}var jA=Ll(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),VA=Ll(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),dF=fp("toLowerCase"),$A=Ll(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),q_=Ll(function(u,h,m){return u+(m?" ":"")+kp(h)}),sw=Ll(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),kp=fp("toUpperCase");function Q_(u,h,m){return u=Ii(u),(h=m?J:h)===J?function(st){return Dl.test(st)}(u)?function(st){return st.match(gv)||[]}(u):function(st){return st.match(jn)||[]}(u):u.match(h)||[]}var Z_=ai(function(u,h){try{return es(u,J,h)}catch(m){return Aa(m)?m:new xn(m)}}),ow=rl(function(u,h){return ks(h,function(m){m=Zn(m),el(u,m,Hh(u[m],u))}),u});function J_(u){return function(){return u}}var fF=yu(),Bd=yu(!0);function eo(u){return u}function Eu(u){return sC("function"==typeof u?u:js(u,1))}var ey=ai(function(u,h){return function(m){return Sa(m,u,h)}}),aw=ai(function(u,h){return function(m){return Sa(u,m,h)}});function ty(u,h,m){var N=Cs(h),ae=Nh(h,N);null==m&&(!wr(h)||!ae.length&&N.length)&&(m=h,h=u,u=this,ae=Nh(h,Cs(h)));var xe=!(wr(m)&&"chain"in m&&!m.chain),ze=ea(u);return ks(ae,function(Ke){var lt=h[Ke];u[Ke]=lt,ze&&(u.prototype[Ke]=function(){var Ot=this.__chain__;if(xe||Ot){var Nt=u(this.__wrapped__),Bt=Nt.__actions__=Qs(this.__actions__);return Bt.push({func:lt,args:arguments,thisArg:u}),Nt.__chain__=Ot,Nt}return lt.apply(u,kr([this.value()],arguments))})}),u}function ny(){}var ZA=pp(ki),JA=pp(Qn),cw=pp(Co);function Su(u){return Xo(u)?Am(Zn(u)):function(u){return function(h){return Wo(h,u)}}(u)}var eT=Hv(),tT=Hv(!0);function Dc(){return[]}function ry(){return!1}var Hn=i_(function(u,h){return u+h},0),sy=Ad("ceil"),gF=i_(function(u,h){return u/h},1),Ul=Ad("floor"),fw=i_(function(u,h){return u*h},1),pw=Ad("round"),gw=i_(function(u,h){return u-h},0);return Se.after=function(u,h){if("function"!=typeof h)throw new ma(Ae);return u=Yn(u),function(){if(--u<1)return h.apply(this,arguments)}},Se.ary=Dp,Se.assign=EA,Se.assignIn=SA,Se.assignInWith=Nd,Se.assignWith=xA,Se.at=Gb,Se.before=I_,Se.bind=Hh,Se.bindAll=ow,Se.bindKey=Od,Se.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Mn(u)?u:[u]},Se.chain=S_,Se.chunk=function(u,h,m){h=(m?zs(u,h,m):h===J)?1:Br(Yn(h),0);var N=null==u?0:u.length;if(!N||h<1)return[];for(var ae=0,xe=0,ze=_t(Ft(N/h));aeae?0:ae+m),(N=N===J||N>ae?ae:Yn(N))<0&&(N+=ae),N=m>N?0:j_(N);m>>0)?(u=Ii(u))&&("string"==typeof h||null!=h&&!Ub(h))&&!(h=Do(h))&&yh(u)?nl(Xa(u),0,m):u.split(h,m):[]},Se.spread=function(u,h){if("function"!=typeof u)throw new ma(Ae);return h=null==h?0:Br(Yn(h),0),ai(function(m){var N=m[h],ae=nl(m,0,h);return N&&kr(ae,N),es(u,this,ae)})},Se.tail=function(u){var h=null==u?0:u.length;return h?Ss(u,1,h):[]},Se.take=function(u,h,m){return u&&u.length?Ss(u,0,(h=m||h===J?1:Yn(h))<0?0:h):[]},Se.takeRight=function(u,h,m){var N=null==u?0:u.length;return N?Ss(u,(h=N-(h=m||h===J?1:Yn(h)))<0?0:h,N):[]},Se.takeRightWhile=function(u,h){return u&&u.length?pu(u,On(h,3),!1,!0):[]},Se.takeWhile=function(u,h){return u&&u.length?pu(u,On(h,3)):[]},Se.tap=function(u,h){return h(u),u},Se.throttle=function(u,h,m){var N=!0,ae=!0;if("function"!=typeof u)throw new ma(Ae);return wr(m)&&(N="leading"in m?!!m.leading:N,ae="trailing"in m?!!m.trailing:ae),Db(u,h,{leading:N,maxWait:h,trailing:ae})},Se.thru=Id,Se.toArray=zb,Se.toPairs=OA,Se.toPairsIn=Jb,Se.toPath=function(u){return Mn(u)?ki(u,Zn):ta(u)?[u]:Qs(tb(Ii(u)))},Se.toPlainObject=Hb,Se.transform=function(u,h,m){var N=Mn(u),ae=N||ll(u)||$h(u);if(h=On(h,4),null==m){var xe=u&&u.constructor;m=ae?N?new xe:[]:wr(u)&&ea(xe)?cu(_a(u)):{}}return(ae?ks:tl)(u,function(ze,Ke,lt){return h(m,ze,Ke,lt)}),m},Se.unary=function(u){return Dp(u,1)},Se.union=db,Se.unionBy=GC,Se.unionWith=$C,Se.uniq=function(u){return u&&u.length?wc(u):[]},Se.uniqBy=function(u,h){return u&&u.length?wc(u,On(h,2)):[]},Se.uniqWith=function(u,h){return h="function"==typeof h?h:J,u&&u.length?wc(u,J,h):[]},Se.unset=function(u,h){return null==u||fu(u,h)},Se.unzip=hb,Se.unzipWith=qC,Se.update=function(u,h,m){return null==u?u:up(u,h,t_(m))},Se.updateWith=function(u,h,m,N){return N="function"==typeof N?N:J,null==u?u:up(u,h,t_(m),N)},Se.values=kd,Se.valuesIn=function(u){return null==u?[]:Mm(u,Js(u))},Se.without=fb,Se.words=Q_,Se.wrap=function(u,h){return Ip(t_(h),u)},Se.xor=eF,Se.xorBy=Ro,Se.xorWith=w_,Se.zip=E_,Se.zipObject=function(u,h){return dp(u||[],h||[],Ja)},Se.zipObjectDeep=function(u,h){return dp(u||[],h||[],cp)},Se.zipWith=zh,Se.entries=OA,Se.entriesIn=Jb,Se.extend=SA,Se.extendWith=Nd,ty(Se,Se),Se.add=Hn,Se.attempt=Z_,Se.camelCase=kA,Se.capitalize=H_,Se.ceil=sy,Se.clamp=function(u,h,m){return m===J&&(m=h,h=J),m!==J&&(m=(m=fo(m))==m?m:0),h!==J&&(h=(h=fo(h))==h?h:0),uu(fo(u),h,m)},Se.clone=function(u){return js(u,4)},Se.cloneDeep=function(u){return js(u,5)},Se.cloneDeepWith=function(u,h){return js(u,5,h="function"==typeof h?h:J)},Se.cloneWith=function(u,h){return js(u,4,h="function"==typeof h?h:J)},Se.conformsTo=function(u,h){return null==h||sp(u,h,Cs(h))},Se.deburr=G_,Se.defaultTo=function(u,h){return null==u||u!=u?h:u},Se.divide=gF,Se.endsWith=function(u,h,m){u=Ii(u),h=Do(h);var N=u.length,ae=m=m===J?N:uu(Yn(m),0,N);return(m-=h.length)>=0&&u.slice(m,ae)==h},Se.eq=Cn,Se.escape=function(u){return(u=Ii(u))&&Qt.test(u)?u.replace(ua,TP):u},Se.escapeRegExp=function(u){return(u=Ii(u))&&ct.test(u)?u.replace(ke,"\\$&"):u},Se.every=function(u,h,m){var N=Mn(u)?Qn:Iv;return m&&zs(u,h,m)&&(h=J),N(u,On(h,3))},Se.find=JC,Se.findIndex=g_,Se.findKey=function(u,h){return mh(u,On(h,3),tl)},Se.findLast=eA,Se.findLastIndex=m_,Se.findLastKey=function(u,h){return mh(u,On(h,3),op)},Se.floor=Ul,Se.forEach=M_,Se.forEachRight=Ap,Se.forIn=function(u,h){return null==u?u:md(u,On(h,3),Js)},Se.forInRight=function(u,h){return null==u?u:_d(u,On(h,3),Js)},Se.forOwn=function(u,h){return u&&tl(u,On(h,3))},Se.forOwnRight=function(u,h){return u&&op(u,On(h,3))},Se.get=Kh,Se.gt=on,Se.gte=Fb,Se.has=function(u,h){return null!=u&&Xv(u,h,yd)},Se.hasIn=Pp,Se.head=ib,Se.identity=eo,Se.includes=function(u,h,m,N){u=ho(u)?u:kd(u),m=m&&!N?Yn(m):0;var ae=u.length;return m<0&&(m=Br(ae+m,0)),k_(u)?m<=ae&&u.indexOf(h,m)>-1:!!ae&&Ya(u,h,m)>-1},Se.indexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=null==m?0:Yn(m);return ae<0&&(ae=Br(N+ae,0)),Ya(u,h,ae)},Se.inRange=function(u,h,m){return h=cl(h),m===J?(m=h,h=0):m=cl(m),function(u,h,m){return u>=us(h,m)&&u=-Te&&u<=Te},Se.isSet=wA,Se.isString=k_,Se.isSymbol=ta,Se.isTypedArray=$h,Se.isUndefined=function(u){return u===J},Se.isWeakMap=function(u){return Er(u)&&Us(u)==k},Se.isWeakSet=function(u){return Er(u)&&"[object WeakSet]"==Es(u)},Se.join=function(u,h){return null==u?"":Sh.call(u,h)},Se.kebabCase=jA,Se.last=Qo,Se.lastIndexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=N;return m!==J&&(ae=(ae=Yn(m))<0?Br(N+ae,0):us(ae,N-1)),h==h?function(st,Mt,_t){for(var sn=_t+1;sn--;)if(st[sn]===Mt)return sn;return sn}(u,h,ae):ad(u,gc,ae,!0)},Se.lowerCase=VA,Se.lowerFirst=dF,Se.lt=Tc,Se.lte=B_,Se.max=function(u){return u&&u.length?Oh(u,eo,Ea):J},Se.maxBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Ea):J},Se.mean=function(u){return vs(u,eo)},Se.meanBy=function(u,h){return vs(u,On(h,2))},Se.min=function(u){return u&&u.length?Oh(u,eo,Pv):J},Se.minBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Pv):J},Se.stubArray=Dc,Se.stubFalse=ry,Se.stubObject=function(){return{}},Se.stubString=function(){return""},Se.stubTrue=function(){return!0},Se.multiply=fw,Se.nth=function(u,h){return u&&u.length?hu(u,Yn(h)):J},Se.noConflict=function(){return Di._===this&&(Di._=Pm),this},Se.noop=ny,Se.now=wu,Se.pad=function(u,h,m){u=Ii(u);var N=(h=Yn(h))?vh(u):0;if(!h||N>=h)return u;var ae=(h-N)/2;return gp(fi(ae),m)+u+gp(Ft(ae),m)},Se.padEnd=function(u,h,m){u=Ii(u);var N=(h=Yn(h))?vh(u):0;return h&&Nh){var N=u;u=h,h=N}if(m||u%1||h%1){var ae=xh();return us(u+ae*(h-u+I1("1e-"+((ae+"").length-1))),h)}return Pl(u,h)},Se.reduce=function(u,h,m){var N=Mn(u)?su:Go,ae=arguments.length<3;return N(u,On(h,4),m,ae,vc)},Se.reduceRight=function(u,h,m){var N=Mn(u)?od:Go,ae=arguments.length<3;return N(u,On(h,4),m,ae,qm)},Se.repeat=function(u,h,m){return h=(m?zs(u,h,m):h===J)?1:Yn(h),lp(Ii(u),h)},Se.replace=function(){var u=arguments,h=Ii(u[0]);return u.length<3?h:h.replace(u[1],u[2])},Se.result=function(u,h,m){var N=-1,ae=(h=Sc(h,u)).length;for(ae||(ae=1,u=J);++NTe)return[];var m=ye,N=us(u,ye);h=On(h),u-=ye;for(var ae=cd(N,h);++m=xe)return u;var Ke=m-vh(N);if(Ke<1)return N;var lt=ze?nl(ze,0,Ke).join(""):u.slice(0,Ke);if(ae===J)return lt+N;if(ze&&(Ke+=lt.length-Ke),Ub(ae)){if(u.slice(Ke).search(ae)){var Ot,Nt=lt;for(ae.global||(ae=Om(ae.source,Ii(zn.exec(ae))+"g")),ae.lastIndex=0;Ot=ae.exec(Nt);)var Bt=Ot.index;lt=lt.slice(0,Bt===J?Ke:Bt)}}else if(u.indexOf(Do(ae),Ke)!=Ke){var Jt=lt.lastIndexOf(ae);Jt>-1&&(lt=lt.slice(0,Jt))}return lt+N},Se.unescape=function(u){return(u=Ii(u))&&ms.test(u)?u.replace(Al,Rm):u},Se.uniqueId=function(u){var h=++PP;return Ii(u)+h},Se.upperCase=sw,Se.upperFirst=kp,Se.each=M_,Se.eachRight=Ap,Se.first=ib,ty(Se,function(){var u={};return tl(Se,function(h,m){ji.call(Se.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),Se.VERSION="4.17.21",ks(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){Se[u].placeholder=Se}),ks(["drop","take"],function(u,h){oi.prototype[u]=function(m){m=m===J?1:Br(Yn(m),0);var N=this.__filtered__&&!h?new oi(this):this.clone();return N.__filtered__?N.__takeCount__=us(m,N.__takeCount__):N.__views__.push({size:us(m,ye),type:u+(N.__dir__<0?"Right":"")}),N},oi.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),ks(["filter","map","takeWhile"],function(u,h){var m=h+1,N=1==m||3==m;oi.prototype[u]=function(ae){var xe=this.clone();return xe.__iteratees__.push({iteratee:On(ae,3),type:m}),xe.__filtered__=xe.__filtered__||N,xe}}),ks(["head","last"],function(u,h){var m="take"+(h?"Right":"");oi.prototype[u]=function(){return this[m](1).value()[0]}}),ks(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");oi.prototype[u]=function(){return this.__filtered__?new oi(this):this[m](1)}}),oi.prototype.compact=function(){return this.filter(eo)},oi.prototype.find=function(u){return this.filter(u).head()},oi.prototype.findLast=function(u){return this.reverse().find(u)},oi.prototype.invokeMap=ai(function(u,h){return"function"==typeof u?new oi(this):this.map(function(m){return Sa(m,u,h)})}),oi.prototype.reject=function(u){return this.filter(N_(On(u)))},oi.prototype.slice=function(u,h){u=Yn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new oi(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==J&&(m=(h=Yn(h))<0?m.dropRight(-h):m.take(h-u)),m)},oi.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},oi.prototype.toArray=function(){return this.take(ye)},tl(oi.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),N=/^(?:head|last)$/.test(h),ae=Se[N?"take"+("last"==h?"Right":""):h],xe=N||/^find/.test(h);!ae||(Se.prototype[h]=function(){var ze=this.__wrapped__,Ke=N?[1]:arguments,lt=ze instanceof oi,Ot=Ke[0],Nt=lt||Mn(ze),Bt=function(ci){var vi=ae.apply(Se,kr([ci],Ke));return N&&Jt?vi[0]:vi};Nt&&m&&"function"==typeof Ot&&1!=Ot.length&&(lt=Nt=!1);var Jt=this.__chain__,_n=!!this.__actions__.length,Fn=xe&&!Jt,li=lt&&!_n;if(!xe&&Nt){ze=li?ze:new oi(this);var kn=u.apply(ze,Ke);return kn.__actions__.push({func:Id,args:[Bt],thisArg:J}),new To(kn,Jt)}return Fn&&li?u.apply(this,Ke):(kn=this.thru(Bt),Fn?N?kn.value()[0]:kn.value():kn)})}),ks(["pop","push","shift","sort","splice","unshift"],function(u){var h=or[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",N=/^(?:pop|shift)$/.test(u);Se.prototype[u]=function(){var ae=arguments;if(N&&!this.__chain__){var xe=this.value();return h.apply(Mn(xe)?xe:[],ae)}return this[m](function(ze){return h.apply(Mn(ze)?ze:[],ae)})}}),tl(oi.prototype,function(u,h){var m=Se[h];if(m){var N=m.name+"";ji.call(hd,N)||(hd[N]=[]),hd[N].push({name:h,func:m})}}),hd[Cc(J,2).name]=[{name:"wrapper",func:J}],oi.prototype.clone=function(){var u=new oi(this.__wrapped__);return u.__actions__=Qs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Qs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Qs(this.__views__),u},oi.prototype.reverse=function(){if(this.__filtered__){var u=new oi(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},oi.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Mn(u),N=h<0,ae=m?u.length:0,xe=function(u,h,m){for(var N=-1,ae=m.length;++N=this.__values__.length;return{done:u,value:u?J:this.__values__[this.__index__++]}},Se.prototype.plant=function(u){for(var h,m=this;m instanceof Mh;){var N=Sp(m);N.__index__=0,N.__values__=J,h?ae.__wrapped__=N:h=N;var ae=N;m=m.__wrapped__}return ae.__wrapped__=u,h},Se.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof oi){var h=u;return this.__actions__.length&&(h=new oi(this)),(h=h.reverse()).__actions__.push({func:Id,args:[b_],thisArg:J}),new To(h,this.__chain__)}return this.thru(b_)},Se.prototype.toJSON=Se.prototype.valueOf=Se.prototype.value=function(){return cC(this.__wrapped__,this.__actions__)},Se.prototype.first=Se.prototype.head,Eh&&(Se.prototype[Eh]=function(){return this}),Se}();Di._=bh,(gt=function(){return bh}.call(it,tt,it,kt))!==J&&(kt.exports=gt)}.call(this)},478:function(kt){kt.exports=function(){"use strict";function it(rt,ot){for(var ut=0;utrt.length)&&(ot=rt.length);for(var ut=0,pe=new Array(ot);ut=rt.length?{done:!0}:{done:!1,value:rt[pe++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var dt={exports:{}};function K(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}dt.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:K,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,q=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,re={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(ot){return re[ot]};var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function O(rt){return rt.replace(S,function(ot,ut){return"colon"===(ut=ut.toLowerCase())?":":"#"===ut.charAt(0)?"x"===ut.charAt(1)?String.fromCharCode(parseInt(ut.substring(2),16)):String.fromCharCode(+ut.substring(1)):""})}var T=/(^|[^\[])\^/g;var y=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var j={},I=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,Y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(rt,ot){j[" "+rt]||(j[" "+rt]=I.test(rt)?rt+"/":U(rt,"/",!0));var ut=-1===(rt=j[" "+rt]).indexOf(":");return"//"===ot.substring(0,2)?ut?ot:rt.replace(H,"$1")+ot:"/"===ot.charAt(0)?ut?ot:rt.replace(Y,"$1")+ot:rt+ot}function U(rt,ot,ut){var pe=rt.length;if(0===pe)return"";for(var ve=0;ve1;)1&ot&&(ut+=rt),ot>>=1,rt+=rt;return ut+rt},Te=dt.exports.defaults,me=U,te=function(rt,ot){var pe=rt.replace(/\|/g,function(ke,ct,Qe){for(var vt=!1,xt=ct;--xt>=0&&"\\"===Qe[xt];)vt=!vt;return vt?"|":" |"}).split(/ \|/),ve=0;if(pe.length>ot)pe.splice(ot);else for(;pe.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},ot.code=function(pe){var ve=this.rules.block.code.exec(pe);if(ve){var ke=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:me(ke,"\n")}}},ot.fences=function(pe){var ve=this.rules.block.fences.exec(pe);if(ve){var ke=ve[0],ct=function(rt,ot){var ut=rt.match(/^(\s+)(?:```)/);if(null===ut)return ot;var pe=ut[1];return ot.split("\n").map(function(ve){var ke=ve.match(/^\s+/);return null===ke?ve:ke[0].length>=pe.length?ve.slice(pe.length):ve}).join("\n")}(ke,ve[3]||"");return{type:"code",raw:ke,lang:ve[2]?ve[2].trim():ve[2],text:ct}}},ot.heading=function(pe){var ve=this.rules.block.heading.exec(pe);if(ve){var ke=ve[2].trim();if(/#$/.test(ke)){var ct=me(ke,"#");(this.options.pedantic||!ct||/ $/.test(ct))&&(ke=ct.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:ke}}},ot.nptable=function(pe){var ve=this.rules.block.nptable.exec(pe);if(ve){var ke={type:"table",header:te(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(ke.header.length===ke.align.length){var Qe,ct=ke.align.length;for(Qe=0;Qe ?/gm,"");return{type:"blockquote",raw:ve[0],text:ke}}},ot.list=function(pe){var ve=this.rules.block.list.exec(pe);if(ve){var $t,jn,ii,Dn,fn,zn,bn,Qi,Zi,ke=ve[0],ct=ve[2],Qe=ct.length>1,vt={type:"list",raw:ke,ordered:Qe,start:Qe?+ct.slice(0,-1):"",loose:!1,items:[]},xt=ve[0].match(this.rules.block.item),Tt=!1,qn=xt.length;ii=this.rules.block.listItemStart.exec(xt[0]);for(var Pi=0;Piii[1].length:Dn[1].length>=ii[0].length||Dn[1].length>3){xt.splice(Pi,2,xt[Pi]+(!this.options.pedantic&&Dn[1].length/i.test(ct[0])&&(ve=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(ct[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ct[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:ct[0],inLink:ve,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ct[0]):ye(ct[0]):ct[0]}},ot.link=function(pe){var ve=this.rules.inline.link.exec(pe);if(ve){var ke=ve[2].trim();if(!this.options.pedantic&&/^$/.test(ke))return;var ct=me(ke.slice(0,-1),"\\");if((ke.length-ct.length)%2==0)return}else{var Qe=De(ve[2],"()");if(Qe>-1){var xt=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Qe;ve[2]=ve[2].substring(0,Qe),ve[0]=ve[0].substring(0,xt).trim(),ve[3]=""}}var Tt=ve[2],$t="";if(this.options.pedantic){var jn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Tt);jn&&(Tt=jn[1],$t=jn[3])}else $t=ve[3]?ve[3].slice(1,-1):"";return Tt=Tt.trim(),/^$/.test(ke)?Tt.slice(1):Tt.slice(1,-1)),Ve(ve,{href:Tt&&Tt.replace(this.rules.inline._escapes,"$1"),title:$t&&$t.replace(this.rules.inline._escapes,"$1")},ve[0])}},ot.reflink=function(pe,ve){var ke;if((ke=this.rules.inline.reflink.exec(pe))||(ke=this.rules.inline.nolink.exec(pe))){var ct=(ke[2]||ke[1]).replace(/\s+/g," ");if(!(ct=ve[ct.toLowerCase()])||!ct.href){var Qe=ke[0].charAt(0);return{type:"text",raw:Qe,text:Qe}}return Ve(ke,ct,ke[0])}},ot.emStrong=function(pe,ve,ke){void 0===ke&&(ke="");var ct=this.rules.inline.emStrong.lDelim.exec(pe);if(ct&&(!ct[3]||!ke.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Qe=ct[1]||ct[2]||"";if(!Qe||Qe&&(""===ke||this.rules.inline.punctuation.exec(ke))){var xt,Tt,vt=ct[0].length-1,$t=vt,jn=0,ii="*"===ct[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ii.lastIndex=0,ve=ve.slice(-1*pe.length+vt);null!=(ct=ii.exec(ve));)if(xt=ct[1]||ct[2]||ct[3]||ct[4]||ct[5]||ct[6]){if(Tt=xt.length,ct[3]||ct[4]){$t+=Tt;continue}if((ct[5]||ct[6])&&vt%3&&!((vt+Tt)%3)){jn+=Tt;continue}if(!(($t-=Tt)>0))return Tt=Math.min(Tt,Tt+$t+jn),Math.min(vt,Tt)%2?{type:"em",raw:pe.slice(0,vt+ct.index+Tt+1),text:pe.slice(1,vt+ct.index+Tt)}:{type:"strong",raw:pe.slice(0,vt+ct.index+Tt+1),text:pe.slice(2,vt+ct.index+Tt-1)}}}}},ot.codespan=function(pe){var ve=this.rules.inline.code.exec(pe);if(ve){var ke=ve[2].replace(/\n/g," "),ct=/[^ ]/.test(ke),Qe=/^ /.test(ke)&&/ $/.test(ke);return ct&&Qe&&(ke=ke.substring(1,ke.length-1)),ke=ye(ke,!0),{type:"codespan",raw:ve[0],text:ke}}},ot.br=function(pe){var ve=this.rules.inline.br.exec(pe);if(ve)return{type:"br",raw:ve[0]}},ot.del=function(pe){var ve=this.rules.inline.del.exec(pe);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},ot.autolink=function(pe,ve){var ct,Qe,ke=this.rules.inline.autolink.exec(pe);if(ke)return Qe="@"===ke[2]?"mailto:"+(ct=ye(this.options.mangle?ve(ke[1]):ke[1])):ct=ye(ke[1]),{type:"link",raw:ke[0],text:ct,href:Qe,tokens:[{type:"text",raw:ct,text:ct}]}},ot.url=function(pe,ve){var ke;if(ke=this.rules.inline.url.exec(pe)){var ct,Qe;if("@"===ke[2])Qe="mailto:"+(ct=ye(this.options.mangle?ve(ke[0]):ke[0]));else{var vt;do{vt=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0]}while(vt!==ke[0]);ct=ye(ke[0]),Qe="www."===ke[1]?"http://"+ct:ct}return{type:"link",raw:ke[0],text:ct,href:Qe,tokens:[{type:"text",raw:ct,text:ct}]}}},ot.inlineText=function(pe,ve,ke){var Qe,ct=this.rules.inline.text.exec(pe);if(ct)return Qe=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ct[0]):ye(ct[0]):ct[0]:ye(this.options.smartypants?ke(ct[0]):ct[0]),{type:"text",raw:ct[0],text:Qe}},rt}(),Je=se_noopTest,Ye=se_edit,je=se_merge,Le={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Je,table:Je,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Le.def=Ye(Le.def).replace("label",Le._label).replace("title",Le._title).getRegex(),Le.bullet=/(?:[*+-]|\d{1,9}[.)])/,Le.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Le.item=Ye(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Ye(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Ye(Le.list).replace(/bull/g,Le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Le.def.source+")").getRegex(),Le._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Le._comment=/|$)/,Le.html=Ye(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Ye(Le._paragraph).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.blockquote=Ye(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=je({},Le),Le.gfm=je({},Le.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Le.gfm.nptable=Ye(Le.gfm.nptable).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.gfm.table=Ye(Le.gfm.table).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.pedantic=je({},Le.normal,{html:Ye("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Je,paragraph:Ye(Le.normal._paragraph).replace("hr",Le.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ee.punctuation=Ye(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ee.escapedEmSt=/\\\*|\\_/g,Ee._comment=Ye(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ee.emStrong.lDelim=Ye(Ee.emStrong.lDelim).replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimAst=Ye(Ee.emStrong.rDelimAst,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimUnd=Ye(Ee.emStrong.rDelimUnd,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ee.autolink=Ye(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Ye(Ee.tag).replace("comment",Ee._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Ye(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Ye(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Ye(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=je({},Ee),Ee.pedantic=je({},Ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ye(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=je({},Ee.normal,{escape:Ye(Ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(pe="x"+pe.toString(16)),ot+="&#"+pe+";";return ot}var Pe=function(){function rt(ut){this.tokens=[],this.tokens.links=Object.create(null),this.options=ut||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var pe={block:Be.normal,inline:z.normal};this.options.pedantic?(pe.block=Be.pedantic,pe.inline=z.pedantic):this.options.gfm&&(pe.block=Be.gfm,pe.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=pe}rt.lex=function(pe,ve){return new rt(ve).lex(pe)},rt.lexInline=function(pe,ve){return new rt(ve).inlineTokens(pe)};var ot=rt.prototype;return ot.lex=function(pe){return pe=pe.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(pe,this.tokens,!0),this.inline(this.tokens),this.tokens},ot.blockTokens=function(pe,ve,ke){var Qe,vt,xt,Tt,$t,jn,ct=this;for(void 0===ve&&(ve=[]),void 0===ke&&(ke=!0),this.options.pedantic&&(pe=pe.replace(/^ +$/gm,""));pe;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Dn){return!!(Qe=Dn.call(ct,pe,ve))&&(pe=pe.substring(Qe.raw.length),ve.push(Qe),!0)}))){if(Qe=this.tokenizer.space(pe)){pe=pe.substring(Qe.raw.length),Qe.type&&ve.push(Qe);continue}if(Qe=this.tokenizer.code(pe)){pe=pe.substring(Qe.raw.length),(Tt=ve[ve.length-1])&&"paragraph"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe);continue}if(Qe=this.tokenizer.fences(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.heading(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.nptable(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.hr(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.blockquote(pe)){pe=pe.substring(Qe.raw.length),Qe.tokens=this.blockTokens(Qe.text,[],ke),ve.push(Qe);continue}if(Qe=this.tokenizer.list(pe)){for(pe=pe.substring(Qe.raw.length),xt=Qe.items.length,vt=0;vt=0&&(Dn=Math.min(Dn,zn))}),Dn<1/0&&Dn>=0&&($t=pe.substring(0,Dn+1))}(),ke&&(Qe=this.tokenizer.paragraph($t))){Tt=ve[ve.length-1],jn&&"paragraph"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe),jn=$t.length!==pe.length,pe=pe.substring(Qe.raw.length);continue}if(Qe=this.tokenizer.text(pe)){pe=pe.substring(Qe.raw.length),(Tt=ve[ve.length-1])&&"text"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe);continue}if(pe){var ii="Infinite loop on byte: "+pe.charCodeAt(0);if(this.options.silent){console.error(ii);break}throw new Error(ii)}}return ve},ot.inline=function(pe){var ve,ke,ct,Qe,vt,xt,Tt=pe.length;for(ve=0;ve0)for(;null!=(jn=this.tokenizer.rules.inline.reflinkSearch.exec($t));)fn.includes(jn[0].slice(jn[0].lastIndexOf("[")+1,-1))&&($t=$t.slice(0,jn.index)+"["+X("a",jn[0].length-2)+"]"+$t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(jn=this.tokenizer.rules.inline.blockSkip.exec($t));)$t=$t.slice(0,jn.index)+"["+X("a",jn[0].length-2)+"]"+$t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(jn=this.tokenizer.rules.inline.escapedEmSt.exec($t));)$t=$t.slice(0,jn.index)+"++"+$t.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;pe;)if(ii||(Dn=""),ii=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(bn){return!!(vt=bn.call(Qe,pe,ve))&&(pe=pe.substring(vt.raw.length),ve.push(vt),!0)}))){if(vt=this.tokenizer.escape(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.tag(pe,ke,ct)){pe=pe.substring(vt.raw.length),ke=vt.inLink,ct=vt.inRawBlock,(xt=ve[ve.length-1])&&"text"===vt.type&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.link(pe)){pe=pe.substring(vt.raw.length),"link"===vt.type&&(vt.tokens=this.inlineTokens(vt.text,[],!0,ct)),ve.push(vt);continue}if(vt=this.tokenizer.reflink(pe,this.tokens.links)){pe=pe.substring(vt.raw.length),xt=ve[ve.length-1],"link"===vt.type?(vt.tokens=this.inlineTokens(vt.text,[],!0,ct),ve.push(vt)):xt&&"text"===vt.type&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.emStrong(pe,$t,Dn)){pe=pe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,ct),ve.push(vt);continue}if(vt=this.tokenizer.codespan(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.br(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.del(pe)){pe=pe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,ct),ve.push(vt);continue}if(vt=this.tokenizer.autolink(pe,ce)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(!ke&&(vt=this.tokenizer.url(pe,ce))){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(Tt=pe,this.options.extensions&&this.options.extensions.startInline&&function(){var bn=1/0,Qi=pe.slice(1),Zi=void 0;Qe.options.extensions.startInline.forEach(function(qn){"number"==typeof(Zi=qn.call(this,Qi))&&Zi>=0&&(bn=Math.min(bn,Zi))}),bn<1/0&&bn>=0&&(Tt=pe.substring(0,bn+1))}(),vt=this.tokenizer.inlineText(Tt,ct,be)){pe=pe.substring(vt.raw.length),"_"!==vt.raw.slice(-1)&&(Dn=vt.raw.slice(-1)),ii=!0,(xt=ve[ve.length-1])&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(pe){var zn="Infinite loop on byte: "+pe.charCodeAt(0);if(this.options.silent){console.error(zn);break}throw new Error(zn)}}return ve},function(rt,ot,ut){ot&&it(rt.prototype,ot),ut&&it(rt,ut)}(rt,null,[{key:"rules",get:function(){return{block:Be,inline:z}}}]),rt}(),wt=dt.exports.defaults,pt=se_cleanUrl,fe=se_escape,B=function(){function rt(ut){this.options=ut||wt}var ot=rt.prototype;return ot.code=function(pe,ve,ke){var ct=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Qe=this.options.highlight(pe,ct);null!=Qe&&Qe!==pe&&(ke=!0,pe=Qe)}return pe=pe.replace(/\n$/,"")+"\n",ct?'
'+(ke?pe:fe(pe,!0))+"
\n":"
"+(ke?pe:fe(pe,!0))+"
\n"},ot.blockquote=function(pe){return"
\n"+pe+"
\n"},ot.html=function(pe){return pe},ot.heading=function(pe,ve,ke,ct){return this.options.headerIds?"'+pe+"\n":""+pe+"\n"},ot.hr=function(){return this.options.xhtml?"
\n":"
\n"},ot.list=function(pe,ve,ke){var ct=ve?"ol":"ul";return"<"+ct+(ve&&1!==ke?' start="'+ke+'"':"")+">\n"+pe+"\n"},ot.listitem=function(pe){return"
  • "+pe+"
  • \n"},ot.checkbox=function(pe){return" "},ot.paragraph=function(pe){return"

    "+pe+"

    \n"},ot.table=function(pe,ve){return ve&&(ve=""+ve+""),"\n\n"+pe+"\n"+ve+"
    \n"},ot.tablerow=function(pe){return"\n"+pe+"\n"},ot.tablecell=function(pe,ve){var ke=ve.header?"th":"td";return(ve.align?"<"+ke+' align="'+ve.align+'">':"<"+ke+">")+pe+"\n"},ot.strong=function(pe){return""+pe+""},ot.em=function(pe){return""+pe+""},ot.codespan=function(pe){return""+pe+""},ot.br=function(){return this.options.xhtml?"
    ":"
    "},ot.del=function(pe){return""+pe+""},ot.link=function(pe,ve,ke){if(null===(pe=pt(this.options.sanitize,this.options.baseUrl,pe)))return ke;var ct='"+ke+""},ot.image=function(pe,ve,ke){if(null===(pe=pt(this.options.sanitize,this.options.baseUrl,pe)))return ke;var ct=''+ke+'":">")},ot.text=function(pe){return pe},rt}(),R=function(){function rt(){}var ot=rt.prototype;return ot.strong=function(pe){return pe},ot.em=function(pe){return pe},ot.codespan=function(pe){return pe},ot.del=function(pe){return pe},ot.html=function(pe){return pe},ot.text=function(pe){return pe},ot.link=function(pe,ve,ke){return""+ke},ot.image=function(pe,ve,ke){return""+ke},ot.br=function(){return""},rt}(),k=function(){function rt(){this.seen={}}var ot=rt.prototype;return ot.serialize=function(pe){return pe.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ot.getNextSafeSlug=function(pe,ve){var ke=pe,ct=0;if(this.seen.hasOwnProperty(ke)){ct=this.seen[pe];do{ke=pe+"-"+ ++ct}while(this.seen.hasOwnProperty(ke))}return ve||(this.seen[pe]=ct,this.seen[ke]=0),ke},ot.slug=function(pe,ve){void 0===ve&&(ve={});var ke=this.serialize(pe);return this.getNextSafeSlug(ke,ve.dryrun)},rt}(),Oe=B,Xe=R,yt=k,It=dt.exports.defaults,Tn=se_unescape,Gn=Pe,yi=function(){function rt(ut){this.options=ut||It,this.options.renderer=this.options.renderer||new Oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new yt}rt.parse=function(pe,ve){return new rt(ve).parse(pe)},rt.parseInline=function(pe,ve){return new rt(ve).parseInline(pe)};var ot=rt.prototype;return ot.parse=function(pe,ve){void 0===ve&&(ve=!0);var ct,Qe,vt,xt,Tt,$t,jn,ii,Dn,fn,zn,bn,Qi,Zi,qn,Pi,da,$r,ne,ke="",de=pe.length;for(ct=0;ct0&&"text"===qn.tokens[0].type?(qn.tokens[0].text=$r+" "+qn.tokens[0].text,qn.tokens[0].tokens&&qn.tokens[0].tokens.length>0&&"text"===qn.tokens[0].tokens[0].type&&(qn.tokens[0].tokens[0].text=$r+" "+qn.tokens[0].tokens[0].text)):qn.tokens.unshift({type:"text",text:$r}):Zi+=$r),Zi+=this.parse(qn.tokens,Qi),Dn+=this.renderer.listitem(Zi,da,Pi);ke+=this.renderer.list(Dn,zn,bn);continue;case"html":ke+=this.renderer.html(fn.text);continue;case"paragraph":ke+=this.renderer.paragraph(this.parseInline(fn.tokens));continue;case"text":for(Dn=fn.tokens?this.parseInline(fn.tokens):fn.text;ct+1An error occurred:

    "+qa(vt.message+"",!0)+"
    ";throw vt}}return Qt.options=Qt.setOptions=function(rt){return Ps(Qt.defaults,rt),ua(Qt.defaults),Qt},Qt.getDefaults=Al,Qt.defaults=ms,Qt.use=function(){for(var rt=this,ot=arguments.length,ut=new Array(ot),pe=0;peAn error occurred:

    "+qa(pe.message+"",!0)+"
    ";throw pe}},Qt.Parser=yi,Qt.parser=yi.parse,Qt.Renderer=Hr,Qt.TextRenderer=Ns,Qt.Lexer=Gn,Qt.lexer=Gn.lex,Qt.Tokenizer=hi,Qt.Slugger=cs,Qt.parse=Qt,Qt}()},369:(kt,it,tt)=>{var gt=tt(284),J=tt(830);function At(){this.clear()}At.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},At.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},At.prototype.dequeue=function(){if(this.size){var dt=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,dt}},At.prototype.peek=function(){if(this.size)return this.items[this.offset]},At.prototype.forEach=function(dt,K){K=arguments.length>1?K:this;for(var Ae=this.offset,he=0,q=this.items.length;Ae=dt.length)return{done:!0};var Ae=dt[K];return K++,{value:Ae,done:!1}})},At.prototype.entries=function(){var dt=this.items,K=this.offset,Ae=0;return new gt(function(){if(K>=dt.length)return{done:!0};var he=dt[K];return K++,{value:[Ae++,he],done:!1}})},"undefined"!=typeof Symbol&&(At.prototype[Symbol.iterator]=At.prototype.values),At.prototype.toString=function(){return this.toArray().join(",")},At.prototype.toJSON=function(){return this.toArray()},At.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:At,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(At.prototype[Symbol.for("nodejs.util.inspect.custom")]=At.prototype.inspect),At.from=function(dt){var K=new At;return J(dt,function(Ae){K.enqueue(Ae)}),K},At.of=function(){return At.from(arguments)},kt.exports=At},830:kt=>{var it="undefined"!=typeof ArrayBuffer,tt="undefined"!=typeof Symbol;function gt(J,At){var dt,K,Ae,he,q;if(!J)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof At)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(J)||it&&ArrayBuffer.isView(J)||"string"==typeof J||"[object Arguments]"===J.toString())for(Ae=0,he=J.length;Ae{function it(tt){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:tt}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var tt=this._next();return tt.done&&(this.done=!0),tt},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var tt=arguments,gt=tt.length,J=0;return new it(function(){return J>=gt?{done:!0}:{done:!1,value:tt[J++]}})},it.empty=function(){var tt=new it(null);return tt.done=!0,tt},it.is=function(tt){return tt instanceof it||"object"==typeof tt&&null!==tt&&"function"==typeof tt.next},kt.exports=it},310:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==J.window.orientation},it.default=function(he){if(!he&&!(0,At.default)())return"Node";if((0,dt.default)(he))return"Electron";var q="undefined"!=typeof navigator?navigator:{},V=he||q.userAgent||"";if(V.indexOf("Edge")>-1)return"Edge";var L=-1!==V.indexOf("MSIE "),re=-1!==V.indexOf("Trident/");return L||re?"IE":J.window.chrome?"Chrome":J.window.safari?"Safari":J.window.mozInnerScreenX?"Firefox":"Unknown"};var J=tt(151),At=gt(tt(602)),dt=gt(tt(344))},151:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var J=gt(tt(321)),At={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&process};it.self=At.self||At.window||At.global,it.window=At.window||At.self||At.global,it.global=At.global||At.self||At.window,it.document=At.document||{},it.process=At.process||{};var V=console;it.console=V},761:(kt,it,tt)=>{"use strict";var J=tt(948),At=tt(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"jU",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Ae.default}});var dt=tt(151),K=V(tt(602)),Ae=V(tt(310));J(tt(344));function q(L){if("function"!=typeof WeakMap)return null;var re=new WeakMap,$=new WeakMap;return(q=function(S){return S?$:re})(L)}function V(L,re){if(!re&&L&&L.__esModule)return L;if(null===L||"object"!==At(L)&&"function"!=typeof L)return{default:L};var $=q(re);if($&&$.has(L))return $.get(L);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in L)if("default"!==O&&Object.prototype.hasOwnProperty.call(L,O)){var T=S?Object.getOwnPropertyDescriptor(L,O):null;T&&(T.get||T.set)?Object.defineProperty(b,O,T):b[O]=L[O]}return b.default=L,$&&$.set(L,b),b}},602:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var J=gt(tt(321)),At=gt(tt(344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,At.default)()}},344:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,J.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,J.default)(process.versions)&&Boolean(process.versions.electron))return!0;var K="object"===("undefined"==typeof navigator?"undefined":(0,J.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Ae=dt||K;return!!(Ae&&Ae.indexOf("Electron")>=0)};var J=gt(tt(321))},991:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(At,dt,K,Ae){void 0===Ae&&(Ae=K),Object.defineProperty(At,Ae,{enumerable:!0,get:function(){return dt[K]}})}:function(At,dt,K,Ae){void 0===Ae&&(Ae=K),At[Ae]=dt[K]}),J=this&&this.__exportStar||function(At,dt){for(var K in At)"default"!==K&&!Object.prototype.hasOwnProperty.call(dt,K)&>(dt,At,K)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(180),it),J(tt(103),it),J(tt(965),it),J(tt(595),it),J(tt(417),it),J(tt(451),it),J(tt(735),it)},180:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(J){this.termType="BlankNode",this.value=J}equals(J){return!!J&&"BlankNode"===J.termType&&J.value===this.value}}},103:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const gt=tt(180),J=tt(965),At=tt(595),dt=tt(417),K=tt(451),Ae=tt(735);let he=0;it.DataFactory=class{constructor(L){this.blankNodeCounter=0,this.blankNodePrefix=(L=L||{}).blankNodePrefix||`df_${he++}_`}namedNode(L){return new dt.NamedNode(L)}blankNode(L){return new gt.BlankNode(L||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(L,re){return new At.Literal(L,re)}variable(L){return new Ae.Variable(L)}defaultGraph(){return J.DefaultGraph.INSTANCE}quad(L,re,$,b){return new K.Quad(L,re,$,b||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(At.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}}},965:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class tt{constructor(){this.termType="DefaultGraph",this.value=""}equals(J){return!!J&&"DefaultGraph"===J.termType}}it.DefaultGraph=tt,tt.INSTANCE=new tt},595:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const gt=tt(417);class J{constructor(dt,K){this.termType="Literal",this.value=dt,"string"==typeof K?(this.language=K,this.datatype=J.RDF_LANGUAGE_STRING):K?(this.language="",this.datatype=K):(this.language="",this.datatype=J.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=J,J.RDF_LANGUAGE_STRING=new gt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),J.XSD_STRING=new gt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(J){this.termType="NamedNode",this.value=J}equals(J){return!!J&&"NamedNode"===J.termType&&J.value===this.value}}},451:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(J,At,dt,K){this.termType="Quad",this.value="",this.subject=J,this.predicate=At,this.object=dt,this.graph=K}equals(J){return!!J&&("Quad"===J.termType||!J.termType)&&this.subject.equals(J.subject)&&this.predicate.equals(J.predicate)&&this.object.equals(J.object)&&this.graph.equals(J.graph)}}},735:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(J){this.termType="Variable",this.value=J}equals(J){return!!J&&"Variable"===J.termType&&J.value===this.value}}},609:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(b,S,O,T){void 0===T&&(T=O),Object.defineProperty(b,T,{enumerable:!0,get:function(){return S[O]}})}:function(b,S,O,T){void 0===T&&(T=O),b[T]=S[O]}),J=this&&this.__exportStar||function(b,S){for(var O in b)"default"!==O&&!Object.prototype.hasOwnProperty.call(S,O)&>(S,b,O)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const At=tt(991),dt=tt(938),K=tt(60);J(tt(938),it),J(tt(871),it),J(tt(60),it);const Ae=new At.DataFactory,he=new K.Translator;function q(b,S){return he.fromRdf(b,S)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(b=>Ae.namedNode(b)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(b=>Ae.namedNode(b)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(b=>Ae.namedNode(b)),["object"]),it.fromRdf=q,it.toRdf=function(b,S){return S&&"namedNode"in S&&(S={dataFactory:S}),(S=S||{})&&!S.dataFactory&&(S.dataFactory=Ae),he.toRdf(b,S)},it.getTermRaw=function(b,S){return"Literal"===b.termType?q(b,S):b.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Translator=void 0,it.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(J){throw new Error(`Invalid RDF ${J.datatype.value} value: '${J.value}'`)}registerHandler(J,At,dt){for(const K of At)this.supportedRdfDatatypes.push(K),this.fromRdfHandlers[K.value]=J;for(const K of dt){let Ae=this.toRdfHandlers[K];Ae||(this.toRdfHandlers[K]=Ae=[]),Ae.push(J)}}fromRdf(J,At){const dt=this.fromRdfHandlers[J.datatype.value];return dt?dt.fromRdf(J,At):J.value}toRdf(J,At){const dt=this.toRdfHandlers[typeof J];if(dt)for(const K of dt){const Ae=K.toRdf(J,At);if(Ae)return Ae}throw new Error(`Invalid JavaScript value: '${J}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const gt=tt(60);class J{fromRdf(dt,K){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return K&>.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:K,dataFactory:Ae}){return Ae.literal(dt?"true":"false",K||Ae.namedNode(J.TYPE))}}it.TypeHandlerBoolean=J,J.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const gt=tt(60);class J{fromRdf(dt,K){switch(K&&!dt.value.match(J.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&>.Translator.incorrectRdfDataType(dt),dt.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(dt.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const Ae=dt.value.split("-");return new Date(0,parseInt(Ae[0],10)-1,parseInt(Ae[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(dt.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(dt.value+"-01");default:return new Date(dt.value)}}toRdf(dt,{datatype:K,dataFactory:Ae}){if(K=K||Ae.namedNode(J.TYPES[0]),!(dt instanceof Date))return null;const he=dt;let q;switch(K.value){case"http://www.w3.org/2001/XMLSchema#gDay":q=String(he.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":q=he.getUTCMonth()+1+"-"+he.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":q=String(he.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":q=he.getUTCFullYear()+"-"+(he.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":q=he.toISOString().replace(/T.*$/,"");break;default:q=he.toISOString()}return Ae.literal(q,K)}}it.TypeHandlerDate=J,J.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"],J.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]$/}},554:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const gt=tt(60);class J{fromRdf(dt,K){const Ae=parseFloat(dt.value);return K&&isNaN(Ae)&>.Translator.incorrectRdfDataType(dt),Ae}toRdf(dt,{datatype:K,dataFactory:Ae}){return K=K||Ae.namedNode(J.TYPES[0]),isNaN(dt)?Ae.literal("NaN",K):isFinite(dt)?dt%1==0?null:Ae.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),K):Ae.literal(dt>0?"INF":"-INF",K)}}it.TypeHandlerNumberDouble=J,J.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const gt=tt(60);class J{fromRdf(dt,K){const Ae=parseInt(dt.value,10);return K&&(isNaN(Ae)||dt.value.indexOf(".")>=0)&>.Translator.incorrectRdfDataType(dt),Ae}toRdf(dt,{datatype:K,dataFactory:Ae}){return Ae.literal(String(dt),K||Ae.namedNode(dt<=J.MAX_INT&&dt>=J.MIN_INT?J.TYPES[0]:J.TYPES[1]))}}it.TypeHandlerNumberInteger=J,J.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"],J.MAX_INT=2147483647,J.MIN_INT=-2147483648},608:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class tt{fromRdf(J){return J.value}toRdf(J,{datatype:At,dataFactory:dt}){return dt.literal(J,At)}}it.TypeHandlerString=tt,tt.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/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},938:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(At,dt,K,Ae){void 0===Ae&&(Ae=K),Object.defineProperty(At,Ae,{enumerable:!0,get:function(){return dt[K]}})}:function(At,dt,K,Ae){void 0===Ae&&(Ae=K),At[Ae]=dt[K]}),J=this&&this.__exportStar||function(At,dt){for(var K in At)"default"!==K&&!Object.prototype.hasOwnProperty.call(dt,K)&>(dt,At,K)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(727),it),J(tt(525),it),J(tt(554),it),J(tt(750),it),J(tt(608),it)},18:(kt,it,tt)=>{"use strict";var gt={};tt.r(gt),tt.d(gt,{decode:()=>ufe,encode:()=>dfe});var J={};tt.r(J),tt.d(J,{decode:()=>mfe,encode:()=>_fe});var At={};tt.r(At),tt.d(At,{decode:()=>yfe,encode:()=>vfe});var dt={};function K(n){return"function"==typeof n}tt.r(dt),tt.d(dt,{decode:()=>bfe,encode:()=>wfe});let Ae=!1;const he={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else Ae&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ae=n},get useDeprecatedSynchronousErrorHandling(){return Ae}};function q(n){setTimeout(()=>{throw n},0)}const V={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;q(n)},complete(){}},L=Array.isArray||(n=>n&&"number"==typeof n.length);function re(n){return null!==n&&"object"==typeof n}const b=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class S{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof S)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof b?t.errors:t),[])}S.EMPTY=((n=new S).closed=!0,n);const T="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends S{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=V;break;case 1:if(!e){this.destination=V;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,e,t,i)}}[T](){return this}static create(e,t,i){const r=new y(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class w extends y{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;K(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==V&&(o=Object.create(t),K(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;he.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=he;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):q(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;q(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);he.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),he.useDeprecatedSynchronousErrorHandling)throw i;q(i)}}__tryOrSetError(e,t,i){if(!he.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return he.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(q(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const I="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(n){return n}let F=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof y)return n;if(n[T])return n[T]()}return n||e||t?new y(n,e,t):new y(V)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||he.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),he.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){he.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof y?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=Q(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[I](){return this}pipe(...t){return 0===t.length?this:function(n){return 0===n.length?H:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}(t)(this)}toPromise(t){return new(t=Q(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function Q(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const U=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ie extends S{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class ue extends y{constructor(e){super(e),this.destination=e}}let ee=(()=>{class n extends F{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[T](){return new ue(this)}lift(t){const i=new se(this,this);return i.operator=t,i}next(t){if(this.closed)throw new U;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew se(e,t),n})();class se extends ee{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):S.EMPTY}}function Te(n){return n&&"function"==typeof n.schedule}function me(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new te(n,e))}}class te{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new ye(e,this.project,this.thisArg))}}class ye extends y{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const De=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ee(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Re=n=>{if(n&&"function"==typeof n[I])return(n=>e=>{const t=n[I]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(Le(n))return De(n);if(Ee(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,q),e))(n);if(n&&"function"==typeof n[Ze])return(n=>e=>{const t=n[Ze]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${re(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Be(n,e){return new F(t=>{const i=new S;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function Pe(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[I]}(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>{const r=n[I]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(Ee(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(Le(n))return Be(n,e);if(function(n){return n&&"function"==typeof n[Ze]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new F(t=>{const i=new S;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Ze](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof F?n:new F(Re(n))}class wt extends y{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class fe extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function R(n,e){if(e.closed)return;if(n instanceof F)return n.subscribe(e);let t;try{t=Re(n)(e)}catch(i){e.error(i)}return t}function k(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(k((r,s)=>Pe(n(r,s)).pipe(me((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Oe(n,t)))}class Oe{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Xe(e,this.project,this.concurrent))}}class Xe extends fe{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function It(n=Number.POSITIVE_INFINITY){return k(H,n)}function Tn(n,e){return e?Be(n,e):new F(De(n))}function Pn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Te(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof F?n[0]:It(e)(Tn(n,t))}function Gn(){return function(e){return e.lift(new yi(e))}}class yi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new hi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class hi extends y{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Hr extends F{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new S,e.add(this.source.subscribe(new cs(this.getSubject(),this))),e.closed&&(this._connection=null,e=S.EMPTY)),e}refCount(){return Gn()(this)}}const Ns=(()=>{const n=Hr.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class cs extends ue{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class Al{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function ua(){return new ee}function ms(){return n=>Gn()(function(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new Al(r,e));const s=Object.create(i,Ns);return s.source=i,s.subjectFactory=r,s}}(ua)(n))}function Qt(n){for(let e in n)if(n[e]===Qt)return e;throw Error("Could not find renamed property on target object.")}function Ka(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function rt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(rt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ot(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ut=Qt({__forward_ref__:Qt});function pe(n){return n.__forward_ref__=pe,n.toString=function(){return rt(this())},n}function ve(n){return ke(n)?n():n}function ke(n){return"function"==typeof n&&n.hasOwnProperty(ut)&&n.__forward_ref__===pe}class Qe extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function $t(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():function(n){return"string"==typeof n?n:null==n?"":String(n)}(n)}function fn(n,e){const t=e?` in ${e}`:"";throw new Qe("201",`No provider for ${$t(n)} found${t}`)}function Z(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function We(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Et(n){return{providers:n.providers||[],imports:n.imports||[]}}function pn(n){return _s(n,oo)||_s(n,Fs)}function _s(n,e){return n.hasOwnProperty(e)?n[e]:null}function Tl(n){return n&&(n.hasOwnProperty(Pr)||n.hasOwnProperty(fc))?n[Pr]:null}const oo=Qt({\u0275prov:Qt}),Pr=Qt({\u0275inj:Qt}),Fs=Qt({ngInjectableDef:Qt}),fc=Qt({ngInjectorDef:Qt});var yn=(()=>((yn=yn||{})[yn.Default=0]="Default",yn[yn.Host=1]="Host",yn[yn.Self=2]="Self",yn[yn.SkipSelf=4]="SkipSelf",yn[yn.Optional=8]="Optional",yn))();let ao;function ha(n){const e=ao;return ao=n,e}function id(n,e,t){const i=pn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&yn.Optional?null:void 0!==e?e:void fn(rt(n),"Injector")}function Ce(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),Ht=(()=>((Ht=Ht||{})[Ht.Emulated=0]="Emulated",Ht[Ht.None=2]="None",Ht[Ht.ShadowDom=3]="ShadowDom",Ht))();const ri="undefined"!=typeof globalThis&&globalThis,Fr="undefined"!=typeof window&&window,qr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,ys="undefined"!=typeof global&&global,ti=ri||ys||Fr||qr,rd={},Wi=[],Wf=Qt({\u0275cmp:Qt}),xm=Qt({\u0275dir:Qt}),fh=Qt({\u0275pipe:Qt}),gv=Qt({\u0275mod:Qt}),M1=Qt({\u0275loc:Qt}),Dl=Qt({\u0275fac:Qt}),ph=Qt({__NG_ELEMENT_ID__:Qt});let D1=0;function wn(n){return Ce(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===He.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||Wi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Ht.Emulated,id:"c",styles:n.styles||Wi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=D1++,i.inputs=vv(n.inputs,t),i.outputs=vv(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(mv):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(_v):null,i})}function mv(n){return Di(n)||function(n){return n[xm]||null}(n)}function _v(n){return function(n){return n[fh]||null}(n)}const yv={};function gn(n){return Ce(()=>{const e={type:n.type,bootstrap:n.bootstrap||Wi,declarations:n.declarations||Wi,imports:n.imports||Wi,exports:n.exports||Wi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(yv[n.id]=n.type),e})}function vv(n,e){if(null==n)return rd;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const Lt=wn;function Ls(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Di(n){return n[Wf]||null}function xo(n,e){const t=n[gv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Ho(n){return Array.isArray(n)&&"object"==typeof n[1]}function Go(n){return Array.isArray(n)&&!0===n[1]}function Tm(n){return 0!=(8&n.flags)}function ld(n){return 2==(2&n.flags)}function cd(n){return 1==(1&n.flags)}function ga(n){return null!==n.template}function bv(n){return 0!=(512&n[2])}function mc(n,e){return n.hasOwnProperty(Dl)?n[Dl]:null}class Rm{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function qi(){return Sv}function Sv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),L1}function L1(){const n=st(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===rd)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function k1(n,e,t,i){const r=st(n)||function(n,e){return n[bh]=e}(n,{previous:rd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new Rm(l&&l.currentValue,e,o===rd),n[i]=e}qi.ngInherit=!0;const bh="__ngSimpleChanges__";function st(n){return n[bh]||null}let Bi;function or(n){return!!n.listen}const au={createRenderer:(n,e)=>void 0!==Bi?Bi:"undefined"!=typeof document?document:void 0};function vr(n){for(;Array.isArray(n);)n=n[0];return n}function Ys(n,e){return vr(e[n.index])}function Pm(n,e){return n.data[e]}function Bs(n,e){const t=e[n];return Ho(t)?t:t[0]}function Ol(n){return 4==(4&n[2])}function dd(n){return 128==(128&n[2])}function _a(n,e){return null==e?null:n[e]}function Fm(n){n[18]=0}function Yf(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Ln={lFrame:cu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Cv(){return Ln.bindingsEnabled}function Ft(){return Ln.lFrame.lView}function fi(){return Ln.lFrame.tView}function ya(n){return Ln.lFrame.contextLView=n,n[8]}function ts(){let n=Lm();for(;null!==n&&64===n.type;)n=n.parent;return n}function Lm(){return Ln.lFrame.currentTNode}function Qa(n,e){const t=Ln.lFrame;t.currentTNode=n,t.isParent=e}function Br(){return Ln.lFrame.isParent}function xh(){return Ln.isInCheckNoChangesMode}function Qf(n){Ln.isInCheckNoChangesMode=n}function hd(n,e){const t=Ln.lFrame;t.bindingIndex=t.bindingRootIndex=n,km(e)}function km(n){Ln.lFrame.currentDirectiveIndex=n}function Av(){return Ln.lFrame.currentQueryIndex}function jm(n){Ln.lFrame.currentQueryIndex=n}function Jf(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function fd(n,e,t){if(t&yn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&yn.Host||(r=Jf(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ln.lFrame=Se();return i.currentTNode=e,i.lView=n,!0}function Th(n){const e=Se(),t=n[1];Ln.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Se(){const n=Ln.lFrame,e=null===n?null:n.child;return null===e?cu(n):e}function cu(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Mh(){const n=Ln.lFrame;return Ln.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const To=Mh;function oi(){const n=Mh();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Xs(){return Ln.lFrame.selectedIndex}function uo(n){Ln.lFrame.selectedIndex=n}function ep(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class Dh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function ip(n,e,t){const i=or(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let gd=!0;function rp(n){const e=gd;return gd=n,e}let $m=0;function js(n,e){const t=sp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,Wm(i.data,n),Wm(e,null),Wm(i.blueprint,null));const r=Rh(n,e),s=n.injectorIndex;if(Mv(r)){const o=pd(r),a=Ja(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function Wm(n,e){n.push(0,0,0,0,0,0,0,0,e)}function sp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Rh(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function yc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(ph)&&(i=t[ph]),null==i&&(i=t[ph]=$m++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Ov:e}(t);if("function"==typeof s){if(!fd(e,n,i))return i&yn.Host?qm(r,t,i):Iv(e,t,i,r);try{const o=s(i);if(null!=o||i&yn.Optional)return o;fn(t)}finally{To()}}else if("number"==typeof s){let o=null,a=sp(n,e),l=-1,c=i&yn.Host?e[16][6]:null;for((-1===a||i&yn.SkipSelf)&&(l=-1===a?Rh(n,e):e[a+8],-1!==l&&Nh(i,!1)?(o=e[1],a=pd(l),e=Ja(l,e)):a=-1);-1!==a;){const d=e[1];if(op(s,a,d.data)){const f=ws(a,e,t,o,i,c);if(f!==Rv)return f}l=e[a+8],-1!==l&&Nh(i,e[1].data[a+8]===c)&&op(s,a,e)?(o=d,a=pd(l),e=Ja(l,e)):a=-1}}}return Iv(e,t,i,r)}const Rv={};function Ov(){return new Wo(ts(),Ft())}function ws(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=md(a,o,t,null==i?ld(a)&&gd:i!=o&&0!=(3&a.type),r&yn.Host&&s===a);return null!==d?_d(e,o,d,a):Rv}function md(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&ga(g)&&g.type===t)return l}return null}function _d(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Dh}(r)){const o=r;o.resolving&&function(n,e){throw new Qe("200",`Circular dependency in DI detected for ${n}`)}($t(s[t]));const a=rp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ha(o.injectImpl):null;fd(n,i,yn.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=Sv(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ha(l),rp(a),o.resolving=!1,To()}}return r}function op(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Dl]||Es(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Dl]||Es(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Es(n){return ke(n)?()=>{const e=Es(ve(n));return e&&e()}:mc(n)}const vd="__parameters__";function Sa(n,e,t){return Ce(()=>{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(vd)?l[vd]:Object.defineProperty(l,vd,{value:[]})[vd];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Vt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=We({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}function qo(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Ko(t,e):e(t))}function Fh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Pl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Mo(n,e,t){let i=Ss(n,e);return i>=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function Jm(n,e){const t=Ss(n,e);if(t>=0)return n[1|t]}function Ss(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):rt(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Sc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Ec]=null,n}const xd=Sd(Sa("Inject",n=>({token:n})),-1),Yr=Sd(Sa("Optional"),8),il=Sd(Sa("SkipSelf"),4);const m_="__ngContext__";function xs(n,e){n[m_]=e}function __(n){const e=function(n){return n[m_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function xp(n){return n.ngOriginalError}function LC(n,...e){n.error(...e)}class Zo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||LC}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(xp(e)):null}_findOriginalError(e){let t=e&&xp(e);for(;t&&xp(t);)t=xp(t);return t||null}}const db=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(ti))();function sl(n){return n instanceof Function?n():n}var Ro=(()=>((Ro=Ro||{})[Ro.Important=1]="Important",Ro[Ro.DashCase=2]="DashCase",Ro))();function E_(n,e){return undefined(n,e)}function zh(n){const e=n[3];return Go(e)?e[3]:e}function Id(n){return mb(n[13])}function x_(n){return mb(n[4])}function mb(n){for(;null!==n&&!Go(n);)n=n[4];return n}function Rd(n,e,t,i,r){if(null!=i){let s,o=!1;Go(i)?s=i:Ho(i)&&(o=!0,i=i[0]);const a=vr(i);0===n&&null!==t?null==r?wb(e,t,a):ol(e,t,a,r||null,!0):1===n&&null!==t?ol(e,t,a,r||null,!0):2===n?function(n,e,t){const i=Tp(n,e);i&&function(n,e,t,i){or(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==vr(t)&&Rd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Pl(n,10+e);!function(n,e){Od(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function M_(n,e){if(!(256&e[2])){const t=e[11];or(t)&&t.destroyNode&&Od(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Ap(n[1],n);for(;e;){let t=null;if(Ho(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Ho(e)&&Ap(e[1],e),e=e[3];null===e&&(e=n),Ho(e)&&Ap(e[1],e),t=e&&e[4]}e=t}}(e)}}function Ap(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==Gh(g,c,0)||2&i&&c!==p){if(Ca(i))return!1;o=!0}}}}else{if(!o&&!Ca(i)&&!Ca(l))return!1;if(o&&Ca(l))continue;o=!1,i=l|1&i}}return Ca(i)||o}function Ca(n){return 0==(1&n)}function cA(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!Ca(o)&&(e+=Pb(s,r),r=""),i=o,s=s||!Ca(i);t++}return""!==r&&(e+=Pb(s,r)),e}const Cn={};function al(n,e){return n<<17|e<<2}function Mn(n){return n>>17&32767}function br(n){return 2|n}function jl(n){return(131068&n)>>2}function ll(n,e){return-131069&n|e<<2}function P_(n){return 1|n}function Gb(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&function(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&tp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&np(e,s,0,t)}uo(t)}(n,e,20,xh()),t(i,r)}finally{uo(s)}}function Kh(n,e,t){!Cv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||js(t,e),xs(i,e);const o=t.initialInputs;for(let a=r;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function tw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function nw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function kA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&W_(t)}}function W_(n){for(let i=Id(n);null!==i;i=x_(i))for(let r=10;r0&&W_(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&W_(r)}}function GA(n,e){const t=Bs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function sw(n){return n[7]||(n[7]=[])}function kp(n){return n.cleanup||(n.cleanup=[])}function Z_(n,e){const t=n[9],i=t?t.get(Zo,null):null;i&&i.handleError(e)}function ow(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Ko([e],a=>this.processInjectorType(a,[],s)),this.records.set(Bd,Su(void 0,this));const o=this.records.get(Eu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:rt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=gu,i=yn.Default){this.assertNotDestroyed();const r=Ed(this),s=ha(void 0);try{if(!(i&yn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Vt}(e)&&pn(e);a=l&&this.injectableDefInScope(l)?Su(iy(e),Yh):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&yn.Self?aw():this.parent).get(e,t=i&yn.Optional&&t===gu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Ec]=o[Ec]||[]).unshift(rt(e)),r)throw o;return Qs(o,e,"R3InjectorError",this.source)}throw o}finally{ha(s),Ed(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(rt(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=ve(e)))return!1;let r=Tl(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=Tl(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Ko(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||Wi))}}this.injectorDefTypes.add(o);const l=mc(o)||(()=>new o);this.records.set(o,Su(l,Yh));const c=r.providers;if(null!=c&&!a){const d=e;Ko(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Dc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return uw(n)?Su(void 0,n.useValue):Su(function(n,e,t){let i;if(Dc(n)){const r=ve(n);return mc(r)||iy(r)}if(uw(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(..._u(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Ie(ve(n.useExisting));else{const r=ve(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return mc(r)||iy(r);i=()=>new r(..._u(n.deps))}return i}(n),Yh)}(e);if(Dc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Su(void 0,Yh,!0),o.factory=()=>_u(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===Yh&&(t.value=QA,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ve(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function iy(n){const e=pn(n),t=null!==e?e.factory:mc(n);if(null!==t)return t;if(n instanceof Vt)throw new Error(`Token ${rt(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=function(n,e){const t=[];for(let i=0;it.factory(n):()=>new n}(n);throw new Error("unreachable")}function Su(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function uw(n){return null!==n&&"object"==typeof n&&hp in n}function Dc(n){return"function"==typeof n}const dw=function(n,e,t){return function(n,e=null,t=null,i){const r=lw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Hn{static create(e,t){return Array.isArray(e)?dw(e,t,""):dw(e.providers,e.parent,e.name||"")}}function R7(n,e){ep(__(n)[1],ts())}function Nn(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(ga(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=dT(n.inputs),o.declaredInputs=dT(n.declaredInputs),o.outputs=dT(n.outputs);const a=r.hostBindings;a&&F7(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&N7(n,l),c&&P7(n,c),Ka(n.inputs,r.inputs),Ka(n.declaredInputs,r.declaredInputs),Ka(n.outputs,r.outputs),ga(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Ih(r.hostAttrs,t=Ih(t,r.hostAttrs))}}(i)}function dT(n){return n===rd?{}:n===Wi?[]:n}function N7(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function P7(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function F7(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Hn.THROW_IF_NOT_FOUND=gu,Hn.NULL=new eo,Hn.\u0275prov=We({token:Hn,providedIn:"any",factory:()=>Ie(Bd)}),Hn.__NG_ELEMENT_ID__=-1;let mw=null;function jp(){if(!mw){const n=ti.Symbol;if(n&&n.iterator)mw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(vr(Ne[i.index])):i.index;if(or(t)){let Ne=null;if(!a&&l&&(Ne=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==Ne)(Ne.__ngLastListenerFn__||Ne).__ngNextListenerFn__=s,Ne.__ngLastListenerFn__=s,g=!1;else{s=yT(i,e,f,s,!1);const Ge=t.listen(W,r,s);p.push(s,Ge),d&&d.push(r,ge,G,G+1)}}else s=yT(i,e,f,s,!0),W.addEventListener(r,s,o),p.push(s),d&&d.push(r,ge,G,o)}else s=yT(i,e,f,s,!1);const _=i.outputs;let x;if(g&&null!==_&&(x=_[r])){const A=x.length;if(A)for(let W=0;W0;)e=e[15],n--;return e}(n,Ln.lFrame.contextLView))[8]}(n)}function tL(n,e,t,i,r){const s=n[t+1],o=null===e;let a=i?Mn(s):jl(s),l=!1;for(;0!==a&&(!1===l||o);){const d=n[a+1];yW(n[a],e)&&(l=!0,n[a+1]=i?P_(d):br(d)),a=i?Mn(d):jl(d)}l&&(n[t+1]=i?br(s):P_(s))}function yW(n,e){return null===n||null==e||(Array.isArray(n)?n[1]:n)===e||!(!Array.isArray(n)||"string"!=typeof e)&&Ss(n,e)>=0}const As={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function nL(n){return n.substring(As.key,As.keyEnd)}function iL(n,e){const t=As.textEnd;return t===e?-1:(e=As.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,As.key=e,t),Zp(n,e,t))}function Zp(n,e,t){for(;e0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Mn(n[a+1]);n[i+1]=al(p,a),0!==p&&(n[p+1]=ll(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=al(a,0),0!==a&&(n[a+1]=ll(n[a+1],i)),a=i;else n[i+1]=al(l,0),0===a?a=i:n[l+1]=ll(n[l+1],i),l=i;c&&(n[i+1]=br(n[i+1])),tL(n,d,i,!0),tL(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ss(s,e)>=0&&(t[i+1]=P_(t[i+1]))}(e,d,n,i,s),o=al(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}(r,null,s,i);const o=Ft();if(t!==Cn&&go(o,s,t)){const a=r.data[Xs()];if(fL(a,i)&&!lL(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=ot(l,t||"")),_T(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===Cn&&(r=Wi);let l=0,c=0,d=0=0;t=iL(e,t))Mo(n,nL(e),!0)}function lL(n,e){return e>=n.expandoStartIndex}function bT(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===Cn&&(p=f?Wi:void 0);let g=f?Jm(p,i):d===i?p:void 0;if(c&&!Ew(g)&&(g=Jm(l,i)),Ew(g)&&(a=g,o))return a;const _=n[r+1];r=o?Mn(_):jl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=Jm(l,i))}return a}function Ew(n){return void 0!==n}function fL(n,e){return 0!=(n.flags&(e?16:32))}const Zh=void 0;var ZW=["en",[["a","p"],["AM","PM"],Zh],[["AM","PM"],Zh,Zh],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Zh,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Zh,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Zh,"{1} 'at' {0}",Zh],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Jp={};function RL(n){return n in Jp||(Jp[n]=ti.ng&&ti.ng.common&&ti.ng.common.locales&&ti.ng.common.locales[n]),Jp[n]}var rn=(()=>((rn=rn||{})[rn.LocaleId=0]="LocaleId",rn[rn.DayPeriodsFormat=1]="DayPeriodsFormat",rn[rn.DayPeriodsStandalone=2]="DayPeriodsStandalone",rn[rn.DaysFormat=3]="DaysFormat",rn[rn.DaysStandalone=4]="DaysStandalone",rn[rn.MonthsFormat=5]="MonthsFormat",rn[rn.MonthsStandalone=6]="MonthsStandalone",rn[rn.Eras=7]="Eras",rn[rn.FirstDayOfWeek=8]="FirstDayOfWeek",rn[rn.WeekendRange=9]="WeekendRange",rn[rn.DateFormat=10]="DateFormat",rn[rn.TimeFormat=11]="TimeFormat",rn[rn.DateTimeFormat=12]="DateTimeFormat",rn[rn.NumberSymbols=13]="NumberSymbols",rn[rn.NumberFormats=14]="NumberFormats",rn[rn.CurrencyCode=15]="CurrencyCode",rn[rn.CurrencySymbol=16]="CurrencySymbol",rn[rn.CurrencyName=17]="CurrencyName",rn[rn.Currencies=18]="Currencies",rn[rn.Directionality=19]="Directionality",rn[rn.PluralCase=20]="PluralCase",rn[rn.ExtraData=21]="ExtraData",rn))();const xw="en-US";let OL=xw;function ET(n){Z(n,"Expected localeId to be defined"),"string"==typeof n&&(OL=n.toLowerCase().replace(/_/g,"-"))}class r2{}const o2="ngComponent";class Z9{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[o2]=n,e}(e)}}class fl{}function Dw(...n){}function tg(n,e){return new An(Ys(n,e))}fl.NULL=new Z9;const tq=function(){return tg(ts(),Ft())};let An=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=tq,n})();function a2(n){return n instanceof An?n.nativeElement:n}class Jh{}let IT=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class Au{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const l2=new Au("12.2.5");class c2{constructor(){}supports(e){return ly(e)}create(e){return new aq(e)}}const oq=(n,e)=>e;class aq{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||oq}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new lq(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new u2),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new u2),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class lq{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class cq{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class u2{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new cq,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function d2(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new dq(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class dq{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function f2(){return new ng([new c2])}let ng=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||f2()),deps:[[n,new il,new Yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=We({token:n,providedIn:"root",factory:f2}),n})();function p2(){return new ig([new h2])}let ig=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||p2()),deps:[[n,new il,new Yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=We({token:n,providedIn:"root",factory:p2}),n})();function Iw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(vr(s)),Go(s))for(let a=10;a-1&&(T_(e,i),Pl(t,i))}this._attachedToViewContainer=!1}M_(this._lView[1],this._lView)}onDestroy(e){Kb(this._lView[1],this._lView,null,e)}markForCheck(){q_(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Y_(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Qf(!0);try{Y_(n,e,t)}finally{Qf(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Od(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class fq extends _y{constructor(e){super(e),this._view=e}detectChanges(){rw(this._view)}checkNoChanges(){!function(n){Qf(!0);try{rw(n)}finally{Qf(!1)}}(this._view)}get context(){return null}}const gq=function(n){return function(n,e,t){if(ld(n)&&!t){const i=Bs(n.index,e);return new _y(i,i)}return 47&n.type?new _y(e[16],e):null}(ts(),Ft(),16==(16&n))};let is=(()=>{class n{}return n.__NG_ELEMENT_ID__=gq,n})();const yq=[new h2],bq=new ng([new c2]),wq=new ig(yq),Sq=function(){return Rw(ts(),Ft())};let Po=(()=>{class n{}return n.__NG_ELEMENT_ID__=Sq,n})();const xq=Po,Cq=class extends xq{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=Wh(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),qh(t,i,e),new _y(i)}};function Rw(n,e){return 4&n.type?new Cq(e,n,tg(n,e)):null}class Nc{}const Mq=function(){return y2(ts(),Ft())};let Ts=(()=>{class n{}return n.__NG_ELEMENT_ID__=Mq,n})();const Iq=Ts,m2=class extends Iq{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return tg(this._hostTNode,this._hostLView)}get injector(){return new Wo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Rh(this._hostTNode,this._hostLView);if(Mv(e)){const t=Ja(e,this._hostLView),i=pd(e);return new Wo(t[1].data[i+8],t)}return new Wo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=_2(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Nc,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Go(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new m2(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),idb});class V2 extends r2{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(pA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return j2(this.componentDef.inputs)}get outputs(){return j2(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,ag,r);return s!==ag||i===ag?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Jh,au),a=s.get(IT,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(or(n))return n.selectRootElement(e,t===Ht.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):A_(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?"http://www.w3.org/2000/svg":"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||db,clean:YA,playerHandler:e||null,flags:0}}(),g=Fp(0,null,null,1,0,null,null,null,null,null),_=Wh(null,g,p,f,null,null,o,l,a,s);let x,A;Th(_);try{const W=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Pd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(Bp(l,c,!0),null!==n&&(ip(r,n,c),null!==l.classes&&O_(r,n,l.classes),null!==l.styles&&Ib(r,n,l.styles)));const d=i.createRenderer(n,e),f=Wh(t,Pp(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(yc(js(l,t),o,e.type),nw(o,l),H_(l,t.length,1)),Lp(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)ip(l,d,["ng-version",l2.full]);else{const{attrs:G,classes:ge}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&O_(l,d,ge.join(" "))}if(A=Pm(g,20),void 0!==t){const G=A.projection=[];for(let ge=0;gel(o,e)),e.contentQueries){const l=ts();e.contentQueries(1,o,l.directiveStart)}const a=ts();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(uo(a.index),ew(t[1],a,0,a.directiveStart,a.directiveEnd,e),tw(e,o)),o}(W,this.componentDef,_,p,[R7]),qh(g,_,null)}finally{oi()}return new DK(this.componentType,x,tg(A,_),_,A)}}class DK extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new fq(r),this.componentType=e}get injector(){return new Wo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const lg=new Map;class OK extends Nc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new B2(this);const i=xo(e),r=function(n){return n[M1]||null}(e);r&&ET(r),this._bootstrapComponents=sl(i.bootstrap),this._r3Injector=lw(e,t,[{provide:Nc,useValue:this},{provide:fl,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Hn.THROW_IF_NOT_FOUND,i=yn.Default){return e===Hn||e===Nc||e===Bd?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class GT extends class{}{constructor(e){super(),this.moduleType=e,null!==xo(e)&&function(n){const e=new Set;!function t(i){const r=xo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${rt(e)} vs ${rt(e.name)}`)}(s,lg.get(s),i),lg.set(s,i));const o=sl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new OK(this.moduleType,e)}}function H2(n,e,t,i,r,s){const o=e+t;return go(n,o,r)?function(n,e,t){return n[e]=t}(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===Cn?void 0:t}(n,o+1)}function Ty(n,e,t){const i=n+20,r=Ft(),s=function(n,e){return n[e]}(r,i);return function(n,e){zl.isWrapped(e)&&(e=zl.unwrap(e),n[Ln.lFrame.bindingIndex]=Cn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?H2(r,function(){const n=Ln.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),e,s.transform,t,s):s.transform(t))}function $T(n){return e=>{setTimeout(n,void 0,e)}}const cn=class extends ee{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=$T(l),a&&(a=$T(a)),c&&(c=$T(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof S&&e.add(d),d}};function YK(){return this._results[jp()]()}class nf{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=jp(),i=nf.prototype;i[t]||(i[t]=YK)}get changes(){return this._changes||(this._changes=new cn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=qo(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=Dw,this.reject=Dw,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Ie(rf,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Ry=new Vt("AppId"),RY={provide:Ry,useFactory:function(){return`${iM()}${iM()}${iM()}`},deps:[]};function iM(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const mk=new Vt("Platform Initializer"),Pc=new Vt("Platform ID"),Bw=new Vt("appBootstrapListener");let jw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Tu=new Vt("LocaleId"),_k=new Vt("DefaultCurrencyCode");class NY{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const rM=function(n){return new GT(n)},PY=rM,FY=function(n){return Promise.resolve(rM(n))},yk=function(n){const e=rM(n),i=sl(xo(n).declarations).reduce((r,s)=>{const o=Di(s);return o&&r.push(new V2(o)),r},[]);return new NY(e,i)},LY=yk,kY=function(n){return Promise.resolve(yk(n))};let sf=(()=>{class n{constructor(){this.compileModuleSync=PY,this.compileModuleAsync=FY,this.compileModuleAndAllComponentsSync=LY,this.compileModuleAndAllComponentsAsync=kY}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const vk=new Vt("compilerOptions"),jY=(()=>Promise.resolve(0))();function sM(n){"undefined"==typeof Zone?jY.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class mn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new cn(!1),this.onMicrotaskEmpty=new cn(!1),this.onStable=new cn(!1),this.onError=new cn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=ti.requestAnimationFrame,e=ti.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(ti,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,aM(n),n.isCheckStableRunning=!0,oM(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),aM(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return bk(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),wk(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return bk(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),wk(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,aM(n),oM(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!mn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(mn.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,UY,Dw,Dw);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const UY={};function oM(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function aM(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function bk(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function wk(n){n._nesting--,oM(n)}class GY{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new cn,this.onMicrotaskEmpty=new cn,this.onStable=new cn,this.onError=new cn}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let lM=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{mn.assertNotInAngularZone(),sM(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())sM(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Ek=(()=>{class n{constructor(){this._applications=new Map,cM.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return cM.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class $Y{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let cM=new $Y,Sk=!0,xk=!1;function Da(){return xk=!0,Sk}let Kl;const Ck=new Vt("AllowMultipleToken");function Ak(n,e,t=[]){const i=`Platform: ${e}`,r=new Vt(i);return(s=[])=>{let o=dM();if(!o||o.injector.get(Ck,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Eu,useValue:"platform"});!function(n){if(Kl&&!Kl.destroyed&&!Kl.injector.get(Ck,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Kl=n.get(Tk);const e=n.get(mk,null);e&&e.forEach(t=>t())}(Hn.create({providers:a,name:i}))}return function(n){const e=dM();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function dM(){return Kl&&!Kl.destroyed?Kl:null}let Tk=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new GY:("zone.js"===n?void 0:n)||new mn({enableLongStackTrace:Da(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:mn,useValue:a}];return a.run(()=>{const c=Hn.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Zo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{hM(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return uy(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(ug);return p.runInitializers(),p.donePromise.then(()=>(ET(d.injector.get(Tu,xw)||xw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=Mk({},i);return function(n,e,t){const i=new GT(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(zd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${rt(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Mk(n,e){return Array.isArray(e)?e.reduce(Mk,n):Object.assign(Object.assign({},n),e)}let zd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new F(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new F(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{mn.assertNotInAngularZone(),sM(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{mn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Pn(a,l.pipe(ms()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof r2?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Nc),a=r.create(Hn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(lM,null),d=c&&a.injector.get(Ek);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),hM(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;hM(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Bw,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn),Ie(Hn),Ie(Zo),Ie(fl),Ie(ug))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function hM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const yX=Ak(null,"core",[{provide:Pc,useValue:"unknown"},{provide:Tk,deps:[Hn]},{provide:Ek,deps:[]},{provide:jw,deps:[]}]),SX=[{provide:zd,useClass:zd,deps:[mn,Hn,Zo,fl,ug]},{provide:AK,deps:[mn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:ug,useClass:ug,deps:[[new Yr,rf]]},{provide:sf,useClass:sf,deps:[]},RY,{provide:ng,useFactory:function(){return bq},deps:[]},{provide:ig,useFactory:function(){return wq},deps:[]},{provide:Tu,useFactory:function(n){return ET(n=n||"undefined"!=typeof $localize&&$localize.locale||xw),n},deps:[[new xd(Tu),new Yr,new il]]},{provide:_k,useValue:"USD"}];let CX=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(zd))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:SX}),n})(),Qw=null;function Fc(){return Qw}const ln=new Vt("DocumentToken");let lf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:xQ,token:n,providedIn:"platform"}),n})();function xQ(){return Ie(n3)}let n3=(()=>{class n extends lf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Fc().getBaseHref(this._doc)}onPopState(t){const i=Fc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Fc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){r3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){r3()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({factory:AQ,token:n,providedIn:"platform"}),n})();function r3(){return!!window.history.pushState}function AQ(){return new n3(Ie(ln))}function Du(n){return n&&"?"!==n[0]?"?"+n:n}let cf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:TQ,token:n,providedIn:"root"}),n})();function TQ(n){const e=Ie(ln).location;return new o3(Ie(lf),e&&e.origin||"")}const MM=new Vt("appBaseHref");let o3=(()=>{class n extends cf{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return function(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Du(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Du(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Du(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(lf),Ie(MM,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();var ds=(()=>((ds=ds||{})[ds.Zero=0]="Zero",ds[ds.One=1]="One",ds[ds.Two=2]="Two",ds[ds.Few=3]="Few",ds[ds.Many=4]="Many",ds[ds.Other=5]="Other",ds))();const kQ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=RL(e);if(t)return t;const i=e.split("-")[0];if(t=RL(i),t)return t;if("en"===i)return ZW;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[rn.PluralCase]};class aE{}let hZ=(()=>{class n extends aE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(kQ(i||this.locale)(t)){case ds.Zero:return"zero";case ds.One:return"one";case ds.Two:return"two";case ds.Few:return"few";case ds.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Tu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();let Ru=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new mZ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){y3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){y3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(Me(Ts),Me(Po))},n.\u0275dir=Lt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class mZ{constructor(){this.$implicit=null,this.ngIf=null}}function y3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class bZ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class wZ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const EZ=new wZ,SZ=new bZ;let cE=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(uy(t))return EZ;if(GF(t))return SZ;throw function(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${rt(n)}'`)}(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(Me(is,16))},n.\u0275pipe=Ls({name:"async",type:n,pure:!1}),n})(),Ws=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:[{provide:aE,useClass:hZ}]}),n})();const x3="browser";class UM extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){Qw||(Qw=n)}(new UM)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(By=By||document.querySelector("base"),By?By.getAttribute("href"):null);return null==t?null:function(n){uE=uE||document.createElement("a"),uE.setAttribute("href",n);const e=uE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){By=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}(document.cookie,e)}}let uE,By=null;const M3=new Vt("TRANSITION_ID"),KZ=[{provide:rf,useFactory:function(n,e,t){return()=>{t.get(ug).donePromise.then(()=>{const i=Fc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},ti.getAllAngularTestabilities=()=>e.getAllTestabilities(),ti.getAllAngularRootElements=()=>e.getAllRootElements(),ti.frameworkStabilizers||(ti.frameworkStabilizers=[]),ti.frameworkStabilizers.push(i=>{const r=ti.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Fc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let YZ=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const jy=new Vt("EventManagerPlugins");let hE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Vy=(()=>{class n extends I3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(R3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(R3))}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function R3(n){Fc().remove(n)}const GM={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},$M=/%COMP%/g;function fE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let pE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new WM(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Ht.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new uJ(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Ht.ShadowDom:return new dJ(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=fE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Ie(hE),Ie(Vy),Ie(Ry))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class WM{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(GM[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=GM[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=GM[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(Ro.DashCase|Ro.Important)?e.style.setProperty(t,i,r&Ro.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Ro.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,P3(i)):this.eventManager.addEventListener(e,t,P3(i))}}class uJ extends WM{constructor(e,t,i,r){super(e),this.component=i;const s=fE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace($M,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace($M,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class dJ extends WM{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=fE(r.id,r.styles,[]);for(let o=0;o{class n extends HM{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const k3=["alt","control","meta","shift"],vJ={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},B3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},bJ={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let wJ=(()=>{class n extends HM{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Fc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(k3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&B3.hasOwnProperty(e)&&(e=B3[e]))}return vJ[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),k3.forEach(s=>{s!=r&&bJ[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const DJ=Ak(yX,"browser",[{provide:Pc,useValue:x3},{provide:mk,useValue:function(){UM.makeCurrent(),zM.init()},multi:!0},{provide:ln,useFactory:function(){return function(n){Bi=n}(document),document},deps:[]}]),IJ=[[],{provide:Eu,useValue:"root"},{provide:Zo,useFactory:function(){return new Zo},deps:[]},{provide:jy,useClass:hJ,multi:!0,deps:[ln,mn,Pc]},{provide:jy,useClass:wJ,multi:!0,deps:[ln]},[],{provide:pE,useClass:pE,deps:[hE,Vy,Ry]},{provide:Jh,useExisting:pE},{provide:I3,useExisting:Vy},{provide:Vy,useClass:Vy,deps:[ln]},{provide:lM,useClass:lM,deps:[mn]},{provide:hE,useClass:hE,deps:[jy,mn]},{provide:class{},useClass:YZ,deps:[]},[]];let YM=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Ry,useValue:t.appId},{provide:M3,useExisting:Ry},KZ]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:IJ,imports:[Ws,CX]}),n})();"undefined"!=typeof window&&window;class BJ extends S{constructor(e,t){super()}schedule(e,t=0){return this}}class gE extends BJ{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let V3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Jl extends V3{constructor(e,t=V3.now){super(e,()=>Jl.delegate&&Jl.delegate!==this?Jl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Jl.delegate&&Jl.delegate!==this?Jl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const UJ=new class extends Jl{}(class extends gE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Lc=new F(n=>n.complete());function mE(n){return n?function(n){return new F(e=>n.schedule(()=>e.complete()))}(n):Lc}function an(...n){let e=n[n.length-1];return Te(e)?(n.pop(),Be(n,e)):Tn(n)}function gg(n,e){return new F(e?t=>e.schedule(HJ,0,{error:n,subscriber:t}):t=>t.error(n))}function HJ({error:n,subscriber:e}){e.error(n)}class ra{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return an(this.value);case"E":return gg(this.error);case"C":return mE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ra("N",e):ra.undefinedValueNotification}static createError(e){return new ra("E",void 0,e)}static createComplete(){return ra.completeNotification}}ra.completeNotification=new ra("C"),ra.undefinedValueNotification=new ra("N",void 0);class _E extends y{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(_E.dispatch,this.delay,new $J(e,this.destination)))}_next(e){this.scheduleMessage(ra.createNext(e))}_error(e){this.scheduleMessage(ra.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ra.createComplete()),this.unsubscribe()}}class $J{constructor(e,t){this.notification=e,this.destination=t}}class mg extends ee{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new WJ(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new U;if(this.isStopped||this.hasError?o=S.EMPTY:(this.observers.push(e),o=new ie(this,e)),r&&e.add(e=new _E(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class WJ{constructor(e,t){this.time=e,this.value=t}}function Ur(n,e){return"function"==typeof e?t=>t.pipe(Ur((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new qJ(n))}class qJ{constructor(e){this.project=e}call(e,t){return t.subscribe(new KJ(e,this.project))}}class KJ extends fe{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new wt(this),r=this.destination;r.add(i),this.innerSubscription=R(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const yE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return yE.schedule(n,0);if(void 0===window.requestAnimationFrame)return yE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let QM;function ree(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!QM){const t=Element.prototype;QM=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&QM.call(n,e)}(n,r)||(i=s,0))),i}class oee{constructor(e,t){this.componentFactory=t.get(fl).resolveComponentFactory(e)}create(e){return new aee(this.componentFactory,e)}}class aee{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new mg(1),this.events=this.eventEmitters.pipe(Ur(i=>Pn(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(mn),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=yE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Hn.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(me(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=yE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new Rm(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class lee extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const uee={initialConfig:{},parse:{},rename:{}};class dee{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},uee),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let hee=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new dee(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=Lt({type:n,features:[qi]}),n})();var ZM;const Uy={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(ZM=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==ZM?ZM:""},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function Ia(n,e,t,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function z3(n,e){return function(t,i){e(t,i,n)}}function ec(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function ir(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function $3(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function eD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||$3()}const W3="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",bE=eD();class mee{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function tD(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const q3={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function K3(n){return"string"==typeof n?q3[n.toUpperCase()]||q3.WHITE:n}function wE(n,e){if(!n)throw new Error(e||"Assertion failed")}const tc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},zy=tc.window||tc.self||tc.global,Y3=tc.process||{};function _g(){let n;if(bE&&zy.performance)n=zy.performance.now();else if(Y3.hrtime){const e=Y3.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const yg={debug:bE&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},See={enabled:!0,level:0};function yl(){}const X3={},Q3={once:!0};function xee(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let nD=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=W3,this._startTs=_g(),this._deltaTs=_g(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new mee("__probe-".concat(this.id,"__"),See),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((_g()-this._startTs).toPrecision(10))}getDelta(){return Number((_g()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){wE(t,i)}warn(t){return this._getLogFunction(0,t,yg.warn,arguments,Q3)}error(t){return this._getLogFunction(0,t,yg.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,yg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,yg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,yg.debug||yg.info,arguments,Q3)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||yl,r&&[r],{tag:xee(i)}):yl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?bE?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=tD(r,e,t);console.log(...s)},r.src=n,yl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...tD(n,e,t)),yl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...tD(r,e,t)),r.src=n.toDataURL(),yl}return yl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=tt(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):yl}({image:r,message:s,scale:o}):yl}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||yl)}group(t,i,r={collapsed:!1}){r=J3({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||yl)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Z3(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=J3({logLevel:t,message:i,args:s,opts:o}),wE(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=_g();const a=o.tag||o.message;if(o.once){if(X3[a])return yl;X3[a]=_g()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!bE&&"string"==typeof n&&(e&&(e=K3(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=K3(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return yl}}return n.VERSION=W3,n})();function Z3(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return wE(Number.isFinite(e)&&e>=0),e}function J3(n){const{logLevel:e,message:t}=n;n.logLevel=Z3(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return wE("string"===r||"object"===r),Object.assign(n,n.opts)}const Oi=new nD({id:"deck"}),Mi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mi,"IDENTITY",{get:()=>Oi.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},eB={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},un=new nD({id:"luma.gl"});function ko(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function EE(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function pi(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function SE(n){return ko(EE(n),"Invalid WebGLRenderingContext"),n}function Bo(n){return ko(pi(n),"Requires WebGL2"),n}var Sr=tt(761);const Hy={};const Gy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Sr.CO.console&&Sr.CO.console.log&&Sr.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};hf.prototype.VERTEX_ARRAY_BINDING_OES=34229,hf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;ipi(n)?void 0:0,$ee={3074:n=>pi(n)?void 0:36064,35723:n=>pi(n)?void 0:4352,35977:fr,32937:fr,36795:(n,e)=>{const t=pi(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(iB);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(iB);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:fr,35071:fr,37447:fr,36063:(n,e)=>{if(!pi(n)){const t=n.getExtension(nB);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:fr,35374:fr,35377:fr,34852:n=>{if(!pi(n)){const e=n.getExtension(nB);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(tB)?2147483647:65535,33001:n=>n.getExtension(tB)?16777216:65535,33e3:n=>16777216,37157:fr,35373:fr,35657:fr,36183:fr,37137:fr,34045:fr,35978:fr,35979:fr,35968:fr,35376:fr,35375:fr,35659:fr,37154:fr,35371:fr,35658:fr,35076:fr,35077:fr,35380:fr},rB="ANGLE_instanced_arrays",sB={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{ko(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[rB]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){ko(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{ko(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{ko(!1)},deleteQuery:()=>{ko(!1)},beginQuery:()=>{ko(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},iD={readBuffer:(n,e,t)=>{pi(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:pi(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!pi(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!pi(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=$ee[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function rte(n,{extension:e,target:t,target2:i}){const r=sB[e];ko(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new hf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&rte(n,{extension:t,target:n.luma,target2:n})}(n,sB),function(n,{target:e,target2:t}){Object.keys(iD).forEach(i=>{if("function"==typeof iD[i]){const r=n[i]?n[i].bind(n):()=>{},s=iD[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const rD={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},$d=(n,e,t)=>e?n.enable(t):n.disable(t),oB=(n,e,t)=>n.hint(t,e),Ra=(n,e,t)=>n.pixelStorei(t,e);function $y(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const ate={3042:$d,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:$d,2885:(n,e)=>n.cullFace(e),2929:$d,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:$d,35723:oB,36006:(n,e)=>{const t=pi(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:oB,2849:(n,e)=>n.lineWidth(e),32823:$d,32824:"polygonOffset",10752:"polygonOffset",35977:$d,32938:"sampleCoverage",32939:"sampleCoverage",3089:$d,3088:(n,e)=>n.scissor(...e),2960:$d,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:Ra,3317:Ra,37440:Ra,37441:Ra,37443:Ra,3330:Ra,3332:Ra,3331:Ra,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Ra,32878:Ra,3316:Ra,3315:Ra,32877:Ra,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=$y(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=$y(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=$y(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=$y(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=$y(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Qr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const lte={blendEquation:(n,e,t)=>n.blendEquationSeparate(Qr(32777,e,t),Qr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Qr(32969,e,t),Qr(32968,e,t),Qr(32971,e,t),Qr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Qr(32824,e,t),Qr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Qr(32938,e,t),Qr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Qr(2962,e,t),Qr(2967,e,t),Qr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Qr(34816,e,t),Qr(36003,e,t),Qr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Qr(2964,e,t),Qr(2965,e,t),Qr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Qr(34817,e,t),Qr(34818,e,t),Qr(34819,e,t))},aB={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Bc=(n,e)=>n.isEnabled(e),lB={3042:Bc,2884:Bc,2929:Bc,3024:Bc,32823:Bc,32926:Bc,32928:Bc,3089:Bc,2960:Bc,35977:Bc};function cB(n){for(const e in n)return!1;return!0}function cte(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||rD)){const r=e,s=lB[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=lB[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},rD),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){ko(this.stateStack.length>0),Ou(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){ko(void 0!==s);const o=e[s],a=this.cache[s];cte(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function dB(n,e={}){const{enable:t=!0,copyState:i}=e;if(ko(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new hte(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in aB)ute(n,o,aB[o]);uB(n,"getParameter"),uB(n,"isEnabled")}return n.state.enable=t,n}function hB(n){ko(n.state),n.state.pop()}function Ou(n,e){if(ko(EE(n),"setParameters requires a WebGL context"),cB(e))return;const t={};for(const r in e){const s=Number(r),o=ate[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)lte[r](n,e,i)}function nc(n,e,t){if(cB(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||dB(n,{copyState:!1}),n.state.push()}(n),Ou(n,e),i)r=t(n),hB(n);else try{r=t(n)}finally{hB(n)}return r}function vg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function sD(n,e,t=!0){return function(n,e,t,i,r){const s=fB(n[0],e,t);let o=pB(n[1],e,i,r),a=fB(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=pB(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,vg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function fB(n,e,t){return Math.min(Math.round(n*e),t-1)}function pB(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const oD=(0,Sr.jU)(),yte=oD&&"undefined"!=typeof document,gB={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function mB(n={}){ko(oD,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},gB,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(yte&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=aD(r,n),function(n){const e=pi(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);un.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function aD(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},gB,e);const{manageState:t,debug:i}=e;return t&&dB(n,{copyState:!1,log:(...r)=>un.log(1,...r)()}),oD&&i&&(Sr.CO.makeDebugContext?(n=Sr.CO.makeDebugContext(n,e),un.level=Math.max(un.level,1)):un.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function _B(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class yB{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=_B(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(_B()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class lD{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof yB?e:new yB(t,i)),this.stats[t]}}const Wy="8.5.7",ff=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new lD({id:e})),this.stats.get(e)}};if(Sr.CO.luma&&Sr.CO.luma.VERSION!==Wy)throw new Error(`luma.gl - multiple VERSIONs detected: ${Sr.CO.luma.VERSION} vs 8.5.7`);function tn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function cD(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return tn(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Wd(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Sr.CO.luma||((0,Sr.jU)()&&un.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Sr.CO.luma=Sr.CO.luma||{VERSION:Wy,version:Wy,log:un,stats:ff,globals:{modules:{},nodeIO:{}}});const uD={};function jc(n="id"){return uD[n]=uD[n]||1,`${n}-${uD[n]++}`}function vB(n){return tn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function bg(n){let e=!0;for(const t in n){e=!1;break}return e}function bB(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw un.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const wg="Resource subclass must define virtual methods";class Nu{constructor(e,t={}){SE(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||jc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){tn(e=cD(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=pi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=pi(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?Wd(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=Wd(this.gl,o[f]))}}return o}setParameter(e,t){tn(e=cD(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=pi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=cD(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return bB(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(wg)}_deleteHandle(){throw new Error(wg)}_bindHandle(e){throw new Error(wg)}_getOptsFromHandle(){throw new Error(wg)}_getParameter(e,t){throw new Error(wg)}_setParameter(e,t){throw new Error(wg)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=ff.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;ff.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=ff.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=ff.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function dD(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function qy(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function Ite({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return sa.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return sa.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=hD("Accessor",e,Ote)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const EB={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},Nte={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:EB},Pte={removedProps:EB};class rr extends Nu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/sa.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/sa.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=hD("Buffer",e,Nte),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=hD("Buffer",e,Pte))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new sa(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;tn(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Bo(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return Bo(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){Bo(this.gl);const s=qy(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return tn((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(tn(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){tn(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=dD(e);return tn(s),this.setAccessor(new sa(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){tn(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/qy(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new sa(this.accessor,{type:dD(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return un.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return un.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return un.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return un.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new sa(this.accessor,e),this}}const fD={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},SB={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},xB={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},kte=[9729,9728],CB=Sr.CO.WebGLBuffer||function(){};class Eg extends Nu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=fD[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=pi(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=fD[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=jc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(G=>this.initialize(Object.assign({},e,{pixels:G,data:G}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:x=!1,mipmaps:A=!0}=e;const{depth:W=0}=e;return({width:f,height:p,compressed:x,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:x,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=W,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),A&&this._isNPOT()&&(un.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),A=!1,this._updateForNPOT(l)),this.mipmaps=A,this.setImageData({data:t,width:f,height:p,depth:W,format:s,type:_,dataFormat:g,border:o,mipmaps:A,parameters:c,compressed:x}),A&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:x}=this;x.bindTexture(this.target,this.handle);let W,A=null;return({data:c,dataType:A}=this._getDataType({data:c,compressed:_})),nc(this.gl,l,()=>{switch(A){case"null":x.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":x.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":W=Bo(x),W.bindBuffer(35052,c.handle||c),W.texImage2D(t,r,s,f,p,o,g,d,a),W.bindBuffer(35052,null);break;case"browser-object":pi(x)?x.texImage2D(t,r,s,f,p,o,g,d,c):x.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[G,ge]of c.entries())x.compressedTexImage2D(t,G,ge.format,ge.width,ge.height,o,ge.data);break;default:tn(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(SB[this.dataFormat]||4)*(xB[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:x={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),tn(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const A=i;i=A.data,o=A.shape[0],a=A.shape[1]}i instanceof rr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),nc(this.gl,x,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof CB){const A=Bo(this.gl);A.bindBuffer(35052,i),A.texSubImage2D(e,l,r,s,o,a,f,d,g),A.bindBuffer(35052,null)}else pi(this.gl)?Bo(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return un.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof rr?{data:e.handle,dataType:"buffer"}:e instanceof CB?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=fD[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},tn(r,"Could not deduced texture size"),tn(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),tn(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:tn(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(pi(this.gl)||!this.width||!this.height||vB(this.width)&&vB(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===kte.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Bte(n,e){return tn("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class Oa extends Eg{static isSupported(e,t){return Eg.isSupported(e,t)}constructor(e,t={}){SE(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Bte(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const pf="EXT_color_buffer_float",AB={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:pf,bpp:2},33327:{gl2:pf,bpp:4},34842:{gl2:pf,bpp:8},33326:{gl2:pf,bpp:4},33328:{gl2:pf,bpp:8},34836:{gl2:pf,bpp:16},35898:{gl2:pf,bpp:4}};class Sg extends Nu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=pi(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,AB)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return tn(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&pi(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*AB[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const RB="clear: bad arguments";function gD(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),tn(0!==o,RB),nc(n,s,()=>{n.clear(o)})}function OB(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function ni(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){OB(s,i,r,o,a,"next",l)}function a(l){OB(s,i,r,o,a,"throw",l)}o(void 0)})}}const mD=[34069,34070,34071,34072,34073,34074];let $te=(()=>{class n extends Eg{constructor(t,i={}){SE(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return ni(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(mD.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),mD.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&un.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((x,A)=>{t&&i?d.texImage2D(g,A,a,t,i,o,a,l,x):d.texImage2D(g,A,a,a,l,x)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=mD,n})();class Wte extends Eg{static isSupported(e){return pi(e)}constructor(e,t={}){Bo(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),nc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof rr&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(SB[this.dataFormat]||4)*(xB[this.type]||1),"Texture"),this.loaded=!0,this}}function Kte(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Is(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function xE(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof Is?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Kte(n),deleteFramebuffer:!0}}(n);tn(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),tn(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(qy(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return tn(!1),0}}(t))}(o,c,r,a,l),c=c||dD(o);const x=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,x||null),f&&d.delete(),o}function _D(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=xE(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Ite({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return tn(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&un.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){tn(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof Sg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(Is.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&gD(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Bo(n),nc(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:tn(!1,RB)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return un.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return un.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return un.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return un.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return un.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return un.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=Bo(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=Wd(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?Wd(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?Wd(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(_D(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>un.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=_D(this,{targetMaxHeight:100});return un.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new Oa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new Sg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new Sg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&tn(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof Sg?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:Bo(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:tn(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return pi(n)?n:null}(this.gl);t?t.readBuffer(e):tn(36064===e||1029===e,NB),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Bo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):tn(1===e.length&&(36064===e[0]||1029===e[0]),NB)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in PB)void 0===n.luma.caps[e]&&(n.luma.caps[e]=LB(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Is.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const PB={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new Oa(n,{format:6408,type:5126,dataFormat:6408}),t=new Is(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function yD(n,e){return FB(n,e)}function FB(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>LB(n,t))}function LB(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=PB[e];let i;tn(t,e);const r=pi(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:tn(!1);return i}(n,e)),n.luma.caps[e]||un.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class vD{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},one=(Math,1/180*Math.PI),xr={};function lne(n,{precision:e=xr.precision||4}={}){return n=function(n){return Math.round(n/xr.EPSILON)*xr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function qd(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Pu(n,e,t){if(qd(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*one,void 0)}(n)}function gf(n,e,t){return Pu(n,i=>Math.max(e,Math.min(t,i)))}function CE(n,e,t){return qd(n)?n.map((i,r)=>CE(i,e[r],t)):t*e+(1-t)*n}function Xy(n,e,t){const i=xr.EPSILON;t&&(xr.EPSILON=t);try{if(n===e)return!0;if(qd(n)&&qd(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+lne(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(KB.length=n.length,i=KB):i=qB,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function XB(n){return n&&n[Symbol.asyncIterator]}function xD(n,e=(()=>!0)){return Array.isArray(n)?QB(n,e,[]):e(n)?[n]:[]}function QB(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function ZB(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ht(ht(ht({},$ne[n.type]),e),n)):null}function JB(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function ej(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function tj(n){n.push(n.shift())}function AD(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function nj({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=AD(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const W=s;s=(G,ge)=>t._normalizeConstant(W(G,ge))}const _=p?(W,G)=>s(g,G):(W,G)=>s(g.subarray(W,W+a),G),x=n.getData({length:i}),A=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return CD({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===DE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=DE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=zne}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==DE}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const A=f*a+l;for(let W=0;Wd?c.set(ge,x):(e._normalizeValue(ge,W.target,0),Une({target:c,source:W.target,start:x,count:Ne}));x+=Ne*d}else e._normalizeValue(ge,c,x),x+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let MD={};function bo(n){Oi.level>0&&MD[n]&&MD[n].call(...arguments)}function Na(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const ij="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Kne=`#version 300 es\n${ij}`;function rj(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function sj(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Kne:e>300?`#version ${e}\n${ij}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Na(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class oj extends Nu{static isSupported(e){return pi(e)}constructor(e,t={}){Bo(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,bg(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,un.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof rr?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Zne{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof rr?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&tn(pi(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new oj(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],tn(i[s]instanceof rr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new rr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function aj(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const Jy="vs",tie={[Jy]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},IE="__LUMA_INJECT_DECLARATIONS__",lj=/void\s+main\s*\([^)]*\)\s*\{\n?/,cj=/}\n?[^{}]*$/,ID=[];function uj(n,e,t,i=!1){const r=e===Jy;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),ID.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(cj,l=>a+l));break;case"fs:#decl":r||(n=n.replace(IE,a));break;case"fs:#main-start":r||(n=n.replace(lj,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(cj,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(IE,""),i&&(n=n.replace(/\}\s*$/,s=>s+tie[e])),n}function RD(n){const e={};return Na(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const nie={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},RE="transform_uSize_",dj="transform_position";const uie={10241:9728,10240:9728,10242:33071,10243:33071};class hie{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${RE}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${RE}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=xE(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Na(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new rr(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new Is(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters(uie)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){tn(n instanceof Oa||n instanceof $te||n instanceof Wte);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const x=function(n,e){const t={},i=function(n){return rj(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${RE}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Na(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(x){const{updatedLine:A,inject:W}=x;f[g]=A,c=RD([c,W]),Object.assign(a,x.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=rj(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){tn(i);const p=`${RE}${t}`;c=RD([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${dj} = transform_getPos(${p});\n gl_Position = vec4(${dj}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=RD([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||sj({version:aj(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[nie].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const OD={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function pie(n){let e=hj(n);return"object"===e?n?"type"in n?Object.assign({},n,OD[n.type]):"value"in n?(e=hj(n.value),Object.assign({type:e},n,OD[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},OD[e])}function hj(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class ND{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Na("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=pie(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Na(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Na(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function yie(n){return function(n){const e={},t={};return PD({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(pj(n))}function PD({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof ND||(Na("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Na(t.name,"shader module has no name"),(t=new ND(t)).dependencies=pj(t.dependencies)),t))}const FD={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},mf={};function Aie(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(FD).forEach(n=>{mf[n]=n});const LD={};function gj(n,e,t={}){const i=FD[e];if(Na(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in LD)return LD[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),LD[e]=l,l}function OE(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=FD[e];Na(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Na(!1===r||!0===r),r}(n,t))}function Cg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const mj=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],Iie=[...mj,[Cg("attribute"),"in $1"],[Cg("varying"),"out $1"]],Rie=[...mj,[Cg("varying"),"in $1"]],_j=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Oie=[..._j,[Cg("in"),"attribute $1"],[Cg("out"),"varying $1"]],Nie=[..._j,[Cg("in"),"varying $1"]],kD="gl_FragColor",BD=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Pie=/void\s+main\s*\([^)]*\)\s*\{\n?/;function NE(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Bie=`\n\n${IE}\n\n`,yj={[Jy]:"vertex",fs:"fragment"};function vj(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Na("string"==typeof t,"shader source must be a string");const f=i===Jy,p=t.split("\n");let g=100,_="",x=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],x=p.slice(1).join("\n")):_=`#version ${g}`;const A={};r.forEach($e=>{Object.assign(A,$e.getDefines())}),Object.assign(A,s);let W=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${yj[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${yj[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:Aie(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return OE(n,mf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),OE(n,mf.GLSL_DERIVATIVES)&&gj(n,mf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),OE(n,mf.GLSL_FRAG_DATA)&&gj(n,mf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),OE(n,mf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(A)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const G=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),ge={},Ne={},Ge={};for(const $e in a){const at="string"==typeof a[$e]?{injection:a[$e],order:0}:a[$e],St=$e.match(/^(v|f)s:(#)?([\w-]+)$/);if(St){const Pt=St[3];St[2]?"decl"===Pt?Ne[$e]=[at]:Ge[$e]=[at]:ge[$e]=[at]}else Ge[$e]=[at]}for(const $e of r){d&&$e.checkDeprecations(x,d),W+=$e.getModuleSource(i,g);const St=$e.injections[i];for(const Rt in St){const Pt=Rt.match(/^(v|f)s:#([\w-]+)$/);if(Pt){const Zt="decl"===Pt[2]?Ne:Ge;Zt[Rt]=Zt[Rt]||[],Zt[Rt].push(St[Rt])}else ge[Rt]=ge[Rt]||[],ge[Rt].push(St[Rt])}}return W+=Bie,W=uj(W,i,Ne),W+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(G[i],ge),W+=x,W=uj(W,i,Ge),W=function(n,e,t){switch(e){case 300:return t?NE(n,Iie):function(n){const e=(n=NE(n,Rie)).match(BD);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${kD}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(Pie,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${kD}\\b`,"g"),t)}return n}(n);case 100:return t?NE(n,Oie):function(n){const e=(n=NE(n,Nie)).match(BD);if(e){const t=e[1];n=n.replace(BD,"").replace(new RegExp(`\\b${t}\\b`,"g"),kD)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(W,l?100:g,f),W}function Uie(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const qie={5126:Cr.bind(null,"uniform1fv",Pa,1,wo),35664:Cr.bind(null,"uniform2fv",Pa,2,wo),35665:Cr.bind(null,"uniform3fv",Pa,3,wo),35666:Cr.bind(null,"uniform4fv",Pa,4,wo),5124:Cr.bind(null,"uniform1iv",Kd,1,wo),35667:Cr.bind(null,"uniform2iv",Kd,2,wo),35668:Cr.bind(null,"uniform3iv",Kd,3,wo),35669:Cr.bind(null,"uniform4iv",Kd,4,wo),35670:Cr.bind(null,"uniform1iv",Kd,1,wo),35671:Cr.bind(null,"uniform2iv",Kd,2,wo),35672:Cr.bind(null,"uniform3iv",Kd,3,wo),35673:Cr.bind(null,"uniform4iv",Kd,4,wo),35674:Cr.bind(null,"uniformMatrix2fv",Pa,4,Lu),35675:Cr.bind(null,"uniformMatrix3fv",Pa,9,Lu),35676:Cr.bind(null,"uniformMatrix4fv",Pa,16,Lu),35678:no,35680:no,5125:Cr.bind(null,"uniform1uiv",PE,1,wo),36294:Cr.bind(null,"uniform2uiv",PE,2,wo),36295:Cr.bind(null,"uniform3uiv",PE,3,wo),36296:Cr.bind(null,"uniform4uiv",PE,4,wo),35685:Cr.bind(null,"uniformMatrix2x3fv",Pa,6,Lu),35686:Cr.bind(null,"uniformMatrix2x4fv",Pa,8,Lu),35687:Cr.bind(null,"uniformMatrix3x2fv",Pa,6,Lu),35688:Cr.bind(null,"uniformMatrix3x4fv",Pa,12,Lu),35689:Cr.bind(null,"uniformMatrix4x2fv",Pa,8,Lu),35690:Cr.bind(null,"uniformMatrix4x3fv",Pa,12,Lu),35678:no,35680:no,35679:no,35682:no,36289:no,36292:no,36293:no,36298:no,36299:no,36300:no,36303:no,36306:no,36307:no,36308:no,36311:no},Kie={},Yie={},Xie={},bj=[0];function jD(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(bj[0]=n,n=bj);const r=n.length;if(r%e&&un.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Cr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{tn(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return xj(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:Sj(s,c),warnings:Sj(o,c)}}(i,this.source,this.shaderType,this.id);throw un.error(`GLSL compilation errors in ${r}\n${s}`)(),un.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class VD extends e0{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class UD extends e0{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Rs=5126,t0=5124,n0=5125,zD={[Rs]:[Rs,1,"float"],35664:[Rs,2,"vec2"],35665:[Rs,3,"vec3"],35666:[Rs,4,"vec4"],[t0]:[t0,1,"int"],35667:[t0,2,"ivec2"],35668:[t0,3,"ivec3"],35669:[t0,4,"ivec4"],[n0]:[n0,1,"uint"],36294:[n0,2,"uvec2"],36295:[n0,3,"uvec3"],36296:[n0,4,"uvec4"],35670:[Rs,1,"bool"],35671:[Rs,2,"bvec2"],35672:[Rs,3,"bvec3"],35673:[Rs,4,"bvec4"],35674:[Rs,8,"mat2"],35685:[Rs,8,"mat2x3"],35686:[Rs,8,"mat2x4"],35675:[Rs,12,"mat3"],35687:[Rs,12,"mat3x2"],35688:[Rs,12,"mat3x4"],35676:[Rs,16,"mat4"],35689:[Rs,16,"mat4x2"],35690:[Rs,16,"mat4x3"]};function Ij(n){const e=zD[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function Rj(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Rs}for(const t in zD){const[i,r,s]=zD[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class Pre{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!pi(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=Ij(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new sa(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=Ij(i),l={location:e,name:t,accessor:new sa({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Fre=35981,Lre=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class Nj extends Nu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Lre),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=Fre}=e;return this.hash=t||"",this.vs="string"==typeof i?new VD(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new UD(this.gl,{id:`${e.id}-fs`,source:r}):r,tn(this.vs instanceof VD),tn(this.fs instanceof UD),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Bo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Pre(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:x,samplers:A}){if((x||A)&&(un.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(x||{})),un.priority>=e){const W=g?g.id:"default",G=`mode=${Wd(this.gl,t)} verts=${i} instances=${c} indexType=${Wd(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${W}`;un.log(e,G)()}return tn(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const W=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return tn(!1),0}}(t);p.begin(W)}this._bindTextures(),nc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&pi(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){un.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Jie(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof Is&&(s=s.texture),s instanceof Eg)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&ere(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new VD({handle:r});break;case 35632:i.fs=new UD({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=jc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),un.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),un.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||un.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(ge=>this._getHash(ge.name)).sort(),g=o.map(ge=>this._getHash(ge)),_=Object.keys(r).sort(),x=Object.keys(s).sort(),A=[],W=[];for(const ge of _)A.push(this._getHash(ge)),A.push(this._getHash(r[ge]));for(const ge of x)W.push(this._getHash(ge)),W.push(this._getHash(s[ge]));const G=`${d}/${f}D${A.join("/")}M${p.join("/")}I${W.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[G]){const ge=function(n,e){const{vs:t,fs:i}=e,r=yie(e.modules||[]);return{gl:n,vs:vj(n,Object.assign({},e,{source:t,type:Jy,modules:r})),fs:vj(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Uie(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[G]=new Nj(this.gl,{hash:G,vs:ge.vs,fs:ge.fs,varyings:o,bufferMode:a}),this._getUniforms[G]=ge.getUniforms||(Ne=>{}),this._useCounts[G]=0}return this._useCounts[G]++,this._programCache[G]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":zy.chrome?"Chrome":zy.safari?"Safari":zy.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Fa(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Fa.MAX_ATTRIBUTES=Fa.MAX_ATTRIBUTES||e.getParameter(34921),Fa.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Fa._setConstantFloatArray(e,t,i);break;case Int32Array:Fa._setConstantIntArray(e,t,i);break;case Uint32Array:Fa._setConstantUintArray(e,t,i);break;default:tn(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Fa.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return tn(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(tn(pi(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Fa.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new rr(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!kE||kE.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Hre=/^(.+)__LOCATION_([0-9]+)$/,Gre=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class $re{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Fa(e),bB(this,"VertexArray","v6.0",Gre),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new rr(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,un.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=sa.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return tn(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Hre.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof rr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof rr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof rr))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof rr){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return un.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function s0(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=s0(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function Pj(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof rr){const p=e,{data:g,changed:_}=p.getDebugData();let x;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?x=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${Wd(r,s)})`:(c=!0,x=`${l} bytes`),{[i]:`${d}${s0(f,{size:o,isInteger:c})}`,"Format ":x}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${s0(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Kre(n,e){const{type:t,size:i}=e,r=Rj(t,i);return r?`${n} (${r.name})`:n}function Fj({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){tn(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:s0(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function HD({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?s0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function Lj(n){const{type:e,size:t}=n.accessor,i=Rj(e,t);return i?`${i.name} ${n.name}`:n.name}const Qre={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Jre(n,e){const{attributeMap:t=Qre}=e||{};return t&&t[n]||n}function ese(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}tn(Number.isFinite(e.size),`attribute ${n} needs size`)}const kj=()=>{},ise={};class BE{constructor(e,t={}){const{id:i=jc("model")}=t;tn(EE(e)),this.id=i,this.gl=e,this.id=t.id||jc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||r0.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},tn(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return tn(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return tn(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Jre(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ht({},o);delete c.value,i[a]=[new rr(n,l),c],ese(s,c)}}if(r){const s=r.value||r;tn(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new rr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(bg(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return gD(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),un.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&un.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:x,instanceCount:A}=this,{onBeforeRender:W=kj,onAfterRender:G=kj}=this.props;W(),this.program.setUniforms(this.uniforms);const ge=this.program.draw(Object.assign(ise,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:x,instanceCount:A,offset:f?g:0}));return G(),un.priority>=2&&this._logDrawCallEnd(c,l,i),ge}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return un.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}tn(t instanceof Nj,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new $re(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof rr&&t.delete()}}_setAnimationProps(e){this.animated&&tn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(bg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new oj(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:un.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=Pj(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Kre(s.name,a)}`),t[o]=Pj(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=Fj({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=Fj({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&un.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&un.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${Lj(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${Lj(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);un.table(e,s)(),un.table(e,o)(),un.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),un.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class GD{static isSupported(e){return pi(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();tn(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new BE(t,Object.assign({},e,{fs:e.fs||sj({version:aj(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(bg(n.feedbackBuffers)&&bg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Zne(e,t)),function(n){return!(bg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new hie(e,t)),tn(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function jE(){}const ose={onStart:jE,onUpdate:jE,onInterrupt:jE,onEnd:jE};class o0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ht(ht({},ose),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const pse={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new o0(i),this.attribute=t,this.attributeInTransition=new TD(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=ej(e.size);return new GD(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new rr(e,r),new rr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;tj(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)nj(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=AD(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:JB(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new o0(i),this.attribute=t,this.attributeInTransition=new TD(e,Un(ht({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new Oa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new Is(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=ej(e.size);return new GD(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new rr(e,r),new rr(e,r),new rr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)nj(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=AD(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:JB(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),tj(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),xE(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class gse{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=GD.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Oi.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=pse[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Oi.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const Bj="attributeManager.invalidate";class wse{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new gse(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;bo("attribute.updateStart",t),t.allocate(i)&&bo("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,bo("attribute.updateEnd",t,i))}}function Vj(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function Uj(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=ZB(r)))return;const o=Cse[r.type];if(!o)return void Oi.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Un(ht({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const VE={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:Tse}=VE;function Ise(n,e){if(!n.transitions)return null;const t={},i=WD(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&$D(n[r],e[r],s)&&(t[r]=!0)}return t}function zj({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=$D(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=$D(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function $D(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function Nse(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!jse(i[r],e[r])){t=n(i),e=i;break}return t}}function Vse(n,e){if(!e)return n;const t=ht(ht({},n),e);if("defines"in e&&(t.defines=ht(ht({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=ht({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function zE(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],x=e[13],A=e[14],W=e[15],G=t*a-i*o,ge=t*l-r*o,Ne=t*c-s*o,Ge=i*l-r*a,$e=i*c-s*a,at=r*c-s*l,St=d*x-f*_,Rt=d*A-p*_,Pt=d*W-g*_,Xt=f*A-p*x,Zt=f*W-g*x,bt=p*W-g*A,Ct=G*bt-ge*Zt+Ne*Xt+Ge*Pt-$e*Rt+at*St;return Ct?(n[0]=(a*bt-l*Zt+c*Xt)*(Ct=1/Ct),n[1]=(r*Zt-i*bt-s*Xt)*Ct,n[2]=(x*at-A*$e+W*Ge)*Ct,n[3]=(p*$e-f*at-g*Ge)*Ct,n[4]=(l*Pt-o*bt-c*Rt)*Ct,n[5]=(t*bt-r*Pt+s*Rt)*Ct,n[6]=(A*Ne-_*at-W*ge)*Ct,n[7]=(d*at-p*Ne+g*ge)*Ct,n[8]=(o*Zt-a*Pt+c*St)*Ct,n[9]=(i*Pt-t*Zt-s*St)*Ct,n[10]=(_*$e-x*Ne+W*G)*Ct,n[11]=(f*Ne-d*$e-g*G)*Ct,n[12]=(a*Rt-o*Xt-l*St)*Ct,n[13]=(t*Xt-i*Rt+r*St)*Ct,n[14]=(x*ge-_*Ge-A*G)*Ct,n[15]=(d*Ge-f*ge+p*G)*Ct,n):null}function Vc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],x=e[12],A=e[13],W=e[14],G=e[15],ge=t[0],Ne=t[1],Ge=t[2],$e=t[3];return n[0]=ge*i+Ne*a+Ge*f+$e*x,n[1]=ge*r+Ne*l+Ge*p+$e*A,n[2]=ge*s+Ne*c+Ge*g+$e*W,n[3]=ge*o+Ne*d+Ge*_+$e*G,n[4]=(ge=t[4])*i+(Ne=t[5])*a+(Ge=t[6])*f+($e=t[7])*x,n[5]=ge*r+Ne*l+Ge*p+$e*A,n[6]=ge*s+Ne*c+Ge*g+$e*W,n[7]=ge*o+Ne*d+Ge*_+$e*G,n[8]=(ge=t[8])*i+(Ne=t[9])*a+(Ge=t[10])*f+($e=t[11])*x,n[9]=ge*r+Ne*l+Ge*p+$e*A,n[10]=ge*s+Ne*c+Ge*g+$e*W,n[11]=ge*o+Ne*d+Ge*_+$e*G,n[12]=(ge=t[12])*i+(Ne=t[13])*a+(Ge=t[14])*f+($e=t[15])*x,n[13]=ge*r+Ne*l+Ge*p+$e*A,n[14]=ge*s+Ne*c+Ge*g+$e*W,n[15]=ge*o+Ne*d+Ge*_+$e*G,n}function a0(n,e,t){var o,a,l,c,d,f,p,g,_,x,A,W,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],x=e[9],A=e[10],W=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=x,n[10]=A,n[11]=W,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+x*s+e[13],n[14]=l*i+p*r+A*s+e[14],n[15]=c*i+g*r+W*s+e[15]),n}function l0(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function Gj(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function $j(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function Wj(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function qj(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],x=n[13],A=n[14],W=n[15],G=e[0],ge=e[1],Ne=e[2],Ge=e[3],$e=e[4],at=e[5],St=e[6],Rt=e[7],Pt=e[8],Xt=e[9],Zt=e[10],bt=e[11],Ct=e[12],Ut=e[13],ft=e[14],Wt=e[15];return Math.abs(t-G)<=gr*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(i-ge)<=gr*Math.max(1,Math.abs(i),Math.abs(ge))&&Math.abs(r-Ne)<=gr*Math.max(1,Math.abs(r),Math.abs(Ne))&&Math.abs(s-Ge)<=gr*Math.max(1,Math.abs(s),Math.abs(Ge))&&Math.abs(o-$e)<=gr*Math.max(1,Math.abs(o),Math.abs($e))&&Math.abs(a-at)<=gr*Math.max(1,Math.abs(a),Math.abs(at))&&Math.abs(l-St)<=gr*Math.max(1,Math.abs(l),Math.abs(St))&&Math.abs(c-Rt)<=gr*Math.max(1,Math.abs(c),Math.abs(Rt))&&Math.abs(d-Pt)<=gr*Math.max(1,Math.abs(d),Math.abs(Pt))&&Math.abs(f-Xt)<=gr*Math.max(1,Math.abs(f),Math.abs(Xt))&&Math.abs(p-Zt)<=gr*Math.max(1,Math.abs(p),Math.abs(Zt))&&Math.abs(g-bt)<=gr*Math.max(1,Math.abs(g),Math.abs(bt))&&Math.abs(_-Ct)<=gr*Math.max(1,Math.abs(_),Math.abs(Ct))&&Math.abs(x-Ut)<=gr*Math.max(1,Math.abs(x),Math.abs(Ut))&&Math.abs(A-ft)<=gr*Math.max(1,Math.abs(A),Math.abs(ft))&&Math.abs(W-Wt)<=gr*Math.max(1,Math.abs(W),Math.abs(Wt))}function Kj(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function HE(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new oa(4);oa!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const Yj=[0,0,0,0],hoe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],foe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],poe=[0,0,0],goe=[0,0,0],moe=UE(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=Yj,l=Yj,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=Xj(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=HE([],l,o),s=i||s,o=Vc([],r,s),o=Vc([],o,hoe)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:poe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Mi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Mi.LNGLAT:case Mi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Mi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function Xj(n,e,t=goe){let r,i=t,s=!0;switch(r=e===Mi.LNGLAT_OFFSETS||e===Mi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case kc.WEB_MERCATOR:(e===Mi.LNGLAT||e===Mi.CARTESIAN)&&(s=!1);break;case kc.WEB_MERCATOR_AUTO_OFFSET:e===Mi.LNGLAT?i=r:e===Mi.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case kc.IDENTITY:i=n.position.map(Math.fround);break;case kc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class boe extends bD{get ELEMENTS(){return Fu(!1),0}get RANK(){return Fu(!1),0}toString(){let e="[";if(xr.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new $n).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return Wj(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],x=n[14],A=n[15];return(e*o-t*s)*(f*A-p*x)-(e*a-i*s)*(d*A-p*_)+(e*l-r*s)*(d*x-f*_)+(t*a-i*o)*(c*A-p*g)-(t*l-r*o)*(c*x-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return zE(this,this),this.check()}multiplyLeft(e){return Vc(this,e,this),this.check()}multiplyRight(e){return Vc(this,this,e),this.check()}rotateX(e){return Gj(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return $j(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,x,A,W,G,ge,Ne,Ge,$e,at,St,Rt,Pt,Xt,Zt,bt,Ct,Ut,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*sc+rc)/(2*rc),512*(rc+Math.log(Math.tan(eV+e*sc*.5)))/(2*rc)]}function Yd([n,e]){const t=n/512*(2*rc)-rc,i=2*(Math.atan(Math.exp(e/512*(2*rc)-rc))-eV);return[t*YD,i*YD]}function $E({latitude:n,longitude:e,highPrecision:t=!1}){ku(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*sc),o=512/360,a=o/s,l=512/XD/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=sc*Math.tan(n*sc)/s,f=512/XD*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function nV(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=$E({longitude:t,latitude:i,highPrecision:!0}),d=Ng(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Yd(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function iV({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return a0(o,o,[0,0,-i]),Gj(o,o,-e*sc),$j(o,o,t*sc),l0(o,o,[r/=n,r,r]),s&&a0(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function rV({width:n,height:e,fovy:t=WE(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=WE(i));const a=.5*t*sc,l=sV(t),c=r*sc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function WE(n){return 2*Math.atan(.5/n)*YD}function sV(n){return.5/Math.tan(.5*n*sc)}function QD(n,e){const[t,i,r=0]=n;return ku(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Og(e,[t,i,r,1])}function _f(n,e,t=0){const[i,r,s]=n;if(ku(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Og(e,[i,r,s,1]);const o=Og(e,[i,r,0,1]),a=Og(e,[i,r,1,1]),l=o[2],c=a[2];return Qj([],o,a,l===c?0:((t||0)-l)/(c-l))}function oV({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:ku(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new qE({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],x=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ku(x[0]>0&&x[1]>0);const A=x[0]/_[0],W=x[1]/_[1],Ge=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/A,(g[1]+p[1])/2+(s.bottom-s.top)/2/W]),$e=Math.min(r,f.zoom+KD(Math.abs(Math.min(A,W))));return ku(Number.isFinite($e)),{longitude:Ge[0],latitude:Ge[1],zoom:$e}}const aV=Math.PI/180;function lV(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*aV:Math.atan(.5/n.altitude))>(90-n.pitch)*aV-.01?(l=cV(n,0,e),c=cV(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function cV(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Og(i,[e,0,1,1]),s=Og(i,[e,n.height,1,1]),c=Yd(Qj([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class qE{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=WE(l=1.5):null===c?c=WE(l):null===l&&(l=sV(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=$E({longitude:r,latitude:i}),x=Ng([r,i]);x[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(x,x,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=rV({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return Wj([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=iV({height:t,scale:g,center:x,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=x,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Vc(s,s,i),Vc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l0(o,o,[e/2,-t/2,1]),a0(o,o,[1,-1,0]),Vc(o,o,s);const a=zE([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof qE&&e.width===this.width&&e.height===this.height&&qj(e.projectionMatrix,this.projectionMatrix)&&qj(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=QD(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=_f([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Ng(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=Yd(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Ng(e)}unprojectFlat(e){return Yd(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=_f(t,this.pixelUnprojectionMatrix),s=Ig([],Ng(e),qD([],i));return Yd(Ig([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=oV(Object.assign({width:i,height:r,bounds:e},t));return new qE({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return lV(this,e.z||0)}}const Ooe=Math.PI/180,Noe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZD=[0,0,0],Foe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Pg=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?kc.WEB_MERCATOR:kc.WEB_MERCATOR_AUTO_OFFSET:kc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Xy(t.projectionMatrix,this.projectionMatrix)&&Xy(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=QD(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=_f([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Ng(t):t}unprojectFlat(t){return this.isGeospatial?Yd(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?$E({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends Pg{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:x=1.5}=t;const A=Math.pow(2,s);g=g||1,_=_||1,x=Math.max(.75,x);const{fov:W,aspect:G,focalDistance:ge,near:Ne,far:Ge}=rV({width:g,height:_,pitch:o,altitude:x,nearZMultiplier:l,farZMultiplier:c});let $e=iV({height:_,pitch:o,bearing:a,scale:A,altitude:x});p&&($e=(new $n).translate([512*p,0,0]).multiplyLeft($e)),super(Un(ht({},t),{width:g,height:_,viewMatrix:$e,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:W,aspect:G,focalDistance:ge,near:Ne,far:Ge})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=x,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(Un(ht({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return nV(t,i)}panByPosition(t,i){const r=_f(i,this.pixelUnprojectionMatrix),o=Ig([],this.projectFlat(t),qD([],r)),a=Ig([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=lV(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=oV(ht({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function JD(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof pV){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function gV(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=HE([],[o,a,l,1],t)),i){case Mi.LNGLAT:return JD([o,a,l],e,s);case Mi.LNGLAT_OFFSETS:return JD([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mi.METER_OFFSETS:return JD(nV(r,[o,a,l]),e,s);case Mi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Boe={10241:9987,10240:9729,10242:33071,10243:33071},eI={},Uoe={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||d0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tI(n,e)},accessor:{validate(n,e){const t=KE(n);return"function"===t||t===KE(e.value)},equal:(n,e,t)=>"function"==typeof e||tI(n,e)},array:{validate:(n,e)=>e.optional&&!n||d0(n),equal:(n,e,t)=>t.compare?tI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof Oa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new Oa(t,Un(ht({},e),{parameters:ht(ht(ht({},Boe),i),n.props.textureParameters)}));return eI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof Oa)||eI[n.id]&&(n.delete(),delete eI[n.id])}(n)}}};function tI(n,e){if(n===e)return!0;if(!d0(n)||!d0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=eae,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Zoe]||{},i=e[Qoe]||e,r=e[Joe]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(XB(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return ni(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=iI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const A=_,{dataTransform:W}=i.component?i.component.props:{};a=W?W(A,a):a.concat(A),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(A){d=!0,f=A}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const x=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;x&&x(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:vV,ASYNC_RESOLVED:bV,ASYNC_DEFAULTS:tae}=VE,nae={};let iae=0,rae=(()=>{class n{constructor(){this.props=Goe.apply(this,arguments),this.id=this.props.id,this.count=iae++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[tae])s in i[bV]?r[s]=i[bV][s]:s in i[vV]&&(r[s]=i[vV][s]);return new this.constructor(ht(ht(ht({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new yV({})}}return n.componentName="Component",n.defaultProps=nae,n})();class sae extends yV{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const oc=n=>"function"==typeof n,Xd=n=>null!==n&&"object"==typeof n,EV=n=>Xd(n)&&n.constructor==={}.constructor,oae=n=>n&&"function"==typeof n[Symbol.iterator],aae=n=>n&&"function"==typeof n[Symbol.asyncIterator],f0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Fg=n=>"undefined"!=typeof Blob&&n instanceof Blob,SV=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||Xd(n)&&oc(n.tee)&&oc(n.cancel)&&oc(n.getReader))(n)||(n=>Xd(n)&&oc(n.read)&&oc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function yf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sI(n){var e,t;let i;return yf(n,"null loader"),yf(rI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Un(ht({},n=n[0]),{options:ht(ht({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Uc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oI=Uc.global||Uc.self||Uc.window||{},fae="object"!=typeof process||"[object process]"!==String(process)||process.browser,xV="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);xV&&parseFloat(xV[1]);const lI={};function pae(n){for(const e in lI)n.startsWith(e)&&(n=n.replace(e,lI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const gae=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,mae=/^([-\w.]+\/[-\w.+]+)/;function _ae(n){const e=mae.exec(n);return e?e[1]:n}function CV(n){const e=gae.exec(n);return e?e[1]:""}const yae=/\?.*/;function ZE(n){if(f0(n)){const e=cI(n.url||"");return{url:e,type:_ae(n.headers.get("content-type")||"")||CV(e)}}return Fg(n)?{url:cI(n.name||""),type:n.type||""}:"string"==typeof n?{url:cI(n),type:CV(n)}:{url:"",type:""}}function vae(n){return f0(n)?n.headers["content-length"]||-1:Fg(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cI(n){return n.replace(yae,"")}function AV(n){return uI.apply(this,arguments)}function uI(){return(uI=ni(function*(n){if(f0(n))return n;const e={},t=vae(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=ZE(n);r&&(e["content-type"]=r);const s=yield Eae(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function bae(n){return dI.apply(this,arguments)}function dI(){return(dI=ni(function*(n){if(!n.ok){const e=yield wae(n);throw new Error(e)}})).apply(this,arguments)}function wae(n){return hI.apply(this,arguments)}function hI(){return(hI=ni(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function Eae(n){return fI.apply(this,arguments)}function fI(){return(fI=ni(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${Sae(n.slice(0,5))}`:null})).apply(this,arguments)}function Sae(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const DV={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Wn(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Aae={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function gI(){oI.loaders=oI.loaders||{};const{loaders:n}=oI;return n._state=n._state||{},n._state}const mI=()=>{const n=gI();return n.globalOptions=n.globalOptions||ht({},DV),n.globalOptions};function Tae(n,e,t,i){return t=t||[],function(n,e){RV(n,null,DV,Aae,e);for(const t of e)RV(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=ht({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new xae),NV(r,mI()),NV(r,e),r}(e,n,i)}function IV(n,e){const t=mI(),i=n||t;return"function"==typeof i.fetch?i.fetch:Xd(i.fetch)?r=>TV(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:TV}function RV(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&Xd(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)MV.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=Dae(a,r);MV.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function Dae(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function NV(n,e){for(const t in e)t in e&&(n[t]=EV(e[t])&&EV(n[t])?ht(ht({},n[t]),e[t]):e[t])}function zc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Oae(n,e="3.0.12"){return zc(n,"no worker provided"),!(!e||!n.version)}const Hc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Nae=Hc.global||Hc.self||Hc.window||{},_I="object"!=typeof process||"[object process]"!==String(process)||process.browser,yI="function"==typeof importScripts,Pae="undefined"!=typeof window&&void 0!==window.orientation,PV="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),vI=(PV&&parseFloat(PV[1]),new Map);function FV(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function LV(n,e=!0,t){const i=t||new Set;if(n)if(kV(n))i.add(n);else if(kV(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)LV(n[r],e,i);return void 0===t?Array.from(i):[]}function kV(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const bI=()=>{};class BV{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Wn(this,"name",void 0),Wn(this,"source",void 0),Wn(this,"url",void 0),Wn(this,"terminated",!1),Wn(this,"worker",void 0),Wn(this,"onMessage",void 0),Wn(this,"onError",void 0),Wn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;zc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bI,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bI,this.onError=bI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||LV(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){zc(n.source&&!n.url||!n.source&&n.url);let e=vI.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?FV(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),vI.set(n.url,e)),n.source&&(e=FV(n.source),vI.set(n.source,e))),zc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class Bae{constructor(e,t){Wn(this,"name",void 0),Wn(this,"workerThread",void 0),Wn(this,"isRunning",void 0),Wn(this,"result",void 0),Wn(this,"_resolve",void 0),Wn(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zc(this.isRunning),this.isRunning=!1,this._reject(e)}}class jae{constructor(e){Wn(this,"name","unnamed"),Wn(this,"source",void 0),Wn(this,"url",void 0),Wn(this,"maxConcurrency",1),Wn(this,"maxMobileConcurrency",1),Wn(this,"onDebug",()=>{}),Wn(this,"reuseWorkers",!0),Wn(this,"props",{}),Wn(this,"jobQueue",[]),Wn(this,"idleQueue",[]),Wn(this,"count",0),Wn(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=ht(ht({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return ni(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return ni(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new Bae(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class Bu{static isSupported(){return BV.isSupported()}static getWorkerFarm(e={}){return Bu._workerFarm=Bu._workerFarm||new Bu({}),Bu._workerFarm.setProps(e),Bu._workerFarm}constructor(e){Wn(this,"props",void 0),Wn(this,"workerPools",new Map),this.props=ht({},Vae),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ht(ht({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new jae({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function zae(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return zc(r),r}function Hae(n,e){return!!Bu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Gae(n,e,t,i,r){return wI.apply(this,arguments)}function wI(){return(wI=ni(function*(n,e,t,i,r){const s=n.id,o=zae(n,t),l=Bu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",$ae.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function $ae(n,e,t,i){return EI.apply(this,arguments)}function EI(){return(EI=ni(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}Wn(Bu,"_workerFarm",void 0);var VV=tt(521);function UV(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return VV.toArrayBuffer?VV.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Yae(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function zV(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Xae(n){return xI.apply(this,arguments)}function xI(){return(xI=ni(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Yae(...e)})).apply(this,arguments)}const Jae=262144;function HV(n){this.wrapped=n}function p0(n){return new HV(n)}function g0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof HV;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function AI(n){return function(){return new g0(n.apply(this,arguments))}}function TI(){return(TI=AI(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(II)}function ale(n,e,t){return RI.apply(this,arguments)}function RI(){return(RI=ni(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return ole(n,e);if(Fg(n)&&(n=yield AV(n)),f0(n)){const r=n;return yield bae(r),e.binary?yield r.arrayBuffer():yield r.text()}if(SV(n)&&(n=sle(n,t)),oae(n)||aae(n))return Xae(n);throw new Error(II)})).apply(this,arguments)}function cle(n,e,t=null){if(t)return t;const i=ht({fetch:IV(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function ule(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const $V=()=>{const n=gI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function WV(n){const e=$V();n=Array.isArray(n)?n:[n];for(const t of n){const i=sI(t);e.find(r=>i===r)||e.unshift(i)}}const hle=/\.([^.]+)$/;function fle(n){return PI.apply(this,arguments)}function PI(){return(PI=ni(function*(n,e=[],t,i){if(!KV(n))return null;let r=qV(n,e,Un(ht({},t),{nothrow:!0}),i);if(r)return r;if(Fg(n)&&(r=qV(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(YV(n));return r})).apply(this,arguments)}function qV(n,e=[],t,i){if(!KV(n))return null;if(e&&!Array.isArray(e))return sI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...$V()),function(n){for(const e of n)sI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=ZE(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=FI(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&hle.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||FI(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(vle(e,t))return t}else if(ArrayBuffer.isView(e)){if(XV(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&XV(e,0,t))return t;return null}(e,n),a=a||FI(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(YV(n));return s}function KV(n){return!(n instanceof Response&&204===n.status)}function YV(n){const{url:e,type:t}=ZE(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?LI(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?LI(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function FI(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function vle(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function XV(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Gc=new Uint8ClampedArray(0);const Ile={data:{type:"data",value:Mle,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=Un(ht({},r),{fetch:Un(ht({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:eS(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):eS(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mi.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let VI=(()=>{class n extends rae{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=gV(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=QD(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=ht({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Mi.DEFAULT&&(t=i.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=Xj(t,i,r),f=gV(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mi.DEFAULT||t===Mi.LNGLAT||t===Mi.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){ic(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=Vse(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!Dle({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Gc.length/3);if(this.internalState.usesPickingColorCache=!0,rQV&&Oi.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Gc=Yy.allocate(Gc,i,{size:3,copy:!0,maxCount:Math.max(i,QV)});const s=Math.floor(Gc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&bo("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=zj({newProps:n,oldProps:e,propTypes:WD(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&Hj(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&Hj(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Nse(n,e),transitionsChanged:Ise(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=WD(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new wse(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){ic(!this.internalState&&!this.state),ic(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new sae({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Oi.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new Ase(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){bo("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=Ile,n})(),Ole=(()=>{class n extends VI{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:A,fetch:W,_subLayerProps:G}=this.props,ge={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:A,fetch:W},Ne=G&&G[t.id],Ge=Ne&&Ne.updateTriggers,$e=t.id||"sublayer";if(Ne){const at=this.constructor._propTypes,St=t.type?t.type._propTypes:{};for(const Rt in Ne){const Pt=St[Rt]||at[Rt];Pt&&"accessor"===Pt.type&&(Ne[Rt]=this.getSubLayerAccessor(Ne[Rt]))}}Object.assign(ge,t,Ne),ge.id="".concat(this.props.id,"-").concat($e),ge.updateTriggers=ht(ht({all:this.props.updateTriggers.all},t.updateTriggers),Ge);for(const at of A){const St=at.getSubLayerProps.call(this,at);St&&Object.assign(ge,St,{updateTriggers:Object.assign(ge.updateTriggers,St.updateTriggers)})}return ge}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=xD(t,Boolean),this.internalState.subLayers=t),bo("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Nle=/([0-9]+\.?[0-9]*)(%|px)/;function tS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Nle);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function nS(n,e){return n.relative?Math.round(n.position*e):n.position}function m0(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&m0(i,r)))return!1}return!0}class UI{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=Pg}=e;ic(!p||p instanceof Pg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Un(ht({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):m0(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=ht({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:nS(this._x,e),y:nS(this._y,t),width:nS(this._width,e),height:nS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ht(ht({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ht(ht(ht({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=tS(e),this._y=tS(t),this._width=tS(i),this._height=tS(r)}}const _0=()=>{},ZV={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:_0,onTransitionInterrupt:_0,onTransitionEnd:_0};class Ple{constructor(e,t={}){this.ControllerState=e,this.props=ht(ht({},ZV),t),this.propsInTransition=null,this.transition=new o0(t.timeline),this.onViewStateChange=t.onViewStateChange||_0,this.onStateChange=t.onStateChange||_0,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=ht(ht({},ZV),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ht(ht({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(ht(ht({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const JV=["longitude","latitude","zoom","bearing","pitch"],Lle=["longitude","latitude","zoom"];class eU extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!Xy(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];ic(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:JV,extract:JV,required:Lle}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=CE(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ht(ht({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,CE(e.around,t.around,i)))}return r}}const Qd={transitionDuration:0},kle={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},rS=n=>1-(1-n)*(1-n),Lg_WHEEL=["wheel"],Lg_PAN=["panstart","panmove","panend"],Lg_PINCH=["pinchstart","pinchmove","pinchend"],Lg_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Lg_DOUBLE_TAP=["doubletap"],Lg_KEYBOARD=["keydown"];class zI{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new Ple(e,Un(ht({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Un(ht({},kle),{transitionInterpolator:new eU({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Lg_WHEEL,d&&i),this.toggleEvents(Lg_PAN,d&&(r||s)),this.toggleEvents(Lg_PINCH,d&&(a||l)),this.toggleEvents(Lg_TRIPLE_PAN,d&&l),this.toggleEvents(Lg_DOUBLE_TAP,d&&o),this.toggleEvents(Lg_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=ht(ht({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,Qd,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,Un(ht({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,Qd,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,Qd,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,Qd,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,Un(ht({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?Un(ht({},t),{transitionInterpolator:new eU(Un(ht({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:Qd}}class tU{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const Zd_target=[0,0,0];class sS extends tU{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=Zd_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:A,startZoom:W}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:A,startZoom:W},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(Un(ht({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ht({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),gf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new sS(ht(ht(ht({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=gf(r,i,t),e.rotationX=gf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class jle extends zI{constructor(e){super(sS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Vle extends zI{constructor(e){e.dragMode=e.dragMode||"pan",super(sS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Ule=(new $n).lookAt({eye:[0,0,1]});function zle({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new $n).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Hle extends Pg{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(Un(ht({},e),{longitude:null,position:a,viewMatrix:Ule.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:zle({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Ig([],e,qD([],_f(t,this.pixelUnprojectionMatrix)));return{target:Ig([],this.center,r)}}}let Gle=(()=>{class n extends UI{constructor(t){super(Un(ht({},t),{type:Hle}))}get controller(){return this._getControllerProps({type:Vle})}}return n.displayName="OrthographicView",n})();const oS=Math.PI/180;function $le({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*oS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new $n).lookAt({eye:l,up:a});c.rotateX(i*oS),"Z"===t?c.rotateZ(r*oS):c.rotateY(r*oS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class Wle extends Pg{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(Un(ht({},e),{longitude:null,viewMatrix:$le({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=_f([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let qle=(()=>{class n extends UI{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Un(ht({},t),{orbitAxis:i,type:Wle}))}get controller(){return this._getControllerProps({type:jle})}}return n.displayName="OrbitView",n})();const Kle=[255,255,255],Yle=1;let Xle=0;class nU{constructor(e={}){const{color:t=Kle}=e,{intensity:i=Yle}=e;this.id=e.id||"ambient-".concat(Xle++),this.color=t,this.intensity=i,this.type="ambient"}}const Qle=[255,255,255],Zle=1,Jle=[0,0,-1];let ece=0;class iU{constructor(e={}){const{color:t=Qle}=e,{intensity:i=Zle}=e,{direction:r=Jle}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(ece++),this.color=t,this.intensity=i,this.type="directional",this.direction=new vo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class rU{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ht({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class HI extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ht({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Ou(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Ou(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=sU(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dgD(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Ou(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||sU(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class rce extends HI{constructor(e,t){super(e,t),this.shadowMap=new Oa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new Sg(e,{format:33189,width:1,height:1}),this.fbo=new Is(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;nc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=vg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Un(ht({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const oce=Object.keys(Mi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Mi[n],";")).join(""),ace=Object.keys(kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(kc[n],";")).join(""),lce="".concat(oce,"\n").concat(ace,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),cce={},GI={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:lce,getUniforms:function(n=cce){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Mi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mi.DEFAULT&&(i=n.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN);const o=moe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||foe,o}(n):{}}},fce=UE(function({viewport:n,center:e}){return new $n(n.viewProjectionMatrix).invert().transform(e)}),pce=UE(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=_f([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new vo(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new $n).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),gce=[0,0,0,1],mce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],$I={name:"shadow",dependencies:[GI],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||gce,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=fce({viewport:n.viewport,center:e.project_uCenter}),r=[],s=pce({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},wce={color:[255,255,255],intensity:1},oU=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],Ece=[0,0,0,200/255];class WI extends rU{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=Ece,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=r0.getDefaultProgramManager(e),$I&&this.programManager.addDefaultModule($I)),this.dummyShadowMap||(this.dummyShadowMap=new Oa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule($I),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new $n).lookAt({eye:new vo(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=xce++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class Cce{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=eS(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class Ace{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new Cce(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const Tce=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},GI],Mce=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function Dce(n){const e=r0.getDefaultProgramManager(n);for(const t of Tce)e.addDefaultModule(t);for(const t of Mce)e.addShaderHook(t);return e}const Oce=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Nce{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ace({gl:e,protocol:"deck://"}),this.context=Un(ht({},Oce),{layerManager:this,gl:e,deck:t,programManager:e&&Dce(e),stats:i||new lD({id:"deck.gl"}),viewport:r||new Pg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new aU,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){bo("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=xD(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return bo("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Oi.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Oi.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class Pce{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=xD(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!m0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Oi.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(ht({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=Un(ht(ht(ht({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class Lce extends tU{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:x,startRotatePos:A,startBearing:W,startPitch:G,startZoom:ge,normalize:Ne}={}){ic(Number.isFinite(s)),ic(Number.isFinite(r)),ic(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:Ne}),this._state={startPanLngLat:_,startZoomLngLat:x,startRotatePos:A,startBearing:W,startPitch:G,startZoom:ge},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(Un(ht({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(Un(ht({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ht({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(ht(ht(ht({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=gf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=gf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=Jj(t+180,360)-180),(o<-180||o>180)&&(o=Jj(o+180,360)-180);const a=KD(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Yd([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return gf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=gf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class kce extends zI{constructor(e){e.dragMode=e.dragMode||"pan",super(Lce,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Bce=(()=>{class n extends UI{constructor(t){super(Un(ht({},t),{type:pV}))}get controller(){return this._getControllerProps({type:kce})}}return n.displayName="MapView",n})();const jce=new WI;class Vce{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!m0(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof WI)||this._internalEffects.push(jce)}}class Uce extends HI{}const cU={blendFunc:[1,0,32771,0],blendEquation:32774};class uU extends HI{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,nc(_,Un(ht({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},cU),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Un(ht({},cU),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ht(ht({},e.props.parameters),i)}}class Hce{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Uce(e),this.pickLayersPass=new uU(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Is.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Un(ht({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,bo("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new Is(this.gl),new Is(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const Gce={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function $ce({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let A=0;A=0){const G=A+o-t,ge=G*G+x;ge<=d&&(d=ge,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),x=e[g];if(x){const A=x.decodePickingColor(_),W=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:x,pickedObjectIndex:A,pickedX:o+(f/4-W*l),pickedY:a+W}}Oi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Gce}function dU({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function qce(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(x=>x.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=dU(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=ht({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=hU({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function hU({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Yce{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new uU(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?ht(ht({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Is(e),Is.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Is(e),this.depthFBO.attach({36064:new Oa(e,{format:pi(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Oi.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:dU({viewports:i,x:r,y:s})};this._resizeBuffer();const f=vg(this.gl),p=sD(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:x,height:A}=this.pickingFBO,W=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:x,deviceHeight:A});let G;const ge=[],Ne={};for(let Ge=0;Ge=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Oi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:W,width:x.x+x.width-g,height:_-W},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Ge=new Map,$e=Number.isFinite(c);for(let at=0;at=c);at++){const St=Ne[at];let Rt={color:St.pickedColor,layer:null,index:St.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};Rt=hU({layer:St.pickedLayer,info:Rt,mode:l}),Ge.has(Rt.object)||Ge.set(Rt.object,Rt)}return Array.from(Ge.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return xE(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Xce={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Qce{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Xce),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function fU(n,e){if(!n)throw new Error(e)}const $c={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pU=$c.global||$c.self||$c.window,Jce="object"!=typeof process||"[object process]"!==String(process)||process.browser,gU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:eue}=(gU&&parseFloat(gU[1]),pU),qI="undefined"!=typeof Image,KI="undefined"!=typeof ImageBitmap,tue=Boolean(eue),YI=!!Jce||tue;function mU(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function _U(n){switch(mU(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const rue=/^data:image\/svg\+xml/,sue=/\.svg((\?|#).*)?$/;function XI(n){return n&&(rue.test(n)||sue.test(n))}function oue(n,e){if(XI(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return vU(n,e)}function vU(n,e){if(XI(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function bU(n,e,t){return QI.apply(this,arguments)}function QI(){return(QI=ni(function*(n,e,t){const i=oue(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield aue(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function aue(n,e){return ZI.apply(this,arguments)}function ZI(){return(ZI=ni(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const lue={};let wU=!0;function cue(n,e,t){return JI.apply(this,arguments)}function JI(){return(JI=ni(function*(n,e,t){let i;i=XI(t)?yield bU(n,e,t):vU(n,t);const r=e&&e.imagebitmap;return yield uue(i,r)})).apply(this,arguments)}function uue(n){return eR.apply(this,arguments)}function eR(){return(eR=ni(function*(n,e=null){if((due(e)||!wU)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),wU=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function due(n){for(const e in n||lue)return!1;return!0}const Wc=!1,y0=!0;function tR(n){const e=v0(n);return function(n){const e=v0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Wc)?{mimeType:"image/png",width:e.getUint32(16,Wc),height:e.getUint32(20,Wc)}:null}(e)||function(n){const e=v0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Wc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Wc)?{mimeType:"image/gif",width:e.getUint16(6,y0),height:e.getUint16(8,y0)}:null}(e)||function(n){const e=v0(n);return e.byteLength>=14&&16973===e.getUint16(0,Wc)&&e.getUint32(2,y0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,y0),height:e.getUint32(22,y0)}:null}(e)}function v0(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function _ue(n,e){const{mimeType:t}=tR(n)||{},{_parseImageNode:i}=pU;return fU(i),i(n,t,e)}function nR(){return(nR=ni(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(vue(r)){case"imagebitmap":a=yield cue(n,e,s);break;case"image":a=yield bU(n,e,s);break;case"data":a=yield _ue(n,e);break;default:fU(!1)}return"data"===r&&(a=_U(a)),a})).apply(this,arguments)}function vue(n){switch(n){case"auto":case"data":return function(){if(KI)return"imagebitmap";if(qI)return"image";if(YI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return KI||qI||YI;case"imagebitmap":return KI;case"image":return qI;case"data":return YI;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const EU={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return nR.apply(this,arguments)},tests:[n=>Boolean(tR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},wue={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},b0="8.5.8",aS=Sr.CO.deck&&Sr.CO.deck.VERSION;if(aS&&aS!==b0)throw new Error("deck.gl - multiple versions detected: ".concat(aS," vs ").concat(b0));aS||(Oi.log(1,"deck.gl ".concat(b0))(),Sr.CO.deck=Object.assign(Sr.CO.deck||{},{VERSION:b0,version:b0,log:Oi,_registerLoggers:function(n){MD=n}}),WV([wue,[EU,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Eue=Sr.CO.deck;class lS extends Nu{static isSupported(e,t=[]){const i=pi(e),r=FB(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:tn(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return lS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const SU=(0,Sr.jU)()&&"undefined"!=typeof document;let Oue=0;class Nue{constructor(e={}){const{onCreateContext:t=(A=>mB(A)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=ff.get("animation-loop-"+Oue++)}=e;let{useDevicePixels:x=!0}=e;"useDevicePixelRatio"in e&&(un.deprecated("useDevicePixelRatio","useDevicePixels")(),x=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:x}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return tn("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=lS.isSupported(this.gl,["timers"])?new lS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return ni(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return un.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=SU?new Promise((e,t)=>{SU&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?aD(this.props.gl,e):this.onCreateContext(e),!EE(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Ou(n,rD)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(un.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(un.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Is(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var Pue=tt(524),cS=tt.n(Pue);const Fue={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(cS().MouseInput);const jue=cS().Manager,qc=cS(),Vue=qc?[[qc.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[qc.Rotate,{enable:!1}],[qc.Pinch,{enable:!1}],[qc.Swipe,{enable:!1}],[qc.Pan,{threshold:0,enable:!1}],[qc.Press,{enable:!1}],[qc.Tap,{event:"doubletap",taps:2,enable:!1}],[qc.Tap,{event:"anytap",enable:!1}],[qc.Tap,{enable:!1}]]:null,AU={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Uue={doubletap:["tap"]},zue={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},rR={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Hue={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},TU={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Gue="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",kg="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let MU=!1;try{const n={get passive(){return MU=!0,!0}};kg.addEventListener("test",n,n),kg.removeEventListener("test",n,n)}catch(n){}const $ue=-1!==Gue.indexOf("firefox"),{WHEEL_EVENTS:Wue}=rR,IU=4.000244140625;class Yue{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Wue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!MU&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;kg.WheelEvent&&($ue&&e.deltaMode===kg.WheelEvent.DOM_DELTA_PIXEL&&(t/=kg.devicePixelRatio),e.deltaMode===kg.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%IU==0&&(t=Math.floor(t/IU)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:Xue}=rR,RU="pointermove",OU="pointerover",NU="pointerout",PU="pointerleave";class Que{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Xue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===RU&&(this.enableMoveEvent=t),e===OU&&(this.enableOverEvent=t),e===NU&&(this.enableOutEvent=t),e===PU&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:OU,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:NU,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:PU,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:RU,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Zue}=rR,FU="keydown";class Jue{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Zue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===FU&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:FU,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const kU="contextmenu";class ede{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===kU&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:kU,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const tde={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},BU={srcElement:"root",priority:0};class fde{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},BU,i):BU;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&AU[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new Yue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Que(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Jue(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new ede(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=Uue[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=TU[e]||e;let c=a.get(l);c||(c=new fde(this),a.set(l,c),c.recognizerName=Hue[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(TU[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=zue[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function bf(){}const jU={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:bf,onResize:bf,onViewStateChange:bf,onInteractionStateChange:bf,onBeforeRender:bf,onAfterRender:bf,onLoad:bf,onError:(n,e)=>Oi.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class dS{constructor(e){e=ht(ht({},jU),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Oi.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Sr.qs)()&&Oi.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new lD({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Yy.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Oi.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Oi.removed("onLayerClick","onClick")(),e.initialViewState&&!m0(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](ht({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),ic(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new Nue({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>mB(Un(ht(ht({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new Bce({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,aD(e,{enable:!0,copyState:!0})),this.tooltip=new Qce(this.canvas),Ou(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new aU;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new gde(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in eB)this.eventManager.on(r,this._onEvent);this.viewManager=new Pce({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new Nce(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new Vce,this.deckRenderer=new Hce(e),this.deckPicker=new Yce(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Ou(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ht({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Oi.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=Un(ht({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=eB[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=ff.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}dS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(rU)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},dS.defaultProps=jU,dS.VERSION=Eue.VERSION;const VU={name:"project32",dependencies:[GI],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},UU="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",yde={lightSources:{}};function aR({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const lR={name:"lights",vs:UU,fs:UU,getUniforms:function zU(n=yde){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?aR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=aR(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=aR(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return zU({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},bde={};const Ede={name:"phong-lighting",dependencies:[lR],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=bde){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},xde={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},$U=ht({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=xde){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),WU={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class hS{static get DRAW_MODE(){return WU}constructor(e={}){const{id:t=jc("geometry"),drawMode:i=WU.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?ht({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,tn(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(tn(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return tn(Number.isFinite(i)),i}}const cR=Math.PI/180,fS=new Float32Array(16),qU=new Float32Array(12);function KU(n,e,t){const i=e[0]*cR,r=e[1]*cR,s=e[2]*cR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function YU(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const XU={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let x;g?(fS.set(a),x=YU(fS)):(x=qU,KU(x,r,s),x.set(o,9)),n.value=new Float32Array(x)}else{let x=e*n.size;const{iterable:A,objectInfo:W}=YB(i,e,t);for(const G of A){let ge;W.index++,g?(fS.set(c?a:a(G,W)),ge=YU(fS)):(ge=qU,KU(ge,f?r:r(G,W),d?s:s(G,W)),ge.set(p?o:o(G,W),9)),_[x++]=ge[0],_[x++]=ge[1],_[x++]=ge[2],_[x++]=ge[3],_[x++]=ge[4],_[x++]=ge[5],_[x++]=ge[6],_[x++]=ge[7],_[x++]=ge[8],_[x++]=ge[9],_[x++]=ge[10],_[x++]=ge[11]}}}};function QU(n,e){return e===Mi.CARTESIAN||e===Mi.METER_OFFSETS||e===Mi.DEFAULT&&!n.isGeospatial}function ZU(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Oi.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function Mde(n,e){if(n.attributes)return ZU(n.attributes,e),n instanceof hS?n:new hS(n);if(n.positions||n.POSITION)return ZU(n,e),new hS({attributes:n});throw Error("Invalid mesh")}const Dde={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let Ide=(()=>{class n extends VI{getShaders(){const t=!pi(this.context.gl),i={};return yD(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[VU,Ede,$U],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:XU}),this.setState({emptyTexture:new Oa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||QU(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new BE(this.context.gl,Un(ht({},this.getShaders()),{id:this.props.id,geometry:Mde(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=Dde,n})();const JU={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[lR]};class Bg{constructor(e={}){const{id:t}=e;this.id=t||jc(this.constructor.name),this.display=!0,this.position=new vo,this.rotation=new vo,this.scale=new vo(1,1,1),this.matrix=new $n,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return tn(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return tn(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return tn(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){tn(e),t=t||this.matrix;const i=new $n(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class w0 extends Bg{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;un.assert(t.every(i=>i instanceof Bg),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new $n}={}){const i=new $n(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof w0?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function ez(){var n=new oa(4);return oa!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function tz(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function nz(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var rz=Kj,$de=function(){var n=jB(),e=VB(1,0,0),t=VB(0,1,0);return function(i,r,s){var o=UB(r,s);return o<-.999999?(TE(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&TE(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),tz(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(TE(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();ez(),ez(),function(){var n=new oa(9);oa!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const Wde=[0,0,0,1],Kde={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Yde={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function az(n){if(!n._animation){const e=Yde[n.componentType],t=Kde[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return tz(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=to(e)}get y(){return this[1]}set y(e){this[1]=to(e)}get z(){return this[2]}set z(e){this[2]=to(e)}get w(){return this[3]}set w(e){this[3]=to(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return $de(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Fu(!t),nz(this,this,e),this.check()}multiplyLeft(e,t){return Fu(!t),nz(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return rz(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Wde,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,x,A,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>gr?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-i)*p)/_,A=Math.sin(i*p)/_):(x=1-i,A=i),n[0]=x*r+A*l,n[1]=x*s+A*c,n[2]=x*o+A*d,n[3]=x*a+A*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),AE(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class nhe{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:un.warn(`Bad animation path ${s}`)()}tn(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){uR.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:az(e.accessors[a]),interpolation:l,output:az(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new nhe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class rhe extends Bg{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof BE?(this.model=e,this._setModelNodeProps(t)):this.model=new BE(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class she{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},yD(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new Oa(this.gl,ht({id:e.name||e.id,parameters:ht(ht({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(un.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function lz(n,e){return pi(n)?`#version 300 es\n${e}`:e}const che={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},uhe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class dhe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},uhe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new ihe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new w0({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new w0({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new $n).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new w0({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){un.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new she(n,e);un.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new rhe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[JU],defines:a.defines,parameters:a.parameters,vs:lz(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:lz(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),un.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new rr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new sa({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:che[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function cz(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new jg(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new jg(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof jg){const o=e;t=o.fields,i=fz(fz(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new jg(s,i)}}function fz(n,e){return new Map([...n||new Map,...e||new Map])}let Rr,pz,gz,mz,_z,yz,vz,bz;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(Rr||(Rr={}));class dR{static isNull(e){return e&&e.typeId===Rr.Null}static isInt(e){return e&&e.typeId===Rr.Int}static isFloat(e){return e&&e.typeId===Rr.Float}static isBinary(e){return e&&e.typeId===Rr.Binary}static isUtf8(e){return e&&e.typeId===Rr.Utf8}static isBool(e){return e&&e.typeId===Rr.Bool}static isDecimal(e){return e&&e.typeId===Rr.Decimal}static isDate(e){return e&&e.typeId===Rr.Date}static isTime(e){return e&&e.typeId===Rr.Time}static isTimestamp(e){return e&&e.typeId===Rr.Timestamp}static isInterval(e){return e&&e.typeId===Rr.Interval}static isList(e){return e&&e.typeId===Rr.List}static isStruct(e){return e&&e.typeId===Rr.Struct}static isUnion(e){return e&&e.typeId===Rr.Union}static isFixedSizeBinary(e){return e&&e.typeId===Rr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Rr.FixedSizeList}static isMap(e){return e&&e.typeId===Rr.Map}static isDictionary(e){return e&&e.typeId===Rr.Dictionary}get typeId(){return Rr.NONE}compareTo(e){return this===e}}Symbol,Symbol,pz=Symbol.toStringTag;class Vg extends dR{constructor(e,t){super(),Wn(this,"isSigned",void 0),Wn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Rr.Int}get[pz](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class whe extends Vg{constructor(){super(!0,8)}}class Ehe extends Vg{constructor(){super(!0,16)}}class She extends Vg{constructor(){super(!0,32)}}class xhe extends Vg{constructor(){super(!1,8)}}class Che extends Vg{constructor(){super(!1,16)}}class Ahe extends Vg{constructor(){super(!1,32)}}gz=Symbol.toStringTag;class wz extends dR{constructor(e){super(),Wn(this,"precision",void 0),this.precision=e}get typeId(){return Rr.Float}get[gz](){return"Float"}toString(){return`Float${this.precision}`}}class The extends wz{constructor(){super(32)}}class Mhe extends wz{constructor(){super(64)}}Symbol,Symbol,mz=Symbol.toStringTag,_z=Symbol.toStringTag,yz=Symbol.toStringTag,vz=Symbol.toStringTag,bz=Symbol.toStringTag;class Dhe extends dR{constructor(e,t){super(),Wn(this,"listSize",void 0),Wn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Rr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[bz](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class gS{constructor(e,t,i=!1,r=new Map){Wn(this,"name",void 0),Wn(this,"type",void 0),Wn(this,"nullable",void 0),Wn(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new gS(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function Ez(n,e,t){const i=t?Sz(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new whe;case Uint8Array:return new xhe;case Int16Array:return new Ehe;case Uint16Array:return new Che;case Int32Array:return new She;case Uint32Array:return new Ahe;case Float32Array:return new The;case Float64Array:return new Mhe;default:throw new Error("array type not supported")}}(e.value);return new gS(n,new Dhe(e.size,new gS("value",r)),!1,i)}function Sz(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const xz={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Nhe={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class Fhe{constructor(e){Wn(this,"draco",void 0),Wn(this,"decoder",void 0),Wn(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=Sz(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=Ez(o,n[o],s[o]);r.push(l)}if(t){const o=Ez("indices",t);r.push(o)}return new jg(r,i)}(l.attributes,a,l.indices);return Un(ht({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var mS=tt(125);const gR={};function mR(n){return _R.apply(this,arguments)}function _R(){return(_R=ni(function*(n,e=null,t={}){return e&&(n=Vhe(n,e,t)),gR[n]=gR[n]||Uhe(n),yield gR[n]})).apply(this,arguments)}function Vhe(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_I?t.CDN?(zc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yI?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Uhe(n){return yR.apply(this,arguments)}function yR(){return(yR=ni(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_I?yI?importScripts(n):zhe(yield(yield fetch(n)).text(),n):mS.requireFromFile&&(yield mS.requireFromFile(n))})).apply(this,arguments)}function zhe(n,e){if(!_I)return mS.requireFromString&&mS.requireFromString(n,e);if(yI)return eval.call(Nae,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Hhe="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Ghe="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",$he="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let E0;function qhe(n){return vR.apply(this,arguments)}function vR(){return(vR=ni(function*(n){const e=n.modules||{};return E0=e.draco3d?E0||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):E0||Khe(n),yield E0})).apply(this,arguments)}function Khe(n){return wR.apply(this,arguments)}function wR(){return(wR=ni(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield mR(Hhe,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield mR(Ghe,"draco",n),yield mR($he,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Yhe(e,t)})).apply(this,arguments)}function Yhe(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Un(ht({},t),{onModuleLoaded:r=>i({draco:r})}))})}const SR=Un(ht({},hz),{parse:function(n,e){return xR.apply(this,arguments)}});function xR(){return(xR=ni(function*(n,e){const{draco:t}=yield qhe(e),i=new Fhe(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function x0(n,e){return yf(n>=0),yf(e>0),n+(e-1)&~(e-1)}function Zhe(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+x0(i.byteLength,4)}const Cz=["SCALAR","VEC2","VEC3","VEC4"],Jhe=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],efe=new Map(Jhe),tfe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nfe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ife={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Az(n){return Cz[n-1]||Cz[0]}function Tz(n){const e=efe.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function Mz(n,e){const t=ife[n.componentType],i=tfe[n.type],s=n.count*i,o=n.count*i*nfe[n.componentType];return La(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const rfe={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class eh{constructor(e){Wn(this,"gltf",void 0),Wn(this,"sourceBuffers",void 0),Wn(this,"byteLength",void 0),this.gltf=e||{json:ht({},rfe),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return La(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=Mz(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return La(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return La(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=tR(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;La(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=x0(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:Az(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:Tz(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Zhe(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*gfe(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function mfe(n){return TR.apply(this,arguments)}function TR(){return(TR=ni(function*(n){const e=new eh(n),{json:t}=e;e.removeExtension(yS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,yS)})).apply(this,arguments)}function _fe(n){const e=new eh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,yS,{}),e.addExtension(yS))}function yfe(n){return MR.apply(this,arguments)}function MR(){return(MR=ni(function*(n){const e=new eh(n),{json:t}=e,i=e.getExtension(Ug);i&&(e.json.lights=i.lights,e.removeExtension(Ug));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Ug);s&&(r.light=s.light),e.removeObjectExtension(r,Ug)}})).apply(this,arguments)}function vfe(n){return DR.apply(this,arguments)}function DR(){return(DR=ni(function*(n){const e=new eh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Ug);La(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Ug,i);delete e.json.lights}})).apply(this,arguments)}function bfe(n){return IR.apply(this,arguments)}function IR(){return(IR=ni(function*(n){const e=new eh(n),{json:t}=e,i=e.getExtension(vS);if(i){const r=Efe(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,vS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=Sfe(s.technique,e)),e.removeObjectExtension(s,vS)}e.removeExtension(vS)}})).apply(this,arguments)}function wfe(n,e){return RR.apply(this,arguments)}function RR(){return(RR=ni(function*(n,e){})).apply(this,arguments)}function Efe(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function Sfe(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const Rz={KHR_draco_mesh_compression:gt,KHR_materials_unlit:J,KHR_lights_punctual:At,KHR_techniques_webgl:dt};function xfe(n){return OR.apply(this,arguments)}function OR(){return(OR=ni(function*(n,e={},t){for(const r in Rz){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield Rz[r].decode(n,e,t))}})).apply(this,arguments)}const Oz={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Afe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Tfe{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new eh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,Dz);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(Dz)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in Oz)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in Oz)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=Afe[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function Mfe(n,e={}){return(new Tfe).normalize(n,e)}const Dfe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ife={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},vl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Rfe={magFilter:vl.TEXTURE_MAG_FILTER,minFilter:vl.TEXTURE_MIN_FILTER,wrapS:vl.TEXTURE_WRAP_S,wrapT:vl.TEXTURE_WRAP_T},Ofe={[vl.TEXTURE_MAG_FILTER]:vl.LINEAR,[vl.TEXTURE_MIN_FILTER]:vl.NEAREST_MIPMAP_LINEAR,[vl.TEXTURE_WRAP_S]:vl.REPEAT,[vl.TEXTURE_WRAP_]:vl.REPEAT};class Ffe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return La(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=ht({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=ht({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ht({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ht({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=ht({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ht({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ht({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return Ife[n]}(e.componentType),e.components=function(n){return Dfe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=Mz(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):Ofe,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return Rfe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function Lfe(n,e){return(new Ffe).postProcess(n,e)}const Nz=1735152710,zg=!0;function PR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),x0(i,4)}function FR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),x0(i,4)}function Kfe(n,e){return LR.apply(this,arguments)}function LR(){return(LR=ni(function*(n,e,t=0,i,r){var s,o,a,l;Yfe(n,e,t,i),Mfe(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Xfe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Qfe(n,i,r);c.push(f)}const d=xfe(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?Lfe(n,i):n})).apply(this,arguments)}function Yfe(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=Nz}=t,s=i.getUint32(e,!1);return s===r||s===Nz}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?cz(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?cz(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,zg),a=r.getUint32(t+8,zg);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){yf(n.header.byteLength>20);const i=e.getUint32(t+0,zg),r=e.getUint32(t+4,zg);return t+=8,yf(0===r),PR(n,e,t,i),(t+=i)+FR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return yf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,zg),s=e.getUint32(t+4,zg);switch(t+=8,s){case 1313821514:PR(n,e,t,r);break;case 5130562:FR(n,e,t,r);break;case 0:i.strict||PR(n,e,t,r);break;case 1:i.strict||FR(n,e,t,r)}t+=x0(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),La("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else La(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Xfe(n,e,t){return kR.apply(this,arguments)}function kR(){return(kR=ni(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield tpe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function tpe(n){return zR.apply(this,arguments)}function zR(){return(zR=ni(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const Pz=[255,255,255,255],rpe={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:Pz},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Hg]};let spe=(()=>{class n extends VI{getShaders(){const t=[VU,$U];return"pbr"===this.props._lighting&&t.push(JU),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:Pz,transition:!0},instanceModelMatrix:XU})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Bg)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new dhe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ht({gltf:l},c),function(n){return UR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Oi.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Bg?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Oi.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Oi.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Bg&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:ht({isInstanced:!0,transpileToGLSL100:!pi(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:QU(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=rpe,n})();const ope=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),ape=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),lpe=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),cpe=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),upe={POSITION:{size:3,value:new Float32Array(ape)},NORMAL:{size:3,value:new Float32Array(lpe)},TEXCOORD_0:{size:2,value:new Float32Array(cpe)}};class dpe extends hS{constructor(e={}){const{id:t=jc("cube-geometry")}=e;super(Un(ht({},e),{id:t,indices:{size:1,value:new Uint16Array(ope)},attributes:ht(ht({},upe),e.attributes)}))}}class Kc{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new le){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new le){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new le){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new le){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new le){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new le){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new le){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=fpe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=ppe;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(Fz),Fz.almostEquals(e,t)}clone(){return new le(this.x,this.y,this.z)}}le.ZERO=void 0,le.UNIT_X=void 0,le.UNIT_Y=void 0,le.UNIT_Z=void 0,le.ZERO=new le(0,0,0),le.UNIT_X=new le(1,0,0),le.UNIT_Y=new le(0,1,0),le.UNIT_Z=new le(0,0,1);const fpe=new le,ppe=new le,Fz=new le;class ar{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new le,this.upperBound=new le,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=kz;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=kz;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const Lz=new le,kz=[new le,new le,new le,new le,new le,new le,new le,new le];class ss{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new le){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=mpe;e.tangents(i,_pe),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(_r(e.length(),2)*_r(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new ss){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new ss){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new ss){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new le){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new ss(this.x,this.y,this.z,this.w)}slerp(e,t,i=new ss){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,x,A,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-t)*p)/_,A=Math.sin(t*p)/_):(x=1-t,A=t),i.x=x*r+A*l,i.y=x*s+A*c,i.z=x*o+A*d,i.w=x*a+A*f,i}integrate(e,t,i,r=new ss){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const mpe=new le,_pe=new le,ype={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let dn=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=ype,n})();class Ni{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new ss,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Ni.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Ni.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new le){return i.vsub(e,r),t.conjugate(jz),jz.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new le){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new le){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new le){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const jz=new ss;class wf extends dn{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:dn.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new le;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=x,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,d=new le,f=new le,p=new le,g=new le,_=new le;let x=Number.MAX_VALUE;const A=this;if(A.uniqueAxes)for(let W=0;W!==A.uniqueAxes.length;W++){i.vmult(A.uniqueAxes[W],c);const G=A.testSepAxis(c,e,t,i,r,s);if(!1===G)return!1;G0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){wf.project(this,e,i,r,HR),wf.project(t,e,s,o,GR);const l=HR[0],c=HR[1],d=GR[0],f=GR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?hn.STATIC:hn.DYNAMIC,typeof e.type==typeof hn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=hn.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new le,this.quaternion=new ss,this.initQuaternion=new ss,this.previousQuaternion=new ss,this.interpolatedQuaternion=new ss,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new le,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new le,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new le,this.invInertia=new le,this.invInertiaWorld=new Kc,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new Kc,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new le(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new le(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new ar,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new le,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=hn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===hn.SLEEPING&&this.dispatchEvent(hn.wakeupEvent)}sleep(){this.sleepState=hn.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=_r(this.sleepSpeedLimit,2);t===hn.AWAKE&&ir?this.wakeUp():t===hn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(hn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===hn.SLEEPING||this.type===hn.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new le){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new le){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new le,s=new ss;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=wpe,o=Epe,a=this.quaternion,l=this.aabb,c=Spe;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=xpe,r=Cpe;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==hn.DYNAMIC)return;this.sleepState===hn.SLEEPING&&this.wakeUp();const i=Ape;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==hn.DYNAMIC)return;const i=Tpe,r=Mpe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===hn.DYNAMIC&&(this.sleepState===hn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==hn.DYNAMIC)return;this.sleepState===hn.SLEEPING&&this.wakeUp();const i=t,r=Dpe;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=Ipe;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==hn.DYNAMIC)return;const i=Rpe,r=Ope;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=Npe;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),wS.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new le;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==hn.DYNAMIC&&this.type!==hn.KINEMATIC||this.sleepState===hn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,x=this.angularFactor,A=l.x*x.x,W=l.y*x.y,G=l.z*x.z;s.x+=e*(_[0]*A+_[1]*W+_[2]*G),s.y+=e*(_[3]*A+_[4]*W+_[5]*G),s.z+=e*(_[6]*A+_[7]*W+_[8]*G),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}hn.idCounter=0,hn.COLLIDE_EVENT_NAME="collide",hn.DYNAMIC=1,hn.STATIC=2,hn.KINEMATIC=4,hn.AWAKE=0,hn.SLEEPY=1,hn.SLEEPING=2,hn.wakeupEvent={type:"wakeup"},hn.sleepyEvent={type:"sleepy"},hn.sleepEvent={type:"sleep"};const wpe=new le,Epe=new ss,Spe=new ar,xpe=new Kc,Cpe=new Kc,Ape=new le,Tpe=new le,Mpe=new le,Dpe=new le,Ipe=new le,Rpe=new le,Ope=new le,Npe=new le;new le,new le;class ES{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new le,this.rayToWorld=new le,this.hitNormalWorld=new le,this.hitPointWorld=new le,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let Vz,Uz,zz,Hz,Gz,$z,Wz;Vz=dn.types.SPHERE,Uz=dn.types.PLANE,zz=dn.types.BOX,Hz=dn.types.CYLINDER,Gz=dn.types.CONVEXPOLYHEDRON,$z=dn.types.HEIGHTFIELD,Wz=dn.types.TRIMESH;class fs{get[Vz](){return this._intersectSphere}get[Uz](){return this._intersectPlane}get[zz](){return this._intersectBox}get[Hz](){return this._intersectConvex}get[Gz](){return this._intersectConvex}get[$z](){return this._intersectHeightfield}get[Wz](){return this._intersectTrimesh}constructor(e=new le,t=new le){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new le,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=fs.ANY,this.result=new ES,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||fs.ANY,this.result=t.result||new ES,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(qz),KR.length=0,e.broadphase.aabbQuery(e,qz,KR),this.intersectBodies(KR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=Vpe,s=Upe;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new le(0,0,1);t.vmult(c,c);const d=new le;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;A>=0&&A<=1&&(o.lerp(a,A,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Wpe,l=Yz,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,A=_.distanceTo(this.to),W=c?c.length:d.length,G=this.result;for(let ge=0;!G.shouldStop&&geA||this.reportIntersection(a,aa,s,r,Ne)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=qpe,l=Jpe,c=ege,d=Yz,f=Kpe,p=Ype,g=Xpe,_=Zpe,x=Qpe,A=e.indices,W=this.from,G=this.to,ge=this.direction;c.position.copy(i),c.quaternion.copy(t),Ni.vectorToLocalFrame(i,t,ge,f),Ni.pointToLocalFrame(i,t,W,p),Ni.pointToLocalFrame(i,t,G,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const Ne=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Ge=0,$e=l.length;!this.result.shouldStop&&Ge!==$e;Ge++){const at=l[Ge];e.getNormal(at,a),e.getVertex(A[3*at],ac),ac.vsub(p,d);const St=f.dot(a),Rt=a.dot(d)/St;if(Rt<0)continue;f.scale(Rt,aa),aa.vadd(p,aa),e.getVertex(A[3*at+1],Xc),e.getVertex(A[3*at+2],Qc);const Pt=aa.distanceSquared(p);!fs.pointInTriangle(aa,Xc,ac,Qc)&&!fs.pointInTriangle(aa,ac,Xc,Qc)||Pt>Ne||(Ni.vectorToWorldFrame(t,a,x),Ni.pointToWorldFrame(i,t,aa,_),this.reportIntersection(x,_,s,r,at))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case fs.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case fs.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var Af=tt(517);class Or extends ee{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new U;return this._value}next(e){super.next(this._value=e)}}function qg(n,e,t){e||(e=new $n($n.IDENTITY));const i=new $n($n.IDENTITY);if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new $n($n.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new $n(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===qg(s,r,t))return!1;return!0}function V4(){WV([hz,Hg])}function U4(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||qg(r,new $n($n.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function ZR(n,e){return ir(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield JE(i,Hg,{DracoLoader:SR,gltf:{decompressMeshes:!0,postProcess:!0}});return U4(n.scenegraphNode,r)})}function tye(n,e){return ir(this,void 0,void 0,function*(){return U4(n,yield e)})}function JR(n,e,t){if(e&&0!==e.length)return new Ide(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mi.CARTESIAN,data:e,mesh:new dpe,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let iye=(()=>{class n extends Ole{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),V4()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){ir(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new $n(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new ar({lowerBound:new le(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new le(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield eS(o.scenegraph,Hg,{DracoLoader:SR,decompress:!0,postProcess:!0});for(const l of a.scenes)qg(l,new $n(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new ar({lowerBound:new le(...p.map((_,x)=>Math.min(_,g[x]))),upperBound:new le(...g.map((_,x)=>Math.max(_,p[x])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=ZR({scenegraph:l.scenegraph},n.gltfCache));return[JR("cubes",i,{wireframe:!1,pickable:!1}),JR("pickableCubes",r,{wireframe:!1,pickable:!0}),JR("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new spe({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Mi.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?tye(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function z4(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),z4(t,e);return e}let sye=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new iye({}),this.nodeClickSubject=new ee,this.nodeHoverStartSubject=new ee,this.nodeHoverStopSubject=new ee,this.sceneRotationSubject=new Or([0,0]),this.nodeDragStartSubject=new ee,this.nodeDragSubject=new ee,this.nodeDragEndSubject=new ee,this.nodeClick$=this.nodeClickSubject.pipe(ms()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ms()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ms()),this.sceneRotation$=this.sceneRotationSubject.pipe(ms()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ms()),this.nodeDrag$=this.nodeDragSubject.pipe(ms()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ms());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Gle({flipY:!1,near:-1e3}):new qle({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new WI({ambientLight:new nU({color:[255,255,255],intensity:10})})]),this.deck=new dS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return ir(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new $n([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return ir(this,void 0,void 0,function*(){V4();const i=yield ZR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)qg(o,e=new $n(e||$n.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new $n(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new $n(e||$n.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new ar({lowerBound:new le(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new le(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of z4(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new $n($n.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new $n(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return Ia([Af.ZP],n.prototype,"_onHover",null),Ia([Af.ZP],n.prototype,"_onClick",null),Ia([Af.ZP],n.prototype,"_onViewStateChange",null),Ia([Af.ZP],n.prototype,"_onDragStart",null),Ia([Af.ZP],n.prototype,"_onDrag",null),Ia([Af.ZP],n.prototype,"_onDragEnd",null),n})();function oye(n,e){return n===e}function aye(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let eO=(()=>{class n{constructor(){this.bootstrap$=new mg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const tO=new Vt("INITIAL_STATE_TOKEN");let uye=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const G4=new Vt("Internals.StateContextFactory"),$4=new Vt("Internals.StateFactory");function O0(...n){if(1===n.length){const e=n[0];if(L(e))return RS(e,null);if(re(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return RS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return RS(n=1===n.length&&L(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return RS(n,null)}function RS(n,e){return new F(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function Ui(n,e){return function(i){return i.lift(new dye(n,e))}}class dye{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new hye(e,this.predicate,this.thisArg))}}class hye extends y{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}function ka(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new mg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const W4=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function Yi(n){return e=>0===n?mE():e.lift(new pye(n))}class pye{constructor(e){if(this.total=e,this.total<0)throw new W4}call(e,t){return t.subscribe(new gye(e,this.total))}}class gye extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function q4(n,e){return e?t=>t.pipe(q4((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new mye(n))}class mye{constructor(e){this.project=e}call(e,t){return t.subscribe(new _ye(e,this.project))}}class _ye extends fe{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new wt(this),i=this.destination;i.add(t);const r=R(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function OS(n=null){return e=>e.lift(new yye(n))}class yye{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new vye(e,this.defaultValue))}}class vye extends y{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function lc(n){return function(t){const i=new bye(n),r=t.lift(i);return i.caught=r}}class bye{constructor(e){this.selector=e}call(e,t){return t.subscribe(new wye(e,this.selector,this.caught))}}class wye extends fe{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new wt(this);this.add(i);const r=R(t,i);r!==i&&this.add(r)}}}function os(n){return e=>e.lift(new Eye(n))}class Eye{constructor(e){this.notifier=e}call(e,t){const i=new Sye(e),r=R(this.notifier,new wt(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class Sye extends fe{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function nh(){}function Zr(n,e,t){return function(r){return r.lift(new xye(n,e,t))}}class xye{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Cye(e,this.nextOrObserver,this.error,this.complete))}}class Cye extends y{constructor(e,t,i,r){super(e),this._tapNext=nh,this._tapError=nh,this._tapComplete=nh,this._tapError=i||nh,this._tapComplete=r||nh,K(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||nh,this._tapError=t.error||nh,this._tapComplete=t.complete||nh)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}function $u(n,e){return t=>t.lift(new Aye(n,e))}class Aye{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new Tye(e,this.compare,this.keySelector))}}class Tye extends y{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}const Ba={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let K4=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(n){return"server"===n}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return mn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return mn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof mn||console.warn(Ba.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn),Ie(Pc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Y4=new Vt("ROOT_STATE_TOKEN"),X4=new Vt("FEATURE_STATE_TOKEN"),Q4=new Vt("NGXS_PLUGINS"),Z4=new Vt("NG_TEST_MODE"),J4=new Vt("NG_DEV_MODE"),Wu="NGXS_META",e8="NGXS_OPTIONS_META";let Tf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=K4}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Mye{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const t8=new Vt("NGXS_EXECUTION_STRATEGY");function Mf(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const n8=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},NS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),iO=n=>n&&"object"==typeof n&&!Array.isArray(n),rO=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(iO(n)&&iO(t))for(const i in t)iO(t[i])?(n[i]||Object.assign(n,{[i]:{}}),rO(n[i],t[i])):Object.assign(n,{[i]:t[i]});return rO(n,...e)};function N0(n){return n[Wu]}function r8(n,e){const t=NS(e.currentAppState,n.path),i=NS(e.newAppState,n.path);return new Mye(t,i,!n.isInitialised)}function Lye(...n){return function(n,e,t=jye){const i=function(n){return n.reduce((e,t)=>(e[Mf(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Ui(t=>{const i=Mf(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function jye(){return me(n=>n.action)}function PS(n){return e=>new F(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let FS=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(t8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class zye extends ee{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let LS=(()=>{class n extends zye{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Hye=(()=>{class n extends F{constructor(t,i){super(r=>{const s=t.pipe(PS(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(Ie(LS),Ie(FS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const s8=n=>(...e)=>n.shift()(...e,(...i)=>s8(n)(...i));let kS=(()=>{class n extends Or{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),lO=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(Q4,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),cO=(()=>{class n extends ee{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),o8=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Zo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(PS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?an(this._stateStream.getValue()):O0(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!Mf(t))return gg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return s8([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(ka())}getActionResultStream(t){return this._actionResults.pipe(Ui(i=>i.action===t&&"DISPATCHED"!==i.status),Yi(1),ka())}createDispatchObservable(t){return t.pipe(q4(i=>{switch(i.status){case"SUCCESSFUL":return an(this._stateStream.getValue());case"ERRORED":return gg(i.error);default:return Lc}})).pipe(ka())}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(LS),Ie(cO),Ie(lO),Ie(kS),Ie(FS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const a8=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&a8(n[i])}),n};let l8=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(J4),Ie(Z4))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),c8=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Ba.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ba.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(l8),Ie(Tf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Yg=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=a8(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(Ie(kS),Ie(o8),Ie(Tf),Ie(c8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),BS=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return NS(l,t.path)}function s(l,c){const d=n8(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=r8(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Ba.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ba.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Yg))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class jS{static stateNameErrorMessage(e){return Ba.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ba.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Ba.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=N0(e);if(!t)throw new Error(Ba.STATE_DECORATOR());return t}}jS.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Xg=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=H4(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(jS.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[Wu].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[Wu];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[Wu].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[Wu];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>n8(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ui(t=>"DISPATCHED"===t.status),k(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),OS({action:t,status:"CANCELED"}),lc(i=>an({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=Mf(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=Pe(d)),d instanceof F?(d=d.pipe(OS({})),l.options.cancelUncompleted&&(d=d.pipe(os(t.pipe(Lye(i)))))):d=an({}).pipe(ka()),s.push(d)}catch(d){s.push(gg(d))}}}return s.length||s.push(an({})),O0(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=jS.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==NS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(Tf),Ie(n,12),Ie(LS),Ie(cO),Ie(BS),Ie(tO,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),uO=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ui(()=>!!i),Zr(()=>this.invokeInit(i.states)),k(()=>this.bootstrapper.appBootstrapped$),Ui(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=r8(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Yg),Ie(BS),Ie(eO))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();let ih=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(me(i),lc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?an(void 0):gg(r)}),$u(),PS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Yi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(PS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=function(n){return n.NGXS_SELECTOR_META}(n)||N0(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(kS),Ie(Yg),Ie(Tf),Ie(FS),Ie(Xg),Ie(tO,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),P0=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(Tf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class Xye{static get type(){return"@@INIT"}}class Qye{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const US=new mg(1);let FO,Jye=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Da();US.next(t)}catch(n){US.next(!1)}finally{US.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new Xye,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Xg),Ie(Yg),Ie(ih),Ie(P0),Ie(Y4,8),Ie(uO))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})(),e0e=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new Qye(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(Yg),Ie(Xg),Ie(X4,8),Ie(uO))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();class la{static forRoot(e=[],t={}){return{ngModule:Jye,providers:[Xg,BS,Hye,LS,eO,c8,l8,uO,o8,cO,Yg,FS,ih,kS,P0,lO,...e,...la.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:e0e,providers:[Xg,lO,...e,{provide:X4,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:Z4,useValue:cye},{provide:J4,useValue:Da},{provide:t8,useClass:t.executionStrategy||K4},{provide:Y4,useValue:e},{provide:la.ROOT_OPTIONS,useValue:t},{provide:Tf,useFactory:la.ngxsConfigFactory,deps:[la.ROOT_OPTIONS]},{provide:Bw,useFactory:la.appBootstrapListenerFactory,multi:!0,deps:[eO]},{provide:tO,useFactory:la.getInitialState},{provide:G4,useExisting:BS},{provide:$4,useExisting:Xg}]}static ngxsConfigFactory(e){return rO(new Tf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return uye.pop()}}function n0e(n){return i=>{!function(n){US.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ba.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(Wu)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,Wu,{value:e})}return N0(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[e8]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;jS.checkCorrectStateName(d),s.hasOwnProperty(Wu)&&(r.actions=Object.assign({},r.actions,(s[Wu]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[e8]=a}}la.\u0275fac=function(e){return new(e||la)},la.\u0275mod=gn({type:la}),la.\u0275inj=Et({}),la.ROOT_OPTIONS=new Vt("ROOT_OPTIONS"),new Jl(gE);try{FO="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){FO=!1}"undefined"!=typeof Element&∈function YH(n){Promise.resolve(null).then(n)}class nm{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){YH(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function QH(){return"undefined"!=typeof window&&void 0!==window.document}function UO(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let $O=(n,e)=>!1,WO=(n,e)=>!1,e5=(n,e,t)=>[];const t5=UO();(t5||"undefined"!=typeof Element)&&($O=QH()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),WO=(()=>{if(t5||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):WO}})(),e5=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return qO(t)}matchesElement(t,i){return KO(t,i)}containsElement(t,i){return YO(t,i)}query(t,i,r){return XO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new nm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ox{}ox.NOOP=new r5;function l5(n,e,t){return t?e+":"+t+";":""}function c5(n){let e="";for(let t=0;t{const r=tN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),UO()&&c5(n))}function Pf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=tN(t);n.style[i]=""}),UO()&&c5(n))}const ebe=/-+([a-z0-9])/g;function tN(n){return n.replace(ebe,(...e)=>e[1].toUpperCase())}function tbe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class sm{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=sm.initialStylesByElement.get(e);r||sm.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&eu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(eu(this._element,this._initialStyles),this._endStyles&&(eu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(sm.initialStylesByElement.delete(this._element),this._startStyles&&(Pf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Pf(this._element,this._endStyles),this._endStyles=null),eu(this._element,this._initialStyles),this._state=3)}}sm.initialStylesByElement=new WeakMap;let Lf;try{Lf="undefined"!=typeof Intl}catch(n){Lf=!1}new class extends Jl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let tEe=1;const nEe=Promise.resolve(),Mx={};function o6(n){return n in Mx&&(delete Mx[n],!0)}const a6={setImmediate(n){const e=tEe++;return Mx[e]=!0,nEe.then(()=>o6(e)&&n()),e},clearImmediate(n){o6(n)}};new class extends Jl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=a6.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(a6.clearImmediate(t),e.scheduled=void 0)}});function X0(n){return!!n&&(n instanceof F||"function"==typeof n.lift&&"function"==typeof n.subscribe)}function Ix(...n){return It(1)(an(...n))}function Vo(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>Ix(n,t,e)):t=>Ix(n,t)}function V6(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>me(function(n,e){return i=>{let r=i;for(let s=0;s{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&qx(n[o])}),n};function kG(n){return Ha(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const VG="NGXS_DATA_META",GN="NGXS_META",UG="NGXS_ARGUMENT_REGISTRY_META";let zG=(()=>{class n{constructor(t){this.sequence$=new Or(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function nv(n){return n[VG]}let Ga=(()=>{class n{constructor(t,i,r){n.store=t.get(ih),n.ngZone=t.get(mn),n.factory=i,n.context=r,n.computed=t.get(zG)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie($4),Ie(G4))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ls{constructor(){ls.statesCachedMeta.clear()}static createStateContext(e){return Ga.context.createStateContext(e)}static ensureMappedState(e){if(za(Ga.factory)||za(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(Ha(e.name)?ls.statesCachedMeta.get(e.name):null)||ls.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=nv(ls.getStateClassByInstance(e)))&&void 0!==t?t:null;if(za(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=ls.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=ls.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=Ha(e.name)?null===(t=Ga.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Ha(i)&&Ha(e.name)&&ls.statesCachedMeta.set(e.name,i),i}}ls.statesCachedMeta=new Map,ls.\u0275fac=function(e){return new(e||ls)},ls.\u0275prov=We({token:ls,factory:ls.\u0275fac}),new mg(1);class ACe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Ha(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function HG(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function GG(n){var e;const t=HG(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=LG(void 0===t.defaults?{}:t.defaults);if(i.length){if(kG(s))return function(n,e){return e.reduce((t,i)=>{const r=HG(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=GG(i),t},null!=n?n:{})}(s,i);throw new ACe(s)}return s}function WG(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function qG(){var n,e;return null!==(e=null===(n=null==Ga?void 0:Ga.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function ICe(n){let e=!1;return X0(n)&&(e=!0),e}function $N(n){return n[UG]}class RCe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class OCe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(zN(this.argumentMap.has(e))||zN(this.payloadMap.has(e)))throw new RCe(e,t)}}function BCe(n){return{enumerable:!0,configurable:!0,get(){const e=nv(n),t=ls.ensureMappedState(e.stateMeta);return ls.createStateContext(t)}}}function KG(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(kG(i))for(;null!==i;){if(tv(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return za(WG(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),WG(n)}(this),o=null==s?void 0:s.get(i);if(tv(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(za(o)||o.sequenceId!==qG()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:qG(),isObservable:ICe(l)}),l}return o.value},t}}const GCe={cancelUncompleted:!0,insideZone:!1};function WN(n=GCe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=ls.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=$N(r);if(za(f)){const G=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),ge=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var G;return tv(n.insideZone)?null===(G=Ga.ngZone)||void 0===G||G.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),X0(l)?an(null).pipe(me(()=>l)):l};const A=ls.createAction(f,o,g),W=Ga.store.dispatch(A);return X0(l)?function(n,e){return O0([n,e]).pipe(me(t=>t.pop()))}(W,l):l},i}}function YG(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return za($N(t))&&Object.defineProperties(t,{[UG]:{enumerable:!0,configurable:!0,value:new OCe}}),$N(t)})(e,t).createPayloadType(r,t,i)}}function WCe(){return n=>{const e=function(n){if(function(n){return!zN(n)}(n.hasOwnProperty(GN))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,GN,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[GN]}(n)}(n);if(za(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=nv(n))&&void 0!==e?e:null;return(za(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,VG,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),nv(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>LG(t)},context:BCe(n)})}(n,e,GG(n)),function(n){var e,t;const i=nv(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(Ha(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Ha(this[s]))return this[s];if(za(Ga.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ga.store.select(n).pipe(me(o=>Da()?qx(o):o),ka({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let KCe=(()=>{class n{constructor(){this.browserStorageEvents$=new ee,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),YCe=(()=>{class n extends KCe{get snapshot(){return function(n){return Da()?qx(n):n}(this.getState())}get ctx(){return function(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>Da()?qx(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ia([KG(),ec("design:type",Object),ec("design:paramtypes",[])],n.prototype,"snapshot",null),Ia([WN(),z3(0,YG("patchValue")),ec("design:type",Function),ec("design:paramtypes",[Object]),ec("design:returntype",void 0)],n.prototype,"patchState",null),Ia([WN(),z3(0,YG("stateValue")),ec("design:type",Function),ec("design:paramtypes",[Object]),ec("design:returntype",void 0)],n.prototype,"setState",null),Ia([WN(),ec("design:type",Function),ec("design:paramtypes",[]),ec("design:returntype",void 0)],n.prototype,"reset",null),n})();new Vt("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})});const mP=new Vt("ngx-window",{providedIn:"root",factory:()=>function(n){return function(n){return n===x3}(n)?window:null}(xc(Pc))}),_Me=new Vt("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(xc(mP))});new Vt("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(xc(mP),xc(_Me))}),new Vt("ngx-google-analytics-routing-settings",{factory:()=>({})}),new Vt("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"});const DMe=["bodyCanvas"];let IMe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new cn,this.nodeDrag=new cn,this.nodeClick=new cn,this.nodeHoverStart=new cn,this.nodeHoverStop=new cn,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return ir(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new sye({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=wn({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Ms(DMe,5,An),2&t){let r;Ai(r=Ti())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&xu(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&function(n,e,t,i){Kt(n,e,t,i),Yt()}(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),RMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({imports:[[Ws]]}),n})();new Vt("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10}),[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].filter(n=>!0!==n.disabled);let hv=(()=>{let n=class extends YCe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ui(n=>null!=n),ka(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(V6(...t),$u(),ka(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(V6(...t),$u(),ka(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ia([KG()],n.prototype,"config$",null),n=Ia([WCe(),n0e({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();const l7="http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity",aDe=[173,255,47,229.5];var ei=tt(440),hDe=tt(698),fDe=tt(445),pDe=tt.n(fDe),En=tt(815),$a=tt(609);const Hi=ei.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},ei.DataFactory),ym=(Hi("rdf"),Hi("rdf")("type"),{x:Hi("rdfs"),label:Hi("rdfs")("label"),comment:Hi("rdfs")("comment"),isDefinedBy:Hi("rdfs")("isDefinedBy"),seeAlso:Hi("rdfs")("seeAlso")}),Os={x:Hi("entity"),id:Hi("entity")("id"),label:ym.label,description:ym.comment,link:ym.seeAlso,sex:Hi("entity")("sex"),age:Hi("entity")("age"),bmi:Hi("entity")("bmi"),Male:ei.DataFactory.literal("Male"),Female:ei.DataFactory.literal("Female"),consortiumName:Hi("entity")("consortium_name"),providerName:Hi("entity")("provider_name"),providerUUID:Hi("entity")("provider_uuid"),donor:Hi("entity")("has_donor"),sections:Hi("entity")("has_tissue_section"),datasets:Hi("entity")("has_dataset"),sampleType:Hi("entity")("sample_type"),TissueBlock:ei.DataFactory.literal("Tissue Block"),TissueSection:ei.DataFactory.literal("Tissue Section"),NonStandard:ei.DataFactory.literal("Non-standard"),sectionCount:Hi("entity")("section_count"),sectionSize:Hi("entity")("section_size"),sectionUnits:Hi("entity")("section_units"),sectionNumber:Hi("entity")("section_number"),spatialEntity:Hi("entity")("has_spatial_entity"),ontologyTerms:Hi("entity")("has_ontology_term"),technology:Hi("entity")("technology"),thumbnail:Hi("entity")("has_thumbnail")},In=Hi("ccf"),dc={x:In,ontologyNode:{label:In("ccf_preferred_label"),parent:In("ccf_part_of"),children:In("ccf_part_of"),rui_rank:In("ccf_rui_rank"),synonymLabels:ei.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:In("VHFemale"),Male:In("VHMale"),BothSexes:In("VHBothSexes"),FemaleOrgans:In("VHFemaleOrgans"),MaleOrgans:In("VHMaleOrgans")},SpatialObjectReference:In("SpatialObjectReference"),SpatialEntity:In("SpatialEntity"),SpatialPlacement:In("SpatialPlacement"),spatialObjectReference:{file:In("has_object_file"),file_format:In("has_object_file_format"),file_subpath:In("has_object_file_subpath")},extractionSet:{label:ym.label,rui_rank:In("ccf_rui_rank")},spatialEntity:{label:ym.label,comment:ym.comment,creator:Hi("dc")("creator"),creator_first_name:In("creator_first_name"),creator_last_name:In("creator_last_name"),creator_orcid:In("creator_orcid"),creation_date:In("creation_date"),updated_date:In("updated_date"),ccf_annotations:In("ccf_annotation"),representation_of:In("ccf_representation_of"),reference_organ:In("anatomical_structure_of"),extraction_set_for:In("extraction_set_for"),extraction_set:In("extraction_site_for"),sex:In("has_sex"),side:In("has_side"),rui_rank:In("ccf_rui_rank"),slice_thickness:In("ccf_slice_thickness"),slice_count:In("ccf_slice_count"),x_dimension:In("has_x_dimension"),y_dimension:In("has_y_dimension"),z_dimension:In("has_z_dimension"),dimension_units:In("has_dimension_units"),object:In("has_object_reference")},spatialPlacement:{source:In("has_placement_source"),target:In("has_placement_target"),placement_date:In("has_placement_date"),x_scaling:In("has_x_scaling"),y_scaling:In("has_y_scaling"),z_scaling:In("has_z_scaling"),scaling_units:In("has_scaling_units"),x_rotation:In("has_x_rotation"),y_rotation:In("has_y_rotation"),z_rotation:In("has_z_rotation"),w_rotation:In("has_theta_rotation"),rotation_order:In("has_rotation_order"),rotation_units:In("has_rotation_units"),x_translation:In("has_x_translation"),y_translation:In("has_y_translation"),z_translation:In("has_z_translation"),translation_units:In("has_translation_units")}},Tr={x:Hi("uberon")},mDe=(Hi("lmha"),{bladder:Tr.x("0001255"),body:Tr.x("0013702"),brain:Tr.x("0000955"),colon:Tr.x("0001155"),heart:Tr.x("0000948"),kidney:Tr.x("0002113"),large_intestine:Tr.x("0000059"),left_kidney:Tr.x("0004538"),left_lung:Tr.x("0002168"),left_ureter:Tr.x("0001223"),liver:Tr.x("0002107"),lung:Tr.x("0002048"),respiratory_system:Tr.x("0001004"),lymph_node:Tr.x("0000029"),pelvis:Tr.x("0001270"),rectum:Tr.x("0001052"),right_kidney:Tr.x("0004539"),right_lung:Tr.x("0002167"),right_ureter:Tr.x("0001222"),skin:Tr.x("0002097"),small_intestine:Tr.x("0002108"),spleen:Tr.x("0002106"),thymus:Tr.x("0002370"),ureter:Tr.x("0000056"),vasculature:Tr.x("0002049")});function vP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const f1={spatialObjectReference:vP(dc.spatialObjectReference),spatialEntity:vP(dc.spatialEntity),spatialPlacement:vP(dc.spatialPlacement)};function p1(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,$a.fromRdf)(s.object):s.object.id;(0,En.set)(r,o,a)}return!1},ei.DataFactory.namedNode(e),null,null,null),r}const yDe=(0,En.memoize)(function(n,e){return p1(n,e,"SpatialObjectReference",f1.spatialObjectReference)},(n,e)=>e),bDe=(0,En.memoize)(function(n,e){const t=p1(n,e,"ExtractionSet",f1.spatialEntity);return t.extractionSites=(0,En.sortBy)(n.getSubjects(dc.spatialEntity.extraction_set,e,null).map(i=>vm(n,i.id)),["rui_rank"]),t},(n,e)=>e);(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(dc.spatialEntity.extraction_set_for,e,null).map(t=>bDe(n,t.id)),["rui_rank"])},(n,e)=>e),(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(dc.spatialEntity.reference_organ,e,null).map(t=>vm(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),(0,En.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(vm(n,t.subject.id))},null,dc.spatialEntity.reference_organ,null,null),(0,En.sortBy)(e,["rui_rank"])});const vm=(0,En.memoize)(function(n,e){const t=p1(n,e,"SpatialEntity",f1.spatialEntity);return t.object&&(t.object=yDe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,dc.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,Os.spatialEntity,e,null),t},(n,e)=>e);(0,En.memoize)(function(n,e){const t=p1(n,e,"SpatialPlacement",f1.spatialPlacement);return t.source&&(t.source=vm(n,t.source)),t.target&&(t.target=vm(n,t.target)),t},(n,e)=>e),(0,En.memoize)(function(n,e){const t=n.getObjects(ei.DataFactory.namedNode(e),Os.spatialEntity,null);if(t.length>0)return vm(n,t[0].id)},(n,e)=>e),new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),function(){const n={};Object.entries(mDe).forEach(([e,t])=>n[e]=t.id)}();const y1={[Os.label.id]:"label",[Os.description.id]:"description",[Os.link.id]:"link"},WDe=Object.assign(Object.assign({},y1),{[Os.providerName.id]:"providerName"}),qDe=Object.assign(Object.assign({},y1),{[Os.technology.id]:"technology",[Os.thumbnail.id]:"thumbnail"}),KDe=Object.assign(Object.assign({},y1),{[Os.sampleType.id]:"sampleType",[Os.sectionNumber.id]:"sectionNumber",[Os.datasets.id]:"datasets"}),YDe=Object.assign(Object.assign({},y1),{[Os.sampleType.id]:"sampleType",[Os.sectionCount.id]:"sectionCount",[Os.sectionSize.id]:"sectionSize",[Os.sectionUnits.id]:"sectionUnits",[Os.donor.id]:"donor",[Os.spatialEntity.id]:"spatialEntityId",[Os.sections.id]:"sections",[Os.datasets.id]:"datasets"}),QDe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=WDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function d7(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=qDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t}(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=YDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=KDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=d7(n,s);t[r].push(o)}else(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=d7(n,s);t[r].push(o)}else"donor"===r?t[r]=QDe(n,s):(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);const h7={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};function ru(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let bP;function hc(){return bP||(bP=function(n,e){const t=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const i=()=>indexedDB.databases().finally(t);e=setInterval(i,100),i()}).finally(()=>clearInterval(e))}().then(()=>{const i=indexedDB.open("keyval-store");return i.onupgradeneeded=()=>i.result.createObjectStore(e),ru(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),bP}function f7(n,e=hc()){return e("readonly",t=>ru(t.get(n)))}const Gi=ei.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},ei.DataFactory),p7={x:Gi("rdf"),type:Gi("rdf")("type")},bm={x:Gi("rdfs"),label:Gi("rdfs")("label"),comment:Gi("rdfs")("comment"),isDefinedBy:Gi("rdfs")("isDefinedBy"),seeAlso:Gi("rdfs")("seeAlso")},gi={x:Gi("entity"),id:Gi("entity")("id"),label:bm.label,description:bm.comment,link:bm.seeAlso,sex:Gi("entity")("sex"),age:Gi("entity")("age"),bmi:Gi("entity")("bmi"),Male:ei.DataFactory.literal("Male"),Female:ei.DataFactory.literal("Female"),consortiumName:Gi("entity")("consortium_name"),providerName:Gi("entity")("provider_name"),providerUUID:Gi("entity")("provider_uuid"),donor:Gi("entity")("has_donor"),sections:Gi("entity")("has_tissue_section"),datasets:Gi("entity")("has_dataset"),sampleType:Gi("entity")("sample_type"),TissueBlock:ei.DataFactory.literal("Tissue Block"),TissueSection:ei.DataFactory.literal("Tissue Section"),NonStandard:ei.DataFactory.literal("Non-standard"),sectionCount:Gi("entity")("section_count"),sectionSize:Gi("entity")("section_size"),sectionUnits:Gi("entity")("section_units"),sectionNumber:Gi("entity")("section_number"),spatialEntity:Gi("entity")("has_spatial_entity"),ontologyTerms:Gi("entity")("has_ontology_term"),technology:Gi("entity")("technology"),thumbnail:Gi("entity")("has_thumbnail")},Rn=Gi("ccf"),lr={x:Rn,ontologyNode:{label:Rn("ccf_preferred_label"),parent:Rn("ccf_part_of"),children:Rn("ccf_part_of"),rui_rank:Rn("ccf_rui_rank"),synonymLabels:ei.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:Rn("VHFemale"),Male:Rn("VHMale"),BothSexes:Rn("VHBothSexes"),FemaleOrgans:Rn("VHFemaleOrgans"),MaleOrgans:Rn("VHMaleOrgans")},SpatialObjectReference:Rn("SpatialObjectReference"),SpatialEntity:Rn("SpatialEntity"),SpatialPlacement:Rn("SpatialPlacement"),spatialObjectReference:{file:Rn("has_object_file"),file_format:Rn("has_object_file_format"),file_subpath:Rn("has_object_file_subpath")},extractionSet:{label:bm.label,rui_rank:Rn("ccf_rui_rank")},spatialEntity:{label:bm.label,comment:bm.comment,creator:Gi("dc")("creator"),creator_first_name:Rn("creator_first_name"),creator_last_name:Rn("creator_last_name"),creator_orcid:Rn("creator_orcid"),creation_date:Rn("creation_date"),updated_date:Rn("updated_date"),ccf_annotations:Rn("ccf_annotation"),representation_of:Rn("ccf_representation_of"),reference_organ:Rn("anatomical_structure_of"),extraction_set_for:Rn("extraction_set_for"),extraction_set:Rn("extraction_site_for"),sex:Rn("has_sex"),side:Rn("has_side"),rui_rank:Rn("ccf_rui_rank"),slice_thickness:Rn("ccf_slice_thickness"),slice_count:Rn("ccf_slice_count"),x_dimension:Rn("has_x_dimension"),y_dimension:Rn("has_y_dimension"),z_dimension:Rn("has_z_dimension"),dimension_units:Rn("has_dimension_units"),object:Rn("has_object_reference")},spatialPlacement:{source:Rn("has_placement_source"),target:Rn("has_placement_target"),placement_date:Rn("has_placement_date"),x_scaling:Rn("has_x_scaling"),y_scaling:Rn("has_y_scaling"),z_scaling:Rn("has_z_scaling"),scaling_units:Rn("has_scaling_units"),x_rotation:Rn("has_x_rotation"),y_rotation:Rn("has_y_rotation"),z_rotation:Rn("has_z_rotation"),w_rotation:Rn("has_theta_rotation"),rotation_order:Rn("has_rotation_order"),rotation_units:Rn("has_rotation_units"),x_translation:Rn("has_x_translation"),y_translation:Rn("has_y_translation"),z_translation:Rn("has_z_translation"),translation_units:Rn("has_translation_units")}},Mr={x:Gi("uberon")},g7=(Gi("lmha"),{bladder:Mr.x("0001255"),body:Mr.x("0013702"),brain:Mr.x("0000955"),colon:Mr.x("0001155"),heart:Mr.x("0000948"),kidney:Mr.x("0002113"),large_intestine:Mr.x("0000059"),left_kidney:Mr.x("0004538"),left_lung:Mr.x("0002168"),left_ureter:Mr.x("0001223"),liver:Mr.x("0002107"),lung:Mr.x("0002048"),respiratory_system:Mr.x("0001004"),lymph_node:Mr.x("0000029"),pelvis:Mr.x("0001270"),rectum:Mr.x("0001052"),right_kidney:Mr.x("0004539"),right_lung:Mr.x("0002167"),right_ureter:Mr.x("0001222"),skin:Mr.x("0002097"),small_intestine:Mr.x("0002108"),spleen:Mr.x("0002106"),thymus:Mr.x("0002370"),ureter:Mr.x("0000056"),vasculature:Mr.x("0002049")});function EP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const v1={spatialObjectReference:EP(lr.spatialObjectReference),spatialEntity:EP(lr.spatialEntity),spatialPlacement:EP(lr.spatialPlacement)};function b1(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,$a.fromRdf)(s.object):s.object.id;(0,En.set)(r,o,a)}return!1},ei.DataFactory.namedNode(e),null,null,null),r}const aIe=(0,En.memoize)(function(n,e){return b1(n,e,"SpatialObjectReference",v1.spatialObjectReference)},(n,e)=>e),m7=(0,En.memoize)(function(n,e){const t=b1(n,e,"ExtractionSet",v1.spatialEntity);return t.extractionSites=(0,En.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set,e,null).map(i=>$f(n,i.id)),["rui_rank"]),t},(n,e)=>e),uIe=(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set_for,e,null).map(t=>m7(n,t.id)),["rui_rank"])},(n,e)=>e),hIe=(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(lr.spatialEntity.reference_organ,e,null).map(t=>$f(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),pIe=(0,En.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push($f(n,t.subject.id))},null,lr.spatialEntity.reference_organ,null,null),(0,En.sortBy)(e,["rui_rank"])}),$f=(0,En.memoize)(function(n,e){const t=b1(n,e,"SpatialEntity",v1.spatialEntity);return t.object&&(t.object=aIe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,lr.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,gi.spatialEntity,e,null),t},(n,e)=>e),_Ie=(0,En.memoize)(function(n,e){const t=b1(n,e,"SpatialPlacement",v1.spatialPlacement);return t.source&&(t.source=$f(n,t.source)),t.target&&(t.target=$f(n,t.target)),t},(n,e)=>e),vIe=(0,En.memoize)(function(n,e){const t=n.getObjects(ei.DataFactory.namedNode(e),gi.spatialEntity,null);if(t.length>0)return $f(n,t[0].id)},(n,e)=>e);function bIe(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(kB),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class _7{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new hDe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},p7.type,lr.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},p7.type,lr.SpatialEntity,null);const t={};e.some(i=>(t[i.subject.id]=i.object.id,!1),null,lr.spatialPlacement.source,null,null),e.some(i=>{const r=t[i.subject.id];return r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement"),!1},null,lr.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,i,r){this.graph.mergeDirectedEdge(t,i,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new $n($n.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new $n($n.IDENTITY),s=pDe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s){if(o){const l=this.graph.getEdgeAttribute(a,o,"id");bIe(r,_Ie(i,l))}o=a}return r}}}class y7{constructor(e){this.db=e}getSpatialEntity(e){return $f(this.db.store,e)}getExtractionSets(e){return uIe(this.db.store,e)}getExtractionSet(e){return m7(this.db.store,e)}getAnatomicalStructures(e){return hIe(this.db.store,e)}getReferenceOrgans(){return pIe(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=lr.spatial.Male.id;break;case"Female":t=lr.spatial.Female.id;break;case"Both":default:t=lr.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(i=>"Male"===i.sex);break;case"Female":t=t.filter(i=>"Female"===i.sex)}return(null==e?void 0:e.debug)&&(t=t.map(i=>[[i],this.getAnatomicalStructures(i["@id"])]).reduce((i,[r,s])=>i.concat(s.length>0?s:r),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let i=[...this.getReferenceOrganSets(e).map(r=>{const s="http://purl.obolibrary.org/obo/UBERON_0002097"===r.representation_of;return this.getSceneNode(r,t,{color:[255,255,255,255],opacity:s?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!s})})];return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(lr.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(r=>void 0!==r)}getReferenceOrganScene(e,t){var i,r;const s=null!==(i=void 0!==(null==t?void 0:t.sex))&&void 0!==i&&i,o=this.getReferenceOrgans().filter(a=>a.representation_of===e&&(!s||a.sex===(null==t?void 0:t.sex)));if(o.length>0){const a=o[0],c=this.getSceneNode(a,a,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===a.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),d=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(f=>this.getSceneNode(f,a,{color:[255,255,255,229.5]}));return[c].concat(d).filter(f=>void 0!==f)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(i=>this.getSceneNode(i,t,{color:[255,255,255,229.5]})).filter(i=>void 0!==i)}getSceneNode(e,t,i={}){var r,s,o,a;const l=null===(s=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===s?void 0:s.startsWith("model/gltf");let d=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(d){if(l)d=new $n($n.IDENTITY).rotateX(kB(90)).multiplyLeft(d);else{let f;switch(e.dimension_units){case"centimeter":f=.01;break;case"millimeter":f=.001;break;case"meter":default:f=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*f/2);d.scale(p)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:l?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:l?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:d,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const w1="https://entity.api.hubmapconsortium.org/entities/",v7=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),wIe={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},E1={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},xi=function(){const n={};return Object.entries(g7).forEach(([e,t])=>n[e]=t.id),n}(),SIe={BL:[xi.body,xi.bladder],RK:[xi.body,xi.kidney,xi.right_kidney],LK:[xi.body,xi.kidney,xi.left_kidney],HT:[xi.body,xi.heart],LI:[xi.body,xi.large_intestine,xi.colon],SI:[xi.body,xi.small_instestine],LL:[xi.body,xi.respiratory_system,xi.lung,xi.left_lung],RL:[xi.body,xi.respiratory_system,xi.lung,xi.right_lung],LY:[xi.body,xi.lymph_node],SP:[xi.body,xi.spleen],TH:[xi.body,xi.thymus],UR:[xi.body,xi.ureter],LV:[xi.body,xi.liver],OT:[xi.body]},b7={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class AIe{constructor(e,t="",i="",r){var s,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const c=this.data.descendants||[],d=(this.data.ancestors||[]).find($e=>"Donor"===$e.entity_type);this.donor=this.getDonor(d,i);const f=this.getRuiLocation(e,this.donor);f?this.rui_location=f:this.bad=!0;const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=E1[e.group_uuid]||e.group_name,_=e.created_by_user_displayname;this["@id"]=w1+e.uuid,this.label=`Registered ${p}, ${_}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const x={},A=[];this.sections=A;const W=[];this.datasets=W;for(const $e of c.filter(at=>"Sample"===at.entity_type)){const at=this.getSection($e,e,i);x[$e.submission_id]=at,A.push(at),at.section_number=null!==(s=at.section_number)&&void 0!==s?s:A.length}for(const $e of c)if("Dataset"===$e.entity_type){const at=this.getDataset($e,t,i,r),St=(0,En.get)($e,["ingest_metadata","metadata","tissue_id"]);x[St]?null===(o=x[St].datasets)||void 0===o||o.push(at):W.push(at)}const G=null!=f?f:{},ge=`${G.x_dimension} x ${G.y_dimension} x ${G.z_dimension} ${G.dimension_units}`;this.section_count=G.slice_count||A.length;const Ne=parseFloat((G.slice_thickness||(G.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ne;const Ge=G.dimension_units||"millimeter";this.section_units=Ge,this.description=`${ge}, ${Ne} ${Ge}, ${e.specimen_type}, ${this.section_count} Sections`,A.forEach(($e,at)=>{$e.description=`${G.x_dimension} x ${G.y_dimension} x ${Ne} ${Ge}, ${Ne} ${Ge}, ${$e.description}`,$e.section_number=at+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":w1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${E1[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${i}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",i="",r){var s;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=E1[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,En.get)(e,["ingest_metadata","metadata","assay_type"],"")],d=c.join("|").toLowerCase();let f,p="assets/icons/ico-unknown.svg";return-1!==d.indexOf("10x")?(f="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==d.indexOf("af")?(f="AF",p="assets/icons/ico-spatial-af.svg"):-1!==d.indexOf("codex")?(f="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==d.indexOf("imc")?(f="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==d.indexOf("lc")&&-1===d.indexOf("af")?(f="LC",p="assets/icons/ico-bulk-lc.svg"):f=-1!==d.indexOf("maldi")?"MALDI":-1!==d.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":w1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:f,thumbnail:p}}getDatasetThumbnail(e,t,i){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(i?`?token=${i}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,En.get)(e,"metadata.files",[]).filter(s=>/\.(ome\.tif|ome\.tiff)$/.test(s.rel_path)).filter(s=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(s.rel_path)).filter(s=>v7.has(s.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(s=>`${t}/${e.uuid}/${s.rel_path}`+(i?`?token=${i}`:""));if(r.length>0){const s=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(v7.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=wIe[e.hubmap_id];if(r)return`assets/thumbnails/TMC-Florida/${r}`}}getDonor(e,t){const i=(e.description||"").toLowerCase();let r;i.includes("female")?r="Female":i.includes("male")&&(r="Male");const s=i.match(/age ([0-9]+)/);let o,a;s&&(o=(0,En.toNumber)(s[1]));for(const p of(0,En.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===p.preferred_term||"Female"===p.preferred_term?r="Female":"Masculine gender"===p.preferred_term||"Male"===p.preferred_term?r="Male":"Current chronological age"===p.preferred_term||"Age"===p.preferred_term?o=(0,En.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,En.toNumber)(p.data_value));let l="";r&&o&&(l+=`${r}, Age ${o}`,a&&(l+=`, BMI ${a.toFixed(1)}`));const c=new Date(e.last_modified_timestamp).toLocaleDateString(),d=E1[e.group_uuid]||e.group_name;return{"@id":w1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${d}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;const s=(e.ancestors||[]).find(c=>"Sample"===c.entity_type&&"organ"===c.specimen_type),o=SIe[null==s?void 0:s.organ]||[xi.body];let a,l=e.rui_location;if(l&&("string"==typeof l&&(l=JSON.parse(l)),l.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):l["@id"]&&(a=l)),a){a.ccf_annotations=o.concat(a.ccf_annotations||[]);const c=null!==(i=(0,En.get)(a,["placement","target"]))&&void 0!==i?i:"";c.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,En.set)(a,["placement","target"],c.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===c||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===c)&&(0,En.set)(a,["placement","target"],"Male"===t.sex?c.replace("#VH","#VHM")+"_Patch":c.replace("#VH","#VHF")+"_Patch")}return a}getTissueBlock(){return(0,En.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function w7(n,e,t,i,r="",s=""){return ir(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(n).then(a=>a.ok?a.json():void 0).catch(()=>{});else if("search-api"===e){const a={"Content-type":"application/json"};i&&i.length>0&&(a.Authorization=`Bearer ${i}`),o=yield fetch(n,{method:"POST",headers:a,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:{exists:{field:"rui_location"}}})}).then(l=>l.ok?l.json():void 0).catch(()=>{})}if(o)return function(n,e="",t="",i,r=!1){const o={},a=(0,En.get)(n,"hits.hits",[]).map(c=>(0,En.get)(c,"_source",{})).map(c=>new AIe(c,e,t,i).toJsonLd());for(const c of a){const d=c["@id"];o[d]?o[d].samples.push(c.samples[0]):o[d]=c}const l=Object.values(o);return r&&(function(n){let e=[],t=0;for(const i of n.filter(r=>r.samples.length>1)){const r=i.samples;for(let s=0;sc["@id"]===o)&&(r[s].deleteMe=!0,t++)}i.samples=r.filter(s=>!0!==s.deleteMe)}t>0&&console.log(`\u26a0 ${t} sections identified as blocks`)}(l),console.log(l.map(c=>Object.assign({"@context":b7},c)))),{"@context":b7,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function S1(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.donor,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}function pv(n,e){return t=>n.has(t.id)?e.add(t.id):void 0}const zIe={[lr.ontologyNode.label.id]:"label",[lr.ontologyNode.parent.id]:"parent",[lr.ontologyNode.synonymLabels.id]:"synonymLabels"};function HIe(n,e){const t=ei.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return n.some(r=>{const s=zIe[r.predicate.id];if(s){const o="Literal"===r.object.termType?(0,$a.fromRdf)(r.object):r.object.id;"synonymLabels"===s?i.synonymLabels.push(o):(0,En.set)(i,s,o)}return!1},t,null,null,null),i.children=n.getSubjects(lr.ontologyNode.children,t,null).map(r=>r.id),i}const x1={[gi.label.id]:"label",[gi.description.id]:"description",[gi.link.id]:"link"},$Ie=Object.assign(Object.assign({},x1),{[gi.providerName.id]:"providerName"}),WIe=Object.assign(Object.assign({},x1),{[gi.technology.id]:"technology",[gi.thumbnail.id]:"thumbnail"}),qIe=Object.assign(Object.assign({},x1),{[gi.sampleType.id]:"sampleType",[gi.sectionNumber.id]:"sectionNumber",[gi.datasets.id]:"datasets"}),KIe=Object.assign(Object.assign({},x1),{[gi.sampleType.id]:"sampleType",[gi.sectionCount.id]:"sectionCount",[gi.sectionSize.id]:"sectionSize",[gi.sectionUnits.id]:"sectionUnits",[gi.donor.id]:"donor",[gi.spatialEntity.id]:"spatialEntityId",[gi.sections.id]:"sections",[gi.datasets.id]:"datasets"}),XIe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=$Ie[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function E7(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=WIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t}const JIe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=KIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=qIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=E7(n,s);t[r].push(o)}else(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=E7(n,s);t[r].push(o)}else"donor"===r?t[r]=XIe(n,s):(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e),eRe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class tRe{constructor(e=eRe){this.options=e,this.store=new ei.Store(void 0,{factory:ei.DataFactory}),this.graph=new _7(this),this.scene=new y7(this)}connect(e,t=!1){return ir(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return ir(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield f7(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=hc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),ru(t.transaction)))}([i,t]).catch(()=>{}):s=yield f7(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=hc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),ru(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return ir(this,void 0,void 0,function*(){const i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],s=this.options.ccfOwlUrl;if(s.endsWith(".n3store.json")){const o=yield fetch(s).then(a=>a.text()).catch(()=>console.log("Couldn't locate serialized store."));o&&(this.store=(0,ei.deserializeN3Store)(o,ei.DataFactory))}else(null==s?void 0:s.length)>0&&r.push(s);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(w7(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(o=>{if(o)return this.addDataSources([o])}))),i.push(this.addDataSources(r)),yield Promise.all(i),yield this.synchronize()})}addDataSources(e,t){return ir(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>ir(this,void 0,void 0,function*(){"string"==typeof r?r.endsWith("jsonld")?yield(0,ei.addJsonLdToStore)(r,i):r.endsWith("n3")?yield(0,ei.addN3ToStore)(r,i):(r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml"))&&(yield(0,ei.addRdfXmlToStore)(r,i)):yield(0,ei.addJsonLdToStore)(r,i)}))),this})}synchronize(){return ir(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,ei.serializeN3Store)(this.store)}deserialize(e){return ir(this,void 0,void 0,function*(){this.store=(0,ei.deserializeN3Store)(e,ei.DataFactory),this.graph=new _7(this),this.scene=new y7(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e){var t,i,r,s,o;let a=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),gi.spatialEntity,null,null),e}(n);if(a.size>0&&(a=function(n,e,t=!0){const i=new Set;if(n.forSubjects(pv(e,i),gi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const l=e.sex;a=S1(n,a,c=>function(n,e,t){const i=new Set;return n.forSubjects(pv(e,i),gi.sex,gi[t],null),i}(n,c,l))}if(a.size>0&&(null===(t=e.tmc)||void 0===t?void 0:t.length)>0&&(a=S1(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=ei.DataFactory.literal(r);n.forSubjects(pv(e,i),gi.providerName,s,null)}return i}(n,l,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set,o=new Set;n.some(c=>(e.has(c.subject.id)&&o.add(c.object.id),!1),null,gi.sections,null,null),n.some(c=>{var d;return(e.has(c.subject.id)||o.has(c.subject.id))&&(s.add(c.object.id),r.has(c.object.id)?null===(d=r.get(c.object.id))||void 0===d||d.push(c.subject.id):r.set(c.object.id,[c.subject.id])),!1},null,gi.datasets,null,null);const a=t(s),l=new Set;for(const c of a)for(const d of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(d);return l}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=ei.DataFactory.literal(r);n.forSubjects(pv(e,i),gi.technology,s,null)}return i}(n,l,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.spatialEntity,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=ei.DataFactory.namedNode(r);n.forSubjects(pv(e,i),lr.spatialEntity.ccf_annotations,s,null)}return i}(n,l,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,En.isFinite)(e.ageRange[0])&&(0,En.isFinite)(e.ageRange[1])){const l=Math.max(...e.ageRange),c=Math.min(...e.ageRange);1===c&&110===l||(a=S1(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,$a.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.age,null,null),r}(n,d,c,l)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,En.isFinite)(e.bmiRange[0])&&(0,En.isFinite)(e.bmiRange[1])){const l=Math.max(...e.bmiRange),c=Math.min(...e.bmiRange);13===c&&83===l||(a=S1(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,$a.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.bmi,null,null),r}(n,d,c,l)))}return a}(this.store,e)}get(e){return this.store.getQuads(ei.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(t=>this.get(t))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>vIe(this.store,t))}getDatasetTechnologyNames(){return ir(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return ir(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return ir(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>JIe(this.store,t))})}getAggregateResults(e){return ir(this,void 0,void 0,function*(){return function(n,e){const t=new Set;e.some(l=>(n.has(l.subject.id)&&t.add(l.object.id),!1),null,gi.donor,null,null);const i=new Set;e.some(l=>(t.has(l.subject.id)&&i.add(l.object.id),!1),null,gi.providerUUID,null,null);const r=new Set;e.forSubjects(l=>{n.has(l.id)&&r.add(l.id)},gi.spatialEntity,null,null);const s=new Set;e.some(l=>(r.has(l.subject.id)&&s.add(l.object.id),!1),null,gi.sections,null,null);const o=new Set;return e.some(l=>{const c=l.subject;return(r.has(c.id)||s.has(c.id))&&o.add(l.object.id),!1},null,gi.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:t.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([l,c])=>({label:l,count:c}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return ir(this,void 0,void 0,function*(){return function(n,e){const t=new Map;e.some(r=>(n.has(r.subject.id)&&(t.has(r.object.id)?t.get(r.object.id).push(r.subject.id):t.set(r.object.id,[r.subject.id])),!1),null,gi.spatialEntity,null,null);const i={};return e.some(r=>{var s,o;if(t.has(r.subject.id)){const a=null!==(o=null===(s=t.get(r.subject.id))||void 0===s?void 0:s.length)&&void 0!==o?o:0;i[r.object.id]=a+(i[r.object.id]||0)}return!1},null,lr.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store)})}getOntologyTreeModel(){return ir(this,void 0,void 0,function*(){return function(n){const e={root:g7.body.id,nodes:{}},t=new Set;n.some(i=>(t.add(i.subject.id),t.add(i.predicate.id),!1),null,lr.ontologyNode.parent,null,null);for(const i of t)e.nodes[i]=HIe(n,i);return e}(this.store)})}getReferenceOrgans(){return ir(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return ir(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return ir(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}}function iRe(n,e){return n===e}let rRe=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new S,this.dataSource=i.getOption("data").pipe(me(r=>Object.assign(Object.assign({},h7),{dataSources:r})),Ui(r=>Object.keys(r).length>0),me(r=>r),$u(iRe),Ur(r=>function(n,e){return new F(t=>{let i,r;try{i=n()}catch(a){return void t.error(a)}try{r=e(i)}catch(a){return void t.error(a)}const o=(r?Pe(r):Lc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),ka(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Ur(i=>i.getTissueBlockResults(t)),Yi(1))}getAggregateResults(t){return this.dataSource.pipe(Ur(i=>i.getAggregateResults(t)),Yi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Ur(i=>i.getOntologyTermOccurences(t)),Yi(1))}getOntologyTreeModel(){return this.dataSource.pipe(Ur(t=>t.getOntologyTreeModel()),Yi(1))}getReferenceOrgans(){return this.dataSource.pipe(Ur(t=>t.getReferenceOrgans()),Yi(1))}getScene(t){return this.dataSource.pipe(Ur(i=>i.getScene(t)),Yi(1))}getOrganScene(t,i){return this.dataSource.pipe(Ur(r=>r.getReferenceOrganScene(t,i)),Yi(1))}createDataSource(){return{source:new tRe,unsubscribe:()=>{}}}connectDataSource(t,i){return ir(this,void 0,void 0,function*(){const r=(new Date).getTime();return yield t.connect(i,!1),Uy.production||(console.info(`Loaded CCF database in ${((new Date).getTime()-r)/1e3}s`),console.log(t)),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(cf),Ie(hv))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),sRe=(()=>{class n{constructor(t,i){this.configState=t,this.source=i,this.data$=this.configState.getOption("data"),this.zoomToID$=this.configState.getOption("zoomToID").pipe(me(r=>`http://purl.org/ccf/1.5/entity/${r}`)),this.highlightID$=this.configState.getOption("highlightID").pipe(me(r=>`http://purl.org/ccf/1.5/entity/${r}`)),this.referenceOrgans$=this.source.getReferenceOrgans(),this.scene$=Uo([this.data$,this.referenceOrgans$,this.source.dataSource]).pipe(Ur(([r,s,o])=>this.chooseScene(r,s))),this.organs$=this.configState.getOption("data").pipe(me(r=>this.selectOrgans(r)),ka(1)),this.filteredOrgans$=Uo([this.organs$,this.referenceOrgans$]).pipe(me(([r,s])=>this.getNeededReferenceOrgans(s,r)),ka(1)),this.filteredScene$=Uo([this.scene$,this.organs$,this.referenceOrgans$]).pipe(me(([r,s,o])=>this.filterSceneNodes(r,s,o)),function(n,e){const t=n.pipe(Vo(""));return i=>Uo([i,t]).pipe(me(([r,s])=>r.map(o=>function(n,e,t){return n.entityId!==e?n:Object.assign(Object.assign({},n),{color:t})}(o,s,e))))}(this.highlightID$,aDe),function(n){const e=n.pipe(Vo(""));return t=>Uo([t,e]).pipe(me(([i,r])=>i.map(s=>function(n,e){return n.entityId!==e?n:Object.assign(Object.assign({},n),{zoomToOnLoad:!0})}(s,r))))}(this.zoomToID$),ka(1))}chooseScene(t,i){var r;const s=null!==(r=null==t?void 0:t.map(a=>{const l=a[l7];return null==l?void 0:l.placement.target}))&&void 0!==r?r:[];if(new Set(s).size>1)return this.source.getScene();if(i){const a=i.find(l=>l["@id"]===s[0]);if(a)return this.source.getOrganScene(a.representation_of,{ontologyTerms:[a.reference_organ],sex:a.sex})}return an([])}selectOrgans(t){const r=(null!=t?t:[]).map(s=>s[l7].placement.target);return new Set(r)}filterSceneNodes(t,i,r){const s=this.getNeededReferenceOrgans(r,i),o=this.getNeededSkins(s),a=new Set([...i,...o]);return t.filter(c=>!c.reference_organ||a.has(c.reference_organ))}getNeededReferenceOrgans(t,i){return t.filter(r=>{var s;return i.has(null!==(s=r.reference_organ)&&void 0!==s?s:"")})}getNeededSkins(t){if(1===t.length)return[];const i=new Set;return t.forEach(r=>{"Female"===r.sex?i.add("http://purl.org/ccf/latest/ccf.owl#VHFSkin"):"Male"===r.sex&&i.add("http://purl.org/ccf/latest/ccf.owl#VHMSkin")}),[...i]}}return n.\u0275fac=function(t){return new(t||n)(Ie(hv),Ie(rRe))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const oRe=["bodyUI"];let aRe=(()=>{class n{constructor(t,i,r){this.configState=t,this.sceneSource=i,this.cdr=r,this.onMouseEnter=new cn,this.onMouseLeave=new cn,this.onClick=new cn,this.data$=this.configState.getOption("data"),this.organs$=this.sceneSource.filteredOrgans$,this.scene$=this.sceneSource.filteredScene$.pipe(Zr(s=>this.reset()))}reset(){var t,i;return ir(this,void 0,void 0,function*(){const{bodyUI:r}=this;yield new Promise(a=>setTimeout(a,200));const s=yield this.organs$.pipe(Yi(1)).toPromise(),o=null!==(i=!!(null===(t=r.scene)||void 0===t?void 0:t.find(a=>a.zoomToOnLoad)))&&void 0!==i&&i;if(r.rotation=0,r.rotationX=0,!o)if(1===s.length){const{x_dimension:a,y_dimension:l,z_dimension:c}=s[0];r.bounds={x:1.25*a/1e3,y:1.25*l/1e3,z:1.25*c/1e3},r.target=[a/1e3/2,l/1e3/2,c/1e3/2]}else r.bounds={x:2.2,y:2,z:.4},r.target=[0,0,0];this.cdr.detectChanges()})}}return n.\u0275fac=function(t){return new(t||n)(Me(hv),Me(sRe),Me(is))},n.\u0275cmp=wn({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&Ms(oRe,7),2&t){let r;Ai(r=Ti())&&(i.bodyUI=r.first)}},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},decls:3,vars:4,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""]],template:function(t,i){1&t&&(Kt(0,"ccf-body-ui",0,1),ui("nodeClick",function(s){return i.onClick.emit(s)})("nodeHoverStart",function(s){return i.onMouseEnter.emit(s)})("nodeHoverStop",function(s){return i.onMouseLeave.emit(s)}),function(n,e){const t=fi();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new Qe("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=mc(i.type)),o=ha(Me);try{const a=rp(!1),l=s();rp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Ft(),r,l)}finally{ha(o)}}(2,"async"),Yt()),2&t&&vn("scene",Ty(2,2,i.scene$))("interactive",!0)},directives:[IMe],pipes:[cE],styles:[".body-ui[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0}),n})();function lRe(n,e){if(1&n){const t=Ft();Kt(0,"ccf-root",1),ui("onMouseEnter",function(r){return ya(t),cr().onMouseEnter.emit(r)})("onMouseLeave",function(r){return ya(t),cr().onMouseLeave.emit(r)})("onClick",function(r){return ya(t),cr().onClick.emit(r)}),Yt()}}function cRe(n){return n.map(e=>({"@id":`http://purl.org/ccf/1.5/entity/${e.id}`,"@type":"http://purl.org/ccf/latest/ccf-entity.owl#Sample","http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity":e.rui_location}))}let uRe=(()=>{class n extends hee{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},Uy.dbOptions),globalThis.dbOptions),parse:{data:cRe}}),this.onMouseEnter=new cn,this.onMouseLeave=new cn,this.onClick=new cn}}return n.\u0275fac=function(t){return new(t||n)(Me(hv),Me(is))},n.\u0275cmp=wn({type:n,selectors:[["ccf-root-wc"]],inputs:{data:"data",highlightID:"highlightID",zoomToID:"zoomToID"},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},features:[Nn],decls:1,vars:1,consts:[[3,"onMouseEnter","onMouseLeave","onClick",4,"ngIf"],[3,"onMouseEnter","onMouseLeave","onClick"]],template:function(t,i){1&t&&function(n,e,t,i,r,s,o,a){const l=Ft(),c=fi(),d=n+20,f=c.firstCreatePass?function(n,e,t,i,r,s,o,a,l){const c=e.consts,d=Pd(e,n,4,o||null,_a(c,a));z_(e,t,d,_a(c,l)),ep(e,d);const f=d.tViews=Fp(2,d,i,r,s,e.directiveRegistry,e.pipeRegistry,null,e.schemas,c);return null!==e.queries&&(e.queries.template(e,d),f.queries=e.queries.embeddedTView(d)),d}(d,c,l,e,t,i,r,s,o):c.data[d];Qa(f,!1);const p=l[11].createComment("");Mp(c,l,p,f),xs(p,l),Lp(l,l[d]=iw(p,l,p,f)),cd(f)&&Kh(c,l,f),null!=o&&U_(l,f,a)}(0,lRe,1,0,"ccf-root",0),2&t&&vn("ngIf",i.initialized)},directives:[Ru,aRe],encapsulation:2,changeDetection:0}),n})(),dRe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[ls,Ga,zG,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(ls,2),Ie(Ga,2))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();const C1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class pRe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=Mf(this.action),i=function(n){return C1(n.getHours(),2)+":"+C1(n.getMinutes(),2)+":"+C1(n.getSeconds(),2)+"."+C1(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class gRe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const S7=new Vt("NGXS_LOGGER_PLUGIN_OPTIONS");let mRe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new gRe(this._options),this._store=this._store||this._injector.get(ih);const s=new pRe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Zr(o=>{s.completed(o)}),lc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(S7),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const x7=new Vt("LOGGER_USER_OPTIONS");function _Re(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let yRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:Q4,useClass:mRe,multi:!0},{provide:x7,useValue:t},{provide:S7,useFactory:_Re,deps:[x7]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();const vRe=[hv];let bRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({imports:[[dRe.forRoot(),la.forRoot(vRe,{developmentMode:!Uy.production}),yRe.forRoot({disabled:Uy.production})]]}),n})(),wRe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(fl).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new oee(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends lee{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(uRe,{injector:this.injector});customElements.define("ccf-body-ui-wc",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:[],imports:[[YM,bRe,RMe]]}),n})();Uy.production&&function(){if(xk)throw new Error("Cannot enable prod mode after platform setup.");Sk=!1}(),DJ().bootstrapModule(wRe).catch(n=>console.error(n))},52:kt=>{function it(gt,J,At,dt,K,Ae,he){try{var q=gt[Ae](he),V=q.value}catch(L){return void At(L)}q.done?J(V):Promise.resolve(V).then(dt,K)}kt.exports=function(gt){return function(){var J=this,At=arguments;return new Promise(function(dt,K){var Ae=gt.apply(J,At);function he(V){it(Ae,dt,K,he,q,"next",V)}function q(V){it(Ae,dt,K,he,q,"throw",V)}he(void 0)})}},kt.exports.default=kt.exports,kt.exports.__esModule=!0},948:kt=>{kt.exports=function(tt){return tt&&tt.__esModule?tt:{default:tt}},kt.exports.default=kt.exports,kt.exports.__esModule=!0},321:kt=>{function it(tt){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(kt.exports=it=function(J){return typeof J},kt.exports.default=kt.exports,kt.exports.__esModule=!0):(kt.exports=it=function(J){return J&&"function"==typeof Symbol&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},kt.exports.default=kt.exports,kt.exports.__esModule=!0),it(tt)}kt.exports=it,kt.exports.default=kt.exports,kt.exports.__esModule=!0},380:kt=>{function it(tt){return Promise.resolve().then(()=>{var gt=new Error("Cannot find module '"+tt+"'");throw gt.code="MODULE_NOT_FOUND",gt})}it.keys=()=>[],it.resolve=it,it.id=380,kt.exports=it},521:()=>{},125:()=>{},307:()=>{}},kt=>{kt(kt.s=18)}]); \ No newline at end of file +var ERe=Object.defineProperty,SRe=Object.defineProperties,xRe=Object.getOwnPropertyDescriptors,A1=Object.getOwnPropertySymbols,A7=Object.prototype.hasOwnProperty,T7=Object.prototype.propertyIsEnumerable,_r=Math.pow,M7=(kt,it,tt)=>it in kt?ERe(kt,it,{enumerable:!0,configurable:!0,writable:!0,value:tt}):kt[it]=tt,ht=(kt,it)=>{for(var tt in it||(it={}))A7.call(it,tt)&&M7(kt,tt,it[tt]);if(A1)for(var tt of A1(it))T7.call(it,tt)&&M7(kt,tt,it[tt]);return kt},Un=(kt,it)=>SRe(kt,xRe(it)),D7=(kt,it)=>{var tt={};for(var gt in kt)A7.call(kt,gt)&&it.indexOf(gt)<0&&(tt[gt]=kt[gt]);if(null!=kt&&A1)for(var gt of A1(kt))it.indexOf(gt)<0&&T7.call(kt,gt)&&(tt[gt]=kt[gt]);return tt};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(kt,it,tt)=>{var gt=tt(52).default;kt.exports=function K(Ae,he,q){function V($,b){if(!he[$]){if(!Ae[$]){if(L)return L($,!0);var O=new Error("Cannot find module '"+$+"'");throw O.code="MODULE_NOT_FOUND",O}var T=he[$]={exports:{}};Ae[$][0].call(T.exports,function(v){return V(Ae[$][1][v]||v)},T,T.exports,K,Ae,he,q)}return he[$].exports}for(var L=void 0,re=0;re0&&z[z.length-1])&&(6===Pe[0]||2===Pe[0])){Ue=0;continue}if(3===Pe[0]&&(!z||Pe[1]>z[0]&&Pe[1]0?Y-4:Y;for(U=0;U>16&255,F[Q++]=I>>8&255,F[Q++]=255&I;return 2===D&&(I=V[j.charCodeAt(U)]<<2|V[j.charCodeAt(U+1)]>>4,F[Q++]=255&I),1===D&&(I=V[j.charCodeAt(U)]<<10|V[j.charCodeAt(U+1)]<<4|V[j.charCodeAt(U+2)]>>2,F[Q++]=I>>8&255,F[Q++]=255&I),F},he.fromByteArray=function(j){for(var I,H=j.length,Y=H%3,D=[],F=16383,Q=0,E=H-Y;QE?E:Q+F));return 1===Y?D.push(q[(I=j[H-1])>>2]+q[I<<4&63]+"=="):2===Y&&D.push(q[(I=(j[H-2]<<8)+j[H-1])>>10]+q[I>>4&63]+q[I<<2&63]+"="),D.join("")};for(var q=[],V=[],L="undefined"!=typeof Uint8Array?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,b=re.length;$0)throw new Error("Invalid string. Length must be a multiple of 4");var H=j.indexOf("=");return-1===H&&(H=I),[H,H===I?0:4-H%4]}function y(j){return q[j>>18&63]+q[j>>12&63]+q[j>>6&63]+q[63&j]}function w(j,I,H){for(var D=[],F=I;F>5==6?2:D>>4==14?3:D>>3==30?4:D>>6==2?-1:-2}function T(D){var F=this.lastTotal-this.lastNeed,Q=function(D,F,Q){if(128!=(192&F[0]))return D.lastNeed=0,"\ufffd";if(D.lastNeed>1&&F.length>1){if(128!=(192&F[1]))return D.lastNeed=1,"\ufffd";if(D.lastNeed>2&&F.length>2&&128!=(192&F[2]))return D.lastNeed=2,"\ufffd"}}(this,D);return void 0!==Q?Q:this.lastNeed<=D.length?(D.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(D.copy(this.lastChar,F,0,D.length),void(this.lastNeed-=D.length))}function w(D,F){if((D.length-F)%2==0){var Q=D.toString("utf16le",F);if(Q){var E=Q.charCodeAt(Q.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],Q.slice(0,-1)}return Q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",F,D.length-1)}function M(D){var F=D&&D.length?this.write(D):"";return this.lastNeed?F+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):F}function j(D,F){var Q=(D.length-F)%3;return 0===Q?D.toString("base64",F):(this.lastNeed=3-Q,this.lastTotal=3,1===Q?this.lastChar[0]=D[D.length-1]:(this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1]),D.toString("base64",F,D.length-Q))}function I(D){var F=D&&D.length?this.write(D):"";return this.lastNeed?F+this.lastChar.toString("base64",0,3-this.lastNeed):F}function H(D){return D.toString(this.encoding)}function Y(D){return D&&D.length?this.write(D):""}he.StringDecoder=$,$.prototype.write=function(D){if(0===D.length)return"";var F,Q;if(this.lastNeed){if(void 0===(F=this.fillLast(D)))return"";Q=this.lastNeed,this.lastNeed=0}else Q=0;return Q=0?(U>0&&(D.lastNeed=U-1),U):--E=0?(U>0&&(D.lastNeed=U-2),U):--E=0?(U>0&&(2===U?U=0:D.lastNeed=U-3),U):0}(this,D,F);if(!this.lastNeed)return D.toString("utf8",F);this.lastTotal=Q;var E=D.length-(Q-this.lastNeed);return D.copy(this.lastChar,0,E),D.toString("utf8",F,E)},$.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length}},{"safe-buffer":4}],6:[function(K,Ae,he){(function(q){(function(){"use strict";var V=K("base64-js"),L=K("ieee754");he.Buffer=S,he.SlowBuffer=function(B){return+B!=B&&(B=0),S.alloc(+B)},he.INSPECT_MAX_BYTES=50;var re=2147483647;function b(B){if(B>re)throw new RangeError('The value "'+B+'" is invalid for option "size"');var R=new Uint8Array(B);return R.__proto__=S.prototype,R}function S(B,R,k){if("number"==typeof B){if("string"==typeof R)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return O(B,R,k)}function O(B,R,k){if("string"==typeof B)return function(B,R){if(("string"!=typeof R||""===R)&&(R="utf8"),!S.isEncoding(R))throw new TypeError("Unknown encoding: "+R);var k=0|D(B,R),Oe=b(k),Xe=Oe.write(B,R);return Xe!==k&&(Oe=Oe.slice(0,Xe)),Oe}(B,R);if(ArrayBuffer.isView(B))return M(B);if(null==B)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(pt(B,ArrayBuffer)||B&&pt(B.buffer,ArrayBuffer))return function(B,R,k){if(R<0||B.byteLength=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return 0|B}function D(B,R){if(S.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||pt(B,ArrayBuffer))return B.byteLength;if("string"!=typeof B)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var k=B.length,Oe=arguments.length>2&&!0===arguments[2];if(!Oe&&0===k)return 0;for(var Xe=!1;;)switch(R){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return X(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Pe(B).length;default:if(Xe)return Oe?-1:X(B).length;R=(""+R).toLowerCase(),Xe=!0}}function F(B,R,k){var Oe=!1;if((void 0===R||R<0)&&(R=0),R>this.length||((void 0===k||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(R>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return Je(this,R,k);case"utf8":case"utf-8":return ye(this,R,k);case"ascii":return nt(this,R,k);case"latin1":case"binary":return Ze(this,R,k);case"base64":return te(this,R,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,R,k);default:if(Oe)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Oe=!0}}function Q(B,R,k){var Oe=B[R];B[R]=B[k],B[k]=Oe}function E(B,R,k,Oe,Xe){if(0===B.length)return-1;if("string"==typeof k?(Oe=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),fe(k=+k)&&(k=Xe?0:B.length-1),k<0&&(k=B.length+k),k>=B.length){if(Xe)return-1;k=B.length-1}else if(k<0){if(!Xe)return-1;k=0}if("string"==typeof R&&(R=S.from(R,Oe)),S.isBuffer(R))return 0===R.length?-1:U(B,R,k,Oe,Xe);if("number"==typeof R)return R&=255,"function"==typeof Uint8Array.prototype.indexOf?Xe?Uint8Array.prototype.indexOf.call(B,R,k):Uint8Array.prototype.lastIndexOf.call(B,R,k):U(B,[R],k,Oe,Xe);throw new TypeError("val must be string, number or Buffer")}function U(B,R,k,Oe,Xe){var Gn,yt=1,It=B.length,Tn=R.length;if(void 0!==Oe&&("ucs2"===(Oe=String(Oe).toLowerCase())||"ucs-2"===Oe||"utf16le"===Oe||"utf-16le"===Oe)){if(B.length<2||R.length<2)return-1;yt=2,It/=2,Tn/=2,k/=2}function Pn(Ns,cs){return 1===yt?Ns[cs]:Ns.readUInt16BE(cs*yt)}if(Xe){var yi=-1;for(Gn=k;GnIt&&(k=It-Tn),Gn=k;Gn>=0;Gn--){for(var hi=!0,Hr=0;HrXe&&(Oe=Xe):Oe=Xe;var yt=R.length;Oe>yt/2&&(Oe=yt/2);for(var It=0;It>8,yt.push(k%256),yt.push(Oe);return yt}(R,B.length-k),B,k,Oe)}function te(B,R,k){return V.fromByteArray(0===R&&k===B.length?B:B.slice(R,k))}function ye(B,R,k){k=Math.min(B.length,k);for(var Oe=[],Xe=R;Xe239?4:yt>223?3:yt>191?2:1;if(Xe+Tn<=k)switch(Tn){case 1:yt<128&&(It=yt);break;case 2:128==(192&(Pn=B[Xe+1]))&&(hi=(31&yt)<<6|63&Pn)>127&&(It=hi);break;case 3:Gn=B[Xe+2],128==(192&(Pn=B[Xe+1]))&&128==(192&Gn)&&(hi=(15&yt)<<12|(63&Pn)<<6|63&Gn)>2047&&(hi<55296||hi>57343)&&(It=hi);break;case 4:Gn=B[Xe+2],yi=B[Xe+3],128==(192&(Pn=B[Xe+1]))&&128==(192&Gn)&&128==(192&yi)&&(hi=(15&yt)<<18|(63&Pn)<<12|(63&Gn)<<6|63&yi)>65535&&hi<1114112&&(It=hi)}null===It?(It=65533,Tn=1):It>65535&&(Oe.push((It-=65536)>>>10&1023|55296),It=56320|1023&It),Oe.push(It),Xe+=Tn}return function(B){var R=B.length;if(R<=4096)return String.fromCharCode.apply(String,B);for(var k="",Oe=0;Oek&&(R+=" ... "),""},S.prototype.compare=function(R,k,Oe,Xe,yt){if(pt(R,Uint8Array)&&(R=S.from(R,R.offset,R.byteLength)),!S.isBuffer(R))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof R);if(void 0===k&&(k=0),void 0===Oe&&(Oe=R?R.length:0),void 0===Xe&&(Xe=0),void 0===yt&&(yt=this.length),k<0||Oe>R.length||Xe<0||yt>this.length)throw new RangeError("out of range index");if(Xe>=yt&&k>=Oe)return 0;if(Xe>=yt)return-1;if(k>=Oe)return 1;if(this===R)return 0;for(var It=(yt>>>=0)-(Xe>>>=0),Tn=(Oe>>>=0)-(k>>>=0),Pn=Math.min(It,Tn),Gn=this.slice(Xe,yt),yi=R.slice(k,Oe),hi=0;hi>>=0,isFinite(Oe)?(Oe>>>=0,void 0===Xe&&(Xe="utf8")):(Xe=Oe,Oe=void 0)}var yt=this.length-k;if((void 0===Oe||Oe>yt)&&(Oe=yt),R.length>0&&(Oe<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");Xe||(Xe="utf8");for(var It=!1;;)switch(Xe){case"hex":return ie(this,R,k,Oe);case"utf8":case"utf-8":return ue(this,R,k,Oe);case"ascii":return ee(this,R,k,Oe);case"latin1":case"binary":return se(this,R,k,Oe);case"base64":return Te(this,R,k,Oe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,R,k,Oe);default:if(It)throw new TypeError("Unknown encoding: "+Xe);Xe=(""+Xe).toLowerCase(),It=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(B,R,k){var Oe="";k=Math.min(B.length,k);for(var Xe=R;XeOe)&&(k=Oe);for(var Xe="",yt=R;ytk)throw new RangeError("Trying to access beyond buffer length")}function Le(B,R,k,Oe,Xe,yt){if(!S.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(R>Xe||RB.length)throw new RangeError("Index out of range")}function Ee(B,R,k,Oe,Xe,yt){if(k+Oe>B.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Re(B,R,k,Oe,Xe){return R=+R,k>>>=0,Xe||Ee(B,0,k,4),L.write(B,R,k,Oe,23,4),k+4}function Ue(B,R,k,Oe,Xe){return R=+R,k>>>=0,Xe||Ee(B,0,k,8),L.write(B,R,k,Oe,52,8),k+8}S.prototype.slice=function(R,k){var Oe=this.length;(R=~~R)<0?(R+=Oe)<0&&(R=0):R>Oe&&(R=Oe),(k=void 0===k?Oe:~~k)<0?(k+=Oe)<0&&(k=0):k>Oe&&(k=Oe),k>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R],yt=1,It=0;++It>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R+--k],yt=1;k>0&&(yt*=256);)Xe+=this[R+--k]*yt;return Xe},S.prototype.readUInt8=function(R,k){return R>>>=0,k||je(R,1,this.length),this[R]},S.prototype.readUInt16LE=function(R,k){return R>>>=0,k||je(R,2,this.length),this[R]|this[R+1]<<8},S.prototype.readUInt16BE=function(R,k){return R>>>=0,k||je(R,2,this.length),this[R]<<8|this[R+1]},S.prototype.readUInt32LE=function(R,k){return R>>>=0,k||je(R,4,this.length),(this[R]|this[R+1]<<8|this[R+2]<<16)+16777216*this[R+3]},S.prototype.readUInt32BE=function(R,k){return R>>>=0,k||je(R,4,this.length),16777216*this[R]+(this[R+1]<<16|this[R+2]<<8|this[R+3])},S.prototype.readIntLE=function(R,k,Oe){R>>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R],yt=1,It=0;++It=(yt*=128)&&(Xe-=Math.pow(2,8*k)),Xe},S.prototype.readIntBE=function(R,k,Oe){R>>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=k,yt=1,It=this[R+--Xe];Xe>0&&(yt*=256);)It+=this[R+--Xe]*yt;return It>=(yt*=128)&&(It-=Math.pow(2,8*k)),It},S.prototype.readInt8=function(R,k){return R>>>=0,k||je(R,1,this.length),128&this[R]?-1*(255-this[R]+1):this[R]},S.prototype.readInt16LE=function(R,k){R>>>=0,k||je(R,2,this.length);var Oe=this[R]|this[R+1]<<8;return 32768&Oe?4294901760|Oe:Oe},S.prototype.readInt16BE=function(R,k){R>>>=0,k||je(R,2,this.length);var Oe=this[R+1]|this[R]<<8;return 32768&Oe?4294901760|Oe:Oe},S.prototype.readInt32LE=function(R,k){return R>>>=0,k||je(R,4,this.length),this[R]|this[R+1]<<8|this[R+2]<<16|this[R+3]<<24},S.prototype.readInt32BE=function(R,k){return R>>>=0,k||je(R,4,this.length),this[R]<<24|this[R+1]<<16|this[R+2]<<8|this[R+3]},S.prototype.readFloatLE=function(R,k){return R>>>=0,k||je(R,4,this.length),L.read(this,R,!0,23,4)},S.prototype.readFloatBE=function(R,k){return R>>>=0,k||je(R,4,this.length),L.read(this,R,!1,23,4)},S.prototype.readDoubleLE=function(R,k){return R>>>=0,k||je(R,8,this.length),L.read(this,R,!0,52,8)},S.prototype.readDoubleBE=function(R,k){return R>>>=0,k||je(R,8,this.length),L.read(this,R,!1,52,8)},S.prototype.writeUIntLE=function(R,k,Oe,Xe){R=+R,k>>>=0,Oe>>>=0,Xe||Le(this,R,k,Oe,Math.pow(2,8*Oe)-1,0);var It=1,Tn=0;for(this[k]=255&R;++Tn>>=0,Oe>>>=0,Xe||Le(this,R,k,Oe,Math.pow(2,8*Oe)-1,0);var It=Oe-1,Tn=1;for(this[k+It]=255&R;--It>=0&&(Tn*=256);)this[k+It]=R/Tn&255;return k+Oe},S.prototype.writeUInt8=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,1,255,0),this[k]=255&R,k+1},S.prototype.writeUInt16LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,65535,0),this[k]=255&R,this[k+1]=R>>>8,k+2},S.prototype.writeUInt16BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,65535,0),this[k]=R>>>8,this[k+1]=255&R,k+2},S.prototype.writeUInt32LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,4294967295,0),this[k+3]=R>>>24,this[k+2]=R>>>16,this[k+1]=R>>>8,this[k]=255&R,k+4},S.prototype.writeUInt32BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,4294967295,0),this[k]=R>>>24,this[k+1]=R>>>16,this[k+2]=R>>>8,this[k+3]=255&R,k+4},S.prototype.writeIntLE=function(R,k,Oe,Xe){if(R=+R,k>>>=0,!Xe){var yt=Math.pow(2,8*Oe-1);Le(this,R,k,Oe,yt-1,-yt)}var It=0,Tn=1,Pn=0;for(this[k]=255&R;++It>0)-Pn&255;return k+Oe},S.prototype.writeIntBE=function(R,k,Oe,Xe){if(R=+R,k>>>=0,!Xe){var yt=Math.pow(2,8*Oe-1);Le(this,R,k,Oe,yt-1,-yt)}var It=Oe-1,Tn=1,Pn=0;for(this[k+It]=255&R;--It>=0&&(Tn*=256);)R<0&&0===Pn&&0!==this[k+It+1]&&(Pn=1),this[k+It]=(R/Tn>>0)-Pn&255;return k+Oe},S.prototype.writeInt8=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,1,127,-128),R<0&&(R=255+R+1),this[k]=255&R,k+1},S.prototype.writeInt16LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,32767,-32768),this[k]=255&R,this[k+1]=R>>>8,k+2},S.prototype.writeInt16BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,32767,-32768),this[k]=R>>>8,this[k+1]=255&R,k+2},S.prototype.writeInt32LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,2147483647,-2147483648),this[k]=255&R,this[k+1]=R>>>8,this[k+2]=R>>>16,this[k+3]=R>>>24,k+4},S.prototype.writeInt32BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,2147483647,-2147483648),R<0&&(R=4294967295+R+1),this[k]=R>>>24,this[k+1]=R>>>16,this[k+2]=R>>>8,this[k+3]=255&R,k+4},S.prototype.writeFloatLE=function(R,k,Oe){return Re(this,R,k,!0,Oe)},S.prototype.writeFloatBE=function(R,k,Oe){return Re(this,R,k,!1,Oe)},S.prototype.writeDoubleLE=function(R,k,Oe){return Ue(this,R,k,!0,Oe)},S.prototype.writeDoubleBE=function(R,k,Oe){return Ue(this,R,k,!1,Oe)},S.prototype.copy=function(R,k,Oe,Xe){if(!S.isBuffer(R))throw new TypeError("argument should be a Buffer");if(Oe||(Oe=0),!Xe&&0!==Xe&&(Xe=this.length),k>=R.length&&(k=R.length),k||(k=0),Xe>0&&Xe=this.length)throw new RangeError("Index out of range");if(Xe<0)throw new RangeError("sourceEnd out of bounds");Xe>this.length&&(Xe=this.length),R.length-k=0;--It)R[It+k]=this[It+Oe];else Uint8Array.prototype.set.call(R,this.subarray(Oe,Xe),k);return yt},S.prototype.fill=function(R,k,Oe,Xe){if("string"==typeof R){if("string"==typeof k?(Xe=k,k=0,Oe=this.length):"string"==typeof Oe&&(Xe=Oe,Oe=this.length),void 0!==Xe&&"string"!=typeof Xe)throw new TypeError("encoding must be a string");if("string"==typeof Xe&&!S.isEncoding(Xe))throw new TypeError("Unknown encoding: "+Xe);if(1===R.length){var yt=R.charCodeAt(0);("utf8"===Xe&&yt<128||"latin1"===Xe)&&(R=yt)}}else"number"==typeof R&&(R&=255);if(k<0||this.length>>=0,Oe=void 0===Oe?this.length:Oe>>>0,R||(R=0),"number"==typeof R)for(It=k;It55295&&k<57344){if(!Xe){if(k>56319){(R-=3)>-1&&yt.push(239,191,189);continue}if(It+1===Oe){(R-=3)>-1&&yt.push(239,191,189);continue}Xe=k;continue}if(k<56320){(R-=3)>-1&&yt.push(239,191,189),Xe=k;continue}k=65536+(Xe-55296<<10|k-56320)}else Xe&&(R-=3)>-1&&yt.push(239,191,189);if(Xe=null,k<128){if((R-=1)<0)break;yt.push(k)}else if(k<2048){if((R-=2)<0)break;yt.push(k>>6|192,63&k|128)}else if(k<65536){if((R-=3)<0)break;yt.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((R-=4)<0)break;yt.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return yt}function Pe(B){return V.toByteArray(function(B){if((B=(B=B.split("=")[0]).trim().replace(qe,"")).length<2)return"";for(;B.length%4!=0;)B+="=";return B}(B))}function wt(B,R,k,Oe){for(var Xe=0;Xe=R.length||Xe>=B.length);++Xe)R[Xe+k]=B[Xe];return Xe}function pt(B,R){return B instanceof R||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===R.name}function fe(B){return B!=B}}).call(this)}).call(this,K("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(K,Ae,he){"use strict";Ae.exports=function q(V){return null===V||"object"!=typeof V||null!=V.toJSON?JSON.stringify(V):Array.isArray(V)?"["+V.reduce((L,re,$)=>L+(0===$?"":",")+q(void 0===re||"symbol"==typeof re?null:re),"")+"]":"{"+Object.keys(V).sort().reduce((L,re,$)=>void 0===V[re]||"symbol"==typeof V[re]?L:L+(0===L.length?"":",")+q(re)+":"+q(V[re]),"")+"}"}},{}],8:[function(K,Ae,he){"use strict";var L,q="object"==typeof Reflect?Reflect:null,V=q&&"function"==typeof q.apply?q.apply:function(U,ie,ue){return Function.prototype.apply.call(U,ie,ue)};L=q&&"function"==typeof q.ownKeys?q.ownKeys:Object.getOwnPropertySymbols?function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:function(U){return Object.getOwnPropertyNames(U)};var $=Number.isNaN||function(U){return U!=U};function b(){b.init.call(this)}Ae.exports=b,Ae.exports.once=function(E,U){return new Promise(function(ie,ue){function ee(Te){E.removeListener(U,se),ue(Te)}function se(){"function"==typeof E.removeListener&&E.removeListener("error",ee),ie([].slice.call(arguments))}Q(E,U,se,{once:!0}),"error"!==U&&function(E,U,ie){"function"==typeof E.on&&Q(E,"error",U,ie)}(E,ee,{once:!0})})},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var S=10;function O(E){if("function"!=typeof E)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function T(E){return void 0===E._maxListeners?b.defaultMaxListeners:E._maxListeners}function v(E,U,ie,ue){var ee,se,Te;if(O(ie),void 0===(se=E._events)?(se=E._events=Object.create(null),E._eventsCount=0):(void 0!==se.newListener&&(E.emit("newListener",U,ie.listener?ie.listener:ie),se=E._events),Te=se[U]),void 0===Te)Te=se[U]=ie,++E._eventsCount;else if("function"==typeof Te?Te=se[U]=ue?[ie,Te]:[Te,ie]:ue?Te.unshift(ie):Te.push(ie),(ee=T(E))>0&&Te.length>ee&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=U,me.count=Te.length,function(E){console&&console.warn&&console.warn(E)}(me)}return E}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(E,U,ie){var ue={fired:!1,wrapFn:void 0,target:E,type:U,listener:ie},ee=y.bind(ue);return ee.listener=ie,ue.wrapFn=ee,ee}function M(E,U,ie){var ue=E._events;if(void 0===ue)return[];var ee=ue[U];return void 0===ee?[]:"function"==typeof ee?ie?[ee.listener||ee]:[ee]:ie?function(E){for(var U=new Array(E.length),ie=0;ie0&&(Te=ie[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var te=se[U];if(void 0===te)return!1;if("function"==typeof te)V(te,this,ie);else{var ye=te.length,De=I(te,ye);for(ue=0;ue=0;Te--)if(ue[Te]===ie||ue[Te].listener===ie){me=ue[Te].listener,se=Te;break}if(se<0)return this;0===se?ue.shift():function(E,U){for(;U+1=0;ee--)this.removeListener(U,ie[ee]);return this},b.prototype.listeners=function(U){return M(this,U,!0)},b.prototype.rawListeners=function(U){return M(this,U,!1)},b.listenerCount=function(E,U){return"function"==typeof E.listenerCount?E.listenerCount(U):j.call(E,U)},b.prototype.listenerCount=j,b.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},{}],9:[function(K,Ae,he){he.read=function(q,V,L,re,$){var b,S,O=8*$-re-1,T=(1<>1,y=-7,w=L?$-1:0,M=L?-1:1,j=q[V+w];for(w+=M,b=j&(1<<-y)-1,j>>=-y,y+=O;y>0;b=256*b+q[V+w],w+=M,y-=8);for(S=b&(1<<-y)-1,b>>=-y,y+=re;y>0;S=256*S+q[V+w],w+=M,y-=8);if(0===b)b=1-v;else{if(b===T)return S?NaN:1/0*(j?-1:1);S+=Math.pow(2,re),b-=v}return(j?-1:1)*S*Math.pow(2,b-re)},he.write=function(q,V,L,re,$,b){var S,O,T,v=8*b-$-1,y=(1<>1,M=23===$?Math.pow(2,-24)-Math.pow(2,-77):0,j=re?0:b-1,I=re?1:-1,H=V<0||0===V&&1/V<0?1:0;for(V=Math.abs(V),isNaN(V)||V===1/0?(O=isNaN(V)?1:0,S=y):(S=Math.floor(Math.log(V)/Math.LN2),V*(T=Math.pow(2,-S))<1&&(S--,T*=2),(V+=S+w>=1?M/T:M*Math.pow(2,1-w))*T>=2&&(S++,T/=2),S+w>=y?(O=0,S=y):S+w>=1?(O=(V*T-1)*Math.pow(2,$),S+=w):(O=V*Math.pow(2,w-1)*Math.pow(2,$),S=0));$>=8;q[L+j]=255&O,j+=I,O/=256,$-=8);for(S=S<<$|O,v+=$;v>0;q[L+j]=255&S,j+=I,S/=256,v-=8);q[L+j-I]|=128*H}},{}],10:[function(K,Ae,he){Ae.exports="function"==typeof Object.create?function(V,L){L&&(V.super_=L,V.prototype=Object.create(L.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}))}:function(V,L){if(L){V.super_=L;var re=function(){};re.prototype=L.prototype,V.prototype=new re,V.prototype.constructor=V}}},{}],11:[function(K,Ae,he){"use strict";const{isArray:q,isObject:V,isString:L}=K("./types"),{asArray:re}=K("./util"),{prependBase:$}=K("./url"),b=K("./JsonLdError"),S=K("./ResolvedContext");function T(y){throw new b("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function v({context:y,base:w}){if(!y)return;const M=y["@context"];if(L(M))y["@context"]=$(w,M);else if(q(M))for(let j=0;j10)throw new b("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"loading remote context failed":"context overflow",max:10});if(I.has(M))throw new b("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"recursive context inclusion":"context overflow",url:M});let H,Y;I.add(M);try{Y=yield j(M),H=Y.document||null,L(H)&&(H=JSON.parse(H))}catch(D){throw new b("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:M,cause:D})}if(!V(H))throw new b("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:M});return H="@context"in H?{"@context":H["@context"]}:{"@context":{}},Y.contextUrl&&(q(H["@context"])||(H["@context"]=[H["@context"]]),H["@context"].push(Y.contextUrl)),{context:H,remoteDoc:Y}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(K,Ae,he){"use strict";Ae.exports=class extends Error{constructor(V="An unspecified JSON-LD error occurred.",L="jsonld.Error",re={}){super(V),this.name=L,this.message=V,this.details=re}}},{}],13:[function(K,Ae,he){"use strict";Ae.exports=q=>{class V{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(V,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(V.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:V}),V.compact=function(L,re){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):q.compact(L,re)},V.expand=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):q.expand(L)},V.flatten=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):q.flatten(L)},V}},{}],14:[function(K,Ae,he){"use strict";Ae.exports=K("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(K,Ae,he){"use strict";Ae.exports=class{constructor(){this._requests={}}wrapLoader(V){const L=this;return L._loader=V,function(){return L.add.apply(L,arguments)}}add(V){var L=this;return gt(function*(){let re=L._requests[V];if(re)return Promise.resolve(re);re=L._requests[V]=L._loader(V);try{return yield re}finally{delete L._requests[V]}})()}}},{}],16:[function(K,Ae,he){"use strict";const q=K("lru-cache");Ae.exports=class{constructor({document:re}){this.document=re,this.cache=new q({max:10})}getProcessed(re){return this.cache.get(re)}setProcessed(re,$){this.cache.set(re,$)}}},{"lru-cache":33}],17:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),{isArray:V,isObject:L,isString:re,isUndefined:$}=K("./types"),{isList:b,isValue:S,isGraph:O,isSimpleGraph:T,isSubjectReference:v}=K("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:M,process:j,processingMode:I}=K("./context"),{removeBase:H,prependBase:Y}=K("./url"),{addValue:D,asArray:F,compareShortestLeast:Q}=K("./util"),E={};function ie(ue,ee,se){if("@nest"!==y(ue,ee,{vocab:!0},se))throw new q("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ae.exports=E,E.compact=function(){var ue=gt(function*({activeCtx:ee,activeProperty:se=null,element:Te,options:me={},compactionMap:te=(()=>{})}){if(V(Te)){let De=[];for(let Ve=0;Ve1&&(Je=Array.from(Je).sort());const Ye=ee;for(const Le of Je){const Ee=E.compactIri({activeCtx:Ye,iri:Le,relativeTo:{vocab:!0}}),Re=w(nt,Ee,"@context");$(Re)||(ee=yield j({activeCtx:ee,localCtx:Re,options:me,propagate:!1}))}const je=Object.keys(Te).sort();for(const Le of je){const Ee=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&M(Le)){const Re=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Re,Ee)}else{if(!V(Ee))throw new q("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ee.length){const Re=E.compactIri({activeCtx:ee,iri:Le,value:Ee,relativeTo:{vocab:!0},reverse:De}),Ue=ee.mappings.has(Re)?ee.mappings.get(Re)["@nest"]:null;let qe=Ve;Ue&&(ie(ee,Ue,me),L(Ve[Ue])||(Ve[Ue]={}),qe=Ve[Ue]),D(qe,Re,Ee,{propertyIsArray:!0})}for(const Re of Ee){const Ue=E.compactIri({activeCtx:ee,iri:Le,value:Re,relativeTo:{vocab:!0},reverse:De}),qe=ee.mappings.has(Ue)?ee.mappings.get(Ue)["@nest"]:null;let Be=Ve;qe&&(ie(ee,qe,me),L(Ve[qe])||(Ve[qe]={}),Be=Ve[qe]);const z=w(ee,Ue,"@container")||[],X=O(Re),be=b(Re);let ce;be?ce=Re["@list"]:X&&(ce=Re["@graph"]);let Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:be||X?ce:Re,options:me,compactionMap:te});if(be){if(V(Pe)||(Pe=[Pe]),z.includes("@list")){D(Be,Ue,Pe,{valueIsArray:!0,allowDuplicate:!0});continue}Pe={[E.compactIri({activeCtx:ee,iri:"@list",relativeTo:{vocab:!0}})]:Pe},"@index"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Re["@index"])}if(X)if(z.includes("@graph")&&(z.includes("@id")||z.includes("@index")&&T(Re))){let wt;Be.hasOwnProperty(Ue)?wt=Be[Ue]:Be[Ue]=wt={};const pt=(z.includes("@id")?Re["@id"]:Re["@index"])||E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}});D(wt,pt,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})}else z.includes("@graph")&&T(Re)?(V(Pe)&&Pe.length>1&&(Pe={"@included":Pe}),D(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})):(V(Pe)&&1===Pe.length&&me.compactArrays&&(Pe=Pe[0]),Pe={[E.compactIri({activeCtx:ee,iri:"@graph",relativeTo:{vocab:!0}})]:Pe},"@id"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Re["@id"]),"@index"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Re["@index"]),D(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")}));else if(z.includes("@language")||z.includes("@index")||z.includes("@id")||z.includes("@type")){let wt,pt;if(Be.hasOwnProperty(Ue)?wt=Be[Ue]:Be[Ue]=wt={},z.includes("@language"))S(Pe)&&(Pe=Pe["@value"]),pt=Re["@language"];else if(z.includes("@index")){const fe=w(ee,Ue,"@index")||"@index",B=E.compactIri({activeCtx:ee,iri:fe,relativeTo:{vocab:!0}});if("@index"===fe)pt=Re["@index"],delete Pe[B];else{let R;if([pt,...R]=F(Pe[fe]||[]),re(pt))switch(R.length){case 0:delete Pe[fe];break;case 1:Pe[fe]=R[0];break;default:Pe[fe]=R}else pt=null}}else if(z.includes("@id")){const fe=E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}});pt=Pe[fe],delete Pe[fe]}else if(z.includes("@type")){const fe=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=F(Pe[fe]||[]),B.length){case 0:delete Pe[fe];break;case 1:Pe[fe]=B[0];break;default:Pe[fe]=B}1===Object.keys(Pe).length&&"@id"in Re&&(Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:{"@id":Re["@id"]},options:me,compactionMap:te}))}pt||(pt=E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}})),D(wt,pt,Pe,{propertyIsArray:z.includes("@set")})}else{const wt=!me.compactArrays||z.includes("@set")||z.includes("@list")||V(Pe)&&0===Pe.length||"@list"===Le||"@graph"===Le;D(Be,Ue,Pe,{propertyIsArray:wt})}}}else{if((w(ee,se,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Ue,Ee)}else{const Re=yield E.compact({activeCtx:ee,activeProperty:se,element:Ee,options:me,compactionMap:te});V(Re)&&0===Re.length||D(Ve,Le,Re)}else{const Re=yield E.compact({activeCtx:ee,activeProperty:"@reverse",element:Ee,options:me,compactionMap:te});for(const Ue in Re)if(ee.mappings.has(Ue)&&ee.mappings.get(Ue).reverse){const qe=Re[Ue],z=(w(ee,Ue,"@container")||[]).includes("@set")||!me.compactArrays;D(Ve,Ue,qe,{propertyIsArray:z}),delete Re[Ue]}if(Object.keys(Re).length>0){const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Ue,Re)}}else{let Re=F(Ee).map(X=>E.compactIri({activeCtx:nt,iri:X,relativeTo:{vocab:!0}}));1===Re.length&&(Re=Re[0]);const Ue=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}}),z=(w(ee,Ue,"@container")||[]).includes("@set")&&I(ee,1.1)||V(Re)&&0===Ee.length;D(Ve,Ue,Re,{propertyIsArray:z})}else{let Re=F(Ee).map(qe=>E.compactIri({activeCtx:ee,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Re.length&&(Re=Re[0]),Ve[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Re}}return Ve}return Te});return function(ee){return ue.apply(this,arguments)}}(),E.compactIri=({activeCtx:ue,iri:ee,value:se=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:te=null})=>{if(null===ee)return ee;ue.isPropertyTermScoped&&ue.previousContext&&(ue=ue.previousContext);const ye=ue.getInverse();if(M(ee)&&ee in ye&&"@none"in ye[ee]&&"@type"in ye[ee]["@none"]&&"@none"in ye[ee]["@none"]["@type"])return ye[ee]["@none"]["@type"]["@none"];if(Te.vocab&&ee in ye){const Je=ue["@language"]||"@none",Ye=[];L(se)&&"@index"in se&&!("@graph"in se)&&Ye.push("@index","@index@set"),L(se)&&"@preserve"in se&&(se=se["@preserve"][0]),O(se)?("@index"in se&&Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se&&Ye.push("@graph@id","@graph@id@set"),Ye.push("@graph","@graph@set","@set"),"@index"in se||Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se||Ye.push("@graph@id","@graph@id@set")):L(se)&&!S(se)&&Ye.push("@id","@id@set","@type","@set@type");let je="@language",Le="@null";if(me)je="@type",Le="@reverse",Ye.push("@set");else if(b(se)){"@index"in se||Ye.push("@list");const Re=se["@list"];if(0===Re.length)je="@any",Le="@none";else{let Ue=0===Re.length?Je:null,qe=null;for(let Be=0;Bent.includes("_"));Ve&&ye.push(Ve.replace(/^[^_]+_/,"_"))}ye.push("@none");const De=ue.inverse[ee];for(const Ve of Te){if(!(Ve in De))continue;const nt=De[Ve][me];for(const Ze of ye)if(Ze in nt)return nt[Ze]}return null}(ue,ee,se,Ye,je,Le);if(null!==Ee)return Ee}if(Te.vocab&&"@vocab"in ue){const Je=ue["@vocab"];if(0===ee.indexOf(Je)&&ee!==Je){const Ye=ee.substr(Je.length);if(!ue.mappings.has(Ye))return Ye}}let De=null;const Ve=[];let nt=ue.fastCurieMap;const Ze=ee.length-1;for(let Je=0;Je=0;--Je){const Ye=Ve[Je],je=Ye.terms;for(const Le of je){const Ee=Le+":"+ee.substr(Ye.iri.length);ue.mappings.get(Le)._prefix&&(!ue.mappings.has(Ee)||null===se&&ue.mappings.get(Ee)["@id"]===ee)&&(null===De||Q(Ee,De)<0)&&(De=Ee)}}if(null!==De)return De;for(const[Je,Ye]of ue.mappings)if(Ye&&Ye._prefix&&ee.startsWith(Je+":"))throw new q(`Absolute IRI "${ee}" confused with prefix "${Je}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ue});return Te.vocab?ee:"@base"in ue?ue["@base"]?H(Y(te,ue["@base"]),ee):ee:H(te,ee)},E.compactValue=({activeCtx:ue,activeProperty:ee,value:se,options:Te})=>{if(S(se)){const De=w(ue,ee,"@type"),Ve=w(ue,ee,"@language"),nt=w(ue,ee,"@direction"),Ze=w(ue,ee,"@container")||[],Je="@index"in se&&!Ze.includes("@index");if(!Je&&"@none"!==De&&(se["@type"]===De||"@language"in se&&se["@language"]===Ve&&"@direction"in se&&se["@direction"]===nt||"@language"in se&&se["@language"]===Ve||"@direction"in se&&se["@direction"]===nt))return se["@value"];const Ye=Object.keys(se).length,je=1===Ye||2===Ye&&"@index"in se&&!Je,Le="@language"in ue,Ee=re(se["@value"]),Re=ue.mappings.has(ee)&&null===ue.mappings.get(ee)["@language"];if(je&&"@none"!==De&&(!Le||!Ee||Re))return se["@value"];const Ue={};return Je&&(Ue[E.compactIri({activeCtx:ue,iri:"@index",relativeTo:{vocab:!0}})]=se["@index"]),"@type"in se?Ue[E.compactIri({activeCtx:ue,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ue,iri:se["@type"],relativeTo:{vocab:!0}}):"@language"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@language",relativeTo:{vocab:!0}})]=se["@language"]),"@direction"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@direction",relativeTo:{vocab:!0}})]=se["@direction"]),Ue[E.compactIri({activeCtx:ue,iri:"@value",relativeTo:{vocab:!0}})]=se["@value"],Ue}const me=y(ue,ee,{vocab:!0},Te),te=w(ue,ee,"@type"),ye=E.compactIri({activeCtx:ue,iri:se["@id"],relativeTo:{vocab:"@vocab"===te},base:Te.base});return"@id"===te||"@vocab"===te||"@graph"===me?ye:{[E.compactIri({activeCtx:ue,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(K,Ae,he){"use strict";const q="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#";Ae.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:q,RDF_LIST:q+"List",RDF_FIRST:q+"first",RDF_REST:q+"rest",RDF_NIL:q+"nil",RDF_TYPE:q+"type",RDF_PLAIN_LITERAL:q+"PlainLiteral",RDF_XML_LITERAL:q+"XMLLiteral",RDF_JSON_LITERAL:q+"JSON",RDF_OBJECT:q+"object",RDF_LANGSTRING:q+"langString",XSD:V,XSD_BOOLEAN:V+"boolean",XSD_DOUBLE:V+"double",XSD_INTEGER:V+"integer",XSD_STRING:V+"string"}},{}],19:[function(K,Ae,he){"use strict";const q=K("./util"),V=K("./JsonLdError"),{isArray:L,isObject:re,isString:$,isUndefined:b}=K("./types"),{isAbsolute:S,isRelative:O,prependBase:T}=K("./url"),{asArray:v,compareShortestLeast:y}=K("./util"),w=new Map,j=/^@[a-zA-Z]+$/,I={};function H(D,F,Q,E,U,ie){if(null===F||!$(F)||I.isKeyword(F))return F;if(F.match(j))return null;if(E&&E.hasOwnProperty(F)&&!0!==U.get(F)&&I.createTermDefinition({activeCtx:D,localCtx:E,term:F,defined:U,options:ie}),(Q=Q||{}).vocab){const ee=D.mappings.get(F);if(null===ee)return null;if(re(ee)&&"@id"in ee)return ee["@id"]}const ue=F.indexOf(":");if(ue>0){const ee=F.substr(0,ue),se=F.substr(ue+1);if("_"===ee||0===se.indexOf("//"))return F;E&&E.hasOwnProperty(ee)&&I.createTermDefinition({activeCtx:D,localCtx:E,term:ee,defined:U,options:ie});const Te=D.mappings.get(ee);if(Te&&Te._prefix)return Te["@id"]+se;if(S(F))return F}if(Q.vocab&&"@vocab"in D)return D["@vocab"]+F;if(Q.base&&"@base"in D){if(D["@base"])return T(T(ie.base,D["@base"]),F)}else if(Q.base)return T(ie.base,F);return F}function Y(D,F){if(!D||"object"!=typeof D||!F||"object"!=typeof F)return D===F;const Q=Array.isArray(D);if(Q!==Array.isArray(F))return!1;if(Q){if(D.length!==F.length)return!1;for(let ie=0;ie{if(E.has(Q)){if(E.get(Q))return;throw new V("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:F,term:Q})}let ue;if(E.set(Q,!1),F.hasOwnProperty(Q)&&(ue=F[Q]),"@type"===Q&&re(ue)&&"@set"===(ue["@container"]||"@set")&&I.processingMode(D,1.1)){const De=["@container","@id","@protected"],Ve=Object.keys(ue);if(0===Ve.length||Ve.some(nt=>!De.includes(nt)))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q})}else{if(I.isKeyword(Q))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q});if(Q.match(j))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:Q});if(""===Q)throw new V("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:F})}const ee=D.mappings.get(Q);D.mappings.has(Q)&&D.mappings.delete(Q);let se=!1;if(($(ue)||null===ue)&&(se=!0,ue={"@id":ue}),!re(ue))throw new V("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:F});const Te={};D.mappings.set(Q,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];I.processingMode(D,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const De in ue)if(!me.includes(De))throw new V("Invalid JSON-LD syntax; a term definition must not contain "+De,"jsonld.SyntaxError",{code:"invalid term definition",context:F});const te=Q.indexOf(":");if(Te._termHasColon=te>0,"@reverse"in ue){if("@id"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});if("@nest"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});const De=ue["@reverse"];if(!$(De))throw new V("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(!I.isKeyword(De)&&De.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:De}),void(ee?D.mappings.set(Q,ee):D.mappings.delete(Q));const Ve=H(D,De,{vocab:!0,base:!1},F,E,U);if(!S(Ve))throw new V("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:F});Te["@id"]=Ve,Te.reverse=!0}else if("@id"in ue){let De=ue["@id"];if(De&&!$(De))throw new V("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(null===De)Te["@id"]=null;else{if(!I.isKeyword(De)&&De.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:De}),void(ee?D.mappings.set(Q,ee):D.mappings.delete(Q));if(De!==Q){if(De=H(D,De,{vocab:!0,base:!1},F,E,U),!S(De)&&!I.isKeyword(De))throw new V("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:F});if(Q.match(/(?::[^:])|\//)&&H(D,Q,{vocab:!0,base:!1},F,new Map(E).set(Q,!0),U)!==De)throw new V("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});Te["@id"]=De,Te._prefix=se&&!Te._termHasColon&&De.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const De=Q.substr(0,te);if(F.hasOwnProperty(De)&&I.createTermDefinition({activeCtx:D,localCtx:F,term:De,defined:E,options:U}),D.mappings.has(De)){const Ve=Q.substr(te+1);Te["@id"]=D.mappings.get(De)["@id"]+Ve}else Te["@id"]=Q}else if("@type"===Q)Te["@id"]=Q;else{if(!("@vocab"in D))throw new V("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F,term:Q});Te["@id"]=D["@vocab"]+Q}if((!0===ue["@protected"]||!0===E.get("@protected")&&!1!==ue["@protected"])&&(D.protected[Q]=!0,Te.protected=!0),E.set(Q,!0),"@type"in ue){let De=ue["@type"];if(!$(De))throw new V("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if("@json"===De||"@none"===De){if(I.processingMode(D,1))throw new V(`Invalid JSON-LD syntax; an @context @type value must not be "${De}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else if("@id"!==De&&"@vocab"!==De){if(De=H(D,De,{vocab:!0,base:!1},F,E,U),!S(De))throw new V("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if(0===De.indexOf("_:"))throw new V("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}Te["@type"]=De}if("@container"in ue){const De=$(ue["@container"])?[ue["@container"]]:ue["@container"]||[],Ve=["@list","@set","@index","@language"];let nt=!0;const Ze=De.includes("@set");if(I.processingMode(D,1.1)){if(Ve.push("@graph","@id","@type"),De.includes("@list")){if(1!==De.length)throw new V("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:F})}else if(De.includes("@graph")){if(De.some(Je=>"@graph"!==Je&&"@id"!==Je&&"@index"!==Je&&"@set"!==Je))throw new V("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:F})}else nt&=De.length<=(Ze?2:1);if(De.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new V("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else nt&=!L(ue["@container"]),nt&=De.length<=1;if(nt&=De.every(Je=>Ve.includes(Je)),nt&=!(Ze&&De.includes("@list")),!nt)throw new V("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ve.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:F});if(Te.reverse&&!De.every(Je=>["@index","@set"].includes(Je)))throw new V("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});Te["@container"]=De}if("@index"in ue){if(!("@container"in ue)||!Te["@container"].includes("@index"))throw new V(`Invalid JSON-LD syntax; @index without @index in @container: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});if(!$(ue["@index"])||0===ue["@index"].indexOf("@"))throw new V(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});Te["@index"]=ue["@index"]}if("@context"in ue&&(Te["@context"]=ue["@context"]),"@language"in ue&&!("@type"in ue)){let De=ue["@language"];if(null!==De&&!$(De))throw new V("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:F});null!==De&&(De=De.toLowerCase()),Te["@language"]=De}if("@prefix"in ue){if(Q.match(/:|\//))throw new V("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:F});if(I.isKeyword(Te["@id"]))throw new V("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:F});if("boolean"!=typeof ue["@prefix"])throw new V("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:F});Te._prefix=!0===ue["@prefix"]}if("@direction"in ue){const De=ue["@direction"];if(null!==De&&"ltr"!==De&&"rtl"!==De)throw new V('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:F});Te["@direction"]=De}if("@nest"in ue){const De=ue["@nest"];if(!$(De)||"@nest"!==De&&0===De.indexOf("@"))throw new V("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:F});Te["@nest"]=De}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new V("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:F});if(ee&&ee.protected&&!ie&&(D.protected[Q]=!0,Te.protected=!0,!Y(ee,Te))){const De=U&&U.protectedMode||"error";if("error"===De)throw new V(`Invalid JSON-LD syntax; tried to redefine "${Q}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:F,term:Q});if("warn"===De)return void console.warn("WARNING: protected term redefinition",{term:Q});throw new V("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:F,term:Q,protectedMode:De})}},I.expandIri=(D,F,Q,E)=>H(D,F,Q,void 0,void 0,E),I.getInitialContext=D=>{const F=JSON.stringify({processingMode:D.processingMode}),Q=w.get(F);if(Q)return Q;const E={processingMode:D.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},te=Te.fastCurieMap={},ye={},De=(Te["@language"]||"@none").toLowerCase(),Ve=Te["@direction"],nt=Te.mappings,Ze=[...nt.keys()].sort(y);for(const Je of Ze){const Ye=nt.get(Je);if(null===Ye)continue;let je=Ye["@container"]||"@none";if(je=[].concat(je).sort().join(""),null===Ye["@id"])continue;const Le=v(Ye["@id"]);for(const Ee of Le){let Re=me[Ee];const Ue=I.isKeyword(Ee);if(Re)!Ue&&!Ye._termHasColon&&ye[Ee].push(Je);else if(me[Ee]=Re={},!Ue&&!Ye._termHasColon){ye[Ee]=[Je];const qe={iri:Ee,terms:ye[Ee]};Ee[0]in te?te[Ee[0]].push(qe):te[Ee[0]]=[qe]}if(Re[je]||(Re[je]={"@language":{},"@type":{},"@any":{}}),Re=Re[je],ue(Je,Re["@any"],"@none"),Ye.reverse)ue(Je,Re["@type"],"@reverse");else if("@none"===Ye["@type"])ue(Je,Re["@any"],"@none"),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none");else if("@type"in Ye)ue(Je,Re["@type"],Ye["@type"]);else if("@language"in Ye&&"@direction"in Ye){const qe=Ye["@language"],Be=Ye["@direction"];ue(Je,Re["@language"],qe&&Be?`${qe}_${Be}`.toLowerCase():qe?qe.toLowerCase():Be?`_${Be}`:"@null")}else"@language"in Ye?ue(Je,Re["@language"],(Ye["@language"]||"@null").toLowerCase()):"@direction"in Ye?ue(Je,Re["@language"],Ye["@direction"]?`_${Ye["@direction"]}`:"@none"):Ve?(ue(Je,Re["@language"],`_${Ve}`),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none")):(ue(Je,Re["@language"],De),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none"))}}for(const Je in te)ie(te,Je,1);return me},clone:function(){const Te={};return Te.mappings=q.clone(this.mappings),Te.clone=this.clone,Te.inverse=null,Te.getInverse=this.getInverse,Te.protected=q.clone(this.protected),this.previousContext&&(Te.previousContext=this.previousContext.clone()),Te.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Te["@base"]=this["@base"]),"@language"in this&&(Te["@language"]=this["@language"]),"@vocab"in this&&(Te["@vocab"]=this["@vocab"]),Te},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===w.size&&w.clear(),w.set(F,E),E;function ie(Te,me,te){const ye=Te[me],De=Te[me]={};let Ve,nt;for(const Ze of ye)Ve=Ze.iri,nt=te>=Ve.length?"":Ve[te],nt in De?De[nt].push(Ze):De[nt]=[Ze];for(const Ze in De)""!==Ze&&ie(De,Ze,te+1)}function ue(Te,me,te){me.hasOwnProperty(te)||(me[te]=Te)}},I.getContextValue=(D,F,Q)=>{if(null===F)return"@context"===Q?void 0:null;if(D.mappings.has(F)){const E=D.mappings.get(F);if(b(Q))return E;if(E.hasOwnProperty(Q))return E[Q]}return"@language"===Q&&Q in D||"@direction"===Q&&Q in D?D[Q]:"@context"!==Q?null:void 0},I.processingMode=(D,F)=>F.toString()>="1.1"?!D.processingMode||D.processingMode>="json-ld-"+F.toString():"json-ld-1.0"===D.processingMode,I.isKeyword=D=>{if(!$(D)||"@"!==D[0])return!1;switch(D){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(K,Ae,he){"use strict";const{parseLinkHeader:q,buildHeaders:V}=K("../util"),{LINK_HEADER_CONTEXT:L}=K("../constants"),re=K("../JsonLdError"),$=K("../RequestQueue"),{prependBase:b}=K("../url"),S=/(^|(\r\n))link:/i;function O(T,v,y){const w=new(T=T||XMLHttpRequest);return new Promise((M,j)=>{w.onload=()=>M(w),w.onerror=I=>j(I),w.open("GET",v,!0);for(const I in y)w.setRequestHeader(I,y[I]);w.send()})}Ae.exports=({secure:T,headers:v={},xhr:y}={headers:{}})=>{return v=V(v),(new $).wrapLoader(M);function M(I){return j.apply(this,arguments)}function j(){return(j=gt(function*(I){if(0!==I.indexOf("http:")&&0!==I.indexOf("https:"))throw new re('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:I});if(T&&0!==I.indexOf("https"))throw new re('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:I});let H;try{H=yield O(y,I,v)}catch(E){throw new re("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:I,cause:E})}if(H.status>=400)throw new re("URL could not be dereferenced: "+H.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:I,httpStatusCode:H.status});let Y={contextUrl:null,documentUrl:I,document:H.response},D=null;const F=H.getResponseHeader("Content-Type");let Q;if(S.test(H.getAllResponseHeaders())&&(Q=H.getResponseHeader("Link")),Q&&"application/ld+json"!==F){const E=q(Q),U=E[L];if(Array.isArray(U))throw new re("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:I});U&&(Y.contextUrl=U.target),D=E.alternate,D&&"application/ld+json"==D.type&&!(F||"").match(/^application\/(\w*\+)?json$/)&&(Y=yield M(b(I,D.target)))}return Y})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),{isArray:V,isObject:L,isEmptyObject:re,isString:$,isUndefined:b}=K("./types"),{isList:S,isValue:O,isGraph:T,isSubject:v}=K("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:M,process:j,processingMode:I}=K("./context"),{isAbsolute:H}=K("./url"),{addValue:Y,asArray:D,getValues:F,validateTypeValue:Q}=K("./util"),E={};Ae.exports=E;const U=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function ie(te){return ue.apply(this,arguments)}function ue(){return(ue=gt(function*({activeCtx:te,activeProperty:ye,expandedActiveProperty:De,element:Ve,expandedParent:nt,options:Ze={},insideList:Je,typeKey:Ye,typeScopedContext:je,expansionMap:Le}){const Ee=Object.keys(Ve).sort(),Re=[];let Ue;const qe=Ve[Ye]&&"@json"===y(te,V(Ve[Ye])?Ve[Ye][0]:Ve[Ye],{vocab:!0},Ze);for(const Be of Ee){let X,z=Ve[Be];if("@context"===Be)continue;let be=y(te,Be,{vocab:!0},Ze);if((null===be||!H(be)&&!M(be))&&(be=Le({unmappedProperty:Be,activeCtx:te,activeProperty:ye,parent:Ve,options:Ze,insideList:Je,value:z,expandedParent:nt}),void 0===be))continue;if(M(be)){if("@reverse"===De)throw new q("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(be in nt&&"@included"!==be&&"@type"!==be)throw new q("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:be})}if("@id"===be){if(!$(z)){if(!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(L(z)){if(!re(z))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!V(z))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(pt=>$(pt)))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}Y(nt,"@id",D(z).map(pt=>$(pt)?y(te,pt,{base:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@type"===be){L(z)&&(z=Object.fromEntries(Object.entries(z).map(([pt,fe])=>[y(je,pt,{vocab:!0}),D(fe).map(B=>y(je,B,{base:!0,vocab:!0}))]))),Q(z,Ze.isFrame),Y(nt,"@type",D(z).map(pt=>$(pt)?y(je,pt,{base:!0,vocab:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@included"===be&&I(te,1.1)){const pt=D(yield E.expand({activeCtx:te,activeProperty:ye,element:z,options:Ze,expansionMap:Le}));if(!pt.every(fe=>v(fe)))throw new q("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});Y(nt,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===be&&!L(z)&&!V(z))throw new q('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if("@value"===be){Ue=z,qe&&I(te,1.1)?nt["@value"]=z:Y(nt,"@value",z,{propertyIsArray:Ze.isFrame});continue}if("@language"===be){if(null===z)continue;if(!$(z)&&!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=D(z).map(pt=>$(pt)?pt.toLowerCase():pt);for(const pt of z)$(pt)&&!pt.match(U)&&console.warn(`@language must be valid BCP47: ${pt}`);Y(nt,"@language",z,{propertyIsArray:Ze.isFrame});continue}if("@direction"===be){if(!$(z)&&!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=D(z);for(const pt of z)if($(pt)&&"ltr"!==pt&&"rtl"!==pt)throw new q('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});Y(nt,"@direction",z,{propertyIsArray:Ze.isFrame});continue}if("@index"===be){if(!$(z))throw new q('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});Y(nt,"@index",z);continue}if("@reverse"===be){if(!L(z))throw new q('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(X=yield E.expand({activeCtx:te,activeProperty:"@reverse",element:z,options:Ze,expansionMap:Le}),"@reverse"in X)for(const fe in X["@reverse"])Y(nt,fe,X["@reverse"][fe],{propertyIsArray:!0});let pt=nt["@reverse"]||null;for(const fe in X){if("@reverse"===fe)continue;null===pt&&(pt=nt["@reverse"]={}),Y(pt,fe,[],{propertyIsArray:!0});const B=X[fe];for(let R=0;R"@id"===pt||"@index"===pt)&&(X=D(X).map(pt=>({"@graph":D(pt)}))),ce.mappings.has(Be)&&ce.mappings.get(Be).reverse){const pt=nt["@reverse"]=nt["@reverse"]||{};X=D(X);for(let fe=0;fe"@value"===y(te,be,{vocab:!0},Ze)))throw new q("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:X});yield ie({activeCtx:te,activeProperty:ye,expandedActiveProperty:De,element:X,expandedParent:nt,options:Ze,insideList:Je,typeScopedContext:je,typeKey:Ye,expansionMap:Le})}}})).apply(this,arguments)}function ee({activeCtx:te,activeProperty:ye,value:De,options:Ve}){if(null==De)return null;const nt=y(te,ye,{vocab:!0},Ve);if("@id"===nt)return y(te,De,{base:!0},Ve);if("@type"===nt)return y(te,De,{vocab:!0,base:!0},Ve);const Ze=w(te,ye,"@type");if(("@id"===Ze||"@graph"===nt)&&$(De))return{"@id":y(te,De,{base:!0},Ve)};if("@vocab"===Ze&&$(De))return{"@id":y(te,De,{vocab:!0,base:!0},Ve)};if(M(nt))return De;const Je={};if(Ze&&!["@id","@vocab","@none"].includes(Ze))Je["@type"]=Ze;else if($(De)){const Ye=w(te,ye,"@language");null!==Ye&&(Je["@language"]=Ye);const je=w(te,ye,"@direction");null!==je&&(Je["@direction"]=je)}return["boolean","number","string"].includes(typeof De)||(De=De.toString()),Je["@value"]=De,Je}function se(te,ye,De,Ve){const nt=[],Ze=Object.keys(ye).sort();for(const Je of Ze){const Ye=y(te,Je,{vocab:!0},Ve);let je=ye[Je];V(je)||(je=[je]);for(const Le of je){if(null===Le)continue;if(!$(Le))throw new q("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ee={"@value":Le};"@none"!==Ye&&(Ee["@language"]=Je.toLowerCase()),De&&(Ee["@direction"]=De),nt.push(Ee)}}return nt}function Te(te){return me.apply(this,arguments)}function me(){return(me=gt(function*({activeCtx:te,options:ye,activeProperty:De,value:Ve,expansionMap:nt,asGraph:Ze,indexKey:Je,propertyIndex:Ye}){const je=[],Le=Object.keys(Ve).sort(),Ee="@type"===Je;for(let Re of Le){if(Ee){const Be=w(te,Re,"@context");b(Be)||(te=yield j({activeCtx:te,localCtx:Be,propagate:!1,options:ye}))}let qe,Ue=Ve[Re];V(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:te,activeProperty:De,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:nt}),qe=Ye?"@none"===Re?"@none":ee({activeCtx:te,activeProperty:Je,value:Re,options:ye}):y(te,Re,{vocab:!0},ye),"@id"===Je?Re=y(te,Re,{base:!0},ye):Ee&&(Re=qe);for(let Be of Ue){if(Ze&&!T(Be)&&(Be={"@graph":[Be]}),"@type"===Je)"@none"===qe||(Be["@type"]=Be["@type"]?[Re].concat(Be["@type"]):[Re]);else{if(O(Be)&&!["@language","@type","@index"].includes(Je))throw new q(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${Je}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Be});Ye?"@none"!==qe&&Y(Be,Ye,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(Je in Be)&&(Be[Je]=Re)}je.push(Be)}}return je})).apply(this,arguments)}E.expand=function(){var te=gt(function*({activeCtx:ye,activeProperty:De=null,element:Ve,options:nt={},insideList:Ze=!1,insideIndex:Je=!1,typeScopedContext:Ye=null,expansionMap:je=(()=>{})}){if(null==Ve)return null;if("@default"===De&&(nt=Object.assign({},nt,{isFrame:!1})),!V(Ve)&&!L(Ve)){if(!Ze&&(null===De||"@graph"===y(ye,De,{vocab:!0},nt))){const X=yield je({unmappedValue:Ve,activeCtx:ye,activeProperty:De,options:nt,insideList:Ze});return void 0===X?null:X}return ee({activeCtx:ye,activeProperty:De,value:Ve,options:nt})}if(V(Ve)){let X=[];const be=w(ye,De,"@container")||[];Ze=Ze||be.includes("@list");for(let ce=0;ce1?ce.slice().sort():ce:[ce];for(const wt of Pe){const pt=w(Ye,wt,"@context");b(pt)||(ye=yield j({activeCtx:ye,localCtx:pt,options:nt,propagate:!1}))}}let Be={};yield ie({activeCtx:ye,activeProperty:De,expandedActiveProperty:Le,element:Ve,expandedParent:Be,options:nt,insideList:Ze,typeKey:qe,typeScopedContext:Ye,expansionMap:je}),Re=Object.keys(Be);let z=Re.length;if("@value"in Be){if("@type"in Be&&("@language"in Be||"@direction"in Be))throw new q('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:Be});let X=z-1;if("@type"in Be&&(X-=1),"@index"in Be&&(X-=1),"@language"in Be&&(X-=1),"@direction"in Be&&(X-=1),0!==X)throw new q('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:Be});const be=null===Be["@value"]?[]:D(Be["@value"]),ce=F(Be,"@type");if(!I(ye,1.1)||!ce.includes("@json")||1!==ce.length)if(0===be.length){const Pe=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==Pe?Pe:null}else{if(!be.every(Pe=>$(Pe)||re(Pe))&&"@language"in Be)throw new q("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Be});if(!ce.every(Pe=>H(Pe)&&!($(Pe)&&0===Pe.indexOf("_:"))||re(Pe)))throw new q('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:Be})}}else if("@type"in Be&&!V(Be["@type"]))Be["@type"]=[Be["@type"]];else if("@set"in Be||"@list"in Be){if(z>1&&(2!==z||!("@index"in Be)))throw new q('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:Be});"@set"in Be&&(Be=Be["@set"],Re=Object.keys(Be),z=Re.length)}else if(1===z&&"@language"in Be){const X=yield je(Be,{unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}if(L(Be)&&!nt.keepFreeFloatingNodes&&!Ze&&(null===De||"@graph"===Le)&&(0===z||"@value"in Be||"@list"in Be||1===z&&"@id"in Be)){const X=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}return Be});return function(ye){return te.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(K,Ae,he){"use strict";const{isSubjectReference:q}=K("./graphTypes"),{createMergedNodeMap:V}=K("./nodeMap"),L={};Ae.exports=L,L.flatten=re=>{const $=V(re),b=[],S=Object.keys($).sort();for(let O=0;O=0;--ue){const ee=ie[ue];if(ee.graph===U&&ee.subject["@id"]===E["@id"])return!0}return!1}function w(E,U,ie){const ue="@"+ie;let ee=ue in E?E[ue][0]:U[ie];if("embed"===ie)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return ee}function M(E){if(!L.isArray(E)||1!==E.length||!L.isObject(E[0]))throw new b("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const U of re.asArray(E[0]["@id"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const U of re.asArray(E[0]["@type"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function I(E,U,ie,ue){let ee=!0,se=!1;for(const Te in ie){let me=!1;const te=re.getValues(U,Te),ye=0===re.getValues(ie,Te).length;if("@id"===Te){if(L.isEmptyObject(ie["@id"][0]||{})?me=!0:ie["@id"].length>=0&&(me=ie["@id"].includes(te[0])),!ue.requireAll)return me}else if("@type"===Te){if(ee=!1,ye){if(te.length>0)return!1;me=!0}else if(1===ie["@type"].length&&L.isEmptyObject(ie["@type"][0]))me=te.length>0;else for(const De of ie["@type"])me=!(!L.isObject(De)||!("@default"in De))||me||te.some(Ve=>Ve===De);if(!ue.requireAll)return me}else{if(q(Te))continue;{const De=re.getValues(ie,Te)[0];let Ve=!1;if(De&&(M([De]),Ve="@default"in De),ee=!1,0===te.length&&Ve)continue;if(te.length>0&&ye)return!1;if(void 0===De){if(te.length>0)return!1;me=!0}else if(V.isList(De)){const nt=De["@list"][0];if(V.isList(te[0])){const Ze=te[0]["@list"];V.isValue(nt)?me=Ze.some(Je=>Q(nt,Je)):(V.isSubject(nt)||V.isSubjectReference(nt))&&(me=Ze.some(Je=>F(E,nt,Je,ue)))}}else me=V.isValue(De)?te.some(nt=>Q(De,nt)):V.isSubjectReference(De)?te.some(nt=>F(E,De,nt,ue)):!!L.isObject(De)&&te.length>0}}if(!me&&ue.requireAll)return!1;se=se||me}return ee||se}function H(E,U){const ie=E.uniqueEmbeds[E.graph],ue=ie[U],ee=ue.parent,se=ue.property,Te={"@id":U};if(L.isArray(ee)){for(let te=0;te{const ye=Object.keys(ie);for(const De of ye)De in ie&&L.isObject(ie[De].parent)&&ie[De].parent["@id"]===te&&(delete ie[De],me(De))};me(U)}function Y(E,U){if(L.isArray(E))return E.map(ie=>Y(ie,U));if(L.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(V.isValue(E))return E;if(V.isList(E))return E["@list"]=Y(E["@list"],U),E;if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)"@id"===ie&&U.bnodesToClear.includes(E[ie])?delete E["@id"]:E[ie]=Y(E[ie],U)}return E}function D(E,U,ie){L.isObject(E)?re.addValue(E,U,ie,{propertyIsArray:!0}):E.push(ie)}function F(E,U,ie,ue){if(!("@id"in ie))return!1;const ee=E.subjects[ie["@id"]];return ee&&I(E,ee,U,ue)}function Q(E,U){const ie=U["@value"],ue=U["@type"],ee=U["@language"],se=E["@value"]?L.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?L.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?L.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===se.length&&0===Te.length&&0===me.length||!(!se.includes(ie)&&!L.isEmptyObject(se[0])||!(!ue&&0===Te.length||Te.includes(ue)||ue&&L.isEmptyObject(Te[0]))||!(!ee&&0===me.length||me.includes(ee)||ee&&L.isEmptyObject(me[0])))}Ae.exports=T,T.frameMergedOrDefault=(E,U,ie)=>{const ue={options:ie,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new re.IdentifierIssuer("_:b");S(E,ue.graphMap,"@default",ee),ie.merged&&(ue.graphMap["@merged"]=O(ue.graphMap),ue.graph="@merged"),ue.subjects=ue.graphMap[ue.graph];const se=[];return T.frame(ue,Object.keys(ue.subjects).sort(),U,se),ie.pruneBlankNodeIdentifiers&&(ie.bnodesToClear=Object.keys(ue.bnodeMap).filter(Te=>1===ue.bnodeMap[Te].length)),ie.link={},Y(se,ie)},T.frame=(E,U,ie,ue,ee=null)=>{M(ie);const se=E.options,Te={embed:w(ie=ie[0],se,"embed"),explicit:w(ie,se,"explicit"),requireAll:w(ie,se,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],te=function(E,U,ie,ue){const ee={};for(const se of U){const Te=E.graphMap[E.graph][se];I(E,Te,ie,ue)&&(ee[se]=Te)}return ee}(E,U,ie,Te),ye=Object.keys(te).sort();for(const De of ye){const Ve=te[De];if(null===ee?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&De in me){D(ue,ee,me[De]);continue}const nt={"@id":De};if(0===De.indexOf("_:")&&re.addValue(E.bnodeMap,De,nt,{propertyIsArray:!0}),me[De]=nt,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:ie});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(De)){if(E.embedded&&("@never"===Te.embed||y(Ve,E.graph,E.subjectStack))){D(ue,ee,nt);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(De)){D(ue,ee,nt);continue}if("@last"===Te.embed&&De in E.uniqueEmbeds[E.graph]&&H(E,De),E.uniqueEmbeds[E.graph][De]={parent:ue,property:ee},E.subjectStack.push({subject:Ve,graph:E.graph}),De in E.graphMap){let Ze=!1,Je=null;"@graph"in ie?(Je=ie["@graph"][0],Ze=!("@merged"===De||"@default"===De),L.isObject(Je)||(Je={})):(Ze="@merged"!==E.graph,Je={}),Ze&&T.frame(Un(ht({},E),{graph:De,embedded:!1}),Object.keys(E.graphMap[De]).sort(),[Je],nt,"@graph")}"@included"in ie&&T.frame(Un(ht({},E),{embedded:!1}),U,ie["@included"],nt,"@included");for(const Ze of Object.keys(Ve).sort())if(q(Ze)){if(nt[Ze]=re.clone(Ve[Ze]),"@type"===Ze)for(const Je of Ve["@type"])0===Je.indexOf("_:")&&re.addValue(E.bnodeMap,Je,nt,{propertyIsArray:!0})}else if(!Te.explicit||Ze in ie)for(const Je of Ve[Ze]){const Ye=Ze in ie?ie[Ze]:v(Te);if(V.isList(Je)){const je=ie[Ze]&&ie[Ze][0]&&ie[Ze][0]["@list"]?ie[Ze][0]["@list"]:v(Te),Le={"@list":[]};D(nt,Ze,Le);const Ee=Je["@list"];for(const Re of Ee)V.isSubjectReference(Re)?T.frame(Un(ht({},E),{embedded:!0}),[Re["@id"]],je,Le,"@list"):D(Le,"@list",re.clone(Re))}else V.isSubjectReference(Je)?T.frame(Un(ht({},E),{embedded:!0}),[Je["@id"]],Ye,nt,Ze):Q(Ye[0],Je)&&D(nt,Ze,re.clone(Je))}for(const Ze of Object.keys(ie).sort()){if("@type"===Ze){if(!L.isObject(ie[Ze][0])||!("@default"in ie[Ze][0]))continue}else if(q(Ze))continue;const Je=ie[Ze][0]||{};if(!w(Je,se,"omitDefault")&&!(Ze in nt)){let je="@null";"@default"in Je&&(je=re.clone(Je["@default"])),L.isArray(je)||(je=[je]),nt[Ze]=[{"@preserve":je}]}}for(const Ze of Object.keys(ie["@reverse"]||{}).sort()){const Je=ie["@reverse"][Ze];for(const Ye of Object.keys(E.subjects))re.getValues(E.subjects[Ye],Ze).some(Le=>Le["@id"]===De)&&(nt["@reverse"]=nt["@reverse"]||{},re.addValue(nt["@reverse"],Ze,[],{propertyIsArray:!0}),T.frame(Un(ht({},E),{embedded:!0}),[Ye],Je,nt["@reverse"][Ze],ee))}D(ue,ee,nt),E.subjectStack.pop()}}},T.cleanupNull=(E,U)=>{if(L.isArray(E))return E.map(ue=>T.cleanupNull(ue,U)).filter(ue=>ue);if("@null"===E)return null;if(L.isObject(E)){if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)E[ie]=T.cleanupNull(E[ie],U)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),V=K("./graphTypes"),L=K("./types"),re=K("./util"),{RDF_LIST:$,RDF_FIRST:b,RDF_REST:S,RDF_NIL:O,RDF_TYPE:T,RDF_JSON_LITERAL:v,XSD_BOOLEAN:y,XSD_DOUBLE:w,XSD_INTEGER:M,XSD_STRING:j}=K("./constants"),I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,H={};function Y(D,F,Q){if(D.termType.endsWith("Node"))return{"@id":D.value};const E={"@value":D.value};if(D.language)E["@language"]=D.language;else{let U=D.datatype.value;if(U||(U=j),U===v){U="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(ie){throw new q("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:ie})}}if(F){if(U===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(L.isNumeric(E["@value"]))if(U===M){const ie=parseInt(E["@value"],10);ie.toFixed(0)===E["@value"]&&(E["@value"]=ie)}else U===w&&(E["@value"]=parseFloat(E["@value"]));[y,M,w,j].includes(U)||(E["@type"]=U)}else if("i18n-datatype"===Q&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,ue]=U.split(/[#_]/);ie.length>0&&(E["@language"]=ie,ie.match(I)||console.warn(`@language must be valid BCP47: ${ie}`)),E["@direction"]=ue}else U!==j&&(E["@type"]=U)}return E}Ae.exports=H,H.fromRDF=function(){var D=gt(function*(F,{useRdfType:Q=!1,useNativeTypes:E=!1,rdfDirection:U=null}){const ie={},ue={"@default":ie},ee={};for(const me of F){const te="DefaultGraph"===me.graph.termType?"@default":me.graph.value;te in ue||(ue[te]={}),"@default"!==te&&!(te in ie)&&(ie[te]={"@id":te});const ye=ue[te],De=me.subject.value,Ve=me.predicate.value,nt=me.object;De in ye||(ye[De]={"@id":De});const Ze=ye[De],Je=nt.termType.endsWith("Node");if(Je&&!(nt.value in ye)&&(ye[nt.value]={"@id":nt.value}),Ve===T&&!Q&&Je){re.addValue(Ze,"@type",nt.value,{propertyIsArray:!0});continue}const Ye=Y(nt,E,U);if(re.addValue(Ze,Ve,Ye,{propertyIsArray:!0}),Je)if(nt.value===O){const je=ye[nt.value];"usages"in je||(je.usages=[]),je.usages.push({node:Ze,property:Ve,value:Ye})}else ee[nt.value]=!(nt.value in ee)&&{node:Ze,property:Ve,value:Ye}}for(const me in ue){const te=ue[me];if(!(O in te))continue;const ye=te[O];if(ye.usages){for(let De of ye.usages){let Ve=De.node,nt=De.property,Ze=De.value;const Je=[],Ye=[];let je=Object.keys(Ve).length;for(;nt===S&&L.isObject(ee[Ve["@id"]])&&L.isArray(Ve[b])&&1===Ve[b].length&&L.isArray(Ve[S])&&1===Ve[S].length&&(3===je||4===je&&L.isArray(Ve["@type"])&&1===Ve["@type"].length&&Ve["@type"][0]===$)&&(Je.push(Ve[b][0]),Ye.push(Ve["@id"]),De=ee[Ve["@id"]],Ve=De.node,nt=De.property,Ze=De.value,je=Object.keys(Ve).length,V.isBlankNode(Ve)););delete Ze["@id"],Ze["@list"]=Je.reverse();for(const Le of Ye)delete te[Le]}delete ye.usages}}const se=[],Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me];if(me in ue){const ye=te["@graph"]=[],De=ue[me],Ve=Object.keys(De).sort();for(const nt of Ve){const Ze=De[nt];V.isSubjectReference(Ze)||ye.push(Ze)}}V.isSubjectReference(te)||se.push(te)}return se});return function(F,Q){return D.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(K,Ae,he){"use strict";const q=K("./types"),V={};Ae.exports=V,V.isSubject=L=>!(!q.isObject(L)||"@value"in L||"@set"in L||"@list"in L)&&(Object.keys(L).length>1||!("@id"in L)),V.isSubjectReference=L=>q.isObject(L)&&1===Object.keys(L).length&&"@id"in L,V.isValue=L=>q.isObject(L)&&"@value"in L,V.isList=L=>q.isObject(L)&&"@list"in L,V.isGraph=L=>q.isObject(L)&&"@graph"in L&&1===Object.keys(L).filter(re=>"@id"!==re&&"@index"!==re).length,V.isSimpleGraph=L=>V.isGraph(L)&&!("@id"in L),V.isBlankNode=L=>!!q.isObject(L)&&("@id"in L?0===L["@id"].indexOf("_:"):0===Object.keys(L).length||!("@value"in L||"@set"in L||"@list"in L))},{"./types":30}],26:[function(K,Ae,he){const q=K("rdf-canonize"),V=K("./platform"),L=K("./util"),re=K("./ContextResolver"),$=L.IdentifierIssuer,b=K("./JsonLdError"),S=K("lru-cache"),O=K("./NQuads"),{expand:T}=K("./expand"),{flatten:v}=K("./flatten"),{fromRDF:y}=K("./fromRdf"),{toRDF:w}=K("./toRdf"),{frameMergedOrDefault:M,cleanupNull:j}=K("./frame"),{isArray:I,isObject:H,isString:Y}=K("./types"),{isSubjectReference:D}=K("./graphTypes"),{expandIri:F,getInitialContext:Q,process:E,processingMode:U}=K("./context"),{compact:ie,compactIri:ue}=K("./compact"),{createNodeMap:ee,createMergedNodeMap:se,mergeNodeMaps:Te}=K("./nodeMap"),me=function(ye){const De={},nt=new S({max:100});function Ze(Je,Le){var Ee=Le,{documentLoader:Ye=ye.documentLoader}=Ee,je=D7(Ee,["documentLoader"]);return Object.assign({},{documentLoader:Ye},je,Je)}return ye.compact=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===je)throw new b("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ye)return null;let Ee;(Le=Ze(Le,{base:Y(Ye)?Ye:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new $("_:b"),contextResolver:new re({sharedCache:nt})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ee=Le.skipExpansion?Ye:yield ye.expand(Ye,Le);const Re=yield ye.processContext(Q(Le),je,Le);let Ue=yield ie({activeCtx:Re,element:Ee,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&I(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&H(Ue)&&(Ue=[Ue]),H(je)&&"@context"in je&&(je=je["@context"]),je=L.clone(je),I(je)||(je=[je]);const qe=je;je=[];for(let z=0;z0)&&je.push(qe[z]);const Be=je.length>0;if(1===je.length&&(je=je[0]),I(Ue)){const z=ue({activeCtx:Re,iri:"@graph",relativeTo:{vocab:!0}}),X=Ue;Ue={},Be&&(Ue["@context"]=je),Ue[z]=X}else if(H(Ue)&&Be){const z=Ue;Ue={"@context":je};for(const X in z)Ue[X]=z[X]}return Ue});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.expand=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(je=Ze(je,{keepFreeFloatingNodes:!1,contextResolver:new re({sharedCache:nt})})).expansionMap&&(je.expansionMap=void 0);const Le={},Ee=[];if("expandContext"in je){const Be=L.clone(je.expandContext);Le.expandContext=H(Be)&&"@context"in Be?Be:{"@context":Be},Ee.push(Le.expandContext)}let Re;if(Y(Ye)){const Be=yield ye.get(Ye,je);Re=Be.documentUrl,Le.input=Be.document,Be.contextUrl&&(Le.remoteContext={"@context":Be.contextUrl},Ee.push(Le.remoteContext))}else Le.input=L.clone(Ye);"base"in je||(je.base=Re||"");let Ue=Q(je);for(const Be of Ee)Ue=yield E({activeCtx:Ue,localCtx:Be,options:je});let qe=yield T({activeCtx:Ue,element:Le.input,options:je,expansionMap:je.expansionMap});return H(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),I(qe)||(qe=[qe]),qe});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.flatten=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");je="function"==typeof je?null:je||null,Le=Ze(Le,{base:Y(Ye)?Ye:"",contextResolver:new re({sharedCache:nt})});const Ee=yield ye.expand(Ye,Le),Re=v(Ee);return null===je?Re:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Re,je,Le))});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.frame=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Ze(Le,{base:Y(Ye)?Ye:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new re({sharedCache:nt})}),Y(je)){const ce=yield ye.get(je,Le);if(je=ce.document,ce.contextUrl){let Pe=je["@context"];Pe?I(Pe)?Pe.push(ce.contextUrl):Pe=[Pe,ce.contextUrl]:Pe=ce.contextUrl,je["@context"]=Pe}}const Ee=je&&je["@context"]||{},Re=yield ye.processContext(Q(Le),Ee,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=U(Re,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=U(Re,1.1));const Ue=yield ye.expand(Ye,Le),qe=ht({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const Be=yield ye.expand(je,qe),z=Object.keys(je).map(ce=>F(Re,ce,{vocab:!0}));qe.merged=!z.includes("@graph"),qe.is11=U(Re,1.1);const X=M(Ue,Be,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let be=yield ye.compact(X,Ee,qe);return qe.link={},be=j(be,qe),be});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.link=function(){var Je=gt(function*(Ye,je,Le){const Ee={};return je&&(Ee["@context"]=je),Ee["@embed"]="@link",ye.frame(Ye,Ee,Le)});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(je=Ze(je,{base:Y(Ye)?Ye:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new re({sharedCache:nt})}))){if("application/n-quads"!==je.inputFormat&&"application/nquads"!==je.inputFormat)throw new b("Unknown canonicalization input format.","jsonld.CanonizeError");const Re=O.parse(Ye);return q.canonize(Re,je)}const Le=ht({},je);delete Le.format,Le.produceGeneralizedRdf=!1;const Ee=yield ye.toRDF(Ye,Le);return q.canonize(Ee,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.fromRDF=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");je=Ze(je,{format:Y(Ye)?"application/n-quads":void 0});const{format:Le}=je;let{rdfParser:Ee}=je;if(Le){if(Ee=Ee||De[Le],!Ee)throw new b("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ee=()=>Ye;const Re=yield Ee(Ye);return y(Re,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.toRDF=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(je=Ze(je,{base:Y(Ye)?Ye:"",skipExpansion:!1,contextResolver:new re({sharedCache:nt})})).skipExpansion?Ye:yield ye.expand(Ye,je);const Ee=w(Le,je);if(je.format){if("application/n-quads"===je.format||"application/nquads"===je.format)return O.serialize(Ee);throw new b("Unknown output format.","jsonld.UnknownFormat",{format:je.format})}return Ee});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.createNodeMap=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");je=Ze(je,{base:Y(Ye)?Ye:"",contextResolver:new re({sharedCache:nt})});const Le=yield ye.expand(Ye,je);return se(Le,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.merge=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!I(Ye))throw new TypeError('Could not merge, "docs" must be an array.');je="function"==typeof je?null:je||null,Le=Ze(Le,{contextResolver:new re({sharedCache:nt})});const Ee=yield Promise.all(Ye.map(ce=>{const Pe=ht({},Le);return ye.expand(ce,Pe)}));let Re=!0;"mergeNodes"in Le&&(Re=Le.mergeNodes);const Ue=Le.issuer||new $("_:b"),qe={"@default":{}};for(let ce=0;ceye._documentLoader,set:Je=>ye._documentLoader=Je}),ye.documentLoader=function(){var Je=gt(function*(Ye){throw new b("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Ye})});return function(Ye){return Je.apply(this,arguments)}}(),ye.get=function(){var Je=gt(function*(Ye,je){let Le;Le="function"==typeof je.documentLoader?je.documentLoader:ye.documentLoader;const Ee=yield Le(Ye);try{if(!Ee.document)throw new b("No remote document found at the given URL.","jsonld.NullRemoteDocument");Y(Ee.document)&&(Ee.document=JSON.parse(Ee.document))}catch(Re){throw new b("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Re,remoteDoc:Ee})}return Ee});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.processContext=function(){var Je=gt(function*(Ye,je,Le){return Le=Ze(Le,{base:"",contextResolver:new re({sharedCache:nt})}),null===je?Q(Le):(je=L.clone(je),H(je)&&"@context"in je||(je={"@context":je}),E({activeCtx:Ye,localCtx:je,options:Le}))});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.getContextValue=K("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(Je){if(!(Je in ye.documentLoaders))throw new b('Unknown document loader type: "'+Je+'"',"jsonld.UnknownDocumentLoader",{type:Je});ye.documentLoader=ye.documentLoaders[Je].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(Je,Ye){De[Je]=Ye},ye.unregisterRDFParser=function(Je){delete De[Je]},ye.registerRDFParser("application/n-quads",O.parse),ye.registerRDFParser("application/nquads",O.parse),ye.url=K("./url"),ye.util=L,Object.assign(ye,L),ye.promises=ye,ye.RequestQueue=K("./RequestQueue"),ye.JsonLdProcessor=K("./JsonLdProcessor")(ye),V.setupGlobals(ye),V.setupDocumentLoaders(ye),ye},te=function(){return me(function(){return te()})};me(te),Ae.exports=te},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(K,Ae,he){"use strict";const{isKeyword:q}=K("./context"),V=K("./graphTypes"),L=K("./types"),re=K("./util"),$=K("./JsonLdError"),b={};Ae.exports=b,b.createMergedNodeMap=(S,O)=>{const T=(O=O||{}).issuer||new re.IdentifierIssuer("_:b"),v={"@default":{}};return b.createNodeMap(S,v,"@default",T),b.mergeNodeMaps(v)},b.createNodeMap=(S,O,T,v,y,w)=>{if(L.isArray(S)){for(const H of S)b.createNodeMap(H,O,T,v,void 0,w);return}if(!L.isObject(S))return void(w&&w.push(S));if(V.isValue(S)){if("@type"in S){let H=S["@type"];0===H.indexOf("_:")&&(S["@type"]=H=v.getId(H))}return void(w&&w.push(S))}if(w&&V.isList(S)){const H=[];return b.createNodeMap(S["@list"],O,T,v,y,H),void w.push({"@list":H})}if("@type"in S){const H=S["@type"];for(const Y of H)0===Y.indexOf("_:")&&v.getId(Y)}L.isUndefined(y)&&(y=V.isBlankNode(S)?v.getId(S["@id"]):S["@id"]),w&&w.push({"@id":y});const M=O[T],j=M[y]=M[y]||{};j["@id"]=y;const I=Object.keys(S).sort();for(let H of I){if("@id"===H)continue;if("@reverse"===H){const D={"@id":y},F=S["@reverse"];for(const Q in F){const E=F[Q];for(const U of E){let ie=U["@id"];V.isBlankNode(U)&&(ie=v.getId(ie)),b.createNodeMap(U,O,T,v,ie),re.addValue(M[ie],Q,D,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===H){y in O||(O[y]={}),b.createNodeMap(S[H],O,y,v);continue}if("@included"===H){b.createNodeMap(S[H],O,T,v);continue}if("@type"!==H&&q(H)){if("@index"===H&&H in j&&(S[H]!==j[H]||S[H]["@id"]!==j[H]["@id"]))throw new $("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:j});j[H]=S[H];continue}const Y=S[H];if(0===H.indexOf("_:")&&(H=v.getId(H)),0!==Y.length)for(let D of Y)if("@type"===H&&(D=0===D.indexOf("_:")?v.getId(D):D),V.isSubject(D)||V.isSubjectReference(D)){if("@id"in D&&!D["@id"])continue;const F=V.isBlankNode(D)?v.getId(D["@id"]):D["@id"];re.addValue(j,H,{"@id":F},{propertyIsArray:!0,allowDuplicate:!1}),b.createNodeMap(D,O,T,v,F)}else if(V.isValue(D))re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1});else if(V.isList(D)){const F=[];b.createNodeMap(D["@list"],O,T,v,y,F),D={"@list":F},re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1})}else b.createNodeMap(D,O,T,v,y),re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1});else re.addValue(j,H,[],{propertyIsArray:!0})}},b.mergeNodeMapGraphs=S=>{const O={};for(const T of Object.keys(S).sort())for(const v of Object.keys(S[T]).sort()){const y=S[T][v];v in O||(O[v]={"@id":v});const w=O[v];for(const M of Object.keys(y).sort())if(q(M)&&"@type"!==M)w[M]=re.clone(y[M]);else for(const j of y[M])re.addValue(w,M,re.clone(j),{propertyIsArray:!0,allowDuplicate:!1})}return O},b.mergeNodeMaps=S=>{const O=S["@default"],T=Object.keys(S).sort();for(const v of T){if("@default"===v)continue;const y=S[v];let w=O[v];w?"@graph"in w||(w["@graph"]=[]):O[v]=w={"@id":v,"@graph":[]};const M=w["@graph"];for(const j of Object.keys(y).sort()){const I=y[j];V.isSubjectReference(I)||M.push(I)}}return O}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(K,Ae,he){"use strict";const q=K("./documentLoaders/xhr"),V={};Ae.exports=V,V.setupDocumentLoaders=function(L){"undefined"!=typeof XMLHttpRequest&&(L.documentLoaders.xhr=q,L.useDocumentLoader("xhr"))},V.setupGlobals=function(L){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:L.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(K,Ae,he){"use strict";const{createNodeMap:q}=K("./nodeMap"),{isKeyword:V}=K("./context"),L=K("./graphTypes"),re=K("canonicalize"),$=K("./types"),b=K("./util"),{RDF_FIRST:S,RDF_REST:O,RDF_NIL:T,RDF_TYPE:v,RDF_JSON_LITERAL:y,RDF_LANGSTRING:w,XSD_BOOLEAN:M,XSD_DOUBLE:j,XSD_INTEGER:I,XSD_STRING:H}=K("./constants"),{isAbsolute:Y}=K("./url"),D={};function F(U,ie,ue,ee,se){const Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me],ye=Object.keys(te).sort();for(let De of ye){const Ve=te[De];if("@type"===De)De=v;else if(V(De))continue;for(const nt of Ve){const Ze={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!Y(me))continue;const Je={termType:De.startsWith("_:")?"BlankNode":"NamedNode",value:De};if(!Y(De)||"BlankNode"===Je.termType&&!se.produceGeneralizedRdf)continue;const Ye=E(nt,ee,U,ue,se.rdfDirection);Ye&&U.push({subject:Ze,predicate:Je,object:Ye,graph:ue})}}}}function E(U,ie,ue,ee,se){const Te={};if(L.isValue(U)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=U["@value"];const te=U["@type"]||null;"@json"===te?(Te.value=re(me),Te.datatype.value=y):$.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=te||M):$.isDouble(me)||te===j?($.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=te||j):$.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=te||I):"i18n-datatype"===se&&"@direction"in U?(Te.datatype.value="https://www.w3.org/ns/i18n#"+(U["@language"]||"")+`_${U["@direction"]}`,Te.value=me):"@language"in U?(Te.value=me,Te.datatype.value=te||w,Te.language=U["@language"]):(Te.value=me,Te.datatype.value=te||H)}else if(L.isList(U)){const me=function(U,ie,ue,ee,se){const Te={termType:"NamedNode",value:S},me={termType:"NamedNode",value:O},te={termType:"NamedNode",value:T},ye=U.pop(),De=ye?{termType:"BlankNode",value:ie.getId()}:te;let Ve=De;for(const nt of U){const Ze=E(nt,ie,ue,ee,se),Je={termType:"BlankNode",value:ie.getId()};ue.push({subject:Ve,predicate:Te,object:Ze,graph:ee}),ue.push({subject:Ve,predicate:me,object:Je,graph:ee}),Ve=Je}if(ye){const nt=E(ye,ie,ue,ee,se);ue.push({subject:Ve,predicate:Te,object:nt,graph:ee}),ue.push({subject:Ve,predicate:me,object:te,graph:ee})}return De}(U["@list"],ie,ue,ee,se);Te.termType=me.termType,Te.value=me.value}else{const me=$.isObject(U)?U["@id"]:U;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||Y(Te.value)?Te:null}Ae.exports=D,D.toRDF=(U,ie)=>{const ue=new b.IdentifierIssuer("_:b"),ee={"@default":{}};q(U,ee,"@default",ue);const se=[],Te=Object.keys(ee).sort();for(const me of Te){let te;if("@default"===me)te={termType:"DefaultGraph",value:""};else{if(!Y(me))continue;te=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},te.value=me}F(se,ee[me],te,ue,ie)}return se}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(K,Ae,he){"use strict";const q={};Ae.exports=q,q.isArray=Array.isArray,q.isBoolean=V=>"boolean"==typeof V||"[object Boolean]"===Object.prototype.toString.call(V),q.isDouble=V=>q.isNumber(V)&&(-1!==String(V).indexOf(".")||Math.abs(V)>=1e21),q.isEmptyObject=V=>q.isObject(V)&&0===Object.keys(V).length,q.isNumber=V=>"number"==typeof V||"[object Number]"===Object.prototype.toString.call(V),q.isNumeric=V=>!isNaN(parseFloat(V))&&isFinite(V),q.isObject=V=>"[object Object]"===Object.prototype.toString.call(V),q.isString=V=>"string"==typeof V||"[object String]"===Object.prototype.toString.call(V),q.isUndefined=V=>void 0===V},{}],31:[function(K,Ae,he){"use strict";const q=K("./types"),V={};Ae.exports=V,V.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},V.parse=(re,$)=>{const b={},S=V.parsers[$||"full"],O=S.regex.exec(re);let T=S.keys.length;for(;T--;)b[S.keys[T]]=void 0===O[T]?null:O[T];return("https"===b.scheme&&"443"===b.port||"http"===b.scheme&&"80"===b.port)&&(b.href=b.href.replace(":"+b.port,""),b.authority=b.authority.replace(":"+b.port,""),b.port=null),b.normalizedPath=V.removeDotSegments(b.path),b},V.prependBase=(re,$)=>{if(null===re||V.isAbsolute($))return $;(!re||q.isString(re))&&(re=V.parse(re||""));const b=V.parse($),S={protocol:re.protocol||""};if(null!==b.authority)S.authority=b.authority,S.path=b.path,S.query=b.query;else if(S.authority=re.authority,""===b.path)S.path=re.path,S.query=null!==b.query?b.query:re.query;else{if(0===b.path.indexOf("/"))S.path=b.path;else{let T=re.path;T=T.substr(0,T.lastIndexOf("/")+1),(T.length>0||re.authority)&&"/"!==T.substr(-1)&&(T+="/"),T+=b.path,S.path=T}S.query=b.query}""!==b.path&&(S.path=V.removeDotSegments(S.path));let O=S.protocol;return null!==S.authority&&(O+="//"+S.authority),O+=S.path,null!==S.query&&(O+="?"+S.query),null!==b.fragment&&(O+="#"+b.fragment),""===O&&(O="./"),O},V.removeBase=(re,$)=>{if(null===re)return $;(!re||q.isString(re))&&(re=V.parse(re||""));let b="";if(""!==re.href?b+=(re.protocol||"")+"//"+(re.authority||""):$.indexOf("//")&&(b+="//"),0!==$.indexOf(b))return $;const S=V.parse($.substr(b.length)),O=re.normalizedPath.split("/"),T=S.normalizedPath.split("/"),v=S.fragment||S.query?0:1;for(;O.length>0&&T.length>v&&O[0]===T[0];)O.shift(),T.shift();let y="";if(O.length>0){O.pop();for(let w=0;w{if(0===re.length)return"";const $=re.split("/"),b=[];for(;$.length>0;){const S=$.shift(),O=0===$.length;"."!==S?".."!==S?b.push(S):(b.pop(),O&&b.push("")):O&&b.push("")}return"/"===re[0]&&b.length>0&&""!==b[0]&&b.unshift(""),1===b.length&&""===b[0]?"/":b.join("/")};const L=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;V.isAbsolute=re=>q.isString(re)&&L.test(re),V.isRelative=re=>q.isString(re)},{"./types":30}],32:[function(K,Ae,he){"use strict";const q=K("./graphTypes"),V=K("./types"),L=K("rdf-canonize").IdentifierIssuer,re=K("./JsonLdError"),$=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,b=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,S=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,O_headers={accept:"application/ld+json, application/json"},T={};function v(y,w){if(V.isArray(w))for(let M=0;M{if(Object.keys(y).some(M=>"accept"===M.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+O_headers.accept+'" is supported.');return Object.assign({Accept:O_headers.accept},y)},T.parseLinkHeader=y=>{const w={},M=y.match($);for(let j=0;j{if(!(V.isString(y)||V.isArray(y)&&y.every(M=>V.isString(M)))){if(w&&V.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&T.asArray(y["@default"]).every(M=>V.isString(M)))return}throw new re('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:y})}},T.hasProperty=(y,w)=>{if(y.hasOwnProperty(w)){const M=y[w];return!V.isArray(M)||M.length>0}return!1},T.hasValue=(y,w,M)=>{if(T.hasProperty(y,w)){let j=y[w];const I=q.isList(j);if(V.isArray(j)||I){I&&(j=j["@list"]);for(let H=0;H{if("propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1),"valueIsArray"in j||(j.valueIsArray=!1),"allowDuplicate"in j||(j.allowDuplicate=!0),"prependValue"in j||(j.prependValue=!1),j.valueIsArray)y[w]=M;else if(V.isArray(M)){0===M.length&&j.propertyIsArray&&!y.hasOwnProperty(w)&&(y[w]=[]),j.prependValue&&(M=M.concat(y[w]),y[w]=[]);for(let I=0;I[].concat(y[w]||[]),T.removeProperty=(y,w)=>{delete y[w]},T.removeValue=(y,w,M,j)=>{"propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1);const I=T.getValues(y,w).filter(H=>!T.compareValues(H,M));0===I.length?T.removeProperty(y,w):y[w]=1!==I.length||j.propertyIsArray?I:I[0]},T.relabelBlankNodes=(y,w)=>v((w=w||{}).issuer||new L("_:b"),y),T.compareValues=(y,w)=>!!(y===w||q.isValue(y)&&q.isValue(w)&&y["@value"]===w["@value"]&&y["@type"]===w["@type"]&&y["@language"]===w["@language"]&&y["@index"]===w["@index"])||!!(V.isObject(y)&&"@id"in y&&V.isObject(w)&&"@id"in w)&&y["@id"]===w["@id"],T.compareShortestLeast=(y,w)=>y.length1;const j=(Q,E,U)=>{const ie=Q[v].get(E);if(ie){const ue=ie.value;if(I(Q,ue)){if(Y(Q,ie),!Q[$])return}else U&&(Q[y]&&(ie.value.now=Date.now()),Q[T].unshiftNode(ie));return ue.value}},I=(Q,E)=>{if(!E||!E.maxAge&&!Q[b])return!1;const U=Date.now()-E.now;return E.maxAge?U>E.maxAge:Q[b]&&U>Q[b]},H=Q=>{if(Q[L]>Q[V])for(let E=Q[T].tail;Q[L]>Q[V]&&null!==E;){const U=E.prev;Y(Q,E),E=U}},Y=(Q,E)=>{if(E){const U=E.value;Q[S]&&Q[S](U.key,U.value),Q[L]-=U.length,Q[v].delete(U.key),Q[T].removeNode(E)}};class D{constructor(E,U,ie,ue,ee){this.key=E,this.value=U,this.length=ie,this.now=ue,this.maxAge=ee||0}}const F=(Q,E,U,ie)=>{let ue=U.value;I(Q,ue)&&(Y(Q,U),Q[$]||(ue=void 0)),ue&&E.call(ie,ue.value,ue.key,Q)};Ae.exports=class{constructor(E){if("number"==typeof E&&(E={max:E}),E||(E={}),E.max&&("number"!=typeof E.max||E.max<0))throw new TypeError("max must be a non-negative number");this[V]=E.max||1/0;const ie=E.length||w;if(this[re]="function"!=typeof ie?w:ie,this[$]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[b]=E.maxAge||0,this[S]=E.dispose,this[O]=E.noDisposeOnSet||!1,this[y]=E.updateAgeOnGet||!1,this.reset()}set max(E){if("number"!=typeof E||E<0)throw new TypeError("max must be a non-negative number");this[V]=E||1/0,H(this)}get max(){return this[V]}set allowStale(E){this[$]=!!E}get allowStale(){return this[$]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[b]=E,H(this)}get maxAge(){return this[b]}set lengthCalculator(E){"function"!=typeof E&&(E=w),E!==this[re]&&(this[re]=E,this[L]=0,this[T].forEach(U=>{U.length=this[re](U.value,U.key),this[L]+=U.length})),H(this)}get lengthCalculator(){return this[re]}get length(){return this[L]}get itemCount(){return this[T].length}rforEach(E,U){U=U||this;for(let ie=this[T].tail;null!==ie;){const ue=ie.prev;F(this,E,ie,U),ie=ue}}forEach(E,U){U=U||this;for(let ie=this[T].head;null!==ie;){const ue=ie.next;F(this,E,ie,U),ie=ue}}keys(){return this[T].toArray().map(E=>E.key)}values(){return this[T].toArray().map(E=>E.value)}reset(){this[S]&&this[T]&&this[T].length&&this[T].forEach(E=>this[S](E.key,E.value)),this[v]=new Map,this[T]=new q,this[L]=0}dump(){return this[T].map(E=>!I(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[T]}set(E,U,ie){if((ie=ie||this[b])&&"number"!=typeof ie)throw new TypeError("maxAge must be a number");const ue=ie?Date.now():0,ee=this[re](U,E);if(this[v].has(E)){if(ee>this[V])return Y(this,this[v].get(E)),!1;const me=this[v].get(E).value;return this[S]&&(this[O]||this[S](E,me.value)),me.now=ue,me.maxAge=ie,me.value=U,this[L]+=ee-me.length,me.length=ee,this.get(E),H(this),!0}const se=new D(E,U,ee,ue,ie);return se.length>this[V]?(this[S]&&this[S](E,U),!1):(this[L]+=se.length,this[T].unshift(se),this[v].set(E,this[T].head),H(this),!0)}has(E){if(!this[v].has(E))return!1;const U=this[v].get(E).value;return!I(this,U)}get(E){return j(this,E,!0)}peek(E){return j(this,E,!1)}pop(){const E=this[T].tail;return E?(Y(this,E),E.value):null}del(E){Y(this,this[v].get(E))}load(E){this.reset();const U=Date.now();for(let ie=E.length-1;ie>=0;ie--){const ue=E[ie],ee=ue.e||0;if(0===ee)this.set(ue.k,ue.v);else{const se=ee-U;se>0&&this.set(ue.k,ue.v,se)}}}prune(){this[v].forEach((E,U)=>j(this,U,!1))}}},{yallist:92}],34:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;const q="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${V}decimal`,boolean:`${V}boolean`,double:`${V}double`,integer:`${V}integer`,string:`${V}string`},rdf:{type:`${q}type`,nil:`${q}nil`,first:`${q}first`,rest:`${q}rest`,langString:`${q}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${L}reify#forSome`,forAll:`${L}reify#forAll`},log:{implies:`${L}log#implies`}}},{}],35:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.termFromId=function D(te,ye){if(ye=ye||v,!te)return ye.defaultGraph();switch(te[0]){case"?":return ye.variable(te.substr(1));case"_":return ye.blankNode(te.substr(2));case'"':if(ye===v)return new j(te);if('"'===te[te.length-1])return ye.literal(te.substr(1,te.length-2));const De=te.lastIndexOf('"',te.length-1);return ye.literal(te.substr(1,De-1),"@"===te[De+1]?te.substr(De+2):ye.namedNode(te.substr(De+3)));case"<":const Ve=T.exec(te);return ye.quad(D(U(Ve[1]),ye),D(U(Ve[2]),ye),D(U(Ve[3]),ye),Ve[4]&&D(U(Ve[4]),ye));default:return ye.namedNode(te)}},he.termToId=function F(te){if("string"==typeof te)return te;if(te instanceof w&&"Quad"!==te.termType)return te.id;if(!te)return b.id;switch(te.termType){case"NamedNode":return te.value;case"BlankNode":return`_:${te.value}`;case"Variable":return`?${te.value}`;case"DefaultGraph":return"";case"Literal":return`"${te.value}"${te.language?`@${te.language}`:te.datatype&&te.datatype.value!==$.string?`^^${te.datatype.value}`:""}`;case"Quad":return`<<${E(F(te.subject))} ${E(F(te.predicate))} ${E(F(te.object))}${(0,V.isDefaultGraph)(te.graph)?"":` ${F(te.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${te.termType}`)}},he.escapeQuotes=E,he.unescapeQuotes=U,he.Triple=he.Quad=he.DefaultGraph=he.Variable=he.BlankNode=he.Literal=he.NamedNode=he.Term=he.default=void 0;var te,q=(te=K("./IRIs"))&&te.__esModule?te:{default:te},V=K("./N3Util");const{rdf:re,xsd:$}=q.default;let b,S=0;const O=/^"(.*".*)(?="[^"]*$)/,T=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,v={namedNode:function(te){return new M(te)},blankNode:function(te){return new I(te||"n3-"+S++)},variable:function(te){return new H(te)},literal:function(te,ye){if("string"==typeof ye)return new j(`"${te}"@${ye.toLowerCase()}`);let De=ye?ye.value:"";return""===De&&("boolean"==typeof te?De=$.boolean:"number"==typeof te&&(Number.isFinite(te)?De=Number.isInteger(te)?$.integer:$.double:(De=$.double,Number.isNaN(te)||(te=te>0?"INF":"-INF")))),new j(""===De||De===$.string?`"${te}"`:`"${te}"^^${De}`)},defaultGraph:function(){return b},quad:me,triple:me};he.default=v;class w{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof w?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=w;class M extends w{get termType(){return"NamedNode"}}he.NamedNode=M;class j extends w{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let De=ye.lastIndexOf('"')+1;return De`"${De.replace(/"/g,'""')}`)}function U(te){return te.replace(O,(ye,De)=>`"${De.replace(/""/g,'"')}`)}function me(te,ye,De,Ve){return new Q(te,ye,De,Ve)}he.Triple=he.Quad=Q},{"./IRIs":34,"./N3Util":41}],36:[function(K,Ae,he){(function(q){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var V=re(K("./IRIs")),L=re(K("queue-microtask"));function re(w){return w&&w.__esModule?w:{default:w}}const{xsd:$}=V.default,b=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,S={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},O=/[\x00-\x20<>\\"\{\}\|\^\`]/,T={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},v=/$0^/;he.default=class{constructor(M){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]*)?$/,this._lineMode=!!(M=M||{}).lineMode){this._n3Mode=!1;for(const j in this)!(j in T)&&this[j]instanceof RegExp&&(this[j]=v)}else this._n3Mode=!1!==M.n3;this._comments=!!M.comments,this._literalClosingPos=0}_tokenizeToEnd(M,j){let I=this._input;const H=this._comments;for(;;){let D,F;for(;D=this._newline.exec(I);)H&&(F=this._comment.exec(D[0]))&&M(null,{line:this._line,type:"comment",value:F[1],prefix:""}),I=I.substr(D[0].length,I.length),this._line++;if(!D&&(D=this._whitespace.exec(I))&&(I=I.substr(D[0].length,I.length)),this._endOfFile.test(I))return j&&(H&&(F=this._comment.exec(I))&&M(null,{line:this._line,type:"comment",value:F[1],prefix:""}),M(I=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=I;const Q=this._line,E=I[0];let U="",ie="",ue="",ee=null,se=0,Te=!1;switch(E){case"^":if(I.length<3)break;if("^"!==I[1]){this._n3Mode&&(se=1,U="^");break}if(this._previousMarker="^^",I=I.substr(2),"<"!==I[0]){Te=!0;break}case"<":if(ee=this._unescapedIri.exec(I))U="IRI",ie=ee[1];else if(ee=this._iri.exec(I)){if(ie=this._unescape(ee[1]),null===ie||O.test(ie))return Y(this);U="IRI"}else I.length>1&&"<"===I[1]?(U="<<",se=2):this._n3Mode&&I.length>1&&"="===I[1]&&(U="inverse",se=2,ie=">");break;case">":I.length>1&&">"===I[1]&&(U=">>",se=2);break;case"_":((ee=this._blank.exec(I))||j&&(ee=this._blank.exec(`${I} `)))&&(U="blank",ue="_",ie=ee[1]);break;case'"':if(ee=this._simpleQuotedString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return Y(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(ee=this._simpleApostropheString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return Y(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(ee=this._variable.exec(I))&&(U="var",ie=ee[0]);break;case"@":"literal"===this._previousMarker&&(ee=this._langcode.exec(I))?(U="langcode",ie=ee[1]):(ee=this._keyword.exec(I))&&(U=ee[0]);break;case".":if(1===I.length?j:I[1]<"0"||I[1]>"9"){U=".",se=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(ee=this._number.exec(I)||j&&(ee=this._number.exec(`${I} `)))&&(U="literal",ie=ee[0],ue="string"==typeof ee[1]?$.double:"string"==typeof ee[2]?$.decimal:$.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(ee=this._sparqlKeyword.exec(I))?U=ee[0].toUpperCase():Te=!0;break;case"f":case"t":(ee=this._boolean.exec(I))?(U="literal",ie=ee[0],ue=$.boolean):Te=!0;break;case"a":(ee=this._shortPredicates.exec(I))?(U="abbreviation",ie="a"):Te=!0;break;case"=":this._n3Mode&&I.length>1&&(U="abbreviation",">"!==I[1]?(se=1,ie="="):(se=2,ie=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(se=1,U=E);break;default:Te=!0}if(Te&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(ee=this._prefix.exec(I))?((ee=this._prefixed.exec(I))||j&&(ee=this._prefixed.exec(`${I} `)))&&(U="prefixed",ue=ee[1]||"",ie=this._unescape(ee[2])):(U="prefix",ie=ee[1]||"")),"^^"===this._previousMarker)switch(U){case"prefixed":U="type";break;case"IRI":U="typeIRI";break;default:U=""}if(!U)return j||!/^'''|^"""/.test(I)&&/\n|\r/.test(I)?Y(this):this._input=I;const me={line:Q,type:U,value:ie,prefix:ue};M(null,me),this.previousToken=me,this._previousMarker=U,I=I.substr(se||ee[0].length,I.length)}function Y(D){M(D._syntaxError(/^\S*/.exec(I)[0]))}}_unescape(M){let j=!1;const I=M.replace(b,(H,Y,D,F)=>{if("string"==typeof Y)return String.fromCharCode(Number.parseInt(Y,16));if("string"==typeof D){let Q=Number.parseInt(D,16);return Q<=65535?String.fromCharCode(Number.parseInt(D,16)):String.fromCharCode(55296+((Q-=65536)>>10),56320+(1023&Q))}return F in S?S[F]:(j=!0,"")});return j?null:I}_parseLiteral(M){if(M.length>=3){const j=M.match(/^(?:"""|"|'''|'|)/)[0],I=j.length;let H=Math.max(this._literalClosingPos,I);for(;(H=M.indexOf(j,H))>0;){let Y=0;for(;"\\"===M[H-Y-1];)Y++;if(Y%2==0){const D=M.substring(I,H),F=D.split(/\r\n|\r|\n/).length-1,Q=H+I;if(1===I&&0!==F||3===I&&this._lineMode)break;return this._line+=F,{value:this._unescape(D),matchLength:Q}}H++}this._literalClosingPos=M.length-I+1}return{value:"",matchLength:0}}_syntaxError(M){this._input=null;const j=new Error(`Unexpected "${M}" on line ${this._line}.`);return j.context={token:void 0,line:this._line,previousToken:this.previousToken},j}_readStartingBom(M){return M.startsWith("\ufeff")?M.substr(1):M}tokenize(M,j){if(this._line=1,"string"==typeof M){if(this._input=this._readStartingBom(M),"function"!=typeof j){const I=[];let H;if(this._tokenizeToEnd((Y,D)=>Y?H=Y:I.push(D),!0),H)throw H;return I}(0,L.default)(()=>this._tokenizeToEnd(j,!0))}else this._pendingBuffer=null,"function"==typeof M.setEncoding&&M.setEncoding("utf8"),M.on("data",I=>{null!==this._input&&0!==I.length&&(this._pendingBuffer&&(I=q.concat([this._pendingBuffer,I]),this._pendingBuffer=null),128&I[I.length-1]?this._pendingBuffer=I:(void 0===this._input?this._input=this._readStartingBom("string"==typeof I?I:I.toString()):this._input+=I,this._tokenizeToEnd(j,!1)))}),M.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(j,!0)}),M.on("error",j)}}}).call(this)}).call(this,K("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var q=re(K("./N3Lexer")),V=re(K("./N3DataFactory")),L=re(K("./IRIs"));function re(T){return T&&T.__esModule?T:{default:T}}let $=0;class b{constructor(v){this._contextStack=[],this._graph=null,this._setBase((v=v||{}).baseIRI),v.factory&&O(this,v.factory);const y="string"==typeof v.format?v.format.match(/\w*$/)[0].toLowerCase():"",w=/turtle/.test(y),M=/trig/.test(y),j=/triple/.test(y),I=/quad/.test(y),H=this._n3Mode=/n3/.test(y),Y=j||I;(this._supportsNamedGraphs=!(w||H))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(w||M||j||H),this._supportsRDFStar=""===y||/star|\*$/.test(y),Y&&(this._resolveRelativeIRI=D=>null),this._blankNodePrefix="string"!=typeof v.blankNodePrefix?"":v.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=v.lexer||new q.default({lineMode:Y,n3:H}),this._explicitQuantifiers=!!v.explicitQuantifiers}static _resetBlankNodePrefix(){$=0}_setBase(v){if(v){const y=v.indexOf("#");y>=0&&(v=v.substr(0,y)),this._base=v,this._basePath=v.indexOf("/")<0?v:v.replace(/[^\/?]*(?:\?.*)?$/,""),v=v.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=v[0],this._baseScheme=v[1]}else this._base="",this._basePath=""}_saveContext(v,y,w,M,j){const I=this._n3Mode;this._contextStack.push({subject:w,predicate:M,object:j,graph:y,type:v,inverse:!!I&&this._inversePredicate,blankPrefix:I?this._prefixes._:"",quantified:I?this._quantified:null}),I&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const v=this._contextStack.pop(),y=this._n3Mode;this._subject=v.subject,this._predicate=v.predicate,this._object=v.object,this._graph=v.graph,y&&(this._inversePredicate=v.inverse,this._prefixes._=v.blankPrefix,this._quantified=v.quantified)}_readInTopContext(v){switch(v.type){case"eof":return null!==this._graph?this._error("Unclosed graph",v):(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(v)}}_readEntity(v,y){let w;switch(v.type){case"IRI":case"typeIRI":const M=this._resolveIRI(v.value);if(null===M)return this._error("Invalid IRI",v);w=this._namedNode(M);break;case"type":case"prefixed":const j=this._prefixes[v.prefix];if(void 0===j)return this._error(`Undefined prefix "${v.prefix}:"`,v);w=this._namedNode(j+v.value);break;case"blank":w=this._blankNode(this._prefixes[v.prefix]+v.value);break;case"var":w=this._variable(v.value.substr(1));break;default:return this._error(`Expected entity but got ${v.type}`,v)}return!y&&this._n3Mode&&w.id in this._quantified&&(w=this._quantified[w.id]),w}_readSubject(v){switch(this._predicate=null,v.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",v);case"}":return this._readPunctuation(v);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',v);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',v);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",v);if(0===v.prefix.length)return this._literalValue=v.value,this._completeSubjectLiteral;this._subject=this._literal(v.value,this._namedNode(v.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._subject=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(v){const y=v.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[v.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,v):(this._subject=null,"]"===y?this._readBlankNodeTail(v):this._readPunctuation(v));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",v);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",v);default:if(void 0===(this._predicate=this._readEntity(v)))return}return this._readObject}_readObject(v){switch(v.type){case"literal":if(0===v.prefix.length)return this._literalValue=v.value,this._readDataTypeOrLang;this._object=this._literal(v.value,this._namedNode(v.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._object=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(v){return"{"===v.type?this._readGraph(v):this._readPredicate(v)}_readGraph(v){return"{"!==v.type?this._error(`Expected graph but got ${v.type}`,v):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(v){return"]"===v.type?(this._subject=null,this._readBlankNodeTail(v)):(this._predicate=null,this._readPredicate(v))}_readBlankNodeTail(v){if("]"!==v.type)return this._readBlankNodePunctuation(v);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null===this._object?y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(v){switch(v.type){case".":case"}":return this._subject=null,this._readPunctuation(v);default:return this._readPredicate(v)}}_readListItem(v){let y=null,w=null,M=this._readListItem;const j=this._subject,I=this._contextStack,H=I[I.length-1];switch(v.type){case"[":this._saveContext("blank",this._graph,w=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),M=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,w=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==I.length&&"list"===I[I.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(M=this._readPredicate,this._subject===this.RDF_NIL)return M}else if(M=this._getContextEndReader(),this._object===this.RDF_NIL)return M;w=this.RDF_NIL;break;case"literal":0===v.prefix.length?(this._literalValue=v.value,M=this._readListItemDataTypeOrLang):(y=this._literal(v.value,this._namedNode(v.prefix)),M=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);default:if(void 0===(y=this._readEntity(v)))return}if(null===w&&(this._subject=w=this._blankNode()),null===j?null===H.predicate?H.subject=w:H.object=w:this._emit(j,this.RDF_REST,w,this._graph),null!==y){if(this._n3Mode&&("IRI"===v.type||"prefixed"===v.type))return this._saveContext("item",this._graph,w,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(w,this.RDF_FIRST,y,this._graph)}return M}_readDataTypeOrLang(v){return this._completeObjectLiteral(v,!1)}_readListItemDataTypeOrLang(v){return this._completeObjectLiteral(v,!0)}_completeLiteral(v){let y=this._literal(this._literalValue);switch(v.type){case"type":case"typeIRI":const w=this._readEntity(v);if(void 0===w)return;y=this._literal(this._literalValue,w),v=null;break;case"langcode":y=this._literal(this._literalValue,v.value),v=null}return{token:v,literal:y}}_completeSubjectLiteral(v){return this._subject=this._completeLiteral(v).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(v,y){const w=this._completeLiteral(v);if(w)return this._object=w.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===w.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(w.token))}_readFormulaTail(v){return"}"!==v.type?this._readPunctuation(v):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(v){let y,w=this._graph;const M=this._subject,j=this._inversePredicate;switch(v.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",v);if(this._n3Mode)return this._readFormulaTail(v);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,j&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(w=this._readEntity(v))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}if(null!==M){const I=this._predicate,H=this._object;j?this._emit(H,I,M,w):this._emit(M,I,H,w)}return y}_readBlankNodePunctuation(v){let y;switch(v.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(v){return"."!==v.type?this._error("Expected dot to follow quad",v):this._readInTopContext}_readPrefix(v){return"prefix"!==v.type?this._error("Expected prefix to follow @prefix",v):(this._prefix=v.value,this._readPrefixIRI)}_readPrefixIRI(v){if("IRI"!==v.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,v);const y=this._readEntity(v);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(v){const y="IRI"===v.type&&this._resolveIRI(v.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",v)}_readNamedGraphLabel(v){switch(v.type){case"IRI":case"blank":case"prefixed":return this._readSubject(v),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",v)}}_readNamedGraphBlankLabel(v){return"]"!==v.type?this._error("Invalid graph label",v):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(v){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(v)):"."!==v.type?this._error("Expected declaration to end with a dot",v):this._readInTopContext}_readQuantifierList(v){let y;switch(v.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(v,!0)))break;default:return this._error(`Unexpected ${v.type}`,v)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,y,this.QUANTIFIERS_GRAPH)):this._quantified[y.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(v){return","===v.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(v))}_getPathReader(v){return this._afterPath=v,this._readPath}_readPath(v){switch(v.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,w=y.length&&y[y.length-1];if(w&&"item"===w.type){const M=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,M,this._graph)}return this._afterPath(v)}}_readForwardPath(v){let y,w;const M=this._blankNode();if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(y=this._subject,this._subject=M):(y=this._object,this._object=M),this._emit(y,w,M,this._graph),this._readPath}_readBackwardPath(v){const y=this._blankNode();let w,M;if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(M=this._subject,this._subject=y):(M=this._object,this._object=y),this._emit(y,w,M,this._graph),this._readPath}_readRDFStarTailOrGraph(v){return">>"!==v.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(v))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,v):this._readRDFStarTail(v)}_readRDFStarTail(v){if(">>"!==v.type)return this._error(`Expected >> but got ${v.type}`,v);const y=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=y,this._readPredicate):(this._object=y,this._getContextEndReader())}_getContextEndReader(){const v=this._contextStack;if(!v.length)return this._readPunctuation;switch(v[v.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(v,y,w,M){this._callback(null,this._quad(v,y,w,M||this.DEFAULTGRAPH))}_error(v,y){const w=new Error(`${v} on line ${y.line}.`);w.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(w),this._callback=S}_resolveIRI(v){return/^[a-z][a-z0-9+.-]*:/i.test(v)?v:this._resolveRelativeIRI(v)}_resolveRelativeIRI(v){if(!v.length)return this._base;switch(v[0]){case"#":return this._base+v;case"?":return this._base.replace(/(?:\?.*)?$/,v);case"/":return("/"===v[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(v);default:return/^[^/:]*:/.test(v)?null:this._removeDotSegments(this._basePath+v)}}_removeDotSegments(v){if(!/(^|\/)\.\.?($|[/#?])/.test(v))return v;const y=v.length;let w="",M=-1,j=-1,I=0,H="/";for(;M=j&&(w=w.substr(0,I)),"/"!==H)return`${w}/${v.substr(M+1)}`;I=M+1}}}H=v[++M]}return w+v.substring(I)}parse(v,y,w){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${$++}_`,this._prefixCallback=w||S,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const M=[];let j;if(this._callback=(I,H)=>{I?j=I:H&&M.push(H)},this._lexer.tokenize(v).every(I=>this._readCallback=this._readCallback(I)),j)throw j;return M}this._callback=y,this._lexer.tokenize(v,(M,j)=>{null!==M?(this._callback(M),this._callback=S):this._readCallback&&(this._readCallback=this._readCallback(j))})}}function S(){}function O(T,v){const y=v.namedNode;T._namedNode=y,T._blankNode=v.blankNode,T._literal=v.literal,T._variable=v.variable,T._quad=v.quad,T.DEFAULTGRAPH=v.defaultGraph(),T.RDF_FIRST=y(L.default.rdf.first),T.RDF_REST=y(L.default.rdf.rest),T.RDF_NIL=y(L.default.rdf.nil),T.N3_FORALL=y(L.default.r.forAll),T.N3_FORSOME=y(L.default.r.forSome),T.ABBREVIATIONS={a:y(L.default.rdf.type),"=":y(L.default.owl.sameAs),">":y(L.default.log.implies)},T.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=b,O(b.prototype,V.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var v,q=function(v,y){if(!y&&v&&v.__esModule)return v;if(null===v||"object"!=typeof v&&"function"!=typeof v)return{default:v};var w=$(y);if(w&&w.has(v))return w.get(v);var M={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in v)if("default"!==I&&Object.prototype.hasOwnProperty.call(v,I)){var H=j?Object.getOwnPropertyDescriptor(v,I):null;H&&(H.get||H.set)?Object.defineProperty(M,I,H):M[I]=v[I]}return M.default=v,w&&w.set(v,M),M}(K("./N3DataFactory")),V=K("readable-stream"),L=(v=K("./IRIs"))&&v.__esModule?v:{default:v};function $(v){if("function"!=typeof WeakMap)return null;var y=new WeakMap,w=new WeakMap;return($=function(M){return M?w:y})(v)}class S{constructor(y,w){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!w&&y&&!y[0]&&(w=y,y=null),this._factory=(w=w||{}).factory||q.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const w=this._graphs;let M,j;for(const I in w)for(const H in M=w[I].subjects)for(const Y in j=M[H])y+=Object.keys(j[Y]).length;return this._size=y}_addToIndex(y,w,M,j){const I=y[w]||(y[w]={}),H=I[M]||(I[M]={}),Y=j in H;return Y||(H[j]=null),!Y}_removeFromIndex(y,w,M,j){const I=y[w],H=I[M];delete H[j];for(const Y in H)return;delete I[M];for(const Y in I)return;delete y[w]}_findInIndex(y,w,M,j,I,H,Y,D,F,Q){let E,U,ie;const ee=!w+!M+!j>1?Object.keys(this._ids):this._entities;w&&((E=y,y={})[w]=E[w]);for(const se in y){const Te=ee[se];if(U=y[se]){M&&((E=U,U={})[M]=E[M]);for(const me in U){const te=ee[me];if(ie=U[me]){const ye=j?j in ie?[j]:[]:Object.keys(ie);for(let De=0;De{M in w||(w[M]=!0,y((0,q.termFromId)(this._entities[M],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,w,M,j){w||(j=y.graph,M=y.object,w=y.predicate,y=y.subject),y=(0,q.termToId)(y),w=(0,q.termToId)(w),M=(0,q.termToId)(M),j=(0,q.termToId)(j);let I=this._graphs[j];I||(I=this._graphs[j]={subjects:{},predicates:{},objects:{}},Object.freeze(I));const H=this._ids,Y=this._entities;y=H[y]||(H[Y[++this._id]=y]=this._id),w=H[w]||(H[Y[++this._id]=w]=this._id),M=H[M]||(H[Y[++this._id]=M]=this._id);const D=this._addToIndex(I.subjects,y,w,M);return this._addToIndex(I.predicates,w,M,y),this._addToIndex(I.objects,M,y,w),this._size=null,D}addQuads(y){for(let w=0;w{this.addQuad(w)}),y}removeQuad(y,w,M,j){w||(j=y.graph,M=y.object,w=y.predicate,y=y.subject),y=(0,q.termToId)(y),w=(0,q.termToId)(w),M=(0,q.termToId)(M),j=(0,q.termToId)(j);const I=this._ids,H=this._graphs;let Y,D,F;if(!((y=I[y])&&(w=I[w])&&(M=I[M])&&(Y=H[j])&&(D=Y.subjects[y])&&(F=D[w])&&M in F))return!1;for(y in this._removeFromIndex(Y.subjects,y,w,M),this._removeFromIndex(Y.predicates,w,M,y),this._removeFromIndex(Y.objects,M,y,w),null!==this._size&&this._size--,Y.subjects)return!0;return delete H[j],!0}removeQuads(y){for(let w=0;w{this.removeQuad(w)}),y}removeMatches(y,w,M,j){const I=new V.Readable({objectMode:!0});return I._read=()=>{for(const H of this.getQuads(y,w,M,j))I.push(H);I.push(null)},this.remove(I)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,w,M,j){y=y&&(0,q.termToId)(y),w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=[],H=this._getGraphs(j),Y=this._ids;let D,F,Q,E;if(O(y)&&!(F=Y[y])||O(w)&&!(Q=Y[w])||O(M)&&!(E=Y[M]))return I;for(const U in H)(D=H[U])&&(F?E?this._findInIndex(D.objects,E,F,Q,"object","subject","predicate",U,null,I):this._findInIndex(D.subjects,F,Q,null,"subject","predicate","object",U,null,I):Q?this._findInIndex(D.predicates,Q,E,null,"predicate","object","subject",U,null,I):E?this._findInIndex(D.objects,E,null,null,"object","subject","predicate",U,null,I):this._findInIndex(D.subjects,null,null,null,"subject","predicate","object",U,null,I));return I}match(y,w,M,j){return new T(this,y,w,M,j)}countQuads(y,w,M,j){y=y&&(0,q.termToId)(y),w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._getGraphs(j),H=this._ids;let D,F,Q,E,Y=0;if(O(y)&&!(F=H[y])||O(w)&&!(Q=H[w])||O(M)&&!(E=H[M]))return 0;for(const U in I)(D=I[U])&&(Y+=y?M?this._countInIndex(D.objects,E,F,Q):this._countInIndex(D.subjects,F,Q,E):w?this._countInIndex(D.predicates,Q,E,F):this._countInIndex(D.objects,E,F,Q));return Y}forEach(y,w,M,j,I){this.some(H=>(y(H),!1),w,M,j,I)}every(y,w,M,j,I){let H=!1;const Y=!this.some(D=>(H=!0,!y(D)),w,M,j,I);return H&&Y}some(y,w,M,j,I){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j),I=I&&(0,q.termToId)(I);const H=this._getGraphs(I),Y=this._ids;let D,F,Q,E;if(O(w)&&!(F=Y[w])||O(M)&&!(Q=Y[M])||O(j)&&!(E=Y[j]))return!1;for(const U in H)if(D=H[U])if(F){if(E){if(this._findInIndex(D.objects,E,F,Q,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(D.subjects,F,Q,null,"subject","predicate","object",U,y,null))return!0}else if(Q){if(this._findInIndex(D.predicates,Q,E,null,"predicate","object","subject",U,y,null))return!0}else if(E){if(this._findInIndex(D.objects,E,null,null,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(D.subjects,null,null,null,"subject","predicate","object",U,y,null))return!0;return!1}getSubjects(y,w,M){const j=[];return this.forSubjects(I=>{j.push(I)},y,w,M),j}forSubjects(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.predicates,D,F,y):this._loopByKey1(Y.subjects,D,y):F?this._loopByKey0(Y.objects,F,y):this._loop(Y.subjects,y))}getPredicates(y,w,M){const j=[];return this.forPredicates(I=>{j.push(I)},y,w,M),j}forPredicates(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.objects,F,D,y):this._loopByKey0(Y.subjects,D,y):F?this._loopByKey1(Y.predicates,F,y):this._loop(Y.predicates,y))}getObjects(y,w,M){const j=[];return this.forObjects(I=>{j.push(I)},y,w,M),j}forObjects(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.subjects,D,F,y):this._loopByKey1(Y.objects,D,y):F?this._loopByKey0(Y.predicates,F,y):this._loop(Y.objects,y))}getGraphs(y,w,M){const j=[];return this.forGraphs(I=>{j.push(I)},y,w,M),j}forGraphs(y,w,M,j){for(const I in this._graphs)this.some(H=>(y(H.graph),!0),w,M,j,I)}createBlankNode(y){let w,M;if(y)for(w=y=`_:${y}`,M=1;this._ids[w];)w=y+M++;else do{w="_:b"+this._blankNodeIndex++}while(this._ids[w]);return this._ids[w]=++this._id,this._entities[this._id]=w,this._factory.blankNode(w.substr(2))}extractLists({remove:y=!1,ignoreErrors:w=!1}={}){const M={},j=w?()=>!0:(Y,D)=>{throw new Error(`${Y.value} ${D}`)},I=this.getQuads(null,L.default.rdf.rest,L.default.rdf.nil,null),H=y?[...I]:[];return I.forEach(Y=>{const D=[];let Q,E,F=!1;const U=Y.graph;let ie=Y.subject;for(;ie&&!F;){const ue=this.getQuads(null,null,ie,null),ee=this.getQuads(ie,null,null,null);let se,Te=null,me=null,te=null;for(let ye=0;ye{switch(v){case"data":O=y;break;case"end":T=y}}},(v,y)=>{v&&this.emit("error",v)||y&&this.push(y)},(v,y)=>{this.emit("prefix",v,y)}),this._transform=(v,y,w)=>{O(v),w()},this._flush=v=>{T(),v()}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var $,q=K("readable-stream"),V=($=K("./N3Writer"))&&$.__esModule?$:{default:$};he.default=class extends q.Transform{constructor(b){super({encoding:"utf8",writableObjectMode:!0});const S=this._writer=new V.default({write:(O,T,v)=>{this.push(O),v&&v()},end:O=>{this.push(null),O&&O()}},b);this._transform=(O,T,v)=>{S.addQuad(O,v)},this._flush=O=>{S.end(O)}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),b.on("prefix",(S,O)=>{this._writer.addPrefix(S,O)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.isDefaultGraph=S,he.inDefaultGraph=function(y){return S(y.graph)},he.prefix=function(y,w){return v({"":y},w)("")},he.prefixes=v;var y,q=(y=K("./N3DataFactory"))&&y.__esModule?y:{default:y};function S(y){return!!y&&"DefaultGraph"===y.termType}function v(y,w){const M=Object.create(null);for(const I in y)j(I,y[I]);function j(I,H){if("string"==typeof H){const Y=Object.create(null);M[I]=D=>Y[D]||(Y[D]=w.namedNode(H+D))}else if(!(I in M))throw new Error(`Unknown prefix: ${I}`);return M[I]}return w=w||q.default,j}},{"./N3DataFactory":35}],42:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,q=(H=K("./IRIs"))&&H.__esModule?H:{default:H},V=function(H,Y){if(!Y&&H&&H.__esModule)return H;if(null===H||"object"!=typeof H&&"function"!=typeof H)return{default:H};var D=re(Y);if(D&&D.has(H))return D.get(H);var F={},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in H)if("default"!==E&&Object.prototype.hasOwnProperty.call(H,E)){var U=Q?Object.getOwnPropertyDescriptor(H,E):null;U&&(U.get||U.set)?Object.defineProperty(F,E,U):F[E]=H[E]}return F.default=H,D&&D.set(H,F),F}(K("./N3DataFactory")),L=K("./N3Util");function re(H){if("function"!=typeof WeakMap)return null;var Y=new WeakMap,D=new WeakMap;return(re=function(F){return F?D:Y})(H)}const S=V.default.defaultGraph(),{rdf:O,xsd:T}=q.default,v=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,w={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class M extends V.Term{equals(){return!1}}function I(H){let Y=w[H];return void 0===Y&&(1===H.length?(Y=H.charCodeAt(0).toString(16),Y="\\u0000".substr(0,6-Y.length)+Y):(Y=(1024*(H.charCodeAt(0)-55296)+H.charCodeAt(1)+9216).toString(16),Y="\\U00000000".substr(0,10-Y.length)+Y)),Y}he.default=class{constructor(Y,D){if(this._prefixRegex=/$0^/,Y&&"function"!=typeof Y.write&&(D=Y,Y=null),this._lists=(D=D||{}).lists,Y)this._outputStream=Y,this._endStream=void 0===D.end||!!D.end;else{let F="";this._outputStream={write(Q,E,U){F+=Q,U&&U()},end:Q=>{Q&&Q(null,F)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(D.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=S,this._baseIRI=D.baseIRI,this._prefixIRIs=Object.create(null),D.prefixes&&this.addPrefixes(D.prefixes))}get _inDefaultGraph(){return S.equals(this._graph)}_write(Y,D){this._outputStream.write(Y,"utf8",D)}_writeQuad(Y,D,F,Q,E){try{Q.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(S.equals(Q)?"":`${this._encodeIriOrBlank(Q)} {\n`)),this._graph=Q,this._subject=null),Y.equals(this._subject)?D.equals(this._predicate)?this._write(`, ${this._encodeObject(F)}`,E):this._write(`;\n ${this._encodePredicate(this._predicate=D)} ${this._encodeObject(F)}`,E):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=Y)} ${this._encodePredicate(this._predicate=D)} ${this._encodeObject(F)}`,E)}catch(U){E&&E(U)}}_writeQuadLine(Y,D,F,Q,E){delete this._prefixMatch,this._write(this.quadToString(Y,D,F,Q),E)}quadToString(Y,D,F,Q){return`${this._encodeSubject(Y)} ${this._encodeIriOrBlank(D)} ${this._encodeObject(F)}${Q&&Q.value?` ${this._encodeIriOrBlank(Q)} .\n`:" .\n"}`}quadsToString(Y){return Y.map(D=>this.quadToString(D.subject,D.predicate,D.object,D.graph)).join("")}_encodeSubject(Y){return"Quad"===Y.termType?this._encodeQuad(Y):this._encodeIriOrBlank(Y)}_encodeIriOrBlank(Y){if("NamedNode"!==Y.termType)return this._lists&&Y.value in this._lists&&(Y=this.list(this._lists[Y.value])),"id"in Y?Y.id:`_:${Y.value}`;let D=Y.value;this._baseIRI&&D.startsWith(this._baseIRI)&&(D=D.substr(this._baseIRI.length)),v.test(D)&&(D=D.replace(y,I));const F=this._prefixRegex.exec(D);return F?F[1]?this._prefixIRIs[F[1]]+F[2]:D:`<${D}>`}_encodeLiteral(Y){let D=Y.value;if(v.test(D)&&(D=D.replace(y,I)),Y.language)return`"${D}"@${Y.language}`;if(this._lineMode){if(Y.datatype.value===T.string)return`"${D}"`}else switch(Y.datatype.value){case T.string:return`"${D}"`;case T.boolean:if("true"===D||"false"===D)return D;break;case T.integer:if(/^[+-]?\d+$/.test(D))return D;break;case T.decimal:if(/^[+-]?\d*\.\d+$/.test(D))return D;break;case T.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(D))return D}return`"${D}"^^${this._encodeIriOrBlank(Y.datatype)}`}_encodePredicate(Y){return Y.value===O.type?"a":this._encodeIriOrBlank(Y)}_encodeObject(Y){switch(Y.termType){case"Quad":return this._encodeQuad(Y);case"Literal":return this._encodeLiteral(Y);default:return this._encodeIriOrBlank(Y)}}_encodeQuad({subject:Y,predicate:D,object:F,graph:Q}){return`<<${this._encodeSubject(Y)} ${this._encodePredicate(D)} ${this._encodeObject(F)}${(0,L.isDefaultGraph)(Q)?"":` ${this._encodeIriOrBlank(Q)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(Y,D,F,Q,E){void 0===F?this._writeQuad(Y.subject,Y.predicate,Y.object,Y.graph,D):"function"==typeof Q?this._writeQuad(Y,D,F,S,Q):this._writeQuad(Y,D,F,Q||S,E)}addQuads(Y){for(let D=0;D.\n`)}if(F){let Q="",E="";for(const U in this._prefixIRIs)Q+=Q?`|${U}`:U,E+=(E?"|":"")+this._prefixIRIs[U];Q=Q.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${E})[^/]*$|^(${Q})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(F?"\n":"",D)}blank(Y,D){let Q,E,F=Y;switch(void 0===Y?F=[]:Y.termType?F=[{predicate:Y,object:D}]:"length"in Y||(F=[Y]),E=F.length){case 0:return new M("[]");case 1:if(Q=F[0],!(Q.object instanceof M))return new M(`[ ${this._encodePredicate(Q.predicate)} ${this._encodeObject(Q.object)} ]`);default:let U="[";for(let ie=0;ie{D=null,Y(F,Q)});if(this._endStream)try{return this._outputStream.end(D)}catch(F){}D&&D()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return O.Term}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return O.NamedNode}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return O.Literal}}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return O.BlankNode}}),Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return O.Variable}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return O.DefaultGraph}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return O.Quad}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return O.Triple}}),Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return O.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return O.termToId}}),he.Util=void 0;var q=y(K("./N3Lexer")),V=y(K("./N3Parser")),L=y(K("./N3Writer")),re=y(K("./N3Store")),$=y(K("./N3StreamParser")),b=y(K("./N3StreamWriter")),S=v(K("./N3Util"));he.Util=S;var O=v(K("./N3DataFactory"));function T(w){if("function"!=typeof WeakMap)return null;var M=new WeakMap,j=new WeakMap;return(T=function(I){return I?j:M})(w)}function v(w,M){if(!M&&w&&w.__esModule)return w;if(null===w||"object"!=typeof w&&"function"!=typeof w)return{default:w};var j=T(M);if(j&&j.has(w))return j.get(w);var I={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Y in w)if("default"!==Y&&Object.prototype.hasOwnProperty.call(w,Y)){var D=H?Object.getOwnPropertyDescriptor(w,Y):null;D&&(D.get||D.set)?Object.defineProperty(I,Y,D):I[Y]=w[Y]}return I.default=w,j&&j.set(w,I),I}function y(w){return w&&w.__esModule?w:{default:w}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(K,Ae,he){var V,L,q=Ae.exports={};function re(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function b(H){if(V===setTimeout)return setTimeout(H,0);if((V===re||!V)&&setTimeout)return V=setTimeout,setTimeout(H,0);try{return V(H,0)}catch(Y){try{return V.call(null,H,0)}catch(D){return V.call(this,H,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:re}catch(H){V=re}try{L="function"==typeof clearTimeout?clearTimeout:$}catch(H){L=$}}();var v,O=[],T=!1,y=-1;function w(){!T||!v||(T=!1,v.length?O=v.concat(O):y=-1,O.length&&M())}function M(){if(!T){var H=b(w);T=!0;for(var Y=O.length;Y;){for(v=O,O=[];++y1)for(var D=1;D(V||(V=Promise.resolve())).then(L).catch(re=>setTimeout(()=>{throw re},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(K,Ae,he){Ae.exports=K("./lib")},{"./lib":55}],47:[function(K,Ae,he){"use strict";Ae.exports=class I7{constructor(V,L=new Map,re=0){this.prefix=V,this._existing=L,this.counter=re}clone(){const{prefix:V,_existing:L,counter:re}=this;return new I7(V,new Map(L),re)}getId(V){const L=V&&this._existing.get(V);if(L)return L;const re=this.prefix+this.counter;return this.counter++,V&&this._existing.set(V,re),re}hasId(V){return this._existing.has(V)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(K,Ae,he){"use strict";K("setimmediate");const q=self.crypto||self.msCrypto;Ae.exports=class{constructor(L){if(!q||!q.subtle)throw new Error("crypto.subtle not found.");if("sha256"===L)this.algorithm={name:"SHA-256"};else{if("sha1"!==L)throw new Error(`Unsupport algorithm "${L}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(L){this._content+=L}digest(){var L=this;return gt(function*(){const re=(new TextEncoder).encode(L._content),$=new Uint8Array(yield q.subtle.digest(L.algorithm,re));let b="";for(let S=0;S<$.length;++S)b+=$[S].toString(16).padStart(2,"0");return b})()}}},{setimmediate:86}],49:[function(K,Ae,he){"use strict";const L="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",re="http://www.w3.org/2001/XMLSchema#string",$="NamedNode",b="BlankNode",S="Literal",O="DefaultGraph",T={};function v(I,H){return I.subject.termType===H.subject.termType&&I.object.termType===H.object.termType&&I.subject.value===H.subject.value&&I.predicate.value===H.predicate.value&&I.object.value===H.object.value&&(I.object.termType!==S||I.object.datatype.termType===H.object.datatype.termType&&I.object.language===H.object.language&&I.object.datatype.value===H.object.datatype.value)}T.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,T.empty=new RegExp("^[ \\t]*$"),T.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),Ae.exports=class SP{static parse(H){const Y=[],D={},F=H.split(T.eoln);let Q=0;for(const E of F){if(Q++,T.empty.test(E))continue;const U=E.match(T.quad);if(null===U)throw new Error("N-Quads parse error on line "+Q+".");const ie={subject:null,predicate:null,object:null,graph:null};if(ie.subject=void 0!==U[1]?{termType:$,value:U[1]}:{termType:b,value:U[2]},ie.predicate={termType:$,value:U[3]},void 0!==U[4]?ie.object={termType:$,value:U[4]}:void 0!==U[5]?ie.object={termType:b,value:U[5]}:(ie.object={termType:S,value:void 0,datatype:{termType:$}},void 0!==U[7]?ie.object.datatype.value=U[7]:void 0!==U[8]?(ie.object.datatype.value=L,ie.object.language=U[8]):ie.object.datatype.value=re,ie.object.value=U[6].replace(M,function(H,Y,D,F){if(Y)switch(Y){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(D)return String.fromCharCode(parseInt(D,16));if(F)throw new Error("Unsupported U escape")})),ie.graph=void 0!==U[9]?{termType:$,value:U[9]}:void 0!==U[10]?{termType:b,value:U[10]}:{termType:O,value:""},ie.graph.value in D){let ue=!0;const ee=D[ie.graph.value];for(const se of ee)if(v(se,ie)){ue=!1;break}ue&&(ee.push(ie),Y.push(ie))}else D[ie.graph.value]=[ie],Y.push(ie)}return Y}static serialize(H){Array.isArray(H)||(H=SP.legacyDatasetToQuads(H));const Y=[];for(const D of H)Y.push(SP.serializeQuad(D));return Y.sort().join("")}static serializeQuad(H){const Y=H.subject,F=H.object,Q=H.graph;let E="";return E+=Y.termType===$?`<${Y.value}>`:`${Y.value}`,E+=` <${H.predicate.value}> `,F.termType===$?E+=`<${F.value}>`:F.termType===b?E+=F.value:(E+=`"${I=F.value,I.replace(y,function(H){switch(H){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,F.datatype.value===L?F.language&&(E+=`@${F.language}`):F.datatype.value!==re&&(E+=`^^<${F.datatype.value}>`)),Q.termType===$?E+=` <${Q.value}>`:Q.termType===b&&(E+=` ${Q.value}`),E+=" .\n",E;var I}static legacyDatasetToQuads(H){const Y=[],D={"blank node":b,IRI:$,literal:S};for(const F in H)H[F].forEach(E=>{const U={};for(const ie in E){const ue=E[ie],ee={termType:D[ue.type],value:ue.value};ee.termType===S&&(ee.datatype={termType:$},"datatype"in ue&&(ee.datatype.value=ue.datatype),"language"in ue?("datatype"in ue||(ee.datatype.value=L),ee.language=ue.language):"datatype"in ue||(ee.datatype.value=re)),U[ie]=ee}U.graph="@default"===F?{termType:O,value:""}:{termType:F.startsWith("_:")?b:$,value:F},Y.push(U)});return Y}};const y=/["\\\n\r]/g;const M=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(K,Ae,he){"use strict";Ae.exports=class{constructor(V){this.current=V.sort(),this.done=!1,this.dir=new Map;for(let L=0;L$)&&(v&&O>0&&T>V[O-1]||!v&&OV[O+1])&&($=T,b=O)}if(null===$)this.done=!0;else{const O=L.get($)?b-1:b+1;V[b]=V[O],V[O]=$;for(const T of V)T>$&&L.set(T,!L.get(T))}return re}}},{}],51:[function(K,Ae,he){(function(q){(function(){"use strict";const V=K("./IdentifierIssuer"),L=K("./MessageDigest"),re=K("./Permuter"),$=K("./NQuads");function b(S,O){return S.hashO.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new V("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(O){var T=this;return gt(function*(){T.quads=O;for(const H of O)T._addBlankNodeQuadInfo({quad:H,component:H.subject}),T._addBlankNodeQuadInfo({quad:H,component:H.object}),T._addBlankNodeQuadInfo({quad:H,component:H.graph});const v=new Map,y=[...T.blankNodeInfo.keys()];let w=0;for(const H of y)++w%100==0&&(yield T._yield()),yield T._hashAndTrackBlankNode({id:H,hashToBlankNodes:v});const M=[...v.keys()].sort(),j=[];for(const H of M){const Y=v.get(H);Y.length>1?j.push(Y):T.canonicalIssuer.getId(Y[0])}for(const H of j){const Y=[];for(const D of H){if(T.canonicalIssuer.hasId(D))continue;const F=new V("_:b");F.getId(D);const Q=yield T.hashNDegreeQuads(D,F);Y.push(Q)}Y.sort(b);for(const D of Y){const F=D.issuer.getOldIds();for(const Q of F)T.canonicalIssuer.getId(Q)}}const I=[];for(const H of T.quads){const Y=ht({},H);Y.subject=T._useCanonicalId({component:Y.subject}),Y.object=T._useCanonicalId({component:Y.object}),Y.graph=T._useCanonicalId({component:Y.graph}),I.push($.serializeQuad(Y))}return I.sort(),I.join("")})()}hashFirstDegreeQuads(O){var T=this;return gt(function*(){const v=[],y=T.blankNodeInfo.get(O),w=y.quads;for(const j of w){const I={subject:null,predicate:j.predicate,object:null,graph:null};I.subject=T.modifyFirstDegreeComponent(O,j.subject,"subject"),I.object=T.modifyFirstDegreeComponent(O,j.object,"object"),I.graph=T.modifyFirstDegreeComponent(O,j.graph,"graph"),v.push($.serializeQuad(I))}v.sort();const M=new L(T.hashAlgorithm);for(const j of v)M.update(j);return y.hash=yield M.digest(),y.hash})()}hashRelatedBlankNode(O,T,v,y){var w=this;return gt(function*(){let M;M=w.canonicalIssuer.hasId(O)?w.canonicalIssuer.getId(O):v.hasId(O)?v.getId(O):w.blankNodeInfo.get(O).hash;const j=new L(w.hashAlgorithm);return j.update(y),"g"!==y&&j.update(w.getRelatedPredicate(T)),j.update(M),j.digest()})()}hashNDegreeQuads(O,T){var v=this;return gt(function*(){const y=new L(v.hashAlgorithm),w=yield v.createHashToRelated(O,T),M=[...w.keys()].sort();for(const j of M){y.update(j);let H,I="";const Y=new re(w.get(j));let D=0;for(;Y.hasNext();){const F=Y.next();++D%3==0&&(yield v._yield());let Q=T.clone(),E="";const U=[];let ie=!1;for(const ue of F)if(v.canonicalIssuer.hasId(ue)?E+=v.canonicalIssuer.getId(ue):(Q.hasId(ue)||U.push(ue),E+=Q.getId(ue)),0!==I.length&&E>I){ie=!0;break}if(!ie){for(const ue of U){const ee=yield v.hashNDegreeQuads(ue,Q);if(E+=Q.getId(ue),E+=`<${ee.hash}>`,Q=ee.issuer,0!==I.length&&E>I){ie=!0;break}}ie||(0===I.length||E`}createHashToRelated(O,T){var v=this;return gt(function*(){const y=new Map,w=v.blankNodeInfo.get(O).quads;let M=0;for(const j of w)++M%100==0&&(yield v._yield()),yield Promise.all([v._addRelatedBlankNodeHash({quad:j,component:j.subject,position:"s",id:O,issuer:T,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.object,position:"o",id:O,issuer:T,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.graph,position:"g",id:O,issuer:T,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:O,hashToBlankNodes:T}){var v=this;return gt(function*(){const y=yield v.hashFirstDegreeQuads(O),w=T.get(y);w?w.push(O):T.set(y,[O])})()}_addBlankNodeQuadInfo({quad:O,component:T}){if("BlankNode"!==T.termType)return;const v=T.value,y=this.blankNodeInfo.get(v);y?y.quads.add(O):this.blankNodeInfo.set(v,{quads:new Set([O]),hash:null})}_addRelatedBlankNodeHash({quad:O,component:T,position:v,id:y,issuer:w,hashToRelated:M}){var j=this;return gt(function*(){if("BlankNode"!==T.termType||T.value===y)return;const I=T.value,H=yield j.hashRelatedBlankNode(I,O,w,v),Y=M.get(H);Y?Y.push(I):M.set(H,[I])})()}_useCanonicalId({component:O}){return"BlankNode"!==O.termType||O.value.startsWith(this.canonicalIssuer.prefix)?O:{termType:"BlankNode",value:this.canonicalIssuer.getId(O.value)}}_yield(){return gt(function*(){return new Promise(O=>q(O))})()}}}).call(this)}).call(this,K("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(K,Ae,he){"use strict";const q=K("./IdentifierIssuer"),V=K("./MessageDigest"),L=K("./Permuter"),re=K("./NQuads");function $(b,S){return b.hashS.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new q("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(S){this.quads=S;for(const M of S)this._addBlankNodeQuadInfo({quad:M,component:M.subject}),this._addBlankNodeQuadInfo({quad:M,component:M.object}),this._addBlankNodeQuadInfo({quad:M,component:M.graph});const O=new Map,T=[...this.blankNodeInfo.keys()];for(const M of T)this._hashAndTrackBlankNode({id:M,hashToBlankNodes:O});const v=[...O.keys()].sort(),y=[];for(const M of v){const j=O.get(M);j.length>1?y.push(j):this.canonicalIssuer.getId(j[0])}for(const M of y){const j=[];for(const I of M){if(this.canonicalIssuer.hasId(I))continue;const H=new q("_:b");H.getId(I);const Y=this.hashNDegreeQuads(I,H);j.push(Y)}j.sort($);for(const I of j){const H=I.issuer.getOldIds();for(const Y of H)this.canonicalIssuer.getId(Y)}}const w=[];for(const M of this.quads){const j=ht({},M);j.subject=this._useCanonicalId({component:j.subject}),j.object=this._useCanonicalId({component:j.object}),j.graph=this._useCanonicalId({component:j.graph}),w.push(re.serializeQuad(j))}return w.sort(),w.join("")}hashFirstDegreeQuads(S){const O=[],T=this.blankNodeInfo.get(S),v=T.quads;for(const w of v){const M={subject:null,predicate:w.predicate,object:null,graph:null};M.subject=this.modifyFirstDegreeComponent(S,w.subject,"subject"),M.object=this.modifyFirstDegreeComponent(S,w.object,"object"),M.graph=this.modifyFirstDegreeComponent(S,w.graph,"graph"),O.push(re.serializeQuad(M))}O.sort();const y=new V(this.hashAlgorithm);for(const w of O)y.update(w);return T.hash=y.digest(),T.hash}hashRelatedBlankNode(S,O,T,v){let y;y=this.canonicalIssuer.hasId(S)?this.canonicalIssuer.getId(S):T.hasId(S)?T.getId(S):this.blankNodeInfo.get(S).hash;const w=new V(this.hashAlgorithm);return w.update(v),"g"!==v&&w.update(this.getRelatedPredicate(O)),w.update(y),w.digest()}hashNDegreeQuads(S,O){const T=new V(this.hashAlgorithm),v=this.createHashToRelated(S,O),y=[...v.keys()].sort();for(const w of y){T.update(w);let j,M="";const I=new L(v.get(w));for(;I.hasNext();){const H=I.next();let Y=O.clone(),D="";const F=[];let Q=!1;for(const E of H)if(this.canonicalIssuer.hasId(E)?D+=this.canonicalIssuer.getId(E):(Y.hasId(E)||F.push(E),D+=Y.getId(E)),0!==M.length&&D>M){Q=!0;break}if(!Q){for(const E of F){const U=this.hashNDegreeQuads(E,Y);if(D+=Y.getId(E),D+=`<${U.hash}>`,Y=U.issuer,0!==M.length&&D>M){Q=!0;break}}Q||(0===M.length||D`}createHashToRelated(S,O){const T=new Map,v=this.blankNodeInfo.get(S).quads;for(const y of v)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:S,issuer:O,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:S,issuer:O,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:S,issuer:O,hashToRelated:T});return T}_hashAndTrackBlankNode({id:S,hashToBlankNodes:O}){const T=this.hashFirstDegreeQuads(S),v=O.get(T);v?v.push(S):O.set(T,[S])}_addBlankNodeQuadInfo({quad:S,component:O}){if("BlankNode"!==O.termType)return;const T=O.value,v=this.blankNodeInfo.get(T);v?v.quads.add(S):this.blankNodeInfo.set(T,{quads:new Set([S]),hash:null})}_addRelatedBlankNodeHash({quad:S,component:O,position:T,id:v,issuer:y,hashToRelated:w}){if("BlankNode"!==O.termType||O.value===v)return;const M=O.value,j=this.hashRelatedBlankNode(M,S,y,T),I=w.get(j);I?I.push(M):w.set(j,[M])}_useCanonicalId({component:S}){return"BlankNode"!==S.termType||S.value.startsWith(this.canonicalIssuer.prefix)?S:{termType:"BlankNode",value:this.canonicalIssuer.getId(S.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(K,Ae,he){"use strict";const q=K("./URDNA2015");Ae.exports=class extends q{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){var $=this;return gt(function*(){const b=new Map,S=$.blankNodeInfo.get(L).quads;let O=0;for(const T of S){let v,y;if("BlankNode"===T.subject.termType&&T.subject.value!==L)y=T.subject.value,v="p";else{if("BlankNode"!==T.object.termType||T.object.value===L)continue;y=T.object.value,v="r"}++O%100==0&&(yield $._yield());const w=yield $.hashRelatedBlankNode(y,T,re,v),M=b.get(w);M?M.push(y):b.set(w,[y])}return b})()}}},{"./URDNA2015":51}],54:[function(K,Ae,he){"use strict";const q=K("./URDNA2015Sync");Ae.exports=class extends q{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){const $=new Map,b=this.blankNodeInfo.get(L).quads;for(const S of b){let O,T;if("BlankNode"===S.subject.termType&&S.subject.value!==L)T=S.subject.value,O="p";else{if("BlankNode"!==S.object.termType||S.object.value===L)continue;T=S.object.value,O="r"}const v=this.hashRelatedBlankNode(T,S,re,O),y=$.get(v);y?y.push(T):$.set(v,[T])}return $}}},{"./URDNA2015Sync":52}],55:[function(K,Ae,he){"use strict";const q=K("./URDNA2015"),V=K("./URGNA2012"),L=K("./URDNA2015Sync"),re=K("./URGNA2012Sync");let $;try{$=K("rdf-canonize-native")}catch(S){}const b={};Ae.exports=b,b.NQuads=K("./NQuads"),b.IdentifierIssuer=K("./IdentifierIssuer"),b._rdfCanonizeNative=function(S){return S&&($=S),$},b.canonize=function(){var S=gt(function*(O,T){if(Array.isArray(O)||(O=b.NQuads.legacyDatasetToQuads(O)),T.useNative){if(!$)throw new Error("rdf-canonize-native not available");return new Promise((v,y)=>$.canonize(O,T,(w,M)=>w?y(w):v(M)))}if("URDNA2015"===T.algorithm)return new q(T).main(O);if("URGNA2012"===T.algorithm)return new V(T).main(O);throw"algorithm"in T?new Error("Invalid RDF Dataset Canonicalization algorithm: "+T.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(O,T){return S.apply(this,arguments)}}(),b._canonizeSync=function(S,O){if(Array.isArray(S)||(S=b.NQuads.legacyDatasetToQuads(S)),O.useNative){if($)return $.canonizeSync(S,O);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===O.algorithm)return new L(O).main(S);if("URGNA2012"===O.algorithm)return new re(O).main(S);throw"algorithm"in O?new Error("Invalid RDF Dataset Canonicalization algorithm: "+O.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(K,Ae,he){"use strict";var q=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&q(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(K("./lib/BlankNode"),he),V(K("./lib/DataFactory"),he),V(K("./lib/DefaultGraph"),he),V(K("./lib/Literal"),he),V(K("./lib/NamedNode"),he),V(K("./lib/Quad"),he),V(K("./lib/Variable"),he)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(L){this.termType="BlankNode",this.value=L}equals(L){return!!L&&"BlankNode"===L.termType&&L.value===this.value}}},{}],58:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const q=K("./BlankNode"),V=K("./DefaultGraph"),L=K("./Literal"),re=K("./NamedNode"),$=K("./Quad"),b=K("./Variable");let S=0;he.DataFactory=class{constructor(v){this.blankNodeCounter=0,this.blankNodePrefix=(v=v||{}).blankNodePrefix||`df_${S++}_`}namedNode(v){return new re.NamedNode(v)}blankNode(v){return new q.BlankNode(v||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(v,y){return new L.Literal(v,y)}variable(v){return new b.Variable(v)}defaultGraph(){return V.DefaultGraph.INSTANCE}quad(v,y,w,M){return new $.Quad(v,y,w,M||this.defaultGraph())}fromTerm(v){switch(v.termType){case"NamedNode":return this.namedNode(v.value);case"BlankNode":return this.blankNode(v.value);case"Literal":return v.language?this.literal(v.value,v.language):v.datatype.equals(L.Literal.XSD_STRING)?this.literal(v.value):this.literal(v.value,this.fromTerm(v.datatype));case"Variable":return this.variable(v.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(v.subject),this.fromTerm(v.predicate),this.fromTerm(v.object),this.fromTerm(v.graph))}}fromQuad(v){return this.fromTerm(v)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class q{constructor(){this.termType="DefaultGraph",this.value=""}equals(L){return!!L&&"DefaultGraph"===L.termType}}he.DefaultGraph=q,q.INSTANCE=new q},{}],60:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const q=K("./NamedNode");class V{constructor(re,$){this.termType="Literal",this.value=re,"string"==typeof $?(this.language=$,this.datatype=V.RDF_LANGUAGE_STRING):$?(this.language="",this.datatype=$):(this.language="",this.datatype=V.XSD_STRING)}equals(re){return!!re&&"Literal"===re.termType&&re.value===this.value&&re.language===this.language&&re.datatype.equals(this.datatype)}}he.Literal=V,V.RDF_LANGUAGE_STRING=new q.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),V.XSD_STRING=new q.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(L){this.termType="NamedNode",this.value=L}equals(L){return!!L&&"NamedNode"===L.termType&&L.value===this.value}}},{}],62:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(L,re,$,b){this.termType="Quad",this.value="",this.subject=L,this.predicate=re,this.object=$,this.graph=b}equals(L){return!!L&&("Quad"===L.termType||!L.termType)&&this.subject.equals(L.subject)&&this.predicate.equals(L.predicate)&&this.object.equals(L.object)&&this.graph.equals(L.graph)}}},{}],63:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(L){this.termType="Variable",this.value=L}equals(L){return!!L&&"Variable"===L.termType&&L.value===this.value}}},{}],64:[function(K,Ae,he){"use strict";var q=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&q(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(K("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class q extends Error{constructor(L,re){const $=L.saxStream._parser;super(L.trackPosition?`Line ${$.line+1} column ${$.column+1}: ${re}`:re)}}he.ParseError=q},{}],66:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const q=K("relative-to-absolute-iri"),V=K("sax"),L=K("stream"),re=K("./ParseError"),$=K("rdf-data-factory");class b extends L.Transform{constructor(T){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},T&&(Object.assign(this,T),this.options=T),this.dataFactory||(this.dataFactory=new $.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=V.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(T,v){const y={};let w=!1;for(const j in T.attributes)j.startsWith("xmlns")&&(5===j.length?(w=!0,y[""]=T.attributes[j]):":"===j.charAt(5)&&(w=!0,y[j.substr(6)]=T.attributes[j]));const M=v&&v.ns?v.ns:[b.DEFAULT_NS];return w?M.concat([y]):M}static expandPrefixedTerm(T,v,y){const w=T.indexOf(":");let M,j;w>=0?(M=T.substr(0,w),j=T.substr(w+1)):(M="",j=T);let I=null,H=null;for(let Y=v.length-1;Y>=0;Y--){const D=v[Y][M];if(D){I=D;break}H||(H=v[Y][""])}if(!I){if(M&&"xmlns"!==M)throw new re.ParseError(y,`The prefix '${M}' in term '${T}' was not bound.`);I=H||""}return{prefix:M,local:j,uri:I}}static isValidIri(T){return b.IRI_REGEX.test(T)}import(T){const v=new L.PassThrough({readableObjectMode:!0});T.on("error",w=>y.emit("error",w)),T.on("data",w=>v.push(w)),T.on("end",()=>v.push(null));const y=v.pipe(new b(this.options));return y}_transform(T,v,y){try{this.saxStream.write(T,v)}catch(w){return y(w)}y()}newParseError(T){return new re.ParseError(this,T)}valueToUri(T,v){return this.uriToNamedNode(q.resolve(T,v.baseIRI))}uriToNamedNode(T){if(!b.isValidIri(T))throw this.newParseError(`Invalid URI: ${T}`);return this.dataFactory.namedNode(T)}validateNcname(T){if(!b.NCNAME_MATCHER.test(T))throw this.newParseError(`Not a valid NCName: ${T}`)}attachSaxListeners(){this.saxStream.on("error",T=>this.emit("error",T)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(T){const v=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=S.RESOURCE;if(v&&(v.hadChildren=!0,y=v.childrenParseType),v&&v.childrenStringTags){const M=T.name;let j="";for(const D in T.attributes)j+=` ${D}="${T.attributes[D]}"`;v.childrenStringTags.push(`<${M}${j}>`);const Y={childrenStringTags:v.childrenStringTags};return Y.childrenStringEmitClosingTag=``,void this.activeTagStack.push(Y)}const w={};v?(w.language=v.language,w.baseIRI=v.baseIRI):w.baseIRI=this.baseIRI,this.activeTagStack.push(w),w.ns=b.parseNamespace(T,v),y===S.RESOURCE?this.onTagResource(T,w,v,!v):this.onTagProperty(T,w,v)}onTagResource(T,v,y,w){const M=b.expandPrefixedTerm(T.name,v.ns,this);v.childrenParseType=S.PROPERTY;let j=!0;if(M.uri===b.RDF){if(!w&&b.FORBIDDEN_NODE_ELEMENTS.indexOf(M.local)>=0)throw this.newParseError(`Illegal node element name: ${M.local}`);switch(M.local){case"RDF":v.childrenParseType=S.RESOURCE;case"Description":j=!1}}const I=[],H=[];let Y=null,D=!1,F=!1,Q=null;for(const E in T.attributes){const U=T.attributes[E],ie=b.expandPrefixedTerm(E,v.ns,this);if(y&&ie.uri===b.RDF)switch(ie.local){case"about":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);Y=U;continue;case"ID":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);this.validateNcname(U),Y="#"+U,D=!0;continue;case"nodeID":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);this.validateNcname(U),Y=U,F=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":Q=U;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(ie.uri===b.XML){if("lang"===ie.local){v.language=""===U?null:U.toLowerCase();continue}if("base"===ie.local){v.baseIRI=q.resolve(U,v.baseIRI);continue}}"xml"!==ie.prefix&&ie.uri&&(I.push(this.uriToNamedNode(ie.uri+ie.local)),H.push(U))}if(null!==Y&&(v.subject=F?this.dataFactory.blankNode(Y):this.valueToUri(Y,v),D&&this.claimNodeId(v.subject)),v.subject||(v.subject=this.dataFactory.blankNode()),j){const E=this.uriToNamedNode(M.uri+M.local);this.emitTriple(v.subject,this.dataFactory.namedNode(b.RDF+"type"),E,y?y.reifiedStatementId:null)}if(y){if(y.predicate)if(y.childrenCollectionSubject){const E=this.dataFactory.blankNode();this.emitTriple(y.childrenCollectionSubject,y.childrenCollectionPredicate,E,y.reifiedStatementId),this.emitTriple(E,this.dataFactory.namedNode(b.RDF+"first"),v.subject,v.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(b.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,v.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${w.local}`);v.predicateSubPredicates=[],v.predicateSubObjects=[];let M=!1,j=!1,I=null,H=!0;const Y=[],D=[];for(const F in T.attributes){const Q=T.attributes[F],E=b.expandPrefixedTerm(F,v.ns,this);if(E.uri===b.RDF)switch(E.local){case"resource":if(I)throw this.newParseError(`Found both rdf:resource (${Q}) and rdf:nodeID (${I}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${Q})`);v.hadChildren=!0,I=Q,H=!1;continue;case"datatype":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${Q}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${Q})`);v.datatype=this.valueToUri(Q,v);continue;case"nodeID":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${Q}).`);if(v.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${Q}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${Q})`);this.validateNcname(Q),v.hadChildren=!0,I=Q,H=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(j)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(v.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${v.datatype.value})`);if(I)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${I})`);if("Resource"===Q){M=!0,v.childrenParseType=S.PROPERTY;const U=this.dataFactory.blankNode();this.emitTriple(v.subject,v.predicate,U,v.reifiedStatementId),v.subject=U,v.predicate=null}else"Collection"===Q?(M=!0,v.hadChildren=!0,v.childrenCollectionSubject=v.subject,v.childrenCollectionPredicate=v.predicate,H=!1):"Literal"===Q&&(M=!0,v.childrenTagsToString=!0,v.childrenStringTags=[]);continue;case"ID":this.validateNcname(Q),v.reifiedStatementId=this.valueToUri("#"+Q,v),this.claimNodeId(v.reifiedStatementId);continue}else if(E.uri===b.XML&&"lang"===E.local){v.language=""===Q?null:Q.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(M||v.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${Q}`);v.hadChildren=!0,j=!0,Y.push(this.uriToNamedNode(E.uri+E.local)),D.push(this.dataFactory.literal(Q,v.datatype||v.language))}}if(null!==I){const F=v.subject;v.subject=H?this.dataFactory.blankNode(I):this.valueToUri(I,v),this.emitTriple(F,v.predicate,v.subject,v.reifiedStatementId);for(let Q=0;Q/g,(v,y,w)=>(this.saxStream._parser.ENTITIES[y]=w,""))}}var S,O;he.RdfXmlParser=b,b.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,b.MIME_TYPE="application/rdf+xml",b.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",b.XML="http://www.w3.org/XML/1998/namespace",b.XMLNS="http://www.w3.org/2000/xmlns/",b.DEFAULT_NS={xml:b.XML},b.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],b.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],b.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,(O=S=he.ParseType||(he.ParseType={}))[O.RESOURCE=0]="RESOURCE",O[O.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(K,Ae,he){"use strict";var V={};function L(O,T,v){v||(v=Error);var w=function(M){function j(I,H,Y){return M.call(this,function(M,j,I){return"string"==typeof T?T:T(M,j,I)}(I,H,Y))||this}return function(O,T){O.prototype=Object.create(T.prototype),O.prototype.constructor=O,O.__proto__=T}(j,M),j}(v);w.prototype.name=v.name,w.prototype.code=O,V[O]=w}function re(O,T){if(Array.isArray(O)){var v=O.length;return O=O.map(function(y){return String(y)}),v>2?"one of ".concat(T," ").concat(O.slice(0,v-1).join(", "),", or ")+O[v-1]:2===v?"one of ".concat(T," ").concat(O[0]," or ").concat(O[1]):"of ".concat(T," ").concat(O[0])}return"of ".concat(T," ").concat(String(O))}L("ERR_INVALID_OPT_VALUE",function(O,T){return'The value "'+T+'" is invalid for option "'+O+'"'},TypeError),L("ERR_INVALID_ARG_TYPE",function(O,T,v){var y,w;if("string"==typeof T&&function(O,T,v){return O.substr(!v||v<0?0:+v,T.length)===T}(T,"not ")?(y="must not be",T=T.replace(/^not /,"")):y="must be",function(O,T,v){return(void 0===v||v>O.length)&&(v=O.length),O.substring(v-T.length,v)===T}(O," argument"))w="The ".concat(O," ").concat(y," ").concat(re(T,"type"));else{var M=function(O,T,v){return"number"!=typeof v&&(v=0),!(v+T.length>O.length)&&-1!==O.indexOf(T,v)}(O,".")?"property":"argument";w='The "'.concat(O,'" ').concat(M," ").concat(y," ").concat(re(T,"type"))}return w+". Received type ".concat(typeof v)},TypeError),L("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),L("ERR_METHOD_NOT_IMPLEMENTED",function(O){return"The "+O+" method is not implemented"}),L("ERR_STREAM_PREMATURE_CLOSE","Premature close"),L("ERR_STREAM_DESTROYED",function(O){return"Cannot call "+O+" after a stream was destroyed"}),L("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),L("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),L("ERR_STREAM_WRITE_AFTER_END","write after end"),L("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),L("ERR_UNKNOWN_ENCODING",function(O){return"Unknown encoding: "+O},TypeError),L("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.exports.codes=V},{}],68:[function(K,Ae,he){(function(q){(function(){"use strict";var V=Object.keys||function(y){var w=[];for(var M in y)w.push(M);return w};Ae.exports=O;var L=K("./_stream_readable"),re=K("./_stream_writable");K("inherits")(O,L);for(var $=V(re.prototype),b=0;b<$.length;b++){var S=$[b];O.prototype[S]||(O.prototype[S]=re.prototype[S])}function O(y){if(!(this instanceof O))return new O(y);L.call(this,y),re.call(this,y),this.allowHalfOpen=!0,y&&(!1===y.readable&&(this.readable=!1),!1===y.writable&&(this.writable=!1),!1===y.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",T)))}function T(){this._writableState.ended||q.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(w){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=w,this._writableState.destroyed=w)}})}).call(this)}).call(this,K("_process"))},{"./_stream_readable":70,"./_stream_writable":72,_process:44,inherits:10}],69:[function(K,Ae,he){"use strict";Ae.exports=V;var q=K("./_stream_transform");function V(L){if(!(this instanceof V))return new V(L);q.call(this,L)}K("inherits")(V,q),V.prototype._transform=function(L,re,$){$(null,L)}},{"./_stream_transform":71,inherits:10}],70:[function(K,Ae,he){(function(q,V){(function(){"use strict";var L;Ae.exports=te,te.ReadableState=me,K("events");var $=function(B,R){return B.listeners(R).length},b=K("./internal/streams/stream"),S=K("buffer").Buffer,O=V.Uint8Array||function(){};var w,y=K("util");w=y&&y.debuglog?y.debuglog("stream"):function(){};var U,ie,ue,M=K("./internal/streams/buffer_list"),j=K("./internal/streams/destroy"),H=K("./internal/streams/state").getHighWaterMark,Y=K("../errors").codes,D=Y.ERR_INVALID_ARG_TYPE,F=Y.ERR_STREAM_PUSH_AFTER_EOF,Q=Y.ERR_METHOD_NOT_IMPLEMENTED,E=Y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;K("inherits")(te,b);var ee=j.errorOrDestroy,se=["error","close","destroy","pause","resume"];function me(fe,B,R){L=L||K("./_stream_duplex"),"boolean"!=typeof R&&(R=B instanceof L),this.objectMode=!!(fe=fe||{}).objectMode,R&&(this.objectMode=this.objectMode||!!fe.readableObjectMode),this.highWaterMark=H(this,fe,"readableHighWaterMark",R),this.buffer=new M,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==fe.emitClose,this.autoDestroy=!!fe.autoDestroy,this.destroyed=!1,this.defaultEncoding=fe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,fe.encoding&&(U||(U=K("string_decoder/").StringDecoder),this.decoder=new U(fe.encoding),this.encoding=fe.encoding)}function te(fe){if(L=L||K("./_stream_duplex"),!(this instanceof te))return new te(fe);this._readableState=new me(fe,this,this instanceof L),this.readable=!0,fe&&("function"==typeof fe.read&&(this._read=fe.read),"function"==typeof fe.destroy&&(this._destroy=fe.destroy)),b.call(this)}function ye(fe,B,R,k,Oe){w("readableAddChunk",B);var yt,Xe=fe._readableState;if(null===B)Xe.reading=!1,function(fe,B){if(w("onEofChunk"),!B.ended){if(B.decoder){var R=B.decoder.end();R&&R.length&&(B.buffer.push(R),B.length+=B.objectMode?1:R.length)}B.ended=!0,B.sync?je(fe):(B.needReadable=!1,B.emittedReadable||(B.emittedReadable=!0,Le(fe)))}}(fe,Xe);else if(Oe||(yt=function(fe,B){var R;return!function(fe){return S.isBuffer(fe)||fe instanceof O}(B)&&"string"!=typeof B&&void 0!==B&&!fe.objectMode&&(R=new D("chunk",["string","Buffer","Uint8Array"],B)),R}(Xe,B)),yt)ee(fe,yt);else if(Xe.objectMode||B&&B.length>0)if("string"!=typeof B&&!Xe.objectMode&&Object.getPrototypeOf(B)!==S.prototype&&(B=function(fe){return S.from(fe)}(B)),k)Xe.endEmitted?ee(fe,new E):De(fe,Xe,B,!0);else if(Xe.ended)ee(fe,new F);else{if(Xe.destroyed)return!1;Xe.reading=!1,Xe.decoder&&!R?(B=Xe.decoder.write(B),Xe.objectMode||0!==B.length?De(fe,Xe,B,!1):Ee(fe,Xe)):De(fe,Xe,B,!1)}else k||(Xe.reading=!1,Ee(fe,Xe));return!Xe.ended&&(Xe.lengthB.highWaterMark&&(B.highWaterMark=function(fe){return fe>=nt?fe=nt:(fe--,fe|=fe>>>1,fe|=fe>>>2,fe|=fe>>>4,fe|=fe>>>8,fe|=fe>>>16,fe++),fe}(fe)),fe<=B.length?fe:B.ended?B.length:(B.needReadable=!0,0))}function je(fe){var B=fe._readableState;w("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(w("emitReadable",B.flowing),B.emittedReadable=!0,q.nextTick(Le,fe))}function Le(fe){var B=fe._readableState;w("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(fe.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,be(fe)}function Ee(fe,B){B.readingMore||(B.readingMore=!0,q.nextTick(Re,fe,B))}function Re(fe,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:fe.listenerCount("data")>0&&fe.resume()}function Be(fe){w("readable nexttick read 0"),fe.read(0)}function X(fe,B){w("resume",B.reading),B.reading||fe.read(0),B.resumeScheduled=!1,fe.emit("resume"),be(fe),B.flowing&&!B.reading&&fe.read(0)}function be(fe){var B=fe._readableState;for(w("flow",B.flowing);B.flowing&&null!==fe.read(););}function ce(fe,B){return 0===B.length?null:(B.objectMode?R=B.buffer.shift():!fe||fe>=B.length?(R=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):R=B.buffer.consume(fe,B.decoder),R);var R}function Pe(fe){var B=fe._readableState;w("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,q.nextTick(wt,B,fe))}function wt(fe,B){if(w("endReadableNT",fe.endEmitted,fe.length),!fe.endEmitted&&0===fe.length&&(fe.endEmitted=!0,B.readable=!1,B.emit("end"),fe.autoDestroy)){var R=B._writableState;(!R||R.autoDestroy&&R.finished)&&B.destroy()}}function pt(fe,B){for(var R=0,k=fe.length;R=B.highWaterMark:B.length>0)||B.ended))return w("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?Pe(this):je(this),null;if(0===(fe=Je(fe,B))&&B.ended)return 0===B.length&&Pe(this),null;var Oe,k=B.needReadable;return w("need readable",k),(0===B.length||B.length-fe0?ce(fe,B):null)?(B.needReadable=B.length<=B.highWaterMark,fe=0):(B.length-=fe,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),R!==fe&&B.ended&&Pe(this)),null!==Oe&&this.emit("data",Oe),Oe},te.prototype._read=function(fe){ee(this,new Q("_read()"))},te.prototype.pipe=function(fe,B){var R=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=fe;break;case 1:k.pipes=[k.pipes,fe];break;default:k.pipes.push(fe)}k.pipesCount+=1,w("pipe count=%d opts=%j",k.pipesCount,B);var Xe=B&&!1===B.end||fe===q.stdout||fe===q.stderr?cs:It;function yt(Ps,Gr){w("onunpipe"),Ps===R&&Gr&&!1===Gr.hasUnpiped&&(Gr.hasUnpiped=!0,w("cleanup"),fe.removeListener("close",Hr),fe.removeListener("finish",Ns),fe.removeListener("drain",Tn),fe.removeListener("error",hi),fe.removeListener("unpipe",yt),R.removeListener("end",It),R.removeListener("end",cs),R.removeListener("data",yi),Pn=!0,k.awaitDrain&&(!fe._writableState||fe._writableState.needDrain)&&Tn())}function It(){w("onend"),fe.end()}k.endEmitted?q.nextTick(Xe):R.once("end",Xe),fe.on("unpipe",yt);var Tn=function(fe){return function(){var R=fe._readableState;w("pipeOnDrain",R.awaitDrain),R.awaitDrain&&R.awaitDrain--,0===R.awaitDrain&&$(fe,"data")&&(R.flowing=!0,be(fe))}}(R);fe.on("drain",Tn);var Pn=!1;function yi(Ps){w("ondata");var Gr=fe.write(Ps);w("dest.write",Gr),!1===Gr&&((1===k.pipesCount&&k.pipes===fe||k.pipesCount>1&&-1!==pt(k.pipes,fe))&&!Pn&&(w("false write response, pause",k.awaitDrain),k.awaitDrain++),R.pause())}function hi(Ps){w("onerror",Ps),cs(),fe.removeListener("error",hi),0===$(fe,"error")&&ee(fe,Ps)}function Hr(){fe.removeListener("finish",Ns),cs()}function Ns(){w("onfinish"),fe.removeListener("close",Hr),cs()}function cs(){w("unpipe"),R.unpipe(fe)}return R.on("data",yi),function(fe,B,R){if("function"==typeof fe.prependListener)return fe.prependListener(B,R);fe._events&&fe._events[B]?Array.isArray(fe._events[B])?fe._events[B].unshift(R):fe._events[B]=[R,fe._events[B]]:fe.on(B,R)}(fe,"error",hi),fe.once("close",Hr),fe.once("finish",Ns),fe.emit("pipe",R),k.flowing||(w("pipe resume"),R.resume()),fe},te.prototype.unpipe=function(fe){var B=this._readableState,R={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return fe&&fe!==B.pipes||(fe||(fe=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,fe&&fe.emit("unpipe",this,R)),this;if(!fe){var k=B.pipes,Oe=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Xe=0;Xe0,!1!==k.flowing&&this.resume()):"readable"===fe&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,w("on readable",k.length,k.reading),k.length?je(this):k.reading||q.nextTick(Be,this)),R},te.prototype.removeListener=function(fe,B){var R=b.prototype.removeListener.call(this,fe,B);return"readable"===fe&&q.nextTick(qe,this),R},te.prototype.removeAllListeners=function(fe){var B=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===fe||void 0===fe)&&q.nextTick(qe,this),B},te.prototype.resume=function(){var fe=this._readableState;return fe.flowing||(w("resume"),fe.flowing=!fe.readableListening,function(fe,B){B.resumeScheduled||(B.resumeScheduled=!0,q.nextTick(X,fe,B))}(this,fe)),fe.paused=!1,this},te.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},te.prototype.wrap=function(fe){var B=this,R=this._readableState,k=!1;for(var Oe in fe.on("end",function(){if(w("wrapped end"),R.decoder&&!R.ended){var yt=R.decoder.end();yt&&yt.length&&B.push(yt)}B.push(null)}),fe.on("data",function(yt){w("wrapped data"),R.decoder&&(yt=R.decoder.write(yt)),R.objectMode&&null==yt||!(R.objectMode||yt&&yt.length)||B.push(yt)||(k=!0,fe.pause())}),fe)void 0===this[Oe]&&"function"==typeof fe[Oe]&&(this[Oe]=function(It){return function(){return fe[It].apply(fe,arguments)}}(Oe));for(var Xe=0;Xe-1))throw new ie(ce);return this._writableState.defaultEncoding=ce,this},Object.defineProperty(me.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(me.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),me.prototype._write=function(be,ce,Pe){Pe(new Y("_write()"))},me.prototype._writev=null,me.prototype.end=function(be,ce,Pe){var wt=this._writableState;return"function"==typeof be?(Pe=be,be=null,ce=null):"function"==typeof ce&&(Pe=ce,ce=null),null!=be&&this.write(be,ce),wt.corked&&(wt.corked=1,this.uncork()),wt.ending||function(be,ce,Pe){ce.ending=!0,Be(be,ce),Pe&&(ce.finished?q.nextTick(Pe):be.once("finish",Pe)),ce.ended=!0,be.writable=!1}(this,wt,Pe),this},Object.defineProperty(me.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(ce){!this._writableState||(this._writableState.destroyed=ce)}}),me.prototype.destroy=w.destroy,me.prototype._undestroy=w.undestroy,me.prototype._destroy=function(be,ce){ce(be)}}).call(this)}).call(this,K("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(K,Ae,he){(function(q){(function(){"use strict";var V;function L(F,Q,E){return Q in F?Object.defineProperty(F,Q,{value:E,enumerable:!0,configurable:!0,writable:!0}):F[Q]=E,F}var re=K("./end-of-stream"),$=Symbol("lastResolve"),b=Symbol("lastReject"),S=Symbol("error"),O=Symbol("ended"),T=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function w(F,Q){return{value:F,done:Q}}function M(F){var Q=F[$];if(null!==Q){var E=F[y].read();null!==E&&(F[T]=null,F[$]=null,F[b]=null,Q(w(E,!1)))}}function j(F){q.nextTick(M,F)}var H=Object.getPrototypeOf(function(){}),Y=Object.setPrototypeOf((L(V={get stream(){return this[y]},next:function(){var Q=this,E=this[S];if(null!==E)return Promise.reject(E);if(this[O])return Promise.resolve(w(void 0,!0));if(this[y].destroyed)return new Promise(function(ee,se){q.nextTick(function(){Q[S]?se(Q[S]):ee(w(void 0,!0))})});var ie,U=this[T];if(U)ie=new Promise(function(F,Q){return function(E,U){F.then(function(){Q[O]?E(w(void 0,!0)):Q[v](E,U)},U)}}(U,this));else{var ue=this[y].read();if(null!==ue)return Promise.resolve(w(ue,!1));ie=new Promise(this[v])}return this[T]=ie,ie}},Symbol.asyncIterator,function(){return this}),L(V,"return",function(){var Q=this;return new Promise(function(E,U){Q[y].destroy(null,function(ie){ie?U(ie):E(w(void 0,!0))})})}),V),H);Ae.exports=function(Q){var E,U=Object.create(Y,(L(E={},y,{value:Q,writable:!0}),L(E,$,{value:null,writable:!0}),L(E,b,{value:null,writable:!0}),L(E,S,{value:null,writable:!0}),L(E,O,{value:Q._readableState.endEmitted,writable:!0}),L(E,v,{value:function(ue,ee){var se=U[y].read();se?(U[T]=null,U[$]=null,U[b]=null,ue(w(se,!1))):(U[$]=ue,U[b]=ee)},writable:!0}),E));return U[T]=null,re(Q,function(ie){if(ie&&"ERR_STREAM_PREMATURE_CLOSE"!==ie.code){var ue=U[b];return null!==ue&&(U[T]=null,U[$]=null,U[b]=null,ue(ie)),void(U[S]=ie)}var ee=U[$];null!==ee&&(U[T]=null,U[$]=null,U[b]=null,ee(w(void 0,!0))),U[O]=!0}),Q.on("readable",j.bind(null,U)),U}}).call(this)}).call(this,K("_process"))},{"./end-of-stream":76,_process:44}],74:[function(K,Ae,he){"use strict";function q(M,j){var I=Object.keys(M);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(M);j&&(H=H.filter(function(Y){return Object.getOwnPropertyDescriptor(M,Y).enumerable})),I.push.apply(I,H)}return I}function L(M,j,I){return j in M?Object.defineProperty(M,j,{value:I,enumerable:!0,configurable:!0,writable:!0}):M[j]=I,M}function $(M,j){for(var I=0;I0?this.tail.next=H:this.head=H,this.tail=H,++this.length}},{key:"unshift",value:function(I){var H={data:I,next:this.head};0===this.length&&(this.tail=H),this.head=H,++this.length}},{key:"shift",value:function(){if(0!==this.length){var I=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,I}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(I){if(0===this.length)return"";for(var H=this.head,Y=""+H.data;H=H.next;)Y+=I+H.data;return Y}},{key:"concat",value:function(I){if(0===this.length)return O.alloc(0);for(var H=O.allocUnsafe(I>>>0),Y=this.head,D=0;Y;)w(Y.data,H,D),D+=Y.data.length,Y=Y.next;return H}},{key:"consume",value:function(I,H){var Y;return IF.length?F.length:I;if(D+=Q===F.length?F:F.slice(0,I),0==(I-=Q)){Q===F.length?(++Y,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=F.slice(Q));break}++Y}return this.length-=Y,D}},{key:"_getBuffer",value:function(I){var H=O.allocUnsafe(I),Y=this.head,D=1;for(Y.data.copy(H),I-=Y.data.length;Y=Y.next;){var F=Y.data,Q=I>F.length?F.length:I;if(F.copy(H,H.length-I,0,Q),0==(I-=Q)){Q===F.length?(++D,this.head=Y.next?Y.next:this.tail=null):(this.head=Y,Y.data=F.slice(Q));break}++D}return this.length-=D,H}},{key:y,value:function(I,H){return v(this,function(M){for(var j=1;j0,function(ie){Y||(Y=ie),ie&&D.forEach(T),!E&&(D.forEach(T),H(Y))})});return j.reduce(v)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(K,Ae,he){"use strict";var q=K("../../../errors").codes.ERR_INVALID_OPT_VALUE;Ae.exports={getHighWaterMark:function(re,$,b,S){var O=function(re,$,b){return null!=re.highWaterMark?re.highWaterMark:$?re[b]:null}($,S,b);if(null!=O){if(!isFinite(O)||Math.floor(O)!==O||O<0)throw new q(S?b:"highWaterMark",O);return Math.floor(O)}return re.objectMode?16:16384}}},{"../../../errors":67}],80:[function(K,Ae,he){Ae.exports=K("events").EventEmitter},{events:8}],81:[function(K,Ae,he){(he=Ae.exports=K("./lib/_stream_readable.js")).Stream=he,he.Readable=he,he.Writable=K("./lib/_stream_writable.js"),he.Duplex=K("./lib/_stream_duplex.js"),he.Transform=K("./lib/_stream_transform.js"),he.PassThrough=K("./lib/_stream_passthrough.js"),he.finished=K("./lib/internal/streams/end-of-stream.js"),he.pipeline=K("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(V){for(var L in V)he.hasOwnProperty(L)||(he[L]=V[L])}(K("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(K,Ae,he){"use strict";function V($){const b=[];let S=0;for(;S<$.length;)switch($[S]){case"/":if("."===$[S+1])if("."===$[S+2]){if(!re($[S+3])){b.push([]),S++;break}b.pop(),$[S+3]||b.push([]),S+=3}else{if(!re($[S+2])){b.push([]),S++;break}$[S+2]||b.push([]),S+=2}else b.push([]),S++;break;case"#":case"?":b.length||b.push([]),b[b.length-1].push($.substr(S)),S=$.length;break;default:b.length||b.push([]),b[b.length-1].push($[S]),S++}return"/"+b.map(O=>O.join("")).join("/")}function L($,b){let S=b+1;b>=0?"/"===$[b+1]&&"/"===$[b+2]&&(S=b+3):"/"===$[0]&&"/"===$[1]&&(S=2);const O=$.indexOf("/",S);return O<0?$:$.substr(0,O)+V($.substr(O))}function re($){return!$||"#"===$||"?"===$||"/"===$}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function($,b){const S=(b=b||"").indexOf("#");if(S>0&&(b=b.substr(0,S)),!$.length){if(b.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);return b}if($.startsWith("?")){const j=b.indexOf("?");return j>0&&(b=b.substr(0,j)),b+$}if($.startsWith("#"))return b+$;if(!b.length){const j=$.indexOf(":");if(j<0)throw new Error(`Found invalid relative IRI '${$}' for a missing baseIRI`);return L($,j)}const O=$.indexOf(":");if(O>=0)return L($,O);const T=b.indexOf(":");if(T<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);const v=b.substr(0,T+1);if(0===$.indexOf("//"))return v+L($,O);let y;if(b.indexOf("//",T)===T+1){if(y=b.indexOf("/",T+3),y<0)return b.length>T+3?b+"/"+L($,O):v+L($,O)}else if(y=b.indexOf("/",T+1),y<0)return v+L($,O);if(0===$.indexOf("/"))return b.substr(0,y)+V($);let w=b.substr(y);const M=w.lastIndexOf("/");return M>=0&&M"===ce?(te(X,"onsgmldeclaration",X.sgmlDecl),X.sgmlDecl="",X.state=se.TEXT):(U(ce)&&(X.state=se.SGML_DECL_QUOTED),X.sgmlDecl+=ce);continue;case se.SGML_DECL_QUOTED:ce===X.q&&(X.state=se.SGML_DECL,X.q=""),X.sgmlDecl+=ce;continue;case se.DOCTYPE:">"===ce?(X.state=se.TEXT,te(X,"ondoctype",X.doctype),X.doctype=!0):(X.doctype+=ce,"["===ce?X.state=se.DOCTYPE_DTD:U(ce)&&(X.state=se.DOCTYPE_QUOTED,X.q=ce));continue;case se.DOCTYPE_QUOTED:X.doctype+=ce,ce===X.q&&(X.q="",X.state=se.DOCTYPE);continue;case se.DOCTYPE_DTD:X.doctype+=ce,"]"===ce?X.state=se.DOCTYPE:U(ce)&&(X.state=se.DOCTYPE_DTD_QUOTED,X.q=ce);continue;case se.DOCTYPE_DTD_QUOTED:X.doctype+=ce,ce===X.q&&(X.state=se.DOCTYPE_DTD,X.q="");continue;case se.COMMENT:"-"===ce?X.state=se.COMMENT_ENDING:X.comment+=ce;continue;case se.COMMENT_ENDING:"-"===ce?(X.state=se.COMMENT_ENDED,X.comment=De(X.opt,X.comment),X.comment&&te(X,"oncomment",X.comment),X.comment=""):(X.comment+="-"+ce,X.state=se.COMMENT);continue;case se.COMMENT_ENDED:">"!==ce?(Ze(X,"Malformed comment"),X.comment+="--"+ce,X.state=se.COMMENT):X.state=se.TEXT;continue;case se.CDATA:"]"===ce?X.state=se.CDATA_ENDING:X.cdata+=ce;continue;case se.CDATA_ENDING:"]"===ce?X.state=se.CDATA_ENDING_2:(X.cdata+="]"+ce,X.state=se.CDATA);continue;case se.CDATA_ENDING_2:">"===ce?(X.cdata&&te(X,"oncdata",X.cdata),te(X,"onclosecdata"),X.cdata="",X.state=se.TEXT):"]"===ce?X.cdata+="]":(X.cdata+="]]"+ce,X.state=se.CDATA);continue;case se.PROC_INST:"?"===ce?X.state=se.PROC_INST_ENDING:E(ce)?X.state=se.PROC_INST_BODY:X.procInstName+=ce;continue;case se.PROC_INST_BODY:if(!X.procInstBody&&E(ce))continue;"?"===ce?X.state=se.PROC_INST_ENDING:X.procInstBody+=ce;continue;case se.PROC_INST_ENDING:">"===ce?(te(X,"onprocessinginstruction",{name:X.procInstName,body:X.procInstBody}),X.procInstName=X.procInstBody="",X.state=se.TEXT):(X.procInstBody+="?"+ce,X.state=se.PROC_INST_BODY);continue;case se.OPEN_TAG:ue(D,ce)?X.tagName+=ce:(Je(X),">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:(E(ce)||Ze(X,"Invalid character in tag name"),X.state=se.ATTRIB));continue;case se.OPEN_TAG_SLASH:">"===ce?(Le(X,!0),Ee(X)):(Ze(X,"Forward-slash in opening tag not followed by >"),X.state=se.ATTRIB);continue;case se.ATTRIB:if(E(ce))continue;">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(Y,ce)?(X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME:"="===ce?X.state=se.ATTRIB_VALUE:">"===ce?(Ze(X,"Attribute without value"),X.attribValue=X.attribName,je(X),Le(X)):E(ce)?X.state=se.ATTRIB_NAME_SAW_WHITE:ue(D,ce)?X.attribName+=ce:Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME_SAW_WHITE:if("="===ce)X.state=se.ATTRIB_VALUE;else{if(E(ce))continue;Ze(X,"Attribute without value"),X.tag.attributes[X.attribName]="",X.attribValue="",te(X,"onattribute",{name:X.attribName,value:""}),X.attribName="",">"===ce?Le(X):ue(Y,ce)?(X.attribName=ce,X.state=se.ATTRIB_NAME):(Ze(X,"Invalid attribute name"),X.state=se.ATTRIB)}continue;case se.ATTRIB_VALUE:if(E(ce))continue;U(ce)?(X.q=ce,X.state=se.ATTRIB_VALUE_QUOTED):(Ze(X,"Unquoted attribute value"),X.state=se.ATTRIB_VALUE_UNQUOTED,X.attribValue=ce);continue;case se.ATTRIB_VALUE_QUOTED:if(ce!==X.q){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_Q:X.attribValue+=ce;continue}je(X),X.q="",X.state=se.ATTRIB_VALUE_CLOSED;continue;case se.ATTRIB_VALUE_CLOSED:E(ce)?X.state=se.ATTRIB:">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(Y,ce)?(Ze(X,"No whitespace between attributes"),X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_VALUE_UNQUOTED:if(!ie(ce)){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_U:X.attribValue+=ce;continue}je(X),">"===ce?Le(X):X.state=se.ATTRIB;continue;case se.CLOSE_TAG:if(X.tagName)">"===ce?Ee(X):ue(D,ce)?X.tagName+=ce:X.script?(X.script+=""===ce?Ee(X):Ze(X,"Invalid characters in closing tag");continue;case se.TEXT_ENTITY:case se.ATTRIB_VALUE_ENTITY_Q:case se.ATTRIB_VALUE_ENTITY_U:var pt,fe;switch(X.state){case se.TEXT_ENTITY:pt=se.TEXT,fe="textNode";break;case se.ATTRIB_VALUE_ENTITY_Q:pt=se.ATTRIB_VALUE_QUOTED,fe="attribValue";break;case se.ATTRIB_VALUE_ENTITY_U:pt=se.ATTRIB_VALUE_UNQUOTED,fe="attribValue"}";"===ce?(X[fe]+=Re(X),X.entity="",X.state=pt):ue(X.entity.length?Q:F,ce)?X.entity+=ce:(Ze(X,"Invalid character in entity name"),X[fe]+="&"+X.entity+ce,X.entity="",X.state=pt);continue;default:throw new Error(X,"Unknown state: "+X.state)}return X.position>=X.bufferCheckPosition&&function(z){for(var X=Math.max(V.MAX_BUFFER_LENGTH,10),be=0,ce=0,Pe=L.length;ceX)switch(L[ce]){case"textNode":ye(z);break;case"cdata":te(z,"oncdata",z.cdata),z.cdata="";break;case"script":te(z,"onscript",z.script),z.script="";break;default:Ve(z,"Max buffer length exceeded: "+L[ce])}be=Math.max(be,wt)}z.bufferCheckPosition=V.MAX_BUFFER_LENGTH-be+z.position}(X),X},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(z){ye(z),""!==z.cdata&&(te(z,"oncdata",z.cdata),z.cdata=""),""!==z.script&&(te(z,"onscript",z.script),z.script="")}(this)}};try{O=K("stream").Stream}catch(z){O=function(){}}var T=V.EVENTS.filter(function(z){return"error"!==z&&"end"!==z});function y(z,X){if(!(this instanceof y))return new y(z,X);O.apply(this),this._parser=new re(z,X),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ce){be.emit("error",ce),be._parser.error=null},this._decoder=null,T.forEach(function(ce){Object.defineProperty(be,"on"+ce,{get:function(){return be._parser["on"+ce]},set:function(Pe){if(!Pe)return be.removeAllListeners(ce),be._parser["on"+ce]=Pe,Pe;be.on(ce,Pe)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(O.prototype,{constructor:{value:y}})).write=function(z){if("function"==typeof q&&"function"==typeof q.isBuffer&&q.isBuffer(z)){if(!this._decoder){var X=K("string_decoder").StringDecoder;this._decoder=new X("utf8")}z=this._decoder.write(z)}return this._parser.write(z.toString()),this.emit("data",z),!0},y.prototype.end=function(z){return z&&z.length&&this.write(z),this._parser.end(),!0},y.prototype.on=function(z,X){var be=this;return!be._parser["on"+z]&&-1!==T.indexOf(z)&&(be._parser["on"+z]=function(){var ce=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ce.splice(0,0,z),be.emit.apply(be,ce)}),O.prototype.on.call(be,z,X)};var j="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",H={xml:j,xmlns:I},Y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(z){return" "===z||"\n"===z||"\r"===z||"\t"===z}function U(z){return'"'===z||"'"===z}function ie(z){return">"===z||E(z)}function ue(z,X){return z.test(X)}function ee(z,X){return!ue(z,X)}var z,X,be,se=0;for(var Te in V.STATE={BEGIN:se++,BEGIN_WHITESPACE:se++,TEXT:se++,TEXT_ENTITY:se++,OPEN_WAKA:se++,SGML_DECL:se++,SGML_DECL_QUOTED:se++,DOCTYPE:se++,DOCTYPE_QUOTED:se++,DOCTYPE_DTD:se++,DOCTYPE_DTD_QUOTED:se++,COMMENT_STARTING:se++,COMMENT:se++,COMMENT_ENDING:se++,COMMENT_ENDED:se++,CDATA:se++,CDATA_ENDING:se++,CDATA_ENDING_2:se++,PROC_INST:se++,PROC_INST_BODY:se++,PROC_INST_ENDING:se++,OPEN_TAG:se++,OPEN_TAG_SLASH:se++,ATTRIB:se++,ATTRIB_NAME:se++,ATTRIB_NAME_SAW_WHITE:se++,ATTRIB_VALUE:se++,ATTRIB_VALUE_QUOTED:se++,ATTRIB_VALUE_CLOSED:se++,ATTRIB_VALUE_UNQUOTED:se++,ATTRIB_VALUE_ENTITY_Q:se++,ATTRIB_VALUE_ENTITY_U:se++,CLOSE_TAG:se++,CLOSE_TAG_SAW_WHITE:se++,SCRIPT:se++,SCRIPT_ENDING:se++},V.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(V.ENTITIES).forEach(function(z){var X=V.ENTITIES[z],be="number"==typeof X?String.fromCharCode(X):X;V.ENTITIES[z]=be}),V.STATE)V.STATE[V.STATE[Te]]=Te;function me(z,X,be){z[X]&&z[X](be)}function te(z,X,be){z.textNode&&ye(z),me(z,X,be)}function ye(z){z.textNode=De(z.opt,z.textNode),z.textNode&&me(z,"ontext",z.textNode),z.textNode=""}function De(z,X){return z.trim&&(X=X.trim()),z.normalize&&(X=X.replace(/\s+/g," ")),X}function Ve(z,X){return ye(z),z.trackPosition&&(X+="\nLine: "+z.line+"\nColumn: "+z.column+"\nChar: "+z.c),X=new Error(X),z.error=X,me(z,"onerror",X),z}function nt(z){return z.sawRoot&&!z.closedRoot&&Ze(z,"Unclosed root tag"),z.state!==se.BEGIN&&z.state!==se.BEGIN_WHITESPACE&&z.state!==se.TEXT&&Ve(z,"Unexpected end"),ye(z),z.c="",z.closed=!0,me(z,"onend"),re.call(z,z.strict,z.opt),z}function Ze(z,X){if("object"!=typeof z||!(z instanceof re))throw new Error("bad call to strictFail");z.strict&&Ve(z,X)}function Je(z){z.strict||(z.tagName=z.tagName[z.looseCase]());var X=z.tags[z.tags.length-1]||z,be=z.tag={name:z.tagName,attributes:{}};z.opt.xmlns&&(be.ns=X.ns),z.attribList.length=0,te(z,"onopentagstart",be)}function Ye(z,X){var ce=z.indexOf(":")<0?["",z]:z.split(":"),Pe=ce[0],wt=ce[1];return X&&"xmlns"===z&&(Pe="xmlns",wt=""),{prefix:Pe,local:wt}}function je(z){if(z.strict||(z.attribName=z.attribName[z.looseCase]()),-1!==z.attribList.indexOf(z.attribName)||z.tag.attributes.hasOwnProperty(z.attribName))z.attribName=z.attribValue="";else{if(z.opt.xmlns){var X=Ye(z.attribName,!0),ce=X.local;if("xmlns"===X.prefix)if("xml"===ce&&z.attribValue!==j)Ze(z,"xml: prefix must be bound to "+j+"\nActual: "+z.attribValue);else if("xmlns"===ce&&z.attribValue!==I)Ze(z,"xmlns: prefix must be bound to "+I+"\nActual: "+z.attribValue);else{var Pe=z.tag,wt=z.tags[z.tags.length-1]||z;Pe.ns===wt.ns&&(Pe.ns=Object.create(wt.ns)),Pe.ns[ce]=z.attribValue}z.attribList.push([z.attribName,z.attribValue])}else z.tag.attributes[z.attribName]=z.attribValue,te(z,"onattribute",{name:z.attribName,value:z.attribValue});z.attribName=z.attribValue=""}}function Le(z,X){if(z.opt.xmlns){var be=z.tag,ce=Ye(z.tagName);be.prefix=ce.prefix,be.local=ce.local,be.uri=be.ns[ce.prefix]||"",be.prefix&&!be.uri&&(Ze(z,"Unbound namespace prefix: "+JSON.stringify(z.tagName)),be.uri=ce.prefix),be.ns&&(z.tags[z.tags.length-1]||z).ns!==be.ns&&Object.keys(be.ns).forEach(function(Tn){te(z,"onopennamespace",{prefix:Tn,uri:be.ns[Tn]})});for(var wt=0,pt=z.attribList.length;wt",z.tagName="",void(z.state=se.SCRIPT);te(z,"onscript",z.script),z.script=""}var X=z.tags.length,be=z.tagName;z.strict||(be=be[z.looseCase]());for(var ce=be;X--&&z.tags[X].name!==ce;)Ze(z,"Unexpected close tag");if(X<0)return Ze(z,"Unmatched closing tag: "+z.tagName),z.textNode+="",void(z.state=se.TEXT);z.tagName=be;for(var wt=z.tags.length;wt-- >X;){var pt=z.tag=z.tags.pop();z.tagName=z.tag.name,te(z,"onclosetag",z.tagName);var fe={};for(var B in pt.ns)fe[B]=pt.ns[B];z.opt.xmlns&&pt.ns!==(z.tags[z.tags.length-1]||z).ns&&Object.keys(pt.ns).forEach(function(k){te(z,"onclosenamespace",{prefix:k,uri:pt.ns[k]})})}0===X&&(z.closedRoot=!0),z.tagName=z.attribValue=z.attribName="",z.attribList.length=0,z.state=se.TEXT}function Re(z){var ce,X=z.entity,be=X.toLowerCase(),Pe="";return z.ENTITIES[X]?z.ENTITIES[X]:z.ENTITIES[be]?z.ENTITIES[be]:("#"===(X=be).charAt(0)&&("x"===X.charAt(1)?(X=X.slice(2),Pe=(ce=parseInt(X,16)).toString(16)):(X=X.slice(1),Pe=(ce=parseInt(X,10)).toString(10))),X=X.replace(/^0+/,""),isNaN(ce)||Pe.toLowerCase()!==X?(Ze(z,"Invalid character entity"),"&"+z.entity+";"):String.fromCodePoint(ce))}function Ue(z,X){"<"===X?(z.state=se.OPEN_WAKA,z.startTagPosition=z.position):E(X)||(Ze(z,"Non-whitespace before first tag."),z.textNode=X,z.state=se.TEXT)}function qe(z,X){var be="";return X1114111||X(k)!==k)throw RangeError("Invalid code point: "+k);k<=65535?Pe.push(k):Pe.push(55296+((k-=65536)>>10),k%1024+56320),(fe+1===B||Pe.length>ce)&&(R+=z.apply(null,Pe),Pe.length=0)}return R},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,K("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(K,Ae,he){(function(q,V){(function(){!function(L,re){"use strict";if(!L.setImmediate){var T,$=1,b={},S=!1,O=L.document,Q=Object.getPrototypeOf&&Object.getPrototypeOf(L);Q=Q&&Q.setTimeout?Q:L,"[object process]"==={}.toString.call(L.process)?T=function(E){q.nextTick(function(){M(E)})}:function(){if(L.postMessage&&!L.importScripts){var E=!0,U=L.onmessage;return L.onmessage=function(){E=!1},L.postMessage("","*"),L.onmessage=U,E}}()?(E="setImmediate$"+Math.random()+"$",U=function(ie){ie.source===L&&"string"==typeof ie.data&&0===ie.data.indexOf(E)&&M(+ie.data.slice(E.length))},L.addEventListener?L.addEventListener("message",U,!1):L.attachEvent("onmessage",U),T=function(ie){L.postMessage(E+ie,"*")}):L.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function(U){M(U.data)},T=function(U){E.port2.postMessage(U)}}():O&&"onreadystatechange"in O.createElement("script")?function(){var E=O.documentElement;T=function(U){var ie=O.createElement("script");ie.onreadystatechange=function(){M(U),ie.onreadystatechange=null,E.removeChild(ie),ie=null},E.appendChild(ie)}}():T=function(E){setTimeout(M,0,E)},Q.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var U=new Array(arguments.length-1),ie=0;ie=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},v))},he.setImmediate="function"==typeof q?q:function(T){var v=S++,y=!(arguments.length<2)&&$.call(arguments,1);return b[v]=!0,L(function(){b[v]&&(y?T.apply(null,y):T.call(null),he.clearImmediate(v))}),v},he.clearImmediate="function"==typeof V?V:function(T){delete b[T]}}).call(this)}).call(this,K("timers").setImmediate,K("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(K,Ae,he){(function(q){(function(){function L(re){try{if(!q.localStorage)return!1}catch(b){return!1}var $=q.localStorage[re];return null!=$&&"true"===String($).toLowerCase()}Ae.exports=function(re,$){if(L("noDeprecation"))return re;var b=!1;return function(){if(!b){if(L("throwDeprecation"))throw new Error($);L("traceDeprecation")?console.trace($):console.warn($),b=!0}return re.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(K,Ae,he){"use strict";Ae.exports=function(q){q.prototype[Symbol.iterator]=function*(){for(let V=this.head;V;V=V.next)yield V.value}}},{}],92:[function(K,Ae,he){"use strict";function q(b){var S=this;if(S instanceof q||(S=new q),S.tail=null,S.head=null,S.length=0,b&&"function"==typeof b.forEach)b.forEach(function(v){S.push(v)});else if(arguments.length>0)for(var O=0,T=arguments.length;O1)O=S;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");T=this.head.next,O=this.head.value}for(var v=0;null!==T;v++)O=b(O,T.value,v),T=T.next;return O},q.prototype.reduceReverse=function(b,S){var O,T=this.tail;if(arguments.length>1)O=S;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");T=this.tail.prev,O=this.tail.value}for(var v=this.length-1;null!==T;v--)O=b(O,T.value,v),T=T.prev;return O},q.prototype.toArray=function(){for(var b=new Array(this.length),S=0,O=this.head;null!==O;S++)b[S]=O.value,O=O.next;return b},q.prototype.toArrayReverse=function(){for(var b=new Array(this.length),S=0,O=this.tail;null!==O;S++)b[S]=O.value,O=O.prev;return b},q.prototype.slice=function(b,S){(S=S||this.length)<0&&(S+=this.length),(b=b||0)<0&&(b+=this.length);var O=new q;if(Sthis.length&&(S=this.length);for(var T=0,v=this.head;null!==v&&Tthis.length&&(S=this.length);for(var T=this.length,v=this.tail;null!==v&&T>S;T--)v=v.prev;for(;null!==v&&T>b;T--,v=v.prev)O.push(v.value);return O},q.prototype.splice=function(b,S,...O){b>this.length&&(b=this.length-1),b<0&&(b=this.length+b);for(var T=0,v=this.head;null!==v&&T{kt.exports=function(tt,gt){var J=gt.length;if(0!==J){var At=tt.length;tt.length+=J;for(var dt=0;dt{"use strict";var gt=(()=>{return(At=gt||(gt={})).typeOfFunction="function",At.boolTrue=!0,gt;var At})();function J(At,dt,K){if(!K||typeof K.value!==gt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:gt.boolTrue,get:function(){var Ae=K.value.bind(this);return Object.defineProperty(this,dt,{value:Ae,configurable:gt.boolTrue,writable:gt.boolTrue}),Ae}}}it.ak=J,it.ZP=J},266:(kt,it,tt)=>{kt.exports={ResizeSensor:tt(835),ElementQueries:tt(845)}},845:function(kt,it,tt){"use strict";var gt,J,At;"undefined"!=typeof window&&window,J=[tt(835)],void 0!==(At="function"==typeof(gt=function(dt){var K=function(){var he,q={},V=[];function L(D){D||(D=document.documentElement);var F=window.getComputedStyle(D,null).fontSize;return parseFloat(F)||16}function $(D,F){var Q=F.split(/\d/),E=Q[Q.length-1];switch(F=parseFloat(F),E){case"px":return F;case"em":return F*L(D);case"rem":return F*L();case"vw":return F*document.documentElement.clientWidth/100;case"vh":return F*document.documentElement.clientHeight/100;case"vmin":case"vmax":var U=document.documentElement.clientWidth/100,ie=document.documentElement.clientHeight/100;return F*(0,Math["vmin"===E?"min":"max"])(U,ie);default:return F}}function b(D,F){this.element=D;var Q,E,U,ie,ue,ee,se,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(Q in U=function(D){if(!D.getBoundingClientRect)return{width:D.offsetWidth,height:D.offsetHeight};var F=D.getBoundingClientRect();return{width:Math.round(F.width),height:Math.round(F.height)}}(this.element),ee={},q[F])!q[F].hasOwnProperty(Q)||(ie=$(this.element,(E=q[F][Q]).value),ue="width"===E.property?U.width:U.height,se="","min"===E.mode&&ue>=ie&&(se+=E.value),"max"===E.mode&&ue<=ie&&(se+=E.value),ee[Te=E.mode+"-"+E.property]||(ee[Te]=""),se&&-1===(" "+ee[Te]+" ").indexOf(" "+se+" ")&&(ee[Te]+=" "+se));for(var te in me)!me.hasOwnProperty(te)||(ee[me[te]]?this.element.setAttribute(me[te],ee[me[te]].substr(1)):this.element.removeAttribute(me[te]))}}function S(D,F){D.elementQueriesSetupInformation||(D.elementQueriesSetupInformation=new b(D,F)),D.elementQueriesSensor||(D.elementQueriesSensor=new dt(D,function(){D.elementQueriesSetupInformation.call()}))}function O(D,F,Q,E){if(void 0===q[D]){q[D]=[];var U=V.length;he.innerHTML+="\n"+D+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+D+" > .resize-sensor {min-width: "+U+"px;}",V.push(D)}q[D].push({mode:F,property:Q,value:E})}function T(D){var F;if(document.querySelectorAll&&(F=D?D.querySelectorAll.bind(D):document.querySelectorAll.bind(document)),!F&&"undefined"!=typeof $$&&(F=$$),!F&&"undefined"!=typeof jQuery&&(F=jQuery),!F)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return F}function y(D){var F=[],Q=[],E=[],U=0,ie=-1,ue=[];for(var ee in D.children)if(D.children.hasOwnProperty(ee)&&D.children[ee].tagName&&"img"===D.children[ee].tagName.toLowerCase()){F.push(D.children[ee]);var se=D.children[ee].getAttribute("min-width")||D.children[ee].getAttribute("data-min-width"),Te=D.children[ee].getAttribute("data-src")||D.children[ee].getAttribute("url");E.push(Te),Q.push({minWidth:se}),se?D.children[ee].style.display="none":(U=F.length-1,D.children[ee].style.display="block")}function te(){var De,ye=!1;for(De in F)!F.hasOwnProperty(De)||Q[De].minWidth&&D.offsetWidth>Q[De].minWidth&&(ye=De);if(ye||(ye=U),ie!==ye)if(ue[ye])F[ie].style.display="none",F[ye].style.display="block",ie=ye;else{var Ve=new Image;Ve.onload=function(){F[ye].src=E[ye],F[ie].style.display="none",F[ye].style.display="block",ue[ye]=!0,ie=ye},Ve.src=E[ye]}else F[ye].src=E[ye]}ie=U,D.resizeSensorInstance=new dt(D,te),te()}var M=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,j=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function I(D){var F,Q,E,U;for(D=D.replace(/'/g,'"');null!==(F=M.exec(D));)for(Q=F[1]+F[3],E=F[2];null!==(U=j.exec(E));)O(Q,U[1],U[2],U[3])}function H(D){var F="";if(D)if("string"==typeof D)(-1!==(D=D.toLowerCase()).indexOf("min-width")||-1!==D.indexOf("max-width"))&&I(D);else for(var Q=0,E=D.length;Q img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",he.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(he),Y=!0);for(var F=0,Q=document.styleSheets.length;F{var gt=tt(910),J=tt(369),At=tt(322);function dt(re,$,b){if(!gt(re))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!re.hasNode($))throw new Error('graphology-shortest-path: the "'+$+'" source node does not exist in the given graph.');if(!re.hasNode(b))throw new Error('graphology-shortest-path: the "'+b+'" target node does not exist in the given graph.');if(($=""+$)==(b=""+b))return[$];var S=re.inboundNeighbors.bind(re),O=re.outboundNeighbors.bind(re),T={},v={};T[$]=null,v[b]=null;var M,j,I,H,Y,D,F,Q,y=[$],w=[b],E=!1;e:for(;y.length&&w.length;)if(y.length<=w.length){for(M=y,y=[],Y=0,F=M.length;Y{kt.exports=function(tt){return null!==tt&&"object"==typeof tt&&"function"==typeof tt.addUndirectedEdgeWithKey&&"function"==typeof tt.dropNode&&"boolean"==typeof tt.multi}},698:function(kt){kt.exports=function(){"use strict";function it(ne){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(de){return typeof de}:function(de){return de&&"function"==typeof Symbol&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de})(ne)}function tt(ne,de){ne.prototype=Object.create(de.prototype),ne.prototype.constructor=ne,J(ne,de)}function gt(ne){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)})(ne)}function J(ne,de){return(J=Object.setPrototypeOf||function(oe,C){return oe.__proto__=C,oe})(ne,de)}function At(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(ne){return!1}}function dt(ne,de,oe){return(dt=At()?Reflect.construct:function(C,P,Z){var we=[null];we.push.apply(we,P);var Fe=new(Function.bind.apply(C,we));return Z&&J(Fe,Z.prototype),Fe}).apply(null,arguments)}function K(ne){var de="function"==typeof Map?new Map:void 0;return(K=function(oe){if(null===oe||-1===Function.toString.call(oe).indexOf("[native code]"))return oe;if("function"!=typeof oe)throw new TypeError("Super expression must either be null or a function");if(void 0!==de){if(de.has(oe))return de.get(oe);de.set(oe,P)}function P(){return dt(oe,arguments,gt(this).constructor)}return P.prototype=Object.create(oe.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),J(P,oe)})(ne)}function Ae(ne){if(void 0===ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ne}var he=function(){for(var ne=arguments[0],de=1,oe=arguments.length;de0&&we.length>P&&!we.warned){we.warned=!0;var et=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(de)+" listeners added. Use emitter.setMaxListeners() to increase limit");et.name="MaxListenersExceededWarning",et.emitter=ne,et.type=de,et.count=we.length,console&&console.warn&&console.warn(et)}return ne}function D(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F(ne,de,oe){var C={fired:!1,wrapFn:void 0,target:ne,type:de,listener:oe},P=D.bind(C);return P.listener=oe,C.wrapFn=P,P}function Q(ne,de,oe){var C=ne._events;if(void 0===C)return[];var P=C[de];return void 0===P?[]:"function"==typeof P?oe?[P.listener||P]:[P]:oe?function(Z){for(var we=new Array(Z.length),Fe=0;Fe0&&(Z=de[0]),Z instanceof Error)throw Z;var we=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw we.context=Z,we}var Fe=P[ne];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,de);else{var et=Fe.length,Dt=U(Fe,et);for(oe=0;oe=0;Z--)if(oe[Z]===de||oe[Z].listener===de){we=oe[Z].listener,P=Z;break}if(P<0)return this;0===P?oe.shift():function(Fe,et){for(;et+1=0;C--)this.removeListener(ne,de[C]);return this},M.prototype.listeners=function(ne){return Q(this,ne,!0)},M.prototype.rawListeners=function(ne){return Q(this,ne,!1)},M.listenerCount=function(ne,de){return"function"==typeof ne.listenerCount?ne.listenerCount(de):E.call(ne,de)},M.prototype.listenerCount=E,M.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]},ue.prototype.next=function(){if(this.done)return{done:!0};var ne=this._next();return ne.done&&(this.done=!0),ne},"undefined"!=typeof Symbol&&(ue.prototype[Symbol.iterator]=function(){return this}),ue.of=function(){var ne=arguments,de=ne.length,oe=0;return new ue(function(){return oe>=de?{done:!0}:{done:!1,value:ne[oe++]}})},ue.empty=function(){var ne=new ue(null);return ne.done=!0,ne},ue.is=function(ne){return ne instanceof ue||"object"==typeof ne&&null!==ne&&"function"==typeof ne.next};var ee=ue,se=function(ne,de){for(var oe,C=arguments.length>1?de:1/0,P=C!==1/0?new Array(C):[],Z=0;;){if(Z===C)return P;if((oe=ne.next()).done)return Z!==de?P.slice(0,Z):P;P[Z++]=oe.value}},Te=function(ne){function de(oe,C){var P;return(P=ne.call(this)||this).name="GraphError",P.message=oe||"",P.data=C||{},P}return tt(de,ne),de}(K(Error)),me=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),te=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),ye=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te);function De(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ve(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function nt(ne,de){this.key=ne,this.attributes=de,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Ze(ne,de,oe,C,P,Z){this.key=de,this.attributes=Z,this.undirected=ne,this.source=C,this.target=P,this.generatedKey=oe}function Je(ne,de,oe,C,P,Z,we){var Fe,et,Dt="out",We="in";if(de&&(Dt=We="undirected"),ne.multi){if(void 0===(et=(Fe=Z[Dt])[P])&&(et=new Set,Fe[P]=et),et.add(oe),C===P&&de)return;void 0===(Fe=we[We])[C]&&(Fe[C]=et)}else{if(Z[Dt][P]=oe,C===P&&de)return;we[We][C]=oe}}function Ye(ne,de,oe){var C=ne.multi,P=oe.source,Z=oe.target,we=P.key,Fe=Z.key,et=P[de?"undirected":"out"],Dt=de?"undirected":"in";if(Fe in et)if(C){var We=et[Fe];1===We.size?(delete et[Fe],delete Z[Dt][we]):We.delete(oe)}else delete et[Fe];C||delete Z[Dt][we]}Ve.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},nt.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var je=[{name:function(ne){return"get".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes[P]}}},{name:function(ne){return"get".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C){var P;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Z=""+C,we=""+arguments[1];if(!(P=q(this,Z,we,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Z,'" - "').concat(we,'").'))}else if(!(P=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&P.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return P.attributes}}},{name:function(ne){return"has".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes.hasOwnProperty(P)}}},{name:function(ne){return"set".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=q(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"update".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=q(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("function"!=typeof Z)throw new me("Graph.".concat(de,": updater should be a function."));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z(we.attributes[P]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"remove".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return delete Z.attributes[P],this.emit("edgeAttributesUpdated",{key:Z.key,type:"remove",attributes:Z.attributes,name:P}),this}}},{name:function(ne){return"replace".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes=P,this.emit("edgeAttributesUpdated",{key:Z.key,type:"replace",attributes:Z.attributes}),this}}},{name:function(ne){return"merge".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return he(Z.attributes,P),this.emit("edgeAttributesUpdated",{key:Z.key,type:"merge",attributes:Z.attributes,data:P}),this}}}],Le=ee,Ee=function(){var ne,de=arguments,oe=-1;return new Le(function C(){if(!ne){if(++oe>=de.length)return{done:!0};ne=de[oe]}var P=ne.next();return P.done?(ne=null,C()):P})},Re=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Ue(ne,de){for(var oe in de)ne.push(de[oe].key)}function qe(ne,de){for(var oe in de)de[oe].forEach(function(C){return ne.push(C.key)})}function Be(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)}}function z(ne,de,oe){for(var C in ne)C!==oe&&ne[C].forEach(function(P){return de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function X(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];if(de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey))return!0}return!1}function be(ne,de,oe){var C,P,Z,we,Fe;for(var et in ne)if(et!==oe)for(C=ne[et].values();!0!==(P=C.next()).done;)if(we=(Z=P.value).source,de(Z.key,Z.attributes,we.key,(Fe=Z.target).key,we.attributes,Fe.attributes,Z.undirected,Z.generatedKey))return!0;return!1}function ce(ne,de){var oe=Object.keys(ne),C=oe.length,P=null,Z=0;return new ee(function we(){var Fe;if(P){var et=P.next();if(et.done)return P=null,Z++,we();Fe=et.value}else{if(Z>=C)return{done:!0};var Dt=oe[Z];if(Dt===de)return Z++,we();if((Fe=ne[Dt])instanceof Set)return P=Fe.values(),we();Z++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function Pe(ne,de,oe){var C=de[oe];C&&ne.push(C.key)}function wt(ne,de,oe){var C=de[oe];C&&C.forEach(function(P){return ne.push(P.key)})}function pt(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function fe(ne,de,oe){var C=ne[de];C&&C.forEach(function(P){return oe(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function B(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;return oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function R(ne,de,oe){var C=ne[de];if(C){for(var P,Z,we=C.values();!0!==(P=we.next()).done;)if(oe((Z=P.value).key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes,Z.undirected,Z.generatedKey))return!0;return!1}}function k(ne,de){var oe=ne[de];if(oe instanceof Set){var C=oe.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{done:!1,value:[Z.key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes]}})}return ee.of([oe.key,oe.attributes,oe.source.key,oe.target.key,oe.source.attributes,oe.target.attributes])}function Oe(ne,de){if(0===ne.size)return[];if("mixed"===de||de===ne.type)return"function"==typeof Array.from?Array.from(ne._edges.keys()):se(ne._edges.keys(),ne._edges.size);for(var oe,C,Z=new Array("undirected"===de?ne.undirectedSize:ne.directedSize),we="undirected"===de,Fe=ne._edges.values(),et=0;!0!==(oe=Fe.next()).done;)(C=oe.value).undirected===we&&(Z[et++]=C.key);return Z}function Xe(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var zt=P.source,Et=P.target;oe(P.key,P.attributes,zt.key,Et.key,zt.attributes,Et.attributes,P.undirected,P.generatedKey)}}function yt(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var zt=P.source,Et=P.target;if(oe(P.key,P.attributes,zt.key,Et.key,zt.attributes,Et.attributes,P.undirected,P.generatedKey))break}}function It(ne,de){if(0===ne.size)return ee.empty();var oe="mixed"!==de&&de!==ne.type,C="undirected"===de,P=ne._edges.values();return new ee(function(){for(var Z,we;;){if((Z=P.next()).done)return Z;if(we=Z.value,!oe||we.undirected===C)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function Tn(ne,de,oe,C){var P=[],Z=ne?qe:Ue;return"undirected"!==de&&("out"!==oe&&Z(P,C.in),"in"!==oe&&Z(P,C.out),!oe&&C.directedSelfLoops>0&&P.splice(P.lastIndexOf(C.key),1)),"directed"!==de&&Z(P,C.undirected),P}function Pn(ne,de,oe,C,P){var Z=ne?z:Be;"undirected"!==de&&("out"!==oe&&Z(C.in,P),"in"!==oe&&Z(C.out,P,oe?null:C.key)),"directed"!==de&&Z(C.undirected,P)}function Gn(ne,de,oe,C,P){var Z=ne?be:X;"undirected"!==de&&("out"!==oe&&Z(C.in,P)||"in"!==oe&&Z(C.out,P,oe?null:C.key))||"directed"===de||Z(C.undirected,P)}function yi(ne,de,oe){var C=ee.empty();return"undirected"!==ne&&("out"!==de&&void 0!==oe.in&&(C=Ee(C,ce(oe.in))),"in"!==de&&void 0!==oe.out&&(C=Ee(C,ce(oe.out,de?null:oe.key)))),"directed"!==ne&&void 0!==oe.undirected&&(C=Ee(C,ce(oe.undirected))),C}function hi(ne,de,oe,C,P){var Z=de?wt:Pe,we=[];return"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&Z(we,C.in,P),void 0!==C.out&&"in"!==oe&&Z(we,C.out,P),!oe&&C.directedSelfLoops>0&&we.splice(we.lastIndexOf(C.key),1)),"directed"!==ne&&void 0!==C.undirected&&Z(we,C.undirected,P),we}function Hr(ne,de,oe,C,P,Z){var we=de?fe:pt;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z),C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z)),"directed"!==ne&&void 0!==C.undirected&&we(C.undirected,P,Z)}function Ns(ne,de,oe,C,P,Z){var we=de?R:B;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z)||C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z,oe?null:C.key))||"directed"===ne||void 0===C.undirected||we(C.undirected,P,Z)}function cs(ne,de,oe,C){var P=ee.empty();return"undirected"!==ne&&(void 0!==oe.in&&"out"!==de&&C in oe.in&&(P=Ee(P,k(oe.in,C))),void 0!==oe.out&&"in"!==de&&C in oe.out&&(P=Ee(P,k(oe.out,C)))),"directed"!==ne&&void 0!==oe.undirected&&C in oe.undirected&&(P=Ee(P,k(oe.undirected,C))),P}var Ps=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Gr(ne,de){if(void 0!==de)for(var oe in de)ne.add(oe)}function qa(ne,de,oe){if("mixed"!==ne){if("undirected"===ne)return Object.keys(oe.undirected);if("string"==typeof de)return Object.keys(oe[de])}var C=new Set;return"undirected"!==ne&&("out"!==de&&Gr(C,oe.in),"in"!==de&&Gr(C,oe.out)),"directed"!==ne&&Gr(C,oe.undirected),se(C.values(),C.size)}function Al(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;oe(Fe.key,Fe.attributes)}}function ua(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;ne.has(et.key)||(ne.add(et.key),C(et.key,et.attributes))}}function ms(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;if(oe(Fe.key,Fe.attributes))return!0}return!1}function Qt(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;if(!ne.has(et.key)&&(ne.add(et.key),C(et.key,et.attributes)))return!0}return!1}function Ka(ne,de){var oe=Object.keys(de),C=oe.length,P=0;return new ee(function(){if(P>=C)return{done:!0};var Z=de[oe[P++]];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===ne?Z.target:we;return{done:!1,value:[et.key,et.attributes]}})}function rt(ne,de,oe){var C=Object.keys(oe),P=C.length,Z=0;return new ee(function we(){if(Z>=P)return{done:!0};var Fe=oe[C[Z++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var et=Fe.source,We=et===de?Fe.target:et;return ne.has(We.key)?we():(ne.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function ot(ne,de,oe,C,P){var Z=ne._nodes.get(C);if("undirected"!==de){if("out"!==oe&&void 0!==Z.in)for(var we in Z.in)if(we===P)return!0;if("in"!==oe&&void 0!==Z.out)for(var Fe in Z.out)if(Fe===P)return!0}if("directed"!==de&&void 0!==Z.undirected)for(var et in Z.undirected)if(et===P)return!0;return!1}function ke(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,We=de._nodes.values(),zt=de.type;!0!==(C=We.next()).done;){if(P=C.value,"undirected"!==zt)for(Z in we=P.out)if(et=(Fe=we[Z]).target,Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return;if("directed"!==zt)for(Z in we=P.undirected)if((et=(Fe=we[Z]).target).key!==Z&&(et=Fe.source),Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return}}function ct(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,We,zt,Et=de._nodes.values(),pn=de.type;!0!==(C=Et.next()).done;){if(P=C.value,"undirected"!==pn)for(Z in et=P.out)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if(We=(Dt=Fe.value).target,zt=oe(P.key,We.key,P.attributes,We.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&zt)return;if("directed"!==pn)for(Z in et=P.undirected)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if((We=(Dt=Fe.value).target).key!==Z&&(We=Dt.source),zt=oe(P.key,We.key,P.attributes,We.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&zt)return}}function Qe(ne,de){var oe={key:ne};return re(de.attributes)||(oe.attributes=he({},de.attributes)),oe}function vt(ne,de){var oe={source:de.source.key,target:de.target.key};return de.generatedKey||(oe.key=ne),re(de.attributes)||(oe.attributes=he({},de.attributes)),de.undirected&&(oe.undirected=!0),oe}function xt(ne){return L(ne)?"key"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?null:"invalid-attributes":"no-key":"not-object"}function Tt(ne){return L(ne)?"source"in ne?"target"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?"undirected"in ne&&"boolean"!=typeof ne.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var $t=new Set(["directed","undirected","mixed"]),jn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ii={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Dn(ne,de,oe){var C=new ne.NodeDataClass(de,oe);return ne._nodes.set(de,C),ne.emit("nodeAdded",{key:de,attributes:oe}),C}function fn(ne,de,oe,C,P,Z,we,Fe){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(Z=""+Z,we=""+we,Fe=Fe||{},!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var et=ne._nodes.get(Z),Dt=ne._nodes.get(we);if(!et)throw new te("Graph.".concat(de,': source node "').concat(Z,'" not found.'));if(!Dt)throw new te("Graph.".concat(de,': target node "').concat(we,'" not found.'));var We={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(We)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));if(!ne.multi&&(C?void 0!==et.undirected[we]:void 0!==et.out[we]))throw new ye("Graph.".concat(de,': an edge linking "').concat(Z,'" to "').concat(we,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var zt=new Ze(C,P,oe,et,Dt,Fe);return ne._edges.set(P,zt),Z===we?C?(et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(et.undirectedDegree++,Dt.undirectedDegree++):(et.outDegree++,Dt.inDegree++),Je(ne,C,zt,Z,we,et,Dt),C?ne._undirectedSize++:ne._directedSize++,We.key=P,ne.emit("edgeAdded",We),P}function zn(ne,de,oe,C,P,Z,we,Fe,et){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(et){if("function"!=typeof Fe)throw new me("Graph.".concat(de,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Dt;if(Z=""+Z,we=""+we,et&&(Dt=Fe,Fe=void 0),!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,zt,Et=ne._nodes.get(Z),pn=ne._nodes.get(we);if(!oe&&(We=ne._edges.get(P))){if(We.source.key!==Z||We.target.key!==we||C&&(We.source.key!==we||We.target.key!==Z))throw new ye("Graph.".concat(de,': inconsistency detected when attempting to merge the "').concat(P,'" edge with "').concat(Z,'" source & "').concat(we,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));zt=We}if(zt||ne.multi||!Et||(zt=C?Et.undirected[we]:Et.out[we]),zt)return(et?Dt:Fe)?(et?(zt.attributes=Dt(zt.attributes),ne.emit("edgeAttributesUpdated",{type:"replace",key:zt.key,attributes:zt.attributes})):(he(zt.attributes,Fe),ne.emit("edgeAttributesUpdated",{type:"merge",key:zt.key,attributes:zt.attributes,data:Fe})),zt.key):zt.key;Fe=Fe||{},et&&Dt&&(Fe=Dt(Fe));var Wr={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(Wr)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));return Et||(Et=Dn(ne,Z,{}),Z===we&&(pn=Et)),pn||(pn=Dn(ne,we,{})),We=new Ze(C,P,oe,Et,pn,Fe),ne._edges.set(P,We),Z===we?C?(Et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(Et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(Et.undirectedDegree++,pn.undirectedDegree++):(Et.outDegree++,pn.inDegree++),Je(ne,C,We,Z,we,Et,pn),C?ne._undirectedSize++:ne._directedSize++,Wr.key=P,ne.emit("edgeAdded",Wr),P}var ne,bn=function(ne){function de(C){var P;if(P=ne.call(this)||this,(C=he({},ii,C)).edgeKeyGenerator&&"function"!=typeof C.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(C.edgeKeyGenerator,'".'));if("boolean"!=typeof C.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(C.multi,'".'));if(!$t.has(C.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(C.type,'".'));if("boolean"!=typeof C.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(C.allowSelfLoops,'".'));var Z,we="mixed"===C.type?De:"directed"===C.type?Ve:nt;return $(Ae(P),"NodeDataClass",we),$(Ae(P),"_attributes",{}),$(Ae(P),"_nodes",new Map),$(Ae(P),"_edges",new Map),$(Ae(P),"_directedSize",0),$(Ae(P),"_undirectedSize",0),$(Ae(P),"_directedSelfLoopCount",0),$(Ae(P),"_undirectedSelfLoopCount",0),$(Ae(P),"_edgeKeyGenerator",C.edgeKeyGenerator||(Z=0,function(){return Z++})),$(Ae(P),"_options",C),jn.forEach(function(Fe){return $(Ae(P),Fe,P[Fe])}),b(Ae(P),"order",function(){return P._nodes.size}),b(Ae(P),"size",function(){return P._edges.size}),b(Ae(P),"directedSize",function(){return P._directedSize}),b(Ae(P),"undirectedSize",function(){return P._undirectedSize}),b(Ae(P),"selfLoopCount",function(){return P._directedSelfLoopCount+P._undirectedSelfLoopCount}),b(Ae(P),"directedSelfLoopCount",function(){return P._directedSelfLoopCount}),b(Ae(P),"undirectedSelfLoopCount",function(){return P._undirectedSelfLoopCount}),b(Ae(P),"multi",P._options.multi),b(Ae(P),"type",P._options.type),b(Ae(P),"allowSelfLoops",P._options.allowSelfLoops),b(Ae(P),"implementation",function(){return"graphology"}),P}tt(de,ne);var oe=de.prototype;return oe.hasNode=function(C){return this._nodes.has(""+C)},oe.hasDirectedEdge=function(C,P){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&!we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.out[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasUndirectedEdge=function(C,P){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.undirected[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasEdge=function(C,P){if(1===arguments.length)return this._edges.has(""+C);if(2===arguments.length){P=""+P;var we=this._nodes.get(C=""+C);if(!we)return!1;var Fe=void 0!==we.out&&we.out[P];return Fe||(Fe=void 0!==we.undirected&&we.undirected[P]),!(!Fe||this.multi&&!Fe.size)}throw new me("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.directedEdge=function(C,P){if("undirected"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.directedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.directedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||void 0;return we?we.key:void 0}},oe.undirectedEdge=function(C,P){if("directed"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.undirectedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.undirectedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.undirected&&Z.undirected[P]||void 0;return we?we.key:void 0}},oe.edge=function(C,P){if(this.multi)throw new ye("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");P=""+P;var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.edge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.edge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||Z.undirected&&Z.undirected[P]||void 0;if(we)return we.key},oe.inDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.inDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.inDegree+(P?Z.directedSelfLoops:0)},oe.outDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.outDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.outDegree+(P?Z.directedSelfLoops:0)},oe.directedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.directedDegree: could not find the "'.concat(C,'" node in the graph.'));if("undirected"===this.type)return 0;var we=P?Z.directedSelfLoops:0;return Z.inDegree+we+(Z.outDegree+we)},oe.undirectedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.undirectedDegree: could not find the "'.concat(C,'" node in the graph.'));return"directed"===this.type?0:Z.undirectedDegree+2*(P?Z.undirectedSelfLoops:0)},oe.degree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.degree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.degree: could not find the "'.concat(C,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(P&&(Fe=Z.undirectedSelfLoops),we+=Z.undirectedDegree+2*Fe),"undirected"!==this.type&&(P&&(Fe=Z.directedSelfLoops),we+=Z.inDegree+Z.outDegree+2*Fe),we},oe.source=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.source: could not find the "'.concat(C,'" edge in the graph.'));return P.source.key},oe.target=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.target: could not find the "'.concat(C,'" edge in the graph.'));return P.target.key},oe.extremities=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.extremities: could not find the "'.concat(C,'" edge in the graph.'));return[P.source.key,P.target.key]},oe.opposite=function(C,P){C=""+C;var Z=this._edges.get(P=""+P);if(!Z)throw new te('Graph.opposite: could not find the "'.concat(P,'" edge in the graph.'));var we=Z.source.key,Fe=Z.target.key;if(C!==we&&C!==Fe)throw new te('Graph.opposite: the "'.concat(C,'" node is not attached to the "').concat(P,'" edge (').concat(we,", ").concat(Fe,")."));return C===we?Fe:we},oe.hasExtremity=function(C,P){P=""+P;var Z=this._edges.get(C=""+C);if(!Z)throw new te('Graph.hasExtremity: could not find the "'.concat(C,'" edge in the graph.'));return Z.source.key===P||Z.target.key===P},oe.isUndirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isUndirected: could not find the "'.concat(C,'" edge in the graph.'));return P.undirected},oe.isDirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isDirected: could not find the "'.concat(C,'" edge in the graph.'));return!P.undirected},oe.isSelfLoop=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isSelfLoop: could not find the "'.concat(C,'" edge in the graph.'));return P.source===P.target},oe.hasGeneratedKey=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.hasGeneratedKey: could not find the "'.concat(C,'" edge in the graph.'));return P.generatedKey},oe.addNode=function(C,P){return function(Z,we,Fe){if(Fe&&!L(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},Z._nodes.has(we=""+we))throw new ye('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var et=new Z.NodeDataClass(we,Fe);return Z._nodes.set(we,et),Z.emit("nodeAdded",{key:we,attributes:Fe}),et}(this,C,P).key},oe.mergeNode=function(C,P){if(P&&!L(P))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(P,'"'));P=P||{};var Z=this._nodes.get(C=""+C);return Z?(P&&(he(Z.attributes,P),this.emit("nodeAttributesUpdated",{type:"merge",key:C,attributes:Z.attributes,data:P})),C):(Z=new this.NodeDataClass(C,P),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:P}),C)},oe.updateNode=function(C,P){if(P&&"function"!=typeof P)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(P,'"'));var Z=this._nodes.get(C=""+C);if(Z)return P&&(Z.attributes=P(Z.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:C,attributes:Z.attributes})),C;var Fe=P?P({}):{};return Z=new this.NodeDataClass(C,Fe),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:Fe}),C},oe.dropNode=function(C){var P=this,Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.dropNode: could not find the "'.concat(C,'" node in the graph.'));this.forEachEdge(C,function(we){P.dropEdge(we)}),this._nodes.delete(C),this.emit("nodeDropped",{key:C,attributes:Z.attributes})},oe.dropEdge=function(C){var P;if(arguments.length>1){var Z=""+arguments[0],we=""+arguments[1];if(!(P=q(this,Z,we,this.type)))throw new te('Graph.dropEdge: could not find the "'.concat(Z,'" -> "').concat(we,'" edge in the graph.'))}else if(!(P=this._edges.get(C=""+C)))throw new te('Graph.dropEdge: could not find the "'.concat(C,'" edge in the graph.'));this._edges.delete(P.key);var et=P.source,Dt=P.target,We=P.attributes,zt=P.undirected;return et===Dt?zt?(et.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(et.directedSelfLoops--,this._directedSelfLoopCount--):zt?(et.undirectedDegree--,Dt.undirectedDegree--):(et.outDegree--,Dt.inDegree--),Ye(this,zt,P),zt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:C,attributes:We,source:et.key,target:Dt.key,undirected:zt}),this},oe.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},oe.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},oe.getAttribute=function(C){return this._attributes[C]},oe.getAttributes=function(){return this._attributes},oe.hasAttribute=function(C){return this._attributes.hasOwnProperty(C)},oe.setAttribute=function(C,P){return this._attributes[C]=P,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.updateAttribute=function(C,P){if("function"!=typeof P)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[C]=P(this._attributes[C]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.removeAttribute=function(C){return delete this._attributes[C],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:C}),this},oe.replaceAttributes=function(C){if(!L(C))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=C,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},oe.mergeAttributes=function(C){if(!L(C))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,C),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:C}),this},oe.getNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.getNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes[P]},oe.getNodeAttributes=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.getNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));return P.attributes},oe.hasNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes.hasOwnProperty(P)},oe.setNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.setNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return we.attributes[P]=Z,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.updateNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.updateNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof Z)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,et=Z(Fe[P]);return Fe[P]=et,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.removeNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return delete Z.attributes[P],this.emit("nodeAttributesUpdated",{key:C,type:"remove",attributes:Z.attributes,name:P}),this},oe.replaceNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.replaceNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return Z.attributes=P,this.emit("nodeAttributesUpdated",{key:C,type:"replace",attributes:Z.attributes}),this},oe.mergeNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.mergeNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(Z.attributes,P),this.emit("nodeAttributesUpdated",{key:C,type:"merge",attributes:Z.attributes,data:P}),this},oe.updateEachNodeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._nodes.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:P||null})},oe.updateEachEdgeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._edges.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:P||null})},oe.forEach=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?ct(!1,this,C):ke(!1,this,C)},oe.forEachUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?ct(!0,this,C):ke(!0,this,C)},oe.adjacency=function(){return this.multi?(et=(C=this)._nodes.values(),Dt=C.type,We="outer",zt=null,new ee(function Et(){var pn;if("outer"===We)return!0===(pn=et.next()).done?pn:(P=pn.value,We="directed",Et());if("directed"===We)return"undirected"===Dt?(We="undirected",Et()):(we=P.out,Z=Object.keys(P.out),Fe=0,We="inner-directed",Et());if("undirected"===We){if("directed"===Dt)return We="outer",Et();we=P.undirected,Z=Object.keys(P.undirected),Fe=0,We="inner-undirected"}if(!zt&&Fe>=Z.length)return We="inner-undirected"===We?"outer":"undirected",Et();if(!zt){var _s=Z[Fe++];return zt=we[_s].values(),Et()}if((pn=zt.next()).done)return zt=null,Et();var Wr=pn.value,Ks=Wr.target;return"inner-undirected"===We&&Ks.key===P.key&&(Ks=Wr.source),{done:!1,value:[P.key,Ks.key,P.attributes,Ks.attributes,Wr.key,Wr.attributes]}})):(Tl=(Et=this)._nodes.values(),oo=Et.type,Pr="outer",new ee(function Fs(){var fc;if("outer"===Pr)return!0===(fc=Tl.next()).done?fc:(pn=fc.value,Pr="directed",Fs());if("directed"===Pr)return"undirected"===oo?(Pr="undirected",Fs()):(Wr=pn.out,_s=Object.keys(pn.out),Ks=0,Pr="inner-directed",Fs());if("undirected"===Pr){if("directed"===oo)return Pr="outer",Fs();Wr=pn.undirected,_s=Object.keys(pn.undirected),Ks=0,Pr="inner-undirected"}if(Ks>=_s.length)return Pr="inner-undirected"===Pr?"outer":"undirected",Fs();var yn=_s[Ks++],ao=Wr[yn],Ml=ao.target;return"inner-undirected"===Pr&&Ml.key===pn.key&&(Ml=ao.source),{done:!1,value:[pn.key,Ml.key,pn.attributes,Ml.attributes,ao.key,ao.attributes]}}));var Et,pn,_s,Wr,Ks,Tl,oo,Pr,C,P,Z,we,Fe,et,Dt,We,zt},oe.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):se(this._nodes.keys(),this._nodes.size)},oe.forEachNode=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(P,Z){C(Z,P.attributes)})},oe.forEachNodeUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");for(var P,Z,we=this._nodes.values();!0!==(P=we.next())&&!C((Z=P.value).key,Z.attributes););},oe.nodeEntries=function(){var C=this._nodes.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{value:[Z.key,Z.attributes],done:!1}})},oe.exportNode=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.exportNode: could not find the "'.concat(C,'" node in the graph.'));return Qe(C,P)},oe.exportEdge=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.exportEdge: could not find the "'.concat(C,'" edge in the graph.'));return vt(C,P)},oe.export=function(){var C=new Array(this._nodes.size),P=0;this._nodes.forEach(function(we,Fe){C[P++]=Qe(Fe,we)});var Z=new Array(this._edges.size);return P=0,this._edges.forEach(function(we,Fe){Z[P++]=vt(Fe,we)}),{attributes:this.getAttributes(),nodes:C,edges:Z,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},oe.importNode=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=xt(C);if(Z){if("not-object"===Z)throw new me('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===Z)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===Z)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=C.key,Fe=C.attributes,et=void 0===Fe?{}:Fe;return P?this.mergeNode(we,et):this.addNode(we,et),this},oe.importEdge=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=Tt(C);if(Z){if("not-object"===Z)throw new me('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===Z)throw new me("Graph.importEdge: missing souce.");if("no-target"===Z)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===Z)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===Z)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=C.source,Fe=C.target,et=C.attributes,Dt=void 0===et?{}:et,We=C.undirected,zt=void 0!==We&&We;return"key"in C?(P?zt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:zt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,C.key,we,Fe,Dt):(P?zt?this.mergeUndirectedEdge:this.mergeDirectedEdge:zt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Dt),this},oe.import=function(C){var P,Z,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V(C))return this.import(C.export(),Fe),this;if(!L(C))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(C.attributes){if(!L(C.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(C.attributes):this.replaceAttributes(C.attributes)}if(C.nodes){if(we=C.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(P=0,Z=we.length;PZ)){var Dt=new Set;Dt.add(P.undirected[et]),P.undirected[et]=Dt,C._nodes.get(et).undirected[Z]=Dt}})),this;var C},oe.clearIndex=function(){return this._nodes.forEach(function(C){void 0!==C.in&&(C.in={},C.out={}),void 0!==C.undirected&&(C.undirected={})}),this},oe.toJSON=function(){return this.export()},oe.toString=function(){return"[object Graph]"},oe.inspect=function(){var C=this,P={};this._nodes.forEach(function(Dt,We){P[We]=Dt.attributes});var Z={},we={};this._edges.forEach(function(Dt,We){var zt=Dt.undirected?"--":"->",Et="",pn="(".concat(Dt.source.key,")").concat(zt,"(").concat(Dt.target.key,")");Dt.generatedKey?C.multi&&(void 0===we[pn]?we[pn]=0:we[pn]++,Et+="".concat(we[pn],". ")):Et+="[".concat(We,"]: "),Z[Et+=pn]=Dt.attributes});var Fe={};for(var et in this)this.hasOwnProperty(et)&&!jn.has(et)&&"function"!=typeof this[et]&&(Fe[et]=this[et]);return Fe.attributes=this._attributes,Fe.nodes=P,Fe.edges=Z,$(Fe,"constructor",this.constructor),Fe},de}(T.exports.EventEmitter);"undefined"!=typeof Symbol&&(bn.prototype[Symbol.for("nodejs.util.inspect.custom")]=bn.prototype.inspect),[{name:function(ne){return"".concat(ne,"Edge")},generateKey:!0},{name:function(ne){return"".concat(ne,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ne){return"".concat(ne,"EdgeWithKey")}},{name:function(ne){return"".concat(ne,"DirectedEdgeWithKey")},type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ne){["add","merge","update"].forEach(function(de){var oe=ne.name(de),C="add"===de?fn:zn;bn.prototype[oe]=ne.generateKey?function(P,Z,we){return C(this,oe,!0,"undirected"===(ne.type||this.type),null,P,Z,we,"update"===de)}:function(P,Z,we,Fe){return C(this,oe,!1,"undirected"===(ne.type||this.type),P,Z,we,Fe,"update"===de)}})}),"undefined"!=typeof Symbol&&(bn.prototype[Symbol.iterator]=bn.prototype.adjacency),ne=bn,je.forEach(function(de){var oe=de.name,C=de.attacher;C(ne,oe("Edge"),"mixed"),C(ne,oe("DirectedEdge"),"directed"),C(ne,oe("UndirectedEdge"),"undirected")}),function(ne){Re.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe,et){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(!arguments.length)return Oe(this,Z);if(1===arguments.length){var Dt=this._nodes.get(Fe=""+Fe);if(void 0===Dt)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return Tn(this.multi,"mixed"===Z?this.type:Z,we,Dt)}if(2===arguments.length){et=""+et;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" target node in the graph.'));return hi(Z,this.multi,we,We,et)}throw new me("Graph.".concat(P,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1);oe.prototype[Fe]=function(et,Dt,We){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return Xe(this,Z,We=et);if(2===arguments.length){We=Dt;var zt=this._nodes.get(et=""+et);if(void 0===zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Pn(this.multi,"mixed"===Z?this.type:Z,we,zt,We)}if(3===arguments.length){Dt=""+Dt;var Et=this._nodes.get(et=""+et);if(!Et)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Hr(Z,this.multi,we,Et,Dt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1)+"Until";oe.prototype[Fe]=function(et,Dt,We){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return yt(this,Z,We=et);if(2===arguments.length){We=Dt;var zt=this._nodes.get(et=""+et);if(void 0===zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Gn(this.multi,"mixed"===Z?this.type:Z,we,zt,We)}if(3===arguments.length){Dt=""+Dt;var Et=this._nodes.get(et=""+et);if(!Et)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Ns(Z,this.multi,we,Et,Dt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var Z=C.type,we=C.direction,Fe=C.name.slice(0,-1)+"Entries";oe.prototype[Fe]=function(et,Dt){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return ee.empty();if(!arguments.length)return It(this,Z);if(1===arguments.length){var We=this._nodes.get(et=""+et);if(!We)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return yi(Z,we,We)}if(2===arguments.length){Dt=""+Dt;var zt=this._nodes.get(et=""+et);if(!zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return cs(Z,we,zt,Dt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ne,de)})}(bn),function(ne){Ps.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(2===arguments.length){var et=""+arguments[0],Dt=""+arguments[1];if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(P,': could not find the "').concat(Dt,'" node in the graph.'));return ot(this,Z,we,et,Dt)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return qa("mixed"===Z?this.type:Z,we,We)}throw new me("Graph.".concat(P,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1);ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,We,zt,Et){if("mixed"!==Dt){if("undirected"===Dt)return Al(zt,zt.undirected,Et);if("string"==typeof We)return Al(zt,zt[We],Et)}var pn=new Set;"undirected"!==Dt&&("out"!==We&&ua(pn,zt,zt.in,Et),"in"!==We&&ua(pn,zt,zt.out,Et)),"directed"!==Dt&&ua(pn,zt,zt.undirected,Et)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1)+"Until";ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,We,zt,Et){if("mixed"!==Dt){if("undirected"===Dt)return ms(zt,zt.undirected,Et);if("string"==typeof We)return ms(zt,zt[We],Et)}var pn=new Set;"undirected"!==Dt&&("out"!==We&&Qt(pn,zt,zt.in,Et)||"in"!==We&&Qt(pn,zt,zt.out,Et))||"directed"===Dt||Qt(pn,zt,zt.undirected,Et)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var C=de.type,P=de.direction,Z=de.name.slice(0,-1)+"Entries";ne.prototype[Z]=function(we){if("mixed"!==C&&"mixed"!==this.type&&C!==this.type)return ee.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));return function(et,Dt,We){if("mixed"!==et){if("undirected"===et)return Ka(We,We.undirected);if("string"==typeof Dt)return Ka(We,We[Dt])}var zt=ee.empty(),Et=new Set;return"undirected"!==et&&("out"!==Dt&&(zt=Ee(zt,rt(Et,We,We.in))),"in"!==Dt&&(zt=Ee(zt,rt(Et,We,We.out)))),"directed"!==et&&(zt=Ee(zt,rt(Et,We,We.undirected))),zt}("mixed"===C?this.type:C,P,Fe)}}(ne,de)})}(bn);var Qi=function(ne){function de(oe){var C=he({type:"directed"},oe);if("multi"in C&&!1!==C.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==C.type)throw new me('DirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),Zi=function(ne){function de(oe){var C=he({type:"undirected"},oe);if("multi"in C&&!1!==C.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==C.type)throw new me('UndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),qn=function(ne){function de(oe){var C=he({multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ne.call(this,C)||this}return tt(de,ne),de}(bn),Pi=function(ne){function de(oe){var C=he({type:"directed",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==C.type)throw new me('MultiDirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),da=function(ne){function de(oe){var C=he({type:"undirected",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==C.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn);function $r(ne){ne.from=function(de,oe){var C=he({},de.options,oe),P=new ne(C);return P.import(de),P}}return $r(bn),$r(Qi),$r(Zi),$r(qn),$r(Pi),$r(da),bn.Graph=bn,bn.DirectedGraph=Qi,bn.UndirectedGraph=Zi,bn.MultiGraph=qn,bn.MultiDirectedGraph=Pi,bn.MultiUndirectedGraph=da,bn.InvalidArgumentsGraphError=me,bn.NotFoundGraphError=te,bn.UsageGraphError=ye,bn}()},524:(kt,it,tt)=>{var gt;!function(J,At,dt,K){"use strict";var T,Ae=["","webkit","Moz","MS","ms","o"],he=At.createElement("div"),V=Math.round,L=Math.abs,re=Date.now;function $(_e,Ce,He){return setTimeout(M(_e,He),Ce)}function b(_e,Ce,He){return!!Array.isArray(_e)&&(S(_e,He[Ce],He),!0)}function S(_e,Ce,He){var mt;if(_e)if(_e.forEach)_e.forEach(Ce,He);else if(_e.length!==K)for(mt=0;mt<_e.length;)Ce.call(He,_e[mt],mt,_e),mt++;else for(mt in _e)_e.hasOwnProperty(mt)&&Ce.call(He,_e[mt],mt,_e)}function O(_e,Ce,He){var mt="DEPRECATED METHOD: "+Ce+"\n"+He+" AT \n";return function(){var jt=new Error("get-stack-trace"),Ht=jt&&jt.stack?jt.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ri=J.console&&(J.console.warn||J.console.log);return ri&&ri.call(J.console,mt,Ht),_e.apply(this,arguments)}}T="function"!=typeof Object.assign?function(Ce){if(Ce===K||null===Ce)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(Ce),mt=1;mt-1}function Q(_e){return _e.trim().split(/\s+/g)}function E(_e,Ce,He){if(_e.indexOf&&!He)return _e.indexOf(Ce);for(var mt=0;mt<_e.length;){if(He&&_e[mt][He]==Ce||!He&&_e[mt]===Ce)return mt;mt++}return-1}function U(_e){return Array.prototype.slice.call(_e,0)}function ie(_e,Ce,He){for(var mt=[],jt=[],Ht=0;Ht<_e.length;){var ri=Ce?_e[Ht][Ce]:_e[Ht];E(jt,ri)<0&&mt.push(_e[Ht]),jt[Ht]=ri,Ht++}return He&&(mt=Ce?mt.sort(function(qr,ys){return qr[Ce]>ys[Ce]}):mt.sort()),mt}function ue(_e,Ce){for(var He,mt,jt=Ce[0].toUpperCase()+Ce.slice(1),Ht=0;Ht1&&!He.firstMultiple?He.firstMultiple=yt(Ce):1===jt&&(He.firstMultiple=!1);var Ht=He.firstInput,ri=He.firstMultiple,Fr=ri?ri.center:Ht.center,qr=Ce.center=It(mt);Ce.timeStamp=re(),Ce.deltaTime=Ce.timeStamp-Ht.timeStamp,Ce.angle=yi(Fr,qr),Ce.distance=Gn(Fr,qr),function(_e,Ce){var He=Ce.center,mt=_e.offsetDelta||{},jt=_e.prevDelta||{},Ht=_e.prevInput||{};(1===Ce.eventType||4===Ht.eventType)&&(jt=_e.prevDelta={x:Ht.deltaX||0,y:Ht.deltaY||0},mt=_e.offsetDelta={x:He.x,y:He.y}),Ce.deltaX=jt.x+(He.x-mt.x),Ce.deltaY=jt.y+(He.y-mt.y)}(He,Ce),Ce.offsetDirection=Pn(Ce.deltaX,Ce.deltaY);var ys=Tn(Ce.deltaTime,Ce.deltaX,Ce.deltaY);Ce.overallVelocityX=ys.x,Ce.overallVelocityY=ys.y,Ce.overallVelocity=L(ys.x)>L(ys.y)?ys.x:ys.y,Ce.scale=ri?function(_e,Ce){return Gn(Ce[0],Ce[1],pt)/Gn(_e[0],_e[1],pt)}(ri.pointers,mt):1,Ce.rotation=ri?function(_e,Ce){return yi(Ce[1],Ce[0],pt)+yi(_e[1],_e[0],pt)}(ri.pointers,mt):0,Ce.maxPointers=He.prevInput?Ce.pointers.length>He.prevInput.maxPointers?Ce.pointers.length:He.prevInput.maxPointers:Ce.pointers.length,function(_e,Ce){var jt,Ht,ri,Fr,He=_e.lastInterval||Ce,mt=Ce.timeStamp-He.timeStamp;if(8!=Ce.eventType&&(mt>25||He.velocity===K)){var qr=Ce.deltaX-He.deltaX,ys=Ce.deltaY-He.deltaY,ti=Tn(mt,qr,ys);Ht=ti.x,ri=ti.y,jt=L(ti.x)>L(ti.y)?ti.x:ti.y,Fr=Pn(qr,ys),_e.lastInterval=Ce}else jt=He.velocity,Ht=He.velocityX,ri=He.velocityY,Fr=He.direction;Ce.velocity=jt,Ce.velocityX=Ht,Ce.velocityY=ri,Ce.direction=Fr}(He,Ce);var ti=_e.element;D(Ce.srcEvent.target,ti)&&(ti=Ce.srcEvent.target),Ce.target=ti}(_e,He),_e.emit("hammer.input",He),_e.recognize(He),_e.session.prevInput=He}function yt(_e){for(var Ce=[],He=0;He<_e.pointers.length;)Ce[He]={clientX:V(_e.pointers[He].clientX),clientY:V(_e.pointers[He].clientY)},He++;return{timeStamp:re(),pointers:Ce,center:It(Ce),deltaX:_e.deltaX,deltaY:_e.deltaY}}function It(_e){var Ce=_e.length;if(1===Ce)return{x:V(_e[0].clientX),y:V(_e[0].clientY)};for(var He=0,mt=0,jt=0;jt=L(Ce)?_e<0?2:4:Ce<0?8:16}function Gn(_e,Ce,He){He||(He=wt);var mt=Ce[He[0]]-_e[He[0]],jt=Ce[He[1]]-_e[He[1]];return Math.sqrt(mt*mt+jt*jt)}function yi(_e,Ce,He){return He||(He=wt),180*Math.atan2(Ce[He[1]]-_e[He[1]],Ce[He[0]]-_e[He[0]])/Math.PI}fe.prototype={handler:function(){},init:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Y(this.element,this.evEl,this.domHandler),this.evTarget&&Y(this.target,this.evTarget,this.domHandler),this.evWin&&Y(Te(this.element),this.evWin,this.domHandler)}};var Ns={mousedown:1,mousemove:2,mouseup:4},cs="mousedown",Ps="mousemove mouseup";function Gr(){this.evEl=cs,this.evWin=Ps,this.pressed=!1,fe.apply(this,arguments)}w(Gr,fe,{handler:function(Ce){var He=Ns[Ce.type];1&He&&0===Ce.button&&(this.pressed=!0),2&He&&1!==Ce.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[Ce],changedPointers:[Ce],pointerType:Ze,srcEvent:Ce}))}});var qa={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Al={2:Ve,3:"pen",4:Ze,5:"kinect"},ua="pointerdown",ms="pointermove pointerup pointercancel";function Qt(){this.evEl=ua,this.evWin=ms,fe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}J.MSPointerEvent&&!J.PointerEvent&&(ua="MSPointerDown",ms="MSPointerMove MSPointerUp MSPointerCancel"),w(Qt,fe,{handler:function(Ce){var He=this.store,mt=!1,jt=Ce.type.toLowerCase().replace("ms",""),Ht=qa[jt],ri=Al[Ce.pointerType]||Ce.pointerType,Fr=ri==Ve,qr=E(He,Ce.pointerId,"pointerId");1&Ht&&(0===Ce.button||Fr)?qr<0&&(He.push(Ce),qr=He.length-1):12&Ht&&(mt=!0),!(qr<0)&&(He[qr]=Ce,this.callback(this.manager,Ht,{pointers:He,changedPointers:[Ce],pointerType:ri,srcEvent:Ce}),mt&&He.splice(qr,1))}});var Ka={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",ot="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=rt,this.evWin=ot,this.started=!1,fe.apply(this,arguments)}function pe(_e,Ce){var He=U(_e.touches),mt=U(_e.changedTouches);return 12&Ce&&(He=ie(He.concat(mt),"identifier",!0)),[He,mt]}w(ut,fe,{handler:function(Ce){var He=Ka[Ce.type];if(1===He&&(this.started=!0),this.started){var mt=pe.call(this,Ce,He);12&He&&mt[0].length-mt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:mt[0],changedPointers:mt[1],pointerType:Ve,srcEvent:Ce})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ke="touchstart touchmove touchend touchcancel";function ct(){this.evTarget=ke,this.targetIds={},fe.apply(this,arguments)}function Qe(_e,Ce){var He=U(_e.touches),mt=this.targetIds;if(3&Ce&&1===He.length)return mt[He[0].identifier]=!0,[He,He];var jt,Ht,ri=U(_e.changedTouches),Fr=[],qr=this.target;if(Ht=He.filter(function(ys){return D(ys.target,qr)}),1===Ce)for(jt=0;jt-1&&mt.splice(Ht,1)},2500)}}function ii(_e){for(var Ce=_e.srcEvent.clientX,He=_e.srcEvent.clientY,mt=0;mt-1&&this.requireFail.splice(Ce,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(_e){return!!this.simultaneous[_e.id]},emit:function(_e){var Ce=this,He=this.state;function mt(jt){Ce.manager.emit(jt,_e)}He<8&&mt(Ce.options.event+We(He)),mt(Ce.options.event),_e.additionalEvent&&mt(_e.additionalEvent),He>=8&&mt(Ce.options.event+We(He))},tryEmit:function(_e){if(this.canEmit())return this.emit(_e);this.state=32},canEmit:function(){for(var _e=0;_eCe.threshold&&jt&Ce.direction},attrTest:function(_e){return pn.prototype.attrTest.call(this,_e)&&(2&this.state||!(2&this.state)&&this.directionTest(_e))},emit:function(_e){this.pX=_e.deltaX,this.pY=_e.deltaY;var Ce=zt(_e.direction);Ce&&(_e.additionalEvent=this.options.event+Ce),this._super.emit.call(this,_e)}}),w(Wr,pn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.scale-1)>this.options.threshold||2&this.state)},emit:function(_e){1!==_e.scale&&(_e.additionalEvent=this.options.event+(_e.scale<1?"in":"out")),this._super.emit.call(this,_e)}}),w(Ks,Dt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(_e){var Ce=this.options,He=_e.pointers.length===Ce.pointers,mt=_e.distanceCe.time;if(this._input=_e,!mt||!He||12&_e.eventType&&!jt)this.reset();else if(1&_e.eventType)this.reset(),this._timer=$(function(){this.state=8,this.tryEmit()},Ce.time,this);else if(4&_e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(_e){8===this.state&&(_e&&4&_e.eventType?this.manager.emit(this.options.event+"up",_e):(this._input.timeStamp=re(),this.manager.emit(this.options.event,this._input)))}}),w(Tl,pn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.rotation)>this.options.threshold||2&this.state)}}),w(oo,pn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _s.prototype.getTouchAction.call(this)},attrTest:function(_e){var He,Ce=this.options.direction;return 30&Ce?He=_e.overallVelocity:6&Ce?He=_e.overallVelocityX:24&Ce&&(He=_e.overallVelocityY),this._super.attrTest.call(this,_e)&&Ce&_e.offsetDirection&&_e.distance>this.options.threshold&&_e.maxPointers==this.options.pointers&&L(He)>this.options.velocity&&4&_e.eventType},emit:function(_e){var Ce=zt(_e.offsetDirection);Ce&&this.manager.emit(this.options.event+Ce,_e),this.manager.emit(this.options.event,_e)}}),w(Pr,Dt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Qi]},process:function(_e){var Ce=this.options,He=_e.pointers.length===Ce.pointers,mt=_e.distance"']/g,ms=RegExp(Al.source),Qt=RegExp(ua.source),Ka=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pe=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,ct=RegExp(ke.source),Qe=/^\s+/,vt=/\s/,xt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tt=/\{\n\/\* \[wrapped with (.+)\] \*/,$t=/,? & /,jn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ii=/[()=,{}\[\]\/\s]/,Dn=/\\(\\)?/g,fn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zn=/\w*$/,bn=/^[-+]0x[0-9a-f]+$/i,Qi=/^0b[01]+$/i,Zi=/^\[object .+?Constructor\]$/,qn=/^0o[0-7]+$/i,Pi=/^(?:0|[1-9]\d*)$/,da=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$r=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,de="\\ud800-\\udfff",Z="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",pn="\\ufe0e\\ufe0f",_s="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ks="["+de+"]",Tl="["+_s+"]",oo="["+Z+"]",Pr="\\d+",Fs="["+we+"]",fc="["+Fe+"]",yn="[^"+de+_s+Pr+we+Fe+Et+"]",ao="\\ud83c[\\udffb-\\udfff]",ha="[^"+de+"]",id="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="["+Et+"]",mt="(?:"+fc+"|"+yn+")",jt="(?:"+Ce+"|"+yn+")",Ht="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ri="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Fr="(?:"+oo+"|"+ao+")?",qr="["+pn+"]?",T1=qr+Fr+"(?:\\u200d(?:"+[ha,id,_e].join("|")+")"+qr+Fr+")*",rd="(?:"+[Fs,id,_e].join("|")+")"+T1,Wi="(?:"+[ha+oo+"?",oo,id,_e,Ks].join("|")+")",Wf=RegExp("['\u2019]","g"),xm=RegExp(oo,"g"),fh=RegExp(ao+"(?="+ao+")|"+Wi+T1,"g"),gv=RegExp([Ce+"?"+fc+"+"+Ht+"(?="+[Tl,Ce,"$"].join("|")+")",jt+"+"+ri+"(?="+[Tl,Ce+mt,"$"].join("|")+")",Ce+"?"+mt+"+"+Ht,Ce+"+"+ri,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pr,rd].join("|"),"g"),M1=RegExp("[\\u200d"+de+Z+pn+"]"),Dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ph=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],D1=-1,wn={};wn[It]=wn[Tn]=wn[Pn]=wn[Gn]=wn[yi]=wn[hi]=wn[Hr]=wn[Ns]=wn[cs]=!0,wn[Ze]=wn[Je]=wn[Xe]=wn[je]=wn[yt]=wn[Le]=wn[Re]=wn[Ue]=wn[Be]=wn[z]=wn[be]=wn[wt]=wn[pt]=wn[fe]=wn[k]=!1;var Ji={};Ji[Ze]=Ji[Je]=Ji[Xe]=Ji[yt]=Ji[je]=Ji[Le]=Ji[It]=Ji[Tn]=Ji[Pn]=Ji[Gn]=Ji[yi]=Ji[Be]=Ji[z]=Ji[be]=Ji[wt]=Ji[pt]=Ji[fe]=Ji[B]=Ji[hi]=Ji[Hr]=Ji[Ns]=Ji[cs]=!0,Ji[Re]=Ji[Ue]=Ji[k]=!1;var gn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},I1=parseFloat,vv=parseInt,Lt="object"==typeof global&&global&&global.Object===Object&&global,Ls="object"==typeof self&&self&&self.Object===Object&&self,Di=Lt||Ls||Function("return this")(),Il=it&&!it.nodeType&&it,fa=Il&&kt&&!kt.nodeType&&kt,xo=fa&&fa.exports===Il,Cm=xo&&Lt.process,yr=function(){try{return fa&&fa.require&&fa.require("util").types||Cm&&Cm.binding&&Cm.binding("util")}catch(Mt){}}(),en=yr&&yr.isArrayBuffer,si=yr&&yr.isDate,sr=yr&&yr.isMap,lo=yr&&yr.isRegExp,pc=yr&&yr.isSet,Jr=yr&&yr.isTypedArray;function es(st,Mt,_t){switch(_t.length){case 0:return st.call(Mt);case 1:return st.call(Mt,_t[0]);case 2:return st.call(Mt,_t[0],_t[1]);case 3:return st.call(Mt,_t[0],_t[1],_t[2])}return st.apply(Mt,_t)}function Lr(st,Mt,_t,sn){for(var xn=-1,Ci=null==st?0:st.length;++xn-1}function gh(st,Mt,_t){for(var sn=-1,xn=null==st?0:st.length;++sn-1;);return _t}function P1(st,Mt){for(var _t=st.length;_t--&&Ya(Mt,st[_t],0)>-1;);return _t}function CP(st,Mt){for(var _t=st.length,sn=0;_t--;)st[_t]===Mt&&++sn;return sn}var AP=Ho({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),TP=Ho({"&":"&","<":"<",">":">",'"':""","'":"'"});function MP(st){return"\\"+gn[st]}function yh(st){return M1.test(st)}function wv(st){var Mt=-1,_t=Array(st.size);return st.forEach(function(sn,xn){_t[++Mt]=[xn,sn]}),_t}function F1(st,Mt){return function(_t){return st(Mt(_t))}}function ou(st,Mt){for(var _t=-1,sn=st.length,xn=0,Ci=[];++_t",""":'"',"'":"'"}),bh=function st(Mt){var u,_t=(Mt=null==Mt?Di:bh.defaults(Di.Object(),Mt,bh.pick(Di,ph))).Array,sn=Mt.Date,xn=Mt.Error,Ci=Mt.Function,Kr=Mt.Math,Bi=Mt.Object,Om=Mt.RegExp,Nm=Mt.String,ma=Mt.TypeError,or=_t.prototype,au=Bi.prototype,Kf=Mt["__core-js_shared__"],vr=Ci.prototype.toString,ji=au.hasOwnProperty,PP=0,wh=(u=/[^.]+$/.exec(Kf&&Kf.keys&&Kf.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ys=au.toString,B1=vr.call(Bi),Pm=Di._,ud=Om("^"+vr.call(ji).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bs=xo?Mt.Buffer:J,Ol=Mt.Symbol,dd=Mt.Uint8Array,xv=Bs?Bs.allocUnsafe:J,_a=F1(Bi.getPrototypeOf,Bi),Fm=Bi.create,Yf=au.propertyIsEnumerable,Ln=or.splice,j1=Ol?Ol.isConcatSpreadable:J,Eh=Ol?Ol.iterator:J,lu=Ol?Ol.toStringTag:J,Xf=function(){try{var u=Ac(Bi,"defineProperty");return u({},"",{}),u}catch(h){}}(),Cv=Mt.clearTimeout!==Di.clearTimeout&&Mt.clearTimeout,V1=sn&&sn.now!==Di.Date.now&&sn.now,U1=Mt.setTimeout!==Di.setTimeout&&Mt.setTimeout,Ft=Kr.ceil,fi=Kr.floor,ya=Bi.getOwnPropertySymbols,ts=Bs?Bs.isBuffer:J,Lm=Mt.isFinite,Sh=or.join,Qa=F1(Bi.keys,Bi),Br=Kr.max,us=Kr.min,FP=sn.now,z1=Mt.parseInt,xh=Kr.random,Qf=or.reverse,bs=Ac(Mt,"DataView"),co=Ac(Mt,"Map"),Zf=Ac(Mt,"Promise"),va=Ac(Mt,"Set"),Ao=Ac(Mt,"WeakMap"),Ch=Ac(Bi,"create"),Ah=Ao&&new Ao,hd={},H1=bu(bs),km=bu(co),Bm=bu(Zf),Av=bu(va),jm=bu(Ao),Jf=Ol?Ol.prototype:J,fd=Jf?Jf.valueOf:J,Th=Jf?Jf.toString:J;function Se(u){if(Er(u)&&!Mn(u)&&!(u instanceof oi)){if(u instanceof To)return u;if(ji.call(u,"__wrapped__"))return Sp(u)}return new To(u)}var cu=function(){function u(){}return function(h){if(!wr(h))return{};if(Fm)return Fm(h);u.prototype=h;var m=new u;return u.prototype=J,m}}();function Mh(){}function To(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=J}function oi(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function uo(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function js(u,h,m,N,ae,xe){var ze,Ke=1&h,lt=2&h,Ot=4&h;if(m&&(ze=ae?m(u,N,ae,xe):m(u)),ze!==J)return ze;if(!wr(u))return u;var Nt=Mn(u);if(Nt){if(ze=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&ji.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!Ke)return Qs(u,ze)}else{var Bt=Us(u),Jt=Bt==Ue||Bt==qe;if(ll(u))return hp(u,Ke);if(Bt==be||Bt==Ze||Jt&&!ae){if(ze=lt||Jt?{}:Qv(u),!Ke)return lt?function(u,h){return xa(u,Kv(u),h)}(u,function(u,h){return u&&xa(h,Js(h),u)}(ze,u)):function(u,h){return xa(u,a_(u),h)}(u,tC(ze,u))}else{if(!Ji[Bt])return ae?u:{};ze=function(u,h,m){var N=u.constructor;switch(h){case Xe:return mu(u);case je:case Le:return new N(+u);case yt:return function(u,h){var m=h?mu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case It:case Tn:case Pn:case Gn:case yi:case hi:case Hr:case Ns:case cs:return n_(u,m);case Be:return new N;case z:case fe:return new N(u);case wt:return function(u){var h=new u.constructor(u.source,zn.exec(u));return h.lastIndex=u.lastIndex,h}(u);case pt:return new N;case B:return function(u){return fd?Bi(fd.call(u)):{}}(u)}}(u,Bt,Ke)}}xe||(xe=new wa);var _n=xe.get(u);if(_n)return _n;xe.set(u,ze),wA(u)?u.forEach(function(kn){ze.add(js(kn,h,m,kn,u,xe))}):_A(u)&&u.forEach(function(kn,ci){ze.set(ci,js(kn,h,m,ci,u,xe))});var li=Nt?J:(Ot?lt?s_:Bl:lt?Js:Cs)(u);return ks(li||u,function(kn,ci){li&&(kn=u[ci=kn]),Ja(ze,ci,js(kn,h,m,ci,u,xe))}),ze}function sp(u,h,m){var N=m.length;if(null==u)return!N;for(u=Bi(u);N--;){var ae=m[N],ze=u[ae];if(ze===J&&!(ae in u)||!(0,h[ae])(ze))return!1}return!0}function Rh(u,h,m){if("function"!=typeof u)throw new ma(Ae);return Bh(function(){u.apply(J,m)},h)}function yc(u,h,m,N){var ae=-1,xe=Rl,ze=!0,Ke=u.length,lt=[],Ot=h.length;if(!Ke)return lt;m&&(h=ki(h,$o(m))),N?(xe=gh,ze=!1):h.length>=200&&(xe=_h,ze=!1,h=new ba(h));e:for(;++ae-1},Nl.prototype.set=function(u,h){var m=this.__data__,N=gd(m,u);return N<0?(++this.size,m.push([u,h])):m[N][1]=h,this},Za.prototype.clear=function(){this.size=0,this.__data__={hash:new uo,map:new(co||Nl),string:new uo}},Za.prototype.delete=function(u){var h=Vs(this,u).delete(u);return this.size-=h?1:0,h},Za.prototype.get=function(u){return Vs(this,u).get(u)},Za.prototype.has=function(u){return Vs(this,u).has(u)},Za.prototype.set=function(u,h){var m=Vs(this,u),N=m.size;return m.set(u,h),this.size+=m.size==N?0:1,this},ba.prototype.add=ba.prototype.push=function(u){return this.__data__.set(u,q),this},ba.prototype.has=function(u){return this.__data__.has(u)},wa.prototype.clear=function(){this.__data__=new Nl,this.size=0},wa.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},wa.prototype.get=function(u){return this.__data__.get(u)},wa.prototype.has=function(u){return this.__data__.has(u)},wa.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Nl){var N=m.__data__;if(!co||N.length<199)return N.push([u,h]),this.size=++m.size,this;m=this.__data__=new Za(N)}return m.set(u,h),this.size=m.size,this};var vc=il(tl),qm=il(op,!0);function Iv(u,h){var m=!0;return vc(u,function(N,ae,xe){return m=!!h(N,ae,xe)}),m}function Oh(u,h,m){for(var N=-1,ae=u.length;++N0&&m(Ke)?h>1?ws(Ke,h-1,m,N,ae):kr(ae,Ke):N||(ae[ae.length]=Ke)}return ae}var md=jv(),_d=jv(!0);function tl(u,h){return u&&md(u,h,Cs)}function op(u,h){return u&&_d(u,h,Cs)}function Nh(u,h){return pa(h,function(m){return ea(u[m])})}function Wo(u,h){for(var m=0,N=(h=Sc(h,u)).length;null!=u&&mh}function yd(u,h){return null!=u&&ji.call(u,h)}function vd(u,h){return null!=u&&h in Bi(u)}function du(u,h,m){for(var N=m?gh:Rl,ae=u[0].length,xe=u.length,ze=xe,Ke=_t(xe),lt=1/0,Ot=[];ze--;){var Nt=u[ze];ze&&h&&(Nt=ki(Nt,$o(h))),lt=us(Nt.length,lt),Ke[ze]=!m&&(h||ae>=120&&Nt.length>=120)?new ba(ze&&Nt):J}Nt=u[0];var Bt=-1,Jt=Ke[0];e:for(;++Bt=Ke?lt:lt*("desc"==m[N]?-1:1)}return u.index-h.index}(xe,ze,m)});_t--;)st[_t]=st[_t].value;return st}(oC(u,function(xe,ze,Ke){return{criteria:ki(h,function(Ot){return Ot(xe)}),index:++N,value:xe}}))}function Fv(u,h,m){for(var N=-1,ae=h.length,xe={};++N-1;)Ke!==u&&Ln.call(Ke,lt,1),Ln.call(u,lt,1);return u}function Fh(u,h){for(var m=u?h.length:0,N=m-1;m--;){var ae=h[m];if(m==N||ae!==xe){var xe=ae;Io(ae)?Ln.call(u,ae,1):fu(u,ae)}}return u}function Pl(u,h){return u+fi(xh()*(h-u+1))}function lp(u,h){var m="";if(!u||h<1||h>Te)return m;do{h%2&&(m+=u),(h=fi(h/2))&&(u+=u)}while(h);return m}function ai(u,h){return Ep(EC(u,h,eo),u+"")}function lC(u){return Hm(kd(u))}function GP(u,h){var m=kd(u);return Md(m,uu(h,0,m.length))}function cp(u,h,m,N){if(!wr(u))return u;for(var ae=-1,xe=(h=Sc(h,u)).length,ze=xe-1,Ke=u;null!=Ke&&++aeae?0:ae+h),(m=m>ae?ae:m)<0&&(m+=ae),ae=h>m?0:m-h>>>0,h>>>=0;for(var xe=_t(ae);++N>>1,ze=u[xe];null!==ze&&!ta(ze)&&(m?ze<=h:ze=200){var Ot=h?null:r_(u);if(Ot)return Dm(Ot);ze=!1,ae=_h,lt=new ba}else lt=h?[]:Ke;e:for(;++N=N?u:Ss(u,h,m)}var dC=Cv||function(u){return Di.clearTimeout(u)};function hp(u,h){if(h)return u.slice();var m=u.length,N=xv?xv(m):new u.constructor(m);return u.copy(N),N}function mu(u){var h=new u.constructor(u.byteLength);return new dd(h).set(new dd(u)),h}function n_(u,h){var m=h?mu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function xc(u,h){if(u!==h){var m=u!==J,N=null===u,ae=u==u,xe=ta(u),ze=h!==J,Ke=null===h,lt=h==h,Ot=ta(h);if(!Ke&&!Ot&&!xe&&u>h||xe&&ze&<&&!Ke&&!Ot||N&&ze&<||!m&<||!ae)return 1;if(!N&&!xe&&!Ot&&u1?m[ae-1]:J,ze=ae>2?m[2]:J;for(xe=u.length>3&&"function"==typeof xe?(ae--,xe):J,ze&&zs(m[0],m[1],ze)&&(xe=ae<3?J:xe,ae=1),h=Bi(h);++N-1?ae[xe?h[ze]:ze]:J}}function yu(u){return rl(function(h){var m=h.length,N=m,ae=To.prototype.thru;for(u&&h.reverse();N--;){var xe=h[N];if("function"!=typeof xe)throw new ma(Ae);if(ae&&!ze&&"wrapper"==vp(xe))var ze=new To([],!0)}for(N=ze?N:m;++N1&&vi.reverse(),Nt&<Ke))return!1;var Ot=xe.get(u),Nt=xe.get(h);if(Ot&&Nt)return Ot==h&&Nt==u;var Bt=-1,Jt=!0,_n=2&m?new ba:J;for(xe.set(u,h),xe.set(h,u);++Bt-1&&u%1==0&&u1?"& ":"")+h[N],h=h.join(m>2?", ":" "),u.replace(xt,"{\n/* [wrapped with "+h+"] */\n")}(N,function(u,h){return ks(nt,function(m){var N="_."+m[0];h&m[1]&&!Rl(u,N)&&u.push(N)}),u.sort()}(function(u){var h=u.match(Tt);return h?h[1].split($t):[]}(N),m)))}function f_(u){var h=0,m=0;return function(){var N=FP(),ae=16-(N-m);if(m=N,ae>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(J,arguments)}}function Md(u,h){var m=-1,N=u.length,ae=N-1;for(h=h===J?N:h;++m1?u[h-1]:J;return m="function"==typeof m?(u.pop(),m):J,qC(u,m)});function S_(u){var h=Se(u);return h.__chain__=!0,h}function Id(u,h){return h(u)}var x_=rl(function(u){var h=u.length,m=h?u[0]:0,N=this.__wrapped__,ae=function(xe){return $m(xe,u)};return!(h>1||this.__actions__.length)&&N instanceof oi&&Io(m)?((N=N.slice(m,+m+(h?1:0))).__actions__.push({func:Id,args:[ae],thisArg:J}),new To(N,this.__chain__).thru(function(xe){return h&&!xe.length&&xe.push(J),xe})):this.thru(ae)}),XC=Yr(function(u,h,m){ji.call(u,m)?++u[m]:el(u,m,1)}),JC=Uv(g_),eA=Uv(m_);function M_(u,h){return(Mn(u)?ks:vc)(u,On(h,3))}function Ap(u,h){return(Mn(u)?sd:qm)(u,On(h,3))}var nA=Yr(function(u,h,m){ji.call(u,m)?u[m].push(h):el(u,m,[h])}),vb=ai(function(u,h,m){var N=-1,ae="function"==typeof h,xe=ho(u)?_t(u.length):[];return vc(u,function(ze){xe[++N]=ae?es(h,ze,m):Sa(ze,h,m)}),xe}),bb=Yr(function(u,h,m){el(u,m,h)});function ol(u,h){return(Mn(u)?ki:oC)(u,On(h,3))}var Eb=Yr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),Mp=ai(function(u,h){if(null==u)return[];var m=h.length;return m>1&&zs(u,h[0],h[1])?h=[]:m>2&&zs(h[0],h[1],h[2])&&(h=[h[0]]),Ph(u,ws(h,1),[])}),wu=V1||function(){return Di.Date.now()};function Dp(u,h,m){return h=m?J:h,kl(u,H,J,J,J,J,h=u&&null==h?u.length:h)}function I_(u,h){var m;if("function"!=typeof h)throw new ma(Ae);return u=Yn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=J),m}}var Hh=ai(function(u,h,m){var N=1;if(m.length){var ae=ou(m,Td(Hh));N|=j}return kl(u,N,h,m,ae)}),Od=ai(function(u,h,m){var N=3;if(m.length){var ae=ou(m,Td(Od));N|=j}return kl(h,N,u,m,ae)});function Db(u,h,m){var N,ae,xe,ze,Ke,lt,Ot=0,Nt=!1,Bt=!1,Jt=!0;if("function"!=typeof u)throw new ma(Ae);function _n(Ri){var dl=N,Ic=ae;return N=ae=J,Ot=Ri,ze=u.apply(Ic,dl)}function Fn(Ri){return Ot=Ri,Ke=Bh(ci,h),Nt?_n(Ri):ze}function kn(Ri){var dl=Ri-lt;return lt===J||dl>=h||dl<0||Bt&&Ri-Ot>=xe}function ci(){var Ri=wu();if(kn(Ri))return vi(Ri);Ke=Bh(ci,function(Ri){var uT=h-(Ri-lt);return Bt?us(uT,xe-(Ri-Ot)):uT}(Ri))}function vi(Ri){return Ke=J,Jt&&N?_n(Ri):(N=ae=J,ze)}function na(){var Ri=wu(),dl=kn(Ri);if(N=arguments,ae=this,lt=Ri,dl){if(Ke===J)return Fn(lt);if(Bt)return dC(Ke),Ke=Bh(ci,h),_n(lt)}return Ke===J&&(Ke=Bh(ci,h)),ze}return h=fo(h)||0,wr(m)&&(Nt=!!m.leading,xe=(Bt="maxWait"in m)?Br(fo(m.maxWait)||0,h):xe,Jt="trailing"in m?!!m.trailing:Jt),na.cancel=function(){Ke!==J&&dC(Ke),Ot=0,N=lt=ae=Ke=J},na.flush=function(){return Ke===J?ze:vi(wu())},na}var oA=ai(function(u,h){return Rh(u,1,h)}),Ib=ai(function(u,h,m){return Rh(u,fo(h)||0,m)});function Gh(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new ma(Ae);var m=function(){var N=arguments,ae=h?h.apply(this,N):N[0],xe=m.cache;if(xe.has(ae))return xe.get(ae);var ze=u.apply(this,N);return m.cache=xe.set(ae,ze)||xe,ze};return m.cache=new(Gh.Cache||Za),m}function N_(u){if("function"!=typeof u)throw new ma(Ae);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}Gh.Cache=Za;var aA=uC(function(u,h){var m=(h=1==h.length&&Mn(h[0])?ki(h[0],$o(On())):ki(ws(h,1),$o(On()))).length;return ai(function(N){for(var ae=-1,xe=us(N.length,m);++ae=h}),al=nC(function(){return arguments}())?nC:function(u){return Er(u)&&ji.call(u,"callee")&&!Yf.call(u,"callee")},Mn=_t.isArray,Lb=en?$o(en):function(u){return Er(u)&&Es(u)==Xe};function ho(u){return null!=u&&F_(u.length)&&!ea(u)}function br(u){return Er(u)&&ho(u)}var ll=ts||ry,kb=si?$o(si):function(u){return Er(u)&&Es(u)==Le};function Aa(u){if(!Er(u))return!1;var h=Es(u);return h==Re||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!Np(u)}function ea(u){if(!wr(u))return!1;var h=Es(u);return h==Ue||h==qe||"[object AsyncFunction]"==h||"[object Proxy]"==h}function Op(u){return"number"==typeof u&&u==Yn(u)}function F_(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Te}function wr(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Er(u){return null!=u&&"object"==typeof u}var _A=sr?$o(sr):function(u){return Er(u)&&Us(u)==Be};function bA(u){return"number"==typeof u||Er(u)&&Es(u)==z}function Np(u){if(!Er(u)||Es(u)!=be)return!1;var h=_a(u);if(null===h)return!0;var m=ji.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&vr.call(m)==B1}var Ub=lo?$o(lo):function(u){return Er(u)&&Es(u)==wt},wA=pc?$o(pc):function(u){return Er(u)&&Us(u)==pt};function k_(u){return"string"==typeof u||!Mn(u)&&Er(u)&&Es(u)==fe}function ta(u){return"symbol"==typeof u||Er(u)&&Es(u)==B}var $h=Jr?$o(Jr):function(u){return Er(u)&&F_(u.length)&&!!wn[Es(u)]},Tc=mp(Pv),B_=mp(function(u,h){return u<=h});function zb(u){if(!u)return[];if(ho(u))return k_(u)?Xa(u):Qs(u);if(Eh&&u[Eh])return function(st){for(var Mt,_t=[];!(Mt=st.next()).done;)_t.push(Mt.value);return _t}(u[Eh]());var h=Us(u);return(h==Be?wv:h==pt?Dm:kd)(u)}function cl(u){return u?(u=fo(u))===se||u===-se?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Yn(u){var h=cl(u),m=h%1;return h==h?m?h-m:h:0}function j_(u){return u?uu(Yn(u),0,ye):0}function fo(u){if("number"==typeof u)return u;if(ta(u))return NaN;if(wr(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=wr(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=bv(u);var m=Qi.test(u);return m||qn.test(u)?vv(u.slice(2),m?2:8):bn.test(u)?NaN:+u}function Hb(u){return xa(u,Js(u))}function Ii(u){return null==u?"":Do(u)}var EA=Fl(function(u,h){if(wp(h)||ho(h))xa(h,Cs(h),u);else for(var m in h)ji.call(h,m)&&Ja(u,m,h[m])}),SA=Fl(function(u,h){xa(h,Js(h),u)}),Nd=Fl(function(u,h,m,N){xa(h,Js(h),u,N)}),xA=Fl(function(u,h,m,N){xa(h,Cs(h),u,N)}),Gb=rl($m),AA=ai(function(u,h){u=Bi(u);var m=-1,N=h.length,ae=N>2?h[2]:J;for(ae&&zs(h[0],h[1],ae)&&(N=1);++m1),xe}),xa(u,s_(u),m),N&&(m=js(m,7,_p));for(var ae=h.length;ae--;)fu(m,h[ae]);return m}),RA=rl(function(u,h){return null==u?{}:function(u,h){return Fv(u,h,function(m,N){return Pp(u,N)})}(u,h)});function Qb(u,h){if(null==u)return{};var m=ki(s_(u),function(N){return[N]});return h=On(h),Fv(u,m,function(N,ae){return h(N,ae[0])})}var OA=vu(Cs),Jb=vu(Js);function kd(u){return null==u?[]:Mm(u,Cs(u))}var kA=Ll(function(u,h,m){return h=h.toLowerCase(),u+(m?H_(h):h)});function H_(u){return kp(Ii(u).toLowerCase())}function G_(u){return(u=Ii(u))&&u.replace(da,AP).replace(xm,"")}var jA=Ll(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),VA=Ll(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),dF=fp("toLowerCase"),$A=Ll(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),q_=Ll(function(u,h,m){return u+(m?" ":"")+kp(h)}),sw=Ll(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),kp=fp("toUpperCase");function Q_(u,h,m){return u=Ii(u),(h=m?J:h)===J?function(st){return Dl.test(st)}(u)?function(st){return st.match(gv)||[]}(u):function(st){return st.match(jn)||[]}(u):u.match(h)||[]}var Z_=ai(function(u,h){try{return es(u,J,h)}catch(m){return Aa(m)?m:new xn(m)}}),ow=rl(function(u,h){return ks(h,function(m){m=Jn(m),el(u,m,Hh(u[m],u))}),u});function J_(u){return function(){return u}}var fF=yu(),Bd=yu(!0);function eo(u){return u}function Eu(u){return sC("function"==typeof u?u:js(u,1))}var ey=ai(function(u,h){return function(m){return Sa(m,u,h)}}),aw=ai(function(u,h){return function(m){return Sa(u,m,h)}});function ty(u,h,m){var N=Cs(h),ae=Nh(h,N);null==m&&(!wr(h)||!ae.length&&N.length)&&(m=h,h=u,u=this,ae=Nh(h,Cs(h)));var xe=!(wr(m)&&"chain"in m&&!m.chain),ze=ea(u);return ks(ae,function(Ke){var lt=h[Ke];u[Ke]=lt,ze&&(u.prototype[Ke]=function(){var Ot=this.__chain__;if(xe||Ot){var Nt=u(this.__wrapped__),Bt=Nt.__actions__=Qs(this.__actions__);return Bt.push({func:lt,args:arguments,thisArg:u}),Nt.__chain__=Ot,Nt}return lt.apply(u,kr([this.value()],arguments))})}),u}function ny(){}var ZA=pp(ki),JA=pp(Zn),cw=pp(Co);function Su(u){return Xo(u)?Am(Jn(u)):function(u){return function(h){return Wo(h,u)}}(u)}var eT=Hv(),tT=Hv(!0);function Dc(){return[]}function ry(){return!1}var Hn=i_(function(u,h){return u+h},0),sy=Ad("ceil"),gF=i_(function(u,h){return u/h},1),Ul=Ad("floor"),fw=i_(function(u,h){return u*h},1),pw=Ad("round"),gw=i_(function(u,h){return u-h},0);return Se.after=function(u,h){if("function"!=typeof h)throw new ma(Ae);return u=Yn(u),function(){if(--u<1)return h.apply(this,arguments)}},Se.ary=Dp,Se.assign=EA,Se.assignIn=SA,Se.assignInWith=Nd,Se.assignWith=xA,Se.at=Gb,Se.before=I_,Se.bind=Hh,Se.bindAll=ow,Se.bindKey=Od,Se.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Mn(u)?u:[u]},Se.chain=S_,Se.chunk=function(u,h,m){h=(m?zs(u,h,m):h===J)?1:Br(Yn(h),0);var N=null==u?0:u.length;if(!N||h<1)return[];for(var ae=0,xe=0,ze=_t(Ft(N/h));aeae?0:ae+m),(N=N===J||N>ae?ae:Yn(N))<0&&(N+=ae),N=m>N?0:j_(N);m>>0)?(u=Ii(u))&&("string"==typeof h||null!=h&&!Ub(h))&&!(h=Do(h))&&yh(u)?nl(Xa(u),0,m):u.split(h,m):[]},Se.spread=function(u,h){if("function"!=typeof u)throw new ma(Ae);return h=null==h?0:Br(Yn(h),0),ai(function(m){var N=m[h],ae=nl(m,0,h);return N&&kr(ae,N),es(u,this,ae)})},Se.tail=function(u){var h=null==u?0:u.length;return h?Ss(u,1,h):[]},Se.take=function(u,h,m){return u&&u.length?Ss(u,0,(h=m||h===J?1:Yn(h))<0?0:h):[]},Se.takeRight=function(u,h,m){var N=null==u?0:u.length;return N?Ss(u,(h=N-(h=m||h===J?1:Yn(h)))<0?0:h,N):[]},Se.takeRightWhile=function(u,h){return u&&u.length?pu(u,On(h,3),!1,!0):[]},Se.takeWhile=function(u,h){return u&&u.length?pu(u,On(h,3)):[]},Se.tap=function(u,h){return h(u),u},Se.throttle=function(u,h,m){var N=!0,ae=!0;if("function"!=typeof u)throw new ma(Ae);return wr(m)&&(N="leading"in m?!!m.leading:N,ae="trailing"in m?!!m.trailing:ae),Db(u,h,{leading:N,maxWait:h,trailing:ae})},Se.thru=Id,Se.toArray=zb,Se.toPairs=OA,Se.toPairsIn=Jb,Se.toPath=function(u){return Mn(u)?ki(u,Jn):ta(u)?[u]:Qs(tb(Ii(u)))},Se.toPlainObject=Hb,Se.transform=function(u,h,m){var N=Mn(u),ae=N||ll(u)||$h(u);if(h=On(h,4),null==m){var xe=u&&u.constructor;m=ae?N?new xe:[]:wr(u)&&ea(xe)?cu(_a(u)):{}}return(ae?ks:tl)(u,function(ze,Ke,lt){return h(m,ze,Ke,lt)}),m},Se.unary=function(u){return Dp(u,1)},Se.union=db,Se.unionBy=GC,Se.unionWith=$C,Se.uniq=function(u){return u&&u.length?wc(u):[]},Se.uniqBy=function(u,h){return u&&u.length?wc(u,On(h,2)):[]},Se.uniqWith=function(u,h){return h="function"==typeof h?h:J,u&&u.length?wc(u,J,h):[]},Se.unset=function(u,h){return null==u||fu(u,h)},Se.unzip=hb,Se.unzipWith=qC,Se.update=function(u,h,m){return null==u?u:up(u,h,t_(m))},Se.updateWith=function(u,h,m,N){return N="function"==typeof N?N:J,null==u?u:up(u,h,t_(m),N)},Se.values=kd,Se.valuesIn=function(u){return null==u?[]:Mm(u,Js(u))},Se.without=fb,Se.words=Q_,Se.wrap=function(u,h){return Ip(t_(h),u)},Se.xor=eF,Se.xorBy=Ro,Se.xorWith=w_,Se.zip=E_,Se.zipObject=function(u,h){return dp(u||[],h||[],Ja)},Se.zipObjectDeep=function(u,h){return dp(u||[],h||[],cp)},Se.zipWith=zh,Se.entries=OA,Se.entriesIn=Jb,Se.extend=SA,Se.extendWith=Nd,ty(Se,Se),Se.add=Hn,Se.attempt=Z_,Se.camelCase=kA,Se.capitalize=H_,Se.ceil=sy,Se.clamp=function(u,h,m){return m===J&&(m=h,h=J),m!==J&&(m=(m=fo(m))==m?m:0),h!==J&&(h=(h=fo(h))==h?h:0),uu(fo(u),h,m)},Se.clone=function(u){return js(u,4)},Se.cloneDeep=function(u){return js(u,5)},Se.cloneDeepWith=function(u,h){return js(u,5,h="function"==typeof h?h:J)},Se.cloneWith=function(u,h){return js(u,4,h="function"==typeof h?h:J)},Se.conformsTo=function(u,h){return null==h||sp(u,h,Cs(h))},Se.deburr=G_,Se.defaultTo=function(u,h){return null==u||u!=u?h:u},Se.divide=gF,Se.endsWith=function(u,h,m){u=Ii(u),h=Do(h);var N=u.length,ae=m=m===J?N:uu(Yn(m),0,N);return(m-=h.length)>=0&&u.slice(m,ae)==h},Se.eq=Cn,Se.escape=function(u){return(u=Ii(u))&&Qt.test(u)?u.replace(ua,TP):u},Se.escapeRegExp=function(u){return(u=Ii(u))&&ct.test(u)?u.replace(ke,"\\$&"):u},Se.every=function(u,h,m){var N=Mn(u)?Zn:Iv;return m&&zs(u,h,m)&&(h=J),N(u,On(h,3))},Se.find=JC,Se.findIndex=g_,Se.findKey=function(u,h){return mh(u,On(h,3),tl)},Se.findLast=eA,Se.findLastIndex=m_,Se.findLastKey=function(u,h){return mh(u,On(h,3),op)},Se.floor=Ul,Se.forEach=M_,Se.forEachRight=Ap,Se.forIn=function(u,h){return null==u?u:md(u,On(h,3),Js)},Se.forInRight=function(u,h){return null==u?u:_d(u,On(h,3),Js)},Se.forOwn=function(u,h){return u&&tl(u,On(h,3))},Se.forOwnRight=function(u,h){return u&&op(u,On(h,3))},Se.get=Kh,Se.gt=on,Se.gte=Fb,Se.has=function(u,h){return null!=u&&Xv(u,h,yd)},Se.hasIn=Pp,Se.head=ib,Se.identity=eo,Se.includes=function(u,h,m,N){u=ho(u)?u:kd(u),m=m&&!N?Yn(m):0;var ae=u.length;return m<0&&(m=Br(ae+m,0)),k_(u)?m<=ae&&u.indexOf(h,m)>-1:!!ae&&Ya(u,h,m)>-1},Se.indexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=null==m?0:Yn(m);return ae<0&&(ae=Br(N+ae,0)),Ya(u,h,ae)},Se.inRange=function(u,h,m){return h=cl(h),m===J?(m=h,h=0):m=cl(m),function(u,h,m){return u>=us(h,m)&&u=-Te&&u<=Te},Se.isSet=wA,Se.isString=k_,Se.isSymbol=ta,Se.isTypedArray=$h,Se.isUndefined=function(u){return u===J},Se.isWeakMap=function(u){return Er(u)&&Us(u)==k},Se.isWeakSet=function(u){return Er(u)&&"[object WeakSet]"==Es(u)},Se.join=function(u,h){return null==u?"":Sh.call(u,h)},Se.kebabCase=jA,Se.last=Qo,Se.lastIndexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=N;return m!==J&&(ae=(ae=Yn(m))<0?Br(N+ae,0):us(ae,N-1)),h==h?function(st,Mt,_t){for(var sn=_t+1;sn--;)if(st[sn]===Mt)return sn;return sn}(u,h,ae):ad(u,gc,ae,!0)},Se.lowerCase=VA,Se.lowerFirst=dF,Se.lt=Tc,Se.lte=B_,Se.max=function(u){return u&&u.length?Oh(u,eo,Ea):J},Se.maxBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Ea):J},Se.mean=function(u){return vs(u,eo)},Se.meanBy=function(u,h){return vs(u,On(h,2))},Se.min=function(u){return u&&u.length?Oh(u,eo,Pv):J},Se.minBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Pv):J},Se.stubArray=Dc,Se.stubFalse=ry,Se.stubObject=function(){return{}},Se.stubString=function(){return""},Se.stubTrue=function(){return!0},Se.multiply=fw,Se.nth=function(u,h){return u&&u.length?hu(u,Yn(h)):J},Se.noConflict=function(){return Di._===this&&(Di._=Pm),this},Se.noop=ny,Se.now=wu,Se.pad=function(u,h,m){u=Ii(u);var N=(h=Yn(h))?vh(u):0;if(!h||N>=h)return u;var ae=(h-N)/2;return gp(fi(ae),m)+u+gp(Ft(ae),m)},Se.padEnd=function(u,h,m){u=Ii(u);var N=(h=Yn(h))?vh(u):0;return h&&Nh){var N=u;u=h,h=N}if(m||u%1||h%1){var ae=xh();return us(u+ae*(h-u+I1("1e-"+((ae+"").length-1))),h)}return Pl(u,h)},Se.reduce=function(u,h,m){var N=Mn(u)?su:Go,ae=arguments.length<3;return N(u,On(h,4),m,ae,vc)},Se.reduceRight=function(u,h,m){var N=Mn(u)?od:Go,ae=arguments.length<3;return N(u,On(h,4),m,ae,qm)},Se.repeat=function(u,h,m){return h=(m?zs(u,h,m):h===J)?1:Yn(h),lp(Ii(u),h)},Se.replace=function(){var u=arguments,h=Ii(u[0]);return u.length<3?h:h.replace(u[1],u[2])},Se.result=function(u,h,m){var N=-1,ae=(h=Sc(h,u)).length;for(ae||(ae=1,u=J);++NTe)return[];var m=ye,N=us(u,ye);h=On(h),u-=ye;for(var ae=cd(N,h);++m=xe)return u;var Ke=m-vh(N);if(Ke<1)return N;var lt=ze?nl(ze,0,Ke).join(""):u.slice(0,Ke);if(ae===J)return lt+N;if(ze&&(Ke+=lt.length-Ke),Ub(ae)){if(u.slice(Ke).search(ae)){var Ot,Nt=lt;for(ae.global||(ae=Om(ae.source,Ii(zn.exec(ae))+"g")),ae.lastIndex=0;Ot=ae.exec(Nt);)var Bt=Ot.index;lt=lt.slice(0,Bt===J?Ke:Bt)}}else if(u.indexOf(Do(ae),Ke)!=Ke){var Jt=lt.lastIndexOf(ae);Jt>-1&&(lt=lt.slice(0,Jt))}return lt+N},Se.unescape=function(u){return(u=Ii(u))&&ms.test(u)?u.replace(Al,Rm):u},Se.uniqueId=function(u){var h=++PP;return Ii(u)+h},Se.upperCase=sw,Se.upperFirst=kp,Se.each=M_,Se.eachRight=Ap,Se.first=ib,ty(Se,function(){var u={};return tl(Se,function(h,m){ji.call(Se.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),Se.VERSION="4.17.21",ks(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){Se[u].placeholder=Se}),ks(["drop","take"],function(u,h){oi.prototype[u]=function(m){m=m===J?1:Br(Yn(m),0);var N=this.__filtered__&&!h?new oi(this):this.clone();return N.__filtered__?N.__takeCount__=us(m,N.__takeCount__):N.__views__.push({size:us(m,ye),type:u+(N.__dir__<0?"Right":"")}),N},oi.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),ks(["filter","map","takeWhile"],function(u,h){var m=h+1,N=1==m||3==m;oi.prototype[u]=function(ae){var xe=this.clone();return xe.__iteratees__.push({iteratee:On(ae,3),type:m}),xe.__filtered__=xe.__filtered__||N,xe}}),ks(["head","last"],function(u,h){var m="take"+(h?"Right":"");oi.prototype[u]=function(){return this[m](1).value()[0]}}),ks(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");oi.prototype[u]=function(){return this.__filtered__?new oi(this):this[m](1)}}),oi.prototype.compact=function(){return this.filter(eo)},oi.prototype.find=function(u){return this.filter(u).head()},oi.prototype.findLast=function(u){return this.reverse().find(u)},oi.prototype.invokeMap=ai(function(u,h){return"function"==typeof u?new oi(this):this.map(function(m){return Sa(m,u,h)})}),oi.prototype.reject=function(u){return this.filter(N_(On(u)))},oi.prototype.slice=function(u,h){u=Yn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new oi(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==J&&(m=(h=Yn(h))<0?m.dropRight(-h):m.take(h-u)),m)},oi.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},oi.prototype.toArray=function(){return this.take(ye)},tl(oi.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),N=/^(?:head|last)$/.test(h),ae=Se[N?"take"+("last"==h?"Right":""):h],xe=N||/^find/.test(h);!ae||(Se.prototype[h]=function(){var ze=this.__wrapped__,Ke=N?[1]:arguments,lt=ze instanceof oi,Ot=Ke[0],Nt=lt||Mn(ze),Bt=function(ci){var vi=ae.apply(Se,kr([ci],Ke));return N&&Jt?vi[0]:vi};Nt&&m&&"function"==typeof Ot&&1!=Ot.length&&(lt=Nt=!1);var Jt=this.__chain__,_n=!!this.__actions__.length,Fn=xe&&!Jt,li=lt&&!_n;if(!xe&&Nt){ze=li?ze:new oi(this);var kn=u.apply(ze,Ke);return kn.__actions__.push({func:Id,args:[Bt],thisArg:J}),new To(kn,Jt)}return Fn&&li?u.apply(this,Ke):(kn=this.thru(Bt),Fn?N?kn.value()[0]:kn.value():kn)})}),ks(["pop","push","shift","sort","splice","unshift"],function(u){var h=or[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",N=/^(?:pop|shift)$/.test(u);Se.prototype[u]=function(){var ae=arguments;if(N&&!this.__chain__){var xe=this.value();return h.apply(Mn(xe)?xe:[],ae)}return this[m](function(ze){return h.apply(Mn(ze)?ze:[],ae)})}}),tl(oi.prototype,function(u,h){var m=Se[h];if(m){var N=m.name+"";ji.call(hd,N)||(hd[N]=[]),hd[N].push({name:h,func:m})}}),hd[Cc(J,2).name]=[{name:"wrapper",func:J}],oi.prototype.clone=function(){var u=new oi(this.__wrapped__);return u.__actions__=Qs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Qs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Qs(this.__views__),u},oi.prototype.reverse=function(){if(this.__filtered__){var u=new oi(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},oi.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Mn(u),N=h<0,ae=m?u.length:0,xe=function(u,h,m){for(var N=-1,ae=m.length;++N=this.__values__.length;return{done:u,value:u?J:this.__values__[this.__index__++]}},Se.prototype.plant=function(u){for(var h,m=this;m instanceof Mh;){var N=Sp(m);N.__index__=0,N.__values__=J,h?ae.__wrapped__=N:h=N;var ae=N;m=m.__wrapped__}return ae.__wrapped__=u,h},Se.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof oi){var h=u;return this.__actions__.length&&(h=new oi(this)),(h=h.reverse()).__actions__.push({func:Id,args:[b_],thisArg:J}),new To(h,this.__chain__)}return this.thru(b_)},Se.prototype.toJSON=Se.prototype.valueOf=Se.prototype.value=function(){return cC(this.__wrapped__,this.__actions__)},Se.prototype.first=Se.prototype.head,Eh&&(Se.prototype[Eh]=function(){return this}),Se}();Di._=bh,(gt=function(){return bh}.call(it,tt,it,kt))!==J&&(kt.exports=gt)}.call(this)},478:function(kt){kt.exports=function(){"use strict";function it(rt,ot){for(var ut=0;utrt.length)&&(ot=rt.length);for(var ut=0,pe=new Array(ot);ut=rt.length?{done:!0}:{done:!1,value:rt[pe++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var dt={exports:{}};function K(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}dt.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:K,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,q=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,re={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(ot){return re[ot]};var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function O(rt){return rt.replace(S,function(ot,ut){return"colon"===(ut=ut.toLowerCase())?":":"#"===ut.charAt(0)?"x"===ut.charAt(1)?String.fromCharCode(parseInt(ut.substring(2),16)):String.fromCharCode(+ut.substring(1)):""})}var T=/(^|[^\[])\^/g;var y=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var j={},I=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,Y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(rt,ot){j[" "+rt]||(j[" "+rt]=I.test(rt)?rt+"/":U(rt,"/",!0));var ut=-1===(rt=j[" "+rt]).indexOf(":");return"//"===ot.substring(0,2)?ut?ot:rt.replace(H,"$1")+ot:"/"===ot.charAt(0)?ut?ot:rt.replace(Y,"$1")+ot:rt+ot}function U(rt,ot,ut){var pe=rt.length;if(0===pe)return"";for(var ve=0;ve1;)1&ot&&(ut+=rt),ot>>=1,rt+=rt;return ut+rt},Te=dt.exports.defaults,me=U,te=function(rt,ot){var pe=rt.replace(/\|/g,function(ke,ct,Qe){for(var vt=!1,xt=ct;--xt>=0&&"\\"===Qe[xt];)vt=!vt;return vt?"|":" |"}).split(/ \|/),ve=0;if(pe.length>ot)pe.splice(ot);else for(;pe.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},ot.code=function(pe){var ve=this.rules.block.code.exec(pe);if(ve){var ke=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:me(ke,"\n")}}},ot.fences=function(pe){var ve=this.rules.block.fences.exec(pe);if(ve){var ke=ve[0],ct=function(rt,ot){var ut=rt.match(/^(\s+)(?:```)/);if(null===ut)return ot;var pe=ut[1];return ot.split("\n").map(function(ve){var ke=ve.match(/^\s+/);return null===ke?ve:ke[0].length>=pe.length?ve.slice(pe.length):ve}).join("\n")}(ke,ve[3]||"");return{type:"code",raw:ke,lang:ve[2]?ve[2].trim():ve[2],text:ct}}},ot.heading=function(pe){var ve=this.rules.block.heading.exec(pe);if(ve){var ke=ve[2].trim();if(/#$/.test(ke)){var ct=me(ke,"#");(this.options.pedantic||!ct||/ $/.test(ct))&&(ke=ct.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:ke}}},ot.nptable=function(pe){var ve=this.rules.block.nptable.exec(pe);if(ve){var ke={type:"table",header:te(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(ke.header.length===ke.align.length){var Qe,ct=ke.align.length;for(Qe=0;Qe ?/gm,"");return{type:"blockquote",raw:ve[0],text:ke}}},ot.list=function(pe){var ve=this.rules.block.list.exec(pe);if(ve){var $t,jn,ii,Dn,fn,zn,bn,Qi,Zi,ke=ve[0],ct=ve[2],Qe=ct.length>1,vt={type:"list",raw:ke,ordered:Qe,start:Qe?+ct.slice(0,-1):"",loose:!1,items:[]},xt=ve[0].match(this.rules.block.item),Tt=!1,qn=xt.length;ii=this.rules.block.listItemStart.exec(xt[0]);for(var Pi=0;Piii[1].length:Dn[1].length>=ii[0].length||Dn[1].length>3){xt.splice(Pi,2,xt[Pi]+(!this.options.pedantic&&Dn[1].length/i.test(ct[0])&&(ve=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(ct[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ct[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:ct[0],inLink:ve,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ct[0]):ye(ct[0]):ct[0]}},ot.link=function(pe){var ve=this.rules.inline.link.exec(pe);if(ve){var ke=ve[2].trim();if(!this.options.pedantic&&/^$/.test(ke))return;var ct=me(ke.slice(0,-1),"\\");if((ke.length-ct.length)%2==0)return}else{var Qe=De(ve[2],"()");if(Qe>-1){var xt=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Qe;ve[2]=ve[2].substring(0,Qe),ve[0]=ve[0].substring(0,xt).trim(),ve[3]=""}}var Tt=ve[2],$t="";if(this.options.pedantic){var jn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Tt);jn&&(Tt=jn[1],$t=jn[3])}else $t=ve[3]?ve[3].slice(1,-1):"";return Tt=Tt.trim(),/^$/.test(ke)?Tt.slice(1):Tt.slice(1,-1)),Ve(ve,{href:Tt&&Tt.replace(this.rules.inline._escapes,"$1"),title:$t&&$t.replace(this.rules.inline._escapes,"$1")},ve[0])}},ot.reflink=function(pe,ve){var ke;if((ke=this.rules.inline.reflink.exec(pe))||(ke=this.rules.inline.nolink.exec(pe))){var ct=(ke[2]||ke[1]).replace(/\s+/g," ");if(!(ct=ve[ct.toLowerCase()])||!ct.href){var Qe=ke[0].charAt(0);return{type:"text",raw:Qe,text:Qe}}return Ve(ke,ct,ke[0])}},ot.emStrong=function(pe,ve,ke){void 0===ke&&(ke="");var ct=this.rules.inline.emStrong.lDelim.exec(pe);if(ct&&(!ct[3]||!ke.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Qe=ct[1]||ct[2]||"";if(!Qe||Qe&&(""===ke||this.rules.inline.punctuation.exec(ke))){var xt,Tt,vt=ct[0].length-1,$t=vt,jn=0,ii="*"===ct[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ii.lastIndex=0,ve=ve.slice(-1*pe.length+vt);null!=(ct=ii.exec(ve));)if(xt=ct[1]||ct[2]||ct[3]||ct[4]||ct[5]||ct[6]){if(Tt=xt.length,ct[3]||ct[4]){$t+=Tt;continue}if((ct[5]||ct[6])&&vt%3&&!((vt+Tt)%3)){jn+=Tt;continue}if(!(($t-=Tt)>0))return Tt=Math.min(Tt,Tt+$t+jn),Math.min(vt,Tt)%2?{type:"em",raw:pe.slice(0,vt+ct.index+Tt+1),text:pe.slice(1,vt+ct.index+Tt)}:{type:"strong",raw:pe.slice(0,vt+ct.index+Tt+1),text:pe.slice(2,vt+ct.index+Tt-1)}}}}},ot.codespan=function(pe){var ve=this.rules.inline.code.exec(pe);if(ve){var ke=ve[2].replace(/\n/g," "),ct=/[^ ]/.test(ke),Qe=/^ /.test(ke)&&/ $/.test(ke);return ct&&Qe&&(ke=ke.substring(1,ke.length-1)),ke=ye(ke,!0),{type:"codespan",raw:ve[0],text:ke}}},ot.br=function(pe){var ve=this.rules.inline.br.exec(pe);if(ve)return{type:"br",raw:ve[0]}},ot.del=function(pe){var ve=this.rules.inline.del.exec(pe);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},ot.autolink=function(pe,ve){var ct,Qe,ke=this.rules.inline.autolink.exec(pe);if(ke)return Qe="@"===ke[2]?"mailto:"+(ct=ye(this.options.mangle?ve(ke[1]):ke[1])):ct=ye(ke[1]),{type:"link",raw:ke[0],text:ct,href:Qe,tokens:[{type:"text",raw:ct,text:ct}]}},ot.url=function(pe,ve){var ke;if(ke=this.rules.inline.url.exec(pe)){var ct,Qe;if("@"===ke[2])Qe="mailto:"+(ct=ye(this.options.mangle?ve(ke[0]):ke[0]));else{var vt;do{vt=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0]}while(vt!==ke[0]);ct=ye(ke[0]),Qe="www."===ke[1]?"http://"+ct:ct}return{type:"link",raw:ke[0],text:ct,href:Qe,tokens:[{type:"text",raw:ct,text:ct}]}}},ot.inlineText=function(pe,ve,ke){var Qe,ct=this.rules.inline.text.exec(pe);if(ct)return Qe=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ct[0]):ye(ct[0]):ct[0]:ye(this.options.smartypants?ke(ct[0]):ct[0]),{type:"text",raw:ct[0],text:Qe}},rt}(),Je=se_noopTest,Ye=se_edit,je=se_merge,Le={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Je,table:Je,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Le.def=Ye(Le.def).replace("label",Le._label).replace("title",Le._title).getRegex(),Le.bullet=/(?:[*+-]|\d{1,9}[.)])/,Le.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Le.item=Ye(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Ye(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Ye(Le.list).replace(/bull/g,Le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Le.def.source+")").getRegex(),Le._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Le._comment=/|$)/,Le.html=Ye(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Ye(Le._paragraph).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.blockquote=Ye(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=je({},Le),Le.gfm=je({},Le.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Le.gfm.nptable=Ye(Le.gfm.nptable).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.gfm.table=Ye(Le.gfm.table).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.pedantic=je({},Le.normal,{html:Ye("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Je,paragraph:Ye(Le.normal._paragraph).replace("hr",Le.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ee.punctuation=Ye(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ee.escapedEmSt=/\\\*|\\_/g,Ee._comment=Ye(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ee.emStrong.lDelim=Ye(Ee.emStrong.lDelim).replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimAst=Ye(Ee.emStrong.rDelimAst,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimUnd=Ye(Ee.emStrong.rDelimUnd,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ee.autolink=Ye(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Ye(Ee.tag).replace("comment",Ee._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Ye(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Ye(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Ye(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=je({},Ee),Ee.pedantic=je({},Ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ye(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=je({},Ee.normal,{escape:Ye(Ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(pe="x"+pe.toString(16)),ot+="&#"+pe+";";return ot}var Pe=function(){function rt(ut){this.tokens=[],this.tokens.links=Object.create(null),this.options=ut||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var pe={block:Be.normal,inline:z.normal};this.options.pedantic?(pe.block=Be.pedantic,pe.inline=z.pedantic):this.options.gfm&&(pe.block=Be.gfm,pe.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=pe}rt.lex=function(pe,ve){return new rt(ve).lex(pe)},rt.lexInline=function(pe,ve){return new rt(ve).inlineTokens(pe)};var ot=rt.prototype;return ot.lex=function(pe){return pe=pe.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(pe,this.tokens,!0),this.inline(this.tokens),this.tokens},ot.blockTokens=function(pe,ve,ke){var Qe,vt,xt,Tt,$t,jn,ct=this;for(void 0===ve&&(ve=[]),void 0===ke&&(ke=!0),this.options.pedantic&&(pe=pe.replace(/^ +$/gm,""));pe;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Dn){return!!(Qe=Dn.call(ct,pe,ve))&&(pe=pe.substring(Qe.raw.length),ve.push(Qe),!0)}))){if(Qe=this.tokenizer.space(pe)){pe=pe.substring(Qe.raw.length),Qe.type&&ve.push(Qe);continue}if(Qe=this.tokenizer.code(pe)){pe=pe.substring(Qe.raw.length),(Tt=ve[ve.length-1])&&"paragraph"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe);continue}if(Qe=this.tokenizer.fences(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.heading(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.nptable(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.hr(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.blockquote(pe)){pe=pe.substring(Qe.raw.length),Qe.tokens=this.blockTokens(Qe.text,[],ke),ve.push(Qe);continue}if(Qe=this.tokenizer.list(pe)){for(pe=pe.substring(Qe.raw.length),xt=Qe.items.length,vt=0;vt=0&&(Dn=Math.min(Dn,zn))}),Dn<1/0&&Dn>=0&&($t=pe.substring(0,Dn+1))}(),ke&&(Qe=this.tokenizer.paragraph($t))){Tt=ve[ve.length-1],jn&&"paragraph"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe),jn=$t.length!==pe.length,pe=pe.substring(Qe.raw.length);continue}if(Qe=this.tokenizer.text(pe)){pe=pe.substring(Qe.raw.length),(Tt=ve[ve.length-1])&&"text"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe);continue}if(pe){var ii="Infinite loop on byte: "+pe.charCodeAt(0);if(this.options.silent){console.error(ii);break}throw new Error(ii)}}return ve},ot.inline=function(pe){var ve,ke,ct,Qe,vt,xt,Tt=pe.length;for(ve=0;ve0)for(;null!=(jn=this.tokenizer.rules.inline.reflinkSearch.exec($t));)fn.includes(jn[0].slice(jn[0].lastIndexOf("[")+1,-1))&&($t=$t.slice(0,jn.index)+"["+X("a",jn[0].length-2)+"]"+$t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(jn=this.tokenizer.rules.inline.blockSkip.exec($t));)$t=$t.slice(0,jn.index)+"["+X("a",jn[0].length-2)+"]"+$t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(jn=this.tokenizer.rules.inline.escapedEmSt.exec($t));)$t=$t.slice(0,jn.index)+"++"+$t.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;pe;)if(ii||(Dn=""),ii=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(bn){return!!(vt=bn.call(Qe,pe,ve))&&(pe=pe.substring(vt.raw.length),ve.push(vt),!0)}))){if(vt=this.tokenizer.escape(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.tag(pe,ke,ct)){pe=pe.substring(vt.raw.length),ke=vt.inLink,ct=vt.inRawBlock,(xt=ve[ve.length-1])&&"text"===vt.type&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.link(pe)){pe=pe.substring(vt.raw.length),"link"===vt.type&&(vt.tokens=this.inlineTokens(vt.text,[],!0,ct)),ve.push(vt);continue}if(vt=this.tokenizer.reflink(pe,this.tokens.links)){pe=pe.substring(vt.raw.length),xt=ve[ve.length-1],"link"===vt.type?(vt.tokens=this.inlineTokens(vt.text,[],!0,ct),ve.push(vt)):xt&&"text"===vt.type&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.emStrong(pe,$t,Dn)){pe=pe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,ct),ve.push(vt);continue}if(vt=this.tokenizer.codespan(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.br(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.del(pe)){pe=pe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,ct),ve.push(vt);continue}if(vt=this.tokenizer.autolink(pe,ce)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(!ke&&(vt=this.tokenizer.url(pe,ce))){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(Tt=pe,this.options.extensions&&this.options.extensions.startInline&&function(){var bn=1/0,Qi=pe.slice(1),Zi=void 0;Qe.options.extensions.startInline.forEach(function(qn){"number"==typeof(Zi=qn.call(this,Qi))&&Zi>=0&&(bn=Math.min(bn,Zi))}),bn<1/0&&bn>=0&&(Tt=pe.substring(0,bn+1))}(),vt=this.tokenizer.inlineText(Tt,ct,be)){pe=pe.substring(vt.raw.length),"_"!==vt.raw.slice(-1)&&(Dn=vt.raw.slice(-1)),ii=!0,(xt=ve[ve.length-1])&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(pe){var zn="Infinite loop on byte: "+pe.charCodeAt(0);if(this.options.silent){console.error(zn);break}throw new Error(zn)}}return ve},function(rt,ot,ut){ot&&it(rt.prototype,ot),ut&&it(rt,ut)}(rt,null,[{key:"rules",get:function(){return{block:Be,inline:z}}}]),rt}(),wt=dt.exports.defaults,pt=se_cleanUrl,fe=se_escape,B=function(){function rt(ut){this.options=ut||wt}var ot=rt.prototype;return ot.code=function(pe,ve,ke){var ct=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Qe=this.options.highlight(pe,ct);null!=Qe&&Qe!==pe&&(ke=!0,pe=Qe)}return pe=pe.replace(/\n$/,"")+"\n",ct?'
    '+(ke?pe:fe(pe,!0))+"
    \n":"
    "+(ke?pe:fe(pe,!0))+"
    \n"},ot.blockquote=function(pe){return"
    \n"+pe+"
    \n"},ot.html=function(pe){return pe},ot.heading=function(pe,ve,ke,ct){return this.options.headerIds?"'+pe+"\n":""+pe+"\n"},ot.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},ot.list=function(pe,ve,ke){var ct=ve?"ol":"ul";return"<"+ct+(ve&&1!==ke?' start="'+ke+'"':"")+">\n"+pe+"\n"},ot.listitem=function(pe){return"
  • "+pe+"
  • \n"},ot.checkbox=function(pe){return" "},ot.paragraph=function(pe){return"

    "+pe+"

    \n"},ot.table=function(pe,ve){return ve&&(ve=""+ve+""),"\n\n"+pe+"\n"+ve+"
    \n"},ot.tablerow=function(pe){return"\n"+pe+"\n"},ot.tablecell=function(pe,ve){var ke=ve.header?"th":"td";return(ve.align?"<"+ke+' align="'+ve.align+'">':"<"+ke+">")+pe+"\n"},ot.strong=function(pe){return""+pe+""},ot.em=function(pe){return""+pe+""},ot.codespan=function(pe){return""+pe+""},ot.br=function(){return this.options.xhtml?"
    ":"
    "},ot.del=function(pe){return""+pe+""},ot.link=function(pe,ve,ke){if(null===(pe=pt(this.options.sanitize,this.options.baseUrl,pe)))return ke;var ct='"+ke+""},ot.image=function(pe,ve,ke){if(null===(pe=pt(this.options.sanitize,this.options.baseUrl,pe)))return ke;var ct=''+ke+'":">")},ot.text=function(pe){return pe},rt}(),R=function(){function rt(){}var ot=rt.prototype;return ot.strong=function(pe){return pe},ot.em=function(pe){return pe},ot.codespan=function(pe){return pe},ot.del=function(pe){return pe},ot.html=function(pe){return pe},ot.text=function(pe){return pe},ot.link=function(pe,ve,ke){return""+ke},ot.image=function(pe,ve,ke){return""+ke},ot.br=function(){return""},rt}(),k=function(){function rt(){this.seen={}}var ot=rt.prototype;return ot.serialize=function(pe){return pe.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ot.getNextSafeSlug=function(pe,ve){var ke=pe,ct=0;if(this.seen.hasOwnProperty(ke)){ct=this.seen[pe];do{ke=pe+"-"+ ++ct}while(this.seen.hasOwnProperty(ke))}return ve||(this.seen[pe]=ct,this.seen[ke]=0),ke},ot.slug=function(pe,ve){void 0===ve&&(ve={});var ke=this.serialize(pe);return this.getNextSafeSlug(ke,ve.dryrun)},rt}(),Oe=B,Xe=R,yt=k,It=dt.exports.defaults,Tn=se_unescape,Gn=Pe,yi=function(){function rt(ut){this.options=ut||It,this.options.renderer=this.options.renderer||new Oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new yt}rt.parse=function(pe,ve){return new rt(ve).parse(pe)},rt.parseInline=function(pe,ve){return new rt(ve).parseInline(pe)};var ot=rt.prototype;return ot.parse=function(pe,ve){void 0===ve&&(ve=!0);var ct,Qe,vt,xt,Tt,$t,jn,ii,Dn,fn,zn,bn,Qi,Zi,qn,Pi,da,$r,ne,ke="",de=pe.length;for(ct=0;ct0&&"text"===qn.tokens[0].type?(qn.tokens[0].text=$r+" "+qn.tokens[0].text,qn.tokens[0].tokens&&qn.tokens[0].tokens.length>0&&"text"===qn.tokens[0].tokens[0].type&&(qn.tokens[0].tokens[0].text=$r+" "+qn.tokens[0].tokens[0].text)):qn.tokens.unshift({type:"text",text:$r}):Zi+=$r),Zi+=this.parse(qn.tokens,Qi),Dn+=this.renderer.listitem(Zi,da,Pi);ke+=this.renderer.list(Dn,zn,bn);continue;case"html":ke+=this.renderer.html(fn.text);continue;case"paragraph":ke+=this.renderer.paragraph(this.parseInline(fn.tokens));continue;case"text":for(Dn=fn.tokens?this.parseInline(fn.tokens):fn.text;ct+1An error occurred:

    "+qa(vt.message+"",!0)+"
    ";throw vt}}return Qt.options=Qt.setOptions=function(rt){return Ps(Qt.defaults,rt),ua(Qt.defaults),Qt},Qt.getDefaults=Al,Qt.defaults=ms,Qt.use=function(){for(var rt=this,ot=arguments.length,ut=new Array(ot),pe=0;peAn error occurred:

    "+qa(pe.message+"",!0)+"
    ";throw pe}},Qt.Parser=yi,Qt.parser=yi.parse,Qt.Renderer=Hr,Qt.TextRenderer=Ns,Qt.Lexer=Gn,Qt.lexer=Gn.lex,Qt.Tokenizer=hi,Qt.Slugger=cs,Qt.parse=Qt,Qt}()},369:(kt,it,tt)=>{var gt=tt(284),J=tt(830);function At(){this.clear()}At.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},At.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},At.prototype.dequeue=function(){if(this.size){var dt=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,dt}},At.prototype.peek=function(){if(this.size)return this.items[this.offset]},At.prototype.forEach=function(dt,K){K=arguments.length>1?K:this;for(var Ae=this.offset,he=0,q=this.items.length;Ae=dt.length)return{done:!0};var Ae=dt[K];return K++,{value:Ae,done:!1}})},At.prototype.entries=function(){var dt=this.items,K=this.offset,Ae=0;return new gt(function(){if(K>=dt.length)return{done:!0};var he=dt[K];return K++,{value:[Ae++,he],done:!1}})},"undefined"!=typeof Symbol&&(At.prototype[Symbol.iterator]=At.prototype.values),At.prototype.toString=function(){return this.toArray().join(",")},At.prototype.toJSON=function(){return this.toArray()},At.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:At,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(At.prototype[Symbol.for("nodejs.util.inspect.custom")]=At.prototype.inspect),At.from=function(dt){var K=new At;return J(dt,function(Ae){K.enqueue(Ae)}),K},At.of=function(){return At.from(arguments)},kt.exports=At},830:kt=>{var it="undefined"!=typeof ArrayBuffer,tt="undefined"!=typeof Symbol;function gt(J,At){var dt,K,Ae,he,q;if(!J)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof At)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(J)||it&&ArrayBuffer.isView(J)||"string"==typeof J||"[object Arguments]"===J.toString())for(Ae=0,he=J.length;Ae{function it(tt){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:tt}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var tt=this._next();return tt.done&&(this.done=!0),tt},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var tt=arguments,gt=tt.length,J=0;return new it(function(){return J>=gt?{done:!0}:{done:!1,value:tt[J++]}})},it.empty=function(){var tt=new it(null);return tt.done=!0,tt},it.is=function(tt){return tt instanceof it||"object"==typeof tt&&null!==tt&&"function"==typeof tt.next},kt.exports=it},310:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==J.window.orientation},it.default=function(he){if(!he&&!(0,At.default)())return"Node";if((0,dt.default)(he))return"Electron";var q="undefined"!=typeof navigator?navigator:{},V=he||q.userAgent||"";if(V.indexOf("Edge")>-1)return"Edge";var L=-1!==V.indexOf("MSIE "),re=-1!==V.indexOf("Trident/");return L||re?"IE":J.window.chrome?"Chrome":J.window.safari?"Safari":J.window.mozInnerScreenX?"Firefox":"Unknown"};var J=tt(151),At=gt(tt(602)),dt=gt(tt(344))},151:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var J=gt(tt(321)),At={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&process};it.self=At.self||At.window||At.global,it.window=At.window||At.self||At.global,it.global=At.global||At.self||At.window,it.document=At.document||{},it.process=At.process||{};var V=console;it.console=V},761:(kt,it,tt)=>{"use strict";var J=tt(948),At=tt(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"jU",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Ae.default}});var dt=tt(151),K=V(tt(602)),Ae=V(tt(310));J(tt(344));function q(L){if("function"!=typeof WeakMap)return null;var re=new WeakMap,$=new WeakMap;return(q=function(S){return S?$:re})(L)}function V(L,re){if(!re&&L&&L.__esModule)return L;if(null===L||"object"!==At(L)&&"function"!=typeof L)return{default:L};var $=q(re);if($&&$.has(L))return $.get(L);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in L)if("default"!==O&&Object.prototype.hasOwnProperty.call(L,O)){var T=S?Object.getOwnPropertyDescriptor(L,O):null;T&&(T.get||T.set)?Object.defineProperty(b,O,T):b[O]=L[O]}return b.default=L,$&&$.set(L,b),b}},602:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var J=gt(tt(321)),At=gt(tt(344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,At.default)()}},344:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,J.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,J.default)(process.versions)&&Boolean(process.versions.electron))return!0;var K="object"===("undefined"==typeof navigator?"undefined":(0,J.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Ae=dt||K;return!!(Ae&&Ae.indexOf("Electron")>=0)};var J=gt(tt(321))},991:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(At,dt,K,Ae){void 0===Ae&&(Ae=K),Object.defineProperty(At,Ae,{enumerable:!0,get:function(){return dt[K]}})}:function(At,dt,K,Ae){void 0===Ae&&(Ae=K),At[Ae]=dt[K]}),J=this&&this.__exportStar||function(At,dt){for(var K in At)"default"!==K&&!Object.prototype.hasOwnProperty.call(dt,K)&>(dt,At,K)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(180),it),J(tt(103),it),J(tt(965),it),J(tt(595),it),J(tt(417),it),J(tt(451),it),J(tt(735),it)},180:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(J){this.termType="BlankNode",this.value=J}equals(J){return!!J&&"BlankNode"===J.termType&&J.value===this.value}}},103:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const gt=tt(180),J=tt(965),At=tt(595),dt=tt(417),K=tt(451),Ae=tt(735);let he=0;it.DataFactory=class{constructor(L){this.blankNodeCounter=0,this.blankNodePrefix=(L=L||{}).blankNodePrefix||`df_${he++}_`}namedNode(L){return new dt.NamedNode(L)}blankNode(L){return new gt.BlankNode(L||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(L,re){return new At.Literal(L,re)}variable(L){return new Ae.Variable(L)}defaultGraph(){return J.DefaultGraph.INSTANCE}quad(L,re,$,b){return new K.Quad(L,re,$,b||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(At.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}}},965:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class tt{constructor(){this.termType="DefaultGraph",this.value=""}equals(J){return!!J&&"DefaultGraph"===J.termType}}it.DefaultGraph=tt,tt.INSTANCE=new tt},595:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const gt=tt(417);class J{constructor(dt,K){this.termType="Literal",this.value=dt,"string"==typeof K?(this.language=K,this.datatype=J.RDF_LANGUAGE_STRING):K?(this.language="",this.datatype=K):(this.language="",this.datatype=J.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=J,J.RDF_LANGUAGE_STRING=new gt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),J.XSD_STRING=new gt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(J){this.termType="NamedNode",this.value=J}equals(J){return!!J&&"NamedNode"===J.termType&&J.value===this.value}}},451:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(J,At,dt,K){this.termType="Quad",this.value="",this.subject=J,this.predicate=At,this.object=dt,this.graph=K}equals(J){return!!J&&("Quad"===J.termType||!J.termType)&&this.subject.equals(J.subject)&&this.predicate.equals(J.predicate)&&this.object.equals(J.object)&&this.graph.equals(J.graph)}}},735:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(J){this.termType="Variable",this.value=J}equals(J){return!!J&&"Variable"===J.termType&&J.value===this.value}}},609:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(b,S,O,T){void 0===T&&(T=O),Object.defineProperty(b,T,{enumerable:!0,get:function(){return S[O]}})}:function(b,S,O,T){void 0===T&&(T=O),b[T]=S[O]}),J=this&&this.__exportStar||function(b,S){for(var O in b)"default"!==O&&!Object.prototype.hasOwnProperty.call(S,O)&>(S,b,O)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const At=tt(991),dt=tt(938),K=tt(60);J(tt(938),it),J(tt(871),it),J(tt(60),it);const Ae=new At.DataFactory,he=new K.Translator;function q(b,S){return he.fromRdf(b,S)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(b=>Ae.namedNode(b)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(b=>Ae.namedNode(b)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(b=>Ae.namedNode(b)),["object"]),it.fromRdf=q,it.toRdf=function(b,S){return S&&"namedNode"in S&&(S={dataFactory:S}),(S=S||{})&&!S.dataFactory&&(S.dataFactory=Ae),he.toRdf(b,S)},it.getTermRaw=function(b,S){return"Literal"===b.termType?q(b,S):b.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Translator=void 0,it.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(J){throw new Error(`Invalid RDF ${J.datatype.value} value: '${J.value}'`)}registerHandler(J,At,dt){for(const K of At)this.supportedRdfDatatypes.push(K),this.fromRdfHandlers[K.value]=J;for(const K of dt){let Ae=this.toRdfHandlers[K];Ae||(this.toRdfHandlers[K]=Ae=[]),Ae.push(J)}}fromRdf(J,At){const dt=this.fromRdfHandlers[J.datatype.value];return dt?dt.fromRdf(J,At):J.value}toRdf(J,At){const dt=this.toRdfHandlers[typeof J];if(dt)for(const K of dt){const Ae=K.toRdf(J,At);if(Ae)return Ae}throw new Error(`Invalid JavaScript value: '${J}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const gt=tt(60);class J{fromRdf(dt,K){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return K&>.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:K,dataFactory:Ae}){return Ae.literal(dt?"true":"false",K||Ae.namedNode(J.TYPE))}}it.TypeHandlerBoolean=J,J.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const gt=tt(60);class J{fromRdf(dt,K){switch(K&&!dt.value.match(J.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&>.Translator.incorrectRdfDataType(dt),dt.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(dt.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const Ae=dt.value.split("-");return new Date(0,parseInt(Ae[0],10)-1,parseInt(Ae[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(dt.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(dt.value+"-01");default:return new Date(dt.value)}}toRdf(dt,{datatype:K,dataFactory:Ae}){if(K=K||Ae.namedNode(J.TYPES[0]),!(dt instanceof Date))return null;const he=dt;let q;switch(K.value){case"http://www.w3.org/2001/XMLSchema#gDay":q=String(he.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":q=he.getUTCMonth()+1+"-"+he.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":q=String(he.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":q=he.getUTCFullYear()+"-"+(he.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":q=he.toISOString().replace(/T.*$/,"");break;default:q=he.toISOString()}return Ae.literal(q,K)}}it.TypeHandlerDate=J,J.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"],J.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]$/}},554:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const gt=tt(60);class J{fromRdf(dt,K){const Ae=parseFloat(dt.value);return K&&isNaN(Ae)&>.Translator.incorrectRdfDataType(dt),Ae}toRdf(dt,{datatype:K,dataFactory:Ae}){return K=K||Ae.namedNode(J.TYPES[0]),isNaN(dt)?Ae.literal("NaN",K):isFinite(dt)?dt%1==0?null:Ae.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),K):Ae.literal(dt>0?"INF":"-INF",K)}}it.TypeHandlerNumberDouble=J,J.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const gt=tt(60);class J{fromRdf(dt,K){const Ae=parseInt(dt.value,10);return K&&(isNaN(Ae)||dt.value.indexOf(".")>=0)&>.Translator.incorrectRdfDataType(dt),Ae}toRdf(dt,{datatype:K,dataFactory:Ae}){return Ae.literal(String(dt),K||Ae.namedNode(dt<=J.MAX_INT&&dt>=J.MIN_INT?J.TYPES[0]:J.TYPES[1]))}}it.TypeHandlerNumberInteger=J,J.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"],J.MAX_INT=2147483647,J.MIN_INT=-2147483648},608:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class tt{fromRdf(J){return J.value}toRdf(J,{datatype:At,dataFactory:dt}){return dt.literal(J,At)}}it.TypeHandlerString=tt,tt.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/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},938:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(At,dt,K,Ae){void 0===Ae&&(Ae=K),Object.defineProperty(At,Ae,{enumerable:!0,get:function(){return dt[K]}})}:function(At,dt,K,Ae){void 0===Ae&&(Ae=K),At[Ae]=dt[K]}),J=this&&this.__exportStar||function(At,dt){for(var K in At)"default"!==K&&!Object.prototype.hasOwnProperty.call(dt,K)&>(dt,At,K)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(727),it),J(tt(525),it),J(tt(554),it),J(tt(750),it),J(tt(608),it)},18:(kt,it,tt)=>{"use strict";var gt={};tt.r(gt),tt.d(gt,{decode:()=>ufe,encode:()=>dfe});var J={};tt.r(J),tt.d(J,{decode:()=>mfe,encode:()=>_fe});var At={};tt.r(At),tt.d(At,{decode:()=>yfe,encode:()=>vfe});var dt={};function K(n){return"function"==typeof n}tt.r(dt),tt.d(dt,{decode:()=>bfe,encode:()=>wfe});let Ae=!1;const he={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else Ae&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ae=n},get useDeprecatedSynchronousErrorHandling(){return Ae}};function q(n){setTimeout(()=>{throw n},0)}const V={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;q(n)},complete(){}},L=Array.isArray||(n=>n&&"number"==typeof n.length);function re(n){return null!==n&&"object"==typeof n}const b=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class S{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof S)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof b?t.errors:t),[])}S.EMPTY=((n=new S).closed=!0,n);const T="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends S{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=V;break;case 1:if(!e){this.destination=V;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,e,t,i)}}[T](){return this}static create(e,t,i){const r=new y(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class w extends y{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;K(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==V&&(o=Object.create(t),K(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;he.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=he;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):q(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;q(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);he.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),he.useDeprecatedSynchronousErrorHandling)throw i;q(i)}}__tryOrSetError(e,t,i){if(!he.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return he.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(q(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const I="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(n){return n}let F=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof y)return n;if(n[T])return n[T]()}return n||e||t?new y(n,e,t):new y(V)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||he.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),he.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){he.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof y?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=Q(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[I](){return this}pipe(...t){return 0===t.length?this:function(n){return 0===n.length?H:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}(t)(this)}toPromise(t){return new(t=Q(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function Q(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const U=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ie extends S{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class ue extends y{constructor(e){super(e),this.destination=e}}let ee=(()=>{class n extends F{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[T](){return new ue(this)}lift(t){const i=new se(this,this);return i.operator=t,i}next(t){if(this.closed)throw new U;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew se(e,t),n})();class se extends ee{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):S.EMPTY}}function Te(n){return n&&"function"==typeof n.schedule}function me(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new te(n,e))}}class te{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new ye(e,this.project,this.thisArg))}}class ye extends y{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const De=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ee(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Re=n=>{if(n&&"function"==typeof n[I])return(n=>e=>{const t=n[I]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(Le(n))return De(n);if(Ee(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,q),e))(n);if(n&&"function"==typeof n[Ze])return(n=>e=>{const t=n[Ze]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${re(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Be(n,e){return new F(t=>{const i=new S;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function Pe(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[I]}(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>{const r=n[I]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(Ee(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(Le(n))return Be(n,e);if(function(n){return n&&"function"==typeof n[Ze]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new F(t=>{const i=new S;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Ze](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof F?n:new F(Re(n))}class wt extends y{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class fe extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function R(n,e){if(e.closed)return;if(n instanceof F)return n.subscribe(e);let t;try{t=Re(n)(e)}catch(i){e.error(i)}return t}function k(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(k((r,s)=>Pe(n(r,s)).pipe(me((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Oe(n,t)))}class Oe{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Xe(e,this.project,this.concurrent))}}class Xe extends fe{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function It(n=Number.POSITIVE_INFINITY){return k(H,n)}function Tn(n,e){return e?Be(n,e):new F(De(n))}function Pn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Te(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof F?n[0]:It(e)(Tn(n,t))}function Gn(){return function(e){return e.lift(new yi(e))}}class yi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new hi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class hi extends y{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Hr extends F{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new S,e.add(this.source.subscribe(new cs(this.getSubject(),this))),e.closed&&(this._connection=null,e=S.EMPTY)),e}refCount(){return Gn()(this)}}const Ns=(()=>{const n=Hr.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class cs extends ue{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class Al{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function ua(){return new ee}function ms(){return n=>Gn()(function(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new Al(r,e));const s=Object.create(i,Ns);return s.source=i,s.subjectFactory=r,s}}(ua)(n))}function Qt(n){for(let e in n)if(n[e]===Qt)return e;throw Error("Could not find renamed property on target object.")}function Ka(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function rt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(rt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ot(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ut=Qt({__forward_ref__:Qt});function pe(n){return n.__forward_ref__=pe,n.toString=function(){return rt(this())},n}function ve(n){return ke(n)?n():n}function ke(n){return"function"==typeof n&&n.hasOwnProperty(ut)&&n.__forward_ref__===pe}class Qe extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function $t(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():function(n){return"string"==typeof n?n:null==n?"":String(n)}(n)}function fn(n,e){const t=e?` in ${e}`:"";throw new Qe("201",`No provider for ${$t(n)} found${t}`)}function Z(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function We(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Et(n){return{providers:n.providers||[],imports:n.imports||[]}}function pn(n){return _s(n,oo)||_s(n,Fs)}function _s(n,e){return n.hasOwnProperty(e)?n[e]:null}function Tl(n){return n&&(n.hasOwnProperty(Pr)||n.hasOwnProperty(fc))?n[Pr]:null}const oo=Qt({\u0275prov:Qt}),Pr=Qt({\u0275inj:Qt}),Fs=Qt({ngInjectableDef:Qt}),fc=Qt({ngInjectorDef:Qt});var yn=(()=>((yn=yn||{})[yn.Default=0]="Default",yn[yn.Host=1]="Host",yn[yn.Self=2]="Self",yn[yn.SkipSelf=4]="SkipSelf",yn[yn.Optional=8]="Optional",yn))();let ao;function ha(n){const e=ao;return ao=n,e}function id(n,e,t){const i=pn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&yn.Optional?null:void 0!==e?e:void fn(rt(n),"Injector")}function Ce(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),Ht=(()=>((Ht=Ht||{})[Ht.Emulated=0]="Emulated",Ht[Ht.None=2]="None",Ht[Ht.ShadowDom=3]="ShadowDom",Ht))();const ri="undefined"!=typeof globalThis&&globalThis,Fr="undefined"!=typeof window&&window,qr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,ys="undefined"!=typeof global&&global,ti=ri||ys||Fr||qr,rd={},Wi=[],Wf=Qt({\u0275cmp:Qt}),xm=Qt({\u0275dir:Qt}),fh=Qt({\u0275pipe:Qt}),gv=Qt({\u0275mod:Qt}),M1=Qt({\u0275loc:Qt}),Dl=Qt({\u0275fac:Qt}),ph=Qt({__NG_ELEMENT_ID__:Qt});let D1=0;function wn(n){return Ce(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===He.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||Wi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Ht.Emulated,id:"c",styles:n.styles||Wi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=D1++,i.inputs=vv(n.inputs,t),i.outputs=vv(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(mv):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(_v):null,i})}function mv(n){return Di(n)||function(n){return n[xm]||null}(n)}function _v(n){return function(n){return n[fh]||null}(n)}const yv={};function gn(n){return Ce(()=>{const e={type:n.type,bootstrap:n.bootstrap||Wi,declarations:n.declarations||Wi,imports:n.imports||Wi,exports:n.exports||Wi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(yv[n.id]=n.type),e})}function vv(n,e){if(null==n)return rd;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const Lt=wn;function Ls(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Di(n){return n[Wf]||null}function xo(n,e){const t=n[gv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Ho(n){return Array.isArray(n)&&"object"==typeof n[1]}function Go(n){return Array.isArray(n)&&!0===n[1]}function Tm(n){return 0!=(8&n.flags)}function ld(n){return 2==(2&n.flags)}function cd(n){return 1==(1&n.flags)}function ga(n){return null!==n.template}function bv(n){return 0!=(512&n[2])}function mc(n,e){return n.hasOwnProperty(Dl)?n[Dl]:null}class Rm{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function qi(){return Sv}function Sv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),L1}function L1(){const n=st(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===rd)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function k1(n,e,t,i){const r=st(n)||function(n,e){return n[bh]=e}(n,{previous:rd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new Rm(l&&l.currentValue,e,o===rd),n[i]=e}qi.ngInherit=!0;const bh="__ngSimpleChanges__";function st(n){return n[bh]||null}let Bi;function or(n){return!!n.listen}const au={createRenderer:(n,e)=>void 0!==Bi?Bi:"undefined"!=typeof document?document:void 0};function vr(n){for(;Array.isArray(n);)n=n[0];return n}function Ys(n,e){return vr(e[n.index])}function Pm(n,e){return n.data[e]}function Bs(n,e){const t=e[n];return Ho(t)?t:t[0]}function Ol(n){return 4==(4&n[2])}function dd(n){return 128==(128&n[2])}function _a(n,e){return null==e?null:n[e]}function Fm(n){n[18]=0}function Yf(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Ln={lFrame:cu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Cv(){return Ln.bindingsEnabled}function Ft(){return Ln.lFrame.lView}function fi(){return Ln.lFrame.tView}function ya(n){return Ln.lFrame.contextLView=n,n[8]}function ts(){let n=Lm();for(;null!==n&&64===n.type;)n=n.parent;return n}function Lm(){return Ln.lFrame.currentTNode}function Qa(n,e){const t=Ln.lFrame;t.currentTNode=n,t.isParent=e}function Br(){return Ln.lFrame.isParent}function xh(){return Ln.isInCheckNoChangesMode}function Qf(n){Ln.isInCheckNoChangesMode=n}function hd(n,e){const t=Ln.lFrame;t.bindingIndex=t.bindingRootIndex=n,km(e)}function km(n){Ln.lFrame.currentDirectiveIndex=n}function Av(){return Ln.lFrame.currentQueryIndex}function jm(n){Ln.lFrame.currentQueryIndex=n}function Jf(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function fd(n,e,t){if(t&yn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&yn.Host||(r=Jf(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ln.lFrame=Se();return i.currentTNode=e,i.lView=n,!0}function Th(n){const e=Se(),t=n[1];Ln.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Se(){const n=Ln.lFrame,e=null===n?null:n.child;return null===e?cu(n):e}function cu(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Mh(){const n=Ln.lFrame;return Ln.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const To=Mh;function oi(){const n=Mh();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Xs(){return Ln.lFrame.selectedIndex}function uo(n){Ln.lFrame.selectedIndex=n}function ep(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class Dh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function ip(n,e,t){const i=or(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let gd=!0;function rp(n){const e=gd;return gd=n,e}let $m=0;function js(n,e){const t=sp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,Wm(i.data,n),Wm(e,null),Wm(i.blueprint,null));const r=Rh(n,e),s=n.injectorIndex;if(Mv(r)){const o=pd(r),a=Ja(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function Wm(n,e){n.push(0,0,0,0,0,0,0,0,e)}function sp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Rh(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function yc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(ph)&&(i=t[ph]),null==i&&(i=t[ph]=$m++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Ov:e}(t);if("function"==typeof s){if(!fd(e,n,i))return i&yn.Host?qm(r,t,i):Iv(e,t,i,r);try{const o=s(i);if(null!=o||i&yn.Optional)return o;fn(t)}finally{To()}}else if("number"==typeof s){let o=null,a=sp(n,e),l=-1,c=i&yn.Host?e[16][6]:null;for((-1===a||i&yn.SkipSelf)&&(l=-1===a?Rh(n,e):e[a+8],-1!==l&&Nh(i,!1)?(o=e[1],a=pd(l),e=Ja(l,e)):a=-1);-1!==a;){const d=e[1];if(op(s,a,d.data)){const f=ws(a,e,t,o,i,c);if(f!==Rv)return f}l=e[a+8],-1!==l&&Nh(i,e[1].data[a+8]===c)&&op(s,a,e)?(o=d,a=pd(l),e=Ja(l,e)):a=-1}}}return Iv(e,t,i,r)}const Rv={};function Ov(){return new Wo(ts(),Ft())}function ws(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=md(a,o,t,null==i?ld(a)&&gd:i!=o&&0!=(3&a.type),r&yn.Host&&s===a);return null!==d?_d(e,o,d,a):Rv}function md(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&ga(g)&&g.type===t)return l}return null}function _d(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Dh}(r)){const o=r;o.resolving&&function(n,e){throw new Qe("200",`Circular dependency in DI detected for ${n}`)}($t(s[t]));const a=rp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ha(o.injectImpl):null;fd(n,i,yn.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=Sv(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ha(l),rp(a),o.resolving=!1,To()}}return r}function op(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Dl]||Es(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Dl]||Es(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Es(n){return ke(n)?()=>{const e=Es(ve(n));return e&&e()}:mc(n)}const vd="__parameters__";function Sa(n,e,t){return Ce(()=>{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(vd)?l[vd]:Object.defineProperty(l,vd,{value:[]})[vd];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Vt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=We({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}function qo(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Ko(t,e):e(t))}function Fh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Pl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Mo(n,e,t){let i=Ss(n,e);return i>=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function Jm(n,e){const t=Ss(n,e);if(t>=0)return n[1|t]}function Ss(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):rt(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Sc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Ec]=null,n}const xd=Sd(Sa("Inject",n=>({token:n})),-1),Yr=Sd(Sa("Optional"),8),il=Sd(Sa("SkipSelf"),4);const m_="__ngContext__";function xs(n,e){n[m_]=e}function __(n){const e=function(n){return n[m_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function xp(n){return n.ngOriginalError}function LC(n,...e){n.error(...e)}class Zo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||LC}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(xp(e)):null}_findOriginalError(e){let t=e&&xp(e);for(;t&&xp(t);)t=xp(t);return t||null}}const db=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(ti))();function sl(n){return n instanceof Function?n():n}var Ro=(()=>((Ro=Ro||{})[Ro.Important=1]="Important",Ro[Ro.DashCase=2]="DashCase",Ro))();function E_(n,e){return undefined(n,e)}function zh(n){const e=n[3];return Go(e)?e[3]:e}function Id(n){return mb(n[13])}function x_(n){return mb(n[4])}function mb(n){for(;null!==n&&!Go(n);)n=n[4];return n}function Rd(n,e,t,i,r){if(null!=i){let s,o=!1;Go(i)?s=i:Ho(i)&&(o=!0,i=i[0]);const a=vr(i);0===n&&null!==t?null==r?wb(e,t,a):ol(e,t,a,r||null,!0):1===n&&null!==t?ol(e,t,a,r||null,!0):2===n?function(n,e,t){const i=Tp(n,e);i&&function(n,e,t,i){or(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==vr(t)&&Rd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Pl(n,10+e);!function(n,e){Od(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function M_(n,e){if(!(256&e[2])){const t=e[11];or(t)&&t.destroyNode&&Od(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Ap(n[1],n);for(;e;){let t=null;if(Ho(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Ho(e)&&Ap(e[1],e),e=e[3];null===e&&(e=n),Ho(e)&&Ap(e[1],e),t=e&&e[4]}e=t}}(e)}}function Ap(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==Gh(g,c,0)||2&i&&c!==p){if(Ca(i))return!1;o=!0}}}}else{if(!o&&!Ca(i)&&!Ca(l))return!1;if(o&&Ca(l))continue;o=!1,i=l|1&i}}return Ca(i)||o}function Ca(n){return 0==(1&n)}function cA(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!Ca(o)&&(e+=Pb(s,r),r=""),i=o,s=s||!Ca(i);t++}return""!==r&&(e+=Pb(s,r)),e}const Cn={};function al(n,e){return n<<17|e<<2}function Mn(n){return n>>17&32767}function br(n){return 2|n}function jl(n){return(131068&n)>>2}function ll(n,e){return-131069&n|e<<2}function P_(n){return 1|n}function Gb(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&function(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&tp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&np(e,s,0,t)}uo(t)}(n,e,20,xh()),t(i,r)}finally{uo(s)}}function Kh(n,e,t){!Cv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||js(t,e),xs(i,e);const o=t.initialInputs;for(let a=r;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function tw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function nw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function kA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&W_(t)}}function W_(n){for(let i=Id(n);null!==i;i=x_(i))for(let r=10;r0&&W_(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&W_(r)}}function GA(n,e){const t=Bs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function sw(n){return n[7]||(n[7]=[])}function kp(n){return n.cleanup||(n.cleanup=[])}function Z_(n,e){const t=n[9],i=t?t.get(Zo,null):null;i&&i.handleError(e)}function ow(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Ko([e],a=>this.processInjectorType(a,[],s)),this.records.set(Bd,Su(void 0,this));const o=this.records.get(Eu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:rt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=gu,i=yn.Default){this.assertNotDestroyed();const r=Ed(this),s=ha(void 0);try{if(!(i&yn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Vt}(e)&&pn(e);a=l&&this.injectableDefInScope(l)?Su(iy(e),Yh):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&yn.Self?aw():this.parent).get(e,t=i&yn.Optional&&t===gu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Ec]=o[Ec]||[]).unshift(rt(e)),r)throw o;return Qs(o,e,"R3InjectorError",this.source)}throw o}finally{ha(s),Ed(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(rt(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=ve(e)))return!1;let r=Tl(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=Tl(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Ko(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||Wi))}}this.injectorDefTypes.add(o);const l=mc(o)||(()=>new o);this.records.set(o,Su(l,Yh));const c=r.providers;if(null!=c&&!a){const d=e;Ko(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Dc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return uw(n)?Su(void 0,n.useValue):Su(function(n,e,t){let i;if(Dc(n)){const r=ve(n);return mc(r)||iy(r)}if(uw(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(..._u(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Ie(ve(n.useExisting));else{const r=ve(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return mc(r)||iy(r);i=()=>new r(..._u(n.deps))}return i}(n),Yh)}(e);if(Dc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Su(void 0,Yh,!0),o.factory=()=>_u(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===Yh&&(t.value=QA,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ve(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function iy(n){const e=pn(n),t=null!==e?e.factory:mc(n);if(null!==t)return t;if(n instanceof Vt)throw new Error(`Token ${rt(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=function(n,e){const t=[];for(let i=0;it.factory(n):()=>new n}(n);throw new Error("unreachable")}function Su(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function uw(n){return null!==n&&"object"==typeof n&&hp in n}function Dc(n){return"function"==typeof n}const dw=function(n,e,t){return function(n,e=null,t=null,i){const r=lw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Hn{static create(e,t){return Array.isArray(e)?dw(e,t,""):dw(e.providers,e.parent,e.name||"")}}function R7(n,e){ep(__(n)[1],ts())}function Nn(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(ga(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=dT(n.inputs),o.declaredInputs=dT(n.declaredInputs),o.outputs=dT(n.outputs);const a=r.hostBindings;a&&F7(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&N7(n,l),c&&P7(n,c),Ka(n.inputs,r.inputs),Ka(n.declaredInputs,r.declaredInputs),Ka(n.outputs,r.outputs),ga(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Ih(r.hostAttrs,t=Ih(t,r.hostAttrs))}}(i)}function dT(n){return n===rd?{}:n===Wi?[]:n}function N7(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function P7(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function F7(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Hn.THROW_IF_NOT_FOUND=gu,Hn.NULL=new eo,Hn.\u0275prov=We({token:Hn,providedIn:"any",factory:()=>Ie(Bd)}),Hn.__NG_ELEMENT_ID__=-1;let mw=null;function jp(){if(!mw){const n=ti.Symbol;if(n&&n.iterator)mw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(vr(Ne[i.index])):i.index;if(or(t)){let Ne=null;if(!a&&l&&(Ne=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==Ne)(Ne.__ngLastListenerFn__||Ne).__ngNextListenerFn__=s,Ne.__ngLastListenerFn__=s,g=!1;else{s=yT(i,e,f,s,!1);const Ge=t.listen(W,r,s);p.push(s,Ge),d&&d.push(r,ge,G,G+1)}}else s=yT(i,e,f,s,!0),W.addEventListener(r,s,o),p.push(s),d&&d.push(r,ge,G,o)}else s=yT(i,e,f,s,!1);const _=i.outputs;let x;if(g&&null!==_&&(x=_[r])){const A=x.length;if(A)for(let W=0;W0;)e=e[15],n--;return e}(n,Ln.lFrame.contextLView))[8]}(n)}function tL(n,e,t,i,r){const s=n[t+1],o=null===e;let a=i?Mn(s):jl(s),l=!1;for(;0!==a&&(!1===l||o);){const d=n[a+1];yW(n[a],e)&&(l=!0,n[a+1]=i?P_(d):br(d)),a=i?Mn(d):jl(d)}l&&(n[t+1]=i?br(s):P_(s))}function yW(n,e){return null===n||null==e||(Array.isArray(n)?n[1]:n)===e||!(!Array.isArray(n)||"string"!=typeof e)&&Ss(n,e)>=0}const As={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function nL(n){return n.substring(As.key,As.keyEnd)}function iL(n,e){const t=As.textEnd;return t===e?-1:(e=As.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,As.key=e,t),Zp(n,e,t))}function Zp(n,e,t){for(;e0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Mn(n[a+1]);n[i+1]=al(p,a),0!==p&&(n[p+1]=ll(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=al(a,0),0!==a&&(n[a+1]=ll(n[a+1],i)),a=i;else n[i+1]=al(l,0),0===a?a=i:n[l+1]=ll(n[l+1],i),l=i;c&&(n[i+1]=br(n[i+1])),tL(n,d,i,!0),tL(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ss(s,e)>=0&&(t[i+1]=P_(t[i+1]))}(e,d,n,i,s),o=al(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}(r,null,s,i);const o=Ft();if(t!==Cn&&go(o,s,t)){const a=r.data[Xs()];if(fL(a,i)&&!lL(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=ot(l,t||"")),_T(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===Cn&&(r=Wi);let l=0,c=0,d=0=0;t=iL(e,t))Mo(n,nL(e),!0)}function lL(n,e){return e>=n.expandoStartIndex}function bT(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===Cn&&(p=f?Wi:void 0);let g=f?Jm(p,i):d===i?p:void 0;if(c&&!Ew(g)&&(g=Jm(l,i)),Ew(g)&&(a=g,o))return a;const _=n[r+1];r=o?Mn(_):jl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=Jm(l,i))}return a}function Ew(n){return void 0!==n}function fL(n,e){return 0!=(n.flags&(e?16:32))}const Zh=void 0;var ZW=["en",[["a","p"],["AM","PM"],Zh],[["AM","PM"],Zh,Zh],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Zh,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Zh,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Zh,"{1} 'at' {0}",Zh],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Jp={};function RL(n){return n in Jp||(Jp[n]=ti.ng&&ti.ng.common&&ti.ng.common.locales&&ti.ng.common.locales[n]),Jp[n]}var rn=(()=>((rn=rn||{})[rn.LocaleId=0]="LocaleId",rn[rn.DayPeriodsFormat=1]="DayPeriodsFormat",rn[rn.DayPeriodsStandalone=2]="DayPeriodsStandalone",rn[rn.DaysFormat=3]="DaysFormat",rn[rn.DaysStandalone=4]="DaysStandalone",rn[rn.MonthsFormat=5]="MonthsFormat",rn[rn.MonthsStandalone=6]="MonthsStandalone",rn[rn.Eras=7]="Eras",rn[rn.FirstDayOfWeek=8]="FirstDayOfWeek",rn[rn.WeekendRange=9]="WeekendRange",rn[rn.DateFormat=10]="DateFormat",rn[rn.TimeFormat=11]="TimeFormat",rn[rn.DateTimeFormat=12]="DateTimeFormat",rn[rn.NumberSymbols=13]="NumberSymbols",rn[rn.NumberFormats=14]="NumberFormats",rn[rn.CurrencyCode=15]="CurrencyCode",rn[rn.CurrencySymbol=16]="CurrencySymbol",rn[rn.CurrencyName=17]="CurrencyName",rn[rn.Currencies=18]="Currencies",rn[rn.Directionality=19]="Directionality",rn[rn.PluralCase=20]="PluralCase",rn[rn.ExtraData=21]="ExtraData",rn))();const xw="en-US";let OL=xw;function ET(n){Z(n,"Expected localeId to be defined"),"string"==typeof n&&(OL=n.toLowerCase().replace(/_/g,"-"))}class r2{}const o2="ngComponent";class Z9{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[o2]=n,e}(e)}}class fl{}function Dw(...n){}function tg(n,e){return new An(Ys(n,e))}fl.NULL=new Z9;const tq=function(){return tg(ts(),Ft())};let An=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=tq,n})();function a2(n){return n instanceof An?n.nativeElement:n}class Jh{}let IT=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class Au{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const l2=new Au("12.2.5");class c2{constructor(){}supports(e){return ly(e)}create(e){return new aq(e)}}const oq=(n,e)=>e;class aq{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||oq}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new lq(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new u2),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new u2),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class lq{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class cq{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class u2{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new cq,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function d2(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new dq(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class dq{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function f2(){return new ng([new c2])}let ng=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||f2()),deps:[[n,new il,new Yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=We({token:n,providedIn:"root",factory:f2}),n})();function p2(){return new ig([new h2])}let ig=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||p2()),deps:[[n,new il,new Yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=We({token:n,providedIn:"root",factory:p2}),n})();function Iw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(vr(s)),Go(s))for(let a=10;a-1&&(T_(e,i),Pl(t,i))}this._attachedToViewContainer=!1}M_(this._lView[1],this._lView)}onDestroy(e){Kb(this._lView[1],this._lView,null,e)}markForCheck(){q_(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Y_(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Qf(!0);try{Y_(n,e,t)}finally{Qf(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Od(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class fq extends _y{constructor(e){super(e),this._view=e}detectChanges(){rw(this._view)}checkNoChanges(){!function(n){Qf(!0);try{rw(n)}finally{Qf(!1)}}(this._view)}get context(){return null}}const gq=function(n){return function(n,e,t){if(ld(n)&&!t){const i=Bs(n.index,e);return new _y(i,i)}return 47&n.type?new _y(e[16],e):null}(ts(),Ft(),16==(16&n))};let is=(()=>{class n{}return n.__NG_ELEMENT_ID__=gq,n})();const yq=[new h2],bq=new ng([new c2]),wq=new ig(yq),Sq=function(){return Rw(ts(),Ft())};let Po=(()=>{class n{}return n.__NG_ELEMENT_ID__=Sq,n})();const xq=Po,Cq=class extends xq{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=Wh(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),qh(t,i,e),new _y(i)}};function Rw(n,e){return 4&n.type?new Cq(e,n,tg(n,e)):null}class Nc{}const Mq=function(){return y2(ts(),Ft())};let Ts=(()=>{class n{}return n.__NG_ELEMENT_ID__=Mq,n})();const Iq=Ts,m2=class extends Iq{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return tg(this._hostTNode,this._hostLView)}get injector(){return new Wo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Rh(this._hostTNode,this._hostLView);if(Mv(e)){const t=Ja(e,this._hostLView),i=pd(e);return new Wo(t[1].data[i+8],t)}return new Wo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=_2(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Nc,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Go(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new m2(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),idb});class V2 extends r2{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(pA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return j2(this.componentDef.inputs)}get outputs(){return j2(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,ag,r);return s!==ag||i===ag?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Jh,au),a=s.get(IT,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(or(n))return n.selectRootElement(e,t===Ht.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):A_(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?"http://www.w3.org/2000/svg":"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||db,clean:YA,playerHandler:e||null,flags:0}}(),g=Fp(0,null,null,1,0,null,null,null,null,null),_=Wh(null,g,p,f,null,null,o,l,a,s);let x,A;Th(_);try{const W=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Pd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(Bp(l,c,!0),null!==n&&(ip(r,n,c),null!==l.classes&&O_(r,n,l.classes),null!==l.styles&&Ib(r,n,l.styles)));const d=i.createRenderer(n,e),f=Wh(t,Pp(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(yc(js(l,t),o,e.type),nw(o,l),H_(l,t.length,1)),Lp(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)ip(l,d,["ng-version",l2.full]);else{const{attrs:G,classes:ge}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&O_(l,d,ge.join(" "))}if(A=Pm(g,20),void 0!==t){const G=A.projection=[];for(let ge=0;gel(o,e)),e.contentQueries){const l=ts();e.contentQueries(1,o,l.directiveStart)}const a=ts();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(uo(a.index),ew(t[1],a,0,a.directiveStart,a.directiveEnd,e),tw(e,o)),o}(W,this.componentDef,_,p,[R7]),qh(g,_,null)}finally{oi()}return new DK(this.componentType,x,tg(A,_),_,A)}}class DK extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new fq(r),this.componentType=e}get injector(){return new Wo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const lg=new Map;class OK extends Nc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new B2(this);const i=xo(e),r=function(n){return n[M1]||null}(e);r&&ET(r),this._bootstrapComponents=sl(i.bootstrap),this._r3Injector=lw(e,t,[{provide:Nc,useValue:this},{provide:fl,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Hn.THROW_IF_NOT_FOUND,i=yn.Default){return e===Hn||e===Nc||e===Bd?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class GT extends class{}{constructor(e){super(),this.moduleType=e,null!==xo(e)&&function(n){const e=new Set;!function t(i){const r=xo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${rt(e)} vs ${rt(e.name)}`)}(s,lg.get(s),i),lg.set(s,i));const o=sl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new OK(this.moduleType,e)}}function H2(n,e,t,i,r,s){const o=e+t;return go(n,o,r)?function(n,e,t){return n[e]=t}(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===Cn?void 0:t}(n,o+1)}function Ty(n,e,t){const i=n+20,r=Ft(),s=function(n,e){return n[e]}(r,i);return function(n,e){zl.isWrapped(e)&&(e=zl.unwrap(e),n[Ln.lFrame.bindingIndex]=Cn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?H2(r,function(){const n=Ln.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),e,s.transform,t,s):s.transform(t))}function $T(n){return e=>{setTimeout(n,void 0,e)}}const cn=class extends ee{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=$T(l),a&&(a=$T(a)),c&&(c=$T(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof S&&e.add(d),d}};function YK(){return this._results[jp()]()}class nf{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=jp(),i=nf.prototype;i[t]||(i[t]=YK)}get changes(){return this._changes||(this._changes=new cn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=qo(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=Dw,this.reject=Dw,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Ie(rf,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Ry=new Vt("AppId"),RY={provide:Ry,useFactory:function(){return`${iM()}${iM()}${iM()}`},deps:[]};function iM(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const mk=new Vt("Platform Initializer"),Pc=new Vt("Platform ID"),Bw=new Vt("appBootstrapListener");let jw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Tu=new Vt("LocaleId"),_k=new Vt("DefaultCurrencyCode");class NY{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const rM=function(n){return new GT(n)},PY=rM,FY=function(n){return Promise.resolve(rM(n))},yk=function(n){const e=rM(n),i=sl(xo(n).declarations).reduce((r,s)=>{const o=Di(s);return o&&r.push(new V2(o)),r},[]);return new NY(e,i)},LY=yk,kY=function(n){return Promise.resolve(yk(n))};let sf=(()=>{class n{constructor(){this.compileModuleSync=PY,this.compileModuleAsync=FY,this.compileModuleAndAllComponentsSync=LY,this.compileModuleAndAllComponentsAsync=kY}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const vk=new Vt("compilerOptions"),jY=(()=>Promise.resolve(0))();function sM(n){"undefined"==typeof Zone?jY.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class mn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new cn(!1),this.onMicrotaskEmpty=new cn(!1),this.onStable=new cn(!1),this.onError=new cn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=ti.requestAnimationFrame,e=ti.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(ti,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,aM(n),n.isCheckStableRunning=!0,oM(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),aM(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return bk(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),wk(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return bk(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),wk(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,aM(n),oM(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!mn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(mn.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,UY,Dw,Dw);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const UY={};function oM(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function aM(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function bk(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function wk(n){n._nesting--,oM(n)}class GY{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new cn,this.onMicrotaskEmpty=new cn,this.onStable=new cn,this.onError=new cn}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let lM=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{mn.assertNotInAngularZone(),sM(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())sM(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Ek=(()=>{class n{constructor(){this._applications=new Map,cM.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return cM.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class $Y{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let cM=new $Y,Sk=!0,xk=!1;function Da(){return xk=!0,Sk}let Kl;const Ck=new Vt("AllowMultipleToken");function Ak(n,e,t=[]){const i=`Platform: ${e}`,r=new Vt(i);return(s=[])=>{let o=dM();if(!o||o.injector.get(Ck,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Eu,useValue:"platform"});!function(n){if(Kl&&!Kl.destroyed&&!Kl.injector.get(Ck,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Kl=n.get(Tk);const e=n.get(mk,null);e&&e.forEach(t=>t())}(Hn.create({providers:a,name:i}))}return function(n){const e=dM();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function dM(){return Kl&&!Kl.destroyed?Kl:null}let Tk=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new GY:("zone.js"===n?void 0:n)||new mn({enableLongStackTrace:Da(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:mn,useValue:a}];return a.run(()=>{const c=Hn.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Zo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{hM(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return uy(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(ug);return p.runInitializers(),p.donePromise.then(()=>(ET(d.injector.get(Tu,xw)||xw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=Mk({},i);return function(n,e,t){const i=new GT(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(zd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${rt(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Mk(n,e){return Array.isArray(e)?e.reduce(Mk,n):Object.assign(Object.assign({},n),e)}let zd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new F(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new F(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{mn.assertNotInAngularZone(),sM(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{mn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Pn(a,l.pipe(ms()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof r2?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Nc),a=r.create(Hn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(lM,null),d=c&&a.injector.get(Ek);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),hM(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;hM(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Bw,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn),Ie(Hn),Ie(Zo),Ie(fl),Ie(ug))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function hM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const yX=Ak(null,"core",[{provide:Pc,useValue:"unknown"},{provide:Tk,deps:[Hn]},{provide:Ek,deps:[]},{provide:jw,deps:[]}]),SX=[{provide:zd,useClass:zd,deps:[mn,Hn,Zo,fl,ug]},{provide:AK,deps:[mn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:ug,useClass:ug,deps:[[new Yr,rf]]},{provide:sf,useClass:sf,deps:[]},RY,{provide:ng,useFactory:function(){return bq},deps:[]},{provide:ig,useFactory:function(){return wq},deps:[]},{provide:Tu,useFactory:function(n){return ET(n=n||"undefined"!=typeof $localize&&$localize.locale||xw),n},deps:[[new xd(Tu),new Yr,new il]]},{provide:_k,useValue:"USD"}];let CX=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(zd))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:SX}),n})(),Qw=null;function Fc(){return Qw}const ln=new Vt("DocumentToken");let lf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:xQ,token:n,providedIn:"platform"}),n})();function xQ(){return Ie(n3)}let n3=(()=>{class n extends lf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Fc().getBaseHref(this._doc)}onPopState(t){const i=Fc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Fc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){r3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){r3()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({factory:AQ,token:n,providedIn:"platform"}),n})();function r3(){return!!window.history.pushState}function AQ(){return new n3(Ie(ln))}function Du(n){return n&&"?"!==n[0]?"?"+n:n}let cf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:TQ,token:n,providedIn:"root"}),n})();function TQ(n){const e=Ie(ln).location;return new o3(Ie(lf),e&&e.origin||"")}const MM=new Vt("appBaseHref");let o3=(()=>{class n extends cf{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return function(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Du(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Du(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Du(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(lf),Ie(MM,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();var ds=(()=>((ds=ds||{})[ds.Zero=0]="Zero",ds[ds.One=1]="One",ds[ds.Two=2]="Two",ds[ds.Few=3]="Few",ds[ds.Many=4]="Many",ds[ds.Other=5]="Other",ds))();const kQ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=RL(e);if(t)return t;const i=e.split("-")[0];if(t=RL(i),t)return t;if("en"===i)return ZW;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[rn.PluralCase]};class aE{}let hZ=(()=>{class n extends aE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(kQ(i||this.locale)(t)){case ds.Zero:return"zero";case ds.One:return"one";case ds.Two:return"two";case ds.Few:return"few";case ds.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Tu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();let Ru=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new mZ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){y3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){y3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(Me(Ts),Me(Po))},n.\u0275dir=Lt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class mZ{constructor(){this.$implicit=null,this.ngIf=null}}function y3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class bZ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class wZ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const EZ=new wZ,SZ=new bZ;let cE=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(uy(t))return EZ;if(GF(t))return SZ;throw function(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${rt(n)}'`)}(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(Me(is,16))},n.\u0275pipe=Ls({name:"async",type:n,pure:!1}),n})(),Ws=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:[{provide:aE,useClass:hZ}]}),n})();const x3="browser";class UM extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){Qw||(Qw=n)}(new UM)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(By=By||document.querySelector("base"),By?By.getAttribute("href"):null);return null==t?null:function(n){uE=uE||document.createElement("a"),uE.setAttribute("href",n);const e=uE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){By=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}(document.cookie,e)}}let uE,By=null;const M3=new Vt("TRANSITION_ID"),KZ=[{provide:rf,useFactory:function(n,e,t){return()=>{t.get(ug).donePromise.then(()=>{const i=Fc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},ti.getAllAngularTestabilities=()=>e.getAllTestabilities(),ti.getAllAngularRootElements=()=>e.getAllRootElements(),ti.frameworkStabilizers||(ti.frameworkStabilizers=[]),ti.frameworkStabilizers.push(i=>{const r=ti.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Fc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let YZ=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const jy=new Vt("EventManagerPlugins");let hE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Vy=(()=>{class n extends I3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(R3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(R3))}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function R3(n){Fc().remove(n)}const GM={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},$M=/%COMP%/g;function fE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let pE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new WM(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Ht.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new uJ(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Ht.ShadowDom:return new dJ(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=fE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Ie(hE),Ie(Vy),Ie(Ry))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class WM{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(GM[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=GM[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=GM[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(Ro.DashCase|Ro.Important)?e.style.setProperty(t,i,r&Ro.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Ro.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,P3(i)):this.eventManager.addEventListener(e,t,P3(i))}}class uJ extends WM{constructor(e,t,i,r){super(e),this.component=i;const s=fE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace($M,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace($M,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class dJ extends WM{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=fE(r.id,r.styles,[]);for(let o=0;o{class n extends HM{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const k3=["alt","control","meta","shift"],vJ={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},B3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},bJ={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let wJ=(()=>{class n extends HM{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Fc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(k3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&B3.hasOwnProperty(e)&&(e=B3[e]))}return vJ[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),k3.forEach(s=>{s!=r&&bJ[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const DJ=Ak(yX,"browser",[{provide:Pc,useValue:x3},{provide:mk,useValue:function(){UM.makeCurrent(),zM.init()},multi:!0},{provide:ln,useFactory:function(){return function(n){Bi=n}(document),document},deps:[]}]),IJ=[[],{provide:Eu,useValue:"root"},{provide:Zo,useFactory:function(){return new Zo},deps:[]},{provide:jy,useClass:hJ,multi:!0,deps:[ln,mn,Pc]},{provide:jy,useClass:wJ,multi:!0,deps:[ln]},[],{provide:pE,useClass:pE,deps:[hE,Vy,Ry]},{provide:Jh,useExisting:pE},{provide:I3,useExisting:Vy},{provide:Vy,useClass:Vy,deps:[ln]},{provide:lM,useClass:lM,deps:[mn]},{provide:hE,useClass:hE,deps:[jy,mn]},{provide:class{},useClass:YZ,deps:[]},[]];let YM=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Ry,useValue:t.appId},{provide:M3,useExisting:Ry},KZ]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:IJ,imports:[Ws,CX]}),n})();"undefined"!=typeof window&&window;class BJ extends S{constructor(e,t){super()}schedule(e,t=0){return this}}class gE extends BJ{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let V3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Jl extends V3{constructor(e,t=V3.now){super(e,()=>Jl.delegate&&Jl.delegate!==this?Jl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Jl.delegate&&Jl.delegate!==this?Jl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const UJ=new class extends Jl{}(class extends gE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Lc=new F(n=>n.complete());function mE(n){return n?function(n){return new F(e=>n.schedule(()=>e.complete()))}(n):Lc}function an(...n){let e=n[n.length-1];return Te(e)?(n.pop(),Be(n,e)):Tn(n)}function gg(n,e){return new F(e?t=>e.schedule(HJ,0,{error:n,subscriber:t}):t=>t.error(n))}function HJ({error:n,subscriber:e}){e.error(n)}class ra{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return an(this.value);case"E":return gg(this.error);case"C":return mE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ra("N",e):ra.undefinedValueNotification}static createError(e){return new ra("E",void 0,e)}static createComplete(){return ra.completeNotification}}ra.completeNotification=new ra("C"),ra.undefinedValueNotification=new ra("N",void 0);class _E extends y{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(_E.dispatch,this.delay,new $J(e,this.destination)))}_next(e){this.scheduleMessage(ra.createNext(e))}_error(e){this.scheduleMessage(ra.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ra.createComplete()),this.unsubscribe()}}class $J{constructor(e,t){this.notification=e,this.destination=t}}class mg extends ee{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new WJ(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new U;if(this.isStopped||this.hasError?o=S.EMPTY:(this.observers.push(e),o=new ie(this,e)),r&&e.add(e=new _E(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class WJ{constructor(e,t){this.time=e,this.value=t}}function Ur(n,e){return"function"==typeof e?t=>t.pipe(Ur((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new qJ(n))}class qJ{constructor(e){this.project=e}call(e,t){return t.subscribe(new KJ(e,this.project))}}class KJ extends fe{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new wt(this),r=this.destination;r.add(i),this.innerSubscription=R(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const yE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return yE.schedule(n,0);if(void 0===window.requestAnimationFrame)return yE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let QM;function ree(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!QM){const t=Element.prototype;QM=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&QM.call(n,e)}(n,r)||(i=s,0))),i}class oee{constructor(e,t){this.componentFactory=t.get(fl).resolveComponentFactory(e)}create(e){return new aee(this.componentFactory,e)}}class aee{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new mg(1),this.events=this.eventEmitters.pipe(Ur(i=>Pn(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(mn),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=yE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Hn.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(me(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=yE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new Rm(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class lee extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const uee={initialConfig:{},parse:{},rename:{}};class dee{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},uee),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let hee=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new dee(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=Lt({type:n,features:[qi]}),n})();var ZM;const Uy={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(ZM=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==ZM?ZM:""},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function Ia(n,e,t,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function z3(n,e){return function(t,i){e(t,i,n)}}function ec(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function ir(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function $3(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function eD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||$3()}const W3="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",bE=eD();class mee{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function tD(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const q3={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function K3(n){return"string"==typeof n?q3[n.toUpperCase()]||q3.WHITE:n}function wE(n,e){if(!n)throw new Error(e||"Assertion failed")}const tc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},zy=tc.window||tc.self||tc.global,Y3=tc.process||{};function _g(){let n;if(bE&&zy.performance)n=zy.performance.now();else if(Y3.hrtime){const e=Y3.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const yg={debug:bE&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},See={enabled:!0,level:0};function yl(){}const X3={},Q3={once:!0};function xee(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let nD=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=W3,this._startTs=_g(),this._deltaTs=_g(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new mee("__probe-".concat(this.id,"__"),See),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((_g()-this._startTs).toPrecision(10))}getDelta(){return Number((_g()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){wE(t,i)}warn(t){return this._getLogFunction(0,t,yg.warn,arguments,Q3)}error(t){return this._getLogFunction(0,t,yg.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,yg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,yg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,yg.debug||yg.info,arguments,Q3)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||yl,r&&[r],{tag:xee(i)}):yl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?bE?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=tD(r,e,t);console.log(...s)},r.src=n,yl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...tD(n,e,t)),yl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...tD(r,e,t)),r.src=n.toDataURL(),yl}return yl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=tt(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):yl}({image:r,message:s,scale:o}):yl}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||yl)}group(t,i,r={collapsed:!1}){r=J3({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||yl)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Z3(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=J3({logLevel:t,message:i,args:s,opts:o}),wE(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=_g();const a=o.tag||o.message;if(o.once){if(X3[a])return yl;X3[a]=_g()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!bE&&"string"==typeof n&&(e&&(e=K3(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=K3(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return yl}}return n.VERSION=W3,n})();function Z3(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return wE(Number.isFinite(e)&&e>=0),e}function J3(n){const{logLevel:e,message:t}=n;n.logLevel=Z3(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return wE("string"===r||"object"===r),Object.assign(n,n.opts)}const Oi=new nD({id:"deck"}),Mi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mi,"IDENTITY",{get:()=>Oi.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},eB={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},un=new nD({id:"luma.gl"});function ko(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function EE(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function pi(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function SE(n){return ko(EE(n),"Invalid WebGLRenderingContext"),n}function Bo(n){return ko(pi(n),"Requires WebGL2"),n}var Sr=tt(761);const Hy={};const Gy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Sr.CO.console&&Sr.CO.console.log&&Sr.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};hf.prototype.VERTEX_ARRAY_BINDING_OES=34229,hf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;ipi(n)?void 0:0,$ee={3074:n=>pi(n)?void 0:36064,35723:n=>pi(n)?void 0:4352,35977:fr,32937:fr,36795:(n,e)=>{const t=pi(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(iB);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(iB);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:fr,35071:fr,37447:fr,36063:(n,e)=>{if(!pi(n)){const t=n.getExtension(nB);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:fr,35374:fr,35377:fr,34852:n=>{if(!pi(n)){const e=n.getExtension(nB);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(tB)?2147483647:65535,33001:n=>n.getExtension(tB)?16777216:65535,33e3:n=>16777216,37157:fr,35373:fr,35657:fr,36183:fr,37137:fr,34045:fr,35978:fr,35979:fr,35968:fr,35376:fr,35375:fr,35659:fr,37154:fr,35371:fr,35658:fr,35076:fr,35077:fr,35380:fr},rB="ANGLE_instanced_arrays",sB={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{ko(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[rB]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){ko(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{ko(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{ko(!1)},deleteQuery:()=>{ko(!1)},beginQuery:()=>{ko(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},iD={readBuffer:(n,e,t)=>{pi(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:pi(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!pi(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!pi(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=$ee[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function rte(n,{extension:e,target:t,target2:i}){const r=sB[e];ko(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new hf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&rte(n,{extension:t,target:n.luma,target2:n})}(n,sB),function(n,{target:e,target2:t}){Object.keys(iD).forEach(i=>{if("function"==typeof iD[i]){const r=n[i]?n[i].bind(n):()=>{},s=iD[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const rD={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},$d=(n,e,t)=>e?n.enable(t):n.disable(t),oB=(n,e,t)=>n.hint(t,e),Ra=(n,e,t)=>n.pixelStorei(t,e);function $y(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const ate={3042:$d,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:$d,2885:(n,e)=>n.cullFace(e),2929:$d,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:$d,35723:oB,36006:(n,e)=>{const t=pi(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:oB,2849:(n,e)=>n.lineWidth(e),32823:$d,32824:"polygonOffset",10752:"polygonOffset",35977:$d,32938:"sampleCoverage",32939:"sampleCoverage",3089:$d,3088:(n,e)=>n.scissor(...e),2960:$d,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:Ra,3317:Ra,37440:Ra,37441:Ra,37443:Ra,3330:Ra,3332:Ra,3331:Ra,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Ra,32878:Ra,3316:Ra,3315:Ra,32877:Ra,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=$y(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=$y(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=$y(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=$y(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=$y(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Qr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const lte={blendEquation:(n,e,t)=>n.blendEquationSeparate(Qr(32777,e,t),Qr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Qr(32969,e,t),Qr(32968,e,t),Qr(32971,e,t),Qr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Qr(32824,e,t),Qr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Qr(32938,e,t),Qr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Qr(2962,e,t),Qr(2967,e,t),Qr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Qr(34816,e,t),Qr(36003,e,t),Qr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Qr(2964,e,t),Qr(2965,e,t),Qr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Qr(34817,e,t),Qr(34818,e,t),Qr(34819,e,t))},aB={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Bc=(n,e)=>n.isEnabled(e),lB={3042:Bc,2884:Bc,2929:Bc,3024:Bc,32823:Bc,32926:Bc,32928:Bc,3089:Bc,2960:Bc,35977:Bc};function cB(n){for(const e in n)return!1;return!0}function cte(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||rD)){const r=e,s=lB[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=lB[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},rD),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){ko(this.stateStack.length>0),Ou(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){ko(void 0!==s);const o=e[s],a=this.cache[s];cte(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function dB(n,e={}){const{enable:t=!0,copyState:i}=e;if(ko(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new hte(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in aB)ute(n,o,aB[o]);uB(n,"getParameter"),uB(n,"isEnabled")}return n.state.enable=t,n}function hB(n){ko(n.state),n.state.pop()}function Ou(n,e){if(ko(EE(n),"setParameters requires a WebGL context"),cB(e))return;const t={};for(const r in e){const s=Number(r),o=ate[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)lte[r](n,e,i)}function nc(n,e,t){if(cB(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||dB(n,{copyState:!1}),n.state.push()}(n),Ou(n,e),i)r=t(n),hB(n);else try{r=t(n)}finally{hB(n)}return r}function vg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function sD(n,e,t=!0){return function(n,e,t,i,r){const s=fB(n[0],e,t);let o=pB(n[1],e,i,r),a=fB(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=pB(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,vg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function fB(n,e,t){return Math.min(Math.round(n*e),t-1)}function pB(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const oD=(0,Sr.jU)(),yte=oD&&"undefined"!=typeof document,gB={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function mB(n={}){ko(oD,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},gB,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(yte&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=aD(r,n),function(n){const e=pi(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);un.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function aD(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},gB,e);const{manageState:t,debug:i}=e;return t&&dB(n,{copyState:!1,log:(...r)=>un.log(1,...r)()}),oD&&i&&(Sr.CO.makeDebugContext?(n=Sr.CO.makeDebugContext(n,e),un.level=Math.max(un.level,1)):un.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function _B(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class yB{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=_B(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(_B()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class lD{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof yB?e:new yB(t,i)),this.stats[t]}}const Wy="8.5.7",ff=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new lD({id:e})),this.stats.get(e)}};if(Sr.CO.luma&&Sr.CO.luma.VERSION!==Wy)throw new Error(`luma.gl - multiple VERSIONs detected: ${Sr.CO.luma.VERSION} vs 8.5.7`);function tn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function cD(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return tn(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Wd(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Sr.CO.luma||((0,Sr.jU)()&&un.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Sr.CO.luma=Sr.CO.luma||{VERSION:Wy,version:Wy,log:un,stats:ff,globals:{modules:{},nodeIO:{}}});const uD={};function jc(n="id"){return uD[n]=uD[n]||1,`${n}-${uD[n]++}`}function vB(n){return tn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function bg(n){let e=!0;for(const t in n){e=!1;break}return e}function bB(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw un.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const wg="Resource subclass must define virtual methods";class Nu{constructor(e,t={}){SE(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||jc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){tn(e=cD(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=pi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=pi(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?Wd(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=Wd(this.gl,o[f]))}}return o}setParameter(e,t){tn(e=cD(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=pi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=cD(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return bB(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(wg)}_deleteHandle(){throw new Error(wg)}_bindHandle(e){throw new Error(wg)}_getOptsFromHandle(){throw new Error(wg)}_getParameter(e,t){throw new Error(wg)}_setParameter(e,t){throw new Error(wg)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=ff.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;ff.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=ff.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=ff.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function dD(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function qy(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function Ite({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return sa.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return sa.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=hD("Accessor",e,Ote)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const EB={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},Nte={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:EB},Pte={removedProps:EB};class rr extends Nu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/sa.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/sa.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=hD("Buffer",e,Nte),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=hD("Buffer",e,Pte))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new sa(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;tn(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Bo(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return Bo(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){Bo(this.gl);const s=qy(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return tn((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(tn(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){tn(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=dD(e);return tn(s),this.setAccessor(new sa(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){tn(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/qy(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new sa(this.accessor,{type:dD(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return un.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return un.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return un.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return un.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new sa(this.accessor,e),this}}const fD={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},SB={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},xB={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},kte=[9729,9728],CB=Sr.CO.WebGLBuffer||function(){};class Eg extends Nu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=fD[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=pi(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=fD[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=jc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(G=>this.initialize(Object.assign({},e,{pixels:G,data:G}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:x=!1,mipmaps:A=!0}=e;const{depth:W=0}=e;return({width:f,height:p,compressed:x,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:x,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=W,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),A&&this._isNPOT()&&(un.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),A=!1,this._updateForNPOT(l)),this.mipmaps=A,this.setImageData({data:t,width:f,height:p,depth:W,format:s,type:_,dataFormat:g,border:o,mipmaps:A,parameters:c,compressed:x}),A&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:x}=this;x.bindTexture(this.target,this.handle);let W,A=null;return({data:c,dataType:A}=this._getDataType({data:c,compressed:_})),nc(this.gl,l,()=>{switch(A){case"null":x.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":x.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":W=Bo(x),W.bindBuffer(35052,c.handle||c),W.texImage2D(t,r,s,f,p,o,g,d,a),W.bindBuffer(35052,null);break;case"browser-object":pi(x)?x.texImage2D(t,r,s,f,p,o,g,d,c):x.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[G,ge]of c.entries())x.compressedTexImage2D(t,G,ge.format,ge.width,ge.height,o,ge.data);break;default:tn(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(SB[this.dataFormat]||4)*(xB[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:x={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),tn(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const A=i;i=A.data,o=A.shape[0],a=A.shape[1]}i instanceof rr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),nc(this.gl,x,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof CB){const A=Bo(this.gl);A.bindBuffer(35052,i),A.texSubImage2D(e,l,r,s,o,a,f,d,g),A.bindBuffer(35052,null)}else pi(this.gl)?Bo(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return un.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof rr?{data:e.handle,dataType:"buffer"}:e instanceof CB?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=fD[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},tn(r,"Could not deduced texture size"),tn(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),tn(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:tn(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(pi(this.gl)||!this.width||!this.height||vB(this.width)&&vB(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===kte.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Bte(n,e){return tn("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class Oa extends Eg{static isSupported(e,t){return Eg.isSupported(e,t)}constructor(e,t={}){SE(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Bte(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const pf="EXT_color_buffer_float",AB={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:pf,bpp:2},33327:{gl2:pf,bpp:4},34842:{gl2:pf,bpp:8},33326:{gl2:pf,bpp:4},33328:{gl2:pf,bpp:8},34836:{gl2:pf,bpp:16},35898:{gl2:pf,bpp:4}};class Sg extends Nu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=pi(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,AB)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return tn(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&pi(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*AB[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const RB="clear: bad arguments";function gD(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),tn(0!==o,RB),nc(n,s,()=>{n.clear(o)})}function OB(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function ni(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){OB(s,i,r,o,a,"next",l)}function a(l){OB(s,i,r,o,a,"throw",l)}o(void 0)})}}const mD=[34069,34070,34071,34072,34073,34074];let $te=(()=>{class n extends Eg{constructor(t,i={}){SE(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return ni(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(mD.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),mD.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&un.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((x,A)=>{t&&i?d.texImage2D(g,A,a,t,i,o,a,l,x):d.texImage2D(g,A,a,a,l,x)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=mD,n})();class Wte extends Eg{static isSupported(e){return pi(e)}constructor(e,t={}){Bo(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),nc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof rr&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(SB[this.dataFormat]||4)*(xB[this.type]||1),"Texture"),this.loaded=!0,this}}function Kte(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Is(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function xE(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof Is?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Kte(n),deleteFramebuffer:!0}}(n);tn(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),tn(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(qy(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return tn(!1),0}}(t))}(o,c,r,a,l),c=c||dD(o);const x=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,x||null),f&&d.delete(),o}function _D(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=xE(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Ite({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return tn(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&un.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){tn(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof Sg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(Is.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&gD(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Bo(n),nc(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:tn(!1,RB)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return un.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return un.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return un.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return un.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return un.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return un.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=Bo(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=Wd(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?Wd(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?Wd(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(_D(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>un.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=_D(this,{targetMaxHeight:100});return un.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new Oa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new Sg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new Sg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&tn(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof Sg?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:Bo(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:tn(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return pi(n)?n:null}(this.gl);t?t.readBuffer(e):tn(36064===e||1029===e,NB),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Bo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):tn(1===e.length&&(36064===e[0]||1029===e[0]),NB)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in PB)void 0===n.luma.caps[e]&&(n.luma.caps[e]=LB(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Is.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const PB={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new Oa(n,{format:6408,type:5126,dataFormat:6408}),t=new Is(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function yD(n,e){return FB(n,e)}function FB(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>LB(n,t))}function LB(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=PB[e];let i;tn(t,e);const r=pi(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:tn(!1);return i}(n,e)),n.luma.caps[e]||un.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class vD{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},one=(Math,1/180*Math.PI),xr={};function lne(n,{precision:e=xr.precision||4}={}){return n=function(n){return Math.round(n/xr.EPSILON)*xr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function qd(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Pu(n,e,t){if(qd(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*one,void 0)}(n)}function gf(n,e,t){return Pu(n,i=>Math.max(e,Math.min(t,i)))}function CE(n,e,t){return qd(n)?n.map((i,r)=>CE(i,e[r],t)):t*e+(1-t)*n}function Xy(n,e,t){const i=xr.EPSILON;t&&(xr.EPSILON=t);try{if(n===e)return!0;if(qd(n)&&qd(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+lne(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(KB.length=n.length,i=KB):i=qB,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function XB(n){return n&&n[Symbol.asyncIterator]}function xD(n,e=(()=>!0)){return Array.isArray(n)?QB(n,e,[]):e(n)?[n]:[]}function QB(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function ZB(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ht(ht(ht({},$ne[n.type]),e),n)):null}function JB(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function ej(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function tj(n){n.push(n.shift())}function AD(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function nj({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=AD(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const W=s;s=(G,ge)=>t._normalizeConstant(W(G,ge))}const _=p?(W,G)=>s(g,G):(W,G)=>s(g.subarray(W,W+a),G),x=n.getData({length:i}),A=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return CD({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===DE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=DE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=zne}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==DE}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const A=f*a+l;for(let W=0;Wd?c.set(ge,x):(e._normalizeValue(ge,W.target,0),Une({target:c,source:W.target,start:x,count:Ne}));x+=Ne*d}else e._normalizeValue(ge,c,x),x+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let MD={};function bo(n){Oi.level>0&&MD[n]&&MD[n].call(...arguments)}function Na(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const ij="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Kne=`#version 300 es\n${ij}`;function rj(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function sj(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Kne:e>300?`#version ${e}\n${ij}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Na(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class oj extends Nu{static isSupported(e){return pi(e)}constructor(e,t={}){Bo(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,bg(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,un.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof rr?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Zne{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof rr?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&tn(pi(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new oj(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],tn(i[s]instanceof rr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new rr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function aj(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const Jy="vs",tie={[Jy]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},IE="__LUMA_INJECT_DECLARATIONS__",lj=/void\s+main\s*\([^)]*\)\s*\{\n?/,cj=/}\n?[^{}]*$/,ID=[];function uj(n,e,t,i=!1){const r=e===Jy;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),ID.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(cj,l=>a+l));break;case"fs:#decl":r||(n=n.replace(IE,a));break;case"fs:#main-start":r||(n=n.replace(lj,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(cj,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(IE,""),i&&(n=n.replace(/\}\s*$/,s=>s+tie[e])),n}function RD(n){const e={};return Na(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const nie={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},RE="transform_uSize_",dj="transform_position";const uie={10241:9728,10240:9728,10242:33071,10243:33071};class hie{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${RE}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${RE}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=xE(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Na(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new rr(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new Is(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters(uie)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){tn(n instanceof Oa||n instanceof $te||n instanceof Wte);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const x=function(n,e){const t={},i=function(n){return rj(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${RE}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Na(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(x){const{updatedLine:A,inject:W}=x;f[g]=A,c=RD([c,W]),Object.assign(a,x.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=rj(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){tn(i);const p=`${RE}${t}`;c=RD([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${dj} = transform_getPos(${p});\n gl_Position = vec4(${dj}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=RD([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||sj({version:aj(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[nie].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const OD={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function pie(n){let e=hj(n);return"object"===e?n?"type"in n?Object.assign({},n,OD[n.type]):"value"in n?(e=hj(n.value),Object.assign({type:e},n,OD[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},OD[e])}function hj(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class ND{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Na("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=pie(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Na(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Na(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function yie(n){return function(n){const e={},t={};return PD({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(pj(n))}function PD({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof ND||(Na("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Na(t.name,"shader module has no name"),(t=new ND(t)).dependencies=pj(t.dependencies)),t))}const FD={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},mf={};function Aie(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(FD).forEach(n=>{mf[n]=n});const LD={};function gj(n,e,t={}){const i=FD[e];if(Na(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in LD)return LD[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),LD[e]=l,l}function OE(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=FD[e];Na(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Na(!1===r||!0===r),r}(n,t))}function Cg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const mj=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],Iie=[...mj,[Cg("attribute"),"in $1"],[Cg("varying"),"out $1"]],Rie=[...mj,[Cg("varying"),"in $1"]],_j=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Oie=[..._j,[Cg("in"),"attribute $1"],[Cg("out"),"varying $1"]],Nie=[..._j,[Cg("in"),"varying $1"]],kD="gl_FragColor",BD=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Pie=/void\s+main\s*\([^)]*\)\s*\{\n?/;function NE(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Bie=`\n\n${IE}\n\n`,yj={[Jy]:"vertex",fs:"fragment"};function vj(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Na("string"==typeof t,"shader source must be a string");const f=i===Jy,p=t.split("\n");let g=100,_="",x=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],x=p.slice(1).join("\n")):_=`#version ${g}`;const A={};r.forEach($e=>{Object.assign(A,$e.getDefines())}),Object.assign(A,s);let W=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${yj[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${yj[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:Aie(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return OE(n,mf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),OE(n,mf.GLSL_DERIVATIVES)&&gj(n,mf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),OE(n,mf.GLSL_FRAG_DATA)&&gj(n,mf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),OE(n,mf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(A)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const G=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),ge={},Ne={},Ge={};for(const $e in a){const at="string"==typeof a[$e]?{injection:a[$e],order:0}:a[$e],St=$e.match(/^(v|f)s:(#)?([\w-]+)$/);if(St){const Pt=St[3];St[2]?"decl"===Pt?Ne[$e]=[at]:Ge[$e]=[at]:ge[$e]=[at]}else Ge[$e]=[at]}for(const $e of r){d&&$e.checkDeprecations(x,d),W+=$e.getModuleSource(i,g);const St=$e.injections[i];for(const Rt in St){const Pt=Rt.match(/^(v|f)s:#([\w-]+)$/);if(Pt){const Zt="decl"===Pt[2]?Ne:Ge;Zt[Rt]=Zt[Rt]||[],Zt[Rt].push(St[Rt])}else ge[Rt]=ge[Rt]||[],ge[Rt].push(St[Rt])}}return W+=Bie,W=uj(W,i,Ne),W+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(G[i],ge),W+=x,W=uj(W,i,Ge),W=function(n,e,t){switch(e){case 300:return t?NE(n,Iie):function(n){const e=(n=NE(n,Rie)).match(BD);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${kD}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(Pie,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${kD}\\b`,"g"),t)}return n}(n);case 100:return t?NE(n,Oie):function(n){const e=(n=NE(n,Nie)).match(BD);if(e){const t=e[1];n=n.replace(BD,"").replace(new RegExp(`\\b${t}\\b`,"g"),kD)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(W,l?100:g,f),W}function Uie(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const qie={5126:Cr.bind(null,"uniform1fv",Pa,1,wo),35664:Cr.bind(null,"uniform2fv",Pa,2,wo),35665:Cr.bind(null,"uniform3fv",Pa,3,wo),35666:Cr.bind(null,"uniform4fv",Pa,4,wo),5124:Cr.bind(null,"uniform1iv",Kd,1,wo),35667:Cr.bind(null,"uniform2iv",Kd,2,wo),35668:Cr.bind(null,"uniform3iv",Kd,3,wo),35669:Cr.bind(null,"uniform4iv",Kd,4,wo),35670:Cr.bind(null,"uniform1iv",Kd,1,wo),35671:Cr.bind(null,"uniform2iv",Kd,2,wo),35672:Cr.bind(null,"uniform3iv",Kd,3,wo),35673:Cr.bind(null,"uniform4iv",Kd,4,wo),35674:Cr.bind(null,"uniformMatrix2fv",Pa,4,Lu),35675:Cr.bind(null,"uniformMatrix3fv",Pa,9,Lu),35676:Cr.bind(null,"uniformMatrix4fv",Pa,16,Lu),35678:no,35680:no,5125:Cr.bind(null,"uniform1uiv",PE,1,wo),36294:Cr.bind(null,"uniform2uiv",PE,2,wo),36295:Cr.bind(null,"uniform3uiv",PE,3,wo),36296:Cr.bind(null,"uniform4uiv",PE,4,wo),35685:Cr.bind(null,"uniformMatrix2x3fv",Pa,6,Lu),35686:Cr.bind(null,"uniformMatrix2x4fv",Pa,8,Lu),35687:Cr.bind(null,"uniformMatrix3x2fv",Pa,6,Lu),35688:Cr.bind(null,"uniformMatrix3x4fv",Pa,12,Lu),35689:Cr.bind(null,"uniformMatrix4x2fv",Pa,8,Lu),35690:Cr.bind(null,"uniformMatrix4x3fv",Pa,12,Lu),35678:no,35680:no,35679:no,35682:no,36289:no,36292:no,36293:no,36298:no,36299:no,36300:no,36303:no,36306:no,36307:no,36308:no,36311:no},Kie={},Yie={},Xie={},bj=[0];function jD(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(bj[0]=n,n=bj);const r=n.length;if(r%e&&un.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Cr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{tn(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return xj(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:Sj(s,c),warnings:Sj(o,c)}}(i,this.source,this.shaderType,this.id);throw un.error(`GLSL compilation errors in ${r}\n${s}`)(),un.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class VD extends e0{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class UD extends e0{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Rs=5126,t0=5124,n0=5125,zD={[Rs]:[Rs,1,"float"],35664:[Rs,2,"vec2"],35665:[Rs,3,"vec3"],35666:[Rs,4,"vec4"],[t0]:[t0,1,"int"],35667:[t0,2,"ivec2"],35668:[t0,3,"ivec3"],35669:[t0,4,"ivec4"],[n0]:[n0,1,"uint"],36294:[n0,2,"uvec2"],36295:[n0,3,"uvec3"],36296:[n0,4,"uvec4"],35670:[Rs,1,"bool"],35671:[Rs,2,"bvec2"],35672:[Rs,3,"bvec3"],35673:[Rs,4,"bvec4"],35674:[Rs,8,"mat2"],35685:[Rs,8,"mat2x3"],35686:[Rs,8,"mat2x4"],35675:[Rs,12,"mat3"],35687:[Rs,12,"mat3x2"],35688:[Rs,12,"mat3x4"],35676:[Rs,16,"mat4"],35689:[Rs,16,"mat4x2"],35690:[Rs,16,"mat4x3"]};function Ij(n){const e=zD[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function Rj(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Rs}for(const t in zD){const[i,r,s]=zD[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class Pre{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!pi(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=Ij(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new sa(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=Ij(i),l={location:e,name:t,accessor:new sa({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Fre=35981,Lre=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class Nj extends Nu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Lre),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=Fre}=e;return this.hash=t||"",this.vs="string"==typeof i?new VD(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new UD(this.gl,{id:`${e.id}-fs`,source:r}):r,tn(this.vs instanceof VD),tn(this.fs instanceof UD),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Bo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Pre(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:x,samplers:A}){if((x||A)&&(un.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(x||{})),un.priority>=e){const W=g?g.id:"default",G=`mode=${Wd(this.gl,t)} verts=${i} instances=${c} indexType=${Wd(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${W}`;un.log(e,G)()}return tn(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const W=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return tn(!1),0}}(t);p.begin(W)}this._bindTextures(),nc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&pi(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){un.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Jie(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof Is&&(s=s.texture),s instanceof Eg)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&ere(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new VD({handle:r});break;case 35632:i.fs=new UD({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=jc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),un.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),un.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||un.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(ge=>this._getHash(ge.name)).sort(),g=o.map(ge=>this._getHash(ge)),_=Object.keys(r).sort(),x=Object.keys(s).sort(),A=[],W=[];for(const ge of _)A.push(this._getHash(ge)),A.push(this._getHash(r[ge]));for(const ge of x)W.push(this._getHash(ge)),W.push(this._getHash(s[ge]));const G=`${d}/${f}D${A.join("/")}M${p.join("/")}I${W.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[G]){const ge=function(n,e){const{vs:t,fs:i}=e,r=yie(e.modules||[]);return{gl:n,vs:vj(n,Object.assign({},e,{source:t,type:Jy,modules:r})),fs:vj(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Uie(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[G]=new Nj(this.gl,{hash:G,vs:ge.vs,fs:ge.fs,varyings:o,bufferMode:a}),this._getUniforms[G]=ge.getUniforms||(Ne=>{}),this._useCounts[G]=0}return this._useCounts[G]++,this._programCache[G]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":zy.chrome?"Chrome":zy.safari?"Safari":zy.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Fa(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Fa.MAX_ATTRIBUTES=Fa.MAX_ATTRIBUTES||e.getParameter(34921),Fa.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Fa._setConstantFloatArray(e,t,i);break;case Int32Array:Fa._setConstantIntArray(e,t,i);break;case Uint32Array:Fa._setConstantUintArray(e,t,i);break;default:tn(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Fa.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return tn(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(tn(pi(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Fa.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new rr(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!kE||kE.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Hre=/^(.+)__LOCATION_([0-9]+)$/,Gre=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class $re{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Fa(e),bB(this,"VertexArray","v6.0",Gre),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new rr(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,un.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=sa.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return tn(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Hre.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof rr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof rr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof rr))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof rr){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return un.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function s0(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=s0(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function Pj(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof rr){const p=e,{data:g,changed:_}=p.getDebugData();let x;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?x=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${Wd(r,s)})`:(c=!0,x=`${l} bytes`),{[i]:`${d}${s0(f,{size:o,isInteger:c})}`,"Format ":x}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${s0(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Kre(n,e){const{type:t,size:i}=e,r=Rj(t,i);return r?`${n} (${r.name})`:n}function Fj({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){tn(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:s0(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function HD({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?s0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function Lj(n){const{type:e,size:t}=n.accessor,i=Rj(e,t);return i?`${i.name} ${n.name}`:n.name}const Qre={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Jre(n,e){const{attributeMap:t=Qre}=e||{};return t&&t[n]||n}function ese(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}tn(Number.isFinite(e.size),`attribute ${n} needs size`)}const kj=()=>{},ise={};class BE{constructor(e,t={}){const{id:i=jc("model")}=t;tn(EE(e)),this.id=i,this.gl=e,this.id=t.id||jc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||r0.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},tn(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return tn(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return tn(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Jre(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ht({},o);delete c.value,i[a]=[new rr(n,l),c],ese(s,c)}}if(r){const s=r.value||r;tn(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new rr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(bg(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return gD(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),un.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&un.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:x,instanceCount:A}=this,{onBeforeRender:W=kj,onAfterRender:G=kj}=this.props;W(),this.program.setUniforms(this.uniforms);const ge=this.program.draw(Object.assign(ise,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:x,instanceCount:A,offset:f?g:0}));return G(),un.priority>=2&&this._logDrawCallEnd(c,l,i),ge}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return un.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}tn(t instanceof Nj,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new $re(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof rr&&t.delete()}}_setAnimationProps(e){this.animated&&tn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(bg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new oj(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:un.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=Pj(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Kre(s.name,a)}`),t[o]=Pj(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=Fj({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=Fj({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&un.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&un.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${Lj(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${Lj(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);un.table(e,s)(),un.table(e,o)(),un.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),un.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class GD{static isSupported(e){return pi(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();tn(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new BE(t,Object.assign({},e,{fs:e.fs||sj({version:aj(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(bg(n.feedbackBuffers)&&bg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Zne(e,t)),function(n){return!(bg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new hie(e,t)),tn(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function jE(){}const ose={onStart:jE,onUpdate:jE,onInterrupt:jE,onEnd:jE};class o0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ht(ht({},ose),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const pse={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new o0(i),this.attribute=t,this.attributeInTransition=new TD(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=ej(e.size);return new GD(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new rr(e,r),new rr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;tj(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)nj(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=AD(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:JB(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new o0(i),this.attribute=t,this.attributeInTransition=new TD(e,Un(ht({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new Oa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new Is(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=ej(e.size);return new GD(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new rr(e,r),new rr(e,r),new rr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)nj(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=AD(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:JB(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),tj(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),xE(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class gse{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=GD.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Oi.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=pse[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Oi.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const Bj="attributeManager.invalidate";class wse{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new gse(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;bo("attribute.updateStart",t),t.allocate(i)&&bo("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,bo("attribute.updateEnd",t,i))}}function Vj(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function Uj(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=ZB(r)))return;const o=Cse[r.type];if(!o)return void Oi.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Un(ht({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const VE={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:Tse}=VE;function Ise(n,e){if(!n.transitions)return null;const t={},i=WD(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&$D(n[r],e[r],s)&&(t[r]=!0)}return t}function zj({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=$D(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=$D(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function $D(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function Nse(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!jse(i[r],e[r])){t=n(i),e=i;break}return t}}function Vse(n,e){if(!e)return n;const t=ht(ht({},n),e);if("defines"in e&&(t.defines=ht(ht({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=ht({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function zE(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],x=e[13],A=e[14],W=e[15],G=t*a-i*o,ge=t*l-r*o,Ne=t*c-s*o,Ge=i*l-r*a,$e=i*c-s*a,at=r*c-s*l,St=d*x-f*_,Rt=d*A-p*_,Pt=d*W-g*_,Xt=f*A-p*x,Zt=f*W-g*x,bt=p*W-g*A,Ct=G*bt-ge*Zt+Ne*Xt+Ge*Pt-$e*Rt+at*St;return Ct?(n[0]=(a*bt-l*Zt+c*Xt)*(Ct=1/Ct),n[1]=(r*Zt-i*bt-s*Xt)*Ct,n[2]=(x*at-A*$e+W*Ge)*Ct,n[3]=(p*$e-f*at-g*Ge)*Ct,n[4]=(l*Pt-o*bt-c*Rt)*Ct,n[5]=(t*bt-r*Pt+s*Rt)*Ct,n[6]=(A*Ne-_*at-W*ge)*Ct,n[7]=(d*at-p*Ne+g*ge)*Ct,n[8]=(o*Zt-a*Pt+c*St)*Ct,n[9]=(i*Pt-t*Zt-s*St)*Ct,n[10]=(_*$e-x*Ne+W*G)*Ct,n[11]=(f*Ne-d*$e-g*G)*Ct,n[12]=(a*Rt-o*Xt-l*St)*Ct,n[13]=(t*Xt-i*Rt+r*St)*Ct,n[14]=(x*ge-_*Ge-A*G)*Ct,n[15]=(d*Ge-f*ge+p*G)*Ct,n):null}function Vc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],x=e[12],A=e[13],W=e[14],G=e[15],ge=t[0],Ne=t[1],Ge=t[2],$e=t[3];return n[0]=ge*i+Ne*a+Ge*f+$e*x,n[1]=ge*r+Ne*l+Ge*p+$e*A,n[2]=ge*s+Ne*c+Ge*g+$e*W,n[3]=ge*o+Ne*d+Ge*_+$e*G,n[4]=(ge=t[4])*i+(Ne=t[5])*a+(Ge=t[6])*f+($e=t[7])*x,n[5]=ge*r+Ne*l+Ge*p+$e*A,n[6]=ge*s+Ne*c+Ge*g+$e*W,n[7]=ge*o+Ne*d+Ge*_+$e*G,n[8]=(ge=t[8])*i+(Ne=t[9])*a+(Ge=t[10])*f+($e=t[11])*x,n[9]=ge*r+Ne*l+Ge*p+$e*A,n[10]=ge*s+Ne*c+Ge*g+$e*W,n[11]=ge*o+Ne*d+Ge*_+$e*G,n[12]=(ge=t[12])*i+(Ne=t[13])*a+(Ge=t[14])*f+($e=t[15])*x,n[13]=ge*r+Ne*l+Ge*p+$e*A,n[14]=ge*s+Ne*c+Ge*g+$e*W,n[15]=ge*o+Ne*d+Ge*_+$e*G,n}function a0(n,e,t){var o,a,l,c,d,f,p,g,_,x,A,W,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],x=e[9],A=e[10],W=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=x,n[10]=A,n[11]=W,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+x*s+e[13],n[14]=l*i+p*r+A*s+e[14],n[15]=c*i+g*r+W*s+e[15]),n}function l0(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function Gj(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function $j(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function Wj(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function qj(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],x=n[13],A=n[14],W=n[15],G=e[0],ge=e[1],Ne=e[2],Ge=e[3],$e=e[4],at=e[5],St=e[6],Rt=e[7],Pt=e[8],Xt=e[9],Zt=e[10],bt=e[11],Ct=e[12],Ut=e[13],ft=e[14],Wt=e[15];return Math.abs(t-G)<=gr*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(i-ge)<=gr*Math.max(1,Math.abs(i),Math.abs(ge))&&Math.abs(r-Ne)<=gr*Math.max(1,Math.abs(r),Math.abs(Ne))&&Math.abs(s-Ge)<=gr*Math.max(1,Math.abs(s),Math.abs(Ge))&&Math.abs(o-$e)<=gr*Math.max(1,Math.abs(o),Math.abs($e))&&Math.abs(a-at)<=gr*Math.max(1,Math.abs(a),Math.abs(at))&&Math.abs(l-St)<=gr*Math.max(1,Math.abs(l),Math.abs(St))&&Math.abs(c-Rt)<=gr*Math.max(1,Math.abs(c),Math.abs(Rt))&&Math.abs(d-Pt)<=gr*Math.max(1,Math.abs(d),Math.abs(Pt))&&Math.abs(f-Xt)<=gr*Math.max(1,Math.abs(f),Math.abs(Xt))&&Math.abs(p-Zt)<=gr*Math.max(1,Math.abs(p),Math.abs(Zt))&&Math.abs(g-bt)<=gr*Math.max(1,Math.abs(g),Math.abs(bt))&&Math.abs(_-Ct)<=gr*Math.max(1,Math.abs(_),Math.abs(Ct))&&Math.abs(x-Ut)<=gr*Math.max(1,Math.abs(x),Math.abs(Ut))&&Math.abs(A-ft)<=gr*Math.max(1,Math.abs(A),Math.abs(ft))&&Math.abs(W-Wt)<=gr*Math.max(1,Math.abs(W),Math.abs(Wt))}function Kj(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function HE(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new oa(4);oa!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const Yj=[0,0,0,0],hoe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],foe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],poe=[0,0,0],goe=[0,0,0],moe=UE(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=Yj,l=Yj,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=Xj(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=HE([],l,o),s=i||s,o=Vc([],r,s),o=Vc([],o,hoe)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:poe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Mi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Mi.LNGLAT:case Mi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Mi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function Xj(n,e,t=goe){let r,i=t,s=!0;switch(r=e===Mi.LNGLAT_OFFSETS||e===Mi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case kc.WEB_MERCATOR:(e===Mi.LNGLAT||e===Mi.CARTESIAN)&&(s=!1);break;case kc.WEB_MERCATOR_AUTO_OFFSET:e===Mi.LNGLAT?i=r:e===Mi.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case kc.IDENTITY:i=n.position.map(Math.fround);break;case kc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class boe extends bD{get ELEMENTS(){return Fu(!1),0}get RANK(){return Fu(!1),0}toString(){let e="[";if(xr.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new $n).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return Wj(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],x=n[14],A=n[15];return(e*o-t*s)*(f*A-p*x)-(e*a-i*s)*(d*A-p*_)+(e*l-r*s)*(d*x-f*_)+(t*a-i*o)*(c*A-p*g)-(t*l-r*o)*(c*x-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return zE(this,this),this.check()}multiplyLeft(e){return Vc(this,e,this),this.check()}multiplyRight(e){return Vc(this,this,e),this.check()}rotateX(e){return Gj(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return $j(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,x,A,W,G,ge,Ne,Ge,$e,at,St,Rt,Pt,Xt,Zt,bt,Ct,Ut,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*sc+rc)/(2*rc),512*(rc+Math.log(Math.tan(eV+e*sc*.5)))/(2*rc)]}function Yd([n,e]){const t=n/512*(2*rc)-rc,i=2*(Math.atan(Math.exp(e/512*(2*rc)-rc))-eV);return[t*YD,i*YD]}function $E({latitude:n,longitude:e,highPrecision:t=!1}){ku(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*sc),o=512/360,a=o/s,l=512/XD/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=sc*Math.tan(n*sc)/s,f=512/XD*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function nV(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=$E({longitude:t,latitude:i,highPrecision:!0}),d=Ng(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Yd(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function iV({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return a0(o,o,[0,0,-i]),Gj(o,o,-e*sc),$j(o,o,t*sc),l0(o,o,[r/=n,r,r]),s&&a0(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function rV({width:n,height:e,fovy:t=WE(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=WE(i));const a=.5*t*sc,l=sV(t),c=r*sc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function WE(n){return 2*Math.atan(.5/n)*YD}function sV(n){return.5/Math.tan(.5*n*sc)}function QD(n,e){const[t,i,r=0]=n;return ku(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Og(e,[t,i,r,1])}function _f(n,e,t=0){const[i,r,s]=n;if(ku(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Og(e,[i,r,s,1]);const o=Og(e,[i,r,0,1]),a=Og(e,[i,r,1,1]),l=o[2],c=a[2];return Qj([],o,a,l===c?0:((t||0)-l)/(c-l))}function oV({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:ku(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new qE({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],x=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ku(x[0]>0&&x[1]>0);const A=x[0]/_[0],W=x[1]/_[1],Ge=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/A,(g[1]+p[1])/2+(s.bottom-s.top)/2/W]),$e=Math.min(r,f.zoom+KD(Math.abs(Math.min(A,W))));return ku(Number.isFinite($e)),{longitude:Ge[0],latitude:Ge[1],zoom:$e}}const aV=Math.PI/180;function lV(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*aV:Math.atan(.5/n.altitude))>(90-n.pitch)*aV-.01?(l=cV(n,0,e),c=cV(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function cV(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Og(i,[e,0,1,1]),s=Og(i,[e,n.height,1,1]),c=Yd(Qj([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class qE{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=WE(l=1.5):null===c?c=WE(l):null===l&&(l=sV(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=$E({longitude:r,latitude:i}),x=Ng([r,i]);x[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(x,x,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=rV({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return Wj([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=iV({height:t,scale:g,center:x,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=x,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Vc(s,s,i),Vc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l0(o,o,[e/2,-t/2,1]),a0(o,o,[1,-1,0]),Vc(o,o,s);const a=zE([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof qE&&e.width===this.width&&e.height===this.height&&qj(e.projectionMatrix,this.projectionMatrix)&&qj(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=QD(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=_f([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Ng(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=Yd(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Ng(e)}unprojectFlat(e){return Yd(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=_f(t,this.pixelUnprojectionMatrix),s=Ig([],Ng(e),qD([],i));return Yd(Ig([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=oV(Object.assign({width:i,height:r,bounds:e},t));return new qE({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return lV(this,e.z||0)}}const Ooe=Math.PI/180,Noe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZD=[0,0,0],Foe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Pg=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?kc.WEB_MERCATOR:kc.WEB_MERCATOR_AUTO_OFFSET:kc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Xy(t.projectionMatrix,this.projectionMatrix)&&Xy(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=QD(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=_f([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Ng(t):t}unprojectFlat(t){return this.isGeospatial?Yd(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?$E({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends Pg{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:x=1.5}=t;const A=Math.pow(2,s);g=g||1,_=_||1,x=Math.max(.75,x);const{fov:W,aspect:G,focalDistance:ge,near:Ne,far:Ge}=rV({width:g,height:_,pitch:o,altitude:x,nearZMultiplier:l,farZMultiplier:c});let $e=iV({height:_,pitch:o,bearing:a,scale:A,altitude:x});p&&($e=(new $n).translate([512*p,0,0]).multiplyLeft($e)),super(Un(ht({},t),{width:g,height:_,viewMatrix:$e,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:W,aspect:G,focalDistance:ge,near:Ne,far:Ge})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=x,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(Un(ht({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return nV(t,i)}panByPosition(t,i){const r=_f(i,this.pixelUnprojectionMatrix),o=Ig([],this.projectFlat(t),qD([],r)),a=Ig([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=lV(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=oV(ht({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function JD(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof pV){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function gV(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=HE([],[o,a,l,1],t)),i){case Mi.LNGLAT:return JD([o,a,l],e,s);case Mi.LNGLAT_OFFSETS:return JD([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mi.METER_OFFSETS:return JD(nV(r,[o,a,l]),e,s);case Mi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Boe={10241:9987,10240:9729,10242:33071,10243:33071},eI={},Uoe={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||d0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tI(n,e)},accessor:{validate(n,e){const t=KE(n);return"function"===t||t===KE(e.value)},equal:(n,e,t)=>"function"==typeof e||tI(n,e)},array:{validate:(n,e)=>e.optional&&!n||d0(n),equal:(n,e,t)=>t.compare?tI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof Oa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new Oa(t,Un(ht({},e),{parameters:ht(ht(ht({},Boe),i),n.props.textureParameters)}));return eI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof Oa)||eI[n.id]&&(n.delete(),delete eI[n.id])}(n)}}};function tI(n,e){if(n===e)return!0;if(!d0(n)||!d0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=eae,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Zoe]||{},i=e[Qoe]||e,r=e[Joe]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(XB(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return ni(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=iI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const A=_,{dataTransform:W}=i.component?i.component.props:{};a=W?W(A,a):a.concat(A),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(A){d=!0,f=A}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const x=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;x&&x(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:vV,ASYNC_RESOLVED:bV,ASYNC_DEFAULTS:tae}=VE,nae={};let iae=0,rae=(()=>{class n{constructor(){this.props=Goe.apply(this,arguments),this.id=this.props.id,this.count=iae++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[tae])s in i[bV]?r[s]=i[bV][s]:s in i[vV]&&(r[s]=i[vV][s]);return new this.constructor(ht(ht(ht({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new yV({})}}return n.componentName="Component",n.defaultProps=nae,n})();class sae extends yV{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const oc=n=>"function"==typeof n,Xd=n=>null!==n&&"object"==typeof n,EV=n=>Xd(n)&&n.constructor==={}.constructor,oae=n=>n&&"function"==typeof n[Symbol.iterator],aae=n=>n&&"function"==typeof n[Symbol.asyncIterator],f0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Fg=n=>"undefined"!=typeof Blob&&n instanceof Blob,SV=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||Xd(n)&&oc(n.tee)&&oc(n.cancel)&&oc(n.getReader))(n)||(n=>Xd(n)&&oc(n.read)&&oc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function yf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sI(n){var e,t;let i;return yf(n,"null loader"),yf(rI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Un(ht({},n=n[0]),{options:ht(ht({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Uc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oI=Uc.global||Uc.self||Uc.window||{},fae="object"!=typeof process||"[object process]"!==String(process)||process.browser,xV="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);xV&&parseFloat(xV[1]);const lI={};function pae(n){for(const e in lI)n.startsWith(e)&&(n=n.replace(e,lI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const gae=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,mae=/^([-\w.]+\/[-\w.+]+)/;function _ae(n){const e=mae.exec(n);return e?e[1]:n}function CV(n){const e=gae.exec(n);return e?e[1]:""}const yae=/\?.*/;function ZE(n){if(f0(n)){const e=cI(n.url||"");return{url:e,type:_ae(n.headers.get("content-type")||"")||CV(e)}}return Fg(n)?{url:cI(n.name||""),type:n.type||""}:"string"==typeof n?{url:cI(n),type:CV(n)}:{url:"",type:""}}function vae(n){return f0(n)?n.headers["content-length"]||-1:Fg(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cI(n){return n.replace(yae,"")}function AV(n){return uI.apply(this,arguments)}function uI(){return(uI=ni(function*(n){if(f0(n))return n;const e={},t=vae(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=ZE(n);r&&(e["content-type"]=r);const s=yield Eae(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function bae(n){return dI.apply(this,arguments)}function dI(){return(dI=ni(function*(n){if(!n.ok){const e=yield wae(n);throw new Error(e)}})).apply(this,arguments)}function wae(n){return hI.apply(this,arguments)}function hI(){return(hI=ni(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function Eae(n){return fI.apply(this,arguments)}function fI(){return(fI=ni(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${Sae(n.slice(0,5))}`:null})).apply(this,arguments)}function Sae(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const DV={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Wn(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Aae={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function gI(){oI.loaders=oI.loaders||{};const{loaders:n}=oI;return n._state=n._state||{},n._state}const mI=()=>{const n=gI();return n.globalOptions=n.globalOptions||ht({},DV),n.globalOptions};function Tae(n,e,t,i){return t=t||[],function(n,e){RV(n,null,DV,Aae,e);for(const t of e)RV(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=ht({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new xae),NV(r,mI()),NV(r,e),r}(e,n,i)}function IV(n,e){const t=mI(),i=n||t;return"function"==typeof i.fetch?i.fetch:Xd(i.fetch)?r=>TV(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:TV}function RV(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&Xd(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)MV.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=Dae(a,r);MV.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function Dae(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function NV(n,e){for(const t in e)t in e&&(n[t]=EV(e[t])&&EV(n[t])?ht(ht({},n[t]),e[t]):e[t])}function zc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Oae(n,e="3.0.12"){return zc(n,"no worker provided"),!(!e||!n.version)}const Hc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Nae=Hc.global||Hc.self||Hc.window||{},_I="object"!=typeof process||"[object process]"!==String(process)||process.browser,yI="function"==typeof importScripts,Pae="undefined"!=typeof window&&void 0!==window.orientation,PV="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),vI=(PV&&parseFloat(PV[1]),new Map);function FV(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function LV(n,e=!0,t){const i=t||new Set;if(n)if(kV(n))i.add(n);else if(kV(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)LV(n[r],e,i);return void 0===t?Array.from(i):[]}function kV(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const bI=()=>{};class BV{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Wn(this,"name",void 0),Wn(this,"source",void 0),Wn(this,"url",void 0),Wn(this,"terminated",!1),Wn(this,"worker",void 0),Wn(this,"onMessage",void 0),Wn(this,"onError",void 0),Wn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;zc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bI,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bI,this.onError=bI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||LV(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){zc(n.source&&!n.url||!n.source&&n.url);let e=vI.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?FV(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),vI.set(n.url,e)),n.source&&(e=FV(n.source),vI.set(n.source,e))),zc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class Bae{constructor(e,t){Wn(this,"name",void 0),Wn(this,"workerThread",void 0),Wn(this,"isRunning",void 0),Wn(this,"result",void 0),Wn(this,"_resolve",void 0),Wn(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zc(this.isRunning),this.isRunning=!1,this._reject(e)}}class jae{constructor(e){Wn(this,"name","unnamed"),Wn(this,"source",void 0),Wn(this,"url",void 0),Wn(this,"maxConcurrency",1),Wn(this,"maxMobileConcurrency",1),Wn(this,"onDebug",()=>{}),Wn(this,"reuseWorkers",!0),Wn(this,"props",{}),Wn(this,"jobQueue",[]),Wn(this,"idleQueue",[]),Wn(this,"count",0),Wn(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=ht(ht({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return ni(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return ni(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new Bae(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class Bu{static isSupported(){return BV.isSupported()}static getWorkerFarm(e={}){return Bu._workerFarm=Bu._workerFarm||new Bu({}),Bu._workerFarm.setProps(e),Bu._workerFarm}constructor(e){Wn(this,"props",void 0),Wn(this,"workerPools",new Map),this.props=ht({},Vae),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ht(ht({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new jae({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function zae(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return zc(r),r}function Hae(n,e){return!!Bu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Gae(n,e,t,i,r){return wI.apply(this,arguments)}function wI(){return(wI=ni(function*(n,e,t,i,r){const s=n.id,o=zae(n,t),l=Bu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",$ae.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function $ae(n,e,t,i){return EI.apply(this,arguments)}function EI(){return(EI=ni(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}Wn(Bu,"_workerFarm",void 0);var VV=tt(521);function UV(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return VV.toArrayBuffer?VV.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Yae(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function zV(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Xae(n){return xI.apply(this,arguments)}function xI(){return(xI=ni(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Yae(...e)})).apply(this,arguments)}const Jae=262144;function HV(n){this.wrapped=n}function p0(n){return new HV(n)}function g0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof HV;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function AI(n){return function(){return new g0(n.apply(this,arguments))}}function TI(){return(TI=AI(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(II)}function ale(n,e,t){return RI.apply(this,arguments)}function RI(){return(RI=ni(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return ole(n,e);if(Fg(n)&&(n=yield AV(n)),f0(n)){const r=n;return yield bae(r),e.binary?yield r.arrayBuffer():yield r.text()}if(SV(n)&&(n=sle(n,t)),oae(n)||aae(n))return Xae(n);throw new Error(II)})).apply(this,arguments)}function cle(n,e,t=null){if(t)return t;const i=ht({fetch:IV(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function ule(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const $V=()=>{const n=gI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function WV(n){const e=$V();n=Array.isArray(n)?n:[n];for(const t of n){const i=sI(t);e.find(r=>i===r)||e.unshift(i)}}const hle=/\.([^.]+)$/;function fle(n){return PI.apply(this,arguments)}function PI(){return(PI=ni(function*(n,e=[],t,i){if(!KV(n))return null;let r=qV(n,e,Un(ht({},t),{nothrow:!0}),i);if(r)return r;if(Fg(n)&&(r=qV(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(YV(n));return r})).apply(this,arguments)}function qV(n,e=[],t,i){if(!KV(n))return null;if(e&&!Array.isArray(e))return sI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...$V()),function(n){for(const e of n)sI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=ZE(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=FI(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&hle.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||FI(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(vle(e,t))return t}else if(ArrayBuffer.isView(e)){if(XV(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&XV(e,0,t))return t;return null}(e,n),a=a||FI(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(YV(n));return s}function KV(n){return!(n instanceof Response&&204===n.status)}function YV(n){const{url:e,type:t}=ZE(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?LI(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?LI(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function FI(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function vle(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function XV(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Gc=new Uint8ClampedArray(0);const Ile={data:{type:"data",value:Mle,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=Un(ht({},r),{fetch:Un(ht({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:eS(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):eS(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mi.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let VI=(()=>{class n extends rae{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=gV(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=QD(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=ht({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Mi.DEFAULT&&(t=i.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=Xj(t,i,r),f=gV(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mi.DEFAULT||t===Mi.LNGLAT||t===Mi.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){ic(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=Vse(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!Dle({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Gc.length/3);if(this.internalState.usesPickingColorCache=!0,rQV&&Oi.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Gc=Yy.allocate(Gc,i,{size:3,copy:!0,maxCount:Math.max(i,QV)});const s=Math.floor(Gc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&bo("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=zj({newProps:n,oldProps:e,propTypes:WD(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&Hj(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&Hj(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Nse(n,e),transitionsChanged:Ise(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=WD(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new wse(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){ic(!this.internalState&&!this.state),ic(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new sae({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Oi.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new Ase(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){bo("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=Ile,n})(),Ole=(()=>{class n extends VI{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:A,fetch:W,_subLayerProps:G}=this.props,ge={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:A,fetch:W},Ne=G&&G[t.id],Ge=Ne&&Ne.updateTriggers,$e=t.id||"sublayer";if(Ne){const at=this.constructor._propTypes,St=t.type?t.type._propTypes:{};for(const Rt in Ne){const Pt=St[Rt]||at[Rt];Pt&&"accessor"===Pt.type&&(Ne[Rt]=this.getSubLayerAccessor(Ne[Rt]))}}Object.assign(ge,t,Ne),ge.id="".concat(this.props.id,"-").concat($e),ge.updateTriggers=ht(ht({all:this.props.updateTriggers.all},t.updateTriggers),Ge);for(const at of A){const St=at.getSubLayerProps.call(this,at);St&&Object.assign(ge,St,{updateTriggers:Object.assign(ge.updateTriggers,St.updateTriggers)})}return ge}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=xD(t,Boolean),this.internalState.subLayers=t),bo("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Nle=/([0-9]+\.?[0-9]*)(%|px)/;function tS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Nle);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function nS(n,e){return n.relative?Math.round(n.position*e):n.position}function m0(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&m0(i,r)))return!1}return!0}class UI{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=Pg}=e;ic(!p||p instanceof Pg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Un(ht({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):m0(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=ht({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:nS(this._x,e),y:nS(this._y,t),width:nS(this._width,e),height:nS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ht(ht({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ht(ht(ht({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=tS(e),this._y=tS(t),this._width=tS(i),this._height=tS(r)}}const _0=()=>{},ZV={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:_0,onTransitionInterrupt:_0,onTransitionEnd:_0};class Ple{constructor(e,t={}){this.ControllerState=e,this.props=ht(ht({},ZV),t),this.propsInTransition=null,this.transition=new o0(t.timeline),this.onViewStateChange=t.onViewStateChange||_0,this.onStateChange=t.onStateChange||_0,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=ht(ht({},ZV),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ht(ht({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(ht(ht({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const JV=["longitude","latitude","zoom","bearing","pitch"],Lle=["longitude","latitude","zoom"];class eU extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!Xy(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];ic(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:JV,extract:JV,required:Lle}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=CE(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ht(ht({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,CE(e.around,t.around,i)))}return r}}const Qd={transitionDuration:0},kle={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},rS=n=>1-(1-n)*(1-n),Lg_WHEEL=["wheel"],Lg_PAN=["panstart","panmove","panend"],Lg_PINCH=["pinchstart","pinchmove","pinchend"],Lg_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Lg_DOUBLE_TAP=["doubletap"],Lg_KEYBOARD=["keydown"];class zI{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new Ple(e,Un(ht({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Un(ht({},kle),{transitionInterpolator:new eU({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Lg_WHEEL,d&&i),this.toggleEvents(Lg_PAN,d&&(r||s)),this.toggleEvents(Lg_PINCH,d&&(a||l)),this.toggleEvents(Lg_TRIPLE_PAN,d&&l),this.toggleEvents(Lg_DOUBLE_TAP,d&&o),this.toggleEvents(Lg_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=ht(ht({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,Qd,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,Un(ht({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,Qd,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,Qd,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,Qd,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,Un(ht({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?Un(ht({},t),{transitionInterpolator:new eU(Un(ht({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:Qd}}class tU{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const Zd_target=[0,0,0];class sS extends tU{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=Zd_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:A,startZoom:W}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:A,startZoom:W},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(Un(ht({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ht({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),gf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new sS(ht(ht(ht({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=gf(r,i,t),e.rotationX=gf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class jle extends zI{constructor(e){super(sS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Vle extends zI{constructor(e){e.dragMode=e.dragMode||"pan",super(sS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Ule=(new $n).lookAt({eye:[0,0,1]});function zle({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new $n).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Hle extends Pg{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(Un(ht({},e),{longitude:null,position:a,viewMatrix:Ule.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:zle({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Ig([],e,qD([],_f(t,this.pixelUnprojectionMatrix)));return{target:Ig([],this.center,r)}}}let Gle=(()=>{class n extends UI{constructor(t){super(Un(ht({},t),{type:Hle}))}get controller(){return this._getControllerProps({type:Vle})}}return n.displayName="OrthographicView",n})();const oS=Math.PI/180;function $le({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*oS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new $n).lookAt({eye:l,up:a});c.rotateX(i*oS),"Z"===t?c.rotateZ(r*oS):c.rotateY(r*oS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class Wle extends Pg{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(Un(ht({},e),{longitude:null,viewMatrix:$le({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=_f([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let qle=(()=>{class n extends UI{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Un(ht({},t),{orbitAxis:i,type:Wle}))}get controller(){return this._getControllerProps({type:jle})}}return n.displayName="OrbitView",n})();const Kle=[255,255,255],Yle=1;let Xle=0;class nU{constructor(e={}){const{color:t=Kle}=e,{intensity:i=Yle}=e;this.id=e.id||"ambient-".concat(Xle++),this.color=t,this.intensity=i,this.type="ambient"}}const Qle=[255,255,255],Zle=1,Jle=[0,0,-1];let ece=0;class iU{constructor(e={}){const{color:t=Qle}=e,{intensity:i=Zle}=e,{direction:r=Jle}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(ece++),this.color=t,this.intensity=i,this.type="directional",this.direction=new vo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class rU{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ht({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class HI extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ht({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Ou(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Ou(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=sU(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dgD(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Ou(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||sU(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class rce extends HI{constructor(e,t){super(e,t),this.shadowMap=new Oa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new Sg(e,{format:33189,width:1,height:1}),this.fbo=new Is(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;nc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=vg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Un(ht({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const oce=Object.keys(Mi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Mi[n],";")).join(""),ace=Object.keys(kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(kc[n],";")).join(""),lce="".concat(oce,"\n").concat(ace,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),cce={},GI={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:lce,getUniforms:function(n=cce){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Mi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mi.DEFAULT&&(i=n.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN);const o=moe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||foe,o}(n):{}}},fce=UE(function({viewport:n,center:e}){return new $n(n.viewProjectionMatrix).invert().transform(e)}),pce=UE(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=_f([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new vo(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new $n).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),gce=[0,0,0,1],mce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],$I={name:"shadow",dependencies:[GI],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||gce,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=fce({viewport:n.viewport,center:e.project_uCenter}),r=[],s=pce({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},wce={color:[255,255,255],intensity:1},oU=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],Ece=[0,0,0,200/255];class WI extends rU{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=Ece,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=r0.getDefaultProgramManager(e),$I&&this.programManager.addDefaultModule($I)),this.dummyShadowMap||(this.dummyShadowMap=new Oa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule($I),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new $n).lookAt({eye:new vo(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=xce++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class Cce{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=eS(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class Ace{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new Cce(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const Tce=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},GI],Mce=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function Dce(n){const e=r0.getDefaultProgramManager(n);for(const t of Tce)e.addDefaultModule(t);for(const t of Mce)e.addShaderHook(t);return e}const Oce=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Nce{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ace({gl:e,protocol:"deck://"}),this.context=Un(ht({},Oce),{layerManager:this,gl:e,deck:t,programManager:e&&Dce(e),stats:i||new lD({id:"deck.gl"}),viewport:r||new Pg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new aU,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){bo("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=xD(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return bo("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Oi.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Oi.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class Pce{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=xD(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!m0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Oi.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(ht({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=Un(ht(ht(ht({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class Lce extends tU{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:x,startRotatePos:A,startBearing:W,startPitch:G,startZoom:ge,normalize:Ne}={}){ic(Number.isFinite(s)),ic(Number.isFinite(r)),ic(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:Ne}),this._state={startPanLngLat:_,startZoomLngLat:x,startRotatePos:A,startBearing:W,startPitch:G,startZoom:ge},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(Un(ht({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(Un(ht({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ht({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(ht(ht(ht({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=gf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=gf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=Jj(t+180,360)-180),(o<-180||o>180)&&(o=Jj(o+180,360)-180);const a=KD(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Yd([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return gf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=gf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class kce extends zI{constructor(e){e.dragMode=e.dragMode||"pan",super(Lce,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Bce=(()=>{class n extends UI{constructor(t){super(Un(ht({},t),{type:pV}))}get controller(){return this._getControllerProps({type:kce})}}return n.displayName="MapView",n})();const jce=new WI;class Vce{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!m0(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof WI)||this._internalEffects.push(jce)}}class Uce extends HI{}const cU={blendFunc:[1,0,32771,0],blendEquation:32774};class uU extends HI{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,nc(_,Un(ht({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},cU),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Un(ht({},cU),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ht(ht({},e.props.parameters),i)}}class Hce{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Uce(e),this.pickLayersPass=new uU(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Is.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Un(ht({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,bo("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new Is(this.gl),new Is(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const Gce={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function $ce({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let A=0;A=0){const G=A+o-t,ge=G*G+x;ge<=d&&(d=ge,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),x=e[g];if(x){const A=x.decodePickingColor(_),W=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:x,pickedObjectIndex:A,pickedX:o+(f/4-W*l),pickedY:a+W}}Oi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Gce}function dU({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function qce(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(x=>x.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=dU(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=ht({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=hU({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function hU({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Yce{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new uU(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?ht(ht({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Is(e),Is.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Is(e),this.depthFBO.attach({36064:new Oa(e,{format:pi(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Oi.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:dU({viewports:i,x:r,y:s})};this._resizeBuffer();const f=vg(this.gl),p=sD(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:x,height:A}=this.pickingFBO,W=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:x,deviceHeight:A});let G;const ge=[],Ne={};for(let Ge=0;Ge=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Oi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:W,width:x.x+x.width-g,height:_-W},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Ge=new Map,$e=Number.isFinite(c);for(let at=0;at=c);at++){const St=Ne[at];let Rt={color:St.pickedColor,layer:null,index:St.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};Rt=hU({layer:St.pickedLayer,info:Rt,mode:l}),Ge.has(Rt.object)||Ge.set(Rt.object,Rt)}return Array.from(Ge.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return xE(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Xce={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Qce{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Xce),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function fU(n,e){if(!n)throw new Error(e)}const $c={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pU=$c.global||$c.self||$c.window,Jce="object"!=typeof process||"[object process]"!==String(process)||process.browser,gU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:eue}=(gU&&parseFloat(gU[1]),pU),qI="undefined"!=typeof Image,KI="undefined"!=typeof ImageBitmap,tue=Boolean(eue),YI=!!Jce||tue;function mU(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function _U(n){switch(mU(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const rue=/^data:image\/svg\+xml/,sue=/\.svg((\?|#).*)?$/;function XI(n){return n&&(rue.test(n)||sue.test(n))}function oue(n,e){if(XI(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return vU(n,e)}function vU(n,e){if(XI(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function bU(n,e,t){return QI.apply(this,arguments)}function QI(){return(QI=ni(function*(n,e,t){const i=oue(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield aue(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function aue(n,e){return ZI.apply(this,arguments)}function ZI(){return(ZI=ni(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const lue={};let wU=!0;function cue(n,e,t){return JI.apply(this,arguments)}function JI(){return(JI=ni(function*(n,e,t){let i;i=XI(t)?yield bU(n,e,t):vU(n,t);const r=e&&e.imagebitmap;return yield uue(i,r)})).apply(this,arguments)}function uue(n){return eR.apply(this,arguments)}function eR(){return(eR=ni(function*(n,e=null){if((due(e)||!wU)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),wU=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function due(n){for(const e in n||lue)return!1;return!0}const Wc=!1,y0=!0;function tR(n){const e=v0(n);return function(n){const e=v0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Wc)?{mimeType:"image/png",width:e.getUint32(16,Wc),height:e.getUint32(20,Wc)}:null}(e)||function(n){const e=v0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Wc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Wc)?{mimeType:"image/gif",width:e.getUint16(6,y0),height:e.getUint16(8,y0)}:null}(e)||function(n){const e=v0(n);return e.byteLength>=14&&16973===e.getUint16(0,Wc)&&e.getUint32(2,y0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,y0),height:e.getUint32(22,y0)}:null}(e)}function v0(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function _ue(n,e){const{mimeType:t}=tR(n)||{},{_parseImageNode:i}=pU;return fU(i),i(n,t,e)}function nR(){return(nR=ni(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(vue(r)){case"imagebitmap":a=yield cue(n,e,s);break;case"image":a=yield bU(n,e,s);break;case"data":a=yield _ue(n,e);break;default:fU(!1)}return"data"===r&&(a=_U(a)),a})).apply(this,arguments)}function vue(n){switch(n){case"auto":case"data":return function(){if(KI)return"imagebitmap";if(qI)return"image";if(YI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return KI||qI||YI;case"imagebitmap":return KI;case"image":return qI;case"data":return YI;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const EU={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return nR.apply(this,arguments)},tests:[n=>Boolean(tR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},wue={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},b0="8.5.8",aS=Sr.CO.deck&&Sr.CO.deck.VERSION;if(aS&&aS!==b0)throw new Error("deck.gl - multiple versions detected: ".concat(aS," vs ").concat(b0));aS||(Oi.log(1,"deck.gl ".concat(b0))(),Sr.CO.deck=Object.assign(Sr.CO.deck||{},{VERSION:b0,version:b0,log:Oi,_registerLoggers:function(n){MD=n}}),WV([wue,[EU,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Eue=Sr.CO.deck;class lS extends Nu{static isSupported(e,t=[]){const i=pi(e),r=FB(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:tn(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return lS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const SU=(0,Sr.jU)()&&"undefined"!=typeof document;let Oue=0;class Nue{constructor(e={}){const{onCreateContext:t=(A=>mB(A)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=ff.get("animation-loop-"+Oue++)}=e;let{useDevicePixels:x=!0}=e;"useDevicePixelRatio"in e&&(un.deprecated("useDevicePixelRatio","useDevicePixels")(),x=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:x}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return tn("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=lS.isSupported(this.gl,["timers"])?new lS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return ni(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return un.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=SU?new Promise((e,t)=>{SU&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?aD(this.props.gl,e):this.onCreateContext(e),!EE(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Ou(n,rD)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(un.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(un.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Is(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var Pue=tt(524),cS=tt.n(Pue);const Fue={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(cS().MouseInput);const jue=cS().Manager,qc=cS(),Vue=qc?[[qc.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[qc.Rotate,{enable:!1}],[qc.Pinch,{enable:!1}],[qc.Swipe,{enable:!1}],[qc.Pan,{threshold:0,enable:!1}],[qc.Press,{enable:!1}],[qc.Tap,{event:"doubletap",taps:2,enable:!1}],[qc.Tap,{event:"anytap",enable:!1}],[qc.Tap,{enable:!1}]]:null,AU={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Uue={doubletap:["tap"]},zue={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},rR={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Hue={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},TU={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Gue="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",kg="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let MU=!1;try{const n={get passive(){return MU=!0,!0}};kg.addEventListener("test",n,n),kg.removeEventListener("test",n,n)}catch(n){}const $ue=-1!==Gue.indexOf("firefox"),{WHEEL_EVENTS:Wue}=rR,IU=4.000244140625;class Yue{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Wue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!MU&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;kg.WheelEvent&&($ue&&e.deltaMode===kg.WheelEvent.DOM_DELTA_PIXEL&&(t/=kg.devicePixelRatio),e.deltaMode===kg.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%IU==0&&(t=Math.floor(t/IU)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:Xue}=rR,RU="pointermove",OU="pointerover",NU="pointerout",PU="pointerleave";class Que{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Xue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===RU&&(this.enableMoveEvent=t),e===OU&&(this.enableOverEvent=t),e===NU&&(this.enableOutEvent=t),e===PU&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:OU,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:NU,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:PU,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:RU,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Zue}=rR,FU="keydown";class Jue{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Zue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===FU&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:FU,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const kU="contextmenu";class ede{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===kU&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:kU,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const tde={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},BU={srcElement:"root",priority:0};class fde{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},BU,i):BU;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&AU[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new Yue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Que(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Jue(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new ede(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=Uue[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=TU[e]||e;let c=a.get(l);c||(c=new fde(this),a.set(l,c),c.recognizerName=Hue[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(TU[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=zue[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function bf(){}const jU={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:bf,onResize:bf,onViewStateChange:bf,onInteractionStateChange:bf,onBeforeRender:bf,onAfterRender:bf,onLoad:bf,onError:(n,e)=>Oi.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class dS{constructor(e){e=ht(ht({},jU),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Oi.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Sr.qs)()&&Oi.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new lD({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Yy.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Oi.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Oi.removed("onLayerClick","onClick")(),e.initialViewState&&!m0(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](ht({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),ic(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new Nue({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>mB(Un(ht(ht({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new Bce({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,aD(e,{enable:!0,copyState:!0})),this.tooltip=new Qce(this.canvas),Ou(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new aU;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new gde(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in eB)this.eventManager.on(r,this._onEvent);this.viewManager=new Pce({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new Nce(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new Vce,this.deckRenderer=new Hce(e),this.deckPicker=new Yce(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Ou(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ht({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Oi.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=Un(ht({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=eB[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=ff.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}dS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(rU)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},dS.defaultProps=jU,dS.VERSION=Eue.VERSION;const VU={name:"project32",dependencies:[GI],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},UU="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",yde={lightSources:{}};function aR({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const lR={name:"lights",vs:UU,fs:UU,getUniforms:function zU(n=yde){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?aR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=aR(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=aR(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return zU({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},bde={};const Ede={name:"phong-lighting",dependencies:[lR],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=bde){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},xde={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},$U=ht({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=xde){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),WU={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class hS{static get DRAW_MODE(){return WU}constructor(e={}){const{id:t=jc("geometry"),drawMode:i=WU.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?ht({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,tn(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(tn(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return tn(Number.isFinite(i)),i}}const cR=Math.PI/180,fS=new Float32Array(16),qU=new Float32Array(12);function KU(n,e,t){const i=e[0]*cR,r=e[1]*cR,s=e[2]*cR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function YU(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const XU={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let x;g?(fS.set(a),x=YU(fS)):(x=qU,KU(x,r,s),x.set(o,9)),n.value=new Float32Array(x)}else{let x=e*n.size;const{iterable:A,objectInfo:W}=YB(i,e,t);for(const G of A){let ge;W.index++,g?(fS.set(c?a:a(G,W)),ge=YU(fS)):(ge=qU,KU(ge,f?r:r(G,W),d?s:s(G,W)),ge.set(p?o:o(G,W),9)),_[x++]=ge[0],_[x++]=ge[1],_[x++]=ge[2],_[x++]=ge[3],_[x++]=ge[4],_[x++]=ge[5],_[x++]=ge[6],_[x++]=ge[7],_[x++]=ge[8],_[x++]=ge[9],_[x++]=ge[10],_[x++]=ge[11]}}}};function QU(n,e){return e===Mi.CARTESIAN||e===Mi.METER_OFFSETS||e===Mi.DEFAULT&&!n.isGeospatial}function ZU(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Oi.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function Mde(n,e){if(n.attributes)return ZU(n.attributes,e),n instanceof hS?n:new hS(n);if(n.positions||n.POSITION)return ZU(n,e),new hS({attributes:n});throw Error("Invalid mesh")}const Dde={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let Ide=(()=>{class n extends VI{getShaders(){const t=!pi(this.context.gl),i={};return yD(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[VU,Ede,$U],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:XU}),this.setState({emptyTexture:new Oa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||QU(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new BE(this.context.gl,Un(ht({},this.getShaders()),{id:this.props.id,geometry:Mde(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=Dde,n})();const JU={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[lR]};class Bg{constructor(e={}){const{id:t}=e;this.id=t||jc(this.constructor.name),this.display=!0,this.position=new vo,this.rotation=new vo,this.scale=new vo(1,1,1),this.matrix=new $n,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return tn(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return tn(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return tn(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){tn(e),t=t||this.matrix;const i=new $n(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class w0 extends Bg{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;un.assert(t.every(i=>i instanceof Bg),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new $n}={}){const i=new $n(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof w0?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function ez(){var n=new oa(4);return oa!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function tz(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function nz(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var rz=Kj,$de=function(){var n=jB(),e=VB(1,0,0),t=VB(0,1,0);return function(i,r,s){var o=UB(r,s);return o<-.999999?(TE(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&TE(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),tz(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(TE(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();ez(),ez(),function(){var n=new oa(9);oa!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const Wde=[0,0,0,1],Kde={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Yde={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function az(n){if(!n._animation){const e=Yde[n.componentType],t=Kde[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return tz(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=to(e)}get y(){return this[1]}set y(e){this[1]=to(e)}get z(){return this[2]}set z(e){this[2]=to(e)}get w(){return this[3]}set w(e){this[3]=to(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return $de(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Fu(!t),nz(this,this,e),this.check()}multiplyLeft(e,t){return Fu(!t),nz(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return rz(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Wde,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,x,A,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>gr?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-i)*p)/_,A=Math.sin(i*p)/_):(x=1-i,A=i),n[0]=x*r+A*l,n[1]=x*s+A*c,n[2]=x*o+A*d,n[3]=x*a+A*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),AE(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class nhe{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:un.warn(`Bad animation path ${s}`)()}tn(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){uR.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:az(e.accessors[a]),interpolation:l,output:az(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new nhe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class rhe extends Bg{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof BE?(this.model=e,this._setModelNodeProps(t)):this.model=new BE(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class she{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},yD(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new Oa(this.gl,ht({id:e.name||e.id,parameters:ht(ht({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(un.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function lz(n,e){return pi(n)?`#version 300 es\n${e}`:e}const che={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},uhe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class dhe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},uhe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new ihe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new w0({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new w0({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new $n).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new w0({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){un.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new she(n,e);un.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new rhe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[JU],defines:a.defines,parameters:a.parameters,vs:lz(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:lz(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),un.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new rr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new sa({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:che[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function cz(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new jg(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new jg(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof jg){const o=e;t=o.fields,i=fz(fz(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new jg(s,i)}}function fz(n,e){return new Map([...n||new Map,...e||new Map])}let Rr,pz,gz,mz,_z,yz,vz,bz;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(Rr||(Rr={}));class dR{static isNull(e){return e&&e.typeId===Rr.Null}static isInt(e){return e&&e.typeId===Rr.Int}static isFloat(e){return e&&e.typeId===Rr.Float}static isBinary(e){return e&&e.typeId===Rr.Binary}static isUtf8(e){return e&&e.typeId===Rr.Utf8}static isBool(e){return e&&e.typeId===Rr.Bool}static isDecimal(e){return e&&e.typeId===Rr.Decimal}static isDate(e){return e&&e.typeId===Rr.Date}static isTime(e){return e&&e.typeId===Rr.Time}static isTimestamp(e){return e&&e.typeId===Rr.Timestamp}static isInterval(e){return e&&e.typeId===Rr.Interval}static isList(e){return e&&e.typeId===Rr.List}static isStruct(e){return e&&e.typeId===Rr.Struct}static isUnion(e){return e&&e.typeId===Rr.Union}static isFixedSizeBinary(e){return e&&e.typeId===Rr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Rr.FixedSizeList}static isMap(e){return e&&e.typeId===Rr.Map}static isDictionary(e){return e&&e.typeId===Rr.Dictionary}get typeId(){return Rr.NONE}compareTo(e){return this===e}}Symbol,Symbol,pz=Symbol.toStringTag;class Vg extends dR{constructor(e,t){super(),Wn(this,"isSigned",void 0),Wn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Rr.Int}get[pz](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class whe extends Vg{constructor(){super(!0,8)}}class Ehe extends Vg{constructor(){super(!0,16)}}class She extends Vg{constructor(){super(!0,32)}}class xhe extends Vg{constructor(){super(!1,8)}}class Che extends Vg{constructor(){super(!1,16)}}class Ahe extends Vg{constructor(){super(!1,32)}}gz=Symbol.toStringTag;class wz extends dR{constructor(e){super(),Wn(this,"precision",void 0),this.precision=e}get typeId(){return Rr.Float}get[gz](){return"Float"}toString(){return`Float${this.precision}`}}class The extends wz{constructor(){super(32)}}class Mhe extends wz{constructor(){super(64)}}Symbol,Symbol,mz=Symbol.toStringTag,_z=Symbol.toStringTag,yz=Symbol.toStringTag,vz=Symbol.toStringTag,bz=Symbol.toStringTag;class Dhe extends dR{constructor(e,t){super(),Wn(this,"listSize",void 0),Wn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Rr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[bz](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class gS{constructor(e,t,i=!1,r=new Map){Wn(this,"name",void 0),Wn(this,"type",void 0),Wn(this,"nullable",void 0),Wn(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new gS(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function Ez(n,e,t){const i=t?Sz(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new whe;case Uint8Array:return new xhe;case Int16Array:return new Ehe;case Uint16Array:return new Che;case Int32Array:return new She;case Uint32Array:return new Ahe;case Float32Array:return new The;case Float64Array:return new Mhe;default:throw new Error("array type not supported")}}(e.value);return new gS(n,new Dhe(e.size,new gS("value",r)),!1,i)}function Sz(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const xz={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Nhe={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class Fhe{constructor(e){Wn(this,"draco",void 0),Wn(this,"decoder",void 0),Wn(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=Sz(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=Ez(o,n[o],s[o]);r.push(l)}if(t){const o=Ez("indices",t);r.push(o)}return new jg(r,i)}(l.attributes,a,l.indices);return Un(ht({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var mS=tt(125);const gR={};function mR(n){return _R.apply(this,arguments)}function _R(){return(_R=ni(function*(n,e=null,t={}){return e&&(n=Vhe(n,e,t)),gR[n]=gR[n]||Uhe(n),yield gR[n]})).apply(this,arguments)}function Vhe(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_I?t.CDN?(zc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yI?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Uhe(n){return yR.apply(this,arguments)}function yR(){return(yR=ni(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_I?yI?importScripts(n):zhe(yield(yield fetch(n)).text(),n):mS.requireFromFile&&(yield mS.requireFromFile(n))})).apply(this,arguments)}function zhe(n,e){if(!_I)return mS.requireFromString&&mS.requireFromString(n,e);if(yI)return eval.call(Nae,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Hhe="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Ghe="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",$he="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let E0;function qhe(n){return vR.apply(this,arguments)}function vR(){return(vR=ni(function*(n){const e=n.modules||{};return E0=e.draco3d?E0||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):E0||Khe(n),yield E0})).apply(this,arguments)}function Khe(n){return wR.apply(this,arguments)}function wR(){return(wR=ni(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield mR(Hhe,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield mR(Ghe,"draco",n),yield mR($he,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Yhe(e,t)})).apply(this,arguments)}function Yhe(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Un(ht({},t),{onModuleLoaded:r=>i({draco:r})}))})}const SR=Un(ht({},hz),{parse:function(n,e){return xR.apply(this,arguments)}});function xR(){return(xR=ni(function*(n,e){const{draco:t}=yield qhe(e),i=new Fhe(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function x0(n,e){return yf(n>=0),yf(e>0),n+(e-1)&~(e-1)}function Zhe(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+x0(i.byteLength,4)}const Cz=["SCALAR","VEC2","VEC3","VEC4"],Jhe=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],efe=new Map(Jhe),tfe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nfe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ife={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Az(n){return Cz[n-1]||Cz[0]}function Tz(n){const e=efe.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function Mz(n,e){const t=ife[n.componentType],i=tfe[n.type],s=n.count*i,o=n.count*i*nfe[n.componentType];return La(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const rfe={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class eh{constructor(e){Wn(this,"gltf",void 0),Wn(this,"sourceBuffers",void 0),Wn(this,"byteLength",void 0),this.gltf=e||{json:ht({},rfe),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return La(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=Mz(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return La(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return La(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=tR(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;La(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=x0(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:Az(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:Tz(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Zhe(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*gfe(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function mfe(n){return TR.apply(this,arguments)}function TR(){return(TR=ni(function*(n){const e=new eh(n),{json:t}=e;e.removeExtension(yS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,yS)})).apply(this,arguments)}function _fe(n){const e=new eh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,yS,{}),e.addExtension(yS))}function yfe(n){return MR.apply(this,arguments)}function MR(){return(MR=ni(function*(n){const e=new eh(n),{json:t}=e,i=e.getExtension(Ug);i&&(e.json.lights=i.lights,e.removeExtension(Ug));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Ug);s&&(r.light=s.light),e.removeObjectExtension(r,Ug)}})).apply(this,arguments)}function vfe(n){return DR.apply(this,arguments)}function DR(){return(DR=ni(function*(n){const e=new eh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Ug);La(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Ug,i);delete e.json.lights}})).apply(this,arguments)}function bfe(n){return IR.apply(this,arguments)}function IR(){return(IR=ni(function*(n){const e=new eh(n),{json:t}=e,i=e.getExtension(vS);if(i){const r=Efe(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,vS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=Sfe(s.technique,e)),e.removeObjectExtension(s,vS)}e.removeExtension(vS)}})).apply(this,arguments)}function wfe(n,e){return RR.apply(this,arguments)}function RR(){return(RR=ni(function*(n,e){})).apply(this,arguments)}function Efe(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function Sfe(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const Rz={KHR_draco_mesh_compression:gt,KHR_materials_unlit:J,KHR_lights_punctual:At,KHR_techniques_webgl:dt};function xfe(n){return OR.apply(this,arguments)}function OR(){return(OR=ni(function*(n,e={},t){for(const r in Rz){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield Rz[r].decode(n,e,t))}})).apply(this,arguments)}const Oz={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Afe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Tfe{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new eh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,Dz);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(Dz)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in Oz)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in Oz)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=Afe[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function Mfe(n,e={}){return(new Tfe).normalize(n,e)}const Dfe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ife={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},vl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Rfe={magFilter:vl.TEXTURE_MAG_FILTER,minFilter:vl.TEXTURE_MIN_FILTER,wrapS:vl.TEXTURE_WRAP_S,wrapT:vl.TEXTURE_WRAP_T},Ofe={[vl.TEXTURE_MAG_FILTER]:vl.LINEAR,[vl.TEXTURE_MIN_FILTER]:vl.NEAREST_MIPMAP_LINEAR,[vl.TEXTURE_WRAP_S]:vl.REPEAT,[vl.TEXTURE_WRAP_]:vl.REPEAT};class Ffe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return La(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=ht({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=ht({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ht({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ht({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=ht({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ht({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ht({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return Ife[n]}(e.componentType),e.components=function(n){return Dfe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=Mz(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):Ofe,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return Rfe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function Lfe(n,e){return(new Ffe).postProcess(n,e)}const Nz=1735152710,zg=!0;function PR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),x0(i,4)}function FR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),x0(i,4)}function Kfe(n,e){return LR.apply(this,arguments)}function LR(){return(LR=ni(function*(n,e,t=0,i,r){var s,o,a,l;Yfe(n,e,t,i),Mfe(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Xfe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Qfe(n,i,r);c.push(f)}const d=xfe(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?Lfe(n,i):n})).apply(this,arguments)}function Yfe(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=Nz}=t,s=i.getUint32(e,!1);return s===r||s===Nz}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?cz(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?cz(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,zg),a=r.getUint32(t+8,zg);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){yf(n.header.byteLength>20);const i=e.getUint32(t+0,zg),r=e.getUint32(t+4,zg);return t+=8,yf(0===r),PR(n,e,t,i),(t+=i)+FR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return yf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,zg),s=e.getUint32(t+4,zg);switch(t+=8,s){case 1313821514:PR(n,e,t,r);break;case 5130562:FR(n,e,t,r);break;case 0:i.strict||PR(n,e,t,r);break;case 1:i.strict||FR(n,e,t,r)}t+=x0(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),La("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else La(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Xfe(n,e,t){return kR.apply(this,arguments)}function kR(){return(kR=ni(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield tpe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function tpe(n){return zR.apply(this,arguments)}function zR(){return(zR=ni(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const Pz=[255,255,255,255],rpe={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:Pz},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Hg]};let spe=(()=>{class n extends VI{getShaders(){const t=[VU,$U];return"pbr"===this.props._lighting&&t.push(JU),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:Pz,transition:!0},instanceModelMatrix:XU})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Bg)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new dhe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ht({gltf:l},c),function(n){return UR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Oi.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Bg?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Oi.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Oi.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Bg&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:ht({isInstanced:!0,transpileToGLSL100:!pi(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:QU(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=rpe,n})();const ope=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),ape=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),lpe=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),cpe=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),upe={POSITION:{size:3,value:new Float32Array(ape)},NORMAL:{size:3,value:new Float32Array(lpe)},TEXCOORD_0:{size:2,value:new Float32Array(cpe)}};class dpe extends hS{constructor(e={}){const{id:t=jc("cube-geometry")}=e;super(Un(ht({},e),{id:t,indices:{size:1,value:new Uint16Array(ope)},attributes:ht(ht({},upe),e.attributes)}))}}class Kc{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new le){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new le){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new le){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new le){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new le){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new le){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new le){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=fpe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=ppe;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(Fz),Fz.almostEquals(e,t)}clone(){return new le(this.x,this.y,this.z)}}le.ZERO=void 0,le.UNIT_X=void 0,le.UNIT_Y=void 0,le.UNIT_Z=void 0,le.ZERO=new le(0,0,0),le.UNIT_X=new le(1,0,0),le.UNIT_Y=new le(0,1,0),le.UNIT_Z=new le(0,0,1);const fpe=new le,ppe=new le,Fz=new le;class ar{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new le,this.upperBound=new le,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=kz;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=kz;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const Lz=new le,kz=[new le,new le,new le,new le,new le,new le,new le,new le];class ss{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new le){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=mpe;e.tangents(i,_pe),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(_r(e.length(),2)*_r(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new ss){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new ss){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new ss){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new le){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new ss(this.x,this.y,this.z,this.w)}slerp(e,t,i=new ss){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,x,A,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-t)*p)/_,A=Math.sin(t*p)/_):(x=1-t,A=t),i.x=x*r+A*l,i.y=x*s+A*c,i.z=x*o+A*d,i.w=x*a+A*f,i}integrate(e,t,i,r=new ss){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const mpe=new le,_pe=new le,ype={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let dn=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=ype,n})();class Ni{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new ss,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Ni.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Ni.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new le){return i.vsub(e,r),t.conjugate(jz),jz.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new le){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new le){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new le){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const jz=new ss;class wf extends dn{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:dn.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new le;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=x,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,d=new le,f=new le,p=new le,g=new le,_=new le;let x=Number.MAX_VALUE;const A=this;if(A.uniqueAxes)for(let W=0;W!==A.uniqueAxes.length;W++){i.vmult(A.uniqueAxes[W],c);const G=A.testSepAxis(c,e,t,i,r,s);if(!1===G)return!1;G0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){wf.project(this,e,i,r,HR),wf.project(t,e,s,o,GR);const l=HR[0],c=HR[1],d=GR[0],f=GR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?hn.STATIC:hn.DYNAMIC,typeof e.type==typeof hn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=hn.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new le,this.quaternion=new ss,this.initQuaternion=new ss,this.previousQuaternion=new ss,this.interpolatedQuaternion=new ss,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new le,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new le,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new le,this.invInertia=new le,this.invInertiaWorld=new Kc,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new Kc,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new le(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new le(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new ar,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new le,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=hn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===hn.SLEEPING&&this.dispatchEvent(hn.wakeupEvent)}sleep(){this.sleepState=hn.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=_r(this.sleepSpeedLimit,2);t===hn.AWAKE&&ir?this.wakeUp():t===hn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(hn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===hn.SLEEPING||this.type===hn.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new le){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new le){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new le,s=new ss;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=wpe,o=Epe,a=this.quaternion,l=this.aabb,c=Spe;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=xpe,r=Cpe;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==hn.DYNAMIC)return;this.sleepState===hn.SLEEPING&&this.wakeUp();const i=Ape;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==hn.DYNAMIC)return;const i=Tpe,r=Mpe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===hn.DYNAMIC&&(this.sleepState===hn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==hn.DYNAMIC)return;this.sleepState===hn.SLEEPING&&this.wakeUp();const i=t,r=Dpe;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=Ipe;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==hn.DYNAMIC)return;const i=Rpe,r=Ope;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=Npe;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),wS.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new le;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==hn.DYNAMIC&&this.type!==hn.KINEMATIC||this.sleepState===hn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,x=this.angularFactor,A=l.x*x.x,W=l.y*x.y,G=l.z*x.z;s.x+=e*(_[0]*A+_[1]*W+_[2]*G),s.y+=e*(_[3]*A+_[4]*W+_[5]*G),s.z+=e*(_[6]*A+_[7]*W+_[8]*G),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}hn.idCounter=0,hn.COLLIDE_EVENT_NAME="collide",hn.DYNAMIC=1,hn.STATIC=2,hn.KINEMATIC=4,hn.AWAKE=0,hn.SLEEPY=1,hn.SLEEPING=2,hn.wakeupEvent={type:"wakeup"},hn.sleepyEvent={type:"sleepy"},hn.sleepEvent={type:"sleep"};const wpe=new le,Epe=new ss,Spe=new ar,xpe=new Kc,Cpe=new Kc,Ape=new le,Tpe=new le,Mpe=new le,Dpe=new le,Ipe=new le,Rpe=new le,Ope=new le,Npe=new le;new le,new le;class ES{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new le,this.rayToWorld=new le,this.hitNormalWorld=new le,this.hitPointWorld=new le,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let Vz,Uz,zz,Hz,Gz,$z,Wz;Vz=dn.types.SPHERE,Uz=dn.types.PLANE,zz=dn.types.BOX,Hz=dn.types.CYLINDER,Gz=dn.types.CONVEXPOLYHEDRON,$z=dn.types.HEIGHTFIELD,Wz=dn.types.TRIMESH;class fs{get[Vz](){return this._intersectSphere}get[Uz](){return this._intersectPlane}get[zz](){return this._intersectBox}get[Hz](){return this._intersectConvex}get[Gz](){return this._intersectConvex}get[$z](){return this._intersectHeightfield}get[Wz](){return this._intersectTrimesh}constructor(e=new le,t=new le){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new le,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=fs.ANY,this.result=new ES,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||fs.ANY,this.result=t.result||new ES,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(qz),KR.length=0,e.broadphase.aabbQuery(e,qz,KR),this.intersectBodies(KR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=Vpe,s=Upe;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new le(0,0,1);t.vmult(c,c);const d=new le;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;A>=0&&A<=1&&(o.lerp(a,A,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Wpe,l=Yz,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,A=_.distanceTo(this.to),W=c?c.length:d.length,G=this.result;for(let ge=0;!G.shouldStop&&geA||this.reportIntersection(a,aa,s,r,Ne)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=qpe,l=Jpe,c=ege,d=Yz,f=Kpe,p=Ype,g=Xpe,_=Zpe,x=Qpe,A=e.indices,W=this.from,G=this.to,ge=this.direction;c.position.copy(i),c.quaternion.copy(t),Ni.vectorToLocalFrame(i,t,ge,f),Ni.pointToLocalFrame(i,t,W,p),Ni.pointToLocalFrame(i,t,G,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const Ne=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Ge=0,$e=l.length;!this.result.shouldStop&&Ge!==$e;Ge++){const at=l[Ge];e.getNormal(at,a),e.getVertex(A[3*at],ac),ac.vsub(p,d);const St=f.dot(a),Rt=a.dot(d)/St;if(Rt<0)continue;f.scale(Rt,aa),aa.vadd(p,aa),e.getVertex(A[3*at+1],Xc),e.getVertex(A[3*at+2],Qc);const Pt=aa.distanceSquared(p);!fs.pointInTriangle(aa,Xc,ac,Qc)&&!fs.pointInTriangle(aa,ac,Xc,Qc)||Pt>Ne||(Ni.vectorToWorldFrame(t,a,x),Ni.pointToWorldFrame(i,t,aa,_),this.reportIntersection(x,_,s,r,at))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case fs.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case fs.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var Af=tt(517);class Or extends ee{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new U;return this._value}next(e){super.next(this._value=e)}}function qg(n,e,t){e||(e=new $n($n.IDENTITY));const i=new $n($n.IDENTITY);if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new $n($n.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new $n(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===qg(s,r,t))return!1;return!0}function V4(){WV([hz,Hg])}function U4(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||qg(r,new $n($n.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function ZR(n,e){return ir(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield JE(i,Hg,{DracoLoader:SR,gltf:{decompressMeshes:!0,postProcess:!0}});return U4(n.scenegraphNode,r)})}function tye(n,e){return ir(this,void 0,void 0,function*(){return U4(n,yield e)})}function JR(n,e,t){if(e&&0!==e.length)return new Ide(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mi.CARTESIAN,data:e,mesh:new dpe,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let iye=(()=>{class n extends Ole{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),V4()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){ir(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new $n(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new ar({lowerBound:new le(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new le(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield eS(o.scenegraph,Hg,{DracoLoader:SR,decompress:!0,postProcess:!0});for(const l of a.scenes)qg(l,new $n(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new ar({lowerBound:new le(...p.map((_,x)=>Math.min(_,g[x]))),upperBound:new le(...g.map((_,x)=>Math.max(_,p[x])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=ZR({scenegraph:l.scenegraph},n.gltfCache));return[JR("cubes",i,{wireframe:!1,pickable:!1}),JR("pickableCubes",r,{wireframe:!1,pickable:!0}),JR("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new spe({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Mi.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?tye(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function z4(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),z4(t,e);return e}let sye=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new iye({}),this.nodeClickSubject=new ee,this.nodeHoverStartSubject=new ee,this.nodeHoverStopSubject=new ee,this.sceneRotationSubject=new Or([0,0]),this.nodeDragStartSubject=new ee,this.nodeDragSubject=new ee,this.nodeDragEndSubject=new ee,this.nodeClick$=this.nodeClickSubject.pipe(ms()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ms()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ms()),this.sceneRotation$=this.sceneRotationSubject.pipe(ms()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ms()),this.nodeDrag$=this.nodeDragSubject.pipe(ms()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ms());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Gle({flipY:!1,near:-1e3}):new qle({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new WI({ambientLight:new nU({color:[255,255,255],intensity:10})})]),this.deck=new dS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return ir(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new $n([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return ir(this,void 0,void 0,function*(){V4();const i=yield ZR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)qg(o,e=new $n(e||$n.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new $n(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new $n(e||$n.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new ar({lowerBound:new le(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new le(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of z4(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new $n($n.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new $n(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return Ia([Af.ZP],n.prototype,"_onHover",null),Ia([Af.ZP],n.prototype,"_onClick",null),Ia([Af.ZP],n.prototype,"_onViewStateChange",null),Ia([Af.ZP],n.prototype,"_onDragStart",null),Ia([Af.ZP],n.prototype,"_onDrag",null),Ia([Af.ZP],n.prototype,"_onDragEnd",null),n})();function oye(n,e){return n===e}function aye(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let eO=(()=>{class n{constructor(){this.bootstrap$=new mg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const tO=new Vt("INITIAL_STATE_TOKEN");let uye=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const G4=new Vt("Internals.StateContextFactory"),$4=new Vt("Internals.StateFactory");function O0(...n){if(1===n.length){const e=n[0];if(L(e))return RS(e,null);if(re(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return RS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return RS(n=1===n.length&&L(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return RS(n,null)}function RS(n,e){return new F(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function Ui(n,e){return function(i){return i.lift(new dye(n,e))}}class dye{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new hye(e,this.predicate,this.thisArg))}}class hye extends y{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}function ka(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new mg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const W4=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function Yi(n){return e=>0===n?mE():e.lift(new pye(n))}class pye{constructor(e){if(this.total=e,this.total<0)throw new W4}call(e,t){return t.subscribe(new gye(e,this.total))}}class gye extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function q4(n,e){return e?t=>t.pipe(q4((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new mye(n))}class mye{constructor(e){this.project=e}call(e,t){return t.subscribe(new _ye(e,this.project))}}class _ye extends fe{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new wt(this),i=this.destination;i.add(t);const r=R(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function OS(n=null){return e=>e.lift(new yye(n))}class yye{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new vye(e,this.defaultValue))}}class vye extends y{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function lc(n){return function(t){const i=new bye(n),r=t.lift(i);return i.caught=r}}class bye{constructor(e){this.selector=e}call(e,t){return t.subscribe(new wye(e,this.selector,this.caught))}}class wye extends fe{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new wt(this);this.add(i);const r=R(t,i);r!==i&&this.add(r)}}}function os(n){return e=>e.lift(new Eye(n))}class Eye{constructor(e){this.notifier=e}call(e,t){const i=new Sye(e),r=R(this.notifier,new wt(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class Sye extends fe{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function nh(){}function Zr(n,e,t){return function(r){return r.lift(new xye(n,e,t))}}class xye{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Cye(e,this.nextOrObserver,this.error,this.complete))}}class Cye extends y{constructor(e,t,i,r){super(e),this._tapNext=nh,this._tapError=nh,this._tapComplete=nh,this._tapError=i||nh,this._tapComplete=r||nh,K(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||nh,this._tapError=t.error||nh,this._tapComplete=t.complete||nh)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}function $u(n,e){return t=>t.lift(new Aye(n,e))}class Aye{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new Tye(e,this.compare,this.keySelector))}}class Tye extends y{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}const Ba={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let K4=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(n){return"server"===n}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return mn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return mn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof mn||console.warn(Ba.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn),Ie(Pc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Y4=new Vt("ROOT_STATE_TOKEN"),X4=new Vt("FEATURE_STATE_TOKEN"),Q4=new Vt("NGXS_PLUGINS"),Z4=new Vt("NG_TEST_MODE"),J4=new Vt("NG_DEV_MODE"),Wu="NGXS_META",e8="NGXS_OPTIONS_META";let Tf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=K4}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Mye{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const t8=new Vt("NGXS_EXECUTION_STRATEGY");function Mf(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const n8=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},NS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),iO=n=>n&&"object"==typeof n&&!Array.isArray(n),rO=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(iO(n)&&iO(t))for(const i in t)iO(t[i])?(n[i]||Object.assign(n,{[i]:{}}),rO(n[i],t[i])):Object.assign(n,{[i]:t[i]});return rO(n,...e)};function N0(n){return n[Wu]}function r8(n,e){const t=NS(e.currentAppState,n.path),i=NS(e.newAppState,n.path);return new Mye(t,i,!n.isInitialised)}function Lye(...n){return function(n,e,t=jye){const i=function(n){return n.reduce((e,t)=>(e[Mf(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Ui(t=>{const i=Mf(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function jye(){return me(n=>n.action)}function PS(n){return e=>new F(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let FS=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(t8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class zye extends ee{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let LS=(()=>{class n extends zye{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Hye=(()=>{class n extends F{constructor(t,i){super(r=>{const s=t.pipe(PS(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(Ie(LS),Ie(FS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const s8=n=>(...e)=>n.shift()(...e,(...i)=>s8(n)(...i));let kS=(()=>{class n extends Or{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),lO=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(Q4,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),cO=(()=>{class n extends ee{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),o8=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Zo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(PS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?an(this._stateStream.getValue()):O0(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!Mf(t))return gg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return s8([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(ka())}getActionResultStream(t){return this._actionResults.pipe(Ui(i=>i.action===t&&"DISPATCHED"!==i.status),Yi(1),ka())}createDispatchObservable(t){return t.pipe(q4(i=>{switch(i.status){case"SUCCESSFUL":return an(this._stateStream.getValue());case"ERRORED":return gg(i.error);default:return Lc}})).pipe(ka())}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(LS),Ie(cO),Ie(lO),Ie(kS),Ie(FS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const a8=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&a8(n[i])}),n};let l8=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(J4),Ie(Z4))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),c8=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Ba.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ba.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(l8),Ie(Tf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Yg=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=a8(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(Ie(kS),Ie(o8),Ie(Tf),Ie(c8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),BS=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return NS(l,t.path)}function s(l,c){const d=n8(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=r8(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Ba.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ba.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Yg))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class jS{static stateNameErrorMessage(e){return Ba.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ba.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Ba.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=N0(e);if(!t)throw new Error(Ba.STATE_DECORATOR());return t}}jS.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Xg=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=H4(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(jS.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[Wu].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[Wu];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[Wu].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[Wu];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>n8(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ui(t=>"DISPATCHED"===t.status),k(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),OS({action:t,status:"CANCELED"}),lc(i=>an({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=Mf(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=Pe(d)),d instanceof F?(d=d.pipe(OS({})),l.options.cancelUncompleted&&(d=d.pipe(os(t.pipe(Lye(i)))))):d=an({}).pipe(ka()),s.push(d)}catch(d){s.push(gg(d))}}}return s.length||s.push(an({})),O0(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=jS.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==NS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(Tf),Ie(n,12),Ie(LS),Ie(cO),Ie(BS),Ie(tO,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),uO=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ui(()=>!!i),Zr(()=>this.invokeInit(i.states)),k(()=>this.bootstrapper.appBootstrapped$),Ui(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=r8(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Yg),Ie(BS),Ie(eO))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();let ih=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(me(i),lc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?an(void 0):gg(r)}),$u(),PS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Yi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(PS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=function(n){return n.NGXS_SELECTOR_META}(n)||N0(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(kS),Ie(Yg),Ie(Tf),Ie(FS),Ie(Xg),Ie(tO,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),P0=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(Tf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class Xye{static get type(){return"@@INIT"}}class Qye{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const US=new mg(1);let FO,Jye=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Da();US.next(t)}catch(n){US.next(!1)}finally{US.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new Xye,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Xg),Ie(Yg),Ie(ih),Ie(P0),Ie(Y4,8),Ie(uO))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})(),e0e=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new Qye(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(Yg),Ie(Xg),Ie(X4,8),Ie(uO))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();class la{static forRoot(e=[],t={}){return{ngModule:Jye,providers:[Xg,BS,Hye,LS,eO,c8,l8,uO,o8,cO,Yg,FS,ih,kS,P0,lO,...e,...la.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:e0e,providers:[Xg,lO,...e,{provide:X4,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:Z4,useValue:cye},{provide:J4,useValue:Da},{provide:t8,useClass:t.executionStrategy||K4},{provide:Y4,useValue:e},{provide:la.ROOT_OPTIONS,useValue:t},{provide:Tf,useFactory:la.ngxsConfigFactory,deps:[la.ROOT_OPTIONS]},{provide:Bw,useFactory:la.appBootstrapListenerFactory,multi:!0,deps:[eO]},{provide:tO,useFactory:la.getInitialState},{provide:G4,useExisting:BS},{provide:$4,useExisting:Xg}]}static ngxsConfigFactory(e){return rO(new Tf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return uye.pop()}}function n0e(n){return i=>{!function(n){US.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ba.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(Wu)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,Wu,{value:e})}return N0(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[e8]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;jS.checkCorrectStateName(d),s.hasOwnProperty(Wu)&&(r.actions=Object.assign({},r.actions,(s[Wu]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[e8]=a}}la.\u0275fac=function(e){return new(e||la)},la.\u0275mod=gn({type:la}),la.\u0275inj=Et({}),la.ROOT_OPTIONS=new Vt("ROOT_OPTIONS"),new Jl(gE);try{FO="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){FO=!1}"undefined"!=typeof Element&∈function YH(n){Promise.resolve(null).then(n)}class nm{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){YH(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function QH(){return"undefined"!=typeof window&&void 0!==window.document}function UO(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let $O=(n,e)=>!1,WO=(n,e)=>!1,e5=(n,e,t)=>[];const t5=UO();(t5||"undefined"!=typeof Element)&&($O=QH()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),WO=(()=>{if(t5||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):WO}})(),e5=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return qO(t)}matchesElement(t,i){return KO(t,i)}containsElement(t,i){return YO(t,i)}query(t,i,r){return XO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new nm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ox{}ox.NOOP=new r5;function l5(n,e,t){return t?e+":"+t+";":""}function c5(n){let e="";for(let t=0;t{const r=tN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),UO()&&c5(n))}function Pf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=tN(t);n.style[i]=""}),UO()&&c5(n))}const ebe=/-+([a-z0-9])/g;function tN(n){return n.replace(ebe,(...e)=>e[1].toUpperCase())}function tbe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class sm{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=sm.initialStylesByElement.get(e);r||sm.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&eu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(eu(this._element,this._initialStyles),this._endStyles&&(eu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(sm.initialStylesByElement.delete(this._element),this._startStyles&&(Pf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Pf(this._element,this._endStyles),this._endStyles=null),eu(this._element,this._initialStyles),this._state=3)}}sm.initialStylesByElement=new WeakMap;let Lf;try{Lf="undefined"!=typeof Intl}catch(n){Lf=!1}new class extends Jl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let tEe=1;const nEe=Promise.resolve(),Mx={};function o6(n){return n in Mx&&(delete Mx[n],!0)}const a6={setImmediate(n){const e=tEe++;return Mx[e]=!0,nEe.then(()=>o6(e)&&n()),e},clearImmediate(n){o6(n)}};new class extends Jl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=a6.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(a6.clearImmediate(t),e.scheduled=void 0)}});function X0(n){return!!n&&(n instanceof F||"function"==typeof n.lift&&"function"==typeof n.subscribe)}function Ix(...n){return It(1)(an(...n))}function Vo(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>Ix(n,t,e)):t=>Ix(n,t)}function V6(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>me(function(n,e){return i=>{let r=i;for(let s=0;s{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&qx(n[o])}),n};function kG(n){return Ha(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const VG="NGXS_DATA_META",GN="NGXS_META",UG="NGXS_ARGUMENT_REGISTRY_META";let zG=(()=>{class n{constructor(t){this.sequence$=new Or(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function nv(n){return n[VG]}let Ga=(()=>{class n{constructor(t,i,r){n.store=t.get(ih),n.ngZone=t.get(mn),n.factory=i,n.context=r,n.computed=t.get(zG)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie($4),Ie(G4))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ls{constructor(){ls.statesCachedMeta.clear()}static createStateContext(e){return Ga.context.createStateContext(e)}static ensureMappedState(e){if(za(Ga.factory)||za(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(Ha(e.name)?ls.statesCachedMeta.get(e.name):null)||ls.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=nv(ls.getStateClassByInstance(e)))&&void 0!==t?t:null;if(za(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=ls.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=ls.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=Ha(e.name)?null===(t=Ga.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Ha(i)&&Ha(e.name)&&ls.statesCachedMeta.set(e.name,i),i}}ls.statesCachedMeta=new Map,ls.\u0275fac=function(e){return new(e||ls)},ls.\u0275prov=We({token:ls,factory:ls.\u0275fac}),new mg(1);class ACe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Ha(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function HG(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function GG(n){var e;const t=HG(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=LG(void 0===t.defaults?{}:t.defaults);if(i.length){if(kG(s))return function(n,e){return e.reduce((t,i)=>{const r=HG(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=GG(i),t},null!=n?n:{})}(s,i);throw new ACe(s)}return s}function WG(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function qG(){var n,e;return null!==(e=null===(n=null==Ga?void 0:Ga.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function ICe(n){let e=!1;return X0(n)&&(e=!0),e}function $N(n){return n[UG]}class RCe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class OCe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(zN(this.argumentMap.has(e))||zN(this.payloadMap.has(e)))throw new RCe(e,t)}}function BCe(n){return{enumerable:!0,configurable:!0,get(){const e=nv(n),t=ls.ensureMappedState(e.stateMeta);return ls.createStateContext(t)}}}function KG(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(kG(i))for(;null!==i;){if(tv(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return za(WG(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),WG(n)}(this),o=null==s?void 0:s.get(i);if(tv(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(za(o)||o.sequenceId!==qG()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:qG(),isObservable:ICe(l)}),l}return o.value},t}}const GCe={cancelUncompleted:!0,insideZone:!1};function WN(n=GCe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=ls.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=$N(r);if(za(f)){const G=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),ge=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var G;return tv(n.insideZone)?null===(G=Ga.ngZone)||void 0===G||G.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),X0(l)?an(null).pipe(me(()=>l)):l};const A=ls.createAction(f,o,g),W=Ga.store.dispatch(A);return X0(l)?function(n,e){return O0([n,e]).pipe(me(t=>t.pop()))}(W,l):l},i}}function YG(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return za($N(t))&&Object.defineProperties(t,{[UG]:{enumerable:!0,configurable:!0,value:new OCe}}),$N(t)})(e,t).createPayloadType(r,t,i)}}function WCe(){return n=>{const e=function(n){if(function(n){return!zN(n)}(n.hasOwnProperty(GN))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,GN,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[GN]}(n)}(n);if(za(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=nv(n))&&void 0!==e?e:null;return(za(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,VG,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),nv(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>LG(t)},context:BCe(n)})}(n,e,GG(n)),function(n){var e,t;const i=nv(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(Ha(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Ha(this[s]))return this[s];if(za(Ga.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ga.store.select(n).pipe(me(o=>Da()?qx(o):o),ka({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let KCe=(()=>{class n{constructor(){this.browserStorageEvents$=new ee,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),YCe=(()=>{class n extends KCe{get snapshot(){return function(n){return Da()?qx(n):n}(this.getState())}get ctx(){return function(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>Da()?qx(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ia([KG(),ec("design:type",Object),ec("design:paramtypes",[])],n.prototype,"snapshot",null),Ia([WN(),z3(0,YG("patchValue")),ec("design:type",Function),ec("design:paramtypes",[Object]),ec("design:returntype",void 0)],n.prototype,"patchState",null),Ia([WN(),z3(0,YG("stateValue")),ec("design:type",Function),ec("design:paramtypes",[Object]),ec("design:returntype",void 0)],n.prototype,"setState",null),Ia([WN(),ec("design:type",Function),ec("design:paramtypes",[]),ec("design:returntype",void 0)],n.prototype,"reset",null),n})();new Vt("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})});const mP=new Vt("ngx-window",{providedIn:"root",factory:()=>function(n){return function(n){return n===x3}(n)?window:null}(xc(Pc))}),_Me=new Vt("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(xc(mP))});new Vt("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(xc(mP),xc(_Me))}),new Vt("ngx-google-analytics-routing-settings",{factory:()=>({})}),new Vt("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"});const DMe=["bodyCanvas"];let IMe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new cn,this.nodeDrag=new cn,this.nodeClick=new cn,this.nodeHoverStart=new cn,this.nodeHoverStop=new cn,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return ir(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new sye({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=wn({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Ms(DMe,5,An),2&t){let r;Ai(r=Ti())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&xu(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&function(n,e,t,i){Kt(n,e,t,i),Yt()}(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),RMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({imports:[[Ws]]}),n})();new Vt("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10}),[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].filter(n=>!0!==n.disabled);let hv=(()=>{let n=class extends YCe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ui(n=>null!=n),ka(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(V6(...t),$u(),ka(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(V6(...t),$u(),ka(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ia([KG()],n.prototype,"config$",null),n=Ia([WCe(),n0e({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();const l7="http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity",aDe=[173,255,47,229.5];var Qn=tt(440),hDe=tt(698),fDe=tt(445),pDe=tt.n(fDe),En=tt(815),$a=tt(609);const Hi=Qn.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},Qn.DataFactory),ym=(Hi("rdf"),Hi("rdf")("type"),{x:Hi("rdfs"),label:Hi("rdfs")("label"),comment:Hi("rdfs")("comment"),isDefinedBy:Hi("rdfs")("isDefinedBy"),seeAlso:Hi("rdfs")("seeAlso")}),Os={x:Hi("entity"),id:Hi("entity")("id"),label:ym.label,description:ym.comment,link:ym.seeAlso,sex:Hi("entity")("sex"),age:Hi("entity")("age"),bmi:Hi("entity")("bmi"),Male:Qn.DataFactory.literal("Male"),Female:Qn.DataFactory.literal("Female"),consortiumName:Hi("entity")("consortium_name"),providerName:Hi("entity")("provider_name"),providerUUID:Hi("entity")("provider_uuid"),donor:Hi("entity")("has_donor"),sections:Hi("entity")("has_tissue_section"),datasets:Hi("entity")("has_dataset"),sampleType:Hi("entity")("sample_type"),TissueBlock:Qn.DataFactory.literal("Tissue Block"),TissueSection:Qn.DataFactory.literal("Tissue Section"),NonStandard:Qn.DataFactory.literal("Non-standard"),sectionCount:Hi("entity")("section_count"),sectionSize:Hi("entity")("section_size"),sectionUnits:Hi("entity")("section_units"),sectionNumber:Hi("entity")("section_number"),spatialEntity:Hi("entity")("has_spatial_entity"),ontologyTerms:Hi("entity")("has_ontology_term"),technology:Hi("entity")("technology"),thumbnail:Hi("entity")("has_thumbnail")},In=Hi("ccf"),dc={x:In,ontologyNode:{label:In("ccf_preferred_label"),parent:In("ccf_part_of"),children:In("ccf_part_of"),rui_rank:In("ccf_rui_rank"),synonymLabels:Qn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:In("VHFemale"),Male:In("VHMale"),BothSexes:In("VHBothSexes"),FemaleOrgans:In("VHFemaleOrgans"),MaleOrgans:In("VHMaleOrgans")},SpatialObjectReference:In("SpatialObjectReference"),SpatialEntity:In("SpatialEntity"),SpatialPlacement:In("SpatialPlacement"),spatialObjectReference:{file:In("has_object_file"),file_format:In("has_object_file_format"),file_subpath:In("has_object_file_subpath")},extractionSet:{label:ym.label,rui_rank:In("ccf_rui_rank")},spatialEntity:{label:ym.label,comment:ym.comment,creator:Hi("dc")("creator"),creator_first_name:In("creator_first_name"),creator_last_name:In("creator_last_name"),creator_orcid:In("creator_orcid"),creation_date:In("creation_date"),updated_date:In("updated_date"),ccf_annotations:In("ccf_annotation"),representation_of:In("ccf_representation_of"),reference_organ:In("anatomical_structure_of"),extraction_set_for:In("extraction_set_for"),extraction_set:In("extraction_site_for"),sex:In("has_sex"),side:In("has_side"),rui_rank:In("ccf_rui_rank"),slice_thickness:In("ccf_slice_thickness"),slice_count:In("ccf_slice_count"),x_dimension:In("has_x_dimension"),y_dimension:In("has_y_dimension"),z_dimension:In("has_z_dimension"),dimension_units:In("has_dimension_units"),object:In("has_object_reference")},spatialPlacement:{source:In("has_placement_source"),target:In("has_placement_target"),placement_date:In("has_placement_date"),x_scaling:In("has_x_scaling"),y_scaling:In("has_y_scaling"),z_scaling:In("has_z_scaling"),scaling_units:In("has_scaling_units"),x_rotation:In("has_x_rotation"),y_rotation:In("has_y_rotation"),z_rotation:In("has_z_rotation"),w_rotation:In("has_theta_rotation"),rotation_order:In("has_rotation_order"),rotation_units:In("has_rotation_units"),x_translation:In("has_x_translation"),y_translation:In("has_y_translation"),z_translation:In("has_z_translation"),translation_units:In("has_translation_units")}},Tr={x:Hi("uberon")},mDe=(Hi("lmha"),{bladder:Tr.x("0001255"),body:Tr.x("0013702"),brain:Tr.x("0000955"),colon:Tr.x("0001155"),heart:Tr.x("0000948"),kidney:Tr.x("0002113"),large_intestine:Tr.x("0000059"),left_kidney:Tr.x("0004538"),left_lung:Tr.x("0002168"),left_ureter:Tr.x("0001223"),liver:Tr.x("0002107"),lung:Tr.x("0002048"),respiratory_system:Tr.x("0001004"),lymph_node:Tr.x("0000029"),pelvis:Tr.x("0001270"),rectum:Tr.x("0001052"),right_kidney:Tr.x("0004539"),right_lung:Tr.x("0002167"),right_ureter:Tr.x("0001222"),skin:Tr.x("0002097"),small_intestine:Tr.x("0002108"),spleen:Tr.x("0002106"),thymus:Tr.x("0002370"),ureter:Tr.x("0000056"),vasculature:Tr.x("0002049")});function vP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const f1={spatialObjectReference:vP(dc.spatialObjectReference),spatialEntity:vP(dc.spatialEntity),spatialPlacement:vP(dc.spatialPlacement)};function p1(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,$a.fromRdf)(s.object):s.object.id;(0,En.set)(r,o,a)}return!1},Qn.DataFactory.namedNode(e),null,null,null),r}const yDe=(0,En.memoize)(function(n,e){return p1(n,e,"SpatialObjectReference",f1.spatialObjectReference)},(n,e)=>e),bDe=(0,En.memoize)(function(n,e){const t=p1(n,e,"ExtractionSet",f1.spatialEntity);return t.extractionSites=(0,En.sortBy)(n.getSubjects(dc.spatialEntity.extraction_set,e,null).map(i=>vm(n,i.id)),["rui_rank"]),t},(n,e)=>e);(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(dc.spatialEntity.extraction_set_for,e,null).map(t=>bDe(n,t.id)),["rui_rank"])},(n,e)=>e),(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(dc.spatialEntity.reference_organ,e,null).map(t=>vm(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),(0,En.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(vm(n,t.subject.id))},null,dc.spatialEntity.reference_organ,null,null),(0,En.sortBy)(e,["rui_rank"])});const vm=(0,En.memoize)(function(n,e){const t=p1(n,e,"SpatialEntity",f1.spatialEntity);return t.object&&(t.object=yDe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,dc.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,Os.spatialEntity,e,null),t},(n,e)=>e);(0,En.memoize)(function(n,e){const t=p1(n,e,"SpatialPlacement",f1.spatialPlacement);return t.source&&(t.source=vm(n,t.source)),t.target&&(t.target=vm(n,t.target)),t},(n,e)=>e),(0,En.memoize)(function(n,e){const t=n.getObjects(Qn.DataFactory.namedNode(e),Os.spatialEntity,null);if(t.length>0)return vm(n,t[0].id)},(n,e)=>e),new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),function(){const n={};Object.entries(mDe).forEach(([e,t])=>n[e]=t.id)}();const y1={[Os.label.id]:"label",[Os.description.id]:"description",[Os.link.id]:"link"},WDe=Object.assign(Object.assign({},y1),{[Os.providerName.id]:"providerName"}),qDe=Object.assign(Object.assign({},y1),{[Os.technology.id]:"technology",[Os.thumbnail.id]:"thumbnail"}),KDe=Object.assign(Object.assign({},y1),{[Os.sampleType.id]:"sampleType",[Os.sectionNumber.id]:"sectionNumber",[Os.datasets.id]:"datasets"}),YDe=Object.assign(Object.assign({},y1),{[Os.sampleType.id]:"sampleType",[Os.sectionCount.id]:"sectionCount",[Os.sectionSize.id]:"sectionSize",[Os.sectionUnits.id]:"sectionUnits",[Os.donor.id]:"donor",[Os.spatialEntity.id]:"spatialEntityId",[Os.sections.id]:"sections",[Os.datasets.id]:"datasets"}),QDe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=WDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function d7(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=qDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t}(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=YDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=KDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=d7(n,s);t[r].push(o)}else(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=d7(n,s);t[r].push(o)}else"donor"===r?t[r]=QDe(n,s):(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);const h7={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};function ru(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let bP;function hc(){return bP||(bP=function(n,e){const t=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const i=()=>indexedDB.databases().finally(t);e=setInterval(i,100),i()}).finally(()=>clearInterval(e))}().then(()=>{const i=indexedDB.open("keyval-store");return i.onupgradeneeded=()=>i.result.createObjectStore(e),ru(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),bP}function f7(n,e=hc()){return e("readonly",t=>ru(t.get(n)))}const Gi=Qn.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},Qn.DataFactory),p7={x:Gi("rdf"),type:Gi("rdf")("type")},bm={x:Gi("rdfs"),label:Gi("rdfs")("label"),comment:Gi("rdfs")("comment"),isDefinedBy:Gi("rdfs")("isDefinedBy"),seeAlso:Gi("rdfs")("seeAlso")},gi={x:Gi("entity"),id:Gi("entity")("id"),label:bm.label,description:bm.comment,link:bm.seeAlso,sex:Gi("entity")("sex"),age:Gi("entity")("age"),bmi:Gi("entity")("bmi"),Male:Qn.DataFactory.literal("Male"),Female:Qn.DataFactory.literal("Female"),consortiumName:Gi("entity")("consortium_name"),providerName:Gi("entity")("provider_name"),providerUUID:Gi("entity")("provider_uuid"),donor:Gi("entity")("has_donor"),sections:Gi("entity")("has_tissue_section"),datasets:Gi("entity")("has_dataset"),sampleType:Gi("entity")("sample_type"),TissueBlock:Qn.DataFactory.literal("Tissue Block"),TissueSection:Qn.DataFactory.literal("Tissue Section"),NonStandard:Qn.DataFactory.literal("Non-standard"),sectionCount:Gi("entity")("section_count"),sectionSize:Gi("entity")("section_size"),sectionUnits:Gi("entity")("section_units"),sectionNumber:Gi("entity")("section_number"),spatialEntity:Gi("entity")("has_spatial_entity"),ontologyTerms:Gi("entity")("has_ontology_term"),technology:Gi("entity")("technology"),thumbnail:Gi("entity")("has_thumbnail")},Rn=Gi("ccf"),lr={x:Rn,ontologyNode:{label:Rn("ccf_preferred_label"),parent:Rn("ccf_part_of"),children:Rn("ccf_part_of"),rui_rank:Rn("ccf_rui_rank"),synonymLabels:Qn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:Rn("VHFemale"),Male:Rn("VHMale"),BothSexes:Rn("VHBothSexes"),FemaleOrgans:Rn("VHFemaleOrgans"),MaleOrgans:Rn("VHMaleOrgans")},SpatialObjectReference:Rn("SpatialObjectReference"),SpatialEntity:Rn("SpatialEntity"),SpatialPlacement:Rn("SpatialPlacement"),spatialObjectReference:{file:Rn("has_object_file"),file_format:Rn("has_object_file_format"),file_subpath:Rn("has_object_file_subpath")},extractionSet:{label:bm.label,rui_rank:Rn("ccf_rui_rank")},spatialEntity:{label:bm.label,comment:bm.comment,creator:Gi("dc")("creator"),creator_first_name:Rn("creator_first_name"),creator_last_name:Rn("creator_last_name"),creator_orcid:Rn("creator_orcid"),creation_date:Rn("creation_date"),updated_date:Rn("updated_date"),ccf_annotations:Rn("ccf_annotation"),representation_of:Rn("ccf_representation_of"),reference_organ:Rn("anatomical_structure_of"),extraction_set_for:Rn("extraction_set_for"),extraction_set:Rn("extraction_site_for"),sex:Rn("has_sex"),side:Rn("has_side"),rui_rank:Rn("ccf_rui_rank"),slice_thickness:Rn("ccf_slice_thickness"),slice_count:Rn("ccf_slice_count"),x_dimension:Rn("has_x_dimension"),y_dimension:Rn("has_y_dimension"),z_dimension:Rn("has_z_dimension"),dimension_units:Rn("has_dimension_units"),object:Rn("has_object_reference")},spatialPlacement:{source:Rn("has_placement_source"),target:Rn("has_placement_target"),placement_date:Rn("has_placement_date"),x_scaling:Rn("has_x_scaling"),y_scaling:Rn("has_y_scaling"),z_scaling:Rn("has_z_scaling"),scaling_units:Rn("has_scaling_units"),x_rotation:Rn("has_x_rotation"),y_rotation:Rn("has_y_rotation"),z_rotation:Rn("has_z_rotation"),w_rotation:Rn("has_theta_rotation"),rotation_order:Rn("has_rotation_order"),rotation_units:Rn("has_rotation_units"),x_translation:Rn("has_x_translation"),y_translation:Rn("has_y_translation"),z_translation:Rn("has_z_translation"),translation_units:Rn("has_translation_units")}},Mr={x:Gi("uberon")},g7=(Gi("lmha"),{bladder:Mr.x("0001255"),body:Mr.x("0013702"),brain:Mr.x("0000955"),colon:Mr.x("0001155"),heart:Mr.x("0000948"),kidney:Mr.x("0002113"),large_intestine:Mr.x("0000059"),left_kidney:Mr.x("0004538"),left_lung:Mr.x("0002168"),left_ureter:Mr.x("0001223"),liver:Mr.x("0002107"),lung:Mr.x("0002048"),respiratory_system:Mr.x("0001004"),lymph_node:Mr.x("0000029"),pelvis:Mr.x("0001270"),rectum:Mr.x("0001052"),right_kidney:Mr.x("0004539"),right_lung:Mr.x("0002167"),right_ureter:Mr.x("0001222"),skin:Mr.x("0002097"),small_intestine:Mr.x("0002108"),spleen:Mr.x("0002106"),thymus:Mr.x("0002370"),ureter:Mr.x("0000056"),vasculature:Mr.x("0002049")});function EP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const v1={spatialObjectReference:EP(lr.spatialObjectReference),spatialEntity:EP(lr.spatialEntity),spatialPlacement:EP(lr.spatialPlacement)};function b1(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,$a.fromRdf)(s.object):s.object.id;(0,En.set)(r,o,a)}return!1},Qn.DataFactory.namedNode(e),null,null,null),r}const aIe=(0,En.memoize)(function(n,e){return b1(n,e,"SpatialObjectReference",v1.spatialObjectReference)},(n,e)=>e),m7=(0,En.memoize)(function(n,e){const t=b1(n,e,"ExtractionSet",v1.spatialEntity);return t.extractionSites=(0,En.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set,e,null).map(i=>$f(n,i.id)),["rui_rank"]),t},(n,e)=>e),uIe=(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set_for,e,null).map(t=>m7(n,t.id)),["rui_rank"])},(n,e)=>e),hIe=(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(lr.spatialEntity.reference_organ,e,null).map(t=>$f(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),pIe=(0,En.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push($f(n,t.subject.id))},null,lr.spatialEntity.reference_organ,null,null),(0,En.sortBy)(e,["rui_rank"])}),$f=(0,En.memoize)(function(n,e){const t=b1(n,e,"SpatialEntity",v1.spatialEntity);return t.object&&(t.object=aIe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,lr.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,gi.spatialEntity,e,null),t},(n,e)=>e),_Ie=(0,En.memoize)(function(n,e){const t=b1(n,e,"SpatialPlacement",v1.spatialPlacement);return t.source&&(t.source=$f(n,t.source)),t.target&&(t.target=$f(n,t.target)),t},(n,e)=>e),vIe=(0,En.memoize)(function(n,e){const t=n.getObjects(Qn.DataFactory.namedNode(e),gi.spatialEntity,null);if(t.length>0)return $f(n,t[0].id)},(n,e)=>e);function bIe(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(kB),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class _7{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new hDe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},p7.type,lr.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},p7.type,lr.SpatialEntity,null);const t={};e.some(i=>(t[i.subject.id]=i.object.id,!1),null,lr.spatialPlacement.source,null,null),e.some(i=>{const r=t[i.subject.id];return r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement"),!1},null,lr.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,i,r){this.graph.mergeDirectedEdge(t,i,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new $n($n.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new $n($n.IDENTITY),s=pDe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s){if(o){const l=this.graph.getEdgeAttribute(a,o,"id");bIe(r,_Ie(i,l))}o=a}return r}}}class y7{constructor(e){this.db=e}getSpatialEntity(e){return $f(this.db.store,e)}getExtractionSets(e){return uIe(this.db.store,e)}getExtractionSet(e){return m7(this.db.store,e)}getAnatomicalStructures(e){return hIe(this.db.store,e)}getReferenceOrgans(){return pIe(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=lr.spatial.Male.id;break;case"Female":t=lr.spatial.Female.id;break;case"Both":default:t=lr.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(i=>"Male"===i.sex);break;case"Female":t=t.filter(i=>"Female"===i.sex)}return(null==e?void 0:e.debug)&&(t=t.map(i=>[[i],this.getAnatomicalStructures(i["@id"])]).reduce((i,[r,s])=>i.concat(s.length>0?s:r),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let i=[...this.getReferenceOrganSets(e).map(r=>{const s="http://purl.obolibrary.org/obo/UBERON_0002097"===r.representation_of;return this.getSceneNode(r,t,{color:[255,255,255,255],opacity:s?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!s})})];return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(lr.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(r=>void 0!==r)}getReferenceOrganScene(e,t){var i,r;const s=null!==(i=void 0!==(null==t?void 0:t.sex))&&void 0!==i&&i,o=this.getReferenceOrgans().filter(a=>a.representation_of===e&&(!s||a.sex===(null==t?void 0:t.sex)));if(o.length>0){const a=o[0],c=this.getSceneNode(a,a,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===a.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),d=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(f=>this.getSceneNode(f,a,{color:[255,255,255,229.5]}));return[c].concat(d).filter(f=>void 0!==f)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(i=>this.getSceneNode(i,t,{color:[255,255,255,229.5]})).filter(i=>void 0!==i)}getSceneNode(e,t,i={}){var r,s,o,a;const l=null===(s=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===s?void 0:s.startsWith("model/gltf");let d=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(d){if(l)d=new $n($n.IDENTITY).rotateX(kB(90)).multiplyLeft(d);else{let f;switch(e.dimension_units){case"centimeter":f=.01;break;case"millimeter":f=.001;break;case"meter":default:f=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*f/2);d.scale(p)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:l?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:l?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:d,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const w1="https://entity.api.hubmapconsortium.org/entities/",v7=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),wIe={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},E1={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},xi=function(){const n={};return Object.entries(g7).forEach(([e,t])=>n[e]=t.id),n}(),SIe={BL:[xi.body,xi.bladder],RK:[xi.body,xi.kidney,xi.right_kidney],LK:[xi.body,xi.kidney,xi.left_kidney],HT:[xi.body,xi.heart],LI:[xi.body,xi.large_intestine,xi.colon],SI:[xi.body,xi.small_instestine],LL:[xi.body,xi.respiratory_system,xi.lung,xi.left_lung],RL:[xi.body,xi.respiratory_system,xi.lung,xi.right_lung],LY:[xi.body,xi.lymph_node],SP:[xi.body,xi.spleen],TH:[xi.body,xi.thymus],UR:[xi.body,xi.ureter],LV:[xi.body,xi.liver],OT:[xi.body]},b7={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class AIe{constructor(e,t="",i="",r){var s,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const c=this.data.descendants||[],d=(this.data.ancestors||[]).find($e=>"Donor"===$e.entity_type);this.donor=this.getDonor(d,i);const f=this.getRuiLocation(e,this.donor);f?this.rui_location=f:this.bad=!0;const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=E1[e.group_uuid]||e.group_name,_=e.created_by_user_displayname;this["@id"]=w1+e.uuid,this.label=`Registered ${p}, ${_}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const x={},A=[];this.sections=A;const W=[];this.datasets=W;for(const $e of c.filter(at=>"Sample"===at.entity_type)){const at=this.getSection($e,e,i);x[$e.submission_id]=at,A.push(at),at.section_number=null!==(s=at.section_number)&&void 0!==s?s:A.length}for(const $e of c)if("Dataset"===$e.entity_type){const at=this.getDataset($e,t,i,r),St=(0,En.get)($e,["ingest_metadata","metadata","tissue_id"]);x[St]?null===(o=x[St].datasets)||void 0===o||o.push(at):W.push(at)}const G=null!=f?f:{},ge=`${G.x_dimension} x ${G.y_dimension} x ${G.z_dimension} ${G.dimension_units}`;this.section_count=G.slice_count||A.length;const Ne=parseFloat((G.slice_thickness||(G.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ne;const Ge=G.dimension_units||"millimeter";this.section_units=Ge,this.description=`${ge}, ${Ne} ${Ge}, ${e.specimen_type}, ${this.section_count} Sections`,A.forEach(($e,at)=>{$e.description=`${G.x_dimension} x ${G.y_dimension} x ${Ne} ${Ge}, ${Ne} ${Ge}, ${$e.description}`,$e.section_number=at+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":w1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${E1[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${i}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",i="",r){var s;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=E1[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,En.get)(e,["ingest_metadata","metadata","assay_type"],"")],d=c.join("|").toLowerCase();let f,p="assets/icons/ico-unknown.svg";return-1!==d.indexOf("10x")?(f="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==d.indexOf("af")?(f="AF",p="assets/icons/ico-spatial-af.svg"):-1!==d.indexOf("codex")?(f="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==d.indexOf("imc")?(f="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==d.indexOf("lc")&&-1===d.indexOf("af")?(f="LC",p="assets/icons/ico-bulk-lc.svg"):f=-1!==d.indexOf("maldi")?"MALDI":-1!==d.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":w1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:f,thumbnail:p}}getDatasetThumbnail(e,t,i){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(i?`?token=${i}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,En.get)(e,"metadata.files",[]).filter(s=>/\.(ome\.tif|ome\.tiff)$/.test(s.rel_path)).filter(s=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(s.rel_path)).filter(s=>v7.has(s.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(s=>`${t}/${e.uuid}/${s.rel_path}`+(i?`?token=${i}`:""));if(r.length>0){const s=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(v7.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=wIe[e.hubmap_id];if(r)return`assets/thumbnails/TMC-Florida/${r}`}}getDonor(e,t){const i=(e.description||"").toLowerCase();let r;i.includes("female")?r="Female":i.includes("male")&&(r="Male");const s=i.match(/age ([0-9]+)/);let o,a;s&&(o=(0,En.toNumber)(s[1]));for(const p of(0,En.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===p.preferred_term||"Female"===p.preferred_term?r="Female":"Masculine gender"===p.preferred_term||"Male"===p.preferred_term?r="Male":"Current chronological age"===p.preferred_term||"Age"===p.preferred_term?o=(0,En.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,En.toNumber)(p.data_value));let l="";r&&o&&(l+=`${r}, Age ${o}`,a&&(l+=`, BMI ${a.toFixed(1)}`));const c=new Date(e.last_modified_timestamp).toLocaleDateString(),d=E1[e.group_uuid]||e.group_name;return{"@id":w1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${d}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;const s=(e.ancestors||[]).find(c=>"Sample"===c.entity_type&&"organ"===c.specimen_type),o=SIe[null==s?void 0:s.organ]||[xi.body];let a,l=e.rui_location;if(l&&("string"==typeof l&&(l=JSON.parse(l)),l.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):l["@id"]&&(a=l)),a){a.ccf_annotations=o.concat(a.ccf_annotations||[]);const c=null!==(i=(0,En.get)(a,["placement","target"]))&&void 0!==i?i:"";c.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,En.set)(a,["placement","target"],c.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===c||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===c)&&(0,En.set)(a,["placement","target"],"Male"===t.sex?c.replace("#VH","#VHM")+"_Patch":c.replace("#VH","#VHF")+"_Patch")}return a}getTissueBlock(){return(0,En.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function w7(n,e,t,i,r="",s=""){return ir(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(n).then(a=>a.ok?a.json():void 0).catch(()=>{});else if("search-api"===e){const a={"Content-type":"application/json"};i&&i.length>0&&(a.Authorization=`Bearer ${i}`),o=yield fetch(n,{method:"POST",headers:a,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:{exists:{field:"rui_location"}}})}).then(l=>l.ok?l.json():void 0).catch(()=>{})}if(o)return function(n,e="",t="",i,r=!1){const o={},a=(0,En.get)(n,"hits.hits",[]).map(c=>(0,En.get)(c,"_source",{})).map(c=>new AIe(c,e,t,i).toJsonLd());for(const c of a){const d=c["@id"];o[d]?o[d].samples.push(c.samples[0]):o[d]=c}const l=Object.values(o);return r&&(function(n){let e=[],t=0;for(const i of n.filter(r=>r.samples.length>1)){const r=i.samples;for(let s=0;sc["@id"]===o)&&(r[s].deleteMe=!0,t++)}i.samples=r.filter(s=>!0!==s.deleteMe)}t>0&&console.log(`\u26a0 ${t} sections identified as blocks`)}(l),console.log(l.map(c=>Object.assign({"@context":b7},c)))),{"@context":b7,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function S1(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.donor,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}function pv(n,e){return t=>n.has(t.id)?e.add(t.id):void 0}const zIe={[lr.ontologyNode.label.id]:"label",[lr.ontologyNode.parent.id]:"parent",[lr.ontologyNode.synonymLabels.id]:"synonymLabels"};function HIe(n,e){const t=Qn.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return n.some(r=>{const s=zIe[r.predicate.id];if(s){const o="Literal"===r.object.termType?(0,$a.fromRdf)(r.object):r.object.id;"synonymLabels"===s?i.synonymLabels.push(o):(0,En.set)(i,s,o)}return!1},t,null,null,null),i.children=n.getSubjects(lr.ontologyNode.children,t,null).map(r=>r.id),i}const x1={[gi.label.id]:"label",[gi.description.id]:"description",[gi.link.id]:"link"},$Ie=Object.assign(Object.assign({},x1),{[gi.providerName.id]:"providerName"}),WIe=Object.assign(Object.assign({},x1),{[gi.technology.id]:"technology",[gi.thumbnail.id]:"thumbnail"}),qIe=Object.assign(Object.assign({},x1),{[gi.sampleType.id]:"sampleType",[gi.sectionNumber.id]:"sectionNumber",[gi.datasets.id]:"datasets"}),KIe=Object.assign(Object.assign({},x1),{[gi.sampleType.id]:"sampleType",[gi.sectionCount.id]:"sectionCount",[gi.sectionSize.id]:"sectionSize",[gi.sectionUnits.id]:"sectionUnits",[gi.donor.id]:"donor",[gi.spatialEntity.id]:"spatialEntityId",[gi.sections.id]:"sections",[gi.datasets.id]:"datasets"}),XIe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=$Ie[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function E7(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=WIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t}const JIe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=KIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=qIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=E7(n,s);t[r].push(o)}else(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=E7(n,s);t[r].push(o)}else"donor"===r?t[r]=XIe(n,s):(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e),eRe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class tRe{constructor(e=eRe){this.options=e,this.store=new Qn.Store(void 0,{factory:Qn.DataFactory}),this.graph=new _7(this),this.scene=new y7(this)}connect(e,t=!1){return ir(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return ir(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield f7(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=hc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),ru(t.transaction)))}([i,t]).catch(()=>{}):s=yield f7(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=hc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),ru(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return ir(this,void 0,void 0,function*(){const i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],s=this.options.ccfOwlUrl;if(s.endsWith(".n3store.json")){const o=yield fetch(s).then(a=>a.text()).catch(()=>console.log("Couldn't locate serialized store."));o&&(this.store=(0,Qn.deserializeN3Store)(o,Qn.DataFactory))}else(null==s?void 0:s.length)>0&&r.push(s);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(w7(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(o=>{if(o)return this.addDataSources([o])}))),i.push(this.addDataSources(r)),yield Promise.all(i),yield this.synchronize()})}addDataSources(e,t){return ir(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>ir(this,void 0,void 0,function*(){"string"==typeof r?r.endsWith("jsonld")?yield(0,Qn.addJsonLdToStore)(r,i):r.endsWith("n3")?yield(0,Qn.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,Qn.addRdfXmlToStore)(r,i):yield(0,Qn.addJsonLdToStore)(r,i):yield(0,Qn.addJsonLdToStore)(r,i)}))),this})}synchronize(){return ir(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,Qn.serializeN3Store)(this.store)}deserialize(e){return ir(this,void 0,void 0,function*(){this.store=(0,Qn.deserializeN3Store)(e,Qn.DataFactory),this.graph=new _7(this),this.scene=new y7(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e){var t,i,r,s,o;let a=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),gi.spatialEntity,null,null),e}(n);if(a.size>0&&(a=function(n,e,t=!0){const i=new Set;if(n.forSubjects(pv(e,i),gi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const l=e.sex;a=S1(n,a,c=>function(n,e,t){const i=new Set;return n.forSubjects(pv(e,i),gi.sex,gi[t],null),i}(n,c,l))}if(a.size>0&&(null===(t=e.tmc)||void 0===t?void 0:t.length)>0&&(a=S1(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Qn.DataFactory.literal(r);n.forSubjects(pv(e,i),gi.providerName,s,null)}return i}(n,l,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set,o=new Set;n.some(c=>(e.has(c.subject.id)&&o.add(c.object.id),!1),null,gi.sections,null,null),n.some(c=>{var d;return(e.has(c.subject.id)||o.has(c.subject.id))&&(s.add(c.object.id),r.has(c.object.id)?null===(d=r.get(c.object.id))||void 0===d||d.push(c.subject.id):r.set(c.object.id,[c.subject.id])),!1},null,gi.datasets,null,null);const a=t(s),l=new Set;for(const c of a)for(const d of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(d);return l}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Qn.DataFactory.literal(r);n.forSubjects(pv(e,i),gi.technology,s,null)}return i}(n,l,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.spatialEntity,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Qn.DataFactory.namedNode(r);n.forSubjects(pv(e,i),lr.spatialEntity.ccf_annotations,s,null)}return i}(n,l,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,En.isFinite)(e.ageRange[0])&&(0,En.isFinite)(e.ageRange[1])){const l=Math.max(...e.ageRange),c=Math.min(...e.ageRange);1===c&&110===l||(a=S1(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,$a.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.age,null,null),r}(n,d,c,l)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,En.isFinite)(e.bmiRange[0])&&(0,En.isFinite)(e.bmiRange[1])){const l=Math.max(...e.bmiRange),c=Math.min(...e.bmiRange);13===c&&83===l||(a=S1(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,$a.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.bmi,null,null),r}(n,d,c,l)))}return a}(this.store,e)}get(e){return this.store.getQuads(Qn.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(t=>this.get(t))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>vIe(this.store,t))}getDatasetTechnologyNames(){return ir(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return ir(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return ir(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>JIe(this.store,t))})}getAggregateResults(e){return ir(this,void 0,void 0,function*(){return function(n,e){const t=new Set;e.some(l=>(n.has(l.subject.id)&&t.add(l.object.id),!1),null,gi.donor,null,null);const i=new Set;e.some(l=>(t.has(l.subject.id)&&i.add(l.object.id),!1),null,gi.providerUUID,null,null);const r=new Set;e.forSubjects(l=>{n.has(l.id)&&r.add(l.id)},gi.spatialEntity,null,null);const s=new Set;e.some(l=>(r.has(l.subject.id)&&s.add(l.object.id),!1),null,gi.sections,null,null);const o=new Set;return e.some(l=>{const c=l.subject;return(r.has(c.id)||s.has(c.id))&&o.add(l.object.id),!1},null,gi.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:t.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([l,c])=>({label:l,count:c}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return ir(this,void 0,void 0,function*(){return function(n,e){const t=new Map;e.some(r=>(n.has(r.subject.id)&&(t.has(r.object.id)?t.get(r.object.id).push(r.subject.id):t.set(r.object.id,[r.subject.id])),!1),null,gi.spatialEntity,null,null);const i={};return e.some(r=>{var s,o;if(t.has(r.subject.id)){const a=null!==(o=null===(s=t.get(r.subject.id))||void 0===s?void 0:s.length)&&void 0!==o?o:0;i[r.object.id]=a+(i[r.object.id]||0)}return!1},null,lr.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store)})}getOntologyTreeModel(){return ir(this,void 0,void 0,function*(){return function(n){const e={root:g7.body.id,nodes:{}},t=new Set;n.some(i=>(t.add(i.subject.id),t.add(i.predicate.id),!1),null,lr.ontologyNode.parent,null,null);for(const i of t)e.nodes[i]=HIe(n,i);return e}(this.store)})}getReferenceOrgans(){return ir(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return ir(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return ir(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}}function iRe(n,e){return n===e}let rRe=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new S,this.dataSource=i.getOption("data").pipe(me(r=>Object.assign(Object.assign({},h7),{dataSources:r})),Ui(r=>Object.keys(r).length>0),me(r=>r),$u(iRe),Ur(r=>function(n,e){return new F(t=>{let i,r;try{i=n()}catch(a){return void t.error(a)}try{r=e(i)}catch(a){return void t.error(a)}const o=(r?Pe(r):Lc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),ka(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Ur(i=>i.getTissueBlockResults(t)),Yi(1))}getAggregateResults(t){return this.dataSource.pipe(Ur(i=>i.getAggregateResults(t)),Yi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Ur(i=>i.getOntologyTermOccurences(t)),Yi(1))}getOntologyTreeModel(){return this.dataSource.pipe(Ur(t=>t.getOntologyTreeModel()),Yi(1))}getReferenceOrgans(){return this.dataSource.pipe(Ur(t=>t.getReferenceOrgans()),Yi(1))}getScene(t){return this.dataSource.pipe(Ur(i=>i.getScene(t)),Yi(1))}getOrganScene(t,i){return this.dataSource.pipe(Ur(r=>r.getReferenceOrganScene(t,i)),Yi(1))}createDataSource(){return{source:new tRe,unsubscribe:()=>{}}}connectDataSource(t,i){return ir(this,void 0,void 0,function*(){const r=(new Date).getTime();return yield t.connect(i,!1),Uy.production||(console.info(`Loaded CCF database in ${((new Date).getTime()-r)/1e3}s`),console.log(t)),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(cf),Ie(hv))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),sRe=(()=>{class n{constructor(t,i){this.configState=t,this.source=i,this.data$=this.configState.getOption("data"),this.zoomToID$=this.configState.getOption("zoomToID").pipe(me(r=>`http://purl.org/ccf/1.5/entity/${r}`)),this.highlightID$=this.configState.getOption("highlightID").pipe(me(r=>`http://purl.org/ccf/1.5/entity/${r}`)),this.referenceOrgans$=this.source.getReferenceOrgans(),this.scene$=Uo([this.data$,this.referenceOrgans$,this.source.dataSource]).pipe(Ur(([r,s,o])=>this.chooseScene(r,s))),this.organs$=this.configState.getOption("data").pipe(me(r=>this.selectOrgans(r)),ka(1)),this.filteredOrgans$=Uo([this.organs$,this.referenceOrgans$]).pipe(me(([r,s])=>this.getNeededReferenceOrgans(s,r)),ka(1)),this.filteredScene$=Uo([this.scene$,this.organs$,this.referenceOrgans$]).pipe(me(([r,s,o])=>this.filterSceneNodes(r,s,o)),function(n,e){const t=n.pipe(Vo(""));return i=>Uo([i,t]).pipe(me(([r,s])=>r.map(o=>function(n,e,t){return n.entityId!==e?n:Object.assign(Object.assign({},n),{color:t})}(o,s,e))))}(this.highlightID$,aDe),function(n){const e=n.pipe(Vo(""));return t=>Uo([t,e]).pipe(me(([i,r])=>i.map(s=>function(n,e){return n.entityId!==e?n:Object.assign(Object.assign({},n),{zoomToOnLoad:!0})}(s,r))))}(this.zoomToID$),ka(1))}chooseScene(t,i){var r;const s=null!==(r=null==t?void 0:t.map(a=>{const l=a[l7];return null==l?void 0:l.placement.target}))&&void 0!==r?r:[];if(new Set(s).size>1)return this.source.getScene();if(i){const a=i.find(l=>l["@id"]===s[0]);if(a)return this.source.getOrganScene(a.representation_of,{ontologyTerms:[a.reference_organ],sex:a.sex})}return an([])}selectOrgans(t){const r=(null!=t?t:[]).map(s=>s[l7].placement.target);return new Set(r)}filterSceneNodes(t,i,r){const s=this.getNeededReferenceOrgans(r,i),o=this.getNeededSkins(s),a=new Set([...i,...o]);return t.filter(c=>!c.reference_organ||a.has(c.reference_organ))}getNeededReferenceOrgans(t,i){return t.filter(r=>{var s;return i.has(null!==(s=r.reference_organ)&&void 0!==s?s:"")})}getNeededSkins(t){if(1===t.length)return[];const i=new Set;return t.forEach(r=>{"Female"===r.sex?i.add("http://purl.org/ccf/latest/ccf.owl#VHFSkin"):"Male"===r.sex&&i.add("http://purl.org/ccf/latest/ccf.owl#VHMSkin")}),[...i]}}return n.\u0275fac=function(t){return new(t||n)(Ie(hv),Ie(rRe))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const oRe=["bodyUI"];let aRe=(()=>{class n{constructor(t,i,r){this.configState=t,this.sceneSource=i,this.cdr=r,this.onMouseEnter=new cn,this.onMouseLeave=new cn,this.onClick=new cn,this.data$=this.configState.getOption("data"),this.organs$=this.sceneSource.filteredOrgans$,this.scene$=this.sceneSource.filteredScene$.pipe(Zr(s=>this.reset()))}reset(){var t,i;return ir(this,void 0,void 0,function*(){const{bodyUI:r}=this;yield new Promise(a=>setTimeout(a,200));const s=yield this.organs$.pipe(Yi(1)).toPromise(),o=null!==(i=!!(null===(t=r.scene)||void 0===t?void 0:t.find(a=>a.zoomToOnLoad)))&&void 0!==i&&i;if(r.rotation=0,r.rotationX=0,!o)if(1===s.length){const{x_dimension:a,y_dimension:l,z_dimension:c}=s[0];r.bounds={x:1.25*a/1e3,y:1.25*l/1e3,z:1.25*c/1e3},r.target=[a/1e3/2,l/1e3/2,c/1e3/2]}else r.bounds={x:2.2,y:2,z:.4},r.target=[0,0,0];this.cdr.detectChanges()})}}return n.\u0275fac=function(t){return new(t||n)(Me(hv),Me(sRe),Me(is))},n.\u0275cmp=wn({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&Ms(oRe,7),2&t){let r;Ai(r=Ti())&&(i.bodyUI=r.first)}},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},decls:3,vars:4,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""]],template:function(t,i){1&t&&(Kt(0,"ccf-body-ui",0,1),ui("nodeClick",function(s){return i.onClick.emit(s)})("nodeHoverStart",function(s){return i.onMouseEnter.emit(s)})("nodeHoverStop",function(s){return i.onMouseLeave.emit(s)}),function(n,e){const t=fi();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new Qe("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=mc(i.type)),o=ha(Me);try{const a=rp(!1),l=s();rp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Ft(),r,l)}finally{ha(o)}}(2,"async"),Yt()),2&t&&vn("scene",Ty(2,2,i.scene$))("interactive",!0)},directives:[IMe],pipes:[cE],styles:[".body-ui[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0}),n})();function lRe(n,e){if(1&n){const t=Ft();Kt(0,"ccf-root",1),ui("onMouseEnter",function(r){return ya(t),cr().onMouseEnter.emit(r)})("onMouseLeave",function(r){return ya(t),cr().onMouseLeave.emit(r)})("onClick",function(r){return ya(t),cr().onClick.emit(r)}),Yt()}}function cRe(n){return n.map(e=>({"@id":`http://purl.org/ccf/1.5/entity/${e.id}`,"@type":"http://purl.org/ccf/latest/ccf-entity.owl#Sample","http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity":e.rui_location}))}let uRe=(()=>{class n extends hee{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},Uy.dbOptions),globalThis.dbOptions),parse:{data:cRe}}),this.onMouseEnter=new cn,this.onMouseLeave=new cn,this.onClick=new cn}}return n.\u0275fac=function(t){return new(t||n)(Me(hv),Me(is))},n.\u0275cmp=wn({type:n,selectors:[["ccf-root-wc"]],inputs:{data:"data",highlightID:"highlightID",zoomToID:"zoomToID"},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},features:[Nn],decls:1,vars:1,consts:[[3,"onMouseEnter","onMouseLeave","onClick",4,"ngIf"],[3,"onMouseEnter","onMouseLeave","onClick"]],template:function(t,i){1&t&&function(n,e,t,i,r,s,o,a){const l=Ft(),c=fi(),d=n+20,f=c.firstCreatePass?function(n,e,t,i,r,s,o,a,l){const c=e.consts,d=Pd(e,n,4,o||null,_a(c,a));z_(e,t,d,_a(c,l)),ep(e,d);const f=d.tViews=Fp(2,d,i,r,s,e.directiveRegistry,e.pipeRegistry,null,e.schemas,c);return null!==e.queries&&(e.queries.template(e,d),f.queries=e.queries.embeddedTView(d)),d}(d,c,l,e,t,i,r,s,o):c.data[d];Qa(f,!1);const p=l[11].createComment("");Mp(c,l,p,f),xs(p,l),Lp(l,l[d]=iw(p,l,p,f)),cd(f)&&Kh(c,l,f),null!=o&&U_(l,f,a)}(0,lRe,1,0,"ccf-root",0),2&t&&vn("ngIf",i.initialized)},directives:[Ru,aRe],encapsulation:2,changeDetection:0}),n})(),dRe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[ls,Ga,zG,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(ls,2),Ie(Ga,2))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();const C1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class pRe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=Mf(this.action),i=function(n){return C1(n.getHours(),2)+":"+C1(n.getMinutes(),2)+":"+C1(n.getSeconds(),2)+"."+C1(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class gRe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const S7=new Vt("NGXS_LOGGER_PLUGIN_OPTIONS");let mRe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new gRe(this._options),this._store=this._store||this._injector.get(ih);const s=new pRe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Zr(o=>{s.completed(o)}),lc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(S7),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const x7=new Vt("LOGGER_USER_OPTIONS");function _Re(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let yRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:Q4,useClass:mRe,multi:!0},{provide:x7,useValue:t},{provide:S7,useFactory:_Re,deps:[x7]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();const vRe=[hv];let bRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({imports:[[dRe.forRoot(),la.forRoot(vRe,{developmentMode:!Uy.production}),yRe.forRoot({disabled:Uy.production})]]}),n})(),wRe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(fl).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new oee(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends lee{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(uRe,{injector:this.injector});customElements.define("ccf-body-ui-wc",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:[],imports:[[YM,bRe,RMe]]}),n})();Uy.production&&function(){if(xk)throw new Error("Cannot enable prod mode after platform setup.");Sk=!1}(),DJ().bootstrapModule(wRe).catch(n=>console.error(n))},52:kt=>{function it(gt,J,At,dt,K,Ae,he){try{var q=gt[Ae](he),V=q.value}catch(L){return void At(L)}q.done?J(V):Promise.resolve(V).then(dt,K)}kt.exports=function(gt){return function(){var J=this,At=arguments;return new Promise(function(dt,K){var Ae=gt.apply(J,At);function he(V){it(Ae,dt,K,he,q,"next",V)}function q(V){it(Ae,dt,K,he,q,"throw",V)}he(void 0)})}},kt.exports.default=kt.exports,kt.exports.__esModule=!0},948:kt=>{kt.exports=function(tt){return tt&&tt.__esModule?tt:{default:tt}},kt.exports.default=kt.exports,kt.exports.__esModule=!0},321:kt=>{function it(tt){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(kt.exports=it=function(J){return typeof J},kt.exports.default=kt.exports,kt.exports.__esModule=!0):(kt.exports=it=function(J){return J&&"function"==typeof Symbol&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},kt.exports.default=kt.exports,kt.exports.__esModule=!0),it(tt)}kt.exports=it,kt.exports.default=kt.exports,kt.exports.__esModule=!0},380:kt=>{function it(tt){return Promise.resolve().then(()=>{var gt=new Error("Cannot find module '"+tt+"'");throw gt.code="MODULE_NOT_FOUND",gt})}it.keys=()=>[],it.resolve=it,it.id=380,kt.exports=it},521:()=>{},125:()=>{},307:()=>{}},kt=>{kt(kt.s=18)}]); \ No newline at end of file diff --git a/body-ui/wc.js b/body-ui/wc.js index 01be43c5f..5ebaa2053 100644 --- a/body-ui/wc.js +++ b/body-ui/wc.js @@ -2,4 +2,4 @@ "use strict";(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[429],{277:()=>{!function(e){const n=e.performance;function i(I){n&&n.mark&&n.mark(I)}function r(I,p){n&&n.measure&&n.measure(I,p)}i("Zone");const c=e.__Zone_symbol_prefix||"__zone_symbol__";function u(I){return c+I}const f=!0===e[u("forceDuplicateZoneCheck")];if(e.Zone){if(f||"function"!=typeof e.Zone.__symbol__)throw new Error("Zone already loaded.");return e.Zone}let _=(()=>{class I{constructor(t,o){this._parent=t,this._name=o?o.name||"unnamed":"",this._properties=o&&o.properties||{},this._zoneDelegate=new T(this,this._parent&&this._parent._zoneDelegate,o)}static assertZonePatched(){if(e.Promise!==J.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let t=I.current;for(;t.parent;)t=t.parent;return t}static get current(){return G.zone}static get currentTask(){return te}static __load_patch(t,o,y=!1){if(J.hasOwnProperty(t)){if(!y&&f)throw Error("Already loaded patch: "+t)}else if(!e["__Zone_disable_"+t]){const P="Zone:"+t;i(P),J[t]=o(e,I,le),r(P,P)}}get parent(){return this._parent}get name(){return this._name}get(t){const o=this.getZoneWith(t);if(o)return o._properties[t]}getZoneWith(t){let o=this;for(;o;){if(o._properties.hasOwnProperty(t))return o;o=o._parent}return null}fork(t){if(!t)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,t)}wrap(t,o){if("function"!=typeof t)throw new Error("Expecting function got: "+t);const y=this._zoneDelegate.intercept(this,t,o),P=this;return function(){return P.runGuarded(y,this,arguments,o)}}run(t,o,y,P){G={parent:G,zone:this};try{return this._zoneDelegate.invoke(this,t,o,y,P)}finally{G=G.parent}}runGuarded(t,o=null,y,P){G={parent:G,zone:this};try{try{return this._zoneDelegate.invoke(this,t,o,y,P)}catch(K){if(this._zoneDelegate.handleError(this,K))throw K}}finally{G=G.parent}}runTask(t,o,y){if(t.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(t.zone||z).name+"; Execution: "+this.name+")");if(t.state===j&&(t.type===R||t.type===M))return;const P=t.state!=X;P&&t._transitionTo(X,O),t.runCount++;const K=te;te=t,G={parent:G,zone:this};try{t.type==M&&t.data&&!t.data.isPeriodic&&(t.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,t,o,y)}catch(l){if(this._zoneDelegate.handleError(this,l))throw l}}finally{t.state!==j&&t.state!==Y&&(t.type==R||t.data&&t.data.isPeriodic?P&&t._transitionTo(O,X):(t.runCount=0,this._updateTaskCount(t,-1),P&&t._transitionTo(j,X,j))),G=G.parent,te=K}}scheduleTask(t){if(t.zone&&t.zone!==this){let y=this;for(;y;){if(y===t.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${t.zone.name}`);y=y.parent}}t._transitionTo(q,j);const o=[];t._zoneDelegates=o,t._zone=this;try{t=this._zoneDelegate.scheduleTask(this,t)}catch(y){throw t._transitionTo(Y,q,j),this._zoneDelegate.handleError(this,y),y}return t._zoneDelegates===o&&this._updateTaskCount(t,1),t.state==q&&t._transitionTo(O,q),t}scheduleMicroTask(t,o,y,P){return this.scheduleTask(new m(v,t,o,y,P,void 0))}scheduleMacroTask(t,o,y,P,K){return this.scheduleTask(new m(M,t,o,y,P,K))}scheduleEventTask(t,o,y,P,K){return this.scheduleTask(new m(R,t,o,y,P,K))}cancelTask(t){if(t.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(t.zone||z).name+"; Execution: "+this.name+")");t._transitionTo(A,O,X);try{this._zoneDelegate.cancelTask(this,t)}catch(o){throw t._transitionTo(Y,A),this._zoneDelegate.handleError(this,o),o}return this._updateTaskCount(t,-1),t._transitionTo(j,A),t.runCount=0,t}_updateTaskCount(t,o){const y=t._zoneDelegates;-1==o&&(t._zoneDelegates=null);for(let P=0;PI.hasTask(t,o),onScheduleTask:(I,p,t,o)=>I.scheduleTask(t,o),onInvokeTask:(I,p,t,o,y,P)=>I.invokeTask(t,o,y,P),onCancelTask:(I,p,t,o)=>I.cancelTask(t,o)};class T{constructor(p,t,o){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=p,this._parentDelegate=t,this._forkZS=o&&(o&&o.onFork?o:t._forkZS),this._forkDlgt=o&&(o.onFork?t:t._forkDlgt),this._forkCurrZone=o&&(o.onFork?this.zone:t._forkCurrZone),this._interceptZS=o&&(o.onIntercept?o:t._interceptZS),this._interceptDlgt=o&&(o.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=o&&(o.onIntercept?this.zone:t._interceptCurrZone),this._invokeZS=o&&(o.onInvoke?o:t._invokeZS),this._invokeDlgt=o&&(o.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=o&&(o.onInvoke?this.zone:t._invokeCurrZone),this._handleErrorZS=o&&(o.onHandleError?o:t._handleErrorZS),this._handleErrorDlgt=o&&(o.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=o&&(o.onHandleError?this.zone:t._handleErrorCurrZone),this._scheduleTaskZS=o&&(o.onScheduleTask?o:t._scheduleTaskZS),this._scheduleTaskDlgt=o&&(o.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=o&&(o.onScheduleTask?this.zone:t._scheduleTaskCurrZone),this._invokeTaskZS=o&&(o.onInvokeTask?o:t._invokeTaskZS),this._invokeTaskDlgt=o&&(o.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=o&&(o.onInvokeTask?this.zone:t._invokeTaskCurrZone),this._cancelTaskZS=o&&(o.onCancelTask?o:t._cancelTaskZS),this._cancelTaskDlgt=o&&(o.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=o&&(o.onCancelTask?this.zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const y=o&&o.onHasTask;(y||t&&t._hasTaskZS)&&(this._hasTaskZS=y?o:g,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=p,o.onScheduleTask||(this._scheduleTaskZS=g,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),o.onInvokeTask||(this._invokeTaskZS=g,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),o.onCancelTask||(this._cancelTaskZS=g,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}fork(p,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,p,t):new _(p,t)}intercept(p,t,o){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,p,t,o):t}invoke(p,t,o,y,P){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,p,t,o,y,P):t.apply(o,y)}handleError(p,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,p,t)}scheduleTask(p,t){let o=t;if(this._scheduleTaskZS)this._hasTaskZS&&o._zoneDelegates.push(this._hasTaskDlgtOwner),o=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,p,t),o||(o=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=v)throw new Error("Task is missing scheduleFn.");d(t)}return o}invokeTask(p,t,o,y){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,p,t,o,y):t.callback.apply(o,y)}cancelTask(p,t){let o;if(this._cancelTaskZS)o=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,p,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");o=t.cancelFn(t)}return o}hasTask(p,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,p,t)}catch(o){this.handleError(p,o)}}_updateTaskCount(p,t){const o=this._taskCounts,y=o[p],P=o[p]=y+t;if(P<0)throw new Error("More tasks executed then were scheduled.");0!=y&&0!=P||this.hasTask(this.zone,{microTask:o.microTask>0,macroTask:o.macroTask>0,eventTask:o.eventTask>0,change:p})}}class m{constructor(p,t,o,y,P,K){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=p,this.source=t,this.data=y,this.scheduleFn=P,this.cancelFn=K,!o)throw new Error("callback is not defined");this.callback=o;const l=this;this.invoke=p===R&&y&&y.useG?m.invokeTask:function(){return m.invokeTask.call(e,l,this,arguments)}}static invokeTask(p,t,o){p||(p=this),re++;try{return p.runCount++,p.zone.runTask(p,t,o)}finally{1==re&&L(),re--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(j,q)}_transitionTo(p,t,o){if(this._state!==t&&this._state!==o)throw new Error(`${this.type} '${this.source}': can not transition to '${p}', expecting state '${t}'${o?" or '"+o+"'":""}, was '${this._state}'.`);this._state=p,p==j&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const S=u("setTimeout"),D=u("Promise"),Z=u("then");let E,B=[],V=!1;function d(I){if(0===re&&0===B.length)if(E||e[D]&&(E=e[D].resolve(0)),E){let p=E[Z];p||(p=E.then),p.call(E,L)}else e[S](L,0);I&&B.push(I)}function L(){if(!V){for(V=!0;B.length;){const I=B;B=[];for(let p=0;pG,onUnhandledError:F,microtaskDrainDone:F,scheduleMicroTask:d,showUncaughtError:()=>!_[u("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:F,patchMethod:()=>F,bindArguments:()=>[],patchThen:()=>F,patchMacroTask:()=>F,patchEventPrototype:()=>F,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>F,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>F,wrapWithCurrentZone:()=>F,filterProperties:()=>[],attachOriginToPatched:()=>F,_redefineProperty:()=>F,patchCallbacks:()=>F};let G={parent:null,zone:new _(null,null)},te=null,re=0;function F(){}r("Zone","Zone"),e.Zone=_}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global);const ue=Object.getOwnPropertyDescriptor,he=Object.defineProperty,de=Object.getPrototypeOf,Be=Object.create,ut=Array.prototype.slice,Se="addEventListener",Oe="removeEventListener",Ze=Zone.__symbol__(Se),Ie=Zone.__symbol__(Oe),se="true",ie="false",ke=Zone.__symbol__("");function Le(e,n){return Zone.current.wrap(e,n)}function Me(e,n,i,r,c){return Zone.current.scheduleMacroTask(e,n,i,r,c)}const x=Zone.__symbol__,Pe="undefined"!=typeof window,pe=Pe?window:void 0,$=Pe&&pe||"object"==typeof self&&self||global,ht=[null];function Ae(e,n){for(let i=e.length-1;i>=0;i--)"function"==typeof e[i]&&(e[i]=Le(e[i],n+"_"+i));return e}function Fe(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const Ue="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Re=!("nw"in $)&&void 0!==$.process&&"[object process]"==={}.toString.call($.process),je=!Re&&!Ue&&!(!Pe||!pe.HTMLElement),We=void 0!==$.process&&"[object process]"==={}.toString.call($.process)&&!Ue&&!(!Pe||!pe.HTMLElement),Ce={},qe=function(e){if(!(e=e||$.event))return;let n=Ce[e.type];n||(n=Ce[e.type]=x("ON_PROPERTY"+e.type));const i=this||e.target||$,r=i[n];let c;if(je&&i===pe&&"error"===e.type){const u=e;c=r&&r.call(this,u.message,u.filename,u.lineno,u.colno,u.error),!0===c&&e.preventDefault()}else c=r&&r.apply(this,arguments),null!=c&&!c&&e.preventDefault();return c};function Xe(e,n,i){let r=ue(e,n);if(!r&&i&&ue(i,n)&&(r={enumerable:!0,configurable:!0}),!r||!r.configurable)return;const c=x("on"+n+"patched");if(e.hasOwnProperty(c)&&e[c])return;delete r.writable,delete r.value;const u=r.get,f=r.set,_=n.substr(2);let g=Ce[_];g||(g=Ce[_]=x("ON_PROPERTY"+_)),r.set=function(T){let m=this;!m&&e===$&&(m=$),m&&(m[g]&&m.removeEventListener(_,qe),f&&f.apply(m,ht),"function"==typeof T?(m[g]=T,m.addEventListener(_,qe,!1)):m[g]=null)},r.get=function(){let T=this;if(!T&&e===$&&(T=$),!T)return null;const m=T[g];if(m)return m;if(u){let S=u&&u.call(this);if(S)return r.set.call(this,S),"function"==typeof T.removeAttribute&&T.removeAttribute(n),S}return null},he(e,n,r),e[c]=!0}function Ye(e,n,i){if(n)for(let r=0;rfunction(f,_){const g=i(f,_);return g.cbIdx>=0&&"function"==typeof _[g.cbIdx]?Me(g.name,_[g.cbIdx],g,c):u.apply(f,_)})}function ae(e,n){e[x("OriginalDelegate")]=n}let $e=!1,He=!1;function mt(){if($e)return He;$e=!0;try{const e=pe.navigator.userAgent;(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/"))&&(He=!0)}catch(e){}return He}Zone.__load_patch("ZoneAwarePromise",(e,n,i)=>{const r=Object.getOwnPropertyDescriptor,c=Object.defineProperty,f=i.symbol,_=[],g=!0===e[f("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],T=f("Promise"),m=f("then");i.onUnhandledError=l=>{if(i.showUncaughtError()){const s=l&&l.rejection;s?console.error("Unhandled Promise rejection:",s instanceof Error?s.message:s,"; Zone:",l.zone.name,"; Task:",l.task&&l.task.source,"; Value:",s,s instanceof Error?s.stack:void 0):console.error(l)}},i.microtaskDrainDone=()=>{for(;_.length;){const l=_.shift();try{l.zone.runGuarded(()=>{throw l.throwOriginal?l.rejection:l})}catch(s){Z(s)}}};const D=f("unhandledPromiseRejectionHandler");function Z(l){i.onUnhandledError(l);try{const s=n[D];"function"==typeof s&&s.call(this,l)}catch(s){}}function B(l){return l&&l.then}function V(l){return l}function E(l){return t.reject(l)}const d=f("state"),L=f("value"),z=f("finally"),j=f("parentPromiseValue"),q=f("parentPromiseState"),X=null,A=!0,Y=!1;function M(l,s){return a=>{try{G(l,s,a)}catch(h){G(l,!1,h)}}}const le=f("currentTaskTrace");function G(l,s,a){const h=function(){let l=!1;return function(a){return function(){l||(l=!0,a.apply(null,arguments))}}}();if(l===a)throw new TypeError("Promise resolved with itself");if(l[d]===X){let w=null;try{("object"==typeof a||"function"==typeof a)&&(w=a&&a.then)}catch(C){return h(()=>{G(l,!1,C)})(),l}if(s!==Y&&a instanceof t&&a.hasOwnProperty(d)&&a.hasOwnProperty(L)&&a[d]!==X)re(a),G(l,a[d],a[L]);else if(s!==Y&&"function"==typeof w)try{w.call(a,h(M(l,s)),h(M(l,!1)))}catch(C){h(()=>{G(l,!1,C)})()}else{l[d]=s;const C=l[L];if(l[L]=a,l[z]===z&&s===A&&(l[d]=l[q],l[L]=l[j]),s===Y&&a instanceof Error){const k=n.currentTask&&n.currentTask.data&&n.currentTask.data.__creationTrace__;k&&c(a,le,{configurable:!0,enumerable:!1,writable:!0,value:k})}for(let k=0;k{try{const b=l[L],N=!!a&&z===a[z];N&&(a[j]=b,a[q]=C);const H=s.run(k,void 0,N&&k!==E&&k!==V?[]:[b]);G(a,!0,H)}catch(b){G(a,!1,b)}},a)}const p=function(){};class t{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(s){return G(new this(null),A,s)}static reject(s){return G(new this(null),Y,s)}static race(s){let a,h,w=new this((b,N)=>{a=b,h=N});function C(b){a(b)}function k(b){h(b)}for(let b of s)B(b)||(b=this.resolve(b)),b.then(C,k);return w}static all(s){return t.allWithCallback(s)}static allSettled(s){return(this&&this.prototype instanceof t?this:t).allWithCallback(s,{thenCallback:h=>({status:"fulfilled",value:h}),errorCallback:h=>({status:"rejected",reason:h})})}static allWithCallback(s,a){let h,w,C=new this((H,U)=>{h=H,w=U}),k=2,b=0;const N=[];for(let H of s){B(H)||(H=this.resolve(H));const U=b;try{H.then(Q=>{N[U]=a?a.thenCallback(Q):Q,k--,0===k&&h(N)},Q=>{a?(N[U]=a.errorCallback(Q),k--,0===k&&h(N)):w(Q)})}catch(Q){w(Q)}k++,b++}return k-=2,0===k&&h(N),C}constructor(s){const a=this;if(!(a instanceof t))throw new Error("Must be an instanceof Promise.");a[d]=X,a[L]=[];try{s&&s(M(a,A),M(a,Y))}catch(h){G(a,!1,h)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return t}then(s,a){let h=this.constructor[Symbol.species];(!h||"function"!=typeof h)&&(h=this.constructor||t);const w=new h(p),C=n.current;return this[d]==X?this[L].push(C,w,s,a):F(this,C,w,s,a),w}catch(s){return this.then(null,s)}finally(s){let a=this.constructor[Symbol.species];(!a||"function"!=typeof a)&&(a=t);const h=new a(p);h[z]=z;const w=n.current;return this[d]==X?this[L].push(w,h,s,s):F(this,w,h,s,s),h}}t.resolve=t.resolve,t.reject=t.reject,t.race=t.race,t.all=t.all;const o=e[T]=e.Promise;e.Promise=t;const y=f("thenPatched");function P(l){const s=l.prototype,a=r(s,"then");if(a&&(!1===a.writable||!a.configurable))return;const h=s.then;s[m]=h,l.prototype.then=function(w,C){return new t((b,N)=>{h.call(this,b,N)}).then(w,C)},l[y]=!0}return i.patchThen=P,o&&(P(o),ce(e,"fetch",l=>function(l){return function(s,a){let h=l.apply(s,a);if(h instanceof t)return h;let w=h.constructor;return w[y]||P(w),h}}(l))),Promise[n.__symbol__("uncaughtPromiseErrors")]=_,t}),Zone.__load_patch("toString",e=>{const n=Function.prototype.toString,i=x("OriginalDelegate"),r=x("Promise"),c=x("Error"),u=function(){if("function"==typeof this){const T=this[i];if(T)return"function"==typeof T?n.call(T):Object.prototype.toString.call(T);if(this===Promise){const m=e[r];if(m)return n.call(m)}if(this===Error){const m=e[c];if(m)return n.call(m)}}return n.call(this)};u[i]=n,Function.prototype.toString=u;const f=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":f.call(this)}});let me=!1;if("undefined"!=typeof window)try{const e=Object.defineProperty({},"passive",{get:function(){me=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){me=!1}const Et={useG:!0},ee={},Ke={},Je=new RegExp("^"+ke+"(\\w+)(true|false)$"),xe=x("propagationStopped");function Qe(e,n){const i=(n?n(e):e)+ie,r=(n?n(e):e)+se,c=ke+i,u=ke+r;ee[e]={},ee[e][ie]=c,ee[e][se]=u}function Tt(e,n,i){const r=i&&i.add||Se,c=i&&i.rm||Oe,u=i&&i.listeners||"eventListeners",f=i&&i.rmAll||"removeAllListeners",_=x(r),g="."+r+":",S=function(E,d,L){if(E.isRemoved)return;const z=E.callback;"object"==typeof z&&z.handleEvent&&(E.callback=q=>z.handleEvent(q),E.originalDelegate=z),E.invoke(E,d,[L]);const j=E.options;j&&"object"==typeof j&&j.once&&d[c].call(d,L.type,E.originalDelegate?E.originalDelegate:E.callback,j)},D=function(E){if(!(E=E||e.event))return;const d=this||E.target||e,L=d[ee[E.type][ie]];if(L)if(1===L.length)S(L[0],d,E);else{const z=L.slice();for(let j=0;jfunction(c,u){c[xe]=!0,r&&r.apply(c,u)})}function gt(e,n,i,r,c){const u=Zone.__symbol__(r);if(n[u])return;const f=n[u]=n[r];n[r]=function(_,g,T){return g&&g.prototype&&c.forEach(function(m){const S=`${i}.${r}::`+m,D=g.prototype;if(D.hasOwnProperty(m)){const Z=e.ObjectGetOwnPropertyDescriptor(D,m);Z&&Z.value?(Z.value=e.wrapWithCurrentZone(Z.value,S),e._redefineProperty(g.prototype,m,Z)):D[m]&&(D[m]=e.wrapWithCurrentZone(D[m],S))}else D[m]&&(D[m]=e.wrapWithCurrentZone(D[m],S))}),f.call(n,_,g,T)},e.attachOriginToPatched(n[r],f)}const Ve=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplayconnected","vrdisplaydisconnected","vrdisplaypresentchange"],wt=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],tt=["load"],nt=["blur","error","focus","load","resize","scroll","messageerror"],Dt=["bounce","finish","start"],rt=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],Ee=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],St=["close","error","open","message"],Ot=["error","message"],Te=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"].concat(["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],["autocomplete","autocompleteerror"],["toggle"],["afterscriptexecute","beforescriptexecute","DOMContentLoaded","freeze","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange","resume"],Ve,["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"]);function ot(e,n,i){if(!i||0===i.length)return n;const r=i.filter(u=>u.target===e);if(!r||0===r.length)return n;const c=r[0].ignoreProperties;return n.filter(u=>-1===c.indexOf(u))}function W(e,n,i,r){e&&Ye(e,ot(e,n,i),r)}Zone.__load_patch("util",(e,n,i)=>{i.patchOnProperties=Ye,i.patchMethod=ce,i.bindArguments=Ae,i.patchMacroTask=_t;const r=n.__symbol__("BLACK_LISTED_EVENTS"),c=n.__symbol__("UNPATCHED_EVENTS");e[c]&&(e[r]=e[c]),e[r]&&(n[r]=n[c]=e[r]),i.patchEventPrototype=yt,i.patchEventTarget=Tt,i.isIEOrEdge=mt,i.ObjectDefineProperty=he,i.ObjectGetOwnPropertyDescriptor=ue,i.ObjectCreate=Be,i.ArraySlice=ut,i.patchClass=ve,i.wrapWithCurrentZone=Le,i.filterProperties=ot,i.attachOriginToPatched=ae,i._redefineProperty=Object.defineProperty,i.patchCallbacks=gt,i.getGlobalObjects=()=>({globalSources:Ke,zoneSymbolEventNames:ee,eventNames:Te,isBrowser:je,isMix:We,isNode:Re,TRUE_STR:se,FALSE_STR:ie,ZONE_SYMBOL_PREFIX:ke,ADD_EVENT_LISTENER_STR:Se,REMOVE_EVENT_LISTENER_STR:Oe})});const Ne=x("zoneTask");function ye(e,n,i,r){let c=null,u=null;i+=r;const f={};function _(T){const m=T.data;return m.args[0]=function(){return T.invoke.apply(this,arguments)},m.handleId=c.apply(e,m.args),T}function g(T){return u.call(e,T.data.handleId)}c=ce(e,n+=r,T=>function(m,S){if("function"==typeof S[0]){const D={isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?S[1]||0:void 0,args:S},Z=S[0];S[0]=function(){try{return Z.apply(this,arguments)}finally{D.isPeriodic||("number"==typeof D.handleId?delete f[D.handleId]:D.handleId&&(D.handleId[Ne]=null))}};const B=Me(n,S[0],D,_,g);if(!B)return B;const V=B.data.handleId;return"number"==typeof V?f[V]=B:V&&(V[Ne]=B),V&&V.ref&&V.unref&&"function"==typeof V.ref&&"function"==typeof V.unref&&(B.ref=V.ref.bind(V),B.unref=V.unref.bind(V)),"number"==typeof V||V?V:B}return T.apply(e,S)}),u=ce(e,i,T=>function(m,S){const D=S[0];let Z;"number"==typeof D?Z=f[D]:(Z=D&&D[Ne],Z||(Z=D)),Z&&"string"==typeof Z.type?"notScheduled"!==Z.state&&(Z.cancelFn&&Z.data.isPeriodic||0===Z.runCount)&&("number"==typeof D?delete f[D]:D&&(D[Ne]=null),Z.zone.cancelTask(Z)):T.apply(e,S)})}Zone.__load_patch("legacy",e=>{const n=e[Zone.__symbol__("legacyPatch")];n&&n()}),Zone.__load_patch("queueMicrotask",(e,n,i)=>{i.patchMethod(e,"queueMicrotask",r=>function(c,u){n.current.scheduleMicroTask("queueMicrotask",u[0])})}),Zone.__load_patch("timers",e=>{const n="set",i="clear";ye(e,n,i,"Timeout"),ye(e,n,i,"Interval"),ye(e,n,i,"Immediate")}),Zone.__load_patch("requestAnimationFrame",e=>{ye(e,"request","cancel","AnimationFrame"),ye(e,"mozRequest","mozCancel","AnimationFrame"),ye(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(e,n)=>{const i=["alert","prompt","confirm"];for(let r=0;rfunction(g,T){return n.current.run(u,e,T,_)})}),Zone.__load_patch("EventTarget",(e,n,i)=>{(function(e,n){n.patchEventPrototype(e,n)})(e,i),function(e,n){if(Zone[n.symbol("patchEventTarget")])return;const{eventNames:i,zoneSymbolEventNames:r,TRUE_STR:c,FALSE_STR:u,ZONE_SYMBOL_PREFIX:f}=n.getGlobalObjects();for(let g=0;g{ve("MutationObserver"),ve("WebKitMutationObserver")}),Zone.__load_patch("IntersectionObserver",(e,n,i)=>{ve("IntersectionObserver")}),Zone.__load_patch("FileReader",(e,n,i)=>{ve("FileReader")}),Zone.__load_patch("on_property",(e,n,i)=>{!function(e,n){if(Re&&!We||Zone[e.symbol("patchEvents")])return;const i="undefined"!=typeof WebSocket,r=n.__Zone_ignore_on_properties;if(je){const f=window,_=function(){try{const e=pe.navigator.userAgent;if(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/"))return!0}catch(e){}return!1}()?[{target:f,ignoreProperties:["error"]}]:[];W(f,Te.concat(["messageerror"]),r&&r.concat(_),de(f)),W(Document.prototype,Te,r),void 0!==f.SVGElement&&W(f.SVGElement.prototype,Te,r),W(Element.prototype,Te,r),W(HTMLElement.prototype,Te,r),W(HTMLMediaElement.prototype,wt,r),W(HTMLFrameSetElement.prototype,Ve.concat(nt),r),W(HTMLBodyElement.prototype,Ve.concat(nt),r),W(HTMLFrameElement.prototype,tt,r),W(HTMLIFrameElement.prototype,tt,r);const g=f.HTMLMarqueeElement;g&&W(g.prototype,Dt,r);const T=f.Worker;T&&W(T.prototype,Ot,r)}const c=n.XMLHttpRequest;c&&W(c.prototype,rt,r);const u=n.XMLHttpRequestEventTarget;u&&W(u&&u.prototype,rt,r),"undefined"!=typeof IDBIndex&&(W(IDBIndex.prototype,Ee,r),W(IDBRequest.prototype,Ee,r),W(IDBOpenDBRequest.prototype,Ee,r),W(IDBDatabase.prototype,Ee,r),W(IDBTransaction.prototype,Ee,r),W(IDBCursor.prototype,Ee,r)),i&&W(WebSocket.prototype,St,r)}(i,e)}),Zone.__load_patch("customElements",(e,n,i)=>{!function(e,n){const{isBrowser:i,isMix:r}=n.getGlobalObjects();(i||r)&&e.customElements&&"customElements"in e&&n.patchCallbacks(n,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback"])}(e,i)}),Zone.__load_patch("XHR",(e,n)=>{!function(T){const m=T.XMLHttpRequest;if(!m)return;const S=m.prototype;let Z=S[Ze],B=S[Ie];if(!Z){const v=T.XMLHttpRequestEventTarget;if(v){const M=v.prototype;Z=M[Ze],B=M[Ie]}}const V="readystatechange",E="scheduled";function d(v){const M=v.data,R=M.target;R[u]=!1,R[_]=!1;const J=R[c];Z||(Z=R[Ze],B=R[Ie]),J&&B.call(R,V,J);const le=R[c]=()=>{if(R.readyState===R.DONE)if(!M.aborted&&R[u]&&v.state===E){const te=R[n.__symbol__("loadfalse")];if(0!==R.status&&te&&te.length>0){const re=v.invoke;v.invoke=function(){const F=R[n.__symbol__("loadfalse")];for(let I=0;Ifunction(v,M){return v[r]=0==M[2],v[f]=M[1],j.apply(v,M)}),O=x("fetchTaskAborting"),X=x("fetchTaskScheduling"),A=ce(S,"send",()=>function(v,M){if(!0===n.current[X]||v[r])return A.apply(v,M);{const R={target:v,url:v[f],isPeriodic:!1,args:M,aborted:!1},J=Me("XMLHttpRequest.send",L,R,d,z);v&&!0===v[_]&&!R.aborted&&J.state===E&&J.invoke()}}),Y=ce(S,"abort",()=>function(v,M){const R=function(v){return v[i]}(v);if(R&&"string"==typeof R.type){if(null==R.cancelFn||R.data&&R.data.aborted)return;R.zone.cancelTask(R)}else if(!0===n.current[O])return Y.apply(v,M)})}(e);const i=x("xhrTask"),r=x("xhrSync"),c=x("xhrListener"),u=x("xhrScheduled"),f=x("xhrURL"),_=x("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,n){const i=e.constructor.name;for(let r=0;r{const g=function(){return _.apply(this,Ae(arguments,i+"."+c))};return ae(g,_),g})(u)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(e,n)=>{function i(r){return function(c){et(e,r).forEach(f=>{const _=e.PromiseRejectionEvent;if(_){const g=new _(r,{promise:c.promise,reason:c.rejection});f.invoke(g)}})}}e.PromiseRejectionEvent&&(n[x("unhandledPromiseRejectionHandler")]=i("unhandledrejection"),n[x("rejectionHandledHandler")]=i("rejectionhandled"))})},416:(we,ue,he)=>{he(277)}},we=>{we(we.s=416)}]); /*! (C) Andrea Giammarchi - @WebReflection - ISC Style License */ !function(e,t){"use strict";function n(){var e=C.splice(0,C.length);for(We=0;e.length;)e.shift().call(null,e.shift())}function r(e,t){for(var n=0,r=e.length;n1)&&E(this)}}}),Pe(l,B,{value:function(e){-1>0,R="__"+V+P,U="addEventListener",_="attached",k="Callback",x="detached",q="extends",B="attributeChanged"+k,Z=_+k,j="connected"+k,G="disconnected"+k,z="created"+k,K=x+k,X="ADDITION",$="REMOVAL",Q="DOMAttrModified",W="DOMContentLoaded",Y="DOMSubtreeModified",J="<",ee="=",te=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ne=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],re=[],oe=[],le="",ae=g.documentElement,ie=re.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},ue=b.prototype,ce=ue.hasOwnProperty,se=ue.isPrototypeOf,me=b.defineProperty,fe=[],de=b.getOwnPropertyDescriptor,pe=b.getOwnPropertyNames,he=b.getPrototypeOf,Te=b.setPrototypeOf,Le=!!b.__proto__,Me="__dreCEv1",Ee=e.customElements,ve=!/^force/.test(t.type)&&!!(Ee&&Ee.define&&Ee.get&&Ee.whenDefined),He=b.create||b,ge=e.Map||function(){var e,t=[],n=[];return{get:function(e){return n[ie.call(t,e)]},set:function(r,o){(e=ie.call(t,r))<0?n[t.push(r)-1]=o:n[e]=o}}},be=e.Promise||function(e){function t(e){for(r=!0;n.length;)n.shift()(e)}var n=[],r=!1,o={catch:function(){return o},then:function(e){return n.push(e),r&&setTimeout(t,1),o}};return e(t),o},ye=!1,Ce=He(null),we=He(null),Ae=new ge,Oe=function(e){return e.toLowerCase()},Ne=b.create||function e(t){return t?(e.prototype=t,new e):this},De=Te||(Le?function(e,t){return e.__proto__=t,e}:pe&&de?function(){function e(e,t){for(var n,r=pe(t),o=0,l=r.length;o
    ",new Ie(function(e,t){if(e[0]&&"childList"==e[0].type&&!e[0].removedNodes[0].childNodes.length){var n=(S=de(Se,"innerHTML"))&&S.set;n&&me(Se,"innerHTML",{set:function(e){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,e)}})}t.disconnect(),S=null}).observe(S,{childList:!0,subtree:!0}),S.innerHTML=""),Ye||(Te||Le?(I=function(e,t){se.call(t,e)||f(e,t)},F=f):F=I=function(e,t){e[R]||(e[R]=b(!0),f(e,t))},Ve?(tt=!1,function(){var e=de(Se,U),t=e.value,n=function(e){var t=new CustomEvent(Q,{bubbles:!0});t.attrName=e,t.prevValue=Be.call(this,e),t.newValue=null,t[$]=t.attrChange=2,je.call(this,e),qe.call(this,t)},r=function(e,t){var n=Ze.call(this,e),r=n&&Be.call(this,e),o=new CustomEvent(Q,{bubbles:!0});Ge.call(this,e,t),o.attrName=e,o.prevValue=n?r:null,o.newValue=t,n?o.MODIFICATION=o.attrChange=1:o[X]=o.attrChange=0,qe.call(this,o)},o=function(e){var t,n=e.currentTarget,r=n[R],o=e.propertyName;r.hasOwnProperty(o)&&(r=r[o],(t=new CustomEvent(Q,{bubbles:!0})).attrName=r.name,t.prevValue=r.value||null,t.newValue=r.value=n[o]||null,null==t.prevValue?t[X]=t.attrChange=0:t.MODIFICATION=t.attrChange=1,qe.call(n,t))};e.value=function(e,l,a){e===Q&&this[B]&&this.setAttribute!==r&&(this[R]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,e,l,a)},me(Se,U,e)}()):Ie||(ae[U](Q,Qe),ae.setAttribute(R,1),ae.removeAttribute(R),tt&&(w=function(e){var t,n,r,o=this;if(o===e.target){for(r in t=o[R],o[R]=n=O(o),n){if(!(r in t))return A(0,o,r,t[r],n[r],X);if(n[r]!==t[r])return A(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return A(2,o,r,t[r],n[r],$)}},A=function(e,t,n,r,o,l){var a={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};a[l]=e,i(a)},O=function(e){for(var t,n,r={},o=e.attributes,l=0,a=o.length;l$");if(n[q]="a",(t.prototype=Ne(Fe.prototype)).constructor=t,e.customElements.define(r,t,n),!o.test(g.createElement("a",{is:r}).outerHTML)||!o.test((new t).outerHTML))throw n}(function e(){return Reflect.construct(Fe,[],e)},{},"document-register-element-a"+P)}catch(e){H()}if(!t.noBuiltIn)try{if(ze.call(g,"a","a").outerHTML.indexOf("is")<0)throw{}}catch(e){Oe=function(e){return{is:e.toLowerCase()}}}}(window); -var ERe=Object.defineProperty,SRe=Object.defineProperties,xRe=Object.getOwnPropertyDescriptors,A1=Object.getOwnPropertySymbols,A7=Object.prototype.hasOwnProperty,T7=Object.prototype.propertyIsEnumerable,_r=Math.pow,M7=(kt,it,tt)=>it in kt?ERe(kt,it,{enumerable:!0,configurable:!0,writable:!0,value:tt}):kt[it]=tt,ht=(kt,it)=>{for(var tt in it||(it={}))A7.call(it,tt)&&M7(kt,tt,it[tt]);if(A1)for(var tt of A1(it))T7.call(it,tt)&&M7(kt,tt,it[tt]);return kt},Un=(kt,it)=>SRe(kt,xRe(it)),D7=(kt,it)=>{var tt={};for(var gt in kt)A7.call(kt,gt)&&it.indexOf(gt)<0&&(tt[gt]=kt[gt]);if(null!=kt&&A1)for(var gt of A1(kt))it.indexOf(gt)<0&&T7.call(kt,gt)&&(tt[gt]=kt[gt]);return tt};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(kt,it,tt)=>{var gt=tt(52).default;kt.exports=function K(Ae,he,q){function V($,b){if(!he[$]){if(!Ae[$]){if(L)return L($,!0);var O=new Error("Cannot find module '"+$+"'");throw O.code="MODULE_NOT_FOUND",O}var T=he[$]={exports:{}};Ae[$][0].call(T.exports,function(v){return V(Ae[$][1][v]||v)},T,T.exports,K,Ae,he,q)}return he[$].exports}for(var L=void 0,re=0;re0&&z[z.length-1])&&(6===Pe[0]||2===Pe[0])){Ue=0;continue}if(3===Pe[0]&&(!z||Pe[1]>z[0]&&Pe[1]0?Y-4:Y;for(U=0;U>16&255,F[Q++]=I>>8&255,F[Q++]=255&I;return 2===D&&(I=V[j.charCodeAt(U)]<<2|V[j.charCodeAt(U+1)]>>4,F[Q++]=255&I),1===D&&(I=V[j.charCodeAt(U)]<<10|V[j.charCodeAt(U+1)]<<4|V[j.charCodeAt(U+2)]>>2,F[Q++]=I>>8&255,F[Q++]=255&I),F},he.fromByteArray=function(j){for(var I,H=j.length,Y=H%3,D=[],F=16383,Q=0,E=H-Y;QE?E:Q+F));return 1===Y?D.push(q[(I=j[H-1])>>2]+q[I<<4&63]+"=="):2===Y&&D.push(q[(I=(j[H-2]<<8)+j[H-1])>>10]+q[I>>4&63]+q[I<<2&63]+"="),D.join("")};for(var q=[],V=[],L="undefined"!=typeof Uint8Array?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,b=re.length;$0)throw new Error("Invalid string. Length must be a multiple of 4");var H=j.indexOf("=");return-1===H&&(H=I),[H,H===I?0:4-H%4]}function y(j){return q[j>>18&63]+q[j>>12&63]+q[j>>6&63]+q[63&j]}function w(j,I,H){for(var D=[],F=I;F>5==6?2:D>>4==14?3:D>>3==30?4:D>>6==2?-1:-2}function T(D){var F=this.lastTotal-this.lastNeed,Q=function(D,F,Q){if(128!=(192&F[0]))return D.lastNeed=0,"\ufffd";if(D.lastNeed>1&&F.length>1){if(128!=(192&F[1]))return D.lastNeed=1,"\ufffd";if(D.lastNeed>2&&F.length>2&&128!=(192&F[2]))return D.lastNeed=2,"\ufffd"}}(this,D);return void 0!==Q?Q:this.lastNeed<=D.length?(D.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(D.copy(this.lastChar,F,0,D.length),void(this.lastNeed-=D.length))}function w(D,F){if((D.length-F)%2==0){var Q=D.toString("utf16le",F);if(Q){var E=Q.charCodeAt(Q.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],Q.slice(0,-1)}return Q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",F,D.length-1)}function M(D){var F=D&&D.length?this.write(D):"";return this.lastNeed?F+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):F}function j(D,F){var Q=(D.length-F)%3;return 0===Q?D.toString("base64",F):(this.lastNeed=3-Q,this.lastTotal=3,1===Q?this.lastChar[0]=D[D.length-1]:(this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1]),D.toString("base64",F,D.length-Q))}function I(D){var F=D&&D.length?this.write(D):"";return this.lastNeed?F+this.lastChar.toString("base64",0,3-this.lastNeed):F}function H(D){return D.toString(this.encoding)}function Y(D){return D&&D.length?this.write(D):""}he.StringDecoder=$,$.prototype.write=function(D){if(0===D.length)return"";var F,Q;if(this.lastNeed){if(void 0===(F=this.fillLast(D)))return"";Q=this.lastNeed,this.lastNeed=0}else Q=0;return Q=0?(U>0&&(D.lastNeed=U-1),U):--E=0?(U>0&&(D.lastNeed=U-2),U):--E=0?(U>0&&(2===U?U=0:D.lastNeed=U-3),U):0}(this,D,F);if(!this.lastNeed)return D.toString("utf8",F);this.lastTotal=Q;var E=D.length-(Q-this.lastNeed);return D.copy(this.lastChar,0,E),D.toString("utf8",F,E)},$.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length}},{"safe-buffer":4}],6:[function(K,Ae,he){(function(q){(function(){"use strict";var V=K("base64-js"),L=K("ieee754");he.Buffer=S,he.SlowBuffer=function(B){return+B!=B&&(B=0),S.alloc(+B)},he.INSPECT_MAX_BYTES=50;var re=2147483647;function b(B){if(B>re)throw new RangeError('The value "'+B+'" is invalid for option "size"');var R=new Uint8Array(B);return R.__proto__=S.prototype,R}function S(B,R,k){if("number"==typeof B){if("string"==typeof R)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return O(B,R,k)}function O(B,R,k){if("string"==typeof B)return function(B,R){if(("string"!=typeof R||""===R)&&(R="utf8"),!S.isEncoding(R))throw new TypeError("Unknown encoding: "+R);var k=0|D(B,R),Oe=b(k),Xe=Oe.write(B,R);return Xe!==k&&(Oe=Oe.slice(0,Xe)),Oe}(B,R);if(ArrayBuffer.isView(B))return M(B);if(null==B)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(pt(B,ArrayBuffer)||B&&pt(B.buffer,ArrayBuffer))return function(B,R,k){if(R<0||B.byteLength=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return 0|B}function D(B,R){if(S.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||pt(B,ArrayBuffer))return B.byteLength;if("string"!=typeof B)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var k=B.length,Oe=arguments.length>2&&!0===arguments[2];if(!Oe&&0===k)return 0;for(var Xe=!1;;)switch(R){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return X(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Pe(B).length;default:if(Xe)return Oe?-1:X(B).length;R=(""+R).toLowerCase(),Xe=!0}}function F(B,R,k){var Oe=!1;if((void 0===R||R<0)&&(R=0),R>this.length||((void 0===k||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(R>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return Je(this,R,k);case"utf8":case"utf-8":return ye(this,R,k);case"ascii":return nt(this,R,k);case"latin1":case"binary":return Ze(this,R,k);case"base64":return te(this,R,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,R,k);default:if(Oe)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Oe=!0}}function Q(B,R,k){var Oe=B[R];B[R]=B[k],B[k]=Oe}function E(B,R,k,Oe,Xe){if(0===B.length)return-1;if("string"==typeof k?(Oe=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),fe(k=+k)&&(k=Xe?0:B.length-1),k<0&&(k=B.length+k),k>=B.length){if(Xe)return-1;k=B.length-1}else if(k<0){if(!Xe)return-1;k=0}if("string"==typeof R&&(R=S.from(R,Oe)),S.isBuffer(R))return 0===R.length?-1:U(B,R,k,Oe,Xe);if("number"==typeof R)return R&=255,"function"==typeof Uint8Array.prototype.indexOf?Xe?Uint8Array.prototype.indexOf.call(B,R,k):Uint8Array.prototype.lastIndexOf.call(B,R,k):U(B,[R],k,Oe,Xe);throw new TypeError("val must be string, number or Buffer")}function U(B,R,k,Oe,Xe){var Gn,yt=1,It=B.length,Tn=R.length;if(void 0!==Oe&&("ucs2"===(Oe=String(Oe).toLowerCase())||"ucs-2"===Oe||"utf16le"===Oe||"utf-16le"===Oe)){if(B.length<2||R.length<2)return-1;yt=2,It/=2,Tn/=2,k/=2}function Pn(Ns,cs){return 1===yt?Ns[cs]:Ns.readUInt16BE(cs*yt)}if(Xe){var yi=-1;for(Gn=k;GnIt&&(k=It-Tn),Gn=k;Gn>=0;Gn--){for(var hi=!0,Hr=0;HrXe&&(Oe=Xe):Oe=Xe;var yt=R.length;Oe>yt/2&&(Oe=yt/2);for(var It=0;It>8,yt.push(k%256),yt.push(Oe);return yt}(R,B.length-k),B,k,Oe)}function te(B,R,k){return V.fromByteArray(0===R&&k===B.length?B:B.slice(R,k))}function ye(B,R,k){k=Math.min(B.length,k);for(var Oe=[],Xe=R;Xe239?4:yt>223?3:yt>191?2:1;if(Xe+Tn<=k)switch(Tn){case 1:yt<128&&(It=yt);break;case 2:128==(192&(Pn=B[Xe+1]))&&(hi=(31&yt)<<6|63&Pn)>127&&(It=hi);break;case 3:Gn=B[Xe+2],128==(192&(Pn=B[Xe+1]))&&128==(192&Gn)&&(hi=(15&yt)<<12|(63&Pn)<<6|63&Gn)>2047&&(hi<55296||hi>57343)&&(It=hi);break;case 4:Gn=B[Xe+2],yi=B[Xe+3],128==(192&(Pn=B[Xe+1]))&&128==(192&Gn)&&128==(192&yi)&&(hi=(15&yt)<<18|(63&Pn)<<12|(63&Gn)<<6|63&yi)>65535&&hi<1114112&&(It=hi)}null===It?(It=65533,Tn=1):It>65535&&(Oe.push((It-=65536)>>>10&1023|55296),It=56320|1023&It),Oe.push(It),Xe+=Tn}return function(B){var R=B.length;if(R<=4096)return String.fromCharCode.apply(String,B);for(var k="",Oe=0;Oek&&(R+=" ... "),""},S.prototype.compare=function(R,k,Oe,Xe,yt){if(pt(R,Uint8Array)&&(R=S.from(R,R.offset,R.byteLength)),!S.isBuffer(R))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof R);if(void 0===k&&(k=0),void 0===Oe&&(Oe=R?R.length:0),void 0===Xe&&(Xe=0),void 0===yt&&(yt=this.length),k<0||Oe>R.length||Xe<0||yt>this.length)throw new RangeError("out of range index");if(Xe>=yt&&k>=Oe)return 0;if(Xe>=yt)return-1;if(k>=Oe)return 1;if(this===R)return 0;for(var It=(yt>>>=0)-(Xe>>>=0),Tn=(Oe>>>=0)-(k>>>=0),Pn=Math.min(It,Tn),Gn=this.slice(Xe,yt),yi=R.slice(k,Oe),hi=0;hi>>=0,isFinite(Oe)?(Oe>>>=0,void 0===Xe&&(Xe="utf8")):(Xe=Oe,Oe=void 0)}var yt=this.length-k;if((void 0===Oe||Oe>yt)&&(Oe=yt),R.length>0&&(Oe<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");Xe||(Xe="utf8");for(var It=!1;;)switch(Xe){case"hex":return ie(this,R,k,Oe);case"utf8":case"utf-8":return ue(this,R,k,Oe);case"ascii":return ee(this,R,k,Oe);case"latin1":case"binary":return se(this,R,k,Oe);case"base64":return Te(this,R,k,Oe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,R,k,Oe);default:if(It)throw new TypeError("Unknown encoding: "+Xe);Xe=(""+Xe).toLowerCase(),It=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(B,R,k){var Oe="";k=Math.min(B.length,k);for(var Xe=R;XeOe)&&(k=Oe);for(var Xe="",yt=R;ytk)throw new RangeError("Trying to access beyond buffer length")}function Le(B,R,k,Oe,Xe,yt){if(!S.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(R>Xe||RB.length)throw new RangeError("Index out of range")}function Ee(B,R,k,Oe,Xe,yt){if(k+Oe>B.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Re(B,R,k,Oe,Xe){return R=+R,k>>>=0,Xe||Ee(B,0,k,4),L.write(B,R,k,Oe,23,4),k+4}function Ue(B,R,k,Oe,Xe){return R=+R,k>>>=0,Xe||Ee(B,0,k,8),L.write(B,R,k,Oe,52,8),k+8}S.prototype.slice=function(R,k){var Oe=this.length;(R=~~R)<0?(R+=Oe)<0&&(R=0):R>Oe&&(R=Oe),(k=void 0===k?Oe:~~k)<0?(k+=Oe)<0&&(k=0):k>Oe&&(k=Oe),k>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R],yt=1,It=0;++It>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R+--k],yt=1;k>0&&(yt*=256);)Xe+=this[R+--k]*yt;return Xe},S.prototype.readUInt8=function(R,k){return R>>>=0,k||je(R,1,this.length),this[R]},S.prototype.readUInt16LE=function(R,k){return R>>>=0,k||je(R,2,this.length),this[R]|this[R+1]<<8},S.prototype.readUInt16BE=function(R,k){return R>>>=0,k||je(R,2,this.length),this[R]<<8|this[R+1]},S.prototype.readUInt32LE=function(R,k){return R>>>=0,k||je(R,4,this.length),(this[R]|this[R+1]<<8|this[R+2]<<16)+16777216*this[R+3]},S.prototype.readUInt32BE=function(R,k){return R>>>=0,k||je(R,4,this.length),16777216*this[R]+(this[R+1]<<16|this[R+2]<<8|this[R+3])},S.prototype.readIntLE=function(R,k,Oe){R>>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R],yt=1,It=0;++It=(yt*=128)&&(Xe-=Math.pow(2,8*k)),Xe},S.prototype.readIntBE=function(R,k,Oe){R>>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=k,yt=1,It=this[R+--Xe];Xe>0&&(yt*=256);)It+=this[R+--Xe]*yt;return It>=(yt*=128)&&(It-=Math.pow(2,8*k)),It},S.prototype.readInt8=function(R,k){return R>>>=0,k||je(R,1,this.length),128&this[R]?-1*(255-this[R]+1):this[R]},S.prototype.readInt16LE=function(R,k){R>>>=0,k||je(R,2,this.length);var Oe=this[R]|this[R+1]<<8;return 32768&Oe?4294901760|Oe:Oe},S.prototype.readInt16BE=function(R,k){R>>>=0,k||je(R,2,this.length);var Oe=this[R+1]|this[R]<<8;return 32768&Oe?4294901760|Oe:Oe},S.prototype.readInt32LE=function(R,k){return R>>>=0,k||je(R,4,this.length),this[R]|this[R+1]<<8|this[R+2]<<16|this[R+3]<<24},S.prototype.readInt32BE=function(R,k){return R>>>=0,k||je(R,4,this.length),this[R]<<24|this[R+1]<<16|this[R+2]<<8|this[R+3]},S.prototype.readFloatLE=function(R,k){return R>>>=0,k||je(R,4,this.length),L.read(this,R,!0,23,4)},S.prototype.readFloatBE=function(R,k){return R>>>=0,k||je(R,4,this.length),L.read(this,R,!1,23,4)},S.prototype.readDoubleLE=function(R,k){return R>>>=0,k||je(R,8,this.length),L.read(this,R,!0,52,8)},S.prototype.readDoubleBE=function(R,k){return R>>>=0,k||je(R,8,this.length),L.read(this,R,!1,52,8)},S.prototype.writeUIntLE=function(R,k,Oe,Xe){R=+R,k>>>=0,Oe>>>=0,Xe||Le(this,R,k,Oe,Math.pow(2,8*Oe)-1,0);var It=1,Tn=0;for(this[k]=255&R;++Tn>>=0,Oe>>>=0,Xe||Le(this,R,k,Oe,Math.pow(2,8*Oe)-1,0);var It=Oe-1,Tn=1;for(this[k+It]=255&R;--It>=0&&(Tn*=256);)this[k+It]=R/Tn&255;return k+Oe},S.prototype.writeUInt8=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,1,255,0),this[k]=255&R,k+1},S.prototype.writeUInt16LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,65535,0),this[k]=255&R,this[k+1]=R>>>8,k+2},S.prototype.writeUInt16BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,65535,0),this[k]=R>>>8,this[k+1]=255&R,k+2},S.prototype.writeUInt32LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,4294967295,0),this[k+3]=R>>>24,this[k+2]=R>>>16,this[k+1]=R>>>8,this[k]=255&R,k+4},S.prototype.writeUInt32BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,4294967295,0),this[k]=R>>>24,this[k+1]=R>>>16,this[k+2]=R>>>8,this[k+3]=255&R,k+4},S.prototype.writeIntLE=function(R,k,Oe,Xe){if(R=+R,k>>>=0,!Xe){var yt=Math.pow(2,8*Oe-1);Le(this,R,k,Oe,yt-1,-yt)}var It=0,Tn=1,Pn=0;for(this[k]=255&R;++It>0)-Pn&255;return k+Oe},S.prototype.writeIntBE=function(R,k,Oe,Xe){if(R=+R,k>>>=0,!Xe){var yt=Math.pow(2,8*Oe-1);Le(this,R,k,Oe,yt-1,-yt)}var It=Oe-1,Tn=1,Pn=0;for(this[k+It]=255&R;--It>=0&&(Tn*=256);)R<0&&0===Pn&&0!==this[k+It+1]&&(Pn=1),this[k+It]=(R/Tn>>0)-Pn&255;return k+Oe},S.prototype.writeInt8=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,1,127,-128),R<0&&(R=255+R+1),this[k]=255&R,k+1},S.prototype.writeInt16LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,32767,-32768),this[k]=255&R,this[k+1]=R>>>8,k+2},S.prototype.writeInt16BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,32767,-32768),this[k]=R>>>8,this[k+1]=255&R,k+2},S.prototype.writeInt32LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,2147483647,-2147483648),this[k]=255&R,this[k+1]=R>>>8,this[k+2]=R>>>16,this[k+3]=R>>>24,k+4},S.prototype.writeInt32BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,2147483647,-2147483648),R<0&&(R=4294967295+R+1),this[k]=R>>>24,this[k+1]=R>>>16,this[k+2]=R>>>8,this[k+3]=255&R,k+4},S.prototype.writeFloatLE=function(R,k,Oe){return Re(this,R,k,!0,Oe)},S.prototype.writeFloatBE=function(R,k,Oe){return Re(this,R,k,!1,Oe)},S.prototype.writeDoubleLE=function(R,k,Oe){return Ue(this,R,k,!0,Oe)},S.prototype.writeDoubleBE=function(R,k,Oe){return Ue(this,R,k,!1,Oe)},S.prototype.copy=function(R,k,Oe,Xe){if(!S.isBuffer(R))throw new TypeError("argument should be a Buffer");if(Oe||(Oe=0),!Xe&&0!==Xe&&(Xe=this.length),k>=R.length&&(k=R.length),k||(k=0),Xe>0&&Xe=this.length)throw new RangeError("Index out of range");if(Xe<0)throw new RangeError("sourceEnd out of bounds");Xe>this.length&&(Xe=this.length),R.length-k=0;--It)R[It+k]=this[It+Oe];else Uint8Array.prototype.set.call(R,this.subarray(Oe,Xe),k);return yt},S.prototype.fill=function(R,k,Oe,Xe){if("string"==typeof R){if("string"==typeof k?(Xe=k,k=0,Oe=this.length):"string"==typeof Oe&&(Xe=Oe,Oe=this.length),void 0!==Xe&&"string"!=typeof Xe)throw new TypeError("encoding must be a string");if("string"==typeof Xe&&!S.isEncoding(Xe))throw new TypeError("Unknown encoding: "+Xe);if(1===R.length){var yt=R.charCodeAt(0);("utf8"===Xe&&yt<128||"latin1"===Xe)&&(R=yt)}}else"number"==typeof R&&(R&=255);if(k<0||this.length>>=0,Oe=void 0===Oe?this.length:Oe>>>0,R||(R=0),"number"==typeof R)for(It=k;It55295&&k<57344){if(!Xe){if(k>56319){(R-=3)>-1&&yt.push(239,191,189);continue}if(It+1===Oe){(R-=3)>-1&&yt.push(239,191,189);continue}Xe=k;continue}if(k<56320){(R-=3)>-1&&yt.push(239,191,189),Xe=k;continue}k=65536+(Xe-55296<<10|k-56320)}else Xe&&(R-=3)>-1&&yt.push(239,191,189);if(Xe=null,k<128){if((R-=1)<0)break;yt.push(k)}else if(k<2048){if((R-=2)<0)break;yt.push(k>>6|192,63&k|128)}else if(k<65536){if((R-=3)<0)break;yt.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((R-=4)<0)break;yt.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return yt}function Pe(B){return V.toByteArray(function(B){if((B=(B=B.split("=")[0]).trim().replace(qe,"")).length<2)return"";for(;B.length%4!=0;)B+="=";return B}(B))}function wt(B,R,k,Oe){for(var Xe=0;Xe=R.length||Xe>=B.length);++Xe)R[Xe+k]=B[Xe];return Xe}function pt(B,R){return B instanceof R||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===R.name}function fe(B){return B!=B}}).call(this)}).call(this,K("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(K,Ae,he){"use strict";Ae.exports=function q(V){return null===V||"object"!=typeof V||null!=V.toJSON?JSON.stringify(V):Array.isArray(V)?"["+V.reduce((L,re,$)=>L+(0===$?"":",")+q(void 0===re||"symbol"==typeof re?null:re),"")+"]":"{"+Object.keys(V).sort().reduce((L,re,$)=>void 0===V[re]||"symbol"==typeof V[re]?L:L+(0===L.length?"":",")+q(re)+":"+q(V[re]),"")+"}"}},{}],8:[function(K,Ae,he){"use strict";var L,q="object"==typeof Reflect?Reflect:null,V=q&&"function"==typeof q.apply?q.apply:function(U,ie,ue){return Function.prototype.apply.call(U,ie,ue)};L=q&&"function"==typeof q.ownKeys?q.ownKeys:Object.getOwnPropertySymbols?function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:function(U){return Object.getOwnPropertyNames(U)};var $=Number.isNaN||function(U){return U!=U};function b(){b.init.call(this)}Ae.exports=b,Ae.exports.once=function(E,U){return new Promise(function(ie,ue){function ee(Te){E.removeListener(U,se),ue(Te)}function se(){"function"==typeof E.removeListener&&E.removeListener("error",ee),ie([].slice.call(arguments))}Q(E,U,se,{once:!0}),"error"!==U&&function(E,U,ie){"function"==typeof E.on&&Q(E,"error",U,ie)}(E,ee,{once:!0})})},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var S=10;function O(E){if("function"!=typeof E)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function T(E){return void 0===E._maxListeners?b.defaultMaxListeners:E._maxListeners}function v(E,U,ie,ue){var ee,se,Te;if(O(ie),void 0===(se=E._events)?(se=E._events=Object.create(null),E._eventsCount=0):(void 0!==se.newListener&&(E.emit("newListener",U,ie.listener?ie.listener:ie),se=E._events),Te=se[U]),void 0===Te)Te=se[U]=ie,++E._eventsCount;else if("function"==typeof Te?Te=se[U]=ue?[ie,Te]:[Te,ie]:ue?Te.unshift(ie):Te.push(ie),(ee=T(E))>0&&Te.length>ee&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=U,me.count=Te.length,function(E){console&&console.warn&&console.warn(E)}(me)}return E}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(E,U,ie){var ue={fired:!1,wrapFn:void 0,target:E,type:U,listener:ie},ee=y.bind(ue);return ee.listener=ie,ue.wrapFn=ee,ee}function M(E,U,ie){var ue=E._events;if(void 0===ue)return[];var ee=ue[U];return void 0===ee?[]:"function"==typeof ee?ie?[ee.listener||ee]:[ee]:ie?function(E){for(var U=new Array(E.length),ie=0;ie0&&(Te=ie[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var te=se[U];if(void 0===te)return!1;if("function"==typeof te)V(te,this,ie);else{var ye=te.length,De=I(te,ye);for(ue=0;ue=0;Te--)if(ue[Te]===ie||ue[Te].listener===ie){me=ue[Te].listener,se=Te;break}if(se<0)return this;0===se?ue.shift():function(E,U){for(;U+1=0;ee--)this.removeListener(U,ie[ee]);return this},b.prototype.listeners=function(U){return M(this,U,!0)},b.prototype.rawListeners=function(U){return M(this,U,!1)},b.listenerCount=function(E,U){return"function"==typeof E.listenerCount?E.listenerCount(U):j.call(E,U)},b.prototype.listenerCount=j,b.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},{}],9:[function(K,Ae,he){he.read=function(q,V,L,re,$){var b,S,O=8*$-re-1,T=(1<>1,y=-7,w=L?$-1:0,M=L?-1:1,j=q[V+w];for(w+=M,b=j&(1<<-y)-1,j>>=-y,y+=O;y>0;b=256*b+q[V+w],w+=M,y-=8);for(S=b&(1<<-y)-1,b>>=-y,y+=re;y>0;S=256*S+q[V+w],w+=M,y-=8);if(0===b)b=1-v;else{if(b===T)return S?NaN:1/0*(j?-1:1);S+=Math.pow(2,re),b-=v}return(j?-1:1)*S*Math.pow(2,b-re)},he.write=function(q,V,L,re,$,b){var S,O,T,v=8*b-$-1,y=(1<>1,M=23===$?Math.pow(2,-24)-Math.pow(2,-77):0,j=re?0:b-1,I=re?1:-1,H=V<0||0===V&&1/V<0?1:0;for(V=Math.abs(V),isNaN(V)||V===1/0?(O=isNaN(V)?1:0,S=y):(S=Math.floor(Math.log(V)/Math.LN2),V*(T=Math.pow(2,-S))<1&&(S--,T*=2),(V+=S+w>=1?M/T:M*Math.pow(2,1-w))*T>=2&&(S++,T/=2),S+w>=y?(O=0,S=y):S+w>=1?(O=(V*T-1)*Math.pow(2,$),S+=w):(O=V*Math.pow(2,w-1)*Math.pow(2,$),S=0));$>=8;q[L+j]=255&O,j+=I,O/=256,$-=8);for(S=S<<$|O,v+=$;v>0;q[L+j]=255&S,j+=I,S/=256,v-=8);q[L+j-I]|=128*H}},{}],10:[function(K,Ae,he){Ae.exports="function"==typeof Object.create?function(V,L){L&&(V.super_=L,V.prototype=Object.create(L.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}))}:function(V,L){if(L){V.super_=L;var re=function(){};re.prototype=L.prototype,V.prototype=new re,V.prototype.constructor=V}}},{}],11:[function(K,Ae,he){"use strict";const{isArray:q,isObject:V,isString:L}=K("./types"),{asArray:re}=K("./util"),{prependBase:$}=K("./url"),b=K("./JsonLdError"),S=K("./ResolvedContext");function T(y){throw new b("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function v({context:y,base:w}){if(!y)return;const M=y["@context"];if(L(M))y["@context"]=$(w,M);else if(q(M))for(let j=0;j10)throw new b("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"loading remote context failed":"context overflow",max:10});if(I.has(M))throw new b("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"recursive context inclusion":"context overflow",url:M});let H,Y;I.add(M);try{Y=yield j(M),H=Y.document||null,L(H)&&(H=JSON.parse(H))}catch(D){throw new b("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:M,cause:D})}if(!V(H))throw new b("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:M});return H="@context"in H?{"@context":H["@context"]}:{"@context":{}},Y.contextUrl&&(q(H["@context"])||(H["@context"]=[H["@context"]]),H["@context"].push(Y.contextUrl)),{context:H,remoteDoc:Y}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(K,Ae,he){"use strict";Ae.exports=class extends Error{constructor(V="An unspecified JSON-LD error occurred.",L="jsonld.Error",re={}){super(V),this.name=L,this.message=V,this.details=re}}},{}],13:[function(K,Ae,he){"use strict";Ae.exports=q=>{class V{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(V,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(V.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:V}),V.compact=function(L,re){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):q.compact(L,re)},V.expand=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):q.expand(L)},V.flatten=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):q.flatten(L)},V}},{}],14:[function(K,Ae,he){"use strict";Ae.exports=K("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(K,Ae,he){"use strict";Ae.exports=class{constructor(){this._requests={}}wrapLoader(V){const L=this;return L._loader=V,function(){return L.add.apply(L,arguments)}}add(V){var L=this;return gt(function*(){let re=L._requests[V];if(re)return Promise.resolve(re);re=L._requests[V]=L._loader(V);try{return yield re}finally{delete L._requests[V]}})()}}},{}],16:[function(K,Ae,he){"use strict";const q=K("lru-cache");Ae.exports=class{constructor({document:re}){this.document=re,this.cache=new q({max:10})}getProcessed(re){return this.cache.get(re)}setProcessed(re,$){this.cache.set(re,$)}}},{"lru-cache":33}],17:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),{isArray:V,isObject:L,isString:re,isUndefined:$}=K("./types"),{isList:b,isValue:S,isGraph:O,isSimpleGraph:T,isSubjectReference:v}=K("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:M,process:j,processingMode:I}=K("./context"),{removeBase:H,prependBase:Y}=K("./url"),{addValue:D,asArray:F,compareShortestLeast:Q}=K("./util"),E={};function ie(ue,ee,se){if("@nest"!==y(ue,ee,{vocab:!0},se))throw new q("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ae.exports=E,E.compact=function(){var ue=gt(function*({activeCtx:ee,activeProperty:se=null,element:Te,options:me={},compactionMap:te=(()=>{})}){if(V(Te)){let De=[];for(let Ve=0;Ve1&&(Je=Array.from(Je).sort());const Ye=ee;for(const Le of Je){const Ee=E.compactIri({activeCtx:Ye,iri:Le,relativeTo:{vocab:!0}}),Re=w(nt,Ee,"@context");$(Re)||(ee=yield j({activeCtx:ee,localCtx:Re,options:me,propagate:!1}))}const je=Object.keys(Te).sort();for(const Le of je){const Ee=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&M(Le)){const Re=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Re,Ee)}else{if(!V(Ee))throw new q("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ee.length){const Re=E.compactIri({activeCtx:ee,iri:Le,value:Ee,relativeTo:{vocab:!0},reverse:De}),Ue=ee.mappings.has(Re)?ee.mappings.get(Re)["@nest"]:null;let qe=Ve;Ue&&(ie(ee,Ue,me),L(Ve[Ue])||(Ve[Ue]={}),qe=Ve[Ue]),D(qe,Re,Ee,{propertyIsArray:!0})}for(const Re of Ee){const Ue=E.compactIri({activeCtx:ee,iri:Le,value:Re,relativeTo:{vocab:!0},reverse:De}),qe=ee.mappings.has(Ue)?ee.mappings.get(Ue)["@nest"]:null;let Be=Ve;qe&&(ie(ee,qe,me),L(Ve[qe])||(Ve[qe]={}),Be=Ve[qe]);const z=w(ee,Ue,"@container")||[],X=O(Re),be=b(Re);let ce;be?ce=Re["@list"]:X&&(ce=Re["@graph"]);let Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:be||X?ce:Re,options:me,compactionMap:te});if(be){if(V(Pe)||(Pe=[Pe]),z.includes("@list")){D(Be,Ue,Pe,{valueIsArray:!0,allowDuplicate:!0});continue}Pe={[E.compactIri({activeCtx:ee,iri:"@list",relativeTo:{vocab:!0}})]:Pe},"@index"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Re["@index"])}if(X)if(z.includes("@graph")&&(z.includes("@id")||z.includes("@index")&&T(Re))){let wt;Be.hasOwnProperty(Ue)?wt=Be[Ue]:Be[Ue]=wt={};const pt=(z.includes("@id")?Re["@id"]:Re["@index"])||E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}});D(wt,pt,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})}else z.includes("@graph")&&T(Re)?(V(Pe)&&Pe.length>1&&(Pe={"@included":Pe}),D(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})):(V(Pe)&&1===Pe.length&&me.compactArrays&&(Pe=Pe[0]),Pe={[E.compactIri({activeCtx:ee,iri:"@graph",relativeTo:{vocab:!0}})]:Pe},"@id"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Re["@id"]),"@index"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Re["@index"]),D(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")}));else if(z.includes("@language")||z.includes("@index")||z.includes("@id")||z.includes("@type")){let wt,pt;if(Be.hasOwnProperty(Ue)?wt=Be[Ue]:Be[Ue]=wt={},z.includes("@language"))S(Pe)&&(Pe=Pe["@value"]),pt=Re["@language"];else if(z.includes("@index")){const fe=w(ee,Ue,"@index")||"@index",B=E.compactIri({activeCtx:ee,iri:fe,relativeTo:{vocab:!0}});if("@index"===fe)pt=Re["@index"],delete Pe[B];else{let R;if([pt,...R]=F(Pe[fe]||[]),re(pt))switch(R.length){case 0:delete Pe[fe];break;case 1:Pe[fe]=R[0];break;default:Pe[fe]=R}else pt=null}}else if(z.includes("@id")){const fe=E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}});pt=Pe[fe],delete Pe[fe]}else if(z.includes("@type")){const fe=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=F(Pe[fe]||[]),B.length){case 0:delete Pe[fe];break;case 1:Pe[fe]=B[0];break;default:Pe[fe]=B}1===Object.keys(Pe).length&&"@id"in Re&&(Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:{"@id":Re["@id"]},options:me,compactionMap:te}))}pt||(pt=E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}})),D(wt,pt,Pe,{propertyIsArray:z.includes("@set")})}else{const wt=!me.compactArrays||z.includes("@set")||z.includes("@list")||V(Pe)&&0===Pe.length||"@list"===Le||"@graph"===Le;D(Be,Ue,Pe,{propertyIsArray:wt})}}}else{if((w(ee,se,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Ue,Ee)}else{const Re=yield E.compact({activeCtx:ee,activeProperty:se,element:Ee,options:me,compactionMap:te});V(Re)&&0===Re.length||D(Ve,Le,Re)}else{const Re=yield E.compact({activeCtx:ee,activeProperty:"@reverse",element:Ee,options:me,compactionMap:te});for(const Ue in Re)if(ee.mappings.has(Ue)&&ee.mappings.get(Ue).reverse){const qe=Re[Ue],z=(w(ee,Ue,"@container")||[]).includes("@set")||!me.compactArrays;D(Ve,Ue,qe,{propertyIsArray:z}),delete Re[Ue]}if(Object.keys(Re).length>0){const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Ue,Re)}}else{let Re=F(Ee).map(X=>E.compactIri({activeCtx:nt,iri:X,relativeTo:{vocab:!0}}));1===Re.length&&(Re=Re[0]);const Ue=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}}),z=(w(ee,Ue,"@container")||[]).includes("@set")&&I(ee,1.1)||V(Re)&&0===Ee.length;D(Ve,Ue,Re,{propertyIsArray:z})}else{let Re=F(Ee).map(qe=>E.compactIri({activeCtx:ee,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Re.length&&(Re=Re[0]),Ve[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Re}}return Ve}return Te});return function(ee){return ue.apply(this,arguments)}}(),E.compactIri=({activeCtx:ue,iri:ee,value:se=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:te=null})=>{if(null===ee)return ee;ue.isPropertyTermScoped&&ue.previousContext&&(ue=ue.previousContext);const ye=ue.getInverse();if(M(ee)&&ee in ye&&"@none"in ye[ee]&&"@type"in ye[ee]["@none"]&&"@none"in ye[ee]["@none"]["@type"])return ye[ee]["@none"]["@type"]["@none"];if(Te.vocab&&ee in ye){const Je=ue["@language"]||"@none",Ye=[];L(se)&&"@index"in se&&!("@graph"in se)&&Ye.push("@index","@index@set"),L(se)&&"@preserve"in se&&(se=se["@preserve"][0]),O(se)?("@index"in se&&Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se&&Ye.push("@graph@id","@graph@id@set"),Ye.push("@graph","@graph@set","@set"),"@index"in se||Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se||Ye.push("@graph@id","@graph@id@set")):L(se)&&!S(se)&&Ye.push("@id","@id@set","@type","@set@type");let je="@language",Le="@null";if(me)je="@type",Le="@reverse",Ye.push("@set");else if(b(se)){"@index"in se||Ye.push("@list");const Re=se["@list"];if(0===Re.length)je="@any",Le="@none";else{let Ue=0===Re.length?Je:null,qe=null;for(let Be=0;Bent.includes("_"));Ve&&ye.push(Ve.replace(/^[^_]+_/,"_"))}ye.push("@none");const De=ue.inverse[ee];for(const Ve of Te){if(!(Ve in De))continue;const nt=De[Ve][me];for(const Ze of ye)if(Ze in nt)return nt[Ze]}return null}(ue,ee,se,Ye,je,Le);if(null!==Ee)return Ee}if(Te.vocab&&"@vocab"in ue){const Je=ue["@vocab"];if(0===ee.indexOf(Je)&&ee!==Je){const Ye=ee.substr(Je.length);if(!ue.mappings.has(Ye))return Ye}}let De=null;const Ve=[];let nt=ue.fastCurieMap;const Ze=ee.length-1;for(let Je=0;Je=0;--Je){const Ye=Ve[Je],je=Ye.terms;for(const Le of je){const Ee=Le+":"+ee.substr(Ye.iri.length);ue.mappings.get(Le)._prefix&&(!ue.mappings.has(Ee)||null===se&&ue.mappings.get(Ee)["@id"]===ee)&&(null===De||Q(Ee,De)<0)&&(De=Ee)}}if(null!==De)return De;for(const[Je,Ye]of ue.mappings)if(Ye&&Ye._prefix&&ee.startsWith(Je+":"))throw new q(`Absolute IRI "${ee}" confused with prefix "${Je}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ue});return Te.vocab?ee:"@base"in ue?ue["@base"]?H(Y(te,ue["@base"]),ee):ee:H(te,ee)},E.compactValue=({activeCtx:ue,activeProperty:ee,value:se,options:Te})=>{if(S(se)){const De=w(ue,ee,"@type"),Ve=w(ue,ee,"@language"),nt=w(ue,ee,"@direction"),Ze=w(ue,ee,"@container")||[],Je="@index"in se&&!Ze.includes("@index");if(!Je&&"@none"!==De&&(se["@type"]===De||"@language"in se&&se["@language"]===Ve&&"@direction"in se&&se["@direction"]===nt||"@language"in se&&se["@language"]===Ve||"@direction"in se&&se["@direction"]===nt))return se["@value"];const Ye=Object.keys(se).length,je=1===Ye||2===Ye&&"@index"in se&&!Je,Le="@language"in ue,Ee=re(se["@value"]),Re=ue.mappings.has(ee)&&null===ue.mappings.get(ee)["@language"];if(je&&"@none"!==De&&(!Le||!Ee||Re))return se["@value"];const Ue={};return Je&&(Ue[E.compactIri({activeCtx:ue,iri:"@index",relativeTo:{vocab:!0}})]=se["@index"]),"@type"in se?Ue[E.compactIri({activeCtx:ue,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ue,iri:se["@type"],relativeTo:{vocab:!0}}):"@language"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@language",relativeTo:{vocab:!0}})]=se["@language"]),"@direction"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@direction",relativeTo:{vocab:!0}})]=se["@direction"]),Ue[E.compactIri({activeCtx:ue,iri:"@value",relativeTo:{vocab:!0}})]=se["@value"],Ue}const me=y(ue,ee,{vocab:!0},Te),te=w(ue,ee,"@type"),ye=E.compactIri({activeCtx:ue,iri:se["@id"],relativeTo:{vocab:"@vocab"===te},base:Te.base});return"@id"===te||"@vocab"===te||"@graph"===me?ye:{[E.compactIri({activeCtx:ue,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(K,Ae,he){"use strict";const q="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#";Ae.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:q,RDF_LIST:q+"List",RDF_FIRST:q+"first",RDF_REST:q+"rest",RDF_NIL:q+"nil",RDF_TYPE:q+"type",RDF_PLAIN_LITERAL:q+"PlainLiteral",RDF_XML_LITERAL:q+"XMLLiteral",RDF_JSON_LITERAL:q+"JSON",RDF_OBJECT:q+"object",RDF_LANGSTRING:q+"langString",XSD:V,XSD_BOOLEAN:V+"boolean",XSD_DOUBLE:V+"double",XSD_INTEGER:V+"integer",XSD_STRING:V+"string"}},{}],19:[function(K,Ae,he){"use strict";const q=K("./util"),V=K("./JsonLdError"),{isArray:L,isObject:re,isString:$,isUndefined:b}=K("./types"),{isAbsolute:S,isRelative:O,prependBase:T}=K("./url"),{asArray:v,compareShortestLeast:y}=K("./util"),w=new Map,j=/^@[a-zA-Z]+$/,I={};function H(D,F,Q,E,U,ie){if(null===F||!$(F)||I.isKeyword(F))return F;if(F.match(j))return null;if(E&&E.hasOwnProperty(F)&&!0!==U.get(F)&&I.createTermDefinition({activeCtx:D,localCtx:E,term:F,defined:U,options:ie}),(Q=Q||{}).vocab){const ee=D.mappings.get(F);if(null===ee)return null;if(re(ee)&&"@id"in ee)return ee["@id"]}const ue=F.indexOf(":");if(ue>0){const ee=F.substr(0,ue),se=F.substr(ue+1);if("_"===ee||0===se.indexOf("//"))return F;E&&E.hasOwnProperty(ee)&&I.createTermDefinition({activeCtx:D,localCtx:E,term:ee,defined:U,options:ie});const Te=D.mappings.get(ee);if(Te&&Te._prefix)return Te["@id"]+se;if(S(F))return F}if(Q.vocab&&"@vocab"in D)return D["@vocab"]+F;if(Q.base&&"@base"in D){if(D["@base"])return T(T(ie.base,D["@base"]),F)}else if(Q.base)return T(ie.base,F);return F}function Y(D,F){if(!D||"object"!=typeof D||!F||"object"!=typeof F)return D===F;const Q=Array.isArray(D);if(Q!==Array.isArray(F))return!1;if(Q){if(D.length!==F.length)return!1;for(let ie=0;ie{if(E.has(Q)){if(E.get(Q))return;throw new V("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:F,term:Q})}let ue;if(E.set(Q,!1),F.hasOwnProperty(Q)&&(ue=F[Q]),"@type"===Q&&re(ue)&&"@set"===(ue["@container"]||"@set")&&I.processingMode(D,1.1)){const De=["@container","@id","@protected"],Ve=Object.keys(ue);if(0===Ve.length||Ve.some(nt=>!De.includes(nt)))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q})}else{if(I.isKeyword(Q))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q});if(Q.match(j))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:Q});if(""===Q)throw new V("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:F})}const ee=D.mappings.get(Q);D.mappings.has(Q)&&D.mappings.delete(Q);let se=!1;if(($(ue)||null===ue)&&(se=!0,ue={"@id":ue}),!re(ue))throw new V("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:F});const Te={};D.mappings.set(Q,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];I.processingMode(D,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const De in ue)if(!me.includes(De))throw new V("Invalid JSON-LD syntax; a term definition must not contain "+De,"jsonld.SyntaxError",{code:"invalid term definition",context:F});const te=Q.indexOf(":");if(Te._termHasColon=te>0,"@reverse"in ue){if("@id"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});if("@nest"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});const De=ue["@reverse"];if(!$(De))throw new V("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(!I.isKeyword(De)&&De.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:De}),void(ee?D.mappings.set(Q,ee):D.mappings.delete(Q));const Ve=H(D,De,{vocab:!0,base:!1},F,E,U);if(!S(Ve))throw new V("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:F});Te["@id"]=Ve,Te.reverse=!0}else if("@id"in ue){let De=ue["@id"];if(De&&!$(De))throw new V("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(null===De)Te["@id"]=null;else{if(!I.isKeyword(De)&&De.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:De}),void(ee?D.mappings.set(Q,ee):D.mappings.delete(Q));if(De!==Q){if(De=H(D,De,{vocab:!0,base:!1},F,E,U),!S(De)&&!I.isKeyword(De))throw new V("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:F});if(Q.match(/(?::[^:])|\//)&&H(D,Q,{vocab:!0,base:!1},F,new Map(E).set(Q,!0),U)!==De)throw new V("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});Te["@id"]=De,Te._prefix=se&&!Te._termHasColon&&De.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const De=Q.substr(0,te);if(F.hasOwnProperty(De)&&I.createTermDefinition({activeCtx:D,localCtx:F,term:De,defined:E,options:U}),D.mappings.has(De)){const Ve=Q.substr(te+1);Te["@id"]=D.mappings.get(De)["@id"]+Ve}else Te["@id"]=Q}else if("@type"===Q)Te["@id"]=Q;else{if(!("@vocab"in D))throw new V("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F,term:Q});Te["@id"]=D["@vocab"]+Q}if((!0===ue["@protected"]||!0===E.get("@protected")&&!1!==ue["@protected"])&&(D.protected[Q]=!0,Te.protected=!0),E.set(Q,!0),"@type"in ue){let De=ue["@type"];if(!$(De))throw new V("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if("@json"===De||"@none"===De){if(I.processingMode(D,1))throw new V(`Invalid JSON-LD syntax; an @context @type value must not be "${De}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else if("@id"!==De&&"@vocab"!==De){if(De=H(D,De,{vocab:!0,base:!1},F,E,U),!S(De))throw new V("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if(0===De.indexOf("_:"))throw new V("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}Te["@type"]=De}if("@container"in ue){const De=$(ue["@container"])?[ue["@container"]]:ue["@container"]||[],Ve=["@list","@set","@index","@language"];let nt=!0;const Ze=De.includes("@set");if(I.processingMode(D,1.1)){if(Ve.push("@graph","@id","@type"),De.includes("@list")){if(1!==De.length)throw new V("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:F})}else if(De.includes("@graph")){if(De.some(Je=>"@graph"!==Je&&"@id"!==Je&&"@index"!==Je&&"@set"!==Je))throw new V("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:F})}else nt&=De.length<=(Ze?2:1);if(De.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new V("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else nt&=!L(ue["@container"]),nt&=De.length<=1;if(nt&=De.every(Je=>Ve.includes(Je)),nt&=!(Ze&&De.includes("@list")),!nt)throw new V("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ve.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:F});if(Te.reverse&&!De.every(Je=>["@index","@set"].includes(Je)))throw new V("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});Te["@container"]=De}if("@index"in ue){if(!("@container"in ue)||!Te["@container"].includes("@index"))throw new V(`Invalid JSON-LD syntax; @index without @index in @container: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});if(!$(ue["@index"])||0===ue["@index"].indexOf("@"))throw new V(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});Te["@index"]=ue["@index"]}if("@context"in ue&&(Te["@context"]=ue["@context"]),"@language"in ue&&!("@type"in ue)){let De=ue["@language"];if(null!==De&&!$(De))throw new V("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:F});null!==De&&(De=De.toLowerCase()),Te["@language"]=De}if("@prefix"in ue){if(Q.match(/:|\//))throw new V("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:F});if(I.isKeyword(Te["@id"]))throw new V("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:F});if("boolean"!=typeof ue["@prefix"])throw new V("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:F});Te._prefix=!0===ue["@prefix"]}if("@direction"in ue){const De=ue["@direction"];if(null!==De&&"ltr"!==De&&"rtl"!==De)throw new V('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:F});Te["@direction"]=De}if("@nest"in ue){const De=ue["@nest"];if(!$(De)||"@nest"!==De&&0===De.indexOf("@"))throw new V("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:F});Te["@nest"]=De}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new V("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:F});if(ee&&ee.protected&&!ie&&(D.protected[Q]=!0,Te.protected=!0,!Y(ee,Te))){const De=U&&U.protectedMode||"error";if("error"===De)throw new V(`Invalid JSON-LD syntax; tried to redefine "${Q}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:F,term:Q});if("warn"===De)return void console.warn("WARNING: protected term redefinition",{term:Q});throw new V("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:F,term:Q,protectedMode:De})}},I.expandIri=(D,F,Q,E)=>H(D,F,Q,void 0,void 0,E),I.getInitialContext=D=>{const F=JSON.stringify({processingMode:D.processingMode}),Q=w.get(F);if(Q)return Q;const E={processingMode:D.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},te=Te.fastCurieMap={},ye={},De=(Te["@language"]||"@none").toLowerCase(),Ve=Te["@direction"],nt=Te.mappings,Ze=[...nt.keys()].sort(y);for(const Je of Ze){const Ye=nt.get(Je);if(null===Ye)continue;let je=Ye["@container"]||"@none";if(je=[].concat(je).sort().join(""),null===Ye["@id"])continue;const Le=v(Ye["@id"]);for(const Ee of Le){let Re=me[Ee];const Ue=I.isKeyword(Ee);if(Re)!Ue&&!Ye._termHasColon&&ye[Ee].push(Je);else if(me[Ee]=Re={},!Ue&&!Ye._termHasColon){ye[Ee]=[Je];const qe={iri:Ee,terms:ye[Ee]};Ee[0]in te?te[Ee[0]].push(qe):te[Ee[0]]=[qe]}if(Re[je]||(Re[je]={"@language":{},"@type":{},"@any":{}}),Re=Re[je],ue(Je,Re["@any"],"@none"),Ye.reverse)ue(Je,Re["@type"],"@reverse");else if("@none"===Ye["@type"])ue(Je,Re["@any"],"@none"),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none");else if("@type"in Ye)ue(Je,Re["@type"],Ye["@type"]);else if("@language"in Ye&&"@direction"in Ye){const qe=Ye["@language"],Be=Ye["@direction"];ue(Je,Re["@language"],qe&&Be?`${qe}_${Be}`.toLowerCase():qe?qe.toLowerCase():Be?`_${Be}`:"@null")}else"@language"in Ye?ue(Je,Re["@language"],(Ye["@language"]||"@null").toLowerCase()):"@direction"in Ye?ue(Je,Re["@language"],Ye["@direction"]?`_${Ye["@direction"]}`:"@none"):Ve?(ue(Je,Re["@language"],`_${Ve}`),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none")):(ue(Je,Re["@language"],De),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none"))}}for(const Je in te)ie(te,Je,1);return me},clone:function(){const Te={};return Te.mappings=q.clone(this.mappings),Te.clone=this.clone,Te.inverse=null,Te.getInverse=this.getInverse,Te.protected=q.clone(this.protected),this.previousContext&&(Te.previousContext=this.previousContext.clone()),Te.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Te["@base"]=this["@base"]),"@language"in this&&(Te["@language"]=this["@language"]),"@vocab"in this&&(Te["@vocab"]=this["@vocab"]),Te},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===w.size&&w.clear(),w.set(F,E),E;function ie(Te,me,te){const ye=Te[me],De=Te[me]={};let Ve,nt;for(const Ze of ye)Ve=Ze.iri,nt=te>=Ve.length?"":Ve[te],nt in De?De[nt].push(Ze):De[nt]=[Ze];for(const Ze in De)""!==Ze&&ie(De,Ze,te+1)}function ue(Te,me,te){me.hasOwnProperty(te)||(me[te]=Te)}},I.getContextValue=(D,F,Q)=>{if(null===F)return"@context"===Q?void 0:null;if(D.mappings.has(F)){const E=D.mappings.get(F);if(b(Q))return E;if(E.hasOwnProperty(Q))return E[Q]}return"@language"===Q&&Q in D||"@direction"===Q&&Q in D?D[Q]:"@context"!==Q?null:void 0},I.processingMode=(D,F)=>F.toString()>="1.1"?!D.processingMode||D.processingMode>="json-ld-"+F.toString():"json-ld-1.0"===D.processingMode,I.isKeyword=D=>{if(!$(D)||"@"!==D[0])return!1;switch(D){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(K,Ae,he){"use strict";const{parseLinkHeader:q,buildHeaders:V}=K("../util"),{LINK_HEADER_CONTEXT:L}=K("../constants"),re=K("../JsonLdError"),$=K("../RequestQueue"),{prependBase:b}=K("../url"),S=/(^|(\r\n))link:/i;function O(T,v,y){const w=new(T=T||XMLHttpRequest);return new Promise((M,j)=>{w.onload=()=>M(w),w.onerror=I=>j(I),w.open("GET",v,!0);for(const I in y)w.setRequestHeader(I,y[I]);w.send()})}Ae.exports=({secure:T,headers:v={},xhr:y}={headers:{}})=>{return v=V(v),(new $).wrapLoader(M);function M(I){return j.apply(this,arguments)}function j(){return(j=gt(function*(I){if(0!==I.indexOf("http:")&&0!==I.indexOf("https:"))throw new re('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:I});if(T&&0!==I.indexOf("https"))throw new re('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:I});let H;try{H=yield O(y,I,v)}catch(E){throw new re("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:I,cause:E})}if(H.status>=400)throw new re("URL could not be dereferenced: "+H.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:I,httpStatusCode:H.status});let Y={contextUrl:null,documentUrl:I,document:H.response},D=null;const F=H.getResponseHeader("Content-Type");let Q;if(S.test(H.getAllResponseHeaders())&&(Q=H.getResponseHeader("Link")),Q&&"application/ld+json"!==F){const E=q(Q),U=E[L];if(Array.isArray(U))throw new re("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:I});U&&(Y.contextUrl=U.target),D=E.alternate,D&&"application/ld+json"==D.type&&!(F||"").match(/^application\/(\w*\+)?json$/)&&(Y=yield M(b(I,D.target)))}return Y})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),{isArray:V,isObject:L,isEmptyObject:re,isString:$,isUndefined:b}=K("./types"),{isList:S,isValue:O,isGraph:T,isSubject:v}=K("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:M,process:j,processingMode:I}=K("./context"),{isAbsolute:H}=K("./url"),{addValue:Y,asArray:D,getValues:F,validateTypeValue:Q}=K("./util"),E={};Ae.exports=E;const U=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function ie(te){return ue.apply(this,arguments)}function ue(){return(ue=gt(function*({activeCtx:te,activeProperty:ye,expandedActiveProperty:De,element:Ve,expandedParent:nt,options:Ze={},insideList:Je,typeKey:Ye,typeScopedContext:je,expansionMap:Le}){const Ee=Object.keys(Ve).sort(),Re=[];let Ue;const qe=Ve[Ye]&&"@json"===y(te,V(Ve[Ye])?Ve[Ye][0]:Ve[Ye],{vocab:!0},Ze);for(const Be of Ee){let X,z=Ve[Be];if("@context"===Be)continue;let be=y(te,Be,{vocab:!0},Ze);if((null===be||!H(be)&&!M(be))&&(be=Le({unmappedProperty:Be,activeCtx:te,activeProperty:ye,parent:Ve,options:Ze,insideList:Je,value:z,expandedParent:nt}),void 0===be))continue;if(M(be)){if("@reverse"===De)throw new q("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(be in nt&&"@included"!==be&&"@type"!==be)throw new q("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:be})}if("@id"===be){if(!$(z)){if(!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(L(z)){if(!re(z))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!V(z))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(pt=>$(pt)))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}Y(nt,"@id",D(z).map(pt=>$(pt)?y(te,pt,{base:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@type"===be){L(z)&&(z=Object.fromEntries(Object.entries(z).map(([pt,fe])=>[y(je,pt,{vocab:!0}),D(fe).map(B=>y(je,B,{base:!0,vocab:!0}))]))),Q(z,Ze.isFrame),Y(nt,"@type",D(z).map(pt=>$(pt)?y(je,pt,{base:!0,vocab:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@included"===be&&I(te,1.1)){const pt=D(yield E.expand({activeCtx:te,activeProperty:ye,element:z,options:Ze,expansionMap:Le}));if(!pt.every(fe=>v(fe)))throw new q("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});Y(nt,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===be&&!L(z)&&!V(z))throw new q('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if("@value"===be){Ue=z,qe&&I(te,1.1)?nt["@value"]=z:Y(nt,"@value",z,{propertyIsArray:Ze.isFrame});continue}if("@language"===be){if(null===z)continue;if(!$(z)&&!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=D(z).map(pt=>$(pt)?pt.toLowerCase():pt);for(const pt of z)$(pt)&&!pt.match(U)&&console.warn(`@language must be valid BCP47: ${pt}`);Y(nt,"@language",z,{propertyIsArray:Ze.isFrame});continue}if("@direction"===be){if(!$(z)&&!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=D(z);for(const pt of z)if($(pt)&&"ltr"!==pt&&"rtl"!==pt)throw new q('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});Y(nt,"@direction",z,{propertyIsArray:Ze.isFrame});continue}if("@index"===be){if(!$(z))throw new q('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});Y(nt,"@index",z);continue}if("@reverse"===be){if(!L(z))throw new q('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(X=yield E.expand({activeCtx:te,activeProperty:"@reverse",element:z,options:Ze,expansionMap:Le}),"@reverse"in X)for(const fe in X["@reverse"])Y(nt,fe,X["@reverse"][fe],{propertyIsArray:!0});let pt=nt["@reverse"]||null;for(const fe in X){if("@reverse"===fe)continue;null===pt&&(pt=nt["@reverse"]={}),Y(pt,fe,[],{propertyIsArray:!0});const B=X[fe];for(let R=0;R"@id"===pt||"@index"===pt)&&(X=D(X).map(pt=>({"@graph":D(pt)}))),ce.mappings.has(Be)&&ce.mappings.get(Be).reverse){const pt=nt["@reverse"]=nt["@reverse"]||{};X=D(X);for(let fe=0;fe"@value"===y(te,be,{vocab:!0},Ze)))throw new q("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:X});yield ie({activeCtx:te,activeProperty:ye,expandedActiveProperty:De,element:X,expandedParent:nt,options:Ze,insideList:Je,typeScopedContext:je,typeKey:Ye,expansionMap:Le})}}})).apply(this,arguments)}function ee({activeCtx:te,activeProperty:ye,value:De,options:Ve}){if(null==De)return null;const nt=y(te,ye,{vocab:!0},Ve);if("@id"===nt)return y(te,De,{base:!0},Ve);if("@type"===nt)return y(te,De,{vocab:!0,base:!0},Ve);const Ze=w(te,ye,"@type");if(("@id"===Ze||"@graph"===nt)&&$(De))return{"@id":y(te,De,{base:!0},Ve)};if("@vocab"===Ze&&$(De))return{"@id":y(te,De,{vocab:!0,base:!0},Ve)};if(M(nt))return De;const Je={};if(Ze&&!["@id","@vocab","@none"].includes(Ze))Je["@type"]=Ze;else if($(De)){const Ye=w(te,ye,"@language");null!==Ye&&(Je["@language"]=Ye);const je=w(te,ye,"@direction");null!==je&&(Je["@direction"]=je)}return["boolean","number","string"].includes(typeof De)||(De=De.toString()),Je["@value"]=De,Je}function se(te,ye,De,Ve){const nt=[],Ze=Object.keys(ye).sort();for(const Je of Ze){const Ye=y(te,Je,{vocab:!0},Ve);let je=ye[Je];V(je)||(je=[je]);for(const Le of je){if(null===Le)continue;if(!$(Le))throw new q("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ee={"@value":Le};"@none"!==Ye&&(Ee["@language"]=Je.toLowerCase()),De&&(Ee["@direction"]=De),nt.push(Ee)}}return nt}function Te(te){return me.apply(this,arguments)}function me(){return(me=gt(function*({activeCtx:te,options:ye,activeProperty:De,value:Ve,expansionMap:nt,asGraph:Ze,indexKey:Je,propertyIndex:Ye}){const je=[],Le=Object.keys(Ve).sort(),Ee="@type"===Je;for(let Re of Le){if(Ee){const Be=w(te,Re,"@context");b(Be)||(te=yield j({activeCtx:te,localCtx:Be,propagate:!1,options:ye}))}let qe,Ue=Ve[Re];V(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:te,activeProperty:De,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:nt}),qe=Ye?"@none"===Re?"@none":ee({activeCtx:te,activeProperty:Je,value:Re,options:ye}):y(te,Re,{vocab:!0},ye),"@id"===Je?Re=y(te,Re,{base:!0},ye):Ee&&(Re=qe);for(let Be of Ue){if(Ze&&!T(Be)&&(Be={"@graph":[Be]}),"@type"===Je)"@none"===qe||(Be["@type"]=Be["@type"]?[Re].concat(Be["@type"]):[Re]);else{if(O(Be)&&!["@language","@type","@index"].includes(Je))throw new q(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${Je}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Be});Ye?"@none"!==qe&&Y(Be,Ye,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(Je in Be)&&(Be[Je]=Re)}je.push(Be)}}return je})).apply(this,arguments)}E.expand=function(){var te=gt(function*({activeCtx:ye,activeProperty:De=null,element:Ve,options:nt={},insideList:Ze=!1,insideIndex:Je=!1,typeScopedContext:Ye=null,expansionMap:je=(()=>{})}){if(null==Ve)return null;if("@default"===De&&(nt=Object.assign({},nt,{isFrame:!1})),!V(Ve)&&!L(Ve)){if(!Ze&&(null===De||"@graph"===y(ye,De,{vocab:!0},nt))){const X=yield je({unmappedValue:Ve,activeCtx:ye,activeProperty:De,options:nt,insideList:Ze});return void 0===X?null:X}return ee({activeCtx:ye,activeProperty:De,value:Ve,options:nt})}if(V(Ve)){let X=[];const be=w(ye,De,"@container")||[];Ze=Ze||be.includes("@list");for(let ce=0;ce1?ce.slice().sort():ce:[ce];for(const wt of Pe){const pt=w(Ye,wt,"@context");b(pt)||(ye=yield j({activeCtx:ye,localCtx:pt,options:nt,propagate:!1}))}}let Be={};yield ie({activeCtx:ye,activeProperty:De,expandedActiveProperty:Le,element:Ve,expandedParent:Be,options:nt,insideList:Ze,typeKey:qe,typeScopedContext:Ye,expansionMap:je}),Re=Object.keys(Be);let z=Re.length;if("@value"in Be){if("@type"in Be&&("@language"in Be||"@direction"in Be))throw new q('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:Be});let X=z-1;if("@type"in Be&&(X-=1),"@index"in Be&&(X-=1),"@language"in Be&&(X-=1),"@direction"in Be&&(X-=1),0!==X)throw new q('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:Be});const be=null===Be["@value"]?[]:D(Be["@value"]),ce=F(Be,"@type");if(!I(ye,1.1)||!ce.includes("@json")||1!==ce.length)if(0===be.length){const Pe=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==Pe?Pe:null}else{if(!be.every(Pe=>$(Pe)||re(Pe))&&"@language"in Be)throw new q("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Be});if(!ce.every(Pe=>H(Pe)&&!($(Pe)&&0===Pe.indexOf("_:"))||re(Pe)))throw new q('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:Be})}}else if("@type"in Be&&!V(Be["@type"]))Be["@type"]=[Be["@type"]];else if("@set"in Be||"@list"in Be){if(z>1&&(2!==z||!("@index"in Be)))throw new q('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:Be});"@set"in Be&&(Be=Be["@set"],Re=Object.keys(Be),z=Re.length)}else if(1===z&&"@language"in Be){const X=yield je(Be,{unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}if(L(Be)&&!nt.keepFreeFloatingNodes&&!Ze&&(null===De||"@graph"===Le)&&(0===z||"@value"in Be||"@list"in Be||1===z&&"@id"in Be)){const X=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}return Be});return function(ye){return te.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(K,Ae,he){"use strict";const{isSubjectReference:q}=K("./graphTypes"),{createMergedNodeMap:V}=K("./nodeMap"),L={};Ae.exports=L,L.flatten=re=>{const $=V(re),b=[],S=Object.keys($).sort();for(let O=0;O=0;--ue){const ee=ie[ue];if(ee.graph===U&&ee.subject["@id"]===E["@id"])return!0}return!1}function w(E,U,ie){const ue="@"+ie;let ee=ue in E?E[ue][0]:U[ie];if("embed"===ie)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return ee}function M(E){if(!L.isArray(E)||1!==E.length||!L.isObject(E[0]))throw new b("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const U of re.asArray(E[0]["@id"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const U of re.asArray(E[0]["@type"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function I(E,U,ie,ue){let ee=!0,se=!1;for(const Te in ie){let me=!1;const te=re.getValues(U,Te),ye=0===re.getValues(ie,Te).length;if("@id"===Te){if(L.isEmptyObject(ie["@id"][0]||{})?me=!0:ie["@id"].length>=0&&(me=ie["@id"].includes(te[0])),!ue.requireAll)return me}else if("@type"===Te){if(ee=!1,ye){if(te.length>0)return!1;me=!0}else if(1===ie["@type"].length&&L.isEmptyObject(ie["@type"][0]))me=te.length>0;else for(const De of ie["@type"])me=!(!L.isObject(De)||!("@default"in De))||me||te.some(Ve=>Ve===De);if(!ue.requireAll)return me}else{if(q(Te))continue;{const De=re.getValues(ie,Te)[0];let Ve=!1;if(De&&(M([De]),Ve="@default"in De),ee=!1,0===te.length&&Ve)continue;if(te.length>0&&ye)return!1;if(void 0===De){if(te.length>0)return!1;me=!0}else if(V.isList(De)){const nt=De["@list"][0];if(V.isList(te[0])){const Ze=te[0]["@list"];V.isValue(nt)?me=Ze.some(Je=>Q(nt,Je)):(V.isSubject(nt)||V.isSubjectReference(nt))&&(me=Ze.some(Je=>F(E,nt,Je,ue)))}}else me=V.isValue(De)?te.some(nt=>Q(De,nt)):V.isSubjectReference(De)?te.some(nt=>F(E,De,nt,ue)):!!L.isObject(De)&&te.length>0}}if(!me&&ue.requireAll)return!1;se=se||me}return ee||se}function H(E,U){const ie=E.uniqueEmbeds[E.graph],ue=ie[U],ee=ue.parent,se=ue.property,Te={"@id":U};if(L.isArray(ee)){for(let te=0;te{const ye=Object.keys(ie);for(const De of ye)De in ie&&L.isObject(ie[De].parent)&&ie[De].parent["@id"]===te&&(delete ie[De],me(De))};me(U)}function Y(E,U){if(L.isArray(E))return E.map(ie=>Y(ie,U));if(L.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(V.isValue(E))return E;if(V.isList(E))return E["@list"]=Y(E["@list"],U),E;if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)"@id"===ie&&U.bnodesToClear.includes(E[ie])?delete E["@id"]:E[ie]=Y(E[ie],U)}return E}function D(E,U,ie){L.isObject(E)?re.addValue(E,U,ie,{propertyIsArray:!0}):E.push(ie)}function F(E,U,ie,ue){if(!("@id"in ie))return!1;const ee=E.subjects[ie["@id"]];return ee&&I(E,ee,U,ue)}function Q(E,U){const ie=U["@value"],ue=U["@type"],ee=U["@language"],se=E["@value"]?L.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?L.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?L.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===se.length&&0===Te.length&&0===me.length||!(!se.includes(ie)&&!L.isEmptyObject(se[0])||!(!ue&&0===Te.length||Te.includes(ue)||ue&&L.isEmptyObject(Te[0]))||!(!ee&&0===me.length||me.includes(ee)||ee&&L.isEmptyObject(me[0])))}Ae.exports=T,T.frameMergedOrDefault=(E,U,ie)=>{const ue={options:ie,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new re.IdentifierIssuer("_:b");S(E,ue.graphMap,"@default",ee),ie.merged&&(ue.graphMap["@merged"]=O(ue.graphMap),ue.graph="@merged"),ue.subjects=ue.graphMap[ue.graph];const se=[];return T.frame(ue,Object.keys(ue.subjects).sort(),U,se),ie.pruneBlankNodeIdentifiers&&(ie.bnodesToClear=Object.keys(ue.bnodeMap).filter(Te=>1===ue.bnodeMap[Te].length)),ie.link={},Y(se,ie)},T.frame=(E,U,ie,ue,ee=null)=>{M(ie);const se=E.options,Te={embed:w(ie=ie[0],se,"embed"),explicit:w(ie,se,"explicit"),requireAll:w(ie,se,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],te=function(E,U,ie,ue){const ee={};for(const se of U){const Te=E.graphMap[E.graph][se];I(E,Te,ie,ue)&&(ee[se]=Te)}return ee}(E,U,ie,Te),ye=Object.keys(te).sort();for(const De of ye){const Ve=te[De];if(null===ee?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&De in me){D(ue,ee,me[De]);continue}const nt={"@id":De};if(0===De.indexOf("_:")&&re.addValue(E.bnodeMap,De,nt,{propertyIsArray:!0}),me[De]=nt,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:ie});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(De)){if(E.embedded&&("@never"===Te.embed||y(Ve,E.graph,E.subjectStack))){D(ue,ee,nt);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(De)){D(ue,ee,nt);continue}if("@last"===Te.embed&&De in E.uniqueEmbeds[E.graph]&&H(E,De),E.uniqueEmbeds[E.graph][De]={parent:ue,property:ee},E.subjectStack.push({subject:Ve,graph:E.graph}),De in E.graphMap){let Ze=!1,Je=null;"@graph"in ie?(Je=ie["@graph"][0],Ze=!("@merged"===De||"@default"===De),L.isObject(Je)||(Je={})):(Ze="@merged"!==E.graph,Je={}),Ze&&T.frame(Un(ht({},E),{graph:De,embedded:!1}),Object.keys(E.graphMap[De]).sort(),[Je],nt,"@graph")}"@included"in ie&&T.frame(Un(ht({},E),{embedded:!1}),U,ie["@included"],nt,"@included");for(const Ze of Object.keys(Ve).sort())if(q(Ze)){if(nt[Ze]=re.clone(Ve[Ze]),"@type"===Ze)for(const Je of Ve["@type"])0===Je.indexOf("_:")&&re.addValue(E.bnodeMap,Je,nt,{propertyIsArray:!0})}else if(!Te.explicit||Ze in ie)for(const Je of Ve[Ze]){const Ye=Ze in ie?ie[Ze]:v(Te);if(V.isList(Je)){const je=ie[Ze]&&ie[Ze][0]&&ie[Ze][0]["@list"]?ie[Ze][0]["@list"]:v(Te),Le={"@list":[]};D(nt,Ze,Le);const Ee=Je["@list"];for(const Re of Ee)V.isSubjectReference(Re)?T.frame(Un(ht({},E),{embedded:!0}),[Re["@id"]],je,Le,"@list"):D(Le,"@list",re.clone(Re))}else V.isSubjectReference(Je)?T.frame(Un(ht({},E),{embedded:!0}),[Je["@id"]],Ye,nt,Ze):Q(Ye[0],Je)&&D(nt,Ze,re.clone(Je))}for(const Ze of Object.keys(ie).sort()){if("@type"===Ze){if(!L.isObject(ie[Ze][0])||!("@default"in ie[Ze][0]))continue}else if(q(Ze))continue;const Je=ie[Ze][0]||{};if(!w(Je,se,"omitDefault")&&!(Ze in nt)){let je="@null";"@default"in Je&&(je=re.clone(Je["@default"])),L.isArray(je)||(je=[je]),nt[Ze]=[{"@preserve":je}]}}for(const Ze of Object.keys(ie["@reverse"]||{}).sort()){const Je=ie["@reverse"][Ze];for(const Ye of Object.keys(E.subjects))re.getValues(E.subjects[Ye],Ze).some(Le=>Le["@id"]===De)&&(nt["@reverse"]=nt["@reverse"]||{},re.addValue(nt["@reverse"],Ze,[],{propertyIsArray:!0}),T.frame(Un(ht({},E),{embedded:!0}),[Ye],Je,nt["@reverse"][Ze],ee))}D(ue,ee,nt),E.subjectStack.pop()}}},T.cleanupNull=(E,U)=>{if(L.isArray(E))return E.map(ue=>T.cleanupNull(ue,U)).filter(ue=>ue);if("@null"===E)return null;if(L.isObject(E)){if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)E[ie]=T.cleanupNull(E[ie],U)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),V=K("./graphTypes"),L=K("./types"),re=K("./util"),{RDF_LIST:$,RDF_FIRST:b,RDF_REST:S,RDF_NIL:O,RDF_TYPE:T,RDF_JSON_LITERAL:v,XSD_BOOLEAN:y,XSD_DOUBLE:w,XSD_INTEGER:M,XSD_STRING:j}=K("./constants"),I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,H={};function Y(D,F,Q){if(D.termType.endsWith("Node"))return{"@id":D.value};const E={"@value":D.value};if(D.language)E["@language"]=D.language;else{let U=D.datatype.value;if(U||(U=j),U===v){U="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(ie){throw new q("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:ie})}}if(F){if(U===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(L.isNumeric(E["@value"]))if(U===M){const ie=parseInt(E["@value"],10);ie.toFixed(0)===E["@value"]&&(E["@value"]=ie)}else U===w&&(E["@value"]=parseFloat(E["@value"]));[y,M,w,j].includes(U)||(E["@type"]=U)}else if("i18n-datatype"===Q&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,ue]=U.split(/[#_]/);ie.length>0&&(E["@language"]=ie,ie.match(I)||console.warn(`@language must be valid BCP47: ${ie}`)),E["@direction"]=ue}else U!==j&&(E["@type"]=U)}return E}Ae.exports=H,H.fromRDF=function(){var D=gt(function*(F,{useRdfType:Q=!1,useNativeTypes:E=!1,rdfDirection:U=null}){const ie={},ue={"@default":ie},ee={};for(const me of F){const te="DefaultGraph"===me.graph.termType?"@default":me.graph.value;te in ue||(ue[te]={}),"@default"!==te&&!(te in ie)&&(ie[te]={"@id":te});const ye=ue[te],De=me.subject.value,Ve=me.predicate.value,nt=me.object;De in ye||(ye[De]={"@id":De});const Ze=ye[De],Je=nt.termType.endsWith("Node");if(Je&&!(nt.value in ye)&&(ye[nt.value]={"@id":nt.value}),Ve===T&&!Q&&Je){re.addValue(Ze,"@type",nt.value,{propertyIsArray:!0});continue}const Ye=Y(nt,E,U);if(re.addValue(Ze,Ve,Ye,{propertyIsArray:!0}),Je)if(nt.value===O){const je=ye[nt.value];"usages"in je||(je.usages=[]),je.usages.push({node:Ze,property:Ve,value:Ye})}else ee[nt.value]=!(nt.value in ee)&&{node:Ze,property:Ve,value:Ye}}for(const me in ue){const te=ue[me];if(!(O in te))continue;const ye=te[O];if(ye.usages){for(let De of ye.usages){let Ve=De.node,nt=De.property,Ze=De.value;const Je=[],Ye=[];let je=Object.keys(Ve).length;for(;nt===S&&L.isObject(ee[Ve["@id"]])&&L.isArray(Ve[b])&&1===Ve[b].length&&L.isArray(Ve[S])&&1===Ve[S].length&&(3===je||4===je&&L.isArray(Ve["@type"])&&1===Ve["@type"].length&&Ve["@type"][0]===$)&&(Je.push(Ve[b][0]),Ye.push(Ve["@id"]),De=ee[Ve["@id"]],Ve=De.node,nt=De.property,Ze=De.value,je=Object.keys(Ve).length,V.isBlankNode(Ve)););delete Ze["@id"],Ze["@list"]=Je.reverse();for(const Le of Ye)delete te[Le]}delete ye.usages}}const se=[],Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me];if(me in ue){const ye=te["@graph"]=[],De=ue[me],Ve=Object.keys(De).sort();for(const nt of Ve){const Ze=De[nt];V.isSubjectReference(Ze)||ye.push(Ze)}}V.isSubjectReference(te)||se.push(te)}return se});return function(F,Q){return D.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(K,Ae,he){"use strict";const q=K("./types"),V={};Ae.exports=V,V.isSubject=L=>!(!q.isObject(L)||"@value"in L||"@set"in L||"@list"in L)&&(Object.keys(L).length>1||!("@id"in L)),V.isSubjectReference=L=>q.isObject(L)&&1===Object.keys(L).length&&"@id"in L,V.isValue=L=>q.isObject(L)&&"@value"in L,V.isList=L=>q.isObject(L)&&"@list"in L,V.isGraph=L=>q.isObject(L)&&"@graph"in L&&1===Object.keys(L).filter(re=>"@id"!==re&&"@index"!==re).length,V.isSimpleGraph=L=>V.isGraph(L)&&!("@id"in L),V.isBlankNode=L=>!!q.isObject(L)&&("@id"in L?0===L["@id"].indexOf("_:"):0===Object.keys(L).length||!("@value"in L||"@set"in L||"@list"in L))},{"./types":30}],26:[function(K,Ae,he){const q=K("rdf-canonize"),V=K("./platform"),L=K("./util"),re=K("./ContextResolver"),$=L.IdentifierIssuer,b=K("./JsonLdError"),S=K("lru-cache"),O=K("./NQuads"),{expand:T}=K("./expand"),{flatten:v}=K("./flatten"),{fromRDF:y}=K("./fromRdf"),{toRDF:w}=K("./toRdf"),{frameMergedOrDefault:M,cleanupNull:j}=K("./frame"),{isArray:I,isObject:H,isString:Y}=K("./types"),{isSubjectReference:D}=K("./graphTypes"),{expandIri:F,getInitialContext:Q,process:E,processingMode:U}=K("./context"),{compact:ie,compactIri:ue}=K("./compact"),{createNodeMap:ee,createMergedNodeMap:se,mergeNodeMaps:Te}=K("./nodeMap"),me=function(ye){const De={},nt=new S({max:100});function Ze(Je,Le){var Ee=Le,{documentLoader:Ye=ye.documentLoader}=Ee,je=D7(Ee,["documentLoader"]);return Object.assign({},{documentLoader:Ye},je,Je)}return ye.compact=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===je)throw new b("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ye)return null;let Ee;(Le=Ze(Le,{base:Y(Ye)?Ye:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new $("_:b"),contextResolver:new re({sharedCache:nt})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ee=Le.skipExpansion?Ye:yield ye.expand(Ye,Le);const Re=yield ye.processContext(Q(Le),je,Le);let Ue=yield ie({activeCtx:Re,element:Ee,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&I(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&H(Ue)&&(Ue=[Ue]),H(je)&&"@context"in je&&(je=je["@context"]),je=L.clone(je),I(je)||(je=[je]);const qe=je;je=[];for(let z=0;z0)&&je.push(qe[z]);const Be=je.length>0;if(1===je.length&&(je=je[0]),I(Ue)){const z=ue({activeCtx:Re,iri:"@graph",relativeTo:{vocab:!0}}),X=Ue;Ue={},Be&&(Ue["@context"]=je),Ue[z]=X}else if(H(Ue)&&Be){const z=Ue;Ue={"@context":je};for(const X in z)Ue[X]=z[X]}return Ue});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.expand=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(je=Ze(je,{keepFreeFloatingNodes:!1,contextResolver:new re({sharedCache:nt})})).expansionMap&&(je.expansionMap=void 0);const Le={},Ee=[];if("expandContext"in je){const Be=L.clone(je.expandContext);Le.expandContext=H(Be)&&"@context"in Be?Be:{"@context":Be},Ee.push(Le.expandContext)}let Re;if(Y(Ye)){const Be=yield ye.get(Ye,je);Re=Be.documentUrl,Le.input=Be.document,Be.contextUrl&&(Le.remoteContext={"@context":Be.contextUrl},Ee.push(Le.remoteContext))}else Le.input=L.clone(Ye);"base"in je||(je.base=Re||"");let Ue=Q(je);for(const Be of Ee)Ue=yield E({activeCtx:Ue,localCtx:Be,options:je});let qe=yield T({activeCtx:Ue,element:Le.input,options:je,expansionMap:je.expansionMap});return H(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),I(qe)||(qe=[qe]),qe});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.flatten=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");je="function"==typeof je?null:je||null,Le=Ze(Le,{base:Y(Ye)?Ye:"",contextResolver:new re({sharedCache:nt})});const Ee=yield ye.expand(Ye,Le),Re=v(Ee);return null===je?Re:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Re,je,Le))});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.frame=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Ze(Le,{base:Y(Ye)?Ye:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new re({sharedCache:nt})}),Y(je)){const ce=yield ye.get(je,Le);if(je=ce.document,ce.contextUrl){let Pe=je["@context"];Pe?I(Pe)?Pe.push(ce.contextUrl):Pe=[Pe,ce.contextUrl]:Pe=ce.contextUrl,je["@context"]=Pe}}const Ee=je&&je["@context"]||{},Re=yield ye.processContext(Q(Le),Ee,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=U(Re,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=U(Re,1.1));const Ue=yield ye.expand(Ye,Le),qe=ht({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const Be=yield ye.expand(je,qe),z=Object.keys(je).map(ce=>F(Re,ce,{vocab:!0}));qe.merged=!z.includes("@graph"),qe.is11=U(Re,1.1);const X=M(Ue,Be,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let be=yield ye.compact(X,Ee,qe);return qe.link={},be=j(be,qe),be});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.link=function(){var Je=gt(function*(Ye,je,Le){const Ee={};return je&&(Ee["@context"]=je),Ee["@embed"]="@link",ye.frame(Ye,Ee,Le)});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(je=Ze(je,{base:Y(Ye)?Ye:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new re({sharedCache:nt})}))){if("application/n-quads"!==je.inputFormat&&"application/nquads"!==je.inputFormat)throw new b("Unknown canonicalization input format.","jsonld.CanonizeError");const Re=O.parse(Ye);return q.canonize(Re,je)}const Le=ht({},je);delete Le.format,Le.produceGeneralizedRdf=!1;const Ee=yield ye.toRDF(Ye,Le);return q.canonize(Ee,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.fromRDF=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");je=Ze(je,{format:Y(Ye)?"application/n-quads":void 0});const{format:Le}=je;let{rdfParser:Ee}=je;if(Le){if(Ee=Ee||De[Le],!Ee)throw new b("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ee=()=>Ye;const Re=yield Ee(Ye);return y(Re,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.toRDF=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(je=Ze(je,{base:Y(Ye)?Ye:"",skipExpansion:!1,contextResolver:new re({sharedCache:nt})})).skipExpansion?Ye:yield ye.expand(Ye,je);const Ee=w(Le,je);if(je.format){if("application/n-quads"===je.format||"application/nquads"===je.format)return O.serialize(Ee);throw new b("Unknown output format.","jsonld.UnknownFormat",{format:je.format})}return Ee});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.createNodeMap=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");je=Ze(je,{base:Y(Ye)?Ye:"",contextResolver:new re({sharedCache:nt})});const Le=yield ye.expand(Ye,je);return se(Le,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.merge=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!I(Ye))throw new TypeError('Could not merge, "docs" must be an array.');je="function"==typeof je?null:je||null,Le=Ze(Le,{contextResolver:new re({sharedCache:nt})});const Ee=yield Promise.all(Ye.map(ce=>{const Pe=ht({},Le);return ye.expand(ce,Pe)}));let Re=!0;"mergeNodes"in Le&&(Re=Le.mergeNodes);const Ue=Le.issuer||new $("_:b"),qe={"@default":{}};for(let ce=0;ceye._documentLoader,set:Je=>ye._documentLoader=Je}),ye.documentLoader=function(){var Je=gt(function*(Ye){throw new b("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Ye})});return function(Ye){return Je.apply(this,arguments)}}(),ye.get=function(){var Je=gt(function*(Ye,je){let Le;Le="function"==typeof je.documentLoader?je.documentLoader:ye.documentLoader;const Ee=yield Le(Ye);try{if(!Ee.document)throw new b("No remote document found at the given URL.","jsonld.NullRemoteDocument");Y(Ee.document)&&(Ee.document=JSON.parse(Ee.document))}catch(Re){throw new b("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Re,remoteDoc:Ee})}return Ee});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.processContext=function(){var Je=gt(function*(Ye,je,Le){return Le=Ze(Le,{base:"",contextResolver:new re({sharedCache:nt})}),null===je?Q(Le):(je=L.clone(je),H(je)&&"@context"in je||(je={"@context":je}),E({activeCtx:Ye,localCtx:je,options:Le}))});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.getContextValue=K("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(Je){if(!(Je in ye.documentLoaders))throw new b('Unknown document loader type: "'+Je+'"',"jsonld.UnknownDocumentLoader",{type:Je});ye.documentLoader=ye.documentLoaders[Je].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(Je,Ye){De[Je]=Ye},ye.unregisterRDFParser=function(Je){delete De[Je]},ye.registerRDFParser("application/n-quads",O.parse),ye.registerRDFParser("application/nquads",O.parse),ye.url=K("./url"),ye.util=L,Object.assign(ye,L),ye.promises=ye,ye.RequestQueue=K("./RequestQueue"),ye.JsonLdProcessor=K("./JsonLdProcessor")(ye),V.setupGlobals(ye),V.setupDocumentLoaders(ye),ye},te=function(){return me(function(){return te()})};me(te),Ae.exports=te},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(K,Ae,he){"use strict";const{isKeyword:q}=K("./context"),V=K("./graphTypes"),L=K("./types"),re=K("./util"),$=K("./JsonLdError"),b={};Ae.exports=b,b.createMergedNodeMap=(S,O)=>{const T=(O=O||{}).issuer||new re.IdentifierIssuer("_:b"),v={"@default":{}};return b.createNodeMap(S,v,"@default",T),b.mergeNodeMaps(v)},b.createNodeMap=(S,O,T,v,y,w)=>{if(L.isArray(S)){for(const H of S)b.createNodeMap(H,O,T,v,void 0,w);return}if(!L.isObject(S))return void(w&&w.push(S));if(V.isValue(S)){if("@type"in S){let H=S["@type"];0===H.indexOf("_:")&&(S["@type"]=H=v.getId(H))}return void(w&&w.push(S))}if(w&&V.isList(S)){const H=[];return b.createNodeMap(S["@list"],O,T,v,y,H),void w.push({"@list":H})}if("@type"in S){const H=S["@type"];for(const Y of H)0===Y.indexOf("_:")&&v.getId(Y)}L.isUndefined(y)&&(y=V.isBlankNode(S)?v.getId(S["@id"]):S["@id"]),w&&w.push({"@id":y});const M=O[T],j=M[y]=M[y]||{};j["@id"]=y;const I=Object.keys(S).sort();for(let H of I){if("@id"===H)continue;if("@reverse"===H){const D={"@id":y},F=S["@reverse"];for(const Q in F){const E=F[Q];for(const U of E){let ie=U["@id"];V.isBlankNode(U)&&(ie=v.getId(ie)),b.createNodeMap(U,O,T,v,ie),re.addValue(M[ie],Q,D,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===H){y in O||(O[y]={}),b.createNodeMap(S[H],O,y,v);continue}if("@included"===H){b.createNodeMap(S[H],O,T,v);continue}if("@type"!==H&&q(H)){if("@index"===H&&H in j&&(S[H]!==j[H]||S[H]["@id"]!==j[H]["@id"]))throw new $("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:j});j[H]=S[H];continue}const Y=S[H];if(0===H.indexOf("_:")&&(H=v.getId(H)),0!==Y.length)for(let D of Y)if("@type"===H&&(D=0===D.indexOf("_:")?v.getId(D):D),V.isSubject(D)||V.isSubjectReference(D)){if("@id"in D&&!D["@id"])continue;const F=V.isBlankNode(D)?v.getId(D["@id"]):D["@id"];re.addValue(j,H,{"@id":F},{propertyIsArray:!0,allowDuplicate:!1}),b.createNodeMap(D,O,T,v,F)}else if(V.isValue(D))re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1});else if(V.isList(D)){const F=[];b.createNodeMap(D["@list"],O,T,v,y,F),D={"@list":F},re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1})}else b.createNodeMap(D,O,T,v,y),re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1});else re.addValue(j,H,[],{propertyIsArray:!0})}},b.mergeNodeMapGraphs=S=>{const O={};for(const T of Object.keys(S).sort())for(const v of Object.keys(S[T]).sort()){const y=S[T][v];v in O||(O[v]={"@id":v});const w=O[v];for(const M of Object.keys(y).sort())if(q(M)&&"@type"!==M)w[M]=re.clone(y[M]);else for(const j of y[M])re.addValue(w,M,re.clone(j),{propertyIsArray:!0,allowDuplicate:!1})}return O},b.mergeNodeMaps=S=>{const O=S["@default"],T=Object.keys(S).sort();for(const v of T){if("@default"===v)continue;const y=S[v];let w=O[v];w?"@graph"in w||(w["@graph"]=[]):O[v]=w={"@id":v,"@graph":[]};const M=w["@graph"];for(const j of Object.keys(y).sort()){const I=y[j];V.isSubjectReference(I)||M.push(I)}}return O}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(K,Ae,he){"use strict";const q=K("./documentLoaders/xhr"),V={};Ae.exports=V,V.setupDocumentLoaders=function(L){"undefined"!=typeof XMLHttpRequest&&(L.documentLoaders.xhr=q,L.useDocumentLoader("xhr"))},V.setupGlobals=function(L){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:L.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(K,Ae,he){"use strict";const{createNodeMap:q}=K("./nodeMap"),{isKeyword:V}=K("./context"),L=K("./graphTypes"),re=K("canonicalize"),$=K("./types"),b=K("./util"),{RDF_FIRST:S,RDF_REST:O,RDF_NIL:T,RDF_TYPE:v,RDF_JSON_LITERAL:y,RDF_LANGSTRING:w,XSD_BOOLEAN:M,XSD_DOUBLE:j,XSD_INTEGER:I,XSD_STRING:H}=K("./constants"),{isAbsolute:Y}=K("./url"),D={};function F(U,ie,ue,ee,se){const Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me],ye=Object.keys(te).sort();for(let De of ye){const Ve=te[De];if("@type"===De)De=v;else if(V(De))continue;for(const nt of Ve){const Ze={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!Y(me))continue;const Je={termType:De.startsWith("_:")?"BlankNode":"NamedNode",value:De};if(!Y(De)||"BlankNode"===Je.termType&&!se.produceGeneralizedRdf)continue;const Ye=E(nt,ee,U,ue,se.rdfDirection);Ye&&U.push({subject:Ze,predicate:Je,object:Ye,graph:ue})}}}}function E(U,ie,ue,ee,se){const Te={};if(L.isValue(U)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=U["@value"];const te=U["@type"]||null;"@json"===te?(Te.value=re(me),Te.datatype.value=y):$.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=te||M):$.isDouble(me)||te===j?($.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=te||j):$.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=te||I):"i18n-datatype"===se&&"@direction"in U?(Te.datatype.value="https://www.w3.org/ns/i18n#"+(U["@language"]||"")+`_${U["@direction"]}`,Te.value=me):"@language"in U?(Te.value=me,Te.datatype.value=te||w,Te.language=U["@language"]):(Te.value=me,Te.datatype.value=te||H)}else if(L.isList(U)){const me=function(U,ie,ue,ee,se){const Te={termType:"NamedNode",value:S},me={termType:"NamedNode",value:O},te={termType:"NamedNode",value:T},ye=U.pop(),De=ye?{termType:"BlankNode",value:ie.getId()}:te;let Ve=De;for(const nt of U){const Ze=E(nt,ie,ue,ee,se),Je={termType:"BlankNode",value:ie.getId()};ue.push({subject:Ve,predicate:Te,object:Ze,graph:ee}),ue.push({subject:Ve,predicate:me,object:Je,graph:ee}),Ve=Je}if(ye){const nt=E(ye,ie,ue,ee,se);ue.push({subject:Ve,predicate:Te,object:nt,graph:ee}),ue.push({subject:Ve,predicate:me,object:te,graph:ee})}return De}(U["@list"],ie,ue,ee,se);Te.termType=me.termType,Te.value=me.value}else{const me=$.isObject(U)?U["@id"]:U;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||Y(Te.value)?Te:null}Ae.exports=D,D.toRDF=(U,ie)=>{const ue=new b.IdentifierIssuer("_:b"),ee={"@default":{}};q(U,ee,"@default",ue);const se=[],Te=Object.keys(ee).sort();for(const me of Te){let te;if("@default"===me)te={termType:"DefaultGraph",value:""};else{if(!Y(me))continue;te=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},te.value=me}F(se,ee[me],te,ue,ie)}return se}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(K,Ae,he){"use strict";const q={};Ae.exports=q,q.isArray=Array.isArray,q.isBoolean=V=>"boolean"==typeof V||"[object Boolean]"===Object.prototype.toString.call(V),q.isDouble=V=>q.isNumber(V)&&(-1!==String(V).indexOf(".")||Math.abs(V)>=1e21),q.isEmptyObject=V=>q.isObject(V)&&0===Object.keys(V).length,q.isNumber=V=>"number"==typeof V||"[object Number]"===Object.prototype.toString.call(V),q.isNumeric=V=>!isNaN(parseFloat(V))&&isFinite(V),q.isObject=V=>"[object Object]"===Object.prototype.toString.call(V),q.isString=V=>"string"==typeof V||"[object String]"===Object.prototype.toString.call(V),q.isUndefined=V=>void 0===V},{}],31:[function(K,Ae,he){"use strict";const q=K("./types"),V={};Ae.exports=V,V.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},V.parse=(re,$)=>{const b={},S=V.parsers[$||"full"],O=S.regex.exec(re);let T=S.keys.length;for(;T--;)b[S.keys[T]]=void 0===O[T]?null:O[T];return("https"===b.scheme&&"443"===b.port||"http"===b.scheme&&"80"===b.port)&&(b.href=b.href.replace(":"+b.port,""),b.authority=b.authority.replace(":"+b.port,""),b.port=null),b.normalizedPath=V.removeDotSegments(b.path),b},V.prependBase=(re,$)=>{if(null===re||V.isAbsolute($))return $;(!re||q.isString(re))&&(re=V.parse(re||""));const b=V.parse($),S={protocol:re.protocol||""};if(null!==b.authority)S.authority=b.authority,S.path=b.path,S.query=b.query;else if(S.authority=re.authority,""===b.path)S.path=re.path,S.query=null!==b.query?b.query:re.query;else{if(0===b.path.indexOf("/"))S.path=b.path;else{let T=re.path;T=T.substr(0,T.lastIndexOf("/")+1),(T.length>0||re.authority)&&"/"!==T.substr(-1)&&(T+="/"),T+=b.path,S.path=T}S.query=b.query}""!==b.path&&(S.path=V.removeDotSegments(S.path));let O=S.protocol;return null!==S.authority&&(O+="//"+S.authority),O+=S.path,null!==S.query&&(O+="?"+S.query),null!==b.fragment&&(O+="#"+b.fragment),""===O&&(O="./"),O},V.removeBase=(re,$)=>{if(null===re)return $;(!re||q.isString(re))&&(re=V.parse(re||""));let b="";if(""!==re.href?b+=(re.protocol||"")+"//"+(re.authority||""):$.indexOf("//")&&(b+="//"),0!==$.indexOf(b))return $;const S=V.parse($.substr(b.length)),O=re.normalizedPath.split("/"),T=S.normalizedPath.split("/"),v=S.fragment||S.query?0:1;for(;O.length>0&&T.length>v&&O[0]===T[0];)O.shift(),T.shift();let y="";if(O.length>0){O.pop();for(let w=0;w{if(0===re.length)return"";const $=re.split("/"),b=[];for(;$.length>0;){const S=$.shift(),O=0===$.length;"."!==S?".."!==S?b.push(S):(b.pop(),O&&b.push("")):O&&b.push("")}return"/"===re[0]&&b.length>0&&""!==b[0]&&b.unshift(""),1===b.length&&""===b[0]?"/":b.join("/")};const L=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;V.isAbsolute=re=>q.isString(re)&&L.test(re),V.isRelative=re=>q.isString(re)},{"./types":30}],32:[function(K,Ae,he){"use strict";const q=K("./graphTypes"),V=K("./types"),L=K("rdf-canonize").IdentifierIssuer,re=K("./JsonLdError"),$=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,b=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,S=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,O_headers={accept:"application/ld+json, application/json"},T={};function v(y,w){if(V.isArray(w))for(let M=0;M{if(Object.keys(y).some(M=>"accept"===M.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+O_headers.accept+'" is supported.');return Object.assign({Accept:O_headers.accept},y)},T.parseLinkHeader=y=>{const w={},M=y.match($);for(let j=0;j{if(!(V.isString(y)||V.isArray(y)&&y.every(M=>V.isString(M)))){if(w&&V.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&T.asArray(y["@default"]).every(M=>V.isString(M)))return}throw new re('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:y})}},T.hasProperty=(y,w)=>{if(y.hasOwnProperty(w)){const M=y[w];return!V.isArray(M)||M.length>0}return!1},T.hasValue=(y,w,M)=>{if(T.hasProperty(y,w)){let j=y[w];const I=q.isList(j);if(V.isArray(j)||I){I&&(j=j["@list"]);for(let H=0;H{if("propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1),"valueIsArray"in j||(j.valueIsArray=!1),"allowDuplicate"in j||(j.allowDuplicate=!0),"prependValue"in j||(j.prependValue=!1),j.valueIsArray)y[w]=M;else if(V.isArray(M)){0===M.length&&j.propertyIsArray&&!y.hasOwnProperty(w)&&(y[w]=[]),j.prependValue&&(M=M.concat(y[w]),y[w]=[]);for(let I=0;I[].concat(y[w]||[]),T.removeProperty=(y,w)=>{delete y[w]},T.removeValue=(y,w,M,j)=>{"propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1);const I=T.getValues(y,w).filter(H=>!T.compareValues(H,M));0===I.length?T.removeProperty(y,w):y[w]=1!==I.length||j.propertyIsArray?I:I[0]},T.relabelBlankNodes=(y,w)=>v((w=w||{}).issuer||new L("_:b"),y),T.compareValues=(y,w)=>!!(y===w||q.isValue(y)&&q.isValue(w)&&y["@value"]===w["@value"]&&y["@type"]===w["@type"]&&y["@language"]===w["@language"]&&y["@index"]===w["@index"])||!!(V.isObject(y)&&"@id"in y&&V.isObject(w)&&"@id"in w)&&y["@id"]===w["@id"],T.compareShortestLeast=(y,w)=>y.length1;const j=(Q,E,U)=>{const ie=Q[v].get(E);if(ie){const ue=ie.value;if(I(Q,ue)){if(Y(Q,ie),!Q[$])return}else U&&(Q[y]&&(ie.value.now=Date.now()),Q[T].unshiftNode(ie));return ue.value}},I=(Q,E)=>{if(!E||!E.maxAge&&!Q[b])return!1;const U=Date.now()-E.now;return E.maxAge?U>E.maxAge:Q[b]&&U>Q[b]},H=Q=>{if(Q[L]>Q[V])for(let E=Q[T].tail;Q[L]>Q[V]&&null!==E;){const U=E.prev;Y(Q,E),E=U}},Y=(Q,E)=>{if(E){const U=E.value;Q[S]&&Q[S](U.key,U.value),Q[L]-=U.length,Q[v].delete(U.key),Q[T].removeNode(E)}};class D{constructor(E,U,ie,ue,ee){this.key=E,this.value=U,this.length=ie,this.now=ue,this.maxAge=ee||0}}const F=(Q,E,U,ie)=>{let ue=U.value;I(Q,ue)&&(Y(Q,U),Q[$]||(ue=void 0)),ue&&E.call(ie,ue.value,ue.key,Q)};Ae.exports=class{constructor(E){if("number"==typeof E&&(E={max:E}),E||(E={}),E.max&&("number"!=typeof E.max||E.max<0))throw new TypeError("max must be a non-negative number");this[V]=E.max||1/0;const ie=E.length||w;if(this[re]="function"!=typeof ie?w:ie,this[$]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[b]=E.maxAge||0,this[S]=E.dispose,this[O]=E.noDisposeOnSet||!1,this[y]=E.updateAgeOnGet||!1,this.reset()}set max(E){if("number"!=typeof E||E<0)throw new TypeError("max must be a non-negative number");this[V]=E||1/0,H(this)}get max(){return this[V]}set allowStale(E){this[$]=!!E}get allowStale(){return this[$]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[b]=E,H(this)}get maxAge(){return this[b]}set lengthCalculator(E){"function"!=typeof E&&(E=w),E!==this[re]&&(this[re]=E,this[L]=0,this[T].forEach(U=>{U.length=this[re](U.value,U.key),this[L]+=U.length})),H(this)}get lengthCalculator(){return this[re]}get length(){return this[L]}get itemCount(){return this[T].length}rforEach(E,U){U=U||this;for(let ie=this[T].tail;null!==ie;){const ue=ie.prev;F(this,E,ie,U),ie=ue}}forEach(E,U){U=U||this;for(let ie=this[T].head;null!==ie;){const ue=ie.next;F(this,E,ie,U),ie=ue}}keys(){return this[T].toArray().map(E=>E.key)}values(){return this[T].toArray().map(E=>E.value)}reset(){this[S]&&this[T]&&this[T].length&&this[T].forEach(E=>this[S](E.key,E.value)),this[v]=new Map,this[T]=new q,this[L]=0}dump(){return this[T].map(E=>!I(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[T]}set(E,U,ie){if((ie=ie||this[b])&&"number"!=typeof ie)throw new TypeError("maxAge must be a number");const ue=ie?Date.now():0,ee=this[re](U,E);if(this[v].has(E)){if(ee>this[V])return Y(this,this[v].get(E)),!1;const me=this[v].get(E).value;return this[S]&&(this[O]||this[S](E,me.value)),me.now=ue,me.maxAge=ie,me.value=U,this[L]+=ee-me.length,me.length=ee,this.get(E),H(this),!0}const se=new D(E,U,ee,ue,ie);return se.length>this[V]?(this[S]&&this[S](E,U),!1):(this[L]+=se.length,this[T].unshift(se),this[v].set(E,this[T].head),H(this),!0)}has(E){if(!this[v].has(E))return!1;const U=this[v].get(E).value;return!I(this,U)}get(E){return j(this,E,!0)}peek(E){return j(this,E,!1)}pop(){const E=this[T].tail;return E?(Y(this,E),E.value):null}del(E){Y(this,this[v].get(E))}load(E){this.reset();const U=Date.now();for(let ie=E.length-1;ie>=0;ie--){const ue=E[ie],ee=ue.e||0;if(0===ee)this.set(ue.k,ue.v);else{const se=ee-U;se>0&&this.set(ue.k,ue.v,se)}}}prune(){this[v].forEach((E,U)=>j(this,U,!1))}}},{yallist:92}],34:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;const q="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${V}decimal`,boolean:`${V}boolean`,double:`${V}double`,integer:`${V}integer`,string:`${V}string`},rdf:{type:`${q}type`,nil:`${q}nil`,first:`${q}first`,rest:`${q}rest`,langString:`${q}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${L}reify#forSome`,forAll:`${L}reify#forAll`},log:{implies:`${L}log#implies`}}},{}],35:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.termFromId=function D(te,ye){if(ye=ye||v,!te)return ye.defaultGraph();switch(te[0]){case"?":return ye.variable(te.substr(1));case"_":return ye.blankNode(te.substr(2));case'"':if(ye===v)return new j(te);if('"'===te[te.length-1])return ye.literal(te.substr(1,te.length-2));const De=te.lastIndexOf('"',te.length-1);return ye.literal(te.substr(1,De-1),"@"===te[De+1]?te.substr(De+2):ye.namedNode(te.substr(De+3)));case"<":const Ve=T.exec(te);return ye.quad(D(U(Ve[1]),ye),D(U(Ve[2]),ye),D(U(Ve[3]),ye),Ve[4]&&D(U(Ve[4]),ye));default:return ye.namedNode(te)}},he.termToId=function F(te){if("string"==typeof te)return te;if(te instanceof w&&"Quad"!==te.termType)return te.id;if(!te)return b.id;switch(te.termType){case"NamedNode":return te.value;case"BlankNode":return`_:${te.value}`;case"Variable":return`?${te.value}`;case"DefaultGraph":return"";case"Literal":return`"${te.value}"${te.language?`@${te.language}`:te.datatype&&te.datatype.value!==$.string?`^^${te.datatype.value}`:""}`;case"Quad":return`<<${E(F(te.subject))} ${E(F(te.predicate))} ${E(F(te.object))}${(0,V.isDefaultGraph)(te.graph)?"":` ${F(te.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${te.termType}`)}},he.escapeQuotes=E,he.unescapeQuotes=U,he.Triple=he.Quad=he.DefaultGraph=he.Variable=he.BlankNode=he.Literal=he.NamedNode=he.Term=he.default=void 0;var te,q=(te=K("./IRIs"))&&te.__esModule?te:{default:te},V=K("./N3Util");const{rdf:re,xsd:$}=q.default;let b,S=0;const O=/^"(.*".*)(?="[^"]*$)/,T=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,v={namedNode:function(te){return new M(te)},blankNode:function(te){return new I(te||"n3-"+S++)},variable:function(te){return new H(te)},literal:function(te,ye){if("string"==typeof ye)return new j(`"${te}"@${ye.toLowerCase()}`);let De=ye?ye.value:"";return""===De&&("boolean"==typeof te?De=$.boolean:"number"==typeof te&&(Number.isFinite(te)?De=Number.isInteger(te)?$.integer:$.double:(De=$.double,Number.isNaN(te)||(te=te>0?"INF":"-INF")))),new j(""===De||De===$.string?`"${te}"`:`"${te}"^^${De}`)},defaultGraph:function(){return b},quad:me,triple:me};he.default=v;class w{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof w?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=w;class M extends w{get termType(){return"NamedNode"}}he.NamedNode=M;class j extends w{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let De=ye.lastIndexOf('"')+1;return De`"${De.replace(/"/g,'""')}`)}function U(te){return te.replace(O,(ye,De)=>`"${De.replace(/""/g,'"')}`)}function me(te,ye,De,Ve){return new Q(te,ye,De,Ve)}he.Triple=he.Quad=Q},{"./IRIs":34,"./N3Util":41}],36:[function(K,Ae,he){(function(q){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var V=re(K("./IRIs")),L=re(K("queue-microtask"));function re(w){return w&&w.__esModule?w:{default:w}}const{xsd:$}=V.default,b=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,S={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},O=/[\x00-\x20<>\\"\{\}\|\^\`]/,T={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},v=/$0^/;he.default=class{constructor(M){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]*)?$/,this._lineMode=!!(M=M||{}).lineMode){this._n3Mode=!1;for(const j in this)!(j in T)&&this[j]instanceof RegExp&&(this[j]=v)}else this._n3Mode=!1!==M.n3;this._comments=!!M.comments,this._literalClosingPos=0}_tokenizeToEnd(M,j){let I=this._input;const H=this._comments;for(;;){let D,F;for(;D=this._newline.exec(I);)H&&(F=this._comment.exec(D[0]))&&M(null,{line:this._line,type:"comment",value:F[1],prefix:""}),I=I.substr(D[0].length,I.length),this._line++;if(!D&&(D=this._whitespace.exec(I))&&(I=I.substr(D[0].length,I.length)),this._endOfFile.test(I))return j&&(H&&(F=this._comment.exec(I))&&M(null,{line:this._line,type:"comment",value:F[1],prefix:""}),M(I=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=I;const Q=this._line,E=I[0];let U="",ie="",ue="",ee=null,se=0,Te=!1;switch(E){case"^":if(I.length<3)break;if("^"!==I[1]){this._n3Mode&&(se=1,U="^");break}if(this._previousMarker="^^",I=I.substr(2),"<"!==I[0]){Te=!0;break}case"<":if(ee=this._unescapedIri.exec(I))U="IRI",ie=ee[1];else if(ee=this._iri.exec(I)){if(ie=this._unescape(ee[1]),null===ie||O.test(ie))return Y(this);U="IRI"}else I.length>1&&"<"===I[1]?(U="<<",se=2):this._n3Mode&&I.length>1&&"="===I[1]&&(U="inverse",se=2,ie=">");break;case">":I.length>1&&">"===I[1]&&(U=">>",se=2);break;case"_":((ee=this._blank.exec(I))||j&&(ee=this._blank.exec(`${I} `)))&&(U="blank",ue="_",ie=ee[1]);break;case'"':if(ee=this._simpleQuotedString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return Y(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(ee=this._simpleApostropheString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return Y(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(ee=this._variable.exec(I))&&(U="var",ie=ee[0]);break;case"@":"literal"===this._previousMarker&&(ee=this._langcode.exec(I))?(U="langcode",ie=ee[1]):(ee=this._keyword.exec(I))&&(U=ee[0]);break;case".":if(1===I.length?j:I[1]<"0"||I[1]>"9"){U=".",se=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(ee=this._number.exec(I)||j&&(ee=this._number.exec(`${I} `)))&&(U="literal",ie=ee[0],ue="string"==typeof ee[1]?$.double:"string"==typeof ee[2]?$.decimal:$.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(ee=this._sparqlKeyword.exec(I))?U=ee[0].toUpperCase():Te=!0;break;case"f":case"t":(ee=this._boolean.exec(I))?(U="literal",ie=ee[0],ue=$.boolean):Te=!0;break;case"a":(ee=this._shortPredicates.exec(I))?(U="abbreviation",ie="a"):Te=!0;break;case"=":this._n3Mode&&I.length>1&&(U="abbreviation",">"!==I[1]?(se=1,ie="="):(se=2,ie=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(se=1,U=E);break;default:Te=!0}if(Te&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(ee=this._prefix.exec(I))?((ee=this._prefixed.exec(I))||j&&(ee=this._prefixed.exec(`${I} `)))&&(U="prefixed",ue=ee[1]||"",ie=this._unescape(ee[2])):(U="prefix",ie=ee[1]||"")),"^^"===this._previousMarker)switch(U){case"prefixed":U="type";break;case"IRI":U="typeIRI";break;default:U=""}if(!U)return j||!/^'''|^"""/.test(I)&&/\n|\r/.test(I)?Y(this):this._input=I;const me={line:Q,type:U,value:ie,prefix:ue};M(null,me),this.previousToken=me,this._previousMarker=U,I=I.substr(se||ee[0].length,I.length)}function Y(D){M(D._syntaxError(/^\S*/.exec(I)[0]))}}_unescape(M){let j=!1;const I=M.replace(b,(H,Y,D,F)=>{if("string"==typeof Y)return String.fromCharCode(Number.parseInt(Y,16));if("string"==typeof D){let Q=Number.parseInt(D,16);return Q<=65535?String.fromCharCode(Number.parseInt(D,16)):String.fromCharCode(55296+((Q-=65536)>>10),56320+(1023&Q))}return F in S?S[F]:(j=!0,"")});return j?null:I}_parseLiteral(M){if(M.length>=3){const j=M.match(/^(?:"""|"|'''|'|)/)[0],I=j.length;let H=Math.max(this._literalClosingPos,I);for(;(H=M.indexOf(j,H))>0;){let Y=0;for(;"\\"===M[H-Y-1];)Y++;if(Y%2==0){const D=M.substring(I,H),F=D.split(/\r\n|\r|\n/).length-1,Q=H+I;if(1===I&&0!==F||3===I&&this._lineMode)break;return this._line+=F,{value:this._unescape(D),matchLength:Q}}H++}this._literalClosingPos=M.length-I+1}return{value:"",matchLength:0}}_syntaxError(M){this._input=null;const j=new Error(`Unexpected "${M}" on line ${this._line}.`);return j.context={token:void 0,line:this._line,previousToken:this.previousToken},j}_readStartingBom(M){return M.startsWith("\ufeff")?M.substr(1):M}tokenize(M,j){if(this._line=1,"string"==typeof M){if(this._input=this._readStartingBom(M),"function"!=typeof j){const I=[];let H;if(this._tokenizeToEnd((Y,D)=>Y?H=Y:I.push(D),!0),H)throw H;return I}(0,L.default)(()=>this._tokenizeToEnd(j,!0))}else this._pendingBuffer=null,"function"==typeof M.setEncoding&&M.setEncoding("utf8"),M.on("data",I=>{null!==this._input&&0!==I.length&&(this._pendingBuffer&&(I=q.concat([this._pendingBuffer,I]),this._pendingBuffer=null),128&I[I.length-1]?this._pendingBuffer=I:(void 0===this._input?this._input=this._readStartingBom("string"==typeof I?I:I.toString()):this._input+=I,this._tokenizeToEnd(j,!1)))}),M.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(j,!0)}),M.on("error",j)}}}).call(this)}).call(this,K("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var q=re(K("./N3Lexer")),V=re(K("./N3DataFactory")),L=re(K("./IRIs"));function re(T){return T&&T.__esModule?T:{default:T}}let $=0;class b{constructor(v){this._contextStack=[],this._graph=null,this._setBase((v=v||{}).baseIRI),v.factory&&O(this,v.factory);const y="string"==typeof v.format?v.format.match(/\w*$/)[0].toLowerCase():"",w=/turtle/.test(y),M=/trig/.test(y),j=/triple/.test(y),I=/quad/.test(y),H=this._n3Mode=/n3/.test(y),Y=j||I;(this._supportsNamedGraphs=!(w||H))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(w||M||j||H),this._supportsRDFStar=""===y||/star|\*$/.test(y),Y&&(this._resolveRelativeIRI=D=>null),this._blankNodePrefix="string"!=typeof v.blankNodePrefix?"":v.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=v.lexer||new q.default({lineMode:Y,n3:H}),this._explicitQuantifiers=!!v.explicitQuantifiers}static _resetBlankNodePrefix(){$=0}_setBase(v){if(v){const y=v.indexOf("#");y>=0&&(v=v.substr(0,y)),this._base=v,this._basePath=v.indexOf("/")<0?v:v.replace(/[^\/?]*(?:\?.*)?$/,""),v=v.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=v[0],this._baseScheme=v[1]}else this._base="",this._basePath=""}_saveContext(v,y,w,M,j){const I=this._n3Mode;this._contextStack.push({subject:w,predicate:M,object:j,graph:y,type:v,inverse:!!I&&this._inversePredicate,blankPrefix:I?this._prefixes._:"",quantified:I?this._quantified:null}),I&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const v=this._contextStack.pop(),y=this._n3Mode;this._subject=v.subject,this._predicate=v.predicate,this._object=v.object,this._graph=v.graph,y&&(this._inversePredicate=v.inverse,this._prefixes._=v.blankPrefix,this._quantified=v.quantified)}_readInTopContext(v){switch(v.type){case"eof":return null!==this._graph?this._error("Unclosed graph",v):(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(v)}}_readEntity(v,y){let w;switch(v.type){case"IRI":case"typeIRI":const M=this._resolveIRI(v.value);if(null===M)return this._error("Invalid IRI",v);w=this._namedNode(M);break;case"type":case"prefixed":const j=this._prefixes[v.prefix];if(void 0===j)return this._error(`Undefined prefix "${v.prefix}:"`,v);w=this._namedNode(j+v.value);break;case"blank":w=this._blankNode(this._prefixes[v.prefix]+v.value);break;case"var":w=this._variable(v.value.substr(1));break;default:return this._error(`Expected entity but got ${v.type}`,v)}return!y&&this._n3Mode&&w.id in this._quantified&&(w=this._quantified[w.id]),w}_readSubject(v){switch(this._predicate=null,v.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",v);case"}":return this._readPunctuation(v);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',v);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',v);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",v);if(0===v.prefix.length)return this._literalValue=v.value,this._completeSubjectLiteral;this._subject=this._literal(v.value,this._namedNode(v.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._subject=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(v){const y=v.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[v.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,v):(this._subject=null,"]"===y?this._readBlankNodeTail(v):this._readPunctuation(v));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",v);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",v);default:if(void 0===(this._predicate=this._readEntity(v)))return}return this._readObject}_readObject(v){switch(v.type){case"literal":if(0===v.prefix.length)return this._literalValue=v.value,this._readDataTypeOrLang;this._object=this._literal(v.value,this._namedNode(v.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._object=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(v){return"{"===v.type?this._readGraph(v):this._readPredicate(v)}_readGraph(v){return"{"!==v.type?this._error(`Expected graph but got ${v.type}`,v):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(v){return"]"===v.type?(this._subject=null,this._readBlankNodeTail(v)):(this._predicate=null,this._readPredicate(v))}_readBlankNodeTail(v){if("]"!==v.type)return this._readBlankNodePunctuation(v);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null===this._object?y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(v){switch(v.type){case".":case"}":return this._subject=null,this._readPunctuation(v);default:return this._readPredicate(v)}}_readListItem(v){let y=null,w=null,M=this._readListItem;const j=this._subject,I=this._contextStack,H=I[I.length-1];switch(v.type){case"[":this._saveContext("blank",this._graph,w=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),M=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,w=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==I.length&&"list"===I[I.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(M=this._readPredicate,this._subject===this.RDF_NIL)return M}else if(M=this._getContextEndReader(),this._object===this.RDF_NIL)return M;w=this.RDF_NIL;break;case"literal":0===v.prefix.length?(this._literalValue=v.value,M=this._readListItemDataTypeOrLang):(y=this._literal(v.value,this._namedNode(v.prefix)),M=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);default:if(void 0===(y=this._readEntity(v)))return}if(null===w&&(this._subject=w=this._blankNode()),null===j?null===H.predicate?H.subject=w:H.object=w:this._emit(j,this.RDF_REST,w,this._graph),null!==y){if(this._n3Mode&&("IRI"===v.type||"prefixed"===v.type))return this._saveContext("item",this._graph,w,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(w,this.RDF_FIRST,y,this._graph)}return M}_readDataTypeOrLang(v){return this._completeObjectLiteral(v,!1)}_readListItemDataTypeOrLang(v){return this._completeObjectLiteral(v,!0)}_completeLiteral(v){let y=this._literal(this._literalValue);switch(v.type){case"type":case"typeIRI":const w=this._readEntity(v);if(void 0===w)return;y=this._literal(this._literalValue,w),v=null;break;case"langcode":y=this._literal(this._literalValue,v.value),v=null}return{token:v,literal:y}}_completeSubjectLiteral(v){return this._subject=this._completeLiteral(v).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(v,y){const w=this._completeLiteral(v);if(w)return this._object=w.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===w.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(w.token))}_readFormulaTail(v){return"}"!==v.type?this._readPunctuation(v):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(v){let y,w=this._graph;const M=this._subject,j=this._inversePredicate;switch(v.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",v);if(this._n3Mode)return this._readFormulaTail(v);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,j&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(w=this._readEntity(v))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}if(null!==M){const I=this._predicate,H=this._object;j?this._emit(H,I,M,w):this._emit(M,I,H,w)}return y}_readBlankNodePunctuation(v){let y;switch(v.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(v){return"."!==v.type?this._error("Expected dot to follow quad",v):this._readInTopContext}_readPrefix(v){return"prefix"!==v.type?this._error("Expected prefix to follow @prefix",v):(this._prefix=v.value,this._readPrefixIRI)}_readPrefixIRI(v){if("IRI"!==v.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,v);const y=this._readEntity(v);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(v){const y="IRI"===v.type&&this._resolveIRI(v.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",v)}_readNamedGraphLabel(v){switch(v.type){case"IRI":case"blank":case"prefixed":return this._readSubject(v),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",v)}}_readNamedGraphBlankLabel(v){return"]"!==v.type?this._error("Invalid graph label",v):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(v){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(v)):"."!==v.type?this._error("Expected declaration to end with a dot",v):this._readInTopContext}_readQuantifierList(v){let y;switch(v.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(v,!0)))break;default:return this._error(`Unexpected ${v.type}`,v)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,y,this.QUANTIFIERS_GRAPH)):this._quantified[y.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(v){return","===v.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(v))}_getPathReader(v){return this._afterPath=v,this._readPath}_readPath(v){switch(v.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,w=y.length&&y[y.length-1];if(w&&"item"===w.type){const M=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,M,this._graph)}return this._afterPath(v)}}_readForwardPath(v){let y,w;const M=this._blankNode();if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(y=this._subject,this._subject=M):(y=this._object,this._object=M),this._emit(y,w,M,this._graph),this._readPath}_readBackwardPath(v){const y=this._blankNode();let w,M;if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(M=this._subject,this._subject=y):(M=this._object,this._object=y),this._emit(y,w,M,this._graph),this._readPath}_readRDFStarTailOrGraph(v){return">>"!==v.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(v))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,v):this._readRDFStarTail(v)}_readRDFStarTail(v){if(">>"!==v.type)return this._error(`Expected >> but got ${v.type}`,v);const y=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=y,this._readPredicate):(this._object=y,this._getContextEndReader())}_getContextEndReader(){const v=this._contextStack;if(!v.length)return this._readPunctuation;switch(v[v.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(v,y,w,M){this._callback(null,this._quad(v,y,w,M||this.DEFAULTGRAPH))}_error(v,y){const w=new Error(`${v} on line ${y.line}.`);w.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(w),this._callback=S}_resolveIRI(v){return/^[a-z][a-z0-9+.-]*:/i.test(v)?v:this._resolveRelativeIRI(v)}_resolveRelativeIRI(v){if(!v.length)return this._base;switch(v[0]){case"#":return this._base+v;case"?":return this._base.replace(/(?:\?.*)?$/,v);case"/":return("/"===v[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(v);default:return/^[^/:]*:/.test(v)?null:this._removeDotSegments(this._basePath+v)}}_removeDotSegments(v){if(!/(^|\/)\.\.?($|[/#?])/.test(v))return v;const y=v.length;let w="",M=-1,j=-1,I=0,H="/";for(;M=j&&(w=w.substr(0,I)),"/"!==H)return`${w}/${v.substr(M+1)}`;I=M+1}}}H=v[++M]}return w+v.substring(I)}parse(v,y,w){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${$++}_`,this._prefixCallback=w||S,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const M=[];let j;if(this._callback=(I,H)=>{I?j=I:H&&M.push(H)},this._lexer.tokenize(v).every(I=>this._readCallback=this._readCallback(I)),j)throw j;return M}this._callback=y,this._lexer.tokenize(v,(M,j)=>{null!==M?(this._callback(M),this._callback=S):this._readCallback&&(this._readCallback=this._readCallback(j))})}}function S(){}function O(T,v){const y=v.namedNode;T._namedNode=y,T._blankNode=v.blankNode,T._literal=v.literal,T._variable=v.variable,T._quad=v.quad,T.DEFAULTGRAPH=v.defaultGraph(),T.RDF_FIRST=y(L.default.rdf.first),T.RDF_REST=y(L.default.rdf.rest),T.RDF_NIL=y(L.default.rdf.nil),T.N3_FORALL=y(L.default.r.forAll),T.N3_FORSOME=y(L.default.r.forSome),T.ABBREVIATIONS={a:y(L.default.rdf.type),"=":y(L.default.owl.sameAs),">":y(L.default.log.implies)},T.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=b,O(b.prototype,V.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var v,q=function(v,y){if(!y&&v&&v.__esModule)return v;if(null===v||"object"!=typeof v&&"function"!=typeof v)return{default:v};var w=$(y);if(w&&w.has(v))return w.get(v);var M={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in v)if("default"!==I&&Object.prototype.hasOwnProperty.call(v,I)){var H=j?Object.getOwnPropertyDescriptor(v,I):null;H&&(H.get||H.set)?Object.defineProperty(M,I,H):M[I]=v[I]}return M.default=v,w&&w.set(v,M),M}(K("./N3DataFactory")),V=K("readable-stream"),L=(v=K("./IRIs"))&&v.__esModule?v:{default:v};function $(v){if("function"!=typeof WeakMap)return null;var y=new WeakMap,w=new WeakMap;return($=function(M){return M?w:y})(v)}class S{constructor(y,w){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!w&&y&&!y[0]&&(w=y,y=null),this._factory=(w=w||{}).factory||q.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const w=this._graphs;let M,j;for(const I in w)for(const H in M=w[I].subjects)for(const Y in j=M[H])y+=Object.keys(j[Y]).length;return this._size=y}_addToIndex(y,w,M,j){const I=y[w]||(y[w]={}),H=I[M]||(I[M]={}),Y=j in H;return Y||(H[j]=null),!Y}_removeFromIndex(y,w,M,j){const I=y[w],H=I[M];delete H[j];for(const Y in H)return;delete I[M];for(const Y in I)return;delete y[w]}_findInIndex(y,w,M,j,I,H,Y,D,F,Q){let E,U,ie;const ee=!w+!M+!j>1?Object.keys(this._ids):this._entities;w&&((E=y,y={})[w]=E[w]);for(const se in y){const Te=ee[se];if(U=y[se]){M&&((E=U,U={})[M]=E[M]);for(const me in U){const te=ee[me];if(ie=U[me]){const ye=j?j in ie?[j]:[]:Object.keys(ie);for(let De=0;De{M in w||(w[M]=!0,y((0,q.termFromId)(this._entities[M],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,w,M,j){w||(j=y.graph,M=y.object,w=y.predicate,y=y.subject),y=(0,q.termToId)(y),w=(0,q.termToId)(w),M=(0,q.termToId)(M),j=(0,q.termToId)(j);let I=this._graphs[j];I||(I=this._graphs[j]={subjects:{},predicates:{},objects:{}},Object.freeze(I));const H=this._ids,Y=this._entities;y=H[y]||(H[Y[++this._id]=y]=this._id),w=H[w]||(H[Y[++this._id]=w]=this._id),M=H[M]||(H[Y[++this._id]=M]=this._id);const D=this._addToIndex(I.subjects,y,w,M);return this._addToIndex(I.predicates,w,M,y),this._addToIndex(I.objects,M,y,w),this._size=null,D}addQuads(y){for(let w=0;w{this.addQuad(w)}),y}removeQuad(y,w,M,j){w||(j=y.graph,M=y.object,w=y.predicate,y=y.subject),y=(0,q.termToId)(y),w=(0,q.termToId)(w),M=(0,q.termToId)(M),j=(0,q.termToId)(j);const I=this._ids,H=this._graphs;let Y,D,F;if(!((y=I[y])&&(w=I[w])&&(M=I[M])&&(Y=H[j])&&(D=Y.subjects[y])&&(F=D[w])&&M in F))return!1;for(y in this._removeFromIndex(Y.subjects,y,w,M),this._removeFromIndex(Y.predicates,w,M,y),this._removeFromIndex(Y.objects,M,y,w),null!==this._size&&this._size--,Y.subjects)return!0;return delete H[j],!0}removeQuads(y){for(let w=0;w{this.removeQuad(w)}),y}removeMatches(y,w,M,j){const I=new V.Readable({objectMode:!0});return I._read=()=>{for(const H of this.getQuads(y,w,M,j))I.push(H);I.push(null)},this.remove(I)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,w,M,j){y=y&&(0,q.termToId)(y),w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=[],H=this._getGraphs(j),Y=this._ids;let D,F,Q,E;if(O(y)&&!(F=Y[y])||O(w)&&!(Q=Y[w])||O(M)&&!(E=Y[M]))return I;for(const U in H)(D=H[U])&&(F?E?this._findInIndex(D.objects,E,F,Q,"object","subject","predicate",U,null,I):this._findInIndex(D.subjects,F,Q,null,"subject","predicate","object",U,null,I):Q?this._findInIndex(D.predicates,Q,E,null,"predicate","object","subject",U,null,I):E?this._findInIndex(D.objects,E,null,null,"object","subject","predicate",U,null,I):this._findInIndex(D.subjects,null,null,null,"subject","predicate","object",U,null,I));return I}match(y,w,M,j){return new T(this,y,w,M,j)}countQuads(y,w,M,j){y=y&&(0,q.termToId)(y),w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._getGraphs(j),H=this._ids;let D,F,Q,E,Y=0;if(O(y)&&!(F=H[y])||O(w)&&!(Q=H[w])||O(M)&&!(E=H[M]))return 0;for(const U in I)(D=I[U])&&(Y+=y?M?this._countInIndex(D.objects,E,F,Q):this._countInIndex(D.subjects,F,Q,E):w?this._countInIndex(D.predicates,Q,E,F):this._countInIndex(D.objects,E,F,Q));return Y}forEach(y,w,M,j,I){this.some(H=>(y(H),!1),w,M,j,I)}every(y,w,M,j,I){let H=!1;const Y=!this.some(D=>(H=!0,!y(D)),w,M,j,I);return H&&Y}some(y,w,M,j,I){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j),I=I&&(0,q.termToId)(I);const H=this._getGraphs(I),Y=this._ids;let D,F,Q,E;if(O(w)&&!(F=Y[w])||O(M)&&!(Q=Y[M])||O(j)&&!(E=Y[j]))return!1;for(const U in H)if(D=H[U])if(F){if(E){if(this._findInIndex(D.objects,E,F,Q,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(D.subjects,F,Q,null,"subject","predicate","object",U,y,null))return!0}else if(Q){if(this._findInIndex(D.predicates,Q,E,null,"predicate","object","subject",U,y,null))return!0}else if(E){if(this._findInIndex(D.objects,E,null,null,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(D.subjects,null,null,null,"subject","predicate","object",U,y,null))return!0;return!1}getSubjects(y,w,M){const j=[];return this.forSubjects(I=>{j.push(I)},y,w,M),j}forSubjects(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.predicates,D,F,y):this._loopByKey1(Y.subjects,D,y):F?this._loopByKey0(Y.objects,F,y):this._loop(Y.subjects,y))}getPredicates(y,w,M){const j=[];return this.forPredicates(I=>{j.push(I)},y,w,M),j}forPredicates(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.objects,F,D,y):this._loopByKey0(Y.subjects,D,y):F?this._loopByKey1(Y.predicates,F,y):this._loop(Y.predicates,y))}getObjects(y,w,M){const j=[];return this.forObjects(I=>{j.push(I)},y,w,M),j}forObjects(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.subjects,D,F,y):this._loopByKey1(Y.objects,D,y):F?this._loopByKey0(Y.predicates,F,y):this._loop(Y.objects,y))}getGraphs(y,w,M){const j=[];return this.forGraphs(I=>{j.push(I)},y,w,M),j}forGraphs(y,w,M,j){for(const I in this._graphs)this.some(H=>(y(H.graph),!0),w,M,j,I)}createBlankNode(y){let w,M;if(y)for(w=y=`_:${y}`,M=1;this._ids[w];)w=y+M++;else do{w="_:b"+this._blankNodeIndex++}while(this._ids[w]);return this._ids[w]=++this._id,this._entities[this._id]=w,this._factory.blankNode(w.substr(2))}extractLists({remove:y=!1,ignoreErrors:w=!1}={}){const M={},j=w?()=>!0:(Y,D)=>{throw new Error(`${Y.value} ${D}`)},I=this.getQuads(null,L.default.rdf.rest,L.default.rdf.nil,null),H=y?[...I]:[];return I.forEach(Y=>{const D=[];let Q,E,F=!1;const U=Y.graph;let ie=Y.subject;for(;ie&&!F;){const ue=this.getQuads(null,null,ie,null),ee=this.getQuads(ie,null,null,null);let se,Te=null,me=null,te=null;for(let ye=0;ye{switch(v){case"data":O=y;break;case"end":T=y}}},(v,y)=>{v&&this.emit("error",v)||y&&this.push(y)},(v,y)=>{this.emit("prefix",v,y)}),this._transform=(v,y,w)=>{O(v),w()},this._flush=v=>{T(),v()}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var $,q=K("readable-stream"),V=($=K("./N3Writer"))&&$.__esModule?$:{default:$};he.default=class extends q.Transform{constructor(b){super({encoding:"utf8",writableObjectMode:!0});const S=this._writer=new V.default({write:(O,T,v)=>{this.push(O),v&&v()},end:O=>{this.push(null),O&&O()}},b);this._transform=(O,T,v)=>{S.addQuad(O,v)},this._flush=O=>{S.end(O)}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),b.on("prefix",(S,O)=>{this._writer.addPrefix(S,O)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.isDefaultGraph=S,he.inDefaultGraph=function(y){return S(y.graph)},he.prefix=function(y,w){return v({"":y},w)("")},he.prefixes=v;var y,q=(y=K("./N3DataFactory"))&&y.__esModule?y:{default:y};function S(y){return!!y&&"DefaultGraph"===y.termType}function v(y,w){const M=Object.create(null);for(const I in y)j(I,y[I]);function j(I,H){if("string"==typeof H){const Y=Object.create(null);M[I]=D=>Y[D]||(Y[D]=w.namedNode(H+D))}else if(!(I in M))throw new Error(`Unknown prefix: ${I}`);return M[I]}return w=w||q.default,j}},{"./N3DataFactory":35}],42:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,q=(H=K("./IRIs"))&&H.__esModule?H:{default:H},V=function(H,Y){if(!Y&&H&&H.__esModule)return H;if(null===H||"object"!=typeof H&&"function"!=typeof H)return{default:H};var D=re(Y);if(D&&D.has(H))return D.get(H);var F={},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in H)if("default"!==E&&Object.prototype.hasOwnProperty.call(H,E)){var U=Q?Object.getOwnPropertyDescriptor(H,E):null;U&&(U.get||U.set)?Object.defineProperty(F,E,U):F[E]=H[E]}return F.default=H,D&&D.set(H,F),F}(K("./N3DataFactory")),L=K("./N3Util");function re(H){if("function"!=typeof WeakMap)return null;var Y=new WeakMap,D=new WeakMap;return(re=function(F){return F?D:Y})(H)}const S=V.default.defaultGraph(),{rdf:O,xsd:T}=q.default,v=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,w={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class M extends V.Term{equals(){return!1}}function I(H){let Y=w[H];return void 0===Y&&(1===H.length?(Y=H.charCodeAt(0).toString(16),Y="\\u0000".substr(0,6-Y.length)+Y):(Y=(1024*(H.charCodeAt(0)-55296)+H.charCodeAt(1)+9216).toString(16),Y="\\U00000000".substr(0,10-Y.length)+Y)),Y}he.default=class{constructor(Y,D){if(this._prefixRegex=/$0^/,Y&&"function"!=typeof Y.write&&(D=Y,Y=null),this._lists=(D=D||{}).lists,Y)this._outputStream=Y,this._endStream=void 0===D.end||!!D.end;else{let F="";this._outputStream={write(Q,E,U){F+=Q,U&&U()},end:Q=>{Q&&Q(null,F)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(D.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=S,this._baseIRI=D.baseIRI,this._prefixIRIs=Object.create(null),D.prefixes&&this.addPrefixes(D.prefixes))}get _inDefaultGraph(){return S.equals(this._graph)}_write(Y,D){this._outputStream.write(Y,"utf8",D)}_writeQuad(Y,D,F,Q,E){try{Q.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(S.equals(Q)?"":`${this._encodeIriOrBlank(Q)} {\n`)),this._graph=Q,this._subject=null),Y.equals(this._subject)?D.equals(this._predicate)?this._write(`, ${this._encodeObject(F)}`,E):this._write(`;\n ${this._encodePredicate(this._predicate=D)} ${this._encodeObject(F)}`,E):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=Y)} ${this._encodePredicate(this._predicate=D)} ${this._encodeObject(F)}`,E)}catch(U){E&&E(U)}}_writeQuadLine(Y,D,F,Q,E){delete this._prefixMatch,this._write(this.quadToString(Y,D,F,Q),E)}quadToString(Y,D,F,Q){return`${this._encodeSubject(Y)} ${this._encodeIriOrBlank(D)} ${this._encodeObject(F)}${Q&&Q.value?` ${this._encodeIriOrBlank(Q)} .\n`:" .\n"}`}quadsToString(Y){return Y.map(D=>this.quadToString(D.subject,D.predicate,D.object,D.graph)).join("")}_encodeSubject(Y){return"Quad"===Y.termType?this._encodeQuad(Y):this._encodeIriOrBlank(Y)}_encodeIriOrBlank(Y){if("NamedNode"!==Y.termType)return this._lists&&Y.value in this._lists&&(Y=this.list(this._lists[Y.value])),"id"in Y?Y.id:`_:${Y.value}`;let D=Y.value;this._baseIRI&&D.startsWith(this._baseIRI)&&(D=D.substr(this._baseIRI.length)),v.test(D)&&(D=D.replace(y,I));const F=this._prefixRegex.exec(D);return F?F[1]?this._prefixIRIs[F[1]]+F[2]:D:`<${D}>`}_encodeLiteral(Y){let D=Y.value;if(v.test(D)&&(D=D.replace(y,I)),Y.language)return`"${D}"@${Y.language}`;if(this._lineMode){if(Y.datatype.value===T.string)return`"${D}"`}else switch(Y.datatype.value){case T.string:return`"${D}"`;case T.boolean:if("true"===D||"false"===D)return D;break;case T.integer:if(/^[+-]?\d+$/.test(D))return D;break;case T.decimal:if(/^[+-]?\d*\.\d+$/.test(D))return D;break;case T.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(D))return D}return`"${D}"^^${this._encodeIriOrBlank(Y.datatype)}`}_encodePredicate(Y){return Y.value===O.type?"a":this._encodeIriOrBlank(Y)}_encodeObject(Y){switch(Y.termType){case"Quad":return this._encodeQuad(Y);case"Literal":return this._encodeLiteral(Y);default:return this._encodeIriOrBlank(Y)}}_encodeQuad({subject:Y,predicate:D,object:F,graph:Q}){return`<<${this._encodeSubject(Y)} ${this._encodePredicate(D)} ${this._encodeObject(F)}${(0,L.isDefaultGraph)(Q)?"":` ${this._encodeIriOrBlank(Q)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(Y,D,F,Q,E){void 0===F?this._writeQuad(Y.subject,Y.predicate,Y.object,Y.graph,D):"function"==typeof Q?this._writeQuad(Y,D,F,S,Q):this._writeQuad(Y,D,F,Q||S,E)}addQuads(Y){for(let D=0;D.\n`)}if(F){let Q="",E="";for(const U in this._prefixIRIs)Q+=Q?`|${U}`:U,E+=(E?"|":"")+this._prefixIRIs[U];Q=Q.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${E})[^/]*$|^(${Q})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(F?"\n":"",D)}blank(Y,D){let Q,E,F=Y;switch(void 0===Y?F=[]:Y.termType?F=[{predicate:Y,object:D}]:"length"in Y||(F=[Y]),E=F.length){case 0:return new M("[]");case 1:if(Q=F[0],!(Q.object instanceof M))return new M(`[ ${this._encodePredicate(Q.predicate)} ${this._encodeObject(Q.object)} ]`);default:let U="[";for(let ie=0;ie{D=null,Y(F,Q)});if(this._endStream)try{return this._outputStream.end(D)}catch(F){}D&&D()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return O.Term}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return O.NamedNode}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return O.Literal}}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return O.BlankNode}}),Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return O.Variable}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return O.DefaultGraph}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return O.Quad}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return O.Triple}}),Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return O.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return O.termToId}}),he.Util=void 0;var q=y(K("./N3Lexer")),V=y(K("./N3Parser")),L=y(K("./N3Writer")),re=y(K("./N3Store")),$=y(K("./N3StreamParser")),b=y(K("./N3StreamWriter")),S=v(K("./N3Util"));he.Util=S;var O=v(K("./N3DataFactory"));function T(w){if("function"!=typeof WeakMap)return null;var M=new WeakMap,j=new WeakMap;return(T=function(I){return I?j:M})(w)}function v(w,M){if(!M&&w&&w.__esModule)return w;if(null===w||"object"!=typeof w&&"function"!=typeof w)return{default:w};var j=T(M);if(j&&j.has(w))return j.get(w);var I={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Y in w)if("default"!==Y&&Object.prototype.hasOwnProperty.call(w,Y)){var D=H?Object.getOwnPropertyDescriptor(w,Y):null;D&&(D.get||D.set)?Object.defineProperty(I,Y,D):I[Y]=w[Y]}return I.default=w,j&&j.set(w,I),I}function y(w){return w&&w.__esModule?w:{default:w}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(K,Ae,he){var V,L,q=Ae.exports={};function re(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function b(H){if(V===setTimeout)return setTimeout(H,0);if((V===re||!V)&&setTimeout)return V=setTimeout,setTimeout(H,0);try{return V(H,0)}catch(Y){try{return V.call(null,H,0)}catch(D){return V.call(this,H,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:re}catch(H){V=re}try{L="function"==typeof clearTimeout?clearTimeout:$}catch(H){L=$}}();var v,O=[],T=!1,y=-1;function w(){!T||!v||(T=!1,v.length?O=v.concat(O):y=-1,O.length&&M())}function M(){if(!T){var H=b(w);T=!0;for(var Y=O.length;Y;){for(v=O,O=[];++y1)for(var D=1;D(V||(V=Promise.resolve())).then(L).catch(re=>setTimeout(()=>{throw re},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(K,Ae,he){Ae.exports=K("./lib")},{"./lib":55}],47:[function(K,Ae,he){"use strict";Ae.exports=class I7{constructor(V,L=new Map,re=0){this.prefix=V,this._existing=L,this.counter=re}clone(){const{prefix:V,_existing:L,counter:re}=this;return new I7(V,new Map(L),re)}getId(V){const L=V&&this._existing.get(V);if(L)return L;const re=this.prefix+this.counter;return this.counter++,V&&this._existing.set(V,re),re}hasId(V){return this._existing.has(V)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(K,Ae,he){"use strict";K("setimmediate");const q=self.crypto||self.msCrypto;Ae.exports=class{constructor(L){if(!q||!q.subtle)throw new Error("crypto.subtle not found.");if("sha256"===L)this.algorithm={name:"SHA-256"};else{if("sha1"!==L)throw new Error(`Unsupport algorithm "${L}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(L){this._content+=L}digest(){var L=this;return gt(function*(){const re=(new TextEncoder).encode(L._content),$=new Uint8Array(yield q.subtle.digest(L.algorithm,re));let b="";for(let S=0;S<$.length;++S)b+=$[S].toString(16).padStart(2,"0");return b})()}}},{setimmediate:86}],49:[function(K,Ae,he){"use strict";const L="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",re="http://www.w3.org/2001/XMLSchema#string",$="NamedNode",b="BlankNode",S="Literal",O="DefaultGraph",T={};function v(I,H){return I.subject.termType===H.subject.termType&&I.object.termType===H.object.termType&&I.subject.value===H.subject.value&&I.predicate.value===H.predicate.value&&I.object.value===H.object.value&&(I.object.termType!==S||I.object.datatype.termType===H.object.datatype.termType&&I.object.language===H.object.language&&I.object.datatype.value===H.object.datatype.value)}T.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,T.empty=new RegExp("^[ \\t]*$"),T.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),Ae.exports=class SP{static parse(H){const Y=[],D={},F=H.split(T.eoln);let Q=0;for(const E of F){if(Q++,T.empty.test(E))continue;const U=E.match(T.quad);if(null===U)throw new Error("N-Quads parse error on line "+Q+".");const ie={subject:null,predicate:null,object:null,graph:null};if(ie.subject=void 0!==U[1]?{termType:$,value:U[1]}:{termType:b,value:U[2]},ie.predicate={termType:$,value:U[3]},void 0!==U[4]?ie.object={termType:$,value:U[4]}:void 0!==U[5]?ie.object={termType:b,value:U[5]}:(ie.object={termType:S,value:void 0,datatype:{termType:$}},void 0!==U[7]?ie.object.datatype.value=U[7]:void 0!==U[8]?(ie.object.datatype.value=L,ie.object.language=U[8]):ie.object.datatype.value=re,ie.object.value=U[6].replace(M,function(H,Y,D,F){if(Y)switch(Y){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(D)return String.fromCharCode(parseInt(D,16));if(F)throw new Error("Unsupported U escape")})),ie.graph=void 0!==U[9]?{termType:$,value:U[9]}:void 0!==U[10]?{termType:b,value:U[10]}:{termType:O,value:""},ie.graph.value in D){let ue=!0;const ee=D[ie.graph.value];for(const se of ee)if(v(se,ie)){ue=!1;break}ue&&(ee.push(ie),Y.push(ie))}else D[ie.graph.value]=[ie],Y.push(ie)}return Y}static serialize(H){Array.isArray(H)||(H=SP.legacyDatasetToQuads(H));const Y=[];for(const D of H)Y.push(SP.serializeQuad(D));return Y.sort().join("")}static serializeQuad(H){const Y=H.subject,F=H.object,Q=H.graph;let E="";return E+=Y.termType===$?`<${Y.value}>`:`${Y.value}`,E+=` <${H.predicate.value}> `,F.termType===$?E+=`<${F.value}>`:F.termType===b?E+=F.value:(E+=`"${I=F.value,I.replace(y,function(H){switch(H){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,F.datatype.value===L?F.language&&(E+=`@${F.language}`):F.datatype.value!==re&&(E+=`^^<${F.datatype.value}>`)),Q.termType===$?E+=` <${Q.value}>`:Q.termType===b&&(E+=` ${Q.value}`),E+=" .\n",E;var I}static legacyDatasetToQuads(H){const Y=[],D={"blank node":b,IRI:$,literal:S};for(const F in H)H[F].forEach(E=>{const U={};for(const ie in E){const ue=E[ie],ee={termType:D[ue.type],value:ue.value};ee.termType===S&&(ee.datatype={termType:$},"datatype"in ue&&(ee.datatype.value=ue.datatype),"language"in ue?("datatype"in ue||(ee.datatype.value=L),ee.language=ue.language):"datatype"in ue||(ee.datatype.value=re)),U[ie]=ee}U.graph="@default"===F?{termType:O,value:""}:{termType:F.startsWith("_:")?b:$,value:F},Y.push(U)});return Y}};const y=/["\\\n\r]/g;const M=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(K,Ae,he){"use strict";Ae.exports=class{constructor(V){this.current=V.sort(),this.done=!1,this.dir=new Map;for(let L=0;L$)&&(v&&O>0&&T>V[O-1]||!v&&OV[O+1])&&($=T,b=O)}if(null===$)this.done=!0;else{const O=L.get($)?b-1:b+1;V[b]=V[O],V[O]=$;for(const T of V)T>$&&L.set(T,!L.get(T))}return re}}},{}],51:[function(K,Ae,he){(function(q){(function(){"use strict";const V=K("./IdentifierIssuer"),L=K("./MessageDigest"),re=K("./Permuter"),$=K("./NQuads");function b(S,O){return S.hashO.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new V("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(O){var T=this;return gt(function*(){T.quads=O;for(const H of O)T._addBlankNodeQuadInfo({quad:H,component:H.subject}),T._addBlankNodeQuadInfo({quad:H,component:H.object}),T._addBlankNodeQuadInfo({quad:H,component:H.graph});const v=new Map,y=[...T.blankNodeInfo.keys()];let w=0;for(const H of y)++w%100==0&&(yield T._yield()),yield T._hashAndTrackBlankNode({id:H,hashToBlankNodes:v});const M=[...v.keys()].sort(),j=[];for(const H of M){const Y=v.get(H);Y.length>1?j.push(Y):T.canonicalIssuer.getId(Y[0])}for(const H of j){const Y=[];for(const D of H){if(T.canonicalIssuer.hasId(D))continue;const F=new V("_:b");F.getId(D);const Q=yield T.hashNDegreeQuads(D,F);Y.push(Q)}Y.sort(b);for(const D of Y){const F=D.issuer.getOldIds();for(const Q of F)T.canonicalIssuer.getId(Q)}}const I=[];for(const H of T.quads){const Y=ht({},H);Y.subject=T._useCanonicalId({component:Y.subject}),Y.object=T._useCanonicalId({component:Y.object}),Y.graph=T._useCanonicalId({component:Y.graph}),I.push($.serializeQuad(Y))}return I.sort(),I.join("")})()}hashFirstDegreeQuads(O){var T=this;return gt(function*(){const v=[],y=T.blankNodeInfo.get(O),w=y.quads;for(const j of w){const I={subject:null,predicate:j.predicate,object:null,graph:null};I.subject=T.modifyFirstDegreeComponent(O,j.subject,"subject"),I.object=T.modifyFirstDegreeComponent(O,j.object,"object"),I.graph=T.modifyFirstDegreeComponent(O,j.graph,"graph"),v.push($.serializeQuad(I))}v.sort();const M=new L(T.hashAlgorithm);for(const j of v)M.update(j);return y.hash=yield M.digest(),y.hash})()}hashRelatedBlankNode(O,T,v,y){var w=this;return gt(function*(){let M;M=w.canonicalIssuer.hasId(O)?w.canonicalIssuer.getId(O):v.hasId(O)?v.getId(O):w.blankNodeInfo.get(O).hash;const j=new L(w.hashAlgorithm);return j.update(y),"g"!==y&&j.update(w.getRelatedPredicate(T)),j.update(M),j.digest()})()}hashNDegreeQuads(O,T){var v=this;return gt(function*(){const y=new L(v.hashAlgorithm),w=yield v.createHashToRelated(O,T),M=[...w.keys()].sort();for(const j of M){y.update(j);let H,I="";const Y=new re(w.get(j));let D=0;for(;Y.hasNext();){const F=Y.next();++D%3==0&&(yield v._yield());let Q=T.clone(),E="";const U=[];let ie=!1;for(const ue of F)if(v.canonicalIssuer.hasId(ue)?E+=v.canonicalIssuer.getId(ue):(Q.hasId(ue)||U.push(ue),E+=Q.getId(ue)),0!==I.length&&E>I){ie=!0;break}if(!ie){for(const ue of U){const ee=yield v.hashNDegreeQuads(ue,Q);if(E+=Q.getId(ue),E+=`<${ee.hash}>`,Q=ee.issuer,0!==I.length&&E>I){ie=!0;break}}ie||(0===I.length||E`}createHashToRelated(O,T){var v=this;return gt(function*(){const y=new Map,w=v.blankNodeInfo.get(O).quads;let M=0;for(const j of w)++M%100==0&&(yield v._yield()),yield Promise.all([v._addRelatedBlankNodeHash({quad:j,component:j.subject,position:"s",id:O,issuer:T,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.object,position:"o",id:O,issuer:T,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.graph,position:"g",id:O,issuer:T,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:O,hashToBlankNodes:T}){var v=this;return gt(function*(){const y=yield v.hashFirstDegreeQuads(O),w=T.get(y);w?w.push(O):T.set(y,[O])})()}_addBlankNodeQuadInfo({quad:O,component:T}){if("BlankNode"!==T.termType)return;const v=T.value,y=this.blankNodeInfo.get(v);y?y.quads.add(O):this.blankNodeInfo.set(v,{quads:new Set([O]),hash:null})}_addRelatedBlankNodeHash({quad:O,component:T,position:v,id:y,issuer:w,hashToRelated:M}){var j=this;return gt(function*(){if("BlankNode"!==T.termType||T.value===y)return;const I=T.value,H=yield j.hashRelatedBlankNode(I,O,w,v),Y=M.get(H);Y?Y.push(I):M.set(H,[I])})()}_useCanonicalId({component:O}){return"BlankNode"!==O.termType||O.value.startsWith(this.canonicalIssuer.prefix)?O:{termType:"BlankNode",value:this.canonicalIssuer.getId(O.value)}}_yield(){return gt(function*(){return new Promise(O=>q(O))})()}}}).call(this)}).call(this,K("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(K,Ae,he){"use strict";const q=K("./IdentifierIssuer"),V=K("./MessageDigest"),L=K("./Permuter"),re=K("./NQuads");function $(b,S){return b.hashS.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new q("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(S){this.quads=S;for(const M of S)this._addBlankNodeQuadInfo({quad:M,component:M.subject}),this._addBlankNodeQuadInfo({quad:M,component:M.object}),this._addBlankNodeQuadInfo({quad:M,component:M.graph});const O=new Map,T=[...this.blankNodeInfo.keys()];for(const M of T)this._hashAndTrackBlankNode({id:M,hashToBlankNodes:O});const v=[...O.keys()].sort(),y=[];for(const M of v){const j=O.get(M);j.length>1?y.push(j):this.canonicalIssuer.getId(j[0])}for(const M of y){const j=[];for(const I of M){if(this.canonicalIssuer.hasId(I))continue;const H=new q("_:b");H.getId(I);const Y=this.hashNDegreeQuads(I,H);j.push(Y)}j.sort($);for(const I of j){const H=I.issuer.getOldIds();for(const Y of H)this.canonicalIssuer.getId(Y)}}const w=[];for(const M of this.quads){const j=ht({},M);j.subject=this._useCanonicalId({component:j.subject}),j.object=this._useCanonicalId({component:j.object}),j.graph=this._useCanonicalId({component:j.graph}),w.push(re.serializeQuad(j))}return w.sort(),w.join("")}hashFirstDegreeQuads(S){const O=[],T=this.blankNodeInfo.get(S),v=T.quads;for(const w of v){const M={subject:null,predicate:w.predicate,object:null,graph:null};M.subject=this.modifyFirstDegreeComponent(S,w.subject,"subject"),M.object=this.modifyFirstDegreeComponent(S,w.object,"object"),M.graph=this.modifyFirstDegreeComponent(S,w.graph,"graph"),O.push(re.serializeQuad(M))}O.sort();const y=new V(this.hashAlgorithm);for(const w of O)y.update(w);return T.hash=y.digest(),T.hash}hashRelatedBlankNode(S,O,T,v){let y;y=this.canonicalIssuer.hasId(S)?this.canonicalIssuer.getId(S):T.hasId(S)?T.getId(S):this.blankNodeInfo.get(S).hash;const w=new V(this.hashAlgorithm);return w.update(v),"g"!==v&&w.update(this.getRelatedPredicate(O)),w.update(y),w.digest()}hashNDegreeQuads(S,O){const T=new V(this.hashAlgorithm),v=this.createHashToRelated(S,O),y=[...v.keys()].sort();for(const w of y){T.update(w);let j,M="";const I=new L(v.get(w));for(;I.hasNext();){const H=I.next();let Y=O.clone(),D="";const F=[];let Q=!1;for(const E of H)if(this.canonicalIssuer.hasId(E)?D+=this.canonicalIssuer.getId(E):(Y.hasId(E)||F.push(E),D+=Y.getId(E)),0!==M.length&&D>M){Q=!0;break}if(!Q){for(const E of F){const U=this.hashNDegreeQuads(E,Y);if(D+=Y.getId(E),D+=`<${U.hash}>`,Y=U.issuer,0!==M.length&&D>M){Q=!0;break}}Q||(0===M.length||D`}createHashToRelated(S,O){const T=new Map,v=this.blankNodeInfo.get(S).quads;for(const y of v)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:S,issuer:O,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:S,issuer:O,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:S,issuer:O,hashToRelated:T});return T}_hashAndTrackBlankNode({id:S,hashToBlankNodes:O}){const T=this.hashFirstDegreeQuads(S),v=O.get(T);v?v.push(S):O.set(T,[S])}_addBlankNodeQuadInfo({quad:S,component:O}){if("BlankNode"!==O.termType)return;const T=O.value,v=this.blankNodeInfo.get(T);v?v.quads.add(S):this.blankNodeInfo.set(T,{quads:new Set([S]),hash:null})}_addRelatedBlankNodeHash({quad:S,component:O,position:T,id:v,issuer:y,hashToRelated:w}){if("BlankNode"!==O.termType||O.value===v)return;const M=O.value,j=this.hashRelatedBlankNode(M,S,y,T),I=w.get(j);I?I.push(M):w.set(j,[M])}_useCanonicalId({component:S}){return"BlankNode"!==S.termType||S.value.startsWith(this.canonicalIssuer.prefix)?S:{termType:"BlankNode",value:this.canonicalIssuer.getId(S.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(K,Ae,he){"use strict";const q=K("./URDNA2015");Ae.exports=class extends q{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){var $=this;return gt(function*(){const b=new Map,S=$.blankNodeInfo.get(L).quads;let O=0;for(const T of S){let v,y;if("BlankNode"===T.subject.termType&&T.subject.value!==L)y=T.subject.value,v="p";else{if("BlankNode"!==T.object.termType||T.object.value===L)continue;y=T.object.value,v="r"}++O%100==0&&(yield $._yield());const w=yield $.hashRelatedBlankNode(y,T,re,v),M=b.get(w);M?M.push(y):b.set(w,[y])}return b})()}}},{"./URDNA2015":51}],54:[function(K,Ae,he){"use strict";const q=K("./URDNA2015Sync");Ae.exports=class extends q{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){const $=new Map,b=this.blankNodeInfo.get(L).quads;for(const S of b){let O,T;if("BlankNode"===S.subject.termType&&S.subject.value!==L)T=S.subject.value,O="p";else{if("BlankNode"!==S.object.termType||S.object.value===L)continue;T=S.object.value,O="r"}const v=this.hashRelatedBlankNode(T,S,re,O),y=$.get(v);y?y.push(T):$.set(v,[T])}return $}}},{"./URDNA2015Sync":52}],55:[function(K,Ae,he){"use strict";const q=K("./URDNA2015"),V=K("./URGNA2012"),L=K("./URDNA2015Sync"),re=K("./URGNA2012Sync");let $;try{$=K("rdf-canonize-native")}catch(S){}const b={};Ae.exports=b,b.NQuads=K("./NQuads"),b.IdentifierIssuer=K("./IdentifierIssuer"),b._rdfCanonizeNative=function(S){return S&&($=S),$},b.canonize=function(){var S=gt(function*(O,T){if(Array.isArray(O)||(O=b.NQuads.legacyDatasetToQuads(O)),T.useNative){if(!$)throw new Error("rdf-canonize-native not available");return new Promise((v,y)=>$.canonize(O,T,(w,M)=>w?y(w):v(M)))}if("URDNA2015"===T.algorithm)return new q(T).main(O);if("URGNA2012"===T.algorithm)return new V(T).main(O);throw"algorithm"in T?new Error("Invalid RDF Dataset Canonicalization algorithm: "+T.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(O,T){return S.apply(this,arguments)}}(),b._canonizeSync=function(S,O){if(Array.isArray(S)||(S=b.NQuads.legacyDatasetToQuads(S)),O.useNative){if($)return $.canonizeSync(S,O);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===O.algorithm)return new L(O).main(S);if("URGNA2012"===O.algorithm)return new re(O).main(S);throw"algorithm"in O?new Error("Invalid RDF Dataset Canonicalization algorithm: "+O.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(K,Ae,he){"use strict";var q=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&q(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(K("./lib/BlankNode"),he),V(K("./lib/DataFactory"),he),V(K("./lib/DefaultGraph"),he),V(K("./lib/Literal"),he),V(K("./lib/NamedNode"),he),V(K("./lib/Quad"),he),V(K("./lib/Variable"),he)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(L){this.termType="BlankNode",this.value=L}equals(L){return!!L&&"BlankNode"===L.termType&&L.value===this.value}}},{}],58:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const q=K("./BlankNode"),V=K("./DefaultGraph"),L=K("./Literal"),re=K("./NamedNode"),$=K("./Quad"),b=K("./Variable");let S=0;he.DataFactory=class{constructor(v){this.blankNodeCounter=0,this.blankNodePrefix=(v=v||{}).blankNodePrefix||`df_${S++}_`}namedNode(v){return new re.NamedNode(v)}blankNode(v){return new q.BlankNode(v||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(v,y){return new L.Literal(v,y)}variable(v){return new b.Variable(v)}defaultGraph(){return V.DefaultGraph.INSTANCE}quad(v,y,w,M){return new $.Quad(v,y,w,M||this.defaultGraph())}fromTerm(v){switch(v.termType){case"NamedNode":return this.namedNode(v.value);case"BlankNode":return this.blankNode(v.value);case"Literal":return v.language?this.literal(v.value,v.language):v.datatype.equals(L.Literal.XSD_STRING)?this.literal(v.value):this.literal(v.value,this.fromTerm(v.datatype));case"Variable":return this.variable(v.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(v.subject),this.fromTerm(v.predicate),this.fromTerm(v.object),this.fromTerm(v.graph))}}fromQuad(v){return this.fromTerm(v)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class q{constructor(){this.termType="DefaultGraph",this.value=""}equals(L){return!!L&&"DefaultGraph"===L.termType}}he.DefaultGraph=q,q.INSTANCE=new q},{}],60:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const q=K("./NamedNode");class V{constructor(re,$){this.termType="Literal",this.value=re,"string"==typeof $?(this.language=$,this.datatype=V.RDF_LANGUAGE_STRING):$?(this.language="",this.datatype=$):(this.language="",this.datatype=V.XSD_STRING)}equals(re){return!!re&&"Literal"===re.termType&&re.value===this.value&&re.language===this.language&&re.datatype.equals(this.datatype)}}he.Literal=V,V.RDF_LANGUAGE_STRING=new q.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),V.XSD_STRING=new q.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(L){this.termType="NamedNode",this.value=L}equals(L){return!!L&&"NamedNode"===L.termType&&L.value===this.value}}},{}],62:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(L,re,$,b){this.termType="Quad",this.value="",this.subject=L,this.predicate=re,this.object=$,this.graph=b}equals(L){return!!L&&("Quad"===L.termType||!L.termType)&&this.subject.equals(L.subject)&&this.predicate.equals(L.predicate)&&this.object.equals(L.object)&&this.graph.equals(L.graph)}}},{}],63:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(L){this.termType="Variable",this.value=L}equals(L){return!!L&&"Variable"===L.termType&&L.value===this.value}}},{}],64:[function(K,Ae,he){"use strict";var q=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&q(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(K("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class q extends Error{constructor(L,re){const $=L.saxStream._parser;super(L.trackPosition?`Line ${$.line+1} column ${$.column+1}: ${re}`:re)}}he.ParseError=q},{}],66:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const q=K("relative-to-absolute-iri"),V=K("sax"),L=K("stream"),re=K("./ParseError"),$=K("rdf-data-factory");class b extends L.Transform{constructor(T){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},T&&(Object.assign(this,T),this.options=T),this.dataFactory||(this.dataFactory=new $.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=V.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(T,v){const y={};let w=!1;for(const j in T.attributes)j.startsWith("xmlns")&&(5===j.length?(w=!0,y[""]=T.attributes[j]):":"===j.charAt(5)&&(w=!0,y[j.substr(6)]=T.attributes[j]));const M=v&&v.ns?v.ns:[b.DEFAULT_NS];return w?M.concat([y]):M}static expandPrefixedTerm(T,v,y){const w=T.indexOf(":");let M,j;w>=0?(M=T.substr(0,w),j=T.substr(w+1)):(M="",j=T);let I=null,H=null;for(let Y=v.length-1;Y>=0;Y--){const D=v[Y][M];if(D){I=D;break}H||(H=v[Y][""])}if(!I){if(M&&"xmlns"!==M)throw new re.ParseError(y,`The prefix '${M}' in term '${T}' was not bound.`);I=H||""}return{prefix:M,local:j,uri:I}}static isValidIri(T){return b.IRI_REGEX.test(T)}import(T){const v=new L.PassThrough({readableObjectMode:!0});T.on("error",w=>y.emit("error",w)),T.on("data",w=>v.push(w)),T.on("end",()=>v.push(null));const y=v.pipe(new b(this.options));return y}_transform(T,v,y){try{this.saxStream.write(T,v)}catch(w){return y(w)}y()}newParseError(T){return new re.ParseError(this,T)}valueToUri(T,v){return this.uriToNamedNode(q.resolve(T,v.baseIRI))}uriToNamedNode(T){if(!b.isValidIri(T))throw this.newParseError(`Invalid URI: ${T}`);return this.dataFactory.namedNode(T)}validateNcname(T){if(!b.NCNAME_MATCHER.test(T))throw this.newParseError(`Not a valid NCName: ${T}`)}attachSaxListeners(){this.saxStream.on("error",T=>this.emit("error",T)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(T){const v=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=S.RESOURCE;if(v&&(v.hadChildren=!0,y=v.childrenParseType),v&&v.childrenStringTags){const M=T.name;let j="";for(const D in T.attributes)j+=` ${D}="${T.attributes[D]}"`;v.childrenStringTags.push(`<${M}${j}>`);const Y={childrenStringTags:v.childrenStringTags};return Y.childrenStringEmitClosingTag=``,void this.activeTagStack.push(Y)}const w={};v?(w.language=v.language,w.baseIRI=v.baseIRI):w.baseIRI=this.baseIRI,this.activeTagStack.push(w),w.ns=b.parseNamespace(T,v),y===S.RESOURCE?this.onTagResource(T,w,v,!v):this.onTagProperty(T,w,v)}onTagResource(T,v,y,w){const M=b.expandPrefixedTerm(T.name,v.ns,this);v.childrenParseType=S.PROPERTY;let j=!0;if(M.uri===b.RDF){if(!w&&b.FORBIDDEN_NODE_ELEMENTS.indexOf(M.local)>=0)throw this.newParseError(`Illegal node element name: ${M.local}`);switch(M.local){case"RDF":v.childrenParseType=S.RESOURCE;case"Description":j=!1}}const I=[],H=[];let Y=null,D=!1,F=!1,Q=null;for(const E in T.attributes){const U=T.attributes[E],ie=b.expandPrefixedTerm(E,v.ns,this);if(y&&ie.uri===b.RDF)switch(ie.local){case"about":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);Y=U;continue;case"ID":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);this.validateNcname(U),Y="#"+U,D=!0;continue;case"nodeID":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);this.validateNcname(U),Y=U,F=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":Q=U;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(ie.uri===b.XML){if("lang"===ie.local){v.language=""===U?null:U.toLowerCase();continue}if("base"===ie.local){v.baseIRI=q.resolve(U,v.baseIRI);continue}}"xml"!==ie.prefix&&ie.uri&&(I.push(this.uriToNamedNode(ie.uri+ie.local)),H.push(U))}if(null!==Y&&(v.subject=F?this.dataFactory.blankNode(Y):this.valueToUri(Y,v),D&&this.claimNodeId(v.subject)),v.subject||(v.subject=this.dataFactory.blankNode()),j){const E=this.uriToNamedNode(M.uri+M.local);this.emitTriple(v.subject,this.dataFactory.namedNode(b.RDF+"type"),E,y?y.reifiedStatementId:null)}if(y){if(y.predicate)if(y.childrenCollectionSubject){const E=this.dataFactory.blankNode();this.emitTriple(y.childrenCollectionSubject,y.childrenCollectionPredicate,E,y.reifiedStatementId),this.emitTriple(E,this.dataFactory.namedNode(b.RDF+"first"),v.subject,v.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(b.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,v.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${w.local}`);v.predicateSubPredicates=[],v.predicateSubObjects=[];let M=!1,j=!1,I=null,H=!0;const Y=[],D=[];for(const F in T.attributes){const Q=T.attributes[F],E=b.expandPrefixedTerm(F,v.ns,this);if(E.uri===b.RDF)switch(E.local){case"resource":if(I)throw this.newParseError(`Found both rdf:resource (${Q}) and rdf:nodeID (${I}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${Q})`);v.hadChildren=!0,I=Q,H=!1;continue;case"datatype":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${Q}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${Q})`);v.datatype=this.valueToUri(Q,v);continue;case"nodeID":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${Q}).`);if(v.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${Q}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${Q})`);this.validateNcname(Q),v.hadChildren=!0,I=Q,H=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(j)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(v.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${v.datatype.value})`);if(I)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${I})`);if("Resource"===Q){M=!0,v.childrenParseType=S.PROPERTY;const U=this.dataFactory.blankNode();this.emitTriple(v.subject,v.predicate,U,v.reifiedStatementId),v.subject=U,v.predicate=null}else"Collection"===Q?(M=!0,v.hadChildren=!0,v.childrenCollectionSubject=v.subject,v.childrenCollectionPredicate=v.predicate,H=!1):"Literal"===Q&&(M=!0,v.childrenTagsToString=!0,v.childrenStringTags=[]);continue;case"ID":this.validateNcname(Q),v.reifiedStatementId=this.valueToUri("#"+Q,v),this.claimNodeId(v.reifiedStatementId);continue}else if(E.uri===b.XML&&"lang"===E.local){v.language=""===Q?null:Q.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(M||v.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${Q}`);v.hadChildren=!0,j=!0,Y.push(this.uriToNamedNode(E.uri+E.local)),D.push(this.dataFactory.literal(Q,v.datatype||v.language))}}if(null!==I){const F=v.subject;v.subject=H?this.dataFactory.blankNode(I):this.valueToUri(I,v),this.emitTriple(F,v.predicate,v.subject,v.reifiedStatementId);for(let Q=0;Q/g,(v,y,w)=>(this.saxStream._parser.ENTITIES[y]=w,""))}}var S,O;he.RdfXmlParser=b,b.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,b.MIME_TYPE="application/rdf+xml",b.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",b.XML="http://www.w3.org/XML/1998/namespace",b.XMLNS="http://www.w3.org/2000/xmlns/",b.DEFAULT_NS={xml:b.XML},b.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],b.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],b.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,(O=S=he.ParseType||(he.ParseType={}))[O.RESOURCE=0]="RESOURCE",O[O.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(K,Ae,he){"use strict";var V={};function L(O,T,v){v||(v=Error);var w=function(M){function j(I,H,Y){return M.call(this,function(M,j,I){return"string"==typeof T?T:T(M,j,I)}(I,H,Y))||this}return function(O,T){O.prototype=Object.create(T.prototype),O.prototype.constructor=O,O.__proto__=T}(j,M),j}(v);w.prototype.name=v.name,w.prototype.code=O,V[O]=w}function re(O,T){if(Array.isArray(O)){var v=O.length;return O=O.map(function(y){return String(y)}),v>2?"one of ".concat(T," ").concat(O.slice(0,v-1).join(", "),", or ")+O[v-1]:2===v?"one of ".concat(T," ").concat(O[0]," or ").concat(O[1]):"of ".concat(T," ").concat(O[0])}return"of ".concat(T," ").concat(String(O))}L("ERR_INVALID_OPT_VALUE",function(O,T){return'The value "'+T+'" is invalid for option "'+O+'"'},TypeError),L("ERR_INVALID_ARG_TYPE",function(O,T,v){var y,w;if("string"==typeof T&&function(O,T,v){return O.substr(!v||v<0?0:+v,T.length)===T}(T,"not ")?(y="must not be",T=T.replace(/^not /,"")):y="must be",function(O,T,v){return(void 0===v||v>O.length)&&(v=O.length),O.substring(v-T.length,v)===T}(O," argument"))w="The ".concat(O," ").concat(y," ").concat(re(T,"type"));else{var M=function(O,T,v){return"number"!=typeof v&&(v=0),!(v+T.length>O.length)&&-1!==O.indexOf(T,v)}(O,".")?"property":"argument";w='The "'.concat(O,'" ').concat(M," ").concat(y," ").concat(re(T,"type"))}return w+". Received type ".concat(typeof v)},TypeError),L("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),L("ERR_METHOD_NOT_IMPLEMENTED",function(O){return"The "+O+" method is not implemented"}),L("ERR_STREAM_PREMATURE_CLOSE","Premature close"),L("ERR_STREAM_DESTROYED",function(O){return"Cannot call "+O+" after a stream was destroyed"}),L("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),L("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),L("ERR_STREAM_WRITE_AFTER_END","write after end"),L("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),L("ERR_UNKNOWN_ENCODING",function(O){return"Unknown encoding: "+O},TypeError),L("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.exports.codes=V},{}],68:[function(K,Ae,he){(function(q){(function(){"use strict";var V=Object.keys||function(y){var w=[];for(var M in y)w.push(M);return w};Ae.exports=O;var L=K("./_stream_readable"),re=K("./_stream_writable");K("inherits")(O,L);for(var $=V(re.prototype),b=0;b<$.length;b++){var S=$[b];O.prototype[S]||(O.prototype[S]=re.prototype[S])}function O(y){if(!(this instanceof O))return new O(y);L.call(this,y),re.call(this,y),this.allowHalfOpen=!0,y&&(!1===y.readable&&(this.readable=!1),!1===y.writable&&(this.writable=!1),!1===y.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",T)))}function T(){this._writableState.ended||q.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(w){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=w,this._writableState.destroyed=w)}})}).call(this)}).call(this,K("_process"))},{"./_stream_readable":70,"./_stream_writable":72,_process:44,inherits:10}],69:[function(K,Ae,he){"use strict";Ae.exports=V;var q=K("./_stream_transform");function V(L){if(!(this instanceof V))return new V(L);q.call(this,L)}K("inherits")(V,q),V.prototype._transform=function(L,re,$){$(null,L)}},{"./_stream_transform":71,inherits:10}],70:[function(K,Ae,he){(function(q,V){(function(){"use strict";var L;Ae.exports=te,te.ReadableState=me,K("events");var $=function(B,R){return B.listeners(R).length},b=K("./internal/streams/stream"),S=K("buffer").Buffer,O=V.Uint8Array||function(){};var w,y=K("util");w=y&&y.debuglog?y.debuglog("stream"):function(){};var U,ie,ue,M=K("./internal/streams/buffer_list"),j=K("./internal/streams/destroy"),H=K("./internal/streams/state").getHighWaterMark,Y=K("../errors").codes,D=Y.ERR_INVALID_ARG_TYPE,F=Y.ERR_STREAM_PUSH_AFTER_EOF,Q=Y.ERR_METHOD_NOT_IMPLEMENTED,E=Y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;K("inherits")(te,b);var ee=j.errorOrDestroy,se=["error","close","destroy","pause","resume"];function me(fe,B,R){L=L||K("./_stream_duplex"),"boolean"!=typeof R&&(R=B instanceof L),this.objectMode=!!(fe=fe||{}).objectMode,R&&(this.objectMode=this.objectMode||!!fe.readableObjectMode),this.highWaterMark=H(this,fe,"readableHighWaterMark",R),this.buffer=new M,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==fe.emitClose,this.autoDestroy=!!fe.autoDestroy,this.destroyed=!1,this.defaultEncoding=fe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,fe.encoding&&(U||(U=K("string_decoder/").StringDecoder),this.decoder=new U(fe.encoding),this.encoding=fe.encoding)}function te(fe){if(L=L||K("./_stream_duplex"),!(this instanceof te))return new te(fe);this._readableState=new me(fe,this,this instanceof L),this.readable=!0,fe&&("function"==typeof fe.read&&(this._read=fe.read),"function"==typeof fe.destroy&&(this._destroy=fe.destroy)),b.call(this)}function ye(fe,B,R,k,Oe){w("readableAddChunk",B);var yt,Xe=fe._readableState;if(null===B)Xe.reading=!1,function(fe,B){if(w("onEofChunk"),!B.ended){if(B.decoder){var R=B.decoder.end();R&&R.length&&(B.buffer.push(R),B.length+=B.objectMode?1:R.length)}B.ended=!0,B.sync?je(fe):(B.needReadable=!1,B.emittedReadable||(B.emittedReadable=!0,Le(fe)))}}(fe,Xe);else if(Oe||(yt=function(fe,B){var R;return!function(fe){return S.isBuffer(fe)||fe instanceof O}(B)&&"string"!=typeof B&&void 0!==B&&!fe.objectMode&&(R=new D("chunk",["string","Buffer","Uint8Array"],B)),R}(Xe,B)),yt)ee(fe,yt);else if(Xe.objectMode||B&&B.length>0)if("string"!=typeof B&&!Xe.objectMode&&Object.getPrototypeOf(B)!==S.prototype&&(B=function(fe){return S.from(fe)}(B)),k)Xe.endEmitted?ee(fe,new E):De(fe,Xe,B,!0);else if(Xe.ended)ee(fe,new F);else{if(Xe.destroyed)return!1;Xe.reading=!1,Xe.decoder&&!R?(B=Xe.decoder.write(B),Xe.objectMode||0!==B.length?De(fe,Xe,B,!1):Ee(fe,Xe)):De(fe,Xe,B,!1)}else k||(Xe.reading=!1,Ee(fe,Xe));return!Xe.ended&&(Xe.lengthB.highWaterMark&&(B.highWaterMark=function(fe){return fe>=nt?fe=nt:(fe--,fe|=fe>>>1,fe|=fe>>>2,fe|=fe>>>4,fe|=fe>>>8,fe|=fe>>>16,fe++),fe}(fe)),fe<=B.length?fe:B.ended?B.length:(B.needReadable=!0,0))}function je(fe){var B=fe._readableState;w("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(w("emitReadable",B.flowing),B.emittedReadable=!0,q.nextTick(Le,fe))}function Le(fe){var B=fe._readableState;w("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(fe.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,be(fe)}function Ee(fe,B){B.readingMore||(B.readingMore=!0,q.nextTick(Re,fe,B))}function Re(fe,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:fe.listenerCount("data")>0&&fe.resume()}function Be(fe){w("readable nexttick read 0"),fe.read(0)}function X(fe,B){w("resume",B.reading),B.reading||fe.read(0),B.resumeScheduled=!1,fe.emit("resume"),be(fe),B.flowing&&!B.reading&&fe.read(0)}function be(fe){var B=fe._readableState;for(w("flow",B.flowing);B.flowing&&null!==fe.read(););}function ce(fe,B){return 0===B.length?null:(B.objectMode?R=B.buffer.shift():!fe||fe>=B.length?(R=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):R=B.buffer.consume(fe,B.decoder),R);var R}function Pe(fe){var B=fe._readableState;w("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,q.nextTick(wt,B,fe))}function wt(fe,B){if(w("endReadableNT",fe.endEmitted,fe.length),!fe.endEmitted&&0===fe.length&&(fe.endEmitted=!0,B.readable=!1,B.emit("end"),fe.autoDestroy)){var R=B._writableState;(!R||R.autoDestroy&&R.finished)&&B.destroy()}}function pt(fe,B){for(var R=0,k=fe.length;R=B.highWaterMark:B.length>0)||B.ended))return w("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?Pe(this):je(this),null;if(0===(fe=Je(fe,B))&&B.ended)return 0===B.length&&Pe(this),null;var Oe,k=B.needReadable;return w("need readable",k),(0===B.length||B.length-fe0?ce(fe,B):null)?(B.needReadable=B.length<=B.highWaterMark,fe=0):(B.length-=fe,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),R!==fe&&B.ended&&Pe(this)),null!==Oe&&this.emit("data",Oe),Oe},te.prototype._read=function(fe){ee(this,new Q("_read()"))},te.prototype.pipe=function(fe,B){var R=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=fe;break;case 1:k.pipes=[k.pipes,fe];break;default:k.pipes.push(fe)}k.pipesCount+=1,w("pipe count=%d opts=%j",k.pipesCount,B);var Xe=B&&!1===B.end||fe===q.stdout||fe===q.stderr?cs:It;function yt(Ps,Gr){w("onunpipe"),Ps===R&&Gr&&!1===Gr.hasUnpiped&&(Gr.hasUnpiped=!0,w("cleanup"),fe.removeListener("close",Hr),fe.removeListener("finish",Ns),fe.removeListener("drain",Tn),fe.removeListener("error",hi),fe.removeListener("unpipe",yt),R.removeListener("end",It),R.removeListener("end",cs),R.removeListener("data",yi),Pn=!0,k.awaitDrain&&(!fe._writableState||fe._writableState.needDrain)&&Tn())}function It(){w("onend"),fe.end()}k.endEmitted?q.nextTick(Xe):R.once("end",Xe),fe.on("unpipe",yt);var Tn=function(fe){return function(){var R=fe._readableState;w("pipeOnDrain",R.awaitDrain),R.awaitDrain&&R.awaitDrain--,0===R.awaitDrain&&$(fe,"data")&&(R.flowing=!0,be(fe))}}(R);fe.on("drain",Tn);var Pn=!1;function yi(Ps){w("ondata");var Gr=fe.write(Ps);w("dest.write",Gr),!1===Gr&&((1===k.pipesCount&&k.pipes===fe||k.pipesCount>1&&-1!==pt(k.pipes,fe))&&!Pn&&(w("false write response, pause",k.awaitDrain),k.awaitDrain++),R.pause())}function hi(Ps){w("onerror",Ps),cs(),fe.removeListener("error",hi),0===$(fe,"error")&&ee(fe,Ps)}function Hr(){fe.removeListener("finish",Ns),cs()}function Ns(){w("onfinish"),fe.removeListener("close",Hr),cs()}function cs(){w("unpipe"),R.unpipe(fe)}return R.on("data",yi),function(fe,B,R){if("function"==typeof fe.prependListener)return fe.prependListener(B,R);fe._events&&fe._events[B]?Array.isArray(fe._events[B])?fe._events[B].unshift(R):fe._events[B]=[R,fe._events[B]]:fe.on(B,R)}(fe,"error",hi),fe.once("close",Hr),fe.once("finish",Ns),fe.emit("pipe",R),k.flowing||(w("pipe resume"),R.resume()),fe},te.prototype.unpipe=function(fe){var B=this._readableState,R={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return fe&&fe!==B.pipes||(fe||(fe=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,fe&&fe.emit("unpipe",this,R)),this;if(!fe){var k=B.pipes,Oe=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Xe=0;Xe0,!1!==k.flowing&&this.resume()):"readable"===fe&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,w("on readable",k.length,k.reading),k.length?je(this):k.reading||q.nextTick(Be,this)),R},te.prototype.removeListener=function(fe,B){var R=b.prototype.removeListener.call(this,fe,B);return"readable"===fe&&q.nextTick(qe,this),R},te.prototype.removeAllListeners=function(fe){var B=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===fe||void 0===fe)&&q.nextTick(qe,this),B},te.prototype.resume=function(){var fe=this._readableState;return fe.flowing||(w("resume"),fe.flowing=!fe.readableListening,function(fe,B){B.resumeScheduled||(B.resumeScheduled=!0,q.nextTick(X,fe,B))}(this,fe)),fe.paused=!1,this},te.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},te.prototype.wrap=function(fe){var B=this,R=this._readableState,k=!1;for(var Oe in fe.on("end",function(){if(w("wrapped end"),R.decoder&&!R.ended){var yt=R.decoder.end();yt&&yt.length&&B.push(yt)}B.push(null)}),fe.on("data",function(yt){w("wrapped data"),R.decoder&&(yt=R.decoder.write(yt)),R.objectMode&&null==yt||!(R.objectMode||yt&&yt.length)||B.push(yt)||(k=!0,fe.pause())}),fe)void 0===this[Oe]&&"function"==typeof fe[Oe]&&(this[Oe]=function(It){return function(){return fe[It].apply(fe,arguments)}}(Oe));for(var Xe=0;Xe-1))throw new ie(ce);return this._writableState.defaultEncoding=ce,this},Object.defineProperty(me.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(me.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),me.prototype._write=function(be,ce,Pe){Pe(new Y("_write()"))},me.prototype._writev=null,me.prototype.end=function(be,ce,Pe){var wt=this._writableState;return"function"==typeof be?(Pe=be,be=null,ce=null):"function"==typeof ce&&(Pe=ce,ce=null),null!=be&&this.write(be,ce),wt.corked&&(wt.corked=1,this.uncork()),wt.ending||function(be,ce,Pe){ce.ending=!0,Be(be,ce),Pe&&(ce.finished?q.nextTick(Pe):be.once("finish",Pe)),ce.ended=!0,be.writable=!1}(this,wt,Pe),this},Object.defineProperty(me.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(ce){!this._writableState||(this._writableState.destroyed=ce)}}),me.prototype.destroy=w.destroy,me.prototype._undestroy=w.undestroy,me.prototype._destroy=function(be,ce){ce(be)}}).call(this)}).call(this,K("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(K,Ae,he){(function(q){(function(){"use strict";var V;function L(F,Q,E){return Q in F?Object.defineProperty(F,Q,{value:E,enumerable:!0,configurable:!0,writable:!0}):F[Q]=E,F}var re=K("./end-of-stream"),$=Symbol("lastResolve"),b=Symbol("lastReject"),S=Symbol("error"),O=Symbol("ended"),T=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function w(F,Q){return{value:F,done:Q}}function M(F){var Q=F[$];if(null!==Q){var E=F[y].read();null!==E&&(F[T]=null,F[$]=null,F[b]=null,Q(w(E,!1)))}}function j(F){q.nextTick(M,F)}var H=Object.getPrototypeOf(function(){}),Y=Object.setPrototypeOf((L(V={get stream(){return this[y]},next:function(){var Q=this,E=this[S];if(null!==E)return Promise.reject(E);if(this[O])return Promise.resolve(w(void 0,!0));if(this[y].destroyed)return new Promise(function(ee,se){q.nextTick(function(){Q[S]?se(Q[S]):ee(w(void 0,!0))})});var ie,U=this[T];if(U)ie=new Promise(function(F,Q){return function(E,U){F.then(function(){Q[O]?E(w(void 0,!0)):Q[v](E,U)},U)}}(U,this));else{var ue=this[y].read();if(null!==ue)return Promise.resolve(w(ue,!1));ie=new Promise(this[v])}return this[T]=ie,ie}},Symbol.asyncIterator,function(){return this}),L(V,"return",function(){var Q=this;return new Promise(function(E,U){Q[y].destroy(null,function(ie){ie?U(ie):E(w(void 0,!0))})})}),V),H);Ae.exports=function(Q){var E,U=Object.create(Y,(L(E={},y,{value:Q,writable:!0}),L(E,$,{value:null,writable:!0}),L(E,b,{value:null,writable:!0}),L(E,S,{value:null,writable:!0}),L(E,O,{value:Q._readableState.endEmitted,writable:!0}),L(E,v,{value:function(ue,ee){var se=U[y].read();se?(U[T]=null,U[$]=null,U[b]=null,ue(w(se,!1))):(U[$]=ue,U[b]=ee)},writable:!0}),E));return U[T]=null,re(Q,function(ie){if(ie&&"ERR_STREAM_PREMATURE_CLOSE"!==ie.code){var ue=U[b];return null!==ue&&(U[T]=null,U[$]=null,U[b]=null,ue(ie)),void(U[S]=ie)}var ee=U[$];null!==ee&&(U[T]=null,U[$]=null,U[b]=null,ee(w(void 0,!0))),U[O]=!0}),Q.on("readable",j.bind(null,U)),U}}).call(this)}).call(this,K("_process"))},{"./end-of-stream":76,_process:44}],74:[function(K,Ae,he){"use strict";function q(M,j){var I=Object.keys(M);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(M);j&&(H=H.filter(function(Y){return Object.getOwnPropertyDescriptor(M,Y).enumerable})),I.push.apply(I,H)}return I}function L(M,j,I){return j in M?Object.defineProperty(M,j,{value:I,enumerable:!0,configurable:!0,writable:!0}):M[j]=I,M}function $(M,j){for(var I=0;I0?this.tail.next=H:this.head=H,this.tail=H,++this.length}},{key:"unshift",value:function(I){var H={data:I,next:this.head};0===this.length&&(this.tail=H),this.head=H,++this.length}},{key:"shift",value:function(){if(0!==this.length){var I=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,I}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(I){if(0===this.length)return"";for(var H=this.head,Y=""+H.data;H=H.next;)Y+=I+H.data;return Y}},{key:"concat",value:function(I){if(0===this.length)return O.alloc(0);for(var H=O.allocUnsafe(I>>>0),Y=this.head,D=0;Y;)w(Y.data,H,D),D+=Y.data.length,Y=Y.next;return H}},{key:"consume",value:function(I,H){var Y;return IF.length?F.length:I;if(D+=Q===F.length?F:F.slice(0,I),0==(I-=Q)){Q===F.length?(++Y,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=F.slice(Q));break}++Y}return this.length-=Y,D}},{key:"_getBuffer",value:function(I){var H=O.allocUnsafe(I),Y=this.head,D=1;for(Y.data.copy(H),I-=Y.data.length;Y=Y.next;){var F=Y.data,Q=I>F.length?F.length:I;if(F.copy(H,H.length-I,0,Q),0==(I-=Q)){Q===F.length?(++D,this.head=Y.next?Y.next:this.tail=null):(this.head=Y,Y.data=F.slice(Q));break}++D}return this.length-=D,H}},{key:y,value:function(I,H){return v(this,function(M){for(var j=1;j0,function(ie){Y||(Y=ie),ie&&D.forEach(T),!E&&(D.forEach(T),H(Y))})});return j.reduce(v)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(K,Ae,he){"use strict";var q=K("../../../errors").codes.ERR_INVALID_OPT_VALUE;Ae.exports={getHighWaterMark:function(re,$,b,S){var O=function(re,$,b){return null!=re.highWaterMark?re.highWaterMark:$?re[b]:null}($,S,b);if(null!=O){if(!isFinite(O)||Math.floor(O)!==O||O<0)throw new q(S?b:"highWaterMark",O);return Math.floor(O)}return re.objectMode?16:16384}}},{"../../../errors":67}],80:[function(K,Ae,he){Ae.exports=K("events").EventEmitter},{events:8}],81:[function(K,Ae,he){(he=Ae.exports=K("./lib/_stream_readable.js")).Stream=he,he.Readable=he,he.Writable=K("./lib/_stream_writable.js"),he.Duplex=K("./lib/_stream_duplex.js"),he.Transform=K("./lib/_stream_transform.js"),he.PassThrough=K("./lib/_stream_passthrough.js"),he.finished=K("./lib/internal/streams/end-of-stream.js"),he.pipeline=K("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(V){for(var L in V)he.hasOwnProperty(L)||(he[L]=V[L])}(K("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(K,Ae,he){"use strict";function V($){const b=[];let S=0;for(;S<$.length;)switch($[S]){case"/":if("."===$[S+1])if("."===$[S+2]){if(!re($[S+3])){b.push([]),S++;break}b.pop(),$[S+3]||b.push([]),S+=3}else{if(!re($[S+2])){b.push([]),S++;break}$[S+2]||b.push([]),S+=2}else b.push([]),S++;break;case"#":case"?":b.length||b.push([]),b[b.length-1].push($.substr(S)),S=$.length;break;default:b.length||b.push([]),b[b.length-1].push($[S]),S++}return"/"+b.map(O=>O.join("")).join("/")}function L($,b){let S=b+1;b>=0?"/"===$[b+1]&&"/"===$[b+2]&&(S=b+3):"/"===$[0]&&"/"===$[1]&&(S=2);const O=$.indexOf("/",S);return O<0?$:$.substr(0,O)+V($.substr(O))}function re($){return!$||"#"===$||"?"===$||"/"===$}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function($,b){const S=(b=b||"").indexOf("#");if(S>0&&(b=b.substr(0,S)),!$.length){if(b.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);return b}if($.startsWith("?")){const j=b.indexOf("?");return j>0&&(b=b.substr(0,j)),b+$}if($.startsWith("#"))return b+$;if(!b.length){const j=$.indexOf(":");if(j<0)throw new Error(`Found invalid relative IRI '${$}' for a missing baseIRI`);return L($,j)}const O=$.indexOf(":");if(O>=0)return L($,O);const T=b.indexOf(":");if(T<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);const v=b.substr(0,T+1);if(0===$.indexOf("//"))return v+L($,O);let y;if(b.indexOf("//",T)===T+1){if(y=b.indexOf("/",T+3),y<0)return b.length>T+3?b+"/"+L($,O):v+L($,O)}else if(y=b.indexOf("/",T+1),y<0)return v+L($,O);if(0===$.indexOf("/"))return b.substr(0,y)+V($);let w=b.substr(y);const M=w.lastIndexOf("/");return M>=0&&M"===ce?(te(X,"onsgmldeclaration",X.sgmlDecl),X.sgmlDecl="",X.state=se.TEXT):(U(ce)&&(X.state=se.SGML_DECL_QUOTED),X.sgmlDecl+=ce);continue;case se.SGML_DECL_QUOTED:ce===X.q&&(X.state=se.SGML_DECL,X.q=""),X.sgmlDecl+=ce;continue;case se.DOCTYPE:">"===ce?(X.state=se.TEXT,te(X,"ondoctype",X.doctype),X.doctype=!0):(X.doctype+=ce,"["===ce?X.state=se.DOCTYPE_DTD:U(ce)&&(X.state=se.DOCTYPE_QUOTED,X.q=ce));continue;case se.DOCTYPE_QUOTED:X.doctype+=ce,ce===X.q&&(X.q="",X.state=se.DOCTYPE);continue;case se.DOCTYPE_DTD:X.doctype+=ce,"]"===ce?X.state=se.DOCTYPE:U(ce)&&(X.state=se.DOCTYPE_DTD_QUOTED,X.q=ce);continue;case se.DOCTYPE_DTD_QUOTED:X.doctype+=ce,ce===X.q&&(X.state=se.DOCTYPE_DTD,X.q="");continue;case se.COMMENT:"-"===ce?X.state=se.COMMENT_ENDING:X.comment+=ce;continue;case se.COMMENT_ENDING:"-"===ce?(X.state=se.COMMENT_ENDED,X.comment=De(X.opt,X.comment),X.comment&&te(X,"oncomment",X.comment),X.comment=""):(X.comment+="-"+ce,X.state=se.COMMENT);continue;case se.COMMENT_ENDED:">"!==ce?(Ze(X,"Malformed comment"),X.comment+="--"+ce,X.state=se.COMMENT):X.state=se.TEXT;continue;case se.CDATA:"]"===ce?X.state=se.CDATA_ENDING:X.cdata+=ce;continue;case se.CDATA_ENDING:"]"===ce?X.state=se.CDATA_ENDING_2:(X.cdata+="]"+ce,X.state=se.CDATA);continue;case se.CDATA_ENDING_2:">"===ce?(X.cdata&&te(X,"oncdata",X.cdata),te(X,"onclosecdata"),X.cdata="",X.state=se.TEXT):"]"===ce?X.cdata+="]":(X.cdata+="]]"+ce,X.state=se.CDATA);continue;case se.PROC_INST:"?"===ce?X.state=se.PROC_INST_ENDING:E(ce)?X.state=se.PROC_INST_BODY:X.procInstName+=ce;continue;case se.PROC_INST_BODY:if(!X.procInstBody&&E(ce))continue;"?"===ce?X.state=se.PROC_INST_ENDING:X.procInstBody+=ce;continue;case se.PROC_INST_ENDING:">"===ce?(te(X,"onprocessinginstruction",{name:X.procInstName,body:X.procInstBody}),X.procInstName=X.procInstBody="",X.state=se.TEXT):(X.procInstBody+="?"+ce,X.state=se.PROC_INST_BODY);continue;case se.OPEN_TAG:ue(D,ce)?X.tagName+=ce:(Je(X),">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:(E(ce)||Ze(X,"Invalid character in tag name"),X.state=se.ATTRIB));continue;case se.OPEN_TAG_SLASH:">"===ce?(Le(X,!0),Ee(X)):(Ze(X,"Forward-slash in opening tag not followed by >"),X.state=se.ATTRIB);continue;case se.ATTRIB:if(E(ce))continue;">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(Y,ce)?(X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME:"="===ce?X.state=se.ATTRIB_VALUE:">"===ce?(Ze(X,"Attribute without value"),X.attribValue=X.attribName,je(X),Le(X)):E(ce)?X.state=se.ATTRIB_NAME_SAW_WHITE:ue(D,ce)?X.attribName+=ce:Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME_SAW_WHITE:if("="===ce)X.state=se.ATTRIB_VALUE;else{if(E(ce))continue;Ze(X,"Attribute without value"),X.tag.attributes[X.attribName]="",X.attribValue="",te(X,"onattribute",{name:X.attribName,value:""}),X.attribName="",">"===ce?Le(X):ue(Y,ce)?(X.attribName=ce,X.state=se.ATTRIB_NAME):(Ze(X,"Invalid attribute name"),X.state=se.ATTRIB)}continue;case se.ATTRIB_VALUE:if(E(ce))continue;U(ce)?(X.q=ce,X.state=se.ATTRIB_VALUE_QUOTED):(Ze(X,"Unquoted attribute value"),X.state=se.ATTRIB_VALUE_UNQUOTED,X.attribValue=ce);continue;case se.ATTRIB_VALUE_QUOTED:if(ce!==X.q){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_Q:X.attribValue+=ce;continue}je(X),X.q="",X.state=se.ATTRIB_VALUE_CLOSED;continue;case se.ATTRIB_VALUE_CLOSED:E(ce)?X.state=se.ATTRIB:">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(Y,ce)?(Ze(X,"No whitespace between attributes"),X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_VALUE_UNQUOTED:if(!ie(ce)){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_U:X.attribValue+=ce;continue}je(X),">"===ce?Le(X):X.state=se.ATTRIB;continue;case se.CLOSE_TAG:if(X.tagName)">"===ce?Ee(X):ue(D,ce)?X.tagName+=ce:X.script?(X.script+=""===ce?Ee(X):Ze(X,"Invalid characters in closing tag");continue;case se.TEXT_ENTITY:case se.ATTRIB_VALUE_ENTITY_Q:case se.ATTRIB_VALUE_ENTITY_U:var pt,fe;switch(X.state){case se.TEXT_ENTITY:pt=se.TEXT,fe="textNode";break;case se.ATTRIB_VALUE_ENTITY_Q:pt=se.ATTRIB_VALUE_QUOTED,fe="attribValue";break;case se.ATTRIB_VALUE_ENTITY_U:pt=se.ATTRIB_VALUE_UNQUOTED,fe="attribValue"}";"===ce?(X[fe]+=Re(X),X.entity="",X.state=pt):ue(X.entity.length?Q:F,ce)?X.entity+=ce:(Ze(X,"Invalid character in entity name"),X[fe]+="&"+X.entity+ce,X.entity="",X.state=pt);continue;default:throw new Error(X,"Unknown state: "+X.state)}return X.position>=X.bufferCheckPosition&&function(z){for(var X=Math.max(V.MAX_BUFFER_LENGTH,10),be=0,ce=0,Pe=L.length;ceX)switch(L[ce]){case"textNode":ye(z);break;case"cdata":te(z,"oncdata",z.cdata),z.cdata="";break;case"script":te(z,"onscript",z.script),z.script="";break;default:Ve(z,"Max buffer length exceeded: "+L[ce])}be=Math.max(be,wt)}z.bufferCheckPosition=V.MAX_BUFFER_LENGTH-be+z.position}(X),X},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(z){ye(z),""!==z.cdata&&(te(z,"oncdata",z.cdata),z.cdata=""),""!==z.script&&(te(z,"onscript",z.script),z.script="")}(this)}};try{O=K("stream").Stream}catch(z){O=function(){}}var T=V.EVENTS.filter(function(z){return"error"!==z&&"end"!==z});function y(z,X){if(!(this instanceof y))return new y(z,X);O.apply(this),this._parser=new re(z,X),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ce){be.emit("error",ce),be._parser.error=null},this._decoder=null,T.forEach(function(ce){Object.defineProperty(be,"on"+ce,{get:function(){return be._parser["on"+ce]},set:function(Pe){if(!Pe)return be.removeAllListeners(ce),be._parser["on"+ce]=Pe,Pe;be.on(ce,Pe)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(O.prototype,{constructor:{value:y}})).write=function(z){if("function"==typeof q&&"function"==typeof q.isBuffer&&q.isBuffer(z)){if(!this._decoder){var X=K("string_decoder").StringDecoder;this._decoder=new X("utf8")}z=this._decoder.write(z)}return this._parser.write(z.toString()),this.emit("data",z),!0},y.prototype.end=function(z){return z&&z.length&&this.write(z),this._parser.end(),!0},y.prototype.on=function(z,X){var be=this;return!be._parser["on"+z]&&-1!==T.indexOf(z)&&(be._parser["on"+z]=function(){var ce=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ce.splice(0,0,z),be.emit.apply(be,ce)}),O.prototype.on.call(be,z,X)};var j="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",H={xml:j,xmlns:I},Y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(z){return" "===z||"\n"===z||"\r"===z||"\t"===z}function U(z){return'"'===z||"'"===z}function ie(z){return">"===z||E(z)}function ue(z,X){return z.test(X)}function ee(z,X){return!ue(z,X)}var z,X,be,se=0;for(var Te in V.STATE={BEGIN:se++,BEGIN_WHITESPACE:se++,TEXT:se++,TEXT_ENTITY:se++,OPEN_WAKA:se++,SGML_DECL:se++,SGML_DECL_QUOTED:se++,DOCTYPE:se++,DOCTYPE_QUOTED:se++,DOCTYPE_DTD:se++,DOCTYPE_DTD_QUOTED:se++,COMMENT_STARTING:se++,COMMENT:se++,COMMENT_ENDING:se++,COMMENT_ENDED:se++,CDATA:se++,CDATA_ENDING:se++,CDATA_ENDING_2:se++,PROC_INST:se++,PROC_INST_BODY:se++,PROC_INST_ENDING:se++,OPEN_TAG:se++,OPEN_TAG_SLASH:se++,ATTRIB:se++,ATTRIB_NAME:se++,ATTRIB_NAME_SAW_WHITE:se++,ATTRIB_VALUE:se++,ATTRIB_VALUE_QUOTED:se++,ATTRIB_VALUE_CLOSED:se++,ATTRIB_VALUE_UNQUOTED:se++,ATTRIB_VALUE_ENTITY_Q:se++,ATTRIB_VALUE_ENTITY_U:se++,CLOSE_TAG:se++,CLOSE_TAG_SAW_WHITE:se++,SCRIPT:se++,SCRIPT_ENDING:se++},V.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(V.ENTITIES).forEach(function(z){var X=V.ENTITIES[z],be="number"==typeof X?String.fromCharCode(X):X;V.ENTITIES[z]=be}),V.STATE)V.STATE[V.STATE[Te]]=Te;function me(z,X,be){z[X]&&z[X](be)}function te(z,X,be){z.textNode&&ye(z),me(z,X,be)}function ye(z){z.textNode=De(z.opt,z.textNode),z.textNode&&me(z,"ontext",z.textNode),z.textNode=""}function De(z,X){return z.trim&&(X=X.trim()),z.normalize&&(X=X.replace(/\s+/g," ")),X}function Ve(z,X){return ye(z),z.trackPosition&&(X+="\nLine: "+z.line+"\nColumn: "+z.column+"\nChar: "+z.c),X=new Error(X),z.error=X,me(z,"onerror",X),z}function nt(z){return z.sawRoot&&!z.closedRoot&&Ze(z,"Unclosed root tag"),z.state!==se.BEGIN&&z.state!==se.BEGIN_WHITESPACE&&z.state!==se.TEXT&&Ve(z,"Unexpected end"),ye(z),z.c="",z.closed=!0,me(z,"onend"),re.call(z,z.strict,z.opt),z}function Ze(z,X){if("object"!=typeof z||!(z instanceof re))throw new Error("bad call to strictFail");z.strict&&Ve(z,X)}function Je(z){z.strict||(z.tagName=z.tagName[z.looseCase]());var X=z.tags[z.tags.length-1]||z,be=z.tag={name:z.tagName,attributes:{}};z.opt.xmlns&&(be.ns=X.ns),z.attribList.length=0,te(z,"onopentagstart",be)}function Ye(z,X){var ce=z.indexOf(":")<0?["",z]:z.split(":"),Pe=ce[0],wt=ce[1];return X&&"xmlns"===z&&(Pe="xmlns",wt=""),{prefix:Pe,local:wt}}function je(z){if(z.strict||(z.attribName=z.attribName[z.looseCase]()),-1!==z.attribList.indexOf(z.attribName)||z.tag.attributes.hasOwnProperty(z.attribName))z.attribName=z.attribValue="";else{if(z.opt.xmlns){var X=Ye(z.attribName,!0),ce=X.local;if("xmlns"===X.prefix)if("xml"===ce&&z.attribValue!==j)Ze(z,"xml: prefix must be bound to "+j+"\nActual: "+z.attribValue);else if("xmlns"===ce&&z.attribValue!==I)Ze(z,"xmlns: prefix must be bound to "+I+"\nActual: "+z.attribValue);else{var Pe=z.tag,wt=z.tags[z.tags.length-1]||z;Pe.ns===wt.ns&&(Pe.ns=Object.create(wt.ns)),Pe.ns[ce]=z.attribValue}z.attribList.push([z.attribName,z.attribValue])}else z.tag.attributes[z.attribName]=z.attribValue,te(z,"onattribute",{name:z.attribName,value:z.attribValue});z.attribName=z.attribValue=""}}function Le(z,X){if(z.opt.xmlns){var be=z.tag,ce=Ye(z.tagName);be.prefix=ce.prefix,be.local=ce.local,be.uri=be.ns[ce.prefix]||"",be.prefix&&!be.uri&&(Ze(z,"Unbound namespace prefix: "+JSON.stringify(z.tagName)),be.uri=ce.prefix),be.ns&&(z.tags[z.tags.length-1]||z).ns!==be.ns&&Object.keys(be.ns).forEach(function(Tn){te(z,"onopennamespace",{prefix:Tn,uri:be.ns[Tn]})});for(var wt=0,pt=z.attribList.length;wt",z.tagName="",void(z.state=se.SCRIPT);te(z,"onscript",z.script),z.script=""}var X=z.tags.length,be=z.tagName;z.strict||(be=be[z.looseCase]());for(var ce=be;X--&&z.tags[X].name!==ce;)Ze(z,"Unexpected close tag");if(X<0)return Ze(z,"Unmatched closing tag: "+z.tagName),z.textNode+="",void(z.state=se.TEXT);z.tagName=be;for(var wt=z.tags.length;wt-- >X;){var pt=z.tag=z.tags.pop();z.tagName=z.tag.name,te(z,"onclosetag",z.tagName);var fe={};for(var B in pt.ns)fe[B]=pt.ns[B];z.opt.xmlns&&pt.ns!==(z.tags[z.tags.length-1]||z).ns&&Object.keys(pt.ns).forEach(function(k){te(z,"onclosenamespace",{prefix:k,uri:pt.ns[k]})})}0===X&&(z.closedRoot=!0),z.tagName=z.attribValue=z.attribName="",z.attribList.length=0,z.state=se.TEXT}function Re(z){var ce,X=z.entity,be=X.toLowerCase(),Pe="";return z.ENTITIES[X]?z.ENTITIES[X]:z.ENTITIES[be]?z.ENTITIES[be]:("#"===(X=be).charAt(0)&&("x"===X.charAt(1)?(X=X.slice(2),Pe=(ce=parseInt(X,16)).toString(16)):(X=X.slice(1),Pe=(ce=parseInt(X,10)).toString(10))),X=X.replace(/^0+/,""),isNaN(ce)||Pe.toLowerCase()!==X?(Ze(z,"Invalid character entity"),"&"+z.entity+";"):String.fromCodePoint(ce))}function Ue(z,X){"<"===X?(z.state=se.OPEN_WAKA,z.startTagPosition=z.position):E(X)||(Ze(z,"Non-whitespace before first tag."),z.textNode=X,z.state=se.TEXT)}function qe(z,X){var be="";return X1114111||X(k)!==k)throw RangeError("Invalid code point: "+k);k<=65535?Pe.push(k):Pe.push(55296+((k-=65536)>>10),k%1024+56320),(fe+1===B||Pe.length>ce)&&(R+=z.apply(null,Pe),Pe.length=0)}return R},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,K("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(K,Ae,he){(function(q,V){(function(){!function(L,re){"use strict";if(!L.setImmediate){var T,$=1,b={},S=!1,O=L.document,Q=Object.getPrototypeOf&&Object.getPrototypeOf(L);Q=Q&&Q.setTimeout?Q:L,"[object process]"==={}.toString.call(L.process)?T=function(E){q.nextTick(function(){M(E)})}:function(){if(L.postMessage&&!L.importScripts){var E=!0,U=L.onmessage;return L.onmessage=function(){E=!1},L.postMessage("","*"),L.onmessage=U,E}}()?(E="setImmediate$"+Math.random()+"$",U=function(ie){ie.source===L&&"string"==typeof ie.data&&0===ie.data.indexOf(E)&&M(+ie.data.slice(E.length))},L.addEventListener?L.addEventListener("message",U,!1):L.attachEvent("onmessage",U),T=function(ie){L.postMessage(E+ie,"*")}):L.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function(U){M(U.data)},T=function(U){E.port2.postMessage(U)}}():O&&"onreadystatechange"in O.createElement("script")?function(){var E=O.documentElement;T=function(U){var ie=O.createElement("script");ie.onreadystatechange=function(){M(U),ie.onreadystatechange=null,E.removeChild(ie),ie=null},E.appendChild(ie)}}():T=function(E){setTimeout(M,0,E)},Q.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var U=new Array(arguments.length-1),ie=0;ie=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},v))},he.setImmediate="function"==typeof q?q:function(T){var v=S++,y=!(arguments.length<2)&&$.call(arguments,1);return b[v]=!0,L(function(){b[v]&&(y?T.apply(null,y):T.call(null),he.clearImmediate(v))}),v},he.clearImmediate="function"==typeof V?V:function(T){delete b[T]}}).call(this)}).call(this,K("timers").setImmediate,K("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(K,Ae,he){(function(q){(function(){function L(re){try{if(!q.localStorage)return!1}catch(b){return!1}var $=q.localStorage[re];return null!=$&&"true"===String($).toLowerCase()}Ae.exports=function(re,$){if(L("noDeprecation"))return re;var b=!1;return function(){if(!b){if(L("throwDeprecation"))throw new Error($);L("traceDeprecation")?console.trace($):console.warn($),b=!0}return re.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(K,Ae,he){"use strict";Ae.exports=function(q){q.prototype[Symbol.iterator]=function*(){for(let V=this.head;V;V=V.next)yield V.value}}},{}],92:[function(K,Ae,he){"use strict";function q(b){var S=this;if(S instanceof q||(S=new q),S.tail=null,S.head=null,S.length=0,b&&"function"==typeof b.forEach)b.forEach(function(v){S.push(v)});else if(arguments.length>0)for(var O=0,T=arguments.length;O1)O=S;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");T=this.head.next,O=this.head.value}for(var v=0;null!==T;v++)O=b(O,T.value,v),T=T.next;return O},q.prototype.reduceReverse=function(b,S){var O,T=this.tail;if(arguments.length>1)O=S;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");T=this.tail.prev,O=this.tail.value}for(var v=this.length-1;null!==T;v--)O=b(O,T.value,v),T=T.prev;return O},q.prototype.toArray=function(){for(var b=new Array(this.length),S=0,O=this.head;null!==O;S++)b[S]=O.value,O=O.next;return b},q.prototype.toArrayReverse=function(){for(var b=new Array(this.length),S=0,O=this.tail;null!==O;S++)b[S]=O.value,O=O.prev;return b},q.prototype.slice=function(b,S){(S=S||this.length)<0&&(S+=this.length),(b=b||0)<0&&(b+=this.length);var O=new q;if(Sthis.length&&(S=this.length);for(var T=0,v=this.head;null!==v&&Tthis.length&&(S=this.length);for(var T=this.length,v=this.tail;null!==v&&T>S;T--)v=v.prev;for(;null!==v&&T>b;T--,v=v.prev)O.push(v.value);return O},q.prototype.splice=function(b,S,...O){b>this.length&&(b=this.length-1),b<0&&(b=this.length+b);for(var T=0,v=this.head;null!==v&&T{kt.exports=function(tt,gt){var J=gt.length;if(0!==J){var At=tt.length;tt.length+=J;for(var dt=0;dt{"use strict";var gt=(()=>{return(At=gt||(gt={})).typeOfFunction="function",At.boolTrue=!0,gt;var At})();function J(At,dt,K){if(!K||typeof K.value!==gt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:gt.boolTrue,get:function(){var Ae=K.value.bind(this);return Object.defineProperty(this,dt,{value:Ae,configurable:gt.boolTrue,writable:gt.boolTrue}),Ae}}}it.ak=J,it.ZP=J},266:(kt,it,tt)=>{kt.exports={ResizeSensor:tt(835),ElementQueries:tt(845)}},845:function(kt,it,tt){"use strict";var gt,J,At;"undefined"!=typeof window&&window,J=[tt(835)],void 0!==(At="function"==typeof(gt=function(dt){var K=function(){var he,q={},V=[];function L(D){D||(D=document.documentElement);var F=window.getComputedStyle(D,null).fontSize;return parseFloat(F)||16}function $(D,F){var Q=F.split(/\d/),E=Q[Q.length-1];switch(F=parseFloat(F),E){case"px":return F;case"em":return F*L(D);case"rem":return F*L();case"vw":return F*document.documentElement.clientWidth/100;case"vh":return F*document.documentElement.clientHeight/100;case"vmin":case"vmax":var U=document.documentElement.clientWidth/100,ie=document.documentElement.clientHeight/100;return F*(0,Math["vmin"===E?"min":"max"])(U,ie);default:return F}}function b(D,F){this.element=D;var Q,E,U,ie,ue,ee,se,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(Q in U=function(D){if(!D.getBoundingClientRect)return{width:D.offsetWidth,height:D.offsetHeight};var F=D.getBoundingClientRect();return{width:Math.round(F.width),height:Math.round(F.height)}}(this.element),ee={},q[F])!q[F].hasOwnProperty(Q)||(ie=$(this.element,(E=q[F][Q]).value),ue="width"===E.property?U.width:U.height,se="","min"===E.mode&&ue>=ie&&(se+=E.value),"max"===E.mode&&ue<=ie&&(se+=E.value),ee[Te=E.mode+"-"+E.property]||(ee[Te]=""),se&&-1===(" "+ee[Te]+" ").indexOf(" "+se+" ")&&(ee[Te]+=" "+se));for(var te in me)!me.hasOwnProperty(te)||(ee[me[te]]?this.element.setAttribute(me[te],ee[me[te]].substr(1)):this.element.removeAttribute(me[te]))}}function S(D,F){D.elementQueriesSetupInformation||(D.elementQueriesSetupInformation=new b(D,F)),D.elementQueriesSensor||(D.elementQueriesSensor=new dt(D,function(){D.elementQueriesSetupInformation.call()}))}function O(D,F,Q,E){if(void 0===q[D]){q[D]=[];var U=V.length;he.innerHTML+="\n"+D+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+D+" > .resize-sensor {min-width: "+U+"px;}",V.push(D)}q[D].push({mode:F,property:Q,value:E})}function T(D){var F;if(document.querySelectorAll&&(F=D?D.querySelectorAll.bind(D):document.querySelectorAll.bind(document)),!F&&"undefined"!=typeof $$&&(F=$$),!F&&"undefined"!=typeof jQuery&&(F=jQuery),!F)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return F}function y(D){var F=[],Q=[],E=[],U=0,ie=-1,ue=[];for(var ee in D.children)if(D.children.hasOwnProperty(ee)&&D.children[ee].tagName&&"img"===D.children[ee].tagName.toLowerCase()){F.push(D.children[ee]);var se=D.children[ee].getAttribute("min-width")||D.children[ee].getAttribute("data-min-width"),Te=D.children[ee].getAttribute("data-src")||D.children[ee].getAttribute("url");E.push(Te),Q.push({minWidth:se}),se?D.children[ee].style.display="none":(U=F.length-1,D.children[ee].style.display="block")}function te(){var De,ye=!1;for(De in F)!F.hasOwnProperty(De)||Q[De].minWidth&&D.offsetWidth>Q[De].minWidth&&(ye=De);if(ye||(ye=U),ie!==ye)if(ue[ye])F[ie].style.display="none",F[ye].style.display="block",ie=ye;else{var Ve=new Image;Ve.onload=function(){F[ye].src=E[ye],F[ie].style.display="none",F[ye].style.display="block",ue[ye]=!0,ie=ye},Ve.src=E[ye]}else F[ye].src=E[ye]}ie=U,D.resizeSensorInstance=new dt(D,te),te()}var M=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,j=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function I(D){var F,Q,E,U;for(D=D.replace(/'/g,'"');null!==(F=M.exec(D));)for(Q=F[1]+F[3],E=F[2];null!==(U=j.exec(E));)O(Q,U[1],U[2],U[3])}function H(D){var F="";if(D)if("string"==typeof D)(-1!==(D=D.toLowerCase()).indexOf("min-width")||-1!==D.indexOf("max-width"))&&I(D);else for(var Q=0,E=D.length;Q img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",he.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(he),Y=!0);for(var F=0,Q=document.styleSheets.length;F{var gt=tt(910),J=tt(369),At=tt(322);function dt(re,$,b){if(!gt(re))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!re.hasNode($))throw new Error('graphology-shortest-path: the "'+$+'" source node does not exist in the given graph.');if(!re.hasNode(b))throw new Error('graphology-shortest-path: the "'+b+'" target node does not exist in the given graph.');if(($=""+$)==(b=""+b))return[$];var S=re.inboundNeighbors.bind(re),O=re.outboundNeighbors.bind(re),T={},v={};T[$]=null,v[b]=null;var M,j,I,H,Y,D,F,Q,y=[$],w=[b],E=!1;e:for(;y.length&&w.length;)if(y.length<=w.length){for(M=y,y=[],Y=0,F=M.length;Y{kt.exports=function(tt){return null!==tt&&"object"==typeof tt&&"function"==typeof tt.addUndirectedEdgeWithKey&&"function"==typeof tt.dropNode&&"boolean"==typeof tt.multi}},698:function(kt){kt.exports=function(){"use strict";function it(ne){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(de){return typeof de}:function(de){return de&&"function"==typeof Symbol&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de})(ne)}function tt(ne,de){ne.prototype=Object.create(de.prototype),ne.prototype.constructor=ne,J(ne,de)}function gt(ne){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)})(ne)}function J(ne,de){return(J=Object.setPrototypeOf||function(oe,C){return oe.__proto__=C,oe})(ne,de)}function At(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(ne){return!1}}function dt(ne,de,oe){return(dt=At()?Reflect.construct:function(C,P,Z){var we=[null];we.push.apply(we,P);var Fe=new(Function.bind.apply(C,we));return Z&&J(Fe,Z.prototype),Fe}).apply(null,arguments)}function K(ne){var de="function"==typeof Map?new Map:void 0;return(K=function(oe){if(null===oe||-1===Function.toString.call(oe).indexOf("[native code]"))return oe;if("function"!=typeof oe)throw new TypeError("Super expression must either be null or a function");if(void 0!==de){if(de.has(oe))return de.get(oe);de.set(oe,P)}function P(){return dt(oe,arguments,gt(this).constructor)}return P.prototype=Object.create(oe.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),J(P,oe)})(ne)}function Ae(ne){if(void 0===ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ne}var he=function(){for(var ne=arguments[0],de=1,oe=arguments.length;de0&&we.length>P&&!we.warned){we.warned=!0;var et=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(de)+" listeners added. Use emitter.setMaxListeners() to increase limit");et.name="MaxListenersExceededWarning",et.emitter=ne,et.type=de,et.count=we.length,console&&console.warn&&console.warn(et)}return ne}function D(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F(ne,de,oe){var C={fired:!1,wrapFn:void 0,target:ne,type:de,listener:oe},P=D.bind(C);return P.listener=oe,C.wrapFn=P,P}function Q(ne,de,oe){var C=ne._events;if(void 0===C)return[];var P=C[de];return void 0===P?[]:"function"==typeof P?oe?[P.listener||P]:[P]:oe?function(Z){for(var we=new Array(Z.length),Fe=0;Fe0&&(Z=de[0]),Z instanceof Error)throw Z;var we=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw we.context=Z,we}var Fe=P[ne];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,de);else{var et=Fe.length,Dt=U(Fe,et);for(oe=0;oe=0;Z--)if(oe[Z]===de||oe[Z].listener===de){we=oe[Z].listener,P=Z;break}if(P<0)return this;0===P?oe.shift():function(Fe,et){for(;et+1=0;C--)this.removeListener(ne,de[C]);return this},M.prototype.listeners=function(ne){return Q(this,ne,!0)},M.prototype.rawListeners=function(ne){return Q(this,ne,!1)},M.listenerCount=function(ne,de){return"function"==typeof ne.listenerCount?ne.listenerCount(de):E.call(ne,de)},M.prototype.listenerCount=E,M.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]},ue.prototype.next=function(){if(this.done)return{done:!0};var ne=this._next();return ne.done&&(this.done=!0),ne},"undefined"!=typeof Symbol&&(ue.prototype[Symbol.iterator]=function(){return this}),ue.of=function(){var ne=arguments,de=ne.length,oe=0;return new ue(function(){return oe>=de?{done:!0}:{done:!1,value:ne[oe++]}})},ue.empty=function(){var ne=new ue(null);return ne.done=!0,ne},ue.is=function(ne){return ne instanceof ue||"object"==typeof ne&&null!==ne&&"function"==typeof ne.next};var ee=ue,se=function(ne,de){for(var oe,C=arguments.length>1?de:1/0,P=C!==1/0?new Array(C):[],Z=0;;){if(Z===C)return P;if((oe=ne.next()).done)return Z!==de?P.slice(0,Z):P;P[Z++]=oe.value}},Te=function(ne){function de(oe,C){var P;return(P=ne.call(this)||this).name="GraphError",P.message=oe||"",P.data=C||{},P}return tt(de,ne),de}(K(Error)),me=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),te=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),ye=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te);function De(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ve(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function nt(ne,de){this.key=ne,this.attributes=de,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Ze(ne,de,oe,C,P,Z){this.key=de,this.attributes=Z,this.undirected=ne,this.source=C,this.target=P,this.generatedKey=oe}function Je(ne,de,oe,C,P,Z,we){var Fe,et,Dt="out",We="in";if(de&&(Dt=We="undirected"),ne.multi){if(void 0===(et=(Fe=Z[Dt])[P])&&(et=new Set,Fe[P]=et),et.add(oe),C===P&&de)return;void 0===(Fe=we[We])[C]&&(Fe[C]=et)}else{if(Z[Dt][P]=oe,C===P&&de)return;we[We][C]=oe}}function Ye(ne,de,oe){var C=ne.multi,P=oe.source,Z=oe.target,we=P.key,Fe=Z.key,et=P[de?"undirected":"out"],Dt=de?"undirected":"in";if(Fe in et)if(C){var We=et[Fe];1===We.size?(delete et[Fe],delete Z[Dt][we]):We.delete(oe)}else delete et[Fe];C||delete Z[Dt][we]}Ve.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},nt.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var je=[{name:function(ne){return"get".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes[P]}}},{name:function(ne){return"get".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C){var P;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Z=""+C,we=""+arguments[1];if(!(P=q(this,Z,we,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Z,'" - "').concat(we,'").'))}else if(!(P=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&P.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return P.attributes}}},{name:function(ne){return"has".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes.hasOwnProperty(P)}}},{name:function(ne){return"set".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=q(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"update".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=q(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("function"!=typeof Z)throw new me("Graph.".concat(de,": updater should be a function."));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z(we.attributes[P]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"remove".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return delete Z.attributes[P],this.emit("edgeAttributesUpdated",{key:Z.key,type:"remove",attributes:Z.attributes,name:P}),this}}},{name:function(ne){return"replace".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes=P,this.emit("edgeAttributesUpdated",{key:Z.key,type:"replace",attributes:Z.attributes}),this}}},{name:function(ne){return"merge".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return he(Z.attributes,P),this.emit("edgeAttributesUpdated",{key:Z.key,type:"merge",attributes:Z.attributes,data:P}),this}}}],Le=ee,Ee=function(){var ne,de=arguments,oe=-1;return new Le(function C(){if(!ne){if(++oe>=de.length)return{done:!0};ne=de[oe]}var P=ne.next();return P.done?(ne=null,C()):P})},Re=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Ue(ne,de){for(var oe in de)ne.push(de[oe].key)}function qe(ne,de){for(var oe in de)de[oe].forEach(function(C){return ne.push(C.key)})}function Be(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)}}function z(ne,de,oe){for(var C in ne)C!==oe&&ne[C].forEach(function(P){return de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function X(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];if(de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey))return!0}return!1}function be(ne,de,oe){var C,P,Z,we,Fe;for(var et in ne)if(et!==oe)for(C=ne[et].values();!0!==(P=C.next()).done;)if(we=(Z=P.value).source,de(Z.key,Z.attributes,we.key,(Fe=Z.target).key,we.attributes,Fe.attributes,Z.undirected,Z.generatedKey))return!0;return!1}function ce(ne,de){var oe=Object.keys(ne),C=oe.length,P=null,Z=0;return new ee(function we(){var Fe;if(P){var et=P.next();if(et.done)return P=null,Z++,we();Fe=et.value}else{if(Z>=C)return{done:!0};var Dt=oe[Z];if(Dt===de)return Z++,we();if((Fe=ne[Dt])instanceof Set)return P=Fe.values(),we();Z++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function Pe(ne,de,oe){var C=de[oe];C&&ne.push(C.key)}function wt(ne,de,oe){var C=de[oe];C&&C.forEach(function(P){return ne.push(P.key)})}function pt(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function fe(ne,de,oe){var C=ne[de];C&&C.forEach(function(P){return oe(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function B(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;return oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function R(ne,de,oe){var C=ne[de];if(C){for(var P,Z,we=C.values();!0!==(P=we.next()).done;)if(oe((Z=P.value).key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes,Z.undirected,Z.generatedKey))return!0;return!1}}function k(ne,de){var oe=ne[de];if(oe instanceof Set){var C=oe.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{done:!1,value:[Z.key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes]}})}return ee.of([oe.key,oe.attributes,oe.source.key,oe.target.key,oe.source.attributes,oe.target.attributes])}function Oe(ne,de){if(0===ne.size)return[];if("mixed"===de||de===ne.type)return"function"==typeof Array.from?Array.from(ne._edges.keys()):se(ne._edges.keys(),ne._edges.size);for(var oe,C,Z=new Array("undirected"===de?ne.undirectedSize:ne.directedSize),we="undirected"===de,Fe=ne._edges.values(),et=0;!0!==(oe=Fe.next()).done;)(C=oe.value).undirected===we&&(Z[et++]=C.key);return Z}function Xe(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var zt=P.source,Et=P.target;oe(P.key,P.attributes,zt.key,Et.key,zt.attributes,Et.attributes,P.undirected,P.generatedKey)}}function yt(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var zt=P.source,Et=P.target;if(oe(P.key,P.attributes,zt.key,Et.key,zt.attributes,Et.attributes,P.undirected,P.generatedKey))break}}function It(ne,de){if(0===ne.size)return ee.empty();var oe="mixed"!==de&&de!==ne.type,C="undirected"===de,P=ne._edges.values();return new ee(function(){for(var Z,we;;){if((Z=P.next()).done)return Z;if(we=Z.value,!oe||we.undirected===C)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function Tn(ne,de,oe,C){var P=[],Z=ne?qe:Ue;return"undirected"!==de&&("out"!==oe&&Z(P,C.in),"in"!==oe&&Z(P,C.out),!oe&&C.directedSelfLoops>0&&P.splice(P.lastIndexOf(C.key),1)),"directed"!==de&&Z(P,C.undirected),P}function Pn(ne,de,oe,C,P){var Z=ne?z:Be;"undirected"!==de&&("out"!==oe&&Z(C.in,P),"in"!==oe&&Z(C.out,P,oe?null:C.key)),"directed"!==de&&Z(C.undirected,P)}function Gn(ne,de,oe,C,P){var Z=ne?be:X;"undirected"!==de&&("out"!==oe&&Z(C.in,P)||"in"!==oe&&Z(C.out,P,oe?null:C.key))||"directed"===de||Z(C.undirected,P)}function yi(ne,de,oe){var C=ee.empty();return"undirected"!==ne&&("out"!==de&&void 0!==oe.in&&(C=Ee(C,ce(oe.in))),"in"!==de&&void 0!==oe.out&&(C=Ee(C,ce(oe.out,de?null:oe.key)))),"directed"!==ne&&void 0!==oe.undirected&&(C=Ee(C,ce(oe.undirected))),C}function hi(ne,de,oe,C,P){var Z=de?wt:Pe,we=[];return"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&Z(we,C.in,P),void 0!==C.out&&"in"!==oe&&Z(we,C.out,P),!oe&&C.directedSelfLoops>0&&we.splice(we.lastIndexOf(C.key),1)),"directed"!==ne&&void 0!==C.undirected&&Z(we,C.undirected,P),we}function Hr(ne,de,oe,C,P,Z){var we=de?fe:pt;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z),C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z)),"directed"!==ne&&void 0!==C.undirected&&we(C.undirected,P,Z)}function Ns(ne,de,oe,C,P,Z){var we=de?R:B;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z)||C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z,oe?null:C.key))||"directed"===ne||void 0===C.undirected||we(C.undirected,P,Z)}function cs(ne,de,oe,C){var P=ee.empty();return"undirected"!==ne&&(void 0!==oe.in&&"out"!==de&&C in oe.in&&(P=Ee(P,k(oe.in,C))),void 0!==oe.out&&"in"!==de&&C in oe.out&&(P=Ee(P,k(oe.out,C)))),"directed"!==ne&&void 0!==oe.undirected&&C in oe.undirected&&(P=Ee(P,k(oe.undirected,C))),P}var Ps=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Gr(ne,de){if(void 0!==de)for(var oe in de)ne.add(oe)}function qa(ne,de,oe){if("mixed"!==ne){if("undirected"===ne)return Object.keys(oe.undirected);if("string"==typeof de)return Object.keys(oe[de])}var C=new Set;return"undirected"!==ne&&("out"!==de&&Gr(C,oe.in),"in"!==de&&Gr(C,oe.out)),"directed"!==ne&&Gr(C,oe.undirected),se(C.values(),C.size)}function Al(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;oe(Fe.key,Fe.attributes)}}function ua(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;ne.has(et.key)||(ne.add(et.key),C(et.key,et.attributes))}}function ms(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;if(oe(Fe.key,Fe.attributes))return!0}return!1}function Qt(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;if(!ne.has(et.key)&&(ne.add(et.key),C(et.key,et.attributes)))return!0}return!1}function Ka(ne,de){var oe=Object.keys(de),C=oe.length,P=0;return new ee(function(){if(P>=C)return{done:!0};var Z=de[oe[P++]];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===ne?Z.target:we;return{done:!1,value:[et.key,et.attributes]}})}function rt(ne,de,oe){var C=Object.keys(oe),P=C.length,Z=0;return new ee(function we(){if(Z>=P)return{done:!0};var Fe=oe[C[Z++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var et=Fe.source,We=et===de?Fe.target:et;return ne.has(We.key)?we():(ne.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function ot(ne,de,oe,C,P){var Z=ne._nodes.get(C);if("undirected"!==de){if("out"!==oe&&void 0!==Z.in)for(var we in Z.in)if(we===P)return!0;if("in"!==oe&&void 0!==Z.out)for(var Fe in Z.out)if(Fe===P)return!0}if("directed"!==de&&void 0!==Z.undirected)for(var et in Z.undirected)if(et===P)return!0;return!1}function ke(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,We=de._nodes.values(),zt=de.type;!0!==(C=We.next()).done;){if(P=C.value,"undirected"!==zt)for(Z in we=P.out)if(et=(Fe=we[Z]).target,Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return;if("directed"!==zt)for(Z in we=P.undirected)if((et=(Fe=we[Z]).target).key!==Z&&(et=Fe.source),Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return}}function ct(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,We,zt,Et=de._nodes.values(),pn=de.type;!0!==(C=Et.next()).done;){if(P=C.value,"undirected"!==pn)for(Z in et=P.out)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if(We=(Dt=Fe.value).target,zt=oe(P.key,We.key,P.attributes,We.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&zt)return;if("directed"!==pn)for(Z in et=P.undirected)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if((We=(Dt=Fe.value).target).key!==Z&&(We=Dt.source),zt=oe(P.key,We.key,P.attributes,We.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&zt)return}}function Qe(ne,de){var oe={key:ne};return re(de.attributes)||(oe.attributes=he({},de.attributes)),oe}function vt(ne,de){var oe={source:de.source.key,target:de.target.key};return de.generatedKey||(oe.key=ne),re(de.attributes)||(oe.attributes=he({},de.attributes)),de.undirected&&(oe.undirected=!0),oe}function xt(ne){return L(ne)?"key"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?null:"invalid-attributes":"no-key":"not-object"}function Tt(ne){return L(ne)?"source"in ne?"target"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?"undirected"in ne&&"boolean"!=typeof ne.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var $t=new Set(["directed","undirected","mixed"]),jn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ii={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Dn(ne,de,oe){var C=new ne.NodeDataClass(de,oe);return ne._nodes.set(de,C),ne.emit("nodeAdded",{key:de,attributes:oe}),C}function fn(ne,de,oe,C,P,Z,we,Fe){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(Z=""+Z,we=""+we,Fe=Fe||{},!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var et=ne._nodes.get(Z),Dt=ne._nodes.get(we);if(!et)throw new te("Graph.".concat(de,': source node "').concat(Z,'" not found.'));if(!Dt)throw new te("Graph.".concat(de,': target node "').concat(we,'" not found.'));var We={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(We)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));if(!ne.multi&&(C?void 0!==et.undirected[we]:void 0!==et.out[we]))throw new ye("Graph.".concat(de,': an edge linking "').concat(Z,'" to "').concat(we,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var zt=new Ze(C,P,oe,et,Dt,Fe);return ne._edges.set(P,zt),Z===we?C?(et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(et.undirectedDegree++,Dt.undirectedDegree++):(et.outDegree++,Dt.inDegree++),Je(ne,C,zt,Z,we,et,Dt),C?ne._undirectedSize++:ne._directedSize++,We.key=P,ne.emit("edgeAdded",We),P}function zn(ne,de,oe,C,P,Z,we,Fe,et){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(et){if("function"!=typeof Fe)throw new me("Graph.".concat(de,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Dt;if(Z=""+Z,we=""+we,et&&(Dt=Fe,Fe=void 0),!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,zt,Et=ne._nodes.get(Z),pn=ne._nodes.get(we);if(!oe&&(We=ne._edges.get(P))){if(We.source.key!==Z||We.target.key!==we||C&&(We.source.key!==we||We.target.key!==Z))throw new ye("Graph.".concat(de,': inconsistency detected when attempting to merge the "').concat(P,'" edge with "').concat(Z,'" source & "').concat(we,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));zt=We}if(zt||ne.multi||!Et||(zt=C?Et.undirected[we]:Et.out[we]),zt)return(et?Dt:Fe)?(et?(zt.attributes=Dt(zt.attributes),ne.emit("edgeAttributesUpdated",{type:"replace",key:zt.key,attributes:zt.attributes})):(he(zt.attributes,Fe),ne.emit("edgeAttributesUpdated",{type:"merge",key:zt.key,attributes:zt.attributes,data:Fe})),zt.key):zt.key;Fe=Fe||{},et&&Dt&&(Fe=Dt(Fe));var Wr={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(Wr)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));return Et||(Et=Dn(ne,Z,{}),Z===we&&(pn=Et)),pn||(pn=Dn(ne,we,{})),We=new Ze(C,P,oe,Et,pn,Fe),ne._edges.set(P,We),Z===we?C?(Et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(Et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(Et.undirectedDegree++,pn.undirectedDegree++):(Et.outDegree++,pn.inDegree++),Je(ne,C,We,Z,we,Et,pn),C?ne._undirectedSize++:ne._directedSize++,Wr.key=P,ne.emit("edgeAdded",Wr),P}var ne,bn=function(ne){function de(C){var P;if(P=ne.call(this)||this,(C=he({},ii,C)).edgeKeyGenerator&&"function"!=typeof C.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(C.edgeKeyGenerator,'".'));if("boolean"!=typeof C.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(C.multi,'".'));if(!$t.has(C.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(C.type,'".'));if("boolean"!=typeof C.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(C.allowSelfLoops,'".'));var Z,we="mixed"===C.type?De:"directed"===C.type?Ve:nt;return $(Ae(P),"NodeDataClass",we),$(Ae(P),"_attributes",{}),$(Ae(P),"_nodes",new Map),$(Ae(P),"_edges",new Map),$(Ae(P),"_directedSize",0),$(Ae(P),"_undirectedSize",0),$(Ae(P),"_directedSelfLoopCount",0),$(Ae(P),"_undirectedSelfLoopCount",0),$(Ae(P),"_edgeKeyGenerator",C.edgeKeyGenerator||(Z=0,function(){return Z++})),$(Ae(P),"_options",C),jn.forEach(function(Fe){return $(Ae(P),Fe,P[Fe])}),b(Ae(P),"order",function(){return P._nodes.size}),b(Ae(P),"size",function(){return P._edges.size}),b(Ae(P),"directedSize",function(){return P._directedSize}),b(Ae(P),"undirectedSize",function(){return P._undirectedSize}),b(Ae(P),"selfLoopCount",function(){return P._directedSelfLoopCount+P._undirectedSelfLoopCount}),b(Ae(P),"directedSelfLoopCount",function(){return P._directedSelfLoopCount}),b(Ae(P),"undirectedSelfLoopCount",function(){return P._undirectedSelfLoopCount}),b(Ae(P),"multi",P._options.multi),b(Ae(P),"type",P._options.type),b(Ae(P),"allowSelfLoops",P._options.allowSelfLoops),b(Ae(P),"implementation",function(){return"graphology"}),P}tt(de,ne);var oe=de.prototype;return oe.hasNode=function(C){return this._nodes.has(""+C)},oe.hasDirectedEdge=function(C,P){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&!we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.out[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasUndirectedEdge=function(C,P){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.undirected[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasEdge=function(C,P){if(1===arguments.length)return this._edges.has(""+C);if(2===arguments.length){P=""+P;var we=this._nodes.get(C=""+C);if(!we)return!1;var Fe=void 0!==we.out&&we.out[P];return Fe||(Fe=void 0!==we.undirected&&we.undirected[P]),!(!Fe||this.multi&&!Fe.size)}throw new me("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.directedEdge=function(C,P){if("undirected"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.directedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.directedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||void 0;return we?we.key:void 0}},oe.undirectedEdge=function(C,P){if("directed"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.undirectedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.undirectedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.undirected&&Z.undirected[P]||void 0;return we?we.key:void 0}},oe.edge=function(C,P){if(this.multi)throw new ye("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");P=""+P;var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.edge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.edge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||Z.undirected&&Z.undirected[P]||void 0;if(we)return we.key},oe.inDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.inDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.inDegree+(P?Z.directedSelfLoops:0)},oe.outDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.outDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.outDegree+(P?Z.directedSelfLoops:0)},oe.directedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.directedDegree: could not find the "'.concat(C,'" node in the graph.'));if("undirected"===this.type)return 0;var we=P?Z.directedSelfLoops:0;return Z.inDegree+we+(Z.outDegree+we)},oe.undirectedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.undirectedDegree: could not find the "'.concat(C,'" node in the graph.'));return"directed"===this.type?0:Z.undirectedDegree+2*(P?Z.undirectedSelfLoops:0)},oe.degree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.degree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.degree: could not find the "'.concat(C,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(P&&(Fe=Z.undirectedSelfLoops),we+=Z.undirectedDegree+2*Fe),"undirected"!==this.type&&(P&&(Fe=Z.directedSelfLoops),we+=Z.inDegree+Z.outDegree+2*Fe),we},oe.source=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.source: could not find the "'.concat(C,'" edge in the graph.'));return P.source.key},oe.target=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.target: could not find the "'.concat(C,'" edge in the graph.'));return P.target.key},oe.extremities=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.extremities: could not find the "'.concat(C,'" edge in the graph.'));return[P.source.key,P.target.key]},oe.opposite=function(C,P){C=""+C;var Z=this._edges.get(P=""+P);if(!Z)throw new te('Graph.opposite: could not find the "'.concat(P,'" edge in the graph.'));var we=Z.source.key,Fe=Z.target.key;if(C!==we&&C!==Fe)throw new te('Graph.opposite: the "'.concat(C,'" node is not attached to the "').concat(P,'" edge (').concat(we,", ").concat(Fe,")."));return C===we?Fe:we},oe.hasExtremity=function(C,P){P=""+P;var Z=this._edges.get(C=""+C);if(!Z)throw new te('Graph.hasExtremity: could not find the "'.concat(C,'" edge in the graph.'));return Z.source.key===P||Z.target.key===P},oe.isUndirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isUndirected: could not find the "'.concat(C,'" edge in the graph.'));return P.undirected},oe.isDirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isDirected: could not find the "'.concat(C,'" edge in the graph.'));return!P.undirected},oe.isSelfLoop=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isSelfLoop: could not find the "'.concat(C,'" edge in the graph.'));return P.source===P.target},oe.hasGeneratedKey=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.hasGeneratedKey: could not find the "'.concat(C,'" edge in the graph.'));return P.generatedKey},oe.addNode=function(C,P){return function(Z,we,Fe){if(Fe&&!L(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},Z._nodes.has(we=""+we))throw new ye('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var et=new Z.NodeDataClass(we,Fe);return Z._nodes.set(we,et),Z.emit("nodeAdded",{key:we,attributes:Fe}),et}(this,C,P).key},oe.mergeNode=function(C,P){if(P&&!L(P))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(P,'"'));P=P||{};var Z=this._nodes.get(C=""+C);return Z?(P&&(he(Z.attributes,P),this.emit("nodeAttributesUpdated",{type:"merge",key:C,attributes:Z.attributes,data:P})),C):(Z=new this.NodeDataClass(C,P),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:P}),C)},oe.updateNode=function(C,P){if(P&&"function"!=typeof P)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(P,'"'));var Z=this._nodes.get(C=""+C);if(Z)return P&&(Z.attributes=P(Z.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:C,attributes:Z.attributes})),C;var Fe=P?P({}):{};return Z=new this.NodeDataClass(C,Fe),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:Fe}),C},oe.dropNode=function(C){var P=this,Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.dropNode: could not find the "'.concat(C,'" node in the graph.'));this.forEachEdge(C,function(we){P.dropEdge(we)}),this._nodes.delete(C),this.emit("nodeDropped",{key:C,attributes:Z.attributes})},oe.dropEdge=function(C){var P;if(arguments.length>1){var Z=""+arguments[0],we=""+arguments[1];if(!(P=q(this,Z,we,this.type)))throw new te('Graph.dropEdge: could not find the "'.concat(Z,'" -> "').concat(we,'" edge in the graph.'))}else if(!(P=this._edges.get(C=""+C)))throw new te('Graph.dropEdge: could not find the "'.concat(C,'" edge in the graph.'));this._edges.delete(P.key);var et=P.source,Dt=P.target,We=P.attributes,zt=P.undirected;return et===Dt?zt?(et.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(et.directedSelfLoops--,this._directedSelfLoopCount--):zt?(et.undirectedDegree--,Dt.undirectedDegree--):(et.outDegree--,Dt.inDegree--),Ye(this,zt,P),zt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:C,attributes:We,source:et.key,target:Dt.key,undirected:zt}),this},oe.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},oe.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},oe.getAttribute=function(C){return this._attributes[C]},oe.getAttributes=function(){return this._attributes},oe.hasAttribute=function(C){return this._attributes.hasOwnProperty(C)},oe.setAttribute=function(C,P){return this._attributes[C]=P,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.updateAttribute=function(C,P){if("function"!=typeof P)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[C]=P(this._attributes[C]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.removeAttribute=function(C){return delete this._attributes[C],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:C}),this},oe.replaceAttributes=function(C){if(!L(C))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=C,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},oe.mergeAttributes=function(C){if(!L(C))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,C),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:C}),this},oe.getNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.getNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes[P]},oe.getNodeAttributes=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.getNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));return P.attributes},oe.hasNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes.hasOwnProperty(P)},oe.setNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.setNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return we.attributes[P]=Z,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.updateNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.updateNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof Z)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,et=Z(Fe[P]);return Fe[P]=et,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.removeNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return delete Z.attributes[P],this.emit("nodeAttributesUpdated",{key:C,type:"remove",attributes:Z.attributes,name:P}),this},oe.replaceNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.replaceNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return Z.attributes=P,this.emit("nodeAttributesUpdated",{key:C,type:"replace",attributes:Z.attributes}),this},oe.mergeNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.mergeNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(Z.attributes,P),this.emit("nodeAttributesUpdated",{key:C,type:"merge",attributes:Z.attributes,data:P}),this},oe.updateEachNodeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._nodes.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:P||null})},oe.updateEachEdgeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._edges.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:P||null})},oe.forEach=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?ct(!1,this,C):ke(!1,this,C)},oe.forEachUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?ct(!0,this,C):ke(!0,this,C)},oe.adjacency=function(){return this.multi?(et=(C=this)._nodes.values(),Dt=C.type,We="outer",zt=null,new ee(function Et(){var pn;if("outer"===We)return!0===(pn=et.next()).done?pn:(P=pn.value,We="directed",Et());if("directed"===We)return"undirected"===Dt?(We="undirected",Et()):(we=P.out,Z=Object.keys(P.out),Fe=0,We="inner-directed",Et());if("undirected"===We){if("directed"===Dt)return We="outer",Et();we=P.undirected,Z=Object.keys(P.undirected),Fe=0,We="inner-undirected"}if(!zt&&Fe>=Z.length)return We="inner-undirected"===We?"outer":"undirected",Et();if(!zt){var _s=Z[Fe++];return zt=we[_s].values(),Et()}if((pn=zt.next()).done)return zt=null,Et();var Wr=pn.value,Ks=Wr.target;return"inner-undirected"===We&&Ks.key===P.key&&(Ks=Wr.source),{done:!1,value:[P.key,Ks.key,P.attributes,Ks.attributes,Wr.key,Wr.attributes]}})):(Tl=(Et=this)._nodes.values(),oo=Et.type,Pr="outer",new ee(function Fs(){var fc;if("outer"===Pr)return!0===(fc=Tl.next()).done?fc:(pn=fc.value,Pr="directed",Fs());if("directed"===Pr)return"undirected"===oo?(Pr="undirected",Fs()):(Wr=pn.out,_s=Object.keys(pn.out),Ks=0,Pr="inner-directed",Fs());if("undirected"===Pr){if("directed"===oo)return Pr="outer",Fs();Wr=pn.undirected,_s=Object.keys(pn.undirected),Ks=0,Pr="inner-undirected"}if(Ks>=_s.length)return Pr="inner-undirected"===Pr?"outer":"undirected",Fs();var yn=_s[Ks++],ao=Wr[yn],Ml=ao.target;return"inner-undirected"===Pr&&Ml.key===pn.key&&(Ml=ao.source),{done:!1,value:[pn.key,Ml.key,pn.attributes,Ml.attributes,ao.key,ao.attributes]}}));var Et,pn,_s,Wr,Ks,Tl,oo,Pr,C,P,Z,we,Fe,et,Dt,We,zt},oe.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):se(this._nodes.keys(),this._nodes.size)},oe.forEachNode=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(P,Z){C(Z,P.attributes)})},oe.forEachNodeUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");for(var P,Z,we=this._nodes.values();!0!==(P=we.next())&&!C((Z=P.value).key,Z.attributes););},oe.nodeEntries=function(){var C=this._nodes.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{value:[Z.key,Z.attributes],done:!1}})},oe.exportNode=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.exportNode: could not find the "'.concat(C,'" node in the graph.'));return Qe(C,P)},oe.exportEdge=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.exportEdge: could not find the "'.concat(C,'" edge in the graph.'));return vt(C,P)},oe.export=function(){var C=new Array(this._nodes.size),P=0;this._nodes.forEach(function(we,Fe){C[P++]=Qe(Fe,we)});var Z=new Array(this._edges.size);return P=0,this._edges.forEach(function(we,Fe){Z[P++]=vt(Fe,we)}),{attributes:this.getAttributes(),nodes:C,edges:Z,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},oe.importNode=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=xt(C);if(Z){if("not-object"===Z)throw new me('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===Z)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===Z)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=C.key,Fe=C.attributes,et=void 0===Fe?{}:Fe;return P?this.mergeNode(we,et):this.addNode(we,et),this},oe.importEdge=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=Tt(C);if(Z){if("not-object"===Z)throw new me('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===Z)throw new me("Graph.importEdge: missing souce.");if("no-target"===Z)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===Z)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===Z)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=C.source,Fe=C.target,et=C.attributes,Dt=void 0===et?{}:et,We=C.undirected,zt=void 0!==We&&We;return"key"in C?(P?zt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:zt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,C.key,we,Fe,Dt):(P?zt?this.mergeUndirectedEdge:this.mergeDirectedEdge:zt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Dt),this},oe.import=function(C){var P,Z,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V(C))return this.import(C.export(),Fe),this;if(!L(C))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(C.attributes){if(!L(C.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(C.attributes):this.replaceAttributes(C.attributes)}if(C.nodes){if(we=C.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(P=0,Z=we.length;PZ)){var Dt=new Set;Dt.add(P.undirected[et]),P.undirected[et]=Dt,C._nodes.get(et).undirected[Z]=Dt}})),this;var C},oe.clearIndex=function(){return this._nodes.forEach(function(C){void 0!==C.in&&(C.in={},C.out={}),void 0!==C.undirected&&(C.undirected={})}),this},oe.toJSON=function(){return this.export()},oe.toString=function(){return"[object Graph]"},oe.inspect=function(){var C=this,P={};this._nodes.forEach(function(Dt,We){P[We]=Dt.attributes});var Z={},we={};this._edges.forEach(function(Dt,We){var zt=Dt.undirected?"--":"->",Et="",pn="(".concat(Dt.source.key,")").concat(zt,"(").concat(Dt.target.key,")");Dt.generatedKey?C.multi&&(void 0===we[pn]?we[pn]=0:we[pn]++,Et+="".concat(we[pn],". ")):Et+="[".concat(We,"]: "),Z[Et+=pn]=Dt.attributes});var Fe={};for(var et in this)this.hasOwnProperty(et)&&!jn.has(et)&&"function"!=typeof this[et]&&(Fe[et]=this[et]);return Fe.attributes=this._attributes,Fe.nodes=P,Fe.edges=Z,$(Fe,"constructor",this.constructor),Fe},de}(T.exports.EventEmitter);"undefined"!=typeof Symbol&&(bn.prototype[Symbol.for("nodejs.util.inspect.custom")]=bn.prototype.inspect),[{name:function(ne){return"".concat(ne,"Edge")},generateKey:!0},{name:function(ne){return"".concat(ne,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ne){return"".concat(ne,"EdgeWithKey")}},{name:function(ne){return"".concat(ne,"DirectedEdgeWithKey")},type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ne){["add","merge","update"].forEach(function(de){var oe=ne.name(de),C="add"===de?fn:zn;bn.prototype[oe]=ne.generateKey?function(P,Z,we){return C(this,oe,!0,"undirected"===(ne.type||this.type),null,P,Z,we,"update"===de)}:function(P,Z,we,Fe){return C(this,oe,!1,"undirected"===(ne.type||this.type),P,Z,we,Fe,"update"===de)}})}),"undefined"!=typeof Symbol&&(bn.prototype[Symbol.iterator]=bn.prototype.adjacency),ne=bn,je.forEach(function(de){var oe=de.name,C=de.attacher;C(ne,oe("Edge"),"mixed"),C(ne,oe("DirectedEdge"),"directed"),C(ne,oe("UndirectedEdge"),"undirected")}),function(ne){Re.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe,et){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(!arguments.length)return Oe(this,Z);if(1===arguments.length){var Dt=this._nodes.get(Fe=""+Fe);if(void 0===Dt)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return Tn(this.multi,"mixed"===Z?this.type:Z,we,Dt)}if(2===arguments.length){et=""+et;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" target node in the graph.'));return hi(Z,this.multi,we,We,et)}throw new me("Graph.".concat(P,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1);oe.prototype[Fe]=function(et,Dt,We){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return Xe(this,Z,We=et);if(2===arguments.length){We=Dt;var zt=this._nodes.get(et=""+et);if(void 0===zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Pn(this.multi,"mixed"===Z?this.type:Z,we,zt,We)}if(3===arguments.length){Dt=""+Dt;var Et=this._nodes.get(et=""+et);if(!Et)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Hr(Z,this.multi,we,Et,Dt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1)+"Until";oe.prototype[Fe]=function(et,Dt,We){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return yt(this,Z,We=et);if(2===arguments.length){We=Dt;var zt=this._nodes.get(et=""+et);if(void 0===zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Gn(this.multi,"mixed"===Z?this.type:Z,we,zt,We)}if(3===arguments.length){Dt=""+Dt;var Et=this._nodes.get(et=""+et);if(!Et)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Ns(Z,this.multi,we,Et,Dt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var Z=C.type,we=C.direction,Fe=C.name.slice(0,-1)+"Entries";oe.prototype[Fe]=function(et,Dt){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return ee.empty();if(!arguments.length)return It(this,Z);if(1===arguments.length){var We=this._nodes.get(et=""+et);if(!We)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return yi(Z,we,We)}if(2===arguments.length){Dt=""+Dt;var zt=this._nodes.get(et=""+et);if(!zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return cs(Z,we,zt,Dt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ne,de)})}(bn),function(ne){Ps.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(2===arguments.length){var et=""+arguments[0],Dt=""+arguments[1];if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(P,': could not find the "').concat(Dt,'" node in the graph.'));return ot(this,Z,we,et,Dt)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return qa("mixed"===Z?this.type:Z,we,We)}throw new me("Graph.".concat(P,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1);ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,We,zt,Et){if("mixed"!==Dt){if("undirected"===Dt)return Al(zt,zt.undirected,Et);if("string"==typeof We)return Al(zt,zt[We],Et)}var pn=new Set;"undirected"!==Dt&&("out"!==We&&ua(pn,zt,zt.in,Et),"in"!==We&&ua(pn,zt,zt.out,Et)),"directed"!==Dt&&ua(pn,zt,zt.undirected,Et)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1)+"Until";ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,We,zt,Et){if("mixed"!==Dt){if("undirected"===Dt)return ms(zt,zt.undirected,Et);if("string"==typeof We)return ms(zt,zt[We],Et)}var pn=new Set;"undirected"!==Dt&&("out"!==We&&Qt(pn,zt,zt.in,Et)||"in"!==We&&Qt(pn,zt,zt.out,Et))||"directed"===Dt||Qt(pn,zt,zt.undirected,Et)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var C=de.type,P=de.direction,Z=de.name.slice(0,-1)+"Entries";ne.prototype[Z]=function(we){if("mixed"!==C&&"mixed"!==this.type&&C!==this.type)return ee.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));return function(et,Dt,We){if("mixed"!==et){if("undirected"===et)return Ka(We,We.undirected);if("string"==typeof Dt)return Ka(We,We[Dt])}var zt=ee.empty(),Et=new Set;return"undirected"!==et&&("out"!==Dt&&(zt=Ee(zt,rt(Et,We,We.in))),"in"!==Dt&&(zt=Ee(zt,rt(Et,We,We.out)))),"directed"!==et&&(zt=Ee(zt,rt(Et,We,We.undirected))),zt}("mixed"===C?this.type:C,P,Fe)}}(ne,de)})}(bn);var Qi=function(ne){function de(oe){var C=he({type:"directed"},oe);if("multi"in C&&!1!==C.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==C.type)throw new me('DirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),Zi=function(ne){function de(oe){var C=he({type:"undirected"},oe);if("multi"in C&&!1!==C.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==C.type)throw new me('UndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),qn=function(ne){function de(oe){var C=he({multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ne.call(this,C)||this}return tt(de,ne),de}(bn),Pi=function(ne){function de(oe){var C=he({type:"directed",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==C.type)throw new me('MultiDirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),da=function(ne){function de(oe){var C=he({type:"undirected",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==C.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn);function $r(ne){ne.from=function(de,oe){var C=he({},de.options,oe),P=new ne(C);return P.import(de),P}}return $r(bn),$r(Qi),$r(Zi),$r(qn),$r(Pi),$r(da),bn.Graph=bn,bn.DirectedGraph=Qi,bn.UndirectedGraph=Zi,bn.MultiGraph=qn,bn.MultiDirectedGraph=Pi,bn.MultiUndirectedGraph=da,bn.InvalidArgumentsGraphError=me,bn.NotFoundGraphError=te,bn.UsageGraphError=ye,bn}()},524:(kt,it,tt)=>{var gt;!function(J,At,dt,K){"use strict";var T,Ae=["","webkit","Moz","MS","ms","o"],he=At.createElement("div"),V=Math.round,L=Math.abs,re=Date.now;function $(_e,Ce,He){return setTimeout(M(_e,He),Ce)}function b(_e,Ce,He){return!!Array.isArray(_e)&&(S(_e,He[Ce],He),!0)}function S(_e,Ce,He){var mt;if(_e)if(_e.forEach)_e.forEach(Ce,He);else if(_e.length!==K)for(mt=0;mt<_e.length;)Ce.call(He,_e[mt],mt,_e),mt++;else for(mt in _e)_e.hasOwnProperty(mt)&&Ce.call(He,_e[mt],mt,_e)}function O(_e,Ce,He){var mt="DEPRECATED METHOD: "+Ce+"\n"+He+" AT \n";return function(){var jt=new Error("get-stack-trace"),Ht=jt&&jt.stack?jt.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ri=J.console&&(J.console.warn||J.console.log);return ri&&ri.call(J.console,mt,Ht),_e.apply(this,arguments)}}T="function"!=typeof Object.assign?function(Ce){if(Ce===K||null===Ce)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(Ce),mt=1;mt-1}function Q(_e){return _e.trim().split(/\s+/g)}function E(_e,Ce,He){if(_e.indexOf&&!He)return _e.indexOf(Ce);for(var mt=0;mt<_e.length;){if(He&&_e[mt][He]==Ce||!He&&_e[mt]===Ce)return mt;mt++}return-1}function U(_e){return Array.prototype.slice.call(_e,0)}function ie(_e,Ce,He){for(var mt=[],jt=[],Ht=0;Ht<_e.length;){var ri=Ce?_e[Ht][Ce]:_e[Ht];E(jt,ri)<0&&mt.push(_e[Ht]),jt[Ht]=ri,Ht++}return He&&(mt=Ce?mt.sort(function(qr,ys){return qr[Ce]>ys[Ce]}):mt.sort()),mt}function ue(_e,Ce){for(var He,mt,jt=Ce[0].toUpperCase()+Ce.slice(1),Ht=0;Ht1&&!He.firstMultiple?He.firstMultiple=yt(Ce):1===jt&&(He.firstMultiple=!1);var Ht=He.firstInput,ri=He.firstMultiple,Fr=ri?ri.center:Ht.center,qr=Ce.center=It(mt);Ce.timeStamp=re(),Ce.deltaTime=Ce.timeStamp-Ht.timeStamp,Ce.angle=yi(Fr,qr),Ce.distance=Gn(Fr,qr),function(_e,Ce){var He=Ce.center,mt=_e.offsetDelta||{},jt=_e.prevDelta||{},Ht=_e.prevInput||{};(1===Ce.eventType||4===Ht.eventType)&&(jt=_e.prevDelta={x:Ht.deltaX||0,y:Ht.deltaY||0},mt=_e.offsetDelta={x:He.x,y:He.y}),Ce.deltaX=jt.x+(He.x-mt.x),Ce.deltaY=jt.y+(He.y-mt.y)}(He,Ce),Ce.offsetDirection=Pn(Ce.deltaX,Ce.deltaY);var ys=Tn(Ce.deltaTime,Ce.deltaX,Ce.deltaY);Ce.overallVelocityX=ys.x,Ce.overallVelocityY=ys.y,Ce.overallVelocity=L(ys.x)>L(ys.y)?ys.x:ys.y,Ce.scale=ri?function(_e,Ce){return Gn(Ce[0],Ce[1],pt)/Gn(_e[0],_e[1],pt)}(ri.pointers,mt):1,Ce.rotation=ri?function(_e,Ce){return yi(Ce[1],Ce[0],pt)+yi(_e[1],_e[0],pt)}(ri.pointers,mt):0,Ce.maxPointers=He.prevInput?Ce.pointers.length>He.prevInput.maxPointers?Ce.pointers.length:He.prevInput.maxPointers:Ce.pointers.length,function(_e,Ce){var jt,Ht,ri,Fr,He=_e.lastInterval||Ce,mt=Ce.timeStamp-He.timeStamp;if(8!=Ce.eventType&&(mt>25||He.velocity===K)){var qr=Ce.deltaX-He.deltaX,ys=Ce.deltaY-He.deltaY,ti=Tn(mt,qr,ys);Ht=ti.x,ri=ti.y,jt=L(ti.x)>L(ti.y)?ti.x:ti.y,Fr=Pn(qr,ys),_e.lastInterval=Ce}else jt=He.velocity,Ht=He.velocityX,ri=He.velocityY,Fr=He.direction;Ce.velocity=jt,Ce.velocityX=Ht,Ce.velocityY=ri,Ce.direction=Fr}(He,Ce);var ti=_e.element;D(Ce.srcEvent.target,ti)&&(ti=Ce.srcEvent.target),Ce.target=ti}(_e,He),_e.emit("hammer.input",He),_e.recognize(He),_e.session.prevInput=He}function yt(_e){for(var Ce=[],He=0;He<_e.pointers.length;)Ce[He]={clientX:V(_e.pointers[He].clientX),clientY:V(_e.pointers[He].clientY)},He++;return{timeStamp:re(),pointers:Ce,center:It(Ce),deltaX:_e.deltaX,deltaY:_e.deltaY}}function It(_e){var Ce=_e.length;if(1===Ce)return{x:V(_e[0].clientX),y:V(_e[0].clientY)};for(var He=0,mt=0,jt=0;jt=L(Ce)?_e<0?2:4:Ce<0?8:16}function Gn(_e,Ce,He){He||(He=wt);var mt=Ce[He[0]]-_e[He[0]],jt=Ce[He[1]]-_e[He[1]];return Math.sqrt(mt*mt+jt*jt)}function yi(_e,Ce,He){return He||(He=wt),180*Math.atan2(Ce[He[1]]-_e[He[1]],Ce[He[0]]-_e[He[0]])/Math.PI}fe.prototype={handler:function(){},init:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Y(this.element,this.evEl,this.domHandler),this.evTarget&&Y(this.target,this.evTarget,this.domHandler),this.evWin&&Y(Te(this.element),this.evWin,this.domHandler)}};var Ns={mousedown:1,mousemove:2,mouseup:4},cs="mousedown",Ps="mousemove mouseup";function Gr(){this.evEl=cs,this.evWin=Ps,this.pressed=!1,fe.apply(this,arguments)}w(Gr,fe,{handler:function(Ce){var He=Ns[Ce.type];1&He&&0===Ce.button&&(this.pressed=!0),2&He&&1!==Ce.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[Ce],changedPointers:[Ce],pointerType:Ze,srcEvent:Ce}))}});var qa={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Al={2:Ve,3:"pen",4:Ze,5:"kinect"},ua="pointerdown",ms="pointermove pointerup pointercancel";function Qt(){this.evEl=ua,this.evWin=ms,fe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}J.MSPointerEvent&&!J.PointerEvent&&(ua="MSPointerDown",ms="MSPointerMove MSPointerUp MSPointerCancel"),w(Qt,fe,{handler:function(Ce){var He=this.store,mt=!1,jt=Ce.type.toLowerCase().replace("ms",""),Ht=qa[jt],ri=Al[Ce.pointerType]||Ce.pointerType,Fr=ri==Ve,qr=E(He,Ce.pointerId,"pointerId");1&Ht&&(0===Ce.button||Fr)?qr<0&&(He.push(Ce),qr=He.length-1):12&Ht&&(mt=!0),!(qr<0)&&(He[qr]=Ce,this.callback(this.manager,Ht,{pointers:He,changedPointers:[Ce],pointerType:ri,srcEvent:Ce}),mt&&He.splice(qr,1))}});var Ka={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",ot="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=rt,this.evWin=ot,this.started=!1,fe.apply(this,arguments)}function pe(_e,Ce){var He=U(_e.touches),mt=U(_e.changedTouches);return 12&Ce&&(He=ie(He.concat(mt),"identifier",!0)),[He,mt]}w(ut,fe,{handler:function(Ce){var He=Ka[Ce.type];if(1===He&&(this.started=!0),this.started){var mt=pe.call(this,Ce,He);12&He&&mt[0].length-mt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:mt[0],changedPointers:mt[1],pointerType:Ve,srcEvent:Ce})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ke="touchstart touchmove touchend touchcancel";function ct(){this.evTarget=ke,this.targetIds={},fe.apply(this,arguments)}function Qe(_e,Ce){var He=U(_e.touches),mt=this.targetIds;if(3&Ce&&1===He.length)return mt[He[0].identifier]=!0,[He,He];var jt,Ht,ri=U(_e.changedTouches),Fr=[],qr=this.target;if(Ht=He.filter(function(ys){return D(ys.target,qr)}),1===Ce)for(jt=0;jt-1&&mt.splice(Ht,1)},2500)}}function ii(_e){for(var Ce=_e.srcEvent.clientX,He=_e.srcEvent.clientY,mt=0;mt-1&&this.requireFail.splice(Ce,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(_e){return!!this.simultaneous[_e.id]},emit:function(_e){var Ce=this,He=this.state;function mt(jt){Ce.manager.emit(jt,_e)}He<8&&mt(Ce.options.event+We(He)),mt(Ce.options.event),_e.additionalEvent&&mt(_e.additionalEvent),He>=8&&mt(Ce.options.event+We(He))},tryEmit:function(_e){if(this.canEmit())return this.emit(_e);this.state=32},canEmit:function(){for(var _e=0;_eCe.threshold&&jt&Ce.direction},attrTest:function(_e){return pn.prototype.attrTest.call(this,_e)&&(2&this.state||!(2&this.state)&&this.directionTest(_e))},emit:function(_e){this.pX=_e.deltaX,this.pY=_e.deltaY;var Ce=zt(_e.direction);Ce&&(_e.additionalEvent=this.options.event+Ce),this._super.emit.call(this,_e)}}),w(Wr,pn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.scale-1)>this.options.threshold||2&this.state)},emit:function(_e){1!==_e.scale&&(_e.additionalEvent=this.options.event+(_e.scale<1?"in":"out")),this._super.emit.call(this,_e)}}),w(Ks,Dt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(_e){var Ce=this.options,He=_e.pointers.length===Ce.pointers,mt=_e.distanceCe.time;if(this._input=_e,!mt||!He||12&_e.eventType&&!jt)this.reset();else if(1&_e.eventType)this.reset(),this._timer=$(function(){this.state=8,this.tryEmit()},Ce.time,this);else if(4&_e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(_e){8===this.state&&(_e&&4&_e.eventType?this.manager.emit(this.options.event+"up",_e):(this._input.timeStamp=re(),this.manager.emit(this.options.event,this._input)))}}),w(Tl,pn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.rotation)>this.options.threshold||2&this.state)}}),w(oo,pn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _s.prototype.getTouchAction.call(this)},attrTest:function(_e){var He,Ce=this.options.direction;return 30&Ce?He=_e.overallVelocity:6&Ce?He=_e.overallVelocityX:24&Ce&&(He=_e.overallVelocityY),this._super.attrTest.call(this,_e)&&Ce&_e.offsetDirection&&_e.distance>this.options.threshold&&_e.maxPointers==this.options.pointers&&L(He)>this.options.velocity&&4&_e.eventType},emit:function(_e){var Ce=zt(_e.offsetDirection);Ce&&this.manager.emit(this.options.event+Ce,_e),this.manager.emit(this.options.event,_e)}}),w(Pr,Dt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Qi]},process:function(_e){var Ce=this.options,He=_e.pointers.length===Ce.pointers,mt=_e.distance"']/g,ms=RegExp(Al.source),Qt=RegExp(ua.source),Ka=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pe=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,ct=RegExp(ke.source),Qe=/^\s+/,vt=/\s/,xt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tt=/\{\n\/\* \[wrapped with (.+)\] \*/,$t=/,? & /,jn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ii=/[()=,{}\[\]\/\s]/,Dn=/\\(\\)?/g,fn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zn=/\w*$/,bn=/^[-+]0x[0-9a-f]+$/i,Qi=/^0b[01]+$/i,Zi=/^\[object .+?Constructor\]$/,qn=/^0o[0-7]+$/i,Pi=/^(?:0|[1-9]\d*)$/,da=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$r=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,de="\\ud800-\\udfff",Z="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",pn="\\ufe0e\\ufe0f",_s="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ks="["+de+"]",Tl="["+_s+"]",oo="["+Z+"]",Pr="\\d+",Fs="["+we+"]",fc="["+Fe+"]",yn="[^"+de+_s+Pr+we+Fe+Et+"]",ao="\\ud83c[\\udffb-\\udfff]",ha="[^"+de+"]",id="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="["+Et+"]",mt="(?:"+fc+"|"+yn+")",jt="(?:"+Ce+"|"+yn+")",Ht="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ri="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Fr="(?:"+oo+"|"+ao+")?",qr="["+pn+"]?",T1=qr+Fr+"(?:\\u200d(?:"+[ha,id,_e].join("|")+")"+qr+Fr+")*",rd="(?:"+[Fs,id,_e].join("|")+")"+T1,Wi="(?:"+[ha+oo+"?",oo,id,_e,Ks].join("|")+")",Wf=RegExp("['\u2019]","g"),xm=RegExp(oo,"g"),fh=RegExp(ao+"(?="+ao+")|"+Wi+T1,"g"),gv=RegExp([Ce+"?"+fc+"+"+Ht+"(?="+[Tl,Ce,"$"].join("|")+")",jt+"+"+ri+"(?="+[Tl,Ce+mt,"$"].join("|")+")",Ce+"?"+mt+"+"+Ht,Ce+"+"+ri,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pr,rd].join("|"),"g"),M1=RegExp("[\\u200d"+de+Z+pn+"]"),Dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ph=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],D1=-1,wn={};wn[It]=wn[Tn]=wn[Pn]=wn[Gn]=wn[yi]=wn[hi]=wn[Hr]=wn[Ns]=wn[cs]=!0,wn[Ze]=wn[Je]=wn[Xe]=wn[je]=wn[yt]=wn[Le]=wn[Re]=wn[Ue]=wn[Be]=wn[z]=wn[be]=wn[wt]=wn[pt]=wn[fe]=wn[k]=!1;var Ji={};Ji[Ze]=Ji[Je]=Ji[Xe]=Ji[yt]=Ji[je]=Ji[Le]=Ji[It]=Ji[Tn]=Ji[Pn]=Ji[Gn]=Ji[yi]=Ji[Be]=Ji[z]=Ji[be]=Ji[wt]=Ji[pt]=Ji[fe]=Ji[B]=Ji[hi]=Ji[Hr]=Ji[Ns]=Ji[cs]=!0,Ji[Re]=Ji[Ue]=Ji[k]=!1;var gn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},I1=parseFloat,vv=parseInt,Lt="object"==typeof global&&global&&global.Object===Object&&global,Ls="object"==typeof self&&self&&self.Object===Object&&self,Di=Lt||Ls||Function("return this")(),Il=it&&!it.nodeType&&it,fa=Il&&kt&&!kt.nodeType&&kt,xo=fa&&fa.exports===Il,Cm=xo&&Lt.process,yr=function(){try{return fa&&fa.require&&fa.require("util").types||Cm&&Cm.binding&&Cm.binding("util")}catch(Mt){}}(),en=yr&&yr.isArrayBuffer,si=yr&&yr.isDate,sr=yr&&yr.isMap,lo=yr&&yr.isRegExp,pc=yr&&yr.isSet,Jr=yr&&yr.isTypedArray;function es(st,Mt,_t){switch(_t.length){case 0:return st.call(Mt);case 1:return st.call(Mt,_t[0]);case 2:return st.call(Mt,_t[0],_t[1]);case 3:return st.call(Mt,_t[0],_t[1],_t[2])}return st.apply(Mt,_t)}function Lr(st,Mt,_t,sn){for(var xn=-1,Ci=null==st?0:st.length;++xn-1}function gh(st,Mt,_t){for(var sn=-1,xn=null==st?0:st.length;++sn-1;);return _t}function P1(st,Mt){for(var _t=st.length;_t--&&Ya(Mt,st[_t],0)>-1;);return _t}function CP(st,Mt){for(var _t=st.length,sn=0;_t--;)st[_t]===Mt&&++sn;return sn}var AP=Ho({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),TP=Ho({"&":"&","<":"<",">":">",'"':""","'":"'"});function MP(st){return"\\"+gn[st]}function yh(st){return M1.test(st)}function wv(st){var Mt=-1,_t=Array(st.size);return st.forEach(function(sn,xn){_t[++Mt]=[xn,sn]}),_t}function F1(st,Mt){return function(_t){return st(Mt(_t))}}function ou(st,Mt){for(var _t=-1,sn=st.length,xn=0,Ci=[];++_t",""":'"',"'":"'"}),bh=function st(Mt){var u,_t=(Mt=null==Mt?Di:bh.defaults(Di.Object(),Mt,bh.pick(Di,ph))).Array,sn=Mt.Date,xn=Mt.Error,Ci=Mt.Function,Kr=Mt.Math,Bi=Mt.Object,Om=Mt.RegExp,Nm=Mt.String,ma=Mt.TypeError,or=_t.prototype,au=Bi.prototype,Kf=Mt["__core-js_shared__"],vr=Ci.prototype.toString,ji=au.hasOwnProperty,PP=0,wh=(u=/[^.]+$/.exec(Kf&&Kf.keys&&Kf.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ys=au.toString,B1=vr.call(Bi),Pm=Di._,ud=Om("^"+vr.call(ji).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bs=xo?Mt.Buffer:J,Ol=Mt.Symbol,dd=Mt.Uint8Array,xv=Bs?Bs.allocUnsafe:J,_a=F1(Bi.getPrototypeOf,Bi),Fm=Bi.create,Yf=au.propertyIsEnumerable,Ln=or.splice,j1=Ol?Ol.isConcatSpreadable:J,Eh=Ol?Ol.iterator:J,lu=Ol?Ol.toStringTag:J,Xf=function(){try{var u=Ac(Bi,"defineProperty");return u({},"",{}),u}catch(h){}}(),Cv=Mt.clearTimeout!==Di.clearTimeout&&Mt.clearTimeout,V1=sn&&sn.now!==Di.Date.now&&sn.now,U1=Mt.setTimeout!==Di.setTimeout&&Mt.setTimeout,Ft=Kr.ceil,fi=Kr.floor,ya=Bi.getOwnPropertySymbols,ts=Bs?Bs.isBuffer:J,Lm=Mt.isFinite,Sh=or.join,Qa=F1(Bi.keys,Bi),Br=Kr.max,us=Kr.min,FP=sn.now,z1=Mt.parseInt,xh=Kr.random,Qf=or.reverse,bs=Ac(Mt,"DataView"),co=Ac(Mt,"Map"),Zf=Ac(Mt,"Promise"),va=Ac(Mt,"Set"),Ao=Ac(Mt,"WeakMap"),Ch=Ac(Bi,"create"),Ah=Ao&&new Ao,hd={},H1=bu(bs),km=bu(co),Bm=bu(Zf),Av=bu(va),jm=bu(Ao),Jf=Ol?Ol.prototype:J,fd=Jf?Jf.valueOf:J,Th=Jf?Jf.toString:J;function Se(u){if(Er(u)&&!Mn(u)&&!(u instanceof oi)){if(u instanceof To)return u;if(ji.call(u,"__wrapped__"))return Sp(u)}return new To(u)}var cu=function(){function u(){}return function(h){if(!wr(h))return{};if(Fm)return Fm(h);u.prototype=h;var m=new u;return u.prototype=J,m}}();function Mh(){}function To(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=J}function oi(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function uo(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function js(u,h,m,N,ae,xe){var ze,Ke=1&h,lt=2&h,Ot=4&h;if(m&&(ze=ae?m(u,N,ae,xe):m(u)),ze!==J)return ze;if(!wr(u))return u;var Nt=Mn(u);if(Nt){if(ze=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&ji.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!Ke)return Qs(u,ze)}else{var Bt=Us(u),Jt=Bt==Ue||Bt==qe;if(ll(u))return hp(u,Ke);if(Bt==be||Bt==Ze||Jt&&!ae){if(ze=lt||Jt?{}:Qv(u),!Ke)return lt?function(u,h){return xa(u,Kv(u),h)}(u,function(u,h){return u&&xa(h,Js(h),u)}(ze,u)):function(u,h){return xa(u,a_(u),h)}(u,tC(ze,u))}else{if(!Ji[Bt])return ae?u:{};ze=function(u,h,m){var N=u.constructor;switch(h){case Xe:return mu(u);case je:case Le:return new N(+u);case yt:return function(u,h){var m=h?mu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case It:case Tn:case Pn:case Gn:case yi:case hi:case Hr:case Ns:case cs:return n_(u,m);case Be:return new N;case z:case fe:return new N(u);case wt:return function(u){var h=new u.constructor(u.source,zn.exec(u));return h.lastIndex=u.lastIndex,h}(u);case pt:return new N;case B:return function(u){return fd?Bi(fd.call(u)):{}}(u)}}(u,Bt,Ke)}}xe||(xe=new wa);var _n=xe.get(u);if(_n)return _n;xe.set(u,ze),wA(u)?u.forEach(function(kn){ze.add(js(kn,h,m,kn,u,xe))}):_A(u)&&u.forEach(function(kn,ci){ze.set(ci,js(kn,h,m,ci,u,xe))});var li=Nt?J:(Ot?lt?s_:Bl:lt?Js:Cs)(u);return ks(li||u,function(kn,ci){li&&(kn=u[ci=kn]),Ja(ze,ci,js(kn,h,m,ci,u,xe))}),ze}function sp(u,h,m){var N=m.length;if(null==u)return!N;for(u=Bi(u);N--;){var ae=m[N],ze=u[ae];if(ze===J&&!(ae in u)||!(0,h[ae])(ze))return!1}return!0}function Rh(u,h,m){if("function"!=typeof u)throw new ma(Ae);return Bh(function(){u.apply(J,m)},h)}function yc(u,h,m,N){var ae=-1,xe=Rl,ze=!0,Ke=u.length,lt=[],Ot=h.length;if(!Ke)return lt;m&&(h=ki(h,$o(m))),N?(xe=gh,ze=!1):h.length>=200&&(xe=_h,ze=!1,h=new ba(h));e:for(;++ae-1},Nl.prototype.set=function(u,h){var m=this.__data__,N=gd(m,u);return N<0?(++this.size,m.push([u,h])):m[N][1]=h,this},Za.prototype.clear=function(){this.size=0,this.__data__={hash:new uo,map:new(co||Nl),string:new uo}},Za.prototype.delete=function(u){var h=Vs(this,u).delete(u);return this.size-=h?1:0,h},Za.prototype.get=function(u){return Vs(this,u).get(u)},Za.prototype.has=function(u){return Vs(this,u).has(u)},Za.prototype.set=function(u,h){var m=Vs(this,u),N=m.size;return m.set(u,h),this.size+=m.size==N?0:1,this},ba.prototype.add=ba.prototype.push=function(u){return this.__data__.set(u,q),this},ba.prototype.has=function(u){return this.__data__.has(u)},wa.prototype.clear=function(){this.__data__=new Nl,this.size=0},wa.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},wa.prototype.get=function(u){return this.__data__.get(u)},wa.prototype.has=function(u){return this.__data__.has(u)},wa.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Nl){var N=m.__data__;if(!co||N.length<199)return N.push([u,h]),this.size=++m.size,this;m=this.__data__=new Za(N)}return m.set(u,h),this.size=m.size,this};var vc=il(tl),qm=il(op,!0);function Iv(u,h){var m=!0;return vc(u,function(N,ae,xe){return m=!!h(N,ae,xe)}),m}function Oh(u,h,m){for(var N=-1,ae=u.length;++N0&&m(Ke)?h>1?ws(Ke,h-1,m,N,ae):kr(ae,Ke):N||(ae[ae.length]=Ke)}return ae}var md=jv(),_d=jv(!0);function tl(u,h){return u&&md(u,h,Cs)}function op(u,h){return u&&_d(u,h,Cs)}function Nh(u,h){return pa(h,function(m){return ea(u[m])})}function Wo(u,h){for(var m=0,N=(h=Sc(h,u)).length;null!=u&&mh}function yd(u,h){return null!=u&&ji.call(u,h)}function vd(u,h){return null!=u&&h in Bi(u)}function du(u,h,m){for(var N=m?gh:Rl,ae=u[0].length,xe=u.length,ze=xe,Ke=_t(xe),lt=1/0,Ot=[];ze--;){var Nt=u[ze];ze&&h&&(Nt=ki(Nt,$o(h))),lt=us(Nt.length,lt),Ke[ze]=!m&&(h||ae>=120&&Nt.length>=120)?new ba(ze&&Nt):J}Nt=u[0];var Bt=-1,Jt=Ke[0];e:for(;++Bt=Ke?lt:lt*("desc"==m[N]?-1:1)}return u.index-h.index}(xe,ze,m)});_t--;)st[_t]=st[_t].value;return st}(oC(u,function(xe,ze,Ke){return{criteria:ki(h,function(Ot){return Ot(xe)}),index:++N,value:xe}}))}function Fv(u,h,m){for(var N=-1,ae=h.length,xe={};++N-1;)Ke!==u&&Ln.call(Ke,lt,1),Ln.call(u,lt,1);return u}function Fh(u,h){for(var m=u?h.length:0,N=m-1;m--;){var ae=h[m];if(m==N||ae!==xe){var xe=ae;Io(ae)?Ln.call(u,ae,1):fu(u,ae)}}return u}function Pl(u,h){return u+fi(xh()*(h-u+1))}function lp(u,h){var m="";if(!u||h<1||h>Te)return m;do{h%2&&(m+=u),(h=fi(h/2))&&(u+=u)}while(h);return m}function ai(u,h){return Ep(EC(u,h,eo),u+"")}function lC(u){return Hm(kd(u))}function GP(u,h){var m=kd(u);return Md(m,uu(h,0,m.length))}function cp(u,h,m,N){if(!wr(u))return u;for(var ae=-1,xe=(h=Sc(h,u)).length,ze=xe-1,Ke=u;null!=Ke&&++aeae?0:ae+h),(m=m>ae?ae:m)<0&&(m+=ae),ae=h>m?0:m-h>>>0,h>>>=0;for(var xe=_t(ae);++N>>1,ze=u[xe];null!==ze&&!ta(ze)&&(m?ze<=h:ze=200){var Ot=h?null:r_(u);if(Ot)return Dm(Ot);ze=!1,ae=_h,lt=new ba}else lt=h?[]:Ke;e:for(;++N=N?u:Ss(u,h,m)}var dC=Cv||function(u){return Di.clearTimeout(u)};function hp(u,h){if(h)return u.slice();var m=u.length,N=xv?xv(m):new u.constructor(m);return u.copy(N),N}function mu(u){var h=new u.constructor(u.byteLength);return new dd(h).set(new dd(u)),h}function n_(u,h){var m=h?mu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function xc(u,h){if(u!==h){var m=u!==J,N=null===u,ae=u==u,xe=ta(u),ze=h!==J,Ke=null===h,lt=h==h,Ot=ta(h);if(!Ke&&!Ot&&!xe&&u>h||xe&&ze&<&&!Ke&&!Ot||N&&ze&<||!m&<||!ae)return 1;if(!N&&!xe&&!Ot&&u1?m[ae-1]:J,ze=ae>2?m[2]:J;for(xe=u.length>3&&"function"==typeof xe?(ae--,xe):J,ze&&zs(m[0],m[1],ze)&&(xe=ae<3?J:xe,ae=1),h=Bi(h);++N-1?ae[xe?h[ze]:ze]:J}}function yu(u){return rl(function(h){var m=h.length,N=m,ae=To.prototype.thru;for(u&&h.reverse();N--;){var xe=h[N];if("function"!=typeof xe)throw new ma(Ae);if(ae&&!ze&&"wrapper"==vp(xe))var ze=new To([],!0)}for(N=ze?N:m;++N1&&vi.reverse(),Nt&<Ke))return!1;var Ot=xe.get(u),Nt=xe.get(h);if(Ot&&Nt)return Ot==h&&Nt==u;var Bt=-1,Jt=!0,_n=2&m?new ba:J;for(xe.set(u,h),xe.set(h,u);++Bt-1&&u%1==0&&u1?"& ":"")+h[N],h=h.join(m>2?", ":" "),u.replace(xt,"{\n/* [wrapped with "+h+"] */\n")}(N,function(u,h){return ks(nt,function(m){var N="_."+m[0];h&m[1]&&!Rl(u,N)&&u.push(N)}),u.sort()}(function(u){var h=u.match(Tt);return h?h[1].split($t):[]}(N),m)))}function f_(u){var h=0,m=0;return function(){var N=FP(),ae=16-(N-m);if(m=N,ae>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(J,arguments)}}function Md(u,h){var m=-1,N=u.length,ae=N-1;for(h=h===J?N:h;++m1?u[h-1]:J;return m="function"==typeof m?(u.pop(),m):J,qC(u,m)});function S_(u){var h=Se(u);return h.__chain__=!0,h}function Id(u,h){return h(u)}var x_=rl(function(u){var h=u.length,m=h?u[0]:0,N=this.__wrapped__,ae=function(xe){return $m(xe,u)};return!(h>1||this.__actions__.length)&&N instanceof oi&&Io(m)?((N=N.slice(m,+m+(h?1:0))).__actions__.push({func:Id,args:[ae],thisArg:J}),new To(N,this.__chain__).thru(function(xe){return h&&!xe.length&&xe.push(J),xe})):this.thru(ae)}),XC=Yr(function(u,h,m){ji.call(u,m)?++u[m]:el(u,m,1)}),JC=Uv(g_),eA=Uv(m_);function M_(u,h){return(Mn(u)?ks:vc)(u,On(h,3))}function Ap(u,h){return(Mn(u)?sd:qm)(u,On(h,3))}var nA=Yr(function(u,h,m){ji.call(u,m)?u[m].push(h):el(u,m,[h])}),vb=ai(function(u,h,m){var N=-1,ae="function"==typeof h,xe=ho(u)?_t(u.length):[];return vc(u,function(ze){xe[++N]=ae?es(h,ze,m):Sa(ze,h,m)}),xe}),bb=Yr(function(u,h,m){el(u,m,h)});function ol(u,h){return(Mn(u)?ki:oC)(u,On(h,3))}var Eb=Yr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),Mp=ai(function(u,h){if(null==u)return[];var m=h.length;return m>1&&zs(u,h[0],h[1])?h=[]:m>2&&zs(h[0],h[1],h[2])&&(h=[h[0]]),Ph(u,ws(h,1),[])}),wu=V1||function(){return Di.Date.now()};function Dp(u,h,m){return h=m?J:h,kl(u,H,J,J,J,J,h=u&&null==h?u.length:h)}function I_(u,h){var m;if("function"!=typeof h)throw new ma(Ae);return u=Yn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=J),m}}var Hh=ai(function(u,h,m){var N=1;if(m.length){var ae=ou(m,Td(Hh));N|=j}return kl(u,N,h,m,ae)}),Od=ai(function(u,h,m){var N=3;if(m.length){var ae=ou(m,Td(Od));N|=j}return kl(h,N,u,m,ae)});function Db(u,h,m){var N,ae,xe,ze,Ke,lt,Ot=0,Nt=!1,Bt=!1,Jt=!0;if("function"!=typeof u)throw new ma(Ae);function _n(Ri){var dl=N,Ic=ae;return N=ae=J,Ot=Ri,ze=u.apply(Ic,dl)}function Fn(Ri){return Ot=Ri,Ke=Bh(ci,h),Nt?_n(Ri):ze}function kn(Ri){var dl=Ri-lt;return lt===J||dl>=h||dl<0||Bt&&Ri-Ot>=xe}function ci(){var Ri=wu();if(kn(Ri))return vi(Ri);Ke=Bh(ci,function(Ri){var uT=h-(Ri-lt);return Bt?us(uT,xe-(Ri-Ot)):uT}(Ri))}function vi(Ri){return Ke=J,Jt&&N?_n(Ri):(N=ae=J,ze)}function na(){var Ri=wu(),dl=kn(Ri);if(N=arguments,ae=this,lt=Ri,dl){if(Ke===J)return Fn(lt);if(Bt)return dC(Ke),Ke=Bh(ci,h),_n(lt)}return Ke===J&&(Ke=Bh(ci,h)),ze}return h=fo(h)||0,wr(m)&&(Nt=!!m.leading,xe=(Bt="maxWait"in m)?Br(fo(m.maxWait)||0,h):xe,Jt="trailing"in m?!!m.trailing:Jt),na.cancel=function(){Ke!==J&&dC(Ke),Ot=0,N=lt=ae=Ke=J},na.flush=function(){return Ke===J?ze:vi(wu())},na}var oA=ai(function(u,h){return Rh(u,1,h)}),Ib=ai(function(u,h,m){return Rh(u,fo(h)||0,m)});function Gh(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new ma(Ae);var m=function(){var N=arguments,ae=h?h.apply(this,N):N[0],xe=m.cache;if(xe.has(ae))return xe.get(ae);var ze=u.apply(this,N);return m.cache=xe.set(ae,ze)||xe,ze};return m.cache=new(Gh.Cache||Za),m}function N_(u){if("function"!=typeof u)throw new ma(Ae);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}Gh.Cache=Za;var aA=uC(function(u,h){var m=(h=1==h.length&&Mn(h[0])?ki(h[0],$o(On())):ki(ws(h,1),$o(On()))).length;return ai(function(N){for(var ae=-1,xe=us(N.length,m);++ae=h}),al=nC(function(){return arguments}())?nC:function(u){return Er(u)&&ji.call(u,"callee")&&!Yf.call(u,"callee")},Mn=_t.isArray,Lb=en?$o(en):function(u){return Er(u)&&Es(u)==Xe};function ho(u){return null!=u&&F_(u.length)&&!ea(u)}function br(u){return Er(u)&&ho(u)}var ll=ts||ry,kb=si?$o(si):function(u){return Er(u)&&Es(u)==Le};function Aa(u){if(!Er(u))return!1;var h=Es(u);return h==Re||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!Np(u)}function ea(u){if(!wr(u))return!1;var h=Es(u);return h==Ue||h==qe||"[object AsyncFunction]"==h||"[object Proxy]"==h}function Op(u){return"number"==typeof u&&u==Yn(u)}function F_(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Te}function wr(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Er(u){return null!=u&&"object"==typeof u}var _A=sr?$o(sr):function(u){return Er(u)&&Us(u)==Be};function bA(u){return"number"==typeof u||Er(u)&&Es(u)==z}function Np(u){if(!Er(u)||Es(u)!=be)return!1;var h=_a(u);if(null===h)return!0;var m=ji.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&vr.call(m)==B1}var Ub=lo?$o(lo):function(u){return Er(u)&&Es(u)==wt},wA=pc?$o(pc):function(u){return Er(u)&&Us(u)==pt};function k_(u){return"string"==typeof u||!Mn(u)&&Er(u)&&Es(u)==fe}function ta(u){return"symbol"==typeof u||Er(u)&&Es(u)==B}var $h=Jr?$o(Jr):function(u){return Er(u)&&F_(u.length)&&!!wn[Es(u)]},Tc=mp(Pv),B_=mp(function(u,h){return u<=h});function zb(u){if(!u)return[];if(ho(u))return k_(u)?Xa(u):Qs(u);if(Eh&&u[Eh])return function(st){for(var Mt,_t=[];!(Mt=st.next()).done;)_t.push(Mt.value);return _t}(u[Eh]());var h=Us(u);return(h==Be?wv:h==pt?Dm:kd)(u)}function cl(u){return u?(u=fo(u))===se||u===-se?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Yn(u){var h=cl(u),m=h%1;return h==h?m?h-m:h:0}function j_(u){return u?uu(Yn(u),0,ye):0}function fo(u){if("number"==typeof u)return u;if(ta(u))return NaN;if(wr(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=wr(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=bv(u);var m=Qi.test(u);return m||qn.test(u)?vv(u.slice(2),m?2:8):bn.test(u)?NaN:+u}function Hb(u){return xa(u,Js(u))}function Ii(u){return null==u?"":Do(u)}var EA=Fl(function(u,h){if(wp(h)||ho(h))xa(h,Cs(h),u);else for(var m in h)ji.call(h,m)&&Ja(u,m,h[m])}),SA=Fl(function(u,h){xa(h,Js(h),u)}),Nd=Fl(function(u,h,m,N){xa(h,Js(h),u,N)}),xA=Fl(function(u,h,m,N){xa(h,Cs(h),u,N)}),Gb=rl($m),AA=ai(function(u,h){u=Bi(u);var m=-1,N=h.length,ae=N>2?h[2]:J;for(ae&&zs(h[0],h[1],ae)&&(N=1);++m1),xe}),xa(u,s_(u),m),N&&(m=js(m,7,_p));for(var ae=h.length;ae--;)fu(m,h[ae]);return m}),RA=rl(function(u,h){return null==u?{}:function(u,h){return Fv(u,h,function(m,N){return Pp(u,N)})}(u,h)});function Qb(u,h){if(null==u)return{};var m=ki(s_(u),function(N){return[N]});return h=On(h),Fv(u,m,function(N,ae){return h(N,ae[0])})}var OA=vu(Cs),Jb=vu(Js);function kd(u){return null==u?[]:Mm(u,Cs(u))}var kA=Ll(function(u,h,m){return h=h.toLowerCase(),u+(m?H_(h):h)});function H_(u){return kp(Ii(u).toLowerCase())}function G_(u){return(u=Ii(u))&&u.replace(da,AP).replace(xm,"")}var jA=Ll(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),VA=Ll(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),dF=fp("toLowerCase"),$A=Ll(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),q_=Ll(function(u,h,m){return u+(m?" ":"")+kp(h)}),sw=Ll(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),kp=fp("toUpperCase");function Q_(u,h,m){return u=Ii(u),(h=m?J:h)===J?function(st){return Dl.test(st)}(u)?function(st){return st.match(gv)||[]}(u):function(st){return st.match(jn)||[]}(u):u.match(h)||[]}var Z_=ai(function(u,h){try{return es(u,J,h)}catch(m){return Aa(m)?m:new xn(m)}}),ow=rl(function(u,h){return ks(h,function(m){m=Zn(m),el(u,m,Hh(u[m],u))}),u});function J_(u){return function(){return u}}var fF=yu(),Bd=yu(!0);function eo(u){return u}function Eu(u){return sC("function"==typeof u?u:js(u,1))}var ey=ai(function(u,h){return function(m){return Sa(m,u,h)}}),aw=ai(function(u,h){return function(m){return Sa(u,m,h)}});function ty(u,h,m){var N=Cs(h),ae=Nh(h,N);null==m&&(!wr(h)||!ae.length&&N.length)&&(m=h,h=u,u=this,ae=Nh(h,Cs(h)));var xe=!(wr(m)&&"chain"in m&&!m.chain),ze=ea(u);return ks(ae,function(Ke){var lt=h[Ke];u[Ke]=lt,ze&&(u.prototype[Ke]=function(){var Ot=this.__chain__;if(xe||Ot){var Nt=u(this.__wrapped__),Bt=Nt.__actions__=Qs(this.__actions__);return Bt.push({func:lt,args:arguments,thisArg:u}),Nt.__chain__=Ot,Nt}return lt.apply(u,kr([this.value()],arguments))})}),u}function ny(){}var ZA=pp(ki),JA=pp(Qn),cw=pp(Co);function Su(u){return Xo(u)?Am(Zn(u)):function(u){return function(h){return Wo(h,u)}}(u)}var eT=Hv(),tT=Hv(!0);function Dc(){return[]}function ry(){return!1}var Hn=i_(function(u,h){return u+h},0),sy=Ad("ceil"),gF=i_(function(u,h){return u/h},1),Ul=Ad("floor"),fw=i_(function(u,h){return u*h},1),pw=Ad("round"),gw=i_(function(u,h){return u-h},0);return Se.after=function(u,h){if("function"!=typeof h)throw new ma(Ae);return u=Yn(u),function(){if(--u<1)return h.apply(this,arguments)}},Se.ary=Dp,Se.assign=EA,Se.assignIn=SA,Se.assignInWith=Nd,Se.assignWith=xA,Se.at=Gb,Se.before=I_,Se.bind=Hh,Se.bindAll=ow,Se.bindKey=Od,Se.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Mn(u)?u:[u]},Se.chain=S_,Se.chunk=function(u,h,m){h=(m?zs(u,h,m):h===J)?1:Br(Yn(h),0);var N=null==u?0:u.length;if(!N||h<1)return[];for(var ae=0,xe=0,ze=_t(Ft(N/h));aeae?0:ae+m),(N=N===J||N>ae?ae:Yn(N))<0&&(N+=ae),N=m>N?0:j_(N);m>>0)?(u=Ii(u))&&("string"==typeof h||null!=h&&!Ub(h))&&!(h=Do(h))&&yh(u)?nl(Xa(u),0,m):u.split(h,m):[]},Se.spread=function(u,h){if("function"!=typeof u)throw new ma(Ae);return h=null==h?0:Br(Yn(h),0),ai(function(m){var N=m[h],ae=nl(m,0,h);return N&&kr(ae,N),es(u,this,ae)})},Se.tail=function(u){var h=null==u?0:u.length;return h?Ss(u,1,h):[]},Se.take=function(u,h,m){return u&&u.length?Ss(u,0,(h=m||h===J?1:Yn(h))<0?0:h):[]},Se.takeRight=function(u,h,m){var N=null==u?0:u.length;return N?Ss(u,(h=N-(h=m||h===J?1:Yn(h)))<0?0:h,N):[]},Se.takeRightWhile=function(u,h){return u&&u.length?pu(u,On(h,3),!1,!0):[]},Se.takeWhile=function(u,h){return u&&u.length?pu(u,On(h,3)):[]},Se.tap=function(u,h){return h(u),u},Se.throttle=function(u,h,m){var N=!0,ae=!0;if("function"!=typeof u)throw new ma(Ae);return wr(m)&&(N="leading"in m?!!m.leading:N,ae="trailing"in m?!!m.trailing:ae),Db(u,h,{leading:N,maxWait:h,trailing:ae})},Se.thru=Id,Se.toArray=zb,Se.toPairs=OA,Se.toPairsIn=Jb,Se.toPath=function(u){return Mn(u)?ki(u,Zn):ta(u)?[u]:Qs(tb(Ii(u)))},Se.toPlainObject=Hb,Se.transform=function(u,h,m){var N=Mn(u),ae=N||ll(u)||$h(u);if(h=On(h,4),null==m){var xe=u&&u.constructor;m=ae?N?new xe:[]:wr(u)&&ea(xe)?cu(_a(u)):{}}return(ae?ks:tl)(u,function(ze,Ke,lt){return h(m,ze,Ke,lt)}),m},Se.unary=function(u){return Dp(u,1)},Se.union=db,Se.unionBy=GC,Se.unionWith=$C,Se.uniq=function(u){return u&&u.length?wc(u):[]},Se.uniqBy=function(u,h){return u&&u.length?wc(u,On(h,2)):[]},Se.uniqWith=function(u,h){return h="function"==typeof h?h:J,u&&u.length?wc(u,J,h):[]},Se.unset=function(u,h){return null==u||fu(u,h)},Se.unzip=hb,Se.unzipWith=qC,Se.update=function(u,h,m){return null==u?u:up(u,h,t_(m))},Se.updateWith=function(u,h,m,N){return N="function"==typeof N?N:J,null==u?u:up(u,h,t_(m),N)},Se.values=kd,Se.valuesIn=function(u){return null==u?[]:Mm(u,Js(u))},Se.without=fb,Se.words=Q_,Se.wrap=function(u,h){return Ip(t_(h),u)},Se.xor=eF,Se.xorBy=Ro,Se.xorWith=w_,Se.zip=E_,Se.zipObject=function(u,h){return dp(u||[],h||[],Ja)},Se.zipObjectDeep=function(u,h){return dp(u||[],h||[],cp)},Se.zipWith=zh,Se.entries=OA,Se.entriesIn=Jb,Se.extend=SA,Se.extendWith=Nd,ty(Se,Se),Se.add=Hn,Se.attempt=Z_,Se.camelCase=kA,Se.capitalize=H_,Se.ceil=sy,Se.clamp=function(u,h,m){return m===J&&(m=h,h=J),m!==J&&(m=(m=fo(m))==m?m:0),h!==J&&(h=(h=fo(h))==h?h:0),uu(fo(u),h,m)},Se.clone=function(u){return js(u,4)},Se.cloneDeep=function(u){return js(u,5)},Se.cloneDeepWith=function(u,h){return js(u,5,h="function"==typeof h?h:J)},Se.cloneWith=function(u,h){return js(u,4,h="function"==typeof h?h:J)},Se.conformsTo=function(u,h){return null==h||sp(u,h,Cs(h))},Se.deburr=G_,Se.defaultTo=function(u,h){return null==u||u!=u?h:u},Se.divide=gF,Se.endsWith=function(u,h,m){u=Ii(u),h=Do(h);var N=u.length,ae=m=m===J?N:uu(Yn(m),0,N);return(m-=h.length)>=0&&u.slice(m,ae)==h},Se.eq=Cn,Se.escape=function(u){return(u=Ii(u))&&Qt.test(u)?u.replace(ua,TP):u},Se.escapeRegExp=function(u){return(u=Ii(u))&&ct.test(u)?u.replace(ke,"\\$&"):u},Se.every=function(u,h,m){var N=Mn(u)?Qn:Iv;return m&&zs(u,h,m)&&(h=J),N(u,On(h,3))},Se.find=JC,Se.findIndex=g_,Se.findKey=function(u,h){return mh(u,On(h,3),tl)},Se.findLast=eA,Se.findLastIndex=m_,Se.findLastKey=function(u,h){return mh(u,On(h,3),op)},Se.floor=Ul,Se.forEach=M_,Se.forEachRight=Ap,Se.forIn=function(u,h){return null==u?u:md(u,On(h,3),Js)},Se.forInRight=function(u,h){return null==u?u:_d(u,On(h,3),Js)},Se.forOwn=function(u,h){return u&&tl(u,On(h,3))},Se.forOwnRight=function(u,h){return u&&op(u,On(h,3))},Se.get=Kh,Se.gt=on,Se.gte=Fb,Se.has=function(u,h){return null!=u&&Xv(u,h,yd)},Se.hasIn=Pp,Se.head=ib,Se.identity=eo,Se.includes=function(u,h,m,N){u=ho(u)?u:kd(u),m=m&&!N?Yn(m):0;var ae=u.length;return m<0&&(m=Br(ae+m,0)),k_(u)?m<=ae&&u.indexOf(h,m)>-1:!!ae&&Ya(u,h,m)>-1},Se.indexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=null==m?0:Yn(m);return ae<0&&(ae=Br(N+ae,0)),Ya(u,h,ae)},Se.inRange=function(u,h,m){return h=cl(h),m===J?(m=h,h=0):m=cl(m),function(u,h,m){return u>=us(h,m)&&u=-Te&&u<=Te},Se.isSet=wA,Se.isString=k_,Se.isSymbol=ta,Se.isTypedArray=$h,Se.isUndefined=function(u){return u===J},Se.isWeakMap=function(u){return Er(u)&&Us(u)==k},Se.isWeakSet=function(u){return Er(u)&&"[object WeakSet]"==Es(u)},Se.join=function(u,h){return null==u?"":Sh.call(u,h)},Se.kebabCase=jA,Se.last=Qo,Se.lastIndexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=N;return m!==J&&(ae=(ae=Yn(m))<0?Br(N+ae,0):us(ae,N-1)),h==h?function(st,Mt,_t){for(var sn=_t+1;sn--;)if(st[sn]===Mt)return sn;return sn}(u,h,ae):ad(u,gc,ae,!0)},Se.lowerCase=VA,Se.lowerFirst=dF,Se.lt=Tc,Se.lte=B_,Se.max=function(u){return u&&u.length?Oh(u,eo,Ea):J},Se.maxBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Ea):J},Se.mean=function(u){return vs(u,eo)},Se.meanBy=function(u,h){return vs(u,On(h,2))},Se.min=function(u){return u&&u.length?Oh(u,eo,Pv):J},Se.minBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Pv):J},Se.stubArray=Dc,Se.stubFalse=ry,Se.stubObject=function(){return{}},Se.stubString=function(){return""},Se.stubTrue=function(){return!0},Se.multiply=fw,Se.nth=function(u,h){return u&&u.length?hu(u,Yn(h)):J},Se.noConflict=function(){return Di._===this&&(Di._=Pm),this},Se.noop=ny,Se.now=wu,Se.pad=function(u,h,m){u=Ii(u);var N=(h=Yn(h))?vh(u):0;if(!h||N>=h)return u;var ae=(h-N)/2;return gp(fi(ae),m)+u+gp(Ft(ae),m)},Se.padEnd=function(u,h,m){u=Ii(u);var N=(h=Yn(h))?vh(u):0;return h&&Nh){var N=u;u=h,h=N}if(m||u%1||h%1){var ae=xh();return us(u+ae*(h-u+I1("1e-"+((ae+"").length-1))),h)}return Pl(u,h)},Se.reduce=function(u,h,m){var N=Mn(u)?su:Go,ae=arguments.length<3;return N(u,On(h,4),m,ae,vc)},Se.reduceRight=function(u,h,m){var N=Mn(u)?od:Go,ae=arguments.length<3;return N(u,On(h,4),m,ae,qm)},Se.repeat=function(u,h,m){return h=(m?zs(u,h,m):h===J)?1:Yn(h),lp(Ii(u),h)},Se.replace=function(){var u=arguments,h=Ii(u[0]);return u.length<3?h:h.replace(u[1],u[2])},Se.result=function(u,h,m){var N=-1,ae=(h=Sc(h,u)).length;for(ae||(ae=1,u=J);++NTe)return[];var m=ye,N=us(u,ye);h=On(h),u-=ye;for(var ae=cd(N,h);++m=xe)return u;var Ke=m-vh(N);if(Ke<1)return N;var lt=ze?nl(ze,0,Ke).join(""):u.slice(0,Ke);if(ae===J)return lt+N;if(ze&&(Ke+=lt.length-Ke),Ub(ae)){if(u.slice(Ke).search(ae)){var Ot,Nt=lt;for(ae.global||(ae=Om(ae.source,Ii(zn.exec(ae))+"g")),ae.lastIndex=0;Ot=ae.exec(Nt);)var Bt=Ot.index;lt=lt.slice(0,Bt===J?Ke:Bt)}}else if(u.indexOf(Do(ae),Ke)!=Ke){var Jt=lt.lastIndexOf(ae);Jt>-1&&(lt=lt.slice(0,Jt))}return lt+N},Se.unescape=function(u){return(u=Ii(u))&&ms.test(u)?u.replace(Al,Rm):u},Se.uniqueId=function(u){var h=++PP;return Ii(u)+h},Se.upperCase=sw,Se.upperFirst=kp,Se.each=M_,Se.eachRight=Ap,Se.first=ib,ty(Se,function(){var u={};return tl(Se,function(h,m){ji.call(Se.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),Se.VERSION="4.17.21",ks(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){Se[u].placeholder=Se}),ks(["drop","take"],function(u,h){oi.prototype[u]=function(m){m=m===J?1:Br(Yn(m),0);var N=this.__filtered__&&!h?new oi(this):this.clone();return N.__filtered__?N.__takeCount__=us(m,N.__takeCount__):N.__views__.push({size:us(m,ye),type:u+(N.__dir__<0?"Right":"")}),N},oi.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),ks(["filter","map","takeWhile"],function(u,h){var m=h+1,N=1==m||3==m;oi.prototype[u]=function(ae){var xe=this.clone();return xe.__iteratees__.push({iteratee:On(ae,3),type:m}),xe.__filtered__=xe.__filtered__||N,xe}}),ks(["head","last"],function(u,h){var m="take"+(h?"Right":"");oi.prototype[u]=function(){return this[m](1).value()[0]}}),ks(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");oi.prototype[u]=function(){return this.__filtered__?new oi(this):this[m](1)}}),oi.prototype.compact=function(){return this.filter(eo)},oi.prototype.find=function(u){return this.filter(u).head()},oi.prototype.findLast=function(u){return this.reverse().find(u)},oi.prototype.invokeMap=ai(function(u,h){return"function"==typeof u?new oi(this):this.map(function(m){return Sa(m,u,h)})}),oi.prototype.reject=function(u){return this.filter(N_(On(u)))},oi.prototype.slice=function(u,h){u=Yn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new oi(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==J&&(m=(h=Yn(h))<0?m.dropRight(-h):m.take(h-u)),m)},oi.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},oi.prototype.toArray=function(){return this.take(ye)},tl(oi.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),N=/^(?:head|last)$/.test(h),ae=Se[N?"take"+("last"==h?"Right":""):h],xe=N||/^find/.test(h);!ae||(Se.prototype[h]=function(){var ze=this.__wrapped__,Ke=N?[1]:arguments,lt=ze instanceof oi,Ot=Ke[0],Nt=lt||Mn(ze),Bt=function(ci){var vi=ae.apply(Se,kr([ci],Ke));return N&&Jt?vi[0]:vi};Nt&&m&&"function"==typeof Ot&&1!=Ot.length&&(lt=Nt=!1);var Jt=this.__chain__,_n=!!this.__actions__.length,Fn=xe&&!Jt,li=lt&&!_n;if(!xe&&Nt){ze=li?ze:new oi(this);var kn=u.apply(ze,Ke);return kn.__actions__.push({func:Id,args:[Bt],thisArg:J}),new To(kn,Jt)}return Fn&&li?u.apply(this,Ke):(kn=this.thru(Bt),Fn?N?kn.value()[0]:kn.value():kn)})}),ks(["pop","push","shift","sort","splice","unshift"],function(u){var h=or[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",N=/^(?:pop|shift)$/.test(u);Se.prototype[u]=function(){var ae=arguments;if(N&&!this.__chain__){var xe=this.value();return h.apply(Mn(xe)?xe:[],ae)}return this[m](function(ze){return h.apply(Mn(ze)?ze:[],ae)})}}),tl(oi.prototype,function(u,h){var m=Se[h];if(m){var N=m.name+"";ji.call(hd,N)||(hd[N]=[]),hd[N].push({name:h,func:m})}}),hd[Cc(J,2).name]=[{name:"wrapper",func:J}],oi.prototype.clone=function(){var u=new oi(this.__wrapped__);return u.__actions__=Qs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Qs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Qs(this.__views__),u},oi.prototype.reverse=function(){if(this.__filtered__){var u=new oi(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},oi.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Mn(u),N=h<0,ae=m?u.length:0,xe=function(u,h,m){for(var N=-1,ae=m.length;++N=this.__values__.length;return{done:u,value:u?J:this.__values__[this.__index__++]}},Se.prototype.plant=function(u){for(var h,m=this;m instanceof Mh;){var N=Sp(m);N.__index__=0,N.__values__=J,h?ae.__wrapped__=N:h=N;var ae=N;m=m.__wrapped__}return ae.__wrapped__=u,h},Se.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof oi){var h=u;return this.__actions__.length&&(h=new oi(this)),(h=h.reverse()).__actions__.push({func:Id,args:[b_],thisArg:J}),new To(h,this.__chain__)}return this.thru(b_)},Se.prototype.toJSON=Se.prototype.valueOf=Se.prototype.value=function(){return cC(this.__wrapped__,this.__actions__)},Se.prototype.first=Se.prototype.head,Eh&&(Se.prototype[Eh]=function(){return this}),Se}();Di._=bh,(gt=function(){return bh}.call(it,tt,it,kt))!==J&&(kt.exports=gt)}.call(this)},478:function(kt){kt.exports=function(){"use strict";function it(rt,ot){for(var ut=0;utrt.length)&&(ot=rt.length);for(var ut=0,pe=new Array(ot);ut=rt.length?{done:!0}:{done:!1,value:rt[pe++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var dt={exports:{}};function K(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}dt.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:K,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,q=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,re={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(ot){return re[ot]};var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function O(rt){return rt.replace(S,function(ot,ut){return"colon"===(ut=ut.toLowerCase())?":":"#"===ut.charAt(0)?"x"===ut.charAt(1)?String.fromCharCode(parseInt(ut.substring(2),16)):String.fromCharCode(+ut.substring(1)):""})}var T=/(^|[^\[])\^/g;var y=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var j={},I=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,Y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(rt,ot){j[" "+rt]||(j[" "+rt]=I.test(rt)?rt+"/":U(rt,"/",!0));var ut=-1===(rt=j[" "+rt]).indexOf(":");return"//"===ot.substring(0,2)?ut?ot:rt.replace(H,"$1")+ot:"/"===ot.charAt(0)?ut?ot:rt.replace(Y,"$1")+ot:rt+ot}function U(rt,ot,ut){var pe=rt.length;if(0===pe)return"";for(var ve=0;ve1;)1&ot&&(ut+=rt),ot>>=1,rt+=rt;return ut+rt},Te=dt.exports.defaults,me=U,te=function(rt,ot){var pe=rt.replace(/\|/g,function(ke,ct,Qe){for(var vt=!1,xt=ct;--xt>=0&&"\\"===Qe[xt];)vt=!vt;return vt?"|":" |"}).split(/ \|/),ve=0;if(pe.length>ot)pe.splice(ot);else for(;pe.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},ot.code=function(pe){var ve=this.rules.block.code.exec(pe);if(ve){var ke=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:me(ke,"\n")}}},ot.fences=function(pe){var ve=this.rules.block.fences.exec(pe);if(ve){var ke=ve[0],ct=function(rt,ot){var ut=rt.match(/^(\s+)(?:```)/);if(null===ut)return ot;var pe=ut[1];return ot.split("\n").map(function(ve){var ke=ve.match(/^\s+/);return null===ke?ve:ke[0].length>=pe.length?ve.slice(pe.length):ve}).join("\n")}(ke,ve[3]||"");return{type:"code",raw:ke,lang:ve[2]?ve[2].trim():ve[2],text:ct}}},ot.heading=function(pe){var ve=this.rules.block.heading.exec(pe);if(ve){var ke=ve[2].trim();if(/#$/.test(ke)){var ct=me(ke,"#");(this.options.pedantic||!ct||/ $/.test(ct))&&(ke=ct.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:ke}}},ot.nptable=function(pe){var ve=this.rules.block.nptable.exec(pe);if(ve){var ke={type:"table",header:te(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(ke.header.length===ke.align.length){var Qe,ct=ke.align.length;for(Qe=0;Qe ?/gm,"");return{type:"blockquote",raw:ve[0],text:ke}}},ot.list=function(pe){var ve=this.rules.block.list.exec(pe);if(ve){var $t,jn,ii,Dn,fn,zn,bn,Qi,Zi,ke=ve[0],ct=ve[2],Qe=ct.length>1,vt={type:"list",raw:ke,ordered:Qe,start:Qe?+ct.slice(0,-1):"",loose:!1,items:[]},xt=ve[0].match(this.rules.block.item),Tt=!1,qn=xt.length;ii=this.rules.block.listItemStart.exec(xt[0]);for(var Pi=0;Piii[1].length:Dn[1].length>=ii[0].length||Dn[1].length>3){xt.splice(Pi,2,xt[Pi]+(!this.options.pedantic&&Dn[1].length/i.test(ct[0])&&(ve=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(ct[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ct[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:ct[0],inLink:ve,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ct[0]):ye(ct[0]):ct[0]}},ot.link=function(pe){var ve=this.rules.inline.link.exec(pe);if(ve){var ke=ve[2].trim();if(!this.options.pedantic&&/^$/.test(ke))return;var ct=me(ke.slice(0,-1),"\\");if((ke.length-ct.length)%2==0)return}else{var Qe=De(ve[2],"()");if(Qe>-1){var xt=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Qe;ve[2]=ve[2].substring(0,Qe),ve[0]=ve[0].substring(0,xt).trim(),ve[3]=""}}var Tt=ve[2],$t="";if(this.options.pedantic){var jn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Tt);jn&&(Tt=jn[1],$t=jn[3])}else $t=ve[3]?ve[3].slice(1,-1):"";return Tt=Tt.trim(),/^$/.test(ke)?Tt.slice(1):Tt.slice(1,-1)),Ve(ve,{href:Tt&&Tt.replace(this.rules.inline._escapes,"$1"),title:$t&&$t.replace(this.rules.inline._escapes,"$1")},ve[0])}},ot.reflink=function(pe,ve){var ke;if((ke=this.rules.inline.reflink.exec(pe))||(ke=this.rules.inline.nolink.exec(pe))){var ct=(ke[2]||ke[1]).replace(/\s+/g," ");if(!(ct=ve[ct.toLowerCase()])||!ct.href){var Qe=ke[0].charAt(0);return{type:"text",raw:Qe,text:Qe}}return Ve(ke,ct,ke[0])}},ot.emStrong=function(pe,ve,ke){void 0===ke&&(ke="");var ct=this.rules.inline.emStrong.lDelim.exec(pe);if(ct&&(!ct[3]||!ke.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Qe=ct[1]||ct[2]||"";if(!Qe||Qe&&(""===ke||this.rules.inline.punctuation.exec(ke))){var xt,Tt,vt=ct[0].length-1,$t=vt,jn=0,ii="*"===ct[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ii.lastIndex=0,ve=ve.slice(-1*pe.length+vt);null!=(ct=ii.exec(ve));)if(xt=ct[1]||ct[2]||ct[3]||ct[4]||ct[5]||ct[6]){if(Tt=xt.length,ct[3]||ct[4]){$t+=Tt;continue}if((ct[5]||ct[6])&&vt%3&&!((vt+Tt)%3)){jn+=Tt;continue}if(!(($t-=Tt)>0))return Tt=Math.min(Tt,Tt+$t+jn),Math.min(vt,Tt)%2?{type:"em",raw:pe.slice(0,vt+ct.index+Tt+1),text:pe.slice(1,vt+ct.index+Tt)}:{type:"strong",raw:pe.slice(0,vt+ct.index+Tt+1),text:pe.slice(2,vt+ct.index+Tt-1)}}}}},ot.codespan=function(pe){var ve=this.rules.inline.code.exec(pe);if(ve){var ke=ve[2].replace(/\n/g," "),ct=/[^ ]/.test(ke),Qe=/^ /.test(ke)&&/ $/.test(ke);return ct&&Qe&&(ke=ke.substring(1,ke.length-1)),ke=ye(ke,!0),{type:"codespan",raw:ve[0],text:ke}}},ot.br=function(pe){var ve=this.rules.inline.br.exec(pe);if(ve)return{type:"br",raw:ve[0]}},ot.del=function(pe){var ve=this.rules.inline.del.exec(pe);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},ot.autolink=function(pe,ve){var ct,Qe,ke=this.rules.inline.autolink.exec(pe);if(ke)return Qe="@"===ke[2]?"mailto:"+(ct=ye(this.options.mangle?ve(ke[1]):ke[1])):ct=ye(ke[1]),{type:"link",raw:ke[0],text:ct,href:Qe,tokens:[{type:"text",raw:ct,text:ct}]}},ot.url=function(pe,ve){var ke;if(ke=this.rules.inline.url.exec(pe)){var ct,Qe;if("@"===ke[2])Qe="mailto:"+(ct=ye(this.options.mangle?ve(ke[0]):ke[0]));else{var vt;do{vt=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0]}while(vt!==ke[0]);ct=ye(ke[0]),Qe="www."===ke[1]?"http://"+ct:ct}return{type:"link",raw:ke[0],text:ct,href:Qe,tokens:[{type:"text",raw:ct,text:ct}]}}},ot.inlineText=function(pe,ve,ke){var Qe,ct=this.rules.inline.text.exec(pe);if(ct)return Qe=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ct[0]):ye(ct[0]):ct[0]:ye(this.options.smartypants?ke(ct[0]):ct[0]),{type:"text",raw:ct[0],text:Qe}},rt}(),Je=se_noopTest,Ye=se_edit,je=se_merge,Le={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Je,table:Je,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Le.def=Ye(Le.def).replace("label",Le._label).replace("title",Le._title).getRegex(),Le.bullet=/(?:[*+-]|\d{1,9}[.)])/,Le.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Le.item=Ye(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Ye(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Ye(Le.list).replace(/bull/g,Le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Le.def.source+")").getRegex(),Le._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Le._comment=/|$)/,Le.html=Ye(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Ye(Le._paragraph).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.blockquote=Ye(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=je({},Le),Le.gfm=je({},Le.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Le.gfm.nptable=Ye(Le.gfm.nptable).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.gfm.table=Ye(Le.gfm.table).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.pedantic=je({},Le.normal,{html:Ye("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Je,paragraph:Ye(Le.normal._paragraph).replace("hr",Le.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ee.punctuation=Ye(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ee.escapedEmSt=/\\\*|\\_/g,Ee._comment=Ye(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ee.emStrong.lDelim=Ye(Ee.emStrong.lDelim).replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimAst=Ye(Ee.emStrong.rDelimAst,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimUnd=Ye(Ee.emStrong.rDelimUnd,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ee.autolink=Ye(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Ye(Ee.tag).replace("comment",Ee._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Ye(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Ye(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Ye(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=je({},Ee),Ee.pedantic=je({},Ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ye(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=je({},Ee.normal,{escape:Ye(Ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(pe="x"+pe.toString(16)),ot+="&#"+pe+";";return ot}var Pe=function(){function rt(ut){this.tokens=[],this.tokens.links=Object.create(null),this.options=ut||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var pe={block:Be.normal,inline:z.normal};this.options.pedantic?(pe.block=Be.pedantic,pe.inline=z.pedantic):this.options.gfm&&(pe.block=Be.gfm,pe.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=pe}rt.lex=function(pe,ve){return new rt(ve).lex(pe)},rt.lexInline=function(pe,ve){return new rt(ve).inlineTokens(pe)};var ot=rt.prototype;return ot.lex=function(pe){return pe=pe.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(pe,this.tokens,!0),this.inline(this.tokens),this.tokens},ot.blockTokens=function(pe,ve,ke){var Qe,vt,xt,Tt,$t,jn,ct=this;for(void 0===ve&&(ve=[]),void 0===ke&&(ke=!0),this.options.pedantic&&(pe=pe.replace(/^ +$/gm,""));pe;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Dn){return!!(Qe=Dn.call(ct,pe,ve))&&(pe=pe.substring(Qe.raw.length),ve.push(Qe),!0)}))){if(Qe=this.tokenizer.space(pe)){pe=pe.substring(Qe.raw.length),Qe.type&&ve.push(Qe);continue}if(Qe=this.tokenizer.code(pe)){pe=pe.substring(Qe.raw.length),(Tt=ve[ve.length-1])&&"paragraph"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe);continue}if(Qe=this.tokenizer.fences(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.heading(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.nptable(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.hr(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.blockquote(pe)){pe=pe.substring(Qe.raw.length),Qe.tokens=this.blockTokens(Qe.text,[],ke),ve.push(Qe);continue}if(Qe=this.tokenizer.list(pe)){for(pe=pe.substring(Qe.raw.length),xt=Qe.items.length,vt=0;vt=0&&(Dn=Math.min(Dn,zn))}),Dn<1/0&&Dn>=0&&($t=pe.substring(0,Dn+1))}(),ke&&(Qe=this.tokenizer.paragraph($t))){Tt=ve[ve.length-1],jn&&"paragraph"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe),jn=$t.length!==pe.length,pe=pe.substring(Qe.raw.length);continue}if(Qe=this.tokenizer.text(pe)){pe=pe.substring(Qe.raw.length),(Tt=ve[ve.length-1])&&"text"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe);continue}if(pe){var ii="Infinite loop on byte: "+pe.charCodeAt(0);if(this.options.silent){console.error(ii);break}throw new Error(ii)}}return ve},ot.inline=function(pe){var ve,ke,ct,Qe,vt,xt,Tt=pe.length;for(ve=0;ve0)for(;null!=(jn=this.tokenizer.rules.inline.reflinkSearch.exec($t));)fn.includes(jn[0].slice(jn[0].lastIndexOf("[")+1,-1))&&($t=$t.slice(0,jn.index)+"["+X("a",jn[0].length-2)+"]"+$t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(jn=this.tokenizer.rules.inline.blockSkip.exec($t));)$t=$t.slice(0,jn.index)+"["+X("a",jn[0].length-2)+"]"+$t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(jn=this.tokenizer.rules.inline.escapedEmSt.exec($t));)$t=$t.slice(0,jn.index)+"++"+$t.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;pe;)if(ii||(Dn=""),ii=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(bn){return!!(vt=bn.call(Qe,pe,ve))&&(pe=pe.substring(vt.raw.length),ve.push(vt),!0)}))){if(vt=this.tokenizer.escape(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.tag(pe,ke,ct)){pe=pe.substring(vt.raw.length),ke=vt.inLink,ct=vt.inRawBlock,(xt=ve[ve.length-1])&&"text"===vt.type&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.link(pe)){pe=pe.substring(vt.raw.length),"link"===vt.type&&(vt.tokens=this.inlineTokens(vt.text,[],!0,ct)),ve.push(vt);continue}if(vt=this.tokenizer.reflink(pe,this.tokens.links)){pe=pe.substring(vt.raw.length),xt=ve[ve.length-1],"link"===vt.type?(vt.tokens=this.inlineTokens(vt.text,[],!0,ct),ve.push(vt)):xt&&"text"===vt.type&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.emStrong(pe,$t,Dn)){pe=pe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,ct),ve.push(vt);continue}if(vt=this.tokenizer.codespan(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.br(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.del(pe)){pe=pe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,ct),ve.push(vt);continue}if(vt=this.tokenizer.autolink(pe,ce)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(!ke&&(vt=this.tokenizer.url(pe,ce))){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(Tt=pe,this.options.extensions&&this.options.extensions.startInline&&function(){var bn=1/0,Qi=pe.slice(1),Zi=void 0;Qe.options.extensions.startInline.forEach(function(qn){"number"==typeof(Zi=qn.call(this,Qi))&&Zi>=0&&(bn=Math.min(bn,Zi))}),bn<1/0&&bn>=0&&(Tt=pe.substring(0,bn+1))}(),vt=this.tokenizer.inlineText(Tt,ct,be)){pe=pe.substring(vt.raw.length),"_"!==vt.raw.slice(-1)&&(Dn=vt.raw.slice(-1)),ii=!0,(xt=ve[ve.length-1])&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(pe){var zn="Infinite loop on byte: "+pe.charCodeAt(0);if(this.options.silent){console.error(zn);break}throw new Error(zn)}}return ve},function(rt,ot,ut){ot&&it(rt.prototype,ot),ut&&it(rt,ut)}(rt,null,[{key:"rules",get:function(){return{block:Be,inline:z}}}]),rt}(),wt=dt.exports.defaults,pt=se_cleanUrl,fe=se_escape,B=function(){function rt(ut){this.options=ut||wt}var ot=rt.prototype;return ot.code=function(pe,ve,ke){var ct=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Qe=this.options.highlight(pe,ct);null!=Qe&&Qe!==pe&&(ke=!0,pe=Qe)}return pe=pe.replace(/\n$/,"")+"\n",ct?'
    '+(ke?pe:fe(pe,!0))+"
    \n":"
    "+(ke?pe:fe(pe,!0))+"
    \n"},ot.blockquote=function(pe){return"
    \n"+pe+"
    \n"},ot.html=function(pe){return pe},ot.heading=function(pe,ve,ke,ct){return this.options.headerIds?"'+pe+"\n":""+pe+"\n"},ot.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},ot.list=function(pe,ve,ke){var ct=ve?"ol":"ul";return"<"+ct+(ve&&1!==ke?' start="'+ke+'"':"")+">\n"+pe+"\n"},ot.listitem=function(pe){return"
  • "+pe+"
  • \n"},ot.checkbox=function(pe){return" "},ot.paragraph=function(pe){return"

    "+pe+"

    \n"},ot.table=function(pe,ve){return ve&&(ve=""+ve+""),"\n\n"+pe+"\n"+ve+"
    \n"},ot.tablerow=function(pe){return"\n"+pe+"\n"},ot.tablecell=function(pe,ve){var ke=ve.header?"th":"td";return(ve.align?"<"+ke+' align="'+ve.align+'">':"<"+ke+">")+pe+"\n"},ot.strong=function(pe){return""+pe+""},ot.em=function(pe){return""+pe+""},ot.codespan=function(pe){return""+pe+""},ot.br=function(){return this.options.xhtml?"
    ":"
    "},ot.del=function(pe){return""+pe+""},ot.link=function(pe,ve,ke){if(null===(pe=pt(this.options.sanitize,this.options.baseUrl,pe)))return ke;var ct='"+ke+""},ot.image=function(pe,ve,ke){if(null===(pe=pt(this.options.sanitize,this.options.baseUrl,pe)))return ke;var ct=''+ke+'":">")},ot.text=function(pe){return pe},rt}(),R=function(){function rt(){}var ot=rt.prototype;return ot.strong=function(pe){return pe},ot.em=function(pe){return pe},ot.codespan=function(pe){return pe},ot.del=function(pe){return pe},ot.html=function(pe){return pe},ot.text=function(pe){return pe},ot.link=function(pe,ve,ke){return""+ke},ot.image=function(pe,ve,ke){return""+ke},ot.br=function(){return""},rt}(),k=function(){function rt(){this.seen={}}var ot=rt.prototype;return ot.serialize=function(pe){return pe.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ot.getNextSafeSlug=function(pe,ve){var ke=pe,ct=0;if(this.seen.hasOwnProperty(ke)){ct=this.seen[pe];do{ke=pe+"-"+ ++ct}while(this.seen.hasOwnProperty(ke))}return ve||(this.seen[pe]=ct,this.seen[ke]=0),ke},ot.slug=function(pe,ve){void 0===ve&&(ve={});var ke=this.serialize(pe);return this.getNextSafeSlug(ke,ve.dryrun)},rt}(),Oe=B,Xe=R,yt=k,It=dt.exports.defaults,Tn=se_unescape,Gn=Pe,yi=function(){function rt(ut){this.options=ut||It,this.options.renderer=this.options.renderer||new Oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new yt}rt.parse=function(pe,ve){return new rt(ve).parse(pe)},rt.parseInline=function(pe,ve){return new rt(ve).parseInline(pe)};var ot=rt.prototype;return ot.parse=function(pe,ve){void 0===ve&&(ve=!0);var ct,Qe,vt,xt,Tt,$t,jn,ii,Dn,fn,zn,bn,Qi,Zi,qn,Pi,da,$r,ne,ke="",de=pe.length;for(ct=0;ct0&&"text"===qn.tokens[0].type?(qn.tokens[0].text=$r+" "+qn.tokens[0].text,qn.tokens[0].tokens&&qn.tokens[0].tokens.length>0&&"text"===qn.tokens[0].tokens[0].type&&(qn.tokens[0].tokens[0].text=$r+" "+qn.tokens[0].tokens[0].text)):qn.tokens.unshift({type:"text",text:$r}):Zi+=$r),Zi+=this.parse(qn.tokens,Qi),Dn+=this.renderer.listitem(Zi,da,Pi);ke+=this.renderer.list(Dn,zn,bn);continue;case"html":ke+=this.renderer.html(fn.text);continue;case"paragraph":ke+=this.renderer.paragraph(this.parseInline(fn.tokens));continue;case"text":for(Dn=fn.tokens?this.parseInline(fn.tokens):fn.text;ct+1An error occurred:

    "+qa(vt.message+"",!0)+"
    ";throw vt}}return Qt.options=Qt.setOptions=function(rt){return Ps(Qt.defaults,rt),ua(Qt.defaults),Qt},Qt.getDefaults=Al,Qt.defaults=ms,Qt.use=function(){for(var rt=this,ot=arguments.length,ut=new Array(ot),pe=0;peAn error occurred:

    "+qa(pe.message+"",!0)+"
    ";throw pe}},Qt.Parser=yi,Qt.parser=yi.parse,Qt.Renderer=Hr,Qt.TextRenderer=Ns,Qt.Lexer=Gn,Qt.lexer=Gn.lex,Qt.Tokenizer=hi,Qt.Slugger=cs,Qt.parse=Qt,Qt}()},369:(kt,it,tt)=>{var gt=tt(284),J=tt(830);function At(){this.clear()}At.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},At.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},At.prototype.dequeue=function(){if(this.size){var dt=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,dt}},At.prototype.peek=function(){if(this.size)return this.items[this.offset]},At.prototype.forEach=function(dt,K){K=arguments.length>1?K:this;for(var Ae=this.offset,he=0,q=this.items.length;Ae=dt.length)return{done:!0};var Ae=dt[K];return K++,{value:Ae,done:!1}})},At.prototype.entries=function(){var dt=this.items,K=this.offset,Ae=0;return new gt(function(){if(K>=dt.length)return{done:!0};var he=dt[K];return K++,{value:[Ae++,he],done:!1}})},"undefined"!=typeof Symbol&&(At.prototype[Symbol.iterator]=At.prototype.values),At.prototype.toString=function(){return this.toArray().join(",")},At.prototype.toJSON=function(){return this.toArray()},At.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:At,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(At.prototype[Symbol.for("nodejs.util.inspect.custom")]=At.prototype.inspect),At.from=function(dt){var K=new At;return J(dt,function(Ae){K.enqueue(Ae)}),K},At.of=function(){return At.from(arguments)},kt.exports=At},830:kt=>{var it="undefined"!=typeof ArrayBuffer,tt="undefined"!=typeof Symbol;function gt(J,At){var dt,K,Ae,he,q;if(!J)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof At)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(J)||it&&ArrayBuffer.isView(J)||"string"==typeof J||"[object Arguments]"===J.toString())for(Ae=0,he=J.length;Ae{function it(tt){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:tt}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var tt=this._next();return tt.done&&(this.done=!0),tt},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var tt=arguments,gt=tt.length,J=0;return new it(function(){return J>=gt?{done:!0}:{done:!1,value:tt[J++]}})},it.empty=function(){var tt=new it(null);return tt.done=!0,tt},it.is=function(tt){return tt instanceof it||"object"==typeof tt&&null!==tt&&"function"==typeof tt.next},kt.exports=it},310:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==J.window.orientation},it.default=function(he){if(!he&&!(0,At.default)())return"Node";if((0,dt.default)(he))return"Electron";var q="undefined"!=typeof navigator?navigator:{},V=he||q.userAgent||"";if(V.indexOf("Edge")>-1)return"Edge";var L=-1!==V.indexOf("MSIE "),re=-1!==V.indexOf("Trident/");return L||re?"IE":J.window.chrome?"Chrome":J.window.safari?"Safari":J.window.mozInnerScreenX?"Firefox":"Unknown"};var J=tt(151),At=gt(tt(602)),dt=gt(tt(344))},151:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var J=gt(tt(321)),At={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&process};it.self=At.self||At.window||At.global,it.window=At.window||At.self||At.global,it.global=At.global||At.self||At.window,it.document=At.document||{},it.process=At.process||{};var V=console;it.console=V},761:(kt,it,tt)=>{"use strict";var J=tt(948),At=tt(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"jU",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Ae.default}});var dt=tt(151),K=V(tt(602)),Ae=V(tt(310));J(tt(344));function q(L){if("function"!=typeof WeakMap)return null;var re=new WeakMap,$=new WeakMap;return(q=function(S){return S?$:re})(L)}function V(L,re){if(!re&&L&&L.__esModule)return L;if(null===L||"object"!==At(L)&&"function"!=typeof L)return{default:L};var $=q(re);if($&&$.has(L))return $.get(L);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in L)if("default"!==O&&Object.prototype.hasOwnProperty.call(L,O)){var T=S?Object.getOwnPropertyDescriptor(L,O):null;T&&(T.get||T.set)?Object.defineProperty(b,O,T):b[O]=L[O]}return b.default=L,$&&$.set(L,b),b}},602:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var J=gt(tt(321)),At=gt(tt(344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,At.default)()}},344:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,J.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,J.default)(process.versions)&&Boolean(process.versions.electron))return!0;var K="object"===("undefined"==typeof navigator?"undefined":(0,J.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Ae=dt||K;return!!(Ae&&Ae.indexOf("Electron")>=0)};var J=gt(tt(321))},991:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(At,dt,K,Ae){void 0===Ae&&(Ae=K),Object.defineProperty(At,Ae,{enumerable:!0,get:function(){return dt[K]}})}:function(At,dt,K,Ae){void 0===Ae&&(Ae=K),At[Ae]=dt[K]}),J=this&&this.__exportStar||function(At,dt){for(var K in At)"default"!==K&&!Object.prototype.hasOwnProperty.call(dt,K)&>(dt,At,K)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(180),it),J(tt(103),it),J(tt(965),it),J(tt(595),it),J(tt(417),it),J(tt(451),it),J(tt(735),it)},180:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(J){this.termType="BlankNode",this.value=J}equals(J){return!!J&&"BlankNode"===J.termType&&J.value===this.value}}},103:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const gt=tt(180),J=tt(965),At=tt(595),dt=tt(417),K=tt(451),Ae=tt(735);let he=0;it.DataFactory=class{constructor(L){this.blankNodeCounter=0,this.blankNodePrefix=(L=L||{}).blankNodePrefix||`df_${he++}_`}namedNode(L){return new dt.NamedNode(L)}blankNode(L){return new gt.BlankNode(L||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(L,re){return new At.Literal(L,re)}variable(L){return new Ae.Variable(L)}defaultGraph(){return J.DefaultGraph.INSTANCE}quad(L,re,$,b){return new K.Quad(L,re,$,b||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(At.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}}},965:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class tt{constructor(){this.termType="DefaultGraph",this.value=""}equals(J){return!!J&&"DefaultGraph"===J.termType}}it.DefaultGraph=tt,tt.INSTANCE=new tt},595:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const gt=tt(417);class J{constructor(dt,K){this.termType="Literal",this.value=dt,"string"==typeof K?(this.language=K,this.datatype=J.RDF_LANGUAGE_STRING):K?(this.language="",this.datatype=K):(this.language="",this.datatype=J.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=J,J.RDF_LANGUAGE_STRING=new gt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),J.XSD_STRING=new gt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(J){this.termType="NamedNode",this.value=J}equals(J){return!!J&&"NamedNode"===J.termType&&J.value===this.value}}},451:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(J,At,dt,K){this.termType="Quad",this.value="",this.subject=J,this.predicate=At,this.object=dt,this.graph=K}equals(J){return!!J&&("Quad"===J.termType||!J.termType)&&this.subject.equals(J.subject)&&this.predicate.equals(J.predicate)&&this.object.equals(J.object)&&this.graph.equals(J.graph)}}},735:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(J){this.termType="Variable",this.value=J}equals(J){return!!J&&"Variable"===J.termType&&J.value===this.value}}},609:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(b,S,O,T){void 0===T&&(T=O),Object.defineProperty(b,T,{enumerable:!0,get:function(){return S[O]}})}:function(b,S,O,T){void 0===T&&(T=O),b[T]=S[O]}),J=this&&this.__exportStar||function(b,S){for(var O in b)"default"!==O&&!Object.prototype.hasOwnProperty.call(S,O)&>(S,b,O)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const At=tt(991),dt=tt(938),K=tt(60);J(tt(938),it),J(tt(871),it),J(tt(60),it);const Ae=new At.DataFactory,he=new K.Translator;function q(b,S){return he.fromRdf(b,S)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(b=>Ae.namedNode(b)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(b=>Ae.namedNode(b)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(b=>Ae.namedNode(b)),["object"]),it.fromRdf=q,it.toRdf=function(b,S){return S&&"namedNode"in S&&(S={dataFactory:S}),(S=S||{})&&!S.dataFactory&&(S.dataFactory=Ae),he.toRdf(b,S)},it.getTermRaw=function(b,S){return"Literal"===b.termType?q(b,S):b.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Translator=void 0,it.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(J){throw new Error(`Invalid RDF ${J.datatype.value} value: '${J.value}'`)}registerHandler(J,At,dt){for(const K of At)this.supportedRdfDatatypes.push(K),this.fromRdfHandlers[K.value]=J;for(const K of dt){let Ae=this.toRdfHandlers[K];Ae||(this.toRdfHandlers[K]=Ae=[]),Ae.push(J)}}fromRdf(J,At){const dt=this.fromRdfHandlers[J.datatype.value];return dt?dt.fromRdf(J,At):J.value}toRdf(J,At){const dt=this.toRdfHandlers[typeof J];if(dt)for(const K of dt){const Ae=K.toRdf(J,At);if(Ae)return Ae}throw new Error(`Invalid JavaScript value: '${J}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const gt=tt(60);class J{fromRdf(dt,K){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return K&>.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:K,dataFactory:Ae}){return Ae.literal(dt?"true":"false",K||Ae.namedNode(J.TYPE))}}it.TypeHandlerBoolean=J,J.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const gt=tt(60);class J{fromRdf(dt,K){switch(K&&!dt.value.match(J.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&>.Translator.incorrectRdfDataType(dt),dt.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(dt.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const Ae=dt.value.split("-");return new Date(0,parseInt(Ae[0],10)-1,parseInt(Ae[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(dt.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(dt.value+"-01");default:return new Date(dt.value)}}toRdf(dt,{datatype:K,dataFactory:Ae}){if(K=K||Ae.namedNode(J.TYPES[0]),!(dt instanceof Date))return null;const he=dt;let q;switch(K.value){case"http://www.w3.org/2001/XMLSchema#gDay":q=String(he.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":q=he.getUTCMonth()+1+"-"+he.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":q=String(he.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":q=he.getUTCFullYear()+"-"+(he.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":q=he.toISOString().replace(/T.*$/,"");break;default:q=he.toISOString()}return Ae.literal(q,K)}}it.TypeHandlerDate=J,J.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"],J.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]$/}},554:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const gt=tt(60);class J{fromRdf(dt,K){const Ae=parseFloat(dt.value);return K&&isNaN(Ae)&>.Translator.incorrectRdfDataType(dt),Ae}toRdf(dt,{datatype:K,dataFactory:Ae}){return K=K||Ae.namedNode(J.TYPES[0]),isNaN(dt)?Ae.literal("NaN",K):isFinite(dt)?dt%1==0?null:Ae.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),K):Ae.literal(dt>0?"INF":"-INF",K)}}it.TypeHandlerNumberDouble=J,J.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const gt=tt(60);class J{fromRdf(dt,K){const Ae=parseInt(dt.value,10);return K&&(isNaN(Ae)||dt.value.indexOf(".")>=0)&>.Translator.incorrectRdfDataType(dt),Ae}toRdf(dt,{datatype:K,dataFactory:Ae}){return Ae.literal(String(dt),K||Ae.namedNode(dt<=J.MAX_INT&&dt>=J.MIN_INT?J.TYPES[0]:J.TYPES[1]))}}it.TypeHandlerNumberInteger=J,J.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"],J.MAX_INT=2147483647,J.MIN_INT=-2147483648},608:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class tt{fromRdf(J){return J.value}toRdf(J,{datatype:At,dataFactory:dt}){return dt.literal(J,At)}}it.TypeHandlerString=tt,tt.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/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},938:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(At,dt,K,Ae){void 0===Ae&&(Ae=K),Object.defineProperty(At,Ae,{enumerable:!0,get:function(){return dt[K]}})}:function(At,dt,K,Ae){void 0===Ae&&(Ae=K),At[Ae]=dt[K]}),J=this&&this.__exportStar||function(At,dt){for(var K in At)"default"!==K&&!Object.prototype.hasOwnProperty.call(dt,K)&>(dt,At,K)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(727),it),J(tt(525),it),J(tt(554),it),J(tt(750),it),J(tt(608),it)},18:(kt,it,tt)=>{"use strict";var gt={};tt.r(gt),tt.d(gt,{decode:()=>ufe,encode:()=>dfe});var J={};tt.r(J),tt.d(J,{decode:()=>mfe,encode:()=>_fe});var At={};tt.r(At),tt.d(At,{decode:()=>yfe,encode:()=>vfe});var dt={};function K(n){return"function"==typeof n}tt.r(dt),tt.d(dt,{decode:()=>bfe,encode:()=>wfe});let Ae=!1;const he={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else Ae&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ae=n},get useDeprecatedSynchronousErrorHandling(){return Ae}};function q(n){setTimeout(()=>{throw n},0)}const V={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;q(n)},complete(){}},L=Array.isArray||(n=>n&&"number"==typeof n.length);function re(n){return null!==n&&"object"==typeof n}const b=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class S{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof S)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof b?t.errors:t),[])}S.EMPTY=((n=new S).closed=!0,n);const T="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends S{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=V;break;case 1:if(!e){this.destination=V;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,e,t,i)}}[T](){return this}static create(e,t,i){const r=new y(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class w extends y{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;K(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==V&&(o=Object.create(t),K(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;he.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=he;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):q(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;q(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);he.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),he.useDeprecatedSynchronousErrorHandling)throw i;q(i)}}__tryOrSetError(e,t,i){if(!he.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return he.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(q(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const I="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(n){return n}let F=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof y)return n;if(n[T])return n[T]()}return n||e||t?new y(n,e,t):new y(V)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||he.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),he.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){he.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof y?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=Q(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[I](){return this}pipe(...t){return 0===t.length?this:function(n){return 0===n.length?H:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}(t)(this)}toPromise(t){return new(t=Q(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function Q(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const U=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ie extends S{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class ue extends y{constructor(e){super(e),this.destination=e}}let ee=(()=>{class n extends F{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[T](){return new ue(this)}lift(t){const i=new se(this,this);return i.operator=t,i}next(t){if(this.closed)throw new U;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew se(e,t),n})();class se extends ee{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):S.EMPTY}}function Te(n){return n&&"function"==typeof n.schedule}function me(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new te(n,e))}}class te{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new ye(e,this.project,this.thisArg))}}class ye extends y{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const De=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ee(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Re=n=>{if(n&&"function"==typeof n[I])return(n=>e=>{const t=n[I]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(Le(n))return De(n);if(Ee(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,q),e))(n);if(n&&"function"==typeof n[Ze])return(n=>e=>{const t=n[Ze]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${re(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Be(n,e){return new F(t=>{const i=new S;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function Pe(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[I]}(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>{const r=n[I]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(Ee(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(Le(n))return Be(n,e);if(function(n){return n&&"function"==typeof n[Ze]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new F(t=>{const i=new S;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Ze](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof F?n:new F(Re(n))}class wt extends y{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class fe extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function R(n,e){if(e.closed)return;if(n instanceof F)return n.subscribe(e);let t;try{t=Re(n)(e)}catch(i){e.error(i)}return t}function k(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(k((r,s)=>Pe(n(r,s)).pipe(me((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Oe(n,t)))}class Oe{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Xe(e,this.project,this.concurrent))}}class Xe extends fe{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function It(n=Number.POSITIVE_INFINITY){return k(H,n)}function Tn(n,e){return e?Be(n,e):new F(De(n))}function Pn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Te(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof F?n[0]:It(e)(Tn(n,t))}function Gn(){return function(e){return e.lift(new yi(e))}}class yi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new hi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class hi extends y{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Hr extends F{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new S,e.add(this.source.subscribe(new cs(this.getSubject(),this))),e.closed&&(this._connection=null,e=S.EMPTY)),e}refCount(){return Gn()(this)}}const Ns=(()=>{const n=Hr.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class cs extends ue{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class Al{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function ua(){return new ee}function ms(){return n=>Gn()(function(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new Al(r,e));const s=Object.create(i,Ns);return s.source=i,s.subjectFactory=r,s}}(ua)(n))}function Qt(n){for(let e in n)if(n[e]===Qt)return e;throw Error("Could not find renamed property on target object.")}function Ka(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function rt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(rt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ot(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ut=Qt({__forward_ref__:Qt});function pe(n){return n.__forward_ref__=pe,n.toString=function(){return rt(this())},n}function ve(n){return ke(n)?n():n}function ke(n){return"function"==typeof n&&n.hasOwnProperty(ut)&&n.__forward_ref__===pe}class Qe extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function $t(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():function(n){return"string"==typeof n?n:null==n?"":String(n)}(n)}function fn(n,e){const t=e?` in ${e}`:"";throw new Qe("201",`No provider for ${$t(n)} found${t}`)}function Z(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function We(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Et(n){return{providers:n.providers||[],imports:n.imports||[]}}function pn(n){return _s(n,oo)||_s(n,Fs)}function _s(n,e){return n.hasOwnProperty(e)?n[e]:null}function Tl(n){return n&&(n.hasOwnProperty(Pr)||n.hasOwnProperty(fc))?n[Pr]:null}const oo=Qt({\u0275prov:Qt}),Pr=Qt({\u0275inj:Qt}),Fs=Qt({ngInjectableDef:Qt}),fc=Qt({ngInjectorDef:Qt});var yn=(()=>((yn=yn||{})[yn.Default=0]="Default",yn[yn.Host=1]="Host",yn[yn.Self=2]="Self",yn[yn.SkipSelf=4]="SkipSelf",yn[yn.Optional=8]="Optional",yn))();let ao;function ha(n){const e=ao;return ao=n,e}function id(n,e,t){const i=pn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&yn.Optional?null:void 0!==e?e:void fn(rt(n),"Injector")}function Ce(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),Ht=(()=>((Ht=Ht||{})[Ht.Emulated=0]="Emulated",Ht[Ht.None=2]="None",Ht[Ht.ShadowDom=3]="ShadowDom",Ht))();const ri="undefined"!=typeof globalThis&&globalThis,Fr="undefined"!=typeof window&&window,qr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,ys="undefined"!=typeof global&&global,ti=ri||ys||Fr||qr,rd={},Wi=[],Wf=Qt({\u0275cmp:Qt}),xm=Qt({\u0275dir:Qt}),fh=Qt({\u0275pipe:Qt}),gv=Qt({\u0275mod:Qt}),M1=Qt({\u0275loc:Qt}),Dl=Qt({\u0275fac:Qt}),ph=Qt({__NG_ELEMENT_ID__:Qt});let D1=0;function wn(n){return Ce(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===He.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||Wi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Ht.Emulated,id:"c",styles:n.styles||Wi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=D1++,i.inputs=vv(n.inputs,t),i.outputs=vv(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(mv):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(_v):null,i})}function mv(n){return Di(n)||function(n){return n[xm]||null}(n)}function _v(n){return function(n){return n[fh]||null}(n)}const yv={};function gn(n){return Ce(()=>{const e={type:n.type,bootstrap:n.bootstrap||Wi,declarations:n.declarations||Wi,imports:n.imports||Wi,exports:n.exports||Wi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(yv[n.id]=n.type),e})}function vv(n,e){if(null==n)return rd;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const Lt=wn;function Ls(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Di(n){return n[Wf]||null}function xo(n,e){const t=n[gv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Ho(n){return Array.isArray(n)&&"object"==typeof n[1]}function Go(n){return Array.isArray(n)&&!0===n[1]}function Tm(n){return 0!=(8&n.flags)}function ld(n){return 2==(2&n.flags)}function cd(n){return 1==(1&n.flags)}function ga(n){return null!==n.template}function bv(n){return 0!=(512&n[2])}function mc(n,e){return n.hasOwnProperty(Dl)?n[Dl]:null}class Rm{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function qi(){return Sv}function Sv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),L1}function L1(){const n=st(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===rd)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function k1(n,e,t,i){const r=st(n)||function(n,e){return n[bh]=e}(n,{previous:rd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new Rm(l&&l.currentValue,e,o===rd),n[i]=e}qi.ngInherit=!0;const bh="__ngSimpleChanges__";function st(n){return n[bh]||null}let Bi;function or(n){return!!n.listen}const au={createRenderer:(n,e)=>void 0!==Bi?Bi:"undefined"!=typeof document?document:void 0};function vr(n){for(;Array.isArray(n);)n=n[0];return n}function Ys(n,e){return vr(e[n.index])}function Pm(n,e){return n.data[e]}function Bs(n,e){const t=e[n];return Ho(t)?t:t[0]}function Ol(n){return 4==(4&n[2])}function dd(n){return 128==(128&n[2])}function _a(n,e){return null==e?null:n[e]}function Fm(n){n[18]=0}function Yf(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Ln={lFrame:cu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Cv(){return Ln.bindingsEnabled}function Ft(){return Ln.lFrame.lView}function fi(){return Ln.lFrame.tView}function ya(n){return Ln.lFrame.contextLView=n,n[8]}function ts(){let n=Lm();for(;null!==n&&64===n.type;)n=n.parent;return n}function Lm(){return Ln.lFrame.currentTNode}function Qa(n,e){const t=Ln.lFrame;t.currentTNode=n,t.isParent=e}function Br(){return Ln.lFrame.isParent}function xh(){return Ln.isInCheckNoChangesMode}function Qf(n){Ln.isInCheckNoChangesMode=n}function hd(n,e){const t=Ln.lFrame;t.bindingIndex=t.bindingRootIndex=n,km(e)}function km(n){Ln.lFrame.currentDirectiveIndex=n}function Av(){return Ln.lFrame.currentQueryIndex}function jm(n){Ln.lFrame.currentQueryIndex=n}function Jf(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function fd(n,e,t){if(t&yn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&yn.Host||(r=Jf(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ln.lFrame=Se();return i.currentTNode=e,i.lView=n,!0}function Th(n){const e=Se(),t=n[1];Ln.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Se(){const n=Ln.lFrame,e=null===n?null:n.child;return null===e?cu(n):e}function cu(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Mh(){const n=Ln.lFrame;return Ln.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const To=Mh;function oi(){const n=Mh();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Xs(){return Ln.lFrame.selectedIndex}function uo(n){Ln.lFrame.selectedIndex=n}function ep(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class Dh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function ip(n,e,t){const i=or(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let gd=!0;function rp(n){const e=gd;return gd=n,e}let $m=0;function js(n,e){const t=sp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,Wm(i.data,n),Wm(e,null),Wm(i.blueprint,null));const r=Rh(n,e),s=n.injectorIndex;if(Mv(r)){const o=pd(r),a=Ja(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function Wm(n,e){n.push(0,0,0,0,0,0,0,0,e)}function sp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Rh(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function yc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(ph)&&(i=t[ph]),null==i&&(i=t[ph]=$m++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Ov:e}(t);if("function"==typeof s){if(!fd(e,n,i))return i&yn.Host?qm(r,t,i):Iv(e,t,i,r);try{const o=s(i);if(null!=o||i&yn.Optional)return o;fn(t)}finally{To()}}else if("number"==typeof s){let o=null,a=sp(n,e),l=-1,c=i&yn.Host?e[16][6]:null;for((-1===a||i&yn.SkipSelf)&&(l=-1===a?Rh(n,e):e[a+8],-1!==l&&Nh(i,!1)?(o=e[1],a=pd(l),e=Ja(l,e)):a=-1);-1!==a;){const d=e[1];if(op(s,a,d.data)){const f=ws(a,e,t,o,i,c);if(f!==Rv)return f}l=e[a+8],-1!==l&&Nh(i,e[1].data[a+8]===c)&&op(s,a,e)?(o=d,a=pd(l),e=Ja(l,e)):a=-1}}}return Iv(e,t,i,r)}const Rv={};function Ov(){return new Wo(ts(),Ft())}function ws(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=md(a,o,t,null==i?ld(a)&&gd:i!=o&&0!=(3&a.type),r&yn.Host&&s===a);return null!==d?_d(e,o,d,a):Rv}function md(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&ga(g)&&g.type===t)return l}return null}function _d(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Dh}(r)){const o=r;o.resolving&&function(n,e){throw new Qe("200",`Circular dependency in DI detected for ${n}`)}($t(s[t]));const a=rp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ha(o.injectImpl):null;fd(n,i,yn.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=Sv(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ha(l),rp(a),o.resolving=!1,To()}}return r}function op(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Dl]||Es(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Dl]||Es(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Es(n){return ke(n)?()=>{const e=Es(ve(n));return e&&e()}:mc(n)}const vd="__parameters__";function Sa(n,e,t){return Ce(()=>{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(vd)?l[vd]:Object.defineProperty(l,vd,{value:[]})[vd];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Vt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=We({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}function qo(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Ko(t,e):e(t))}function Fh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Pl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Mo(n,e,t){let i=Ss(n,e);return i>=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function Jm(n,e){const t=Ss(n,e);if(t>=0)return n[1|t]}function Ss(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):rt(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Sc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Ec]=null,n}const xd=Sd(Sa("Inject",n=>({token:n})),-1),Yr=Sd(Sa("Optional"),8),il=Sd(Sa("SkipSelf"),4);const m_="__ngContext__";function xs(n,e){n[m_]=e}function __(n){const e=function(n){return n[m_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function xp(n){return n.ngOriginalError}function LC(n,...e){n.error(...e)}class Zo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||LC}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(xp(e)):null}_findOriginalError(e){let t=e&&xp(e);for(;t&&xp(t);)t=xp(t);return t||null}}const db=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(ti))();function sl(n){return n instanceof Function?n():n}var Ro=(()=>((Ro=Ro||{})[Ro.Important=1]="Important",Ro[Ro.DashCase=2]="DashCase",Ro))();function E_(n,e){return undefined(n,e)}function zh(n){const e=n[3];return Go(e)?e[3]:e}function Id(n){return mb(n[13])}function x_(n){return mb(n[4])}function mb(n){for(;null!==n&&!Go(n);)n=n[4];return n}function Rd(n,e,t,i,r){if(null!=i){let s,o=!1;Go(i)?s=i:Ho(i)&&(o=!0,i=i[0]);const a=vr(i);0===n&&null!==t?null==r?wb(e,t,a):ol(e,t,a,r||null,!0):1===n&&null!==t?ol(e,t,a,r||null,!0):2===n?function(n,e,t){const i=Tp(n,e);i&&function(n,e,t,i){or(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==vr(t)&&Rd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Pl(n,10+e);!function(n,e){Od(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function M_(n,e){if(!(256&e[2])){const t=e[11];or(t)&&t.destroyNode&&Od(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Ap(n[1],n);for(;e;){let t=null;if(Ho(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Ho(e)&&Ap(e[1],e),e=e[3];null===e&&(e=n),Ho(e)&&Ap(e[1],e),t=e&&e[4]}e=t}}(e)}}function Ap(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==Gh(g,c,0)||2&i&&c!==p){if(Ca(i))return!1;o=!0}}}}else{if(!o&&!Ca(i)&&!Ca(l))return!1;if(o&&Ca(l))continue;o=!1,i=l|1&i}}return Ca(i)||o}function Ca(n){return 0==(1&n)}function cA(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!Ca(o)&&(e+=Pb(s,r),r=""),i=o,s=s||!Ca(i);t++}return""!==r&&(e+=Pb(s,r)),e}const Cn={};function al(n,e){return n<<17|e<<2}function Mn(n){return n>>17&32767}function br(n){return 2|n}function jl(n){return(131068&n)>>2}function ll(n,e){return-131069&n|e<<2}function P_(n){return 1|n}function Gb(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&function(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&tp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&np(e,s,0,t)}uo(t)}(n,e,20,xh()),t(i,r)}finally{uo(s)}}function Kh(n,e,t){!Cv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||js(t,e),xs(i,e);const o=t.initialInputs;for(let a=r;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function tw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function nw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function kA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&W_(t)}}function W_(n){for(let i=Id(n);null!==i;i=x_(i))for(let r=10;r0&&W_(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&W_(r)}}function GA(n,e){const t=Bs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function sw(n){return n[7]||(n[7]=[])}function kp(n){return n.cleanup||(n.cleanup=[])}function Z_(n,e){const t=n[9],i=t?t.get(Zo,null):null;i&&i.handleError(e)}function ow(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Ko([e],a=>this.processInjectorType(a,[],s)),this.records.set(Bd,Su(void 0,this));const o=this.records.get(Eu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:rt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=gu,i=yn.Default){this.assertNotDestroyed();const r=Ed(this),s=ha(void 0);try{if(!(i&yn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Vt}(e)&&pn(e);a=l&&this.injectableDefInScope(l)?Su(iy(e),Yh):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&yn.Self?aw():this.parent).get(e,t=i&yn.Optional&&t===gu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Ec]=o[Ec]||[]).unshift(rt(e)),r)throw o;return Qs(o,e,"R3InjectorError",this.source)}throw o}finally{ha(s),Ed(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(rt(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=ve(e)))return!1;let r=Tl(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=Tl(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Ko(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||Wi))}}this.injectorDefTypes.add(o);const l=mc(o)||(()=>new o);this.records.set(o,Su(l,Yh));const c=r.providers;if(null!=c&&!a){const d=e;Ko(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Dc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return uw(n)?Su(void 0,n.useValue):Su(function(n,e,t){let i;if(Dc(n)){const r=ve(n);return mc(r)||iy(r)}if(uw(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(..._u(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Ie(ve(n.useExisting));else{const r=ve(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return mc(r)||iy(r);i=()=>new r(..._u(n.deps))}return i}(n),Yh)}(e);if(Dc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Su(void 0,Yh,!0),o.factory=()=>_u(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===Yh&&(t.value=QA,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ve(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function iy(n){const e=pn(n),t=null!==e?e.factory:mc(n);if(null!==t)return t;if(n instanceof Vt)throw new Error(`Token ${rt(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=function(n,e){const t=[];for(let i=0;it.factory(n):()=>new n}(n);throw new Error("unreachable")}function Su(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function uw(n){return null!==n&&"object"==typeof n&&hp in n}function Dc(n){return"function"==typeof n}const dw=function(n,e,t){return function(n,e=null,t=null,i){const r=lw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Hn{static create(e,t){return Array.isArray(e)?dw(e,t,""):dw(e.providers,e.parent,e.name||"")}}function R7(n,e){ep(__(n)[1],ts())}function Nn(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(ga(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=dT(n.inputs),o.declaredInputs=dT(n.declaredInputs),o.outputs=dT(n.outputs);const a=r.hostBindings;a&&F7(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&N7(n,l),c&&P7(n,c),Ka(n.inputs,r.inputs),Ka(n.declaredInputs,r.declaredInputs),Ka(n.outputs,r.outputs),ga(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Ih(r.hostAttrs,t=Ih(t,r.hostAttrs))}}(i)}function dT(n){return n===rd?{}:n===Wi?[]:n}function N7(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function P7(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function F7(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Hn.THROW_IF_NOT_FOUND=gu,Hn.NULL=new eo,Hn.\u0275prov=We({token:Hn,providedIn:"any",factory:()=>Ie(Bd)}),Hn.__NG_ELEMENT_ID__=-1;let mw=null;function jp(){if(!mw){const n=ti.Symbol;if(n&&n.iterator)mw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(vr(Ne[i.index])):i.index;if(or(t)){let Ne=null;if(!a&&l&&(Ne=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==Ne)(Ne.__ngLastListenerFn__||Ne).__ngNextListenerFn__=s,Ne.__ngLastListenerFn__=s,g=!1;else{s=yT(i,e,f,s,!1);const Ge=t.listen(W,r,s);p.push(s,Ge),d&&d.push(r,ge,G,G+1)}}else s=yT(i,e,f,s,!0),W.addEventListener(r,s,o),p.push(s),d&&d.push(r,ge,G,o)}else s=yT(i,e,f,s,!1);const _=i.outputs;let x;if(g&&null!==_&&(x=_[r])){const A=x.length;if(A)for(let W=0;W0;)e=e[15],n--;return e}(n,Ln.lFrame.contextLView))[8]}(n)}function tL(n,e,t,i,r){const s=n[t+1],o=null===e;let a=i?Mn(s):jl(s),l=!1;for(;0!==a&&(!1===l||o);){const d=n[a+1];yW(n[a],e)&&(l=!0,n[a+1]=i?P_(d):br(d)),a=i?Mn(d):jl(d)}l&&(n[t+1]=i?br(s):P_(s))}function yW(n,e){return null===n||null==e||(Array.isArray(n)?n[1]:n)===e||!(!Array.isArray(n)||"string"!=typeof e)&&Ss(n,e)>=0}const As={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function nL(n){return n.substring(As.key,As.keyEnd)}function iL(n,e){const t=As.textEnd;return t===e?-1:(e=As.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,As.key=e,t),Zp(n,e,t))}function Zp(n,e,t){for(;e0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Mn(n[a+1]);n[i+1]=al(p,a),0!==p&&(n[p+1]=ll(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=al(a,0),0!==a&&(n[a+1]=ll(n[a+1],i)),a=i;else n[i+1]=al(l,0),0===a?a=i:n[l+1]=ll(n[l+1],i),l=i;c&&(n[i+1]=br(n[i+1])),tL(n,d,i,!0),tL(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ss(s,e)>=0&&(t[i+1]=P_(t[i+1]))}(e,d,n,i,s),o=al(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}(r,null,s,i);const o=Ft();if(t!==Cn&&go(o,s,t)){const a=r.data[Xs()];if(fL(a,i)&&!lL(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=ot(l,t||"")),_T(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===Cn&&(r=Wi);let l=0,c=0,d=0=0;t=iL(e,t))Mo(n,nL(e),!0)}function lL(n,e){return e>=n.expandoStartIndex}function bT(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===Cn&&(p=f?Wi:void 0);let g=f?Jm(p,i):d===i?p:void 0;if(c&&!Ew(g)&&(g=Jm(l,i)),Ew(g)&&(a=g,o))return a;const _=n[r+1];r=o?Mn(_):jl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=Jm(l,i))}return a}function Ew(n){return void 0!==n}function fL(n,e){return 0!=(n.flags&(e?16:32))}const Zh=void 0;var ZW=["en",[["a","p"],["AM","PM"],Zh],[["AM","PM"],Zh,Zh],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Zh,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Zh,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Zh,"{1} 'at' {0}",Zh],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Jp={};function RL(n){return n in Jp||(Jp[n]=ti.ng&&ti.ng.common&&ti.ng.common.locales&&ti.ng.common.locales[n]),Jp[n]}var rn=(()=>((rn=rn||{})[rn.LocaleId=0]="LocaleId",rn[rn.DayPeriodsFormat=1]="DayPeriodsFormat",rn[rn.DayPeriodsStandalone=2]="DayPeriodsStandalone",rn[rn.DaysFormat=3]="DaysFormat",rn[rn.DaysStandalone=4]="DaysStandalone",rn[rn.MonthsFormat=5]="MonthsFormat",rn[rn.MonthsStandalone=6]="MonthsStandalone",rn[rn.Eras=7]="Eras",rn[rn.FirstDayOfWeek=8]="FirstDayOfWeek",rn[rn.WeekendRange=9]="WeekendRange",rn[rn.DateFormat=10]="DateFormat",rn[rn.TimeFormat=11]="TimeFormat",rn[rn.DateTimeFormat=12]="DateTimeFormat",rn[rn.NumberSymbols=13]="NumberSymbols",rn[rn.NumberFormats=14]="NumberFormats",rn[rn.CurrencyCode=15]="CurrencyCode",rn[rn.CurrencySymbol=16]="CurrencySymbol",rn[rn.CurrencyName=17]="CurrencyName",rn[rn.Currencies=18]="Currencies",rn[rn.Directionality=19]="Directionality",rn[rn.PluralCase=20]="PluralCase",rn[rn.ExtraData=21]="ExtraData",rn))();const xw="en-US";let OL=xw;function ET(n){Z(n,"Expected localeId to be defined"),"string"==typeof n&&(OL=n.toLowerCase().replace(/_/g,"-"))}class r2{}const o2="ngComponent";class Z9{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[o2]=n,e}(e)}}class fl{}function Dw(...n){}function tg(n,e){return new An(Ys(n,e))}fl.NULL=new Z9;const tq=function(){return tg(ts(),Ft())};let An=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=tq,n})();function a2(n){return n instanceof An?n.nativeElement:n}class Jh{}let IT=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class Au{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const l2=new Au("12.2.5");class c2{constructor(){}supports(e){return ly(e)}create(e){return new aq(e)}}const oq=(n,e)=>e;class aq{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||oq}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new lq(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new u2),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new u2),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class lq{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class cq{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class u2{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new cq,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function d2(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new dq(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class dq{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function f2(){return new ng([new c2])}let ng=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||f2()),deps:[[n,new il,new Yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=We({token:n,providedIn:"root",factory:f2}),n})();function p2(){return new ig([new h2])}let ig=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||p2()),deps:[[n,new il,new Yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=We({token:n,providedIn:"root",factory:p2}),n})();function Iw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(vr(s)),Go(s))for(let a=10;a-1&&(T_(e,i),Pl(t,i))}this._attachedToViewContainer=!1}M_(this._lView[1],this._lView)}onDestroy(e){Kb(this._lView[1],this._lView,null,e)}markForCheck(){q_(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Y_(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Qf(!0);try{Y_(n,e,t)}finally{Qf(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Od(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class fq extends _y{constructor(e){super(e),this._view=e}detectChanges(){rw(this._view)}checkNoChanges(){!function(n){Qf(!0);try{rw(n)}finally{Qf(!1)}}(this._view)}get context(){return null}}const gq=function(n){return function(n,e,t){if(ld(n)&&!t){const i=Bs(n.index,e);return new _y(i,i)}return 47&n.type?new _y(e[16],e):null}(ts(),Ft(),16==(16&n))};let is=(()=>{class n{}return n.__NG_ELEMENT_ID__=gq,n})();const yq=[new h2],bq=new ng([new c2]),wq=new ig(yq),Sq=function(){return Rw(ts(),Ft())};let Po=(()=>{class n{}return n.__NG_ELEMENT_ID__=Sq,n})();const xq=Po,Cq=class extends xq{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=Wh(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),qh(t,i,e),new _y(i)}};function Rw(n,e){return 4&n.type?new Cq(e,n,tg(n,e)):null}class Nc{}const Mq=function(){return y2(ts(),Ft())};let Ts=(()=>{class n{}return n.__NG_ELEMENT_ID__=Mq,n})();const Iq=Ts,m2=class extends Iq{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return tg(this._hostTNode,this._hostLView)}get injector(){return new Wo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Rh(this._hostTNode,this._hostLView);if(Mv(e)){const t=Ja(e,this._hostLView),i=pd(e);return new Wo(t[1].data[i+8],t)}return new Wo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=_2(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Nc,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Go(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new m2(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),idb});class V2 extends r2{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(pA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return j2(this.componentDef.inputs)}get outputs(){return j2(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,ag,r);return s!==ag||i===ag?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Jh,au),a=s.get(IT,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(or(n))return n.selectRootElement(e,t===Ht.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):A_(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?"http://www.w3.org/2000/svg":"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||db,clean:YA,playerHandler:e||null,flags:0}}(),g=Fp(0,null,null,1,0,null,null,null,null,null),_=Wh(null,g,p,f,null,null,o,l,a,s);let x,A;Th(_);try{const W=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Pd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(Bp(l,c,!0),null!==n&&(ip(r,n,c),null!==l.classes&&O_(r,n,l.classes),null!==l.styles&&Ib(r,n,l.styles)));const d=i.createRenderer(n,e),f=Wh(t,Pp(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(yc(js(l,t),o,e.type),nw(o,l),H_(l,t.length,1)),Lp(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)ip(l,d,["ng-version",l2.full]);else{const{attrs:G,classes:ge}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&O_(l,d,ge.join(" "))}if(A=Pm(g,20),void 0!==t){const G=A.projection=[];for(let ge=0;gel(o,e)),e.contentQueries){const l=ts();e.contentQueries(1,o,l.directiveStart)}const a=ts();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(uo(a.index),ew(t[1],a,0,a.directiveStart,a.directiveEnd,e),tw(e,o)),o}(W,this.componentDef,_,p,[R7]),qh(g,_,null)}finally{oi()}return new DK(this.componentType,x,tg(A,_),_,A)}}class DK extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new fq(r),this.componentType=e}get injector(){return new Wo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const lg=new Map;class OK extends Nc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new B2(this);const i=xo(e),r=function(n){return n[M1]||null}(e);r&&ET(r),this._bootstrapComponents=sl(i.bootstrap),this._r3Injector=lw(e,t,[{provide:Nc,useValue:this},{provide:fl,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Hn.THROW_IF_NOT_FOUND,i=yn.Default){return e===Hn||e===Nc||e===Bd?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class GT extends class{}{constructor(e){super(),this.moduleType=e,null!==xo(e)&&function(n){const e=new Set;!function t(i){const r=xo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${rt(e)} vs ${rt(e.name)}`)}(s,lg.get(s),i),lg.set(s,i));const o=sl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new OK(this.moduleType,e)}}function H2(n,e,t,i,r,s){const o=e+t;return go(n,o,r)?function(n,e,t){return n[e]=t}(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===Cn?void 0:t}(n,o+1)}function Ty(n,e,t){const i=n+20,r=Ft(),s=function(n,e){return n[e]}(r,i);return function(n,e){zl.isWrapped(e)&&(e=zl.unwrap(e),n[Ln.lFrame.bindingIndex]=Cn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?H2(r,function(){const n=Ln.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),e,s.transform,t,s):s.transform(t))}function $T(n){return e=>{setTimeout(n,void 0,e)}}const cn=class extends ee{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=$T(l),a&&(a=$T(a)),c&&(c=$T(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof S&&e.add(d),d}};function YK(){return this._results[jp()]()}class nf{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=jp(),i=nf.prototype;i[t]||(i[t]=YK)}get changes(){return this._changes||(this._changes=new cn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=qo(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=Dw,this.reject=Dw,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Ie(rf,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Ry=new Vt("AppId"),RY={provide:Ry,useFactory:function(){return`${iM()}${iM()}${iM()}`},deps:[]};function iM(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const mk=new Vt("Platform Initializer"),Pc=new Vt("Platform ID"),Bw=new Vt("appBootstrapListener");let jw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Tu=new Vt("LocaleId"),_k=new Vt("DefaultCurrencyCode");class NY{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const rM=function(n){return new GT(n)},PY=rM,FY=function(n){return Promise.resolve(rM(n))},yk=function(n){const e=rM(n),i=sl(xo(n).declarations).reduce((r,s)=>{const o=Di(s);return o&&r.push(new V2(o)),r},[]);return new NY(e,i)},LY=yk,kY=function(n){return Promise.resolve(yk(n))};let sf=(()=>{class n{constructor(){this.compileModuleSync=PY,this.compileModuleAsync=FY,this.compileModuleAndAllComponentsSync=LY,this.compileModuleAndAllComponentsAsync=kY}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const vk=new Vt("compilerOptions"),jY=(()=>Promise.resolve(0))();function sM(n){"undefined"==typeof Zone?jY.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class mn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new cn(!1),this.onMicrotaskEmpty=new cn(!1),this.onStable=new cn(!1),this.onError=new cn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=ti.requestAnimationFrame,e=ti.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(ti,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,aM(n),n.isCheckStableRunning=!0,oM(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),aM(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return bk(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),wk(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return bk(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),wk(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,aM(n),oM(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!mn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(mn.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,UY,Dw,Dw);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const UY={};function oM(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function aM(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function bk(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function wk(n){n._nesting--,oM(n)}class GY{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new cn,this.onMicrotaskEmpty=new cn,this.onStable=new cn,this.onError=new cn}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let lM=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{mn.assertNotInAngularZone(),sM(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())sM(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Ek=(()=>{class n{constructor(){this._applications=new Map,cM.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return cM.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class $Y{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let cM=new $Y,Sk=!0,xk=!1;function Da(){return xk=!0,Sk}let Kl;const Ck=new Vt("AllowMultipleToken");function Ak(n,e,t=[]){const i=`Platform: ${e}`,r=new Vt(i);return(s=[])=>{let o=dM();if(!o||o.injector.get(Ck,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Eu,useValue:"platform"});!function(n){if(Kl&&!Kl.destroyed&&!Kl.injector.get(Ck,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Kl=n.get(Tk);const e=n.get(mk,null);e&&e.forEach(t=>t())}(Hn.create({providers:a,name:i}))}return function(n){const e=dM();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function dM(){return Kl&&!Kl.destroyed?Kl:null}let Tk=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new GY:("zone.js"===n?void 0:n)||new mn({enableLongStackTrace:Da(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:mn,useValue:a}];return a.run(()=>{const c=Hn.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Zo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{hM(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return uy(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(ug);return p.runInitializers(),p.donePromise.then(()=>(ET(d.injector.get(Tu,xw)||xw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=Mk({},i);return function(n,e,t){const i=new GT(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(zd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${rt(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Mk(n,e){return Array.isArray(e)?e.reduce(Mk,n):Object.assign(Object.assign({},n),e)}let zd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new F(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new F(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{mn.assertNotInAngularZone(),sM(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{mn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Pn(a,l.pipe(ms()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof r2?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Nc),a=r.create(Hn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(lM,null),d=c&&a.injector.get(Ek);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),hM(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;hM(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Bw,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn),Ie(Hn),Ie(Zo),Ie(fl),Ie(ug))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function hM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const yX=Ak(null,"core",[{provide:Pc,useValue:"unknown"},{provide:Tk,deps:[Hn]},{provide:Ek,deps:[]},{provide:jw,deps:[]}]),SX=[{provide:zd,useClass:zd,deps:[mn,Hn,Zo,fl,ug]},{provide:AK,deps:[mn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:ug,useClass:ug,deps:[[new Yr,rf]]},{provide:sf,useClass:sf,deps:[]},RY,{provide:ng,useFactory:function(){return bq},deps:[]},{provide:ig,useFactory:function(){return wq},deps:[]},{provide:Tu,useFactory:function(n){return ET(n=n||"undefined"!=typeof $localize&&$localize.locale||xw),n},deps:[[new xd(Tu),new Yr,new il]]},{provide:_k,useValue:"USD"}];let CX=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(zd))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:SX}),n})(),Qw=null;function Fc(){return Qw}const ln=new Vt("DocumentToken");let lf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:xQ,token:n,providedIn:"platform"}),n})();function xQ(){return Ie(n3)}let n3=(()=>{class n extends lf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Fc().getBaseHref(this._doc)}onPopState(t){const i=Fc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Fc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){r3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){r3()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({factory:AQ,token:n,providedIn:"platform"}),n})();function r3(){return!!window.history.pushState}function AQ(){return new n3(Ie(ln))}function Du(n){return n&&"?"!==n[0]?"?"+n:n}let cf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:TQ,token:n,providedIn:"root"}),n})();function TQ(n){const e=Ie(ln).location;return new o3(Ie(lf),e&&e.origin||"")}const MM=new Vt("appBaseHref");let o3=(()=>{class n extends cf{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return function(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Du(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Du(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Du(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(lf),Ie(MM,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();var ds=(()=>((ds=ds||{})[ds.Zero=0]="Zero",ds[ds.One=1]="One",ds[ds.Two=2]="Two",ds[ds.Few=3]="Few",ds[ds.Many=4]="Many",ds[ds.Other=5]="Other",ds))();const kQ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=RL(e);if(t)return t;const i=e.split("-")[0];if(t=RL(i),t)return t;if("en"===i)return ZW;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[rn.PluralCase]};class aE{}let hZ=(()=>{class n extends aE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(kQ(i||this.locale)(t)){case ds.Zero:return"zero";case ds.One:return"one";case ds.Two:return"two";case ds.Few:return"few";case ds.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Tu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();let Ru=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new mZ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){y3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){y3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(Me(Ts),Me(Po))},n.\u0275dir=Lt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class mZ{constructor(){this.$implicit=null,this.ngIf=null}}function y3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class bZ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class wZ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const EZ=new wZ,SZ=new bZ;let cE=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(uy(t))return EZ;if(GF(t))return SZ;throw function(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${rt(n)}'`)}(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(Me(is,16))},n.\u0275pipe=Ls({name:"async",type:n,pure:!1}),n})(),Ws=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:[{provide:aE,useClass:hZ}]}),n})();const x3="browser";class UM extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){Qw||(Qw=n)}(new UM)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(By=By||document.querySelector("base"),By?By.getAttribute("href"):null);return null==t?null:function(n){uE=uE||document.createElement("a"),uE.setAttribute("href",n);const e=uE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){By=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}(document.cookie,e)}}let uE,By=null;const M3=new Vt("TRANSITION_ID"),KZ=[{provide:rf,useFactory:function(n,e,t){return()=>{t.get(ug).donePromise.then(()=>{const i=Fc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},ti.getAllAngularTestabilities=()=>e.getAllTestabilities(),ti.getAllAngularRootElements=()=>e.getAllRootElements(),ti.frameworkStabilizers||(ti.frameworkStabilizers=[]),ti.frameworkStabilizers.push(i=>{const r=ti.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Fc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let YZ=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const jy=new Vt("EventManagerPlugins");let hE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Vy=(()=>{class n extends I3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(R3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(R3))}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function R3(n){Fc().remove(n)}const GM={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},$M=/%COMP%/g;function fE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let pE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new WM(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Ht.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new uJ(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Ht.ShadowDom:return new dJ(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=fE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Ie(hE),Ie(Vy),Ie(Ry))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class WM{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(GM[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=GM[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=GM[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(Ro.DashCase|Ro.Important)?e.style.setProperty(t,i,r&Ro.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Ro.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,P3(i)):this.eventManager.addEventListener(e,t,P3(i))}}class uJ extends WM{constructor(e,t,i,r){super(e),this.component=i;const s=fE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace($M,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace($M,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class dJ extends WM{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=fE(r.id,r.styles,[]);for(let o=0;o{class n extends HM{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const k3=["alt","control","meta","shift"],vJ={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},B3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},bJ={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let wJ=(()=>{class n extends HM{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Fc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(k3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&B3.hasOwnProperty(e)&&(e=B3[e]))}return vJ[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),k3.forEach(s=>{s!=r&&bJ[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const DJ=Ak(yX,"browser",[{provide:Pc,useValue:x3},{provide:mk,useValue:function(){UM.makeCurrent(),zM.init()},multi:!0},{provide:ln,useFactory:function(){return function(n){Bi=n}(document),document},deps:[]}]),IJ=[[],{provide:Eu,useValue:"root"},{provide:Zo,useFactory:function(){return new Zo},deps:[]},{provide:jy,useClass:hJ,multi:!0,deps:[ln,mn,Pc]},{provide:jy,useClass:wJ,multi:!0,deps:[ln]},[],{provide:pE,useClass:pE,deps:[hE,Vy,Ry]},{provide:Jh,useExisting:pE},{provide:I3,useExisting:Vy},{provide:Vy,useClass:Vy,deps:[ln]},{provide:lM,useClass:lM,deps:[mn]},{provide:hE,useClass:hE,deps:[jy,mn]},{provide:class{},useClass:YZ,deps:[]},[]];let YM=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Ry,useValue:t.appId},{provide:M3,useExisting:Ry},KZ]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:IJ,imports:[Ws,CX]}),n})();"undefined"!=typeof window&&window;class BJ extends S{constructor(e,t){super()}schedule(e,t=0){return this}}class gE extends BJ{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let V3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Jl extends V3{constructor(e,t=V3.now){super(e,()=>Jl.delegate&&Jl.delegate!==this?Jl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Jl.delegate&&Jl.delegate!==this?Jl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const UJ=new class extends Jl{}(class extends gE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Lc=new F(n=>n.complete());function mE(n){return n?function(n){return new F(e=>n.schedule(()=>e.complete()))}(n):Lc}function an(...n){let e=n[n.length-1];return Te(e)?(n.pop(),Be(n,e)):Tn(n)}function gg(n,e){return new F(e?t=>e.schedule(HJ,0,{error:n,subscriber:t}):t=>t.error(n))}function HJ({error:n,subscriber:e}){e.error(n)}class ra{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return an(this.value);case"E":return gg(this.error);case"C":return mE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ra("N",e):ra.undefinedValueNotification}static createError(e){return new ra("E",void 0,e)}static createComplete(){return ra.completeNotification}}ra.completeNotification=new ra("C"),ra.undefinedValueNotification=new ra("N",void 0);class _E extends y{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(_E.dispatch,this.delay,new $J(e,this.destination)))}_next(e){this.scheduleMessage(ra.createNext(e))}_error(e){this.scheduleMessage(ra.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ra.createComplete()),this.unsubscribe()}}class $J{constructor(e,t){this.notification=e,this.destination=t}}class mg extends ee{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new WJ(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new U;if(this.isStopped||this.hasError?o=S.EMPTY:(this.observers.push(e),o=new ie(this,e)),r&&e.add(e=new _E(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class WJ{constructor(e,t){this.time=e,this.value=t}}function Ur(n,e){return"function"==typeof e?t=>t.pipe(Ur((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new qJ(n))}class qJ{constructor(e){this.project=e}call(e,t){return t.subscribe(new KJ(e,this.project))}}class KJ extends fe{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new wt(this),r=this.destination;r.add(i),this.innerSubscription=R(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const yE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return yE.schedule(n,0);if(void 0===window.requestAnimationFrame)return yE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let QM;function ree(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!QM){const t=Element.prototype;QM=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&QM.call(n,e)}(n,r)||(i=s,0))),i}class oee{constructor(e,t){this.componentFactory=t.get(fl).resolveComponentFactory(e)}create(e){return new aee(this.componentFactory,e)}}class aee{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new mg(1),this.events=this.eventEmitters.pipe(Ur(i=>Pn(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(mn),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=yE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Hn.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(me(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=yE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new Rm(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class lee extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const uee={initialConfig:{},parse:{},rename:{}};class dee{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},uee),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let hee=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new dee(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=Lt({type:n,features:[qi]}),n})();var ZM;const Uy={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(ZM=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==ZM?ZM:""},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function Ia(n,e,t,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function z3(n,e){return function(t,i){e(t,i,n)}}function ec(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function ir(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function $3(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function eD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||$3()}const W3="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",bE=eD();class mee{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function tD(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const q3={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function K3(n){return"string"==typeof n?q3[n.toUpperCase()]||q3.WHITE:n}function wE(n,e){if(!n)throw new Error(e||"Assertion failed")}const tc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},zy=tc.window||tc.self||tc.global,Y3=tc.process||{};function _g(){let n;if(bE&&zy.performance)n=zy.performance.now();else if(Y3.hrtime){const e=Y3.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const yg={debug:bE&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},See={enabled:!0,level:0};function yl(){}const X3={},Q3={once:!0};function xee(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let nD=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=W3,this._startTs=_g(),this._deltaTs=_g(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new mee("__probe-".concat(this.id,"__"),See),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((_g()-this._startTs).toPrecision(10))}getDelta(){return Number((_g()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){wE(t,i)}warn(t){return this._getLogFunction(0,t,yg.warn,arguments,Q3)}error(t){return this._getLogFunction(0,t,yg.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,yg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,yg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,yg.debug||yg.info,arguments,Q3)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||yl,r&&[r],{tag:xee(i)}):yl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?bE?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=tD(r,e,t);console.log(...s)},r.src=n,yl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...tD(n,e,t)),yl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...tD(r,e,t)),r.src=n.toDataURL(),yl}return yl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=tt(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):yl}({image:r,message:s,scale:o}):yl}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||yl)}group(t,i,r={collapsed:!1}){r=J3({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||yl)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Z3(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=J3({logLevel:t,message:i,args:s,opts:o}),wE(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=_g();const a=o.tag||o.message;if(o.once){if(X3[a])return yl;X3[a]=_g()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!bE&&"string"==typeof n&&(e&&(e=K3(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=K3(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return yl}}return n.VERSION=W3,n})();function Z3(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return wE(Number.isFinite(e)&&e>=0),e}function J3(n){const{logLevel:e,message:t}=n;n.logLevel=Z3(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return wE("string"===r||"object"===r),Object.assign(n,n.opts)}const Oi=new nD({id:"deck"}),Mi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mi,"IDENTITY",{get:()=>Oi.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},eB={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},un=new nD({id:"luma.gl"});function ko(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function EE(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function pi(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function SE(n){return ko(EE(n),"Invalid WebGLRenderingContext"),n}function Bo(n){return ko(pi(n),"Requires WebGL2"),n}var Sr=tt(761);const Hy={};const Gy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Sr.CO.console&&Sr.CO.console.log&&Sr.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};hf.prototype.VERTEX_ARRAY_BINDING_OES=34229,hf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;ipi(n)?void 0:0,$ee={3074:n=>pi(n)?void 0:36064,35723:n=>pi(n)?void 0:4352,35977:fr,32937:fr,36795:(n,e)=>{const t=pi(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(iB);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(iB);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:fr,35071:fr,37447:fr,36063:(n,e)=>{if(!pi(n)){const t=n.getExtension(nB);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:fr,35374:fr,35377:fr,34852:n=>{if(!pi(n)){const e=n.getExtension(nB);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(tB)?2147483647:65535,33001:n=>n.getExtension(tB)?16777216:65535,33e3:n=>16777216,37157:fr,35373:fr,35657:fr,36183:fr,37137:fr,34045:fr,35978:fr,35979:fr,35968:fr,35376:fr,35375:fr,35659:fr,37154:fr,35371:fr,35658:fr,35076:fr,35077:fr,35380:fr},rB="ANGLE_instanced_arrays",sB={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{ko(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[rB]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){ko(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{ko(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{ko(!1)},deleteQuery:()=>{ko(!1)},beginQuery:()=>{ko(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},iD={readBuffer:(n,e,t)=>{pi(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:pi(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!pi(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!pi(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=$ee[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function rte(n,{extension:e,target:t,target2:i}){const r=sB[e];ko(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new hf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&rte(n,{extension:t,target:n.luma,target2:n})}(n,sB),function(n,{target:e,target2:t}){Object.keys(iD).forEach(i=>{if("function"==typeof iD[i]){const r=n[i]?n[i].bind(n):()=>{},s=iD[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const rD={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},$d=(n,e,t)=>e?n.enable(t):n.disable(t),oB=(n,e,t)=>n.hint(t,e),Ra=(n,e,t)=>n.pixelStorei(t,e);function $y(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const ate={3042:$d,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:$d,2885:(n,e)=>n.cullFace(e),2929:$d,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:$d,35723:oB,36006:(n,e)=>{const t=pi(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:oB,2849:(n,e)=>n.lineWidth(e),32823:$d,32824:"polygonOffset",10752:"polygonOffset",35977:$d,32938:"sampleCoverage",32939:"sampleCoverage",3089:$d,3088:(n,e)=>n.scissor(...e),2960:$d,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:Ra,3317:Ra,37440:Ra,37441:Ra,37443:Ra,3330:Ra,3332:Ra,3331:Ra,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Ra,32878:Ra,3316:Ra,3315:Ra,32877:Ra,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=$y(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=$y(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=$y(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=$y(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=$y(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Qr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const lte={blendEquation:(n,e,t)=>n.blendEquationSeparate(Qr(32777,e,t),Qr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Qr(32969,e,t),Qr(32968,e,t),Qr(32971,e,t),Qr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Qr(32824,e,t),Qr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Qr(32938,e,t),Qr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Qr(2962,e,t),Qr(2967,e,t),Qr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Qr(34816,e,t),Qr(36003,e,t),Qr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Qr(2964,e,t),Qr(2965,e,t),Qr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Qr(34817,e,t),Qr(34818,e,t),Qr(34819,e,t))},aB={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Bc=(n,e)=>n.isEnabled(e),lB={3042:Bc,2884:Bc,2929:Bc,3024:Bc,32823:Bc,32926:Bc,32928:Bc,3089:Bc,2960:Bc,35977:Bc};function cB(n){for(const e in n)return!1;return!0}function cte(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||rD)){const r=e,s=lB[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=lB[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},rD),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){ko(this.stateStack.length>0),Ou(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){ko(void 0!==s);const o=e[s],a=this.cache[s];cte(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function dB(n,e={}){const{enable:t=!0,copyState:i}=e;if(ko(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new hte(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in aB)ute(n,o,aB[o]);uB(n,"getParameter"),uB(n,"isEnabled")}return n.state.enable=t,n}function hB(n){ko(n.state),n.state.pop()}function Ou(n,e){if(ko(EE(n),"setParameters requires a WebGL context"),cB(e))return;const t={};for(const r in e){const s=Number(r),o=ate[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)lte[r](n,e,i)}function nc(n,e,t){if(cB(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||dB(n,{copyState:!1}),n.state.push()}(n),Ou(n,e),i)r=t(n),hB(n);else try{r=t(n)}finally{hB(n)}return r}function vg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function sD(n,e,t=!0){return function(n,e,t,i,r){const s=fB(n[0],e,t);let o=pB(n[1],e,i,r),a=fB(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=pB(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,vg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function fB(n,e,t){return Math.min(Math.round(n*e),t-1)}function pB(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const oD=(0,Sr.jU)(),yte=oD&&"undefined"!=typeof document,gB={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function mB(n={}){ko(oD,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},gB,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(yte&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=aD(r,n),function(n){const e=pi(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);un.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function aD(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},gB,e);const{manageState:t,debug:i}=e;return t&&dB(n,{copyState:!1,log:(...r)=>un.log(1,...r)()}),oD&&i&&(Sr.CO.makeDebugContext?(n=Sr.CO.makeDebugContext(n,e),un.level=Math.max(un.level,1)):un.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function _B(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class yB{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=_B(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(_B()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class lD{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof yB?e:new yB(t,i)),this.stats[t]}}const Wy="8.5.7",ff=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new lD({id:e})),this.stats.get(e)}};if(Sr.CO.luma&&Sr.CO.luma.VERSION!==Wy)throw new Error(`luma.gl - multiple VERSIONs detected: ${Sr.CO.luma.VERSION} vs 8.5.7`);function tn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function cD(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return tn(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Wd(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Sr.CO.luma||((0,Sr.jU)()&&un.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Sr.CO.luma=Sr.CO.luma||{VERSION:Wy,version:Wy,log:un,stats:ff,globals:{modules:{},nodeIO:{}}});const uD={};function jc(n="id"){return uD[n]=uD[n]||1,`${n}-${uD[n]++}`}function vB(n){return tn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function bg(n){let e=!0;for(const t in n){e=!1;break}return e}function bB(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw un.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const wg="Resource subclass must define virtual methods";class Nu{constructor(e,t={}){SE(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||jc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){tn(e=cD(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=pi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=pi(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?Wd(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=Wd(this.gl,o[f]))}}return o}setParameter(e,t){tn(e=cD(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=pi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=cD(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return bB(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(wg)}_deleteHandle(){throw new Error(wg)}_bindHandle(e){throw new Error(wg)}_getOptsFromHandle(){throw new Error(wg)}_getParameter(e,t){throw new Error(wg)}_setParameter(e,t){throw new Error(wg)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=ff.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;ff.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=ff.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=ff.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function dD(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function qy(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function Ite({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return sa.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return sa.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=hD("Accessor",e,Ote)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const EB={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},Nte={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:EB},Pte={removedProps:EB};class rr extends Nu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/sa.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/sa.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=hD("Buffer",e,Nte),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=hD("Buffer",e,Pte))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new sa(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;tn(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Bo(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return Bo(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){Bo(this.gl);const s=qy(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return tn((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(tn(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){tn(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=dD(e);return tn(s),this.setAccessor(new sa(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){tn(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/qy(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new sa(this.accessor,{type:dD(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return un.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return un.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return un.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return un.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new sa(this.accessor,e),this}}const fD={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},SB={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},xB={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},kte=[9729,9728],CB=Sr.CO.WebGLBuffer||function(){};class Eg extends Nu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=fD[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=pi(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=fD[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=jc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(G=>this.initialize(Object.assign({},e,{pixels:G,data:G}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:x=!1,mipmaps:A=!0}=e;const{depth:W=0}=e;return({width:f,height:p,compressed:x,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:x,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=W,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),A&&this._isNPOT()&&(un.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),A=!1,this._updateForNPOT(l)),this.mipmaps=A,this.setImageData({data:t,width:f,height:p,depth:W,format:s,type:_,dataFormat:g,border:o,mipmaps:A,parameters:c,compressed:x}),A&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:x}=this;x.bindTexture(this.target,this.handle);let W,A=null;return({data:c,dataType:A}=this._getDataType({data:c,compressed:_})),nc(this.gl,l,()=>{switch(A){case"null":x.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":x.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":W=Bo(x),W.bindBuffer(35052,c.handle||c),W.texImage2D(t,r,s,f,p,o,g,d,a),W.bindBuffer(35052,null);break;case"browser-object":pi(x)?x.texImage2D(t,r,s,f,p,o,g,d,c):x.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[G,ge]of c.entries())x.compressedTexImage2D(t,G,ge.format,ge.width,ge.height,o,ge.data);break;default:tn(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(SB[this.dataFormat]||4)*(xB[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:x={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),tn(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const A=i;i=A.data,o=A.shape[0],a=A.shape[1]}i instanceof rr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),nc(this.gl,x,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof CB){const A=Bo(this.gl);A.bindBuffer(35052,i),A.texSubImage2D(e,l,r,s,o,a,f,d,g),A.bindBuffer(35052,null)}else pi(this.gl)?Bo(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return un.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof rr?{data:e.handle,dataType:"buffer"}:e instanceof CB?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=fD[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},tn(r,"Could not deduced texture size"),tn(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),tn(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:tn(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(pi(this.gl)||!this.width||!this.height||vB(this.width)&&vB(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===kte.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Bte(n,e){return tn("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class Oa extends Eg{static isSupported(e,t){return Eg.isSupported(e,t)}constructor(e,t={}){SE(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Bte(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const pf="EXT_color_buffer_float",AB={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:pf,bpp:2},33327:{gl2:pf,bpp:4},34842:{gl2:pf,bpp:8},33326:{gl2:pf,bpp:4},33328:{gl2:pf,bpp:8},34836:{gl2:pf,bpp:16},35898:{gl2:pf,bpp:4}};class Sg extends Nu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=pi(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,AB)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return tn(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&pi(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*AB[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const RB="clear: bad arguments";function gD(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),tn(0!==o,RB),nc(n,s,()=>{n.clear(o)})}function OB(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function ni(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){OB(s,i,r,o,a,"next",l)}function a(l){OB(s,i,r,o,a,"throw",l)}o(void 0)})}}const mD=[34069,34070,34071,34072,34073,34074];let $te=(()=>{class n extends Eg{constructor(t,i={}){SE(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return ni(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(mD.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),mD.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&un.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((x,A)=>{t&&i?d.texImage2D(g,A,a,t,i,o,a,l,x):d.texImage2D(g,A,a,a,l,x)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=mD,n})();class Wte extends Eg{static isSupported(e){return pi(e)}constructor(e,t={}){Bo(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),nc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof rr&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(SB[this.dataFormat]||4)*(xB[this.type]||1),"Texture"),this.loaded=!0,this}}function Kte(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Is(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function xE(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof Is?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Kte(n),deleteFramebuffer:!0}}(n);tn(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),tn(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(qy(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return tn(!1),0}}(t))}(o,c,r,a,l),c=c||dD(o);const x=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,x||null),f&&d.delete(),o}function _D(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=xE(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Ite({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return tn(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&un.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){tn(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof Sg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(Is.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&gD(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Bo(n),nc(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:tn(!1,RB)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return un.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return un.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return un.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return un.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return un.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return un.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=Bo(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=Wd(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?Wd(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?Wd(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(_D(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>un.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=_D(this,{targetMaxHeight:100});return un.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new Oa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new Sg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new Sg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&tn(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof Sg?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:Bo(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:tn(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return pi(n)?n:null}(this.gl);t?t.readBuffer(e):tn(36064===e||1029===e,NB),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Bo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):tn(1===e.length&&(36064===e[0]||1029===e[0]),NB)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in PB)void 0===n.luma.caps[e]&&(n.luma.caps[e]=LB(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Is.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const PB={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new Oa(n,{format:6408,type:5126,dataFormat:6408}),t=new Is(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function yD(n,e){return FB(n,e)}function FB(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>LB(n,t))}function LB(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=PB[e];let i;tn(t,e);const r=pi(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:tn(!1);return i}(n,e)),n.luma.caps[e]||un.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class vD{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},one=(Math,1/180*Math.PI),xr={};function lne(n,{precision:e=xr.precision||4}={}){return n=function(n){return Math.round(n/xr.EPSILON)*xr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function qd(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Pu(n,e,t){if(qd(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*one,void 0)}(n)}function gf(n,e,t){return Pu(n,i=>Math.max(e,Math.min(t,i)))}function CE(n,e,t){return qd(n)?n.map((i,r)=>CE(i,e[r],t)):t*e+(1-t)*n}function Xy(n,e,t){const i=xr.EPSILON;t&&(xr.EPSILON=t);try{if(n===e)return!0;if(qd(n)&&qd(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+lne(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(KB.length=n.length,i=KB):i=qB,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function XB(n){return n&&n[Symbol.asyncIterator]}function xD(n,e=(()=>!0)){return Array.isArray(n)?QB(n,e,[]):e(n)?[n]:[]}function QB(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function ZB(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ht(ht(ht({},$ne[n.type]),e),n)):null}function JB(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function ej(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function tj(n){n.push(n.shift())}function AD(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function nj({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=AD(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const W=s;s=(G,ge)=>t._normalizeConstant(W(G,ge))}const _=p?(W,G)=>s(g,G):(W,G)=>s(g.subarray(W,W+a),G),x=n.getData({length:i}),A=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return CD({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===DE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=DE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=zne}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==DE}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const A=f*a+l;for(let W=0;Wd?c.set(ge,x):(e._normalizeValue(ge,W.target,0),Une({target:c,source:W.target,start:x,count:Ne}));x+=Ne*d}else e._normalizeValue(ge,c,x),x+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let MD={};function bo(n){Oi.level>0&&MD[n]&&MD[n].call(...arguments)}function Na(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const ij="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Kne=`#version 300 es\n${ij}`;function rj(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function sj(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Kne:e>300?`#version ${e}\n${ij}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Na(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class oj extends Nu{static isSupported(e){return pi(e)}constructor(e,t={}){Bo(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,bg(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,un.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof rr?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Zne{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof rr?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&tn(pi(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new oj(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],tn(i[s]instanceof rr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new rr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function aj(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const Jy="vs",tie={[Jy]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},IE="__LUMA_INJECT_DECLARATIONS__",lj=/void\s+main\s*\([^)]*\)\s*\{\n?/,cj=/}\n?[^{}]*$/,ID=[];function uj(n,e,t,i=!1){const r=e===Jy;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),ID.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(cj,l=>a+l));break;case"fs:#decl":r||(n=n.replace(IE,a));break;case"fs:#main-start":r||(n=n.replace(lj,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(cj,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(IE,""),i&&(n=n.replace(/\}\s*$/,s=>s+tie[e])),n}function RD(n){const e={};return Na(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const nie={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},RE="transform_uSize_",dj="transform_position";const uie={10241:9728,10240:9728,10242:33071,10243:33071};class hie{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${RE}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${RE}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=xE(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Na(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new rr(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new Is(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters(uie)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){tn(n instanceof Oa||n instanceof $te||n instanceof Wte);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const x=function(n,e){const t={},i=function(n){return rj(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${RE}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Na(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(x){const{updatedLine:A,inject:W}=x;f[g]=A,c=RD([c,W]),Object.assign(a,x.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=rj(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){tn(i);const p=`${RE}${t}`;c=RD([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${dj} = transform_getPos(${p});\n gl_Position = vec4(${dj}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=RD([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||sj({version:aj(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[nie].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const OD={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function pie(n){let e=hj(n);return"object"===e?n?"type"in n?Object.assign({},n,OD[n.type]):"value"in n?(e=hj(n.value),Object.assign({type:e},n,OD[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},OD[e])}function hj(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class ND{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Na("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=pie(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Na(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Na(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function yie(n){return function(n){const e={},t={};return PD({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(pj(n))}function PD({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof ND||(Na("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Na(t.name,"shader module has no name"),(t=new ND(t)).dependencies=pj(t.dependencies)),t))}const FD={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},mf={};function Aie(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(FD).forEach(n=>{mf[n]=n});const LD={};function gj(n,e,t={}){const i=FD[e];if(Na(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in LD)return LD[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),LD[e]=l,l}function OE(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=FD[e];Na(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Na(!1===r||!0===r),r}(n,t))}function Cg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const mj=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],Iie=[...mj,[Cg("attribute"),"in $1"],[Cg("varying"),"out $1"]],Rie=[...mj,[Cg("varying"),"in $1"]],_j=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Oie=[..._j,[Cg("in"),"attribute $1"],[Cg("out"),"varying $1"]],Nie=[..._j,[Cg("in"),"varying $1"]],kD="gl_FragColor",BD=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Pie=/void\s+main\s*\([^)]*\)\s*\{\n?/;function NE(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Bie=`\n\n${IE}\n\n`,yj={[Jy]:"vertex",fs:"fragment"};function vj(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Na("string"==typeof t,"shader source must be a string");const f=i===Jy,p=t.split("\n");let g=100,_="",x=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],x=p.slice(1).join("\n")):_=`#version ${g}`;const A={};r.forEach($e=>{Object.assign(A,$e.getDefines())}),Object.assign(A,s);let W=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${yj[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${yj[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:Aie(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return OE(n,mf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),OE(n,mf.GLSL_DERIVATIVES)&&gj(n,mf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),OE(n,mf.GLSL_FRAG_DATA)&&gj(n,mf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),OE(n,mf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(A)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const G=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),ge={},Ne={},Ge={};for(const $e in a){const at="string"==typeof a[$e]?{injection:a[$e],order:0}:a[$e],St=$e.match(/^(v|f)s:(#)?([\w-]+)$/);if(St){const Pt=St[3];St[2]?"decl"===Pt?Ne[$e]=[at]:Ge[$e]=[at]:ge[$e]=[at]}else Ge[$e]=[at]}for(const $e of r){d&&$e.checkDeprecations(x,d),W+=$e.getModuleSource(i,g);const St=$e.injections[i];for(const Rt in St){const Pt=Rt.match(/^(v|f)s:#([\w-]+)$/);if(Pt){const Zt="decl"===Pt[2]?Ne:Ge;Zt[Rt]=Zt[Rt]||[],Zt[Rt].push(St[Rt])}else ge[Rt]=ge[Rt]||[],ge[Rt].push(St[Rt])}}return W+=Bie,W=uj(W,i,Ne),W+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(G[i],ge),W+=x,W=uj(W,i,Ge),W=function(n,e,t){switch(e){case 300:return t?NE(n,Iie):function(n){const e=(n=NE(n,Rie)).match(BD);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${kD}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(Pie,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${kD}\\b`,"g"),t)}return n}(n);case 100:return t?NE(n,Oie):function(n){const e=(n=NE(n,Nie)).match(BD);if(e){const t=e[1];n=n.replace(BD,"").replace(new RegExp(`\\b${t}\\b`,"g"),kD)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(W,l?100:g,f),W}function Uie(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const qie={5126:Cr.bind(null,"uniform1fv",Pa,1,wo),35664:Cr.bind(null,"uniform2fv",Pa,2,wo),35665:Cr.bind(null,"uniform3fv",Pa,3,wo),35666:Cr.bind(null,"uniform4fv",Pa,4,wo),5124:Cr.bind(null,"uniform1iv",Kd,1,wo),35667:Cr.bind(null,"uniform2iv",Kd,2,wo),35668:Cr.bind(null,"uniform3iv",Kd,3,wo),35669:Cr.bind(null,"uniform4iv",Kd,4,wo),35670:Cr.bind(null,"uniform1iv",Kd,1,wo),35671:Cr.bind(null,"uniform2iv",Kd,2,wo),35672:Cr.bind(null,"uniform3iv",Kd,3,wo),35673:Cr.bind(null,"uniform4iv",Kd,4,wo),35674:Cr.bind(null,"uniformMatrix2fv",Pa,4,Lu),35675:Cr.bind(null,"uniformMatrix3fv",Pa,9,Lu),35676:Cr.bind(null,"uniformMatrix4fv",Pa,16,Lu),35678:no,35680:no,5125:Cr.bind(null,"uniform1uiv",PE,1,wo),36294:Cr.bind(null,"uniform2uiv",PE,2,wo),36295:Cr.bind(null,"uniform3uiv",PE,3,wo),36296:Cr.bind(null,"uniform4uiv",PE,4,wo),35685:Cr.bind(null,"uniformMatrix2x3fv",Pa,6,Lu),35686:Cr.bind(null,"uniformMatrix2x4fv",Pa,8,Lu),35687:Cr.bind(null,"uniformMatrix3x2fv",Pa,6,Lu),35688:Cr.bind(null,"uniformMatrix3x4fv",Pa,12,Lu),35689:Cr.bind(null,"uniformMatrix4x2fv",Pa,8,Lu),35690:Cr.bind(null,"uniformMatrix4x3fv",Pa,12,Lu),35678:no,35680:no,35679:no,35682:no,36289:no,36292:no,36293:no,36298:no,36299:no,36300:no,36303:no,36306:no,36307:no,36308:no,36311:no},Kie={},Yie={},Xie={},bj=[0];function jD(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(bj[0]=n,n=bj);const r=n.length;if(r%e&&un.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Cr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{tn(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return xj(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:Sj(s,c),warnings:Sj(o,c)}}(i,this.source,this.shaderType,this.id);throw un.error(`GLSL compilation errors in ${r}\n${s}`)(),un.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class VD extends e0{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class UD extends e0{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Rs=5126,t0=5124,n0=5125,zD={[Rs]:[Rs,1,"float"],35664:[Rs,2,"vec2"],35665:[Rs,3,"vec3"],35666:[Rs,4,"vec4"],[t0]:[t0,1,"int"],35667:[t0,2,"ivec2"],35668:[t0,3,"ivec3"],35669:[t0,4,"ivec4"],[n0]:[n0,1,"uint"],36294:[n0,2,"uvec2"],36295:[n0,3,"uvec3"],36296:[n0,4,"uvec4"],35670:[Rs,1,"bool"],35671:[Rs,2,"bvec2"],35672:[Rs,3,"bvec3"],35673:[Rs,4,"bvec4"],35674:[Rs,8,"mat2"],35685:[Rs,8,"mat2x3"],35686:[Rs,8,"mat2x4"],35675:[Rs,12,"mat3"],35687:[Rs,12,"mat3x2"],35688:[Rs,12,"mat3x4"],35676:[Rs,16,"mat4"],35689:[Rs,16,"mat4x2"],35690:[Rs,16,"mat4x3"]};function Ij(n){const e=zD[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function Rj(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Rs}for(const t in zD){const[i,r,s]=zD[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class Pre{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!pi(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=Ij(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new sa(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=Ij(i),l={location:e,name:t,accessor:new sa({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Fre=35981,Lre=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class Nj extends Nu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Lre),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=Fre}=e;return this.hash=t||"",this.vs="string"==typeof i?new VD(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new UD(this.gl,{id:`${e.id}-fs`,source:r}):r,tn(this.vs instanceof VD),tn(this.fs instanceof UD),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Bo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Pre(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:x,samplers:A}){if((x||A)&&(un.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(x||{})),un.priority>=e){const W=g?g.id:"default",G=`mode=${Wd(this.gl,t)} verts=${i} instances=${c} indexType=${Wd(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${W}`;un.log(e,G)()}return tn(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const W=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return tn(!1),0}}(t);p.begin(W)}this._bindTextures(),nc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&pi(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){un.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Jie(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof Is&&(s=s.texture),s instanceof Eg)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&ere(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new VD({handle:r});break;case 35632:i.fs=new UD({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=jc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),un.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),un.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||un.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(ge=>this._getHash(ge.name)).sort(),g=o.map(ge=>this._getHash(ge)),_=Object.keys(r).sort(),x=Object.keys(s).sort(),A=[],W=[];for(const ge of _)A.push(this._getHash(ge)),A.push(this._getHash(r[ge]));for(const ge of x)W.push(this._getHash(ge)),W.push(this._getHash(s[ge]));const G=`${d}/${f}D${A.join("/")}M${p.join("/")}I${W.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[G]){const ge=function(n,e){const{vs:t,fs:i}=e,r=yie(e.modules||[]);return{gl:n,vs:vj(n,Object.assign({},e,{source:t,type:Jy,modules:r})),fs:vj(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Uie(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[G]=new Nj(this.gl,{hash:G,vs:ge.vs,fs:ge.fs,varyings:o,bufferMode:a}),this._getUniforms[G]=ge.getUniforms||(Ne=>{}),this._useCounts[G]=0}return this._useCounts[G]++,this._programCache[G]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":zy.chrome?"Chrome":zy.safari?"Safari":zy.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Fa(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Fa.MAX_ATTRIBUTES=Fa.MAX_ATTRIBUTES||e.getParameter(34921),Fa.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Fa._setConstantFloatArray(e,t,i);break;case Int32Array:Fa._setConstantIntArray(e,t,i);break;case Uint32Array:Fa._setConstantUintArray(e,t,i);break;default:tn(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Fa.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return tn(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(tn(pi(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Fa.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new rr(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!kE||kE.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Hre=/^(.+)__LOCATION_([0-9]+)$/,Gre=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class $re{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Fa(e),bB(this,"VertexArray","v6.0",Gre),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new rr(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,un.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=sa.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return tn(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Hre.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof rr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof rr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof rr))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof rr){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return un.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function s0(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=s0(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function Pj(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof rr){const p=e,{data:g,changed:_}=p.getDebugData();let x;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?x=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${Wd(r,s)})`:(c=!0,x=`${l} bytes`),{[i]:`${d}${s0(f,{size:o,isInteger:c})}`,"Format ":x}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${s0(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Kre(n,e){const{type:t,size:i}=e,r=Rj(t,i);return r?`${n} (${r.name})`:n}function Fj({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){tn(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:s0(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function HD({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?s0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function Lj(n){const{type:e,size:t}=n.accessor,i=Rj(e,t);return i?`${i.name} ${n.name}`:n.name}const Qre={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Jre(n,e){const{attributeMap:t=Qre}=e||{};return t&&t[n]||n}function ese(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}tn(Number.isFinite(e.size),`attribute ${n} needs size`)}const kj=()=>{},ise={};class BE{constructor(e,t={}){const{id:i=jc("model")}=t;tn(EE(e)),this.id=i,this.gl=e,this.id=t.id||jc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||r0.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},tn(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return tn(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return tn(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Jre(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ht({},o);delete c.value,i[a]=[new rr(n,l),c],ese(s,c)}}if(r){const s=r.value||r;tn(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new rr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(bg(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return gD(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),un.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&un.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:x,instanceCount:A}=this,{onBeforeRender:W=kj,onAfterRender:G=kj}=this.props;W(),this.program.setUniforms(this.uniforms);const ge=this.program.draw(Object.assign(ise,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:x,instanceCount:A,offset:f?g:0}));return G(),un.priority>=2&&this._logDrawCallEnd(c,l,i),ge}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return un.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}tn(t instanceof Nj,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new $re(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof rr&&t.delete()}}_setAnimationProps(e){this.animated&&tn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(bg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new oj(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:un.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=Pj(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Kre(s.name,a)}`),t[o]=Pj(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=Fj({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=Fj({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&un.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&un.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${Lj(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${Lj(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);un.table(e,s)(),un.table(e,o)(),un.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),un.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class GD{static isSupported(e){return pi(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();tn(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new BE(t,Object.assign({},e,{fs:e.fs||sj({version:aj(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(bg(n.feedbackBuffers)&&bg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Zne(e,t)),function(n){return!(bg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new hie(e,t)),tn(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function jE(){}const ose={onStart:jE,onUpdate:jE,onInterrupt:jE,onEnd:jE};class o0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ht(ht({},ose),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const pse={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new o0(i),this.attribute=t,this.attributeInTransition=new TD(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=ej(e.size);return new GD(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new rr(e,r),new rr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;tj(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)nj(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=AD(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:JB(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new o0(i),this.attribute=t,this.attributeInTransition=new TD(e,Un(ht({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new Oa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new Is(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=ej(e.size);return new GD(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new rr(e,r),new rr(e,r),new rr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)nj(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=AD(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:JB(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),tj(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),xE(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class gse{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=GD.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Oi.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=pse[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Oi.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const Bj="attributeManager.invalidate";class wse{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new gse(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;bo("attribute.updateStart",t),t.allocate(i)&&bo("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,bo("attribute.updateEnd",t,i))}}function Vj(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function Uj(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=ZB(r)))return;const o=Cse[r.type];if(!o)return void Oi.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Un(ht({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const VE={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:Tse}=VE;function Ise(n,e){if(!n.transitions)return null;const t={},i=WD(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&$D(n[r],e[r],s)&&(t[r]=!0)}return t}function zj({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=$D(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=$D(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function $D(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function Nse(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!jse(i[r],e[r])){t=n(i),e=i;break}return t}}function Vse(n,e){if(!e)return n;const t=ht(ht({},n),e);if("defines"in e&&(t.defines=ht(ht({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=ht({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function zE(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],x=e[13],A=e[14],W=e[15],G=t*a-i*o,ge=t*l-r*o,Ne=t*c-s*o,Ge=i*l-r*a,$e=i*c-s*a,at=r*c-s*l,St=d*x-f*_,Rt=d*A-p*_,Pt=d*W-g*_,Xt=f*A-p*x,Zt=f*W-g*x,bt=p*W-g*A,Ct=G*bt-ge*Zt+Ne*Xt+Ge*Pt-$e*Rt+at*St;return Ct?(n[0]=(a*bt-l*Zt+c*Xt)*(Ct=1/Ct),n[1]=(r*Zt-i*bt-s*Xt)*Ct,n[2]=(x*at-A*$e+W*Ge)*Ct,n[3]=(p*$e-f*at-g*Ge)*Ct,n[4]=(l*Pt-o*bt-c*Rt)*Ct,n[5]=(t*bt-r*Pt+s*Rt)*Ct,n[6]=(A*Ne-_*at-W*ge)*Ct,n[7]=(d*at-p*Ne+g*ge)*Ct,n[8]=(o*Zt-a*Pt+c*St)*Ct,n[9]=(i*Pt-t*Zt-s*St)*Ct,n[10]=(_*$e-x*Ne+W*G)*Ct,n[11]=(f*Ne-d*$e-g*G)*Ct,n[12]=(a*Rt-o*Xt-l*St)*Ct,n[13]=(t*Xt-i*Rt+r*St)*Ct,n[14]=(x*ge-_*Ge-A*G)*Ct,n[15]=(d*Ge-f*ge+p*G)*Ct,n):null}function Vc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],x=e[12],A=e[13],W=e[14],G=e[15],ge=t[0],Ne=t[1],Ge=t[2],$e=t[3];return n[0]=ge*i+Ne*a+Ge*f+$e*x,n[1]=ge*r+Ne*l+Ge*p+$e*A,n[2]=ge*s+Ne*c+Ge*g+$e*W,n[3]=ge*o+Ne*d+Ge*_+$e*G,n[4]=(ge=t[4])*i+(Ne=t[5])*a+(Ge=t[6])*f+($e=t[7])*x,n[5]=ge*r+Ne*l+Ge*p+$e*A,n[6]=ge*s+Ne*c+Ge*g+$e*W,n[7]=ge*o+Ne*d+Ge*_+$e*G,n[8]=(ge=t[8])*i+(Ne=t[9])*a+(Ge=t[10])*f+($e=t[11])*x,n[9]=ge*r+Ne*l+Ge*p+$e*A,n[10]=ge*s+Ne*c+Ge*g+$e*W,n[11]=ge*o+Ne*d+Ge*_+$e*G,n[12]=(ge=t[12])*i+(Ne=t[13])*a+(Ge=t[14])*f+($e=t[15])*x,n[13]=ge*r+Ne*l+Ge*p+$e*A,n[14]=ge*s+Ne*c+Ge*g+$e*W,n[15]=ge*o+Ne*d+Ge*_+$e*G,n}function a0(n,e,t){var o,a,l,c,d,f,p,g,_,x,A,W,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],x=e[9],A=e[10],W=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=x,n[10]=A,n[11]=W,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+x*s+e[13],n[14]=l*i+p*r+A*s+e[14],n[15]=c*i+g*r+W*s+e[15]),n}function l0(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function Gj(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function $j(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function Wj(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function qj(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],x=n[13],A=n[14],W=n[15],G=e[0],ge=e[1],Ne=e[2],Ge=e[3],$e=e[4],at=e[5],St=e[6],Rt=e[7],Pt=e[8],Xt=e[9],Zt=e[10],bt=e[11],Ct=e[12],Ut=e[13],ft=e[14],Wt=e[15];return Math.abs(t-G)<=gr*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(i-ge)<=gr*Math.max(1,Math.abs(i),Math.abs(ge))&&Math.abs(r-Ne)<=gr*Math.max(1,Math.abs(r),Math.abs(Ne))&&Math.abs(s-Ge)<=gr*Math.max(1,Math.abs(s),Math.abs(Ge))&&Math.abs(o-$e)<=gr*Math.max(1,Math.abs(o),Math.abs($e))&&Math.abs(a-at)<=gr*Math.max(1,Math.abs(a),Math.abs(at))&&Math.abs(l-St)<=gr*Math.max(1,Math.abs(l),Math.abs(St))&&Math.abs(c-Rt)<=gr*Math.max(1,Math.abs(c),Math.abs(Rt))&&Math.abs(d-Pt)<=gr*Math.max(1,Math.abs(d),Math.abs(Pt))&&Math.abs(f-Xt)<=gr*Math.max(1,Math.abs(f),Math.abs(Xt))&&Math.abs(p-Zt)<=gr*Math.max(1,Math.abs(p),Math.abs(Zt))&&Math.abs(g-bt)<=gr*Math.max(1,Math.abs(g),Math.abs(bt))&&Math.abs(_-Ct)<=gr*Math.max(1,Math.abs(_),Math.abs(Ct))&&Math.abs(x-Ut)<=gr*Math.max(1,Math.abs(x),Math.abs(Ut))&&Math.abs(A-ft)<=gr*Math.max(1,Math.abs(A),Math.abs(ft))&&Math.abs(W-Wt)<=gr*Math.max(1,Math.abs(W),Math.abs(Wt))}function Kj(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function HE(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new oa(4);oa!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const Yj=[0,0,0,0],hoe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],foe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],poe=[0,0,0],goe=[0,0,0],moe=UE(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=Yj,l=Yj,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=Xj(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=HE([],l,o),s=i||s,o=Vc([],r,s),o=Vc([],o,hoe)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:poe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Mi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Mi.LNGLAT:case Mi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Mi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function Xj(n,e,t=goe){let r,i=t,s=!0;switch(r=e===Mi.LNGLAT_OFFSETS||e===Mi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case kc.WEB_MERCATOR:(e===Mi.LNGLAT||e===Mi.CARTESIAN)&&(s=!1);break;case kc.WEB_MERCATOR_AUTO_OFFSET:e===Mi.LNGLAT?i=r:e===Mi.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case kc.IDENTITY:i=n.position.map(Math.fround);break;case kc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class boe extends bD{get ELEMENTS(){return Fu(!1),0}get RANK(){return Fu(!1),0}toString(){let e="[";if(xr.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new $n).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return Wj(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],x=n[14],A=n[15];return(e*o-t*s)*(f*A-p*x)-(e*a-i*s)*(d*A-p*_)+(e*l-r*s)*(d*x-f*_)+(t*a-i*o)*(c*A-p*g)-(t*l-r*o)*(c*x-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return zE(this,this),this.check()}multiplyLeft(e){return Vc(this,e,this),this.check()}multiplyRight(e){return Vc(this,this,e),this.check()}rotateX(e){return Gj(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return $j(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,x,A,W,G,ge,Ne,Ge,$e,at,St,Rt,Pt,Xt,Zt,bt,Ct,Ut,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*sc+rc)/(2*rc),512*(rc+Math.log(Math.tan(eV+e*sc*.5)))/(2*rc)]}function Yd([n,e]){const t=n/512*(2*rc)-rc,i=2*(Math.atan(Math.exp(e/512*(2*rc)-rc))-eV);return[t*YD,i*YD]}function $E({latitude:n,longitude:e,highPrecision:t=!1}){ku(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*sc),o=512/360,a=o/s,l=512/XD/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=sc*Math.tan(n*sc)/s,f=512/XD*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function nV(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=$E({longitude:t,latitude:i,highPrecision:!0}),d=Ng(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Yd(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function iV({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return a0(o,o,[0,0,-i]),Gj(o,o,-e*sc),$j(o,o,t*sc),l0(o,o,[r/=n,r,r]),s&&a0(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function rV({width:n,height:e,fovy:t=WE(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=WE(i));const a=.5*t*sc,l=sV(t),c=r*sc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function WE(n){return 2*Math.atan(.5/n)*YD}function sV(n){return.5/Math.tan(.5*n*sc)}function QD(n,e){const[t,i,r=0]=n;return ku(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Og(e,[t,i,r,1])}function _f(n,e,t=0){const[i,r,s]=n;if(ku(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Og(e,[i,r,s,1]);const o=Og(e,[i,r,0,1]),a=Og(e,[i,r,1,1]),l=o[2],c=a[2];return Qj([],o,a,l===c?0:((t||0)-l)/(c-l))}function oV({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:ku(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new qE({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],x=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ku(x[0]>0&&x[1]>0);const A=x[0]/_[0],W=x[1]/_[1],Ge=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/A,(g[1]+p[1])/2+(s.bottom-s.top)/2/W]),$e=Math.min(r,f.zoom+KD(Math.abs(Math.min(A,W))));return ku(Number.isFinite($e)),{longitude:Ge[0],latitude:Ge[1],zoom:$e}}const aV=Math.PI/180;function lV(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*aV:Math.atan(.5/n.altitude))>(90-n.pitch)*aV-.01?(l=cV(n,0,e),c=cV(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function cV(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Og(i,[e,0,1,1]),s=Og(i,[e,n.height,1,1]),c=Yd(Qj([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class qE{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=WE(l=1.5):null===c?c=WE(l):null===l&&(l=sV(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=$E({longitude:r,latitude:i}),x=Ng([r,i]);x[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(x,x,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=rV({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return Wj([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=iV({height:t,scale:g,center:x,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=x,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Vc(s,s,i),Vc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l0(o,o,[e/2,-t/2,1]),a0(o,o,[1,-1,0]),Vc(o,o,s);const a=zE([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof qE&&e.width===this.width&&e.height===this.height&&qj(e.projectionMatrix,this.projectionMatrix)&&qj(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=QD(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=_f([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Ng(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=Yd(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Ng(e)}unprojectFlat(e){return Yd(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=_f(t,this.pixelUnprojectionMatrix),s=Ig([],Ng(e),qD([],i));return Yd(Ig([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=oV(Object.assign({width:i,height:r,bounds:e},t));return new qE({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return lV(this,e.z||0)}}const Ooe=Math.PI/180,Noe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZD=[0,0,0],Foe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Pg=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?kc.WEB_MERCATOR:kc.WEB_MERCATOR_AUTO_OFFSET:kc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Xy(t.projectionMatrix,this.projectionMatrix)&&Xy(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=QD(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=_f([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Ng(t):t}unprojectFlat(t){return this.isGeospatial?Yd(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?$E({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends Pg{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:x=1.5}=t;const A=Math.pow(2,s);g=g||1,_=_||1,x=Math.max(.75,x);const{fov:W,aspect:G,focalDistance:ge,near:Ne,far:Ge}=rV({width:g,height:_,pitch:o,altitude:x,nearZMultiplier:l,farZMultiplier:c});let $e=iV({height:_,pitch:o,bearing:a,scale:A,altitude:x});p&&($e=(new $n).translate([512*p,0,0]).multiplyLeft($e)),super(Un(ht({},t),{width:g,height:_,viewMatrix:$e,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:W,aspect:G,focalDistance:ge,near:Ne,far:Ge})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=x,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(Un(ht({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return nV(t,i)}panByPosition(t,i){const r=_f(i,this.pixelUnprojectionMatrix),o=Ig([],this.projectFlat(t),qD([],r)),a=Ig([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=lV(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=oV(ht({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function JD(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof pV){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function gV(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=HE([],[o,a,l,1],t)),i){case Mi.LNGLAT:return JD([o,a,l],e,s);case Mi.LNGLAT_OFFSETS:return JD([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mi.METER_OFFSETS:return JD(nV(r,[o,a,l]),e,s);case Mi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Boe={10241:9987,10240:9729,10242:33071,10243:33071},eI={},Uoe={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||d0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tI(n,e)},accessor:{validate(n,e){const t=KE(n);return"function"===t||t===KE(e.value)},equal:(n,e,t)=>"function"==typeof e||tI(n,e)},array:{validate:(n,e)=>e.optional&&!n||d0(n),equal:(n,e,t)=>t.compare?tI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof Oa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new Oa(t,Un(ht({},e),{parameters:ht(ht(ht({},Boe),i),n.props.textureParameters)}));return eI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof Oa)||eI[n.id]&&(n.delete(),delete eI[n.id])}(n)}}};function tI(n,e){if(n===e)return!0;if(!d0(n)||!d0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=eae,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Zoe]||{},i=e[Qoe]||e,r=e[Joe]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(XB(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return ni(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=iI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const A=_,{dataTransform:W}=i.component?i.component.props:{};a=W?W(A,a):a.concat(A),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(A){d=!0,f=A}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const x=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;x&&x(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:vV,ASYNC_RESOLVED:bV,ASYNC_DEFAULTS:tae}=VE,nae={};let iae=0,rae=(()=>{class n{constructor(){this.props=Goe.apply(this,arguments),this.id=this.props.id,this.count=iae++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[tae])s in i[bV]?r[s]=i[bV][s]:s in i[vV]&&(r[s]=i[vV][s]);return new this.constructor(ht(ht(ht({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new yV({})}}return n.componentName="Component",n.defaultProps=nae,n})();class sae extends yV{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const oc=n=>"function"==typeof n,Xd=n=>null!==n&&"object"==typeof n,EV=n=>Xd(n)&&n.constructor==={}.constructor,oae=n=>n&&"function"==typeof n[Symbol.iterator],aae=n=>n&&"function"==typeof n[Symbol.asyncIterator],f0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Fg=n=>"undefined"!=typeof Blob&&n instanceof Blob,SV=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||Xd(n)&&oc(n.tee)&&oc(n.cancel)&&oc(n.getReader))(n)||(n=>Xd(n)&&oc(n.read)&&oc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function yf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sI(n){var e,t;let i;return yf(n,"null loader"),yf(rI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Un(ht({},n=n[0]),{options:ht(ht({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Uc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oI=Uc.global||Uc.self||Uc.window||{},fae="object"!=typeof process||"[object process]"!==String(process)||process.browser,xV="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);xV&&parseFloat(xV[1]);const lI={};function pae(n){for(const e in lI)n.startsWith(e)&&(n=n.replace(e,lI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const gae=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,mae=/^([-\w.]+\/[-\w.+]+)/;function _ae(n){const e=mae.exec(n);return e?e[1]:n}function CV(n){const e=gae.exec(n);return e?e[1]:""}const yae=/\?.*/;function ZE(n){if(f0(n)){const e=cI(n.url||"");return{url:e,type:_ae(n.headers.get("content-type")||"")||CV(e)}}return Fg(n)?{url:cI(n.name||""),type:n.type||""}:"string"==typeof n?{url:cI(n),type:CV(n)}:{url:"",type:""}}function vae(n){return f0(n)?n.headers["content-length"]||-1:Fg(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cI(n){return n.replace(yae,"")}function AV(n){return uI.apply(this,arguments)}function uI(){return(uI=ni(function*(n){if(f0(n))return n;const e={},t=vae(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=ZE(n);r&&(e["content-type"]=r);const s=yield Eae(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function bae(n){return dI.apply(this,arguments)}function dI(){return(dI=ni(function*(n){if(!n.ok){const e=yield wae(n);throw new Error(e)}})).apply(this,arguments)}function wae(n){return hI.apply(this,arguments)}function hI(){return(hI=ni(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function Eae(n){return fI.apply(this,arguments)}function fI(){return(fI=ni(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${Sae(n.slice(0,5))}`:null})).apply(this,arguments)}function Sae(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const DV={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Wn(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Aae={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function gI(){oI.loaders=oI.loaders||{};const{loaders:n}=oI;return n._state=n._state||{},n._state}const mI=()=>{const n=gI();return n.globalOptions=n.globalOptions||ht({},DV),n.globalOptions};function Tae(n,e,t,i){return t=t||[],function(n,e){RV(n,null,DV,Aae,e);for(const t of e)RV(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=ht({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new xae),NV(r,mI()),NV(r,e),r}(e,n,i)}function IV(n,e){const t=mI(),i=n||t;return"function"==typeof i.fetch?i.fetch:Xd(i.fetch)?r=>TV(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:TV}function RV(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&Xd(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)MV.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=Dae(a,r);MV.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function Dae(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function NV(n,e){for(const t in e)t in e&&(n[t]=EV(e[t])&&EV(n[t])?ht(ht({},n[t]),e[t]):e[t])}function zc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Oae(n,e="3.0.12"){return zc(n,"no worker provided"),!(!e||!n.version)}const Hc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Nae=Hc.global||Hc.self||Hc.window||{},_I="object"!=typeof process||"[object process]"!==String(process)||process.browser,yI="function"==typeof importScripts,Pae="undefined"!=typeof window&&void 0!==window.orientation,PV="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),vI=(PV&&parseFloat(PV[1]),new Map);function FV(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function LV(n,e=!0,t){const i=t||new Set;if(n)if(kV(n))i.add(n);else if(kV(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)LV(n[r],e,i);return void 0===t?Array.from(i):[]}function kV(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const bI=()=>{};class BV{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Wn(this,"name",void 0),Wn(this,"source",void 0),Wn(this,"url",void 0),Wn(this,"terminated",!1),Wn(this,"worker",void 0),Wn(this,"onMessage",void 0),Wn(this,"onError",void 0),Wn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;zc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bI,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bI,this.onError=bI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||LV(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){zc(n.source&&!n.url||!n.source&&n.url);let e=vI.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?FV(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),vI.set(n.url,e)),n.source&&(e=FV(n.source),vI.set(n.source,e))),zc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class Bae{constructor(e,t){Wn(this,"name",void 0),Wn(this,"workerThread",void 0),Wn(this,"isRunning",void 0),Wn(this,"result",void 0),Wn(this,"_resolve",void 0),Wn(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zc(this.isRunning),this.isRunning=!1,this._reject(e)}}class jae{constructor(e){Wn(this,"name","unnamed"),Wn(this,"source",void 0),Wn(this,"url",void 0),Wn(this,"maxConcurrency",1),Wn(this,"maxMobileConcurrency",1),Wn(this,"onDebug",()=>{}),Wn(this,"reuseWorkers",!0),Wn(this,"props",{}),Wn(this,"jobQueue",[]),Wn(this,"idleQueue",[]),Wn(this,"count",0),Wn(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=ht(ht({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return ni(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return ni(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new Bae(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class Bu{static isSupported(){return BV.isSupported()}static getWorkerFarm(e={}){return Bu._workerFarm=Bu._workerFarm||new Bu({}),Bu._workerFarm.setProps(e),Bu._workerFarm}constructor(e){Wn(this,"props",void 0),Wn(this,"workerPools",new Map),this.props=ht({},Vae),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ht(ht({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new jae({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function zae(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return zc(r),r}function Hae(n,e){return!!Bu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Gae(n,e,t,i,r){return wI.apply(this,arguments)}function wI(){return(wI=ni(function*(n,e,t,i,r){const s=n.id,o=zae(n,t),l=Bu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",$ae.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function $ae(n,e,t,i){return EI.apply(this,arguments)}function EI(){return(EI=ni(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}Wn(Bu,"_workerFarm",void 0);var VV=tt(521);function UV(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return VV.toArrayBuffer?VV.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Yae(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function zV(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Xae(n){return xI.apply(this,arguments)}function xI(){return(xI=ni(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Yae(...e)})).apply(this,arguments)}const Jae=262144;function HV(n){this.wrapped=n}function p0(n){return new HV(n)}function g0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof HV;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function AI(n){return function(){return new g0(n.apply(this,arguments))}}function TI(){return(TI=AI(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(II)}function ale(n,e,t){return RI.apply(this,arguments)}function RI(){return(RI=ni(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return ole(n,e);if(Fg(n)&&(n=yield AV(n)),f0(n)){const r=n;return yield bae(r),e.binary?yield r.arrayBuffer():yield r.text()}if(SV(n)&&(n=sle(n,t)),oae(n)||aae(n))return Xae(n);throw new Error(II)})).apply(this,arguments)}function cle(n,e,t=null){if(t)return t;const i=ht({fetch:IV(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function ule(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const $V=()=>{const n=gI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function WV(n){const e=$V();n=Array.isArray(n)?n:[n];for(const t of n){const i=sI(t);e.find(r=>i===r)||e.unshift(i)}}const hle=/\.([^.]+)$/;function fle(n){return PI.apply(this,arguments)}function PI(){return(PI=ni(function*(n,e=[],t,i){if(!KV(n))return null;let r=qV(n,e,Un(ht({},t),{nothrow:!0}),i);if(r)return r;if(Fg(n)&&(r=qV(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(YV(n));return r})).apply(this,arguments)}function qV(n,e=[],t,i){if(!KV(n))return null;if(e&&!Array.isArray(e))return sI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...$V()),function(n){for(const e of n)sI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=ZE(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=FI(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&hle.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||FI(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(vle(e,t))return t}else if(ArrayBuffer.isView(e)){if(XV(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&XV(e,0,t))return t;return null}(e,n),a=a||FI(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(YV(n));return s}function KV(n){return!(n instanceof Response&&204===n.status)}function YV(n){const{url:e,type:t}=ZE(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?LI(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?LI(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function FI(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function vle(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function XV(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Gc=new Uint8ClampedArray(0);const Ile={data:{type:"data",value:Mle,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=Un(ht({},r),{fetch:Un(ht({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:eS(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):eS(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mi.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let VI=(()=>{class n extends rae{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=gV(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=QD(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=ht({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Mi.DEFAULT&&(t=i.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=Xj(t,i,r),f=gV(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mi.DEFAULT||t===Mi.LNGLAT||t===Mi.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){ic(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=Vse(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!Dle({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Gc.length/3);if(this.internalState.usesPickingColorCache=!0,rQV&&Oi.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Gc=Yy.allocate(Gc,i,{size:3,copy:!0,maxCount:Math.max(i,QV)});const s=Math.floor(Gc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&bo("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=zj({newProps:n,oldProps:e,propTypes:WD(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&Hj(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&Hj(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Nse(n,e),transitionsChanged:Ise(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=WD(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new wse(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){ic(!this.internalState&&!this.state),ic(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new sae({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Oi.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new Ase(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){bo("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=Ile,n})(),Ole=(()=>{class n extends VI{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:A,fetch:W,_subLayerProps:G}=this.props,ge={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:A,fetch:W},Ne=G&&G[t.id],Ge=Ne&&Ne.updateTriggers,$e=t.id||"sublayer";if(Ne){const at=this.constructor._propTypes,St=t.type?t.type._propTypes:{};for(const Rt in Ne){const Pt=St[Rt]||at[Rt];Pt&&"accessor"===Pt.type&&(Ne[Rt]=this.getSubLayerAccessor(Ne[Rt]))}}Object.assign(ge,t,Ne),ge.id="".concat(this.props.id,"-").concat($e),ge.updateTriggers=ht(ht({all:this.props.updateTriggers.all},t.updateTriggers),Ge);for(const at of A){const St=at.getSubLayerProps.call(this,at);St&&Object.assign(ge,St,{updateTriggers:Object.assign(ge.updateTriggers,St.updateTriggers)})}return ge}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=xD(t,Boolean),this.internalState.subLayers=t),bo("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Nle=/([0-9]+\.?[0-9]*)(%|px)/;function tS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Nle);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function nS(n,e){return n.relative?Math.round(n.position*e):n.position}function m0(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&m0(i,r)))return!1}return!0}class UI{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=Pg}=e;ic(!p||p instanceof Pg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Un(ht({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):m0(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=ht({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:nS(this._x,e),y:nS(this._y,t),width:nS(this._width,e),height:nS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ht(ht({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ht(ht(ht({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=tS(e),this._y=tS(t),this._width=tS(i),this._height=tS(r)}}const _0=()=>{},ZV={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:_0,onTransitionInterrupt:_0,onTransitionEnd:_0};class Ple{constructor(e,t={}){this.ControllerState=e,this.props=ht(ht({},ZV),t),this.propsInTransition=null,this.transition=new o0(t.timeline),this.onViewStateChange=t.onViewStateChange||_0,this.onStateChange=t.onStateChange||_0,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=ht(ht({},ZV),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ht(ht({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(ht(ht({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const JV=["longitude","latitude","zoom","bearing","pitch"],Lle=["longitude","latitude","zoom"];class eU extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!Xy(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];ic(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:JV,extract:JV,required:Lle}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=CE(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ht(ht({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,CE(e.around,t.around,i)))}return r}}const Qd={transitionDuration:0},kle={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},rS=n=>1-(1-n)*(1-n),Lg_WHEEL=["wheel"],Lg_PAN=["panstart","panmove","panend"],Lg_PINCH=["pinchstart","pinchmove","pinchend"],Lg_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Lg_DOUBLE_TAP=["doubletap"],Lg_KEYBOARD=["keydown"];class zI{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new Ple(e,Un(ht({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Un(ht({},kle),{transitionInterpolator:new eU({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Lg_WHEEL,d&&i),this.toggleEvents(Lg_PAN,d&&(r||s)),this.toggleEvents(Lg_PINCH,d&&(a||l)),this.toggleEvents(Lg_TRIPLE_PAN,d&&l),this.toggleEvents(Lg_DOUBLE_TAP,d&&o),this.toggleEvents(Lg_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=ht(ht({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,Qd,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,Un(ht({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,Qd,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,Qd,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,Qd,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,Un(ht({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?Un(ht({},t),{transitionInterpolator:new eU(Un(ht({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:Qd}}class tU{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const Zd_target=[0,0,0];class sS extends tU{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=Zd_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:A,startZoom:W}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:A,startZoom:W},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(Un(ht({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ht({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),gf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new sS(ht(ht(ht({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=gf(r,i,t),e.rotationX=gf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class jle extends zI{constructor(e){super(sS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Vle extends zI{constructor(e){e.dragMode=e.dragMode||"pan",super(sS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Ule=(new $n).lookAt({eye:[0,0,1]});function zle({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new $n).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Hle extends Pg{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(Un(ht({},e),{longitude:null,position:a,viewMatrix:Ule.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:zle({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Ig([],e,qD([],_f(t,this.pixelUnprojectionMatrix)));return{target:Ig([],this.center,r)}}}let Gle=(()=>{class n extends UI{constructor(t){super(Un(ht({},t),{type:Hle}))}get controller(){return this._getControllerProps({type:Vle})}}return n.displayName="OrthographicView",n})();const oS=Math.PI/180;function $le({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*oS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new $n).lookAt({eye:l,up:a});c.rotateX(i*oS),"Z"===t?c.rotateZ(r*oS):c.rotateY(r*oS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class Wle extends Pg{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(Un(ht({},e),{longitude:null,viewMatrix:$le({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=_f([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let qle=(()=>{class n extends UI{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Un(ht({},t),{orbitAxis:i,type:Wle}))}get controller(){return this._getControllerProps({type:jle})}}return n.displayName="OrbitView",n})();const Kle=[255,255,255],Yle=1;let Xle=0;class nU{constructor(e={}){const{color:t=Kle}=e,{intensity:i=Yle}=e;this.id=e.id||"ambient-".concat(Xle++),this.color=t,this.intensity=i,this.type="ambient"}}const Qle=[255,255,255],Zle=1,Jle=[0,0,-1];let ece=0;class iU{constructor(e={}){const{color:t=Qle}=e,{intensity:i=Zle}=e,{direction:r=Jle}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(ece++),this.color=t,this.intensity=i,this.type="directional",this.direction=new vo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class rU{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ht({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class HI extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ht({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Ou(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Ou(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=sU(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dgD(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Ou(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||sU(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class rce extends HI{constructor(e,t){super(e,t),this.shadowMap=new Oa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new Sg(e,{format:33189,width:1,height:1}),this.fbo=new Is(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;nc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=vg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Un(ht({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const oce=Object.keys(Mi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Mi[n],";")).join(""),ace=Object.keys(kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(kc[n],";")).join(""),lce="".concat(oce,"\n").concat(ace,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),cce={},GI={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:lce,getUniforms:function(n=cce){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Mi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mi.DEFAULT&&(i=n.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN);const o=moe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||foe,o}(n):{}}},fce=UE(function({viewport:n,center:e}){return new $n(n.viewProjectionMatrix).invert().transform(e)}),pce=UE(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=_f([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new vo(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new $n).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),gce=[0,0,0,1],mce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],$I={name:"shadow",dependencies:[GI],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||gce,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=fce({viewport:n.viewport,center:e.project_uCenter}),r=[],s=pce({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},wce={color:[255,255,255],intensity:1},oU=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],Ece=[0,0,0,200/255];class WI extends rU{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=Ece,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=r0.getDefaultProgramManager(e),$I&&this.programManager.addDefaultModule($I)),this.dummyShadowMap||(this.dummyShadowMap=new Oa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule($I),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new $n).lookAt({eye:new vo(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=xce++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class Cce{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=eS(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class Ace{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new Cce(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const Tce=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},GI],Mce=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function Dce(n){const e=r0.getDefaultProgramManager(n);for(const t of Tce)e.addDefaultModule(t);for(const t of Mce)e.addShaderHook(t);return e}const Oce=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Nce{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ace({gl:e,protocol:"deck://"}),this.context=Un(ht({},Oce),{layerManager:this,gl:e,deck:t,programManager:e&&Dce(e),stats:i||new lD({id:"deck.gl"}),viewport:r||new Pg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new aU,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){bo("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=xD(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return bo("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Oi.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Oi.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class Pce{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=xD(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!m0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Oi.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(ht({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=Un(ht(ht(ht({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class Lce extends tU{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:x,startRotatePos:A,startBearing:W,startPitch:G,startZoom:ge,normalize:Ne}={}){ic(Number.isFinite(s)),ic(Number.isFinite(r)),ic(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:Ne}),this._state={startPanLngLat:_,startZoomLngLat:x,startRotatePos:A,startBearing:W,startPitch:G,startZoom:ge},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(Un(ht({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(Un(ht({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ht({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(ht(ht(ht({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=gf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=gf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=Jj(t+180,360)-180),(o<-180||o>180)&&(o=Jj(o+180,360)-180);const a=KD(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Yd([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return gf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=gf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class kce extends zI{constructor(e){e.dragMode=e.dragMode||"pan",super(Lce,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Bce=(()=>{class n extends UI{constructor(t){super(Un(ht({},t),{type:pV}))}get controller(){return this._getControllerProps({type:kce})}}return n.displayName="MapView",n})();const jce=new WI;class Vce{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!m0(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof WI)||this._internalEffects.push(jce)}}class Uce extends HI{}const cU={blendFunc:[1,0,32771,0],blendEquation:32774};class uU extends HI{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,nc(_,Un(ht({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},cU),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Un(ht({},cU),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ht(ht({},e.props.parameters),i)}}class Hce{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Uce(e),this.pickLayersPass=new uU(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Is.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Un(ht({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,bo("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new Is(this.gl),new Is(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const Gce={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function $ce({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let A=0;A=0){const G=A+o-t,ge=G*G+x;ge<=d&&(d=ge,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),x=e[g];if(x){const A=x.decodePickingColor(_),W=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:x,pickedObjectIndex:A,pickedX:o+(f/4-W*l),pickedY:a+W}}Oi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Gce}function dU({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function qce(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(x=>x.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=dU(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=ht({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=hU({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function hU({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Yce{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new uU(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?ht(ht({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Is(e),Is.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Is(e),this.depthFBO.attach({36064:new Oa(e,{format:pi(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Oi.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:dU({viewports:i,x:r,y:s})};this._resizeBuffer();const f=vg(this.gl),p=sD(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:x,height:A}=this.pickingFBO,W=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:x,deviceHeight:A});let G;const ge=[],Ne={};for(let Ge=0;Ge=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Oi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:W,width:x.x+x.width-g,height:_-W},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Ge=new Map,$e=Number.isFinite(c);for(let at=0;at=c);at++){const St=Ne[at];let Rt={color:St.pickedColor,layer:null,index:St.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};Rt=hU({layer:St.pickedLayer,info:Rt,mode:l}),Ge.has(Rt.object)||Ge.set(Rt.object,Rt)}return Array.from(Ge.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return xE(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Xce={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Qce{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Xce),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function fU(n,e){if(!n)throw new Error(e)}const $c={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pU=$c.global||$c.self||$c.window,Jce="object"!=typeof process||"[object process]"!==String(process)||process.browser,gU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:eue}=(gU&&parseFloat(gU[1]),pU),qI="undefined"!=typeof Image,KI="undefined"!=typeof ImageBitmap,tue=Boolean(eue),YI=!!Jce||tue;function mU(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function _U(n){switch(mU(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const rue=/^data:image\/svg\+xml/,sue=/\.svg((\?|#).*)?$/;function XI(n){return n&&(rue.test(n)||sue.test(n))}function oue(n,e){if(XI(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return vU(n,e)}function vU(n,e){if(XI(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function bU(n,e,t){return QI.apply(this,arguments)}function QI(){return(QI=ni(function*(n,e,t){const i=oue(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield aue(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function aue(n,e){return ZI.apply(this,arguments)}function ZI(){return(ZI=ni(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const lue={};let wU=!0;function cue(n,e,t){return JI.apply(this,arguments)}function JI(){return(JI=ni(function*(n,e,t){let i;i=XI(t)?yield bU(n,e,t):vU(n,t);const r=e&&e.imagebitmap;return yield uue(i,r)})).apply(this,arguments)}function uue(n){return eR.apply(this,arguments)}function eR(){return(eR=ni(function*(n,e=null){if((due(e)||!wU)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),wU=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function due(n){for(const e in n||lue)return!1;return!0}const Wc=!1,y0=!0;function tR(n){const e=v0(n);return function(n){const e=v0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Wc)?{mimeType:"image/png",width:e.getUint32(16,Wc),height:e.getUint32(20,Wc)}:null}(e)||function(n){const e=v0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Wc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Wc)?{mimeType:"image/gif",width:e.getUint16(6,y0),height:e.getUint16(8,y0)}:null}(e)||function(n){const e=v0(n);return e.byteLength>=14&&16973===e.getUint16(0,Wc)&&e.getUint32(2,y0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,y0),height:e.getUint32(22,y0)}:null}(e)}function v0(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function _ue(n,e){const{mimeType:t}=tR(n)||{},{_parseImageNode:i}=pU;return fU(i),i(n,t,e)}function nR(){return(nR=ni(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(vue(r)){case"imagebitmap":a=yield cue(n,e,s);break;case"image":a=yield bU(n,e,s);break;case"data":a=yield _ue(n,e);break;default:fU(!1)}return"data"===r&&(a=_U(a)),a})).apply(this,arguments)}function vue(n){switch(n){case"auto":case"data":return function(){if(KI)return"imagebitmap";if(qI)return"image";if(YI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return KI||qI||YI;case"imagebitmap":return KI;case"image":return qI;case"data":return YI;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const EU={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return nR.apply(this,arguments)},tests:[n=>Boolean(tR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},wue={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},b0="8.5.8",aS=Sr.CO.deck&&Sr.CO.deck.VERSION;if(aS&&aS!==b0)throw new Error("deck.gl - multiple versions detected: ".concat(aS," vs ").concat(b0));aS||(Oi.log(1,"deck.gl ".concat(b0))(),Sr.CO.deck=Object.assign(Sr.CO.deck||{},{VERSION:b0,version:b0,log:Oi,_registerLoggers:function(n){MD=n}}),WV([wue,[EU,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Eue=Sr.CO.deck;class lS extends Nu{static isSupported(e,t=[]){const i=pi(e),r=FB(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:tn(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return lS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const SU=(0,Sr.jU)()&&"undefined"!=typeof document;let Oue=0;class Nue{constructor(e={}){const{onCreateContext:t=(A=>mB(A)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=ff.get("animation-loop-"+Oue++)}=e;let{useDevicePixels:x=!0}=e;"useDevicePixelRatio"in e&&(un.deprecated("useDevicePixelRatio","useDevicePixels")(),x=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:x}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return tn("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=lS.isSupported(this.gl,["timers"])?new lS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return ni(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return un.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=SU?new Promise((e,t)=>{SU&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?aD(this.props.gl,e):this.onCreateContext(e),!EE(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Ou(n,rD)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(un.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(un.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Is(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var Pue=tt(524),cS=tt.n(Pue);const Fue={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(cS().MouseInput);const jue=cS().Manager,qc=cS(),Vue=qc?[[qc.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[qc.Rotate,{enable:!1}],[qc.Pinch,{enable:!1}],[qc.Swipe,{enable:!1}],[qc.Pan,{threshold:0,enable:!1}],[qc.Press,{enable:!1}],[qc.Tap,{event:"doubletap",taps:2,enable:!1}],[qc.Tap,{event:"anytap",enable:!1}],[qc.Tap,{enable:!1}]]:null,AU={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Uue={doubletap:["tap"]},zue={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},rR={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Hue={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},TU={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Gue="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",kg="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let MU=!1;try{const n={get passive(){return MU=!0,!0}};kg.addEventListener("test",n,n),kg.removeEventListener("test",n,n)}catch(n){}const $ue=-1!==Gue.indexOf("firefox"),{WHEEL_EVENTS:Wue}=rR,IU=4.000244140625;class Yue{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Wue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!MU&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;kg.WheelEvent&&($ue&&e.deltaMode===kg.WheelEvent.DOM_DELTA_PIXEL&&(t/=kg.devicePixelRatio),e.deltaMode===kg.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%IU==0&&(t=Math.floor(t/IU)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:Xue}=rR,RU="pointermove",OU="pointerover",NU="pointerout",PU="pointerleave";class Que{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Xue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===RU&&(this.enableMoveEvent=t),e===OU&&(this.enableOverEvent=t),e===NU&&(this.enableOutEvent=t),e===PU&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:OU,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:NU,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:PU,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:RU,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Zue}=rR,FU="keydown";class Jue{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Zue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===FU&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:FU,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const kU="contextmenu";class ede{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===kU&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:kU,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const tde={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},BU={srcElement:"root",priority:0};class fde{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},BU,i):BU;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&AU[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new Yue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Que(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Jue(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new ede(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=Uue[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=TU[e]||e;let c=a.get(l);c||(c=new fde(this),a.set(l,c),c.recognizerName=Hue[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(TU[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=zue[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function bf(){}const jU={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:bf,onResize:bf,onViewStateChange:bf,onInteractionStateChange:bf,onBeforeRender:bf,onAfterRender:bf,onLoad:bf,onError:(n,e)=>Oi.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class dS{constructor(e){e=ht(ht({},jU),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Oi.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Sr.qs)()&&Oi.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new lD({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Yy.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Oi.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Oi.removed("onLayerClick","onClick")(),e.initialViewState&&!m0(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](ht({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),ic(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new Nue({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>mB(Un(ht(ht({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new Bce({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,aD(e,{enable:!0,copyState:!0})),this.tooltip=new Qce(this.canvas),Ou(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new aU;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new gde(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in eB)this.eventManager.on(r,this._onEvent);this.viewManager=new Pce({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new Nce(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new Vce,this.deckRenderer=new Hce(e),this.deckPicker=new Yce(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Ou(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ht({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Oi.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=Un(ht({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=eB[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=ff.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}dS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(rU)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},dS.defaultProps=jU,dS.VERSION=Eue.VERSION;const VU={name:"project32",dependencies:[GI],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},UU="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",yde={lightSources:{}};function aR({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const lR={name:"lights",vs:UU,fs:UU,getUniforms:function zU(n=yde){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?aR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=aR(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=aR(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return zU({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},bde={};const Ede={name:"phong-lighting",dependencies:[lR],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=bde){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},xde={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},$U=ht({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=xde){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),WU={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class hS{static get DRAW_MODE(){return WU}constructor(e={}){const{id:t=jc("geometry"),drawMode:i=WU.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?ht({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,tn(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(tn(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return tn(Number.isFinite(i)),i}}const cR=Math.PI/180,fS=new Float32Array(16),qU=new Float32Array(12);function KU(n,e,t){const i=e[0]*cR,r=e[1]*cR,s=e[2]*cR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function YU(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const XU={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let x;g?(fS.set(a),x=YU(fS)):(x=qU,KU(x,r,s),x.set(o,9)),n.value=new Float32Array(x)}else{let x=e*n.size;const{iterable:A,objectInfo:W}=YB(i,e,t);for(const G of A){let ge;W.index++,g?(fS.set(c?a:a(G,W)),ge=YU(fS)):(ge=qU,KU(ge,f?r:r(G,W),d?s:s(G,W)),ge.set(p?o:o(G,W),9)),_[x++]=ge[0],_[x++]=ge[1],_[x++]=ge[2],_[x++]=ge[3],_[x++]=ge[4],_[x++]=ge[5],_[x++]=ge[6],_[x++]=ge[7],_[x++]=ge[8],_[x++]=ge[9],_[x++]=ge[10],_[x++]=ge[11]}}}};function QU(n,e){return e===Mi.CARTESIAN||e===Mi.METER_OFFSETS||e===Mi.DEFAULT&&!n.isGeospatial}function ZU(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Oi.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function Mde(n,e){if(n.attributes)return ZU(n.attributes,e),n instanceof hS?n:new hS(n);if(n.positions||n.POSITION)return ZU(n,e),new hS({attributes:n});throw Error("Invalid mesh")}const Dde={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let Ide=(()=>{class n extends VI{getShaders(){const t=!pi(this.context.gl),i={};return yD(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[VU,Ede,$U],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:XU}),this.setState({emptyTexture:new Oa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||QU(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new BE(this.context.gl,Un(ht({},this.getShaders()),{id:this.props.id,geometry:Mde(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=Dde,n})();const JU={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[lR]};class Bg{constructor(e={}){const{id:t}=e;this.id=t||jc(this.constructor.name),this.display=!0,this.position=new vo,this.rotation=new vo,this.scale=new vo(1,1,1),this.matrix=new $n,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return tn(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return tn(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return tn(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){tn(e),t=t||this.matrix;const i=new $n(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class w0 extends Bg{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;un.assert(t.every(i=>i instanceof Bg),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new $n}={}){const i=new $n(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof w0?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function ez(){var n=new oa(4);return oa!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function tz(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function nz(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var rz=Kj,$de=function(){var n=jB(),e=VB(1,0,0),t=VB(0,1,0);return function(i,r,s){var o=UB(r,s);return o<-.999999?(TE(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&TE(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),tz(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(TE(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();ez(),ez(),function(){var n=new oa(9);oa!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const Wde=[0,0,0,1],Kde={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Yde={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function az(n){if(!n._animation){const e=Yde[n.componentType],t=Kde[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return tz(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=to(e)}get y(){return this[1]}set y(e){this[1]=to(e)}get z(){return this[2]}set z(e){this[2]=to(e)}get w(){return this[3]}set w(e){this[3]=to(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return $de(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Fu(!t),nz(this,this,e),this.check()}multiplyLeft(e,t){return Fu(!t),nz(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return rz(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Wde,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,x,A,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>gr?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-i)*p)/_,A=Math.sin(i*p)/_):(x=1-i,A=i),n[0]=x*r+A*l,n[1]=x*s+A*c,n[2]=x*o+A*d,n[3]=x*a+A*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),AE(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class nhe{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:un.warn(`Bad animation path ${s}`)()}tn(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){uR.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:az(e.accessors[a]),interpolation:l,output:az(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new nhe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class rhe extends Bg{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof BE?(this.model=e,this._setModelNodeProps(t)):this.model=new BE(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class she{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},yD(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new Oa(this.gl,ht({id:e.name||e.id,parameters:ht(ht({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(un.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function lz(n,e){return pi(n)?`#version 300 es\n${e}`:e}const che={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},uhe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class dhe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},uhe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new ihe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new w0({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new w0({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new $n).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new w0({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){un.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new she(n,e);un.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new rhe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[JU],defines:a.defines,parameters:a.parameters,vs:lz(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:lz(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),un.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new rr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new sa({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:che[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function cz(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new jg(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new jg(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof jg){const o=e;t=o.fields,i=fz(fz(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new jg(s,i)}}function fz(n,e){return new Map([...n||new Map,...e||new Map])}let Rr,pz,gz,mz,_z,yz,vz,bz;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(Rr||(Rr={}));class dR{static isNull(e){return e&&e.typeId===Rr.Null}static isInt(e){return e&&e.typeId===Rr.Int}static isFloat(e){return e&&e.typeId===Rr.Float}static isBinary(e){return e&&e.typeId===Rr.Binary}static isUtf8(e){return e&&e.typeId===Rr.Utf8}static isBool(e){return e&&e.typeId===Rr.Bool}static isDecimal(e){return e&&e.typeId===Rr.Decimal}static isDate(e){return e&&e.typeId===Rr.Date}static isTime(e){return e&&e.typeId===Rr.Time}static isTimestamp(e){return e&&e.typeId===Rr.Timestamp}static isInterval(e){return e&&e.typeId===Rr.Interval}static isList(e){return e&&e.typeId===Rr.List}static isStruct(e){return e&&e.typeId===Rr.Struct}static isUnion(e){return e&&e.typeId===Rr.Union}static isFixedSizeBinary(e){return e&&e.typeId===Rr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Rr.FixedSizeList}static isMap(e){return e&&e.typeId===Rr.Map}static isDictionary(e){return e&&e.typeId===Rr.Dictionary}get typeId(){return Rr.NONE}compareTo(e){return this===e}}Symbol,Symbol,pz=Symbol.toStringTag;class Vg extends dR{constructor(e,t){super(),Wn(this,"isSigned",void 0),Wn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Rr.Int}get[pz](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class whe extends Vg{constructor(){super(!0,8)}}class Ehe extends Vg{constructor(){super(!0,16)}}class She extends Vg{constructor(){super(!0,32)}}class xhe extends Vg{constructor(){super(!1,8)}}class Che extends Vg{constructor(){super(!1,16)}}class Ahe extends Vg{constructor(){super(!1,32)}}gz=Symbol.toStringTag;class wz extends dR{constructor(e){super(),Wn(this,"precision",void 0),this.precision=e}get typeId(){return Rr.Float}get[gz](){return"Float"}toString(){return`Float${this.precision}`}}class The extends wz{constructor(){super(32)}}class Mhe extends wz{constructor(){super(64)}}Symbol,Symbol,mz=Symbol.toStringTag,_z=Symbol.toStringTag,yz=Symbol.toStringTag,vz=Symbol.toStringTag,bz=Symbol.toStringTag;class Dhe extends dR{constructor(e,t){super(),Wn(this,"listSize",void 0),Wn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Rr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[bz](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class gS{constructor(e,t,i=!1,r=new Map){Wn(this,"name",void 0),Wn(this,"type",void 0),Wn(this,"nullable",void 0),Wn(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new gS(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function Ez(n,e,t){const i=t?Sz(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new whe;case Uint8Array:return new xhe;case Int16Array:return new Ehe;case Uint16Array:return new Che;case Int32Array:return new She;case Uint32Array:return new Ahe;case Float32Array:return new The;case Float64Array:return new Mhe;default:throw new Error("array type not supported")}}(e.value);return new gS(n,new Dhe(e.size,new gS("value",r)),!1,i)}function Sz(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const xz={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Nhe={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class Fhe{constructor(e){Wn(this,"draco",void 0),Wn(this,"decoder",void 0),Wn(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=Sz(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=Ez(o,n[o],s[o]);r.push(l)}if(t){const o=Ez("indices",t);r.push(o)}return new jg(r,i)}(l.attributes,a,l.indices);return Un(ht({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var mS=tt(125);const gR={};function mR(n){return _R.apply(this,arguments)}function _R(){return(_R=ni(function*(n,e=null,t={}){return e&&(n=Vhe(n,e,t)),gR[n]=gR[n]||Uhe(n),yield gR[n]})).apply(this,arguments)}function Vhe(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_I?t.CDN?(zc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yI?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Uhe(n){return yR.apply(this,arguments)}function yR(){return(yR=ni(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_I?yI?importScripts(n):zhe(yield(yield fetch(n)).text(),n):mS.requireFromFile&&(yield mS.requireFromFile(n))})).apply(this,arguments)}function zhe(n,e){if(!_I)return mS.requireFromString&&mS.requireFromString(n,e);if(yI)return eval.call(Nae,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Hhe="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Ghe="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",$he="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let E0;function qhe(n){return vR.apply(this,arguments)}function vR(){return(vR=ni(function*(n){const e=n.modules||{};return E0=e.draco3d?E0||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):E0||Khe(n),yield E0})).apply(this,arguments)}function Khe(n){return wR.apply(this,arguments)}function wR(){return(wR=ni(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield mR(Hhe,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield mR(Ghe,"draco",n),yield mR($he,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Yhe(e,t)})).apply(this,arguments)}function Yhe(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Un(ht({},t),{onModuleLoaded:r=>i({draco:r})}))})}const SR=Un(ht({},hz),{parse:function(n,e){return xR.apply(this,arguments)}});function xR(){return(xR=ni(function*(n,e){const{draco:t}=yield qhe(e),i=new Fhe(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function x0(n,e){return yf(n>=0),yf(e>0),n+(e-1)&~(e-1)}function Zhe(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+x0(i.byteLength,4)}const Cz=["SCALAR","VEC2","VEC3","VEC4"],Jhe=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],efe=new Map(Jhe),tfe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nfe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ife={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Az(n){return Cz[n-1]||Cz[0]}function Tz(n){const e=efe.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function Mz(n,e){const t=ife[n.componentType],i=tfe[n.type],s=n.count*i,o=n.count*i*nfe[n.componentType];return La(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const rfe={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class eh{constructor(e){Wn(this,"gltf",void 0),Wn(this,"sourceBuffers",void 0),Wn(this,"byteLength",void 0),this.gltf=e||{json:ht({},rfe),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return La(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=Mz(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return La(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return La(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=tR(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;La(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=x0(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:Az(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:Tz(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Zhe(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*gfe(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function mfe(n){return TR.apply(this,arguments)}function TR(){return(TR=ni(function*(n){const e=new eh(n),{json:t}=e;e.removeExtension(yS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,yS)})).apply(this,arguments)}function _fe(n){const e=new eh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,yS,{}),e.addExtension(yS))}function yfe(n){return MR.apply(this,arguments)}function MR(){return(MR=ni(function*(n){const e=new eh(n),{json:t}=e,i=e.getExtension(Ug);i&&(e.json.lights=i.lights,e.removeExtension(Ug));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Ug);s&&(r.light=s.light),e.removeObjectExtension(r,Ug)}})).apply(this,arguments)}function vfe(n){return DR.apply(this,arguments)}function DR(){return(DR=ni(function*(n){const e=new eh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Ug);La(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Ug,i);delete e.json.lights}})).apply(this,arguments)}function bfe(n){return IR.apply(this,arguments)}function IR(){return(IR=ni(function*(n){const e=new eh(n),{json:t}=e,i=e.getExtension(vS);if(i){const r=Efe(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,vS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=Sfe(s.technique,e)),e.removeObjectExtension(s,vS)}e.removeExtension(vS)}})).apply(this,arguments)}function wfe(n,e){return RR.apply(this,arguments)}function RR(){return(RR=ni(function*(n,e){})).apply(this,arguments)}function Efe(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function Sfe(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const Rz={KHR_draco_mesh_compression:gt,KHR_materials_unlit:J,KHR_lights_punctual:At,KHR_techniques_webgl:dt};function xfe(n){return OR.apply(this,arguments)}function OR(){return(OR=ni(function*(n,e={},t){for(const r in Rz){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield Rz[r].decode(n,e,t))}})).apply(this,arguments)}const Oz={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Afe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Tfe{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new eh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,Dz);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(Dz)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in Oz)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in Oz)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=Afe[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function Mfe(n,e={}){return(new Tfe).normalize(n,e)}const Dfe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ife={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},vl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Rfe={magFilter:vl.TEXTURE_MAG_FILTER,minFilter:vl.TEXTURE_MIN_FILTER,wrapS:vl.TEXTURE_WRAP_S,wrapT:vl.TEXTURE_WRAP_T},Ofe={[vl.TEXTURE_MAG_FILTER]:vl.LINEAR,[vl.TEXTURE_MIN_FILTER]:vl.NEAREST_MIPMAP_LINEAR,[vl.TEXTURE_WRAP_S]:vl.REPEAT,[vl.TEXTURE_WRAP_]:vl.REPEAT};class Ffe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return La(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=ht({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=ht({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ht({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ht({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=ht({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ht({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ht({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return Ife[n]}(e.componentType),e.components=function(n){return Dfe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=Mz(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):Ofe,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return Rfe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function Lfe(n,e){return(new Ffe).postProcess(n,e)}const Nz=1735152710,zg=!0;function PR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),x0(i,4)}function FR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),x0(i,4)}function Kfe(n,e){return LR.apply(this,arguments)}function LR(){return(LR=ni(function*(n,e,t=0,i,r){var s,o,a,l;Yfe(n,e,t,i),Mfe(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Xfe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Qfe(n,i,r);c.push(f)}const d=xfe(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?Lfe(n,i):n})).apply(this,arguments)}function Yfe(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=Nz}=t,s=i.getUint32(e,!1);return s===r||s===Nz}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?cz(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?cz(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,zg),a=r.getUint32(t+8,zg);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){yf(n.header.byteLength>20);const i=e.getUint32(t+0,zg),r=e.getUint32(t+4,zg);return t+=8,yf(0===r),PR(n,e,t,i),(t+=i)+FR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return yf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,zg),s=e.getUint32(t+4,zg);switch(t+=8,s){case 1313821514:PR(n,e,t,r);break;case 5130562:FR(n,e,t,r);break;case 0:i.strict||PR(n,e,t,r);break;case 1:i.strict||FR(n,e,t,r)}t+=x0(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),La("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else La(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Xfe(n,e,t){return kR.apply(this,arguments)}function kR(){return(kR=ni(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield tpe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function tpe(n){return zR.apply(this,arguments)}function zR(){return(zR=ni(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const Pz=[255,255,255,255],rpe={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:Pz},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Hg]};let spe=(()=>{class n extends VI{getShaders(){const t=[VU,$U];return"pbr"===this.props._lighting&&t.push(JU),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:Pz,transition:!0},instanceModelMatrix:XU})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Bg)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new dhe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ht({gltf:l},c),function(n){return UR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Oi.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Bg?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Oi.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Oi.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Bg&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:ht({isInstanced:!0,transpileToGLSL100:!pi(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:QU(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=rpe,n})();const ope=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),ape=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),lpe=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),cpe=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),upe={POSITION:{size:3,value:new Float32Array(ape)},NORMAL:{size:3,value:new Float32Array(lpe)},TEXCOORD_0:{size:2,value:new Float32Array(cpe)}};class dpe extends hS{constructor(e={}){const{id:t=jc("cube-geometry")}=e;super(Un(ht({},e),{id:t,indices:{size:1,value:new Uint16Array(ope)},attributes:ht(ht({},upe),e.attributes)}))}}class Kc{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new le){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new le){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new le){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new le){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new le){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new le){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new le){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=fpe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=ppe;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(Fz),Fz.almostEquals(e,t)}clone(){return new le(this.x,this.y,this.z)}}le.ZERO=void 0,le.UNIT_X=void 0,le.UNIT_Y=void 0,le.UNIT_Z=void 0,le.ZERO=new le(0,0,0),le.UNIT_X=new le(1,0,0),le.UNIT_Y=new le(0,1,0),le.UNIT_Z=new le(0,0,1);const fpe=new le,ppe=new le,Fz=new le;class ar{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new le,this.upperBound=new le,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=kz;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=kz;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const Lz=new le,kz=[new le,new le,new le,new le,new le,new le,new le,new le];class ss{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new le){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=mpe;e.tangents(i,_pe),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(_r(e.length(),2)*_r(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new ss){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new ss){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new ss){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new le){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new ss(this.x,this.y,this.z,this.w)}slerp(e,t,i=new ss){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,x,A,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-t)*p)/_,A=Math.sin(t*p)/_):(x=1-t,A=t),i.x=x*r+A*l,i.y=x*s+A*c,i.z=x*o+A*d,i.w=x*a+A*f,i}integrate(e,t,i,r=new ss){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const mpe=new le,_pe=new le,ype={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let dn=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=ype,n})();class Ni{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new ss,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Ni.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Ni.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new le){return i.vsub(e,r),t.conjugate(jz),jz.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new le){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new le){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new le){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const jz=new ss;class wf extends dn{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:dn.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new le;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=x,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,d=new le,f=new le,p=new le,g=new le,_=new le;let x=Number.MAX_VALUE;const A=this;if(A.uniqueAxes)for(let W=0;W!==A.uniqueAxes.length;W++){i.vmult(A.uniqueAxes[W],c);const G=A.testSepAxis(c,e,t,i,r,s);if(!1===G)return!1;G0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){wf.project(this,e,i,r,HR),wf.project(t,e,s,o,GR);const l=HR[0],c=HR[1],d=GR[0],f=GR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?hn.STATIC:hn.DYNAMIC,typeof e.type==typeof hn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=hn.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new le,this.quaternion=new ss,this.initQuaternion=new ss,this.previousQuaternion=new ss,this.interpolatedQuaternion=new ss,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new le,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new le,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new le,this.invInertia=new le,this.invInertiaWorld=new Kc,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new Kc,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new le(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new le(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new ar,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new le,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=hn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===hn.SLEEPING&&this.dispatchEvent(hn.wakeupEvent)}sleep(){this.sleepState=hn.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=_r(this.sleepSpeedLimit,2);t===hn.AWAKE&&ir?this.wakeUp():t===hn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(hn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===hn.SLEEPING||this.type===hn.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new le){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new le){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new le,s=new ss;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=wpe,o=Epe,a=this.quaternion,l=this.aabb,c=Spe;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=xpe,r=Cpe;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==hn.DYNAMIC)return;this.sleepState===hn.SLEEPING&&this.wakeUp();const i=Ape;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==hn.DYNAMIC)return;const i=Tpe,r=Mpe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===hn.DYNAMIC&&(this.sleepState===hn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==hn.DYNAMIC)return;this.sleepState===hn.SLEEPING&&this.wakeUp();const i=t,r=Dpe;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=Ipe;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==hn.DYNAMIC)return;const i=Rpe,r=Ope;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=Npe;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),wS.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new le;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==hn.DYNAMIC&&this.type!==hn.KINEMATIC||this.sleepState===hn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,x=this.angularFactor,A=l.x*x.x,W=l.y*x.y,G=l.z*x.z;s.x+=e*(_[0]*A+_[1]*W+_[2]*G),s.y+=e*(_[3]*A+_[4]*W+_[5]*G),s.z+=e*(_[6]*A+_[7]*W+_[8]*G),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}hn.idCounter=0,hn.COLLIDE_EVENT_NAME="collide",hn.DYNAMIC=1,hn.STATIC=2,hn.KINEMATIC=4,hn.AWAKE=0,hn.SLEEPY=1,hn.SLEEPING=2,hn.wakeupEvent={type:"wakeup"},hn.sleepyEvent={type:"sleepy"},hn.sleepEvent={type:"sleep"};const wpe=new le,Epe=new ss,Spe=new ar,xpe=new Kc,Cpe=new Kc,Ape=new le,Tpe=new le,Mpe=new le,Dpe=new le,Ipe=new le,Rpe=new le,Ope=new le,Npe=new le;new le,new le;class ES{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new le,this.rayToWorld=new le,this.hitNormalWorld=new le,this.hitPointWorld=new le,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let Vz,Uz,zz,Hz,Gz,$z,Wz;Vz=dn.types.SPHERE,Uz=dn.types.PLANE,zz=dn.types.BOX,Hz=dn.types.CYLINDER,Gz=dn.types.CONVEXPOLYHEDRON,$z=dn.types.HEIGHTFIELD,Wz=dn.types.TRIMESH;class fs{get[Vz](){return this._intersectSphere}get[Uz](){return this._intersectPlane}get[zz](){return this._intersectBox}get[Hz](){return this._intersectConvex}get[Gz](){return this._intersectConvex}get[$z](){return this._intersectHeightfield}get[Wz](){return this._intersectTrimesh}constructor(e=new le,t=new le){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new le,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=fs.ANY,this.result=new ES,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||fs.ANY,this.result=t.result||new ES,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(qz),KR.length=0,e.broadphase.aabbQuery(e,qz,KR),this.intersectBodies(KR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=Vpe,s=Upe;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new le(0,0,1);t.vmult(c,c);const d=new le;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;A>=0&&A<=1&&(o.lerp(a,A,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Wpe,l=Yz,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,A=_.distanceTo(this.to),W=c?c.length:d.length,G=this.result;for(let ge=0;!G.shouldStop&&geA||this.reportIntersection(a,aa,s,r,Ne)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=qpe,l=Jpe,c=ege,d=Yz,f=Kpe,p=Ype,g=Xpe,_=Zpe,x=Qpe,A=e.indices,W=this.from,G=this.to,ge=this.direction;c.position.copy(i),c.quaternion.copy(t),Ni.vectorToLocalFrame(i,t,ge,f),Ni.pointToLocalFrame(i,t,W,p),Ni.pointToLocalFrame(i,t,G,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const Ne=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Ge=0,$e=l.length;!this.result.shouldStop&&Ge!==$e;Ge++){const at=l[Ge];e.getNormal(at,a),e.getVertex(A[3*at],ac),ac.vsub(p,d);const St=f.dot(a),Rt=a.dot(d)/St;if(Rt<0)continue;f.scale(Rt,aa),aa.vadd(p,aa),e.getVertex(A[3*at+1],Xc),e.getVertex(A[3*at+2],Qc);const Pt=aa.distanceSquared(p);!fs.pointInTriangle(aa,Xc,ac,Qc)&&!fs.pointInTriangle(aa,ac,Xc,Qc)||Pt>Ne||(Ni.vectorToWorldFrame(t,a,x),Ni.pointToWorldFrame(i,t,aa,_),this.reportIntersection(x,_,s,r,at))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case fs.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case fs.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var Af=tt(517);class Or extends ee{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new U;return this._value}next(e){super.next(this._value=e)}}function qg(n,e,t){e||(e=new $n($n.IDENTITY));const i=new $n($n.IDENTITY);if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new $n($n.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new $n(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===qg(s,r,t))return!1;return!0}function V4(){WV([hz,Hg])}function U4(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||qg(r,new $n($n.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function ZR(n,e){return ir(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield JE(i,Hg,{DracoLoader:SR,gltf:{decompressMeshes:!0,postProcess:!0}});return U4(n.scenegraphNode,r)})}function tye(n,e){return ir(this,void 0,void 0,function*(){return U4(n,yield e)})}function JR(n,e,t){if(e&&0!==e.length)return new Ide(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mi.CARTESIAN,data:e,mesh:new dpe,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let iye=(()=>{class n extends Ole{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),V4()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){ir(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new $n(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new ar({lowerBound:new le(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new le(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield eS(o.scenegraph,Hg,{DracoLoader:SR,decompress:!0,postProcess:!0});for(const l of a.scenes)qg(l,new $n(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new ar({lowerBound:new le(...p.map((_,x)=>Math.min(_,g[x]))),upperBound:new le(...g.map((_,x)=>Math.max(_,p[x])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=ZR({scenegraph:l.scenegraph},n.gltfCache));return[JR("cubes",i,{wireframe:!1,pickable:!1}),JR("pickableCubes",r,{wireframe:!1,pickable:!0}),JR("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new spe({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Mi.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?tye(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function z4(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),z4(t,e);return e}let sye=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new iye({}),this.nodeClickSubject=new ee,this.nodeHoverStartSubject=new ee,this.nodeHoverStopSubject=new ee,this.sceneRotationSubject=new Or([0,0]),this.nodeDragStartSubject=new ee,this.nodeDragSubject=new ee,this.nodeDragEndSubject=new ee,this.nodeClick$=this.nodeClickSubject.pipe(ms()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ms()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ms()),this.sceneRotation$=this.sceneRotationSubject.pipe(ms()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ms()),this.nodeDrag$=this.nodeDragSubject.pipe(ms()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ms());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Gle({flipY:!1,near:-1e3}):new qle({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new WI({ambientLight:new nU({color:[255,255,255],intensity:10})})]),this.deck=new dS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return ir(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new $n([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return ir(this,void 0,void 0,function*(){V4();const i=yield ZR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)qg(o,e=new $n(e||$n.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new $n(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new $n(e||$n.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new ar({lowerBound:new le(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new le(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of z4(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new $n($n.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new $n(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return Ia([Af.ZP],n.prototype,"_onHover",null),Ia([Af.ZP],n.prototype,"_onClick",null),Ia([Af.ZP],n.prototype,"_onViewStateChange",null),Ia([Af.ZP],n.prototype,"_onDragStart",null),Ia([Af.ZP],n.prototype,"_onDrag",null),Ia([Af.ZP],n.prototype,"_onDragEnd",null),n})();function oye(n,e){return n===e}function aye(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let eO=(()=>{class n{constructor(){this.bootstrap$=new mg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const tO=new Vt("INITIAL_STATE_TOKEN");let uye=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const G4=new Vt("Internals.StateContextFactory"),$4=new Vt("Internals.StateFactory");function O0(...n){if(1===n.length){const e=n[0];if(L(e))return RS(e,null);if(re(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return RS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return RS(n=1===n.length&&L(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return RS(n,null)}function RS(n,e){return new F(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function Ui(n,e){return function(i){return i.lift(new dye(n,e))}}class dye{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new hye(e,this.predicate,this.thisArg))}}class hye extends y{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}function ka(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new mg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const W4=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function Yi(n){return e=>0===n?mE():e.lift(new pye(n))}class pye{constructor(e){if(this.total=e,this.total<0)throw new W4}call(e,t){return t.subscribe(new gye(e,this.total))}}class gye extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function q4(n,e){return e?t=>t.pipe(q4((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new mye(n))}class mye{constructor(e){this.project=e}call(e,t){return t.subscribe(new _ye(e,this.project))}}class _ye extends fe{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new wt(this),i=this.destination;i.add(t);const r=R(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function OS(n=null){return e=>e.lift(new yye(n))}class yye{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new vye(e,this.defaultValue))}}class vye extends y{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function lc(n){return function(t){const i=new bye(n),r=t.lift(i);return i.caught=r}}class bye{constructor(e){this.selector=e}call(e,t){return t.subscribe(new wye(e,this.selector,this.caught))}}class wye extends fe{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new wt(this);this.add(i);const r=R(t,i);r!==i&&this.add(r)}}}function os(n){return e=>e.lift(new Eye(n))}class Eye{constructor(e){this.notifier=e}call(e,t){const i=new Sye(e),r=R(this.notifier,new wt(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class Sye extends fe{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function nh(){}function Zr(n,e,t){return function(r){return r.lift(new xye(n,e,t))}}class xye{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Cye(e,this.nextOrObserver,this.error,this.complete))}}class Cye extends y{constructor(e,t,i,r){super(e),this._tapNext=nh,this._tapError=nh,this._tapComplete=nh,this._tapError=i||nh,this._tapComplete=r||nh,K(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||nh,this._tapError=t.error||nh,this._tapComplete=t.complete||nh)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}function $u(n,e){return t=>t.lift(new Aye(n,e))}class Aye{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new Tye(e,this.compare,this.keySelector))}}class Tye extends y{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}const Ba={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let K4=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(n){return"server"===n}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return mn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return mn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof mn||console.warn(Ba.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn),Ie(Pc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Y4=new Vt("ROOT_STATE_TOKEN"),X4=new Vt("FEATURE_STATE_TOKEN"),Q4=new Vt("NGXS_PLUGINS"),Z4=new Vt("NG_TEST_MODE"),J4=new Vt("NG_DEV_MODE"),Wu="NGXS_META",e8="NGXS_OPTIONS_META";let Tf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=K4}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Mye{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const t8=new Vt("NGXS_EXECUTION_STRATEGY");function Mf(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const n8=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},NS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),iO=n=>n&&"object"==typeof n&&!Array.isArray(n),rO=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(iO(n)&&iO(t))for(const i in t)iO(t[i])?(n[i]||Object.assign(n,{[i]:{}}),rO(n[i],t[i])):Object.assign(n,{[i]:t[i]});return rO(n,...e)};function N0(n){return n[Wu]}function r8(n,e){const t=NS(e.currentAppState,n.path),i=NS(e.newAppState,n.path);return new Mye(t,i,!n.isInitialised)}function Lye(...n){return function(n,e,t=jye){const i=function(n){return n.reduce((e,t)=>(e[Mf(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Ui(t=>{const i=Mf(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function jye(){return me(n=>n.action)}function PS(n){return e=>new F(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let FS=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(t8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class zye extends ee{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let LS=(()=>{class n extends zye{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Hye=(()=>{class n extends F{constructor(t,i){super(r=>{const s=t.pipe(PS(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(Ie(LS),Ie(FS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const s8=n=>(...e)=>n.shift()(...e,(...i)=>s8(n)(...i));let kS=(()=>{class n extends Or{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),lO=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(Q4,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),cO=(()=>{class n extends ee{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),o8=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Zo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(PS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?an(this._stateStream.getValue()):O0(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!Mf(t))return gg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return s8([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(ka())}getActionResultStream(t){return this._actionResults.pipe(Ui(i=>i.action===t&&"DISPATCHED"!==i.status),Yi(1),ka())}createDispatchObservable(t){return t.pipe(q4(i=>{switch(i.status){case"SUCCESSFUL":return an(this._stateStream.getValue());case"ERRORED":return gg(i.error);default:return Lc}})).pipe(ka())}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(LS),Ie(cO),Ie(lO),Ie(kS),Ie(FS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const a8=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&a8(n[i])}),n};let l8=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(J4),Ie(Z4))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),c8=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Ba.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ba.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(l8),Ie(Tf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Yg=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=a8(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(Ie(kS),Ie(o8),Ie(Tf),Ie(c8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),BS=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return NS(l,t.path)}function s(l,c){const d=n8(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=r8(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Ba.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ba.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Yg))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class jS{static stateNameErrorMessage(e){return Ba.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ba.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Ba.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=N0(e);if(!t)throw new Error(Ba.STATE_DECORATOR());return t}}jS.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Xg=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=H4(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(jS.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[Wu].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[Wu];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[Wu].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[Wu];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>n8(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ui(t=>"DISPATCHED"===t.status),k(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),OS({action:t,status:"CANCELED"}),lc(i=>an({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=Mf(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=Pe(d)),d instanceof F?(d=d.pipe(OS({})),l.options.cancelUncompleted&&(d=d.pipe(os(t.pipe(Lye(i)))))):d=an({}).pipe(ka()),s.push(d)}catch(d){s.push(gg(d))}}}return s.length||s.push(an({})),O0(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=jS.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==NS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(Tf),Ie(n,12),Ie(LS),Ie(cO),Ie(BS),Ie(tO,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),uO=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ui(()=>!!i),Zr(()=>this.invokeInit(i.states)),k(()=>this.bootstrapper.appBootstrapped$),Ui(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=r8(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Yg),Ie(BS),Ie(eO))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();let ih=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(me(i),lc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?an(void 0):gg(r)}),$u(),PS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Yi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(PS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=function(n){return n.NGXS_SELECTOR_META}(n)||N0(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(kS),Ie(Yg),Ie(Tf),Ie(FS),Ie(Xg),Ie(tO,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),P0=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(Tf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class Xye{static get type(){return"@@INIT"}}class Qye{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const US=new mg(1);let FO,Jye=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Da();US.next(t)}catch(n){US.next(!1)}finally{US.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new Xye,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Xg),Ie(Yg),Ie(ih),Ie(P0),Ie(Y4,8),Ie(uO))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})(),e0e=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new Qye(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(Yg),Ie(Xg),Ie(X4,8),Ie(uO))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();class la{static forRoot(e=[],t={}){return{ngModule:Jye,providers:[Xg,BS,Hye,LS,eO,c8,l8,uO,o8,cO,Yg,FS,ih,kS,P0,lO,...e,...la.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:e0e,providers:[Xg,lO,...e,{provide:X4,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:Z4,useValue:cye},{provide:J4,useValue:Da},{provide:t8,useClass:t.executionStrategy||K4},{provide:Y4,useValue:e},{provide:la.ROOT_OPTIONS,useValue:t},{provide:Tf,useFactory:la.ngxsConfigFactory,deps:[la.ROOT_OPTIONS]},{provide:Bw,useFactory:la.appBootstrapListenerFactory,multi:!0,deps:[eO]},{provide:tO,useFactory:la.getInitialState},{provide:G4,useExisting:BS},{provide:$4,useExisting:Xg}]}static ngxsConfigFactory(e){return rO(new Tf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return uye.pop()}}function n0e(n){return i=>{!function(n){US.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ba.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(Wu)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,Wu,{value:e})}return N0(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[e8]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;jS.checkCorrectStateName(d),s.hasOwnProperty(Wu)&&(r.actions=Object.assign({},r.actions,(s[Wu]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[e8]=a}}la.\u0275fac=function(e){return new(e||la)},la.\u0275mod=gn({type:la}),la.\u0275inj=Et({}),la.ROOT_OPTIONS=new Vt("ROOT_OPTIONS"),new Jl(gE);try{FO="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){FO=!1}"undefined"!=typeof Element&∈function YH(n){Promise.resolve(null).then(n)}class nm{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){YH(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function QH(){return"undefined"!=typeof window&&void 0!==window.document}function UO(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let $O=(n,e)=>!1,WO=(n,e)=>!1,e5=(n,e,t)=>[];const t5=UO();(t5||"undefined"!=typeof Element)&&($O=QH()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),WO=(()=>{if(t5||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):WO}})(),e5=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return qO(t)}matchesElement(t,i){return KO(t,i)}containsElement(t,i){return YO(t,i)}query(t,i,r){return XO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new nm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ox{}ox.NOOP=new r5;function l5(n,e,t){return t?e+":"+t+";":""}function c5(n){let e="";for(let t=0;t{const r=tN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),UO()&&c5(n))}function Pf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=tN(t);n.style[i]=""}),UO()&&c5(n))}const ebe=/-+([a-z0-9])/g;function tN(n){return n.replace(ebe,(...e)=>e[1].toUpperCase())}function tbe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class sm{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=sm.initialStylesByElement.get(e);r||sm.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&eu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(eu(this._element,this._initialStyles),this._endStyles&&(eu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(sm.initialStylesByElement.delete(this._element),this._startStyles&&(Pf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Pf(this._element,this._endStyles),this._endStyles=null),eu(this._element,this._initialStyles),this._state=3)}}sm.initialStylesByElement=new WeakMap;let Lf;try{Lf="undefined"!=typeof Intl}catch(n){Lf=!1}new class extends Jl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let tEe=1;const nEe=Promise.resolve(),Mx={};function o6(n){return n in Mx&&(delete Mx[n],!0)}const a6={setImmediate(n){const e=tEe++;return Mx[e]=!0,nEe.then(()=>o6(e)&&n()),e},clearImmediate(n){o6(n)}};new class extends Jl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=a6.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(a6.clearImmediate(t),e.scheduled=void 0)}});function X0(n){return!!n&&(n instanceof F||"function"==typeof n.lift&&"function"==typeof n.subscribe)}function Ix(...n){return It(1)(an(...n))}function Vo(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>Ix(n,t,e)):t=>Ix(n,t)}function V6(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>me(function(n,e){return i=>{let r=i;for(let s=0;s{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&qx(n[o])}),n};function kG(n){return Ha(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const VG="NGXS_DATA_META",GN="NGXS_META",UG="NGXS_ARGUMENT_REGISTRY_META";let zG=(()=>{class n{constructor(t){this.sequence$=new Or(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function nv(n){return n[VG]}let Ga=(()=>{class n{constructor(t,i,r){n.store=t.get(ih),n.ngZone=t.get(mn),n.factory=i,n.context=r,n.computed=t.get(zG)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie($4),Ie(G4))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ls{constructor(){ls.statesCachedMeta.clear()}static createStateContext(e){return Ga.context.createStateContext(e)}static ensureMappedState(e){if(za(Ga.factory)||za(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(Ha(e.name)?ls.statesCachedMeta.get(e.name):null)||ls.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=nv(ls.getStateClassByInstance(e)))&&void 0!==t?t:null;if(za(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=ls.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=ls.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=Ha(e.name)?null===(t=Ga.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Ha(i)&&Ha(e.name)&&ls.statesCachedMeta.set(e.name,i),i}}ls.statesCachedMeta=new Map,ls.\u0275fac=function(e){return new(e||ls)},ls.\u0275prov=We({token:ls,factory:ls.\u0275fac}),new mg(1);class ACe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Ha(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function HG(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function GG(n){var e;const t=HG(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=LG(void 0===t.defaults?{}:t.defaults);if(i.length){if(kG(s))return function(n,e){return e.reduce((t,i)=>{const r=HG(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=GG(i),t},null!=n?n:{})}(s,i);throw new ACe(s)}return s}function WG(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function qG(){var n,e;return null!==(e=null===(n=null==Ga?void 0:Ga.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function ICe(n){let e=!1;return X0(n)&&(e=!0),e}function $N(n){return n[UG]}class RCe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class OCe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(zN(this.argumentMap.has(e))||zN(this.payloadMap.has(e)))throw new RCe(e,t)}}function BCe(n){return{enumerable:!0,configurable:!0,get(){const e=nv(n),t=ls.ensureMappedState(e.stateMeta);return ls.createStateContext(t)}}}function KG(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(kG(i))for(;null!==i;){if(tv(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return za(WG(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),WG(n)}(this),o=null==s?void 0:s.get(i);if(tv(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(za(o)||o.sequenceId!==qG()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:qG(),isObservable:ICe(l)}),l}return o.value},t}}const GCe={cancelUncompleted:!0,insideZone:!1};function WN(n=GCe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=ls.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=$N(r);if(za(f)){const G=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),ge=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var G;return tv(n.insideZone)?null===(G=Ga.ngZone)||void 0===G||G.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),X0(l)?an(null).pipe(me(()=>l)):l};const A=ls.createAction(f,o,g),W=Ga.store.dispatch(A);return X0(l)?function(n,e){return O0([n,e]).pipe(me(t=>t.pop()))}(W,l):l},i}}function YG(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return za($N(t))&&Object.defineProperties(t,{[UG]:{enumerable:!0,configurable:!0,value:new OCe}}),$N(t)})(e,t).createPayloadType(r,t,i)}}function WCe(){return n=>{const e=function(n){if(function(n){return!zN(n)}(n.hasOwnProperty(GN))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,GN,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[GN]}(n)}(n);if(za(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=nv(n))&&void 0!==e?e:null;return(za(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,VG,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),nv(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>LG(t)},context:BCe(n)})}(n,e,GG(n)),function(n){var e,t;const i=nv(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(Ha(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Ha(this[s]))return this[s];if(za(Ga.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ga.store.select(n).pipe(me(o=>Da()?qx(o):o),ka({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let KCe=(()=>{class n{constructor(){this.browserStorageEvents$=new ee,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),YCe=(()=>{class n extends KCe{get snapshot(){return function(n){return Da()?qx(n):n}(this.getState())}get ctx(){return function(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>Da()?qx(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ia([KG(),ec("design:type",Object),ec("design:paramtypes",[])],n.prototype,"snapshot",null),Ia([WN(),z3(0,YG("patchValue")),ec("design:type",Function),ec("design:paramtypes",[Object]),ec("design:returntype",void 0)],n.prototype,"patchState",null),Ia([WN(),z3(0,YG("stateValue")),ec("design:type",Function),ec("design:paramtypes",[Object]),ec("design:returntype",void 0)],n.prototype,"setState",null),Ia([WN(),ec("design:type",Function),ec("design:paramtypes",[]),ec("design:returntype",void 0)],n.prototype,"reset",null),n})();new Vt("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})});const mP=new Vt("ngx-window",{providedIn:"root",factory:()=>function(n){return function(n){return n===x3}(n)?window:null}(xc(Pc))}),_Me=new Vt("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(xc(mP))});new Vt("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(xc(mP),xc(_Me))}),new Vt("ngx-google-analytics-routing-settings",{factory:()=>({})}),new Vt("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"});const DMe=["bodyCanvas"];let IMe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new cn,this.nodeDrag=new cn,this.nodeClick=new cn,this.nodeHoverStart=new cn,this.nodeHoverStop=new cn,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return ir(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new sye({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=wn({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Ms(DMe,5,An),2&t){let r;Ai(r=Ti())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&xu(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&function(n,e,t,i){Kt(n,e,t,i),Yt()}(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),RMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({imports:[[Ws]]}),n})();new Vt("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10}),[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].filter(n=>!0!==n.disabled);let hv=(()=>{let n=class extends YCe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ui(n=>null!=n),ka(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(V6(...t),$u(),ka(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(V6(...t),$u(),ka(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ia([KG()],n.prototype,"config$",null),n=Ia([WCe(),n0e({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();const l7="http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity",aDe=[173,255,47,229.5];var ei=tt(440),hDe=tt(698),fDe=tt(445),pDe=tt.n(fDe),En=tt(815),$a=tt(609);const Hi=ei.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},ei.DataFactory),ym=(Hi("rdf"),Hi("rdf")("type"),{x:Hi("rdfs"),label:Hi("rdfs")("label"),comment:Hi("rdfs")("comment"),isDefinedBy:Hi("rdfs")("isDefinedBy"),seeAlso:Hi("rdfs")("seeAlso")}),Os={x:Hi("entity"),id:Hi("entity")("id"),label:ym.label,description:ym.comment,link:ym.seeAlso,sex:Hi("entity")("sex"),age:Hi("entity")("age"),bmi:Hi("entity")("bmi"),Male:ei.DataFactory.literal("Male"),Female:ei.DataFactory.literal("Female"),consortiumName:Hi("entity")("consortium_name"),providerName:Hi("entity")("provider_name"),providerUUID:Hi("entity")("provider_uuid"),donor:Hi("entity")("has_donor"),sections:Hi("entity")("has_tissue_section"),datasets:Hi("entity")("has_dataset"),sampleType:Hi("entity")("sample_type"),TissueBlock:ei.DataFactory.literal("Tissue Block"),TissueSection:ei.DataFactory.literal("Tissue Section"),NonStandard:ei.DataFactory.literal("Non-standard"),sectionCount:Hi("entity")("section_count"),sectionSize:Hi("entity")("section_size"),sectionUnits:Hi("entity")("section_units"),sectionNumber:Hi("entity")("section_number"),spatialEntity:Hi("entity")("has_spatial_entity"),ontologyTerms:Hi("entity")("has_ontology_term"),technology:Hi("entity")("technology"),thumbnail:Hi("entity")("has_thumbnail")},In=Hi("ccf"),dc={x:In,ontologyNode:{label:In("ccf_preferred_label"),parent:In("ccf_part_of"),children:In("ccf_part_of"),rui_rank:In("ccf_rui_rank"),synonymLabels:ei.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:In("VHFemale"),Male:In("VHMale"),BothSexes:In("VHBothSexes"),FemaleOrgans:In("VHFemaleOrgans"),MaleOrgans:In("VHMaleOrgans")},SpatialObjectReference:In("SpatialObjectReference"),SpatialEntity:In("SpatialEntity"),SpatialPlacement:In("SpatialPlacement"),spatialObjectReference:{file:In("has_object_file"),file_format:In("has_object_file_format"),file_subpath:In("has_object_file_subpath")},extractionSet:{label:ym.label,rui_rank:In("ccf_rui_rank")},spatialEntity:{label:ym.label,comment:ym.comment,creator:Hi("dc")("creator"),creator_first_name:In("creator_first_name"),creator_last_name:In("creator_last_name"),creator_orcid:In("creator_orcid"),creation_date:In("creation_date"),updated_date:In("updated_date"),ccf_annotations:In("ccf_annotation"),representation_of:In("ccf_representation_of"),reference_organ:In("anatomical_structure_of"),extraction_set_for:In("extraction_set_for"),extraction_set:In("extraction_site_for"),sex:In("has_sex"),side:In("has_side"),rui_rank:In("ccf_rui_rank"),slice_thickness:In("ccf_slice_thickness"),slice_count:In("ccf_slice_count"),x_dimension:In("has_x_dimension"),y_dimension:In("has_y_dimension"),z_dimension:In("has_z_dimension"),dimension_units:In("has_dimension_units"),object:In("has_object_reference")},spatialPlacement:{source:In("has_placement_source"),target:In("has_placement_target"),placement_date:In("has_placement_date"),x_scaling:In("has_x_scaling"),y_scaling:In("has_y_scaling"),z_scaling:In("has_z_scaling"),scaling_units:In("has_scaling_units"),x_rotation:In("has_x_rotation"),y_rotation:In("has_y_rotation"),z_rotation:In("has_z_rotation"),w_rotation:In("has_theta_rotation"),rotation_order:In("has_rotation_order"),rotation_units:In("has_rotation_units"),x_translation:In("has_x_translation"),y_translation:In("has_y_translation"),z_translation:In("has_z_translation"),translation_units:In("has_translation_units")}},Tr={x:Hi("uberon")},mDe=(Hi("lmha"),{bladder:Tr.x("0001255"),body:Tr.x("0013702"),brain:Tr.x("0000955"),colon:Tr.x("0001155"),heart:Tr.x("0000948"),kidney:Tr.x("0002113"),large_intestine:Tr.x("0000059"),left_kidney:Tr.x("0004538"),left_lung:Tr.x("0002168"),left_ureter:Tr.x("0001223"),liver:Tr.x("0002107"),lung:Tr.x("0002048"),respiratory_system:Tr.x("0001004"),lymph_node:Tr.x("0000029"),pelvis:Tr.x("0001270"),rectum:Tr.x("0001052"),right_kidney:Tr.x("0004539"),right_lung:Tr.x("0002167"),right_ureter:Tr.x("0001222"),skin:Tr.x("0002097"),small_intestine:Tr.x("0002108"),spleen:Tr.x("0002106"),thymus:Tr.x("0002370"),ureter:Tr.x("0000056"),vasculature:Tr.x("0002049")});function vP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const f1={spatialObjectReference:vP(dc.spatialObjectReference),spatialEntity:vP(dc.spatialEntity),spatialPlacement:vP(dc.spatialPlacement)};function p1(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,$a.fromRdf)(s.object):s.object.id;(0,En.set)(r,o,a)}return!1},ei.DataFactory.namedNode(e),null,null,null),r}const yDe=(0,En.memoize)(function(n,e){return p1(n,e,"SpatialObjectReference",f1.spatialObjectReference)},(n,e)=>e),bDe=(0,En.memoize)(function(n,e){const t=p1(n,e,"ExtractionSet",f1.spatialEntity);return t.extractionSites=(0,En.sortBy)(n.getSubjects(dc.spatialEntity.extraction_set,e,null).map(i=>vm(n,i.id)),["rui_rank"]),t},(n,e)=>e);(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(dc.spatialEntity.extraction_set_for,e,null).map(t=>bDe(n,t.id)),["rui_rank"])},(n,e)=>e),(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(dc.spatialEntity.reference_organ,e,null).map(t=>vm(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),(0,En.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(vm(n,t.subject.id))},null,dc.spatialEntity.reference_organ,null,null),(0,En.sortBy)(e,["rui_rank"])});const vm=(0,En.memoize)(function(n,e){const t=p1(n,e,"SpatialEntity",f1.spatialEntity);return t.object&&(t.object=yDe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,dc.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,Os.spatialEntity,e,null),t},(n,e)=>e);(0,En.memoize)(function(n,e){const t=p1(n,e,"SpatialPlacement",f1.spatialPlacement);return t.source&&(t.source=vm(n,t.source)),t.target&&(t.target=vm(n,t.target)),t},(n,e)=>e),(0,En.memoize)(function(n,e){const t=n.getObjects(ei.DataFactory.namedNode(e),Os.spatialEntity,null);if(t.length>0)return vm(n,t[0].id)},(n,e)=>e),new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),function(){const n={};Object.entries(mDe).forEach(([e,t])=>n[e]=t.id)}();const y1={[Os.label.id]:"label",[Os.description.id]:"description",[Os.link.id]:"link"},WDe=Object.assign(Object.assign({},y1),{[Os.providerName.id]:"providerName"}),qDe=Object.assign(Object.assign({},y1),{[Os.technology.id]:"technology",[Os.thumbnail.id]:"thumbnail"}),KDe=Object.assign(Object.assign({},y1),{[Os.sampleType.id]:"sampleType",[Os.sectionNumber.id]:"sectionNumber",[Os.datasets.id]:"datasets"}),YDe=Object.assign(Object.assign({},y1),{[Os.sampleType.id]:"sampleType",[Os.sectionCount.id]:"sectionCount",[Os.sectionSize.id]:"sectionSize",[Os.sectionUnits.id]:"sectionUnits",[Os.donor.id]:"donor",[Os.spatialEntity.id]:"spatialEntityId",[Os.sections.id]:"sections",[Os.datasets.id]:"datasets"}),QDe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=WDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function d7(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=qDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t}(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=YDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=KDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=d7(n,s);t[r].push(o)}else(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=d7(n,s);t[r].push(o)}else"donor"===r?t[r]=QDe(n,s):(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);const h7={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};function ru(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let bP;function hc(){return bP||(bP=function(n,e){const t=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const i=()=>indexedDB.databases().finally(t);e=setInterval(i,100),i()}).finally(()=>clearInterval(e))}().then(()=>{const i=indexedDB.open("keyval-store");return i.onupgradeneeded=()=>i.result.createObjectStore(e),ru(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),bP}function f7(n,e=hc()){return e("readonly",t=>ru(t.get(n)))}const Gi=ei.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},ei.DataFactory),p7={x:Gi("rdf"),type:Gi("rdf")("type")},bm={x:Gi("rdfs"),label:Gi("rdfs")("label"),comment:Gi("rdfs")("comment"),isDefinedBy:Gi("rdfs")("isDefinedBy"),seeAlso:Gi("rdfs")("seeAlso")},gi={x:Gi("entity"),id:Gi("entity")("id"),label:bm.label,description:bm.comment,link:bm.seeAlso,sex:Gi("entity")("sex"),age:Gi("entity")("age"),bmi:Gi("entity")("bmi"),Male:ei.DataFactory.literal("Male"),Female:ei.DataFactory.literal("Female"),consortiumName:Gi("entity")("consortium_name"),providerName:Gi("entity")("provider_name"),providerUUID:Gi("entity")("provider_uuid"),donor:Gi("entity")("has_donor"),sections:Gi("entity")("has_tissue_section"),datasets:Gi("entity")("has_dataset"),sampleType:Gi("entity")("sample_type"),TissueBlock:ei.DataFactory.literal("Tissue Block"),TissueSection:ei.DataFactory.literal("Tissue Section"),NonStandard:ei.DataFactory.literal("Non-standard"),sectionCount:Gi("entity")("section_count"),sectionSize:Gi("entity")("section_size"),sectionUnits:Gi("entity")("section_units"),sectionNumber:Gi("entity")("section_number"),spatialEntity:Gi("entity")("has_spatial_entity"),ontologyTerms:Gi("entity")("has_ontology_term"),technology:Gi("entity")("technology"),thumbnail:Gi("entity")("has_thumbnail")},Rn=Gi("ccf"),lr={x:Rn,ontologyNode:{label:Rn("ccf_preferred_label"),parent:Rn("ccf_part_of"),children:Rn("ccf_part_of"),rui_rank:Rn("ccf_rui_rank"),synonymLabels:ei.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:Rn("VHFemale"),Male:Rn("VHMale"),BothSexes:Rn("VHBothSexes"),FemaleOrgans:Rn("VHFemaleOrgans"),MaleOrgans:Rn("VHMaleOrgans")},SpatialObjectReference:Rn("SpatialObjectReference"),SpatialEntity:Rn("SpatialEntity"),SpatialPlacement:Rn("SpatialPlacement"),spatialObjectReference:{file:Rn("has_object_file"),file_format:Rn("has_object_file_format"),file_subpath:Rn("has_object_file_subpath")},extractionSet:{label:bm.label,rui_rank:Rn("ccf_rui_rank")},spatialEntity:{label:bm.label,comment:bm.comment,creator:Gi("dc")("creator"),creator_first_name:Rn("creator_first_name"),creator_last_name:Rn("creator_last_name"),creator_orcid:Rn("creator_orcid"),creation_date:Rn("creation_date"),updated_date:Rn("updated_date"),ccf_annotations:Rn("ccf_annotation"),representation_of:Rn("ccf_representation_of"),reference_organ:Rn("anatomical_structure_of"),extraction_set_for:Rn("extraction_set_for"),extraction_set:Rn("extraction_site_for"),sex:Rn("has_sex"),side:Rn("has_side"),rui_rank:Rn("ccf_rui_rank"),slice_thickness:Rn("ccf_slice_thickness"),slice_count:Rn("ccf_slice_count"),x_dimension:Rn("has_x_dimension"),y_dimension:Rn("has_y_dimension"),z_dimension:Rn("has_z_dimension"),dimension_units:Rn("has_dimension_units"),object:Rn("has_object_reference")},spatialPlacement:{source:Rn("has_placement_source"),target:Rn("has_placement_target"),placement_date:Rn("has_placement_date"),x_scaling:Rn("has_x_scaling"),y_scaling:Rn("has_y_scaling"),z_scaling:Rn("has_z_scaling"),scaling_units:Rn("has_scaling_units"),x_rotation:Rn("has_x_rotation"),y_rotation:Rn("has_y_rotation"),z_rotation:Rn("has_z_rotation"),w_rotation:Rn("has_theta_rotation"),rotation_order:Rn("has_rotation_order"),rotation_units:Rn("has_rotation_units"),x_translation:Rn("has_x_translation"),y_translation:Rn("has_y_translation"),z_translation:Rn("has_z_translation"),translation_units:Rn("has_translation_units")}},Mr={x:Gi("uberon")},g7=(Gi("lmha"),{bladder:Mr.x("0001255"),body:Mr.x("0013702"),brain:Mr.x("0000955"),colon:Mr.x("0001155"),heart:Mr.x("0000948"),kidney:Mr.x("0002113"),large_intestine:Mr.x("0000059"),left_kidney:Mr.x("0004538"),left_lung:Mr.x("0002168"),left_ureter:Mr.x("0001223"),liver:Mr.x("0002107"),lung:Mr.x("0002048"),respiratory_system:Mr.x("0001004"),lymph_node:Mr.x("0000029"),pelvis:Mr.x("0001270"),rectum:Mr.x("0001052"),right_kidney:Mr.x("0004539"),right_lung:Mr.x("0002167"),right_ureter:Mr.x("0001222"),skin:Mr.x("0002097"),small_intestine:Mr.x("0002108"),spleen:Mr.x("0002106"),thymus:Mr.x("0002370"),ureter:Mr.x("0000056"),vasculature:Mr.x("0002049")});function EP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const v1={spatialObjectReference:EP(lr.spatialObjectReference),spatialEntity:EP(lr.spatialEntity),spatialPlacement:EP(lr.spatialPlacement)};function b1(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,$a.fromRdf)(s.object):s.object.id;(0,En.set)(r,o,a)}return!1},ei.DataFactory.namedNode(e),null,null,null),r}const aIe=(0,En.memoize)(function(n,e){return b1(n,e,"SpatialObjectReference",v1.spatialObjectReference)},(n,e)=>e),m7=(0,En.memoize)(function(n,e){const t=b1(n,e,"ExtractionSet",v1.spatialEntity);return t.extractionSites=(0,En.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set,e,null).map(i=>$f(n,i.id)),["rui_rank"]),t},(n,e)=>e),uIe=(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set_for,e,null).map(t=>m7(n,t.id)),["rui_rank"])},(n,e)=>e),hIe=(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(lr.spatialEntity.reference_organ,e,null).map(t=>$f(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),pIe=(0,En.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push($f(n,t.subject.id))},null,lr.spatialEntity.reference_organ,null,null),(0,En.sortBy)(e,["rui_rank"])}),$f=(0,En.memoize)(function(n,e){const t=b1(n,e,"SpatialEntity",v1.spatialEntity);return t.object&&(t.object=aIe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,lr.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,gi.spatialEntity,e,null),t},(n,e)=>e),_Ie=(0,En.memoize)(function(n,e){const t=b1(n,e,"SpatialPlacement",v1.spatialPlacement);return t.source&&(t.source=$f(n,t.source)),t.target&&(t.target=$f(n,t.target)),t},(n,e)=>e),vIe=(0,En.memoize)(function(n,e){const t=n.getObjects(ei.DataFactory.namedNode(e),gi.spatialEntity,null);if(t.length>0)return $f(n,t[0].id)},(n,e)=>e);function bIe(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(kB),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class _7{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new hDe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},p7.type,lr.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},p7.type,lr.SpatialEntity,null);const t={};e.some(i=>(t[i.subject.id]=i.object.id,!1),null,lr.spatialPlacement.source,null,null),e.some(i=>{const r=t[i.subject.id];return r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement"),!1},null,lr.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,i,r){this.graph.mergeDirectedEdge(t,i,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new $n($n.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new $n($n.IDENTITY),s=pDe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s){if(o){const l=this.graph.getEdgeAttribute(a,o,"id");bIe(r,_Ie(i,l))}o=a}return r}}}class y7{constructor(e){this.db=e}getSpatialEntity(e){return $f(this.db.store,e)}getExtractionSets(e){return uIe(this.db.store,e)}getExtractionSet(e){return m7(this.db.store,e)}getAnatomicalStructures(e){return hIe(this.db.store,e)}getReferenceOrgans(){return pIe(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=lr.spatial.Male.id;break;case"Female":t=lr.spatial.Female.id;break;case"Both":default:t=lr.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(i=>"Male"===i.sex);break;case"Female":t=t.filter(i=>"Female"===i.sex)}return(null==e?void 0:e.debug)&&(t=t.map(i=>[[i],this.getAnatomicalStructures(i["@id"])]).reduce((i,[r,s])=>i.concat(s.length>0?s:r),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let i=[...this.getReferenceOrganSets(e).map(r=>{const s="http://purl.obolibrary.org/obo/UBERON_0002097"===r.representation_of;return this.getSceneNode(r,t,{color:[255,255,255,255],opacity:s?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!s})})];return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(lr.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(r=>void 0!==r)}getReferenceOrganScene(e,t){var i,r;const s=null!==(i=void 0!==(null==t?void 0:t.sex))&&void 0!==i&&i,o=this.getReferenceOrgans().filter(a=>a.representation_of===e&&(!s||a.sex===(null==t?void 0:t.sex)));if(o.length>0){const a=o[0],c=this.getSceneNode(a,a,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===a.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),d=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(f=>this.getSceneNode(f,a,{color:[255,255,255,229.5]}));return[c].concat(d).filter(f=>void 0!==f)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(i=>this.getSceneNode(i,t,{color:[255,255,255,229.5]})).filter(i=>void 0!==i)}getSceneNode(e,t,i={}){var r,s,o,a;const l=null===(s=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===s?void 0:s.startsWith("model/gltf");let d=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(d){if(l)d=new $n($n.IDENTITY).rotateX(kB(90)).multiplyLeft(d);else{let f;switch(e.dimension_units){case"centimeter":f=.01;break;case"millimeter":f=.001;break;case"meter":default:f=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*f/2);d.scale(p)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:l?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:l?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:d,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const w1="https://entity.api.hubmapconsortium.org/entities/",v7=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),wIe={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},E1={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},xi=function(){const n={};return Object.entries(g7).forEach(([e,t])=>n[e]=t.id),n}(),SIe={BL:[xi.body,xi.bladder],RK:[xi.body,xi.kidney,xi.right_kidney],LK:[xi.body,xi.kidney,xi.left_kidney],HT:[xi.body,xi.heart],LI:[xi.body,xi.large_intestine,xi.colon],SI:[xi.body,xi.small_instestine],LL:[xi.body,xi.respiratory_system,xi.lung,xi.left_lung],RL:[xi.body,xi.respiratory_system,xi.lung,xi.right_lung],LY:[xi.body,xi.lymph_node],SP:[xi.body,xi.spleen],TH:[xi.body,xi.thymus],UR:[xi.body,xi.ureter],LV:[xi.body,xi.liver],OT:[xi.body]},b7={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class AIe{constructor(e,t="",i="",r){var s,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const c=this.data.descendants||[],d=(this.data.ancestors||[]).find($e=>"Donor"===$e.entity_type);this.donor=this.getDonor(d,i);const f=this.getRuiLocation(e,this.donor);f?this.rui_location=f:this.bad=!0;const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=E1[e.group_uuid]||e.group_name,_=e.created_by_user_displayname;this["@id"]=w1+e.uuid,this.label=`Registered ${p}, ${_}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const x={},A=[];this.sections=A;const W=[];this.datasets=W;for(const $e of c.filter(at=>"Sample"===at.entity_type)){const at=this.getSection($e,e,i);x[$e.submission_id]=at,A.push(at),at.section_number=null!==(s=at.section_number)&&void 0!==s?s:A.length}for(const $e of c)if("Dataset"===$e.entity_type){const at=this.getDataset($e,t,i,r),St=(0,En.get)($e,["ingest_metadata","metadata","tissue_id"]);x[St]?null===(o=x[St].datasets)||void 0===o||o.push(at):W.push(at)}const G=null!=f?f:{},ge=`${G.x_dimension} x ${G.y_dimension} x ${G.z_dimension} ${G.dimension_units}`;this.section_count=G.slice_count||A.length;const Ne=parseFloat((G.slice_thickness||(G.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ne;const Ge=G.dimension_units||"millimeter";this.section_units=Ge,this.description=`${ge}, ${Ne} ${Ge}, ${e.specimen_type}, ${this.section_count} Sections`,A.forEach(($e,at)=>{$e.description=`${G.x_dimension} x ${G.y_dimension} x ${Ne} ${Ge}, ${Ne} ${Ge}, ${$e.description}`,$e.section_number=at+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":w1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${E1[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${i}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",i="",r){var s;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=E1[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,En.get)(e,["ingest_metadata","metadata","assay_type"],"")],d=c.join("|").toLowerCase();let f,p="assets/icons/ico-unknown.svg";return-1!==d.indexOf("10x")?(f="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==d.indexOf("af")?(f="AF",p="assets/icons/ico-spatial-af.svg"):-1!==d.indexOf("codex")?(f="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==d.indexOf("imc")?(f="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==d.indexOf("lc")&&-1===d.indexOf("af")?(f="LC",p="assets/icons/ico-bulk-lc.svg"):f=-1!==d.indexOf("maldi")?"MALDI":-1!==d.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":w1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:f,thumbnail:p}}getDatasetThumbnail(e,t,i){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(i?`?token=${i}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,En.get)(e,"metadata.files",[]).filter(s=>/\.(ome\.tif|ome\.tiff)$/.test(s.rel_path)).filter(s=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(s.rel_path)).filter(s=>v7.has(s.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(s=>`${t}/${e.uuid}/${s.rel_path}`+(i?`?token=${i}`:""));if(r.length>0){const s=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(v7.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=wIe[e.hubmap_id];if(r)return`assets/thumbnails/TMC-Florida/${r}`}}getDonor(e,t){const i=(e.description||"").toLowerCase();let r;i.includes("female")?r="Female":i.includes("male")&&(r="Male");const s=i.match(/age ([0-9]+)/);let o,a;s&&(o=(0,En.toNumber)(s[1]));for(const p of(0,En.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===p.preferred_term||"Female"===p.preferred_term?r="Female":"Masculine gender"===p.preferred_term||"Male"===p.preferred_term?r="Male":"Current chronological age"===p.preferred_term||"Age"===p.preferred_term?o=(0,En.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,En.toNumber)(p.data_value));let l="";r&&o&&(l+=`${r}, Age ${o}`,a&&(l+=`, BMI ${a.toFixed(1)}`));const c=new Date(e.last_modified_timestamp).toLocaleDateString(),d=E1[e.group_uuid]||e.group_name;return{"@id":w1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${d}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;const s=(e.ancestors||[]).find(c=>"Sample"===c.entity_type&&"organ"===c.specimen_type),o=SIe[null==s?void 0:s.organ]||[xi.body];let a,l=e.rui_location;if(l&&("string"==typeof l&&(l=JSON.parse(l)),l.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):l["@id"]&&(a=l)),a){a.ccf_annotations=o.concat(a.ccf_annotations||[]);const c=null!==(i=(0,En.get)(a,["placement","target"]))&&void 0!==i?i:"";c.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,En.set)(a,["placement","target"],c.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===c||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===c)&&(0,En.set)(a,["placement","target"],"Male"===t.sex?c.replace("#VH","#VHM")+"_Patch":c.replace("#VH","#VHF")+"_Patch")}return a}getTissueBlock(){return(0,En.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function w7(n,e,t,i,r="",s=""){return ir(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(n).then(a=>a.ok?a.json():void 0).catch(()=>{});else if("search-api"===e){const a={"Content-type":"application/json"};i&&i.length>0&&(a.Authorization=`Bearer ${i}`),o=yield fetch(n,{method:"POST",headers:a,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:{exists:{field:"rui_location"}}})}).then(l=>l.ok?l.json():void 0).catch(()=>{})}if(o)return function(n,e="",t="",i,r=!1){const o={},a=(0,En.get)(n,"hits.hits",[]).map(c=>(0,En.get)(c,"_source",{})).map(c=>new AIe(c,e,t,i).toJsonLd());for(const c of a){const d=c["@id"];o[d]?o[d].samples.push(c.samples[0]):o[d]=c}const l=Object.values(o);return r&&(function(n){let e=[],t=0;for(const i of n.filter(r=>r.samples.length>1)){const r=i.samples;for(let s=0;sc["@id"]===o)&&(r[s].deleteMe=!0,t++)}i.samples=r.filter(s=>!0!==s.deleteMe)}t>0&&console.log(`\u26a0 ${t} sections identified as blocks`)}(l),console.log(l.map(c=>Object.assign({"@context":b7},c)))),{"@context":b7,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function S1(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.donor,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}function pv(n,e){return t=>n.has(t.id)?e.add(t.id):void 0}const zIe={[lr.ontologyNode.label.id]:"label",[lr.ontologyNode.parent.id]:"parent",[lr.ontologyNode.synonymLabels.id]:"synonymLabels"};function HIe(n,e){const t=ei.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return n.some(r=>{const s=zIe[r.predicate.id];if(s){const o="Literal"===r.object.termType?(0,$a.fromRdf)(r.object):r.object.id;"synonymLabels"===s?i.synonymLabels.push(o):(0,En.set)(i,s,o)}return!1},t,null,null,null),i.children=n.getSubjects(lr.ontologyNode.children,t,null).map(r=>r.id),i}const x1={[gi.label.id]:"label",[gi.description.id]:"description",[gi.link.id]:"link"},$Ie=Object.assign(Object.assign({},x1),{[gi.providerName.id]:"providerName"}),WIe=Object.assign(Object.assign({},x1),{[gi.technology.id]:"technology",[gi.thumbnail.id]:"thumbnail"}),qIe=Object.assign(Object.assign({},x1),{[gi.sampleType.id]:"sampleType",[gi.sectionNumber.id]:"sectionNumber",[gi.datasets.id]:"datasets"}),KIe=Object.assign(Object.assign({},x1),{[gi.sampleType.id]:"sampleType",[gi.sectionCount.id]:"sectionCount",[gi.sectionSize.id]:"sectionSize",[gi.sectionUnits.id]:"sectionUnits",[gi.donor.id]:"donor",[gi.spatialEntity.id]:"spatialEntityId",[gi.sections.id]:"sections",[gi.datasets.id]:"datasets"}),XIe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=$Ie[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function E7(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=WIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t}const JIe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=KIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=qIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=E7(n,s);t[r].push(o)}else(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=E7(n,s);t[r].push(o)}else"donor"===r?t[r]=XIe(n,s):(0,En.set)(t,r,s)}return!1},ei.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e),eRe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class tRe{constructor(e=eRe){this.options=e,this.store=new ei.Store(void 0,{factory:ei.DataFactory}),this.graph=new _7(this),this.scene=new y7(this)}connect(e,t=!1){return ir(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return ir(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield f7(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=hc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),ru(t.transaction)))}([i,t]).catch(()=>{}):s=yield f7(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=hc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),ru(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return ir(this,void 0,void 0,function*(){const i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],s=this.options.ccfOwlUrl;if(s.endsWith(".n3store.json")){const o=yield fetch(s).then(a=>a.text()).catch(()=>console.log("Couldn't locate serialized store."));o&&(this.store=(0,ei.deserializeN3Store)(o,ei.DataFactory))}else(null==s?void 0:s.length)>0&&r.push(s);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(w7(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(o=>{if(o)return this.addDataSources([o])}))),i.push(this.addDataSources(r)),yield Promise.all(i),yield this.synchronize()})}addDataSources(e,t){return ir(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>ir(this,void 0,void 0,function*(){"string"==typeof r?r.endsWith("jsonld")?yield(0,ei.addJsonLdToStore)(r,i):r.endsWith("n3")?yield(0,ei.addN3ToStore)(r,i):(r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml"))&&(yield(0,ei.addRdfXmlToStore)(r,i)):yield(0,ei.addJsonLdToStore)(r,i)}))),this})}synchronize(){return ir(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,ei.serializeN3Store)(this.store)}deserialize(e){return ir(this,void 0,void 0,function*(){this.store=(0,ei.deserializeN3Store)(e,ei.DataFactory),this.graph=new _7(this),this.scene=new y7(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e){var t,i,r,s,o;let a=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),gi.spatialEntity,null,null),e}(n);if(a.size>0&&(a=function(n,e,t=!0){const i=new Set;if(n.forSubjects(pv(e,i),gi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const l=e.sex;a=S1(n,a,c=>function(n,e,t){const i=new Set;return n.forSubjects(pv(e,i),gi.sex,gi[t],null),i}(n,c,l))}if(a.size>0&&(null===(t=e.tmc)||void 0===t?void 0:t.length)>0&&(a=S1(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=ei.DataFactory.literal(r);n.forSubjects(pv(e,i),gi.providerName,s,null)}return i}(n,l,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set,o=new Set;n.some(c=>(e.has(c.subject.id)&&o.add(c.object.id),!1),null,gi.sections,null,null),n.some(c=>{var d;return(e.has(c.subject.id)||o.has(c.subject.id))&&(s.add(c.object.id),r.has(c.object.id)?null===(d=r.get(c.object.id))||void 0===d||d.push(c.subject.id):r.set(c.object.id,[c.subject.id])),!1},null,gi.datasets,null,null);const a=t(s),l=new Set;for(const c of a)for(const d of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(d);return l}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=ei.DataFactory.literal(r);n.forSubjects(pv(e,i),gi.technology,s,null)}return i}(n,l,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.spatialEntity,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=ei.DataFactory.namedNode(r);n.forSubjects(pv(e,i),lr.spatialEntity.ccf_annotations,s,null)}return i}(n,l,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,En.isFinite)(e.ageRange[0])&&(0,En.isFinite)(e.ageRange[1])){const l=Math.max(...e.ageRange),c=Math.min(...e.ageRange);1===c&&110===l||(a=S1(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,$a.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.age,null,null),r}(n,d,c,l)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,En.isFinite)(e.bmiRange[0])&&(0,En.isFinite)(e.bmiRange[1])){const l=Math.max(...e.bmiRange),c=Math.min(...e.bmiRange);13===c&&83===l||(a=S1(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,$a.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.bmi,null,null),r}(n,d,c,l)))}return a}(this.store,e)}get(e){return this.store.getQuads(ei.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(t=>this.get(t))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>vIe(this.store,t))}getDatasetTechnologyNames(){return ir(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return ir(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return ir(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>JIe(this.store,t))})}getAggregateResults(e){return ir(this,void 0,void 0,function*(){return function(n,e){const t=new Set;e.some(l=>(n.has(l.subject.id)&&t.add(l.object.id),!1),null,gi.donor,null,null);const i=new Set;e.some(l=>(t.has(l.subject.id)&&i.add(l.object.id),!1),null,gi.providerUUID,null,null);const r=new Set;e.forSubjects(l=>{n.has(l.id)&&r.add(l.id)},gi.spatialEntity,null,null);const s=new Set;e.some(l=>(r.has(l.subject.id)&&s.add(l.object.id),!1),null,gi.sections,null,null);const o=new Set;return e.some(l=>{const c=l.subject;return(r.has(c.id)||s.has(c.id))&&o.add(l.object.id),!1},null,gi.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:t.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([l,c])=>({label:l,count:c}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return ir(this,void 0,void 0,function*(){return function(n,e){const t=new Map;e.some(r=>(n.has(r.subject.id)&&(t.has(r.object.id)?t.get(r.object.id).push(r.subject.id):t.set(r.object.id,[r.subject.id])),!1),null,gi.spatialEntity,null,null);const i={};return e.some(r=>{var s,o;if(t.has(r.subject.id)){const a=null!==(o=null===(s=t.get(r.subject.id))||void 0===s?void 0:s.length)&&void 0!==o?o:0;i[r.object.id]=a+(i[r.object.id]||0)}return!1},null,lr.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store)})}getOntologyTreeModel(){return ir(this,void 0,void 0,function*(){return function(n){const e={root:g7.body.id,nodes:{}},t=new Set;n.some(i=>(t.add(i.subject.id),t.add(i.predicate.id),!1),null,lr.ontologyNode.parent,null,null);for(const i of t)e.nodes[i]=HIe(n,i);return e}(this.store)})}getReferenceOrgans(){return ir(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return ir(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return ir(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}}function iRe(n,e){return n===e}let rRe=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new S,this.dataSource=i.getOption("data").pipe(me(r=>Object.assign(Object.assign({},h7),{dataSources:r})),Ui(r=>Object.keys(r).length>0),me(r=>r),$u(iRe),Ur(r=>function(n,e){return new F(t=>{let i,r;try{i=n()}catch(a){return void t.error(a)}try{r=e(i)}catch(a){return void t.error(a)}const o=(r?Pe(r):Lc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),ka(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Ur(i=>i.getTissueBlockResults(t)),Yi(1))}getAggregateResults(t){return this.dataSource.pipe(Ur(i=>i.getAggregateResults(t)),Yi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Ur(i=>i.getOntologyTermOccurences(t)),Yi(1))}getOntologyTreeModel(){return this.dataSource.pipe(Ur(t=>t.getOntologyTreeModel()),Yi(1))}getReferenceOrgans(){return this.dataSource.pipe(Ur(t=>t.getReferenceOrgans()),Yi(1))}getScene(t){return this.dataSource.pipe(Ur(i=>i.getScene(t)),Yi(1))}getOrganScene(t,i){return this.dataSource.pipe(Ur(r=>r.getReferenceOrganScene(t,i)),Yi(1))}createDataSource(){return{source:new tRe,unsubscribe:()=>{}}}connectDataSource(t,i){return ir(this,void 0,void 0,function*(){const r=(new Date).getTime();return yield t.connect(i,!1),Uy.production||(console.info(`Loaded CCF database in ${((new Date).getTime()-r)/1e3}s`),console.log(t)),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(cf),Ie(hv))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),sRe=(()=>{class n{constructor(t,i){this.configState=t,this.source=i,this.data$=this.configState.getOption("data"),this.zoomToID$=this.configState.getOption("zoomToID").pipe(me(r=>`http://purl.org/ccf/1.5/entity/${r}`)),this.highlightID$=this.configState.getOption("highlightID").pipe(me(r=>`http://purl.org/ccf/1.5/entity/${r}`)),this.referenceOrgans$=this.source.getReferenceOrgans(),this.scene$=Uo([this.data$,this.referenceOrgans$,this.source.dataSource]).pipe(Ur(([r,s,o])=>this.chooseScene(r,s))),this.organs$=this.configState.getOption("data").pipe(me(r=>this.selectOrgans(r)),ka(1)),this.filteredOrgans$=Uo([this.organs$,this.referenceOrgans$]).pipe(me(([r,s])=>this.getNeededReferenceOrgans(s,r)),ka(1)),this.filteredScene$=Uo([this.scene$,this.organs$,this.referenceOrgans$]).pipe(me(([r,s,o])=>this.filterSceneNodes(r,s,o)),function(n,e){const t=n.pipe(Vo(""));return i=>Uo([i,t]).pipe(me(([r,s])=>r.map(o=>function(n,e,t){return n.entityId!==e?n:Object.assign(Object.assign({},n),{color:t})}(o,s,e))))}(this.highlightID$,aDe),function(n){const e=n.pipe(Vo(""));return t=>Uo([t,e]).pipe(me(([i,r])=>i.map(s=>function(n,e){return n.entityId!==e?n:Object.assign(Object.assign({},n),{zoomToOnLoad:!0})}(s,r))))}(this.zoomToID$),ka(1))}chooseScene(t,i){var r;const s=null!==(r=null==t?void 0:t.map(a=>{const l=a[l7];return null==l?void 0:l.placement.target}))&&void 0!==r?r:[];if(new Set(s).size>1)return this.source.getScene();if(i){const a=i.find(l=>l["@id"]===s[0]);if(a)return this.source.getOrganScene(a.representation_of,{ontologyTerms:[a.reference_organ],sex:a.sex})}return an([])}selectOrgans(t){const r=(null!=t?t:[]).map(s=>s[l7].placement.target);return new Set(r)}filterSceneNodes(t,i,r){const s=this.getNeededReferenceOrgans(r,i),o=this.getNeededSkins(s),a=new Set([...i,...o]);return t.filter(c=>!c.reference_organ||a.has(c.reference_organ))}getNeededReferenceOrgans(t,i){return t.filter(r=>{var s;return i.has(null!==(s=r.reference_organ)&&void 0!==s?s:"")})}getNeededSkins(t){if(1===t.length)return[];const i=new Set;return t.forEach(r=>{"Female"===r.sex?i.add("http://purl.org/ccf/latest/ccf.owl#VHFSkin"):"Male"===r.sex&&i.add("http://purl.org/ccf/latest/ccf.owl#VHMSkin")}),[...i]}}return n.\u0275fac=function(t){return new(t||n)(Ie(hv),Ie(rRe))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const oRe=["bodyUI"];let aRe=(()=>{class n{constructor(t,i,r){this.configState=t,this.sceneSource=i,this.cdr=r,this.onMouseEnter=new cn,this.onMouseLeave=new cn,this.onClick=new cn,this.data$=this.configState.getOption("data"),this.organs$=this.sceneSource.filteredOrgans$,this.scene$=this.sceneSource.filteredScene$.pipe(Zr(s=>this.reset()))}reset(){var t,i;return ir(this,void 0,void 0,function*(){const{bodyUI:r}=this;yield new Promise(a=>setTimeout(a,200));const s=yield this.organs$.pipe(Yi(1)).toPromise(),o=null!==(i=!!(null===(t=r.scene)||void 0===t?void 0:t.find(a=>a.zoomToOnLoad)))&&void 0!==i&&i;if(r.rotation=0,r.rotationX=0,!o)if(1===s.length){const{x_dimension:a,y_dimension:l,z_dimension:c}=s[0];r.bounds={x:1.25*a/1e3,y:1.25*l/1e3,z:1.25*c/1e3},r.target=[a/1e3/2,l/1e3/2,c/1e3/2]}else r.bounds={x:2.2,y:2,z:.4},r.target=[0,0,0];this.cdr.detectChanges()})}}return n.\u0275fac=function(t){return new(t||n)(Me(hv),Me(sRe),Me(is))},n.\u0275cmp=wn({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&Ms(oRe,7),2&t){let r;Ai(r=Ti())&&(i.bodyUI=r.first)}},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},decls:3,vars:4,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""]],template:function(t,i){1&t&&(Kt(0,"ccf-body-ui",0,1),ui("nodeClick",function(s){return i.onClick.emit(s)})("nodeHoverStart",function(s){return i.onMouseEnter.emit(s)})("nodeHoverStop",function(s){return i.onMouseLeave.emit(s)}),function(n,e){const t=fi();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new Qe("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=mc(i.type)),o=ha(Me);try{const a=rp(!1),l=s();rp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Ft(),r,l)}finally{ha(o)}}(2,"async"),Yt()),2&t&&vn("scene",Ty(2,2,i.scene$))("interactive",!0)},directives:[IMe],pipes:[cE],styles:[".body-ui[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0}),n})();function lRe(n,e){if(1&n){const t=Ft();Kt(0,"ccf-root",1),ui("onMouseEnter",function(r){return ya(t),cr().onMouseEnter.emit(r)})("onMouseLeave",function(r){return ya(t),cr().onMouseLeave.emit(r)})("onClick",function(r){return ya(t),cr().onClick.emit(r)}),Yt()}}function cRe(n){return n.map(e=>({"@id":`http://purl.org/ccf/1.5/entity/${e.id}`,"@type":"http://purl.org/ccf/latest/ccf-entity.owl#Sample","http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity":e.rui_location}))}let uRe=(()=>{class n extends hee{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},Uy.dbOptions),globalThis.dbOptions),parse:{data:cRe}}),this.onMouseEnter=new cn,this.onMouseLeave=new cn,this.onClick=new cn}}return n.\u0275fac=function(t){return new(t||n)(Me(hv),Me(is))},n.\u0275cmp=wn({type:n,selectors:[["ccf-root-wc"]],inputs:{data:"data",highlightID:"highlightID",zoomToID:"zoomToID"},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},features:[Nn],decls:1,vars:1,consts:[[3,"onMouseEnter","onMouseLeave","onClick",4,"ngIf"],[3,"onMouseEnter","onMouseLeave","onClick"]],template:function(t,i){1&t&&function(n,e,t,i,r,s,o,a){const l=Ft(),c=fi(),d=n+20,f=c.firstCreatePass?function(n,e,t,i,r,s,o,a,l){const c=e.consts,d=Pd(e,n,4,o||null,_a(c,a));z_(e,t,d,_a(c,l)),ep(e,d);const f=d.tViews=Fp(2,d,i,r,s,e.directiveRegistry,e.pipeRegistry,null,e.schemas,c);return null!==e.queries&&(e.queries.template(e,d),f.queries=e.queries.embeddedTView(d)),d}(d,c,l,e,t,i,r,s,o):c.data[d];Qa(f,!1);const p=l[11].createComment("");Mp(c,l,p,f),xs(p,l),Lp(l,l[d]=iw(p,l,p,f)),cd(f)&&Kh(c,l,f),null!=o&&U_(l,f,a)}(0,lRe,1,0,"ccf-root",0),2&t&&vn("ngIf",i.initialized)},directives:[Ru,aRe],encapsulation:2,changeDetection:0}),n})(),dRe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[ls,Ga,zG,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(ls,2),Ie(Ga,2))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();const C1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class pRe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=Mf(this.action),i=function(n){return C1(n.getHours(),2)+":"+C1(n.getMinutes(),2)+":"+C1(n.getSeconds(),2)+"."+C1(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class gRe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const S7=new Vt("NGXS_LOGGER_PLUGIN_OPTIONS");let mRe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new gRe(this._options),this._store=this._store||this._injector.get(ih);const s=new pRe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Zr(o=>{s.completed(o)}),lc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(S7),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const x7=new Vt("LOGGER_USER_OPTIONS");function _Re(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let yRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:Q4,useClass:mRe,multi:!0},{provide:x7,useValue:t},{provide:S7,useFactory:_Re,deps:[x7]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();const vRe=[hv];let bRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({imports:[[dRe.forRoot(),la.forRoot(vRe,{developmentMode:!Uy.production}),yRe.forRoot({disabled:Uy.production})]]}),n})(),wRe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(fl).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new oee(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends lee{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(uRe,{injector:this.injector});customElements.define("ccf-body-ui-wc",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:[],imports:[[YM,bRe,RMe]]}),n})();Uy.production&&function(){if(xk)throw new Error("Cannot enable prod mode after platform setup.");Sk=!1}(),DJ().bootstrapModule(wRe).catch(n=>console.error(n))},52:kt=>{function it(gt,J,At,dt,K,Ae,he){try{var q=gt[Ae](he),V=q.value}catch(L){return void At(L)}q.done?J(V):Promise.resolve(V).then(dt,K)}kt.exports=function(gt){return function(){var J=this,At=arguments;return new Promise(function(dt,K){var Ae=gt.apply(J,At);function he(V){it(Ae,dt,K,he,q,"next",V)}function q(V){it(Ae,dt,K,he,q,"throw",V)}he(void 0)})}},kt.exports.default=kt.exports,kt.exports.__esModule=!0},948:kt=>{kt.exports=function(tt){return tt&&tt.__esModule?tt:{default:tt}},kt.exports.default=kt.exports,kt.exports.__esModule=!0},321:kt=>{function it(tt){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(kt.exports=it=function(J){return typeof J},kt.exports.default=kt.exports,kt.exports.__esModule=!0):(kt.exports=it=function(J){return J&&"function"==typeof Symbol&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},kt.exports.default=kt.exports,kt.exports.__esModule=!0),it(tt)}kt.exports=it,kt.exports.default=kt.exports,kt.exports.__esModule=!0},380:kt=>{function it(tt){return Promise.resolve().then(()=>{var gt=new Error("Cannot find module '"+tt+"'");throw gt.code="MODULE_NOT_FOUND",gt})}it.keys=()=>[],it.resolve=it,it.id=380,kt.exports=it},521:()=>{},125:()=>{},307:()=>{}},kt=>{kt(kt.s=18)}]); \ No newline at end of file +var ERe=Object.defineProperty,SRe=Object.defineProperties,xRe=Object.getOwnPropertyDescriptors,A1=Object.getOwnPropertySymbols,A7=Object.prototype.hasOwnProperty,T7=Object.prototype.propertyIsEnumerable,_r=Math.pow,M7=(kt,it,tt)=>it in kt?ERe(kt,it,{enumerable:!0,configurable:!0,writable:!0,value:tt}):kt[it]=tt,ht=(kt,it)=>{for(var tt in it||(it={}))A7.call(it,tt)&&M7(kt,tt,it[tt]);if(A1)for(var tt of A1(it))T7.call(it,tt)&&M7(kt,tt,it[tt]);return kt},Un=(kt,it)=>SRe(kt,xRe(it)),D7=(kt,it)=>{var tt={};for(var gt in kt)A7.call(kt,gt)&&it.indexOf(gt)<0&&(tt[gt]=kt[gt]);if(null!=kt&&A1)for(var gt of A1(kt))it.indexOf(gt)<0&&T7.call(kt,gt)&&(tt[gt]=kt[gt]);return tt};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(kt,it,tt)=>{var gt=tt(52).default;kt.exports=function K(Ae,he,q){function V($,b){if(!he[$]){if(!Ae[$]){if(L)return L($,!0);var O=new Error("Cannot find module '"+$+"'");throw O.code="MODULE_NOT_FOUND",O}var T=he[$]={exports:{}};Ae[$][0].call(T.exports,function(v){return V(Ae[$][1][v]||v)},T,T.exports,K,Ae,he,q)}return he[$].exports}for(var L=void 0,re=0;re0&&z[z.length-1])&&(6===Pe[0]||2===Pe[0])){Ue=0;continue}if(3===Pe[0]&&(!z||Pe[1]>z[0]&&Pe[1]0?Y-4:Y;for(U=0;U>16&255,F[Q++]=I>>8&255,F[Q++]=255&I;return 2===D&&(I=V[j.charCodeAt(U)]<<2|V[j.charCodeAt(U+1)]>>4,F[Q++]=255&I),1===D&&(I=V[j.charCodeAt(U)]<<10|V[j.charCodeAt(U+1)]<<4|V[j.charCodeAt(U+2)]>>2,F[Q++]=I>>8&255,F[Q++]=255&I),F},he.fromByteArray=function(j){for(var I,H=j.length,Y=H%3,D=[],F=16383,Q=0,E=H-Y;QE?E:Q+F));return 1===Y?D.push(q[(I=j[H-1])>>2]+q[I<<4&63]+"=="):2===Y&&D.push(q[(I=(j[H-2]<<8)+j[H-1])>>10]+q[I>>4&63]+q[I<<2&63]+"="),D.join("")};for(var q=[],V=[],L="undefined"!=typeof Uint8Array?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,b=re.length;$0)throw new Error("Invalid string. Length must be a multiple of 4");var H=j.indexOf("=");return-1===H&&(H=I),[H,H===I?0:4-H%4]}function y(j){return q[j>>18&63]+q[j>>12&63]+q[j>>6&63]+q[63&j]}function w(j,I,H){for(var D=[],F=I;F>5==6?2:D>>4==14?3:D>>3==30?4:D>>6==2?-1:-2}function T(D){var F=this.lastTotal-this.lastNeed,Q=function(D,F,Q){if(128!=(192&F[0]))return D.lastNeed=0,"\ufffd";if(D.lastNeed>1&&F.length>1){if(128!=(192&F[1]))return D.lastNeed=1,"\ufffd";if(D.lastNeed>2&&F.length>2&&128!=(192&F[2]))return D.lastNeed=2,"\ufffd"}}(this,D);return void 0!==Q?Q:this.lastNeed<=D.length?(D.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(D.copy(this.lastChar,F,0,D.length),void(this.lastNeed-=D.length))}function w(D,F){if((D.length-F)%2==0){var Q=D.toString("utf16le",F);if(Q){var E=Q.charCodeAt(Q.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],Q.slice(0,-1)}return Q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",F,D.length-1)}function M(D){var F=D&&D.length?this.write(D):"";return this.lastNeed?F+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):F}function j(D,F){var Q=(D.length-F)%3;return 0===Q?D.toString("base64",F):(this.lastNeed=3-Q,this.lastTotal=3,1===Q?this.lastChar[0]=D[D.length-1]:(this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1]),D.toString("base64",F,D.length-Q))}function I(D){var F=D&&D.length?this.write(D):"";return this.lastNeed?F+this.lastChar.toString("base64",0,3-this.lastNeed):F}function H(D){return D.toString(this.encoding)}function Y(D){return D&&D.length?this.write(D):""}he.StringDecoder=$,$.prototype.write=function(D){if(0===D.length)return"";var F,Q;if(this.lastNeed){if(void 0===(F=this.fillLast(D)))return"";Q=this.lastNeed,this.lastNeed=0}else Q=0;return Q=0?(U>0&&(D.lastNeed=U-1),U):--E=0?(U>0&&(D.lastNeed=U-2),U):--E=0?(U>0&&(2===U?U=0:D.lastNeed=U-3),U):0}(this,D,F);if(!this.lastNeed)return D.toString("utf8",F);this.lastTotal=Q;var E=D.length-(Q-this.lastNeed);return D.copy(this.lastChar,0,E),D.toString("utf8",F,E)},$.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length}},{"safe-buffer":4}],6:[function(K,Ae,he){(function(q){(function(){"use strict";var V=K("base64-js"),L=K("ieee754");he.Buffer=S,he.SlowBuffer=function(B){return+B!=B&&(B=0),S.alloc(+B)},he.INSPECT_MAX_BYTES=50;var re=2147483647;function b(B){if(B>re)throw new RangeError('The value "'+B+'" is invalid for option "size"');var R=new Uint8Array(B);return R.__proto__=S.prototype,R}function S(B,R,k){if("number"==typeof B){if("string"==typeof R)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return O(B,R,k)}function O(B,R,k){if("string"==typeof B)return function(B,R){if(("string"!=typeof R||""===R)&&(R="utf8"),!S.isEncoding(R))throw new TypeError("Unknown encoding: "+R);var k=0|D(B,R),Oe=b(k),Xe=Oe.write(B,R);return Xe!==k&&(Oe=Oe.slice(0,Xe)),Oe}(B,R);if(ArrayBuffer.isView(B))return M(B);if(null==B)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(pt(B,ArrayBuffer)||B&&pt(B.buffer,ArrayBuffer))return function(B,R,k){if(R<0||B.byteLength=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return 0|B}function D(B,R){if(S.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||pt(B,ArrayBuffer))return B.byteLength;if("string"!=typeof B)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var k=B.length,Oe=arguments.length>2&&!0===arguments[2];if(!Oe&&0===k)return 0;for(var Xe=!1;;)switch(R){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return X(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Pe(B).length;default:if(Xe)return Oe?-1:X(B).length;R=(""+R).toLowerCase(),Xe=!0}}function F(B,R,k){var Oe=!1;if((void 0===R||R<0)&&(R=0),R>this.length||((void 0===k||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(R>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return Je(this,R,k);case"utf8":case"utf-8":return ye(this,R,k);case"ascii":return nt(this,R,k);case"latin1":case"binary":return Ze(this,R,k);case"base64":return te(this,R,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,R,k);default:if(Oe)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Oe=!0}}function Q(B,R,k){var Oe=B[R];B[R]=B[k],B[k]=Oe}function E(B,R,k,Oe,Xe){if(0===B.length)return-1;if("string"==typeof k?(Oe=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),fe(k=+k)&&(k=Xe?0:B.length-1),k<0&&(k=B.length+k),k>=B.length){if(Xe)return-1;k=B.length-1}else if(k<0){if(!Xe)return-1;k=0}if("string"==typeof R&&(R=S.from(R,Oe)),S.isBuffer(R))return 0===R.length?-1:U(B,R,k,Oe,Xe);if("number"==typeof R)return R&=255,"function"==typeof Uint8Array.prototype.indexOf?Xe?Uint8Array.prototype.indexOf.call(B,R,k):Uint8Array.prototype.lastIndexOf.call(B,R,k):U(B,[R],k,Oe,Xe);throw new TypeError("val must be string, number or Buffer")}function U(B,R,k,Oe,Xe){var Gn,yt=1,It=B.length,Tn=R.length;if(void 0!==Oe&&("ucs2"===(Oe=String(Oe).toLowerCase())||"ucs-2"===Oe||"utf16le"===Oe||"utf-16le"===Oe)){if(B.length<2||R.length<2)return-1;yt=2,It/=2,Tn/=2,k/=2}function Pn(Ns,cs){return 1===yt?Ns[cs]:Ns.readUInt16BE(cs*yt)}if(Xe){var yi=-1;for(Gn=k;GnIt&&(k=It-Tn),Gn=k;Gn>=0;Gn--){for(var hi=!0,Hr=0;HrXe&&(Oe=Xe):Oe=Xe;var yt=R.length;Oe>yt/2&&(Oe=yt/2);for(var It=0;It>8,yt.push(k%256),yt.push(Oe);return yt}(R,B.length-k),B,k,Oe)}function te(B,R,k){return V.fromByteArray(0===R&&k===B.length?B:B.slice(R,k))}function ye(B,R,k){k=Math.min(B.length,k);for(var Oe=[],Xe=R;Xe239?4:yt>223?3:yt>191?2:1;if(Xe+Tn<=k)switch(Tn){case 1:yt<128&&(It=yt);break;case 2:128==(192&(Pn=B[Xe+1]))&&(hi=(31&yt)<<6|63&Pn)>127&&(It=hi);break;case 3:Gn=B[Xe+2],128==(192&(Pn=B[Xe+1]))&&128==(192&Gn)&&(hi=(15&yt)<<12|(63&Pn)<<6|63&Gn)>2047&&(hi<55296||hi>57343)&&(It=hi);break;case 4:Gn=B[Xe+2],yi=B[Xe+3],128==(192&(Pn=B[Xe+1]))&&128==(192&Gn)&&128==(192&yi)&&(hi=(15&yt)<<18|(63&Pn)<<12|(63&Gn)<<6|63&yi)>65535&&hi<1114112&&(It=hi)}null===It?(It=65533,Tn=1):It>65535&&(Oe.push((It-=65536)>>>10&1023|55296),It=56320|1023&It),Oe.push(It),Xe+=Tn}return function(B){var R=B.length;if(R<=4096)return String.fromCharCode.apply(String,B);for(var k="",Oe=0;Oek&&(R+=" ... "),""},S.prototype.compare=function(R,k,Oe,Xe,yt){if(pt(R,Uint8Array)&&(R=S.from(R,R.offset,R.byteLength)),!S.isBuffer(R))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof R);if(void 0===k&&(k=0),void 0===Oe&&(Oe=R?R.length:0),void 0===Xe&&(Xe=0),void 0===yt&&(yt=this.length),k<0||Oe>R.length||Xe<0||yt>this.length)throw new RangeError("out of range index");if(Xe>=yt&&k>=Oe)return 0;if(Xe>=yt)return-1;if(k>=Oe)return 1;if(this===R)return 0;for(var It=(yt>>>=0)-(Xe>>>=0),Tn=(Oe>>>=0)-(k>>>=0),Pn=Math.min(It,Tn),Gn=this.slice(Xe,yt),yi=R.slice(k,Oe),hi=0;hi>>=0,isFinite(Oe)?(Oe>>>=0,void 0===Xe&&(Xe="utf8")):(Xe=Oe,Oe=void 0)}var yt=this.length-k;if((void 0===Oe||Oe>yt)&&(Oe=yt),R.length>0&&(Oe<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");Xe||(Xe="utf8");for(var It=!1;;)switch(Xe){case"hex":return ie(this,R,k,Oe);case"utf8":case"utf-8":return ue(this,R,k,Oe);case"ascii":return ee(this,R,k,Oe);case"latin1":case"binary":return se(this,R,k,Oe);case"base64":return Te(this,R,k,Oe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,R,k,Oe);default:if(It)throw new TypeError("Unknown encoding: "+Xe);Xe=(""+Xe).toLowerCase(),It=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(B,R,k){var Oe="";k=Math.min(B.length,k);for(var Xe=R;XeOe)&&(k=Oe);for(var Xe="",yt=R;ytk)throw new RangeError("Trying to access beyond buffer length")}function Le(B,R,k,Oe,Xe,yt){if(!S.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(R>Xe||RB.length)throw new RangeError("Index out of range")}function Ee(B,R,k,Oe,Xe,yt){if(k+Oe>B.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Re(B,R,k,Oe,Xe){return R=+R,k>>>=0,Xe||Ee(B,0,k,4),L.write(B,R,k,Oe,23,4),k+4}function Ue(B,R,k,Oe,Xe){return R=+R,k>>>=0,Xe||Ee(B,0,k,8),L.write(B,R,k,Oe,52,8),k+8}S.prototype.slice=function(R,k){var Oe=this.length;(R=~~R)<0?(R+=Oe)<0&&(R=0):R>Oe&&(R=Oe),(k=void 0===k?Oe:~~k)<0?(k+=Oe)<0&&(k=0):k>Oe&&(k=Oe),k>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R],yt=1,It=0;++It>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R+--k],yt=1;k>0&&(yt*=256);)Xe+=this[R+--k]*yt;return Xe},S.prototype.readUInt8=function(R,k){return R>>>=0,k||je(R,1,this.length),this[R]},S.prototype.readUInt16LE=function(R,k){return R>>>=0,k||je(R,2,this.length),this[R]|this[R+1]<<8},S.prototype.readUInt16BE=function(R,k){return R>>>=0,k||je(R,2,this.length),this[R]<<8|this[R+1]},S.prototype.readUInt32LE=function(R,k){return R>>>=0,k||je(R,4,this.length),(this[R]|this[R+1]<<8|this[R+2]<<16)+16777216*this[R+3]},S.prototype.readUInt32BE=function(R,k){return R>>>=0,k||je(R,4,this.length),16777216*this[R]+(this[R+1]<<16|this[R+2]<<8|this[R+3])},S.prototype.readIntLE=function(R,k,Oe){R>>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=this[R],yt=1,It=0;++It=(yt*=128)&&(Xe-=Math.pow(2,8*k)),Xe},S.prototype.readIntBE=function(R,k,Oe){R>>>=0,k>>>=0,Oe||je(R,k,this.length);for(var Xe=k,yt=1,It=this[R+--Xe];Xe>0&&(yt*=256);)It+=this[R+--Xe]*yt;return It>=(yt*=128)&&(It-=Math.pow(2,8*k)),It},S.prototype.readInt8=function(R,k){return R>>>=0,k||je(R,1,this.length),128&this[R]?-1*(255-this[R]+1):this[R]},S.prototype.readInt16LE=function(R,k){R>>>=0,k||je(R,2,this.length);var Oe=this[R]|this[R+1]<<8;return 32768&Oe?4294901760|Oe:Oe},S.prototype.readInt16BE=function(R,k){R>>>=0,k||je(R,2,this.length);var Oe=this[R+1]|this[R]<<8;return 32768&Oe?4294901760|Oe:Oe},S.prototype.readInt32LE=function(R,k){return R>>>=0,k||je(R,4,this.length),this[R]|this[R+1]<<8|this[R+2]<<16|this[R+3]<<24},S.prototype.readInt32BE=function(R,k){return R>>>=0,k||je(R,4,this.length),this[R]<<24|this[R+1]<<16|this[R+2]<<8|this[R+3]},S.prototype.readFloatLE=function(R,k){return R>>>=0,k||je(R,4,this.length),L.read(this,R,!0,23,4)},S.prototype.readFloatBE=function(R,k){return R>>>=0,k||je(R,4,this.length),L.read(this,R,!1,23,4)},S.prototype.readDoubleLE=function(R,k){return R>>>=0,k||je(R,8,this.length),L.read(this,R,!0,52,8)},S.prototype.readDoubleBE=function(R,k){return R>>>=0,k||je(R,8,this.length),L.read(this,R,!1,52,8)},S.prototype.writeUIntLE=function(R,k,Oe,Xe){R=+R,k>>>=0,Oe>>>=0,Xe||Le(this,R,k,Oe,Math.pow(2,8*Oe)-1,0);var It=1,Tn=0;for(this[k]=255&R;++Tn>>=0,Oe>>>=0,Xe||Le(this,R,k,Oe,Math.pow(2,8*Oe)-1,0);var It=Oe-1,Tn=1;for(this[k+It]=255&R;--It>=0&&(Tn*=256);)this[k+It]=R/Tn&255;return k+Oe},S.prototype.writeUInt8=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,1,255,0),this[k]=255&R,k+1},S.prototype.writeUInt16LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,65535,0),this[k]=255&R,this[k+1]=R>>>8,k+2},S.prototype.writeUInt16BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,65535,0),this[k]=R>>>8,this[k+1]=255&R,k+2},S.prototype.writeUInt32LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,4294967295,0),this[k+3]=R>>>24,this[k+2]=R>>>16,this[k+1]=R>>>8,this[k]=255&R,k+4},S.prototype.writeUInt32BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,4294967295,0),this[k]=R>>>24,this[k+1]=R>>>16,this[k+2]=R>>>8,this[k+3]=255&R,k+4},S.prototype.writeIntLE=function(R,k,Oe,Xe){if(R=+R,k>>>=0,!Xe){var yt=Math.pow(2,8*Oe-1);Le(this,R,k,Oe,yt-1,-yt)}var It=0,Tn=1,Pn=0;for(this[k]=255&R;++It>0)-Pn&255;return k+Oe},S.prototype.writeIntBE=function(R,k,Oe,Xe){if(R=+R,k>>>=0,!Xe){var yt=Math.pow(2,8*Oe-1);Le(this,R,k,Oe,yt-1,-yt)}var It=Oe-1,Tn=1,Pn=0;for(this[k+It]=255&R;--It>=0&&(Tn*=256);)R<0&&0===Pn&&0!==this[k+It+1]&&(Pn=1),this[k+It]=(R/Tn>>0)-Pn&255;return k+Oe},S.prototype.writeInt8=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,1,127,-128),R<0&&(R=255+R+1),this[k]=255&R,k+1},S.prototype.writeInt16LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,32767,-32768),this[k]=255&R,this[k+1]=R>>>8,k+2},S.prototype.writeInt16BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,2,32767,-32768),this[k]=R>>>8,this[k+1]=255&R,k+2},S.prototype.writeInt32LE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,2147483647,-2147483648),this[k]=255&R,this[k+1]=R>>>8,this[k+2]=R>>>16,this[k+3]=R>>>24,k+4},S.prototype.writeInt32BE=function(R,k,Oe){return R=+R,k>>>=0,Oe||Le(this,R,k,4,2147483647,-2147483648),R<0&&(R=4294967295+R+1),this[k]=R>>>24,this[k+1]=R>>>16,this[k+2]=R>>>8,this[k+3]=255&R,k+4},S.prototype.writeFloatLE=function(R,k,Oe){return Re(this,R,k,!0,Oe)},S.prototype.writeFloatBE=function(R,k,Oe){return Re(this,R,k,!1,Oe)},S.prototype.writeDoubleLE=function(R,k,Oe){return Ue(this,R,k,!0,Oe)},S.prototype.writeDoubleBE=function(R,k,Oe){return Ue(this,R,k,!1,Oe)},S.prototype.copy=function(R,k,Oe,Xe){if(!S.isBuffer(R))throw new TypeError("argument should be a Buffer");if(Oe||(Oe=0),!Xe&&0!==Xe&&(Xe=this.length),k>=R.length&&(k=R.length),k||(k=0),Xe>0&&Xe=this.length)throw new RangeError("Index out of range");if(Xe<0)throw new RangeError("sourceEnd out of bounds");Xe>this.length&&(Xe=this.length),R.length-k=0;--It)R[It+k]=this[It+Oe];else Uint8Array.prototype.set.call(R,this.subarray(Oe,Xe),k);return yt},S.prototype.fill=function(R,k,Oe,Xe){if("string"==typeof R){if("string"==typeof k?(Xe=k,k=0,Oe=this.length):"string"==typeof Oe&&(Xe=Oe,Oe=this.length),void 0!==Xe&&"string"!=typeof Xe)throw new TypeError("encoding must be a string");if("string"==typeof Xe&&!S.isEncoding(Xe))throw new TypeError("Unknown encoding: "+Xe);if(1===R.length){var yt=R.charCodeAt(0);("utf8"===Xe&&yt<128||"latin1"===Xe)&&(R=yt)}}else"number"==typeof R&&(R&=255);if(k<0||this.length>>=0,Oe=void 0===Oe?this.length:Oe>>>0,R||(R=0),"number"==typeof R)for(It=k;It55295&&k<57344){if(!Xe){if(k>56319){(R-=3)>-1&&yt.push(239,191,189);continue}if(It+1===Oe){(R-=3)>-1&&yt.push(239,191,189);continue}Xe=k;continue}if(k<56320){(R-=3)>-1&&yt.push(239,191,189),Xe=k;continue}k=65536+(Xe-55296<<10|k-56320)}else Xe&&(R-=3)>-1&&yt.push(239,191,189);if(Xe=null,k<128){if((R-=1)<0)break;yt.push(k)}else if(k<2048){if((R-=2)<0)break;yt.push(k>>6|192,63&k|128)}else if(k<65536){if((R-=3)<0)break;yt.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((R-=4)<0)break;yt.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return yt}function Pe(B){return V.toByteArray(function(B){if((B=(B=B.split("=")[0]).trim().replace(qe,"")).length<2)return"";for(;B.length%4!=0;)B+="=";return B}(B))}function wt(B,R,k,Oe){for(var Xe=0;Xe=R.length||Xe>=B.length);++Xe)R[Xe+k]=B[Xe];return Xe}function pt(B,R){return B instanceof R||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===R.name}function fe(B){return B!=B}}).call(this)}).call(this,K("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(K,Ae,he){"use strict";Ae.exports=function q(V){return null===V||"object"!=typeof V||null!=V.toJSON?JSON.stringify(V):Array.isArray(V)?"["+V.reduce((L,re,$)=>L+(0===$?"":",")+q(void 0===re||"symbol"==typeof re?null:re),"")+"]":"{"+Object.keys(V).sort().reduce((L,re,$)=>void 0===V[re]||"symbol"==typeof V[re]?L:L+(0===L.length?"":",")+q(re)+":"+q(V[re]),"")+"}"}},{}],8:[function(K,Ae,he){"use strict";var L,q="object"==typeof Reflect?Reflect:null,V=q&&"function"==typeof q.apply?q.apply:function(U,ie,ue){return Function.prototype.apply.call(U,ie,ue)};L=q&&"function"==typeof q.ownKeys?q.ownKeys:Object.getOwnPropertySymbols?function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:function(U){return Object.getOwnPropertyNames(U)};var $=Number.isNaN||function(U){return U!=U};function b(){b.init.call(this)}Ae.exports=b,Ae.exports.once=function(E,U){return new Promise(function(ie,ue){function ee(Te){E.removeListener(U,se),ue(Te)}function se(){"function"==typeof E.removeListener&&E.removeListener("error",ee),ie([].slice.call(arguments))}Q(E,U,se,{once:!0}),"error"!==U&&function(E,U,ie){"function"==typeof E.on&&Q(E,"error",U,ie)}(E,ee,{once:!0})})},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var S=10;function O(E){if("function"!=typeof E)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function T(E){return void 0===E._maxListeners?b.defaultMaxListeners:E._maxListeners}function v(E,U,ie,ue){var ee,se,Te;if(O(ie),void 0===(se=E._events)?(se=E._events=Object.create(null),E._eventsCount=0):(void 0!==se.newListener&&(E.emit("newListener",U,ie.listener?ie.listener:ie),se=E._events),Te=se[U]),void 0===Te)Te=se[U]=ie,++E._eventsCount;else if("function"==typeof Te?Te=se[U]=ue?[ie,Te]:[Te,ie]:ue?Te.unshift(ie):Te.push(ie),(ee=T(E))>0&&Te.length>ee&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=U,me.count=Te.length,function(E){console&&console.warn&&console.warn(E)}(me)}return E}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(E,U,ie){var ue={fired:!1,wrapFn:void 0,target:E,type:U,listener:ie},ee=y.bind(ue);return ee.listener=ie,ue.wrapFn=ee,ee}function M(E,U,ie){var ue=E._events;if(void 0===ue)return[];var ee=ue[U];return void 0===ee?[]:"function"==typeof ee?ie?[ee.listener||ee]:[ee]:ie?function(E){for(var U=new Array(E.length),ie=0;ie0&&(Te=ie[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var te=se[U];if(void 0===te)return!1;if("function"==typeof te)V(te,this,ie);else{var ye=te.length,De=I(te,ye);for(ue=0;ue=0;Te--)if(ue[Te]===ie||ue[Te].listener===ie){me=ue[Te].listener,se=Te;break}if(se<0)return this;0===se?ue.shift():function(E,U){for(;U+1=0;ee--)this.removeListener(U,ie[ee]);return this},b.prototype.listeners=function(U){return M(this,U,!0)},b.prototype.rawListeners=function(U){return M(this,U,!1)},b.listenerCount=function(E,U){return"function"==typeof E.listenerCount?E.listenerCount(U):j.call(E,U)},b.prototype.listenerCount=j,b.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},{}],9:[function(K,Ae,he){he.read=function(q,V,L,re,$){var b,S,O=8*$-re-1,T=(1<>1,y=-7,w=L?$-1:0,M=L?-1:1,j=q[V+w];for(w+=M,b=j&(1<<-y)-1,j>>=-y,y+=O;y>0;b=256*b+q[V+w],w+=M,y-=8);for(S=b&(1<<-y)-1,b>>=-y,y+=re;y>0;S=256*S+q[V+w],w+=M,y-=8);if(0===b)b=1-v;else{if(b===T)return S?NaN:1/0*(j?-1:1);S+=Math.pow(2,re),b-=v}return(j?-1:1)*S*Math.pow(2,b-re)},he.write=function(q,V,L,re,$,b){var S,O,T,v=8*b-$-1,y=(1<>1,M=23===$?Math.pow(2,-24)-Math.pow(2,-77):0,j=re?0:b-1,I=re?1:-1,H=V<0||0===V&&1/V<0?1:0;for(V=Math.abs(V),isNaN(V)||V===1/0?(O=isNaN(V)?1:0,S=y):(S=Math.floor(Math.log(V)/Math.LN2),V*(T=Math.pow(2,-S))<1&&(S--,T*=2),(V+=S+w>=1?M/T:M*Math.pow(2,1-w))*T>=2&&(S++,T/=2),S+w>=y?(O=0,S=y):S+w>=1?(O=(V*T-1)*Math.pow(2,$),S+=w):(O=V*Math.pow(2,w-1)*Math.pow(2,$),S=0));$>=8;q[L+j]=255&O,j+=I,O/=256,$-=8);for(S=S<<$|O,v+=$;v>0;q[L+j]=255&S,j+=I,S/=256,v-=8);q[L+j-I]|=128*H}},{}],10:[function(K,Ae,he){Ae.exports="function"==typeof Object.create?function(V,L){L&&(V.super_=L,V.prototype=Object.create(L.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}))}:function(V,L){if(L){V.super_=L;var re=function(){};re.prototype=L.prototype,V.prototype=new re,V.prototype.constructor=V}}},{}],11:[function(K,Ae,he){"use strict";const{isArray:q,isObject:V,isString:L}=K("./types"),{asArray:re}=K("./util"),{prependBase:$}=K("./url"),b=K("./JsonLdError"),S=K("./ResolvedContext");function T(y){throw new b("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function v({context:y,base:w}){if(!y)return;const M=y["@context"];if(L(M))y["@context"]=$(w,M);else if(q(M))for(let j=0;j10)throw new b("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"loading remote context failed":"context overflow",max:10});if(I.has(M))throw new b("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"recursive context inclusion":"context overflow",url:M});let H,Y;I.add(M);try{Y=yield j(M),H=Y.document||null,L(H)&&(H=JSON.parse(H))}catch(D){throw new b("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:M,cause:D})}if(!V(H))throw new b("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:M});return H="@context"in H?{"@context":H["@context"]}:{"@context":{}},Y.contextUrl&&(q(H["@context"])||(H["@context"]=[H["@context"]]),H["@context"].push(Y.contextUrl)),{context:H,remoteDoc:Y}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(K,Ae,he){"use strict";Ae.exports=class extends Error{constructor(V="An unspecified JSON-LD error occurred.",L="jsonld.Error",re={}){super(V),this.name=L,this.message=V,this.details=re}}},{}],13:[function(K,Ae,he){"use strict";Ae.exports=q=>{class V{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(V,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(V.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:V}),V.compact=function(L,re){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):q.compact(L,re)},V.expand=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):q.expand(L)},V.flatten=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):q.flatten(L)},V}},{}],14:[function(K,Ae,he){"use strict";Ae.exports=K("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(K,Ae,he){"use strict";Ae.exports=class{constructor(){this._requests={}}wrapLoader(V){const L=this;return L._loader=V,function(){return L.add.apply(L,arguments)}}add(V){var L=this;return gt(function*(){let re=L._requests[V];if(re)return Promise.resolve(re);re=L._requests[V]=L._loader(V);try{return yield re}finally{delete L._requests[V]}})()}}},{}],16:[function(K,Ae,he){"use strict";const q=K("lru-cache");Ae.exports=class{constructor({document:re}){this.document=re,this.cache=new q({max:10})}getProcessed(re){return this.cache.get(re)}setProcessed(re,$){this.cache.set(re,$)}}},{"lru-cache":33}],17:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),{isArray:V,isObject:L,isString:re,isUndefined:$}=K("./types"),{isList:b,isValue:S,isGraph:O,isSimpleGraph:T,isSubjectReference:v}=K("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:M,process:j,processingMode:I}=K("./context"),{removeBase:H,prependBase:Y}=K("./url"),{addValue:D,asArray:F,compareShortestLeast:Q}=K("./util"),E={};function ie(ue,ee,se){if("@nest"!==y(ue,ee,{vocab:!0},se))throw new q("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ae.exports=E,E.compact=function(){var ue=gt(function*({activeCtx:ee,activeProperty:se=null,element:Te,options:me={},compactionMap:te=(()=>{})}){if(V(Te)){let De=[];for(let Ve=0;Ve1&&(Je=Array.from(Je).sort());const Ye=ee;for(const Le of Je){const Ee=E.compactIri({activeCtx:Ye,iri:Le,relativeTo:{vocab:!0}}),Re=w(nt,Ee,"@context");$(Re)||(ee=yield j({activeCtx:ee,localCtx:Re,options:me,propagate:!1}))}const je=Object.keys(Te).sort();for(const Le of je){const Ee=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&M(Le)){const Re=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Re,Ee)}else{if(!V(Ee))throw new q("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ee.length){const Re=E.compactIri({activeCtx:ee,iri:Le,value:Ee,relativeTo:{vocab:!0},reverse:De}),Ue=ee.mappings.has(Re)?ee.mappings.get(Re)["@nest"]:null;let qe=Ve;Ue&&(ie(ee,Ue,me),L(Ve[Ue])||(Ve[Ue]={}),qe=Ve[Ue]),D(qe,Re,Ee,{propertyIsArray:!0})}for(const Re of Ee){const Ue=E.compactIri({activeCtx:ee,iri:Le,value:Re,relativeTo:{vocab:!0},reverse:De}),qe=ee.mappings.has(Ue)?ee.mappings.get(Ue)["@nest"]:null;let Be=Ve;qe&&(ie(ee,qe,me),L(Ve[qe])||(Ve[qe]={}),Be=Ve[qe]);const z=w(ee,Ue,"@container")||[],X=O(Re),be=b(Re);let ce;be?ce=Re["@list"]:X&&(ce=Re["@graph"]);let Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:be||X?ce:Re,options:me,compactionMap:te});if(be){if(V(Pe)||(Pe=[Pe]),z.includes("@list")){D(Be,Ue,Pe,{valueIsArray:!0,allowDuplicate:!0});continue}Pe={[E.compactIri({activeCtx:ee,iri:"@list",relativeTo:{vocab:!0}})]:Pe},"@index"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Re["@index"])}if(X)if(z.includes("@graph")&&(z.includes("@id")||z.includes("@index")&&T(Re))){let wt;Be.hasOwnProperty(Ue)?wt=Be[Ue]:Be[Ue]=wt={};const pt=(z.includes("@id")?Re["@id"]:Re["@index"])||E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}});D(wt,pt,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})}else z.includes("@graph")&&T(Re)?(V(Pe)&&Pe.length>1&&(Pe={"@included":Pe}),D(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})):(V(Pe)&&1===Pe.length&&me.compactArrays&&(Pe=Pe[0]),Pe={[E.compactIri({activeCtx:ee,iri:"@graph",relativeTo:{vocab:!0}})]:Pe},"@id"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Re["@id"]),"@index"in Re&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Re["@index"]),D(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")}));else if(z.includes("@language")||z.includes("@index")||z.includes("@id")||z.includes("@type")){let wt,pt;if(Be.hasOwnProperty(Ue)?wt=Be[Ue]:Be[Ue]=wt={},z.includes("@language"))S(Pe)&&(Pe=Pe["@value"]),pt=Re["@language"];else if(z.includes("@index")){const fe=w(ee,Ue,"@index")||"@index",B=E.compactIri({activeCtx:ee,iri:fe,relativeTo:{vocab:!0}});if("@index"===fe)pt=Re["@index"],delete Pe[B];else{let R;if([pt,...R]=F(Pe[fe]||[]),re(pt))switch(R.length){case 0:delete Pe[fe];break;case 1:Pe[fe]=R[0];break;default:Pe[fe]=R}else pt=null}}else if(z.includes("@id")){const fe=E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}});pt=Pe[fe],delete Pe[fe]}else if(z.includes("@type")){const fe=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=F(Pe[fe]||[]),B.length){case 0:delete Pe[fe];break;case 1:Pe[fe]=B[0];break;default:Pe[fe]=B}1===Object.keys(Pe).length&&"@id"in Re&&(Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:{"@id":Re["@id"]},options:me,compactionMap:te}))}pt||(pt=E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}})),D(wt,pt,Pe,{propertyIsArray:z.includes("@set")})}else{const wt=!me.compactArrays||z.includes("@set")||z.includes("@list")||V(Pe)&&0===Pe.length||"@list"===Le||"@graph"===Le;D(Be,Ue,Pe,{propertyIsArray:wt})}}}else{if((w(ee,se,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Ue,Ee)}else{const Re=yield E.compact({activeCtx:ee,activeProperty:se,element:Ee,options:me,compactionMap:te});V(Re)&&0===Re.length||D(Ve,Le,Re)}else{const Re=yield E.compact({activeCtx:ee,activeProperty:"@reverse",element:Ee,options:me,compactionMap:te});for(const Ue in Re)if(ee.mappings.has(Ue)&&ee.mappings.get(Ue).reverse){const qe=Re[Ue],z=(w(ee,Ue,"@container")||[]).includes("@set")||!me.compactArrays;D(Ve,Ue,qe,{propertyIsArray:z}),delete Re[Ue]}if(Object.keys(Re).length>0){const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});D(Ve,Ue,Re)}}else{let Re=F(Ee).map(X=>E.compactIri({activeCtx:nt,iri:X,relativeTo:{vocab:!0}}));1===Re.length&&(Re=Re[0]);const Ue=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}}),z=(w(ee,Ue,"@container")||[]).includes("@set")&&I(ee,1.1)||V(Re)&&0===Ee.length;D(Ve,Ue,Re,{propertyIsArray:z})}else{let Re=F(Ee).map(qe=>E.compactIri({activeCtx:ee,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Re.length&&(Re=Re[0]),Ve[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Re}}return Ve}return Te});return function(ee){return ue.apply(this,arguments)}}(),E.compactIri=({activeCtx:ue,iri:ee,value:se=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:te=null})=>{if(null===ee)return ee;ue.isPropertyTermScoped&&ue.previousContext&&(ue=ue.previousContext);const ye=ue.getInverse();if(M(ee)&&ee in ye&&"@none"in ye[ee]&&"@type"in ye[ee]["@none"]&&"@none"in ye[ee]["@none"]["@type"])return ye[ee]["@none"]["@type"]["@none"];if(Te.vocab&&ee in ye){const Je=ue["@language"]||"@none",Ye=[];L(se)&&"@index"in se&&!("@graph"in se)&&Ye.push("@index","@index@set"),L(se)&&"@preserve"in se&&(se=se["@preserve"][0]),O(se)?("@index"in se&&Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se&&Ye.push("@graph@id","@graph@id@set"),Ye.push("@graph","@graph@set","@set"),"@index"in se||Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se||Ye.push("@graph@id","@graph@id@set")):L(se)&&!S(se)&&Ye.push("@id","@id@set","@type","@set@type");let je="@language",Le="@null";if(me)je="@type",Le="@reverse",Ye.push("@set");else if(b(se)){"@index"in se||Ye.push("@list");const Re=se["@list"];if(0===Re.length)je="@any",Le="@none";else{let Ue=0===Re.length?Je:null,qe=null;for(let Be=0;Bent.includes("_"));Ve&&ye.push(Ve.replace(/^[^_]+_/,"_"))}ye.push("@none");const De=ue.inverse[ee];for(const Ve of Te){if(!(Ve in De))continue;const nt=De[Ve][me];for(const Ze of ye)if(Ze in nt)return nt[Ze]}return null}(ue,ee,se,Ye,je,Le);if(null!==Ee)return Ee}if(Te.vocab&&"@vocab"in ue){const Je=ue["@vocab"];if(0===ee.indexOf(Je)&&ee!==Je){const Ye=ee.substr(Je.length);if(!ue.mappings.has(Ye))return Ye}}let De=null;const Ve=[];let nt=ue.fastCurieMap;const Ze=ee.length-1;for(let Je=0;Je=0;--Je){const Ye=Ve[Je],je=Ye.terms;for(const Le of je){const Ee=Le+":"+ee.substr(Ye.iri.length);ue.mappings.get(Le)._prefix&&(!ue.mappings.has(Ee)||null===se&&ue.mappings.get(Ee)["@id"]===ee)&&(null===De||Q(Ee,De)<0)&&(De=Ee)}}if(null!==De)return De;for(const[Je,Ye]of ue.mappings)if(Ye&&Ye._prefix&&ee.startsWith(Je+":"))throw new q(`Absolute IRI "${ee}" confused with prefix "${Je}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ue});return Te.vocab?ee:"@base"in ue?ue["@base"]?H(Y(te,ue["@base"]),ee):ee:H(te,ee)},E.compactValue=({activeCtx:ue,activeProperty:ee,value:se,options:Te})=>{if(S(se)){const De=w(ue,ee,"@type"),Ve=w(ue,ee,"@language"),nt=w(ue,ee,"@direction"),Ze=w(ue,ee,"@container")||[],Je="@index"in se&&!Ze.includes("@index");if(!Je&&"@none"!==De&&(se["@type"]===De||"@language"in se&&se["@language"]===Ve&&"@direction"in se&&se["@direction"]===nt||"@language"in se&&se["@language"]===Ve||"@direction"in se&&se["@direction"]===nt))return se["@value"];const Ye=Object.keys(se).length,je=1===Ye||2===Ye&&"@index"in se&&!Je,Le="@language"in ue,Ee=re(se["@value"]),Re=ue.mappings.has(ee)&&null===ue.mappings.get(ee)["@language"];if(je&&"@none"!==De&&(!Le||!Ee||Re))return se["@value"];const Ue={};return Je&&(Ue[E.compactIri({activeCtx:ue,iri:"@index",relativeTo:{vocab:!0}})]=se["@index"]),"@type"in se?Ue[E.compactIri({activeCtx:ue,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ue,iri:se["@type"],relativeTo:{vocab:!0}}):"@language"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@language",relativeTo:{vocab:!0}})]=se["@language"]),"@direction"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@direction",relativeTo:{vocab:!0}})]=se["@direction"]),Ue[E.compactIri({activeCtx:ue,iri:"@value",relativeTo:{vocab:!0}})]=se["@value"],Ue}const me=y(ue,ee,{vocab:!0},Te),te=w(ue,ee,"@type"),ye=E.compactIri({activeCtx:ue,iri:se["@id"],relativeTo:{vocab:"@vocab"===te},base:Te.base});return"@id"===te||"@vocab"===te||"@graph"===me?ye:{[E.compactIri({activeCtx:ue,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(K,Ae,he){"use strict";const q="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#";Ae.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:q,RDF_LIST:q+"List",RDF_FIRST:q+"first",RDF_REST:q+"rest",RDF_NIL:q+"nil",RDF_TYPE:q+"type",RDF_PLAIN_LITERAL:q+"PlainLiteral",RDF_XML_LITERAL:q+"XMLLiteral",RDF_JSON_LITERAL:q+"JSON",RDF_OBJECT:q+"object",RDF_LANGSTRING:q+"langString",XSD:V,XSD_BOOLEAN:V+"boolean",XSD_DOUBLE:V+"double",XSD_INTEGER:V+"integer",XSD_STRING:V+"string"}},{}],19:[function(K,Ae,he){"use strict";const q=K("./util"),V=K("./JsonLdError"),{isArray:L,isObject:re,isString:$,isUndefined:b}=K("./types"),{isAbsolute:S,isRelative:O,prependBase:T}=K("./url"),{asArray:v,compareShortestLeast:y}=K("./util"),w=new Map,j=/^@[a-zA-Z]+$/,I={};function H(D,F,Q,E,U,ie){if(null===F||!$(F)||I.isKeyword(F))return F;if(F.match(j))return null;if(E&&E.hasOwnProperty(F)&&!0!==U.get(F)&&I.createTermDefinition({activeCtx:D,localCtx:E,term:F,defined:U,options:ie}),(Q=Q||{}).vocab){const ee=D.mappings.get(F);if(null===ee)return null;if(re(ee)&&"@id"in ee)return ee["@id"]}const ue=F.indexOf(":");if(ue>0){const ee=F.substr(0,ue),se=F.substr(ue+1);if("_"===ee||0===se.indexOf("//"))return F;E&&E.hasOwnProperty(ee)&&I.createTermDefinition({activeCtx:D,localCtx:E,term:ee,defined:U,options:ie});const Te=D.mappings.get(ee);if(Te&&Te._prefix)return Te["@id"]+se;if(S(F))return F}if(Q.vocab&&"@vocab"in D)return D["@vocab"]+F;if(Q.base&&"@base"in D){if(D["@base"])return T(T(ie.base,D["@base"]),F)}else if(Q.base)return T(ie.base,F);return F}function Y(D,F){if(!D||"object"!=typeof D||!F||"object"!=typeof F)return D===F;const Q=Array.isArray(D);if(Q!==Array.isArray(F))return!1;if(Q){if(D.length!==F.length)return!1;for(let ie=0;ie{if(E.has(Q)){if(E.get(Q))return;throw new V("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:F,term:Q})}let ue;if(E.set(Q,!1),F.hasOwnProperty(Q)&&(ue=F[Q]),"@type"===Q&&re(ue)&&"@set"===(ue["@container"]||"@set")&&I.processingMode(D,1.1)){const De=["@container","@id","@protected"],Ve=Object.keys(ue);if(0===Ve.length||Ve.some(nt=>!De.includes(nt)))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q})}else{if(I.isKeyword(Q))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q});if(Q.match(j))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:Q});if(""===Q)throw new V("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:F})}const ee=D.mappings.get(Q);D.mappings.has(Q)&&D.mappings.delete(Q);let se=!1;if(($(ue)||null===ue)&&(se=!0,ue={"@id":ue}),!re(ue))throw new V("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:F});const Te={};D.mappings.set(Q,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];I.processingMode(D,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const De in ue)if(!me.includes(De))throw new V("Invalid JSON-LD syntax; a term definition must not contain "+De,"jsonld.SyntaxError",{code:"invalid term definition",context:F});const te=Q.indexOf(":");if(Te._termHasColon=te>0,"@reverse"in ue){if("@id"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});if("@nest"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});const De=ue["@reverse"];if(!$(De))throw new V("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(!I.isKeyword(De)&&De.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:De}),void(ee?D.mappings.set(Q,ee):D.mappings.delete(Q));const Ve=H(D,De,{vocab:!0,base:!1},F,E,U);if(!S(Ve))throw new V("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:F});Te["@id"]=Ve,Te.reverse=!0}else if("@id"in ue){let De=ue["@id"];if(De&&!$(De))throw new V("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(null===De)Te["@id"]=null;else{if(!I.isKeyword(De)&&De.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:De}),void(ee?D.mappings.set(Q,ee):D.mappings.delete(Q));if(De!==Q){if(De=H(D,De,{vocab:!0,base:!1},F,E,U),!S(De)&&!I.isKeyword(De))throw new V("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:F});if(Q.match(/(?::[^:])|\//)&&H(D,Q,{vocab:!0,base:!1},F,new Map(E).set(Q,!0),U)!==De)throw new V("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});Te["@id"]=De,Te._prefix=se&&!Te._termHasColon&&De.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const De=Q.substr(0,te);if(F.hasOwnProperty(De)&&I.createTermDefinition({activeCtx:D,localCtx:F,term:De,defined:E,options:U}),D.mappings.has(De)){const Ve=Q.substr(te+1);Te["@id"]=D.mappings.get(De)["@id"]+Ve}else Te["@id"]=Q}else if("@type"===Q)Te["@id"]=Q;else{if(!("@vocab"in D))throw new V("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F,term:Q});Te["@id"]=D["@vocab"]+Q}if((!0===ue["@protected"]||!0===E.get("@protected")&&!1!==ue["@protected"])&&(D.protected[Q]=!0,Te.protected=!0),E.set(Q,!0),"@type"in ue){let De=ue["@type"];if(!$(De))throw new V("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if("@json"===De||"@none"===De){if(I.processingMode(D,1))throw new V(`Invalid JSON-LD syntax; an @context @type value must not be "${De}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else if("@id"!==De&&"@vocab"!==De){if(De=H(D,De,{vocab:!0,base:!1},F,E,U),!S(De))throw new V("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if(0===De.indexOf("_:"))throw new V("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}Te["@type"]=De}if("@container"in ue){const De=$(ue["@container"])?[ue["@container"]]:ue["@container"]||[],Ve=["@list","@set","@index","@language"];let nt=!0;const Ze=De.includes("@set");if(I.processingMode(D,1.1)){if(Ve.push("@graph","@id","@type"),De.includes("@list")){if(1!==De.length)throw new V("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:F})}else if(De.includes("@graph")){if(De.some(Je=>"@graph"!==Je&&"@id"!==Je&&"@index"!==Je&&"@set"!==Je))throw new V("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:F})}else nt&=De.length<=(Ze?2:1);if(De.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new V("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else nt&=!L(ue["@container"]),nt&=De.length<=1;if(nt&=De.every(Je=>Ve.includes(Je)),nt&=!(Ze&&De.includes("@list")),!nt)throw new V("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ve.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:F});if(Te.reverse&&!De.every(Je=>["@index","@set"].includes(Je)))throw new V("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});Te["@container"]=De}if("@index"in ue){if(!("@container"in ue)||!Te["@container"].includes("@index"))throw new V(`Invalid JSON-LD syntax; @index without @index in @container: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});if(!$(ue["@index"])||0===ue["@index"].indexOf("@"))throw new V(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});Te["@index"]=ue["@index"]}if("@context"in ue&&(Te["@context"]=ue["@context"]),"@language"in ue&&!("@type"in ue)){let De=ue["@language"];if(null!==De&&!$(De))throw new V("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:F});null!==De&&(De=De.toLowerCase()),Te["@language"]=De}if("@prefix"in ue){if(Q.match(/:|\//))throw new V("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:F});if(I.isKeyword(Te["@id"]))throw new V("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:F});if("boolean"!=typeof ue["@prefix"])throw new V("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:F});Te._prefix=!0===ue["@prefix"]}if("@direction"in ue){const De=ue["@direction"];if(null!==De&&"ltr"!==De&&"rtl"!==De)throw new V('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:F});Te["@direction"]=De}if("@nest"in ue){const De=ue["@nest"];if(!$(De)||"@nest"!==De&&0===De.indexOf("@"))throw new V("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:F});Te["@nest"]=De}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new V("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:F});if(ee&&ee.protected&&!ie&&(D.protected[Q]=!0,Te.protected=!0,!Y(ee,Te))){const De=U&&U.protectedMode||"error";if("error"===De)throw new V(`Invalid JSON-LD syntax; tried to redefine "${Q}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:F,term:Q});if("warn"===De)return void console.warn("WARNING: protected term redefinition",{term:Q});throw new V("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:F,term:Q,protectedMode:De})}},I.expandIri=(D,F,Q,E)=>H(D,F,Q,void 0,void 0,E),I.getInitialContext=D=>{const F=JSON.stringify({processingMode:D.processingMode}),Q=w.get(F);if(Q)return Q;const E={processingMode:D.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},te=Te.fastCurieMap={},ye={},De=(Te["@language"]||"@none").toLowerCase(),Ve=Te["@direction"],nt=Te.mappings,Ze=[...nt.keys()].sort(y);for(const Je of Ze){const Ye=nt.get(Je);if(null===Ye)continue;let je=Ye["@container"]||"@none";if(je=[].concat(je).sort().join(""),null===Ye["@id"])continue;const Le=v(Ye["@id"]);for(const Ee of Le){let Re=me[Ee];const Ue=I.isKeyword(Ee);if(Re)!Ue&&!Ye._termHasColon&&ye[Ee].push(Je);else if(me[Ee]=Re={},!Ue&&!Ye._termHasColon){ye[Ee]=[Je];const qe={iri:Ee,terms:ye[Ee]};Ee[0]in te?te[Ee[0]].push(qe):te[Ee[0]]=[qe]}if(Re[je]||(Re[je]={"@language":{},"@type":{},"@any":{}}),Re=Re[je],ue(Je,Re["@any"],"@none"),Ye.reverse)ue(Je,Re["@type"],"@reverse");else if("@none"===Ye["@type"])ue(Je,Re["@any"],"@none"),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none");else if("@type"in Ye)ue(Je,Re["@type"],Ye["@type"]);else if("@language"in Ye&&"@direction"in Ye){const qe=Ye["@language"],Be=Ye["@direction"];ue(Je,Re["@language"],qe&&Be?`${qe}_${Be}`.toLowerCase():qe?qe.toLowerCase():Be?`_${Be}`:"@null")}else"@language"in Ye?ue(Je,Re["@language"],(Ye["@language"]||"@null").toLowerCase()):"@direction"in Ye?ue(Je,Re["@language"],Ye["@direction"]?`_${Ye["@direction"]}`:"@none"):Ve?(ue(Je,Re["@language"],`_${Ve}`),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none")):(ue(Je,Re["@language"],De),ue(Je,Re["@language"],"@none"),ue(Je,Re["@type"],"@none"))}}for(const Je in te)ie(te,Je,1);return me},clone:function(){const Te={};return Te.mappings=q.clone(this.mappings),Te.clone=this.clone,Te.inverse=null,Te.getInverse=this.getInverse,Te.protected=q.clone(this.protected),this.previousContext&&(Te.previousContext=this.previousContext.clone()),Te.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Te["@base"]=this["@base"]),"@language"in this&&(Te["@language"]=this["@language"]),"@vocab"in this&&(Te["@vocab"]=this["@vocab"]),Te},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===w.size&&w.clear(),w.set(F,E),E;function ie(Te,me,te){const ye=Te[me],De=Te[me]={};let Ve,nt;for(const Ze of ye)Ve=Ze.iri,nt=te>=Ve.length?"":Ve[te],nt in De?De[nt].push(Ze):De[nt]=[Ze];for(const Ze in De)""!==Ze&&ie(De,Ze,te+1)}function ue(Te,me,te){me.hasOwnProperty(te)||(me[te]=Te)}},I.getContextValue=(D,F,Q)=>{if(null===F)return"@context"===Q?void 0:null;if(D.mappings.has(F)){const E=D.mappings.get(F);if(b(Q))return E;if(E.hasOwnProperty(Q))return E[Q]}return"@language"===Q&&Q in D||"@direction"===Q&&Q in D?D[Q]:"@context"!==Q?null:void 0},I.processingMode=(D,F)=>F.toString()>="1.1"?!D.processingMode||D.processingMode>="json-ld-"+F.toString():"json-ld-1.0"===D.processingMode,I.isKeyword=D=>{if(!$(D)||"@"!==D[0])return!1;switch(D){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(K,Ae,he){"use strict";const{parseLinkHeader:q,buildHeaders:V}=K("../util"),{LINK_HEADER_CONTEXT:L}=K("../constants"),re=K("../JsonLdError"),$=K("../RequestQueue"),{prependBase:b}=K("../url"),S=/(^|(\r\n))link:/i;function O(T,v,y){const w=new(T=T||XMLHttpRequest);return new Promise((M,j)=>{w.onload=()=>M(w),w.onerror=I=>j(I),w.open("GET",v,!0);for(const I in y)w.setRequestHeader(I,y[I]);w.send()})}Ae.exports=({secure:T,headers:v={},xhr:y}={headers:{}})=>{return v=V(v),(new $).wrapLoader(M);function M(I){return j.apply(this,arguments)}function j(){return(j=gt(function*(I){if(0!==I.indexOf("http:")&&0!==I.indexOf("https:"))throw new re('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:I});if(T&&0!==I.indexOf("https"))throw new re('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:I});let H;try{H=yield O(y,I,v)}catch(E){throw new re("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:I,cause:E})}if(H.status>=400)throw new re("URL could not be dereferenced: "+H.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:I,httpStatusCode:H.status});let Y={contextUrl:null,documentUrl:I,document:H.response},D=null;const F=H.getResponseHeader("Content-Type");let Q;if(S.test(H.getAllResponseHeaders())&&(Q=H.getResponseHeader("Link")),Q&&"application/ld+json"!==F){const E=q(Q),U=E[L];if(Array.isArray(U))throw new re("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:I});U&&(Y.contextUrl=U.target),D=E.alternate,D&&"application/ld+json"==D.type&&!(F||"").match(/^application\/(\w*\+)?json$/)&&(Y=yield M(b(I,D.target)))}return Y})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),{isArray:V,isObject:L,isEmptyObject:re,isString:$,isUndefined:b}=K("./types"),{isList:S,isValue:O,isGraph:T,isSubject:v}=K("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:M,process:j,processingMode:I}=K("./context"),{isAbsolute:H}=K("./url"),{addValue:Y,asArray:D,getValues:F,validateTypeValue:Q}=K("./util"),E={};Ae.exports=E;const U=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function ie(te){return ue.apply(this,arguments)}function ue(){return(ue=gt(function*({activeCtx:te,activeProperty:ye,expandedActiveProperty:De,element:Ve,expandedParent:nt,options:Ze={},insideList:Je,typeKey:Ye,typeScopedContext:je,expansionMap:Le}){const Ee=Object.keys(Ve).sort(),Re=[];let Ue;const qe=Ve[Ye]&&"@json"===y(te,V(Ve[Ye])?Ve[Ye][0]:Ve[Ye],{vocab:!0},Ze);for(const Be of Ee){let X,z=Ve[Be];if("@context"===Be)continue;let be=y(te,Be,{vocab:!0},Ze);if((null===be||!H(be)&&!M(be))&&(be=Le({unmappedProperty:Be,activeCtx:te,activeProperty:ye,parent:Ve,options:Ze,insideList:Je,value:z,expandedParent:nt}),void 0===be))continue;if(M(be)){if("@reverse"===De)throw new q("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(be in nt&&"@included"!==be&&"@type"!==be)throw new q("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:be})}if("@id"===be){if(!$(z)){if(!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(L(z)){if(!re(z))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!V(z))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(pt=>$(pt)))throw new q('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}Y(nt,"@id",D(z).map(pt=>$(pt)?y(te,pt,{base:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@type"===be){L(z)&&(z=Object.fromEntries(Object.entries(z).map(([pt,fe])=>[y(je,pt,{vocab:!0}),D(fe).map(B=>y(je,B,{base:!0,vocab:!0}))]))),Q(z,Ze.isFrame),Y(nt,"@type",D(z).map(pt=>$(pt)?y(je,pt,{base:!0,vocab:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@included"===be&&I(te,1.1)){const pt=D(yield E.expand({activeCtx:te,activeProperty:ye,element:z,options:Ze,expansionMap:Le}));if(!pt.every(fe=>v(fe)))throw new q("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});Y(nt,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===be&&!L(z)&&!V(z))throw new q('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if("@value"===be){Ue=z,qe&&I(te,1.1)?nt["@value"]=z:Y(nt,"@value",z,{propertyIsArray:Ze.isFrame});continue}if("@language"===be){if(null===z)continue;if(!$(z)&&!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=D(z).map(pt=>$(pt)?pt.toLowerCase():pt);for(const pt of z)$(pt)&&!pt.match(U)&&console.warn(`@language must be valid BCP47: ${pt}`);Y(nt,"@language",z,{propertyIsArray:Ze.isFrame});continue}if("@direction"===be){if(!$(z)&&!Ze.isFrame)throw new q('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=D(z);for(const pt of z)if($(pt)&&"ltr"!==pt&&"rtl"!==pt)throw new q('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});Y(nt,"@direction",z,{propertyIsArray:Ze.isFrame});continue}if("@index"===be){if(!$(z))throw new q('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});Y(nt,"@index",z);continue}if("@reverse"===be){if(!L(z))throw new q('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(X=yield E.expand({activeCtx:te,activeProperty:"@reverse",element:z,options:Ze,expansionMap:Le}),"@reverse"in X)for(const fe in X["@reverse"])Y(nt,fe,X["@reverse"][fe],{propertyIsArray:!0});let pt=nt["@reverse"]||null;for(const fe in X){if("@reverse"===fe)continue;null===pt&&(pt=nt["@reverse"]={}),Y(pt,fe,[],{propertyIsArray:!0});const B=X[fe];for(let R=0;R"@id"===pt||"@index"===pt)&&(X=D(X).map(pt=>({"@graph":D(pt)}))),ce.mappings.has(Be)&&ce.mappings.get(Be).reverse){const pt=nt["@reverse"]=nt["@reverse"]||{};X=D(X);for(let fe=0;fe"@value"===y(te,be,{vocab:!0},Ze)))throw new q("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:X});yield ie({activeCtx:te,activeProperty:ye,expandedActiveProperty:De,element:X,expandedParent:nt,options:Ze,insideList:Je,typeScopedContext:je,typeKey:Ye,expansionMap:Le})}}})).apply(this,arguments)}function ee({activeCtx:te,activeProperty:ye,value:De,options:Ve}){if(null==De)return null;const nt=y(te,ye,{vocab:!0},Ve);if("@id"===nt)return y(te,De,{base:!0},Ve);if("@type"===nt)return y(te,De,{vocab:!0,base:!0},Ve);const Ze=w(te,ye,"@type");if(("@id"===Ze||"@graph"===nt)&&$(De))return{"@id":y(te,De,{base:!0},Ve)};if("@vocab"===Ze&&$(De))return{"@id":y(te,De,{vocab:!0,base:!0},Ve)};if(M(nt))return De;const Je={};if(Ze&&!["@id","@vocab","@none"].includes(Ze))Je["@type"]=Ze;else if($(De)){const Ye=w(te,ye,"@language");null!==Ye&&(Je["@language"]=Ye);const je=w(te,ye,"@direction");null!==je&&(Je["@direction"]=je)}return["boolean","number","string"].includes(typeof De)||(De=De.toString()),Je["@value"]=De,Je}function se(te,ye,De,Ve){const nt=[],Ze=Object.keys(ye).sort();for(const Je of Ze){const Ye=y(te,Je,{vocab:!0},Ve);let je=ye[Je];V(je)||(je=[je]);for(const Le of je){if(null===Le)continue;if(!$(Le))throw new q("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ee={"@value":Le};"@none"!==Ye&&(Ee["@language"]=Je.toLowerCase()),De&&(Ee["@direction"]=De),nt.push(Ee)}}return nt}function Te(te){return me.apply(this,arguments)}function me(){return(me=gt(function*({activeCtx:te,options:ye,activeProperty:De,value:Ve,expansionMap:nt,asGraph:Ze,indexKey:Je,propertyIndex:Ye}){const je=[],Le=Object.keys(Ve).sort(),Ee="@type"===Je;for(let Re of Le){if(Ee){const Be=w(te,Re,"@context");b(Be)||(te=yield j({activeCtx:te,localCtx:Be,propagate:!1,options:ye}))}let qe,Ue=Ve[Re];V(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:te,activeProperty:De,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:nt}),qe=Ye?"@none"===Re?"@none":ee({activeCtx:te,activeProperty:Je,value:Re,options:ye}):y(te,Re,{vocab:!0},ye),"@id"===Je?Re=y(te,Re,{base:!0},ye):Ee&&(Re=qe);for(let Be of Ue){if(Ze&&!T(Be)&&(Be={"@graph":[Be]}),"@type"===Je)"@none"===qe||(Be["@type"]=Be["@type"]?[Re].concat(Be["@type"]):[Re]);else{if(O(Be)&&!["@language","@type","@index"].includes(Je))throw new q(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${Je}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Be});Ye?"@none"!==qe&&Y(Be,Ye,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(Je in Be)&&(Be[Je]=Re)}je.push(Be)}}return je})).apply(this,arguments)}E.expand=function(){var te=gt(function*({activeCtx:ye,activeProperty:De=null,element:Ve,options:nt={},insideList:Ze=!1,insideIndex:Je=!1,typeScopedContext:Ye=null,expansionMap:je=(()=>{})}){if(null==Ve)return null;if("@default"===De&&(nt=Object.assign({},nt,{isFrame:!1})),!V(Ve)&&!L(Ve)){if(!Ze&&(null===De||"@graph"===y(ye,De,{vocab:!0},nt))){const X=yield je({unmappedValue:Ve,activeCtx:ye,activeProperty:De,options:nt,insideList:Ze});return void 0===X?null:X}return ee({activeCtx:ye,activeProperty:De,value:Ve,options:nt})}if(V(Ve)){let X=[];const be=w(ye,De,"@container")||[];Ze=Ze||be.includes("@list");for(let ce=0;ce1?ce.slice().sort():ce:[ce];for(const wt of Pe){const pt=w(Ye,wt,"@context");b(pt)||(ye=yield j({activeCtx:ye,localCtx:pt,options:nt,propagate:!1}))}}let Be={};yield ie({activeCtx:ye,activeProperty:De,expandedActiveProperty:Le,element:Ve,expandedParent:Be,options:nt,insideList:Ze,typeKey:qe,typeScopedContext:Ye,expansionMap:je}),Re=Object.keys(Be);let z=Re.length;if("@value"in Be){if("@type"in Be&&("@language"in Be||"@direction"in Be))throw new q('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:Be});let X=z-1;if("@type"in Be&&(X-=1),"@index"in Be&&(X-=1),"@language"in Be&&(X-=1),"@direction"in Be&&(X-=1),0!==X)throw new q('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:Be});const be=null===Be["@value"]?[]:D(Be["@value"]),ce=F(Be,"@type");if(!I(ye,1.1)||!ce.includes("@json")||1!==ce.length)if(0===be.length){const Pe=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==Pe?Pe:null}else{if(!be.every(Pe=>$(Pe)||re(Pe))&&"@language"in Be)throw new q("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Be});if(!ce.every(Pe=>H(Pe)&&!($(Pe)&&0===Pe.indexOf("_:"))||re(Pe)))throw new q('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:Be})}}else if("@type"in Be&&!V(Be["@type"]))Be["@type"]=[Be["@type"]];else if("@set"in Be||"@list"in Be){if(z>1&&(2!==z||!("@index"in Be)))throw new q('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:Be});"@set"in Be&&(Be=Be["@set"],Re=Object.keys(Be),z=Re.length)}else if(1===z&&"@language"in Be){const X=yield je(Be,{unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}if(L(Be)&&!nt.keepFreeFloatingNodes&&!Ze&&(null===De||"@graph"===Le)&&(0===z||"@value"in Be||"@list"in Be||1===z&&"@id"in Be)){const X=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:De,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}return Be});return function(ye){return te.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(K,Ae,he){"use strict";const{isSubjectReference:q}=K("./graphTypes"),{createMergedNodeMap:V}=K("./nodeMap"),L={};Ae.exports=L,L.flatten=re=>{const $=V(re),b=[],S=Object.keys($).sort();for(let O=0;O=0;--ue){const ee=ie[ue];if(ee.graph===U&&ee.subject["@id"]===E["@id"])return!0}return!1}function w(E,U,ie){const ue="@"+ie;let ee=ue in E?E[ue][0]:U[ie];if("embed"===ie)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return ee}function M(E){if(!L.isArray(E)||1!==E.length||!L.isObject(E[0]))throw new b("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const U of re.asArray(E[0]["@id"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const U of re.asArray(E[0]["@type"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function I(E,U,ie,ue){let ee=!0,se=!1;for(const Te in ie){let me=!1;const te=re.getValues(U,Te),ye=0===re.getValues(ie,Te).length;if("@id"===Te){if(L.isEmptyObject(ie["@id"][0]||{})?me=!0:ie["@id"].length>=0&&(me=ie["@id"].includes(te[0])),!ue.requireAll)return me}else if("@type"===Te){if(ee=!1,ye){if(te.length>0)return!1;me=!0}else if(1===ie["@type"].length&&L.isEmptyObject(ie["@type"][0]))me=te.length>0;else for(const De of ie["@type"])me=!(!L.isObject(De)||!("@default"in De))||me||te.some(Ve=>Ve===De);if(!ue.requireAll)return me}else{if(q(Te))continue;{const De=re.getValues(ie,Te)[0];let Ve=!1;if(De&&(M([De]),Ve="@default"in De),ee=!1,0===te.length&&Ve)continue;if(te.length>0&&ye)return!1;if(void 0===De){if(te.length>0)return!1;me=!0}else if(V.isList(De)){const nt=De["@list"][0];if(V.isList(te[0])){const Ze=te[0]["@list"];V.isValue(nt)?me=Ze.some(Je=>Q(nt,Je)):(V.isSubject(nt)||V.isSubjectReference(nt))&&(me=Ze.some(Je=>F(E,nt,Je,ue)))}}else me=V.isValue(De)?te.some(nt=>Q(De,nt)):V.isSubjectReference(De)?te.some(nt=>F(E,De,nt,ue)):!!L.isObject(De)&&te.length>0}}if(!me&&ue.requireAll)return!1;se=se||me}return ee||se}function H(E,U){const ie=E.uniqueEmbeds[E.graph],ue=ie[U],ee=ue.parent,se=ue.property,Te={"@id":U};if(L.isArray(ee)){for(let te=0;te{const ye=Object.keys(ie);for(const De of ye)De in ie&&L.isObject(ie[De].parent)&&ie[De].parent["@id"]===te&&(delete ie[De],me(De))};me(U)}function Y(E,U){if(L.isArray(E))return E.map(ie=>Y(ie,U));if(L.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(V.isValue(E))return E;if(V.isList(E))return E["@list"]=Y(E["@list"],U),E;if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)"@id"===ie&&U.bnodesToClear.includes(E[ie])?delete E["@id"]:E[ie]=Y(E[ie],U)}return E}function D(E,U,ie){L.isObject(E)?re.addValue(E,U,ie,{propertyIsArray:!0}):E.push(ie)}function F(E,U,ie,ue){if(!("@id"in ie))return!1;const ee=E.subjects[ie["@id"]];return ee&&I(E,ee,U,ue)}function Q(E,U){const ie=U["@value"],ue=U["@type"],ee=U["@language"],se=E["@value"]?L.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?L.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?L.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===se.length&&0===Te.length&&0===me.length||!(!se.includes(ie)&&!L.isEmptyObject(se[0])||!(!ue&&0===Te.length||Te.includes(ue)||ue&&L.isEmptyObject(Te[0]))||!(!ee&&0===me.length||me.includes(ee)||ee&&L.isEmptyObject(me[0])))}Ae.exports=T,T.frameMergedOrDefault=(E,U,ie)=>{const ue={options:ie,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new re.IdentifierIssuer("_:b");S(E,ue.graphMap,"@default",ee),ie.merged&&(ue.graphMap["@merged"]=O(ue.graphMap),ue.graph="@merged"),ue.subjects=ue.graphMap[ue.graph];const se=[];return T.frame(ue,Object.keys(ue.subjects).sort(),U,se),ie.pruneBlankNodeIdentifiers&&(ie.bnodesToClear=Object.keys(ue.bnodeMap).filter(Te=>1===ue.bnodeMap[Te].length)),ie.link={},Y(se,ie)},T.frame=(E,U,ie,ue,ee=null)=>{M(ie);const se=E.options,Te={embed:w(ie=ie[0],se,"embed"),explicit:w(ie,se,"explicit"),requireAll:w(ie,se,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],te=function(E,U,ie,ue){const ee={};for(const se of U){const Te=E.graphMap[E.graph][se];I(E,Te,ie,ue)&&(ee[se]=Te)}return ee}(E,U,ie,Te),ye=Object.keys(te).sort();for(const De of ye){const Ve=te[De];if(null===ee?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&De in me){D(ue,ee,me[De]);continue}const nt={"@id":De};if(0===De.indexOf("_:")&&re.addValue(E.bnodeMap,De,nt,{propertyIsArray:!0}),me[De]=nt,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:ie});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(De)){if(E.embedded&&("@never"===Te.embed||y(Ve,E.graph,E.subjectStack))){D(ue,ee,nt);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(De)){D(ue,ee,nt);continue}if("@last"===Te.embed&&De in E.uniqueEmbeds[E.graph]&&H(E,De),E.uniqueEmbeds[E.graph][De]={parent:ue,property:ee},E.subjectStack.push({subject:Ve,graph:E.graph}),De in E.graphMap){let Ze=!1,Je=null;"@graph"in ie?(Je=ie["@graph"][0],Ze=!("@merged"===De||"@default"===De),L.isObject(Je)||(Je={})):(Ze="@merged"!==E.graph,Je={}),Ze&&T.frame(Un(ht({},E),{graph:De,embedded:!1}),Object.keys(E.graphMap[De]).sort(),[Je],nt,"@graph")}"@included"in ie&&T.frame(Un(ht({},E),{embedded:!1}),U,ie["@included"],nt,"@included");for(const Ze of Object.keys(Ve).sort())if(q(Ze)){if(nt[Ze]=re.clone(Ve[Ze]),"@type"===Ze)for(const Je of Ve["@type"])0===Je.indexOf("_:")&&re.addValue(E.bnodeMap,Je,nt,{propertyIsArray:!0})}else if(!Te.explicit||Ze in ie)for(const Je of Ve[Ze]){const Ye=Ze in ie?ie[Ze]:v(Te);if(V.isList(Je)){const je=ie[Ze]&&ie[Ze][0]&&ie[Ze][0]["@list"]?ie[Ze][0]["@list"]:v(Te),Le={"@list":[]};D(nt,Ze,Le);const Ee=Je["@list"];for(const Re of Ee)V.isSubjectReference(Re)?T.frame(Un(ht({},E),{embedded:!0}),[Re["@id"]],je,Le,"@list"):D(Le,"@list",re.clone(Re))}else V.isSubjectReference(Je)?T.frame(Un(ht({},E),{embedded:!0}),[Je["@id"]],Ye,nt,Ze):Q(Ye[0],Je)&&D(nt,Ze,re.clone(Je))}for(const Ze of Object.keys(ie).sort()){if("@type"===Ze){if(!L.isObject(ie[Ze][0])||!("@default"in ie[Ze][0]))continue}else if(q(Ze))continue;const Je=ie[Ze][0]||{};if(!w(Je,se,"omitDefault")&&!(Ze in nt)){let je="@null";"@default"in Je&&(je=re.clone(Je["@default"])),L.isArray(je)||(je=[je]),nt[Ze]=[{"@preserve":je}]}}for(const Ze of Object.keys(ie["@reverse"]||{}).sort()){const Je=ie["@reverse"][Ze];for(const Ye of Object.keys(E.subjects))re.getValues(E.subjects[Ye],Ze).some(Le=>Le["@id"]===De)&&(nt["@reverse"]=nt["@reverse"]||{},re.addValue(nt["@reverse"],Ze,[],{propertyIsArray:!0}),T.frame(Un(ht({},E),{embedded:!0}),[Ye],Je,nt["@reverse"][Ze],ee))}D(ue,ee,nt),E.subjectStack.pop()}}},T.cleanupNull=(E,U)=>{if(L.isArray(E))return E.map(ue=>T.cleanupNull(ue,U)).filter(ue=>ue);if("@null"===E)return null;if(L.isObject(E)){if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)E[ie]=T.cleanupNull(E[ie],U)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(K,Ae,he){"use strict";const q=K("./JsonLdError"),V=K("./graphTypes"),L=K("./types"),re=K("./util"),{RDF_LIST:$,RDF_FIRST:b,RDF_REST:S,RDF_NIL:O,RDF_TYPE:T,RDF_JSON_LITERAL:v,XSD_BOOLEAN:y,XSD_DOUBLE:w,XSD_INTEGER:M,XSD_STRING:j}=K("./constants"),I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,H={};function Y(D,F,Q){if(D.termType.endsWith("Node"))return{"@id":D.value};const E={"@value":D.value};if(D.language)E["@language"]=D.language;else{let U=D.datatype.value;if(U||(U=j),U===v){U="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(ie){throw new q("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:ie})}}if(F){if(U===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(L.isNumeric(E["@value"]))if(U===M){const ie=parseInt(E["@value"],10);ie.toFixed(0)===E["@value"]&&(E["@value"]=ie)}else U===w&&(E["@value"]=parseFloat(E["@value"]));[y,M,w,j].includes(U)||(E["@type"]=U)}else if("i18n-datatype"===Q&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,ue]=U.split(/[#_]/);ie.length>0&&(E["@language"]=ie,ie.match(I)||console.warn(`@language must be valid BCP47: ${ie}`)),E["@direction"]=ue}else U!==j&&(E["@type"]=U)}return E}Ae.exports=H,H.fromRDF=function(){var D=gt(function*(F,{useRdfType:Q=!1,useNativeTypes:E=!1,rdfDirection:U=null}){const ie={},ue={"@default":ie},ee={};for(const me of F){const te="DefaultGraph"===me.graph.termType?"@default":me.graph.value;te in ue||(ue[te]={}),"@default"!==te&&!(te in ie)&&(ie[te]={"@id":te});const ye=ue[te],De=me.subject.value,Ve=me.predicate.value,nt=me.object;De in ye||(ye[De]={"@id":De});const Ze=ye[De],Je=nt.termType.endsWith("Node");if(Je&&!(nt.value in ye)&&(ye[nt.value]={"@id":nt.value}),Ve===T&&!Q&&Je){re.addValue(Ze,"@type",nt.value,{propertyIsArray:!0});continue}const Ye=Y(nt,E,U);if(re.addValue(Ze,Ve,Ye,{propertyIsArray:!0}),Je)if(nt.value===O){const je=ye[nt.value];"usages"in je||(je.usages=[]),je.usages.push({node:Ze,property:Ve,value:Ye})}else ee[nt.value]=!(nt.value in ee)&&{node:Ze,property:Ve,value:Ye}}for(const me in ue){const te=ue[me];if(!(O in te))continue;const ye=te[O];if(ye.usages){for(let De of ye.usages){let Ve=De.node,nt=De.property,Ze=De.value;const Je=[],Ye=[];let je=Object.keys(Ve).length;for(;nt===S&&L.isObject(ee[Ve["@id"]])&&L.isArray(Ve[b])&&1===Ve[b].length&&L.isArray(Ve[S])&&1===Ve[S].length&&(3===je||4===je&&L.isArray(Ve["@type"])&&1===Ve["@type"].length&&Ve["@type"][0]===$)&&(Je.push(Ve[b][0]),Ye.push(Ve["@id"]),De=ee[Ve["@id"]],Ve=De.node,nt=De.property,Ze=De.value,je=Object.keys(Ve).length,V.isBlankNode(Ve)););delete Ze["@id"],Ze["@list"]=Je.reverse();for(const Le of Ye)delete te[Le]}delete ye.usages}}const se=[],Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me];if(me in ue){const ye=te["@graph"]=[],De=ue[me],Ve=Object.keys(De).sort();for(const nt of Ve){const Ze=De[nt];V.isSubjectReference(Ze)||ye.push(Ze)}}V.isSubjectReference(te)||se.push(te)}return se});return function(F,Q){return D.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(K,Ae,he){"use strict";const q=K("./types"),V={};Ae.exports=V,V.isSubject=L=>!(!q.isObject(L)||"@value"in L||"@set"in L||"@list"in L)&&(Object.keys(L).length>1||!("@id"in L)),V.isSubjectReference=L=>q.isObject(L)&&1===Object.keys(L).length&&"@id"in L,V.isValue=L=>q.isObject(L)&&"@value"in L,V.isList=L=>q.isObject(L)&&"@list"in L,V.isGraph=L=>q.isObject(L)&&"@graph"in L&&1===Object.keys(L).filter(re=>"@id"!==re&&"@index"!==re).length,V.isSimpleGraph=L=>V.isGraph(L)&&!("@id"in L),V.isBlankNode=L=>!!q.isObject(L)&&("@id"in L?0===L["@id"].indexOf("_:"):0===Object.keys(L).length||!("@value"in L||"@set"in L||"@list"in L))},{"./types":30}],26:[function(K,Ae,he){const q=K("rdf-canonize"),V=K("./platform"),L=K("./util"),re=K("./ContextResolver"),$=L.IdentifierIssuer,b=K("./JsonLdError"),S=K("lru-cache"),O=K("./NQuads"),{expand:T}=K("./expand"),{flatten:v}=K("./flatten"),{fromRDF:y}=K("./fromRdf"),{toRDF:w}=K("./toRdf"),{frameMergedOrDefault:M,cleanupNull:j}=K("./frame"),{isArray:I,isObject:H,isString:Y}=K("./types"),{isSubjectReference:D}=K("./graphTypes"),{expandIri:F,getInitialContext:Q,process:E,processingMode:U}=K("./context"),{compact:ie,compactIri:ue}=K("./compact"),{createNodeMap:ee,createMergedNodeMap:se,mergeNodeMaps:Te}=K("./nodeMap"),me=function(ye){const De={},nt=new S({max:100});function Ze(Je,Le){var Ee=Le,{documentLoader:Ye=ye.documentLoader}=Ee,je=D7(Ee,["documentLoader"]);return Object.assign({},{documentLoader:Ye},je,Je)}return ye.compact=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===je)throw new b("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ye)return null;let Ee;(Le=Ze(Le,{base:Y(Ye)?Ye:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new $("_:b"),contextResolver:new re({sharedCache:nt})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ee=Le.skipExpansion?Ye:yield ye.expand(Ye,Le);const Re=yield ye.processContext(Q(Le),je,Le);let Ue=yield ie({activeCtx:Re,element:Ee,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&I(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&H(Ue)&&(Ue=[Ue]),H(je)&&"@context"in je&&(je=je["@context"]),je=L.clone(je),I(je)||(je=[je]);const qe=je;je=[];for(let z=0;z0)&&je.push(qe[z]);const Be=je.length>0;if(1===je.length&&(je=je[0]),I(Ue)){const z=ue({activeCtx:Re,iri:"@graph",relativeTo:{vocab:!0}}),X=Ue;Ue={},Be&&(Ue["@context"]=je),Ue[z]=X}else if(H(Ue)&&Be){const z=Ue;Ue={"@context":je};for(const X in z)Ue[X]=z[X]}return Ue});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.expand=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(je=Ze(je,{keepFreeFloatingNodes:!1,contextResolver:new re({sharedCache:nt})})).expansionMap&&(je.expansionMap=void 0);const Le={},Ee=[];if("expandContext"in je){const Be=L.clone(je.expandContext);Le.expandContext=H(Be)&&"@context"in Be?Be:{"@context":Be},Ee.push(Le.expandContext)}let Re;if(Y(Ye)){const Be=yield ye.get(Ye,je);Re=Be.documentUrl,Le.input=Be.document,Be.contextUrl&&(Le.remoteContext={"@context":Be.contextUrl},Ee.push(Le.remoteContext))}else Le.input=L.clone(Ye);"base"in je||(je.base=Re||"");let Ue=Q(je);for(const Be of Ee)Ue=yield E({activeCtx:Ue,localCtx:Be,options:je});let qe=yield T({activeCtx:Ue,element:Le.input,options:je,expansionMap:je.expansionMap});return H(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),I(qe)||(qe=[qe]),qe});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.flatten=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");je="function"==typeof je?null:je||null,Le=Ze(Le,{base:Y(Ye)?Ye:"",contextResolver:new re({sharedCache:nt})});const Ee=yield ye.expand(Ye,Le),Re=v(Ee);return null===je?Re:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Re,je,Le))});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.frame=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Ze(Le,{base:Y(Ye)?Ye:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new re({sharedCache:nt})}),Y(je)){const ce=yield ye.get(je,Le);if(je=ce.document,ce.contextUrl){let Pe=je["@context"];Pe?I(Pe)?Pe.push(ce.contextUrl):Pe=[Pe,ce.contextUrl]:Pe=ce.contextUrl,je["@context"]=Pe}}const Ee=je&&je["@context"]||{},Re=yield ye.processContext(Q(Le),Ee,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=U(Re,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=U(Re,1.1));const Ue=yield ye.expand(Ye,Le),qe=ht({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const Be=yield ye.expand(je,qe),z=Object.keys(je).map(ce=>F(Re,ce,{vocab:!0}));qe.merged=!z.includes("@graph"),qe.is11=U(Re,1.1);const X=M(Ue,Be,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let be=yield ye.compact(X,Ee,qe);return qe.link={},be=j(be,qe),be});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.link=function(){var Je=gt(function*(Ye,je,Le){const Ee={};return je&&(Ee["@context"]=je),Ee["@embed"]="@link",ye.frame(Ye,Ee,Le)});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(je=Ze(je,{base:Y(Ye)?Ye:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new re({sharedCache:nt})}))){if("application/n-quads"!==je.inputFormat&&"application/nquads"!==je.inputFormat)throw new b("Unknown canonicalization input format.","jsonld.CanonizeError");const Re=O.parse(Ye);return q.canonize(Re,je)}const Le=ht({},je);delete Le.format,Le.produceGeneralizedRdf=!1;const Ee=yield ye.toRDF(Ye,Le);return q.canonize(Ee,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.fromRDF=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");je=Ze(je,{format:Y(Ye)?"application/n-quads":void 0});const{format:Le}=je;let{rdfParser:Ee}=je;if(Le){if(Ee=Ee||De[Le],!Ee)throw new b("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ee=()=>Ye;const Re=yield Ee(Ye);return y(Re,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.toRDF=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(je=Ze(je,{base:Y(Ye)?Ye:"",skipExpansion:!1,contextResolver:new re({sharedCache:nt})})).skipExpansion?Ye:yield ye.expand(Ye,je);const Ee=w(Le,je);if(je.format){if("application/n-quads"===je.format||"application/nquads"===je.format)return O.serialize(Ee);throw new b("Unknown output format.","jsonld.UnknownFormat",{format:je.format})}return Ee});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.createNodeMap=function(){var Je=gt(function*(Ye,je){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");je=Ze(je,{base:Y(Ye)?Ye:"",contextResolver:new re({sharedCache:nt})});const Le=yield ye.expand(Ye,je);return se(Le,je)});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.merge=function(){var Je=gt(function*(Ye,je,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!I(Ye))throw new TypeError('Could not merge, "docs" must be an array.');je="function"==typeof je?null:je||null,Le=Ze(Le,{contextResolver:new re({sharedCache:nt})});const Ee=yield Promise.all(Ye.map(ce=>{const Pe=ht({},Le);return ye.expand(ce,Pe)}));let Re=!0;"mergeNodes"in Le&&(Re=Le.mergeNodes);const Ue=Le.issuer||new $("_:b"),qe={"@default":{}};for(let ce=0;ceye._documentLoader,set:Je=>ye._documentLoader=Je}),ye.documentLoader=function(){var Je=gt(function*(Ye){throw new b("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Ye})});return function(Ye){return Je.apply(this,arguments)}}(),ye.get=function(){var Je=gt(function*(Ye,je){let Le;Le="function"==typeof je.documentLoader?je.documentLoader:ye.documentLoader;const Ee=yield Le(Ye);try{if(!Ee.document)throw new b("No remote document found at the given URL.","jsonld.NullRemoteDocument");Y(Ee.document)&&(Ee.document=JSON.parse(Ee.document))}catch(Re){throw new b("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Re,remoteDoc:Ee})}return Ee});return function(Ye,je){return Je.apply(this,arguments)}}(),ye.processContext=function(){var Je=gt(function*(Ye,je,Le){return Le=Ze(Le,{base:"",contextResolver:new re({sharedCache:nt})}),null===je?Q(Le):(je=L.clone(je),H(je)&&"@context"in je||(je={"@context":je}),E({activeCtx:Ye,localCtx:je,options:Le}))});return function(Ye,je,Le){return Je.apply(this,arguments)}}(),ye.getContextValue=K("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(Je){if(!(Je in ye.documentLoaders))throw new b('Unknown document loader type: "'+Je+'"',"jsonld.UnknownDocumentLoader",{type:Je});ye.documentLoader=ye.documentLoaders[Je].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(Je,Ye){De[Je]=Ye},ye.unregisterRDFParser=function(Je){delete De[Je]},ye.registerRDFParser("application/n-quads",O.parse),ye.registerRDFParser("application/nquads",O.parse),ye.url=K("./url"),ye.util=L,Object.assign(ye,L),ye.promises=ye,ye.RequestQueue=K("./RequestQueue"),ye.JsonLdProcessor=K("./JsonLdProcessor")(ye),V.setupGlobals(ye),V.setupDocumentLoaders(ye),ye},te=function(){return me(function(){return te()})};me(te),Ae.exports=te},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(K,Ae,he){"use strict";const{isKeyword:q}=K("./context"),V=K("./graphTypes"),L=K("./types"),re=K("./util"),$=K("./JsonLdError"),b={};Ae.exports=b,b.createMergedNodeMap=(S,O)=>{const T=(O=O||{}).issuer||new re.IdentifierIssuer("_:b"),v={"@default":{}};return b.createNodeMap(S,v,"@default",T),b.mergeNodeMaps(v)},b.createNodeMap=(S,O,T,v,y,w)=>{if(L.isArray(S)){for(const H of S)b.createNodeMap(H,O,T,v,void 0,w);return}if(!L.isObject(S))return void(w&&w.push(S));if(V.isValue(S)){if("@type"in S){let H=S["@type"];0===H.indexOf("_:")&&(S["@type"]=H=v.getId(H))}return void(w&&w.push(S))}if(w&&V.isList(S)){const H=[];return b.createNodeMap(S["@list"],O,T,v,y,H),void w.push({"@list":H})}if("@type"in S){const H=S["@type"];for(const Y of H)0===Y.indexOf("_:")&&v.getId(Y)}L.isUndefined(y)&&(y=V.isBlankNode(S)?v.getId(S["@id"]):S["@id"]),w&&w.push({"@id":y});const M=O[T],j=M[y]=M[y]||{};j["@id"]=y;const I=Object.keys(S).sort();for(let H of I){if("@id"===H)continue;if("@reverse"===H){const D={"@id":y},F=S["@reverse"];for(const Q in F){const E=F[Q];for(const U of E){let ie=U["@id"];V.isBlankNode(U)&&(ie=v.getId(ie)),b.createNodeMap(U,O,T,v,ie),re.addValue(M[ie],Q,D,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===H){y in O||(O[y]={}),b.createNodeMap(S[H],O,y,v);continue}if("@included"===H){b.createNodeMap(S[H],O,T,v);continue}if("@type"!==H&&q(H)){if("@index"===H&&H in j&&(S[H]!==j[H]||S[H]["@id"]!==j[H]["@id"]))throw new $("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:j});j[H]=S[H];continue}const Y=S[H];if(0===H.indexOf("_:")&&(H=v.getId(H)),0!==Y.length)for(let D of Y)if("@type"===H&&(D=0===D.indexOf("_:")?v.getId(D):D),V.isSubject(D)||V.isSubjectReference(D)){if("@id"in D&&!D["@id"])continue;const F=V.isBlankNode(D)?v.getId(D["@id"]):D["@id"];re.addValue(j,H,{"@id":F},{propertyIsArray:!0,allowDuplicate:!1}),b.createNodeMap(D,O,T,v,F)}else if(V.isValue(D))re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1});else if(V.isList(D)){const F=[];b.createNodeMap(D["@list"],O,T,v,y,F),D={"@list":F},re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1})}else b.createNodeMap(D,O,T,v,y),re.addValue(j,H,D,{propertyIsArray:!0,allowDuplicate:!1});else re.addValue(j,H,[],{propertyIsArray:!0})}},b.mergeNodeMapGraphs=S=>{const O={};for(const T of Object.keys(S).sort())for(const v of Object.keys(S[T]).sort()){const y=S[T][v];v in O||(O[v]={"@id":v});const w=O[v];for(const M of Object.keys(y).sort())if(q(M)&&"@type"!==M)w[M]=re.clone(y[M]);else for(const j of y[M])re.addValue(w,M,re.clone(j),{propertyIsArray:!0,allowDuplicate:!1})}return O},b.mergeNodeMaps=S=>{const O=S["@default"],T=Object.keys(S).sort();for(const v of T){if("@default"===v)continue;const y=S[v];let w=O[v];w?"@graph"in w||(w["@graph"]=[]):O[v]=w={"@id":v,"@graph":[]};const M=w["@graph"];for(const j of Object.keys(y).sort()){const I=y[j];V.isSubjectReference(I)||M.push(I)}}return O}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(K,Ae,he){"use strict";const q=K("./documentLoaders/xhr"),V={};Ae.exports=V,V.setupDocumentLoaders=function(L){"undefined"!=typeof XMLHttpRequest&&(L.documentLoaders.xhr=q,L.useDocumentLoader("xhr"))},V.setupGlobals=function(L){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:L.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(K,Ae,he){"use strict";const{createNodeMap:q}=K("./nodeMap"),{isKeyword:V}=K("./context"),L=K("./graphTypes"),re=K("canonicalize"),$=K("./types"),b=K("./util"),{RDF_FIRST:S,RDF_REST:O,RDF_NIL:T,RDF_TYPE:v,RDF_JSON_LITERAL:y,RDF_LANGSTRING:w,XSD_BOOLEAN:M,XSD_DOUBLE:j,XSD_INTEGER:I,XSD_STRING:H}=K("./constants"),{isAbsolute:Y}=K("./url"),D={};function F(U,ie,ue,ee,se){const Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me],ye=Object.keys(te).sort();for(let De of ye){const Ve=te[De];if("@type"===De)De=v;else if(V(De))continue;for(const nt of Ve){const Ze={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!Y(me))continue;const Je={termType:De.startsWith("_:")?"BlankNode":"NamedNode",value:De};if(!Y(De)||"BlankNode"===Je.termType&&!se.produceGeneralizedRdf)continue;const Ye=E(nt,ee,U,ue,se.rdfDirection);Ye&&U.push({subject:Ze,predicate:Je,object:Ye,graph:ue})}}}}function E(U,ie,ue,ee,se){const Te={};if(L.isValue(U)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=U["@value"];const te=U["@type"]||null;"@json"===te?(Te.value=re(me),Te.datatype.value=y):$.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=te||M):$.isDouble(me)||te===j?($.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=te||j):$.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=te||I):"i18n-datatype"===se&&"@direction"in U?(Te.datatype.value="https://www.w3.org/ns/i18n#"+(U["@language"]||"")+`_${U["@direction"]}`,Te.value=me):"@language"in U?(Te.value=me,Te.datatype.value=te||w,Te.language=U["@language"]):(Te.value=me,Te.datatype.value=te||H)}else if(L.isList(U)){const me=function(U,ie,ue,ee,se){const Te={termType:"NamedNode",value:S},me={termType:"NamedNode",value:O},te={termType:"NamedNode",value:T},ye=U.pop(),De=ye?{termType:"BlankNode",value:ie.getId()}:te;let Ve=De;for(const nt of U){const Ze=E(nt,ie,ue,ee,se),Je={termType:"BlankNode",value:ie.getId()};ue.push({subject:Ve,predicate:Te,object:Ze,graph:ee}),ue.push({subject:Ve,predicate:me,object:Je,graph:ee}),Ve=Je}if(ye){const nt=E(ye,ie,ue,ee,se);ue.push({subject:Ve,predicate:Te,object:nt,graph:ee}),ue.push({subject:Ve,predicate:me,object:te,graph:ee})}return De}(U["@list"],ie,ue,ee,se);Te.termType=me.termType,Te.value=me.value}else{const me=$.isObject(U)?U["@id"]:U;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||Y(Te.value)?Te:null}Ae.exports=D,D.toRDF=(U,ie)=>{const ue=new b.IdentifierIssuer("_:b"),ee={"@default":{}};q(U,ee,"@default",ue);const se=[],Te=Object.keys(ee).sort();for(const me of Te){let te;if("@default"===me)te={termType:"DefaultGraph",value:""};else{if(!Y(me))continue;te=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},te.value=me}F(se,ee[me],te,ue,ie)}return se}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(K,Ae,he){"use strict";const q={};Ae.exports=q,q.isArray=Array.isArray,q.isBoolean=V=>"boolean"==typeof V||"[object Boolean]"===Object.prototype.toString.call(V),q.isDouble=V=>q.isNumber(V)&&(-1!==String(V).indexOf(".")||Math.abs(V)>=1e21),q.isEmptyObject=V=>q.isObject(V)&&0===Object.keys(V).length,q.isNumber=V=>"number"==typeof V||"[object Number]"===Object.prototype.toString.call(V),q.isNumeric=V=>!isNaN(parseFloat(V))&&isFinite(V),q.isObject=V=>"[object Object]"===Object.prototype.toString.call(V),q.isString=V=>"string"==typeof V||"[object String]"===Object.prototype.toString.call(V),q.isUndefined=V=>void 0===V},{}],31:[function(K,Ae,he){"use strict";const q=K("./types"),V={};Ae.exports=V,V.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},V.parse=(re,$)=>{const b={},S=V.parsers[$||"full"],O=S.regex.exec(re);let T=S.keys.length;for(;T--;)b[S.keys[T]]=void 0===O[T]?null:O[T];return("https"===b.scheme&&"443"===b.port||"http"===b.scheme&&"80"===b.port)&&(b.href=b.href.replace(":"+b.port,""),b.authority=b.authority.replace(":"+b.port,""),b.port=null),b.normalizedPath=V.removeDotSegments(b.path),b},V.prependBase=(re,$)=>{if(null===re||V.isAbsolute($))return $;(!re||q.isString(re))&&(re=V.parse(re||""));const b=V.parse($),S={protocol:re.protocol||""};if(null!==b.authority)S.authority=b.authority,S.path=b.path,S.query=b.query;else if(S.authority=re.authority,""===b.path)S.path=re.path,S.query=null!==b.query?b.query:re.query;else{if(0===b.path.indexOf("/"))S.path=b.path;else{let T=re.path;T=T.substr(0,T.lastIndexOf("/")+1),(T.length>0||re.authority)&&"/"!==T.substr(-1)&&(T+="/"),T+=b.path,S.path=T}S.query=b.query}""!==b.path&&(S.path=V.removeDotSegments(S.path));let O=S.protocol;return null!==S.authority&&(O+="//"+S.authority),O+=S.path,null!==S.query&&(O+="?"+S.query),null!==b.fragment&&(O+="#"+b.fragment),""===O&&(O="./"),O},V.removeBase=(re,$)=>{if(null===re)return $;(!re||q.isString(re))&&(re=V.parse(re||""));let b="";if(""!==re.href?b+=(re.protocol||"")+"//"+(re.authority||""):$.indexOf("//")&&(b+="//"),0!==$.indexOf(b))return $;const S=V.parse($.substr(b.length)),O=re.normalizedPath.split("/"),T=S.normalizedPath.split("/"),v=S.fragment||S.query?0:1;for(;O.length>0&&T.length>v&&O[0]===T[0];)O.shift(),T.shift();let y="";if(O.length>0){O.pop();for(let w=0;w{if(0===re.length)return"";const $=re.split("/"),b=[];for(;$.length>0;){const S=$.shift(),O=0===$.length;"."!==S?".."!==S?b.push(S):(b.pop(),O&&b.push("")):O&&b.push("")}return"/"===re[0]&&b.length>0&&""!==b[0]&&b.unshift(""),1===b.length&&""===b[0]?"/":b.join("/")};const L=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;V.isAbsolute=re=>q.isString(re)&&L.test(re),V.isRelative=re=>q.isString(re)},{"./types":30}],32:[function(K,Ae,he){"use strict";const q=K("./graphTypes"),V=K("./types"),L=K("rdf-canonize").IdentifierIssuer,re=K("./JsonLdError"),$=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,b=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,S=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,O_headers={accept:"application/ld+json, application/json"},T={};function v(y,w){if(V.isArray(w))for(let M=0;M{if(Object.keys(y).some(M=>"accept"===M.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+O_headers.accept+'" is supported.');return Object.assign({Accept:O_headers.accept},y)},T.parseLinkHeader=y=>{const w={},M=y.match($);for(let j=0;j{if(!(V.isString(y)||V.isArray(y)&&y.every(M=>V.isString(M)))){if(w&&V.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&T.asArray(y["@default"]).every(M=>V.isString(M)))return}throw new re('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:y})}},T.hasProperty=(y,w)=>{if(y.hasOwnProperty(w)){const M=y[w];return!V.isArray(M)||M.length>0}return!1},T.hasValue=(y,w,M)=>{if(T.hasProperty(y,w)){let j=y[w];const I=q.isList(j);if(V.isArray(j)||I){I&&(j=j["@list"]);for(let H=0;H{if("propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1),"valueIsArray"in j||(j.valueIsArray=!1),"allowDuplicate"in j||(j.allowDuplicate=!0),"prependValue"in j||(j.prependValue=!1),j.valueIsArray)y[w]=M;else if(V.isArray(M)){0===M.length&&j.propertyIsArray&&!y.hasOwnProperty(w)&&(y[w]=[]),j.prependValue&&(M=M.concat(y[w]),y[w]=[]);for(let I=0;I[].concat(y[w]||[]),T.removeProperty=(y,w)=>{delete y[w]},T.removeValue=(y,w,M,j)=>{"propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1);const I=T.getValues(y,w).filter(H=>!T.compareValues(H,M));0===I.length?T.removeProperty(y,w):y[w]=1!==I.length||j.propertyIsArray?I:I[0]},T.relabelBlankNodes=(y,w)=>v((w=w||{}).issuer||new L("_:b"),y),T.compareValues=(y,w)=>!!(y===w||q.isValue(y)&&q.isValue(w)&&y["@value"]===w["@value"]&&y["@type"]===w["@type"]&&y["@language"]===w["@language"]&&y["@index"]===w["@index"])||!!(V.isObject(y)&&"@id"in y&&V.isObject(w)&&"@id"in w)&&y["@id"]===w["@id"],T.compareShortestLeast=(y,w)=>y.length1;const j=(Q,E,U)=>{const ie=Q[v].get(E);if(ie){const ue=ie.value;if(I(Q,ue)){if(Y(Q,ie),!Q[$])return}else U&&(Q[y]&&(ie.value.now=Date.now()),Q[T].unshiftNode(ie));return ue.value}},I=(Q,E)=>{if(!E||!E.maxAge&&!Q[b])return!1;const U=Date.now()-E.now;return E.maxAge?U>E.maxAge:Q[b]&&U>Q[b]},H=Q=>{if(Q[L]>Q[V])for(let E=Q[T].tail;Q[L]>Q[V]&&null!==E;){const U=E.prev;Y(Q,E),E=U}},Y=(Q,E)=>{if(E){const U=E.value;Q[S]&&Q[S](U.key,U.value),Q[L]-=U.length,Q[v].delete(U.key),Q[T].removeNode(E)}};class D{constructor(E,U,ie,ue,ee){this.key=E,this.value=U,this.length=ie,this.now=ue,this.maxAge=ee||0}}const F=(Q,E,U,ie)=>{let ue=U.value;I(Q,ue)&&(Y(Q,U),Q[$]||(ue=void 0)),ue&&E.call(ie,ue.value,ue.key,Q)};Ae.exports=class{constructor(E){if("number"==typeof E&&(E={max:E}),E||(E={}),E.max&&("number"!=typeof E.max||E.max<0))throw new TypeError("max must be a non-negative number");this[V]=E.max||1/0;const ie=E.length||w;if(this[re]="function"!=typeof ie?w:ie,this[$]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[b]=E.maxAge||0,this[S]=E.dispose,this[O]=E.noDisposeOnSet||!1,this[y]=E.updateAgeOnGet||!1,this.reset()}set max(E){if("number"!=typeof E||E<0)throw new TypeError("max must be a non-negative number");this[V]=E||1/0,H(this)}get max(){return this[V]}set allowStale(E){this[$]=!!E}get allowStale(){return this[$]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[b]=E,H(this)}get maxAge(){return this[b]}set lengthCalculator(E){"function"!=typeof E&&(E=w),E!==this[re]&&(this[re]=E,this[L]=0,this[T].forEach(U=>{U.length=this[re](U.value,U.key),this[L]+=U.length})),H(this)}get lengthCalculator(){return this[re]}get length(){return this[L]}get itemCount(){return this[T].length}rforEach(E,U){U=U||this;for(let ie=this[T].tail;null!==ie;){const ue=ie.prev;F(this,E,ie,U),ie=ue}}forEach(E,U){U=U||this;for(let ie=this[T].head;null!==ie;){const ue=ie.next;F(this,E,ie,U),ie=ue}}keys(){return this[T].toArray().map(E=>E.key)}values(){return this[T].toArray().map(E=>E.value)}reset(){this[S]&&this[T]&&this[T].length&&this[T].forEach(E=>this[S](E.key,E.value)),this[v]=new Map,this[T]=new q,this[L]=0}dump(){return this[T].map(E=>!I(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[T]}set(E,U,ie){if((ie=ie||this[b])&&"number"!=typeof ie)throw new TypeError("maxAge must be a number");const ue=ie?Date.now():0,ee=this[re](U,E);if(this[v].has(E)){if(ee>this[V])return Y(this,this[v].get(E)),!1;const me=this[v].get(E).value;return this[S]&&(this[O]||this[S](E,me.value)),me.now=ue,me.maxAge=ie,me.value=U,this[L]+=ee-me.length,me.length=ee,this.get(E),H(this),!0}const se=new D(E,U,ee,ue,ie);return se.length>this[V]?(this[S]&&this[S](E,U),!1):(this[L]+=se.length,this[T].unshift(se),this[v].set(E,this[T].head),H(this),!0)}has(E){if(!this[v].has(E))return!1;const U=this[v].get(E).value;return!I(this,U)}get(E){return j(this,E,!0)}peek(E){return j(this,E,!1)}pop(){const E=this[T].tail;return E?(Y(this,E),E.value):null}del(E){Y(this,this[v].get(E))}load(E){this.reset();const U=Date.now();for(let ie=E.length-1;ie>=0;ie--){const ue=E[ie],ee=ue.e||0;if(0===ee)this.set(ue.k,ue.v);else{const se=ee-U;se>0&&this.set(ue.k,ue.v,se)}}}prune(){this[v].forEach((E,U)=>j(this,U,!1))}}},{yallist:92}],34:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;const q="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${V}decimal`,boolean:`${V}boolean`,double:`${V}double`,integer:`${V}integer`,string:`${V}string`},rdf:{type:`${q}type`,nil:`${q}nil`,first:`${q}first`,rest:`${q}rest`,langString:`${q}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${L}reify#forSome`,forAll:`${L}reify#forAll`},log:{implies:`${L}log#implies`}}},{}],35:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.termFromId=function D(te,ye){if(ye=ye||v,!te)return ye.defaultGraph();switch(te[0]){case"?":return ye.variable(te.substr(1));case"_":return ye.blankNode(te.substr(2));case'"':if(ye===v)return new j(te);if('"'===te[te.length-1])return ye.literal(te.substr(1,te.length-2));const De=te.lastIndexOf('"',te.length-1);return ye.literal(te.substr(1,De-1),"@"===te[De+1]?te.substr(De+2):ye.namedNode(te.substr(De+3)));case"<":const Ve=T.exec(te);return ye.quad(D(U(Ve[1]),ye),D(U(Ve[2]),ye),D(U(Ve[3]),ye),Ve[4]&&D(U(Ve[4]),ye));default:return ye.namedNode(te)}},he.termToId=function F(te){if("string"==typeof te)return te;if(te instanceof w&&"Quad"!==te.termType)return te.id;if(!te)return b.id;switch(te.termType){case"NamedNode":return te.value;case"BlankNode":return`_:${te.value}`;case"Variable":return`?${te.value}`;case"DefaultGraph":return"";case"Literal":return`"${te.value}"${te.language?`@${te.language}`:te.datatype&&te.datatype.value!==$.string?`^^${te.datatype.value}`:""}`;case"Quad":return`<<${E(F(te.subject))} ${E(F(te.predicate))} ${E(F(te.object))}${(0,V.isDefaultGraph)(te.graph)?"":` ${F(te.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${te.termType}`)}},he.escapeQuotes=E,he.unescapeQuotes=U,he.Triple=he.Quad=he.DefaultGraph=he.Variable=he.BlankNode=he.Literal=he.NamedNode=he.Term=he.default=void 0;var te,q=(te=K("./IRIs"))&&te.__esModule?te:{default:te},V=K("./N3Util");const{rdf:re,xsd:$}=q.default;let b,S=0;const O=/^"(.*".*)(?="[^"]*$)/,T=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,v={namedNode:function(te){return new M(te)},blankNode:function(te){return new I(te||"n3-"+S++)},variable:function(te){return new H(te)},literal:function(te,ye){if("string"==typeof ye)return new j(`"${te}"@${ye.toLowerCase()}`);let De=ye?ye.value:"";return""===De&&("boolean"==typeof te?De=$.boolean:"number"==typeof te&&(Number.isFinite(te)?De=Number.isInteger(te)?$.integer:$.double:(De=$.double,Number.isNaN(te)||(te=te>0?"INF":"-INF")))),new j(""===De||De===$.string?`"${te}"`:`"${te}"^^${De}`)},defaultGraph:function(){return b},quad:me,triple:me};he.default=v;class w{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof w?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=w;class M extends w{get termType(){return"NamedNode"}}he.NamedNode=M;class j extends w{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let De=ye.lastIndexOf('"')+1;return De`"${De.replace(/"/g,'""')}`)}function U(te){return te.replace(O,(ye,De)=>`"${De.replace(/""/g,'"')}`)}function me(te,ye,De,Ve){return new Q(te,ye,De,Ve)}he.Triple=he.Quad=Q},{"./IRIs":34,"./N3Util":41}],36:[function(K,Ae,he){(function(q){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var V=re(K("./IRIs")),L=re(K("queue-microtask"));function re(w){return w&&w.__esModule?w:{default:w}}const{xsd:$}=V.default,b=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,S={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},O=/[\x00-\x20<>\\"\{\}\|\^\`]/,T={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},v=/$0^/;he.default=class{constructor(M){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]*)?$/,this._lineMode=!!(M=M||{}).lineMode){this._n3Mode=!1;for(const j in this)!(j in T)&&this[j]instanceof RegExp&&(this[j]=v)}else this._n3Mode=!1!==M.n3;this._comments=!!M.comments,this._literalClosingPos=0}_tokenizeToEnd(M,j){let I=this._input;const H=this._comments;for(;;){let D,F;for(;D=this._newline.exec(I);)H&&(F=this._comment.exec(D[0]))&&M(null,{line:this._line,type:"comment",value:F[1],prefix:""}),I=I.substr(D[0].length,I.length),this._line++;if(!D&&(D=this._whitespace.exec(I))&&(I=I.substr(D[0].length,I.length)),this._endOfFile.test(I))return j&&(H&&(F=this._comment.exec(I))&&M(null,{line:this._line,type:"comment",value:F[1],prefix:""}),M(I=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=I;const Q=this._line,E=I[0];let U="",ie="",ue="",ee=null,se=0,Te=!1;switch(E){case"^":if(I.length<3)break;if("^"!==I[1]){this._n3Mode&&(se=1,U="^");break}if(this._previousMarker="^^",I=I.substr(2),"<"!==I[0]){Te=!0;break}case"<":if(ee=this._unescapedIri.exec(I))U="IRI",ie=ee[1];else if(ee=this._iri.exec(I)){if(ie=this._unescape(ee[1]),null===ie||O.test(ie))return Y(this);U="IRI"}else I.length>1&&"<"===I[1]?(U="<<",se=2):this._n3Mode&&I.length>1&&"="===I[1]&&(U="inverse",se=2,ie=">");break;case">":I.length>1&&">"===I[1]&&(U=">>",se=2);break;case"_":((ee=this._blank.exec(I))||j&&(ee=this._blank.exec(`${I} `)))&&(U="blank",ue="_",ie=ee[1]);break;case'"':if(ee=this._simpleQuotedString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return Y(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(ee=this._simpleApostropheString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return Y(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(ee=this._variable.exec(I))&&(U="var",ie=ee[0]);break;case"@":"literal"===this._previousMarker&&(ee=this._langcode.exec(I))?(U="langcode",ie=ee[1]):(ee=this._keyword.exec(I))&&(U=ee[0]);break;case".":if(1===I.length?j:I[1]<"0"||I[1]>"9"){U=".",se=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(ee=this._number.exec(I)||j&&(ee=this._number.exec(`${I} `)))&&(U="literal",ie=ee[0],ue="string"==typeof ee[1]?$.double:"string"==typeof ee[2]?$.decimal:$.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(ee=this._sparqlKeyword.exec(I))?U=ee[0].toUpperCase():Te=!0;break;case"f":case"t":(ee=this._boolean.exec(I))?(U="literal",ie=ee[0],ue=$.boolean):Te=!0;break;case"a":(ee=this._shortPredicates.exec(I))?(U="abbreviation",ie="a"):Te=!0;break;case"=":this._n3Mode&&I.length>1&&(U="abbreviation",">"!==I[1]?(se=1,ie="="):(se=2,ie=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(se=1,U=E);break;default:Te=!0}if(Te&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(ee=this._prefix.exec(I))?((ee=this._prefixed.exec(I))||j&&(ee=this._prefixed.exec(`${I} `)))&&(U="prefixed",ue=ee[1]||"",ie=this._unescape(ee[2])):(U="prefix",ie=ee[1]||"")),"^^"===this._previousMarker)switch(U){case"prefixed":U="type";break;case"IRI":U="typeIRI";break;default:U=""}if(!U)return j||!/^'''|^"""/.test(I)&&/\n|\r/.test(I)?Y(this):this._input=I;const me={line:Q,type:U,value:ie,prefix:ue};M(null,me),this.previousToken=me,this._previousMarker=U,I=I.substr(se||ee[0].length,I.length)}function Y(D){M(D._syntaxError(/^\S*/.exec(I)[0]))}}_unescape(M){let j=!1;const I=M.replace(b,(H,Y,D,F)=>{if("string"==typeof Y)return String.fromCharCode(Number.parseInt(Y,16));if("string"==typeof D){let Q=Number.parseInt(D,16);return Q<=65535?String.fromCharCode(Number.parseInt(D,16)):String.fromCharCode(55296+((Q-=65536)>>10),56320+(1023&Q))}return F in S?S[F]:(j=!0,"")});return j?null:I}_parseLiteral(M){if(M.length>=3){const j=M.match(/^(?:"""|"|'''|'|)/)[0],I=j.length;let H=Math.max(this._literalClosingPos,I);for(;(H=M.indexOf(j,H))>0;){let Y=0;for(;"\\"===M[H-Y-1];)Y++;if(Y%2==0){const D=M.substring(I,H),F=D.split(/\r\n|\r|\n/).length-1,Q=H+I;if(1===I&&0!==F||3===I&&this._lineMode)break;return this._line+=F,{value:this._unescape(D),matchLength:Q}}H++}this._literalClosingPos=M.length-I+1}return{value:"",matchLength:0}}_syntaxError(M){this._input=null;const j=new Error(`Unexpected "${M}" on line ${this._line}.`);return j.context={token:void 0,line:this._line,previousToken:this.previousToken},j}_readStartingBom(M){return M.startsWith("\ufeff")?M.substr(1):M}tokenize(M,j){if(this._line=1,"string"==typeof M){if(this._input=this._readStartingBom(M),"function"!=typeof j){const I=[];let H;if(this._tokenizeToEnd((Y,D)=>Y?H=Y:I.push(D),!0),H)throw H;return I}(0,L.default)(()=>this._tokenizeToEnd(j,!0))}else this._pendingBuffer=null,"function"==typeof M.setEncoding&&M.setEncoding("utf8"),M.on("data",I=>{null!==this._input&&0!==I.length&&(this._pendingBuffer&&(I=q.concat([this._pendingBuffer,I]),this._pendingBuffer=null),128&I[I.length-1]?this._pendingBuffer=I:(void 0===this._input?this._input=this._readStartingBom("string"==typeof I?I:I.toString()):this._input+=I,this._tokenizeToEnd(j,!1)))}),M.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(j,!0)}),M.on("error",j)}}}).call(this)}).call(this,K("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var q=re(K("./N3Lexer")),V=re(K("./N3DataFactory")),L=re(K("./IRIs"));function re(T){return T&&T.__esModule?T:{default:T}}let $=0;class b{constructor(v){this._contextStack=[],this._graph=null,this._setBase((v=v||{}).baseIRI),v.factory&&O(this,v.factory);const y="string"==typeof v.format?v.format.match(/\w*$/)[0].toLowerCase():"",w=/turtle/.test(y),M=/trig/.test(y),j=/triple/.test(y),I=/quad/.test(y),H=this._n3Mode=/n3/.test(y),Y=j||I;(this._supportsNamedGraphs=!(w||H))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(w||M||j||H),this._supportsRDFStar=""===y||/star|\*$/.test(y),Y&&(this._resolveRelativeIRI=D=>null),this._blankNodePrefix="string"!=typeof v.blankNodePrefix?"":v.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=v.lexer||new q.default({lineMode:Y,n3:H}),this._explicitQuantifiers=!!v.explicitQuantifiers}static _resetBlankNodePrefix(){$=0}_setBase(v){if(v){const y=v.indexOf("#");y>=0&&(v=v.substr(0,y)),this._base=v,this._basePath=v.indexOf("/")<0?v:v.replace(/[^\/?]*(?:\?.*)?$/,""),v=v.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=v[0],this._baseScheme=v[1]}else this._base="",this._basePath=""}_saveContext(v,y,w,M,j){const I=this._n3Mode;this._contextStack.push({subject:w,predicate:M,object:j,graph:y,type:v,inverse:!!I&&this._inversePredicate,blankPrefix:I?this._prefixes._:"",quantified:I?this._quantified:null}),I&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const v=this._contextStack.pop(),y=this._n3Mode;this._subject=v.subject,this._predicate=v.predicate,this._object=v.object,this._graph=v.graph,y&&(this._inversePredicate=v.inverse,this._prefixes._=v.blankPrefix,this._quantified=v.quantified)}_readInTopContext(v){switch(v.type){case"eof":return null!==this._graph?this._error("Unclosed graph",v):(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(v)}}_readEntity(v,y){let w;switch(v.type){case"IRI":case"typeIRI":const M=this._resolveIRI(v.value);if(null===M)return this._error("Invalid IRI",v);w=this._namedNode(M);break;case"type":case"prefixed":const j=this._prefixes[v.prefix];if(void 0===j)return this._error(`Undefined prefix "${v.prefix}:"`,v);w=this._namedNode(j+v.value);break;case"blank":w=this._blankNode(this._prefixes[v.prefix]+v.value);break;case"var":w=this._variable(v.value.substr(1));break;default:return this._error(`Expected entity but got ${v.type}`,v)}return!y&&this._n3Mode&&w.id in this._quantified&&(w=this._quantified[w.id]),w}_readSubject(v){switch(this._predicate=null,v.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",v);case"}":return this._readPunctuation(v);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',v);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',v);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",v);if(0===v.prefix.length)return this._literalValue=v.value,this._completeSubjectLiteral;this._subject=this._literal(v.value,this._namedNode(v.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._subject=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(v){const y=v.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[v.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,v):(this._subject=null,"]"===y?this._readBlankNodeTail(v):this._readPunctuation(v));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",v);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",v);default:if(void 0===(this._predicate=this._readEntity(v)))return}return this._readObject}_readObject(v){switch(v.type){case"literal":if(0===v.prefix.length)return this._literalValue=v.value,this._readDataTypeOrLang;this._object=this._literal(v.value,this._namedNode(v.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._object=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(v){return"{"===v.type?this._readGraph(v):this._readPredicate(v)}_readGraph(v){return"{"!==v.type?this._error(`Expected graph but got ${v.type}`,v):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(v){return"]"===v.type?(this._subject=null,this._readBlankNodeTail(v)):(this._predicate=null,this._readPredicate(v))}_readBlankNodeTail(v){if("]"!==v.type)return this._readBlankNodePunctuation(v);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null===this._object?y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(v){switch(v.type){case".":case"}":return this._subject=null,this._readPunctuation(v);default:return this._readPredicate(v)}}_readListItem(v){let y=null,w=null,M=this._readListItem;const j=this._subject,I=this._contextStack,H=I[I.length-1];switch(v.type){case"[":this._saveContext("blank",this._graph,w=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),M=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,w=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==I.length&&"list"===I[I.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(M=this._readPredicate,this._subject===this.RDF_NIL)return M}else if(M=this._getContextEndReader(),this._object===this.RDF_NIL)return M;w=this.RDF_NIL;break;case"literal":0===v.prefix.length?(this._literalValue=v.value,M=this._readListItemDataTypeOrLang):(y=this._literal(v.value,this._namedNode(v.prefix)),M=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);default:if(void 0===(y=this._readEntity(v)))return}if(null===w&&(this._subject=w=this._blankNode()),null===j?null===H.predicate?H.subject=w:H.object=w:this._emit(j,this.RDF_REST,w,this._graph),null!==y){if(this._n3Mode&&("IRI"===v.type||"prefixed"===v.type))return this._saveContext("item",this._graph,w,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(w,this.RDF_FIRST,y,this._graph)}return M}_readDataTypeOrLang(v){return this._completeObjectLiteral(v,!1)}_readListItemDataTypeOrLang(v){return this._completeObjectLiteral(v,!0)}_completeLiteral(v){let y=this._literal(this._literalValue);switch(v.type){case"type":case"typeIRI":const w=this._readEntity(v);if(void 0===w)return;y=this._literal(this._literalValue,w),v=null;break;case"langcode":y=this._literal(this._literalValue,v.value),v=null}return{token:v,literal:y}}_completeSubjectLiteral(v){return this._subject=this._completeLiteral(v).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(v,y){const w=this._completeLiteral(v);if(w)return this._object=w.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===w.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(w.token))}_readFormulaTail(v){return"}"!==v.type?this._readPunctuation(v):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(v){let y,w=this._graph;const M=this._subject,j=this._inversePredicate;switch(v.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",v);if(this._n3Mode)return this._readFormulaTail(v);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,j&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(w=this._readEntity(v))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}if(null!==M){const I=this._predicate,H=this._object;j?this._emit(H,I,M,w):this._emit(M,I,H,w)}return y}_readBlankNodePunctuation(v){let y;switch(v.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(v){return"."!==v.type?this._error("Expected dot to follow quad",v):this._readInTopContext}_readPrefix(v){return"prefix"!==v.type?this._error("Expected prefix to follow @prefix",v):(this._prefix=v.value,this._readPrefixIRI)}_readPrefixIRI(v){if("IRI"!==v.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,v);const y=this._readEntity(v);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(v){const y="IRI"===v.type&&this._resolveIRI(v.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",v)}_readNamedGraphLabel(v){switch(v.type){case"IRI":case"blank":case"prefixed":return this._readSubject(v),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",v)}}_readNamedGraphBlankLabel(v){return"]"!==v.type?this._error("Invalid graph label",v):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(v){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(v)):"."!==v.type?this._error("Expected declaration to end with a dot",v):this._readInTopContext}_readQuantifierList(v){let y;switch(v.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(v,!0)))break;default:return this._error(`Unexpected ${v.type}`,v)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,y,this.QUANTIFIERS_GRAPH)):this._quantified[y.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(v){return","===v.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(v))}_getPathReader(v){return this._afterPath=v,this._readPath}_readPath(v){switch(v.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,w=y.length&&y[y.length-1];if(w&&"item"===w.type){const M=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,M,this._graph)}return this._afterPath(v)}}_readForwardPath(v){let y,w;const M=this._blankNode();if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(y=this._subject,this._subject=M):(y=this._object,this._object=M),this._emit(y,w,M,this._graph),this._readPath}_readBackwardPath(v){const y=this._blankNode();let w,M;if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(M=this._subject,this._subject=y):(M=this._object,this._object=y),this._emit(y,w,M,this._graph),this._readPath}_readRDFStarTailOrGraph(v){return">>"!==v.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(v))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,v):this._readRDFStarTail(v)}_readRDFStarTail(v){if(">>"!==v.type)return this._error(`Expected >> but got ${v.type}`,v);const y=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=y,this._readPredicate):(this._object=y,this._getContextEndReader())}_getContextEndReader(){const v=this._contextStack;if(!v.length)return this._readPunctuation;switch(v[v.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(v,y,w,M){this._callback(null,this._quad(v,y,w,M||this.DEFAULTGRAPH))}_error(v,y){const w=new Error(`${v} on line ${y.line}.`);w.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(w),this._callback=S}_resolveIRI(v){return/^[a-z][a-z0-9+.-]*:/i.test(v)?v:this._resolveRelativeIRI(v)}_resolveRelativeIRI(v){if(!v.length)return this._base;switch(v[0]){case"#":return this._base+v;case"?":return this._base.replace(/(?:\?.*)?$/,v);case"/":return("/"===v[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(v);default:return/^[^/:]*:/.test(v)?null:this._removeDotSegments(this._basePath+v)}}_removeDotSegments(v){if(!/(^|\/)\.\.?($|[/#?])/.test(v))return v;const y=v.length;let w="",M=-1,j=-1,I=0,H="/";for(;M=j&&(w=w.substr(0,I)),"/"!==H)return`${w}/${v.substr(M+1)}`;I=M+1}}}H=v[++M]}return w+v.substring(I)}parse(v,y,w){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${$++}_`,this._prefixCallback=w||S,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const M=[];let j;if(this._callback=(I,H)=>{I?j=I:H&&M.push(H)},this._lexer.tokenize(v).every(I=>this._readCallback=this._readCallback(I)),j)throw j;return M}this._callback=y,this._lexer.tokenize(v,(M,j)=>{null!==M?(this._callback(M),this._callback=S):this._readCallback&&(this._readCallback=this._readCallback(j))})}}function S(){}function O(T,v){const y=v.namedNode;T._namedNode=y,T._blankNode=v.blankNode,T._literal=v.literal,T._variable=v.variable,T._quad=v.quad,T.DEFAULTGRAPH=v.defaultGraph(),T.RDF_FIRST=y(L.default.rdf.first),T.RDF_REST=y(L.default.rdf.rest),T.RDF_NIL=y(L.default.rdf.nil),T.N3_FORALL=y(L.default.r.forAll),T.N3_FORSOME=y(L.default.r.forSome),T.ABBREVIATIONS={a:y(L.default.rdf.type),"=":y(L.default.owl.sameAs),">":y(L.default.log.implies)},T.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=b,O(b.prototype,V.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var v,q=function(v,y){if(!y&&v&&v.__esModule)return v;if(null===v||"object"!=typeof v&&"function"!=typeof v)return{default:v};var w=$(y);if(w&&w.has(v))return w.get(v);var M={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in v)if("default"!==I&&Object.prototype.hasOwnProperty.call(v,I)){var H=j?Object.getOwnPropertyDescriptor(v,I):null;H&&(H.get||H.set)?Object.defineProperty(M,I,H):M[I]=v[I]}return M.default=v,w&&w.set(v,M),M}(K("./N3DataFactory")),V=K("readable-stream"),L=(v=K("./IRIs"))&&v.__esModule?v:{default:v};function $(v){if("function"!=typeof WeakMap)return null;var y=new WeakMap,w=new WeakMap;return($=function(M){return M?w:y})(v)}class S{constructor(y,w){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!w&&y&&!y[0]&&(w=y,y=null),this._factory=(w=w||{}).factory||q.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const w=this._graphs;let M,j;for(const I in w)for(const H in M=w[I].subjects)for(const Y in j=M[H])y+=Object.keys(j[Y]).length;return this._size=y}_addToIndex(y,w,M,j){const I=y[w]||(y[w]={}),H=I[M]||(I[M]={}),Y=j in H;return Y||(H[j]=null),!Y}_removeFromIndex(y,w,M,j){const I=y[w],H=I[M];delete H[j];for(const Y in H)return;delete I[M];for(const Y in I)return;delete y[w]}_findInIndex(y,w,M,j,I,H,Y,D,F,Q){let E,U,ie;const ee=!w+!M+!j>1?Object.keys(this._ids):this._entities;w&&((E=y,y={})[w]=E[w]);for(const se in y){const Te=ee[se];if(U=y[se]){M&&((E=U,U={})[M]=E[M]);for(const me in U){const te=ee[me];if(ie=U[me]){const ye=j?j in ie?[j]:[]:Object.keys(ie);for(let De=0;De{M in w||(w[M]=!0,y((0,q.termFromId)(this._entities[M],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,w,M,j){w||(j=y.graph,M=y.object,w=y.predicate,y=y.subject),y=(0,q.termToId)(y),w=(0,q.termToId)(w),M=(0,q.termToId)(M),j=(0,q.termToId)(j);let I=this._graphs[j];I||(I=this._graphs[j]={subjects:{},predicates:{},objects:{}},Object.freeze(I));const H=this._ids,Y=this._entities;y=H[y]||(H[Y[++this._id]=y]=this._id),w=H[w]||(H[Y[++this._id]=w]=this._id),M=H[M]||(H[Y[++this._id]=M]=this._id);const D=this._addToIndex(I.subjects,y,w,M);return this._addToIndex(I.predicates,w,M,y),this._addToIndex(I.objects,M,y,w),this._size=null,D}addQuads(y){for(let w=0;w{this.addQuad(w)}),y}removeQuad(y,w,M,j){w||(j=y.graph,M=y.object,w=y.predicate,y=y.subject),y=(0,q.termToId)(y),w=(0,q.termToId)(w),M=(0,q.termToId)(M),j=(0,q.termToId)(j);const I=this._ids,H=this._graphs;let Y,D,F;if(!((y=I[y])&&(w=I[w])&&(M=I[M])&&(Y=H[j])&&(D=Y.subjects[y])&&(F=D[w])&&M in F))return!1;for(y in this._removeFromIndex(Y.subjects,y,w,M),this._removeFromIndex(Y.predicates,w,M,y),this._removeFromIndex(Y.objects,M,y,w),null!==this._size&&this._size--,Y.subjects)return!0;return delete H[j],!0}removeQuads(y){for(let w=0;w{this.removeQuad(w)}),y}removeMatches(y,w,M,j){const I=new V.Readable({objectMode:!0});return I._read=()=>{for(const H of this.getQuads(y,w,M,j))I.push(H);I.push(null)},this.remove(I)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,w,M,j){y=y&&(0,q.termToId)(y),w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=[],H=this._getGraphs(j),Y=this._ids;let D,F,Q,E;if(O(y)&&!(F=Y[y])||O(w)&&!(Q=Y[w])||O(M)&&!(E=Y[M]))return I;for(const U in H)(D=H[U])&&(F?E?this._findInIndex(D.objects,E,F,Q,"object","subject","predicate",U,null,I):this._findInIndex(D.subjects,F,Q,null,"subject","predicate","object",U,null,I):Q?this._findInIndex(D.predicates,Q,E,null,"predicate","object","subject",U,null,I):E?this._findInIndex(D.objects,E,null,null,"object","subject","predicate",U,null,I):this._findInIndex(D.subjects,null,null,null,"subject","predicate","object",U,null,I));return I}match(y,w,M,j){return new T(this,y,w,M,j)}countQuads(y,w,M,j){y=y&&(0,q.termToId)(y),w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._getGraphs(j),H=this._ids;let D,F,Q,E,Y=0;if(O(y)&&!(F=H[y])||O(w)&&!(Q=H[w])||O(M)&&!(E=H[M]))return 0;for(const U in I)(D=I[U])&&(Y+=y?M?this._countInIndex(D.objects,E,F,Q):this._countInIndex(D.subjects,F,Q,E):w?this._countInIndex(D.predicates,Q,E,F):this._countInIndex(D.objects,E,F,Q));return Y}forEach(y,w,M,j,I){this.some(H=>(y(H),!1),w,M,j,I)}every(y,w,M,j,I){let H=!1;const Y=!this.some(D=>(H=!0,!y(D)),w,M,j,I);return H&&Y}some(y,w,M,j,I){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j),I=I&&(0,q.termToId)(I);const H=this._getGraphs(I),Y=this._ids;let D,F,Q,E;if(O(w)&&!(F=Y[w])||O(M)&&!(Q=Y[M])||O(j)&&!(E=Y[j]))return!1;for(const U in H)if(D=H[U])if(F){if(E){if(this._findInIndex(D.objects,E,F,Q,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(D.subjects,F,Q,null,"subject","predicate","object",U,y,null))return!0}else if(Q){if(this._findInIndex(D.predicates,Q,E,null,"predicate","object","subject",U,y,null))return!0}else if(E){if(this._findInIndex(D.objects,E,null,null,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(D.subjects,null,null,null,"subject","predicate","object",U,y,null))return!0;return!1}getSubjects(y,w,M){const j=[];return this.forSubjects(I=>{j.push(I)},y,w,M),j}forSubjects(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.predicates,D,F,y):this._loopByKey1(Y.subjects,D,y):F?this._loopByKey0(Y.objects,F,y):this._loop(Y.subjects,y))}getPredicates(y,w,M){const j=[];return this.forPredicates(I=>{j.push(I)},y,w,M),j}forPredicates(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.objects,F,D,y):this._loopByKey0(Y.subjects,D,y):F?this._loopByKey1(Y.predicates,F,y):this._loop(Y.predicates,y))}getObjects(y,w,M){const j=[];return this.forObjects(I=>{j.push(I)},y,w,M),j}forObjects(y,w,M,j){w=w&&(0,q.termToId)(w),M=M&&(0,q.termToId)(M),j=j&&(0,q.termToId)(j);const I=this._ids,H=this._getGraphs(j);let Y,D,F;if(y=this._uniqueEntities(y),!(O(w)&&!(D=I[w])||O(M)&&!(F=I[M])))for(j in H)(Y=H[j])&&(D?F?this._loopBy2Keys(Y.subjects,D,F,y):this._loopByKey1(Y.objects,D,y):F?this._loopByKey0(Y.predicates,F,y):this._loop(Y.objects,y))}getGraphs(y,w,M){const j=[];return this.forGraphs(I=>{j.push(I)},y,w,M),j}forGraphs(y,w,M,j){for(const I in this._graphs)this.some(H=>(y(H.graph),!0),w,M,j,I)}createBlankNode(y){let w,M;if(y)for(w=y=`_:${y}`,M=1;this._ids[w];)w=y+M++;else do{w="_:b"+this._blankNodeIndex++}while(this._ids[w]);return this._ids[w]=++this._id,this._entities[this._id]=w,this._factory.blankNode(w.substr(2))}extractLists({remove:y=!1,ignoreErrors:w=!1}={}){const M={},j=w?()=>!0:(Y,D)=>{throw new Error(`${Y.value} ${D}`)},I=this.getQuads(null,L.default.rdf.rest,L.default.rdf.nil,null),H=y?[...I]:[];return I.forEach(Y=>{const D=[];let Q,E,F=!1;const U=Y.graph;let ie=Y.subject;for(;ie&&!F;){const ue=this.getQuads(null,null,ie,null),ee=this.getQuads(ie,null,null,null);let se,Te=null,me=null,te=null;for(let ye=0;ye{switch(v){case"data":O=y;break;case"end":T=y}}},(v,y)=>{v&&this.emit("error",v)||y&&this.push(y)},(v,y)=>{this.emit("prefix",v,y)}),this._transform=(v,y,w)=>{O(v),w()},this._flush=v=>{T(),v()}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var $,q=K("readable-stream"),V=($=K("./N3Writer"))&&$.__esModule?$:{default:$};he.default=class extends q.Transform{constructor(b){super({encoding:"utf8",writableObjectMode:!0});const S=this._writer=new V.default({write:(O,T,v)=>{this.push(O),v&&v()},end:O=>{this.push(null),O&&O()}},b);this._transform=(O,T,v)=>{S.addQuad(O,v)},this._flush=O=>{S.end(O)}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),b.on("prefix",(S,O)=>{this._writer.addPrefix(S,O)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.isDefaultGraph=S,he.inDefaultGraph=function(y){return S(y.graph)},he.prefix=function(y,w){return v({"":y},w)("")},he.prefixes=v;var y,q=(y=K("./N3DataFactory"))&&y.__esModule?y:{default:y};function S(y){return!!y&&"DefaultGraph"===y.termType}function v(y,w){const M=Object.create(null);for(const I in y)j(I,y[I]);function j(I,H){if("string"==typeof H){const Y=Object.create(null);M[I]=D=>Y[D]||(Y[D]=w.namedNode(H+D))}else if(!(I in M))throw new Error(`Unknown prefix: ${I}`);return M[I]}return w=w||q.default,j}},{"./N3DataFactory":35}],42:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,q=(H=K("./IRIs"))&&H.__esModule?H:{default:H},V=function(H,Y){if(!Y&&H&&H.__esModule)return H;if(null===H||"object"!=typeof H&&"function"!=typeof H)return{default:H};var D=re(Y);if(D&&D.has(H))return D.get(H);var F={},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in H)if("default"!==E&&Object.prototype.hasOwnProperty.call(H,E)){var U=Q?Object.getOwnPropertyDescriptor(H,E):null;U&&(U.get||U.set)?Object.defineProperty(F,E,U):F[E]=H[E]}return F.default=H,D&&D.set(H,F),F}(K("./N3DataFactory")),L=K("./N3Util");function re(H){if("function"!=typeof WeakMap)return null;var Y=new WeakMap,D=new WeakMap;return(re=function(F){return F?D:Y})(H)}const S=V.default.defaultGraph(),{rdf:O,xsd:T}=q.default,v=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,w={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class M extends V.Term{equals(){return!1}}function I(H){let Y=w[H];return void 0===Y&&(1===H.length?(Y=H.charCodeAt(0).toString(16),Y="\\u0000".substr(0,6-Y.length)+Y):(Y=(1024*(H.charCodeAt(0)-55296)+H.charCodeAt(1)+9216).toString(16),Y="\\U00000000".substr(0,10-Y.length)+Y)),Y}he.default=class{constructor(Y,D){if(this._prefixRegex=/$0^/,Y&&"function"!=typeof Y.write&&(D=Y,Y=null),this._lists=(D=D||{}).lists,Y)this._outputStream=Y,this._endStream=void 0===D.end||!!D.end;else{let F="";this._outputStream={write(Q,E,U){F+=Q,U&&U()},end:Q=>{Q&&Q(null,F)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(D.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=S,this._baseIRI=D.baseIRI,this._prefixIRIs=Object.create(null),D.prefixes&&this.addPrefixes(D.prefixes))}get _inDefaultGraph(){return S.equals(this._graph)}_write(Y,D){this._outputStream.write(Y,"utf8",D)}_writeQuad(Y,D,F,Q,E){try{Q.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(S.equals(Q)?"":`${this._encodeIriOrBlank(Q)} {\n`)),this._graph=Q,this._subject=null),Y.equals(this._subject)?D.equals(this._predicate)?this._write(`, ${this._encodeObject(F)}`,E):this._write(`;\n ${this._encodePredicate(this._predicate=D)} ${this._encodeObject(F)}`,E):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=Y)} ${this._encodePredicate(this._predicate=D)} ${this._encodeObject(F)}`,E)}catch(U){E&&E(U)}}_writeQuadLine(Y,D,F,Q,E){delete this._prefixMatch,this._write(this.quadToString(Y,D,F,Q),E)}quadToString(Y,D,F,Q){return`${this._encodeSubject(Y)} ${this._encodeIriOrBlank(D)} ${this._encodeObject(F)}${Q&&Q.value?` ${this._encodeIriOrBlank(Q)} .\n`:" .\n"}`}quadsToString(Y){return Y.map(D=>this.quadToString(D.subject,D.predicate,D.object,D.graph)).join("")}_encodeSubject(Y){return"Quad"===Y.termType?this._encodeQuad(Y):this._encodeIriOrBlank(Y)}_encodeIriOrBlank(Y){if("NamedNode"!==Y.termType)return this._lists&&Y.value in this._lists&&(Y=this.list(this._lists[Y.value])),"id"in Y?Y.id:`_:${Y.value}`;let D=Y.value;this._baseIRI&&D.startsWith(this._baseIRI)&&(D=D.substr(this._baseIRI.length)),v.test(D)&&(D=D.replace(y,I));const F=this._prefixRegex.exec(D);return F?F[1]?this._prefixIRIs[F[1]]+F[2]:D:`<${D}>`}_encodeLiteral(Y){let D=Y.value;if(v.test(D)&&(D=D.replace(y,I)),Y.language)return`"${D}"@${Y.language}`;if(this._lineMode){if(Y.datatype.value===T.string)return`"${D}"`}else switch(Y.datatype.value){case T.string:return`"${D}"`;case T.boolean:if("true"===D||"false"===D)return D;break;case T.integer:if(/^[+-]?\d+$/.test(D))return D;break;case T.decimal:if(/^[+-]?\d*\.\d+$/.test(D))return D;break;case T.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(D))return D}return`"${D}"^^${this._encodeIriOrBlank(Y.datatype)}`}_encodePredicate(Y){return Y.value===O.type?"a":this._encodeIriOrBlank(Y)}_encodeObject(Y){switch(Y.termType){case"Quad":return this._encodeQuad(Y);case"Literal":return this._encodeLiteral(Y);default:return this._encodeIriOrBlank(Y)}}_encodeQuad({subject:Y,predicate:D,object:F,graph:Q}){return`<<${this._encodeSubject(Y)} ${this._encodePredicate(D)} ${this._encodeObject(F)}${(0,L.isDefaultGraph)(Q)?"":` ${this._encodeIriOrBlank(Q)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(Y,D,F,Q,E){void 0===F?this._writeQuad(Y.subject,Y.predicate,Y.object,Y.graph,D):"function"==typeof Q?this._writeQuad(Y,D,F,S,Q):this._writeQuad(Y,D,F,Q||S,E)}addQuads(Y){for(let D=0;D.\n`)}if(F){let Q="",E="";for(const U in this._prefixIRIs)Q+=Q?`|${U}`:U,E+=(E?"|":"")+this._prefixIRIs[U];Q=Q.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${E})[^/]*$|^(${Q})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(F?"\n":"",D)}blank(Y,D){let Q,E,F=Y;switch(void 0===Y?F=[]:Y.termType?F=[{predicate:Y,object:D}]:"length"in Y||(F=[Y]),E=F.length){case 0:return new M("[]");case 1:if(Q=F[0],!(Q.object instanceof M))return new M(`[ ${this._encodePredicate(Q.predicate)} ${this._encodeObject(Q.object)} ]`);default:let U="[";for(let ie=0;ie{D=null,Y(F,Q)});if(this._endStream)try{return this._outputStream.end(D)}catch(F){}D&&D()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return O.Term}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return O.NamedNode}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return O.Literal}}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return O.BlankNode}}),Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return O.Variable}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return O.DefaultGraph}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return O.Quad}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return O.Triple}}),Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return O.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return O.termToId}}),he.Util=void 0;var q=y(K("./N3Lexer")),V=y(K("./N3Parser")),L=y(K("./N3Writer")),re=y(K("./N3Store")),$=y(K("./N3StreamParser")),b=y(K("./N3StreamWriter")),S=v(K("./N3Util"));he.Util=S;var O=v(K("./N3DataFactory"));function T(w){if("function"!=typeof WeakMap)return null;var M=new WeakMap,j=new WeakMap;return(T=function(I){return I?j:M})(w)}function v(w,M){if(!M&&w&&w.__esModule)return w;if(null===w||"object"!=typeof w&&"function"!=typeof w)return{default:w};var j=T(M);if(j&&j.has(w))return j.get(w);var I={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Y in w)if("default"!==Y&&Object.prototype.hasOwnProperty.call(w,Y)){var D=H?Object.getOwnPropertyDescriptor(w,Y):null;D&&(D.get||D.set)?Object.defineProperty(I,Y,D):I[Y]=w[Y]}return I.default=w,j&&j.set(w,I),I}function y(w){return w&&w.__esModule?w:{default:w}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(K,Ae,he){var V,L,q=Ae.exports={};function re(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function b(H){if(V===setTimeout)return setTimeout(H,0);if((V===re||!V)&&setTimeout)return V=setTimeout,setTimeout(H,0);try{return V(H,0)}catch(Y){try{return V.call(null,H,0)}catch(D){return V.call(this,H,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:re}catch(H){V=re}try{L="function"==typeof clearTimeout?clearTimeout:$}catch(H){L=$}}();var v,O=[],T=!1,y=-1;function w(){!T||!v||(T=!1,v.length?O=v.concat(O):y=-1,O.length&&M())}function M(){if(!T){var H=b(w);T=!0;for(var Y=O.length;Y;){for(v=O,O=[];++y1)for(var D=1;D(V||(V=Promise.resolve())).then(L).catch(re=>setTimeout(()=>{throw re},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(K,Ae,he){Ae.exports=K("./lib")},{"./lib":55}],47:[function(K,Ae,he){"use strict";Ae.exports=class I7{constructor(V,L=new Map,re=0){this.prefix=V,this._existing=L,this.counter=re}clone(){const{prefix:V,_existing:L,counter:re}=this;return new I7(V,new Map(L),re)}getId(V){const L=V&&this._existing.get(V);if(L)return L;const re=this.prefix+this.counter;return this.counter++,V&&this._existing.set(V,re),re}hasId(V){return this._existing.has(V)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(K,Ae,he){"use strict";K("setimmediate");const q=self.crypto||self.msCrypto;Ae.exports=class{constructor(L){if(!q||!q.subtle)throw new Error("crypto.subtle not found.");if("sha256"===L)this.algorithm={name:"SHA-256"};else{if("sha1"!==L)throw new Error(`Unsupport algorithm "${L}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(L){this._content+=L}digest(){var L=this;return gt(function*(){const re=(new TextEncoder).encode(L._content),$=new Uint8Array(yield q.subtle.digest(L.algorithm,re));let b="";for(let S=0;S<$.length;++S)b+=$[S].toString(16).padStart(2,"0");return b})()}}},{setimmediate:86}],49:[function(K,Ae,he){"use strict";const L="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",re="http://www.w3.org/2001/XMLSchema#string",$="NamedNode",b="BlankNode",S="Literal",O="DefaultGraph",T={};function v(I,H){return I.subject.termType===H.subject.termType&&I.object.termType===H.object.termType&&I.subject.value===H.subject.value&&I.predicate.value===H.predicate.value&&I.object.value===H.object.value&&(I.object.termType!==S||I.object.datatype.termType===H.object.datatype.termType&&I.object.language===H.object.language&&I.object.datatype.value===H.object.datatype.value)}T.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,T.empty=new RegExp("^[ \\t]*$"),T.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),Ae.exports=class SP{static parse(H){const Y=[],D={},F=H.split(T.eoln);let Q=0;for(const E of F){if(Q++,T.empty.test(E))continue;const U=E.match(T.quad);if(null===U)throw new Error("N-Quads parse error on line "+Q+".");const ie={subject:null,predicate:null,object:null,graph:null};if(ie.subject=void 0!==U[1]?{termType:$,value:U[1]}:{termType:b,value:U[2]},ie.predicate={termType:$,value:U[3]},void 0!==U[4]?ie.object={termType:$,value:U[4]}:void 0!==U[5]?ie.object={termType:b,value:U[5]}:(ie.object={termType:S,value:void 0,datatype:{termType:$}},void 0!==U[7]?ie.object.datatype.value=U[7]:void 0!==U[8]?(ie.object.datatype.value=L,ie.object.language=U[8]):ie.object.datatype.value=re,ie.object.value=U[6].replace(M,function(H,Y,D,F){if(Y)switch(Y){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(D)return String.fromCharCode(parseInt(D,16));if(F)throw new Error("Unsupported U escape")})),ie.graph=void 0!==U[9]?{termType:$,value:U[9]}:void 0!==U[10]?{termType:b,value:U[10]}:{termType:O,value:""},ie.graph.value in D){let ue=!0;const ee=D[ie.graph.value];for(const se of ee)if(v(se,ie)){ue=!1;break}ue&&(ee.push(ie),Y.push(ie))}else D[ie.graph.value]=[ie],Y.push(ie)}return Y}static serialize(H){Array.isArray(H)||(H=SP.legacyDatasetToQuads(H));const Y=[];for(const D of H)Y.push(SP.serializeQuad(D));return Y.sort().join("")}static serializeQuad(H){const Y=H.subject,F=H.object,Q=H.graph;let E="";return E+=Y.termType===$?`<${Y.value}>`:`${Y.value}`,E+=` <${H.predicate.value}> `,F.termType===$?E+=`<${F.value}>`:F.termType===b?E+=F.value:(E+=`"${I=F.value,I.replace(y,function(H){switch(H){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,F.datatype.value===L?F.language&&(E+=`@${F.language}`):F.datatype.value!==re&&(E+=`^^<${F.datatype.value}>`)),Q.termType===$?E+=` <${Q.value}>`:Q.termType===b&&(E+=` ${Q.value}`),E+=" .\n",E;var I}static legacyDatasetToQuads(H){const Y=[],D={"blank node":b,IRI:$,literal:S};for(const F in H)H[F].forEach(E=>{const U={};for(const ie in E){const ue=E[ie],ee={termType:D[ue.type],value:ue.value};ee.termType===S&&(ee.datatype={termType:$},"datatype"in ue&&(ee.datatype.value=ue.datatype),"language"in ue?("datatype"in ue||(ee.datatype.value=L),ee.language=ue.language):"datatype"in ue||(ee.datatype.value=re)),U[ie]=ee}U.graph="@default"===F?{termType:O,value:""}:{termType:F.startsWith("_:")?b:$,value:F},Y.push(U)});return Y}};const y=/["\\\n\r]/g;const M=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(K,Ae,he){"use strict";Ae.exports=class{constructor(V){this.current=V.sort(),this.done=!1,this.dir=new Map;for(let L=0;L$)&&(v&&O>0&&T>V[O-1]||!v&&OV[O+1])&&($=T,b=O)}if(null===$)this.done=!0;else{const O=L.get($)?b-1:b+1;V[b]=V[O],V[O]=$;for(const T of V)T>$&&L.set(T,!L.get(T))}return re}}},{}],51:[function(K,Ae,he){(function(q){(function(){"use strict";const V=K("./IdentifierIssuer"),L=K("./MessageDigest"),re=K("./Permuter"),$=K("./NQuads");function b(S,O){return S.hashO.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new V("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(O){var T=this;return gt(function*(){T.quads=O;for(const H of O)T._addBlankNodeQuadInfo({quad:H,component:H.subject}),T._addBlankNodeQuadInfo({quad:H,component:H.object}),T._addBlankNodeQuadInfo({quad:H,component:H.graph});const v=new Map,y=[...T.blankNodeInfo.keys()];let w=0;for(const H of y)++w%100==0&&(yield T._yield()),yield T._hashAndTrackBlankNode({id:H,hashToBlankNodes:v});const M=[...v.keys()].sort(),j=[];for(const H of M){const Y=v.get(H);Y.length>1?j.push(Y):T.canonicalIssuer.getId(Y[0])}for(const H of j){const Y=[];for(const D of H){if(T.canonicalIssuer.hasId(D))continue;const F=new V("_:b");F.getId(D);const Q=yield T.hashNDegreeQuads(D,F);Y.push(Q)}Y.sort(b);for(const D of Y){const F=D.issuer.getOldIds();for(const Q of F)T.canonicalIssuer.getId(Q)}}const I=[];for(const H of T.quads){const Y=ht({},H);Y.subject=T._useCanonicalId({component:Y.subject}),Y.object=T._useCanonicalId({component:Y.object}),Y.graph=T._useCanonicalId({component:Y.graph}),I.push($.serializeQuad(Y))}return I.sort(),I.join("")})()}hashFirstDegreeQuads(O){var T=this;return gt(function*(){const v=[],y=T.blankNodeInfo.get(O),w=y.quads;for(const j of w){const I={subject:null,predicate:j.predicate,object:null,graph:null};I.subject=T.modifyFirstDegreeComponent(O,j.subject,"subject"),I.object=T.modifyFirstDegreeComponent(O,j.object,"object"),I.graph=T.modifyFirstDegreeComponent(O,j.graph,"graph"),v.push($.serializeQuad(I))}v.sort();const M=new L(T.hashAlgorithm);for(const j of v)M.update(j);return y.hash=yield M.digest(),y.hash})()}hashRelatedBlankNode(O,T,v,y){var w=this;return gt(function*(){let M;M=w.canonicalIssuer.hasId(O)?w.canonicalIssuer.getId(O):v.hasId(O)?v.getId(O):w.blankNodeInfo.get(O).hash;const j=new L(w.hashAlgorithm);return j.update(y),"g"!==y&&j.update(w.getRelatedPredicate(T)),j.update(M),j.digest()})()}hashNDegreeQuads(O,T){var v=this;return gt(function*(){const y=new L(v.hashAlgorithm),w=yield v.createHashToRelated(O,T),M=[...w.keys()].sort();for(const j of M){y.update(j);let H,I="";const Y=new re(w.get(j));let D=0;for(;Y.hasNext();){const F=Y.next();++D%3==0&&(yield v._yield());let Q=T.clone(),E="";const U=[];let ie=!1;for(const ue of F)if(v.canonicalIssuer.hasId(ue)?E+=v.canonicalIssuer.getId(ue):(Q.hasId(ue)||U.push(ue),E+=Q.getId(ue)),0!==I.length&&E>I){ie=!0;break}if(!ie){for(const ue of U){const ee=yield v.hashNDegreeQuads(ue,Q);if(E+=Q.getId(ue),E+=`<${ee.hash}>`,Q=ee.issuer,0!==I.length&&E>I){ie=!0;break}}ie||(0===I.length||E`}createHashToRelated(O,T){var v=this;return gt(function*(){const y=new Map,w=v.blankNodeInfo.get(O).quads;let M=0;for(const j of w)++M%100==0&&(yield v._yield()),yield Promise.all([v._addRelatedBlankNodeHash({quad:j,component:j.subject,position:"s",id:O,issuer:T,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.object,position:"o",id:O,issuer:T,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.graph,position:"g",id:O,issuer:T,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:O,hashToBlankNodes:T}){var v=this;return gt(function*(){const y=yield v.hashFirstDegreeQuads(O),w=T.get(y);w?w.push(O):T.set(y,[O])})()}_addBlankNodeQuadInfo({quad:O,component:T}){if("BlankNode"!==T.termType)return;const v=T.value,y=this.blankNodeInfo.get(v);y?y.quads.add(O):this.blankNodeInfo.set(v,{quads:new Set([O]),hash:null})}_addRelatedBlankNodeHash({quad:O,component:T,position:v,id:y,issuer:w,hashToRelated:M}){var j=this;return gt(function*(){if("BlankNode"!==T.termType||T.value===y)return;const I=T.value,H=yield j.hashRelatedBlankNode(I,O,w,v),Y=M.get(H);Y?Y.push(I):M.set(H,[I])})()}_useCanonicalId({component:O}){return"BlankNode"!==O.termType||O.value.startsWith(this.canonicalIssuer.prefix)?O:{termType:"BlankNode",value:this.canonicalIssuer.getId(O.value)}}_yield(){return gt(function*(){return new Promise(O=>q(O))})()}}}).call(this)}).call(this,K("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(K,Ae,he){"use strict";const q=K("./IdentifierIssuer"),V=K("./MessageDigest"),L=K("./Permuter"),re=K("./NQuads");function $(b,S){return b.hashS.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new q("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(S){this.quads=S;for(const M of S)this._addBlankNodeQuadInfo({quad:M,component:M.subject}),this._addBlankNodeQuadInfo({quad:M,component:M.object}),this._addBlankNodeQuadInfo({quad:M,component:M.graph});const O=new Map,T=[...this.blankNodeInfo.keys()];for(const M of T)this._hashAndTrackBlankNode({id:M,hashToBlankNodes:O});const v=[...O.keys()].sort(),y=[];for(const M of v){const j=O.get(M);j.length>1?y.push(j):this.canonicalIssuer.getId(j[0])}for(const M of y){const j=[];for(const I of M){if(this.canonicalIssuer.hasId(I))continue;const H=new q("_:b");H.getId(I);const Y=this.hashNDegreeQuads(I,H);j.push(Y)}j.sort($);for(const I of j){const H=I.issuer.getOldIds();for(const Y of H)this.canonicalIssuer.getId(Y)}}const w=[];for(const M of this.quads){const j=ht({},M);j.subject=this._useCanonicalId({component:j.subject}),j.object=this._useCanonicalId({component:j.object}),j.graph=this._useCanonicalId({component:j.graph}),w.push(re.serializeQuad(j))}return w.sort(),w.join("")}hashFirstDegreeQuads(S){const O=[],T=this.blankNodeInfo.get(S),v=T.quads;for(const w of v){const M={subject:null,predicate:w.predicate,object:null,graph:null};M.subject=this.modifyFirstDegreeComponent(S,w.subject,"subject"),M.object=this.modifyFirstDegreeComponent(S,w.object,"object"),M.graph=this.modifyFirstDegreeComponent(S,w.graph,"graph"),O.push(re.serializeQuad(M))}O.sort();const y=new V(this.hashAlgorithm);for(const w of O)y.update(w);return T.hash=y.digest(),T.hash}hashRelatedBlankNode(S,O,T,v){let y;y=this.canonicalIssuer.hasId(S)?this.canonicalIssuer.getId(S):T.hasId(S)?T.getId(S):this.blankNodeInfo.get(S).hash;const w=new V(this.hashAlgorithm);return w.update(v),"g"!==v&&w.update(this.getRelatedPredicate(O)),w.update(y),w.digest()}hashNDegreeQuads(S,O){const T=new V(this.hashAlgorithm),v=this.createHashToRelated(S,O),y=[...v.keys()].sort();for(const w of y){T.update(w);let j,M="";const I=new L(v.get(w));for(;I.hasNext();){const H=I.next();let Y=O.clone(),D="";const F=[];let Q=!1;for(const E of H)if(this.canonicalIssuer.hasId(E)?D+=this.canonicalIssuer.getId(E):(Y.hasId(E)||F.push(E),D+=Y.getId(E)),0!==M.length&&D>M){Q=!0;break}if(!Q){for(const E of F){const U=this.hashNDegreeQuads(E,Y);if(D+=Y.getId(E),D+=`<${U.hash}>`,Y=U.issuer,0!==M.length&&D>M){Q=!0;break}}Q||(0===M.length||D`}createHashToRelated(S,O){const T=new Map,v=this.blankNodeInfo.get(S).quads;for(const y of v)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:S,issuer:O,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:S,issuer:O,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:S,issuer:O,hashToRelated:T});return T}_hashAndTrackBlankNode({id:S,hashToBlankNodes:O}){const T=this.hashFirstDegreeQuads(S),v=O.get(T);v?v.push(S):O.set(T,[S])}_addBlankNodeQuadInfo({quad:S,component:O}){if("BlankNode"!==O.termType)return;const T=O.value,v=this.blankNodeInfo.get(T);v?v.quads.add(S):this.blankNodeInfo.set(T,{quads:new Set([S]),hash:null})}_addRelatedBlankNodeHash({quad:S,component:O,position:T,id:v,issuer:y,hashToRelated:w}){if("BlankNode"!==O.termType||O.value===v)return;const M=O.value,j=this.hashRelatedBlankNode(M,S,y,T),I=w.get(j);I?I.push(M):w.set(j,[M])}_useCanonicalId({component:S}){return"BlankNode"!==S.termType||S.value.startsWith(this.canonicalIssuer.prefix)?S:{termType:"BlankNode",value:this.canonicalIssuer.getId(S.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(K,Ae,he){"use strict";const q=K("./URDNA2015");Ae.exports=class extends q{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){var $=this;return gt(function*(){const b=new Map,S=$.blankNodeInfo.get(L).quads;let O=0;for(const T of S){let v,y;if("BlankNode"===T.subject.termType&&T.subject.value!==L)y=T.subject.value,v="p";else{if("BlankNode"!==T.object.termType||T.object.value===L)continue;y=T.object.value,v="r"}++O%100==0&&(yield $._yield());const w=yield $.hashRelatedBlankNode(y,T,re,v),M=b.get(w);M?M.push(y):b.set(w,[y])}return b})()}}},{"./URDNA2015":51}],54:[function(K,Ae,he){"use strict";const q=K("./URDNA2015Sync");Ae.exports=class extends q{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){const $=new Map,b=this.blankNodeInfo.get(L).quads;for(const S of b){let O,T;if("BlankNode"===S.subject.termType&&S.subject.value!==L)T=S.subject.value,O="p";else{if("BlankNode"!==S.object.termType||S.object.value===L)continue;T=S.object.value,O="r"}const v=this.hashRelatedBlankNode(T,S,re,O),y=$.get(v);y?y.push(T):$.set(v,[T])}return $}}},{"./URDNA2015Sync":52}],55:[function(K,Ae,he){"use strict";const q=K("./URDNA2015"),V=K("./URGNA2012"),L=K("./URDNA2015Sync"),re=K("./URGNA2012Sync");let $;try{$=K("rdf-canonize-native")}catch(S){}const b={};Ae.exports=b,b.NQuads=K("./NQuads"),b.IdentifierIssuer=K("./IdentifierIssuer"),b._rdfCanonizeNative=function(S){return S&&($=S),$},b.canonize=function(){var S=gt(function*(O,T){if(Array.isArray(O)||(O=b.NQuads.legacyDatasetToQuads(O)),T.useNative){if(!$)throw new Error("rdf-canonize-native not available");return new Promise((v,y)=>$.canonize(O,T,(w,M)=>w?y(w):v(M)))}if("URDNA2015"===T.algorithm)return new q(T).main(O);if("URGNA2012"===T.algorithm)return new V(T).main(O);throw"algorithm"in T?new Error("Invalid RDF Dataset Canonicalization algorithm: "+T.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(O,T){return S.apply(this,arguments)}}(),b._canonizeSync=function(S,O){if(Array.isArray(S)||(S=b.NQuads.legacyDatasetToQuads(S)),O.useNative){if($)return $.canonizeSync(S,O);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===O.algorithm)return new L(O).main(S);if("URGNA2012"===O.algorithm)return new re(O).main(S);throw"algorithm"in O?new Error("Invalid RDF Dataset Canonicalization algorithm: "+O.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(K,Ae,he){"use strict";var q=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&q(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(K("./lib/BlankNode"),he),V(K("./lib/DataFactory"),he),V(K("./lib/DefaultGraph"),he),V(K("./lib/Literal"),he),V(K("./lib/NamedNode"),he),V(K("./lib/Quad"),he),V(K("./lib/Variable"),he)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(L){this.termType="BlankNode",this.value=L}equals(L){return!!L&&"BlankNode"===L.termType&&L.value===this.value}}},{}],58:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const q=K("./BlankNode"),V=K("./DefaultGraph"),L=K("./Literal"),re=K("./NamedNode"),$=K("./Quad"),b=K("./Variable");let S=0;he.DataFactory=class{constructor(v){this.blankNodeCounter=0,this.blankNodePrefix=(v=v||{}).blankNodePrefix||`df_${S++}_`}namedNode(v){return new re.NamedNode(v)}blankNode(v){return new q.BlankNode(v||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(v,y){return new L.Literal(v,y)}variable(v){return new b.Variable(v)}defaultGraph(){return V.DefaultGraph.INSTANCE}quad(v,y,w,M){return new $.Quad(v,y,w,M||this.defaultGraph())}fromTerm(v){switch(v.termType){case"NamedNode":return this.namedNode(v.value);case"BlankNode":return this.blankNode(v.value);case"Literal":return v.language?this.literal(v.value,v.language):v.datatype.equals(L.Literal.XSD_STRING)?this.literal(v.value):this.literal(v.value,this.fromTerm(v.datatype));case"Variable":return this.variable(v.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(v.subject),this.fromTerm(v.predicate),this.fromTerm(v.object),this.fromTerm(v.graph))}}fromQuad(v){return this.fromTerm(v)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class q{constructor(){this.termType="DefaultGraph",this.value=""}equals(L){return!!L&&"DefaultGraph"===L.termType}}he.DefaultGraph=q,q.INSTANCE=new q},{}],60:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const q=K("./NamedNode");class V{constructor(re,$){this.termType="Literal",this.value=re,"string"==typeof $?(this.language=$,this.datatype=V.RDF_LANGUAGE_STRING):$?(this.language="",this.datatype=$):(this.language="",this.datatype=V.XSD_STRING)}equals(re){return!!re&&"Literal"===re.termType&&re.value===this.value&&re.language===this.language&&re.datatype.equals(this.datatype)}}he.Literal=V,V.RDF_LANGUAGE_STRING=new q.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),V.XSD_STRING=new q.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(L){this.termType="NamedNode",this.value=L}equals(L){return!!L&&"NamedNode"===L.termType&&L.value===this.value}}},{}],62:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(L,re,$,b){this.termType="Quad",this.value="",this.subject=L,this.predicate=re,this.object=$,this.graph=b}equals(L){return!!L&&("Quad"===L.termType||!L.termType)&&this.subject.equals(L.subject)&&this.predicate.equals(L.predicate)&&this.object.equals(L.object)&&this.graph.equals(L.graph)}}},{}],63:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(L){this.termType="Variable",this.value=L}equals(L){return!!L&&"Variable"===L.termType&&L.value===this.value}}},{}],64:[function(K,Ae,he){"use strict";var q=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&q(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(K("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class q extends Error{constructor(L,re){const $=L.saxStream._parser;super(L.trackPosition?`Line ${$.line+1} column ${$.column+1}: ${re}`:re)}}he.ParseError=q},{}],66:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const q=K("relative-to-absolute-iri"),V=K("sax"),L=K("stream"),re=K("./ParseError"),$=K("rdf-data-factory");class b extends L.Transform{constructor(T){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},T&&(Object.assign(this,T),this.options=T),this.dataFactory||(this.dataFactory=new $.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=V.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(T,v){const y={};let w=!1;for(const j in T.attributes)j.startsWith("xmlns")&&(5===j.length?(w=!0,y[""]=T.attributes[j]):":"===j.charAt(5)&&(w=!0,y[j.substr(6)]=T.attributes[j]));const M=v&&v.ns?v.ns:[b.DEFAULT_NS];return w?M.concat([y]):M}static expandPrefixedTerm(T,v,y){const w=T.indexOf(":");let M,j;w>=0?(M=T.substr(0,w),j=T.substr(w+1)):(M="",j=T);let I=null,H=null;for(let Y=v.length-1;Y>=0;Y--){const D=v[Y][M];if(D){I=D;break}H||(H=v[Y][""])}if(!I){if(M&&"xmlns"!==M)throw new re.ParseError(y,`The prefix '${M}' in term '${T}' was not bound.`);I=H||""}return{prefix:M,local:j,uri:I}}static isValidIri(T){return b.IRI_REGEX.test(T)}import(T){const v=new L.PassThrough({readableObjectMode:!0});T.on("error",w=>y.emit("error",w)),T.on("data",w=>v.push(w)),T.on("end",()=>v.push(null));const y=v.pipe(new b(this.options));return y}_transform(T,v,y){try{this.saxStream.write(T,v)}catch(w){return y(w)}y()}newParseError(T){return new re.ParseError(this,T)}valueToUri(T,v){return this.uriToNamedNode(q.resolve(T,v.baseIRI))}uriToNamedNode(T){if(!b.isValidIri(T))throw this.newParseError(`Invalid URI: ${T}`);return this.dataFactory.namedNode(T)}validateNcname(T){if(!b.NCNAME_MATCHER.test(T))throw this.newParseError(`Not a valid NCName: ${T}`)}attachSaxListeners(){this.saxStream.on("error",T=>this.emit("error",T)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(T){const v=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=S.RESOURCE;if(v&&(v.hadChildren=!0,y=v.childrenParseType),v&&v.childrenStringTags){const M=T.name;let j="";for(const D in T.attributes)j+=` ${D}="${T.attributes[D]}"`;v.childrenStringTags.push(`<${M}${j}>`);const Y={childrenStringTags:v.childrenStringTags};return Y.childrenStringEmitClosingTag=``,void this.activeTagStack.push(Y)}const w={};v?(w.language=v.language,w.baseIRI=v.baseIRI):w.baseIRI=this.baseIRI,this.activeTagStack.push(w),w.ns=b.parseNamespace(T,v),y===S.RESOURCE?this.onTagResource(T,w,v,!v):this.onTagProperty(T,w,v)}onTagResource(T,v,y,w){const M=b.expandPrefixedTerm(T.name,v.ns,this);v.childrenParseType=S.PROPERTY;let j=!0;if(M.uri===b.RDF){if(!w&&b.FORBIDDEN_NODE_ELEMENTS.indexOf(M.local)>=0)throw this.newParseError(`Illegal node element name: ${M.local}`);switch(M.local){case"RDF":v.childrenParseType=S.RESOURCE;case"Description":j=!1}}const I=[],H=[];let Y=null,D=!1,F=!1,Q=null;for(const E in T.attributes){const U=T.attributes[E],ie=b.expandPrefixedTerm(E,v.ns,this);if(y&&ie.uri===b.RDF)switch(ie.local){case"about":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);Y=U;continue;case"ID":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);this.validateNcname(U),Y="#"+U,D=!0;continue;case"nodeID":if(Y)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${Y} where found.`);this.validateNcname(U),Y=U,F=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":Q=U;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(ie.uri===b.XML){if("lang"===ie.local){v.language=""===U?null:U.toLowerCase();continue}if("base"===ie.local){v.baseIRI=q.resolve(U,v.baseIRI);continue}}"xml"!==ie.prefix&&ie.uri&&(I.push(this.uriToNamedNode(ie.uri+ie.local)),H.push(U))}if(null!==Y&&(v.subject=F?this.dataFactory.blankNode(Y):this.valueToUri(Y,v),D&&this.claimNodeId(v.subject)),v.subject||(v.subject=this.dataFactory.blankNode()),j){const E=this.uriToNamedNode(M.uri+M.local);this.emitTriple(v.subject,this.dataFactory.namedNode(b.RDF+"type"),E,y?y.reifiedStatementId:null)}if(y){if(y.predicate)if(y.childrenCollectionSubject){const E=this.dataFactory.blankNode();this.emitTriple(y.childrenCollectionSubject,y.childrenCollectionPredicate,E,y.reifiedStatementId),this.emitTriple(E,this.dataFactory.namedNode(b.RDF+"first"),v.subject,v.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(b.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,v.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${w.local}`);v.predicateSubPredicates=[],v.predicateSubObjects=[];let M=!1,j=!1,I=null,H=!0;const Y=[],D=[];for(const F in T.attributes){const Q=T.attributes[F],E=b.expandPrefixedTerm(F,v.ns,this);if(E.uri===b.RDF)switch(E.local){case"resource":if(I)throw this.newParseError(`Found both rdf:resource (${Q}) and rdf:nodeID (${I}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${Q})`);v.hadChildren=!0,I=Q,H=!1;continue;case"datatype":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${Q}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${Q})`);v.datatype=this.valueToUri(Q,v);continue;case"nodeID":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${Q}).`);if(v.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${Q}).`);if(M)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${Q})`);this.validateNcname(Q),v.hadChildren=!0,I=Q,H=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(j)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(v.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${v.datatype.value})`);if(I)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${I})`);if("Resource"===Q){M=!0,v.childrenParseType=S.PROPERTY;const U=this.dataFactory.blankNode();this.emitTriple(v.subject,v.predicate,U,v.reifiedStatementId),v.subject=U,v.predicate=null}else"Collection"===Q?(M=!0,v.hadChildren=!0,v.childrenCollectionSubject=v.subject,v.childrenCollectionPredicate=v.predicate,H=!1):"Literal"===Q&&(M=!0,v.childrenTagsToString=!0,v.childrenStringTags=[]);continue;case"ID":this.validateNcname(Q),v.reifiedStatementId=this.valueToUri("#"+Q,v),this.claimNodeId(v.reifiedStatementId);continue}else if(E.uri===b.XML&&"lang"===E.local){v.language=""===Q?null:Q.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(M||v.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${Q}`);v.hadChildren=!0,j=!0,Y.push(this.uriToNamedNode(E.uri+E.local)),D.push(this.dataFactory.literal(Q,v.datatype||v.language))}}if(null!==I){const F=v.subject;v.subject=H?this.dataFactory.blankNode(I):this.valueToUri(I,v),this.emitTriple(F,v.predicate,v.subject,v.reifiedStatementId);for(let Q=0;Q/g,(v,y,w)=>(this.saxStream._parser.ENTITIES[y]=w,""))}}var S,O;he.RdfXmlParser=b,b.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,b.MIME_TYPE="application/rdf+xml",b.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",b.XML="http://www.w3.org/XML/1998/namespace",b.XMLNS="http://www.w3.org/2000/xmlns/",b.DEFAULT_NS={xml:b.XML},b.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],b.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],b.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,(O=S=he.ParseType||(he.ParseType={}))[O.RESOURCE=0]="RESOURCE",O[O.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(K,Ae,he){"use strict";var V={};function L(O,T,v){v||(v=Error);var w=function(M){function j(I,H,Y){return M.call(this,function(M,j,I){return"string"==typeof T?T:T(M,j,I)}(I,H,Y))||this}return function(O,T){O.prototype=Object.create(T.prototype),O.prototype.constructor=O,O.__proto__=T}(j,M),j}(v);w.prototype.name=v.name,w.prototype.code=O,V[O]=w}function re(O,T){if(Array.isArray(O)){var v=O.length;return O=O.map(function(y){return String(y)}),v>2?"one of ".concat(T," ").concat(O.slice(0,v-1).join(", "),", or ")+O[v-1]:2===v?"one of ".concat(T," ").concat(O[0]," or ").concat(O[1]):"of ".concat(T," ").concat(O[0])}return"of ".concat(T," ").concat(String(O))}L("ERR_INVALID_OPT_VALUE",function(O,T){return'The value "'+T+'" is invalid for option "'+O+'"'},TypeError),L("ERR_INVALID_ARG_TYPE",function(O,T,v){var y,w;if("string"==typeof T&&function(O,T,v){return O.substr(!v||v<0?0:+v,T.length)===T}(T,"not ")?(y="must not be",T=T.replace(/^not /,"")):y="must be",function(O,T,v){return(void 0===v||v>O.length)&&(v=O.length),O.substring(v-T.length,v)===T}(O," argument"))w="The ".concat(O," ").concat(y," ").concat(re(T,"type"));else{var M=function(O,T,v){return"number"!=typeof v&&(v=0),!(v+T.length>O.length)&&-1!==O.indexOf(T,v)}(O,".")?"property":"argument";w='The "'.concat(O,'" ').concat(M," ").concat(y," ").concat(re(T,"type"))}return w+". Received type ".concat(typeof v)},TypeError),L("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),L("ERR_METHOD_NOT_IMPLEMENTED",function(O){return"The "+O+" method is not implemented"}),L("ERR_STREAM_PREMATURE_CLOSE","Premature close"),L("ERR_STREAM_DESTROYED",function(O){return"Cannot call "+O+" after a stream was destroyed"}),L("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),L("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),L("ERR_STREAM_WRITE_AFTER_END","write after end"),L("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),L("ERR_UNKNOWN_ENCODING",function(O){return"Unknown encoding: "+O},TypeError),L("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.exports.codes=V},{}],68:[function(K,Ae,he){(function(q){(function(){"use strict";var V=Object.keys||function(y){var w=[];for(var M in y)w.push(M);return w};Ae.exports=O;var L=K("./_stream_readable"),re=K("./_stream_writable");K("inherits")(O,L);for(var $=V(re.prototype),b=0;b<$.length;b++){var S=$[b];O.prototype[S]||(O.prototype[S]=re.prototype[S])}function O(y){if(!(this instanceof O))return new O(y);L.call(this,y),re.call(this,y),this.allowHalfOpen=!0,y&&(!1===y.readable&&(this.readable=!1),!1===y.writable&&(this.writable=!1),!1===y.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",T)))}function T(){this._writableState.ended||q.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(w){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=w,this._writableState.destroyed=w)}})}).call(this)}).call(this,K("_process"))},{"./_stream_readable":70,"./_stream_writable":72,_process:44,inherits:10}],69:[function(K,Ae,he){"use strict";Ae.exports=V;var q=K("./_stream_transform");function V(L){if(!(this instanceof V))return new V(L);q.call(this,L)}K("inherits")(V,q),V.prototype._transform=function(L,re,$){$(null,L)}},{"./_stream_transform":71,inherits:10}],70:[function(K,Ae,he){(function(q,V){(function(){"use strict";var L;Ae.exports=te,te.ReadableState=me,K("events");var $=function(B,R){return B.listeners(R).length},b=K("./internal/streams/stream"),S=K("buffer").Buffer,O=V.Uint8Array||function(){};var w,y=K("util");w=y&&y.debuglog?y.debuglog("stream"):function(){};var U,ie,ue,M=K("./internal/streams/buffer_list"),j=K("./internal/streams/destroy"),H=K("./internal/streams/state").getHighWaterMark,Y=K("../errors").codes,D=Y.ERR_INVALID_ARG_TYPE,F=Y.ERR_STREAM_PUSH_AFTER_EOF,Q=Y.ERR_METHOD_NOT_IMPLEMENTED,E=Y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;K("inherits")(te,b);var ee=j.errorOrDestroy,se=["error","close","destroy","pause","resume"];function me(fe,B,R){L=L||K("./_stream_duplex"),"boolean"!=typeof R&&(R=B instanceof L),this.objectMode=!!(fe=fe||{}).objectMode,R&&(this.objectMode=this.objectMode||!!fe.readableObjectMode),this.highWaterMark=H(this,fe,"readableHighWaterMark",R),this.buffer=new M,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==fe.emitClose,this.autoDestroy=!!fe.autoDestroy,this.destroyed=!1,this.defaultEncoding=fe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,fe.encoding&&(U||(U=K("string_decoder/").StringDecoder),this.decoder=new U(fe.encoding),this.encoding=fe.encoding)}function te(fe){if(L=L||K("./_stream_duplex"),!(this instanceof te))return new te(fe);this._readableState=new me(fe,this,this instanceof L),this.readable=!0,fe&&("function"==typeof fe.read&&(this._read=fe.read),"function"==typeof fe.destroy&&(this._destroy=fe.destroy)),b.call(this)}function ye(fe,B,R,k,Oe){w("readableAddChunk",B);var yt,Xe=fe._readableState;if(null===B)Xe.reading=!1,function(fe,B){if(w("onEofChunk"),!B.ended){if(B.decoder){var R=B.decoder.end();R&&R.length&&(B.buffer.push(R),B.length+=B.objectMode?1:R.length)}B.ended=!0,B.sync?je(fe):(B.needReadable=!1,B.emittedReadable||(B.emittedReadable=!0,Le(fe)))}}(fe,Xe);else if(Oe||(yt=function(fe,B){var R;return!function(fe){return S.isBuffer(fe)||fe instanceof O}(B)&&"string"!=typeof B&&void 0!==B&&!fe.objectMode&&(R=new D("chunk",["string","Buffer","Uint8Array"],B)),R}(Xe,B)),yt)ee(fe,yt);else if(Xe.objectMode||B&&B.length>0)if("string"!=typeof B&&!Xe.objectMode&&Object.getPrototypeOf(B)!==S.prototype&&(B=function(fe){return S.from(fe)}(B)),k)Xe.endEmitted?ee(fe,new E):De(fe,Xe,B,!0);else if(Xe.ended)ee(fe,new F);else{if(Xe.destroyed)return!1;Xe.reading=!1,Xe.decoder&&!R?(B=Xe.decoder.write(B),Xe.objectMode||0!==B.length?De(fe,Xe,B,!1):Ee(fe,Xe)):De(fe,Xe,B,!1)}else k||(Xe.reading=!1,Ee(fe,Xe));return!Xe.ended&&(Xe.lengthB.highWaterMark&&(B.highWaterMark=function(fe){return fe>=nt?fe=nt:(fe--,fe|=fe>>>1,fe|=fe>>>2,fe|=fe>>>4,fe|=fe>>>8,fe|=fe>>>16,fe++),fe}(fe)),fe<=B.length?fe:B.ended?B.length:(B.needReadable=!0,0))}function je(fe){var B=fe._readableState;w("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(w("emitReadable",B.flowing),B.emittedReadable=!0,q.nextTick(Le,fe))}function Le(fe){var B=fe._readableState;w("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(fe.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,be(fe)}function Ee(fe,B){B.readingMore||(B.readingMore=!0,q.nextTick(Re,fe,B))}function Re(fe,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:fe.listenerCount("data")>0&&fe.resume()}function Be(fe){w("readable nexttick read 0"),fe.read(0)}function X(fe,B){w("resume",B.reading),B.reading||fe.read(0),B.resumeScheduled=!1,fe.emit("resume"),be(fe),B.flowing&&!B.reading&&fe.read(0)}function be(fe){var B=fe._readableState;for(w("flow",B.flowing);B.flowing&&null!==fe.read(););}function ce(fe,B){return 0===B.length?null:(B.objectMode?R=B.buffer.shift():!fe||fe>=B.length?(R=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):R=B.buffer.consume(fe,B.decoder),R);var R}function Pe(fe){var B=fe._readableState;w("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,q.nextTick(wt,B,fe))}function wt(fe,B){if(w("endReadableNT",fe.endEmitted,fe.length),!fe.endEmitted&&0===fe.length&&(fe.endEmitted=!0,B.readable=!1,B.emit("end"),fe.autoDestroy)){var R=B._writableState;(!R||R.autoDestroy&&R.finished)&&B.destroy()}}function pt(fe,B){for(var R=0,k=fe.length;R=B.highWaterMark:B.length>0)||B.ended))return w("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?Pe(this):je(this),null;if(0===(fe=Je(fe,B))&&B.ended)return 0===B.length&&Pe(this),null;var Oe,k=B.needReadable;return w("need readable",k),(0===B.length||B.length-fe0?ce(fe,B):null)?(B.needReadable=B.length<=B.highWaterMark,fe=0):(B.length-=fe,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),R!==fe&&B.ended&&Pe(this)),null!==Oe&&this.emit("data",Oe),Oe},te.prototype._read=function(fe){ee(this,new Q("_read()"))},te.prototype.pipe=function(fe,B){var R=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=fe;break;case 1:k.pipes=[k.pipes,fe];break;default:k.pipes.push(fe)}k.pipesCount+=1,w("pipe count=%d opts=%j",k.pipesCount,B);var Xe=B&&!1===B.end||fe===q.stdout||fe===q.stderr?cs:It;function yt(Ps,Gr){w("onunpipe"),Ps===R&&Gr&&!1===Gr.hasUnpiped&&(Gr.hasUnpiped=!0,w("cleanup"),fe.removeListener("close",Hr),fe.removeListener("finish",Ns),fe.removeListener("drain",Tn),fe.removeListener("error",hi),fe.removeListener("unpipe",yt),R.removeListener("end",It),R.removeListener("end",cs),R.removeListener("data",yi),Pn=!0,k.awaitDrain&&(!fe._writableState||fe._writableState.needDrain)&&Tn())}function It(){w("onend"),fe.end()}k.endEmitted?q.nextTick(Xe):R.once("end",Xe),fe.on("unpipe",yt);var Tn=function(fe){return function(){var R=fe._readableState;w("pipeOnDrain",R.awaitDrain),R.awaitDrain&&R.awaitDrain--,0===R.awaitDrain&&$(fe,"data")&&(R.flowing=!0,be(fe))}}(R);fe.on("drain",Tn);var Pn=!1;function yi(Ps){w("ondata");var Gr=fe.write(Ps);w("dest.write",Gr),!1===Gr&&((1===k.pipesCount&&k.pipes===fe||k.pipesCount>1&&-1!==pt(k.pipes,fe))&&!Pn&&(w("false write response, pause",k.awaitDrain),k.awaitDrain++),R.pause())}function hi(Ps){w("onerror",Ps),cs(),fe.removeListener("error",hi),0===$(fe,"error")&&ee(fe,Ps)}function Hr(){fe.removeListener("finish",Ns),cs()}function Ns(){w("onfinish"),fe.removeListener("close",Hr),cs()}function cs(){w("unpipe"),R.unpipe(fe)}return R.on("data",yi),function(fe,B,R){if("function"==typeof fe.prependListener)return fe.prependListener(B,R);fe._events&&fe._events[B]?Array.isArray(fe._events[B])?fe._events[B].unshift(R):fe._events[B]=[R,fe._events[B]]:fe.on(B,R)}(fe,"error",hi),fe.once("close",Hr),fe.once("finish",Ns),fe.emit("pipe",R),k.flowing||(w("pipe resume"),R.resume()),fe},te.prototype.unpipe=function(fe){var B=this._readableState,R={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return fe&&fe!==B.pipes||(fe||(fe=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,fe&&fe.emit("unpipe",this,R)),this;if(!fe){var k=B.pipes,Oe=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Xe=0;Xe0,!1!==k.flowing&&this.resume()):"readable"===fe&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,w("on readable",k.length,k.reading),k.length?je(this):k.reading||q.nextTick(Be,this)),R},te.prototype.removeListener=function(fe,B){var R=b.prototype.removeListener.call(this,fe,B);return"readable"===fe&&q.nextTick(qe,this),R},te.prototype.removeAllListeners=function(fe){var B=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===fe||void 0===fe)&&q.nextTick(qe,this),B},te.prototype.resume=function(){var fe=this._readableState;return fe.flowing||(w("resume"),fe.flowing=!fe.readableListening,function(fe,B){B.resumeScheduled||(B.resumeScheduled=!0,q.nextTick(X,fe,B))}(this,fe)),fe.paused=!1,this},te.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},te.prototype.wrap=function(fe){var B=this,R=this._readableState,k=!1;for(var Oe in fe.on("end",function(){if(w("wrapped end"),R.decoder&&!R.ended){var yt=R.decoder.end();yt&&yt.length&&B.push(yt)}B.push(null)}),fe.on("data",function(yt){w("wrapped data"),R.decoder&&(yt=R.decoder.write(yt)),R.objectMode&&null==yt||!(R.objectMode||yt&&yt.length)||B.push(yt)||(k=!0,fe.pause())}),fe)void 0===this[Oe]&&"function"==typeof fe[Oe]&&(this[Oe]=function(It){return function(){return fe[It].apply(fe,arguments)}}(Oe));for(var Xe=0;Xe-1))throw new ie(ce);return this._writableState.defaultEncoding=ce,this},Object.defineProperty(me.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(me.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),me.prototype._write=function(be,ce,Pe){Pe(new Y("_write()"))},me.prototype._writev=null,me.prototype.end=function(be,ce,Pe){var wt=this._writableState;return"function"==typeof be?(Pe=be,be=null,ce=null):"function"==typeof ce&&(Pe=ce,ce=null),null!=be&&this.write(be,ce),wt.corked&&(wt.corked=1,this.uncork()),wt.ending||function(be,ce,Pe){ce.ending=!0,Be(be,ce),Pe&&(ce.finished?q.nextTick(Pe):be.once("finish",Pe)),ce.ended=!0,be.writable=!1}(this,wt,Pe),this},Object.defineProperty(me.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(ce){!this._writableState||(this._writableState.destroyed=ce)}}),me.prototype.destroy=w.destroy,me.prototype._undestroy=w.undestroy,me.prototype._destroy=function(be,ce){ce(be)}}).call(this)}).call(this,K("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(K,Ae,he){(function(q){(function(){"use strict";var V;function L(F,Q,E){return Q in F?Object.defineProperty(F,Q,{value:E,enumerable:!0,configurable:!0,writable:!0}):F[Q]=E,F}var re=K("./end-of-stream"),$=Symbol("lastResolve"),b=Symbol("lastReject"),S=Symbol("error"),O=Symbol("ended"),T=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function w(F,Q){return{value:F,done:Q}}function M(F){var Q=F[$];if(null!==Q){var E=F[y].read();null!==E&&(F[T]=null,F[$]=null,F[b]=null,Q(w(E,!1)))}}function j(F){q.nextTick(M,F)}var H=Object.getPrototypeOf(function(){}),Y=Object.setPrototypeOf((L(V={get stream(){return this[y]},next:function(){var Q=this,E=this[S];if(null!==E)return Promise.reject(E);if(this[O])return Promise.resolve(w(void 0,!0));if(this[y].destroyed)return new Promise(function(ee,se){q.nextTick(function(){Q[S]?se(Q[S]):ee(w(void 0,!0))})});var ie,U=this[T];if(U)ie=new Promise(function(F,Q){return function(E,U){F.then(function(){Q[O]?E(w(void 0,!0)):Q[v](E,U)},U)}}(U,this));else{var ue=this[y].read();if(null!==ue)return Promise.resolve(w(ue,!1));ie=new Promise(this[v])}return this[T]=ie,ie}},Symbol.asyncIterator,function(){return this}),L(V,"return",function(){var Q=this;return new Promise(function(E,U){Q[y].destroy(null,function(ie){ie?U(ie):E(w(void 0,!0))})})}),V),H);Ae.exports=function(Q){var E,U=Object.create(Y,(L(E={},y,{value:Q,writable:!0}),L(E,$,{value:null,writable:!0}),L(E,b,{value:null,writable:!0}),L(E,S,{value:null,writable:!0}),L(E,O,{value:Q._readableState.endEmitted,writable:!0}),L(E,v,{value:function(ue,ee){var se=U[y].read();se?(U[T]=null,U[$]=null,U[b]=null,ue(w(se,!1))):(U[$]=ue,U[b]=ee)},writable:!0}),E));return U[T]=null,re(Q,function(ie){if(ie&&"ERR_STREAM_PREMATURE_CLOSE"!==ie.code){var ue=U[b];return null!==ue&&(U[T]=null,U[$]=null,U[b]=null,ue(ie)),void(U[S]=ie)}var ee=U[$];null!==ee&&(U[T]=null,U[$]=null,U[b]=null,ee(w(void 0,!0))),U[O]=!0}),Q.on("readable",j.bind(null,U)),U}}).call(this)}).call(this,K("_process"))},{"./end-of-stream":76,_process:44}],74:[function(K,Ae,he){"use strict";function q(M,j){var I=Object.keys(M);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(M);j&&(H=H.filter(function(Y){return Object.getOwnPropertyDescriptor(M,Y).enumerable})),I.push.apply(I,H)}return I}function L(M,j,I){return j in M?Object.defineProperty(M,j,{value:I,enumerable:!0,configurable:!0,writable:!0}):M[j]=I,M}function $(M,j){for(var I=0;I0?this.tail.next=H:this.head=H,this.tail=H,++this.length}},{key:"unshift",value:function(I){var H={data:I,next:this.head};0===this.length&&(this.tail=H),this.head=H,++this.length}},{key:"shift",value:function(){if(0!==this.length){var I=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,I}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(I){if(0===this.length)return"";for(var H=this.head,Y=""+H.data;H=H.next;)Y+=I+H.data;return Y}},{key:"concat",value:function(I){if(0===this.length)return O.alloc(0);for(var H=O.allocUnsafe(I>>>0),Y=this.head,D=0;Y;)w(Y.data,H,D),D+=Y.data.length,Y=Y.next;return H}},{key:"consume",value:function(I,H){var Y;return IF.length?F.length:I;if(D+=Q===F.length?F:F.slice(0,I),0==(I-=Q)){Q===F.length?(++Y,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=F.slice(Q));break}++Y}return this.length-=Y,D}},{key:"_getBuffer",value:function(I){var H=O.allocUnsafe(I),Y=this.head,D=1;for(Y.data.copy(H),I-=Y.data.length;Y=Y.next;){var F=Y.data,Q=I>F.length?F.length:I;if(F.copy(H,H.length-I,0,Q),0==(I-=Q)){Q===F.length?(++D,this.head=Y.next?Y.next:this.tail=null):(this.head=Y,Y.data=F.slice(Q));break}++D}return this.length-=D,H}},{key:y,value:function(I,H){return v(this,function(M){for(var j=1;j0,function(ie){Y||(Y=ie),ie&&D.forEach(T),!E&&(D.forEach(T),H(Y))})});return j.reduce(v)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(K,Ae,he){"use strict";var q=K("../../../errors").codes.ERR_INVALID_OPT_VALUE;Ae.exports={getHighWaterMark:function(re,$,b,S){var O=function(re,$,b){return null!=re.highWaterMark?re.highWaterMark:$?re[b]:null}($,S,b);if(null!=O){if(!isFinite(O)||Math.floor(O)!==O||O<0)throw new q(S?b:"highWaterMark",O);return Math.floor(O)}return re.objectMode?16:16384}}},{"../../../errors":67}],80:[function(K,Ae,he){Ae.exports=K("events").EventEmitter},{events:8}],81:[function(K,Ae,he){(he=Ae.exports=K("./lib/_stream_readable.js")).Stream=he,he.Readable=he,he.Writable=K("./lib/_stream_writable.js"),he.Duplex=K("./lib/_stream_duplex.js"),he.Transform=K("./lib/_stream_transform.js"),he.PassThrough=K("./lib/_stream_passthrough.js"),he.finished=K("./lib/internal/streams/end-of-stream.js"),he.pipeline=K("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(K,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(V){for(var L in V)he.hasOwnProperty(L)||(he[L]=V[L])}(K("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(K,Ae,he){"use strict";function V($){const b=[];let S=0;for(;S<$.length;)switch($[S]){case"/":if("."===$[S+1])if("."===$[S+2]){if(!re($[S+3])){b.push([]),S++;break}b.pop(),$[S+3]||b.push([]),S+=3}else{if(!re($[S+2])){b.push([]),S++;break}$[S+2]||b.push([]),S+=2}else b.push([]),S++;break;case"#":case"?":b.length||b.push([]),b[b.length-1].push($.substr(S)),S=$.length;break;default:b.length||b.push([]),b[b.length-1].push($[S]),S++}return"/"+b.map(O=>O.join("")).join("/")}function L($,b){let S=b+1;b>=0?"/"===$[b+1]&&"/"===$[b+2]&&(S=b+3):"/"===$[0]&&"/"===$[1]&&(S=2);const O=$.indexOf("/",S);return O<0?$:$.substr(0,O)+V($.substr(O))}function re($){return!$||"#"===$||"?"===$||"/"===$}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function($,b){const S=(b=b||"").indexOf("#");if(S>0&&(b=b.substr(0,S)),!$.length){if(b.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);return b}if($.startsWith("?")){const j=b.indexOf("?");return j>0&&(b=b.substr(0,j)),b+$}if($.startsWith("#"))return b+$;if(!b.length){const j=$.indexOf(":");if(j<0)throw new Error(`Found invalid relative IRI '${$}' for a missing baseIRI`);return L($,j)}const O=$.indexOf(":");if(O>=0)return L($,O);const T=b.indexOf(":");if(T<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);const v=b.substr(0,T+1);if(0===$.indexOf("//"))return v+L($,O);let y;if(b.indexOf("//",T)===T+1){if(y=b.indexOf("/",T+3),y<0)return b.length>T+3?b+"/"+L($,O):v+L($,O)}else if(y=b.indexOf("/",T+1),y<0)return v+L($,O);if(0===$.indexOf("/"))return b.substr(0,y)+V($);let w=b.substr(y);const M=w.lastIndexOf("/");return M>=0&&M"===ce?(te(X,"onsgmldeclaration",X.sgmlDecl),X.sgmlDecl="",X.state=se.TEXT):(U(ce)&&(X.state=se.SGML_DECL_QUOTED),X.sgmlDecl+=ce);continue;case se.SGML_DECL_QUOTED:ce===X.q&&(X.state=se.SGML_DECL,X.q=""),X.sgmlDecl+=ce;continue;case se.DOCTYPE:">"===ce?(X.state=se.TEXT,te(X,"ondoctype",X.doctype),X.doctype=!0):(X.doctype+=ce,"["===ce?X.state=se.DOCTYPE_DTD:U(ce)&&(X.state=se.DOCTYPE_QUOTED,X.q=ce));continue;case se.DOCTYPE_QUOTED:X.doctype+=ce,ce===X.q&&(X.q="",X.state=se.DOCTYPE);continue;case se.DOCTYPE_DTD:X.doctype+=ce,"]"===ce?X.state=se.DOCTYPE:U(ce)&&(X.state=se.DOCTYPE_DTD_QUOTED,X.q=ce);continue;case se.DOCTYPE_DTD_QUOTED:X.doctype+=ce,ce===X.q&&(X.state=se.DOCTYPE_DTD,X.q="");continue;case se.COMMENT:"-"===ce?X.state=se.COMMENT_ENDING:X.comment+=ce;continue;case se.COMMENT_ENDING:"-"===ce?(X.state=se.COMMENT_ENDED,X.comment=De(X.opt,X.comment),X.comment&&te(X,"oncomment",X.comment),X.comment=""):(X.comment+="-"+ce,X.state=se.COMMENT);continue;case se.COMMENT_ENDED:">"!==ce?(Ze(X,"Malformed comment"),X.comment+="--"+ce,X.state=se.COMMENT):X.state=se.TEXT;continue;case se.CDATA:"]"===ce?X.state=se.CDATA_ENDING:X.cdata+=ce;continue;case se.CDATA_ENDING:"]"===ce?X.state=se.CDATA_ENDING_2:(X.cdata+="]"+ce,X.state=se.CDATA);continue;case se.CDATA_ENDING_2:">"===ce?(X.cdata&&te(X,"oncdata",X.cdata),te(X,"onclosecdata"),X.cdata="",X.state=se.TEXT):"]"===ce?X.cdata+="]":(X.cdata+="]]"+ce,X.state=se.CDATA);continue;case se.PROC_INST:"?"===ce?X.state=se.PROC_INST_ENDING:E(ce)?X.state=se.PROC_INST_BODY:X.procInstName+=ce;continue;case se.PROC_INST_BODY:if(!X.procInstBody&&E(ce))continue;"?"===ce?X.state=se.PROC_INST_ENDING:X.procInstBody+=ce;continue;case se.PROC_INST_ENDING:">"===ce?(te(X,"onprocessinginstruction",{name:X.procInstName,body:X.procInstBody}),X.procInstName=X.procInstBody="",X.state=se.TEXT):(X.procInstBody+="?"+ce,X.state=se.PROC_INST_BODY);continue;case se.OPEN_TAG:ue(D,ce)?X.tagName+=ce:(Je(X),">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:(E(ce)||Ze(X,"Invalid character in tag name"),X.state=se.ATTRIB));continue;case se.OPEN_TAG_SLASH:">"===ce?(Le(X,!0),Ee(X)):(Ze(X,"Forward-slash in opening tag not followed by >"),X.state=se.ATTRIB);continue;case se.ATTRIB:if(E(ce))continue;">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(Y,ce)?(X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME:"="===ce?X.state=se.ATTRIB_VALUE:">"===ce?(Ze(X,"Attribute without value"),X.attribValue=X.attribName,je(X),Le(X)):E(ce)?X.state=se.ATTRIB_NAME_SAW_WHITE:ue(D,ce)?X.attribName+=ce:Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME_SAW_WHITE:if("="===ce)X.state=se.ATTRIB_VALUE;else{if(E(ce))continue;Ze(X,"Attribute without value"),X.tag.attributes[X.attribName]="",X.attribValue="",te(X,"onattribute",{name:X.attribName,value:""}),X.attribName="",">"===ce?Le(X):ue(Y,ce)?(X.attribName=ce,X.state=se.ATTRIB_NAME):(Ze(X,"Invalid attribute name"),X.state=se.ATTRIB)}continue;case se.ATTRIB_VALUE:if(E(ce))continue;U(ce)?(X.q=ce,X.state=se.ATTRIB_VALUE_QUOTED):(Ze(X,"Unquoted attribute value"),X.state=se.ATTRIB_VALUE_UNQUOTED,X.attribValue=ce);continue;case se.ATTRIB_VALUE_QUOTED:if(ce!==X.q){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_Q:X.attribValue+=ce;continue}je(X),X.q="",X.state=se.ATTRIB_VALUE_CLOSED;continue;case se.ATTRIB_VALUE_CLOSED:E(ce)?X.state=se.ATTRIB:">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(Y,ce)?(Ze(X,"No whitespace between attributes"),X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_VALUE_UNQUOTED:if(!ie(ce)){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_U:X.attribValue+=ce;continue}je(X),">"===ce?Le(X):X.state=se.ATTRIB;continue;case se.CLOSE_TAG:if(X.tagName)">"===ce?Ee(X):ue(D,ce)?X.tagName+=ce:X.script?(X.script+=""===ce?Ee(X):Ze(X,"Invalid characters in closing tag");continue;case se.TEXT_ENTITY:case se.ATTRIB_VALUE_ENTITY_Q:case se.ATTRIB_VALUE_ENTITY_U:var pt,fe;switch(X.state){case se.TEXT_ENTITY:pt=se.TEXT,fe="textNode";break;case se.ATTRIB_VALUE_ENTITY_Q:pt=se.ATTRIB_VALUE_QUOTED,fe="attribValue";break;case se.ATTRIB_VALUE_ENTITY_U:pt=se.ATTRIB_VALUE_UNQUOTED,fe="attribValue"}";"===ce?(X[fe]+=Re(X),X.entity="",X.state=pt):ue(X.entity.length?Q:F,ce)?X.entity+=ce:(Ze(X,"Invalid character in entity name"),X[fe]+="&"+X.entity+ce,X.entity="",X.state=pt);continue;default:throw new Error(X,"Unknown state: "+X.state)}return X.position>=X.bufferCheckPosition&&function(z){for(var X=Math.max(V.MAX_BUFFER_LENGTH,10),be=0,ce=0,Pe=L.length;ceX)switch(L[ce]){case"textNode":ye(z);break;case"cdata":te(z,"oncdata",z.cdata),z.cdata="";break;case"script":te(z,"onscript",z.script),z.script="";break;default:Ve(z,"Max buffer length exceeded: "+L[ce])}be=Math.max(be,wt)}z.bufferCheckPosition=V.MAX_BUFFER_LENGTH-be+z.position}(X),X},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(z){ye(z),""!==z.cdata&&(te(z,"oncdata",z.cdata),z.cdata=""),""!==z.script&&(te(z,"onscript",z.script),z.script="")}(this)}};try{O=K("stream").Stream}catch(z){O=function(){}}var T=V.EVENTS.filter(function(z){return"error"!==z&&"end"!==z});function y(z,X){if(!(this instanceof y))return new y(z,X);O.apply(this),this._parser=new re(z,X),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ce){be.emit("error",ce),be._parser.error=null},this._decoder=null,T.forEach(function(ce){Object.defineProperty(be,"on"+ce,{get:function(){return be._parser["on"+ce]},set:function(Pe){if(!Pe)return be.removeAllListeners(ce),be._parser["on"+ce]=Pe,Pe;be.on(ce,Pe)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(O.prototype,{constructor:{value:y}})).write=function(z){if("function"==typeof q&&"function"==typeof q.isBuffer&&q.isBuffer(z)){if(!this._decoder){var X=K("string_decoder").StringDecoder;this._decoder=new X("utf8")}z=this._decoder.write(z)}return this._parser.write(z.toString()),this.emit("data",z),!0},y.prototype.end=function(z){return z&&z.length&&this.write(z),this._parser.end(),!0},y.prototype.on=function(z,X){var be=this;return!be._parser["on"+z]&&-1!==T.indexOf(z)&&(be._parser["on"+z]=function(){var ce=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ce.splice(0,0,z),be.emit.apply(be,ce)}),O.prototype.on.call(be,z,X)};var j="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",H={xml:j,xmlns:I},Y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(z){return" "===z||"\n"===z||"\r"===z||"\t"===z}function U(z){return'"'===z||"'"===z}function ie(z){return">"===z||E(z)}function ue(z,X){return z.test(X)}function ee(z,X){return!ue(z,X)}var z,X,be,se=0;for(var Te in V.STATE={BEGIN:se++,BEGIN_WHITESPACE:se++,TEXT:se++,TEXT_ENTITY:se++,OPEN_WAKA:se++,SGML_DECL:se++,SGML_DECL_QUOTED:se++,DOCTYPE:se++,DOCTYPE_QUOTED:se++,DOCTYPE_DTD:se++,DOCTYPE_DTD_QUOTED:se++,COMMENT_STARTING:se++,COMMENT:se++,COMMENT_ENDING:se++,COMMENT_ENDED:se++,CDATA:se++,CDATA_ENDING:se++,CDATA_ENDING_2:se++,PROC_INST:se++,PROC_INST_BODY:se++,PROC_INST_ENDING:se++,OPEN_TAG:se++,OPEN_TAG_SLASH:se++,ATTRIB:se++,ATTRIB_NAME:se++,ATTRIB_NAME_SAW_WHITE:se++,ATTRIB_VALUE:se++,ATTRIB_VALUE_QUOTED:se++,ATTRIB_VALUE_CLOSED:se++,ATTRIB_VALUE_UNQUOTED:se++,ATTRIB_VALUE_ENTITY_Q:se++,ATTRIB_VALUE_ENTITY_U:se++,CLOSE_TAG:se++,CLOSE_TAG_SAW_WHITE:se++,SCRIPT:se++,SCRIPT_ENDING:se++},V.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(V.ENTITIES).forEach(function(z){var X=V.ENTITIES[z],be="number"==typeof X?String.fromCharCode(X):X;V.ENTITIES[z]=be}),V.STATE)V.STATE[V.STATE[Te]]=Te;function me(z,X,be){z[X]&&z[X](be)}function te(z,X,be){z.textNode&&ye(z),me(z,X,be)}function ye(z){z.textNode=De(z.opt,z.textNode),z.textNode&&me(z,"ontext",z.textNode),z.textNode=""}function De(z,X){return z.trim&&(X=X.trim()),z.normalize&&(X=X.replace(/\s+/g," ")),X}function Ve(z,X){return ye(z),z.trackPosition&&(X+="\nLine: "+z.line+"\nColumn: "+z.column+"\nChar: "+z.c),X=new Error(X),z.error=X,me(z,"onerror",X),z}function nt(z){return z.sawRoot&&!z.closedRoot&&Ze(z,"Unclosed root tag"),z.state!==se.BEGIN&&z.state!==se.BEGIN_WHITESPACE&&z.state!==se.TEXT&&Ve(z,"Unexpected end"),ye(z),z.c="",z.closed=!0,me(z,"onend"),re.call(z,z.strict,z.opt),z}function Ze(z,X){if("object"!=typeof z||!(z instanceof re))throw new Error("bad call to strictFail");z.strict&&Ve(z,X)}function Je(z){z.strict||(z.tagName=z.tagName[z.looseCase]());var X=z.tags[z.tags.length-1]||z,be=z.tag={name:z.tagName,attributes:{}};z.opt.xmlns&&(be.ns=X.ns),z.attribList.length=0,te(z,"onopentagstart",be)}function Ye(z,X){var ce=z.indexOf(":")<0?["",z]:z.split(":"),Pe=ce[0],wt=ce[1];return X&&"xmlns"===z&&(Pe="xmlns",wt=""),{prefix:Pe,local:wt}}function je(z){if(z.strict||(z.attribName=z.attribName[z.looseCase]()),-1!==z.attribList.indexOf(z.attribName)||z.tag.attributes.hasOwnProperty(z.attribName))z.attribName=z.attribValue="";else{if(z.opt.xmlns){var X=Ye(z.attribName,!0),ce=X.local;if("xmlns"===X.prefix)if("xml"===ce&&z.attribValue!==j)Ze(z,"xml: prefix must be bound to "+j+"\nActual: "+z.attribValue);else if("xmlns"===ce&&z.attribValue!==I)Ze(z,"xmlns: prefix must be bound to "+I+"\nActual: "+z.attribValue);else{var Pe=z.tag,wt=z.tags[z.tags.length-1]||z;Pe.ns===wt.ns&&(Pe.ns=Object.create(wt.ns)),Pe.ns[ce]=z.attribValue}z.attribList.push([z.attribName,z.attribValue])}else z.tag.attributes[z.attribName]=z.attribValue,te(z,"onattribute",{name:z.attribName,value:z.attribValue});z.attribName=z.attribValue=""}}function Le(z,X){if(z.opt.xmlns){var be=z.tag,ce=Ye(z.tagName);be.prefix=ce.prefix,be.local=ce.local,be.uri=be.ns[ce.prefix]||"",be.prefix&&!be.uri&&(Ze(z,"Unbound namespace prefix: "+JSON.stringify(z.tagName)),be.uri=ce.prefix),be.ns&&(z.tags[z.tags.length-1]||z).ns!==be.ns&&Object.keys(be.ns).forEach(function(Tn){te(z,"onopennamespace",{prefix:Tn,uri:be.ns[Tn]})});for(var wt=0,pt=z.attribList.length;wt",z.tagName="",void(z.state=se.SCRIPT);te(z,"onscript",z.script),z.script=""}var X=z.tags.length,be=z.tagName;z.strict||(be=be[z.looseCase]());for(var ce=be;X--&&z.tags[X].name!==ce;)Ze(z,"Unexpected close tag");if(X<0)return Ze(z,"Unmatched closing tag: "+z.tagName),z.textNode+="",void(z.state=se.TEXT);z.tagName=be;for(var wt=z.tags.length;wt-- >X;){var pt=z.tag=z.tags.pop();z.tagName=z.tag.name,te(z,"onclosetag",z.tagName);var fe={};for(var B in pt.ns)fe[B]=pt.ns[B];z.opt.xmlns&&pt.ns!==(z.tags[z.tags.length-1]||z).ns&&Object.keys(pt.ns).forEach(function(k){te(z,"onclosenamespace",{prefix:k,uri:pt.ns[k]})})}0===X&&(z.closedRoot=!0),z.tagName=z.attribValue=z.attribName="",z.attribList.length=0,z.state=se.TEXT}function Re(z){var ce,X=z.entity,be=X.toLowerCase(),Pe="";return z.ENTITIES[X]?z.ENTITIES[X]:z.ENTITIES[be]?z.ENTITIES[be]:("#"===(X=be).charAt(0)&&("x"===X.charAt(1)?(X=X.slice(2),Pe=(ce=parseInt(X,16)).toString(16)):(X=X.slice(1),Pe=(ce=parseInt(X,10)).toString(10))),X=X.replace(/^0+/,""),isNaN(ce)||Pe.toLowerCase()!==X?(Ze(z,"Invalid character entity"),"&"+z.entity+";"):String.fromCodePoint(ce))}function Ue(z,X){"<"===X?(z.state=se.OPEN_WAKA,z.startTagPosition=z.position):E(X)||(Ze(z,"Non-whitespace before first tag."),z.textNode=X,z.state=se.TEXT)}function qe(z,X){var be="";return X1114111||X(k)!==k)throw RangeError("Invalid code point: "+k);k<=65535?Pe.push(k):Pe.push(55296+((k-=65536)>>10),k%1024+56320),(fe+1===B||Pe.length>ce)&&(R+=z.apply(null,Pe),Pe.length=0)}return R},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,K("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(K,Ae,he){(function(q,V){(function(){!function(L,re){"use strict";if(!L.setImmediate){var T,$=1,b={},S=!1,O=L.document,Q=Object.getPrototypeOf&&Object.getPrototypeOf(L);Q=Q&&Q.setTimeout?Q:L,"[object process]"==={}.toString.call(L.process)?T=function(E){q.nextTick(function(){M(E)})}:function(){if(L.postMessage&&!L.importScripts){var E=!0,U=L.onmessage;return L.onmessage=function(){E=!1},L.postMessage("","*"),L.onmessage=U,E}}()?(E="setImmediate$"+Math.random()+"$",U=function(ie){ie.source===L&&"string"==typeof ie.data&&0===ie.data.indexOf(E)&&M(+ie.data.slice(E.length))},L.addEventListener?L.addEventListener("message",U,!1):L.attachEvent("onmessage",U),T=function(ie){L.postMessage(E+ie,"*")}):L.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function(U){M(U.data)},T=function(U){E.port2.postMessage(U)}}():O&&"onreadystatechange"in O.createElement("script")?function(){var E=O.documentElement;T=function(U){var ie=O.createElement("script");ie.onreadystatechange=function(){M(U),ie.onreadystatechange=null,E.removeChild(ie),ie=null},E.appendChild(ie)}}():T=function(E){setTimeout(M,0,E)},Q.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var U=new Array(arguments.length-1),ie=0;ie=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},v))},he.setImmediate="function"==typeof q?q:function(T){var v=S++,y=!(arguments.length<2)&&$.call(arguments,1);return b[v]=!0,L(function(){b[v]&&(y?T.apply(null,y):T.call(null),he.clearImmediate(v))}),v},he.clearImmediate="function"==typeof V?V:function(T){delete b[T]}}).call(this)}).call(this,K("timers").setImmediate,K("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(K,Ae,he){(function(q){(function(){function L(re){try{if(!q.localStorage)return!1}catch(b){return!1}var $=q.localStorage[re];return null!=$&&"true"===String($).toLowerCase()}Ae.exports=function(re,$){if(L("noDeprecation"))return re;var b=!1;return function(){if(!b){if(L("throwDeprecation"))throw new Error($);L("traceDeprecation")?console.trace($):console.warn($),b=!0}return re.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(K,Ae,he){"use strict";Ae.exports=function(q){q.prototype[Symbol.iterator]=function*(){for(let V=this.head;V;V=V.next)yield V.value}}},{}],92:[function(K,Ae,he){"use strict";function q(b){var S=this;if(S instanceof q||(S=new q),S.tail=null,S.head=null,S.length=0,b&&"function"==typeof b.forEach)b.forEach(function(v){S.push(v)});else if(arguments.length>0)for(var O=0,T=arguments.length;O1)O=S;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");T=this.head.next,O=this.head.value}for(var v=0;null!==T;v++)O=b(O,T.value,v),T=T.next;return O},q.prototype.reduceReverse=function(b,S){var O,T=this.tail;if(arguments.length>1)O=S;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");T=this.tail.prev,O=this.tail.value}for(var v=this.length-1;null!==T;v--)O=b(O,T.value,v),T=T.prev;return O},q.prototype.toArray=function(){for(var b=new Array(this.length),S=0,O=this.head;null!==O;S++)b[S]=O.value,O=O.next;return b},q.prototype.toArrayReverse=function(){for(var b=new Array(this.length),S=0,O=this.tail;null!==O;S++)b[S]=O.value,O=O.prev;return b},q.prototype.slice=function(b,S){(S=S||this.length)<0&&(S+=this.length),(b=b||0)<0&&(b+=this.length);var O=new q;if(Sthis.length&&(S=this.length);for(var T=0,v=this.head;null!==v&&Tthis.length&&(S=this.length);for(var T=this.length,v=this.tail;null!==v&&T>S;T--)v=v.prev;for(;null!==v&&T>b;T--,v=v.prev)O.push(v.value);return O},q.prototype.splice=function(b,S,...O){b>this.length&&(b=this.length-1),b<0&&(b=this.length+b);for(var T=0,v=this.head;null!==v&&T{kt.exports=function(tt,gt){var J=gt.length;if(0!==J){var At=tt.length;tt.length+=J;for(var dt=0;dt{"use strict";var gt=(()=>{return(At=gt||(gt={})).typeOfFunction="function",At.boolTrue=!0,gt;var At})();function J(At,dt,K){if(!K||typeof K.value!==gt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:gt.boolTrue,get:function(){var Ae=K.value.bind(this);return Object.defineProperty(this,dt,{value:Ae,configurable:gt.boolTrue,writable:gt.boolTrue}),Ae}}}it.ak=J,it.ZP=J},266:(kt,it,tt)=>{kt.exports={ResizeSensor:tt(835),ElementQueries:tt(845)}},845:function(kt,it,tt){"use strict";var gt,J,At;"undefined"!=typeof window&&window,J=[tt(835)],void 0!==(At="function"==typeof(gt=function(dt){var K=function(){var he,q={},V=[];function L(D){D||(D=document.documentElement);var F=window.getComputedStyle(D,null).fontSize;return parseFloat(F)||16}function $(D,F){var Q=F.split(/\d/),E=Q[Q.length-1];switch(F=parseFloat(F),E){case"px":return F;case"em":return F*L(D);case"rem":return F*L();case"vw":return F*document.documentElement.clientWidth/100;case"vh":return F*document.documentElement.clientHeight/100;case"vmin":case"vmax":var U=document.documentElement.clientWidth/100,ie=document.documentElement.clientHeight/100;return F*(0,Math["vmin"===E?"min":"max"])(U,ie);default:return F}}function b(D,F){this.element=D;var Q,E,U,ie,ue,ee,se,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(Q in U=function(D){if(!D.getBoundingClientRect)return{width:D.offsetWidth,height:D.offsetHeight};var F=D.getBoundingClientRect();return{width:Math.round(F.width),height:Math.round(F.height)}}(this.element),ee={},q[F])!q[F].hasOwnProperty(Q)||(ie=$(this.element,(E=q[F][Q]).value),ue="width"===E.property?U.width:U.height,se="","min"===E.mode&&ue>=ie&&(se+=E.value),"max"===E.mode&&ue<=ie&&(se+=E.value),ee[Te=E.mode+"-"+E.property]||(ee[Te]=""),se&&-1===(" "+ee[Te]+" ").indexOf(" "+se+" ")&&(ee[Te]+=" "+se));for(var te in me)!me.hasOwnProperty(te)||(ee[me[te]]?this.element.setAttribute(me[te],ee[me[te]].substr(1)):this.element.removeAttribute(me[te]))}}function S(D,F){D.elementQueriesSetupInformation||(D.elementQueriesSetupInformation=new b(D,F)),D.elementQueriesSensor||(D.elementQueriesSensor=new dt(D,function(){D.elementQueriesSetupInformation.call()}))}function O(D,F,Q,E){if(void 0===q[D]){q[D]=[];var U=V.length;he.innerHTML+="\n"+D+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+D+" > .resize-sensor {min-width: "+U+"px;}",V.push(D)}q[D].push({mode:F,property:Q,value:E})}function T(D){var F;if(document.querySelectorAll&&(F=D?D.querySelectorAll.bind(D):document.querySelectorAll.bind(document)),!F&&"undefined"!=typeof $$&&(F=$$),!F&&"undefined"!=typeof jQuery&&(F=jQuery),!F)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return F}function y(D){var F=[],Q=[],E=[],U=0,ie=-1,ue=[];for(var ee in D.children)if(D.children.hasOwnProperty(ee)&&D.children[ee].tagName&&"img"===D.children[ee].tagName.toLowerCase()){F.push(D.children[ee]);var se=D.children[ee].getAttribute("min-width")||D.children[ee].getAttribute("data-min-width"),Te=D.children[ee].getAttribute("data-src")||D.children[ee].getAttribute("url");E.push(Te),Q.push({minWidth:se}),se?D.children[ee].style.display="none":(U=F.length-1,D.children[ee].style.display="block")}function te(){var De,ye=!1;for(De in F)!F.hasOwnProperty(De)||Q[De].minWidth&&D.offsetWidth>Q[De].minWidth&&(ye=De);if(ye||(ye=U),ie!==ye)if(ue[ye])F[ie].style.display="none",F[ye].style.display="block",ie=ye;else{var Ve=new Image;Ve.onload=function(){F[ye].src=E[ye],F[ie].style.display="none",F[ye].style.display="block",ue[ye]=!0,ie=ye},Ve.src=E[ye]}else F[ye].src=E[ye]}ie=U,D.resizeSensorInstance=new dt(D,te),te()}var M=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,j=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function I(D){var F,Q,E,U;for(D=D.replace(/'/g,'"');null!==(F=M.exec(D));)for(Q=F[1]+F[3],E=F[2];null!==(U=j.exec(E));)O(Q,U[1],U[2],U[3])}function H(D){var F="";if(D)if("string"==typeof D)(-1!==(D=D.toLowerCase()).indexOf("min-width")||-1!==D.indexOf("max-width"))&&I(D);else for(var Q=0,E=D.length;Q img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",he.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(he),Y=!0);for(var F=0,Q=document.styleSheets.length;F{var gt=tt(910),J=tt(369),At=tt(322);function dt(re,$,b){if(!gt(re))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!re.hasNode($))throw new Error('graphology-shortest-path: the "'+$+'" source node does not exist in the given graph.');if(!re.hasNode(b))throw new Error('graphology-shortest-path: the "'+b+'" target node does not exist in the given graph.');if(($=""+$)==(b=""+b))return[$];var S=re.inboundNeighbors.bind(re),O=re.outboundNeighbors.bind(re),T={},v={};T[$]=null,v[b]=null;var M,j,I,H,Y,D,F,Q,y=[$],w=[b],E=!1;e:for(;y.length&&w.length;)if(y.length<=w.length){for(M=y,y=[],Y=0,F=M.length;Y{kt.exports=function(tt){return null!==tt&&"object"==typeof tt&&"function"==typeof tt.addUndirectedEdgeWithKey&&"function"==typeof tt.dropNode&&"boolean"==typeof tt.multi}},698:function(kt){kt.exports=function(){"use strict";function it(ne){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(de){return typeof de}:function(de){return de&&"function"==typeof Symbol&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de})(ne)}function tt(ne,de){ne.prototype=Object.create(de.prototype),ne.prototype.constructor=ne,J(ne,de)}function gt(ne){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)})(ne)}function J(ne,de){return(J=Object.setPrototypeOf||function(oe,C){return oe.__proto__=C,oe})(ne,de)}function At(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(ne){return!1}}function dt(ne,de,oe){return(dt=At()?Reflect.construct:function(C,P,Z){var we=[null];we.push.apply(we,P);var Fe=new(Function.bind.apply(C,we));return Z&&J(Fe,Z.prototype),Fe}).apply(null,arguments)}function K(ne){var de="function"==typeof Map?new Map:void 0;return(K=function(oe){if(null===oe||-1===Function.toString.call(oe).indexOf("[native code]"))return oe;if("function"!=typeof oe)throw new TypeError("Super expression must either be null or a function");if(void 0!==de){if(de.has(oe))return de.get(oe);de.set(oe,P)}function P(){return dt(oe,arguments,gt(this).constructor)}return P.prototype=Object.create(oe.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),J(P,oe)})(ne)}function Ae(ne){if(void 0===ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ne}var he=function(){for(var ne=arguments[0],de=1,oe=arguments.length;de0&&we.length>P&&!we.warned){we.warned=!0;var et=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(de)+" listeners added. Use emitter.setMaxListeners() to increase limit");et.name="MaxListenersExceededWarning",et.emitter=ne,et.type=de,et.count=we.length,console&&console.warn&&console.warn(et)}return ne}function D(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F(ne,de,oe){var C={fired:!1,wrapFn:void 0,target:ne,type:de,listener:oe},P=D.bind(C);return P.listener=oe,C.wrapFn=P,P}function Q(ne,de,oe){var C=ne._events;if(void 0===C)return[];var P=C[de];return void 0===P?[]:"function"==typeof P?oe?[P.listener||P]:[P]:oe?function(Z){for(var we=new Array(Z.length),Fe=0;Fe0&&(Z=de[0]),Z instanceof Error)throw Z;var we=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw we.context=Z,we}var Fe=P[ne];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,de);else{var et=Fe.length,Dt=U(Fe,et);for(oe=0;oe=0;Z--)if(oe[Z]===de||oe[Z].listener===de){we=oe[Z].listener,P=Z;break}if(P<0)return this;0===P?oe.shift():function(Fe,et){for(;et+1=0;C--)this.removeListener(ne,de[C]);return this},M.prototype.listeners=function(ne){return Q(this,ne,!0)},M.prototype.rawListeners=function(ne){return Q(this,ne,!1)},M.listenerCount=function(ne,de){return"function"==typeof ne.listenerCount?ne.listenerCount(de):E.call(ne,de)},M.prototype.listenerCount=E,M.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]},ue.prototype.next=function(){if(this.done)return{done:!0};var ne=this._next();return ne.done&&(this.done=!0),ne},"undefined"!=typeof Symbol&&(ue.prototype[Symbol.iterator]=function(){return this}),ue.of=function(){var ne=arguments,de=ne.length,oe=0;return new ue(function(){return oe>=de?{done:!0}:{done:!1,value:ne[oe++]}})},ue.empty=function(){var ne=new ue(null);return ne.done=!0,ne},ue.is=function(ne){return ne instanceof ue||"object"==typeof ne&&null!==ne&&"function"==typeof ne.next};var ee=ue,se=function(ne,de){for(var oe,C=arguments.length>1?de:1/0,P=C!==1/0?new Array(C):[],Z=0;;){if(Z===C)return P;if((oe=ne.next()).done)return Z!==de?P.slice(0,Z):P;P[Z++]=oe.value}},Te=function(ne){function de(oe,C){var P;return(P=ne.call(this)||this).name="GraphError",P.message=oe||"",P.data=C||{},P}return tt(de,ne),de}(K(Error)),me=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),te=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),ye=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te);function De(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ve(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function nt(ne,de){this.key=ne,this.attributes=de,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Ze(ne,de,oe,C,P,Z){this.key=de,this.attributes=Z,this.undirected=ne,this.source=C,this.target=P,this.generatedKey=oe}function Je(ne,de,oe,C,P,Z,we){var Fe,et,Dt="out",We="in";if(de&&(Dt=We="undirected"),ne.multi){if(void 0===(et=(Fe=Z[Dt])[P])&&(et=new Set,Fe[P]=et),et.add(oe),C===P&&de)return;void 0===(Fe=we[We])[C]&&(Fe[C]=et)}else{if(Z[Dt][P]=oe,C===P&&de)return;we[We][C]=oe}}function Ye(ne,de,oe){var C=ne.multi,P=oe.source,Z=oe.target,we=P.key,Fe=Z.key,et=P[de?"undirected":"out"],Dt=de?"undirected":"in";if(Fe in et)if(C){var We=et[Fe];1===We.size?(delete et[Fe],delete Z[Dt][we]):We.delete(oe)}else delete et[Fe];C||delete Z[Dt][we]}Ve.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},nt.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var je=[{name:function(ne){return"get".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes[P]}}},{name:function(ne){return"get".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C){var P;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Z=""+C,we=""+arguments[1];if(!(P=q(this,Z,we,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Z,'" - "').concat(we,'").'))}else if(!(P=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&P.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return P.attributes}}},{name:function(ne){return"has".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes.hasOwnProperty(P)}}},{name:function(ne){return"set".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=q(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"update".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=q(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("function"!=typeof Z)throw new me("Graph.".concat(de,": updater should be a function."));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z(we.attributes[P]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"remove".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return delete Z.attributes[P],this.emit("edgeAttributesUpdated",{key:Z.key,type:"remove",attributes:Z.attributes,name:P}),this}}},{name:function(ne){return"replace".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes=P,this.emit("edgeAttributesUpdated",{key:Z.key,type:"replace",attributes:Z.attributes}),this}}},{name:function(ne){return"merge".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=q(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return he(Z.attributes,P),this.emit("edgeAttributesUpdated",{key:Z.key,type:"merge",attributes:Z.attributes,data:P}),this}}}],Le=ee,Ee=function(){var ne,de=arguments,oe=-1;return new Le(function C(){if(!ne){if(++oe>=de.length)return{done:!0};ne=de[oe]}var P=ne.next();return P.done?(ne=null,C()):P})},Re=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Ue(ne,de){for(var oe in de)ne.push(de[oe].key)}function qe(ne,de){for(var oe in de)de[oe].forEach(function(C){return ne.push(C.key)})}function Be(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)}}function z(ne,de,oe){for(var C in ne)C!==oe&&ne[C].forEach(function(P){return de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function X(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];if(de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey))return!0}return!1}function be(ne,de,oe){var C,P,Z,we,Fe;for(var et in ne)if(et!==oe)for(C=ne[et].values();!0!==(P=C.next()).done;)if(we=(Z=P.value).source,de(Z.key,Z.attributes,we.key,(Fe=Z.target).key,we.attributes,Fe.attributes,Z.undirected,Z.generatedKey))return!0;return!1}function ce(ne,de){var oe=Object.keys(ne),C=oe.length,P=null,Z=0;return new ee(function we(){var Fe;if(P){var et=P.next();if(et.done)return P=null,Z++,we();Fe=et.value}else{if(Z>=C)return{done:!0};var Dt=oe[Z];if(Dt===de)return Z++,we();if((Fe=ne[Dt])instanceof Set)return P=Fe.values(),we();Z++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function Pe(ne,de,oe){var C=de[oe];C&&ne.push(C.key)}function wt(ne,de,oe){var C=de[oe];C&&C.forEach(function(P){return ne.push(P.key)})}function pt(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function fe(ne,de,oe){var C=ne[de];C&&C.forEach(function(P){return oe(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function B(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;return oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function R(ne,de,oe){var C=ne[de];if(C){for(var P,Z,we=C.values();!0!==(P=we.next()).done;)if(oe((Z=P.value).key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes,Z.undirected,Z.generatedKey))return!0;return!1}}function k(ne,de){var oe=ne[de];if(oe instanceof Set){var C=oe.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{done:!1,value:[Z.key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes]}})}return ee.of([oe.key,oe.attributes,oe.source.key,oe.target.key,oe.source.attributes,oe.target.attributes])}function Oe(ne,de){if(0===ne.size)return[];if("mixed"===de||de===ne.type)return"function"==typeof Array.from?Array.from(ne._edges.keys()):se(ne._edges.keys(),ne._edges.size);for(var oe,C,Z=new Array("undirected"===de?ne.undirectedSize:ne.directedSize),we="undirected"===de,Fe=ne._edges.values(),et=0;!0!==(oe=Fe.next()).done;)(C=oe.value).undirected===we&&(Z[et++]=C.key);return Z}function Xe(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var zt=P.source,Et=P.target;oe(P.key,P.attributes,zt.key,Et.key,zt.attributes,Et.attributes,P.undirected,P.generatedKey)}}function yt(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var zt=P.source,Et=P.target;if(oe(P.key,P.attributes,zt.key,Et.key,zt.attributes,Et.attributes,P.undirected,P.generatedKey))break}}function It(ne,de){if(0===ne.size)return ee.empty();var oe="mixed"!==de&&de!==ne.type,C="undirected"===de,P=ne._edges.values();return new ee(function(){for(var Z,we;;){if((Z=P.next()).done)return Z;if(we=Z.value,!oe||we.undirected===C)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function Tn(ne,de,oe,C){var P=[],Z=ne?qe:Ue;return"undirected"!==de&&("out"!==oe&&Z(P,C.in),"in"!==oe&&Z(P,C.out),!oe&&C.directedSelfLoops>0&&P.splice(P.lastIndexOf(C.key),1)),"directed"!==de&&Z(P,C.undirected),P}function Pn(ne,de,oe,C,P){var Z=ne?z:Be;"undirected"!==de&&("out"!==oe&&Z(C.in,P),"in"!==oe&&Z(C.out,P,oe?null:C.key)),"directed"!==de&&Z(C.undirected,P)}function Gn(ne,de,oe,C,P){var Z=ne?be:X;"undirected"!==de&&("out"!==oe&&Z(C.in,P)||"in"!==oe&&Z(C.out,P,oe?null:C.key))||"directed"===de||Z(C.undirected,P)}function yi(ne,de,oe){var C=ee.empty();return"undirected"!==ne&&("out"!==de&&void 0!==oe.in&&(C=Ee(C,ce(oe.in))),"in"!==de&&void 0!==oe.out&&(C=Ee(C,ce(oe.out,de?null:oe.key)))),"directed"!==ne&&void 0!==oe.undirected&&(C=Ee(C,ce(oe.undirected))),C}function hi(ne,de,oe,C,P){var Z=de?wt:Pe,we=[];return"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&Z(we,C.in,P),void 0!==C.out&&"in"!==oe&&Z(we,C.out,P),!oe&&C.directedSelfLoops>0&&we.splice(we.lastIndexOf(C.key),1)),"directed"!==ne&&void 0!==C.undirected&&Z(we,C.undirected,P),we}function Hr(ne,de,oe,C,P,Z){var we=de?fe:pt;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z),C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z)),"directed"!==ne&&void 0!==C.undirected&&we(C.undirected,P,Z)}function Ns(ne,de,oe,C,P,Z){var we=de?R:B;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z)||C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z,oe?null:C.key))||"directed"===ne||void 0===C.undirected||we(C.undirected,P,Z)}function cs(ne,de,oe,C){var P=ee.empty();return"undirected"!==ne&&(void 0!==oe.in&&"out"!==de&&C in oe.in&&(P=Ee(P,k(oe.in,C))),void 0!==oe.out&&"in"!==de&&C in oe.out&&(P=Ee(P,k(oe.out,C)))),"directed"!==ne&&void 0!==oe.undirected&&C in oe.undirected&&(P=Ee(P,k(oe.undirected,C))),P}var Ps=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Gr(ne,de){if(void 0!==de)for(var oe in de)ne.add(oe)}function qa(ne,de,oe){if("mixed"!==ne){if("undirected"===ne)return Object.keys(oe.undirected);if("string"==typeof de)return Object.keys(oe[de])}var C=new Set;return"undirected"!==ne&&("out"!==de&&Gr(C,oe.in),"in"!==de&&Gr(C,oe.out)),"directed"!==ne&&Gr(C,oe.undirected),se(C.values(),C.size)}function Al(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;oe(Fe.key,Fe.attributes)}}function ua(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;ne.has(et.key)||(ne.add(et.key),C(et.key,et.attributes))}}function ms(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;if(oe(Fe.key,Fe.attributes))return!0}return!1}function Qt(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;if(!ne.has(et.key)&&(ne.add(et.key),C(et.key,et.attributes)))return!0}return!1}function Ka(ne,de){var oe=Object.keys(de),C=oe.length,P=0;return new ee(function(){if(P>=C)return{done:!0};var Z=de[oe[P++]];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===ne?Z.target:we;return{done:!1,value:[et.key,et.attributes]}})}function rt(ne,de,oe){var C=Object.keys(oe),P=C.length,Z=0;return new ee(function we(){if(Z>=P)return{done:!0};var Fe=oe[C[Z++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var et=Fe.source,We=et===de?Fe.target:et;return ne.has(We.key)?we():(ne.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function ot(ne,de,oe,C,P){var Z=ne._nodes.get(C);if("undirected"!==de){if("out"!==oe&&void 0!==Z.in)for(var we in Z.in)if(we===P)return!0;if("in"!==oe&&void 0!==Z.out)for(var Fe in Z.out)if(Fe===P)return!0}if("directed"!==de&&void 0!==Z.undirected)for(var et in Z.undirected)if(et===P)return!0;return!1}function ke(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,We=de._nodes.values(),zt=de.type;!0!==(C=We.next()).done;){if(P=C.value,"undirected"!==zt)for(Z in we=P.out)if(et=(Fe=we[Z]).target,Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return;if("directed"!==zt)for(Z in we=P.undirected)if((et=(Fe=we[Z]).target).key!==Z&&(et=Fe.source),Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return}}function ct(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,We,zt,Et=de._nodes.values(),pn=de.type;!0!==(C=Et.next()).done;){if(P=C.value,"undirected"!==pn)for(Z in et=P.out)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if(We=(Dt=Fe.value).target,zt=oe(P.key,We.key,P.attributes,We.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&zt)return;if("directed"!==pn)for(Z in et=P.undirected)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if((We=(Dt=Fe.value).target).key!==Z&&(We=Dt.source),zt=oe(P.key,We.key,P.attributes,We.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&zt)return}}function Qe(ne,de){var oe={key:ne};return re(de.attributes)||(oe.attributes=he({},de.attributes)),oe}function vt(ne,de){var oe={source:de.source.key,target:de.target.key};return de.generatedKey||(oe.key=ne),re(de.attributes)||(oe.attributes=he({},de.attributes)),de.undirected&&(oe.undirected=!0),oe}function xt(ne){return L(ne)?"key"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?null:"invalid-attributes":"no-key":"not-object"}function Tt(ne){return L(ne)?"source"in ne?"target"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?"undirected"in ne&&"boolean"!=typeof ne.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var $t=new Set(["directed","undirected","mixed"]),jn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ii={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Dn(ne,de,oe){var C=new ne.NodeDataClass(de,oe);return ne._nodes.set(de,C),ne.emit("nodeAdded",{key:de,attributes:oe}),C}function fn(ne,de,oe,C,P,Z,we,Fe){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(Z=""+Z,we=""+we,Fe=Fe||{},!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var et=ne._nodes.get(Z),Dt=ne._nodes.get(we);if(!et)throw new te("Graph.".concat(de,': source node "').concat(Z,'" not found.'));if(!Dt)throw new te("Graph.".concat(de,': target node "').concat(we,'" not found.'));var We={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(We)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));if(!ne.multi&&(C?void 0!==et.undirected[we]:void 0!==et.out[we]))throw new ye("Graph.".concat(de,': an edge linking "').concat(Z,'" to "').concat(we,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var zt=new Ze(C,P,oe,et,Dt,Fe);return ne._edges.set(P,zt),Z===we?C?(et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(et.undirectedDegree++,Dt.undirectedDegree++):(et.outDegree++,Dt.inDegree++),Je(ne,C,zt,Z,we,et,Dt),C?ne._undirectedSize++:ne._directedSize++,We.key=P,ne.emit("edgeAdded",We),P}function zn(ne,de,oe,C,P,Z,we,Fe,et){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(et){if("function"!=typeof Fe)throw new me("Graph.".concat(de,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Dt;if(Z=""+Z,we=""+we,et&&(Dt=Fe,Fe=void 0),!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,zt,Et=ne._nodes.get(Z),pn=ne._nodes.get(we);if(!oe&&(We=ne._edges.get(P))){if(We.source.key!==Z||We.target.key!==we||C&&(We.source.key!==we||We.target.key!==Z))throw new ye("Graph.".concat(de,': inconsistency detected when attempting to merge the "').concat(P,'" edge with "').concat(Z,'" source & "').concat(we,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));zt=We}if(zt||ne.multi||!Et||(zt=C?Et.undirected[we]:Et.out[we]),zt)return(et?Dt:Fe)?(et?(zt.attributes=Dt(zt.attributes),ne.emit("edgeAttributesUpdated",{type:"replace",key:zt.key,attributes:zt.attributes})):(he(zt.attributes,Fe),ne.emit("edgeAttributesUpdated",{type:"merge",key:zt.key,attributes:zt.attributes,data:Fe})),zt.key):zt.key;Fe=Fe||{},et&&Dt&&(Fe=Dt(Fe));var Wr={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(Wr)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));return Et||(Et=Dn(ne,Z,{}),Z===we&&(pn=Et)),pn||(pn=Dn(ne,we,{})),We=new Ze(C,P,oe,Et,pn,Fe),ne._edges.set(P,We),Z===we?C?(Et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(Et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(Et.undirectedDegree++,pn.undirectedDegree++):(Et.outDegree++,pn.inDegree++),Je(ne,C,We,Z,we,Et,pn),C?ne._undirectedSize++:ne._directedSize++,Wr.key=P,ne.emit("edgeAdded",Wr),P}var ne,bn=function(ne){function de(C){var P;if(P=ne.call(this)||this,(C=he({},ii,C)).edgeKeyGenerator&&"function"!=typeof C.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(C.edgeKeyGenerator,'".'));if("boolean"!=typeof C.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(C.multi,'".'));if(!$t.has(C.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(C.type,'".'));if("boolean"!=typeof C.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(C.allowSelfLoops,'".'));var Z,we="mixed"===C.type?De:"directed"===C.type?Ve:nt;return $(Ae(P),"NodeDataClass",we),$(Ae(P),"_attributes",{}),$(Ae(P),"_nodes",new Map),$(Ae(P),"_edges",new Map),$(Ae(P),"_directedSize",0),$(Ae(P),"_undirectedSize",0),$(Ae(P),"_directedSelfLoopCount",0),$(Ae(P),"_undirectedSelfLoopCount",0),$(Ae(P),"_edgeKeyGenerator",C.edgeKeyGenerator||(Z=0,function(){return Z++})),$(Ae(P),"_options",C),jn.forEach(function(Fe){return $(Ae(P),Fe,P[Fe])}),b(Ae(P),"order",function(){return P._nodes.size}),b(Ae(P),"size",function(){return P._edges.size}),b(Ae(P),"directedSize",function(){return P._directedSize}),b(Ae(P),"undirectedSize",function(){return P._undirectedSize}),b(Ae(P),"selfLoopCount",function(){return P._directedSelfLoopCount+P._undirectedSelfLoopCount}),b(Ae(P),"directedSelfLoopCount",function(){return P._directedSelfLoopCount}),b(Ae(P),"undirectedSelfLoopCount",function(){return P._undirectedSelfLoopCount}),b(Ae(P),"multi",P._options.multi),b(Ae(P),"type",P._options.type),b(Ae(P),"allowSelfLoops",P._options.allowSelfLoops),b(Ae(P),"implementation",function(){return"graphology"}),P}tt(de,ne);var oe=de.prototype;return oe.hasNode=function(C){return this._nodes.has(""+C)},oe.hasDirectedEdge=function(C,P){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&!we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.out[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasUndirectedEdge=function(C,P){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.undirected[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasEdge=function(C,P){if(1===arguments.length)return this._edges.has(""+C);if(2===arguments.length){P=""+P;var we=this._nodes.get(C=""+C);if(!we)return!1;var Fe=void 0!==we.out&&we.out[P];return Fe||(Fe=void 0!==we.undirected&&we.undirected[P]),!(!Fe||this.multi&&!Fe.size)}throw new me("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.directedEdge=function(C,P){if("undirected"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.directedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.directedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||void 0;return we?we.key:void 0}},oe.undirectedEdge=function(C,P){if("directed"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.undirectedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.undirectedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.undirected&&Z.undirected[P]||void 0;return we?we.key:void 0}},oe.edge=function(C,P){if(this.multi)throw new ye("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");P=""+P;var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.edge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.edge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||Z.undirected&&Z.undirected[P]||void 0;if(we)return we.key},oe.inDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.inDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.inDegree+(P?Z.directedSelfLoops:0)},oe.outDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.outDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.outDegree+(P?Z.directedSelfLoops:0)},oe.directedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.directedDegree: could not find the "'.concat(C,'" node in the graph.'));if("undirected"===this.type)return 0;var we=P?Z.directedSelfLoops:0;return Z.inDegree+we+(Z.outDegree+we)},oe.undirectedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.undirectedDegree: could not find the "'.concat(C,'" node in the graph.'));return"directed"===this.type?0:Z.undirectedDegree+2*(P?Z.undirectedSelfLoops:0)},oe.degree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.degree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.degree: could not find the "'.concat(C,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(P&&(Fe=Z.undirectedSelfLoops),we+=Z.undirectedDegree+2*Fe),"undirected"!==this.type&&(P&&(Fe=Z.directedSelfLoops),we+=Z.inDegree+Z.outDegree+2*Fe),we},oe.source=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.source: could not find the "'.concat(C,'" edge in the graph.'));return P.source.key},oe.target=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.target: could not find the "'.concat(C,'" edge in the graph.'));return P.target.key},oe.extremities=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.extremities: could not find the "'.concat(C,'" edge in the graph.'));return[P.source.key,P.target.key]},oe.opposite=function(C,P){C=""+C;var Z=this._edges.get(P=""+P);if(!Z)throw new te('Graph.opposite: could not find the "'.concat(P,'" edge in the graph.'));var we=Z.source.key,Fe=Z.target.key;if(C!==we&&C!==Fe)throw new te('Graph.opposite: the "'.concat(C,'" node is not attached to the "').concat(P,'" edge (').concat(we,", ").concat(Fe,")."));return C===we?Fe:we},oe.hasExtremity=function(C,P){P=""+P;var Z=this._edges.get(C=""+C);if(!Z)throw new te('Graph.hasExtremity: could not find the "'.concat(C,'" edge in the graph.'));return Z.source.key===P||Z.target.key===P},oe.isUndirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isUndirected: could not find the "'.concat(C,'" edge in the graph.'));return P.undirected},oe.isDirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isDirected: could not find the "'.concat(C,'" edge in the graph.'));return!P.undirected},oe.isSelfLoop=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isSelfLoop: could not find the "'.concat(C,'" edge in the graph.'));return P.source===P.target},oe.hasGeneratedKey=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.hasGeneratedKey: could not find the "'.concat(C,'" edge in the graph.'));return P.generatedKey},oe.addNode=function(C,P){return function(Z,we,Fe){if(Fe&&!L(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},Z._nodes.has(we=""+we))throw new ye('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var et=new Z.NodeDataClass(we,Fe);return Z._nodes.set(we,et),Z.emit("nodeAdded",{key:we,attributes:Fe}),et}(this,C,P).key},oe.mergeNode=function(C,P){if(P&&!L(P))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(P,'"'));P=P||{};var Z=this._nodes.get(C=""+C);return Z?(P&&(he(Z.attributes,P),this.emit("nodeAttributesUpdated",{type:"merge",key:C,attributes:Z.attributes,data:P})),C):(Z=new this.NodeDataClass(C,P),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:P}),C)},oe.updateNode=function(C,P){if(P&&"function"!=typeof P)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(P,'"'));var Z=this._nodes.get(C=""+C);if(Z)return P&&(Z.attributes=P(Z.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:C,attributes:Z.attributes})),C;var Fe=P?P({}):{};return Z=new this.NodeDataClass(C,Fe),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:Fe}),C},oe.dropNode=function(C){var P=this,Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.dropNode: could not find the "'.concat(C,'" node in the graph.'));this.forEachEdge(C,function(we){P.dropEdge(we)}),this._nodes.delete(C),this.emit("nodeDropped",{key:C,attributes:Z.attributes})},oe.dropEdge=function(C){var P;if(arguments.length>1){var Z=""+arguments[0],we=""+arguments[1];if(!(P=q(this,Z,we,this.type)))throw new te('Graph.dropEdge: could not find the "'.concat(Z,'" -> "').concat(we,'" edge in the graph.'))}else if(!(P=this._edges.get(C=""+C)))throw new te('Graph.dropEdge: could not find the "'.concat(C,'" edge in the graph.'));this._edges.delete(P.key);var et=P.source,Dt=P.target,We=P.attributes,zt=P.undirected;return et===Dt?zt?(et.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(et.directedSelfLoops--,this._directedSelfLoopCount--):zt?(et.undirectedDegree--,Dt.undirectedDegree--):(et.outDegree--,Dt.inDegree--),Ye(this,zt,P),zt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:C,attributes:We,source:et.key,target:Dt.key,undirected:zt}),this},oe.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},oe.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},oe.getAttribute=function(C){return this._attributes[C]},oe.getAttributes=function(){return this._attributes},oe.hasAttribute=function(C){return this._attributes.hasOwnProperty(C)},oe.setAttribute=function(C,P){return this._attributes[C]=P,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.updateAttribute=function(C,P){if("function"!=typeof P)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[C]=P(this._attributes[C]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.removeAttribute=function(C){return delete this._attributes[C],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:C}),this},oe.replaceAttributes=function(C){if(!L(C))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=C,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},oe.mergeAttributes=function(C){if(!L(C))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,C),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:C}),this},oe.getNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.getNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes[P]},oe.getNodeAttributes=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.getNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));return P.attributes},oe.hasNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes.hasOwnProperty(P)},oe.setNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.setNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return we.attributes[P]=Z,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.updateNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.updateNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof Z)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,et=Z(Fe[P]);return Fe[P]=et,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.removeNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return delete Z.attributes[P],this.emit("nodeAttributesUpdated",{key:C,type:"remove",attributes:Z.attributes,name:P}),this},oe.replaceNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.replaceNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return Z.attributes=P,this.emit("nodeAttributesUpdated",{key:C,type:"replace",attributes:Z.attributes}),this},oe.mergeNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.mergeNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(Z.attributes,P),this.emit("nodeAttributesUpdated",{key:C,type:"merge",attributes:Z.attributes,data:P}),this},oe.updateEachNodeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._nodes.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:P||null})},oe.updateEachEdgeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._edges.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:P||null})},oe.forEach=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?ct(!1,this,C):ke(!1,this,C)},oe.forEachUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?ct(!0,this,C):ke(!0,this,C)},oe.adjacency=function(){return this.multi?(et=(C=this)._nodes.values(),Dt=C.type,We="outer",zt=null,new ee(function Et(){var pn;if("outer"===We)return!0===(pn=et.next()).done?pn:(P=pn.value,We="directed",Et());if("directed"===We)return"undirected"===Dt?(We="undirected",Et()):(we=P.out,Z=Object.keys(P.out),Fe=0,We="inner-directed",Et());if("undirected"===We){if("directed"===Dt)return We="outer",Et();we=P.undirected,Z=Object.keys(P.undirected),Fe=0,We="inner-undirected"}if(!zt&&Fe>=Z.length)return We="inner-undirected"===We?"outer":"undirected",Et();if(!zt){var _s=Z[Fe++];return zt=we[_s].values(),Et()}if((pn=zt.next()).done)return zt=null,Et();var Wr=pn.value,Ks=Wr.target;return"inner-undirected"===We&&Ks.key===P.key&&(Ks=Wr.source),{done:!1,value:[P.key,Ks.key,P.attributes,Ks.attributes,Wr.key,Wr.attributes]}})):(Tl=(Et=this)._nodes.values(),oo=Et.type,Pr="outer",new ee(function Fs(){var fc;if("outer"===Pr)return!0===(fc=Tl.next()).done?fc:(pn=fc.value,Pr="directed",Fs());if("directed"===Pr)return"undirected"===oo?(Pr="undirected",Fs()):(Wr=pn.out,_s=Object.keys(pn.out),Ks=0,Pr="inner-directed",Fs());if("undirected"===Pr){if("directed"===oo)return Pr="outer",Fs();Wr=pn.undirected,_s=Object.keys(pn.undirected),Ks=0,Pr="inner-undirected"}if(Ks>=_s.length)return Pr="inner-undirected"===Pr?"outer":"undirected",Fs();var yn=_s[Ks++],ao=Wr[yn],Ml=ao.target;return"inner-undirected"===Pr&&Ml.key===pn.key&&(Ml=ao.source),{done:!1,value:[pn.key,Ml.key,pn.attributes,Ml.attributes,ao.key,ao.attributes]}}));var Et,pn,_s,Wr,Ks,Tl,oo,Pr,C,P,Z,we,Fe,et,Dt,We,zt},oe.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):se(this._nodes.keys(),this._nodes.size)},oe.forEachNode=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(P,Z){C(Z,P.attributes)})},oe.forEachNodeUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");for(var P,Z,we=this._nodes.values();!0!==(P=we.next())&&!C((Z=P.value).key,Z.attributes););},oe.nodeEntries=function(){var C=this._nodes.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{value:[Z.key,Z.attributes],done:!1}})},oe.exportNode=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.exportNode: could not find the "'.concat(C,'" node in the graph.'));return Qe(C,P)},oe.exportEdge=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.exportEdge: could not find the "'.concat(C,'" edge in the graph.'));return vt(C,P)},oe.export=function(){var C=new Array(this._nodes.size),P=0;this._nodes.forEach(function(we,Fe){C[P++]=Qe(Fe,we)});var Z=new Array(this._edges.size);return P=0,this._edges.forEach(function(we,Fe){Z[P++]=vt(Fe,we)}),{attributes:this.getAttributes(),nodes:C,edges:Z,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},oe.importNode=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=xt(C);if(Z){if("not-object"===Z)throw new me('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===Z)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===Z)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=C.key,Fe=C.attributes,et=void 0===Fe?{}:Fe;return P?this.mergeNode(we,et):this.addNode(we,et),this},oe.importEdge=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=Tt(C);if(Z){if("not-object"===Z)throw new me('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===Z)throw new me("Graph.importEdge: missing souce.");if("no-target"===Z)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===Z)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===Z)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=C.source,Fe=C.target,et=C.attributes,Dt=void 0===et?{}:et,We=C.undirected,zt=void 0!==We&&We;return"key"in C?(P?zt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:zt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,C.key,we,Fe,Dt):(P?zt?this.mergeUndirectedEdge:this.mergeDirectedEdge:zt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Dt),this},oe.import=function(C){var P,Z,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V(C))return this.import(C.export(),Fe),this;if(!L(C))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(C.attributes){if(!L(C.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(C.attributes):this.replaceAttributes(C.attributes)}if(C.nodes){if(we=C.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(P=0,Z=we.length;PZ)){var Dt=new Set;Dt.add(P.undirected[et]),P.undirected[et]=Dt,C._nodes.get(et).undirected[Z]=Dt}})),this;var C},oe.clearIndex=function(){return this._nodes.forEach(function(C){void 0!==C.in&&(C.in={},C.out={}),void 0!==C.undirected&&(C.undirected={})}),this},oe.toJSON=function(){return this.export()},oe.toString=function(){return"[object Graph]"},oe.inspect=function(){var C=this,P={};this._nodes.forEach(function(Dt,We){P[We]=Dt.attributes});var Z={},we={};this._edges.forEach(function(Dt,We){var zt=Dt.undirected?"--":"->",Et="",pn="(".concat(Dt.source.key,")").concat(zt,"(").concat(Dt.target.key,")");Dt.generatedKey?C.multi&&(void 0===we[pn]?we[pn]=0:we[pn]++,Et+="".concat(we[pn],". ")):Et+="[".concat(We,"]: "),Z[Et+=pn]=Dt.attributes});var Fe={};for(var et in this)this.hasOwnProperty(et)&&!jn.has(et)&&"function"!=typeof this[et]&&(Fe[et]=this[et]);return Fe.attributes=this._attributes,Fe.nodes=P,Fe.edges=Z,$(Fe,"constructor",this.constructor),Fe},de}(T.exports.EventEmitter);"undefined"!=typeof Symbol&&(bn.prototype[Symbol.for("nodejs.util.inspect.custom")]=bn.prototype.inspect),[{name:function(ne){return"".concat(ne,"Edge")},generateKey:!0},{name:function(ne){return"".concat(ne,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ne){return"".concat(ne,"EdgeWithKey")}},{name:function(ne){return"".concat(ne,"DirectedEdgeWithKey")},type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ne){["add","merge","update"].forEach(function(de){var oe=ne.name(de),C="add"===de?fn:zn;bn.prototype[oe]=ne.generateKey?function(P,Z,we){return C(this,oe,!0,"undirected"===(ne.type||this.type),null,P,Z,we,"update"===de)}:function(P,Z,we,Fe){return C(this,oe,!1,"undirected"===(ne.type||this.type),P,Z,we,Fe,"update"===de)}})}),"undefined"!=typeof Symbol&&(bn.prototype[Symbol.iterator]=bn.prototype.adjacency),ne=bn,je.forEach(function(de){var oe=de.name,C=de.attacher;C(ne,oe("Edge"),"mixed"),C(ne,oe("DirectedEdge"),"directed"),C(ne,oe("UndirectedEdge"),"undirected")}),function(ne){Re.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe,et){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(!arguments.length)return Oe(this,Z);if(1===arguments.length){var Dt=this._nodes.get(Fe=""+Fe);if(void 0===Dt)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return Tn(this.multi,"mixed"===Z?this.type:Z,we,Dt)}if(2===arguments.length){et=""+et;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" target node in the graph.'));return hi(Z,this.multi,we,We,et)}throw new me("Graph.".concat(P,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1);oe.prototype[Fe]=function(et,Dt,We){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return Xe(this,Z,We=et);if(2===arguments.length){We=Dt;var zt=this._nodes.get(et=""+et);if(void 0===zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Pn(this.multi,"mixed"===Z?this.type:Z,we,zt,We)}if(3===arguments.length){Dt=""+Dt;var Et=this._nodes.get(et=""+et);if(!Et)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Hr(Z,this.multi,we,Et,Dt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1)+"Until";oe.prototype[Fe]=function(et,Dt,We){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return yt(this,Z,We=et);if(2===arguments.length){We=Dt;var zt=this._nodes.get(et=""+et);if(void 0===zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Gn(this.multi,"mixed"===Z?this.type:Z,we,zt,We)}if(3===arguments.length){Dt=""+Dt;var Et=this._nodes.get(et=""+et);if(!Et)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Ns(Z,this.multi,we,Et,Dt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var Z=C.type,we=C.direction,Fe=C.name.slice(0,-1)+"Entries";oe.prototype[Fe]=function(et,Dt){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return ee.empty();if(!arguments.length)return It(this,Z);if(1===arguments.length){var We=this._nodes.get(et=""+et);if(!We)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return yi(Z,we,We)}if(2===arguments.length){Dt=""+Dt;var zt=this._nodes.get(et=""+et);if(!zt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return cs(Z,we,zt,Dt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ne,de)})}(bn),function(ne){Ps.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(2===arguments.length){var et=""+arguments[0],Dt=""+arguments[1];if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(P,': could not find the "').concat(Dt,'" node in the graph.'));return ot(this,Z,we,et,Dt)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return qa("mixed"===Z?this.type:Z,we,We)}throw new me("Graph.".concat(P,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1);ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,We,zt,Et){if("mixed"!==Dt){if("undirected"===Dt)return Al(zt,zt.undirected,Et);if("string"==typeof We)return Al(zt,zt[We],Et)}var pn=new Set;"undirected"!==Dt&&("out"!==We&&ua(pn,zt,zt.in,Et),"in"!==We&&ua(pn,zt,zt.out,Et)),"directed"!==Dt&&ua(pn,zt,zt.undirected,Et)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1)+"Until";ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,We,zt,Et){if("mixed"!==Dt){if("undirected"===Dt)return ms(zt,zt.undirected,Et);if("string"==typeof We)return ms(zt,zt[We],Et)}var pn=new Set;"undirected"!==Dt&&("out"!==We&&Qt(pn,zt,zt.in,Et)||"in"!==We&&Qt(pn,zt,zt.out,Et))||"directed"===Dt||Qt(pn,zt,zt.undirected,Et)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var C=de.type,P=de.direction,Z=de.name.slice(0,-1)+"Entries";ne.prototype[Z]=function(we){if("mixed"!==C&&"mixed"!==this.type&&C!==this.type)return ee.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));return function(et,Dt,We){if("mixed"!==et){if("undirected"===et)return Ka(We,We.undirected);if("string"==typeof Dt)return Ka(We,We[Dt])}var zt=ee.empty(),Et=new Set;return"undirected"!==et&&("out"!==Dt&&(zt=Ee(zt,rt(Et,We,We.in))),"in"!==Dt&&(zt=Ee(zt,rt(Et,We,We.out)))),"directed"!==et&&(zt=Ee(zt,rt(Et,We,We.undirected))),zt}("mixed"===C?this.type:C,P,Fe)}}(ne,de)})}(bn);var Qi=function(ne){function de(oe){var C=he({type:"directed"},oe);if("multi"in C&&!1!==C.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==C.type)throw new me('DirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),Zi=function(ne){function de(oe){var C=he({type:"undirected"},oe);if("multi"in C&&!1!==C.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==C.type)throw new me('UndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),qn=function(ne){function de(oe){var C=he({multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ne.call(this,C)||this}return tt(de,ne),de}(bn),Pi=function(ne){function de(oe){var C=he({type:"directed",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==C.type)throw new me('MultiDirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn),da=function(ne){function de(oe){var C=he({type:"undirected",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==C.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(bn);function $r(ne){ne.from=function(de,oe){var C=he({},de.options,oe),P=new ne(C);return P.import(de),P}}return $r(bn),$r(Qi),$r(Zi),$r(qn),$r(Pi),$r(da),bn.Graph=bn,bn.DirectedGraph=Qi,bn.UndirectedGraph=Zi,bn.MultiGraph=qn,bn.MultiDirectedGraph=Pi,bn.MultiUndirectedGraph=da,bn.InvalidArgumentsGraphError=me,bn.NotFoundGraphError=te,bn.UsageGraphError=ye,bn}()},524:(kt,it,tt)=>{var gt;!function(J,At,dt,K){"use strict";var T,Ae=["","webkit","Moz","MS","ms","o"],he=At.createElement("div"),V=Math.round,L=Math.abs,re=Date.now;function $(_e,Ce,He){return setTimeout(M(_e,He),Ce)}function b(_e,Ce,He){return!!Array.isArray(_e)&&(S(_e,He[Ce],He),!0)}function S(_e,Ce,He){var mt;if(_e)if(_e.forEach)_e.forEach(Ce,He);else if(_e.length!==K)for(mt=0;mt<_e.length;)Ce.call(He,_e[mt],mt,_e),mt++;else for(mt in _e)_e.hasOwnProperty(mt)&&Ce.call(He,_e[mt],mt,_e)}function O(_e,Ce,He){var mt="DEPRECATED METHOD: "+Ce+"\n"+He+" AT \n";return function(){var jt=new Error("get-stack-trace"),Ht=jt&&jt.stack?jt.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ri=J.console&&(J.console.warn||J.console.log);return ri&&ri.call(J.console,mt,Ht),_e.apply(this,arguments)}}T="function"!=typeof Object.assign?function(Ce){if(Ce===K||null===Ce)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(Ce),mt=1;mt-1}function Q(_e){return _e.trim().split(/\s+/g)}function E(_e,Ce,He){if(_e.indexOf&&!He)return _e.indexOf(Ce);for(var mt=0;mt<_e.length;){if(He&&_e[mt][He]==Ce||!He&&_e[mt]===Ce)return mt;mt++}return-1}function U(_e){return Array.prototype.slice.call(_e,0)}function ie(_e,Ce,He){for(var mt=[],jt=[],Ht=0;Ht<_e.length;){var ri=Ce?_e[Ht][Ce]:_e[Ht];E(jt,ri)<0&&mt.push(_e[Ht]),jt[Ht]=ri,Ht++}return He&&(mt=Ce?mt.sort(function(qr,ys){return qr[Ce]>ys[Ce]}):mt.sort()),mt}function ue(_e,Ce){for(var He,mt,jt=Ce[0].toUpperCase()+Ce.slice(1),Ht=0;Ht1&&!He.firstMultiple?He.firstMultiple=yt(Ce):1===jt&&(He.firstMultiple=!1);var Ht=He.firstInput,ri=He.firstMultiple,Fr=ri?ri.center:Ht.center,qr=Ce.center=It(mt);Ce.timeStamp=re(),Ce.deltaTime=Ce.timeStamp-Ht.timeStamp,Ce.angle=yi(Fr,qr),Ce.distance=Gn(Fr,qr),function(_e,Ce){var He=Ce.center,mt=_e.offsetDelta||{},jt=_e.prevDelta||{},Ht=_e.prevInput||{};(1===Ce.eventType||4===Ht.eventType)&&(jt=_e.prevDelta={x:Ht.deltaX||0,y:Ht.deltaY||0},mt=_e.offsetDelta={x:He.x,y:He.y}),Ce.deltaX=jt.x+(He.x-mt.x),Ce.deltaY=jt.y+(He.y-mt.y)}(He,Ce),Ce.offsetDirection=Pn(Ce.deltaX,Ce.deltaY);var ys=Tn(Ce.deltaTime,Ce.deltaX,Ce.deltaY);Ce.overallVelocityX=ys.x,Ce.overallVelocityY=ys.y,Ce.overallVelocity=L(ys.x)>L(ys.y)?ys.x:ys.y,Ce.scale=ri?function(_e,Ce){return Gn(Ce[0],Ce[1],pt)/Gn(_e[0],_e[1],pt)}(ri.pointers,mt):1,Ce.rotation=ri?function(_e,Ce){return yi(Ce[1],Ce[0],pt)+yi(_e[1],_e[0],pt)}(ri.pointers,mt):0,Ce.maxPointers=He.prevInput?Ce.pointers.length>He.prevInput.maxPointers?Ce.pointers.length:He.prevInput.maxPointers:Ce.pointers.length,function(_e,Ce){var jt,Ht,ri,Fr,He=_e.lastInterval||Ce,mt=Ce.timeStamp-He.timeStamp;if(8!=Ce.eventType&&(mt>25||He.velocity===K)){var qr=Ce.deltaX-He.deltaX,ys=Ce.deltaY-He.deltaY,ti=Tn(mt,qr,ys);Ht=ti.x,ri=ti.y,jt=L(ti.x)>L(ti.y)?ti.x:ti.y,Fr=Pn(qr,ys),_e.lastInterval=Ce}else jt=He.velocity,Ht=He.velocityX,ri=He.velocityY,Fr=He.direction;Ce.velocity=jt,Ce.velocityX=Ht,Ce.velocityY=ri,Ce.direction=Fr}(He,Ce);var ti=_e.element;D(Ce.srcEvent.target,ti)&&(ti=Ce.srcEvent.target),Ce.target=ti}(_e,He),_e.emit("hammer.input",He),_e.recognize(He),_e.session.prevInput=He}function yt(_e){for(var Ce=[],He=0;He<_e.pointers.length;)Ce[He]={clientX:V(_e.pointers[He].clientX),clientY:V(_e.pointers[He].clientY)},He++;return{timeStamp:re(),pointers:Ce,center:It(Ce),deltaX:_e.deltaX,deltaY:_e.deltaY}}function It(_e){var Ce=_e.length;if(1===Ce)return{x:V(_e[0].clientX),y:V(_e[0].clientY)};for(var He=0,mt=0,jt=0;jt=L(Ce)?_e<0?2:4:Ce<0?8:16}function Gn(_e,Ce,He){He||(He=wt);var mt=Ce[He[0]]-_e[He[0]],jt=Ce[He[1]]-_e[He[1]];return Math.sqrt(mt*mt+jt*jt)}function yi(_e,Ce,He){return He||(He=wt),180*Math.atan2(Ce[He[1]]-_e[He[1]],Ce[He[0]]-_e[He[0]])/Math.PI}fe.prototype={handler:function(){},init:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Y(this.element,this.evEl,this.domHandler),this.evTarget&&Y(this.target,this.evTarget,this.domHandler),this.evWin&&Y(Te(this.element),this.evWin,this.domHandler)}};var Ns={mousedown:1,mousemove:2,mouseup:4},cs="mousedown",Ps="mousemove mouseup";function Gr(){this.evEl=cs,this.evWin=Ps,this.pressed=!1,fe.apply(this,arguments)}w(Gr,fe,{handler:function(Ce){var He=Ns[Ce.type];1&He&&0===Ce.button&&(this.pressed=!0),2&He&&1!==Ce.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[Ce],changedPointers:[Ce],pointerType:Ze,srcEvent:Ce}))}});var qa={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Al={2:Ve,3:"pen",4:Ze,5:"kinect"},ua="pointerdown",ms="pointermove pointerup pointercancel";function Qt(){this.evEl=ua,this.evWin=ms,fe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}J.MSPointerEvent&&!J.PointerEvent&&(ua="MSPointerDown",ms="MSPointerMove MSPointerUp MSPointerCancel"),w(Qt,fe,{handler:function(Ce){var He=this.store,mt=!1,jt=Ce.type.toLowerCase().replace("ms",""),Ht=qa[jt],ri=Al[Ce.pointerType]||Ce.pointerType,Fr=ri==Ve,qr=E(He,Ce.pointerId,"pointerId");1&Ht&&(0===Ce.button||Fr)?qr<0&&(He.push(Ce),qr=He.length-1):12&Ht&&(mt=!0),!(qr<0)&&(He[qr]=Ce,this.callback(this.manager,Ht,{pointers:He,changedPointers:[Ce],pointerType:ri,srcEvent:Ce}),mt&&He.splice(qr,1))}});var Ka={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",ot="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=rt,this.evWin=ot,this.started=!1,fe.apply(this,arguments)}function pe(_e,Ce){var He=U(_e.touches),mt=U(_e.changedTouches);return 12&Ce&&(He=ie(He.concat(mt),"identifier",!0)),[He,mt]}w(ut,fe,{handler:function(Ce){var He=Ka[Ce.type];if(1===He&&(this.started=!0),this.started){var mt=pe.call(this,Ce,He);12&He&&mt[0].length-mt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:mt[0],changedPointers:mt[1],pointerType:Ve,srcEvent:Ce})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ke="touchstart touchmove touchend touchcancel";function ct(){this.evTarget=ke,this.targetIds={},fe.apply(this,arguments)}function Qe(_e,Ce){var He=U(_e.touches),mt=this.targetIds;if(3&Ce&&1===He.length)return mt[He[0].identifier]=!0,[He,He];var jt,Ht,ri=U(_e.changedTouches),Fr=[],qr=this.target;if(Ht=He.filter(function(ys){return D(ys.target,qr)}),1===Ce)for(jt=0;jt-1&&mt.splice(Ht,1)},2500)}}function ii(_e){for(var Ce=_e.srcEvent.clientX,He=_e.srcEvent.clientY,mt=0;mt-1&&this.requireFail.splice(Ce,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(_e){return!!this.simultaneous[_e.id]},emit:function(_e){var Ce=this,He=this.state;function mt(jt){Ce.manager.emit(jt,_e)}He<8&&mt(Ce.options.event+We(He)),mt(Ce.options.event),_e.additionalEvent&&mt(_e.additionalEvent),He>=8&&mt(Ce.options.event+We(He))},tryEmit:function(_e){if(this.canEmit())return this.emit(_e);this.state=32},canEmit:function(){for(var _e=0;_eCe.threshold&&jt&Ce.direction},attrTest:function(_e){return pn.prototype.attrTest.call(this,_e)&&(2&this.state||!(2&this.state)&&this.directionTest(_e))},emit:function(_e){this.pX=_e.deltaX,this.pY=_e.deltaY;var Ce=zt(_e.direction);Ce&&(_e.additionalEvent=this.options.event+Ce),this._super.emit.call(this,_e)}}),w(Wr,pn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.scale-1)>this.options.threshold||2&this.state)},emit:function(_e){1!==_e.scale&&(_e.additionalEvent=this.options.event+(_e.scale<1?"in":"out")),this._super.emit.call(this,_e)}}),w(Ks,Dt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(_e){var Ce=this.options,He=_e.pointers.length===Ce.pointers,mt=_e.distanceCe.time;if(this._input=_e,!mt||!He||12&_e.eventType&&!jt)this.reset();else if(1&_e.eventType)this.reset(),this._timer=$(function(){this.state=8,this.tryEmit()},Ce.time,this);else if(4&_e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(_e){8===this.state&&(_e&&4&_e.eventType?this.manager.emit(this.options.event+"up",_e):(this._input.timeStamp=re(),this.manager.emit(this.options.event,this._input)))}}),w(Tl,pn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.rotation)>this.options.threshold||2&this.state)}}),w(oo,pn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _s.prototype.getTouchAction.call(this)},attrTest:function(_e){var He,Ce=this.options.direction;return 30&Ce?He=_e.overallVelocity:6&Ce?He=_e.overallVelocityX:24&Ce&&(He=_e.overallVelocityY),this._super.attrTest.call(this,_e)&&Ce&_e.offsetDirection&&_e.distance>this.options.threshold&&_e.maxPointers==this.options.pointers&&L(He)>this.options.velocity&&4&_e.eventType},emit:function(_e){var Ce=zt(_e.offsetDirection);Ce&&this.manager.emit(this.options.event+Ce,_e),this.manager.emit(this.options.event,_e)}}),w(Pr,Dt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Qi]},process:function(_e){var Ce=this.options,He=_e.pointers.length===Ce.pointers,mt=_e.distance"']/g,ms=RegExp(Al.source),Qt=RegExp(ua.source),Ka=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pe=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,ct=RegExp(ke.source),Qe=/^\s+/,vt=/\s/,xt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tt=/\{\n\/\* \[wrapped with (.+)\] \*/,$t=/,? & /,jn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ii=/[()=,{}\[\]\/\s]/,Dn=/\\(\\)?/g,fn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zn=/\w*$/,bn=/^[-+]0x[0-9a-f]+$/i,Qi=/^0b[01]+$/i,Zi=/^\[object .+?Constructor\]$/,qn=/^0o[0-7]+$/i,Pi=/^(?:0|[1-9]\d*)$/,da=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$r=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,de="\\ud800-\\udfff",Z="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",pn="\\ufe0e\\ufe0f",_s="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ks="["+de+"]",Tl="["+_s+"]",oo="["+Z+"]",Pr="\\d+",Fs="["+we+"]",fc="["+Fe+"]",yn="[^"+de+_s+Pr+we+Fe+Et+"]",ao="\\ud83c[\\udffb-\\udfff]",ha="[^"+de+"]",id="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="["+Et+"]",mt="(?:"+fc+"|"+yn+")",jt="(?:"+Ce+"|"+yn+")",Ht="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ri="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Fr="(?:"+oo+"|"+ao+")?",qr="["+pn+"]?",T1=qr+Fr+"(?:\\u200d(?:"+[ha,id,_e].join("|")+")"+qr+Fr+")*",rd="(?:"+[Fs,id,_e].join("|")+")"+T1,Wi="(?:"+[ha+oo+"?",oo,id,_e,Ks].join("|")+")",Wf=RegExp("['\u2019]","g"),xm=RegExp(oo,"g"),fh=RegExp(ao+"(?="+ao+")|"+Wi+T1,"g"),gv=RegExp([Ce+"?"+fc+"+"+Ht+"(?="+[Tl,Ce,"$"].join("|")+")",jt+"+"+ri+"(?="+[Tl,Ce+mt,"$"].join("|")+")",Ce+"?"+mt+"+"+Ht,Ce+"+"+ri,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pr,rd].join("|"),"g"),M1=RegExp("[\\u200d"+de+Z+pn+"]"),Dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ph=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],D1=-1,wn={};wn[It]=wn[Tn]=wn[Pn]=wn[Gn]=wn[yi]=wn[hi]=wn[Hr]=wn[Ns]=wn[cs]=!0,wn[Ze]=wn[Je]=wn[Xe]=wn[je]=wn[yt]=wn[Le]=wn[Re]=wn[Ue]=wn[Be]=wn[z]=wn[be]=wn[wt]=wn[pt]=wn[fe]=wn[k]=!1;var Ji={};Ji[Ze]=Ji[Je]=Ji[Xe]=Ji[yt]=Ji[je]=Ji[Le]=Ji[It]=Ji[Tn]=Ji[Pn]=Ji[Gn]=Ji[yi]=Ji[Be]=Ji[z]=Ji[be]=Ji[wt]=Ji[pt]=Ji[fe]=Ji[B]=Ji[hi]=Ji[Hr]=Ji[Ns]=Ji[cs]=!0,Ji[Re]=Ji[Ue]=Ji[k]=!1;var gn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},I1=parseFloat,vv=parseInt,Lt="object"==typeof global&&global&&global.Object===Object&&global,Ls="object"==typeof self&&self&&self.Object===Object&&self,Di=Lt||Ls||Function("return this")(),Il=it&&!it.nodeType&&it,fa=Il&&kt&&!kt.nodeType&&kt,xo=fa&&fa.exports===Il,Cm=xo&&Lt.process,yr=function(){try{return fa&&fa.require&&fa.require("util").types||Cm&&Cm.binding&&Cm.binding("util")}catch(Mt){}}(),en=yr&&yr.isArrayBuffer,si=yr&&yr.isDate,sr=yr&&yr.isMap,lo=yr&&yr.isRegExp,pc=yr&&yr.isSet,Jr=yr&&yr.isTypedArray;function es(st,Mt,_t){switch(_t.length){case 0:return st.call(Mt);case 1:return st.call(Mt,_t[0]);case 2:return st.call(Mt,_t[0],_t[1]);case 3:return st.call(Mt,_t[0],_t[1],_t[2])}return st.apply(Mt,_t)}function Lr(st,Mt,_t,sn){for(var xn=-1,Ci=null==st?0:st.length;++xn-1}function gh(st,Mt,_t){for(var sn=-1,xn=null==st?0:st.length;++sn-1;);return _t}function P1(st,Mt){for(var _t=st.length;_t--&&Ya(Mt,st[_t],0)>-1;);return _t}function CP(st,Mt){for(var _t=st.length,sn=0;_t--;)st[_t]===Mt&&++sn;return sn}var AP=Ho({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),TP=Ho({"&":"&","<":"<",">":">",'"':""","'":"'"});function MP(st){return"\\"+gn[st]}function yh(st){return M1.test(st)}function wv(st){var Mt=-1,_t=Array(st.size);return st.forEach(function(sn,xn){_t[++Mt]=[xn,sn]}),_t}function F1(st,Mt){return function(_t){return st(Mt(_t))}}function ou(st,Mt){for(var _t=-1,sn=st.length,xn=0,Ci=[];++_t",""":'"',"'":"'"}),bh=function st(Mt){var u,_t=(Mt=null==Mt?Di:bh.defaults(Di.Object(),Mt,bh.pick(Di,ph))).Array,sn=Mt.Date,xn=Mt.Error,Ci=Mt.Function,Kr=Mt.Math,Bi=Mt.Object,Om=Mt.RegExp,Nm=Mt.String,ma=Mt.TypeError,or=_t.prototype,au=Bi.prototype,Kf=Mt["__core-js_shared__"],vr=Ci.prototype.toString,ji=au.hasOwnProperty,PP=0,wh=(u=/[^.]+$/.exec(Kf&&Kf.keys&&Kf.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ys=au.toString,B1=vr.call(Bi),Pm=Di._,ud=Om("^"+vr.call(ji).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bs=xo?Mt.Buffer:J,Ol=Mt.Symbol,dd=Mt.Uint8Array,xv=Bs?Bs.allocUnsafe:J,_a=F1(Bi.getPrototypeOf,Bi),Fm=Bi.create,Yf=au.propertyIsEnumerable,Ln=or.splice,j1=Ol?Ol.isConcatSpreadable:J,Eh=Ol?Ol.iterator:J,lu=Ol?Ol.toStringTag:J,Xf=function(){try{var u=Ac(Bi,"defineProperty");return u({},"",{}),u}catch(h){}}(),Cv=Mt.clearTimeout!==Di.clearTimeout&&Mt.clearTimeout,V1=sn&&sn.now!==Di.Date.now&&sn.now,U1=Mt.setTimeout!==Di.setTimeout&&Mt.setTimeout,Ft=Kr.ceil,fi=Kr.floor,ya=Bi.getOwnPropertySymbols,ts=Bs?Bs.isBuffer:J,Lm=Mt.isFinite,Sh=or.join,Qa=F1(Bi.keys,Bi),Br=Kr.max,us=Kr.min,FP=sn.now,z1=Mt.parseInt,xh=Kr.random,Qf=or.reverse,bs=Ac(Mt,"DataView"),co=Ac(Mt,"Map"),Zf=Ac(Mt,"Promise"),va=Ac(Mt,"Set"),Ao=Ac(Mt,"WeakMap"),Ch=Ac(Bi,"create"),Ah=Ao&&new Ao,hd={},H1=bu(bs),km=bu(co),Bm=bu(Zf),Av=bu(va),jm=bu(Ao),Jf=Ol?Ol.prototype:J,fd=Jf?Jf.valueOf:J,Th=Jf?Jf.toString:J;function Se(u){if(Er(u)&&!Mn(u)&&!(u instanceof oi)){if(u instanceof To)return u;if(ji.call(u,"__wrapped__"))return Sp(u)}return new To(u)}var cu=function(){function u(){}return function(h){if(!wr(h))return{};if(Fm)return Fm(h);u.prototype=h;var m=new u;return u.prototype=J,m}}();function Mh(){}function To(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=J}function oi(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function uo(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function js(u,h,m,N,ae,xe){var ze,Ke=1&h,lt=2&h,Ot=4&h;if(m&&(ze=ae?m(u,N,ae,xe):m(u)),ze!==J)return ze;if(!wr(u))return u;var Nt=Mn(u);if(Nt){if(ze=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&ji.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!Ke)return Qs(u,ze)}else{var Bt=Us(u),Jt=Bt==Ue||Bt==qe;if(ll(u))return hp(u,Ke);if(Bt==be||Bt==Ze||Jt&&!ae){if(ze=lt||Jt?{}:Qv(u),!Ke)return lt?function(u,h){return xa(u,Kv(u),h)}(u,function(u,h){return u&&xa(h,Js(h),u)}(ze,u)):function(u,h){return xa(u,a_(u),h)}(u,tC(ze,u))}else{if(!Ji[Bt])return ae?u:{};ze=function(u,h,m){var N=u.constructor;switch(h){case Xe:return mu(u);case je:case Le:return new N(+u);case yt:return function(u,h){var m=h?mu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case It:case Tn:case Pn:case Gn:case yi:case hi:case Hr:case Ns:case cs:return n_(u,m);case Be:return new N;case z:case fe:return new N(u);case wt:return function(u){var h=new u.constructor(u.source,zn.exec(u));return h.lastIndex=u.lastIndex,h}(u);case pt:return new N;case B:return function(u){return fd?Bi(fd.call(u)):{}}(u)}}(u,Bt,Ke)}}xe||(xe=new wa);var _n=xe.get(u);if(_n)return _n;xe.set(u,ze),wA(u)?u.forEach(function(kn){ze.add(js(kn,h,m,kn,u,xe))}):_A(u)&&u.forEach(function(kn,ci){ze.set(ci,js(kn,h,m,ci,u,xe))});var li=Nt?J:(Ot?lt?s_:Bl:lt?Js:Cs)(u);return ks(li||u,function(kn,ci){li&&(kn=u[ci=kn]),Ja(ze,ci,js(kn,h,m,ci,u,xe))}),ze}function sp(u,h,m){var N=m.length;if(null==u)return!N;for(u=Bi(u);N--;){var ae=m[N],ze=u[ae];if(ze===J&&!(ae in u)||!(0,h[ae])(ze))return!1}return!0}function Rh(u,h,m){if("function"!=typeof u)throw new ma(Ae);return Bh(function(){u.apply(J,m)},h)}function yc(u,h,m,N){var ae=-1,xe=Rl,ze=!0,Ke=u.length,lt=[],Ot=h.length;if(!Ke)return lt;m&&(h=ki(h,$o(m))),N?(xe=gh,ze=!1):h.length>=200&&(xe=_h,ze=!1,h=new ba(h));e:for(;++ae-1},Nl.prototype.set=function(u,h){var m=this.__data__,N=gd(m,u);return N<0?(++this.size,m.push([u,h])):m[N][1]=h,this},Za.prototype.clear=function(){this.size=0,this.__data__={hash:new uo,map:new(co||Nl),string:new uo}},Za.prototype.delete=function(u){var h=Vs(this,u).delete(u);return this.size-=h?1:0,h},Za.prototype.get=function(u){return Vs(this,u).get(u)},Za.prototype.has=function(u){return Vs(this,u).has(u)},Za.prototype.set=function(u,h){var m=Vs(this,u),N=m.size;return m.set(u,h),this.size+=m.size==N?0:1,this},ba.prototype.add=ba.prototype.push=function(u){return this.__data__.set(u,q),this},ba.prototype.has=function(u){return this.__data__.has(u)},wa.prototype.clear=function(){this.__data__=new Nl,this.size=0},wa.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},wa.prototype.get=function(u){return this.__data__.get(u)},wa.prototype.has=function(u){return this.__data__.has(u)},wa.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Nl){var N=m.__data__;if(!co||N.length<199)return N.push([u,h]),this.size=++m.size,this;m=this.__data__=new Za(N)}return m.set(u,h),this.size=m.size,this};var vc=il(tl),qm=il(op,!0);function Iv(u,h){var m=!0;return vc(u,function(N,ae,xe){return m=!!h(N,ae,xe)}),m}function Oh(u,h,m){for(var N=-1,ae=u.length;++N0&&m(Ke)?h>1?ws(Ke,h-1,m,N,ae):kr(ae,Ke):N||(ae[ae.length]=Ke)}return ae}var md=jv(),_d=jv(!0);function tl(u,h){return u&&md(u,h,Cs)}function op(u,h){return u&&_d(u,h,Cs)}function Nh(u,h){return pa(h,function(m){return ea(u[m])})}function Wo(u,h){for(var m=0,N=(h=Sc(h,u)).length;null!=u&&mh}function yd(u,h){return null!=u&&ji.call(u,h)}function vd(u,h){return null!=u&&h in Bi(u)}function du(u,h,m){for(var N=m?gh:Rl,ae=u[0].length,xe=u.length,ze=xe,Ke=_t(xe),lt=1/0,Ot=[];ze--;){var Nt=u[ze];ze&&h&&(Nt=ki(Nt,$o(h))),lt=us(Nt.length,lt),Ke[ze]=!m&&(h||ae>=120&&Nt.length>=120)?new ba(ze&&Nt):J}Nt=u[0];var Bt=-1,Jt=Ke[0];e:for(;++Bt=Ke?lt:lt*("desc"==m[N]?-1:1)}return u.index-h.index}(xe,ze,m)});_t--;)st[_t]=st[_t].value;return st}(oC(u,function(xe,ze,Ke){return{criteria:ki(h,function(Ot){return Ot(xe)}),index:++N,value:xe}}))}function Fv(u,h,m){for(var N=-1,ae=h.length,xe={};++N-1;)Ke!==u&&Ln.call(Ke,lt,1),Ln.call(u,lt,1);return u}function Fh(u,h){for(var m=u?h.length:0,N=m-1;m--;){var ae=h[m];if(m==N||ae!==xe){var xe=ae;Io(ae)?Ln.call(u,ae,1):fu(u,ae)}}return u}function Pl(u,h){return u+fi(xh()*(h-u+1))}function lp(u,h){var m="";if(!u||h<1||h>Te)return m;do{h%2&&(m+=u),(h=fi(h/2))&&(u+=u)}while(h);return m}function ai(u,h){return Ep(EC(u,h,eo),u+"")}function lC(u){return Hm(kd(u))}function GP(u,h){var m=kd(u);return Md(m,uu(h,0,m.length))}function cp(u,h,m,N){if(!wr(u))return u;for(var ae=-1,xe=(h=Sc(h,u)).length,ze=xe-1,Ke=u;null!=Ke&&++aeae?0:ae+h),(m=m>ae?ae:m)<0&&(m+=ae),ae=h>m?0:m-h>>>0,h>>>=0;for(var xe=_t(ae);++N>>1,ze=u[xe];null!==ze&&!ta(ze)&&(m?ze<=h:ze=200){var Ot=h?null:r_(u);if(Ot)return Dm(Ot);ze=!1,ae=_h,lt=new ba}else lt=h?[]:Ke;e:for(;++N=N?u:Ss(u,h,m)}var dC=Cv||function(u){return Di.clearTimeout(u)};function hp(u,h){if(h)return u.slice();var m=u.length,N=xv?xv(m):new u.constructor(m);return u.copy(N),N}function mu(u){var h=new u.constructor(u.byteLength);return new dd(h).set(new dd(u)),h}function n_(u,h){var m=h?mu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function xc(u,h){if(u!==h){var m=u!==J,N=null===u,ae=u==u,xe=ta(u),ze=h!==J,Ke=null===h,lt=h==h,Ot=ta(h);if(!Ke&&!Ot&&!xe&&u>h||xe&&ze&<&&!Ke&&!Ot||N&&ze&<||!m&<||!ae)return 1;if(!N&&!xe&&!Ot&&u1?m[ae-1]:J,ze=ae>2?m[2]:J;for(xe=u.length>3&&"function"==typeof xe?(ae--,xe):J,ze&&zs(m[0],m[1],ze)&&(xe=ae<3?J:xe,ae=1),h=Bi(h);++N-1?ae[xe?h[ze]:ze]:J}}function yu(u){return rl(function(h){var m=h.length,N=m,ae=To.prototype.thru;for(u&&h.reverse();N--;){var xe=h[N];if("function"!=typeof xe)throw new ma(Ae);if(ae&&!ze&&"wrapper"==vp(xe))var ze=new To([],!0)}for(N=ze?N:m;++N1&&vi.reverse(),Nt&<Ke))return!1;var Ot=xe.get(u),Nt=xe.get(h);if(Ot&&Nt)return Ot==h&&Nt==u;var Bt=-1,Jt=!0,_n=2&m?new ba:J;for(xe.set(u,h),xe.set(h,u);++Bt-1&&u%1==0&&u1?"& ":"")+h[N],h=h.join(m>2?", ":" "),u.replace(xt,"{\n/* [wrapped with "+h+"] */\n")}(N,function(u,h){return ks(nt,function(m){var N="_."+m[0];h&m[1]&&!Rl(u,N)&&u.push(N)}),u.sort()}(function(u){var h=u.match(Tt);return h?h[1].split($t):[]}(N),m)))}function f_(u){var h=0,m=0;return function(){var N=FP(),ae=16-(N-m);if(m=N,ae>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(J,arguments)}}function Md(u,h){var m=-1,N=u.length,ae=N-1;for(h=h===J?N:h;++m1?u[h-1]:J;return m="function"==typeof m?(u.pop(),m):J,qC(u,m)});function S_(u){var h=Se(u);return h.__chain__=!0,h}function Id(u,h){return h(u)}var x_=rl(function(u){var h=u.length,m=h?u[0]:0,N=this.__wrapped__,ae=function(xe){return $m(xe,u)};return!(h>1||this.__actions__.length)&&N instanceof oi&&Io(m)?((N=N.slice(m,+m+(h?1:0))).__actions__.push({func:Id,args:[ae],thisArg:J}),new To(N,this.__chain__).thru(function(xe){return h&&!xe.length&&xe.push(J),xe})):this.thru(ae)}),XC=Yr(function(u,h,m){ji.call(u,m)?++u[m]:el(u,m,1)}),JC=Uv(g_),eA=Uv(m_);function M_(u,h){return(Mn(u)?ks:vc)(u,On(h,3))}function Ap(u,h){return(Mn(u)?sd:qm)(u,On(h,3))}var nA=Yr(function(u,h,m){ji.call(u,m)?u[m].push(h):el(u,m,[h])}),vb=ai(function(u,h,m){var N=-1,ae="function"==typeof h,xe=ho(u)?_t(u.length):[];return vc(u,function(ze){xe[++N]=ae?es(h,ze,m):Sa(ze,h,m)}),xe}),bb=Yr(function(u,h,m){el(u,m,h)});function ol(u,h){return(Mn(u)?ki:oC)(u,On(h,3))}var Eb=Yr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),Mp=ai(function(u,h){if(null==u)return[];var m=h.length;return m>1&&zs(u,h[0],h[1])?h=[]:m>2&&zs(h[0],h[1],h[2])&&(h=[h[0]]),Ph(u,ws(h,1),[])}),wu=V1||function(){return Di.Date.now()};function Dp(u,h,m){return h=m?J:h,kl(u,H,J,J,J,J,h=u&&null==h?u.length:h)}function I_(u,h){var m;if("function"!=typeof h)throw new ma(Ae);return u=Yn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=J),m}}var Hh=ai(function(u,h,m){var N=1;if(m.length){var ae=ou(m,Td(Hh));N|=j}return kl(u,N,h,m,ae)}),Od=ai(function(u,h,m){var N=3;if(m.length){var ae=ou(m,Td(Od));N|=j}return kl(h,N,u,m,ae)});function Db(u,h,m){var N,ae,xe,ze,Ke,lt,Ot=0,Nt=!1,Bt=!1,Jt=!0;if("function"!=typeof u)throw new ma(Ae);function _n(Ri){var dl=N,Ic=ae;return N=ae=J,Ot=Ri,ze=u.apply(Ic,dl)}function Fn(Ri){return Ot=Ri,Ke=Bh(ci,h),Nt?_n(Ri):ze}function kn(Ri){var dl=Ri-lt;return lt===J||dl>=h||dl<0||Bt&&Ri-Ot>=xe}function ci(){var Ri=wu();if(kn(Ri))return vi(Ri);Ke=Bh(ci,function(Ri){var uT=h-(Ri-lt);return Bt?us(uT,xe-(Ri-Ot)):uT}(Ri))}function vi(Ri){return Ke=J,Jt&&N?_n(Ri):(N=ae=J,ze)}function na(){var Ri=wu(),dl=kn(Ri);if(N=arguments,ae=this,lt=Ri,dl){if(Ke===J)return Fn(lt);if(Bt)return dC(Ke),Ke=Bh(ci,h),_n(lt)}return Ke===J&&(Ke=Bh(ci,h)),ze}return h=fo(h)||0,wr(m)&&(Nt=!!m.leading,xe=(Bt="maxWait"in m)?Br(fo(m.maxWait)||0,h):xe,Jt="trailing"in m?!!m.trailing:Jt),na.cancel=function(){Ke!==J&&dC(Ke),Ot=0,N=lt=ae=Ke=J},na.flush=function(){return Ke===J?ze:vi(wu())},na}var oA=ai(function(u,h){return Rh(u,1,h)}),Ib=ai(function(u,h,m){return Rh(u,fo(h)||0,m)});function Gh(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new ma(Ae);var m=function(){var N=arguments,ae=h?h.apply(this,N):N[0],xe=m.cache;if(xe.has(ae))return xe.get(ae);var ze=u.apply(this,N);return m.cache=xe.set(ae,ze)||xe,ze};return m.cache=new(Gh.Cache||Za),m}function N_(u){if("function"!=typeof u)throw new ma(Ae);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}Gh.Cache=Za;var aA=uC(function(u,h){var m=(h=1==h.length&&Mn(h[0])?ki(h[0],$o(On())):ki(ws(h,1),$o(On()))).length;return ai(function(N){for(var ae=-1,xe=us(N.length,m);++ae=h}),al=nC(function(){return arguments}())?nC:function(u){return Er(u)&&ji.call(u,"callee")&&!Yf.call(u,"callee")},Mn=_t.isArray,Lb=en?$o(en):function(u){return Er(u)&&Es(u)==Xe};function ho(u){return null!=u&&F_(u.length)&&!ea(u)}function br(u){return Er(u)&&ho(u)}var ll=ts||ry,kb=si?$o(si):function(u){return Er(u)&&Es(u)==Le};function Aa(u){if(!Er(u))return!1;var h=Es(u);return h==Re||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!Np(u)}function ea(u){if(!wr(u))return!1;var h=Es(u);return h==Ue||h==qe||"[object AsyncFunction]"==h||"[object Proxy]"==h}function Op(u){return"number"==typeof u&&u==Yn(u)}function F_(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Te}function wr(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Er(u){return null!=u&&"object"==typeof u}var _A=sr?$o(sr):function(u){return Er(u)&&Us(u)==Be};function bA(u){return"number"==typeof u||Er(u)&&Es(u)==z}function Np(u){if(!Er(u)||Es(u)!=be)return!1;var h=_a(u);if(null===h)return!0;var m=ji.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&vr.call(m)==B1}var Ub=lo?$o(lo):function(u){return Er(u)&&Es(u)==wt},wA=pc?$o(pc):function(u){return Er(u)&&Us(u)==pt};function k_(u){return"string"==typeof u||!Mn(u)&&Er(u)&&Es(u)==fe}function ta(u){return"symbol"==typeof u||Er(u)&&Es(u)==B}var $h=Jr?$o(Jr):function(u){return Er(u)&&F_(u.length)&&!!wn[Es(u)]},Tc=mp(Pv),B_=mp(function(u,h){return u<=h});function zb(u){if(!u)return[];if(ho(u))return k_(u)?Xa(u):Qs(u);if(Eh&&u[Eh])return function(st){for(var Mt,_t=[];!(Mt=st.next()).done;)_t.push(Mt.value);return _t}(u[Eh]());var h=Us(u);return(h==Be?wv:h==pt?Dm:kd)(u)}function cl(u){return u?(u=fo(u))===se||u===-se?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Yn(u){var h=cl(u),m=h%1;return h==h?m?h-m:h:0}function j_(u){return u?uu(Yn(u),0,ye):0}function fo(u){if("number"==typeof u)return u;if(ta(u))return NaN;if(wr(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=wr(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=bv(u);var m=Qi.test(u);return m||qn.test(u)?vv(u.slice(2),m?2:8):bn.test(u)?NaN:+u}function Hb(u){return xa(u,Js(u))}function Ii(u){return null==u?"":Do(u)}var EA=Fl(function(u,h){if(wp(h)||ho(h))xa(h,Cs(h),u);else for(var m in h)ji.call(h,m)&&Ja(u,m,h[m])}),SA=Fl(function(u,h){xa(h,Js(h),u)}),Nd=Fl(function(u,h,m,N){xa(h,Js(h),u,N)}),xA=Fl(function(u,h,m,N){xa(h,Cs(h),u,N)}),Gb=rl($m),AA=ai(function(u,h){u=Bi(u);var m=-1,N=h.length,ae=N>2?h[2]:J;for(ae&&zs(h[0],h[1],ae)&&(N=1);++m1),xe}),xa(u,s_(u),m),N&&(m=js(m,7,_p));for(var ae=h.length;ae--;)fu(m,h[ae]);return m}),RA=rl(function(u,h){return null==u?{}:function(u,h){return Fv(u,h,function(m,N){return Pp(u,N)})}(u,h)});function Qb(u,h){if(null==u)return{};var m=ki(s_(u),function(N){return[N]});return h=On(h),Fv(u,m,function(N,ae){return h(N,ae[0])})}var OA=vu(Cs),Jb=vu(Js);function kd(u){return null==u?[]:Mm(u,Cs(u))}var kA=Ll(function(u,h,m){return h=h.toLowerCase(),u+(m?H_(h):h)});function H_(u){return kp(Ii(u).toLowerCase())}function G_(u){return(u=Ii(u))&&u.replace(da,AP).replace(xm,"")}var jA=Ll(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),VA=Ll(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),dF=fp("toLowerCase"),$A=Ll(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),q_=Ll(function(u,h,m){return u+(m?" ":"")+kp(h)}),sw=Ll(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),kp=fp("toUpperCase");function Q_(u,h,m){return u=Ii(u),(h=m?J:h)===J?function(st){return Dl.test(st)}(u)?function(st){return st.match(gv)||[]}(u):function(st){return st.match(jn)||[]}(u):u.match(h)||[]}var Z_=ai(function(u,h){try{return es(u,J,h)}catch(m){return Aa(m)?m:new xn(m)}}),ow=rl(function(u,h){return ks(h,function(m){m=Jn(m),el(u,m,Hh(u[m],u))}),u});function J_(u){return function(){return u}}var fF=yu(),Bd=yu(!0);function eo(u){return u}function Eu(u){return sC("function"==typeof u?u:js(u,1))}var ey=ai(function(u,h){return function(m){return Sa(m,u,h)}}),aw=ai(function(u,h){return function(m){return Sa(u,m,h)}});function ty(u,h,m){var N=Cs(h),ae=Nh(h,N);null==m&&(!wr(h)||!ae.length&&N.length)&&(m=h,h=u,u=this,ae=Nh(h,Cs(h)));var xe=!(wr(m)&&"chain"in m&&!m.chain),ze=ea(u);return ks(ae,function(Ke){var lt=h[Ke];u[Ke]=lt,ze&&(u.prototype[Ke]=function(){var Ot=this.__chain__;if(xe||Ot){var Nt=u(this.__wrapped__),Bt=Nt.__actions__=Qs(this.__actions__);return Bt.push({func:lt,args:arguments,thisArg:u}),Nt.__chain__=Ot,Nt}return lt.apply(u,kr([this.value()],arguments))})}),u}function ny(){}var ZA=pp(ki),JA=pp(Zn),cw=pp(Co);function Su(u){return Xo(u)?Am(Jn(u)):function(u){return function(h){return Wo(h,u)}}(u)}var eT=Hv(),tT=Hv(!0);function Dc(){return[]}function ry(){return!1}var Hn=i_(function(u,h){return u+h},0),sy=Ad("ceil"),gF=i_(function(u,h){return u/h},1),Ul=Ad("floor"),fw=i_(function(u,h){return u*h},1),pw=Ad("round"),gw=i_(function(u,h){return u-h},0);return Se.after=function(u,h){if("function"!=typeof h)throw new ma(Ae);return u=Yn(u),function(){if(--u<1)return h.apply(this,arguments)}},Se.ary=Dp,Se.assign=EA,Se.assignIn=SA,Se.assignInWith=Nd,Se.assignWith=xA,Se.at=Gb,Se.before=I_,Se.bind=Hh,Se.bindAll=ow,Se.bindKey=Od,Se.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Mn(u)?u:[u]},Se.chain=S_,Se.chunk=function(u,h,m){h=(m?zs(u,h,m):h===J)?1:Br(Yn(h),0);var N=null==u?0:u.length;if(!N||h<1)return[];for(var ae=0,xe=0,ze=_t(Ft(N/h));aeae?0:ae+m),(N=N===J||N>ae?ae:Yn(N))<0&&(N+=ae),N=m>N?0:j_(N);m>>0)?(u=Ii(u))&&("string"==typeof h||null!=h&&!Ub(h))&&!(h=Do(h))&&yh(u)?nl(Xa(u),0,m):u.split(h,m):[]},Se.spread=function(u,h){if("function"!=typeof u)throw new ma(Ae);return h=null==h?0:Br(Yn(h),0),ai(function(m){var N=m[h],ae=nl(m,0,h);return N&&kr(ae,N),es(u,this,ae)})},Se.tail=function(u){var h=null==u?0:u.length;return h?Ss(u,1,h):[]},Se.take=function(u,h,m){return u&&u.length?Ss(u,0,(h=m||h===J?1:Yn(h))<0?0:h):[]},Se.takeRight=function(u,h,m){var N=null==u?0:u.length;return N?Ss(u,(h=N-(h=m||h===J?1:Yn(h)))<0?0:h,N):[]},Se.takeRightWhile=function(u,h){return u&&u.length?pu(u,On(h,3),!1,!0):[]},Se.takeWhile=function(u,h){return u&&u.length?pu(u,On(h,3)):[]},Se.tap=function(u,h){return h(u),u},Se.throttle=function(u,h,m){var N=!0,ae=!0;if("function"!=typeof u)throw new ma(Ae);return wr(m)&&(N="leading"in m?!!m.leading:N,ae="trailing"in m?!!m.trailing:ae),Db(u,h,{leading:N,maxWait:h,trailing:ae})},Se.thru=Id,Se.toArray=zb,Se.toPairs=OA,Se.toPairsIn=Jb,Se.toPath=function(u){return Mn(u)?ki(u,Jn):ta(u)?[u]:Qs(tb(Ii(u)))},Se.toPlainObject=Hb,Se.transform=function(u,h,m){var N=Mn(u),ae=N||ll(u)||$h(u);if(h=On(h,4),null==m){var xe=u&&u.constructor;m=ae?N?new xe:[]:wr(u)&&ea(xe)?cu(_a(u)):{}}return(ae?ks:tl)(u,function(ze,Ke,lt){return h(m,ze,Ke,lt)}),m},Se.unary=function(u){return Dp(u,1)},Se.union=db,Se.unionBy=GC,Se.unionWith=$C,Se.uniq=function(u){return u&&u.length?wc(u):[]},Se.uniqBy=function(u,h){return u&&u.length?wc(u,On(h,2)):[]},Se.uniqWith=function(u,h){return h="function"==typeof h?h:J,u&&u.length?wc(u,J,h):[]},Se.unset=function(u,h){return null==u||fu(u,h)},Se.unzip=hb,Se.unzipWith=qC,Se.update=function(u,h,m){return null==u?u:up(u,h,t_(m))},Se.updateWith=function(u,h,m,N){return N="function"==typeof N?N:J,null==u?u:up(u,h,t_(m),N)},Se.values=kd,Se.valuesIn=function(u){return null==u?[]:Mm(u,Js(u))},Se.without=fb,Se.words=Q_,Se.wrap=function(u,h){return Ip(t_(h),u)},Se.xor=eF,Se.xorBy=Ro,Se.xorWith=w_,Se.zip=E_,Se.zipObject=function(u,h){return dp(u||[],h||[],Ja)},Se.zipObjectDeep=function(u,h){return dp(u||[],h||[],cp)},Se.zipWith=zh,Se.entries=OA,Se.entriesIn=Jb,Se.extend=SA,Se.extendWith=Nd,ty(Se,Se),Se.add=Hn,Se.attempt=Z_,Se.camelCase=kA,Se.capitalize=H_,Se.ceil=sy,Se.clamp=function(u,h,m){return m===J&&(m=h,h=J),m!==J&&(m=(m=fo(m))==m?m:0),h!==J&&(h=(h=fo(h))==h?h:0),uu(fo(u),h,m)},Se.clone=function(u){return js(u,4)},Se.cloneDeep=function(u){return js(u,5)},Se.cloneDeepWith=function(u,h){return js(u,5,h="function"==typeof h?h:J)},Se.cloneWith=function(u,h){return js(u,4,h="function"==typeof h?h:J)},Se.conformsTo=function(u,h){return null==h||sp(u,h,Cs(h))},Se.deburr=G_,Se.defaultTo=function(u,h){return null==u||u!=u?h:u},Se.divide=gF,Se.endsWith=function(u,h,m){u=Ii(u),h=Do(h);var N=u.length,ae=m=m===J?N:uu(Yn(m),0,N);return(m-=h.length)>=0&&u.slice(m,ae)==h},Se.eq=Cn,Se.escape=function(u){return(u=Ii(u))&&Qt.test(u)?u.replace(ua,TP):u},Se.escapeRegExp=function(u){return(u=Ii(u))&&ct.test(u)?u.replace(ke,"\\$&"):u},Se.every=function(u,h,m){var N=Mn(u)?Zn:Iv;return m&&zs(u,h,m)&&(h=J),N(u,On(h,3))},Se.find=JC,Se.findIndex=g_,Se.findKey=function(u,h){return mh(u,On(h,3),tl)},Se.findLast=eA,Se.findLastIndex=m_,Se.findLastKey=function(u,h){return mh(u,On(h,3),op)},Se.floor=Ul,Se.forEach=M_,Se.forEachRight=Ap,Se.forIn=function(u,h){return null==u?u:md(u,On(h,3),Js)},Se.forInRight=function(u,h){return null==u?u:_d(u,On(h,3),Js)},Se.forOwn=function(u,h){return u&&tl(u,On(h,3))},Se.forOwnRight=function(u,h){return u&&op(u,On(h,3))},Se.get=Kh,Se.gt=on,Se.gte=Fb,Se.has=function(u,h){return null!=u&&Xv(u,h,yd)},Se.hasIn=Pp,Se.head=ib,Se.identity=eo,Se.includes=function(u,h,m,N){u=ho(u)?u:kd(u),m=m&&!N?Yn(m):0;var ae=u.length;return m<0&&(m=Br(ae+m,0)),k_(u)?m<=ae&&u.indexOf(h,m)>-1:!!ae&&Ya(u,h,m)>-1},Se.indexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=null==m?0:Yn(m);return ae<0&&(ae=Br(N+ae,0)),Ya(u,h,ae)},Se.inRange=function(u,h,m){return h=cl(h),m===J?(m=h,h=0):m=cl(m),function(u,h,m){return u>=us(h,m)&&u=-Te&&u<=Te},Se.isSet=wA,Se.isString=k_,Se.isSymbol=ta,Se.isTypedArray=$h,Se.isUndefined=function(u){return u===J},Se.isWeakMap=function(u){return Er(u)&&Us(u)==k},Se.isWeakSet=function(u){return Er(u)&&"[object WeakSet]"==Es(u)},Se.join=function(u,h){return null==u?"":Sh.call(u,h)},Se.kebabCase=jA,Se.last=Qo,Se.lastIndexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=N;return m!==J&&(ae=(ae=Yn(m))<0?Br(N+ae,0):us(ae,N-1)),h==h?function(st,Mt,_t){for(var sn=_t+1;sn--;)if(st[sn]===Mt)return sn;return sn}(u,h,ae):ad(u,gc,ae,!0)},Se.lowerCase=VA,Se.lowerFirst=dF,Se.lt=Tc,Se.lte=B_,Se.max=function(u){return u&&u.length?Oh(u,eo,Ea):J},Se.maxBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Ea):J},Se.mean=function(u){return vs(u,eo)},Se.meanBy=function(u,h){return vs(u,On(h,2))},Se.min=function(u){return u&&u.length?Oh(u,eo,Pv):J},Se.minBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Pv):J},Se.stubArray=Dc,Se.stubFalse=ry,Se.stubObject=function(){return{}},Se.stubString=function(){return""},Se.stubTrue=function(){return!0},Se.multiply=fw,Se.nth=function(u,h){return u&&u.length?hu(u,Yn(h)):J},Se.noConflict=function(){return Di._===this&&(Di._=Pm),this},Se.noop=ny,Se.now=wu,Se.pad=function(u,h,m){u=Ii(u);var N=(h=Yn(h))?vh(u):0;if(!h||N>=h)return u;var ae=(h-N)/2;return gp(fi(ae),m)+u+gp(Ft(ae),m)},Se.padEnd=function(u,h,m){u=Ii(u);var N=(h=Yn(h))?vh(u):0;return h&&Nh){var N=u;u=h,h=N}if(m||u%1||h%1){var ae=xh();return us(u+ae*(h-u+I1("1e-"+((ae+"").length-1))),h)}return Pl(u,h)},Se.reduce=function(u,h,m){var N=Mn(u)?su:Go,ae=arguments.length<3;return N(u,On(h,4),m,ae,vc)},Se.reduceRight=function(u,h,m){var N=Mn(u)?od:Go,ae=arguments.length<3;return N(u,On(h,4),m,ae,qm)},Se.repeat=function(u,h,m){return h=(m?zs(u,h,m):h===J)?1:Yn(h),lp(Ii(u),h)},Se.replace=function(){var u=arguments,h=Ii(u[0]);return u.length<3?h:h.replace(u[1],u[2])},Se.result=function(u,h,m){var N=-1,ae=(h=Sc(h,u)).length;for(ae||(ae=1,u=J);++NTe)return[];var m=ye,N=us(u,ye);h=On(h),u-=ye;for(var ae=cd(N,h);++m=xe)return u;var Ke=m-vh(N);if(Ke<1)return N;var lt=ze?nl(ze,0,Ke).join(""):u.slice(0,Ke);if(ae===J)return lt+N;if(ze&&(Ke+=lt.length-Ke),Ub(ae)){if(u.slice(Ke).search(ae)){var Ot,Nt=lt;for(ae.global||(ae=Om(ae.source,Ii(zn.exec(ae))+"g")),ae.lastIndex=0;Ot=ae.exec(Nt);)var Bt=Ot.index;lt=lt.slice(0,Bt===J?Ke:Bt)}}else if(u.indexOf(Do(ae),Ke)!=Ke){var Jt=lt.lastIndexOf(ae);Jt>-1&&(lt=lt.slice(0,Jt))}return lt+N},Se.unescape=function(u){return(u=Ii(u))&&ms.test(u)?u.replace(Al,Rm):u},Se.uniqueId=function(u){var h=++PP;return Ii(u)+h},Se.upperCase=sw,Se.upperFirst=kp,Se.each=M_,Se.eachRight=Ap,Se.first=ib,ty(Se,function(){var u={};return tl(Se,function(h,m){ji.call(Se.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),Se.VERSION="4.17.21",ks(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){Se[u].placeholder=Se}),ks(["drop","take"],function(u,h){oi.prototype[u]=function(m){m=m===J?1:Br(Yn(m),0);var N=this.__filtered__&&!h?new oi(this):this.clone();return N.__filtered__?N.__takeCount__=us(m,N.__takeCount__):N.__views__.push({size:us(m,ye),type:u+(N.__dir__<0?"Right":"")}),N},oi.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),ks(["filter","map","takeWhile"],function(u,h){var m=h+1,N=1==m||3==m;oi.prototype[u]=function(ae){var xe=this.clone();return xe.__iteratees__.push({iteratee:On(ae,3),type:m}),xe.__filtered__=xe.__filtered__||N,xe}}),ks(["head","last"],function(u,h){var m="take"+(h?"Right":"");oi.prototype[u]=function(){return this[m](1).value()[0]}}),ks(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");oi.prototype[u]=function(){return this.__filtered__?new oi(this):this[m](1)}}),oi.prototype.compact=function(){return this.filter(eo)},oi.prototype.find=function(u){return this.filter(u).head()},oi.prototype.findLast=function(u){return this.reverse().find(u)},oi.prototype.invokeMap=ai(function(u,h){return"function"==typeof u?new oi(this):this.map(function(m){return Sa(m,u,h)})}),oi.prototype.reject=function(u){return this.filter(N_(On(u)))},oi.prototype.slice=function(u,h){u=Yn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new oi(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==J&&(m=(h=Yn(h))<0?m.dropRight(-h):m.take(h-u)),m)},oi.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},oi.prototype.toArray=function(){return this.take(ye)},tl(oi.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),N=/^(?:head|last)$/.test(h),ae=Se[N?"take"+("last"==h?"Right":""):h],xe=N||/^find/.test(h);!ae||(Se.prototype[h]=function(){var ze=this.__wrapped__,Ke=N?[1]:arguments,lt=ze instanceof oi,Ot=Ke[0],Nt=lt||Mn(ze),Bt=function(ci){var vi=ae.apply(Se,kr([ci],Ke));return N&&Jt?vi[0]:vi};Nt&&m&&"function"==typeof Ot&&1!=Ot.length&&(lt=Nt=!1);var Jt=this.__chain__,_n=!!this.__actions__.length,Fn=xe&&!Jt,li=lt&&!_n;if(!xe&&Nt){ze=li?ze:new oi(this);var kn=u.apply(ze,Ke);return kn.__actions__.push({func:Id,args:[Bt],thisArg:J}),new To(kn,Jt)}return Fn&&li?u.apply(this,Ke):(kn=this.thru(Bt),Fn?N?kn.value()[0]:kn.value():kn)})}),ks(["pop","push","shift","sort","splice","unshift"],function(u){var h=or[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",N=/^(?:pop|shift)$/.test(u);Se.prototype[u]=function(){var ae=arguments;if(N&&!this.__chain__){var xe=this.value();return h.apply(Mn(xe)?xe:[],ae)}return this[m](function(ze){return h.apply(Mn(ze)?ze:[],ae)})}}),tl(oi.prototype,function(u,h){var m=Se[h];if(m){var N=m.name+"";ji.call(hd,N)||(hd[N]=[]),hd[N].push({name:h,func:m})}}),hd[Cc(J,2).name]=[{name:"wrapper",func:J}],oi.prototype.clone=function(){var u=new oi(this.__wrapped__);return u.__actions__=Qs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Qs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Qs(this.__views__),u},oi.prototype.reverse=function(){if(this.__filtered__){var u=new oi(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},oi.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Mn(u),N=h<0,ae=m?u.length:0,xe=function(u,h,m){for(var N=-1,ae=m.length;++N=this.__values__.length;return{done:u,value:u?J:this.__values__[this.__index__++]}},Se.prototype.plant=function(u){for(var h,m=this;m instanceof Mh;){var N=Sp(m);N.__index__=0,N.__values__=J,h?ae.__wrapped__=N:h=N;var ae=N;m=m.__wrapped__}return ae.__wrapped__=u,h},Se.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof oi){var h=u;return this.__actions__.length&&(h=new oi(this)),(h=h.reverse()).__actions__.push({func:Id,args:[b_],thisArg:J}),new To(h,this.__chain__)}return this.thru(b_)},Se.prototype.toJSON=Se.prototype.valueOf=Se.prototype.value=function(){return cC(this.__wrapped__,this.__actions__)},Se.prototype.first=Se.prototype.head,Eh&&(Se.prototype[Eh]=function(){return this}),Se}();Di._=bh,(gt=function(){return bh}.call(it,tt,it,kt))!==J&&(kt.exports=gt)}.call(this)},478:function(kt){kt.exports=function(){"use strict";function it(rt,ot){for(var ut=0;utrt.length)&&(ot=rt.length);for(var ut=0,pe=new Array(ot);ut=rt.length?{done:!0}:{done:!1,value:rt[pe++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var dt={exports:{}};function K(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}dt.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:K,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,q=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,re={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(ot){return re[ot]};var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function O(rt){return rt.replace(S,function(ot,ut){return"colon"===(ut=ut.toLowerCase())?":":"#"===ut.charAt(0)?"x"===ut.charAt(1)?String.fromCharCode(parseInt(ut.substring(2),16)):String.fromCharCode(+ut.substring(1)):""})}var T=/(^|[^\[])\^/g;var y=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var j={},I=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,Y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(rt,ot){j[" "+rt]||(j[" "+rt]=I.test(rt)?rt+"/":U(rt,"/",!0));var ut=-1===(rt=j[" "+rt]).indexOf(":");return"//"===ot.substring(0,2)?ut?ot:rt.replace(H,"$1")+ot:"/"===ot.charAt(0)?ut?ot:rt.replace(Y,"$1")+ot:rt+ot}function U(rt,ot,ut){var pe=rt.length;if(0===pe)return"";for(var ve=0;ve1;)1&ot&&(ut+=rt),ot>>=1,rt+=rt;return ut+rt},Te=dt.exports.defaults,me=U,te=function(rt,ot){var pe=rt.replace(/\|/g,function(ke,ct,Qe){for(var vt=!1,xt=ct;--xt>=0&&"\\"===Qe[xt];)vt=!vt;return vt?"|":" |"}).split(/ \|/),ve=0;if(pe.length>ot)pe.splice(ot);else for(;pe.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},ot.code=function(pe){var ve=this.rules.block.code.exec(pe);if(ve){var ke=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:me(ke,"\n")}}},ot.fences=function(pe){var ve=this.rules.block.fences.exec(pe);if(ve){var ke=ve[0],ct=function(rt,ot){var ut=rt.match(/^(\s+)(?:```)/);if(null===ut)return ot;var pe=ut[1];return ot.split("\n").map(function(ve){var ke=ve.match(/^\s+/);return null===ke?ve:ke[0].length>=pe.length?ve.slice(pe.length):ve}).join("\n")}(ke,ve[3]||"");return{type:"code",raw:ke,lang:ve[2]?ve[2].trim():ve[2],text:ct}}},ot.heading=function(pe){var ve=this.rules.block.heading.exec(pe);if(ve){var ke=ve[2].trim();if(/#$/.test(ke)){var ct=me(ke,"#");(this.options.pedantic||!ct||/ $/.test(ct))&&(ke=ct.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:ke}}},ot.nptable=function(pe){var ve=this.rules.block.nptable.exec(pe);if(ve){var ke={type:"table",header:te(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(ke.header.length===ke.align.length){var Qe,ct=ke.align.length;for(Qe=0;Qe ?/gm,"");return{type:"blockquote",raw:ve[0],text:ke}}},ot.list=function(pe){var ve=this.rules.block.list.exec(pe);if(ve){var $t,jn,ii,Dn,fn,zn,bn,Qi,Zi,ke=ve[0],ct=ve[2],Qe=ct.length>1,vt={type:"list",raw:ke,ordered:Qe,start:Qe?+ct.slice(0,-1):"",loose:!1,items:[]},xt=ve[0].match(this.rules.block.item),Tt=!1,qn=xt.length;ii=this.rules.block.listItemStart.exec(xt[0]);for(var Pi=0;Piii[1].length:Dn[1].length>=ii[0].length||Dn[1].length>3){xt.splice(Pi,2,xt[Pi]+(!this.options.pedantic&&Dn[1].length/i.test(ct[0])&&(ve=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(ct[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ct[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:ct[0],inLink:ve,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ct[0]):ye(ct[0]):ct[0]}},ot.link=function(pe){var ve=this.rules.inline.link.exec(pe);if(ve){var ke=ve[2].trim();if(!this.options.pedantic&&/^$/.test(ke))return;var ct=me(ke.slice(0,-1),"\\");if((ke.length-ct.length)%2==0)return}else{var Qe=De(ve[2],"()");if(Qe>-1){var xt=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Qe;ve[2]=ve[2].substring(0,Qe),ve[0]=ve[0].substring(0,xt).trim(),ve[3]=""}}var Tt=ve[2],$t="";if(this.options.pedantic){var jn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Tt);jn&&(Tt=jn[1],$t=jn[3])}else $t=ve[3]?ve[3].slice(1,-1):"";return Tt=Tt.trim(),/^$/.test(ke)?Tt.slice(1):Tt.slice(1,-1)),Ve(ve,{href:Tt&&Tt.replace(this.rules.inline._escapes,"$1"),title:$t&&$t.replace(this.rules.inline._escapes,"$1")},ve[0])}},ot.reflink=function(pe,ve){var ke;if((ke=this.rules.inline.reflink.exec(pe))||(ke=this.rules.inline.nolink.exec(pe))){var ct=(ke[2]||ke[1]).replace(/\s+/g," ");if(!(ct=ve[ct.toLowerCase()])||!ct.href){var Qe=ke[0].charAt(0);return{type:"text",raw:Qe,text:Qe}}return Ve(ke,ct,ke[0])}},ot.emStrong=function(pe,ve,ke){void 0===ke&&(ke="");var ct=this.rules.inline.emStrong.lDelim.exec(pe);if(ct&&(!ct[3]||!ke.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Qe=ct[1]||ct[2]||"";if(!Qe||Qe&&(""===ke||this.rules.inline.punctuation.exec(ke))){var xt,Tt,vt=ct[0].length-1,$t=vt,jn=0,ii="*"===ct[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ii.lastIndex=0,ve=ve.slice(-1*pe.length+vt);null!=(ct=ii.exec(ve));)if(xt=ct[1]||ct[2]||ct[3]||ct[4]||ct[5]||ct[6]){if(Tt=xt.length,ct[3]||ct[4]){$t+=Tt;continue}if((ct[5]||ct[6])&&vt%3&&!((vt+Tt)%3)){jn+=Tt;continue}if(!(($t-=Tt)>0))return Tt=Math.min(Tt,Tt+$t+jn),Math.min(vt,Tt)%2?{type:"em",raw:pe.slice(0,vt+ct.index+Tt+1),text:pe.slice(1,vt+ct.index+Tt)}:{type:"strong",raw:pe.slice(0,vt+ct.index+Tt+1),text:pe.slice(2,vt+ct.index+Tt-1)}}}}},ot.codespan=function(pe){var ve=this.rules.inline.code.exec(pe);if(ve){var ke=ve[2].replace(/\n/g," "),ct=/[^ ]/.test(ke),Qe=/^ /.test(ke)&&/ $/.test(ke);return ct&&Qe&&(ke=ke.substring(1,ke.length-1)),ke=ye(ke,!0),{type:"codespan",raw:ve[0],text:ke}}},ot.br=function(pe){var ve=this.rules.inline.br.exec(pe);if(ve)return{type:"br",raw:ve[0]}},ot.del=function(pe){var ve=this.rules.inline.del.exec(pe);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},ot.autolink=function(pe,ve){var ct,Qe,ke=this.rules.inline.autolink.exec(pe);if(ke)return Qe="@"===ke[2]?"mailto:"+(ct=ye(this.options.mangle?ve(ke[1]):ke[1])):ct=ye(ke[1]),{type:"link",raw:ke[0],text:ct,href:Qe,tokens:[{type:"text",raw:ct,text:ct}]}},ot.url=function(pe,ve){var ke;if(ke=this.rules.inline.url.exec(pe)){var ct,Qe;if("@"===ke[2])Qe="mailto:"+(ct=ye(this.options.mangle?ve(ke[0]):ke[0]));else{var vt;do{vt=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0]}while(vt!==ke[0]);ct=ye(ke[0]),Qe="www."===ke[1]?"http://"+ct:ct}return{type:"link",raw:ke[0],text:ct,href:Qe,tokens:[{type:"text",raw:ct,text:ct}]}}},ot.inlineText=function(pe,ve,ke){var Qe,ct=this.rules.inline.text.exec(pe);if(ct)return Qe=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ct[0]):ye(ct[0]):ct[0]:ye(this.options.smartypants?ke(ct[0]):ct[0]),{type:"text",raw:ct[0],text:Qe}},rt}(),Je=se_noopTest,Ye=se_edit,je=se_merge,Le={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Je,table:Je,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Le.def=Ye(Le.def).replace("label",Le._label).replace("title",Le._title).getRegex(),Le.bullet=/(?:[*+-]|\d{1,9}[.)])/,Le.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Le.item=Ye(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Ye(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Ye(Le.list).replace(/bull/g,Le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Le.def.source+")").getRegex(),Le._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Le._comment=/|$)/,Le.html=Ye(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Ye(Le._paragraph).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.blockquote=Ye(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=je({},Le),Le.gfm=je({},Le.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Le.gfm.nptable=Ye(Le.gfm.nptable).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.gfm.table=Ye(Le.gfm.table).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.pedantic=je({},Le.normal,{html:Ye("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Je,paragraph:Ye(Le.normal._paragraph).replace("hr",Le.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ee.punctuation=Ye(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ee.escapedEmSt=/\\\*|\\_/g,Ee._comment=Ye(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ee.emStrong.lDelim=Ye(Ee.emStrong.lDelim).replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimAst=Ye(Ee.emStrong.rDelimAst,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimUnd=Ye(Ee.emStrong.rDelimUnd,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ee.autolink=Ye(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Ye(Ee.tag).replace("comment",Ee._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Ye(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Ye(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Ye(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=je({},Ee),Ee.pedantic=je({},Ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ye(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=je({},Ee.normal,{escape:Ye(Ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(pe="x"+pe.toString(16)),ot+="&#"+pe+";";return ot}var Pe=function(){function rt(ut){this.tokens=[],this.tokens.links=Object.create(null),this.options=ut||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var pe={block:Be.normal,inline:z.normal};this.options.pedantic?(pe.block=Be.pedantic,pe.inline=z.pedantic):this.options.gfm&&(pe.block=Be.gfm,pe.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=pe}rt.lex=function(pe,ve){return new rt(ve).lex(pe)},rt.lexInline=function(pe,ve){return new rt(ve).inlineTokens(pe)};var ot=rt.prototype;return ot.lex=function(pe){return pe=pe.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(pe,this.tokens,!0),this.inline(this.tokens),this.tokens},ot.blockTokens=function(pe,ve,ke){var Qe,vt,xt,Tt,$t,jn,ct=this;for(void 0===ve&&(ve=[]),void 0===ke&&(ke=!0),this.options.pedantic&&(pe=pe.replace(/^ +$/gm,""));pe;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Dn){return!!(Qe=Dn.call(ct,pe,ve))&&(pe=pe.substring(Qe.raw.length),ve.push(Qe),!0)}))){if(Qe=this.tokenizer.space(pe)){pe=pe.substring(Qe.raw.length),Qe.type&&ve.push(Qe);continue}if(Qe=this.tokenizer.code(pe)){pe=pe.substring(Qe.raw.length),(Tt=ve[ve.length-1])&&"paragraph"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe);continue}if(Qe=this.tokenizer.fences(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.heading(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.nptable(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.hr(pe)){pe=pe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.blockquote(pe)){pe=pe.substring(Qe.raw.length),Qe.tokens=this.blockTokens(Qe.text,[],ke),ve.push(Qe);continue}if(Qe=this.tokenizer.list(pe)){for(pe=pe.substring(Qe.raw.length),xt=Qe.items.length,vt=0;vt=0&&(Dn=Math.min(Dn,zn))}),Dn<1/0&&Dn>=0&&($t=pe.substring(0,Dn+1))}(),ke&&(Qe=this.tokenizer.paragraph($t))){Tt=ve[ve.length-1],jn&&"paragraph"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe),jn=$t.length!==pe.length,pe=pe.substring(Qe.raw.length);continue}if(Qe=this.tokenizer.text(pe)){pe=pe.substring(Qe.raw.length),(Tt=ve[ve.length-1])&&"text"===Tt.type?(Tt.raw+="\n"+Qe.raw,Tt.text+="\n"+Qe.text):ve.push(Qe);continue}if(pe){var ii="Infinite loop on byte: "+pe.charCodeAt(0);if(this.options.silent){console.error(ii);break}throw new Error(ii)}}return ve},ot.inline=function(pe){var ve,ke,ct,Qe,vt,xt,Tt=pe.length;for(ve=0;ve0)for(;null!=(jn=this.tokenizer.rules.inline.reflinkSearch.exec($t));)fn.includes(jn[0].slice(jn[0].lastIndexOf("[")+1,-1))&&($t=$t.slice(0,jn.index)+"["+X("a",jn[0].length-2)+"]"+$t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(jn=this.tokenizer.rules.inline.blockSkip.exec($t));)$t=$t.slice(0,jn.index)+"["+X("a",jn[0].length-2)+"]"+$t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(jn=this.tokenizer.rules.inline.escapedEmSt.exec($t));)$t=$t.slice(0,jn.index)+"++"+$t.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;pe;)if(ii||(Dn=""),ii=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(bn){return!!(vt=bn.call(Qe,pe,ve))&&(pe=pe.substring(vt.raw.length),ve.push(vt),!0)}))){if(vt=this.tokenizer.escape(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.tag(pe,ke,ct)){pe=pe.substring(vt.raw.length),ke=vt.inLink,ct=vt.inRawBlock,(xt=ve[ve.length-1])&&"text"===vt.type&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.link(pe)){pe=pe.substring(vt.raw.length),"link"===vt.type&&(vt.tokens=this.inlineTokens(vt.text,[],!0,ct)),ve.push(vt);continue}if(vt=this.tokenizer.reflink(pe,this.tokens.links)){pe=pe.substring(vt.raw.length),xt=ve[ve.length-1],"link"===vt.type?(vt.tokens=this.inlineTokens(vt.text,[],!0,ct),ve.push(vt)):xt&&"text"===vt.type&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.emStrong(pe,$t,Dn)){pe=pe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,ct),ve.push(vt);continue}if(vt=this.tokenizer.codespan(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.br(pe)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.del(pe)){pe=pe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,ct),ve.push(vt);continue}if(vt=this.tokenizer.autolink(pe,ce)){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(!ke&&(vt=this.tokenizer.url(pe,ce))){pe=pe.substring(vt.raw.length),ve.push(vt);continue}if(Tt=pe,this.options.extensions&&this.options.extensions.startInline&&function(){var bn=1/0,Qi=pe.slice(1),Zi=void 0;Qe.options.extensions.startInline.forEach(function(qn){"number"==typeof(Zi=qn.call(this,Qi))&&Zi>=0&&(bn=Math.min(bn,Zi))}),bn<1/0&&bn>=0&&(Tt=pe.substring(0,bn+1))}(),vt=this.tokenizer.inlineText(Tt,ct,be)){pe=pe.substring(vt.raw.length),"_"!==vt.raw.slice(-1)&&(Dn=vt.raw.slice(-1)),ii=!0,(xt=ve[ve.length-1])&&"text"===xt.type?(xt.raw+=vt.raw,xt.text+=vt.text):ve.push(vt);continue}if(pe){var zn="Infinite loop on byte: "+pe.charCodeAt(0);if(this.options.silent){console.error(zn);break}throw new Error(zn)}}return ve},function(rt,ot,ut){ot&&it(rt.prototype,ot),ut&&it(rt,ut)}(rt,null,[{key:"rules",get:function(){return{block:Be,inline:z}}}]),rt}(),wt=dt.exports.defaults,pt=se_cleanUrl,fe=se_escape,B=function(){function rt(ut){this.options=ut||wt}var ot=rt.prototype;return ot.code=function(pe,ve,ke){var ct=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Qe=this.options.highlight(pe,ct);null!=Qe&&Qe!==pe&&(ke=!0,pe=Qe)}return pe=pe.replace(/\n$/,"")+"\n",ct?'
    '+(ke?pe:fe(pe,!0))+"
    \n":"
    "+(ke?pe:fe(pe,!0))+"
    \n"},ot.blockquote=function(pe){return"
    \n"+pe+"
    \n"},ot.html=function(pe){return pe},ot.heading=function(pe,ve,ke,ct){return this.options.headerIds?"'+pe+"\n":""+pe+"\n"},ot.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},ot.list=function(pe,ve,ke){var ct=ve?"ol":"ul";return"<"+ct+(ve&&1!==ke?' start="'+ke+'"':"")+">\n"+pe+"\n"},ot.listitem=function(pe){return"
  • "+pe+"
  • \n"},ot.checkbox=function(pe){return" "},ot.paragraph=function(pe){return"

    "+pe+"

    \n"},ot.table=function(pe,ve){return ve&&(ve=""+ve+""),"\n\n"+pe+"\n"+ve+"
    \n"},ot.tablerow=function(pe){return"\n"+pe+"\n"},ot.tablecell=function(pe,ve){var ke=ve.header?"th":"td";return(ve.align?"<"+ke+' align="'+ve.align+'">':"<"+ke+">")+pe+"\n"},ot.strong=function(pe){return""+pe+""},ot.em=function(pe){return""+pe+""},ot.codespan=function(pe){return""+pe+""},ot.br=function(){return this.options.xhtml?"
    ":"
    "},ot.del=function(pe){return""+pe+""},ot.link=function(pe,ve,ke){if(null===(pe=pt(this.options.sanitize,this.options.baseUrl,pe)))return ke;var ct='"+ke+""},ot.image=function(pe,ve,ke){if(null===(pe=pt(this.options.sanitize,this.options.baseUrl,pe)))return ke;var ct=''+ke+'":">")},ot.text=function(pe){return pe},rt}(),R=function(){function rt(){}var ot=rt.prototype;return ot.strong=function(pe){return pe},ot.em=function(pe){return pe},ot.codespan=function(pe){return pe},ot.del=function(pe){return pe},ot.html=function(pe){return pe},ot.text=function(pe){return pe},ot.link=function(pe,ve,ke){return""+ke},ot.image=function(pe,ve,ke){return""+ke},ot.br=function(){return""},rt}(),k=function(){function rt(){this.seen={}}var ot=rt.prototype;return ot.serialize=function(pe){return pe.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ot.getNextSafeSlug=function(pe,ve){var ke=pe,ct=0;if(this.seen.hasOwnProperty(ke)){ct=this.seen[pe];do{ke=pe+"-"+ ++ct}while(this.seen.hasOwnProperty(ke))}return ve||(this.seen[pe]=ct,this.seen[ke]=0),ke},ot.slug=function(pe,ve){void 0===ve&&(ve={});var ke=this.serialize(pe);return this.getNextSafeSlug(ke,ve.dryrun)},rt}(),Oe=B,Xe=R,yt=k,It=dt.exports.defaults,Tn=se_unescape,Gn=Pe,yi=function(){function rt(ut){this.options=ut||It,this.options.renderer=this.options.renderer||new Oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new yt}rt.parse=function(pe,ve){return new rt(ve).parse(pe)},rt.parseInline=function(pe,ve){return new rt(ve).parseInline(pe)};var ot=rt.prototype;return ot.parse=function(pe,ve){void 0===ve&&(ve=!0);var ct,Qe,vt,xt,Tt,$t,jn,ii,Dn,fn,zn,bn,Qi,Zi,qn,Pi,da,$r,ne,ke="",de=pe.length;for(ct=0;ct0&&"text"===qn.tokens[0].type?(qn.tokens[0].text=$r+" "+qn.tokens[0].text,qn.tokens[0].tokens&&qn.tokens[0].tokens.length>0&&"text"===qn.tokens[0].tokens[0].type&&(qn.tokens[0].tokens[0].text=$r+" "+qn.tokens[0].tokens[0].text)):qn.tokens.unshift({type:"text",text:$r}):Zi+=$r),Zi+=this.parse(qn.tokens,Qi),Dn+=this.renderer.listitem(Zi,da,Pi);ke+=this.renderer.list(Dn,zn,bn);continue;case"html":ke+=this.renderer.html(fn.text);continue;case"paragraph":ke+=this.renderer.paragraph(this.parseInline(fn.tokens));continue;case"text":for(Dn=fn.tokens?this.parseInline(fn.tokens):fn.text;ct+1An error occurred:

    "+qa(vt.message+"",!0)+"
    ";throw vt}}return Qt.options=Qt.setOptions=function(rt){return Ps(Qt.defaults,rt),ua(Qt.defaults),Qt},Qt.getDefaults=Al,Qt.defaults=ms,Qt.use=function(){for(var rt=this,ot=arguments.length,ut=new Array(ot),pe=0;peAn error occurred:

    "+qa(pe.message+"",!0)+"
    ";throw pe}},Qt.Parser=yi,Qt.parser=yi.parse,Qt.Renderer=Hr,Qt.TextRenderer=Ns,Qt.Lexer=Gn,Qt.lexer=Gn.lex,Qt.Tokenizer=hi,Qt.Slugger=cs,Qt.parse=Qt,Qt}()},369:(kt,it,tt)=>{var gt=tt(284),J=tt(830);function At(){this.clear()}At.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},At.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},At.prototype.dequeue=function(){if(this.size){var dt=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,dt}},At.prototype.peek=function(){if(this.size)return this.items[this.offset]},At.prototype.forEach=function(dt,K){K=arguments.length>1?K:this;for(var Ae=this.offset,he=0,q=this.items.length;Ae=dt.length)return{done:!0};var Ae=dt[K];return K++,{value:Ae,done:!1}})},At.prototype.entries=function(){var dt=this.items,K=this.offset,Ae=0;return new gt(function(){if(K>=dt.length)return{done:!0};var he=dt[K];return K++,{value:[Ae++,he],done:!1}})},"undefined"!=typeof Symbol&&(At.prototype[Symbol.iterator]=At.prototype.values),At.prototype.toString=function(){return this.toArray().join(",")},At.prototype.toJSON=function(){return this.toArray()},At.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:At,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(At.prototype[Symbol.for("nodejs.util.inspect.custom")]=At.prototype.inspect),At.from=function(dt){var K=new At;return J(dt,function(Ae){K.enqueue(Ae)}),K},At.of=function(){return At.from(arguments)},kt.exports=At},830:kt=>{var it="undefined"!=typeof ArrayBuffer,tt="undefined"!=typeof Symbol;function gt(J,At){var dt,K,Ae,he,q;if(!J)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof At)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(J)||it&&ArrayBuffer.isView(J)||"string"==typeof J||"[object Arguments]"===J.toString())for(Ae=0,he=J.length;Ae{function it(tt){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:tt}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var tt=this._next();return tt.done&&(this.done=!0),tt},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var tt=arguments,gt=tt.length,J=0;return new it(function(){return J>=gt?{done:!0}:{done:!1,value:tt[J++]}})},it.empty=function(){var tt=new it(null);return tt.done=!0,tt},it.is=function(tt){return tt instanceof it||"object"==typeof tt&&null!==tt&&"function"==typeof tt.next},kt.exports=it},310:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==J.window.orientation},it.default=function(he){if(!he&&!(0,At.default)())return"Node";if((0,dt.default)(he))return"Electron";var q="undefined"!=typeof navigator?navigator:{},V=he||q.userAgent||"";if(V.indexOf("Edge")>-1)return"Edge";var L=-1!==V.indexOf("MSIE "),re=-1!==V.indexOf("Trident/");return L||re?"IE":J.window.chrome?"Chrome":J.window.safari?"Safari":J.window.mozInnerScreenX?"Firefox":"Unknown"};var J=tt(151),At=gt(tt(602)),dt=gt(tt(344))},151:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var J=gt(tt(321)),At={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&process};it.self=At.self||At.window||At.global,it.window=At.window||At.self||At.global,it.global=At.global||At.self||At.window,it.document=At.document||{},it.process=At.process||{};var V=console;it.console=V},761:(kt,it,tt)=>{"use strict";var J=tt(948),At=tt(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"jU",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Ae.default}});var dt=tt(151),K=V(tt(602)),Ae=V(tt(310));J(tt(344));function q(L){if("function"!=typeof WeakMap)return null;var re=new WeakMap,$=new WeakMap;return(q=function(S){return S?$:re})(L)}function V(L,re){if(!re&&L&&L.__esModule)return L;if(null===L||"object"!==At(L)&&"function"!=typeof L)return{default:L};var $=q(re);if($&&$.has(L))return $.get(L);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in L)if("default"!==O&&Object.prototype.hasOwnProperty.call(L,O)){var T=S?Object.getOwnPropertyDescriptor(L,O):null;T&&(T.get||T.set)?Object.defineProperty(b,O,T):b[O]=L[O]}return b.default=L,$&&$.set(L,b),b}},602:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var J=gt(tt(321)),At=gt(tt(344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,At.default)()}},344:(kt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,J.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,J.default)(process.versions)&&Boolean(process.versions.electron))return!0;var K="object"===("undefined"==typeof navigator?"undefined":(0,J.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Ae=dt||K;return!!(Ae&&Ae.indexOf("Electron")>=0)};var J=gt(tt(321))},991:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(At,dt,K,Ae){void 0===Ae&&(Ae=K),Object.defineProperty(At,Ae,{enumerable:!0,get:function(){return dt[K]}})}:function(At,dt,K,Ae){void 0===Ae&&(Ae=K),At[Ae]=dt[K]}),J=this&&this.__exportStar||function(At,dt){for(var K in At)"default"!==K&&!Object.prototype.hasOwnProperty.call(dt,K)&>(dt,At,K)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(180),it),J(tt(103),it),J(tt(965),it),J(tt(595),it),J(tt(417),it),J(tt(451),it),J(tt(735),it)},180:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(J){this.termType="BlankNode",this.value=J}equals(J){return!!J&&"BlankNode"===J.termType&&J.value===this.value}}},103:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const gt=tt(180),J=tt(965),At=tt(595),dt=tt(417),K=tt(451),Ae=tt(735);let he=0;it.DataFactory=class{constructor(L){this.blankNodeCounter=0,this.blankNodePrefix=(L=L||{}).blankNodePrefix||`df_${he++}_`}namedNode(L){return new dt.NamedNode(L)}blankNode(L){return new gt.BlankNode(L||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(L,re){return new At.Literal(L,re)}variable(L){return new Ae.Variable(L)}defaultGraph(){return J.DefaultGraph.INSTANCE}quad(L,re,$,b){return new K.Quad(L,re,$,b||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(At.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}}},965:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class tt{constructor(){this.termType="DefaultGraph",this.value=""}equals(J){return!!J&&"DefaultGraph"===J.termType}}it.DefaultGraph=tt,tt.INSTANCE=new tt},595:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const gt=tt(417);class J{constructor(dt,K){this.termType="Literal",this.value=dt,"string"==typeof K?(this.language=K,this.datatype=J.RDF_LANGUAGE_STRING):K?(this.language="",this.datatype=K):(this.language="",this.datatype=J.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=J,J.RDF_LANGUAGE_STRING=new gt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),J.XSD_STRING=new gt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(J){this.termType="NamedNode",this.value=J}equals(J){return!!J&&"NamedNode"===J.termType&&J.value===this.value}}},451:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(J,At,dt,K){this.termType="Quad",this.value="",this.subject=J,this.predicate=At,this.object=dt,this.graph=K}equals(J){return!!J&&("Quad"===J.termType||!J.termType)&&this.subject.equals(J.subject)&&this.predicate.equals(J.predicate)&&this.object.equals(J.object)&&this.graph.equals(J.graph)}}},735:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(J){this.termType="Variable",this.value=J}equals(J){return!!J&&"Variable"===J.termType&&J.value===this.value}}},609:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(b,S,O,T){void 0===T&&(T=O),Object.defineProperty(b,T,{enumerable:!0,get:function(){return S[O]}})}:function(b,S,O,T){void 0===T&&(T=O),b[T]=S[O]}),J=this&&this.__exportStar||function(b,S){for(var O in b)"default"!==O&&!Object.prototype.hasOwnProperty.call(S,O)&>(S,b,O)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const At=tt(991),dt=tt(938),K=tt(60);J(tt(938),it),J(tt(871),it),J(tt(60),it);const Ae=new At.DataFactory,he=new K.Translator;function q(b,S){return he.fromRdf(b,S)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(b=>Ae.namedNode(b)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(b=>Ae.namedNode(b)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(b=>Ae.namedNode(b)),["object"]),it.fromRdf=q,it.toRdf=function(b,S){return S&&"namedNode"in S&&(S={dataFactory:S}),(S=S||{})&&!S.dataFactory&&(S.dataFactory=Ae),he.toRdf(b,S)},it.getTermRaw=function(b,S){return"Literal"===b.termType?q(b,S):b.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Translator=void 0,it.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(J){throw new Error(`Invalid RDF ${J.datatype.value} value: '${J.value}'`)}registerHandler(J,At,dt){for(const K of At)this.supportedRdfDatatypes.push(K),this.fromRdfHandlers[K.value]=J;for(const K of dt){let Ae=this.toRdfHandlers[K];Ae||(this.toRdfHandlers[K]=Ae=[]),Ae.push(J)}}fromRdf(J,At){const dt=this.fromRdfHandlers[J.datatype.value];return dt?dt.fromRdf(J,At):J.value}toRdf(J,At){const dt=this.toRdfHandlers[typeof J];if(dt)for(const K of dt){const Ae=K.toRdf(J,At);if(Ae)return Ae}throw new Error(`Invalid JavaScript value: '${J}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const gt=tt(60);class J{fromRdf(dt,K){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return K&>.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:K,dataFactory:Ae}){return Ae.literal(dt?"true":"false",K||Ae.namedNode(J.TYPE))}}it.TypeHandlerBoolean=J,J.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const gt=tt(60);class J{fromRdf(dt,K){switch(K&&!dt.value.match(J.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&>.Translator.incorrectRdfDataType(dt),dt.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(dt.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const Ae=dt.value.split("-");return new Date(0,parseInt(Ae[0],10)-1,parseInt(Ae[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(dt.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(dt.value+"-01");default:return new Date(dt.value)}}toRdf(dt,{datatype:K,dataFactory:Ae}){if(K=K||Ae.namedNode(J.TYPES[0]),!(dt instanceof Date))return null;const he=dt;let q;switch(K.value){case"http://www.w3.org/2001/XMLSchema#gDay":q=String(he.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":q=he.getUTCMonth()+1+"-"+he.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":q=String(he.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":q=he.getUTCFullYear()+"-"+(he.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":q=he.toISOString().replace(/T.*$/,"");break;default:q=he.toISOString()}return Ae.literal(q,K)}}it.TypeHandlerDate=J,J.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"],J.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]$/}},554:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const gt=tt(60);class J{fromRdf(dt,K){const Ae=parseFloat(dt.value);return K&&isNaN(Ae)&>.Translator.incorrectRdfDataType(dt),Ae}toRdf(dt,{datatype:K,dataFactory:Ae}){return K=K||Ae.namedNode(J.TYPES[0]),isNaN(dt)?Ae.literal("NaN",K):isFinite(dt)?dt%1==0?null:Ae.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),K):Ae.literal(dt>0?"INF":"-INF",K)}}it.TypeHandlerNumberDouble=J,J.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(kt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const gt=tt(60);class J{fromRdf(dt,K){const Ae=parseInt(dt.value,10);return K&&(isNaN(Ae)||dt.value.indexOf(".")>=0)&>.Translator.incorrectRdfDataType(dt),Ae}toRdf(dt,{datatype:K,dataFactory:Ae}){return Ae.literal(String(dt),K||Ae.namedNode(dt<=J.MAX_INT&&dt>=J.MIN_INT?J.TYPES[0]:J.TYPES[1]))}}it.TypeHandlerNumberInteger=J,J.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"],J.MAX_INT=2147483647,J.MIN_INT=-2147483648},608:(kt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class tt{fromRdf(J){return J.value}toRdf(J,{datatype:At,dataFactory:dt}){return dt.literal(J,At)}}it.TypeHandlerString=tt,tt.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/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},938:function(kt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(At,dt,K,Ae){void 0===Ae&&(Ae=K),Object.defineProperty(At,Ae,{enumerable:!0,get:function(){return dt[K]}})}:function(At,dt,K,Ae){void 0===Ae&&(Ae=K),At[Ae]=dt[K]}),J=this&&this.__exportStar||function(At,dt){for(var K in At)"default"!==K&&!Object.prototype.hasOwnProperty.call(dt,K)&>(dt,At,K)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(727),it),J(tt(525),it),J(tt(554),it),J(tt(750),it),J(tt(608),it)},18:(kt,it,tt)=>{"use strict";var gt={};tt.r(gt),tt.d(gt,{decode:()=>ufe,encode:()=>dfe});var J={};tt.r(J),tt.d(J,{decode:()=>mfe,encode:()=>_fe});var At={};tt.r(At),tt.d(At,{decode:()=>yfe,encode:()=>vfe});var dt={};function K(n){return"function"==typeof n}tt.r(dt),tt.d(dt,{decode:()=>bfe,encode:()=>wfe});let Ae=!1;const he={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else Ae&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ae=n},get useDeprecatedSynchronousErrorHandling(){return Ae}};function q(n){setTimeout(()=>{throw n},0)}const V={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;q(n)},complete(){}},L=Array.isArray||(n=>n&&"number"==typeof n.length);function re(n){return null!==n&&"object"==typeof n}const b=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class S{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof S)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof b?t.errors:t),[])}S.EMPTY=((n=new S).closed=!0,n);const T="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends S{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=V;break;case 1:if(!e){this.destination=V;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,e,t,i)}}[T](){return this}static create(e,t,i){const r=new y(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class w extends y{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;K(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==V&&(o=Object.create(t),K(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;he.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=he;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):q(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;q(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);he.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),he.useDeprecatedSynchronousErrorHandling)throw i;q(i)}}__tryOrSetError(e,t,i){if(!he.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return he.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(q(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const I="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(n){return n}let F=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof y)return n;if(n[T])return n[T]()}return n||e||t?new y(n,e,t):new y(V)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||he.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),he.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){he.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof y?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=Q(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[I](){return this}pipe(...t){return 0===t.length?this:function(n){return 0===n.length?H:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}(t)(this)}toPromise(t){return new(t=Q(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function Q(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const U=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ie extends S{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class ue extends y{constructor(e){super(e),this.destination=e}}let ee=(()=>{class n extends F{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[T](){return new ue(this)}lift(t){const i=new se(this,this);return i.operator=t,i}next(t){if(this.closed)throw new U;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew se(e,t),n})();class se extends ee{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):S.EMPTY}}function Te(n){return n&&"function"==typeof n.schedule}function me(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new te(n,e))}}class te{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new ye(e,this.project,this.thisArg))}}class ye extends y{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const De=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ee(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Re=n=>{if(n&&"function"==typeof n[I])return(n=>e=>{const t=n[I]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(Le(n))return De(n);if(Ee(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,q),e))(n);if(n&&"function"==typeof n[Ze])return(n=>e=>{const t=n[Ze]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${re(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Be(n,e){return new F(t=>{const i=new S;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function Pe(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[I]}(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>{const r=n[I]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(Ee(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(Le(n))return Be(n,e);if(function(n){return n&&"function"==typeof n[Ze]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new F(t=>{const i=new S;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Ze](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof F?n:new F(Re(n))}class wt extends y{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class fe extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function R(n,e){if(e.closed)return;if(n instanceof F)return n.subscribe(e);let t;try{t=Re(n)(e)}catch(i){e.error(i)}return t}function k(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(k((r,s)=>Pe(n(r,s)).pipe(me((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Oe(n,t)))}class Oe{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Xe(e,this.project,this.concurrent))}}class Xe extends fe{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function It(n=Number.POSITIVE_INFINITY){return k(H,n)}function Tn(n,e){return e?Be(n,e):new F(De(n))}function Pn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Te(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof F?n[0]:It(e)(Tn(n,t))}function Gn(){return function(e){return e.lift(new yi(e))}}class yi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new hi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class hi extends y{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Hr extends F{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new S,e.add(this.source.subscribe(new cs(this.getSubject(),this))),e.closed&&(this._connection=null,e=S.EMPTY)),e}refCount(){return Gn()(this)}}const Ns=(()=>{const n=Hr.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class cs extends ue{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class Al{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function ua(){return new ee}function ms(){return n=>Gn()(function(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new Al(r,e));const s=Object.create(i,Ns);return s.source=i,s.subjectFactory=r,s}}(ua)(n))}function Qt(n){for(let e in n)if(n[e]===Qt)return e;throw Error("Could not find renamed property on target object.")}function Ka(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function rt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(rt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ot(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ut=Qt({__forward_ref__:Qt});function pe(n){return n.__forward_ref__=pe,n.toString=function(){return rt(this())},n}function ve(n){return ke(n)?n():n}function ke(n){return"function"==typeof n&&n.hasOwnProperty(ut)&&n.__forward_ref__===pe}class Qe extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function $t(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():function(n){return"string"==typeof n?n:null==n?"":String(n)}(n)}function fn(n,e){const t=e?` in ${e}`:"";throw new Qe("201",`No provider for ${$t(n)} found${t}`)}function Z(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function We(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Et(n){return{providers:n.providers||[],imports:n.imports||[]}}function pn(n){return _s(n,oo)||_s(n,Fs)}function _s(n,e){return n.hasOwnProperty(e)?n[e]:null}function Tl(n){return n&&(n.hasOwnProperty(Pr)||n.hasOwnProperty(fc))?n[Pr]:null}const oo=Qt({\u0275prov:Qt}),Pr=Qt({\u0275inj:Qt}),Fs=Qt({ngInjectableDef:Qt}),fc=Qt({ngInjectorDef:Qt});var yn=(()=>((yn=yn||{})[yn.Default=0]="Default",yn[yn.Host=1]="Host",yn[yn.Self=2]="Self",yn[yn.SkipSelf=4]="SkipSelf",yn[yn.Optional=8]="Optional",yn))();let ao;function ha(n){const e=ao;return ao=n,e}function id(n,e,t){const i=pn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&yn.Optional?null:void 0!==e?e:void fn(rt(n),"Injector")}function Ce(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),Ht=(()=>((Ht=Ht||{})[Ht.Emulated=0]="Emulated",Ht[Ht.None=2]="None",Ht[Ht.ShadowDom=3]="ShadowDom",Ht))();const ri="undefined"!=typeof globalThis&&globalThis,Fr="undefined"!=typeof window&&window,qr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,ys="undefined"!=typeof global&&global,ti=ri||ys||Fr||qr,rd={},Wi=[],Wf=Qt({\u0275cmp:Qt}),xm=Qt({\u0275dir:Qt}),fh=Qt({\u0275pipe:Qt}),gv=Qt({\u0275mod:Qt}),M1=Qt({\u0275loc:Qt}),Dl=Qt({\u0275fac:Qt}),ph=Qt({__NG_ELEMENT_ID__:Qt});let D1=0;function wn(n){return Ce(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===He.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||Wi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Ht.Emulated,id:"c",styles:n.styles||Wi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=D1++,i.inputs=vv(n.inputs,t),i.outputs=vv(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(mv):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(_v):null,i})}function mv(n){return Di(n)||function(n){return n[xm]||null}(n)}function _v(n){return function(n){return n[fh]||null}(n)}const yv={};function gn(n){return Ce(()=>{const e={type:n.type,bootstrap:n.bootstrap||Wi,declarations:n.declarations||Wi,imports:n.imports||Wi,exports:n.exports||Wi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(yv[n.id]=n.type),e})}function vv(n,e){if(null==n)return rd;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const Lt=wn;function Ls(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Di(n){return n[Wf]||null}function xo(n,e){const t=n[gv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Ho(n){return Array.isArray(n)&&"object"==typeof n[1]}function Go(n){return Array.isArray(n)&&!0===n[1]}function Tm(n){return 0!=(8&n.flags)}function ld(n){return 2==(2&n.flags)}function cd(n){return 1==(1&n.flags)}function ga(n){return null!==n.template}function bv(n){return 0!=(512&n[2])}function mc(n,e){return n.hasOwnProperty(Dl)?n[Dl]:null}class Rm{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function qi(){return Sv}function Sv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),L1}function L1(){const n=st(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===rd)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function k1(n,e,t,i){const r=st(n)||function(n,e){return n[bh]=e}(n,{previous:rd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new Rm(l&&l.currentValue,e,o===rd),n[i]=e}qi.ngInherit=!0;const bh="__ngSimpleChanges__";function st(n){return n[bh]||null}let Bi;function or(n){return!!n.listen}const au={createRenderer:(n,e)=>void 0!==Bi?Bi:"undefined"!=typeof document?document:void 0};function vr(n){for(;Array.isArray(n);)n=n[0];return n}function Ys(n,e){return vr(e[n.index])}function Pm(n,e){return n.data[e]}function Bs(n,e){const t=e[n];return Ho(t)?t:t[0]}function Ol(n){return 4==(4&n[2])}function dd(n){return 128==(128&n[2])}function _a(n,e){return null==e?null:n[e]}function Fm(n){n[18]=0}function Yf(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Ln={lFrame:cu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Cv(){return Ln.bindingsEnabled}function Ft(){return Ln.lFrame.lView}function fi(){return Ln.lFrame.tView}function ya(n){return Ln.lFrame.contextLView=n,n[8]}function ts(){let n=Lm();for(;null!==n&&64===n.type;)n=n.parent;return n}function Lm(){return Ln.lFrame.currentTNode}function Qa(n,e){const t=Ln.lFrame;t.currentTNode=n,t.isParent=e}function Br(){return Ln.lFrame.isParent}function xh(){return Ln.isInCheckNoChangesMode}function Qf(n){Ln.isInCheckNoChangesMode=n}function hd(n,e){const t=Ln.lFrame;t.bindingIndex=t.bindingRootIndex=n,km(e)}function km(n){Ln.lFrame.currentDirectiveIndex=n}function Av(){return Ln.lFrame.currentQueryIndex}function jm(n){Ln.lFrame.currentQueryIndex=n}function Jf(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function fd(n,e,t){if(t&yn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&yn.Host||(r=Jf(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ln.lFrame=Se();return i.currentTNode=e,i.lView=n,!0}function Th(n){const e=Se(),t=n[1];Ln.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Se(){const n=Ln.lFrame,e=null===n?null:n.child;return null===e?cu(n):e}function cu(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Mh(){const n=Ln.lFrame;return Ln.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const To=Mh;function oi(){const n=Mh();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Xs(){return Ln.lFrame.selectedIndex}function uo(n){Ln.lFrame.selectedIndex=n}function ep(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class Dh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function ip(n,e,t){const i=or(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let gd=!0;function rp(n){const e=gd;return gd=n,e}let $m=0;function js(n,e){const t=sp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,Wm(i.data,n),Wm(e,null),Wm(i.blueprint,null));const r=Rh(n,e),s=n.injectorIndex;if(Mv(r)){const o=pd(r),a=Ja(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function Wm(n,e){n.push(0,0,0,0,0,0,0,0,e)}function sp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Rh(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function yc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(ph)&&(i=t[ph]),null==i&&(i=t[ph]=$m++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Ov:e}(t);if("function"==typeof s){if(!fd(e,n,i))return i&yn.Host?qm(r,t,i):Iv(e,t,i,r);try{const o=s(i);if(null!=o||i&yn.Optional)return o;fn(t)}finally{To()}}else if("number"==typeof s){let o=null,a=sp(n,e),l=-1,c=i&yn.Host?e[16][6]:null;for((-1===a||i&yn.SkipSelf)&&(l=-1===a?Rh(n,e):e[a+8],-1!==l&&Nh(i,!1)?(o=e[1],a=pd(l),e=Ja(l,e)):a=-1);-1!==a;){const d=e[1];if(op(s,a,d.data)){const f=ws(a,e,t,o,i,c);if(f!==Rv)return f}l=e[a+8],-1!==l&&Nh(i,e[1].data[a+8]===c)&&op(s,a,e)?(o=d,a=pd(l),e=Ja(l,e)):a=-1}}}return Iv(e,t,i,r)}const Rv={};function Ov(){return new Wo(ts(),Ft())}function ws(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=md(a,o,t,null==i?ld(a)&&gd:i!=o&&0!=(3&a.type),r&yn.Host&&s===a);return null!==d?_d(e,o,d,a):Rv}function md(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&ga(g)&&g.type===t)return l}return null}function _d(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Dh}(r)){const o=r;o.resolving&&function(n,e){throw new Qe("200",`Circular dependency in DI detected for ${n}`)}($t(s[t]));const a=rp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ha(o.injectImpl):null;fd(n,i,yn.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=Sv(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ha(l),rp(a),o.resolving=!1,To()}}return r}function op(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Dl]||Es(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Dl]||Es(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Es(n){return ke(n)?()=>{const e=Es(ve(n));return e&&e()}:mc(n)}const vd="__parameters__";function Sa(n,e,t){return Ce(()=>{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(vd)?l[vd]:Object.defineProperty(l,vd,{value:[]})[vd];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Vt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=We({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}function qo(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Ko(t,e):e(t))}function Fh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Pl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Mo(n,e,t){let i=Ss(n,e);return i>=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function Jm(n,e){const t=Ss(n,e);if(t>=0)return n[1|t]}function Ss(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):rt(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Sc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Ec]=null,n}const xd=Sd(Sa("Inject",n=>({token:n})),-1),Yr=Sd(Sa("Optional"),8),il=Sd(Sa("SkipSelf"),4);const m_="__ngContext__";function xs(n,e){n[m_]=e}function __(n){const e=function(n){return n[m_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function xp(n){return n.ngOriginalError}function LC(n,...e){n.error(...e)}class Zo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||LC}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(xp(e)):null}_findOriginalError(e){let t=e&&xp(e);for(;t&&xp(t);)t=xp(t);return t||null}}const db=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(ti))();function sl(n){return n instanceof Function?n():n}var Ro=(()=>((Ro=Ro||{})[Ro.Important=1]="Important",Ro[Ro.DashCase=2]="DashCase",Ro))();function E_(n,e){return undefined(n,e)}function zh(n){const e=n[3];return Go(e)?e[3]:e}function Id(n){return mb(n[13])}function x_(n){return mb(n[4])}function mb(n){for(;null!==n&&!Go(n);)n=n[4];return n}function Rd(n,e,t,i,r){if(null!=i){let s,o=!1;Go(i)?s=i:Ho(i)&&(o=!0,i=i[0]);const a=vr(i);0===n&&null!==t?null==r?wb(e,t,a):ol(e,t,a,r||null,!0):1===n&&null!==t?ol(e,t,a,r||null,!0):2===n?function(n,e,t){const i=Tp(n,e);i&&function(n,e,t,i){or(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==vr(t)&&Rd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Pl(n,10+e);!function(n,e){Od(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function M_(n,e){if(!(256&e[2])){const t=e[11];or(t)&&t.destroyNode&&Od(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Ap(n[1],n);for(;e;){let t=null;if(Ho(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Ho(e)&&Ap(e[1],e),e=e[3];null===e&&(e=n),Ho(e)&&Ap(e[1],e),t=e&&e[4]}e=t}}(e)}}function Ap(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==Gh(g,c,0)||2&i&&c!==p){if(Ca(i))return!1;o=!0}}}}else{if(!o&&!Ca(i)&&!Ca(l))return!1;if(o&&Ca(l))continue;o=!1,i=l|1&i}}return Ca(i)||o}function Ca(n){return 0==(1&n)}function cA(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!Ca(o)&&(e+=Pb(s,r),r=""),i=o,s=s||!Ca(i);t++}return""!==r&&(e+=Pb(s,r)),e}const Cn={};function al(n,e){return n<<17|e<<2}function Mn(n){return n>>17&32767}function br(n){return 2|n}function jl(n){return(131068&n)>>2}function ll(n,e){return-131069&n|e<<2}function P_(n){return 1|n}function Gb(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&function(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&tp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&np(e,s,0,t)}uo(t)}(n,e,20,xh()),t(i,r)}finally{uo(s)}}function Kh(n,e,t){!Cv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||js(t,e),xs(i,e);const o=t.initialInputs;for(let a=r;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function tw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function nw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function kA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&W_(t)}}function W_(n){for(let i=Id(n);null!==i;i=x_(i))for(let r=10;r0&&W_(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&W_(r)}}function GA(n,e){const t=Bs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function sw(n){return n[7]||(n[7]=[])}function kp(n){return n.cleanup||(n.cleanup=[])}function Z_(n,e){const t=n[9],i=t?t.get(Zo,null):null;i&&i.handleError(e)}function ow(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Ko([e],a=>this.processInjectorType(a,[],s)),this.records.set(Bd,Su(void 0,this));const o=this.records.get(Eu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:rt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=gu,i=yn.Default){this.assertNotDestroyed();const r=Ed(this),s=ha(void 0);try{if(!(i&yn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Vt}(e)&&pn(e);a=l&&this.injectableDefInScope(l)?Su(iy(e),Yh):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&yn.Self?aw():this.parent).get(e,t=i&yn.Optional&&t===gu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Ec]=o[Ec]||[]).unshift(rt(e)),r)throw o;return Qs(o,e,"R3InjectorError",this.source)}throw o}finally{ha(s),Ed(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(rt(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=ve(e)))return!1;let r=Tl(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=Tl(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Ko(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||Wi))}}this.injectorDefTypes.add(o);const l=mc(o)||(()=>new o);this.records.set(o,Su(l,Yh));const c=r.providers;if(null!=c&&!a){const d=e;Ko(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Dc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return uw(n)?Su(void 0,n.useValue):Su(function(n,e,t){let i;if(Dc(n)){const r=ve(n);return mc(r)||iy(r)}if(uw(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(..._u(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Ie(ve(n.useExisting));else{const r=ve(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return mc(r)||iy(r);i=()=>new r(..._u(n.deps))}return i}(n),Yh)}(e);if(Dc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Su(void 0,Yh,!0),o.factory=()=>_u(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===Yh&&(t.value=QA,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ve(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function iy(n){const e=pn(n),t=null!==e?e.factory:mc(n);if(null!==t)return t;if(n instanceof Vt)throw new Error(`Token ${rt(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=function(n,e){const t=[];for(let i=0;it.factory(n):()=>new n}(n);throw new Error("unreachable")}function Su(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function uw(n){return null!==n&&"object"==typeof n&&hp in n}function Dc(n){return"function"==typeof n}const dw=function(n,e,t){return function(n,e=null,t=null,i){const r=lw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Hn{static create(e,t){return Array.isArray(e)?dw(e,t,""):dw(e.providers,e.parent,e.name||"")}}function R7(n,e){ep(__(n)[1],ts())}function Nn(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(ga(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=dT(n.inputs),o.declaredInputs=dT(n.declaredInputs),o.outputs=dT(n.outputs);const a=r.hostBindings;a&&F7(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&N7(n,l),c&&P7(n,c),Ka(n.inputs,r.inputs),Ka(n.declaredInputs,r.declaredInputs),Ka(n.outputs,r.outputs),ga(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Ih(r.hostAttrs,t=Ih(t,r.hostAttrs))}}(i)}function dT(n){return n===rd?{}:n===Wi?[]:n}function N7(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function P7(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function F7(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Hn.THROW_IF_NOT_FOUND=gu,Hn.NULL=new eo,Hn.\u0275prov=We({token:Hn,providedIn:"any",factory:()=>Ie(Bd)}),Hn.__NG_ELEMENT_ID__=-1;let mw=null;function jp(){if(!mw){const n=ti.Symbol;if(n&&n.iterator)mw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(vr(Ne[i.index])):i.index;if(or(t)){let Ne=null;if(!a&&l&&(Ne=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==Ne)(Ne.__ngLastListenerFn__||Ne).__ngNextListenerFn__=s,Ne.__ngLastListenerFn__=s,g=!1;else{s=yT(i,e,f,s,!1);const Ge=t.listen(W,r,s);p.push(s,Ge),d&&d.push(r,ge,G,G+1)}}else s=yT(i,e,f,s,!0),W.addEventListener(r,s,o),p.push(s),d&&d.push(r,ge,G,o)}else s=yT(i,e,f,s,!1);const _=i.outputs;let x;if(g&&null!==_&&(x=_[r])){const A=x.length;if(A)for(let W=0;W0;)e=e[15],n--;return e}(n,Ln.lFrame.contextLView))[8]}(n)}function tL(n,e,t,i,r){const s=n[t+1],o=null===e;let a=i?Mn(s):jl(s),l=!1;for(;0!==a&&(!1===l||o);){const d=n[a+1];yW(n[a],e)&&(l=!0,n[a+1]=i?P_(d):br(d)),a=i?Mn(d):jl(d)}l&&(n[t+1]=i?br(s):P_(s))}function yW(n,e){return null===n||null==e||(Array.isArray(n)?n[1]:n)===e||!(!Array.isArray(n)||"string"!=typeof e)&&Ss(n,e)>=0}const As={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function nL(n){return n.substring(As.key,As.keyEnd)}function iL(n,e){const t=As.textEnd;return t===e?-1:(e=As.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,As.key=e,t),Zp(n,e,t))}function Zp(n,e,t){for(;e0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Mn(n[a+1]);n[i+1]=al(p,a),0!==p&&(n[p+1]=ll(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=al(a,0),0!==a&&(n[a+1]=ll(n[a+1],i)),a=i;else n[i+1]=al(l,0),0===a?a=i:n[l+1]=ll(n[l+1],i),l=i;c&&(n[i+1]=br(n[i+1])),tL(n,d,i,!0),tL(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ss(s,e)>=0&&(t[i+1]=P_(t[i+1]))}(e,d,n,i,s),o=al(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}(r,null,s,i);const o=Ft();if(t!==Cn&&go(o,s,t)){const a=r.data[Xs()];if(fL(a,i)&&!lL(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=ot(l,t||"")),_T(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===Cn&&(r=Wi);let l=0,c=0,d=0=0;t=iL(e,t))Mo(n,nL(e),!0)}function lL(n,e){return e>=n.expandoStartIndex}function bT(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===Cn&&(p=f?Wi:void 0);let g=f?Jm(p,i):d===i?p:void 0;if(c&&!Ew(g)&&(g=Jm(l,i)),Ew(g)&&(a=g,o))return a;const _=n[r+1];r=o?Mn(_):jl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=Jm(l,i))}return a}function Ew(n){return void 0!==n}function fL(n,e){return 0!=(n.flags&(e?16:32))}const Zh=void 0;var ZW=["en",[["a","p"],["AM","PM"],Zh],[["AM","PM"],Zh,Zh],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Zh,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Zh,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Zh,"{1} 'at' {0}",Zh],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Jp={};function RL(n){return n in Jp||(Jp[n]=ti.ng&&ti.ng.common&&ti.ng.common.locales&&ti.ng.common.locales[n]),Jp[n]}var rn=(()=>((rn=rn||{})[rn.LocaleId=0]="LocaleId",rn[rn.DayPeriodsFormat=1]="DayPeriodsFormat",rn[rn.DayPeriodsStandalone=2]="DayPeriodsStandalone",rn[rn.DaysFormat=3]="DaysFormat",rn[rn.DaysStandalone=4]="DaysStandalone",rn[rn.MonthsFormat=5]="MonthsFormat",rn[rn.MonthsStandalone=6]="MonthsStandalone",rn[rn.Eras=7]="Eras",rn[rn.FirstDayOfWeek=8]="FirstDayOfWeek",rn[rn.WeekendRange=9]="WeekendRange",rn[rn.DateFormat=10]="DateFormat",rn[rn.TimeFormat=11]="TimeFormat",rn[rn.DateTimeFormat=12]="DateTimeFormat",rn[rn.NumberSymbols=13]="NumberSymbols",rn[rn.NumberFormats=14]="NumberFormats",rn[rn.CurrencyCode=15]="CurrencyCode",rn[rn.CurrencySymbol=16]="CurrencySymbol",rn[rn.CurrencyName=17]="CurrencyName",rn[rn.Currencies=18]="Currencies",rn[rn.Directionality=19]="Directionality",rn[rn.PluralCase=20]="PluralCase",rn[rn.ExtraData=21]="ExtraData",rn))();const xw="en-US";let OL=xw;function ET(n){Z(n,"Expected localeId to be defined"),"string"==typeof n&&(OL=n.toLowerCase().replace(/_/g,"-"))}class r2{}const o2="ngComponent";class Z9{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[o2]=n,e}(e)}}class fl{}function Dw(...n){}function tg(n,e){return new An(Ys(n,e))}fl.NULL=new Z9;const tq=function(){return tg(ts(),Ft())};let An=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=tq,n})();function a2(n){return n instanceof An?n.nativeElement:n}class Jh{}let IT=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class Au{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const l2=new Au("12.2.5");class c2{constructor(){}supports(e){return ly(e)}create(e){return new aq(e)}}const oq=(n,e)=>e;class aq{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||oq}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new lq(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new u2),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new u2),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class lq{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class cq{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class u2{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new cq,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function d2(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new dq(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class dq{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function f2(){return new ng([new c2])}let ng=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||f2()),deps:[[n,new il,new Yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=We({token:n,providedIn:"root",factory:f2}),n})();function p2(){return new ig([new h2])}let ig=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||p2()),deps:[[n,new il,new Yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=We({token:n,providedIn:"root",factory:p2}),n})();function Iw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(vr(s)),Go(s))for(let a=10;a-1&&(T_(e,i),Pl(t,i))}this._attachedToViewContainer=!1}M_(this._lView[1],this._lView)}onDestroy(e){Kb(this._lView[1],this._lView,null,e)}markForCheck(){q_(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Y_(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Qf(!0);try{Y_(n,e,t)}finally{Qf(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Od(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class fq extends _y{constructor(e){super(e),this._view=e}detectChanges(){rw(this._view)}checkNoChanges(){!function(n){Qf(!0);try{rw(n)}finally{Qf(!1)}}(this._view)}get context(){return null}}const gq=function(n){return function(n,e,t){if(ld(n)&&!t){const i=Bs(n.index,e);return new _y(i,i)}return 47&n.type?new _y(e[16],e):null}(ts(),Ft(),16==(16&n))};let is=(()=>{class n{}return n.__NG_ELEMENT_ID__=gq,n})();const yq=[new h2],bq=new ng([new c2]),wq=new ig(yq),Sq=function(){return Rw(ts(),Ft())};let Po=(()=>{class n{}return n.__NG_ELEMENT_ID__=Sq,n})();const xq=Po,Cq=class extends xq{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=Wh(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),qh(t,i,e),new _y(i)}};function Rw(n,e){return 4&n.type?new Cq(e,n,tg(n,e)):null}class Nc{}const Mq=function(){return y2(ts(),Ft())};let Ts=(()=>{class n{}return n.__NG_ELEMENT_ID__=Mq,n})();const Iq=Ts,m2=class extends Iq{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return tg(this._hostTNode,this._hostLView)}get injector(){return new Wo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Rh(this._hostTNode,this._hostLView);if(Mv(e)){const t=Ja(e,this._hostLView),i=pd(e);return new Wo(t[1].data[i+8],t)}return new Wo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=_2(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Nc,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Go(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new m2(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),idb});class V2 extends r2{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(pA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return j2(this.componentDef.inputs)}get outputs(){return j2(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,ag,r);return s!==ag||i===ag?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Jh,au),a=s.get(IT,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(or(n))return n.selectRootElement(e,t===Ht.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):A_(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?"http://www.w3.org/2000/svg":"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||db,clean:YA,playerHandler:e||null,flags:0}}(),g=Fp(0,null,null,1,0,null,null,null,null,null),_=Wh(null,g,p,f,null,null,o,l,a,s);let x,A;Th(_);try{const W=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Pd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(Bp(l,c,!0),null!==n&&(ip(r,n,c),null!==l.classes&&O_(r,n,l.classes),null!==l.styles&&Ib(r,n,l.styles)));const d=i.createRenderer(n,e),f=Wh(t,Pp(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(yc(js(l,t),o,e.type),nw(o,l),H_(l,t.length,1)),Lp(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)ip(l,d,["ng-version",l2.full]);else{const{attrs:G,classes:ge}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&O_(l,d,ge.join(" "))}if(A=Pm(g,20),void 0!==t){const G=A.projection=[];for(let ge=0;gel(o,e)),e.contentQueries){const l=ts();e.contentQueries(1,o,l.directiveStart)}const a=ts();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(uo(a.index),ew(t[1],a,0,a.directiveStart,a.directiveEnd,e),tw(e,o)),o}(W,this.componentDef,_,p,[R7]),qh(g,_,null)}finally{oi()}return new DK(this.componentType,x,tg(A,_),_,A)}}class DK extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new fq(r),this.componentType=e}get injector(){return new Wo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const lg=new Map;class OK extends Nc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new B2(this);const i=xo(e),r=function(n){return n[M1]||null}(e);r&&ET(r),this._bootstrapComponents=sl(i.bootstrap),this._r3Injector=lw(e,t,[{provide:Nc,useValue:this},{provide:fl,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Hn.THROW_IF_NOT_FOUND,i=yn.Default){return e===Hn||e===Nc||e===Bd?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class GT extends class{}{constructor(e){super(),this.moduleType=e,null!==xo(e)&&function(n){const e=new Set;!function t(i){const r=xo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${rt(e)} vs ${rt(e.name)}`)}(s,lg.get(s),i),lg.set(s,i));const o=sl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new OK(this.moduleType,e)}}function H2(n,e,t,i,r,s){const o=e+t;return go(n,o,r)?function(n,e,t){return n[e]=t}(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===Cn?void 0:t}(n,o+1)}function Ty(n,e,t){const i=n+20,r=Ft(),s=function(n,e){return n[e]}(r,i);return function(n,e){zl.isWrapped(e)&&(e=zl.unwrap(e),n[Ln.lFrame.bindingIndex]=Cn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?H2(r,function(){const n=Ln.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),e,s.transform,t,s):s.transform(t))}function $T(n){return e=>{setTimeout(n,void 0,e)}}const cn=class extends ee{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=$T(l),a&&(a=$T(a)),c&&(c=$T(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof S&&e.add(d),d}};function YK(){return this._results[jp()]()}class nf{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=jp(),i=nf.prototype;i[t]||(i[t]=YK)}get changes(){return this._changes||(this._changes=new cn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=qo(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=Dw,this.reject=Dw,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Ie(rf,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Ry=new Vt("AppId"),RY={provide:Ry,useFactory:function(){return`${iM()}${iM()}${iM()}`},deps:[]};function iM(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const mk=new Vt("Platform Initializer"),Pc=new Vt("Platform ID"),Bw=new Vt("appBootstrapListener");let jw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Tu=new Vt("LocaleId"),_k=new Vt("DefaultCurrencyCode");class NY{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const rM=function(n){return new GT(n)},PY=rM,FY=function(n){return Promise.resolve(rM(n))},yk=function(n){const e=rM(n),i=sl(xo(n).declarations).reduce((r,s)=>{const o=Di(s);return o&&r.push(new V2(o)),r},[]);return new NY(e,i)},LY=yk,kY=function(n){return Promise.resolve(yk(n))};let sf=(()=>{class n{constructor(){this.compileModuleSync=PY,this.compileModuleAsync=FY,this.compileModuleAndAllComponentsSync=LY,this.compileModuleAndAllComponentsAsync=kY}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const vk=new Vt("compilerOptions"),jY=(()=>Promise.resolve(0))();function sM(n){"undefined"==typeof Zone?jY.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class mn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new cn(!1),this.onMicrotaskEmpty=new cn(!1),this.onStable=new cn(!1),this.onError=new cn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=ti.requestAnimationFrame,e=ti.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(ti,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,aM(n),n.isCheckStableRunning=!0,oM(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),aM(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return bk(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),wk(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return bk(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),wk(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,aM(n),oM(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!mn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(mn.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,UY,Dw,Dw);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const UY={};function oM(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function aM(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function bk(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function wk(n){n._nesting--,oM(n)}class GY{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new cn,this.onMicrotaskEmpty=new cn,this.onStable=new cn,this.onError=new cn}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let lM=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{mn.assertNotInAngularZone(),sM(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())sM(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Ek=(()=>{class n{constructor(){this._applications=new Map,cM.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return cM.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class $Y{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let cM=new $Y,Sk=!0,xk=!1;function Da(){return xk=!0,Sk}let Kl;const Ck=new Vt("AllowMultipleToken");function Ak(n,e,t=[]){const i=`Platform: ${e}`,r=new Vt(i);return(s=[])=>{let o=dM();if(!o||o.injector.get(Ck,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Eu,useValue:"platform"});!function(n){if(Kl&&!Kl.destroyed&&!Kl.injector.get(Ck,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Kl=n.get(Tk);const e=n.get(mk,null);e&&e.forEach(t=>t())}(Hn.create({providers:a,name:i}))}return function(n){const e=dM();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function dM(){return Kl&&!Kl.destroyed?Kl:null}let Tk=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new GY:("zone.js"===n?void 0:n)||new mn({enableLongStackTrace:Da(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:mn,useValue:a}];return a.run(()=>{const c=Hn.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Zo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{hM(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return uy(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(ug);return p.runInitializers(),p.donePromise.then(()=>(ET(d.injector.get(Tu,xw)||xw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=Mk({},i);return function(n,e,t){const i=new GT(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(zd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${rt(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Mk(n,e){return Array.isArray(e)?e.reduce(Mk,n):Object.assign(Object.assign({},n),e)}let zd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new F(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new F(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{mn.assertNotInAngularZone(),sM(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{mn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Pn(a,l.pipe(ms()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof r2?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Nc),a=r.create(Hn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(lM,null),d=c&&a.injector.get(Ek);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),hM(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;hM(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Bw,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn),Ie(Hn),Ie(Zo),Ie(fl),Ie(ug))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function hM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const yX=Ak(null,"core",[{provide:Pc,useValue:"unknown"},{provide:Tk,deps:[Hn]},{provide:Ek,deps:[]},{provide:jw,deps:[]}]),SX=[{provide:zd,useClass:zd,deps:[mn,Hn,Zo,fl,ug]},{provide:AK,deps:[mn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:ug,useClass:ug,deps:[[new Yr,rf]]},{provide:sf,useClass:sf,deps:[]},RY,{provide:ng,useFactory:function(){return bq},deps:[]},{provide:ig,useFactory:function(){return wq},deps:[]},{provide:Tu,useFactory:function(n){return ET(n=n||"undefined"!=typeof $localize&&$localize.locale||xw),n},deps:[[new xd(Tu),new Yr,new il]]},{provide:_k,useValue:"USD"}];let CX=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(zd))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:SX}),n})(),Qw=null;function Fc(){return Qw}const ln=new Vt("DocumentToken");let lf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:xQ,token:n,providedIn:"platform"}),n})();function xQ(){return Ie(n3)}let n3=(()=>{class n extends lf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Fc().getBaseHref(this._doc)}onPopState(t){const i=Fc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Fc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){r3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){r3()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({factory:AQ,token:n,providedIn:"platform"}),n})();function r3(){return!!window.history.pushState}function AQ(){return new n3(Ie(ln))}function Du(n){return n&&"?"!==n[0]?"?"+n:n}let cf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:TQ,token:n,providedIn:"root"}),n})();function TQ(n){const e=Ie(ln).location;return new o3(Ie(lf),e&&e.origin||"")}const MM=new Vt("appBaseHref");let o3=(()=>{class n extends cf{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return function(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Du(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Du(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Du(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(lf),Ie(MM,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();var ds=(()=>((ds=ds||{})[ds.Zero=0]="Zero",ds[ds.One=1]="One",ds[ds.Two=2]="Two",ds[ds.Few=3]="Few",ds[ds.Many=4]="Many",ds[ds.Other=5]="Other",ds))();const kQ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=RL(e);if(t)return t;const i=e.split("-")[0];if(t=RL(i),t)return t;if("en"===i)return ZW;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[rn.PluralCase]};class aE{}let hZ=(()=>{class n extends aE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(kQ(i||this.locale)(t)){case ds.Zero:return"zero";case ds.One:return"one";case ds.Two:return"two";case ds.Few:return"few";case ds.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Tu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();let Ru=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new mZ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){y3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){y3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(Me(Ts),Me(Po))},n.\u0275dir=Lt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class mZ{constructor(){this.$implicit=null,this.ngIf=null}}function y3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class bZ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class wZ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const EZ=new wZ,SZ=new bZ;let cE=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(uy(t))return EZ;if(GF(t))return SZ;throw function(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${rt(n)}'`)}(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(Me(is,16))},n.\u0275pipe=Ls({name:"async",type:n,pure:!1}),n})(),Ws=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:[{provide:aE,useClass:hZ}]}),n})();const x3="browser";class UM extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){Qw||(Qw=n)}(new UM)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(By=By||document.querySelector("base"),By?By.getAttribute("href"):null);return null==t?null:function(n){uE=uE||document.createElement("a"),uE.setAttribute("href",n);const e=uE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){By=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}(document.cookie,e)}}let uE,By=null;const M3=new Vt("TRANSITION_ID"),KZ=[{provide:rf,useFactory:function(n,e,t){return()=>{t.get(ug).donePromise.then(()=>{const i=Fc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},ti.getAllAngularTestabilities=()=>e.getAllTestabilities(),ti.getAllAngularRootElements=()=>e.getAllRootElements(),ti.frameworkStabilizers||(ti.frameworkStabilizers=[]),ti.frameworkStabilizers.push(i=>{const r=ti.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Fc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let YZ=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const jy=new Vt("EventManagerPlugins");let hE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Vy=(()=>{class n extends I3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(R3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(R3))}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function R3(n){Fc().remove(n)}const GM={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},$M=/%COMP%/g;function fE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let pE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new WM(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Ht.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new uJ(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Ht.ShadowDom:return new dJ(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=fE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Ie(hE),Ie(Vy),Ie(Ry))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class WM{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(GM[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=GM[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=GM[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(Ro.DashCase|Ro.Important)?e.style.setProperty(t,i,r&Ro.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Ro.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,P3(i)):this.eventManager.addEventListener(e,t,P3(i))}}class uJ extends WM{constructor(e,t,i,r){super(e),this.component=i;const s=fE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace($M,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace($M,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class dJ extends WM{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=fE(r.id,r.styles,[]);for(let o=0;o{class n extends HM{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const k3=["alt","control","meta","shift"],vJ={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},B3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},bJ={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let wJ=(()=>{class n extends HM{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Fc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(k3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&B3.hasOwnProperty(e)&&(e=B3[e]))}return vJ[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),k3.forEach(s=>{s!=r&&bJ[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(Ie(ln))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const DJ=Ak(yX,"browser",[{provide:Pc,useValue:x3},{provide:mk,useValue:function(){UM.makeCurrent(),zM.init()},multi:!0},{provide:ln,useFactory:function(){return function(n){Bi=n}(document),document},deps:[]}]),IJ=[[],{provide:Eu,useValue:"root"},{provide:Zo,useFactory:function(){return new Zo},deps:[]},{provide:jy,useClass:hJ,multi:!0,deps:[ln,mn,Pc]},{provide:jy,useClass:wJ,multi:!0,deps:[ln]},[],{provide:pE,useClass:pE,deps:[hE,Vy,Ry]},{provide:Jh,useExisting:pE},{provide:I3,useExisting:Vy},{provide:Vy,useClass:Vy,deps:[ln]},{provide:lM,useClass:lM,deps:[mn]},{provide:hE,useClass:hE,deps:[jy,mn]},{provide:class{},useClass:YZ,deps:[]},[]];let YM=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Ry,useValue:t.appId},{provide:M3,useExisting:Ry},KZ]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:IJ,imports:[Ws,CX]}),n})();"undefined"!=typeof window&&window;class BJ extends S{constructor(e,t){super()}schedule(e,t=0){return this}}class gE extends BJ{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let V3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Jl extends V3{constructor(e,t=V3.now){super(e,()=>Jl.delegate&&Jl.delegate!==this?Jl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Jl.delegate&&Jl.delegate!==this?Jl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const UJ=new class extends Jl{}(class extends gE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Lc=new F(n=>n.complete());function mE(n){return n?function(n){return new F(e=>n.schedule(()=>e.complete()))}(n):Lc}function an(...n){let e=n[n.length-1];return Te(e)?(n.pop(),Be(n,e)):Tn(n)}function gg(n,e){return new F(e?t=>e.schedule(HJ,0,{error:n,subscriber:t}):t=>t.error(n))}function HJ({error:n,subscriber:e}){e.error(n)}class ra{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return an(this.value);case"E":return gg(this.error);case"C":return mE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ra("N",e):ra.undefinedValueNotification}static createError(e){return new ra("E",void 0,e)}static createComplete(){return ra.completeNotification}}ra.completeNotification=new ra("C"),ra.undefinedValueNotification=new ra("N",void 0);class _E extends y{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(_E.dispatch,this.delay,new $J(e,this.destination)))}_next(e){this.scheduleMessage(ra.createNext(e))}_error(e){this.scheduleMessage(ra.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ra.createComplete()),this.unsubscribe()}}class $J{constructor(e,t){this.notification=e,this.destination=t}}class mg extends ee{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new WJ(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new U;if(this.isStopped||this.hasError?o=S.EMPTY:(this.observers.push(e),o=new ie(this,e)),r&&e.add(e=new _E(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class WJ{constructor(e,t){this.time=e,this.value=t}}function Ur(n,e){return"function"==typeof e?t=>t.pipe(Ur((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new qJ(n))}class qJ{constructor(e){this.project=e}call(e,t){return t.subscribe(new KJ(e,this.project))}}class KJ extends fe{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new wt(this),r=this.destination;r.add(i),this.innerSubscription=R(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const yE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return yE.schedule(n,0);if(void 0===window.requestAnimationFrame)return yE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let QM;function ree(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!QM){const t=Element.prototype;QM=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&QM.call(n,e)}(n,r)||(i=s,0))),i}class oee{constructor(e,t){this.componentFactory=t.get(fl).resolveComponentFactory(e)}create(e){return new aee(this.componentFactory,e)}}class aee{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new mg(1),this.events=this.eventEmitters.pipe(Ur(i=>Pn(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(mn),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=yE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Hn.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(me(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=yE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new Rm(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class lee extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const uee={initialConfig:{},parse:{},rename:{}};class dee{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},uee),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let hee=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new dee(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=Lt({type:n,features:[qi]}),n})();var ZM;const Uy={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(ZM=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==ZM?ZM:""},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function Ia(n,e,t,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function z3(n,e){return function(t,i){e(t,i,n)}}function ec(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function ir(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function $3(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function eD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||$3()}const W3="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",bE=eD();class mee{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function tD(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const q3={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function K3(n){return"string"==typeof n?q3[n.toUpperCase()]||q3.WHITE:n}function wE(n,e){if(!n)throw new Error(e||"Assertion failed")}const tc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},zy=tc.window||tc.self||tc.global,Y3=tc.process||{};function _g(){let n;if(bE&&zy.performance)n=zy.performance.now();else if(Y3.hrtime){const e=Y3.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const yg={debug:bE&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},See={enabled:!0,level:0};function yl(){}const X3={},Q3={once:!0};function xee(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let nD=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=W3,this._startTs=_g(),this._deltaTs=_g(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new mee("__probe-".concat(this.id,"__"),See),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((_g()-this._startTs).toPrecision(10))}getDelta(){return Number((_g()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){wE(t,i)}warn(t){return this._getLogFunction(0,t,yg.warn,arguments,Q3)}error(t){return this._getLogFunction(0,t,yg.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,yg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,yg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,yg.debug||yg.info,arguments,Q3)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||yl,r&&[r],{tag:xee(i)}):yl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?bE?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=tD(r,e,t);console.log(...s)},r.src=n,yl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...tD(n,e,t)),yl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...tD(r,e,t)),r.src=n.toDataURL(),yl}return yl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=tt(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):yl}({image:r,message:s,scale:o}):yl}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||yl)}group(t,i,r={collapsed:!1}){r=J3({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||yl)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Z3(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=J3({logLevel:t,message:i,args:s,opts:o}),wE(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=_g();const a=o.tag||o.message;if(o.once){if(X3[a])return yl;X3[a]=_g()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!bE&&"string"==typeof n&&(e&&(e=K3(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=K3(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return yl}}return n.VERSION=W3,n})();function Z3(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return wE(Number.isFinite(e)&&e>=0),e}function J3(n){const{logLevel:e,message:t}=n;n.logLevel=Z3(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return wE("string"===r||"object"===r),Object.assign(n,n.opts)}const Oi=new nD({id:"deck"}),Mi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mi,"IDENTITY",{get:()=>Oi.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},eB={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},un=new nD({id:"luma.gl"});function ko(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function EE(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function pi(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function SE(n){return ko(EE(n),"Invalid WebGLRenderingContext"),n}function Bo(n){return ko(pi(n),"Requires WebGL2"),n}var Sr=tt(761);const Hy={};const Gy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Sr.CO.console&&Sr.CO.console.log&&Sr.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};hf.prototype.VERTEX_ARRAY_BINDING_OES=34229,hf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;ipi(n)?void 0:0,$ee={3074:n=>pi(n)?void 0:36064,35723:n=>pi(n)?void 0:4352,35977:fr,32937:fr,36795:(n,e)=>{const t=pi(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(iB);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(iB);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:fr,35071:fr,37447:fr,36063:(n,e)=>{if(!pi(n)){const t=n.getExtension(nB);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:fr,35374:fr,35377:fr,34852:n=>{if(!pi(n)){const e=n.getExtension(nB);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(tB)?2147483647:65535,33001:n=>n.getExtension(tB)?16777216:65535,33e3:n=>16777216,37157:fr,35373:fr,35657:fr,36183:fr,37137:fr,34045:fr,35978:fr,35979:fr,35968:fr,35376:fr,35375:fr,35659:fr,37154:fr,35371:fr,35658:fr,35076:fr,35077:fr,35380:fr},rB="ANGLE_instanced_arrays",sB={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{ko(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[rB]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){ko(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{ko(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{ko(!1)},deleteQuery:()=>{ko(!1)},beginQuery:()=>{ko(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},iD={readBuffer:(n,e,t)=>{pi(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:pi(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!pi(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!pi(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=$ee[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function rte(n,{extension:e,target:t,target2:i}){const r=sB[e];ko(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new hf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&rte(n,{extension:t,target:n.luma,target2:n})}(n,sB),function(n,{target:e,target2:t}){Object.keys(iD).forEach(i=>{if("function"==typeof iD[i]){const r=n[i]?n[i].bind(n):()=>{},s=iD[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const rD={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},$d=(n,e,t)=>e?n.enable(t):n.disable(t),oB=(n,e,t)=>n.hint(t,e),Ra=(n,e,t)=>n.pixelStorei(t,e);function $y(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const ate={3042:$d,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:$d,2885:(n,e)=>n.cullFace(e),2929:$d,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:$d,35723:oB,36006:(n,e)=>{const t=pi(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:oB,2849:(n,e)=>n.lineWidth(e),32823:$d,32824:"polygonOffset",10752:"polygonOffset",35977:$d,32938:"sampleCoverage",32939:"sampleCoverage",3089:$d,3088:(n,e)=>n.scissor(...e),2960:$d,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:Ra,3317:Ra,37440:Ra,37441:Ra,37443:Ra,3330:Ra,3332:Ra,3331:Ra,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Ra,32878:Ra,3316:Ra,3315:Ra,32877:Ra,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=$y(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=$y(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=$y(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=$y(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=$y(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Qr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const lte={blendEquation:(n,e,t)=>n.blendEquationSeparate(Qr(32777,e,t),Qr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Qr(32969,e,t),Qr(32968,e,t),Qr(32971,e,t),Qr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Qr(32824,e,t),Qr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Qr(32938,e,t),Qr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Qr(2962,e,t),Qr(2967,e,t),Qr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Qr(34816,e,t),Qr(36003,e,t),Qr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Qr(2964,e,t),Qr(2965,e,t),Qr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Qr(34817,e,t),Qr(34818,e,t),Qr(34819,e,t))},aB={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Bc=(n,e)=>n.isEnabled(e),lB={3042:Bc,2884:Bc,2929:Bc,3024:Bc,32823:Bc,32926:Bc,32928:Bc,3089:Bc,2960:Bc,35977:Bc};function cB(n){for(const e in n)return!1;return!0}function cte(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||rD)){const r=e,s=lB[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=lB[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},rD),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){ko(this.stateStack.length>0),Ou(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){ko(void 0!==s);const o=e[s],a=this.cache[s];cte(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function dB(n,e={}){const{enable:t=!0,copyState:i}=e;if(ko(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new hte(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in aB)ute(n,o,aB[o]);uB(n,"getParameter"),uB(n,"isEnabled")}return n.state.enable=t,n}function hB(n){ko(n.state),n.state.pop()}function Ou(n,e){if(ko(EE(n),"setParameters requires a WebGL context"),cB(e))return;const t={};for(const r in e){const s=Number(r),o=ate[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)lte[r](n,e,i)}function nc(n,e,t){if(cB(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||dB(n,{copyState:!1}),n.state.push()}(n),Ou(n,e),i)r=t(n),hB(n);else try{r=t(n)}finally{hB(n)}return r}function vg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function sD(n,e,t=!0){return function(n,e,t,i,r){const s=fB(n[0],e,t);let o=pB(n[1],e,i,r),a=fB(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=pB(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,vg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function fB(n,e,t){return Math.min(Math.round(n*e),t-1)}function pB(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const oD=(0,Sr.jU)(),yte=oD&&"undefined"!=typeof document,gB={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function mB(n={}){ko(oD,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},gB,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(yte&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=aD(r,n),function(n){const e=pi(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);un.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function aD(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},gB,e);const{manageState:t,debug:i}=e;return t&&dB(n,{copyState:!1,log:(...r)=>un.log(1,...r)()}),oD&&i&&(Sr.CO.makeDebugContext?(n=Sr.CO.makeDebugContext(n,e),un.level=Math.max(un.level,1)):un.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function _B(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class yB{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=_B(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(_B()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class lD{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof yB?e:new yB(t,i)),this.stats[t]}}const Wy="8.5.7",ff=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new lD({id:e})),this.stats.get(e)}};if(Sr.CO.luma&&Sr.CO.luma.VERSION!==Wy)throw new Error(`luma.gl - multiple VERSIONs detected: ${Sr.CO.luma.VERSION} vs 8.5.7`);function tn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function cD(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return tn(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Wd(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Sr.CO.luma||((0,Sr.jU)()&&un.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Sr.CO.luma=Sr.CO.luma||{VERSION:Wy,version:Wy,log:un,stats:ff,globals:{modules:{},nodeIO:{}}});const uD={};function jc(n="id"){return uD[n]=uD[n]||1,`${n}-${uD[n]++}`}function vB(n){return tn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function bg(n){let e=!0;for(const t in n){e=!1;break}return e}function bB(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw un.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const wg="Resource subclass must define virtual methods";class Nu{constructor(e,t={}){SE(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||jc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){tn(e=cD(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=pi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=pi(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?Wd(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=Wd(this.gl,o[f]))}}return o}setParameter(e,t){tn(e=cD(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=pi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=cD(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return bB(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(wg)}_deleteHandle(){throw new Error(wg)}_bindHandle(e){throw new Error(wg)}_getOptsFromHandle(){throw new Error(wg)}_getParameter(e,t){throw new Error(wg)}_setParameter(e,t){throw new Error(wg)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=ff.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;ff.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=ff.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=ff.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function dD(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function qy(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function Ite({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return sa.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return sa.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=hD("Accessor",e,Ote)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const EB={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},Nte={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:EB},Pte={removedProps:EB};class rr extends Nu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/sa.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/sa.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=hD("Buffer",e,Nte),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=hD("Buffer",e,Pte))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new sa(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;tn(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Bo(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return Bo(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){Bo(this.gl);const s=qy(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return tn((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(tn(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){tn(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=dD(e);return tn(s),this.setAccessor(new sa(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){tn(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/qy(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new sa(this.accessor,{type:dD(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return un.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return un.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return un.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return un.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new sa(this.accessor,e),this}}const fD={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},SB={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},xB={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},kte=[9729,9728],CB=Sr.CO.WebGLBuffer||function(){};class Eg extends Nu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=fD[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=pi(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=fD[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=jc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(G=>this.initialize(Object.assign({},e,{pixels:G,data:G}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:x=!1,mipmaps:A=!0}=e;const{depth:W=0}=e;return({width:f,height:p,compressed:x,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:x,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=W,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),A&&this._isNPOT()&&(un.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),A=!1,this._updateForNPOT(l)),this.mipmaps=A,this.setImageData({data:t,width:f,height:p,depth:W,format:s,type:_,dataFormat:g,border:o,mipmaps:A,parameters:c,compressed:x}),A&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:x}=this;x.bindTexture(this.target,this.handle);let W,A=null;return({data:c,dataType:A}=this._getDataType({data:c,compressed:_})),nc(this.gl,l,()=>{switch(A){case"null":x.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":x.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":W=Bo(x),W.bindBuffer(35052,c.handle||c),W.texImage2D(t,r,s,f,p,o,g,d,a),W.bindBuffer(35052,null);break;case"browser-object":pi(x)?x.texImage2D(t,r,s,f,p,o,g,d,c):x.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[G,ge]of c.entries())x.compressedTexImage2D(t,G,ge.format,ge.width,ge.height,o,ge.data);break;default:tn(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(SB[this.dataFormat]||4)*(xB[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:x={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),tn(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const A=i;i=A.data,o=A.shape[0],a=A.shape[1]}i instanceof rr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),nc(this.gl,x,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof CB){const A=Bo(this.gl);A.bindBuffer(35052,i),A.texSubImage2D(e,l,r,s,o,a,f,d,g),A.bindBuffer(35052,null)}else pi(this.gl)?Bo(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return un.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof rr?{data:e.handle,dataType:"buffer"}:e instanceof CB?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=fD[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},tn(r,"Could not deduced texture size"),tn(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),tn(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:tn(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(pi(this.gl)||!this.width||!this.height||vB(this.width)&&vB(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===kte.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Bte(n,e){return tn("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class Oa extends Eg{static isSupported(e,t){return Eg.isSupported(e,t)}constructor(e,t={}){SE(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Bte(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const pf="EXT_color_buffer_float",AB={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:pf,bpp:2},33327:{gl2:pf,bpp:4},34842:{gl2:pf,bpp:8},33326:{gl2:pf,bpp:4},33328:{gl2:pf,bpp:8},34836:{gl2:pf,bpp:16},35898:{gl2:pf,bpp:4}};class Sg extends Nu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=pi(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,AB)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return tn(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&pi(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*AB[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const RB="clear: bad arguments";function gD(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),tn(0!==o,RB),nc(n,s,()=>{n.clear(o)})}function OB(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function ni(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){OB(s,i,r,o,a,"next",l)}function a(l){OB(s,i,r,o,a,"throw",l)}o(void 0)})}}const mD=[34069,34070,34071,34072,34073,34074];let $te=(()=>{class n extends Eg{constructor(t,i={}){SE(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return ni(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(mD.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),mD.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&un.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((x,A)=>{t&&i?d.texImage2D(g,A,a,t,i,o,a,l,x):d.texImage2D(g,A,a,a,l,x)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=mD,n})();class Wte extends Eg{static isSupported(e){return pi(e)}constructor(e,t={}){Bo(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),nc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof rr&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(SB[this.dataFormat]||4)*(xB[this.type]||1),"Texture"),this.loaded=!0,this}}function Kte(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Is(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function xE(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof Is?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Kte(n),deleteFramebuffer:!0}}(n);tn(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),tn(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(qy(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return tn(!1),0}}(t))}(o,c,r,a,l),c=c||dD(o);const x=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,x||null),f&&d.delete(),o}function _D(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=xE(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Ite({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return tn(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&un.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){tn(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof Sg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(Is.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&gD(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Bo(n),nc(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:tn(!1,RB)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return un.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return un.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return un.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return un.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return un.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return un.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=Bo(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=Wd(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?Wd(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?Wd(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(_D(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>un.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=_D(this,{targetMaxHeight:100});return un.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new Oa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new Sg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new Sg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&tn(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof Sg?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:Bo(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:tn(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return pi(n)?n:null}(this.gl);t?t.readBuffer(e):tn(36064===e||1029===e,NB),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Bo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):tn(1===e.length&&(36064===e[0]||1029===e[0]),NB)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in PB)void 0===n.luma.caps[e]&&(n.luma.caps[e]=LB(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Is.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const PB={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new Oa(n,{format:6408,type:5126,dataFormat:6408}),t=new Is(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function yD(n,e){return FB(n,e)}function FB(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>LB(n,t))}function LB(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=PB[e];let i;tn(t,e);const r=pi(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:tn(!1);return i}(n,e)),n.luma.caps[e]||un.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class vD{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},one=(Math,1/180*Math.PI),xr={};function lne(n,{precision:e=xr.precision||4}={}){return n=function(n){return Math.round(n/xr.EPSILON)*xr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function qd(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Pu(n,e,t){if(qd(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*one,void 0)}(n)}function gf(n,e,t){return Pu(n,i=>Math.max(e,Math.min(t,i)))}function CE(n,e,t){return qd(n)?n.map((i,r)=>CE(i,e[r],t)):t*e+(1-t)*n}function Xy(n,e,t){const i=xr.EPSILON;t&&(xr.EPSILON=t);try{if(n===e)return!0;if(qd(n)&&qd(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+lne(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(KB.length=n.length,i=KB):i=qB,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function XB(n){return n&&n[Symbol.asyncIterator]}function xD(n,e=(()=>!0)){return Array.isArray(n)?QB(n,e,[]):e(n)?[n]:[]}function QB(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function ZB(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ht(ht(ht({},$ne[n.type]),e),n)):null}function JB(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function ej(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function tj(n){n.push(n.shift())}function AD(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function nj({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=AD(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const W=s;s=(G,ge)=>t._normalizeConstant(W(G,ge))}const _=p?(W,G)=>s(g,G):(W,G)=>s(g.subarray(W,W+a),G),x=n.getData({length:i}),A=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return CD({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===DE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=DE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=zne}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==DE}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const A=f*a+l;for(let W=0;Wd?c.set(ge,x):(e._normalizeValue(ge,W.target,0),Une({target:c,source:W.target,start:x,count:Ne}));x+=Ne*d}else e._normalizeValue(ge,c,x),x+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let MD={};function bo(n){Oi.level>0&&MD[n]&&MD[n].call(...arguments)}function Na(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const ij="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Kne=`#version 300 es\n${ij}`;function rj(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function sj(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Kne:e>300?`#version ${e}\n${ij}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Na(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class oj extends Nu{static isSupported(e){return pi(e)}constructor(e,t={}){Bo(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,bg(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,un.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof rr?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Zne{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof rr?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&tn(pi(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new oj(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],tn(i[s]instanceof rr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new rr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function aj(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const Jy="vs",tie={[Jy]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},IE="__LUMA_INJECT_DECLARATIONS__",lj=/void\s+main\s*\([^)]*\)\s*\{\n?/,cj=/}\n?[^{}]*$/,ID=[];function uj(n,e,t,i=!1){const r=e===Jy;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),ID.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(cj,l=>a+l));break;case"fs:#decl":r||(n=n.replace(IE,a));break;case"fs:#main-start":r||(n=n.replace(lj,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(cj,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(IE,""),i&&(n=n.replace(/\}\s*$/,s=>s+tie[e])),n}function RD(n){const e={};return Na(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const nie={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},RE="transform_uSize_",dj="transform_position";const uie={10241:9728,10240:9728,10242:33071,10243:33071};class hie{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${RE}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${RE}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=xE(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Na(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new rr(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new Is(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters(uie)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){tn(n instanceof Oa||n instanceof $te||n instanceof Wte);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const x=function(n,e){const t={},i=function(n){return rj(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${RE}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Na(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(x){const{updatedLine:A,inject:W}=x;f[g]=A,c=RD([c,W]),Object.assign(a,x.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=rj(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){tn(i);const p=`${RE}${t}`;c=RD([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${dj} = transform_getPos(${p});\n gl_Position = vec4(${dj}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=RD([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||sj({version:aj(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[nie].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const OD={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function pie(n){let e=hj(n);return"object"===e?n?"type"in n?Object.assign({},n,OD[n.type]):"value"in n?(e=hj(n.value),Object.assign({type:e},n,OD[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},OD[e])}function hj(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class ND{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Na("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=pie(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Na(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Na(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function yie(n){return function(n){const e={},t={};return PD({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(pj(n))}function PD({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof ND||(Na("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Na(t.name,"shader module has no name"),(t=new ND(t)).dependencies=pj(t.dependencies)),t))}const FD={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},mf={};function Aie(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(FD).forEach(n=>{mf[n]=n});const LD={};function gj(n,e,t={}){const i=FD[e];if(Na(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in LD)return LD[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),LD[e]=l,l}function OE(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=FD[e];Na(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Na(!1===r||!0===r),r}(n,t))}function Cg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const mj=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],Iie=[...mj,[Cg("attribute"),"in $1"],[Cg("varying"),"out $1"]],Rie=[...mj,[Cg("varying"),"in $1"]],_j=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Oie=[..._j,[Cg("in"),"attribute $1"],[Cg("out"),"varying $1"]],Nie=[..._j,[Cg("in"),"varying $1"]],kD="gl_FragColor",BD=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Pie=/void\s+main\s*\([^)]*\)\s*\{\n?/;function NE(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Bie=`\n\n${IE}\n\n`,yj={[Jy]:"vertex",fs:"fragment"};function vj(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Na("string"==typeof t,"shader source must be a string");const f=i===Jy,p=t.split("\n");let g=100,_="",x=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],x=p.slice(1).join("\n")):_=`#version ${g}`;const A={};r.forEach($e=>{Object.assign(A,$e.getDefines())}),Object.assign(A,s);let W=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${yj[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${yj[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:Aie(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return OE(n,mf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),OE(n,mf.GLSL_DERIVATIVES)&&gj(n,mf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),OE(n,mf.GLSL_FRAG_DATA)&&gj(n,mf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),OE(n,mf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(A)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const G=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),ge={},Ne={},Ge={};for(const $e in a){const at="string"==typeof a[$e]?{injection:a[$e],order:0}:a[$e],St=$e.match(/^(v|f)s:(#)?([\w-]+)$/);if(St){const Pt=St[3];St[2]?"decl"===Pt?Ne[$e]=[at]:Ge[$e]=[at]:ge[$e]=[at]}else Ge[$e]=[at]}for(const $e of r){d&&$e.checkDeprecations(x,d),W+=$e.getModuleSource(i,g);const St=$e.injections[i];for(const Rt in St){const Pt=Rt.match(/^(v|f)s:#([\w-]+)$/);if(Pt){const Zt="decl"===Pt[2]?Ne:Ge;Zt[Rt]=Zt[Rt]||[],Zt[Rt].push(St[Rt])}else ge[Rt]=ge[Rt]||[],ge[Rt].push(St[Rt])}}return W+=Bie,W=uj(W,i,Ne),W+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(G[i],ge),W+=x,W=uj(W,i,Ge),W=function(n,e,t){switch(e){case 300:return t?NE(n,Iie):function(n){const e=(n=NE(n,Rie)).match(BD);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${kD}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(Pie,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${kD}\\b`,"g"),t)}return n}(n);case 100:return t?NE(n,Oie):function(n){const e=(n=NE(n,Nie)).match(BD);if(e){const t=e[1];n=n.replace(BD,"").replace(new RegExp(`\\b${t}\\b`,"g"),kD)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(W,l?100:g,f),W}function Uie(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const qie={5126:Cr.bind(null,"uniform1fv",Pa,1,wo),35664:Cr.bind(null,"uniform2fv",Pa,2,wo),35665:Cr.bind(null,"uniform3fv",Pa,3,wo),35666:Cr.bind(null,"uniform4fv",Pa,4,wo),5124:Cr.bind(null,"uniform1iv",Kd,1,wo),35667:Cr.bind(null,"uniform2iv",Kd,2,wo),35668:Cr.bind(null,"uniform3iv",Kd,3,wo),35669:Cr.bind(null,"uniform4iv",Kd,4,wo),35670:Cr.bind(null,"uniform1iv",Kd,1,wo),35671:Cr.bind(null,"uniform2iv",Kd,2,wo),35672:Cr.bind(null,"uniform3iv",Kd,3,wo),35673:Cr.bind(null,"uniform4iv",Kd,4,wo),35674:Cr.bind(null,"uniformMatrix2fv",Pa,4,Lu),35675:Cr.bind(null,"uniformMatrix3fv",Pa,9,Lu),35676:Cr.bind(null,"uniformMatrix4fv",Pa,16,Lu),35678:no,35680:no,5125:Cr.bind(null,"uniform1uiv",PE,1,wo),36294:Cr.bind(null,"uniform2uiv",PE,2,wo),36295:Cr.bind(null,"uniform3uiv",PE,3,wo),36296:Cr.bind(null,"uniform4uiv",PE,4,wo),35685:Cr.bind(null,"uniformMatrix2x3fv",Pa,6,Lu),35686:Cr.bind(null,"uniformMatrix2x4fv",Pa,8,Lu),35687:Cr.bind(null,"uniformMatrix3x2fv",Pa,6,Lu),35688:Cr.bind(null,"uniformMatrix3x4fv",Pa,12,Lu),35689:Cr.bind(null,"uniformMatrix4x2fv",Pa,8,Lu),35690:Cr.bind(null,"uniformMatrix4x3fv",Pa,12,Lu),35678:no,35680:no,35679:no,35682:no,36289:no,36292:no,36293:no,36298:no,36299:no,36300:no,36303:no,36306:no,36307:no,36308:no,36311:no},Kie={},Yie={},Xie={},bj=[0];function jD(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(bj[0]=n,n=bj);const r=n.length;if(r%e&&un.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Cr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{tn(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return xj(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:Sj(s,c),warnings:Sj(o,c)}}(i,this.source,this.shaderType,this.id);throw un.error(`GLSL compilation errors in ${r}\n${s}`)(),un.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class VD extends e0{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class UD extends e0{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Rs=5126,t0=5124,n0=5125,zD={[Rs]:[Rs,1,"float"],35664:[Rs,2,"vec2"],35665:[Rs,3,"vec3"],35666:[Rs,4,"vec4"],[t0]:[t0,1,"int"],35667:[t0,2,"ivec2"],35668:[t0,3,"ivec3"],35669:[t0,4,"ivec4"],[n0]:[n0,1,"uint"],36294:[n0,2,"uvec2"],36295:[n0,3,"uvec3"],36296:[n0,4,"uvec4"],35670:[Rs,1,"bool"],35671:[Rs,2,"bvec2"],35672:[Rs,3,"bvec3"],35673:[Rs,4,"bvec4"],35674:[Rs,8,"mat2"],35685:[Rs,8,"mat2x3"],35686:[Rs,8,"mat2x4"],35675:[Rs,12,"mat3"],35687:[Rs,12,"mat3x2"],35688:[Rs,12,"mat3x4"],35676:[Rs,16,"mat4"],35689:[Rs,16,"mat4x2"],35690:[Rs,16,"mat4x3"]};function Ij(n){const e=zD[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function Rj(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Rs}for(const t in zD){const[i,r,s]=zD[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class Pre{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!pi(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=Ij(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new sa(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=Ij(i),l={location:e,name:t,accessor:new sa({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Fre=35981,Lre=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class Nj extends Nu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Lre),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=Fre}=e;return this.hash=t||"",this.vs="string"==typeof i?new VD(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new UD(this.gl,{id:`${e.id}-fs`,source:r}):r,tn(this.vs instanceof VD),tn(this.fs instanceof UD),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Bo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Pre(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:x,samplers:A}){if((x||A)&&(un.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(x||{})),un.priority>=e){const W=g?g.id:"default",G=`mode=${Wd(this.gl,t)} verts=${i} instances=${c} indexType=${Wd(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${W}`;un.log(e,G)()}return tn(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const W=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return tn(!1),0}}(t);p.begin(W)}this._bindTextures(),nc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&pi(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){un.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Jie(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof Is&&(s=s.texture),s instanceof Eg)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&ere(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new VD({handle:r});break;case 35632:i.fs=new UD({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=jc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),un.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),un.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||un.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(ge=>this._getHash(ge.name)).sort(),g=o.map(ge=>this._getHash(ge)),_=Object.keys(r).sort(),x=Object.keys(s).sort(),A=[],W=[];for(const ge of _)A.push(this._getHash(ge)),A.push(this._getHash(r[ge]));for(const ge of x)W.push(this._getHash(ge)),W.push(this._getHash(s[ge]));const G=`${d}/${f}D${A.join("/")}M${p.join("/")}I${W.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[G]){const ge=function(n,e){const{vs:t,fs:i}=e,r=yie(e.modules||[]);return{gl:n,vs:vj(n,Object.assign({},e,{source:t,type:Jy,modules:r})),fs:vj(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Uie(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[G]=new Nj(this.gl,{hash:G,vs:ge.vs,fs:ge.fs,varyings:o,bufferMode:a}),this._getUniforms[G]=ge.getUniforms||(Ne=>{}),this._useCounts[G]=0}return this._useCounts[G]++,this._programCache[G]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":zy.chrome?"Chrome":zy.safari?"Safari":zy.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Fa(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Fa.MAX_ATTRIBUTES=Fa.MAX_ATTRIBUTES||e.getParameter(34921),Fa.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Fa._setConstantFloatArray(e,t,i);break;case Int32Array:Fa._setConstantIntArray(e,t,i);break;case Uint32Array:Fa._setConstantUintArray(e,t,i);break;default:tn(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Fa.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return tn(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(tn(pi(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Fa.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new rr(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!kE||kE.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Hre=/^(.+)__LOCATION_([0-9]+)$/,Gre=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class $re{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Fa(e),bB(this,"VertexArray","v6.0",Gre),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new rr(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,un.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=sa.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return tn(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Hre.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof rr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof rr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof rr))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof rr){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return un.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function s0(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=s0(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function Pj(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof rr){const p=e,{data:g,changed:_}=p.getDebugData();let x;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?x=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${Wd(r,s)})`:(c=!0,x=`${l} bytes`),{[i]:`${d}${s0(f,{size:o,isInteger:c})}`,"Format ":x}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${s0(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Kre(n,e){const{type:t,size:i}=e,r=Rj(t,i);return r?`${n} (${r.name})`:n}function Fj({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){tn(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||HD({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:s0(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function HD({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?s0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function Lj(n){const{type:e,size:t}=n.accessor,i=Rj(e,t);return i?`${i.name} ${n.name}`:n.name}const Qre={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Jre(n,e){const{attributeMap:t=Qre}=e||{};return t&&t[n]||n}function ese(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}tn(Number.isFinite(e.size),`attribute ${n} needs size`)}const kj=()=>{},ise={};class BE{constructor(e,t={}){const{id:i=jc("model")}=t;tn(EE(e)),this.id=i,this.gl=e,this.id=t.id||jc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||r0.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},tn(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return tn(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return tn(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Jre(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ht({},o);delete c.value,i[a]=[new rr(n,l),c],ese(s,c)}}if(r){const s=r.value||r;tn(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new rr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(bg(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return gD(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),un.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&un.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:x,instanceCount:A}=this,{onBeforeRender:W=kj,onAfterRender:G=kj}=this.props;W(),this.program.setUniforms(this.uniforms);const ge=this.program.draw(Object.assign(ise,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:x,instanceCount:A,offset:f?g:0}));return G(),un.priority>=2&&this._logDrawCallEnd(c,l,i),ge}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return un.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}tn(t instanceof Nj,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new $re(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof rr&&t.delete()}}_setAnimationProps(e){this.animated&&tn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(bg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new oj(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:un.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=Pj(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Kre(s.name,a)}`),t[o]=Pj(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=Fj({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=Fj({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&un.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&un.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${Lj(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${Lj(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);un.table(e,s)(),un.table(e,o)(),un.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),un.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class GD{static isSupported(e){return pi(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();tn(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new BE(t,Object.assign({},e,{fs:e.fs||sj({version:aj(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(bg(n.feedbackBuffers)&&bg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Zne(e,t)),function(n){return!(bg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new hie(e,t)),tn(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function jE(){}const ose={onStart:jE,onUpdate:jE,onInterrupt:jE,onEnd:jE};class o0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ht(ht({},ose),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const pse={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new o0(i),this.attribute=t,this.attributeInTransition=new TD(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=ej(e.size);return new GD(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new rr(e,r),new rr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;tj(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)nj(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=AD(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:JB(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new o0(i),this.attribute=t,this.attributeInTransition=new TD(e,Un(ht({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new Oa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new Is(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=ej(e.size);return new GD(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new rr(e,r),new rr(e,r),new rr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)nj(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=AD(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:JB(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),tj(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),xE(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class gse{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=GD.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Oi.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=pse[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Oi.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const Bj="attributeManager.invalidate";class wse{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new gse(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;bo("attribute.updateStart",t),t.allocate(i)&&bo("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,bo("attribute.updateEnd",t,i))}}function Vj(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function Uj(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=ZB(r)))return;const o=Cse[r.type];if(!o)return void Oi.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Un(ht({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const VE={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:Tse}=VE;function Ise(n,e){if(!n.transitions)return null;const t={},i=WD(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&$D(n[r],e[r],s)&&(t[r]=!0)}return t}function zj({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=$D(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=$D(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function $D(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function Nse(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!jse(i[r],e[r])){t=n(i),e=i;break}return t}}function Vse(n,e){if(!e)return n;const t=ht(ht({},n),e);if("defines"in e&&(t.defines=ht(ht({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=ht({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function zE(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],x=e[13],A=e[14],W=e[15],G=t*a-i*o,ge=t*l-r*o,Ne=t*c-s*o,Ge=i*l-r*a,$e=i*c-s*a,at=r*c-s*l,St=d*x-f*_,Rt=d*A-p*_,Pt=d*W-g*_,Xt=f*A-p*x,Zt=f*W-g*x,bt=p*W-g*A,Ct=G*bt-ge*Zt+Ne*Xt+Ge*Pt-$e*Rt+at*St;return Ct?(n[0]=(a*bt-l*Zt+c*Xt)*(Ct=1/Ct),n[1]=(r*Zt-i*bt-s*Xt)*Ct,n[2]=(x*at-A*$e+W*Ge)*Ct,n[3]=(p*$e-f*at-g*Ge)*Ct,n[4]=(l*Pt-o*bt-c*Rt)*Ct,n[5]=(t*bt-r*Pt+s*Rt)*Ct,n[6]=(A*Ne-_*at-W*ge)*Ct,n[7]=(d*at-p*Ne+g*ge)*Ct,n[8]=(o*Zt-a*Pt+c*St)*Ct,n[9]=(i*Pt-t*Zt-s*St)*Ct,n[10]=(_*$e-x*Ne+W*G)*Ct,n[11]=(f*Ne-d*$e-g*G)*Ct,n[12]=(a*Rt-o*Xt-l*St)*Ct,n[13]=(t*Xt-i*Rt+r*St)*Ct,n[14]=(x*ge-_*Ge-A*G)*Ct,n[15]=(d*Ge-f*ge+p*G)*Ct,n):null}function Vc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],x=e[12],A=e[13],W=e[14],G=e[15],ge=t[0],Ne=t[1],Ge=t[2],$e=t[3];return n[0]=ge*i+Ne*a+Ge*f+$e*x,n[1]=ge*r+Ne*l+Ge*p+$e*A,n[2]=ge*s+Ne*c+Ge*g+$e*W,n[3]=ge*o+Ne*d+Ge*_+$e*G,n[4]=(ge=t[4])*i+(Ne=t[5])*a+(Ge=t[6])*f+($e=t[7])*x,n[5]=ge*r+Ne*l+Ge*p+$e*A,n[6]=ge*s+Ne*c+Ge*g+$e*W,n[7]=ge*o+Ne*d+Ge*_+$e*G,n[8]=(ge=t[8])*i+(Ne=t[9])*a+(Ge=t[10])*f+($e=t[11])*x,n[9]=ge*r+Ne*l+Ge*p+$e*A,n[10]=ge*s+Ne*c+Ge*g+$e*W,n[11]=ge*o+Ne*d+Ge*_+$e*G,n[12]=(ge=t[12])*i+(Ne=t[13])*a+(Ge=t[14])*f+($e=t[15])*x,n[13]=ge*r+Ne*l+Ge*p+$e*A,n[14]=ge*s+Ne*c+Ge*g+$e*W,n[15]=ge*o+Ne*d+Ge*_+$e*G,n}function a0(n,e,t){var o,a,l,c,d,f,p,g,_,x,A,W,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],x=e[9],A=e[10],W=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=x,n[10]=A,n[11]=W,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+x*s+e[13],n[14]=l*i+p*r+A*s+e[14],n[15]=c*i+g*r+W*s+e[15]),n}function l0(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function Gj(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function $j(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function Wj(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function qj(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],x=n[13],A=n[14],W=n[15],G=e[0],ge=e[1],Ne=e[2],Ge=e[3],$e=e[4],at=e[5],St=e[6],Rt=e[7],Pt=e[8],Xt=e[9],Zt=e[10],bt=e[11],Ct=e[12],Ut=e[13],ft=e[14],Wt=e[15];return Math.abs(t-G)<=gr*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(i-ge)<=gr*Math.max(1,Math.abs(i),Math.abs(ge))&&Math.abs(r-Ne)<=gr*Math.max(1,Math.abs(r),Math.abs(Ne))&&Math.abs(s-Ge)<=gr*Math.max(1,Math.abs(s),Math.abs(Ge))&&Math.abs(o-$e)<=gr*Math.max(1,Math.abs(o),Math.abs($e))&&Math.abs(a-at)<=gr*Math.max(1,Math.abs(a),Math.abs(at))&&Math.abs(l-St)<=gr*Math.max(1,Math.abs(l),Math.abs(St))&&Math.abs(c-Rt)<=gr*Math.max(1,Math.abs(c),Math.abs(Rt))&&Math.abs(d-Pt)<=gr*Math.max(1,Math.abs(d),Math.abs(Pt))&&Math.abs(f-Xt)<=gr*Math.max(1,Math.abs(f),Math.abs(Xt))&&Math.abs(p-Zt)<=gr*Math.max(1,Math.abs(p),Math.abs(Zt))&&Math.abs(g-bt)<=gr*Math.max(1,Math.abs(g),Math.abs(bt))&&Math.abs(_-Ct)<=gr*Math.max(1,Math.abs(_),Math.abs(Ct))&&Math.abs(x-Ut)<=gr*Math.max(1,Math.abs(x),Math.abs(Ut))&&Math.abs(A-ft)<=gr*Math.max(1,Math.abs(A),Math.abs(ft))&&Math.abs(W-Wt)<=gr*Math.max(1,Math.abs(W),Math.abs(Wt))}function Kj(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function HE(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new oa(4);oa!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const Yj=[0,0,0,0],hoe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],foe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],poe=[0,0,0],goe=[0,0,0],moe=UE(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=Yj,l=Yj,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=Xj(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=HE([],l,o),s=i||s,o=Vc([],r,s),o=Vc([],o,hoe)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:poe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Mi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Mi.LNGLAT:case Mi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Mi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function Xj(n,e,t=goe){let r,i=t,s=!0;switch(r=e===Mi.LNGLAT_OFFSETS||e===Mi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case kc.WEB_MERCATOR:(e===Mi.LNGLAT||e===Mi.CARTESIAN)&&(s=!1);break;case kc.WEB_MERCATOR_AUTO_OFFSET:e===Mi.LNGLAT?i=r:e===Mi.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case kc.IDENTITY:i=n.position.map(Math.fround);break;case kc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class boe extends bD{get ELEMENTS(){return Fu(!1),0}get RANK(){return Fu(!1),0}toString(){let e="[";if(xr.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new $n).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return Wj(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],x=n[14],A=n[15];return(e*o-t*s)*(f*A-p*x)-(e*a-i*s)*(d*A-p*_)+(e*l-r*s)*(d*x-f*_)+(t*a-i*o)*(c*A-p*g)-(t*l-r*o)*(c*x-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return zE(this,this),this.check()}multiplyLeft(e){return Vc(this,e,this),this.check()}multiplyRight(e){return Vc(this,this,e),this.check()}rotateX(e){return Gj(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return $j(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,x,A,W,G,ge,Ne,Ge,$e,at,St,Rt,Pt,Xt,Zt,bt,Ct,Ut,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*sc+rc)/(2*rc),512*(rc+Math.log(Math.tan(eV+e*sc*.5)))/(2*rc)]}function Yd([n,e]){const t=n/512*(2*rc)-rc,i=2*(Math.atan(Math.exp(e/512*(2*rc)-rc))-eV);return[t*YD,i*YD]}function $E({latitude:n,longitude:e,highPrecision:t=!1}){ku(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*sc),o=512/360,a=o/s,l=512/XD/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=sc*Math.tan(n*sc)/s,f=512/XD*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function nV(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=$E({longitude:t,latitude:i,highPrecision:!0}),d=Ng(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Yd(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function iV({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return a0(o,o,[0,0,-i]),Gj(o,o,-e*sc),$j(o,o,t*sc),l0(o,o,[r/=n,r,r]),s&&a0(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function rV({width:n,height:e,fovy:t=WE(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=WE(i));const a=.5*t*sc,l=sV(t),c=r*sc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function WE(n){return 2*Math.atan(.5/n)*YD}function sV(n){return.5/Math.tan(.5*n*sc)}function QD(n,e){const[t,i,r=0]=n;return ku(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Og(e,[t,i,r,1])}function _f(n,e,t=0){const[i,r,s]=n;if(ku(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Og(e,[i,r,s,1]);const o=Og(e,[i,r,0,1]),a=Og(e,[i,r,1,1]),l=o[2],c=a[2];return Qj([],o,a,l===c?0:((t||0)-l)/(c-l))}function oV({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:ku(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new qE({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],x=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ku(x[0]>0&&x[1]>0);const A=x[0]/_[0],W=x[1]/_[1],Ge=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/A,(g[1]+p[1])/2+(s.bottom-s.top)/2/W]),$e=Math.min(r,f.zoom+KD(Math.abs(Math.min(A,W))));return ku(Number.isFinite($e)),{longitude:Ge[0],latitude:Ge[1],zoom:$e}}const aV=Math.PI/180;function lV(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*aV:Math.atan(.5/n.altitude))>(90-n.pitch)*aV-.01?(l=cV(n,0,e),c=cV(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function cV(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Og(i,[e,0,1,1]),s=Og(i,[e,n.height,1,1]),c=Yd(Qj([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class qE{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=WE(l=1.5):null===c?c=WE(l):null===l&&(l=sV(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=$E({longitude:r,latitude:i}),x=Ng([r,i]);x[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(x,x,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=rV({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return Wj([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=iV({height:t,scale:g,center:x,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=x,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Vc(s,s,i),Vc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l0(o,o,[e/2,-t/2,1]),a0(o,o,[1,-1,0]),Vc(o,o,s);const a=zE([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof qE&&e.width===this.width&&e.height===this.height&&qj(e.projectionMatrix,this.projectionMatrix)&&qj(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=QD(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=_f([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Ng(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=Yd(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Ng(e)}unprojectFlat(e){return Yd(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=_f(t,this.pixelUnprojectionMatrix),s=Ig([],Ng(e),qD([],i));return Yd(Ig([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=oV(Object.assign({width:i,height:r,bounds:e},t));return new qE({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return lV(this,e.z||0)}}const Ooe=Math.PI/180,Noe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZD=[0,0,0],Foe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Pg=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?kc.WEB_MERCATOR:kc.WEB_MERCATOR_AUTO_OFFSET:kc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Xy(t.projectionMatrix,this.projectionMatrix)&&Xy(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=QD(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=_f([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Ng(t):t}unprojectFlat(t){return this.isGeospatial?Yd(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?$E({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends Pg{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:x=1.5}=t;const A=Math.pow(2,s);g=g||1,_=_||1,x=Math.max(.75,x);const{fov:W,aspect:G,focalDistance:ge,near:Ne,far:Ge}=rV({width:g,height:_,pitch:o,altitude:x,nearZMultiplier:l,farZMultiplier:c});let $e=iV({height:_,pitch:o,bearing:a,scale:A,altitude:x});p&&($e=(new $n).translate([512*p,0,0]).multiplyLeft($e)),super(Un(ht({},t),{width:g,height:_,viewMatrix:$e,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:W,aspect:G,focalDistance:ge,near:Ne,far:Ge})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=x,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(Un(ht({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return nV(t,i)}panByPosition(t,i){const r=_f(i,this.pixelUnprojectionMatrix),o=Ig([],this.projectFlat(t),qD([],r)),a=Ig([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=lV(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=oV(ht({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function JD(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof pV){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function gV(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=HE([],[o,a,l,1],t)),i){case Mi.LNGLAT:return JD([o,a,l],e,s);case Mi.LNGLAT_OFFSETS:return JD([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mi.METER_OFFSETS:return JD(nV(r,[o,a,l]),e,s);case Mi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Boe={10241:9987,10240:9729,10242:33071,10243:33071},eI={},Uoe={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||d0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tI(n,e)},accessor:{validate(n,e){const t=KE(n);return"function"===t||t===KE(e.value)},equal:(n,e,t)=>"function"==typeof e||tI(n,e)},array:{validate:(n,e)=>e.optional&&!n||d0(n),equal:(n,e,t)=>t.compare?tI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof Oa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new Oa(t,Un(ht({},e),{parameters:ht(ht(ht({},Boe),i),n.props.textureParameters)}));return eI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof Oa)||eI[n.id]&&(n.delete(),delete eI[n.id])}(n)}}};function tI(n,e){if(n===e)return!0;if(!d0(n)||!d0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=eae,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Zoe]||{},i=e[Qoe]||e,r=e[Joe]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(XB(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return ni(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=iI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const A=_,{dataTransform:W}=i.component?i.component.props:{};a=W?W(A,a):a.concat(A),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(A){d=!0,f=A}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const x=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;x&&x(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:vV,ASYNC_RESOLVED:bV,ASYNC_DEFAULTS:tae}=VE,nae={};let iae=0,rae=(()=>{class n{constructor(){this.props=Goe.apply(this,arguments),this.id=this.props.id,this.count=iae++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[tae])s in i[bV]?r[s]=i[bV][s]:s in i[vV]&&(r[s]=i[vV][s]);return new this.constructor(ht(ht(ht({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new yV({})}}return n.componentName="Component",n.defaultProps=nae,n})();class sae extends yV{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const oc=n=>"function"==typeof n,Xd=n=>null!==n&&"object"==typeof n,EV=n=>Xd(n)&&n.constructor==={}.constructor,oae=n=>n&&"function"==typeof n[Symbol.iterator],aae=n=>n&&"function"==typeof n[Symbol.asyncIterator],f0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Fg=n=>"undefined"!=typeof Blob&&n instanceof Blob,SV=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||Xd(n)&&oc(n.tee)&&oc(n.cancel)&&oc(n.getReader))(n)||(n=>Xd(n)&&oc(n.read)&&oc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function yf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sI(n){var e,t;let i;return yf(n,"null loader"),yf(rI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Un(ht({},n=n[0]),{options:ht(ht({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Uc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oI=Uc.global||Uc.self||Uc.window||{},fae="object"!=typeof process||"[object process]"!==String(process)||process.browser,xV="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);xV&&parseFloat(xV[1]);const lI={};function pae(n){for(const e in lI)n.startsWith(e)&&(n=n.replace(e,lI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const gae=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,mae=/^([-\w.]+\/[-\w.+]+)/;function _ae(n){const e=mae.exec(n);return e?e[1]:n}function CV(n){const e=gae.exec(n);return e?e[1]:""}const yae=/\?.*/;function ZE(n){if(f0(n)){const e=cI(n.url||"");return{url:e,type:_ae(n.headers.get("content-type")||"")||CV(e)}}return Fg(n)?{url:cI(n.name||""),type:n.type||""}:"string"==typeof n?{url:cI(n),type:CV(n)}:{url:"",type:""}}function vae(n){return f0(n)?n.headers["content-length"]||-1:Fg(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cI(n){return n.replace(yae,"")}function AV(n){return uI.apply(this,arguments)}function uI(){return(uI=ni(function*(n){if(f0(n))return n;const e={},t=vae(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=ZE(n);r&&(e["content-type"]=r);const s=yield Eae(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function bae(n){return dI.apply(this,arguments)}function dI(){return(dI=ni(function*(n){if(!n.ok){const e=yield wae(n);throw new Error(e)}})).apply(this,arguments)}function wae(n){return hI.apply(this,arguments)}function hI(){return(hI=ni(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function Eae(n){return fI.apply(this,arguments)}function fI(){return(fI=ni(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${Sae(n.slice(0,5))}`:null})).apply(this,arguments)}function Sae(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const DV={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Wn(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Aae={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function gI(){oI.loaders=oI.loaders||{};const{loaders:n}=oI;return n._state=n._state||{},n._state}const mI=()=>{const n=gI();return n.globalOptions=n.globalOptions||ht({},DV),n.globalOptions};function Tae(n,e,t,i){return t=t||[],function(n,e){RV(n,null,DV,Aae,e);for(const t of e)RV(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=ht({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new xae),NV(r,mI()),NV(r,e),r}(e,n,i)}function IV(n,e){const t=mI(),i=n||t;return"function"==typeof i.fetch?i.fetch:Xd(i.fetch)?r=>TV(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:TV}function RV(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&Xd(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)MV.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=Dae(a,r);MV.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function Dae(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function NV(n,e){for(const t in e)t in e&&(n[t]=EV(e[t])&&EV(n[t])?ht(ht({},n[t]),e[t]):e[t])}function zc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Oae(n,e="3.0.12"){return zc(n,"no worker provided"),!(!e||!n.version)}const Hc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Nae=Hc.global||Hc.self||Hc.window||{},_I="object"!=typeof process||"[object process]"!==String(process)||process.browser,yI="function"==typeof importScripts,Pae="undefined"!=typeof window&&void 0!==window.orientation,PV="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),vI=(PV&&parseFloat(PV[1]),new Map);function FV(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function LV(n,e=!0,t){const i=t||new Set;if(n)if(kV(n))i.add(n);else if(kV(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)LV(n[r],e,i);return void 0===t?Array.from(i):[]}function kV(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const bI=()=>{};class BV{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Wn(this,"name",void 0),Wn(this,"source",void 0),Wn(this,"url",void 0),Wn(this,"terminated",!1),Wn(this,"worker",void 0),Wn(this,"onMessage",void 0),Wn(this,"onError",void 0),Wn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;zc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bI,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bI,this.onError=bI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||LV(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){zc(n.source&&!n.url||!n.source&&n.url);let e=vI.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?FV(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),vI.set(n.url,e)),n.source&&(e=FV(n.source),vI.set(n.source,e))),zc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class Bae{constructor(e,t){Wn(this,"name",void 0),Wn(this,"workerThread",void 0),Wn(this,"isRunning",void 0),Wn(this,"result",void 0),Wn(this,"_resolve",void 0),Wn(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zc(this.isRunning),this.isRunning=!1,this._reject(e)}}class jae{constructor(e){Wn(this,"name","unnamed"),Wn(this,"source",void 0),Wn(this,"url",void 0),Wn(this,"maxConcurrency",1),Wn(this,"maxMobileConcurrency",1),Wn(this,"onDebug",()=>{}),Wn(this,"reuseWorkers",!0),Wn(this,"props",{}),Wn(this,"jobQueue",[]),Wn(this,"idleQueue",[]),Wn(this,"count",0),Wn(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=ht(ht({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return ni(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return ni(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new Bae(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class Bu{static isSupported(){return BV.isSupported()}static getWorkerFarm(e={}){return Bu._workerFarm=Bu._workerFarm||new Bu({}),Bu._workerFarm.setProps(e),Bu._workerFarm}constructor(e){Wn(this,"props",void 0),Wn(this,"workerPools",new Map),this.props=ht({},Vae),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ht(ht({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new jae({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function zae(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return zc(r),r}function Hae(n,e){return!!Bu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Gae(n,e,t,i,r){return wI.apply(this,arguments)}function wI(){return(wI=ni(function*(n,e,t,i,r){const s=n.id,o=zae(n,t),l=Bu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",$ae.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function $ae(n,e,t,i){return EI.apply(this,arguments)}function EI(){return(EI=ni(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}Wn(Bu,"_workerFarm",void 0);var VV=tt(521);function UV(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return VV.toArrayBuffer?VV.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Yae(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function zV(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Xae(n){return xI.apply(this,arguments)}function xI(){return(xI=ni(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Yae(...e)})).apply(this,arguments)}const Jae=262144;function HV(n){this.wrapped=n}function p0(n){return new HV(n)}function g0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof HV;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function AI(n){return function(){return new g0(n.apply(this,arguments))}}function TI(){return(TI=AI(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(II)}function ale(n,e,t){return RI.apply(this,arguments)}function RI(){return(RI=ni(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return ole(n,e);if(Fg(n)&&(n=yield AV(n)),f0(n)){const r=n;return yield bae(r),e.binary?yield r.arrayBuffer():yield r.text()}if(SV(n)&&(n=sle(n,t)),oae(n)||aae(n))return Xae(n);throw new Error(II)})).apply(this,arguments)}function cle(n,e,t=null){if(t)return t;const i=ht({fetch:IV(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function ule(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const $V=()=>{const n=gI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function WV(n){const e=$V();n=Array.isArray(n)?n:[n];for(const t of n){const i=sI(t);e.find(r=>i===r)||e.unshift(i)}}const hle=/\.([^.]+)$/;function fle(n){return PI.apply(this,arguments)}function PI(){return(PI=ni(function*(n,e=[],t,i){if(!KV(n))return null;let r=qV(n,e,Un(ht({},t),{nothrow:!0}),i);if(r)return r;if(Fg(n)&&(r=qV(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(YV(n));return r})).apply(this,arguments)}function qV(n,e=[],t,i){if(!KV(n))return null;if(e&&!Array.isArray(e))return sI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...$V()),function(n){for(const e of n)sI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=ZE(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=FI(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&hle.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||FI(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(vle(e,t))return t}else if(ArrayBuffer.isView(e)){if(XV(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&XV(e,0,t))return t;return null}(e,n),a=a||FI(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(YV(n));return s}function KV(n){return!(n instanceof Response&&204===n.status)}function YV(n){const{url:e,type:t}=ZE(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?LI(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?LI(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function FI(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function vle(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function XV(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Gc=new Uint8ClampedArray(0);const Ile={data:{type:"data",value:Mle,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=Un(ht({},r),{fetch:Un(ht({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:eS(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):eS(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mi.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let VI=(()=>{class n extends rae{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=gV(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=QD(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=ht({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Mi.DEFAULT&&(t=i.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=Xj(t,i,r),f=gV(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mi.DEFAULT||t===Mi.LNGLAT||t===Mi.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){ic(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=Vse(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!Dle({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Gc.length/3);if(this.internalState.usesPickingColorCache=!0,rQV&&Oi.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Gc=Yy.allocate(Gc,i,{size:3,copy:!0,maxCount:Math.max(i,QV)});const s=Math.floor(Gc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&bo("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=zj({newProps:n,oldProps:e,propTypes:WD(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&Hj(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&Hj(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Nse(n,e),transitionsChanged:Ise(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=WD(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new wse(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){ic(!this.internalState&&!this.state),ic(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new sae({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Oi.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new Ase(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){bo("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=Ile,n})(),Ole=(()=>{class n extends VI{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:A,fetch:W,_subLayerProps:G}=this.props,ge={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:A,fetch:W},Ne=G&&G[t.id],Ge=Ne&&Ne.updateTriggers,$e=t.id||"sublayer";if(Ne){const at=this.constructor._propTypes,St=t.type?t.type._propTypes:{};for(const Rt in Ne){const Pt=St[Rt]||at[Rt];Pt&&"accessor"===Pt.type&&(Ne[Rt]=this.getSubLayerAccessor(Ne[Rt]))}}Object.assign(ge,t,Ne),ge.id="".concat(this.props.id,"-").concat($e),ge.updateTriggers=ht(ht({all:this.props.updateTriggers.all},t.updateTriggers),Ge);for(const at of A){const St=at.getSubLayerProps.call(this,at);St&&Object.assign(ge,St,{updateTriggers:Object.assign(ge.updateTriggers,St.updateTriggers)})}return ge}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=xD(t,Boolean),this.internalState.subLayers=t),bo("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Nle=/([0-9]+\.?[0-9]*)(%|px)/;function tS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Nle);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function nS(n,e){return n.relative?Math.round(n.position*e):n.position}function m0(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&m0(i,r)))return!1}return!0}class UI{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=Pg}=e;ic(!p||p instanceof Pg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Un(ht({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):m0(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=ht({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:nS(this._x,e),y:nS(this._y,t),width:nS(this._width,e),height:nS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ht(ht({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ht(ht(ht({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=tS(e),this._y=tS(t),this._width=tS(i),this._height=tS(r)}}const _0=()=>{},ZV={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:_0,onTransitionInterrupt:_0,onTransitionEnd:_0};class Ple{constructor(e,t={}){this.ControllerState=e,this.props=ht(ht({},ZV),t),this.propsInTransition=null,this.transition=new o0(t.timeline),this.onViewStateChange=t.onViewStateChange||_0,this.onStateChange=t.onStateChange||_0,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=ht(ht({},ZV),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ht(ht({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(ht(ht({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const JV=["longitude","latitude","zoom","bearing","pitch"],Lle=["longitude","latitude","zoom"];class eU extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!Xy(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];ic(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:JV,extract:JV,required:Lle}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=CE(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ht(ht({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,CE(e.around,t.around,i)))}return r}}const Qd={transitionDuration:0},kle={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},rS=n=>1-(1-n)*(1-n),Lg_WHEEL=["wheel"],Lg_PAN=["panstart","panmove","panend"],Lg_PINCH=["pinchstart","pinchmove","pinchend"],Lg_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Lg_DOUBLE_TAP=["doubletap"],Lg_KEYBOARD=["keydown"];class zI{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new Ple(e,Un(ht({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Un(ht({},kle),{transitionInterpolator:new eU({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Lg_WHEEL,d&&i),this.toggleEvents(Lg_PAN,d&&(r||s)),this.toggleEvents(Lg_PINCH,d&&(a||l)),this.toggleEvents(Lg_TRIPLE_PAN,d&&l),this.toggleEvents(Lg_DOUBLE_TAP,d&&o),this.toggleEvents(Lg_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=ht(ht({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,Qd,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,Un(ht({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,Qd,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Qd,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,Un(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,Qd,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,Qd,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,Un(ht({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:rS}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?Un(ht({},t),{transitionInterpolator:new eU(Un(ht({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:Qd}}class tU{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const Zd_target=[0,0,0];class sS extends tU{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=Zd_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:A,startZoom:W}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:A,startZoom:W},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(Un(ht({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ht({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),gf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new sS(ht(ht(ht({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=gf(r,i,t),e.rotationX=gf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class jle extends zI{constructor(e){super(sS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Vle extends zI{constructor(e){e.dragMode=e.dragMode||"pan",super(sS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Ule=(new $n).lookAt({eye:[0,0,1]});function zle({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new $n).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Hle extends Pg{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(Un(ht({},e),{longitude:null,position:a,viewMatrix:Ule.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:zle({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Ig([],e,qD([],_f(t,this.pixelUnprojectionMatrix)));return{target:Ig([],this.center,r)}}}let Gle=(()=>{class n extends UI{constructor(t){super(Un(ht({},t),{type:Hle}))}get controller(){return this._getControllerProps({type:Vle})}}return n.displayName="OrthographicView",n})();const oS=Math.PI/180;function $le({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*oS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new $n).lookAt({eye:l,up:a});c.rotateX(i*oS),"Z"===t?c.rotateZ(r*oS):c.rotateY(r*oS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class Wle extends Pg{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(Un(ht({},e),{longitude:null,viewMatrix:$le({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=_f([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let qle=(()=>{class n extends UI{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Un(ht({},t),{orbitAxis:i,type:Wle}))}get controller(){return this._getControllerProps({type:jle})}}return n.displayName="OrbitView",n})();const Kle=[255,255,255],Yle=1;let Xle=0;class nU{constructor(e={}){const{color:t=Kle}=e,{intensity:i=Yle}=e;this.id=e.id||"ambient-".concat(Xle++),this.color=t,this.intensity=i,this.type="ambient"}}const Qle=[255,255,255],Zle=1,Jle=[0,0,-1];let ece=0;class iU{constructor(e={}){const{color:t=Qle}=e,{intensity:i=Zle}=e,{direction:r=Jle}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(ece++),this.color=t,this.intensity=i,this.type="directional",this.direction=new vo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class rU{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ht({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class HI extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ht({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Ou(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Ou(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=sU(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dgD(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Ou(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||sU(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class rce extends HI{constructor(e,t){super(e,t),this.shadowMap=new Oa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new Sg(e,{format:33189,width:1,height:1}),this.fbo=new Is(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;nc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=vg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Un(ht({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const oce=Object.keys(Mi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Mi[n],";")).join(""),ace=Object.keys(kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(kc[n],";")).join(""),lce="".concat(oce,"\n").concat(ace,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),cce={},GI={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:lce,getUniforms:function(n=cce){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Mi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mi.DEFAULT&&(i=n.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN);const o=moe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||foe,o}(n):{}}},fce=UE(function({viewport:n,center:e}){return new $n(n.viewProjectionMatrix).invert().transform(e)}),pce=UE(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=_f([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new vo(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new $n).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),gce=[0,0,0,1],mce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],$I={name:"shadow",dependencies:[GI],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||gce,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=fce({viewport:n.viewport,center:e.project_uCenter}),r=[],s=pce({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},wce={color:[255,255,255],intensity:1},oU=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],Ece=[0,0,0,200/255];class WI extends rU{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=Ece,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=r0.getDefaultProgramManager(e),$I&&this.programManager.addDefaultModule($I)),this.dummyShadowMap||(this.dummyShadowMap=new Oa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule($I),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new $n).lookAt({eye:new vo(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=xce++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class Cce{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=eS(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class Ace{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new Cce(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const Tce=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},GI],Mce=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function Dce(n){const e=r0.getDefaultProgramManager(n);for(const t of Tce)e.addDefaultModule(t);for(const t of Mce)e.addShaderHook(t);return e}const Oce=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Nce{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ace({gl:e,protocol:"deck://"}),this.context=Un(ht({},Oce),{layerManager:this,gl:e,deck:t,programManager:e&&Dce(e),stats:i||new lD({id:"deck.gl"}),viewport:r||new Pg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new aU,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){bo("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=xD(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return bo("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Oi.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Oi.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class Pce{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=xD(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!m0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Oi.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(ht({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=Un(ht(ht(ht({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class Lce extends tU{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:x,startRotatePos:A,startBearing:W,startPitch:G,startZoom:ge,normalize:Ne}={}){ic(Number.isFinite(s)),ic(Number.isFinite(r)),ic(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:Ne}),this._state={startPanLngLat:_,startZoomLngLat:x,startRotatePos:A,startBearing:W,startPitch:G,startZoom:ge},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(Un(ht({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(Un(ht({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ht({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(ht(ht(ht({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=gf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=gf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=Jj(t+180,360)-180),(o<-180||o>180)&&(o=Jj(o+180,360)-180);const a=KD(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Yd([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return gf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=gf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class kce extends zI{constructor(e){e.dragMode=e.dragMode||"pan",super(Lce,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Bce=(()=>{class n extends UI{constructor(t){super(Un(ht({},t),{type:pV}))}get controller(){return this._getControllerProps({type:kce})}}return n.displayName="MapView",n})();const jce=new WI;class Vce{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!m0(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof WI)||this._internalEffects.push(jce)}}class Uce extends HI{}const cU={blendFunc:[1,0,32771,0],blendEquation:32774};class uU extends HI{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,nc(_,Un(ht({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},cU),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Un(ht({},cU),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ht(ht({},e.props.parameters),i)}}class Hce{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Uce(e),this.pickLayersPass=new uU(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Is.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Un(ht({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,bo("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new Is(this.gl),new Is(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const Gce={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function $ce({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let A=0;A=0){const G=A+o-t,ge=G*G+x;ge<=d&&(d=ge,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),x=e[g];if(x){const A=x.decodePickingColor(_),W=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:x,pickedObjectIndex:A,pickedX:o+(f/4-W*l),pickedY:a+W}}Oi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Gce}function dU({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function qce(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(x=>x.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=dU(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=ht({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=hU({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function hU({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Yce{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new uU(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?ht(ht({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Is(e),Is.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Is(e),this.depthFBO.attach({36064:new Oa(e,{format:pi(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Oi.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:dU({viewports:i,x:r,y:s})};this._resizeBuffer();const f=vg(this.gl),p=sD(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:x,height:A}=this.pickingFBO,W=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:x,deviceHeight:A});let G;const ge=[],Ne={};for(let Ge=0;Ge=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Oi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:W,width:x.x+x.width-g,height:_-W},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Ge=new Map,$e=Number.isFinite(c);for(let at=0;at=c);at++){const St=Ne[at];let Rt={color:St.pickedColor,layer:null,index:St.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};Rt=hU({layer:St.pickedLayer,info:Rt,mode:l}),Ge.has(Rt.object)||Ge.set(Rt.object,Rt)}return Array.from(Ge.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return xE(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Xce={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Qce{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Xce),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function fU(n,e){if(!n)throw new Error(e)}const $c={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pU=$c.global||$c.self||$c.window,Jce="object"!=typeof process||"[object process]"!==String(process)||process.browser,gU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:eue}=(gU&&parseFloat(gU[1]),pU),qI="undefined"!=typeof Image,KI="undefined"!=typeof ImageBitmap,tue=Boolean(eue),YI=!!Jce||tue;function mU(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function _U(n){switch(mU(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const rue=/^data:image\/svg\+xml/,sue=/\.svg((\?|#).*)?$/;function XI(n){return n&&(rue.test(n)||sue.test(n))}function oue(n,e){if(XI(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return vU(n,e)}function vU(n,e){if(XI(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function bU(n,e,t){return QI.apply(this,arguments)}function QI(){return(QI=ni(function*(n,e,t){const i=oue(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield aue(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function aue(n,e){return ZI.apply(this,arguments)}function ZI(){return(ZI=ni(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const lue={};let wU=!0;function cue(n,e,t){return JI.apply(this,arguments)}function JI(){return(JI=ni(function*(n,e,t){let i;i=XI(t)?yield bU(n,e,t):vU(n,t);const r=e&&e.imagebitmap;return yield uue(i,r)})).apply(this,arguments)}function uue(n){return eR.apply(this,arguments)}function eR(){return(eR=ni(function*(n,e=null){if((due(e)||!wU)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),wU=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function due(n){for(const e in n||lue)return!1;return!0}const Wc=!1,y0=!0;function tR(n){const e=v0(n);return function(n){const e=v0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Wc)?{mimeType:"image/png",width:e.getUint32(16,Wc),height:e.getUint32(20,Wc)}:null}(e)||function(n){const e=v0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Wc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Wc)?{mimeType:"image/gif",width:e.getUint16(6,y0),height:e.getUint16(8,y0)}:null}(e)||function(n){const e=v0(n);return e.byteLength>=14&&16973===e.getUint16(0,Wc)&&e.getUint32(2,y0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,y0),height:e.getUint32(22,y0)}:null}(e)}function v0(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function _ue(n,e){const{mimeType:t}=tR(n)||{},{_parseImageNode:i}=pU;return fU(i),i(n,t,e)}function nR(){return(nR=ni(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(vue(r)){case"imagebitmap":a=yield cue(n,e,s);break;case"image":a=yield bU(n,e,s);break;case"data":a=yield _ue(n,e);break;default:fU(!1)}return"data"===r&&(a=_U(a)),a})).apply(this,arguments)}function vue(n){switch(n){case"auto":case"data":return function(){if(KI)return"imagebitmap";if(qI)return"image";if(YI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return KI||qI||YI;case"imagebitmap":return KI;case"image":return qI;case"data":return YI;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const EU={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return nR.apply(this,arguments)},tests:[n=>Boolean(tR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},wue={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},b0="8.5.8",aS=Sr.CO.deck&&Sr.CO.deck.VERSION;if(aS&&aS!==b0)throw new Error("deck.gl - multiple versions detected: ".concat(aS," vs ").concat(b0));aS||(Oi.log(1,"deck.gl ".concat(b0))(),Sr.CO.deck=Object.assign(Sr.CO.deck||{},{VERSION:b0,version:b0,log:Oi,_registerLoggers:function(n){MD=n}}),WV([wue,[EU,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Eue=Sr.CO.deck;class lS extends Nu{static isSupported(e,t=[]){const i=pi(e),r=FB(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:tn(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return lS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const SU=(0,Sr.jU)()&&"undefined"!=typeof document;let Oue=0;class Nue{constructor(e={}){const{onCreateContext:t=(A=>mB(A)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=ff.get("animation-loop-"+Oue++)}=e;let{useDevicePixels:x=!0}=e;"useDevicePixelRatio"in e&&(un.deprecated("useDevicePixelRatio","useDevicePixels")(),x=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:x}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return tn("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=lS.isSupported(this.gl,["timers"])?new lS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return ni(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return un.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=SU?new Promise((e,t)=>{SU&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?aD(this.props.gl,e):this.onCreateContext(e),!EE(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Ou(n,rD)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(un.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(un.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Is(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var Pue=tt(524),cS=tt.n(Pue);const Fue={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(cS().MouseInput);const jue=cS().Manager,qc=cS(),Vue=qc?[[qc.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[qc.Rotate,{enable:!1}],[qc.Pinch,{enable:!1}],[qc.Swipe,{enable:!1}],[qc.Pan,{threshold:0,enable:!1}],[qc.Press,{enable:!1}],[qc.Tap,{event:"doubletap",taps:2,enable:!1}],[qc.Tap,{event:"anytap",enable:!1}],[qc.Tap,{enable:!1}]]:null,AU={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Uue={doubletap:["tap"]},zue={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},rR={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Hue={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},TU={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Gue="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",kg="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let MU=!1;try{const n={get passive(){return MU=!0,!0}};kg.addEventListener("test",n,n),kg.removeEventListener("test",n,n)}catch(n){}const $ue=-1!==Gue.indexOf("firefox"),{WHEEL_EVENTS:Wue}=rR,IU=4.000244140625;class Yue{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Wue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!MU&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;kg.WheelEvent&&($ue&&e.deltaMode===kg.WheelEvent.DOM_DELTA_PIXEL&&(t/=kg.devicePixelRatio),e.deltaMode===kg.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%IU==0&&(t=Math.floor(t/IU)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:Xue}=rR,RU="pointermove",OU="pointerover",NU="pointerout",PU="pointerleave";class Que{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Xue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===RU&&(this.enableMoveEvent=t),e===OU&&(this.enableOverEvent=t),e===NU&&(this.enableOutEvent=t),e===PU&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:OU,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:NU,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:PU,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:RU,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Zue}=rR,FU="keydown";class Jue{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Zue.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===FU&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:FU,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const kU="contextmenu";class ede{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===kU&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:kU,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const tde={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},BU={srcElement:"root",priority:0};class fde{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},BU,i):BU;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&AU[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new Yue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Que(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Jue(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new ede(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=Uue[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=TU[e]||e;let c=a.get(l);c||(c=new fde(this),a.set(l,c),c.recognizerName=Hue[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(TU[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=zue[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function bf(){}const jU={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:bf,onResize:bf,onViewStateChange:bf,onInteractionStateChange:bf,onBeforeRender:bf,onAfterRender:bf,onLoad:bf,onError:(n,e)=>Oi.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class dS{constructor(e){e=ht(ht({},jU),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Oi.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Sr.qs)()&&Oi.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new lD({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Yy.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Oi.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Oi.removed("onLayerClick","onClick")(),e.initialViewState&&!m0(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](ht({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),ic(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new Nue({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>mB(Un(ht(ht({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new Bce({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,aD(e,{enable:!0,copyState:!0})),this.tooltip=new Qce(this.canvas),Ou(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new aU;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new gde(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in eB)this.eventManager.on(r,this._onEvent);this.viewManager=new Pce({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new Nce(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new Vce,this.deckRenderer=new Hce(e),this.deckPicker=new Yce(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Ou(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ht({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Oi.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=Un(ht({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=eB[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=ff.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}dS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(rU)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},dS.defaultProps=jU,dS.VERSION=Eue.VERSION;const VU={name:"project32",dependencies:[GI],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},UU="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",yde={lightSources:{}};function aR({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const lR={name:"lights",vs:UU,fs:UU,getUniforms:function zU(n=yde){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?aR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=aR(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=aR(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return zU({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},bde={};const Ede={name:"phong-lighting",dependencies:[lR],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=bde){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},xde={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},$U=ht({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=xde){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),WU={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class hS{static get DRAW_MODE(){return WU}constructor(e={}){const{id:t=jc("geometry"),drawMode:i=WU.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?ht({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,tn(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(tn(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return tn(Number.isFinite(i)),i}}const cR=Math.PI/180,fS=new Float32Array(16),qU=new Float32Array(12);function KU(n,e,t){const i=e[0]*cR,r=e[1]*cR,s=e[2]*cR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function YU(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const XU={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let x;g?(fS.set(a),x=YU(fS)):(x=qU,KU(x,r,s),x.set(o,9)),n.value=new Float32Array(x)}else{let x=e*n.size;const{iterable:A,objectInfo:W}=YB(i,e,t);for(const G of A){let ge;W.index++,g?(fS.set(c?a:a(G,W)),ge=YU(fS)):(ge=qU,KU(ge,f?r:r(G,W),d?s:s(G,W)),ge.set(p?o:o(G,W),9)),_[x++]=ge[0],_[x++]=ge[1],_[x++]=ge[2],_[x++]=ge[3],_[x++]=ge[4],_[x++]=ge[5],_[x++]=ge[6],_[x++]=ge[7],_[x++]=ge[8],_[x++]=ge[9],_[x++]=ge[10],_[x++]=ge[11]}}}};function QU(n,e){return e===Mi.CARTESIAN||e===Mi.METER_OFFSETS||e===Mi.DEFAULT&&!n.isGeospatial}function ZU(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Oi.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function Mde(n,e){if(n.attributes)return ZU(n.attributes,e),n instanceof hS?n:new hS(n);if(n.positions||n.POSITION)return ZU(n,e),new hS({attributes:n});throw Error("Invalid mesh")}const Dde={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let Ide=(()=>{class n extends VI{getShaders(){const t=!pi(this.context.gl),i={};return yD(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[VU,Ede,$U],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:XU}),this.setState({emptyTexture:new Oa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||QU(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new BE(this.context.gl,Un(ht({},this.getShaders()),{id:this.props.id,geometry:Mde(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=Dde,n})();const JU={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[lR]};class Bg{constructor(e={}){const{id:t}=e;this.id=t||jc(this.constructor.name),this.display=!0,this.position=new vo,this.rotation=new vo,this.scale=new vo(1,1,1),this.matrix=new $n,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return tn(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return tn(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return tn(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){tn(e),t=t||this.matrix;const i=new $n(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class w0 extends Bg{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;un.assert(t.every(i=>i instanceof Bg),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new $n}={}){const i=new $n(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof w0?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function ez(){var n=new oa(4);return oa!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function tz(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function nz(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var rz=Kj,$de=function(){var n=jB(),e=VB(1,0,0),t=VB(0,1,0);return function(i,r,s){var o=UB(r,s);return o<-.999999?(TE(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&TE(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),tz(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(TE(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();ez(),ez(),function(){var n=new oa(9);oa!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const Wde=[0,0,0,1],Kde={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Yde={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function az(n){if(!n._animation){const e=Yde[n.componentType],t=Kde[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return tz(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=to(e)}get y(){return this[1]}set y(e){this[1]=to(e)}get z(){return this[2]}set z(e){this[2]=to(e)}get w(){return this[3]}set w(e){this[3]=to(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return $de(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Fu(!t),nz(this,this,e),this.check()}multiplyLeft(e,t){return Fu(!t),nz(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return rz(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Wde,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,x,A,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>gr?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-i)*p)/_,A=Math.sin(i*p)/_):(x=1-i,A=i),n[0]=x*r+A*l,n[1]=x*s+A*c,n[2]=x*o+A*d,n[3]=x*a+A*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),AE(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class nhe{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:un.warn(`Bad animation path ${s}`)()}tn(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){uR.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:az(e.accessors[a]),interpolation:l,output:az(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new nhe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class rhe extends Bg{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof BE?(this.model=e,this._setModelNodeProps(t)):this.model=new BE(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class she{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},yD(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new Oa(this.gl,ht({id:e.name||e.id,parameters:ht(ht({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(un.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function lz(n,e){return pi(n)?`#version 300 es\n${e}`:e}const che={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},uhe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class dhe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},uhe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new ihe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new w0({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new w0({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new $n).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new w0({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){un.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new she(n,e);un.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new rhe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[JU],defines:a.defines,parameters:a.parameters,vs:lz(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:lz(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),un.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new rr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new sa({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:che[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function cz(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new jg(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new jg(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof jg){const o=e;t=o.fields,i=fz(fz(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new jg(s,i)}}function fz(n,e){return new Map([...n||new Map,...e||new Map])}let Rr,pz,gz,mz,_z,yz,vz,bz;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(Rr||(Rr={}));class dR{static isNull(e){return e&&e.typeId===Rr.Null}static isInt(e){return e&&e.typeId===Rr.Int}static isFloat(e){return e&&e.typeId===Rr.Float}static isBinary(e){return e&&e.typeId===Rr.Binary}static isUtf8(e){return e&&e.typeId===Rr.Utf8}static isBool(e){return e&&e.typeId===Rr.Bool}static isDecimal(e){return e&&e.typeId===Rr.Decimal}static isDate(e){return e&&e.typeId===Rr.Date}static isTime(e){return e&&e.typeId===Rr.Time}static isTimestamp(e){return e&&e.typeId===Rr.Timestamp}static isInterval(e){return e&&e.typeId===Rr.Interval}static isList(e){return e&&e.typeId===Rr.List}static isStruct(e){return e&&e.typeId===Rr.Struct}static isUnion(e){return e&&e.typeId===Rr.Union}static isFixedSizeBinary(e){return e&&e.typeId===Rr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Rr.FixedSizeList}static isMap(e){return e&&e.typeId===Rr.Map}static isDictionary(e){return e&&e.typeId===Rr.Dictionary}get typeId(){return Rr.NONE}compareTo(e){return this===e}}Symbol,Symbol,pz=Symbol.toStringTag;class Vg extends dR{constructor(e,t){super(),Wn(this,"isSigned",void 0),Wn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Rr.Int}get[pz](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class whe extends Vg{constructor(){super(!0,8)}}class Ehe extends Vg{constructor(){super(!0,16)}}class She extends Vg{constructor(){super(!0,32)}}class xhe extends Vg{constructor(){super(!1,8)}}class Che extends Vg{constructor(){super(!1,16)}}class Ahe extends Vg{constructor(){super(!1,32)}}gz=Symbol.toStringTag;class wz extends dR{constructor(e){super(),Wn(this,"precision",void 0),this.precision=e}get typeId(){return Rr.Float}get[gz](){return"Float"}toString(){return`Float${this.precision}`}}class The extends wz{constructor(){super(32)}}class Mhe extends wz{constructor(){super(64)}}Symbol,Symbol,mz=Symbol.toStringTag,_z=Symbol.toStringTag,yz=Symbol.toStringTag,vz=Symbol.toStringTag,bz=Symbol.toStringTag;class Dhe extends dR{constructor(e,t){super(),Wn(this,"listSize",void 0),Wn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Rr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[bz](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class gS{constructor(e,t,i=!1,r=new Map){Wn(this,"name",void 0),Wn(this,"type",void 0),Wn(this,"nullable",void 0),Wn(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new gS(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function Ez(n,e,t){const i=t?Sz(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new whe;case Uint8Array:return new xhe;case Int16Array:return new Ehe;case Uint16Array:return new Che;case Int32Array:return new She;case Uint32Array:return new Ahe;case Float32Array:return new The;case Float64Array:return new Mhe;default:throw new Error("array type not supported")}}(e.value);return new gS(n,new Dhe(e.size,new gS("value",r)),!1,i)}function Sz(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const xz={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Nhe={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class Fhe{constructor(e){Wn(this,"draco",void 0),Wn(this,"decoder",void 0),Wn(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=Sz(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=Ez(o,n[o],s[o]);r.push(l)}if(t){const o=Ez("indices",t);r.push(o)}return new jg(r,i)}(l.attributes,a,l.indices);return Un(ht({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var mS=tt(125);const gR={};function mR(n){return _R.apply(this,arguments)}function _R(){return(_R=ni(function*(n,e=null,t={}){return e&&(n=Vhe(n,e,t)),gR[n]=gR[n]||Uhe(n),yield gR[n]})).apply(this,arguments)}function Vhe(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_I?t.CDN?(zc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yI?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Uhe(n){return yR.apply(this,arguments)}function yR(){return(yR=ni(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_I?yI?importScripts(n):zhe(yield(yield fetch(n)).text(),n):mS.requireFromFile&&(yield mS.requireFromFile(n))})).apply(this,arguments)}function zhe(n,e){if(!_I)return mS.requireFromString&&mS.requireFromString(n,e);if(yI)return eval.call(Nae,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Hhe="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Ghe="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",$he="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let E0;function qhe(n){return vR.apply(this,arguments)}function vR(){return(vR=ni(function*(n){const e=n.modules||{};return E0=e.draco3d?E0||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):E0||Khe(n),yield E0})).apply(this,arguments)}function Khe(n){return wR.apply(this,arguments)}function wR(){return(wR=ni(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield mR(Hhe,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield mR(Ghe,"draco",n),yield mR($he,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Yhe(e,t)})).apply(this,arguments)}function Yhe(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Un(ht({},t),{onModuleLoaded:r=>i({draco:r})}))})}const SR=Un(ht({},hz),{parse:function(n,e){return xR.apply(this,arguments)}});function xR(){return(xR=ni(function*(n,e){const{draco:t}=yield qhe(e),i=new Fhe(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function x0(n,e){return yf(n>=0),yf(e>0),n+(e-1)&~(e-1)}function Zhe(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+x0(i.byteLength,4)}const Cz=["SCALAR","VEC2","VEC3","VEC4"],Jhe=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],efe=new Map(Jhe),tfe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nfe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ife={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Az(n){return Cz[n-1]||Cz[0]}function Tz(n){const e=efe.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function Mz(n,e){const t=ife[n.componentType],i=tfe[n.type],s=n.count*i,o=n.count*i*nfe[n.componentType];return La(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const rfe={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class eh{constructor(e){Wn(this,"gltf",void 0),Wn(this,"sourceBuffers",void 0),Wn(this,"byteLength",void 0),this.gltf=e||{json:ht({},rfe),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return La(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=Mz(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return La(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return La(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=tR(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;La(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=x0(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:Az(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:Tz(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Zhe(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*gfe(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function mfe(n){return TR.apply(this,arguments)}function TR(){return(TR=ni(function*(n){const e=new eh(n),{json:t}=e;e.removeExtension(yS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,yS)})).apply(this,arguments)}function _fe(n){const e=new eh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,yS,{}),e.addExtension(yS))}function yfe(n){return MR.apply(this,arguments)}function MR(){return(MR=ni(function*(n){const e=new eh(n),{json:t}=e,i=e.getExtension(Ug);i&&(e.json.lights=i.lights,e.removeExtension(Ug));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Ug);s&&(r.light=s.light),e.removeObjectExtension(r,Ug)}})).apply(this,arguments)}function vfe(n){return DR.apply(this,arguments)}function DR(){return(DR=ni(function*(n){const e=new eh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Ug);La(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Ug,i);delete e.json.lights}})).apply(this,arguments)}function bfe(n){return IR.apply(this,arguments)}function IR(){return(IR=ni(function*(n){const e=new eh(n),{json:t}=e,i=e.getExtension(vS);if(i){const r=Efe(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,vS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=Sfe(s.technique,e)),e.removeObjectExtension(s,vS)}e.removeExtension(vS)}})).apply(this,arguments)}function wfe(n,e){return RR.apply(this,arguments)}function RR(){return(RR=ni(function*(n,e){})).apply(this,arguments)}function Efe(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function Sfe(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const Rz={KHR_draco_mesh_compression:gt,KHR_materials_unlit:J,KHR_lights_punctual:At,KHR_techniques_webgl:dt};function xfe(n){return OR.apply(this,arguments)}function OR(){return(OR=ni(function*(n,e={},t){for(const r in Rz){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield Rz[r].decode(n,e,t))}})).apply(this,arguments)}const Oz={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Afe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Tfe{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new eh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,Dz);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(Dz)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in Oz)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in Oz)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=Afe[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function Mfe(n,e={}){return(new Tfe).normalize(n,e)}const Dfe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ife={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},vl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Rfe={magFilter:vl.TEXTURE_MAG_FILTER,minFilter:vl.TEXTURE_MIN_FILTER,wrapS:vl.TEXTURE_WRAP_S,wrapT:vl.TEXTURE_WRAP_T},Ofe={[vl.TEXTURE_MAG_FILTER]:vl.LINEAR,[vl.TEXTURE_MIN_FILTER]:vl.NEAREST_MIPMAP_LINEAR,[vl.TEXTURE_WRAP_S]:vl.REPEAT,[vl.TEXTURE_WRAP_]:vl.REPEAT};class Ffe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return La(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=ht({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=ht({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ht({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ht({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=ht({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ht({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ht({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return Ife[n]}(e.componentType),e.components=function(n){return Dfe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=Mz(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):Ofe,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return Rfe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function Lfe(n,e){return(new Ffe).postProcess(n,e)}const Nz=1735152710,zg=!0;function PR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),x0(i,4)}function FR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),x0(i,4)}function Kfe(n,e){return LR.apply(this,arguments)}function LR(){return(LR=ni(function*(n,e,t=0,i,r){var s,o,a,l;Yfe(n,e,t,i),Mfe(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Xfe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Qfe(n,i,r);c.push(f)}const d=xfe(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?Lfe(n,i):n})).apply(this,arguments)}function Yfe(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=Nz}=t,s=i.getUint32(e,!1);return s===r||s===Nz}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?cz(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?cz(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,zg),a=r.getUint32(t+8,zg);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){yf(n.header.byteLength>20);const i=e.getUint32(t+0,zg),r=e.getUint32(t+4,zg);return t+=8,yf(0===r),PR(n,e,t,i),(t+=i)+FR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return yf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,zg),s=e.getUint32(t+4,zg);switch(t+=8,s){case 1313821514:PR(n,e,t,r);break;case 5130562:FR(n,e,t,r);break;case 0:i.strict||PR(n,e,t,r);break;case 1:i.strict||FR(n,e,t,r)}t+=x0(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),La("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else La(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Xfe(n,e,t){return kR.apply(this,arguments)}function kR(){return(kR=ni(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield tpe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function tpe(n){return zR.apply(this,arguments)}function zR(){return(zR=ni(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const Pz=[255,255,255,255],rpe={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:Pz},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Hg]};let spe=(()=>{class n extends VI{getShaders(){const t=[VU,$U];return"pbr"===this.props._lighting&&t.push(JU),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:Pz,transition:!0},instanceModelMatrix:XU})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Bg)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new dhe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ht({gltf:l},c),function(n){return UR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Oi.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Bg?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Oi.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Oi.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Bg&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:ht({isInstanced:!0,transpileToGLSL100:!pi(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:QU(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=rpe,n})();const ope=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),ape=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),lpe=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),cpe=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),upe={POSITION:{size:3,value:new Float32Array(ape)},NORMAL:{size:3,value:new Float32Array(lpe)},TEXCOORD_0:{size:2,value:new Float32Array(cpe)}};class dpe extends hS{constructor(e={}){const{id:t=jc("cube-geometry")}=e;super(Un(ht({},e),{id:t,indices:{size:1,value:new Uint16Array(ope)},attributes:ht(ht({},upe),e.attributes)}))}}class Kc{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new le){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new le){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new le){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new le){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new le){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new le){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new le){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=fpe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=ppe;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(Fz),Fz.almostEquals(e,t)}clone(){return new le(this.x,this.y,this.z)}}le.ZERO=void 0,le.UNIT_X=void 0,le.UNIT_Y=void 0,le.UNIT_Z=void 0,le.ZERO=new le(0,0,0),le.UNIT_X=new le(1,0,0),le.UNIT_Y=new le(0,1,0),le.UNIT_Z=new le(0,0,1);const fpe=new le,ppe=new le,Fz=new le;class ar{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new le,this.upperBound=new le,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=kz;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=kz;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const Lz=new le,kz=[new le,new le,new le,new le,new le,new le,new le,new le];class ss{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new le){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=mpe;e.tangents(i,_pe),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(_r(e.length(),2)*_r(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new ss){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new ss){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new ss){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new le){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new ss(this.x,this.y,this.z,this.w)}slerp(e,t,i=new ss){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,x,A,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-t)*p)/_,A=Math.sin(t*p)/_):(x=1-t,A=t),i.x=x*r+A*l,i.y=x*s+A*c,i.z=x*o+A*d,i.w=x*a+A*f,i}integrate(e,t,i,r=new ss){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const mpe=new le,_pe=new le,ype={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let dn=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=ype,n})();class Ni{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new ss,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Ni.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Ni.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new le){return i.vsub(e,r),t.conjugate(jz),jz.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new le){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new le){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new le){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const jz=new ss;class wf extends dn{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:dn.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new le;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=x,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,d=new le,f=new le,p=new le,g=new le,_=new le;let x=Number.MAX_VALUE;const A=this;if(A.uniqueAxes)for(let W=0;W!==A.uniqueAxes.length;W++){i.vmult(A.uniqueAxes[W],c);const G=A.testSepAxis(c,e,t,i,r,s);if(!1===G)return!1;G0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){wf.project(this,e,i,r,HR),wf.project(t,e,s,o,GR);const l=HR[0],c=HR[1],d=GR[0],f=GR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?hn.STATIC:hn.DYNAMIC,typeof e.type==typeof hn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=hn.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new le,this.quaternion=new ss,this.initQuaternion=new ss,this.previousQuaternion=new ss,this.interpolatedQuaternion=new ss,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new le,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new le,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new le,this.invInertia=new le,this.invInertiaWorld=new Kc,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new Kc,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new le(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new le(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new ar,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new le,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=hn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===hn.SLEEPING&&this.dispatchEvent(hn.wakeupEvent)}sleep(){this.sleepState=hn.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=_r(this.sleepSpeedLimit,2);t===hn.AWAKE&&ir?this.wakeUp():t===hn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(hn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===hn.SLEEPING||this.type===hn.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new le){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new le){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new le,s=new ss;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=wpe,o=Epe,a=this.quaternion,l=this.aabb,c=Spe;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=xpe,r=Cpe;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==hn.DYNAMIC)return;this.sleepState===hn.SLEEPING&&this.wakeUp();const i=Ape;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==hn.DYNAMIC)return;const i=Tpe,r=Mpe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===hn.DYNAMIC&&(this.sleepState===hn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==hn.DYNAMIC)return;this.sleepState===hn.SLEEPING&&this.wakeUp();const i=t,r=Dpe;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=Ipe;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==hn.DYNAMIC)return;const i=Rpe,r=Ope;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=Npe;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),wS.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new le;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==hn.DYNAMIC&&this.type!==hn.KINEMATIC||this.sleepState===hn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,x=this.angularFactor,A=l.x*x.x,W=l.y*x.y,G=l.z*x.z;s.x+=e*(_[0]*A+_[1]*W+_[2]*G),s.y+=e*(_[3]*A+_[4]*W+_[5]*G),s.z+=e*(_[6]*A+_[7]*W+_[8]*G),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}hn.idCounter=0,hn.COLLIDE_EVENT_NAME="collide",hn.DYNAMIC=1,hn.STATIC=2,hn.KINEMATIC=4,hn.AWAKE=0,hn.SLEEPY=1,hn.SLEEPING=2,hn.wakeupEvent={type:"wakeup"},hn.sleepyEvent={type:"sleepy"},hn.sleepEvent={type:"sleep"};const wpe=new le,Epe=new ss,Spe=new ar,xpe=new Kc,Cpe=new Kc,Ape=new le,Tpe=new le,Mpe=new le,Dpe=new le,Ipe=new le,Rpe=new le,Ope=new le,Npe=new le;new le,new le;class ES{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new le,this.rayToWorld=new le,this.hitNormalWorld=new le,this.hitPointWorld=new le,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let Vz,Uz,zz,Hz,Gz,$z,Wz;Vz=dn.types.SPHERE,Uz=dn.types.PLANE,zz=dn.types.BOX,Hz=dn.types.CYLINDER,Gz=dn.types.CONVEXPOLYHEDRON,$z=dn.types.HEIGHTFIELD,Wz=dn.types.TRIMESH;class fs{get[Vz](){return this._intersectSphere}get[Uz](){return this._intersectPlane}get[zz](){return this._intersectBox}get[Hz](){return this._intersectConvex}get[Gz](){return this._intersectConvex}get[$z](){return this._intersectHeightfield}get[Wz](){return this._intersectTrimesh}constructor(e=new le,t=new le){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new le,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=fs.ANY,this.result=new ES,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||fs.ANY,this.result=t.result||new ES,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(qz),KR.length=0,e.broadphase.aabbQuery(e,qz,KR),this.intersectBodies(KR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=Vpe,s=Upe;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new le(0,0,1);t.vmult(c,c);const d=new le;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;A>=0&&A<=1&&(o.lerp(a,A,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Wpe,l=Yz,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,A=_.distanceTo(this.to),W=c?c.length:d.length,G=this.result;for(let ge=0;!G.shouldStop&&geA||this.reportIntersection(a,aa,s,r,Ne)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=qpe,l=Jpe,c=ege,d=Yz,f=Kpe,p=Ype,g=Xpe,_=Zpe,x=Qpe,A=e.indices,W=this.from,G=this.to,ge=this.direction;c.position.copy(i),c.quaternion.copy(t),Ni.vectorToLocalFrame(i,t,ge,f),Ni.pointToLocalFrame(i,t,W,p),Ni.pointToLocalFrame(i,t,G,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const Ne=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Ge=0,$e=l.length;!this.result.shouldStop&&Ge!==$e;Ge++){const at=l[Ge];e.getNormal(at,a),e.getVertex(A[3*at],ac),ac.vsub(p,d);const St=f.dot(a),Rt=a.dot(d)/St;if(Rt<0)continue;f.scale(Rt,aa),aa.vadd(p,aa),e.getVertex(A[3*at+1],Xc),e.getVertex(A[3*at+2],Qc);const Pt=aa.distanceSquared(p);!fs.pointInTriangle(aa,Xc,ac,Qc)&&!fs.pointInTriangle(aa,ac,Xc,Qc)||Pt>Ne||(Ni.vectorToWorldFrame(t,a,x),Ni.pointToWorldFrame(i,t,aa,_),this.reportIntersection(x,_,s,r,at))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case fs.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case fs.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var Af=tt(517);class Or extends ee{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new U;return this._value}next(e){super.next(this._value=e)}}function qg(n,e,t){e||(e=new $n($n.IDENTITY));const i=new $n($n.IDENTITY);if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new $n($n.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new $n(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===qg(s,r,t))return!1;return!0}function V4(){WV([hz,Hg])}function U4(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||qg(r,new $n($n.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function ZR(n,e){return ir(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield JE(i,Hg,{DracoLoader:SR,gltf:{decompressMeshes:!0,postProcess:!0}});return U4(n.scenegraphNode,r)})}function tye(n,e){return ir(this,void 0,void 0,function*(){return U4(n,yield e)})}function JR(n,e,t){if(e&&0!==e.length)return new Ide(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mi.CARTESIAN,data:e,mesh:new dpe,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let iye=(()=>{class n extends Ole{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),V4()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){ir(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new $n(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new ar({lowerBound:new le(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new le(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield eS(o.scenegraph,Hg,{DracoLoader:SR,decompress:!0,postProcess:!0});for(const l of a.scenes)qg(l,new $n(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new ar({lowerBound:new le(...p.map((_,x)=>Math.min(_,g[x]))),upperBound:new le(...g.map((_,x)=>Math.max(_,p[x])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=ZR({scenegraph:l.scenegraph},n.gltfCache));return[JR("cubes",i,{wireframe:!1,pickable:!1}),JR("pickableCubes",r,{wireframe:!1,pickable:!0}),JR("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new spe({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Mi.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?tye(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function z4(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),z4(t,e);return e}let sye=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new iye({}),this.nodeClickSubject=new ee,this.nodeHoverStartSubject=new ee,this.nodeHoverStopSubject=new ee,this.sceneRotationSubject=new Or([0,0]),this.nodeDragStartSubject=new ee,this.nodeDragSubject=new ee,this.nodeDragEndSubject=new ee,this.nodeClick$=this.nodeClickSubject.pipe(ms()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ms()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ms()),this.sceneRotation$=this.sceneRotationSubject.pipe(ms()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ms()),this.nodeDrag$=this.nodeDragSubject.pipe(ms()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ms());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Gle({flipY:!1,near:-1e3}):new qle({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new WI({ambientLight:new nU({color:[255,255,255],intensity:10})})]),this.deck=new dS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return ir(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new $n([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return ir(this,void 0,void 0,function*(){V4();const i=yield ZR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)qg(o,e=new $n(e||$n.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new $n(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new $n(e||$n.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new ar({lowerBound:new le(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new le(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of z4(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new $n($n.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new $n(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return Ia([Af.ZP],n.prototype,"_onHover",null),Ia([Af.ZP],n.prototype,"_onClick",null),Ia([Af.ZP],n.prototype,"_onViewStateChange",null),Ia([Af.ZP],n.prototype,"_onDragStart",null),Ia([Af.ZP],n.prototype,"_onDrag",null),Ia([Af.ZP],n.prototype,"_onDragEnd",null),n})();function oye(n,e){return n===e}function aye(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let eO=(()=>{class n{constructor(){this.bootstrap$=new mg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const tO=new Vt("INITIAL_STATE_TOKEN");let uye=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const G4=new Vt("Internals.StateContextFactory"),$4=new Vt("Internals.StateFactory");function O0(...n){if(1===n.length){const e=n[0];if(L(e))return RS(e,null);if(re(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return RS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return RS(n=1===n.length&&L(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return RS(n,null)}function RS(n,e){return new F(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function Ui(n,e){return function(i){return i.lift(new dye(n,e))}}class dye{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new hye(e,this.predicate,this.thisArg))}}class hye extends y{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}function ka(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new mg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const W4=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function Yi(n){return e=>0===n?mE():e.lift(new pye(n))}class pye{constructor(e){if(this.total=e,this.total<0)throw new W4}call(e,t){return t.subscribe(new gye(e,this.total))}}class gye extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function q4(n,e){return e?t=>t.pipe(q4((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new mye(n))}class mye{constructor(e){this.project=e}call(e,t){return t.subscribe(new _ye(e,this.project))}}class _ye extends fe{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new wt(this),i=this.destination;i.add(t);const r=R(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function OS(n=null){return e=>e.lift(new yye(n))}class yye{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new vye(e,this.defaultValue))}}class vye extends y{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function lc(n){return function(t){const i=new bye(n),r=t.lift(i);return i.caught=r}}class bye{constructor(e){this.selector=e}call(e,t){return t.subscribe(new wye(e,this.selector,this.caught))}}class wye extends fe{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new wt(this);this.add(i);const r=R(t,i);r!==i&&this.add(r)}}}function os(n){return e=>e.lift(new Eye(n))}class Eye{constructor(e){this.notifier=e}call(e,t){const i=new Sye(e),r=R(this.notifier,new wt(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class Sye extends fe{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function nh(){}function Zr(n,e,t){return function(r){return r.lift(new xye(n,e,t))}}class xye{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Cye(e,this.nextOrObserver,this.error,this.complete))}}class Cye extends y{constructor(e,t,i,r){super(e),this._tapNext=nh,this._tapError=nh,this._tapComplete=nh,this._tapError=i||nh,this._tapComplete=r||nh,K(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||nh,this._tapError=t.error||nh,this._tapComplete=t.complete||nh)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}function $u(n,e){return t=>t.lift(new Aye(n,e))}class Aye{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new Tye(e,this.compare,this.keySelector))}}class Tye extends y{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}const Ba={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let K4=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(n){return"server"===n}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return mn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return mn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof mn||console.warn(Ba.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(mn),Ie(Pc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Y4=new Vt("ROOT_STATE_TOKEN"),X4=new Vt("FEATURE_STATE_TOKEN"),Q4=new Vt("NGXS_PLUGINS"),Z4=new Vt("NG_TEST_MODE"),J4=new Vt("NG_DEV_MODE"),Wu="NGXS_META",e8="NGXS_OPTIONS_META";let Tf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=K4}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Mye{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const t8=new Vt("NGXS_EXECUTION_STRATEGY");function Mf(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const n8=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},NS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),iO=n=>n&&"object"==typeof n&&!Array.isArray(n),rO=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(iO(n)&&iO(t))for(const i in t)iO(t[i])?(n[i]||Object.assign(n,{[i]:{}}),rO(n[i],t[i])):Object.assign(n,{[i]:t[i]});return rO(n,...e)};function N0(n){return n[Wu]}function r8(n,e){const t=NS(e.currentAppState,n.path),i=NS(e.newAppState,n.path);return new Mye(t,i,!n.isInitialised)}function Lye(...n){return function(n,e,t=jye){const i=function(n){return n.reduce((e,t)=>(e[Mf(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Ui(t=>{const i=Mf(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function jye(){return me(n=>n.action)}function PS(n){return e=>new F(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let FS=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(t8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class zye extends ee{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let LS=(()=>{class n extends zye{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Hye=(()=>{class n extends F{constructor(t,i){super(r=>{const s=t.pipe(PS(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(Ie(LS),Ie(FS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const s8=n=>(...e)=>n.shift()(...e,(...i)=>s8(n)(...i));let kS=(()=>{class n extends Or{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),lO=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(Q4,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),cO=(()=>{class n extends ee{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),o8=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Zo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(PS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?an(this._stateStream.getValue()):O0(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!Mf(t))return gg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return s8([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(ka())}getActionResultStream(t){return this._actionResults.pipe(Ui(i=>i.action===t&&"DISPATCHED"!==i.status),Yi(1),ka())}createDispatchObservable(t){return t.pipe(q4(i=>{switch(i.status){case"SUCCESSFUL":return an(this._stateStream.getValue());case"ERRORED":return gg(i.error);default:return Lc}})).pipe(ka())}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(LS),Ie(cO),Ie(lO),Ie(kS),Ie(FS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const a8=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&a8(n[i])}),n};let l8=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(J4),Ie(Z4))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),c8=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Ba.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ba.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(l8),Ie(Tf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Yg=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=a8(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(Ie(kS),Ie(o8),Ie(Tf),Ie(c8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),BS=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return NS(l,t.path)}function s(l,c){const d=n8(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=r8(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Ba.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ba.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Yg))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class jS{static stateNameErrorMessage(e){return Ba.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ba.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Ba.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=N0(e);if(!t)throw new Error(Ba.STATE_DECORATOR());return t}}jS.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Xg=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=H4(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(jS.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[Wu].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[Wu];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[Wu].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[Wu];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>n8(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ui(t=>"DISPATCHED"===t.status),k(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),OS({action:t,status:"CANCELED"}),lc(i=>an({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=Mf(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=Pe(d)),d instanceof F?(d=d.pipe(OS({})),l.options.cancelUncompleted&&(d=d.pipe(os(t.pipe(Lye(i)))))):d=an({}).pipe(ka()),s.push(d)}catch(d){s.push(gg(d))}}}return s.length||s.push(an({})),O0(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=jS.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==NS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(Tf),Ie(n,12),Ie(LS),Ie(cO),Ie(BS),Ie(tO,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),uO=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ui(()=>!!i),Zr(()=>this.invokeInit(i.states)),k(()=>this.bootstrapper.appBootstrapped$),Ui(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=r8(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Yg),Ie(BS),Ie(eO))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();let ih=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(me(i),lc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?an(void 0):gg(r)}),$u(),PS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Yi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(PS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=function(n){return n.NGXS_SELECTOR_META}(n)||N0(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(kS),Ie(Yg),Ie(Tf),Ie(FS),Ie(Xg),Ie(tO,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),P0=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(Tf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class Xye{static get type(){return"@@INIT"}}class Qye{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const US=new mg(1);let FO,Jye=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Da();US.next(t)}catch(n){US.next(!1)}finally{US.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new Xye,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Xg),Ie(Yg),Ie(ih),Ie(P0),Ie(Y4,8),Ie(uO))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})(),e0e=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new Qye(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(Yg),Ie(Xg),Ie(X4,8),Ie(uO))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();class la{static forRoot(e=[],t={}){return{ngModule:Jye,providers:[Xg,BS,Hye,LS,eO,c8,l8,uO,o8,cO,Yg,FS,ih,kS,P0,lO,...e,...la.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:e0e,providers:[Xg,lO,...e,{provide:X4,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:Z4,useValue:cye},{provide:J4,useValue:Da},{provide:t8,useClass:t.executionStrategy||K4},{provide:Y4,useValue:e},{provide:la.ROOT_OPTIONS,useValue:t},{provide:Tf,useFactory:la.ngxsConfigFactory,deps:[la.ROOT_OPTIONS]},{provide:Bw,useFactory:la.appBootstrapListenerFactory,multi:!0,deps:[eO]},{provide:tO,useFactory:la.getInitialState},{provide:G4,useExisting:BS},{provide:$4,useExisting:Xg}]}static ngxsConfigFactory(e){return rO(new Tf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return uye.pop()}}function n0e(n){return i=>{!function(n){US.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ba.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(Wu)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,Wu,{value:e})}return N0(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[e8]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;jS.checkCorrectStateName(d),s.hasOwnProperty(Wu)&&(r.actions=Object.assign({},r.actions,(s[Wu]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[e8]=a}}la.\u0275fac=function(e){return new(e||la)},la.\u0275mod=gn({type:la}),la.\u0275inj=Et({}),la.ROOT_OPTIONS=new Vt("ROOT_OPTIONS"),new Jl(gE);try{FO="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){FO=!1}"undefined"!=typeof Element&∈function YH(n){Promise.resolve(null).then(n)}class nm{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){YH(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function QH(){return"undefined"!=typeof window&&void 0!==window.document}function UO(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let $O=(n,e)=>!1,WO=(n,e)=>!1,e5=(n,e,t)=>[];const t5=UO();(t5||"undefined"!=typeof Element)&&($O=QH()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),WO=(()=>{if(t5||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):WO}})(),e5=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return qO(t)}matchesElement(t,i){return KO(t,i)}containsElement(t,i){return YO(t,i)}query(t,i,r){return XO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new nm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ox{}ox.NOOP=new r5;function l5(n,e,t){return t?e+":"+t+";":""}function c5(n){let e="";for(let t=0;t{const r=tN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),UO()&&c5(n))}function Pf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=tN(t);n.style[i]=""}),UO()&&c5(n))}const ebe=/-+([a-z0-9])/g;function tN(n){return n.replace(ebe,(...e)=>e[1].toUpperCase())}function tbe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class sm{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=sm.initialStylesByElement.get(e);r||sm.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&eu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(eu(this._element,this._initialStyles),this._endStyles&&(eu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(sm.initialStylesByElement.delete(this._element),this._startStyles&&(Pf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Pf(this._element,this._endStyles),this._endStyles=null),eu(this._element,this._initialStyles),this._state=3)}}sm.initialStylesByElement=new WeakMap;let Lf;try{Lf="undefined"!=typeof Intl}catch(n){Lf=!1}new class extends Jl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let tEe=1;const nEe=Promise.resolve(),Mx={};function o6(n){return n in Mx&&(delete Mx[n],!0)}const a6={setImmediate(n){const e=tEe++;return Mx[e]=!0,nEe.then(()=>o6(e)&&n()),e},clearImmediate(n){o6(n)}};new class extends Jl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=a6.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(a6.clearImmediate(t),e.scheduled=void 0)}});function X0(n){return!!n&&(n instanceof F||"function"==typeof n.lift&&"function"==typeof n.subscribe)}function Ix(...n){return It(1)(an(...n))}function Vo(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>Ix(n,t,e)):t=>Ix(n,t)}function V6(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>me(function(n,e){return i=>{let r=i;for(let s=0;s{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&qx(n[o])}),n};function kG(n){return Ha(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const VG="NGXS_DATA_META",GN="NGXS_META",UG="NGXS_ARGUMENT_REGISTRY_META";let zG=(()=>{class n{constructor(t){this.sequence$=new Or(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function nv(n){return n[VG]}let Ga=(()=>{class n{constructor(t,i,r){n.store=t.get(ih),n.ngZone=t.get(mn),n.factory=i,n.context=r,n.computed=t.get(zG)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie($4),Ie(G4))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ls{constructor(){ls.statesCachedMeta.clear()}static createStateContext(e){return Ga.context.createStateContext(e)}static ensureMappedState(e){if(za(Ga.factory)||za(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(Ha(e.name)?ls.statesCachedMeta.get(e.name):null)||ls.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=nv(ls.getStateClassByInstance(e)))&&void 0!==t?t:null;if(za(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=ls.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=ls.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=Ha(e.name)?null===(t=Ga.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Ha(i)&&Ha(e.name)&&ls.statesCachedMeta.set(e.name,i),i}}ls.statesCachedMeta=new Map,ls.\u0275fac=function(e){return new(e||ls)},ls.\u0275prov=We({token:ls,factory:ls.\u0275fac}),new mg(1);class ACe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Ha(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function HG(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function GG(n){var e;const t=HG(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=LG(void 0===t.defaults?{}:t.defaults);if(i.length){if(kG(s))return function(n,e){return e.reduce((t,i)=>{const r=HG(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=GG(i),t},null!=n?n:{})}(s,i);throw new ACe(s)}return s}function WG(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function qG(){var n,e;return null!==(e=null===(n=null==Ga?void 0:Ga.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function ICe(n){let e=!1;return X0(n)&&(e=!0),e}function $N(n){return n[UG]}class RCe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class OCe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(zN(this.argumentMap.has(e))||zN(this.payloadMap.has(e)))throw new RCe(e,t)}}function BCe(n){return{enumerable:!0,configurable:!0,get(){const e=nv(n),t=ls.ensureMappedState(e.stateMeta);return ls.createStateContext(t)}}}function KG(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(kG(i))for(;null!==i;){if(tv(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return za(WG(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),WG(n)}(this),o=null==s?void 0:s.get(i);if(tv(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(za(o)||o.sequenceId!==qG()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:qG(),isObservable:ICe(l)}),l}return o.value},t}}const GCe={cancelUncompleted:!0,insideZone:!1};function WN(n=GCe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=ls.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=$N(r);if(za(f)){const G=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),ge=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var G;return tv(n.insideZone)?null===(G=Ga.ngZone)||void 0===G||G.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),X0(l)?an(null).pipe(me(()=>l)):l};const A=ls.createAction(f,o,g),W=Ga.store.dispatch(A);return X0(l)?function(n,e){return O0([n,e]).pipe(me(t=>t.pop()))}(W,l):l},i}}function YG(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return za($N(t))&&Object.defineProperties(t,{[UG]:{enumerable:!0,configurable:!0,value:new OCe}}),$N(t)})(e,t).createPayloadType(r,t,i)}}function WCe(){return n=>{const e=function(n){if(function(n){return!zN(n)}(n.hasOwnProperty(GN))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,GN,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[GN]}(n)}(n);if(za(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=nv(n))&&void 0!==e?e:null;return(za(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,VG,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),nv(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>LG(t)},context:BCe(n)})}(n,e,GG(n)),function(n){var e,t;const i=nv(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(Ha(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Ha(this[s]))return this[s];if(za(Ga.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ga.store.select(n).pipe(me(o=>Da()?qx(o):o),ka({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let KCe=(()=>{class n{constructor(){this.browserStorageEvents$=new ee,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),YCe=(()=>{class n extends KCe{get snapshot(){return function(n){return Da()?qx(n):n}(this.getState())}get ctx(){return function(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>Da()?qx(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ia([KG(),ec("design:type",Object),ec("design:paramtypes",[])],n.prototype,"snapshot",null),Ia([WN(),z3(0,YG("patchValue")),ec("design:type",Function),ec("design:paramtypes",[Object]),ec("design:returntype",void 0)],n.prototype,"patchState",null),Ia([WN(),z3(0,YG("stateValue")),ec("design:type",Function),ec("design:paramtypes",[Object]),ec("design:returntype",void 0)],n.prototype,"setState",null),Ia([WN(),ec("design:type",Function),ec("design:paramtypes",[]),ec("design:returntype",void 0)],n.prototype,"reset",null),n})();new Vt("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})});const mP=new Vt("ngx-window",{providedIn:"root",factory:()=>function(n){return function(n){return n===x3}(n)?window:null}(xc(Pc))}),_Me=new Vt("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(xc(mP))});new Vt("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(xc(mP),xc(_Me))}),new Vt("ngx-google-analytics-routing-settings",{factory:()=>({})}),new Vt("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"});const DMe=["bodyCanvas"];let IMe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new cn,this.nodeDrag=new cn,this.nodeClick=new cn,this.nodeHoverStart=new cn,this.nodeHoverStop=new cn,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return ir(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new sye({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=wn({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Ms(DMe,5,An),2&t){let r;Ai(r=Ti())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&xu(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&function(n,e,t,i){Kt(n,e,t,i),Yt()}(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),RMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({imports:[[Ws]]}),n})();new Vt("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10}),[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].filter(n=>!0!==n.disabled);let hv=(()=>{let n=class extends YCe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ui(n=>null!=n),ka(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(V6(...t),$u(),ka(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(V6(...t),$u(),ka(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=tr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ia([KG()],n.prototype,"config$",null),n=Ia([WCe(),n0e({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();const l7="http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity",aDe=[173,255,47,229.5];var Qn=tt(440),hDe=tt(698),fDe=tt(445),pDe=tt.n(fDe),En=tt(815),$a=tt(609);const Hi=Qn.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},Qn.DataFactory),ym=(Hi("rdf"),Hi("rdf")("type"),{x:Hi("rdfs"),label:Hi("rdfs")("label"),comment:Hi("rdfs")("comment"),isDefinedBy:Hi("rdfs")("isDefinedBy"),seeAlso:Hi("rdfs")("seeAlso")}),Os={x:Hi("entity"),id:Hi("entity")("id"),label:ym.label,description:ym.comment,link:ym.seeAlso,sex:Hi("entity")("sex"),age:Hi("entity")("age"),bmi:Hi("entity")("bmi"),Male:Qn.DataFactory.literal("Male"),Female:Qn.DataFactory.literal("Female"),consortiumName:Hi("entity")("consortium_name"),providerName:Hi("entity")("provider_name"),providerUUID:Hi("entity")("provider_uuid"),donor:Hi("entity")("has_donor"),sections:Hi("entity")("has_tissue_section"),datasets:Hi("entity")("has_dataset"),sampleType:Hi("entity")("sample_type"),TissueBlock:Qn.DataFactory.literal("Tissue Block"),TissueSection:Qn.DataFactory.literal("Tissue Section"),NonStandard:Qn.DataFactory.literal("Non-standard"),sectionCount:Hi("entity")("section_count"),sectionSize:Hi("entity")("section_size"),sectionUnits:Hi("entity")("section_units"),sectionNumber:Hi("entity")("section_number"),spatialEntity:Hi("entity")("has_spatial_entity"),ontologyTerms:Hi("entity")("has_ontology_term"),technology:Hi("entity")("technology"),thumbnail:Hi("entity")("has_thumbnail")},In=Hi("ccf"),dc={x:In,ontologyNode:{label:In("ccf_preferred_label"),parent:In("ccf_part_of"),children:In("ccf_part_of"),rui_rank:In("ccf_rui_rank"),synonymLabels:Qn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:In("VHFemale"),Male:In("VHMale"),BothSexes:In("VHBothSexes"),FemaleOrgans:In("VHFemaleOrgans"),MaleOrgans:In("VHMaleOrgans")},SpatialObjectReference:In("SpatialObjectReference"),SpatialEntity:In("SpatialEntity"),SpatialPlacement:In("SpatialPlacement"),spatialObjectReference:{file:In("has_object_file"),file_format:In("has_object_file_format"),file_subpath:In("has_object_file_subpath")},extractionSet:{label:ym.label,rui_rank:In("ccf_rui_rank")},spatialEntity:{label:ym.label,comment:ym.comment,creator:Hi("dc")("creator"),creator_first_name:In("creator_first_name"),creator_last_name:In("creator_last_name"),creator_orcid:In("creator_orcid"),creation_date:In("creation_date"),updated_date:In("updated_date"),ccf_annotations:In("ccf_annotation"),representation_of:In("ccf_representation_of"),reference_organ:In("anatomical_structure_of"),extraction_set_for:In("extraction_set_for"),extraction_set:In("extraction_site_for"),sex:In("has_sex"),side:In("has_side"),rui_rank:In("ccf_rui_rank"),slice_thickness:In("ccf_slice_thickness"),slice_count:In("ccf_slice_count"),x_dimension:In("has_x_dimension"),y_dimension:In("has_y_dimension"),z_dimension:In("has_z_dimension"),dimension_units:In("has_dimension_units"),object:In("has_object_reference")},spatialPlacement:{source:In("has_placement_source"),target:In("has_placement_target"),placement_date:In("has_placement_date"),x_scaling:In("has_x_scaling"),y_scaling:In("has_y_scaling"),z_scaling:In("has_z_scaling"),scaling_units:In("has_scaling_units"),x_rotation:In("has_x_rotation"),y_rotation:In("has_y_rotation"),z_rotation:In("has_z_rotation"),w_rotation:In("has_theta_rotation"),rotation_order:In("has_rotation_order"),rotation_units:In("has_rotation_units"),x_translation:In("has_x_translation"),y_translation:In("has_y_translation"),z_translation:In("has_z_translation"),translation_units:In("has_translation_units")}},Tr={x:Hi("uberon")},mDe=(Hi("lmha"),{bladder:Tr.x("0001255"),body:Tr.x("0013702"),brain:Tr.x("0000955"),colon:Tr.x("0001155"),heart:Tr.x("0000948"),kidney:Tr.x("0002113"),large_intestine:Tr.x("0000059"),left_kidney:Tr.x("0004538"),left_lung:Tr.x("0002168"),left_ureter:Tr.x("0001223"),liver:Tr.x("0002107"),lung:Tr.x("0002048"),respiratory_system:Tr.x("0001004"),lymph_node:Tr.x("0000029"),pelvis:Tr.x("0001270"),rectum:Tr.x("0001052"),right_kidney:Tr.x("0004539"),right_lung:Tr.x("0002167"),right_ureter:Tr.x("0001222"),skin:Tr.x("0002097"),small_intestine:Tr.x("0002108"),spleen:Tr.x("0002106"),thymus:Tr.x("0002370"),ureter:Tr.x("0000056"),vasculature:Tr.x("0002049")});function vP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const f1={spatialObjectReference:vP(dc.spatialObjectReference),spatialEntity:vP(dc.spatialEntity),spatialPlacement:vP(dc.spatialPlacement)};function p1(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,$a.fromRdf)(s.object):s.object.id;(0,En.set)(r,o,a)}return!1},Qn.DataFactory.namedNode(e),null,null,null),r}const yDe=(0,En.memoize)(function(n,e){return p1(n,e,"SpatialObjectReference",f1.spatialObjectReference)},(n,e)=>e),bDe=(0,En.memoize)(function(n,e){const t=p1(n,e,"ExtractionSet",f1.spatialEntity);return t.extractionSites=(0,En.sortBy)(n.getSubjects(dc.spatialEntity.extraction_set,e,null).map(i=>vm(n,i.id)),["rui_rank"]),t},(n,e)=>e);(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(dc.spatialEntity.extraction_set_for,e,null).map(t=>bDe(n,t.id)),["rui_rank"])},(n,e)=>e),(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(dc.spatialEntity.reference_organ,e,null).map(t=>vm(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),(0,En.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(vm(n,t.subject.id))},null,dc.spatialEntity.reference_organ,null,null),(0,En.sortBy)(e,["rui_rank"])});const vm=(0,En.memoize)(function(n,e){const t=p1(n,e,"SpatialEntity",f1.spatialEntity);return t.object&&(t.object=yDe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,dc.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,Os.spatialEntity,e,null),t},(n,e)=>e);(0,En.memoize)(function(n,e){const t=p1(n,e,"SpatialPlacement",f1.spatialPlacement);return t.source&&(t.source=vm(n,t.source)),t.target&&(t.target=vm(n,t.target)),t},(n,e)=>e),(0,En.memoize)(function(n,e){const t=n.getObjects(Qn.DataFactory.namedNode(e),Os.spatialEntity,null);if(t.length>0)return vm(n,t[0].id)},(n,e)=>e),new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),function(){const n={};Object.entries(mDe).forEach(([e,t])=>n[e]=t.id)}();const y1={[Os.label.id]:"label",[Os.description.id]:"description",[Os.link.id]:"link"},WDe=Object.assign(Object.assign({},y1),{[Os.providerName.id]:"providerName"}),qDe=Object.assign(Object.assign({},y1),{[Os.technology.id]:"technology",[Os.thumbnail.id]:"thumbnail"}),KDe=Object.assign(Object.assign({},y1),{[Os.sampleType.id]:"sampleType",[Os.sectionNumber.id]:"sectionNumber",[Os.datasets.id]:"datasets"}),YDe=Object.assign(Object.assign({},y1),{[Os.sampleType.id]:"sampleType",[Os.sectionCount.id]:"sectionCount",[Os.sectionSize.id]:"sectionSize",[Os.sectionUnits.id]:"sectionUnits",[Os.donor.id]:"donor",[Os.spatialEntity.id]:"spatialEntityId",[Os.sections.id]:"sections",[Os.datasets.id]:"datasets"}),QDe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=WDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function d7(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=qDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t}(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=YDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=KDe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=d7(n,s);t[r].push(o)}else(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=d7(n,s);t[r].push(o)}else"donor"===r?t[r]=QDe(n,s):(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);const h7={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};function ru(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let bP;function hc(){return bP||(bP=function(n,e){const t=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const i=()=>indexedDB.databases().finally(t);e=setInterval(i,100),i()}).finally(()=>clearInterval(e))}().then(()=>{const i=indexedDB.open("keyval-store");return i.onupgradeneeded=()=>i.result.createObjectStore(e),ru(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),bP}function f7(n,e=hc()){return e("readonly",t=>ru(t.get(n)))}const Gi=Qn.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},Qn.DataFactory),p7={x:Gi("rdf"),type:Gi("rdf")("type")},bm={x:Gi("rdfs"),label:Gi("rdfs")("label"),comment:Gi("rdfs")("comment"),isDefinedBy:Gi("rdfs")("isDefinedBy"),seeAlso:Gi("rdfs")("seeAlso")},gi={x:Gi("entity"),id:Gi("entity")("id"),label:bm.label,description:bm.comment,link:bm.seeAlso,sex:Gi("entity")("sex"),age:Gi("entity")("age"),bmi:Gi("entity")("bmi"),Male:Qn.DataFactory.literal("Male"),Female:Qn.DataFactory.literal("Female"),consortiumName:Gi("entity")("consortium_name"),providerName:Gi("entity")("provider_name"),providerUUID:Gi("entity")("provider_uuid"),donor:Gi("entity")("has_donor"),sections:Gi("entity")("has_tissue_section"),datasets:Gi("entity")("has_dataset"),sampleType:Gi("entity")("sample_type"),TissueBlock:Qn.DataFactory.literal("Tissue Block"),TissueSection:Qn.DataFactory.literal("Tissue Section"),NonStandard:Qn.DataFactory.literal("Non-standard"),sectionCount:Gi("entity")("section_count"),sectionSize:Gi("entity")("section_size"),sectionUnits:Gi("entity")("section_units"),sectionNumber:Gi("entity")("section_number"),spatialEntity:Gi("entity")("has_spatial_entity"),ontologyTerms:Gi("entity")("has_ontology_term"),technology:Gi("entity")("technology"),thumbnail:Gi("entity")("has_thumbnail")},Rn=Gi("ccf"),lr={x:Rn,ontologyNode:{label:Rn("ccf_preferred_label"),parent:Rn("ccf_part_of"),children:Rn("ccf_part_of"),rui_rank:Rn("ccf_rui_rank"),synonymLabels:Qn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:Rn("VHFemale"),Male:Rn("VHMale"),BothSexes:Rn("VHBothSexes"),FemaleOrgans:Rn("VHFemaleOrgans"),MaleOrgans:Rn("VHMaleOrgans")},SpatialObjectReference:Rn("SpatialObjectReference"),SpatialEntity:Rn("SpatialEntity"),SpatialPlacement:Rn("SpatialPlacement"),spatialObjectReference:{file:Rn("has_object_file"),file_format:Rn("has_object_file_format"),file_subpath:Rn("has_object_file_subpath")},extractionSet:{label:bm.label,rui_rank:Rn("ccf_rui_rank")},spatialEntity:{label:bm.label,comment:bm.comment,creator:Gi("dc")("creator"),creator_first_name:Rn("creator_first_name"),creator_last_name:Rn("creator_last_name"),creator_orcid:Rn("creator_orcid"),creation_date:Rn("creation_date"),updated_date:Rn("updated_date"),ccf_annotations:Rn("ccf_annotation"),representation_of:Rn("ccf_representation_of"),reference_organ:Rn("anatomical_structure_of"),extraction_set_for:Rn("extraction_set_for"),extraction_set:Rn("extraction_site_for"),sex:Rn("has_sex"),side:Rn("has_side"),rui_rank:Rn("ccf_rui_rank"),slice_thickness:Rn("ccf_slice_thickness"),slice_count:Rn("ccf_slice_count"),x_dimension:Rn("has_x_dimension"),y_dimension:Rn("has_y_dimension"),z_dimension:Rn("has_z_dimension"),dimension_units:Rn("has_dimension_units"),object:Rn("has_object_reference")},spatialPlacement:{source:Rn("has_placement_source"),target:Rn("has_placement_target"),placement_date:Rn("has_placement_date"),x_scaling:Rn("has_x_scaling"),y_scaling:Rn("has_y_scaling"),z_scaling:Rn("has_z_scaling"),scaling_units:Rn("has_scaling_units"),x_rotation:Rn("has_x_rotation"),y_rotation:Rn("has_y_rotation"),z_rotation:Rn("has_z_rotation"),w_rotation:Rn("has_theta_rotation"),rotation_order:Rn("has_rotation_order"),rotation_units:Rn("has_rotation_units"),x_translation:Rn("has_x_translation"),y_translation:Rn("has_y_translation"),z_translation:Rn("has_z_translation"),translation_units:Rn("has_translation_units")}},Mr={x:Gi("uberon")},g7=(Gi("lmha"),{bladder:Mr.x("0001255"),body:Mr.x("0013702"),brain:Mr.x("0000955"),colon:Mr.x("0001155"),heart:Mr.x("0000948"),kidney:Mr.x("0002113"),large_intestine:Mr.x("0000059"),left_kidney:Mr.x("0004538"),left_lung:Mr.x("0002168"),left_ureter:Mr.x("0001223"),liver:Mr.x("0002107"),lung:Mr.x("0002048"),respiratory_system:Mr.x("0001004"),lymph_node:Mr.x("0000029"),pelvis:Mr.x("0001270"),rectum:Mr.x("0001052"),right_kidney:Mr.x("0004539"),right_lung:Mr.x("0002167"),right_ureter:Mr.x("0001222"),skin:Mr.x("0002097"),small_intestine:Mr.x("0002108"),spleen:Mr.x("0002106"),thymus:Mr.x("0002370"),ureter:Mr.x("0000056"),vasculature:Mr.x("0002049")});function EP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const v1={spatialObjectReference:EP(lr.spatialObjectReference),spatialEntity:EP(lr.spatialEntity),spatialPlacement:EP(lr.spatialPlacement)};function b1(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,$a.fromRdf)(s.object):s.object.id;(0,En.set)(r,o,a)}return!1},Qn.DataFactory.namedNode(e),null,null,null),r}const aIe=(0,En.memoize)(function(n,e){return b1(n,e,"SpatialObjectReference",v1.spatialObjectReference)},(n,e)=>e),m7=(0,En.memoize)(function(n,e){const t=b1(n,e,"ExtractionSet",v1.spatialEntity);return t.extractionSites=(0,En.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set,e,null).map(i=>$f(n,i.id)),["rui_rank"]),t},(n,e)=>e),uIe=(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set_for,e,null).map(t=>m7(n,t.id)),["rui_rank"])},(n,e)=>e),hIe=(0,En.memoize)(function(n,e){return(0,En.sortBy)(n.getSubjects(lr.spatialEntity.reference_organ,e,null).map(t=>$f(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),pIe=(0,En.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push($f(n,t.subject.id))},null,lr.spatialEntity.reference_organ,null,null),(0,En.sortBy)(e,["rui_rank"])}),$f=(0,En.memoize)(function(n,e){const t=b1(n,e,"SpatialEntity",v1.spatialEntity);return t.object&&(t.object=aIe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,lr.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,gi.spatialEntity,e,null),t},(n,e)=>e),_Ie=(0,En.memoize)(function(n,e){const t=b1(n,e,"SpatialPlacement",v1.spatialPlacement);return t.source&&(t.source=$f(n,t.source)),t.target&&(t.target=$f(n,t.target)),t},(n,e)=>e),vIe=(0,En.memoize)(function(n,e){const t=n.getObjects(Qn.DataFactory.namedNode(e),gi.spatialEntity,null);if(t.length>0)return $f(n,t[0].id)},(n,e)=>e);function bIe(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(kB),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class _7{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new hDe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},p7.type,lr.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},p7.type,lr.SpatialEntity,null);const t={};e.some(i=>(t[i.subject.id]=i.object.id,!1),null,lr.spatialPlacement.source,null,null),e.some(i=>{const r=t[i.subject.id];return r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement"),!1},null,lr.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,i,r){this.graph.mergeDirectedEdge(t,i,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new $n($n.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new $n($n.IDENTITY),s=pDe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s){if(o){const l=this.graph.getEdgeAttribute(a,o,"id");bIe(r,_Ie(i,l))}o=a}return r}}}class y7{constructor(e){this.db=e}getSpatialEntity(e){return $f(this.db.store,e)}getExtractionSets(e){return uIe(this.db.store,e)}getExtractionSet(e){return m7(this.db.store,e)}getAnatomicalStructures(e){return hIe(this.db.store,e)}getReferenceOrgans(){return pIe(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=lr.spatial.Male.id;break;case"Female":t=lr.spatial.Female.id;break;case"Both":default:t=lr.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(i=>"Male"===i.sex);break;case"Female":t=t.filter(i=>"Female"===i.sex)}return(null==e?void 0:e.debug)&&(t=t.map(i=>[[i],this.getAnatomicalStructures(i["@id"])]).reduce((i,[r,s])=>i.concat(s.length>0?s:r),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let i=[...this.getReferenceOrganSets(e).map(r=>{const s="http://purl.obolibrary.org/obo/UBERON_0002097"===r.representation_of;return this.getSceneNode(r,t,{color:[255,255,255,255],opacity:s?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!s})})];return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(lr.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(r=>void 0!==r)}getReferenceOrganScene(e,t){var i,r;const s=null!==(i=void 0!==(null==t?void 0:t.sex))&&void 0!==i&&i,o=this.getReferenceOrgans().filter(a=>a.representation_of===e&&(!s||a.sex===(null==t?void 0:t.sex)));if(o.length>0){const a=o[0],c=this.getSceneNode(a,a,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===a.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),d=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(f=>this.getSceneNode(f,a,{color:[255,255,255,229.5]}));return[c].concat(d).filter(f=>void 0!==f)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(i=>this.getSceneNode(i,t,{color:[255,255,255,229.5]})).filter(i=>void 0!==i)}getSceneNode(e,t,i={}){var r,s,o,a;const l=null===(s=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===s?void 0:s.startsWith("model/gltf");let d=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(d){if(l)d=new $n($n.IDENTITY).rotateX(kB(90)).multiplyLeft(d);else{let f;switch(e.dimension_units){case"centimeter":f=.01;break;case"millimeter":f=.001;break;case"meter":default:f=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*f/2);d.scale(p)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:l?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:l?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:d,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const w1="https://entity.api.hubmapconsortium.org/entities/",v7=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),wIe={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},E1={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},xi=function(){const n={};return Object.entries(g7).forEach(([e,t])=>n[e]=t.id),n}(),SIe={BL:[xi.body,xi.bladder],RK:[xi.body,xi.kidney,xi.right_kidney],LK:[xi.body,xi.kidney,xi.left_kidney],HT:[xi.body,xi.heart],LI:[xi.body,xi.large_intestine,xi.colon],SI:[xi.body,xi.small_instestine],LL:[xi.body,xi.respiratory_system,xi.lung,xi.left_lung],RL:[xi.body,xi.respiratory_system,xi.lung,xi.right_lung],LY:[xi.body,xi.lymph_node],SP:[xi.body,xi.spleen],TH:[xi.body,xi.thymus],UR:[xi.body,xi.ureter],LV:[xi.body,xi.liver],OT:[xi.body]},b7={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class AIe{constructor(e,t="",i="",r){var s,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const c=this.data.descendants||[],d=(this.data.ancestors||[]).find($e=>"Donor"===$e.entity_type);this.donor=this.getDonor(d,i);const f=this.getRuiLocation(e,this.donor);f?this.rui_location=f:this.bad=!0;const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=E1[e.group_uuid]||e.group_name,_=e.created_by_user_displayname;this["@id"]=w1+e.uuid,this.label=`Registered ${p}, ${_}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const x={},A=[];this.sections=A;const W=[];this.datasets=W;for(const $e of c.filter(at=>"Sample"===at.entity_type)){const at=this.getSection($e,e,i);x[$e.submission_id]=at,A.push(at),at.section_number=null!==(s=at.section_number)&&void 0!==s?s:A.length}for(const $e of c)if("Dataset"===$e.entity_type){const at=this.getDataset($e,t,i,r),St=(0,En.get)($e,["ingest_metadata","metadata","tissue_id"]);x[St]?null===(o=x[St].datasets)||void 0===o||o.push(at):W.push(at)}const G=null!=f?f:{},ge=`${G.x_dimension} x ${G.y_dimension} x ${G.z_dimension} ${G.dimension_units}`;this.section_count=G.slice_count||A.length;const Ne=parseFloat((G.slice_thickness||(G.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ne;const Ge=G.dimension_units||"millimeter";this.section_units=Ge,this.description=`${ge}, ${Ne} ${Ge}, ${e.specimen_type}, ${this.section_count} Sections`,A.forEach(($e,at)=>{$e.description=`${G.x_dimension} x ${G.y_dimension} x ${Ne} ${Ge}, ${Ne} ${Ge}, ${$e.description}`,$e.section_number=at+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":w1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${E1[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${i}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",i="",r){var s;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=E1[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,En.get)(e,["ingest_metadata","metadata","assay_type"],"")],d=c.join("|").toLowerCase();let f,p="assets/icons/ico-unknown.svg";return-1!==d.indexOf("10x")?(f="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==d.indexOf("af")?(f="AF",p="assets/icons/ico-spatial-af.svg"):-1!==d.indexOf("codex")?(f="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==d.indexOf("imc")?(f="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==d.indexOf("lc")&&-1===d.indexOf("af")?(f="LC",p="assets/icons/ico-bulk-lc.svg"):f=-1!==d.indexOf("maldi")?"MALDI":-1!==d.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":w1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:f,thumbnail:p}}getDatasetThumbnail(e,t,i){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(i?`?token=${i}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,En.get)(e,"metadata.files",[]).filter(s=>/\.(ome\.tif|ome\.tiff)$/.test(s.rel_path)).filter(s=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(s.rel_path)).filter(s=>v7.has(s.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(s=>`${t}/${e.uuid}/${s.rel_path}`+(i?`?token=${i}`:""));if(r.length>0){const s=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(v7.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=wIe[e.hubmap_id];if(r)return`assets/thumbnails/TMC-Florida/${r}`}}getDonor(e,t){const i=(e.description||"").toLowerCase();let r;i.includes("female")?r="Female":i.includes("male")&&(r="Male");const s=i.match(/age ([0-9]+)/);let o,a;s&&(o=(0,En.toNumber)(s[1]));for(const p of(0,En.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===p.preferred_term||"Female"===p.preferred_term?r="Female":"Masculine gender"===p.preferred_term||"Male"===p.preferred_term?r="Male":"Current chronological age"===p.preferred_term||"Age"===p.preferred_term?o=(0,En.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,En.toNumber)(p.data_value));let l="";r&&o&&(l+=`${r}, Age ${o}`,a&&(l+=`, BMI ${a.toFixed(1)}`));const c=new Date(e.last_modified_timestamp).toLocaleDateString(),d=E1[e.group_uuid]||e.group_name;return{"@id":w1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${d}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;const s=(e.ancestors||[]).find(c=>"Sample"===c.entity_type&&"organ"===c.specimen_type),o=SIe[null==s?void 0:s.organ]||[xi.body];let a,l=e.rui_location;if(l&&("string"==typeof l&&(l=JSON.parse(l)),l.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):l["@id"]&&(a=l)),a){a.ccf_annotations=o.concat(a.ccf_annotations||[]);const c=null!==(i=(0,En.get)(a,["placement","target"]))&&void 0!==i?i:"";c.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,En.set)(a,["placement","target"],c.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===c||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===c)&&(0,En.set)(a,["placement","target"],"Male"===t.sex?c.replace("#VH","#VHM")+"_Patch":c.replace("#VH","#VHF")+"_Patch")}return a}getTissueBlock(){return(0,En.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function w7(n,e,t,i,r="",s=""){return ir(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(n).then(a=>a.ok?a.json():void 0).catch(()=>{});else if("search-api"===e){const a={"Content-type":"application/json"};i&&i.length>0&&(a.Authorization=`Bearer ${i}`),o=yield fetch(n,{method:"POST",headers:a,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:{exists:{field:"rui_location"}}})}).then(l=>l.ok?l.json():void 0).catch(()=>{})}if(o)return function(n,e="",t="",i,r=!1){const o={},a=(0,En.get)(n,"hits.hits",[]).map(c=>(0,En.get)(c,"_source",{})).map(c=>new AIe(c,e,t,i).toJsonLd());for(const c of a){const d=c["@id"];o[d]?o[d].samples.push(c.samples[0]):o[d]=c}const l=Object.values(o);return r&&(function(n){let e=[],t=0;for(const i of n.filter(r=>r.samples.length>1)){const r=i.samples;for(let s=0;sc["@id"]===o)&&(r[s].deleteMe=!0,t++)}i.samples=r.filter(s=>!0!==s.deleteMe)}t>0&&console.log(`\u26a0 ${t} sections identified as blocks`)}(l),console.log(l.map(c=>Object.assign({"@context":b7},c)))),{"@context":b7,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function S1(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.donor,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}function pv(n,e){return t=>n.has(t.id)?e.add(t.id):void 0}const zIe={[lr.ontologyNode.label.id]:"label",[lr.ontologyNode.parent.id]:"parent",[lr.ontologyNode.synonymLabels.id]:"synonymLabels"};function HIe(n,e){const t=Qn.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return n.some(r=>{const s=zIe[r.predicate.id];if(s){const o="Literal"===r.object.termType?(0,$a.fromRdf)(r.object):r.object.id;"synonymLabels"===s?i.synonymLabels.push(o):(0,En.set)(i,s,o)}return!1},t,null,null,null),i.children=n.getSubjects(lr.ontologyNode.children,t,null).map(r=>r.id),i}const x1={[gi.label.id]:"label",[gi.description.id]:"description",[gi.link.id]:"link"},$Ie=Object.assign(Object.assign({},x1),{[gi.providerName.id]:"providerName"}),WIe=Object.assign(Object.assign({},x1),{[gi.technology.id]:"technology",[gi.thumbnail.id]:"thumbnail"}),qIe=Object.assign(Object.assign({},x1),{[gi.sampleType.id]:"sampleType",[gi.sectionNumber.id]:"sectionNumber",[gi.datasets.id]:"datasets"}),KIe=Object.assign(Object.assign({},x1),{[gi.sampleType.id]:"sampleType",[gi.sectionCount.id]:"sectionCount",[gi.sectionSize.id]:"sectionSize",[gi.sectionUnits.id]:"sectionUnits",[gi.donor.id]:"donor",[gi.spatialEntity.id]:"spatialEntityId",[gi.sections.id]:"sections",[gi.datasets.id]:"datasets"}),XIe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=$Ie[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function E7(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=WIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t}const JIe=(0,En.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=KIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=qIe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,$a.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=E7(n,s);t[r].push(o)}else(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=E7(n,s);t[r].push(o)}else"donor"===r?t[r]=XIe(n,s):(0,En.set)(t,r,s)}return!1},Qn.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e),eRe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class tRe{constructor(e=eRe){this.options=e,this.store=new Qn.Store(void 0,{factory:Qn.DataFactory}),this.graph=new _7(this),this.scene=new y7(this)}connect(e,t=!1){return ir(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return ir(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield f7(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=hc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),ru(t.transaction)))}([i,t]).catch(()=>{}):s=yield f7(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=hc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),ru(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return ir(this,void 0,void 0,function*(){const i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],s=this.options.ccfOwlUrl;if(s.endsWith(".n3store.json")){const o=yield fetch(s).then(a=>a.text()).catch(()=>console.log("Couldn't locate serialized store."));o&&(this.store=(0,Qn.deserializeN3Store)(o,Qn.DataFactory))}else(null==s?void 0:s.length)>0&&r.push(s);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(w7(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(o=>{if(o)return this.addDataSources([o])}))),i.push(this.addDataSources(r)),yield Promise.all(i),yield this.synchronize()})}addDataSources(e,t){return ir(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>ir(this,void 0,void 0,function*(){"string"==typeof r?r.endsWith("jsonld")?yield(0,Qn.addJsonLdToStore)(r,i):r.endsWith("n3")?yield(0,Qn.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,Qn.addRdfXmlToStore)(r,i):yield(0,Qn.addJsonLdToStore)(r,i):yield(0,Qn.addJsonLdToStore)(r,i)}))),this})}synchronize(){return ir(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,Qn.serializeN3Store)(this.store)}deserialize(e){return ir(this,void 0,void 0,function*(){this.store=(0,Qn.deserializeN3Store)(e,Qn.DataFactory),this.graph=new _7(this),this.scene=new y7(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e){var t,i,r,s,o;let a=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),gi.spatialEntity,null,null),e}(n);if(a.size>0&&(a=function(n,e,t=!0){const i=new Set;if(n.forSubjects(pv(e,i),gi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const l=e.sex;a=S1(n,a,c=>function(n,e,t){const i=new Set;return n.forSubjects(pv(e,i),gi.sex,gi[t],null),i}(n,c,l))}if(a.size>0&&(null===(t=e.tmc)||void 0===t?void 0:t.length)>0&&(a=S1(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Qn.DataFactory.literal(r);n.forSubjects(pv(e,i),gi.providerName,s,null)}return i}(n,l,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set,o=new Set;n.some(c=>(e.has(c.subject.id)&&o.add(c.object.id),!1),null,gi.sections,null,null),n.some(c=>{var d;return(e.has(c.subject.id)||o.has(c.subject.id))&&(s.add(c.object.id),r.has(c.object.id)?null===(d=r.get(c.object.id))||void 0===d||d.push(c.subject.id):r.set(c.object.id,[c.subject.id])),!1},null,gi.datasets,null,null);const a=t(s),l=new Set;for(const c of a)for(const d of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(d);return l}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Qn.DataFactory.literal(r);n.forSubjects(pv(e,i),gi.technology,s,null)}return i}(n,l,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.spatialEntity,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Qn.DataFactory.namedNode(r);n.forSubjects(pv(e,i),lr.spatialEntity.ccf_annotations,s,null)}return i}(n,l,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,En.isFinite)(e.ageRange[0])&&(0,En.isFinite)(e.ageRange[1])){const l=Math.max(...e.ageRange),c=Math.min(...e.ageRange);1===c&&110===l||(a=S1(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,$a.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.age,null,null),r}(n,d,c,l)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,En.isFinite)(e.bmiRange[0])&&(0,En.isFinite)(e.bmiRange[1])){const l=Math.max(...e.bmiRange),c=Math.min(...e.bmiRange);13===c&&83===l||(a=S1(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,$a.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.bmi,null,null),r}(n,d,c,l)))}return a}(this.store,e)}get(e){return this.store.getQuads(Qn.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(t=>this.get(t))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>vIe(this.store,t))}getDatasetTechnologyNames(){return ir(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return ir(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return ir(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>JIe(this.store,t))})}getAggregateResults(e){return ir(this,void 0,void 0,function*(){return function(n,e){const t=new Set;e.some(l=>(n.has(l.subject.id)&&t.add(l.object.id),!1),null,gi.donor,null,null);const i=new Set;e.some(l=>(t.has(l.subject.id)&&i.add(l.object.id),!1),null,gi.providerUUID,null,null);const r=new Set;e.forSubjects(l=>{n.has(l.id)&&r.add(l.id)},gi.spatialEntity,null,null);const s=new Set;e.some(l=>(r.has(l.subject.id)&&s.add(l.object.id),!1),null,gi.sections,null,null);const o=new Set;return e.some(l=>{const c=l.subject;return(r.has(c.id)||s.has(c.id))&&o.add(l.object.id),!1},null,gi.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:t.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([l,c])=>({label:l,count:c}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return ir(this,void 0,void 0,function*(){return function(n,e){const t=new Map;e.some(r=>(n.has(r.subject.id)&&(t.has(r.object.id)?t.get(r.object.id).push(r.subject.id):t.set(r.object.id,[r.subject.id])),!1),null,gi.spatialEntity,null,null);const i={};return e.some(r=>{var s,o;if(t.has(r.subject.id)){const a=null!==(o=null===(s=t.get(r.subject.id))||void 0===s?void 0:s.length)&&void 0!==o?o:0;i[r.object.id]=a+(i[r.object.id]||0)}return!1},null,lr.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store)})}getOntologyTreeModel(){return ir(this,void 0,void 0,function*(){return function(n){const e={root:g7.body.id,nodes:{}},t=new Set;n.some(i=>(t.add(i.subject.id),t.add(i.predicate.id),!1),null,lr.ontologyNode.parent,null,null);for(const i of t)e.nodes[i]=HIe(n,i);return e}(this.store)})}getReferenceOrgans(){return ir(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return ir(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return ir(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}}function iRe(n,e){return n===e}let rRe=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new S,this.dataSource=i.getOption("data").pipe(me(r=>Object.assign(Object.assign({},h7),{dataSources:r})),Ui(r=>Object.keys(r).length>0),me(r=>r),$u(iRe),Ur(r=>function(n,e){return new F(t=>{let i,r;try{i=n()}catch(a){return void t.error(a)}try{r=e(i)}catch(a){return void t.error(a)}const o=(r?Pe(r):Lc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),ka(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Ur(i=>i.getTissueBlockResults(t)),Yi(1))}getAggregateResults(t){return this.dataSource.pipe(Ur(i=>i.getAggregateResults(t)),Yi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Ur(i=>i.getOntologyTermOccurences(t)),Yi(1))}getOntologyTreeModel(){return this.dataSource.pipe(Ur(t=>t.getOntologyTreeModel()),Yi(1))}getReferenceOrgans(){return this.dataSource.pipe(Ur(t=>t.getReferenceOrgans()),Yi(1))}getScene(t){return this.dataSource.pipe(Ur(i=>i.getScene(t)),Yi(1))}getOrganScene(t,i){return this.dataSource.pipe(Ur(r=>r.getReferenceOrganScene(t,i)),Yi(1))}createDataSource(){return{source:new tRe,unsubscribe:()=>{}}}connectDataSource(t,i){return ir(this,void 0,void 0,function*(){const r=(new Date).getTime();return yield t.connect(i,!1),Uy.production||(console.info(`Loaded CCF database in ${((new Date).getTime()-r)/1e3}s`),console.log(t)),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(cf),Ie(hv))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),sRe=(()=>{class n{constructor(t,i){this.configState=t,this.source=i,this.data$=this.configState.getOption("data"),this.zoomToID$=this.configState.getOption("zoomToID").pipe(me(r=>`http://purl.org/ccf/1.5/entity/${r}`)),this.highlightID$=this.configState.getOption("highlightID").pipe(me(r=>`http://purl.org/ccf/1.5/entity/${r}`)),this.referenceOrgans$=this.source.getReferenceOrgans(),this.scene$=Uo([this.data$,this.referenceOrgans$,this.source.dataSource]).pipe(Ur(([r,s,o])=>this.chooseScene(r,s))),this.organs$=this.configState.getOption("data").pipe(me(r=>this.selectOrgans(r)),ka(1)),this.filteredOrgans$=Uo([this.organs$,this.referenceOrgans$]).pipe(me(([r,s])=>this.getNeededReferenceOrgans(s,r)),ka(1)),this.filteredScene$=Uo([this.scene$,this.organs$,this.referenceOrgans$]).pipe(me(([r,s,o])=>this.filterSceneNodes(r,s,o)),function(n,e){const t=n.pipe(Vo(""));return i=>Uo([i,t]).pipe(me(([r,s])=>r.map(o=>function(n,e,t){return n.entityId!==e?n:Object.assign(Object.assign({},n),{color:t})}(o,s,e))))}(this.highlightID$,aDe),function(n){const e=n.pipe(Vo(""));return t=>Uo([t,e]).pipe(me(([i,r])=>i.map(s=>function(n,e){return n.entityId!==e?n:Object.assign(Object.assign({},n),{zoomToOnLoad:!0})}(s,r))))}(this.zoomToID$),ka(1))}chooseScene(t,i){var r;const s=null!==(r=null==t?void 0:t.map(a=>{const l=a[l7];return null==l?void 0:l.placement.target}))&&void 0!==r?r:[];if(new Set(s).size>1)return this.source.getScene();if(i){const a=i.find(l=>l["@id"]===s[0]);if(a)return this.source.getOrganScene(a.representation_of,{ontologyTerms:[a.reference_organ],sex:a.sex})}return an([])}selectOrgans(t){const r=(null!=t?t:[]).map(s=>s[l7].placement.target);return new Set(r)}filterSceneNodes(t,i,r){const s=this.getNeededReferenceOrgans(r,i),o=this.getNeededSkins(s),a=new Set([...i,...o]);return t.filter(c=>!c.reference_organ||a.has(c.reference_organ))}getNeededReferenceOrgans(t,i){return t.filter(r=>{var s;return i.has(null!==(s=r.reference_organ)&&void 0!==s?s:"")})}getNeededSkins(t){if(1===t.length)return[];const i=new Set;return t.forEach(r=>{"Female"===r.sex?i.add("http://purl.org/ccf/latest/ccf.owl#VHFSkin"):"Male"===r.sex&&i.add("http://purl.org/ccf/latest/ccf.owl#VHMSkin")}),[...i]}}return n.\u0275fac=function(t){return new(t||n)(Ie(hv),Ie(rRe))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const oRe=["bodyUI"];let aRe=(()=>{class n{constructor(t,i,r){this.configState=t,this.sceneSource=i,this.cdr=r,this.onMouseEnter=new cn,this.onMouseLeave=new cn,this.onClick=new cn,this.data$=this.configState.getOption("data"),this.organs$=this.sceneSource.filteredOrgans$,this.scene$=this.sceneSource.filteredScene$.pipe(Zr(s=>this.reset()))}reset(){var t,i;return ir(this,void 0,void 0,function*(){const{bodyUI:r}=this;yield new Promise(a=>setTimeout(a,200));const s=yield this.organs$.pipe(Yi(1)).toPromise(),o=null!==(i=!!(null===(t=r.scene)||void 0===t?void 0:t.find(a=>a.zoomToOnLoad)))&&void 0!==i&&i;if(r.rotation=0,r.rotationX=0,!o)if(1===s.length){const{x_dimension:a,y_dimension:l,z_dimension:c}=s[0];r.bounds={x:1.25*a/1e3,y:1.25*l/1e3,z:1.25*c/1e3},r.target=[a/1e3/2,l/1e3/2,c/1e3/2]}else r.bounds={x:2.2,y:2,z:.4},r.target=[0,0,0];this.cdr.detectChanges()})}}return n.\u0275fac=function(t){return new(t||n)(Me(hv),Me(sRe),Me(is))},n.\u0275cmp=wn({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&Ms(oRe,7),2&t){let r;Ai(r=Ti())&&(i.bodyUI=r.first)}},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},decls:3,vars:4,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""]],template:function(t,i){1&t&&(Kt(0,"ccf-body-ui",0,1),ui("nodeClick",function(s){return i.onClick.emit(s)})("nodeHoverStart",function(s){return i.onMouseEnter.emit(s)})("nodeHoverStop",function(s){return i.onMouseLeave.emit(s)}),function(n,e){const t=fi();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new Qe("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=mc(i.type)),o=ha(Me);try{const a=rp(!1),l=s();rp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Ft(),r,l)}finally{ha(o)}}(2,"async"),Yt()),2&t&&vn("scene",Ty(2,2,i.scene$))("interactive",!0)},directives:[IMe],pipes:[cE],styles:[".body-ui[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0}),n})();function lRe(n,e){if(1&n){const t=Ft();Kt(0,"ccf-root",1),ui("onMouseEnter",function(r){return ya(t),cr().onMouseEnter.emit(r)})("onMouseLeave",function(r){return ya(t),cr().onMouseLeave.emit(r)})("onClick",function(r){return ya(t),cr().onClick.emit(r)}),Yt()}}function cRe(n){return n.map(e=>({"@id":`http://purl.org/ccf/1.5/entity/${e.id}`,"@type":"http://purl.org/ccf/latest/ccf-entity.owl#Sample","http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity":e.rui_location}))}let uRe=(()=>{class n extends hee{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},Uy.dbOptions),globalThis.dbOptions),parse:{data:cRe}}),this.onMouseEnter=new cn,this.onMouseLeave=new cn,this.onClick=new cn}}return n.\u0275fac=function(t){return new(t||n)(Me(hv),Me(is))},n.\u0275cmp=wn({type:n,selectors:[["ccf-root-wc"]],inputs:{data:"data",highlightID:"highlightID",zoomToID:"zoomToID"},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},features:[Nn],decls:1,vars:1,consts:[[3,"onMouseEnter","onMouseLeave","onClick",4,"ngIf"],[3,"onMouseEnter","onMouseLeave","onClick"]],template:function(t,i){1&t&&function(n,e,t,i,r,s,o,a){const l=Ft(),c=fi(),d=n+20,f=c.firstCreatePass?function(n,e,t,i,r,s,o,a,l){const c=e.consts,d=Pd(e,n,4,o||null,_a(c,a));z_(e,t,d,_a(c,l)),ep(e,d);const f=d.tViews=Fp(2,d,i,r,s,e.directiveRegistry,e.pipeRegistry,null,e.schemas,c);return null!==e.queries&&(e.queries.template(e,d),f.queries=e.queries.embeddedTView(d)),d}(d,c,l,e,t,i,r,s,o):c.data[d];Qa(f,!1);const p=l[11].createComment("");Mp(c,l,p,f),xs(p,l),Lp(l,l[d]=iw(p,l,p,f)),cd(f)&&Kh(c,l,f),null!=o&&U_(l,f,a)}(0,lRe,1,0,"ccf-root",0),2&t&&vn("ngIf",i.initialized)},directives:[Ru,aRe],encapsulation:2,changeDetection:0}),n})(),dRe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[ls,Ga,zG,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(ls,2),Ie(Ga,2))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();const C1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class pRe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=Mf(this.action),i=function(n){return C1(n.getHours(),2)+":"+C1(n.getMinutes(),2)+":"+C1(n.getSeconds(),2)+"."+C1(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class gRe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const S7=new Vt("NGXS_LOGGER_PLUGIN_OPTIONS");let mRe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new gRe(this._options),this._store=this._store||this._injector.get(ih);const s=new pRe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Zr(o=>{s.completed(o)}),lc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(S7),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const x7=new Vt("LOGGER_USER_OPTIONS");function _Re(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let yRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:Q4,useClass:mRe,multi:!0},{provide:x7,useValue:t},{provide:S7,useFactory:_Re,deps:[x7]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({}),n})();const vRe=[hv];let bRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({imports:[[dRe.forRoot(),la.forRoot(vRe,{developmentMode:!Uy.production}),yRe.forRoot({disabled:Uy.production})]]}),n})(),wRe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(fl).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new oee(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends lee{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(uRe,{injector:this.injector});customElements.define("ccf-body-ui-wc",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275mod=gn({type:n}),n.\u0275inj=Et({providers:[],imports:[[YM,bRe,RMe]]}),n})();Uy.production&&function(){if(xk)throw new Error("Cannot enable prod mode after platform setup.");Sk=!1}(),DJ().bootstrapModule(wRe).catch(n=>console.error(n))},52:kt=>{function it(gt,J,At,dt,K,Ae,he){try{var q=gt[Ae](he),V=q.value}catch(L){return void At(L)}q.done?J(V):Promise.resolve(V).then(dt,K)}kt.exports=function(gt){return function(){var J=this,At=arguments;return new Promise(function(dt,K){var Ae=gt.apply(J,At);function he(V){it(Ae,dt,K,he,q,"next",V)}function q(V){it(Ae,dt,K,he,q,"throw",V)}he(void 0)})}},kt.exports.default=kt.exports,kt.exports.__esModule=!0},948:kt=>{kt.exports=function(tt){return tt&&tt.__esModule?tt:{default:tt}},kt.exports.default=kt.exports,kt.exports.__esModule=!0},321:kt=>{function it(tt){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(kt.exports=it=function(J){return typeof J},kt.exports.default=kt.exports,kt.exports.__esModule=!0):(kt.exports=it=function(J){return J&&"function"==typeof Symbol&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},kt.exports.default=kt.exports,kt.exports.__esModule=!0),it(tt)}kt.exports=it,kt.exports.default=kt.exports,kt.exports.__esModule=!0},380:kt=>{function it(tt){return Promise.resolve().then(()=>{var gt=new Error("Cannot find module '"+tt+"'");throw gt.code="MODULE_NOT_FOUND",gt})}it.keys=()=>[],it.resolve=it,it.id=380,kt.exports=it},521:()=>{},125:()=>{},307:()=>{}},kt=>{kt(kt.s=18)}]); \ No newline at end of file diff --git a/index.html b/index.html index df9c48879..fdbc29f20 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ - + diff --git a/main-es2015.js b/main-es2015.js index aefd0cdb2..4ed0d314d 100644 --- a/main-es2015.js +++ b/main-es2015.js @@ -1 +1 @@ -var oBe=Object.defineProperty,aBe=Object.defineProperties,lBe=Object.getOwnPropertyDescriptors,dT=Object.getOwnPropertySymbols,eX=Object.prototype.hasOwnProperty,tX=Object.prototype.propertyIsEnumerable,Nr=Math.pow,nX=(t,e,n)=>e in t?oBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,bt=(t,e)=>{for(var n in e||(e={}))eX.call(e,n)&&nX(t,n,e[n]);if(dT)for(var n of dT(e))tX.call(e,n)&&nX(t,n,e[n]);return t},ti=(t,e)=>aBe(t,lBe(e)),iX=(t,e)=>{var n={};for(var i in t)eX.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&dT)for(var i of dT(t))e.indexOf(i)<0&&tX.call(t,i)&&(n[i]=t[i]);return n};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{71440:function(t,e,n){var i=n(91052).default;t.exports=function t(e,n,i){function r(o,a){if(!n[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){return r(e[o][1][t]||t)},c,c.exports,t,e,n,i)}return n[o].exports}for(var s=void 0,o=0;o0&&r[r.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0?o-4:o;for(n=0;n>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[u++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l},n.fromByteArray=function(t){for(var e,n=t.length,r=n%3,s=[],o=16383,a=0,l=n-r;al?l:a+o));return 1===r?s.push(i[(e=t[n-1])>>2]+i[e<<4&63]+"=="):2===r&&s.push(i[(e=(t[n-2]<<8)+t[n-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t){return i[t>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}function h(t,e,n){for(var i=[],r=e;r>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}n.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(r>0&&(t.lastNeed=r-1),r):--i=0?(r>0&&(t.lastNeed=r-2),r):--i=0?(r>0&&(2===r?r=0:t.lastNeed=r-3),r):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":4}],6:[function(t,e,n){(function(e){(function(){"use strict";var e=t("base64-js"),i=t("ieee754");n.Buffer=o,n.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function s(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=o.prototype,e}function o(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return a(t,e,n)}function a(t,e,n){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|d(t,e),i=s(n),r=i.write(t,e);return r!==n&&(i=i.slice(0,r)),i}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function d(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(t).length;default:if(r)return i?-1:L(t).length;e=(""+e).toLowerCase(),r=!0}}function p(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return C(this,e,n);case"latin1":case"binary":return O(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function f(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function g(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=o.from(e,i)),o.isBuffer(e))return 0===e.length?-1:m(t,e,n,i,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function m(t,e,n,i,r){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var u=-1;for(s=n;sa&&(n=a-l),s=n;s>=0;s--){for(var h=!0,d=0;dr&&(i=r):i=r;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o>8,r.push(n%256),r.push(i);return r}(e,t.length-n),t,n,i)}function S(t,n,i){return e.fromByteArray(0===n&&i===t.length?t:t.slice(n,i))}function E(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(s=t[r+1]))&&(l=(31&c)<<6|63&s)>127&&(u=l);break;case 3:o=t[r+2],128==(192&(s=t[r+1]))&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=t[r+2],a=t[r+3],128==(192&(s=t[r+1]))&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(i.push((u-=65536)>>>10&1023|55296),u=56320|1023&u),i.push(u),r+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var n="",i=0;ie&&(t+=" ... "),""},o.prototype.compare=function(t,e,n,i,r){if(B(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(e>>>=0),l=Math.min(s,a),c=this.slice(i,r),u=t.slice(e,n),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return y(this,t,e,n);case"ascii":return v(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;ri)&&(n=i);for(var r="",s=e;sn)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,i,r,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function I(t,e,n,i,r,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(t,e,n,r,s){return e=+e,n>>>=0,s||I(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function D(t,e,n,r,s){return e=+e,n>>>=0,s||I(t,0,n,8),i.write(t,e,n,r,52,8),n+8}o.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t],r=1,s=0;++s>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t+--e],r=1;e>0&&(r*=256);)i+=this[t+--e]*r;return i},o.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t],r=1,s=0;++s=(r*=128)&&(i-=Math.pow(2,8*e)),i},o.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var i=e,r=1,s=this[t+--i];i>0&&(r*=256);)s+=this[t+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*e)),s},o.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,i){t=+t,e>>>=0,n>>>=0,i||P(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[e]=255&t;++s>>=0,n>>>=0,i||P(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,s=1;for(this[e+r]=255&t;--r>=0&&(s*=256);)this[e+r]=t/s&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,t,e,n,r-1,-r)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,t,e,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,n){return M(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return M(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,i){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&0!==i&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--s)t[s+e]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,i),e);return r},o.prototype.fill=function(t,e,n,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var r=t.charCodeAt(0);("utf8"===i&&r<128||"latin1"===i)&&(t=r)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function j(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(t,e,n){"use strict";e.exports=function t(e){return null===e||"object"!=typeof e||null!=e.toJSON?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((e,n,i)=>e+(0===i?"":",")+t(void 0===n||"symbol"==typeof n?null:n),"")+"]":"{"+Object.keys(e).sort().reduce((n,i,r)=>void 0===e[i]||"symbol"==typeof e[i]?n:n+(0===n.length?"":",")+t(i)+":"+t(e[i]),"")+"}"}},{}],8:[function(t,e,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(t,e){return new Promise(function(n,i){function r(n){t.removeListener(e,s),i(n)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}b(t,e,s,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&b(t,"error",e,n)}(t,r,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,n,i){var r,s,o;if(c(n),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]),void 0===o)o=s[e]=n,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(r=u(t))>0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,function(t){console&&console.warn&&console.warn(t)}(a)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=d.bind(i);return r.listener=n,i.wrapFn=r,r}function f(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=r[t];if(void 0===l)return!1;if("function"==typeof l)s(l,this,e);else{var c=l.length,u=m(l,c);for(n=0;n=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},{}],9:[function(t,e,n){n.read=function(t,e,n,i,r){var s,o,a=8*r-i-1,l=(1<>1,u=-7,h=n?r-1:0,d=n?-1:1,p=t[e+h];for(h+=d,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=256*s+t[e+h],h+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+h],h+=d,u-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},n.write=function(t,e,n,i,r,s){var o,a,l,c=8*s-r-1,u=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(a=0,o=u):o+h>=1?(a=(e*l-1)*Math.pow(2,r),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<0;t[n+p]=255&o,p+=f,o/=256,c-=8);t[n+p-f]|=128*g}},{}],10:[function(t,e,n){e.exports="function"==typeof Object.create?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},{}],11:[function(t,e,n){"use strict";const{isArray:r,isObject:s,isString:o}=t("./types"),{asArray:a}=t("./util"),{prependBase:l}=t("./url"),c=t("./JsonLdError"),u=t("./ResolvedContext");function h(t){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:t})}function d({context:t,base:e}){if(!t)return;const n=t["@context"];if(o(n))t["@context"]=l(e,n);else if(r(n))for(let i=0;i10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(e))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:e});let i,l;a.add(e);try{l=yield n(e),i=l.document||null,o(i)&&(i=JSON.parse(i))}catch(u){throw new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:e,cause:u})}if(!s(i))throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:e});return i="@context"in i?{"@context":i["@context"]}:{"@context":{}},l.contextUrl&&(r(i["@context"])||(i["@context"]=[i["@context"]]),i["@context"].push(l.contextUrl)),{context:i,remoteDoc:l}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(t,e,n){"use strict";e.exports=class extends Error{constructor(t="An unspecified JSON-LD error occurred.",e="jsonld.Error",n={}){super(t),this.name=e,this.message=t,this.details=n}}},{}],13:[function(t,e,n){"use strict";e.exports=t=>{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(e,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):t.compact(e,n)},e.expand=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):t.expand(e)},e.flatten=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):t.flatten(e)},e}},{}],14:[function(t,e,n){"use strict";e.exports=t("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(t,e,n){"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(t){const e=this;return e._loader=t,function(){return e.add.apply(e,arguments)}}add(t){var e=this;return i(function*(){let n=e._requests[t];if(n)return Promise.resolve(n);n=e._requests[t]=e._loader(t);try{return yield n}finally{delete e._requests[t]}})()}}},{}],16:[function(t,e,n){"use strict";const i=t("lru-cache");e.exports=class{constructor({document:t}){this.document=t,this.cache=new i({max:10})}getProcessed(t){return this.cache.get(t)}setProcessed(t,e){this.cache.set(t,e)}}},{"lru-cache":33}],17:[function(t,e,n){"use strict";const r=t("./JsonLdError"),{isArray:s,isObject:o,isString:a,isUndefined:l}=t("./types"),{isList:c,isValue:u,isGraph:h,isSimpleGraph:d,isSubjectReference:p}=t("./graphTypes"),{expandIri:f,getContextValue:g,isKeyword:m,process:b,processingMode:y}=t("./context"),{removeBase:v,prependBase:_}=t("./url"),{addValue:w,asArray:x,compareShortestLeast:S}=t("./util"),E={};function C(t,e,n){if("@nest"!==f(t,e,{vocab:!0},n))throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=E,E.compact=function(){var t=i(function*({activeCtx:t,activeProperty:e=null,element:n,options:i={},compactionMap:f=(()=>{})}){if(s(n)){let r=[];for(let s=0;s1&&(T=Array.from(T).sort());const k=t;for(const e of T){const n=E.compactIri({activeCtx:k,iri:e,relativeTo:{vocab:!0}}),r=g(S,n,"@context");l(r)||(t=yield b({activeCtx:t,localCtx:r,options:i,propagate:!1}))}const A=Object.keys(n).sort();for(const l of A){const p=n[l];if("@id"!==l)if("@type"!==l)if("@reverse"!==l)if("@preserve"!==l)if("@index"!==l)if("@graph"!==l&&"@list"!==l&&"@included"!==l&&m(l)){const e=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,e,p)}else{if(!s(p))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const e=E.compactIri({activeCtx:t,iri:l,value:p,relativeTo:{vocab:!0},reverse:v}),n=t.mappings.has(e)?t.mappings.get(e)["@nest"]:null;let r=_;n&&(C(t,n,i),o(_[n])||(_[n]={}),r=_[n]),w(r,e,p,{propertyIsArray:!0})}for(const e of p){const n=E.compactIri({activeCtx:t,iri:l,value:e,relativeTo:{vocab:!0},reverse:v}),r=t.mappings.has(n)?t.mappings.get(n)["@nest"]:null;let p=_;r&&(C(t,r,i),o(_[r])||(_[r]={}),p=_[r]);const m=g(t,n,"@container")||[],b=h(e),y=c(e);let S;y?S=e["@list"]:b&&(S=e["@graph"]);let O=yield E.compact({activeCtx:t,activeProperty:n,element:y||b?S:e,options:i,compactionMap:f});if(y){if(s(O)||(O=[O]),m.includes("@list")){w(p,n,O,{valueIsArray:!0,allowDuplicate:!0});continue}O={[E.compactIri({activeCtx:t,iri:"@list",relativeTo:{vocab:!0}})]:O},"@index"in e&&(O[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"])}if(b)if(m.includes("@graph")&&(m.includes("@id")||m.includes("@index")&&d(e))){let r;p.hasOwnProperty(n)?r=p[n]:p[n]=r={};const s=(m.includes("@id")?e["@id"]:e["@index"])||E.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}});w(r,s,O,{propertyIsArray:!i.compactArrays||m.includes("@set")})}else m.includes("@graph")&&d(e)?(s(O)&&O.length>1&&(O={"@included":O}),w(p,n,O,{propertyIsArray:!i.compactArrays||m.includes("@set")})):(s(O)&&1===O.length&&i.compactArrays&&(O=O[0]),O={[E.compactIri({activeCtx:t,iri:"@graph",relativeTo:{vocab:!0}})]:O},"@id"in e&&(O[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e["@id"]),"@index"in e&&(O[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"]),w(p,n,O,{propertyIsArray:!i.compactArrays||m.includes("@set")}));else if(m.includes("@language")||m.includes("@index")||m.includes("@id")||m.includes("@type")){let r,s;if(p.hasOwnProperty(n)?r=p[n]:p[n]=r={},m.includes("@language"))u(O)&&(O=O["@value"]),s=e["@language"];else if(m.includes("@index")){const i=g(t,n,"@index")||"@index",r=E.compactIri({activeCtx:t,iri:i,relativeTo:{vocab:!0}});if("@index"===i)s=e["@index"],delete O[r];else{let t;if([s,...t]=x(O[i]||[]),a(s))switch(t.length){case 0:delete O[i];break;case 1:O[i]=t[0];break;default:O[i]=t}else s=null}}else if(m.includes("@id")){const e=E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}});s=O[e],delete O[e]}else if(m.includes("@type")){const r=E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}});let o;switch([s,...o]=x(O[r]||[]),o.length){case 0:delete O[r];break;case 1:O[r]=o[0];break;default:O[r]=o}1===Object.keys(O).length&&"@id"in e&&(O=yield E.compact({activeCtx:t,activeProperty:n,element:{"@id":e["@id"]},options:i,compactionMap:f}))}s||(s=E.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}})),w(r,s,O,{propertyIsArray:m.includes("@set")})}else{const t=!i.compactArrays||m.includes("@set")||m.includes("@list")||s(O)&&0===O.length||"@list"===l||"@graph"===l;w(p,n,O,{propertyIsArray:t})}}}else{if((g(t,e,"@container")||[]).includes("@index"))continue;const n=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,p)}else{const n=yield E.compact({activeCtx:t,activeProperty:e,element:p,options:i,compactionMap:f});s(n)&&0===n.length||w(_,l,n)}else{const e=yield E.compact({activeCtx:t,activeProperty:"@reverse",element:p,options:i,compactionMap:f});for(const n in e)if(t.mappings.has(n)&&t.mappings.get(n).reverse){const r=e[n],s=(g(t,n,"@container")||[]).includes("@set")||!i.compactArrays;w(_,n,r,{propertyIsArray:s}),delete e[n]}if(Object.keys(e).length>0){const n=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,e)}}else{let e=x(p).map(t=>E.compactIri({activeCtx:S,iri:t,relativeTo:{vocab:!0}}));1===e.length&&(e=e[0]);const n=E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}}),i=(g(t,n,"@container")||[]).includes("@set")&&y(t,1.1)||s(e)&&0===p.length;w(_,n,e,{propertyIsArray:i})}else{let e=x(p).map(e=>E.compactIri({activeCtx:t,iri:e,relativeTo:{vocab:!1},base:i.base}));1===e.length&&(e=e[0]),_[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e}}return _}return n});return function(e){return t.apply(this,arguments)}}(),E.compactIri=({activeCtx:t,iri:e,value:n=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=null})=>{if(null===e)return e;t.isPropertyTermScoped&&t.previousContext&&(t=t.previousContext);const l=t.getInverse();if(m(e)&&e in l&&"@none"in l[e]&&"@type"in l[e]["@none"]&&"@none"in l[e]["@none"]["@type"])return l[e]["@none"]["@type"]["@none"];if(i.vocab&&e in l){const i=t["@language"]||"@none",r=[];o(n)&&"@index"in n&&!("@graph"in n)&&r.push("@index","@index@set"),o(n)&&"@preserve"in n&&(n=n["@preserve"][0]),h(n)?("@index"in n&&r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&r.push("@graph@id","@graph@id@set"),r.push("@graph","@graph@set","@set"),"@index"in n||r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||r.push("@graph@id","@graph@id@set")):o(n)&&!u(n)&&r.push("@id","@id@set","@type","@set@type");let a="@language",l="@null";if(s)a="@type",l="@reverse",r.push("@set");else if(c(n)){"@index"in n||r.push("@list");const t=n["@list"];if(0===t.length)a="@any",l="@none";else{let e=0===t.length?i:null,n=null;for(let i=0;it.includes("_"));t&&a.push(t.replace(/^[^_]+_/,"_"))}a.push("@none");const l=t.inverse[e];for(const o of i){if(!(o in l))continue;const t=l[o][r];for(const e of a)if(e in t)return t[e]}return null}(t,e,n,r,a,l);if(null!==d)return d}if(i.vocab&&"@vocab"in t){const n=t["@vocab"];if(0===e.indexOf(n)&&e!==n){const i=e.substr(n.length);if(!t.mappings.has(i))return i}}let d=null;const p=[];let f=t.fastCurieMap;const g=e.length-1;for(let r=0;r=0;--r){const i=p[r],s=i.terms;for(const r of s){const s=r+":"+e.substr(i.iri.length);t.mappings.get(r)._prefix&&(!t.mappings.has(s)||null===n&&t.mappings.get(s)["@id"]===e)&&(null===d||S(s,d)<0)&&(d=s)}}if(null!==d)return d;for(const[o,c]of t.mappings)if(c&&c._prefix&&e.startsWith(o+":"))throw new r(`Absolute IRI "${e}" confused with prefix "${o}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:t});return i.vocab?e:"@base"in t?t["@base"]?v(_(a,t["@base"]),e):e:v(a,e)},E.compactValue=({activeCtx:t,activeProperty:e,value:n,options:i})=>{if(u(n)){const i=g(t,e,"@type"),r=g(t,e,"@language"),s=g(t,e,"@direction"),o=g(t,e,"@container")||[],l="@index"in n&&!o.includes("@index");if(!l&&"@none"!==i&&(n["@type"]===i||"@language"in n&&n["@language"]===r&&"@direction"in n&&n["@direction"]===s||"@language"in n&&n["@language"]===r||"@direction"in n&&n["@direction"]===s))return n["@value"];const c=Object.keys(n).length,u=1===c||2===c&&"@index"in n&&!l,h="@language"in t,d=a(n["@value"]),p=t.mappings.has(e)&&null===t.mappings.get(e)["@language"];if(u&&"@none"!==i&&(!h||!d||p))return n["@value"];const f={};return l&&(f[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?f[E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:t,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(f[E.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(f[E.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),f[E.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],f}const r=f(t,e,{vocab:!0},i),s=g(t,e,"@type"),o=E.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:"@vocab"===s},base:i.base});return"@id"===s||"@vocab"===s||"@graph"===r?o:{[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]:o}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(t,e,n){"use strict";const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF: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:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},{}],19:[function(t,e,n){"use strict";const r=t("./util"),s=t("./JsonLdError"),{isArray:o,isObject:a,isString:l,isUndefined:c}=t("./types"),{isAbsolute:u,isRelative:h,prependBase:d}=t("./url"),{asArray:p,compareShortestLeast:f}=t("./util"),g=new Map,m=/^@[a-zA-Z]+$/,b={};function y(t,e,n,i,r,s){if(null===e||!l(e)||b.isKeyword(e))return e;if(e.match(m))return null;if(i&&i.hasOwnProperty(e)&&!0!==r.get(e)&&b.createTermDefinition({activeCtx:t,localCtx:i,term:e,defined:r,options:s}),(n=n||{}).vocab){const n=t.mappings.get(e);if(null===n)return null;if(a(n)&&"@id"in n)return n["@id"]}const o=e.indexOf(":");if(o>0){const n=e.substr(0,o),a=e.substr(o+1);if("_"===n||0===a.indexOf("//"))return e;i&&i.hasOwnProperty(n)&&b.createTermDefinition({activeCtx:t,localCtx:i,term:n,defined:r,options:s});const l=t.mappings.get(n);if(l&&l._prefix)return l["@id"]+a;if(u(e))return e}if(n.vocab&&"@vocab"in t)return t["@vocab"]+e;if(n.base&&"@base"in t){if(t["@base"])return d(d(s.base,t["@base"]),e)}else if(n.base)return d(s.base,e);return e}function v(t,e){if(!t||"object"!=typeof t||!e||"object"!=typeof e)return t===e;const n=Array.isArray(t);if(n!==Array.isArray(e))return!1;if(n){if(t.length!==e.length)return!1;for(let n=0;n{if(i.has(n)){if(i.get(n))return;throw new s("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:e,term:n})}let h;if(i.set(n,!1),e.hasOwnProperty(n)&&(h=e[n]),"@type"===n&&a(h)&&"@set"===(h["@container"]||"@set")&&b.processingMode(t,1.1)){const t=["@container","@id","@protected"],i=Object.keys(h);if(0===i.length||i.some(e=>!t.includes(e)))throw new s("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n})}else{if(b.isKeyword(n))throw new s("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n});if(n.match(m))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new s("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:e})}const d=t.mappings.get(n);t.mappings.has(n)&&t.mappings.delete(n);let p=!1;if((l(h)||null===h)&&(p=!0,h={"@id":h}),!a(h))throw new s("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:e});const f={};t.mappings.set(n,f),f.reverse=!1;const g=["@container","@id","@language","@reverse","@type"];b.processingMode(t,1.1)&&g.push("@context","@direction","@index","@nest","@prefix","@protected");for(const o in h)if(!g.includes(o))throw new s("Invalid JSON-LD syntax; a term definition must not contain "+o,"jsonld.SyntaxError",{code:"invalid term definition",context:e});const _=n.indexOf(":");if(f._termHasColon=_>0,"@reverse"in h){if("@id"in h)throw new s("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});if("@nest"in h)throw new s("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});const o=h["@reverse"];if(!l(o))throw new s("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(!b.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:o}),void(d?t.mappings.set(n,d):t.mappings.delete(n));const a=y(t,o,{vocab:!0,base:!1},e,i,r);if(!u(a))throw new s("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:e});f["@id"]=a,f.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!l(o))throw new s("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(null===o)f["@id"]=null;else{if(!b.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:o}),void(d?t.mappings.set(n,d):t.mappings.delete(n));if(o!==n){if(o=y(t,o,{vocab:!0,base:!1},e,i,r),!u(o)&&!b.isKeyword(o))throw new s("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:e});if(n.match(/(?::[^:])|\//)&&y(t,n,{vocab:!0,base:!1},e,new Map(i).set(n,!0),r)!==o)throw new s("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});f["@id"]=o,f._prefix=p&&!f._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in f))if(f._termHasColon){const s=n.substr(0,_);if(e.hasOwnProperty(s)&&b.createTermDefinition({activeCtx:t,localCtx:e,term:s,defined:i,options:r}),t.mappings.has(s)){const e=n.substr(_+1);f["@id"]=t.mappings.get(s)["@id"]+e}else f["@id"]=n}else if("@type"===n)f["@id"]=n;else{if(!("@vocab"in t))throw new s("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e,term:n});f["@id"]=t["@vocab"]+n}if((!0===h["@protected"]||!0===i.get("@protected")&&!1!==h["@protected"])&&(t.protected[n]=!0,f.protected=!0),i.set(n,!0),"@type"in h){let n=h["@type"];if(!l(n))throw new s("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if("@json"===n||"@none"===n){if(b.processingMode(t,1))throw new s(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else if("@id"!==n&&"@vocab"!==n){if(n=y(t,n,{vocab:!0,base:!1},e,i,r),!u(n))throw new s("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if(0===n.indexOf("_:"))throw new s("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}f["@type"]=n}if("@container"in h){const n=l(h["@container"])?[h["@container"]]:h["@container"]||[],i=["@list","@set","@index","@language"];let r=!0;const a=n.includes("@set");if(b.processingMode(t,1.1)){if(i.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new s("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:e})}else if(n.includes("@graph")){if(n.some(t=>"@graph"!==t&&"@id"!==t&&"@index"!==t&&"@set"!==t))throw new s("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:e})}else r&=n.length<=(a?2:1);if(n.includes("@type")&&(f["@type"]=f["@type"]||"@id",!["@id","@vocab"].includes(f["@type"])))throw new s("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else r&=!o(h["@container"]),r&=n.length<=1;if(r&=n.every(t=>i.includes(t)),r&=!(a&&n.includes("@list")),!r)throw new s("Invalid JSON-LD syntax; @context @container value must be one of the following: "+i.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:e});if(f.reverse&&!n.every(t=>["@index","@set"].includes(t)))throw new s("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});f["@container"]=n}if("@index"in h){if(!("@container"in h)||!f["@container"].includes("@index"))throw new s(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});if(!l(h["@index"])||0===h["@index"].indexOf("@"))throw new s(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});f["@index"]=h["@index"]}if("@context"in h&&(f["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let t=h["@language"];if(null!==t&&!l(t))throw new s("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:e});null!==t&&(t=t.toLowerCase()),f["@language"]=t}if("@prefix"in h){if(n.match(/:|\//))throw new s("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:e});if(b.isKeyword(f["@id"]))throw new s("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:e});if("boolean"!=typeof h["@prefix"])throw new s("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:e});f._prefix=!0===h["@prefix"]}if("@direction"in h){const t=h["@direction"];if(null!==t&&"ltr"!==t&&"rtl"!==t)throw new s('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:e});f["@direction"]=t}if("@nest"in h){const t=h["@nest"];if(!l(t)||"@nest"!==t&&0===t.indexOf("@"))throw new s("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:e});f["@nest"]=t}const w=f["@id"];if("@context"===w||"@preserve"===w)throw new s("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:e});if(d&&d.protected&&!c&&(t.protected[n]=!0,f.protected=!0,!v(d,f))){const t=r&&r.protectedMode||"error";if("error"===t)throw new s(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:e,term:n});if("warn"===t)return void console.warn("WARNING: protected term redefinition",{term:n});throw new s("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:e,term:n,protectedMode:t})}},b.expandIri=(t,e,n,i)=>y(t,e,n,void 0,void 0,i),b.getInitialContext=t=>{const e=JSON.stringify({processingMode:t.processingMode}),n=g.get(e);if(n)return n;const i={processingMode:t.processingMode,mappings:new Map,inverse:null,getInverse:function(){const t=this;if(t.inverse)return t.inverse;const e=t.inverse={},n=t.fastCurieMap={},i={},r=(t["@language"]||"@none").toLowerCase(),a=t["@direction"],l=t.mappings,c=[...l.keys()].sort(f);for(const s of c){const t=l.get(s);if(null===t)continue;let c=t["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===t["@id"])continue;const u=p(t["@id"]);for(const l of u){let u=e[l];const h=b.isKeyword(l);if(u)!h&&!t._termHasColon&&i[l].push(s);else if(e[l]=u={},!h&&!t._termHasColon){i[l]=[s];const t={iri:l,terms:i[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],o(s,u["@any"],"@none"),t.reverse)o(s,u["@type"],"@reverse");else if("@none"===t["@type"])o(s,u["@any"],"@none"),o(s,u["@language"],"@none"),o(s,u["@type"],"@none");else if("@type"in t)o(s,u["@type"],t["@type"]);else if("@language"in t&&"@direction"in t){const e=t["@language"],n=t["@direction"];o(s,u["@language"],e&&n?`${e}_${n}`.toLowerCase():e?e.toLowerCase():n?`_${n}`:"@null")}else"@language"in t?o(s,u["@language"],(t["@language"]||"@null").toLowerCase()):"@direction"in t?o(s,u["@language"],t["@direction"]?`_${t["@direction"]}`:"@none"):a?(o(s,u["@language"],`_${a}`),o(s,u["@language"],"@none"),o(s,u["@type"],"@none")):(o(s,u["@language"],r),o(s,u["@language"],"@none"),o(s,u["@type"],"@none"))}}for(const o in n)s(n,o,1);return e},clone:function(){const t={};return t.mappings=r.clone(this.mappings),t.clone=this.clone,t.inverse=null,t.getInverse=this.getInverse,t.protected=r.clone(this.protected),this.previousContext&&(t.previousContext=this.previousContext.clone()),t.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(t["@base"]=this["@base"]),"@language"in this&&(t["@language"]=this["@language"]),"@vocab"in this&&(t["@vocab"]=this["@vocab"]),t},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===g.size&&g.clear(),g.set(e,i),i;function s(t,e,n){const i=t[e],r=t[e]={};let o,a;for(const s of i)o=s.iri,a=n>=o.length?"":o[n],a in r?r[a].push(s):r[a]=[s];for(const l in r)""!==l&&s(r,l,n+1)}function o(t,e,n){e.hasOwnProperty(n)||(e[n]=t)}},b.getContextValue=(t,e,n)=>{if(null===e)return"@context"===n?void 0:null;if(t.mappings.has(e)){const i=t.mappings.get(e);if(c(n))return i;if(i.hasOwnProperty(n))return i[n]}return"@language"===n&&n in t||"@direction"===n&&n in t?t[n]:"@context"!==n?null:void 0},b.processingMode=(t,e)=>e.toString()>="1.1"?!t.processingMode||t.processingMode>="json-ld-"+e.toString():"json-ld-1.0"===t.processingMode,b.isKeyword=t=>{if(!l(t)||"@"!==t[0])return!1;switch(t){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(t,e,n){"use strict";const{parseLinkHeader:r,buildHeaders:s}=t("../util"),{LINK_HEADER_CONTEXT:o}=t("../constants"),a=t("../JsonLdError"),l=t("../RequestQueue"),{prependBase:c}=t("../url"),u=/(^|(\r\n))link:/i;function h(t,e,n){const i=new(t=t||XMLHttpRequest);return new Promise((t,r)=>{i.onload=()=>t(i),i.onerror=t=>r(t),i.open("GET",e,!0);for(const e in n)i.setRequestHeader(e,n[e]);i.send()})}e.exports=({secure:t,headers:e={},xhr:n}={headers:{}})=>{return e=s(e),(new l).wrapLoader(d);function d(t){return p.apply(this,arguments)}function p(){return(p=i(function*(i){if(0!==i.indexOf("http:")&&0!==i.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:i});if(t&&0!==i.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:i});let s;try{s=yield h(n,i,e)}catch(m){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:i,cause:m})}if(s.status>=400)throw new a("URL could not be dereferenced: "+s.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:i,httpStatusCode:s.status});let l={contextUrl:null,documentUrl:i,document:s.response},p=null;const f=s.getResponseHeader("Content-Type");let g;if(u.test(s.getAllResponseHeaders())&&(g=s.getResponseHeader("Link")),g&&"application/ld+json"!==f){const t=r(g),e=t[o];if(Array.isArray(e))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:i});e&&(l.contextUrl=e.target),p=t.alternate,p&&"application/ld+json"==p.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(l=yield d(c(i,p.target)))}return l})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(t,e,n){"use strict";const r=t("./JsonLdError"),{isArray:s,isObject:o,isEmptyObject:a,isString:l,isUndefined:c}=t("./types"),{isList:u,isValue:h,isGraph:d,isSubject:p}=t("./graphTypes"),{expandIri:f,getContextValue:g,isKeyword:m,process:b,processingMode:y}=t("./context"),{isAbsolute:v}=t("./url"),{addValue:_,asArray:w,getValues:x,validateTypeValue:S}=t("./util"),E={};e.exports=E;const C=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function O(t){return T.apply(this,arguments)}function T(){return(T=i(function*({activeCtx:t,activeProperty:e,expandedActiveProperty:n,element:i,expandedParent:d,options:x={},insideList:T,typeKey:k,typeScopedContext:I,expansionMap:M}){const D=Object.keys(i).sort(),R=[];let N;const L=i[k]&&"@json"===f(t,s(i[k])?i[k][0]:i[k],{vocab:!0},x);for(const O of D){let k,D=i[O];if("@context"===O)continue;let j=f(t,O,{vocab:!0},x);if((null===j||!v(j)&&!m(j))&&(j=M({unmappedProperty:O,activeCtx:t,activeProperty:e,parent:i,options:x,insideList:T,value:D,expandedParent:d}),void 0===j))continue;if(m(j)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:D});if(j in d&&"@included"!==j&&"@type"!==j)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:j})}if("@id"===j){if(!l(D)){if(!x.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(o(D)){if(!a(D))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}else{if(!s(D))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(!D.every(t=>l(t)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}}_(d,"@id",w(D).map(e=>l(e)?f(t,e,{base:!0},x):e),{propertyIsArray:x.isFrame});continue}if("@type"===j){o(D)&&(D=Object.fromEntries(Object.entries(D).map(([t,e])=>[f(I,t,{vocab:!0}),w(e).map(t=>f(I,t,{base:!0,vocab:!0}))]))),S(D,x.isFrame),_(d,"@type",w(D).map(t=>l(t)?f(I,t,{base:!0,vocab:!0},x):t),{propertyIsArray:x.isFrame});continue}if("@included"===j&&y(t,1.1)){const n=w(yield E.expand({activeCtx:t,activeProperty:e,element:D,options:x,expansionMap:M}));if(!n.every(t=>p(t)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:D});_(d,"@included",n,{propertyIsArray:!0});continue}if("@graph"===j&&!o(D)&&!s(D))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:D});if("@value"===j){N=D,L&&y(t,1.1)?d["@value"]=D:_(d,"@value",D,{propertyIsArray:x.isFrame});continue}if("@language"===j){if(null===D)continue;if(!l(D)&&!x.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:D});D=w(D).map(t=>l(t)?t.toLowerCase():t);for(const t of D)l(t)&&!t.match(C)&&console.warn(`@language must be valid BCP47: ${t}`);_(d,"@language",D,{propertyIsArray:x.isFrame});continue}if("@direction"===j){if(!l(D)&&!x.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:D});D=w(D);for(const t of D)if(l(t)&&"ltr"!==t&&"rtl"!==t)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:D});_(d,"@direction",D,{propertyIsArray:x.isFrame});continue}if("@index"===j){if(!l(D))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:D});_(d,"@index",D);continue}if("@reverse"===j){if(!o(D))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:D});if(k=yield E.expand({activeCtx:t,activeProperty:"@reverse",element:D,options:x,expansionMap:M}),"@reverse"in k)for(const t in k["@reverse"])_(d,t,k["@reverse"][t],{propertyIsArray:!0});let e=d["@reverse"]||null;for(const t in k){if("@reverse"===t)continue;null===e&&(e=d["@reverse"]={}),_(e,t,[],{propertyIsArray:!0});const n=k[t];for(let i=0;i"@id"===t||"@index"===t)&&(k=w(k).map(t=>({"@graph":w(t)}))),F.mappings.has(O)&&F.mappings.get(O).reverse){const t=d["@reverse"]=d["@reverse"]||{};k=w(k);for(let e=0;e"@value"===f(t,e,{vocab:!0},x)))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:n,element:i,expandedParent:d,options:x,insideList:T,typeScopedContext:I,typeKey:k,expansionMap:M})}}})).apply(this,arguments)}function k({activeCtx:t,activeProperty:e,value:n,options:i}){if(null==n)return null;const r=f(t,e,{vocab:!0},i);if("@id"===r)return f(t,n,{base:!0},i);if("@type"===r)return f(t,n,{vocab:!0,base:!0},i);const s=g(t,e,"@type");if(("@id"===s||"@graph"===r)&&l(n))return{"@id":f(t,n,{base:!0},i)};if("@vocab"===s&&l(n))return{"@id":f(t,n,{vocab:!0,base:!0},i)};if(m(r))return n;const o={};if(s&&!["@id","@vocab","@none"].includes(s))o["@type"]=s;else if(l(n)){const n=g(t,e,"@language");null!==n&&(o["@language"]=n);const i=g(t,e,"@direction");null!==i&&(o["@direction"]=i)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),o["@value"]=n,o}function A(t,e,n,i){const o=[],a=Object.keys(e).sort();for(const c of a){const a=f(t,c,{vocab:!0},i);let u=e[c];s(u)||(u=[u]);for(const t of u){if(null===t)continue;if(!l(t))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:e});const i={"@value":t};"@none"!==a&&(i["@language"]=c.toLowerCase()),n&&(i["@direction"]=n),o.push(i)}}return o}function P(t){return I.apply(this,arguments)}function I(){return(I=i(function*({activeCtx:t,options:e,activeProperty:n,value:i,expansionMap:o,asGraph:a,indexKey:l,propertyIndex:u}){const p=[],m=Object.keys(i).sort(),y="@type"===l;for(let v of m){if(y){const n=g(t,v,"@context");c(n)||(t=yield b({activeCtx:t,localCtx:n,propagate:!1,options:e}))}let m,w=i[v];s(w)||(w=[w]),w=yield E.expand({activeCtx:t,activeProperty:n,element:w,options:e,insideList:!1,insideIndex:!0,expansionMap:o}),m=u?"@none"===v?"@none":k({activeCtx:t,activeProperty:l,value:v,options:e}):f(t,v,{vocab:!0},e),"@id"===l?v=f(t,v,{base:!0},e):y&&(v=m);for(let t of w){if(a&&!d(t)&&(t={"@graph":[t]}),"@type"===l)"@none"===m||(t["@type"]=t["@type"]?[v].concat(t["@type"]):[v]);else{if(h(t)&&!["@language","@type","@index"].includes(l))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${l}".`,"jsonld.SyntaxError",{code:"invalid value object",value:t});u?"@none"!==m&&_(t,u,m,{propertyIsArray:!0,prependValue:!0}):"@none"!==m&&!(l in t)&&(t[l]=v)}p.push(t)}}return p})).apply(this,arguments)}E.expand=function(){var t=i(function*({activeCtx:t,activeProperty:e=null,element:n,options:i={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:d=null,expansionMap:p=(()=>{})}){if(null==n)return null;if("@default"===e&&(i=Object.assign({},i,{isFrame:!1})),!s(n)&&!o(n)){if(!u&&(null===e||"@graph"===f(t,e,{vocab:!0},i))){const r=yield p({unmappedValue:n,activeCtx:t,activeProperty:e,options:i,insideList:u});return void 0===r?null:r}return k({activeCtx:t,activeProperty:e,value:n,options:i})}if(s(n)){let r=[];const o=g(t,e,"@container")||[];u=u||o.includes("@list");for(let a=0;a1?e.slice().sort():e:[e];for(const n of s){const e=g(d,n,"@context");c(e)||(t=yield b({activeCtx:t,localCtx:e,options:i,propagate:!1}))}}let A={};yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:m,element:n,expandedParent:A,options:i,insideList:u,typeKey:T,typeScopedContext:d,expansionMap:p}),S=Object.keys(A);let P=S.length;if("@value"in A){if("@type"in A&&("@language"in A||"@direction"in A))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});let s=P-1;if("@type"in A&&(s-=1),"@index"in A&&(s-=1),"@language"in A&&(s-=1),"@direction"in A&&(s-=1),0!==s)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});const o=null===A["@value"]?[]:w(A["@value"]),c=x(A,"@type");if(!y(t,1.1)||!c.includes("@json")||1!==c.length)if(0===o.length){const r=yield p({unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}else{if(!o.every(t=>l(t)||a(t))&&"@language"in A)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:A});if(!c.every(t=>v(t)&&!(l(t)&&0===t.indexOf("_:"))||a(t)))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:A})}}else if("@type"in A&&!s(A["@type"]))A["@type"]=[A["@type"]];else if("@set"in A||"@list"in A){if(P>1&&(2!==P||!("@index"in A)))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:A});"@set"in A&&(A=A["@set"],S=Object.keys(A),P=S.length)}else if(1===P&&"@language"in A){const r=yield p(A,{unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}if(o(A)&&!i.keepFreeFloatingNodes&&!u&&(null===e||"@graph"===m)&&(0===P||"@value"in A||"@list"in A||1===P&&"@id"in A)){const r=yield p({unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}return A});return function(e){return t.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(t,e,n){"use strict";const{isSubjectReference:i}=t("./graphTypes"),{createMergedNodeMap:r}=t("./nodeMap"),s={};e.exports=s,s.flatten=t=>{const e=r(t),n=[],s=Object.keys(e).sort();for(let r=0;r=0;--i){const r=n[i];if(r.graph===e&&r.subject["@id"]===t["@id"])return!0}return!1}function f(t,e,n){const i="@"+n;let r=i in t?t[i][0]:e[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:t});return r}function g(t){if(!s.isArray(t)||1!==t.length||!s.isObject(t[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:t});if("@id"in t[0])for(const e of o.asArray(t[0]["@id"]))if(!s.isObject(e)&&!a.isAbsolute(e)||s.isString(e)&&0===e.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t});if("@type"in t[0])for(const e of o.asArray(t[0]["@type"]))if(!s.isObject(e)&&!a.isAbsolute(e)||s.isString(e)&&0===e.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t})}function m(t,e,n,a){let l=!0,c=!1;for(const u in n){let h=!1;const d=o.getValues(e,u),p=0===o.getValues(n,u).length;if("@id"===u){if(s.isEmptyObject(n["@id"][0]||{})?h=!0:n["@id"].length>=0&&(h=n["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(l=!1,p){if(d.length>0)return!1;h=!0}else if(1===n["@type"].length&&s.isEmptyObject(n["@type"][0]))h=d.length>0;else for(const t of n["@type"])h=!(!s.isObject(t)||!("@default"in t))||h||d.some(e=>e===t);if(!a.requireAll)return h}else{if(i(u))continue;{const e=o.getValues(n,u)[0];let i=!1;if(e&&(g([e]),i="@default"in e),l=!1,0===d.length&&i)continue;if(d.length>0&&p)return!1;if(void 0===e){if(d.length>0)return!1;h=!0}else if(r.isList(e)){const n=e["@list"][0];if(r.isList(d[0])){const e=d[0]["@list"];r.isValue(n)?h=e.some(t=>w(n,t)):(r.isSubject(n)||r.isSubjectReference(n))&&(h=e.some(e=>_(t,n,e,a)))}}else h=r.isValue(e)?d.some(t=>w(e,t)):r.isSubjectReference(e)?d.some(n=>_(t,e,n,a)):!!s.isObject(e)&&d.length>0}}if(!h&&a.requireAll)return!1;c=c||h}return l||c}function b(t,e){const n=t.uniqueEmbeds[t.graph],i=n[e],r=i.parent,a=i.property,l={"@id":e};if(s.isArray(r)){for(let t=0;t{const e=Object.keys(n);for(const i of e)i in n&&s.isObject(n[i].parent)&&n[i].parent["@id"]===t&&(delete n[i],c(i))};c(e)}function y(t,e){if(s.isArray(t))return t.map(t=>y(t,e));if(s.isObject(t)){if("@preserve"in t)return t["@preserve"][0];if(r.isValue(t))return t;if(r.isList(t))return t["@list"]=y(t["@list"],e),t;if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)"@id"===n&&e.bnodesToClear.includes(t[n])?delete t["@id"]:t[n]=y(t[n],e)}return t}function v(t,e,n){s.isObject(t)?o.addValue(t,e,n,{propertyIsArray:!0}):t.push(n)}function _(t,e,n,i){if(!("@id"in n))return!1;const r=t.subjects[n["@id"]];return r&&m(t,r,e,i)}function w(t,e){const n=e["@value"],i=e["@type"],r=e["@language"],o=t["@value"]?s.isArray(t["@value"])?t["@value"]:[t["@value"]]:[],a=t["@type"]?s.isArray(t["@type"])?t["@type"]:[t["@type"]]:[],l=t["@language"]?s.isArray(t["@language"])?t["@language"]:[t["@language"]]:[];return 0===o.length&&0===a.length&&0===l.length||!(!o.includes(n)&&!s.isEmptyObject(o[0])||!(!i&&0===a.length||a.includes(i)||i&&s.isEmptyObject(a[0]))||!(!r&&0===l.length||l.includes(r)||r&&s.isEmptyObject(l[0])))}e.exports=h,h.frameMergedOrDefault=(t,e,n)=>{const i={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},r=new o.IdentifierIssuer("_:b");c(t,i.graphMap,"@default",r),n.merged&&(i.graphMap["@merged"]=u(i.graphMap),i.graph="@merged"),i.subjects=i.graphMap[i.graph];const s=[];return h.frame(i,Object.keys(i.subjects).sort(),e,s),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(i.bnodeMap).filter(t=>1===i.bnodeMap[t].length)),n.link={},y(s,n)},h.frame=(t,e,n,a,c=null)=>{g(n);const u=t.options,y={embed:f(n=n[0],u,"embed"),explicit:f(n,u,"explicit"),requireAll:f(n,u,"requireAll")};t.link.hasOwnProperty(t.graph)||(t.link[t.graph]={});const _=t.link[t.graph],x=function(t,e,n,i){const r={};for(const s of e){const e=t.graphMap[t.graph][s];m(t,e,n,i)&&(r[s]=e)}return r}(t,e,n,y),S=Object.keys(x).sort();for(const g of S){const m=x[g];if(null===c?t.uniqueEmbeds={[t.graph]:{}}:t.uniqueEmbeds[t.graph]=t.uniqueEmbeds[t.graph]||{},"@link"===y.embed&&g in _){v(a,c,_[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&o.addValue(t.bnodeMap,g,S,{propertyIsArray:!0}),_[g]=S,("@first"===y.embed||"@last"===y.embed)&&t.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(t.embedded||!t.uniqueEmbeds[t.graph].hasOwnProperty(g)){if(t.embedded&&("@never"===y.embed||p(m,t.graph,t.subjectStack))){v(a,c,S);continue}if(t.embedded&&("@first"==y.embed||"@once"==y.embed)&&t.uniqueEmbeds[t.graph].hasOwnProperty(g)){v(a,c,S);continue}if("@last"===y.embed&&g in t.uniqueEmbeds[t.graph]&&b(t,g),t.uniqueEmbeds[t.graph][g]={parent:a,property:c},t.subjectStack.push({subject:m,graph:t.graph}),g in t.graphMap){let e=!1,i=null;"@graph"in n?(i=n["@graph"][0],e=!("@merged"===g||"@default"===g),s.isObject(i)||(i={})):(e="@merged"!==t.graph,i={}),e&&h.frame(ti(bt({},t),{graph:g,embedded:!1}),Object.keys(t.graphMap[g]).sort(),[i],S,"@graph")}"@included"in n&&h.frame(ti(bt({},t),{embedded:!1}),e,n["@included"],S,"@included");for(const e of Object.keys(m).sort())if(i(e)){if(S[e]=o.clone(m[e]),"@type"===e)for(const e of m["@type"])0===e.indexOf("_:")&&o.addValue(t.bnodeMap,e,S,{propertyIsArray:!0})}else if(!y.explicit||e in n)for(const i of m[e]){const s=e in n?n[e]:d(y);if(r.isList(i)){const s=n[e]&&n[e][0]&&n[e][0]["@list"]?n[e][0]["@list"]:d(y),a={"@list":[]};v(S,e,a);const l=i["@list"];for(const e of l)r.isSubjectReference(e)?h.frame(ti(bt({},t),{embedded:!0}),[e["@id"]],s,a,"@list"):v(a,"@list",o.clone(e))}else r.isSubjectReference(i)?h.frame(ti(bt({},t),{embedded:!0}),[i["@id"]],s,S,e):w(s[0],i)&&v(S,e,o.clone(i))}for(const t of Object.keys(n).sort()){if("@type"===t){if(!s.isObject(n[t][0])||!("@default"in n[t][0]))continue}else if(i(t))continue;const e=n[t][0]||{};if(!f(e,u,"omitDefault")&&!(t in S)){let n="@null";"@default"in e&&(n=o.clone(e["@default"])),s.isArray(n)||(n=[n]),S[t]=[{"@preserve":n}]}}for(const e of Object.keys(n["@reverse"]||{}).sort()){const i=n["@reverse"][e];for(const n of Object.keys(t.subjects))o.getValues(t.subjects[n],e).some(t=>t["@id"]===g)&&(S["@reverse"]=S["@reverse"]||{},o.addValue(S["@reverse"],e,[],{propertyIsArray:!0}),h.frame(ti(bt({},t),{embedded:!0}),[n],i,S["@reverse"][e],c))}v(a,c,S),t.subjectStack.pop()}}},h.cleanupNull=(t,e)=>{if(s.isArray(t))return t.map(t=>h.cleanupNull(t,e)).filter(t=>t);if("@null"===t)return null;if(s.isObject(t)){if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)t[n]=h.cleanupNull(t[n],e)}return t}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(t,e,n){"use strict";const r=t("./JsonLdError"),s=t("./graphTypes"),o=t("./types"),a=t("./util"),{RDF_LIST:l,RDF_FIRST:c,RDF_REST:u,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:p,XSD_BOOLEAN:f,XSD_DOUBLE:g,XSD_INTEGER:m,XSD_STRING:b}=t("./constants"),y=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,v={};function _(t,e,n){if(t.termType.endsWith("Node"))return{"@id":t.value};const i={"@value":t.value};if(t.language)i["@language"]=t.language;else{let a=t.datatype.value;if(a||(a=b),a===p){a="@json";try{i["@value"]=JSON.parse(i["@value"])}catch(s){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:i["@value"],cause:s})}}if(e){if(a===f)"true"===i["@value"]?i["@value"]=!0:"false"===i["@value"]&&(i["@value"]=!1);else if(o.isNumeric(i["@value"]))if(a===m){const t=parseInt(i["@value"],10);t.toFixed(0)===i["@value"]&&(i["@value"]=t)}else a===g&&(i["@value"]=parseFloat(i["@value"]));[f,m,g,b].includes(a)||(i["@type"]=a)}else if("i18n-datatype"===n&&a.startsWith("https://www.w3.org/ns/i18n#")){const[,t,e]=a.split(/[#_]/);t.length>0&&(i["@language"]=t,t.match(y)||console.warn(`@language must be valid BCP47: ${t}`)),i["@direction"]=e}else a!==b&&(i["@type"]=a)}return i}e.exports=v,v.fromRDF=function(){var t=i(function*(t,{useRdfType:e=!1,useNativeTypes:n=!1,rdfDirection:i=null}){const r={},p={"@default":r},f={};for(const s of t){const t="DefaultGraph"===s.graph.termType?"@default":s.graph.value;t in p||(p[t]={}),"@default"!==t&&!(t in r)&&(r[t]={"@id":t});const o=p[t],l=s.subject.value,c=s.predicate.value,u=s.object;l in o||(o[l]={"@id":l});const g=o[l],m=u.termType.endsWith("Node");if(m&&!(u.value in o)&&(o[u.value]={"@id":u.value}),c===d&&!e&&m){a.addValue(g,"@type",u.value,{propertyIsArray:!0});continue}const b=_(u,n,i);if(a.addValue(g,c,b,{propertyIsArray:!0}),m)if(u.value===h){const t=o[u.value];"usages"in t||(t.usages=[]),t.usages.push({node:g,property:c,value:b})}else f[u.value]=!(u.value in f)&&{node:g,property:c,value:b}}for(const a in p){const t=p[a];if(!(h in t))continue;const e=t[h];if(e.usages){for(let n of e.usages){let e=n.node,i=n.property,r=n.value;const a=[],h=[];let d=Object.keys(e).length;for(;i===u&&o.isObject(f[e["@id"]])&&o.isArray(e[c])&&1===e[c].length&&o.isArray(e[u])&&1===e[u].length&&(3===d||4===d&&o.isArray(e["@type"])&&1===e["@type"].length&&e["@type"][0]===l)&&(a.push(e[c][0]),h.push(e["@id"]),n=f[e["@id"]],e=n.node,i=n.property,r=n.value,d=Object.keys(e).length,s.isBlankNode(e)););delete r["@id"],r["@list"]=a.reverse();for(const n of h)delete t[n]}delete e.usages}}const g=[],m=Object.keys(r).sort();for(const o of m){const t=r[o];if(o in p){const e=t["@graph"]=[],n=p[o],i=Object.keys(n).sort();for(const t of i){const i=n[t];s.isSubjectReference(i)||e.push(i)}}s.isSubjectReference(t)||g.push(t)}return g});return function(e,n){return t.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(t,e,n){"use strict";const i=t("./types"),r={};e.exports=r,r.isSubject=t=>!(!i.isObject(t)||"@value"in t||"@set"in t||"@list"in t)&&(Object.keys(t).length>1||!("@id"in t)),r.isSubjectReference=t=>i.isObject(t)&&1===Object.keys(t).length&&"@id"in t,r.isValue=t=>i.isObject(t)&&"@value"in t,r.isList=t=>i.isObject(t)&&"@list"in t,r.isGraph=t=>i.isObject(t)&&"@graph"in t&&1===Object.keys(t).filter(t=>"@id"!==t&&"@index"!==t).length,r.isSimpleGraph=t=>r.isGraph(t)&&!("@id"in t),r.isBlankNode=t=>!!i.isObject(t)&&("@id"in t?0===t["@id"].indexOf("_:"):0===Object.keys(t).length||!("@value"in t||"@set"in t||"@list"in t))},{"./types":30}],26:[function(t,e,n){const r=t("rdf-canonize"),s=t("./platform"),o=t("./util"),a=t("./ContextResolver"),l=o.IdentifierIssuer,c=t("./JsonLdError"),u=t("lru-cache"),h=t("./NQuads"),{expand:d}=t("./expand"),{flatten:p}=t("./flatten"),{fromRDF:f}=t("./fromRdf"),{toRDF:g}=t("./toRdf"),{frameMergedOrDefault:m,cleanupNull:b}=t("./frame"),{isArray:y,isObject:v,isString:_}=t("./types"),{isSubjectReference:w}=t("./graphTypes"),{expandIri:x,getInitialContext:S,process:E,processingMode:C}=t("./context"),{compact:O,compactIri:T}=t("./compact"),{createNodeMap:k,createMergedNodeMap:A,mergeNodeMaps:P}=t("./nodeMap"),I=function(e){const n={},I=new u({max:100});function M(t,n){var i=n,{documentLoader:r=e.documentLoader}=i,s=iX(i,["documentLoader"]);return Object.assign({},{documentLoader:r},s,t)}return e.compact=function(){var t=i(function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let r;(i=M(i,{base:_(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new l("_:b"),contextResolver:new a({sharedCache:I})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,r=i.skipExpansion?t:yield e.expand(t,i);const s=yield e.processContext(S(i),n,i);let u=yield O({activeCtx:s,element:r,options:i,compactionMap:i.compactionMap});i.compactArrays&&!i.graph&&y(u)?1===u.length?u=u[0]:0===u.length&&(u={}):i.graph&&v(u)&&(u=[u]),v(n)&&"@context"in n&&(n=n["@context"]),n=o.clone(n),y(n)||(n=[n]);const h=n;n=[];for(let e=0;e0)&&n.push(h[e]);const d=n.length>0;if(1===n.length&&(n=n[0]),y(u)){const t=T({activeCtx:s,iri:"@graph",relativeTo:{vocab:!0}}),e=u;u={},d&&(u["@context"]=n),u[t]=e}else if(v(u)&&d){const t=u;u={"@context":n};for(const e in t)u[e]=t[e]}return u});return function(e,n,i){return t.apply(this,arguments)}}(),e.expand=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=M(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:I})})).expansionMap&&(n.expansionMap=void 0);const i={},r=[];if("expandContext"in n){const t=o.clone(n.expandContext);i.expandContext=v(t)&&"@context"in t?t:{"@context":t},r.push(i.expandContext)}let s;if(_(t)){const o=yield e.get(t,n);s=o.documentUrl,i.input=o.document,o.contextUrl&&(i.remoteContext={"@context":o.contextUrl},r.push(i.remoteContext))}else i.input=o.clone(t);"base"in n||(n.base=s||"");let l=S(n);for(const e of r)l=yield E({activeCtx:l,localCtx:e,options:n});let c=yield d({activeCtx:l,element:i.input,options:n,expansionMap:n.expansionMap});return v(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),y(c)||(c=[c]),c});return function(e,n){return t.apply(this,arguments)}}(),e.flatten=function(){var t=i(function*(t,n,i){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,i=M(i,{base:_(t)?t:"",contextResolver:new a({sharedCache:I})});const r=yield e.expand(t,i),s=p(r);return null===n?s:(i.graph=!0,i.skipExpansion=!0,yield e.compact(s,n,i))});return function(e,n,i){return t.apply(this,arguments)}}(),e.frame=function(){var t=i(function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(i=M(i,{base:_(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:I})}),_(n)){const t=yield e.get(n,i);if(n=t.document,t.contextUrl){let e=n["@context"];e?y(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const r=n&&n["@context"]||{},s=yield e.processContext(S(i),r,i);i.hasOwnProperty("omitGraph")||(i.omitGraph=C(s,1.1)),i.hasOwnProperty("pruneBlankNodeIdentifiers")||(i.pruneBlankNodeIdentifiers=C(s,1.1));const o=yield e.expand(t,i),l=bt({},i);l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=yield e.expand(n,l),u=Object.keys(n).map(t=>x(s,t,{vocab:!0}));l.merged=!u.includes("@graph"),l.is11=C(s,1.1);const h=m(o,c,l);l.graph=!i.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let d=yield e.compact(h,r,l);return l.link={},d=b(d,l),d});return function(e,n,i){return t.apply(this,arguments)}}(),e.link=function(){var t=i(function*(t,n,i){const r={};return n&&(r["@context"]=n),r["@embed"]="@link",e.frame(t,r,i)});return function(e,n,i){return t.apply(this,arguments)}}(),e.normalize=e.canonize=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=M(n,{base:_(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:I})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const e=h.parse(t);return r.canonize(e,n)}const i=bt({},n);delete i.format,i.produceGeneralizedRdf=!1;const s=yield e.toRDF(t,i);return r.canonize(s,n)});return function(e,n){return t.apply(this,arguments)}}(),e.fromRDF=function(){var t=i(function*(t,e){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");e=M(e,{format:_(t)?"application/n-quads":void 0});const{format:i}=e;let{rdfParser:r}=e;if(i){if(r=r||n[i],!r)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:i})}else r=()=>t;const s=yield r(t);return f(s,e)});return function(e,n){return t.apply(this,arguments)}}(),e.toRDF=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let i;i=(n=M(n,{base:_(t)?t:"",skipExpansion:!1,contextResolver:new a({sharedCache:I})})).skipExpansion?t:yield e.expand(t,n);const r=g(i,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return h.serialize(r);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return r});return function(e,n){return t.apply(this,arguments)}}(),e.createNodeMap=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=M(n,{base:_(t)?t:"",contextResolver:new a({sharedCache:I})});const i=yield e.expand(t,n);return A(i,n)});return function(e,n){return t.apply(this,arguments)}}(),e.merge=function(){var t=i(function*(t,n,i){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,i=M(i,{contextResolver:new a({sharedCache:I})});const r=yield Promise.all(t.map(t=>{const n=bt({},i);return e.expand(t,n)}));let s=!0;"mergeNodes"in i&&(s=i.mergeNodes);const c=i.issuer||new l("_:b"),u={"@default":{}};for(let e=0;ee._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=function(){var t=i(function*(t){throw new c("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:t})});return function(e){return t.apply(this,arguments)}}(),e.get=function(){var t=i(function*(t,n){let i;i="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const r=yield i(t);try{if(!r.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");_(r.document)&&(r.document=JSON.parse(r.document))}catch(s){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:s,remoteDoc:r})}return r});return function(e,n){return t.apply(this,arguments)}}(),e.processContext=function(){var t=i(function*(t,e,n){return n=M(n,{base:"",contextResolver:new a({sharedCache:I})}),null===e?S(n):(e=o.clone(e),v(e)&&"@context"in e||(e={"@context":e}),E({activeCtx:t,localCtx:e,options:n}))});return function(e,n,i){return t.apply(this,arguments)}}(),e.getContextValue=t("./context").getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new c('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(t,e){n[t]=e},e.unregisterRDFParser=function(t){delete n[t]},e.registerRDFParser("application/n-quads",h.parse),e.registerRDFParser("application/nquads",h.parse),e.url=t("./url"),e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=t("./RequestQueue"),e.JsonLdProcessor=t("./JsonLdProcessor")(e),s.setupGlobals(e),s.setupDocumentLoaders(e),e},M=function(){return I(function(){return M()})};I(M),e.exports=M},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(t,e,n){"use strict";const{isKeyword:i}=t("./context"),r=t("./graphTypes"),s=t("./types"),o=t("./util"),a=t("./JsonLdError"),l={};e.exports=l,l.createMergedNodeMap=(t,e)=>{const n=(e=e||{}).issuer||new o.IdentifierIssuer("_:b"),i={"@default":{}};return l.createNodeMap(t,i,"@default",n),l.mergeNodeMaps(i)},l.createNodeMap=(t,e,n,c,u,h)=>{if(s.isArray(t)){for(const i of t)l.createNodeMap(i,e,n,c,void 0,h);return}if(!s.isObject(t))return void(h&&h.push(t));if(r.isValue(t)){if("@type"in t){let e=t["@type"];0===e.indexOf("_:")&&(t["@type"]=e=c.getId(e))}return void(h&&h.push(t))}if(h&&r.isList(t)){const i=[];return l.createNodeMap(t["@list"],e,n,c,u,i),void h.push({"@list":i})}if("@type"in t){const e=t["@type"];for(const t of e)0===t.indexOf("_:")&&c.getId(t)}s.isUndefined(u)&&(u=r.isBlankNode(t)?c.getId(t["@id"]):t["@id"]),h&&h.push({"@id":u});const d=e[n],p=d[u]=d[u]||{};p["@id"]=u;const f=Object.keys(t).sort();for(let s of f){if("@id"===s)continue;if("@reverse"===s){const i={"@id":u},s=t["@reverse"];for(const t in s){const a=s[t];for(const s of a){let a=s["@id"];r.isBlankNode(s)&&(a=c.getId(a)),l.createNodeMap(s,e,n,c,a),o.addValue(d[a],t,i,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===s){u in e||(e[u]={}),l.createNodeMap(t[s],e,u,c);continue}if("@included"===s){l.createNodeMap(t[s],e,n,c);continue}if("@type"!==s&&i(s)){if("@index"===s&&s in p&&(t[s]!==p[s]||t[s]["@id"]!==p[s]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:p});p[s]=t[s];continue}const h=t[s];if(0===s.indexOf("_:")&&(s=c.getId(s)),0!==h.length)for(let t of h)if("@type"===s&&(t=0===t.indexOf("_:")?c.getId(t):t),r.isSubject(t)||r.isSubjectReference(t)){if("@id"in t&&!t["@id"])continue;const i=r.isBlankNode(t)?c.getId(t["@id"]):t["@id"];o.addValue(p,s,{"@id":i},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(t,e,n,c,i)}else if(r.isValue(t))o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1});else if(r.isList(t)){const i=[];l.createNodeMap(t["@list"],e,n,c,u,i),t={"@list":i},o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(t,e,n,c,u),o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(p,s,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=t=>{const e={};for(const n of Object.keys(t).sort())for(const r of Object.keys(t[n]).sort()){const s=t[n][r];r in e||(e[r]={"@id":r});const a=e[r];for(const t of Object.keys(s).sort())if(i(t)&&"@type"!==t)a[t]=o.clone(s[t]);else for(const e of s[t])o.addValue(a,t,o.clone(e),{propertyIsArray:!0,allowDuplicate:!1})}return e},l.mergeNodeMaps=t=>{const e=t["@default"],n=Object.keys(t).sort();for(const i of n){if("@default"===i)continue;const n=t[i];let s=e[i];s?"@graph"in s||(s["@graph"]=[]):e[i]=s={"@id":i,"@graph":[]};const o=s["@graph"];for(const t of Object.keys(n).sort()){const e=n[t];r.isSubjectReference(e)||o.push(e)}}return e}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(t,e,n){"use strict";const i=t("./documentLoaders/xhr"),r={};e.exports=r,r.setupDocumentLoaders=function(t){"undefined"!=typeof XMLHttpRequest&&(t.documentLoaders.xhr=i,t.useDocumentLoader("xhr"))},r.setupGlobals=function(t){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(t,e,n){"use strict";const{createNodeMap:i}=t("./nodeMap"),{isKeyword:r}=t("./context"),s=t("./graphTypes"),o=t("canonicalize"),a=t("./types"),l=t("./util"),{RDF_FIRST:c,RDF_REST:u,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:p,RDF_LANGSTRING:f,XSD_BOOLEAN:g,XSD_DOUBLE:m,XSD_INTEGER:b,XSD_STRING:y}=t("./constants"),{isAbsolute:v}=t("./url"),_={};function w(t,e,n,i,s){const o=Object.keys(e).sort();for(const a of o){const o=e[a],l=Object.keys(o).sort();for(let e of l){const l=o[e];if("@type"===e)e=d;else if(r(e))continue;for(const r of l){const o={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!v(a))continue;const l={termType:e.startsWith("_:")?"BlankNode":"NamedNode",value:e};if(!v(e)||"BlankNode"===l.termType&&!s.produceGeneralizedRdf)continue;const c=x(r,i,t,n,s.rdfDirection);c&&t.push({subject:o,predicate:l,object:c,graph:n})}}}}function x(t,e,n,i,r){const l={};if(s.isValue(t)){l.termType="Literal",l.value=void 0,l.datatype={termType:"NamedNode"};let e=t["@value"];const n=t["@type"]||null;"@json"===n?(l.value=o(e),l.datatype.value=p):a.isBoolean(e)?(l.value=e.toString(),l.datatype.value=n||g):a.isDouble(e)||n===m?(a.isDouble(e)||(e=parseFloat(e)),l.value=e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),l.datatype.value=n||m):a.isNumber(e)?(l.value=e.toFixed(0),l.datatype.value=n||b):"i18n-datatype"===r&&"@direction"in t?(l.datatype.value="https://www.w3.org/ns/i18n#"+(t["@language"]||"")+`_${t["@direction"]}`,l.value=e):"@language"in t?(l.value=e,l.datatype.value=n||f,l.language=t["@language"]):(l.value=e,l.datatype.value=n||y)}else if(s.isList(t)){const s=function(t,e,n,i,r){const s={termType:"NamedNode",value:c},o={termType:"NamedNode",value:u},a={termType:"NamedNode",value:h},l=t.pop(),d=l?{termType:"BlankNode",value:e.getId()}:a;let p=d;for(const c of t){const t=x(c,e,n,i,r),a={termType:"BlankNode",value:e.getId()};n.push({subject:p,predicate:s,object:t,graph:i}),n.push({subject:p,predicate:o,object:a,graph:i}),p=a}if(l){const t=x(l,e,n,i,r);n.push({subject:p,predicate:s,object:t,graph:i}),n.push({subject:p,predicate:o,object:a,graph:i})}return d}(t["@list"],e,n,i,r);l.termType=s.termType,l.value=s.value}else{const e=a.isObject(t)?t["@id"]:t;l.termType=e.startsWith("_:")?"BlankNode":"NamedNode",l.value=e}return"NamedNode"!==l.termType||v(l.value)?l:null}e.exports=_,_.toRDF=(t,e)=>{const n=new l.IdentifierIssuer("_:b"),r={"@default":{}};i(t,r,"@default",n);const s=[],o=Object.keys(r).sort();for(const i of o){let t;if("@default"===i)t={termType:"DefaultGraph",value:""};else{if(!v(i))continue;t=i.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},t.value=i}w(s,r[i],t,n,e)}return s}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(t,e,n){"use strict";const i={};e.exports=i,i.isArray=Array.isArray,i.isBoolean=t=>"boolean"==typeof t||"[object Boolean]"===Object.prototype.toString.call(t),i.isDouble=t=>i.isNumber(t)&&(-1!==String(t).indexOf(".")||Math.abs(t)>=1e21),i.isEmptyObject=t=>i.isObject(t)&&0===Object.keys(t).length,i.isNumber=t=>"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t),i.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t),i.isObject=t=>"[object Object]"===Object.prototype.toString.call(t),i.isString=t=>"string"==typeof t||"[object String]"===Object.prototype.toString.call(t),i.isUndefined=t=>void 0===t},{}],31:[function(t,e,n){"use strict";const i=t("./types"),r={};e.exports=r,r.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=(t,e)=>{const n={},i=r.parsers[e||"full"],s=i.regex.exec(t);let o=i.keys.length;for(;o--;)n[i.keys[o]]=void 0===s[o]?null:s[o];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=(t,e)=>{if(null===t||r.isAbsolute(e))return e;(!t||i.isString(t))&&(t=r.parse(t||""));const n=r.parse(e),s={protocol:t.protocol||""};if(null!==n.authority)s.authority=n.authority,s.path=n.path,s.query=n.query;else if(s.authority=t.authority,""===n.path)s.path=t.path,s.query=null!==n.query?n.query:t.query;else{if(0===n.path.indexOf("/"))s.path=n.path;else{let e=t.path;e=e.substr(0,e.lastIndexOf("/")+1),(e.length>0||t.authority)&&"/"!==e.substr(-1)&&(e+="/"),e+=n.path,s.path=e}s.query=n.query}""!==n.path&&(s.path=r.removeDotSegments(s.path));let o=s.protocol;return null!==s.authority&&(o+="//"+s.authority),o+=s.path,null!==s.query&&(o+="?"+s.query),null!==n.fragment&&(o+="#"+n.fragment),""===o&&(o="./"),o},r.removeBase=(t,e)=>{if(null===t)return e;(!t||i.isString(t))&&(t=r.parse(t||""));let n="";if(""!==t.href?n+=(t.protocol||"")+"//"+(t.authority||""):e.indexOf("//")&&(n+="//"),0!==e.indexOf(n))return e;const s=r.parse(e.substr(n.length)),o=t.normalizedPath.split("/"),a=s.normalizedPath.split("/"),l=s.fragment||s.query?0:1;for(;o.length>0&&a.length>l&&o[0]===a[0];)o.shift(),a.shift();let c="";if(o.length>0){o.pop();for(let t=0;t{if(0===t.length)return"";const e=t.split("/"),n=[];for(;e.length>0;){const t=e.shift(),i=0===e.length;"."!==t?".."!==t?n.push(t):(n.pop(),i&&n.push("")):i&&n.push("")}return"/"===t[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const s=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=t=>i.isString(t)&&s.test(t),r.isRelative=t=>i.isString(t)},{"./types":30}],32:[function(t,e,n){"use strict";const i=t("./graphTypes"),r=t("./types"),s=t("rdf-canonize").IdentifierIssuer,o=t("./JsonLdError"),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u={accept:"application/ld+json, application/json"},h={};function d(t,e){if(r.isArray(e))for(let n=0;n{if(Object.keys(t).some(t=>"accept"===t.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+u.accept+'" is supported.');return Object.assign({Accept:u.accept},t)},h.parseLinkHeader=t=>{const e={},n=t.match(a);for(let i=0;i{if(!(r.isString(t)||r.isArray(t)&&t.every(t=>r.isString(t)))){if(e&&r.isObject(t))switch(Object.keys(t).length){case 0:return;case 1:if("@default"in t&&h.asArray(t["@default"]).every(t=>r.isString(t)))return}throw new o('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:t})}},h.hasProperty=(t,e)=>{if(t.hasOwnProperty(e)){const n=t[e];return!r.isArray(n)||n.length>0}return!1},h.hasValue=(t,e,n)=>{if(h.hasProperty(t,e)){let s=t[e];const o=i.isList(s);if(r.isArray(s)||o){o&&(s=s["@list"]);for(let t=0;t{if("propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1),"valueIsArray"in i||(i.valueIsArray=!1),"allowDuplicate"in i||(i.allowDuplicate=!0),"prependValue"in i||(i.prependValue=!1),i.valueIsArray)t[e]=n;else if(r.isArray(n)){0===n.length&&i.propertyIsArray&&!t.hasOwnProperty(e)&&(t[e]=[]),i.prependValue&&(n=n.concat(t[e]),t[e]=[]);for(let r=0;r[].concat(t[e]||[]),h.removeProperty=(t,e)=>{delete t[e]},h.removeValue=(t,e,n,i)=>{"propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1);const r=h.getValues(t,e).filter(t=>!h.compareValues(t,n));0===r.length?h.removeProperty(t,e):t[e]=1!==r.length||i.propertyIsArray?r:r[0]},h.relabelBlankNodes=(t,e)=>d((e=e||{}).issuer||new s("_:b"),t),h.compareValues=(t,e)=>!!(t===e||i.isValue(t)&&i.isValue(e)&&t["@value"]===e["@value"]&&t["@type"]===e["@type"]&&t["@language"]===e["@language"]&&t["@index"]===e["@index"])||!!(r.isObject(t)&&"@id"in t&&r.isObject(e)&&"@id"in e)&&t["@id"]===e["@id"],h.compareShortestLeast=(t,e)=>t.length1;const g=(t,e,n)=>{const i=t[d].get(e);if(i){const e=i.value;if(m(t,e)){if(y(t,i),!t[a])return}else n&&(t[p]&&(i.value.now=Date.now()),t[h].unshiftNode(i));return e.value}},m=(t,e)=>{if(!e||!e.maxAge&&!t[l])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[l]&&n>t[l]},b=t=>{if(t[s]>t[r])for(let e=t[h].tail;t[s]>t[r]&&null!==e;){const n=e.prev;y(t,e),e=n}},y=(t,e)=>{if(e){const n=e.value;t[c]&&t[c](n.key,n.value),t[s]-=n.length,t[d].delete(n.key),t[h].removeNode(e)}};class v{constructor(t,e,n,i,r){this.key=t,this.value=e,this.length=n,this.now=i,this.maxAge=r||0}}const _=(t,e,n,i)=>{let r=n.value;m(t,r)&&(y(t,n),t[a]||(r=void 0)),r&&e.call(i,r.value,r.key,t)};e.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[r]=t.max||1/0;const e=t.length||f;if(this[o]="function"!=typeof e?f:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[l]=t.maxAge||0,this[c]=t.dispose,this[u]=t.noDisposeOnSet||!1,this[p]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[r]=t||1/0,b(this)}get max(){return this[r]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[l]=t,b(this)}get maxAge(){return this[l]}set lengthCalculator(t){"function"!=typeof t&&(t=f),t!==this[o]&&(this[o]=t,this[s]=0,this[h].forEach(t=>{t.length=this[o](t.value,t.key),this[s]+=t.length})),b(this)}get lengthCalculator(){return this[o]}get length(){return this[s]}get itemCount(){return this[h].length}rforEach(t,e){e=e||this;for(let n=this[h].tail;null!==n;){const i=n.prev;_(this,t,n,e),n=i}}forEach(t,e){e=e||this;for(let n=this[h].head;null!==n;){const i=n.next;_(this,t,n,e),n=i}}keys(){return this[h].toArray().map(t=>t.key)}values(){return this[h].toArray().map(t=>t.value)}reset(){this[c]&&this[h]&&this[h].length&&this[h].forEach(t=>this[c](t.key,t.value)),this[d]=new Map,this[h]=new i,this[s]=0}dump(){return this[h].map(t=>!m(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[h]}set(t,e,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const i=n?Date.now():0,a=this[o](e,t);if(this[d].has(t)){if(a>this[r])return y(this,this[d].get(t)),!1;const o=this[d].get(t).value;return this[c]&&(this[u]||this[c](t,o.value)),o.now=i,o.maxAge=n,o.value=e,this[s]+=a-o.length,o.length=a,this.get(t),b(this),!0}const p=new v(t,e,a,i,n);return p.length>this[r]?(this[c]&&this[c](t,e),!1):(this[s]+=p.length,this[h].unshift(p),this[d].set(t,this[h].head),b(this),!0)}has(t){if(!this[d].has(t))return!1;const e=this[d].get(t).value;return!m(this,e)}get(t){return g(this,t,!0)}peek(t){return g(this,t,!1)}pop(){const t=this[h].tail;return t?(y(this,t),t.value):null}del(t){y(this,this[d].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const t=r-e;t>0&&this.set(i.k,i.v,t)}}}prune(){this[d].forEach((t,e)=>g(this,e,!1))}}},{yallist:92}],34:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#",s="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:`${r}decimal`,boolean:`${r}boolean`,double:`${r}double`,integer:`${r}integer`,string:`${r}string`},rdf:{type:`${i}type`,nil:`${i}nil`,first:`${i}first`,rest:`${i}rest`,langString:`${i}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`}}},{}],35:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function t(e,n){if(n=n||d,!e)return n.defaultGraph();switch(e[0]){case"?":return n.variable(e.substr(1));case"_":return n.blankNode(e.substr(2));case'"':if(n===d)return new g(e);if('"'===e[e.length-1])return n.literal(e.substr(1,e.length-2));const i=e.lastIndexOf('"',e.length-1);return n.literal(e.substr(1,i-1),"@"===e[i+1]?e.substr(i+2):n.namedNode(e.substr(i+3)));case"<":const r=h.exec(e);return n.quad(t(w(r[1]),n),t(w(r[2]),n),t(w(r[3]),n),r[4]&&t(w(r[4]),n));default:return n.namedNode(e)}},n.termToId=function t(e){if("string"==typeof e)return e;if(e instanceof p&&"Quad"!==e.termType)return e.id;if(!e)return l.id;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==a.string?`^^${e.datatype.value}`:""}`;case"Quad":return`<<${_(t(e.subject))} ${_(t(e.predicate))} ${_(t(e.object))}${(0,s.isDefaultGraph)(e.graph)?"":` ${t(e.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${e.termType}`)}},n.escapeQuotes=_,n.unescapeQuotes=w,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var i,r=(i=t("./IRIs"))&&i.__esModule?i:{default:i},s=t("./N3Util");const{rdf:o,xsd:a}=r.default;let l,c=0;const u=/^"(.*".*)(?="[^"]*$)/,h=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,d={namedNode:function(t){return new f(t)},blankNode:function(t){return new m(t||"n3-"+c++)},variable:function(t){return new b(t)},literal:function(t,e){if("string"==typeof e)return new g(`"${t}"@${e.toLowerCase()}`);let n=e?e.value:"";return""===n&&("boolean"==typeof t?n=a.boolean:"number"==typeof t&&(Number.isFinite(t)?n=Number.isInteger(t)?a.integer:a.double:(n=a.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),new g(""===n||n===a.string?`"${t}"`:`"${t}"^^${n}`)},defaultGraph:function(){return l},quad:x,triple:x};n.default=d;class p{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof p?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}toJSON(){return{termType:this.termType,value:this.value}}}n.Term=p;class f extends p{get termType(){return"NamedNode"}}n.NamedNode=f;class g extends p{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e`"${e.replace(/"/g,'""')}`)}function w(t){return t.replace(u,(t,e)=>`"${e.replace(/""/g,'"')}`)}function x(t,e,n,i){return new v(t,e,n,i)}n.Triple=n.Quad=v},{"./IRIs":34,"./N3Util":41}],36:[function(t,e,n){(function(e){(function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=s(t("./IRIs")),r=s(t("queue-microtask"));function s(t){return t&&t.__esModule?t:{default:t}}const{xsd:o}=i.default,a=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,l={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},c=/[\x00-\x20<>\\"\{\}\|\^\`]/,u={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},h=/$0^/;n.default=class{constructor(t){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]*)?$/,this._lineMode=!!(t=t||{}).lineMode){this._n3Mode=!1;for(const t in this)!(t in u)&&this[t]instanceof RegExp&&(this[t]=h)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let n=this._input;const i=this._comments;for(;;){let s,a;for(;s=this._newline.exec(n);)i&&(a=this._comment.exec(s[0]))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),n=n.substr(s[0].length,n.length),this._line++;if(!s&&(s=this._whitespace.exec(n))&&(n=n.substr(s[0].length,n.length)),this._endOfFile.test(n))return e&&(i&&(a=this._comment.exec(n))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),t(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;const l=this._line,u=n[0];let h="",d="",p="",f=null,g=0,m=!1;switch(u){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(g=1,h="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){m=!0;break}case"<":if(f=this._unescapedIri.exec(n))h="IRI",d=f[1];else if(f=this._iri.exec(n)){if(d=this._unescape(f[1]),null===d||c.test(d))return r(this);h="IRI"}else n.length>1&&"<"===n[1]?(h="<<",g=2):this._n3Mode&&n.length>1&&"="===n[1]&&(h="inverse",g=2,d=">");break;case">":n.length>1&&">"===n[1]&&(h=">>",g=2);break;case"_":((f=this._blank.exec(n))||e&&(f=this._blank.exec(`${n} `)))&&(h="blank",p="_",d=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(n))d=f[1];else if(({value:d,matchLength:g}=this._parseLiteral(n)),null===d)return r(this);(null!==f||0!==g)&&(h="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(n))d=f[1];else if(({value:d,matchLength:g}=this._parseLiteral(n)),null===d)return r(this);(null!==f||0!==g)&&(h="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(n))&&(h="var",d=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(n))?(h="langcode",d=f[1]):(f=this._keyword.exec(n))&&(h=f[0]);break;case".":if(1===n.length?e:n[1]<"0"||n[1]>"9"){h=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(n)||e&&(f=this._number.exec(`${n} `)))&&(h="literal",d=f[0],p="string"==typeof f[1]?o.double:"string"==typeof f[2]?o.decimal:o.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(n))?h=f[0].toUpperCase():m=!0;break;case"f":case"t":(f=this._boolean.exec(n))?(h="literal",d=f[0],p=o.boolean):m=!0;break;case"a":(f=this._shortPredicates.exec(n))?(h="abbreviation",d="a"):m=!0;break;case"=":this._n3Mode&&n.length>1&&(h="abbreviation",">"!==n[1]?(g=1,d="="):(g=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(g=1,h=u);break;default:m=!0}if(m&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(n))?((f=this._prefixed.exec(n))||e&&(f=this._prefixed.exec(`${n} `)))&&(h="prefixed",p=f[1]||"",d=this._unescape(f[2])):(h="prefix",d=f[1]||"")),"^^"===this._previousMarker)switch(h){case"prefixed":h="type";break;case"IRI":h="typeIRI";break;default:h=""}if(!h)return e||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?r(this):this._input=n;const b={line:l,type:h,value:d,prefix:p};t(null,b),this.previousToken=b,this._previousMarker=h,n=n.substr(g||f[0].length,n.length)}function r(e){t(e._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(t){let e=!1;const n=t.replace(a,(t,n,i,r)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof i){let t=Number.parseInt(i,16);return t<=65535?String.fromCharCode(Number.parseInt(i,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return r in l?l[r]:(e=!0,"")});return e?null:n}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],n=e.length;let i=Math.max(this._literalClosingPos,n);for(;(i=t.indexOf(e,i))>0;){let e=0;for(;"\\"===t[i-e-1];)e++;if(e%2==0){const e=t.substring(n,i),r=e.split(/\r\n|\r|\n/).length-1,s=i+n;if(1===n&&0!==r||3===n&&this._lineMode)break;return this._line+=r,{value:this._unescape(e),matchLength:s}}i++}this._literalClosingPos=t.length-n+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,n){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof n){const t=[];let e;if(this._tokenizeToEnd((n,i)=>n?e=n:t.push(i),!0),e)throw e;return t}(0,r.default)(()=>this._tokenizeToEnd(n,!0))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=e.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(n,!1)))}),t.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(n,!0)}),t.on("error",n)}}}).call(this)}).call(this,t("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(t("./N3Lexer")),r=o(t("./N3DataFactory")),s=o(t("./IRIs"));function o(t){return t&&t.__esModule?t:{default:t}}let a=0;class l{constructor(t){this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&u(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(e),r=/trig/.test(e),s=/triple/.test(e),o=/quad/.test(e),a=this._n3Mode=/n3/.test(e),l=s||o;(this._supportsNamedGraphs=!(n||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||s||a),this._supportsRDFStar=""===e||/star|\*$/.test(e),l&&(this._resolveRelativeIRI=t=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new i.default({lineMode:l,n3:a}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){a=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,n,i,r){const s=this._n3Mode;this._contextStack.push({subject:n,predicate:i,object:r,graph:e,type:t,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const t=this._contextStack.pop(),e=this._n3Mode;this._subject=t.subject,this._predicate=t.predicate,this._object=t.object,this._graph=t.graph,e&&(this._inversePredicate=t.inverse,this._prefixes._=t.blankPrefix,this._quantified=t.quantified)}_readInTopContext(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let n;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);n=this._namedNode(e);break;case"type":case"prefixed":const i=this._prefixes[t.prefix];if(void 0===i)return this._error(`Undefined prefix "${t.prefix}:"`,t);n=this._namedNode(i+t.value);break;case"blank":n=this._blankNode(this._prefixes[t.prefix]+t.value);break;case"var":n=this._variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(t){switch(this._predicate=null,t.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._literal(t.value,this._namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._literal(t.value,this._namedNode(t.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext(),null===this._object?e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,n=null,i=this._readListItem;const r=this._subject,s=this._contextStack,o=s[s.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=e=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==s.length&&"list"===s[s.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":0===t.prefix.length?(this._literalValue=t.value,i=this._readListItemDataTypeOrLang):(e=this._literal(t.value,this._namedNode(t.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===n&&(this._subject=n=this._blankNode()),null===r?null===o.predicate?o.subject=n:o.object=n:this._emit(r,this.RDF_REST,n,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,e,this._graph)}return i}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const n=this._readEntity(t);if(void 0===n)return;e=this._literal(this._literalValue,n),t=null;break;case"langcode":e=this._literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const n=this._completeLiteral(t);if(n)return this._object=n.literal,e&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,n=this._graph;const i=this._subject,r=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,r&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==i){const t=this._predicate,e=this._object;r?this._emit(e,t,i,n):this._emit(i,t,e,n)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,n=e.length&&e[e.length-1];if(n&&"item"===n.type){const t=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,n;const i=this._blankNode();if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=i):(e=this._object,this._object=i),this._emit(e,n,i,this._graph),this._readPath}_readBackwardPath(t){const e=this._blankNode();let n,i;if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(i=this._subject,this._subject=e):(i=this._object,this._object=e),this._emit(e,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,n,i){this._callback(null,this._quad(t,e,n,i||this.DEFAULTGRAPH))}_error(t,e){const n=new Error(`${t} on line ${e.line}.`);n.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let n="",i=-1,r=-1,s=0,o="/";for(;i=r&&(n=n.substr(0,s)),"/"!==o)return`${n}/${t.substr(i+1)}`;s=i+1}}}o=t[++i]}return n+t.substring(s)}parse(t,e,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${a++}_`,this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!e){const e=[];let n;if(this._callback=(t,i)=>{t?n=t:i&&e.push(i)},this._lexer.tokenize(t).every(t=>this._readCallback=this._readCallback(t)),n)throw n;return e}this._callback=e,this._lexer.tokenize(t,(t,e)=>{null!==t?(this._callback(t),this._callback=c):this._readCallback&&(this._readCallback=this._readCallback(e))})}}function c(){}function u(t,e){const n=e.namedNode;t._namedNode=n,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=n(s.default.rdf.first),t.RDF_REST=n(s.default.rdf.rest),t.RDF_NIL=n(s.default.rdf.nil),t.N3_FORALL=n(s.default.r.forAll),t.N3_FORSOME=n(s.default.r.forSome),t.ABBREVIATIONS={a:n(s.default.rdf.type),"=":n(s.default.owl.sameAs),">":n(s.default.log.implies)},t.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=l,u(l.prototype,r.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}(t("./N3DataFactory")),s=t("readable-stream"),o=(i=t("./IRIs"))&&i.__esModule?i:{default:i};function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}class l{constructor(t,e){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!e&&t&&!t[0]&&(e=t,t=null),this._factory=(e=e||{}).factory||r.default,t&&this.addQuads(t)}get size(){let t=this._size;if(null!==t)return t;t=0;const e=this._graphs;let n,i;for(const r in e)for(const s in n=e[r].subjects)for(const e in i=n[s])t+=Object.keys(i[e]).length;return this._size=t}_addToIndex(t,e,n,i){const r=t[e]||(t[e]={}),s=r[n]||(r[n]={}),o=i in s;return o||(s[i]=null),!o}_removeFromIndex(t,e,n,i){const r=t[e],s=r[n];delete s[i];for(const o in s)return;delete r[n];for(const o in r)return;delete t[e]}_findInIndex(t,e,n,i,s,o,a,l,c,u){let h,d,p;const f=!e+!n+!i>1?Object.keys(this._ids):this._entities;e&&((h=t,t={})[e]=h[e]);for(const g in t){const e=f[g];if(d=t[g]){n&&((h=d,d={})[n]=h[n]);for(const t in d){const n=f[t];if(p=d[t]){const t=i?i in p?[i]:[]:Object.keys(p);for(let i=0;i{n in e||(e[n]=!0,t((0,r.termFromId)(this._entities[n],this._factory)))}}add(t){return this.addQuad(t),this}addQuad(t,e,n,i){e||(i=t.graph,n=t.object,e=t.predicate,t=t.subject),t=(0,r.termToId)(t),e=(0,r.termToId)(e),n=(0,r.termToId)(n),i=(0,r.termToId)(i);let s=this._graphs[i];s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s));const o=this._ids,a=this._entities;t=o[t]||(o[a[++this._id]=t]=this._id),e=o[e]||(o[a[++this._id]=e]=this._id),n=o[n]||(o[a[++this._id]=n]=this._id);const l=this._addToIndex(s.subjects,t,e,n);return this._addToIndex(s.predicates,e,n,t),this._addToIndex(s.objects,n,t,e),this._size=null,l}addQuads(t){for(let e=0;e{this.addQuad(t)}),t}removeQuad(t,e,n,i){e||(i=t.graph,n=t.object,e=t.predicate,t=t.subject),t=(0,r.termToId)(t),e=(0,r.termToId)(e),n=(0,r.termToId)(n),i=(0,r.termToId)(i);const s=this._ids,o=this._graphs;let a,l,c;if(!((t=s[t])&&(e=s[e])&&(n=s[n])&&(a=o[i])&&(l=a.subjects[t])&&(c=l[e])&&n in c))return!1;for(t in this._removeFromIndex(a.subjects,t,e,n),this._removeFromIndex(a.predicates,e,n,t),this._removeFromIndex(a.objects,n,t,e),null!==this._size&&this._size--,a.subjects)return!0;return delete o[i],!0}removeQuads(t){for(let e=0;e{this.removeQuad(t)}),t}removeMatches(t,e,n,i){const r=new s.Readable({objectMode:!0});return r._read=()=>{for(const s of this.getQuads(t,e,n,i))r.push(s);r.push(null)},this.remove(r)}deleteGraph(t){return this.removeMatches(null,null,null,t)}getQuads(t,e,n,i){t=t&&(0,r.termToId)(t),e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=[],o=this._getGraphs(i),a=this._ids;let l,u,h,d;if(c(t)&&!(u=a[t])||c(e)&&!(h=a[e])||c(n)&&!(d=a[n]))return s;for(const r in o)(l=o[r])&&(u?d?this._findInIndex(l.objects,d,u,h,"object","subject","predicate",r,null,s):this._findInIndex(l.subjects,u,h,null,"subject","predicate","object",r,null,s):h?this._findInIndex(l.predicates,h,d,null,"predicate","object","subject",r,null,s):d?this._findInIndex(l.objects,d,null,null,"object","subject","predicate",r,null,s):this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",r,null,s));return s}match(t,e,n,i){return new u(this,t,e,n,i)}countQuads(t,e,n,i){t=t&&(0,r.termToId)(t),e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._getGraphs(i),o=this._ids;let a,l,u,h,d=0;if(c(t)&&!(l=o[t])||c(e)&&!(u=o[e])||c(n)&&!(h=o[n]))return 0;for(const r in s)(a=s[r])&&(d+=t?n?this._countInIndex(a.objects,h,l,u):this._countInIndex(a.subjects,l,u,h):e?this._countInIndex(a.predicates,u,h,l):this._countInIndex(a.objects,h,l,u));return d}forEach(t,e,n,i,r){this.some(e=>(t(e),!1),e,n,i,r)}every(t,e,n,i,r){let s=!1;const o=!this.some(e=>(s=!0,!t(e)),e,n,i,r);return s&&o}some(t,e,n,i,s){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i),s=s&&(0,r.termToId)(s);const o=this._getGraphs(s),a=this._ids;let l,u,h,d;if(c(e)&&!(u=a[e])||c(n)&&!(h=a[n])||c(i)&&!(d=a[i]))return!1;for(const r in o)if(l=o[r])if(u){if(d){if(this._findInIndex(l.objects,d,u,h,"object","subject","predicate",r,t,null))return!0}else if(this._findInIndex(l.subjects,u,h,null,"subject","predicate","object",r,t,null))return!0}else if(h){if(this._findInIndex(l.predicates,h,d,null,"predicate","object","subject",r,t,null))return!0}else if(d){if(this._findInIndex(l.objects,d,null,null,"object","subject","predicate",r,t,null))return!0}else if(this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",r,t,null))return!0;return!1}getSubjects(t,e,n){const i=[];return this.forSubjects(t=>{i.push(t)},t,e,n),i}forSubjects(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.predicates,l,u,t):this._loopByKey1(a.subjects,l,t):u?this._loopByKey0(a.objects,u,t):this._loop(a.subjects,t))}getPredicates(t,e,n){const i=[];return this.forPredicates(t=>{i.push(t)},t,e,n),i}forPredicates(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.objects,u,l,t):this._loopByKey0(a.subjects,l,t):u?this._loopByKey1(a.predicates,u,t):this._loop(a.predicates,t))}getObjects(t,e,n){const i=[];return this.forObjects(t=>{i.push(t)},t,e,n),i}forObjects(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.subjects,l,u,t):this._loopByKey1(a.objects,l,t):u?this._loopByKey0(a.predicates,u,t):this._loop(a.objects,t))}getGraphs(t,e,n){const i=[];return this.forGraphs(t=>{i.push(t)},t,e,n),i}forGraphs(t,e,n,i){for(const r in this._graphs)this.some(e=>(t(e.graph),!0),e,n,i,r)}createBlankNode(t){let e,n;if(t)for(e=t=`_:${t}`,n=1;this._ids[e];)e=t+n++;else do{e="_:b"+this._blankNodeIndex++}while(this._ids[e]);return this._ids[e]=++this._id,this._entities[this._id]=e,this._factory.blankNode(e.substr(2))}extractLists({remove:t=!1,ignoreErrors:e=!1}={}){const n={},i=e?()=>!0:(t,e)=>{throw new Error(`${t.value} ${e}`)},r=this.getQuads(null,o.default.rdf.rest,o.default.rdf.nil,null),s=t?[...r]:[];return r.forEach(e=>{const r=[];let a,l,c=!1;const u=e.graph;let h=e.subject;for(;h&&!c;){const t=this.getQuads(null,null,h,null),e=this.getQuads(h,null,null,null);let n,d=null,p=null,f=null;for(let r=0;r{switch(t){case"data":e=i;break;case"end":n=i}}},(t,e)=>{t&&this.emit("error",t)||e&&this.push(e)},(t,e)=>{this.emit("prefix",t,e)}),this._transform=(t,n,i)=>{e(t),i()},this._flush=t=>{n(),t()}}import(t){return t.on("data",t=>{this.write(t)}),t.on("end",()=>{this.end()}),t.on("error",t=>{this.emit("error",t)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=t("readable-stream"),s=(i=t("./N3Writer"))&&i.__esModule?i:{default:i};n.default=class extends r.Transform{constructor(t){super({encoding:"utf8",writableObjectMode:!0});const e=this._writer=new s.default({write:(t,e,n)=>{this.push(t),n&&n()},end:t=>{this.push(null),t&&t()}},t);this._transform=(t,n,i)=>{e.addQuad(t,i)},this._flush=t=>{e.end(t)}}import(t){return t.on("data",t=>{this.write(t)}),t.on("end",()=>{this.end()}),t.on("error",t=>{this.emit("error",t)}),t.on("prefix",(t,e)=>{this._writer.addPrefix(t,e)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isNamedNode=function(t){return!!t&&"NamedNode"===t.termType},n.isBlankNode=function(t){return!!t&&"BlankNode"===t.termType},n.isLiteral=function(t){return!!t&&"Literal"===t.termType},n.isVariable=function(t){return!!t&&"Variable"===t.termType},n.isDefaultGraph=s,n.inDefaultGraph=function(t){return s(t.graph)},n.prefix=function(t,e){return o({"":t},e)("")},n.prefixes=o;var i,r=(i=t("./N3DataFactory"))&&i.__esModule?i:{default:i};function s(t){return!!t&&"DefaultGraph"===t.termType}function o(t,e){const n=Object.create(null);for(const r in t)i(r,t[r]);function i(t,i){if("string"==typeof i){const r=Object.create(null);n[t]=t=>r[t]||(r[t]=e.namedNode(i+t))}else if(!(t in n))throw new Error(`Unknown prefix: ${t}`);return n[t]}return e=e||r.default,i}},{"./N3DataFactory":35}],42:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=(i=t("./IRIs"))&&i.__esModule?i:{default:i},s=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}(t("./N3DataFactory")),o=t("./N3Util");function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}const l=s.default.defaultGraph(),{rdf:c,xsd:u}=r.default,h=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,d=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,p={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class f extends s.Term{equals(){return!1}}function g(t){let e=p[t];return void 0===e&&(1===t.length?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}n.default=class{constructor(t,e){if(this._prefixRegex=/$0^/,t&&"function"!=typeof t.write&&(e=t,t=null),this._lists=(e=e||{}).lists,t)this._outputStream=t,this._endStream=void 0===e.end||!!e.end;else{let t="";this._outputStream={write(e,n,i){t+=e,i&&i()},end:e=>{e&&e(null,t)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(e.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=l,this._baseIRI=e.baseIRI,this._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes))}get _inDefaultGraph(){return l.equals(this._graph)}_write(t,e){this._outputStream.write(t,"utf8",e)}_writeQuad(t,e,n,i,r){try{i.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(l.equals(i)?"":`${this._encodeIriOrBlank(i)} {\n`)),this._graph=i,this._subject=null),t.equals(this._subject)?e.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,r):this._write(`;\n ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=t)} ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r)}catch(s){r&&r(s)}}_writeQuadLine(t,e,n,i,r){delete this._prefixMatch,this._write(this.quadToString(t,e,n,i),r)}quadToString(t,e,n,i){return`${this._encodeSubject(t)} ${this._encodeIriOrBlank(e)} ${this._encodeObject(n)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .\n`:" .\n"}`}quadsToString(t){return t.map(t=>this.quadToString(t.subject,t.predicate,t.object,t.graph)).join("")}_encodeSubject(t){return"Quad"===t.termType?this._encodeQuad(t):this._encodeIriOrBlank(t)}_encodeIriOrBlank(t){if("NamedNode"!==t.termType)return this._lists&&t.value in this._lists&&(t=this.list(this._lists[t.value])),"id"in t?t.id:`_:${t.value}`;let e=t.value;this._baseIRI&&e.startsWith(this._baseIRI)&&(e=e.substr(this._baseIRI.length)),h.test(e)&&(e=e.replace(d,g));const n=this._prefixRegex.exec(e);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:e:`<${e}>`}_encodeLiteral(t){let e=t.value;if(h.test(e)&&(e=e.replace(d,g)),t.language)return`"${e}"@${t.language}`;if(this._lineMode){if(t.datatype.value===u.string)return`"${e}"`}else switch(t.datatype.value){case u.string:return`"${e}"`;case u.boolean:if("true"===e||"false"===e)return e;break;case u.integer:if(/^[+-]?\d+$/.test(e))return e;break;case u.decimal:if(/^[+-]?\d*\.\d+$/.test(e))return e;break;case u.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(e))return e}return`"${e}"^^${this._encodeIriOrBlank(t.datatype)}`}_encodePredicate(t){return t.value===c.type?"a":this._encodeIriOrBlank(t)}_encodeObject(t){switch(t.termType){case"Quad":return this._encodeQuad(t);case"Literal":return this._encodeLiteral(t);default:return this._encodeIriOrBlank(t)}}_encodeQuad({subject:t,predicate:e,object:n,graph:i}){return`<<${this._encodeSubject(t)} ${this._encodePredicate(e)} ${this._encodeObject(n)}${(0,o.isDefaultGraph)(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(t,e,n,i,r){void 0===n?this._writeQuad(t.subject,t.predicate,t.object,t.graph,e):"function"==typeof i?this._writeQuad(t,e,n,l,i):this._writeQuad(t,e,n,i||l,r)}addQuads(t){for(let e=0;e.\n`)}if(n){let t="",e="";for(const n in this._prefixIRIs)t+=t?`|${n}`:n,e+=(e?"|":"")+this._prefixIRIs[n];t=t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${e})[^/]*$|^(${t})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",e)}blank(t,e){let n,i,r=t;switch(void 0===t?r=[]:t.termType?r=[{predicate:t,object:e}]:"length"in t||(r=[t]),i=r.length){case 0:return new f("[]");case 1:if(n=r[0],!(n.object instanceof f))return new f(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let e="[";for(let s=0;s{e=null,t(n,i)});if(this._endStream)try{return this._outputStream.end(e)}catch(n){}e&&e()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"Writer",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"Store",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"StreamParser",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"StreamWriter",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"DataFactory",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"Term",{enumerable:!0,get:function(){return u.Term}}),Object.defineProperty(n,"NamedNode",{enumerable:!0,get:function(){return u.NamedNode}}),Object.defineProperty(n,"Literal",{enumerable:!0,get:function(){return u.Literal}}),Object.defineProperty(n,"BlankNode",{enumerable:!0,get:function(){return u.BlankNode}}),Object.defineProperty(n,"Variable",{enumerable:!0,get:function(){return u.Variable}}),Object.defineProperty(n,"DefaultGraph",{enumerable:!0,get:function(){return u.DefaultGraph}}),Object.defineProperty(n,"Quad",{enumerable:!0,get:function(){return u.Quad}}),Object.defineProperty(n,"Triple",{enumerable:!0,get:function(){return u.Triple}}),Object.defineProperty(n,"termFromId",{enumerable:!0,get:function(){return u.termFromId}}),Object.defineProperty(n,"termToId",{enumerable:!0,get:function(){return u.termToId}}),n.Util=void 0;var i=p(t("./N3Lexer")),r=p(t("./N3Parser")),s=p(t("./N3Writer")),o=p(t("./N3Store")),a=p(t("./N3StreamParser")),l=p(t("./N3StreamWriter")),c=d(t("./N3Util"));n.Util=c;var u=d(t("./N3DataFactory"));function h(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(h=function(t){return t?n:e})(t)}function d(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=h(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}function p(t){return t&&t.__esModule?t:{default:t}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(t,e,n){var i,r,s=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(n){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(t){i=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],h=!1,d=-1;function p(){!h||!c||(h=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!h){var t=l(p);h=!0;for(var e=u.length;e;){for(c=u,u=[];++d1)for(var n=1;n(n||(n=Promise.resolve())).then(t).catch(t=>setTimeout(()=>{throw t},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(t,e,n){e.exports=t("./lib")},{"./lib":55}],47:[function(t,e,n){"use strict";e.exports=class t{constructor(t,e=new Map,n=0){this.prefix=t,this._existing=e,this.counter=n}clone(){const{prefix:e,_existing:n,counter:i}=this;return new t(e,new Map(n),i)}getId(t){const e=t&&this._existing.get(t);if(e)return e;const n=this.prefix+this.counter;return this.counter++,t&&this._existing.set(t,n),n}hasId(t){return this._existing.has(t)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(t,e,n){"use strict";t("setimmediate");const r=self.crypto||self.msCrypto;e.exports=class{constructor(t){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error(`Unsupport algorithm "${t}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(t){this._content+=t}digest(){var t=this;return i(function*(){const e=(new TextEncoder).encode(t._content),n=new Uint8Array(yield r.subtle.digest(t.algorithm,e));let i="";for(let t=0;t]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class t{static parse(t){const e=[],n={},h=t.split(c.eoln);let p=0;for(const f of h){if(p++,c.empty.test(f))continue;const t=f.match(c.quad);if(null===t)throw new Error("N-Quads parse error on line "+p+".");const h={subject:null,predicate:null,object:null,graph:null};if(h.subject=void 0!==t[1]?{termType:s,value:t[1]}:{termType:o,value:t[2]},h.predicate={termType:s,value:t[3]},void 0!==t[4]?h.object={termType:s,value:t[4]}:void 0!==t[5]?h.object={termType:o,value:t[5]}:(h.object={termType:a,value:void 0,datatype:{termType:s}},void 0!==t[7]?h.object.datatype.value=t[7]:void 0!==t[8]?(h.object.datatype.value=i,h.object.language=t[8]):h.object.datatype.value=r,h.object.value=t[6].replace(d,function(t,e,n,i){if(e)switch(e){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(i)throw new Error("Unsupported U escape")})),h.graph=void 0!==t[9]?{termType:s,value:t[9]}:void 0!==t[10]?{termType:o,value:t[10]}:{termType:l,value:""},h.graph.value in n){let t=!0;const i=n[h.graph.value];for(const e of i)if(u(e,h)){t=!1;break}t&&(i.push(h),e.push(h))}else n[h.graph.value]=[h],e.push(h)}return e}static serialize(e){Array.isArray(e)||(e=t.legacyDatasetToQuads(e));const n=[];for(const i of e)n.push(t.serializeQuad(i));return n.sort().join("")}static serializeQuad(t){const e=t.subject,n=t.object,a=t.graph;let l="";return l+=e.termType===s?`<${e.value}>`:`${e.value}`,l+=` <${t.predicate.value}> `,n.termType===s?l+=`<${n.value}>`:n.termType===o?l+=n.value:(l+=`"${c=n.value,c.replace(h,function(t){switch(t){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,n.datatype.value===i?n.language&&(l+=`@${n.language}`):n.datatype.value!==r&&(l+=`^^<${n.datatype.value}>`)),a.termType===s?l+=` <${a.value}>`:a.termType===o&&(l+=` ${a.value}`),l+=" .\n",l;var c}static legacyDatasetToQuads(t){const e=[],n={"blank node":o,IRI:s,literal:a};for(const c in t)t[c].forEach(t=>{const u={};for(const e in t){const o=t[e],l={termType:n[o.type],value:o.value};l.termType===a&&(l.datatype={termType:s},"datatype"in o&&(l.datatype.value=o.datatype),"language"in o?("datatype"in o||(l.datatype.value=i),l.language=o.language):"datatype"in o||(l.datatype.value=r)),u[e]=l}u.graph="@default"===c?{termType:l,value:""}:{termType:c.startsWith("_:")?o:s,value:c},e.push(u)});return e}};const h=/["\\\n\r]/g;const d=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(t,e,n){"use strict";e.exports=class{constructor(t){this.current=t.sort(),this.done=!1,this.dir=new Map;for(let e=0;ei)&&(a&&o>0&&n>t[o-1]||!a&&ot[o+1])&&(i=n,r=o)}if(null===i)this.done=!0;else{const n=e.get(i)?r-1:r+1;t[r]=t[n],t[n]=i;for(const r of t)r>i&&e.set(r,!e.get(r))}return n}}},{}],51:[function(t,e,n){(function(n){(function(){"use strict";const r=t("./IdentifierIssuer"),s=t("./MessageDigest"),o=t("./Permuter"),a=t("./NQuads");function l(t,e){return t.hashe.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){var e=this;return i(function*(){e.quads=t;for(const r of t)e._addBlankNodeQuadInfo({quad:r,component:r.subject}),e._addBlankNodeQuadInfo({quad:r,component:r.object}),e._addBlankNodeQuadInfo({quad:r,component:r.graph});const n=new Map,i=[...e.blankNodeInfo.keys()];let s=0;for(const t of i)++s%100==0&&(yield e._yield()),yield e._hashAndTrackBlankNode({id:t,hashToBlankNodes:n});const o=[...n.keys()].sort(),c=[];for(const t of o){const i=n.get(t);i.length>1?c.push(i):e.canonicalIssuer.getId(i[0])}for(const t of c){const n=[];for(const i of t){if(e.canonicalIssuer.hasId(i))continue;const t=new r("_:b");t.getId(i);const s=yield e.hashNDegreeQuads(i,t);n.push(s)}n.sort(l);for(const t of n){const n=t.issuer.getOldIds();for(const t of n)e.canonicalIssuer.getId(t)}}const u=[];for(const t of e.quads){const n=bt({},t);n.subject=e._useCanonicalId({component:n.subject}),n.object=e._useCanonicalId({component:n.object}),n.graph=e._useCanonicalId({component:n.graph}),u.push(a.serializeQuad(n))}return u.sort(),u.join("")})()}hashFirstDegreeQuads(t){var e=this;return i(function*(){const n=[],i=e.blankNodeInfo.get(t),r=i.quads;for(const s of r){const i={subject:null,predicate:s.predicate,object:null,graph:null};i.subject=e.modifyFirstDegreeComponent(t,s.subject,"subject"),i.object=e.modifyFirstDegreeComponent(t,s.object,"object"),i.graph=e.modifyFirstDegreeComponent(t,s.graph,"graph"),n.push(a.serializeQuad(i))}n.sort();const o=new s(e.hashAlgorithm);for(const t of n)o.update(t);return i.hash=yield o.digest(),i.hash})()}hashRelatedBlankNode(t,e,n,r){var o=this;return i(function*(){let i;i=o.canonicalIssuer.hasId(t)?o.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):o.blankNodeInfo.get(t).hash;const a=new s(o.hashAlgorithm);return a.update(r),"g"!==r&&a.update(o.getRelatedPredicate(e)),a.update(i),a.digest()})()}hashNDegreeQuads(t,e){var n=this;return i(function*(){const i=new s(n.hashAlgorithm),r=yield n.createHashToRelated(t,e),a=[...r.keys()].sort();for(const t of a){i.update(t);let s,a="";const l=new o(r.get(t));let c=0;for(;l.hasNext();){const t=l.next();++c%3==0&&(yield n._yield());let i=e.clone(),r="";const o=[];let u=!1;for(const e of t)if(n.canonicalIssuer.hasId(e)?r+=n.canonicalIssuer.getId(e):(i.hasId(e)||o.push(e),r+=i.getId(e)),0!==a.length&&r>a){u=!0;break}if(!u){for(const t of o){const e=yield n.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==a.length&&r>a){u=!0;break}}u||(0===a.length||r`}createHashToRelated(t,e){var n=this;return i(function*(){const i=new Map,r=n.blankNodeInfo.get(t).quads;let s=0;for(const o of r)++s%100==0&&(yield n._yield()),yield Promise.all([n._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:t,issuer:e,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:t,issuer:e,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:t,issuer:e,hashToRelated:i})]);return i})()}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){var n=this;return i(function*(){const i=yield n.hashFirstDegreeQuads(t),r=e.get(i);r?r.push(t):e.set(i,[t])})()}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:n,id:r,issuer:s,hashToRelated:o}){var a=this;return i(function*(){if("BlankNode"!==e.termType||e.value===r)return;const i=e.value,l=yield a.hashRelatedBlankNode(i,t,s,n),c=o.get(l);c?c.push(i):o.set(l,[i])})()}_useCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}_yield(){return i(function*(){return new Promise(t=>n(t))})()}}}).call(this)}).call(this,t("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(t,e,n){"use strict";const i=t("./IdentifierIssuer"),r=t("./MessageDigest"),s=t("./Permuter"),o=t("./NQuads");function a(t,e){return t.hashe.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){this.quads=t;for(const i of t)this._addBlankNodeQuadInfo({quad:i,component:i.subject}),this._addBlankNodeQuadInfo({quad:i,component:i.object}),this._addBlankNodeQuadInfo({quad:i,component:i.graph});const e=new Map,n=[...this.blankNodeInfo.keys()];for(const i of n)this._hashAndTrackBlankNode({id:i,hashToBlankNodes:e});const r=[...e.keys()].sort(),s=[];for(const i of r){const t=e.get(i);t.length>1?s.push(t):this.canonicalIssuer.getId(t[0])}for(const o of s){const t=[];for(const e of o){if(this.canonicalIssuer.hasId(e))continue;const n=new i("_:b");n.getId(e);const r=this.hashNDegreeQuads(e,n);t.push(r)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const i of this.quads){const t=bt({},i);t.subject=this._useCanonicalId({component:t.subject}),t.object=this._useCanonicalId({component:t.object}),t.graph=this._useCanonicalId({component:t.graph}),l.push(o.serializeQuad(t))}return l.sort(),l.join("")}hashFirstDegreeQuads(t){const e=[],n=this.blankNodeInfo.get(t),i=n.quads;for(const r of i){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(t,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(t,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(t,r.graph,"graph"),e.push(o.serializeQuad(n))}e.sort();const s=new r(this.hashAlgorithm);for(const r of e)s.update(r);return n.hash=s.digest(),n.hash}hashRelatedBlankNode(t,e,n,i){let s;s=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):this.blankNodeInfo.get(t).hash;const o=new r(this.hashAlgorithm);return o.update(i),"g"!==i&&o.update(this.getRelatedPredicate(e)),o.update(s),o.digest()}hashNDegreeQuads(t,e){const n=new r(this.hashAlgorithm),i=this.createHashToRelated(t,e),o=[...i.keys()].sort();for(const r of o){n.update(r);let t,o="";const a=new s(i.get(r));for(;a.hasNext();){const n=a.next();let i=e.clone(),r="";const s=[];let l=!1;for(const t of n)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(i.hasId(t)||s.push(t),r+=i.getId(t)),0!==o.length&&r>o){l=!0;break}if(!l){for(const t of s){const e=this.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==o.length&&r>o){l=!0;break}}l||(0===o.length||r`}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i)this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:t,issuer:e,hashToRelated:n});return n}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){const n=this.hashFirstDegreeQuads(t),i=e.get(n);i?i.push(t):e.set(n,[t])}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:n,id:i,issuer:r,hashToRelated:s}){if("BlankNode"!==e.termType||e.value===i)return;const o=e.value,a=this.hashRelatedBlankNode(o,t,r,n),l=s.get(a);l?l.push(o):s.set(a,[o])}_useCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(t,e,n){"use strict";const r=t("./URDNA2015");e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){var n=this;return i(function*(){const i=new Map,r=n.blankNodeInfo.get(t).quads;let s=0;for(const o of r){let r,a;if("BlankNode"===o.subject.termType&&o.subject.value!==t)a=o.subject.value,r="p";else{if("BlankNode"!==o.object.termType||o.object.value===t)continue;a=o.object.value,r="r"}++s%100==0&&(yield n._yield());const l=yield n.hashRelatedBlankNode(a,o,e,r),c=i.get(l);c?c.push(a):i.set(l,[a])}return i})()}}},{"./URDNA2015":51}],54:[function(t,e,n){"use strict";const i=t("./URDNA2015Sync");e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i){let i,s;if("BlankNode"===r.subject.termType&&r.subject.value!==t)s=r.subject.value,i="p";else{if("BlankNode"!==r.object.termType||r.object.value===t)continue;s=r.object.value,i="r"}const o=this.hashRelatedBlankNode(s,r,e,i),a=n.get(o);a?a.push(s):n.set(o,[s])}return n}}},{"./URDNA2015Sync":52}],55:[function(t,e,n){"use strict";const r=t("./URDNA2015"),s=t("./URGNA2012"),o=t("./URDNA2015Sync"),a=t("./URGNA2012Sync");let l;try{l=t("rdf-canonize-native")}catch(u){}const c={};e.exports=c,c.NQuads=t("./NQuads"),c.IdentifierIssuer=t("./IdentifierIssuer"),c._rdfCanonizeNative=function(t){return t&&(l=t),l},c.canonize=function(){var t=i(function*(t,e){if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),e.useNative){if(!l)throw new Error("rdf-canonize-native not available");return new Promise((n,i)=>l.canonize(t,e,(t,e)=>t?i(t):n(e)))}if("URDNA2015"===e.algorithm)return new r(e).main(t);if("URGNA2012"===e.algorithm)return new s(e).main(t);throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(e,n){return t.apply(this,arguments)}}(),c._canonizeSync=function(t,e){if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),e.useNative){if(l)return l.canonizeSync(t,e);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===e.algorithm)return new o(e).main(t);if("URGNA2012"===e.algorithm)return new a(e).main(t);throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(t("./lib/BlankNode"),n),r(t("./lib/DataFactory"),n),r(t("./lib/DefaultGraph"),n),r(t("./lib/Literal"),n),r(t("./lib/NamedNode"),n),r(t("./lib/Quad"),n),r(t("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0;n.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&"BlankNode"===t.termType&&t.value===this.value}}},{}],58:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;const i=t("./BlankNode"),r=t("./DefaultGraph"),s=t("./Literal"),o=t("./NamedNode"),a=t("./Quad"),l=t("./Variable");let c=0;n.DataFactory=class{constructor(t){this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||`df_${c++}_`}namedNode(t){return new o.NamedNode(t)}blankNode(t){return new i.BlankNode(t||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(t,e){return new s.Literal(t,e)}variable(t){return new l.Variable(t)}defaultGraph(){return r.DefaultGraph.INSTANCE}quad(t,e,n,i){return new a.Quad(t,e,n,i||this.defaultGraph())}fromTerm(t){switch(t.termType){case"NamedNode":return this.namedNode(t.value);case"BlankNode":return this.blankNode(t.value);case"Literal":return t.language?this.literal(t.value,t.language):t.datatype.equals(s.Literal.XSD_STRING)?this.literal(t.value):this.literal(t.value,this.fromTerm(t.datatype));case"Variable":return this.variable(t.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(t.subject),this.fromTerm(t.predicate),this.fromTerm(t.object),this.fromTerm(t.graph))}}fromQuad(t){return this.fromTerm(t)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;class i{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&"DefaultGraph"===t.termType}}n.DefaultGraph=i,i.INSTANCE=new i},{}],60:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;const i=t("./NamedNode");class r{constructor(t,e){this.termType="Literal",this.value=t,"string"==typeof e?(this.language=e,this.datatype=r.RDF_LANGUAGE_STRING):e?(this.language="",this.datatype=e):(this.language="",this.datatype=r.XSD_STRING)}equals(t){return!!t&&"Literal"===t.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}n.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0;n.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&"NamedNode"===t.termType&&t.value===this.value}}},{}],62:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0;n.Quad=class{constructor(t,e,n,i){this.termType="Quad",this.value="",this.subject=t,this.predicate=e,this.object=n,this.graph=i}equals(t){return!!t&&("Quad"===t.termType||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},{}],63:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0;n.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&"Variable"===t.termType&&t.value===this.value}}},{}],64:[function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(t("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;class i extends Error{constructor(t,e){const n=t.saxStream._parser;super(t.trackPosition?`Line ${n.line+1} column ${n.column+1}: ${e}`:e)}}n.ParseError=i},{}],66:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;const i=t("relative-to-absolute-iri"),r=t("sax"),s=t("stream"),o=t("./ParseError"),a=t("rdf-data-factory");class l extends s.Transform{constructor(t){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},t&&(Object.assign(this,t),this.options=t),this.dataFactory||(this.dataFactory=new a.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=r.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(t,e){const n={};let i=!1;for(const s in t.attributes)s.startsWith("xmlns")&&(5===s.length?(i=!0,n[""]=t.attributes[s]):":"===s.charAt(5)&&(i=!0,n[s.substr(6)]=t.attributes[s]));const r=e&&e.ns?e.ns:[l.DEFAULT_NS];return i?r.concat([n]):r}static expandPrefixedTerm(t,e,n){const i=t.indexOf(":");let r,s;i>=0?(r=t.substr(0,i),s=t.substr(i+1)):(r="",s=t);let a=null,l=null;for(let o=e.length-1;o>=0;o--){const t=e[o][r];if(t){a=t;break}l||(l=e[o][""])}if(!a){if(r&&"xmlns"!==r)throw new o.ParseError(n,`The prefix '${r}' in term '${t}' was not bound.`);a=l||""}return{prefix:r,local:s,uri:a}}static isValidIri(t){return l.IRI_REGEX.test(t)}import(t){const e=new s.PassThrough({readableObjectMode:!0});t.on("error",t=>n.emit("error",t)),t.on("data",t=>e.push(t)),t.on("end",()=>e.push(null));const n=e.pipe(new l(this.options));return n}_transform(t,e,n){try{this.saxStream.write(t,e)}catch(i){return n(i)}n()}newParseError(t){return new o.ParseError(this,t)}valueToUri(t,e){return this.uriToNamedNode(i.resolve(t,e.baseIRI))}uriToNamedNode(t){if(!l.isValidIri(t))throw this.newParseError(`Invalid URI: ${t}`);return this.dataFactory.namedNode(t)}validateNcname(t){if(!l.NCNAME_MATCHER.test(t))throw this.newParseError(`Not a valid NCName: ${t}`)}attachSaxListeners(){this.saxStream.on("error",t=>this.emit("error",t)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(t){const e=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let n=c.RESOURCE;if(e&&(e.hadChildren=!0,n=e.childrenParseType),e&&e.childrenStringTags){const n=t.name;let i="";for(const e in t.attributes)i+=` ${e}="${t.attributes[e]}"`;e.childrenStringTags.push(`<${n}${i}>`);const r={childrenStringTags:e.childrenStringTags};return r.childrenStringEmitClosingTag=``,void this.activeTagStack.push(r)}const i={};e?(i.language=e.language,i.baseIRI=e.baseIRI):i.baseIRI=this.baseIRI,this.activeTagStack.push(i),i.ns=l.parseNamespace(t,e),n===c.RESOURCE?this.onTagResource(t,i,e,!e):this.onTagProperty(t,i,e)}onTagResource(t,e,n,r){const s=l.expandPrefixedTerm(t.name,e.ns,this);e.childrenParseType=c.PROPERTY;let o=!0;if(s.uri===l.RDF){if(!r&&l.FORBIDDEN_NODE_ELEMENTS.indexOf(s.local)>=0)throw this.newParseError(`Illegal node element name: ${s.local}`);switch(s.local){case"RDF":e.childrenParseType=c.RESOURCE;case"Description":o=!1}}const a=[],u=[];let h=null,d=!1,p=!1,f=null;for(const c in t.attributes){const r=t.attributes[c],s=l.expandPrefixedTerm(c,e.ns,this);if(n&&s.uri===l.RDF)switch(s.local){case"about":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);h=r;continue;case"ID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);this.validateNcname(r),h="#"+r,d=!0;continue;case"nodeID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);this.validateNcname(r),h=r,p=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":f=r;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(s.uri===l.XML){if("lang"===s.local){e.language=""===r?null:r.toLowerCase();continue}if("base"===s.local){e.baseIRI=i.resolve(r,e.baseIRI);continue}}"xml"!==s.prefix&&s.uri&&(a.push(this.uriToNamedNode(s.uri+s.local)),u.push(r))}if(null!==h&&(e.subject=p?this.dataFactory.blankNode(h):this.valueToUri(h,e),d&&this.claimNodeId(e.subject)),e.subject||(e.subject=this.dataFactory.blankNode()),o){const t=this.uriToNamedNode(s.uri+s.local);this.emitTriple(e.subject,this.dataFactory.namedNode(l.RDF+"type"),t,n?n.reifiedStatementId:null)}if(n){if(n.predicate)if(n.childrenCollectionSubject){const t=this.dataFactory.blankNode();this.emitTriple(n.childrenCollectionSubject,n.childrenCollectionPredicate,t,n.reifiedStatementId),this.emitTriple(t,this.dataFactory.namedNode(l.RDF+"first"),e.subject,e.reifiedStatementId),n.childrenCollectionSubject=t,n.childrenCollectionPredicate=this.dataFactory.namedNode(l.RDF+"rest")}else{this.emitTriple(n.subject,n.predicate,e.subject,n.reifiedStatementId);for(let t=0;t=0)throw this.newParseError(`Illegal property element name: ${i.local}`);e.predicateSubPredicates=[],e.predicateSubObjects=[];let r=!1,s=!1,o=null,a=!0;const u=[],h=[];for(const d in t.attributes){const n=t.attributes[d],i=l.expandPrefixedTerm(d,e.ns,this);if(i.uri===l.RDF)switch(i.local){case"resource":if(o)throw this.newParseError(`Found both rdf:resource (${n}) and rdf:nodeID (${o}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${n})`);e.hadChildren=!0,o=n,a=!1;continue;case"datatype":if(s)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${n}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${n})`);e.datatype=this.valueToUri(n,e);continue;case"nodeID":if(s)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${n}).`);if(e.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${n}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${n})`);this.validateNcname(n),e.hadChildren=!0,o=n,a=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(s)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(e.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${e.datatype.value})`);if(o)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${o})`);if("Resource"===n){r=!0,e.childrenParseType=c.PROPERTY;const t=this.dataFactory.blankNode();this.emitTriple(e.subject,e.predicate,t,e.reifiedStatementId),e.subject=t,e.predicate=null}else"Collection"===n?(r=!0,e.hadChildren=!0,e.childrenCollectionSubject=e.subject,e.childrenCollectionPredicate=e.predicate,a=!1):"Literal"===n&&(r=!0,e.childrenTagsToString=!0,e.childrenStringTags=[]);continue;case"ID":this.validateNcname(n),e.reifiedStatementId=this.valueToUri("#"+n,e),this.claimNodeId(e.reifiedStatementId);continue}else if(i.uri===l.XML&&"lang"===i.local){e.language=""===n?null:n.toLowerCase();continue}if("xml"!==i.prefix&&"xmlns"!==i.prefix&&i.uri){if(r||e.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${n}`);e.hadChildren=!0,s=!0,u.push(this.uriToNamedNode(i.uri+i.local)),h.push(this.dataFactory.literal(n,e.datatype||e.language))}}if(null!==o){const t=e.subject;e.subject=a?this.dataFactory.blankNode(o):this.valueToUri(o,e),this.emitTriple(t,e.predicate,e.subject,e.reifiedStatementId);for(let n=0;n/g,(t,e,n)=>(this.saxStream._parser.ENTITIES[e]=n,""))}}var c,u;n.RdfXmlParser=l,l.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,l.MIME_TYPE="application/rdf+xml",l.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",l.XML="http://www.w3.org/XML/1998/namespace",l.XMLNS="http://www.w3.org/2000/xmlns/",l.DEFAULT_NS={xml:l.XML},l.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],l.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],l.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,(u=c=n.ParseType||(n.ParseType={}))[u.RESOURCE=0]="RESOURCE",u[u.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(t,e,n){"use strict";var i={};function r(t,e,n){n||(n=Error);var r=function(t){function n(n,i,r){return t.call(this,function(t,n,i){return"string"==typeof e?e:e(t,n,i)}(n,i,r))||this}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(n,t),n}(n);r.prototype.name=n.name,r.prototype.code=t,i[t]=r}function s(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map(function(t){return String(t)}),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,n){var i,r;if("string"==typeof e&&function(t,e,n){return t.substr(!n||n<0?0:+n,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))r="The ".concat(t," ").concat(i," ").concat(s(e,"type"));else{var o=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";r='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(s(e,"type"))}return r+". Received type ".concat(typeof n)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},{}],68:[function(t,e,n){(function(n){(function(){"use strict";var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};e.exports=c;var r=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(c,r);for(var o=i(s.prototype),a=0;a0)if("string"!=typeof e&&!o.objectMode&&Object.getPrototypeOf(e)!==a.prototype&&(e=function(t){return a.from(t)}(e)),i)o.endEmitted?x(t,new w):T(t,o,e,!0);else if(o.ended)x(t,new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(e=o.decoder.write(e),o.objectMode||0!==e.length?T(t,o,e,!1):M(t,o)):T(t,o,e,!1)}else i||(o.reading=!1,M(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(I,t))}function I(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,j(t)}function M(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(D,t,e))}function D(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){c("readable nexttick read 0"),t.read(0)}function L(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(V,e,t))}function V(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function z(t,e){for(var n=0,i=t.length;n=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):P(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&B(this),null;var i,r=e.needReadable;return c("need readable",r),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&B(this)),null!==i&&this.emit("data",i),i},C.prototype._read=function(t){x(this,new _("_read()"))},C.prototype.pipe=function(t,e){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,c("pipe count=%d opts=%j",r.pipesCount,e);var o=e&&!1===e.end||t===n.stdout||t===n.stderr?m:l;function a(e,n){c("onunpipe"),e===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),t.removeListener("close",f),t.removeListener("finish",g),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",m),i.removeListener("data",d),h=!0,r.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u())}function l(){c("onend"),t.end()}r.endEmitted?n.nextTick(o):i.once("end",o),t.on("unpipe",a);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,j(t))}}(i);t.on("drain",u);var h=!1;function d(e){c("ondata");var n=t.write(e);c("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==z(r.pipes,t))&&!h&&(c("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function p(e){c("onerror",e),m(),t.removeListener("error",p),0===s(t,"error")&&x(t,e)}function f(){t.removeListener("finish",g),m()}function g(){c("onfinish"),t.removeListener("close",f),m()}function m(){c("unpipe"),i.unpipe(t)}return i.on("data",d),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",p),t.once("close",f),t.once("finish",g),t.emit("pipe",i),r.flowing||(c("pipe resume"),i.resume()),t},C.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var i=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s0,!1!==r.flowing&&this.resume()):"readable"===t&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,c("on readable",r.length,r.reading),r.length?P(this):r.reading||n.nextTick(N,this)),i},C.prototype.removeListener=function(t,e){var i=o.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(R,this),i},C.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.nextTick(R,this),e},C.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(L,t,e))}(this,t)),t.paused=!1,this},C.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(t){var e=this,n=this._readableState,i=!1;for(var r in t.on("end",function(){if(c("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(r){c("wrapped data"),n.decoder&&(r=n.decoder.write(r)),n.objectMode&&null==r||!(n.objectMode||r&&r.length)||e.push(r)||(i=!0,t.pause())}),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));for(var s=0;s-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(t,e,n){n(new g("_write()"))},C.prototype._writev=null,C.prototype.end=function(t,e,i){var r=this._writableState;return"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,i){e.ending=!0,M(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i)),e.ended=!0,t.writable=!1}(this,r,i),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){!this._writableState||(this._writableState.destroyed=t)}}),C.prototype.destroy=h.destroy,C.prototype._undestroy=h.undestroy,C.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(t,e,n){(function(n){(function(){"use strict";var i;function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=t("./end-of-stream"),o=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function f(t){var e=t[o];if(null!==e){var n=t[d].read();null!==n&&(t[u]=null,t[o]=null,t[a]=null,e(p(n,!1)))}}function g(t){n.nextTick(f,t)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((r(i={get stream(){return this[d]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(e,i){n.nextTick(function(){t[l]?i(t[l]):e(p(void 0,!0))})});var i,r=this[u];if(r)i=new Promise(function(t,e){return function(n,i){t.then(function(){e[c]?n(p(void 0,!0)):e[h](n,i)},i)}}(r,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(p(s,!1));i=new Promise(this[h])}return this[u]=i,i}},Symbol.asyncIterator,function(){return this}),r(i,"return",function(){var t=this;return new Promise(function(e,n){t[d].destroy(null,function(t){t?n(t):e(p(void 0,!0))})})}),i),m);e.exports=function(t){var e,n=Object.create(b,(r(e={},d,{value:t,writable:!0}),r(e,o,{value:null,writable:!0}),r(e,a,{value:null,writable:!0}),r(e,l,{value:null,writable:!0}),r(e,c,{value:t._readableState.endEmitted,writable:!0}),r(e,h,{value:function(t,e){var i=n[d].read();i?(n[u]=null,n[o]=null,n[a]=null,t(p(i,!1))):(n[o]=t,n[a]=e)},writable:!0}),e));return n[u]=null,s(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[a];return null!==e&&(n[u]=null,n[o]=null,n[a]=null,e(t)),void(n[l]=t)}var i=n[o];null!==i&&(n[u]=null,n[o]=null,n[a]=null,i(p(void 0,!0))),n[c]=!0}),t.on("readable",g.bind(null,n)),n}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":76,_process:44}],74:[function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){for(var n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e=o.allocUnsafe(t>>>0),n=this.head,i=0;n;)c(n.data,e,i),i+=n.data.length,n=n.next;return e}},{key:"consume",value:function(t,e){var n;return tr.length?r.length:t;if(i+=s===r.length?r:r.slice(0,t),0==(t-=s)){s===r.length?(++n,this.head=e.next?e.next:this.tail=null):(this.head=e,e.data=r.slice(s));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),n=this.head,i=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var r=n.data,s=t>r.length?r.length:t;if(r.copy(e,e.length-t,0,s),0==(t-=s)){s===r.length?(++i,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=r.slice(s));break}++i}return this.length-=i,e}},{key:l,value:function(t,e){return a(this,function(t){for(var e=1;e0,function(t){r||(r=t),t&&o.forEach(c),!s&&(o.forEach(c),i(r))})});return e.reduce(u)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(t,e,n){"use strict";var i=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,r){var s=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,r,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(r?n:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},{"../../../errors":67}],80:[function(t,e,n){e.exports=t("events").EventEmitter},{events:8}],81:[function(t,e,n){(n=e.exports=t("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=t("./lib/_stream_writable.js"),n.Duplex=t("./lib/_stream_duplex.js"),n.Transform=t("./lib/_stream_transform.js"),n.PassThrough=t("./lib/_stream_passthrough.js"),n.finished=t("./lib/internal/streams/end-of-stream.js"),n.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}(t("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(t,e,n){"use strict";function i(t){const e=[];let n=0;for(;nt.join("")).join("/")}function r(t,e){let n=e+1;e>=0?"/"===t[e+1]&&"/"===t[e+2]&&(n=e+3):"/"===t[0]&&"/"===t[1]&&(n=2);const r=t.indexOf("/",n);return r<0?t:t.substr(0,r)+i(t.substr(r))}function s(t){return!t||"#"===t||"?"===t||"/"===t}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(t,e){const n=(e=e||"").indexOf("#");if(n>0&&(e=e.substr(0,n)),!t.length){if(e.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);return e}if(t.startsWith("?")){const n=e.indexOf("?");return n>0&&(e=e.substr(0,n)),e+t}if(t.startsWith("#"))return e+t;if(!e.length){const e=t.indexOf(":");if(e<0)throw new Error(`Found invalid relative IRI '${t}' for a missing baseIRI`);return r(t,e)}const s=t.indexOf(":");if(s>=0)return r(t,s);const o=e.indexOf(":");if(o<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);const a=e.substr(0,o+1);if(0===t.indexOf("//"))return a+r(t,s);let l;if(e.indexOf("//",o)===o+1){if(l=e.indexOf("/",o+3),l<0)return e.length>o+3?e+"/"+r(t,s):a+r(t,s)}else if(l=e.indexOf("/",o+1),l<0)return a+r(t,s);if(0===t.indexOf("/"))return e.substr(0,l)+i(t);let c=e.substr(l);const u=c.lastIndexOf("/");return u>=0&&u"===s?(O(e,"onsgmldeclaration",e.sgmlDecl),e.sgmlDecl="",e.state=S.TEXT):(m(s)&&(e.state=S.SGML_DECL_QUOTED),e.sgmlDecl+=s);continue;case S.SGML_DECL_QUOTED:s===e.q&&(e.state=S.SGML_DECL,e.q=""),e.sgmlDecl+=s;continue;case S.DOCTYPE:">"===s?(e.state=S.TEXT,O(e,"ondoctype",e.doctype),e.doctype=!0):(e.doctype+=s,"["===s?e.state=S.DOCTYPE_DTD:m(s)&&(e.state=S.DOCTYPE_QUOTED,e.q=s));continue;case S.DOCTYPE_QUOTED:e.doctype+=s,s===e.q&&(e.q="",e.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:e.doctype+=s,"]"===s?e.state=S.DOCTYPE:m(s)&&(e.state=S.DOCTYPE_DTD_QUOTED,e.q=s);continue;case S.DOCTYPE_DTD_QUOTED:e.doctype+=s,s===e.q&&(e.state=S.DOCTYPE_DTD,e.q="");continue;case S.COMMENT:"-"===s?e.state=S.COMMENT_ENDING:e.comment+=s;continue;case S.COMMENT_ENDING:"-"===s?(e.state=S.COMMENT_ENDED,e.comment=k(e.opt,e.comment),e.comment&&O(e,"oncomment",e.comment),e.comment=""):(e.comment+="-"+s,e.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==s?(I(e,"Malformed comment"),e.comment+="--"+s,e.state=S.COMMENT):e.state=S.TEXT;continue;case S.CDATA:"]"===s?e.state=S.CDATA_ENDING:e.cdata+=s;continue;case S.CDATA_ENDING:"]"===s?e.state=S.CDATA_ENDING_2:(e.cdata+="]"+s,e.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===s?(e.cdata&&O(e,"oncdata",e.cdata),O(e,"onclosecdata"),e.cdata="",e.state=S.TEXT):"]"===s?e.cdata+="]":(e.cdata+="]]"+s,e.state=S.CDATA);continue;case S.PROC_INST:"?"===s?e.state=S.PROC_INST_ENDING:g(s)?e.state=S.PROC_INST_BODY:e.procInstName+=s;continue;case S.PROC_INST_BODY:if(!e.procInstBody&&g(s))continue;"?"===s?e.state=S.PROC_INST_ENDING:e.procInstBody+=s;continue;case S.PROC_INST_ENDING:">"===s?(O(e,"onprocessinginstruction",{name:e.procInstName,body:e.procInstBody}),e.procInstName=e.procInstBody="",e.state=S.TEXT):(e.procInstBody+="?"+s,e.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:y(d,s)?e.tagName+=s:(M(e),">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:(g(s)||I(e,"Invalid character in tag name"),e.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===s?(N(e,!0),L(e)):(I(e,"Forward-slash in opening tag not followed by >"),e.state=S.ATTRIB);continue;case S.ATTRIB:if(g(s))continue;">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:y(h,s)?(e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):I(e,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===s?e.state=S.ATTRIB_VALUE:">"===s?(I(e,"Attribute without value"),e.attribValue=e.attribName,R(e),N(e)):g(s)?e.state=S.ATTRIB_NAME_SAW_WHITE:y(d,s)?e.attribName+=s:I(e,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===s)e.state=S.ATTRIB_VALUE;else{if(g(s))continue;I(e,"Attribute without value"),e.tag.attributes[e.attribName]="",e.attribValue="",O(e,"onattribute",{name:e.attribName,value:""}),e.attribName="",">"===s?N(e):y(h,s)?(e.attribName=s,e.state=S.ATTRIB_NAME):(I(e,"Invalid attribute name"),e.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(g(s))continue;m(s)?(e.q=s,e.state=S.ATTRIB_VALUE_QUOTED):(I(e,"Unquoted attribute value"),e.state=S.ATTRIB_VALUE_UNQUOTED,e.attribValue=s);continue;case S.ATTRIB_VALUE_QUOTED:if(s!==e.q){"&"===s?e.state=S.ATTRIB_VALUE_ENTITY_Q:e.attribValue+=s;continue}R(e),e.q="",e.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:g(s)?e.state=S.ATTRIB:">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:y(h,s)?(I(e,"No whitespace between attributes"),e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):I(e,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!b(s)){"&"===s?e.state=S.ATTRIB_VALUE_ENTITY_U:e.attribValue+=s;continue}R(e),">"===s?N(e):e.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(e.tagName)">"===s?L(e):y(d,s)?e.tagName+=s:e.script?(e.script+=""===s?L(e):I(e,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var a,l;switch(e.state){case S.TEXT_ENTITY:a=S.TEXT,l="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:a=S.ATTRIB_VALUE_QUOTED,l="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:a=S.ATTRIB_VALUE_UNQUOTED,l="attribValue"}";"===s?(e[l]+=j(e),e.entity="",e.state=a):y(e.entity.length?f:p,s)?e.entity+=s:(I(e,"Invalid character in entity name"),e[l]+="&"+e.entity+s,e.entity="",e.state=a);continue;default:throw new Error(e,"Unknown state: "+e.state)}return e.position>=e.bufferCheckPosition&&function(t){for(var e=Math.max(n.MAX_BUFFER_LENGTH,10),i=0,s=0,o=r.length;se)switch(r[s]){case"textNode":T(t);break;case"cdata":O(t,"oncdata",t.cdata),t.cdata="";break;case"script":O(t,"onscript",t.script),t.script="";break;default:A(t,"Max buffer length exceeded: "+r[s])}i=Math.max(i,a)}t.bufferCheckPosition=n.MAX_BUFFER_LENGTH-i+t.position}(e),e},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(t){T(t),""!==t.cdata&&(O(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(O(t,"onscript",t.script),t.script="")}(this)}};try{i=t("stream").Stream}catch(_){i=function(){}}var o=n.EVENTS.filter(function(t){return"error"!==t&&"end"!==t});function a(t,e){if(!(this instanceof a))return new a(t,e);i.apply(this),this._parser=new s(t,e),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(t){n.emit("error",t),n._parser.error=null},this._decoder=null,o.forEach(function(t){Object.defineProperty(n,"on"+t,{get:function(){return n._parser["on"+t]},set:function(e){if(!e)return n.removeAllListeners(t),n._parser["on"+t]=e,e;n.on(t,e)},enumerable:!0,configurable:!1})})}(a.prototype=Object.create(i.prototype,{constructor:{value:a}})).write=function(n){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(n)){if(!this._decoder){var i=t("string_decoder").StringDecoder;this._decoder=new i("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},a.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},a.prototype.on=function(t,e){var n=this;return!n._parser["on"+t]&&-1!==o.indexOf(t)&&(n._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),n.emit.apply(n,e)}),i.prototype.on.call(n,t,e)};var l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",u={xml:l,xmlns:c},h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function m(t){return'"'===t||"'"===t}function b(t){return">"===t||g(t)}function y(t,e){return t.test(e)}function v(t,e){return!y(t,e)}var _,w,x,S=0;for(var E in n.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(t){var e=n.ENTITIES[t],i="number"==typeof e?String.fromCharCode(e):e;n.ENTITIES[t]=i}),n.STATE)n.STATE[n.STATE[E]]=E;function C(t,e,n){t[e]&&t[e](n)}function O(t,e,n){t.textNode&&T(t),C(t,e,n)}function T(t){t.textNode=k(t.opt,t.textNode),t.textNode&&C(t,"ontext",t.textNode),t.textNode=""}function k(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function A(t,e){return T(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,C(t,"onerror",e),t}function P(t){return t.sawRoot&&!t.closedRoot&&I(t,"Unclosed root tag"),t.state!==S.BEGIN&&t.state!==S.BEGIN_WHITESPACE&&t.state!==S.TEXT&&A(t,"Unexpected end"),T(t),t.c="",t.closed=!0,C(t,"onend"),s.call(t,t.strict,t.opt),t}function I(t,e){if("object"!=typeof t||!(t instanceof s))throw new Error("bad call to strictFail");t.strict&&A(t,e)}function M(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,O(t,"onopentagstart",n)}function D(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),i=n[0],r=n[1];return e&&"xmlns"===t&&(i="xmlns",r=""),{prefix:i,local:r}}function R(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=D(t.attribName,!0),n=e.local;if("xmlns"===e.prefix)if("xml"===n&&t.attribValue!==l)I(t,"xml: prefix must be bound to "+l+"\nActual: "+t.attribValue);else if("xmlns"===n&&t.attribValue!==c)I(t,"xmlns: prefix must be bound to "+c+"\nActual: "+t.attribValue);else{var i=t.tag,r=t.tags[t.tags.length-1]||t;i.ns===r.ns&&(i.ns=Object.create(r.ns)),i.ns[n]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,O(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function N(t,e){if(t.opt.xmlns){var n=t.tag,i=D(t.tagName);n.prefix=i.prefix,n.local=i.local,n.uri=n.ns[i.prefix]||"",n.prefix&&!n.uri&&(I(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=i.prefix),n.ns&&(t.tags[t.tags.length-1]||t).ns!==n.ns&&Object.keys(n.ns).forEach(function(e){O(t,"onopennamespace",{prefix:e,uri:n.ns[e]})});for(var r=0,s=t.attribList.length;r",t.tagName="",void(t.state=S.SCRIPT);O(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var i=n;e--&&t.tags[e].name!==i;)I(t,"Unexpected close tag");if(e<0)return I(t,"Unmatched closing tag: "+t.tagName),t.textNode+="",void(t.state=S.TEXT);t.tagName=n;for(var r=t.tags.length;r-- >e;){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,O(t,"onclosetag",t.tagName);var o={};for(var a in s.ns)o[a]=s.ns[a];t.opt.xmlns&&s.ns!==(t.tags[t.tags.length-1]||t).ns&&Object.keys(s.ns).forEach(function(e){O(t,"onclosenamespace",{prefix:e,uri:s.ns[e]})})}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=S.TEXT}function j(t){var e,n=t.entity,i=n.toLowerCase(),r="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[i]?t.ENTITIES[i]:("#"===(n=i).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),r=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),r=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(e)||r.toLowerCase()!==n?(I(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function F(t,e){"<"===e?(t.state=S.OPEN_WAKA,t.startTagPosition=t.position):g(e)||(I(t,"Non-whitespace before first tag."),t.textNode=e,t.state=S.TEXT)}function B(t,e){var n="";return e1114111||w(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?e.push(s):e.push(55296+((s-=65536)>>10),s%1024+56320),(n+1===i||e.length>t)&&(r+=_.apply(null,e),e.length=0)}return r},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:x,configurable:!0,writable:!0}):String.fromCodePoint=x)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,t("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(t,e,n){(function(t,e){(function(){!function(e,n){"use strict";if(!e.setImmediate){var i,r=1,s={},o=!1,a=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick(function(){d(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(c="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(c)&&d(+t.data.slice(c.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),i=function(t){e.postMessage(c+t,"*")}):e.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){d(t.data)},i=function(e){t.port2.postMessage(e)}}():a&&"onreadystatechange"in a.createElement("script")?function(){var t=a.documentElement;i=function(e){var n=a.createElement("script");n.onreadystatechange=function(){d(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():i=function(t){setTimeout(d,0,t)},l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n.setImmediate="function"==typeof e?e:function(t){var e=l++,i=!(arguments.length<2)&&o.call(arguments,1);return a[e]=!0,r(function(){a[e]&&(i?t.apply(null,i):t.call(null),n.clearImmediate(e))}),e},n.clearImmediate="function"==typeof i?i:function(t){delete a[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(t,e,n){(function(t){(function(){function n(e){try{if(!t.localStorage)return!1}catch(i){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(t,e,n){"use strict";e.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},{}],92:[function(t,e,n){"use strict";function i(t){var e=this;if(e instanceof i||(e=new i),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach(function(t){e.push(t)});else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=t(n,i.value,r),i=i.next;return n},i.prototype.reduceReverse=function(t,e){var n,i=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=t(n,i.value,r),i=i.prev;return n},i.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},i.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},i.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new i;if(ethis.length&&(e=this.length);for(var r=0,s=this.head;null!==s&&rthis.length&&(e=this.length);for(var r=this.length,s=this.tail;null!==s&&r>e;r--)s=s.prev;for(;null!==s&&r>t;r--,s=s.prev)n.push(s.value);return n},i.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,s=this.head;null!==s&&i{return(t=n||(n={})).typeOfFunction="function",t.boolTrue=!0,n;var t})();function i(t,e,i){if(!i||typeof i.value!==n.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:n.boolTrue,get:function(){var t=i.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:n.boolTrue,writable:n.boolTrue}),t}}}e.ak=i,e.ZP=i},97266:function(t,e,n){t.exports={ResizeSensor:n(69835),ElementQueries:n(54845)}},54845:function(t,e,n){"use strict";var i,r,s;"undefined"!=typeof window&&window,r=[n(69835)],void 0!==(s="function"==typeof(i=function(t){var e=function(){var e,n={},i=[];function r(t){t||(t=document.documentElement);var e=window.getComputedStyle(t,null).fontSize;return parseFloat(e)||16}function s(t,e){var n=e.split(/\d/),i=n[n.length-1];switch(e=parseFloat(e),i){case"px":return e;case"em":return e*r(t);case"rem":return e*r();case"vw":return e*document.documentElement.clientWidth/100;case"vh":return e*document.documentElement.clientHeight/100;case"vmin":case"vmax":var s=document.documentElement.clientWidth/100,o=document.documentElement.clientHeight/100;return e*(0,Math["vmin"===i?"min":"max"])(s,o);default:return e}}function o(t,e){this.element=t;var i,r,o,a,l,c,u,h,d=["min-width","min-height","max-width","max-height"];this.call=function(){for(i in o=function(t){if(!t.getBoundingClientRect)return{width:t.offsetWidth,height:t.offsetHeight};var e=t.getBoundingClientRect();return{width:Math.round(e.width),height:Math.round(e.height)}}(this.element),c={},n[e])!n[e].hasOwnProperty(i)||(a=s(this.element,(r=n[e][i]).value),l="width"===r.property?o.width:o.height,u="","min"===r.mode&&l>=a&&(u+=r.value),"max"===r.mode&&l<=a&&(u+=r.value),c[h=r.mode+"-"+r.property]||(c[h]=""),u&&-1===(" "+c[h]+" ").indexOf(" "+u+" ")&&(c[h]+=" "+u));for(var t in d)!d.hasOwnProperty(t)||(c[d[t]]?this.element.setAttribute(d[t],c[d[t]].substr(1)):this.element.removeAttribute(d[t]))}}function a(e,n){e.elementQueriesSetupInformation||(e.elementQueriesSetupInformation=new o(e,n)),e.elementQueriesSensor||(e.elementQueriesSensor=new t(e,function(){e.elementQueriesSetupInformation.call()}))}function l(t,r,s,o){if(void 0===n[t]){n[t]=[];var a=i.length;e.innerHTML+="\n"+t+" {animation: 0.1s element-queries;}",e.innerHTML+="\n"+t+" > .resize-sensor {min-width: "+a+"px;}",i.push(t)}n[t].push({mode:r,property:s,value:o})}function c(t){var e;if(document.querySelectorAll&&(e=t?t.querySelectorAll.bind(t):document.querySelectorAll.bind(document)),!e&&"undefined"!=typeof $$&&(e=$$),!e&&"undefined"!=typeof jQuery&&(e=jQuery),!e)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return e}function u(e){var n=[],i=[],r=[],s=0,o=-1,a=[];for(var l in e.children)if(e.children.hasOwnProperty(l)&&e.children[l].tagName&&"img"===e.children[l].tagName.toLowerCase()){n.push(e.children[l]);var c=e.children[l].getAttribute("min-width")||e.children[l].getAttribute("data-min-width"),u=e.children[l].getAttribute("data-src")||e.children[l].getAttribute("url");r.push(u),i.push({minWidth:c}),c?e.children[l].style.display="none":(s=n.length-1,e.children[l].style.display="block")}function h(){var t,l=!1;for(t in n)!n.hasOwnProperty(t)||i[t].minWidth&&e.offsetWidth>i[t].minWidth&&(l=t);if(l||(l=s),o!==l)if(a[l])n[o].style.display="none",n[l].style.display="block",o=l;else{var c=new Image;c.onload=function(){n[l].src=r[l],n[o].style.display="none",n[l].style.display="block",a[l]=!0,o=l},c.src=r[l]}else n[l].src=r[l]}o=s,e.resizeSensorInstance=new t(e,h),h()}var h=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,d=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function p(t){var e,n,i,r;for(t=t.replace(/'/g,'"');null!==(e=h.exec(t));)for(n=e[1]+e[3],i=e[2];null!==(r=d.exec(i));)l(n,r[1],r[2],r[3])}function f(t){var e="";if(t)if("string"==typeof t)(-1!==(t=t.toLowerCase()).indexOf("min-width")||-1!==t.indexOf("max-width"))&&p(t);else for(var n=0,i=t.length;n img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",e.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(e),g=!0);for(var r=0,s=document.styleSheets.length;r0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,console&&console.warn&&console.warn(a)}return t}function O(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function T(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=O.bind(i);return r.listener=n,i.wrapFn=r,r}function k(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=r[t];if(void 0===a)return!1;if("function"==typeof a)v(a,this,e);else{var l=a.length,c=P(a,l);for(n=0;n=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},w.prototype.listeners=function(t){return k(this,t,!0)},w.prototype.rawListeners=function(t){return k(this,t,!1)},w.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):A.call(t,e)},w.prototype.listenerCount=A,w.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]},M.prototype.next=function(){if(this.done)return{done:!0};var t=this._next();return t.done&&(this.done=!0),t},"undefined"!=typeof Symbol&&(M.prototype[Symbol.iterator]=function(){return this}),M.of=function(){var t=arguments,e=t.length,n=0;return new M(function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}})},M.empty=function(){var t=new M(null);return t.done=!0,t},M.is=function(t){return t instanceof M||"object"==typeof t&&null!==t&&"function"==typeof t.next};var D=M,R=function(t,e){for(var n,i=arguments.length>1?e:1/0,r=i!==1/0?new Array(i):[],s=0;;){if(s===i)return r;if((n=t.next()).done)return s!==e?r.slice(0,s):r;r[s++]=n.value}},N=function(t){function n(e,n){var i;return(i=t.call(this)||this).name="GraphError",i.message=e||"",i.data=n||{},i}return e(n,t),n}(o(Error)),L=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N),j=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N),F=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N);function B(t,e){this.key=t,this.attributes=e,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function V(t,e){this.key=t,this.attributes=e,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function z(t,e){this.key=t,this.attributes=e,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function U(t,e,n,i,r,s){this.key=e,this.attributes=s,this.undirected=t,this.source=i,this.target=r,this.generatedKey=n}function H(t,e,n,i,r,s,o){var a,l,c="out",u="in";if(e&&(c=u="undirected"),t.multi){if(void 0===(l=(a=s[c])[r])&&(l=new Set,a[r]=l),l.add(n),i===r&&e)return;void 0===(a=o[u])[i]&&(a[i]=l)}else{if(s[c][r]=n,i===r&&e)return;o[u][i]=n}}function $(t,e,n){var i=t.multi,r=n.source,s=n.target,o=r.key,a=s.key,l=r[e?"undirected":"out"],c=e?"undirected":"in";if(a in l)if(i){var u=l[a];1===u.size?(delete l[a],delete s[c][o]):u.delete(n)}else delete l[a];i||delete s[c][o]}V.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},z.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var G=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes[i]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var r=""+t,s=""+arguments[1];if(!(i=c(this,r,s,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(r,'" - "').concat(s,'").'))}else if(!(i=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes.hasOwnProperty(i)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+i;if(i=arguments[2],r=arguments[3],!(s=c(this,o,a,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(s=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&s.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return s.attributes[i]=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+i;if(i=arguments[2],r=arguments[3],!(s=c(this,o,a,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(s=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("function"!=typeof r)throw new L("Graph.".concat(e,": updater should be a function."));if("mixed"!==n&&s.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return s.attributes[i]=r(s.attributes[i]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return delete r.attributes[i],this.emit("edgeAttributesUpdated",{key:r.key,type:"remove",attributes:r.attributes,name:i}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(e,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes=i,this.emit("edgeAttributesUpdated",{key:r.key,type:"replace",attributes:r.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(e,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return l(r.attributes,i),this.emit("edgeAttributesUpdated",{key:r.key,type:"merge",attributes:r.attributes,data:i}),this}}}],W=D,q=function(){var t,e=arguments,n=-1;return new W(function i(){if(!t){if(++n>=e.length)return{done:!0};t=e[n]}var r=t.next();return r.done?(t=null,i()):r})},X=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Y(t,e){for(var n in e)t.push(e[n].key)}function K(t,e){for(var n in e)e[n].forEach(function(e){return t.push(e.key)})}function Q(t,e,n){for(var i in t)if(i!==n){var r=t[i];e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey)}}function Z(t,e,n){for(var i in t)i!==n&&t[i].forEach(function(t){return e(t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes,t.undirected,t.generatedKey)})}function J(t,e,n){for(var i in t)if(i!==n){var r=t[i];if(e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey))return!0}return!1}function tt(t,e,n){var i,r,s,o,a;for(var l in t)if(l!==n)for(i=t[l].values();!0!==(r=i.next()).done;)if(o=(s=r.value).source,e(s.key,s.attributes,o.key,(a=s.target).key,o.attributes,a.attributes,s.undirected,s.generatedKey))return!0;return!1}function et(t,e){var n=Object.keys(t),i=n.length,r=null,s=0;return new D(function o(){var a;if(r){var l=r.next();if(l.done)return r=null,s++,o();a=l.value}else{if(s>=i)return{done:!0};var c=n[s];if(c===e)return s++,o();if((a=t[c])instanceof Set)return r=a.values(),o();s++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}})}function nt(t,e,n){var i=e[n];i&&t.push(i.key)}function it(t,e,n){var i=e[n];i&&i.forEach(function(e){return t.push(e.key)})}function rt(t,e,n){var i=t[e];if(i){var r=i.source,s=i.target;n(i.key,i.attributes,r.key,s.key,r.attributes,s.attributes,i.undirected,i.generatedKey)}}function st(t,e,n){var i=t[e];i&&i.forEach(function(t){return n(t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes,t.undirected,t.generatedKey)})}function ot(t,e,n){var i=t[e];if(i){var r=i.source,s=i.target;return n(i.key,i.attributes,r.key,s.key,r.attributes,s.attributes,i.undirected,i.generatedKey)}}function at(t,e,n){var i=t[e];if(i){for(var r,s,o=i.values();!0!==(r=o.next()).done;)if(n((s=r.value).key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected,s.generatedKey))return!0;return!1}}function lt(t,e){var n=t[e];if(n instanceof Set){var i=n.values();return new D(function(){var t=i.next();if(t.done)return t;var e=t.value;return{done:!1,value:[e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes]}})}return D.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ct(t,e){if(0===t.size)return[];if("mixed"===e||e===t.type)return"function"==typeof Array.from?Array.from(t._edges.keys()):R(t._edges.keys(),t._edges.size);for(var n,i,r=new Array("undirected"===e?t.undirectedSize:t.directedSize),s="undirected"===e,o=t._edges.values(),a=0;!0!==(n=o.next()).done;)(i=n.value).undirected===s&&(r[a++]=i.key);return r}function ut(t,e,n){if(0!==t.size)for(var i,r,s="mixed"!==e&&e!==t.type,o="undirected"===e,a=t._edges.values();!0!==(i=a.next()).done;)if(r=i.value,!s||r.undirected===o){var l=r.source,c=r.target;n(r.key,r.attributes,l.key,c.key,l.attributes,c.attributes,r.undirected,r.generatedKey)}}function ht(t,e,n){if(0!==t.size)for(var i,r,s="mixed"!==e&&e!==t.type,o="undirected"===e,a=t._edges.values();!0!==(i=a.next()).done;)if(r=i.value,!s||r.undirected===o){var l=r.source,c=r.target;if(n(r.key,r.attributes,l.key,c.key,l.attributes,c.attributes,r.undirected,r.generatedKey))break}}function dt(t,e){if(0===t.size)return D.empty();var n="mixed"!==e&&e!==t.type,i="undirected"===e,r=t._edges.values();return new D(function(){for(var t,e;;){if((t=r.next()).done)return t;if(e=t.value,!n||e.undirected===i)break}return{value:[e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes],done:!1}})}function pt(t,e,n,i){var r=[],s=t?K:Y;return"undirected"!==e&&("out"!==n&&s(r,i.in),"in"!==n&&s(r,i.out),!n&&i.directedSelfLoops>0&&r.splice(r.lastIndexOf(i.key),1)),"directed"!==e&&s(r,i.undirected),r}function ft(t,e,n,i,r){var s=t?Z:Q;"undirected"!==e&&("out"!==n&&s(i.in,r),"in"!==n&&s(i.out,r,n?null:i.key)),"directed"!==e&&s(i.undirected,r)}function gt(t,e,n,i,r){var s=t?tt:J;"undirected"!==e&&("out"!==n&&s(i.in,r)||"in"!==n&&s(i.out,r,n?null:i.key))||"directed"===e||s(i.undirected,r)}function mt(t,e,n){var i=D.empty();return"undirected"!==t&&("out"!==e&&void 0!==n.in&&(i=q(i,et(n.in))),"in"!==e&&void 0!==n.out&&(i=q(i,et(n.out,e?null:n.key)))),"directed"!==t&&void 0!==n.undirected&&(i=q(i,et(n.undirected))),i}function bt(t,e,n,i,r){var s=e?it:nt,o=[];return"undirected"!==t&&(void 0!==i.in&&"out"!==n&&s(o,i.in,r),void 0!==i.out&&"in"!==n&&s(o,i.out,r),!n&&i.directedSelfLoops>0&&o.splice(o.lastIndexOf(i.key),1)),"directed"!==t&&void 0!==i.undirected&&s(o,i.undirected,r),o}function yt(t,e,n,i,r,s){var o=e?st:rt;"undirected"!==t&&(void 0!==i.in&&"out"!==n&&o(i.in,r,s),i.key!==r&&void 0!==i.out&&"in"!==n&&o(i.out,r,s)),"directed"!==t&&void 0!==i.undirected&&o(i.undirected,r,s)}function vt(t,e,n,i,r,s){var o=e?at:ot;"undirected"!==t&&(void 0!==i.in&&"out"!==n&&o(i.in,r,s)||i.key!==r&&void 0!==i.out&&"in"!==n&&o(i.out,r,s,n?null:i.key))||"directed"===t||void 0===i.undirected||o(i.undirected,r,s)}function _t(t,e,n,i){var r=D.empty();return"undirected"!==t&&(void 0!==n.in&&"out"!==e&&i in n.in&&(r=q(r,lt(n.in,i))),void 0!==n.out&&"in"!==e&&i in n.out&&(r=q(r,lt(n.out,i)))),"directed"!==t&&void 0!==n.undirected&&i in n.undirected&&(r=q(r,lt(n.undirected,i))),r}var wt=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xt(t,e){if(void 0!==e)for(var n in e)t.add(n)}function St(t,e,n){if("mixed"!==t){if("undirected"===t)return Object.keys(n.undirected);if("string"==typeof e)return Object.keys(n[e])}var i=new Set;return"undirected"!==t&&("out"!==e&&xt(i,n.in),"in"!==e&&xt(i,n.out)),"directed"!==t&&xt(i,n.undirected),R(i.values(),i.size)}function Et(t,e,n){for(var i in e){var r=e[i];r instanceof Set&&(r=r.values().next().value);var s=r.source,o=s===t?r.target:s;n(o.key,o.attributes)}}function Ct(t,e,n,i){for(var r in n){var s=n[r];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===e?s.target:o;t.has(a.key)||(t.add(a.key),i(a.key,a.attributes))}}function Ot(t,e,n){for(var i in e){var r=e[i];r instanceof Set&&(r=r.values().next().value);var s=r.source,o=s===t?r.target:s;if(n(o.key,o.attributes))return!0}return!1}function Tt(t,e,n,i){for(var r in n){var s=n[r];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===e?s.target:o;if(!t.has(a.key)&&(t.add(a.key),i(a.key,a.attributes)))return!0}return!1}function kt(t,e){var n=Object.keys(e),i=n.length,r=0;return new D(function(){if(r>=i)return{done:!0};var s=e[n[r++]];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===t?s.target:o;return{done:!1,value:[a.key,a.attributes]}})}function At(t,e,n){var i=Object.keys(n),r=i.length,s=0;return new D(function o(){if(s>=r)return{done:!0};var a=n[i[s++]];a instanceof Set&&(a=a.values().next().value);var l=a.source,c=l===e?a.target:l;return t.has(c.key)?o():(t.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function Pt(t,e,n,i,r){var s=t._nodes.get(i);if("undirected"!==e){if("out"!==n&&void 0!==s.in)for(var o in s.in)if(o===r)return!0;if("in"!==n&&void 0!==s.out)for(var a in s.out)if(a===r)return!0}if("directed"!==e&&void 0!==s.undirected)for(var l in s.undirected)if(l===r)return!0;return!1}function It(t,e,n){for(var i,r,s,o,a,l,c,u=e._nodes.values(),h=e.type;!0!==(i=u.next()).done;){if(r=i.value,"undirected"!==h)for(s in o=r.out)if(l=(a=o[s]).target,c=n(r.key,l.key,r.attributes,l.attributes,a.key,a.attributes,a.undirected,a.generatedKey),t&&c)return;if("directed"!==h)for(s in o=r.undirected)if((l=(a=o[s]).target).key!==s&&(l=a.source),c=n(r.key,l.key,r.attributes,l.attributes,a.key,a.attributes,a.undirected,a.generatedKey),t&&c)return}}function Mt(t,e,n){for(var i,r,s,o,a,l,c,u,h,d=e._nodes.values(),p=e.type;!0!==(i=d.next()).done;){if(r=i.value,"undirected"!==p)for(s in l=r.out)for(o=l[s].values();!0!==(a=o.next()).done;)if(u=(c=a.value).target,h=n(r.key,u.key,r.attributes,u.attributes,c.key,c.attributes,c.undirected,c.generatedKey),t&&h)return;if("directed"!==p)for(s in l=r.undirected)for(o=l[s].values();!0!==(a=o.next()).done;)if((u=(c=a.value).target).key!==s&&(u=c.source),h=n(r.key,u.key,r.attributes,u.attributes,c.key,c.attributes,c.undirected,c.generatedKey),t&&h)return}}function Dt(t,e){var n={key:t};return d(e.attributes)||(n.attributes=l({},e.attributes)),n}function Rt(t,e){var n={source:e.source.key,target:e.target.key};return e.generatedKey||(n.key=t),d(e.attributes)||(n.attributes=l({},e.attributes)),e.undirected&&(n.undirected=!0),n}function Nt(t){return h(t)?"key"in t?!("attributes"in t)||h(t.attributes)&&null!==t.attributes?null:"invalid-attributes":"no-key":"not-object"}function Lt(t){return h(t)?"source"in t?"target"in t?!("attributes"in t)||h(t.attributes)&&null!==t.attributes?"undirected"in t&&"boolean"!=typeof t.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var jt=new Set(["directed","undirected","mixed"]),Ft=new Set(["domain","_events","_eventsCount","_maxListeners"]),Bt={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Vt(t,e,n){var i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}function zt(t,e,n,i,r,s,o,a){if(!i&&"undirected"===t.type)throw new F("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===t.type)throw new F("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a&&!h(a))throw new L("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(a,'"'));if(s=""+s,o=""+o,a=a||{},!t.allowSelfLoops&&s===o)throw new F("Graph.".concat(e,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l=t._nodes.get(s),c=t._nodes.get(o);if(!l)throw new j("Graph.".concat(e,': source node "').concat(s,'" not found.'));if(!c)throw new j("Graph.".concat(e,': target node "').concat(o,'" not found.'));var u={key:null,undirected:i,source:s,target:o,attributes:a};if(n&&(r=t._edgeKeyGenerator(u)),t._edges.has(r=""+r))throw new F("Graph.".concat(e,': the "').concat(r,'" edge already exists in the graph.'));if(!t.multi&&(i?void 0!==l.undirected[o]:void 0!==l.out[o]))throw new F("Graph.".concat(e,': an edge linking "').concat(s,'" to "').concat(o,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var d=new U(i,r,n,l,c,a);return t._edges.set(r,d),s===o?i?(l.undirectedSelfLoops++,t._undirectedSelfLoopCount++):(l.directedSelfLoops++,t._directedSelfLoopCount++):i?(l.undirectedDegree++,c.undirectedDegree++):(l.outDegree++,c.inDegree++),H(t,i,d,s,o,l,c),i?t._undirectedSize++:t._directedSize++,u.key=r,t.emit("edgeAdded",u),r}function Ut(t,e,n,i,r,s,o,a,c){if(!i&&"undirected"===t.type)throw new F("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===t.type)throw new F("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a)if(c){if("function"!=typeof a)throw new L("Graph.".concat(e,': invalid updater function. Expecting a function but got "').concat(a,'"'))}else if(!h(a))throw new L("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(a,'"'));var u;if(s=""+s,o=""+o,c&&(u=a,a=void 0),!t.allowSelfLoops&&s===o)throw new F("Graph.".concat(e,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,p,f=t._nodes.get(s),g=t._nodes.get(o);if(!n&&(d=t._edges.get(r))){if(d.source.key!==s||d.target.key!==o||i&&(d.source.key!==o||d.target.key!==s))throw new F("Graph.".concat(e,': inconsistency detected when attempting to merge the "').concat(r,'" edge with "').concat(s,'" source & "').concat(o,'" target vs. ("').concat(d.source.key,'", "').concat(d.target.key,'").'));p=d}if(p||t.multi||!f||(p=i?f.undirected[o]:f.out[o]),p)return(c?u:a)?(c?(p.attributes=u(p.attributes),t.emit("edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})):(l(p.attributes,a),t.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:a})),p.key):p.key;a=a||{},c&&u&&(a=u(a));var m={key:null,undirected:i,source:s,target:o,attributes:a};if(n&&(r=t._edgeKeyGenerator(m)),t._edges.has(r=""+r))throw new F("Graph.".concat(e,': the "').concat(r,'" edge already exists in the graph.'));return f||(f=Vt(t,s,{}),s===o&&(g=f)),g||(g=Vt(t,o,{})),d=new U(i,r,n,f,g,a),t._edges.set(r,d),s===o?i?(f.undirectedSelfLoops++,t._undirectedSelfLoopCount++):(f.directedSelfLoops++,t._directedSelfLoopCount++):i?(f.undirectedDegree++,g.undirectedDegree++):(f.outDegree++,g.inDegree++),H(t,i,d,s,o,f,g),i?t._undirectedSize++:t._directedSize++,m.key=r,t.emit("edgeAdded",m),r}var Ht,$t=function(t){function n(e){var n;if(n=t.call(this)||this,(e=l({},Bt,e)).edgeKeyGenerator&&"function"!=typeof e.edgeKeyGenerator)throw new L("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(e.edgeKeyGenerator,'".'));if("boolean"!=typeof e.multi)throw new L("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(e.multi,'".'));if(!jt.has(e.type))throw new L('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(e.type,'".'));if("boolean"!=typeof e.allowSelfLoops)throw new L("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(e.allowSelfLoops,'".'));var i,r="mixed"===e.type?B:"directed"===e.type?V:z;return p(a(n),"NodeDataClass",r),p(a(n),"_attributes",{}),p(a(n),"_nodes",new Map),p(a(n),"_edges",new Map),p(a(n),"_directedSize",0),p(a(n),"_undirectedSize",0),p(a(n),"_directedSelfLoopCount",0),p(a(n),"_undirectedSelfLoopCount",0),p(a(n),"_edgeKeyGenerator",e.edgeKeyGenerator||(i=0,function(){return i++})),p(a(n),"_options",e),Ft.forEach(function(t){return p(a(n),t,n[t])}),f(a(n),"order",function(){return n._nodes.size}),f(a(n),"size",function(){return n._edges.size}),f(a(n),"directedSize",function(){return n._directedSize}),f(a(n),"undirectedSize",function(){return n._undirectedSize}),f(a(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),f(a(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),f(a(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),f(a(n),"multi",n._options.multi),f(a(n),"type",n._options.type),f(a(n),"allowSelfLoops",n._options.allowSelfLoops),f(a(n),"implementation",function(){return"graphology"}),n}e(n,t);var i=n.prototype;return i.hasNode=function(t){return this._nodes.has(""+t)},i.hasDirectedEdge=function(t,e){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+t);return!!n&&!n.undirected}if(2===arguments.length){e=""+e;var i=this._nodes.get(t=""+t);if(!i)return!1;var r=i.out[e];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(t,e){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+t);return!!n&&n.undirected}if(2===arguments.length){e=""+e;var i=this._nodes.get(t=""+t);if(!i)return!1;var r=i.undirected[e];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(t,e){if(1===arguments.length)return this._edges.has(""+t);if(2===arguments.length){e=""+e;var n=this._nodes.get(t=""+t);if(!n)return!1;var i=void 0!==n.out&&n.out[e];return i||(i=void 0!==n.undirected&&n.undirected[e]),!(!i||this.multi&&!i.size)}throw new L("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(t,e){if("undirected"!==this.type){if(t=""+t,e=""+e,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(t);if(!n)throw new j('Graph.directedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.directedEdge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.out&&n.out[e]||void 0;return i?i.key:void 0}},i.undirectedEdge=function(t,e){if("directed"!==this.type){if(t=""+t,e=""+e,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(t);if(!n)throw new j('Graph.undirectedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.undirectedEdge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.undirected&&n.undirected[e]||void 0;return i?i.key:void 0}},i.edge=function(t,e){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e;var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.edge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.edge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.out&&n.out[e]||n.undirected&&n.undirected[e]||void 0;if(i)return i.key},i.inDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.inDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.inDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(e?n.directedSelfLoops:0)},i.outDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.outDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.outDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(e?n.directedSelfLoops:0)},i.directedDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.directedDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.directedDegree: could not find the "'.concat(t,'" node in the graph.'));if("undirected"===this.type)return 0;var i=e?n.directedSelfLoops:0;return n.inDegree+i+(n.outDegree+i)},i.undirectedDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.undirectedDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.undirectedDegree: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(e?n.undirectedSelfLoops:0)},i.degree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.degree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.degree: could not find the "'.concat(t,'" node in the graph.'));var i=0,r=0;return"directed"!==this.type&&(e&&(r=n.undirectedSelfLoops),i+=n.undirectedDegree+2*r),"undirected"!==this.type&&(e&&(r=n.directedSelfLoops),i+=n.inDegree+n.outDegree+2*r),i},i.source=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.source: could not find the "'.concat(t,'" edge in the graph.'));return e.source.key},i.target=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.target: could not find the "'.concat(t,'" edge in the graph.'));return e.target.key},i.extremities=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.extremities: could not find the "'.concat(t,'" edge in the graph.'));return[e.source.key,e.target.key]},i.opposite=function(t,e){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new j('Graph.opposite: could not find the "'.concat(e,'" edge in the graph.'));var i=n.source.key,r=n.target.key;if(t!==i&&t!==r)throw new j('Graph.opposite: the "'.concat(t,'" node is not attached to the "').concat(e,'" edge (').concat(i,", ").concat(r,")."));return t===i?r:i},i.hasExtremity=function(t,e){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new j('Graph.hasExtremity: could not find the "'.concat(t,'" edge in the graph.'));return n.source.key===e||n.target.key===e},i.isUndirected=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isUndirected: could not find the "'.concat(t,'" edge in the graph.'));return e.undirected},i.isDirected=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isDirected: could not find the "'.concat(t,'" edge in the graph.'));return!e.undirected},i.isSelfLoop=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isSelfLoop: could not find the "'.concat(t,'" edge in the graph.'));return e.source===e.target},i.hasGeneratedKey=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.hasGeneratedKey: could not find the "'.concat(t,'" edge in the graph.'));return e.generatedKey},i.addNode=function(t,e){return function(t,e,n){if(n&&!h(n))throw new L('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},t._nodes.has(e=""+e))throw new F('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}(this,t,e).key},i.mergeNode=function(t,e){if(e&&!h(e))throw new L('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(e,'"'));e=e||{};var n=this._nodes.get(t=""+t);return n?(e&&(l(n.attributes,e),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:n.attributes,data:e})),t):(n=new this.NodeDataClass(t,e),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:e}),t)},i.updateNode=function(t,e){if(e&&"function"!=typeof e)throw new L('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(e,'"'));var n=this._nodes.get(t=""+t);if(n)return e&&(n.attributes=e(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:n.attributes})),t;var i=e?e({}):{};return n=new this.NodeDataClass(t,i),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:i}),t},i.dropNode=function(t){var e=this,n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.dropNode: could not find the "'.concat(t,'" node in the graph.'));this.forEachEdge(t,function(t){e.dropEdge(t)}),this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})},i.dropEdge=function(t){var e;if(arguments.length>1){var n=""+arguments[0],i=""+arguments[1];if(!(e=c(this,n,i,this.type)))throw new j('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(i,'" edge in the graph.'))}else if(!(e=this._edges.get(t=""+t)))throw new j('Graph.dropEdge: could not find the "'.concat(t,'" edge in the graph.'));this._edges.delete(e.key);var r=e.source,s=e.target,o=e.attributes,a=e.undirected;return r===s?a?(r.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(r.directedSelfLoops--,this._directedSelfLoopCount--):a?(r.undirectedDegree--,s.undirectedDegree--):(r.outDegree--,s.inDegree--),$(this,a,e),a?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:t,attributes:o,source:r.key,target:s.key,undirected:a}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(t){return this._attributes[t]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(t){return this._attributes.hasOwnProperty(t)},i.setAttribute=function(t,e){return this._attributes[t]=e,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.updateAttribute=function(t,e){if("function"!=typeof e)throw new L("Graph.updateAttribute: updater should be a function.");return this._attributes[t]=e(this._attributes[t]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.removeAttribute=function(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this},i.replaceAttributes=function(t){if(!h(t))throw new L("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(t){if(!h(t))throw new L("Graph.mergeAttributes: provided attributes are not a plain object.");return l(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this},i.getNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.getNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return n.attributes[e]},i.getNodeAttributes=function(t){var e=this._nodes.get(t=""+t);if(!e)throw new j('Graph.getNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));return e.attributes},i.hasNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return n.attributes.hasOwnProperty(e)},i.setNodeAttribute=function(t,e,n){var i=this._nodes.get(t=""+t);if(!i)throw new j('Graph.setNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return i.attributes[e]=n,this.emit("nodeAttributesUpdated",{key:t,type:"set",attributes:i.attributes,name:e}),this},i.updateNodeAttribute=function(t,e,n){var i=this._nodes.get(t=""+t);if(!i)throw new j('Graph.updateNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new L("Graph.updateAttribute: updater should be a function.");var r=i.attributes,s=n(r[e]);return r[e]=s,this.emit("nodeAttributesUpdated",{key:t,type:"set",attributes:i.attributes,name:e}),this},i.removeNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return delete n.attributes[e],this.emit("nodeAttributesUpdated",{key:t,type:"remove",attributes:n.attributes,name:e}),this},i.replaceNodeAttributes=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.replaceNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));if(!h(e))throw new L("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=e,this.emit("nodeAttributesUpdated",{key:t,type:"replace",attributes:n.attributes}),this},i.mergeNodeAttributes=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.mergeNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));if(!h(e))throw new L("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return l(n.attributes,e),this.emit("nodeAttributesUpdated",{key:t,type:"merge",attributes:n.attributes,data:e}),this},i.updateEachNodeAttributes=function(t,e){if("function"!=typeof t)throw new L("Graph.updateEachNodeAttributes: expecting an updater function.");if(e&&!g(e))throw new L("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._nodes.values();!0!==(n=r.next()).done;)(i=n.value).attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:e||null})},i.updateEachEdgeAttributes=function(t,e){if("function"!=typeof t)throw new L("Graph.updateEachEdgeAttributes: expecting an updater function.");if(e&&!g(e))throw new L("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._edges.values();!0!==(n=r.next()).done;)(i=n.value).attributes=t(i.key,i.attributes);this.emit("eachEdgeAttributesUpdated",{hints:e||null})},i.forEach=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?Mt(!1,this,t):It(!1,this,t)},i.forEachUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?Mt(!0,this,t):It(!0,this,t)},i.adjacency=function(){return this.multi?(p=(l=this)._nodes.values(),f=l.type,g="outer",m=null,new D(function t(){var e;if("outer"===g)return!0===(e=p.next()).done?e:(c=e.value,g="directed",t());if("directed"===g)return"undirected"===f?(g="undirected",t()):(h=c.out,u=Object.keys(c.out),d=0,g="inner-directed",t());if("undirected"===g){if("directed"===f)return g="outer",t();h=c.undirected,u=Object.keys(c.undirected),d=0,g="inner-undirected"}if(!m&&d>=u.length)return g="inner-undirected"===g?"outer":"undirected",t();if(!m){var n=u[d++];return m=h[n].values(),t()}if((e=m.next()).done)return m=null,t();var i=e.value,r=i.target;return"inner-undirected"===g&&r.key===c.key&&(r=i.source),{done:!1,value:[c.key,r.key,c.attributes,r.attributes,i.key,i.attributes]}})):(s=(t=this)._nodes.values(),o=t.type,a="outer",new D(function t(){var l;if("outer"===a)return!0===(l=s.next()).done?l:(e=l.value,a="directed",t());if("directed"===a)return"undirected"===o?(a="undirected",t()):(i=e.out,n=Object.keys(e.out),r=0,a="inner-directed",t());if("undirected"===a){if("directed"===o)return a="outer",t();i=e.undirected,n=Object.keys(e.undirected),r=0,a="inner-undirected"}if(r>=n.length)return a="inner-undirected"===a?"outer":"undirected",t();var c=n[r++],u=i[c],h=u.target;return"inner-undirected"===a&&h.key===e.key&&(h=u.source),{done:!1,value:[e.key,h.key,e.attributes,h.attributes,u.key,u.attributes]}}));var t,e,n,i,r,s,o,a,l,c,u,h,d,p,f,g,m},i.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):R(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(t){if("function"!=typeof t)throw new L("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(e,n){t(n,e.attributes)})},i.forEachNodeUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEachNode: expecting a callback.");for(var e,n,i=this._nodes.values();!0!==(e=i.next())&&!t((n=e.value).key,n.attributes););},i.nodeEntries=function(){var t=this._nodes.values();return new D(function(){var e=t.next();if(e.done)return e;var n=e.value;return{value:[n.key,n.attributes],done:!1}})},i.exportNode=function(t){var e=this._nodes.get(t=""+t);if(!e)throw new j('Graph.exportNode: could not find the "'.concat(t,'" node in the graph.'));return Dt(t,e)},i.exportEdge=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.exportEdge: could not find the "'.concat(t,'" edge in the graph.'));return Rt(t,e)},i.export=function(){var t=new Array(this._nodes.size),e=0;this._nodes.forEach(function(n,i){t[e++]=Dt(i,n)});var n=new Array(this._edges.size);return e=0,this._edges.forEach(function(t,i){n[e++]=Rt(i,t)}),{attributes:this.getAttributes(),nodes:t,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},i.importNode=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Nt(t);if(n){if("not-object"===n)throw new L('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new L("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new L("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var i=t.key,r=t.attributes,s=void 0===r?{}:r;return e?this.mergeNode(i,s):this.addNode(i,s),this},i.importEdge=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Lt(t);if(n){if("not-object"===n)throw new L('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new L("Graph.importEdge: missing souce.");if("no-target"===n)throw new L("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new L("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new L("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var i=t.source,r=t.target,s=t.attributes,o=void 0===s?{}:s,a=t.undirected,l=void 0!==a&&a;return"key"in t?(e?l?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:l?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,t.key,i,r,o):(e?l?this.mergeUndirectedEdge:this.mergeDirectedEdge:l?this.addUndirectedEdge:this.addDirectedEdge).call(this,i,r,o),this},i.import=function(t){var e,n,i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u(t))return this.import(t.export(),r),this;if(!h(t))throw new L("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!h(t.attributes))throw new L("Graph.import: invalid attributes. Expecting a plain object.");r?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new L("Graph.import: invalid nodes. Expecting an array.");for(e=0,n=i.length;en)){var o=new Set;o.add(e.undirected[s]),e.undirected[s]=o,t._nodes.get(s).undirected[n]=o}})),this;var t},i.clearIndex=function(){return this._nodes.forEach(function(t){void 0!==t.in&&(t.in={},t.out={}),void 0!==t.undirected&&(t.undirected={})}),this},i.toJSON=function(){return this.export()},i.toString=function(){return"[object Graph]"},i.inspect=function(){var t=this,e={};this._nodes.forEach(function(t,n){e[n]=t.attributes});var n={},i={};this._edges.forEach(function(e,r){var s=e.undirected?"--":"->",o="",a="(".concat(e.source.key,")").concat(s,"(").concat(e.target.key,")");e.generatedKey?t.multi&&(void 0===i[a]?i[a]=0:i[a]++,o+="".concat(i[a],". ")):o+="[".concat(r,"]: "),n[o+=a]=e.attributes});var r={};for(var s in this)this.hasOwnProperty(s)&&!Ft.has(s)&&"function"!=typeof this[s]&&(r[s]=this[s]);return r.attributes=this._attributes,r.nodes=e,r.edges=n,p(r,"constructor",this.constructor),r},n}(b.exports.EventEmitter);"undefined"!=typeof Symbol&&($t.prototype[Symbol.for("nodejs.util.inspect.custom")]=$t.prototype.inspect),[{name:function(t){return"".concat(t,"Edge")},generateKey:!0},{name:function(t){return"".concat(t,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(t){return"".concat(t,"EdgeWithKey")}},{name:function(t){return"".concat(t,"DirectedEdgeWithKey")},type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(t){["add","merge","update"].forEach(function(e){var n=t.name(e),i="add"===e?zt:Ut;$t.prototype[n]=t.generateKey?function(r,s,o){return i(this,n,!0,"undirected"===(t.type||this.type),null,r,s,o,"update"===e)}:function(r,s,o,a){return i(this,n,!1,"undirected"===(t.type||this.type),r,s,o,a,"update"===e)}})}),"undefined"!=typeof Symbol&&($t.prototype[Symbol.iterator]=$t.prototype.adjacency),Ht=$t,G.forEach(function(t){var e=t.name,n=t.attacher;n(Ht,e("Edge"),"mixed"),n(Ht,e("DirectedEdge"),"directed"),n(Ht,e("UndirectedEdge"),"undirected")}),function(t){X.forEach(function(e){var n,i,r,s;r=(n=e).type,s=n.direction,t.prototype[i=n.name]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return ct(this,r);if(1===arguments.length){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));return pt(this.multi,"mixed"===r?this.type:r,s,n)}if(2===arguments.length){e=""+e;var o=this._nodes.get(t=""+t);if(!o)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(i,': could not find the "').concat(e,'" target node in the graph.'));return bt(r,this.multi,s,o,e)}throw new L("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(t,e,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return ut(this,i,n=t);if(2===arguments.length){n=e;var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));return ft(this.multi,"mixed"===i?this.type:i,r,o,n)}if(3===arguments.length){e=""+e;var a=this._nodes.get(t=""+t);if(!a)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(s,': could not find the "').concat(e,'" target node in the graph.'));return yt(i,this.multi,r,a,e,n)}throw new L("Graph.".concat(s,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(t,e),function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";t.prototype[s]=function(t,e,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return ht(this,i,n=t);if(2===arguments.length){n=e;var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));return gt(this.multi,"mixed"===i?this.type:i,r,o,n)}if(3===arguments.length){e=""+e;var a=this._nodes.get(t=""+t);if(!a)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(s,': could not find the "').concat(e,'" target node in the graph.'));return vt(i,this.multi,r,a,e,n)}throw new L("Graph.".concat(s,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(t,e),function(t,e){var n=e.type,i=e.direction,r=e.name.slice(0,-1)+"Entries";t.prototype[r]=function(t,e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return D.empty();if(!arguments.length)return dt(this,n);if(1===arguments.length){var s=this._nodes.get(t=""+t);if(!s)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));return mt(n,i,s)}if(2===arguments.length){e=""+e;var o=this._nodes.get(t=""+t);if(!o)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(r,': could not find the "').concat(e,'" target node in the graph.'));return _t(n,i,o,e)}throw new L("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e)})}($t),function(t){wt.forEach(function(e){var n,i,r,s;r=(n=e).type,s=n.direction,t.prototype[i=n.name]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var e=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(e))throw new j("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));if(!this._nodes.has(n))throw new j("Graph.".concat(i,': could not find the "').concat(n,'" node in the graph.'));return Pt(this,r,s,e,n)}if(1===arguments.length){var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));return St("mixed"===r?this.type:r,s,o)}throw new L("Graph.".concat(i,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(t,e){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));!function(t,e,n,i){if("mixed"!==t){if("undirected"===t)return Et(n,n.undirected,i);if("string"==typeof e)return Et(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Ct(r,n,n.in,i),"in"!==e&&Ct(r,n,n.out,i)),"directed"!==t&&Ct(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,e)}}}(t,e),function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";t.prototype[s]=function(t,e){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));!function(t,e,n,i){if("mixed"!==t){if("undirected"===t)return Ot(n,n.undirected,i);if("string"==typeof e)return Ot(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Tt(r,n,n.in,i)||"in"!==e&&Tt(r,n,n.out,i))||"directed"===t||Tt(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,e)}}}(t,e),function(t,e){var n=e.type,i=e.direction,r=e.name.slice(0,-1)+"Entries";t.prototype[r]=function(t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return D.empty();var e=this._nodes.get(t=""+t);if(void 0===e)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return kt(n,n.undirected);if("string"==typeof e)return kt(n,n[e])}var i=D.empty(),r=new Set;return"undirected"!==t&&("out"!==e&&(i=q(i,At(r,n,n.in))),"in"!==e&&(i=q(i,At(r,n,n.out)))),"directed"!==t&&(i=q(i,At(r,n,n.undirected))),i}("mixed"===n?this.type:n,i,e)}}(t,e)})}($t);var Gt=function(t){function n(e){var n=l({type:"directed"},e);if("multi"in n&&!1!==n.multi)throw new L("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new L('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),Wt=function(t){function n(e){var n=l({type:"undirected"},e);if("multi"in n&&!1!==n.multi)throw new L("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new L('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),qt=function(t){function n(e){var n=l({multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return t.call(this,n)||this}return e(n,t),n}($t),Xt=function(t){function n(e){var n=l({type:"directed",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new L('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),Yt=function(t){function n(e){var n=l({type:"undirected",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new L('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t);function Kt(t){t.from=function(e,n){var i=l({},e.options,n),r=new t(i);return r.import(e),r}}return Kt($t),Kt(Gt),Kt(Wt),Kt(qt),Kt(Xt),Kt(Yt),$t.Graph=$t,$t.DirectedGraph=Gt,$t.UndirectedGraph=Wt,$t.MultiGraph=qt,$t.MultiDirectedGraph=Xt,$t.MultiUndirectedGraph=Yt,$t.InvalidArgumentsGraphError=L,$t.NotFoundGraphError=j,$t.UsageGraphError=F,$t}()},11524:function(t,e,n){var i;!function(r,s,o,a){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=s.createElement("div"),h=Math.round,d=Math.abs,p=Date.now;function f(t,e,n){return setTimeout(w(t,n),e)}function g(t,e,n){return!!Array.isArray(t)&&(m(t,n[e],n),!0)}function m(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==a)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=r.console&&(r.console.warn||r.console.log);return s&&s.call(r.console,i,n),t.apply(this,arguments)}}l="function"!=typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n-1}function k(t){return t.trim().split(/\s+/g)}function A(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function M(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),s=0;s1&&!n.firstMultiple?n.firstMultiple=$(e):1===r&&(n.firstMultiple=!1);var s=n.firstInput,o=n.firstMultiple,l=o?o.center:s.center,c=e.center=G(i);e.timeStamp=p(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Y(l,c),e.distance=X(l,c),function(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},s=t.prevInput||{};(1===e.eventType||4===s.eventType)&&(r=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}(n,e),e.offsetDirection=q(e.deltaX,e.deltaY);var u=W(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=d(u.x)>d(u.y)?u.x:u.y,e.scale=o?function(t,e){return X(e[0],e[1],z)/X(t[0],t[1],z)}(o.pointers,i):1,e.rotation=o?function(t,e){return Y(e[1],e[0],z)+Y(t[1],t[0],z)}(o.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,r,s,o=t.lastInterval||e,l=e.timeStamp-o.timeStamp;if(8!=e.eventType&&(l>25||o.velocity===a)){var c=e.deltaX-o.deltaX,u=e.deltaY-o.deltaY,h=W(l,c,u);i=h.x,r=h.y,n=d(h.x)>d(h.y)?h.x:h.y,s=q(c,u),t.lastInterval=e}else n=o.velocity,i=o.velocityX,r=o.velocityY,s=o.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=s}(n,e);var h=t.element;O(e.srcEvent.target,h)&&(h=e.srcEvent.target),e.target=h}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function $(t){for(var e=[],n=0;n=d(e)?t<0?2:4:e<0?8:16}function X(t,e,n){n||(n=V);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function Y(t,e,n){return n||(n=V),180*Math.atan2(e[n[1]]-t[n[1]],e[n[0]]-t[n[0]])/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(R(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},Q="mousedown",Z="mousemove mouseup";function J(){this.evEl=Q,this.evWin=Z,this.pressed=!1,U.apply(this,arguments)}_(J,U,{handler:function(t){var e=K[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:B,srcEvent:t}))}});var tt={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},et={2:F,3:"pen",4:B,5:"kinect"},nt="pointerdown",it="pointermove pointerup pointercancel";function rt(){this.evEl=nt,this.evWin=it,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(nt="MSPointerDown",it="MSPointerMove MSPointerUp MSPointerCancel"),_(rt,U,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=tt[i],s=et[t.pointerType]||t.pointerType,o=s==F,a=A(e,t.pointerId,"pointerId");1&r&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):12&r&&(n=!0),!(a<0)&&(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),n&&e.splice(a,1))}});var st={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ot="touchstart",at="touchstart touchmove touchend touchcancel";function lt(){this.evTarget=ot,this.evWin=at,this.started=!1,U.apply(this,arguments)}function ct(t,e){var n=P(t.touches),i=P(t.changedTouches);return 12&e&&(n=I(n.concat(i),"identifier",!0)),[n,i]}_(lt,U,{handler:function(t){var e=st[t.type];if(1===e&&(this.started=!0),this.started){var n=ct.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:F,srcEvent:t})}}});var ut={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ht="touchstart touchmove touchend touchcancel";function dt(){this.evTarget=ht,this.targetIds={},U.apply(this,arguments)}function pt(t,e){var n=P(t.touches),i=this.targetIds;if(3&e&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,s,o=P(t.changedTouches),a=[],l=this.target;if(s=n.filter(function(t){return O(t.target,l)}),1===e)for(r=0;r-1&&i.splice(t,1)},2500)}}function bt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function i(n){e.manager.emit(n,t)}n<8&&i(e.options.event+kt(n)),i(e.options.event),t.additionalEvent&&i(t.additionalEvent),n>=8&&i(e.options.event+kt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return It.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=At(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(Dt,It,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[xt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){1!==t.scale&&(t.additionalEvent=this.options.event+(t.scale<1?"in":"out")),this._super.emit.call(this,t)}}),_(Rt,Tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!n||12&t.eventType&&!r)this.reset();else if(1&t.eventType)this.reset(),this._timer=f(function(){this.state=8,this.tryEmit()},e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),_(Nt,It,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[xt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Lt,It,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Mt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&d(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=At(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(jt,Tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[wt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance"']/g,W=RegExp($.source),q=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,it=/\s/,rt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,ot=/,? & /,at=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,ft=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,vt=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Ct="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tt="["+_t+"]",kt="["+Ot+"]",At="["+wt+"]",Pt="\\d+",It="["+xt+"]",Mt="["+St+"]",Dt="[^"+_t+Ot+Pt+xt+St+Et+"]",Rt="\\ud83c[\\udffb-\\udfff]",Nt="[^"+_t+"]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Et+"]",Bt="(?:"+Mt+"|"+Dt+")",Vt="(?:"+Ft+"|"+Dt+")",zt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ut="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+At+"|"+Rt+")?",$t="["+Ct+"]?",Gt=$t+Ht+"(?:\\u200d(?:"+[Nt,Lt,jt].join("|")+")"+$t+Ht+")*",Wt="(?:"+[It,Lt,jt].join("|")+")"+Gt,qt="(?:"+[Nt+At+"?",At,Lt,jt,Tt].join("|")+")",Xt=RegExp("['\u2019]","g"),Yt=RegExp(At,"g"),Kt=RegExp(Rt+"(?="+Rt+")|"+qt+Gt,"g"),Qt=RegExp([Ft+"?"+Mt+"+"+zt+"(?="+[kt,Ft,"$"].join("|")+")",Vt+"+"+Ut+"(?="+[kt,Ft+Bt,"$"].join("|")+")",Ft+"?"+Bt+"+"+zt,Ft+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pt,Wt].join("|"),"g"),Zt=RegExp("[\\u200d"+_t+wt+Ct+"]"),Jt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,te=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ee=-1,ne={};ne[M]=ne[D]=ne[R]=ne[N]=ne[L]=ne[j]=ne[F]=ne[B]=ne[V]=!0,ne[f]=ne[g]=ne[P]=ne[m]=ne[I]=ne[b]=ne[y]=ne[v]=ne[w]=ne[x]=ne[S]=ne[C]=ne[O]=ne[T]=ne[A]=!1;var ie={};ie[f]=ie[g]=ie[P]=ie[I]=ie[m]=ie[b]=ie[M]=ie[D]=ie[R]=ie[N]=ie[L]=ie[w]=ie[x]=ie[S]=ie[C]=ie[O]=ie[T]=ie[k]=ie[j]=ie[F]=ie[B]=ie[V]=!0,ie[y]=ie[v]=ie[A]=!1;var re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,oe=parseInt,ae="object"==typeof global&&global&&global.Object===Object&&global,le="object"==typeof self&&self&&self.Object===Object&&self,ce=ae||le||Function("return this")(),ue=e&&!e.nodeType&&e,he=ue&&t&&!t.nodeType&&t,de=he&&he.exports===ue,pe=de&&ae.process,fe=function(){try{return he&&he.require&&he.require("util").types||pe&&pe.binding&&pe.binding("util")}catch(t){}}(),ge=fe&&fe.isArrayBuffer,me=fe&&fe.isDate,be=fe&&fe.isMap,ye=fe&&fe.isRegExp,ve=fe&&fe.isSet,_e=fe&&fe.isTypedArray;function we(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,i){for(var r=-1,s=null==t?0:t.length;++r-1}function ke(t,e,n){for(var i=-1,r=null==t?0:t.length;++i-1;);return n}function Qe(t,e){for(var n=t.length;n--&&je(e,t[n],0)>-1;);return n}function Ze(t,e){for(var n=t.length,i=0;n--;)t[n]===e&&++i;return i}var Je=Ue({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),tn=Ue({"&":"&","<":"<",">":">",'"':""","'":"'"});function en(t){return"\\"+re[t]}function nn(t){return Zt.test(t)}function rn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,i){n[++e]=[i,t]}),n}function sn(t,e){return function(n){return t(e(n))}}function on(t,e){for(var n=-1,i=t.length,r=0,s=[];++n",""":'"',"'":"'"}),dn=function t(e){var n,i=(e=null==e?ce:dn.defaults(ce.Object(),e,dn.pick(ce,te))).Array,it=e.Date,_t=e.Error,wt=e.Function,xt=e.Math,St=e.Object,Et=e.RegExp,Ct=e.String,Ot=e.TypeError,Tt=i.prototype,kt=St.prototype,At=e["__core-js_shared__"],Pt=wt.prototype.toString,It=kt.hasOwnProperty,Mt=0,Dt=(n=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Rt=kt.toString,Nt=Pt.call(St),Lt=ce._,jt=Et("^"+Pt.call(It).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ft=de?e.Buffer:r,Bt=e.Symbol,Vt=e.Uint8Array,zt=Ft?Ft.allocUnsafe:r,Ut=sn(St.getPrototypeOf,St),Ht=St.create,$t=kt.propertyIsEnumerable,Gt=Tt.splice,Wt=Bt?Bt.isConcatSpreadable:r,qt=Bt?Bt.iterator:r,Kt=Bt?Bt.toStringTag:r,Zt=function(){try{var t=os(St,"defineProperty");return t({},"",{}),t}catch(Is){}}(),re=e.clearTimeout!==ce.clearTimeout&&e.clearTimeout,ae=it&&it.now!==ce.Date.now&&it.now,le=e.setTimeout!==ce.setTimeout&&e.setTimeout,ue=xt.ceil,he=xt.floor,pe=St.getOwnPropertySymbols,fe=Ft?Ft.isBuffer:r,Re=e.isFinite,Ue=Tt.join,pn=sn(St.keys,St),fn=xt.max,gn=xt.min,mn=it.now,bn=e.parseInt,yn=xt.random,vn=Tt.reverse,_n=os(e,"DataView"),wn=os(e,"Map"),xn=os(e,"Promise"),Sn=os(e,"Set"),En=os(e,"WeakMap"),Cn=os(St,"create"),On=En&&new En,Tn={},kn=Ns(_n),An=Ns(wn),Pn=Ns(xn),In=Ns(Sn),Mn=Ns(En),Dn=Bt?Bt.prototype:r,Rn=Dn?Dn.valueOf:r,Nn=Dn?Dn.toString:r;function Ln(t){if(Jo(t)&&!Uo(t)&&!(t instanceof Vn)){if(t instanceof Bn)return t;if(It.call(t,"__wrapped__"))return Ls(t)}return new Bn(t)}var jn=function(){function t(){}return function(e){if(!Zo(e))return{};if(Ht)return Ht(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function Fn(){}function Bn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function ri(t,e,n,i,s,o){var a,l=1&e,c=2&e,u=4&e;if(n&&(a=s?n(t,i,s,o):n(t)),a!==r)return a;if(!Zo(t))return t;var h=Uo(t);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&It.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Er(t,a)}else{var d=cs(t),p=d==v||d==_;if(Wo(t))return yr(t,l);if(d==S||d==f||p&&!s){if(a=c||p?{}:hs(t),!l)return c?function(t,e){return Cr(t,ls(t),e)}(t,function(t,e){return t&&Cr(e,Pa(e),t)}(a,t)):function(t,e){return Cr(t,as(t),e)}(t,ti(a,t))}else{if(!ie[d])return s?t:{};a=function(t,e,n){var i=t.constructor;switch(e){case P:return vr(t);case m:case b:return new i(+t);case I:return function(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case M:case D:case R:case N:case L:case j:case F:case B:case V:return _r(t,n);case w:return new i;case x:case T:return new i(t);case C:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new i;case k:return function(t){return Rn?St(Rn.call(t)):{}}(t)}}(t,d,l)}}o||(o=new Gn);var g=o.get(t);if(g)return g;o.set(t,a),ra(t)?t.forEach(function(i){a.add(ri(i,e,n,i,t,o))}):ta(t)&&t.forEach(function(i,r){a.set(r,ri(i,e,n,r,t,o))});var y=h?r:(u?c?Jr:Zr:c?Pa:Aa)(t);return Se(y||t,function(i,r){y&&(i=t[r=i]),Qn(a,r,ri(i,e,n,r,t,o))}),a}function si(t,e,n){var i=n.length;if(null==t)return!i;for(t=St(t);i--;){var s=n[i],o=t[s];if(o===r&&!(s in t)||!(0,e[s])(o))return!1}return!0}function oi(t,e,n){if("function"!=typeof t)throw new Ot(s);return Os(function(){t.apply(r,n)},e)}function ai(t,e,n,i){var r=-1,s=Te,o=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=Ae(e,qe(n))),i?(s=ke,o=!1):e.length>=200&&(s=Ye,o=!1,e=new $n(e));t:for(;++r-1},Un.prototype.set=function(t,e){var n=this.__data__,i=Zn(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new zn,map:new(wn||Un),string:new zn}},Hn.prototype.delete=function(t){var e=rs(this,t).delete(t);return this.size-=e?1:0,e},Hn.prototype.get=function(t){return rs(this,t).get(t)},Hn.prototype.has=function(t){return rs(this,t).has(t)},Hn.prototype.set=function(t,e){var n=rs(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},$n.prototype.add=$n.prototype.push=function(t){return this.__data__.set(t,o),this},$n.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new Un,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Un){var i=n.__data__;if(!wn||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Hn(i)}return n.set(t,e),this.size=n.size,this};var li=kr(mi),ci=kr(bi,!0);function ui(t,e){var n=!0;return li(t,function(t,i,r){return n=!!e(t,i,r)}),n}function hi(t,e,n){for(var i=-1,s=t.length;++i0&&n(a)?e>1?pi(a,e-1,n,i,r):Pe(r,a):i||(r[r.length]=a)}return r}var fi=Ar(),gi=Ar(!0);function mi(t,e){return t&&fi(t,e,Aa)}function bi(t,e){return t&&gi(t,e,Aa)}function yi(t,e){return Oe(e,function(e){return Yo(t[e])})}function vi(t,e){for(var n=0,i=(e=fr(e,t)).length;null!=t&&ne}function Si(t,e){return null!=t&&It.call(t,e)}function Ei(t,e){return null!=t&&e in St(t)}function Ci(t,e,n){for(var s=n?ke:Te,o=t[0].length,a=t.length,l=a,c=i(a),u=1/0,h=[];l--;){var d=t[l];l&&e&&(d=Ae(d,qe(e))),u=gn(d.length,u),c[l]=!n&&(e||o>=120&&d.length>=120)?new $n(l&&d):r}d=t[0];var p=-1,f=c[0];t:for(;++p=a?l:l*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)});i--;)t[i]=t[i].value;return t}(Ri(t,function(t,n,r){return{criteria:Ae(e,function(e){return e(t)}),index:++i,value:t}}))}function Vi(t,e,n){for(var i=-1,r=e.length,s={};++i-1;)a!==t&&Gt.call(a,l,1),Gt.call(t,l,1);return t}function Ui(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==s){var s=r;ps(r)?Gt.call(t,r,1):or(t,r)}}return t}function Hi(t,e){return t+he(yn()*(e-t+1))}function $i(t,e){var n="";if(!t||e<1||e>h)return n;do{e%2&&(n+=t),(e=he(e/2))&&(t+=t)}while(e);return n}function Gi(t,e){return Ts(ws(t,e,el),t+"")}function Wi(t){return qn(Fa(t))}function qi(t,e){var n=Fa(t);return Ps(n,ii(e,0,n.length))}function Xi(t,e,n,i){if(!Zo(t))return t;for(var s=-1,o=(e=fr(e,t)).length,a=o-1,l=t;null!=l&&++ss?0:s+e),(n=n>s?s:n)<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;for(var o=i(s);++r>>1,o=t[s];null!==o&&!oa(o)&&(n?o<=e:o=200){var c=e?null:$r(t);if(c)return an(c);o=!1,r=Ye,l=new $n}else l=e?[]:a;t:for(;++i=i?t:Zi(t,e,n)}var br=re||function(t){return ce.clearTimeout(t)};function yr(t,e){if(e)return t.slice();var n=t.length,i=zt?zt(n):new t.constructor(n);return t.copy(i),i}function vr(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function _r(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function wr(t,e){if(t!==e){var n=t!==r,i=null===t,s=t==t,o=oa(t),a=e!==r,l=null===e,c=e==e,u=oa(e);if(!l&&!u&&!o&&t>e||o&&a&&c&&!l&&!u||i&&a&&c||!n&&c||!s)return 1;if(!i&&!o&&!u&&t1?n[s-1]:r,a=s>2?n[2]:r;for(o=t.length>3&&"function"==typeof o?(s--,o):r,a&&fs(n[0],n[1],a)&&(o=s<3?r:o,s=1),e=St(e);++i-1?s[o?e[a]:a]:r}}function Rr(t){return Qr(function(e){var n=e.length,i=n,o=Bn.prototype.thru;for(t&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new Ot(s);if(o&&!l&&"wrapper"==es(a))var l=new Bn([],!0)}for(i=l?i:n;++i1&&v.reverse(),p&&hl))return!1;var u=o.get(t),h=o.get(e);if(u&&h)return u==e&&h==t;var d=-1,p=!0,f=2&n?new $n:r;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(rt,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Se(p,function(n){var i="_."+n[0];e&n[1]&&!Te(t,i)&&t.push(i)}),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(ot):[]}(i),n)))}function As(t){var e=0,n=0;return function(){var i=mn(),s=16-(i-n);if(n=i,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Ps(t,e){var n=-1,i=t.length,s=i-1;for(e=e===r?i:e;++n1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,no(t,n)});function co(t){var e=Ln(t);return e.__chain__=!0,e}function uo(t,e){return e(t)}var ho=Qr(function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,s=function(e){return ni(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Vn&&ps(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:uo,args:[s],thisArg:r}),new Bn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(r),t})):this.thru(s)}),po=Or(function(t,e,n){It.call(t,n)?++t[n]:ei(t,n,1)}),fo=Dr(Vs),go=Dr(zs);function mo(t,e){return(Uo(t)?Se:li)(t,is(e,3))}function bo(t,e){return(Uo(t)?Ee:ci)(t,is(e,3))}var yo=Or(function(t,e,n){It.call(t,n)?t[n].push(e):ei(t,n,[e])}),vo=Gi(function(t,e,n){var r=-1,s="function"==typeof e,o=$o(t)?i(t.length):[];return li(t,function(t){o[++r]=s?we(e,t,n):Oi(t,e,n)}),o}),_o=Or(function(t,e,n){ei(t,n,e)});function wo(t,e){return(Uo(t)?Ae:Ri)(t,is(e,3))}var xo=Or(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),So=Gi(function(t,e){if(null==t)return[];var n=e.length;return n>1&&fs(t,e[0],e[1])?e=[]:n>2&&fs(e[0],e[1],e[2])&&(e=[e[0]]),Bi(t,pi(e,1),[])}),Eo=ae||function(){return ce.Date.now()};function Co(t,e,n){return e=n?r:e,Wr(t,c,r,r,r,r,e=t&&null==e?t.length:e)}function Oo(t,e){var n;if("function"!=typeof e)throw new Ot(s);return t=da(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var To=Gi(function(t,e,n){var i=1;if(n.length){var r=on(n,ns(To));i|=l}return Wr(t,i,e,n,r)}),ko=Gi(function(t,e,n){var i=3;if(n.length){var r=on(n,ns(ko));i|=l}return Wr(e,i,t,n,r)});function Ao(t,e,n){var i,o,a,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new Ot(s);function g(e){var n=i,s=o;return i=o=r,h=e,l=t.apply(s,n)}function m(t){return h=t,c=Os(y,e),d?g(t):l}function b(t){var n=t-u;return u===r||n>=e||n<0||p&&t-h>=a}function y(){var t=Eo();if(b(t))return v(t);c=Os(y,function(t){var n=e-(t-u);return p?gn(n,a-(t-h)):n}(t))}function v(t){return c=r,f&&i?g(t):(i=o=r,l)}function _(){var t=Eo(),n=b(t);if(i=arguments,o=this,u=t,n){if(c===r)return m(u);if(p)return br(c),c=Os(y,e),g(u)}return c===r&&(c=Os(y,e)),l}return e=fa(e)||0,Zo(n)&&(d=!!n.leading,a=(p="maxWait"in n)?fn(fa(n.maxWait)||0,e):a,f="trailing"in n?!!n.trailing:f),_.cancel=function(){c!==r&&br(c),h=0,i=u=o=c=r},_.flush=function(){return c===r?l:v(Eo())},_}var Po=Gi(function(t,e){return oi(t,1,e)}),Io=Gi(function(t,e,n){return oi(t,fa(e)||0,n)});function Mo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(s);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(Mo.Cache||Hn),n}function Do(t){if("function"!=typeof t)throw new Ot(s);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Mo.Cache=Hn;var Ro=gr(function(t,e){var n=(e=1==e.length&&Uo(e[0])?Ae(e[0],qe(is())):Ae(pi(e,1),qe(is()))).length;return Gi(function(i){for(var r=-1,s=gn(i.length,n);++r=e}),zo=Ti(function(){return arguments}())?Ti:function(t){return Jo(t)&&It.call(t,"callee")&&!$t.call(t,"callee")},Uo=i.isArray,Ho=ge?qe(ge):function(t){return Jo(t)&&wi(t)==P};function $o(t){return null!=t&&Qo(t.length)&&!Yo(t)}function Go(t){return Jo(t)&&$o(t)}var Wo=fe||fl,qo=me?qe(me):function(t){return Jo(t)&&wi(t)==b};function Xo(t){if(!Jo(t))return!1;var e=wi(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!na(t)}function Yo(t){if(!Zo(t))return!1;var e=wi(t);return e==v||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ko(t){return"number"==typeof t&&t==da(t)}function Qo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function Zo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Jo(t){return null!=t&&"object"==typeof t}var ta=be?qe(be):function(t){return Jo(t)&&cs(t)==w};function ea(t){return"number"==typeof t||Jo(t)&&wi(t)==x}function na(t){if(!Jo(t)||wi(t)!=S)return!1;var e=Ut(t);if(null===e)return!0;var n=It.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Nt}var ia=ye?qe(ye):function(t){return Jo(t)&&wi(t)==C},ra=ve?qe(ve):function(t){return Jo(t)&&cs(t)==O};function sa(t){return"string"==typeof t||!Uo(t)&&Jo(t)&&wi(t)==T}function oa(t){return"symbol"==typeof t||Jo(t)&&wi(t)==k}var aa=_e?qe(_e):function(t){return Jo(t)&&Qo(t.length)&&!!ne[wi(t)]},la=zr(Di),ca=zr(function(t,e){return t<=e});function ua(t){if(!t)return[];if($o(t))return sa(t)?cn(t):Er(t);if(qt&&t[qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qt]());var e=cs(t);return(e==w?rn:e==O?an:Fa)(t)}function ha(t){return t?(t=fa(t))===u||t===-u?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function da(t){var e=ha(t),n=e%1;return e==e?n?e-n:e:0}function pa(t){return t?ii(da(t),0,d):0}function fa(t){if("number"==typeof t)return t;if(oa(t))return NaN;if(Zo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Zo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=We(t);var n=pt.test(t);return n||gt.test(t)?oe(t.slice(2),n?2:8):dt.test(t)?NaN:+t}function ga(t){return Cr(t,Pa(t))}function ma(t){return null==t?"":rr(t)}var ba=Tr(function(t,e){if(ys(e)||$o(e))Cr(e,Aa(e),t);else for(var n in e)It.call(e,n)&&Qn(t,n,e[n])}),ya=Tr(function(t,e){Cr(e,Pa(e),t)}),va=Tr(function(t,e,n,i){Cr(e,Pa(e),t,i)}),_a=Tr(function(t,e,n,i){Cr(e,Aa(e),t,i)}),wa=Qr(ni),xa=Gi(function(t,e){t=St(t);var n=-1,i=e.length,s=i>2?e[2]:r;for(s&&fs(e[0],e[1],s)&&(i=1);++n1),e}),Cr(t,Jr(t),n),i&&(n=ri(n,7,Yr));for(var r=e.length;r--;)or(n,e[r]);return n}),Ra=Qr(function(t,e){return null==t?{}:function(t,e){return Vi(t,e,function(e,n){return Ca(t,n)})}(t,e)});function Na(t,e){if(null==t)return{};var n=Ae(Jr(t),function(t){return[t]});return e=is(e),Vi(t,n,function(t,n){return e(t,n[0])})}var La=Gr(Aa),ja=Gr(Pa);function Fa(t){return null==t?[]:Xe(t,Aa(t))}var Ba=Ir(function(t,e,n){return e=e.toLowerCase(),t+(n?Va(e):e)});function Va(t){return Xa(ma(t).toLowerCase())}function za(t){return(t=ma(t))&&t.replace(bt,Je).replace(Yt,"")}var Ua=Ir(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ha=Ir(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),$a=Pr("toLowerCase"),Ga=Ir(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Wa=Ir(function(t,e,n){return t+(n?" ":"")+Xa(e)}),qa=Ir(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Xa=Pr("toUpperCase");function Ya(t,e,n){return t=ma(t),(e=n?r:e)===r?function(t){return Jt.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(at)||[]}(t):t.match(e)||[]}var Ka=Gi(function(t,e){try{return we(t,r,e)}catch(Ms){return Xo(Ms)?Ms:new _t(Ms)}}),Qa=Qr(function(t,e){return Se(e,function(e){e=Rs(e),ei(t,e,To(t[e],t))}),t});function Za(t){return function(){return t}}var Ja=Rr(),tl=Rr(!0);function el(t){return t}function nl(t){return Ii("function"==typeof t?t:ri(t,1))}var il=Gi(function(t,e){return function(n){return Oi(n,t,e)}}),rl=Gi(function(t,e){return function(n){return Oi(t,n,e)}});function sl(t,e,n){var i=Aa(e),r=yi(e,i);null==n&&(!Zo(e)||!r.length&&i.length)&&(n=e,e=t,t=this,r=yi(e,Aa(e)));var s=!(Zo(n)&&"chain"in n&&!n.chain),o=Yo(t);return Se(r,function(n){var i=e[n];t[n]=i,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__),r=n.__actions__=Er(this.__actions__);return r.push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,Pe([this.value()],arguments))})}),t}function ol(){}var al=Fr(Ae),ll=Fr(Ce),cl=Fr(De);function ul(t){return gs(t)?ze(Rs(t)):function(t){return function(e){return vi(e,t)}}(t)}var hl=Vr(),dl=Vr(!0);function pl(){return[]}function fl(){return!1}var gl=jr(function(t,e){return t+e},0),ml=Hr("ceil"),bl=jr(function(t,e){return t/e},1),yl=Hr("floor"),vl=jr(function(t,e){return t*e},1),_l=Hr("round"),wl=jr(function(t,e){return t-e},0);return Ln.after=function(t,e){if("function"!=typeof e)throw new Ot(s);return t=da(t),function(){if(--t<1)return e.apply(this,arguments)}},Ln.ary=Co,Ln.assign=ba,Ln.assignIn=ya,Ln.assignInWith=va,Ln.assignWith=_a,Ln.at=wa,Ln.before=Oo,Ln.bind=To,Ln.bindAll=Qa,Ln.bindKey=ko,Ln.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Uo(t)?t:[t]},Ln.chain=co,Ln.chunk=function(t,e,n){e=(n?fs(t,e,n):e===r)?1:fn(da(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=i(ue(s/e));os?0:s+n),(i=i===r||i>s?s:da(i))<0&&(i+=s),i=n>i?0:pa(i);n>>0)?(t=ma(t))&&("string"==typeof e||null!=e&&!ia(e))&&!(e=rr(e))&&nn(t)?mr(cn(t),0,n):t.split(e,n):[]},Ln.spread=function(t,e){if("function"!=typeof t)throw new Ot(s);return e=null==e?0:fn(da(e),0),Gi(function(n){var i=n[e],r=mr(n,0,e);return i&&Pe(r,i),we(t,this,r)})},Ln.tail=function(t){var e=null==t?0:t.length;return e?Zi(t,1,e):[]},Ln.take=function(t,e,n){return t&&t.length?Zi(t,0,(e=n||e===r?1:da(e))<0?0:e):[]},Ln.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?Zi(t,(e=i-(e=n||e===r?1:da(e)))<0?0:e,i):[]},Ln.takeRightWhile=function(t,e){return t&&t.length?lr(t,is(e,3),!1,!0):[]},Ln.takeWhile=function(t,e){return t&&t.length?lr(t,is(e,3)):[]},Ln.tap=function(t,e){return e(t),t},Ln.throttle=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new Ot(s);return Zo(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Ao(t,e,{leading:i,maxWait:e,trailing:r})},Ln.thru=uo,Ln.toArray=ua,Ln.toPairs=La,Ln.toPairsIn=ja,Ln.toPath=function(t){return Uo(t)?Ae(t,Rs):oa(t)?[t]:Er(Ds(ma(t)))},Ln.toPlainObject=ga,Ln.transform=function(t,e,n){var i=Uo(t),r=i||Wo(t)||aa(t);if(e=is(e,4),null==n){var s=t&&t.constructor;n=r?i?new s:[]:Zo(t)&&Yo(s)?jn(Ut(t)):{}}return(r?Se:mi)(t,function(t,i,r){return e(n,t,i,r)}),n},Ln.unary=function(t){return Co(t,1)},Ln.union=Zs,Ln.unionBy=Js,Ln.unionWith=to,Ln.uniq=function(t){return t&&t.length?sr(t):[]},Ln.uniqBy=function(t,e){return t&&t.length?sr(t,is(e,2)):[]},Ln.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?sr(t,r,e):[]},Ln.unset=function(t,e){return null==t||or(t,e)},Ln.unzip=eo,Ln.unzipWith=no,Ln.update=function(t,e,n){return null==t?t:ar(t,e,pr(n))},Ln.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:ar(t,e,pr(n),i)},Ln.values=Fa,Ln.valuesIn=function(t){return null==t?[]:Xe(t,Pa(t))},Ln.without=io,Ln.words=Ya,Ln.wrap=function(t,e){return No(pr(e),t)},Ln.xor=ro,Ln.xorBy=so,Ln.xorWith=oo,Ln.zip=ao,Ln.zipObject=function(t,e){return hr(t||[],e||[],Qn)},Ln.zipObjectDeep=function(t,e){return hr(t||[],e||[],Xi)},Ln.zipWith=lo,Ln.entries=La,Ln.entriesIn=ja,Ln.extend=ya,Ln.extendWith=va,sl(Ln,Ln),Ln.add=gl,Ln.attempt=Ka,Ln.camelCase=Ba,Ln.capitalize=Va,Ln.ceil=ml,Ln.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=fa(n))==n?n:0),e!==r&&(e=(e=fa(e))==e?e:0),ii(fa(t),e,n)},Ln.clone=function(t){return ri(t,4)},Ln.cloneDeep=function(t){return ri(t,5)},Ln.cloneDeepWith=function(t,e){return ri(t,5,e="function"==typeof e?e:r)},Ln.cloneWith=function(t,e){return ri(t,4,e="function"==typeof e?e:r)},Ln.conformsTo=function(t,e){return null==e||si(t,e,Aa(e))},Ln.deburr=za,Ln.defaultTo=function(t,e){return null==t||t!=t?e:t},Ln.divide=bl,Ln.endsWith=function(t,e,n){t=ma(t),e=rr(e);var i=t.length,s=n=n===r?i:ii(da(n),0,i);return(n-=e.length)>=0&&t.slice(n,s)==e},Ln.eq=Fo,Ln.escape=function(t){return(t=ma(t))&&q.test(t)?t.replace(G,tn):t},Ln.escapeRegExp=function(t){return(t=ma(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Ln.every=function(t,e,n){var i=Uo(t)?Ce:ui;return n&&fs(t,e,n)&&(e=r),i(t,is(e,3))},Ln.find=fo,Ln.findIndex=Vs,Ln.findKey=function(t,e){return Ne(t,is(e,3),mi)},Ln.findLast=go,Ln.findLastIndex=zs,Ln.findLastKey=function(t,e){return Ne(t,is(e,3),bi)},Ln.floor=yl,Ln.forEach=mo,Ln.forEachRight=bo,Ln.forIn=function(t,e){return null==t?t:fi(t,is(e,3),Pa)},Ln.forInRight=function(t,e){return null==t?t:gi(t,is(e,3),Pa)},Ln.forOwn=function(t,e){return t&&mi(t,is(e,3))},Ln.forOwnRight=function(t,e){return t&&bi(t,is(e,3))},Ln.get=Ea,Ln.gt=Bo,Ln.gte=Vo,Ln.has=function(t,e){return null!=t&&us(t,e,Si)},Ln.hasIn=Ca,Ln.head=Hs,Ln.identity=el,Ln.includes=function(t,e,n,i){t=$o(t)?t:Fa(t),n=n&&!i?da(n):0;var r=t.length;return n<0&&(n=fn(r+n,0)),sa(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&je(t,e,n)>-1},Ln.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:da(n);return r<0&&(r=fn(i+r,0)),je(t,e,r)},Ln.inRange=function(t,e,n){return e=ha(e),n===r?(n=e,e=0):n=ha(n),function(t,e,n){return t>=gn(e,n)&&t=-h&&t<=h},Ln.isSet=ra,Ln.isString=sa,Ln.isSymbol=oa,Ln.isTypedArray=aa,Ln.isUndefined=function(t){return t===r},Ln.isWeakMap=function(t){return Jo(t)&&cs(t)==A},Ln.isWeakSet=function(t){return Jo(t)&&"[object WeakSet]"==wi(t)},Ln.join=function(t,e){return null==t?"":Ue.call(t,e)},Ln.kebabCase=Ua,Ln.last=qs,Ln.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var s=i;return n!==r&&(s=(s=da(n))<0?fn(i+s,0):gn(s,i-1)),e==e?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(t,e,s):Le(t,Be,s,!0)},Ln.lowerCase=Ha,Ln.lowerFirst=$a,Ln.lt=la,Ln.lte=ca,Ln.max=function(t){return t&&t.length?hi(t,el,xi):r},Ln.maxBy=function(t,e){return t&&t.length?hi(t,is(e,2),xi):r},Ln.mean=function(t){return Ve(t,el)},Ln.meanBy=function(t,e){return Ve(t,is(e,2))},Ln.min=function(t){return t&&t.length?hi(t,el,Di):r},Ln.minBy=function(t,e){return t&&t.length?hi(t,is(e,2),Di):r},Ln.stubArray=pl,Ln.stubFalse=fl,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=vl,Ln.nth=function(t,e){return t&&t.length?Fi(t,da(e)):r},Ln.noConflict=function(){return ce._===this&&(ce._=Lt),this},Ln.noop=ol,Ln.now=Eo,Ln.pad=function(t,e,n){t=ma(t);var i=(e=da(e))?ln(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return Br(he(r),n)+t+Br(ue(r),n)},Ln.padEnd=function(t,e,n){t=ma(t);var i=(e=da(e))?ln(t):0;return e&&ie){var i=t;t=e,e=i}if(n||t%1||e%1){var s=yn();return gn(t+s*(e-t+se("1e-"+((s+"").length-1))),e)}return Hi(t,e)},Ln.reduce=function(t,e,n){var i=Uo(t)?Ie:He,r=arguments.length<3;return i(t,is(e,4),n,r,li)},Ln.reduceRight=function(t,e,n){var i=Uo(t)?Me:He,r=arguments.length<3;return i(t,is(e,4),n,r,ci)},Ln.repeat=function(t,e,n){return e=(n?fs(t,e,n):e===r)?1:da(e),$i(ma(t),e)},Ln.replace=function(){var t=arguments,e=ma(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Ln.result=function(t,e,n){var i=-1,s=(e=fr(e,t)).length;for(s||(s=1,t=r);++ih)return[];var n=d,i=gn(t,d);e=is(e),t-=d;for(var r=Ge(i,e);++n=o)return t;var l=n-ln(i);if(l<1)return i;var c=a?mr(a,0,l).join(""):t.slice(0,l);if(s===r)return c+i;if(a&&(l+=c.length-l),ia(s)){if(t.slice(l).search(s)){var u,h=c;for(s.global||(s=Et(s.source,ma(ht.exec(s))+"g")),s.lastIndex=0;u=s.exec(h);)var d=u.index;c=c.slice(0,d===r?l:d)}}else if(t.indexOf(rr(s),l)!=l){var p=c.lastIndexOf(s);p>-1&&(c=c.slice(0,p))}return c+i},Ln.unescape=function(t){return(t=ma(t))&&W.test(t)?t.replace($,hn):t},Ln.uniqueId=function(t){var e=++Mt;return ma(t)+e},Ln.upperCase=qa,Ln.upperFirst=Xa,Ln.each=mo,Ln.eachRight=bo,Ln.first=Hs,sl(Ln,function(){var t={};return mi(Ln,function(e,n){It.call(Ln.prototype,n)||(t[n]=e)}),t}(),{chain:!1}),Ln.VERSION="4.17.21",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Ln[t].placeholder=Ln}),Se(["drop","take"],function(t,e){Vn.prototype[t]=function(n){n=n===r?1:fn(da(n),0);var i=this.__filtered__&&!e?new Vn(this):this.clone();return i.__filtered__?i.__takeCount__=gn(n,i.__takeCount__):i.__views__.push({size:gn(n,d),type:t+(i.__dir__<0?"Right":"")}),i},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Se(["filter","map","takeWhile"],function(t,e){var n=e+1,i=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:is(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}}),Se(["head","last"],function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}}),Se(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}}),Vn.prototype.compact=function(){return this.filter(el)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Gi(function(t,e){return"function"==typeof t?new Vn(this):this.map(function(n){return Oi(n,t,e)})}),Vn.prototype.reject=function(t){return this.filter(Do(is(t)))},Vn.prototype.slice=function(t,e){t=da(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=da(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(d)},mi(Vn.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),s=Ln[i?"take"+("last"==e?"Right":""):e],o=i||/^find/.test(e);!s||(Ln.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,l=e instanceof Vn,c=a[0],u=l||Uo(e),h=function(t){var e=s.apply(Ln,Pe([t],a));return i&&d?e[0]:e};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=o&&!d,g=l&&!p;if(!o&&u){e=g?e:new Vn(this);var m=t.apply(e,a);return m.__actions__.push({func:uo,args:[h],thisArg:r}),new Bn(m,d)}return f&&g?t.apply(this,a):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})}),Se(["pop","push","shift","sort","splice","unshift"],function(t){var e=Tt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Ln.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(Uo(r)?r:[],t)}return this[n](function(n){return e.apply(Uo(n)?n:[],t)})}}),mi(Vn.prototype,function(t,e){var n=Ln[e];if(n){var i=n.name+"";It.call(Tn,i)||(Tn[i]=[]),Tn[i].push({name:e,func:n})}}),Tn[Nr(r,2).name]=[{name:"wrapper",func:r}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Er(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Er(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Er(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Uo(t),i=e<0,r=n?t.length:0,s=function(t,e,n){for(var i=-1,r=n.length;++i=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Ln.prototype.plant=function(t){for(var e,n=this;n instanceof Fn;){var i=Ls(n);i.__index__=0,i.__values__=r,e?s.__wrapped__=i:e=i;var s=i;n=n.__wrapped__}return s.__wrapped__=t,e},Ln.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:uo,args:[Qs],thisArg:r}),new Bn(e,this.__chain__)}return this.thru(Qs)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return cr(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,qt&&(Ln.prototype[qt]=function(){return this}),Ln}();ce._=dn,(i=(function(){return dn}).call(e,n,e,t))!==r&&(t.exports=i)}).call(this)},5478:function(t){t.exports=function(){"use strict";function t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i={exports:{}};function r(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}i.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:r,changeDefaults:function(t){i.exports.defaults=t}};var s=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,c={"&":"&","<":"<",">":">",'"':""","'":"'"},u=function(t){return c[t]};var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(t){return t.replace(h,function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""})}var p=/(^|[^\[])\^/g;var f=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var m={},b=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(t,e){m[" "+t]||(m[" "+t]=b.test(t)?t+"/":w(t,"/",!0));var n=-1===(t=m[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(y,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(v,"$1")+e:t+e}function w(t,e,n){var i=t.length;if(0===i)return"";for(var r=0;r1;)1&e&&(n+=t),e>>=1,t+=t;return n+t},P=i.exports.defaults,I=w,M=function(t,e){var n=t.replace(/\|/g,function(t,e,n){for(var i=!1,r=e;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/),i=0;if(n.length>e)n.splice(e);else for(;n.length1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t){var e=this.rules.block.code.exec(t);if(e){var n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:I(n,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map(function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=i.length?t.slice(i.length):t}).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e){var n=e[2].trim();if(/#$/.test(n)){var i=I(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n}}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:M(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){var n,i,r,s,o,a,l,c,u,h=e[0],d=e[2],p=d.length>1,f={type:"list",raw:h,ordered:p,start:p?+d.slice(0,-1):"",loose:!1,items:[]},g=e[0].match(this.rules.block.item),m=!1,b=g.length;r=this.rules.block.listItemStart.exec(g[0]);for(var y=0;yr[1].length:s[1].length>=r[0].length||s[1].length>3){g.splice(y,2,g[y]+(!this.options.pedantic&&s[1].length/i.test(i[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):D(i[0]):i[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=e[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;var i=I(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=R(e[2],"()");if(r>-1){var s=(0===e[0].indexOf("!")?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,s).trim(),e[3]=""}}var o=e[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);l&&(o=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o.slice(1):o.slice(1,-1)),N(e,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:a&&a.replace(this.rules.inline._escapes,"$1")},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=e[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return N(n,i,n[0])}},e.emStrong=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(t);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var s,o,a=i[0].length-1,l=a,c=0,u="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+a);null!=(i=u.exec(e));)if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6]){if(o=s.length,i[3]||i[4]){l+=o;continue}if((i[5]||i[6])&&a%3&&!((a+o)%3)){c+=o;continue}if(!((l-=o)>0))return o=Math.min(o,o+l+c),Math.min(a,o)%2?{type:"em",raw:t.slice(0,a+i.index+o+1),text:t.slice(1,a+i.index+o)}:{type:"strong",raw:t.slice(0,a+i.index+o+1),text:t.slice(2,a+i.index+o-1)}}}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=D(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2]}},e.autolink=function(t,e){var n,i,r=this.rules.inline.autolink.exec(t);if(r)return i="@"===r[2]?"mailto:"+(n=D(this.options.mangle?e(r[1]):r[1])):n=D(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var i,r;if("@"===n[2])r="mailto:"+(i=D(this.options.mangle?e(n[0]):n[0]));else{var s;do{s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(s!==n[0]);i=D(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},e.inlineText=function(t,e,n){var i,r=this.rules.inline.text.exec(t);if(r)return i=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):D(r[0]):r[0]:D(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},t}(),j=O,F=E,B=T,V={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:j,table:j,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};V.def=F(V.def).replace("label",V._label).replace("title",V._title).getRegex(),V.bullet=/(?:[*+-]|\d{1,9}[.)])/,V.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,V.item=F(V.item,"gm").replace(/bull/g,V.bullet).getRegex(),V.listItemStart=F(/^( *)(bull) */).replace("bull",V.bullet).getRegex(),V.list=F(V.list).replace(/bull/g,V.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+V.def.source+")").getRegex(),V._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V._comment=/|$)/,V.html=F(V.html,"i").replace("comment",V._comment).replace("tag",V._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),V.paragraph=F(V._paragraph).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.blockquote=F(V.blockquote).replace("paragraph",V.paragraph).getRegex(),V.normal=B({},V),V.gfm=B({},V.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),V.gfm.nptable=F(V.gfm.nptable).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.gfm.table=F(V.gfm.table).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.pedantic=B({},V.normal,{html:F("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",V._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:j,paragraph:F(V.normal._paragraph).replace("hr",V.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",V.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:j,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};z.punctuation=F(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,z.escapedEmSt=/\\\*|\\_/g,z._comment=F(V._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),z.emStrong.lDelim=F(z.emStrong.lDelim).replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimAst=F(z.emStrong.rDelimAst,"g").replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimUnd=F(z.emStrong.rDelimUnd,"g").replace(/punct/g,z._punctuation).getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,z.autolink=F(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=F(z.tag).replace("comment",z._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=F(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=F(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=F(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=B({},z),z.pedantic=B({},z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:F(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=B({},z.normal,{escape:F(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var K=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||$,this.options.tokenizer=this.options.tokenizer||new H,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:G.normal,inline:W.normal};this.options.pedantic?(e.block=G.pedantic,e.inline=W.pedantic):this.options.gfm&&(e.block=G.gfm,e.inline=this.options.breaks?W.breaks:W.gfm),this.tokenizer.rules=e}e.lex=function(t,n){return new e(n).lex(t)},e.lexInline=function(t,n){return new e(n).inlineTokens(t)};var n=e.prototype;return n.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(t,e,n){var i,r,s,o,a,l,c=this;for(void 0===e&&(e=[]),void 0===n&&(n=!0),this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(n){return!!(i=n.call(c,t,e))&&(t=t.substring(i.raw.length),e.push(i),!0)}))){if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length),i.type&&e.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length),(o=e[e.length-1])&&"paragraph"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.nptable(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),e.push(i);continue}if(i=this.tokenizer.list(t)){for(t=t.substring(i.raw.length),s=i.items.length,r=0;r=0&&(e=Math.min(e,i))}),e<1/0&&e>=0&&(a=t.substring(0,e+1))}(),n&&(i=this.tokenizer.paragraph(a))){o=e[e.length-1],l&&"paragraph"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i),l=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length),(o=e[e.length-1])&&"text"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i);continue}if(t){var u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}throw new Error(u)}}return e},n.inline=function(t){var e,n,i,r,s,o,a=t.length;for(e=0;e0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,l.index)+"["+q("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,l.index)+"["+q("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,l.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(c||(u=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(n){return!!(s=n.call(r,t,e))&&(t=t.substring(s.raw.length),e.push(s),!0)}))){if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.tag(t,n,i)){t=t.substring(s.raw.length),n=s.inLink,i=s.inRawBlock,(o=e[e.length-1])&&"text"===s.type&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,i)),e.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length),o=e[e.length-1],"link"===s.type?(s.tokens=this.inlineTokens(s.text,[],!0,i),e.push(s)):o&&"text"===s.type&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(s=this.tokenizer.emStrong(t,h,u)){t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,i),e.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,i),e.push(s);continue}if(s=this.tokenizer.autolink(t,Y)){t=t.substring(s.raw.length),e.push(s);continue}if(!n&&(s=this.tokenizer.url(t,Y))){t=t.substring(s.raw.length),e.push(s);continue}if(a=t,this.options.extensions&&this.options.extensions.startInline&&function(){var e=1/0,n=t.slice(1),i=void 0;r.options.extensions.startInline.forEach(function(t){"number"==typeof(i=t.call(this,n))&&i>=0&&(e=Math.min(e,i))}),e<1/0&&e>=0&&(a=t.substring(0,e+1))}(),s=this.tokenizer.inlineText(a,i,X)){t=t.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(u=s.raw.slice(-1)),c=!0,(o=e[e.length-1])&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(t){var p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}throw new Error(p)}}return e},function(e,n,i){n&&t(e.prototype,n),i&&t(e,i)}(e,null,[{key:"rules",get:function(){return{block:G,inline:W}}}]),e}(),Q=i.exports.defaults,Z=C,J=x,tt=function(){function t(t){this.options=t||Q}var e=t.prototype;return e.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,i);null!=r&&r!==t&&(n=!0,t=r)}return t=t.replace(/\n$/,"")+"\n",i?'
    '+(n?t:J(t,!0))+"
    \n":"
    "+(n?t:J(t,!0))+"
    \n"},e.blockquote=function(t){return"
    \n"+t+"
    \n"},e.html=function(t){return t},e.heading=function(t,e,n,i){return this.options.headerIds?"'+t+"\n":""+t+"\n"},e.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},e.list=function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"\n"},e.listitem=function(t){return"
  • "+t+"
  • \n"},e.checkbox=function(t){return" "},e.paragraph=function(t){return"

    "+t+"

    \n"},e.table=function(t,e){return e&&(e=""+e+""),"\n\n"+t+"\n"+e+"
    \n"},e.tablerow=function(t){return"\n"+t+"\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"\n"},e.strong=function(t){return""+t+""},e.em=function(t){return""+t+""},e.codespan=function(t){return""+t+""},e.br=function(){return this.options.xhtml?"
    ":"
    "},e.del=function(t){return""+t+""},e.link=function(t,e,n){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return n;var i='"+n+""},e.image=function(t,e,n){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return n;var i=''+n+'":">")},e.text=function(t){return t},t}(),et=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),nt=function(){function t(){this.seen={}}var e=t.prototype;return e.serialize=function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},e.getNextSafeSlug=function(t,e){var n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do{n=t+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=i,this.seen[n]=0),n},e.slug=function(t,e){void 0===e&&(e={});var n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)},t}(),it=tt,rt=et,st=nt,ot=i.exports.defaults,at=S,lt=K,ct=function(){function t(t){this.options=t||ot,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rt,this.slugger=new st}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,i,r,s,o,a,l,c,u,h,d,p,f,g,m,b,y,v,_,w="",x=t.length;for(n=0;n0&&"text"===m.tokens[0].type?(m.tokens[0].text=v+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=v+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:v}):g+=v),g+=this.parse(m.tokens,f),u+=this.renderer.listitem(g,y,b);w+=this.renderer.list(u,d,p);continue;case"html":w+=this.renderer.html(h.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+mt(l.message+"",!0)+"
    ";throw l}}return _t.options=_t.setOptions=function(t){return ft(_t.defaults,t),yt(_t.defaults),_t},_t.getDefaults=bt,_t.defaults=vt,_t.use=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;iAn error occurred:

    "+mt(i.message+"",!0)+"
    ";throw i}},_t.Parser=ct,_t.parser=ct.parse,_t.Renderer=ht,_t.TextRenderer=dt,_t.Lexer=lt,_t.lexer=lt.lex,_t.Tokenizer=ut,_t.Slugger=pt,_t.parse=_t,_t}()},29369:function(t,e,n){var i=n(56284),r=n(67830);function s(){this.clear()}s.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},s.prototype.enqueue=function(t){return this.items.push(t),++this.size},s.prototype.dequeue=function(){if(this.size){var t=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,t}},s.prototype.peek=function(){if(this.size)return this.items[this.offset]},s.prototype.forEach=function(t,e){e=arguments.length>1?e:this;for(var n=this.offset,i=0,r=this.items.length;n=t.length)return{done:!0};var n=t[e];return e++,{value:n,done:!1}})},s.prototype.entries=function(){var t=this.items,e=this.offset,n=0;return new i(function(){if(e>=t.length)return{done:!0};var i=t[e];return e++,{value:[n++,i],done:!1}})},"undefined"!=typeof Symbol&&(s.prototype[Symbol.iterator]=s.prototype.values),s.prototype.toString=function(){return this.toArray().join(",")},s.prototype.toJSON=function(){return this.toArray()},s.prototype.inspect=function(){var t=this.toArray();return Object.defineProperty(t,"constructor",{value:s,enumerable:!1}),t},"undefined"!=typeof Symbol&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(t){var e=new s;return r(t,function(t){e.enqueue(t)}),e},s.of=function(){return s.from(arguments)},t.exports=s},65593:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(72293),o=function(t){function e(){t.apply(this,arguments),this.value=null,this.hasNext=!1,this.hasCompleted=!1}return i(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),s.Subscription.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(r.Subject);e.AsyncSubject=o},73907:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(6594),o=function(t){function e(e){t.call(this),this._value=e}return i(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new s.ObjectUnsubscribedError;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(r.Subject);e.BehaviorSubject=o},36888:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n,i){t.call(this),this.parent=e,this.outerValue=n,this.outerIndex=i,this.index=0}return i(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n(42109).Subscriber);e.InnerSubscriber=r},94429:function(t,e,n){"use strict";var i=n(18705),r=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return i.Observable.of(this.value);case"E":return i.Observable.throw(this.error);case"C":return i.Observable.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();e.Notification=r},18705:function(t,e,n){"use strict";var i=n(80019),r=n(18154),s=n(45783),o=n(10142),a=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var i=this.operator,s=r.toSubscriber(t,e,n);if(i?i.call(s,this.source):s.add(this.source||!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var n=this;if(e||(i.root.Rx&&i.root.Rx.config&&i.root.Rx.config.Promise?e=i.root.Rx.config.Promise:i.root.Promise&&(e=i.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,i){var r;r=n.subscribe(function(e){if(r)try{t(e)}catch(n){i(n),r.unsubscribe()}else t(e)},i,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[s.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;ee&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i},e}(r.Subject);e.ReplaySubject=u;var h=function(t,e){this.time=t,this.value=e}},25430:function(t,e,n){"use strict";var i=n(2369);e.xQ=i.Subject,n(18705),n(24769),n(95914),n(88007),n(3194),n(61898),n(16301),n(23276),n(66593),n(13745),n(57362),n(24518),n(68789),n(30520),n(67370),n(86866),n(11505),n(5031),n(36780),n(17038),n(15718),n(27915),n(90763),n(6846),n(65662),n(6799),n(81854),n(612),n(10838),n(6725),n(8827),n(43511),n(38922),n(25178),n(56937),n(22947),n(82894),n(11206),n(94183),n(16653),n(17930),n(81118),n(50317),n(90674),n(66460),n(79232),n(3945),n(44674),n(73505),n(38749),n(16479),n(22744),n(44475),n(97384),n(8237),n(24937),n(99013),n(84042),n(44436),n(7099),n(6217),n(57476),n(72646),n(91573),n(27387),n(27366),n(88859),n(65425),n(16733),n(23381),n(80404),n(63770),n(53626),n(98851),n(84878),n(26544),n(53582),n(61749),n(34838),n(49681),n(46227),n(56455),n(40881),n(94315),n(92910),n(52442),n(84664),n(61250),n(28310),n(43027),n(18252),n(49571),n(31782),n(9800),n(41854),n(74839),n(1305),n(99144),n(89952),n(85863),n(2865),n(92667),n(22185),n(72919),n(88630),n(75458),n(40780),n(35099),n(57502),n(81676),n(20579),n(71323),n(84950),n(57113),n(95073),n(75654),n(59889),n(96611),n(81845),n(7828),n(4881),n(74568),n(32352),n(50169),n(93543),n(61690),n(15914),n(68583),n(44808),n(49088),n(72293),n(42109),n(65593),n(81959),n(73907),n(51493),n(94429),n(44640),n(11758),n(6594),n(13815),n(84536),n(73390),n(62688),n(24482),n(18353);n(55298);n(10142);n(85522),n(90680),n(97088),n(12948),n(28592),n(72121),n(45783);n(39053)},11965:function(t,e){"use strict";var n=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=Date.now?Date.now:function(){return+new Date},t}();e.Scheduler=n},2369:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(42109),o=n(72293),a=n(6594),l=n(9060),c=n(28592),u=function(t){function e(e){t.call(this,e),this.destination=e}return i(e,t),e}(s.Subscriber);e.SubjectSubscriber=u;var h=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return i(e,t),e.prototype[c.rxSubscriber]=function(){return new u(this)},e.prototype.lift=function(t){var e=new d(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,n=e.length,i=e.slice(),r=0;r=t.length)return void i.complete();i.next(e[n]),t.index=n+1,this.schedule(t)}},e.prototype._subscribe=function(t){var n=this.arrayLike,i=this.scheduler,r=n.length;if(i)return i.schedule(e.dispatch,0,{arrayLike:n,index:0,length:r,subscriber:t});for(var s=0;s1?new e(t,i):1===r?new s.ScalarObservable(t[0],i):new o.EmptyObservable(i)},e.dispatch=function(t){var e=t.array,n=t.index,i=t.subscriber;n>=t.count?i.complete():(i.next(e[n]),!i.closed&&(t.index=n+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.array,i=n.length,r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{array:n,index:0,count:i,subscriber:t});for(var s=0;s1)this.connection=null;else{var n=this.connection,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null}}(o.Subscriber)},34078:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(93658),o=n(84308),a=function(t){function e(e){t.call(this),this.observableFactory=e}return i(e,t),e.create=function(t){return new e(t)},e.prototype._subscribe=function(t){return new l(t,this.observableFactory)},e}(r.Observable);e.DeferObservable=a;var l=function(t){function e(e,n){t.call(this,e),this.factory=n,this.tryDefer()}return i(e,t),e.prototype.tryDefer=function(){try{this._callFactory()}catch(t){this._error(t)}},e.prototype._callFactory=function(){var t=this.factory();t&&this.add(s.subscribeToResult(this,t))},e}(o.OuterSubscriber)},70481:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e){t.call(this),this.scheduler=e}return i(e,t),e.create=function(t){return new e(t)},e.dispatch=function(t){t.subscriber.complete()},e.prototype._subscribe=function(t){var n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{subscriber:t});t.complete()},e}(n(18705).Observable);e.EmptyObservable=r},72210:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this),this.error=e,this.scheduler=n}return i(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){t.subscriber.error(t.error)},e.prototype._subscribe=function(t){var n=this.error,i=this.scheduler;if(t.syncErrorThrowable=!0,i)return i.schedule(e.dispatch,0,{error:n,subscriber:t});t.error(n)},e}(n(18705).Observable);e.ErrorObservable=r},56064:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(70481),o=n(48242),a=n(93658),l=n(84308),c=function(t){function e(e,n){t.call(this),this.sources=e,this.resultSelector=n}return i(e,t),e.create=function(){for(var t=[],n=0;nu?u:e:e}(t)),this.arr=t,this.idx=e,this.len=n}return t.prototype[o.iterator]=function(){return this},t.prototype.next=function(){return this.idx=t.count?i.complete():(i.next(e),!i.closed&&(t.index=n+1,t.start=e+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=0,i=this.start,r=this._count,s=this.scheduler;if(s)return s.schedule(e.dispatch,0,{index:n,count:r,start:i,subscriber:t});for(;;){if(n++>=r){t.complete();break}if(t.next(i++),t.closed)break}},e}(n(18705).Observable);e.RangeObservable=r},80478:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this),this.value=e,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return i(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){var e=t.value,n=t.subscriber;t.done?n.complete():(n.next(e),!n.closed&&(t.done=!0,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.value,i=this.scheduler;if(i)return i.schedule(e.dispatch,0,{done:!1,value:n,subscriber:t});t.next(n),t.closed||t.complete()},e}(n(18705).Observable);e.ScalarObservable=r},82966:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(85522),o=n(39479),a=function(t){function e(e,n,i){void 0===n&&(n=0),void 0===i&&(i=s.asap),t.call(this),this.source=e,this.delayTime=n,this.scheduler=i,(!o.isNumeric(n)||n<0)&&(this.delayTime=0),(!i||"function"!=typeof i.schedule)&&(this.scheduler=s.asap)}return i(e,t),e.create=function(t,n,i){return void 0===n&&(n=0),void 0===i&&(i=s.asap),new e(t,n,i)},e.dispatch=function(t){return this.add(t.source.subscribe(t.subscriber))},e.prototype._subscribe=function(t){return this.scheduler.schedule(e.dispatch,this.delayTime,{source:this.source,subscriber:t})},e}(r.Observable);e.SubscribeOnObservable=a},92870:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(39479),s=n(18705),o=n(90680),a=n(41503),l=n(783),c=function(t){function e(e,n,i){void 0===e&&(e=0),t.call(this),this.period=-1,this.dueTime=0,r.isNumeric(n)?this.period=Number(n)<1?1:Number(n):a.isScheduler(n)&&(i=n),a.isScheduler(i)||(i=o.async),this.scheduler=i,this.dueTime=l.isDate(e)?+e-this.scheduler.now():e}return i(e,t),e.create=function(t,n,i){return void 0===t&&(t=0),new e(t,n,i)},e.dispatch=function(t){var e=t.index,n=t.period,i=t.subscriber;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}},e.prototype._subscribe=function(t){var n=this;return n.scheduler.schedule(e.dispatch,n.dueTime,{index:0,period:n.period,subscriber:t})},e}(s.Observable);e.TimerObservable=c},16196:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(93658),o=n(84308),a=function(t){function e(e,n){t.call(this),this.resourceFactory=e,this.observableFactory=n}return i(e,t),e.create=function(t,n){return new e(t,n)},e.prototype._subscribe=function(t){var e,n=this.resourceFactory,i=this.observableFactory;try{return e=n(),new l(t,e,i)}catch(r){t.error(r)}},e}(r.Observable);e.UsingObservable=a;var l=function(t){function e(e,n,i){t.call(this,e),this.resource=n,this.observableFactory=i,e.add(n),this.tryUse()}return i(e,t),e.prototype.tryUse=function(){try{var t=this.observableFactory.call(this,this.resource);t&&this.add(s.subscribeToResult(this,t))}catch(e){this._error(e)}},e}(o.OuterSubscriber)},59246:function(t,e,n){"use strict";var i=n(19183);e.bindCallback=i.BoundCallbackObservable.create},65571:function(t,e,n){"use strict";var i=n(78655);e.bindNodeCallback=i.BoundNodeCallbackObservable.create},24669:function(t,e,n){"use strict";var i=n(41503),r=n(48242),s=n(96177),o=n(49134);e.combineLatest=function(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof l&&(n=t.pop()),null===a&&1===t.length&&t[0]instanceof i.Observable?t[0]:o.mergeAll(n)(new r.ArrayObservable(t,a))}},94503:function(t,e,n){"use strict";var i=n(20143);e.never=i.NeverObservable.create},69657:function(t,e,n){"use strict";var i=n(96177);e.of=i.ArrayObservable.of},61395:function(t,e,n){"use strict";var i=n(46243);e.onErrorResumeNext=i.onErrorResumeNextStatic},95425:function(t,e,n){"use strict";var i=n(19770);e.pairs=i.PairsObservable.create},24330:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(48242),s=n(96177),o=n(84308),a=n(93658);e.race=function(){for(var t=[],e=0;e=2&&(o=arguments[1]);var a=Number.POSITIVE_INFINITY;return e>=3&&(a=arguments[2]),s.bufferTime(t,o,a,n)(this)}},92523:function(t,e,n){"use strict";var i=n(15440);e.bufferToggle=function(t,e){return i.bufferToggle(t,e)(this)}},49436:function(t,e,n){"use strict";var i=n(51786);e.bufferWhen=function(t){return i.bufferWhen(t)(this)}},64731:function(t,e,n){"use strict";var i=n(93017);e._catch=function(t){return i.catchError(t)(this)}},92273:function(t,e,n){"use strict";var i=n(17054);e.combineAll=function(t){return i.combineAll(t)(this)}},8709:function(t,e,n){"use strict";var i=n(49134);e.combineLatest=function(){for(var t=[],e=0;e=2?i.reduce(t,e)(this):i.reduce(t)(this)}},12931:function(t,e,n){"use strict";var i=n(15329);e.repeat=function(t){return void 0===t&&(t=-1),i.repeat(t)(this)}},68816:function(t,e,n){"use strict";var i=n(63964);e.repeatWhen=function(t){return i.repeatWhen(t)(this)}},17144:function(t,e,n){"use strict";var i=n(40241);e.retry=function(t){return void 0===t&&(t=-1),i.retry(t)(this)}},82766:function(t,e,n){"use strict";var i=n(23896);e.retryWhen=function(t){return i.retryWhen(t)(this)}},62068:function(t,e,n){"use strict";var i=n(92043);e.sample=function(t){return i.sample(t)(this)}},97013:function(t,e,n){"use strict";var i=n(90680),r=n(71239);e.sampleTime=function(t,e){return void 0===e&&(e=i.async),r.sampleTime(t,e)(this)}},98996:function(t,e,n){"use strict";var i=n(64949);e.scan=function(t,e){return arguments.length>=2?i.scan(t,e)(this):i.scan(t)(this)}},77033:function(t,e,n){"use strict";var i=n(88948);e.sequenceEqual=function(t,e){return i.sequenceEqual(t,e)(this)}},10377:function(t,e,n){"use strict";var i=n(35473);e.share=function(){return i.share()(this)}},71623:function(t,e,n){"use strict";var i=n(62704);e.shareReplay=function(t,e,n){return i.shareReplay(t,e,n)(this)}},91956:function(t,e,n){"use strict";var i=n(92223);e.single=function(t){return i.single(t)(this)}},72355:function(t,e,n){"use strict";var i=n(11189);e.skip=function(t){return i.skip(t)(this)}},69329:function(t,e,n){"use strict";var i=n(73346);e.skipLast=function(t){return i.skipLast(t)(this)}},68481:function(t,e,n){"use strict";var i=n(12928);e.skipUntil=function(t){return i.skipUntil(t)(this)}},587:function(t,e,n){"use strict";var i=n(69415);e.skipWhile=function(t){return i.skipWhile(t)(this)}},49292:function(t,e,n){"use strict";var i=n(30673);e.startWith=function(){for(var t=[],e=0;e0&&this.destination.next(e),t.prototype._complete.call(this)},e}(r.Subscriber),a=function(t){function e(e,n,i){t.call(this,e),this.bufferSize=n,this.startBufferEvery=i,this.buffers=[],this.count=0}return i(e,t),e.prototype._next=function(t){var e=this,n=e.bufferSize,i=e.startBufferEvery,r=e.buffers,s=e.count;this.count++,s%i==0&&r.push([]);for(var o=r.length;o--;){var a=r[o];a.push(t),a.length===n&&(r.splice(o,1),this.destination.next(a))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var i=e.shift();i.length>0&&n.next(i)}t.prototype._complete.call(this)},e}(r.Subscriber)},6489:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(90680),s=n(42109),o=n(41503);e.bufferTime=function(t){var e=arguments.length,n=r.async;o.isScheduler(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var i=null;e>=2&&(i=arguments[1]);var s=Number.POSITIVE_INFINITY;return e>=3&&(s=arguments[2]),function(e){return e.lift(new a(t,i,s,n))}};var a=function(){function t(t,e,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),l=function(){this.buffer=[]},c=function(t){function e(e,n,i,r,s){t.call(this,e),this.bufferTimeSpan=n,this.bufferCreationInterval=i,this.maxBufferSize=r,this.scheduler=s,this.contexts=[];var o=this.openContext();if(this.timespanOnly=null==i||i<0,this.timespanOnly)this.add(o.closeAction=s.schedule(u,n,{subscriber:this,context:o,bufferTimeSpan:n}));else{var a={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:this,scheduler:s};this.add(o.closeAction=s.schedule(d,n,{subscriber:this,context:o})),this.add(s.schedule(h,i,a))}}return i(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,i=n.length,r=0;r0;){var i=e.shift();n.next(i.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan;this.add(t.closeAction=this.scheduler.schedule(u,n,{subscriber:this,context:t,bufferTimeSpan:n}))}},e.prototype.openContext=function(){var t=new l;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(s.Subscriber);function u(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function h(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,i=t.subscriber,r=t.scheduler,s=i.openContext();i.closed||(i.add(s.closeAction=r.schedule(d,n,{subscriber:i,context:s})),this.schedule(t,e))}function d(t){t.subscriber.closeContext(t.context)}},15440:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(72293),s=n(93658),o=n(84308);e.bufferToggle=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.openings,this.closingSelector))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(s.subscribeToResult(this,n))}return i(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,i=0;i0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(n){this._error(n)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.subscription;this.destination.next(t.buffer),e.splice(e.indexOf(t),1),this.remove(n),n.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new r.Subscription,i={buffer:[],subscription:n};e.push(i);var o=s.subscribeToResult(this,t,i);!o||o.closed?this.closeBuffer(i):(o.context=i,this.add(o),n.add(o))},e}(o.OuterSubscriber)},51786:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(72293),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.bufferWhen=function(t){return function(e){return e.lift(new c(t))}};var c=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.closingSelector))},t}(),u=function(t){function e(e,n){t.call(this,e),this.closingSelector=n,this.subscribing=!1,this.openBuffer()}return i(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,i,r){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe()),this.buffer&&this.destination.next(this.buffer),this.buffer=[];var e=s.tryCatch(this.closingSelector)();e===o.errorObject?this.error(o.errorObject.e):(t=new r.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(l.subscribeToResult(this,e)),this.subscribing=!1)},e}(a.OuterSubscriber)},93017:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.catchError=function(t){return function(e){var n=new o(t),i=e.lift(n);return n.caught=i}};var o=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.selector,this.caught))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.selector=n,this.caught=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(i){return void t.prototype.error.call(this,i)}this._unsubscribeAndRecycle(),this.add(s.subscribeToResult(this,n))}},e}(r.OuterSubscriber)},17054:function(t,e,n){"use strict";var i=n(49134);e.combineAll=function(t){return function(e){return e.lift(new i.CombineLatestOperator(t))}}},49134:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(96177),s=n(48242),o=n(84308),a=n(93658),l={};e.combineLatest=function(){for(var t=[],e=0;e0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){var s=Math.max(0,n[0].time-i.now());this.schedule(t,s)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new u(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(a.Notification.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t)},e.prototype._complete=function(){this.scheduleNotification(a.Notification.createComplete())},e}(o.Subscriber),u=function(t,e){this.time=t,this.notification=e}},22944:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(18705),o=n(84308),a=n(93658);e.delayWhen=function(t,e){return e?function(n){return new u(n,e).lift(new l(t))}:function(e){return e.lift(new l(t))}};var l=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.delayDurationSelector))},t}(),c=function(t){function e(e,n){t.call(this,e),this.delayDurationSelector=n,this.completed=!1,this.delayNotifierSubscriptions=[],this.values=[]}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.destination.next(t),this.removeSubscription(r),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){try{var e=this.delayDurationSelector(t);e&&this.tryDelay(e,t)}catch(n){this.destination.error(n)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t),n=null;return-1!==e&&(n=this.values[e],this.delayNotifierSubscriptions.splice(e,1),this.values.splice(e,1)),n},e.prototype.tryDelay=function(t,e){var n=a.subscribeToResult(this,t,e);n&&!n.closed&&(this.add(n),this.delayNotifierSubscriptions.push(n)),this.values.push(e)},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(o.OuterSubscriber),u=function(t){function e(e,n){t.call(this),this.source=e,this.subscriptionDelay=n}return i(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new h(t,this.source))},e}(s.Observable),h=function(t){function e(e,n){t.call(this),this.parent=e,this.source=n,this.sourceSubscribed=!1}return i(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(r.Subscriber)},95591:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.dematerialize=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new o(t))},t}(),o=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(r.Subscriber)},25753:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658),o=n(40317);e.distinct=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.keySelector,this.flushes))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.keySelector=n,this.values=new o.Set,i&&this.add(s.subscribeToResult(this,i))}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(i){return void n.error(i)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(r.OuterSubscriber);e.DistinctSubscriber=l},65608:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(33463),o=n(85814);e.distinctUntilChanged=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.compare,this.keySelector))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.keySelector=i,this.hasKey=!1,"function"==typeof n&&(this.compare=n)}return i(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e=t;if(this.keySelector&&(e=s.tryCatch(this.keySelector)(t))===o.errorObject)return this.destination.error(o.errorObject.e);var n=!1;if(this.hasKey){if((n=s.tryCatch(this.compare)(this.key,e))===o.errorObject)return this.destination.error(o.errorObject.e)}else this.hasKey=!0;!1===Boolean(n)&&(this.key=e,this.destination.next(t))},e}(r.Subscriber)},8330:function(t,e,n){"use strict";var i=n(65608);e.distinctUntilKeyChanged=function(t,e){return i.distinctUntilChanged(function(n,i){return e?e(n[t],i[t]):n[t]===i[t]})}},29264:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758);e.elementAt=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){if(this.index=t,this.defaultValue=e,t<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.index,this.defaultValue))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.index=n,this.defaultValue=i}return i(e,t),e.prototype._next=function(t){0==this.index--&&(this.destination.next(t),this.destination.complete())},e.prototype._complete=function(){var t=this.destination;this.index>=0&&(void 0!==this.defaultValue?t.next(this.defaultValue):t.error(new s.ArgumentOutOfRangeError)),t.complete()},e}(r.Subscriber)},26285:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.every=function(t,e){return function(n){return n.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.thisArg,this.source))},t}(),o=function(t){function e(e,n,i,r){t.call(this,e),this.predicate=n,this.thisArg=i,this.source=r,this.index=0,this.thisArg=i||this}return i(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(n){return void this.destination.error(n)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(r.Subscriber)},93229:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.exhaust=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){t.call(this,e),this.hasCompleted=!1,this.hasSubscription=!1}return i(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(s.subscribeToResult(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber)},15758:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.exhaustMap=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.resultSelector=i,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}return i(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e=this.index++,n=this.destination;try{var i=this.project(t,e);this.hasSubscription=!0,this.add(s.subscribeToResult(this,i,t,e))}catch(r){n.error(r)}},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyNext=function(t,e,n,i,r){var s=this.destination;this.resultSelector?this.trySelectResult(t,e,n,i):s.next(e)},e.prototype.trySelectResult=function(t,e,n,i){var r=this.resultSelector,s=this.destination;try{var o=r(t,e,n,i);s.next(o)}catch(a){s.error(a)}},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber)},55364:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(33463),s=n(85814),o=n(84308),a=n(93658);e.expand=function(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(i){return i.lift(new l(t,e,n))}};var l=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.concurrent,this.scheduler))},t}();e.ExpandOperator=l;var c=function(t){function e(e,n,i,r){t.call(this,e),this.project=n,this.concurrent=i,this.scheduler=r,this.index=0,this.active=0,this.hasCompleted=!1,i0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(o.OuterSubscriber);e.ExpandSubscriber=c},27015:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.filter=function(t,e){return function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.thisArg))},t}(),o=function(t){function e(e,n,i){t.call(this,e),this.predicate=n,this.thisArg=i,this.count=0}return i(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)},e}(r.Subscriber)},94367:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(72293);e.finalize=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.callback))},t}(),a=function(t){function e(e,n){t.call(this,e),this.add(new s.Subscription(n))}return i(e,t),e}(r.Subscriber)},16700:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.find=function(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new s(t,n,!1,e))}};var s=function(){function t(t,e,n,i){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}();e.FindValueOperator=s;var o=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.source=i,this.yieldIndex=r,this.thisArg=s,this.index=0}return i(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,i=this.index++;try{e.call(n||this,t,i,this.source)&&this.notifyComplete(this.yieldIndex?i:t)}catch(r){this.destination.error(r)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(r.Subscriber);e.FindValueSubscriber=o},86452:function(t,e,n){"use strict";var i=n(16700);e.findIndex=function(t,e){return function(n){return n.lift(new i.FindValueOperator(t,n,!0,e))}}},12309:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.first=function(t,e,n){return function(i){return i.lift(new o(t,e,n,i))}};var o=function(){function t(t,e,n,i){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=i}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),a=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=s,this.index=0,this.hasCompleted=!1,this._emitted=!1}return i(e,t),e.prototype._next=function(t){var e=this.index++;this.predicate?this._tryPredicate(t,e):this._emit(t,e)},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(i){return void this.destination.error(i)}n&&this._emit(t,e)},e.prototype._emit=function(t,e){this.resultSelector?this._tryResultSelector(t,e):this._emitFinal(t)},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(i){return void this.destination.error(i)}this._emitFinal(n)},e.prototype._emitFinal=function(t){var e=this.destination;this._emitted||(this._emitted=!0,e.next(t),e.complete(),this.hasCompleted=!0)},e.prototype._complete=function(){var t=this.destination;this.hasCompleted||void 0===this.defaultValue?this.hasCompleted||t.error(new s.EmptyError):(t.next(this.defaultValue),t.complete())},e}(r.Subscriber)},92577:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(72293),o=n(18705),a=n(2369),l=n(49754),c=n(30764);e.groupBy=function(t,e,n,i){return function(r){return r.lift(new u(t,e,n,i))}};var u=function(){function t(t,e,n,i){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),h=function(t){function e(e,n,i,r,s){t.call(this,e),this.keySelector=n,this.elementSelector=i,this.durationSelector=r,this.subjectSelector=s,this.groups=null,this.attemptedToUnsubscribe=!1,this.count=0}return i(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(n){return void this.error(n)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups="string"==typeof e?new c.FastMap:new l.Map);var i,r=n.get(e);if(this.elementSelector)try{i=this.elementSelector(t)}catch(u){this.error(u)}else i=t;if(!r){r=this.subjectSelector?this.subjectSelector():new a.Subject,n.set(e,r);var s=new p(e,r,this);if(this.destination.next(s),this.durationSelector){var o=void 0;try{o=this.durationSelector(new p(e,r))}catch(u){return void this.error(u)}this.add(o.subscribe(new d(e,r,this)))}}r.closed||r.next(i)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach(function(e,n){e.error(t)}),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach(function(t,e){t.complete()}),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(r.Subscriber),d=function(t){function e(e,n,i){t.call(this,n),this.key=e,this.group=n,this.parent=i}return i(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(r.Subscriber),p=function(t){function e(e,n,i){t.call(this),this.key=e,this.groupSubject=n,this.refCountSubscription=i}return i(e,t),e.prototype._subscribe=function(t){var e=new s.Subscription,n=this.refCountSubscription,i=this.groupSubject;return n&&!n.closed&&e.add(new f(n)),e.add(i.subscribe(t)),e},e}(o.Observable);e.GroupedObservable=p;var f=function(t){function e(e){t.call(this),this.parent=e,e.count++}return i(e,t),e.prototype.unsubscribe=function(){var e=this.parent;!e.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(s.Subscription)},86898:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(68668);e.ignoreElements=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._next=function(t){s.noop()},e}(r.Subscriber)},89121:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.isEmpty=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new o(t))},t}(),o=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(r.Subscriber)},4636:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.last=function(t,e,n){return function(i){return i.lift(new o(t,e,n,i))}};var o=function(){function t(t,e,n,i){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=i}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),a=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=s,this.hasValue=!1,this.index=0,void 0!==r&&(this.lastValue=r,this.hasValue=!0)}return i(e,t),e.prototype._next=function(t){var e=this.index++;if(this.predicate)this._tryPredicate(t,e);else{if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(i){return void this.destination.error(i)}if(n){if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(i){return void this.destination.error(i)}this.lastValue=n,this.hasValue=!0},e.prototype._complete=function(){var t=this.destination;this.hasValue?(t.next(this.lastValue),t.complete()):t.error(new s.EmptyError)},e}(r.Subscriber)},40119:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.map=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.project,this.thisArg))},t}();e.MapOperator=s;var o=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.count=0,this.thisArg=i||this}return i(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(r.Subscriber)},23491:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.mapTo=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.value))},t}(),o=function(t){function e(e,n){t.call(this,e),this.value=n}return i(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(r.Subscriber)},71177:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(94429);e.materialize=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype._next=function(t){this.destination.next(s.Notification.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(s.Notification.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(s.Notification.createComplete()),t.complete()},e}(r.Subscriber)},33499:function(t,e,n){"use strict";var i=n(97369);e.max=function(t){return i.reduce("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}},56098:function(t,e,n){"use strict";var i=n(38781),r=n(38781);e.mergeStatic=r.merge,e.merge=function(){for(var t=[],e=0;e0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(s.OuterSubscriber);e.MergeMapSubscriber=a},6693:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.mergeMapTo=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"number"==typeof e&&(n=e,e=null),function(i){return i.lift(new o(t,e,n))}};var o=function(){function t(t,e,n){void 0===n&&(n=Number.POSITIVE_INFINITY),this.ish=t,this.resultSelector=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.ish,this.resultSelector,this.concurrent))},t}();e.MergeMapToOperator=o;var a=function(t){function e(e,n,i,r){void 0===r&&(r=Number.POSITIVE_INFINITY),t.call(this,e),this.ish=n,this.resultSelector=i,this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber);e.MergeMapToSubscriber=a},7550:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(33463),s=n(85814),o=n(93658),a=n(84308);e.mergeScan=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(i){return i.lift(new l(t,e,n))}};var l=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.accumulator,this.seed,this.concurrent))},t}();e.MergeScanOperator=l;var c=function(t){function e(e,n,i,r){t.call(this,e),this.accumulator=n,this.acc=i,this.concurrent=r,this.hasValue=!1,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(a.OuterSubscriber);e.MergeScanSubscriber=c},51213:function(t,e,n){"use strict";var i=n(97369);e.min=function(t){return i.reduce("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t=2?function(n){return o.pipe(i.scan(t,e),r.takeLast(1),s.defaultIfEmpty(e))(n)}:function(e){return o.pipe(i.scan(function(e,n,i){return t(e,n,i+1)}),r.takeLast(1))(e)}}},1694:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.refCount=function(){return function(t){return t.lift(new s(t))}};var s=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var i=new o(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r},t}(),o=function(t){function e(e,n){t.call(this,e),this.connectable=n}return i(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null},e}(r.Subscriber)},15329:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(70481);e.repeat=function(t){return void 0===t&&(t=-1),function(e){return 0===t?new s.EmptyObservable:e.lift(new o(t<0?-1:t-1,e))}};var o=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.count,this.source))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.count=n,this.source=i}return i(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(r.Subscriber)},63964:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.repeatWhen=function(t){return function(e){return e.lift(new c(t))}};var c=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,e))},t}(),u=function(t){function e(e,n,i){t.call(this,e),this.notifier=n,this.source=i,this.sourceIsBeingSubscribedTo=!0}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this,n=e.notifications,i=e.retries,r=e.retriesSubscription;return this.notifications=null,this.retries=null,this.retriesSubscription=null,t.prototype._unsubscribeAndRecycle.call(this),this.notifications=n,this.retries=i,this.retriesSubscription=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new r.Subject;var e=s.tryCatch(this.notifier)(this.notifications);if(e===o.errorObject)return t.prototype.complete.call(this);this.retries=e,this.retriesSubscription=l.subscribeToResult(this,e)},e}(a.OuterSubscriber)},40241:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.retry=function(t){return void 0===t&&(t=-1),function(e){return e.lift(new s(t,e))}};var s=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.count,this.source))},t}(),o=function(t){function e(e,n,i){t.call(this,e),this.count=n,this.source=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,i=this.count;if(0===i)return t.prototype.error.call(this,e);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(r.Subscriber)},23896:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.retryWhen=function(t){return function(e){return e.lift(new c(t,e))}};var c=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,this.source))},t}(),u=function(t){function e(e,n,i){t.call(this,e),this.notifier=n,this.source=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,i=this.retries,a=this.retriesSubscription;if(i)this.errors=null,this.retriesSubscription=null;else{if(n=new r.Subject,(i=s.tryCatch(this.notifier)(n))===o.errorObject)return t.prototype.error.call(this,o.errorObject.e);a=l.subscribeToResult(this,i)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=a,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,i,r){var s=this,o=s.errors,a=s.retries,l=s.retriesSubscription;this.errors=null,this.retries=null,this.retriesSubscription=null,this._unsubscribeAndRecycle(),this.errors=o,this.retries=a,this.retriesSubscription=l,this.source.subscribe(this)},e}(a.OuterSubscriber)},92043:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.sample=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new a(t),i=e.subscribe(n);return i.add(s.subscribeToResult(n,this.notifier)),i},t}(),a=function(t){function e(){t.apply(this,arguments),this.hasValue=!1}return i(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,i,r){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(r.OuterSubscriber)},71239:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(90680);e.sampleTime=function(t,e){return void 0===e&&(e=s.async),function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.period,this.scheduler))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.period=n,this.scheduler=i,this.hasValue=!1,this.add(i.schedule(l,n,{subscriber:this,period:n}))}return i(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(r.Subscriber);function l(t){var e=t.period;t.subscriber.notifyNext(),this.schedule(t,e)}},64949:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.scan=function(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.accumulator,this.seed,this.hasSeed))},t}(),o=function(t){function e(e,n,i,r){t.call(this,e),this.accumulator=n,this._seed=i,this.hasSeed=r,this.index=0}return i(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(i){this.destination.error(i)}this.seed=e,this.destination.next(e)},e}(r.Subscriber)},88948:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(33463),o=n(85814);e.sequenceEqual=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.compareTo=t,this.comparor=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.compareTo,this.comparor))},t}();e.SequenceEqualOperator=a;var l=function(t){function e(e,n,i){t.call(this,e),this.compareTo=n,this.comparor=i,this._a=[],this._b=[],this._oneComplete=!1,this.add(n.subscribe(new c(e,this)))}return i(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e.prototype.checkValues=function(){for(var t=this,e=t._a,n=t._b,i=t.comparor;e.length>0&&n.length>0;){var r=e.shift(),a=n.shift(),l=!1;i?(l=s.tryCatch(i)(r,a))===o.errorObject&&this.destination.error(o.errorObject.e):l=r===a,l||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e}(r.Subscriber);e.SequenceEqualSubscriber=l;var c=function(t){function e(e,n){t.call(this,e),this.parent=n}return i(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t)},e.prototype._complete=function(){this.parent._complete()},e}(r.Subscriber)},35473:function(t,e,n){"use strict";var i=n(27372),r=n(1694),s=n(2369);function o(){return new s.Subject}e.share=function(){return function(t){return r.refCount()(i.multicast(o)(t))}}},62704:function(t,e,n){"use strict";var i=n(81959);e.shareReplay=function(t,e,n){return function(r){return r.lift(function(t,e,n){var r,s,o=0,a=!1,l=!1;return function(c){o++,(!r||a)&&(a=!1,r=new i.ReplaySubject(t,e,n),s=c.subscribe({next:function(t){r.next(t)},error:function(t){a=!0,r.error(t)},complete:function(){l=!0,r.complete()}}));var u=r.subscribe(this);return function(){o--,u.unsubscribe(),s&&0===o&&l&&s.unsubscribe()}}}(t,e,n))}}},92223:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.single=function(t){return function(e){return e.lift(new o(t,e))}};var o=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.source))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.predicate=n,this.source=i,this.seenValue=!1,this.index=0}return i(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(n){this.destination.error(n)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new s.EmptyError)},e}(r.Subscriber)},11189:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.skip=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.total))},t}(),o=function(t){function e(e,n){t.call(this,e),this.total=n,this.count=0}return i(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(r.Subscriber)},73346:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758);e.skipLast=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(0===this._skipCount?new r.Subscriber(t):new a(t,this._skipCount))},t}(),a=function(t){function e(e,n){t.call(this,e),this._skipCount=n,this._count=0,this._ring=new Array(n)}return i(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n1?new i.ArrayObservable(t,n):new s.EmptyObservable(n),e)}}},10118:function(t,e,n){"use strict";var i=n(82966);e.subscribeOn=function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new r(t,e))}};var r=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new i.SubscribeOnObservable(e,this.delay,this.scheduler).subscribe(t)},t}()},77243:function(t,e,n){"use strict";var i=n(18483),r=n(5027);e.switchAll=function(){return i.switchMap(r.identity)}},18483:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.switchMap=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.resultSelector=i,this.index=0}return i(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var i=this.innerSubscription;i&&i.unsubscribe(),this.add(this.innerSubscription=s.subscribeToResult(this,t,e,n))},e.prototype._complete=function(){var e=this.innerSubscription;(!e||e.closed)&&t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){this.resultSelector?this._tryNotifyNext(t,e,n,i):this.destination.next(e)},e.prototype._tryNotifyNext=function(t,e,n,i){var r;try{r=this.resultSelector(t,e,n,i)}catch(s){return void this.destination.error(s)}this.destination.next(r)},e}(r.OuterSubscriber)},10684:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.switchMapTo=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.observable=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.observable,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.inner=n,this.resultSelector=i,this.index=0}return i(e,t),e.prototype._next=function(t){var e=this.innerSubscription;e&&e.unsubscribe(),this.add(this.innerSubscription=s.subscribeToResult(this,this.inner,t,this.index++))},e.prototype._complete=function(){var e=this.innerSubscription;(!e||e.closed)&&t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){var s=this.destination;this.resultSelector?this.tryResultSelector(t,e,n,i):s.next(e)},e.prototype.tryResultSelector=function(t,e,n,i){var r,s=this.resultSelector,o=this.destination;try{r=s(t,e,n,i)}catch(a){return void o.error(a)}o.next(r)},e}(r.OuterSubscriber)},44396:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758),o=n(70481);e.take=function(t){return function(e){return 0===t?new o.EmptyObservable:e.lift(new a(t))}};var a=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.total))},t}(),l=function(t){function e(e,n){t.call(this,e),this.total=n,this.count=0}return i(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(r.Subscriber)},73935:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758),o=n(70481);e.takeLast=function(t){return function(e){return 0===t?new o.EmptyObservable:e.lift(new a(t))}};var a=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.total))},t}(),l=function(t){function e(e,n){t.call(this,e),this.total=n,this.ring=new Array,this.count=0}return i(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,i=this.count++;e.length0)for(var n=this.count>=this.total?this.total:this.count,i=this.ring,r=0;r0?this.startWindowEvery:this.windowSize,n=this.destination,i=this.windowSize,r=this.windows,o=r.length,a=0;a=0&&l%e==0&&!this.closed&&r.shift().complete(),++this.count%e==0&&!this.closed){var c=new s.Subject;r.push(c),n.next(c)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(r.Subscriber)},42603:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(90680),o=n(42109),a=n(39479),l=n(41503);e.windowTime=function(t){var e=s.async,n=null,i=Number.POSITIVE_INFINITY;return l.isScheduler(arguments[3])&&(e=arguments[3]),l.isScheduler(arguments[2])?e=arguments[2]:a.isNumeric(arguments[2])&&(i=arguments[2]),l.isScheduler(arguments[1])?e=arguments[1]:a.isNumeric(arguments[1])&&(n=arguments[1]),function(r){return r.lift(new c(t,n,i,e))}};var c=function(){function t(t,e,n,i){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),u=function(t){function e(){t.apply(this,arguments),this._numberOfNextedValues=0}return i(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(r.Subject),h=function(t){function e(e,n,i,r,s){t.call(this,e),this.destination=e,this.windowTimeSpan=n,this.windowCreationInterval=i,this.maxWindowSize=r,this.scheduler=s,this.windows=[];var o=this.openWindow();if(null!==i&&i>=0){var a={windowTimeSpan:n,windowCreationInterval:i,subscriber:this,scheduler:s};this.add(s.schedule(f,n,{subscriber:this,window:o,context:null})),this.add(s.schedule(p,i,a))}else this.add(s.schedule(d,n,{subscriber:this,window:o,windowTimeSpan:n}))}return i(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,i=0;i=this.maxWindowSize&&this.closeWindow(r))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new u;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(o.Subscriber);function d(t){var e=t.subscriber,n=t.windowTimeSpan,i=t.window;i&&e.closeWindow(i),t.window=e.openWindow(),this.schedule(t,n)}function p(t){var e=t.windowTimeSpan,n=t.subscriber,i=t.scheduler,r=t.windowCreationInterval,s=n.openWindow(),o=this,a={action:o,subscription:null};a.subscription=i.schedule(f,e,{subscriber:n,window:s,context:a}),o.add(a.subscription),o.schedule(t,r)}function f(t){var e=t.subscriber,n=t.window,i=t.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),e.closeWindow(n)}},59048:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(72293),o=n(33463),a=n(85814),l=n(84308),c=n(93658);e.windowToggle=function(t,e){return function(n){return n.lift(new u(t,e))}};var u=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.openings,this.closingSelector))},t}(),h=function(t){function e(e,n,i){t.call(this,e),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(this.openSubscription=c.subscribeToResult(this,n,n))}return i(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,i=0;i0){var o=s.indexOf(n);-1!==o&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(r.OuterSubscriber)},9477:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(96177),s=n(48242),o=n(42109),a=n(84308),l=n(93658),c=n(72121);function u(){for(var t=[],e=0;ethis.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),g=function(t){function e(e,n,i){t.call(this,e),this.parent=n,this.observable=i,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return i(e,t),e.prototype[c.iterator]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,n,i,r){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return l.subscribeToResult(this,this.observable,this,e)},e}(a.OuterSubscriber)},33310:function(t,e,n){"use strict";var i=n(9477);e.zipAll=function(t){return function(e){return e.lift(new i.ZipOperator(t))}}},28101:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this)}return i(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(72293).Subscription);e.Action=r},67529:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(12624),s=n(95018),o=function(t){function e(e,n){t.call(this,e,n),this.scheduler=e,this.work=n}return i(e,t),e.prototype.requestAsyncId=function(e,n,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,n,i):(e.actions.push(this),e.scheduled||(e.scheduled=s.AnimationFrame.requestAnimationFrame(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,i);0===e.actions.length&&(s.AnimationFrame.cancelAnimationFrame(n),e.scheduled=void 0)},e}(r.AsyncAction);e.AnimationFrameAction=o},68909:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,i=-1,r=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i0?t.prototype.requestAsyncId.call(this,e,n,i):(e.actions.push(this),e.scheduled||(e.scheduled=r.Immediate.setImmediate(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,i);0===e.actions.length&&(r.Immediate.clearImmediate(n),e.scheduled=void 0)},e}(n(12624).AsyncAction);e.AsapAction=s},25766:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,i=-1,r=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,i):e.flush(this)},e}(n(12624).AsyncAction);e.QueueAction=r},77373:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e}(n(42704).AsyncScheduler);e.QueueScheduler=r},18353:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(12624),s=function(t){function e(e,n){var i=this;void 0===e&&(e=o),void 0===n&&(n=Number.POSITIVE_INFINITY),t.call(this,e,function(){return i.frame}),this.maxFrames=n,this.frame=0,this.index=-1}return i(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,i=this.maxFrames;(e=n.shift())&&(this.frame=e.delay)<=i&&!(t=e.execute(e.state,e.delay)););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(n(42704).AsyncScheduler);e.VirtualTimeScheduler=s;var o=function(t){function e(e,n,i){void 0===i&&(i=e.index+=1),t.call(this,e,n),this.scheduler=e,this.work=n,this.index=i,this.active=!0,this.index=e.index=i}return i(e,t),e.prototype.schedule=function(n,i){if(void 0===i&&(i=0),!this.id)return t.prototype.schedule.call(this,n,i);this.active=!1;var r=new e(this.scheduler,this.work);return this.add(r),r.schedule(n,i)},e.prototype.requestAsyncId=function(t,n,i){void 0===i&&(i=0),this.delay=t.frame+i;var r=t.actions;return r.push(this),r.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){void 0===n&&(n=0)},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(r.AsyncAction);e.VirtualAction=o},12948:function(t,e,n){"use strict";var i=n(67529),r=n(68909);e.animationFrame=new r.AnimationFrameScheduler(i.AnimationFrameAction)},85522:function(t,e,n){"use strict";var i=n(3496),r=n(25766);e.asap=new r.AsapScheduler(i.AsapAction)},90680:function(t,e,n){"use strict";var i=n(12624),r=n(42704);e.async=new r.AsyncScheduler(i.AsyncAction)},97088:function(t,e,n){"use strict";var i=n(7100),r=n(77373);e.queue=new r.QueueScheduler(i.QueueAction)},72121:function(t,e,n){"use strict";var i=n(80019);function r(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var n=t.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var i=t.Map;if(i)for(var r=Object.getOwnPropertyNames(i.prototype),s=0;s0;)e.shift().setup();t.prototype.flush.call(this);for(var n=this.flushTests.filter(function(t){return t.ready});n.length>0;){var i=n.shift();this.assertDeepEqual(i.actual,i.expected)}},e.parseMarblesAsSubscriptions=function(t){if("string"!=typeof t)return new l.SubscriptionLog(Number.POSITIVE_INFINITY);for(var e=t.length,n=-1,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,s=0;s-1?n:o;break;case"!":if(r!==Number.POSITIVE_INFINITY)throw new Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");r=n>-1?n:o;break;default:throw new Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+a+"'.")}}return r<0?new l.SubscriptionLog(i):new l.SubscriptionLog(i,r)},e.parseMarbles=function(t,e,n,i){if(void 0===i&&(i=!1),-1!==t.indexOf("!"))throw new Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var r=t.length,a=[],l=t.indexOf("^"),c=-1===l?0:l*-this.frameTimeFactor,u="object"!=typeof e?function(t){return t}:function(t){return i&&e[t]instanceof o.ColdObservable?e[t].messages:e[t]},h=-1,d=0;d-1?h:p,notification:f})}return a},e}(c.VirtualTimeScheduler);e.TestScheduler=u},95018:function(t,e,n){"use strict";var i=n(80019),r=function(t){t.requestAnimationFrame?(this.cancelAnimationFrame=t.cancelAnimationFrame.bind(t),this.requestAnimationFrame=t.requestAnimationFrame.bind(t)):t.mozRequestAnimationFrame?(this.cancelAnimationFrame=t.mozCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.mozRequestAnimationFrame.bind(t)):t.webkitRequestAnimationFrame?(this.cancelAnimationFrame=t.webkitCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.webkitRequestAnimationFrame.bind(t)):t.msRequestAnimationFrame?(this.cancelAnimationFrame=t.msCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.msRequestAnimationFrame.bind(t)):t.oRequestAnimationFrame?(this.cancelAnimationFrame=t.oCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.oRequestAnimationFrame.bind(t)):(this.cancelAnimationFrame=t.clearTimeout.bind(t),this.requestAnimationFrame=function(e){return t.setTimeout(e,1e3/60)})};e.RequestAnimationFrameDefinition=r,e.AnimationFrame=new r(i.root)},11758:function(t,e){"use strict";var n=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t){function e(){var e=t.call(this,"argument out of range");this.name=e.name="ArgumentOutOfRangeError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.ArgumentOutOfRangeError=i},44640:function(t,e){"use strict";var n=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t){function e(){var e=t.call(this,"no elements in sequence");this.name=e.name="EmptyError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.EmptyError=i},30764:function(t,e){"use strict";var n=function(){function t(){this.values={}}return t.prototype.delete=function(t){return this.values[t]=null,!0},t.prototype.set=function(t,e){return this.values[t]=e,this},t.prototype.get=function(t){return this.values[t]},t.prototype.forEach=function(t,e){var n=this.values;for(var i in n)n.hasOwnProperty(i)&&null!==n[i]&&t.call(e,n[i],i)},t.prototype.clear=function(){this.values={}},t}();e.FastMap=n},42982:function(t,e,n){"use strict";var i=n(80019),r=function(){function t(t){if(this.root=t,t.setImmediate&&"function"==typeof t.setImmediate)this.setImmediate=t.setImmediate.bind(t),this.clearImmediate=t.clearImmediate.bind(t);else{this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.setImmediate=this.canUseProcessNextTick()?this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.createReadyStateChangeSetImmediate():this.createSetTimeoutSetImmediate();var e=function t(e){delete t.instance.tasksByHandle[e]};e.instance=this,this.clearImmediate=e}}return t.prototype.identify=function(t){return this.root.Object.prototype.toString.call(t)},t.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)},t.prototype.canUseMessageChannel=function(){return Boolean(this.root.MessageChannel)},t.prototype.canUseReadyStateChange=function(){var t=this.root.document;return Boolean(t&&"onreadystatechange"in t.createElement("script"))},t.prototype.canUsePostMessage=function(){var t=this.root;if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}return!1},t.prototype.partiallyApplied=function(t){for(var e=[],n=1;n=0}},1856:function(t,e){"use strict";e.isObject=function(t){return null!=t&&"object"==typeof t}},35130:function(t,e){"use strict";e.isPromise=function(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}},41503:function(t,e){"use strict";e.isScheduler=function(t){return t&&"function"==typeof t.schedule}},68668:function(t,e){"use strict";e.noop=function(){}},67239:function(t,e){"use strict";e.not=function(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}},10142:function(t,e,n){"use strict";var i=n(68668);function r(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:i.noop}e.pipe=function(){for(var t=[],e=0;e=n?{done:!0}:{done:!1,value:t[i++]}})},e.empty=function(){var t=new e(null);return t.done=!0,t},e.is=function(t){return t instanceof e||"object"==typeof t&&null!==t&&"function"==typeof t.next},t.exports=e},97310:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.isMobile=function(){return void 0!==r.window.orientation},e.default=function(t){if(!t&&!(0,s.default)())return"Node";if((0,o.default)(t))return"Electron";var e="undefined"!=typeof navigator?navigator:{},n=t||e.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),a=-1!==n.indexOf("Trident/");return i||a?"IE":r.window.chrome?"Chrome":r.window.safari?"Safari":r.window.mozInnerScreenX?"Firefox":"Unknown"};var r=n(41151),s=i(n(61602)),o=i(n(22344))},41151:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.console=e.process=e.document=e.global=e.window=e.self=void 0;var r=i(n(34321)),s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&process};e.self=s.self||s.window||s.global,e.window=s.window||s.self||s.global,e.global=s.global||s.self||s.window,e.document=s.document||{},e.process=s.process||{};var o=console;e.console=o},84761:function(t,e,n){"use strict";var i=n(61948),r=n(34321);Object.defineProperty(e,"CO",{enumerable:!0,get:function(){return s.global}}),Object.defineProperty(e,"jU",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"qs",{enumerable:!0,get:function(){return a.default}});var s=n(41151),o=c(n(61602)),a=c(n(97310));i(n(22344));function l(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(l=function(t){return t?n:e})(t)}function c(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=l(e);if(n&&n.has(t))return n.get(t);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&Object.prototype.hasOwnProperty.call(t,o)){var a=s?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=t[o]}return i.default=t,n&&n.set(t,i),i}},61602:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,e.isBrowserMainThread=function(){return o()&&"undefined"!=typeof document};var r=i(n(34321)),s=i(n(22344));function o(){return!("object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,s.default)()}},22344:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("undefined"!=typeof window&&"object"===(0,r.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,r.default)(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":(0,r.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)};var r=i(n(34321))},86991:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(14180),e),r(n(75103),e),r(n(48965),e),r(n(32595),e),r(n(82417),e),r(n(92451),e),r(n(17735),e)},14180:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BlankNode=void 0,e.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&"BlankNode"===t.termType&&t.value===this.value}}},75103:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataFactory=void 0;const i=n(14180),r=n(48965),s=n(32595),o=n(82417),a=n(92451),l=n(17735);let c=0;e.DataFactory=class{constructor(t){this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||`df_${c++}_`}namedNode(t){return new o.NamedNode(t)}blankNode(t){return new i.BlankNode(t||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(t,e){return new s.Literal(t,e)}variable(t){return new l.Variable(t)}defaultGraph(){return r.DefaultGraph.INSTANCE}quad(t,e,n,i){return new a.Quad(t,e,n,i||this.defaultGraph())}fromTerm(t){switch(t.termType){case"NamedNode":return this.namedNode(t.value);case"BlankNode":return this.blankNode(t.value);case"Literal":return t.language?this.literal(t.value,t.language):t.datatype.equals(s.Literal.XSD_STRING)?this.literal(t.value):this.literal(t.value,this.fromTerm(t.datatype));case"Variable":return this.variable(t.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(t.subject),this.fromTerm(t.predicate),this.fromTerm(t.object),this.fromTerm(t.graph))}}fromQuad(t){return this.fromTerm(t)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},48965:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&"DefaultGraph"===t.termType}}e.DefaultGraph=n,n.INSTANCE=new n},32595:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Literal=void 0;const i=n(82417);class r{constructor(t,e){this.termType="Literal",this.value=t,"string"==typeof e?(this.language=e,this.datatype=r.RDF_LANGUAGE_STRING):e?(this.language="",this.datatype=e):(this.language="",this.datatype=r.XSD_STRING)}equals(t){return!!t&&"Literal"===t.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}e.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NamedNode=void 0,e.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&"NamedNode"===t.termType&&t.value===this.value}}},92451:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Quad=void 0,e.Quad=class{constructor(t,e,n,i){this.termType="Quad",this.value="",this.subject=t,this.predicate=e,this.object=n,this.graph=i}equals(t){return!!t&&("Quad"===t.termType||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},17735:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Variable=void 0,e.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&"Variable"===t.termType&&t.value===this.value}}},31609:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.getSupportedJavaScriptPrimitives=e.getSupportedRdfDatatypes=e.getTermRaw=e.toRdf=e.fromRdf=void 0;const s=n(86991),o=n(9938),a=n(66060);r(n(9938),e),r(n(88871),e),r(n(66060),e);const l=new s.DataFactory,c=new a.Translator;function u(t,e){return c.fromRdf(t,e)}c.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map(t=>l.namedNode(t)),["string"]),c.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map(t=>l.namedNode(t)),["boolean"]),c.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map(t=>l.namedNode(t)),["number"]),c.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map(t=>l.namedNode(t)),["number"]),c.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map(t=>l.namedNode(t)),["object"]),e.fromRdf=u,e.toRdf=function(t,e){return e&&"namedNode"in e&&(e={dataFactory:e}),(e=e||{})&&!e.dataFactory&&(e.dataFactory=l),c.toRdf(t,e)},e.getTermRaw=function(t,e){return"Literal"===t.termType?u(t,e):t.value},e.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},e.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},66060:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Translator=void 0,e.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,e,n){for(const i of e)this.supportedRdfDatatypes.push(i),this.fromRdfHandlers[i.value]=t;for(const i of n){let e=this.toRdfHandlers[i];e||(this.toRdfHandlers[i]=e=[]),e.push(t)}}fromRdf(t,e){const n=this.fromRdfHandlers[t.datatype.value];return n?n.fromRdf(t,e):t.value}toRdf(t,e){const n=this.toRdfHandlers[typeof t];if(n)for(const i of n){const n=i.toRdf(t,e);if(n)return n}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},80727:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerBoolean=void 0;const i=n(66060);class r{fromRdf(t,e){switch(t.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return e&&i.Translator.incorrectRdfDataType(t),!1}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(t?"true":"false",e||n.namedNode(r.TYPE))}}e.TypeHandlerBoolean=r,r.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerDate=void 0;const i=n(66060);class r{fromRdf(t,e){switch(e&&!t.value.match(r.VALIDATORS[t.datatype.value.substr(33,t.datatype.value.length)])&&i.Translator.incorrectRdfDataType(t),t.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(t.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const e=t.value.split("-");return new Date(0,parseInt(e[0],10)-1,parseInt(e[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(t.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(t.value+"-01");default:return new Date(t.value)}}toRdf(t,{datatype:e,dataFactory:n}){if(e=e||n.namedNode(r.TYPES[0]),!(t instanceof Date))return null;const i=t;let s;switch(e.value){case"http://www.w3.org/2001/XMLSchema#gDay":s=String(i.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":s=i.getUTCMonth()+1+"-"+i.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":s=String(i.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":s=i.getUTCFullYear()+"-"+(i.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":s=i.toISOString().replace(/T.*$/,"");break;default:s=i.toISOString()}return n.literal(s,e)}}e.TypeHandlerDate=r,r.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"],r.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]$/}},38554:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberDouble=void 0;const i=n(66060);class r{fromRdf(t,e){const n=parseFloat(t.value);return e&&isNaN(n)&&i.Translator.incorrectRdfDataType(t),n}toRdf(t,{datatype:e,dataFactory:n}){return e=e||n.namedNode(r.TYPES[0]),isNaN(t)?n.literal("NaN",e):isFinite(t)?t%1==0?null:n.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),e):n.literal(t>0?"INF":"-INF",e)}}e.TypeHandlerNumberDouble=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberInteger=void 0;const i=n(66060);class r{fromRdf(t,e){const n=parseInt(t.value,10);return e&&(isNaN(n)||t.value.indexOf(".")>=0)&&i.Translator.incorrectRdfDataType(t),n}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(String(t),e||n.namedNode(t<=r.MAX_INT&&t>=r.MIN_INT?r.TYPES[0]:r.TYPES[1]))}}e.TypeHandlerNumberInteger=r,r.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"],r.MAX_INT=2147483647,r.MIN_INT=-2147483648},14608:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerString=void 0;class n{fromRdf(t){return t.value}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(t,e)}}e.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(80727),e),r(n(52525),e),r(n(38554),e),r(n(37750),e),r(n(14608),e)},35090:function(t,e,n){"use strict";var i={};n.r(i),n.d(i,{decode:function(){return eL},encode:function(){return iL}});var r={};n.r(r),n.d(r,{decode:function(){return cL},encode:function(){return hL}});var s={};n.r(s),n.d(s,{decode:function(){return dL},encode:function(){return fL}});var o={};function a(t){return"function"==typeof t}n.r(o),n.d(o,{decode:function(){return mL},encode:function(){return yL}});let l=!1;const c={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else l&&console.log("RxJS: Back to a better error behavior. Thank you. <3");l=t},get useDeprecatedSynchronousErrorHandling(){return l}};function u(t){setTimeout(()=>{throw t},0)}const h={closed:!0,next(t){},error(t){if(c.useDeprecatedSynchronousErrorHandling)throw t;u(t)},complete(){}},d=Array.isArray||(t=>t&&"number"==typeof t.length);function p(t){return null!==t&&"object"==typeof t}const f=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();class g{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:e,_ctorUnsubscribe:n,_unsubscribe:i,_subscriptions:r}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,e instanceof g)e.remove(this);else if(null!==e)for(let a=0;at.concat(e instanceof f?e.errors:e),[])}g.EMPTY=((m=new g).closed=!0,m);const y="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class v extends g{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=h;break;case 1:if(!t){this.destination=h;break}if("object"==typeof t){t instanceof v?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new _(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new _(this,t,e,n)}}[y](){return this}static create(t,e,n){const i=new v(t,e,n);return i.syncErrorThrowable=!1,i}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class _ extends v{constructor(t,e,n,i){super(),this._parentSubscriber=t;let r,s=this;a(e)?r=e:e&&(r=e.next,n=e.error,i=e.complete,e!==h&&(s=Object.create(e),a(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=r,this._error=n,this._complete=i}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;c.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=c;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):u(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;u(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);c.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),c.useDeprecatedSynchronousErrorHandling)throw n;u(n)}}__tryOrSetError(t,e,n){if(!c.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(i){return c.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=i,t.syncErrorThrown=!0,!0):(u(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const w="function"==typeof Symbol&&Symbol.observable||"@@observable";function x(t){return t}function S(...t){return E(t)}function E(t){return 0===t.length?x:1===t.length?t[0]:function(e){return t.reduce((t,e)=>e(t),e)}}let C=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:i}=this,r=function(t,e,n){if(t){if(t instanceof v)return t;if(t[y])return t[y]()}return t||e||n?new v(t,e,n):new v(h)}(t,e,n);if(r.add(i?i.call(r,this.source):this.source||c.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),c.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(t){try{return this._subscribe(t)}catch(e){c.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:i}=t;if(e||i)return!1;t=n&&n instanceof v?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=O(e))((e,n)=>{let i;i=this.subscribe(e=>{try{t(e)}catch(r){n(r),i&&i.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[w](){return this}pipe(...t){return 0===t.length?this:E(t)(this)}toPromise(t){return new(t=O(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function O(t){if(t||(t=c.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const T=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class k extends g{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class A extends v{constructor(t){super(t),this.destination=t}}let P=(()=>{class t extends C{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[y](){return new A(this)}lift(t){const e=new I(this,this);return e.operator=t,e}next(t){if(this.closed)throw new T;if(!this.isStopped){const{observers:e}=this,n=e.length,i=e.slice();for(let r=0;rnew I(t,e),t})();class I extends P{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):g.EMPTY}}function M(t){return t&&"function"==typeof t.schedule}function D(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new R(t,e))}}class R{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new N(t,this.project,this.thisArg))}}class N extends v{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}const L=t=>e=>{for(let n=0,i=t.length;nt&&"number"==typeof t.length&&"function"!=typeof t;function B(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const V=t=>{if(t&&"function"==typeof t[w])return(t=>e=>{const n=t[w]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)})(t);if(F(t))return L(t);if(B(t))return(t=>e=>(t.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,u),e))(t);if(t&&"function"==typeof t[j])return(t=>e=>{const n=t[j]();for(;;){let t;try{t=n.next()}catch(i){return e.error(i),e}if(t.done){e.complete();break}if(e.next(t.value),e.closed)break}return"function"==typeof n.return&&e.add(()=>{n.return&&n.return()}),e})(t);{const e=`You provided ${p(t)?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(e)}};function z(t,e){return new C(n=>{const i=new g;let r=0;return i.add(e.schedule(function(){r!==t.length?(n.next(t[r++]),n.closed||i.add(this.schedule())):n.complete()})),i})}function U(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[w]}(t))return function(t,e){return new C(n=>{const i=new g;return i.add(e.schedule(()=>{const r=t[w]();i.add(r.subscribe({next(t){i.add(e.schedule(()=>n.next(t)))},error(t){i.add(e.schedule(()=>n.error(t)))},complete(){i.add(e.schedule(()=>n.complete()))}}))})),i})}(t,e);if(B(t))return function(t,e){return new C(n=>{const i=new g;return i.add(e.schedule(()=>t.then(t=>{i.add(e.schedule(()=>{n.next(t),i.add(e.schedule(()=>n.complete()))}))},t=>{i.add(e.schedule(()=>n.error(t)))}))),i})}(t,e);if(F(t))return z(t,e);if(function(t){return t&&"function"==typeof t[j]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new C(n=>{const i=new g;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=t[j](),i.add(e.schedule(function(){if(n.closed)return;let t,e;try{const n=r.next();t=n.value,e=n.done}catch(i){return void n.error(i)}e?n.complete():(n.next(t),this.schedule())}))})),i})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof C?t:new C(V(t))}class H extends v{constructor(t){super(),this.parent=t}_next(t){this.parent.notifyNext(t)}_error(t){this.parent.notifyError(t),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class $ extends v{notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.destination.complete()}}function G(t,e){if(e.closed)return;if(t instanceof C)return t.subscribe(e);let n;try{n=V(t)(e)}catch(i){e.error(i)}return n}function W(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(W((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))),n)):("number"==typeof e&&(n=e),e=>e.lift(new q(t,n)))}class q{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new X(t,this.project,this.concurrent))}}class X extends ${constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function Y(t=Number.POSITIVE_INFINITY){return W(x,t)}function K(t,e){return e?z(t,e):new C(L(t))}function Q(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return M(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof i&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof C?t[0]:Y(e)(K(t,n))}function Z(){return function(t){return t.lift(new J(t))}}class J{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const i=new tt(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class tt extends v{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}class et extends C{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new g,t.add(this.source.subscribe(new it(this.getSubject(),this))),t.closed&&(this._connection=null,t=g.EMPTY)),t}refCount(){return Z()(this)}}const nt=(()=>{const t=et.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class it extends A{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function rt(t,e){return function(n){let i;if(i="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new st(i,e));const r=Object.create(n,nt);return r.source=n,r.subjectFactory=i,r}}class st{constructor(t,e){this.subjectFactory=t,this.selector=e}call(t,e){const{selector:n}=this,i=this.subjectFactory(),r=n(i).subscribe(t);return r.add(e.subscribe(i)),r}}function ot(){return new P}function at(){return t=>Z()(rt(ot)(t))}function lt(t){for(let e in t)if(t[e]===lt)return e;throw Error("Could not find renamed property on target object.")}function ct(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function ut(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(ut).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function ht(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const dt=lt({__forward_ref__:lt});function pt(t){return t.__forward_ref__=pt,t.toString=function(){return ut(this())},t}function ft(t){return gt(t)?t():t}function gt(t){return"function"==typeof t&&t.hasOwnProperty(dt)&&t.__forward_ref__===pt}class mt extends Error{constructor(t,e){super(function(t,e){return`${t?`NG0${t}: `:""}${e}`}(t,e)),this.code=t}}function yt(t){return"string"==typeof t?t:null==t?"":String(t)}function vt(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():yt(t)}function _t(t,e){const n=e?` in ${e}`:"";throw new mt("201",`No provider for ${vt(t)} found${n}`)}function wt(t,e){null==t&&function(t,e,n,i){throw new Error(`ASSERTION ERROR: ${t}`+(null==i?"":` [Expected=> ${n} ${i} ${e} <=Actual]`))}(e,t,null,"!=")}function xt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function St(t){return{providers:t.providers||[],imports:t.imports||[]}}function Et(t){return Ct(t,Tt)||Ct(t,At)}function Ct(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ot(t){return t&&(t.hasOwnProperty(kt)||t.hasOwnProperty(Pt))?t[kt]:null}const Tt=lt({"\u0275prov":lt}),kt=lt({"\u0275inj":lt}),At=lt({ngInjectableDef:lt}),Pt=lt({ngInjectorDef:lt});var It=(()=>((It=It||{})[It.Default=0]="Default",It[It.Host=1]="Host",It[It.Self=2]="Self",It[It.SkipSelf=4]="SkipSelf",It[It.Optional=8]="Optional",It))();let Mt;function Dt(t){const e=Mt;return Mt=t,e}function Rt(t,e,n){const i=Et(t);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&It.Optional?null:void 0!==e?e:void _t(ut(t),"Injector")}function Nt(t){return{toString:t}.toString()}var Lt=(()=>((Lt=Lt||{})[Lt.OnPush=0]="OnPush",Lt[Lt.Default=1]="Default",Lt))(),jt=(()=>((jt=jt||{})[jt.Emulated=0]="Emulated",jt[jt.None=2]="None",jt[jt.ShadowDom=3]="ShadowDom",jt))();const Ft="undefined"!=typeof globalThis&&globalThis,Bt="undefined"!=typeof window&&window,Vt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,zt="undefined"!=typeof global&&global,Ut=Ft||zt||Bt||Vt,Ht={},$t=[],Gt=lt({"\u0275cmp":lt}),Wt=lt({"\u0275dir":lt}),qt=lt({"\u0275pipe":lt}),Xt=lt({"\u0275mod":lt}),Yt=lt({"\u0275loc":lt}),Kt=lt({"\u0275fac":lt}),Qt=lt({__NG_ELEMENT_ID__:lt});let Zt=0;function Jt(t){return Nt(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===Lt.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||$t,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||jt.Emulated,id:"c",styles:t.styles||$t,_:null,setInput:null,schemas:t.schemas||null,tView:null},i=t.directives,r=t.features,s=t.pipes;return n.id+=Zt++,n.inputs=re(t.inputs,e),n.outputs=re(t.outputs),r&&r.forEach(t=>t(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(te):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(ee):null,n})}function te(t){return ae(t)||function(t){return t[Wt]||null}(t)}function ee(t){return function(t){return t[qt]||null}(t)}const ne={};function ie(t){return Nt(()=>{const e={type:t.type,bootstrap:t.bootstrap||$t,declarations:t.declarations||$t,imports:t.imports||$t,exports:t.exports||$t,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&(ne[t.id]=t.type),e})}function re(t,e){if(null==t)return Ht;const n={};for(const i in t)if(t.hasOwnProperty(i)){let r=t[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,e&&(e[r]=s)}return n}const se=Jt;function oe(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,onDestroy:t.type.prototype.ngOnDestroy||null}}function ae(t){return t[Gt]||null}function le(t,e){const n=t[Xt]||null;if(!n&&!0===e)throw new Error(`Type ${ut(t)} does not have '\u0275mod' property.`);return n}function ce(t){return Array.isArray(t)&&"object"==typeof t[1]}function ue(t){return Array.isArray(t)&&!0===t[1]}function he(t){return 0!=(8&t.flags)}function de(t){return 2==(2&t.flags)}function pe(t){return 1==(1&t.flags)}function fe(t){return null!==t.template}function ge(t){return 0!=(512&t[2])}function me(t,e){return t.hasOwnProperty(Kt)?t[Kt]:null}class be{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function ye(){return ve}function ve(t){return t.type.prototype.ngOnChanges&&(t.setInput=we),_e}function _e(){const t=Se(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===Ht)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function we(t,e,n,i){const r=Se(t)||function(t,e){return t[xe]=e}(t,{previous:Ht,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],l=o[a];s[a]=new be(l&&l.currentValue,e,o===Ht),t[i]=e}ye.ngInherit=!0;const xe="__ngSimpleChanges__";function Se(t){return t[xe]||null}const Ee="http://www.w3.org/2000/svg";let Ce;function Oe(){return void 0!==Ce?Ce:"undefined"!=typeof document?document:void 0}function Te(t){return!!t.listen}const ke={createRenderer:(t,e)=>Oe()};function Ae(t){for(;Array.isArray(t);)t=t[0];return t}function Pe(t,e){return Ae(e[t])}function Ie(t,e){return Ae(e[t.index])}function Me(t,e){return t.data[e]}function De(t,e){return t[e]}function Re(t,e){const n=e[t];return ce(n)?n:n[0]}function Ne(t){return 4==(4&t[2])}function Le(t){return 128==(128&t[2])}function je(t,e){return null==e?null:t[e]}function Fe(t){t[18]=0}function Be(t,e){t[5]+=e;let n=t,i=t[3];for(;null!==i&&(1===e&&1===n[5]||-1===e&&0===n[5]);)i[5]+=e,n=i,i=i[3]}const Ve={lFrame:dn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function ze(){return Ve.bindingsEnabled}function Ue(){return Ve.lFrame.lView}function He(){return Ve.lFrame.tView}function $e(t){return Ve.lFrame.contextLView=t,t[8]}function Ge(){let t=We();for(;null!==t&&64===t.type;)t=t.parent;return t}function We(){return Ve.lFrame.currentTNode}function qe(t,e){const n=Ve.lFrame;n.currentTNode=t,n.isParent=e}function Xe(){return Ve.lFrame.isParent}function Ye(){Ve.lFrame.isParent=!1}function Ke(){return Ve.isInCheckNoChangesMode}function Qe(t){Ve.isInCheckNoChangesMode=t}function Ze(){const t=Ve.lFrame;let e=t.bindingRootIndex;return-1===e&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function Je(){return Ve.lFrame.bindingIndex}function tn(){return Ve.lFrame.bindingIndex++}function en(t){const e=Ve.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function nn(t,e){const n=Ve.lFrame;n.bindingIndex=n.bindingRootIndex=t,rn(e)}function rn(t){Ve.lFrame.currentDirectiveIndex=t}function sn(t){const e=Ve.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}function on(){return Ve.lFrame.currentQueryIndex}function an(t){Ve.lFrame.currentQueryIndex=t}function ln(t){const e=t[1];return 2===e.type?e.declTNode:1===e.type?t[6]:null}function cn(t,e,n){if(n&It.SkipSelf){let i=e,r=t;for(;!(i=i.parent,null!==i||n&It.Host||(i=ln(r),null===i||(r=r[15],10&i.type))););if(null===i)return!1;e=i,t=r}const i=Ve.lFrame=hn();return i.currentTNode=e,i.lView=t,!0}function un(t){const e=hn(),n=t[1];Ve.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function hn(){const t=Ve.lFrame,e=null===t?null:t.child;return null===e?dn(t):e}function dn(t){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=e),e}function pn(){const t=Ve.lFrame;return Ve.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const fn=pn;function gn(){const t=pn();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function mn(){return Ve.lFrame.selectedIndex}function bn(t){Ve.lFrame.selectedIndex=t}function yn(){const t=Ve.lFrame;return Me(t.tView,t.selectedIndex)}function vn(){Ve.lFrame.currentNamespace=Ee}function _n(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n=i)break}else e[a]<0&&(t[18]+=65536),(o>11>16&&(3&t[2])===e){t[2]+=2048;try{s.call(o)}finally{}}}else try{s.call(o)}finally{}}class On{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function Tn(t,e,n){const i=Te(t);let r=0;for(;re){o=s-1;break}}}for(;s>16}(t),i=e;for(;n>0;)i=i[15],n--;return i}let Nn=!0;function Ln(t){const e=Nn;return Nn=t,e}let jn=0;function Fn(t,e){const n=Vn(t,e);if(-1!==n)return n;const i=e[1];i.firstCreatePass&&(t.injectorIndex=e.length,Bn(i.data,t),Bn(e,null),Bn(i.blueprint,null));const r=zn(t,e),s=t.injectorIndex;if(Mn(r)){const t=Dn(r),n=Rn(r,e),i=n[1].data;for(let r=0;r<8;r++)e[s+r]=n[t+r]|i[t+r]}return e[s+8]=r,s}function Bn(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Vn(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===e[t.injectorIndex+8]?-1:t.injectorIndex}function zn(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=0,i=null,r=e;for(;null!==r;){const t=r[1],e=t.type;if(i=2===e?t.declTNode:1===e?r[6]:null,null===i)return-1;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return-1}function Un(t,e,n){!function(t,e,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Qt)&&(i=n[Qt]),null==i&&(i=n[Qt]=jn++);const r=255&i;e.data[t+(r>>5)]|=1<=0?255&e:qn:e}(n);if("function"==typeof s){if(!cn(e,t,i))return i&It.Host?Hn(r,n,i):$n(e,n,i,r);try{const t=s(i);if(null!=t||i&It.Optional)return t;_t(n)}finally{fn()}}else if("number"==typeof s){let r=null,o=Vn(t,e),a=-1,l=i&It.Host?e[16][6]:null;for((-1===o||i&It.SkipSelf)&&(a=-1===o?zn(t,e):e[o+8],-1!==a&&Zn(i,!1)?(r=e[1],o=Dn(a),e=Rn(a,e)):o=-1);-1!==o;){const t=e[1];if(Qn(s,o,t.data)){const t=Xn(o,e,n,r,i,l);if(t!==Wn)return t}a=e[o+8],-1!==a&&Zn(i,e[1].data[o+8]===l)&&Qn(s,o,e)?(r=t,o=Dn(a),e=Rn(a,e)):o=-1}}}return $n(e,n,i,r)}const Wn={};function qn(){return new Jn(Ge(),Ue())}function Xn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Yn(a,o,n,null==i?de(a)&&Nn:i!=o&&0!=(3&a.type),r&It.Host&&s===a);return null!==l?Kn(e,o,l,a):Wn}function Yn(t,e,n,i,r){const s=t.providerIndexes,o=e.data,a=1048575&s,l=t.directiveStart,c=s>>20,u=r?a+c:t.directiveEnd;for(let h=i?a:a+c;h=l&&t.type===n)return h}if(r){const t=o[l];if(t&&fe(t)&&t.type===n)return l}return null}function Kn(t,e,n,i){let r=t[n];const s=e.data;if(function(t){return t instanceof On}(r)){const o=r;o.resolving&&function(t,e){throw new mt("200",`Circular dependency in DI detected for ${t}`)}(vt(s[n]));const a=Ln(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Dt(o.injectImpl):null;cn(t,i,It.Default);try{r=t[n]=o.factory(void 0,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&function(t,e,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const i=ve(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,s))}(n,s[n],e)}finally{null!==l&&Dt(l),Ln(a),o.resolving=!1,fn()}}return r}function Qn(t,e,n){return!!(n[e+(t>>5)]&1<{const e=t.prototype.constructor,n=e[Kt]||ni(e),i=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==i;){const t=r[Kt]||ni(r);if(t&&t!==n)return t;r=Object.getPrototypeOf(r)}return t=>new t})}function ni(t){return gt(t)?()=>{const e=ni(ft(t));return e&&e()}:me(t)}function ii(t){return function(t,e){if("class"===e)return t.classes;if("style"===e)return t.styles;const n=t.attrs;if(n){const t=n.length;let i=0;for(;i{const i=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function r(...t){if(this instanceof r)return i.apply(this,t),this;const e=new r(...t);return n.annotation=e,n;function n(t,n,i){const r=t.hasOwnProperty(ri)?t[ri]:Object.defineProperty(t,ri,{value:[]})[ri];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(e),t}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}class oi{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=xt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return`InjectionToken ${this._desc}`}}const ai=Function;function li(t,e){void 0===e&&(e=t);for(let n=0;nArray.isArray(t)?ci(t,e):e(t))}function ui(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function hi(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function di(t,e){const n=[];for(let i=0;i=0?t[1|i]=n:(i=~i,function(t,e,n,i){let r=t.length;if(r==e)t.push(n,i);else if(1===r)t.push(i,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;)t[r]=t[r-2],r--;t[e]=n,t[e+1]=i}}(t,i,e,n)),i}function fi(t,e){const n=gi(t,e);if(n>=0)return t[1|n]}function gi(t,e){return function(t,e,n){let i=0,r=t.length>>n;for(;r!==i;){const s=i+(r-i>>1),o=t[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t.push(n+":"+("string"==typeof i?JSON.stringify(i):ut(i)))}r=`{${t.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${t.replace(vi,"\n ")}`}("\n"+t.message,r,n,i),t.ngTokenPath=r,t[yi]=null,t}const Ii=ki(si("Inject",t=>({token:t})),-1),Mi=ki(si("Optional"),8),Di=ki(si("SkipSelf"),4);let Ri,Ni;function Li(t){var e;return(null===(e=function(){if(void 0===Ri&&(Ri=null,Ut.trustedTypes))try{Ri=Ut.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(t){}return Ri}())||void 0===e?void 0:e.createHTML(t))||t}function ji(){if(void 0===Ni&&(Ni=null,Ut.trustedTypes))try{Ni=Ut.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(m){}return Ni}function Fi(t){var e;return(null===(e=ji())||void 0===e?void 0:e.createHTML(t))||t}function Bi(t){var e;return(null===(e=ji())||void 0===e?void 0:e.createScriptURL(t))||t}class Vi{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class zi extends Vi{getTypeName(){return"HTML"}}class Ui extends Vi{getTypeName(){return"Style"}}class Hi extends Vi{getTypeName(){return"Script"}}class $i extends Vi{getTypeName(){return"URL"}}class Gi extends Vi{getTypeName(){return"ResourceURL"}}function Wi(t){return t instanceof Vi?t.changingThisBreaksApplicationSecurity:t}function qi(t,e){const n=Xi(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===e}function Xi(t){return t instanceof Vi&&t.getTypeName()||null}class Yi{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t=""+t;try{const e=(new window.DOMParser).parseFromString(Li(t),"text/html").body;return null===e?this.inertDocumentHelper.getInertBodyElement(t):(e.removeChild(e.firstChild),e)}catch(e){return null}}}class Ki{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const e=this.inertDocument.createElement("body");t.appendChild(e)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=Li(t),e;const n=this.inertDocument.createElement("body");return n.innerHTML=Li(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(t){const e=t.attributes;for(let i=e.length-1;0Ji(t.trim())).join(", ")}function er(t){const e={};for(const n of t.split(","))e[n]=!0;return e}function nr(...t){const e={};for(const n of t)for(const t in n)n.hasOwnProperty(t)&&(e[t]=!0);return e}const ir=er("area,br,col,hr,img,wbr"),rr=er("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),sr=er("rp,rt"),or=nr(ir,nr(rr,er("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),nr(sr,er("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),nr(sr,rr)),ar=er("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),lr=er("srcset"),cr=nr(ar,lr,er("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),er("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),ur=er("script,style,template");class hr{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let e=t.firstChild,n=!0;for(;e;)if(e.nodeType===Node.ELEMENT_NODE?n=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,n&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);let t=this.checkClobberedElement(e,e.nextSibling);if(t){e=t;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")}startElement(t){const e=t.nodeName.toLowerCase();if(!or.hasOwnProperty(e))return this.sanitizedSomething=!0,!ur.hasOwnProperty(e);this.buf.push("<"),this.buf.push(e);const n=t.attributes;for(let i=0;i"),!0}endElement(t){const e=t.nodeName.toLowerCase();or.hasOwnProperty(e)&&!ir.hasOwnProperty(e)&&(this.buf.push(""))}chars(t){this.buf.push(fr(t))}checkClobberedElement(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`);return e}}const dr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,pr=/([^\#-~ |!])/g;function fr(t){return t.replace(/&/g,"&").replace(dr,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(pr,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let gr;function mr(t,e){let n=null;try{gr=gr||function(t){const e=new Ki(t);return function(){try{return!!(new window.DOMParser).parseFromString(Li(""),"text/html")}catch(t){return!1}}()?new Yi(e):e}(t);let i=e?String(e):"";n=gr.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=gr.getInertBodyElement(i)}while(i!==s);return Li((new hr).sanitizeChildren(br(n)||n))}finally{if(n){const t=br(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function br(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var yr=(()=>((yr=yr||{})[yr.NONE=0]="NONE",yr[yr.HTML=1]="HTML",yr[yr.STYLE=2]="STYLE",yr[yr.SCRIPT=3]="SCRIPT",yr[yr.URL=4]="URL",yr[yr.RESOURCE_URL=5]="RESOURCE_URL",yr))();function vr(t){const e=xr();return e?Fi(e.sanitize(yr.HTML,t)||""):qi(t,"HTML")?Fi(Wi(t)):mr(Oe(),yt(t))}function _r(t){const e=xr();return e?e.sanitize(yr.URL,t)||"":qi(t,"URL")?Wi(t):Ji(yt(t))}function wr(t){const e=xr();if(e)return Bi(e.sanitize(yr.RESOURCE_URL,t)||"");if(qi(t,"ResourceURL"))return Bi(Wi(t));throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)")}function xr(){const t=Ue();return t&&t[12]}const Sr="__ngContext__";function Er(t,e){t[Sr]=e}function Cr(t){const e=function(t){return t[Sr]||null}(t);return e?Array.isArray(e)?e:e.lView:null}function Or(t){return t.ngOriginalError}function Tr(t,...e){t.error(...e)}class kr{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),i=function(t){return t&&t.ngErrorLogger||Tr}(t);i(this._console,"ERROR",t),e&&i(this._console,"ORIGINAL ERROR",e),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?function(t){return t.ngDebugContext}(t)||this._findContext(Or(t)):null}_findOriginalError(t){let e=t&&Or(t);for(;e&&Or(e);)e=Or(e);return e||null}}const Ar=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Ut))();function Pr(t){return t.ownerDocument.defaultView}function Ir(t){return t.ownerDocument}function Mr(t){return t instanceof Function?t():t}var Dr=(()=>((Dr=Dr||{})[Dr.Important=1]="Important",Dr[Dr.DashCase=2]="DashCase",Dr))();function Rr(t,e){return undefined(t,e)}function Lr(t){const e=t[3];return ue(e)?e[3]:e}function jr(t){return Br(t[13])}function Fr(t){return Br(t[4])}function Br(t){for(;null!==t&&!ue(t);)t=t[4];return t}function Vr(t,e,n,i,r){if(null!=i){let s,o=!1;ue(i)?s=i:ce(i)&&(o=!0,i=i[0]);const a=Ae(i);0===t&&null!==n?null==r?Xr(e,n,a):qr(e,n,a,r||null,!0):1===t&&null!==n?qr(e,n,a,r||null,!0):2===t?function(t,e,n){const i=Kr(t,e);i&&function(t,e,n,i){Te(t)?t.removeChild(e,n,i):e.removeChild(n)}(t,i,e,n)}(e,a,o):3===t&&e.destroyNode(a),null!=s&&function(t,e,n,i,r){const s=n[7];s!==Ae(n)&&Vr(e,t,i,s,r);for(let o=10;o0&&(t[n-1][4]=i[4]);const s=hi(t,10+e);!function(t,e){rs(t,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function $r(t,e){if(!(256&e[2])){const n=e[11];Te(n)&&n.destroyNode&&rs(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Gr(t[1],t);for(;e;){let n=null;if(ce(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)ce(e)&&Gr(e[1],e),e=e[3];null===e&&(e=t),ce(e)&&Gr(e[1],e),n=e&&e[4]}e=n}}(e)}}function Gr(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let i=0;i=0?i[r=l]():i[r=-l].unsubscribe(),s+=2}else{const t=i[r=n[s+1]];n[s].call(t)}if(null!==i){for(let t=r+1;ts?"":r[u+1].toLowerCase();const e=8&i?t:null;if(e&&-1!==ls(e,c,0)||2&i&&c!==t){if(fs(i))return!1;o=!0}}}}else{if(!o&&!fs(i)&&!fs(l))return!1;if(o&&fs(l))continue;o=!1,i=l|1&i}}return fs(i)||o}function fs(t){return 0==(1&t)}function gs(t,e,n,i){if(null===e)return-1;let r=0;if(i||!n){let n=!1;for(;r-1)for(n++;n0?'="'+e+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!fs(o)&&(e+=ys(s,r),r=""),i=o,s=s||!fs(i);n++}return""!==r&&(e+=ys(s,r)),e}const _s={};function ws(t){xs(He(),Ue(),mn()+t,Ke())}function xs(t,e,n,i){if(!i)if(3==(3&e[2])){const i=t.preOrderCheckHooks;null!==i&&wn(e,i,n)}else{const i=t.preOrderHooks;null!==i&&xn(e,i,0,n)}bn(n)}function Ss(t,e){return t<<17|e<<2}function Es(t){return t>>17&32767}function Cs(t){return 2|t}function Os(t){return(131068&t)>>2}function Ts(t,e){return-131069&t|e<<2}function ks(t){return 1|t}function As(t,e){const n=t.contentQueries;if(null!==n)for(let i=0;i20&&xs(t,e,20,Ke()),n(i,r)}finally{bn(s)}}function js(t,e,n){if(he(e)){const i=e.directiveEnd;for(let r=e.directiveStart;r0;){const n=t[--e];if("number"==typeof n&&n<0)return n}return 0})(n)!=s&&n.push(s),n.push(i,r,o)}}function qs(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function Xs(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function Ys(t,e,n){if(n){if(e.exportAs)for(let i=0;i0&&ro(n)}}function ro(t){for(let n=jr(t);null!==n;n=Fr(n))for(let t=10;t0&&ro(e)}const e=t[1].components;if(null!==e)for(let n=0;n0&&ro(i)}}function so(t,e){const n=Re(e,t),i=n[1];(function(t,e){for(let n=e.length;nPromise.resolve(null))();function po(t){return t[7]||(t[7]=[])}function fo(t){return t.cleanup||(t.cleanup=[])}function go(t,e,n){return(null===t||fe(t))&&(n=function(t){for(;Array.isArray(t);){if("object"==typeof t[1])return t;t=t[0]}return null}(n[e.index])),n[11]}function mo(t,e){const n=t[9],i=n?n.get(kr,null):null;i&&i.handleError(e)}function bo(t,e,n,i,r){for(let s=0;sthis.processProvider(n,t,e)),ci([t],t=>this.processInjectorType(t,[],r)),this.records.set(_o,Io(void 0,this));const s=this.records.get(xo);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof t?null:ut(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=mi,n=It.Default){this.assertNotDestroyed();const i=Si(this),r=Dt(void 0);try{if(!(n&It.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=function(t){return"function"==typeof t||"object"==typeof t&&t instanceof oi}(t)&&Et(t);e=n&&this.injectableDefInScope(n)?Io(Ao(t),So):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&It.Self?Oo():this.parent).get(t,e=n&It.Optional&&e===mi?null:e)}catch(s){if("NullInjectorError"===s.name){if((s[yi]=s[yi]||[]).unshift(ut(t)),i)throw s;return Pi(s,t,"R3InjectorError",this.source)}throw s}finally{Dt(r),Si(i)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(ut(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=ft(t)))return!1;let i=Ot(t);const r=null==i&&t.ngModule||void 0,s=void 0===r?t:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=Ot(r)),null==i)return!1;if(null!=i.imports&&!o){let t;n.push(s);try{ci(i.imports,i=>{this.processInjectorType(i,e,n)&&(void 0===t&&(t=[]),t.push(i))})}finally{}if(void 0!==t)for(let e=0;ethis.processProvider(t,n,i||$t))}}this.injectorDefTypes.add(s);const a=me(s)||(()=>new s);this.records.set(s,Io(a,So));const l=i.providers;if(null!=l&&!o){const e=t;ci(l,t=>this.processProvider(t,e,l))}return void 0!==r&&void 0!==t.providers}processProvider(t,e,n){let i=Do(t=ft(t))?t:ft(t&&t.provide);const r=function(t,e,n){return Mo(t)?Io(void 0,t.useValue):Io(Po(t),So)}(t);if(Do(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=Io(void 0,So,!0),e.factory=()=>Ti(e.multi),this.records.set(i,e)),i=t,e.multi.push(t)}this.records.set(i,r)}hydrate(t,e){return e.value===So&&(e.value=Eo,e.value=e.factory()),"object"==typeof e.value&&e.value&&function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.ngOnDestroy}(e.value)&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){if(!t.providedIn)return!1;const e=ft(t.providedIn);return"string"==typeof e?"any"===e||e===this.scope:this.injectorDefTypes.has(e)}}function Ao(t){const e=Et(t),n=null!==e?e.factory:me(t);if(null!==n)return n;if(t instanceof oi)throw new Error(`Token ${ut(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=di(e,"?");throw new Error(`Can't resolve all parameters for ${ut(t)}: (${n.join(", ")}).`)}const n=function(t){const e=t&&(t[Tt]||t[At]);if(e){const n=function(t){if(t.hasOwnProperty("name"))return t.name;const e=(""+t).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),e}return null}(t);return null!==n?()=>n.factory(t):()=>new t}(t);throw new Error("unreachable")}function Po(t,e,n){let i;if(Do(t)){const e=ft(t);return me(e)||Ao(e)}if(Mo(t))i=()=>ft(t.useValue);else if(function(t){return!(!t||!t.useFactory)}(t))i=()=>t.useFactory(...Ti(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))i=()=>Ci(ft(t.useExisting));else{const e=ft(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return me(e)||Ao(e);i=()=>new e(...Ti(t.deps))}return i}function Io(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function Mo(t){return null!==t&&"object"==typeof t&&wi in t}function Do(t){return"function"==typeof t}const Ro=function(t,e,n){return function(t,e=null,n=null,i){const r=To(t,e,n,i);return r._resolveInjectorDefTypes(),r}({name:n},e,t,n)};class No{static create(t,e){return Array.isArray(t)?Ro(t,e,""):Ro(t.providers,t.parent,t.name||"")}}function Lo(t,e){_n(Cr(t)[1],Ge())}function jo(t){let e=function(t){return Object.getPrototypeOf(t.prototype).constructor}(t.type),n=!0;const i=[t];for(;e;){let r;if(fe(t))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(n){i.push(r);const e=t;e.inputs=Fo(t.inputs),e.declaredInputs=Fo(t.declaredInputs),e.outputs=Fo(t.outputs);const n=r.hostBindings;n&&zo(t,n);const s=r.viewQuery,o=r.contentQueries;if(s&&Bo(t,s),o&&Vo(t,o),ct(t.inputs,r.inputs),ct(t.declaredInputs,r.declaredInputs),ct(t.outputs,r.outputs),fe(r)&&r.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(r.data.animation)}}const e=r.features;if(e)for(let i=0;i=0;i--){const r=t[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Pn(r.hostAttrs,n=Pn(n,r.hostAttrs))}}(i)}function Fo(t){return t===Ht?{}:t===$t?[]:t}function Bo(t,e){const n=t.viewQuery;t.viewQuery=n?(t,i)=>{e(t,i),n(t,i)}:e}function Vo(t,e){const n=t.contentQueries;t.contentQueries=n?(t,i,r)=>{e(t,i,r),n(t,i,r)}:e}function zo(t,e){const n=t.hostBindings;t.hostBindings=n?(t,i)=>{e(t,i),n(t,i)}:e}No.THROW_IF_NOT_FOUND=mi,No.NULL=new wo,No.\u0275prov=xt({token:No,providedIn:"any",factory:()=>Ci(_o)}),No.__NG_ELEMENT_ID__=-1;let Uo=null;function Ho(){if(!Uo){const t=Ut.Symbol;if(t&&t.iterator)Uo=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;ea(Ae(t[i.index])):i.index;if(Te(n)){let o=null;if(!a&&l&&(o=function(t,e,n,i){const r=t.cleanup;if(null!=r)for(let s=0;sn?t[n]:null}"string"==typeof t&&(s+=2)}return null}(t,e,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,d=!1;else{s=ya(i,e,u,s,!1);const t=n.listen(f,r,s);h.push(s,t),c&&c.push(r,m,g,g+1)}}else s=ya(i,e,u,s,!0),f.addEventListener(r,s,o),h.push(s),c&&c.push(r,m,g,o)}else s=ya(i,e,u,s,!1);const p=i.outputs;let f;if(d&&null!==p&&(f=p[r])){const t=f.length;if(t)for(let n=0;n0;)e=e[15],t--;return e}(t,Ve.lFrame.contextLView))[8]}(t)}function _a(t,e){let n=null;const i=function(t){const e=t.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(t);for(let r=0;r=0}const Ta={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function ka(t){return t.substring(Ta.key,Ta.keyEnd)}function Aa(t){return t.substring(Ta.value,Ta.valueEnd)}function Pa(t,e){const n=Ta.textEnd;return n===e?-1:(e=Ta.keyEnd=function(t,e,n){for(;e32;)e++;return e}(t,Ta.key=e,n),Da(t,e,n))}function Ia(t,e){const n=Ta.textEnd;let i=Ta.key=Da(t,e,n);return n===i?-1:(i=Ta.keyEnd=function(t,e,n){let i;for(;e=65&&(-33&i)<=90||i>=48&&i<=57);)e++;return e}(t,i,n),i=Ra(t,i,n),i=Ta.value=Da(t,i,n),i=Ta.valueEnd=function(t,e,n){let i=-1,r=-1,s=-1,o=e,a=o;for(;o32&&(a=o),s=r,r=i,i=-33&l}return a}(t,i,n),Ra(t,i,n))}function Ma(t){Ta.key=0,Ta.keyEnd=0,Ta.value=0,Ta.valueEnd=0,Ta.textEnd=t.length}function Da(t,e,n){for(;e=0;n=Ia(e,n))qa(t,ka(e),Aa(e))}function Ba(t){Ua(pi,Va,t,!0)}function Va(t,e){for(let n=function(t){return Ma(t),Pa(t,Da(t,0,Ta.textEnd))}(e);n>=0;n=Pa(e,n))pi(t,ka(e),!0)}function za(t,e,n,i){const r=Ue(),s=He(),o=en(2);s.firstUpdatePass&&$a(s,t,o,i),e!==_s&&Xo(r,o,e)&&Xa(s,s.data[mn()],r,r[11],t,r[o+1]=function(t,e){return null==t||("string"==typeof e?t+=e:"object"==typeof t&&(t=ut(Wi(t)))),t}(e,n),i,o)}function Ua(t,e,n,i){const r=He(),s=en(2);r.firstUpdatePass&&$a(r,null,s,i);const o=Ue();if(n!==_s&&Xo(o,s,n)){const a=r.data[mn()];if(Qa(a,i)&&!Ha(r,s)){let t=i?a.classesWithoutHost:a.stylesWithoutHost;null!==t&&(n=ht(t,n||"")),ia(r,a,o,n,i)}else!function(t,e,n,i,r,s,o,a){r===_s&&(r=$t);let l=0,c=0,u=0=t.expandoStartIndex}function $a(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[mn()],o=Ha(t,n);Qa(s,i)&&null===e&&!o&&(e=!1),e=function(t,e,n,i){const r=sn(t);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(n=Wa(n=Ga(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=Ga(r,t,e,n,i),null===s){let n=function(t,e,n){const i=n?e.classBindings:e.styleBindings;if(0!==Os(i))return t[Es(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=Ga(null,t,e,n[1],i),n=Wa(n,e.attrs,i),function(t,e,n,i){t[Es(n?e.classBindings:e.styleBindings)]=i}(t,e,i,n))}else s=function(t,e,n){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(u=!0)}else c=n;if(r)if(0!==l){const e=Es(t[a+1]);t[i+1]=Ss(e,a),0!==e&&(t[e+1]=Ts(t[e+1],i)),t[a+1]=function(t,e){return 131071&t|e<<17}(t[a+1],i)}else t[i+1]=Ss(a,0),0!==a&&(t[a+1]=Ts(t[a+1],i)),a=i;else t[i+1]=Ss(l,0),0===a?a=i:t[l+1]=Ts(t[l+1],i),l=i;u&&(t[i+1]=Cs(t[i+1])),Ca(t,c,i,!0),Ca(t,c,i,!1),function(t,e,n,i,r){const s=r?t.residualClasses:t.residualStyles;null!=s&&"string"==typeof e&&gi(s,e)>=0&&(n[i+1]=ks(n[i+1]))}(e,c,t,i,s),o=Ss(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,n,o,i)}}function Ga(t,e,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a0;){const e=t[r],s=Array.isArray(e),l=s?e[1]:e,c=null===l;let u=n[r+1];u===_s&&(u=c?$t:void 0);let h=c?fi(u,i):l===i?u:void 0;if(s&&!Ka(h)&&(h=fi(e,i)),Ka(h)&&(a=h,o))return a;const d=t[r+1];r=o?Es(d):Os(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=fi(t,i))}return a}function Ka(t){return void 0!==t}function Qa(t,e){return 0!=(t.flags&(e?16:32))}function Za(t,e=""){const n=Ue(),i=He(),r=t+20,s=i.firstCreatePass?Is(i,r,1,e,null):i.data[r],o=n[r]=function(t,e){return Te(t)?t.createText(e):t.createTextNode(e)}(n[11],e);Jr(i,n,o,s),qe(s,!1)}function Ja(t){return tl("",t,""),Ja}function tl(t,e,n){const i=Ue(),r=Qo(i,t,e,n);return r!==_s&&yo(i,mn(),r),tl}function el(t,e,n,i,r){const s=Ue(),o=function(t,e,n,i,r,s){const o=Yo(t,Je(),n,r);return en(2),o?e+yt(n)+i+yt(r)+s:_s}(s,t,e,n,i,r);return o!==_s&&yo(s,mn(),o),el}function nl(t,e,n){Ua(pi,Va,Qo(Ue(),t,e,n),!0)}function il(t,e,n){const i=Ue();return Xo(i,tn(),e)&&$s(He(),yn(),i,t,e,i[11],n,!0),il}function rl(t,e,n){const i=Ue();if(Xo(i,tn(),e)){const r=He(),s=yn();$s(r,s,i,t,e,go(sn(r.data),s,i),n,!0)}return rl}const sl=void 0;var ol=["en",[["a","p"],["AM","PM"],sl],[["AM","PM"],sl,sl],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],sl,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],sl,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",sl,"{1} 'at' {0}",sl],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){const e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];let al={};function ll(t){return t in al||(al[t]=Ut.ng&&Ut.ng.common&&Ut.ng.common.locales&&Ut.ng.common.locales[t]),al[t]}var cl=(()=>((cl=cl||{})[cl.LocaleId=0]="LocaleId",cl[cl.DayPeriodsFormat=1]="DayPeriodsFormat",cl[cl.DayPeriodsStandalone=2]="DayPeriodsStandalone",cl[cl.DaysFormat=3]="DaysFormat",cl[cl.DaysStandalone=4]="DaysStandalone",cl[cl.MonthsFormat=5]="MonthsFormat",cl[cl.MonthsStandalone=6]="MonthsStandalone",cl[cl.Eras=7]="Eras",cl[cl.FirstDayOfWeek=8]="FirstDayOfWeek",cl[cl.WeekendRange=9]="WeekendRange",cl[cl.DateFormat=10]="DateFormat",cl[cl.TimeFormat=11]="TimeFormat",cl[cl.DateTimeFormat=12]="DateTimeFormat",cl[cl.NumberSymbols=13]="NumberSymbols",cl[cl.NumberFormats=14]="NumberFormats",cl[cl.CurrencyCode=15]="CurrencyCode",cl[cl.CurrencySymbol=16]="CurrencySymbol",cl[cl.CurrencyName=17]="CurrencyName",cl[cl.Currencies=18]="Currencies",cl[cl.Directionality=19]="Directionality",cl[cl.PluralCase=20]="PluralCase",cl[cl.ExtraData=21]="ExtraData",cl))();const ul="en-US";let hl=ul;function dl(t){wt(t,"Expected localeId to be defined"),"string"==typeof t&&(hl=t.toLowerCase().replace(/_/g,"-"))}function pl(t,e,n,i,r){if(t=ft(t),Array.isArray(t))for(let s=0;s>20;if(Do(t)||!t.multi){const i=new On(l,r,ea),p=ml(a,e,r?u:u+d,h);-1===p?(Un(Fn(c,o),s,a),fl(s,t,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(i),o.push(i)):(n[p]=i,o[p]=i)}else{const p=ml(a,e,u+d,h),f=ml(a,e,u,u+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Un(Fn(c,o),s,a);const u=function(t,e,n,i,r){const s=new On(t,n,ea);return s.multi=[],s.index=e,s.componentProviders=0,gl(s,r,i&&!n),s}(r?yl:bl,n.length,r,i,l);!r&&m&&(n[f].providerFactory=u),fl(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(u),o.push(u)}else fl(s,t,p>-1?p:f,gl(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function fl(t,e,n,i){const r=Do(e);if(r||function(t){return!!t.useClass}(e)){const s=(e.useClass||e).prototype.ngOnDestroy;if(s){const o=t.destroyHooks||(t.destroyHooks=[]);if(!r&&e.multi){const t=o.indexOf(n);-1===t?o.push(n,[i,s]):o[t+1].push(i,s)}else o.push(n,s)}}}function gl(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function ml(t,e,n,i){for(let r=n;r{n.providersResolver=(n,i)=>function(t,e,n){const i=He();if(i.firstCreatePass){const r=fe(t);pl(n,i.data,i.blueprint,r,!0),pl(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class wl{}const xl="ngComponent";class Sl{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${ut(t)}. Did you add it to @NgModule.entryComponents?`);return e[xl]=t,e}(t)}}class El{}function Cl(...t){}function Ol(t,e){return new kl(Ie(t,e))}El.NULL=new Sl;const Tl=function(){return Ol(Ge(),Ue())};let kl=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=Tl,t})();function Al(t){return t instanceof kl?t.nativeElement:t}class Pl{}let Il=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Ml(),t})();const Ml=function(){const t=Ue(),e=Re(Ge().index,t);return function(t){return t[11]}(ce(e)?e:t)};let Dl=(()=>{class t{}return t.\u0275prov=xt({token:t,providedIn:"root",factory:()=>null}),t})();class Rl{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Nl=new Rl("12.2.5");class Ll{constructor(){}supports(t){return Go(t)}create(t){return new Fl(t)}}const jl=(t,e)=>e;class Fl{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||jl}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,i=0,r=null;for(;e||n;){const s=!n||e&&e.currentIndex{i=this._trackByFn(e,t),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,t,i,e)),Object.is(r.item,t)||this._addIdentityChange(r,t)):(r=this._mismatch(r,t,i,e),s=!0),r=r._next,e++}),this.length=e;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,i){let r;return null===t?r=this._itTail:(r=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,r,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,r,i)):t=this._addAfter(new Bl(e,n),r,i),t}_verifyReinsertion(t,e,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?t=this._reinsertAfter(r,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,r=t._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const i=null===e?this._itHead:e._next;return t._next=i,t._prev=e,null===i?this._itTail=t:i._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new zl),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new zl),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class Bl{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Vl{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class zl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new Vl,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Ul(t,e,n){const i=t.previousIndex;if(null===i)return i;let r=0;return n&&i{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const i=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,i)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new Gl(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class Gl{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function Wl(){return new ql([new Ll])}let ql=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Wl()),deps:[[t,new Di,new Mi]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(t){return t.name||typeof t}(t)}'`)}}return t.\u0275prov=xt({token:t,providedIn:"root",factory:Wl}),t})();function Xl(){return new Yl([new Hl])}let Yl=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Xl()),deps:[[t,new Di,new Mi]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=xt({token:t,providedIn:"root",factory:Xl}),t})();function Kl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(Ae(s)),ue(s))for(let t=10;t-1&&(Hr(t,n),hi(e,n))}this._attachedToViewContainer=!1}$r(this._lView[1],this._lView)}onDestroy(t){Us(this._lView[1],this._lView,null,t)}markForCheck(){ao(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){lo(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){Qe(!0);try{lo(t,e,n)}finally{Qe(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(t,e){rs(t,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class Zl extends Ql{constructor(t){super(t),this._view=t}detectChanges(){co(this._view)}checkNoChanges(){!function(t){Qe(!0);try{co(t)}finally{Qe(!1)}}(this._view)}get context(){return null}}const Jl=function(t){return function(t,e,n){if(de(t)&&!n){const n=Re(t.index,e);return new Ql(n,n)}return 47&t.type?new Ql(e[16],e):null}(Ge(),Ue(),16==(16&t))};let tc=(()=>{class t{}return t.__NG_ELEMENT_ID__=Jl,t})();const ec=[new Hl],nc=new ql([new Ll]),ic=new Yl(ec),rc=function(){return lc(Ge(),Ue())};let sc=(()=>{class t{}return t.__NG_ELEMENT_ID__=rc,t})();const oc=sc,ac=class extends oc{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=Ps(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(e)),Ds(e,n,t),new Ql(n)}};function lc(t,e){return 4&t.type?new ac(e,t,Ol(t,e)):null}class cc{}const uc=function(){return mc(Ge(),Ue())};let hc=(()=>{class t{}return t.__NG_ELEMENT_ID__=uc,t})();const dc=hc,pc=class extends dc{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return Ol(this._hostTNode,this._hostLView)}get injector(){return new Jn(this._hostTNode,this._hostLView)}get parentInjector(){const t=zn(this._hostTNode,this._hostLView);if(Mn(t)){const e=Rn(t,this._hostLView),n=Dn(t);return new Jn(e[1].data[n+8],e)}return new Jn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=fc(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,e,n){const i=t.createEmbeddedView(e||{});return this.insert(i,n),i}createComponent(t,e,n,i,r){const s=n||this.parentInjector;if(!r&&null==t.ngModule&&s){const t=s.get(cc,null);t&&(r=t)}const o=t.create(s,i,void 0,r);return this.insert(o.hostView,e),o}insert(t,e){const n=t._lView,i=n[1];if(function(t){return ue(t[3])}(n)){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],i=new pc(e,e[6],e[3]);i.detach(i.indexOf(t))}}const r=this._adjustIndex(e),s=this._lContainer;!function(t,e,n,i){const r=10+i,s=n.length;i>0&&(n[r-1][4]=e),iAr});class wc extends wl{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=function(t){return t.map(vs).join(",")}(t.selectors),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return vc(this.componentDef.inputs)}get outputs(){return vc(this.componentDef.outputs)}create(t,e,n,i){const r=(i=i||this.ngModule)?function(t,e){return{get:(n,i,r)=>{const s=t.get(n,bc,r);return s!==bc||i===bc?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Pl,ke),o=r.get(Dl,null),a=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(Te(t))return t.selectRootElement(e,n===jt.ShadowDom);let i="string"==typeof e?t.querySelector(e):e;return i.textContent="",i}(a,n,this.componentDef.encapsulation):zr(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?Ee:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),u=this.componentDef.onPush?576:528,h=function(t,e){return{components:[],scheduler:t||Ar,clean:ho,playerHandler:e||null,flags:0}}(),d=zs(0,null,null,1,0,null,null,null,null,null),p=Ps(null,d,h,u,null,null,s,a,o,r);let f,g;un(p);try{const t=function(t,e,n,i,r,s){const o=n[1];n[20]=t;const a=Is(o,20,2,"#host",null),l=a.mergedAttrs=e.hostAttrs;null!==l&&(vo(a,l,!0),null!==t&&(Tn(r,t,l),null!==a.classes&&as(r,t,a.classes),null!==a.styles&&os(r,t,a.styles)));const c=i.createRenderer(t,e),u=Ps(n,Vs(e),null,e.onPush?64:16,n[20],a,i,c,s||null,null);return o.firstCreatePass&&(Un(Fn(a,n),o,e.type),Xs(o,a),Ks(a,n.length,1)),oo(n,u),n[20]=u}(c,this.componentDef,p,s,a);if(c)if(n)Tn(a,c,["ng-version",Nl.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let i=1,r=2;for(;i0&&as(a,c,e.join(" "))}if(g=Me(d,20),void 0!==e){const t=g.projection=[];for(let n=0;nt(o,e)),e.contentQueries){const t=Ge();e.contentQueries(1,o,t.directiveStart)}const a=Ge();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(bn(a.index),Ws(n[1],a,0,a.directiveStart,a.directiveEnd,e),qs(e,o)),o}(t,this.componentDef,p,h,[Lo]),Ds(d,p,null)}finally{gn()}return new xc(this.componentType,f,Ol(g,p),p,g)}}class xc extends class{}{constructor(t,e,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.instance=e,this.hostView=this.changeDetectorRef=new Zl(i),this.componentType=t}get injector(){return new Jn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Sc=new Map;class Ec extends cc{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new yc(this);const n=le(t),i=function(t){return t[Yt]||null}(t);i&&dl(i),this._bootstrapComponents=Mr(n.bootstrap),this._r3Injector=To(t,e,[{provide:cc,useValue:this},{provide:El,useValue:this.componentFactoryResolver}],ut(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=No.THROW_IF_NOT_FOUND,n=It.Default){return t===No||t===cc||t===_o?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Cc extends class{}{constructor(t){super(),this.moduleType=t,null!==le(t)&&function(t){const e=new Set;!function t(n){const i=le(n,!0),r=i.id;null!==r&&(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${ut(e)} vs ${ut(e.name)}`)}(r,Sc.get(r),n),Sc.set(r,n));const s=Mr(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Ec(this.moduleType,t)}}function Oc(t,e,n){const i=Ze()+t,r=Ue();return r[i]===_s?qo(r,i,n?e.call(n):e()):function(t,e){return t[e]}(r,i)}function Tc(t,e,n,i){return Pc(Ue(),Ze(),t,e,n,i)}function kc(t,e,n,i,r,s){return function(t,e,n,i,r,s,o,a){const l=e+n;return function(t,e,n,i,r){const s=Yo(t,e,n,i);return Xo(t,e+2,r)||s}(t,l,r,s,o)?qo(t,l+3,a?i.call(a,r,s,o):i(r,s,o)):Ac(t,l+3)}(Ue(),Ze(),t,e,n,i,r,s)}function Ac(t,e){const n=t[e];return n===_s?void 0:n}function Pc(t,e,n,i,r,s){const o=e+n;return Xo(t,o,r)?qo(t,o+1,s?i.call(s,r):i(r)):Ac(t,o+1)}function Ic(t,e){const n=He();let i;const r=t+20;n.firstCreatePass?(i=function(t,e){if(e)for(let n=e.length-1;n>=0;n--){const i=e[n];if(t===i.name)return i}throw new mt("302",`The pipe '${t}' could not be found!`)}(e,n.pipeRegistry),n.data[r]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(r,i.onDestroy)):i=n.data[r];const s=i.factory||(i.factory=me(i.type)),o=Dt(ea);try{const t=Ln(!1),e=s();return Ln(t),function(t,e,n,i){n>=t.data.length&&(t.data[n]=null,t.blueprint[n]=null),e[n]=i}(n,Ue(),r,e),e}finally{Dt(o)}}function Mc(t,e,n){const i=t+20,r=Ue(),s=De(r,i);return function(t,e){$o.isWrapped(e)&&(e=$o.unwrap(e),t[Je()]=_s);return e}(r,function(t,e){return t[1].data[e].pure}(r,i)?Pc(r,Ze(),e,s.transform,n,s):s.transform(n))}function Dc(t){return e=>{setTimeout(t,void 0,e)}}const Rc=class extends P{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){var i,r,s;let o=t,a=e||(()=>null),l=n;if(t&&"object"==typeof t){const e=t;o=null===(i=e.next)||void 0===i?void 0:i.bind(e),a=null===(r=e.error)||void 0===r?void 0:r.bind(e),l=null===(s=e.complete)||void 0===s?void 0:s.bind(e)}this.__isAsync&&(a=Dc(a),o&&(o=Dc(o)),l&&(l=Dc(l)));const c=super.subscribe({next:o,error:a,complete:l});return t instanceof g&&t.add(c),c}};function Nc(){return this._results[Ho()]()}class Lc{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const e=Ho(),n=Lc.prototype;n[e]||(n[e]=Nc)}get changes(){return this._changes||(this._changes=new Rc)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,e){const n=this;n.dirty=!1;const i=li(t);(this._changesDetected=!function(t,e,n){if(t.length!==e.length)return!1;for(let i=0;i0)i.push(o[t/2]);else{const r=s[t+1],o=e[-n];for(let t=10;t{class t{constructor(t){this.appInits=t,this.resolve=Cl,this.reject=Cl,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n{e.subscribe({complete:t,error:n})});t.push(n)}}Promise.all(t).then(()=>{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(Ci(tu,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const nu=new oi("AppId"),iu={provide:nu,useFactory:function(){return`${ru()}${ru()}${ru()}`},deps:[]};function ru(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const su=new oi("Platform Initializer"),ou=new oi("Platform ID"),au=new oi("appBootstrapListener");let lu=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const cu=new oi("LocaleId"),uu=new oi("DefaultCurrencyCode");class hu{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const du=function(t){return new Cc(t)},pu=du,fu=function(t){return Promise.resolve(du(t))},gu=function(t){const e=du(t),n=Mr(le(t).declarations).reduce((t,e)=>{const n=ae(e);return n&&t.push(new wc(n)),t},[]);return new hu(e,n)},mu=gu,bu=function(t){return Promise.resolve(gu(t))};let yu=(()=>{class t{constructor(){this.compileModuleSync=pu,this.compileModuleAsync=fu,this.compileModuleAndAllComponentsSync=mu,this.compileModuleAndAllComponentsAsync=bu}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const vu=new oi("compilerOptions"),_u=(()=>Promise.resolve(0))();function wu(t){"undefined"==typeof Zone?_u.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class xu{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Rc(!1),this.onMicrotaskEmpty=new Rc(!1),this.onStable=new Rc(!1),this.onError=new Rc(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const i=this;i._nesting=0,i._outer=i._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!n&&e,i.shouldCoalesceRunChangeDetection=n,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function(){let t=Ut.requestAnimationFrame,e=Ut.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=()=>{!function(t){t.isCheckStableRunning||-1!==t.lastRequestAnimationFrameId||(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(Ut,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,Cu(t),t.isCheckStableRunning=!0,Eu(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Cu(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,i,r,s,o,a)=>{try{return Ou(t),n.invokeTask(r,s,o,a)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||t.shouldCoalesceRunChangeDetection)&&e(),Tu(t)}},onInvoke:(n,i,r,s,o,a,l)=>{try{return Ou(t),n.invoke(r,s,o,a,l)}finally{t.shouldCoalesceRunChangeDetection&&e(),Tu(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Cu(t),Eu(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,i,r)=>(e.handleError(i,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}(i)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!xu.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(xu.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,t,Su,Cl,Cl);try{return r.runTask(s,e,n)}finally{r.cancelTask(s)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}const Su={};function Eu(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Cu(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function Ou(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Tu(t){t._nesting--,Eu(t)}class ku{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Rc,this.onMicrotaskEmpty=new Rc,this.onStable=new Rc,this.onError=new Rc}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,i){return t.apply(e,n)}}let Au=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{xu.assertNotInAngularZone(),wu(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())wu(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let i=-1;e&&e>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==i),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})}whenStable(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Pu=(()=>{class t{constructor(){this._applications=new Map,Mu.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return Mu.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Iu{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let Mu=new Iu,Du=!0,Ru=!1;function Nu(){return Ru=!0,Du}let Lu;const ju=new oi("AllowMultipleToken");function Fu(t,e,n=[]){const i=`Platform: ${e}`,r=new oi(i);return(e=[])=>{let s=Bu();if(!s||s.injector.get(ju,!1))if(t)t(n.concat(e).concat({provide:r,useValue:!0}));else{const t=n.concat(e).concat({provide:r,useValue:!0},{provide:xo,useValue:"platform"});!function(t){if(Lu&&!Lu.destroyed&&!Lu.injector.get(ju,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Lu=t.get(Vu);const e=t.get(su,null);e&&e.forEach(t=>t())}(No.create({providers:t,name:i}))}return function(t){const e=Bu();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function Bu(){return Lu&&!Lu.destroyed?Lu:null}let Vu=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new ku:("zone.js"===t?void 0:t)||new xu({enableLongStackTrace:Nu(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),n}(e?e.ngZone:void 0,{ngZoneEventCoalescing:e&&e.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:e&&e.ngZoneRunCoalescing||!1}),i=[{provide:xu,useValue:n}];return n.run(()=>{const r=No.create({providers:i,parent:this.injector,name:t.moduleType.name}),s=t.create(r),o=s.injector.get(kr,null);if(!o)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const t=n.onError.subscribe({next:t=>{o.handleError(t)}});s.onDestroy(()=>{Hu(this._modules,s),t.unsubscribe()})}),function(t,n,i){try{const e=i();return ha(e)?e.catch(e=>{throw n.runOutsideAngular(()=>t.handleError(e)),e}):e}catch(e){throw n.runOutsideAngular(()=>t.handleError(e)),e}}(o,n,()=>{const t=s.injector.get(eu);return t.runInitializers(),t.donePromise.then(()=>(dl(s.injector.get(cu,ul)||ul),this._moduleDoBootstrap(s),s))})})}bootstrapModule(t,e=[]){const n=zu({},e);return function(t,e,n){const i=new Cc(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(Uu);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${ut(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(e)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function zu(t,e){return Array.isArray(e)?e.reduce(zu,t):Object.assign(Object.assign({},t),e)}let Uu=(()=>{class t{constructor(t,e,n,i,r){this._zone=t,this._injector=e,this._exceptionHandler=n,this._componentFactoryResolver=i,this._initStatus=r,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const s=new C(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),o=new C(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{xu.assertNotInAngularZone(),wu(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{xu.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=Q(s,o.pipe(at()))}bootstrap(t,e){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=t instanceof wl?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=function(t){return t.isBoundToModule}(n)?void 0:this._injector.get(cc),r=n.create(No.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Au,null),a=o&&r.injector.get(Pu);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),Hu(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;Hu(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(au,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(No),Ci(kr),Ci(El),Ci(eu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Hu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const $u=Fu(null,"core",[{provide:ou,useValue:"unknown"},{provide:Vu,deps:[No]},{provide:Pu,deps:[]},{provide:lu,deps:[]}]),Gu=[{provide:Uu,useClass:Uu,deps:[xu,No,kr,El,eu]},{provide:_c,deps:[xu],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:eu,useClass:eu,deps:[[new Mi,tu]]},{provide:yu,useClass:yu,deps:[]},iu,{provide:ql,useFactory:function(){return nc},deps:[]},{provide:Yl,useFactory:function(){return ic},deps:[]},{provide:cu,useFactory:function(t){return dl(t=t||"undefined"!=typeof $localize&&$localize.locale||ul),t},deps:[[new Ii(cu),new Mi,new Di]]},{provide:uu,useValue:"USD"}];let Wu=(()=>{class t{constructor(t){}}return t.\u0275fac=function(e){return new(e||t)(Ci(Uu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Gu}),t})(),qu=null;function Xu(){return qu}const Yu=new oi("DocumentToken");let Ku=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:Qu,token:t,providedIn:"platform"}),t})();function Qu(){return Ci(Zu)}let Zu=(()=>{class t extends Ku{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Xu().getBaseHref(this._doc)}onPopState(t){const e=Xu().getGlobalEventTarget(this._doc,"window");return e.addEventListener("popstate",t,!1),()=>e.removeEventListener("popstate",t)}onHashChange(t){const e=Xu().getGlobalEventTarget(this._doc,"window");return e.addEventListener("hashchange",t,!1),()=>e.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){Ju()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){Ju()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:th,token:t,providedIn:"platform"}),t})();function Ju(){return!!window.history.pushState}function th(){return new Zu(Ci(Yu))}function eh(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}function nh(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}function ih(t){return t&&"?"!==t[0]?"?"+t:t}let rh=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:sh,token:t,providedIn:"root"}),t})();function sh(t){const e=Ci(Yu).location;return new ah(Ci(Ku),e&&e.origin||"")}const oh=new oi("appBaseHref");let ah=(()=>{class t extends rh{constructor(t,e){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=e}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return eh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+ih(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+ih(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+ih(i));this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var e,n;null===(n=(e=this._platformLocation).historyGo)||void 0===n||n.call(e,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ku),Ci(oh,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),lh=(()=>{class t{constructor(t,e){this._subject=new Rc,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=nh(uh(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+ih(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,uh(e)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ih(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ih(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var e,n;null===(n=(e=this._platformStrategy).historyGo)||void 0===n||n.call(e,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}))}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}}return t.\u0275fac=function(e){return new(e||t)(Ci(rh),Ci(Ku))},t.normalizeQueryParams=ih,t.joinWithSlash=eh,t.stripTrailingSlash=nh,t.\u0275prov=xt({factory:ch,token:t,providedIn:"root"}),t})();function ch(){return new lh(Ci(rh),Ci(Ku))}function uh(t){return t.replace(/\/index.html$/,"")}var hh=(()=>((hh=hh||{})[hh.Zero=0]="Zero",hh[hh.One=1]="One",hh[hh.Two=2]="Two",hh[hh.Few=3]="Few",hh[hh.Many=4]="Many",hh[hh.Other=5]="Other",hh))();const dh=function(t){return function(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=ll(e);if(n)return n;const i=e.split("-")[0];if(n=ll(i),n)return n;if("en"===i)return ol;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[cl.PluralCase]};class ph{}let fh=(()=>{class t extends ph{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(dh(e||this.locale)(t)){case hh.Zero:return"zero";case hh.One:return"one";case hh.Two:return"two";case hh.Few:return"few";case hh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(Ci(cu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function gh(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[i,r]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(i.trim()===e)return decodeURIComponent(r)}return null}let mh=(()=>{class t{constructor(t,e,n,i){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&(Go(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachChangedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachRemovedItem(t=>{t.previousValue&&this._toggleClass(t.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(t=>{if("string"!=typeof t.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${ut(t.item)}`);this._toggleClass(t.item,!0)}),t.forEachRemovedItem(t=>this._toggleClass(t.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!0)):Object.keys(t).forEach(e=>this._toggleClass(e,!!t[e])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!1)):Object.keys(t).forEach(t=>this._toggleClass(t,!1)))}_toggleClass(t,e){(t=t.trim())&&t.split(/\s+/g).forEach(t=>{e?this._renderer.addClass(this._ngEl.nativeElement,t):this._renderer.removeClass(this._ngEl.nativeElement,t)})}}return t.\u0275fac=function(e){return new(e||t)(ea(ql),ea(Yl),ea(kl),ea(Il))},t.\u0275dir=se({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class bh{constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let yh=(()=>{class t{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const e=this._ngForOf;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${e}' of type '${function(t){return t.name||typeof t}(e)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,i)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new bh(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new vh(t,n);e.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new vh(t,r);e.push(s)}});for(let n=0;n{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(ql))},t.\u0275dir=se({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class vh{constructor(t,e){this.record=t,this.view=e}}let _h=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new wh,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){xh("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){xh("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc))},t.\u0275dir=se({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class wh{constructor(){this.$implicit=null,this.ngIf=null}}function xh(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${ut(e)}'.`)}class Sh{constructor(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()}}let Eh=(()=>{class t{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let e=0;e{class t{constructor(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new Sh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(Eh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Oh=(()=>{class t{constructor(t,e,n){n._addDefault(new Sh(t,e))}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(Eh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchDefault",""]]}),t})(),Th=(()=>{class t{constructor(t,e,n){this._ngEl=t,this._differs=e,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,e){const[n,i]=t.split(".");null!=(e=null!=e&&i?`${e}${i}`:e)?this._renderer.setStyle(this._ngEl.nativeElement,n,e):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(t){t.forEachRemovedItem(t=>this._setStyle(t.key,null)),t.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),t.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Yl),ea(Il))},t.\u0275dir=se({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),kh=(()=>{class t{constructor(t){this._viewContainerRef=t,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(t){if(t.ngTemplateOutlet){const t=this._viewContainerRef;this._viewRef&&t.remove(t.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?t.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&t.ngTemplateOutletContext&&this.ngTemplateOutletContext&&(this._viewRef.context=this.ngTemplateOutletContext)}}return t.\u0275fac=function(e){return new(e||t)(ea(hc))},t.\u0275dir=se({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[ye]}),t})();class Ah{createSubscription(t,e){return t.subscribe({next:e,error:t=>{throw t}})}dispose(t){t.unsubscribe()}onDestroy(t){t.unsubscribe()}}class Ph{createSubscription(t,e){return t.then(e,t=>{throw t})}dispose(t){}onDestroy(t){}}const Ih=new Ph,Mh=new Ah;let Dh=(()=>{class t{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,e=>this._updateLatestValue(t,e))}_selectStrategy(e){if(ha(e))return Ih;if(da(e))return Mh;throw function(t,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${ut(t)}'`)}(t,e)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,e){t===this._obj&&(this._latestValue=e,this._ref.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(ea(tc,16))},t.\u0275pipe=oe({name:"async",type:t,pure:!1}),t})(),Rh=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:ph,useClass:fh}]}),t})();const Nh="browser";function Lh(t){return t===Nh}class jh{}class Fh extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(t){qu||(qu=t)}(new Fh)}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getBaseHref(t){const e=(Vh=Vh||document.querySelector("base"),Vh?Vh.getAttribute("href"):null);return null==e?null:function(t){Bh=Bh||document.createElement("a"),Bh.setAttribute("href",t);const e=Bh.pathname;return"/"===e.charAt(0)?e:`/${e}`}(e)}resetBaseElement(){Vh=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return gh(document.cookie,t)}}let Bh,Vh=null;const zh=new oi("TRANSITION_ID"),Uh=[{provide:tu,useFactory:function(t,e,n){return()=>{n.get(eu).donePromise.then(()=>{const n=Xu(),i=e.querySelectorAll(`style[ng-transition="${t}"]`);for(let t=0;t{const i=t.findTestabilityInTree(e,n);if(null==i)throw new Error("Could not find testability for element.");return i},Ut.getAllAngularTestabilities=()=>t.getAllTestabilities(),Ut.getAllAngularRootElements=()=>t.getAllRootElements(),Ut.frameworkStabilizers||(Ut.frameworkStabilizers=[]),Ut.frameworkStabilizers.push(t=>{const e=Ut.getAllAngularTestabilities();let n=e.length,i=!1;const r=function(e){i=i||e,n--,0==n&&t(i)};e.forEach(function(t){t.whenStable(r)})})}findTestabilityInTree(t,e,n){if(null==e)return null;const i=t.getTestability(e);return null!=i?i:n?Xu().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}let $h=(()=>{class t{build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Gh=new oi("EventManagerPlugins");let Wh=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let i=0;i{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Yh=(()=>{class t extends Xh{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,e,n){t.forEach(t=>{const i=this._doc.createElement("style");i.textContent=t,n.push(e.appendChild(i))})}addHost(t){const e=[];this._addStylesToHost(this._stylesSet,t,e),this._hostNodes.set(t,e)}removeHost(t){const e=this._hostNodes.get(t);e&&e.forEach(Kh),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((e,n)=>{this._addStylesToHost(t,n,e)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(Kh))}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Kh(t){Xu().remove(t)}const Qh={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Zh=/%COMP%/g;function Jh(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let ed=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new nd(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case jt.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new id(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case jt.ShadowDom:return new rd(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=Jh(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(Ci(Wh),Ci(Yh),Ci(nu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class nd{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(Qh[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,i){if(i){e=i+":"+e;const r=Qh[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=Qh[n];i?t.removeAttributeNS(i,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&(Dr.DashCase|Dr.Important)?t.style.setProperty(e,n,i&Dr.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&Dr.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,td(n)):this.eventManager.addEventListener(t,e,td(n))}}class id extends nd{constructor(t,e,n,i){super(t),this.component=n;const r=Jh(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr=function(t){return"_ngcontent-%COMP%".replace(Zh,t)}(i+"-"+n.id),this.hostAttr=function(t){return"_nghost-%COMP%".replace(Zh,t)}(i+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class rd extends nd{constructor(t,e,n,i){super(t),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=Jh(i.id,i.styles,[]);for(let s=0;s{class t extends qh{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const od=["alt","control","meta","shift"],ad={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},ld={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},cd={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let ud=(()=>{class t extends qh{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,i){const r=t.parseEventName(n),s=t.eventCallback(r.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Xu().onAndCancel(e,r.domEventName,s))}static parseEventName(e){const n=e.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=t._normalizeKey(n.pop());let s="";if(od.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),s+=t+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&ld.hasOwnProperty(e)&&(e=ld[e]))}return ad[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),od.forEach(i=>{i!=n&&cd[i](t)&&(e+=i+".")}),e+=n,e}static eventCallback(e,n,i){return r=>{t.getEventFullKey(r)===e&&i.runGuarded(()=>n(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),hd=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return Ci(dd)},token:t,providedIn:"root"}),t})(),dd=(()=>{class t extends hd{constructor(t){super(),this._doc=t}sanitize(t,e){if(null==e)return null;switch(t){case yr.NONE:return e;case yr.HTML:return qi(e,"HTML")?Wi(e):mr(this._doc,String(e)).toString();case yr.STYLE:return qi(e,"Style")?Wi(e):e;case yr.SCRIPT:if(qi(e,"Script"))return Wi(e);throw new Error("unsafe value used in a script context");case yr.URL:return Xi(e),qi(e,"URL")?Wi(e):Ji(String(e));case yr.RESOURCE_URL:if(qi(e,"ResourceURL"))return Wi(e);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function(t){return new zi(t)}(t)}bypassSecurityTrustStyle(t){return function(t){return new Ui(t)}(t)}bypassSecurityTrustScript(t){return function(t){return new Hi(t)}(t)}bypassSecurityTrustUrl(t){return function(t){return new $i(t)}(t)}bypassSecurityTrustResourceUrl(t){return function(t){return new Gi(t)}(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return function(t){return new dd(t.get(Yu))}(Ci(_o))},token:t,providedIn:"root"}),t})();const pd=Fu($u,"browser",[{provide:ou,useValue:Nh},{provide:su,useValue:function(){Fh.makeCurrent(),Hh.init()},multi:!0},{provide:Yu,useFactory:function(){return function(t){Ce=t}(document),document},deps:[]}]),fd=[[],{provide:xo,useValue:"root"},{provide:kr,useFactory:function(){return new kr},deps:[]},{provide:Gh,useClass:sd,multi:!0,deps:[Yu,xu,ou]},{provide:Gh,useClass:ud,multi:!0,deps:[Yu]},[],{provide:ed,useClass:ed,deps:[Wh,Yh,nu]},{provide:Pl,useExisting:ed},{provide:Xh,useExisting:Yh},{provide:Yh,useClass:Yh,deps:[Yu]},{provide:Au,useClass:Au,deps:[xu]},{provide:Wh,useClass:Wh,deps:[Gh,xu]},{provide:jh,useClass:$h,deps:[]},[]];let gd=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:nu,useValue:e.appId},{provide:zh,useExisting:nu},Uh]}}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:fd,imports:[Rh,Wu]}),t})();function md(t){return null!=t&&"false"!=`${t}`}function bd(t,e=0){return function(t){return!isNaN(parseFloat(t))&&!isNaN(Number(t))}(t)?Number(t):e}function yd(t){return Array.isArray(t)?t:[t]}function vd(t){return null==t?"":"string"==typeof t?t:`${t}px`}function _d(t){return t instanceof kl?t.nativeElement:t}function wd(...t){let e=t[t.length-1];return M(e)?(t.pop(),z(t,e)):K(t)}function xd(t,e,n,i){return a(n)&&(i=n,n=void 0),i?xd(t,e,n).pipe(D(t=>d(t)?i(...t):i(t))):new C(i=>{Sd(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Sd(t,e,n,i,r){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const i=t;t.addEventListener(e,n,r),s=()=>i.removeEventListener(e,n,r)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const i=t;t.on(e,n),s=()=>i.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const i=t;t.addListener(e,n),s=()=>i.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let s=0,o=t.length;s{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class Td extends Od{constructor(t,e=Od.now){super(t,()=>Td.delegate&&Td.delegate!==this?Td.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return Td.delegate&&Td.delegate!==this?Td.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}new class extends Td{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,i=-1,r=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++i0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame(()=>t.flush(null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(cancelAnimationFrame(e),t.scheduled=void 0)}});let kd=1;const Ad=Promise.resolve(),Pd={};function Id(t){return t in Pd&&(delete Pd[t],!0)}const Md={setImmediate(t){const e=kd++;return Pd[e]=!0,Ad.then(()=>Id(e)&&t()),e},clearImmediate(t){Id(t)}};new class extends Td{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,i=-1,r=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++i0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=Md.setImmediate(t.flush.bind(t,null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(Md.clearImmediate(e),t.scheduled=void 0)}});function Dd(t){return!!t&&(t instanceof C||"function"==typeof t.lift&&"function"==typeof t.subscribe)}function Rd(t,e){return n=>n.lift(new Nd(t,e))}class Nd{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new Ld(t,this.compare,this.keySelector))}}class Ld extends v{constructor(t,e,n){super(t),this.keySelector=n,this.hasKey=!1,"function"==typeof e&&(this.compare=e)}compare(t,e){return t===e}_next(t){let e;try{const{keySelector:n}=this;e=n?n(t):t}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:t}=this;n=t(this.key,e)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))}}const jd=new Td(Cd);class Fd{constructor(t){this.durationSelector=t}call(t,e){return e.subscribe(new Bd(t,this.durationSelector))}}class Bd extends ${constructor(t,e){super(t),this.durationSelector=e,this.hasValue=!1}_next(t){if(this.value=t,this.hasValue=!0,!this.throttled){let n;try{const{durationSelector:e}=this;n=e(t)}catch(e){return this.destination.error(e)}const i=G(n,new H(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:t,hasValue:e,throttled:n}=this;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),e&&(this.value=void 0,this.hasValue=!1,this.destination.next(t))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function Vd(t){return!d(t)&&t-parseFloat(t)+1>=0}function zd(t){const{index:e,period:n,subscriber:i}=t;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}}function Ud(t,e=jd){return function(t){return function(e){return e.lift(new Fd(t))}}(()=>function(t=0,e,n){let i=-1;return Vd(e)?i=Number(e)<1?1:Number(e):M(e)&&(n=e),M(n)||(n=jd),new C(e=>{const r=Vd(t)?t:+t-n.now();return n.schedule(zd,r,{index:0,period:i,subscriber:e})})}(t,e))}function Hd(t,e){return function(n){return n.lift(new $d(t,e))}}class $d{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new Gd(t,this.predicate,this.thisArg))}}class Gd extends v{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}function Wd(t){return e=>e.lift(new qd(t))}class qd{constructor(t){this.notifier=t}call(t,e){const n=new Xd(t),i=G(this.notifier,new H(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class Xd extends ${constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Yd(...t){return Y(1)(wd(...t))}function Kd(...t){const e=t[t.length-1];return M(e)?(t.pop(),n=>Yd(t,n,e)):e=>Yd(t,e)}function Qd(t,e){return"function"==typeof e?n=>n.pipe(Qd((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new Zd(t))}class Zd{constructor(t){this.project=t}call(t,e){return e.subscribe(new Jd(t,this.project))}}class Jd extends ${constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e)}_innerSub(t){const e=this.innerSubscription;e&&e.unsubscribe();const n=new H(this),i=this.destination;i.add(n),this.innerSubscription=G(t,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:t}=this;(!t||t.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(t){this.destination.next(t)}}const tp=new class extends Td{}(class extends Cd{constructor(t,e){super(t,e),this.scheduler=t,this.work=e}schedule(t,e=0){return e>0?super.schedule(t,e):(this.delay=e,this.state=t,this.scheduler.flush(this),this)}execute(t,e){return e>0||this.closed?super.execute(t,e):this._execute(t,e)}requestAsyncId(t,e,n=0){return null!==n&&n>0||null===n&&this.delay>0?super.requestAsyncId(t,e,n):t.flush(this)}}),ep=new C(t=>t.complete());function np(t){return t?function(t){return new C(e=>t.schedule(()=>e.complete()))}(t):ep}function ip(t,e){return new C(e?n=>e.schedule(rp,0,{error:t,subscriber:n}):e=>e.error(t))}function rp({error:t,subscriber:e}){e.error(t)}class sp{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return wd(this.value);case"E":return ip(this.error);case"C":return np()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new sp("N",t):sp.undefinedValueNotification}static createError(t){return new sp("E",void 0,t)}static createComplete(){return sp.completeNotification}}sp.completeNotification=new sp("C"),sp.undefinedValueNotification=new sp("N",void 0);class op extends v{constructor(t,e,n=0){super(t),this.scheduler=e,this.delay=n}static dispatch(t){const{notification:e,destination:n}=t;e.observe(n),this.unsubscribe()}scheduleMessage(t){this.destination.add(this.scheduler.schedule(op.dispatch,this.delay,new ap(t,this.destination)))}_next(t){this.scheduleMessage(sp.createNext(t))}_error(t){this.scheduleMessage(sp.createError(t)),this.unsubscribe()}_complete(){this.scheduleMessage(sp.createComplete()),this.unsubscribe()}}class ap{constructor(t,e){this.notification=t,this.destination=e}}class lp extends P{constructor(t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n){super(),this.scheduler=n,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=t<1?1:t,this._windowTime=e<1?1:e,e===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(t){if(!this.isStopped){const e=this._events;e.push(t),e.length>this._bufferSize&&e.shift()}super.next(t)}nextTimeWindow(t){this.isStopped||(this._events.push(new cp(this._getNow(),t)),this._trimBufferThenGetEvents()),super.next(t)}_subscribe(t){const e=this._infiniteTimeWindow,n=e?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,r=n.length;let s;if(this.closed)throw new T;if(this.isStopped||this.hasError?s=g.EMPTY:(this.observers.push(t),s=new k(this,t)),i&&t.add(t=new op(t,i)),e)for(let o=0;oe&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i}}class cp{constructor(t,e){this.time=t,this.value=e}}function up(t,e,n){let i;return i=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},t=>t.lift(function({bufferSize:t=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:n,scheduler:i}){let r,s,o=0,a=!1,l=!1;return function(c){let u;o++,!r||a?(a=!1,r=new lp(t,e,i),u=r.subscribe(this),s=c.subscribe({next(t){r.next(t)},error(t){a=!0,r.error(t)},complete(){l=!0,s=void 0,r.complete()}}),l&&(s=void 0)):u=r.subscribe(this),this.add(()=>{o--,u.unsubscribe(),u=void 0,s&&!l&&n&&0===o&&(s.unsubscribe(),s=void 0,r=void 0)})}}(i))}let hp;try{hp="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(m){hp=!1}let dp,pp=(()=>{class t{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Lh(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!hp)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return t.\u0275fac=function(e){return new(e||t)(Ci(ou))},t.\u0275prov=xt({factory:function(){return new t(Ci(ou))},token:t,providedIn:"root"}),t})(),fp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const gp=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function mp(){if(dp)return dp;if("object"!=typeof document||!document)return dp=new Set(gp),dp;let t=document.createElement("input");return dp=new Set(gp.filter(e=>(t.setAttribute("type",e),t.type===e))),dp}let bp,yp,vp;function _p(t){return function(){if(null==bp&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>bp=!0}))}finally{bp=bp||!1}return bp}()?t:!!t.capture}function wp(){if(null==yp){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return yp=!1,yp;if("scrollBehavior"in document.documentElement.style)yp=!0;else{const t=Element.prototype.scrollTo;yp=!!t&&!/\{\s*\[native code\]\s*\}/.test(t.toString())}}return yp}function xp(t){if(function(){if(null==vp){const t="undefined"!=typeof document?document.head:null;vp=!(!t||!t.createShadowRoot&&!t.attachShadow)}return vp}()){const e=t.getRootNode?t.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}function Sp(){let t="undefined"!=typeof document&&document?document.activeElement:null;for(;t&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}function Ep(t){return t.composedPath?t.composedPath()[0]:t.target}const Cp=new oi("cdk-dir-doc",{providedIn:"root",factory:function(){return Oi(Yu)}});let Op=(()=>{class t{constructor(t){if(this.value="ltr",this.change=new Rc,t){const e=t.documentElement?t.documentElement.dir:null,n=(t.body?t.body.dir:null)||e;this.value="ltr"===n||"rtl"===n?n:"ltr"}}ngOnDestroy(){this.change.complete()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Cp,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(Cp,8))},token:t,providedIn:"root"}),t})(),Tp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class kp{constructor(t=!1,e,n=!0){this._multiple=t,this._emitChanges=n,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new P,e&&e.length&&(t?e.forEach(t=>this._markSelected(t)):this._markSelected(e[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...t){this._verifyValueAssignment(t),t.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...t){this._verifyValueAssignment(t),t.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(t){this.isSelected(t)?this.deselect(t):this.select(t)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(t){return this._selection.has(t)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){this.isSelected(t)||(this._multiple||this._unmarkAll(),this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){}}let Ap=(()=>{class t{constructor(){this._listeners=[]}notify(t,e){for(let n of this._listeners)n(t,e)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(e=>t!==e)}}ngOnDestroy(){this._listeners=[]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),Pp=(()=>{class t{constructor(t,e,n){this._ngZone=t,this._platform=e,this._scrolled=new P,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=n}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const e=this.scrollContainers.get(t);e&&(e.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new C(e=>{this._globalSubscription||this._addGlobalListener();const n=t>0?this._scrolled.pipe(Ud(t)).subscribe(e):this._scrolled.subscribe(e);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):wd()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,e)=>this.deregister(e)),this._scrolled.complete()}ancestorScrolled(t,e){const n=this.getAncestorScrollContainers(t);return this.scrolled(e).pipe(Hd(t=>!t||n.indexOf(t)>-1))}getAncestorScrollContainers(t){const e=[];return this.scrollContainers.forEach((n,i)=>{this._scrollableContainsElement(i,t)&&e.push(i)}),e}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,e){let n=_d(e),i=t.getElementRef().nativeElement;do{if(n==i)return!0}while(n=n.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>xd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(pp),Ci(Yu,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(xu),Ci(pp),Ci(Yu,8))},token:t,providedIn:"root"}),t})(),Ip=(()=>{class t{constructor(t,e,n){this._platform=t,this._change=new P,this._changeListener=t=>{this._change.next(t)},this._document=n,e.runOutsideAngular(()=>{if(t.isBrowser){const t=this._getWindow();t.addEventListener("resize",this._changeListener),t.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){const t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:e,height:n}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+n,right:t.left+e,height:n,width:e}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,e=this._getWindow(),n=t.documentElement,i=n.getBoundingClientRect();return{top:-i.top||t.body.scrollTop||e.scrollY||n.scrollTop||0,left:-i.left||t.body.scrollLeft||e.scrollX||n.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(Ud(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu),Ci(Yu,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu),Ci(Yu,8))},token:t,providedIn:"root"}),t})(),Mp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),Dp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Tp,fp,Mp],Tp,Mp]}),t})();class Rp{attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;null!=t&&(this._attachedHost=null,t.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class Np extends Rp{constructor(t,e,n,i){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.componentFactoryResolver=i}}class Lp extends Rp{constructor(t,e,n){super(),this.templateRef=t,this.viewContainerRef=e,this.context=n}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}}class jp extends Rp{constructor(t){super(),this.element=t instanceof kl?t.nativeElement:t}}class Fp{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){return t instanceof Np?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof Lp?(this._attachedPortal=t,this.attachTemplatePortal(t)):this.attachDomPortal&&t instanceof jp?(this._attachedPortal=t,this.attachDomPortal(t)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class Bp extends Fp{constructor(t,e,n,i,r){super(),this.outletElement=t,this._componentFactoryResolver=e,this._appRef=n,this._defaultInjector=i,this.attachDomPortal=t=>{const e=t.element,n=this._document.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=r}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let n;return t.viewContainerRef?(n=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector),this.setDisposeFn(()=>n.destroy())):(n=e.create(t.injector||this._defaultInjector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(n)),this._attachedPortal=t,n}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context);return n.rootNodes.forEach(t=>this.outletElement.appendChild(t)),n.detectChanges(),this.setDisposeFn(()=>{let t=e.indexOf(n);-1!==t&&e.remove(t)}),this._attachedPortal=t,n}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let Vp=(()=>{class t extends Lp{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(ea(sc),ea(hc))},t.\u0275dir=se({type:t,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[jo]}),t})(),zp=(()=>{class t extends Vp{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","cdk-portal",""],["","portal",""]],exportAs:["cdkPortal"],features:[_l([{provide:Vp,useExisting:t}]),jo]}),t})(),Up=(()=>{class t extends Fp{constructor(t,e,n){super(),this._componentFactoryResolver=t,this._viewContainerRef=e,this._isInitialized=!1,this.attached=new Rc,this.attachDomPortal=t=>{const e=t.element,n=this._document.createComment("dom-portal");t.setAttachedHost(this),e.parentNode.insertBefore(n,e),this._getRootNode().appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=n}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedPortal=null,this._attachedRef=null}attachComponentPortal(t){t.setAttachedHost(this);const e=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,n=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),i=e.createComponent(n,e.length,t.injector||e.injector);return e!==this._viewContainerRef&&this._getRootNode().appendChild(i.hostView.rootNodes[0]),super.setDisposeFn(()=>i.destroy()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}attachTemplatePortal(t){t.setAttachedHost(this);const e=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=e,this.attached.emit(e),e}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return t.\u0275fac=function(e){return new(e||t)(ea(El),ea(hc),ea(Yu))},t.\u0275dir=se({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[jo]}),t})(),Hp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const $p=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})();function Gp(t){return e=>0===t?np():e.lift(new Wp(t))}class Wp{constructor(t){if(this.total=t,this.total<0)throw new $p}call(t,e){return e.subscribe(new qp(t,this.total))}}class qp extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}function Xp(t,e=!1){return n=>n.lift(new Yp(t,e))}class Yp{constructor(t,e){this.predicate=t,this.inclusive=e}call(t,e){return e.subscribe(new Kp(t,this.predicate,this.inclusive))}}class Kp extends v{constructor(t,e,n){super(t),this.predicate=e,this.inclusive=n,this.index=0}_next(t){const e=this.destination;let n;try{n=this.predicate(t,this.index++)}catch(i){return void e.error(i)}this.nextOrComplete(t,n)}nextOrComplete(t,e){const n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())}}function Qp(t,...e){return e.length?e.some(e=>t[e]):t.altKey||t.shiftKey||t.ctrlKey||t.metaKey}const Zp=wp();class Jp{constructor(t,e){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=e}attach(){}enable(){if(this._canBeEnabled()){const t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=vd(-this._previousScrollPosition.left),t.style.top=vd(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const t=this._document.documentElement,e=t.style,n=this._document.body.style,i=e.scrollBehavior||"",r=n.scrollBehavior||"";this._isEnabled=!1,e.left=this._previousHTMLStyles.left,e.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Zp&&(e.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Zp&&(e.scrollBehavior=i,n.scrollBehavior=r)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,e=this._viewportRuler.getViewportSize();return t.scrollHeight>e.height||t.scrollWidth>e.width}}class tf{constructor(t,e,n,i){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=n,this._config=i,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(t){this._overlayRef=t}enable(){if(this._scrollSubscription)return;const t=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class ef{enable(){}disable(){}attach(){}}function nf(t,e){return e.some(e=>t.bottome.bottom||t.righte.right)}function rf(t,e){return e.some(e=>t.tope.bottom||t.lefte.right)}class sf{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this._config=i,this._scrollSubscription=null}attach(t){this._overlayRef=t}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:e,height:n}=this._viewportRuler.getViewportSize();nf(t,[{width:e,height:n,bottom:n,right:e,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let of=(()=>{class t{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this.noop=()=>new ef,this.close=t=>new tf(this._scrollDispatcher,this._ngZone,this._viewportRuler,t),this.block=()=>new Jp(this._viewportRuler,this._document),this.reposition=t=>new sf(this._scrollDispatcher,this._viewportRuler,this._ngZone,t),this._document=i}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pp),Ci(Ip),Ci(xu),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Pp),Ci(Ip),Ci(xu),Ci(Yu))},token:t,providedIn:"root"}),t})();class af{constructor(t){if(this.scrollStrategy=new ef,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){const e=Object.keys(t);for(const n of e)void 0!==t[n]&&(this[n]=t[n])}}}class lf{constructor(t,e,n,i,r){this.offsetX=n,this.offsetY=i,this.panelClass=r,this.originX=t.originX,this.originY=t.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY}}class cf{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}}let uf=(()=>{class t{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),0===this._attachedOverlays.length&&this.detach()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})(),hf=(()=>{class t extends uf{constructor(t){super(t),this._keydownListener=t=>{const e=this._attachedOverlays;for(let n=e.length-1;n>-1;n--)if(e[n]._keydownEvents.observers.length>0){e[n]._keydownEvents.next(t);break}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})(),df=(()=>{class t extends uf{constructor(t,e){super(t),this._platform=e,this._cursorStyleIsSet=!1,this._clickListener=t=>{const e=Ep(t),n=this._attachedOverlays.slice();for(let i=n.length-1;i>-1;i--){const r=n[i];if(!(r._outsidePointerEvents.observers.length<1)&&r.hasAttached()){if(r.overlayElement.contains(e))break;r._outsidePointerEvents.next(t)}}}}add(t){if(super.add(t),!this._isAttached){const t=this._document.body;t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=t.style.cursor,t.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu),Ci(pp))},token:t,providedIn:"root"}),t})();const pf="undefined"!=typeof window?window:{},ff=void 0!==pf.__karma__&&!!pf.__karma__||void 0!==pf.jasmine&&!!pf.jasmine||void 0!==pf.jest&&!!pf.jest||void 0!==pf.Mocha&&!!pf.Mocha;let gf=(()=>{class t{constructor(t,e){this._platform=e,this._document=t}ngOnDestroy(){const t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||ff){const e=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let t=0;tthis._backdropClick.next(t),this._keydownEvents=new P,this._outsidePointerEvents=new P,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(t){let e=this._portalOutlet.attach(t);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(Gp(1)).subscribe(()=>{this.hasAttached()&&this.updatePosition()}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){const t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,t&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=Object.assign(Object.assign({},this._config),t),this._updateElementSize()}setDirection(t){this._config=Object.assign(Object.assign({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){const t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const t=this._pane.style;t.width=vd(this._config.width),t.height=vd(this._config.height),t.minWidth=vd(this._config.minWidth),t.minHeight=vd(this._config.minHeight),t.maxWidth=vd(this._config.maxWidth),t.maxHeight=vd(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){const t="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(t)})}):this._backdropElement.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let t=this._backdropElement;if(!t)return;let e,n=()=>{t&&(t.removeEventListener("click",this._backdropClickHandler),t.removeEventListener("transitionend",n),t.parentNode&&t.parentNode.removeChild(t)),this._backdropElement==t&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(t,this._config.backdropClass,!1),clearTimeout(e)};t.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{t.addEventListener("transitionend",n)}),t.style.pointerEvents="none",e=this._ngZone.runOutsideAngular(()=>setTimeout(n,500))}_toggleClasses(t,e,n){const i=t.classList;yd(e).forEach(t=>{t&&(n?i.add(t):i.remove(t))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const t=this._ngZone.onStable.pipe(Wd(Q(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._previousHostParent.removeChild(this._host)),t.unsubscribe())})})}_disposeScrollStrategy(){const t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())}}const bf="cdk-overlay-connected-position-bounding-box",yf=/([A-Za-z%]+)$/;class vf{constructor(t,e,n,i,r){this._viewportRuler=e,this._document=n,this._platform=i,this._overlayContainer=r,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new P,this._resizeSubscription=g.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}get positions(){return this._preferredPositions}attach(t){this._validatePositions(),t.hostElement.classList.add(bf),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();const t=this._originRect,e=this._overlayRect,n=this._viewportRect,i=[];let r;for(let s of this._preferredPositions){let o=this._getOriginPoint(t,s),a=this._getOverlayPoint(o,e,s),l=this._getOverlayFit(a,e,n,s);if(l.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(s,o);this._canFitWithFlexibleDimensions(l,a,n)?i.push({position:s,origin:o,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(o,s)}):(!r||r.overlayFit.visibleAreae&&(e=i,t=n)}return this._isPushed=!1,void this._applyPosition(t.position,t.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(r.position,r.originPoint);this._applyPosition(r.position,r.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&_f(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(bf),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();const t=this._lastPosition||this._preferredPositions[0],e=this._getOriginPoint(this._originRect,t);this._applyPosition(t,e)}}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e){let n,i;if("center"==e.originX)n=t.left+t.width/2;else{const i=this._isRtl()?t.right:t.left,r=this._isRtl()?t.left:t.right;n="start"==e.originX?i:r}return i="center"==e.originY?t.top+t.height/2:"top"==e.originY?t.top:t.bottom,{x:n,y:i}}_getOverlayPoint(t,e,n){let i,r;return i="center"==n.overlayX?-e.width/2:"start"===n.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,r="center"==n.overlayY?-e.height/2:"top"==n.overlayY?0:-e.height,{x:t.x+i,y:t.y+r}}_getOverlayFit(t,e,n,i){const r=xf(e);let{x:s,y:o}=t,a=this._getOffset(i,"x"),l=this._getOffset(i,"y");a&&(s+=a),l&&(o+=l);let c=0-o,u=o+r.height-n.height,h=this._subtractOverflows(r.width,0-s,s+r.width-n.width),d=this._subtractOverflows(r.height,c,u),p=h*d;return{visibleArea:p,isCompletelyWithinViewport:r.width*r.height===p,fitsInViewportVertically:d===r.height,fitsInViewportHorizontally:h==r.width}}_canFitWithFlexibleDimensions(t,e,n){if(this._hasFlexibleDimensions){const i=n.bottom-e.y,r=n.right-e.x,s=wf(this._overlayRef.getConfig().minHeight),o=wf(this._overlayRef.getConfig().minWidth),a=t.fitsInViewportHorizontally||null!=o&&o<=r;return(t.fitsInViewportVertically||null!=s&&s<=i)&&a}return!1}_pushOverlayOnScreen(t,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};const i=xf(e),r=this._viewportRect,s=Math.max(t.x+i.width-r.width,0),o=Math.max(t.y+i.height-r.height,0),a=Math.max(r.top-n.top-t.y,0),l=Math.max(r.left-n.left-t.x,0);let c=0,u=0;return c=i.width<=r.width?l||-s:t.xi&&!this._isInitialRender&&!this._growAfterOpen&&(s=t.y-i/2)}if("end"===e.overlayX&&!i||"start"===e.overlayX&&i)c=n.width-t.x+this._viewportMargin,a=t.x-this._viewportMargin;else if("start"===e.overlayX&&!i||"end"===e.overlayX&&i)l=t.x,a=n.right-t.x;else{const e=Math.min(n.right-t.x+n.left,t.x),i=this._lastBoundingBoxSize.width;a=2*e,l=t.x-e,a>i&&!this._isInitialRender&&!this._growAfterOpen&&(l=t.x-i/2)}return{top:s,left:l,bottom:o,right:c,width:a,height:r}}_setBoundingBoxStyles(t,e){const n=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));const i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{const t=this._overlayRef.getConfig().maxHeight,r=this._overlayRef.getConfig().maxWidth;i.height=vd(n.height),i.top=vd(n.top),i.bottom=vd(n.bottom),i.width=vd(n.width),i.left=vd(n.left),i.right=vd(n.right),i.alignItems="center"===e.overlayX?"center":"end"===e.overlayX?"flex-end":"flex-start",i.justifyContent="center"===e.overlayY?"center":"bottom"===e.overlayY?"flex-end":"flex-start",t&&(i.maxHeight=vd(t)),r&&(i.maxWidth=vd(r))}this._lastBoundingBoxSize=n,_f(this._boundingBox.style,i)}_resetBoundingBoxStyles(){_f(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){_f(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){const n={},i=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(i){const i=this._viewportRuler.getViewportScrollPosition();_f(n,this._getExactOverlayY(e,t,i)),_f(n,this._getExactOverlayX(e,t,i))}else n.position="static";let o="",a=this._getOffset(e,"x"),l=this._getOffset(e,"y");a&&(o+=`translateX(${a}px) `),l&&(o+=`translateY(${l}px)`),n.transform=o.trim(),s.maxHeight&&(i?n.maxHeight=vd(s.maxHeight):r&&(n.maxHeight="")),s.maxWidth&&(i?n.maxWidth=vd(s.maxWidth):r&&(n.maxWidth="")),_f(this._pane.style,n)}_getExactOverlayY(t,e,n){let i={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n));let s=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return r.y-=s,"bottom"===t.overlayY?i.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":i.top=vd(r.y),i}_getExactOverlayX(t,e,n){let i,r={left:"",right:""},s=this._getOverlayPoint(e,this._overlayRect,t);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,n)),i=this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left","right"===i?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=vd(s.x),r}_getScrollVisibility(){const t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(t=>t.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:rf(t,n),isOriginOutsideView:nf(t,n),isOverlayClipped:rf(e,n),isOverlayOutsideView:nf(e,n)}}_subtractOverflows(t,...e){return e.reduce((t,e)=>t-Math.max(e,0),t)}_getNarrowedViewportRect(){const t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+t-this._viewportMargin,bottom:n.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return"x"===e?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&yd(t).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){const t=this._origin;if(t instanceof kl)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();const e=t.width||0,n=t.height||0;return{top:t.y,bottom:t.y+n,left:t.x,right:t.x+e,height:n,width:e}}}function _f(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function wf(t){if("number"!=typeof t&&null!=t){const[e,n]=t.split(yf);return n&&"px"!==n?null:parseFloat(e)}return t||null}function xf(t){return{top:Math.floor(t.top),right:Math.floor(t.right),bottom:Math.floor(t.bottom),left:Math.floor(t.left),width:Math.floor(t.width),height:Math.floor(t.height)}}class Sf{constructor(t,e,n,i,r,s,o){this._preferredPositions=[],this._positionStrategy=new vf(n,i,r,s,o).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(t,e),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(t){this._overlayRef=t,this._positionStrategy.attach(t),this._direction&&(t.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(t){this._positionStrategy.withScrollableContainers(t)}withFallbackPosition(t,e,n,i){const r=new lf(t,e,n,i);return this._preferredPositions.push(r),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(t){return this._overlayRef?this._overlayRef.setDirection(t):this._direction=t,this}withOffsetX(t){return this._positionStrategy.withDefaultOffsetX(t),this}withOffsetY(t){return this._positionStrategy.withDefaultOffsetY(t),this}withLockedPosition(t){return this._positionStrategy.withLockedPosition(t),this}withPositions(t){return this._preferredPositions=t.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(t){return this._positionStrategy.setOrigin(t),this}}const Ef="cdk-global-overlay-wrapper";class Cf{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(t){const e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(Ef),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._rightOffset="",this._leftOffset=t,this._justifyContent="flex-start",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._leftOffset="",this._rightOffset=t,this._justifyContent="flex-end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._justifyContent="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:i,height:r,maxWidth:s,maxHeight:o}=n,a=!("100%"!==i&&"100vw"!==i||s&&"100%"!==s&&"100vw"!==s),l=!("100%"!==r&&"100vh"!==r||o&&"100%"!==o&&"100vh"!==o);t.position=this._cssPosition,t.marginLeft=a?"0":this._leftOffset,t.marginTop=l?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=this._rightOffset,a?e.justifyContent="flex-start":"center"===this._justifyContent?e.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?e.justifyContent="flex-end":"flex-end"===this._justifyContent&&(e.justifyContent="flex-start"):e.justifyContent=this._justifyContent,e.alignItems=l?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(Ef),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}}let Of=(()=>{class t{constructor(t,e,n,i){this._viewportRuler=t,this._document=e,this._platform=n,this._overlayContainer=i}global(){return new Cf}connectedTo(t,e,n){return new Sf(e,n,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new vf(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ip),Ci(Yu),Ci(pp),Ci(gf))},t.\u0275prov=xt({factory:function(){return new t(Ci(Ip),Ci(Yu),Ci(pp),Ci(gf))},token:t,providedIn:"root"}),t})(),Tf=0,kf=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u){this.scrollStrategies=t,this._overlayContainer=e,this._componentFactoryResolver=n,this._positionBuilder=i,this._keyboardDispatcher=r,this._injector=s,this._ngZone=o,this._document=a,this._directionality=l,this._location=c,this._outsideClickDispatcher=u}create(t){const e=this._createHostElement(),n=this._createPaneElement(e),i=this._createPortalOutlet(n),r=new af(t);return r.direction=r.direction||this._directionality.value,new mf(i,e,n,r,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const e=this._document.createElement("div");return e.id="cdk-overlay-"+Tf++,e.classList.add("cdk-overlay-pane"),t.appendChild(e),e}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Uu)),new Bp(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return t.\u0275fac=function(e){return new(e||t)(Ci(of),Ci(gf),Ci(El),Ci(Of),Ci(hf),Ci(No),Ci(xu),Ci(Yu),Ci(Op),Ci(lh),Ci(df))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Af=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],Pf=new oi("cdk-connected-overlay-scroll-strategy");let If=(()=>{class t{constructor(t){this.elementRef=t}}return t.\u0275fac=function(e){return new(e||t)(ea(kl))},t.\u0275dir=se({type:t,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),t})(),Mf=(()=>{class t{constructor(t,e,n,i,r){this._overlay=t,this._dir=r,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=g.EMPTY,this._attachSubscription=g.EMPTY,this._detachSubscription=g.EMPTY,this._positionSubscription=g.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Rc,this.positionChange=new Rc,this.attach=new Rc,this.detach=new Rc,this.overlayKeydown=new Rc,this.overlayOutsideClick=new Rc,this._templatePortal=new Lp(e,n),this._scrollStrategyFactory=i,this.scrollStrategy=this._scrollStrategyFactory()}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}get hasBackdrop(){return this._hasBackdrop}set hasBackdrop(t){this._hasBackdrop=md(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=md(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=md(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=md(t)}get push(){return this._push}set push(t){this._push=md(t)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Af);const t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(t=>{this.overlayKeydown.next(t),27===t.keyCode&&!this.disableClose&&!Qp(t)&&(t.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(t=>{this.overlayOutsideClick.next(t)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),e=new af({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(e.width=this.width),(this.height||0===this.height)&&(e.height=this.height),(this.minWidth||0===this.minWidth)&&(e.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(e.minHeight=this.minHeight),this.backdropClass&&(e.backdropClass=this.backdropClass),this.panelClass&&(e.panelClass=this.panelClass),e}_updatePositionStrategy(t){const e=this.positions.map(t=>({originX:t.originX,originY:t.originY,overlayX:t.overlayX,overlayY:t.overlayY,offsetX:t.offsetX||this.offsetX,offsetY:t.offsetY||this.offsetY,panelClass:t.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(e).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const t=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(t),t}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(Xp(()=>this.positionChange.observers.length>0)).subscribe(t=>{this.positionChange.emit(t),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()}))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(sc),ea(hc),ea(Pf),ea(Op,8))},t.\u0275dir=se({type:t,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[ye]}),t})();const Df={provide:Pf,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};let Rf=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[kf,Df],imports:[[Tp,Hp,Dp],Dp]}),t})(),Nf=(()=>{class t extends gf{constructor(){super(...arguments),this.attached=!1}setRootElement(t){this.attached&&(this.rootElement.nativeElement.removeChild(this._containerElement),this.attached=!1),this.rootElement=t,this.rootElement.nativeElement.style.display="block",this.rootElement.nativeElement.style.position="contents",this.rootElement.nativeElement.style.height="100%",this.appendToRoot()}_createContainer(){super._createContainer(),this.appendToRoot()}appendToRoot(){!this._containerElement||!this.rootElement||(this.rootElement.nativeElement.appendChild(this._containerElement),this.attached=!0)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const Lf={schedule(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)},scheduleBeforeRender(t){if("undefined"==typeof window)return Lf.schedule(t,0);if(void 0===window.requestAnimationFrame)return Lf.schedule(t,16);const e=window.requestAnimationFrame(t);return()=>window.cancelAnimationFrame(e)}};let jf;function Ff(t,e,n){let i=n;return function(t){return!!t&&t.nodeType===Node.ELEMENT_NODE}(t)&&e.some((e,n)=>!("*"===e||!function(t,e){if(!jf){const t=Element.prototype;jf=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE&&jf.call(t,e)}(t,e)||(i=n,0))),i}class Bf{constructor(t,e){this.componentFactory=e.get(El).resolveComponentFactory(t)}create(t){return new Vf(this.componentFactory,t)}}class Vf{constructor(t,e){this.componentFactory=t,this.injector=e,this.eventEmitters=new lp(1),this.events=this.eventEmitters.pipe(Qd(t=>Q(...t))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:t})=>t)),this.ngZone=this.injector.get(xu),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(t){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(t)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=Lf.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(t){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(t):this.componentRef.instance[t])}setInputValue(t,e){this.runInZone(()=>{null!==this.componentRef?function(t,e){return t===e||t!=t&&e!=e}(e,this.getInputValue(t))&&(void 0!==e||!this.unchangedInputs.has(t))||(this.recordInputChange(t,e),this.unchangedInputs.delete(t),this.hasInputChanges=!0,this.componentRef.instance[t]=e,this.scheduleDetectChanges()):this.initialInputValues.set(t,e)})}initializeComponent(t){const e=No.create({providers:[],parent:this.injector}),n=function(t,e){const n=t.childNodes,i=e.map(()=>[]);let r=-1;e.some((t,e)=>"*"===t&&(r=e,!0));for(let s=0,o=n.length;s{this.initialInputValues.has(t)&&this.setInputValue(t,this.initialInputValues.get(t))}),this.initialInputValues.clear()}initializeOutputs(t){const e=this.componentFactory.outputs.map(({propName:e,templateName:n})=>t.instance[e].pipe(D(t=>({name:n,value:t}))));this.eventEmitters.next(e)}callNgOnChanges(t){if(!this.implementsOnChanges||null===this.inputChanges)return;const e=this.inputChanges;this.inputChanges=null,t.instance.ngOnChanges(e)}markViewForCheck(t){this.hasInputChanges&&(this.hasInputChanges=!1,t.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=Lf.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(t,e){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const n=this.inputChanges[t];if(n)return void(n.currentValue=e);const i=this.unchangedInputs.has(t),r=i?void 0:this.getInputValue(t);this.inputChanges[t]=new be(r,e,i)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(t){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(t):t()}}class zf extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}class Uf extends P{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new T;return this._value}next(t){super.next(this._value=t)}}function Hf(){}function $f(t,e,n){return function(i){return i.lift(new Gf(t,e,n))}}class Gf{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new Wf(t,this.nextOrObserver,this.error,this.complete))}}class Wf extends v{constructor(t,e,n,i){super(t),this._tapNext=Hf,this._tapError=Hf,this._tapComplete=Hf,this._tapError=n||Hf,this._tapComplete=i||Hf,a(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||Hf,this._tapError=e.error||Hf,this._tapComplete=e.complete||Hf)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}function qf(t,e=jd){return n=>n.lift(new Xf(t,e))}class Xf{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new Yf(t,this.dueTime,this.scheduler))}}class Yf extends v{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Kf,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Kf(t){t.debouncedNext()}function Qf(t){return e=>e.lift(new Zf(t))}class Zf{constructor(t){this.total=t}call(t,e){return e.subscribe(new Jf(t,this.total))}}class Jf extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){++this.count>this.total&&this.destination.next(t)}}let tg=(()=>{class t{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),eg=(()=>{class t{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,e)=>this._cleanupObserver(e))}observe(t){const e=_d(t);return new C(t=>{const n=this._observeElement(e).subscribe(t);return()=>{n.unsubscribe(),this._unobserveElement(e)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const e=new P,n=this._mutationObserverFactory.create(t=>e.next(t));n&&n.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:n,stream:e,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:e,stream:n}=this._observedElements.get(t);e&&e.disconnect(),n.complete(),this._observedElements.delete(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(tg))},t.\u0275prov=xt({factory:function(){return new t(Ci(tg))},token:t,providedIn:"root"}),t})(),ng=(()=>{class t{constructor(t,e,n){this._contentObserver=t,this._elementRef=e,this._ngZone=n,this.event=new Rc,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=bd(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe(qf(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(eg),ea(kl),ea(xu))},t.\u0275dir=se({type:t,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),t})(),ig=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[tg]}),t})();function rg(t,e){return(t.getAttribute(e)||"").match(/\S+/g)||[]}const sg="cdk-describedby-message-container",og="cdk-describedby-message",ag="cdk-describedby-host";let lg=0;const cg=new Map;let ug=null,hg=(()=>{class t{constructor(t){this._document=t}describe(t,e,n){if(!this._canBeDescribed(t,e))return;const i=dg(e,n);"string"!=typeof e?(pg(e),cg.set(i,{messageElement:e,referenceCount:0})):cg.has(i)||this._createMessageElement(e,n),this._isElementDescribedByMessage(t,i)||this._addMessageReference(t,i)}removeDescription(t,e,n){if(!e||!this._isElementNode(t))return;const i=dg(e,n);if(this._isElementDescribedByMessage(t,i)&&this._removeMessageReference(t,i),"string"==typeof e){const t=cg.get(i);t&&0===t.referenceCount&&this._deleteMessageElement(i)}ug&&0===ug.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${ag}]`);for(let e=0;e0!=t.indexOf(og));t.setAttribute("aria-describedby",e.join(" "))}_addMessageReference(t,e){const n=cg.get(e);(function(t,e,n){const i=rg(t,e);i.some(t=>t.trim()==n.trim())||(i.push(n.trim()),t.setAttribute(e,i.join(" ")))})(t,"aria-describedby",n.messageElement.id),t.setAttribute(ag,""),n.referenceCount++}_removeMessageReference(t,e){const n=cg.get(e);n.referenceCount--,function(t,e,n){const i=rg(t,e).filter(t=>t!=n.trim());i.length?t.setAttribute(e,i.join(" ")):t.removeAttribute(e)}(t,"aria-describedby",n.messageElement.id),t.removeAttribute(ag)}_isElementDescribedByMessage(t,e){const n=rg(t,"aria-describedby"),i=cg.get(e),r=i&&i.messageElement.id;return!!r&&-1!=n.indexOf(r)}_canBeDescribed(t,e){if(!this._isElementNode(t))return!1;if(e&&"object"==typeof e)return!0;const n=null==e?"":`${e}`.trim(),i=t.getAttribute("aria-label");return!(!n||i&&i.trim()===n)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})();function dg(t,e){return"string"==typeof t?`${e||""}/${t}`:t}function pg(t){t.id||(t.id=`${og}-${lg++}`)}class fg extends class{constructor(t){this._items=t,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new P,this._typeaheadSubscription=g.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new P,this.change=new P,t instanceof Lc&&t.changes.subscribe(t=>{if(this._activeItem){const e=t.toArray().indexOf(this._activeItem);e>-1&&e!==this._activeItemIndex&&(this._activeItemIndex=e)}})}skipPredicate(t){return this._skipPredicateFn=t,this}withWrap(t=!0){return this._wrap=t,this}withVerticalOrientation(t=!0){return this._vertical=t,this}withHorizontalOrientation(t){return this._horizontal=t,this}withAllowedModifierKeys(t){return this._allowedModifierKeys=t,this}withTypeAhead(t=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe($f(t=>this._pressedLetters.push(t)),qf(t),Hd(()=>this._pressedLetters.length>0),D(()=>this._pressedLetters.join(""))).subscribe(t=>{const e=this._getItemsArray();for(let n=1;n!t[e]||this._allowedModifierKeys.indexOf(e)>-1);switch(e){case 9:return void this.tabOut.next();case 40:if(this._vertical&&n){this.setNextItemActive();break}return;case 38:if(this._vertical&&n){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&n){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&n){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&n){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&n){this.setLastItemActive();break}return;default:return void((n||Qp(t,"shiftKey"))&&(t.key&&1===t.key.length?this._letterKeyStream.next(t.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))))}this._pressedLetters=[],t.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem}isTyping(){return this._pressedLetters.length>0}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._items.length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(t){const e=this._getItemsArray(),n="number"==typeof t?t:e.indexOf(t),i=e[n];this._activeItem=null==i?null:i,this._activeItemIndex=n}_setActiveItemByDelta(t){this._wrap?this._setActiveInWrapMode(t):this._setActiveInDefaultMode(t)}_setActiveInWrapMode(t){const e=this._getItemsArray();for(let n=1;n<=e.length;n++){const i=(this._activeItemIndex+t*n+e.length)%e.length;if(!this._skipPredicateFn(e[i]))return void this.setActiveItem(i)}}_setActiveInDefaultMode(t){this._setActiveItemByIndex(this._activeItemIndex+t,t)}_setActiveItemByIndex(t,e){const n=this._getItemsArray();if(n[t]){for(;this._skipPredicateFn(n[t]);)if(!n[t+=e])return;this.setActiveItem(t)}}_getItemsArray(){return this._items instanceof Lc?this._items.toArray():this._items}}{setActiveItem(t){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(t),this.activeItem&&this.activeItem.setActiveStyles()}}let gg=(()=>{class t{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(t){return!!(t.offsetWidth||t.offsetHeight||"function"==typeof t.getClientRects&&t.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const e=function(t){try{return t.frameElement}catch(e){return null}}(function(t){return t.ownerDocument&&t.ownerDocument.defaultView||window}(t));if(e&&(-1===bg(e)||!this.isVisible(e)))return!1;let n=t.nodeName.toLowerCase(),i=bg(t);return t.hasAttribute("contenteditable")?-1!==i:!("iframe"===n||"object"===n||this._platform.WEBKIT&&this._platform.IOS&&!function(t){let e=t.nodeName.toLowerCase(),n="input"===e&&t.type;return"text"===n||"password"===n||"select"===e||"textarea"===e}(t))&&("audio"===n?!!t.hasAttribute("controls")&&-1!==i:"video"===n?-1!==i&&(null!==i||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,e){return function(t){return!function(t){return function(t){return"input"==t.nodeName.toLowerCase()}(t)&&"hidden"==t.type}(t)&&(function(t){let e=t.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(t)||function(t){return function(t){return"a"==t.nodeName.toLowerCase()}(t)&&t.hasAttribute("href")}(t)||t.hasAttribute("contenteditable")||mg(t))}(t)&&!this.isDisabled(t)&&((null==e?void 0:e.ignoreVisibility)||this.isVisible(t))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp))},token:t,providedIn:"root"}),t})();function mg(t){if(!t.hasAttribute("tabindex")||void 0===t.tabIndex)return!1;let e=t.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function bg(t){if(!mg(t))return null;const e=parseInt(t.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class yg{constructor(t,e,n,i,r=!1){this._element=t,this._checker=e,this._ngZone=n,this._document=i,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,r||this.attachAnchors()}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}destroy(){const t=this._startAnchor,e=this._endAnchor;t&&(t.removeEventListener("focus",this.startAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),e&&(e.removeEventListener("focus",this.endAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusInitialElement(t)))})}focusFirstTabbableElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusFirstTabbableElement(t)))})}focusLastTabbableElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusLastTabbableElement(t)))})}_getRegionBoundary(t){let e=this._element.querySelectorAll(`[cdk-focus-region-${t}], [cdkFocusRegion${t}], [cdk-focus-${t}]`);for(let n=0;n=0;n--){let t=e[n].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(e[n]):null;if(t)return t}return null}_createAnchor(){const t=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,t),t.classList.add("cdk-visually-hidden"),t.classList.add("cdk-focus-trap-anchor"),t.setAttribute("aria-hidden","true"),t}_toggleAnchorTabIndex(t,e){t?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}toggleAnchors(t){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}_executeOnStable(t){this._ngZone.isStable?t():this._ngZone.onStable.pipe(Gp(1)).subscribe(t)}}let vg=(()=>{class t{constructor(t,e,n){this._checker=t,this._ngZone=e,this._document=n}create(t,e=!1){return new yg(t,this._checker,this._ngZone,this._document,e)}}return t.\u0275fac=function(e){return new(e||t)(Ci(gg),Ci(xu),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(gg),Ci(xu),Ci(Yu))},token:t,providedIn:"root"}),t})();function _g(t){return 0===t.offsetX&&0===t.offsetY}function wg(t){const e=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const xg=new oi("cdk-input-modality-detector-options"),Sg={ignoreKeys:[18,17,224,91,16]},Eg=_p({passive:!0,capture:!0});let Cg=(()=>{class t{constructor(t,e,n,i){this._platform=t,this._mostRecentTarget=null,this._modality=new Uf(null),this._lastTouchMs=0,this._onKeydown=t=>{var e,n;(null===(n=null===(e=this._options)||void 0===e?void 0:e.ignoreKeys)||void 0===n?void 0:n.some(e=>e===t.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Ep(t))},this._onMousedown=t=>{Date.now()-this._lastTouchMs<650||(this._modality.next(_g(t)?"keyboard":"mouse"),this._mostRecentTarget=Ep(t))},this._onTouchstart=t=>{wg(t)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Ep(t))},this._options=Object.assign(Object.assign({},Sg),i),this.modalityDetected=this._modality.pipe(Qf(1)),this.modalityChanged=this.modalityDetected.pipe(Rd()),t.isBrowser&&e.runOutsideAngular(()=>{n.addEventListener("keydown",this._onKeydown,Eg),n.addEventListener("mousedown",this._onMousedown,Eg),n.addEventListener("touchstart",this._onTouchstart,Eg)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Eg),document.removeEventListener("mousedown",this._onMousedown,Eg),document.removeEventListener("touchstart",this._onTouchstart,Eg))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu),Ci(Yu),Ci(xg,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu),Ci(Yu),Ci(xg,8))},token:t,providedIn:"root"}),t})();const Og=new oi("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),Tg=new oi("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let kg=(()=>{class t{constructor(t,e,n,i){this._ngZone=e,this._defaultOptions=i,this._document=n,this._liveElement=t||this._createLiveElement()}announce(t,...e){const n=this._defaultOptions;let i,r;return 1===e.length&&"number"==typeof e[0]?r=e[0]:[i,r]=e,this.clear(),clearTimeout(this._previousTimeout),i||(i=n&&n.politeness?n.politeness:"polite"),null==r&&n&&(r=n.duration),this._liveElement.setAttribute("aria-live",i),this._ngZone.runOutsideAngular(()=>new Promise(e=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,e(),"number"==typeof r&&(this._previousTimeout=setTimeout(()=>this.clear(),r))},100)}))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement&&this._liveElement.parentNode&&(this._liveElement.parentNode.removeChild(this._liveElement),this._liveElement=null)}_createLiveElement(){const t="cdk-live-announcer-element",e=this._document.getElementsByClassName(t),n=this._document.createElement("div");for(let i=0;i{class t{constructor(t,e,n,i,r){this._ngZone=t,this._platform=e,this._inputModalityDetector=n,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new P,this._rootNodeFocusAndBlurListener=t=>{const e=Ep(t),n="focus"===t.type?this._onFocus:this._onBlur;for(let i=e;i;i=i.parentElement)n.call(this,t,i)},this._document=i,this._detectionMode=(null==r?void 0:r.detectionMode)||0}monitor(t,e=!1){const n=_d(t);if(!this._platform.isBrowser||1!==n.nodeType)return wd(null);const i=xp(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return e&&(r.checkChildren=!0),r.subject;const s={checkChildren:e,subject:new P,rootNode:i};return this._elementInfo.set(n,s),this._registerGlobalListeners(s),s.subject}stopMonitoring(t){const e=_d(t),n=this._elementInfo.get(e);n&&(n.subject.complete(),this._setClasses(e),this._elementInfo.delete(e),this._removeGlobalListeners(n))}focusVia(t,e,n){const i=_d(t);i===this._getDocument().activeElement?this._getClosestElementsInfo(i).forEach(([t,n])=>this._originChanged(t,e,n)):(this._setOrigin(e),"function"==typeof i.focus&&i.focus(n))}ngOnDestroy(){this._elementInfo.forEach((t,e)=>this.stopMonitoring(e))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,e,n){n?t.classList.add(e):t.classList.remove(e)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,e){this._toggleClass(t,"cdk-focused",!!e),this._toggleClass(t,"cdk-touch-focused","touch"===e),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===e),this._toggleClass(t,"cdk-mouse-focused","mouse"===e),this._toggleClass(t,"cdk-program-focused","program"===e)}_setOrigin(t,e=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&e,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,e){const n=this._elementInfo.get(e),i=Ep(t);!n||!n.checkChildren&&e!==i||this._originChanged(e,this._getFocusOrigin(i),n)}_onBlur(t,e){const n=this._elementInfo.get(e);!n||n.checkChildren&&t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||(this._setClasses(e),this._emitOrigin(n.subject,null))}_emitOrigin(t,e){this._ngZone.run(()=>t.next(e))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const e=t.rootNode,n=this._rootNodeFocusListenerCount.get(e)||0;n||this._ngZone.runOutsideAngular(()=>{e.addEventListener("focus",this._rootNodeFocusAndBlurListener,Pg),e.addEventListener("blur",this._rootNodeFocusAndBlurListener,Pg)}),this._rootNodeFocusListenerCount.set(e,n+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(Wd(this._stopInputModalityDetector)).subscribe(t=>{this._setOrigin(t,!0)}))}_removeGlobalListeners(t){const e=t.rootNode;if(this._rootNodeFocusListenerCount.has(e)){const t=this._rootNodeFocusListenerCount.get(e);t>1?this._rootNodeFocusListenerCount.set(e,t-1):(e.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Pg),e.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Pg),this._rootNodeFocusListenerCount.delete(e))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,e,n){this._setClasses(t,e),this._emitOrigin(n.subject,e),this._lastFocusOrigin=e}_getClosestElementsInfo(t){const e=[];return this._elementInfo.forEach((n,i)=>{(i===t||n.checkChildren&&i.contains(t))&&e.push([i,n])}),e}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(pp),Ci(Cg),Ci(Yu,8),Ci(Ag,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(xu),Ci(pp),Ci(Cg),Ci(Yu,8),Ci(Ag,8))},token:t,providedIn:"root"}),t})();const Mg="cdk-high-contrast-black-on-white",Dg="cdk-high-contrast-white-on-black",Rg="cdk-high-contrast-active";let Ng=(()=>{class t{constructor(t,e){this._platform=t,this._document=e}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const e=this._document.defaultView||window,n=e&&e.getComputedStyle?e.getComputedStyle(t):null,i=(n&&n.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),i){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(Rg),t.remove(Mg),t.remove(Dg),this._hasCheckedHighContrastMode=!0;const e=this.getHighContrastMode();1===e?(t.add(Rg),t.add(Mg)):2===e&&(t.add(Rg),t.add(Dg))}}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(Yu))},token:t,providedIn:"root"}),t})(),Lg=(()=>{class t{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ng))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[fp,ig]]}),t})();const jg=new Rl("12.2.5");class Fg{}const Bg="*";function Vg(t,e){return{type:7,name:t,definitions:e,options:{}}}function zg(t,e=null){return{type:4,styles:e,timings:t}}function Ug(t,e=null){return{type:2,steps:t,options:e}}function Hg(t){return{type:6,styles:t,offset:null}}function $g(t,e,n){return{type:0,name:t,styles:e,options:n}}function Gg(t){return{type:5,steps:t}}function Wg(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function qg(t=null){return{type:9,options:t}}function Xg(t,e,n=null){return{type:11,selector:t,animation:e,options:n}}function Yg(t){Promise.resolve(null).then(t)}class Kg{constructor(t=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Yg(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Qg{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let e=0,n=0,i=0;const r=this.players.length;0==r?Yg(()=>this._onFinish()):this.players.forEach(t=>{t.onDone(()=>{++e==r&&this._onFinish()}),t.onDestroy(()=>{++n==r&&this._onDestroy()}),t.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((t,e)=>Math.max(t,e.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const e=t*this.totalTime;this.players.forEach(t=>{const n=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(n)})}getPosition(){const t=this.players.reduce((t,e)=>null===t||e.totalTime>t.totalTime?e:t,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}function Zg(){return"undefined"!=typeof window&&void 0!==window.document}function Jg(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function tm(t){switch(t.length){case 0:return new Kg;case 1:return t[0];default:return new Qg(t)}}function em(t,e,n,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(t=>{const n=t.offset,i=n==l,u=i&&c||{};Object.keys(t).forEach(n=>{let i=n,a=t[n];if("offset"!==n)switch(i=e.normalizePropertyName(i,o),a){case"!":a=r[n];break;case Bg:a=s[n];break;default:a=e.normalizeStyleValue(n,i,a,o)}u[i]=a}),i||a.push(u),c=u,l=n}),o.length){const t="\n - ";throw new Error(`Unable to animate due to the following errors:${t}${o.join(t)}`)}return a}function nm(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&im(n,"start",t)));break;case"done":t.onDone(()=>i(n&&im(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&im(n,"destroy",t)))}}function im(t,e,n){const i=n.totalTime,r=rm(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,null==i?t.totalTime:i,!!n.disabled),s=t._data;return null!=s&&(r._data=s),r}function rm(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function sm(t,e,n){let i;return t instanceof Map?(i=t.get(e),i||t.set(e,i=n)):(i=t[e],i||(i=t[e]=n)),i}function om(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let am=(t,e)=>!1,lm=(t,e)=>!1,cm=(t,e,n)=>[];const um=Jg();(um||"undefined"!=typeof Element)&&(am=Zg()?(t,e)=>{for(;e&&e!==document.documentElement;){if(e===t)return!0;e=e.parentNode||e.host}return!1}:(t,e)=>t.contains(e),lm=(()=>{if(um||Element.prototype.matches)return(t,e)=>t.matches(e);{const t=Element.prototype,e=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return e?(t,n)=>e.apply(t,[n]):lm}})(),cm=(t,e,n)=>{let i=[];if(n){const n=t.querySelectorAll(e);for(let t=0;t{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=t[n]}),e}let ym=(()=>{class t{validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new Kg(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class vm{}vm.NOOP=new ym;const _m="ng-enter",wm="ng-leave",xm="ng-trigger",Sm=".ng-trigger",Em="ng-animating",Cm=".ng-animating";function Om(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Tm(parseFloat(e[1]),e[2])}function Tm(t,e){switch(e){case"s":return 1e3*t;default:return t}}function km(t,e,n){return t.hasOwnProperty("duration")?t:function(t,e,n){let i,r=0,s="";if("string"==typeof t){const n=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return e.push(`The provided timing value "${t}" is invalid.`),{duration:0,delay:0,easing:""};i=Tm(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=Tm(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=t;if(!n){let n=!1,s=e.length;i<0&&(e.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(e.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&e.splice(s,0,`The provided timing value "${t}" is invalid.`)}return{duration:i,delay:r,easing:s}}(t,e,n)}function Am(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function Pm(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else Am(t,n);return n}function Im(t,e,n){return n?e+":"+n+";":""}function Mm(t){let e="";for(let n=0;n{const r=zm(i);n&&!n.hasOwnProperty(i)&&(n[i]=t.style[r]),t.style[r]=e[i]}),Jg()&&Mm(t))}function Rm(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=zm(e);t.style[n]=""}),Jg()&&Mm(t))}function Nm(t){return Array.isArray(t)?1==t.length?t[0]:Ug(t):t}const Lm=new RegExp("{{\\s*(.+?)\\s*}}","g");function jm(t){let e=[];if("string"==typeof t){let n;for(;n=Lm.exec(t);)e.push(n[1]);Lm.lastIndex=0}return e}function Fm(t,e,n){const i=t.toString(),r=i.replace(Lm,(t,i)=>{let r=e[i];return e.hasOwnProperty(i)||(n.push(`Please provide a value for the animation param ${i}`),r=""),r.toString()});return r==i?t:r}function Bm(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Vm=/-+([a-z0-9])/g;function zm(t){return t.replace(Vm,(...t)=>t[1].toUpperCase())}function Um(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Hm(t,e){return 0===t||0===e}function $m(t,e,n){const i=Object.keys(n);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(t=>{s.hasOwnProperty(t)||o.push(t),s[t]=n[t]}),o.length)for(var r=1;rfunction(t,e,n){if(":"==t[0]){const i=function(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,e)=>parseFloat(e)>parseFloat(t);case":decrement":return(t,e)=>parseFloat(e) *"}}(t,n);if("function"==typeof i)return void e.push(i);t=i}const i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${t}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(Km(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(Km(o,r))}(t,n,e)):n.push(t),n}const Xm=new Set(["true","1"]),Ym=new Set(["false","0"]);function Km(t,e){const n=Xm.has(t)||Ym.has(t),i=Xm.has(e)||Ym.has(e);return(r,s)=>{let o="*"==t||t==r,a="*"==e||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?Xm.has(t):Ym.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?Xm.has(e):Ym.has(e)),o&&a}}const Qm=new RegExp("s*:selfs*,?","g");function Zm(t,e,n){return new Jm(t).build(e,n)}class Jm{constructor(t){this._driver=t}build(t,e){const n=new tb(e);return this._resetContextStyleTimingState(n),Gm(this,Nm(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,i=e.depCount=0;const r=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(t=>{if(this._resetContextStyleTimingState(e),0==t.type){const n=t,i=n.name;i.toString().split(/\s*,\s*/).forEach(t=>{n.name=t,r.push(this.visitState(n,e))}),n.name=i}else if(1==t.type){const r=this.visitTransition(t,e);n+=r.queryCount,i+=r.depCount,s.push(r)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(t,e){const n=this.visitStyle(t.styles,e),i=t.options&&t.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(t=>{if(eb(t)){const e=t;Object.keys(e).forEach(t=>{jm(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Bm(r.values());e.errors.push(`state("${t.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:t.name,style:n,options:i?{params:i}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;const n=Gm(this,Nm(t.animation),e);return{type:1,matchers:qm(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:nb(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>Gm(this,t,e)),options:nb(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=Gm(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:nb(t.options)}}visitAnimate(t,e){const n=function(t,e){let n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return ib(km(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=ib(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||km(i,e),ib(n.duration,n.delay,n.easing)}(t.timings,e.errors);e.currentAnimateTimings=n;let i,r=t.styles?t.styles:Hg({});if(5==r.type)i=this.visitKeyframes(r,e);else{let r=t.styles,s=!1;if(!r){s=!0;const t={};n.easing&&(t.easing=n.easing),r=Hg(t)}e.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,e);o.isEmptyStep=s,i=o}return e.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(t,e){const n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){const n=[];Array.isArray(t.styles)?t.styles.forEach(t=>{"string"==typeof t?t==Bg?n.push(t):e.errors.push(`The provided style string value ${t} is not allowed.`):n.push(t)}):n.push(t.styles);let i=!1,r=null;return n.forEach(t=>{if(eb(t)){const e=t,n=e.easing;if(n&&(r=n,delete e.easing),!i)for(let t in e)if(e[t].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:t.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(t,e){const n=e.currentAnimateTimings;let i=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),t.styles.forEach(t=>{"string"!=typeof t&&Object.keys(t).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void e.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=e.collectedStyles[e.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(e.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),e.options&&function(t,e,n){const i=e.params||{},r=jm(t);r.length&&r.forEach(t=>{i.hasOwnProperty(t)||n.push(`Unable to resolve the local animation param ${t} in the given list of values`)})}(t[n],e.options,e.errors)})})}visitKeyframes(t,e){const n={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const l=t.steps.map(t=>{const n=this._makeStyleAst(t,e);let l=null!=n.offset?n.offset:function(t){if("string"==typeof t)return null;let e=null;if(Array.isArray(t))t.forEach(t=>{if(eb(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(eb(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}return e}(n.styles),c=0;return null!=l&&(i++,c=n.offset=l),o=o||c<0||c>1,s=s||c0&&i{const s=u>0?i==h?1:u*i:r[i],o=s*f;e.currentTime=d+p.delay+o,p.duration=o,this._validateStyleAst(t,e),t.offset=s,n.styles.push(t)}),n}visitReference(t,e){return{type:8,animation:Gm(this,Nm(t.animation),e),options:nb(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:nb(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:nb(t.options)}}visitQuery(t,e){const n=e.currentQuerySelector,i=t.options||{};e.queryCount++,e.currentQuery=t;const[r,s]=function(t){const e=!!t.split(/\s*,\s*/).find(t=>":self"==t);return e&&(t=t.replace(Qm,"")),[t=t.replace(/@\*/g,Sm).replace(/@\w+/g,t=>Sm+"-"+t.substr(1)).replace(/:animating/g,Cm),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,sm(e.collectedStyles,e.currentQuerySelector,{});const o=Gm(this,Nm(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:t.selector,options:nb(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const n="full"===t.timings?{duration:0,delay:0,easing:"full"}:km(t.timings,e.errors,!0);return{type:12,animation:Gm(this,Nm(t.animation),e),timings:n,options:null}}}class tb{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function eb(t){return!Array.isArray(t)&&"object"==typeof t}function nb(t){return t?(t=Am(t)).params&&(t.params=function(t){return t?Am(t):null}(t.params)):t={},t}function ib(t,e,n){return{duration:t,delay:e,easing:n}}function rb(t,e,n,i,r,s,o=null,a=!1){return{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class sb{constructor(){this._map=new Map}consume(t){let e=this._map.get(t);return e?this._map.delete(t):e=[],e}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const ob=new RegExp(":enter","g"),ab=new RegExp(":leave","g");function lb(t,e,n,i,r,s={},o={},a,l,c=[]){return(new cb).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class cb{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new sb;const u=new hb(t,e,l,i,r,c,[]);u.options=a,u.currentTimeline.setStyles([s],null,u.errors,a),Gm(this,n,u);const h=u.timelines.filter(t=>t.containsAnimation());if(h.length&&Object.keys(o).length){const t=h[h.length-1];t.allowOnlyTimelineStyles()||t.setStyles([o],null,u.errors,a)}return h.length?h.map(t=>t.buildKeyframes()):[rb(e,[],[],[],0,0,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){const n=e.subInstructions.consume(e.element);if(n){const i=e.createSubContext(t.options),r=e.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&e.transformIntoNewTimeline(s)}e.previousNode=t}visitAnimateRef(t,e){const n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_visitSubInstructions(t,e,n){let i=e.currentTimeline.currentTime;const r=null!=n.duration?Om(n.duration):null,s=null!=n.delay?Om(n.delay):null;return 0!==r&&t.forEach(t=>{const n=e.appendInstructionToTimeline(t,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(t,e){e.updateOptions(t.options,!0),Gm(this,t.animation,e),e.previousNode=t}visitSequence(t,e){const n=e.subContextCount;let i=e;const r=t.options;if(r&&(r.params||r.delay)&&(i=e.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=ub);const t=Om(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>Gm(this,t,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){const n=[];let i=e.currentTimeline.currentTime;const r=t.options&&t.options.delay?Om(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),Gm(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(t=>e.currentTimeline.mergeTimelineCollectedStyles(t)),e.transformIntoNewTimeline(i),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){const n=t.strValue;return km(e.params?Fm(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){const n=e.currentAnimateTimings=this._visitTiming(t.timings,e),i=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),i.snapshotCurrentStyles());const r=t.style;5==r.type?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){const n=e.currentTimeline,i=e.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(r):n.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){const n=e.currentAnimateTimings,i=e.currentTimeline.duration,r=n.duration,s=e.createSubContext().currentTimeline;s.easing=n.easing,t.styles.forEach(t=>{s.forwardTime((t.offset||0)*r),s.setStyles(t.styles,t.easing,e.errors,e.options),s.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(s),e.transformIntoNewTimeline(i+r),e.previousNode=t}visitQuery(t,e){const n=e.currentTimeline.currentTime,i=t.options||{},r=i.delay?Om(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=ub);let s=n;const o=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{e.currentQueryIndex=i;const o=e.createSubContext(t.options,n);r&&o.delayNextStep(r),n===e.element&&(a=o.currentTimeline),Gm(this,t.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),a&&(e.currentTimeline.mergeTimelineCollectedStyles(a),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){const n=e.parentContext,i=e.currentTimeline,r=t.timings,s=Math.abs(r.duration),o=s*(e.currentQueryTotal-1);let a=s*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const l=e.currentTimeline;a&&l.delayNextStep(a);const c=l.currentTime;Gm(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const ub={};class hb{constructor(t,e,n,i,r,s,o,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=ub,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new db(this._driver,e,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;const n=t;let i=this.options;null!=n.duration&&(i.duration=Om(n.duration)),null!=n.delay&&(i.delay=Om(n.delay));const r=n.params;if(r){let t=i.params;t||(t=this.options.params={}),Object.keys(r).forEach(n=>{(!e||!t.hasOwnProperty(n))&&(t[n]=Fm(r[n],t,this.errors))})}}_copyOptions(){const t={};if(this.options){const e=this.options.params;if(e){const n=t.params={};Object.keys(e).forEach(t=>{n[t]=e[t]})}}return t}createSubContext(t=null,e,n){const i=e||this.element,r=new hb(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=ub,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){const i={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},r=new pb(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,i,t.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,i,r,s){let o=[];if(i&&o.push(this.element),t.length>0){t=(t=t.replace(ob,"."+this._enterClassName)).replace(ab,"."+this._leaveClassName);let e=this._driver.query(this.element,t,1!=n);0!==n&&(e=n<0?e.slice(e.length+n,e.length):e.slice(0,n)),o.push(...e)}return!r&&0==o.length&&s.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),o}}class db{constructor(t,e,n,i){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new db(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||Bg,this._currentKeyframe[t]=Bg}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,i){e&&(this._previousKeyframe.easing=e);const r=i&&i.params||{},s=function(t,e){const n={};let i;return t.forEach(t=>{"*"===t?(i=i||Object.keys(e),i.forEach(t=>{n[t]=Bg})):Pm(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=Fm(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Bg),this._updateStyle(t,e)})}applyStylesToKeyframe(){const t=this._pendingStyles,e=Object.keys(t);0!=e.length&&(this._pendingStyles={},e.forEach(e=>{this._currentKeyframe[e]=t[e]}),Object.keys(this._localTimelineStyles).forEach(t=>{this._currentKeyframe.hasOwnProperty(t)||(this._currentKeyframe[t]=this._localTimelineStyles[t])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(t=>{const e=this._localTimelineStyles[t];this._pendingStyles[t]=e,this._updateStyle(t,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){Object.keys(t._styleSummary).forEach(e=>{const n=this._styleSummary[e],i=t._styleSummary[e];(!n||i.time>n.time)&&this._updateStyle(e,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,e=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=Pm(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Bg&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Bm(t.values()):[],s=e.size?Bm(e.values()):[];if(n){const t=i[0],e=Am(t);t.offset=0,e.offset=1,i=[t,e]}return rb(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class pb extends db{constructor(t,e,n,i,r,s,o=!1){super(t,e,s.delay),this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){const r=[],s=n+e,o=e/s,a=Pm(t[0],!1);a.offset=0,r.push(a);const l=Pm(t[0],!1);l.offset=fb(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=Pm(t[i],!1);o.offset=fb((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return rb(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function fb(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class gb{}class mb extends gb{normalizePropertyName(t,e){return zm(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(bb[e]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const e=n.match(/^[+-]?[\d\.]+([a-z]*)$/);e&&0==e[1].length&&i.push(`Please provide a CSS unit value for ${t}:${n}`)}return s+r}}const bb=(()=>function(t){const e={};return t.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function yb(t,e,n,i,r,s,o,a,l,c,u,h,d){return{type:0,element:t,triggerName:e,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:u,totalTime:h,errors:d}}const vb={};class _b{constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,i){return function(t,e,n,i,r){return t.some(t=>t(e,n,i,r))}(this.ast.matchers,t,e,n,i)}buildStyles(t,e,n){const i=this._stateStyles["*"],r=this._stateStyles[t],s=i?i.buildStyles(e,n):{};return r?r.buildStyles(e,n):s}build(t,e,n,i,r,s,o,a,l,c){const u=[],h=this.ast.options&&this.ast.options.params||vb,d=this.buildStyles(n,o&&o.params||vb,u),p=a&&a.params||vb,f=this.buildStyles(i,p,u),g=new Set,m=new Map,b=new Map,y="void"===i,v={params:Object.assign(Object.assign({},h),p)},_=c?[]:lb(t,e,this.ast.animation,r,s,d,f,v,l,u);let w=0;if(_.forEach(t=>{w=Math.max(t.duration+t.delay,w)}),u.length)return yb(e,this._triggerName,n,i,y,d,f,[],[],m,b,w,u);_.forEach(t=>{const n=t.element,i=sm(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=sm(b,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const x=Bm(g.values());return yb(e,this._triggerName,n,i,y,d,f,_,x,m,b,w)}}class wb{constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){const n={},i=Am(this.defaultParams);return Object.keys(t).forEach(e=>{const n=t[e];null!=n&&(i[e]=n)}),this.styles.styles.forEach(t=>{if("string"!=typeof t){const r=t;Object.keys(r).forEach(t=>{let s=r[t];s.length>1&&(s=Fm(s,i,e));const o=this.normalizer.normalizePropertyName(t,e);s=this.normalizer.normalizeStyleValue(t,o,s,e),n[o]=s})}}),n}}class xb{constructor(t,e,n){this.name=t,this.ast=e,this._normalizer=n,this.transitionFactories=[],this.states={},e.states.forEach(t=>{this.states[t.name]=new wb(t.style,t.options&&t.options.params||{},n)}),Sb(this.states,"true","1"),Sb(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new _b(t,e,this.states))}),this.fallbackTransition=function(t,e,n){return new _b(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[(t,e)=>!0],options:null,queryCount:0,depCount:0},e)}(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,i){return this.transitionFactories.find(r=>r.match(t,e,n,i))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}}function Sb(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const Eb=new sb;class Cb{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(t,e){const n=[],i=Zm(this._driver,e,n);if(n.length)throw new Error(`Unable to build the animation due to the following errors: ${n.join("\n")}`);this._animations[t]=i}_buildPlayer(t,e,n){const i=t.element,r=em(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(i,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){const i=[],r=this._animations[t];let s;const o=new Map;if(r?(s=lb(this._driver,e,r,_m,wm,{},{},n,Eb,i),s.forEach(t=>{const e=sm(o,t.element,{});t.postStyleProps.forEach(t=>e[t]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error(`Unable to create the animation due to the following errors: ${i.join("\n")}`);o.forEach((t,e)=>{Object.keys(t).forEach(n=>{t[n]=this._driver.computeStyle(e,n,Bg)})});const a=tm(s.map(t=>{const e=o.get(t.element);return this._buildPlayer(t,{},e)}));return this._playersById[t]=a,a.onDestroy(()=>this.destroy(t)),this.players.push(a),a}destroy(t){const e=this._getPlayer(t);e.destroy(),delete this._playersById[t];const n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){const e=this._playersById[t];if(!e)throw new Error(`Unable to find the timeline player referenced by ${t}`);return e}listen(t,e,n,i){const r=rm(e,"","","");return nm(this._getPlayer(t),n,r,i),()=>{}}command(t,e,n,i){if("register"==n)return void this.register(t,i[0]);if("create"==n)return void this.create(t,e,i[0]||{});const r=this._getPlayer(t);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(t)}}}const Ob="ng-animate-queued",Tb="ng-animate-disabled",kb=".ng-animate-disabled",Ab=[],Pb={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ib={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Mb="__ng_removed";class Db{constructor(t,e=""){this.namespaceId=e;const n=t&&t.hasOwnProperty("value");if(this.value=function(t){return null!=t?t:null}(n?t.value:t),n){const e=Am(t);delete e.value,this.options=e}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(t){const e=t.params;if(e){const t=this.options.params;Object.keys(e).forEach(n=>{null==t[n]&&(t[n]=e[n])})}}}const Rb="void",Nb=new Db(Rb);class Lb{constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,$b(e,this._hostClassName)}listen(t,e,n,i){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${e}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if(!function(t){return"start"==t||"done"==t}(n))throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${e}" is not supported!`);const r=sm(this._elementListeners,t,[]),s={name:e,phase:n,callback:i};r.push(s);const o=sm(this._engine.statesByElement,t,{});return o.hasOwnProperty(e)||($b(t,xm),$b(t,xm+"-"+e),o[e]=Nb),()=>{this._engine.afterFlush(()=>{const t=r.indexOf(s);t>=0&&r.splice(t,1),this._triggers[e]||delete o[e]})}}register(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)}_getTrigger(t){const e=this._triggers[t];if(!e)throw new Error(`The provided animation trigger "${t}" has not been registered!`);return e}trigger(t,e,n,i=!0){const r=this._getTrigger(e),s=new Fb(this.id,e,t);let o=this._engine.statesByElement.get(t);o||($b(t,xm),$b(t,xm+"-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new Db(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=Nb),l.value!==Rb&&a.value===l.value){if(!function(t,e){const n=Object.keys(t),i=Object.keys(e);if(n.length!=i.length)return!1;for(let r=0;r{Rm(t,n),Dm(t,i)})}return}const c=sm(this._engine.playersByElement,t,[]);c.forEach(t=>{t.namespaceId==this.id&&t.triggerName==e&&t.queued&&t.destroy()});let u=r.matchTransition(a.value,l.value,t,l.params),h=!1;if(!u){if(!i)return;u=r.fallbackTransition,h=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:u,fromState:a,toState:l,player:s,isFallbackTransition:h}),h||($b(t,Ob),s.onStart(()=>{Gb(t,Ob)})),s.onDone(()=>{let e=this.players.indexOf(s);e>=0&&this.players.splice(e,1);const n=this._engine.playersByElement.get(t);if(n){let t=n.indexOf(s);t>=0&&n.splice(t,1)}}),this.players.push(s),c.push(s),s}deregister(t){delete this._triggers[t],this._engine.statesByElement.forEach((e,n)=>{delete e[t]}),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(e=>e.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const e=this._engine.playersByElement.get(t);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){const n=this._engine.driver.query(t,Sm,!0);n.forEach(t=>{if(t[Mb])return;const n=this._engine.fetchNamespacesByElement(t);n.size?n.forEach(n=>n.triggerLeaveAnimation(t,e,!1,!0)):this.clearElementCache(t)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(t=>this.clearElementCache(t)))}triggerLeaveAnimation(t,e,n,i){const r=this._engine.statesByElement.get(t);if(r){const s=[];if(Object.keys(r).forEach(e=>{if(this._triggers[e]){const n=this.trigger(t,e,Rb,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&tm(s).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const e=this._elementListeners.get(t),n=this._engine.statesByElement.get(t);if(e&&n){const i=new Set;e.forEach(e=>{const r=e.name;if(i.has(r))return;i.add(r);const s=this._triggers[r].fallbackTransition,o=n[r]||Nb,a=new Db(Rb),l=new Fb(this.id,r,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:r,transition:s,fromState:o,toState:a,player:l,isFallbackTransition:!0})})}}removeNode(t,e){const n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let i=!1;if(n.totalAnimations){const e=n.players.length?n.playersByQueriedElement.get(t):[];if(e&&e.length)i=!0;else{let e=t;for(;e=e.parentNode;)if(n.statesByElement.get(e)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(t),i)n.markElementAsRemoved(this.id,t,!1,e);else{const i=t[Mb];(!i||i===Pb)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){$b(t,this._hostClassName)}drainQueuedTransitions(t){const e=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(e=>{if(e.name==n.triggerName){const i=rm(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,nm(n.player,e.phase,i,e.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(n)}),this._queue=[],e.sort((t,e)=>{const n=t.transition.ast.depCount,i=e.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(t.element,e.element)?1:-1})}destroy(t){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}elementContainsData(t){let e=!1;return this._elementListeners.has(t)&&(e=!0),e=!!this._queue.find(e=>e.element===t)||e,e}}class jb{constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(t,e)=>{}}_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}get queuedPlayers(){const t=[];return this._namespaceList.forEach(e=>{e.players.forEach(e=>{e.queued&&t.push(e)})}),t}createNamespace(t,e){const n=new Lb(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,e)){this._namespaceList.splice(r+1,0,t),i=!0;break}i||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let i=this._namespaceLookup[t];i&&i.register(e,n)&&this.totalAnimations++}destroy(t,e){if(!t)return;const n=this._fetchNamespace(t);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[t];const e=this._namespaceList.indexOf(n);e>=0&&this._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(()=>n.destroy(e))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const e=new Set,n=this.statesByElement.get(t);if(n){const t=Object.keys(n);for(let i=0;i=0&&this.collectedLeaveElements.splice(t,1)}if(t){const i=this._fetchNamespace(t);i&&i.insertNode(e,n)}i&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),$b(t,Tb)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Gb(t,Tb))}removeNode(t,e,n,i){if(Bb(e)){const r=t?this._fetchNamespace(t):null;if(r?r.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i),n){const n=this.namespacesByHostElement.get(e);n&&n.id!==t&&n.removeNode(e,i)}}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,n,i){this.collectedLeaveElements.push(e),e[Mb]={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return Bb(e)?this._fetchNamespace(t).listen(e,n,i,r):()=>{}}_buildInstruction(t,e,n,i,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,i,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,Sm,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,Cm,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(t){const e=this.playersByElement.get(t);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(t){const e=this.playersByQueriedElement.get(t);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return tm(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t[Mb];if(e&&e.setForRemoval){if(t[Mb]=Pb,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,kb)&&this.markElementAsDisabled(t,!1),this.driver.query(t,kb,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,e)=>this._balanceNamespaceList(t,e)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nt()),this._flushFns=[],this._whenQuietFns.length){const t=this._whenQuietFns;this._whenQuietFns=[],e.length?tm(e).onDone(()=>{t.forEach(t=>t())}):t.forEach(t=>t())}}reportError(t){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${t.join("\n")}`)}_flushAnimations(t,e){const n=new sb,i=[],r=new Map,s=[],o=new Map,a=new Map,l=new Map,c=new Set;this.disabledNodes.forEach(t=>{c.add(t);const e=this.driver.query(t,".ng-animate-queued",!0);for(let n=0;n{const n=_m+f++;p.set(e,n),t.forEach(t=>$b(t,n))});const g=[],m=new Set,b=new Set;for(let P=0;Pm.add(t)):b.add(t))}const y=new Map,v=Ub(h,Array.from(m));v.forEach((t,e)=>{const n=wm+f++;y.set(e,n),t.forEach(t=>$b(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>Gb(t,n))}),v.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>Gb(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const _=[],w=[];for(let P=this._namespaceList.length-1;P>=0;P--)this._namespaceList[P].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(_.push(e),this.collectedEnterElements.length){const t=r[Mb];if(t&&t.setForMove)return void e.destroy()}const c=!u||!this.driver.containsElement(u,r),h=y.get(r),d=p.get(r),f=this._buildInstruction(t,n,d,h,c);if(f.errors&&f.errors.length)w.push(f);else{if(c)return e.onStart(()=>Rm(r,f.fromStyles)),e.onDestroy(()=>Dm(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>Rm(r,f.fromStyles)),e.onDestroy(()=>Dm(r,f.toStyles)),void i.push(e);f.timelines.forEach(t=>t.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:e,element:r}),f.queriedElements.forEach(t=>sm(o,t,[]).push(e)),f.preStyleProps.forEach((t,e)=>{const n=Object.keys(t);if(n.length){let t=a.get(e);t||a.set(e,t=new Set),n.forEach(e=>t.add(e))}}),f.postStyleProps.forEach((t,e)=>{const n=Object.keys(t);let i=l.get(e);i||l.set(e,i=new Set),n.forEach(t=>i.add(t))})}});if(w.length){const t=[];w.forEach(e=>{t.push(`@${e.triggerName} has failed due to:\n`),e.errors.forEach(e=>t.push(`- ${e}\n`))}),_.forEach(t=>t.destroy()),this.reportError(t)}const x=new Map,S=new Map;s.forEach(t=>{const e=t.element;n.has(e)&&(S.set(e,e),this._beforeAnimationBuild(t.player.namespaceId,t.instruction,x))}),i.forEach(t=>{const e=t.element;this._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(t=>{sm(x,e,[]).push(t),t.destroy()})});const E=g.filter(t=>Xb(t,a,l)),C=new Map;zb(C,this.driver,b,l,Bg).forEach(t=>{Xb(t,a,l)&&E.push(t)});const O=new Map;d.forEach((t,e)=>{zb(O,this.driver,new Set(t),a,"!")}),E.forEach(t=>{const e=C.get(t),n=O.get(t);C.set(t,Object.assign(Object.assign({},e),n))});const T=[],k=[],A={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>Dm(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=A;if(S.size>1){let n=e;const i=[];for(;n=n.parentNode;){const e=S.get(n);if(e){t=e;break}i.push(n)}i.forEach(e=>S.set(e,t))}const n=this._buildAnimation(s.namespaceId,o,x,r,O,C);if(s.setRealPlayer(n),t===A)T.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=tm(e)),i.push(s)}}else Rm(e,o.fromStyles),s.onDestroy(()=>Dm(e,o.toStyles)),k.push(s),c.has(e)&&i.push(s)}),k.forEach(t=>{const e=r.get(t.element);if(e&&e.length){const n=tm(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let P=0;P!t.destroyed);i.length?Wb(this,t,i):this.processLeaveNode(t)}return g.length=0,T.forEach(t=>{this.players.push(t),t.onDone(()=>{t.destroy();const e=this.players.indexOf(t);this.players.splice(e,1)}),t.play()}),T}elementContainsData(t,e){let n=!1;const i=e[Mb];return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,i,r){let s=[];if(e){const e=this.playersByQueriedElement.get(t);e&&(s=e)}else{const e=this.playersByElement.get(t);if(e){const t=!r||r==Rb;e.forEach(e=>{e.queued||!t&&e.triggerName!=i||s.push(e)})}}return(n||i)&&(s=s.filter(t=>!(n&&n!=t.namespaceId||i&&i!=t.triggerName))),s}_beforeAnimationBuild(t,e,n){const i=e.element,r=e.isRemovalTransition?void 0:t,s=e.isRemovalTransition?void 0:e.triggerName;for(const o of e.timelines){const t=o.element,a=t!==i,l=sm(n,t,[]);this._getPreviousPlayers(t,a,r,s,e.toState).forEach(t=>{const e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),l.push(t)})}Rm(i,e.fromStyles)}_buildAnimation(t,e,n,i,r,s){const o=e.triggerName,a=e.element,l=[],c=new Set,u=new Set,h=e.timelines.map(e=>{const h=e.element;c.add(h);const d=h[Mb];if(d&&d.removedBeforeQueried)return new Kg(e.duration,e.delay);const p=h!==a,f=function(t){const e=[];return qb(t,e),e}((n.get(h)||Ab).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===h),g=r.get(h),m=s.get(h),b=em(0,this._normalizer,0,e.keyframes,g,m),y=this._buildPlayer(e,b,f);if(e.subTimeline&&i&&u.add(h),p){const e=new Fb(t,o,h);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{sm(this.playersByQueriedElement,t.element,[]).push(t),t.onDone(()=>function(t,e,n){let i;if(t instanceof Map){if(i=t.get(e),i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&t.delete(e)}}else if(i=t[e],i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&delete t[e]}return i}(this.playersByQueriedElement,t.element,t))}),c.forEach(t=>$b(t,Em));const d=tm(h);return d.onDestroy(()=>{c.forEach(t=>Gb(t,Em)),Dm(a,e.toStyles)}),u.forEach(t=>{sm(i,t,[]).push(d)}),d}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new Kg(t.duration,t.delay)}}class Fb{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new Kg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(n=>nm(t,e,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){sm(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const e=this._player;e.triggerCallback&&e.triggerCallback(t)}}function Bb(t){return t&&1===t.nodeType}function Vb(t,e){const n=t.style.display;return t.style.display=null!=e?e:"none",n}function zb(t,e,n,i,r){const s=[];n.forEach(t=>s.push(Vb(t)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(t=>{const n=s[t]=e.computeStyle(i,t,r);(!n||0==n.length)&&(i[Mb]=Ib,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Vb(t,s[a++])),o}function Ub(t,e){const n=new Map;if(t.forEach(t=>n.set(t,[])),0==e.length)return n;const i=new Set(e),r=new Map;function s(t){if(!t)return 1;let e=r.get(t);if(e)return e;const o=t.parentNode;return e=n.has(o)?o:i.has(o)?1:s(o),r.set(t,e),e}return e.forEach(t=>{const e=s(t);1!==e&&n.get(e).push(t)}),n}const Hb="$$classes";function $b(t,e){if(t.classList)t.classList.add(e);else{let n=t[Hb];n||(n=t[Hb]={}),n[e]=!0}}function Gb(t,e){if(t.classList)t.classList.remove(e);else{let n=t[Hb];n&&delete n[e]}}function Wb(t,e,n){tm(n).onDone(()=>t.processLeaveNode(e))}function qb(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class Yb{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new jb(t,e,n),this._timelineEngine=new Cb(t,e,n),this._transitionEngine.onRemovalComplete=(t,e)=>this.onRemovalComplete(t,e)}registerTrigger(t,e,n,i,r){const s=t+"-"+i;let o=this._triggerCache[s];if(!o){const t=[],e=Zm(this._driver,r,t);if(t.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${t.join("\n - ")}`);o=function(t,e,n){return new xb(t,e,n)}(i,e,this._normalizer),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(e,i,o)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,i){this._transitionEngine.insertNode(t,e,n,i)}onRemove(t,e,n,i){this._transitionEngine.removeNode(t,e,i||!1,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,i){if("@"==n.charAt(0)){const[t,r]=om(n);this._timelineEngine.command(t,e,r,i)}else this._transitionEngine.trigger(t,e,n,i)}listen(t,e,n,i,r){if("@"==n.charAt(0)){const[t,i]=om(n);return this._timelineEngine.listen(t,e,i,r)}return this._transitionEngine.listen(t,e,n,i,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function Kb(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=Zb(e[0]),e.length>1&&(i=Zb(e[e.length-1]))):e&&(n=Zb(e)),n||i?new Qb(t,n,i):null}class Qb{constructor(t,e,n){this._element=t,this._startStyles=e,this._endStyles=n,this._state=0;let i=Qb.initialStylesByElement.get(t);i||Qb.initialStylesByElement.set(t,i={}),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&Dm(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Dm(this._element,this._initialStyles),this._endStyles&&(Dm(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Qb.initialStylesByElement.delete(this._element),this._startStyles&&(Rm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Rm(this._element,this._endStyles),this._endStyles=null),Dm(this._element,this._initialStyles),this._state=3)}}function Zb(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){(function(t,e){const n=ly(t,"").trim();let i=0;n.length&&(function(t,e){let n=0;for(let i=0;i=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),oy(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=ly(t,"").split(","),i=sy(n,e);i>=0&&(n.splice(i,1),ay(t,"",n.join(",")))}(this._element,this._name))}}function iy(t,e,n){ay(t,"PlayState",n,ry(t,e))}function ry(t,e){const n=ly(t,"");return n.indexOf(",")>0?sy(n.split(","),e):sy([n],e)}function sy(t,e){for(let n=0;n=0)return n;return-1}function oy(t,e,n){n?t.removeEventListener(ey,e):t.addEventListener(ey,e)}function ay(t,e,n,i){const r=ty+e;if(null!=i){const e=t.style[r];if(e.length){const t=e.split(",");t[i]=n,n=t.join(",")}}t.style[r]=n}function ly(t,e){return t.style[ty+e]||""}class cy{constructor(t,e,n,i,r,s,o,a){this.element=t,this.keyframes=e,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(t=>t()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(t){this._styler.setPosition(t)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new ny(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}beforeDestroy(){this.init();const t={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(t[n]=e?this._finalStyles[n]:Wm(this.element,n))})}this.currentSnapshot=t}}class uy extends Kg{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=bm(e)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(t=>{this._startingStyles[t]=this.element.style[t]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(t=>this.element.style.setProperty(t,this._styles[t])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(t=>{const e=this._startingStyles[t];e?this.element.style.setProperty(t,e):this.element.style.removeProperty(t)}),this._startingStyles=null,super.destroy())}}class hy{constructor(){this._count=0}validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>bm(t));let i=`@keyframes ${e} {\n`,r="";n.forEach(t=>{r=" ";const e=parseFloat(t.offset);i+=`${r}${100*e}% {\n`,r+=" ",Object.keys(t).forEach(e=>{const n=t[e];switch(e){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${e}: ${n};\n`)}}),i+=`${r}}\n`}),i+="}\n";const s=document.createElement("style");return s.textContent=i,s}animate(t,e,n,i,r,s=[],o){const a=s.filter(t=>t instanceof cy),l={};Hm(n,i)&&a.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const c=function(t){let e={};return t&&(Array.isArray(t)?t:[t]).forEach(t=>{Object.keys(t).forEach(n=>{"offset"==n||"easing"==n||(e[n]=t[n])})}),e}(e=$m(t,e,l));if(0==n)return new uy(t,c);const u="gen_css_kf_"+this._count++,h=this.buildKeyframeElement(t,u,e);(function(t){var e;const n=null===(e=t.getRootNode)||void 0===e?void 0:e.call(t);return"undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot?n:document.head})(t).appendChild(h);const d=Kb(t,e),p=new cy(t,e,u,n,i,r,c,d);return p.onDestroy(()=>function(t){t.parentNode.removeChild(t)}(h)),p}}class dy{constructor(t,e,n,i){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(t,e,n){return t.animate(e,n)}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(e=>{"offset"!=e&&(t[e]=this._finished?this._finalKeyframe[e]:Wm(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class py{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(fy().toString()),this._cssKeyframesDriver=new hy}validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}overrideWebAnimationsSupport(t){this._isNativeImpl=t}animate(t,e,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const l={},c=s.filter(t=>t instanceof dy);Hm(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const u=Kb(t,e=$m(t,e=e.map(t=>Pm(t,!1)),l));return new dy(t,e,a,u)}}function fy(){return Zg()&&Element.prototype.animate||{}}let gy=(()=>{class t extends Fg{constructor(t,e){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(e.body,{id:"0",encapsulation:jt.None,styles:[],data:{animation:[]}})}build(t){const e=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(t)?Ug(t):t;return yy(this._renderer,null,e,"register",[n]),new my(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pl),Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class my extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new by(this._id,t,e||{},this._renderer)}}class by{constructor(t,e,n,i){this.id=t,this.element=e,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(t,e){return this._renderer.listen(this.element,`@@${this.id}:${t}`,e)}_command(t,...e){return yy(this._renderer,this.element,this.id,t,e)}onDone(t){this._listen("done",t)}onStart(t){this._listen("start",t)}onDestroy(t){this._listen("destroy",t)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(t){this._command("setPosition",t)}getPosition(){var t,e;return null!==(e=null===(t=this._renderer.engine.players[+this.id])||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}}function yy(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const vy="@.disabled";let _y=(()=>{class t{constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),e.onRemovalComplete=(t,e)=>{e&&e.parentNode(t)&&e.removeChild(t.parentNode,t)}}createRenderer(t,e){const n=this.delegate.createRenderer(t,e);if(!(t&&e&&e.data&&e.data.animation)){let t=this._rendererCache.get(n);return t||(t=new wy("",n,this.engine),this._rendererCache.set(n,t)),t}const i=e.id,r=e.id+"-"+this._currentId;this._currentId++,this.engine.register(r,t);const s=e=>{Array.isArray(e)?e.forEach(s):this.engine.registerTrigger(i,r,t,e.name,e)};return e.data.animation.forEach(s),new xy(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){t>=0&&te(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(t=>{const[e,n]=t;e(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([e,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pl),Ci(Yb),Ci(xu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class wy{constructor(t,e,n){this.namespaceId=t,this.delegate=e,this.engine=n,this.destroyNode=this.delegate.destroyNode?t=>e.destroyNode(t):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,i=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,i)}removeChild(t,e,n){this.engine.onRemove(this.namespaceId,e,this.delegate,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,i){this.delegate.setAttribute(t,e,n,i)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,i){this.delegate.setStyle(t,e,n,i)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){"@"==e.charAt(0)&&e==vy?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.delegate.listen(t,e,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}}class xy extends wy{constructor(t,e,n,i){super(e,n,i),this.factory=t,this.namespaceId=e}setProperty(t,e,n){"@"==e.charAt(0)?"."==e.charAt(1)&&e==vy?this.disableAnimations(t,n=void 0===n||!!n):this.engine.process(this.namespaceId,t,e.substr(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n){if("@"==e.charAt(0)){const i=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(t);let r=e.substr(1),s="";return"@"!=r.charAt(0)&&([r,s]=function(t){const e=t.indexOf(".");return[t.substring(0,e),t.substr(e+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,t=>{this.factory.scheduleListenerCallback(t._data||-1,n,t)})}return this.delegate.listen(t,e,n)}}let Sy=(()=>{class t extends Yb{constructor(t,e,n){super(t.body,e,n)}ngOnDestroy(){this.flush()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(vm),Ci(gb))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Ey=new oi("AnimationModuleType"),Cy=[{provide:Fg,useClass:gy},{provide:gb,useFactory:function(){return new mb}},{provide:Yb,useClass:Sy},{provide:Pl,useFactory:function(t,e,n){return new _y(t,e,n)},deps:[ed,Yb,xu]}],Oy=[{provide:vm,useFactory:function(){return"function"==typeof fy()?new py:new hy}},{provide:Ey,useValue:"BrowserAnimations"},...Cy],Ty=[{provide:vm,useClass:ym},{provide:Ey,useValue:"NoopAnimations"},...Cy];let ky=(()=>{class t{static withConfig(e){return{ngModule:t,providers:e.disableAnimations?Ty:Oy}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Oy,imports:[gd]}),t})();function Ay(t,e){if(1&t&&oa(0,"mat-pseudo-checkbox",4),2&t){const t=va();na("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function Py(t,e){if(1&t&&(ra(0,"span",5),Za(1),sa()),2&t){const t=va();ws(1),tl("(",t.group.label,")")}}const Iy=["*"],My=new Rl("12.2.5"),Dy=new oi("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Ry,Ny=(()=>{class t{constructor(t,e,n){this._hasDoneGlobalChecks=!1,this._document=n,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=e,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!Nu()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const e=getComputedStyle(t);e&&"none"!==e.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&My.full!==jg.full&&console.warn("The Angular Material version ("+My.full+") does not match the Angular CDK version ("+jg.full+").\nPlease ensure the versions of these two packages exactly match.")}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ng),Ci(Dy,8),Ci(Yu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Tp],Tp]}),t})();function Ly(t){return class extends t{constructor(...t){super(...t),this._disabled=!1}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t)}}}function jy(t,e){return class extends t{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const e=t||this.defaultColor;e!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),e&&this._elementRef.nativeElement.classList.add(`mat-${e}`),this._color=e)}}}function Fy(t){return class extends t{constructor(...t){super(...t),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=md(t)}}}function By(t,e=0){return class extends t{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?bd(t):this.defaultTabIndex}}}function Vy(t){return class extends t{constructor(...t){super(...t),this.stateChanges=new P,this.errorState=!1}updateErrorState(){const t=this.errorState,e=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);e!==t&&(this.errorState=e,this.stateChanges.next())}}}try{Ry="undefined"!=typeof Intl}catch(m){Ry=!1}let zy=(()=>{class t{isErrorState(t,e){return!!(t&&t.invalid&&(t.touched||e&&e.submitted))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})();class Uy{constructor(t,e,n){this._renderer=t,this.element=e,this.config=n,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const Hy={enterDuration:225,exitDuration:150},$y=_p({passive:!0}),Gy=["mousedown","touchstart"],Wy=["mouseup","mouseleave","touchend","touchcancel"];class qy{constructor(t,e,n,i){this._target=t,this._ngZone=e,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,i.isBrowser&&(this._containerElement=_d(n))}fadeInRipple(t,e,n={}){const i=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),r=Object.assign(Object.assign({},Hy),n.animation);n.centered&&(t=i.left+i.width/2,e=i.top+i.height/2);const s=n.radius||function(t,e,n){const i=Math.max(Math.abs(t-n.left),Math.abs(t-n.right)),r=Math.max(Math.abs(e-n.top),Math.abs(e-n.bottom));return Math.sqrt(i*i+r*r)}(t,e,i),o=t-i.left,a=e-i.top,l=r.enterDuration,c=document.createElement("div");c.classList.add("mat-ripple-element"),c.style.left=o-s+"px",c.style.top=a-s+"px",c.style.height=2*s+"px",c.style.width=2*s+"px",null!=n.color&&(c.style.backgroundColor=n.color),c.style.transitionDuration=`${l}ms`,this._containerElement.appendChild(c),function(t){window.getComputedStyle(t).getPropertyValue("opacity")}(c),c.style.transform="scale(1)";const u=new Uy(this,c,n);return u.state=0,this._activeRipples.add(u),n.persistent||(this._mostRecentTransientRipple=u),this._runTimeoutOutsideZone(()=>{const t=u===this._mostRecentTransientRipple;u.state=1,!n.persistent&&(!t||!this._isPointerDown)&&u.fadeOut()},l),u}fadeOutRipple(t){const e=this._activeRipples.delete(t);if(t===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!e)return;const n=t.element,i=Object.assign(Object.assign({},Hy),t.config.animation);n.style.transitionDuration=`${i.exitDuration}ms`,n.style.opacity="0",t.state=2,this._runTimeoutOutsideZone(()=>{t.state=3,n.parentNode.removeChild(n)},i.exitDuration)}fadeOutAll(){this._activeRipples.forEach(t=>t.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(t=>{t.config.persistent||t.fadeOut()})}setupTriggerEvents(t){const e=_d(t);!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,this._registerEvents(Gy))}handleEvent(t){"mousedown"===t.type?this._onMousedown(t):"touchstart"===t.type?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(Wy),this._pointerUpEventsRegistered=!0)}_onMousedown(t){const e=_g(t),n=this._lastTouchStartEvent&&Date.now(){!t.config.persistent&&(1===t.state||t.config.terminateOnPointerUp&&0===t.state)&&t.fadeOut()}))}_runTimeoutOutsideZone(t,e=0){this._ngZone.runOutsideAngular(()=>setTimeout(t,e))}_registerEvents(t){this._ngZone.runOutsideAngular(()=>{t.forEach(t=>{this._triggerElement.addEventListener(t,this,$y)})})}_removeTriggerEvents(){this._triggerElement&&(Gy.forEach(t=>{this._triggerElement.removeEventListener(t,this,$y)}),this._pointerUpEventsRegistered&&Wy.forEach(t=>{this._triggerElement.removeEventListener(t,this,$y)}))}}const Xy=new oi("mat-ripple-global-options");let Yy=(()=>{class t{constructor(t,e,n,i,r){this._elementRef=t,this._animationMode=r,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=i||{},this._rippleRenderer=new qy(this,e,t,n)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,e=0,n){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,e,Object.assign(Object.assign({},this.rippleConfig),n)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(xu),ea(pp),ea(Xy,8),ea(Ey,8))},t.\u0275dir=se({type:t,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,e){2&t&&ja("mat-ripple-unbounded",e.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),t})(),Ky=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny,fp],Ny]}),t})(),Qy=(()=>{class t{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return t.\u0275fac=function(e){return new(e||t)(ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,e){2&t&&ja("mat-pseudo-checkbox-indeterminate","indeterminate"===e.state)("mat-pseudo-checkbox-checked","checked"===e.state)("mat-pseudo-checkbox-disabled",e.disabled)("_mat-animation-noopable","NoopAnimations"===e._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,e){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),t})(),Zy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny]]}),t})();const Jy=new oi("MAT_OPTION_PARENT_COMPONENT"),tv=Ly(class{});let ev=0,nv=(()=>{class t extends tv{constructor(t){var e;super(),this._labelId="mat-optgroup-label-"+ev++,this._inert=null!==(e=null==t?void 0:t.inertGroups)&&void 0!==e&&e}}return t.\u0275fac=function(e){return new(e||t)(ea(Jy,8))},t.\u0275dir=se({type:t,inputs:{label:"label"},features:[jo]}),t})();const iv=new oi("MatOptgroup");let rv=0;class sv{constructor(t,e=!1){this.source=t,this.isUserInput=e}}let ov=(()=>{class t{constructor(t,e,n,i){this._element=t,this._changeDetectorRef=e,this._parent=n,this.group=i,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+rv++,this.onSelectionChange=new Rc,this._stateChanges=new P}get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(t){this._disabled=md(t)}get disableRipple(){return this._parent&&this._parent.disableRipple}get active(){return this._active}get viewValue(){return(this._getHostElement().textContent||"").trim()}select(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}deselect(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}focus(t,e){const n=this._getHostElement();"function"==typeof n.focus&&n.focus(e)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!Qp(t)&&(this._selectViaInteraction(),t.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getAriaSelected(){return this.selected||!this.multiple&&null}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){const t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue=t,this._stateChanges.next())}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(t=!1){this.onSelectionChange.emit(new sv(this,t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(void 0),ea(nv))},t.\u0275dir=se({type:t,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),t})(),av=(()=>{class t extends ov{constructor(t,e,n,i){super(t,e,n,i)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(Jy,8),ea(iv,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,e){1&t&&fa("click",function(){return e._selectViaInteraction()})("keydown",function(t){return e._handleKeydown(t)}),2&t&&(il("id",e.id),Ko("tabindex",e._getTabIndex())("aria-selected",e._getAriaSelected())("aria-disabled",e.disabled.toString()),ja("mat-selected",e.selected)("mat-option-multiple",e.multiple)("mat-active",e.active)("mat-option-disabled",e.disabled))},exportAs:["matOption"],features:[jo],ngContentSelectors:Iy,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(t,e){1&t&&(wa(),Jo(0,Ay,1,2,"mat-pseudo-checkbox",0),ra(1,"span",1),xa(2),sa(),Jo(3,Py,2,1,"span",2),oa(4,"div",3)),2&t&&(na("ngIf",e.multiple),ws(3),na("ngIf",e.group&&e.group._inert),ws(1),na("matRippleTrigger",e._getHostElement())("matRippleDisabled",e.disabled||e.disableRipple))},directives:[_h,Yy,Qy],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),t})();function lv(t,e,n){if(n.length){let i=e.toArray(),r=n.toArray(),s=0;for(let e=0;en+i?Math.max(0,t-i+e):n}let uv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Rh,Ny,Zy]]}),t})();function hv(...t){if(1===t.length){const e=t[0];if(d(e))return dv(e,null);if(p(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return dv(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return dv(t=1===t.length&&d(t[0])?t[0]:t,null).pipe(D(t=>e(...t)))}return dv(t,null)}function dv(t,e){return new C(n=>{const i=t.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=t},error:t=>n.error(t),complete:()=>{s++,(s===i||!c)&&(o===i&&n.next(e?e.reduce((t,e,n)=>(t[e]=r[n],t),{}):r),n.complete())}}))}})}function pv(t){return function(e){const n=new fv(t),i=e.lift(n);return n.caught=i}}class fv{constructor(t){this.selector=t}call(t,e){return e.subscribe(new gv(t,this.selector,this.caught))}}class gv extends ${constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const i=new H(this);this.add(i);const r=G(n,i);r!==i&&this.add(r)}}}function mv(t){return e=>e.lift(new bv(t))}class bv{constructor(t){this.callback=t}call(t,e){return e.subscribe(new yv(t,this.callback))}}class yv extends v{constructor(t,e){super(t),this.add(new g(e))}}class vv{}class _v{}class wv{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),i=n.toLowerCase(),r=t.slice(e+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const i=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(e,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof wv?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new wv;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof wv?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const i=("a"===t.op?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":const r=t.value;if(r){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===r.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}}class xv{encodeKey(t){return Cv(t)}encodeValue(t){return Cv(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const Sv=/%(\d[a-f0-9])/gi,Ev={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Cv(t){return encodeURIComponent(t).replace(Sv,(t,e)=>{var n;return null!==(n=Ev[e])&&void 0!==n?n:t})}function Ov(t){return`${t}`}class Tv{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new xv,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(t=>{const i=t.indexOf("="),[r,s]=-1==i?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,i)),e.decodeValue(t.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){const e=[];return Object.keys(t).forEach(n=>{const i=t[n];Array.isArray(i)?i.forEach(t=>{e.push({param:n,value:t,op:"a"})}):e.push({param:n,value:i,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Tv({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(Ov(t.value)),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(Ov(t.value));-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}class kv{constructor(){this.map=new Map}set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}keys(){return this.map.keys()}}function Av(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function Pv(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Iv(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Mv{constructor(t,e,n,i){let r;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.context&&(this.context=r.context),r.params&&(this.params=r.params)),this.headers||(this.headers=new wv),this.context||(this.context=new kv),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),l)),t.setParams&&(c=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),c)),new Mv(n,i,s,{params:c,headers:l,context:u,reportProgress:a,responseType:r,withCredentials:o})}}var Dv=(()=>((Dv=Dv||{})[Dv.Sent=0]="Sent",Dv[Dv.UploadProgress=1]="UploadProgress",Dv[Dv.ResponseHeader=2]="ResponseHeader",Dv[Dv.DownloadProgress=3]="DownloadProgress",Dv[Dv.Response=4]="Response",Dv[Dv.User=5]="User",Dv))();class Rv{constructor(t,e=200,n="OK"){this.headers=t.headers||new wv,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class Nv extends Rv{constructor(t={}){super(t),this.type=Dv.ResponseHeader}clone(t={}){return new Nv({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class Lv extends Rv{constructor(t={}){super(t),this.type=Dv.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new Lv({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class jv extends Rv{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function Fv(t,e){return{body:e,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let Bv=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Mv)i=t;else{let r,s;r=n.headers instanceof wv?n.headers:new wv(n.headers),n.params&&(s=n.params instanceof Tv?n.params:new Tv({fromObject:n.params})),i=new Mv(t,e,void 0!==n.body?n.body:null,{headers:r,context:n.context,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const r=wd(i).pipe(function(t,e){return W(t,e,1)}(t=>this.handler.handle(t)));if(t instanceof Mv||"events"===n.observe)return r;const s=r.pipe(Hd(t=>t instanceof Lv));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return s.pipe(D(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return s.pipe(D(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return s.pipe(D(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return s.pipe(D(t=>t.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new Tv).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,Fv(n,e))}post(t,e,n={}){return this.request("POST",t,Fv(n,e))}put(t,e,n={}){return this.request("PUT",t,Fv(n,e))}}return t.\u0275fac=function(e){return new(e||t)(Ci(vv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Vv{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const zv=new oi("HTTP_INTERCEPTORS");let Uv=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Hv=/^\)\]\}',?\n/;let $v=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new C(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const i=t.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const e=1223===n.status?204:n.status,i=n.statusText||"OK",s=new wv(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return r=new Nv({headers:s,status:e,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),l=null;204!==r&&(l=void 0===n.response?n.responseText:n.response),0===r&&(r=l?200:0);let c=r>=200&&r<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(Hv,"");try{l=""!==l?JSON.parse(l):null}catch(u){l=t,c&&(c=!1,l={error:u,text:l})}}c?(e.next(new Lv({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new jv({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new jv({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});e.error(r)};let l=!1;const c=i=>{l||(e.next(s()),l=!0);let r={type:Dv.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===t.responseType&&!!n.responseText&&(r.partialText=n.responseText),e.next(r)},u=t=>{let n={type:Dv.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),n.addEventListener("timeout",a),n.addEventListener("abort",a),t.reportProgress&&(n.addEventListener("progress",c),null!==i&&n.upload&&n.upload.addEventListener("progress",u)),n.send(i),e.next({type:Dv.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("abort",a),n.removeEventListener("load",o),n.removeEventListener("timeout",a),t.reportProgress&&(n.removeEventListener("progress",c),null!==i&&n.upload&&n.upload.removeEventListener("progress",u)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(Ci(jh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Gv=new oi("XSRF_COOKIE_NAME"),Wv=new oi("XSRF_HEADER_NAME");class qv{}let Xv=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=gh(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(ou),Ci(Gv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Yv=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const i=this.tokenService.getToken();return null!==i&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,i)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(qv),Ci(Wv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Kv=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(zv,[]);this.chain=t.reduceRight((t,e)=>new Vv(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(_v),Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Qv=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:Yv,useClass:Uv}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:Gv,useValue:e.cookieName}:[],e.headerName?{provide:Wv,useValue:e.headerName}:[]]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Yv,{provide:zv,useExisting:Yv,multi:!0},{provide:qv,useClass:Xv},{provide:Gv,useValue:"XSRF-TOKEN"},{provide:Wv,useValue:"X-XSRF-TOKEN"}]}),t})(),Zv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Bv,{provide:vv,useClass:Kv},$v,{provide:_v,useExisting:$v}],imports:[[Qv.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();const Jv=["*"];function t_(t){return Error(`Unable to find icon with the name "${t}"`)}function e_(t){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${t}".`)}function n_(t){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${t}".`)}class i_{constructor(t,e,n){this.url=t,this.svgText=e,this.options=n}}let r_=(()=>{class t{constructor(t,e,n,i){this._httpClient=t,this._sanitizer=e,this._errorHandler=i,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=n}addSvgIcon(t,e,n){return this.addSvgIconInNamespace("",t,e,n)}addSvgIconLiteral(t,e,n){return this.addSvgIconLiteralInNamespace("",t,e,n)}addSvgIconInNamespace(t,e,n,i){return this._addSvgIconConfig(t,e,new i_(n,null,i))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,e,n,i){const r=this._sanitizer.sanitize(yr.HTML,n);if(!r)throw n_(n);return this._addSvgIconConfig(t,e,new i_("",r,i))}addSvgIconSet(t,e){return this.addSvgIconSetInNamespace("",t,e)}addSvgIconSetLiteral(t,e){return this.addSvgIconSetLiteralInNamespace("",t,e)}addSvgIconSetInNamespace(t,e,n){return this._addSvgIconSetConfig(t,new i_(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){const i=this._sanitizer.sanitize(yr.HTML,e);if(!i)throw n_(e);return this._addSvgIconSetConfig(t,new i_("",i,n))}registerFontClassAlias(t,e=t){return this._fontCssClassesByAlias.set(t,e),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const e=this._sanitizer.sanitize(yr.RESOURCE_URL,t);if(!e)throw e_(t);const n=this._cachedIconsByUrl.get(e);return n?wd(s_(n)):this._loadSvgIconFromConfig(new i_(t,null)).pipe($f(t=>this._cachedIconsByUrl.set(e,t)),D(t=>s_(t)))}getNamedSvgIcon(t,e=""){const n=o_(e,t);let i=this._svgIconConfigs.get(n);if(i)return this._getSvgFromConfig(i);if(i=this._getIconConfigFromResolvers(e,t),i)return this._svgIconConfigs.set(n,i),this._getSvgFromConfig(i);const r=this._iconSetConfigs.get(e);return r?this._getSvgFromIconSetConfigs(t,r):ip(t_(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?wd(s_(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(D(t=>s_(t)))}_getSvgFromIconSetConfigs(t,e){const n=this._extractIconWithNameFromAnySet(t,e);return n?wd(n):hv(e.filter(t=>!t.svgText).map(t=>this._loadSvgIconSetFromConfig(t).pipe(pv(e=>{const n=`Loading icon set URL: ${this._sanitizer.sanitize(yr.RESOURCE_URL,t.url)} failed: ${e.message}`;return this._errorHandler.handleError(new Error(n)),wd(null)})))).pipe(D(()=>{const n=this._extractIconWithNameFromAnySet(t,e);if(!n)throw t_(t);return n}))}_extractIconWithNameFromAnySet(t,e){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.svgText&&i.svgText.indexOf(t)>-1){const e=this._svgElementFromConfig(i),n=this._extractSvgIconFromSet(e,t,i.options);if(n)return n}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe($f(e=>t.svgText=e),D(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?wd(null):this._fetchIcon(t).pipe($f(e=>t.svgText=e))}_extractSvgIconFromSet(t,e,n){const i=t.querySelector(`[id="${e}"]`);if(!i)return null;const r=i.cloneNode(!0);if(r.removeAttribute("id"),"svg"===r.nodeName.toLowerCase())return this._setSvgAttributes(r,n);if("symbol"===r.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(r),n);const s=this._svgElementFromString("");return s.appendChild(r),this._setSvgAttributes(s,n)}_svgElementFromString(t){const e=this._document.createElement("DIV");e.innerHTML=t;const n=e.querySelector("svg");if(!n)throw Error(" tag not found");return n}_toSvgElement(t){const e=this._svgElementFromString(""),n=t.attributes;for(let i=0;ithis._inProgressUrlFetches.delete(s)),at());return this._inProgressUrlFetches.set(s,a),a}_addSvgIconConfig(t,e,n){return this._svgIconConfigs.set(o_(t,e),n),this}_addSvgIconSetConfig(t,e){const n=this._iconSetConfigs.get(t);return n?n.push(e):this._iconSetConfigs.set(t,[e]),this}_svgElementFromConfig(t){if(!t.svgElement){const e=this._svgElementFromString(t.svgText);this._setSvgAttributes(e,t.options),t.svgElement=e}return t.svgElement}_getIconConfigFromResolvers(t,e){for(let n=0;ne?e.pathname+e.search:""}}}),u_=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],h_=u_.map(t=>`[${t}]`).join(", "),d_=/^url\(['"]?#(.*?)['"]?\)$/;let p_=(()=>{class t extends l_{constructor(t,e,n,i,r){super(t),this._iconRegistry=e,this._location=i,this._errorHandler=r,this._inline=!1,this._currentIconFetch=g.EMPTY,n||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=md(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){const e=this._cleanupFontValue(t);e!==this._fontSet&&(this._fontSet=e,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const e=this._cleanupFontValue(t);e!==this._fontIcon&&(this._fontIcon=e,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const e=t.split(":");switch(e.length){case 1:return["",e[0]];case 2:return e;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const t=this._location.getPathname();t!==this._previousPath&&(this._previousPath=t,this._prependPathToReferences(t))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const e=t.querySelectorAll("style");for(let i=0;i{e.forEach(e=>{n.setAttribute(e.name,`url('${t}#${e.value}')`)})})}_cacheChildrenWithExternalReferences(t){const e=t.querySelectorAll(h_),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let i=0;i{const r=e[i],s=r.getAttribute(t),o=s?s.match(d_):null;if(o){let e=n.get(r);e||(e=[],n.set(r,e)),e.push({name:t,value:o[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[e,n]=this._splitIconName(t);e&&(this._svgNamespace=e),n&&(this._svgName=n),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(n,e).pipe(Gp(1)).subscribe(t=>this._setSvgElement(t),t=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${e}:${n}! ${t.message}`))})}}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(r_),ii("aria-hidden"),ea(c_),ea(kr))},t.\u0275cmp=Jt({type:t,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,e){2&t&&(Ko("data-mat-icon-type",e._usingFontIcon()?"font":"svg")("data-mat-icon-name",e._svgName||e.fontIcon)("data-mat-icon-namespace",e._svgNamespace||e.fontSet),ja("mat-icon-inline",e.inline)("mat-icon-no-color","primary"!==e.color&&"accent"!==e.color&&"warn"!==e.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[jo],ngContentSelectors:Jv,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:[".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0}),t})(),f_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny],Ny]}),t})();const g_=["mat-button",""],m_=["*"],b_=".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n",y_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],v_=jy(Ly(Fy(class{constructor(t){this._elementRef=t}})));let __=(()=>{class t extends v_{constructor(t,e,n){super(t),this._focusMonitor=e,this._animationMode=n,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const i of y_)this._hasHostAttributes(i)&&this._getHostElement().classList.add(i);t.nativeElement.classList.add("mat-button-base"),this.isRoundButton&&(this.color="accent")}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}focus(t,e){t?this._focusMonitor.focusVia(this._getHostElement(),t,e):this._getHostElement().focus(e)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(t=>this._getHostElement().hasAttribute(t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Ig),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-icon-button",""],["button","mat-fab",""],["button","mat-mini-fab",""],["button","mat-stroked-button",""],["button","mat-flat-button",""]],viewQuery:function(t,e){if(1&t&&qc(Yy,5),2&t){let t;Wc(t=Yc())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,e){2&t&&(Ko("disabled",e.disabled||null),ja("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-button-disabled",e.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[jo],attrs:g_,ngContentSelectors:m_,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,e){1&t&&(wa(),ra(0,"span",0),xa(1),sa(),oa(2,"span",1),oa(3,"span",2)),2&t&&(ws(2),ja("mat-button-ripple-round",e.isRoundButton||e.isIconButton),na("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",e.isIconButton)("matRippleTrigger",e._getHostElement()))},directives:[Yy],styles:[b_],encapsulation:2,changeDetection:0}),t})(),w_=(()=>{class t extends __{constructor(t,e,n){super(e,t,n)}_haltDisabledEvents(t){this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}}return t.\u0275fac=function(e){return new(e||t)(ea(Ig),ea(kl),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["a","mat-button",""],["a","mat-raised-button",""],["a","mat-icon-button",""],["a","mat-fab",""],["a","mat-mini-fab",""],["a","mat-stroked-button",""],["a","mat-flat-button",""]],hostAttrs:[1,"mat-focus-indicator"],hostVars:7,hostBindings:function(t,e){1&t&&fa("click",function(t){return e._haltDisabledEvents(t)}),2&t&&(Ko("tabindex",e.disabled?-1:e.tabIndex||0)("disabled",e.disabled||null)("aria-disabled",e.disabled.toString()),ja("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-button-disabled",e.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex"},exportAs:["matButton","matAnchor"],features:[jo],attrs:g_,ngContentSelectors:m_,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,e){1&t&&(wa(),ra(0,"span",0),xa(1),sa(),oa(2,"span",1),oa(3,"span",2)),2&t&&(ws(2),ja("mat-button-ripple-round",e.isRoundButton||e.isIconButton),na("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",e.isIconButton)("matRippleTrigger",e._getHostElement()))},directives:[Yy],styles:[b_],encapsulation:2,changeDetection:0}),t})(),x_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Ny],Ny]}),t})();class S_ extends v{notifyNext(t,e,n,i,r){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}class E_ extends v{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function C_(t,e,n,i,r=new E_(t,n,i)){if(!r.closed)return e instanceof C?e.subscribe(r):V(e)(r)}const O_={};function T_(...t){let e,n;return M(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&d(t[0])&&(t=t[0]),K(t,n).lift(new k_(e))}class k_{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new A_(t,this.resultSelector))}}class A_ extends S_{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(O_),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n{class t{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):D_}matchMedia(t){return this._platform.WEBKIT&&function(t){if(!P_.has(t))try{I_||(I_=document.createElement("style"),I_.setAttribute("type","text/css"),document.head.appendChild(I_)),I_.sheet&&(I_.sheet.insertRule(`@media ${t} {.fx-query-test{ }}`,0),P_.add(t))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp))},token:t,providedIn:"root"}),t})();function D_(t){return{matches:"all"===t||""===t,media:t,addListener:()=>{},removeListener:()=>{}}}let R_=(()=>{class t{constructor(t,e){this._mediaMatcher=t,this._zone=e,this._queries=new Map,this._destroySubject=new P}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return N_(yd(t)).some(t=>this._registerQuery(t).mql.matches)}observe(t){let e=T_(N_(yd(t)).map(t=>this._registerQuery(t).observable));return e=Yd(e.pipe(Gp(1)),e.pipe(Qf(1),qf(0))),e.pipe(D(t=>{const e={matches:!1,breakpoints:{}};return t.forEach(({matches:t,query:n})=>{e.matches=e.matches||t,e.breakpoints[n]=t}),e}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const e=this._mediaMatcher.matchMedia(t),n={observable:new C(t=>{const n=e=>this._zone.run(()=>t.next(e));return e.addListener(n),()=>{e.removeListener(n)}}).pipe(Kd(e),D(({matches:e})=>({query:t,matches:e})),Wd(this._destroySubject)),mql:e};return this._queries.set(t,n),n}}return t.\u0275fac=function(e){return new(e||t)(Ci(M_),Ci(xu))},t.\u0275prov=xt({factory:function(){return new t(Ci(M_),Ci(xu))},token:t,providedIn:"root"}),t})();function N_(t){return t.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}function L_(t,e){if(1&t){const t=ua();ra(0,"div",1),ra(1,"button",2),fa("click",function(){return $e(t),va().action()}),Za(2),sa(),sa()}if(2&t){const t=va();ws(2),Ja(t.data.action)}}function j_(t,e){}const F_=new oi("MatSnackBarData");class B_{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const V_=Math.pow(2,31)-1;class z_{constructor(t,e){this._overlayRef=e,this._afterDismissed=new P,this._afterOpened=new P,this._onAction=new P,this._dismissedByAction=!1,this.containerInstance=t,this.onAction().subscribe(()=>this.dismiss()),t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,V_))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}let U_=(()=>{class t{constructor(t,e){this.snackBarRef=t,this.data=e}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return t.\u0275fac=function(e){return new(e||t)(ea(z_),ea(F_))},t.\u0275cmp=Jt({type:t,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,e){1&t&&(ra(0,"span"),Za(1),sa(),Jo(2,L_,3,1,"div",0)),2&t&&(ws(1),Ja(e.data.message),ws(1),na("ngIf",e.hasAction))},directives:[_h,__],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),t})();const H_={snackBarState:Vg("state",[$g("void, hidden",Hg({transform:"scale(0.8)",opacity:0})),$g("visible",Hg({transform:"scale(1)",opacity:1})),Wg("* => visible",zg("150ms cubic-bezier(0, 0, 0.2, 1)")),Wg("* => void, * => hidden",zg("75ms cubic-bezier(0.4, 0.0, 1, 1)",Hg({opacity:0})))])};let $_=(()=>{class t extends Fp{constructor(t,e,n,i,r){super(),this._ngZone=t,this._elementRef=e,this._changeDetectorRef=n,this._platform=i,this.snackBarConfig=r,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new P,this._onExit=new P,this._onEnter=new P,this._animationState="void",this.attachDomPortal=t=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(t)),this._live="assertive"!==r.politeness||r.announcementMessage?"off"===r.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(t)}onAnimationEnd(t){const{fromState:e,toState:n}=t;if(("void"===n&&"void"!==e||"hidden"===n)&&this._completeExit(),"visible"===n){const t=this._onEnter;this._ngZone.run(()=>{t.next(),t.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}ngOnDestroy(){this._destroyed=!0,this._completeExit()}_completeExit(){this._ngZone.onMicrotaskEmpty.pipe(Gp(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,e=this.snackBarConfig.panelClass;e&&(Array.isArray(e)?e.forEach(e=>t.classList.add(e)):t.classList.add(e)),"center"===this.snackBarConfig.horizontalPosition&&t.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&t.classList.add("mat-snack-bar-top")}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),e=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&e){let n=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(n=document.activeElement),t.removeAttribute("aria-hidden"),e.appendChild(t),null==n||n.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(kl),ea(tc),ea(pp),ea(B_))},t.\u0275cmp=Jt({type:t,selectors:[["snack-bar-container"]],viewQuery:function(t,e){if(1&t&&qc(Up,7),2&t){let t;Wc(t=Yc())&&(e._portalOutlet=t.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,e){1&t&&ga("@state.done",function(t){return e.onAnimationEnd(t)}),2&t&&rl("@state",e._animationState)},features:[jo],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,e){1&t&&(ra(0,"div",0),Jo(1,j_,0,0,"ng-template",1),sa(),oa(2,"div")),2&t&&(ws(2),Ko("aria-live",e._live)("role",e._role))},directives:[Up],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[H_.snackBarState]}}),t})(),G_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rf,Hp,Rh,x_,Ny],Ny]}),t})();const W_=new oi("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new B_}});let q_=(()=>{class t{constructor(t,e,n,i,r,s){this._overlay=t,this._live=e,this._injector=n,this._breakpointObserver=i,this._parentSnackBar=r,this._defaultConfig=s,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=U_,this.snackBarContainerComponent=$_,this.handsetCssClass="mat-snack-bar-handset"}get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}openFromComponent(t,e){return this._attach(t,e)}openFromTemplate(t,e){return this._attach(t,e)}open(t,e="",n){const i=Object.assign(Object.assign({},this._defaultConfig),n);return i.data={message:t,action:e},i.announcementMessage===t&&(i.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,i)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,e){const n=No.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:B_,useValue:e}]}),i=new Np(this.snackBarContainerComponent,e.viewContainerRef,n),r=t.attach(i);return r.instance.snackBarConfig=e,r.instance}_attach(t,e){const n=Object.assign(Object.assign(Object.assign({},new B_),this._defaultConfig),e),i=this._createOverlay(n),r=this._attachSnackBarContainer(i,n),s=new z_(r,i);if(t instanceof sc){const e=new Lp(t,null,{$implicit:n.data,snackBarRef:s});s.instance=r.attachTemplatePortal(e)}else{const e=this._createInjector(n,s),i=new Np(t,void 0,e),o=r.attachComponentPortal(i);s.instance=o.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(Wd(i.detachments())).subscribe(t=>{const e=i.overlayElement.classList;t.matches?e.add(this.handsetCssClass):e.remove(this.handsetCssClass)}),n.announcementMessage&&r._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(s,n),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(t,e){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),e.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),e.duration&&e.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(e.duration))}_createOverlay(t){const e=new af;e.direction=t.direction;let n=this._overlay.position().global();const i="rtl"===t.direction,r="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!i||"end"===t.horizontalPosition&&i,s=!r&&"center"!==t.horizontalPosition;return r?n.left("0"):s?n.right("0"):n.centerHorizontally(),"top"===t.verticalPosition?n.top("0"):n.bottom("0"),e.positionStrategy=n,this._overlay.create(e)}_createInjector(t,e){return No.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:z_,useValue:e},{provide:F_,useValue:t.data}]})}}return t.\u0275fac=function(e){return new(e||t)(Ci(kf),Ci(kg),Ci(No),Ci(R_),Ci(t,12),Ci(W_))},t.\u0275prov=xt({factory:function(){return new t(Ci(kf),Ci(kg),Ci(_o),Ci(R_),Ci(t,12),Ci(W_))},token:t,providedIn:G_}),t})();const X_={tooltipState:Vg("state",[$g("initial, void, hidden",Hg({opacity:0,transform:"scale(0)"})),$g("visible",Hg({transform:"scale(1)"})),Wg("* => visible",zg("200ms cubic-bezier(0, 0, 0.2, 1)",Gg([Hg({opacity:0,transform:"scale(0)",offset:0}),Hg({opacity:.5,transform:"scale(0.99)",offset:.5}),Hg({opacity:1,transform:"scale(1)",offset:1})]))),Wg("* => hidden",zg("100ms cubic-bezier(0, 0, 0.2, 1)",Hg({opacity:0})))])},Y_="tooltip-panel",K_=_p({passive:!0}),Q_=new oi("mat-tooltip-scroll-strategy"),Z_={provide:Q_,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition({scrollThrottle:20})}},J_=new oi("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let tw=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u,h){this._overlay=t,this._elementRef=e,this._scrollDispatcher=n,this._viewContainerRef=i,this._ngZone=r,this._platform=s,this._ariaDescriber=o,this._focusMonitor=a,this._dir=c,this._defaultOptions=u,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new P,this._handleKeydown=t=>{this._isTooltipVisible()&&27===t.keyCode&&!Qp(t)&&(t.preventDefault(),t.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=l,this._document=h,u&&(u.position&&(this.position=u.position),u.touchGestures&&(this.touchGestures=u.touchGestures)),c.change.pipe(Wd(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),r.runOutsideAngular(()=>{e.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var e;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(e=this._tooltipInstance)||void 0===e||e.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}get message(){return this._message}set message(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")})}))}get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(Wd(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),t.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(([e,n])=>{t.removeEventListener(e,n,K_)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay){if(this.disabled||!this.message||this._isTooltipVisible()&&!this._tooltipInstance._showTimeoutId&&!this._tooltipInstance._hideTimeoutId)return;const e=this._createOverlay();this._detach(),this._portal=this._portal||new Np(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=e.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(Wd(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}hide(t=this.hideDelay){this._tooltipInstance&&this._tooltipInstance.hide(t)}toggle(){this._isTooltipVisible()?this.hide():this.show()}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(){if(this._overlayRef)return this._overlayRef;const t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),e=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return e.positionChanges.pipe(Wd(this._destroyed)).subscribe(t=>{this._updateCurrentPositionClass(t.connectionPair),this._tooltipInstance&&t.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:e,panelClass:`${this._cssClassPrefix}-${Y_}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Wd(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Wd(this._destroyed)).subscribe(()=>{var t;return null===(t=this._tooltipInstance)||void 0===t?void 0:t._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const e=t.getConfig().positionStrategy,n=this._getOrigin(),i=this._getOverlayPosition();e.withPositions([this._addOffset(Object.assign(Object.assign({},n.main),i.main)),this._addOffset(Object.assign(Object.assign({},n.fallback),i.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,e=this.position;let n;"above"==e||"below"==e?n={originX:"center",originY:"above"==e?"top":"bottom"}:"before"==e||"left"==e&&t||"right"==e&&!t?n={originX:"start",originY:"center"}:("after"==e||"right"==e&&t||"left"==e&&!t)&&(n={originX:"end",originY:"center"});const{x:i,y:r}=this._invertPosition(n.originX,n.originY);return{main:n,fallback:{originX:i,originY:r}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,e=this.position;let n;"above"==e?n={overlayX:"center",overlayY:"bottom"}:"below"==e?n={overlayX:"center",overlayY:"top"}:"before"==e||"left"==e&&t||"right"==e&&!t?n={overlayX:"end",overlayY:"center"}:("after"==e||"right"==e&&t||"left"==e&&!t)&&(n={overlayX:"start",overlayY:"center"});const{x:i,y:r}=this._invertPosition(n.overlayX,n.overlayY);return{main:n,fallback:{overlayX:i,overlayY:r}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(Gp(1),Wd(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,e){return"above"===this.position||"below"===this.position?"top"===e?e="bottom":"bottom"===e&&(e="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){const{overlayY:e,originX:n,originY:i}=t;let r;if(r="center"===e?this._dir&&"rtl"===this._dir.value?"end"===n?"left":"right":"start"===n?"left":"right":"bottom"===e&&"top"===i?"above":"below",r!==this._currentPosition){const t=this._overlayRef;if(t){const e=`${this._cssClassPrefix}-${Y_}-`;t.removePanelClass(e+this._currentPosition),t.addPanelClass(e+r)}this._currentPosition=r}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",()=>{this._setupPointerExitEventsIfNeeded(),this.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",()=>{this._setupPointerExitEventsIfNeeded(),clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>this.show(),500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",()=>this.hide()],["wheel",t=>this._wheelListener(t)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const e=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",e],["touchcancel",e])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([t,e])=>{this._elementRef.nativeElement.addEventListener(t,e,K_)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const e=this._document.elementFromPoint(t.clientX,t.clientY),n=this._elementRef.nativeElement;e!==n&&!n.contains(e)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const e=this._elementRef.nativeElement,n=e.style;("on"===t||"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName)&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),("on"===t||!e.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(Pp),ea(hc),ea(xu),ea(pp),ea(hg),ea(Ig),ea(void 0),ea(Op),ea(void 0),ea(Yu))},t.\u0275dir=se({type:t,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),t})(),ew=(()=>{class t extends tw{constructor(t,e,n,i,r,s,o,a,l,c,u,h){super(t,e,n,i,r,s,o,a,l,c,u,h),this._tooltipComponent=iw}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(Pp),ea(hc),ea(xu),ea(pp),ea(hg),ea(Ig),ea(Q_),ea(Op,8),ea(J_,8),ea(Yu))},t.\u0275dir=se({type:t,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[jo]}),t})(),nw=(()=>{class t{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new P}show(t){clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(()=>{this._visibility="visible",this._showTimeoutId=void 0,this._onShow(),this._markForCheck()},t)}hide(t){clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._visibility="hidden",this._hideTimeoutId=void 0,this._markForCheck()},t)}afterHidden(){return this._onHide}isVisible(){return"visible"===this._visibility}ngOnDestroy(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}_animationStart(){this._closeOnInteraction=!1}_animationDone(t){const e=t.toState;"hidden"===e&&!this.isVisible()&&this._onHide.next(),("visible"===e||"hidden"===e)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return t.\u0275fac=function(e){return new(e||t)(ea(tc))},t.\u0275dir=se({type:t}),t})(),iw=(()=>{class t extends nw{constructor(t,e){super(t),this._breakpointObserver=e,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(R_))},t.\u0275cmp=Jt({type:t,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,e){2&t&&La("zoom","visible"===e._visibility?1:null)},features:[jo],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,e){if(1&t&&(ra(0,"div",0),fa("@state.start",function(){return e._animationStart()})("@state.done",function(t){return e._animationDone(t)}),Ic(1,"async"),Za(2),sa()),2&t){let t;ja("mat-tooltip-handset",null==(t=Mc(1,5,e._isHandset))?null:t.matches),na("ngClass",e.tooltipClass)("@state",e._visibility),ws(2),Ja(e.message)}},directives:[mh],pipes:[Dh],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[X_.tooltipState]},changeDetection:0}),t})(),rw=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Z_],imports:[[Lg,Rh,Rf,Ny],Ny,Mp]}),t})();function sw(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}function ow(t,e){return function(n,i){e(n,i,t)}}function aw(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function lw(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(e){s(e)}}function a(t){try{l(i.throw(t))}catch(e){s(e)}}function l(t){t.done?r(t.value):function(t){return t instanceof n?t:new n(function(e){e(t)})}(t.value).then(o,a)}l((i=i.apply(t,e||[])).next())})}function cw(t){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)}function uw(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||cw()}const hw="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",dw=uw();class pw{constructor(t,e,n="sessionStorage"){this.storage=function(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(t){return null}}(n),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){return this.config={},this.updateConfiguration(t)}updateConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function fw(t,e,n,i=600){const r=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>i&&(n=Math.min(n,i/t.width));const s=t.width*n,o=t.height*n,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const gw={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function mw(t){return"string"==typeof t?gw[t.toUpperCase()]||gw.WHITE:t}function bw(t,e){if(!t)throw new Error(e||"Assertion failed")}const yw={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},vw=yw.window||yw.self||yw.global,_w=yw.process||{};function ww(){let t;if(dw&&vw.performance)t=vw.performance.now();else if(_w.hrtime){const e=_w.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}console;const xw={debug:dw&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Sw={enabled:!0,level:0};function Ew(){}const Cw={},Ow={once:!0};function Tw(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}let kw=(()=>{class t{constructor({id:t}={id:""}){this.id=t,this.VERSION=hw,this._startTs=ww(),this._deltaTs=ww(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new pw("__probe-".concat(this.id,"__"),Sw),this.userData={},this.timeStamp("".concat(this.id," started")),function(t,e=["constructor"]){const n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n);for(const r of i)"function"==typeof t[r]&&(e.find(t=>r===t)||(t[r]=t[r].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((ww()-this._startTs).toPrecision(10))}getDelta(){return Number((ww()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,e){bw(t,e)}warn(t){return this._getLogFunction(0,t,xw.warn,arguments,Ow)}error(t){return this._getLogFunction(0,t,xw.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,xw.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,xw.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,xw.debug||xw.info,arguments,Ow)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||Ew,n&&[n],{tag:Tw(e)}):Ew}image({logLevel:t,priority:e,image:i,message:r="",scale:s=1}){return this._shouldLog(t||e)?dw?function({image:t,message:e="",scale:n=1}){if("string"==typeof t){const i=new Image;return i.onload=()=>{const t=fw(i,e,n);console.log(...t)},i.src=t,Ew}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...fw(t,e,n)),Ew;if("canvas"===i.toLowerCase()){const i=new Image;return i.onload=()=>console.log(...fw(i,e,n)),i.src=t.toDataURL(),Ew}return Ew}({image:i,message:r,scale:s}):function({image:t,message:e="",scale:r=1}){let s=null;try{s=n(75307)}catch(i){}return s?()=>s(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(t=>console.log(t)):Ew}({image:i,message:r,scale:s}):Ew}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,e){this._storage.updateConfiguration({[t]:e})}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||Ew)}group(t,e,n={collapsed:!1}){n=Pw({logLevel:t,message:e,opts:n});const{collapsed:i}=n;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,e,n={}){return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Ew)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Aw(t)}_getLogFunction(t,e,n,i=[],r){if(this._shouldLog(t)){r=Pw({logLevel:t,message:e,args:i,opts:r}),bw(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=ww();const s=r.tag||r.message;if(r.once){if(Cw[s])return Ew;Cw[s]=ww()}return e=function(t,e,n){if("string"==typeof e){const i=n.time?function(t,e=8){const n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(n.total)):"";e=function(t,e,n){return!dw&&"string"==typeof t&&(e&&(e=mw(e),t="\x1b[".concat(e,"m").concat(t,"\x1b[39m")),n&&(e=mw(n),t="\x1b[".concat(n+10,"m").concat(t,"\x1b[49m"))),t}(e=n.time?"".concat(t,": ").concat(i," ").concat(e):"".concat(t,": ").concat(e),n.color,n.background)}return e}(this.id,r.message,r),n.bind(console,e,...r.args)}return Ew}}return t.VERSION=hw,t})();function Aw(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return bw(Number.isFinite(e)&&e>=0),e}function Pw(t){const{logLevel:e,message:n}=t;t.logLevel=Aw(e);const i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==n;);switch(t.args=i,typeof e){case"string":case"function":void 0!==n&&i.unshift(n),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());const r=typeof t.message;return bw("string"===r||"object"===r),Object.assign(t,t.opts)}var Iw=new kw({id:"deck"});const Mw={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mw,"IDENTITY",{get:()=>Iw.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Dw={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Rw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Nw=new kw({id:"luma.gl"});function Lw(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function jw(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version))}function Fw(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function Bw(t){return Lw(jw(t),"Invalid WebGLRenderingContext"),t}function Vw(t){return Lw(Fw(t),"Requires WebGL2"),t}var zw=n(84761);const Uw={};const Hw=function t(e){const n=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{zw.CO.console&&zw.CO.console.log&&zw.CO.console.log("OESVertexArrayObject emulation library context restored"),e.reset_()},!0),this.reset_()};$w.prototype.VERTEX_ARRAY_BINDING_OES=34229,$w.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;tFw(t)?void 0:0,Yw={3074:t=>Fw(t)?void 0:36064,35723:t=>Fw(t)?void 0:4352,35977:Xw,32937:Xw,36795:(t,e)=>{const n=Fw(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?e(n.GPU_DISJOINT_EXT):0},37445:(t,e)=>{const n=t.getExtension(qw);return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const n=t.getExtension(qw);return e(n&&n.UNMASKED_RENDERER_WEBGL||7937)},34047:(t,e)=>{const n=t.luma.extensions.EXT_texture_filter_anisotropic;return n?e(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:Xw,35071:Xw,37447:Xw,36063:(t,e)=>{if(!Fw(t)){const n=t.getExtension(Ww);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Xw,35374:Xw,35377:Xw,34852:t=>{if(!Fw(t)){const e=t.getExtension(Ww);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(Gw)?2147483647:65535,33001:t=>t.getExtension(Gw)?16777216:65535,33e3:t=>16777216,37157:Xw,35373:Xw,35657:Xw,36183:Xw,37137:Xw,34045:Xw,35978:Xw,35979:Xw,35968:Xw,35376:Xw,35375:Xw,35659:Xw,37154:Xw,35371:Xw,35658:Xw,35076:Xw,35077:Xw,35380:Xw},Kw="ANGLE_instanced_arrays",Qw={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Lw(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[Kw]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){Lw(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Lw(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Lw(!1)},deleteQuery:()=>{Lw(!1)},beginQuery:()=>{Lw(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},Zw={readBuffer:(t,e,n)=>{Fw(t)&&e(n)},getVertexAttrib:(t,e,n,i)=>{const{webgl2:r,ext:s}=function(t,e){return{webgl2:Fw(t),ext:t.getExtension("ANGLE_instanced_arrays")}}(t);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(n,i)},getProgramParameter:(t,e,n,i)=>{if(!Fw(t))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,i)},getInternalformatParameter:(t,e,n,i,r)=>{if(!Fw(t))switch(r){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(n,i,r)},getTexParameter(t,e,n,i){switch(i){case 34046:const{extensions:e}=t.luma,n=e.EXT_texture_filter_anisotropic;i=n&&n.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(n,i)},getParameter:function(t,e,n){const i=Yw[n],r="function"==typeof i?i(t,e,n):i;return void 0!==r?r:e(n)},hint:(t,e,n,i)=>e(n,i)};function Jw(t,{extension:e,target:n,target2:i}){const r=Qw[e];Lw(r);const{meta:s={}}=r,{suffix:o=""}=s,a=t.getExtension(e);for(const l of Object.keys(r)){const e=`${l}${o}`;let s=null;"meta"===l||"function"==typeof t[l]||(a&&"function"==typeof a[e]?s=(...t)=>a[e](...t):"function"==typeof r[l]&&(s=r[l].bind(n))),s&&(n[l]=s,i[l]=s)}}("undefined"!=typeof global?global:window).polyfillContext=function(t){t.luma=t.luma||{};const{luma:e}=t;return e.polyfilled||(function(t){if("function"==typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const n=t.getExtension;t.getExtension=function(e){return n.call(this,e)||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new $w(this)),this.__OESVertexArrayObject))}}(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const n of e)t.luma[n]=t.getExtension(n)}(t),function(t,e){for(const n of Object.getOwnPropertyNames(e))"overrides"!==n&&Jw(t,{extension:n,target:t.luma,target2:t})}(t,Qw),function(t,{target:e,target2:n}){Object.keys(Zw).forEach(i=>{if("function"==typeof Zw[i]){const r=t[i]?t[i].bind(t):()=>{},s=Zw[i].bind(null,t,r);e[i]=s,n[i]=s}})}(t,{target:e,target2:t}),e.polyfilled=!0),t};const tx={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ex=(t,e,n)=>e?t.enable(n):t.disable(n),nx=(t,e,n)=>t.hint(n,e),ix=(t,e,n)=>t.pixelStorei(n,e);function rx(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const sx={3042:ex,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:ex,2885:(t,e)=>t.cullFace(e),2929:ex,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:ex,35723:nx,36006:(t,e)=>{const n=Fw(t)?36009:36160;return t.bindFramebuffer(n,e)},2886:(t,e)=>t.frontFace(e),33170:nx,2849:(t,e)=>t.lineWidth(e),32823:ex,32824:"polygonOffset",10752:"polygonOffset",35977:ex,32938:"sampleCoverage",32939:"sampleCoverage",3089:ex,3088:(t,e)=>t.scissor(...e),2960:ex,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:ix,3317:ix,37440:ix,37441:ix,37443:ix,3330:ix,3332:ix,3331:ix,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:ix,32878:ix,3316:ix,3315:ix,32877:ix,framebuffer:(t,e)=>t.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=rx(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=rx(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=rx(e)?e:[e,e];const[n,i]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=rx(e)&&3===e.length?[...e,...e]:e;const[n,i,r,s,o,a]=e;t.stencilFuncSeparate(1028,n,i,r),t.stencilFuncSeparate(1029,s,o,a)},stencilOp:(t,e)=>{e=rx(e)&&3===e.length?[...e,...e]:e;const[n,i,r,s,o,a]=e;t.stencilOpSeparate(1028,n,i,r),t.stencilOpSeparate(1029,s,o,a)},viewport:(t,e)=>t.viewport(...e)};function ox(t,e,n){return void 0!==e[t]?e[t]:n[t]}const ax={blendEquation:(t,e,n)=>t.blendEquationSeparate(ox(32777,e,n),ox(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(ox(32969,e,n),ox(32968,e,n),ox(32971,e,n),ox(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(ox(32824,e,n),ox(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(ox(32938,e,n),ox(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,ox(2962,e,n),ox(2967,e,n),ox(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,ox(34816,e,n),ox(36003,e,n),ox(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,ox(2964,e,n),ox(2965,e,n),ox(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,ox(34817,e,n),ox(34818,e,n),ox(34819,e,n))},lx={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},blendColor:(t,e,n,i,r)=>t({32773:new Float32Array([e,n,i,r])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,i,r)=>t({32969:e,32968:n,32971:i,32970:r}),clearColor:(t,e,n,i,r)=>t({3106:new Float32Array([e,n,i,r])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,i,r)=>t({3107:[e,n,i,r]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,i,r)=>t({3088:new Int32Array([e,n,i,r])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[1028===e?2968:36005]:n}),stencilFunc:(t,e,n,i)=>t({2962:e,2967:n,2963:i,34816:e,36003:n,36004:i}),stencilFuncSeparate:(t,e,n,i,r)=>t({[1028===e?2962:34816]:n,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(t,e,n,i)=>t({2964:e,2965:n,2966:i,34817:e,34818:n,34819:i}),stencilOpSeparate:(t,e,n,i,r)=>t({[1028===e?2964:34817]:n,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(t,e,n,i,r)=>t({2978:[e,n,i,r]})},cx=(t,e)=>t.isEnabled(e),ux={3042:cx,2884:cx,2929:cx,3024:cx,32823:cx,32926:cx,32928:cx,3089:cx,2960:cx,35977:cx};function hx(t){for(const e in t)return!1;return!0}function dx(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&i&&t.length===e.length){for(let n=0;n{})}={}){this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?function(t,e){if("number"==typeof(e=e||tx)){const n=e,i=ux[n];return i?i(t,n):t.getParameter(n)}const n=Array.isArray(e)?e:Object.keys(e),i={};for(const r of n){const e=ux[r];i[r]=e?e(t,Number(r)):t.getParameter(Number(r))}return i}(t):Object.assign({},tx),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(t={}){this.stateStack.push({})}pop(){Lw(this.stateStack.length>0),yx(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(t){let e,n=!1;const i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const r in t){Lw(void 0!==r);const s=t[r],o=this.cache[r];dx(s,o)||(n=!0,e=o,i&&!(r in i)&&(i[r]=o),this.cache[r]=s)}return{valueChanged:n,oldValue:e}}}function mx(t,e={}){const{enable:n=!0,copyState:i}=e;if(Lw(void 0!==i),!t.state){const e="undefined"!=typeof global?global:window,{polyfillContext:n}=e;n&&n(t),t.state=new gx(t,{copyState:i}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(e(n),t.state.program=n)}}(t);for(const i in lx)fx(t,i,lx[i]);px(t,"getParameter"),px(t,"isEnabled")}return t.state.enable=n,t}function bx(t){Lw(t.state),t.state.pop()}function yx(t,e){if(Lw(jw(t),"setParameters requires a WebGL context"),hx(e))return;const n={};for(const r in e){const i=Number(r),s=sx[r];s&&("string"==typeof s?n[s]=!0:s(t,e[r],i))}const i=t.state&&t.state.cache;if(i)for(const r in n)ax[r](t,e,i)}function vx(t,e,n){if(hx(e))return n(t);const{nocatch:i=!0}=e;let r;if(function(t){t.state||mx(t,{copyState:!1}),t.state.push()}(t),yx(t,e),i)r=n(t),bx(t);else try{r=n(t)}finally{bx(t)}return r}function _x(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:n}=e.canvasSizeInfo;return n?t.drawingBufferWidth/n:1}return 1}function wx(t,e,n=!0){return function(t,e,n,i,r){const s=xx(t[0],e,n);let o=Sx(t[1],e,i,r),a=xx(t[0]+1,e,n);const l=a===n-1?a:a-1;let c;return a=Sx(t[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,_x(t),t.drawingBufferWidth,t.drawingBufferHeight,n)}function xx(t,e,n){return Math.min(Math.round(t*e),n-1)}function Sx(t,e,n,i){return i?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const Ex=(0,zw.jU)(),Cx=Ex&&"undefined"!=typeof document,Ox={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Tx(t={}){Lw(Ex,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},Ox,t);const{width:e,height:n}=t;function i(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let r;t.onError=i;const{canvas:s}=t,o=function({canvas:t,width:e=800,height:n=600,onError:i}){let r;return"string"==typeof t?(Cx&&"complete"===document.readyState||i(`createGLContext called on canvas '${t}' before page was loaded`),r=document.getElementById(t)):t?r=t:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(n)?`${n}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:n,onError:i});return r=function(t,e){const{onError:n}=e;let i=null;const r=t=>i=t.statusMessage||i;t.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||t.getContext("webgl2",e),a=a||t.getContext("experimental-webgl2",e)),s&&(a=a||t.getContext("webgl",e),a=a||t.getContext("experimental-webgl",e)),t.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):n(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,t),r?(r=kx(r,t),function(t){const e=Fw(t)?"WebGL2":"WebGL1",n=function(t){const e=t.getParameter(7936),n=t.getParameter(7937),i=t.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&t.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&t.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:e,rendererMasked:n,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t);Nw.info(1,`${e}${t.debug?" debug":""} context ${n?`(${n.vendor},${n.renderer})`:""}`)()}(r),r):null}function kx(t,e={}){if(!t||t._instrumented)return t;t._version=t._version||function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext?2:1}(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},Ox,e);const{manageState:n,debug:i}=e;return n&&mx(t,{copyState:!1,log:(...t)=>Nw.log(1,...t)()}),Ex&&i&&(zw.CO.makeDebugContext?(t=zw.CO.makeDebugContext(t,e),Nw.level=Math.max(Nw.level,1)):Nw.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function Ax(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}class Px{constructor(t,e){this.name=t,this.type=e,this.sampleSize=1,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ax(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ax()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class Ix{constructor({id:t,stats:e}){this.id=t,this.stats={},this._initializeStats(e),Object.seal(this)}get(t,e="count"){return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach(e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(t=>this._getOrCreate(t))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:n}=t;return this.stats[e]||(this.stats[e]=t instanceof Px?t:new Px(e,n)),this.stats[e]}}const Mx="8.5.7",Dx=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new Ix({id:t})),this.stats.get(t)}};if(zw.CO.luma&&zw.CO.luma.VERSION!==Mx)throw new Error(`luma.gl - multiple VERSIONs detected: ${zw.CO.luma.VERSION} vs 8.5.7`);function Rx(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Nx(t,e){if("string"!=typeof e)return e;const n=Number(e);if(!isNaN(n))return n;const i=t[e=e.replace(/^.*\./,"")];return Rx(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Lx(t,e){e=Number(e);for(const n in t)if(t[n]===e)return`GL.${n}`;return String(e)}zw.CO.luma||((0,zw.jU)()&&Nw.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),zw.CO.luma=zw.CO.luma||{VERSION:Mx,version:Mx,log:Nw,stats:Dx,globals:{modules:{},nodeIO:{}}});const jx={};function Fx(t="id"){return jx[t]=jx[t]||1,`${t}-${jx[t]++}`}function Bx(t){return Rx("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function Vx(t){let e=!0;for(const n in t){e=!1;break}return e}function zx(t,e,n,i){const r=`See luma.gl ${n} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(t);i.forEach(t=>{s.methodName||(s[t]=()=>{throw Nw.removed(`Calling removed method ${e}.${t}: `,r)(),new Error(t)})})}const Ux="Resource subclass must define virtual methods";class Hx{constructor(t,e={}){Bw(t);const{id:n,userData:i={}}=e;this.gl=t,this.gl2=t,this.id=n||Fx(this.constructor.name),this.userData=i,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:t=!1}={}){const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEach(t=>t.delete()),this}bind(t=this.handle){if("function"!=typeof t)return this._bindHandle(t),this;let e;return this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e}unbind(){this.bind(null)}getParameter(t,e={}){Rx(t=Nx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Fw(this.gl);if("webgl2"in n&&!t||"extension"in n&&!this.gl.getExtension(n.extension)){const e=n.webgl1,i="webgl2"in n?n.webgl2:n.webgl1;return t?i:e}}return this._getParameter(t,e)}getParameters(t={}){const{parameters:e,keys:n}=t,i=this.constructor.PARAMETERS||{},r=Fw(this.gl),s={},o=e||Object.keys(i);for(const a of o){const e=i[a];if(e&&(!("webgl2"in e)||r)&&(!("extension"in e)||this.gl.getExtension(e.extension))){const i=n?Lx(this.gl,a):a;s[i]=this.getParameter(a,t),n&&"GLenum"===e.type&&(s[i]=Lx(this.gl,s[i]))}}return s}setParameter(t,e){Rx(t=Nx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Fw(this.gl);if("webgl2"in n&&!t||"extension"in n&&!this.gl.getExtension(n.extension))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(e=Nx(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,n){return zx(this,t,e,n)}initialize(t){}_createHandle(){throw new Error(Ux)}_deleteHandle(){throw new Error(Ux)}_bindHandle(t){throw new Error(Ux)}_getOptsFromHandle(){throw new Error(Ux)}_getParameter(t,e){throw new Error(Ux)}_setParameter(t,e){throw new Error(Ux)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this.constructor.name,e=Dx.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}_removeStats(){const t=this.constructor.name;Dx.get("Resource Counts").get(`${t}s Active`).decrementCount()}_trackAllocatedMemory(t,e=this.constructor.name){const n=Dx.get("Memory Usage");n.get("GPU Memory").addCount(t),n.get(`${e} Memory`).addCount(t),this.byteLength=t}_trackDeallocatedMemory(t=this.constructor.name){const e=Dx.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get(`${t} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function $x(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Gx(t,{clamped:e=!0}={}){switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function Wx({data:t,width:e,height:n}){const i=Math.round(e/2),r=Math.round(n/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Kx.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Kx.getBytesPerVertex(this)}_assign(t={}){return void 0!==(t=qx("Accessor",t,Yx)).type&&(this.type=t.type,(5124===t.type||5125===t.type)&&(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&(this.index="boolean"==typeof t.index?t.index?1:0:t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}const Qx={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},Zx={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Qx},Jx={removedProps:Qx};class tS extends Hx{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(t=this.accessor){return Math.round(this.byteLength/Kx.getBytesPerElement(t))}getVertexCount(t=this.accessor){return Math.round(this.byteLength/Kx.getBytesPerVertex(t))}initialize(t={}){return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=qx("Buffer",t,Zx),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=qx("Buffer",t,Jx))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new Kx(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:n=0,srcOffset:i=0}=t,r=t.byteLength||t.length;Rx(e);const s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==i||void 0!==r?(Vw(this.gl),this.gl.bufferSubData(this.target,n,e,i,r)):this.gl.bufferSubData(s,n,e),this.gl.bindBuffer(s,null),this.debugData=null,this._inferType(e),this}copyData({sourceBuffer:t,readOffset:e=0,writeOffset:n=0,size:i}){const{gl:r}=this;return Vw(r),r.bindBuffer(36662,t.handle),r.bindBuffer(36663,this.handle),r.copyBufferSubData(36662,36663,e,n,i),r.bindBuffer(36662,null),r.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:t=null,srcByteOffset:e=0,dstOffset:n=0,length:i=0}={}){Vw(this.gl);const r=Gx(this.accessor.type||5126,{clamped:!1}),s=this._getAvailableElementCount(e),o=n;let a,l;t?(l=t.length,a=l-o):(a=Math.min(s,i||s),l=o+a);const c=Math.min(s,a);return Rx((i=i||c)<=c),t=t||new r(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,n,i),this.gl.bindBuffer(36662,null),t}bind({target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:n=0,size:i}={}){return 35345===t||35982===t?void 0!==i?this.gl.bindBufferRange(t,e,this.handle,n,i):(Rx(0===n),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind({target:t=this.target,index:e=this.accessor&&this.accessor.index}={}){return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t,e=0,n=t.byteLength+e){Rx(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const i=this._getTarget();this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,this.usage),this.gl.bufferSubData(i,e,t),this.gl.bindBuffer(i,null),this.debugData=t.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n);const r=$x(t);return Rx(r),this.setAccessor(new Kx(this.accessor,{type:r})),this}_setByteLength(t,e=this.usage){Rx(t>=0),this._trackDeallocatedMemory();let n=t;0===t&&(n=new Float32Array(0));const i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,e),this.gl.bindBuffer(i,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/Gx(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new Kx(this.accessor,{type:$x(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return Nw.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return Nw.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return Nw.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return Nw.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Kx(this.accessor,t),this}}const eS={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},nS={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},iS={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},rS=[9729,9728],sS=zw.CO.WebGLBuffer||function(){};class oS extends Hx{static isSupported(t,e={}){const{format:n,linearFiltering:i}=e;let r=!0;return n&&(r=r&&function(t,e){const n=eS[e];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;const i=Fw(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}(t,n),r=r&&(!i||function(t,e){const n=eS[e];switch(n&&n.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}(t,n))),r}constructor(t,e){const{id:n=Fx("texture"),handle:i,target:r}=e;super(t,{id:n,handle:i}),this.target=r,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(t={}){let e=t.data;if(e instanceof Promise)return e.then(e=>this.initialize(Object.assign({},t,{pixels:e,data:e}))),this;const n="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(n&&e.readyStatethis.initialize(t)),this;const{pixels:i=null,format:r=6408,border:s=0,recreate:o=!1,parameters:a={},pixelStore:l={},textureUnit:c}=t;e||(e=i);let{width:u,height:h,dataFormat:d,type:p,compressed:f=!1,mipmaps:g=!0}=t;const{depth:m=0}=t;return({width:u,height:h,compressed:f,dataFormat:d,type:p}=this._deduceParameters({format:r,type:p,dataFormat:d,compressed:f,data:e,width:u,height:h})),this.width=u,this.height=h,this.depth=m,this.format=r,this.type=p,this.dataFormat=d,this.border=s,this.textureUnit=c,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),g&&this._isNPOT()&&(Nw.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),g=!1,this._updateForNPOT(a)),this.mipmaps=g,this.setImageData({data:e,width:u,height:h,depth:m,format:r,type:p,dataFormat:d,border:s,mipmaps:g,parameters:l,compressed:f}),g&&this.generateMipmap(),this.setParameters(a),o&&(this.data=e),n&&(this._video={video:e,parameters:a,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:n}=this._video;if(n===t.currentTime||t.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:n=null,level:i=0,format:r=this.format,border:s=this.border,offset:o=0,parameters:a={}}=t;let{data:l=null,type:c=this.type,width:u=this.width,height:h=this.height,dataFormat:d=this.dataFormat,compressed:p=!1}=t;l||(l=n),({type:c,dataFormat:d,compressed:p,width:u,height:h}=this._deduceParameters({format:r,type:c,dataFormat:d,compressed:p,data:l,width:u,height:h}));const{gl:f}=this;f.bindTexture(this.target,this.handle);let g,m=null;return({data:l,dataType:m}=this._getDataType({data:l,compressed:p})),vx(this.gl,a,()=>{switch(m){case"null":f.texImage2D(e,i,r,u,h,s,d,c,l);break;case"typed-array":f.texImage2D(e,i,r,u,h,s,d,c,l,o);break;case"buffer":g=Vw(f),g.bindBuffer(35052,l.handle||l),g.texImage2D(e,i,r,u,h,s,d,c,o),g.bindBuffer(35052,null);break;case"browser-object":Fw(f)?f.texImage2D(e,i,r,u,h,s,d,c,l):f.texImage2D(e,i,r,d,c,l);break;case"compressed":for(const[t,n]of l.entries())f.compressedTexImage2D(e,t,n.format,n.width,n.height,s,n.data);break;default:Rx(!1,"Unknown image data type")}}),this._trackAllocatedMemory(l&&l.byteLength?l.byteLength:this.width*this.height*(nS[this.dataFormat]||4)*(iS[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:t=this.target,pixels:e=null,data:n=null,x:i=0,y:r=0,width:s=this.width,height:o=this.height,level:a=0,format:l=this.format,type:c=this.type,dataFormat:u=this.dataFormat,compressed:h=!1,offset:d=0,border:p=this.border,parameters:f={}}){if(({type:c,dataFormat:u,compressed:h,width:s,height:o}=this._deduceParameters({format:l,type:c,dataFormat:u,compressed:h,data:n,width:s,height:o})),Rx(0===this.depth,"texSubImage not supported for 3D textures"),n||(n=e),n&&n.data){const t=n;n=t.data,s=t.shape[0],o=t.shape[1]}n instanceof tS&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),vx(this.gl,f,()=>{if(h)this.gl.compressedTexSubImage2D(t,a,i,r,s,o,l,n);else if(null===n)this.gl.texSubImage2D(t,a,i,r,s,o,u,c,null);else if(ArrayBuffer.isView(n))this.gl.texSubImage2D(t,a,i,r,s,o,u,c,n,d);else if(n instanceof sS){const e=Vw(this.gl);e.bindBuffer(35052,n),e.texSubImage2D(t,a,i,r,s,o,u,c,d),e.bindBuffer(35052,null)}else Fw(this.gl)?Vw(this.gl).texSubImage2D(t,a,i,r,s,o,u,c,n):this.gl.texSubImage2D(t,a,i,r,u,c,n)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(t={}){return Nw.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType({data:t,compressed:e=!1}){return e?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof tS?{data:t.handle,dataType:"buffer"}:t instanceof sS?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:n}=t;let{width:i,height:r,dataFormat:s,type:o,compressed:a}=t;const l=eS[e];return s=s||l&&l.dataFormat,o=o||l&&l.types[0],a=a||l&&l.compressed,({width:i,height:r}=this._deduceImageSize(n,i,r)),{dataFormat:s,type:o,compressed:a,width:i,height:r,format:e,data:n}}_deduceImageSize(t,e,n){let i;return i="undefined"!=typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:n}:{width:e>=0?e:1,height:n>=0?n:1},Rx(i,"Could not deduced texture size"),Rx(void 0===e||i.width===e,"Deduced texture width does not match supplied width"),Rx(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Rx(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Fw(this.gl)||!this.width||!this.height||Bx(this.width)&&Bx(this.height))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===rS.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}function aS(t,e){return Rx("string"==typeof t),t=""+t,new Promise((n,i)=>{try{const r=new Image;r.onload=()=>n(r),r.onerror=()=>i(new Error(`Could not load image ${t}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=t}catch(r){i(r)}})}class lS extends oS{static isSupported(t,e){return oS.isSupported(t,e)}constructor(t,e={}){Bw(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:aS(e.data)})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}const cS="EXT_color_buffer_float";var uS={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:cS,bpp:2},33327:{gl2:cS,bpp:4},34842:{gl2:cS,bpp:8},33326:{gl2:cS,bpp:4},33328:{gl2:cS,bpp:8},34836:{gl2:cS,bpp:16},35898:{gl2:cS,bpp:4}};class hS extends Hx{static isSupported(t,{format:e}={format:null}){return!e||function(t,e,n){const i=n[e];if(!i)return!1;const r=Fw(t)&&i.gl2||i.gl1;return"string"==typeof r?t.getExtension(r):r}(t,e,uS)}static getSamplesForFormat(t,{format:e}){return t.getInternalformatParameter(36161,e,32937)}constructor(t,e={}){super(t,e),this.initialize(e),Object.seal(this)}initialize({format:t,width:e=1,height:n=1,samples:i=0}){return Rx(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==i&&Fw(this.gl)?this.gl.renderbufferStorageMultisample(36161,i,t,e,n):this.gl.renderbufferStorage(36161,t,e,n),this.format=t,this.width=e,this.height=n,this.samples=i,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*uS[this.format].bpp),this}resize({width:t,height:e}){return t!==this.width||e!==this.height?this.initialize({width:t,height:e,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}const dS="clear: bad arguments";function pS(t,{framebuffer:e=null,color:n=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;n&&(o|=16384,!0!==n&&(s.clearColor=n)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),Rx(0!==o,dS),vx(t,s,()=>{t.clear(o)})}function fS(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function gS(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var s=t.apply(e,n);function o(t){fS(s,i,r,o,a,"next",t)}function a(t){fS(s,i,r,o,a,"throw",t)}o(void 0)})}}const mS=[34069,34070,34071,34072,34073,34074];let bS=(()=>{class t extends oS{constructor(t,e={}){Bw(t),super(t,Object.assign({},e,{target:34067})),this.initialize(e),Object.seal(this)}initialize(t={}){const{mipmaps:e=!0,parameters:n={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(n)}),this}subImage({face:t,data:e,x:n=0,y:i=0,mipmapLevel:r=0}){return this._subImage({target:t,data:e,x:n,y:i,mipmapLevel:r})}setCubeMapImageData({width:t,height:e,pixels:n,data:i,border:r=0,format:s=6408,type:o=5121}){var a=this;return gS(function*(){const{gl:l}=a,c=n||i,u=yield Promise.all(mS.map(t=>{const e=c[t];return Promise.all(Array.isArray(e)?e:[e])}));a.bind(),mS.forEach((n,i)=>{u[i].length>1&&!1!==a.opts.mipmaps&&Nw.warn(`${a.id} has mipmap and multiple LODs.`)(),u[i].forEach((i,a)=>{t&&e?l.texImage2D(n,a,s,t,e,r,s,o,i):l.texImage2D(n,a,s,s,o,i)})}),a.unbind()})()}setImageDataForFace(t){const{face:e,width:n,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}=t,{gl:c}=this,u=r||s;return this.bind(),u instanceof Promise?u.then(n=>this.setImageDataForFace(Object.assign({},t,{face:e,data:n,pixels:n}))):this.width||this.height?c.texImage2D(e,0,a,n,i,o,a,l,u):c.texImage2D(e,0,a,a,l,u),this}}return t.FACES=mS,t})();class yS extends oS{static isSupported(t){return Fw(t)}constructor(t,e={}){Vw(t),super(t,e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1})),this.initialize(e),Object.seal(this)}setImageData({level:t=0,dataFormat:e=6408,width:n,height:i,depth:r=1,border:s=0,format:o,type:a=5121,offset:l=0,data:c,parameters:u={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),vx(this.gl,u,()=>{ArrayBuffer.isView(c)&&this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,c),c instanceof tS&&(this.gl.bindBuffer(35052,c.handle),this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,l))}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*this.depth*(nS[this.dataFormat]||4)*(iS[this.type]||1),"Texture"),this.loaded=!0,this}}function vS(t,e){const{gl:n,width:i,height:r,id:s}=t;return new SS(n,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:t}}))}function _S(t,e={}){const{sourceX:n=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:u,deleteFramebuffer:h}=function(t){return t instanceof SS?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:vS(t),deleteFramebuffer:!0}}(t);Rx(u);const{gl:d,handle:p,attachments:f}=u;a=a||u.width,l=l||u.height,36064===s&&null===p&&(s=1028),Rx(f[s]),c=c||f[s].type,o=function(t,e,n,i,r){if(t)return t;return new(Gx(e=e||5121,{clamped:!1}))(i*r*function(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Rx(!1),0}}(n))}(o,c,r,a,l),c=c||$x(o);const g=d.bindFramebuffer(36160,p);return d.readPixels(n,i,a,l,r,c,o),d.bindFramebuffer(36160,g||null),h&&u.delete(),o}function wS(t,{sourceAttachment:e=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}={}){let i=_S(t,{sourceAttachment:e}),{width:r,height:s}=t;for(;s>n;)({data:i,width:r,height:s}=Wx({data:i,width:r,height:s}));!function({data:t,width:e,height:n,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&e>=0,"Width and height need to be integers"),this.width=t,this.height=e,n)for(const c in n){const i=n[c];(Array.isArray(i)?i[0]:i).resize({width:t,height:e})}else n=this._createDefaultAttachments(i,r,s,t,e);this.update({clearAttachments:!0,attachments:n,readBuffer:a,drawBuffers:l}),n&&o&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update({attachments:t={},readBuffer:e,drawBuffers:n,clearAttachments:i=!1,resizeAttachments:r=!0}){this.attach(t,{clearAttachments:i,resizeAttachments:r});const{gl:s}=this,o=s.bindFramebuffer(36160,this.handle);return e&&this._setReadBuffer(e),n&&this._setDrawBuffers(n),s.bindFramebuffer(36160,o||null),this}resize(t={}){let{width:e,height:n}=t;if(null===this.handle)return Rx(void 0===e&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),e!==this.width&&n!==this.height&&Nw.log(2,`Resizing framebuffer ${this.id} to ${e}x${n}`)();for(const i in this.attachments)this.attachments[i].resize({width:e,height:n});return this.width=e,this.height=n,this}attach(t,{clearAttachments:e=!1,resizeAttachments:n=!0}={}){const i={};e&&Object.keys(this.attachments).forEach(t=>{i[t]=null}),Object.assign(i,t);const r=this.gl.bindFramebuffer(36160,this.handle);for(const s in i){Rx(void 0!==s,"Misspelled framebuffer binding point?");const t=Number(s),e=i[t];let r=e;if(r)if(r instanceof hS)this._attachRenderbuffer({attachment:t,renderbuffer:r});else if(Array.isArray(e)){const[n,i=0,s=0]=e;r=n,this._attachTexture({attachment:t,texture:n,layer:i,level:s})}else this._attachTexture({attachment:t,texture:r,layer:0,level:0});else this._unattach(t);n&&r&&r.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,r||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter(t=>!this.attachments[t]).forEach(t=>{delete this.attachments[t]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(t){return(SS.STATUS||{})[t]||`Framebuffer error ${t}`}(t));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),n=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),n}clear(t={}){const{color:e,depth:n,stencil:i,drawBuffers:r=[]}=t,s=this.gl.bindFramebuffer(36160,this.handle);return(e||n||i)&&pS(this.gl,{color:e,depth:n,stencil:i}),r.forEach((t,e)=>{!function(t,{framebuffer:e=null,buffer:n=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Vw(t),vx(t,{framebuffer:e},()=>{switch(n){case 6144:switch(r.constructor){case Int32Array:t.clearBufferiv(n,i,r);break;case Uint32Array:t.clearBufferuiv(n,i,r);break;case Float32Array:default:t.clearBufferfv(n,i,r)}break;case 6145:t.clearBufferfv(6145,0,[r]);break;case 6146:t.clearBufferiv(6146,0,[r]);break;case 34041:const[e,s]=r;t.clearBufferfi(34041,0,e,s);break;default:Rx(!1,dS)}})}(this.gl,{drawBuffer:e,value:t})}),this.gl.bindFramebuffer(36160,s||null),this}readPixels(t={}){return Nw.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(t={}){return Nw.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(t={}){return Nw.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(t={}){return Nw.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(t={}){return Nw.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(t={}){return Nw.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:t=[],x:e=0,y:n=0,width:i,height:r}){const s=Vw(this.gl),o=s.bindFramebuffer(36008,this.handle);return 0===e&&0===n&&void 0===i&&void 0===r?s.invalidateFramebuffer(36008,t):s.invalidateFramebuffer(36008,t,e,n,i,r),s.bindFramebuffer(36008,o),this}getAttachmentParameter(t,e,n){let i=this._getAttachmentParameterFallback(e);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Lx(this.gl,i)),i}getAttachmentParameters(t=36064,e,n=this.constructor.ATTACHMENT_PARAMETERS||[]){const i={};for(const r of n)i[e?Lx(this.gl,r):r]=this.getAttachmentParameter(t,r,e);return i}getParameters(t=!0){const e=Object.keys(this.attachments),n={};for(const i of e){const e=Number(i);n[t?Lx(this.gl,e):e]=this.getAttachmentParameters(e,t)}return n}show(){return"undefined"!=typeof window&&window.open(wS(this),"luma-debug-texture"),this}log(t=0,e=""){if(t>Nw.level||"undefined"==typeof window)return this;e=e||`Framebuffer ${this.id}`;const n=wS(this,{targetMaxHeight:100});return Nw.image({logLevel:t,message:e,image:n},e)(),this}bind({target:t=36160}={}){return this.gl.bindFramebuffer(t,this.handle),this}unbind({target:t=36160}={}){return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,n,i,r){let s=null;return t&&(s=s||{},s[36064]=new lS(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(s[36064])),e&&n?(s=s||{},s[33306]=new hS(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:i,height:111}),this.ownResources.push(s[33306])):e?(s=s||{},s[36096]=new hS(this.gl,{id:`${this.id}-depth`,format:33189,width:i,height:r}),this.ownResources.push(s[36096])):n&&Rx(!1),s}_unattach(t){const e=this.attachments[t];!e||(e instanceof hS?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer({attachment:t=36064,renderbuffer:e}){const{gl:n}=this;n.framebufferRenderbuffer(36160,t,36161,e.handle),this.attachments[t]=e}_attachTexture({attachment:t=36064,texture:e,layer:n,level:i}){const{gl:r}=this;switch(r.bindTexture(e.target,e.handle),e.target){case 35866:case 32879:Vw(r).framebufferTextureLayer(36160,t,e.target,i,n);break;case 34067:const s=function(t){return t<34069?t+34069:t}(n);r.framebufferTexture2D(36160,t,s,e.handle,i);break;case 3553:r.framebufferTexture2D(36160,t,3553,e.handle,i);break;default:Rx(!1,"Illegal texture type")}r.bindTexture(e.target,null),this.attachments[t]=e}_setReadBuffer(t){const e=function(t){return Fw(t)?t:null}(this.gl);e?e.readBuffer(t):Rx(36064===t||1029===t,xS),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,n=Vw(e);if(n)n.drawBuffers(t);else{const n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Rx(1===t.length&&(36064===t[0]||1029===t[0]),xS)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=function(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in ES)void 0===t.luma.caps[e]&&(t.luma.caps[e]=TS(t,e));return t.luma.caps}(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}SS.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var ES={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(t){const e=new lS(t,{format:6408,type:5126,dataFormat:6408}),n=new SS(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=n.getStatus();return e.delete(),n.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function CS(t,e){return OS(t,e)}function OS(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>TS(t,e))}function TS(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const n=ES[e];let i;Rx(n,e);const r=Fw(t)&&n[1]||n[0];if("function"==typeof r)i=r(t);else if(Array.isArray(r)){i=!0;for(const e of r)i=i&&Boolean(t.getExtension(e))}else"string"==typeof r?i=Boolean(t.getExtension(r)):"boolean"==typeof r?i=r:Rx(!1);return i}(t,e)),t.luma.caps[e]||Nw.log(2,`Feature: ${e} not supported`)(),t.luma.caps[e]}class kS{constructor(t,e){this.opts=e,this.source=t}get value(){return this.source.value}getValue(){const t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];const{value:n}=this.source,{size:i}=e;let r=n;if(n&&n.length!==i){r=new Float32Array(i);const t=e.elementOffset||0;for(let e=0;ei&&(r=i);const s=this._pool,o=t.BYTES_PER_ELEMENT*r,a=s.findIndex(t=>t.byteLength>=o);if(a>=0){const e=new t(s.splice(a,1)[0],0,r);return n&&e.fill(0),e}return new t(r)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:n}=t,{byteLength:i}=n,r=e.findIndex(t=>t.byteLength>=i);r<0?e.push(n):(r>0||e.lengththis.props.poolSize&&e.shift()}};Math;const PS=1/180*Math.PI,IS={};function MS(t,{precision:e=IS.precision||4}={}){return t=function(t){return Math.round(t/IS.EPSILON)*IS.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function DS(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function RS(t,e,n){if(DS(t)){n=n||function(t){return t.clone?t.clone():new Array(t.length)}(t);for(let i=0;it*PS,void 0)}(t)}function LS(t,e,n){return RS(t,t=>Math.max(e,Math.min(n,t)))}function jS(t,e,n){return DS(t)?t.map((t,i)=>jS(t,e[i],n)):n*e+(1-n)*t}function FS(t,e,n){const i=IS.EPSILON;n&&(IS.EPSILON=n);try{if(t===e)return!0;if(DS(t)&&DS(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+MS(this[n],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e=0&&t=0&&t0&&(dE.length=t.length,i=dE):i=hE,(e>0||Number.isFinite(n))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,n),r.index=e-1),{iterable:i,objectInfo:r}}function fE(t){return t&&t[Symbol.asyncIterator]}function gE(t,e=(()=>!0)){return Array.isArray(t)?mE(t,e,[]):e(t)?[t]:[]}function mE(t,e,n){let i=-1;for(;++ia)return void e.set(t.subarray(0,a),n);if(e.set(t,n),!s)return;let l=o;for(;lt},spring:{stiffness:.05,damping:.5}};function xE(t,e){return t?(Number.isFinite(t)&&(t={duration:t}),t.type=t.type||"interpolation",bt(bt(bt({},wE[t.type]),e),t)):null}function SE(t,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function EE(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function CE(t){t.push(t.shift())}function OE(t,e){const{doublePrecision:n,settings:i,value:r,size:s}=t,o=n&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function TE({buffer:t,numInstances:e,attribute:n,fromLength:i,fromStartIndices:r,getData:s=(t=>t)}){const o=n.doublePrecision&&n.value instanceof Float64Array?2:1,a=n.size*o,l=n.byteOffset,c=n.startIndices,u=r&&c,h=OE(n,e),d=n.state.constant;if(!u&&i>=h)return;const p=d?n.value:n.getBuffer().getData({srcByteOffset:l});if(n.settings.normalized&&!d){const t=s;s=(e,i)=>n._normalizeConstant(t(e,i))}const f=d?(t,e)=>s(p,e):(t,e)=>s(p.subarray(t,t+a),e),g=t.getData({length:i}),m=new Float32Array(h);(function({source:t,target:e,size:n,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return _E({source:t,target:e,size:n,getData:i}),e;let o=0,a=0;const l=i&&((t,e)=>i(t+a,e)),c=Math.min(r.length,s.length);for(let u=1;u(t+128)/255*2-1);case 5122:return new Float32Array(t).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(t).map(t=>t/255);case 5123:return new Float32Array(t).map(t=>t/65535);default:return t}}_normalizeValue(t,e,n){const{defaultValue:i,size:r}=this.settings;if(Number.isFinite(t))return e[n]=t,e;if(!t)return e[n]=i[0],e;switch(r){case 4:e[n+3]=Number.isFinite(t[3])?t[3]:i[3];case 3:e[n+2]=Number.isFinite(t[2])?t[2]:i[2];case 2:e[n+1]=Number.isFinite(t[1])?t[1]:i[1];case 1:e[n+0]=Number.isFinite(t[0])?t[0]:i[0];break;default:let s=r;for(;--s>=0;)e[n+s]=Number.isFinite(t[s])?t[s]:i[s]}return e}_areValuesEqual(t,e){if(!t||!e)return!1;const{size:n}=this;for(let i=0;it[e])]:t[e],n)}setNeedsUpdate(t=this.id,e){if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){const{startRow:t=0,endRow:n=1/0}=e;this.state.updateRanges=function(t,e){if(t===vE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return t;const n=[],i=t.length;let r=0;for(let s=0;se[1]?n.push(i):e=[Math.min(i[0],e[0]),Math.max(i[1],e[1])]}return n.splice(r,0,e),n}(this.state.updateRanges,[t,n])}else this.state.updateRanges=vE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=yE}setNeedsRedraw(t=this.id){this.state.needsRedraw=this.state.needsRedraw||t}update(t){this.setData(t)}allocate(t){const{state:e,settings:n}=this;return!n.noAlloc&&!!n.update&&(super.allocate({numInstances:t,copy:e.updateRanges!==vE}),!0)}updateBuffer({numInstances:t,data:e,props:n,context:i}){if(!this.needsUpdate())return!1;const{state:{updateRanges:r},settings:{update:s,noAlloc:o}}=this;let a=!0;if(s){for(const[o,a]of r)s.call(i,this,{data:e,startRow:o,endRow:a,props:n,numInstances:t});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const n=i*a+l;for(let i=0;ic?l.set(e,f):(t._normalizeValue(e,m.target,0),bE({target:l,source:m.target,start:f,count:n}));f+=n*c}else t._normalizeValue(e,l,f),f+=c}}_validateAttributeUpdaters(){const{settings:t}=this;if(!t.noAlloc&&"function"!=typeof t.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:t}=this,e=Math.min(4,this.size);if(t&&t.length>=e){let n=!0;switch(e){case 4:n=n&&Number.isFinite(t[3]);case 3:n=n&&Number.isFinite(t[2]);case 2:n=n&&Number.isFinite(t[1]);case 1:n=n&&Number.isFinite(t[0]);break;default:n=!1}if(!n)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let AE={};function PE(t){Iw.level>0&&AE[t]&&AE[t].call(...arguments)}function IE(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const ME="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",DE=`#version 300 es\n${ME}`;function RE(t,e){e=Array.isArray(e)?e:[e];const n=t.replace(/^\s+/,"").split(/\s+/),[i,r,s]=n;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function NE(t={}){const{version:e=100,input:n,inputType:i,output:r}=t;if(!n)return 300===e?DE:e>300?`#version ${e}\n${ME}`:"void main() {gl_FragColor = vec4(0);}";const s=function(t,e){switch(e){case"float":return`vec4(${t}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${t}, 0.0, 1.0)`;case"vec3":return`vec4(${t}, 1.0)`;case"vec4":return t;default:return IE(!1),null}}(n,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${n};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${n};\nvoid main() {\n gl_FragColor = ${s};\n}`}class LE extends Hx{static isSupported(t){return Fw(t)}constructor(t,e={}){Vw(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(t={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Vx(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(t={}){return this.bind(()=>{for(const e in t)this.setBuffer(e,t[e])}),this}setBuffer(t,e){const n=this._getVaryingIndex(t),{buffer:i,byteSize:r,byteOffset:s}=this._getBufferParams(e);return n<0?(this.unused[t]=i,Nw.warn(()=>`${this.id} unused varying buffer ${t}`)(),this):(this.buffers[n]=e,this.bindOnUse||this._bindBuffer(n,i,s,r),this)}begin(t=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,n,i;return t instanceof tS?i=t:(i=t.buffer,n=t.byteSize,e=t.byteOffset),(void 0!==e||void 0!==n)&&(e=e||0,n=n||i.byteLength-e),{buffer:i,byteOffset:e,byteSize:n}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:n,byteOffset:i}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,i,n)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e,n=0,i){const r=e&&e.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,t,r,n,i):this.gl.bindBufferBase(35982,t,r),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}class jE{constructor(t,e={}){this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(t={}){const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(t={}){const e=this.bindings[this.currentIndex],{sourceBuffers:n,transformFeedback:i}=e;return{attributes:Object.assign({},n,t.attributes),transformFeedback:i}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],n=t?e[t]:null;return n?n instanceof tS?n:n.buffer:null}getData(t={}){const{varyingName:e}=t,n=this.getBuffer(e);return n?n.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(t={}){this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Rx(Fw(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,n={};if(this.bindings[this.currentIndex]&&Object.assign(n,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const i in this.feedbackMap){const t=this.feedbackMap[i];i in e&&(n[t]=i)}Object.assign(n,t.feedbackBuffers);for(const i in n){const t=n[i];if("string"==typeof t){const r=e[t],{byteLength:s,usage:o,accessor:a}=r;n[i]=this._createNewBuffer(i,{byteLength:s,usage:o,accessor:a})}}return n}_setupBuffers(t={}){const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const n=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:n})}_setupTransformFeedback(t,{model:e}){const{program:n}=e;t.transformFeedback=new LE(this.gl,{program:n,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),n=Object.assign({},t.feedbackBuffers);for(const i in this.feedbackMap){const r=this.feedbackMap[i];e[i]=t.feedbackBuffers[r],n[r]=t.sourceBuffers[i],Rx(n[r]instanceof tS)}return{sourceBuffers:e,feedbackBuffers:n}}_createNewBuffer(t,e){const n=new tS(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}_getNextIndex(){return(this.currentIndex+1)%2}}function FE(t){let e=100;const n=t.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){const t=parseInt(n[1],10);Number.isFinite(t)&&(e=t)}return e}const BE="vs",VE={[BE]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},zE="__LUMA_INJECT_DECLARATIONS__",UE=/void\s+main\s*\([^)]*\)\s*\{\n?/,HE=/}\n?[^{}]*$/,$E=[];function GE(t,e,n,i=!1){const r=e===BE;for(const s in n){const e=n[s];e.sort((t,e)=>t.order-e.order),$E.length=e.length;for(let t=0,n=e.length;tt+i));break;case"vs:#main-end":r&&(t=t.replace(HE,t=>i+t));break;case"fs:#decl":r||(t=t.replace(zE,i));break;case"fs:#main-start":r||(t=t.replace(UE,t=>t+i));break;case"fs:#main-end":r||(t=t.replace(HE,t=>i+t));break;default:t=t.replace(s,t=>t+i)}}return t=t.replace(zE,""),i&&(t=t.replace(/\}\s*$/,t=>t+VE[e])),t}function WE(t){const e={};return IE(Array.isArray(t)&&t.length>1),t.forEach(t=>{for(const n in t)e[n]=e[n]?`${e[n]}\n${t[n]}`:t[n]}),e}const qE={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},XE="transform_uSize_",YE="transform_position";const KE={10241:9728,10240:9728,10242:33071,10243:33071};class QE{constructor(t,e={}){this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(t={}){const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(t={}){const{sourceBuffers:e,sourceTextures:n,framebuffer:i,targetTexture:r}=this.bindings[this.currentIndex],s=Object.assign({},e,t.attributes),o=Object.assign({},t.uniforms),a=Object.assign({},t.parameters);let l=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){s.transform_elementID=this.elementIDBuffer;for(const e in this.samplerTextureMap)o[e]=n[this.samplerTextureMap[e]];this._setSourceTextureParameters();const t=function({sourceTextureMap:t,targetTextureVarying:e,targetTexture:n}){const i={};let r,s;e&&(({width:r,height:s}=n),i[`${XE}${e}`]=[r,s]);for(const o in t)({width:r,height:s}=t[o]),i[`${XE}${o}`]=[r,s];return i}({sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:r});Object.assign(o,t)}return this.hasTargetTexture&&(l=!1,a.viewport=[0,0,i.width,i.height]),{attributes:s,framebuffer:i,uniforms:o,discard:l,parameters:a}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData({packed:t=!1}={}){const{framebuffer:e}=this.bindings[this.currentIndex],n=_S(e);if(!t)return n;const i=n.constructor,r=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return IE(!1),null}}(this.targetTextureType),s=new i(n.length*r/4);let o=0;for(let a=0;a0,this._updateBindings({sourceBuffers:e,sourceTextures:n,targetTexture:r}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}_updateElementIDBuffer(t){if("number"!=typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach((t,e,n)=>{n[e]=e}),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new tS(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:n,sourceTextures:i,targetTexture:r}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,i),Object.assign(t.sourceBuffers,n),r){t.targetTexture=r;const{width:e,height:n}=r,{framebuffer:i}=t;i?(i.update({attachments:{36064:r},resizeAttachments:!1}),i.resize({width:e,height:n})):t.framebuffer=new SS(this.gl,{id:"transform-framebuffer",width:e,height:n,attachments:{36064:r}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const n in e)e[n].setParameters(KE)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);return e[this._swapTexture]=t.targetTexture,{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=function(t,e){Rx(t instanceof lS||t instanceof bS||t instanceof yS);const n=t.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=t;return new n(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(t);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(t={}){const{sourceTextures:e,targetTexture:n}=this.bindings[this.currentIndex],{vs:i,uniforms:r,targetTextureType:s,inject:o,samplerTextureMap:a}=function({vs:t,sourceTextureMap:e,targetTextureVarying:n,targetTexture:i}){let r=Object.keys(e).length,s=null;const o={};let a=t,l={};if(r>0||n){const t=a.split("\n"),c=t.slice();if(t.forEach((t,i,a)=>{if(r>0){const n=function(t,e){const n={},i=function(t){return RE(t,["attribute","in"])}(t);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const e=`// ${t} => Replaced by Transform with a sampler`,{samplerName:i,sizeName:o,uniformDeclerations:a}=function(t){const e=`transform_uSampler_${t}`,n=`${XE}${t}`;return{samplerName:e,sizeName:n,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${n};`}}(s),l=` ${r} ${s} = transform_getInput(${i}, ${o}).${function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return IE(!1),null}}(r)};\n`;return n[i]=s,{updatedLine:e,inject:{"vs:#decl":a,"vs:#main-start":l},samplerTextureMap:n}}return null}(t,e);if(n){const{updatedLine:t,inject:e}=n;c[i]=t,l=WE([l,e]),Object.assign(o,n.samplerTextureMap),r--}}n&&!s&&(s=function(t,e){const n=RE(t,["varying","out"]);return n&&n.name===e?n.type:null}(t,n))}),n){Rx(i);const t=`${XE}${n}`;l=WE([l,{"vs:#decl":`uniform vec2 ${t};\n`,"vs:#main-start":` vec2 ${YE} = transform_getPos(${t});\n gl_Position = vec4(${YE}, 0, 1.);\n`}])}a=c.join("\n")}return{vs:a,targetTextureType:s,inject:l,samplerTextureMap:o}}({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:n}),l=WE([t.inject||{},o]);return this.targetTextureType=s,this.samplerTextureMap=a,{vs:i,fs:t._fs||NE({version:FE(i),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[qE].concat(t.modules||[]):t.modules,uniforms:r,inject:l}}}const ZE={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function JE(t){let e=tC(t);return"object"===e?t?"type"in t?Object.assign({},t,ZE[t.type]):"value"in t?(e=tC(t.value),Object.assign({type:e},t,ZE[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},ZE[e])}function tC(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class eC{constructor({name:t,vs:e,fs:n,dependencies:i=[],uniforms:r,getUniforms:s,deprecations:o=[],defines:a={},inject:l={},vertexShader:c,fragmentShader:u}){IE("string"==typeof t),this.name=t,this.vs=e||c,this.fs=n||u,this.getModuleUniforms=s,this.dependencies=i,this.deprecations=this._parseDeprecationDefinitions(o),this.defines=a,this.injections=function(t){const e={vs:{},fs:{}};for(const n in t){let i=t[n];const r=n.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][n]=i}return e}(l),r&&(this.uniforms=function(t){const e={};for(const n in t){const i=JE(t[n]);e[n]=i}return e}(r))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:IE(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${e}// END MODULE_${this.name}\n\n`}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach(n=>{n.regex.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())})}_parseDeprecationDefinitions(t){return t.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),t}_defaultGetUniforms(t={}){const e={},n=this.uniforms;for(const i in n){const r=n[i];i in t&&!r.private?(r.validate&&IE(r.validate(t[i],r),`${this.name}: invalid ${i}`),e[i]=t[i]):e[i]=r.value}return e}}function nC(t){return function(t){const e={},n={};return iC({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort((t,e)=>n[e]-n[t]).map(t=>e[t])}(rC(t))}function iC({modules:t,level:e,moduleMap:n,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of t)n[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof eC||(IE("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),IE(t.name,"shader module has no name"),(t=new eC(t)).dependencies=rC(t.dependencies)),t))}const sC={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},oC={};function aC(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/Apple/i)||e.match(/Apple/i)?"APPLE":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(sC).forEach(t=>{oC[t]=t});const lC={};function cC(t,e,n={}){const i=sC[e];if(IE(i,e),!function(t={}){const e="undefined"!=typeof window&&window.navigator||{},n=t.userAgent||e.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(e in lC)return lC[e];const r=`#extension GL_${i[0]} : ${n.behavior||"enable"}\nvoid main(void) {}`,s=t.createShader(35633);t.shaderSource(s,r),t.compileShader(s);const o=t.getShaderParameter(s,35713);return t.deleteShader(s),lC[e]=o,o}function uC(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>function(t,e){const n=sC[e];IE(n,e);const i=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&n[1]||n[0],r="string"==typeof i?Boolean(t.getExtension(i)):i;return IE(!1===r||!0===r),r}(t,e))}function hC(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const dC=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],pC=[...dC,[hC("attribute"),"in $1"],[hC("varying"),"out $1"]],fC=[...dC,[hC("varying"),"in $1"]],gC=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],mC=[...gC,[hC("in"),"attribute $1"],[hC("out"),"varying $1"]],bC=[...gC,[hC("in"),"varying $1"]],yC="gl_FragColor",vC=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,_C=/void\s+main\s*\([^)]*\)\s*\{\n?/;function wC(t,e){for(const[n,i]of e)t=t.replace(n,i);return t}const xC=`\n\n${zE}\n\n`,SC={[BE]:"vertex",fs:"fragment"};function EC(t,{id:e,source:n,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){IE("string"==typeof n,"shader source must be a string");const h=i===BE,d=n.split("\n");let p=100,f="",g=n;0===d[0].indexOf("#version ")?(p=300,f=d[0],g=d.slice(1).join("\n")):f=`#version ${p}`;const m={};r.forEach(t=>{Object.assign(m,t.getDefines())}),Object.assign(m,s);let b=c?`${f}\n${function({id:t,source:e,type:n}){return t&&"string"==typeof t&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${t}_${SC[n]}\n\n`:""}({id:e,source:n,type:i})}\n${function({type:t}){return`\n#define SHADER_TYPE_${SC[t].toUpperCase()}\n`}({type:i})}\n${function(t){switch(function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),n=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:aC(n,i),vendor:n,renderer:i,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(t)}\n${function(t,e,n){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return uC(t,oC.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),uC(t,oC.GLSL_DERIVATIVES)&&cC(t,oC.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),uC(t,oC.GLSL_FRAG_DATA)&&cC(t,oC.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),uC(t,oC.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(t)}\n${function(t={}){let e=0,n="";for(const i in t){0===e&&(n+="\n// APPLICATION DEFINES\n"),e++;const r=t[i];(r||Number.isFinite(r))&&(n+=`#define ${i.toUpperCase()} ${t[i]}\n`)}return 0===e&&(n+="\n"),n}(m)}\n${h?"":"precision highp float;\n\n"}\n`:`${f}\n`;const y=function(t){const e={vs:{},fs:{}};return t.forEach(t=>{let n;"string"!=typeof t?(n=t,t=n.hook):n={},t=t.trim();const[i,r]=t.split(":"),s=t.replace(/\(.+/,"");e[i][s]=Object.assign(n,{signature:r})}),e}(o),v={},_={},w={};for(const x in a){const t="string"==typeof a[x]?{injection:a[x],order:0}:a[x],e=x.match(/^(v|f)s:(#)?([\w-]+)$/);if(e){const n=e[3];e[2]?"decl"===n?_[x]=[t]:w[x]=[t]:v[x]=[t]}else w[x]=[t]}for(const x of r){u&&x.checkDeprecations(g,u),b+=x.getModuleSource(i,p);const t=x.injections[i];for(const e in t){const n=e.match(/^(v|f)s:#([\w-]+)$/);if(n){const i="decl"===n[2]?_:w;i[e]=i[e]||[],i[e].push(t[e])}else v[e]=v[e]||[],v[e].push(t[e])}}return b+=xC,b=GE(b,i,_),b+=function(t,e){let n="";for(const i in t){const r=t[i];if(n+=`void ${r.signature} {\n`,r.header&&(n+=` ${r.header}`),e[i]){const t=e[i];t.sort((t,e)=>t.order-e.order);for(const e of t)n+=` ${e.injection}\n`}r.footer&&(n+=` ${r.footer}`),n+="}\n"}return n}(y[i],v),b+=g,b=GE(b,i,w),b=function(t,e,n){switch(e){case 300:return n?wC(t,pC):function(t){const e=(t=wC(t,fC)).match(vC);if(e){const n=e[1];t=t.replace(new RegExp(`\\b${yC}\\b`,"g"),n)}else{const e="fragmentColor";t=t.replace(_C,t=>`out vec4 ${e};\n${t}`).replace(new RegExp(`\\b${yC}\\b`,"g"),e)}return t}(t);case 100:return n?wC(t,mC):function(t){const e=(t=wC(t,bC)).match(vC);if(e){const n=e[1];t=t.replace(vC,"").replace(new RegExp(`\\b${n}\\b`,"g"),yC)}return t}(t);default:throw new Error(`unknown GLSL version ${e}`)}}(b,l?100:p,h),b}function CC(t){return function(e){const n={};for(const i of t){const t=i.getUniforms(e,n);Object.assign(n,t)}return n}}const OC={5126:VC.bind(null,"uniform1fv",MC,1,zC),35664:VC.bind(null,"uniform2fv",MC,2,zC),35665:VC.bind(null,"uniform3fv",MC,3,zC),35666:VC.bind(null,"uniform4fv",MC,4,zC),5124:VC.bind(null,"uniform1iv",DC,1,zC),35667:VC.bind(null,"uniform2iv",DC,2,zC),35668:VC.bind(null,"uniform3iv",DC,3,zC),35669:VC.bind(null,"uniform4iv",DC,4,zC),35670:VC.bind(null,"uniform1iv",DC,1,zC),35671:VC.bind(null,"uniform2iv",DC,2,zC),35672:VC.bind(null,"uniform3iv",DC,3,zC),35673:VC.bind(null,"uniform4iv",DC,4,zC),35674:VC.bind(null,"uniformMatrix2fv",MC,4,UC),35675:VC.bind(null,"uniformMatrix3fv",MC,9,UC),35676:VC.bind(null,"uniformMatrix4fv",MC,16,UC),35678:BC,35680:BC,5125:VC.bind(null,"uniform1uiv",RC,1,zC),36294:VC.bind(null,"uniform2uiv",RC,2,zC),36295:VC.bind(null,"uniform3uiv",RC,3,zC),36296:VC.bind(null,"uniform4uiv",RC,4,zC),35685:VC.bind(null,"uniformMatrix2x3fv",MC,6,UC),35686:VC.bind(null,"uniformMatrix2x4fv",MC,8,UC),35687:VC.bind(null,"uniformMatrix3x2fv",MC,6,UC),35688:VC.bind(null,"uniformMatrix3x4fv",MC,12,UC),35689:VC.bind(null,"uniformMatrix4x2fv",MC,8,UC),35690:VC.bind(null,"uniformMatrix4x3fv",MC,12,UC),35678:BC,35680:BC,35679:BC,35682:BC,36289:BC,36292:BC,36293:BC,36298:BC,36299:BC,36300:BC,36303:BC,36306:BC,36307:BC,36308:BC,36311:BC},TC={},kC={},AC={},PC=[0];function IC(t,e,n,i){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(PC[0]=t,t=PC);const r=t.length;if(r%e&&Nw.warn(`Uniform size should be multiples of ${e}`,t)(),t instanceof n)return t;let s=i[r];s||(s=new n(r),i[r]=s);for(let o=0;o{const r=t!==i;return r&&(e.uniform1i(n,i),t=i),r}}function VC(t,e,n,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,n),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{Rx(s===u,"Uniform length cannot change.");for(let t=0;t{const s=String(i+e);return GC(s,r-s.length)+n+t})}(e);return{shaderName:l,errors:$C(s,c),warnings:$C(o,c)}}(t,this.source,this.shaderType,this.id);throw Nw.error(`GLSL compilation errors in ${e}\n${n}`)(),Nw.warn(`GLSL compilation warnings in ${e}\n${i}`)(),new Error(`GLSL compilation errors in ${e}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class qC extends WC{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class XC extends WC{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const YC=5126,KC=5124,QC=5125,ZC={[YC]:[YC,1,"float"],35664:[YC,2,"vec2"],35665:[YC,3,"vec3"],35666:[YC,4,"vec4"],[KC]:[KC,1,"int"],35667:[KC,2,"ivec2"],35668:[KC,3,"ivec3"],35669:[KC,4,"ivec4"],[QC]:[QC,1,"uint"],36294:[QC,2,"uvec2"],36295:[QC,3,"uvec3"],36296:[QC,4,"uvec4"],35670:[YC,1,"bool"],35671:[YC,2,"bvec2"],35672:[YC,3,"bvec3"],35673:[YC,4,"bvec4"],35674:[YC,8,"mat2"],35685:[YC,8,"mat2x3"],35686:[YC,8,"mat2x4"],35675:[YC,12,"mat3"],35687:[YC,12,"mat3x2"],35688:[YC,12,"mat3x4"],35676:[YC,16,"mat4"],35689:[YC,16,"mat4x2"],35690:[YC,16,"mat4x3"]};function JC(t){const e=ZC[t];if(!e)return null;const[n,i]=e;return{type:n,components:i}}function tO(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=YC}for(const n in ZC){const[i,r,s]=ZC[n];if(i===t&&r===e)return{glType:n,name:s}}return null}class eO{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,n=e.getProgramParameter(t.handle,35721);for(let i=0;i=0&&this._addAttribute(o,n,r,s)}this.attributeInfos.sort((t,e)=>t.location-e.location)}_readVaryingsFromProgram(t){const{gl:e}=t;if(!Fw(e))return;const n=e.getProgramParameter(t.handle,35971);for(let i=0;it.location-e.location)}_addAttribute(t,e,n,i){const{type:r,components:s}=JC(n),o={type:r,size:i*s};this._inferProperties(t,e,o);const a={location:t,name:e,accessor:new Kx(o)};this.attributeInfos.push(a),this.attributeInfosByLocation[t]=a,this.attributeInfosByName[a.name]=a}_inferProperties(t,e,n){/instance/i.test(e)&&(n.divisor=1)}_addVarying(t,e,n,i){const{type:r,components:s}=JC(n),o={location:t,name:e,accessor:new Kx({type:r,size:i*s})};this.varyingInfos.push(o),this.varyingInfosByName[o.name]=o}}const nO=35981,iO=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class rO extends Hx{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Program","v6.0",iO),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(t={}){const{hash:e,vs:n,fs:i,varyings:r,bufferMode:s=nO}=t;return this.hash=e||"",this.vs="string"==typeof n?new qC(this.gl,{id:`${t.id}-vs`,source:n}):n,this.fs="string"==typeof i?new XC(this.gl,{id:`${t.id}-fs`,source:i}):i,Rx(this.vs instanceof qC),Rx(this.fs instanceof XC),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(Vw(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,s)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new eO(this),this.setProps(t)}delete(t={}){return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw({logPriority:t,drawMode:e=4,vertexCount:n,offset:i=0,start:r,end:s,isIndexed:o=!1,indexType:a=5123,instanceCount:l=0,isInstanced:c=l>0,vertexArray:u=null,transformFeedback:h,framebuffer:d,parameters:p={},uniforms:f,samplers:g}){if((f||g)&&(Nw.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(f||{})),Nw.priority>=t){const i=d?d.id:"default",r=`mode=${Lx(this.gl,e)} verts=${n} instances=${l} indexType=${Lx(this.gl,a)} isInstanced=${c} isIndexed=${o} Framebuffer=${i}`;Nw.log(t,r)()}return Rx(u),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===n||c&&0===l||(u.bindForDraw(n,l,()=>{if(void 0!==d&&(p=Object.assign({},p,{framebuffer:d})),h){const t=function(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Rx(!1),0}}(e);h.begin(t)}this._bindTextures(),vx(this.gl,p,()=>{o&&c?this.gl2.drawElementsInstanced(e,n,a,i,l):o&&Fw(this.gl)&&!isNaN(r)&&!isNaN(s)?this.gl2.drawRangeElements(e,r,s,n,a,i):o?this.gl.drawElements(e,n,a,i):c?this.gl2.drawArraysInstanced(e,i,n,l):this.gl.drawArrays(e,i,n)}),h&&h.end()}),0))}setUniforms(t={}){Nw.priority>=2&&function(t,e,n){for(const i in t){const r=t[i];if((!n||Boolean(n[i]))&&!jC(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const e in t){const n=t[e],i=this._uniformSetters[e];if(i){let t=n,r=!1;if(t instanceof SS&&(t=t.texture),t instanceof oS)if(r=this.uniforms[e]!==n,r){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);const n=t,{textureIndex:r}=i;n.bind(r),t=r,this._textureUniforms[e]=n}else t=i.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(i(t)||r)&&FC(this.uniforms,e,n)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const n=this._textureUniforms[e];n.update(),t=t&&n.loaded}return t}_bindTextures(){for(const t in this._textureUniforms)this._textureUniforms[t].bind(this._uniformSetters[t].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),n={};for(const i of e)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new qC({handle:i});break;case 35632:n.fs=new XC({handle:i})}return n}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=Fx(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?`${t}-program`:"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),Nw.time(4,`linkProgram for ${this._getName()}`)(),t.linkProgram(this.handle),Nw.timeEnd(4,`linkProgram for ${this._getName()}`)(),t.debug||Nw.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${t.getProgramInfoLog(this.handle)}`);if(t.validateProgram(this.handle),!t.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${t.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e1)for(let e=0;ee.name===t.name)||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"==typeof t?t:t.name;this._defaultModules=this._defaultModules.filter(t=>t.name!==e),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(t={}){const{vs:e="",fs:n="",defines:i={},inject:r={},varyings:s=[],bufferMode:o=35981,transpileToGLSL100:a=!1}=t,l=this._getModuleList(t.modules),c=this._getHash(e),u=this._getHash(n),h=l.map(t=>this._getHash(t.name)).sort(),d=s.map(t=>this._getHash(t)),p=Object.keys(i).sort(),f=Object.keys(r).sort(),g=[],m=[];for(const y of p)g.push(this._getHash(y)),g.push(this._getHash(i[y]));for(const y of f)m.push(this._getHash(y)),m.push(this._getHash(r[y]));const b=`${c}/${u}D${g.join("/")}M${h.join("/")}I${m.join("/")}V${d.join("/")}H${this.stateHash}B${o}${a?"T":""}`;if(!this._programCache[b]){const t=function(t,e){const{vs:n,fs:i}=e,r=nC(e.modules||[]);return{gl:t,vs:EC(t,Object.assign({},e,{source:n,type:BE,modules:r})),fs:EC(t,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:CC(r)}}(this.gl,{vs:e,fs:n,modules:l,inject:r,defines:i,hookFunctions:this._hookFunctions,transpileToGLSL100:a});this._programCache[b]=new rO(this.gl,{hash:b,vs:t.vs,fs:t.fs,varyings:s,bufferMode:o}),this._getUniforms[b]=t.getUniforms||(t=>{}),this._useCounts[b]=0}return this._useCounts[b]++,this._programCache[b]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(t=[]){const e=new Array(this._defaultModules.length+t.length),n={};let i=0;for(let r=0,s=this._defaultModules.length;r-1)return"Edge";const n=-1!==e.indexOf("MSIE "),i=-1!==e.indexOf("Trident/");return n||i?"IE":vw.chrome?"Chrome":vw.safari?"Safari":vw.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new aO(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return aO.MAX_ATTRIBUTES=aO.MAX_ATTRIBUTES||t.getParameter(34921),aO.MAX_ATTRIBUTES}static setConstant(t,e,n){switch(n.constructor){case Float32Array:aO._setConstantFloatArray(t,e,n);break;case Int32Array:aO._setConstantIntArray(t,e,n);break;case Uint32Array:aO._setConstantUintArray(t,e,n);break;default:Rx(!1)}}constructor(t,e={}){super(t,Object.assign({},e,{id:e.id||e.program&&e.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return aO.getMaxAttributes(this.gl)}initialize(t={}){return this.setProps(t)}setProps(t){return this}setElementBuffer(t=null,e={}){return Rx(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,t?t.handle:null)}),this}setBuffer(t,e,n){if(34963===e.target)return this.setElementBuffer(e,n);const{size:i,type:r,stride:s,offset:o,normalized:a,integer:l,divisor:c}=n,{gl:u,gl2:h}=this;return t=Number(t),this.bind(()=>{u.bindBuffer(34962,e.handle),l?(Rx(Fw(u)),h.vertexAttribIPointer(t,i,r,s,o)):u.vertexAttribPointer(t,i,r,a,s,o),u.enableVertexAttribArray(t),h.vertexAttribDivisor(t,c||0)}),this}enable(t,e=!0){return!e&&0===t&&!aO.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind(()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t))),this}getConstantBuffer(t,e){const n=this._normalizeConstantArrayValue(e),i=n.byteLength*t,r=n.length*t;let s=!this.buffer;if(this.buffer=this.buffer||new tS(this.gl,i),s=s||this.buffer.reallocate(i),s=s||!this._compareConstantArrayValues(n,this.bufferValue),s){const t=function(t,e){return new t(function(t){return(!oO||oO.byteLength{switch(t){case 34373:return this.gl.getVertexAttribOffset(e,t);default:return this.gl.getVertexAttrib(e,t)}})}}const lO=/^(.+)__LOCATION_([0-9]+)$/,cO=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class uO{constructor(t,e={}){this.id=e.id||e.program&&e.program.id,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new aO(t),zx(this,"VertexArray","v6.0",cO),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(t={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind(()=>{for(const e in t)this._setAttribute(e,t[e]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(t=null,e={}){return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e,n={}){if(34963===e.target)return this.setElementBuffer(e,n);const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,e.accessor,n);return i>=0&&(this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,r)),this}setConstant(t,e,n={}){const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},n));return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new tS(this.gl,{accessor:{size:4}});for(let t=0;t{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t{this._setConstantAttributes(t,e),i=n()}),i}_resolveLocationAndAccessor(t,e,n,i){const r={location:-1,accessor:null},{location:s,name:o}=this._getAttributeIndex(t);if(!Number.isFinite(s)||s<0)return this.unused[t]=e,Nw.once(3,()=>`unused value ${t} in ${this.id}`)(),r;const a=this._getAttributeInfo(o||s);if(!a)return r;const l=Kx.resolve(a.accessor,this.accessors[s]||{},n,i),{size:c,type:u}=l;return Rx(Number.isFinite(c)&&Number.isFinite(u)),{location:s,accessor:l}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const n=lO.exec(t),i=n?n[1]:t,r=n?Number(n[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(i)+r,name:i}:{location:-1}}_setAttribute(t,e){if(e instanceof tS)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof tS)this.setBuffer(t,e[0],e[1]);else if(ArrayBuffer.isView(e)||Array.isArray(e))this.setConstant(t,e);else{if(!(e.buffer instanceof tS))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(t,e.buffer,e)}}_setConstantAttributes(t,e){const n=Math.max(0|t,0|e);let i=this.values[0];ArrayBuffer.isView(i)&&this._setConstantAttributeZero(i,n);for(let r=1;r0;if(t.isInstanced=t.isInstanced||s,n instanceof tS){const e=n;if(s){const n=e.getVertexCount(i);t.instanceCount=Math.min(t.instanceCount,n)}else{const n=e.getVertexCount(i);t.vertexCount=Math.min(t.vertexCount,n)}}}setElements(t=null,e={}){return Nw.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}function hO(t,e={}){const{isInteger:n=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){const{maxElts:n=16,size:i=1}=e;let r="[";for(let s=0;s0&&(r+=","+(s%i==0?" ":"")),r+=hO(t[s],e);return`${r}${t.length>n?"...":"]"}`}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return n?"0":"0.";if(n||Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const i=t.toPrecision(2);return i.indexOf(".0")===i.length-2?i.slice(0,-1):i}function dO(t,e,n,i){const{gl:r}=t;if(!e)return{[i]:"null","Format ":"N/A"};let s,o,a,l="NOT PROVIDED",c=1,u=0,h=0;if(n&&(l=n.type,c=n.size,l=String(l).replace("Array",""),s=-1!==l.indexOf("nt")),e instanceof tS){const t=e,{data:d,changed:p}=t.getDebugData();let f;return o=p?"*":"",a=d,h=t.byteLength,u=h/d.BYTES_PER_ELEMENT/c,n?f=`${n.divisor>0?"I ":"P "} ${u} (x${c}=${h} bytes ${Lx(r,l)})`:(s=!0,f=`${h} bytes`),{[i]:`${o}${hO(a,{size:c,isInteger:s})}`,"Format ":f}}return a=e,c=e.length,l=String(e.constructor.name).replace("Array",""),s=-1!==l.indexOf("nt"),{[i]:`${hO(a,{size:c,isInteger:s})} (constant)`,"Format ":`${c}x${l} (constant)`}}function pO(t,e){const{type:n,size:i}=e,r=tO(n,i);return r?`${t} (${r.name})`:t}function fO({header:t="Uniforms",program:e,uniforms:n,undefinedOnly:i=!1}){Rx(e);const r=".*Matrix",s={},o=Object.keys(e._uniformSetters).sort();let a=0;for(const u of o)!u.match(".*_.*")&&!u.match(r)&&gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)u.match(r)&&gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)s[u]||gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;let l=0;const c={};if(!i)for(const u in n){const e=n[u];s[u]||(l++,c[u]={Type:`NOT USED: ${e}`,[t]:hO(e)})}return{table:s,count:a,unusedTable:c,unusedCount:l}}function gO({table:t,header:e,uniforms:n,uniformName:i,undefinedOnly:r}){const s=n[i],o=function(t){return null!=t}(s);return!(r&&o||(t[i]={[e]:o?hO(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function mO(t){const{type:e,size:n}=t.accessor,i=tO(e,n);return i?`${i.name} ${t.name}`:t.name}const bO={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function yO(t,e){const{attributeMap:n=bO}=e||{};return n&&n[t]||t}function vO(t,e){let n;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Rx(Number.isFinite(e.size),`attribute ${t} needs size`)}const _O=()=>{},wO={};class xO{constructor(t,e={}){const{id:n=Fx("model")}=e;Rx(jw(t)),this.id=n,this.gl=t,this.id=e.id||Fx("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||sO.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},Rx(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return Rx(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return Rx(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,n){const i={};let r=e.indices;for(const s in e.attributes){const n=e.attributes[s],o=yO(s,undefined);if("indices"===s)r=n;else if(n.constant)i[o]=n.value;else{const e=n.value,r=bt({},n);delete r.value,i[o]=[new tS(t,e),r],vO(s,r)}}if(r){const e=r.value||r;Rx(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const n={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new tS(t,{data:e,target:34963}),n]}return i}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(t={}){if(Vx(t))return this;const e={};for(const n in t){const i=t[n];e[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(e),this}setUniforms(t={}){return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return pS(this.program.gl,t),this}draw(t={}){this._checkProgram();const{moduleSettings:e=null,framebuffer:n,uniforms:i={},attributes:r={},transformFeedback:s=this.transformFeedback,parameters:o={},vertexArray:a=this.vertexArray}=t;let l;this.setAttributes(r),this.updateModuleSettings(e),this.setUniforms(i),Nw.priority>=2&&(l=this._logDrawCallStart(2));const c=this.vertexArray.getDrawParams(),{isIndexed:u=c.isIndexed,indexType:h=c.indexType,indexOffset:d=c.indexOffset,vertexArrayInstanced:p=c.isInstanced}=this.props;p&&!this.isInstanced&&Nw.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:f,instanceCount:g}=this,{onBeforeRender:m=_O,onAfterRender:b=_O}=this.props;m(),this.program.setUniforms(this.uniforms);const y=this.program.draw(Object.assign(wO,t,{logPriority:l,uniforms:null,framebuffer:n,parameters:o,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:a,transformFeedback:s,isIndexed:u,indexType:h,isInstanced:f,instanceCount:g,offset:u?d:0}));return b(),Nw.priority>=2&&this._logDrawCallEnd(l,a,n),y}transform(t={}){const{discard:e=!0,feedbackBuffers:n,unbindModels:i=[]}=t;let{parameters:r}=t;n&&this._setFeedbackBuffers(n),e&&(r=Object.assign({},r,{35977:e})),i.forEach(t=>t.vertexArray.unbindBuffers());try{this.draw(Object.assign({},t,{parameters:r}))}finally{i.forEach(t=>t.vertexArray.bindBuffers())}return this}render(t={}){return Nw.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:n,modules:i,inject:r,defines:s,varyings:o,bufferMode:a,transpileToGLSL100:l}=this.programProps;t=this.programManager.get({vs:e,fs:n,modules:i,inject:r,defines:s,varyings:o,bufferMode:a,transpileToGLSL100:l}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Rx(t instanceof rO,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new uO(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof tS&&e.delete()}}_setAnimationProps(t){this.animated&&Rx(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(t={}){if(Vx(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new LE(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:Nw.level<=2})(),t}_logDrawCallEnd(t,e,n,i){if(void 0===t)return;const r=function({vertexArray:t,header:e="Attributes"}){if(!t.configuration)return{};const n={};t.elements&&(n.ELEMENT_ARRAY_BUFFER=dO(t,t.elements,null,e));const i=t.values;for(const r in i){const s=t._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=t.accessors[s.location];a&&(o=`${r}: ${pO(s.name,a)}`),n[o]=dO(t,i[r],a,e)}}return n}({vertexArray:e,header:`${this.id} attributes`,attributes:this._attributes}),{table:s,unusedTable:o,unusedCount:a}=fO({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),{table:l,count:c}=fO({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0});c>0&&Nw.log("MISSING UNIFORMS",Object.keys(l))(),a>0&&Nw.log("UNUSED UNIFORMS",Object.keys(o))();const u=function(t){const e={},n=`Accessors for ${t.id}`;for(const i of t.attributeInfos)i&&(e[`in ${mO(i)}`]={[n]:JSON.stringify(i.accessor)});for(const i of t.varyingInfos)i&&(e[`out ${mO(i)}`]={[n]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);Nw.table(t,r)(),Nw.table(t,s)(),Nw.table(t+1,u)(),i&&i.log({logLevel:2,message:`Rendered to ${i.id}`}),Nw.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class SO{static isSupported(t){return Fw(t)}constructor(t,e={}){this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:n}=this;t&&t.delete(),e&&e.delete(),n&&n.delete()}run(t={}){const{clearRenderTarget:e=!0}=t,n=this._updateDrawOptions(t);e&&n.framebuffer&&n.framebuffer.clear({color:!0}),this.model.transform(n)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)t=t||n.swap();Rx(t,"Nothing to swap")}getBuffer(t=null){return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(t={}){const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e){const e=n.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(t={}){"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)n.update(t)}_initialize(t={}){const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new xO(e,Object.assign({},t,{fs:t.fs||NE({version:FE(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=i.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){return!(Vx(t.feedbackBuffers)&&Vx(t.feedbackMap)&&!(t.varyings&&t.varyings.length>0))})(e)&&(this.bufferTransform=new jE(t,e)),function(t){return!(Vx(t._sourceTextures)&&!t._targetTexture&&!t._targetTextureVarying)}(e)&&(this.textureTransform=new QE(t,e)),Rx(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=Object.assign(e,i.getDrawOptions(e));return e}}function EO(){}const CO={onStart:EO,onUpdate:EO,onInterrupt:EO,onEnd:EO};class OO{constructor(t){this._inProgress=!1,this._handle=null,this.timeline=t,this.settings={}}get inProgress(){return this._inProgress}start(t){this.cancel(),this.settings=bt(bt({},CO),t),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const TO={interpolation:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="interpolation",this.transition=new OO(n),this.attribute=e,this.attributeInTransition=new kE(t,e.settings),this.currentStartIndices=e.startIndices,this.currentLength=0,this.transform=function(t,e){const n=EE(e.size);return new SO(t,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(t,e);const i={byteLength:0,usage:35050};this.buffers=[new tS(t,i),new tS(t,i)]}get inProgress(){return this.transition.inProgress}start(t,e){if(t.duration<=0)return void this.transition.cancel();const{buffers:n,attribute:i}=this;CE(n);const r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)TE(bt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=OE(i,e),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:n[0],aTo:SE(0,i)},feedbackBuffers:{vCurrent:n[1]}})}update(){const t=this.transition.update();if(t){const{time:t,settings:{duration:e,easing:n}}=this.transition,i=n(t/e);this.transform.run({uniforms:{time:i}})}return t}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="spring",this.transition=new OO(n),this.attribute=e,this.attributeInTransition=new kE(t,ti(bt({},e.settings),{normalized:!1})),this.currentStartIndices=e.startIndices,this.currentLength=0,this.texture=function(t){return new lS(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(t),this.framebuffer=function(t,e){return new SS(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(t,this.texture),this.transform=function(t,e,n){const i=EE(e.size);return new SO(t,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(t,e,this.framebuffer);const i={byteLength:0,usage:35050};this.buffers=[new tS(t,i),new tS(t,i),new tS(t,i)]}get inProgress(){return this.transition.inProgress}start(t,e){const{buffers:n,attribute:i}=this,r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)TE(bt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=OE(i,e),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aTo:SE(0,i)}})}update(){const{buffers:t,transform:e,framebuffer:n,transition:i}=this;return!!i.update()&&(e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:i.settings.stiffness,damping:i.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),CE(t),this.attributeInTransition.update({buffer:t[1],value:this.attribute.value}),_S(n)[0]>0||i.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class kO{constructor(t,{id:e,timeline:n}){this.id=e,this.gl=t,this.timeline=n,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=SO.isSupported(t)}finalize(){for(const t in this.transitions)this._removeTransition(t)}update({attributes:t,transitions:e,numInstances:n}){this.numInstances=n||1;for(const i in t){const n=t[i],r=n.getTransitionSetting(e);!r||this._updateAttribute(i,n,r)}for(const i in this.transitions){const n=t[i];(!n||!n.getTransitionSetting(e))&&this._removeTransition(i)}}hasAttribute(t){const e=this.transitions[t];return e&&e.inProgress}getAttributes(){const t={};for(const e in this.transitions){const n=this.transitions[e];n.inProgress&&(t[e]=n.attributeInTransition)}return t}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const e in this.transitions)this.transitions[e].update()&&(this.needsRedraw=!0);const t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].cancel(),delete this.transitions[t]}_updateAttribute(t,e,n){const i=this.transitions[t];let r=!i||i.type!==n.type;if(r){if(!this.isSupported)return void Iw.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();i&&this._removeTransition(t);const s=TO[n.type];s?this.transitions[t]=new s({attribute:e,timeline:this.timeline,gl:this.gl}):(Iw.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}const AO="attributeManager.invalidate";class PO{constructor(t,{id:e="attribute-manager",stats:n,timeline:i}={}){this.id=e,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=n,this.attributeTransitionManager=new kO(t,{id:"".concat(e,"-transitions"),timeline:i}),Object.seal(this)}finalize(){for(const t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(t={clearRedrawFlags:!1}){const e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}setNeedsRedraw(t=!0){return this.needsRedraw=!0,this}add(t,e){this._add(t,e)}addInstanced(t,e){this._add(t,e,{instanced:1})}remove(t){for(let e=0;e{t[n]||(t[n]=[]),t[n].push(e)});this.updateTriggers=t}_invalidateTrigger(t,e){const{attributes:n,updateTriggers:i}=this,r=i[t];return r&&r.forEach(t=>{const i=n[t];i&&i.setNeedsUpdate(i.id,e)}),r}_updateAttribute(t){const{attribute:e,numInstances:n}=t;PE("attribute.updateStart",e),e.allocate(n)&&PE("attribute.allocate",e,n),e.updateBuffer(t)&&(this.needsRedraw=!0,PE("attribute.updateEnd",e,n))}}function IO(t,e,n,i,r){const s=e-t;return(n-e)*r+-s*i+s+e}function MO(t,e){if(Array.isArray(t)){let n=0;for(let i=0;i0}add(t,e,n,i){const{transitions:r}=this;if(r.has(t)){const n=r.get(t),{value:i=n.settings.fromValue}=n;e=i,this.remove(t)}if(!(i=xE(i)))return;const s=DO[i.type];if(!s)return void Iw.error("unsupported transition type '".concat(i.type,"'"))();const o=new s(this.timeline);o.start(ti(bt({},i),{fromValue:e,toValue:n})),r.set(t,o)}remove(t){const{transitions:e}=this;e.has(t)&&(e.get(t).cancel(),e.delete(t))}update(){const t={};for(const[e,n]of this.transitions)n.update(),t[e]=n.value,n.inProgress||this.remove(e);return t}clear(){for(const t of this.transitions.keys())this.remove(t)}}const NO={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:LO}=NO;function jO(t,e){if(!t.transitions)return null;const n={},i=UO(t);for(const r in t.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&BO(t[r],e[r],s)&&(n[r]=!0)}return n}function FO({newProps:t,oldProps:e,ignoreProps:n={},propTypes:i={},triggerName:r="props"}={}){if(e===t)return null;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(t))if(!(s in n)){if(!(s in e))return"".concat(r,".").concat(s," added");const n=BO(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}for(const s of Object.keys(e))if(!(s in n)){if(!(s in t))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(t,s)){const n=BO(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}}return null}function BO(t,e,n){let i=n&&n.equal;return i&&!i(t,e,n)||!i&&(i=t&&e&&t.equals,i&&!i.call(t,e))?"changed deeply":i||e===t?null:"changed shallowly"}function VO(t,e){if(null===e)return"oldProps is null, initial diff";const n=e.extensions,{extensions:i}=t;if(i===n)return!1;if(i.length!==n.length)return!0;for(let r=0;r{for(const r in i)if(!HO(i[r],n[r])){e=t(i),n=i;break}return e}}function GO(t,e){if(!e)return t;const n=bt(bt({},t),e);if("defines"in e&&(n.defines=bt(bt({},t.defines),e.defines)),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some(t=>"project64"===t.name))){const t=n.modules.findIndex(t=>"project32"===t.name);t>=0&&n.modules.splice(t,1)}if("inject"in e)if(t.inject){const i=bt({},t.inject);for(const t in e.inject)i[t]=(i[t]||"")+e.inject[t];n.inject=i}else n.inject=e.inject;return n}function WO(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],g=e[13],m=e[14],b=e[15],y=n*a-i*o,v=n*l-r*o,_=n*c-s*o,w=i*l-r*a,x=i*c-s*a,S=r*c-s*l,E=u*g-h*f,C=u*m-d*f,O=u*b-p*f,T=h*m-d*g,k=h*b-p*g,A=d*b-p*m,P=y*A-v*k+_*T+w*O-x*C+S*E;return P?(t[0]=(a*A-l*k+c*T)*(P=1/P),t[1]=(r*k-i*A-s*T)*P,t[2]=(g*S-m*x+b*w)*P,t[3]=(d*x-h*S-p*w)*P,t[4]=(l*O-o*A-c*C)*P,t[5]=(n*A-r*O+s*C)*P,t[6]=(m*_-f*S-b*v)*P,t[7]=(u*S-d*_+p*v)*P,t[8]=(o*k-a*O+c*E)*P,t[9]=(i*O-n*k-s*E)*P,t[10]=(f*x-g*_+b*y)*P,t[11]=(h*_-u*x-p*y)*P,t[12]=(a*C-o*T-l*E)*P,t[13]=(n*T-i*C+r*E)*P,t[14]=(g*v-f*w-m*y)*P,t[15]=(u*w-h*v+d*y)*P,t):null}function qO(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],b=e[14],y=e[15],v=n[0],_=n[1],w=n[2],x=n[3];return t[0]=v*i+_*a+w*h+x*g,t[1]=v*r+_*l+w*d+x*m,t[2]=v*s+_*c+w*p+x*b,t[3]=v*o+_*u+w*f+x*y,t[4]=(v=n[4])*i+(_=n[5])*a+(w=n[6])*h+(x=n[7])*g,t[5]=v*r+_*l+w*d+x*m,t[6]=v*s+_*c+w*p+x*b,t[7]=v*o+_*u+w*f+x*y,t[8]=(v=n[8])*i+(_=n[9])*a+(w=n[10])*h+(x=n[11])*g,t[9]=v*r+_*l+w*d+x*m,t[10]=v*s+_*c+w*p+x*b,t[11]=v*o+_*u+w*f+x*y,t[12]=(v=n[12])*i+(_=n[13])*a+(w=n[14])*h+(x=n[15])*g,t[13]=v*r+_*l+w*d+x*m,t[14]=v*s+_*c+w*p+x*b,t[15]=v*o+_*u+w*f+x*y,t}function XO(t,e,n){var i,r,s,o,a,l,c,u,h,d,p,f,g=n[0],m=n[1],b=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*b+e[12],t[13]=e[1]*g+e[5]*m+e[9]*b+e[13],t[14]=e[2]*g+e[6]*m+e[10]*b+e[14],t[15]=e[3]*g+e[7]*m+e[11]*b+e[15]):(r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=i=e[0],t[1]=r,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=i*g+a*m+h*b+e[12],t[13]=r*g+l*m+d*b+e[13],t[14]=s*g+c*m+p*b+e[14],t[15]=o*g+u*m+f*b+e[15]),t}function YO(t,e,n){var i=n[0],r=n[1],s=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function KO(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*i,t[5]=o*r+u*i,t[6]=a*r+h*i,t[7]=l*r+d*i,t[8]=c*r-s*i,t[9]=u*r-o*i,t[10]=h*r-a*i,t[11]=d*r-l*i,t}function QO(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*i,t[1]=o*r+u*i,t[2]=a*r+h*i,t[3]=l*r+d*i,t[4]=c*r-s*i,t[5]=u*r-o*i,t[6]=h*r-a*i,t[7]=d*r-l*i,t}function ZO(t,e,n,i,r){var s,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+i)*(s=1/(i-r)),t[14]=2*r*i*s):(t[10]=-1,t[14]=-2*i),t}function JO(t,e){var n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],b=t[15],y=e[0],v=e[1],_=e[2],w=e[3],x=e[4],S=e[5],E=e[6],C=e[7],O=e[8],T=e[9],k=e[10],A=e[11],P=e[12],I=e[13],M=e[14],D=e[15];return Math.abs(n-y)<=WS*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-v)<=WS*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(r-_)<=WS*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(s-w)<=WS*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(o-x)<=WS*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-S)<=WS*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(l-E)<=WS*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-C)<=WS*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(u-O)<=WS*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(h-T)<=WS*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-k)<=WS*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-A)<=WS*Math.max(1,Math.abs(p),Math.abs(A))&&Math.abs(f-P)<=WS*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(g-I)<=WS*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(m-M)<=WS*Math.max(1,Math.abs(m),Math.abs(M))&&Math.abs(b-D)<=WS*Math.max(1,Math.abs(b),Math.abs(D))}function tT(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function eT(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*s+n[12]*o,t[1]=n[1]*i+n[5]*r+n[9]*s+n[13]*o,t[2]=n[2]*i+n[6]*r+n[10]*s+n[14]*o,t[3]=n[3]*i+n[7]*r+n[11]*s+n[15]*o,t}!function(){var t=new qS(4);qS!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();const nT=[0,0,0,0],iT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],rT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],sT=[0,0,0],oT=[0,0,0],aT=$O(function({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(t,e,n){const{viewMatrixUncentered:i,projectionMatrix:r}=t;let{viewMatrix:s,viewProjectionMatrix:o}=t,a=nT,l=nT,c=t.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:d}=lT(t,e,n);return d&&(l=t.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=eT([],l,o),s=i||s,o=qO([],r,s),o=qO([],o,iT)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(t,n,i),u=t.getDistanceScales(),h=[t.width*e,t.height*e],d=t.projectionMatrix.transform([0,0,-t.focalDistance,1])[3]||1,p={project_uCoordinateSystem:n,project_uProjectionMode:t.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:h,project_uDevicePixelRatio:e,project_uFocalDistance:d,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:sT,project_uScale:t.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const e=t.getDistanceScales(c);switch(n){case Mw.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerMeter2;break;case Mw.LNGLAT:case Mw.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerDegree2;break;case Mw.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,e.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,e.unitsPerMeter2[2]]}}return p});function lT(t,e,n=oT){let i,r=n,s=!0;switch(i=e===Mw.LNGLAT_OFFSETS||e===Mw.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case Dw.WEB_MERCATOR:(e===Mw.LNGLAT||e===Mw.CARTESIAN)&&(s=!1);break;case Dw.WEB_MERCATOR_AUTO_OFFSET:e===Mw.LNGLAT?r=i:e===Mw.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case Dw.IDENTITY:r=t.position.map(Math.fround);break;case Dw.GLOBE:s=!1,i=null;break;default:s=!1}return r[2]=r[2]||0,{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}class cT extends VS{get ELEMENTS(){return BS(!1),0}get RANK(){return BS(!1),0}toString(){let t="[";if(IS.printRowMajor){t+="row-major:";for(let e=0;e2*Math.PI)throw Error("radians");const s=n*Math.tan(t/2),o=s*e;return(new bT).ortho({left:-o,right:o,bottom:-s,top:s,near:i,far:r})}perspective({fovy:t,fov:e=45*Math.PI/180,aspect:n=1,near:i=.1,far:r=500}={}){if((t=t||e)>2*Math.PI)throw Error("radians");return ZO(this,t,n,i,r),this.check()}determinant(){return function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],p=t[12],f=t[13],g=t[14],m=t[15];return(e*o-n*s)*(h*m-d*g)-(e*a-i*s)*(u*m-d*f)+(e*l-r*s)*(u*g-h*f)+(n*a-i*o)*(c*m-d*p)-(n*l-r*o)*(c*g-h*p)+(i*l-r*a)*(c*f-u*p)}(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const n=this.getScale(e||[-0,-0,-0]),i=1/n[0],r=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*r,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*r,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const n=this.getScale(e||[-0,-0,-0]),i=1/n[0],r=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*s,t[3]=this[4]*i,t[4]=this[5]*r,t[5]=this[6]*s,t[6]=this[8]*i,t[7]=this[9]*r,t[8]=this[10]*s,t}transpose(){return function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=r,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]}(this,this),this.check()}invert(){return WO(this,this),this.check()}multiplyLeft(t){return qO(this,t,this),this.check()}multiplyRight(t){return qO(this,this,t),this.check()}rotateX(t){return KO(this,this,t),this.check()}rotateY(t){return function(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*i,t[1]=o*r-u*i,t[2]=a*r-h*i,t[3]=l*r-d*i,t[8]=s*i+c*r,t[9]=o*i+u*r,t[10]=a*i+h*r,t[11]=l*i+d*r}(this,this,t),this.check()}rotateZ(t){return QO(this,this,t),this.check()}rotateXYZ([t,e,n]){return this.rotateX(t).rotateY(e).rotateZ(n)}rotateAxis(t,e){return function(t,e,n,i){var r,s,o,a,l,c,u,h,d,p,f,g,m,b,y,v,_,w,x,S,E,C,O,T,k=i[0],A=i[1],P=i[2],I=Math.hypot(k,A,P);I=-90&&e<=90,"invalid latitude"),[512*(t*ET+xT)/(2*xT),512*(xT+Math.log(Math.tan(ST+e*ET*.5)))/(2*xT)]}function kT([t,e]){const n=t/512*(2*xT)-xT,i=2*(Math.atan(Math.exp(e/512*(2*xT)-xT))-ST);return[n*CT,i*CT]}function AT({latitude:t,longitude:e,highPrecision:n=!1}){wT(Number.isFinite(t)&&Number.isFinite(e));const i={},r=Math.cos(t*ET),s=512/360,o=s/r,a=512/OT/r;if(i.unitsPerMeter=[a,a,a],i.metersPerUnit=[1/a,1/a,1/a],i.unitsPerDegree=[s,o,a],i.degreesPerUnit=[1/s,1/o,1/a],n){const e=ET*Math.tan(t*ET)/r,n=512/OT*e,l=n/o*a;i.unitsPerDegree2=[0,s*e/2,n],i.unitsPerMeter2=[l,0,l]}return i}function PT(t,e){const[n,i,r]=t,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=AT({longitude:n,latitude:i,highPrecision:!0}),u=TT(t);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=kT(u),d=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],d]:h}function IT({height:t,pitch:e,bearing:n,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return XO(o,o,[0,0,-i]),KO(o,o,-e*ET),QO(o,o,n*ET),YO(o,o,[r/=t,r,r]),s&&XO(o,o,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],s)),o}function MT({width:t,height:e,fovy:n=DT(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(n=DT(i));const a=.5*n*ET,l=RT(n),c=r*ET,u=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:t/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}function DT(t){return 2*Math.atan(.5/t)*CT}function RT(t){return.5/Math.tan(.5*t*ET)}function NT(t,e){const[n,i,r=0]=t;return wT(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),yT(e,[n,i,r,1])}function LT(t,e,n=0){const[i,r,s]=t;if(wT(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return yT(e,[i,r,s,1]);const o=yT(e,[i,r,0,1]),a=yT(e,[i,r,1,1]),l=o[2],c=a[2];return dT([],o,a,l===c?0:((n||0)-l)/(c-l))}function jT({width:t,height:e,bounds:n,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=n;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:wT(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=new zT({width:t,height:e,longitude:0,latitude:0,zoom:0}),d=h.project([a,u]),p=h.project([c,l]),f=[Math.max(Math.abs(p[0]-d[0]),i),Math.max(Math.abs(p[1]-d[1]),i)],g=[t-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];wT(g[0]>0&&g[1]>0);const m=g[0]/f[0],b=g[1]/f[1],y=h.unproject([(p[0]+d[0])/2+(s.right-s.left)/2/m,(p[1]+d[1])/2+(s.bottom-s.top)/2/b]),v=Math.min(r,h.zoom+_T(Math.abs(Math.min(m,b))));return wT(Number.isFinite(v)),{longitude:y[0],latitude:y[1],zoom:v}}const FT=Math.PI/180;function BT(t,e=0){const{width:n,height:i,unproject:r}=t,s={targetZ:e},o=r([0,i],s),a=r([n,i],s);let l,c;return(t.fovy?.5*t.fovy*FT:Math.atan(.5/t.altitude))>(90-t.pitch)*FT-.01?(l=VT(t,0,e),c=VT(t,n,e)):(l=r([0,0],s),c=r([n,0],s)),[o,a,c,l]}function VT(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=yT(i,[e,0,1,1]),s=yT(i,[e,t.height,1,1]),o=kT(dT([],r,s,(n*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return o[2]=n,o}class zT{constructor({width:t,height:e,latitude:n=0,longitude:i=0,zoom:r=0,pitch:s=0,bearing:o=0,altitude:a=null,fovy:l=null,position:c=null,nearZMultiplier:u=.02,farZMultiplier:h=1.01}={width:1,height:1}){t=t||1,e=e||1,null===l&&null===a?l=DT(a=1.5):null===l?l=DT(a):null===a&&(a=RT(l));const d=function(t){return Math.pow(2,t)}(r);a=Math.max(.75,a);const p=AT({longitude:i,latitude:n}),f=TT([i,n]);f[2]=0,c&&function(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}(f,f,function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}([],c,p.unitsPerMeter)),this.projectionMatrix=function({width:t,height:e,pitch:n,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:u}=MT({width:t,height:e,altitude:i,fovy:r,pitch:n,nearZMultiplier:s,farZMultiplier:o});return ZO([],a,l,c,u)}({width:t,height:e,pitch:s,fovy:l,nearZMultiplier:u,farZMultiplier:h}),this.viewMatrix=IT({height:e,scale:d,center:f,pitch:s,bearing:o,altitude:a}),this.width=t,this.height=e,this.scale=d,this.latitude=n,this.longitude=i,this.zoom=r,this.pitch=s,this.bearing=o,this.altitude=a,this.fovy=l,this.center=f,this.meterOffset=c||[0,0,0],this.distanceScales=p,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:t,height:e,projectionMatrix:n,viewMatrix:i}=this,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];qO(r,r,n),qO(r,r,i),this.viewProjectionMatrix=r;const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];YO(s,s,[t/2,-e/2,1]),XO(s,s,[1,-1,0]),qO(s,s,r);const o=WO([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],s);if(!o)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=s,this.pixelUnprojectionMatrix=o}equals(t){return t instanceof zT&&t.width===this.width&&t.height===this.height&&JO(t.projectionMatrix,this.projectionMatrix)&&JO(t.viewMatrix,this.viewMatrix)}project(t,{topLeft:e=!0}={}){const n=NT(this.projectPosition(t),this.pixelProjectionMatrix),[i,r]=n,s=e?r:this.height-r;return 2===t.length?[i,s]:[i,s,n[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,r,s]=t,o=LT([i,e?r:this.height-r,s],this.pixelUnprojectionMatrix,n&&n*this.distanceScales.unitsPerMeter[2]),[a,l,c]=this.unprojectPosition(o);return Number.isFinite(s)?[a,l,c]:Number.isFinite(n)?[a,l,n]:[a,l]}projectPosition(t){const[e,n]=TT(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=kT(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return TT(t)}unprojectFlat(t){return kT(t)}getMapCenterByLngLatPosition({lngLat:t,pos:e}){const n=LT(e,this.pixelUnprojectionMatrix),i=uT([],TT(t),hT([],n));return kT(uT([],this.center,i))}getLocationAtPoint({lngLat:t,pos:e}){return this.getMapCenterByLngLatPosition({lngLat:t,pos:e})}fitBounds(t,e={}){const{width:n,height:i}=this,{longitude:r,latitude:s,zoom:o}=jT(Object.assign({width:n,height:i,bounds:t},e));return new zT({width:n,height:i,longitude:r,latitude:s,zoom:o})}getBounds(t){const e=this.getBoundingRegion(t),n=Math.min(...e.map(t=>t[0])),i=Math.max(...e.map(t=>t[0]));return[[n,Math.min(...e.map(t=>t[1]))],[i,Math.max(...e.map(t=>t[1]))]]}getBoundingRegion(t={}){return BT(this,t.z||0)}}const UT=Math.PI/180,HT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],$T=[0,0,0],GT={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let WT=(()=>{class t{constructor(t={}){const{id:e=null,x:n=0,y:i=0,width:r=1,height:s=1}=t;this.id=e||this.constructor.displayName||"viewport",this.x=n,this.y=i,this.width=r||1,this.height=s||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?Dw.WEB_MERCATOR:Dw.WEB_MERCATOR_AUTO_OFFSET:Dw.IDENTITY}equals(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&FS(e.projectionMatrix,this.projectionMatrix)&&FS(e.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const n=NT(this.projectPosition(t),this.pixelProjectionMatrix),[i,r]=n,s=e?r:this.height-r;return 2===t.length?[i,s]:[i,s,n[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,r,s]=t,o=LT([i,e?r:this.height-r,s],this.pixelUnprojectionMatrix,n&&n*this.distanceScales.unitsPerMeter[2]),[a,l,c]=this.unprojectPosition(o);return Number.isFinite(s)?[a,l,c]:Number.isFinite(n)?[a,l,n]:[a,l]}projectPosition(t){const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?TT(t):t}unprojectFlat(t){return this.isGeospatial?kT(t):t}getBounds(t={}){const e={targetZ:t.z||0},n=this.unproject([0,0],e),i=this.unproject([this.width,0],e),r=this.unproject([0,this.height],e),s=this.unproject([this.width,this.height],e);return[Math.min(n[0],i[0],r[0],s[0]),Math.min(n[1],i[1],r[1],s[1]),Math.max(n[0],i[0],r[0],s[0]),Math.max(n[1],i[1],r[1],s[1])]}getDistanceScales(t=null){return t?AT({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:e,width:n=1,height:i=1}){return t{class t extends WT{constructor(t={}){const{latitude:e=0,longitude:n=0,zoom:i=11,pitch:r=0,bearing:s=0,nearZMultiplier:o=.1,farZMultiplier:a=1.01,orthographic:l=!1,repeat:c=!1,worldOffset:u=0}=t;let{width:h,height:d,altitude:p=1.5}=t;const f=Math.pow(2,i);h=h||1,d=d||1,p=Math.max(.75,p);const{fov:g,aspect:m,focalDistance:b,near:y,far:v}=MT({width:h,height:d,pitch:r,altitude:p,nearZMultiplier:o,farZMultiplier:a});let _=IT({height:d,pitch:r,bearing:s,scale:f,altitude:p});u&&(_=(new bT).translate([512*u,0,0]).multiplyLeft(_)),super(ti(bt({},t),{width:h,height:d,viewMatrix:_,longitude:n,latitude:e,zoom:i,orthographic:l,fovyRadians:g,aspect:m,focalDistance:b,near:y,far:v})),this.latitude=e,this.longitude=n,this.zoom=i,this.pitch=r,this.bearing=s,this.altitude=p,this.orthographic=l,this._subViewports=c?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const e=this.getBounds(),n=Math.floor((e[0]+180)/360),i=Math.ceil((e[2]-180)/360);for(let r=n;r<=i;r++){const e=r?new t(ti(bt({},this),{worldOffset:r})):this;this._subViewports.push(e)}}return this._subViewports}addMetersToLngLat(t,e){return PT(t,e)}panByPosition(t,e){const n=LT(e,this.pixelUnprojectionMatrix),i=uT([],this.projectFlat(t),hT([],n)),r=uT([],this.center,i),[s,o]=this.unprojectFlat(r);return{longitude:s,latitude:o}}getBounds(t={}){const e=BT(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(e,n={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=jT(bt({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:s,latitude:o,zoom:a})}}return t.displayName="WebMercatorViewport",t})();function XT(t,e,n=!1){const i=e.projectPosition(t);if(n&&e instanceof qT){const[n,r,s=0]=t,o=e.getDistanceScales([n,r]);i[2]=s*o.unitsPerMeter[2]}return i}function KT(t,{viewport:e,modelMatrix:n,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=t;switch(n&&([o,a,l]=eT([],[o,a,l,1],n)),i){case Mw.LNGLAT:return XT([o,a,l],e,s);case Mw.LNGLAT_OFFSETS:return XT([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mw.METER_OFFSETS:return XT(PT(r,[o,a,l]),e,s);case Mw.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const QT={10241:9987,10240:9729,10242:33071,10243:33071},ZT={},JT={boolean:{validate:(t,e)=>!0,equal:(t,e,n)=>Boolean(t)===Boolean(e)},number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},color:{validate:(t,e)=>e.optional&&!t||ik(t)&&(3===t.length||4===t.length),equal:(t,e,n)=>tk(t,e)},accessor:{validate(t,e){const n=rk(t);return"function"===n||n===rk(e.value)},equal:(t,e,n)=>"function"==typeof e||tk(t,e)},array:{validate:(t,e)=>e.optional&&!t||ik(t),equal:(t,e,n)=>n.compare?tk(t,e):t===e},function:{validate:(t,e)=>e.optional&&!t||"function"==typeof t,equal:(t,e,n)=>!n.compare||t===e},data:{transform:(t,e,n)=>{const{dataTransform:i}=n?n.props:{};return i&&t?i(t):t}},image:{transform:(t,e,n)=>function(t,e){const n=t.context&&t.context.gl;if(!n||!e)return null;if(e instanceof lS)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new lS(n,ti(bt({},e),{parameters:bt(bt(bt({},QT),i),t.props.textureParameters)}));return ZT[r.id]=!0,r}(n,t),release:t=>{!function(t){!t||!(t instanceof lS)||ZT[t.id]&&(t.delete(),delete ZT[t.id])}(t)}}};function tk(t,e){if(t===e)return!0;if(!ik(t)||!ik(e))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i{},this.oldProps=yk,this.oldAsyncProps=null}finalize(){for(const t in this.asyncProps){const e=this.asyncProps[t];e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){const e=this.asyncProps[t];return e&&e.resolvedValue}isAsyncPropLoading(t){if(t){const e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(const e in this.asyncProps)if(this.isAsyncPropLoading(e))return!0;return!1}reloadAsyncProp(t,e){this._watchPromise(t,Promise.resolve(e))}setAsyncProps(t){const e=t[mk]||{},n=t[gk]||t,i=t[bk]||{};for(const r in e){const t=e[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t),e[r]=this.getAsyncProp(r)}for(const r in n){const t=n[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t)}}_updateAsyncProp(t,e){if(this._didAsyncInputValueChange(t,e)){if("string"==typeof e){var n;const i=null===(n=this.layer)||void 0===n?void 0:n.props.fetch;i&&(e=i(e,{propName:t,layer:this.layer}))}if(e instanceof Promise)return void this._watchPromise(t,e);if(fE(e))return void this._resolveAsyncIterable(t,e);this._setPropValue(t,e)}}_didAsyncInputValueChange(t,e){const n=this.asyncProps[t];return e!==n.resolvedValue&&e!==n.lastValue&&(n.lastValue=e,!0)}_setPropValue(t,e){const n=this.asyncProps[t];e=this._postProcessValue(n,e),n.resolvedValue=e,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}_setAsyncPropValue(t,e,n){const i=this.asyncProps[t];i&&n>=i.resolvedLoadCount&&void 0!==e&&(this.freezeAsyncOldProps(),i.resolvedValue=e,i.resolvedLoadCount=n,this.onAsyncPropUpdated(t,e))}_watchPromise(t,e){const n=this.asyncProps[t];n.pendingLoadCount++;const i=n.pendingLoadCount;e.then(e=>{var r;e=this._postProcessValue(n,e),this._setAsyncPropValue(t,e,i);const s=null===(r=this.layer)||void 0===r?void 0:r.props.onDataLoad;"data"===t&&s&&s(e,{propName:t,layer:this.layer})}).catch(e=>{var n;null===(n=this.layer)||void 0===n||n.raiseError(e,"loading ".concat(t," of ").concat(this.layer))})}_resolveAsyncIterable(t,e){var n=this;return gS(function*(){var i;"data"!==t&&n._setPropValue(t,e);const r=n.asyncProps[t];r.pendingLoadCount++;const s=r.pendingLoadCount;let o=[],a=0;var l,c=!0,u=!1;try{for(var h,d,p=fk(e);c=(h=yield p.next()).done,d=yield h.value,!c;c=!0){const e=d,{dataTransform:i}=n.component?n.component.props:{};o=i?i(e,o):o.concat(e),Object.defineProperty(o,"__diff",{enumerable:!1,value:[{startRow:a,endRow:o.length}]}),a=o.length,n._setAsyncPropValue(t,o,s)}}catch(g){u=!0,l=g}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(u)throw l}}const f=null===(i=n.layer)||void 0===i?void 0:i.props.onDataLoad;f&&f(o,{propName:t,layer:n.layer})})()}_postProcessValue(t,e){const n=t.type;return n&&(n.release&&n.release(t.resolvedValue,n,this.component),n.transform)?n.transform(e,n,this.component):e}_createAsyncPropData(t,e){if(!this.asyncProps[t]){const n=this.component&&this.component.constructor._propTypes;this.asyncProps[t]={type:n&&n[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:_k,ASYNC_RESOLVED:wk,ASYNC_DEFAULTS:xk}=NO,Sk={};let Ek=0,Ck=(()=>{class t{constructor(){this.props=ck.apply(this,arguments),this.id=this.props.id,this.count=Ek++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:e}=this,n={};for(const i in e[xk])i in e[wk]?n[i]=e[wk][i]:i in e[_k]&&(n[i]=e[_k][i]);return new this.constructor(bt(bt(bt({},e),n),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new vk({})}}return t.componentName="Component",t.defaultProps=Sk,t})();class Ok extends vk{constructor({attributeManager:t,layer:e}){super(e),this.attributeManager=t,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(t){this.component=t}}const Tk=t=>"function"==typeof t,kk=t=>null!==t&&"object"==typeof t,Ak=t=>kk(t)&&t.constructor==={}.constructor,Pk=t=>t&&"function"==typeof t[Symbol.iterator],Ik=t=>t&&"function"==typeof t[Symbol.asyncIterator],Mk=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Dk=t=>"undefined"!=typeof Blob&&t instanceof Blob,Rk=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||kk(t)&&Tk(t.tee)&&Tk(t.cancel)&&Tk(t.getReader))(t)||(t=>kk(t)&&Tk(t.read)&&Tk(t.pipe)&&(t=>"boolean"==typeof t)(t.readable))(t);function Nk(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function Lk(t){var e;return!!t&&(Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions))}function jk(t){var e,n;let i;return Nk(t,"null loader"),Nk(Lk(t),"invalid loader"),Array.isArray(t)&&(i=t[1],t=ti(bt({},t=t[0]),{options:bt(bt({},t.options),i)})),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(n=t)&&void 0!==n&&n.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const Fk={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Bk=Fk.global||Fk.self||Fk.window||{},Vk="object"!=typeof process||"[object process]"!==String(process)||process.browser,zk="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);zk&&parseFloat(zk[1]);const Uk={};function Hk(t){for(const e in Uk)t.startsWith(e)&&(t=t.replace(e,Uk[e]));return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${t}`),t}const $k=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Gk=/^([-\w.]+\/[-\w.+]+)/;function Wk(t){const e=Gk.exec(t);return e?e[1]:t}function qk(t){const e=$k.exec(t);return e?e[1]:""}const Xk=/\?.*/;function Yk(t){if(Mk(t)){const e=Qk(t.url||"");return{url:e,type:Wk(t.headers.get("content-type")||"")||qk(e)}}return Dk(t)?{url:Qk(t.name||""),type:t.type||""}:"string"==typeof t?{url:Qk(t),type:qk(t)}:{url:"",type:""}}function Kk(t){return Mk(t)?t.headers["content-length"]||-1:Dk(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function Qk(t){return t.replace(Xk,"")}function Zk(t){return Jk.apply(this,arguments)}function Jk(){return(Jk=gS(function*(t){if(Mk(t))return t;const e={},n=Kk(t);n>=0&&(e["content-length"]=String(n));const{url:i,type:r}=Yk(t);r&&(e["content-type"]=r);const s=yield rA(t);s&&(e["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t));const o=new Response(t,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function tA(t){return eA.apply(this,arguments)}function eA(){return(eA=gS(function*(t){if(!t.ok){const e=yield nA(t);throw new Error(e)}})).apply(this,arguments)}function nA(t){return iA.apply(this,arguments)}function iA(){return(iA=gS(function*(t){let e=`Failed to fetch resource ${t.url} (${t.status}): `;try{const n=t.headers.get("Content-Type");let i=t.statusText;n.includes("application/json")&&(i+=` ${yield t.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(n){}return e})).apply(this,arguments)}function rA(t){return sA.apply(this,arguments)}function sA(){return(sA=gS(function*(t){if("string"==typeof t)return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const e=t.slice(0,5);return yield new Promise(t=>{const n=new FileReader;n.onload=e=>{var n;return t(null==e||null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsDataURL(e)})}return t instanceof ArrayBuffer?`data:base64,${oA(t.slice(0,5))}`:null})).apply(this,arguments)}function oA(t){let e="";const n=new Uint8Array(t);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const dA={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){cA(this,"console",void 0),this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},pA={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function fA(){Bk.loaders=Bk.loaders||{};const{loaders:t}=Bk;return t._state=t._state||{},t._state}const gA=()=>{const t=fA();return t.globalOptions=t.globalOptions||bt({},dA),t.globalOptions};function mA(t,e,n,i){return n=n||[],function(t,e){yA(t,null,dA,pA,e);for(const n of e)yA(t&&t[n.id]||{},n.id,n.options&&n.options[n.id]||{},n.deprecatedOptions&&n.deprecatedOptions[n.id]||{},e)}(t,n=Array.isArray(n)?n:[n]),function(t,e,n){const i=bt({},t.options||{});return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,n),null===i.log&&(i.log=new hA),_A(i,gA()),_A(i,e),i}(e,t,i)}function bA(t,e){const n=gA(),i=t||n;return"function"==typeof i.fetch?i.fetch:kk(i.fetch)?t=>aA(t,i):null!=e&&e.fetch?null==e?void 0:e.fetch:aA}function yA(t,e,n,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in t){const l=!e&&kk(t[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in n)&&!c&&!u)if(a in i)uA.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const t=vA(a,r);uA.warn(`${s} loader option '${o}${a}' not recognized. ${t}`)()}}}function vA(t,e){const n=t.toLowerCase();let i="";for(const r of e)for(const e in r.options){if(t===e)return`Did you mean '${r.id}.${e}'?`;const s=e.toLowerCase();(n.startsWith(s)||s.startsWith(n))&&(i=i||`Did you mean '${r.id}.${e}'?`)}return i}function _A(t,e){for(const n in e)n in e&&(t[n]=Ak(e[n])&&Ak(t[n])?bt(bt({},t[n]),e[n]):e[n])}function wA(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}function xA(t,e="3.0.12"){return wA(t,"no worker provided"),!(!e||!t.version)}const SA={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},EA=SA.global||SA.self||SA.window||{},CA="object"!=typeof process||"[object process]"!==String(process)||process.browser,OA="function"==typeof importScripts,TA="undefined"!=typeof window&&void 0!==window.orientation,kA="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),AA=(kA&&parseFloat(kA[1]),new Map);function PA(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function IA(t,e=!0,n){const i=n||new Set;if(t)if(MA(t))i.add(t);else if(MA(t.buffer))i.add(t.buffer);else if(!ArrayBuffer.isView(t)&&e&&"object"==typeof t)for(const r in t)IA(t[r],e,i);return void 0===n?Array.from(i):[]}function MA(t){return!!t&&(t instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&t instanceof MessagePort||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)}const DA=()=>{};class RA{static isSupported(){return"undefined"!=typeof Worker}constructor(t){cA(this,"name",void 0),cA(this,"source",void 0),cA(this,"url",void 0),cA(this,"terminated",!1),cA(this,"worker",void 0),cA(this,"onMessage",void 0),cA(this,"onError",void 0),cA(this,"_loadableURL","");const{name:e,source:n,url:i}=t;wA(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=DA,this.onError=t=>console.log(t),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=DA,this.onError=DA,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||IA(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+=`worker ${this.name}. `,t.message&&(e+=`${t.message} in `),t.lineno&&(e+=`:${t.lineno}:${t.colno}`),new Error(e)}_createBrowserWorker(){this._loadableURL=function(t){wA(t.source&&!t.url||!t.source&&t.url);let e=AA.get(t.source||t.url);return e||(t.url&&(e=function(t){return t.startsWith("http")?PA(function(t){return`try {\n importScripts('${t}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(t)):t}(t.url),AA.set(t.url,e)),t.source&&(e=PA(t.source),AA.set(t.source,e))),wA(e),e}({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}}class NA{constructor(t,e){cA(this,"name",void 0),cA(this,"workerThread",void 0),cA(this,"isRunning",void 0),cA(this,"result",void 0),cA(this,"_resolve",void 0),cA(this,"_reject",void 0),this.name=t,this.workerThread=e,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e})}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){wA(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){wA(this.isRunning),this.isRunning=!1,this._reject(t)}}class LA{constructor(t){cA(this,"name","unnamed"),cA(this,"source",void 0),cA(this,"url",void 0),cA(this,"maxConcurrency",1),cA(this,"maxMobileConcurrency",1),cA(this,"onDebug",()=>{}),cA(this,"reuseWorkers",!0),cA(this,"props",{}),cA(this,"jobQueue",[]),cA(this,"idleQueue",[]),cA(this,"count",0),cA(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props=bt(bt({},this.props),t),void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}startJob(t,e=((t,e,n)=>t.done(n)),n=((t,e)=>t.error(e))){var i=this;return gS(function*(){const r=new Promise(r=>(i.jobQueue.push({name:t,onMessage:e,onError:n,onStart:r}),i));return i._startQueuedJob(),yield r})()}_startQueuedJob(){var t=this;return gS(function*(){if(!t.jobQueue.length)return;const e=t._getAvailableWorker();if(!e)return;const n=t.jobQueue.shift();if(n){t.onDebug({message:"Starting job",name:n.name,workerThread:e,backlog:t.jobQueue.length});const i=new NA(n.name,e);e.onMessage=t=>n.onMessage(i,t.type,t.payload),e.onError=t=>n.onError(i,t),n.onStart(i);try{yield i.result}finally{t.returnWorkerToQueue(e)}}})()}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class FA{static isSupported(){return RA.isSupported()}static getWorkerFarm(t={}){return FA._workerFarm=FA._workerFarm||new FA({}),FA._workerFarm.setProps(t),FA._workerFarm}constructor(t){cA(this,"props",void 0),cA(this,"workerPools",new Map),this.props=bt({},jA),this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy()}setProps(t){this.props=bt(bt({},this.props),t);for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:n,url:i}=t;let r=this.workerPools.get(e);return r||(r=new LA({name:e,source:n,url:i}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function BA(t,e={}){const n=`${t.id}-worker.js`;let i=(e[t.id]||{}).workerUrl;if("test"===e._workerType&&(i=`modules/${t.module}/dist/${n}`),!i){let e=t.version;"latest"===e&&(e="latest"),i=`https://unpkg.com/@loaders.gl/${t.module}${e?`@${e}`:""}/dist/${n}`}return wA(i),i}function VA(t,e){return!!FA.isSupported()&&t.worker&&(null==e?void 0:e.worker)}function zA(t,e,n,i,r){return UA.apply(this,arguments)}function UA(){return(UA=gS(function*(t,e,n,i,r){const s=t.id,o=BA(t,n),a=FA.getWorkerFarm(n).getWorkerPool({name:s,url:o});n=JSON.parse(JSON.stringify(n));const l=yield a.startJob("process-on-worker",HA.bind(null,r));return l.postMessage("process",{input:e,options:n}),yield(yield l.result).result})).apply(this,arguments)}function HA(t,e,n,i){return $A.apply(this,arguments)}function $A(){return($A=gS(function*(t,e,n,i){switch(n){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:s,input:o,options:a}=i;try{const n=yield t(o,a);e.postMessage("done",{id:s,result:n})}catch(r){const t=r instanceof Error?r.message:"unknown error";e.postMessage("error",{id:s,error:t})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}})).apply(this,arguments)}cA(FA,"_workerFarm",void 0);var GA=n(9521);function WA(t){if(function(t){return t&&"object"==typeof t&&t.isBuffer}(t)&&(t=function(t){return GA.toArrayBuffer?GA.toArrayBuffer(t):t}(t)),t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"==typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"==typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function qA(...t){const e=t.map(t=>t instanceof ArrayBuffer?new Uint8Array(t):t),n=e.reduce((t,e)=>t+e.byteLength,0),i=new Uint8Array(n);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function XA(t,e,n){const i=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(i).buffer}function YA(t){return KA.apply(this,arguments)}function KA(){return(KA=gS(function*(t){const e=[];var n,i=!0,r=!1;try{for(var s,o,a=fk(t);i=(s=yield a.next()).done,o=yield s.value,!i;i=!0)e.push(o)}catch(l){r=!0,n=l}finally{try{!i&&null!=a.return&&(yield a.return())}finally{if(r)throw n}}return qA(...e)})).apply(this,arguments)}const QA=262144;function ZA(t){this.wrapped=t}function JA(t){return new ZA(t)}function tP(t){var e,n;function i(e,n){try{var s=t[e](n),o=s.value,a=o instanceof ZA;Promise.resolve(a?o.wrapped:o).then(function(t){a?i("return"===e?"return":"next",t):r(s.done?"return":"normal",t)},function(t){i("throw",t)})}catch(l){r("throw",l)}}function r(t,r){switch(t){case"return":e.resolve({value:r,done:!0});break;case"throw":e.reject(r);break;default:e.resolve({value:r,done:!1})}(e=e.next)?i(e.key,e.arg):n=null}this._invoke=function(t,r){return new Promise(function(s,o){var a={key:t,arg:r,resolve:s,reject:o,next:null};n?n=n.next=a:(e=n=a,i(t,r))})},"function"!=typeof t.return&&(this.return=void 0)}function eP(t){return function(){return new tP(t.apply(this,arguments))}}function nP(){return(nP=eP(function*(t,e){const n=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;it&&"object"==typeof t&&t.isBuffer)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const n=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let n=t.buffer;const i=t.byteLength||t.length;return(0!==t.byteOffset||i!==n.byteLength)&&(n=n.slice(t.byteOffset,t.byteOffset+i)),n}throw new Error(aP)}function cP(t,e,n){return uP.apply(this,arguments)}function uP(){return(uP=gS(function*(t,e,n){const i=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||i)return lP(t,e);if(Dk(t)&&(t=yield Zk(t)),Mk(t)){const n=t;return yield tA(n),e.binary?yield n.arrayBuffer():yield n.text()}if(Rk(t)&&(t=oP(t,n)),Pk(t)||Ik(t))return YA(t);throw new Error(aP)})).apply(this,arguments)}function hP(t,e,n=null){if(n)return n;const i=bt({fetch:bA(e,t)},t);return Array.isArray(i.loaders)||(i.loaders=null),i}function dP(t,e){if(!e&&t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...t]:t}return n&&n.length?n:null}const pP=()=>{const t=fA();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function fP(t){const e=pP();t=Array.isArray(t)?t:[t];for(const n of t){const t=jk(n);e.find(e=>t===e)||e.unshift(t)}}const gP=/\.([^.]+)$/;function mP(t){return bP.apply(this,arguments)}function bP(){return(bP=gS(function*(t,e=[],n,i){if(!vP(t))return null;let r=yP(t,e,ti(bt({},n),{nothrow:!0}),i);if(r)return r;if(Dk(t)&&(r=yP(t=yield t.slice(0,10).arrayBuffer(),e,n,i)),!(r||null!=n&&n.nothrow))throw new Error(_P(t));return r})).apply(this,arguments)}function yP(t,e=[],n,i){if(!vP(t))return null;if(e&&!Array.isArray(e))return jk(e);let r=[];e&&(r=r.concat(e)),null!=n&&n.ignoreRegisteredLoaders||r.push(...pP()),function(t){for(const e of t)jk(e)}(r);const s=function(t,e,n,i){const{url:r,type:s}=Yk(t),o=r||(null==i?void 0:i.url);let a=null;return null!=n&&n.mimeType&&(a=wP(e,null==n?void 0:n.mimeType)),a=a||function(t,e){const n=e&&gP.exec(e),i=n&&n[1];return i?function(t,e){e=e.toLowerCase();for(const n of t)for(const t of n.extensions)if(t.toLowerCase()===e)return n;return null}(t,i):null}(e,o),a=a||wP(e,s),a=a||function(t,e){if(!e)return null;for(const n of t)if("string"==typeof e){if(xP(e,n))return n}else if(ArrayBuffer.isView(e)){if(SP(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&SP(e,0,n))return n;return null}(e,t),a=a||wP(e,null==n?void 0:n.fallbackMimeType),a}(t,r,n,i);if(!(s||null!=n&&n.nothrow))throw new Error(_P(t));return s}function vP(t){return!(t instanceof Response&&204===t.status)}function _P(t){const{url:e,type:n}=Yk(t);let i="No valid loader found";return t&&(i+=` data: "${function(t,e=5){return"string"==typeof t?t.slice(0,e):ArrayBuffer.isView(t)?EP(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?EP(t,0,e):""}(t)}", contentType: "${n}"`),e&&(i+=` url: ${e}`),i}function wP(t,e){for(const n of t)if(n.mimeTypes&&n.mimeTypes.includes(e)||e===`application/x.${n.id}`)return n;return null}function xP(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(e=>t.startsWith(e))}function SP(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(i=>function(t,e,n,i){if(i instanceof ArrayBuffer)return function(t,e,n){if(t.byteLength<(n=n||t.byteLength)||e.byteLengtht.equals(e));let RP=new Uint8ClampedArray(0);const NP={data:{type:"data",value:MP,async:!0},dataComparator:null,_dataDiff:{type:"function",value:t=>t&&t.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:n,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=n.context;var a;r=r||n.getLoadOptions(),i=i||n.props.loaders,s&&(r=ti(bt({},r),{fetch:ti(bt({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(t);return!l&&!r&&(o.add({resourceId:t,data:AP(t,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:t,onChange:t=>n.internalState.reloadAsyncProp(e,t),consumerId:n.id,requestId:e}):AP(t,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mw.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,100*-t],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let LP=(()=>{class t extends Ck{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,e){var n,i,r,s;e&&(t.message="".concat(e,": ").concat(t.message)),(null===(n=(i=this.props).onError)||void 0===n?void 0:n.call(i,t))||null===(r=this.context)||void 0===r||null===(s=r.onError)||void 0===s||s.call(r,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:e}=this.context,n=KT(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,r,s]=NT(n,e.pixelProjectionMatrix);return 2===t.length?[i,r]:[i,r,s]}unproject(t){const{viewport:e}=this.context;return e.unproject(t)}projectPosition(t){return function(t,e){const{viewport:n,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(t){const e=bt({},t);let{coordinateSystem:n}=t;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=t;return n===Mw.DEFAULT&&(n=i.isGeospatial?Mw.LNGLAT:Mw.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=n),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=n,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=lT(n,i,r),h=KT(t,{viewport:n,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}(h,h,n.projectPosition(l||c));return h}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mw.DEFAULT||t===Mw.LNGLAT||t===Mw.CARTESIAN}onHover(t,e){return!!this.props.onHover&&this.props.onHover(t,e)}onClick(t,e){return!!this.props.onClick&&this.props.onClick(t,e)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,e=[]){return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}decodePickingColor(t){uE(t instanceof Uint8Array);const[e,n,i]=t;return e+256*n+65536*i-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const e of this.props.extensions)t=GO(t,e.getShaders.call(this,e));return t}shouldUpdateState({changeFlags:t}){return t.propsOrDataChanged}updateState({oldProps:t,props:e,changeFlags:n}){const i=this.getAttributeManager();if(n.dataChanged&&i){const{dataChanged:t}=n;if(Array.isArray(t))for(const e of t)i.invalidateAll(e);else i.invalidateAll()}const r=e.highlightedObjectIndex>=0||e.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==r&&i){const{pickingColors:t,instancePickingColors:e}=i.attributes,n=t||e;n&&(r&&n.constant&&(n.constant=!1,i.invalidate(n.id)),!n.value&&!r&&(n.constant=!0,n.value=[0,0,0]))}}finalizeState(){for(const e of this.getModels())e.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const e of this.getModels())e.draw(t)}getPickingInfo({info:t}){const{index:e}=t;return e>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[e]),t}activateViewport(t){const e=this.internalState.viewport;this.internalState.viewport=t,(!e||!DP({oldViewport:e,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",e=""){const n=this.getAttributeManager();!n||("all"===t?n.invalidateAll():n.invalidate(t))}updateAttributes(t){for(const e of this.getModels())this._setModelAttributes(e,t)}_updateAttributes(t){const e=this.getAttributeManager();if(!e)return;const n=this.getNumInstances(t),i=this.getStartIndices(t);e.update({data:t.data,numInstances:n,startIndices:i,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const r=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const e=t.update(),n=Object.create(this.props);for(const t in e)Object.defineProperty(n,t,{value:e[t]});return n}return this.props}calculateInstancePickingColors(t,{numInstances:e}){if(t.constant)return;const n=Math.floor(RP.length/3);if(this.internalState.usesPickingColorCache=!0,nIP&&Iw.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),RP=AS.allocate(RP,e,{size:3,copy:!0,maxCount:Math.max(e,IP)});const t=Math.floor(RP.length/3),i=[];for(let e=n;e{const i={moduleParameters:t,uniforms:e,parameters:n,context:this.context};for(const t of this.props.extensions)t.draw.call(this,i,t);this.draw(i)})}finally{this.props=i}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:e}=this.internalState;for(const i in t)if(t[i]){let n=!1;switch(i){case"dataChanged":Array.isArray(e[i])&&(e[i]=Array.isArray(t[i])?e[i].concat(t[i]):t[i],n=!0);default:e[i]||(e[i]=t[i],n=!0)}n&&PE("layer.changeFlag",this,i,t)}const n=e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged;e.propsOrDataChanged=n,e.somethingChanged=n||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,e){const n=function(t,e){const n=FO({newProps:t,oldProps:e,propTypes:UO(t),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(t,e){if(null===e)return"oldProps is null, initial diff";let n=null;const{dataComparator:i,_dataDiff:r}=t;return i?i(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied"),n&&r&&(n=r(t.data,e.data)||n),n}(t,e);let r=!1;return i||(r=function(t,e){if(null===e)return"oldProps is null, initial diff";if("all"in t.updateTriggers&&zO(t,e,"all"))return{all:!0};const n={};let i=!1;for(const r in t.updateTriggers)"all"!==r&&zO(t,e,r)&&(n[r]=!0,i=n);return i}(t,e)),{dataChanged:i,propsChanged:n,updateTriggersChanged:r,extensionsChanged:VO(t,e),transitionsChanged:jO(t,e)}}(t,e);if(n.updateTriggersChanged)for(const i in n.updateTriggersChanged)n.updateTriggersChanged[i]&&this.invalidateAttribute(i);if(n.transitionsChanged)for(const i in n.transitionsChanged)this.internalState.uniformTransitions.add(i,e[i],t[i],t.transitions[i]);return this.setChangeFlags(n)}validateProps(){!function(t){const e=UO(t);for(const n in e){const i=e[n],{validate:r}=i;if(r&&!r(t[n],i))throw new Error("Invalid prop ".concat(n,": ").concat(t[n]))}}(this.props)}setModuleParameters(t){for(const e of this.getModels())e.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const e={pickingSelectedColor:t.picked?t.color:null},{highlightColor:n}=this.props;t.picked&&"function"==typeof n&&(e.pickingHighlightColor=n(t)),this.setModuleParameters(e),this.setNeedsRedraw()}_updateModules({props:t,oldProps:e},n){const{autoHighlight:i,highlightedObjectIndex:r,highlightColor:s}=t;if(n||e.autoHighlight!==i||e.highlightedObjectIndex!==r||e.highlightColor!==s){const t={};i||(t.pickingSelectedColor=null),Array.isArray(s)&&(t.pickingHighlightColor=s),Number.isInteger(r)&&(t.pickingSelectedColor=r>=0?this.encodePickingColor(r):null),this.setModuleParameters(t)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let e=!1;e=e||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const n=this.getAttributeManager(),i=n&&n.getNeedsRedraw(t);return e=e||i,e}_getAttributeManager(){return new PO(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){uE(!this.internalState&&!this.state),uE(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Ok({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Iw.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new RO(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){PE("layer.matched",this,this===t);const{state:e,internalState:n}=t;this!==t&&(this.internalState=n,this.internalState.layer=this,this.state=e,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return t.layerName="Layer",t.defaultProps=NP,t})(),jP=(()=>{class t extends LP{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:e}=t;return e&&e.__source&&e.__source.parent&&e.__source.parent.id===this.id&&(t.object=e.__source.object,t.index=e.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}getSubLayerClass(t,e){const{_subLayerProps:n}=this.props;return n&&n[t]&&n[t].type||e}getSubLayerRow(t,e,n){return t.__source={parent:this,object:e,index:n},t}getSubLayerAccessor(t){if("function"==typeof t){const e={data:this.props.data,target:[]};return(n,i)=>n&&n.__source?(e.index=n.__source.index,t(n.__source.object,e)):t(n,i)}return t}getSubLayerProps(t={}){const{opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:s,highlightedObjectIndex:o,autoHighlight:a,highlightColor:l,coordinateSystem:c,coordinateOrigin:u,wrapLongitude:h,positionFormat:d,modelMatrix:p,extensions:f,fetch:g,_subLayerProps:m}=this.props,b={opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:s,highlightedObjectIndex:o,autoHighlight:a,highlightColor:l,coordinateSystem:c,coordinateOrigin:u,wrapLongitude:h,positionFormat:d,modelMatrix:p,extensions:f,fetch:g},y=m&&m[t.id],v=y&&y.updateTriggers,_=t.id||"sublayer";if(y){const e=this.constructor._propTypes,n=t.type?t.type._propTypes:{};for(const t in y){const i=n[t]||e[t];i&&"accessor"===i.type&&(y[t]=this.getSubLayerAccessor(y[t]))}}Object.assign(b,t,y),b.id="".concat(this.props.id,"-").concat(_),b.updateTriggers=bt(bt({all:this.props.updateTriggers.all},t.updateTriggers),v);for(const w of f){const t=w.getSubLayerProps.call(this,w);t&&Object.assign(b,t,{updateTriggers:Object.assign(b.updateTriggers,t.updateTriggers)})}return b}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const e=!t||this.needsUpdate();e&&(t=this.renderLayers(),t=gE(t,Boolean),this.internalState.subLayers=t),PE("compositeLayer.renderLayers",this,e,t);for(const n of t)n.parent=this}}return t.layerName="CompositeLayer",t})();const FP=/([0-9]+\.?[0-9]*)(%|px)/;function BP(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=t.match(FP);if(e&&e.length>=3){const t="%"===e[2],n=parseFloat(e[1]);return{position:t?n/100:n,relative:t}}default:throw new Error("Could not parse position string ".concat(t))}}function VP(t,e){return t.relative?Math.round(t.position*e):t.position}function zP(t,e){if(t===e)return!0;if(!t||!e)return!1;for(const n in t){const i=t[n],r=e[n];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&zP(i,r)))return!1}return!0}class UP{constructor(t={}){const{id:e=null,x:n=0,y:i=0,width:r="100%",height:s="100%",projectionMatrix:o=null,fovy:a=50,near:l=.1,far:c=1e3,modelMatrix:u=null,viewportInstance:h=null,type:d=WT}=t;uE(!h||h instanceof WT),this.viewportInstance=h,this.id=e||this.constructor.displayName||"view",this.type=d,this.props=ti(bt({},t),{id:this.id,projectionMatrix:o,fovy:a,near:l,far:c,modelMatrix:u}),this._parseDimensions({x:n,y:i,width:r,height:s}),this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||(this.viewportInstance?t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):zP(this.props,t.props))}makeViewport({width:t,height:e,viewState:n}){if(this.viewportInstance)return this.viewportInstance;n=this.filterViewState(n);const i=this.getDimensions({width:t,height:e});return this._getViewport(n,i)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(t){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e=bt({},t);for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions({width:t,height:e}){return{x:VP(this._x,t),y:VP(this._y,e),width:VP(this._width,t),height:VP(this._height,e)}}_getControllerProps(t){let e=this.props.controller;return e?!0===e?t:("function"==typeof e&&(e={type:e}),bt(bt({},t),e)):null}_getViewport(t,e){const{type:n}=this;return new n(bt(bt(bt({},t),this.props),e))}_parseDimensions({x:t,y:e,width:n,height:i}){this._x=BP(t),this._y=BP(e),this._width=BP(n),this._height=BP(i)}}const HP=()=>{},$P={transitionEasing:t=>t,transitionInterruption:1,onTransitionStart:HP,onTransitionInterrupt:HP,onTransitionEnd:HP};class GP{constructor(t,e={}){this.ControllerState=t,this.props=bt(bt({},$P),e),this.propsInTransition=null,this.transition=new OO(e.timeline),this.onViewStateChange=e.onViewStateChange||HP,this.onStateChange=e.onStateChange||HP,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const n=this.props;if(t=bt(bt({},$P),t),this.props=t,this._shouldIgnoreViewportChange(n,t))return e;if(this._isTransitionEnabled(t)){const{interruption:i,endProps:r}=this.transition.settings,s=bt(bt({},n),2===i?r:this.propsInTransition||n);this._triggerTransition(s,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:n}=t;return(e>0||"auto"===e)&&Boolean(n)}_isUpdateDueToCurrentTransition(t){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const n=new this.ControllerState(t),i=new this.ControllerState(e).shortestPathFrom(n),{transitionInterpolator:r}=e,s=r.getDuration?r.getDuration(t,e):e.transitionDuration;if(0===s)return;const o=e.transitionInterpolator.initializeProps(t,i);this.propsInTransition={},this.duration=s,this.transition.start({duration:s,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startProps:o.start,endProps:o.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),t(e)}}_onTransitionUpdate(t){const{time:e,settings:{interpolator:n,startProps:i,endProps:r,duration:s,easing:o}}=t,a=o(e/s),l=n.interpolateProps(i,r,a);this.propsInTransition=new this.ControllerState(bt(bt({},this.props),l)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const WP=["longitude","latitude","zoom","bearing","pitch"],qP=["longitude","latitude","zoom"];class XP extends class{constructor(t={}){Array.isArray(t)&&(t={compare:t,extract:t,required:t});const{compare:e,extract:n,required:i}=t;this._propsToCompare=e,this._propsToExtract=n,this._requiredProps=i}arePropsEqual(t,e){for(const n of this._propsToCompare||Object.keys(e))if(!(n in t)||!(n in e)||!FS(t[n],e[n]))return!1;return!0}initializeProps(t,e){let n;if(this._propsToExtract){const i={},r={};for(const n of this._propsToExtract)i[n]=t[n],r[n]=e[n];n={start:i,end:r}}else n={start:t,end:e};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}interpolateProps(t,e,n){return e}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){!this._requiredProps||this._requiredProps.forEach(e=>{const n=t[e];uE(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))})}}{constructor(t={}){super((Array.isArray(t)?t:t.transitionProps)||{compare:WP,extract:WP,required:qP}),this.opts=t}initializeProps(t,e){const n=super.initializeProps(t,e),{makeViewport:i,around:r}=this.opts;if(i&&r){const s=i(t),o=i(e),a=s.unproject(r);n.start.around=r,Object.assign(n.end,{around:o.project(a),aroundPosition:a,width:e.width,height:e.height})}return n}interpolateProps(t,e,n){const i={};for(const r of this._propsToExtract)i[r]=jS(t[r]||0,e[r]||0,n);if(e.aroundPosition){const r=this.opts.makeViewport(bt(bt({},e),i));Object.assign(i,r.panByPosition(e.aroundPosition,jS(t.around,e.around,n)))}return i}}const YP={transitionDuration:0},KP={transitionDuration:300,transitionEasing:t=>t,transitionInterruption:1},QP=t=>1-(1-t)*(1-t),ZP=["wheel"],JP=["panstart","panmove","panend"],tI=["pinchstart","pinchmove","pinchend"],eI=["tripanstart","tripanmove","tripanend"],nI=["doubletap"],iI=["keydown"];class rI{constructor(t,e={}){this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new GP(t,ti(bt({},e),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const n=this.linearTransitionProps;this._transition=n&&ti(bt({},KP),{transitionInterpolator:new XP({transitionProps:n})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(e)}get linearTransitionProps(){return null}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.setProps(this.controllerStateProps)}finalize(){for(const t in this._events)this._events[t]&&this.eventManager.off(t,this.handleEvent);this.transitionManager.finalize()}handleEvent(t){const{ControllerState:e}=this;this.controllerState=new e(bt(bt({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const n=this._eventStartBlocked;switch(t.type){case"panstart":return!n&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!n&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!n&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}getCenter(t){const{x:e,y:n}=this.controllerStateProps,{offsetCenter:i}=t;return[i.x-e,i.y-n]}isPointInBounds(t,e){const{width:n,height:i}=this.controllerStateProps;if(e&&e.handled)return!1;const r=t[0]>=0&&t[0]<=n&&t[1]>=0&&t[1]<=i;return r&&e&&e.stopPropagation(),r}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(t){const e=setTimeout(()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)},t);this._eventStartBlocked=e}setProps(t){"onViewStateChange"in t&&(this.onViewStateChange=t.onViewStateChange),"onStateChange"in t&&(this.onStateChange=t.onStateChange),"makeViewport"in t&&(this.makeViewport=t.makeViewport),"dragMode"in t&&(this.dragMode=t.dragMode),this.controllerStateProps=t,"eventManager"in t&&this.eventManager!==t.eventManager&&(this.eventManager=t.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);let{inertia:e}=t;!0===e&&(e=300),this.inertia=e;const{scrollZoom:n=!0,dragPan:i=!0,dragRotate:r=!0,doubleClickZoom:s=!0,touchZoom:o=!0,touchRotate:a=!1,keyboard:l=!0}=t,c=Boolean(this.onViewStateChange);this.toggleEvents(ZP,c&&n),this.toggleEvents(JP,c&&(i||r)),this.toggleEvents(tI,c&&(o||a)),this.toggleEvents(eI,c&&a),this.toggleEvents(nI,c&&s),this.toggleEvents(iI,c&&l),this.scrollZoom=n,this.dragPan=i,this.dragRotate=r,this.doubleClickZoom=s,this.touchZoom=o,this.touchRotate=a,this.keyboard=l}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach(t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))})}updateViewport(t,e={},n={}){const i=bt(bt({},t.getViewportProps()),e),r=this.controllerState!==t;if(this._state=t.getState(),this._setInteractionState(n),r){const t=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:t})}}_onTransition(t){this.onViewStateChange&&(t.interactionState=this._interactionState,this.onViewStateChange(t))}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let n=this.isFunctionKeyPressed(t)||t.rightButton;(this.invertPan||"pan"===this.dragMode)&&(n=!n);const i=this.controllerState[n?"panStart":"rotateStart"]({pos:e});return this._panMove=n,this.updateViewport(i,YP,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),n=this.controllerState.pan({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const n=this.getCenter(t),i=this.controllerState.pan({pos:[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2]}).panEnd();this.updateViewport(i,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),n=this.controllerState.rotate({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const n=this.getCenter(t),i=this.controllerState.rotate({pos:[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2]}).rotateEnd();this.updateViewport(i,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;t.preventDefault();const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const{speed:n=.01,smooth:i=!1}=this.scrollZoom,{delta:r}=t;let s=2/(1+Math.exp(-Math.abs(r*n)));r<0&&0!==s&&(s=1/s);const o=this.controllerState.zoom({pos:e,scale:s});return this.updateViewport(o,ti(bt({},this._getTransitionProps({around:e})),{transitionDuration:i?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.rotateStart({pos:e});return this.updateViewport(n,YP,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate||!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const n=this.controllerState.rotate({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const n=this.getCenter(t),i=[n[0],n[1]+=t.velocityY*e/2],r=this.controllerState.rotate({pos:i});this.updateViewport(r,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(n,YP,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:n}=t,i=this.getCenter(t);e=e.zoom({pos:i,scale:n})}if(this.touchRotate){const{rotation:n}=t;e=e.rotate({deltaAngleX:this._startPinchRotation-n})}return this.updateViewport(e,YP,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e,_lastPinchEvent:n}=this;if(this.touchZoom&&e&&n&&t.scale!==n.scale){const i=this.getCenter(t);let r=this.controllerState.rotateEnd();const s=Math.log2(t.scale),o=(s-Math.log2(n.scale))/(t.deltaTime-n.deltaTime),a=Math.pow(2,s+o*e/2);r=r.zoom({pos:i,scale:a}).zoomEnd(),this.updateViewport(r,ti(bt({},this._getTransitionProps({around:i})),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.isFunctionKeyPressed(t),i=this.controllerState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:n,moveSpeed:i,rotateSpeedX:r,rotateSpeedY:s}=this.keyboard,{controllerState:o}=this;let a;const l={};switch(t.srcEvent.code){case"Minus":a=e?o.zoomOut(n).zoomOut(n):o.zoomOut(n),l.isZooming=!0;break;case"Equal":a=e?o.zoomIn(n).zoomIn(n):o.zoomIn(n),l.isZooming=!0;break;case"ArrowLeft":e?(a=o.rotateLeft(r),l.isRotating=!0):(a=o.moveLeft(i),l.isPanning=!0);break;case"ArrowRight":e?(a=o.rotateRight(r),l.isRotating=!0):(a=o.moveRight(i),l.isPanning=!0);break;case"ArrowUp":e?(a=o.rotateUp(s),l.isRotating=!0):(a=o.moveUp(i),l.isPanning=!0);break;case"ArrowDown":e?(a=o.rotateDown(s),l.isRotating=!0):(a=o.moveDown(i),l.isPanning=!0);break;default:return!1}return this.updateViewport(a,this._getTransitionProps(),l),!0}_getTransitionProps(t){const{_transition:e}=this;return e?t?ti(bt({},e),{transitionInterpolator:new XP(ti(bt({},t),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):e:YP}}class sI{constructor(t){this._viewportProps=this._applyConstraints(t)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(t){return this._viewportProps}_applyConstraints(t){return t}}const oI=[0,0,0];class aI extends sI{constructor({makeViewport:t,width:e,height:n,rotationX:i=0,rotationOrbit:r=0,target:s=oI,zoom:o=0,minRotationX:a=-90,maxRotationX:l=90,minZoom:c=-(1/0),maxZoom:u=Infinity,startPanPosition:h,startRotatePos:d,startRotationX:p,startRotationOrbit:f,startZoomPosition:g,startZoom:m}){super({width:e,height:n,rotationX:i,rotationOrbit:r,target:s,zoom:o,minRotationX:a,maxRotationX:l,minZoom:c,maxZoom:u}),this._state={startPanPosition:h,startRotatePos:d,startRotationX:p,startRotationOrbit:f,startZoomPosition:g,startZoom:m},this.makeViewport=t}panStart({pos:t}){return this._getUpdatedState({startPanPosition:this._unproject(t)})}pan({pos:t,startPosition:e}){const n=this._state.startPanPosition||e;if(!n)return this;const i=this.makeViewport(this._viewportProps).panByPosition(n,t);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){const{startRotatePos:i,startRotationX:r,startRotationOrbit:s}=this._state,{width:o,height:a}=this._viewportProps;if(!i||!Number.isFinite(r)||!Number.isFinite(s))return this;let l;if(t){let e=(t[0]-i[0])/o;(r<-90||r>90)&&(e*=-1),l={rotationX:r+(t[1]-i[1])/a*180,rotationOrbit:s+180*e}}else l={rotationX:r+n,rotationOrbit:s+e};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(t){const e=t.getViewportProps(),n=bt({},this._viewportProps),{rotationOrbit:i}=n;return Math.abs(i-e.rotationOrbit)>180&&(n.rotationOrbit=i<0?i+360:i-360),n}zoomStart({pos:t}){return this._getUpdatedState({startZoomPosition:this._unproject(t),startZoom:this._viewportProps.zoom})}zoom({pos:t,startPos:e,scale:n}){const{zoom:i}=this._viewportProps;let{startZoom:r,startZoomPosition:s}=this._state;Number.isFinite(r)||(r=i,s=this._unproject(e)||this._unproject(t));const o=this._calculateNewZoom({scale:n,startZoom:r}),a=this.makeViewport(ti(bt({},this._viewportProps),{zoom:o}));return this._getUpdatedState(bt({zoom:o},a.panByPosition(s,t)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}zoomOut(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}moveLeft(t=50){return this._panFromCenter([-t,0])}moveRight(t=50){return this._panFromCenter([t,0])}moveUp(t=50){return this._panFromCenter([0,-t])}moveDown(t=50){return this._panFromCenter([0,t])}rotateLeft(t=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-t})}rotateRight(t=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+t})}rotateUp(t=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-t})}rotateDown(t=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+t})}_unproject(t){const e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}_calculateNewZoom({scale:t,startZoom:e}){const{maxZoom:n,minZoom:i}=this._viewportProps;return Number.isFinite(e)||(e=this._viewportProps.zoom),LS(e+Math.log2(t),i,n)}_panFromCenter(t){const{width:e,height:n,target:i}=this._viewportProps;return this.pan({startPosition:i,pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new aI(bt(bt(bt({},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i,maxRotationX:r,minRotationX:s,rotationOrbit:o}=t;return t.zoom=LS(i,n,e),t.rotationX=LS(t.rotationX,s,r),(o<-180||o>180)&&(t.rotationOrbit=function(t,e){const n=t%360;return n<0?360+n:n}(o+180)-180),t}}class lI extends rI{constructor(t){super(aI,t)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class cI extends rI{constructor(t){t.dragMode=t.dragMode||"pan",super(aI,t)}_onPanRotate(t){return!1}get linearTransitionProps(){return["target","zoom"]}}const uI=(new bT).lookAt({eye:[0,0,1]});function hI({width:t,height:e,near:n,far:i}){return t=t||1,e=e||1,(new bT).ortho({left:-t/2,right:t/2,bottom:-e/2,top:e/2,near:n,far:i})}class dI extends WT{constructor(t){const{width:e,height:n,near:i=.1,far:r=1e3,zoom:s=0,target:o=[0,0,0],flipY:a=!0}=t,l=Math.pow(2,s);super(ti(bt({},t),{longitude:null,position:o,viewMatrix:uI.clone().scale([l,l*(a?-1:1),l]),projectionMatrix:hI({width:e,height:n,near:i,far:r}),zoom:s}))}panByPosition(t,e){const n=uT([],t,hT([],LT(e,this.pixelUnprojectionMatrix)));return{target:uT([],this.center,n)}}}let pI=(()=>{class t extends UP{constructor(t){super(ti(bt({},t),{type:dI}))}get controller(){return this._getControllerProps({type:cI})}}return t.displayName="OrthographicView",t})();const fI=Math.PI/180;function gI({height:t,fovy:e,orbitAxis:n,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*fI/2),a="Z"===n?[0,0,1]:[0,1,0],l="Z"===n?[0,-o,0]:[0,0,o],c=(new bT).lookAt({eye:l,up:a});c.rotateX(i*fI),"Z"===n?c.rotateZ(r*fI):c.rotateY(r*fI);const u=Math.pow(2,s)/(t||1);return c.scale(u),c}class mI extends WT{constructor(t){const{height:e,fovy:n,orbitAxis:i,target:r=[0,0,0],rotationX:s=0,rotationOrbit:o=0,zoom:a=0}=t;super(ti(bt({},t),{longitude:null,viewMatrix:gI({height:e,fovy:n,orbitAxis:i,rotationX:s,rotationOrbit:o,zoom:a}),fovy:n,position:r,zoom:a})),this.projectedCenter=this.project(this.center)}unproject(t,{topLeft:e=!0}={}){const[n,i,r=this.projectedCenter[2]]=t,s=e?i:this.height-i,[o,a,l]=LT([n,s,r],this.pixelUnprojectionMatrix);return[o,a,l]}panByPosition(t,e){const n=this.project(t);return{target:this.unproject([this.width/2+n[0]-e[0],this.height/2+n[1]-e[1],this.projectedCenter[2]])}}}let bI=(()=>{class t extends UP{constructor(t={}){const{orbitAxis:e="Z"}=t;super(ti(bt({},t),{orbitAxis:e,type:mI}))}get controller(){return this._getControllerProps({type:lI})}}return t.displayName="OrbitView",t})();const yI=[255,255,255],vI=1;let _I=0;class wI{constructor(t={}){const{color:e=yI}=t,{intensity:n=vI}=t;this.id=t.id||"ambient-".concat(_I++),this.color=e,this.intensity=n,this.type="ambient"}}const xI=[255,255,255],SI=1,EI=[0,0,-1];let CI=0;class OI{constructor(t={}){const{color:e=xI}=t,{intensity:n=SI}=t,{direction:i=EI}=t,{_shadow:r=!1}=t;this.id=t.id||"directional-".concat(CI++),this.color=e,this.intensity=n,this.type="directional",this.direction=new nE(i).normalize().toArray(),this.shadow=r}getProjectedLight(){return this}}class TI{constructor(t={}){const{id:e="effect"}=t;this.id=e,this.props=bt({},t)}preRender(){}getModuleParameters(){}cleanup(){}}class kI extends class{constructor(t,e={}){const{id:n="pass"}=e;this.id=n,this.gl=t,this.props=bt({},e)}setProps(t){Object.assign(this.props,t)}render(){}cleanup(){}}{render(t){return yx(this.gl,{framebuffer:t.target}),this._drawLayers(t)}_drawLayers(t){const{viewports:e,views:n,onViewportActive:i,clearCanvas:r=!0}=t;t.pass=t.pass||"unknown";const s=this.gl;r&&function(t){yx(t,{viewport:[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}),t.clear(16640)}(s);const o=[];for(const a of e){const e=a.viewport||a,r=n&&n[e.id];i(e);const l=this._getDrawLayerParams(e,t);t.view=r;const c=e.subViewports||[e];for(const n of c){t.viewport=n;const e=this._drawLayersInViewport(s,t,l);o.push(e)}}return o}_getDrawLayerParams(t,{layers:e,pass:n,layerFilter:i,effects:r,moduleParameters:s}){const o=[],a=AI(),l={viewport:t,isPicking:n.startsWith("picking"),renderPass:n};for(let c=0;cpS(t,e))}const a={totalCount:e.length,visibleCount:0,compositeCount:0,pickableCount:0};yx(t,{viewport:o});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in n){const t=n[l]=n[l]||AI(e[l],e);c=t(r,s),n[a]=t}else Number.isFinite(o)?(c=o+(e[l]||0),n[a]=null):c=t;return s&&c>=t&&(t=c+1),e[a]=c,c};return i}class PI extends kI{constructor(t,e){super(t,e),this.shadowMap=new lS(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new hS(t,{format:33189,width:1,height:1}),this.fbo=new SS(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;vx(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const n=t.viewports[0],i=_x(this.gl),r=n.width*i,s=n.height*i;(r!==e.width||s!==e.height)&&e.resize({width:r,height:s}),super.render(ti(bt({},t),{target:e,pass:"shadow"}))})}shouldDrawLayer(t){return!1!==t.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const II=Object.keys(Mw).map(t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(Mw[t],";")).join(""),MI=Object.keys(Dw).map(t=>"const int PROJECTION_MODE_".concat(t," = ").concat(Dw[t],";")).join("");var DI="".concat(II,"\n").concat(MI,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n");const RI={};var NI={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:DI,getUniforms:function(t=RI){return t.viewport?function({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:i=Mw.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mw.DEFAULT&&(i=t.isGeospatial?Mw.LNGLAT:Mw.CARTESIAN);const o=aT({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=n||rT,o}(t):{}}};const LI=$O(function({viewport:t,center:e}){return new bT(t.viewProjectionMatrix).invert().transform(e)}),jI=$O(function({viewport:t,shadowMatrices:e}){const n=[],i=t.pixelUnprojectionMatrix,r=t.isGeospatial?void 0:1,s=[[0,0,r],[t.width,0,r],[0,t.height,r],[t.width,t.height,r],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(t=>function(t,e){const[n,i,r]=t,s=LT([n,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(t,i));for(const o of e){const e=o.clone().translate(new nE(t.center).negate()),i=s.map(t=>e.transform(t)),r=(new bT).ortho({left:Math.min(...i.map(t=>t[0])),right:Math.max(...i.map(t=>t[0])),bottom:Math.min(...i.map(t=>t[1])),top:Math.max(...i.map(t=>t[1])),near:Math.min(...i.map(t=>-t[2])),far:Math.max(...i.map(t=>-t[2]))});n.push(r.multiplyRight(o))}return n}),FI=[0,0,0,1],BI=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];var VI={name:"shadow",dependencies:[NI],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(t={},e={})=>{if(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0){const{shadowEnabled:n=!0}=t;return n&&t.shadowMatrices&&t.shadowMatrices.length>0?function(t={},e={}){const n={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||FI,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},i=LI({viewport:t.viewport,center:e.project_uCenter}),r=[],s=jI({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let o=0;o0?t.shadowMaps[o]:t.dummyShadowMap;return n}(t,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}};const zI={color:[255,255,255],intensity:1},UI=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],HI=[0,0,0,200/255];class $I extends TI{constructor(t){super(t),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=HI,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const e in t){const n=t[e];switch(n.type){case"ambient":this.ambientLight=n;break;case"directional":this.directionalLights.push(n);break;case"point":this.pointLights.push(n)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(t,{layers:e,layerFilter:n,viewports:i,onViewportActive:r,views:s}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=sO.getDefaultProgramManager(t),VI&&this.programManager.addDefaultModule(VI)),this.dummyShadowMap||(this.dummyShadowMap=new lS(t,{width:1,height:1}));for(let t=0;te.getProjectedLight({layer:t})),pointLights:this.pointLights.map(e=>e.getProjectedLight({layer:t}))},e}cleanup(){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(VI),this.programManager=null)}_createLightMatrix(){const t=[];for(const e of this.directionalLights){const n=(new bT).lookAt({eye:new nE(e.direction).negate()});t.push(n)}return t}_createShadowPasses(t){for(let e=0;e=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const i of e)this._setChannelTime(i,this.time);const n=this.animations.values();for(const i of n){const{animation:t,channel:e}=i;t.setTime(this.getTime(e))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const n=WI++;return this.animations.set(n,{animation:t,channel:e}),t.setTime(this.getTime(e)),n}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const n=e-t.delay;n>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,n)%t.duration,t.time*=t.rate)}}class XI{constructor(t,e,n){this.id=t,this.context=n,this._loadCount=0,this._subscribers=new Set,this.setData(e)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(t,e){if(t===this._data&&!e)return;this._data=t;const n=++this._loadCount;let i=t;"string"==typeof t&&(i=AP(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then(t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=null,this._content=t)}).catch(t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=t||!0)})):(this.isLoaded=!0,this._error=null,this._content=t);for(const r of this._subscribers)r.onChange(this.getData())}}class YI{constructor({gl:t,protocol:e}){this.protocol=e||"resource://",this._context={gl:t,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return!!t.startsWith(this.protocol)||t in this._resources}add({resourceId:t,data:e,forceUpdate:n=!1,persistent:i=!0}){let r=this._resources[t];r?r.setData(e,n):(r=new XI(t,e,this._context),this._resources[t]=r),r.persistent=i}remove(t){const e=this._resources[t];e&&(e.delete(),delete this._resources[t])}unsubscribe({consumerId:t}){const e=this._consumers[t];if(e){for(const t in e){const n=e[t];n.resource&&n.resource.unsubscribe(n)}delete this._consumers[t],this.prune()}}subscribe({resourceId:t,onChange:e,consumerId:n,requestId:i="default"}){const{_resources:r,protocol:s}=this;t.startsWith(s)&&(r[t=t.replace(s,"")]||this.add({resourceId:t,data:null,persistent:!1}));const o=r[t];if(this._track(n,i,o,e),o)return o.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const t in this._resources)this._resources[t].delete()}_track(t,e,n,i){const r=this._consumers,s=r[t]=r[t]||{},o=s[e]||{};o.resource&&(o.resource.unsubscribe(o),o.resource=null,this.prune()),n&&(s[e]=o,o.onChange=i,o.resource=n,n.subscribe(o))}_prune(){this._pruneRequest=null;for(const t of Object.keys(this._resources)){const e=this._resources[t];!e.persistent&&!e.inUse()&&(e.delete(),delete this._resources[t])}}}const KI=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},NI],QI=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function ZI(t){const e=sO.getDefaultProgramManager(t);for(const n of KI)e.addDefaultModule(n);for(const n of QI)e.addShaderHook(n);return e}const JI=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class tM{constructor(t,{deck:e,stats:n,viewport:i,timeline:r}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new YI({gl:t,protocol:"deck://"}),this.context=ti(bt({},JI),{layerManager:this,gl:t,deck:e,programManager:t&&ZI(t),stats:n||new Ix({id:"deck.gl"}),viewport:i||new WT({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:r||new qI,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const t of this.layers)this._finalizeLayer(t)}needsRedraw(t={clearRedrawFlags:!1}){let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(const n of this.layers){const i=n.getNeedsRedraw(t);e=e||i}return e}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers({layerIds:t=null}={}){return t?this.layers.filter(e=>t.find(t=>0===e.id.indexOf(t))):this.layers}setProps(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}setLayers(t,e){PE("layerManager.setLayers",this,e,t),this.lastRenderedLayers=t,t=gE(t,Boolean);for(const n of t)n.context=this.context;return this._updateLayers(this.layers,t),this}updateLayers(){const t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this.lastRenderedLayers,t)),this._nextLayers=null}activateViewport(t){return PE("layerManager.activateViewport",this,t),t&&(this.context.viewport=t),this}_handleError(t,e,n){n.raiseError(e,"".concat(t," of ").concat(n))}_updateLayers(t,e){const n={};for(const s of t)n[s.id]?Iw.warn("Multiple old layers with same id ".concat(s.id))():n[s.id]=s;const i=[];this._updateSublayersRecursively(e,n,i),this._finalizeOldLayers(n);let r=!1;for(const s of i)if(s.hasUniformTransition()){r=!0;break}this._needsUpdate=r,this.layers=i}_updateSublayersRecursively(t,e,n){for(const r of t){r.context=this.context;const t=e[r.id];null===t&&Iw.warn("Multiple new layers with same id ".concat(r.id))(),e[r.id]=null;let s=null;try{this._debug&&t!==r&&r.validateProps(),t?(this._transferLayerState(t,r),this._updateLayer(r)):this._initializeLayer(r),n.push(r),s=r.isComposite&&r.getSubLayers()}catch(i){this._handleError("matching",i,r)}s&&this._updateSublayersRecursively(s,e,n)}}_finalizeOldLayers(t){for(const e in t){const n=t[e];n&&this._finalizeLayer(n)}}_initializeLayer(t){try{t._initialize(),t.lifecycle="Initialized"}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(t,e){e._transferState(t),e.lifecycle="Matched. State transferred from previous layer",e!==t&&(t.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle="No longer matched. Awaiting garbage collection";try{t._finalize(),t.lifecycle="Finalized! Awaiting garbage collection"}catch(e){this._handleError("finalization",e,t)}}}class eM{constructor(t={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(const t in this.controllers)this.controllers[t]&&this.controllers[t].finalize();this.controllers={}}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(const t in this.controllers){const e=this.controllers[t];e&&e.updateTransition()}}getViewports(t){return t?this._viewports.filter(e=>e.containsPixel(t)):this._viewports}getViews(){const t={};return this.views.forEach(e=>{t[e.id]=e}),t}getView(t){return"string"==typeof t?this.views.find(e=>e.id===t):t}getViewState(t){const e=this.getView(t),n=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(n):n}getViewport(t){return this._viewportMap[t]}unproject(t,e){const n=this.getViewports(),i={x:t[0],y:t[1]};for(let r=n.length-1;r>=0;--r){const s=n[r];if(s.containsPixel(i)){const n=t.slice();return n[0]-=s.x,n[1]-=s.y,s.unproject(n,e)}}return null}setProps(t){"views"in t&&this._setViews(t.views),"viewState"in t&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,e){(t!==this.width||e!==this.height)&&(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}_setViews(t){t=gE(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){t?(!zP(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):Iw.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(t,e){e.viewId=t,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(e)}_createController(t,e){return new(0,e.type)(bt({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>t._getViewport(e,{width:e.width,height:e.height})},e))}_updateController(t,e,n,i){let r=t.controller;return r?(r=ti(bt(bt(bt({},e),t.props),r),{id:t.id,x:n.x,y:n.y,width:n.width,height:n.height}),i?i.setProps(r):i=this._createController(t,r),i):null}_rebuildViewports(){const{width:t,height:e,views:n}=this,i=this.controllers;this._viewports=[],this.controllers={};let r=!1;for(let s=n.length;s--;){const o=n[s],a=this.getViewState(o),l=o.makeViewport({width:t,height:e,viewState:a});let c=i[o.id];o.controller&&!c&&(r=!0),(r||!o.controller)&&c&&(c.finalize(),c=null),this.controllers[o.id]=this._updateController(o,a,l,c),this._viewports.unshift(l)}for(const s in i)i[s]&&!this.controllers[s]&&i[s].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)})}_diffViews(t,e){return t.length!==e.length||t.some((n,i)=>!t[i].equals(e[i]))}}class nM extends sI{constructor({makeViewport:t,width:e,height:n,latitude:i,longitude:r,zoom:s,bearing:o=0,pitch:a=0,altitude:l=1.5,maxZoom:c=20,minZoom:u=0,maxPitch:h=60,minPitch:d=0,startPanLngLat:p,startZoomLngLat:f,startRotatePos:g,startBearing:m,startPitch:b,startZoom:y,normalize:v}={}){uE(Number.isFinite(r)),uE(Number.isFinite(i)),uE(Number.isFinite(s)),super({width:e,height:n,latitude:i,longitude:r,zoom:s,bearing:o,pitch:a,altitude:l,maxZoom:c,minZoom:u,maxPitch:h,minPitch:d,normalize:v}),this._state={startPanLngLat:p,startZoomLngLat:f,startRotatePos:g,startBearing:m,startPitch:b,startZoom:y},this.makeViewport=t}panStart({pos:t}){return this._getUpdatedState({startPanLngLat:this._unproject(t)})}pan({pos:t,startPos:e}){const n=this._state.startPanLngLat||this._unproject(e);if(!n)return this;const i=this.makeViewport(this._viewportProps).panByPosition(n,t);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){const{startRotatePos:i,startBearing:r,startPitch:s}=this._state;if(!i||!Number.isFinite(r)||!Number.isFinite(s))return this;let o;return o=t?this._calculateNewPitchAndBearing(ti(bt({},this._getRotationParams(t,i)),{startBearing:r,startPitch:s})):{bearing:r+e,pitch:s+n},this._getUpdatedState(o)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:t}){return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}zoom({pos:t,startPos:e,scale:n}){let{startZoom:i,startZoomLngLat:r}=this._state;Number.isFinite(i)||(i=this._viewportProps.zoom,r=this._unproject(e)||this._unproject(t));const s=this._calculateNewZoom({scale:n,startZoom:i}),o=this.makeViewport(ti(bt({},this._viewportProps),{zoom:s}));return this._getUpdatedState(bt({zoom:s},o.panByPosition(r,t)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(t=2){return this._zoomFromCenter(t)}zoomOut(t=2){return this._zoomFromCenter(1/t)}moveLeft(t=100){return this._panFromCenter([t,0])}moveRight(t=100){return this._panFromCenter([-t,0])}moveUp(t=100){return this._panFromCenter([0,t])}moveDown(t=100){return this._panFromCenter([0,-t])}rotateLeft(t=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-t})}rotateRight(t=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+t})}rotateUp(t=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+t})}rotateDown(t=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),n=bt({},this._viewportProps),{bearing:i,longitude:r}=n;return Math.abs(i-e.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-e.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}_zoomFromCenter(t){const{width:e,height:n}=this._viewportProps;return this.zoom({pos:[e/2,n/2],scale:t})}_panFromCenter(t){const{width:e,height:n}=this._viewportProps;return this.pan({startPos:[e/2,n/2],pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new this.constructor(bt(bt(bt({makeViewport:this.makeViewport},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i}=t;t.zoom=LS(i,n,e);const{maxPitch:r,minPitch:s,pitch:o}=t;t.pitch=LS(o,s,r);const{normalize:a=!0}=t;return a&&Object.assign(t,function({width:t,height:e,longitude:n,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(n<-180||n>180)&&(n=vT(n+180,360)-180),(o<-180||o>180)&&(o=vT(o+180,360)-180);const a=_T(e/512);if(r<=a)r=a,i=0;else{const t=e/2/Math.pow(2,r),n=kT([0,t])[1];if(ie&&(i=e)}}return{width:t,height:e,longitude:n,latitude:i,zoom:r,pitch:s,bearing:o}}(t)),t}_unproject(t){const e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}_calculateNewZoom({scale:t,startZoom:e}){const{maxZoom:n,minZoom:i}=this._viewportProps;return LS(e+Math.log2(t),i,n)}_calculateNewPitchAndBearing({deltaScaleX:t,deltaScaleY:e,startBearing:n,startPitch:i}){e=LS(e,-1,1);const{minPitch:r,maxPitch:s}=this._viewportProps;let o=i;return e>0?o=i+e*(s-i):e<0&&(o=i-e*(r-i)),{pitch:o,bearing:n+180*t}}_getRotationParams(t,e){const n=t[0]-e[0],i=t[1]-e[1],r=t[1],s=e[1],{width:o,height:a}=this._viewportProps,l=n/o;let c=0;return i>0?Math.abs(a-s)>5&&(c=i/(s-a)*1.2):i<0&&s>5&&(c=1-r/s),c=Math.min(1,Math.max(-1,c)),{deltaScaleX:l,deltaScaleY:c}}}class iM extends rI{constructor(t){t.dragMode=t.dragMode||"pan",super(nM,t)}setProps(t){const e=this.controllerStateProps;super.setProps(t),(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState(bt(bt({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let rM=(()=>{class t extends UP{constructor(t){super(ti(bt({},t),{type:qT}))}get controller(){return this._getControllerProps({type:iM})}}return t.displayName="MapView",t})();const sM=new $I;class oM{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(t){"effects"in t&&(t.effects.length!==this.effects.length||!zP(t.effects,this.effects))&&(this.setEffects(t.effects),this._needsRedraw="effects changed")}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(t=[]){this.cleanup(),this.effects=t,this._createInternalEffects()}cleanup(){for(const t of this.effects)t.cleanup();for(const t of this._internalEffects)t.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(t=>t instanceof $I)||this._internalEffects.push(sM)}}class aM extends kI{}const lM={blendFunc:[1,0,32771,0],blendEquation:32774};class cM extends kI{render(t){t.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(t)):(this.useAlpha=!1,super.render(t))}_drawPickingBuffer({layers:t,layerFilter:e,views:n,viewports:i,onViewportActive:r,pickingFBO:s,deviceRect:{x:o,y:a,width:l,height:c},pass:u="picking",redrawReason:h,pickZ:d}){const p=this.gl;return this.pickZ=d,vx(p,ti(bt({scissorTest:!0,scissor:[o,a,l,c],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},lM),{blend:!d}),()=>{super.render({target:s,layers:t,layerFilter:e,views:n,viewports:i,onViewportActive:r,pass:u,redrawReason:h})})}shouldDrawLayer(t){return t.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(t,e){const n=this.pickZ?{blend:!1}:ti(bt({},lM),{blend:!0,blendColor:[0,0,0,this.useAlpha?(e+1)/255:1]});return bt(bt({},t.props.parameters),n)}}class uM{constructor(t){this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new aM(t),this.pickLayersPass=new cM(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){"layerFilter"in t&&this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in t&&this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(t){const e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;t.layerFilter=this.layerFilter,t.effects=t.effects||[],t.target=t.target||SS.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);const n=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,i=e.render(ti(bt({},t),{target:n}));this._postRender(t.effects,t),this.renderCount++,PE("deckRenderer.renderLayers",this,i,t)}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}finalize(){const{renderBuffers:t}=this;for(const e of t)e.delete();t.length=0}_preRender(t,e){let n=null;for(const i of t)i.preRender(this.gl,e),i.postRender&&(n=i);n&&this._resizeRenderBuffers(),this.lastPostProcessEffect=n}_resizeRenderBuffers(){const{renderBuffers:t}=this;0===t.length&&t.push(new SS(this.gl),new SS(this.gl));for(const e of t)e.resize()}_postRender(t,e){const{renderBuffers:n}=this,i={inputBuffer:n[0],swapBuffer:n[1],target:null};for(const r of t)if(r.postRender){if(r===this.lastPostProcessEffect){i.target=e.target,r.postRender(this.gl,i);break}const t=r.postRender(this.gl,i);i.inputBuffer=t,i.swapBuffer=t===n[0]?n[1]:n[0]}}}const hM={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function dM({pickedColors:t,layers:e,deviceX:n,deviceY:i,deviceRadius:r,deviceRect:s}){if(t){const{x:o,y:a,width:l,height:c}=s;let u=r*r,h=-1,d=0;for(let e=0;eu)d+=4*l;else for(let e=0;e=0){const t=e+o-n,i=t*t+s;i<=u&&(u=i,h=d)}d+=4}}if(h>=0){const n=t[h+3]-1,i=t.slice(h,h+4),r=e[n];if(r){const t=r.decodePickingColor(i),e=Math.floor(h/4/l);return{pickedColor:i,pickedLayer:r,pickedObjectIndex:t,pickedX:o+(h/4-e*l),pickedY:a+e}}Iw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return hM}function pM({pickInfo:t,mode:e,viewports:n,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=t&&t.pickedLayer,c=function(t,e,n){for(let i=t.length-1;i>=0;i--){const r=t[i];if(r.containsPixel(e)&&(!n||n(r)))return r}return t[0]}(n,{x:s,y:o},i&&l&&(t=>i({layer:l,viewport:t,isPicking:!0,renderPass:"picking:".concat(e)}))),u=c&&c.unproject([s-c.x,o-c.y],{targetZ:a});return{color:null,layer:null,viewport:c,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:u,devicePixel:t&&[t.pickedX,t.pickedY],pixelRatio:r}}function fM(t){const{pickInfo:e,lastPickedInfo:n,mode:i,layers:r}=t,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const t=n.index,e=n.layerId,i=o&&o.props.id;if(i!==e||a!==t){if(i!==e){const t=r.find(t=>t.props.id===e);t&&l.unshift(t)}n.layerId=i,n.index=a,n.info=null}}const c=pM(t),u=new Map;return u.set(null,c),l.forEach(t=>{let e=bt({},c);t===o&&(e.color=s,e.index=a,e.picked=!0),e=gM({layer:t,info:e,mode:i}),t===o&&"hover"===i&&(n.info=e),u.set(e.layer.id,e),"hover"===i&&e.layer.updateAutoHighlight(e)}),u}function gM({layer:t,info:e,mode:n}){for(;t&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=t,e=t.getPickingInfo({info:e,mode:n,sourceLayer:i}),t=t.parent}return e}class mM{constructor(t){this.gl=t,this.pickingFBO=null,this.pickLayersPass=new cM(t),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject({x:t,y:e,layers:n,viewports:i},r=this.lastPickedInfo.info){const s=r&&r.layer&&r.layer.id,o=r&&r.viewport&&r.viewport.id,a=s?n.find(t=>t.id===s):null,l=o&&i.find(t=>t.id===o)||i[0],c=l&&l.unproject([t-l.x,e-l.y]),u={x:t,y:e,viewport:l,coordinate:c,layer:a};return a?bt(bt({},r),u):Object.assign(u,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:t}=this;return this.pickingFBO||(this.pickingFBO=new SS(t),SS.isSupported(t,{colorBufferFloat:!0})&&(this.depthFBO=new SS(t),this.depthFBO.attach({36064:new lS(t,{format:Fw(t)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.pickingFBO}_getPickable(t){if(!1===this._pickable)return null;const e=t.filter(t=>t.isPickable()&&!t.isComposite);return e.length>255?(Iw.warn("Too many pickable layers, only picking the first 255")(),e.slice(0,255)):e.length?e:null}_pickClosestObject({layers:t,views:e,viewports:n,x:i,y:r,radius:s=0,depth:o=1,mode:a="query",unproject3D:l,onViewportActive:c}){if(!(t=this._getPickable(t)))return{result:[],emptyInfo:pM({viewports:n,x:i,y:r})};this._resizeBuffer();const u=_x(this.gl),h=wx(this.gl,[i,r],!0),d=[h.x+Math.floor(h.width/2),h.y+Math.floor(h.height/2)],p=Math.round(s*u),{width:f,height:g}=this.pickingFBO,m=this._getPickingRect({deviceX:d[0],deviceY:d[1],deviceRadius:p,deviceWidth:f,deviceHeight:g});let b;const y=[],v={};for(let _=0;_=0){const s=t.slice(i,i+4),o=s.join(",");if(!n.has(o)){const t=e[r];t?n.set(o,{pickedColor:s,pickedLayer:t,pickedObjectIndex:t.decodePickingColor(s)}):Iw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}({pickedColors:this._drawAndSample({layers:t,views:e,viewports:n,onViewportActive:c,deviceRect:{x:d,y:g,width:f.x+f.width-d,height:p-g},pass:"picking:".concat(a),redrawReason:a}),layers:t}),b=new Map,y=Number.isFinite(l);for(let v=0;v=l);v++){const t=m[v];let e={color:t.pickedColor,layer:null,index:t.pickedObjectIndex,picked:!0,x:i,y:r,width:s,height:o,pixelRatio:u};e=gM({layer:t.pickedLayer,info:e,mode:a}),b.has(e.object)||b.set(e.object,e)}return Array.from(b.values())}_drawAndSample({layers:t,views:e,viewports:n,onViewportActive:i,deviceRect:r,pass:s,redrawReason:o,pickZ:a}){if(t.length<1)return null;const l=a?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:t,layerFilter:this.layerFilter,views:e,viewports:n,onViewportActive:i,pickingFBO:l,deviceRect:r,pass:s,redrawReason:o,pickZ:a});const{x:c,y:u,width:h,height:d}=r,p=new(a?Float32Array:Uint8Array)(h*d*4);return _S(l,{sourceX:c,sourceY:u,sourceWidth:h,sourceHeight:d,target:p}),p}_getPickingRect({deviceX:t,deviceY:e,deviceRadius:n,deviceWidth:i,deviceHeight:r}){const s=Math.max(0,t-n),o=Math.max(0,e-n),a=Math.min(i,t+n+1)-s,l=Math.min(r,e+n+1)-o;return a<=0||l<=0?null:{x:s,y:o,width:a,height:l}}}const bM={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class yM{constructor(t){const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,bM),e.appendChild(this.el)),this.isVisible=!1}setTooltip(t,e,n){const i=this.el;if("string"==typeof t)i.innerText=t;else{if(!t)return this.isVisible=!1,void(i.style.display="none");"text"in t&&(i.innerText=t.text),"html"in t&&(i.innerHTML=t.html),"className"in t&&(i.className=t.className),Object.assign(i.style,t.style)}this.isVisible=!0,i.style.display="block",i.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}remove(){this.el&&this.el.remove()}}function vM(t,e){if(!t)throw new Error(e)}const _M={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},wM=_M.global||_M.self||_M.window,xM="object"!=typeof process||"[object process]"!==String(process)||process.browser,SM="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:EM}=(SM&&parseFloat(SM[1]),wM),CM="undefined"!=typeof Image,OM="undefined"!=typeof ImageBitmap,TM=Boolean(EM),kM=!!xM||TM;function AM(t){const e=function(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}(t);if(!e)throw new Error("Not an image");return e}function PM(t){switch(AM(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}const IM=/^data:image\/svg\+xml/,MM=/\.svg((\?|#).*)?$/;function DM(t){return t&&(IM.test(t)||MM.test(t))}function RM(t,e){if(DM(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(e)}`}return NM(t,e)}function NM(t,e){if(DM(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function LM(t,e,n){return jM.apply(this,arguments)}function jM(){return(jM=gS(function*(t,e,n){const i=RM(t,n),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield FM(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function FM(t,e){return BM.apply(this,arguments)}function BM(){return(BM=gS(function*(t,e){const n=new Image;return n.src=t,e.image&&e.image.decode&&n.decode?(yield n.decode(),n):yield new Promise((e,i)=>{try{n.onload=()=>e(n),n.onerror=e=>i(new Error(`Could not load image ${t}: ${e}`))}catch(r){i(r)}})})).apply(this,arguments)}const VM={};let zM=!0;function UM(t,e,n){return HM.apply(this,arguments)}function HM(){return(HM=gS(function*(t,e,n){let i;i=DM(n)?yield LM(t,e,n):NM(t,n);const r=e&&e.imagebitmap;return yield $M(i,r)})).apply(this,arguments)}function $M(t){return GM.apply(this,arguments)}function GM(){return(GM=gS(function*(t,e=null){if((WM(e)||!zM)&&(e=null),e)try{return yield createImageBitmap(t,e)}catch(n){console.warn(n),zM=!1}return yield createImageBitmap(t)})).apply(this,arguments)}function WM(t){for(const e in t||VM)return!1;return!0}const qM=!1,XM=!0;function YM(t){const e=KM(t);return function(t){const e=KM(t);return e.byteLength>=24&&2303741511===e.getUint32(0,qM)?{mimeType:"image/png",width:e.getUint32(16,qM),height:e.getUint32(20,qM)}:null}(e)||function(t){const e=KM(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,qM)&&255===e.getUint8(2)))return null;const{tableMarkers:n,sofMarkers:i}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let r=2;for(;r+9=10&&1195984440===e.getUint32(0,qM)?{mimeType:"image/gif",width:e.getUint16(6,XM),height:e.getUint16(8,XM)}:null}(e)||function(t){const e=KM(t);return e.byteLength>=14&&16973===e.getUint16(0,qM)&&e.getUint32(2,XM)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,XM),height:e.getUint32(22,XM)}:null}(e)}function KM(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}function QM(t,e){const{mimeType:n}=YM(t)||{},{_parseImageNode:i}=wM;return vM(i),i(t,n,e)}function ZM(){return(ZM=gS(function*(t,e,n){const i=((e=e||{}).image||{}).type||"auto",{url:r}=n||{};let s;switch(JM(i)){case"imagebitmap":s=yield UM(t,e,r);break;case"image":s=yield LM(t,e,r);break;case"data":s=yield QM(t,e);break;default:vM(!1)}return"data"===i&&(s=PM(s)),s})).apply(this,arguments)}function JM(t){switch(t){case"auto":case"data":return function(){if(OM)return"imagebitmap";if(CM)return"image";if(kM)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return OM||CM||kM;case"imagebitmap":return OM;case"image":return CM;case"data":return kM;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}const tD={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(t,e,n){return ZM.apply(this,arguments)},tests:[t=>Boolean(YM(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};var eD={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){const e=t[0],n=t[t.length-1];return"{"===e&&"}"===n||"["===e&&"]"===n},parseTextSync:JSON.parse};const nD="8.5.8",iD=zw.CO.deck&&zw.CO.deck.VERSION;if(iD&&iD!==nD)throw new Error("deck.gl - multiple versions detected: ".concat(iD," vs ").concat(nD));iD||(Iw.log(1,"deck.gl ".concat(nD))(),zw.CO.deck=Object.assign(zw.CO.deck||{},{VERSION:nD,version:nD,log:Iw,_registerLoggers:function(t){AE=t}}),fP([eD,[tD,{imagebitmap:{premultiplyAlpha:"none"}}]]));var rD=zw.CO.deck;class sD extends Hx{static isSupported(t,e=[]){const n=Fw(t),i=OS(t,"TIMER_QUERY");let r=n||i;for(const s of e)switch(s){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Rx(!1)}return r}constructor(t,e={}){super(t,e),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:t=!1}={}){return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(t=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise((n,i)=>{const r=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):e++>t?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(r)};requestAnimationFrame(r)}),this._pollingPromise}_createHandle(){return sD.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const oD=(0,zw.jU)()&&"undefined"!=typeof document;let aD=0;class lD{constructor(t={}){const{onCreateContext:e=(t=>Tx(t)),onAddHTML:n=null,onInitialize:i=(()=>{}),onRender:r=(()=>{}),onFinalize:s=(()=>{}),onError:o,gl:a=null,glOptions:l={},debug:c=!1,createFramebuffer:u=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:d=!0,stats:p=Dx.get("animation-loop-"+aD++)}=t;let{useDevicePixels:f=!0}=t;"useDevicePixelRatio"in t&&(Nw.deprecated("useDevicePixelRatio","useDevicePixels")(),f=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:n,onInitialize:i,onRender:r,onFinalize:s,onError:o,gl:a,glOptions:l,debug:c,createFramebuffer:u},this.gl=a,this.needsRedraw=null,this.timeline=null,this.stats=p,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:d,useDevicePixels:f}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return Rx("string"==typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(t={}){if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=sD.isSupported(this.gl,["timers"])?new sD(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())});return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(t=>{this._resolveNextFrame=t})),this._nextFramePromise}toDataURL(){var t=this;return gS(function*(){return t.setNeedsRedraw("toDataURL"),yield t.waitForRender(),t.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...t){return this.props.onCreateContext(...t)}onInitialize(...t){return this.props.onInitialize(...t)}onRender(...t){return this.props.onRender(...t)}onFinalize(...t){return this.props.onFinalize(...t)}getHTMLControlValue(t,e=1){const n=document.getElementById(t);return n?Number(n.value):e}setViewParameters(){return Nw.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=oD?new Promise((t,e)=>{oD&&"complete"===document.readyState?t(document):window.addEventListener("load",()=>{t(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}(t)}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}(t)}_renderFrame(...t){this.display?this.display._renderFrame(...t):this.onRender(...t)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:n}=this._getSizeAndAspect();(t!==this.animationProps.width||e!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),n!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=n,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"==typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!=typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?kx(this.props.gl,t):this.onCreateContext(t),!jw(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(t){yx(t,tx)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const n=this.props.onAddHTML(e);n&&(e.innerHTML=n)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let n=1;const{canvas:i}=this.gl;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:t>0&&e>0&&(n=t/e),{width:t,height:e,aspect:n}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(t,e={}){if(t.canvas)return void function(t,e,n){let i="width"in n?n.width:t.canvas.clientWidth,r="height"in n?n.height:t.canvas.clientHeight;(!i||!r)&&(Nw.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=t.canvas.width||1,r=t.canvas.height||1),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};const s=t.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let n=e;const s=Math.floor(i*n),o=Math.floor(r*n);t.canvas.width=s,t.canvas.height=o,(t.drawingBufferWidth!==s||t.drawingBufferHeight!==o)&&(Nw.warn("Device pixel ratio clamped")(),n=Math.min(t.drawingBufferWidth/i,t.drawingBufferHeight/r),t.canvas.width=Math.floor(i*n),t.canvas.height=Math.floor(r*n)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(t,function(t){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e);const n=t.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in e&&"height"in e&&n.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new SS(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}var cD=n(11524),uD=n.n(cD);const hD={mousedown:1,mousemove:2,mouseup:4};(function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const n=this.store;t.button>0&&"pointerdown"===t.type&&(function(e,n){for(let i=0;i=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(uD().MouseInput);const dD=uD().Manager;var pD=uD();const fD=pD?[[pD.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[pD.Rotate,{enable:!1}],[pD.Pinch,{enable:!1}],[pD.Swipe,{enable:!1}],[pD.Pan,{threshold:0,enable:!1}],[pD.Press,{enable:!1}],[pD.Tap,{event:"doubletap",taps:2,enable:!1}],[pD.Tap,{event:"anytap",enable:!1}],[pD.Tap,{enable:!1}]]:null,gD={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},mD={doubletap:["tap"]},bD={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},yD={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},vD={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},_D={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},wD="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",xD="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let SD=!1;try{const t={get passive(){return SD=!0,!0}};xD.addEventListener("test",t,t),xD.removeEventListener("test",t,t)}catch(m){}const ED=-1!==wD.indexOf("firefox"),{WHEEL_EVENTS:CD}=yD,OD=4.000244140625;class TD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.events=CD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!SD&&{passive:!1}))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){"wheel"===t&&(this.options.enable=e)}handleEvent(t){if(!this.options.enable)return;let e=t.deltaY;xD.WheelEvent&&(ED&&t.deltaMode===xD.WheelEvent.DOM_DELTA_PIXEL&&(e/=xD.devicePixelRatio),t.deltaMode===xD.WheelEvent.DOM_DELTA_LINE&&(e*=40));const n={x:t.clientX,y:t.clientY};0!==e&&e%OD==0&&(e=Math.floor(e/OD)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}_onWheel(t,e,n){this.callback({type:"wheel",center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}const{MOUSE_EVENTS:kD}=yD,AD="pointermove",PD="pointerover",ID="pointerout",MD="pointerleave";class DD{constructor(t,e,n={}){this.element=t,this.callback=e,this.pressed=!1,this.options=Object.assign({enable:!0},n),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=kD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){t===AD&&(this.enableMoveEvent=e),t===PD&&(this.enableOverEvent=e),t===ID&&(this.enableOutEvent=e),t===MD&&(this.enableLeaveEvent=e)}handleEvent(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:PD,srcEvent:t,pointerType:"mouse",target:t.target})}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:ID,srcEvent:t,pointerType:"mouse",target:t.target})}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:MD,srcEvent:t,pointerType:"mouse",target:t.target})}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:AD,srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:RD}=yD,ND="keydown";class LD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=RD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=n.tabIndex||0,t.style.outline="none",this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){t===ND&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}handleEvent(t){const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:ND,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}const jD="contextmenu";class FD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===jD&&(this.options.enable=e)}handleEvent(t){!this.options.enable||this.callback({type:jD,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}const BD={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},VD={srcElement:"root",priority:0};class zD{constructor(t){this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(t,e,n,i=!1,r=!1){const{handlers:s,handlersByElement:o}=this;n&&("object"!=typeof n||n.addEventListener)&&(n={srcElement:n}),n=n?Object.assign({},VD,n):VD;let a=o.get(n.srcElement);a||(a=[],o.set(n.srcElement,a));const l={type:t,handler:e,srcElement:n.srcElement,priority:n.priority};i&&(l.once=!0),r&&(l.passive=!0),s.push(l),this._active=this._active||!l.passive;let c=a.length-1;for(;c>=0&&!(a[c].priority>=l.priority);)c--;a.splice(c+1,0,l)}remove(t,e){const{handlers:n,handlersByElement:i}=this;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.type===t&&s.handler===e){n.splice(r,1);const t=i.get(s.srcElement);t.splice(t.indexOf(s),1),0===t.length&&i.delete(s.srcElement)}}this._active=n.some(t=>!t.passive)}handleEvent(t){if(this.isEmpty())return;const e=this._normalizeEvent(t);let n=t.srcEvent.target;for(;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")}_emit(t,e){const n=this.handlersByElement.get(e);if(n){let e=!1;const i=()=>{t.handled=!0},r=()=>{t.handled=!0,e=!0},s=[];for(let o=0;o{const e=this.manager.get(t);e&&gD[t].forEach(t=>{e.recognizeWith(t)})});for(const n in e.recognizerOptions){const t=this.manager.get(n);if(t){const i=e.recognizerOptions[n];delete i.enable,t.set(i)}}this.wheelInput=new TD(t,this._onOtherEvent,{enable:!1}),this.moveInput=new DD(t,this._onOtherEvent,{enable:!1}),this.keyInput=new LD(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new FD(t,this._onOtherEvent,{enable:!1});for(const[n,i]of this.events)i.isEmpty()||(this._toggleRecognizer(i.recognizerName,!0),this.manager.on(n,i.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,n){this._addEventHandler(t,e,n,!1)}once(t,e,n){this._addEventHandler(t,e,n,!0)}watch(t,e,n){this._addEventHandler(t,e,n,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:n}=this;if(!n)return;const i=n.get(t);if(i&&i.options.enable!==e){i.set({enable:e});const r=mD[t];r&&!this.options.recognizers&&r.forEach(r=>{const s=n.get(r);e?(s.requireFailure(t),i.dropRequireFailure(r)):s.dropRequireFailure(t)})}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,n,i,r){if("string"!=typeof t){n=e;for(const e in t)this._addEventHandler(e,t[e],n,i,r);return}const{manager:s,events:o}=this,a=_D[t]||t;let l=o.get(a);l||(l=new zD(this),o.set(a,l),l.recognizerName=vD[a]||a,s&&s.on(a,l.handleEvent)),l.add(t,e,n,i,r),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:n}=this,i=n.get(_D[t]||t);if(i&&(i.remove(t,e),i.isEmpty())){const{recognizerName:t}=i;let e=!1;for(const i of n.values())if(i.recognizerName===t&&!i.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}_onBasicInput(t){const{srcEvent:e}=t,n=bD[e.type];n&&this.manager.emit(n,t)}_onOtherEvent(t){this.manager.emit(t.type,t)}}function $D(){}const GD={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:$D,onResize:$D,onViewStateChange:$D,onInteractionStateChange:$D,onBeforeRender:$D,onAfterRender:$D,onLoad:$D,onError:(t,e)=>Iw.error(t)(),_onMetrics:null,getCursor:({isDragging:t})=>t?"grabbing":"grab",debug:!1,drawPickingColors:!1};class WD{constructor(t){t=bt(bt({},GD),t),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),t.viewState&&t.initialViewState&&Iw.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,zw.qs)()&&Iw.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new Ix({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&AS.setProps(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&Iw.removed("onLayerHover","onHover")(),"onLayerClick"in t&&Iw.removed("onLayerClick","onClick")(),t.initialViewState&&!zP(this.props.initialViewState,t.initialViewState)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);const e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(t={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);const n=this.viewManager.needsRedraw(t),i=this.layerManager.needsRedraw(t),r=this.effectManager.needsRedraw(t),s=this.deckRenderer.needsRedraw(t);return e=e||n||i||r||s,e}redraw(t){if(!this.layerManager)return;const e=t||this.needsRedraw({clearRedrawFlags:!0});!e||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}getViews(){return this.viewManager.views}getViewports(t){return this.viewManager.getViewports(t)}pickObject(t){const e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}pickObjects(t){return this._pick("pickObjects","pickObjects Time",t)}_addResources(t,e=!1){for(const n in t)this.layerManager.resourceManager.add({resourceId:n,data:t[n],forceUpdate:e})}_removeResources(t){for(const e of t)this.layerManager.resourceManager.remove(e)}_pick(t,e,n){const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(e).timeStart();const r=this.deckPicker[t](bt({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport},n));return i.get(e).timeEnd(),r}_createCanvas(t){let e=t.canvas;return"string"==typeof e&&(e=document.getElementById(e),uE(e)),e||(e=document.createElement("canvas"),e.id=t.id||"deckgl-overlay",(t.parent||document.body).appendChild(e)),Object.assign(e.style,t.style),e}_setCanvasSize(t){if(!this.canvas)return;let{width:e,height:n}=t;(e||0===e)&&(e=Number.isFinite(e)?"".concat(e,"px"):e,this.canvas.style.width=e),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:t,height:e}=this;this.viewManager.setProps({width:t,height:e}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:t}=this;if(!t)return!1;const e=t.clientWidth||t.width,n=t.clientHeight||t.height;return(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,!0)}_createAnimationLoop(t){const{width:e,height:n,gl:i,glOptions:r,debug:s,onError:o,onBeforeRender:a,onAfterRender:l,useDevicePixels:c,autoResizeDrawingBuffer:u}=t;return new lD({width:e,height:n,useDevicePixels:c,autoResizeDrawingBuffer:u,autoResizeViewport:!1,gl:i,onCreateContext:t=>Tx(ti(bt(bt({},r),t),{canvas:this.canvas,debug:s,onContextLost:()=>this._onContextLost()})),onInitialize:t=>this._setGLContext(t.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:a,onAfterRender:l,onError:o})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let t=this.props.views||[new rM({id:"default-view"})];return t=Array.isArray(t)?t:[t],t.length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}_onContextLost(){const{onError:t}=this.props;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}_onPointerMove(t){const{_pickRequest:e}=this;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;{const n=t.offsetCenter;if(!n)return;e.x=n.x,e.y=n.y,e.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t,e.mode="hover"}_pickAndCallback(){const{_pickRequest:t}=this;if(t.event){const{result:e,emptyInfo:n}=this._pick("pickObject","pickObject Time",t);this.interactiveState.isHovering=e.length>0;let i=n,r=!1;for(const s of e)i=s,r=s.layer.onHover(s,t.event);if(!r&&this.props.onHover&&this.props.onHover(i,t.event),this.props.getTooltip){const t=this.props.getTooltip(i);this.tooltip.setTooltip(t,i.x,i.y)}t.event=null}}_updateCursor(){const t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(t){if(this.layerManager)return;this.canvas||(this.canvas=t.canvas,kx(t,{enable:!0,copyState:!0})),this.tooltip=new yM(this.canvas),yx(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new qI;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new HD(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const i in Rw)this.eventManager.on(i,this._onEvent);this.viewManager=new eM({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const n=this.viewManager.getViewports()[0];this.layerManager=new tM(t,{deck:this,stats:this.stats,viewport:n,timeline:e}),this.effectManager=new oM,this.deckRenderer=new uM(t),this.deckPicker=new mM(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:n}=this.layerManager.context;yx(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(bt({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:t,effects:this.effectManager.getEffects()},e)),this.props.onAfterRender({gl:n})}_onRenderFrame(t){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Iw.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){const e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState=ti(bt({},this.viewState),{[t.viewId]:e}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.interactiveState.isDragging=t.isDragging,this.props.onInteractionStateChange(t)}_onEvent(t){const e=Rw[t.type],n=t.offsetCenter;if(!e||!n)return;const i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),{layer:s}=r,o=s&&(s[e.handler]||s.props[e.handler]),a=this.props[e.handler];let l=!1;o&&(l=o.call(s,r,t)),!l&&a&&a(r,t)}_onPointerDown(t){const e=t.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:e.x,y:e.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:t}=this;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();const e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:t,stats:e}=this;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();const n=Dx.get("Memory Usage");t.bufferMemory=n.get("Buffer Memory").count,t.textureMemory=n.get("Texture Memory").count,t.renderbufferMemory=n.get("Renderbuffer Memory").count,t.gpuMemory=n.get("GPU Memory").count}}WD.getPropTypes=function(t){return{id:t.string,width:t.oneOfType([t.number,t.string]),height:t.oneOfType([t.number,t.string]),layers:t.oneOfType([t.object,t.array]),layerFilter:t.func,views:t.oneOfType([t.object,t.array]),viewState:t.object,effects:t.arrayOf(t.instanceOf(TI)),controller:t.oneOfType([t.func,t.bool,t.object]),gl:t.object,glOptions:t.object,parameters:t.object,pickingRadius:t.number,useDevicePixels:t.oneOfType([t.bool,t.number]),touchAction:t.string,eventRecognizerOptions:t.object,onWebGLInitialized:t.func,onResize:t.func,onViewStateChange:t.func,onInteractionStateChange:t.func,onBeforeRender:t.func,onAfterRender:t.func,onLoad:t.func,onError:t.func,debug:t.bool,drawPickingColors:t.bool,_framebuffer:t.object,_animate:t.bool,_pickable:t.bool,_typedArrayManagerProps:t.object}},WD.defaultProps=GD,WD.VERSION=rD.VERSION;var qD={name:"project32",dependencies:[NI],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},XD="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n";const YD={lightSources:{}};function KD({color:t=[0,0,0],intensity:e=1}={}){return t.map(t=>t*e/255)}const QD={name:"lights",vs:XD,fs:XD,getUniforms:function t(e=YD){if("lightSources"in e){const{ambientLight:t,pointLights:n,directionalLights:i}=e.lightSources||{};return t||n&&n.length>0||i&&i.length>0?Object.assign({},function({ambientLight:t,pointLights:e=[],directionalLights:n=[]}){const i={};return i["lighting_uAmbientLight.color"]=t?KD(t):[0,0,0],e.forEach((t,e)=>{i[`lighting_uPointLight[${e}].color`]=KD(t),i[`lighting_uPointLight[${e}].position`]=t.position,i[`lighting_uPointLight[${e}].attenuation`]=t.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,n.forEach((t,e)=>{i[`lighting_uDirectionalLight[${e}].color`]=KD(t),i[`lighting_uDirectionalLight[${e}].direction`]=t.direction}),i.lighting_uDirectionalLightCount=n.length,i}({ambientLight:t,pointLights:n,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const n={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":n.ambientLight=t;break;case"directional":n.directionalLights.push(t);break;case"point":n.pointLights.push(t)}return t({lightSources:n})}return{}},defines:{MAX_LIGHTS:3}};const ZD={};const JD={name:"phong-lighting",dependencies:[QD],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(t=ZD){if(!("material"in t))return{};const{material:e}=t;return e?function(t){const{ambient:e=.35,diffuse:n=.6,shininess:i=32,specularColor:r=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:n,lighting_uShininess:i,lighting_uSpecularColor:r.map(t=>t/255)}}(e):{lighting_uEnabled:!1}}},tR={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};var eR=bt({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(t=tR){const e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){const n=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=n}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){const n=Array.from(t.pickingHighlightColor,t=>t/255);Number.isFinite(n[3])||(n[3]=1),e.picking_uHighlightColor=n}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}});const nR={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class iR{static get DRAW_MODE(){return nR}constructor(t={}){const{id:e=Fx("geometry"),drawMode:n=nR.TRIANGLES,attributes:i={},indices:r=null,vertexCount:s=null}=t;this.id=e,this.drawMode=0|n,this.attributes={},this.userData={},this._setAttributes(i,r),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?bt({indices:this.indices},this.attributes):this.attributes}_print(t){return`Geometry ${this.id} attribute ${t}`}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const n in t){let e=t[n];e=ArrayBuffer.isView(e)?{value:e}:e,Rx(ArrayBuffer.isView(e.value),`${this._print(n)}: must be typed array or object with value as typed array`),("POSITION"===n||"positions"===n)&&!e.size&&(e.size=3),"indices"===n?(Rx(!this.indices),this.indices=e):this.attributes[n]=e}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(t,e){if(e)return e.value.length;let n=1/0;for(const i in t){const e=t[i],{value:r,size:s,constant:o}=e;!o&&r&&s>=1&&(n=Math.min(n,r.length/s))}return Rx(Number.isFinite(n)),n}}const rR=Math.PI/180,sR=new Float32Array(16),oR=new Float32Array(12);function aR(t,e,n){const i=e[0]*rR,r=e[1]*rR,s=e[2]*rR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),d=n[0],p=n[1],f=n[2];t[0]=d*h*u,t[1]=d*l*u,t[2]=d*-a,t[3]=p*(-l*c+h*a*o),t[4]=p*(h*c+l*a*o),t[5]=p*u*o,t[6]=f*(l*o+h*a*c),t[7]=f*(-h*o+l*a*c),t[8]=f*u*c}function lR(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}const cR={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(t,{startRow:e,endRow:n}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,u=Array.isArray(s),h=Array.isArray(r),d=Array.isArray(o),p=c||!l&&Boolean(a(i[0]));t.constant=p?c:h&&u&&d;const f=t.value;if(t.constant){let e;p?(sR.set(a),e=lR(sR)):(e=oR,aR(e,r,s),e.set(o,9)),t.value=new Float32Array(e)}else{let l=e*t.size;const{iterable:g,objectInfo:m}=pE(i,e,n);for(const t of g){let e;m.index++,p?(sR.set(c?a:a(t,m)),e=lR(sR)):(e=oR,aR(e,h?r:r(t,m),u?s:s(t,m)),e.set(d?o:o(t,m),9)),f[l++]=e[0],f[l++]=e[1],f[l++]=e[2],f[l++]=e[3],f[l++]=e[4],f[l++]=e[5],f[l++]=e[6],f[l++]=e[7],f[l++]=e[8],f[l++]=e[9],f[l++]=e[10],f[l++]=e[11]}}}};function uR(t,e){return e===Mw.CARTESIAN||e===Mw.METER_OFFSETS||e===Mw.DEFAULT&&!t.isGeospatial}function hR(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),Iw.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function dR(t,e){if(t.attributes)return hR(t.attributes,e),t instanceof iR?t:new iR(t);if(t.positions||t.POSITION)return hR(t,e),new iR({attributes:t});throw Error("Invalid mesh")}const pR={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let fR=(()=>{class t extends LP{getShaders(){const t=!Fw(this.context.gl),e={};return CS(this.context.gl,"GLSL_DERIVATIVES")&&(e.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[qD,JD,eR],transpileToGLSL100:t,defines:e})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:cR}),this.setState({emptyTexture:new lS(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:e,changeFlags:n}){if(super.updateState({props:t,oldProps:e,changeFlags:n}),t.mesh!==e.mesh||n.extensionsChanged){var i;if(null===(i=this.state.model)||void 0===i||i.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const e=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(e.NORMAL||e.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==e.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:e}=this.context,{sizeScale:n,coordinateSystem:i,_instanced:r}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:n,composeModelMatrix:!r||uR(e,i),flatShading:!this.state.hasNormals}).draw()}getModel(t){const e=new xO(this.context.gl,ti(bt({},this.getShaders()),{id:this.props.id,geometry:dR(t,this.props._useMeshColors),isInstanced:!0})),{texture:n}=this.props,{emptyTexture:i}=this.state;return e.setUniforms({sampler:n||i,hasTexture:Boolean(n)}),e}setTexture(t){const{emptyTexture:e,model:n}=this.state;null==n||n.setUniforms({sampler:t||e,hasTexture:Boolean(t)})}}return t.layerName="SimpleMeshLayer",t.defaultProps=pR,t})();const gR={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[QD]};class mR{constructor(t={}){const{id:e}=t;this.id=e||Fx(this.constructor.name),this.display=!0,this.position=new nE,this.rotation=new nE,this.scale=new nE(1,1,1),this.matrix=new bT,this.userData={},this.props={},this._setScenegraphNodeProps(t)}delete(){}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(t){return Rx(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return Rx(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return Rx(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t,e=!0){e?this.matrix.copy(t):this.matrix=t}setMatrixComponents({position:t,rotation:e,scale:n,update:i=!0}){return t&&this.setPosition(t),e&&this.setRotation(e),n&&this.setScale(n),i&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(n),this}update(t={}){const{position:e,rotation:n,scale:i}=t;return e&&this.setPosition(e),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}getCoordinateUniforms(t,e){Rx(t),e=e||this.matrix;const n=new bT(t).multiplyRight(e),i=n.invert(),r=i.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}class bR extends mR{constructor(t={}){t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;Nw.assert(e.every(t=>t instanceof mR),"every child must an instance of ScenegraphNode"),super(t),this.children=e}add(...t){for(const e of t)Array.isArray(e)?this.add(...e):this.children.push(e);return this}remove(t){const e=this.children,n=e.indexOf(t);return n>-1&&e.splice(n,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(t=>t.delete()),this.removeAll(),super.delete()}traverse(t,{worldMatrix:e=new bT}={}){const n=new bT(e).multiplyRight(this.matrix);for(const i of this.children)i instanceof bR?i.traverse(t,{worldMatrix:n}):t(i,{worldMatrix:n})}}function yR(){var t=new qS(4);return qS!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function vR(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function _R(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3],a=n[0],l=n[1],c=n[2],u=n[3];return t[0]=i*u+o*a+r*c-s*l,t[1]=r*u+o*l+s*a-i*c,t[2]=s*u+o*c+i*l-r*a,t[3]=o*u-i*a-r*l-s*c,t}var wR=tT,xR=function(){var t=XS(),e=YS(1,0,0),n=YS(0,1,0);return function(i,r,s){var o=KS(r,s);return o<-.999999?(QS(t,e,r),function(t){return Math.hypot(t[0],t[1],t[2])}(t)<1e-6&&QS(t,n,r),function(t,e){var n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s}(t,t),vR(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(QS(t,r,s),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=n*n+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=i*o,t[2]=r*o,t[3]=s*o,t}(i,i))}}();yR(),yR(),function(){var t=new qS(9);qS!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1}();const SR=[0,0,0,1],ER={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},CR={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function OR(t){if(!t._animation){const e=CR[t.componentType],n=ER[t.type],i=n*t.count,{buffer:r,byteOffset:s}=t.bufferView.data,o=new e(r,s+(t.byteOffset||0),i);if(1===n)t._animation=Array.from(o);else{const e=[];for(let t=0;t0)n=Math.sqrt(i+1),t[3]=.5*n,t[0]=(e[5]-e[7])*(n=.5/n),t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),t[r]=.5*n,t[3]=(e[3*s+o]-e[3*o+s])*(n=.5/n),t[s]=(e[3*s+r]+e[3*r+s])*n,t[o]=(e[3*o+r]+e[3*r+o])*n}}(this,t),this.check()}identity(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this),this.check()}fromAxisRotation(t,e){return vR(this,t,e),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=zS(t)}get y(){return this[1]}set y(t){this[1]=zS(t)}get z(){return this[2]}set z(t){this[2]=zS(t)}get w(){return this[3]}set w(t){this[3]=zS(t)}len(){return function(t){return Math.hypot(t[0],t[1],t[2],t[3])}(this)}lengthSquared(){return function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}(this)}dot(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}(this,t)}rotationTo(t,e){return xR(this,t,e),this.check()}add(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return function(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3]}(this,this,t),this.check()}calculateW(){return function(t,e){var n=e[0],i=e[1],r=e[2];t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r))}(this,this),this.check()}conjugate(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this,this),this.check()}invert(){return function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=n*n+i*i+r*r+s*s,a=o?1/o:0;t[0]=-n*a,t[1]=-i*a,t[2]=-r*a,t[3]=s*a}(this,this),this.check()}lerp(t,e,n){return function(t,e,n,i){var r=e[0],s=e[1],o=e[2],a=e[3];t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=o+i*(n[2]-o),t[3]=a+i*(n[3]-a)}(this,t,e,n),this.check()}multiplyRight(t,e){return BS(!e),_R(this,this,t),this.check()}multiplyLeft(t,e){return BS(!e),_R(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+o*a,t[1]=r*l+s*a,t[2]=s*l-r*a,t[3]=o*l-i*a}(this,this,t),this.check()}rotateY(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l-s*a,t[1]=r*l+o*a,t[2]=s*l+i*a,t[3]=o*l-r*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+r*a,t[1]=r*l-i*a,t[2]=s*l+o*a,t[3]=o*l-s*a}(this,this,t),this.check()}scale(t){return wR(this,this,t),this.check()}slerp(t,e,n){switch(arguments.length){case 1:({start:t=SR,target:e,ratio:n}=arguments[0]);break;case 2:[e,n]=arguments,t=this}return function(t,e,n,i){var r,s,o,a,l,c=e[0],u=e[1],h=e[2],d=e[3],p=n[0],f=n[1],g=n[2],m=n[3];(s=c*p+u*f+h*g+d*m)<0&&(s=-s,p=-p,f=-f,g=-g,m=-m),1-s>WS?(r=Math.acos(s),o=Math.sin(r),a=Math.sin((1-i)*r)/o,l=Math.sin(i*r)/o):(a=1-i,l=i),t[0]=a*c+l*p,t[1]=a*u+l*f,t[2]=a*h+l*g,t[3]=a*d+l*m}(this,t,e,n),this.check()}transformVector4(t,e=t){return function(t,e,n){var i=e[0],r=e[1],s=e[2],o=n[0],a=n[1],l=n[2],c=n[3],u=c*i+a*s-l*r,h=c*r+l*i-o*s,d=c*s+o*r-a*i,p=-o*i-a*r-l*s;t[0]=u*c+p*-o+h*-l-d*-a,t[1]=h*c+p*-a+d*-o-u*-l,t[2]=d*c+p*-l+u*-a-h*-o,t[3]=e[3]}(e,t,this),US(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t,e){return this.multiplyLeft(t,e)}multiply(t,e){return this.multiplyRight(t,e)}};class AR{constructor(t){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:t,target:n,path:i})=>{(function(t,{input:e,interpolation:n,output:i},r,s){const o=t%e[e.length-1],a=e.findIndex(t=>t>=o),l=Math.max(0,a-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:Nw.warn(`Bad animation path ${s}`)()}Rx(r[s].length===i[l].length);const c=e[l],u=e[a];switch(n){case"STEP":!function(t,e,n){for(let i=0;ic&&function(t,e,n,i,r){if("rotation"===e){kR.slerp({start:n,target:i,ratio:r});for(let n=0;nc&&function(t,e,{p0:n,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const i=e.name||`Animation-${n}`,r=e.samplers.map(({input:e,interpolation:n="LINEAR",output:i})=>({input:OR(t.accessors[e]),interpolation:n,output:OR(t.accessors[i])})),s=e.channels.map(({sampler:e,target:n})=>({sampler:r[e],target:t.nodes[n.node],path:n.path}));return new AR({name:i,channels:s})})}animate(t){this.setTime(t)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}class IR extends mR{constructor(t,e={}){super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof xO?(this.model=t,this._setModelNodeProps(e)):this.model=new xO(t,e),this.managedResources=e.managedResources||[]}setProps(t){return super.setProps(t),this._setModelNodeProps(t),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(t=>t.delete()),this.managedResources=[]}draw(...t){return this.model.draw(...t)}setUniforms(...t){return this.model.setUniforms(...t),this}setAttributes(...t){return this.model.setAttributes(...t),this}updateModuleSettings(...t){return this.model.updateModuleSettings(...t),this}_setModelNodeProps(t){this.model.setProps(t)}}class MR{constructor(t,{attributes:e,material:n,pbrDebug:i,imageBasedLightingEnvironment:r,lights:s,useTangents:o}){this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},CS(t,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],r&&(this.uniforms.u_DiffuseEnvSampler=r.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=r.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=r.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),i&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(e.NORMAL,"HAS_NORMALS"),this.defineIfPresent(e.TANGENT&&o,"HAS_TANGENTS"),this.defineIfPresent(e.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(r,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(i,"PBR_DEBUG"),n&&this.parseMaterial(n)}defineIfPresent(t,e){t&&(this.defines[e]=1)}parseTexture(t,e,n=null){const i=t.texture.source.image;let r,s={};i.compressed?(r=i,s={[this.gl.TEXTURE_MIN_FILTER]:i.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):r={data:i};const o=new lS(this.gl,bt({id:t.name||t.id,parameters:bt(bt({},t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{}),s),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},r));this.uniforms[e]=o,this.defineIfPresent(n,n),this.generatedTextures.push(o)}parsePbrMetallicRoughness(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:e=1,roughnessFactor:n=1}=t;this.uniforms.u_MetallicRoughnessValues=[e,n]}parseMaterial(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:e=1}=t.normalTexture;this.uniforms.u_NormalScale=e}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:e=1}=t.occlusionTexture;this.uniforms.u_OcclusionStrength=e}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){const{alphaCutoff:e=.5}=t;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=e}else"BLEND"===t.alphaMode&&(Nw.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function DR(t,e){return Fw(t)?`#version 300 es\n${e}`:e}const RR={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},NR={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class LR{constructor(t,e={}){this.gl=t,this.options=Object.assign({},NR,e)}instantiate(t){return this.gltf=t,(t.scenes||[]).map(t=>this.createScene(t))}createAnimator(){return Array.isArray(this.gltf.animations)?new PR(this.gltf):null}createScene(t){const e=(t.nodes||[]).map(t=>this.createNode(t));return new bR({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map(t=>this.createNode(t));t.mesh&&e.push(this.createMesh(t.mesh));const n=new bR({id:t.name||t.id,children:e});if(t.matrix)n.setMatrix(t.matrix);else{if(n.matrix.identity(),t.translation&&n.matrix.translate(t.translation),t.rotation){const e=(new bT).fromQuaternion(t.rotation);n.matrix.multiplyRight(e)}t.scale&&n.matrix.scale(t.scale)}t._node=n}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map((e,n)=>this.createPrimitive(e,n,t)),n=new bR({id:t.name||t.id,children:e});t._mesh=n}return t._mesh}getVertexCount(t){Nw.warn("getVertexCount() not found")()}createPrimitive(t,e,n){return function(t,e){const{id:n,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new MR(t,e);Nw.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(t=>t.buffer));const c=new IR(t,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[gR],defines:a.defines,parameters:a.parameters,vs:DR(t,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:DR(t,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:t.name||`${n.name||n.id}-primitive-${e}`,drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options))}createAttributes(t,e){const n={};return Object.keys(t).forEach(e=>{n[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))}),e&&(n.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),Nw.info(4,"glTF Attributes",{attributes:t,indices:e,generated:n})(),n}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:n}=t;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[e]||(n.lumaBuffers[e]=new tS(this.gl,{id:`from-${n.id}`,data:n.data||t.value,target:e})),n.lumaBuffers[e]}createAccessor(t,e){return new Kx({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:RR[t.type]})}createSampler(t){return t}needsPOT(){return!1}}function jR(t,e,n){if(t.byteLength<=e+n)return"";const i=new DataView(t);let r="";for(let s=0;se[t.name]);return new UR(n,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new UR(e,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof UR){const i=t;e=i.fields,n=HR(HR(new Map,this.metadata),i.metadata)}else e=t;const i=Object.create(null);for(const s of this.fields)i[s.name]=s;for(const s of e)i[s.name]=s;const r=Object.values(i);return new UR(r,n)}}function HR(t,e){return new Map([...t||new Map,...e||new Map])}let $R,GR,WR,qR,XR,YR,KR,QR;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}($R||($R={}));class ZR{static isNull(t){return t&&t.typeId===$R.Null}static isInt(t){return t&&t.typeId===$R.Int}static isFloat(t){return t&&t.typeId===$R.Float}static isBinary(t){return t&&t.typeId===$R.Binary}static isUtf8(t){return t&&t.typeId===$R.Utf8}static isBool(t){return t&&t.typeId===$R.Bool}static isDecimal(t){return t&&t.typeId===$R.Decimal}static isDate(t){return t&&t.typeId===$R.Date}static isTime(t){return t&&t.typeId===$R.Time}static isTimestamp(t){return t&&t.typeId===$R.Timestamp}static isInterval(t){return t&&t.typeId===$R.Interval}static isList(t){return t&&t.typeId===$R.List}static isStruct(t){return t&&t.typeId===$R.Struct}static isUnion(t){return t&&t.typeId===$R.Union}static isFixedSizeBinary(t){return t&&t.typeId===$R.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===$R.FixedSizeList}static isMap(t){return t&&t.typeId===$R.Map}static isDictionary(t){return t&&t.typeId===$R.Dictionary}get typeId(){return $R.NONE}compareTo(t){return this===t}}Symbol,Symbol,GR=Symbol.toStringTag;class JR extends ZR{constructor(t,e){super(),cA(this,"isSigned",void 0),cA(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return $R.Int}get[GR](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class tN extends JR{constructor(){super(!0,8)}}class eN extends JR{constructor(){super(!0,16)}}class nN extends JR{constructor(){super(!0,32)}}class iN extends JR{constructor(){super(!1,8)}}class rN extends JR{constructor(){super(!1,16)}}class sN extends JR{constructor(){super(!1,32)}}WR=Symbol.toStringTag;class oN extends ZR{constructor(t){super(),cA(this,"precision",void 0),this.precision=t}get typeId(){return $R.Float}get[WR](){return"Float"}toString(){return`Float${this.precision}`}}class aN extends oN{constructor(){super(32)}}class lN extends oN{constructor(){super(64)}}Symbol,Symbol,qR=Symbol.toStringTag,XR=Symbol.toStringTag,YR=Symbol.toStringTag,KR=Symbol.toStringTag,QR=Symbol.toStringTag;class cN extends ZR{constructor(t,e){super(),cA(this,"listSize",void 0),cA(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return $R.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[QR](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class uN{constructor(t,e,n=!1,i=new Map){cA(this,"name",void 0),cA(this,"type",void 0),cA(this,"nullable",void 0),cA(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=n,this.metadata=i}get typeId(){return this.type&&this.type.typeId}clone(){return new uN(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function hN(t,e,n){const i=n?dN(n.metadata):void 0,r=function(t){switch(t.constructor){case Int8Array:return new tN;case Uint8Array:return new iN;case Int16Array:return new eN;case Uint16Array:return new rN;case Int32Array:return new nN;case Uint32Array:return new sN;case Float32Array:return new aN;case Float64Array:return new lN;default:throw new Error("array type not supported")}}(e.value);return new uN(t,new cN(e.size,new uN("value",r)),!1,i)}function dN(t){const e=new Map;for(const n in t)e.set(`${n}.string`,JSON.stringify(t[n]));return e}const pN={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},fN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class gN{constructor(t){cA(this,"draco",void 0),cA(this,"decoder",void 0),cA(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){const n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const i=this.decoder.GetEncodedGeometryType(n),r=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(i){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(n,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(n,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e=`DRACO decompression failed: ${t.error_msg()}`;throw new Error(e)}const s=this._getDracoLoaderData(r,i,e),o=this._getMeshData(r,s,e),a=function(t){let e=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;cr?t:r,s=l>s?l:s,o=u>o?u:o}return[[e,n,i],[r,s,o]]}(o.attributes),l=function(t,e,n){const i=dN(e.metadata),r=[],s=function(t){const e={};for(const n in t){const i=t[n];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in t){const e=hN(o,t[o],s[o]);r.push(e)}if(n){const t=hN("indices",n);r.push(t)}return new UR(r,i)}(o.attributes,s,o.indices);return ti(bt({loader:"draco",loaderData:s,header:{vertexCount:r.num_points(),boundingBox:a}},o),{schema:l})}finally{this.draco.destroy(n),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,n){const i=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,n);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:r}}_getDracoAttributes(t,e){const n={};for(let i=0;ithis.decoder[t]).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map(t=>e.min_value(t))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:n=[]}=e,i=t.attribute_type();if(n.map(t=>this.decoder[t]).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}var mN=n(49125);const bN={};function yN(t){return vN.apply(this,arguments)}function vN(){return(vN=gS(function*(t,e=null,n={}){return e&&(t=_N(t,e,n)),bN[t]=bN[t]||wN(t),yield bN[t]})).apply(this,arguments)}function _N(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};return i[t]?i[t]:CA?n.CDN?(wA(n.CDN.startsWith("http")),`${n.CDN}/${e}@3.0.12/dist/libs/${t}`):OA?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}function wN(t){return xN.apply(this,arguments)}function xN(){return(xN=gS(function*(t){return t.endsWith("wasm")?yield(yield fetch(t)).arrayBuffer():CA?OA?importScripts(t):SN(yield(yield fetch(t)).text(),t):mN.requireFromFile&&(yield mN.requireFromFile(t))})).apply(this,arguments)}function SN(t,e){if(!CA)return mN.requireFromString&&mN.requireFromString(t,e);if(OA)return eval.call(EA,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(i){n.text=t}return document.body.appendChild(n),null}const EN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",CN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",ON="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let TN;function kN(t){return AN.apply(this,arguments)}function AN(){return(AN=gS(function*(t){const e=t.modules||{};return TN=e.draco3d?TN||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):TN||PN(t),yield TN})).apply(this,arguments)}function PN(t){return IN.apply(this,arguments)}function IN(){return(IN=gS(function*(t){let e,n;switch(t.draco&&t.draco.decoderType){case"js":e=yield yN(EN,"draco",t);break;case"wasm":default:[e,n]=yield Promise.all([yield yN(CN,"draco",t),yield yN(ON,"draco",t)])}return e=e||globalThis.DracoDecoderModule,yield MN(e,n)})).apply(this,arguments)}function MN(t,e){const n={};return e&&(n.wasmBinary=e),new Promise(e=>{t(ti(bt({},n),{onModuleLoaded:t=>e({draco:t})}))})}const DN=ti(bt({},zR),{parse:function(t,e){return RN.apply(this,arguments)}});function RN(){return(RN=gS(function*(t,e){const{draco:n}=yield kN(e),i=new gN(n);try{return i.parseSync(t,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function NN(t,e){return Nk(t>=0),Nk(e>0),t+(e-1)&~(e-1)}function LN(t,e,n){let i;return i=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer||t.arrayBuffer,t.byteOffset,t.byteLength),e.set(i,n),n+NN(i.byteLength,4)}const jN=["SCALAR","VEC2","VEC3","VEC4"],FN=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],BN=new Map(FN),VN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zN={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},UN={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function HN(t){return jN[t-1]||jN[0]}function $N(t){const e=BN.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function GN(t,e){const n=UN[t.componentType],i=VN[t.type],r=t.count*i,s=t.count*i*zN[t.componentType];return FR(s>=0&&s<=e.byteLength),{ArrayType:n,length:r,byteLength:s}}const WN={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class qN{constructor(t){cA(this,"gltf",void 0),cA(this,"sourceBuffers",void 0),cA(this,"byteLength",void 0),this.gltf=t||{json:bt({},WN),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){return this.getUsedExtensions().find(e=>e===t)?(this.json.extensions||{})[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(e=>e===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];if(!n)throw new Error(`glTF file error: Could not find ${t}[${e}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);const e=this.gltf.buffers[t.buffer];return FR(e),new Uint8Array(e.arrayBuffer,(t.byteOffset||0)+e.byteOffset,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,{ArrayType:i,length:r}=GN(t,e);return new i(n,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data;return new Uint8Array(n,e.byteOffset||0,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}setObjectExtension(t,e,n){(t.extensions||{})[e]=n}removeObjectExtension(t,e){const n=t.extensions||{},i=n[e];return delete n[e],i}addExtension(t,e={}){return FR(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return FR(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(e=>e===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(e=>e===t)||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:n}=t;this.json.nodes=this.json.nodes||[];const i={mesh:e};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:n,material:i,mode:r=4}=t,s={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(n){const t=this._addIndices(n);s.primitives[0].indices=t}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const n=YM(t),i=e||(null==n?void 0:n.mimeType),r={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;FR(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=NN(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(t,e){const n={bufferView:t,type:HN(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,e={size:3}){const n=this.addBufferView(t);let i={min:e.min,max:e.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:$N(t),count:Math.round(t.length/e.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,n={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const n=this.byteLength,i=new ArrayBuffer(n),r=new Uint8Array(i);let s=0;for(const o of this.sourceBuffers||[])s=LN(o,r,s);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}_removeStringFromArray(t,e){let n=!0;for(;n;){const i=t.indexOf(e);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){const e={};for(const n in t){const i=t[n],r=this._getGltfAttributeName(n),s=this.addBinaryBuffer(i.value,i);e[r]=s}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const n={min:null,max:null};if(t.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*lL(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}function cL(t){return uL.apply(this,arguments)}function uL(){return(uL=gS(function*(t){const e=new qN(t),{json:n}=e;e.removeExtension(QN);for(const i of n.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,QN)})).apply(this,arguments)}function hL(t){const e=new qN(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,QN,{}),e.addExtension(QN))}function dL(t){return pL.apply(this,arguments)}function pL(){return(pL=gS(function*(t){const e=new qN(t),{json:n}=e,i=e.getExtension(KN);i&&(e.json.lights=i.lights,e.removeExtension(KN));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,KN);t&&(r.light=t.light),e.removeObjectExtension(r,KN)}})).apply(this,arguments)}function fL(t){return gL.apply(this,arguments)}function gL(){return(gL=gS(function*(t){const e=new qN(t),{json:n}=e;if(n.lights){const t=e.addExtension(KN);FR(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights)e.addObjectExtension(t.node,KN,t);delete e.json.lights}})).apply(this,arguments)}function mL(t){return bL.apply(this,arguments)}function bL(){return(bL=gS(function*(t){const e=new qN(t),{json:n}=e,i=e.getExtension(ZN);if(i){const t=_L(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,ZN);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=wL(i.technique,e)),e.removeObjectExtension(i,ZN)}e.removeExtension(ZN)}})).apply(this,arguments)}function yL(t,e){return vL.apply(this,arguments)}function vL(){return(vL=gS(function*(t,e){})).apply(this,arguments)}function _L(t,e){const{programs:n=[],shaders:i=[],techniques:r=[]}=t,s=new TextDecoder;return i.forEach(t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=s.decode(e.getTypedArrayForBufferView(t.bufferView))}),n.forEach(t=>{t.fragmentShader=i[t.fragmentShader],t.vertexShader=i[t.vertexShader]}),r.forEach(t=>{t.program=n[t.program]}),r}function wL(t,e){const n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(e=>{t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)}),Object.keys(n).forEach(t=>{"object"==typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))}),n}const xL={KHR_draco_mesh_compression:i,KHR_materials_unlit:r,KHR_lights_punctual:s,KHR_techniques_webgl:o};function SL(t){return EL.apply(this,arguments)}function EL(){return(EL=gS(function*(t,e={},n){for(const r in xL){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield xL[r].decode(t,e,n))}})).apply(this,arguments)}const CL={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},OL={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class TL{constructor(t){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(t,e){this.json=t.json;const n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${n.asset.version}`)}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t){const e=new qN(t),{json:n}=e;for(const i of n.images||[]){const t=e.removeObjectExtension(i,XN);t&&Object.assign(i,t)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(XN)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in CL)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const n=t[e];if(n&&!Array.isArray(n)){t[e]=[];for(const i in n){const r=n[i];r.id=r.id||i;const s=t[e].length;t[e].push(r),this.idToIndexMap[e][i]=s}}}_convertObjectIdsToArrayIndices(t){for(const e in CL)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:n,material:i}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");n&&(e.indices=this._convertIdToIndex(n,"accessor")),i&&(e.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(t=>this._convertIdToIndex(t,"node"))),t.meshes&&(t.meshes=t.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(t,e){t[e]||(console.warn(`gltf v1: json doesn't contain attribute ${e}`),t[e]=[]);for(const n of t[e])for(const t in n){const e=this._convertIdToIndex(n[t],t);n[t]=e}}_convertIdToIndex(t,e){const n=OL[e];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${e} with id ${t}`);return i}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const e of t.materials){e.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const n=e.values&&e.values.tex,i=t.textures.findIndex(t=>t.id===n);-1!==i&&(e.pbrMetallicRoughness.baseColorTexture={index:i})}}}function kL(t,e={}){return(new TL).normalize(t,e)}const AL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},PL={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},IL={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},ML={magFilter:IL.TEXTURE_MAG_FILTER,minFilter:IL.TEXTURE_MIN_FILTER,wrapS:IL.TEXTURE_WRAP_S,wrapT:IL.TEXTURE_WRAP_T},DL={[IL.TEXTURE_MAG_FILTER]:IL.LINEAR,[IL.TEXTURE_MIN_FILTER]:IL.NEAREST_MIPMAP_LINEAR,[IL.TEXTURE_WRAP_S]:IL.REPEAT,[IL.TEXTURE_WRAP_]:IL.REPEAT};class RL{postProcess(t,e={}){const{json:n,buffers:i=[],images:r=[],baseUri:s=""}=t;return FR(n),this.baseUri=s,this.json=n,this.buffers=i,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t,e={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((t,e)=>this._resolveBufferView(t,e))),t.images&&(t.images=t.images.map((t,e)=>this._resolveImage(t,e))),t.samplers&&(t.samplers=t.samplers.map((t,e)=>this._resolveSampler(t,e))),t.textures&&(t.textures=t.textures.map((t,e)=>this._resolveTexture(t,e))),t.accessors&&(t.accessors=t.accessors.map((t,e)=>this._resolveAccessor(t,e))),t.materials&&(t.materials=t.materials.map((t,e)=>this._resolveMaterial(t,e))),t.meshes&&(t.meshes=t.meshes.map((t,e)=>this._resolveMesh(t,e))),t.nodes&&(t.nodes=t.nodes.map((t,e)=>this._resolveNode(t,e))),t.skins&&(t.skins=t.skins.map((t,e)=>this._resolveSkin(t,e))),t.scenes&&(t.scenes=t.scenes.map((t,e)=>this._resolveScene(t,e))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];return n||console.warn(`glTF file error: Could not find ${t}[${e}]`),n}_resolveScene(t,e){return t.id=t.id||`scene-${e}`,t.nodes=(t.nodes||[]).map(t=>this.getNode(t)),t}_resolveNode(t,e){return t.id=t.id||`node-${e}`,t.children&&(t.children=t.children.map(t=>this.getNode(t))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((t,e)=>{const n=this.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t},{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||`skin-${e}`,t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||`mesh-${e}`,t.primitives&&(t.primitives=t.primitives.map(t=>{const e=(t=bt({},t)).attributes;t.attributes={};for(const n in e)t.attributes[n]=this.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t})),t}_resolveMaterial(t,e){if(t.id=t.id||`material-${e}`,t.normalTexture&&(t.normalTexture=bt({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=bt({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=bt({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness=bt({},t.pbrMetallicRoughness);const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture=bt({},e.baseColorTexture),e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture=bt({},e.metallicRoughnessTexture),e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){if(t.id=t.id||`accessor-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=function(t){return PL[t]}(t.componentType),t.components=function(t){return AL[t]}(t.type),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:i}=GN(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset,s=e.arrayBuffer.slice(r,r+i);t.value=new n(s)}return t}_resolveTexture(t,e){return t.id=t.id||`texture-${e}`,t.sampler="sampler"in t?this.getSampler(t.sampler):DL,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||`sampler-${e}`,t.parameters={};for(const n in t){const e=this._enumSamplerParameter(n);void 0!==e&&(t.parameters[e]=t[n])}return t}_enumSamplerParameter(t){return ML[t]}_resolveImage(t,e){t.id=t.id||`image-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const n=this.images[e];return n&&(t.image=n),t}_resolveBufferView(t,e){t.id=t.id||`bufferView-${e}`;const n=t.buffer;t.buffer=this.buffers[n];let i=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(i+=t.byteOffset),t.data=new Uint8Array(this.buffers[n].arrayBuffer,i,t.byteLength),t}_resolveCamera(t,e){return t.id=t.id||`camera-${e}`,t}}function NL(t,e){return(new RL).postProcess(t,e)}const LL=1735152710,jL=!0;function FL(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),s=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(s),NN(i,4)}function BL(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),NN(i,4)}function VL(t,e){return zL.apply(this,arguments)}function zL(){return(zL=gS(function*(t,e,n=0,i,r){var s,o,a,l;UL(t,e,n,i),kL(t,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&t.json.buffers&&(yield HL(t,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const e=GL(t,i,r);c.push(e)}const u=SL(t,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?NL(t,i):t})).apply(this,arguments)}function UL(t,e,n,i){if(i.uri&&(t.baseUri=i.uri),e instanceof ArrayBuffer&&!function(t,e=0,n={}){const i=new DataView(t),{magic:r=LL}=n,s=i.getUint32(e,!1);return s===r||s===LL}(e,n,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)t.json=function(t){try{return JSON.parse(t)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(t,e=5){return"string"==typeof t?t.slice(0,e):ArrayBuffer.isView(t)?jR(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?jR(t,0,e):""}(t)}"`)}}(e);else if(e instanceof ArrayBuffer){const r={};n=function(t,e,n=0,i={}){const r=new DataView(e),s=function(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}(r,n+0),o=r.getUint32(n+4,jL),a=r.getUint32(n+8,jL);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),n+=12,t.version){case 1:return function(t,e,n){Nk(t.header.byteLength>20);const i=e.getUint32(n+0,jL),r=e.getUint32(n+4,jL);return n+=8,Nk(0===r),FL(t,e,n,i),(n+=i)+BL(t,e,n,t.header.byteLength)}(t,r,n);case 2:return function(t,e,n,i){return Nk(t.header.byteLength>20),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,jL),s=e.getUint32(n+4,jL);switch(n+=8,s){case 1313821514:FL(t,e,n,r);break;case 5130562:BL(t,e,n,r);break;case 0:i.strict||FL(t,e,n,r);break;case 1:i.strict||BL(t,e,n,r)}n+=NN(r,4)}}(t,e,n,{}),n+t.header.byteLength}(t,r,n);default:throw new Error(`Invalid GLB version ${t.version}. Only supports v1 and v2.`)}}(r,e,n,i.glb),FR("glTF"===r.type,`Invalid GLB magic string ${r.type}`),t._glb=r,t.json=r.json}else FR(!1,"GLTF: must be ArrayBuffer or string");if(t.buffers=new Array((t.json.buffers||[]).length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}t.images=new Array((t.json.images||[]).length).fill({})}function HL(t,e,n){return $L.apply(this,arguments)}function $L(){return($L=gS(function*(t,e,n){for(let s=0;s{t.traverse(t=>{Object.values(t.model.getUniforms()).forEach(t=>{!1===t.loaded&&e.push(t)})})}),yield ZL(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function ZL(t){return JL.apply(this,arguments)}function JL(){return(JL=gS(function*(t){for(;t();)yield new Promise(t=>requestAnimationFrame(t))})).apply(this,arguments)}const tj=[255,255,255,255],ej={scenegraph:{type:"object",value:null,async:!0},getScene:t=>t&&t.scenes?"object"==typeof t.scene?t.scene:t.scenes[t.scene||0]:t,getAnimator:t=>t&&t.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:tj},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[YL]};let nj=(()=>{class t extends LP{getShaders(){const t=[qD,eR];return"pbr"===this.props._lighting&&t.push(gR),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:tj,transition:!0},instanceModelMatrix:cR})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;e.scenegraph!==n.scenegraph?this._updateScenegraph(e):e._animations!==n._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:e}=this.context;let n=null;if(t.scenegraph instanceof mR)n={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const i=t.scenegraph,r=function(t,e,n){const i=new LR(t,n);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(e,i,this._getModelOptions());n=bt({gltf:i},r),function(t){return QL.apply(this,arguments)}(r).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Iw.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),n=t.scenegraph);const i={layer:this,gl:e},r=t.getScene(n,i),s=t.getAnimator(n,i);r instanceof mR?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,s,t._animations),this.setState({scenegraph:r,animator:s})):null!==r&&Iw.warn("invalid scenegraph:",r)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const e=this.getAttributeManager().getAttributes();t.traverse(t=>{this._setModelAttributes(t.model,e)})}}_applyAnimationsProp(t,e,n){if(!t||!e||!n)return;const i=e.getAnimations();Object.keys(n).sort().forEach(t=>{const e=n[t];if("*"===t)i.forEach(t=>{Object.assign(t,e)});else if(Number.isFinite(Number(t))){const n=Number(t);n>=0&&ne===t);n?Object.assign(n,e):Iw.warn("animation ".concat(t," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof mR&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let e=null;return t&&(e="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:e,modelOptions:bt({isInstanced:!0,transpileToGLSL100:!Fw(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(e=>{this._setModelAttributes(e.model,t)})}draw({moduleParameters:t=null,parameters:e={},context:n}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(n.timeline.getTime()),this.setNeedsRedraw());const{viewport:i}=this.context,{sizeScale:r,sizeMinPixels:s,sizeMaxPixels:o,opacity:a,coordinateSystem:l}=this.props,c=this.getNumInstances();this.state.scenegraph.traverse((n,{worldMatrix:u})=>{n.model.setInstanceCount(c),n.updateModuleSettings(t),n.draw({parameters:e,uniforms:{sizeScale:r,opacity:a,sizeMinPixels:s,sizeMaxPixels:o,composeModelMatrix:uR(i,l),sceneModelMatrix:u,u_Camera:n.model.getUniforms().project_uCameraPosition}})})}}return t.layerName="ScenegraphLayer",t.defaultProps=ej,t})();const ij=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),rj=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),sj=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),oj=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),aj={POSITION:{size:3,value:new Float32Array(rj)},NORMAL:{size:3,value:new Float32Array(sj)},TEXCOORD_0:{size:2,value:new Float32Array(oj)}};class lj extends iR{constructor(t={}){const{id:e=Fx("cube-geometry")}=t;super(ti(bt({},t),{id:e,indices:{size:1,value:new Uint16Array(ij)},attributes:bt(bt({},aj),t.attributes)}))}}class cj{constructor(t=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=t}identity(){const t=this.elements;t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1}setZero(){const t=this.elements;t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0}setTrace(t){const e=this.elements;e[0]=t.x,e[4]=t.y,e[8]=t.z}getTrace(t=new hj){const e=this.elements;return t.x=e[0],t.y=e[4],t.z=e[8],t}vmult(t,e=new hj){const n=this.elements,i=t.x,r=t.y,s=t.z;return e.x=n[0]*i+n[1]*r+n[2]*s,e.y=n[3]*i+n[4]*r+n[5]*s,e.z=n[6]*i+n[7]*r+n[8]*s,e}smult(t){for(let e=0;e0){const t=1/i;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return i}unit(t=new hj){const e=this.x,n=this.y,i=this.z;let r=Math.sqrt(e*e+n*n+i*i);return r>0?(r=1/r,t.x=e*r,t.y=n*r,t.z=i*r):(t.x=1,t.y=0,t.z=0),t}length(){const t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)}lengthSquared(){return this.dot(this)}distanceTo(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return Math.sqrt((r-e)*(r-e)+(s-n)*(s-n)+(o-i)*(o-i))}distanceSquared(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return(r-e)*(r-e)+(s-n)*(s-n)+(o-i)*(o-i)}scale(t,e=new hj){const n=this.y,i=this.z;return e.x=t*this.x,e.y=t*n,e.z=t*i,e}vmul(t,e=new hj){return e.x=t.x*this.x,e.y=t.y*this.y,e.z=t.z*this.z,e}addScaledVector(t,e,n=new hj){return n.x=this.x+t*e.x,n.y=this.y+t*e.y,n.z=this.z+t*e.z,n}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(t=new hj){return t.x=-this.x,t.y=-this.y,t.z=-this.z,t}tangents(t,e){const n=this.length();if(n>0){const i=dj,r=1/n;i.set(this.x*r,this.y*r,this.z*r);const s=pj;Math.abs(i.x)<.9?(s.set(1,0,0),i.cross(s,t)):(s.set(0,1,0),i.cross(s,t)),i.cross(t,e)}else t.set(1,0,0),e.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}lerp(t,e,n){const i=this.x,r=this.y,s=this.z;n.x=i+(t.x-i)*e,n.y=r+(t.y-r)*e,n.z=s+(t.z-s)*e}almostEquals(t,e=1e-6){return!(Math.abs(this.x-t.x)>e||Math.abs(this.y-t.y)>e||Math.abs(this.z-t.z)>e)}almostZero(t=1e-6){return!(Math.abs(this.x)>t||Math.abs(this.y)>t||Math.abs(this.z)>t)}isAntiparallelTo(t,e){return this.negate(fj),fj.almostEquals(t,e)}clone(){return new hj(this.x,this.y,this.z)}}hj.ZERO=void 0,hj.UNIT_X=void 0,hj.UNIT_Y=void 0,hj.UNIT_Z=void 0,hj.ZERO=new hj(0,0,0),hj.UNIT_X=new hj(1,0,0),hj.UNIT_Y=new hj(0,1,0),hj.UNIT_Z=new hj(0,0,1);const dj=new hj,pj=new hj,fj=new hj;class gj{constructor(t={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new hj,this.upperBound=new hj,t.lowerBound&&this.lowerBound.copy(t.lowerBound),t.upperBound&&this.upperBound.copy(t.upperBound)}setFromPoints(t,e,n,i){const r=this.lowerBound,s=this.upperBound,o=n;r.copy(t[0]),o&&o.vmult(r,r),s.copy(r);for(let a=1;as.x&&(s.x=e.x),e.xs.y&&(s.y=e.y),e.ys.z&&(s.z=e.z),e.z=r.x&&e.y<=i.y&&n.y>=r.y&&e.z<=i.z&&n.z>=r.z}getCorners(t,e,n,i,r,s,o,a){const l=this.lowerBound,c=this.upperBound;t.copy(l),e.set(c.x,l.y,l.z),n.set(c.x,c.y,l.z),i.set(l.x,c.y,c.z),r.set(c.x,l.y,c.z),s.set(l.x,c.y,l.z),o.set(l.x,l.y,c.z),a.copy(c)}toLocalFrame(t,e){const n=bj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(let i=0;8!==i;i++){const e=n[i];t.pointToLocal(e,e)}return e.setFromPoints(n)}toWorldFrame(t,e){const n=bj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(let i=0;8!==i;i++){const e=n[i];t.pointToWorld(e,e)}return e.setFromPoints(n)}overlapsRay(t){const{direction:e,from:n}=t,i=1/e.x,r=1/e.y,s=1/e.z,o=(this.lowerBound.x-n.x)*i,a=(this.upperBound.x-n.x)*i,l=(this.lowerBound.y-n.y)*r,c=(this.upperBound.y-n.y)*r,u=(this.lowerBound.z-n.z)*s,h=(this.upperBound.z-n.z)*s,d=Math.max(Math.max(Math.min(o,a),Math.min(l,c)),Math.min(u,h)),p=Math.min(Math.min(Math.max(o,a),Math.max(l,c)),Math.max(u,h));return!(p<0||d>p)}}const mj=new hj,bj=[new hj,new hj,new hj,new hj,new hj,new hj,new hj,new hj];class yj{constructor(t=0,e=0,n=0,i=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=t,this.y=e,this.z=n,this.w=i}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(t,e){const n=Math.sin(.5*e);return this.x=t.x*n,this.y=t.y*n,this.z=t.z*n,this.w=Math.cos(.5*e),this}toAxisAngle(t=new hj){this.normalize();const e=2*Math.acos(this.w),n=Math.sqrt(1-this.w*this.w);return n<.001?(t.x=this.x,t.y=this.y,t.z=this.z):(t.x=this.x/n,t.y=this.y/n,t.z=this.z/n),[t,e]}setFromVectors(t,e){if(t.isAntiparallelTo(e)){const e=vj;t.tangents(e,_j),this.setFromAxisAngle(e,Math.PI)}else{const n=t.cross(e);this.x=n.x,this.y=n.y,this.z=n.z,this.w=Math.sqrt(Nr(t.length(),2)*Nr(e.length(),2))+t.dot(e),this.normalize()}return this}mult(t,e=new yj){const n=this.x,i=this.y,r=this.z,s=this.w,o=t.x,a=t.y,l=t.z,c=t.w;return e.x=n*c+s*o+i*l-r*a,e.y=i*c+s*a+r*o-n*l,e.z=r*c+s*l+n*a-i*o,e.w=s*c-n*o-i*a-r*l,e}inverse(t=new yj){const e=this.x,n=this.y,i=this.z,r=this.w;this.conjugate(t);const s=1/(e*e+n*n+i*i+r*r);return t.x*=s,t.y*=s,t.z*=s,t.w*=s,t}conjugate(t=new yj){return t.x=-this.x,t.y=-this.y,t.z=-this.z,t.w=this.w,t}normalize(){let t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}normalizeFast(){const t=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}vmult(t,e=new hj){const n=t.x,i=t.y,r=t.z,s=this.x,o=this.y,a=this.z,l=this.w,c=l*n+o*r-a*i,u=l*i+a*n-s*r,h=l*r+s*i-o*n,d=-s*n-o*i-a*r;return e.x=c*l+d*-s+u*-a-h*-o,e.y=u*l+d*-o+h*-s-c*-a,e.z=h*l+d*-a+c*-o-u*-s,e}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}toEuler(t,e="YZX"){let n,i,r;const s=this.x,o=this.y,a=this.z,l=this.w;switch(e){case"YZX":const t=s*o+a*l;if(t>.499&&(n=2*Math.atan2(s,l),i=Math.PI/2,r=0),t<-.499&&(n=-2*Math.atan2(s,l),i=-Math.PI/2,r=0),void 0===n){const e=s*s,c=a*a;n=Math.atan2(2*o*l-2*s*a,1-o*o*2-2*c),i=Math.asin(2*t),r=Math.atan2(2*s*l-2*o*a,1-2*e-2*c)}break;default:throw new Error("Euler order "+e+" not supported yet.")}t.y=n,t.z=i,t.x=r}setFromEuler(t,e,n,i="XYZ"){const r=Math.cos(t/2),s=Math.cos(e/2),o=Math.cos(n/2),a=Math.sin(t/2),l=Math.sin(e/2),c=Math.sin(n/2);return"XYZ"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o-a*l*c):"YXZ"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o+a*l*c):"ZXY"===i?(this.x=a*s*o-r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o-a*l*c):"ZYX"===i?(this.x=a*s*o-r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o+a*l*c):"YZX"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o-a*l*c):"XZY"===i&&(this.x=a*s*o-r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o+a*l*c),this}clone(){return new yj(this.x,this.y,this.z,this.w)}slerp(t,e,n=new yj){const i=this.x,r=this.y,s=this.z,o=this.w;let a,l,c,u,h,d=t.x,p=t.y,f=t.z,g=t.w;return l=i*d+r*p+s*f+o*g,l<0&&(l=-l,d=-d,p=-p,f=-f,g=-g),1-l>1e-6?(a=Math.acos(l),c=Math.sin(a),u=Math.sin((1-e)*a)/c,h=Math.sin(e*a)/c):(u=1-e,h=e),n.x=u*i+h*d,n.y=u*r+h*p,n.z=u*s+h*f,n.w=u*o+h*g,n}integrate(t,e,n,i=new yj){const r=t.x*n.x,s=t.y*n.y,o=t.z*n.z,a=this.x,l=this.y,c=this.z,u=this.w,h=.5*e;return i.x+=h*(r*u+s*c-o*l),i.y+=h*(s*u+o*a-r*c),i.z+=h*(o*u+r*l-s*a),i.w+=h*(-r*a-s*l-o*c),i}}const vj=new hj,_j=new hj,wj={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let xj=(()=>{class t{constructor(e={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=t.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=!e.collisionResponse||e.collisionResponse,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:1,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,e){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,e,n,i){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return t.idCounter=0,t.types=wj,t})();class Sj{constructor(t={}){this.position=void 0,this.quaternion=void 0,this.position=new hj,this.quaternion=new yj,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}pointToLocal(t,e){return Sj.pointToLocalFrame(this.position,this.quaternion,t,e)}pointToWorld(t,e){return Sj.pointToWorldFrame(this.position,this.quaternion,t,e)}vectorToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e}static pointToLocalFrame(t,e,n,i=new hj){return n.vsub(t,i),e.conjugate(Ej),Ej.vmult(i,i),i}static pointToWorldFrame(t,e,n,i=new hj){return e.vmult(n,i),i.vadd(t,i),i}static vectorToWorldFrame(t,e,n=new hj){return t.vmult(e,n),n}static vectorToLocalFrame(t,e,n,i=new hj){return e.w*=-1,e.vmult(n,i),e.w*=-1,i}}const Ej=new yj;class Cj extends xj{constructor(t={}){const{vertices:e=[],faces:n=[],normals:i=[],axes:r,boundingSphereRadius:s}=t;super({type:xj.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=e,this.faces=n,this.faceNormals=i,0===this.faceNormals.length&&this.computeNormals(),s?this.boundingSphereRadius=s:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=r?r.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const t=this.faces,e=this.vertices,n=this.uniqueEdges;n.length=0;const i=new hj;for(let r=0;r!==t.length;r++){const s=t[r],o=s.length;for(let t=0;t!==o;t++){e[s[t]].vsub(e[s[(t+1)%o]],i),i.normalize();let r=!1;for(let t=0;t!==n.length;t++)if(n[t].almostEquals(i)||n[t].almostEquals(i)){r=!0;break}r||n.push(i.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let t=0;th&&(h=t,u=p)}const d=[];for(let p=0;p=0&&this.clipFaceAgainstHull(s,t,e,d,o,a,l)}findSeparatingAxis(t,e,n,i,r,s,o,a){const l=new hj,c=new hj,u=new hj,h=new hj,d=new hj,p=new hj;let f=Number.MAX_VALUE;const g=this;if(g.uniqueAxes)for(let m=0;m!==g.uniqueAxes.length;m++){n.vmult(g.uniqueAxes[m],l);const o=g.testSepAxis(l,t,e,n,i,r);if(!1===o)return!1;o0&&s.negate(s),!0}testSepAxis(t,e,n,i,r,s){Cj.project(this,t,n,i,Oj),Cj.project(e,t,r,s,Tj);const o=Oj[0],a=Oj[1],l=Tj[0],c=Tj[1];if(o0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?Dj.STATIC:Dj.DYNAMIC,typeof t.type==typeof Dj.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=Dj.AWAKE,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new hj,this.quaternion=new yj,this.initQuaternion=new yj,this.previousQuaternion=new yj,this.interpolatedQuaternion=new yj,t.quaternion&&(this.quaternion.copy(t.quaternion),this.initQuaternion.copy(t.quaternion),this.previousQuaternion.copy(t.quaternion),this.interpolatedQuaternion.copy(t.quaternion)),this.angularVelocity=new hj,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new hj,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new hj,this.invInertia=new hj,this.invInertiaWorld=new cj,this.invMassSolve=0,this.invInertiaSolve=new hj,this.invInertiaWorldSolve=new cj,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new hj(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new hj(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new gj,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new hj,this.isTrigger=Boolean(t.isTrigger),t.shape&&this.addShape(t.shape),this.updateMassProperties()}wakeUp(){const t=this.sleepState;this.sleepState=Dj.AWAKE,this.wakeUpAfterNarrowphase=!1,t===Dj.SLEEPING&&this.dispatchEvent(Dj.wakeupEvent)}sleep(){this.sleepState=Dj.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(t){if(this.allowSleep){const e=this.sleepState,n=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),i=Nr(this.sleepSpeedLimit,2);e===Dj.AWAKE&&ni?this.wakeUp():e===Dj.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(Dj.sleepEvent))}}updateSolveMassProperties(){this.sleepState===Dj.SLEEPING||this.type===Dj.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(t,e=new hj){return t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e}vectorToLocalFrame(t,e=new hj){return this.quaternion.conjugate().vmult(t,e),e}pointToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e.vadd(this.position,e),e}vectorToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e}addShape(t,e,n){const i=new hj,r=new yj;return e&&i.copy(e),n&&r.copy(n),this.shapes.push(t),this.shapeOffsets.push(i),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=this,this}removeShape(t){const e=this.shapes.indexOf(t);return-1===e?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(e,1),this.shapeOffsets.splice(e,1),this.shapeOrientations.splice(e,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=null,this)}updateBoundingRadius(){const t=this.shapes,e=this.shapeOffsets,n=t.length;let i=0;for(let r=0;r!==n;r++){const n=t[r];n.updateBoundingSphereRadius();const s=e[r].length(),o=n.boundingSphereRadius;s+o>i&&(i=s+o)}this.boundingRadius=i}updateAABB(){const t=this.shapes,e=this.shapeOffsets,n=this.shapeOrientations,i=t.length,r=Rj,s=Nj,o=this.quaternion,a=this.aabb,l=Lj;for(let c=0;c!==i;c++){const i=t[c];o.vmult(e[c],r),r.vadd(this.position,r),o.mult(n[c],s),i.calculateWorldAABB(r,s,l.lowerBound,l.upperBound),0===c?a.copy(l):a.extend(l)}this.aabbNeedsUpdate=!1}updateInertiaWorld(t){const e=this.invInertia;if(e.x!==e.y||e.y!==e.z||t){const t=jj,n=Fj;t.setRotationFromQuaternion(this.quaternion),t.transpose(n),t.scale(e,t),t.mmult(n,this.invInertiaWorld)}}applyForce(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;this.sleepState===Dj.SLEEPING&&this.wakeUp();const n=Bj;e.cross(t,n),this.force.vadd(t,this.force),this.torque.vadd(n,this.torque)}applyLocalForce(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;const n=Vj,i=zj;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyForce(n,i)}applyTorque(t){this.type===Dj.DYNAMIC&&(this.sleepState===Dj.SLEEPING&&this.wakeUp(),this.torque.vadd(t,this.torque))}applyImpulse(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;this.sleepState===Dj.SLEEPING&&this.wakeUp();const n=e,i=Uj;i.copy(t),i.scale(this.invMass,i),this.velocity.vadd(i,this.velocity);const r=Hj;n.cross(t,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;const n=$j,i=Gj;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyImpulse(n,i)}updateMassProperties(){const t=Wj;this.invMass=this.mass>0?1/this.mass:0;const e=this.inertia,n=this.fixedRotation;this.updateAABB(),t.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),Pj.calculateInertia(t,this.mass,e),this.invInertia.set(e.x>0&&!n?1/e.x:0,e.y>0&&!n?1/e.y:0,e.z>0&&!n?1/e.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(t,e){const n=new hj;return t.vsub(this.position,n),this.angularVelocity.cross(n,e),this.velocity.vadd(e,e),e}integrate(t,e,n){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==Dj.DYNAMIC&&this.type!==Dj.KINEMATIC||this.sleepState===Dj.SLEEPING)return;const i=this.velocity,r=this.angularVelocity,s=this.position,o=this.force,a=this.torque,l=this.quaternion,c=this.invInertiaWorld,u=this.linearFactor,h=this.invMass*t;i.x+=o.x*h*u.x,i.y+=o.y*h*u.y,i.z+=o.z*h*u.z;const d=c.elements,p=this.angularFactor,f=a.x*p.x,g=a.y*p.y,m=a.z*p.z;r.x+=t*(d[0]*f+d[1]*g+d[2]*m),r.y+=t*(d[3]*f+d[4]*g+d[5]*m),r.z+=t*(d[6]*f+d[7]*g+d[8]*m),s.x+=i.x*t,s.y+=i.y*t,s.z+=i.z*t,l.integrate(this.angularVelocity,t,this.angularFactor,l),e&&(n?l.normalizeFast():l.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}Dj.idCounter=0,Dj.COLLIDE_EVENT_NAME="collide",Dj.DYNAMIC=1,Dj.STATIC=2,Dj.KINEMATIC=4,Dj.AWAKE=0,Dj.SLEEPY=1,Dj.SLEEPING=2,Dj.wakeupEvent={type:"wakeup"},Dj.sleepyEvent={type:"sleepy"},Dj.sleepEvent={type:"sleep"};const Rj=new hj,Nj=new yj,Lj=new gj,jj=new cj,Fj=new cj,Bj=new hj,Vj=new hj,zj=new hj,Uj=new hj,Hj=new hj,$j=new hj,Gj=new hj,Wj=new hj;new hj,new hj;class qj{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new hj,this.rayToWorld=new hj,this.hitNormalWorld=new hj,this.hitPointWorld=new hj,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(t,e,n,i,r,s,o){this.rayFromWorld.copy(t),this.rayToWorld.copy(e),this.hitNormalWorld.copy(n),this.hitPointWorld.copy(i),this.shape=r,this.body=s,this.distance=o}}let Xj,Yj,Kj,Qj,Zj,Jj,tF;Xj=xj.types.SPHERE,Yj=xj.types.PLANE,Kj=xj.types.BOX,Qj=xj.types.CYLINDER,Zj=xj.types.CONVEXPOLYHEDRON,Jj=xj.types.HEIGHTFIELD,tF=xj.types.TRIMESH;class eF{get[Xj](){return this._intersectSphere}get[Yj](){return this._intersectPlane}get[Kj](){return this._intersectBox}get[Qj](){return this._intersectConvex}get[Zj](){return this._intersectConvex}get[Jj](){return this._intersectHeightfield}get[tF](){return this._intersectTrimesh}constructor(t=new hj,e=new hj){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=t.clone(),this.to=e.clone(),this.direction=new hj,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=eF.ANY,this.result=new qj,this.hasHit=!1,this.callback=t=>{}}intersectWorld(t,e){return this.mode=e.mode||eF.ANY,this.result=e.result||new qj,this.skipBackfaces=!!e.skipBackfaces,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===e.checkCollisionResponse||e.checkCollisionResponse,e.from&&this.from.copy(e.from),e.to&&this.to.copy(e.to),this.callback=e.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(nF),iF.length=0,t.broadphase.aabbQuery(t,nF,iF),this.intersectBodies(iF),this.hasHit}intersectBody(t,e){e&&(this.result=e,this.updateDirection());const n=this.checkCollisionResponse;if(n&&!t.collisionResponse||0==(this.collisionFilterGroup&t.collisionFilterMask)||0==(t.collisionFilterGroup&this.collisionFilterMask))return;const i=oF,r=aF;for(let s=0,o=t.shapes.length;st.boundingSphereRadius)return;const r=this[t.type];r&&r.call(this,t,e,n,i,t)}_intersectBox(t,e,n,i,r){return this._intersectConvex(t.convexPolyhedronRepresentation,e,n,i,r)}_intersectPlane(t,e,n,i,r){const s=this.from,o=this.to,a=this.direction,l=new hj(0,0,1);e.vmult(l,l);const c=new hj;s.vsub(n,c);const u=c.dot(l);if(o.vsub(n,c),u*c.dot(l)>0||s.distanceTo(o)=0&&t<=1&&(s.lerp(o,t,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1)),this.result.shouldStop)return;e>=0&&e<=1&&(s.lerp(o,e,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1))}}_intersectConvex(t,e,n,i,r,s){const o=yF,a=vF,l=s&&s.faceList||null,c=t.faces,u=t.vertices,h=t.faceNormals,d=this.direction,p=this.from,f=p.distanceTo(this.to),g=l?l.length:c.length,m=this.result;for(let b=0;!m.shouldStop&&bf||this.reportIntersection(o,lF,r,i,t)}}}}_intersectTrimesh(t,e,n,i,r,s){const o=_F,a=OF,l=TF,c=vF,u=wF,h=xF,d=SF,p=CF,f=EF,g=t.indices,m=this.from,b=this.to,y=this.direction;l.position.copy(n),l.quaternion.copy(e),Sj.vectorToLocalFrame(n,e,y,u),Sj.pointToLocalFrame(n,e,m,h),Sj.pointToLocalFrame(n,e,b,d),d.x*=t.scale.x,d.y*=t.scale.y,d.z*=t.scale.z,h.x*=t.scale.x,h.y*=t.scale.y,h.z*=t.scale.z,d.vsub(h,u),u.normalize();const v=h.distanceSquared(d);t.tree.rayQuery(this,l,a);for(let _=0,w=a.length;!this.result.shouldStop&&_!==w;_++){const s=a[_];t.getNormal(s,o),t.getVertex(g[3*s],cF),cF.vsub(h,c);const l=u.dot(o),d=o.dot(c)/l;if(d<0)continue;u.scale(d,lF),lF.vadd(h,lF),t.getVertex(g[3*s+1],uF),t.getVertex(g[3*s+2],hF);const m=lF.distanceSquared(h);!eF.pointInTriangle(lF,uF,cF,hF)&&!eF.pointInTriangle(lF,cF,uF,hF)||m>v||(Sj.vectorToWorldFrame(e,o,f),Sj.pointToWorldFrame(n,e,lF,p),this.reportIntersection(f,p,r,i,s))}a.length=0}reportIntersection(t,e,n,i,r){const s=this.from,o=this.to,a=s.distanceTo(e),l=this.result;if(!(this.skipBackfaces&&t.dot(this.direction)>0))switch(l.hitFaceIndex=void 0!==r?r:-1,this.mode){case eF.ALL:this.hasHit=!0,l.set(s,o,t,e,n,i,a),l.hasHit=!0,this.callback(l);break;case eF.CLOSEST:(a=0&&(u=r*l-s*o)>=0&&c+uDate.now()-t}var iB=n(24517);function rB(t,e,n){e||(e=new bT(bT.IDENTITY));const i=new bT(bT.IDENTITY);if(t.matrix)i.copy(t.matrix);else{if(i.identity(),t.translation&&i.translate(t.translation),t.rotation){const e=new bT(bT.IDENTITY).fromQuaternion(t.rotation);i.multiplyRight(e)}t.scale&&i.scale(t.scale)}const r=new bT(e).multiplyRight(i);if(!1===n(t,r,e))return!1;for(const s of t.nodes||t.children||[])if(!1===rB(s,r,n))return!1;return!0}function sB(){fP([zR,YL])}function oB(t,e){const n=e.nodes.find(e=>e.name===t);if(n){let i=!1;for(const t of e.scenes)i||rB(t,new bT(bT.IDENTITY),(t,e)=>t!==n||(t.matrix=e,t.translation=void 0,t.rotation=void 0,t.scale=void 0,i=!0,!1));return e.scene={id:t,name:t,nodes:[n]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function aB(t,e){return lw(this,void 0,void 0,function*(){const n=t.scenegraph;let i;i=e?e[n]||(e[n]=fetch(n).then(t=>t.blob())):fetch(n);const r=yield CP(i,YL,{DracoLoader:DN,gltf:{decompressMeshes:!0,postProcess:!0}});return oB(t.scenegraphNode,r)})}function lB(t,e){return lw(this,void 0,void 0,function*(){return oB(t,yield e)})}function cB(t,e,n){if(e&&0!==e.length)return new fR(Object.assign({id:t,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mw.CARTESIAN,data:e,mesh:new lj,wireframe:!1,getTransformMatrix:t=>t.transformMatrix,getColor:t=>t.color||[255,255,255,229.5]},n))}let uB=(()=>{class t extends jP{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),sB()}renderLayers(){const e=this.state,n=e.data.filter(t=>!t.scenegraph&&!t.wireframe&&t.unpickable),i=e.data.filter(t=>!t.scenegraph&&!t.wireframe&&!t.unpickable),r=e.data.filter(t=>!t.scenegraph&&t.wireframe),s=e.data.filter(t=>!!t.scenegraph);e.doCollisions&&function(t){lw(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=t.filter(t=>!t.scenegraph&&!t.wireframe).map(t=>{const e=new bT(t.transformMatrix),n=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return{"@id":t["@id"],name:t.tooltip,entityId:t.entityId,bbox:new gj({lowerBound:new hj(...n.map((t,e)=>Math.min(t,i[e]))),upperBound:new hj(...i.map((t,e)=>Math.max(t,n[e])))})}}),n=[];for(const o of t.filter(t=>!!t.scenegraph)){const t=yield AP(o.scenegraph,YL,{DracoLoader:DN,decompress:!0,postProcess:!0});for(const e of t.scenes)rB(e,new bT(o.transformMatrix),(e,i)=>{if(e.mesh&&e.mesh.primitives&&e.mesh.primitives.length>0)for(const r of e.mesh.primitives)if(r.attributes.POSITION&&r.attributes.POSITION.min){const s=i.transformAsPoint(r.attributes.POSITION.min,[]),a=i.transformAsPoint(r.attributes.POSITION.max,[]);n.push({"@id":o["@id"],name:e.name,entityId:o.entityId,bbox:new gj({lowerBound:new hj(...s.map((t,e)=>Math.min(t,a[e]))),upperBound:new hj(...a.map((t,e)=>Math.max(t,s[e])))}),gltf:t})}return!0})}const i=[],r=[];for(const t of e){const e=[];for(const i of n)t.bbox.overlaps(i.bbox)&&e.push({"@id":i["@id"],name:i.name});e.length>0?i.push({"@id":t.entityId,name:t.name,hits:e}):r.push(t)}console.log({sourceBoxes:e,targetBoxes:n,report:i,sad:r,maxHits:Math.max(...i.map(t=>t.hits.length))});const s=[];for(const t of i){s.push({"Tissue ID":t["@id"],"Tissue Name":t.name,"Hit ID":"","Hit Name":""});for(const e of t.hits)s.push({"Tissue ID":t["@id"],"Tissue Name":t.name,"Hit ID":e["@id"],"Hit Name":e.name})}return console.log(s),i})}(e.data);const o={};for(const a of s)a.scenegraph&&a.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,a.scenegraph)&&(o[a.scenegraph]=aB({scenegraph:a.scenegraph},t.gltfCache));return[cB("cubes",n,{wireframe:!1,pickable:!1}),cB("pickableCubes",i,{wireframe:!1,pickable:!0}),cB("wireframes",r,{wireframe:!0,pickable:!1}),...s.map(t=>{var n;return new nj({id:"models-"+t["@id"],opacity:t.zoomBasedOpacity?e.zoomOpacity:void 0!==t.opacity?t.opacity:1,pickable:!t.unpickable,coordinateSystem:Mw.CARTESIAN,data:[t],scenegraph:t.scenegraphNode?lB(t.scenegraphNode,o[t.scenegraph]):t.scenegraph,_lighting:t._lighting,getTransformMatrix:t.transformMatrix,getColor:null!==(n=t.color)&&void 0!==n?n:[0,255,0,127.5],parameters:{depthMask:!t.zoomBasedOpacity&&(void 0===t.opacity||1===t.opacity)}})})].filter(t=>!!t)}getPickingInfo(t){return t.info}}return t.layerName="BodyUILayer",t.gltfCache={},t})();function hB(t,e=[]){for(const n of t.nodes||t.children||[])e.push(n.name),hB(n,e);return e}let dB=(()=>{class t{constructor(t){var e,n,i,r,s;this.deckProps=t,this.bodyUILayer=new uB({}),this.nodeClickSubject=new P,this.nodeHoverStartSubject=new P,this.nodeHoverStopSubject=new P,this.sceneRotationSubject=new Uf([0,0]),this.nodeDragStartSubject=new P,this.nodeDragSubject=new P,this.nodeDragEndSubject=new P,this.nodeClick$=this.nodeClickSubject.pipe(at()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(at()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(at()),this.sceneRotation$=this.sceneRotationSubject.pipe(at()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(at()),this.nodeDrag$=this.nodeDragSubject.pipe(at()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(at());const o=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new pI({flipY:!1,near:-1e3}):new bI({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:t=>{var e;return null!==(e=this.cursor)&&void 0!==e?e:t.isDragging?"grabbing":"grab"}});t.legacyLighting&&(o.effects=[new $I({ambientLight:new wI({color:[255,255,255],intensity:10})})]),this.deck=new WD(o),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(e=t.minRotationX)&&void 0!==e?e:-15,maxRotationX:null!==(n=t.maxRotationX)&&void 0!==n?n:15,target:null!==(i=t.target)&&void 0!==i?i:[.5,.5,0],rotationX:0,rotationOrbit:null!==(r=t.rotation)&&void 0!==r?r:0,zoom:null!==(s=t.zoom)&&void 0!==s?s:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return lw(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let e=this.bodyUILayer.state.zoomOpacity,n=!1;for(const i of t)i.zoomToOnLoad&&(this.zoomTo(i),n=!0);e=n?.05:e,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,e):this.bodyUILayer.setState({data:t,zoomOpacity:e})}}debugSceneNodeProcessing(t,e){const n="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",i=new bT([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(t,e,n){return lw(this,void 0,void 0,function*(){sB();const n=yield aB({scenegraph:t,scenegraphNode:"VHF_Kidney_L_Low1"}),i={},r=[];for(const s of n.scenes)rB(s,e=new bT(e||bT.IDENTITY),(n,s)=>{const o={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new bT(s),wireframe:!0,node:n};if(r.push({"@id":`GLTF:${o["@id"]}`,"@type":"GLTFNode",scenegraph:t,scenegraphNode:o["@id"],transformMatrix:new bT(e||bT.IDENTITY),tooltip:n.name||n.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:n}),n.mesh&&n.mesh.primitives&&n.mesh.primitives.length>0)for(const t of n.mesh.primitives)if(t.attributes.POSITION&&t.attributes.POSITION.min){const e=s.transformAsPoint(t.attributes.POSITION.min,[]),n=s.transformAsPoint(t.attributes.POSITION.max,[]);o.bbox=new gj({lowerBound:new hj(...e.map((t,e)=>Math.min(t,n[e]))),upperBound:new hj(...n.map((t,n)=>Math.max(t,e[n])))})}return i[o["@id"]]=o,!0});for(const t of Object.values(i).filter(t=>!t.bbox)){for(const e of hB(t.node).map(t=>i[t]).filter(t=>t.bbox))t.bbox?t.bbox.extend(e.bbox):t.bbox=e.bbox.clone();t.bbox||delete i[t["@id"]]}for(const t of Object.values(i)){const e=t.bbox.lowerBound,n=(t.size=t.bbox.upperBound.clone().vsub(e)).clone().vmul(new hj(.5,.5,.5)),i=t.center=e.clone().vadd(n);t.transformMatrix=new bT(bT.IDENTITY).translate(i.toArray()).scale(n.toArray())}for(const t of r)i[t["@id"]]=t;return i})})(n,i).then(r=>{console.log("results",r),console.log("data",t),(t=t.concat(Object.values(r))).push({"@id":"TEST","@type":"TEST",scenegraph:n,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:i,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:e})})}zoomTo(t){const e=new bT(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:e.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:e}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?e!==t.object&&(e&&this.nodeHoverStopSubject.next(e),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):e&&(this.nodeHoverStopSubject.next(e),this.lastHovered=void 0)}_onClick(t,e){var n,i;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(i=null===(n=null==e?void 0:e.srcEvent)||void 0===n?void 0:n.ctrlKey)&&void 0!==i?i:void 0})}_onViewStateChange(t){var e;if(null===(e=t.interactionState)||void 0===e?void 0:e.isZooming){const e=this.bodyUILayer.state,n=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);e.zoomOpacity!==n&&this.bodyUILayer.setState({data:e.data,zoomOpacity:n})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,e){this._dragEvent(t,e,this.nodeDragStartSubject)}_onDrag(t,e){this._dragEvent(t,e,this.nodeDragSubject)}_onDragEnd(t,e){this._dragEvent(t,e,this.nodeDragEndSubject)}_dragEvent(t,e,n){var i;(null===(i=null==t?void 0:t.object)||void 0===i?void 0:i["@id"])&&n.next({node:t.object,info:t,e})}}return sw([iB.ZP],t.prototype,"_onHover",null),sw([iB.ZP],t.prototype,"_onClick",null),sw([iB.ZP],t.prototype,"_onViewStateChange",null),sw([iB.ZP],t.prototype,"_onDragStart",null),sw([iB.ZP],t.prototype,"_onDrag",null),sw([iB.ZP],t.prototype,"_onDragEnd",null),t})();function pB(t,e){return t===e}function fB(t,e,n){if(null===e||null===n||e.length!==n.length)return!1;const i=e.length;for(let r=0;r(t&&t.providers||[]).some(t=>t&&t.provide&&"MockNgModuleResolver"===t.provide.name||!1))});let bB=(()=>{class t{constructor(){this.bootstrap$=new lp(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const yB=new oi("INITIAL_STATE_TOKEN");let vB=(()=>{class t{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return t.value={},t})();const _B=new oi("Internals.StateContextFactory"),wB=new oi("Internals.StateFactory");function xB(t,e){return e?n=>n.pipe(xB((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new SB(t))}class SB{constructor(t){this.project=t}call(t,e){return e.subscribe(new EB(t,this.project))}}class EB extends ${constructor(t,e){super(t),this.project=e,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(t){this.hasSubscription||this.tryNext(t)}tryNext(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this.hasSubscription=!0,this._innerSub(e)}_innerSub(t){const e=new H(this),n=this.destination;n.add(e);const i=G(t,e);i!==e&&n.add(i)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function CB(t=null){return e=>e.lift(new OB(t))}class OB{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new TB(t,this.defaultValue))}}class TB extends v{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}const kB={STATE_NAME:t=>`${t} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(t,e,n)=>`State name '${t}' from ${e} already exists in ${n}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:t=>`'${t}' class should be decorated with @Injectable() right after the @State() decorator`};let AB=(()=>{class t{constructor(t,e){this._ngZone=t,this._platformId=e,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(t){return"server"===t}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return xu.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return xu.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof xu||console.warn(kB.ZONE_WARNING())}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(ou))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const PB=new oi("ROOT_STATE_TOKEN"),IB=new oi("FEATURE_STATE_TOKEN"),MB=new oi("NGXS_PLUGINS"),DB=new oi("NG_TEST_MODE"),RB=new oi("NG_DEV_MODE"),NB="NGXS_META",LB="NGXS_OPTIONS_META";let jB=(()=>{class t{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=AB}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class FB{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}}const BB=new oi("NGXS_EXECUTION_STRATEGY");function VB(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}const zB=(t,e,n)=>{t=Object.assign({},t);const i=e.split("."),r=i.length-1;return i.reduce((t,e,i)=>(t[e]=i===r?n:Array.isArray(t[e])?t[e].slice():Object.assign({},t[e]),t&&t[e]),t),t},UB=(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t),HB=t=>t&&"object"==typeof t&&!Array.isArray(t),$B=(t,...e)=>{if(!e.length)return t;const n=e.shift();if(HB(t)&&HB(n))for(const i in n)HB(n[i])?(t[i]||Object.assign(t,{[i]:{}}),$B(t[i],n[i])):Object.assign(t,{[i]:n[i]});return $B(t,...e)};function GB(t){return t[NB]}function WB(t,e){const n=UB(e.currentAppState,t.path),i=UB(e.newAppState,t.path);return new FB(n,i,!t.isInitialised)}function qB(...t){return function(t,e,n=XB){const i=function(t){return t.reduce((t,e)=>(t[VB(e)]=!0,t),{})}(t),r=e&&function(t){return t.reduce((t,e)=>(t[e]=!0,t),{})}(e);return function(t){return t.pipe(function(t,e){return Hd(n=>{const i=VB(n.action);return t[i]&&(!e||e[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function XB(){return D(t=>t.action)}function YB(t){return e=>new C(n=>e.subscribe({next(e){t.leave(()=>n.next(e))},error(e){t.leave(()=>n.error(e))},complete(){t.leave(()=>n.complete())}}))}let KB=(()=>{class t{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(BB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class QB extends P{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(t){if(this._busyPushingNext)this._itemQueue.unshift(t);else{for(this._busyPushingNext=!0,super.next(t);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let ZB=(()=>{class t extends QB{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),JB=(()=>{class t extends C{constructor(t,e){super(n=>{const i=t.pipe(YB(e)).subscribe({next:t=>n.next(t),error:t=>n.error(t),complete:()=>n.complete()});n.add(i)})}}return t.\u0275fac=function(e){return new(e||t)(Ci(ZB),Ci(KB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const tV=t=>(...e)=>t.shift()(...e,(...e)=>tV(t)(...e));let eV=(()=>{class t extends Uf{constructor(){super({})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),nV=(()=>{class t{constructor(t,e){this._parentManager=t,this._pluginHandlers=e,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(t=>t.handle?t.handle.bind(t):t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12),Ci(MB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),iV=(()=>{class t extends P{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),rV=(()=>{class t{constructor(t,e,n,i,r,s){this._injector=t,this._actions=e,this._actionResults=n,this._pluginManager=i,this._stateStream=r,this._ngxsExecutionStrategy=s}dispatch(t){const e=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return e.subscribe({error:t=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(kr),this._errorHandler.handleError(t)}catch(e){}})}),e.pipe(YB(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?wd(this._stateStream.getValue()):hv(t.map(t=>this.dispatchSingle(t))):this.dispatchSingle(t)}dispatchSingle(t){if(!VB(t))return ip(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const e=this._stateStream.getValue();return tV([...this._pluginManager.plugins,(t,n)=>{t!==e&&this._stateStream.next(t);const i=this.getActionResultStream(n);return i.subscribe(t=>this._actions.next(t)),this._actions.next({action:n,status:"DISPATCHED"}),this.createDispatchObservable(i)}])(e,t).pipe(up())}getActionResultStream(t){return this._actionResults.pipe(Hd(e=>e.action===t&&"DISPATCHED"!==e.status),Gp(1),up())}createDispatchObservable(t){return t.pipe(xB(t=>{switch(t.status){case"SUCCESSFUL":return wd(this._stateStream.getValue());case"ERRORED":return ip(t.error);default:return ep}})).pipe(up())}}return t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(ZB),Ci(iV),Ci(nV),Ci(eV),Ci(KB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const sV=t=>{Object.freeze(t);const e="function"==typeof t,n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(function(i){n.call(t,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==t[i]&&("object"==typeof t[i]||"function"==typeof t[i])&&!Object.isFrozen(t[i])&&sV(t[i])}),t};let oV=(()=>{class t{constructor(t,e){this.isDevMode=t,this.isTestMode=e}}return t.\u0275fac=function(e){return new(e||t)(Ci(RB),Ci(DB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),aV=(()=>{class t{constructor(t,e){this._host=t,this._config=e}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(kB.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(kB.INCORRECT_DEVELOPMENT()))}}return t.\u0275fac=function(e){return new(e||t)(Ci(oV),Ci(jB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),lV=(()=>{class t{constructor(t,e,n,i){this._stateStream=t,this._dispatcher=e,this._config=n,i.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:t=>this._stateStream.next(t),dispatch:t=>this._dispatcher.dispatch(t)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:e=>{const n=sV(e);return t.setState(n)},dispatch:e=>t.dispatch(e)}}setStateToTheCurrentWithNew(t){const e=this.getRootStateOperations(),n=e.getState();e.setState(Object.assign({},n,t.defaults))}}return t.\u0275fac=function(e){return new(e||t)(Ci(eV),Ci(rV),Ci(jB),Ci(aV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),cV=(()=>{class t{constructor(t){this._internalStateOperations=t}createStateContext(t){const e=this._internalStateOperations.getRootStateOperations();function n(e){return UB(e,t.path)}function i(n,i){const r=zB(n,t.path,i),s=t.instance;if(s.ngxsOnChanges){const e=WB(t,{currentAppState:n,newAppState:r});s.ngxsOnChanges(e)}return e.setState(r),r}function r(t,e){return i(t,e(n(t)))}return{getState:()=>n(e.getState()),patchState:t=>r(e.getState(),function(t){return e=>{if(Array.isArray(t))throw new Error(kB.PATCHING_ARRAY());if("object"!=typeof t)throw new Error(kB.PATCHING_PRIMITIVE());const n=Object.assign({},e);for(const i in t)n[i]=t[i];return n}}(t)),setState(t){const n=e.getState();return function(t){return"function"==typeof t}(t)?r(n,t):i(n,t)},dispatch:t=>e.dispatch(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(lV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class uV{static stateNameErrorMessage(t){return kB.STATE_NAME(t)}static checkCorrectStateName(t){if(!t)throw new Error(kB.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(t))throw new Error(this.stateNameErrorMessage(t))}static checkStateNameIsUnique(t,e){const n=this.getValidStateMeta(t).name,i=e[n];if(i&&i!==t)throw new Error(kB.STATE_UNIQUE(n,t.name,i.name));return n}static getValidStateMeta(t){const e=GB(t);if(!e)throw new Error(kB.STATE_DECORATOR());return e}}uV.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let hV=(()=>{class t{constructor(t,e,n,i,r,s,o){this._injector=t,this._config=e,this._parentFactory=n,this._actions=i,this._actionResults=r,this._stateContextFactory=s,this._initialState=o,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=gB(()=>{const t=this;function e(e){const n=t.statePaths[e];return n?function(t,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(t){const e=t.slice();return t=>e.reduce((t,e)=>t&&t[e],t)}(t):function(t){const e=t;let n="store."+e[0],i=0;const r=e.length;let s=n;for(;++i(n||(n=e(t)),n?n(...i):void 0))},getSelectorOptions:e=>Object.assign({},t._config.selectorOptions,e||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let e={};return e=Array.isArray(t)?t.slice():function(t){return"object"==typeof t&&null!==t||"function"==typeof t}(t)?Object.assign({},t):void 0===t?{}:t,e}static checkStatesAreValid(t){t.forEach(uV.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(e){t.checkStatesAreValid(e);const{newStates:n}=this.addToStatesMap(e);if(!n.length)return[];const i=function(t){const e=e=>{const n=t.find(t=>t===e);if(!n)throw new Error(`Child state not found: ${e}. \r\nYou may have forgotten to add states to module`);return n[NB].name};return t.reduce((t,n)=>{const{name:i,children:r}=n[NB];return t[i]=(r||[]).map(e),t},{})}(n),r=function(t){const e=[],n={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),n[r]=!0,t[r].forEach(t=>{if(s.indexOf(t)>=0)throw new Error(`Circular dependency '${t}' is required by '${r}': ${s.join(" -> ")}`);n[t]||i(t,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(t).forEach(t=>i(t)),e.reverse()}(i),s=function(t,e={}){const n=(t,e)=>{for(const i in t)if(t.hasOwnProperty(i)&&t[i].indexOf(e)>=0){const e=n(t,i);return null!==e?`${e}.${i}`:i}return null};for(const i in t)if(t.hasOwnProperty(i)){const r=n(t,i);e[i]=r?`${r}.${i}`:i}return e}(i),o=function(t){return t.reduce((t,e)=>(t[e[NB].name]=e,t),{})}(n),a=[];for(const l of r){const e=o[l],n=s[l],i=e[NB];this.addRuntimeInfoToMeta(i,n);const r={name:l,path:n,isInitialised:!1,actions:i.actions,instance:this._injector.get(e),defaults:t.cloneDefaults(i.defaults)};this.hasBeenMountedAndBootstrapped(l,n)||a.push(r),this.states.push(r)}return a}addAndReturnDefaults(t){const e=this.add(t||[]);return{defaults:e.reduce((t,e)=>zB(t,e.path,e.defaults),{}),states:e}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Hd(t=>"DISPATCHED"===t.status),W(({action:t})=>this.invokeActions(this._actions,t).pipe(D(()=>({action:t,status:"SUCCESSFUL"})),CB({action:t,status:"CANCELED"}),pv(e=>wd({action:t,status:"ERRORED",error:e}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,e){const n=VB(e),i=[];for(const s of this.states){const o=s.actions[n];if(o)for(const n of o){const o=this._stateContextFactory.createStateContext(s);try{let r=s.instance[n.fn](o,e);r instanceof Promise&&(r=U(r)),r instanceof C?(r=r.pipe(CB({})),n.options.cancelUncompleted&&(r=r.pipe(Wd(t.pipe(qB(e)))))):r=wd({}).pipe(up()),i.push(r)}catch(r){i.push(ip(r))}}}return i.length||i.push(wd({})),hv(i)}addToStatesMap(t){const e=[],n=this.statesByName;for(const i of t){const t=uV.checkStateNameIsUnique(i,n);!n[t]&&(e.push(i),n[t]=i)}return{newStates:e}}addRuntimeInfoToMeta(t,e){this.statePaths[t.name]=e,t.path=e}hasBeenMountedAndBootstrapped(t,e){const n=void 0!==UB(this._initialState,e);return this.statesByName[t]&&n}}return t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(jB),Ci(t,12),Ci(ZB),Ci(iV),Ci(cV),Ci(yB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),dV=(()=>{class t{constructor(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}ngxsBootstrap(t,e){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Hd(()=>!!e),$f(()=>this.invokeInit(e.states)),W(()=>this.bootstrapper.appBootstrapped$),Hd(t=>!!t)).subscribe(()=>this.invokeBootstrap(e.states))}invokeInit(t){for(const e of t){const t=e.instance;if(t.ngxsOnChanges){const n=WB(e,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});t.ngxsOnChanges(n)}t.ngxsOnInit&&t.ngxsOnInit(this.getStateContext(e)),e.isInitialised=!0}}invokeBootstrap(t){for(const e of t){const t=e.instance;t.ngxsAfterBootstrap&&t.ngxsAfterBootstrap(this.getStateContext(e))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(lV),Ci(cV),Ci(bB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();let pV=(()=>{class t{constructor(t,e,n,i,r,s){this._stateStream=t,this._internalStateOperations=e,this._config=n,this._internalExecutionStrategy=i,this._stateFactory=r,this.initStateStream(s)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const e=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(D(e),pv(t=>{const{suppressErrors:e}=this._config.selectorOptions;return t instanceof TypeError&&e?wd(void 0):ip(t)}),Rd(),YB(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Gp(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(YB(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(t){const e=function(t){return t.NGXS_SELECTOR_META}(t)||GB(t);return e&&e.makeRootSelector||(()=>t)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const e=this._stateStream.value;if(!e||0===Object.keys(e).length){const e=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(e)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(eV),Ci(lV),Ci(jB),Ci(KB),Ci(hV),Ci(yB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),fV=(()=>{class t{constructor(e,n){t.store=e,t.config=n}ngOnDestroy(){t.store=null,t.config=null}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV),Ci(jB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t.store=null,t.config=null,t})();class gV{static get type(){return"@@INIT"}}class mV{constructor(t){this.addedStates=t}static get type(){return"@@UPDATE_STATE"}}const bV=new lp(1);let yV=(()=>{class t{constructor(e,n,i,r,s=[],o){!function(){try{const t=window.ng,e=!(t.probe&&t.coreTokens)&&Nu();bV.next(e)}catch(t){bV.next(!1)}finally{bV.complete()}}();const a=e.addAndReturnDefaults(s);n.setStateToTheCurrentWithNew(a),e.connectActionHandlers(),o.ngxsBootstrap(new gV,a)}}return t.\u0275fac=function(e){return new(e||t)(Ci(hV),Ci(lV),Ci(pV),Ci(fV),Ci(PB,8),Ci(dV))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),vV=(()=>{class t{constructor(e,n,i,r=[],s){const o=t.flattenStates(r),a=i.addAndReturnDefaults(o);a.states.length&&(n.setStateToTheCurrentWithNew(a),s.ngxsBootstrap(new mV(a.defaults),a))}static flattenStates(t=[]){return t.reduce((t,e)=>t.concat(e),[])}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV),Ci(lV),Ci(hV),Ci(IB,8),Ci(dV))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class _V{static forRoot(t=[],e={}){return{ngModule:yV,providers:[hV,cV,JB,ZB,bB,aV,oV,dV,rV,iV,lV,KB,pV,eV,fV,nV,...t,..._V.ngxsTokenProviders(t,e)]}}static forFeature(t=[]){return{ngModule:vV,providers:[hV,nV,...t,{provide:IB,multi:!0,useValue:t}]}}static ngxsTokenProviders(t,e){return[{provide:DB,useValue:mB},{provide:RB,useValue:Nu},{provide:BB,useClass:e.executionStrategy||AB},{provide:PB,useValue:t},{provide:_V.ROOT_OPTIONS,useValue:e},{provide:jB,useFactory:_V.ngxsConfigFactory,deps:[_V.ROOT_OPTIONS]},{provide:au,useFactory:_V.appBootstrapListenerFactory,multi:!0,deps:[bB]},{provide:yB,useFactory:_V.getInitialState},{provide:_B,useExisting:cV},{provide:wB,useExisting:hV}]}static ngxsConfigFactory(t){return $B(new jB,t)}static appBootstrapListenerFactory(t){return()=>t.bootstrap()}static getInitialState(){return vB.pop()}}function wV(t){return e=>{!function(t){bV.subscribe(e=>{e&&(t.\u0275prov||console.warn(kB.UNDECORATED_STATE_IN_IVY(t.name)))})}(e);const n=e,i=function(t){if(!t.hasOwnProperty(NB)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,NB,{value:e})}return GB(t)}(n),r=Object.getPrototypeOf(n),s=function(e){return Object.assign({},e[LB]||{},t)}(r);(function(t){const{meta:e,inheritedStateClass:n,optionsWithInheritance:i}=t,{children:r,defaults:s,name:o}=i,a="string"==typeof o?o:o&&o.getName()||null;uV.checkCorrectStateName(a),n.hasOwnProperty(NB)&&(e.actions=Object.assign({},e.actions,(n[NB]||{}).actions)),e.children=r,e.defaults=s,e.name=a})({meta:i,inheritedStateClass:r,optionsWithInheritance:s}),n[LB]=s}}_V.\u0275fac=function(t){return new(t||_V)},_V.\u0275mod=ie({type:_V}),_V.\u0275inj=St({}),_V.ROOT_OPTIONS=new oi("ROOT_OPTIONS");let xV=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}setProperty(t,e){this._renderer.setProperty(this._elementRef.nativeElement,t,e)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl))},t.\u0275dir=se({type:t}),t})(),SV=(()=>{class t extends xV{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,features:[jo]}),t})();const EV=new oi("NgValueAccessor"),CV={provide:EV,useExisting:pt(()=>TV),multi:!0},OV=new oi("CompositionEventMode");let TV=(()=>{class t extends xV{constructor(t,e,n){super(t,e),this._compositionMode=n,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=Xu()?Xu().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl),ea(OV,8))},t.\u0275dir=se({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,e){1&t&&fa("input",function(t){return e._handleInput(t.target.value)})("blur",function(){return e.onTouched()})("compositionstart",function(){return e._compositionStart()})("compositionend",function(t){return e._compositionEnd(t.target.value)})},features:[_l([CV]),jo]}),t})();const kV=new oi("NgValidators"),AV=new oi("NgAsyncValidators");function PV(t){return null!=t}function IV(t){const e=ha(t)?U(t):t;return pa(e),e}function MV(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function DV(t,e){return e.map(e=>e(t))}function RV(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function NV(t){return null!=t?function(t){if(!t)return null;const e=t.filter(PV);return 0==e.length?null:function(t){return MV(DV(t,e))}}(RV(t)):null}function LV(t){return null!=t?function(t){if(!t)return null;const e=t.filter(PV);return 0==e.length?null:function(t){return hv(DV(t,e).map(IV)).pipe(D(MV))}}(RV(t)):null}function jV(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function FV(t){return t._rawValidators}function BV(t){return t._rawAsyncValidators}function VV(t){return t?Array.isArray(t)?t:[t]:[]}function zV(t,e){return Array.isArray(t)?t.includes(e):t===e}function UV(t,e){const n=VV(e);return VV(t).forEach(t=>{zV(n,t)||n.push(t)}),n}function HV(t,e){return VV(e).filter(e=>!zV(t,e))}let $V=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=NV(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=LV(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})(),GV=(()=>{class t extends $V{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,features:[jo]}),t})();class WV extends $V{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class qV{constructor(t){this._cd=t}is(t){var e,n,i;return"submitted"===t?!!(null===(e=this._cd)||void 0===e?void 0:e.submitted):!!(null===(i=null===(n=this._cd)||void 0===n?void 0:n.control)||void 0===i?void 0:i[t])}}let XV=(()=>{class t extends qV{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(WV,2))},t.\u0275dir=se({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,e){2&t&&ja("ng-untouched",e.is("untouched"))("ng-touched",e.is("touched"))("ng-pristine",e.is("pristine"))("ng-dirty",e.is("dirty"))("ng-valid",e.is("valid"))("ng-invalid",e.is("invalid"))("ng-pending",e.is("pending"))},features:[jo]}),t})(),YV=(()=>{class t extends qV{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(GV,10))},t.\u0275dir=se({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(t,e){2&t&&ja("ng-untouched",e.is("untouched"))("ng-touched",e.is("touched"))("ng-pristine",e.is("pristine"))("ng-dirty",e.is("dirty"))("ng-valid",e.is("valid"))("ng-invalid",e.is("invalid"))("ng-pending",e.is("pending"))("ng-submitted",e.is("submitted"))},features:[jo]}),t})();function KV(t,e){JV(t,e),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&ez(t,e)})}(t,e),function(t,e){const n=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&ez(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),function(t,e){if(e.valueAccessor.setDisabledState){const n=t=>{e.valueAccessor.setDisabledState(t)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}(t,e)}function QV(t,e,n=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),tz(t,e),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function ZV(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function JV(t,e){const n=FV(t);null!==e.validator?t.setValidators(jV(n,e.validator)):"function"==typeof n&&t.setValidators([n]);const i=BV(t);null!==e.asyncValidator?t.setAsyncValidators(jV(i,e.asyncValidator)):"function"==typeof i&&t.setAsyncValidators([i]);const r=()=>t.updateValueAndValidity();ZV(e._rawValidators,r),ZV(e._rawAsyncValidators,r)}function tz(t,e){let n=!1;if(null!==t){if(null!==e.validator){const i=FV(t);if(Array.isArray(i)&&i.length>0){const r=i.filter(t=>t!==e.validator);r.length!==i.length&&(n=!0,t.setValidators(r))}}if(null!==e.asyncValidator){const i=BV(t);if(Array.isArray(i)&&i.length>0){const r=i.filter(t=>t!==e.asyncValidator);r.length!==i.length&&(n=!0,t.setAsyncValidators(r))}}}const i=()=>{};return ZV(e._rawValidators,i),ZV(e._rawAsyncValidators,i),n}function ez(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function nz(t,e){JV(t,e)}function iz(t,e){t._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)})}function rz(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const sz="VALID",oz="INVALID",az="PENDING",lz="DISABLED";function cz(t){return(pz(t)?t.validators:t)||null}function uz(t){return Array.isArray(t)?NV(t):t||null}function hz(t,e){return(pz(e)?e.asyncValidators:t)||null}function dz(t){return Array.isArray(t)?LV(t):t||null}function pz(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class fz{constructor(t,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=uz(this._rawValidators),this._composedAsyncValidatorFn=dz(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===sz}get invalid(){return this.status===oz}get pending(){return this.status==az}get disabled(){return this.status===lz}get enabled(){return this.status!==lz}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=uz(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=dz(t)}addValidators(t){this.setValidators(UV(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(UV(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(HV(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(HV(t,this._rawAsyncValidators))}hasValidator(t){return zV(this._rawValidators,t)}hasAsyncValidator(t){return zV(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=az,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=lz,this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=sz,this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===sz||this.status===az)&&this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?lz:sz}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=az,this._hasOwnPendingAsyncValidator=!0;const e=IV(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(e,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=t;return e.forEach(t=>{i=i instanceof mz?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof bz&&i.at(t)||null}),i}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new Rc,this.statusChanges=new Rc}_calculateStatus(){return this._allControlsDisabled()?lz:this.errors?oz:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(az)?az:this._anyControlsHaveStatus(oz)?oz:sz}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){pz(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class gz extends fz{constructor(t=null,e,n){super(cz(e),hz(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){rz(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){rz(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class mz extends fz{constructor(t,e,n){super(cz(e),hz(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,n={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof gz?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>{const n=this.controls[e];n&&t(n,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,i)=>{n=e(n,t,i)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class bz extends fz{constructor(t,e,n){super(cz(e),hz(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(t){return this.controls[t]}push(t,e={}){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(t,e,n={}){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:n.emitEvent})}removeAt(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t=[],e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof gz?t.value:t.getRawValue())}clear(t={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:t.emitEvent}))}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error(`Cannot find form control at index ${t}`)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}const yz={provide:GV,useExisting:pt(()=>_z)},vz=(()=>Promise.resolve(null))();let _z=(()=>{class t extends GV{constructor(t,e){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Rc,this.form=new mz({},NV(t),LV(e))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){vz.then(()=>{const e=this._findContainer(t.path);t.control=e.registerControl(t.name,t.control),KV(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){vz.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name),rz(this._directives,t)})}addFormGroup(t){vz.then(()=>{const e=this._findContainer(t.path),n=new mz({});nz(n,t),e.registerControl(t.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){vz.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,e){vz.then(()=>{this.form.get(t.path).setValue(e)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,iz(this.form,this._directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10))},t.\u0275dir=se({type:t,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,e){1&t&&fa("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_l([yz]),jo]}),t})(),wz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),t})(),xz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Sz=new oi("NgModelWithFormControlWarning"),Ez={provide:WV,useExisting:pt(()=>Cz)};let Cz=(()=>{class t extends WV{constructor(t,e,n,i){super(),this._ngModelWarningConfig=i,this.update=new Rc,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(e),this.valueAccessor=function(t,e){if(!e)return null;let n,i,r;return Array.isArray(e),e.forEach(t=>{t.constructor===TV?n=t:function(t){return Object.getPrototypeOf(t.constructor)===SV}(t)?i=t:r=t}),r||i||n||null}(0,n)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const e=t.form.previousValue;e&&QV(e,this,!1),KV(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}(function(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)})(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&QV(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10),ea(EV,10),ea(Sz,8))},t.\u0275dir=se({type:t,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[_l([Ez]),jo,ye]}),t._ngModelWarningSentOnce=!1,t})();const Oz={provide:GV,useExisting:pt(()=>Tz)};let Tz=(()=>{class t extends GV{constructor(t,e){super(),this.validators=t,this.asyncValidators=e,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Rc,this._setValidators(t),this._setAsyncValidators(e)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(tz(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const e=this.form.get(t.path);return KV(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){QV(t.control||null,t,!1),rz(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,e){this.form.get(t.path).setValue(e)}onSubmit(t){return this.submitted=!0,iz(this.form,this.directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const e=t.control,n=this.form.get(t.path);e!==n&&(QV(e||null,t),n instanceof gz&&(KV(n,t),t.control=n))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const e=this.form.get(t.path);nz(e,t),e.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const e=this.form.get(t.path);e&&function(t,e){return tz(t,e)}(e,t)&&e.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){JV(this.form,this),this._oldForm&&tz(this._oldForm,this)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10))},t.\u0275dir=se({type:t,selectors:[["","formGroup",""]],hostBindings:function(t,e){1&t&&fa("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_l([Oz]),jo,ye]}),t})(),kz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[xz]]}),t})(),Az=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[kz]}),t})(),Pz=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:Sz,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[kz]}),t})();function Iz(t){return new C(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?U(n):np()).subscribe(e)})}const Mz=["underline"],Dz=["connectionContainer"],Rz=["inputContainer"],Nz=["label"];function Lz(t,e){1&t&&(aa(0),ra(1,"div",14),oa(2,"div",15),oa(3,"div",16),oa(4,"div",17),sa(),ra(5,"div",18),oa(6,"div",15),oa(7,"div",16),oa(8,"div",17),sa(),la())}function jz(t,e){1&t&&(ra(0,"div",19),xa(1,1),sa())}function Fz(t,e){if(1&t&&(aa(0),xa(1,2),ra(2,"span"),Za(3),sa(),la()),2&t){const t=va(2);ws(3),Ja(t._control.placeholder)}}function Bz(t,e){1&t&&xa(0,3,["*ngSwitchCase","true"])}function Vz(t,e){1&t&&(ra(0,"span",23),Za(1," *"),sa())}function zz(t,e){if(1&t){const t=ua();ra(0,"label",20,21),fa("cdkObserveContent",function(){return $e(t),va().updateOutlineGap()}),Jo(2,Fz,4,1,"ng-container",12),Jo(3,Bz,1,0,"ng-content",12),Jo(4,Vz,2,0,"span",22),sa()}if(2&t){const t=va();ja("mat-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-form-field-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-accent","accent"==t.color)("mat-warn","warn"==t.color),na("cdkObserveContentDisabled","outline"!=t.appearance)("id",t._labelId)("ngSwitch",t._hasLabel()),Ko("for",t._control.id)("aria-owns",t._control.id),ws(2),na("ngSwitchCase",!1),ws(1),na("ngSwitchCase",!0),ws(1),na("ngIf",!t.hideRequiredMarker&&t._control.required&&!t._control.disabled)}}function Uz(t,e){1&t&&(ra(0,"div",24),xa(1,4),sa())}function Hz(t,e){if(1&t&&(ra(0,"div",25,26),oa(2,"span",27),sa()),2&t){const t=va();ws(2),ja("mat-accent","accent"==t.color)("mat-warn","warn"==t.color)}}function $z(t,e){1&t&&(ra(0,"div"),xa(1,5),sa()),2&t&&na("@transitionMessages",va()._subscriptAnimationState)}function Gz(t,e){if(1&t&&(ra(0,"div",31),Za(1),sa()),2&t){const t=va(2);na("id",t._hintLabelId),ws(1),Ja(t.hintLabel)}}function Wz(t,e){if(1&t&&(ra(0,"div",28),Jo(1,Gz,2,2,"div",29),xa(2,6),oa(3,"div",30),xa(4,7),sa()),2&t){const t=va();na("@transitionMessages",t._subscriptAnimationState),ws(1),na("ngIf",t.hintLabel)}}const qz=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Xz=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Yz=new oi("MatError"),Kz={transitionMessages:Vg("transitionMessages",[$g("enter",Hg({opacity:1,transform:"translateY(0%)"})),Wg("void => enter",[Hg({opacity:0,transform:"translateY(-5px)"}),zg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let Qz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})();const Zz=new oi("MatHint");let Jz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-label"]]}),t})(),tU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-placeholder"]]}),t})();const eU=new oi("MatPrefix");let nU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","matPrefix",""]],features:[_l([{provide:eU,useExisting:t}])]}),t})();const iU=new oi("MatSuffix");let rU=0;const sU=jy(class{constructor(t){this._elementRef=t}},"primary"),oU=new oi("MAT_FORM_FIELD_DEFAULT_OPTIONS"),aU=new oi("MatFormField");let lU=(()=>{class t extends sU{constructor(t,e,n,i,r,s,o,a){super(t),this._changeDetectorRef=e,this._dir=i,this._defaults=r,this._platform=s,this._ngZone=o,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new P,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+rU++,this._labelId="mat-form-field-label-"+rU++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==a,this.appearance=r&&r.appearance?r.appearance:"legacy",this._hideRequiredMarker=!(!r||null==r.hideRequiredMarker)&&r.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const e=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&e!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=md(t)}_shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}_canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(t){this._explicitFormFieldControl=t}getLabelId(){return this._hasFloatingLabel()?this._labelId:null}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add(`mat-form-field-type-${t.controlType}`),t.stateChanges.pipe(Kd(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(Wd(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Wd(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),Q(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Kd(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Kd(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(Wd(this._destroyed)).subscribe(()=>{"function"==typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this.updateOutlineGap())}):this.updateOutlineGap()})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(t){const e=this._control?this._control.ngControl:null;return e&&e[t]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}_shouldLabelFloat(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,xd(this._label.nativeElement,"transitionend").pipe(Gp(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_getDefaultFloatLabelState(){return this._defaults&&this._defaults.floatLabel||"auto"}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const e=this._hintChildren?this._hintChildren.find(t=>"start"===t.align):null,n=this._hintChildren?this._hintChildren.find(t=>"end"===t.align):null;e?t.push(e.id):this._hintLabel&&t.push(this._hintLabelId),n&&t.push(n.id)}else this._errorChildren&&t.push(...this._errorChildren.map(t=>t.id));this._control.setDescribedByIds(t)}}_validateControlChild(){}updateOutlineGap(){const t=this._label?this._label.nativeElement:null;if(!("outline"===this.appearance&&t&&t.children.length&&t.textContent.trim()&&this._platform.isBrowser))return;if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);let e=0,n=0;const i=this._connectionContainerRef.nativeElement,r=i.querySelectorAll(".mat-form-field-outline-start"),s=i.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const r=i.getBoundingClientRect();if(0===r.width&&0===r.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const s=this._getStartEnd(r),o=t.children,a=this._getStartEnd(o[0].getBoundingClientRect());let l=0;for(let t=0;t0?.75*l+10:0}for(let o=0;o{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny,ig],Ny]}),t})();function uU(t,e=jd){const n=function(t){return t instanceof Date&&!isNaN(+t)}(t)?+t-e.now():Math.abs(t);return t=>t.lift(new hU(n,e))}class hU{constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new dU(t,this.delay,this.scheduler))}}class dU extends v{constructor(t,e,n){super(t),this.delay=e,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(t){const e=t.source,n=e.queue,i=t.scheduler,r=t.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const e=Math.max(0,n[0].time-i.now());this.schedule(t,e)}else this.unsubscribe(),e.active=!1}_schedule(t){this.active=!0,this.destination.add(t.schedule(dU.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new pU(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(sp.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(sp.createComplete()),this.unsubscribe()}}class pU{constructor(t,e){this.time=t,this.notification=e}}const fU=["panel"];function gU(t,e){if(1&t&&(ra(0,"div",0,1),xa(2),sa()),2&t){const t=e.id,n=va();na("id",n.id)("ngClass",n._classList),Ko("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}const mU=["*"];let bU=0;class yU{constructor(t,e){this.source=t,this.option=e}}const vU=Fy(class{}),_U=new oi("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}});let wU=(()=>{class t extends vU{constructor(t,e,n,i){super(),this._changeDetectorRef=t,this._elementRef=e,this._activeOptionChanges=g.EMPTY,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new Rc,this.opened=new Rc,this.closed=new Rc,this.optionActivated=new Rc,this._classList={},this.id="mat-autocomplete-"+bU++,this.inertGroups=(null==i?void 0:i.SAFARI)||!1,this._autoActiveFirstOption=!!n.autoActiveFirstOption}get isOpen(){return this._isOpen&&this.showPanel}get autoActiveFirstOption(){return this._autoActiveFirstOption}set autoActiveFirstOption(t){this._autoActiveFirstOption=md(t)}set classList(t){this._classList=t&&t.length?function(t,e=/\s+/){const n=[];if(null!=t){const i=Array.isArray(t)?t:`${t}`.split(e);for(const t of i){const e=`${t}`.trim();e&&n.push(e)}}return n}(t).reduce((t,e)=>(t[e]=!0,t),{}):{},this._setVisibilityClasses(this._classList),this._elementRef.nativeElement.className=""}ngAfterContentInit(){this._keyManager=new fg(this.options).withWrap(),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._activeOptionChanges.unsubscribe()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._setVisibilityClasses(this._classList),this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){const e=new yU(this,t);this.optionSelected.emit(e)}_getPanelAriaLabelledby(t){return this.ariaLabel?null:this.ariaLabelledby?(t?t+" ":"")+this.ariaLabelledby:t}_setVisibilityClasses(t){t[this._visibleClass]=this.showPanel,t[this._hiddenClass]=!this.showPanel}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(kl),ea(_U),ea(pp))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(qc(sc,7),qc(fU,5)),2&t){let t;Wc(t=Yc())&&(e.template=t.first),Wc(t=Yc())&&(e.panel=t.first)}},inputs:{displayWith:"displayWith",autoActiveFirstOption:"autoActiveFirstOption",classList:["class","classList"],ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],panelWidth:"panelWidth"},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},features:[jo]}),t})(),xU=(()=>{class t extends wU{constructor(){super(...arguments),this._visibleClass="mat-autocomplete-visible",this._hiddenClass="mat-autocomplete-hidden"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,iv,5),Xc(n,av,5)),2&t){let t;Wc(t=Yc())&&(e.optionGroups=t),Wc(t=Yc())&&(e.options=t)}},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[_l([{provide:Jy,useExisting:t}]),jo],ngContentSelectors:mU,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(t,e){1&t&&(wa(),Jo(0,gU,3,4,"ng-template"))},directives:[mh],styles:[".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}\n"],encapsulation:2,changeDetection:0}),t})();const SU=new oi("mat-autocomplete-scroll-strategy"),EU={provide:SU,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}},CU={provide:EV,useExisting:pt(()=>TU),multi:!0};let OU=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u){this._element=t,this._overlay=e,this._viewContainerRef=n,this._zone=i,this._changeDetectorRef=r,this._dir=o,this._formField=a,this._document=l,this._viewportRuler=c,this._defaults=u,this._componentDestroyed=!1,this._autocompleteDisabled=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=g.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new P,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=Iz(()=>this.autocomplete&&this.autocomplete.options?Q(...this.autocomplete.options.map(t=>t.onSelectionChange)):this._zone.onStable.pipe(Gp(1),Qd(()=>this.optionSelections))),this._scrollStrategy=s}get autocompleteDisabled(){return this._autocompleteDisabled}set autocompleteDisabled(t){this._autocompleteDisabled=md(t)}ngAfterViewInit(){const t=this._getWindow();void 0!==t&&this._zone.runOutsideAngular(()=>t.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){const t=this._getWindow();void 0!==t&&t.removeEventListener("blur",this._windowBlurHandler),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._attachOverlay(),this._floatLabel()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this.autocomplete.closed.emit(),this.autocomplete._isOpen=this._overlayAttached=!1,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._componentDestroyed||this._changeDetectorRef.detectChanges())}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Q(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Hd(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Hd(()=>this._overlayAttached)):wd()).pipe(D(t=>t instanceof sv?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Q(xd(this._document,"click"),xd(this._document,"auxclick"),xd(this._document,"touchend")).pipe(Hd(t=>{const e=Ep(t),n=this._formField?this._formField._elementRef.nativeElement:null,i=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&e!==this._element.nativeElement&&(!n||!n.contains(e))&&(!i||!i.contains(e))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(e)}))}writeValue(t){Promise.resolve(null).then(()=>this._setTriggerValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){const e=t.keyCode;if(27===e&&!Qp(t)&&t.preventDefault(),this.activeOption&&13===e&&this.panelOpen)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){const n=this.autocomplete._keyManager.activeItem,i=38===e||40===e;this.panelOpen||9===e?this.autocomplete._keyManager.onKeydown(t):i&&this._canOpen()&&this.openPanel(),(i||this.autocomplete._keyManager.activeItem!==n)&&this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0)}}_handleInput(t){let e=t.target,n=e.value;"number"===e.type&&(n=""==n?null:parseFloat(n)),this._previousValue!==n&&(this._previousValue=n,this._onChange(n),this._canOpen()&&this._document.activeElement===t.target&&this.openPanel())}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_floatLabel(t=!1){this._formField&&"auto"===this._formField.floatLabel&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField.floatLabel="auto",this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){return Q(this._zone.onStable.pipe(Gp(1)),this.autocomplete.options.changes.pipe($f(()=>this._positionStrategy.reapplyLastPosition()),uU(0))).pipe(Qd(()=>{const t=this.panelOpen;return this._resetActiveItem(),this.autocomplete._setVisibility(),this.panelOpen&&(this._overlayRef.updatePosition(),t!==this.panelOpen&&this.autocomplete.opened.emit()),this.panelClosingActions}),Gp(1)).subscribe(t=>this._setValueAndClose(t))}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_setTriggerValue(t){const e=this.autocomplete&&this.autocomplete.displayWith?this.autocomplete.displayWith(t):t,n=null!=e?e:"";this._formField?this._formField._control.value=n:this._element.nativeElement.value=n,this._previousValue=n}_setValueAndClose(t){t&&t.source&&(this._clearPreviousSelectedOption(t.source),this._setTriggerValue(t.source.value),this._onChange(t.source.value),this._element.nativeElement.focus(),this.autocomplete._emitSelectEvent(t.source)),this.closePanel()}_clearPreviousSelectedOption(t){this.autocomplete.options.forEach(e=>{e!==t&&e.selected&&e.deselect()})}_attachOverlay(){var t;let e=this._overlayRef;e?(this._positionStrategy.setOrigin(this._getConnectedElement()),e.updateSize({width:this._getPanelWidth()})):(this._portal=new Lp(this.autocomplete.template,this._viewContainerRef,{id:null===(t=this._formField)||void 0===t?void 0:t.getLabelId()}),e=this._overlay.create(this._getOverlayConfig()),this._overlayRef=e,e.keydownEvents().subscribe(t=>{(27===t.keyCode&&!Qp(t)||38===t.keyCode&&Qp(t,"altKey"))&&(this._closeKeyEventStream.next(),this._resetActiveItem(),t.stopPropagation(),t.preventDefault())}),this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&e&&e.updateSize({width:this._getPanelWidth()})})),e&&!e.hasAttached()&&(e.attach(this._portal),this._closingActionsSubscription=this._subscribeToClosingActions());const n=this.panelOpen;this.autocomplete._setVisibility(),this.autocomplete._isOpen=this._overlayAttached=!0,this.panelOpen&&n!==this.panelOpen&&this.autocomplete.opened.emit()}_getOverlayConfig(){var t;return new af({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir,panelClass:null===(t=this._defaults)||void 0===t?void 0:t.overlayPanelClass})}_getOverlayPosition(){const t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){const e=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],n=this._aboveClass,i=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:n},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:n}];let r;r="above"===this.position?i:"below"===this.position?e:[...e,...i],t.withPositions(r)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){const t=this.autocomplete;t.autoActiveFirstOption?t._keyManager.setFirstItemActive():t._keyManager.setActiveItem(-1)}_canOpen(){const t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this._autocompleteDisabled}_getWindow(){var t;return(null===(t=this._document)||void 0===t?void 0:t.defaultView)||window}_scrollToOption(t){const e=this.autocomplete,n=lv(t,e.options,e.optionGroups);if(0===t&&1===n)e._setScrollTop(0);else if(e.panel){const n=e.options.toArray()[t];if(n){const t=n._getHostElement(),i=cv(t.offsetTop,t.offsetHeight,e._getScrollTop(),e.panel.nativeElement.offsetHeight);e._setScrollTop(i)}}}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(kf),ea(hc),ea(xu),ea(tc),ea(SU),ea(Op,8),ea(aU,9),ea(Yu,8),ea(Ip),ea(_U,8))},t.\u0275dir=se({type:t,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[ye]}),t})(),TU=(()=>{class t extends OU{constructor(){super(...arguments),this._aboveClass="mat-autocomplete-panel-above"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(t,e){1&t&&fa("focusin",function(){return e._handleFocus()})("blur",function(){return e._onTouched()})("input",function(t){return e._handleInput(t)})("keydown",function(t){return e._handleKeydown(t)}),2&t&&Ko("autocomplete",e.autocompleteAttribute)("role",e.autocompleteDisabled?null:"combobox")("aria-autocomplete",e.autocompleteDisabled?null:"list")("aria-activedescendant",e.panelOpen&&e.activeOption?e.activeOption.id:null)("aria-expanded",e.autocompleteDisabled?null:e.panelOpen.toString())("aria-owns",e.autocompleteDisabled||!e.panelOpen||null==e.autocomplete?null:e.autocomplete.id)("aria-haspopup",!e.autocompleteDisabled)},exportAs:["matAutocompleteTrigger"],features:[_l([CU]),jo]}),t})(),kU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[EU],imports:[[Rf,uv,Ny,Rh],Mp,uv,Ny]}),t})();const AU=_p({passive:!0});let PU=(()=>{class t{constructor(t,e){this._platform=t,this._ngZone=e,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return ep;const e=_d(t),n=this._monitoredElements.get(e);if(n)return n.subject;const i=new P,r="cdk-text-field-autofilled",s=t=>{"cdk-text-field-autofill-start"!==t.animationName||e.classList.contains(r)?"cdk-text-field-autofill-end"===t.animationName&&e.classList.contains(r)&&(e.classList.remove(r),this._ngZone.run(()=>i.next({target:t.target,isAutofilled:!1}))):(e.classList.add(r),this._ngZone.run(()=>i.next({target:t.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{e.addEventListener("animationstart",s,AU),e.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(e,{subject:i,unlisten:()=>{e.removeEventListener("animationstart",s,AU)}}),i}stopMonitoring(t){const e=_d(t),n=this._monitoredElements.get(e);n&&(n.unlisten(),n.subject.complete(),e.classList.remove("cdk-text-field-autofill-monitored"),e.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(e))}ngOnDestroy(){this._monitoredElements.forEach((t,e)=>this.stopMonitoring(e))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu))},token:t,providedIn:"root"}),t})(),IU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[fp]]}),t})();const MU=new oi("MAT_INPUT_VALUE_ACCESSOR"),DU=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let RU=0;const NU=Vy(class{constructor(t,e,n,i){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=n,this.ngControl=i}});let LU=(()=>{class t extends NU{constructor(t,e,n,i,r,s,o,a,l,c){super(s,i,r,n),this._elementRef=t,this._platform=e,this._autofillMonitor=a,this._formField=c,this._uid="mat-input-"+RU++,this.focused=!1,this.stateChanges=new P,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._required=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(t=>mp().has(t));const u=this._elementRef.nativeElement,h=u.nodeName.toLowerCase();this._inputValueAccessor=o||u,this._previousNativeValue=this.value,this.id=this.id,e.IOS&&l.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",t=>{const e=t.target;!e.value&&0===e.selectionStart&&0===e.selectionEnd&&(e.setSelectionRange(1,1),e.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===h,this._isTextarea="textarea"===h,this._isInFormField=!!c,this._isNativeSelect&&(this.controlType=u.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=md(t),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(t){this._id=t||this._uid}get required(){return this._required}set required(t){this._required=md(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&mp().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(t){t!==this.value&&(this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=md(t)}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}_focusChanged(t){t!==this.focused&&(this.focused=t,this.stateChanges.next())}_onInput(){}_dirtyCheckPlaceholder(){var t,e;const n=(null===(e=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===e?void 0:e.call(t))?null:this.placeholder;if(n!==this._previousPlaceholder){const t=this._elementRef.nativeElement;this._previousPlaceholder=n,n?t.setAttribute("placeholder",n):t.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){DU.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,e=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&e&&e.label)}return this.focused||!this.empty}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(WV,10),ea(_z,8),ea(Tz,8),ea(zy),ea(MU,10),ea(PU),ea(xu),ea(aU,8))},t.\u0275dir=se({type:t,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._focusChanged(!0)})("blur",function(){return e._focusChanged(!1)})("input",function(){return e._onInput()}),2&t&&(il("disabled",e.disabled)("required",e.required),Ko("id",e.id)("data-placeholder",e.placeholder)("readonly",e.readonly&&!e._isNativeSelect||null)("aria-invalid",e.empty&&e.required?null:e.errorState)("aria-required",e.required),ja("mat-input-server",e._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[_l([{provide:Qz,useExisting:t}]),jo,ye]}),t})(),jU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[zy],imports:[[IU,cU,Ny],IU,cU]}),t})();function FU(...t){const e=t.length;if(0===e)throw new Error("list of properties cannot be empty.");return n=>D(function(t,e){return n=>{let i=n;for(let r=0;rYU),multi:!0};class qU{}const XU=By(jy(Ly(class{constructor(t){this._elementRef=t}}),"accent"));let YU=(()=>{class t extends XU{constructor(t,e,n,i,r,s,o,a){super(t),this._focusMonitor=e,this._changeDetectorRef=n,this._dir=i,this._ngZone=s,this._animationMode=a,this._invert=!1,this._max=100,this._min=0,this._step=1,this._thumbLabel=!1,this._tickInterval=0,this._value=null,this._vertical=!1,this.change=new Rc,this.input=new Rc,this.valueChange=new Rc,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=g.EMPTY,this._pointerDown=t=>{this.disabled||this._isSliding||!KU(t)&&0!==t.button||this._ngZone.run(()=>{this._touchId=KU(t)?function(t,e){for(let n=0;n{if("pointer"===this._isSliding){const e=QU(t,this._touchId);if(e){t.preventDefault();const n=this.value;this._lastPointerEvent=t,this._updateValueFromPosition(e),n!=this.value&&this._emitInputEvent()}}},this._pointerUp=t=>{"pointer"===this._isSliding&&(!KU(t)||"number"!=typeof this._touchId||ZU(t.changedTouches,this._touchId))&&(t.preventDefault(),this._removeGlobalEvents(),this._isSliding=null,this._touchId=void 0,this._valueOnSlideStart!=this.value&&!this.disabled&&this._emitChangeEvent(),this._valueOnSlideStart=this._lastPointerEvent=null)},this._windowBlur=()=>{this._lastPointerEvent&&this._pointerUp(this._lastPointerEvent)},this._document=o,this.tabIndex=parseInt(r)||0,s.runOutsideAngular(()=>{const e=t.nativeElement;e.addEventListener("mousedown",this._pointerDown,GU),e.addEventListener("touchstart",this._pointerDown,GU)})}get invert(){return this._invert}set invert(t){this._invert=md(t)}get max(){return this._max}set max(t){this._max=bd(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=bd(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=bd(t,this._step),this._step%1!=0&&(this._roundToDecimal=this._step.toString().split(".").pop().length),this._changeDetectorRef.markForCheck()}get thumbLabel(){return this._thumbLabel}set thumbLabel(t){this._thumbLabel=md(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?bd(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let e=bd(t,0);this._roundToDecimal&&e!==this.min&&e!==this.max&&(e=parseFloat(e.toFixed(this._roundToDecimal))),this._value=e,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=md(t)}get displayValue(){return this.displayWith?this.displayWith(this.value):this._roundToDecimal&&this.value&&this.value%1!=0?this.value.toFixed(this._roundToDecimal):this.value||0}focus(t){this._focusHostElement(t)}blur(){this._blurHostElement()}get percent(){return this._clamp(this._percent)}_shouldInvertAxis(){return this.vertical?!this.invert:this.invert}_isMinValue(){return 0===this.percent}_getThumbGap(){return this.disabled?7:this._isMinValue()&&!this.thumbLabel?this._isActive?10:7:0}_getTrackBackgroundStyles(){const t=this.vertical?`1, ${1-this.percent}, 1`:1-this.percent+", 1, 1";return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"-":""}${this._getThumbGap()}px) scale3d(${t})`}}_getTrackFillStyles(){const t=this.percent,e=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${e})`,display:0===t?"none":""}}_getTicksContainerStyles(){return{transform:`translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"-":""}${this._tickIntervalPercent/2*100}%)`}}_getTicksStyles(){let t=100*this._tickIntervalPercent,e={backgroundSize:this.vertical?`2px ${t}%`:`${t}% 2px`,transform:`translateZ(0) translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"":"-"}${t/2}%)${this.vertical||"rtl"!=this._getDirection()?"":" rotate(180deg)"}`};if(this._isMinValue()&&this._getThumbGap()){const t=this._shouldInvertAxis();let n;n=this.vertical?t?"Bottom":"Top":t?"Right":"Left",e[`padding${n}`]=`${this._getThumbGap()}px`}return e}_getThumbContainerStyles(){const t=this._shouldInvertAxis();return{transform:`translate${this.vertical?"Y":"X"}(-${100*(("rtl"!=this._getDirection()||this.vertical?t:!t)?this.percent:1-this.percent)}%)`}}_shouldInvertMouseCoords(){const t=this._shouldInvertAxis();return"rtl"!=this._getDirection()||this.vertical?t:!t}_getDirection(){return this._dir&&"rtl"==this._dir.value?"rtl":"ltr"}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{this._isActive=!!t&&"keyboard"!==t,this._changeDetectorRef.detectChanges()}),this._dir&&(this._dirChangeSubscription=this._dir.change.subscribe(()=>{this._changeDetectorRef.markForCheck()}))}ngOnDestroy(){const t=this._elementRef.nativeElement;t.removeEventListener("mousedown",this._pointerDown,GU),t.removeEventListener("touchstart",this._pointerDown,GU),this._lastPointerEvent=null,this._removeGlobalEvents(),this._focusMonitor.stopMonitoring(this._elementRef),this._dirChangeSubscription.unsubscribe()}_onMouseenter(){this.disabled||(this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent())}_onFocus(){this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent()}_onBlur(){this.onTouched()}_onKeydown(t){if(this.disabled||Qp(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const e=this.value;switch(t.keyCode){case 33:this._increment(10);break;case 34:this._increment(-10);break;case 35:this.value=this.max;break;case 36:this.value=this.min;break;case 37:this._increment("rtl"==this._getDirection()?1:-1);break;case 38:this._increment(1);break;case 39:this._increment("rtl"==this._getDirection()?-1:1);break;case 40:this._increment(-1);break;default:return}e!=this.value&&(this._emitInputEvent(),this._emitChangeEvent()),this._isSliding="keyboard",t.preventDefault()}_onKeyup(){"keyboard"===this._isSliding&&(this._isSliding=null)}_getWindow(){return this._document.defaultView||window}_bindGlobalEvents(t){const e=this._document,n=KU(t),i=n?"touchend":"mouseup";e.addEventListener(n?"touchmove":"mousemove",this._pointerMove,GU),e.addEventListener(i,this._pointerUp,GU),n&&e.addEventListener("touchcancel",this._pointerUp,GU);const r=this._getWindow();void 0!==r&&r&&r.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,GU),t.removeEventListener("mouseup",this._pointerUp,GU),t.removeEventListener("touchmove",this._pointerMove,GU),t.removeEventListener("touchend",this._pointerUp,GU),t.removeEventListener("touchcancel",this._pointerUp,GU);const e=this._getWindow();void 0!==e&&e&&e.removeEventListener("blur",this._windowBlur)}_increment(t){this.value=this._clamp((this.value||0)+this.step*t,this.min,this.max)}_updateValueFromPosition(t){if(!this._sliderDimensions)return;let e=this._clamp(((this.vertical?t.y:t.x)-(this.vertical?this._sliderDimensions.top:this._sliderDimensions.left))/(this.vertical?this._sliderDimensions.height:this._sliderDimensions.width));if(this._shouldInvertMouseCoords()&&(e=1-e),0===e)this.value=this.min;else if(1===e)this.value=this.max;else{const t=this._calculateValue(e),n=Math.round((t-this.min)/this.step)*this.step+this.min;this.value=this._clamp(n,this.min,this.max)}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.value),this.valueChange.emit(this.value),this.change.emit(this._createChangeEvent())}_emitInputEvent(){this.input.emit(this._createChangeEvent())}_updateTickIntervalPercent(){if(this.tickInterval&&this._sliderDimensions)if("auto"==this.tickInterval){let t=this.vertical?this._sliderDimensions.height:this._sliderDimensions.width,e=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=e/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let e=new qU;return e.source=this,e.value=t,e}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,e=0,n=1){return Math.max(e,Math.min(t,n))}_getSliderDimensions(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}_focusHostElement(t){this._elementRef.nativeElement.focus(t)}_blurHostElement(){this._elementRef.nativeElement.blur()}writeValue(t){this.value=t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Ig),ea(tc),ea(Op,8),ii("tabindex"),ea(xu),ea(Yu),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-slider"]],viewQuery:function(t,e){if(1&t&&qc($U,5),2&t){let t;Wc(t=Yc())&&(e._sliderWrapper=t.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._onFocus()})("blur",function(){return e._onBlur()})("keydown",function(t){return e._onKeydown(t)})("keyup",function(){return e._onKeyup()})("mouseenter",function(){return e._onMouseenter()})("selectstart",function(t){return t.preventDefault()}),2&t&&(il("tabIndex",e.tabIndex),Ko("aria-disabled",e.disabled)("aria-valuemax",e.max)("aria-valuemin",e.min)("aria-valuenow",e.value)("aria-valuetext",null==e.valueText?e.displayValue:e.valueText)("aria-orientation",e.vertical?"vertical":"horizontal"),ja("mat-slider-disabled",e.disabled)("mat-slider-has-ticks",e.tickInterval)("mat-slider-horizontal",!e.vertical)("mat-slider-axis-inverted",e._shouldInvertAxis())("mat-slider-invert-mouse-coords",e._shouldInvertMouseCoords())("mat-slider-sliding",e._isSliding)("mat-slider-thumb-label-showing",e.thumbLabel)("mat-slider-vertical",e.vertical)("mat-slider-min-value",e._isMinValue())("mat-slider-hide-last-tick",e.disabled||e._isMinValue()&&e._getThumbGap()&&e._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[_l([WU]),jo],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(t,e){1&t&&(ra(0,"div",0,1),ra(2,"div",2),oa(3,"div",3),oa(4,"div",4),sa(),ra(5,"div",5),oa(6,"div",6),sa(),ra(7,"div",7),oa(8,"div",8),oa(9,"div",9),ra(10,"div",10),ra(11,"span",11),Za(12),sa(),sa(),sa(),sa()),2&t&&(ws(3),na("ngStyle",e._getTrackBackgroundStyles()),ws(1),na("ngStyle",e._getTrackFillStyles()),ws(1),na("ngStyle",e._getTicksContainerStyles()),ws(1),na("ngStyle",e._getTicksStyles()),ws(1),na("ngStyle",e._getThumbContainerStyles()),ws(5),Ja(e.displayValue))},directives:[Th],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),t})();function KU(t){return"t"===t.type[0]}function QU(t,e){let n;return n=KU(t)?"number"==typeof e?ZU(t.touches,e)||ZU(t.changedTouches,e):t.touches[0]||t.changedTouches[0]:t,n?{x:n.clientX,y:n.clientY}:void 0}function ZU(t,e){for(let n=0;n{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny],Ny]}),t})();function tH(t,e){}class eH{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.maxWidth="80vw",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.autoFocus=!0,this.restoreFocus=!0,this.closeOnNavigation=!0}}const nH={dialogContainer:Vg("dialogContainer",[$g("void, exit",Hg({opacity:0,transform:"scale(0.7)"})),$g("enter",Hg({transform:"none"})),Wg("* => enter",zg("150ms cubic-bezier(0, 0, 0.2, 1)",Hg({transform:"none",opacity:1}))),Wg("* => void, * => exit",zg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",Hg({opacity:0})))])};let iH=(()=>{class t extends Fp{constructor(t,e,n,i,r,s){super(),this._elementRef=t,this._focusTrapFactory=e,this._changeDetectorRef=n,this._config=r,this._focusMonitor=s,this._animationStateChanged=new Rc,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=t=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(t)),this._ariaLabelledBy=r.ariaLabelledBy||null,this._document=i}_initializeWithAttachedContent(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}attachComponentPortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(t)}_recaptureFocus(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}_trapFocus(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}_restoreFocus(){const t=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&t&&"function"==typeof t.focus){const e=Sp(),n=this._elementRef.nativeElement;(!e||e===this._document.body||e===n||n.contains(e))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_setupFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}_capturePreviouslyFocusedElement(){this._document&&(this._elementFocusedBeforeDialogWasOpened=Sp())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,e=Sp();return t===e||t.contains(e)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(vg),ea(tc),ea(Yu,8),ea(eH),ea(Ig))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&qc(Up,7),2&t){let t;Wc(t=Yc())&&(e._portalOutlet=t.first)}},features:[jo]}),t})(),rH=(()=>{class t extends iH{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:e}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:e}))}_onAnimationStart({toState:t,totalTime:e}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:e}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:e})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,e){1&t&&ga("@dialogContainer.start",function(t){return e._onAnimationStart(t)})("@dialogContainer.done",function(t){return e._onAnimationDone(t)}),2&t&&(il("id",e._id),Ko("role",e._config.role)("aria-labelledby",e._config.ariaLabel?null:e._ariaLabelledBy)("aria-label",e._config.ariaLabel)("aria-describedby",e._config.ariaDescribedBy||null),rl("@dialogContainer",e._state))},features:[jo],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,e){1&t&&Jo(0,tH,0,0,"ng-template",0)},directives:[Up],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[nH.dialogContainer]}}),t})(),sH=0;class oH{constructor(t,e,n="mat-dialog-"+sH++){this._overlayRef=t,this._containerInstance=e,this.id=n,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new P,this._afterClosed=new P,this._beforeClosed=new P,this._state=0,e._id=n,e._animationStateChanged.pipe(Hd(t=>"opened"===t.state),Gp(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),e._animationStateChanged.pipe(Hd(t=>"closed"===t.state),Gp(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),t.keydownEvents().pipe(Hd(t=>27===t.keyCode&&!this.disableClose&&!Qp(t))).subscribe(t=>{t.preventDefault(),aH(this,"keyboard")}),t.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():aH(this,"mouse")})}close(t){this._result=t,this._containerInstance._animationStateChanged.pipe(Hd(t=>"closing"===t.state),Gp(1)).subscribe(e=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),e.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}afterOpened(){return this._afterOpened}afterClosed(){return this._afterClosed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._overlayRef.backdropClick()}keydownEvents(){return this._overlayRef.keydownEvents()}updatePosition(t){let e=this._getPositionStrategy();return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._overlayRef.updatePosition(),this}updateSize(t="",e=""){return this._overlayRef.updateSize({width:t,height:e}),this._overlayRef.updatePosition(),this}addPanelClass(t){return this._overlayRef.addPanelClass(t),this}removePanelClass(t){return this._overlayRef.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function aH(t,e,n){return void 0!==t._containerInstance&&(t._containerInstance._closeInteractionType=e),t.close(n)}const lH=new oi("MatDialogData"),cH=new oi("mat-dialog-default-options"),uH=new oi("mat-dialog-scroll-strategy"),hH={provide:uH,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.block()}};let dH=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l){this._overlay=t,this._injector=e,this._defaultOptions=n,this._parentDialog=i,this._overlayContainer=r,this._dialogRefConstructor=o,this._dialogContainerType=a,this._dialogDataToken=l,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new P,this._afterOpenedAtThisLevel=new P,this._ariaHiddenElements=new Map,this.afterAllClosed=Iz(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Kd(void 0))),this._scrollStrategy=s}get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){const t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}open(t,e){(e=function(t,e){return Object.assign(Object.assign({},e),t)}(e,this._defaultOptions||new eH)).id&&this.getDialogById(e.id);const n=this._createOverlay(e),i=this._attachDialogContainer(n,e),r=this._attachDialogContent(t,i,n,e);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(r),r.afterClosed().subscribe(()=>this._removeOpenDialog(r)),this.afterOpened.next(r),i._initializeWithAttachedContent(),r}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(e=>e.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const e=this._getOverlayConfig(t);return this._overlay.create(e)}_getOverlayConfig(t){const e=new af({positionStrategy:this._overlay.position().global(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,disposeOnNavigation:t.closeOnNavigation});return t.backdropClass&&(e.backdropClass=t.backdropClass),e}_attachDialogContainer(t,e){const n=No.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:eH,useValue:e}]}),i=new Np(this._dialogContainerType,e.viewContainerRef,n,e.componentFactoryResolver);return t.attach(i).instance}_attachDialogContent(t,e,n,i){const r=new this._dialogRefConstructor(n,e,i.id);if(t instanceof sc)e.attachTemplatePortal(new Lp(t,null,{$implicit:i.data,dialogRef:r}));else{const n=this._createInjector(i,r,e),s=e.attachComponentPortal(new Np(t,i.viewContainerRef,n));r.componentInstance=s.instance}return r.updateSize(i.width,i.height).updatePosition(i.position),r}_createInjector(t,e,n){const i=t&&t.viewContainerRef&&t.viewContainerRef.injector,r=[{provide:this._dialogContainerType,useValue:n},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:e}];return t.direction&&(!i||!i.get(Op,null,It.Optional))&&r.push({provide:Op,useValue:{value:t.direction,change:wd()}}),No.create({parent:i||this._injector,providers:r})}_removeOpenDialog(t){const e=this.openDialogs.indexOf(t);e>-1&&(this.openDialogs.splice(e,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const e=t.parentElement.children;for(let n=e.length-1;n>-1;n--){let i=e[n];i!==t&&"SCRIPT"!==i.nodeName&&"STYLE"!==i.nodeName&&!i.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(i,i.getAttribute("aria-hidden")),i.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let e=t.length;for(;e--;)t[e].close()}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(No),ea(void 0),ea(void 0),ea(gf),ea(void 0),ea(ai),ea(ai),ea(oi))},t.\u0275dir=se({type:t}),t})(),pH=(()=>{class t extends dH{constructor(t,e,n,i,r,s,o){super(t,e,i,s,o,r,oH,rH,lH)}}return t.\u0275fac=function(e){return new(e||t)(Ci(kf),Ci(No),Ci(lh,8),Ci(cH,8),Ci(uH),Ci(t,12),Ci(gf))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),fH=0,gH=(()=>{class t{constructor(t,e,n){this._dialogRef=t,this._elementRef=e,this._dialog=n,this.id="mat-dialog-title-"+fH++}ngOnInit(){this._dialogRef||(this._dialogRef=function(t,e){let n=t.nativeElement.parentElement;for(;n&&!n.classList.contains("mat-dialog-container");)n=n.parentElement;return n?e.find(t=>t.id===n.id):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{const t=this._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=this.id)})}}return t.\u0275fac=function(e){return new(e||t)(ea(oH,8),ea(kl),ea(pH))},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,e){2&t&&il("id",e.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),t})(),mH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),t})();let bH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[pH,hH],imports:[[Rf,Hp,Ny],Ny]}),t})();const yH=new oi("CdkAccordion");let vH=0,_H=(()=>{class t{constructor(t,e,n){this.accordion=t,this._changeDetectorRef=e,this._expansionDispatcher=n,this._openCloseAllSubscription=g.EMPTY,this.closed=new Rc,this.opened=new Rc,this.destroyed=new Rc,this.expandedChange=new Rc,this.id="cdk-accordion-child-"+vH++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=n.listen((t,e)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===e&&this.id!==t&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=md(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return t.\u0275fac=function(e){return new(e||t)(ea(yH,12),ea(tc),ea(Ap))},t.\u0275dir=se({type:t,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[_l([{provide:yH,useValue:void 0}])]}),t})(),wH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const xH=["body"];function SH(t,e){}const EH=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],CH=["mat-expansion-panel-header","*","mat-action-row"];function OH(t,e){1&t&&oa(0,"span",2),2&t&&na("@indicatorRotate",va()._getExpandedState())}const TH=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],kH=["mat-panel-title","mat-panel-description","*"],AH=new oi("MAT_ACCORDION"),PH="225ms cubic-bezier(0.4,0.0,0.2,1)",IH={indicatorRotate:Vg("indicatorRotate",[$g("collapsed, void",Hg({transform:"rotate(0deg)"})),$g("expanded",Hg({transform:"rotate(180deg)"})),Wg("expanded <=> collapsed, void => collapsed",zg(PH))]),bodyExpansion:Vg("bodyExpansion",[$g("collapsed, void",Hg({height:"0px",visibility:"hidden"})),$g("expanded",Hg({height:"*",visibility:"visible"})),Wg("expanded <=> collapsed, void => collapsed",zg(PH))])};let MH=(()=>{class t{constructor(t){this._template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["ng-template","matExpansionPanelContent",""]]}),t})(),DH=0;const RH=new oi("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let NH=(()=>{class t extends _H{constructor(t,e,n,i,r,s,o){super(t,e,n),this._viewContainerRef=i,this._animationMode=s,this._hideToggle=!1,this.afterExpand=new Rc,this.afterCollapse=new Rc,this._inputChanges=new P,this._headerId="mat-expansion-panel-header-"+DH++,this._bodyAnimationDone=new P,this.accordion=t,this._document=r,this._bodyAnimationDone.pipe(Rd((t,e)=>t.fromState===e.fromState&&t.toState===e.toState)).subscribe(t=>{"void"!==t.fromState&&("expanded"===t.toState?this.afterExpand.emit():"collapsed"===t.toState&&this.afterCollapse.emit())}),o&&(this.hideToggle=o.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=md(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe(Kd(null),Hd(()=>this.expanded&&!this._portal),Gp(1)).subscribe(()=>{this._portal=new Lp(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,e=this._body.nativeElement;return t===e||e.contains(t)}return!1}}return t.\u0275fac=function(e){return new(e||t)(ea(AH,12),ea(tc),ea(Ap),ea(hc),ea(Yu),ea(Ey,8),ea(RH,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,MH,5),2&t){let t;Wc(t=Yc())&&(e._lazyContent=t.first)}},viewQuery:function(t,e){if(1&t&&qc(xH,5),2&t){let t;Wc(t=Yc())&&(e._body=t.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,e){2&t&&ja("mat-expanded",e.expanded)("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-expansion-panel-spacing",e._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[_l([{provide:AH,useValue:void 0}]),jo,ye],ngContentSelectors:CH,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,e){1&t&&(wa(EH),xa(0),ra(1,"div",0,1),fa("@bodyExpansion.done",function(t){return e._bodyAnimationDone.next(t)}),ra(3,"div",2),xa(4,1),Jo(5,SH,0,0,"ng-template",3),sa(),xa(6,2),sa()),2&t&&(ws(1),na("@bodyExpansion",e._getExpandedState())("id",e.id),Ko("aria-labelledby",e._headerId),ws(4),na("cdkPortalOutlet",e._portal))},directives:[Up],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[IH.bodyExpansion]},changeDetection:0}),t})();class LH{}const jH=By(LH);let FH=(()=>{class t extends jH{constructor(t,e,n,i,r,s,o){super(),this.panel=t,this._element=e,this._focusMonitor=n,this._changeDetectorRef=i,this._animationMode=s,this._parentChangeSubscription=g.EMPTY;const a=t.accordion?t.accordion._stateChanges.pipe(Hd(t=>!(!t.hideToggle&&!t.togglePosition))):ep;this.tabIndex=parseInt(o||"")||0,this._parentChangeSubscription=Q(t.opened,t.closed,a,t._inputChanges.pipe(Hd(t=>!!(t.hideToggle||t.disabled||t.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Hd(()=>t._containsFocus())).subscribe(()=>n.focusVia(e,"program")),r&&(this.expandedHeight=r.expandedHeight,this.collapsedHeight=r.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Qp(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,e){t?this._focusMonitor.focusVia(this._element,t,e):this._element.nativeElement.focus(e)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return t.\u0275fac=function(e){return new(e||t)(ea(NH,1),ea(kl),ea(Ig),ea(tc),ea(RH,8),ea(Ey,8),ii("tabindex"))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,e){1&t&&fa("click",function(){return e._toggle()})("keydown",function(t){return e._keydown(t)}),2&t&&(Ko("id",e.panel._headerId)("tabindex",e.tabIndex)("aria-controls",e._getPanelId())("aria-expanded",e._isExpanded())("aria-disabled",e.panel.disabled),La("height",e._getHeaderHeight()),ja("mat-expanded",e._isExpanded())("mat-expansion-toggle-indicator-after","after"===e._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===e._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[jo],ngContentSelectors:kH,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,e){1&t&&(wa(TH),ra(0,"span",0),xa(1),xa(2,1),xa(3,2),sa(),Jo(4,OH,1,1,"span",1)),2&t&&(ws(4),na("ngIf",e._showToggle()))},directives:[_h],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[IH.indicatorRotate]},changeDetection:0}),t})(),BH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny,wH,Hp]]}),t})();var VH=n(5478);Object.create(Error.prototype);const zH=["*"];var UH=(()=>(function(t){t.LineHighlight="line-highlight",t.LineNumbers="line-numbers"}(UH||(UH={})),UH))();class HH{}const $H=new oi("SECURITY_CONTEXT");let GH=(()=>{class t{constructor(t,e,n,i,r){this.platform=t,this.securityContext=e,this.http=n,this.sanitizer=r,this.initialMarkedOptions={renderer:new VH.Renderer},this.options=i}get options(){return this._options}set options(t){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),t)}get renderer(){return this.options.renderer}set renderer(t){this.options.renderer=t}compile(t,e=!1,n=!1,i=this.options){const r=this.trimIndentation(t),s=e?this.decodeHtml(r):r,o=n?this.renderEmoji(s):s,a=VH.parse(o,i);return this.sanitizer.sanitize(this.securityContext,a)||""}getSource(t){if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(t,{responseType:"text"}).pipe(D(e=>this.handleExtension(t,e)))}highlight(t){if(Lh(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const e=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(e,t=>t.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,e){if(!Lh(this.platform))return t;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return t.replace(/\$([^\s][^$]*?[^\s])\$/gm,(t,n)=>katex.renderToString(n,e))}decodeHtml(t){if(!Lh(this.platform))return t;const e=document.createElement("textarea");return e.innerHTML=t,e.value}handleExtension(t,e){const n=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==n?"```"+n+"\n"+e+"\n```":e}renderEmoji(t){if(!Lh(this.platform))return t;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(t)}trimIndentation(t){if(!t)return"";let e;return t.split("\n").map(t=>{let n=e;return t.length>0&&(n=isNaN(n)?t.search(/\S|$/):Math.min(t.search(/\S|$/),n)),isNaN(e)&&(e=n),n?t.substring(n):t}).join("\n")}}return t.\u0275fac=function(e){return new(e||t)(Ci(ou),Ci($H),Ci(Bv,8),Ci(HH,8),Ci(hd))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),WH=(()=>{class t{constructor(t,e){this.element=t,this.markdownService=e,this.error=new Rc,this.load=new Rc,this.ready=new Rc,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}get emoji(){return this._emoji}set emoji(t){this._emoji=this.coerceBooleanProperty(t)}get katex(){return this._katex}set katex(t){this._katex=this.coerceBooleanProperty(t)}get lineHighlight(){return this._lineHighlight}set lineHighlight(t){this._lineHighlight=this.coerceBooleanProperty(t)}get lineNumbers(){return this._lineNumbers}set lineNumbers(t){this._lineNumbers=this.coerceBooleanProperty(t)}ngOnChanges(){null==this.data?null==this.src||this.handleSrc():this.handleData()}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion()}render(t,e=!1){let n=this.markdownService.compile(t,e,this.emoji);n=this.katex?this.markdownService.renderKatex(n,this.katexOptions):n,this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}coerceBooleanProperty(t){return null!=t&&"false"!=`${String(t)}`}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe(t=>{this.render(t),this.load.emit(t)},t=>this.error.emit(t))}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,UH.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,e){const n=t.querySelectorAll("pre");for(let i=0;i{const r=e[t];if(r){const e=this.toLispCase(t);n.item(i).setAttribute(e,r.toString())}})}toLispCase(t){const e=t.match(/([A-Z])/g);if(!e)return t;let n=t.toString();for(let i=0,r=e.length;i{class t{static forRoot(e){return{ngModule:t,providers:[GH,e&&e.loader||[],e&&e.markedOptions||[],{provide:$H,useValue:e&&null!=e.sanitize?e.sanitize:yr.HTML}]}}static forChild(){return{ngModule:t}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function XH(t,e,n){return n?XH(t,e).pipe(D(t=>d(t)?n(...t):n(t))):new C(n=>{const i=(...t)=>n.next(1===t.length?t[0]:t);let r;try{r=t(i)}catch(s){return void n.error(s)}if(a(e))return()=>e(i,r)})}function YH(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new KH(t,n))}}class KH{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new QH(t,this.observables,this.project))}}class QH extends S_{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const i=e.length;this.values=new Array(i);for(let r=0;r0){const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}class ZH{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new JH(t,this.accumulator,this.seed,this.hasSeed))}}class JH extends v{constructor(t,e,n,i){super(t),this.accumulator=e,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}class t${constructor(t){this.predicate=t}call(t,e){return e.subscribe(new e$(t,this.predicate))}}class e$ extends v{constructor(t,e){super(t),this.predicate=e,this.skipping=!0,this.index=0}_next(t){const e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)}tryCallPredicate(t){try{const e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(e){this.destination.error(e)}}}const n$=["youtubeContainer"];let i$=(()=>{class t{constructor(t,e){this._ngZone=t,this._youtubeContainer=new P,this._destroyed=new P,this._playerChanges=new Uf(void 0),this._videoId=new Uf(void 0),this._height=new Uf(390),this._width=new Uf(640),this._startSeconds=new Uf(void 0),this._endSeconds=new Uf(void 0),this._suggestedQuality=new Uf(void 0),this._playerVars=new Uf(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=Lh(e)}get videoId(){return this._videoId.value}set videoId(t){this._videoId.next(t)}get height(){return this._height.value}set height(t){this._height.next(t||390)}get width(){return this._width.value}set width(t){this._width.next(t||640)}set startSeconds(t){this._startSeconds.next(t)}set endSeconds(t){this._endSeconds.next(t)}set suggestedQuality(t){this._suggestedQuality.next(t)}get playerVars(){return this._playerVars.value}set playerVars(t){this._playerVars.next(t)}ngOnInit(){if(!this._isBrowser)return;let t=wd(!0);if(!window.YT||!window.YT.Player){const e=new P;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>e.next(!0))},t=e.pipe(Gp(1),Kd(!1))}const e=function(t,e,n,i,r,s,o){const a=T_([e,s]).pipe(YH(T_([i,r])),D(([t,e])=>{const[n,i]=t,[r,s]=e;return n?{videoId:n,playerVars:i,width:r,height:s}:void 0}));return T_([t,a,wd(o)]).pipe(function(t){return S(function(...t){let e=null;return"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&d(t[0])&&(t=t[0].slice()),n=>n.lift.call(U([n,...t]),new k_(e))}(t),function(t){return e=>e.lift(new t$(t))}(([t,e])=>!e),D(([t])=>t))}(n),function(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new ZH(t,e,n))}}(r$,void 0),Rd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe($f(t=>{this._playerChanges.next(t)}),W(t=>t?s$(t)?wd(t):new C(e=>{let n=!1,i=!1;const r=t=>{i=!0,n||(t.target.removeEventListener("onReady",r),e.next(t.target))};return t.addEventListener("onReady",r),()=>{n=!0,i||(t=>{s$(t)||t.destroy()})(t)}}).pipe(Gp(1),Kd(void 0)):wd(void 0)),Wd(this._destroyed),rt(new P));e.subscribe(t=>{this._player=t,t&&this._pendingPlayerState&&this._initializePlayer(t,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(t,e,n){T_([t,e,n]).subscribe(([t,e,n])=>t&&t.setSize(e,n))}(e,this._width,this._height),function(t,e){T_([t,e]).subscribe(([t,e])=>t&&e&&t.setPlaybackQuality(e))}(e,this._suggestedQuality),function(t,e,n,i,r,s){const o=T_([n,i]).pipe(D(([t,e])=>({startSeconds:t,endSeconds:e}))),a=o.pipe(o$(t,t=>!!t&&!function(t){const e=t.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(t))),l=e.pipe(o$(t,(t,e)=>!!t&&t.videoId!==e));Q(t.pipe(o$(T_([e,o]),([t,e],n)=>!(!n||t==n.videoId&&!e.startSeconds&&!e.endSeconds))),l,a).pipe(YH(T_([t,e,o,r])),D(([t,e])=>e),Wd(s)).subscribe(([t,e,n,i])=>{!e||!t||(t.videoId=e,t.cueVideoById(Object.assign({videoId:e,suggestedQuality:i},n)))})}(e,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),e.connect()}createEventsBoundInZone(){return{}}ngAfterViewInit(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}ngOnDestroy(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,e){this._player?this._player.seekTo(t,e):this._getPendingState().seek={seconds:t,allowSeekAhead:e}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_initializePlayer(t,e){const{playbackState:n,playbackRate:i,volume:r,muted:s,seek:o}=e;switch(n){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=i&&t.setPlaybackRate(i),null!=r&&t.setVolume(r),null!=s&&(s?t.mute():t.unMute()),null!=o&&t.seekTo(o.seconds,o.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Qd(e=>e?XH(n=>{e.addEventListener(t,n)},n=>{try{e.removeEventListener&&e.removeEventListener(t,n)}catch(i){}}):wd()),t=>new C(e=>t.subscribe({next:t=>this._ngZone.run(()=>e.next(t)),error:t=>e.error(t),complete:()=>e.complete()})),Wd(this._destroyed))}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(ou))},t.\u0275cmp=Jt({type:t,selectors:[["youtube-player"]],viewQuery:function(t,e){if(1&t&&qc(n$,5),2&t){let t;Wc(t=Yc())&&(e.youtubeContainer=t.first)}},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(t,e){1&t&&oa(0,"div",null,0)},encapsulation:2,changeDetection:0}),t})();function r$(t,[e,n,i]){if(t&&n&&t.playerVars!==n.playerVars)t.destroy();else{if(!n)return void(t&&t.destroy());if(t)return t}const r=i.runOutsideAngular(()=>new YT.Player(e,n));return r.videoId=n.videoId,r.playerVars=n.playerVars,r}function s$(t){return"getPlayerStatus"in t}function o$(t,e){return S(YH(t),Hd(([t,n])=>e(n,t)),D(([t])=>t))}let a$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function l$(t){return!0===t}function c$(t){return null==t}function u$(t){return!c$(t)}function h$(t){return Boolean(t)}function d$(t){return c$(t)?t:JSON.parse(JSON.stringify(t))}const p$=t=>{const e=t instanceof Date;if("object"!=typeof t||null===t||e)return t;Object.freeze(t);const n="function"==typeof t,i=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(e=>{i.call(t,e)&&(!n||"caller"!==e&&"callee"!==e&&"arguments"!==e)&&null!==t[e]&&("object"==typeof t[e]||"function"==typeof t[e])&&!Object.isFrozen(t[e])&&p$(t[e])}),t};function f$(t){return u$(t)&&"object"==typeof t&&function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)}const g$="NGXS_DATA_META",m$="NGXS_META",b$="NGXS_ARGUMENT_REGISTRY_META";let y$=(()=>{class t{constructor(t){this.sequence$=new Uf(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function v$(t){return t[g$]}let _$=(()=>{class t{constructor(e,n,i){t.store=e.get(pV),t.ngZone=e.get(xu),t.factory=n,t.context=i,t.computed=e.get(y$)}}return t.store=null,t.computed=null,t.context=null,t.factory=null,t.ngZone=null,t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(wB),Ci(_B))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class w${constructor(){w$.statesCachedMeta.clear()}static createStateContext(t){return _$.context.createStateContext(t)}static ensureMappedState(t){if(c$(_$.factory)||c$(t))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(u$(t.name)?w$.statesCachedMeta.get(t.name):null)||w$.ensureMeta(t)}static getRepositoryByInstance(t){var e;const n=null!==(e=v$(w$.getStateClassByInstance(t)))&&void 0!==e?e:null;if(c$(n))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return n}static getStateClassByInstance(t){return(null!=t?t:{}).constructor}static clearMetaByInstance(t){const e=w$.getRepositoryByInstance(t);e.stateMeta.actions={},e.operations={}}static createPayload(t,e){const n={},i=Array.from(t);for(let r=0;r0?n:null}static createAction(t,e,n){const i=w$.createPayload(e,n);return new(function(t){return class{constructor(t){t&&Object.keys(t).forEach(e=>{this[e]=t[e]})}static get type(){return t}}}(t.type))(i)}static ensureMeta(t){var e;const n=u$(t.name)?null===(e=_$.factory.states)||void 0===e?void 0:e.find(e=>e.name===t.name):null;return u$(n)&&u$(t.name)&&w$.statesCachedMeta.set(t.name,n),n}}w$.statesCachedMeta=new Map,w$.\u0275fac=function(t){return new(t||w$)},w$.\u0275prov=xt({token:w$,factory:w$.\u0275fac}),new lp(1);class x$ extends Error{constructor(t){super(`Child states can only be added to an object. Cannot convert ${u$(null==t?void 0:t.constructor)?t.constructor.name:t} to PlainObject`)}}function S$(t){var e;return null!==(e=t.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function E$(t){var e;const n=S$(t),i=null!==(e=n.children)&&void 0!==e?e:[],r=d$(void 0===n.defaults?{}:n.defaults);if(i.length){if(f$(r))return function(t,e){return e.reduce((t,e)=>{const n=S$(e);if(function(t){const e="string"==typeof t?t.trim():t;return[void 0,null,NaN,"",1/0].includes(e)}(n.name))throw new Error("State name not provided in class");return t[n.name.toString()]=E$(e),t},null!=t?t:{})}(r,i);throw new x$(r)}return r}function C$(t){var e;return null!==(e=t.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function O$(){var t,e;return null!==(e=null===(t=null==_$?void 0:_$.computed)||void 0===t?void 0:t.sequenceValue)&&void 0!==e?e:0}function T$(t){let e=!1;return Dd(t)&&(e=!0),e}function k$(t){return t[b$]}class A$ extends Error{constructor(t,e){super(`An argument with the name '${t}' already exists in the method '${e}'`)}}class P${constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(t){var e;return null!==(e=this.payloadMap.get(t))&&void 0!==e?e:null}getArgumentNameByIndex(t){var e;return null!==(e=this.argumentMap.get(t))&&void 0!==e?e:null}createPayloadType(t,e,n){this.checkDuplicateName(t,e),this.payloadMap.set(n,t),this.payloadMap.set(t,t)}createArgumentName(t,e,n){this.checkDuplicateName(t,e),this.argumentMap.set(n,t),this.argumentMap.set(t,t)}checkDuplicateName(t,e){if(h$(this.argumentMap.has(t))||h$(this.payloadMap.has(t)))throw new A$(t,e)}}function I$(t){return Nu()?p$(t):t}function M$(t){return{enumerable:!0,configurable:!0,get(){const e=v$(t),n=w$.ensureMappedState(e.stateMeta);return w$.createStateContext(n)}}}function D$(t){if(!t)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},t),{getState:()=>Nu()?p$(t.getState()):t.getState(),setState(e){t.setState(e)},patchState(e){t.patchState(e)}})}function R$(){return(t,e,n)=>{!function(t,e){if(!function(t,e){var n;let i=t,r=!1;if(f$(i))for(;null!==i;){if(l$(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(n=Object.getOwnPropertyDescriptor(i,e))||void 0===n?void 0:n.get);break}i=Object.getPrototypeOf(i)}return r}(t,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(t,e);const i=n.get;return n.get=function(...t){const e=function(t){return c$(C$(t))&&Object.defineProperties(t,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),C$(t)}(this),n=null==e?void 0:e.get(i);if(l$(null==n?void 0:n.isObservable))return null==n?void 0:n.value;if(c$(n)||n.sequenceId!==O$()){e.delete(i);const n=i.apply(this,t);return e.set(i,{value:n,sequenceId:O$(),isObservable:T$(n)}),n}return n.value},n}}const N$={cancelUncompleted:!0,insideZone:!1};function L$(t=N$){return(e,n,i)=>{!function(t,e){if(t.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=n.toString();return i.value=function(...e){const n=this;let i=null;const o=w$.getRepositoryByInstance(n),a=o.operations;let l=a[s];const c=o.stateMeta,u=k$(r);if(c$(l)){const e=function(t){var e,n,i;return null!==(i=null===(n=null===(e=(t+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===n?void 0:n.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),n=function(t){const{statePath:e,argumentsNames:n,methodName:i,argumentRegistry:r}=t;let s="";for(let o=0;o{var s;return l$(t.insideZone)?null===(s=_$.ngZone)||void 0===s||s.run(()=>{i=r.apply(n,e)}):i=r.apply(n,e),Dd(i)?wd(null).pipe(D(()=>i)):i};const h=w$.createAction(l,e,u),d=_$.store.dispatch(h);return Dd(i)?function(t,e){return hv([t,e]).pipe(D(t=>t.pop()))}(d,i):i},i}}function j$(t){return(e,n,i)=>{const r=t.trim();if(!r)throw new Error("Payload name should be initialized");(function(t,e){const n=t[e];return c$(k$(n))&&Object.defineProperties(n,{[b$]:{enumerable:!0,configurable:!0,value:new P$}}),k$(n)})(e,n).createPayloadType(r,n,i)}}function F$(){return t=>{const e=function(t){if(function(t){return!h$(t)}(t.hasOwnProperty(m$))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,m$,{value:e})}return function(t){var e;return null===(e=t)||void 0===e?void 0:e[m$]}(t)}(t);if(c$(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(t,e){(function(t){var e;const n=null!==(e=v$(t))&&void 0!==e?e:null;return(c$(n)||(null==n?void 0:n.stateClass)!==t)&&function(t){Object.defineProperty(t,g$,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:t}})}(t),v$(t)}(t)).stateMeta=e}(t,e),function(t,e,n){Object.defineProperties(t.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>d$(n)},context:M$(t)})}(t,e,E$(t)),function(t){var e,n;const i=v$(t),r=null!==(n=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==n?n:null;if(u$(r)){const e=`__${r}__selector`;Object.defineProperties(t.prototype,{[e]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(u$(this[e]))return this[e];if(c$(_$.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[e]=_$.store.select(t).pipe(D(t=>Nu()?p$(t):t),up({refCount:!0,bufferSize:1})),this[e]}}})}}(t)}}let B$=(()=>{class t{constructor(){this.browserStorageEvents$=new P,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var e;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(e=this.ngxsDataDoCheck)||void 0===e||e.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var t;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(t=this.ngxsDataDoCheck)||void 0===t||t.call(this))}markAsDirtyAfterReset(){var t;this.dirty=!0,null===(t=this.ngxsDataAfterReset)||void 0===t||t.call(this)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),V$=(()=>{class t extends B${get snapshot(){return I$(this.getState())}get ctx(){return D$(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$(),aw("design:type",Object),aw("design:paramtypes",[])],t.prototype,"snapshot",null),sw([L$(),ow(0,j$("patchValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"patchState",null),sw([L$(),ow(0,j$("stateValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"setState",null),sw([L$(),aw("design:type",Function),aw("design:paramtypes",[]),aw("design:returntype",void 0)],t.prototype,"reset",null),t})(),z$=(()=>{class t extends B${get snapshot(){return I$(this.getState())}get ctx(){return D$(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$(),aw("design:type",Object),aw("design:paramtypes",[])],t.prototype,"snapshot",null),sw([L$(),ow(0,j$("patchValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"patchState",null),sw([L$(),ow(0,j$("stateValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"setState",null),sw([L$(),aw("design:type",Function),aw("design:paramtypes",[]),aw("design:returntype",void 0)],t.prototype,"reset",null),t})();const U$=new oi("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),H$=new oi("ngx-window",{providedIn:"root",factory:()=>function(t){return Lh(t)?window:null}(Oi(ou))}),$$=new oi("ngx-data-layer",{providedIn:"root",factory:()=>function(t){return t?t.dataLayer=t.dataLayer||[]:null}(Oi(H$))}),G$=new oi("ngx-gtag-fn",{providedIn:"root",factory:()=>function(t,e){return t?t.gtag=t.gtag||function(){e.push(arguments)}:null}(Oi(H$),Oi($$))});let W$=(()=>{class t{constructor(t,e,n){this.settings=t,this._document=e,this._gtag=n}get document(){return this._document}throw(t){(this.settings.enableTracing||Nu())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((t,[e,n])=>Object.defineProperty(t,e,{value:n,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(t=>void 0!==t))}catch(e){this.throw(e)}}event(t,e,n,i,r){try{const s=new Map;e&&s.set("event_category",e),n&&s.set("event_label",n),i&&s.set("value",i),void 0!==r&&s.set("interaction",r);const o=this.toKeyValue(s);o?this.gtag("event",t,o):this.gtag("event",t)}catch(s){this.throw(s)}}pageView(t,e,n,i){try{const r=new Map([["page_path",t]]);e&&r.set("page_title",e),(n||this.document)&&r.set("page_location",n||this.document.location.href),i&&Object.entries(i).map(([t,e])=>r.set(t,e)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(r))}catch(r){this.throw(r)}}appView(t,e,n,i,r){try{const s=new Map([["screen_name",t],["app_name",e]]);n&&s.set("app_id",n),i&&s.set("app_version",i),r&&s.set("app_installer_id",r),this.gtag("event","screen_view",this.toKeyValue(s))}catch(s){this.throw(s)}}set(...t){try{this._gtag("set",...t)}catch(e){this.throw(e)}}exception(t,e){try{const n=new Map;t&&n.set("description",t),e&&n.set("fatal",e),this.toKeyValue(n)?this.gtag("event","exception",this.toKeyValue(n)):this.gtag("event","exception")}catch(n){this.throw(n)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(U$),Ci(Yu),Ci(G$))},t.\u0275prov=xt({factory:function(){return new t(Ci(U$),Ci(Yu),Ci(G$))},token:t,providedIn:"root"}),t})();const q$={provide:tu,multi:!0,useFactory:function(t,e,n){return()=>lw(this,void 0,void 0,function*(){var i;if(!t.trackingCode)return void(Nu()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Nu()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));n||Nu()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),t.uri=t.uri||`https://www.googletagmanager.com/gtag/js?id=${t.trackingCode}`,t.initCommands=null!==(i=null==t?void 0:t.initCommands)&&void 0!==i?i:[],t.initCommands.find(t=>"config"===t.command)||t.initCommands.unshift({command:"config",values:[t.trackingCode]}),t.initCommands.find(t=>"js"===t.command)||t.initCommands.unshift({command:"js",values:[new Date]});for(const n of t.initCommands)e(n.command,...n.values);const r=n.createElement("script");r.async=!0,r.src=t.uri,t.nonce&&r.setAttribute("nonce",t.nonce),n.getElementsByTagName("head")[0].appendChild(r)})},deps:[U$,G$,Yu]};new oi("ngx-google-analytics-routing-settings",{factory:()=>({})});let X$=(()=>{class t{static forRoot(e,n=[],i,r,s){return{ngModule:t,providers:[{provide:U$,useValue:{trackingCode:e,initCommands:n,uri:i,enableTracing:r,nonce:s}},q$]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[]]}),t})(),Y$=(()=>{class t{constructor(){this.consent="not-set",this.consentChange=new lp(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),K$=(()=>{class t{constructor(t,e,{trackingCode:n}){this.window=e,this.subscriptions=new g,this.token=n,this.subscriptions.add(t.consentChange.subscribe(t=>this.toggleGoogleAnalytics("rescinded"===t)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Y$),Ci(H$),Ci(U$))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Q$=new oi("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),Z$=[Y$,K$,(()=>{class t{constructor(t,e){this.key=e,this.subscriptions=new g;try{this.storage=localStorage}catch(n){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(t=>this.saveConsent(t)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,e;const n=null===(e=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===e?void 0:e.call(t,this.key);if(null==n)return"not-set";const i=n.trim().toLowerCase();switch(i){case"given":case"rescinded":return i;default:return"not-set"}}saveConsent(t){var e,n;null===(n=null===(e=this.storage)||void 0===e?void 0:e.setItem)||void 0===n||n.call(e,this.key,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Y$),Ci(Q$))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})()];function J$(t){return Object.entries(t).reduce((t,[e,n])=>(null!=n&&(t[e]=`${n}`),t),{})}let tG=(()=>{class t{static forRoot(e){const{providers:n=[]}=X$.forRoot(e.gaToken,function(t){const{appName:e,projectName:n,developmentMode:i}=t;return[{command:"set",values:[J$({appName:e,projectName:n,developmentMode:i})]}]}(e));return{ngModule:t,providers:n}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[...Z$,{provide:tu,multi:!0,useFactory:()=>()=>{},deps:Z$}],imports:[[X$]]}),t})();const eG=["bodyCanvas"];let nG=(()=>{class t{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Rc,this.nodeDrag=new Rc,this.nodeClick=new Rc,this.nodeHoverStart=new Rc,this.nodeHoverStop=new Rc,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var e;this._scene=t,null===(e=this.bodyUI)||void 0===e||e.setScene(t)}get rotation(){return this._rotation}set rotation(t){var e;this._rotation=t,null===(e=this.bodyUI)||void 0===e||e.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var e;this._rotationX=t,null===(e=this.bodyUI)||void 0===e||e.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var e;this._zoom=t,null===(e=this.bodyUI)||void 0===e||e.setZoom(t)}get target(){return this._target}set target(t){var e;this._target=t,null===(e=this.bodyUI)||void 0===e||e.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,e={x:48,y:48}){if(this.bodyCanvas){const{width:n,height:i}=this.bodyCanvas.nativeElement,r=window.devicePixelRatio,s=Math.min(Math.log2((n-e.x)/r/t.x),Math.log2((i-e.y)/r/t.y));this.zoom=s}}setupBodyUI(){var t;return lw(this,void 0,void 0,function*(){const e=this.bodyCanvas.nativeElement,n=new dB({id:"body-ui",canvas:e,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});e.addEventListener("contextmenu",t=>t.preventDefault()),yield n.initialize(),this.bodyUI=n,window.bodyUI=n,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(t=>this.rotationChange.next(t)),this.bodyUI.nodeDrag$.subscribe(t=>this.nodeDrag.emit(t)),this.bodyUI.nodeClick$.subscribe(t=>this.nodeClick.emit(t)),this.bodyUI.nodeHoverStart$.subscribe(t=>this.nodeHoverStart.emit(t)),this.bodyUI.nodeHoverStop$.subscribe(t=>this.nodeHoverStop.emit(t))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-body-ui"]],viewQuery:function(t,e){if(1&t&&qc(eG,5,kl),2&t){let t;Wc(t=Yc())&&(e.bodyCanvas=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,e){1&t&&oa(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),t})(),iG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})();new oi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const rG=["carouselContainer"],sG=["itemlist"],oG=["itemcontainer"];function aG(t,e){if(1&t&&(ra(0,"div",14),Za(1),sa()),2&t){const t=va().$implicit,e=va();ws(1),Ja(e.occurenceData[t.id]||0)}}function lG(t,e){if(1&t){const t=ua();ra(0,"div",9),fa("click",function(){const e=$e(t).$implicit;return va().selectOrgan(e)}),oa(1,"mat-icon",10),ra(2,"div",11),ra(3,"div",12),Za(4),sa(),Jo(5,aG,2,1,"div",13),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ja("disabled",t.disabled)("selected",n.isSelected(t)),ws(1),Sa("svgIcon",t.src),ws(3),Ja(t.name),ws(1),na("ngIf",void 0!==t.numResults)}}const cG=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}],uG=cG.filter(t=>!0!==t.disabled);let hG=(()=>{class t{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=uG,this.selectedOrgans=[],this.organsChanged=new Rc,this.onLeft=!0,this.onRight=!1,this.step=72}set occurenceData(t){this._occurenceData=t}get occurenceData(){return this._occurenceData}ngAfterViewInit(){const{carouselContainer:t}=this;this.sensor=new HU.ResizeSensor(t.nativeElement,()=>{this.set()})}ngOnChanges(t){"organList"in t&&this.set()}ngOnDestroy(){this.sensor.detach()}get error(){return!(!this.displayErrors||0===this.selectedOrgans.length)}shift(t){const{itemList:e}=this;let n=parseInt(e.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(n="right"===t?n-this.step:n+this.step,e.nativeElement.style.left=n+"px",this.setLeftRight(n))}scroll(t){this.timeoutHandler=setInterval(()=>{this.shift(t)},200)}stopScroll(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}selectOrgan(t){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(t)?this.selectedOrgans.filter(e=>t!==e):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:e,carouselContainer:n}=this,i=parseInt(t.nativeElement.style.left,10)||0;if(t.nativeElement.offsetWidth>=this.organList.length*this.step)t.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(i);const t=this.step*Math.floor(n.nativeElement.offsetWidth/this.step)-64;e.nativeElement.style.width=`${t}px`}}setWidth(){const{itemContainer:t,carouselContainer:e}=this,n=this.step*Math.floor(e.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${n}px`}setLeftRight(t){const{itemContainer:e}=this;this.onLeft=0===t,this.onRight=t<=e.nativeElement.offsetWidth-this.organList.length*this.step}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-organ-selector"]],viewQuery:function(t,e){if(1&t&&(qc(rG,7),qc(sG,7),qc(oG,7)),2&t){let t;Wc(t=Yc())&&(e.carouselContainer=t.first),Wc(t=Yc())&&(e.itemList=t.first),Wc(t=Yc())&&(e.itemContainer=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[ye],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(t,e){1&t&&(ra(0,"div",0,1),ra(2,"mat-icon",2),fa("touchstart",function(){return e.scroll("left")})("touchend",function(){return e.stopScroll()})("click",function(){return e.shift("left")})("mousedown",function(){return e.scroll("left")})("mouseup",function(){return e.stopScroll()}),Za(3,"chevron_left"),sa(),ra(4,"div",3,4),ra(6,"div",5,6),Jo(8,lG,6,7,"div",7),sa(),sa(),ra(9,"mat-icon",8),fa("touchstart",function(){return e.scroll("right")})("touchend",function(){return e.stopScroll()})("click",function(){return e.shift("right")})("mousedown",function(){return e.scroll("right")})("mouseup",function(){return e.stopScroll()}),Za(10,"chevron_right"),sa(),sa()),2&t&&(ja("error",e.error),na("matTooltipDisabled",e.multiselect),ws(2),ja("disabled",e.onLeft),ws(6),na("ngForOf",e.organList),ws(1),ja("disabled",e.onRight))},directives:[ew,p_,yh,_h],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),t})(),dG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,rw]]}),t})(),pG=(()=>{class t{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Rc,this.visibilityToggle=new Rc,this.opacityReset=new Rc}ngOnInit(){this.prevOpacity=this.visible?0:20}reset(){this.prevOpacity=20}changeOpacity(t){this.opacity=parseInt(t,10),this.opacityChange.emit(this.opacity)}toggleVisibility(){const t=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=t,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}resetOpacity(){this.prevOpacity=0,this.opacityReset.emit()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"mat-slider",2),fa("input",function(t){return e.changeOpacity(t.value)}),sa(),ra(3,"span",3),Za(4),sa(),sa(),ra(5,"div",4),ra(6,"mat-icon",5),fa("click",function(){return e.toggleVisibility()}),sa(),ra(7,"mat-icon",6),fa("click",function(){return e.toggleVisibility()}),sa(),ra(8,"mat-icon",7),fa("click",function(){return e.resetOpacity()}),Za(9,"refresh"),sa(),sa(),sa()),2&t&&(ws(2),ja("disabled",!e.visible),na("step",1)("min",0)("max",100)("value",e.opacity),ws(2),tl("",e.opacity,"%"),ws(2),ja("hidden",e.visible),na("matRippleCentered",!0)("matRippleUnbounded",!0),ws(1),ja("hidden",!e.visible),na("matRippleCentered",!0)("matRippleUnbounded",!0),ws(1),na("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[YU,p_,Yy],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})(),fG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,JU,Ky]]}),t})();function gG(t,e){if(1&t&&(ra(0,"div",15),oa(1,"youtube-player",16),sa()),2&t){const t=va(3);ws(1),Sa("videoId",t.videoID)}}function mG(t,e){if(1&t&&(ra(0,"mat-expansion-panel",10),ra(1,"mat-expansion-panel-header"),ra(2,"h2",11),Za(3),sa(),sa(),ra(4,"div",12),oa(5,"markdown",13),Jo(6,gG,2,1,"div",14),sa(),sa()),2&t){const t=va(),e=t.index,n=t.$implicit;na("expanded",0===e),ws(3),Ja(n.title),ws(2),ja("first",0===e),na("data",n.content),ws(1),na("ngIf",0===e)}}function bG(t,e){if(1&t&&(ra(0,"div",8),Jo(1,mG,7,6,"mat-expansion-panel",9),sa()),2&t){const t=e.$implicit;ws(1),na("ngIf",t)}}let yG=(()=>{class t{constructor(t,e){this.dialogRef=t,this.data=e,this.documentationContents=e.content||[],this.infoTitle=e.title||"",this.videoID=e.videoID}ngOnInit(){const t=document.createElement("script");t.src="https://www.youtube.com/iframe_api",document.body.appendChild(t)}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return t.\u0275fac=function(e){return new(e||t)(ea(oH),ea(lH))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),ra(3,"mat-icon",3),fa("click",function(){return e.close()}),Za(4,"clear"),sa(),sa(),ra(5,"div",4),ra(6,"h2",5),Za(7),sa(),ra(8,"mat-dialog-content",6),Jo(9,bG,2,1,"div",7),sa(),sa(),sa(),sa()),2&t&&(ws(7),Ja(e.infoTitle),ws(2),na("ngForOf",e.documentationContents))},directives:[p_,gH,mH,yh,_h,NH,FH,WH,i$],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),t})(),vG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,bH,f_,BH,a$,qH.forRoot({})]]}),t})(),_G=(()=>{class t{constructor(t){this.http=t,this.markdownContent=new Uf([])}readMarkdown(){this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(t=>{const e=this.parseMarkdown(t);this.markdownContent.next(e)})}parseMarkdown(t){const e=[],n=t.split("# ");for(const i of n)if(i.length){const t=i.split("\n\n");e.push({title:t[0],content:t.splice(1).join("\n\n")})}return e}}return t.\u0275fac=function(e){return new(e||t)(Ci(Bv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),wG=(()=>{class t{constructor(t,e){this.dialog=t,this.infoButtonService=e,this.infoTitle="",this.subscriptions=new g,this.subscriptions.add(e.markdownContent.subscribe(t=>{t.length&&this.launchInfoDialog(t)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){this.dialog.open(yG,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:t,videoID:this.videoID}})}onDialogButtonClick(){this.infoButtonService.readMarkdown()}}return t.\u0275fac=function(e){return new(e||t)(ea(pH),ea(_G))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"mat-icon",1),fa("click",function(){return e.onDialogButtonClick()}),Za(2," info "),sa(),sa())},directives:[p_],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),t})(),xG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,vG,f_,Zv]]}),t})(),SG=(()=>{let t=class extends z${constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Hd(t=>null!=t),up(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(FU(...t),Rd(),up(1))}getOption(...t){const e=this.getPathKey(t);if(this.optionCache.has(e))return this.optionCache.get(e);const n=this.config$.pipe(FU(...t),Rd(),up(1));return this.optionCache.set(e,n),n}getPathKey(t){return`${t.length}:${t.join(".")}`}};return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$()],t.prototype,"config$",null),t=sw([F$(),wV({name:"globalConfig",defaults:null})],t),t})();!function(){const t=localStorage.getItem("ALLOW_TELEMETRY");null===t||t.toLowerCase()}();let EG=(()=>{class t{constructor(t,e){t&&function(t,e){xd(t,"mousemove").pipe(function(t,e=jd,n=BU){return i=>i.lift(new VU(t,e,n.leading,n.trailing))}(1e3),D(e=>{const{clientWidth:n,clientHeight:i}=t,{clientX:r,clientY:s}=e;return[r,s,n,i].join("_")})).subscribe(t=>e.event("webpage","mousemove",t))}(t.body,e)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(W$))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function CG(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!0)}),Za(1),sa()}if(2&t){const t=va();ws(1),tl(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function OG(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!1)}),Za(1,"Opt out"),sa()}}let TG=(()=>{class t{constructor(t,e,n){this.consentService=e,this.data=n,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}get allowTelemetry(){return this.consentService.consent}dismiss(){this.data.preClose()}submit(t){this.consentService.setConsent(t?"given":"rescinded"),this.dismiss()}showButton(t){const{allowTelemetry:e}=this;return"not-set"===e||("opt-in"===t?"rescinded"===e:"given"===e)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Y$),ea(F_))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,e){1&t&&(ra(0,"p"),Za(1,"We log usage to improve this service."),sa(),Jo(2,CG,2,1,"button",0),Jo(3,OG,2,0,"button",0)),2&t&&(ws(2),na("ngIf",e.showButton("opt-in")),ws(1),na("ngIf",e.showButton("opt-out")))},directives:[_h,__],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),t})(),kG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_]]}),t})();const AG=new oi("Default theme class"),PG="light-theme",IG="dark-theme";let MG=(()=>{class t{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(e){const{injector:n,location:i}=e;n.get(t).initialize(i,n)}getTheme(){return this.theme}setTheme(t){t!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(t),this.theme=t)}resetTheme(){this.setTheme(this.defaultTheme)}initialize(t,e){this.element=t,this.injector=e,this.applyThemeClass(this.getTheme())}applyThemeClass(t,e="add"){var n;const{element:i,injector:r}=this;if(!t||!i||!r)return;const s=r.get(Il,null);if(!s)return;const o=i.nativeElement,a=null===(n=r.get(gf,null))||void 0===n?void 0:n.getContainerElement(),l="add"===e?"addClass":"removeClass";s[l](o,t),a&&s[l](a,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(AG,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();var DG;const RG={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["assets/kpmp/data/rui_locations.jsonld","assets/sparc/data/rui_locations.jsonld","assets/gtex/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(DG=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==DG?DG:"",useRemoteApi:!0,remoteApiEndpoint:"https://ccf-api.herokuapp.com/v1"},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"},NG=["*",[["mat-toolbar-row"]]],LG=["*","mat-toolbar-row"],jG=jy(class{constructor(t){this._elementRef=t}});let FG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]}),t})(),BG=(()=>{class t extends jG{constructor(t,e,n){super(t),this._platform=e,this._document=n}ngAfterViewInit(){this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(()=>this._checkToolbarMixedModes()))}_checkToolbarMixedModes(){}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(Yu))},t.\u0275cmp=Jt({type:t,selectors:[["mat-toolbar"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,FG,5),2&t){let t;Wc(t=Yc())&&(e._toolbarRows=t)}},hostAttrs:[1,"mat-toolbar"],hostVars:4,hostBindings:function(t,e){2&t&&ja("mat-toolbar-multiple-rows",e._toolbarRows.length>0)("mat-toolbar-single-row",0===e._toolbarRows.length)},inputs:{color:"color"},exportAs:["matToolbar"],features:[jo],ngContentSelectors:LG,decls:2,vars:0,template:function(t,e){1&t&&(wa(NG),xa(0),xa(1,1))},styles:[".cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}\n"],encapsulation:2,changeDetection:0}),t})(),VG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny],Ny]}),t})(),zG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,VG,rw]]}),t})();function UG(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}let HG;function $G(){return HG||(HG=function(t,e){const n=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let t;return new Promise(e=>{const n=()=>indexedDB.databases().finally(e);t=setInterval(n,100),n()}).finally(()=>clearInterval(t))}().then(()=>{const t=indexedDB.open("keyval-store");return t.onupgradeneeded=()=>t.result.createObjectStore(e),UG(t)});return(t,i)=>n.then(n=>i(n.transaction(e,t).objectStore(e)))}(0,"keyval")),HG}function GG(t,e=$G()){return e("readonly",e=>UG(e.get(t)))}var WG=n(71440),qG=n(70698),XG=n(7445),YG=n.n(XG),KG=n(23815),QG=n(31609);const ZG=WG.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},WG.DataFactory),JG={x:ZG("rdf"),type:ZG("rdf")("type")},tW={x:ZG("rdfs"),label:ZG("rdfs")("label"),comment:ZG("rdfs")("comment"),isDefinedBy:ZG("rdfs")("isDefinedBy"),seeAlso:ZG("rdfs")("seeAlso")},eW={x:ZG("entity"),id:ZG("entity")("id"),label:tW.label,description:tW.comment,link:tW.seeAlso,sex:ZG("entity")("sex"),age:ZG("entity")("age"),bmi:ZG("entity")("bmi"),Male:WG.DataFactory.literal("Male"),Female:WG.DataFactory.literal("Female"),consortiumName:ZG("entity")("consortium_name"),providerName:ZG("entity")("provider_name"),providerUUID:ZG("entity")("provider_uuid"),donor:ZG("entity")("has_donor"),sections:ZG("entity")("has_tissue_section"),datasets:ZG("entity")("has_dataset"),sampleType:ZG("entity")("sample_type"),TissueBlock:WG.DataFactory.literal("Tissue Block"),TissueSection:WG.DataFactory.literal("Tissue Section"),NonStandard:WG.DataFactory.literal("Non-standard"),sectionCount:ZG("entity")("section_count"),sectionSize:ZG("entity")("section_size"),sectionUnits:ZG("entity")("section_units"),sectionNumber:ZG("entity")("section_number"),spatialEntity:ZG("entity")("has_spatial_entity"),ontologyTerms:ZG("entity")("has_ontology_term"),technology:ZG("entity")("technology"),thumbnail:ZG("entity")("has_thumbnail")},nW=ZG("ccf"),iW={x:nW,ontologyNode:{label:nW("ccf_preferred_label"),parent:nW("ccf_part_of"),children:nW("ccf_part_of"),rui_rank:nW("ccf_rui_rank"),synonymLabels:WG.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:nW("VHFemale"),Male:nW("VHMale"),BothSexes:nW("VHBothSexes"),FemaleOrgans:nW("VHFemaleOrgans"),MaleOrgans:nW("VHMaleOrgans")},SpatialObjectReference:nW("SpatialObjectReference"),SpatialEntity:nW("SpatialEntity"),SpatialPlacement:nW("SpatialPlacement"),spatialObjectReference:{file:nW("has_object_file"),file_format:nW("has_object_file_format"),file_subpath:nW("has_object_file_subpath")},extractionSet:{label:tW.label,rui_rank:nW("ccf_rui_rank")},spatialEntity:{label:tW.label,comment:tW.comment,creator:ZG("dc")("creator"),creator_first_name:nW("creator_first_name"),creator_last_name:nW("creator_last_name"),creator_orcid:nW("creator_orcid"),creation_date:nW("creation_date"),updated_date:nW("updated_date"),ccf_annotations:nW("ccf_annotation"),representation_of:nW("ccf_representation_of"),reference_organ:nW("anatomical_structure_of"),extraction_set_for:nW("extraction_set_for"),extraction_set:nW("extraction_site_for"),sex:nW("has_sex"),side:nW("has_side"),rui_rank:nW("ccf_rui_rank"),slice_thickness:nW("ccf_slice_thickness"),slice_count:nW("ccf_slice_count"),x_dimension:nW("has_x_dimension"),y_dimension:nW("has_y_dimension"),z_dimension:nW("has_z_dimension"),dimension_units:nW("has_dimension_units"),object:nW("has_object_reference")},spatialPlacement:{source:nW("has_placement_source"),target:nW("has_placement_target"),placement_date:nW("has_placement_date"),x_scaling:nW("has_x_scaling"),y_scaling:nW("has_y_scaling"),z_scaling:nW("has_z_scaling"),scaling_units:nW("has_scaling_units"),x_rotation:nW("has_x_rotation"),y_rotation:nW("has_y_rotation"),z_rotation:nW("has_z_rotation"),w_rotation:nW("has_theta_rotation"),rotation_order:nW("has_rotation_order"),rotation_units:nW("has_rotation_units"),x_translation:nW("has_x_translation"),y_translation:nW("has_y_translation"),z_translation:nW("has_z_translation"),translation_units:nW("has_translation_units")}},rW={x:ZG("uberon")},sW=(ZG("lmha"),{bladder:rW.x("0001255"),body:rW.x("0013702"),brain:rW.x("0000955"),colon:rW.x("0001155"),heart:rW.x("0000948"),kidney:rW.x("0002113"),large_intestine:rW.x("0000059"),left_kidney:rW.x("0004538"),left_lung:rW.x("0002168"),left_ureter:rW.x("0001223"),liver:rW.x("0002107"),lung:rW.x("0002048"),respiratory_system:rW.x("0001004"),lymph_node:rW.x("0000029"),pelvis:rW.x("0001270"),rectum:rW.x("0001052"),right_kidney:rW.x("0004539"),right_lung:rW.x("0002167"),right_ureter:rW.x("0001222"),skin:rW.x("0002097"),small_intestine:rW.x("0002108"),spleen:rW.x("0002106"),thymus:rW.x("0002370"),ureter:rW.x("0000056"),vasculature:rW.x("0002049")});function oW(t){const e={};return Object.entries(t).forEach(([t,n])=>{e[n.id]=t}),e}const aW={spatialObjectReference:oW(iW.spatialObjectReference),spatialEntity:oW(iW.spatialEntity),spatialPlacement:oW(iW.spatialPlacement)};function lW(t,e,n,i){const r={"@id":e,"@type":n};return t.some(t=>{const e=i[t.predicate.id];if(e){const n="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(r,e,n)}return!1},WG.DataFactory.namedNode(e),null,null,null),r}const cW=(0,KG.memoize)(function(t,e){return lW(t,e,"SpatialObjectReference",aW.spatialObjectReference)},(t,e)=>e),uW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"ExtractionSet",aW.spatialEntity);return n.extractionSites=(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.extraction_set,e,null).map(e=>fW(t,e.id)),["rui_rank"]),n},(t,e)=>e),hW=(0,KG.memoize)(function(t,e){return(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.extraction_set_for,e,null).map(e=>uW(t,e.id)),["rui_rank"])},(t,e)=>e),dW=(0,KG.memoize)(function(t,e){return(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.reference_organ,e,null).map(e=>fW(t,e.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(t,e)=>e),pW=(0,KG.memoize)(function(t){const e=[];return t.forEach(n=>{n.subject.id===n.object.id&&e.push(fW(t,n.subject.id))},null,iW.spatialEntity.reference_organ,null,null),(0,KG.sortBy)(e,["rui_rank"])}),fW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"SpatialEntity",aW.spatialEntity);return n.object&&(n.object=cW(t,n.object)),n.ccf_annotations&&(n.ccf_annotations=t.getObjects(e,iW.spatialEntity.ccf_annotations,null).map(t=>t.id)),t.forSubjects(t=>n.entityId=t.id,eW.spatialEntity,e,null),n},(t,e)=>e),gW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"SpatialPlacement",aW.spatialPlacement);return n.source&&(n.source=fW(t,n.source)),n.target&&(n.target=fW(t,n.target)),n},(t,e)=>e),mW=(0,KG.memoize)(function(t,e){const n=t.getObjects(WG.DataFactory.namedNode(e),eW.spatialEntity,null);if(n.length>0)return fW(t,n[0].id)},(t,e)=>e);function bW(t,e){const n=e;let i;switch(n.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[n.x_translation,n.y_translation,n.z_translation].map(t=>t*i),s=[n.x_rotation,n.y_rotation,n.z_rotation].map(NS),o=[n.x_scaling,n.y_scaling,n.z_scaling];return t.translate(r).rotateXYZ(s).scale(o)}class yW{constructor(t){this.db=t,this.createGraph()}createGraph(){this.graph=new qG.DirectedGraph;const t=this.db.store;t.forSubjects(t=>{this.addNode(t.id,"SpatialObjectReference")},JG.type,iW.SpatialObjectReference,null),t.forSubjects(t=>{this.addNode(t.id,"SpatialEntity")},JG.type,iW.SpatialEntity,null);const e={};t.some(t=>(e[t.subject.id]=t.object.id,!1),null,iW.spatialPlacement.source,null,null),t.some(t=>{const n=e[t.subject.id];return n&&this.addEdge(t.subject.id,n,t.object.id,"SpatialPlacement"),!1},null,iW.spatialPlacement.target,null,null)}addNode(t,e){this.graph.mergeNode(t,{type:e})}addEdge(t,e,n,i){this.graph.mergeDirectedEdge(e,n,{type:i,id:t})}getTransformationMatrix(t,e){if(t===e)return new bT(bT.IDENTITY);if(!this.graph.hasNode(t)||!this.graph.hasNode(e))return;const n=this.db.store,i=new bT(bT.IDENTITY),r=YG()(this.graph,t,e);if(r&&r.length>0){r.reverse();let t="";for(const e of r){if(t){const r=this.graph.getEdgeAttribute(e,t,"id");bW(i,gW(n,r))}t=e}return i}}}class vW{constructor(t){this.db=t}getSpatialEntity(t){return fW(this.db.store,t)}getExtractionSets(t){return hW(this.db.store,t)}getExtractionSet(t){return uW(this.db.store,t)}getAnatomicalStructures(t){return dW(this.db.store,t)}getReferenceOrgans(){return pW(this.db.store)}getReferenceBody(t){let e;switch(null==t?void 0:t.sex){case"Male":e=iW.spatial.Male.id;break;case"Female":e=iW.spatial.Female.id;break;case"Both":default:e=iW.spatial.BothSexes.id}return this.getSpatialEntity(e)}getReferenceOrganSets(t){let e=this.getReferenceOrgans();switch(null==t?void 0:t.sex){case"Male":e=e.filter(t=>"Male"===t.sex);break;case"Female":e=e.filter(t=>"Female"===t.sex)}return(null==t?void 0:t.debug)&&(e=e.map(t=>[[t],this.getAnatomicalStructures(t["@id"])]).reduce((t,[e,n])=>t.concat(n.length>0?n:e),[])),e}getReferenceSceneNodes(t){const e=this.getReferenceBody(t);let n=[...this.getReferenceOrganSets(t).map(t=>{const n="http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of;return this.getSceneNode(t,e,{color:[255,255,255,255],opacity:n?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!n})})];return(null==t?void 0:t.debug)&&(n=n.concat([this.getSceneNode(this.getSpatialEntity(iW.x("VHRightKidney").id),e,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHLeftKidney").id),e,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC1").id),e,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC2").id),e,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC3").id),e,{color:[0,255,0,127.5],wireframe:!0})])),n.filter(t=>void 0!==t)}getReferenceOrganScene(t,e){var n,i;const r=null!==(n=void 0!==(null==e?void 0:e.sex))&&void 0!==n&&n,s=this.getReferenceOrgans().filter(n=>n.representation_of===t&&(!r||n.sex===(null==e?void 0:e.sex)));if(s.length>0){const t=s[0],n=this.getSceneNode(t,t,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),r=(null!==(i=this.db.getSpatialEntities(e))&&void 0!==i?i:[]).map(e=>this.getSceneNode(e,t,{color:[255,255,255,229.5]}));return[n].concat(r).filter(t=>void 0!==t)}return[]}getEntitySceneNodes(t){const e=this.getReferenceBody(t);return this.db.getSpatialEntities(t).map(t=>this.getSceneNode(t,e,{color:[255,255,255,229.5]})).filter(t=>void 0!==t)}getSceneNode(t,e,n={}){var i,r,s,o;const a=null===(r=null===(i=null==t?void 0:t.object)||void 0===i?void 0:i.file_format)||void 0===r?void 0:r.startsWith("model/gltf");let l=this.db.graph.getTransformationMatrix(a&&t.object?t.object["@id"]:t["@id"],e["@id"]);if(l){if(a)l=new bT(bT.IDENTITY).rotateX(NS(90)).multiplyLeft(l);else{let e;switch(t.dimension_units){case"centimeter":e=.01;break;case"millimeter":e=.001;break;case"meter":default:e=1}const n=[t.x_dimension,t.y_dimension,t.z_dimension].map(t=>t*e/2);l.scale(n)}return Object.assign({"@id":t["@id"],"@type":"SpatialSceneNode",entityId:t.entityId,ccf_annotations:t.ccf_annotations,representation_of:t.representation_of,reference_organ:t.reference_organ,scenegraph:a?null===(s=t.object)||void 0===s?void 0:s.file:void 0,scenegraphNode:a?null===(o=t.object)||void 0===o?void 0:o.file_subpath:void 0,transformMatrix:l,tooltip:t.label},n)}}getScene(t){return[...this.getReferenceSceneNodes(t),...this.getEntitySceneNodes(t)]}}const _W="https://entity.api.hubmapconsortium.org/entities/",wW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),xW={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},SW={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},EW=function(){const t={};return Object.entries(sW).forEach(([e,n])=>t[e]=n.id),t}(),CW={BL:[EW.body,EW.bladder],RK:[EW.body,EW.kidney,EW.right_kidney],LK:[EW.body,EW.kidney,EW.left_kidney],HT:[EW.body,EW.heart],LI:[EW.body,EW.large_intestine,EW.colon],SI:[EW.body,EW.small_instestine],LL:[EW.body,EW.respiratory_system,EW.lung,EW.left_lung],RL:[EW.body,EW.respiratory_system,EW.lung,EW.right_lung],LY:[EW.body,EW.lymph_node],SP:[EW.body,EW.spleen],TH:[EW.body,EW.thymus],UR:[EW.body,EW.ureter],LV:[EW.body,EW.liver],OT:[EW.body]},OW={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class TW{constructor(t,e="",n="",i){var r,s;if(this.data=t,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const o=this.data.descendants||[],a=(this.data.ancestors||[]).find(t=>"Donor"===t.entity_type);this.donor=this.getDonor(a,n);const l=this.getRuiLocation(t,this.donor);l?this.rui_location=l:this.bad=!0;const c=new Date(t.last_modified_timestamp).toLocaleDateString(),u=SW[t.group_uuid]||t.group_name,h=t.created_by_user_displayname;this["@id"]=_W+t.uuid,this.label=`Registered ${c}, ${h}, ${u}`,this.link=`${n}browse/sample/${t.uuid}`;const d={},p=[];this.sections=p;const f=[];this.datasets=f;for(const v of o.filter(t=>"Sample"===t.entity_type)){const e=this.getSection(v,t,n);d[v.submission_id]=e,p.push(e),e.section_number=null!==(r=e.section_number)&&void 0!==r?r:p.length}for(const v of o)if("Dataset"===v.entity_type){const t=this.getDataset(v,e,n,i),r=(0,KG.get)(v,["ingest_metadata","metadata","tissue_id"]);d[r]?null===(s=d[r].datasets)||void 0===s||s.push(t):f.push(t)}const g=null!=l?l:{},m=`${g.x_dimension} x ${g.y_dimension} x ${g.z_dimension} ${g.dimension_units}`;this.section_count=g.slice_count||p.length;const b=parseFloat((g.slice_thickness||(g.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=b;const y=g.dimension_units||"millimeter";this.section_units=y,this.description=`${m}, ${b} ${y}, ${t.specimen_type}, ${this.section_count} Sections`,p.forEach((t,e)=>{t.description=`${g.x_dimension} x ${g.y_dimension} x ${b} ${y}, ${b} ${y}, ${t.description}`,t.section_number=e+1})}getSection(t,e,n){const i=new Date(t.last_modified_timestamp).toLocaleDateString();return{"@id":_W+t.uuid,"@type":"Sample",label:`Registered ${i}, ${t.created_by_user_displayname}, ${SW[t.group_uuid]||t.group_name}`,description:`${e.specimen_type}`,link:`${n}browse/sample/${t.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(t,e="",n="",i){var r;const s=new Date(t.last_modified_timestamp).toLocaleDateString(),o=SW[t.group_uuid]||t.group_name,a=t.created_by_user_displayname,l=[...t.data_types,(0,KG.get)(t,["ingest_metadata","metadata","assay_type"],"")],c=l.join("|").toLowerCase();let u,h="assets/icons/ico-unknown.svg";return-1!==c.indexOf("10x")?(u="10x",h="assets/icons/ico-bulk-10x.svg"):-1!==c.indexOf("af")?(u="AF",h="assets/icons/ico-spatial-af.svg"):-1!==c.indexOf("codex")?(u="CODEX",h="assets/icons/ico-spatial-codex.svg"):-1!==c.indexOf("imc")?(u="IMC",h="assets/icons/ico-spatial-imc.svg"):-1!==c.indexOf("lc")&&-1===c.indexOf("af")?(u="LC",h="assets/icons/ico-bulk-lc.svg"):u=-1!==c.indexOf("maldi")?"MALDI":-1!==c.indexOf("pas")?"PAS":"OTHER",h=null!==(r=this.getDatasetThumbnail(t,e,i))&&void 0!==r?r:h,{"@id":_W+t.uuid,"@type":"Dataset",label:`Registered ${s}, ${a}, ${o}`,description:`Data/Assay Types: ${l.join(", ")}`,link:`${n}browse/dataset/${t.uuid}`,technology:u,thumbnail:h}}getDatasetThumbnail(t,e,n){if(t.thumbnail_file){const i=t.thumbnail_file;return`${e}/${i.file_uuid}/${i.filename}`+(n?`?token=${n}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===t.group_uuid){const i=(0,KG.get)(t,"metadata.files",[]).filter(t=>/\.(ome\.tif|ome\.tiff)$/.test(t.rel_path)).filter(t=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(t.rel_path)).filter(t=>wW.has(t.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(i=>`${e}/${t.uuid}/${i.rel_path}`+(n?`?token=${n}`:""));if(i.length>0){const t=i[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(wW.has(t))return`assets/thumbnails/TMC-Vanderbilt/DR1/${t}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===t.group_uuid){const e=xW[t.hubmap_id];if(e)return`assets/thumbnails/TMC-Florida/${e}`}}getDonor(t,e){const n=(t.description||"").toLowerCase();let i;n.includes("female")?i="Female":n.includes("male")&&(i="Male");const r=n.match(/age ([0-9]+)/);let s,o;r&&(s=(0,KG.toNumber)(r[1]));for(const u of(0,KG.get)(t,"metadata.organ_donor_data",[]))"Feminine gender"===u.preferred_term||"Female"===u.preferred_term?i="Female":"Masculine gender"===u.preferred_term||"Male"===u.preferred_term?i="Male":"Current chronological age"===u.preferred_term||"Age"===u.preferred_term?s=(0,KG.toNumber)(u.data_value):"Body mass index"===u.preferred_term&&(o=(0,KG.toNumber)(u.data_value));let a="";i&&s&&(a+=`${i}, Age ${s}`,o&&(a+=`, BMI ${o.toFixed(1)}`));const l=new Date(t.last_modified_timestamp).toLocaleDateString(),c=SW[t.group_uuid]||t.group_name;return{"@id":_W+t.uuid,"@type":"Donor",label:a,description:`Entered ${l}, ${t.created_by_user_displayname}, ${c}`,link:`${e}browse/donor/${t.uuid}`,age:s,sex:i,bmi:o,consortium_name:"HuBMAP",provider_name:c,provider_uuid:t.group_uuid,samples:[]}}getRuiLocation(t,e){var n;const i=(t.ancestors||[]).find(t=>"Sample"===t.entity_type&&"organ"===t.specimen_type),r=CW[null==i?void 0:i.organ]||[EW.body];let s,o=t.rui_location;if(o&&("string"==typeof o&&(o=JSON.parse(o)),o.alignment_id?console.log("Detected a deprecated rui_location",t.uuid):o["@id"]&&(s=o)),s){s.ccf_annotations=r.concat(s.ccf_annotations||[]);const t=null!==(n=(0,KG.get)(s,["placement","target"]))&&void 0!==n?n:"";t.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,KG.set)(s,["placement","target"],t.replace("#VHSpleenCC","Male"===e.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===t||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===t)&&(0,KG.set)(s,["placement","target"],"Male"===e.sex?t.replace("#VH","#VHM")+"_Patch":t.replace("#VH","#VHF")+"_Patch")}return s}getTissueBlock(){return(0,KG.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function kW(t,e,n,i,r="",s=""){return lw(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(t).then(t=>t.ok?t.json():void 0).catch(()=>{});else if("search-api"===e){const e={"Content-type":"application/json"};i&&i.length>0&&(e.Authorization=`Bearer ${i}`),o=yield fetch(t,{method:"POST",headers:e,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:{exists:{field:"rui_location"}}})}).then(t=>t.ok?t.json():void 0).catch(()=>{})}if(o)return function(t,e="",n="",i,r=!1){const s={},o=(0,KG.get)(t,"hits.hits",[]).map(t=>(0,KG.get)(t,"_source",{})).map(t=>new TW(t,e,n,i).toJsonLd());for(const l of o){const t=l["@id"];s[t]?s[t].samples.push(l.samples[0]):s[t]=l}const a=Object.values(s);return r&&(function(t){let e=[],n=0;for(const i of t.filter(t=>t.samples.length>1)){const t=i.samples;for(let i=0;it["@id"]===r)&&(t[i].deleteMe=!0,n++)}i.samples=t.filter(t=>!0!==t.deleteMe)}n>0&&console.log(`\u26a0 ${n} sections identified as blocks`)}(a),console.log(a.map(t=>Object.assign({"@context":OW},t)))),{"@context":OW,"@graph":a}}(o,r,s,i);console.warn(`Unable to load ${t} as HuBMAP Data`)})}function AW(t,e,n){var i;const r=new Map,s=new Set;t.some(t=>{var n;return e.has(t.subject.id)&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.donor,null,null);const o=n(s),a=new Set;for(const l of o)for(const t of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(t);return a}function PW(t,e){return n=>t.has(n.id)?e.add(n.id):void 0}const IW={[iW.ontologyNode.label.id]:"label",[iW.ontologyNode.parent.id]:"parent",[iW.ontologyNode.synonymLabels.id]:"synonymLabels"};function MW(t,e){const n=WG.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return t.some(t=>{const e=IW[t.predicate.id];if(e){const n="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;"synonymLabels"===e?i.synonymLabels.push(n):(0,KG.set)(i,e,n)}return!1},n,null,null,null),i.children=t.getSubjects(iW.ontologyNode.children,n,null).map(t=>t.id),i}const DW={[eW.label.id]:"label",[eW.description.id]:"description",[eW.link.id]:"link"},RW=Object.assign(Object.assign({},DW),{[eW.providerName.id]:"providerName"}),NW=Object.assign(Object.assign({},DW),{[eW.technology.id]:"technology",[eW.thumbnail.id]:"thumbnail"}),LW=Object.assign(Object.assign({},DW),{[eW.sampleType.id]:"sampleType",[eW.sectionNumber.id]:"sectionNumber",[eW.datasets.id]:"datasets"}),jW=Object.assign(Object.assign({},DW),{[eW.sampleType.id]:"sampleType",[eW.sectionCount.id]:"sectionCount",[eW.sectionSize.id]:"sectionSize",[eW.sectionUnits.id]:"sectionUnits",[eW.donor.id]:"donor",[eW.spatialEntity.id]:"spatialEntityId",[eW.sections.id]:"sections",[eW.datasets.id]:"datasets"}),FW=(0,KG.memoize)(function(t,e){const n={"@id":e,"@type":"Donor"};return t.some(t=>{const e=RW[t.predicate.id];if(e){const i="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(n,e,i)}return!1},WG.DataFactory.namedNode(e),null,null,null),n},(t,e)=>e);function BW(t,e){const n={"@id":e,"@type":"Dataset"};return t.some(t=>{const e=NW[t.predicate.id];if(e){const i="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(n,e,i)}return!1},WG.DataFactory.namedNode(e),null,null,null),n}const VW=(0,KG.memoize)(function(t,e){const n={"@id":e,"@type":"Sample",sections:[],datasets:[]};return t.some(e=>{const i=jW[e.predicate.id];if(i){const r="Literal"===e.object.termType?(0,QG.fromRdf)(e.object):e.object.id;if("sections"===i){const e=function(t,e){const n={"@id":e,"@type":"Sample",datasets:[]};return t.some(e=>{const i=LW[e.predicate.id];if(i){const r="Literal"===e.object.termType?(0,QG.fromRdf)(e.object):e.object.id;if("datasets"===i){const e=BW(t,r);n[i].push(e)}else(0,KG.set)(n,i,r)}return!1},WG.DataFactory.namedNode(e),null,null,null),n}(t,r);n[i].push(e)}else if("datasets"===i){const e=BW(t,r);n[i].push(e)}else"donor"===i?n[i]=FW(t,r):(0,KG.set)(n,i,r)}return!1},WG.DataFactory.namedNode(e),null,null,null),n},(t,e)=>e),zW={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class UW{constructor(t=zW){this.options=t,this.store=new WG.Store(void 0,{factory:WG.DataFactory}),this.graph=new yW(this),this.scene=new vW(this)}connect(t,e=!1){return lw(this,void 0,void 0,function*(){return t&&(this.options=t),this.initializing||(this.initializing=e?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return lw(this,void 0,void 0,function*(){const t=(new Date).getTime(),e="ccf-database.last_modified",n="ccf-database",i=yield GG(e).catch(()=>{});let r;i&&t-new Date(+i).getTime()>36e5?yield function(t,e=$G()){return e("readwrite",e=>(t.forEach(t=>e.delete(t)),UG(e.transaction)))}([n,e]).catch(()=>{}):r=yield GG(n).catch(()=>{}),r?yield this.deserialize(r):(yield this.doConnect(),function(t,e=$G()){return e("readwrite",e=>(t.forEach(t=>e.put(t[1],t[0])),UG(e.transaction)))}([[n,this.serialize()],[e,""+t]]).catch(()=>{}))})}doConnect(){var t,e;return lw(this,void 0,void 0,function*(){const n=[],i=null!==(e=null===(t=this.options.dataSources)||void 0===t?void 0:t.concat())&&void 0!==e?e:[],r=this.options.ccfOwlUrl;if(r.endsWith(".n3store.json")){const t=yield fetch(r).then(t=>t.text()).catch(()=>console.log("Couldn't locate serialized store."));t&&(this.store=(0,WG.deserializeN3Store)(t,WG.DataFactory))}else(null==r?void 0:r.length)>0&&i.push(r);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?i.push(this.options.hubmapDataUrl):n.push(kW(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(t=>{if(t)return this.addDataSources([t])}))),n.push(this.addDataSources(i)),yield Promise.all(n),yield this.synchronize()})}addDataSources(t,e){return lw(this,void 0,void 0,function*(){const n=null!=e?e:this.store;return yield Promise.all(t.map(t=>lw(this,void 0,void 0,function*(){"string"==typeof t?t.endsWith("jsonld")?yield(0,WG.addJsonLdToStore)(t,n):t.endsWith("n3")?yield(0,WG.addN3ToStore)(t,n):(t.endsWith("rdf")||t.endsWith("owl")||t.endsWith("xml"))&&(yield(0,WG.addRdfXmlToStore)(t,n)):yield(0,WG.addJsonLdToStore)(t,n)}))),this})}synchronize(){return lw(this,void 0,void 0,function*(){return yield new Promise(t=>{setTimeout(t,500)}),this.graph.createGraph(),this})}serialize(){return(0,WG.serializeN3Store)(this.store)}deserialize(t){return lw(this,void 0,void 0,function*(){this.store=(0,WG.deserializeN3Store)(t,WG.DataFactory),this.graph=new yW(this),this.scene=new vW(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(t={}){return function(t,e){var n,i,r,s,o;let a=function(t){const e=new Set;return t.forSubjects(t=>e.add(t.id),eW.spatialEntity,null,null),e}(t);if(a.size>0&&(a=function(t,e,n=!0){const i=new Set;if(t.forSubjects(PW(e,i),eW.spatialEntity,null,null),!n){const t=new Set;return e.forEach(e=>i.has(e)?void 0:t.add(e)),t}return i}(t,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const n=e.sex;a=AW(t,a,e=>function(t,e,n){const i=new Set;return t.forSubjects(PW(e,i),eW.sex,eW[n],null),i}(t,e,n))}if(a.size>0&&(null===(n=e.tmc)||void 0===n?void 0:n.length)>0&&(a=AW(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.literal(r);t.forSubjects(PW(e,i),eW.providerName,n,null)}return i}(t,n,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(t,e,n){var i;const r=new Map,s=new Set,o=new Set;t.some(t=>(e.has(t.subject.id)&&o.add(t.object.id),!1),null,eW.sections,null,null),t.some(t=>{var n;return(e.has(t.subject.id)||o.has(t.subject.id))&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.datasets,null,null);const a=n(s),l=new Set;for(const c of a)for(const t of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(t);return l}(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.literal(r);t.forSubjects(PW(e,i),eW.technology,n,null)}return i}(t,n,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(t,e,n){var i;const r=new Map,s=new Set;t.some(t=>{var n;return e.has(t.subject.id)&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.spatialEntity,null,null);const o=n(s),a=new Set;for(const l of o)for(const t of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(t);return a}(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.namedNode(r);t.forSubjects(PW(e,i),iW.spatialEntity.ccf_annotations,n,null)}return i}(t,n,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,KG.isFinite)(e.ageRange[0])&&(0,KG.isFinite)(e.ageRange[1])){const n=Math.max(...e.ageRange),i=Math.min(...e.ageRange);1===i&&110===n||(a=AW(t,a,e=>function(t,e,n,i){const r=new Set;return t.some(t=>{if(e.has(t.subject.id)){const e=(0,QG.fromRdf)(t.object);e>=n&&e<=i&&r.add(t.subject.id)}return!1},null,eW.age,null,null),r}(t,e,i,n)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,KG.isFinite)(e.bmiRange[0])&&(0,KG.isFinite)(e.bmiRange[1])){const n=Math.max(...e.bmiRange),i=Math.min(...e.bmiRange);13===i&&83===n||(a=AW(t,a,e=>function(t,e,n,i){const r=new Set;return t.some(t=>{if(e.has(t.subject.id)){const e=(0,QG.fromRdf)(t.object);e>=n&&e<=i&&r.add(t.subject.id)}return!1},null,eW.bmi,null,null),r}(t,e,i,n)))}return a}(this.store,t)}get(t){return this.store.getQuads(WG.DataFactory.namedNode(t),null,null,null)}search(t={}){return[...this.getIds(t)].map(t=>this.get(t))}getSpatialEntities(t){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>mW(this.store,t))}getDatasetTechnologyNames(){return lw(this,void 0,void 0,function*(){return function(t){const e=new Set;return t.some(t=>(e.add(t.object.value),!1),null,eW.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return lw(this,void 0,void 0,function*(){return function(t){const e=new Set;return t.some(t=>(e.add(t.object.value),!1),null,eW.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(t){return lw(this,void 0,void 0,function*(){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>VW(this.store,t))})}getAggregateResults(t){return lw(this,void 0,void 0,function*(){return function(t,e){const n=new Set;e.some(e=>(t.has(e.subject.id)&&n.add(e.object.id),!1),null,eW.donor,null,null);const i=new Set;e.some(t=>(n.has(t.subject.id)&&i.add(t.object.id),!1),null,eW.providerUUID,null,null);const r=new Set;e.forSubjects(e=>{t.has(e.id)&&r.add(e.id)},eW.spatialEntity,null,null);const s=new Set;e.some(t=>(r.has(t.subject.id)&&s.add(t.object.id),!1),null,eW.sections,null,null);const o=new Set;return e.some(t=>{const e=t.subject;return(r.has(e.id)||s.has(e.id))&&o.add(t.object.id),!1},null,eW.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:n.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([t,e])=>({label:t,count:e}))}(this.getIds(t),this.store)})}getOntologyTermOccurences(t){return lw(this,void 0,void 0,function*(){return function(t,e){const n=new Map;e.some(e=>(t.has(e.subject.id)&&(n.has(e.object.id)?n.get(e.object.id).push(e.subject.id):n.set(e.object.id,[e.subject.id])),!1),null,eW.spatialEntity,null,null);const i={};return e.some(t=>{var e,r;if(n.has(t.subject.id)){const s=null!==(r=null===(e=n.get(t.subject.id))||void 0===e?void 0:e.length)&&void 0!==r?r:0;i[t.object.id]=s+(i[t.object.id]||0)}return!1},null,iW.spatialEntity.ccf_annotations,null,null),i}(this.getIds(t),this.store)})}getOntologyTreeModel(){return lw(this,void 0,void 0,function*(){return function(t){const e={root:sW.body.id,nodes:{}},n=new Set;t.some(t=>(n.add(t.subject.id),n.add(t.predicate.id),!1),null,iW.ontologyNode.parent,null,null);for(const i of n)e.nodes[i]=MW(t,i);return e}(this.store)})}getReferenceOrgans(){return lw(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(t){return lw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(t)})}getReferenceOrganScene(t,e){return lw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(t,e)})}}const HW=Symbol("Comlink.proxy"),$W=Symbol("Comlink.endpoint"),GW=Symbol("Comlink.releaseProxy"),WW=Symbol("Comlink.thrown"),qW=t=>"object"==typeof t&&null!==t||"function"==typeof t,XW=new Map([["proxy",{canHandle:t=>qW(t)&&t[HW],serialize(t){const{port1:e,port2:n}=new MessageChannel;return YW(t,e),[n,[n]]},deserialize:t=>(t.start(),QW(t))}],["throw",{canHandle:t=>qW(t)&&WW in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}}]]);function YW(t,e=self){e.addEventListener("message",function n(i){if(!i||!i.data)return;const{id:r,type:s,path:o}=Object.assign({path:[]},i.data),a=(i.data.argumentList||[]).map(rq);let l;try{const e=o.slice(0,-1).reduce((t,e)=>t[e],t),n=o.reduce((t,e)=>t[e],t);switch(s){case"GET":l=n;break;case"SET":e[o.slice(-1)[0]]=rq(i.data.value),l=!0;break;case"APPLY":l=n.apply(e,a);break;case"CONSTRUCT":l=function(t){return Object.assign(t,{[HW]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;YW(t,n),l=function(t,e){return nq.set(t,e),t}(e,[e])}break;case"RELEASE":l=void 0;break;default:return}}catch(c){l={value:c,[WW]:0}}Promise.resolve(l).catch(t=>({value:t,[WW]:0})).then(t=>{const[i,o]=iq(t);e.postMessage(Object.assign(Object.assign({},i),{id:r}),o),"RELEASE"===s&&(e.removeEventListener("message",n),KW(e))})}),e.start&&e.start()}function KW(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function QW(t,e){return JW(t,[],e)}function ZW(t){if(t)throw new Error("Proxy has been released and is not useable")}function JW(t,e=[],n=function(){}){let i=!1;const r=new Proxy(n,{get(n,s){if(ZW(i),s===GW)return()=>sq(t,{type:"RELEASE",path:e.map(t=>t.toString())}).then(()=>{KW(t),i=!0});if("then"===s){if(0===e.length)return{then:()=>r};const n=sq(t,{type:"GET",path:e.map(t=>t.toString())}).then(rq);return n.then.bind(n)}return JW(t,[...e,s])},set(n,r,s){ZW(i);const[o,a]=iq(s);return sq(t,{type:"SET",path:[...e,r].map(t=>t.toString()),value:o},a).then(rq)},apply(n,r,s){ZW(i);const o=e[e.length-1];if(o===$W)return sq(t,{type:"ENDPOINT"}).then(rq);if("bind"===o)return JW(t,e.slice(0,-1));const[a,l]=eq(s);return sq(t,{type:"APPLY",path:e.map(t=>t.toString()),argumentList:a},l).then(rq)},construct(n,r){ZW(i);const[s,o]=eq(r);return sq(t,{type:"CONSTRUCT",path:e.map(t=>t.toString()),argumentList:s},o).then(rq)}});return r}function tq(t){return Array.prototype.concat.apply([],t)}function eq(t){const e=t.map(iq);return[e.map(t=>t[0]),tq(e.map(t=>t[1]))]}const nq=new WeakMap;function iq(t){for(const[e,n]of XW)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},nq.get(t)||[]]}function rq(t){switch(t.type){case"HANDLER":return XW.get(t.name).deserialize(t.value);case"RAW":return t.value}}function sq(t,e,n){return new Promise(i=>{const r=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.addEventListener("message",function e(n){!n.data||!n.data.id||n.data.id!==r||(t.removeEventListener("message",e),i(n.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:r},e),n)})}function oq(t,e){return t===e}let aq=(()=>{class t{constructor(t,e){this.locator=e,this.subscriptions=new g,this.dataSource=t.config$.pipe(Hd(t=>Object.keys(t).length>0),D(t=>t),Rd(oq),Qd(t=>function(t,e){return new C(n=>{let i,r;try{i=t()}catch(o){return void n.error(o)}try{r=e(i)}catch(o){return void n.error(o)}const s=(r?U(r):ep).subscribe(n);return()=>{s.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),e=>this.connectDataSource(e.source,t))),up(1))}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Qd(e=>e.getTissueBlockResults(t)),Gp(1))}getDatasetTechnologyNames(){return this.dataSource.pipe(Qd(t=>t.getDatasetTechnologyNames()),Gp(1))}getProviderNames(){return this.dataSource.pipe(Qd(t=>t.getProviderNames()),Gp(1))}getAggregateResults(t){return this.dataSource.pipe(Qd(e=>e.getAggregateResults(t)),Gp(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Qd(e=>e.getOntologyTermOccurences(t)),Gp(1))}getOntologyTreeModel(){return this.dataSource.pipe(Qd(t=>t.getOntologyTreeModel()),Gp(1))}getReferenceOrgans(){return this.dataSource.pipe(Qd(t=>t.getReferenceOrgans()),Gp(1))}getScene(t){return this.dataSource.pipe(Qd(e=>e.getScene(t)),Gp(1))}createDataSource(){let t,e=()=>{};if("undefined"==typeof Worker||RG.disableDbWorker)t=new UW;else{let n;({source:t,worker:n}=this.getWebWorkerDataSource(!0)),e=()=>lw(this,void 0,void 0,function*(){yield t[GW](),n.terminate()})}return{source:t,unsubscribe:e}}connectDataSource(t,e){return lw(this,void 0,void 0,function*(){RG.disableDbWorker&&(yield new Promise(t=>{setTimeout(t,100)}));const n=(new Date).getTime();return yield t.connect(e,!0),RG.production||console.info(`Loaded CCF database in ${((new Date).getTime()-n)/1e3}s`),t})}getWebWorkerDataSource(t=!1){let e;if(t)e=new Worker(n.tu(new URL(n.p+n.u(10),n.b)),{type:void 0});else{const t=this.locator.prepareExternalUrl("0-es2015.worker.js"),n=new Blob([`importScripts('${t}')`],{type:"application/javascript"});e=new Worker(URL.createObjectURL(n),{type:"module"})}return{source:QW(e),worker:e}}}return t.\u0275fac=function(e){return new(e||t)(Ci(SG),Ci(rh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function lq(t,e,n,i){n&&"function"!=typeof n&&(i=n);const r="function"==typeof n?n:void 0,s=new lp(t,e,i);return t=>rt(()=>s,r)(t)}const cq=(t,e)=>JSON.stringify(t)===JSON.stringify(e),uq=t=>t.map(t=>void 0!==t?JSON.parse(JSON.stringify(t)):t),hq={storageStrategy:class extends class{}{constructor(){super(...arguments),this.cachePairs=[]}add(t,e,n){this.cachePairs.push(t)}addMany(t){this.cachePairs=t}updateAtIndex(t,e){Object.assign(this.cachePairs[t],e)}update(t,e){Object.assign(this.cachePairs[t],e)}getAll(){return this.cachePairs}removeAtIndex(t){this.cachePairs.splice(t,1)}remove(t){this.cachePairs.splice(t,1)}removeAll(){this.cachePairs.length=0}},globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},dq=new P;function pq(t={}){return function(e,n,i){const r=t.cacheKey||e.constructor.name+"#"+n,s=i.value;if(i&&i.value){let e=t.storageStrategy?new t.storageStrategy:new hq.storageStrategy;const n=[];t.cacheModifier&&t.cacheModifier.subscribe(t=>e.addMany(t(e.getAll(r,this)),r,this)),Q(dq.asObservable(),t.cacheBusterObserver?t.cacheBusterObserver:np()).subscribe(t=>{e.removeAll(r,this),n.length=0}),t.cacheResolver=t.cacheResolver||hq.cacheResolver||cq,t.cacheHasher=t.cacheHasher||hq.cacheHasher||uq,i.value=function(...i){const o=e.getAll(r,this);let a=t.cacheHasher(i),l=o.find(e=>t.cacheResolver(e.parameters,a));const c=n.find(e=>t.cacheResolver(e.parameters,a));if((t.maxAge||hq.maxAge)&&l&&l.created&&((new Date).getTime()-new Date(l.created).getTime()>(t.maxAge||hq.maxAge)?(e.remove?e.remove(o.indexOf(l),l,r,this):e.removeAtIndex(o.indexOf(l),r,this),l=null):(t.slidingExpiration||hq.slidingExpiration)&&(l.created=new Date,e.update?e.update(o.indexOf(l),l,r,this):e.updateAtIndex(o.indexOf(l),l,r,this))),l){const e=wd(l.response);return t.async?e.pipe(uU(0)):e}if(c)return c.response;{const l=s.call(this,...i).pipe(mv(()=>{const e=n.find(e=>t.cacheResolver(e.parameters,a));n.splice(n.indexOf(e),1)}),$f(n=>{(!t.shouldCacheDecider||t.shouldCacheDecider(n))&&((!(t.maxCacheCount||hq.maxCacheCount)||1===(t.maxCacheCount||hq.maxCacheCount)||(t.maxCacheCount||hq.maxCacheCount)&&(t.maxCacheCount||hq.maxCacheCount)t.map(t=>Object.assign(Object.assign({},t),{transformMatrix:new bT(t.transformMatrix)}))))}doFetch(t,e){const{globalConfig:n,http:i}=this,r=this.filterToParams(e);return n.getOption("remoteApiEndpoint").pipe(D(e=>`${e}/${t}`),Qd(t=>i.get(t,{params:this.withToken(r),responseType:"json"})),up(1))}filterToParams(t={}){return Object.keys(t).sort().reduce((e,n)=>{const i=t[n];return(t=>null==t||""===t||Array.isArray(t)&&0===t.length)(i)?e:e.set(n,(t=>Array.isArray(t)?t.join(","):`${t}`)(i))},new Tv)}withToken(t){const{globalConfig:{snapshot:{hubmapToken:e}}}=this;return e?t.set("token",e):t}}fq.\u0275fac=function(t){return new(t||fq)(Ci(SG),Ci(Bv))},fq.\u0275prov=xt({token:fq,factory:fq.\u0275fac,providedIn:"root"}),sw([pq()],fq.prototype,"getProviderNames",null),sw([pq()],fq.prototype,"getDatasetTechnologyNames",null),sw([pq()],fq.prototype,"getOntologyTreeModel",null),sw([pq()],fq.prototype,"getReferenceOrgans",null),sw([pq()],fq.prototype,"getTissueBlockResults",null),sw([pq()],fq.prototype,"getAggregateResults",null),sw([pq()],fq.prototype,"getOntologyTermOccurences",null),sw([pq()],fq.prototype,"getScene",null);let gq=(()=>{class t{constructor(t,e,n){this.impl$=t.config$.pipe(D(t=>!!t.useRemoteApi&&!!t.remoteApiEndpoint),D(t=>t?n:e),Rd(),up(1))}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getReferenceOrgans(){return this.forwardCall("getReferenceOrgans")}getTissueBlockResults(t){return this.forwardCall("getTissueBlockResults",t)}getAggregateResults(t){return this.forwardCall("getAggregateResults",t)}getOntologyTermOccurences(t){return this.forwardCall("getOntologyTermOccurences",t)}getScene(t){return this.forwardCall("getScene",t)}forwardCall(t,...e){return this.impl$.pipe(Qd(n=>n[t](...e)))}}return t.\u0275fac=function(e){return new(e||t)(Ci(SG),Ci(aq),Ci(fq))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),mq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),bq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:au,useValue:MG.initialize,multi:!0},MG]}),t})(),yq=(()=>{class t{constructor(t,e){this.accessor=t,this.injector=e}static forRoot(e=[]){return{ngModule:t,providers:[w$,_$,y$,...e]}}}return t.\u0275fac=function(e){return new(e||t)(Ci(w$,2),Ci(_$,2))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const vq=(t,e)=>((t,e)=>new Array(e+1).join("0"))(0,e-t.toString().length)+t;class _q{constructor(t,e,n){this.action=t,this.store=e,this.logWriter=n}dispatched(t){const e=VB(this.action),n=function(t){return vq(t.getHours(),2)+":"+vq(t.getMinutes(),2)+":"+vq(t.getSeconds(),2)+"."+vq(t.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${e} @ ${n}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",t)}completed(t){this.logWriter.logGreen("next state",t),this.logWriter.endGroup()}errored(t){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",t),this.logWriter.endGroup()}_hasPayload(t){return this._getNonEmptyProperties(t).length>0}_getNonEmptyProperties(t){return Object.keys(t).map(e=>t[e]).filter(t=>void 0!==t)}}class wq{constructor(t){this.options=t,this.options=this.options||{},this.logger=t.logger||console}startGroup(t){const e=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{e.call(this.logger,t)}catch(n){console.log(t)}}endGroup(){try{this.logger.groupEnd()}catch(t){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(t,e){this.log(t,"color: #9E9E9E; font-weight: bold",e)}logGreen(t,e){this.log(t,"color: #4CAF50; font-weight: bold",e)}logRedish(t,e){this.log(t,"color: #FD8182; font-weight: bold",e)}log(t,e,n){this.isIE()?this.logger.log(t,n):this.logger.log("%c "+t,e,n)}isIE(){const t="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let e=!1;const n=t.indexOf("MSIE "),i=t.indexOf("Trident/");return(n>-1||i>-1)&&(e=!0),e}}const xq=new oi("NGXS_LOGGER_PLUGIN_OPTIONS");let Sq=(()=>{class t{constructor(t,e){this._options=t,this._injector=e}handle(t,e,n){if(this._options.disabled||!this._options.filter(e,t))return n(t,e);this._logWriter=this._logWriter||new wq(this._options),this._store=this._store||this._injector.get(pV);const i=new _q(e,this._store,this._logWriter);return i.dispatched(t),n(t,e).pipe($f(t=>{i.completed(t)}),pv(t=>{throw i.errored(t),t}))}}return t.\u0275fac=function(e){return new(e||t)(Ci(xq),Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Eq=new oi("LOGGER_USER_OPTIONS");function Cq(t){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},t)}let Oq=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[{provide:MB,useClass:Sq,multi:!0},{provide:Eq,useValue:e},{provide:xq,useFactory:Cq,deps:[Eq]}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Tq=new RegExp("[^#a-f\\d]","gi"),kq=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),Aq=["#FF8800","#2979ff","#ffd740","#b92dff","#da326f","#7323e2","#acf32b","#82B1FF","#E040FB","#00E5FF"].map((t,e)=>{const n=function(t,e={}){if("string"!=typeof t||Tq.test(t)||!kq.test(t))throw new TypeError("Expected a valid hex string");let n=1;8===(t=t.replace(/^#/,"")).length&&(n=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(n=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const i=Number.parseInt(t,16),r=i>>16,s=i>>8&255,o=255&i,a="number"==typeof e.alpha?e.alpha:n;return"array"===e.format?[r,s,o,a]:"css"===e.format?`rgb(${r} ${s} ${o}${1===a?"":` / ${Number((100*a).toFixed(2))}%`})`:{red:r,green:s,blue:o,alpha:a}}(t,{format:"array"});return n[3]=255,{color:t,rgba:n,rank:e}});let Pq=class extends z${constructor(){super(...arguments),this.forcedUnassignment=new P,this.forcedUnassignment$=this.forcedUnassignment.asObservable(),this.colorAssignments$=this.state$.pipe(FU("colorAssignments"),Rd()),this.colorAssignmentsList$=this.state$.pipe(FU("colorAssignmentsList"),Rd())}getColor(t){const{colorAssignments:e}=this.snapshot;return e[t]}assignColor(t,e=!1){let{colorAssignments:n,colorAssignmentsList:i,colorsAvailable:r}=this.snapshot;e&&(r=this.snapshot.colorPalette.concat(),i=[],n={});let s=n[t];return s||(r.length>0?s=r[0]:(s=i[i.length-1].color,i=i.slice(0,-1),this.forcedUnassignment.next()),r=r.filter(t=>t.color!==s.color),i=[{color:s,key:t}].concat(i),n=i.reduce((t,e,n)=>(t[e.key]=Object.assign(Object.assign({},e.color),{rank:n}),t),{}),this.ctx.patchState({colorsAvailable:r,colorAssignments:n,colorAssignmentsList:i})),s}unassignColor(t){let{colorAssignments:e,colorAssignmentsList:n,colorsAvailable:i}=this.snapshot;const r=e[t];r&&(i=[r].concat(i),n=n.filter(t=>t.color.color!==r.color),e=n.reduce((t,e,n)=>(t[e.key]=Object.assign(Object.assign({},e.color),{rank:n}),t),{}),this.ctx.patchState({colorsAvailable:i,colorAssignments:e,colorAssignmentsList:n}))}};function Iq(t,e){return n=>n.lift(new Mq(t,e))}Pq.\u0275fac=function(){let t;return function(e){return(t||(t=ei(Pq)))(e||Pq)}}(),Pq.\u0275prov=xt({token:Pq,factory:Pq.\u0275fac}),sw([L$(),ow(0,j$("key")),ow(1,j$("doReset"))],Pq.prototype,"assignColor",null),sw([L$(),ow(0,j$("key"))],Pq.prototype,"unassignColor",null),Pq=sw([F$(),wV({name:"colors",defaults:{colorPalette:Aq.concat(),colorsAvailable:Aq.concat(),colorAssignments:{},colorAssignmentsList:[]}})],Pq);class Mq{constructor(t,e){this.keySelector=t,this.flushes=e}call(t,e){return e.subscribe(new Dq(t,this.keySelector,this.flushes))}}class Dq extends ${constructor(t,e,n){super(t),this.keySelector=e,this.values=new Set,n&&this.add(G(n,new H(this)))}notifyNext(){this.values.clear()}notifyError(t){this._error(t)}_next(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)}_useKeySelector(t){let e;const{destination:n}=this;try{e=this.keySelector(t)}catch(i){return void n.error(i)}this._finalizeNext(e,t)}_finalizeNext(t,e){const{values:n}=this;n.has(t)||(n.add(t),this.destination.next(e))}}const Rq={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"]};var Nq=(()=>(function(t){t.Running="running",t.Completed="completed"}(Nq||(Nq={})),Nq))();function Lq(t){return()=>t.next(Nq.Completed)}function jq(t,e){return n=>n.pipe(Qd(t),$f(e),lq(1),Z())}let Fq=class extends V${constructor(t){super(),this.source=t,this._tissueBlockDataQueryStatus$=new lp(1),this._aggregateDataQueryStatus$=new lp(1),this._termOccurencesDataQueryStatus$=new lp(1),this._sceneDataQueryStatus$=new lp(1),this._technologyFilterQueryStatus$=new lp(1),this._providerFilterQueryStatus$=new lp(1),this.ontologyTermsFullData$=new lp(1),this.filter$=this.state$.pipe(FU("filter")),this.tissueBlockData$=this.filter$.pipe(jq(this.tissueBlockData,Lq(this._tissueBlockDataQueryStatus$))),this.aggregateData$=this.filter$.pipe(jq(this.aggregateData,Lq(this._aggregateDataQueryStatus$))),this.termOccurencesData$=this.filter$.pipe(jq(this.termOccurencesData,Lq(this._termOccurencesDataQueryStatus$))),this.sceneData$=this.filter$.pipe(jq(this.sceneData,Lq(this._sceneDataQueryStatus$))),this.technologyFilterData$=this.filter$.pipe(jq(this.technologyFilterData,Lq(this._technologyFilterQueryStatus$))),this.providerFilterData$=this.filter$.pipe(jq(this.providerFilterData,Lq(this._providerFilterQueryStatus$))),this.tissueBlockDataQueryStatus$=this._tissueBlockDataQueryStatus$.pipe(Iq()),this.aggregateDataQueryStatus$=this._aggregateDataQueryStatus$.pipe(Iq()),this.termOccurencesDataQueryStatus$=this._termOccurencesDataQueryStatus$.pipe(Iq()),this.sceneDataQueryStatus$=this._sceneDataQueryStatus$.pipe(Iq()),this.technologyFilterQueryStatus$=this._technologyFilterQueryStatus$.pipe(Iq()),this.providerFilterQueryStatus$=this._providerFilterQueryStatus$.pipe(Iq()),this.queryStatus$=T_([this.tissueBlockDataQueryStatus$,this.aggregateDataQueryStatus$,this.termOccurencesDataQueryStatus$,this.sceneDataQueryStatus$,this.technologyFilterQueryStatus$,this.providerFilterQueryStatus$]).pipe(D(t=>function(t){return t.every(t=>t===Nq.Completed)}(t)?Nq.Completed:Nq.Running),Iq()),this._tissueBlockDataQueryStatus$.next(Nq.Completed),this._aggregateDataQueryStatus$.next(Nq.Completed),this._termOccurencesDataQueryStatus$.next(Nq.Completed),this._sceneDataQueryStatus$.next(Nq.Completed),this._technologyFilterQueryStatus$.next(Nq.Completed),this._providerFilterQueryStatus$.next(Nq.Completed)}ngxsOnInit(){const{ontologyTermsFullData$:t,termOccurencesData$:e,source:n,snapshot:{filter:i}}=this;i===Rq?e.pipe(Gp(1)).subscribe(t):n.getOntologyTermOccurences().pipe(Gp(1)).subscribe(t)}updateFilter(t){this.patchState({filter:Object.assign(Object.assign({},this.getState().filter),t)})}tissueBlockData(t){return this._tissueBlockDataQueryStatus$.next(Nq.Running),this.source.getTissueBlockResults(t)}aggregateData(t){return this._aggregateDataQueryStatus$.next(Nq.Running),this.source.getAggregateResults(t)}termOccurencesData(t){return this._termOccurencesDataQueryStatus$.next(Nq.Running),this.source.getOntologyTermOccurences(t)}sceneData(t){return this._sceneDataQueryStatus$.next(Nq.Running),this.source.getScene(t)}technologyFilterData(){return this._technologyFilterQueryStatus$.next(Nq.Running),this.source.getDatasetTechnologyNames()}providerFilterData(){return this._providerFilterQueryStatus$.next(Nq.Running),this.source.getProviderNames()}};Fq.\u0275fac=function(t){return new(t||Fq)(Ci(mq))},Fq.\u0275prov=xt({token:Fq,factory:Fq.\u0275fac}),sw([L$(),ow(0,j$("filter"))],Fq.prototype,"updateFilter",null),sw([iB.ak],Fq.prototype,"tissueBlockData",null),sw([iB.ak],Fq.prototype,"aggregateData",null),sw([iB.ak],Fq.prototype,"termOccurencesData",null),sw([iB.ak],Fq.prototype,"sceneData",null),sw([iB.ak],Fq.prototype,"technologyFilterData",null),sw([iB.ak],Fq.prototype,"providerFilterData",null),Fq=sw([F$(),wV({name:"data",defaults:{filter:Rq}})],Fq);const Bq=[{name:"logo",namespace:"app",url:"assets/icons/app/hubmap-logo.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs_bladder.svg"},{name:"bone_marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs_brain.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs_heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs_kidney.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"large_intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs_liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs_lung.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lymph_nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small_intestine",namespace:"app",url:"assets/icons/organs/ico-organs_small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs_spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"vasculature",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"expand_more",namespace:"app",url:"assets/icons/expand_more-24px.svg"},{name:"expand_less",namespace:"app",url:"assets/icons/expand_less-24px.svg"},{name:"filter",url:"assets/icons/filter.svg"}];let Vq=class extends V${constructor(t,e){super(),this.registry=t;for(const{name:n,namespace:i,url:r,html:s}of Bq){const t={name:n,namespace:i,url:r&&e.bypassSecurityTrustResourceUrl(r),html:s&&e.bypassSecurityTrustHtml(s)};this.registerIconImpl(t)}}registerIcon(t){return this.registerIconImpl(t)}registerIconImpl(t){if(!this.registry||!t.url&&!t.html)return!1;const e=this.registry,n=e[this.getMethodName(t)],i=this.getArguments(t);if(!n)return!1;try{return n.apply(e,i),!0}catch(r){return!1}}getMethodName({name:t,namespace:e,url:n}){const i=["addSvgIcon"];return t||i.push("Set"),n||i.push("Literal"),e&&i.push("InNamespace"),i.join("")}getArguments({name:t,namespace:e,url:n,html:i}){return[e,t,null!=n?n:i].filter(t=>!!t)}};Vq.\u0275fac=function(t){return new(t||Vq)(Ci(r_,8),Ci(hd))},Vq.\u0275prov=xt({token:Vq,factory:Vq.\u0275fac}),sw([L$()],Vq.prototype,"registerIcon",null),Vq=sw([F$(),wV({name:"iconRegistry"})],Vq);let zq=class extends z${constructor(t,e){super(),this.dataService=t,this.injector=e,this.listResults$=this.state$.pipe(FU("listResults"),Rd()),this.highlightedNodeId$=this.state$.pipe(FU("highlightedNodeId"),Rd())}setListResults(t){this.ctx.patchState({listResults:t})}selectListResult(t){this.colorAssignments.assignColor(t.tissueBlock.spatialEntityId)}deselectListResult(t){this.colorAssignments.unassignColor(t.tissueBlock.spatialEntityId)}highlightNode(t){this.ctx.patchState({highlightedNodeId:t})}unHighlightNode(){this.ctx.patchState({highlightedNodeId:void 0})}ngxsOnInit(){super.ngxsOnInit(),this.dataState=this.injector.get(Fq),this.colorAssignments=this.injector.get(Pq),T_([this.dataState.tissueBlockData$,this.colorAssignments.colorAssignments$]).pipe(D(([t,e])=>{const n=[],i=[];for(const r of t){const t=e[r.spatialEntityId];t?n.push({selected:!0,color:t.color,tissueBlock:r,rank:t.rank}):i.push({selected:!1,tissueBlock:r})}return(0,KG.sortBy)(n,["rank"]).concat(i)}),$f(t=>this.setListResults(t))).subscribe()}};function Uq(t,e,n){e[n.id]=n,(0,KG.forEach)(n.children,n=>Uq(t,e,t[n]))}function Hq(t,e){const n={"@id":t.root,"@type":"OntologyTreeNode",id:t.root,label:"body",parent:"",children:e,synonymLabels:[]},i=(0,KG.at)(t.nodes,e),r={[n.id]:n};return(0,KG.forEach)(i,t=>t.parent=n.id),(0,KG.forEach)(i,e=>Uq(t.nodes,r,e)),{root:n.id,nodes:r}}zq.\u0275fac=function(t){return new(t||zq)(Ci(mq),Ci(No))},zq.\u0275prov=xt({token:zq,factory:zq.\u0275fac}),sw([L$(),ow(0,j$("listResults"))],zq.prototype,"setListResults",null),zq=sw([F$(),wV({name:"listResults",defaults:{listResults:[]}})],zq);let $q=class extends z${constructor(t){super(),this.dataService=t,this.nodes$=this.state$.pipe(D(t=>Object.values(t.nodes))),this.rootNode$=this.state$.pipe(D(t=>t.nodes[t.root]))}setOntology(t){this.ctx.setState(t)}ngxsOnInit(){super.ngxsOnInit(),this.loadOntology()}loadOntology(){hv([this.dataService.getOntologyTreeModel().pipe(Gp(1)),this.dataService.getReferenceOrgans().pipe(Gp(1))]).subscribe(([t,e])=>{const n=RG.organNodes.concat(),i=(0,KG.partial)(Hq,KG.partial.placeholder,n)(t);this.setOntology(i)})}};$q.\u0275fac=function(t){return new(t||$q)(Ci(mq))},$q.\u0275prov=xt({token:$q,factory:$q.\u0275fac}),sw([L$()],$q.prototype,"setOntology",null),$q=sw([F$(),wV({name:"ontology",defaults:{root:"",nodes:{}}})],$q);const Gq=new Set(["Skin","Heart","Kidney","Spleen"]);let Wq=class extends z${constructor(t,e){super(),this.dataService=t,this.injector=e,this.referenceOrgans$=this.state$.pipe(FU("referenceOrgans"),Rd()),this.selectedReferenceOrgans$=this.state$.pipe(FU("selectedReferenceOrgans"),Rd()),this.scene$=this.state$.pipe(FU("scene"),Rd()),this.highlightedId$=this.state$.pipe(FU("highlightedId"),Rd())}setSelectedReferenceOrgans(t){this.ctx.patchState({selectedReferenceOrgans:t})}setReferenceOrgans(t){this.ctx.patchState({referenceOrgans:t})}setScene(t){this.ctx.patchState({scene:t})}sceneNodeClicked({node:t,ctrlClick:e}){t.representation_of&&"http://purl.org/ccf/latest/ccf.owl#VHFSkin"!==t["@id"]&&t.entityId?this.dataState.updateFilter({ontologyTerms:[t.representation_of]}):t.entityId&&this.colorAssignments.assignColor(t["@id"],!e)}sceneNodeHovered(t){this.listResults.highlightNode(t["@id"])}sceneNodeUnhover(){this.listResults.unHighlightNode()}ngxsOnInit(){super.ngxsOnInit(),this.dataState=this.injector.get(Fq),this.colorAssignments=this.injector.get(Pq),this.listResults=this.injector.get(zq),this.dataService.getReferenceOrgans().pipe(D(t=>{const e=new Set(t.map(t=>t.representation_of));return cG.filter(t=>e.has(t.id)).map(t=>Object.assign(Object.assign({},t),{disabled:!1,numResults:0}))}),Gp(1),$f(t=>{this.setReferenceOrgans(t),this.setSelectedReferenceOrgans(t.filter(t=>Gq.has(t.organ)))})).subscribe(),T_([this.dataState.sceneData$,this.selectedReferenceOrgans$,this.colorAssignments.colorAssignments$,this.dataService.getReferenceOrgans(),this.listResults.highlightedNodeId$]).pipe(D(([t,e,n,i,r])=>{const s=new Set(e.map(t=>t.id)),o=new Set(i.filter(t=>s.has(t.representation_of)).map(t=>t["@id"]));return t.filter(t=>{var e,n;return(null===(n=null===(e=t.ccf_annotations)||void 0===e?void 0:e.some)||void 0===n?void 0:n.call(e,t=>s.has(t)))||t.reference_organ&&o.has(t.reference_organ)}).map(t=>t.entityId&&(Object.prototype.hasOwnProperty.call(n,t["@id"])||r===t["@id"])?Object.assign(Object.assign({},t),{color:r===t["@id"]?[30,136,229,255]:n[t["@id"]].rgba}):t)}),$f(t=>this.setScene(t))).subscribe()}};Wq.\u0275fac=function(t){return new(t||Wq)(Ci(mq),Ci(No))},Wq.\u0275prov=xt({token:Wq,factory:Wq.\u0275fac}),sw([L$(),ow(0,j$("selectedReferenceOrgans"))],Wq.prototype,"setSelectedReferenceOrgans",null),sw([L$(),ow(0,j$("referenceOrgans"))],Wq.prototype,"setReferenceOrgans",null),sw([L$(),ow(0,j$("scene"))],Wq.prototype,"setScene",null),Wq=sw([F$(),wV({name:"scene",defaults:{scene:[],referenceOrgans:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],Wq);const qq=[SG,Pq,Vq,zq,Fq,$q,Wq];let Xq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[yq.forRoot(),_V.forRoot(qq,{developmentMode:!RG.production}),Oq.forRoot({disabled:RG.production})]]}),t})(),Yq=(()=>{class t{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:mq,useExisting:gq}],imports:[[Zv,tG.forRoot({gaToken:RG.googleAnalyticsToken,appName:"eui"}),EG,zG,Xq,bq],zG]}),t})();const Kq=["input"],Qq=function(t){return{enterDuration:t}},Zq=["*"],Jq=new oi("mat-checkbox-default-options",{providedIn:"root",factory:tX});function tX(){return{color:"accent",clickAction:"check-indeterminate"}}let eX=0;const nX=tX(),iX={provide:EV,useExisting:pt(()=>oX),multi:!0};class rX{}const sX=By(jy(Fy(Ly(class{constructor(t){this._elementRef=t}}))));let oX=(()=>{class t extends sX{constructor(t,e,n,i,r,s,o){super(t),this._changeDetectorRef=e,this._focusMonitor=n,this._ngZone=i,this._animationMode=s,this._options=o,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++eX,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Rc,this.indeterminateChange=new Rc,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||nX,this.color=this.defaultColor=this._options.color||nX.color,this.tabIndex=parseInt(r)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=md(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t||Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}ngAfterViewChecked(){}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}get checked(){return this._checked}set checked(t){t!=this.checked&&(this._checked=t,this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){const e=md(t);e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const e=t!=this._indeterminate;this._indeterminate=md(t),e&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(t){this.checked=!!t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_getAriaChecked(){return this.checked?"true":this.indeterminate?"mixed":"false"}_transitionCheckState(t){let e=this._currentCheckState,n=this._elementRef.nativeElement;if(e!==t&&(this._currentAnimationClass.length>0&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(e,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);const t=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{n.classList.remove(t)},1e3)})}}_emitChangeEvent(){const t=new rX;t.source=this,t.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(t),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked}_onInputClick(t){var e;const n=null===(e=this._options)||void 0===e?void 0:e.clickAction;t.stopPropagation(),this.disabled||"noop"===n?!this.disabled&&"noop"===n&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==n&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,e){t?this._focusMonitor.focusVia(this._inputElement,t,e):this._inputElement.nativeElement.focus(e)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,e){if("NoopAnimations"===this._animationMode)return"";let n="";switch(t){case 0:if(1===e)n="unchecked-checked";else{if(3!=e)return"";n="unchecked-indeterminate"}break;case 2:n=1===e?"unchecked-checked":"unchecked-indeterminate";break;case 1:n=2===e?"checked-unchecked":"checked-indeterminate";break;case 3:n=1===e?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${n}`}_syncIndeterminate(t){const e=this._inputElement;e&&(e.nativeElement.indeterminate=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(Ig),ea(xu),ii("tabindex"),ea(Ey,8),ea(Jq,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-checkbox"]],viewQuery:function(t,e){if(1&t&&(qc(Kq,5),qc(Yy,5)),2&t){let t;Wc(t=Yc())&&(e._inputElement=t.first),Wc(t=Yc())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,e){2&t&&(il("id",e.id),Ko("tabindex",null),ja("mat-checkbox-indeterminate",e.indeterminate)("mat-checkbox-checked",e.checked)("mat-checkbox-disabled",e.disabled)("mat-checkbox-label-before","before"==e.labelPosition)("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[_l([iX]),jo],ngContentSelectors:Zq,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(t,e){if(1&t&&(wa(),ra(0,"label",0,1),ra(2,"span",2),ra(3,"input",3,4),fa("change",function(t){return e._onInteractionEvent(t)})("click",function(t){return e._onInputClick(t)}),sa(),ra(5,"span",5),oa(6,"span",6),sa(),oa(7,"span",7),ra(8,"span",8),vn(),ra(9,"svg",9),oa(10,"path",10),sa(),Ve.lFrame.currentNamespace=null,oa(11,"span",11),sa(),sa(),ra(12,"span",12,13),fa("cdkObserveContent",function(){return e._onLabelTextChange()}),ra(14,"span",14),Za(15,"\xa0"),sa(),xa(16),sa(),sa()),2&t){const t=ta(1),n=ta(13);Ko("for",e.inputId),ws(2),ja("mat-checkbox-inner-container-no-side-margin",!n.textContent||!n.textContent.trim()),ws(1),na("id",e.inputId)("required",e.required)("checked",e.checked)("disabled",e.disabled)("tabIndex",e.tabIndex),Ko("value",e.value)("name",e.name)("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby)("aria-checked",e._getAriaChecked())("aria-describedby",e.ariaDescribedby),ws(2),na("matRippleTrigger",t)("matRippleDisabled",e._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Tc(19,Qq,"NoopAnimations"===e._animationMode?0:150))}},directives:[Yy,ng],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),t})(),aX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),lX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Ny,ig,aX],Ny,aX]}),t})(),cX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,lX]]}),t})();const uX=["trigger"],hX=["panel"];function dX(t,e){if(1&t&&(ra(0,"span",8),Za(1),sa()),2&t){const t=va();ws(1),Ja(t.placeholder)}}function pX(t,e){if(1&t&&(ra(0,"span",12),Za(1),sa()),2&t){const t=va(2);ws(1),Ja(t.triggerValue)}}function fX(t,e){1&t&&xa(0,0,["*ngSwitchCase","true"])}function gX(t,e){1&t&&(ra(0,"span",9),Jo(1,pX,2,1,"span",10),Jo(2,fX,1,0,"ng-content",11),sa()),2&t&&(na("ngSwitch",!!va().customTrigger),ws(2),na("ngSwitchCase",!0))}function mX(t,e){if(1&t){const t=ua();ra(0,"div",13),ra(1,"div",14,15),fa("@transformPanel.done",function(e){return $e(t),va()._panelDoneAnimatingStream.next(e.toState)})("keydown",function(e){return $e(t),va()._handleKeydown(e)}),xa(3,1),sa(),sa()}if(2&t){const t=va();na("@transformPanelWrap",void 0),ws(1),nl("mat-select-panel ",t._getPanelTheme(),""),La("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),na("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),Ko("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const bX=[[["mat-select-trigger"]],"*"],yX=["mat-select-trigger","*"],vX={transformPanelWrap:Vg("transformPanelWrap",[Wg("* => void",Xg("@transformPanel",[qg()],{optional:!0}))]),transformPanel:Vg("transformPanel",[$g("void",Hg({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),$g("showing",Hg({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),$g("showing-multiple",Hg({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Wg("void => *",zg("120ms cubic-bezier(0, 0, 0.2, 1)")),Wg("* => void",zg("100ms 25ms linear",Hg({opacity:0})))])};let _X=0;const wX=new oi("mat-select-scroll-strategy"),xX=new oi("MAT_SELECT_CONFIG"),SX={provide:wX,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};class EX{constructor(t,e){this.source=t,this.value=e}}const CX=Fy(By(Ly(Vy(class{constructor(t,e,n,i,r){this._elementRef=t,this._defaultErrorStateMatcher=e,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}})))),OX=new oi("MatSelectTrigger");let TX=(()=>{class t extends CX{constructor(t,e,n,i,r,s,o,a,l,c,u,h,d,p){var f,g,m;super(r,i,o,a,c),this._viewportRuler=t,this._changeDetectorRef=e,this._ngZone=n,this._dir=s,this._parentFormField=l,this._liveAnnouncer=d,this._defaultOptions=p,this._panelOpen=!1,this._compareWith=(t,e)=>t===e,this._uid="mat-select-"+_X++,this._triggerAriaLabelledBy=null,this._destroy=new P,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+_X++,this._panelDoneAnimatingStream=new P,this._overlayPanelClass=(null===(f=this._defaultOptions)||void 0===f?void 0:f.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(m=null===(g=this._defaultOptions)||void 0===g?void 0:g.disableOptionCentering)&&void 0!==m&&m,this.ariaLabel="",this.optionSelectionChanges=Iz(()=>{const t=this.options;return t?t.changes.pipe(Kd(t),Qd(()=>Q(...t.map(t=>t.onSelectionChange)))):this._ngZone.onStable.pipe(Gp(1),Qd(()=>this.optionSelectionChanges))}),this.openedChange=new Rc,this._openedStream=this.openedChange.pipe(Hd(t=>t),D(()=>{})),this._closedStream=this.openedChange.pipe(Hd(t=>!t),D(()=>{})),this.selectionChange=new Rc,this.valueChange=new Rc,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==p?void 0:p.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=p.typeaheadDebounceInterval),this._scrollStrategyFactory=h,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(u)||0,this.id=this.id}get focused(){return this._focused||this._panelOpen}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get required(){return this._required}set required(t){this._required=md(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=md(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=md(t)}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){(t!==this._value||this._multiple&&Array.isArray(t))&&(this.options&&this._setSelectionByValue(t),this._value=t)}get typeaheadDebounceInterval(){return this._typeaheadDebounceInterval}set typeaheadDebounceInterval(t){this._typeaheadDebounceInterval=bd(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new kp(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Rd(),Wd(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(Wd(this._destroy)).subscribe(t=>{t.added.forEach(t=>t.select()),t.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(Kd(null),Wd(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const e=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?e.setAttribute("aria-labelledby",t):e.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}ngOnChanges(t){t.disabled&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}ngOnDestroy(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}writeValue(t){this.value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){const t=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}_isRtl(){return!!this._dir&&"rtl"===this._dir.value}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){const e=t.keyCode,n=40===e||38===e||37===e||39===e,i=13===e||32===e,r=this._keyManager;if(!r.isTyping()&&i&&!Qp(t)||(this.multiple||t.altKey)&&n)t.preventDefault(),this.open();else if(!this.multiple){const e=this.selected;r.onKeydown(t);const n=this.selected;n&&e!==n&&this._liveAnnouncer.announce(n.viewValue,1e4)}}_handleOpenKeydown(t){const e=this._keyManager,n=t.keyCode,i=40===n||38===n,r=e.isTyping();if(i&&t.altKey)t.preventDefault(),this.close();else if(r||13!==n&&32!==n||!e.activeItem||Qp(t))if(!r&&this._multiple&&65===n&&t.ctrlKey){t.preventDefault();const e=this.options.some(t=>!t.disabled&&!t.selected);this.options.forEach(t=>{t.disabled||(e?t.select():t.deselect())})}else{const n=e.activeItemIndex;e.onKeydown(t),this._multiple&&i&&t.shiftKey&&e.activeItem&&e.activeItemIndex!==n&&e.activeItem._selectViaInteraction()}else t.preventDefault(),e.activeItem._selectViaInteraction()}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(Gp(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this._selectionModel.selected.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(t=>this._selectValue(t)),this._sortValues();else{const e=this._selectValue(t);e?this._keyManager.updateActiveItem(e):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const e=this.options.find(e=>{if(this._selectionModel.isSelected(e))return!1;try{return null!=e.value&&this._compareWith(e.value,t)}catch(n){return!1}});return e&&this._selectionModel.select(e),e}_initKeyManager(){this._keyManager=new fg(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(Wd(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(Wd(this._destroy)).subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){const t=Q(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Wd(t)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Q(...this.options.map(t=>t._stateChanges)).pipe(Wd(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,e){const n=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(n!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),e&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),e&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),n!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((e,n)=>this.sortComparator?this.sortComparator(e,n,t):t.indexOf(e)-t.indexOf(n)),this.stateChanges.next()}}_propagateChanges(t){let e=null;e=this.multiple?this.selected.map(t=>t.value):this.selected?this.selected.value:t,this._value=e,this.valueChange.emit(e),this._onChange(e),this.selectionChange.emit(this._getChangeEvent(e)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}_canOpen(){var t;return!this._panelOpen&&!this.disabled&&(null===(t=this.options)||void 0===t?void 0:t.length)>0}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){var t;if(this.ariaLabel)return null;const e=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(e?e+" ":"")+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const e=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let n=(e?e+" ":"")+this._valueId;return this.ariaLabelledby&&(n+=" "+this.ariaLabelledby),n}_panelDoneAnimating(t){this.openedChange.emit(t)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}return t.\u0275fac=function(e){return new(e||t)(ea(Ip),ea(tc),ea(xu),ea(zy),ea(kl),ea(Op,8),ea(_z,8),ea(Tz,8),ea(aU,8),ea(WV,10),ii("tabindex"),ea(wX),ea(kg),ea(xX,8))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(qc(uX,5),qc(hX,5),qc(Mf,5)),2&t){let t;Wc(t=Yc())&&(e.trigger=t.first),Wc(t=Yc())&&(e.panel=t.first),Wc(t=Yc())&&(e._overlayDir=t.first)}},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[jo,ye]}),t})(),kX=(()=>{class t extends TX{constructor(){super(...arguments),this._scrollTop=0,this._triggerFontSize=0,this._transformOrigin="top",this._offsetY=0,this._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}]}_calculateOverlayScroll(t,e,n){const i=this._getItemHeight();return Math.min(Math.max(0,i*t-e+i/2),n)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(Wd(this._destroy)).subscribe(()=>{this.panelOpen&&(this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._changeDetectorRef.markForCheck())})}open(){super._canOpen()&&(super.open(),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(Gp(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const e=lv(t,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===e?0:cv((t+e)*n,n,this.panel.nativeElement.scrollTop,256)}_positioningSettled(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}_panelDoneAnimating(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),super._panelDoneAnimating(t)}_getChangeEvent(t){return new EX(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),e=this._viewportRuler.getViewportSize(),n=this._isRtl(),i=this.multiple?56:32;let r;if(this.multiple)r=40;else if(this.disableOptionCentering)r=16;else{let t=this._selectionModel.selected[0]||this.options.first;r=t&&t.group?32:16}n||(r*=-1);const s=0-(t.left+r-(n?i:0)),o=t.right+r-e.width+(n?0:i);s>0?r+=s+8:o>0&&(r-=o+8),this._overlayDir.offsetX=Math.round(r),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,e,n){const i=this._getItemHeight(),r=(i-this._triggerRect.height)/2,s=Math.floor(256/i);let o;return this.disableOptionCentering?0:(o=0===this._scrollTop?t*i:this._scrollTop===n?(t-(this._getItemCount()-s))*i+(i-(this._getItemCount()*i-256)%i):e-i/2,Math.round(-1*o-r))}_checkOverlayWithinViewport(t){const e=this._getItemHeight(),n=this._viewportRuler.getViewportSize(),i=this._triggerRect.top-8,r=n.height-this._triggerRect.bottom-8,s=Math.abs(this._offsetY),o=Math.min(this._getItemCount()*e,256)-s-this._triggerRect.height;o>r?this._adjustPanelUp(o,r):s>i?this._adjustPanelDown(s,i,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,e){const n=Math.round(t-e);this._scrollTop-=n,this._offsetY-=n,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,e,n){const i=Math.round(t-e);if(this._scrollTop+=i,this._offsetY+=i,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=n)return this._scrollTop=n,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),e=this._getItemCount(),n=Math.min(e*t,256),i=e*t-n;let r;r=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),r+=lv(r,this.options,this.optionGroups);const s=n/2;this._scrollTop=this._calculateOverlayScroll(r,s,i),this._offsetY=this._calculateOverlayOffsetY(r,s,i),this._checkOverlayWithinViewport(i)}_getOriginBasedOnOption(){const t=this._getItemHeight(),e=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-e+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-select"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,OX,5),Xc(n,av,5),Xc(n,iv,5)),2&t){let t;Wc(t=Yc())&&(e.customTrigger=t.first),Wc(t=Yc())&&(e.options=t),Wc(t=Yc())&&(e.optionGroups=t)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,e){1&t&&fa("keydown",function(t){return e._handleKeydown(t)})("focus",function(){return e._onFocus()})("blur",function(){return e._onBlur()}),2&t&&(Ko("id",e.id)("tabindex",e.tabIndex)("aria-controls",e.panelOpen?e.id+"-panel":null)("aria-expanded",e.panelOpen)("aria-label",e.ariaLabel||null)("aria-required",e.required.toString())("aria-disabled",e.disabled.toString())("aria-invalid",e.errorState)("aria-describedby",e._ariaDescribedby||null)("aria-activedescendant",e._getAriaActiveDescendant()),ja("mat-select-disabled",e.disabled)("mat-select-invalid",e.errorState)("mat-select-required",e.required)("mat-select-empty",e.empty)("mat-select-multiple",e.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[_l([{provide:Qz,useExisting:t},{provide:Jy,useExisting:t}]),jo],ngContentSelectors:yX,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(t,e){if(1&t&&(wa(bX),ra(0,"div",0,1),fa("click",function(){return e.toggle()}),ra(3,"div",2),Jo(4,dX,2,1,"span",3),Jo(5,gX,3,2,"span",4),sa(),ra(6,"div",5),oa(7,"div",6),sa(),sa(),Jo(8,mX,4,14,"ng-template",7),fa("backdropClick",function(){return e.close()})("attach",function(){return e._onAttached()})("detach",function(){return e.close()})),2&t){const t=ta(1);Ko("aria-owns",e.panelOpen?e.id+"-panel":null),ws(3),na("ngSwitch",e.empty),Ko("id",e._valueId),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1),ws(3),na("cdkConnectedOverlayPanelClass",e._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",e._scrollStrategy)("cdkConnectedOverlayOrigin",t)("cdkConnectedOverlayOpen",e.panelOpen)("cdkConnectedOverlayPositions",e._positions)("cdkConnectedOverlayMinWidth",null==e._triggerRect?null:e._triggerRect.width)("cdkConnectedOverlayOffsetY",e._offsetY)}},directives:[If,Eh,Ch,Mf,Oh,mh],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[vX.transformPanelWrap,vX.transformPanel]},changeDetection:0}),t})(),AX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[SX],imports:[[Rh,Rf,uv,Ny],Mp,cU,uv,Ny]}),t})(),PX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,cU,AX]]}),t})();var IX=n(25430),MX=n(39053),DX=n(26202);const RX=["tooltipTemplate"],NX=["leftOuterSelectionBar"],LX=["rightOuterSelectionBar"],jX=["fullBar"],FX=["selectionBar"],BX=["minHandle"],VX=["maxHandle"],zX=["floorLabel"],UX=["ceilLabel"],HX=["minHandleLabel"],$X=["maxHandleLabel"],GX=["combinedLabel"],WX=["ticksElement"];function qX(t,e){if(1&t&&oa(0,"ng5-slider-tooltip-wrapper",31),2&t){const t=va().$implicit;na("template",va().tooltipTemplate)("tooltip",t.valueTooltip)("placement",t.valueTooltipPlacement)("content",t.value)}}function XX(t,e){1&t&&oa(0,"span",32),2&t&&na("innerHTML",va().$implicit.legend,vr)}const YX=function(t){return{"ng5-slider-selected":t}};function KX(t,e){if(1&t&&(ra(0,"span",27),oa(1,"ng5-slider-tooltip-wrapper",28),Jo(2,qX,1,4,"ng5-slider-tooltip-wrapper",29),Jo(3,XX,1,1,"span",30),sa()),2&t){const t=e.$implicit,n=va();na("ngClass",Tc(7,YX,t.selected))("ngStyle",t.style),ws(1),na("template",n.tooltipTemplate)("tooltip",t.tooltip)("placement",t.tooltipPlacement),ws(1),na("ngIf",null!=t.value),ws(1),na("ngIf",null!=t.legend)}}function QX(t,e){}function ZX(t,e){1&t&&Jo(0,QX,0,0,"ng-template")}const JX=function(t,e,n){return{tooltip:t,placement:e,content:n}};function tY(t,e){if(1&t&&(aa(0),Jo(1,ZX,1,0,void 0,1),la()),2&t){const t=va();ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",kc(2,JX,t.tooltip,t.placement,t.content))}}function eY(t,e){if(1&t&&(aa(0),ra(1,"div",2),Za(2),sa(),la()),2&t){const t=va();ws(1),Ko("title",t.tooltip)("data-tooltip-placement",t.placement),ws(1),tl(" ",t.content," ")}}const nY={Min:0,Max:1};nY[nY.Min]="Min",nY[nY.Max]="Max";const iY={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};iY[iY.Low]="Low",iY[iY.High]="High",iY[iY.Floor]="Floor",iY[iY.Ceil]="Ceil",iY[iY.TickValue]="TickValue";class rY{constructor(){this.floor=0,this.ceil=null,this.step=1,this.minRange=null,this.maxRange=null,this.pushRange=!1,this.minLimit=null,this.maxLimit=null,this.translate=null,this.combineLabels=null,this.getLegend=null,this.stepsArray=null,this.bindIndexForStepsArray=!1,this.draggableRange=!1,this.draggableRangeOnly=!1,this.showSelectionBar=!1,this.showSelectionBarEnd=!1,this.showSelectionBarFromValue=null,this.showOuterSelectionBars=!1,this.hidePointerLabels=!1,this.hideLimitLabels=!1,this.autoHideLimitLabels=!0,this.readOnly=!1,this.disabled=!1,this.mouseEventsInterval=50,this.touchEventsInterval=50,this.inputEventsInterval=100,this.outputEventsInterval=100,this.showTicks=!1,this.showTicksValues=!1,this.tickStep=null,this.tickValueStep=1,this.ticksArray=null,this.ticksTooltip=null,this.ticksValuesTooltip=null,this.vertical=!1,this.getSelectionBarColor=null,this.getTickColor=null,this.getPointerColor=null,this.keyboardSupport=!0,this.scale=1,this.enforceStep=!0,this.enforceRange=!0,this.noSwitching=!1,this.onlyBindHandles=!1,this.rightToLeft=!1,this.reversedControls=!1,this.boundPointerLabels=!0,this.logScale=!1,this.customValueToPosition=null,this.customPositionToValue=null,this.precisionLimit=12,this.selectionBarGradient=null,this.ariaLabel=null,this.ariaLabelledBy=null,this.ariaLabelHigh=null,this.ariaLabelledByHigh=null,this.handleDimension=null,this.barDimension=null,this.animate=!0}}class sY{}class oY{static isNullOrUndefined(t){return null==t}static linearValueToPosition(t,e,n){return(t-e)/(n-e)}static logValueToPosition(t,e,n){return((t=Math.log(t))-(e=Math.log(e)))/((n=Math.log(n))-e)}static linearPositionToValue(t,e,n){return t*(n-e)+e}static logPositionToValue(t,e,n){return e=Math.log(e),n=Math.log(n),Math.exp(t*(n-e)+e)}static findStepIndex(t,e){const n=e.map(e=>Math.abs(t-e.value));let i=0;for(let r=0;r{r.events.next(t)};return t.addEventListener(e,s,{passive:!0,capture:!1}),r.teardownCallback=()=>{t.removeEventListener(e,s,{passive:!0,capture:!1})},r.eventsSubscription=r.events.pipe(oY.isNullOrUndefined(i)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}detachEventListener(t){oY.isNullOrUndefined(t.eventsSubscription)||(t.eventsSubscription.unsubscribe(),t.eventsSubscription=null),oY.isNullOrUndefined(t.events)||(t.events.complete(),t.events=null),oY.isNullOrUndefined(t.teardownCallback)||(t.teardownCallback(),t.teardownCallback=null)}attachEventListener(t,e,n,i){const r=new cY;return r.eventName=e,r.events=new IX.xQ,r.teardownCallback=this.renderer.listen(t,e,t=>{r.events.next(t)}),r.eventsSubscription=r.events.pipe(oY.isNullOrUndefined(i)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}}let hY=(()=>{class t{constructor(t,e,n){this.elemRef=t,this.renderer=e,this.changeDetectionRef=n,this._position=0,this._dimension=0,this._alwaysHide=!1,this._vertical=!1,this._scale=1,this.opacity=1,this.visibility="visible",this.left="",this.bottom="",this.height="",this.width="",this.eventListeners=[],this.eventListenerHelper=new uY(this.renderer)}get position(){return this._position}get dimension(){return this._dimension}get alwaysHide(){return this._alwaysHide}get vertical(){return this._vertical}get scale(){return this._scale}setAlwaysHide(t){this._alwaysHide=t,this.visibility=t?"hidden":"visible"}hide(){this.opacity=0}show(){this.alwaysHide||(this.opacity=1)}isVisible(){return!this.alwaysHide&&0!==this.opacity}setVertical(t){this._vertical=t,this._vertical?(this.left="",this.width=""):(this.bottom="",this.height="")}setScale(t){this._scale=t}setPosition(t){this._position!==t&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._position=t,this._vertical?this.bottom=Math.round(t)+"px":this.left=Math.round(t)+"px"}calculateDimension(){const t=this.getBoundingClientRect();this._dimension=this.vertical?(t.bottom-t.top)*this.scale:(t.right-t.left)*this.scale}setDimension(t){this._dimension!==t&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._dimension=t,this._vertical?this.height=Math.round(t)+"px":this.width=Math.round(t)+"px"}getBoundingClientRect(){return this.elemRef.nativeElement.getBoundingClientRect()}on(t,e,n){const i=this.eventListenerHelper.attachEventListener(this.elemRef.nativeElement,t,e,n);this.eventListeners.push(i)}onPassive(t,e,n){const i=this.eventListenerHelper.attachPassiveEventListener(this.elemRef.nativeElement,t,e,n);this.eventListeners.push(i)}off(t){let e,n;oY.isNullOrUndefined(t)?(e=[],n=this.eventListeners):(e=this.eventListeners.filter(e=>e.eventName!==t),n=this.eventListeners.filter(e=>e.eventName===t));for(const i of n)this.eventListenerHelper.detachEventListener(i);this.eventListeners=e}isRefDestroyed(){return oY.isNullOrUndefined(this.changeDetectionRef)||this.changeDetectionRef.destroyed}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderElement",""]],hostVars:12,hostBindings:function(t,e){2&t&&La("opacity",e.opacity)("visibility",e.visibility)("left",e.left)("bottom",e.bottom)("height",e.height)("width",e.width)}}),t})(),dY=(()=>{class t extends hY{constructor(t,e,n){super(t,e,n),this.active=!1,this.role="",this.tabindex="",this.ariaOrientation="",this.ariaLabel="",this.ariaLabelledBy="",this.ariaValueNow="",this.ariaValueText="",this.ariaValueMin="",this.ariaValueMax=""}focus(){this.elemRef.nativeElement.focus()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderHandle",""]],hostVars:11,hostBindings:function(t,e){2&t&&(Ko("role",e.role)("tabindex",e.tabindex)("aria-orientation",e.ariaOrientation)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledBy)("aria-valuenow",e.ariaValueNow)("aria-valuetext",e.ariaValueText)("aria-valuemin",e.ariaValueMin)("aria-valuemax",e.ariaValueMax),ja("ng5-slider-active",e.active))},features:[jo]}),t})(),pY=(()=>{class t extends hY{constructor(t,e,n){super(t,e,n),this._value=null}get value(){return this._value}setValue(t){let e=!1;!this.alwaysHide&&(oY.isNullOrUndefined(this.value)||this.value.length!==t.length||this.value.length>0&&0===this.dimension)&&(e=!0),this._value=t,this.elemRef.nativeElement.innerHTML=t,e&&this.calculateDimension()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderLabel",""]],features:[jo]}),t})();class fY{constructor(){this.selected=!1,this.style={},this.tooltip=null,this.tooltipPlacement=null,this.value=null,this.valueTooltip=null,this.valueTooltipPlacement=null,this.legend=null}}class gY{constructor(){this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0}}class mY{static compare(t,e){return!(oY.isNullOrUndefined(t)&&oY.isNullOrUndefined(e)||oY.isNullOrUndefined(t)!==oY.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue}}class bY extends mY{static compare(t,e){return!(oY.isNullOrUndefined(t)&&oY.isNullOrUndefined(e)||oY.isNullOrUndefined(t)!==oY.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue&&t.forceChange===e.forceChange}}const yY={provide:EV,useExisting:pt(()=>vY),multi:!0};let vY=(()=>{class t{constructor(t,e,n,i){this.renderer=t,this.elementRef=e,this.changeDetectionRef=n,this.zone=i,this.value=null,this.valueChange=new Rc,this.highValue=null,this.highValueChange=new Rc,this.options=new rY,this.userChangeStart=new Rc,this.userChange=new Rc,this.userChangeEnd=new Rc,this.initHasRun=!1,this.inputModelChangeSubject=new IX.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new IX.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new rY,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new gY,this.sliderElementVerticalClass=!1,this.sliderElementAnimateClass=!1,this.sliderElementDisabledAttr=null,this.barStyle={},this.minPointerStyle={},this.maxPointerStyle={},this.fullBarTransparentClass=!1,this.selectionBarDraggableClass=!1,this.ticksUnderValuesClass=!1,this.intermediateTicks=!1,this.ticks=[],this.eventListenerHelper=null,this.onMoveEventListener=null,this.onEndEventListener=null,this.resizeObserver=null,this.onTouchedCallback=null,this.onChangeCallback=null,this.eventListenerHelper=new uY(this.renderer)}set manualRefresh(t){this.unsubscribeManualRefresh(),this.manualRefreshSubscription=t.subscribe(()=>{setTimeout(()=>this.calculateViewDimensionsAndDetectChanges())})}set triggerFocus(t){this.unsubscribeTriggerFocus(),this.triggerFocusSubscription=t.subscribe(t=>{this.focusPointer(t)})}get range(){return!oY.isNullOrUndefined(this.value)&&!oY.isNullOrUndefined(this.highValue)}get showTicks(){return this.viewOptions.showTicks}ngOnInit(){this.viewOptions=new rY,Object.assign(this.viewOptions,this.options),this.updateDisabledState(),this.updateVerticalState()}ngAfterViewInit(){this.applyOptions(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval),this.subscribeOutputModelChangeSubject(this.viewOptions.outputEventsInterval),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.updateVerticalState(),this.manageElementsStyle(),this.updateDisabledState(),this.calculateViewDimensions(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.initHandles(),this.manageEventsBindings(),this.subscribeResizeObserver(),this.initHasRun=!0,this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}ngOnChanges(t){oY.isNullOrUndefined(t.options)||this.onChangeOptions(),(!oY.isNullOrUndefined(t.value)||!oY.isNullOrUndefined(t.highValue))&&this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}ngOnDestroy(){this.unbindEvents(),this.unsubscribeResizeObserver(),this.unsubscribeInputModelChangeSubject(),this.unsubscribeOutputModelChangeSubject(),this.unsubscribeManualRefresh(),this.unsubscribeTriggerFocus()}writeValue(t){t instanceof Array?(this.value=t[0],this.highValue=t[1]):this.value=t,this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}registerOnChange(t){this.onChangeCallback=t}registerOnTouched(t){this.onTouchedCallback=t}setDisabledState(t){this.viewOptions.disabled=t,this.updateDisabledState()}onResize(t){this.calculateViewDimensionsAndDetectChanges()}subscribeInputModelChangeSubject(t){this.inputModelChangeSubscription=this.inputModelChangeSubject.pipe((0,MX.distinctUntilChanged)(bY.compare),(0,MX.filter)(t=>!t.forceChange&&!t.internalChange),oY.isNullOrUndefined(t)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.applyInputModelChange(t))}subscribeOutputModelChangeSubject(t){this.outputModelChangeSubscription=this.outputModelChangeSubject.pipe((0,MX.distinctUntilChanged)(bY.compare),oY.isNullOrUndefined(t)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.publishOutputModelChange(t))}subscribeResizeObserver(){aY.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(()=>this.calculateViewDimensionsAndDetectChanges()),this.resizeObserver.observe(this.elementRef.nativeElement))}unsubscribeResizeObserver(){aY.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}unsubscribeOnMove(){oY.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}unsubscribeOnEnd(){oY.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}unsubscribeInputModelChangeSubject(){oY.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}unsubscribeOutputModelChangeSubject(){oY.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}unsubscribeManualRefresh(){oY.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}unsubscribeTriggerFocus(){oY.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}getPointerElement(t){return t===nY.Min?this.minHandleElement:t===nY.Max?this.maxHandleElement:null}getCurrentTrackingValue(){return this.currentTrackingPointer===nY.Min?this.viewLowValue:this.currentTrackingPointer===nY.Max?this.viewHighValue:null}modelValueToViewValue(t){return oY.isNullOrUndefined(t)?NaN:oY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+t:oY.findStepIndex(+t,this.viewOptions.stepsArray)}viewValueToModelValue(t){return oY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?t:this.getStepValue(t)}getStepValue(t){const e=this.viewOptions.stepsArray[t];return oY.isNullOrUndefined(e)?NaN:e.value}applyViewChange(){this.value=this.viewValueToModelValue(this.viewLowValue),this.range&&(this.highValue=this.viewValueToModelValue(this.viewHighValue)),this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,userEventInitiated:!0,forceChange:!1}),this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!0})}applyInputModelChange(t){const e=this.normaliseModelValues(t),n=!mY.compare(t,e);n&&(this.value=e.value,this.highValue=e.highValue),this.viewLowValue=this.modelValueToViewValue(e.value),this.viewHighValue=this.range?this.modelValueToViewValue(e.highValue):null,this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCombinedLabel(),this.outputModelChangeSubject.next({value:e.value,highValue:e.highValue,forceChange:n,userEventInitiated:!1})}publishOutputModelChange(t){const e=()=>{this.valueChange.emit(t.value),this.range&&this.highValueChange.emit(t.highValue),oY.isNullOrUndefined(this.onChangeCallback)||this.onChangeCallback(this.range?[t.value,t.highValue]:t.value),oY.isNullOrUndefined(this.onTouchedCallback)||this.onTouchedCallback(this.range?[t.value,t.highValue]:t.value)};t.userEventInitiated?(e(),this.userChange.emit(this.getChangeContext())):setTimeout(()=>{e()})}normaliseModelValues(t){const e=new mY;if(e.value=t.value,e.highValue=t.highValue,this.viewOptions.enforceStep&&(e.value=this.roundStep(e.value),this.range&&(e.highValue=this.roundStep(e.highValue))),!oY.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return e;if(e.value=lY.clampToRange(e.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(e.highValue=lY.clampToRange(e.highValue,this.viewOptions.floor,this.viewOptions.ceil)),this.range&&t.value>t.highValue)if(this.viewOptions.noSwitching)e.value=e.highValue;else{const n=t.value;e.value=t.highValue,e.highValue=n}return e}renormaliseModelValues(){const t={value:this.value,highValue:this.highValue},e=this.normaliseModelValues(t);mY.compare(e,t)||(this.value=e.value,this.highValue=e.highValue,this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!0,userEventInitiated:!1}))}onChangeOptions(){if(!this.initHasRun)return;const t=this.viewOptions.inputEventsInterval,e=this.viewOptions.outputEventsInterval;this.applyOptions(),t!==this.viewOptions.inputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval)),e!==this.viewOptions.outputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.outputEventsInterval)),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.resetSlider()}applyOptions(){if(this.viewOptions=new rY,Object.assign(this.viewOptions,this.options),this.viewOptions.draggableRange=this.range&&this.viewOptions.draggableRange,this.viewOptions.draggableRangeOnly=this.range&&this.viewOptions.draggableRangeOnly,this.viewOptions.draggableRangeOnly&&(this.viewOptions.draggableRange=!0),this.viewOptions.showTicks=this.viewOptions.showTicks||this.viewOptions.showTicksValues||!oY.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!oY.isNullOrUndefined(this.viewOptions.tickStep)||!oY.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),oY.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),oY.isNullOrUndefined(this.viewOptions.combineLabels)&&(this.viewOptions.combineLabels=(t,e)=>t+" - "+e),this.viewOptions.logScale&&0===this.viewOptions.floor)throw Error("Can't use floor=0 with logarithmic scale")}applyStepsArrayOptions(){this.viewOptions.floor=0,this.viewOptions.ceil=this.viewOptions.stepsArray.length-1,this.viewOptions.step=1,oY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=t=>String(this.viewOptions.bindIndexForStepsArray?this.getStepValue(t):t)),this.viewOptions.getLegend=t=>this.viewOptions.stepsArray[t].legend}applyFloorCeilOptions(){if(oY.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),oY.isNullOrUndefined(this.viewOptions.ceil)||oY.isNullOrUndefined(this.viewOptions.floor))throw Error("floor and ceil options must be supplied");this.viewOptions.ceil=+this.viewOptions.ceil,this.viewOptions.floor=+this.viewOptions.floor,oY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=t=>String(t))}resetSlider(){this.manageElementsStyle(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.unbindEvents(),this.manageEventsBindings(),this.updateDisabledState(),this.calculateViewDimensions(),this.refocusPointerIfNeeded()}focusPointer(t){t!==nY.Min&&t!==nY.Max&&(t=nY.Min),t===nY.Min?this.minHandleElement.focus():this.range&&t===nY.Max&&this.maxHandleElement.focus()}refocusPointerIfNeeded(){oY.isNullOrUndefined(this.currentFocusPointer)||(this.onPointerFocus(this.currentFocusPointer),this.getPointerElement(this.currentFocusPointer).focus())}manageElementsStyle(){this.updateScale(),this.floorLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels),this.ceilLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels);const t=this.viewOptions.showTicksValues&&!this.intermediateTicks;this.minHandleLabelElement.setAlwaysHide(t||this.viewOptions.hidePointerLabels),this.maxHandleLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.combinedLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.selectionBarElement.setAlwaysHide(!this.range&&!this.viewOptions.showSelectionBar),this.leftOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.rightOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.fullBarTransparentClass=this.range&&this.viewOptions.showOuterSelectionBars,this.selectionBarDraggableClass=this.viewOptions.draggableRange&&!this.viewOptions.onlyBindHandles,this.ticksUnderValuesClass=this.intermediateTicks&&this.options.showTicksValues,this.sliderElementVerticalClass!==this.viewOptions.vertical&&(this.updateVerticalState(),setTimeout(()=>{this.resetSlider()})),this.sliderElementAnimateClass!==this.viewOptions.animate&&setTimeout(()=>{this.sliderElementAnimateClass=this.viewOptions.animate})}manageEventsBindings(){this.viewOptions.disabled||this.viewOptions.readOnly?this.unbindEvents():this.bindEvents()}updateDisabledState(){this.sliderElementDisabledAttr=this.viewOptions.disabled?"disabled":null}updateVerticalState(){this.sliderElementVerticalClass=this.viewOptions.vertical;for(const t of this.getAllSliderElements())oY.isNullOrUndefined(t)||t.setVertical(this.viewOptions.vertical)}updateScale(){for(const t of this.getAllSliderElements())t.setScale(this.viewOptions.scale)}getAllSliderElements(){return[this.leftOuterSelectionBarElement,this.rightOuterSelectionBarElement,this.fullBarElement,this.selectionBarElement,this.minHandleElement,this.maxHandleElement,this.floorLabelElement,this.ceilLabelElement,this.minHandleLabelElement,this.maxHandleLabelElement,this.combinedLabelElement,this.ticksElement]}initHandles(){this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.range&&this.updateCombinedLabel(),this.updateTicksScale()}addAccessibility(){this.updateAriaAttributes(),this.minHandleElement.role="slider",this.minHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.viewOptions.vertical&&(this.minHandleElement.ariaOrientation="vertical"),oY.isNullOrUndefined(this.viewOptions.ariaLabel)?oY.isNullOrUndefined(this.viewOptions.ariaLabelledBy)||(this.minHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledBy):this.minHandleElement.ariaLabel=this.viewOptions.ariaLabel,this.range&&(this.maxHandleElement.role="slider",this.maxHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.maxHandleElement.ariaOrientation=this.viewOptions.vertical?"vertical":"horizontal",oY.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?oY.isNullOrUndefined(this.viewOptions.ariaLabelledByHigh)||(this.maxHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledByHigh):this.maxHandleElement.ariaLabel=this.viewOptions.ariaLabelHigh)}updateAriaAttributes(){this.minHandleElement.ariaValueNow=(+this.value).toString(),this.minHandleElement.ariaValueText=this.viewOptions.translate(+this.value,iY.Low),this.minHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.minHandleElement.ariaValueMax=this.viewOptions.ceil.toString(),this.range&&(this.maxHandleElement.ariaValueNow=(+this.highValue).toString(),this.maxHandleElement.ariaValueText=this.viewOptions.translate(+this.highValue,iY.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}calculateViewDimensions(){oY.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);const t=this.minHandleElement.dimension;this.handleHalfDimension=t/2,oY.isNullOrUndefined(this.viewOptions.barDimension)?this.fullBarElement.calculateDimension():this.fullBarElement.setDimension(this.viewOptions.barDimension),this.maxHandlePosition=this.fullBarElement.dimension-t,this.initHasRun&&(this.updateFloorLabel(),this.updateCeilLabel(),this.initHandles())}calculateViewDimensionsAndDetectChanges(){this.calculateViewDimensions(),this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}isRefDestroyed(){return this.changeDetectionRef.destroyed}updateTicksScale(){if(!this.viewOptions.showTicks)return;const t=oY.isNullOrUndefined(this.viewOptions.ticksArray)?this.getTicksArray():this.viewOptions.ticksArray,e=this.viewOptions.vertical?"translateY":"translateX";this.viewOptions.rightToLeft&&t.reverse();const n=t.map(t=>{let n=this.valueToPosition(t);this.viewOptions.vertical&&(n=this.maxHandlePosition-n);const i=e+"("+Math.round(n)+"px)",r=new fY;if(r.selected=this.isTickSelected(t),r.style={"-webkit-transform":i,"-moz-transform":i,"-o-transform":i,"-ms-transform":i,transform:i},r.selected&&!oY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)&&(r.style["background-color"]=this.getSelectionBarColor()),!r.selected&&!oY.isNullOrUndefined(this.viewOptions.getTickColor)&&(r.style["background-color"]=this.getTickColor(t)),oY.isNullOrUndefined(this.viewOptions.ticksTooltip)||(r.tooltip=this.viewOptions.ticksTooltip(t),r.tooltipPlacement=this.viewOptions.vertical?"right":"top"),this.viewOptions.showTicksValues&&t%this.viewOptions.tickValueStep==0&&(r.value=this.getDisplayValue(t,iY.TickValue),oY.isNullOrUndefined(this.viewOptions.ticksValuesTooltip)||(r.valueTooltip=this.viewOptions.ticksValuesTooltip(t),r.valueTooltipPlacement=this.viewOptions.vertical?"right":"top")),!oY.isNullOrUndefined(this.viewOptions.getLegend)){const e=this.viewOptions.getLegend(t);oY.isNullOrUndefined(e)||(r.legend=e)}return r});if(oY.isNullOrUndefined(this.ticks)||this.ticks.length!==n.length)this.ticks=n;else for(let i=0;i=this.viewLowValue)return!0}else if(this.viewOptions.showSelectionBar&&t<=this.viewLowValue)return!0}else{const e=this.viewOptions.showSelectionBarFromValue;if(this.viewLowValue>e&&t>=e&&t<=this.viewLowValue)return!0;if(this.viewLowValue=this.viewLowValue)return!0}return!!(this.range&&t>=this.viewLowValue&&t<=this.viewHighValue)}updateFloorLabel(){this.floorLabelElement.alwaysHide||(this.floorLabelElement.setValue(this.getDisplayValue(this.viewOptions.floor,iY.Floor)),this.floorLabelElement.calculateDimension(),this.floorLabelElement.setPosition(this.viewOptions.rightToLeft?this.fullBarElement.dimension-this.floorLabelElement.dimension:0))}updateCeilLabel(){this.ceilLabelElement.alwaysHide||(this.ceilLabelElement.setValue(this.getDisplayValue(this.viewOptions.ceil,iY.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}updateHandles(t,e){t===nY.Min?this.updateLowHandle(e):t===nY.Max&&this.updateHighHandle(e),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}getHandleLabelPos(t,e){const n=t===nY.Min?this.minHandleLabelElement.dimension:this.maxHandleLabelElement.dimension,i=e-n/2+this.handleHalfDimension,r=this.fullBarElement.dimension-n;return this.viewOptions.boundPointerLabels?this.viewOptions.rightToLeft&&t===nY.Min||!this.viewOptions.rightToLeft&&t===nY.Max?Math.min(i,r):Math.min(Math.max(i,0),r):i}updateLowHandle(t){this.minHandleElement.setPosition(t),this.minHandleLabelElement.setValue(this.getDisplayValue(this.viewLowValue,iY.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(nY.Min,t)),oY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(nY.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateHighHandle(t){this.maxHandleElement.setPosition(t),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,iY.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(nY.Max,t)),oY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(nY.Max)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateFloorAndCeilLabelsVisibility(){if(this.viewOptions.hidePointerLabels)return;let t=!1,e=!1;const n=this.isLabelBelowFloorLabel(this.minHandleLabelElement),i=this.isLabelAboveCeilLabel(this.minHandleLabelElement),r=this.isLabelAboveCeilLabel(this.maxHandleLabelElement),s=this.isLabelBelowFloorLabel(this.combinedLabelElement),o=this.isLabelAboveCeilLabel(this.combinedLabelElement);if(n?(t=!0,this.floorLabelElement.hide()):(t=!1,this.floorLabelElement.show()),i?(e=!0,this.ceilLabelElement.hide()):(e=!1,this.ceilLabelElement.show()),this.range){const i=this.combinedLabelElement.isVisible()?o:r,a=this.combinedLabelElement.isVisible()?s:n;i?this.ceilLabelElement.hide():e||this.ceilLabelElement.show(),a?this.floorLabelElement.hide():t||this.floorLabelElement.show()}}isLabelBelowFloorLabel(t){const e=t.position,n=this.floorLabelElement.position;return this.viewOptions.rightToLeft?e+t.dimension>=n-2:e<=n+this.floorLabelElement.dimension+2}isLabelAboveCeilLabel(t){const e=t.position,n=this.ceilLabelElement.position;return this.viewOptions.rightToLeft?e<=n+this.ceilLabelElement.dimension+2:e+t.dimension>=n-2}updateSelectionBar(){let t=0,e=0;const n=this.viewOptions.rightToLeft?!this.viewOptions.showSelectionBarEnd:this.viewOptions.showSelectionBarEnd,i=this.viewOptions.rightToLeft?this.maxHandleElement.position+this.handleHalfDimension:this.minHandleElement.position+this.handleHalfDimension;if(this.range)e=Math.abs(this.maxHandleElement.position-this.minHandleElement.position),t=i;else if(oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue))n?(e=Math.ceil(Math.abs(this.maxHandlePosition-this.minHandleElement.position)+this.handleHalfDimension),t=Math.floor(this.minHandleElement.position+this.handleHalfDimension)):(e=this.minHandleElement.position+this.handleHalfDimension,t=0);else{const n=this.viewOptions.showSelectionBarFromValue,i=this.valueToPosition(n);(this.viewOptions.rightToLeft?this.viewLowValue<=n:this.viewLowValue>n)?(e=this.minHandleElement.position-i,t=i+this.handleHalfDimension):(e=i-this.minHandleElement.position,t=this.minHandleElement.position+this.handleHalfDimension)}if(this.selectionBarElement.setDimension(e),this.selectionBarElement.setPosition(t),this.range&&this.viewOptions.showOuterSelectionBars&&(this.viewOptions.rightToLeft?(this.rightOuterSelectionBarElement.setDimension(t),this.rightOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.leftOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(t+e)),this.leftOuterSelectionBarElement.setPosition(t+e)):(this.leftOuterSelectionBarElement.setDimension(t),this.leftOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.rightOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(t+e)),this.rightOuterSelectionBarElement.setPosition(t+e))),oY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!oY.isNullOrUndefined(this.viewOptions.selectionBarGradient)){const i=oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue)?0:this.valueToPosition(this.viewOptions.showSelectionBarFromValue),r=i-t>0&&!n||i-t<=0&&n;this.barStyle={backgroundImage:"linear-gradient(to "+(this.viewOptions.vertical?r?"bottom":"top":r?"left":"right")+", "+this.viewOptions.selectionBarGradient.from+" 0%,"+this.viewOptions.selectionBarGradient.to+" 100%)"},this.viewOptions.vertical?(this.barStyle.backgroundPosition="center "+(i+e+t+(r?-this.handleHalfDimension:0))+"px",this.barStyle.backgroundSize="100% "+(this.fullBarElement.dimension-this.handleHalfDimension)+"px"):(this.barStyle.backgroundPosition=i-t+(r?this.handleHalfDimension:0)+"px center",this.barStyle.backgroundSize=this.fullBarElement.dimension-this.handleHalfDimension+"px 100%")}}else{const t=this.getSelectionBarColor();this.barStyle={backgroundColor:t}}}getSelectionBarColor(){return this.range?this.viewOptions.getSelectionBarColor(this.value,this.highValue):this.viewOptions.getSelectionBarColor(this.value)}getPointerColor(t){return this.viewOptions.getPointerColor(t===nY.Max?this.highValue:this.value,t)}getTickColor(t){return this.viewOptions.getTickColor(t)}updateCombinedLabel(){let t=null;if(t=this.viewOptions.rightToLeft?this.minHandleLabelElement.position-this.minHandleLabelElement.dimension-10<=this.maxHandleLabelElement.position:this.minHandleLabelElement.position+this.minHandleLabelElement.dimension+10>=this.maxHandleLabelElement.position,t){const t=this.getDisplayValue(this.viewLowValue,iY.Low),e=this.getDisplayValue(this.viewHighValue,iY.High),n=this.viewOptions.rightToLeft?this.viewOptions.combineLabels(e,t):this.viewOptions.combineLabels(t,e);this.combinedLabelElement.setValue(n);const i=this.viewOptions.boundPointerLabels?Math.min(Math.max(this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2,0),this.fullBarElement.dimension-this.combinedLabelElement.dimension):this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2;this.combinedLabelElement.setPosition(i),this.minHandleLabelElement.hide(),this.maxHandleLabelElement.hide(),this.combinedLabelElement.show()}else this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.maxHandleLabelElement.show(),this.minHandleLabelElement.show(),this.combinedLabelElement.hide();this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}getDisplayValue(t,e){return!oY.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(t=this.getStepValue(t)),this.viewOptions.translate(t,e)}roundStep(t,e){const n=oY.isNullOrUndefined(e)?this.viewOptions.step:e;let i=lY.roundToPrecisionLimit((t-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,lY.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}valueToPosition(t){let e=oY.linearValueToPosition;oY.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(e=oY.logValueToPosition):e=this.viewOptions.customValueToPosition;let n=e(t=lY.clampToRange(t,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return oY.isNullOrUndefined(n)&&(n=0),this.viewOptions.rightToLeft&&(n=1-n),n*this.maxHandlePosition}positionToValue(t){let e=t/this.maxHandlePosition;this.viewOptions.rightToLeft&&(e=1-e);let n=oY.linearPositionToValue;oY.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=oY.logPositionToValue):n=this.viewOptions.customPositionToValue;const i=n(e,this.viewOptions.floor,this.viewOptions.ceil);return oY.isNullOrUndefined(i)?0:i}getEventXY(t,e){if(t instanceof MouseEvent)return this.viewOptions.vertical?t.clientY:t.clientX;let n=0;const i=t.touches;if(!oY.isNullOrUndefined(e))for(let r=0;ri?nY.Max:this.viewOptions.rightToLeft?e>this.minHandleElement.position?nY.Min:nY.Max:ethis.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.on("mousedown",e=>this.onBarStart(nY.Min,t,e,!0,!0)),this.maxHandleElement.on("mousedown",e=>this.onBarStart(nY.Max,t,e,!0,!0))):(this.minHandleElement.on("mousedown",t=>this.onStart(nY.Min,t,!0,!0)),this.range&&this.maxHandleElement.on("mousedown",t=>this.onStart(nY.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0,!0)))),this.viewOptions.onlyBindHandles||this.selectionBarElement.onPassive("touchstart",e=>this.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.onPassive("touchstart",e=>this.onBarStart(nY.Min,t,e,!0,!0)),this.maxHandleElement.onPassive("touchstart",e=>this.onBarStart(nY.Max,t,e,!0,!0))):(this.minHandleElement.onPassive("touchstart",t=>this.onStart(nY.Min,t,!0,!0)),this.range&&this.maxHandleElement.onPassive("touchstart",t=>this.onStart(nY.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.onPassive("touchstart",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.onPassive("touchstart",t=>this.onStart(null,t,!1,!1,!0,!0)))),this.viewOptions.keyboardSupport&&(this.minHandleElement.on("focus",()=>this.onPointerFocus(nY.Min)),this.range&&this.maxHandleElement.on("focus",()=>this.onPointerFocus(nY.Max)))}unbindEvents(){this.unsubscribeOnMove(),this.unsubscribeOnEnd();for(const t of this.getAllSliderElements())oY.isNullOrUndefined(t)||t.off()}onBarStart(t,e,n,i,r,s,o){e?this.onDragStart(t,n,i,r):this.onStart(t,n,i,r,s,o)}onStart(t,e,n,i,r,s){e.stopPropagation(),(!aY.isTouchEvent(e)||!DX.Z.hasSupport)&&e.preventDefault(),this.calculateViewDimensions(),oY.isNullOrUndefined(t)&&(t=this.getNearestHandle(e)),this.currentTrackingPointer=t;const o=this.getPointerElement(t);if(o.active=!0,this.viewOptions.keyboardSupport&&o.focus(),n){this.unsubscribeOnMove();const t=t=>this.dragging.active?this.onDragMove(t):this.onMove(t);this.onMoveEventListener=aY.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchmove",t,this.viewOptions.touchEventsInterval):this.eventListenerHelper.attachEventListener(document,"mousemove",t,this.viewOptions.mouseEventsInterval)}if(i){this.unsubscribeOnEnd();const t=t=>this.onEnd(t);this.onEndEventListener=aY.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchend",t):this.eventListenerHelper.attachEventListener(document,"mouseup",t)}this.userChangeStart.emit(this.getChangeContext()),aY.isTouchEvent(e)&&!oY.isNullOrUndefined(e.changedTouches)&&oY.isNullOrUndefined(this.touchId)&&(this.touchId=e.changedTouches[0].identifier),r&&this.onMove(e,!0),s&&this.onEnd(e)}onMove(t,e){let n=null;if(aY.isTouchEvent(t)){const e=t.changedTouches;for(let t=0;t=this.maxHandlePosition?r=this.viewOptions.rightToLeft?this.viewOptions.floor:this.viewOptions.ceil:(r=this.positionToValue(i),r=e&&!oY.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(r,this.viewOptions.tickStep):this.roundStep(r)),this.positionTrackingHandle(r)}onEnd(t){aY.isTouchEvent(t)&&t.changedTouches[0].identifier!==this.touchId||(this.touchId=null,this.viewOptions.keyboardSupport||(this.minHandleElement.active=!1,this.maxHandleElement.active=!1,this.currentTrackingPointer=null),this.dragging.active=!1,this.unsubscribeOnMove(),this.unsubscribeOnEnd(),this.userChangeEnd.emit(this.getChangeContext()))}onPointerFocus(t){const e=this.getPointerElement(t);e.on("blur",()=>this.onPointerBlur(e)),e.on("keydown",t=>this.onKeyboardEvent(t)),e.on("keyup",()=>this.onKeyUp()),e.active=!0,this.currentTrackingPointer=t,this.currentFocusPointer=t,this.firstKeyDown=!0}onKeyUp(){this.firstKeyDown=!0,this.userChangeEnd.emit(this.getChangeContext())}onPointerBlur(t){t.off("blur"),t.off("keydown"),t.off("keyup"),t.active=!1,oY.isNullOrUndefined(this.touchId)&&(this.currentTrackingPointer=null,this.currentFocusPointer=null)}getKeyActions(t){const e=this.viewOptions.ceil-this.viewOptions.floor;let n=t+this.viewOptions.step,i=t-this.viewOptions.step,r=t+e/10,s=t-e/10;this.viewOptions.reversedControls&&(n=t-this.viewOptions.step,i=t+this.viewOptions.step,r=t-e/10,s=t+e/10);const o={UP:n,DOWN:i,LEFT:i,RIGHT:n,PAGEUP:r,PAGEDOWN:s,HOME:this.viewOptions.reversedControls?this.viewOptions.ceil:this.viewOptions.floor,END:this.viewOptions.reversedControls?this.viewOptions.floor:this.viewOptions.ceil};return this.viewOptions.rightToLeft&&(o.LEFT=n,o.RIGHT=i,this.viewOptions.vertical&&(o.UP=i,o.DOWN=n)),o}onKeyboardEvent(t){const e=this.getCurrentTrackingValue(),n=oY.isNullOrUndefined(t.keyCode)?t.which:t.keyCode,i=this.getKeyActions(e)[{38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"}[n]];if(oY.isNullOrUndefined(i)||oY.isNullOrUndefined(this.currentTrackingPointer))return;t.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));const r=lY.clampToRange(i,this.viewOptions.floor,this.viewOptions.ceil),s=this.roundStep(r);if(this.viewOptions.draggableRangeOnly){const t=this.viewHighValue-this.viewLowValue;let e,n;this.currentTrackingPointer===nY.Min?(e=s,n=s+t,n>this.viewOptions.ceil&&(n=this.viewOptions.ceil,e=n-t)):this.currentTrackingPointer===nY.Max&&(n=s,e=s-t,e=this.maxHandlePosition-n;let a,l;if(e<=i){if(0===r.position)return;a=this.getMinValue(e,!0,!1),l=this.getMaxValue(e,!0,!1)}else if(o){if(s.position===this.maxHandlePosition)return;l=this.getMaxValue(e,!0,!0),a=this.getMinValue(e,!0,!0)}else a=this.getMinValue(e,!1,!1),l=this.getMaxValue(e,!1,!1);this.positionTrackingBar(a,l)}positionTrackingBar(t,e){!oY.isNullOrUndefined(this.viewOptions.minLimit)&&tthis.viewOptions.maxLimit&&(t=lY.roundToPrecisionLimit((e=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=t,this.viewHighValue=e,this.applyViewChange(),this.updateHandles(nY.Min,this.valueToPosition(t)),this.updateHandles(nY.Max,this.valueToPosition(e))}positionTrackingHandle(t){t=this.applyMinMaxLimit(t),this.range&&(this.viewOptions.pushRange?t=this.applyPushRange(t):(this.viewOptions.noSwitching&&(this.currentTrackingPointer===nY.Min&&t>this.viewHighValue?t=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===nY.Max&&tthis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(nY.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=nY.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===nY.Max&&tthis.viewOptions.maxLimit?this.viewOptions.maxLimit:t}applyMinMaxRange(t){const e=Math.abs(t-(this.currentTrackingPointer===nY.Min?this.viewHighValue:this.viewLowValue));if(!oY.isNullOrUndefined(this.viewOptions.minRange)&&ethis.viewOptions.maxRange){if(this.currentTrackingPointer===nY.Min)return lY.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===nY.Max)return lY.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return t}applyPushRange(t){const e=this.currentTrackingPointer===nY.Min?this.viewHighValue-t:t-this.viewLowValue,n=oY.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ei&&(this.currentTrackingPointer===nY.Min?(this.viewHighValue=lY.roundToPrecisionLimit(t+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(nY.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===nY.Max&&(this.viewLowValue=lY.roundToPrecisionLimit(t-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(nY.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),t}getChangeContext(){const t=new sY;return t.pointerType=this.currentTrackingPointer,t.value=+this.value,this.range&&(t.highValue=+this.highValue),t}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl),ea(tc),ea(xu))},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,RX,5),2&t){let t;Wc(t=Yc())&&(e.tooltipTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&(qc(NX,5,hY),qc(LX,5,hY),qc(jX,5,hY),qc(FX,5,hY),qc(BX,5,dY),qc(VX,5,dY),qc(zX,5,pY),qc(UX,5,pY),qc(HX,5,pY),qc($X,5,pY),qc(GX,5,pY),qc(WX,5,hY)),2&t){let t;Wc(t=Yc())&&(e.leftOuterSelectionBarElement=t.first),Wc(t=Yc())&&(e.rightOuterSelectionBarElement=t.first),Wc(t=Yc())&&(e.fullBarElement=t.first),Wc(t=Yc())&&(e.selectionBarElement=t.first),Wc(t=Yc())&&(e.minHandleElement=t.first),Wc(t=Yc())&&(e.maxHandleElement=t.first),Wc(t=Yc())&&(e.floorLabelElement=t.first),Wc(t=Yc())&&(e.ceilLabelElement=t.first),Wc(t=Yc())&&(e.minHandleLabelElement=t.first),Wc(t=Yc())&&(e.maxHandleLabelElement=t.first),Wc(t=Yc())&&(e.combinedLabelElement=t.first),Wc(t=Yc())&&(e.ticksElement=t.first)}},hostAttrs:[1,"ng5-slider"],hostVars:5,hostBindings:function(t,e){1&t&&fa("resize",function(t){return e.onResize(t)},!1,Pr),2&t&&(Ko("disabled",e.sliderElementDisabledAttr),ja("vertical",e.sliderElementVerticalClass)("animate",e.sliderElementAnimateClass))},inputs:{value:"value",highValue:"highValue",options:"options",manualRefresh:"manualRefresh",triggerFocus:"triggerFocus"},outputs:{valueChange:"valueChange",highValueChange:"highValueChange",userChangeStart:"userChangeStart",userChange:"userChange",userChangeEnd:"userChangeEnd"},features:[_l([yY]),ye],decls:29,vars:13,consts:[["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-left-out-selection"],["leftOuterSelectionBar",""],[1,"ng5-slider-span","ng5-slider-bar"],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-right-out-selection"],["rightOuterSelectionBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-full-bar"],["fullBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-selection-bar"],["selectionBar",""],[1,"ng5-slider-span","ng5-slider-bar","ng5-slider-selection",3,"ngStyle"],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-min",3,"ngStyle"],["minHandle",""],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-max",3,"ngStyle"],["maxHandle",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-floor"],["floorLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-ceil"],["ceilLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-value"],["minHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-high"],["maxHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-combined"],["combinedLabel",""],["ng5SliderElement","",1,"ng5-slider-ticks",3,"hidden"],["ticksElement",""],["class","ng5-slider-tick",3,"ngClass","ngStyle",4,"ngFor","ngForOf"],[1,"ng5-slider-tick",3,"ngClass","ngStyle"],[3,"template","tooltip","placement"],["class","ng5-slider-span ng5-slider-tick-value",3,"template","tooltip","placement","content",4,"ngIf"],["class","ng5-slider-span ng5-slider-tick-legend",3,"innerHTML",4,"ngIf"],[1,"ng5-slider-span","ng5-slider-tick-value",3,"template","tooltip","placement","content"],[1,"ng5-slider-span","ng5-slider-tick-legend",3,"innerHTML"]],template:function(t,e){1&t&&(ra(0,"span",0,1),oa(2,"span",2),sa(),ra(3,"span",3,4),oa(5,"span",2),sa(),ra(6,"span",5,6),oa(8,"span",2),sa(),ra(9,"span",7,8),oa(11,"span",9),sa(),oa(12,"span",10,11),oa(14,"span",12,13),oa(16,"span",14,15),oa(18,"span",16,17),oa(20,"span",18,19),oa(22,"span",20,21),oa(24,"span",22,23),ra(26,"span",24,25),Jo(28,KX,4,9,"span",26),sa()),2&t&&(ws(6),ja("ng5-slider-transparent",e.fullBarTransparentClass),ws(3),ja("ng5-slider-draggable",e.selectionBarDraggableClass),ws(2),na("ngStyle",e.barStyle),ws(1),na("ngStyle",e.minPointerStyle),ws(2),La("display",e.range?"inherit":"none"),na("ngStyle",e.maxPointerStyle),ws(12),ja("ng5-slider-ticks-values-under",e.ticksUnderValuesClass),na("hidden",!e.showTicks),ws(2),na("ngForOf",e.ticks))},directives:function(){return[hY,Th,dY,pY,yh,mh,_Y,_h]},styles:[".ng5-slider{display:inline-block;position:relative;height:4px;width:100%;margin:35px 0 15px;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y} .ng5-slider.with-legend{margin-bottom:40px} .ng5-slider[disabled]{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-pointer{cursor:not-allowed;background-color:#d8e0f3} .ng5-slider[disabled] .ng5-slider-draggable{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-selection{background:#8b91a2} .ng5-slider[disabled] .ng5-slider-tick{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-tick.ng5-slider-selected{background:#8b91a2} .ng5-slider .ng5-slider-span{white-space:nowrap;position:absolute;display:inline-block} .ng5-slider .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider .ng5-slider-bar-wrapper{left:0;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:-16px;padding-top:16px;width:100%;height:32px;z-index:1} .ng5-slider .ng5-slider-draggable{cursor:move} .ng5-slider .ng5-slider-bar{left:0;width:100%;height:4px;z-index:1;background:#d8e0f3;border-radius:2px} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-transparent .ng5-slider-bar{background:0 0} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-left-out-selection .ng5-slider-bar{background:#df002d} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-right-out-selection .ng5-slider-bar{background:#03a688} .ng5-slider .ng5-slider-selection{z-index:2;background:#0db9f0;border-radius:2px} .ng5-slider .ng5-slider-pointer{cursor:pointer;width:32px;height:32px;top:-14px;background-color:#0db9f0;z-index:3;border-radius:16px} .ng5-slider .ng5-slider-pointer:after{content:'';width:8px;height:8px;position:absolute;top:12px;left:12px;border-radius:4px;background:#fff} .ng5-slider .ng5-slider-pointer:hover:after{background-color:#fff} .ng5-slider .ng5-slider-pointer.ng5-slider-active{z-index:4} .ng5-slider .ng5-slider-pointer.ng5-slider-active:after{background-color:#451aff} .ng5-slider .ng5-slider-bubble{cursor:default;bottom:16px;padding:1px 3px;color:#55637d;font-size:16px} .ng5-slider .ng5-slider-bubble.ng5-slider-limit{color:#55637d} .ng5-slider .ng5-slider-ticks{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:0;position:absolute;left:0;top:-3px;margin:0;z-index:1;list-style:none} .ng5-slider .ng5-slider-ticks-values-under .ng5-slider-tick-value{top:auto;bottom:-36px} .ng5-slider .ng5-slider-tick{text-align:center;cursor:pointer;width:10px;height:10px;background:#d8e0f3;border-radius:50%;position:absolute;top:0;left:0;margin-left:11px} .ng5-slider .ng5-slider-tick.ng5-slider-selected{background:#0db9f0} .ng5-slider .ng5-slider-tick-value{position:absolute;top:-34px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0)} .ng5-slider .ng5-slider-tick-legend{position:absolute;top:24px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0);max-width:50px;white-space:normal} .ng5-slider.vertical{position:relative;width:4px;height:100%;margin:0 20px;padding:0;vertical-align:baseline;-ms-touch-action:pan-x;touch-action:pan-x} .ng5-slider.vertical .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider.vertical .ng5-slider-bar-wrapper{top:auto;left:0;margin:0 0 0 -16px;padding:0 0 0 16px;height:100%;width:32px} .ng5-slider.vertical .ng5-slider-bar{bottom:0;left:auto;width:4px;height:100%} .ng5-slider.vertical .ng5-slider-pointer{left:-14px!important;top:auto;bottom:0} .ng5-slider.vertical .ng5-slider-bubble{left:16px!important;bottom:0} .ng5-slider.vertical .ng5-slider-ticks{height:100%;width:0;left:-3px;top:0;z-index:1} .ng5-slider.vertical .ng5-slider-tick{vertical-align:middle;margin-left:auto;margin-top:11px} .ng5-slider.vertical .ng5-slider-tick-value{left:24px;top:auto;-webkit-transform:translate(0,-28%);transform:translate(0,-28%)} .ng5-slider.vertical .ng5-slider-tick-legend{top:auto;right:24px;-webkit-transform:translate(0,-28%);transform:translate(0,-28%);max-width:none;white-space:nowrap} .ng5-slider.vertical .ng5-slider-ticks-values-under .ng5-slider-tick-value{bottom:auto;left:auto;right:24px} .ng5-slider *{-webkit-transition:none;transition:none} .ng5-slider.animate .ng5-slider-bar-wrapper{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-selection{-webkit-transition:background-color linear .3s;transition:background-color linear .3s} .ng5-slider.animate .ng5-slider-pointer{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-limit{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-combined{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-tick{-webkit-transition:background-color linear .3s;transition:background-color linear .3s}"]}),t})(),_Y=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider-tooltip-wrapper"]],inputs:{template:"template",tooltip:"tooltip",placement:"placement",content:"content"},decls:2,vars:2,consts:[[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ng5-slider-inner-tooltip"]],template:function(t,e){1&t&&(Jo(0,tY,2,6,"ng-container",0),Jo(1,eY,3,3,"ng-container",0)),2&t&&(na("ngIf",e.template),ws(1),na("ngIf",!e.template))},directives:[_h,kh],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),t})(),wY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})(),xY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Rf,Hp,cU,AX,wY]]}),t})(),SY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,cX,PX,xY,x_,f_]]}),t})(),EY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,SY]]}),t})(),CY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Az,Pz,kU,cU,jU,f_]]}),t})();class OY extends class{constructor(){this.expansionModel=new kp(!0)}toggle(t){this.expansionModel.toggle(this._trackByValue(t))}expand(t){this.expansionModel.select(this._trackByValue(t))}collapse(t){this.expansionModel.deselect(this._trackByValue(t))}isExpanded(t){return this.expansionModel.isSelected(this._trackByValue(t))}toggleDescendants(t){this.expansionModel.isSelected(this._trackByValue(t))?this.collapseDescendants(t):this.expandDescendants(t)}collapseAll(){this.expansionModel.clear()}expandDescendants(t){let e=[t];e.push(...this.getDescendants(t)),this.expansionModel.select(...e.map(t=>this._trackByValue(t)))}collapseDescendants(t){let e=[t];e.push(...this.getDescendants(t)),this.expansionModel.deselect(...e.map(t=>this._trackByValue(t)))}_trackByValue(t){return this.trackBy?this.trackBy(t):t}}{constructor(t,e,n){super(),this.getLevel=t,this.isExpandable=e,this.options=n,this.options&&(this.trackBy=this.options.trackBy)}getDescendants(t){const e=[];for(let n=this.dataNodes.indexOf(t)+1;nthis._trackByValue(t)))}}const TY=new oi("CDK_TREE_NODE_OUTLET_NODE");let kY=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(TY,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeOutlet",""]]}),t})();class AY{constructor(t){this.$implicit=t}}let PY=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:["cdkTreeNodeDefWhen","when"]}}),t})(),IY=(()=>{class t{constructor(t,e){this._differs=t,this._changeDetectorRef=e,this._onDestroy=new P,this._levels=new Map,this.viewChange=new Uf({start:0,end:Number.MAX_VALUE})}get dataSource(){return this._dataSource}set dataSource(t){this._dataSource!==t&&this._switchDataSource(t)}ngOnInit(){this._dataDiffer=this._differs.find([]).create(this.trackBy)}ngOnDestroy(){this._nodeOutlet.viewContainer.clear(),this.viewChange.complete(),this._onDestroy.next(),this._onDestroy.complete(),this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null)}ngAfterContentChecked(){const t=this._nodeDefs.filter(t=>!t.when);this._defaultNodeDef=t[0],this.dataSource&&this._nodeDefs&&!this._dataSubscription&&this._observeRenderChanges()}_switchDataSource(t){this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null),t||this._nodeOutlet.viewContainer.clear(),this._dataSource=t,this._nodeDefs&&this._observeRenderChanges()}_observeRenderChanges(){let t;!function(t){return t&&"function"==typeof t.connect}(this._dataSource)?Dd(this._dataSource)?t=this._dataSource:Array.isArray(this._dataSource)&&(t=wd(this._dataSource)):t=this._dataSource.connect(this),t&&(this._dataSubscription=t.pipe(Wd(this._onDestroy)).subscribe(t=>this.renderNodeChanges(t)))}renderNodeChanges(t,e=this._dataDiffer,n=this._nodeOutlet.viewContainer,i){const r=e.diff(t);!r||(r.forEachOperation((e,r,s)=>{if(null==e.previousIndex)this.insertNode(t[s],s,n,i);else if(null==s)n.remove(r),this._levels.delete(e.item);else{const t=n.get(r);n.move(t,s)}}),this._changeDetectorRef.detectChanges())}_getNodeDef(t,e){return 1===this._nodeDefs.length?this._nodeDefs.first:this._nodeDefs.find(n=>n.when&&n.when(e,t))||this._defaultNodeDef}insertNode(t,e,n,i){const r=this._getNodeDef(t,e),s=new AY(t);s.level=this.treeControl.getLevel?this.treeControl.getLevel(t):void 0!==i&&this._levels.has(i)?this._levels.get(i)+1:0,this._levels.set(t,s.level),(n||this._nodeOutlet.viewContainer).createEmbeddedView(r.template,s,e),MY.mostRecentTreeNode&&(MY.mostRecentTreeNode.data=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(ql),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["cdk-tree"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,PY,5),2&t){let t;Wc(t=Yc())&&(e._nodeDefs=t)}},viewQuery:function(t,e){if(1&t&&qc(kY,7),2&t){let t;Wc(t=Yc())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"cdk-tree"],inputs:{dataSource:"dataSource",treeControl:"treeControl",trackBy:"trackBy"},exportAs:["cdkTree"],decls:1,vars:0,consts:[["cdkTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[kY],encapsulation:2}),t})(),MY=(()=>{class t{constructor(e,n){this._elementRef=e,this._tree=n,this._destroyed=new P,this._dataChanges=new P,t.mostRecentTreeNode=this,this._elementRef.nativeElement.classList.add("cdk-tree-node"),this.role="treeitem"}get role(){return"treeitem"}set role(t){this._elementRef.nativeElement.setAttribute("role",t)}get data(){return this._data}set data(t){t!==this._data&&(this._data=t,this._setRoleFromData(),this._dataChanges.next())}get isExpanded(){return this._tree.treeControl.isExpanded(this._data)}_setExpanded(t){this._isAriaExpanded=t,this._elementRef.nativeElement.setAttribute("aria-expanded",`${t}`)}get level(){return this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._data):this._parentNodeAriaLevel}ngOnInit(){this._parentNodeAriaLevel=function(t){let e=t.parentElement;for(;e&&!DY(e);)e=e.parentElement;return e?e.classList.contains("cdk-nested-tree-node")?bd(e.getAttribute("aria-level")):0:-1}(this._elementRef.nativeElement),this._elementRef.nativeElement.setAttribute("aria-level",`${this.level+1}`)}ngDoCheck(){this.isExpanded!=this._isAriaExpanded&&this._setExpanded(this.isExpanded)}ngOnDestroy(){t.mostRecentTreeNode===this&&(t.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}focus(){this._elementRef.nativeElement.focus()}_setRoleFromData(){this.role="treeitem"}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(IY))},t.\u0275dir=se({type:t,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),t.mostRecentTreeNode=null,t})();function DY(t){const e=t.classList;return!(!(null==e?void 0:e.contains("cdk-nested-tree-node"))&&!(null==e?void 0:e.contains("cdk-tree")))}const RY=/([A-Za-z%]+)$/;let NY=(()=>{class t{constructor(t,e,n,i){this._treeNode=t,this._tree=e,this._element=n,this._dir=i,this._destroyed=new P,this.indentUnits="px",this._indent=40,this._setPadding(),i&&i.change.pipe(Wd(this._destroyed)).subscribe(()=>this._setPadding(!0)),t._dataChanges.subscribe(()=>this._setPadding())}get level(){return this._level}set level(t){this._setLevelInput(t)}get indent(){return this._indent}set indent(t){this._setIndentInput(t)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_paddingIndent(){const t=this._treeNode.data&&this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._treeNode.data):null,e=null==this._level?t:this._level;return"number"==typeof e?`${e*this._indent}${this.indentUnits}`:null}_setPadding(t=!1){const e=this._paddingIndent();if(e!==this._currentPadding||t){const t=this._element.nativeElement,n=this._dir&&"rtl"===this._dir.value?"paddingRight":"paddingLeft",i="paddingLeft"===n?"paddingRight":"paddingLeft";t.style[n]=e||"",t.style[i]="",this._currentPadding=e}}_setLevelInput(t){this._level=bd(t,null),this._setPadding()}_setIndentInput(t){let e=t,n="px";if("string"==typeof t){const i=t.split(RY);e=i[0],n=i[1]||n}this.indentUnits=n,this._indent=bd(e),this._setPadding()}}return t.\u0275fac=function(e){return new(e||t)(ea(MY),ea(IY),ea(kl),ea(Op,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),t})(),LY=(()=>{class t{constructor(t,e){this._tree=t,this._treeNode=e,this._recursive=!1}get recursive(){return this._recursive}set recursive(t){this._recursive=md(t)}_toggle(t){this.recursive?this._tree.treeControl.toggleDescendants(this._treeNode.data):this._tree.treeControl.toggle(this._treeNode.data),t.stopPropagation()}}return t.\u0275fac=function(e){return new(e||t)(ea(IY),ea(MY))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeToggle",""]],hostBindings:function(t,e){1&t&&fa("click",function(t){return e._toggle(t)})},inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]}}),t})(),jY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const FY=By(Ly(MY));let BY=(()=>{class t extends FY{constructor(t,e,n){super(t,e),this.tabIndex=Number(n)||0,t.nativeElement.classList.add("mat-tree-node")}ngOnInit(){super.ngOnInit()}ngDoCheck(){super.ngDoCheck()}ngOnDestroy(){super.ngOnDestroy()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(IY),ii("tabindex"))},t.\u0275dir=se({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[_l([{provide:MY,useExisting:t}]),jo]}),t})(),VY=(()=>{class t extends PY{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodeDef",""]],inputs:{when:["matTreeNodeDefWhen","when"],data:["matTreeNode","data"]},features:[_l([{provide:PY,useExisting:t}]),jo]}),t})(),zY=(()=>{class t extends NY{get level(){return this._level}set level(t){this._setLevelInput(t)}get indent(){return this._indent}set indent(t){this._setIndentInput(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodePadding",""]],inputs:{level:["matTreeNodePadding","level"],indent:["matTreeNodePaddingIndent","indent"]},features:[_l([{provide:NY,useExisting:t}]),jo]}),t})(),UY=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(TY,8))},t.\u0275dir=se({type:t,selectors:[["","matTreeNodeOutlet",""]],features:[_l([{provide:kY,useExisting:t}])]}),t})(),HY=(()=>{class t extends IY{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-tree"]],viewQuery:function(t,e){if(1&t&&qc(UY,7),2&t){let t;Wc(t=Yc())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[_l([{provide:IY,useExisting:t}]),jo],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[UY],styles:[".mat-tree{display:block}.mat-tree-node{display:flex;align-items:center;flex:1;word-wrap:break-word}.mat-nested-tree-node{border-bottom-width:0}\n"],encapsulation:2}),t})(),$Y=(()=>{class t extends LY{get recursive(){return this._recursive}set recursive(t){this._recursive=md(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodeToggle",""]],inputs:{recursive:["matTreeNodeToggleRecursive","recursive"]},features:[_l([{provide:LY,useExisting:t}]),jo]}),t})(),GY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[jY,Ny],Ny]}),t})();class WY{constructor(t,e,n,i){this.transformFunction=t,this.getLevel=e,this.isExpandable=n,this.getChildren=i}_flattenNode(t,e,n,i){const r=this.transformFunction(t,e);if(n.push(r),this.isExpandable(r)){const r=this.getChildren(t);r&&(Array.isArray(r)?this._flattenChildren(r,e,n,i):r.pipe(Gp(1)).subscribe(t=>{this._flattenChildren(t,e,n,i)}))}return n}_flattenChildren(t,e,n,i){t.forEach((r,s)=>{let o=i.slice();o.push(s!=t.length-1),this._flattenNode(r,e+1,n,o)})}flattenNodes(t){let e=[];return t.forEach(t=>this._flattenNode(t,0,e,[])),e}expandFlattenedNodes(t,e){let n=[],i=[];return i[0]=!0,t.forEach(t=>{let r=!0;for(let e=0;e<=this.getLevel(t);e++)r=r&&i[e];r&&n.push(t),this.isExpandable(t)&&(i[this.getLevel(t)+1]=e.isExpanded(t))}),n}}class qY extends class{}{constructor(t,e,n){super(),this._treeControl=t,this._treeFlattener=e,this._flattenedData=new Uf([]),this._expandedData=new Uf([]),this._data=new Uf([]),n&&(this.data=n)}get data(){return this._data.value}set data(t){this._data.next(t),this._flattenedData.next(this._treeFlattener.flattenNodes(this.data)),this._treeControl.dataNodes=this._flattenedData.value}connect(t){return Q(t.viewChange,this._treeControl.expansionModel.changed,this._flattenedData).pipe(D(()=>(this._expandedData.next(this._treeFlattener.expandFlattenedNodes(this._flattenedData.value,this._treeControl)),this._expandedData.value)))}disconnect(){}}let XY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,rw,GY,fG]]}),t})(),YY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,CY,XY]]}),t})(),KY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,CY,XY,YY],CY,XY,YY]}),t})();function QY(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function ZY(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(e).forEach(function(n){void 0===t[n]?t[n]=e[n]:QY(e[n])&&QY(t[n])&&Object.keys(e[n]).length>0&&ZY(t[n],e[n])})}var JY={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function tK(){var t="undefined"!=typeof document?document:{};return ZY(t,JY),t}var eK={document:JY,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(t){return"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0)},cancelAnimationFrame:function(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function nK(){var t="undefined"!=typeof window?window:{};return ZY(t,eK),t}function iK(t){return(iK=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rK(t,e){return(rK=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function sK(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(m){return!1}}function oK(t,e,n){return(oK=sK()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&rK(r,n.prototype),r}).apply(null,arguments)}function aK(t){var e="function"==typeof Map?new Map:void 0;return(aK=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return oK(t,arguments,iK(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),rK(n,t)})(t)}var lK=function(t){function e(e){var n;return function(t){var e=t.__proto__;Object.defineProperty(t,"__proto__",{get:function(){return e},set:function(t){e.__proto__=t}})}(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n=t.call.apply(t,[this].concat(e))||this)),n}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t),e}(aK(Array));function cK(t){void 0===t&&(t=[]);var e=[];return t.forEach(function(t){Array.isArray(t)?e.push.apply(e,cK(t)):e.push(t)}),e}function uK(t,e){return Array.prototype.filter.call(t,e)}function hK(t,e){var n=nK(),i=tK(),r=[];if(!e&&t instanceof lK)return t;if(!t)return new lK(r);if("string"==typeof t){var s=t.trim();if(s.indexOf("<")>=0&&s.indexOf(">")>=0){var o="div";0===s.indexOf("0}).length>0},toggleClass:function(){for(var t=arguments.length,e=new Array(t),n=0;n=0;p-=1){var f=d[p];s&&f.listener===s||s&&f.listener&&f.listener.dom7proxy&&f.listener.dom7proxy===s?(h.removeEventListener(c,f.proxyListener,o),d.splice(p,1)):s||(h.removeEventListener(c,f.proxyListener,o),d.splice(p,1))}}return this},trigger:function(){for(var t=nK(),e=arguments.length,n=new Array(e),i=0;i0}),c.dispatchEvent(u),c.dom7EventData=[],delete c.dom7EventData}}return this},transitionEnd:function(t){var e=this;return t&&e.on("transitionend",function n(i){i.target===this&&(t.call(this,i),e.off("transitionend",n))}),this},outerWidth:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetWidth+parseFloat(e.getPropertyValue("margin-right"))+parseFloat(e.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetHeight+parseFloat(e.getPropertyValue("margin-top"))+parseFloat(e.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},styles:function(){var t=nK();return this[0]?t.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var t=nK(),e=tK(),n=this[0],i=n.getBoundingClientRect(),r=e.body;return{top:i.top+(n===t?t.scrollY:n.scrollTop)-(n.clientTop||r.clientTop||0),left:i.left+(n===t?t.scrollX:n.scrollLeft)-(n.clientLeft||r.clientLeft||0)}}return null},css:function(t,e){var n,i=nK();if(1===arguments.length){if("string"!=typeof t){for(n=0;ne-1)return hK([]);if(t<0){var n=e+t;return hK(n<0?[]:[this[n]])}return hK([this[t]])},append:function(){for(var t,e=tK(),n=0;n=0;n-=1)this[e].insertBefore(r.childNodes[n],this[e].childNodes[0])}else if(t instanceof lK)for(n=0;n0?t?this[0].nextElementSibling&&hK(this[0].nextElementSibling).is(t)?hK([this[0].nextElementSibling]):hK([]):hK(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):hK([])},nextAll:function(t){var e=[],n=this[0];if(!n)return hK([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;t?hK(i).is(t)&&e.push(i):e.push(i),n=i}return hK(e)},prev:function(t){if(this.length>0){var e=this[0];return t?e.previousElementSibling&&hK(e.previousElementSibling).is(t)?hK([e.previousElementSibling]):hK([]):hK(e.previousElementSibling?[e.previousElementSibling]:[])}return hK([])},prevAll:function(t){var e=[],n=this[0];if(!n)return hK([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;t?hK(i).is(t)&&e.push(i):e.push(i),n=i}return hK(e)},parent:function(t){for(var e=[],n=0;n=0,observer:"MutationObserver"in t||"WebkitMutationObserver"in t,passiveListener:function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});t.addEventListener("testPassiveListener",null,n)}catch(i){}return e}(),gestures:"ongesturestart"in t}}()),gK}function OK(t){return void 0===t&&(t={}),mK||(mK=function(t){var e=(void 0===t?{}:t).userAgent,n=CK(),i=nK(),r=i.navigator.platform,s=e||i.navigator.userAgent,o={ios:!1,android:!1},a=i.screen.width,l=i.screen.height,c=s.match(/(Android);?[\s\/]+([\d.]+)?/),u=s.match(/(iPad).*OS\s([\d_]+)/),h=s.match(/(iPod)(.*OS\s([\d_]+))?/),d=!u&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),p="Win32"===r,f="MacIntel"===r;return!u&&f&&n.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(a+"x"+l)>=0&&((u=s.match(/(Version)\/([\d.]+)/))||(u=[0,1,"13_0_0"]),f=!1),c&&!p&&(o.os="android",o.android=!0),(u||d||h)&&(o.os="ios",o.ios=!0),o}(t)),mK}function TK(){return bK||(bK=function(){var t,e=nK();return{isEdge:!!e.navigator.userAgent.match(/Edge/g),isSafari:(t=e.navigator.userAgent.toLowerCase(),t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0),isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),bK}var kK={name:"resize",create:function(){var t=this;SK(t,{resize:{observer:null,createObserver:function(){!t||t.destroyed||!t.initialized||(t.resize.observer=new ResizeObserver(function(e){var n=t.width,i=t.height,r=n,s=i;e.forEach(function(e){var n=e.contentBoxSize,i=e.contentRect,o=e.target;o&&o!==t.el||(r=i?i.width:(n[0]||n).inlineSize,s=i?i.height:(n[0]||n).blockSize)}),(r!==n||s!==i)&&t.resize.resizeHandler()}),t.resize.observer.observe(t.el))},removeObserver:function(){t.resize.observer&&t.resize.observer.unobserve&&t.el&&(t.resize.observer.unobserve(t.el),t.resize.observer=null)},resizeHandler:function(){!t||t.destroyed||!t.initialized||(t.emit("beforeResize"),t.emit("resize"))},orientationChangeHandler:function(){!t||t.destroyed||!t.initialized||t.emit("orientationchange")}}})},on:{init:function(t){var e=nK();t.params.resizeObserver&&void 0!==nK().ResizeObserver?t.resize.createObserver():(e.addEventListener("resize",t.resize.resizeHandler),e.addEventListener("orientationchange",t.resize.orientationChangeHandler))},destroy:function(t){var e=nK();t.resize.removeObserver(),e.removeEventListener("resize",t.resize.resizeHandler),e.removeEventListener("orientationchange",t.resize.orientationChangeHandler)}}};function AK(){return(AK=Object.assign||function(t){for(var e=1;e0)&&(!r.isTouched||!r.isMoved))){s.noSwipingClass&&""!==s.noSwipingClass&&a.target&&a.target.shadowRoot&&t.path&&t.path[0]&&(l=yK(t.path[0]));var c=s.noSwipingSelector?s.noSwipingSelector:"."+s.noSwipingClass;if(s.noSwiping&&(a.target&&a.target.shadowRoot?function(t,e){return void 0===e&&(e=this),function e(n){return n&&n!==tK()&&n!==nK()?(n.assignedSlot&&(n=n.assignedSlot),n.closest(t)||e(n.getRootNode().host)):null}(e)}(c,a.target):l.closest(c)[0]))return void(e.allowClick=!0);if(!s.swipeHandler||l.closest(s.swipeHandler)[0]){o.currentX="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,o.currentY="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY;var u=o.currentX,h=o.currentY,d=s.edgeSwipeDetection||s.iOSEdgeSwipeDetection,p=s.edgeSwipeThreshold||s.iOSEdgeSwipeThreshold;if(d&&(u<=p||u>=i.innerWidth-p)){if("prevent"!==d)return;t.preventDefault()}if(SK(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=u,o.startY=h,r.touchStartTime=_K(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,s.threshold>0&&(r.allowThresholdMove=!1),"touchstart"!==a.type){var f=!0;l.is(r.focusableElements)&&(f=!1),n.activeElement&&yK(n.activeElement).is(r.focusableElements)&&n.activeElement!==l[0]&&n.activeElement.blur(),(s.touchStartForcePreventDefault||f&&e.allowTouchMove&&s.touchStartPreventDefault)&&!l[0].isContentEditable&&a.preventDefault()}e.emit("touchStart",a)}}}}function DK(t){var e=tK(),n=this,i=n.touchEventsData,r=n.params,s=n.touches,o=n.rtlTranslate;if(n.enabled){var a=t;if(a.originalEvent&&(a=a.originalEvent),!i.isTouched)return void(i.startMoving&&i.isScrolling&&n.emit("touchMoveOpposite",a));if(!i.isTouchEvent||"touchmove"===a.type){var l="touchmove"===a.type&&a.targetTouches&&(a.targetTouches[0]||a.changedTouches[0]),c="touchmove"===a.type?l.pageX:a.pageX,u="touchmove"===a.type?l.pageY:a.pageY;if(a.preventedByNestedSwiper)return s.startX=c,void(s.startY=u);if(!n.allowTouchMove)return n.allowClick=!1,void(i.isTouched&&(SK(s,{startX:c,startY:u,currentX:c,currentY:u}),i.touchStartTime=_K()));if(i.isTouchEvent&&r.touchReleaseOnEdges&&!r.loop)if(n.isVertical()){if(us.startY&&n.translate>=n.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(cs.startX&&n.translate>=n.minTranslate())return;if(i.isTouchEvent&&e.activeElement&&a.target===e.activeElement&&yK(a.target).is(i.focusableElements))return i.isMoved=!0,void(n.allowClick=!1);if(i.allowTouchCallbacks&&n.emit("touchMove",a),!(a.targetTouches&&a.targetTouches.length>1)){s.currentX=c,s.currentY=u;var h=s.currentX-s.startX,d=s.currentY-s.startY;if(!(n.params.threshold&&Math.sqrt(Math.pow(h,2)+Math.pow(d,2))=25&&(p=180*Math.atan2(Math.abs(d),Math.abs(h))/Math.PI,i.isScrolling=n.isHorizontal()?p>r.touchAngle:90-p>r.touchAngle)),i.isScrolling&&n.emit("touchMoveOpposite",a),void 0===i.startMoving&&(s.currentX!==s.startX||s.currentY!==s.startY)&&(i.startMoving=!0),i.isScrolling)return void(i.isTouched=!1);if(i.startMoving){n.allowClick=!1,!r.cssMode&&a.cancelable&&a.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&a.stopPropagation(),i.isMoved||(r.loop&&n.loopFix(),i.startTranslate=n.getTranslate(),n.setTransition(0),n.animating&&n.$wrapperEl.trigger("webkitTransitionEnd transitionend"),i.allowMomentumBounce=!1,r.grabCursor&&(!0===n.allowSlideNext||!0===n.allowSlidePrev)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",a)),n.emit("sliderMove",a),i.isMoved=!0;var f=n.isHorizontal()?h:d;s.diff=f,f*=r.touchRatio,o&&(f=-f),n.swipeDirection=f>0?"prev":"next",i.currentTranslate=f+i.startTranslate;var g=!0,m=r.resistanceRatio;if(r.touchReleaseOnEdges&&(m=0),f>0&&i.currentTranslate>n.minTranslate()?(g=!1,r.resistance&&(i.currentTranslate=n.minTranslate()-1+Math.pow(-n.minTranslate()+i.startTranslate+f,m))):f<0&&i.currentTranslatei.startTranslate&&(i.currentTranslate=i.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(f)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,i.currentTranslate=i.startTranslate,void(s.diff=n.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}!r.followFinger||r.cssMode||((r.freeMode||r.watchSlidesProgress||r.watchSlidesVisibility)&&(n.updateActiveIndex(),n.updateSlidesClasses()),r.freeMode&&(0===i.velocities.length&&i.velocities.push({position:s[n.isHorizontal()?"startX":"startY"],time:i.touchStartTime}),i.velocities.push({position:s[n.isHorizontal()?"currentX":"currentY"],time:_K()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function RK(t){var e=this,n=e.touchEventsData,i=e.params,r=e.touches,s=e.rtlTranslate,o=e.$wrapperEl,a=e.slidesGrid,l=e.snapGrid;if(e.enabled){var c=t;if(c.originalEvent&&(c=c.originalEvent),n.allowTouchCallbacks&&e.emit("touchEnd",c),n.allowTouchCallbacks=!1,!n.isTouched)return n.isMoved&&i.grabCursor&&e.setGrabCursor(!1),n.isMoved=!1,void(n.startMoving=!1);i.grabCursor&&n.isMoved&&n.isTouched&&(!0===e.allowSlideNext||!0===e.allowSlidePrev)&&e.setGrabCursor(!1);var u,h=_K(),d=h-n.touchStartTime;if(e.allowClick&&(e.updateClickedSlide(c),e.emit("tap click",c),d<300&&h-n.lastClickTime<300&&e.emit("doubleTap doubleClick",c)),n.lastClickTime=_K(),vK(function(){e.destroyed||(e.allowClick=!0)}),!n.isTouched||!n.isMoved||!e.swipeDirection||0===r.diff||n.currentTranslate===n.startTranslate)return n.isTouched=!1,n.isMoved=!1,void(n.startMoving=!1);if(n.isTouched=!1,n.isMoved=!1,n.startMoving=!1,u=i.followFinger?s?e.translate:-e.translate:-n.currentTranslate,!i.cssMode){if(i.freeMode){if(u<-e.minTranslate())return void e.slideTo(e.activeIndex);if(u>-e.maxTranslate())return void e.slideTo(e.slides.length1){var p=n.velocities.pop(),f=n.velocities.pop(),g=p.time-f.time;e.velocity=(p.position-f.position)/g,e.velocity/=2,Math.abs(e.velocity)150||_K()-p.time>300)&&(e.velocity=0)}else e.velocity=0;e.velocity*=i.freeModeMomentumVelocityRatio,n.velocities.length=0;var m=1e3*i.freeModeMomentumRatio,b=e.translate+e.velocity*m;s&&(b=-b);var y,v,_=!1,w=20*Math.abs(e.velocity)*i.freeModeMomentumBounceRatio;if(be.minTranslate())i.freeModeMomentumBounce?(b-e.minTranslate()>w&&(b=e.minTranslate()+w),y=e.minTranslate(),_=!0,n.allowMomentumBounce=!0):b=e.minTranslate(),i.loop&&i.centeredSlides&&(v=!0);else if(i.freeModeSticky){for(var x,S=0;S-b){x=S;break}b=-(b=Math.abs(l[x]-b)=i.longSwipesMs)&&(e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses()))}for(var O=0,T=e.slidesSizesGrid[0],k=0;k=a[k]&&u=a[k]&&(O=k,T=a[a.length-1]-a[a.length-2])}var P=(u-a[O])/T,I=Oi.longSwipesMs){if(!i.longSwipes)return void e.slideTo(e.activeIndex);"next"===e.swipeDirection&&e.slideTo(P>=i.longSwipesRatio?O+I:O),"prev"===e.swipeDirection&&e.slideTo(P>1-i.longSwipesRatio?O+I:O)}else{if(!i.shortSwipes)return void e.slideTo(e.activeIndex);!e.navigation||c.target!==e.navigation.nextEl&&c.target!==e.navigation.prevEl?("next"===e.swipeDirection&&e.slideTo(O+I),"prev"===e.swipeDirection&&e.slideTo(O)):e.slideTo(c.target===e.navigation.nextEl?O+I:O)}}}}function NK(){var t=this,e=t.params,n=t.el;if(!n||0!==n.offsetWidth){e.breakpoints&&t.setBreakpoint();var i=t.allowSlideNext,r=t.allowSlidePrev,s=t.snapGrid;t.allowSlideNext=!0,t.allowSlidePrev=!0,t.updateSize(),t.updateSlides(),t.updateSlidesClasses(),t.slideTo(("auto"===e.slidesPerView||e.slidesPerView>1)&&t.isEnd&&!t.isBeginning&&!t.params.centeredSlides?t.slides.length-1:t.activeIndex,0,!1,!0),t.autoplay&&t.autoplay.running&&t.autoplay.paused&&t.autoplay.run(),t.allowSlidePrev=r,t.allowSlideNext=i,t.params.watchOverflow&&s!==t.snapGrid&&t.checkOverflow()}}function LK(t){var e=this;!e.enabled||e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation()))}function jK(){var t=this,e=t.wrapperEl,n=t.rtlTranslate;if(t.enabled){t.previousTranslate=t.translate,t.translate=t.isHorizontal()?n?e.scrollWidth-e.offsetWidth-e.scrollLeft:-e.scrollLeft:-e.scrollTop,-0===t.translate&&(t.translate=0),t.updateActiveIndex(),t.updateSlidesClasses();var i=t.maxTranslate()-t.minTranslate();(0===i?0:(t.translate-t.minTranslate())/i)!==t.progress&&t.updateProgress(n?-t.translate:t.translate),t.emit("setTranslate",t.translate,!1)}}var FK=!1;function BK(){}var VK={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!1,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,slidesPerGroupSkip:0,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,loopPreventsSlide:!0,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0,_emitClasses:!1};function zK(t,e){for(var n=0;n=0&&e.eventsAnyListeners.splice(n,1),e},off:function(t,e){var n=this;return n.eventsListeners&&t.split(" ").forEach(function(t){void 0===e?n.eventsListeners[t]=[]:n.eventsListeners[t]&&n.eventsListeners[t].forEach(function(i,r){(i===e||i.__emitterProxy&&i.__emitterProxy===e)&&n.eventsListeners[t].splice(r,1)})}),n},emit:function(){var t=this;if(!t.eventsListeners)return t;for(var e,n,i,r=arguments.length,s=new Array(r),o=0;o=0&&(v=parseFloat(v.replace("%",""))/100*s),t.virtualSize=-v,u.css(o?{marginLeft:"",marginBottom:"",marginTop:""}:{marginRight:"",marginBottom:"",marginTop:""}),i.slidesPerColumn>1&&(S=Math.floor(h/i.slidesPerColumn)===h/t.params.slidesPerColumn?h:Math.ceil(h/i.slidesPerColumn)*i.slidesPerColumn,"auto"!==i.slidesPerView&&"row"===i.slidesPerColumnFill&&(S=Math.max(S,i.slidesPerView*i.slidesPerColumn)));for(var T,k=i.slidesPerColumn,A=S/k,P=Math.floor(h/i.slidesPerColumn),I=0;I1){var D=void 0,R=void 0,N=void 0;if("row"===i.slidesPerColumnFill&&i.slidesPerGroup>1){var L=Math.floor(I/(i.slidesPerGroup*i.slidesPerColumn)),j=I-i.slidesPerColumn*i.slidesPerGroup*L,F=0===L?i.slidesPerGroup:Math.min(Math.ceil((h-L*k*i.slidesPerGroup)/k),i.slidesPerGroup);N=Math.floor(j/F),M.css({"-webkit-box-ordinal-group":D=(R=j-N*F+L*i.slidesPerGroup)+N*S/k,"-moz-box-ordinal-group":D,"-ms-flex-order":D,"-webkit-order":D,order:D})}else"column"===i.slidesPerColumnFill?(N=I-(R=Math.floor(I/k))*k,(R>P||R===P&&N===k-1)&&(N+=1)>=k&&(N=0,R+=1)):R=I-(N=Math.floor(I/A))*A;M.css(e("margin-top"),0!==N?i.spaceBetween&&i.spaceBetween+"px":"")}if("none"!==M.css("display")){if("auto"===i.slidesPerView){var B=getComputedStyle(M[0]),V=M[0].style.transform,z=M[0].style.webkitTransform;if(V&&(M[0].style.transform="none"),z&&(M[0].style.webkitTransform="none"),i.roundLengths)T=t.isHorizontal()?M.outerWidth(!0):M.outerHeight(!0);else{var U=n(B,"width"),H=n(B,"padding-left"),$=n(B,"padding-right"),G=n(B,"margin-left"),W=n(B,"margin-right"),q=B.getPropertyValue("box-sizing");if(q&&"border-box"===q)T=U+G+W;else{var X=M[0];T=U+H+$+G+W+(X.offsetWidth-X.clientWidth)}}V&&(M[0].style.transform=V),z&&(M[0].style.webkitTransform=z),i.roundLengths&&(T=Math.floor(T))}else T=(s-(i.slidesPerView-1)*v)/i.slidesPerView,i.roundLengths&&(T=Math.floor(T)),u[I]&&(u[I].style[e("width")]=T+"px");u[I]&&(u[I].swiperSlideSize=T),f.push(T),i.centeredSlides?(_=_+T/2+w/2+v,0===w&&0!==I&&(_=_-s/2-v),0===I&&(_=_-s/2-v),Math.abs(_)<.001&&(_=0),i.roundLengths&&(_=Math.floor(_)),x%i.slidesPerGroup==0&&d.push(_),p.push(_)):(i.roundLengths&&(_=Math.floor(_)),(x-Math.min(t.params.slidesPerGroupSkip,x))%t.params.slidesPerGroup==0&&d.push(_),p.push(_),_=_+T+v),t.virtualSize+=T+v,w=T,x+=1}}if(t.virtualSize=Math.max(t.virtualSize,s)+m,o&&a&&("slide"===i.effect||"coverflow"===i.effect)&&r.css({width:t.virtualSize+i.spaceBetween+"px"}),i.setWrapperSize&&r.css(((C={})[e("width")]=t.virtualSize+i.spaceBetween+"px",C)),i.slidesPerColumn>1&&(t.virtualSize=(T+i.spaceBetween)*S,t.virtualSize=Math.ceil(t.virtualSize/i.slidesPerColumn)-i.spaceBetween,r.css(((O={})[e("width")]=t.virtualSize+i.spaceBetween+"px",O)),i.centeredSlides)){E=[];for(var Y=0;Y1&&d.push(t.virtualSize-s)}if(0===d.length&&(d=[0]),0!==i.spaceBetween){var J,tt=t.isHorizontal()&&o?"marginLeft":e("marginRight");u.filter(function(t,e){return!i.cssMode||e!==u.length-1}).css(((J={})[tt]=v+"px",J))}if(i.centeredSlides&&i.centeredSlidesBounds){var et=0;f.forEach(function(t){et+=t+(i.spaceBetween?i.spaceBetween:0)});var nt=(et-=i.spaceBetween)-s;d=d.map(function(t){return t<0?-g:t>nt?nt+m:t})}if(i.centerInsufficientSlides){var it=0;if(f.forEach(function(t){it+=t+(i.spaceBetween?i.spaceBetween:0)}),(it-=i.spaceBetween)1)if(n.params.centeredSlides)n.visibleSlides.each(function(t){i.push(t)});else for(e=0;en.slides.length&&!r)break;i.push(o(a))}else i.push(o(n.activeIndex));for(e=0;es?l:s}s&&n.$wrapperEl.css("height",s+"px")},updateSlidesOffset:function(){for(var t=this.slides,e=0;e=0&&c1&&u<=e.size||c<=0&&u>=e.size)&&(e.visibleSlides.push(a),e.visibleSlidesIndexes.push(o),i.eq(o).addClass(n.slideVisibleClass))}a.progress=r?-l:l}e.visibleSlides=yK(e.visibleSlides)}},updateProgress:function(t){var e=this;void 0===t&&(t=e&&e.translate&&e.translate*(e.rtlTranslate?-1:1)||0);var n=e.params,i=e.maxTranslate()-e.minTranslate(),r=e.progress,s=e.isBeginning,o=e.isEnd,a=s,l=o;0===i?(r=0,s=!0,o=!0):(s=(r=(t-e.minTranslate())/i)<=0,o=r>=1),SK(e,{progress:r,isBeginning:s,isEnd:o}),(n.watchSlidesProgress||n.watchSlidesVisibility||n.centeredSlides&&n.autoHeight)&&e.updateSlidesProgress(t),s&&!a&&e.emit("reachBeginning toEdge"),o&&!l&&e.emit("reachEnd toEdge"),(a&&!s||l&&!o)&&e.emit("fromEdge"),e.emit("progress",r)},updateSlidesClasses:function(){var t,e=this,n=e.slides,i=e.params,r=e.$wrapperEl,s=e.activeIndex,o=e.realIndex,a=e.virtual&&i.virtual.enabled;n.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(t=a?e.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+s+'"]'):n.eq(s)).addClass(i.slideActiveClass),i.loop&&(t.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+o+'"]').addClass(i.slideDuplicateActiveClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+o+'"]').addClass(i.slideDuplicateActiveClass));var l=t.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===l.length&&(l=n.eq(0)).addClass(i.slideNextClass);var c=t.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===c.length&&(c=n.eq(-1)).addClass(i.slidePrevClass),i.loop&&(l.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),c.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass)),e.emitSlidesClasses()},updateActiveIndex:function(t){var e,n=this,i=n.rtlTranslate?n.translate:-n.translate,r=n.slidesGrid,s=n.snapGrid,o=n.params,a=n.activeIndex,l=n.realIndex,c=n.snapIndex,u=t;if(void 0===u){for(var h=0;h=r[h]&&i=r[h]&&i=r[h]&&(u=h);o.normalizeSlideIndex&&(u<0||void 0===u)&&(u=0)}if(s.indexOf(i)>=0)e=s.indexOf(i);else{var d=Math.min(o.slidesPerGroupSkip,u);e=d+Math.floor((u-d)/o.slidesPerGroup)}if(e>=s.length&&(e=s.length-1),u!==a){var p=parseInt(n.slides.eq(u).attr("data-swiper-slide-index")||u,10);SK(n,{snapIndex:e,realIndex:p,previousIndex:a,activeIndex:u}),n.emit("activeIndexChange"),n.emit("snapIndexChange"),l!==p&&n.emit("realIndexChange"),(n.initialized||n.params.runCallbacksOnInit)&&n.emit("slideChange")}else e!==c&&(n.snapIndex=e,n.emit("snapIndexChange"))},updateClickedSlide:function(t){var e,n=this,i=n.params,r=yK(t.target).closest("."+i.slideClass)[0],s=!1;if(r)for(var o=0;o6&&(i=i.split(", ").map(function(t){return t.replace(",",".")}).join(", ")),r=new s.WebKitCSSMatrix("none"===i?"":i)):n=(r=o.MozTransform||o.OTransform||o.MsTransform||o.msTransform||o.transform||o.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===e&&(i=s.WebKitCSSMatrix?r.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===e&&(i=s.WebKitCSSMatrix?r.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),i||0}(e.$wrapperEl[0],t);return i&&(s=-s),s||0},setTranslate:function(t,e){var n=this,i=n.rtlTranslate,r=n.params,s=n.$wrapperEl,o=n.wrapperEl,a=n.progress,l=0,c=0;n.isHorizontal()?l=i?-t:t:c=t,r.roundLengths&&(l=Math.floor(l),c=Math.floor(c)),r.cssMode?o[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-l:-c:r.virtualTranslate||s.transform("translate3d("+l+"px, "+c+"px, 0px)"),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?l:c;var u=n.maxTranslate()-n.minTranslate();(0===u?0:(t-n.minTranslate())/u)!==a&&n.updateProgress(t),n.emit("setTranslate",n.translate,e)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(t,e,n,i,r){void 0===t&&(t=0),void 0===e&&(e=this.params.speed),void 0===n&&(n=!0),void 0===i&&(i=!0);var s=this,o=s.params,a=s.wrapperEl;if(s.animating&&o.preventInteractionOnTransition)return!1;var l,c=s.minTranslate(),u=s.maxTranslate();if(s.updateProgress(l=i&&t>c?c:i&&ts?"next":ir?"next":i=c.length&&(m=c.length-1),(d||l.initialSlide||0)===(h||0)&&n&&o.emit("beforeSlideChangeStart");var b,y=-c[m];if(o.updateProgress(y),l.normalizeSlideIndex)for(var v=0;v=w&&_=w&&_=w&&(a=v)}if(o.initialized&&a!==d&&(!o.allowSlideNext&&yo.translate&&y>o.maxTranslate()&&(d||0)!==a))return!1;if(b=a>d?"next":a=t&&(d=t)}),void 0!==d&&(c=o.indexOf(d))<0&&(c=i.activeIndex-1),i.slideTo(c,t,e,n)},slideReset:function(t,e,n){return void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),this.slideTo(this.activeIndex,t,e,n)},slideToClosest:function(t,e,n,i){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),void 0===i&&(i=.5);var r=this,s=r.activeIndex,o=Math.min(r.params.slidesPerGroupSkip,s),a=o+Math.floor((s-o)/r.params.slidesPerGroup),l=r.rtlTranslate?r.translate:-r.translate;if(l>=r.snapGrid[a]){var c=r.snapGrid[a];l-c>(r.snapGrid[a+1]-c)*i&&(s+=r.params.slidesPerGroup)}else{var u=r.snapGrid[a-1];l-u<=(r.snapGrid[a]-u)*i&&(s-=r.params.slidesPerGroup)}return s=Math.max(s,0),s=Math.min(s,r.slidesGrid.length-1),r.slideTo(s,t,e,n)},slideToClickedSlide:function(){var t,e=this,n=e.params,i=e.$wrapperEl,r="auto"===n.slidesPerView?e.slidesPerViewDynamic():n.slidesPerView,s=e.clickedIndex;if(n.loop){if(e.animating)return;t=parseInt(yK(e.clickedSlide).attr("data-swiper-slide-index"),10),n.centeredSlides?se.slides.length-e.loopedSlides+r/2?(e.loopFix(),s=i.children("."+n.slideClass+'[data-swiper-slide-index="'+t+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),vK(function(){e.slideTo(s)})):e.slideTo(s):s>e.slides.length-r?(e.loopFix(),s=i.children("."+n.slideClass+'[data-swiper-slide-index="'+t+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),vK(function(){e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}},loop:{loopCreate:function(){var t=this,e=tK(),n=t.params,i=t.$wrapperEl;i.children("."+n.slideClass+"."+n.slideDuplicateClass).remove();var r=i.children("."+n.slideClass);if(n.loopFillGroupWithBlank){var s=n.slidesPerGroup-r.length%n.slidesPerGroup;if(s!==n.slidesPerGroup){for(var o=0;or.length&&(t.loopedSlides=r.length);var l=[],c=[];r.each(function(e,n){var i=yK(e);n=r.length-t.loopedSlides&&l.push(e),i.attr("data-swiper-slide-index",n)});for(var u=0;u=0;h-=1)i.prepend(yK(l[h].cloneNode(!0)).addClass(n.slideDuplicateClass))},loopFix:function(){var t=this;t.emit("beforeLoopFix");var e,n=t.activeIndex,i=t.slides,r=t.loopedSlides,s=t.allowSlidePrev,o=t.allowSlideNext,a=t.snapGrid,l=t.rtlTranslate;t.allowSlidePrev=!0,t.allowSlideNext=!0;var c=-a[n]-t.getTranslate();n=i.length-r&&(e=-i.length+n+r,t.slideTo(e+=r,0,!1,!0)&&0!==c&&t.setTranslate((l?-t.translate:t.translate)-c)),t.allowSlidePrev=s,t.allowSlideNext=o,t.emit("loopFix")},loopDestroy:function(){var t=this,e=t.params,n=t.slides;t.$wrapperEl.children("."+e.slideClass+"."+e.slideDuplicateClass+",."+e.slideClass+"."+e.slideBlankClass).remove(),n.removeAttr("data-swiper-slide-index")}},grabCursor:{setGrabCursor:function(t){var e=this;if(!(e.support.touch||!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)){var n=e.el;n.style.cursor="move",n.style.cursor=t?"-webkit-grabbing":"-webkit-grab",n.style.cursor=t?"-moz-grabbin":"-moz-grab",n.style.cursor=t?"grabbing":"grab"}},unsetGrabCursor:function(){var t=this;t.support.touch||t.params.watchOverflow&&t.isLocked||t.params.cssMode||(t.el.style.cursor="")}},manipulation:{appendSlide:function(t){var e=this,n=e.$wrapperEl,i=e.params;if(i.loop&&e.loopDestroy(),"object"==typeof t&&"length"in t)for(var r=0;r=o)n.appendSlide(e);else{for(var a=s>t?s+1:s,l=[],c=o-1;c>=t;c-=1){var u=n.slides.eq(c);u.remove(),l.unshift(u)}if("object"==typeof e&&"length"in e){for(var h=0;ht?s+e.length:s}else i.append(e);for(var d=0;d1,d=u.slidesPerColumn>1,p=s.enabled;h&&!d?(o.removeClass(s.containerModifierClass+"multirow "+s.containerModifierClass+"multirow-column"),t.emitContainerClasses()):!h&&d&&(o.addClass(s.containerModifierClass+"multirow"),(u.slidesPerColumnFill&&"column"===u.slidesPerColumnFill||!u.slidesPerColumnFill&&"column"===s.slidesPerColumnFill)&&o.addClass(s.containerModifierClass+"multirow-column"),t.emitContainerClasses());var f=u.direction&&u.direction!==s.direction,g=s.loop&&(u.slidesPerView!==s.slidesPerView||f);f&&n&&t.changeDirection(),SK(t.params,u);var m=t.params.enabled;SK(t,{allowTouchMove:t.params.allowTouchMove,allowSlideNext:t.params.allowSlideNext,allowSlidePrev:t.params.allowSlidePrev}),p&&!m?t.disable():!p&&m&&t.enable(),t.currentBreakpoint=l,t.emit("_beforeBreakpoint",u),g&&n&&(t.loopDestroy(),t.loopCreate(),t.updateSlides(),t.slideTo(e-r+t.loopedSlides,0,!1)),t.emit("breakpoint",u)}}},getBreakpoint:function(t,e,n){if(void 0===e&&(e="window"),t&&("container"!==e||n)){var i=!1,r=nK(),s="window"===e?r.innerHeight:n.clientHeight,o=Object.keys(t).map(function(t){if("string"==typeof t&&0===t.indexOf("@")){var e=parseFloat(t.substr(1));return{value:s*e,point:t}}return{value:t,point:t}});o.sort(function(t,e){return parseInt(t.value,10)-parseInt(e.value,10)});for(var a=0;a0&&e.slidesOffsetBefore+e.spaceBetween*(t.slides.length-1)+t.slides[0].offsetWidth*t.slides.length;t.isLocked=e.slidesOffsetBefore&&e.slidesOffsetAfter&&i?i<=t.size:1===t.snapGrid.length,t.allowSlideNext=!t.isLocked,t.allowSlidePrev=!t.isLocked,n!==t.isLocked&&t.emit(t.isLocked?"lock":"unlock"),n&&n!==t.isLocked&&(t.isEnd=!1,t.navigation&&t.navigation.update())}},classes:{addClasses:function(){var t=this,e=t.classNames,n=t.params,i=t.$el,r=t.device,s=t.support,o=function(t,e){var n=[];return t.forEach(function(t){"object"==typeof t?Object.keys(t).forEach(function(i){t[i]&&n.push(e+i)}):"string"==typeof t&&n.push(e+t)}),n}(["initialized",n.direction,{"pointer-events":s.pointerEvents&&!s.touch},{"free-mode":n.freeMode},{autoheight:n.autoHeight},{rtl:t.rtl},{multirow:n.slidesPerColumn>1},{"multirow-column":n.slidesPerColumn>1&&"column"===n.slidesPerColumnFill},{android:r.android},{ios:r.ios},{"css-mode":n.cssMode}],n.containerModifierClass);e.push.apply(e,o),i.addClass([].concat(e).join(" ")),t.emitContainerClasses()},removeClasses:function(){var t=this;t.$el.removeClass(t.classNames.join(" ")),t.emitContainerClasses()}},images:{loadImage:function(t,e,n,i,r,s){var o,a=nK();function l(){s&&s()}yK(t).parent("picture")[0]||t.complete&&r||!e?l():((o=new a.Image).onload=l,o.onerror=l,i&&(o.sizes=i),n&&(o.srcset=n),e&&(o.src=e))},preloadImages:function(){var t=this;function e(){null==t||!t||t.destroyed||(void 0!==t.imagesLoaded&&(t.imagesLoaded+=1),t.imagesLoaded===t.imagesToLoad.length&&(t.params.updateOnImagesReady&&t.update(),t.emit("imagesReady")))}t.imagesToLoad=t.$el.find("img");for(var n=0;n1){var o=[];return yK(n.el).each(function(e){var i=SK({},n,{el:e});o.push(new t(i))}),o}var a=this;a.__swiper__=!0,a.support=CK(),a.device=OK({userAgent:n.userAgent}),a.browser=TK(),a.eventsListeners={},a.eventsAnyListeners=[],void 0===a.modules&&(a.modules={}),Object.keys(a.modules).forEach(function(t){var e=a.modules[t];if(e.params){var i=Object.keys(e.params)[0],r=e.params[i];if("object"!=typeof r||null===r||(["navigation","pagination","scrollbar"].indexOf(i)>=0&&!0===n[i]&&(n[i]={auto:!0}),!(i in n)||!("enabled"in r)))return;!0===n[i]&&(n[i]={enabled:!0}),"object"==typeof n[i]&&!("enabled"in n[i])&&(n[i].enabled=!0),n[i]||(n[i]={enabled:!1})}});var l,c,u=SK({},VK);return a.useParams(u),a.params=SK({},u,HK,n),a.originalParams=SK({},a.params),a.passedParams=SK({},n),a.params&&a.params.on&&Object.keys(a.params.on).forEach(function(t){a.on(t,a.params.on[t])}),a.params&&a.params.onAny&&a.onAny(a.params.onAny),a.$=yK,SK(a,{enabled:a.params.enabled,el:e,classNames:[],slides:yK(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===a.params.direction},isVertical:function(){return"vertical"===a.params.direction},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEvents:(l=["touchstart","touchmove","touchend","touchcancel"],c=["mousedown","mousemove","mouseup"],a.support.pointerEvents&&(c=["pointerdown","pointermove","pointerup"]),a.touchEventsTouch={start:l[0],move:l[1],end:l[2],cancel:l[3]},a.touchEventsDesktop={start:c[0],move:c[1],end:c[2]},a.support.touch||!a.params.simulateTouch?a.touchEventsTouch:a.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:_K(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.useModules(),a.emit("_swiper"),a.params.init&&a.init(),a}var e=t.prototype;return e.enable=function(){var t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))},e.disable=function(){var t=this;!t.enabled||(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))},e.setProgress=function(t,e){var n=this;t=Math.min(Math.max(t,0),1);var i=n.minTranslate(),r=n.maxTranslate();n.translateTo((r-i)*t+i,void 0===e?0:e),n.updateActiveIndex(),n.updateSlidesClasses()},e.emitContainerClasses=function(){var t=this;if(t.params._emitClasses&&t.el){var e=t.el.className.split(" ").filter(function(e){return 0===e.indexOf("swiper-container")||0===e.indexOf(t.params.containerModifierClass)});t.emit("_containerClasses",e.join(" "))}},e.getSlideClasses=function(t){var e=this;return t.className.split(" ").filter(function(t){return 0===t.indexOf("swiper-slide")||0===t.indexOf(e.params.slideClass)}).join(" ")},e.emitSlidesClasses=function(){var t=this;if(t.params._emitClasses&&t.el){var e=[];t.slides.each(function(n){var i=t.getSlideClasses(n);e.push({slideEl:n,classNames:i}),t.emit("_slideClass",n,i)}),t.emit("_slideClasses",e)}},e.slidesPerViewDynamic=function(){var t=this,e=t.slides,n=t.slidesGrid,i=t.size,r=t.activeIndex,s=1;if(t.params.centeredSlides){for(var o,a=e[r].swiperSlideSize,l=r+1;li&&(o=!0));for(var c=r-1;c>=0;c-=1)e[c]&&!o&&(s+=1,(a+=e[c].swiperSlideSize)>i&&(o=!0))}else for(var u=r+1;u1)&&t.isEnd&&!t.params.centeredSlides?t.slides.length-1:t.activeIndex,0,!1,!0)||i(),n.watchOverflow&&e!==t.snapGrid&&t.checkOverflow(),t.emit("update")}function i(){var e=Math.min(Math.max(t.rtlTranslate?-1*t.translate:t.translate,t.maxTranslate()),t.minTranslate());t.setTranslate(e),t.updateActiveIndex(),t.updateSlidesClasses()}},e.changeDirection=function(t,e){void 0===e&&(e=!0);var n=this,i=n.params.direction;return t||(t="horizontal"===i?"vertical":"horizontal"),t===i||"horizontal"!==t&&"vertical"!==t||(n.$el.removeClass(""+n.params.containerModifierClass+i).addClass(""+n.params.containerModifierClass+t),n.emitContainerClasses(),n.params.direction=t,n.slides.each(function(e){"vertical"===t?e.style.width="":e.style.height=""}),n.emit("changeDirection"),e&&n.update()),n},e.mount=function(t){var e=this;if(e.mounted)return!0;var n=yK(t||e.params.el);if(!(t=n[0]))return!1;t.swiper=e;var i=function(){return"."+(e.params.wrapperClass||"").trim().split(" ").join(".")},r=function(){if(t&&t.shadowRoot&&t.shadowRoot.querySelector){var e=yK(t.shadowRoot.querySelector(i()));return e.children=function(t){return n.children(t)},e}return n.children(i())}();if(0===r.length&&e.params.createElements){var s=tK().createElement("div");r=yK(s),s.className=e.params.wrapperClass,n.append(s),n.children("."+e.params.slideClass).each(function(t){r.append(t)})}return SK(e,{$el:n,el:t,$wrapperEl:r,wrapperEl:r[0],mounted:!0,rtl:"rtl"===t.dir.toLowerCase()||"rtl"===n.css("direction"),rtlTranslate:"horizontal"===e.params.direction&&("rtl"===t.dir.toLowerCase()||"rtl"===n.css("direction")),wrongRTL:"-webkit-box"===r.css("display")}),!0},e.init=function(t){var e=this;return e.initialized||!1===e.mount(t)||(e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.params.loop&&e.loopCreate(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.enabled&&e.setGrabCursor(),e.params.preloadImages&&e.preloadImages(),e.slideTo(e.params.loop?e.params.initialSlide+e.loopedSlides:e.params.initialSlide,0,e.params.runCallbacksOnInit,!1,!0),e.attachEvents(),e.initialized=!0,e.emit("init"),e.emit("afterInit")),e},e.destroy=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0);var n=this,i=n.params,r=n.$el,s=n.$wrapperEl,o=n.slides;return void 0===n.params||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),i.loop&&n.loopDestroy(),e&&(n.removeClasses(),r.removeAttr("style"),s.removeAttr("style"),o&&o.length&&o.removeClass([i.slideVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(function(t){n.off(t)}),!1!==t&&(n.$el[0].swiper=null,function(e){var n=e;Object.keys(n).forEach(function(e){try{n[e]=null}catch(t){}try{delete n[e]}catch(t){}})}(n)),n.destroyed=!0),null},t.extendDefaults=function(t){SK(HK,t)},t.installModule=function(e){t.prototype.modules||(t.prototype.modules={});var n=e.name||Object.keys(t.prototype.modules).length+"_"+_K();t.prototype.modules[n]=e},t.use=function(e){return Array.isArray(e)?(e.forEach(function(e){return t.installModule(e)}),t):(t.installModule(e),t)},function(t,e,n){n&&zK(t,n)}(t,0,[{key:"extendedDefaults",get:function(){return HK}},{key:"defaults",get:function(){return VK}}]),t}();Object.keys(UK).forEach(function(t){Object.keys(UK[t]).forEach(function(e){$K.prototype[e]=UK[t][e]})}),$K.use([kK,IK]);var GK=$K;const WK=["prevElRef"],qK=["nextElRef"],XK=["scrollbarElRef"],YK=["paginationElRef"];function KK(t,e){1&t&&(aa(0),oa(1,"div",6,7),oa(3,"div",8,9),la())}function QK(t,e){1&t&&oa(0,"div",10,11)}function ZK(t,e){1&t&&oa(0,"div",12,13)}function JK(t,e){}function tQ(t,e){1&t&&Jo(0,JK,0,0,"ng-template")}function eQ(t,e){}function nQ(t,e){1&t&&Jo(0,eQ,0,0,"ng-template")}function iQ(t,e){}function rQ(t,e){1&t&&Jo(0,iQ,0,0,"ng-template")}function sQ(t,e){}const oQ=function(t){return{$implicit:t}};function aQ(t,e){if(1&t&&(ra(0,"div",3),Jo(1,sQ,0,0,"ng-template",18),sa()),2&t){const t=va().$implicit;na("ngClass",va(2).zoomContainerClass),ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Tc(3,oQ,t.slideData))}}function lQ(t,e){}function cQ(t,e){if(1&t&&(aa(0),Jo(1,lQ,0,0,"ng-template",18),la()),2&t){const t=va().$implicit;ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Tc(2,oQ,t.slideData))}}function uQ(t,e){if(1&t&&(ra(0,"div",15),Jo(1,aQ,2,5,"div",16),Jo(2,cQ,2,4,"ng-container",17),sa()),2&t){const t=e.$implicit,n=va().key,i=va();(function(t){Ua(qa,Fa,t,!1)})(i.style),na("ngClass",(t.class?t.class+" ":"")+i.slideClass+(""!==n?" "+i.slideDuplicateClass:""))("ngSwitch",t.zoom),Ko("data-swiper-slide-index",t.virtualIndex?t.virtualIndex:t.slideIndex),ws(1),na("ngSwitchCase",!0)}}function hQ(t,e){1&t&&(Jo(0,uQ,3,6,"div",14),Ic(1,"async")),2&t&&na("ngForOf",Mc(1,1,e.loopSlides))}const dQ=[[["","slot","container-start"]],[["","slot","wrapper-start"]],[["","slot","wrapper-end"]],[["","slot","container-end"]]],pQ=function(t){return{loopSlides:t,key:"prepend"}},fQ=function(t){return{loopSlides:t,key:""}},gQ=function(t){return{loopSlides:t,key:"append"}},mQ=["[slot=container-start]","[slot=wrapper-start]","[slot=wrapper-end]","[slot=container-end]"];function bQ(t){return"object"==typeof t&&null!==t&&t.constructor&&"Object"===Object.prototype.toString.call(t).slice(8,-1)}function yQ(t,e,n){return!0===_Q(t)&&e&&!e.el||!("boolean"!=typeof e&&e.el!==(null==n?void 0:n.nativeElement)&&("string"==typeof e.el||"object"==typeof e.el))}function vQ(t,e){const n=["__proto__","constructor","prototype"];Object.keys(e).filter(t=>n.indexOf(t)<0).forEach(n=>{void 0!==t[n]?t[n]&&!e[n]||(bQ(e[n])&&bQ(t[n])&&Object.keys(e[n]).length>0?e[n].__swiper__?t[n]=e[n]:vQ(t[n],e[n]):t[n]=e[n]):t[n]=e[n]})}function _Q(t){return null!=t&&"false"!=`${t}`}const wQ=["pagination","navigation","scrollbar","virtual"];function xQ(t,e={}){return bQ(t)?t:!0===_Q(t)&&e}const SQ=["init","_direction","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_freeModeMomentum","_freeModeMomentumRatio","_freeModeMomentumBounce","_freeModeMomentumBounceRatio","_freeModeMomentumVelocityRatio","_freeModeSticky","_freeModeMinimumVelocity","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","_slidesPerColumn","_slidesPerColumnFill","_slidesPerGroup","_slidesPerGroupSkip","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_watchSlidesVisibility","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_preloadImages","updateOnImagesReady","_loop","_loopAdditionalSlides","_loopedSlides","_loopFillGroupWithBlank","loopPreventsSlide","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","hashNavigation","history","keyboard","lazy","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom"].map(t=>t.replace(/_/,""));function EQ(t={}){const e={on:{}},n={};vQ(e,GK.defaults),vQ(e,GK.extendedDefaults),e._emitClasses=!0;const i={};return Object.keys(t).forEach(r=>{const s=r.replace(/^_/,"");void 0!==t[s]&&(SQ.indexOf(s)>=0?bQ(t[s])?(e[s]={},n[s]={},vQ(e[s],t[s]),vQ(n[s],t[s])):(e[s]=t[s],n[s]=t[s]):i[s]=t[s])}),{params:e,passedParams:n,rest:i}}let CQ=(()=>{class t{constructor(t){this.template=t,this.class="",this.slideData={isActive:!1,isPrev:!1,isNext:!1,isVisible:!1,isDuplicate:!1}}set zoom(t){this._zoom=_Q(t)}get zoom(){return this._zoom}get classNames(){return this._classNames}set classNames(t){this._classNames!==t&&(this._classNames=t,this.slideData={isActive:this._hasClass(["swiper-slide-active","swiper-slide-duplicate-active"]),isVisible:this._hasClass(["swiper-slide-visible"]),isDuplicate:this._hasClass(["swiper-slide-duplicate"]),isPrev:this._hasClass(["swiper-slide-prev","swiper-slide-duplicate-prev"]),isNext:this._hasClass(["swiper-slide-next","swiper-slide-duplicate-next"])})}_hasClass(t){return t.some(t=>this._classNames.indexOf(t)>=0)}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),t})(),OQ=(()=>{class t{constructor(t,e,n,i){this._ngZone=t,this.elementRef=e,this._changeDetectorRef=n,this._platformId=i,this.slideClass="swiper-slide",this.wrapperClass="swiper-wrapper",this.showNavigation=!0,this.showPagination=!0,this.showScrollbar=!0,this.s__beforeBreakpoint=new Rc,this.s__containerClasses=new Rc,this.s__slideClass=new Rc,this.s__swiper=new Rc,this.s_activeIndexChange=new Rc,this.s_afterInit=new Rc,this.s_autoplay=new Rc,this.s_autoplayStart=new Rc,this.s_autoplayStop=new Rc,this.s_beforeDestroy=new Rc,this.s_beforeInit=new Rc,this.s_beforeLoopFix=new Rc,this.s_beforeResize=new Rc,this.s_beforeSlideChangeStart=new Rc,this.s_beforeTransitionStart=new Rc,this.s_breakpoint=new Rc,this.s_changeDirection=new Rc,this.s_click=new Rc,this.s_doubleTap=new Rc,this.s_doubleClick=new Rc,this.s_destroy=new Rc,this.s_fromEdge=new Rc,this.s_hashChange=new Rc,this.s_hashSet=new Rc,this.s_imagesReady=new Rc,this.s_init=new Rc,this.s_keyPress=new Rc,this.s_lazyImageLoad=new Rc,this.s_lazyImageReady=new Rc,this.s_loopFix=new Rc,this.s_momentumBounce=new Rc,this.s_navigationHide=new Rc,this.s_navigationShow=new Rc,this.s_observerUpdate=new Rc,this.s_orientationchange=new Rc,this.s_paginationHide=new Rc,this.s_paginationRender=new Rc,this.s_paginationShow=new Rc,this.s_paginationUpdate=new Rc,this.s_progress=new Rc,this.s_reachBeginning=new Rc,this.s_reachEnd=new Rc,this.s_realIndexChange=new Rc,this.s_resize=new Rc,this.s_scroll=new Rc,this.s_scrollbarDragEnd=new Rc,this.s_scrollbarDragMove=new Rc,this.s_scrollbarDragStart=new Rc,this.s_setTransition=new Rc,this.s_setTranslate=new Rc,this.s_slideChange=new Rc,this.s_slideChangeTransitionEnd=new Rc,this.s_slideChangeTransitionStart=new Rc,this.s_slideNextTransitionEnd=new Rc,this.s_slideNextTransitionStart=new Rc,this.s_slidePrevTransitionEnd=new Rc,this.s_slidePrevTransitionStart=new Rc,this.s_slideResetTransitionStart=new Rc,this.s_slideResetTransitionEnd=new Rc,this.s_sliderMove=new Rc,this.s_sliderFirstMove=new Rc,this.s_slidesLengthChange=new Rc,this.s_slidesGridLengthChange=new Rc,this.s_snapGridLengthChange=new Rc,this.s_snapIndexChange=new Rc,this.s_tap=new Rc,this.s_toEdge=new Rc,this.s_touchEnd=new Rc,this.s_touchMove=new Rc,this.s_touchMoveOpposite=new Rc,this.s_touchStart=new Rc,this.s_transitionEnd=new Rc,this.s_transitionStart=new Rc,this.s_update=new Rc,this.s_zoomChange=new Rc,this.s_swiper=new Rc,this.indexChange=new Rc,this._activeSlides=new P,this.containerClasses="swiper-container",this.slidesChanges=t=>{this.slides=t.map((t,e)=>(t.slideIndex=e,t.classNames=this.slideClass,t)),this.loop&&!this.loopedSlides&&this.calcLoopedSlides(),this.virtual?this.swiperRef&&this.swiperRef.virtual&&this._ngZone.runOutsideAngular(()=>{this.swiperRef.virtual.slides=this.slides,this.swiperRef.virtual.update(!0)}):(this.prependSlides=wd(this.slides.slice(this.slides.length-this.loopedSlides)),this.appendSlides=wd(this.slides.slice(0,this.loopedSlides))),this._changeDetectorRef.detectChanges()},this.style=null,this.updateVirtualSlides=t=>{!this.swiperRef||this.currentVirtualData&&this.currentVirtualData.from===t.from&&this.currentVirtualData.to===t.to&&this.currentVirtualData.offset===t.offset||(this.style=this.swiperRef.isHorizontal()?{[this.swiperRef.rtlTranslate?"right":"left"]:`${t.offset}px`}:{top:`${t.offset}px`},this.currentVirtualData=t,this._activeSlides.next(t.slides),this._ngZone.run(()=>{this._changeDetectorRef.detectChanges()}),this._ngZone.runOutsideAngular(()=>{this.swiperRef.updateSlides(),this.swiperRef.updateProgress(),this.swiperRef.updateSlidesClasses(),this.swiperRef.lazy&&this.swiperRef.params.lazy.enabled&&this.swiperRef.lazy.load(),this.swiperRef.virtual.update(!0)}))}}set navigation(t){var e,n,i;const r="boolean"!=typeof this._navigation?null===(e=this._navigation)||void 0===e?void 0:e.nextEl:null,s="boolean"!=typeof this._navigation?null===(n=this._navigation)||void 0===n?void 0:n.prevEl:null;this._navigation=xQ(t,{nextEl:r||null,prevEl:s||null}),this.showNavigation=!(!0!==_Q(t)||this._navigation&&"boolean"!=typeof this._navigation&&this._navigation.prevEl!==(null===(i=this._prevElRef)||void 0===i?void 0:i.nativeElement)&&(null!==this._navigation.prevEl||null!==this._navigation.nextEl)&&("string"==typeof this._navigation.nextEl||"string"==typeof this._navigation.prevEl||"object"==typeof this._navigation.nextEl||"object"==typeof this._navigation.prevEl))}get navigation(){return this._navigation}set pagination(t){var e;const n="boolean"!=typeof this._pagination?null===(e=this._pagination)||void 0===e?void 0:e.el:null;this._pagination=xQ(t,{el:n||null}),this.showPagination=yQ(t,this._pagination,this._paginationElRef)}get pagination(){return this._pagination}set scrollbar(t){var e;const n="boolean"!=typeof this._scrollbar?null===(e=this._scrollbar)||void 0===e?void 0:e.el:null;this._scrollbar=xQ(t,{el:n||null}),this.showScrollbar=yQ(t,this._scrollbar,this._scrollbarElRef)}get scrollbar(){return this._scrollbar}set virtual(t){this._virtual=xQ(t)}get virtual(){return this._virtual}set index(t){this.setIndex(t)}set config(t){this.updateSwiper(t);const{params:e}=EQ(t);Object.assign(this,e)}set prevElRef(t){this._prevElRef=t,this._setElement(t,this.navigation,"navigation","prevEl")}set nextElRef(t){this._nextElRef=t,this._setElement(t,this.navigation,"navigation","nextEl")}set scrollbarElRef(t){this._scrollbarElRef=t,this._setElement(t,this.scrollbar,"scrollbar")}set paginationElRef(t){this._paginationElRef=t,this._setElement(t,this.pagination,"pagination")}get activeSlides(){return this.virtual?this._activeSlides:wd(this.slides)}get zoomContainerClass(){return"boolean"!=typeof this.zoom?this.zoom.containerClass:"swiper-zoom-container"}_setElement(t,e,n,i="el"){if(!t||!e)return;if(e&&t.nativeElement){if(e[i]===t.nativeElement)return;e[i]=t.nativeElement}const r={};r[n]=!0,this.updateInitSwiper(r)}ngOnInit(){const{params:t}=EQ(this);Object.assign(this,t)}ngAfterViewInit(){this.childrenSlidesInit(),this.initSwiper(),this._changeDetectorRef.detectChanges(),setTimeout(()=>{this.s_swiper.emit(this.swiperRef)})}childrenSlidesInit(){this.slidesChanges(this.slidesEl),this.slidesEl.changes.subscribe(this.slidesChanges)}get isSwiperActive(){return this.swiperRef&&!this.swiperRef.destroyed}initSwiper(){const{params:t}=EQ(this);Object.assign(this,t),this._ngZone.runOutsideAngular(()=>{t.init=!1,t.virtual||(t.observer=!0),t.onAny=(t,...e)=>{const n=this[`s_${t}`];n&&n.emit(...e)},Object.assign(t.on,{_containerClasses(t,e){this.containerClasses=e},_slideClasses:(t,e)=>{e.forEach(({slideEl:t,classNames:e},n)=>{const i=parseInt(t.getAttribute("data-swiper-slide-index"))||n;if(this.virtual){const t=this.slides.find(t=>t.virtualIndex&&t.virtualIndex===i);if(t)return void(t.classNames=e)}this.slides[i]&&(this.slides[i].classNames=e)}),this._changeDetectorRef.detectChanges()}});const e=new GK(t);if(e.loopCreate=()=>{},e.loopDestroy=()=>{},t.loop&&(e.loopedSlides=this.loopedSlides),e.virtual&&e.params.virtual.enabled){e.virtual.slides=this.slides;const t={cache:!1,renderExternal:this.updateVirtualSlides,renderExternalUpdate:!1};vQ(e.params.virtual,t),vQ(e.originalParams.virtual,t)}Lh(this._platformId)&&(this.swiperRef=e.init(this.elementRef.nativeElement),this.swiperRef.virtual&&this.swiperRef.params.virtual.enabled&&this.swiperRef.virtual.update(!0),this._changeDetectorRef.detectChanges(),e.on("slideChange",()=>{this.indexChange.emit(this.swiperRef.realIndex)}))})}ngOnChanges(t){this.updateSwiper(t),this._changeDetectorRef.detectChanges()}updateInitSwiper(t){!t||!this.swiperRef||this.swiperRef.destroyed||this._ngZone.runOutsideAngular(()=>{const{pagination:e,navigation:n,scrollbar:i,thumbs:r}=this.swiperRef;t.pagination&&(this.pagination&&"boolean"!=typeof this.pagination&&this.pagination.el&&e&&!e.el?(this.updateParameter("pagination",this.pagination),e.init(),e.render(),e.update()):(e.destroy(),e.el=null)),t.scrollbar&&(this.scrollbar&&"boolean"!=typeof this.scrollbar&&this.scrollbar.el&&i&&!i.el?(this.updateParameter("scrollbar",this.scrollbar),i.init(),i.updateSize(),i.setTranslate()):(i.destroy(),i.el=null)),t.navigation&&(this.navigation&&"boolean"!=typeof this.navigation&&this.navigation.prevEl&&this.navigation.nextEl&&n&&!n.prevEl&&!n.nextEl?(this.updateParameter("navigation",this.navigation),n.init(),n.update()):n.prevEl&&n.nextEl&&(n.destroy(),n.nextEl=null,n.prevEl=null)),t.thumbs&&this.thumbs&&this.thumbs.swiper&&(this.updateParameter("thumbs",this.thumbs),r.init()&&r.update(!0)),t.controller&&this.controller&&this.controller.control&&(this.swiperRef.controller.control=this.controller.control),this.swiperRef.update()})}updateSwiper(t){this._ngZone.runOutsideAngular(()=>{var e,n;if(!t.config&&t&&this.swiperRef&&!this.swiperRef.destroyed){for(const i in t){if(wQ.indexOf(i)>=0)continue;const r=null!==(n=null===(e=t[i])||void 0===e?void 0:e.currentValue)&&void 0!==n?n:t[i];this.updateParameter(i,r)}t.allowSlideNext&&(this.swiperRef.allowSlideNext=this.allowSlideNext),t.allowSlidePrev&&(this.swiperRef.allowSlidePrev=this.allowSlidePrev),t.direction&&this.swiperRef.changeDirection(this.direction,!1),t.breakpoints&&(this.loop&&!this.loopedSlides&&this.calcLoopedSlides(),this.swiperRef.currentBreakpoint=null,this.swiperRef.setBreakpoint()),(t.thumbs||t.controller)&&this.updateInitSwiper(t),this.swiperRef.update()}})}calcLoopedSlides(){if(!this.loop)return;let t=this.slidesPerView;if(this.breakpoints){const e=GK.prototype.getBreakpoint(this.breakpoints),n=e in this.breakpoints?this.breakpoints[e]:void 0;n&&n.slidesPerView&&(t=n.slidesPerView)}if("auto"===t)return this.loopedSlides=this.slides.length,this.slides.length;let e=this.loopedSlides||t;return e+=this.loopAdditionalSlides,e>this.slides.length&&(e=this.slides.length),this.loopedSlides=e,e}updateParameter(t,e){if(!this.swiperRef||this.swiperRef.destroyed)return;const n=t.replace(/^_/,""),i=bQ(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){const t=this.swiperRef.modules[n].params[n];i?vQ(this.swiperRef.params[n],t):this.swiperRef.params[n]=t}i&&bQ(e)?vQ(this.swiperRef.params[n],e):this.swiperRef.params[n]=e}setIndex(t,e,n){this.isSwiperActive?t!==this.swiperRef.activeIndex&&this._ngZone.runOutsideAngular(()=>{this.loop?this.swiperRef.slideToLoop(t,e,!n):this.swiperRef.slideTo(t,e,!n)}):this.initialSlide=t}ngOnDestroy(){this._ngZone.runOutsideAngular(()=>{var t;null===(t=this.swiperRef)||void 0===t||t.destroy(!0,!1)})}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(kl),ea(tc),ea(ou))},t.\u0275cmp=Jt({type:t,selectors:[["swiper"],["","swiper",""]],contentQueries:function(t,e,n){if(1&t&&Xc(n,CQ,4),2&t){let t;Wc(t=Yc())&&(e.slidesEl=t)}},viewQuery:function(t,e){if(1&t&&(qc(WK,5),qc(qK,5),qc(XK,5),qc(YK,5)),2&t){let t;Wc(t=Yc())&&(e.prevElRef=t.first),Wc(t=Yc())&&(e.nextElRef=t.first),Wc(t=Yc())&&(e.scrollbarElRef=t.first),Wc(t=Yc())&&(e.paginationElRef=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.containerClasses)},inputs:{slideClass:"slideClass",wrapperClass:"wrapperClass",navigation:"navigation",pagination:"pagination",scrollbar:"scrollbar",virtual:"virtual",index:"index",config:"config",loopedSlides:"loopedSlides",initialSlide:"initialSlide",direction:"direction",touchEventsTarget:"touchEventsTarget",speed:"speed",cssMode:"cssMode",updateOnWindowResize:"updateOnWindowResize",resizeObserver:"resizeObserver",nested:"nested",focusableElements:"focusableElements",width:"width",height:"height",preventInteractionOnTransition:"preventInteractionOnTransition",userAgent:"userAgent",url:"url",edgeSwipeDetection:"edgeSwipeDetection",edgeSwipeThreshold:"edgeSwipeThreshold",freeMode:"freeMode",freeModeMomentum:"freeModeMomentum",freeModeMomentumRatio:"freeModeMomentumRatio",freeModeMomentumBounce:"freeModeMomentumBounce",freeModeMomentumBounceRatio:"freeModeMomentumBounceRatio",freeModeMomentumVelocityRatio:"freeModeMomentumVelocityRatio",freeModeSticky:"freeModeSticky",freeModeMinimumVelocity:"freeModeMinimumVelocity",autoHeight:"autoHeight",setWrapperSize:"setWrapperSize",virtualTranslate:"virtualTranslate",effect:"effect",breakpoints:"breakpoints",spaceBetween:"spaceBetween",slidesPerView:"slidesPerView",slidesPerColumn:"slidesPerColumn",slidesPerColumnFill:"slidesPerColumnFill",slidesPerGroup:"slidesPerGroup",slidesPerGroupSkip:"slidesPerGroupSkip",centeredSlides:"centeredSlides",centeredSlidesBounds:"centeredSlidesBounds",slidesOffsetBefore:"slidesOffsetBefore",slidesOffsetAfter:"slidesOffsetAfter",normalizeSlideIndex:"normalizeSlideIndex",centerInsufficientSlides:"centerInsufficientSlides",watchOverflow:"watchOverflow",roundLengths:"roundLengths",touchRatio:"touchRatio",touchAngle:"touchAngle",simulateTouch:"simulateTouch",shortSwipes:"shortSwipes",longSwipes:"longSwipes",longSwipesRatio:"longSwipesRatio",longSwipesMs:"longSwipesMs",followFinger:"followFinger",allowTouchMove:"allowTouchMove",threshold:"threshold",touchMoveStopPropagation:"touchMoveStopPropagation",touchStartPreventDefault:"touchStartPreventDefault",touchStartForcePreventDefault:"touchStartForcePreventDefault",touchReleaseOnEdges:"touchReleaseOnEdges",uniqueNavElements:"uniqueNavElements",resistance:"resistance",resistanceRatio:"resistanceRatio",watchSlidesProgress:"watchSlidesProgress",watchSlidesVisibility:"watchSlidesVisibility",grabCursor:"grabCursor",preventClicks:"preventClicks",preventClicksPropagation:"preventClicksPropagation",slideToClickedSlide:"slideToClickedSlide",preloadImages:"preloadImages",updateOnImagesReady:"updateOnImagesReady",loop:"loop",loopAdditionalSlides:"loopAdditionalSlides",loopFillGroupWithBlank:"loopFillGroupWithBlank",loopPreventsSlide:"loopPreventsSlide",allowSlidePrev:"allowSlidePrev",allowSlideNext:"allowSlideNext",swipeHandler:"swipeHandler",noSwiping:"noSwiping",noSwipingClass:"noSwipingClass",noSwipingSelector:"noSwipingSelector",passiveListeners:"passiveListeners",containerModifierClass:"containerModifierClass",slideBlankClass:"slideBlankClass",slideActiveClass:"slideActiveClass",slideDuplicateActiveClass:"slideDuplicateActiveClass",slideVisibleClass:"slideVisibleClass",slideDuplicateClass:"slideDuplicateClass",slideNextClass:"slideNextClass",slideDuplicateNextClass:"slideDuplicateNextClass",slidePrevClass:"slidePrevClass",slideDuplicatePrevClass:"slideDuplicatePrevClass",runCallbacksOnInit:"runCallbacksOnInit",observeParents:"observeParents",observeSlideChildren:"observeSlideChildren",a11y:"a11y",autoplay:"autoplay",controller:"controller",coverflowEffect:"coverflowEffect",cubeEffect:"cubeEffect",fadeEffect:"fadeEffect",flipEffect:"flipEffect",hashNavigation:"hashNavigation",history:"history",keyboard:"keyboard",lazy:"lazy",mousewheel:"mousewheel",parallax:"parallax",thumbs:"thumbs",zoom:"zoom",class:"class",id:"id"},outputs:{s__beforeBreakpoint:"_beforeBreakpoint",s__containerClasses:"_containerClasses",s__slideClass:"_slideClass",s__swiper:"_swiper",s_activeIndexChange:"activeIndexChange",s_afterInit:"afterInit",s_autoplay:"autoplay",s_autoplayStart:"autoplayStart",s_autoplayStop:"autoplayStop",s_beforeDestroy:"beforeDestroy",s_beforeInit:"beforeInit",s_beforeLoopFix:"beforeLoopFix",s_beforeResize:"beforeResize",s_beforeSlideChangeStart:"beforeSlideChangeStart",s_beforeTransitionStart:"beforeTransitionStart",s_breakpoint:"breakpoint",s_changeDirection:"changeDirection",s_click:"click",s_doubleTap:"doubleTap",s_doubleClick:"doubleClick",s_destroy:"destroy",s_fromEdge:"fromEdge",s_hashChange:"hashChange",s_hashSet:"hashSet",s_imagesReady:"imagesReady",s_init:"init",s_keyPress:"keyPress",s_lazyImageLoad:"lazyImageLoad",s_lazyImageReady:"lazyImageReady",s_loopFix:"loopFix",s_momentumBounce:"momentumBounce",s_navigationHide:"navigationHide",s_navigationShow:"navigationShow",s_observerUpdate:"observerUpdate",s_orientationchange:"orientationchange",s_paginationHide:"paginationHide",s_paginationRender:"paginationRender",s_paginationShow:"paginationShow",s_paginationUpdate:"paginationUpdate",s_progress:"progress",s_reachBeginning:"reachBeginning",s_reachEnd:"reachEnd",s_realIndexChange:"realIndexChange",s_resize:"resize",s_scroll:"scroll",s_scrollbarDragEnd:"scrollbarDragEnd",s_scrollbarDragMove:"scrollbarDragMove",s_scrollbarDragStart:"scrollbarDragStart",s_setTransition:"setTransition",s_setTranslate:"setTranslate",s_slideChange:"slideChange",s_slideChangeTransitionEnd:"slideChangeTransitionEnd",s_slideChangeTransitionStart:"slideChangeTransitionStart",s_slideNextTransitionEnd:"slideNextTransitionEnd",s_slideNextTransitionStart:"slideNextTransitionStart",s_slidePrevTransitionEnd:"slidePrevTransitionEnd",s_slidePrevTransitionStart:"slidePrevTransitionStart",s_slideResetTransitionStart:"slideResetTransitionStart",s_slideResetTransitionEnd:"slideResetTransitionEnd",s_sliderMove:"sliderMove",s_sliderFirstMove:"sliderFirstMove",s_slidesLengthChange:"slidesLengthChange",s_slidesGridLengthChange:"slidesGridLengthChange",s_snapGridLengthChange:"snapGridLengthChange",s_snapIndexChange:"snapIndexChange",s_tap:"tap",s_toEdge:"toEdge",s_touchEnd:"touchEnd",s_touchMove:"touchMove",s_touchMoveOpposite:"touchMoveOpposite",s_touchStart:"touchStart",s_transitionEnd:"transitionEnd",s_transitionStart:"transitionStart",s_update:"update",s_zoomChange:"zoomChange",s_swiper:"swiper",indexChange:"indexChange"},features:[ye],ngContentSelectors:mQ,decls:13,vars:17,consts:[[4,"ngIf"],["class","swiper-scrollbar",4,"ngIf"],["class","swiper-pagination",4,"ngIf"],[3,"ngClass"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["slidesTemplate",""],[1,"swiper-button-prev"],["prevElRef",""],[1,"swiper-button-next"],["nextElRef",""],[1,"swiper-scrollbar"],["scrollbarElRef",""],[1,"swiper-pagination"],["paginationElRef",""],[3,"ngClass","style","ngSwitch",4,"ngFor","ngForOf"],[3,"ngClass","ngSwitch"],[3,"ngClass",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(t,e){if(1&t&&(wa(dQ),xa(0),Jo(1,KK,5,0,"ng-container",0),Jo(2,QK,2,0,"div",1),Jo(3,ZK,2,0,"div",2),ra(4,"div",3),xa(5,1),Jo(6,tQ,1,0,void 0,4),Jo(7,nQ,1,0,void 0,4),Jo(8,rQ,1,0,void 0,4),xa(9,2),sa(),xa(10,3),Jo(11,hQ,2,3,"ng-template",null,5,Jc)),2&t){const t=ta(12);ws(1),na("ngIf",e.navigation&&e.showNavigation),ws(1),na("ngIf",e.scrollbar&&e.showScrollbar),ws(1),na("ngIf",e.pagination&&e.showPagination),ws(1),na("ngClass",e.wrapperClass),Ko("id",e.id),ws(2),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(11,pQ,e.prependSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(13,fQ,e.activeSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(15,gQ,e.appendSlides))}},directives:[_h,mh,kh,yh,Eh,Ch,Oh],pipes:[Dh],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),t})(),TQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})();function kQ(){return(kQ=Object.assign||function(t){for(var e=1;e0&&(n(s,!!t.isBeginning),t.params.watchOverflow&&t.enabled&&s[t.isLocked?"addClass":"removeClass"](e.lockClass)),r&&r.length>0&&(n(r,!!t.isEnd),t.params.watchOverflow&&t.enabled&&r[t.isLocked?"addClass":"removeClass"](e.lockClass))}},onPrevClick:function(t){var e=this;t.preventDefault(),(!e.isBeginning||e.params.loop)&&e.slidePrev()},onNextClick:function(t){var e=this;t.preventDefault(),(!e.isEnd||e.params.loop)&&e.slideNext()},init:function(){var t,e,n=this,i=n.params.navigation;n.params.navigation=function(t,e,n,i){var r=tK();return n&&Object.keys(i).forEach(function(n){if(!e[n]&&!0===e.auto){var s=r.createElement("div");s.className=i[n],t.append(s),e[n]=s}}),e}(n.$el,n.params.navigation,n.params.createElements,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),(i.nextEl||i.prevEl)&&(i.nextEl&&(t=yK(i.nextEl),n.params.uniqueNavElements&&"string"==typeof i.nextEl&&t.length>1&&1===n.$el.find(i.nextEl).length&&(t=n.$el.find(i.nextEl))),i.prevEl&&(e=yK(i.prevEl),n.params.uniqueNavElements&&"string"==typeof i.prevEl&&e.length>1&&1===n.$el.find(i.prevEl).length&&(e=n.$el.find(i.prevEl))),t&&t.length>0&&t.on("click",n.navigation.onNextClick),e&&e.length>0&&e.on("click",n.navigation.onPrevClick),SK(n.navigation,{$nextEl:t,nextEl:t&&t[0],$prevEl:e,prevEl:e&&e[0]}),n.enabled||(t&&t.addClass(i.lockClass),e&&e.addClass(i.lockClass)))},destroy:function(){var t=this,e=t.navigation,n=e.$nextEl,i=e.$prevEl;n&&n.length&&(n.off("click",t.navigation.onNextClick),n.removeClass(t.params.navigation.disabledClass)),i&&i.length&&(i.off("click",t.navigation.onPrevClick),i.removeClass(t.params.navigation.disabledClass))}},PQ={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){EK(this,{navigation:kQ({},AQ)})},on:{init:function(t){t.navigation.init(),t.navigation.update()},toEdge:function(t){t.navigation.update()},fromEdge:function(t){t.navigation.update()},destroy:function(t){t.navigation.destroy()},"enable disable":function(t){var e=t.navigation,n=e.$nextEl,i=e.$prevEl;n&&n[t.enabled?"removeClass":"addClass"](t.params.navigation.lockClass),i&&i[t.enabled?"removeClass":"addClass"](t.params.navigation.lockClass)},click:function(t,e){var n=t.navigation,i=n.$nextEl,r=n.$prevEl,s=e.target;if(t.params.navigation.hideOnClick&&!yK(s).is(r)&&!yK(s).is(i)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===s||t.pagination.el.contains(s)))return;var o;i?o=i.hasClass(t.params.navigation.hiddenClass):r&&(o=r.hasClass(t.params.navigation.hiddenClass)),t.emit(!0===o?"navigationShow":"navigationHide"),i&&i.toggleClass(t.params.navigation.hiddenClass),r&&r.toggleClass(t.params.navigation.hiddenClass)}}}};let IQ=(()=>{class t{constructor(){GK.use([PQ])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,TQ]]}),t})(),MQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})(),DQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,lX,f_,IQ,MQ]]}),t})(),RQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Dp,DQ]]}),t})();const NQ={isolated:!0},LQ=new oi("Message service configuration",{providedIn:"root",factory:()=>NQ});let jQ=(()=>{class t{constructor(t,e,n){this.source=t,this.channel=e,this.messages=n}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Hd(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Hd(e=>e.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Hd(e=>t.includes(e.source)))}nextMessageId(){return t.counter++}}return t.counter=0,t})(),FQ=(()=>{class t{constructor(t,e){this.config=t,this.parent=e,this.channel=new P,this.messages=t.isolated||!e?this.channel.asObservable():U([this.channel,e.messages.pipe(Xp(()=>!this.channel.closed))]).pipe(Y())}ngOnDestroy(){this.channel.complete()}connect(t){return new jQ(t,this.channel,this.messages)}}return t.\u0275fac=function(e){return new(e||t)(Ci(LQ),Ci(t,12))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),BQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:LQ,useValue:NQ}],imports:[[gd,ky,f_]]}),t})();function VQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function zQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function UQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function HQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}const $Q=".mat-progress-spinner{display:block;position:relative;overflow:hidden}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}._mat-animation-noopable.mat-progress-spinner circle{transition:none;animation:none}.cdk-high-contrast-active .mat-progress-spinner circle{stroke:currentColor;stroke:CanvasText}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{animation:mat-progress-spinner-linear-rotate 2000ms linear infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4000ms;animation-timing-function:cubic-bezier(0.35, 0, 0.25, 1);animation-iteration-count:infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{animation:mat-progress-spinner-stroke-rotate-fallback 10000ms cubic-bezier(0.87, 0.03, 0.33, 1) infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition:none;animation:none}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.606171575px;transform:rotate(0)}12.5%{stroke-dashoffset:56.5486677px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.606171575px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.5486677px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.606171575px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.5486677px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.606171575px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.5486677px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0deg)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}\n",GQ=jy(class{constructor(t){this._elementRef=t}},"primary"),WQ=new oi("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}});class qQ extends GQ{constructor(t,e,n,i,r){super(t),this._document=n,this._diameter=100,this._value=0,this._fallbackAnimation=!1,this.mode="determinate";const s=qQ._diameters;this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),s.has(n.head)||s.set(n.head,new Set([100])),this._fallbackAnimation=e.EDGE||e.TRIDENT,this._noopAnimations="NoopAnimations"===i&&!!r&&!r._forceAnimations,r&&(r.diameter&&(this.diameter=r.diameter),r.strokeWidth&&(this.strokeWidth=r.strokeWidth))}get diameter(){return this._diameter}set diameter(t){this._diameter=bd(t),this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()}get strokeWidth(){return this._strokeWidth||this.diameter/10}set strokeWidth(t){this._strokeWidth=bd(t)}get value(){return"determinate"===this.mode?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,bd(t)))}ngOnInit(){const t=this._elementRef.nativeElement;this._styleRoot=xp(t)||this._document.head,this._attachStyleNode(),t.classList.add(`mat-progress-spinner-indeterminate${this._fallbackAnimation?"-fallback":""}-animation`)}_getCircleRadius(){return(this.diameter-10)/2}_getViewBox(){const t=2*this._getCircleRadius()+this.strokeWidth;return`0 0 ${t} ${t}`}_getStrokeCircumference(){return 2*Math.PI*this._getCircleRadius()}_getStrokeDashOffset(){return"determinate"===this.mode?this._getStrokeCircumference()*(100-this._value)/100:this._fallbackAnimation&&"indeterminate"===this.mode?.2*this._getStrokeCircumference():null}_getCircleStrokeWidth(){return this.strokeWidth/this.diameter*100}_attachStyleNode(){const t=this._styleRoot,e=this._diameter,n=qQ._diameters;let i=n.get(t);if(!i||!i.has(e)){const r=this._document.createElement("style");r.setAttribute("mat-spinner-animation",this._spinnerAnimationLabel),r.textContent=this._getAnimationText(),t.appendChild(r),i||(i=new Set,n.set(t,i)),i.add(e)}}_getAnimationText(){const t=this._getStrokeCircumference();return"\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n".replace(/START_VALUE/g,""+.95*t).replace(/END_VALUE/g,""+.2*t).replace(/DIAMETER/g,`${this._spinnerAnimationLabel}`)}_getSpinnerAnimationLabel(){return this.diameter.toString().replace(".","_")}}qQ.\u0275fac=function(t){return new(t||qQ)(ea(kl),ea(pp),ea(Yu,8),ea(Ey,8),ea(WQ))},qQ.\u0275cmp=Jt({type:qQ,selectors:[["mat-progress-spinner"]],hostAttrs:["role","progressbar","tabindex","-1",1,"mat-progress-spinner"],hostVars:10,hostBindings:function(t,e){2&t&&(Ko("aria-valuemin","determinate"===e.mode?0:null)("aria-valuemax","determinate"===e.mode?100:null)("aria-valuenow","determinate"===e.mode?e.value:null)("mode",e.mode),La("width",e.diameter,"px")("height",e.diameter,"px"),ja("_mat-animation-noopable",e._noopAnimations))},inputs:{color:"color",mode:"mode",diameter:"diameter",strokeWidth:"strokeWidth",value:"value"},exportAs:["matProgressSpinner"],features:[jo],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,e){1&t&&(vn(),ra(0,"svg",0),Jo(1,VQ,1,9,"circle",1),Jo(2,zQ,1,7,"circle",2),sa()),2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),na("ngSwitch","indeterminate"===e.mode),Ko("viewBox",e._getViewBox()),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1))},directives:[Eh,Ch],styles:[$Q],encapsulation:2,changeDetection:0}),qQ._diameters=new WeakMap;let XQ=(()=>{class t extends qQ{constructor(t,e,n,i,r){super(t,e,n,i,r),this.mode="indeterminate"}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(Yu,8),ea(Ey,8),ea(WQ))},t.\u0275cmp=Jt({type:t,selectors:[["mat-spinner"]],hostAttrs:["role","progressbar","mode","indeterminate",1,"mat-spinner","mat-progress-spinner"],hostVars:6,hostBindings:function(t,e){2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),ja("_mat-animation-noopable",e._noopAnimations))},inputs:{color:"color"},features:[jo],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,e){1&t&&(vn(),ra(0,"svg",0),Jo(1,UQ,1,9,"circle",1),Jo(2,HQ,1,7,"circle",2),sa()),2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),na("ngSwitch","indeterminate"===e.mode),Ko("viewBox",e._getViewBox()),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1))},directives:[Eh,Ch],styles:[$Q],encapsulation:2,changeDetection:0}),t})(),YQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny,Rh],Ny]}),t})(),KQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,YQ]]}),t})(),QQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,YQ]]}),t})();const ZQ={initialConfig:{},parse:{},rename:{}};class JQ{constructor(t,e){this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},ZQ),e)}addChanges(t){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),t)}applyChanges(t,e={}){void 0===t&&(t=this.storedChanges,this.storedChanges={});const{configState:n,options:{initialConfig:i}}=this,r=n.snapshot,s=Object.assign(Object.assign(Object.assign({},i),r),e);for(const[o,a]of Object.entries(t))this.processChange(o,a,s);n.setConfig(s)}processChange(t,e,n){var i,r;const{options:{parse:s,rename:o}}=this,a=null!==(i=o[t])&&void 0!==i?i:t,l=e.currentValue,c=null!==(r=s[t])&&void 0!==r?r:s[a];if(null==l)delete n[a];else if(c)try{n[a]=c(l)}catch(u){console.warn(`Failed to parse ${t} = ${l}`,u.message)}else n[a]=l}}let tZ=(()=>{class t{constructor(t,e,n={}){this.configState=t,this.cdr=e,this.options=n,this.initialized=!1,this.configManager=new JQ(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return t.\u0275fac=function(t){!function(){throw new Error("invalid")}()},t.\u0275dir=se({type:t,features:[ye]}),t})();const eZ={boolean:t=>"false"!=`${t}`,json:t=>"string"==typeof t?JSON.parse(t):t,function:t=>{if("function"!=typeof t)throw new Error("Expected a javascript function");return t}};let nZ=(()=>{class t{constructor(){this.className="ccf-spinner-overlay",this.active=!1}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spinner-overlay"]],hostVars:4,hostBindings:function(t,e){2&t&&(Ba(e.className),ja("active",e.active))},inputs:{active:"active",text:"text"},decls:3,vars:1,consts:[[1,"content"]],template:function(t,e){1&t&&(oa(0,"mat-spinner"),ra(1,"div",0),Za(2),sa()),2&t&&(ws(2),Ja(e.text))},directives:[XQ],styles:["[_nghost-%COMP%]{display:flex;position:absolute;width:100%;height:100%;z-index:99;flex-direction:column;justify-content:center;align-items:center;pointer-events:none;visibility:hidden;opacity:0;transition:visibility .6s,opacity .4s ease-in-out}[_nghost-%COMP%] mat-spinner[_ngcontent-%COMP%]{margin-bottom:1rem;opacity:0;transition:opacity .3s ease-in-out .3s}.active[_nghost-%COMP%]{pointer-events:auto;visibility:visible;opacity:1}.active[_nghost-%COMP%] mat-spinner[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0}),t})();const iZ=FQ,rZ=["*"];let sZ=(()=>{class t{constructor(t,e){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new g;const n=t.connect(this).getMessages();this.subscriptions.add(n.subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){switch(t.payload.type){case"drawer-containers-changed":return this.drawers=t.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":{const e=t.source.position,{opened:n,width:i,margin:r}=t.payload;return this.updateMargin(e,n,i,r),this.updateFaded(),!0}default:return!1}}updateMargin(t,e,n,i){const r=e?n+i:i;"start"===t?this.leftMargin=r:this.rightMargin=r}updateFaded(){const[t,e]=this.drawers;this.faded=(null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==e?void 0:e.opened)&&(null==e?void 0:e.expanded)}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,e){2&t&&(rl("@fadeInOut",e.faded),Ba(e.className),La("margin-left",e.leftMargin,"px")("margin-right",e.rightMargin,"px"),ja("cff-drawer-content-animations",e.animationsEnabled))},ngContentSelectors:rZ,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 5.5rem);z-index:2;overflow:auto}.cff-drawer-content-animations[_nghost-%COMP%]{transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:margin-left,margin-right}"],data:{animation:[Vg("fadeInOut",[$g("false",Hg({opacity:1})),$g("true",Hg({opacity:0})),Wg("false <=> true",zg("1s"))])]},changeDetection:0}),t})();const oZ=["*"],aZ={params:{width:0,margin:0,margin2:0}};class lZ{constructor(){this.initialized=!1,this.deferred=new Promise(t=>{this.resolve=t})}set(){this.initialized=!0,this.resolve()}wait(){return lw(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let cZ=(()=>{class t{constructor(t,e,n){this.element=n,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Rc(!0),this.expandedChange=new Rc(!0),this.stateChange=new Rc(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new lZ,this.subscriptions=new g,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}get classEnd(){return"end"===this.position}get position(){return this._position}set position(t){this._position=t||"start"}get opened(){return this._opened}set opened(t){this.toggle(md(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(md(t))}get expandedStateObj(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}get measuredWidth(){if(this._measuredWidth>0)return this._measuredWidth;const t=this.element.nativeElement;if(!t)return 0;const e=t.getBoundingClientRect(),n=e.right-e.left;return 0===n?0:(this._measuredWidth=n,n)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const e=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),n=Number(e.slice(0,-2));return this._measuredMargin=n,n}ngAfterViewInit(){this.initialized.set(),setTimeout(()=>this.channel.sendMessage({type:"drawer-initialized"}))}ngOnDestroy(){this.subscriptions.unsubscribe()}open(){this.toggle(!0)}close(){this.toggle(!1)}toggle(t=!this.opened){this.opened!==t&&(t?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=t,this.sendToggle())}openExpanded(){this.toggleExpanded(!0)}closeExpanded(){this.toggleExpanded(!1)}toggleExpanded(t=!this.expanded){this.expanded!==t&&(t?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=t,this.sendToggle())}closeOpenDone(){this.openedChange.emit(this.opened)}expandCollapseDone(){this.expandedChange.emit(this.expanded)}sendToggle(){return lw(this,void 0,void 0,function*(){yield this.initialized.wait(),this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit()})}handleMessage(t){switch(t.payload.type){case"drawer-toggled":return this.syncExpanded(t.source),!0;default:return!1}}syncExpanded(t){(this.expanded||t.expanded)&&(this.expanded&&t.expanded?this.expandedState2=t.expandedState2="half":this.expanded?t.opened?(this.expandedState2="extended",this.width=t.measuredWidth+t.measuredMargin):(this.expandedState2="full",this.margin2=t.measuredMargin):this.opened?(t.expandedState2="extended",t.width=this.measuredWidth+this.measuredMargin):(t.expandedState2="full",t.margin2=this.measuredMargin))}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc),ea(kl))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,e){1&t&&ga("@openClose.done",function(){return e.closeOpenDone()})("@expandCollapse.done",function(){return e.expandCollapseDone()}),2&t&&(rl("@openClose",e.openedState)("@expandCollapse",e.expandedStateObj),Ba(e.className),ja("ccf-drawer-end",e.classEnd)("ccf-drawer-opened",e.opened)("ccf-drawer-expanded",e.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:oZ,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,e){1&t&&(wa(),ra(0,"div",0),xa(1),sa())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%);background-color:#fff}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[Vg("openClose",[$g("open, open-instant",Hg({transform:"none"})),$g("closed",Hg({})),Wg("closed => open-instant",zg(0)),Wg("closed <=> open, open-instant => closed",zg(".5s ease-in-out"))]),Vg("expandCollapse",[$g("collapsed",Hg({})),$g("half",Hg({width:"calc(50% - {{ margin }}px)"}),aZ),$g("extended",Hg({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),aZ),$g("full",Hg({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),aZ),Wg("* <=> *",zg(".5s ease-in-out"))])]},changeDetection:0}),t})();function uZ(t,e){1&t&&(ra(0,"ccf-drawer-content"),xa(1,2),sa())}const hZ=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],dZ=["ccf-drawer","ccf-drawer-content","*"];function pZ(t){throw new Error(`Multiple drawers in position ${t}`)}let fZ=(()=>{class t{constructor(t,e){this.cdr=e,this.className="ccf-drawer-container",this.subscriptions=new g,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}get content(){var t;return null!==(t=this.content1.first)&&void 0!==t?t:this.content2.first}get hasWrappedContent(){return 0!==this.content1.length}ngAfterViewInit(){this.drawers.changes.pipe(Kd(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(Kd(null)).subscribe(()=>{this.channel.sendMessage({type:"content-container-changed",content:this.content}),this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return!0}validateDrawers(){const t=this.drawers.toArray(),e=t.filter(t=>"start"===t.position),n=t.filter(t=>"end"===t.position);return e.length>1&&pZ("start"),n.length>1&&pZ("end"),[e[0],n[0]]}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-container"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,cZ,5),Xc(n,sZ,5)),2&t){let t;Wc(t=Yc())&&(e.drawers=t),Wc(t=Yc())&&(e.content1=t)}},viewQuery:function(t,e){if(1&t&&qc(sZ,5),2&t){let t;Wc(t=Yc())&&(e.content2=t)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},exportAs:["ccfDrawerContainer"],features:[_l([iZ])],ngContentSelectors:dZ,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&(wa(hZ),xa(0),xa(1,1),Jo(2,uZ,2,0,"ccf-drawer-content",0)),2&t&&(ws(2),na("ngIf",!e.hasWrappedContent))},directives:[_h,sZ],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),t})();function gZ(t,e){if(1&t&&(ra(0,"mat-option",6),ra(1,"div"),Za(2),sa(),sa()),2&t){const t=e.$implicit,n=va();na("value",t),ws(1),Ba(n.optionsVisible),ws(1),tl(" ",t," ")}}let mZ=(()=>{class t{constructor(t){this.ga=t,this.selectionChange=new Rc,this.optionsVisible="invisible"}toggleOptions(){this.optionsVisible="visible"===this.optionsVisible?"invisible":"visible"}selectionChanged(t){this.selection=t,this.ga.event("selection_change","dropdown",`${this.label}:${t}`),this.selectionChange.emit(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dropdown"]],inputs:{label:"label",options:"options",selection:"selection"},outputs:{selectionChange:"selectionChange"},decls:7,vars:3,consts:[[1,"ccf-dropdown","wrapper"],[1,"container"],[1,"dropdown-form-field"],[1,"label"],["disableOptionCentering","true","panelClass","option-panel","disableRipple","true",1,"selected-value",3,"value","selectionChange","openedChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"mat-form-field",2),ra(3,"div",3),Za(4),sa(),ra(5,"mat-select",4),fa("selectionChange",function(t){return e.selectionChanged(t.value)})("openedChange",function(){return e.toggleOptions()}),Jo(6,gZ,3,5,"mat-option",5),sa(),sa(),sa(),sa()),2&t&&(ws(4),tl(" ",e.label," "),ws(1),na("value",e.selection),ws(1),na("ngForOf",e.options))},directives:[lU,kX,yh,av],styles:["@-webkit-keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.dropdown-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:1em;padding-right:1em;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{font-size:.875rem;border:none}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix mat-select{font-size:1rem;font-weight:bold}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .option-panel{-webkit-animation:slideInHorizontalDropdown .3s;animation:slideInHorizontalDropdown .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;position:absolute!important;top:1.55rem;max-width:9.5rem} .option-panel .mat-option{border-bottom-width:1px;border-bottom-style:solid;padding-left:1em} .option-panel :last-child{border-bottom:none} .cdk-overlay-pane{min-width:0rem!important}.dropdown-form-field[_ngcontent-%COMP%]{height:3rem;width:100%}.dropdown-form-field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{padding-bottom:.063rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem} .ccf-dropdown .mat-select-arrow-wrapper{transform:translatey(-.5em)}"],changeDetection:0}),t})();const bZ=["popover"];function yZ(t,e){if(1&t){const t=ua();ra(0,"div",7,8),ra(2,"div"),ra(3,"div",9),Za(4),sa(),ra(5,"input",10),fa("keyup",function(e){return $e(t),va().onKeyLow(e)}),sa(),sa(),ra(6,"ng5-slider",11),fa("valueChange",function(e){return $e(t),va().lowValue=e})("highValueChange",function(e){return $e(t),va().highValue=e})("userChangeEnd",function(){return $e(t),va().sliderValueChanged()}),sa(),ra(7,"div"),ra(8,"div",12),Za(9),sa(),ra(10,"input",13),fa("keyup",function(e){return $e(t),va().onKeyHigh(e)}),sa(),sa(),sa()}if(2&t){const t=va();ws(2),nl("label min fade-in ",t.contentsVisible,""),ws(2),tl(" ",t.options.floor,"> "),ws(1),Sa("value",t.lowValue),ws(1),nl("slider fade-in ",t.contentsVisible,""),na("options",t.options)("value",t.lowValue)("highValue",t.highValue),ws(1),nl("label max fade-in ",t.contentsVisible,""),ws(2),tl(" ",t.options.ceil," "),ws(1),Sa("value",t.highValue)}}let vZ=(()=>{class t{constructor(t,e,n){this.element=e,this.ga=n,this.selectionChange=new Rc,this.isSliderOpen=!1,this.contentsVisible="invisible",this.isSliderInitialized=!1;const i=t.position().flexibleConnectedTo(e).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"}]);this.overlayRef=t.create({panelClass:"slider-pane",positionStrategy:i})}get rangeLabel(){const{lowValue:t,highValue:e}=this;return t===e?`${t}`:`${t}-${e}`}ngOnChanges(t){t.valueRange&&this.optionsChanged(),t.selection&&(this.lowValue=Math.min(...this.selection),this.highValue=Math.max(...this.selection))}optionsChanged(){var t,e;this.options={floor:this.valueRange?this.valueRange[0]:0,ceil:this.valueRange?this.valueRange[1]:0,step:1,hideLimitLabels:!0,hidePointerLabels:!0},this.lowValue=null!==(t=this.options.floor)&&void 0!==t?t:0,this.highValue=null!==(e=this.options.ceil)&&void 0!==e?e:0}ngOnDestroy(){this.overlayRef.dispose()}closeSliderPopover(t){var e,n;const{element:i,isSliderOpen:r,popoverElement:s}=this;r&&(i.nativeElement.contains(t)||(null===(n=null===(e=null==s?void 0:s.nativeElement)||void 0===e?void 0:e.contains)||void 0===n?void 0:n.call(e,t))||(this.overlayRef.detach(),this.isSliderInitialized=!1,this.isSliderOpen=!1,this.contentsVisible="invisible"))}toggleSliderPopover(){const{isSliderOpen:t,isSliderInitialized:e}=this;e?(this.overlayRef.detach(),this.isSliderInitialized=!1):!e&&!t&&this.initializeSliderPopover(),this.contentsVisible="visible"===this.contentsVisible?"invisible":"visible",this.isSliderOpen=!t}sliderValueChanged(){const{lowValue:t,highValue:e}=this;this.selection=[t,e],this.ga.event("slider_range_change","dual_slider",`${this.label}:${t}:${e}`),this.selectionChange.emit(this.selection)}initializeSliderPopover(){const{overlayRef:t,popoverPortal:e}=this;t.attach(e),t.updatePosition(),this.isSliderInitialized=!0}onKeyLow(t){const e=Number(t.target.value);"Enter"===t.key&&(e>=Number(this.options.floor)&&e<=Number(this.options.ceil)&&(this.lowValue=e),t.target.value=String(this.lowValue),t.target.blur(),this.sliderValueChanged())}onKeyHigh(t){const e=Number(t.target.value);"Enter"===t.key&&(e>=Number(this.options.floor)&&e<=Number(this.options.ceil)&&(this.highValue=e),t.target.value=String(this.highValue),t.target.blur(),this.sliderValueChanged())}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dual-slider"]],viewQuery:function(t,e){if(1&t&&(qc(Vp,7),qc(bZ,5,kl)),2&t){let t;Wc(t=Yc())&&(e.popoverPortal=t.first),Wc(t=Yc())&&(e.popoverElement=t.first)}},hostBindings:function(t,e){1&t&&fa("click",function(t){return e.closeSliderPopover(t.target)},!1,Ir)("touchstart",function(t){return e.closeSliderPopover(t.target)},!1,Ir)},inputs:{label:"label",valueRange:"valueRange",selection:"selection"},outputs:{selectionChange:"selectionChange"},features:[ye],decls:10,vars:4,consts:[[1,"ccf-slider","wrapper"],[1,"container"],["class","ccf-slider detached",4,"cdk-portal"],[1,"slider-form-field",3,"click"],[1,"slider-labels"],[1,"name-label"],[1,"range-label"],[1,"ccf-slider","detached"],["popover",""],[1,"label","floor"],["type","text",1,"input-low",3,"value","keyup"],[3,"options","value","highValue","valueChange","highValueChange","userChangeEnd"],[1,"label","ceil"],["type","text",1,"input-high",3,"value","keyup"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Jo(2,yZ,11,16,"div",2),ra(3,"mat-form-field",3),fa("click",function(){return e.toggleSliderPopover()}),ra(4,"div",4),ra(5,"span",5),Za(6),sa(),ra(7,"span",6),Za(8),sa(),sa(),oa(9,"mat-select"),sa(),sa(),sa()),2&t&&(ws(3),ja("highlight",e.isSliderOpen),ws(3),Ja(e.label),ws(2),Ja(e.rangeLabel))},directives:[zp,lU,kX,vY],styles:[".slider-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;font-size:.875rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.slider-labels[_ngcontent-%COMP%]{display:flex;flex-direction:column}.slider-labels[_ngcontent-%COMP%] .name-label[_ngcontent-%COMP%]{padding-bottom:.25rem}.slider-labels[_ngcontent-%COMP%] .range-label[_ngcontent-%COMP%]{font-weight:bold} .ccf-slider.wrapper .mat-select-arrow-wrapper{transform:translatey(-1.5em)}@-webkit-keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .slider-pane{position:absolute!important;top:-1px}.ccf-slider.detached[_ngcontent-%COMP%]{-webkit-animation:slideInHorizontalSlider .3s;animation:slideInHorizontalSlider .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;display:flex;justify-content:center;align-items:center;width:0rem;height:4.375rem;padding:.75rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] {visibility:hidden;margin-top:.9375rem;margin-bottom:.9375rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-bar{opacity:.2;height:.15rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-selection{opacity:1}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer{width:1rem;height:1rem;top:-.405rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer:after{display:none}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:2rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.min[_ngcontent-%COMP%]{margin-right:1rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%]{margin-left:1rem;align-items:flex-end}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-align:right}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .floor[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%]{font-size:.875rem}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border:none;width:1.75rem;font-size:1rem;font-weight:bold;padding:0}"]}),t})();function _Z(t,e){if(1&t){const t=ua();ra(0,"div",4),ra(1,"mat-checkbox",5),fa("change",function(e){const n=$e(t).$implicit;return va().filterOnChange(e,n)}),Za(2),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ws(1),na("checked",null==n.selection?null:n.selection.includes(t)),ws(1),tl(" ",t," ")}}let wZ=(()=>{class t{constructor(t){this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new Rc}filterOnChange(t,e){t.checked?(this.selection=[...this.selection,e],this.ga.event("filter_added","filter_checkbox",e)):(this.selection=this.selection.filter(t=>t!==e),this.ga.event("filter_removed","filter_checkbox",e)),this.selectionChange.emit(this.selection)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-checkbox"]],inputs:{label:"label",options:"options",selection:"selection",columns:"columns"},outputs:{selectionChange:"selectionChange"},decls:5,vars:6,consts:[[1,"filter-container"],[1,"filter-label"],[1,"options-container"],["class","option",4,"ngFor","ngForOf"],[1,"option"],[3,"checked","change"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Za(2),sa(),ra(3,"div",2),Jo(4,_Z,3,2,"div",3),sa(),sa()),2&t&&(ws(2),Ja(e.label),ws(1),ja("three",3===e.columns)("four",4===e.columns),ws(1),na("ngForOf",e.options))},directives:[yh,oX],styles:[".mat-checkbox.mat-accent .mat-checkbox-checkmark-path{stroke:#fff!important} .mat-checkbox.mat-accent .mat-checkbox-inner-container{margin-right:1rem}.filter-label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}.options-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap}.options-container.three[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:33%}.options-container.four[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:25%}.option[_ngcontent-%COMP%]{color:#fafafa}"],changeDetection:0}),t})();const xZ=function(){return["Both","Male","Female"]},SZ=function(){return[1,110]},EZ=function(){return[13,83]};let CZ=(()=>{class t{constructor(t){this.ga=t,this.filtersChange=new Rc,this.applyFilters=new Rc}updateFilter(t,e){this.filters=Object.assign(Object.assign({},this.filters),{[e]:t}),this.ga.event("filter_update","filter_content",`${e}:${t}`),this.filtersChange.emit(this.filters)}applyButtonClick(){this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}refreshFilters(){this.filters=Object.assign(Object.assign({},this.filters),{sex:"Both",ageRange:[1,110],bmiRange:[13,83],technologies:[],tmc:[]}),this.ga.event("filters_reset","filter_content"),this.filtersChange.emit(this.filters)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange",applyFilters:"applyFilters"},decls:14,vars:23,consts:[[1,"patient-filters"],["label","Sex",3,"options","selection","selectionChange"],["label","Age",3,"valueRange","selection","selectionChange"],["label","BMI",3,"valueRange","selection","selectionChange"],[1,"filter","assays"],["label","Assay Types",3,"columns","options","selection","selectionChange"],[1,"filter","providers"],["label","Tissue Providers",3,"columns","options","selection","selectionChange"],[1,"button-container"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"ccf-dropdown",1),fa("selectionChange",function(t){return e.updateFilter(t,"sex")}),sa(),ra(2,"ccf-dual-slider",2),fa("selectionChange",function(t){return e.updateFilter(t,"ageRange")}),sa(),ra(3,"ccf-dual-slider",3),fa("selectionChange",function(t){return e.updateFilter(t,"bmiRange")}),sa(),sa(),ra(4,"div",4),ra(5,"ccf-checkbox",5),fa("selectionChange",function(t){return e.updateFilter(t,"technologies")}),sa(),sa(),ra(6,"div",6),ra(7,"ccf-checkbox",7),fa("selectionChange",function(t){return e.updateFilter(t,"tmc")}),sa(),sa(),ra(8,"div",8),ra(9,"button",9),fa("click",function(){return e.applyButtonClick()}),Za(10,"APPLY FILTERS"),sa(),ra(11,"div",10),ra(12,"mat-icon",11),fa("click",function(){return e.refreshFilters()}),Za(13,"refresh"),sa(),sa(),sa()),2&t&&(ja("hidden",e.hidden),ws(1),na("options",Oc(20,xZ))("selection",null==e.filters?null:e.filters.sex),ws(1),na("valueRange",Oc(21,SZ))("selection",null==e.filters?null:e.filters.ageRange),ws(1),na("valueRange",Oc(22,EZ))("selection",null==e.filters?null:e.filters.bmiRange),ws(1),ja("hidden",e.hidden),ws(1),na("columns",4)("options",e.technologyFilters)("selection",null==e.filters?null:e.filters.technologies),ws(1),ja("hidden",e.hidden),ws(1),na("columns",3)("options",e.providerFilters)("selection",null==e.filters?null:e.filters.tmc),ws(1),ja("hidden",e.hidden))},directives:[mZ,vZ,wZ,__,p_],styles:[".filter[_ngcontent-%COMP%]{margin-top:2rem}.filter.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.filter.assays[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{margin-right:0 rem;width:25%}.button-container[_ngcontent-%COMP%]{margin-top:2rem;display:flex;flex-direction:row-reverse;align-items:center}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.refresh-icon[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{cursor:pointer;transition:.6s;transition-property:background}.patient-filters[_ngcontent-%COMP%]{display:flex;width:90%;padding-top:1rem}.patient-filters.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.patient-filters[_ngcontent-%COMP%] ccf-dual-slider[_ngcontent-%COMP%]{margin-left:.5rem;width:33%}.patient-filters[_ngcontent-%COMP%] ccf-dropdown[_ngcontent-%COMP%]{width:33%}"],changeDetection:0}),t})();function OZ(t,e){1&t&&(ra(0,"div"),ra(1,"mat-icon",7),Za(2,"close"),sa(),sa())}function TZ(t,e){1&t&&oa(0,"mat-icon",8)}let kZ=(()=>{class t{constructor(){this.filtersChange=new Rc,this.filtersVisible=!1}toggleFilterVisible(){this.filtersVisible=!this.filtersVisible}removeBox(){this.filtersVisible=!1}applyFilters(t){this.filters=t,this.filtersChange.emit(t),this.removeBox()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange"},decls:8,vars:12,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","hidden","filters","applyFilters"],[1,"icon"],["svgIcon","filter",1,"icon","funnel"]],template:function(t,e){if(1&t&&(ra(0,"div",0),ra(1,"button",1),fa("click",function(){return e.toggleFilterVisible()}),Jo(2,OZ,3,0,"div",2),Jo(3,TZ,1,0,"ng-template",null,3,Jc),sa(),ra(5,"div",4),ra(6,"div",5),ra(7,"ccf-filters-content",6),fa("applyFilters",function(t){return e.applyFilters(t)}),sa(),sa(),sa(),sa()),2&t){const t=ta(4);ja("expanded",e.drawerExpanded),ws(2),na("ngIf",e.filtersVisible)("ngIfElse",t),ws(3),ja("visible",e.filtersVisible)("hidden",!e.filtersVisible),ws(2),na("technologyFilters",e.technologyFilters)("providerFilters",e.providerFilters)("hidden",!e.filtersVisible)("filters",e.filters)}},directives:[_h,CZ,p_],styles:[".filters-popover[_ngcontent-%COMP%]{position:inherit}.filters-popover.expanded[_ngcontent-%COMP%]{position:relative}.filters-popover.expanded[_ngcontent-%COMP%] .popup-container[_ngcontent-%COMP%]{right:inherit}.filters-popover.expanded[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding-left:4em!important}.popup-container[_ngcontent-%COMP%]{position:absolute;z-index:5;top:1.2rem;left:1.48rem;box-shadow:.2rem .2rem 1rem #00000058}.popup-container[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding:1.5rem;position:relative;height:26.5rem}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;height:26.5rem;transition:width .2s ease-in-out;border-width:1px}.popup-container.visible[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:1;transition-delay:.3s;transition-duration:.2s}.popup-container.hidden[_ngcontent-%COMP%]{width:0;height:0;transition:all .2s ease-out;transition-delay:.3s;pointer-events:none}.popup-container.hidden[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out}.show-hide[_ngcontent-%COMP%]{background:none;border:none;z-index:10;position:relative;cursor:pointer;outline:none;padding:.5rem;border-radius:.25rem;transition:.6s}"],changeDetection:0}),t})();class AZ{constructor(t,e){this.original=t,this.level=e,this.visible=!0,this.opacity=20}get label(){return this.original.label}get expandable(){return this.original.children.length>0}static create(t,e){return new AZ(t,e)}}function PZ(t,e){if(1&t){const t=ua();ra(0,"div",5),fa("click",function(e){const n=$e(t).node,i=va();return i.select(e.ctrlKey,n,!0,!i.isSelected(n))}),Za(1),sa()}if(2&t){const t=e.node,n=va();ja("hidden",t.label===(null==n.highlightedNode?null:n.highlightedNode.label))("filtered-out",!n.occurenceData[t.original.id]&&!!n.termData[t.original.id])("unavailable",!n.termData[t.original.id])("selected",n.isSelected(t)),ws(1),Ja("colon"===t.label?"large intestine":t.label)}}function IZ(t,e){1&t&&ca(0)}const MZ=function(t){return{node:t}};function DZ(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",6),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",7),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",8),ra(4,"ccf-opacity-slider",9,10),fa("opacityChange",function(e){const n=$e(t).$implicit;return va().updateOpacity(n,e)})("opacityReset",function(){const e=$e(t).$implicit;return va().resetNode(e)})("visibilityToggle",function(){const e=$e(t).$implicit;return va().toggleVisibility(e)}),sa(),sa(),sa(),oa(6,"div",11),Jo(7,IZ,1,0,"ng-container",12),ra(8,"div",13),Za(9),sa(),sa()}if(2&t){const t=e.$implicit,n=va(),i=ta(2);na("matTreeNodePaddingIndent",n.indent),ws(1),La("display",-1!==t.opacity?"none":"block"),ws(1),La("left",n.getLeftIndent(t.level)),ja("fade",!0!==t.visible),ws(1),La("left",n.getLeftIndent(t.level)),ja("hidden",t.label!==(null==n.highlightedNode?null:n.highlightedNode.label)),ws(1),na("visible",t.visible)("opacity",t.opacity),ws(3),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Tc(18,MZ,t)),ws(1),ja("suborgan",t.level>1),ws(1),Ja(n.occurenceData[t.original.id]||0)}}function RZ(t,e){1&t&&ca(0)}function NZ(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",14),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",7),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",8),ra(4,"ccf-opacity-slider",9,15),fa("opacityChange",function(e){const n=$e(t).$implicit;return va().updateOpacity(n,e)})("opacityReset",function(){const e=$e(t).$implicit;return va().resetNode(e)})("visibilityToggle",function(){const e=$e(t).$implicit;return va().toggleVisibility(e)}),sa(),sa(),sa(),ra(6,"button",16),ra(7,"mat-icon",17),Za(8),sa(),sa(),Jo(9,RZ,1,0,"ng-container",12),ra(10,"div",13),Za(11),sa(),sa()}if(2&t){const t=e.$implicit,n=va(),i=ta(2);na("matTreeNodePaddingIndent",n.indent),ws(1),La("display",-1!==t.opacity?"none":"block"),ws(1),La("left",n.getLeftIndent(t.level)),ja("fade",!0!==t.visible),ws(1),La("left",n.getLeftIndent(t.level)),ja("hidden",t.label!==(null==n.highlightedNode?null:n.highlightedNode.label)),ws(1),na("visible",t.visible)("opacity",t.opacity),ws(2),ja("hidden",t.label===(null==n.highlightedNode?null:n.highlightedNode.label)),Zo("aria-label","Toggle ",t.label,""),ws(2),tl(" ",n.control.isExpanded(t)?"expand_less":"expand_more"," "),ws(1),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Tc(22,MZ,t)),ws(1),ja("suborgan",t.level>1),ws(1),Ja(n.occurenceData[t.original.id]||0)}}const LZ=(0,KG.property)("level"),jZ=(0,KG.property)("expandable");let FZ=(()=>{class t{constructor(t,e){this.cdr=t,this.ga=e,this.atScrollBottom=!1,this.nodeSelected=new Rc,this.nodeChanged=new Rc,this.indent="1.5rem",this.control=new OY(LZ,jZ),this.flattener=new WY(AZ.create,LZ,jZ,KG.invoke.bind(void 0,this,"getChildren")),this.dataSource=new qY(this.control,this.flattener),this._nodes=void 0,this.bodyNode=new AZ({"@id":"http://purl.obolibrary.org/obo/UBERON_0013702","@type":"OntologyTreeNode",id:"http://purl.obolibrary.org/obo/UBERON_0013702",label:"body",parent:"",children:[],synonymLabels:[]},0),this.anySelectionsMade=!1,this.selectedNodes=[]}set nodes(t){var e;this._nodes=t,this.control&&(this.dataSource.data=null!==(e=this._nodes)&&void 0!==e?e:[])}get nodes(){return this._nodes}set getChildren(t){var e;this._getChildren=t,this.dataSource.data=null!==(e=this.nodes)&&void 0!==e?e:[]}get getChildren(){return this._getChildren}set occurenceData(t){this._occurenceData=t||{}}get occurenceData(){return this._occurenceData}set termData(t){this._termData=t||{}}get termData(){return this._termData}ngOnInit(){this.control.dataNodes&&this.control.expand(this.control.dataNodes[0])}ngOnChanges(t){if(t.ontologyFilter){const e=t.ontologyFilter.currentValue;this.selectByIDs((null==e?void 0:e.length)>=0?e:[this.bodyNode.original.id])}}selectByIDs(t){const e=this.control.dataNodes,n=e.filter(e=>t.indexOf(e.original.id)>-1);(null==n?void 0:n.length)>0&&(this.selectedNodes=n,this.ga.event("nodes_selected_by_ids","ontology_tree",n.map(t=>t.label).join(",")),this.control.collapseAll(),this.selectedNodes.forEach(t=>{this.expandAndSelect(t.original,t=>{var n;return null===(n=e.find(e=>e.original.id===t.parent))||void 0===n?void 0:n.original},!0)}))}expandAndSelect(t,e,n=!1){var i;const{cdr:r,control:s}=this,o=new Set;let a=e(t);for(;a;)o.add(a),a=e(a);const l=(0,KG.filter)(s.dataNodes,t=>o.has(t.original)),c=s.dataNodes.find(e=>e.original===t);n||(this.selectedNodes=[],s.collapseAll());for(const u of l)s.expand(u);"body"===t.label&&(null===(i=s.dataNodes)||void 0===i?void 0:i.length)>0&&s.expand(s.dataNodes[0]),this.select(n,c,!1,!0),r.detectChanges()}isInnerNode(t,e){return e.expandable}isSelected(t){return this.selectedNodes.filter(e=>(null==t?void 0:t.original.label)===(null==e?void 0:e.original.label)).length>0}select(t,e,n,i){if(this.anySelectionsMade||(this.selectedNodes=[],this.anySelectionsMade=!0),void 0===e)return this.selectedNodes=[],void this.ga.event("nodes_unselected","ontology_tree");t?i?this.selectedNodes.indexOf(e)<0&&this.selectedNodes.push(e):this.selectedNodes.splice(this.selectedNodes.indexOf(e),1):(this.selectedNodes=[],i&&this.selectedNodes.push(e)),this.ga.event("nodes_selected","ontology_tree",this.selectedNodes.map(t=>t.label).join(",")),n&&this.nodeSelected.emit(this.selectedNodes.map(t=>null==t?void 0:t.original))}mouseOver(t){this.highlightedNode=t}mouseOut(){this.highlightedNode=void 0}updateOpacity(t,e){t.opacity=e,this.ga.event("opacity_update","ontology_tree",t.label,e),this.nodeChanged.emit(t)}resetNode(t){t.opacity=20,t.visible=!0,this.ga.event("node_reset","ontology_tree",t.label),this.nodeChanged.emit(t)}toggleVisibility(t){t.visible=!0!==t.visible,this.ga.event("visibility_update","ontology_tree",t.label,+t.visible),this.nodeChanged.emit(t)}getLeftIndent(t){return-1.5*t+"rem"}onScroll(t){if(!t.target)return;const{clientHeight:e,scrollHeight:n,scrollTop:i}=t.target;this.atScrollBottom=n-i-e<20}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[ye],decls:6,vars:5,consts:[[1,"ccf-ontology-tree",3,"dataSource","treeControl","scroll"],["selectableRegion",""],["class","node leaf-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef"],["class","node inner-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef","matTreeNodeDefWhen"],[1,"scroll-gradient"],[1,"text",3,"click"],["matTreeNodePadding","",1,"node","leaf-node",3,"matTreeNodePaddingIndent","mouseleave"],["svgIcon","app:opacity",1,"icon","opacity",3,"mouseenter"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider1",""],[1,"non-expandable"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"num-results"],["matTreeNodePadding","",1,"node","inner-node",3,"matTreeNodePaddingIndent","mouseleave"],["slider2",""],["mat-icon-button","","matTreeNodeToggle","",1,"toggle"],[1,"icon","font-icon"]],template:function(t,e){1&t&&(ra(0,"mat-tree",0),fa("scroll",function(t){return e.onScroll(t)}),Jo(1,PZ,2,9,"ng-template",null,1,Jc),Jo(3,DZ,10,20,"mat-tree-node",2),Jo(4,NZ,12,24,"mat-tree-node",3),sa(),oa(5,"div",4)),2&t&&(na("dataSource",e.dataSource)("treeControl",e.control),ws(4),na("matTreeNodeDefWhen",e.isInnerNode),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[HY,VY,BY,zY,p_,pG,kh,__,$Y],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;height:100%;width:25.25rem;overflow:auto;overflow-x:hidden}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .toggle[_ngcontent-%COMP%]{z-index:-1;opacity:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .text[_ngcontent-%COMP%]{margin-left:.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]{min-height:0;font-size:1rem;margin-bottom:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:width;position:relative;z-index:1}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{width:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%] ccf-opacity-slider[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider{height:1.5rem;margin-left:1rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box .slider-and-label{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider{height:1.5rem;width:15rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider .mat-slider-wrapper{top:12px}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .opacity-value{width:3rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-right:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node.inner-node[_ngcontent-%COMP%] button.hidden[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{position:relative;min-width:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:normal}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .autocomplete-open[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{border-bottom:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .non-expandable[_ngcontent-%COMP%]{margin-left:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{white-space:nowrap;cursor:pointer;margin-left:1rem;opacity:1;width:50%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:opacity,width}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.hidden[_ngcontent-%COMP%]{opacity:0;width:0%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.unavailable[_ngcontent-%COMP%]{pointer-events:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-left:auto}.scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();class BZ{constructor(t){this.ontologyState=t}get rootNode(){return this.ontologyState.rootNode$}filter(t){return this.ontologyState.nodes$.pipe(D(e=>this.lookup(e,t.toLowerCase())))}lookup(t,e){const n=new Map;return t&&t.forEach(t=>{if(t.label.toLowerCase().includes(e)&&!n.get(t.id))n.set(t.id,{index:this.getIndexOfMatch(t.label,e),displayLabel:this.formatLabel(t.label,e),node:t});else{const i=t.synonymLabels.find(t=>t.toLowerCase().includes(e));i&&!n.get(t.id)&&n.set(t.id,{index:this.getIndexOfMatch(t.label+" ("+i+")",e),displayLabel:this.formatLabel(t.label+" ("+i+")",e),node:t})}}),Array.from(n.values())}getIndexOfMatch(t,e){return t.toLowerCase().indexOf(e)}formatLabel(t,e){const n=this.getIndexOfMatch(t,e);return[t.substr(0,n),t.substr(n,e.length),t.substr(n+e.length,t.length)]}getChildren(t){return(0,KG.at)(this.ontologyState.snapshot.nodes,t.children)}}function VZ(t,e){if(1&t&&(ra(0,"mat-option",8),ra(1,"span",9),Za(2),sa(),ra(3,"span",10),Za(4),sa(),ra(5,"span",11),Za(6),sa(),sa()),2&t){const t=e.$implicit;na("value",t),ws(2),Ja(t.displayLabel[0]),ws(2),Ja(t.displayLabel[1]),ws(2),Ja(t.displayLabel[2])}}BZ.\u0275fac=function(t){return new(t||BZ)(Ci($q))},BZ.\u0275prov=xt({token:BZ,factory:BZ.\u0275fac,providedIn:"root"}),sw([iB.ak],BZ.prototype,"getChildren",null);let zZ=(()=>{class t{constructor(t,e){this.ontologyService=t,this.ga=e,this.selected=new Rc,this.formControl=new gz(""),this.autoCompleteOpen=!1}ngOnInit(){this.filteredResults$=this.formControl.valueChanges.pipe(Hd(t=>"string"==typeof t),Kd(""),Qd(t=>this.ontologyService.filter(t)),D(t=>(0,KG.sortBy)(t,[this.sortBySynonymResult,"index",this.sortLexically])))}displayFormatter(t){var e;return(null!==(e=null==t?void 0:t.displayLabel)&&void 0!==e?e:[]).join("")}sortBySynonymResult(t){return t.displayLabel.join().includes("(")?1:-1}sortLexically(t){return t.node.label.toLowerCase()}onSelect(t){const e=(0,KG.get)(t,["option","value","node"]);e&&(this.ga.event("search","ontology_search",e.id),this.selected.emit(e),this.formControl.reset())}}return t.\u0275fac=function(e){return new(e||t)(ea(BZ),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-search"]],outputs:{selected:"selected"},decls:10,vars:8,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","placeholder","Search ontology terms ...","matInput","",1,"input",3,"formControl","matAutocomplete"],[1,"ccf-ontology-search","detached","autocomplete",3,"displayWith","optionSelected","opened","closed"],["autocomplete",""],[1,"results-container"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"prefix"],[1,"search-term"],[1,"suffix"]],template:function(t,e){if(1&t&&(ra(0,"form",0),ra(1,"mat-form-field",1),ra(2,"mat-icon",2),Za(3,"search"),sa(),oa(4,"input",3),ra(5,"mat-autocomplete",4,5),fa("optionSelected",function(t){return e.onSelect(t)})("opened",function(){return e.autoCompleteOpen=!0})("closed",function(){return e.autoCompleteOpen=!1}),ra(7,"div",6),Jo(8,VZ,7,4,"mat-option",7),Ic(9,"async"),sa(),sa(),sa(),sa()),2&t){const t=ta(6);ja("autocomplete-open",e.autoCompleteOpen),ws(4),na("formControl",e.formControl)("matAutocomplete",t),ws(1),na("displayWith",e.displayFormatter),ws(3),na("ngForOf",Mc(9,6,e.filteredResults$))}},directives:[wz,YV,_z,lU,p_,nU,LU,TV,TU,XV,Cz,xU,yh,av],pipes:[Dh],styles:[".ccf-ontology-search[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem .25rem 0;margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;height:3rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix input{margin-left:.4rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-prefix{top:.5rem;border:none}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0 .25rem;min-width:2.5rem} .ccf-ontology-search.detached{border:.125rem solid;border-top:none;border-radius:0 0 .25rem .25rem;max-height:18rem} .ccf-ontology-search.detached .results-container{width:23.75rem;margin-bottom:1rem;overflow:auto;max-height:15rem;scrollbar-width:thin} .ccf-ontology-search.detached .results-container mat-option{height:1.5rem;width:23.75rem} .ccf-ontology-search.detached .results-container mat-option .search-term{text-decoration:underline}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0;border-bottom:none}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem 0 0;border-bottom:none}"],changeDetection:0}),t})();const UZ=function(t){return[t]};function HZ(t,e){if(1&t){const t=ua();ra(0,"ccf-ontology-tree",2),fa("nodeSelected",function(e){return $e(t),va().ontologySelection.emit(e)}),sa()}if(2&t){const t=e.ngIf,n=va();na("nodes",Tc(5,UZ,t))("getChildren",n.ontologySearchService.getChildren)("occurenceData",n.occurenceData)("termData",n.termData)("ontologyFilter",n.ontologyFilter)}}let $Z=(()=>{class t{constructor(t,e){this.ontologySearchService=t,this.store=e,this.ontologySelection=new Rc}selected(t){const{nodes:e}=this.store.selectSnapshot($q);this.tree.expandAndSelect(t,t=>e[t.parent])}}return t.\u0275fac=function(e){return new(e||t)(ea(BZ),ea(pV))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-selection"]],viewQuery:function(t,e){if(1&t&&qc(FZ,5),2&t){let t;Wc(t=Yc())&&(e.tree=t.first)}},inputs:{occurenceData:"occurenceData",termData:"termData",ontologyFilter:"ontologyFilter"},outputs:{ontologySelection:"ontologySelection"},decls:3,vars:3,consts:[[3,"selected"],["class","tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected"]],template:function(t,e){1&t&&(ra(0,"ccf-ontology-search",0),fa("selected",function(t){return e.selected(t)}),sa(),Jo(1,HZ,1,7,"ccf-ontology-tree",1),Ic(2,"async")),2&t&&(ws(1),na("ngIf",Mc(2,1,e.ontologySearchService.rootNode)))},directives:[zZ,_h,FZ],pipes:[Dh],styles:[""],changeDetection:0}),t})(),GZ=(()=>{class t{constructor(t,e,n){this.drawer=t,this.cdr=n,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new g;const i=e.connect(this);this.subscriptions.add(i.getMessagesFromSource(t).subscribe(t=>{this.handleMessage(t)&&n.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",e="arrow_left";return"end"===this.position&&([t,e]=[e,t]),this.opened?e:t}ngAfterViewInit(){setTimeout(()=>{this.position=this.drawer.position,this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return"drawer-toggled"===t.payload.type&&(this.opened=t.payload.opened,!0)}toggle(){const t=this.drawer,{opened:e,expanded:n}=t;e?n?t.closeExpanded():t.close():t.open()}}return t.\u0275fac=function(e){return new(e||t)(ea(cZ),ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,e){2&t&&(Ba(e.className),ja("ccf-drawer-toggle-button-end",e.classEnd))},decls:2,vars:1,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,e){1&t&&(ra(0,"mat-icon",0),fa("click",function(){return e.toggle()}),Za(1),sa()),2&t&&(ws(1),tl(" ",e.icon,"\n"))},directives:[p_],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;display:flex;align-items:center;transition:.6s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:relative;right:.25rem;transition:all .5s}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}"],changeDetection:0}),t})();function WZ(t,e){1&t&&(ra(0,"div",7),oa(1,"mat-spinner",8),ra(2,"span",3),Za(3,"Loading External Site"),sa(),sa())}function qZ(t,e){if(1&t){const t=ua();ra(0,"iframe",9),fa("load",function(){return $e(t),va().loading=!1}),sa()}2&t&&Ko("src",va().safeUrl,wr)}let XZ=(()=>{class t{constructor(t){this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new Rc,this.loading=!0,this.safeUrl=null}ngOnChanges(t){"url"in t&&this.updateUrl()}updateUrl(){const{sanitizer:t,url:e}=this;this.safeUrl=null,e&&(this.safeUrl=t.bypassSecurityTrustResourceUrl(e),this.loading=!0)}}return t.\u0275fac=function(e){return new(e||t)(ea(hd))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},inputs:{url:"url"},outputs:{closed:"closed"},features:[ye],decls:11,vars:4,consts:[[1,"toolbar"],["mat-flat-button","","target","_blank","rel","noopener noreferrer",1,"launch",3,"href","disabled"],[1,"icon"],[1,"text"],["mat-flat-button","",1,"close",3,"click"],["class","overlay",4,"ngIf"],["class","frame","title","Portal Data Viewer","referrerpolicy","no-referrer",3,"load",4,"ngIf"],[1,"overlay"],[1,"spinner"],["title","Portal Data Viewer","referrerpolicy","no-referrer",1,"frame",3,"load"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"a",1),ra(2,"mat-icon",2),Za(3,"launch"),sa(),ra(4,"span",3),Za(5,"Open in Portal"),sa(),sa(),ra(6,"button",4),fa("click",function(){return e.closed.emit()}),ra(7,"mat-icon",2),Za(8,"clear"),sa(),sa(),sa(),Jo(9,WZ,4,0,"div",5),Jo(10,qZ,1,1,"iframe",6)),2&t&&(ws(1),na("href",e.safeUrl,_r)("disabled",!e.safeUrl),ws(8),na("ngIf",e.loading),ws(1),na("ngIf",e.safeUrl))},directives:[w_,p_,__,_h,XQ],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;width:100%;height:1.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%]{margin-right:3.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch.mat-button-disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.25rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{min-width:0;padding:0;line-height:1.5rem;border-radius:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:1.5rem;bottom:0;left:0;right:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{margin-bottom:.5rem}[_nghost-%COMP%] .frame[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0}),t})();function YZ(t,e){if(1&t&&oa(0,"div",3),2&t){const t=e.index;ja("line-tick-visible",va().tissueSectionExists(t+1))}}const KZ=function(){return[]};let QZ=(()=>{class t{constructor(){this.clsName="ccf-tissue-section-vis"}tissueSectionExists(t){return this.tissueSections.filter(e=>e.sectionNumber===t).length>0}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tissue-section-vis"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{totalTissueSections:"totalTissueSections",tissueSections:"tissueSections"},decls:7,vars:3,consts:[[1,"container"],["class","line-tick",3,"line-tick-visible",4,"ngFor","ngForOf"],[1,"x-axis"],[1,"line-tick"]],template:function(t,e){1&t&&(ra(0,"div"),Za(1,"0"),sa(),ra(2,"div",0),Jo(3,YZ,1,2,"div",1),oa(4,"div",2),sa(),ra(5,"div"),Za(6),sa()),2&t&&(ws(3),na("ngForOf",Oc(2,KZ).constructor(e.totalTissueSections)),ws(3),Ja(e.totalTissueSections))},directives:[yh],styles:["[_nghost-%COMP%]{width:100%;height:2.5rem;padding:.5rem 1rem;display:flex}[_nghost-%COMP%] .container[_ngcontent-%COMP%]{margin-right:.5rem;margin-left:.5rem;flex-grow:1;display:flex;position:relative;justify-content:space-evenly}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .line-tick[_ngcontent-%COMP%]{height:100%;width:1px;z-index:2}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .x-axis[_ngcontent-%COMP%]{width:100%;height:2px;position:absolute;top:calc(50% - 1px);right:0;z-index:1}"],changeDetection:0}),t})();function ZZ(t,e){if(1&t){const t=ua();ra(0,"div",7),ra(1,"div",8),Za(2),sa(),ra(3,"a",9),fa("click",function(){$e(t);const e=va().$implicit;return va().linkClicked.emit(e)}),Za(4," DATA "),ra(5,"mat-icon"),Za(6,"open_in_new"),sa(),sa(),sa()}if(2&t){const t=va().$implicit;ws(1),La("background-image","url("+t.thumbnail+")"),ws(1),tl(" ",t.technology," ")}}function JZ(t,e){1&t&&(aa(0),Jo(1,ZZ,7,3,"ng-template",6),la())}const tJ=(()=>{let t=-1;return()=>(t+=1,t)})();let eJ=(()=>{class t{constructor(){this.className="ccf-thumbnail-carousel",this.linkClicked=new Rc,this.uid=tJ(),this.config={allowTouchMove:!1,slidesOffsetBefore:4,slidesOffsetAfter:4,slidesPerView:"auto",spaceBetween:4,watchOverflow:!0},this.navigation={prevEl:"#"+this.prevButtonId,nextEl:"#"+this.nextButtonId}}get prevButtonId(){return`ccf-thumbnail-carousel-prev-button-${this.uid}`}get nextButtonId(){return`ccf-thumbnail-carousel-next-button-${this.uid}`}itemId(t,e){return e.thumbnail}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-thumbnail-carousel"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},inputs:{data:"data"},outputs:{linkClicked:"linkClicked"},decls:11,vars:6,consts:[[1,"prev"],["mat-icon-button","","disableRipple",""],[1,"swiper",3,"config","navigation"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"next"],[1,"fade"],["swiperSlide",""],[1,"slide"],[1,"thumbnail"],[1,"link",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"button",1),ra(2,"mat-icon"),Za(3,"navigate_before"),sa(),sa(),sa(),ra(4,"swiper",2),Jo(5,JZ,2,0,"ng-container",3),sa(),ra(6,"div",4),ra(7,"button",1),oa(8,"div",5),ra(9,"mat-icon"),Za(10,"navigate_next"),sa(),sa(),sa()),2&t&&(ws(1),Ko("id",e.prevButtonId),ws(3),na("config",e.config)("navigation",e.navigation),ws(1),na("ngForOf",e.data)("ngForTrackBy",e.itemId),ws(2),Ko("id",e.nextButtonId))},directives:[__,p_,OQ,yh,CQ],styles:['[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%]{flex-grow:1;padding-bottom:.3125rem}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%] .swiper-slide{width:3.75rem;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:1.5rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{position:absolute;top:-.625rem;left:-2rem;z-index:10;width:2rem;height:3.125rem;opacity:1;transition:opacity ease-in-out .3s;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%]{cursor:default;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background-size:cover;position:relative;width:calc(100% - 2 * .125rem);height:calc(100% - 2 * .125rem);border-style:solid;border-width:.125rem;border-radius:.25rem;background-origin:padding-box;background-clip:padding-box;font-size:.875rem;font-weight:bold}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-.125rem;left:-.125rem;width:.125rem;height:.125rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;bottom:0;right:0;left:0;opacity:0;transition:opacity ease-in-out .3s;box-shadow:0 2px 4px #0009;font-size:.75rem;line-height:.75rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%], [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:link, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:visited, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:focus, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:active{cursor:pointer;text-decoration:none}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]:hover .link[_ngcontent-%COMP%]{opacity:1}'],changeDetection:0}),t})();function nJ(t,e){if(1&t){const t=ua();ra(0,"mat-icon",14),fa("click",function(){return $e(t),va().toggleExpansion()}),Za(1),sa()}if(2&t){const t=va();ws(1),Ja(t.expanded?"expand_less":"expand_more")}}function iJ(t,e){if(1&t&&oa(0,"ccf-tissue-section-vis",20),2&t){const t=va(2);na("totalTissueSections",t.tissueBlock.sectionCount)("tissueSections",t.tissueBlock.sections)}}function rJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"ccf-thumbnail-carousel",21),fa("linkClicked",function(e){return $e(t),va(2).linkHandler(e.link)}),sa(),la()}if(2&t){const t=va(2);ws(1),na("data",t.tissueBlock.datasets)}}function sJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"ccf-thumbnail-carousel",21),fa("linkClicked",function(e){return $e(t),va(3).linkHandler(e.link)}),sa(),la()}if(2&t){const t=va().$implicit;ws(1),na("data",t.datasets)}}function oJ(t,e){if(1&t){const t=ua();ra(0,"div",22),ra(1,"div",23),ra(2,"mat-icon",24),Za(3,"bubble_chart"),sa(),ra(4,"div",17),ra(5,"div",8),Za(6),sa(),ra(7,"div",8),Za(8),sa(),sa(),ra(9,"div",9),fa("click",function(){const e=$e(t).$implicit;return va(2).linkHandler(e.link)}),ra(10,"div",10),Za(11,"TISSUE SECTION"),sa(),ra(12,"mat-icon",11),Za(13,"open_in_new"),sa(),sa(),sa(),Jo(14,sJ,2,1,"ng-container",13),sa()}if(2&t){const t=e.$implicit;ws(6),Ja(t.label),ws(2),Ja(t.description),ws(6),na("ngIf",t.datasets.length>0)}}function aJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"div",15),ra(2,"div",16),ra(3,"mat-icon",5),Za(4,"bubble_chart"),sa(),ra(5,"div",17),ra(6,"div",8),Za(7),sa(),ra(8,"div",8),Za(9),sa(),sa(),ra(10,"div",9),fa("click",function(){$e(t);const e=va();return e.linkHandler(e.tissueBlock.link)}),ra(11,"div",10),Za(12,"TISSUE BLOCK"),sa(),ra(13,"mat-icon",11),Za(14,"open_in_new"),sa(),sa(),sa(),Jo(15,iJ,1,2,"ccf-tissue-section-vis",18),Jo(16,rJ,2,1,"ng-container",13),sa(),Jo(17,oJ,15,3,"div",19),la()}if(2&t){const t=va();ws(7),Ja(t.tissueBlock.label),ws(2),Ja(t.tissueBlock.description),ws(6),na("ngIf",t.tissueBlock.sections.length>1),ws(1),na("ngIf",t.tissueBlock.datasets.length>0),ws(1),na("ngForOf",t.tissueBlock.sections)}}const lJ=function(t){return{"background-color":t}};let cJ=(()=>{class t{constructor(t){this.ga=t,this.clsName="ccf-donor-card",this.selected=!1,this.expanded=!1,this.highlighted=!1,this.checked=new Rc,this.linkClick=new Rc,this.hoverState=""}handleCheckbox(){this.selected=!this.selected,this.ga.event("selected_toggled","donor_card",this.tissueBlock.label,+this.selected),this.checked.emit(this.selected),this.expanded=!1}toggleExpansion(){this.selected&&(this.expanded=!this.expanded,this.ga.event("expanded_toggled","donor_card",this.tissueBlock.label,+this.expanded))}linkHandler(t){this.ga.event("link_clicked","donor_card",this.tissueBlock.label),this.selected?this.linkClick.emit(t):(this.selected=!0,this.checked.emit(this.selected))}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{tissueBlock:"tissueBlock",selected:"selected",color:"color",expanded:"expanded",highlighted:"highlighted"},outputs:{checked:"checked",linkClick:"linkClick"},decls:19,vars:20,consts:[[1,"main-container"],[1,"checkbox-background",3,"ngStyle","click"],[1,"checkbox",3,"checked"],[1,"hoverable","default-padding","donor","mat-elevation-z2"],[1,"d-flex"],[1,"icon-size","icon-dark","mr-5"],[1,"donor-info"],[1,"title","description"],[1,"description"],[1,"hover-state","mat-elevation-z4",3,"click"],[1,"hover-title"],[1,"icon-size","hover-icon"],["class","icon-size ml-5 selectable",3,"click",4,"ngIf"],[4,"ngIf"],[1,"icon-size","ml-5","selectable",3,"click"],[1,"expanded-view","mat-elevation-z2","align-end"],[1,"info-block","hover-enabled","default-padding"],[1,"text-content"],[3,"totalTissueSections","tissueSections",4,"ngIf"],["class","expanded-view w-80 mat-elevation-z2 align-end",4,"ngFor","ngForOf"],[3,"totalTissueSections","tissueSections"],[1,"mt-05",3,"data","linkClicked"],[1,"expanded-view","w-80","mat-elevation-z2","align-end"],[1,"default-padding","info-block","hover-enabled"],[1,"icon-size","mr-5","icon-light"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),fa("click",function(){return e.handleCheckbox()}),oa(2,"mat-checkbox",2),sa(),ra(3,"div",3),ra(4,"div",4),ra(5,"mat-icon",5),Za(6,"person"),sa(),ra(7,"div",6),ra(8,"div",7),Za(9),sa(),ra(10,"div",8),Za(11),sa(),sa(),sa(),ra(12,"div",9),fa("click",function(){return e.linkHandler(e.tissueBlock.donor.link)}),ra(13,"div",10),Za(14,"DONOR"),sa(),ra(15,"mat-icon",11),Za(16,"open_in_new"),sa(),sa(),Jo(17,nJ,2,1,"mat-icon",12),sa(),sa(),Jo(18,aJ,18,5,"ng-container",13)),2&t&&(ws(1),ja("selected",e.selected)("highlighted",e.highlighted),na("ngStyle",Tc(18,lJ,e.selected?e.color:"transparent")),ws(1),ja("checkselected",e.selected),na("checked",e.selected),ws(1),ja("hover-enabled",e.selected)("expanded",e.expanded)("highlighted",e.highlighted),ws(6),Ja(e.tissueBlock.donor.label),ws(2),Ja(e.tissueBlock.donor.description),ws(6),na("ngIf",e.selected),ws(1),na("ngIf",e.expanded))},directives:[Th,oX,p_,_h,yh,QZ,eJ],styles:["[_nghost-%COMP%]{width:100%}[_nghost-%COMP%] .main-container[_ngcontent-%COMP%]{display:flex;min-height:3rem;width:100%;align-items:center;padding-left:.5rem}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%]{height:2rem;width:2rem;border-radius:50%;margin-right:.5rem;display:flex;justify-content:center;align-items:center;cursor:pointer}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-checked.mat-accent .mat-checkbox-background, [_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-indeterminate.mat-accent[_ngcontent-%COMP%] .mat-checkbox-background[_ngcontent-%COMP%]{background-color:transparent}[_nghost-%COMP%] .checkbox-background.highlighted[_ngcontent-%COMP%] .mat-ripple-element{opacity:.04}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkselected[_ngcontent-%COMP%] .mat-checkbox-frame{border-color:#fff!important}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{margin-left:1.12rem;margin-bottom:.12rem}[_nghost-%COMP%] .align-end[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;width:100%;align-items:center}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]:not(:first-child){margin-top:.5rem}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .donor.highlighted[_ngcontent-%COMP%]{box-shadow:0 6px 2px -2px #0003,0 4px 4px #00000024,0 2px 10px #0000001f}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .hover-state[_ngcontent-%COMP%]{width:19.5rem!important}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .hoverable[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]:hover .hover-state[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%]{transition:opacity .15s ease-in-out;opacity:0;cursor:pointer;position:absolute;height:100%;width:100%;top:0;margin-left:-.5rem;align-items:center;display:flex;justify-content:flex-end;padding-right:1rem;font-size:.75rem}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-title[_ngcontent-%COMP%]{font-weight:lighter}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-icon[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .default-padding[_ngcontent-%COMP%]{padding:.25rem .5rem}[_nghost-%COMP%] .expanded-view[_ngcontent-%COMP%]{margin-top:.25rem;width:85%;margin-bottom:.25rem}[_nghost-%COMP%] .d-flex[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .icon-size[_ngcontent-%COMP%]{height:1.5rem;width:1.5rem;font-size:1.5rem}[_nghost-%COMP%] .selectable[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%]{width:80%!important}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:16rem!important}[_nghost-%COMP%] .ml-5[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .mr-5[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .mt-05[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),t})();function uJ(t,e){if(1&t&&(ra(0,"div",7),ra(1,"div",8),Za(2),sa(),ra(3,"div",9),Za(4),sa(),sa()),2&t){const t=e.$implicit;ws(2),Ja(t.count),ws(2),Ja(t.label)}}function hJ(t,e){if(1&t){const t=ua();ra(0,"div",10),fa("mouseenter",function(){const e=$e(t).$implicit;return va().handleHover(e.tissueBlock.spatialEntityId)})("mouseleave",function(){return $e(t),va().handleUnhover()}),ra(1,"ccf-donor-card",11),fa("checked",function(e){const n=$e(t).$implicit;return va().handleSelection(n,e)})("linkClick",function(e){return $e(t),va().handleLinkClick(e)}),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ws(1),na("tissueBlock",t.tissueBlock)("selected",t.selected)("color",t.color)("highlighted",t.tissueBlock.spatialEntityId===n.highlighted)}}let dJ=(()=>{class t{constructor(t){this.ga=t,this.linkClicked=new Rc,this.listResultSelected=new Rc,this.listResultDeselected=new Rc,this.itemHovered=new Rc,this.itemUnhovered=new Rc,this.atScrollBottom=!1}handleSelection(t,e){this.ga.event("list_result_selected","results_browser",this.resultLabel,+e),e?this.listResultSelected.next(t):this.listResultDeselected.next(t)}handleLinkClick(t){this.linkClicked.emit(t)}onScroll(t){if(!t.target)return;const{clientHeight:e,scrollHeight:n,scrollTop:i}=t.target;this.atScrollBottom=n-i-e<64}handleHover(t){this.itemHovered.emit(t)}handleUnhover(){this.itemUnhovered.emit()}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:5,consts:[[1,"results-browser-container"],[1,"stat-box"],["id","title"],["class","stat-row",4,"ngFor","ngForOf"],[1,"results-browser-list",3,"scroll"],["class","browser-item-container",3,"mouseenter","mouseleave",4,"ngFor","ngForOf"],[1,"scroll-gradient"],[1,"stat-row"],[1,"stat-value"],[1,"stat-label"],[1,"browser-item-container",3,"mouseenter","mouseleave"],[3,"tissueBlock","selected","color","highlighted","checked","linkClick"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),Za(3),sa(),Jo(4,uJ,5,2,"div",3),sa(),ra(5,"div",4),fa("scroll",function(t){return e.onScroll(t)}),Jo(6,hJ,2,4,"div",5),sa(),oa(7,"div",6),sa()),2&t&&(ws(3),Ja(e.resultLabel),ws(1),na("ngForOf",e.aggregateData),ws(2),na("ngForOf",e.listResults),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[yh,cJ],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 7rem);padding:0 1.5rem 1.5rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%]{margin-bottom:1.5rem;line-height:1.25;min-height:7.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] #title[_ngcontent-%COMP%]{font-size:1.25rem;margin-bottom:.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-value[_ngcontent-%COMP%]{margin-right:1rem;width:5.5rem;text-align:right;font-weight:600}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-label[_ngcontent-%COMP%]{font-weight:300}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;overflow-y:scroll;scrollbar-width:thin;padding-right:.5rem;margin-bottom:2rem}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%] .browser-item-container[_ngcontent-%COMP%]{width:100%}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();function pJ(t,e){1&t&&(ra(0,"a",5),Za(1,"LOGIN"),sa()),2&t&&na("href",va().hubmapPortalUrl+"login",_r)}function fJ(t,e){1&t&&(ra(0,"a",5),Za(1,"LOGOUT"),sa()),2&t&&na("href",va().hubmapPortalUrl+"logout",_r)}let gJ=(()=>{class t{constructor(){this.refreshClicked=new Rc,this.downloadClicked=new Rc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-header"]],inputs:{hubmapPortalUrl:"hubmapPortalUrl",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:3,consts:[[1,"ccf-header"],[1,"portal-home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right","svgIcon","app:logo",1,"logo"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"href",4,"ngIf"],["mat-button","","rel","noreferrer noopener","target","_blank",1,"authentication",3,"href"]],template:function(t,e){1&t&&(ra(0,"mat-toolbar",0),ra(1,"a",1),oa(2,"mat-icon",2),sa(),oa(3,"div",3),Jo(4,pJ,2,1,"a",4),Jo(5,fJ,2,1,"a",4),sa()),2&t&&(ws(1),na("href",e.hubmapPortalUrl,_r),ws(3),na("ngIf",!e.loggedIn),ws(1),na("ngIf",e.loggedIn))},directives:[BG,p_,ew,_h,w_],styles:[".ccf-header[_ngcontent-%COMP%]{height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid;display:flex}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%}.ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%]{height:1.5rem}.ccf-header[_ngcontent-%COMP%] .authentication[_ngcontent-%COMP%]{width:8.25rem;border-radius:.125rem;font-weight:500}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{display:flex;align-items:center;transition:color 1s;cursor:pointer;text-decoration:none}.ccf-header[_ngcontent-%COMP%] [_ngcontent-%COMP%]:not(:last-child){margin-right:1.5rem}.ccf-header[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}.ccf-header[_ngcontent-%COMP%] .filter-labels[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;font:400 1rem/1.25rem Inter,sans-serif}"],changeDetection:0}),t})();const mJ=["bodyUI"];function bJ(t,e){if(1&t&&(oa(0,"ccf-header",33),Ic(1,"async")),2&t){const t=va();na("hubmapPortalUrl",Mc(1,2,t.portalUrl$))("loggedIn",t.loggedIn)}}const yJ=function(){return{}},vJ=function(){return{x:2.2,y:2,z:.4}};let _J=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c){this.data=n,this.theming=i,this.scene=r,this.listResultsState=s,this.consentService=o,this.snackbar=a,this.globalConfig=c,this.ontologySelectionLabel="Body",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=RG.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(D(t=>t===Nq.Running)),this.portalUrl$=this.globalConfig.getOption("hubmapPortalUrl"),i.initialize(t,e),l.setRootElement(t),n.tissueBlockData$.subscribe(),n.aggregateData$.subscribe(),n.termOccurencesData$.subscribe(),n.sceneData$.subscribe(),n.filter$.subscribe(),n.technologyFilterData$.subscribe(),n.providerFilterData$.subscribe(),this.ontologyTerms$=n.filter$.pipe(FU("ontologyTerms"))}ngOnInit(){const t=this.snackbar.openFromComponent(TG,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia&&(window.matchMedia("(prefers-color-scheme: dark)").matches&&this.theming.setTheme(IG),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.theming.setTheme(t.matches?IG:PG)}))}reset(t,e,n){t.open(),t.closeExpanded(),e.open(),e.closeExpanded(),n.removeBox(),this.resetView()}resetView(){this.bodyUI.target=[0,0,0],this.bodyUI.rotation=0,this.bodyUI.rotationX=0,this.bodyUI.bounds={x:2.2,y:2,z:.4}}toggleScheme(){this.theming.setTheme(this.theming.getTheme()===PG?IG:PG)}ontologySelected(t){if(t)return this.data.updateFilter({ontologyTerms:t.map(t=>t.id)}),this.ontologySelectionLabel=this.createSelectionLabel(t),void(t[0]&&"body"===t[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[]}),this.ontologySelectionLabel=""}createSelectionLabel(t){if(0===t.length)return"";if(1===t.length)return t[0].label;let e="";return t.forEach((n,i)=>{e+=n.label,inull==t?void 0:t.startsWith(e))?(this.url=t,this.viewerOpen=!!t):(window.open(t,"_blank"),this.closeiFrameViewer())}closeiFrameViewer(){this.viewerOpen=!1}get loggedIn(){var t;return(null!==(t=this.globalConfig.snapshot.hubmapToken)&&void 0!==t?t:"").length>0}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(No),ea(Fq),ea(MG),ea(Wq),ea(zq),ea(Y$),ea(q_),ea(Nf),ea(SG))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-root"]],viewQuery:function(t,e){if(1&t&&qc(mJ,5),2&t){let t;Wc(t=Yc())&&(e.bodyUI=t.first)}},decls:70,vars:77,consts:[[1,"ccf-app","mat-app-background"],["text","Loading CCF Exploration User Interface (EUI)",3,"active"],[3,"hubmapPortalUrl","loggedIn",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","filtersChange"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],[3,"termData","occurenceData","ontologySelection"],["position","end","opened","",1,"right-drawer",3,"stateChange"],["right",""],[1,"portal-view",3,"url","closed"],[1,"drawer-icons"],[1,"drawer-icons-left"],[1,"button",3,"matTooltip","click"],[1,"icon"],[1,"scheme-toggle","button",3,"matTooltip","click"],[1,"button"],["matTooltip","Reset View",1,"refresh","icon",3,"click"],["videoID","YAHJqvD3Q_8","infoTitle","HuBMAP CCF Exploration User Interface","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],[1,"close-button-wrapper"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"hubmapPortalUrl","loggedIn"]],template:function(t,e){if(1&t){const t=ua();ra(0,"div",0),oa(1,"ccf-spinner-overlay",1),Ic(2,"async"),Jo(3,bJ,2,4,"ccf-header",2),Ic(4,"async"),ra(5,"ccf-drawer-container",3),ra(6,"ccf-drawer",4,5),fa("stateChange",function(){return $e(t),ta(11).removeBox()}),ra(8,"div"),ra(9,"div",6),ra(10,"ccf-filters-popover",7,8),fa("filtersChange",function(t){return e.data.updateFilter(t)}),Ic(12,"async"),Ic(13,"async"),Ic(14,"async"),sa(),ra(15,"div",9),ra(16,"div",10),Za(17,"Sex: "),ra(18,"strong"),Za(19),Ic(20,"async"),sa(),sa(),ra(21,"div",11),Za(22,"Age: "),ra(23,"strong"),Za(24),Ic(25,"async"),Ic(26,"async"),sa(),sa(),ra(27,"div",12),Za(28,"BMI: "),ra(29,"strong"),Za(30),Ic(31,"async"),Ic(32,"async"),sa(),sa(),sa(),sa(),ra(33,"ccf-ontology-selection",13),fa("ontologySelection",function(t){return e.ontologySelected(t)}),Ic(34,"async"),Ic(35,"async"),sa(),oa(36,"ccf-drawer-toggle-button"),sa(),sa(),ra(37,"ccf-drawer",14,15),fa("stateChange",function(){return $e(t),ta(11).removeBox()}),ra(39,"ccf-viewer",16),fa("closed",function(){return e.viewerOpen=!1}),sa(),ra(40,"div",17),ra(41,"div",18),ra(42,"button",19),fa("click",function(){$e(t);const e=ta(11),n=ta(38);return e.removeBox(),n.toggleExpanded()}),ra(43,"mat-icon",20),Za(44),sa(),sa(),ra(45,"button",21),fa("click",function(){return e.toggleScheme()}),ra(46,"mat-icon",20),Za(47),sa(),sa(),ra(48,"button",22),ra(49,"mat-icon",23),fa("click",function(){$e(t);const n=ta(7),i=ta(38),r=ta(11);return e.reset(n,i,r)}),Za(50,"refresh "),sa(),sa(),sa(),oa(51,"ccf-info-button",24),sa(),ra(52,"ccf-results-browser",25),fa("listResultSelected",function(t){return e.listResultsState.selectListResult(t)})("listResultDeselected",function(t){return e.listResultsState.deselectListResult(t)})("linkClicked",function(t){return e.openiFrameViewer(t)})("itemHovered",function(t){return e.listResultsState.highlightNode(t)})("itemUnhovered",function(){return e.listResultsState.unHighlightNode()}),Ic(53,"async"),Ic(54,"async"),Ic(55,"async"),sa(),oa(56,"ccf-drawer-toggle-button"),sa(),ra(57,"ccf-drawer-content"),ra(58,"div",26),ra(59,"ccf-organ-selector",27),fa("organsChanged",function(t){return e.scene.setSelectedReferenceOrgans(t)}),Ic(60,"async"),Ic(61,"async"),Ic(62,"async"),sa(),sa(),ra(63,"div",28),ra(64,"div",29),fa("click",function(){return e.organListVisible=!e.organListVisible}),ra(65,"mat-icon",30),Za(66),sa(),sa(),sa(),ra(67,"ccf-body-ui",31,32),fa("nodeClick",function(t){return e.scene.sceneNodeClicked(t)})("nodeHoverStart",function(t){return e.scene.sceneNodeHovered(t)})("nodeHoverStop",function(){return e.scene.sceneNodeUnhover()}),Ic(69,"async"),sa(),sa(),sa(),sa()}if(2&t){const t=ta(38);let n,i,r,s;ws(1),na("active",Mc(2,37,e.spinnerActive$)),ws(2),na("ngIf",!1===Mc(4,39,e.spinnerActive$)),ws(7),na("filters",Mc(12,41,e.data.filter$))("drawerExpanded",t.expanded)("technologyFilters",Mc(13,43,e.data.technologyFilterData$))("providerFilters",Mc(14,45,e.data.providerFilterData$)),ws(9),Ja(null==(n=Mc(20,47,e.data.filter$))?null:n.sex),ws(5),el("",null==(i=Mc(25,49,e.data.filter$))?null:i.ageRange[0],"-",null==(i=Mc(26,51,e.data.filter$))?null:i.ageRange[1],""),ws(6),el("",null==(r=Mc(31,53,e.data.filter$))?null:r.bmiRange[0],"-",null==(r=Mc(32,55,e.data.filter$))?null:r.bmiRange[1],""),ws(3),na("termData",Mc(34,57,e.data.ontologyTermsFullData$))("occurenceData",Mc(35,59,e.data.termOccurencesData$)),ws(6),ja("opened",e.viewerOpen),na("url",e.url),ws(3),na("matTooltip",t.expanded?"Exit Fullscreen":"Enter Fullscreen"),ws(2),Ja(t.expanded?"fullscreen_exit":"fullscreen"),ws(1),na("matTooltip","light-theme"===e.theming.getTheme()?"Enter Dark Mode":"Enter Light Mode"),ws(2),tl("","light-theme"===e.theming.getTheme()?"brightness_2":"brightness_5"," "),ws(5),na("listResults",Mc(53,61,e.listResultsState.listResults$))("aggregateData",Mc(54,63,e.data.aggregateData$))("resultLabel",e.ontologySelectionLabel)("highlighted",Mc(55,65,e.listResultsState.highlightedNodeId$)),ws(6),ja("closed",!e.organListVisible),ws(1),na("multiselect",!0)("occurenceData",null!==(s=Mc(60,67,e.data.termOccurencesData$))&&void 0!==s?s:Oc(75,yJ))("organList",Mc(61,69,e.scene.referenceOrgans$))("selectedOrgans",Mc(62,71,e.scene.selectedReferenceOrgans$)),ws(4),ja("closed",!e.organListVisible),ws(3),tl(" ",e.organListVisible?"arrow_drop_up":"arrow_drop_down"," "),ws(1),ja("expanded-stage",!e.organListVisible),na("scene",Mc(69,73,e.scene.scene$))("bounds",Oc(76,vJ))}},directives:[nZ,_h,fZ,cZ,kZ,$Z,GZ,XZ,ew,p_,wG,dJ,sZ,hG,nG,gJ],pipes:[Dh],styles:[".cdk-overlay-container{position:absolute;font-size:1.2rem}[_nghost-%COMP%]{display:block;position:relative}.ccf-app[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;position:relative;text-align:left}.ccf-app[_ngcontent-%COMP%] ccf-header[_ngcontent-%COMP%]{z-index:99}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{flex-grow:1;height:100%;width:100%;opacity:1;overflow:visible;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{overflow:hidden;margin-bottom:1.5rem;border-radius:.5rem;height:100%;padding-bottom:4rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .organ-selector[_ngcontent-%COMP%]{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:28.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%]{display:flex;padding-left:1.5rem;height:5rem;padding-right:1.5rem;align-items:center;justify-content:space-between}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;padding:.65rem;transition:.6s}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5rem;transition:all .5s ease-in-out}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-4.25rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{transition:all .5s ease-in-out;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem;height:calc(100% - 6rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:100%;padding-bottom:3rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;border-top-right-radius:.5rem;border-top-left-radius:.5rem;height:0}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{display:flex;justify-content:center;height:1.0625rem;width:3rem;align-self:center;border-radius:0 0 .25rem .25rem;cursor:pointer;transition:.6s;position:relative;top:.5rem;z-index:1}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{position:relative;bottom:.2rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%]{padding-left:1.5rem;padding-right:1.5rem;height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%]{height:5rem;display:flex;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:75%;margin-left:1.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%]{font-weight:300}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600!important}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view[_ngcontent-%COMP%]{position:fixed;left:0;top:0;bottom:0;right:425%;height:100%;transform:translate(-425%);width:calc(100% - 28.5rem);transition:transform .5s cubic-bezier(.82,.085,.395,.895)}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view.opened[_ngcontent-%COMP%]{transform:translate(0);transition:width 0s .5s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view[_ngcontent-%COMP%]{width:100vw}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view.opened[_ngcontent-%COMP%]{transition:width 0s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .shaded-toggle[_ngcontent-%COMP%]{box-shadow:-1px 0 4px #212121}[_ngcontent-%COMP%]::-webkit-scrollbar{width:7.5rem}"],changeDetection:0}),t})();function wJ(t,e){1&t&&oa(0,"ccf-root")}function xJ(t){const e=t=>"string"==typeof t,n=t=>Array.isArray(t)&&t.every(e);if("string"==typeof t){const e=eZ.json(t);if(n(e))return e}else if(n(t))return t;throw new Error("Invalid data sources")}let SJ=(()=>{class t extends tZ{constructor(t,e){super(t,e,{initialDelay:10,initialConfig:Object.assign(Object.assign({},RG.dbOptions),globalThis.dbOptions),parse:{dataSources:xJ,useRemoteApi:eZ.boolean}})}}return t.\u0275fac=function(e){return new(e||t)(ea(SG),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-root-wc"]],inputs:{dataSources:"dataSources",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[jo],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&Jo(0,wJ,1,0,"ccf-root",0),2&t&&na("ngIf",e.initialized)},directives:[_h,_J],encapsulation:2,changeDetection:0}),t})(),EJ=(()=>{class t{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(t,e){const n=function(t,e){return e.get(El).resolveComponentFactory(t).inputs}(t,e.injector),i=e.strategyFactory||new Bf(t,e.injector),r=function(t){const e={};return t.forEach(({propName:t,templateName:n})=>{e[function(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}(n)]=t}),e}(n);class s extends zf{constructor(t){super(),this.injector=t}get ngElementStrategy(){if(!this._ngElementStrategy){const t=this._ngElementStrategy=i.create(this.injector||e.injector);n.forEach(({propName:e})=>{if(!this.hasOwnProperty(e))return;const n=this[e];delete this[e],t.setInputValue(e,n)})}return this._ngElementStrategy}attributeChangedCallback(t,e,n,i){this.ngElementStrategy.setInputValue(r[t],n)}connectedCallback(){let t=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),t=!0),this.ngElementStrategy.connect(this),t||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(t=>{const e=function(t,e,n){if("function"!=typeof CustomEvent){const i=t.createEvent("CustomEvent");return i.initCustomEvent(e,!1,!1,n),i}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:n})}(this.ownerDocument,t.name,t.value);this.dispatchEvent(e)})}}return s.observedAttributes=Object.keys(r),n.forEach(({propName:t})=>{Object.defineProperty(s.prototype,t,{get(){return this.ngElementStrategy.getInputValue(t)},set(e){this.ngElementStrategy.setInputValue(t,e)},configurable:!0,enumerable:!0})}),s}(SJ,{injector:this.injector});customElements.define("ccf-eui",t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(No))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:AG,useValue:"light-theme"},{provide:gf,useExisting:Nf}],imports:[[ky,gd,Yq,BQ,EY,KY,f_,xY,RQ,KQ,iG,dG,xG,rw,QQ,kG,G_]]}),t})();RG.production&&function(){if(Ru)throw new Error("Cannot enable prod mode after platform setup.");Du=!1}(),pd().bootstrapModule(EJ).catch(t=>console.error(t))},91052:function(t){function e(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(i,r)}t.exports=function(t){return function(){var n=this,i=arguments;return new Promise(function(r,s){var o=t.apply(n,i);function a(t){e(o,r,s,a,l,"next",t)}function l(t){e(o,r,s,a,l,"throw",t)}a(void 0)})}},t.exports.default=t.exports,t.exports.__esModule=!0},61948:function(t){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},34321:function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},91741:function(t){function e(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}e.keys=function(){return[]},e.resolve=e,e.id=91741,t.exports=e},9521:function(){},49125:function(){},75307:function(){}},function(t){t(t.s=35090)}]); \ No newline at end of file +var oBe=Object.defineProperty,aBe=Object.defineProperties,lBe=Object.getOwnPropertyDescriptors,dT=Object.getOwnPropertySymbols,eX=Object.prototype.hasOwnProperty,tX=Object.prototype.propertyIsEnumerable,Nr=Math.pow,nX=(t,e,n)=>e in t?oBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,bt=(t,e)=>{for(var n in e||(e={}))eX.call(e,n)&&nX(t,n,e[n]);if(dT)for(var n of dT(e))tX.call(e,n)&&nX(t,n,e[n]);return t},ti=(t,e)=>aBe(t,lBe(e)),iX=(t,e)=>{var n={};for(var i in t)eX.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&dT)for(var i of dT(t))e.indexOf(i)<0&&tX.call(t,i)&&(n[i]=t[i]);return n};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{71440:function(t,e,n){var i=n(91052).default;t.exports=function t(e,n,i){function r(o,a){if(!n[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){return r(e[o][1][t]||t)},c,c.exports,t,e,n,i)}return n[o].exports}for(var s=void 0,o=0;o0&&r[r.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0?o-4:o;for(n=0;n>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[u++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l},n.fromByteArray=function(t){for(var e,n=t.length,r=n%3,s=[],o=16383,a=0,l=n-r;al?l:a+o));return 1===r?s.push(i[(e=t[n-1])>>2]+i[e<<4&63]+"=="):2===r&&s.push(i[(e=(t[n-2]<<8)+t[n-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t){return i[t>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}function h(t,e,n){for(var i=[],r=e;r>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}n.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(r>0&&(t.lastNeed=r-1),r):--i=0?(r>0&&(t.lastNeed=r-2),r):--i=0?(r>0&&(2===r?r=0:t.lastNeed=r-3),r):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":4}],6:[function(t,e,n){(function(e){(function(){"use strict";var e=t("base64-js"),i=t("ieee754");n.Buffer=o,n.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function s(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=o.prototype,e}function o(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return a(t,e,n)}function a(t,e,n){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|d(t,e),i=s(n),r=i.write(t,e);return r!==n&&(i=i.slice(0,r)),i}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function d(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(t).length;default:if(r)return i?-1:L(t).length;e=(""+e).toLowerCase(),r=!0}}function p(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return C(this,e,n);case"latin1":case"binary":return O(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function f(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function g(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=o.from(e,i)),o.isBuffer(e))return 0===e.length?-1:m(t,e,n,i,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function m(t,e,n,i,r){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var u=-1;for(s=n;sa&&(n=a-l),s=n;s>=0;s--){for(var h=!0,d=0;dr&&(i=r):i=r;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o>8,r.push(n%256),r.push(i);return r}(e,t.length-n),t,n,i)}function S(t,n,i){return e.fromByteArray(0===n&&i===t.length?t:t.slice(n,i))}function E(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(s=t[r+1]))&&(l=(31&c)<<6|63&s)>127&&(u=l);break;case 3:o=t[r+2],128==(192&(s=t[r+1]))&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=t[r+2],a=t[r+3],128==(192&(s=t[r+1]))&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(i.push((u-=65536)>>>10&1023|55296),u=56320|1023&u),i.push(u),r+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var n="",i=0;ie&&(t+=" ... "),""},o.prototype.compare=function(t,e,n,i,r){if(B(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(e>>>=0),l=Math.min(s,a),c=this.slice(i,r),u=t.slice(e,n),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return y(this,t,e,n);case"ascii":return v(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;ri)&&(n=i);for(var r="",s=e;sn)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,i,r,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function I(t,e,n,i,r,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(t,e,n,r,s){return e=+e,n>>>=0,s||I(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function D(t,e,n,r,s){return e=+e,n>>>=0,s||I(t,0,n,8),i.write(t,e,n,r,52,8),n+8}o.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t],r=1,s=0;++s>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t+--e],r=1;e>0&&(r*=256);)i+=this[t+--e]*r;return i},o.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t],r=1,s=0;++s=(r*=128)&&(i-=Math.pow(2,8*e)),i},o.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var i=e,r=1,s=this[t+--i];i>0&&(r*=256);)s+=this[t+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*e)),s},o.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,i){t=+t,e>>>=0,n>>>=0,i||P(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[e]=255&t;++s>>=0,n>>>=0,i||P(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,s=1;for(this[e+r]=255&t;--r>=0&&(s*=256);)this[e+r]=t/s&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,t,e,n,r-1,-r)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,t,e,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,n){return M(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return M(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,i){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&0!==i&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--s)t[s+e]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,i),e);return r},o.prototype.fill=function(t,e,n,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var r=t.charCodeAt(0);("utf8"===i&&r<128||"latin1"===i)&&(t=r)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function j(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(t,e,n){"use strict";e.exports=function t(e){return null===e||"object"!=typeof e||null!=e.toJSON?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((e,n,i)=>e+(0===i?"":",")+t(void 0===n||"symbol"==typeof n?null:n),"")+"]":"{"+Object.keys(e).sort().reduce((n,i,r)=>void 0===e[i]||"symbol"==typeof e[i]?n:n+(0===n.length?"":",")+t(i)+":"+t(e[i]),"")+"}"}},{}],8:[function(t,e,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(t,e){return new Promise(function(n,i){function r(n){t.removeListener(e,s),i(n)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}b(t,e,s,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&b(t,"error",e,n)}(t,r,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,n,i){var r,s,o;if(c(n),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]),void 0===o)o=s[e]=n,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(r=u(t))>0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,function(t){console&&console.warn&&console.warn(t)}(a)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=d.bind(i);return r.listener=n,i.wrapFn=r,r}function f(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=r[t];if(void 0===l)return!1;if("function"==typeof l)s(l,this,e);else{var c=l.length,u=m(l,c);for(n=0;n=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},{}],9:[function(t,e,n){n.read=function(t,e,n,i,r){var s,o,a=8*r-i-1,l=(1<>1,u=-7,h=n?r-1:0,d=n?-1:1,p=t[e+h];for(h+=d,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=256*s+t[e+h],h+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+h],h+=d,u-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},n.write=function(t,e,n,i,r,s){var o,a,l,c=8*s-r-1,u=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(a=0,o=u):o+h>=1?(a=(e*l-1)*Math.pow(2,r),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<0;t[n+p]=255&o,p+=f,o/=256,c-=8);t[n+p-f]|=128*g}},{}],10:[function(t,e,n){e.exports="function"==typeof Object.create?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},{}],11:[function(t,e,n){"use strict";const{isArray:r,isObject:s,isString:o}=t("./types"),{asArray:a}=t("./util"),{prependBase:l}=t("./url"),c=t("./JsonLdError"),u=t("./ResolvedContext");function h(t){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:t})}function d({context:t,base:e}){if(!t)return;const n=t["@context"];if(o(n))t["@context"]=l(e,n);else if(r(n))for(let i=0;i10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(e))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:e});let i,l;a.add(e);try{l=yield n(e),i=l.document||null,o(i)&&(i=JSON.parse(i))}catch(u){throw new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:e,cause:u})}if(!s(i))throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:e});return i="@context"in i?{"@context":i["@context"]}:{"@context":{}},l.contextUrl&&(r(i["@context"])||(i["@context"]=[i["@context"]]),i["@context"].push(l.contextUrl)),{context:i,remoteDoc:l}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(t,e,n){"use strict";e.exports=class extends Error{constructor(t="An unspecified JSON-LD error occurred.",e="jsonld.Error",n={}){super(t),this.name=e,this.message=t,this.details=n}}},{}],13:[function(t,e,n){"use strict";e.exports=t=>{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(e,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):t.compact(e,n)},e.expand=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):t.expand(e)},e.flatten=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):t.flatten(e)},e}},{}],14:[function(t,e,n){"use strict";e.exports=t("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(t,e,n){"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(t){const e=this;return e._loader=t,function(){return e.add.apply(e,arguments)}}add(t){var e=this;return i(function*(){let n=e._requests[t];if(n)return Promise.resolve(n);n=e._requests[t]=e._loader(t);try{return yield n}finally{delete e._requests[t]}})()}}},{}],16:[function(t,e,n){"use strict";const i=t("lru-cache");e.exports=class{constructor({document:t}){this.document=t,this.cache=new i({max:10})}getProcessed(t){return this.cache.get(t)}setProcessed(t,e){this.cache.set(t,e)}}},{"lru-cache":33}],17:[function(t,e,n){"use strict";const r=t("./JsonLdError"),{isArray:s,isObject:o,isString:a,isUndefined:l}=t("./types"),{isList:c,isValue:u,isGraph:h,isSimpleGraph:d,isSubjectReference:p}=t("./graphTypes"),{expandIri:f,getContextValue:g,isKeyword:m,process:b,processingMode:y}=t("./context"),{removeBase:v,prependBase:_}=t("./url"),{addValue:w,asArray:x,compareShortestLeast:S}=t("./util"),E={};function C(t,e,n){if("@nest"!==f(t,e,{vocab:!0},n))throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=E,E.compact=function(){var t=i(function*({activeCtx:t,activeProperty:e=null,element:n,options:i={},compactionMap:f=(()=>{})}){if(s(n)){let r=[];for(let s=0;s1&&(T=Array.from(T).sort());const k=t;for(const e of T){const n=E.compactIri({activeCtx:k,iri:e,relativeTo:{vocab:!0}}),r=g(S,n,"@context");l(r)||(t=yield b({activeCtx:t,localCtx:r,options:i,propagate:!1}))}const A=Object.keys(n).sort();for(const l of A){const p=n[l];if("@id"!==l)if("@type"!==l)if("@reverse"!==l)if("@preserve"!==l)if("@index"!==l)if("@graph"!==l&&"@list"!==l&&"@included"!==l&&m(l)){const e=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,e,p)}else{if(!s(p))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const e=E.compactIri({activeCtx:t,iri:l,value:p,relativeTo:{vocab:!0},reverse:v}),n=t.mappings.has(e)?t.mappings.get(e)["@nest"]:null;let r=_;n&&(C(t,n,i),o(_[n])||(_[n]={}),r=_[n]),w(r,e,p,{propertyIsArray:!0})}for(const e of p){const n=E.compactIri({activeCtx:t,iri:l,value:e,relativeTo:{vocab:!0},reverse:v}),r=t.mappings.has(n)?t.mappings.get(n)["@nest"]:null;let p=_;r&&(C(t,r,i),o(_[r])||(_[r]={}),p=_[r]);const m=g(t,n,"@container")||[],b=h(e),y=c(e);let S;y?S=e["@list"]:b&&(S=e["@graph"]);let O=yield E.compact({activeCtx:t,activeProperty:n,element:y||b?S:e,options:i,compactionMap:f});if(y){if(s(O)||(O=[O]),m.includes("@list")){w(p,n,O,{valueIsArray:!0,allowDuplicate:!0});continue}O={[E.compactIri({activeCtx:t,iri:"@list",relativeTo:{vocab:!0}})]:O},"@index"in e&&(O[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"])}if(b)if(m.includes("@graph")&&(m.includes("@id")||m.includes("@index")&&d(e))){let r;p.hasOwnProperty(n)?r=p[n]:p[n]=r={};const s=(m.includes("@id")?e["@id"]:e["@index"])||E.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}});w(r,s,O,{propertyIsArray:!i.compactArrays||m.includes("@set")})}else m.includes("@graph")&&d(e)?(s(O)&&O.length>1&&(O={"@included":O}),w(p,n,O,{propertyIsArray:!i.compactArrays||m.includes("@set")})):(s(O)&&1===O.length&&i.compactArrays&&(O=O[0]),O={[E.compactIri({activeCtx:t,iri:"@graph",relativeTo:{vocab:!0}})]:O},"@id"in e&&(O[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e["@id"]),"@index"in e&&(O[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"]),w(p,n,O,{propertyIsArray:!i.compactArrays||m.includes("@set")}));else if(m.includes("@language")||m.includes("@index")||m.includes("@id")||m.includes("@type")){let r,s;if(p.hasOwnProperty(n)?r=p[n]:p[n]=r={},m.includes("@language"))u(O)&&(O=O["@value"]),s=e["@language"];else if(m.includes("@index")){const i=g(t,n,"@index")||"@index",r=E.compactIri({activeCtx:t,iri:i,relativeTo:{vocab:!0}});if("@index"===i)s=e["@index"],delete O[r];else{let t;if([s,...t]=x(O[i]||[]),a(s))switch(t.length){case 0:delete O[i];break;case 1:O[i]=t[0];break;default:O[i]=t}else s=null}}else if(m.includes("@id")){const e=E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}});s=O[e],delete O[e]}else if(m.includes("@type")){const r=E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}});let o;switch([s,...o]=x(O[r]||[]),o.length){case 0:delete O[r];break;case 1:O[r]=o[0];break;default:O[r]=o}1===Object.keys(O).length&&"@id"in e&&(O=yield E.compact({activeCtx:t,activeProperty:n,element:{"@id":e["@id"]},options:i,compactionMap:f}))}s||(s=E.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}})),w(r,s,O,{propertyIsArray:m.includes("@set")})}else{const t=!i.compactArrays||m.includes("@set")||m.includes("@list")||s(O)&&0===O.length||"@list"===l||"@graph"===l;w(p,n,O,{propertyIsArray:t})}}}else{if((g(t,e,"@container")||[]).includes("@index"))continue;const n=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,p)}else{const n=yield E.compact({activeCtx:t,activeProperty:e,element:p,options:i,compactionMap:f});s(n)&&0===n.length||w(_,l,n)}else{const e=yield E.compact({activeCtx:t,activeProperty:"@reverse",element:p,options:i,compactionMap:f});for(const n in e)if(t.mappings.has(n)&&t.mappings.get(n).reverse){const r=e[n],s=(g(t,n,"@container")||[]).includes("@set")||!i.compactArrays;w(_,n,r,{propertyIsArray:s}),delete e[n]}if(Object.keys(e).length>0){const n=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,e)}}else{let e=x(p).map(t=>E.compactIri({activeCtx:S,iri:t,relativeTo:{vocab:!0}}));1===e.length&&(e=e[0]);const n=E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}}),i=(g(t,n,"@container")||[]).includes("@set")&&y(t,1.1)||s(e)&&0===p.length;w(_,n,e,{propertyIsArray:i})}else{let e=x(p).map(e=>E.compactIri({activeCtx:t,iri:e,relativeTo:{vocab:!1},base:i.base}));1===e.length&&(e=e[0]),_[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e}}return _}return n});return function(e){return t.apply(this,arguments)}}(),E.compactIri=({activeCtx:t,iri:e,value:n=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=null})=>{if(null===e)return e;t.isPropertyTermScoped&&t.previousContext&&(t=t.previousContext);const l=t.getInverse();if(m(e)&&e in l&&"@none"in l[e]&&"@type"in l[e]["@none"]&&"@none"in l[e]["@none"]["@type"])return l[e]["@none"]["@type"]["@none"];if(i.vocab&&e in l){const i=t["@language"]||"@none",r=[];o(n)&&"@index"in n&&!("@graph"in n)&&r.push("@index","@index@set"),o(n)&&"@preserve"in n&&(n=n["@preserve"][0]),h(n)?("@index"in n&&r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&r.push("@graph@id","@graph@id@set"),r.push("@graph","@graph@set","@set"),"@index"in n||r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||r.push("@graph@id","@graph@id@set")):o(n)&&!u(n)&&r.push("@id","@id@set","@type","@set@type");let a="@language",l="@null";if(s)a="@type",l="@reverse",r.push("@set");else if(c(n)){"@index"in n||r.push("@list");const t=n["@list"];if(0===t.length)a="@any",l="@none";else{let e=0===t.length?i:null,n=null;for(let i=0;it.includes("_"));t&&a.push(t.replace(/^[^_]+_/,"_"))}a.push("@none");const l=t.inverse[e];for(const o of i){if(!(o in l))continue;const t=l[o][r];for(const e of a)if(e in t)return t[e]}return null}(t,e,n,r,a,l);if(null!==d)return d}if(i.vocab&&"@vocab"in t){const n=t["@vocab"];if(0===e.indexOf(n)&&e!==n){const i=e.substr(n.length);if(!t.mappings.has(i))return i}}let d=null;const p=[];let f=t.fastCurieMap;const g=e.length-1;for(let r=0;r=0;--r){const i=p[r],s=i.terms;for(const r of s){const s=r+":"+e.substr(i.iri.length);t.mappings.get(r)._prefix&&(!t.mappings.has(s)||null===n&&t.mappings.get(s)["@id"]===e)&&(null===d||S(s,d)<0)&&(d=s)}}if(null!==d)return d;for(const[o,c]of t.mappings)if(c&&c._prefix&&e.startsWith(o+":"))throw new r(`Absolute IRI "${e}" confused with prefix "${o}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:t});return i.vocab?e:"@base"in t?t["@base"]?v(_(a,t["@base"]),e):e:v(a,e)},E.compactValue=({activeCtx:t,activeProperty:e,value:n,options:i})=>{if(u(n)){const i=g(t,e,"@type"),r=g(t,e,"@language"),s=g(t,e,"@direction"),o=g(t,e,"@container")||[],l="@index"in n&&!o.includes("@index");if(!l&&"@none"!==i&&(n["@type"]===i||"@language"in n&&n["@language"]===r&&"@direction"in n&&n["@direction"]===s||"@language"in n&&n["@language"]===r||"@direction"in n&&n["@direction"]===s))return n["@value"];const c=Object.keys(n).length,u=1===c||2===c&&"@index"in n&&!l,h="@language"in t,d=a(n["@value"]),p=t.mappings.has(e)&&null===t.mappings.get(e)["@language"];if(u&&"@none"!==i&&(!h||!d||p))return n["@value"];const f={};return l&&(f[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?f[E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:t,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(f[E.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(f[E.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),f[E.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],f}const r=f(t,e,{vocab:!0},i),s=g(t,e,"@type"),o=E.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:"@vocab"===s},base:i.base});return"@id"===s||"@vocab"===s||"@graph"===r?o:{[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]:o}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(t,e,n){"use strict";const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF: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:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},{}],19:[function(t,e,n){"use strict";const r=t("./util"),s=t("./JsonLdError"),{isArray:o,isObject:a,isString:l,isUndefined:c}=t("./types"),{isAbsolute:u,isRelative:h,prependBase:d}=t("./url"),{asArray:p,compareShortestLeast:f}=t("./util"),g=new Map,m=/^@[a-zA-Z]+$/,b={};function y(t,e,n,i,r,s){if(null===e||!l(e)||b.isKeyword(e))return e;if(e.match(m))return null;if(i&&i.hasOwnProperty(e)&&!0!==r.get(e)&&b.createTermDefinition({activeCtx:t,localCtx:i,term:e,defined:r,options:s}),(n=n||{}).vocab){const n=t.mappings.get(e);if(null===n)return null;if(a(n)&&"@id"in n)return n["@id"]}const o=e.indexOf(":");if(o>0){const n=e.substr(0,o),a=e.substr(o+1);if("_"===n||0===a.indexOf("//"))return e;i&&i.hasOwnProperty(n)&&b.createTermDefinition({activeCtx:t,localCtx:i,term:n,defined:r,options:s});const l=t.mappings.get(n);if(l&&l._prefix)return l["@id"]+a;if(u(e))return e}if(n.vocab&&"@vocab"in t)return t["@vocab"]+e;if(n.base&&"@base"in t){if(t["@base"])return d(d(s.base,t["@base"]),e)}else if(n.base)return d(s.base,e);return e}function v(t,e){if(!t||"object"!=typeof t||!e||"object"!=typeof e)return t===e;const n=Array.isArray(t);if(n!==Array.isArray(e))return!1;if(n){if(t.length!==e.length)return!1;for(let n=0;n{if(i.has(n)){if(i.get(n))return;throw new s("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:e,term:n})}let h;if(i.set(n,!1),e.hasOwnProperty(n)&&(h=e[n]),"@type"===n&&a(h)&&"@set"===(h["@container"]||"@set")&&b.processingMode(t,1.1)){const t=["@container","@id","@protected"],i=Object.keys(h);if(0===i.length||i.some(e=>!t.includes(e)))throw new s("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n})}else{if(b.isKeyword(n))throw new s("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n});if(n.match(m))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new s("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:e})}const d=t.mappings.get(n);t.mappings.has(n)&&t.mappings.delete(n);let p=!1;if((l(h)||null===h)&&(p=!0,h={"@id":h}),!a(h))throw new s("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:e});const f={};t.mappings.set(n,f),f.reverse=!1;const g=["@container","@id","@language","@reverse","@type"];b.processingMode(t,1.1)&&g.push("@context","@direction","@index","@nest","@prefix","@protected");for(const o in h)if(!g.includes(o))throw new s("Invalid JSON-LD syntax; a term definition must not contain "+o,"jsonld.SyntaxError",{code:"invalid term definition",context:e});const _=n.indexOf(":");if(f._termHasColon=_>0,"@reverse"in h){if("@id"in h)throw new s("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});if("@nest"in h)throw new s("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});const o=h["@reverse"];if(!l(o))throw new s("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(!b.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:o}),void(d?t.mappings.set(n,d):t.mappings.delete(n));const a=y(t,o,{vocab:!0,base:!1},e,i,r);if(!u(a))throw new s("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:e});f["@id"]=a,f.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!l(o))throw new s("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(null===o)f["@id"]=null;else{if(!b.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:o}),void(d?t.mappings.set(n,d):t.mappings.delete(n));if(o!==n){if(o=y(t,o,{vocab:!0,base:!1},e,i,r),!u(o)&&!b.isKeyword(o))throw new s("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:e});if(n.match(/(?::[^:])|\//)&&y(t,n,{vocab:!0,base:!1},e,new Map(i).set(n,!0),r)!==o)throw new s("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});f["@id"]=o,f._prefix=p&&!f._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in f))if(f._termHasColon){const s=n.substr(0,_);if(e.hasOwnProperty(s)&&b.createTermDefinition({activeCtx:t,localCtx:e,term:s,defined:i,options:r}),t.mappings.has(s)){const e=n.substr(_+1);f["@id"]=t.mappings.get(s)["@id"]+e}else f["@id"]=n}else if("@type"===n)f["@id"]=n;else{if(!("@vocab"in t))throw new s("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e,term:n});f["@id"]=t["@vocab"]+n}if((!0===h["@protected"]||!0===i.get("@protected")&&!1!==h["@protected"])&&(t.protected[n]=!0,f.protected=!0),i.set(n,!0),"@type"in h){let n=h["@type"];if(!l(n))throw new s("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if("@json"===n||"@none"===n){if(b.processingMode(t,1))throw new s(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else if("@id"!==n&&"@vocab"!==n){if(n=y(t,n,{vocab:!0,base:!1},e,i,r),!u(n))throw new s("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if(0===n.indexOf("_:"))throw new s("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}f["@type"]=n}if("@container"in h){const n=l(h["@container"])?[h["@container"]]:h["@container"]||[],i=["@list","@set","@index","@language"];let r=!0;const a=n.includes("@set");if(b.processingMode(t,1.1)){if(i.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new s("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:e})}else if(n.includes("@graph")){if(n.some(t=>"@graph"!==t&&"@id"!==t&&"@index"!==t&&"@set"!==t))throw new s("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:e})}else r&=n.length<=(a?2:1);if(n.includes("@type")&&(f["@type"]=f["@type"]||"@id",!["@id","@vocab"].includes(f["@type"])))throw new s("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else r&=!o(h["@container"]),r&=n.length<=1;if(r&=n.every(t=>i.includes(t)),r&=!(a&&n.includes("@list")),!r)throw new s("Invalid JSON-LD syntax; @context @container value must be one of the following: "+i.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:e});if(f.reverse&&!n.every(t=>["@index","@set"].includes(t)))throw new s("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});f["@container"]=n}if("@index"in h){if(!("@container"in h)||!f["@container"].includes("@index"))throw new s(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});if(!l(h["@index"])||0===h["@index"].indexOf("@"))throw new s(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});f["@index"]=h["@index"]}if("@context"in h&&(f["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let t=h["@language"];if(null!==t&&!l(t))throw new s("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:e});null!==t&&(t=t.toLowerCase()),f["@language"]=t}if("@prefix"in h){if(n.match(/:|\//))throw new s("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:e});if(b.isKeyword(f["@id"]))throw new s("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:e});if("boolean"!=typeof h["@prefix"])throw new s("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:e});f._prefix=!0===h["@prefix"]}if("@direction"in h){const t=h["@direction"];if(null!==t&&"ltr"!==t&&"rtl"!==t)throw new s('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:e});f["@direction"]=t}if("@nest"in h){const t=h["@nest"];if(!l(t)||"@nest"!==t&&0===t.indexOf("@"))throw new s("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:e});f["@nest"]=t}const w=f["@id"];if("@context"===w||"@preserve"===w)throw new s("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:e});if(d&&d.protected&&!c&&(t.protected[n]=!0,f.protected=!0,!v(d,f))){const t=r&&r.protectedMode||"error";if("error"===t)throw new s(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:e,term:n});if("warn"===t)return void console.warn("WARNING: protected term redefinition",{term:n});throw new s("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:e,term:n,protectedMode:t})}},b.expandIri=(t,e,n,i)=>y(t,e,n,void 0,void 0,i),b.getInitialContext=t=>{const e=JSON.stringify({processingMode:t.processingMode}),n=g.get(e);if(n)return n;const i={processingMode:t.processingMode,mappings:new Map,inverse:null,getInverse:function(){const t=this;if(t.inverse)return t.inverse;const e=t.inverse={},n=t.fastCurieMap={},i={},r=(t["@language"]||"@none").toLowerCase(),a=t["@direction"],l=t.mappings,c=[...l.keys()].sort(f);for(const s of c){const t=l.get(s);if(null===t)continue;let c=t["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===t["@id"])continue;const u=p(t["@id"]);for(const l of u){let u=e[l];const h=b.isKeyword(l);if(u)!h&&!t._termHasColon&&i[l].push(s);else if(e[l]=u={},!h&&!t._termHasColon){i[l]=[s];const t={iri:l,terms:i[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],o(s,u["@any"],"@none"),t.reverse)o(s,u["@type"],"@reverse");else if("@none"===t["@type"])o(s,u["@any"],"@none"),o(s,u["@language"],"@none"),o(s,u["@type"],"@none");else if("@type"in t)o(s,u["@type"],t["@type"]);else if("@language"in t&&"@direction"in t){const e=t["@language"],n=t["@direction"];o(s,u["@language"],e&&n?`${e}_${n}`.toLowerCase():e?e.toLowerCase():n?`_${n}`:"@null")}else"@language"in t?o(s,u["@language"],(t["@language"]||"@null").toLowerCase()):"@direction"in t?o(s,u["@language"],t["@direction"]?`_${t["@direction"]}`:"@none"):a?(o(s,u["@language"],`_${a}`),o(s,u["@language"],"@none"),o(s,u["@type"],"@none")):(o(s,u["@language"],r),o(s,u["@language"],"@none"),o(s,u["@type"],"@none"))}}for(const o in n)s(n,o,1);return e},clone:function(){const t={};return t.mappings=r.clone(this.mappings),t.clone=this.clone,t.inverse=null,t.getInverse=this.getInverse,t.protected=r.clone(this.protected),this.previousContext&&(t.previousContext=this.previousContext.clone()),t.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(t["@base"]=this["@base"]),"@language"in this&&(t["@language"]=this["@language"]),"@vocab"in this&&(t["@vocab"]=this["@vocab"]),t},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===g.size&&g.clear(),g.set(e,i),i;function s(t,e,n){const i=t[e],r=t[e]={};let o,a;for(const s of i)o=s.iri,a=n>=o.length?"":o[n],a in r?r[a].push(s):r[a]=[s];for(const l in r)""!==l&&s(r,l,n+1)}function o(t,e,n){e.hasOwnProperty(n)||(e[n]=t)}},b.getContextValue=(t,e,n)=>{if(null===e)return"@context"===n?void 0:null;if(t.mappings.has(e)){const i=t.mappings.get(e);if(c(n))return i;if(i.hasOwnProperty(n))return i[n]}return"@language"===n&&n in t||"@direction"===n&&n in t?t[n]:"@context"!==n?null:void 0},b.processingMode=(t,e)=>e.toString()>="1.1"?!t.processingMode||t.processingMode>="json-ld-"+e.toString():"json-ld-1.0"===t.processingMode,b.isKeyword=t=>{if(!l(t)||"@"!==t[0])return!1;switch(t){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(t,e,n){"use strict";const{parseLinkHeader:r,buildHeaders:s}=t("../util"),{LINK_HEADER_CONTEXT:o}=t("../constants"),a=t("../JsonLdError"),l=t("../RequestQueue"),{prependBase:c}=t("../url"),u=/(^|(\r\n))link:/i;function h(t,e,n){const i=new(t=t||XMLHttpRequest);return new Promise((t,r)=>{i.onload=()=>t(i),i.onerror=t=>r(t),i.open("GET",e,!0);for(const e in n)i.setRequestHeader(e,n[e]);i.send()})}e.exports=({secure:t,headers:e={},xhr:n}={headers:{}})=>{return e=s(e),(new l).wrapLoader(d);function d(t){return p.apply(this,arguments)}function p(){return(p=i(function*(i){if(0!==i.indexOf("http:")&&0!==i.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:i});if(t&&0!==i.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:i});let s;try{s=yield h(n,i,e)}catch(m){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:i,cause:m})}if(s.status>=400)throw new a("URL could not be dereferenced: "+s.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:i,httpStatusCode:s.status});let l={contextUrl:null,documentUrl:i,document:s.response},p=null;const f=s.getResponseHeader("Content-Type");let g;if(u.test(s.getAllResponseHeaders())&&(g=s.getResponseHeader("Link")),g&&"application/ld+json"!==f){const t=r(g),e=t[o];if(Array.isArray(e))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:i});e&&(l.contextUrl=e.target),p=t.alternate,p&&"application/ld+json"==p.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(l=yield d(c(i,p.target)))}return l})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(t,e,n){"use strict";const r=t("./JsonLdError"),{isArray:s,isObject:o,isEmptyObject:a,isString:l,isUndefined:c}=t("./types"),{isList:u,isValue:h,isGraph:d,isSubject:p}=t("./graphTypes"),{expandIri:f,getContextValue:g,isKeyword:m,process:b,processingMode:y}=t("./context"),{isAbsolute:v}=t("./url"),{addValue:_,asArray:w,getValues:x,validateTypeValue:S}=t("./util"),E={};e.exports=E;const C=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function O(t){return T.apply(this,arguments)}function T(){return(T=i(function*({activeCtx:t,activeProperty:e,expandedActiveProperty:n,element:i,expandedParent:d,options:x={},insideList:T,typeKey:k,typeScopedContext:I,expansionMap:M}){const D=Object.keys(i).sort(),R=[];let N;const L=i[k]&&"@json"===f(t,s(i[k])?i[k][0]:i[k],{vocab:!0},x);for(const O of D){let k,D=i[O];if("@context"===O)continue;let j=f(t,O,{vocab:!0},x);if((null===j||!v(j)&&!m(j))&&(j=M({unmappedProperty:O,activeCtx:t,activeProperty:e,parent:i,options:x,insideList:T,value:D,expandedParent:d}),void 0===j))continue;if(m(j)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:D});if(j in d&&"@included"!==j&&"@type"!==j)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:j})}if("@id"===j){if(!l(D)){if(!x.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(o(D)){if(!a(D))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}else{if(!s(D))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(!D.every(t=>l(t)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}}_(d,"@id",w(D).map(e=>l(e)?f(t,e,{base:!0},x):e),{propertyIsArray:x.isFrame});continue}if("@type"===j){o(D)&&(D=Object.fromEntries(Object.entries(D).map(([t,e])=>[f(I,t,{vocab:!0}),w(e).map(t=>f(I,t,{base:!0,vocab:!0}))]))),S(D,x.isFrame),_(d,"@type",w(D).map(t=>l(t)?f(I,t,{base:!0,vocab:!0},x):t),{propertyIsArray:x.isFrame});continue}if("@included"===j&&y(t,1.1)){const n=w(yield E.expand({activeCtx:t,activeProperty:e,element:D,options:x,expansionMap:M}));if(!n.every(t=>p(t)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:D});_(d,"@included",n,{propertyIsArray:!0});continue}if("@graph"===j&&!o(D)&&!s(D))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:D});if("@value"===j){N=D,L&&y(t,1.1)?d["@value"]=D:_(d,"@value",D,{propertyIsArray:x.isFrame});continue}if("@language"===j){if(null===D)continue;if(!l(D)&&!x.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:D});D=w(D).map(t=>l(t)?t.toLowerCase():t);for(const t of D)l(t)&&!t.match(C)&&console.warn(`@language must be valid BCP47: ${t}`);_(d,"@language",D,{propertyIsArray:x.isFrame});continue}if("@direction"===j){if(!l(D)&&!x.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:D});D=w(D);for(const t of D)if(l(t)&&"ltr"!==t&&"rtl"!==t)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:D});_(d,"@direction",D,{propertyIsArray:x.isFrame});continue}if("@index"===j){if(!l(D))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:D});_(d,"@index",D);continue}if("@reverse"===j){if(!o(D))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:D});if(k=yield E.expand({activeCtx:t,activeProperty:"@reverse",element:D,options:x,expansionMap:M}),"@reverse"in k)for(const t in k["@reverse"])_(d,t,k["@reverse"][t],{propertyIsArray:!0});let e=d["@reverse"]||null;for(const t in k){if("@reverse"===t)continue;null===e&&(e=d["@reverse"]={}),_(e,t,[],{propertyIsArray:!0});const n=k[t];for(let i=0;i"@id"===t||"@index"===t)&&(k=w(k).map(t=>({"@graph":w(t)}))),F.mappings.has(O)&&F.mappings.get(O).reverse){const t=d["@reverse"]=d["@reverse"]||{};k=w(k);for(let e=0;e"@value"===f(t,e,{vocab:!0},x)))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:n,element:i,expandedParent:d,options:x,insideList:T,typeScopedContext:I,typeKey:k,expansionMap:M})}}})).apply(this,arguments)}function k({activeCtx:t,activeProperty:e,value:n,options:i}){if(null==n)return null;const r=f(t,e,{vocab:!0},i);if("@id"===r)return f(t,n,{base:!0},i);if("@type"===r)return f(t,n,{vocab:!0,base:!0},i);const s=g(t,e,"@type");if(("@id"===s||"@graph"===r)&&l(n))return{"@id":f(t,n,{base:!0},i)};if("@vocab"===s&&l(n))return{"@id":f(t,n,{vocab:!0,base:!0},i)};if(m(r))return n;const o={};if(s&&!["@id","@vocab","@none"].includes(s))o["@type"]=s;else if(l(n)){const n=g(t,e,"@language");null!==n&&(o["@language"]=n);const i=g(t,e,"@direction");null!==i&&(o["@direction"]=i)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),o["@value"]=n,o}function A(t,e,n,i){const o=[],a=Object.keys(e).sort();for(const c of a){const a=f(t,c,{vocab:!0},i);let u=e[c];s(u)||(u=[u]);for(const t of u){if(null===t)continue;if(!l(t))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:e});const i={"@value":t};"@none"!==a&&(i["@language"]=c.toLowerCase()),n&&(i["@direction"]=n),o.push(i)}}return o}function P(t){return I.apply(this,arguments)}function I(){return(I=i(function*({activeCtx:t,options:e,activeProperty:n,value:i,expansionMap:o,asGraph:a,indexKey:l,propertyIndex:u}){const p=[],m=Object.keys(i).sort(),y="@type"===l;for(let v of m){if(y){const n=g(t,v,"@context");c(n)||(t=yield b({activeCtx:t,localCtx:n,propagate:!1,options:e}))}let m,w=i[v];s(w)||(w=[w]),w=yield E.expand({activeCtx:t,activeProperty:n,element:w,options:e,insideList:!1,insideIndex:!0,expansionMap:o}),m=u?"@none"===v?"@none":k({activeCtx:t,activeProperty:l,value:v,options:e}):f(t,v,{vocab:!0},e),"@id"===l?v=f(t,v,{base:!0},e):y&&(v=m);for(let t of w){if(a&&!d(t)&&(t={"@graph":[t]}),"@type"===l)"@none"===m||(t["@type"]=t["@type"]?[v].concat(t["@type"]):[v]);else{if(h(t)&&!["@language","@type","@index"].includes(l))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${l}".`,"jsonld.SyntaxError",{code:"invalid value object",value:t});u?"@none"!==m&&_(t,u,m,{propertyIsArray:!0,prependValue:!0}):"@none"!==m&&!(l in t)&&(t[l]=v)}p.push(t)}}return p})).apply(this,arguments)}E.expand=function(){var t=i(function*({activeCtx:t,activeProperty:e=null,element:n,options:i={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:d=null,expansionMap:p=(()=>{})}){if(null==n)return null;if("@default"===e&&(i=Object.assign({},i,{isFrame:!1})),!s(n)&&!o(n)){if(!u&&(null===e||"@graph"===f(t,e,{vocab:!0},i))){const r=yield p({unmappedValue:n,activeCtx:t,activeProperty:e,options:i,insideList:u});return void 0===r?null:r}return k({activeCtx:t,activeProperty:e,value:n,options:i})}if(s(n)){let r=[];const o=g(t,e,"@container")||[];u=u||o.includes("@list");for(let a=0;a1?e.slice().sort():e:[e];for(const n of s){const e=g(d,n,"@context");c(e)||(t=yield b({activeCtx:t,localCtx:e,options:i,propagate:!1}))}}let A={};yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:m,element:n,expandedParent:A,options:i,insideList:u,typeKey:T,typeScopedContext:d,expansionMap:p}),S=Object.keys(A);let P=S.length;if("@value"in A){if("@type"in A&&("@language"in A||"@direction"in A))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});let s=P-1;if("@type"in A&&(s-=1),"@index"in A&&(s-=1),"@language"in A&&(s-=1),"@direction"in A&&(s-=1),0!==s)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});const o=null===A["@value"]?[]:w(A["@value"]),c=x(A,"@type");if(!y(t,1.1)||!c.includes("@json")||1!==c.length)if(0===o.length){const r=yield p({unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}else{if(!o.every(t=>l(t)||a(t))&&"@language"in A)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:A});if(!c.every(t=>v(t)&&!(l(t)&&0===t.indexOf("_:"))||a(t)))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:A})}}else if("@type"in A&&!s(A["@type"]))A["@type"]=[A["@type"]];else if("@set"in A||"@list"in A){if(P>1&&(2!==P||!("@index"in A)))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:A});"@set"in A&&(A=A["@set"],S=Object.keys(A),P=S.length)}else if(1===P&&"@language"in A){const r=yield p(A,{unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}if(o(A)&&!i.keepFreeFloatingNodes&&!u&&(null===e||"@graph"===m)&&(0===P||"@value"in A||"@list"in A||1===P&&"@id"in A)){const r=yield p({unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}return A});return function(e){return t.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(t,e,n){"use strict";const{isSubjectReference:i}=t("./graphTypes"),{createMergedNodeMap:r}=t("./nodeMap"),s={};e.exports=s,s.flatten=t=>{const e=r(t),n=[],s=Object.keys(e).sort();for(let r=0;r=0;--i){const r=n[i];if(r.graph===e&&r.subject["@id"]===t["@id"])return!0}return!1}function f(t,e,n){const i="@"+n;let r=i in t?t[i][0]:e[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:t});return r}function g(t){if(!s.isArray(t)||1!==t.length||!s.isObject(t[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:t});if("@id"in t[0])for(const e of o.asArray(t[0]["@id"]))if(!s.isObject(e)&&!a.isAbsolute(e)||s.isString(e)&&0===e.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t});if("@type"in t[0])for(const e of o.asArray(t[0]["@type"]))if(!s.isObject(e)&&!a.isAbsolute(e)||s.isString(e)&&0===e.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t})}function m(t,e,n,a){let l=!0,c=!1;for(const u in n){let h=!1;const d=o.getValues(e,u),p=0===o.getValues(n,u).length;if("@id"===u){if(s.isEmptyObject(n["@id"][0]||{})?h=!0:n["@id"].length>=0&&(h=n["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(l=!1,p){if(d.length>0)return!1;h=!0}else if(1===n["@type"].length&&s.isEmptyObject(n["@type"][0]))h=d.length>0;else for(const t of n["@type"])h=!(!s.isObject(t)||!("@default"in t))||h||d.some(e=>e===t);if(!a.requireAll)return h}else{if(i(u))continue;{const e=o.getValues(n,u)[0];let i=!1;if(e&&(g([e]),i="@default"in e),l=!1,0===d.length&&i)continue;if(d.length>0&&p)return!1;if(void 0===e){if(d.length>0)return!1;h=!0}else if(r.isList(e)){const n=e["@list"][0];if(r.isList(d[0])){const e=d[0]["@list"];r.isValue(n)?h=e.some(t=>w(n,t)):(r.isSubject(n)||r.isSubjectReference(n))&&(h=e.some(e=>_(t,n,e,a)))}}else h=r.isValue(e)?d.some(t=>w(e,t)):r.isSubjectReference(e)?d.some(n=>_(t,e,n,a)):!!s.isObject(e)&&d.length>0}}if(!h&&a.requireAll)return!1;c=c||h}return l||c}function b(t,e){const n=t.uniqueEmbeds[t.graph],i=n[e],r=i.parent,a=i.property,l={"@id":e};if(s.isArray(r)){for(let t=0;t{const e=Object.keys(n);for(const i of e)i in n&&s.isObject(n[i].parent)&&n[i].parent["@id"]===t&&(delete n[i],c(i))};c(e)}function y(t,e){if(s.isArray(t))return t.map(t=>y(t,e));if(s.isObject(t)){if("@preserve"in t)return t["@preserve"][0];if(r.isValue(t))return t;if(r.isList(t))return t["@list"]=y(t["@list"],e),t;if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)"@id"===n&&e.bnodesToClear.includes(t[n])?delete t["@id"]:t[n]=y(t[n],e)}return t}function v(t,e,n){s.isObject(t)?o.addValue(t,e,n,{propertyIsArray:!0}):t.push(n)}function _(t,e,n,i){if(!("@id"in n))return!1;const r=t.subjects[n["@id"]];return r&&m(t,r,e,i)}function w(t,e){const n=e["@value"],i=e["@type"],r=e["@language"],o=t["@value"]?s.isArray(t["@value"])?t["@value"]:[t["@value"]]:[],a=t["@type"]?s.isArray(t["@type"])?t["@type"]:[t["@type"]]:[],l=t["@language"]?s.isArray(t["@language"])?t["@language"]:[t["@language"]]:[];return 0===o.length&&0===a.length&&0===l.length||!(!o.includes(n)&&!s.isEmptyObject(o[0])||!(!i&&0===a.length||a.includes(i)||i&&s.isEmptyObject(a[0]))||!(!r&&0===l.length||l.includes(r)||r&&s.isEmptyObject(l[0])))}e.exports=h,h.frameMergedOrDefault=(t,e,n)=>{const i={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},r=new o.IdentifierIssuer("_:b");c(t,i.graphMap,"@default",r),n.merged&&(i.graphMap["@merged"]=u(i.graphMap),i.graph="@merged"),i.subjects=i.graphMap[i.graph];const s=[];return h.frame(i,Object.keys(i.subjects).sort(),e,s),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(i.bnodeMap).filter(t=>1===i.bnodeMap[t].length)),n.link={},y(s,n)},h.frame=(t,e,n,a,c=null)=>{g(n);const u=t.options,y={embed:f(n=n[0],u,"embed"),explicit:f(n,u,"explicit"),requireAll:f(n,u,"requireAll")};t.link.hasOwnProperty(t.graph)||(t.link[t.graph]={});const _=t.link[t.graph],x=function(t,e,n,i){const r={};for(const s of e){const e=t.graphMap[t.graph][s];m(t,e,n,i)&&(r[s]=e)}return r}(t,e,n,y),S=Object.keys(x).sort();for(const g of S){const m=x[g];if(null===c?t.uniqueEmbeds={[t.graph]:{}}:t.uniqueEmbeds[t.graph]=t.uniqueEmbeds[t.graph]||{},"@link"===y.embed&&g in _){v(a,c,_[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&o.addValue(t.bnodeMap,g,S,{propertyIsArray:!0}),_[g]=S,("@first"===y.embed||"@last"===y.embed)&&t.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(t.embedded||!t.uniqueEmbeds[t.graph].hasOwnProperty(g)){if(t.embedded&&("@never"===y.embed||p(m,t.graph,t.subjectStack))){v(a,c,S);continue}if(t.embedded&&("@first"==y.embed||"@once"==y.embed)&&t.uniqueEmbeds[t.graph].hasOwnProperty(g)){v(a,c,S);continue}if("@last"===y.embed&&g in t.uniqueEmbeds[t.graph]&&b(t,g),t.uniqueEmbeds[t.graph][g]={parent:a,property:c},t.subjectStack.push({subject:m,graph:t.graph}),g in t.graphMap){let e=!1,i=null;"@graph"in n?(i=n["@graph"][0],e=!("@merged"===g||"@default"===g),s.isObject(i)||(i={})):(e="@merged"!==t.graph,i={}),e&&h.frame(ti(bt({},t),{graph:g,embedded:!1}),Object.keys(t.graphMap[g]).sort(),[i],S,"@graph")}"@included"in n&&h.frame(ti(bt({},t),{embedded:!1}),e,n["@included"],S,"@included");for(const e of Object.keys(m).sort())if(i(e)){if(S[e]=o.clone(m[e]),"@type"===e)for(const e of m["@type"])0===e.indexOf("_:")&&o.addValue(t.bnodeMap,e,S,{propertyIsArray:!0})}else if(!y.explicit||e in n)for(const i of m[e]){const s=e in n?n[e]:d(y);if(r.isList(i)){const s=n[e]&&n[e][0]&&n[e][0]["@list"]?n[e][0]["@list"]:d(y),a={"@list":[]};v(S,e,a);const l=i["@list"];for(const e of l)r.isSubjectReference(e)?h.frame(ti(bt({},t),{embedded:!0}),[e["@id"]],s,a,"@list"):v(a,"@list",o.clone(e))}else r.isSubjectReference(i)?h.frame(ti(bt({},t),{embedded:!0}),[i["@id"]],s,S,e):w(s[0],i)&&v(S,e,o.clone(i))}for(const t of Object.keys(n).sort()){if("@type"===t){if(!s.isObject(n[t][0])||!("@default"in n[t][0]))continue}else if(i(t))continue;const e=n[t][0]||{};if(!f(e,u,"omitDefault")&&!(t in S)){let n="@null";"@default"in e&&(n=o.clone(e["@default"])),s.isArray(n)||(n=[n]),S[t]=[{"@preserve":n}]}}for(const e of Object.keys(n["@reverse"]||{}).sort()){const i=n["@reverse"][e];for(const n of Object.keys(t.subjects))o.getValues(t.subjects[n],e).some(t=>t["@id"]===g)&&(S["@reverse"]=S["@reverse"]||{},o.addValue(S["@reverse"],e,[],{propertyIsArray:!0}),h.frame(ti(bt({},t),{embedded:!0}),[n],i,S["@reverse"][e],c))}v(a,c,S),t.subjectStack.pop()}}},h.cleanupNull=(t,e)=>{if(s.isArray(t))return t.map(t=>h.cleanupNull(t,e)).filter(t=>t);if("@null"===t)return null;if(s.isObject(t)){if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)t[n]=h.cleanupNull(t[n],e)}return t}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(t,e,n){"use strict";const r=t("./JsonLdError"),s=t("./graphTypes"),o=t("./types"),a=t("./util"),{RDF_LIST:l,RDF_FIRST:c,RDF_REST:u,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:p,XSD_BOOLEAN:f,XSD_DOUBLE:g,XSD_INTEGER:m,XSD_STRING:b}=t("./constants"),y=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,v={};function _(t,e,n){if(t.termType.endsWith("Node"))return{"@id":t.value};const i={"@value":t.value};if(t.language)i["@language"]=t.language;else{let a=t.datatype.value;if(a||(a=b),a===p){a="@json";try{i["@value"]=JSON.parse(i["@value"])}catch(s){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:i["@value"],cause:s})}}if(e){if(a===f)"true"===i["@value"]?i["@value"]=!0:"false"===i["@value"]&&(i["@value"]=!1);else if(o.isNumeric(i["@value"]))if(a===m){const t=parseInt(i["@value"],10);t.toFixed(0)===i["@value"]&&(i["@value"]=t)}else a===g&&(i["@value"]=parseFloat(i["@value"]));[f,m,g,b].includes(a)||(i["@type"]=a)}else if("i18n-datatype"===n&&a.startsWith("https://www.w3.org/ns/i18n#")){const[,t,e]=a.split(/[#_]/);t.length>0&&(i["@language"]=t,t.match(y)||console.warn(`@language must be valid BCP47: ${t}`)),i["@direction"]=e}else a!==b&&(i["@type"]=a)}return i}e.exports=v,v.fromRDF=function(){var t=i(function*(t,{useRdfType:e=!1,useNativeTypes:n=!1,rdfDirection:i=null}){const r={},p={"@default":r},f={};for(const s of t){const t="DefaultGraph"===s.graph.termType?"@default":s.graph.value;t in p||(p[t]={}),"@default"!==t&&!(t in r)&&(r[t]={"@id":t});const o=p[t],l=s.subject.value,c=s.predicate.value,u=s.object;l in o||(o[l]={"@id":l});const g=o[l],m=u.termType.endsWith("Node");if(m&&!(u.value in o)&&(o[u.value]={"@id":u.value}),c===d&&!e&&m){a.addValue(g,"@type",u.value,{propertyIsArray:!0});continue}const b=_(u,n,i);if(a.addValue(g,c,b,{propertyIsArray:!0}),m)if(u.value===h){const t=o[u.value];"usages"in t||(t.usages=[]),t.usages.push({node:g,property:c,value:b})}else f[u.value]=!(u.value in f)&&{node:g,property:c,value:b}}for(const a in p){const t=p[a];if(!(h in t))continue;const e=t[h];if(e.usages){for(let n of e.usages){let e=n.node,i=n.property,r=n.value;const a=[],h=[];let d=Object.keys(e).length;for(;i===u&&o.isObject(f[e["@id"]])&&o.isArray(e[c])&&1===e[c].length&&o.isArray(e[u])&&1===e[u].length&&(3===d||4===d&&o.isArray(e["@type"])&&1===e["@type"].length&&e["@type"][0]===l)&&(a.push(e[c][0]),h.push(e["@id"]),n=f[e["@id"]],e=n.node,i=n.property,r=n.value,d=Object.keys(e).length,s.isBlankNode(e)););delete r["@id"],r["@list"]=a.reverse();for(const n of h)delete t[n]}delete e.usages}}const g=[],m=Object.keys(r).sort();for(const o of m){const t=r[o];if(o in p){const e=t["@graph"]=[],n=p[o],i=Object.keys(n).sort();for(const t of i){const i=n[t];s.isSubjectReference(i)||e.push(i)}}s.isSubjectReference(t)||g.push(t)}return g});return function(e,n){return t.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(t,e,n){"use strict";const i=t("./types"),r={};e.exports=r,r.isSubject=t=>!(!i.isObject(t)||"@value"in t||"@set"in t||"@list"in t)&&(Object.keys(t).length>1||!("@id"in t)),r.isSubjectReference=t=>i.isObject(t)&&1===Object.keys(t).length&&"@id"in t,r.isValue=t=>i.isObject(t)&&"@value"in t,r.isList=t=>i.isObject(t)&&"@list"in t,r.isGraph=t=>i.isObject(t)&&"@graph"in t&&1===Object.keys(t).filter(t=>"@id"!==t&&"@index"!==t).length,r.isSimpleGraph=t=>r.isGraph(t)&&!("@id"in t),r.isBlankNode=t=>!!i.isObject(t)&&("@id"in t?0===t["@id"].indexOf("_:"):0===Object.keys(t).length||!("@value"in t||"@set"in t||"@list"in t))},{"./types":30}],26:[function(t,e,n){const r=t("rdf-canonize"),s=t("./platform"),o=t("./util"),a=t("./ContextResolver"),l=o.IdentifierIssuer,c=t("./JsonLdError"),u=t("lru-cache"),h=t("./NQuads"),{expand:d}=t("./expand"),{flatten:p}=t("./flatten"),{fromRDF:f}=t("./fromRdf"),{toRDF:g}=t("./toRdf"),{frameMergedOrDefault:m,cleanupNull:b}=t("./frame"),{isArray:y,isObject:v,isString:_}=t("./types"),{isSubjectReference:w}=t("./graphTypes"),{expandIri:x,getInitialContext:S,process:E,processingMode:C}=t("./context"),{compact:O,compactIri:T}=t("./compact"),{createNodeMap:k,createMergedNodeMap:A,mergeNodeMaps:P}=t("./nodeMap"),I=function(e){const n={},I=new u({max:100});function M(t,n){var i=n,{documentLoader:r=e.documentLoader}=i,s=iX(i,["documentLoader"]);return Object.assign({},{documentLoader:r},s,t)}return e.compact=function(){var t=i(function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let r;(i=M(i,{base:_(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new l("_:b"),contextResolver:new a({sharedCache:I})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,r=i.skipExpansion?t:yield e.expand(t,i);const s=yield e.processContext(S(i),n,i);let u=yield O({activeCtx:s,element:r,options:i,compactionMap:i.compactionMap});i.compactArrays&&!i.graph&&y(u)?1===u.length?u=u[0]:0===u.length&&(u={}):i.graph&&v(u)&&(u=[u]),v(n)&&"@context"in n&&(n=n["@context"]),n=o.clone(n),y(n)||(n=[n]);const h=n;n=[];for(let e=0;e0)&&n.push(h[e]);const d=n.length>0;if(1===n.length&&(n=n[0]),y(u)){const t=T({activeCtx:s,iri:"@graph",relativeTo:{vocab:!0}}),e=u;u={},d&&(u["@context"]=n),u[t]=e}else if(v(u)&&d){const t=u;u={"@context":n};for(const e in t)u[e]=t[e]}return u});return function(e,n,i){return t.apply(this,arguments)}}(),e.expand=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=M(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:I})})).expansionMap&&(n.expansionMap=void 0);const i={},r=[];if("expandContext"in n){const t=o.clone(n.expandContext);i.expandContext=v(t)&&"@context"in t?t:{"@context":t},r.push(i.expandContext)}let s;if(_(t)){const o=yield e.get(t,n);s=o.documentUrl,i.input=o.document,o.contextUrl&&(i.remoteContext={"@context":o.contextUrl},r.push(i.remoteContext))}else i.input=o.clone(t);"base"in n||(n.base=s||"");let l=S(n);for(const e of r)l=yield E({activeCtx:l,localCtx:e,options:n});let c=yield d({activeCtx:l,element:i.input,options:n,expansionMap:n.expansionMap});return v(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),y(c)||(c=[c]),c});return function(e,n){return t.apply(this,arguments)}}(),e.flatten=function(){var t=i(function*(t,n,i){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,i=M(i,{base:_(t)?t:"",contextResolver:new a({sharedCache:I})});const r=yield e.expand(t,i),s=p(r);return null===n?s:(i.graph=!0,i.skipExpansion=!0,yield e.compact(s,n,i))});return function(e,n,i){return t.apply(this,arguments)}}(),e.frame=function(){var t=i(function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(i=M(i,{base:_(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:I})}),_(n)){const t=yield e.get(n,i);if(n=t.document,t.contextUrl){let e=n["@context"];e?y(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const r=n&&n["@context"]||{},s=yield e.processContext(S(i),r,i);i.hasOwnProperty("omitGraph")||(i.omitGraph=C(s,1.1)),i.hasOwnProperty("pruneBlankNodeIdentifiers")||(i.pruneBlankNodeIdentifiers=C(s,1.1));const o=yield e.expand(t,i),l=bt({},i);l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=yield e.expand(n,l),u=Object.keys(n).map(t=>x(s,t,{vocab:!0}));l.merged=!u.includes("@graph"),l.is11=C(s,1.1);const h=m(o,c,l);l.graph=!i.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let d=yield e.compact(h,r,l);return l.link={},d=b(d,l),d});return function(e,n,i){return t.apply(this,arguments)}}(),e.link=function(){var t=i(function*(t,n,i){const r={};return n&&(r["@context"]=n),r["@embed"]="@link",e.frame(t,r,i)});return function(e,n,i){return t.apply(this,arguments)}}(),e.normalize=e.canonize=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=M(n,{base:_(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:I})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const e=h.parse(t);return r.canonize(e,n)}const i=bt({},n);delete i.format,i.produceGeneralizedRdf=!1;const s=yield e.toRDF(t,i);return r.canonize(s,n)});return function(e,n){return t.apply(this,arguments)}}(),e.fromRDF=function(){var t=i(function*(t,e){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");e=M(e,{format:_(t)?"application/n-quads":void 0});const{format:i}=e;let{rdfParser:r}=e;if(i){if(r=r||n[i],!r)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:i})}else r=()=>t;const s=yield r(t);return f(s,e)});return function(e,n){return t.apply(this,arguments)}}(),e.toRDF=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let i;i=(n=M(n,{base:_(t)?t:"",skipExpansion:!1,contextResolver:new a({sharedCache:I})})).skipExpansion?t:yield e.expand(t,n);const r=g(i,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return h.serialize(r);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return r});return function(e,n){return t.apply(this,arguments)}}(),e.createNodeMap=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=M(n,{base:_(t)?t:"",contextResolver:new a({sharedCache:I})});const i=yield e.expand(t,n);return A(i,n)});return function(e,n){return t.apply(this,arguments)}}(),e.merge=function(){var t=i(function*(t,n,i){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,i=M(i,{contextResolver:new a({sharedCache:I})});const r=yield Promise.all(t.map(t=>{const n=bt({},i);return e.expand(t,n)}));let s=!0;"mergeNodes"in i&&(s=i.mergeNodes);const c=i.issuer||new l("_:b"),u={"@default":{}};for(let e=0;ee._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=function(){var t=i(function*(t){throw new c("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:t})});return function(e){return t.apply(this,arguments)}}(),e.get=function(){var t=i(function*(t,n){let i;i="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const r=yield i(t);try{if(!r.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");_(r.document)&&(r.document=JSON.parse(r.document))}catch(s){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:s,remoteDoc:r})}return r});return function(e,n){return t.apply(this,arguments)}}(),e.processContext=function(){var t=i(function*(t,e,n){return n=M(n,{base:"",contextResolver:new a({sharedCache:I})}),null===e?S(n):(e=o.clone(e),v(e)&&"@context"in e||(e={"@context":e}),E({activeCtx:t,localCtx:e,options:n}))});return function(e,n,i){return t.apply(this,arguments)}}(),e.getContextValue=t("./context").getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new c('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(t,e){n[t]=e},e.unregisterRDFParser=function(t){delete n[t]},e.registerRDFParser("application/n-quads",h.parse),e.registerRDFParser("application/nquads",h.parse),e.url=t("./url"),e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=t("./RequestQueue"),e.JsonLdProcessor=t("./JsonLdProcessor")(e),s.setupGlobals(e),s.setupDocumentLoaders(e),e},M=function(){return I(function(){return M()})};I(M),e.exports=M},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(t,e,n){"use strict";const{isKeyword:i}=t("./context"),r=t("./graphTypes"),s=t("./types"),o=t("./util"),a=t("./JsonLdError"),l={};e.exports=l,l.createMergedNodeMap=(t,e)=>{const n=(e=e||{}).issuer||new o.IdentifierIssuer("_:b"),i={"@default":{}};return l.createNodeMap(t,i,"@default",n),l.mergeNodeMaps(i)},l.createNodeMap=(t,e,n,c,u,h)=>{if(s.isArray(t)){for(const i of t)l.createNodeMap(i,e,n,c,void 0,h);return}if(!s.isObject(t))return void(h&&h.push(t));if(r.isValue(t)){if("@type"in t){let e=t["@type"];0===e.indexOf("_:")&&(t["@type"]=e=c.getId(e))}return void(h&&h.push(t))}if(h&&r.isList(t)){const i=[];return l.createNodeMap(t["@list"],e,n,c,u,i),void h.push({"@list":i})}if("@type"in t){const e=t["@type"];for(const t of e)0===t.indexOf("_:")&&c.getId(t)}s.isUndefined(u)&&(u=r.isBlankNode(t)?c.getId(t["@id"]):t["@id"]),h&&h.push({"@id":u});const d=e[n],p=d[u]=d[u]||{};p["@id"]=u;const f=Object.keys(t).sort();for(let s of f){if("@id"===s)continue;if("@reverse"===s){const i={"@id":u},s=t["@reverse"];for(const t in s){const a=s[t];for(const s of a){let a=s["@id"];r.isBlankNode(s)&&(a=c.getId(a)),l.createNodeMap(s,e,n,c,a),o.addValue(d[a],t,i,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===s){u in e||(e[u]={}),l.createNodeMap(t[s],e,u,c);continue}if("@included"===s){l.createNodeMap(t[s],e,n,c);continue}if("@type"!==s&&i(s)){if("@index"===s&&s in p&&(t[s]!==p[s]||t[s]["@id"]!==p[s]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:p});p[s]=t[s];continue}const h=t[s];if(0===s.indexOf("_:")&&(s=c.getId(s)),0!==h.length)for(let t of h)if("@type"===s&&(t=0===t.indexOf("_:")?c.getId(t):t),r.isSubject(t)||r.isSubjectReference(t)){if("@id"in t&&!t["@id"])continue;const i=r.isBlankNode(t)?c.getId(t["@id"]):t["@id"];o.addValue(p,s,{"@id":i},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(t,e,n,c,i)}else if(r.isValue(t))o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1});else if(r.isList(t)){const i=[];l.createNodeMap(t["@list"],e,n,c,u,i),t={"@list":i},o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(t,e,n,c,u),o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(p,s,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=t=>{const e={};for(const n of Object.keys(t).sort())for(const r of Object.keys(t[n]).sort()){const s=t[n][r];r in e||(e[r]={"@id":r});const a=e[r];for(const t of Object.keys(s).sort())if(i(t)&&"@type"!==t)a[t]=o.clone(s[t]);else for(const e of s[t])o.addValue(a,t,o.clone(e),{propertyIsArray:!0,allowDuplicate:!1})}return e},l.mergeNodeMaps=t=>{const e=t["@default"],n=Object.keys(t).sort();for(const i of n){if("@default"===i)continue;const n=t[i];let s=e[i];s?"@graph"in s||(s["@graph"]=[]):e[i]=s={"@id":i,"@graph":[]};const o=s["@graph"];for(const t of Object.keys(n).sort()){const e=n[t];r.isSubjectReference(e)||o.push(e)}}return e}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(t,e,n){"use strict";const i=t("./documentLoaders/xhr"),r={};e.exports=r,r.setupDocumentLoaders=function(t){"undefined"!=typeof XMLHttpRequest&&(t.documentLoaders.xhr=i,t.useDocumentLoader("xhr"))},r.setupGlobals=function(t){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(t,e,n){"use strict";const{createNodeMap:i}=t("./nodeMap"),{isKeyword:r}=t("./context"),s=t("./graphTypes"),o=t("canonicalize"),a=t("./types"),l=t("./util"),{RDF_FIRST:c,RDF_REST:u,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:p,RDF_LANGSTRING:f,XSD_BOOLEAN:g,XSD_DOUBLE:m,XSD_INTEGER:b,XSD_STRING:y}=t("./constants"),{isAbsolute:v}=t("./url"),_={};function w(t,e,n,i,s){const o=Object.keys(e).sort();for(const a of o){const o=e[a],l=Object.keys(o).sort();for(let e of l){const l=o[e];if("@type"===e)e=d;else if(r(e))continue;for(const r of l){const o={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!v(a))continue;const l={termType:e.startsWith("_:")?"BlankNode":"NamedNode",value:e};if(!v(e)||"BlankNode"===l.termType&&!s.produceGeneralizedRdf)continue;const c=x(r,i,t,n,s.rdfDirection);c&&t.push({subject:o,predicate:l,object:c,graph:n})}}}}function x(t,e,n,i,r){const l={};if(s.isValue(t)){l.termType="Literal",l.value=void 0,l.datatype={termType:"NamedNode"};let e=t["@value"];const n=t["@type"]||null;"@json"===n?(l.value=o(e),l.datatype.value=p):a.isBoolean(e)?(l.value=e.toString(),l.datatype.value=n||g):a.isDouble(e)||n===m?(a.isDouble(e)||(e=parseFloat(e)),l.value=e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),l.datatype.value=n||m):a.isNumber(e)?(l.value=e.toFixed(0),l.datatype.value=n||b):"i18n-datatype"===r&&"@direction"in t?(l.datatype.value="https://www.w3.org/ns/i18n#"+(t["@language"]||"")+`_${t["@direction"]}`,l.value=e):"@language"in t?(l.value=e,l.datatype.value=n||f,l.language=t["@language"]):(l.value=e,l.datatype.value=n||y)}else if(s.isList(t)){const s=function(t,e,n,i,r){const s={termType:"NamedNode",value:c},o={termType:"NamedNode",value:u},a={termType:"NamedNode",value:h},l=t.pop(),d=l?{termType:"BlankNode",value:e.getId()}:a;let p=d;for(const c of t){const t=x(c,e,n,i,r),a={termType:"BlankNode",value:e.getId()};n.push({subject:p,predicate:s,object:t,graph:i}),n.push({subject:p,predicate:o,object:a,graph:i}),p=a}if(l){const t=x(l,e,n,i,r);n.push({subject:p,predicate:s,object:t,graph:i}),n.push({subject:p,predicate:o,object:a,graph:i})}return d}(t["@list"],e,n,i,r);l.termType=s.termType,l.value=s.value}else{const e=a.isObject(t)?t["@id"]:t;l.termType=e.startsWith("_:")?"BlankNode":"NamedNode",l.value=e}return"NamedNode"!==l.termType||v(l.value)?l:null}e.exports=_,_.toRDF=(t,e)=>{const n=new l.IdentifierIssuer("_:b"),r={"@default":{}};i(t,r,"@default",n);const s=[],o=Object.keys(r).sort();for(const i of o){let t;if("@default"===i)t={termType:"DefaultGraph",value:""};else{if(!v(i))continue;t=i.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},t.value=i}w(s,r[i],t,n,e)}return s}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(t,e,n){"use strict";const i={};e.exports=i,i.isArray=Array.isArray,i.isBoolean=t=>"boolean"==typeof t||"[object Boolean]"===Object.prototype.toString.call(t),i.isDouble=t=>i.isNumber(t)&&(-1!==String(t).indexOf(".")||Math.abs(t)>=1e21),i.isEmptyObject=t=>i.isObject(t)&&0===Object.keys(t).length,i.isNumber=t=>"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t),i.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t),i.isObject=t=>"[object Object]"===Object.prototype.toString.call(t),i.isString=t=>"string"==typeof t||"[object String]"===Object.prototype.toString.call(t),i.isUndefined=t=>void 0===t},{}],31:[function(t,e,n){"use strict";const i=t("./types"),r={};e.exports=r,r.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=(t,e)=>{const n={},i=r.parsers[e||"full"],s=i.regex.exec(t);let o=i.keys.length;for(;o--;)n[i.keys[o]]=void 0===s[o]?null:s[o];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=(t,e)=>{if(null===t||r.isAbsolute(e))return e;(!t||i.isString(t))&&(t=r.parse(t||""));const n=r.parse(e),s={protocol:t.protocol||""};if(null!==n.authority)s.authority=n.authority,s.path=n.path,s.query=n.query;else if(s.authority=t.authority,""===n.path)s.path=t.path,s.query=null!==n.query?n.query:t.query;else{if(0===n.path.indexOf("/"))s.path=n.path;else{let e=t.path;e=e.substr(0,e.lastIndexOf("/")+1),(e.length>0||t.authority)&&"/"!==e.substr(-1)&&(e+="/"),e+=n.path,s.path=e}s.query=n.query}""!==n.path&&(s.path=r.removeDotSegments(s.path));let o=s.protocol;return null!==s.authority&&(o+="//"+s.authority),o+=s.path,null!==s.query&&(o+="?"+s.query),null!==n.fragment&&(o+="#"+n.fragment),""===o&&(o="./"),o},r.removeBase=(t,e)=>{if(null===t)return e;(!t||i.isString(t))&&(t=r.parse(t||""));let n="";if(""!==t.href?n+=(t.protocol||"")+"//"+(t.authority||""):e.indexOf("//")&&(n+="//"),0!==e.indexOf(n))return e;const s=r.parse(e.substr(n.length)),o=t.normalizedPath.split("/"),a=s.normalizedPath.split("/"),l=s.fragment||s.query?0:1;for(;o.length>0&&a.length>l&&o[0]===a[0];)o.shift(),a.shift();let c="";if(o.length>0){o.pop();for(let t=0;t{if(0===t.length)return"";const e=t.split("/"),n=[];for(;e.length>0;){const t=e.shift(),i=0===e.length;"."!==t?".."!==t?n.push(t):(n.pop(),i&&n.push("")):i&&n.push("")}return"/"===t[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const s=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=t=>i.isString(t)&&s.test(t),r.isRelative=t=>i.isString(t)},{"./types":30}],32:[function(t,e,n){"use strict";const i=t("./graphTypes"),r=t("./types"),s=t("rdf-canonize").IdentifierIssuer,o=t("./JsonLdError"),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u={accept:"application/ld+json, application/json"},h={};function d(t,e){if(r.isArray(e))for(let n=0;n{if(Object.keys(t).some(t=>"accept"===t.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+u.accept+'" is supported.');return Object.assign({Accept:u.accept},t)},h.parseLinkHeader=t=>{const e={},n=t.match(a);for(let i=0;i{if(!(r.isString(t)||r.isArray(t)&&t.every(t=>r.isString(t)))){if(e&&r.isObject(t))switch(Object.keys(t).length){case 0:return;case 1:if("@default"in t&&h.asArray(t["@default"]).every(t=>r.isString(t)))return}throw new o('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:t})}},h.hasProperty=(t,e)=>{if(t.hasOwnProperty(e)){const n=t[e];return!r.isArray(n)||n.length>0}return!1},h.hasValue=(t,e,n)=>{if(h.hasProperty(t,e)){let s=t[e];const o=i.isList(s);if(r.isArray(s)||o){o&&(s=s["@list"]);for(let t=0;t{if("propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1),"valueIsArray"in i||(i.valueIsArray=!1),"allowDuplicate"in i||(i.allowDuplicate=!0),"prependValue"in i||(i.prependValue=!1),i.valueIsArray)t[e]=n;else if(r.isArray(n)){0===n.length&&i.propertyIsArray&&!t.hasOwnProperty(e)&&(t[e]=[]),i.prependValue&&(n=n.concat(t[e]),t[e]=[]);for(let r=0;r[].concat(t[e]||[]),h.removeProperty=(t,e)=>{delete t[e]},h.removeValue=(t,e,n,i)=>{"propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1);const r=h.getValues(t,e).filter(t=>!h.compareValues(t,n));0===r.length?h.removeProperty(t,e):t[e]=1!==r.length||i.propertyIsArray?r:r[0]},h.relabelBlankNodes=(t,e)=>d((e=e||{}).issuer||new s("_:b"),t),h.compareValues=(t,e)=>!!(t===e||i.isValue(t)&&i.isValue(e)&&t["@value"]===e["@value"]&&t["@type"]===e["@type"]&&t["@language"]===e["@language"]&&t["@index"]===e["@index"])||!!(r.isObject(t)&&"@id"in t&&r.isObject(e)&&"@id"in e)&&t["@id"]===e["@id"],h.compareShortestLeast=(t,e)=>t.length1;const g=(t,e,n)=>{const i=t[d].get(e);if(i){const e=i.value;if(m(t,e)){if(y(t,i),!t[a])return}else n&&(t[p]&&(i.value.now=Date.now()),t[h].unshiftNode(i));return e.value}},m=(t,e)=>{if(!e||!e.maxAge&&!t[l])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[l]&&n>t[l]},b=t=>{if(t[s]>t[r])for(let e=t[h].tail;t[s]>t[r]&&null!==e;){const n=e.prev;y(t,e),e=n}},y=(t,e)=>{if(e){const n=e.value;t[c]&&t[c](n.key,n.value),t[s]-=n.length,t[d].delete(n.key),t[h].removeNode(e)}};class v{constructor(t,e,n,i,r){this.key=t,this.value=e,this.length=n,this.now=i,this.maxAge=r||0}}const _=(t,e,n,i)=>{let r=n.value;m(t,r)&&(y(t,n),t[a]||(r=void 0)),r&&e.call(i,r.value,r.key,t)};e.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[r]=t.max||1/0;const e=t.length||f;if(this[o]="function"!=typeof e?f:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[l]=t.maxAge||0,this[c]=t.dispose,this[u]=t.noDisposeOnSet||!1,this[p]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[r]=t||1/0,b(this)}get max(){return this[r]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[l]=t,b(this)}get maxAge(){return this[l]}set lengthCalculator(t){"function"!=typeof t&&(t=f),t!==this[o]&&(this[o]=t,this[s]=0,this[h].forEach(t=>{t.length=this[o](t.value,t.key),this[s]+=t.length})),b(this)}get lengthCalculator(){return this[o]}get length(){return this[s]}get itemCount(){return this[h].length}rforEach(t,e){e=e||this;for(let n=this[h].tail;null!==n;){const i=n.prev;_(this,t,n,e),n=i}}forEach(t,e){e=e||this;for(let n=this[h].head;null!==n;){const i=n.next;_(this,t,n,e),n=i}}keys(){return this[h].toArray().map(t=>t.key)}values(){return this[h].toArray().map(t=>t.value)}reset(){this[c]&&this[h]&&this[h].length&&this[h].forEach(t=>this[c](t.key,t.value)),this[d]=new Map,this[h]=new i,this[s]=0}dump(){return this[h].map(t=>!m(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[h]}set(t,e,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const i=n?Date.now():0,a=this[o](e,t);if(this[d].has(t)){if(a>this[r])return y(this,this[d].get(t)),!1;const o=this[d].get(t).value;return this[c]&&(this[u]||this[c](t,o.value)),o.now=i,o.maxAge=n,o.value=e,this[s]+=a-o.length,o.length=a,this.get(t),b(this),!0}const p=new v(t,e,a,i,n);return p.length>this[r]?(this[c]&&this[c](t,e),!1):(this[s]+=p.length,this[h].unshift(p),this[d].set(t,this[h].head),b(this),!0)}has(t){if(!this[d].has(t))return!1;const e=this[d].get(t).value;return!m(this,e)}get(t){return g(this,t,!0)}peek(t){return g(this,t,!1)}pop(){const t=this[h].tail;return t?(y(this,t),t.value):null}del(t){y(this,this[d].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const t=r-e;t>0&&this.set(i.k,i.v,t)}}}prune(){this[d].forEach((t,e)=>g(this,e,!1))}}},{yallist:92}],34:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#",s="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:`${r}decimal`,boolean:`${r}boolean`,double:`${r}double`,integer:`${r}integer`,string:`${r}string`},rdf:{type:`${i}type`,nil:`${i}nil`,first:`${i}first`,rest:`${i}rest`,langString:`${i}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`}}},{}],35:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function t(e,n){if(n=n||d,!e)return n.defaultGraph();switch(e[0]){case"?":return n.variable(e.substr(1));case"_":return n.blankNode(e.substr(2));case'"':if(n===d)return new g(e);if('"'===e[e.length-1])return n.literal(e.substr(1,e.length-2));const i=e.lastIndexOf('"',e.length-1);return n.literal(e.substr(1,i-1),"@"===e[i+1]?e.substr(i+2):n.namedNode(e.substr(i+3)));case"<":const r=h.exec(e);return n.quad(t(w(r[1]),n),t(w(r[2]),n),t(w(r[3]),n),r[4]&&t(w(r[4]),n));default:return n.namedNode(e)}},n.termToId=function t(e){if("string"==typeof e)return e;if(e instanceof p&&"Quad"!==e.termType)return e.id;if(!e)return l.id;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==a.string?`^^${e.datatype.value}`:""}`;case"Quad":return`<<${_(t(e.subject))} ${_(t(e.predicate))} ${_(t(e.object))}${(0,s.isDefaultGraph)(e.graph)?"":` ${t(e.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${e.termType}`)}},n.escapeQuotes=_,n.unescapeQuotes=w,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var i,r=(i=t("./IRIs"))&&i.__esModule?i:{default:i},s=t("./N3Util");const{rdf:o,xsd:a}=r.default;let l,c=0;const u=/^"(.*".*)(?="[^"]*$)/,h=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,d={namedNode:function(t){return new f(t)},blankNode:function(t){return new m(t||"n3-"+c++)},variable:function(t){return new b(t)},literal:function(t,e){if("string"==typeof e)return new g(`"${t}"@${e.toLowerCase()}`);let n=e?e.value:"";return""===n&&("boolean"==typeof t?n=a.boolean:"number"==typeof t&&(Number.isFinite(t)?n=Number.isInteger(t)?a.integer:a.double:(n=a.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),new g(""===n||n===a.string?`"${t}"`:`"${t}"^^${n}`)},defaultGraph:function(){return l},quad:x,triple:x};n.default=d;class p{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof p?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}toJSON(){return{termType:this.termType,value:this.value}}}n.Term=p;class f extends p{get termType(){return"NamedNode"}}n.NamedNode=f;class g extends p{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e`"${e.replace(/"/g,'""')}`)}function w(t){return t.replace(u,(t,e)=>`"${e.replace(/""/g,'"')}`)}function x(t,e,n,i){return new v(t,e,n,i)}n.Triple=n.Quad=v},{"./IRIs":34,"./N3Util":41}],36:[function(t,e,n){(function(e){(function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=s(t("./IRIs")),r=s(t("queue-microtask"));function s(t){return t&&t.__esModule?t:{default:t}}const{xsd:o}=i.default,a=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,l={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},c=/[\x00-\x20<>\\"\{\}\|\^\`]/,u={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},h=/$0^/;n.default=class{constructor(t){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]*)?$/,this._lineMode=!!(t=t||{}).lineMode){this._n3Mode=!1;for(const t in this)!(t in u)&&this[t]instanceof RegExp&&(this[t]=h)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let n=this._input;const i=this._comments;for(;;){let s,a;for(;s=this._newline.exec(n);)i&&(a=this._comment.exec(s[0]))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),n=n.substr(s[0].length,n.length),this._line++;if(!s&&(s=this._whitespace.exec(n))&&(n=n.substr(s[0].length,n.length)),this._endOfFile.test(n))return e&&(i&&(a=this._comment.exec(n))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),t(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;const l=this._line,u=n[0];let h="",d="",p="",f=null,g=0,m=!1;switch(u){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(g=1,h="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){m=!0;break}case"<":if(f=this._unescapedIri.exec(n))h="IRI",d=f[1];else if(f=this._iri.exec(n)){if(d=this._unescape(f[1]),null===d||c.test(d))return r(this);h="IRI"}else n.length>1&&"<"===n[1]?(h="<<",g=2):this._n3Mode&&n.length>1&&"="===n[1]&&(h="inverse",g=2,d=">");break;case">":n.length>1&&">"===n[1]&&(h=">>",g=2);break;case"_":((f=this._blank.exec(n))||e&&(f=this._blank.exec(`${n} `)))&&(h="blank",p="_",d=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(n))d=f[1];else if(({value:d,matchLength:g}=this._parseLiteral(n)),null===d)return r(this);(null!==f||0!==g)&&(h="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(n))d=f[1];else if(({value:d,matchLength:g}=this._parseLiteral(n)),null===d)return r(this);(null!==f||0!==g)&&(h="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(n))&&(h="var",d=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(n))?(h="langcode",d=f[1]):(f=this._keyword.exec(n))&&(h=f[0]);break;case".":if(1===n.length?e:n[1]<"0"||n[1]>"9"){h=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(n)||e&&(f=this._number.exec(`${n} `)))&&(h="literal",d=f[0],p="string"==typeof f[1]?o.double:"string"==typeof f[2]?o.decimal:o.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(n))?h=f[0].toUpperCase():m=!0;break;case"f":case"t":(f=this._boolean.exec(n))?(h="literal",d=f[0],p=o.boolean):m=!0;break;case"a":(f=this._shortPredicates.exec(n))?(h="abbreviation",d="a"):m=!0;break;case"=":this._n3Mode&&n.length>1&&(h="abbreviation",">"!==n[1]?(g=1,d="="):(g=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(g=1,h=u);break;default:m=!0}if(m&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(n))?((f=this._prefixed.exec(n))||e&&(f=this._prefixed.exec(`${n} `)))&&(h="prefixed",p=f[1]||"",d=this._unescape(f[2])):(h="prefix",d=f[1]||"")),"^^"===this._previousMarker)switch(h){case"prefixed":h="type";break;case"IRI":h="typeIRI";break;default:h=""}if(!h)return e||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?r(this):this._input=n;const b={line:l,type:h,value:d,prefix:p};t(null,b),this.previousToken=b,this._previousMarker=h,n=n.substr(g||f[0].length,n.length)}function r(e){t(e._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(t){let e=!1;const n=t.replace(a,(t,n,i,r)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof i){let t=Number.parseInt(i,16);return t<=65535?String.fromCharCode(Number.parseInt(i,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return r in l?l[r]:(e=!0,"")});return e?null:n}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],n=e.length;let i=Math.max(this._literalClosingPos,n);for(;(i=t.indexOf(e,i))>0;){let e=0;for(;"\\"===t[i-e-1];)e++;if(e%2==0){const e=t.substring(n,i),r=e.split(/\r\n|\r|\n/).length-1,s=i+n;if(1===n&&0!==r||3===n&&this._lineMode)break;return this._line+=r,{value:this._unescape(e),matchLength:s}}i++}this._literalClosingPos=t.length-n+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,n){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof n){const t=[];let e;if(this._tokenizeToEnd((n,i)=>n?e=n:t.push(i),!0),e)throw e;return t}(0,r.default)(()=>this._tokenizeToEnd(n,!0))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=e.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(n,!1)))}),t.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(n,!0)}),t.on("error",n)}}}).call(this)}).call(this,t("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(t("./N3Lexer")),r=o(t("./N3DataFactory")),s=o(t("./IRIs"));function o(t){return t&&t.__esModule?t:{default:t}}let a=0;class l{constructor(t){this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&u(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(e),r=/trig/.test(e),s=/triple/.test(e),o=/quad/.test(e),a=this._n3Mode=/n3/.test(e),l=s||o;(this._supportsNamedGraphs=!(n||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||s||a),this._supportsRDFStar=""===e||/star|\*$/.test(e),l&&(this._resolveRelativeIRI=t=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new i.default({lineMode:l,n3:a}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){a=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,n,i,r){const s=this._n3Mode;this._contextStack.push({subject:n,predicate:i,object:r,graph:e,type:t,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const t=this._contextStack.pop(),e=this._n3Mode;this._subject=t.subject,this._predicate=t.predicate,this._object=t.object,this._graph=t.graph,e&&(this._inversePredicate=t.inverse,this._prefixes._=t.blankPrefix,this._quantified=t.quantified)}_readInTopContext(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let n;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);n=this._namedNode(e);break;case"type":case"prefixed":const i=this._prefixes[t.prefix];if(void 0===i)return this._error(`Undefined prefix "${t.prefix}:"`,t);n=this._namedNode(i+t.value);break;case"blank":n=this._blankNode(this._prefixes[t.prefix]+t.value);break;case"var":n=this._variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(t){switch(this._predicate=null,t.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._literal(t.value,this._namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._literal(t.value,this._namedNode(t.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext(),null===this._object?e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,n=null,i=this._readListItem;const r=this._subject,s=this._contextStack,o=s[s.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=e=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==s.length&&"list"===s[s.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":0===t.prefix.length?(this._literalValue=t.value,i=this._readListItemDataTypeOrLang):(e=this._literal(t.value,this._namedNode(t.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===n&&(this._subject=n=this._blankNode()),null===r?null===o.predicate?o.subject=n:o.object=n:this._emit(r,this.RDF_REST,n,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,e,this._graph)}return i}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const n=this._readEntity(t);if(void 0===n)return;e=this._literal(this._literalValue,n),t=null;break;case"langcode":e=this._literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const n=this._completeLiteral(t);if(n)return this._object=n.literal,e&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,n=this._graph;const i=this._subject,r=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,r&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==i){const t=this._predicate,e=this._object;r?this._emit(e,t,i,n):this._emit(i,t,e,n)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,n=e.length&&e[e.length-1];if(n&&"item"===n.type){const t=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,n;const i=this._blankNode();if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=i):(e=this._object,this._object=i),this._emit(e,n,i,this._graph),this._readPath}_readBackwardPath(t){const e=this._blankNode();let n,i;if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(i=this._subject,this._subject=e):(i=this._object,this._object=e),this._emit(e,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,n,i){this._callback(null,this._quad(t,e,n,i||this.DEFAULTGRAPH))}_error(t,e){const n=new Error(`${t} on line ${e.line}.`);n.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let n="",i=-1,r=-1,s=0,o="/";for(;i=r&&(n=n.substr(0,s)),"/"!==o)return`${n}/${t.substr(i+1)}`;s=i+1}}}o=t[++i]}return n+t.substring(s)}parse(t,e,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${a++}_`,this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!e){const e=[];let n;if(this._callback=(t,i)=>{t?n=t:i&&e.push(i)},this._lexer.tokenize(t).every(t=>this._readCallback=this._readCallback(t)),n)throw n;return e}this._callback=e,this._lexer.tokenize(t,(t,e)=>{null!==t?(this._callback(t),this._callback=c):this._readCallback&&(this._readCallback=this._readCallback(e))})}}function c(){}function u(t,e){const n=e.namedNode;t._namedNode=n,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=n(s.default.rdf.first),t.RDF_REST=n(s.default.rdf.rest),t.RDF_NIL=n(s.default.rdf.nil),t.N3_FORALL=n(s.default.r.forAll),t.N3_FORSOME=n(s.default.r.forSome),t.ABBREVIATIONS={a:n(s.default.rdf.type),"=":n(s.default.owl.sameAs),">":n(s.default.log.implies)},t.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=l,u(l.prototype,r.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}(t("./N3DataFactory")),s=t("readable-stream"),o=(i=t("./IRIs"))&&i.__esModule?i:{default:i};function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}class l{constructor(t,e){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!e&&t&&!t[0]&&(e=t,t=null),this._factory=(e=e||{}).factory||r.default,t&&this.addQuads(t)}get size(){let t=this._size;if(null!==t)return t;t=0;const e=this._graphs;let n,i;for(const r in e)for(const s in n=e[r].subjects)for(const e in i=n[s])t+=Object.keys(i[e]).length;return this._size=t}_addToIndex(t,e,n,i){const r=t[e]||(t[e]={}),s=r[n]||(r[n]={}),o=i in s;return o||(s[i]=null),!o}_removeFromIndex(t,e,n,i){const r=t[e],s=r[n];delete s[i];for(const o in s)return;delete r[n];for(const o in r)return;delete t[e]}_findInIndex(t,e,n,i,s,o,a,l,c,u){let h,d,p;const f=!e+!n+!i>1?Object.keys(this._ids):this._entities;e&&((h=t,t={})[e]=h[e]);for(const g in t){const e=f[g];if(d=t[g]){n&&((h=d,d={})[n]=h[n]);for(const t in d){const n=f[t];if(p=d[t]){const t=i?i in p?[i]:[]:Object.keys(p);for(let i=0;i{n in e||(e[n]=!0,t((0,r.termFromId)(this._entities[n],this._factory)))}}add(t){return this.addQuad(t),this}addQuad(t,e,n,i){e||(i=t.graph,n=t.object,e=t.predicate,t=t.subject),t=(0,r.termToId)(t),e=(0,r.termToId)(e),n=(0,r.termToId)(n),i=(0,r.termToId)(i);let s=this._graphs[i];s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s));const o=this._ids,a=this._entities;t=o[t]||(o[a[++this._id]=t]=this._id),e=o[e]||(o[a[++this._id]=e]=this._id),n=o[n]||(o[a[++this._id]=n]=this._id);const l=this._addToIndex(s.subjects,t,e,n);return this._addToIndex(s.predicates,e,n,t),this._addToIndex(s.objects,n,t,e),this._size=null,l}addQuads(t){for(let e=0;e{this.addQuad(t)}),t}removeQuad(t,e,n,i){e||(i=t.graph,n=t.object,e=t.predicate,t=t.subject),t=(0,r.termToId)(t),e=(0,r.termToId)(e),n=(0,r.termToId)(n),i=(0,r.termToId)(i);const s=this._ids,o=this._graphs;let a,l,c;if(!((t=s[t])&&(e=s[e])&&(n=s[n])&&(a=o[i])&&(l=a.subjects[t])&&(c=l[e])&&n in c))return!1;for(t in this._removeFromIndex(a.subjects,t,e,n),this._removeFromIndex(a.predicates,e,n,t),this._removeFromIndex(a.objects,n,t,e),null!==this._size&&this._size--,a.subjects)return!0;return delete o[i],!0}removeQuads(t){for(let e=0;e{this.removeQuad(t)}),t}removeMatches(t,e,n,i){const r=new s.Readable({objectMode:!0});return r._read=()=>{for(const s of this.getQuads(t,e,n,i))r.push(s);r.push(null)},this.remove(r)}deleteGraph(t){return this.removeMatches(null,null,null,t)}getQuads(t,e,n,i){t=t&&(0,r.termToId)(t),e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=[],o=this._getGraphs(i),a=this._ids;let l,u,h,d;if(c(t)&&!(u=a[t])||c(e)&&!(h=a[e])||c(n)&&!(d=a[n]))return s;for(const r in o)(l=o[r])&&(u?d?this._findInIndex(l.objects,d,u,h,"object","subject","predicate",r,null,s):this._findInIndex(l.subjects,u,h,null,"subject","predicate","object",r,null,s):h?this._findInIndex(l.predicates,h,d,null,"predicate","object","subject",r,null,s):d?this._findInIndex(l.objects,d,null,null,"object","subject","predicate",r,null,s):this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",r,null,s));return s}match(t,e,n,i){return new u(this,t,e,n,i)}countQuads(t,e,n,i){t=t&&(0,r.termToId)(t),e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._getGraphs(i),o=this._ids;let a,l,u,h,d=0;if(c(t)&&!(l=o[t])||c(e)&&!(u=o[e])||c(n)&&!(h=o[n]))return 0;for(const r in s)(a=s[r])&&(d+=t?n?this._countInIndex(a.objects,h,l,u):this._countInIndex(a.subjects,l,u,h):e?this._countInIndex(a.predicates,u,h,l):this._countInIndex(a.objects,h,l,u));return d}forEach(t,e,n,i,r){this.some(e=>(t(e),!1),e,n,i,r)}every(t,e,n,i,r){let s=!1;const o=!this.some(e=>(s=!0,!t(e)),e,n,i,r);return s&&o}some(t,e,n,i,s){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i),s=s&&(0,r.termToId)(s);const o=this._getGraphs(s),a=this._ids;let l,u,h,d;if(c(e)&&!(u=a[e])||c(n)&&!(h=a[n])||c(i)&&!(d=a[i]))return!1;for(const r in o)if(l=o[r])if(u){if(d){if(this._findInIndex(l.objects,d,u,h,"object","subject","predicate",r,t,null))return!0}else if(this._findInIndex(l.subjects,u,h,null,"subject","predicate","object",r,t,null))return!0}else if(h){if(this._findInIndex(l.predicates,h,d,null,"predicate","object","subject",r,t,null))return!0}else if(d){if(this._findInIndex(l.objects,d,null,null,"object","subject","predicate",r,t,null))return!0}else if(this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",r,t,null))return!0;return!1}getSubjects(t,e,n){const i=[];return this.forSubjects(t=>{i.push(t)},t,e,n),i}forSubjects(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.predicates,l,u,t):this._loopByKey1(a.subjects,l,t):u?this._loopByKey0(a.objects,u,t):this._loop(a.subjects,t))}getPredicates(t,e,n){const i=[];return this.forPredicates(t=>{i.push(t)},t,e,n),i}forPredicates(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.objects,u,l,t):this._loopByKey0(a.subjects,l,t):u?this._loopByKey1(a.predicates,u,t):this._loop(a.predicates,t))}getObjects(t,e,n){const i=[];return this.forObjects(t=>{i.push(t)},t,e,n),i}forObjects(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.subjects,l,u,t):this._loopByKey1(a.objects,l,t):u?this._loopByKey0(a.predicates,u,t):this._loop(a.objects,t))}getGraphs(t,e,n){const i=[];return this.forGraphs(t=>{i.push(t)},t,e,n),i}forGraphs(t,e,n,i){for(const r in this._graphs)this.some(e=>(t(e.graph),!0),e,n,i,r)}createBlankNode(t){let e,n;if(t)for(e=t=`_:${t}`,n=1;this._ids[e];)e=t+n++;else do{e="_:b"+this._blankNodeIndex++}while(this._ids[e]);return this._ids[e]=++this._id,this._entities[this._id]=e,this._factory.blankNode(e.substr(2))}extractLists({remove:t=!1,ignoreErrors:e=!1}={}){const n={},i=e?()=>!0:(t,e)=>{throw new Error(`${t.value} ${e}`)},r=this.getQuads(null,o.default.rdf.rest,o.default.rdf.nil,null),s=t?[...r]:[];return r.forEach(e=>{const r=[];let a,l,c=!1;const u=e.graph;let h=e.subject;for(;h&&!c;){const t=this.getQuads(null,null,h,null),e=this.getQuads(h,null,null,null);let n,d=null,p=null,f=null;for(let r=0;r{switch(t){case"data":e=i;break;case"end":n=i}}},(t,e)=>{t&&this.emit("error",t)||e&&this.push(e)},(t,e)=>{this.emit("prefix",t,e)}),this._transform=(t,n,i)=>{e(t),i()},this._flush=t=>{n(),t()}}import(t){return t.on("data",t=>{this.write(t)}),t.on("end",()=>{this.end()}),t.on("error",t=>{this.emit("error",t)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=t("readable-stream"),s=(i=t("./N3Writer"))&&i.__esModule?i:{default:i};n.default=class extends r.Transform{constructor(t){super({encoding:"utf8",writableObjectMode:!0});const e=this._writer=new s.default({write:(t,e,n)=>{this.push(t),n&&n()},end:t=>{this.push(null),t&&t()}},t);this._transform=(t,n,i)=>{e.addQuad(t,i)},this._flush=t=>{e.end(t)}}import(t){return t.on("data",t=>{this.write(t)}),t.on("end",()=>{this.end()}),t.on("error",t=>{this.emit("error",t)}),t.on("prefix",(t,e)=>{this._writer.addPrefix(t,e)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isNamedNode=function(t){return!!t&&"NamedNode"===t.termType},n.isBlankNode=function(t){return!!t&&"BlankNode"===t.termType},n.isLiteral=function(t){return!!t&&"Literal"===t.termType},n.isVariable=function(t){return!!t&&"Variable"===t.termType},n.isDefaultGraph=s,n.inDefaultGraph=function(t){return s(t.graph)},n.prefix=function(t,e){return o({"":t},e)("")},n.prefixes=o;var i,r=(i=t("./N3DataFactory"))&&i.__esModule?i:{default:i};function s(t){return!!t&&"DefaultGraph"===t.termType}function o(t,e){const n=Object.create(null);for(const r in t)i(r,t[r]);function i(t,i){if("string"==typeof i){const r=Object.create(null);n[t]=t=>r[t]||(r[t]=e.namedNode(i+t))}else if(!(t in n))throw new Error(`Unknown prefix: ${t}`);return n[t]}return e=e||r.default,i}},{"./N3DataFactory":35}],42:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=(i=t("./IRIs"))&&i.__esModule?i:{default:i},s=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}(t("./N3DataFactory")),o=t("./N3Util");function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}const l=s.default.defaultGraph(),{rdf:c,xsd:u}=r.default,h=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,d=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,p={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class f extends s.Term{equals(){return!1}}function g(t){let e=p[t];return void 0===e&&(1===t.length?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}n.default=class{constructor(t,e){if(this._prefixRegex=/$0^/,t&&"function"!=typeof t.write&&(e=t,t=null),this._lists=(e=e||{}).lists,t)this._outputStream=t,this._endStream=void 0===e.end||!!e.end;else{let t="";this._outputStream={write(e,n,i){t+=e,i&&i()},end:e=>{e&&e(null,t)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(e.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=l,this._baseIRI=e.baseIRI,this._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes))}get _inDefaultGraph(){return l.equals(this._graph)}_write(t,e){this._outputStream.write(t,"utf8",e)}_writeQuad(t,e,n,i,r){try{i.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(l.equals(i)?"":`${this._encodeIriOrBlank(i)} {\n`)),this._graph=i,this._subject=null),t.equals(this._subject)?e.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,r):this._write(`;\n ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=t)} ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r)}catch(s){r&&r(s)}}_writeQuadLine(t,e,n,i,r){delete this._prefixMatch,this._write(this.quadToString(t,e,n,i),r)}quadToString(t,e,n,i){return`${this._encodeSubject(t)} ${this._encodeIriOrBlank(e)} ${this._encodeObject(n)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .\n`:" .\n"}`}quadsToString(t){return t.map(t=>this.quadToString(t.subject,t.predicate,t.object,t.graph)).join("")}_encodeSubject(t){return"Quad"===t.termType?this._encodeQuad(t):this._encodeIriOrBlank(t)}_encodeIriOrBlank(t){if("NamedNode"!==t.termType)return this._lists&&t.value in this._lists&&(t=this.list(this._lists[t.value])),"id"in t?t.id:`_:${t.value}`;let e=t.value;this._baseIRI&&e.startsWith(this._baseIRI)&&(e=e.substr(this._baseIRI.length)),h.test(e)&&(e=e.replace(d,g));const n=this._prefixRegex.exec(e);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:e:`<${e}>`}_encodeLiteral(t){let e=t.value;if(h.test(e)&&(e=e.replace(d,g)),t.language)return`"${e}"@${t.language}`;if(this._lineMode){if(t.datatype.value===u.string)return`"${e}"`}else switch(t.datatype.value){case u.string:return`"${e}"`;case u.boolean:if("true"===e||"false"===e)return e;break;case u.integer:if(/^[+-]?\d+$/.test(e))return e;break;case u.decimal:if(/^[+-]?\d*\.\d+$/.test(e))return e;break;case u.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(e))return e}return`"${e}"^^${this._encodeIriOrBlank(t.datatype)}`}_encodePredicate(t){return t.value===c.type?"a":this._encodeIriOrBlank(t)}_encodeObject(t){switch(t.termType){case"Quad":return this._encodeQuad(t);case"Literal":return this._encodeLiteral(t);default:return this._encodeIriOrBlank(t)}}_encodeQuad({subject:t,predicate:e,object:n,graph:i}){return`<<${this._encodeSubject(t)} ${this._encodePredicate(e)} ${this._encodeObject(n)}${(0,o.isDefaultGraph)(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(t,e,n,i,r){void 0===n?this._writeQuad(t.subject,t.predicate,t.object,t.graph,e):"function"==typeof i?this._writeQuad(t,e,n,l,i):this._writeQuad(t,e,n,i||l,r)}addQuads(t){for(let e=0;e.\n`)}if(n){let t="",e="";for(const n in this._prefixIRIs)t+=t?`|${n}`:n,e+=(e?"|":"")+this._prefixIRIs[n];t=t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${e})[^/]*$|^(${t})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",e)}blank(t,e){let n,i,r=t;switch(void 0===t?r=[]:t.termType?r=[{predicate:t,object:e}]:"length"in t||(r=[t]),i=r.length){case 0:return new f("[]");case 1:if(n=r[0],!(n.object instanceof f))return new f(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let e="[";for(let s=0;s{e=null,t(n,i)});if(this._endStream)try{return this._outputStream.end(e)}catch(n){}e&&e()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"Writer",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"Store",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"StreamParser",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"StreamWriter",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"DataFactory",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"Term",{enumerable:!0,get:function(){return u.Term}}),Object.defineProperty(n,"NamedNode",{enumerable:!0,get:function(){return u.NamedNode}}),Object.defineProperty(n,"Literal",{enumerable:!0,get:function(){return u.Literal}}),Object.defineProperty(n,"BlankNode",{enumerable:!0,get:function(){return u.BlankNode}}),Object.defineProperty(n,"Variable",{enumerable:!0,get:function(){return u.Variable}}),Object.defineProperty(n,"DefaultGraph",{enumerable:!0,get:function(){return u.DefaultGraph}}),Object.defineProperty(n,"Quad",{enumerable:!0,get:function(){return u.Quad}}),Object.defineProperty(n,"Triple",{enumerable:!0,get:function(){return u.Triple}}),Object.defineProperty(n,"termFromId",{enumerable:!0,get:function(){return u.termFromId}}),Object.defineProperty(n,"termToId",{enumerable:!0,get:function(){return u.termToId}}),n.Util=void 0;var i=p(t("./N3Lexer")),r=p(t("./N3Parser")),s=p(t("./N3Writer")),o=p(t("./N3Store")),a=p(t("./N3StreamParser")),l=p(t("./N3StreamWriter")),c=d(t("./N3Util"));n.Util=c;var u=d(t("./N3DataFactory"));function h(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(h=function(t){return t?n:e})(t)}function d(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=h(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}function p(t){return t&&t.__esModule?t:{default:t}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(t,e,n){var i,r,s=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(n){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(t){i=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],h=!1,d=-1;function p(){!h||!c||(h=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!h){var t=l(p);h=!0;for(var e=u.length;e;){for(c=u,u=[];++d1)for(var n=1;n(n||(n=Promise.resolve())).then(t).catch(t=>setTimeout(()=>{throw t},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(t,e,n){e.exports=t("./lib")},{"./lib":55}],47:[function(t,e,n){"use strict";e.exports=class t{constructor(t,e=new Map,n=0){this.prefix=t,this._existing=e,this.counter=n}clone(){const{prefix:e,_existing:n,counter:i}=this;return new t(e,new Map(n),i)}getId(t){const e=t&&this._existing.get(t);if(e)return e;const n=this.prefix+this.counter;return this.counter++,t&&this._existing.set(t,n),n}hasId(t){return this._existing.has(t)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(t,e,n){"use strict";t("setimmediate");const r=self.crypto||self.msCrypto;e.exports=class{constructor(t){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error(`Unsupport algorithm "${t}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(t){this._content+=t}digest(){var t=this;return i(function*(){const e=(new TextEncoder).encode(t._content),n=new Uint8Array(yield r.subtle.digest(t.algorithm,e));let i="";for(let t=0;t]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class t{static parse(t){const e=[],n={},h=t.split(c.eoln);let p=0;for(const f of h){if(p++,c.empty.test(f))continue;const t=f.match(c.quad);if(null===t)throw new Error("N-Quads parse error on line "+p+".");const h={subject:null,predicate:null,object:null,graph:null};if(h.subject=void 0!==t[1]?{termType:s,value:t[1]}:{termType:o,value:t[2]},h.predicate={termType:s,value:t[3]},void 0!==t[4]?h.object={termType:s,value:t[4]}:void 0!==t[5]?h.object={termType:o,value:t[5]}:(h.object={termType:a,value:void 0,datatype:{termType:s}},void 0!==t[7]?h.object.datatype.value=t[7]:void 0!==t[8]?(h.object.datatype.value=i,h.object.language=t[8]):h.object.datatype.value=r,h.object.value=t[6].replace(d,function(t,e,n,i){if(e)switch(e){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(i)throw new Error("Unsupported U escape")})),h.graph=void 0!==t[9]?{termType:s,value:t[9]}:void 0!==t[10]?{termType:o,value:t[10]}:{termType:l,value:""},h.graph.value in n){let t=!0;const i=n[h.graph.value];for(const e of i)if(u(e,h)){t=!1;break}t&&(i.push(h),e.push(h))}else n[h.graph.value]=[h],e.push(h)}return e}static serialize(e){Array.isArray(e)||(e=t.legacyDatasetToQuads(e));const n=[];for(const i of e)n.push(t.serializeQuad(i));return n.sort().join("")}static serializeQuad(t){const e=t.subject,n=t.object,a=t.graph;let l="";return l+=e.termType===s?`<${e.value}>`:`${e.value}`,l+=` <${t.predicate.value}> `,n.termType===s?l+=`<${n.value}>`:n.termType===o?l+=n.value:(l+=`"${c=n.value,c.replace(h,function(t){switch(t){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,n.datatype.value===i?n.language&&(l+=`@${n.language}`):n.datatype.value!==r&&(l+=`^^<${n.datatype.value}>`)),a.termType===s?l+=` <${a.value}>`:a.termType===o&&(l+=` ${a.value}`),l+=" .\n",l;var c}static legacyDatasetToQuads(t){const e=[],n={"blank node":o,IRI:s,literal:a};for(const c in t)t[c].forEach(t=>{const u={};for(const e in t){const o=t[e],l={termType:n[o.type],value:o.value};l.termType===a&&(l.datatype={termType:s},"datatype"in o&&(l.datatype.value=o.datatype),"language"in o?("datatype"in o||(l.datatype.value=i),l.language=o.language):"datatype"in o||(l.datatype.value=r)),u[e]=l}u.graph="@default"===c?{termType:l,value:""}:{termType:c.startsWith("_:")?o:s,value:c},e.push(u)});return e}};const h=/["\\\n\r]/g;const d=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(t,e,n){"use strict";e.exports=class{constructor(t){this.current=t.sort(),this.done=!1,this.dir=new Map;for(let e=0;ei)&&(a&&o>0&&n>t[o-1]||!a&&ot[o+1])&&(i=n,r=o)}if(null===i)this.done=!0;else{const n=e.get(i)?r-1:r+1;t[r]=t[n],t[n]=i;for(const r of t)r>i&&e.set(r,!e.get(r))}return n}}},{}],51:[function(t,e,n){(function(n){(function(){"use strict";const r=t("./IdentifierIssuer"),s=t("./MessageDigest"),o=t("./Permuter"),a=t("./NQuads");function l(t,e){return t.hashe.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){var e=this;return i(function*(){e.quads=t;for(const r of t)e._addBlankNodeQuadInfo({quad:r,component:r.subject}),e._addBlankNodeQuadInfo({quad:r,component:r.object}),e._addBlankNodeQuadInfo({quad:r,component:r.graph});const n=new Map,i=[...e.blankNodeInfo.keys()];let s=0;for(const t of i)++s%100==0&&(yield e._yield()),yield e._hashAndTrackBlankNode({id:t,hashToBlankNodes:n});const o=[...n.keys()].sort(),c=[];for(const t of o){const i=n.get(t);i.length>1?c.push(i):e.canonicalIssuer.getId(i[0])}for(const t of c){const n=[];for(const i of t){if(e.canonicalIssuer.hasId(i))continue;const t=new r("_:b");t.getId(i);const s=yield e.hashNDegreeQuads(i,t);n.push(s)}n.sort(l);for(const t of n){const n=t.issuer.getOldIds();for(const t of n)e.canonicalIssuer.getId(t)}}const u=[];for(const t of e.quads){const n=bt({},t);n.subject=e._useCanonicalId({component:n.subject}),n.object=e._useCanonicalId({component:n.object}),n.graph=e._useCanonicalId({component:n.graph}),u.push(a.serializeQuad(n))}return u.sort(),u.join("")})()}hashFirstDegreeQuads(t){var e=this;return i(function*(){const n=[],i=e.blankNodeInfo.get(t),r=i.quads;for(const s of r){const i={subject:null,predicate:s.predicate,object:null,graph:null};i.subject=e.modifyFirstDegreeComponent(t,s.subject,"subject"),i.object=e.modifyFirstDegreeComponent(t,s.object,"object"),i.graph=e.modifyFirstDegreeComponent(t,s.graph,"graph"),n.push(a.serializeQuad(i))}n.sort();const o=new s(e.hashAlgorithm);for(const t of n)o.update(t);return i.hash=yield o.digest(),i.hash})()}hashRelatedBlankNode(t,e,n,r){var o=this;return i(function*(){let i;i=o.canonicalIssuer.hasId(t)?o.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):o.blankNodeInfo.get(t).hash;const a=new s(o.hashAlgorithm);return a.update(r),"g"!==r&&a.update(o.getRelatedPredicate(e)),a.update(i),a.digest()})()}hashNDegreeQuads(t,e){var n=this;return i(function*(){const i=new s(n.hashAlgorithm),r=yield n.createHashToRelated(t,e),a=[...r.keys()].sort();for(const t of a){i.update(t);let s,a="";const l=new o(r.get(t));let c=0;for(;l.hasNext();){const t=l.next();++c%3==0&&(yield n._yield());let i=e.clone(),r="";const o=[];let u=!1;for(const e of t)if(n.canonicalIssuer.hasId(e)?r+=n.canonicalIssuer.getId(e):(i.hasId(e)||o.push(e),r+=i.getId(e)),0!==a.length&&r>a){u=!0;break}if(!u){for(const t of o){const e=yield n.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==a.length&&r>a){u=!0;break}}u||(0===a.length||r`}createHashToRelated(t,e){var n=this;return i(function*(){const i=new Map,r=n.blankNodeInfo.get(t).quads;let s=0;for(const o of r)++s%100==0&&(yield n._yield()),yield Promise.all([n._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:t,issuer:e,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:t,issuer:e,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:t,issuer:e,hashToRelated:i})]);return i})()}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){var n=this;return i(function*(){const i=yield n.hashFirstDegreeQuads(t),r=e.get(i);r?r.push(t):e.set(i,[t])})()}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:n,id:r,issuer:s,hashToRelated:o}){var a=this;return i(function*(){if("BlankNode"!==e.termType||e.value===r)return;const i=e.value,l=yield a.hashRelatedBlankNode(i,t,s,n),c=o.get(l);c?c.push(i):o.set(l,[i])})()}_useCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}_yield(){return i(function*(){return new Promise(t=>n(t))})()}}}).call(this)}).call(this,t("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(t,e,n){"use strict";const i=t("./IdentifierIssuer"),r=t("./MessageDigest"),s=t("./Permuter"),o=t("./NQuads");function a(t,e){return t.hashe.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){this.quads=t;for(const i of t)this._addBlankNodeQuadInfo({quad:i,component:i.subject}),this._addBlankNodeQuadInfo({quad:i,component:i.object}),this._addBlankNodeQuadInfo({quad:i,component:i.graph});const e=new Map,n=[...this.blankNodeInfo.keys()];for(const i of n)this._hashAndTrackBlankNode({id:i,hashToBlankNodes:e});const r=[...e.keys()].sort(),s=[];for(const i of r){const t=e.get(i);t.length>1?s.push(t):this.canonicalIssuer.getId(t[0])}for(const o of s){const t=[];for(const e of o){if(this.canonicalIssuer.hasId(e))continue;const n=new i("_:b");n.getId(e);const r=this.hashNDegreeQuads(e,n);t.push(r)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const i of this.quads){const t=bt({},i);t.subject=this._useCanonicalId({component:t.subject}),t.object=this._useCanonicalId({component:t.object}),t.graph=this._useCanonicalId({component:t.graph}),l.push(o.serializeQuad(t))}return l.sort(),l.join("")}hashFirstDegreeQuads(t){const e=[],n=this.blankNodeInfo.get(t),i=n.quads;for(const r of i){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(t,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(t,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(t,r.graph,"graph"),e.push(o.serializeQuad(n))}e.sort();const s=new r(this.hashAlgorithm);for(const r of e)s.update(r);return n.hash=s.digest(),n.hash}hashRelatedBlankNode(t,e,n,i){let s;s=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):this.blankNodeInfo.get(t).hash;const o=new r(this.hashAlgorithm);return o.update(i),"g"!==i&&o.update(this.getRelatedPredicate(e)),o.update(s),o.digest()}hashNDegreeQuads(t,e){const n=new r(this.hashAlgorithm),i=this.createHashToRelated(t,e),o=[...i.keys()].sort();for(const r of o){n.update(r);let t,o="";const a=new s(i.get(r));for(;a.hasNext();){const n=a.next();let i=e.clone(),r="";const s=[];let l=!1;for(const t of n)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(i.hasId(t)||s.push(t),r+=i.getId(t)),0!==o.length&&r>o){l=!0;break}if(!l){for(const t of s){const e=this.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==o.length&&r>o){l=!0;break}}l||(0===o.length||r`}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i)this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:t,issuer:e,hashToRelated:n});return n}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){const n=this.hashFirstDegreeQuads(t),i=e.get(n);i?i.push(t):e.set(n,[t])}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:n,id:i,issuer:r,hashToRelated:s}){if("BlankNode"!==e.termType||e.value===i)return;const o=e.value,a=this.hashRelatedBlankNode(o,t,r,n),l=s.get(a);l?l.push(o):s.set(a,[o])}_useCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(t,e,n){"use strict";const r=t("./URDNA2015");e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){var n=this;return i(function*(){const i=new Map,r=n.blankNodeInfo.get(t).quads;let s=0;for(const o of r){let r,a;if("BlankNode"===o.subject.termType&&o.subject.value!==t)a=o.subject.value,r="p";else{if("BlankNode"!==o.object.termType||o.object.value===t)continue;a=o.object.value,r="r"}++s%100==0&&(yield n._yield());const l=yield n.hashRelatedBlankNode(a,o,e,r),c=i.get(l);c?c.push(a):i.set(l,[a])}return i})()}}},{"./URDNA2015":51}],54:[function(t,e,n){"use strict";const i=t("./URDNA2015Sync");e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i){let i,s;if("BlankNode"===r.subject.termType&&r.subject.value!==t)s=r.subject.value,i="p";else{if("BlankNode"!==r.object.termType||r.object.value===t)continue;s=r.object.value,i="r"}const o=this.hashRelatedBlankNode(s,r,e,i),a=n.get(o);a?a.push(s):n.set(o,[s])}return n}}},{"./URDNA2015Sync":52}],55:[function(t,e,n){"use strict";const r=t("./URDNA2015"),s=t("./URGNA2012"),o=t("./URDNA2015Sync"),a=t("./URGNA2012Sync");let l;try{l=t("rdf-canonize-native")}catch(u){}const c={};e.exports=c,c.NQuads=t("./NQuads"),c.IdentifierIssuer=t("./IdentifierIssuer"),c._rdfCanonizeNative=function(t){return t&&(l=t),l},c.canonize=function(){var t=i(function*(t,e){if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),e.useNative){if(!l)throw new Error("rdf-canonize-native not available");return new Promise((n,i)=>l.canonize(t,e,(t,e)=>t?i(t):n(e)))}if("URDNA2015"===e.algorithm)return new r(e).main(t);if("URGNA2012"===e.algorithm)return new s(e).main(t);throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(e,n){return t.apply(this,arguments)}}(),c._canonizeSync=function(t,e){if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),e.useNative){if(l)return l.canonizeSync(t,e);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===e.algorithm)return new o(e).main(t);if("URGNA2012"===e.algorithm)return new a(e).main(t);throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(t("./lib/BlankNode"),n),r(t("./lib/DataFactory"),n),r(t("./lib/DefaultGraph"),n),r(t("./lib/Literal"),n),r(t("./lib/NamedNode"),n),r(t("./lib/Quad"),n),r(t("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0;n.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&"BlankNode"===t.termType&&t.value===this.value}}},{}],58:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;const i=t("./BlankNode"),r=t("./DefaultGraph"),s=t("./Literal"),o=t("./NamedNode"),a=t("./Quad"),l=t("./Variable");let c=0;n.DataFactory=class{constructor(t){this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||`df_${c++}_`}namedNode(t){return new o.NamedNode(t)}blankNode(t){return new i.BlankNode(t||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(t,e){return new s.Literal(t,e)}variable(t){return new l.Variable(t)}defaultGraph(){return r.DefaultGraph.INSTANCE}quad(t,e,n,i){return new a.Quad(t,e,n,i||this.defaultGraph())}fromTerm(t){switch(t.termType){case"NamedNode":return this.namedNode(t.value);case"BlankNode":return this.blankNode(t.value);case"Literal":return t.language?this.literal(t.value,t.language):t.datatype.equals(s.Literal.XSD_STRING)?this.literal(t.value):this.literal(t.value,this.fromTerm(t.datatype));case"Variable":return this.variable(t.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(t.subject),this.fromTerm(t.predicate),this.fromTerm(t.object),this.fromTerm(t.graph))}}fromQuad(t){return this.fromTerm(t)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;class i{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&"DefaultGraph"===t.termType}}n.DefaultGraph=i,i.INSTANCE=new i},{}],60:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;const i=t("./NamedNode");class r{constructor(t,e){this.termType="Literal",this.value=t,"string"==typeof e?(this.language=e,this.datatype=r.RDF_LANGUAGE_STRING):e?(this.language="",this.datatype=e):(this.language="",this.datatype=r.XSD_STRING)}equals(t){return!!t&&"Literal"===t.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}n.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0;n.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&"NamedNode"===t.termType&&t.value===this.value}}},{}],62:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0;n.Quad=class{constructor(t,e,n,i){this.termType="Quad",this.value="",this.subject=t,this.predicate=e,this.object=n,this.graph=i}equals(t){return!!t&&("Quad"===t.termType||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},{}],63:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0;n.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&"Variable"===t.termType&&t.value===this.value}}},{}],64:[function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(t("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;class i extends Error{constructor(t,e){const n=t.saxStream._parser;super(t.trackPosition?`Line ${n.line+1} column ${n.column+1}: ${e}`:e)}}n.ParseError=i},{}],66:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;const i=t("relative-to-absolute-iri"),r=t("sax"),s=t("stream"),o=t("./ParseError"),a=t("rdf-data-factory");class l extends s.Transform{constructor(t){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},t&&(Object.assign(this,t),this.options=t),this.dataFactory||(this.dataFactory=new a.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=r.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(t,e){const n={};let i=!1;for(const s in t.attributes)s.startsWith("xmlns")&&(5===s.length?(i=!0,n[""]=t.attributes[s]):":"===s.charAt(5)&&(i=!0,n[s.substr(6)]=t.attributes[s]));const r=e&&e.ns?e.ns:[l.DEFAULT_NS];return i?r.concat([n]):r}static expandPrefixedTerm(t,e,n){const i=t.indexOf(":");let r,s;i>=0?(r=t.substr(0,i),s=t.substr(i+1)):(r="",s=t);let a=null,l=null;for(let o=e.length-1;o>=0;o--){const t=e[o][r];if(t){a=t;break}l||(l=e[o][""])}if(!a){if(r&&"xmlns"!==r)throw new o.ParseError(n,`The prefix '${r}' in term '${t}' was not bound.`);a=l||""}return{prefix:r,local:s,uri:a}}static isValidIri(t){return l.IRI_REGEX.test(t)}import(t){const e=new s.PassThrough({readableObjectMode:!0});t.on("error",t=>n.emit("error",t)),t.on("data",t=>e.push(t)),t.on("end",()=>e.push(null));const n=e.pipe(new l(this.options));return n}_transform(t,e,n){try{this.saxStream.write(t,e)}catch(i){return n(i)}n()}newParseError(t){return new o.ParseError(this,t)}valueToUri(t,e){return this.uriToNamedNode(i.resolve(t,e.baseIRI))}uriToNamedNode(t){if(!l.isValidIri(t))throw this.newParseError(`Invalid URI: ${t}`);return this.dataFactory.namedNode(t)}validateNcname(t){if(!l.NCNAME_MATCHER.test(t))throw this.newParseError(`Not a valid NCName: ${t}`)}attachSaxListeners(){this.saxStream.on("error",t=>this.emit("error",t)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(t){const e=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let n=c.RESOURCE;if(e&&(e.hadChildren=!0,n=e.childrenParseType),e&&e.childrenStringTags){const n=t.name;let i="";for(const e in t.attributes)i+=` ${e}="${t.attributes[e]}"`;e.childrenStringTags.push(`<${n}${i}>`);const r={childrenStringTags:e.childrenStringTags};return r.childrenStringEmitClosingTag=``,void this.activeTagStack.push(r)}const i={};e?(i.language=e.language,i.baseIRI=e.baseIRI):i.baseIRI=this.baseIRI,this.activeTagStack.push(i),i.ns=l.parseNamespace(t,e),n===c.RESOURCE?this.onTagResource(t,i,e,!e):this.onTagProperty(t,i,e)}onTagResource(t,e,n,r){const s=l.expandPrefixedTerm(t.name,e.ns,this);e.childrenParseType=c.PROPERTY;let o=!0;if(s.uri===l.RDF){if(!r&&l.FORBIDDEN_NODE_ELEMENTS.indexOf(s.local)>=0)throw this.newParseError(`Illegal node element name: ${s.local}`);switch(s.local){case"RDF":e.childrenParseType=c.RESOURCE;case"Description":o=!1}}const a=[],u=[];let h=null,d=!1,p=!1,f=null;for(const c in t.attributes){const r=t.attributes[c],s=l.expandPrefixedTerm(c,e.ns,this);if(n&&s.uri===l.RDF)switch(s.local){case"about":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);h=r;continue;case"ID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);this.validateNcname(r),h="#"+r,d=!0;continue;case"nodeID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);this.validateNcname(r),h=r,p=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":f=r;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(s.uri===l.XML){if("lang"===s.local){e.language=""===r?null:r.toLowerCase();continue}if("base"===s.local){e.baseIRI=i.resolve(r,e.baseIRI);continue}}"xml"!==s.prefix&&s.uri&&(a.push(this.uriToNamedNode(s.uri+s.local)),u.push(r))}if(null!==h&&(e.subject=p?this.dataFactory.blankNode(h):this.valueToUri(h,e),d&&this.claimNodeId(e.subject)),e.subject||(e.subject=this.dataFactory.blankNode()),o){const t=this.uriToNamedNode(s.uri+s.local);this.emitTriple(e.subject,this.dataFactory.namedNode(l.RDF+"type"),t,n?n.reifiedStatementId:null)}if(n){if(n.predicate)if(n.childrenCollectionSubject){const t=this.dataFactory.blankNode();this.emitTriple(n.childrenCollectionSubject,n.childrenCollectionPredicate,t,n.reifiedStatementId),this.emitTriple(t,this.dataFactory.namedNode(l.RDF+"first"),e.subject,e.reifiedStatementId),n.childrenCollectionSubject=t,n.childrenCollectionPredicate=this.dataFactory.namedNode(l.RDF+"rest")}else{this.emitTriple(n.subject,n.predicate,e.subject,n.reifiedStatementId);for(let t=0;t=0)throw this.newParseError(`Illegal property element name: ${i.local}`);e.predicateSubPredicates=[],e.predicateSubObjects=[];let r=!1,s=!1,o=null,a=!0;const u=[],h=[];for(const d in t.attributes){const n=t.attributes[d],i=l.expandPrefixedTerm(d,e.ns,this);if(i.uri===l.RDF)switch(i.local){case"resource":if(o)throw this.newParseError(`Found both rdf:resource (${n}) and rdf:nodeID (${o}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${n})`);e.hadChildren=!0,o=n,a=!1;continue;case"datatype":if(s)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${n}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${n})`);e.datatype=this.valueToUri(n,e);continue;case"nodeID":if(s)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${n}).`);if(e.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${n}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${n})`);this.validateNcname(n),e.hadChildren=!0,o=n,a=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(s)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(e.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${e.datatype.value})`);if(o)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${o})`);if("Resource"===n){r=!0,e.childrenParseType=c.PROPERTY;const t=this.dataFactory.blankNode();this.emitTriple(e.subject,e.predicate,t,e.reifiedStatementId),e.subject=t,e.predicate=null}else"Collection"===n?(r=!0,e.hadChildren=!0,e.childrenCollectionSubject=e.subject,e.childrenCollectionPredicate=e.predicate,a=!1):"Literal"===n&&(r=!0,e.childrenTagsToString=!0,e.childrenStringTags=[]);continue;case"ID":this.validateNcname(n),e.reifiedStatementId=this.valueToUri("#"+n,e),this.claimNodeId(e.reifiedStatementId);continue}else if(i.uri===l.XML&&"lang"===i.local){e.language=""===n?null:n.toLowerCase();continue}if("xml"!==i.prefix&&"xmlns"!==i.prefix&&i.uri){if(r||e.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${n}`);e.hadChildren=!0,s=!0,u.push(this.uriToNamedNode(i.uri+i.local)),h.push(this.dataFactory.literal(n,e.datatype||e.language))}}if(null!==o){const t=e.subject;e.subject=a?this.dataFactory.blankNode(o):this.valueToUri(o,e),this.emitTriple(t,e.predicate,e.subject,e.reifiedStatementId);for(let n=0;n/g,(t,e,n)=>(this.saxStream._parser.ENTITIES[e]=n,""))}}var c,u;n.RdfXmlParser=l,l.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,l.MIME_TYPE="application/rdf+xml",l.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",l.XML="http://www.w3.org/XML/1998/namespace",l.XMLNS="http://www.w3.org/2000/xmlns/",l.DEFAULT_NS={xml:l.XML},l.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],l.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],l.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,(u=c=n.ParseType||(n.ParseType={}))[u.RESOURCE=0]="RESOURCE",u[u.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(t,e,n){"use strict";var i={};function r(t,e,n){n||(n=Error);var r=function(t){function n(n,i,r){return t.call(this,function(t,n,i){return"string"==typeof e?e:e(t,n,i)}(n,i,r))||this}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(n,t),n}(n);r.prototype.name=n.name,r.prototype.code=t,i[t]=r}function s(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map(function(t){return String(t)}),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,n){var i,r;if("string"==typeof e&&function(t,e,n){return t.substr(!n||n<0?0:+n,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))r="The ".concat(t," ").concat(i," ").concat(s(e,"type"));else{var o=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";r='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(s(e,"type"))}return r+". Received type ".concat(typeof n)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},{}],68:[function(t,e,n){(function(n){(function(){"use strict";var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};e.exports=c;var r=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(c,r);for(var o=i(s.prototype),a=0;a0)if("string"!=typeof e&&!o.objectMode&&Object.getPrototypeOf(e)!==a.prototype&&(e=function(t){return a.from(t)}(e)),i)o.endEmitted?x(t,new w):T(t,o,e,!0);else if(o.ended)x(t,new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(e=o.decoder.write(e),o.objectMode||0!==e.length?T(t,o,e,!1):M(t,o)):T(t,o,e,!1)}else i||(o.reading=!1,M(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(I,t))}function I(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,j(t)}function M(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(D,t,e))}function D(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){c("readable nexttick read 0"),t.read(0)}function L(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(V,e,t))}function V(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function z(t,e){for(var n=0,i=t.length;n=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):P(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&B(this),null;var i,r=e.needReadable;return c("need readable",r),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&B(this)),null!==i&&this.emit("data",i),i},C.prototype._read=function(t){x(this,new _("_read()"))},C.prototype.pipe=function(t,e){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,c("pipe count=%d opts=%j",r.pipesCount,e);var o=e&&!1===e.end||t===n.stdout||t===n.stderr?m:l;function a(e,n){c("onunpipe"),e===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),t.removeListener("close",f),t.removeListener("finish",g),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",m),i.removeListener("data",d),h=!0,r.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u())}function l(){c("onend"),t.end()}r.endEmitted?n.nextTick(o):i.once("end",o),t.on("unpipe",a);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,j(t))}}(i);t.on("drain",u);var h=!1;function d(e){c("ondata");var n=t.write(e);c("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==z(r.pipes,t))&&!h&&(c("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function p(e){c("onerror",e),m(),t.removeListener("error",p),0===s(t,"error")&&x(t,e)}function f(){t.removeListener("finish",g),m()}function g(){c("onfinish"),t.removeListener("close",f),m()}function m(){c("unpipe"),i.unpipe(t)}return i.on("data",d),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",p),t.once("close",f),t.once("finish",g),t.emit("pipe",i),r.flowing||(c("pipe resume"),i.resume()),t},C.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var i=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s0,!1!==r.flowing&&this.resume()):"readable"===t&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,c("on readable",r.length,r.reading),r.length?P(this):r.reading||n.nextTick(N,this)),i},C.prototype.removeListener=function(t,e){var i=o.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(R,this),i},C.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.nextTick(R,this),e},C.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(L,t,e))}(this,t)),t.paused=!1,this},C.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(t){var e=this,n=this._readableState,i=!1;for(var r in t.on("end",function(){if(c("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(r){c("wrapped data"),n.decoder&&(r=n.decoder.write(r)),n.objectMode&&null==r||!(n.objectMode||r&&r.length)||e.push(r)||(i=!0,t.pause())}),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));for(var s=0;s-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(t,e,n){n(new g("_write()"))},C.prototype._writev=null,C.prototype.end=function(t,e,i){var r=this._writableState;return"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,i){e.ending=!0,M(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i)),e.ended=!0,t.writable=!1}(this,r,i),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){!this._writableState||(this._writableState.destroyed=t)}}),C.prototype.destroy=h.destroy,C.prototype._undestroy=h.undestroy,C.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(t,e,n){(function(n){(function(){"use strict";var i;function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=t("./end-of-stream"),o=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function f(t){var e=t[o];if(null!==e){var n=t[d].read();null!==n&&(t[u]=null,t[o]=null,t[a]=null,e(p(n,!1)))}}function g(t){n.nextTick(f,t)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((r(i={get stream(){return this[d]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(e,i){n.nextTick(function(){t[l]?i(t[l]):e(p(void 0,!0))})});var i,r=this[u];if(r)i=new Promise(function(t,e){return function(n,i){t.then(function(){e[c]?n(p(void 0,!0)):e[h](n,i)},i)}}(r,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(p(s,!1));i=new Promise(this[h])}return this[u]=i,i}},Symbol.asyncIterator,function(){return this}),r(i,"return",function(){var t=this;return new Promise(function(e,n){t[d].destroy(null,function(t){t?n(t):e(p(void 0,!0))})})}),i),m);e.exports=function(t){var e,n=Object.create(b,(r(e={},d,{value:t,writable:!0}),r(e,o,{value:null,writable:!0}),r(e,a,{value:null,writable:!0}),r(e,l,{value:null,writable:!0}),r(e,c,{value:t._readableState.endEmitted,writable:!0}),r(e,h,{value:function(t,e){var i=n[d].read();i?(n[u]=null,n[o]=null,n[a]=null,t(p(i,!1))):(n[o]=t,n[a]=e)},writable:!0}),e));return n[u]=null,s(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[a];return null!==e&&(n[u]=null,n[o]=null,n[a]=null,e(t)),void(n[l]=t)}var i=n[o];null!==i&&(n[u]=null,n[o]=null,n[a]=null,i(p(void 0,!0))),n[c]=!0}),t.on("readable",g.bind(null,n)),n}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":76,_process:44}],74:[function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){for(var n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e=o.allocUnsafe(t>>>0),n=this.head,i=0;n;)c(n.data,e,i),i+=n.data.length,n=n.next;return e}},{key:"consume",value:function(t,e){var n;return tr.length?r.length:t;if(i+=s===r.length?r:r.slice(0,t),0==(t-=s)){s===r.length?(++n,this.head=e.next?e.next:this.tail=null):(this.head=e,e.data=r.slice(s));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),n=this.head,i=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var r=n.data,s=t>r.length?r.length:t;if(r.copy(e,e.length-t,0,s),0==(t-=s)){s===r.length?(++i,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=r.slice(s));break}++i}return this.length-=i,e}},{key:l,value:function(t,e){return a(this,function(t){for(var e=1;e0,function(t){r||(r=t),t&&o.forEach(c),!s&&(o.forEach(c),i(r))})});return e.reduce(u)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(t,e,n){"use strict";var i=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,r){var s=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,r,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(r?n:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},{"../../../errors":67}],80:[function(t,e,n){e.exports=t("events").EventEmitter},{events:8}],81:[function(t,e,n){(n=e.exports=t("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=t("./lib/_stream_writable.js"),n.Duplex=t("./lib/_stream_duplex.js"),n.Transform=t("./lib/_stream_transform.js"),n.PassThrough=t("./lib/_stream_passthrough.js"),n.finished=t("./lib/internal/streams/end-of-stream.js"),n.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}(t("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(t,e,n){"use strict";function i(t){const e=[];let n=0;for(;nt.join("")).join("/")}function r(t,e){let n=e+1;e>=0?"/"===t[e+1]&&"/"===t[e+2]&&(n=e+3):"/"===t[0]&&"/"===t[1]&&(n=2);const r=t.indexOf("/",n);return r<0?t:t.substr(0,r)+i(t.substr(r))}function s(t){return!t||"#"===t||"?"===t||"/"===t}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(t,e){const n=(e=e||"").indexOf("#");if(n>0&&(e=e.substr(0,n)),!t.length){if(e.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);return e}if(t.startsWith("?")){const n=e.indexOf("?");return n>0&&(e=e.substr(0,n)),e+t}if(t.startsWith("#"))return e+t;if(!e.length){const e=t.indexOf(":");if(e<0)throw new Error(`Found invalid relative IRI '${t}' for a missing baseIRI`);return r(t,e)}const s=t.indexOf(":");if(s>=0)return r(t,s);const o=e.indexOf(":");if(o<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);const a=e.substr(0,o+1);if(0===t.indexOf("//"))return a+r(t,s);let l;if(e.indexOf("//",o)===o+1){if(l=e.indexOf("/",o+3),l<0)return e.length>o+3?e+"/"+r(t,s):a+r(t,s)}else if(l=e.indexOf("/",o+1),l<0)return a+r(t,s);if(0===t.indexOf("/"))return e.substr(0,l)+i(t);let c=e.substr(l);const u=c.lastIndexOf("/");return u>=0&&u"===s?(O(e,"onsgmldeclaration",e.sgmlDecl),e.sgmlDecl="",e.state=S.TEXT):(m(s)&&(e.state=S.SGML_DECL_QUOTED),e.sgmlDecl+=s);continue;case S.SGML_DECL_QUOTED:s===e.q&&(e.state=S.SGML_DECL,e.q=""),e.sgmlDecl+=s;continue;case S.DOCTYPE:">"===s?(e.state=S.TEXT,O(e,"ondoctype",e.doctype),e.doctype=!0):(e.doctype+=s,"["===s?e.state=S.DOCTYPE_DTD:m(s)&&(e.state=S.DOCTYPE_QUOTED,e.q=s));continue;case S.DOCTYPE_QUOTED:e.doctype+=s,s===e.q&&(e.q="",e.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:e.doctype+=s,"]"===s?e.state=S.DOCTYPE:m(s)&&(e.state=S.DOCTYPE_DTD_QUOTED,e.q=s);continue;case S.DOCTYPE_DTD_QUOTED:e.doctype+=s,s===e.q&&(e.state=S.DOCTYPE_DTD,e.q="");continue;case S.COMMENT:"-"===s?e.state=S.COMMENT_ENDING:e.comment+=s;continue;case S.COMMENT_ENDING:"-"===s?(e.state=S.COMMENT_ENDED,e.comment=k(e.opt,e.comment),e.comment&&O(e,"oncomment",e.comment),e.comment=""):(e.comment+="-"+s,e.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==s?(I(e,"Malformed comment"),e.comment+="--"+s,e.state=S.COMMENT):e.state=S.TEXT;continue;case S.CDATA:"]"===s?e.state=S.CDATA_ENDING:e.cdata+=s;continue;case S.CDATA_ENDING:"]"===s?e.state=S.CDATA_ENDING_2:(e.cdata+="]"+s,e.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===s?(e.cdata&&O(e,"oncdata",e.cdata),O(e,"onclosecdata"),e.cdata="",e.state=S.TEXT):"]"===s?e.cdata+="]":(e.cdata+="]]"+s,e.state=S.CDATA);continue;case S.PROC_INST:"?"===s?e.state=S.PROC_INST_ENDING:g(s)?e.state=S.PROC_INST_BODY:e.procInstName+=s;continue;case S.PROC_INST_BODY:if(!e.procInstBody&&g(s))continue;"?"===s?e.state=S.PROC_INST_ENDING:e.procInstBody+=s;continue;case S.PROC_INST_ENDING:">"===s?(O(e,"onprocessinginstruction",{name:e.procInstName,body:e.procInstBody}),e.procInstName=e.procInstBody="",e.state=S.TEXT):(e.procInstBody+="?"+s,e.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:y(d,s)?e.tagName+=s:(M(e),">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:(g(s)||I(e,"Invalid character in tag name"),e.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===s?(N(e,!0),L(e)):(I(e,"Forward-slash in opening tag not followed by >"),e.state=S.ATTRIB);continue;case S.ATTRIB:if(g(s))continue;">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:y(h,s)?(e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):I(e,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===s?e.state=S.ATTRIB_VALUE:">"===s?(I(e,"Attribute without value"),e.attribValue=e.attribName,R(e),N(e)):g(s)?e.state=S.ATTRIB_NAME_SAW_WHITE:y(d,s)?e.attribName+=s:I(e,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===s)e.state=S.ATTRIB_VALUE;else{if(g(s))continue;I(e,"Attribute without value"),e.tag.attributes[e.attribName]="",e.attribValue="",O(e,"onattribute",{name:e.attribName,value:""}),e.attribName="",">"===s?N(e):y(h,s)?(e.attribName=s,e.state=S.ATTRIB_NAME):(I(e,"Invalid attribute name"),e.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(g(s))continue;m(s)?(e.q=s,e.state=S.ATTRIB_VALUE_QUOTED):(I(e,"Unquoted attribute value"),e.state=S.ATTRIB_VALUE_UNQUOTED,e.attribValue=s);continue;case S.ATTRIB_VALUE_QUOTED:if(s!==e.q){"&"===s?e.state=S.ATTRIB_VALUE_ENTITY_Q:e.attribValue+=s;continue}R(e),e.q="",e.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:g(s)?e.state=S.ATTRIB:">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:y(h,s)?(I(e,"No whitespace between attributes"),e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):I(e,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!b(s)){"&"===s?e.state=S.ATTRIB_VALUE_ENTITY_U:e.attribValue+=s;continue}R(e),">"===s?N(e):e.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(e.tagName)">"===s?L(e):y(d,s)?e.tagName+=s:e.script?(e.script+=""===s?L(e):I(e,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var a,l;switch(e.state){case S.TEXT_ENTITY:a=S.TEXT,l="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:a=S.ATTRIB_VALUE_QUOTED,l="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:a=S.ATTRIB_VALUE_UNQUOTED,l="attribValue"}";"===s?(e[l]+=j(e),e.entity="",e.state=a):y(e.entity.length?f:p,s)?e.entity+=s:(I(e,"Invalid character in entity name"),e[l]+="&"+e.entity+s,e.entity="",e.state=a);continue;default:throw new Error(e,"Unknown state: "+e.state)}return e.position>=e.bufferCheckPosition&&function(t){for(var e=Math.max(n.MAX_BUFFER_LENGTH,10),i=0,s=0,o=r.length;se)switch(r[s]){case"textNode":T(t);break;case"cdata":O(t,"oncdata",t.cdata),t.cdata="";break;case"script":O(t,"onscript",t.script),t.script="";break;default:A(t,"Max buffer length exceeded: "+r[s])}i=Math.max(i,a)}t.bufferCheckPosition=n.MAX_BUFFER_LENGTH-i+t.position}(e),e},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(t){T(t),""!==t.cdata&&(O(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(O(t,"onscript",t.script),t.script="")}(this)}};try{i=t("stream").Stream}catch(_){i=function(){}}var o=n.EVENTS.filter(function(t){return"error"!==t&&"end"!==t});function a(t,e){if(!(this instanceof a))return new a(t,e);i.apply(this),this._parser=new s(t,e),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(t){n.emit("error",t),n._parser.error=null},this._decoder=null,o.forEach(function(t){Object.defineProperty(n,"on"+t,{get:function(){return n._parser["on"+t]},set:function(e){if(!e)return n.removeAllListeners(t),n._parser["on"+t]=e,e;n.on(t,e)},enumerable:!0,configurable:!1})})}(a.prototype=Object.create(i.prototype,{constructor:{value:a}})).write=function(n){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(n)){if(!this._decoder){var i=t("string_decoder").StringDecoder;this._decoder=new i("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},a.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},a.prototype.on=function(t,e){var n=this;return!n._parser["on"+t]&&-1!==o.indexOf(t)&&(n._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),n.emit.apply(n,e)}),i.prototype.on.call(n,t,e)};var l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",u={xml:l,xmlns:c},h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function m(t){return'"'===t||"'"===t}function b(t){return">"===t||g(t)}function y(t,e){return t.test(e)}function v(t,e){return!y(t,e)}var _,w,x,S=0;for(var E in n.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(t){var e=n.ENTITIES[t],i="number"==typeof e?String.fromCharCode(e):e;n.ENTITIES[t]=i}),n.STATE)n.STATE[n.STATE[E]]=E;function C(t,e,n){t[e]&&t[e](n)}function O(t,e,n){t.textNode&&T(t),C(t,e,n)}function T(t){t.textNode=k(t.opt,t.textNode),t.textNode&&C(t,"ontext",t.textNode),t.textNode=""}function k(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function A(t,e){return T(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,C(t,"onerror",e),t}function P(t){return t.sawRoot&&!t.closedRoot&&I(t,"Unclosed root tag"),t.state!==S.BEGIN&&t.state!==S.BEGIN_WHITESPACE&&t.state!==S.TEXT&&A(t,"Unexpected end"),T(t),t.c="",t.closed=!0,C(t,"onend"),s.call(t,t.strict,t.opt),t}function I(t,e){if("object"!=typeof t||!(t instanceof s))throw new Error("bad call to strictFail");t.strict&&A(t,e)}function M(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,O(t,"onopentagstart",n)}function D(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),i=n[0],r=n[1];return e&&"xmlns"===t&&(i="xmlns",r=""),{prefix:i,local:r}}function R(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=D(t.attribName,!0),n=e.local;if("xmlns"===e.prefix)if("xml"===n&&t.attribValue!==l)I(t,"xml: prefix must be bound to "+l+"\nActual: "+t.attribValue);else if("xmlns"===n&&t.attribValue!==c)I(t,"xmlns: prefix must be bound to "+c+"\nActual: "+t.attribValue);else{var i=t.tag,r=t.tags[t.tags.length-1]||t;i.ns===r.ns&&(i.ns=Object.create(r.ns)),i.ns[n]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,O(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function N(t,e){if(t.opt.xmlns){var n=t.tag,i=D(t.tagName);n.prefix=i.prefix,n.local=i.local,n.uri=n.ns[i.prefix]||"",n.prefix&&!n.uri&&(I(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=i.prefix),n.ns&&(t.tags[t.tags.length-1]||t).ns!==n.ns&&Object.keys(n.ns).forEach(function(e){O(t,"onopennamespace",{prefix:e,uri:n.ns[e]})});for(var r=0,s=t.attribList.length;r",t.tagName="",void(t.state=S.SCRIPT);O(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var i=n;e--&&t.tags[e].name!==i;)I(t,"Unexpected close tag");if(e<0)return I(t,"Unmatched closing tag: "+t.tagName),t.textNode+="",void(t.state=S.TEXT);t.tagName=n;for(var r=t.tags.length;r-- >e;){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,O(t,"onclosetag",t.tagName);var o={};for(var a in s.ns)o[a]=s.ns[a];t.opt.xmlns&&s.ns!==(t.tags[t.tags.length-1]||t).ns&&Object.keys(s.ns).forEach(function(e){O(t,"onclosenamespace",{prefix:e,uri:s.ns[e]})})}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=S.TEXT}function j(t){var e,n=t.entity,i=n.toLowerCase(),r="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[i]?t.ENTITIES[i]:("#"===(n=i).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),r=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),r=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(e)||r.toLowerCase()!==n?(I(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function F(t,e){"<"===e?(t.state=S.OPEN_WAKA,t.startTagPosition=t.position):g(e)||(I(t,"Non-whitespace before first tag."),t.textNode=e,t.state=S.TEXT)}function B(t,e){var n="";return e1114111||w(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?e.push(s):e.push(55296+((s-=65536)>>10),s%1024+56320),(n+1===i||e.length>t)&&(r+=_.apply(null,e),e.length=0)}return r},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:x,configurable:!0,writable:!0}):String.fromCodePoint=x)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,t("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(t,e,n){(function(t,e){(function(){!function(e,n){"use strict";if(!e.setImmediate){var i,r=1,s={},o=!1,a=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick(function(){d(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(c="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(c)&&d(+t.data.slice(c.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),i=function(t){e.postMessage(c+t,"*")}):e.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){d(t.data)},i=function(e){t.port2.postMessage(e)}}():a&&"onreadystatechange"in a.createElement("script")?function(){var t=a.documentElement;i=function(e){var n=a.createElement("script");n.onreadystatechange=function(){d(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():i=function(t){setTimeout(d,0,t)},l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n.setImmediate="function"==typeof e?e:function(t){var e=l++,i=!(arguments.length<2)&&o.call(arguments,1);return a[e]=!0,r(function(){a[e]&&(i?t.apply(null,i):t.call(null),n.clearImmediate(e))}),e},n.clearImmediate="function"==typeof i?i:function(t){delete a[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(t,e,n){(function(t){(function(){function n(e){try{if(!t.localStorage)return!1}catch(i){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(t,e,n){"use strict";e.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},{}],92:[function(t,e,n){"use strict";function i(t){var e=this;if(e instanceof i||(e=new i),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach(function(t){e.push(t)});else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=t(n,i.value,r),i=i.next;return n},i.prototype.reduceReverse=function(t,e){var n,i=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=t(n,i.value,r),i=i.prev;return n},i.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},i.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},i.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new i;if(ethis.length&&(e=this.length);for(var r=0,s=this.head;null!==s&&rthis.length&&(e=this.length);for(var r=this.length,s=this.tail;null!==s&&r>e;r--)s=s.prev;for(;null!==s&&r>t;r--,s=s.prev)n.push(s.value);return n},i.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,s=this.head;null!==s&&i{return(t=n||(n={})).typeOfFunction="function",t.boolTrue=!0,n;var t})();function i(t,e,i){if(!i||typeof i.value!==n.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:n.boolTrue,get:function(){var t=i.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:n.boolTrue,writable:n.boolTrue}),t}}}e.ak=i,e.ZP=i},97266:function(t,e,n){t.exports={ResizeSensor:n(69835),ElementQueries:n(54845)}},54845:function(t,e,n){"use strict";var i,r,s;"undefined"!=typeof window&&window,r=[n(69835)],void 0!==(s="function"==typeof(i=function(t){var e=function(){var e,n={},i=[];function r(t){t||(t=document.documentElement);var e=window.getComputedStyle(t,null).fontSize;return parseFloat(e)||16}function s(t,e){var n=e.split(/\d/),i=n[n.length-1];switch(e=parseFloat(e),i){case"px":return e;case"em":return e*r(t);case"rem":return e*r();case"vw":return e*document.documentElement.clientWidth/100;case"vh":return e*document.documentElement.clientHeight/100;case"vmin":case"vmax":var s=document.documentElement.clientWidth/100,o=document.documentElement.clientHeight/100;return e*(0,Math["vmin"===i?"min":"max"])(s,o);default:return e}}function o(t,e){this.element=t;var i,r,o,a,l,c,u,h,d=["min-width","min-height","max-width","max-height"];this.call=function(){for(i in o=function(t){if(!t.getBoundingClientRect)return{width:t.offsetWidth,height:t.offsetHeight};var e=t.getBoundingClientRect();return{width:Math.round(e.width),height:Math.round(e.height)}}(this.element),c={},n[e])!n[e].hasOwnProperty(i)||(a=s(this.element,(r=n[e][i]).value),l="width"===r.property?o.width:o.height,u="","min"===r.mode&&l>=a&&(u+=r.value),"max"===r.mode&&l<=a&&(u+=r.value),c[h=r.mode+"-"+r.property]||(c[h]=""),u&&-1===(" "+c[h]+" ").indexOf(" "+u+" ")&&(c[h]+=" "+u));for(var t in d)!d.hasOwnProperty(t)||(c[d[t]]?this.element.setAttribute(d[t],c[d[t]].substr(1)):this.element.removeAttribute(d[t]))}}function a(e,n){e.elementQueriesSetupInformation||(e.elementQueriesSetupInformation=new o(e,n)),e.elementQueriesSensor||(e.elementQueriesSensor=new t(e,function(){e.elementQueriesSetupInformation.call()}))}function l(t,r,s,o){if(void 0===n[t]){n[t]=[];var a=i.length;e.innerHTML+="\n"+t+" {animation: 0.1s element-queries;}",e.innerHTML+="\n"+t+" > .resize-sensor {min-width: "+a+"px;}",i.push(t)}n[t].push({mode:r,property:s,value:o})}function c(t){var e;if(document.querySelectorAll&&(e=t?t.querySelectorAll.bind(t):document.querySelectorAll.bind(document)),!e&&"undefined"!=typeof $$&&(e=$$),!e&&"undefined"!=typeof jQuery&&(e=jQuery),!e)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return e}function u(e){var n=[],i=[],r=[],s=0,o=-1,a=[];for(var l in e.children)if(e.children.hasOwnProperty(l)&&e.children[l].tagName&&"img"===e.children[l].tagName.toLowerCase()){n.push(e.children[l]);var c=e.children[l].getAttribute("min-width")||e.children[l].getAttribute("data-min-width"),u=e.children[l].getAttribute("data-src")||e.children[l].getAttribute("url");r.push(u),i.push({minWidth:c}),c?e.children[l].style.display="none":(s=n.length-1,e.children[l].style.display="block")}function h(){var t,l=!1;for(t in n)!n.hasOwnProperty(t)||i[t].minWidth&&e.offsetWidth>i[t].minWidth&&(l=t);if(l||(l=s),o!==l)if(a[l])n[o].style.display="none",n[l].style.display="block",o=l;else{var c=new Image;c.onload=function(){n[l].src=r[l],n[o].style.display="none",n[l].style.display="block",a[l]=!0,o=l},c.src=r[l]}else n[l].src=r[l]}o=s,e.resizeSensorInstance=new t(e,h),h()}var h=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,d=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function p(t){var e,n,i,r;for(t=t.replace(/'/g,'"');null!==(e=h.exec(t));)for(n=e[1]+e[3],i=e[2];null!==(r=d.exec(i));)l(n,r[1],r[2],r[3])}function f(t){var e="";if(t)if("string"==typeof t)(-1!==(t=t.toLowerCase()).indexOf("min-width")||-1!==t.indexOf("max-width"))&&p(t);else for(var n=0,i=t.length;n img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",e.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(e),g=!0);for(var r=0,s=document.styleSheets.length;r0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,console&&console.warn&&console.warn(a)}return t}function O(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function T(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=O.bind(i);return r.listener=n,i.wrapFn=r,r}function k(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=r[t];if(void 0===a)return!1;if("function"==typeof a)v(a,this,e);else{var l=a.length,c=P(a,l);for(n=0;n=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},w.prototype.listeners=function(t){return k(this,t,!0)},w.prototype.rawListeners=function(t){return k(this,t,!1)},w.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):A.call(t,e)},w.prototype.listenerCount=A,w.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]},M.prototype.next=function(){if(this.done)return{done:!0};var t=this._next();return t.done&&(this.done=!0),t},"undefined"!=typeof Symbol&&(M.prototype[Symbol.iterator]=function(){return this}),M.of=function(){var t=arguments,e=t.length,n=0;return new M(function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}})},M.empty=function(){var t=new M(null);return t.done=!0,t},M.is=function(t){return t instanceof M||"object"==typeof t&&null!==t&&"function"==typeof t.next};var D=M,R=function(t,e){for(var n,i=arguments.length>1?e:1/0,r=i!==1/0?new Array(i):[],s=0;;){if(s===i)return r;if((n=t.next()).done)return s!==e?r.slice(0,s):r;r[s++]=n.value}},N=function(t){function n(e,n){var i;return(i=t.call(this)||this).name="GraphError",i.message=e||"",i.data=n||{},i}return e(n,t),n}(o(Error)),L=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N),j=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N),F=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N);function B(t,e){this.key=t,this.attributes=e,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function V(t,e){this.key=t,this.attributes=e,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function z(t,e){this.key=t,this.attributes=e,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function U(t,e,n,i,r,s){this.key=e,this.attributes=s,this.undirected=t,this.source=i,this.target=r,this.generatedKey=n}function H(t,e,n,i,r,s,o){var a,l,c="out",u="in";if(e&&(c=u="undirected"),t.multi){if(void 0===(l=(a=s[c])[r])&&(l=new Set,a[r]=l),l.add(n),i===r&&e)return;void 0===(a=o[u])[i]&&(a[i]=l)}else{if(s[c][r]=n,i===r&&e)return;o[u][i]=n}}function $(t,e,n){var i=t.multi,r=n.source,s=n.target,o=r.key,a=s.key,l=r[e?"undirected":"out"],c=e?"undirected":"in";if(a in l)if(i){var u=l[a];1===u.size?(delete l[a],delete s[c][o]):u.delete(n)}else delete l[a];i||delete s[c][o]}V.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},z.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var G=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes[i]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var r=""+t,s=""+arguments[1];if(!(i=c(this,r,s,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(r,'" - "').concat(s,'").'))}else if(!(i=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes.hasOwnProperty(i)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+i;if(i=arguments[2],r=arguments[3],!(s=c(this,o,a,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(s=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&s.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return s.attributes[i]=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+i;if(i=arguments[2],r=arguments[3],!(s=c(this,o,a,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(s=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("function"!=typeof r)throw new L("Graph.".concat(e,": updater should be a function."));if("mixed"!==n&&s.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return s.attributes[i]=r(s.attributes[i]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return delete r.attributes[i],this.emit("edgeAttributesUpdated",{key:r.key,type:"remove",attributes:r.attributes,name:i}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(e,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes=i,this.emit("edgeAttributesUpdated",{key:r.key,type:"replace",attributes:r.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(e,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return l(r.attributes,i),this.emit("edgeAttributesUpdated",{key:r.key,type:"merge",attributes:r.attributes,data:i}),this}}}],W=D,q=function(){var t,e=arguments,n=-1;return new W(function i(){if(!t){if(++n>=e.length)return{done:!0};t=e[n]}var r=t.next();return r.done?(t=null,i()):r})},X=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Y(t,e){for(var n in e)t.push(e[n].key)}function K(t,e){for(var n in e)e[n].forEach(function(e){return t.push(e.key)})}function Q(t,e,n){for(var i in t)if(i!==n){var r=t[i];e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey)}}function Z(t,e,n){for(var i in t)i!==n&&t[i].forEach(function(t){return e(t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes,t.undirected,t.generatedKey)})}function J(t,e,n){for(var i in t)if(i!==n){var r=t[i];if(e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey))return!0}return!1}function tt(t,e,n){var i,r,s,o,a;for(var l in t)if(l!==n)for(i=t[l].values();!0!==(r=i.next()).done;)if(o=(s=r.value).source,e(s.key,s.attributes,o.key,(a=s.target).key,o.attributes,a.attributes,s.undirected,s.generatedKey))return!0;return!1}function et(t,e){var n=Object.keys(t),i=n.length,r=null,s=0;return new D(function o(){var a;if(r){var l=r.next();if(l.done)return r=null,s++,o();a=l.value}else{if(s>=i)return{done:!0};var c=n[s];if(c===e)return s++,o();if((a=t[c])instanceof Set)return r=a.values(),o();s++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}})}function nt(t,e,n){var i=e[n];i&&t.push(i.key)}function it(t,e,n){var i=e[n];i&&i.forEach(function(e){return t.push(e.key)})}function rt(t,e,n){var i=t[e];if(i){var r=i.source,s=i.target;n(i.key,i.attributes,r.key,s.key,r.attributes,s.attributes,i.undirected,i.generatedKey)}}function st(t,e,n){var i=t[e];i&&i.forEach(function(t){return n(t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes,t.undirected,t.generatedKey)})}function ot(t,e,n){var i=t[e];if(i){var r=i.source,s=i.target;return n(i.key,i.attributes,r.key,s.key,r.attributes,s.attributes,i.undirected,i.generatedKey)}}function at(t,e,n){var i=t[e];if(i){for(var r,s,o=i.values();!0!==(r=o.next()).done;)if(n((s=r.value).key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected,s.generatedKey))return!0;return!1}}function lt(t,e){var n=t[e];if(n instanceof Set){var i=n.values();return new D(function(){var t=i.next();if(t.done)return t;var e=t.value;return{done:!1,value:[e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes]}})}return D.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ct(t,e){if(0===t.size)return[];if("mixed"===e||e===t.type)return"function"==typeof Array.from?Array.from(t._edges.keys()):R(t._edges.keys(),t._edges.size);for(var n,i,r=new Array("undirected"===e?t.undirectedSize:t.directedSize),s="undirected"===e,o=t._edges.values(),a=0;!0!==(n=o.next()).done;)(i=n.value).undirected===s&&(r[a++]=i.key);return r}function ut(t,e,n){if(0!==t.size)for(var i,r,s="mixed"!==e&&e!==t.type,o="undirected"===e,a=t._edges.values();!0!==(i=a.next()).done;)if(r=i.value,!s||r.undirected===o){var l=r.source,c=r.target;n(r.key,r.attributes,l.key,c.key,l.attributes,c.attributes,r.undirected,r.generatedKey)}}function ht(t,e,n){if(0!==t.size)for(var i,r,s="mixed"!==e&&e!==t.type,o="undirected"===e,a=t._edges.values();!0!==(i=a.next()).done;)if(r=i.value,!s||r.undirected===o){var l=r.source,c=r.target;if(n(r.key,r.attributes,l.key,c.key,l.attributes,c.attributes,r.undirected,r.generatedKey))break}}function dt(t,e){if(0===t.size)return D.empty();var n="mixed"!==e&&e!==t.type,i="undirected"===e,r=t._edges.values();return new D(function(){for(var t,e;;){if((t=r.next()).done)return t;if(e=t.value,!n||e.undirected===i)break}return{value:[e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes],done:!1}})}function pt(t,e,n,i){var r=[],s=t?K:Y;return"undirected"!==e&&("out"!==n&&s(r,i.in),"in"!==n&&s(r,i.out),!n&&i.directedSelfLoops>0&&r.splice(r.lastIndexOf(i.key),1)),"directed"!==e&&s(r,i.undirected),r}function ft(t,e,n,i,r){var s=t?Z:Q;"undirected"!==e&&("out"!==n&&s(i.in,r),"in"!==n&&s(i.out,r,n?null:i.key)),"directed"!==e&&s(i.undirected,r)}function gt(t,e,n,i,r){var s=t?tt:J;"undirected"!==e&&("out"!==n&&s(i.in,r)||"in"!==n&&s(i.out,r,n?null:i.key))||"directed"===e||s(i.undirected,r)}function mt(t,e,n){var i=D.empty();return"undirected"!==t&&("out"!==e&&void 0!==n.in&&(i=q(i,et(n.in))),"in"!==e&&void 0!==n.out&&(i=q(i,et(n.out,e?null:n.key)))),"directed"!==t&&void 0!==n.undirected&&(i=q(i,et(n.undirected))),i}function bt(t,e,n,i,r){var s=e?it:nt,o=[];return"undirected"!==t&&(void 0!==i.in&&"out"!==n&&s(o,i.in,r),void 0!==i.out&&"in"!==n&&s(o,i.out,r),!n&&i.directedSelfLoops>0&&o.splice(o.lastIndexOf(i.key),1)),"directed"!==t&&void 0!==i.undirected&&s(o,i.undirected,r),o}function yt(t,e,n,i,r,s){var o=e?st:rt;"undirected"!==t&&(void 0!==i.in&&"out"!==n&&o(i.in,r,s),i.key!==r&&void 0!==i.out&&"in"!==n&&o(i.out,r,s)),"directed"!==t&&void 0!==i.undirected&&o(i.undirected,r,s)}function vt(t,e,n,i,r,s){var o=e?at:ot;"undirected"!==t&&(void 0!==i.in&&"out"!==n&&o(i.in,r,s)||i.key!==r&&void 0!==i.out&&"in"!==n&&o(i.out,r,s,n?null:i.key))||"directed"===t||void 0===i.undirected||o(i.undirected,r,s)}function _t(t,e,n,i){var r=D.empty();return"undirected"!==t&&(void 0!==n.in&&"out"!==e&&i in n.in&&(r=q(r,lt(n.in,i))),void 0!==n.out&&"in"!==e&&i in n.out&&(r=q(r,lt(n.out,i)))),"directed"!==t&&void 0!==n.undirected&&i in n.undirected&&(r=q(r,lt(n.undirected,i))),r}var wt=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xt(t,e){if(void 0!==e)for(var n in e)t.add(n)}function St(t,e,n){if("mixed"!==t){if("undirected"===t)return Object.keys(n.undirected);if("string"==typeof e)return Object.keys(n[e])}var i=new Set;return"undirected"!==t&&("out"!==e&&xt(i,n.in),"in"!==e&&xt(i,n.out)),"directed"!==t&&xt(i,n.undirected),R(i.values(),i.size)}function Et(t,e,n){for(var i in e){var r=e[i];r instanceof Set&&(r=r.values().next().value);var s=r.source,o=s===t?r.target:s;n(o.key,o.attributes)}}function Ct(t,e,n,i){for(var r in n){var s=n[r];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===e?s.target:o;t.has(a.key)||(t.add(a.key),i(a.key,a.attributes))}}function Ot(t,e,n){for(var i in e){var r=e[i];r instanceof Set&&(r=r.values().next().value);var s=r.source,o=s===t?r.target:s;if(n(o.key,o.attributes))return!0}return!1}function Tt(t,e,n,i){for(var r in n){var s=n[r];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===e?s.target:o;if(!t.has(a.key)&&(t.add(a.key),i(a.key,a.attributes)))return!0}return!1}function kt(t,e){var n=Object.keys(e),i=n.length,r=0;return new D(function(){if(r>=i)return{done:!0};var s=e[n[r++]];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===t?s.target:o;return{done:!1,value:[a.key,a.attributes]}})}function At(t,e,n){var i=Object.keys(n),r=i.length,s=0;return new D(function o(){if(s>=r)return{done:!0};var a=n[i[s++]];a instanceof Set&&(a=a.values().next().value);var l=a.source,c=l===e?a.target:l;return t.has(c.key)?o():(t.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function Pt(t,e,n,i,r){var s=t._nodes.get(i);if("undirected"!==e){if("out"!==n&&void 0!==s.in)for(var o in s.in)if(o===r)return!0;if("in"!==n&&void 0!==s.out)for(var a in s.out)if(a===r)return!0}if("directed"!==e&&void 0!==s.undirected)for(var l in s.undirected)if(l===r)return!0;return!1}function It(t,e,n){for(var i,r,s,o,a,l,c,u=e._nodes.values(),h=e.type;!0!==(i=u.next()).done;){if(r=i.value,"undirected"!==h)for(s in o=r.out)if(l=(a=o[s]).target,c=n(r.key,l.key,r.attributes,l.attributes,a.key,a.attributes,a.undirected,a.generatedKey),t&&c)return;if("directed"!==h)for(s in o=r.undirected)if((l=(a=o[s]).target).key!==s&&(l=a.source),c=n(r.key,l.key,r.attributes,l.attributes,a.key,a.attributes,a.undirected,a.generatedKey),t&&c)return}}function Mt(t,e,n){for(var i,r,s,o,a,l,c,u,h,d=e._nodes.values(),p=e.type;!0!==(i=d.next()).done;){if(r=i.value,"undirected"!==p)for(s in l=r.out)for(o=l[s].values();!0!==(a=o.next()).done;)if(u=(c=a.value).target,h=n(r.key,u.key,r.attributes,u.attributes,c.key,c.attributes,c.undirected,c.generatedKey),t&&h)return;if("directed"!==p)for(s in l=r.undirected)for(o=l[s].values();!0!==(a=o.next()).done;)if((u=(c=a.value).target).key!==s&&(u=c.source),h=n(r.key,u.key,r.attributes,u.attributes,c.key,c.attributes,c.undirected,c.generatedKey),t&&h)return}}function Dt(t,e){var n={key:t};return d(e.attributes)||(n.attributes=l({},e.attributes)),n}function Rt(t,e){var n={source:e.source.key,target:e.target.key};return e.generatedKey||(n.key=t),d(e.attributes)||(n.attributes=l({},e.attributes)),e.undirected&&(n.undirected=!0),n}function Nt(t){return h(t)?"key"in t?!("attributes"in t)||h(t.attributes)&&null!==t.attributes?null:"invalid-attributes":"no-key":"not-object"}function Lt(t){return h(t)?"source"in t?"target"in t?!("attributes"in t)||h(t.attributes)&&null!==t.attributes?"undirected"in t&&"boolean"!=typeof t.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var jt=new Set(["directed","undirected","mixed"]),Ft=new Set(["domain","_events","_eventsCount","_maxListeners"]),Bt={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Vt(t,e,n){var i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}function zt(t,e,n,i,r,s,o,a){if(!i&&"undirected"===t.type)throw new F("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===t.type)throw new F("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a&&!h(a))throw new L("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(a,'"'));if(s=""+s,o=""+o,a=a||{},!t.allowSelfLoops&&s===o)throw new F("Graph.".concat(e,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l=t._nodes.get(s),c=t._nodes.get(o);if(!l)throw new j("Graph.".concat(e,': source node "').concat(s,'" not found.'));if(!c)throw new j("Graph.".concat(e,': target node "').concat(o,'" not found.'));var u={key:null,undirected:i,source:s,target:o,attributes:a};if(n&&(r=t._edgeKeyGenerator(u)),t._edges.has(r=""+r))throw new F("Graph.".concat(e,': the "').concat(r,'" edge already exists in the graph.'));if(!t.multi&&(i?void 0!==l.undirected[o]:void 0!==l.out[o]))throw new F("Graph.".concat(e,': an edge linking "').concat(s,'" to "').concat(o,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var d=new U(i,r,n,l,c,a);return t._edges.set(r,d),s===o?i?(l.undirectedSelfLoops++,t._undirectedSelfLoopCount++):(l.directedSelfLoops++,t._directedSelfLoopCount++):i?(l.undirectedDegree++,c.undirectedDegree++):(l.outDegree++,c.inDegree++),H(t,i,d,s,o,l,c),i?t._undirectedSize++:t._directedSize++,u.key=r,t.emit("edgeAdded",u),r}function Ut(t,e,n,i,r,s,o,a,c){if(!i&&"undirected"===t.type)throw new F("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===t.type)throw new F("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a)if(c){if("function"!=typeof a)throw new L("Graph.".concat(e,': invalid updater function. Expecting a function but got "').concat(a,'"'))}else if(!h(a))throw new L("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(a,'"'));var u;if(s=""+s,o=""+o,c&&(u=a,a=void 0),!t.allowSelfLoops&&s===o)throw new F("Graph.".concat(e,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,p,f=t._nodes.get(s),g=t._nodes.get(o);if(!n&&(d=t._edges.get(r))){if(d.source.key!==s||d.target.key!==o||i&&(d.source.key!==o||d.target.key!==s))throw new F("Graph.".concat(e,': inconsistency detected when attempting to merge the "').concat(r,'" edge with "').concat(s,'" source & "').concat(o,'" target vs. ("').concat(d.source.key,'", "').concat(d.target.key,'").'));p=d}if(p||t.multi||!f||(p=i?f.undirected[o]:f.out[o]),p)return(c?u:a)?(c?(p.attributes=u(p.attributes),t.emit("edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})):(l(p.attributes,a),t.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:a})),p.key):p.key;a=a||{},c&&u&&(a=u(a));var m={key:null,undirected:i,source:s,target:o,attributes:a};if(n&&(r=t._edgeKeyGenerator(m)),t._edges.has(r=""+r))throw new F("Graph.".concat(e,': the "').concat(r,'" edge already exists in the graph.'));return f||(f=Vt(t,s,{}),s===o&&(g=f)),g||(g=Vt(t,o,{})),d=new U(i,r,n,f,g,a),t._edges.set(r,d),s===o?i?(f.undirectedSelfLoops++,t._undirectedSelfLoopCount++):(f.directedSelfLoops++,t._directedSelfLoopCount++):i?(f.undirectedDegree++,g.undirectedDegree++):(f.outDegree++,g.inDegree++),H(t,i,d,s,o,f,g),i?t._undirectedSize++:t._directedSize++,m.key=r,t.emit("edgeAdded",m),r}var Ht,$t=function(t){function n(e){var n;if(n=t.call(this)||this,(e=l({},Bt,e)).edgeKeyGenerator&&"function"!=typeof e.edgeKeyGenerator)throw new L("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(e.edgeKeyGenerator,'".'));if("boolean"!=typeof e.multi)throw new L("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(e.multi,'".'));if(!jt.has(e.type))throw new L('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(e.type,'".'));if("boolean"!=typeof e.allowSelfLoops)throw new L("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(e.allowSelfLoops,'".'));var i,r="mixed"===e.type?B:"directed"===e.type?V:z;return p(a(n),"NodeDataClass",r),p(a(n),"_attributes",{}),p(a(n),"_nodes",new Map),p(a(n),"_edges",new Map),p(a(n),"_directedSize",0),p(a(n),"_undirectedSize",0),p(a(n),"_directedSelfLoopCount",0),p(a(n),"_undirectedSelfLoopCount",0),p(a(n),"_edgeKeyGenerator",e.edgeKeyGenerator||(i=0,function(){return i++})),p(a(n),"_options",e),Ft.forEach(function(t){return p(a(n),t,n[t])}),f(a(n),"order",function(){return n._nodes.size}),f(a(n),"size",function(){return n._edges.size}),f(a(n),"directedSize",function(){return n._directedSize}),f(a(n),"undirectedSize",function(){return n._undirectedSize}),f(a(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),f(a(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),f(a(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),f(a(n),"multi",n._options.multi),f(a(n),"type",n._options.type),f(a(n),"allowSelfLoops",n._options.allowSelfLoops),f(a(n),"implementation",function(){return"graphology"}),n}e(n,t);var i=n.prototype;return i.hasNode=function(t){return this._nodes.has(""+t)},i.hasDirectedEdge=function(t,e){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+t);return!!n&&!n.undirected}if(2===arguments.length){e=""+e;var i=this._nodes.get(t=""+t);if(!i)return!1;var r=i.out[e];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(t,e){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+t);return!!n&&n.undirected}if(2===arguments.length){e=""+e;var i=this._nodes.get(t=""+t);if(!i)return!1;var r=i.undirected[e];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(t,e){if(1===arguments.length)return this._edges.has(""+t);if(2===arguments.length){e=""+e;var n=this._nodes.get(t=""+t);if(!n)return!1;var i=void 0!==n.out&&n.out[e];return i||(i=void 0!==n.undirected&&n.undirected[e]),!(!i||this.multi&&!i.size)}throw new L("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(t,e){if("undirected"!==this.type){if(t=""+t,e=""+e,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(t);if(!n)throw new j('Graph.directedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.directedEdge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.out&&n.out[e]||void 0;return i?i.key:void 0}},i.undirectedEdge=function(t,e){if("directed"!==this.type){if(t=""+t,e=""+e,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(t);if(!n)throw new j('Graph.undirectedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.undirectedEdge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.undirected&&n.undirected[e]||void 0;return i?i.key:void 0}},i.edge=function(t,e){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e;var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.edge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.edge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.out&&n.out[e]||n.undirected&&n.undirected[e]||void 0;if(i)return i.key},i.inDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.inDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.inDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(e?n.directedSelfLoops:0)},i.outDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.outDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.outDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(e?n.directedSelfLoops:0)},i.directedDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.directedDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.directedDegree: could not find the "'.concat(t,'" node in the graph.'));if("undirected"===this.type)return 0;var i=e?n.directedSelfLoops:0;return n.inDegree+i+(n.outDegree+i)},i.undirectedDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.undirectedDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.undirectedDegree: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(e?n.undirectedSelfLoops:0)},i.degree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.degree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.degree: could not find the "'.concat(t,'" node in the graph.'));var i=0,r=0;return"directed"!==this.type&&(e&&(r=n.undirectedSelfLoops),i+=n.undirectedDegree+2*r),"undirected"!==this.type&&(e&&(r=n.directedSelfLoops),i+=n.inDegree+n.outDegree+2*r),i},i.source=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.source: could not find the "'.concat(t,'" edge in the graph.'));return e.source.key},i.target=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.target: could not find the "'.concat(t,'" edge in the graph.'));return e.target.key},i.extremities=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.extremities: could not find the "'.concat(t,'" edge in the graph.'));return[e.source.key,e.target.key]},i.opposite=function(t,e){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new j('Graph.opposite: could not find the "'.concat(e,'" edge in the graph.'));var i=n.source.key,r=n.target.key;if(t!==i&&t!==r)throw new j('Graph.opposite: the "'.concat(t,'" node is not attached to the "').concat(e,'" edge (').concat(i,", ").concat(r,")."));return t===i?r:i},i.hasExtremity=function(t,e){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new j('Graph.hasExtremity: could not find the "'.concat(t,'" edge in the graph.'));return n.source.key===e||n.target.key===e},i.isUndirected=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isUndirected: could not find the "'.concat(t,'" edge in the graph.'));return e.undirected},i.isDirected=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isDirected: could not find the "'.concat(t,'" edge in the graph.'));return!e.undirected},i.isSelfLoop=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isSelfLoop: could not find the "'.concat(t,'" edge in the graph.'));return e.source===e.target},i.hasGeneratedKey=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.hasGeneratedKey: could not find the "'.concat(t,'" edge in the graph.'));return e.generatedKey},i.addNode=function(t,e){return function(t,e,n){if(n&&!h(n))throw new L('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},t._nodes.has(e=""+e))throw new F('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}(this,t,e).key},i.mergeNode=function(t,e){if(e&&!h(e))throw new L('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(e,'"'));e=e||{};var n=this._nodes.get(t=""+t);return n?(e&&(l(n.attributes,e),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:n.attributes,data:e})),t):(n=new this.NodeDataClass(t,e),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:e}),t)},i.updateNode=function(t,e){if(e&&"function"!=typeof e)throw new L('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(e,'"'));var n=this._nodes.get(t=""+t);if(n)return e&&(n.attributes=e(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:n.attributes})),t;var i=e?e({}):{};return n=new this.NodeDataClass(t,i),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:i}),t},i.dropNode=function(t){var e=this,n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.dropNode: could not find the "'.concat(t,'" node in the graph.'));this.forEachEdge(t,function(t){e.dropEdge(t)}),this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})},i.dropEdge=function(t){var e;if(arguments.length>1){var n=""+arguments[0],i=""+arguments[1];if(!(e=c(this,n,i,this.type)))throw new j('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(i,'" edge in the graph.'))}else if(!(e=this._edges.get(t=""+t)))throw new j('Graph.dropEdge: could not find the "'.concat(t,'" edge in the graph.'));this._edges.delete(e.key);var r=e.source,s=e.target,o=e.attributes,a=e.undirected;return r===s?a?(r.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(r.directedSelfLoops--,this._directedSelfLoopCount--):a?(r.undirectedDegree--,s.undirectedDegree--):(r.outDegree--,s.inDegree--),$(this,a,e),a?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:t,attributes:o,source:r.key,target:s.key,undirected:a}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(t){return this._attributes[t]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(t){return this._attributes.hasOwnProperty(t)},i.setAttribute=function(t,e){return this._attributes[t]=e,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.updateAttribute=function(t,e){if("function"!=typeof e)throw new L("Graph.updateAttribute: updater should be a function.");return this._attributes[t]=e(this._attributes[t]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.removeAttribute=function(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this},i.replaceAttributes=function(t){if(!h(t))throw new L("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(t){if(!h(t))throw new L("Graph.mergeAttributes: provided attributes are not a plain object.");return l(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this},i.getNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.getNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return n.attributes[e]},i.getNodeAttributes=function(t){var e=this._nodes.get(t=""+t);if(!e)throw new j('Graph.getNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));return e.attributes},i.hasNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return n.attributes.hasOwnProperty(e)},i.setNodeAttribute=function(t,e,n){var i=this._nodes.get(t=""+t);if(!i)throw new j('Graph.setNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return i.attributes[e]=n,this.emit("nodeAttributesUpdated",{key:t,type:"set",attributes:i.attributes,name:e}),this},i.updateNodeAttribute=function(t,e,n){var i=this._nodes.get(t=""+t);if(!i)throw new j('Graph.updateNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new L("Graph.updateAttribute: updater should be a function.");var r=i.attributes,s=n(r[e]);return r[e]=s,this.emit("nodeAttributesUpdated",{key:t,type:"set",attributes:i.attributes,name:e}),this},i.removeNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return delete n.attributes[e],this.emit("nodeAttributesUpdated",{key:t,type:"remove",attributes:n.attributes,name:e}),this},i.replaceNodeAttributes=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.replaceNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));if(!h(e))throw new L("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=e,this.emit("nodeAttributesUpdated",{key:t,type:"replace",attributes:n.attributes}),this},i.mergeNodeAttributes=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.mergeNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));if(!h(e))throw new L("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return l(n.attributes,e),this.emit("nodeAttributesUpdated",{key:t,type:"merge",attributes:n.attributes,data:e}),this},i.updateEachNodeAttributes=function(t,e){if("function"!=typeof t)throw new L("Graph.updateEachNodeAttributes: expecting an updater function.");if(e&&!g(e))throw new L("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._nodes.values();!0!==(n=r.next()).done;)(i=n.value).attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:e||null})},i.updateEachEdgeAttributes=function(t,e){if("function"!=typeof t)throw new L("Graph.updateEachEdgeAttributes: expecting an updater function.");if(e&&!g(e))throw new L("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._edges.values();!0!==(n=r.next()).done;)(i=n.value).attributes=t(i.key,i.attributes);this.emit("eachEdgeAttributesUpdated",{hints:e||null})},i.forEach=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?Mt(!1,this,t):It(!1,this,t)},i.forEachUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?Mt(!0,this,t):It(!0,this,t)},i.adjacency=function(){return this.multi?(p=(l=this)._nodes.values(),f=l.type,g="outer",m=null,new D(function t(){var e;if("outer"===g)return!0===(e=p.next()).done?e:(c=e.value,g="directed",t());if("directed"===g)return"undirected"===f?(g="undirected",t()):(h=c.out,u=Object.keys(c.out),d=0,g="inner-directed",t());if("undirected"===g){if("directed"===f)return g="outer",t();h=c.undirected,u=Object.keys(c.undirected),d=0,g="inner-undirected"}if(!m&&d>=u.length)return g="inner-undirected"===g?"outer":"undirected",t();if(!m){var n=u[d++];return m=h[n].values(),t()}if((e=m.next()).done)return m=null,t();var i=e.value,r=i.target;return"inner-undirected"===g&&r.key===c.key&&(r=i.source),{done:!1,value:[c.key,r.key,c.attributes,r.attributes,i.key,i.attributes]}})):(s=(t=this)._nodes.values(),o=t.type,a="outer",new D(function t(){var l;if("outer"===a)return!0===(l=s.next()).done?l:(e=l.value,a="directed",t());if("directed"===a)return"undirected"===o?(a="undirected",t()):(i=e.out,n=Object.keys(e.out),r=0,a="inner-directed",t());if("undirected"===a){if("directed"===o)return a="outer",t();i=e.undirected,n=Object.keys(e.undirected),r=0,a="inner-undirected"}if(r>=n.length)return a="inner-undirected"===a?"outer":"undirected",t();var c=n[r++],u=i[c],h=u.target;return"inner-undirected"===a&&h.key===e.key&&(h=u.source),{done:!1,value:[e.key,h.key,e.attributes,h.attributes,u.key,u.attributes]}}));var t,e,n,i,r,s,o,a,l,c,u,h,d,p,f,g,m},i.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):R(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(t){if("function"!=typeof t)throw new L("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(e,n){t(n,e.attributes)})},i.forEachNodeUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEachNode: expecting a callback.");for(var e,n,i=this._nodes.values();!0!==(e=i.next())&&!t((n=e.value).key,n.attributes););},i.nodeEntries=function(){var t=this._nodes.values();return new D(function(){var e=t.next();if(e.done)return e;var n=e.value;return{value:[n.key,n.attributes],done:!1}})},i.exportNode=function(t){var e=this._nodes.get(t=""+t);if(!e)throw new j('Graph.exportNode: could not find the "'.concat(t,'" node in the graph.'));return Dt(t,e)},i.exportEdge=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.exportEdge: could not find the "'.concat(t,'" edge in the graph.'));return Rt(t,e)},i.export=function(){var t=new Array(this._nodes.size),e=0;this._nodes.forEach(function(n,i){t[e++]=Dt(i,n)});var n=new Array(this._edges.size);return e=0,this._edges.forEach(function(t,i){n[e++]=Rt(i,t)}),{attributes:this.getAttributes(),nodes:t,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},i.importNode=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Nt(t);if(n){if("not-object"===n)throw new L('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new L("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new L("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var i=t.key,r=t.attributes,s=void 0===r?{}:r;return e?this.mergeNode(i,s):this.addNode(i,s),this},i.importEdge=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Lt(t);if(n){if("not-object"===n)throw new L('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new L("Graph.importEdge: missing souce.");if("no-target"===n)throw new L("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new L("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new L("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var i=t.source,r=t.target,s=t.attributes,o=void 0===s?{}:s,a=t.undirected,l=void 0!==a&&a;return"key"in t?(e?l?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:l?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,t.key,i,r,o):(e?l?this.mergeUndirectedEdge:this.mergeDirectedEdge:l?this.addUndirectedEdge:this.addDirectedEdge).call(this,i,r,o),this},i.import=function(t){var e,n,i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u(t))return this.import(t.export(),r),this;if(!h(t))throw new L("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!h(t.attributes))throw new L("Graph.import: invalid attributes. Expecting a plain object.");r?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new L("Graph.import: invalid nodes. Expecting an array.");for(e=0,n=i.length;en)){var o=new Set;o.add(e.undirected[s]),e.undirected[s]=o,t._nodes.get(s).undirected[n]=o}})),this;var t},i.clearIndex=function(){return this._nodes.forEach(function(t){void 0!==t.in&&(t.in={},t.out={}),void 0!==t.undirected&&(t.undirected={})}),this},i.toJSON=function(){return this.export()},i.toString=function(){return"[object Graph]"},i.inspect=function(){var t=this,e={};this._nodes.forEach(function(t,n){e[n]=t.attributes});var n={},i={};this._edges.forEach(function(e,r){var s=e.undirected?"--":"->",o="",a="(".concat(e.source.key,")").concat(s,"(").concat(e.target.key,")");e.generatedKey?t.multi&&(void 0===i[a]?i[a]=0:i[a]++,o+="".concat(i[a],". ")):o+="[".concat(r,"]: "),n[o+=a]=e.attributes});var r={};for(var s in this)this.hasOwnProperty(s)&&!Ft.has(s)&&"function"!=typeof this[s]&&(r[s]=this[s]);return r.attributes=this._attributes,r.nodes=e,r.edges=n,p(r,"constructor",this.constructor),r},n}(b.exports.EventEmitter);"undefined"!=typeof Symbol&&($t.prototype[Symbol.for("nodejs.util.inspect.custom")]=$t.prototype.inspect),[{name:function(t){return"".concat(t,"Edge")},generateKey:!0},{name:function(t){return"".concat(t,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(t){return"".concat(t,"EdgeWithKey")}},{name:function(t){return"".concat(t,"DirectedEdgeWithKey")},type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(t){["add","merge","update"].forEach(function(e){var n=t.name(e),i="add"===e?zt:Ut;$t.prototype[n]=t.generateKey?function(r,s,o){return i(this,n,!0,"undirected"===(t.type||this.type),null,r,s,o,"update"===e)}:function(r,s,o,a){return i(this,n,!1,"undirected"===(t.type||this.type),r,s,o,a,"update"===e)}})}),"undefined"!=typeof Symbol&&($t.prototype[Symbol.iterator]=$t.prototype.adjacency),Ht=$t,G.forEach(function(t){var e=t.name,n=t.attacher;n(Ht,e("Edge"),"mixed"),n(Ht,e("DirectedEdge"),"directed"),n(Ht,e("UndirectedEdge"),"undirected")}),function(t){X.forEach(function(e){var n,i,r,s;r=(n=e).type,s=n.direction,t.prototype[i=n.name]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return ct(this,r);if(1===arguments.length){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));return pt(this.multi,"mixed"===r?this.type:r,s,n)}if(2===arguments.length){e=""+e;var o=this._nodes.get(t=""+t);if(!o)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(i,': could not find the "').concat(e,'" target node in the graph.'));return bt(r,this.multi,s,o,e)}throw new L("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(t,e,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return ut(this,i,n=t);if(2===arguments.length){n=e;var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));return ft(this.multi,"mixed"===i?this.type:i,r,o,n)}if(3===arguments.length){e=""+e;var a=this._nodes.get(t=""+t);if(!a)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(s,': could not find the "').concat(e,'" target node in the graph.'));return yt(i,this.multi,r,a,e,n)}throw new L("Graph.".concat(s,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(t,e),function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";t.prototype[s]=function(t,e,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return ht(this,i,n=t);if(2===arguments.length){n=e;var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));return gt(this.multi,"mixed"===i?this.type:i,r,o,n)}if(3===arguments.length){e=""+e;var a=this._nodes.get(t=""+t);if(!a)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(s,': could not find the "').concat(e,'" target node in the graph.'));return vt(i,this.multi,r,a,e,n)}throw new L("Graph.".concat(s,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(t,e),function(t,e){var n=e.type,i=e.direction,r=e.name.slice(0,-1)+"Entries";t.prototype[r]=function(t,e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return D.empty();if(!arguments.length)return dt(this,n);if(1===arguments.length){var s=this._nodes.get(t=""+t);if(!s)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));return mt(n,i,s)}if(2===arguments.length){e=""+e;var o=this._nodes.get(t=""+t);if(!o)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(r,': could not find the "').concat(e,'" target node in the graph.'));return _t(n,i,o,e)}throw new L("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e)})}($t),function(t){wt.forEach(function(e){var n,i,r,s;r=(n=e).type,s=n.direction,t.prototype[i=n.name]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var e=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(e))throw new j("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));if(!this._nodes.has(n))throw new j("Graph.".concat(i,': could not find the "').concat(n,'" node in the graph.'));return Pt(this,r,s,e,n)}if(1===arguments.length){var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));return St("mixed"===r?this.type:r,s,o)}throw new L("Graph.".concat(i,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(t,e){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));!function(t,e,n,i){if("mixed"!==t){if("undirected"===t)return Et(n,n.undirected,i);if("string"==typeof e)return Et(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Ct(r,n,n.in,i),"in"!==e&&Ct(r,n,n.out,i)),"directed"!==t&&Ct(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,e)}}}(t,e),function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";t.prototype[s]=function(t,e){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));!function(t,e,n,i){if("mixed"!==t){if("undirected"===t)return Ot(n,n.undirected,i);if("string"==typeof e)return Ot(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Tt(r,n,n.in,i)||"in"!==e&&Tt(r,n,n.out,i))||"directed"===t||Tt(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,e)}}}(t,e),function(t,e){var n=e.type,i=e.direction,r=e.name.slice(0,-1)+"Entries";t.prototype[r]=function(t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return D.empty();var e=this._nodes.get(t=""+t);if(void 0===e)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return kt(n,n.undirected);if("string"==typeof e)return kt(n,n[e])}var i=D.empty(),r=new Set;return"undirected"!==t&&("out"!==e&&(i=q(i,At(r,n,n.in))),"in"!==e&&(i=q(i,At(r,n,n.out)))),"directed"!==t&&(i=q(i,At(r,n,n.undirected))),i}("mixed"===n?this.type:n,i,e)}}(t,e)})}($t);var Gt=function(t){function n(e){var n=l({type:"directed"},e);if("multi"in n&&!1!==n.multi)throw new L("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new L('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),Wt=function(t){function n(e){var n=l({type:"undirected"},e);if("multi"in n&&!1!==n.multi)throw new L("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new L('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),qt=function(t){function n(e){var n=l({multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return t.call(this,n)||this}return e(n,t),n}($t),Xt=function(t){function n(e){var n=l({type:"directed",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new L('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),Yt=function(t){function n(e){var n=l({type:"undirected",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new L('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t);function Kt(t){t.from=function(e,n){var i=l({},e.options,n),r=new t(i);return r.import(e),r}}return Kt($t),Kt(Gt),Kt(Wt),Kt(qt),Kt(Xt),Kt(Yt),$t.Graph=$t,$t.DirectedGraph=Gt,$t.UndirectedGraph=Wt,$t.MultiGraph=qt,$t.MultiDirectedGraph=Xt,$t.MultiUndirectedGraph=Yt,$t.InvalidArgumentsGraphError=L,$t.NotFoundGraphError=j,$t.UsageGraphError=F,$t}()},11524:function(t,e,n){var i;!function(r,s,o,a){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=s.createElement("div"),h=Math.round,d=Math.abs,p=Date.now;function f(t,e,n){return setTimeout(w(t,n),e)}function g(t,e,n){return!!Array.isArray(t)&&(m(t,n[e],n),!0)}function m(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==a)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=r.console&&(r.console.warn||r.console.log);return s&&s.call(r.console,i,n),t.apply(this,arguments)}}l="function"!=typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n-1}function k(t){return t.trim().split(/\s+/g)}function A(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function M(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),s=0;s1&&!n.firstMultiple?n.firstMultiple=$(e):1===r&&(n.firstMultiple=!1);var s=n.firstInput,o=n.firstMultiple,l=o?o.center:s.center,c=e.center=G(i);e.timeStamp=p(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Y(l,c),e.distance=X(l,c),function(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},s=t.prevInput||{};(1===e.eventType||4===s.eventType)&&(r=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}(n,e),e.offsetDirection=q(e.deltaX,e.deltaY);var u=W(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=d(u.x)>d(u.y)?u.x:u.y,e.scale=o?function(t,e){return X(e[0],e[1],z)/X(t[0],t[1],z)}(o.pointers,i):1,e.rotation=o?function(t,e){return Y(e[1],e[0],z)+Y(t[1],t[0],z)}(o.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,r,s,o=t.lastInterval||e,l=e.timeStamp-o.timeStamp;if(8!=e.eventType&&(l>25||o.velocity===a)){var c=e.deltaX-o.deltaX,u=e.deltaY-o.deltaY,h=W(l,c,u);i=h.x,r=h.y,n=d(h.x)>d(h.y)?h.x:h.y,s=q(c,u),t.lastInterval=e}else n=o.velocity,i=o.velocityX,r=o.velocityY,s=o.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=s}(n,e);var h=t.element;O(e.srcEvent.target,h)&&(h=e.srcEvent.target),e.target=h}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function $(t){for(var e=[],n=0;n=d(e)?t<0?2:4:e<0?8:16}function X(t,e,n){n||(n=V);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function Y(t,e,n){return n||(n=V),180*Math.atan2(e[n[1]]-t[n[1]],e[n[0]]-t[n[0]])/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(R(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},Q="mousedown",Z="mousemove mouseup";function J(){this.evEl=Q,this.evWin=Z,this.pressed=!1,U.apply(this,arguments)}_(J,U,{handler:function(t){var e=K[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:B,srcEvent:t}))}});var tt={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},et={2:F,3:"pen",4:B,5:"kinect"},nt="pointerdown",it="pointermove pointerup pointercancel";function rt(){this.evEl=nt,this.evWin=it,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(nt="MSPointerDown",it="MSPointerMove MSPointerUp MSPointerCancel"),_(rt,U,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=tt[i],s=et[t.pointerType]||t.pointerType,o=s==F,a=A(e,t.pointerId,"pointerId");1&r&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):12&r&&(n=!0),!(a<0)&&(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),n&&e.splice(a,1))}});var st={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ot="touchstart",at="touchstart touchmove touchend touchcancel";function lt(){this.evTarget=ot,this.evWin=at,this.started=!1,U.apply(this,arguments)}function ct(t,e){var n=P(t.touches),i=P(t.changedTouches);return 12&e&&(n=I(n.concat(i),"identifier",!0)),[n,i]}_(lt,U,{handler:function(t){var e=st[t.type];if(1===e&&(this.started=!0),this.started){var n=ct.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:F,srcEvent:t})}}});var ut={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ht="touchstart touchmove touchend touchcancel";function dt(){this.evTarget=ht,this.targetIds={},U.apply(this,arguments)}function pt(t,e){var n=P(t.touches),i=this.targetIds;if(3&e&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,s,o=P(t.changedTouches),a=[],l=this.target;if(s=n.filter(function(t){return O(t.target,l)}),1===e)for(r=0;r-1&&i.splice(t,1)},2500)}}function bt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function i(n){e.manager.emit(n,t)}n<8&&i(e.options.event+kt(n)),i(e.options.event),t.additionalEvent&&i(t.additionalEvent),n>=8&&i(e.options.event+kt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return It.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=At(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(Dt,It,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[xt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){1!==t.scale&&(t.additionalEvent=this.options.event+(t.scale<1?"in":"out")),this._super.emit.call(this,t)}}),_(Rt,Tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!n||12&t.eventType&&!r)this.reset();else if(1&t.eventType)this.reset(),this._timer=f(function(){this.state=8,this.tryEmit()},e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),_(Nt,It,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[xt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Lt,It,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Mt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&d(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=At(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(jt,Tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[wt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance"']/g,W=RegExp($.source),q=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,it=/\s/,rt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,ot=/,? & /,at=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,ft=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,vt=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Ct="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tt="["+_t+"]",kt="["+Ot+"]",At="["+wt+"]",Pt="\\d+",It="["+xt+"]",Mt="["+St+"]",Dt="[^"+_t+Ot+Pt+xt+St+Et+"]",Rt="\\ud83c[\\udffb-\\udfff]",Nt="[^"+_t+"]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Et+"]",Bt="(?:"+Mt+"|"+Dt+")",Vt="(?:"+Ft+"|"+Dt+")",zt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ut="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+At+"|"+Rt+")?",$t="["+Ct+"]?",Gt=$t+Ht+"(?:\\u200d(?:"+[Nt,Lt,jt].join("|")+")"+$t+Ht+")*",Wt="(?:"+[It,Lt,jt].join("|")+")"+Gt,qt="(?:"+[Nt+At+"?",At,Lt,jt,Tt].join("|")+")",Xt=RegExp("['\u2019]","g"),Yt=RegExp(At,"g"),Kt=RegExp(Rt+"(?="+Rt+")|"+qt+Gt,"g"),Qt=RegExp([Ft+"?"+Mt+"+"+zt+"(?="+[kt,Ft,"$"].join("|")+")",Vt+"+"+Ut+"(?="+[kt,Ft+Bt,"$"].join("|")+")",Ft+"?"+Bt+"+"+zt,Ft+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pt,Wt].join("|"),"g"),Zt=RegExp("[\\u200d"+_t+wt+Ct+"]"),Jt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,te=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ee=-1,ne={};ne[M]=ne[D]=ne[R]=ne[N]=ne[L]=ne[j]=ne[F]=ne[B]=ne[V]=!0,ne[f]=ne[g]=ne[P]=ne[m]=ne[I]=ne[b]=ne[y]=ne[v]=ne[w]=ne[x]=ne[S]=ne[C]=ne[O]=ne[T]=ne[A]=!1;var ie={};ie[f]=ie[g]=ie[P]=ie[I]=ie[m]=ie[b]=ie[M]=ie[D]=ie[R]=ie[N]=ie[L]=ie[w]=ie[x]=ie[S]=ie[C]=ie[O]=ie[T]=ie[k]=ie[j]=ie[F]=ie[B]=ie[V]=!0,ie[y]=ie[v]=ie[A]=!1;var re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,oe=parseInt,ae="object"==typeof global&&global&&global.Object===Object&&global,le="object"==typeof self&&self&&self.Object===Object&&self,ce=ae||le||Function("return this")(),ue=e&&!e.nodeType&&e,he=ue&&t&&!t.nodeType&&t,de=he&&he.exports===ue,pe=de&&ae.process,fe=function(){try{return he&&he.require&&he.require("util").types||pe&&pe.binding&&pe.binding("util")}catch(t){}}(),ge=fe&&fe.isArrayBuffer,me=fe&&fe.isDate,be=fe&&fe.isMap,ye=fe&&fe.isRegExp,ve=fe&&fe.isSet,_e=fe&&fe.isTypedArray;function we(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,i){for(var r=-1,s=null==t?0:t.length;++r-1}function ke(t,e,n){for(var i=-1,r=null==t?0:t.length;++i-1;);return n}function Qe(t,e){for(var n=t.length;n--&&je(e,t[n],0)>-1;);return n}function Ze(t,e){for(var n=t.length,i=0;n--;)t[n]===e&&++i;return i}var Je=Ue({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),tn=Ue({"&":"&","<":"<",">":">",'"':""","'":"'"});function en(t){return"\\"+re[t]}function nn(t){return Zt.test(t)}function rn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,i){n[++e]=[i,t]}),n}function sn(t,e){return function(n){return t(e(n))}}function on(t,e){for(var n=-1,i=t.length,r=0,s=[];++n",""":'"',"'":"'"}),dn=function t(e){var n,i=(e=null==e?ce:dn.defaults(ce.Object(),e,dn.pick(ce,te))).Array,it=e.Date,_t=e.Error,wt=e.Function,xt=e.Math,St=e.Object,Et=e.RegExp,Ct=e.String,Ot=e.TypeError,Tt=i.prototype,kt=St.prototype,At=e["__core-js_shared__"],Pt=wt.prototype.toString,It=kt.hasOwnProperty,Mt=0,Dt=(n=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Rt=kt.toString,Nt=Pt.call(St),Lt=ce._,jt=Et("^"+Pt.call(It).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ft=de?e.Buffer:r,Bt=e.Symbol,Vt=e.Uint8Array,zt=Ft?Ft.allocUnsafe:r,Ut=sn(St.getPrototypeOf,St),Ht=St.create,$t=kt.propertyIsEnumerable,Gt=Tt.splice,Wt=Bt?Bt.isConcatSpreadable:r,qt=Bt?Bt.iterator:r,Kt=Bt?Bt.toStringTag:r,Zt=function(){try{var t=os(St,"defineProperty");return t({},"",{}),t}catch(Is){}}(),re=e.clearTimeout!==ce.clearTimeout&&e.clearTimeout,ae=it&&it.now!==ce.Date.now&&it.now,le=e.setTimeout!==ce.setTimeout&&e.setTimeout,ue=xt.ceil,he=xt.floor,pe=St.getOwnPropertySymbols,fe=Ft?Ft.isBuffer:r,Re=e.isFinite,Ue=Tt.join,pn=sn(St.keys,St),fn=xt.max,gn=xt.min,mn=it.now,bn=e.parseInt,yn=xt.random,vn=Tt.reverse,_n=os(e,"DataView"),wn=os(e,"Map"),xn=os(e,"Promise"),Sn=os(e,"Set"),En=os(e,"WeakMap"),Cn=os(St,"create"),On=En&&new En,Tn={},kn=Ns(_n),An=Ns(wn),Pn=Ns(xn),In=Ns(Sn),Mn=Ns(En),Dn=Bt?Bt.prototype:r,Rn=Dn?Dn.valueOf:r,Nn=Dn?Dn.toString:r;function Ln(t){if(Jo(t)&&!Uo(t)&&!(t instanceof Vn)){if(t instanceof Bn)return t;if(It.call(t,"__wrapped__"))return Ls(t)}return new Bn(t)}var jn=function(){function t(){}return function(e){if(!Zo(e))return{};if(Ht)return Ht(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function Fn(){}function Bn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function ri(t,e,n,i,s,o){var a,l=1&e,c=2&e,u=4&e;if(n&&(a=s?n(t,i,s,o):n(t)),a!==r)return a;if(!Zo(t))return t;var h=Uo(t);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&It.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Er(t,a)}else{var d=cs(t),p=d==v||d==_;if(Wo(t))return yr(t,l);if(d==S||d==f||p&&!s){if(a=c||p?{}:hs(t),!l)return c?function(t,e){return Cr(t,ls(t),e)}(t,function(t,e){return t&&Cr(e,Pa(e),t)}(a,t)):function(t,e){return Cr(t,as(t),e)}(t,ti(a,t))}else{if(!ie[d])return s?t:{};a=function(t,e,n){var i=t.constructor;switch(e){case P:return vr(t);case m:case b:return new i(+t);case I:return function(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case M:case D:case R:case N:case L:case j:case F:case B:case V:return _r(t,n);case w:return new i;case x:case T:return new i(t);case C:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new i;case k:return function(t){return Rn?St(Rn.call(t)):{}}(t)}}(t,d,l)}}o||(o=new Gn);var g=o.get(t);if(g)return g;o.set(t,a),ra(t)?t.forEach(function(i){a.add(ri(i,e,n,i,t,o))}):ta(t)&&t.forEach(function(i,r){a.set(r,ri(i,e,n,r,t,o))});var y=h?r:(u?c?Jr:Zr:c?Pa:Aa)(t);return Se(y||t,function(i,r){y&&(i=t[r=i]),Qn(a,r,ri(i,e,n,r,t,o))}),a}function si(t,e,n){var i=n.length;if(null==t)return!i;for(t=St(t);i--;){var s=n[i],o=t[s];if(o===r&&!(s in t)||!(0,e[s])(o))return!1}return!0}function oi(t,e,n){if("function"!=typeof t)throw new Ot(s);return Os(function(){t.apply(r,n)},e)}function ai(t,e,n,i){var r=-1,s=Te,o=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=Ae(e,qe(n))),i?(s=ke,o=!1):e.length>=200&&(s=Ye,o=!1,e=new $n(e));t:for(;++r-1},Un.prototype.set=function(t,e){var n=this.__data__,i=Zn(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new zn,map:new(wn||Un),string:new zn}},Hn.prototype.delete=function(t){var e=rs(this,t).delete(t);return this.size-=e?1:0,e},Hn.prototype.get=function(t){return rs(this,t).get(t)},Hn.prototype.has=function(t){return rs(this,t).has(t)},Hn.prototype.set=function(t,e){var n=rs(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},$n.prototype.add=$n.prototype.push=function(t){return this.__data__.set(t,o),this},$n.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new Un,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Un){var i=n.__data__;if(!wn||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Hn(i)}return n.set(t,e),this.size=n.size,this};var li=kr(mi),ci=kr(bi,!0);function ui(t,e){var n=!0;return li(t,function(t,i,r){return n=!!e(t,i,r)}),n}function hi(t,e,n){for(var i=-1,s=t.length;++i0&&n(a)?e>1?pi(a,e-1,n,i,r):Pe(r,a):i||(r[r.length]=a)}return r}var fi=Ar(),gi=Ar(!0);function mi(t,e){return t&&fi(t,e,Aa)}function bi(t,e){return t&&gi(t,e,Aa)}function yi(t,e){return Oe(e,function(e){return Yo(t[e])})}function vi(t,e){for(var n=0,i=(e=fr(e,t)).length;null!=t&&ne}function Si(t,e){return null!=t&&It.call(t,e)}function Ei(t,e){return null!=t&&e in St(t)}function Ci(t,e,n){for(var s=n?ke:Te,o=t[0].length,a=t.length,l=a,c=i(a),u=1/0,h=[];l--;){var d=t[l];l&&e&&(d=Ae(d,qe(e))),u=gn(d.length,u),c[l]=!n&&(e||o>=120&&d.length>=120)?new $n(l&&d):r}d=t[0];var p=-1,f=c[0];t:for(;++p=a?l:l*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)});i--;)t[i]=t[i].value;return t}(Ri(t,function(t,n,r){return{criteria:Ae(e,function(e){return e(t)}),index:++i,value:t}}))}function Vi(t,e,n){for(var i=-1,r=e.length,s={};++i-1;)a!==t&&Gt.call(a,l,1),Gt.call(t,l,1);return t}function Ui(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==s){var s=r;ps(r)?Gt.call(t,r,1):or(t,r)}}return t}function Hi(t,e){return t+he(yn()*(e-t+1))}function $i(t,e){var n="";if(!t||e<1||e>h)return n;do{e%2&&(n+=t),(e=he(e/2))&&(t+=t)}while(e);return n}function Gi(t,e){return Ts(ws(t,e,el),t+"")}function Wi(t){return qn(Fa(t))}function qi(t,e){var n=Fa(t);return Ps(n,ii(e,0,n.length))}function Xi(t,e,n,i){if(!Zo(t))return t;for(var s=-1,o=(e=fr(e,t)).length,a=o-1,l=t;null!=l&&++ss?0:s+e),(n=n>s?s:n)<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;for(var o=i(s);++r>>1,o=t[s];null!==o&&!oa(o)&&(n?o<=e:o=200){var c=e?null:$r(t);if(c)return an(c);o=!1,r=Ye,l=new $n}else l=e?[]:a;t:for(;++i=i?t:Zi(t,e,n)}var br=re||function(t){return ce.clearTimeout(t)};function yr(t,e){if(e)return t.slice();var n=t.length,i=zt?zt(n):new t.constructor(n);return t.copy(i),i}function vr(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function _r(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function wr(t,e){if(t!==e){var n=t!==r,i=null===t,s=t==t,o=oa(t),a=e!==r,l=null===e,c=e==e,u=oa(e);if(!l&&!u&&!o&&t>e||o&&a&&c&&!l&&!u||i&&a&&c||!n&&c||!s)return 1;if(!i&&!o&&!u&&t1?n[s-1]:r,a=s>2?n[2]:r;for(o=t.length>3&&"function"==typeof o?(s--,o):r,a&&fs(n[0],n[1],a)&&(o=s<3?r:o,s=1),e=St(e);++i-1?s[o?e[a]:a]:r}}function Rr(t){return Qr(function(e){var n=e.length,i=n,o=Bn.prototype.thru;for(t&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new Ot(s);if(o&&!l&&"wrapper"==es(a))var l=new Bn([],!0)}for(i=l?i:n;++i1&&v.reverse(),p&&hl))return!1;var u=o.get(t),h=o.get(e);if(u&&h)return u==e&&h==t;var d=-1,p=!0,f=2&n?new $n:r;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(rt,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Se(p,function(n){var i="_."+n[0];e&n[1]&&!Te(t,i)&&t.push(i)}),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(ot):[]}(i),n)))}function As(t){var e=0,n=0;return function(){var i=mn(),s=16-(i-n);if(n=i,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Ps(t,e){var n=-1,i=t.length,s=i-1;for(e=e===r?i:e;++n1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,no(t,n)});function co(t){var e=Ln(t);return e.__chain__=!0,e}function uo(t,e){return e(t)}var ho=Qr(function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,s=function(e){return ni(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Vn&&ps(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:uo,args:[s],thisArg:r}),new Bn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(r),t})):this.thru(s)}),po=Or(function(t,e,n){It.call(t,n)?++t[n]:ei(t,n,1)}),fo=Dr(Vs),go=Dr(zs);function mo(t,e){return(Uo(t)?Se:li)(t,is(e,3))}function bo(t,e){return(Uo(t)?Ee:ci)(t,is(e,3))}var yo=Or(function(t,e,n){It.call(t,n)?t[n].push(e):ei(t,n,[e])}),vo=Gi(function(t,e,n){var r=-1,s="function"==typeof e,o=$o(t)?i(t.length):[];return li(t,function(t){o[++r]=s?we(e,t,n):Oi(t,e,n)}),o}),_o=Or(function(t,e,n){ei(t,n,e)});function wo(t,e){return(Uo(t)?Ae:Ri)(t,is(e,3))}var xo=Or(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),So=Gi(function(t,e){if(null==t)return[];var n=e.length;return n>1&&fs(t,e[0],e[1])?e=[]:n>2&&fs(e[0],e[1],e[2])&&(e=[e[0]]),Bi(t,pi(e,1),[])}),Eo=ae||function(){return ce.Date.now()};function Co(t,e,n){return e=n?r:e,Wr(t,c,r,r,r,r,e=t&&null==e?t.length:e)}function Oo(t,e){var n;if("function"!=typeof e)throw new Ot(s);return t=da(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var To=Gi(function(t,e,n){var i=1;if(n.length){var r=on(n,ns(To));i|=l}return Wr(t,i,e,n,r)}),ko=Gi(function(t,e,n){var i=3;if(n.length){var r=on(n,ns(ko));i|=l}return Wr(e,i,t,n,r)});function Ao(t,e,n){var i,o,a,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new Ot(s);function g(e){var n=i,s=o;return i=o=r,h=e,l=t.apply(s,n)}function m(t){return h=t,c=Os(y,e),d?g(t):l}function b(t){var n=t-u;return u===r||n>=e||n<0||p&&t-h>=a}function y(){var t=Eo();if(b(t))return v(t);c=Os(y,function(t){var n=e-(t-u);return p?gn(n,a-(t-h)):n}(t))}function v(t){return c=r,f&&i?g(t):(i=o=r,l)}function _(){var t=Eo(),n=b(t);if(i=arguments,o=this,u=t,n){if(c===r)return m(u);if(p)return br(c),c=Os(y,e),g(u)}return c===r&&(c=Os(y,e)),l}return e=fa(e)||0,Zo(n)&&(d=!!n.leading,a=(p="maxWait"in n)?fn(fa(n.maxWait)||0,e):a,f="trailing"in n?!!n.trailing:f),_.cancel=function(){c!==r&&br(c),h=0,i=u=o=c=r},_.flush=function(){return c===r?l:v(Eo())},_}var Po=Gi(function(t,e){return oi(t,1,e)}),Io=Gi(function(t,e,n){return oi(t,fa(e)||0,n)});function Mo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(s);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(Mo.Cache||Hn),n}function Do(t){if("function"!=typeof t)throw new Ot(s);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Mo.Cache=Hn;var Ro=gr(function(t,e){var n=(e=1==e.length&&Uo(e[0])?Ae(e[0],qe(is())):Ae(pi(e,1),qe(is()))).length;return Gi(function(i){for(var r=-1,s=gn(i.length,n);++r=e}),zo=Ti(function(){return arguments}())?Ti:function(t){return Jo(t)&&It.call(t,"callee")&&!$t.call(t,"callee")},Uo=i.isArray,Ho=ge?qe(ge):function(t){return Jo(t)&&wi(t)==P};function $o(t){return null!=t&&Qo(t.length)&&!Yo(t)}function Go(t){return Jo(t)&&$o(t)}var Wo=fe||fl,qo=me?qe(me):function(t){return Jo(t)&&wi(t)==b};function Xo(t){if(!Jo(t))return!1;var e=wi(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!na(t)}function Yo(t){if(!Zo(t))return!1;var e=wi(t);return e==v||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ko(t){return"number"==typeof t&&t==da(t)}function Qo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function Zo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Jo(t){return null!=t&&"object"==typeof t}var ta=be?qe(be):function(t){return Jo(t)&&cs(t)==w};function ea(t){return"number"==typeof t||Jo(t)&&wi(t)==x}function na(t){if(!Jo(t)||wi(t)!=S)return!1;var e=Ut(t);if(null===e)return!0;var n=It.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Nt}var ia=ye?qe(ye):function(t){return Jo(t)&&wi(t)==C},ra=ve?qe(ve):function(t){return Jo(t)&&cs(t)==O};function sa(t){return"string"==typeof t||!Uo(t)&&Jo(t)&&wi(t)==T}function oa(t){return"symbol"==typeof t||Jo(t)&&wi(t)==k}var aa=_e?qe(_e):function(t){return Jo(t)&&Qo(t.length)&&!!ne[wi(t)]},la=zr(Di),ca=zr(function(t,e){return t<=e});function ua(t){if(!t)return[];if($o(t))return sa(t)?cn(t):Er(t);if(qt&&t[qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qt]());var e=cs(t);return(e==w?rn:e==O?an:Fa)(t)}function ha(t){return t?(t=fa(t))===u||t===-u?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function da(t){var e=ha(t),n=e%1;return e==e?n?e-n:e:0}function pa(t){return t?ii(da(t),0,d):0}function fa(t){if("number"==typeof t)return t;if(oa(t))return NaN;if(Zo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Zo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=We(t);var n=pt.test(t);return n||gt.test(t)?oe(t.slice(2),n?2:8):dt.test(t)?NaN:+t}function ga(t){return Cr(t,Pa(t))}function ma(t){return null==t?"":rr(t)}var ba=Tr(function(t,e){if(ys(e)||$o(e))Cr(e,Aa(e),t);else for(var n in e)It.call(e,n)&&Qn(t,n,e[n])}),ya=Tr(function(t,e){Cr(e,Pa(e),t)}),va=Tr(function(t,e,n,i){Cr(e,Pa(e),t,i)}),_a=Tr(function(t,e,n,i){Cr(e,Aa(e),t,i)}),wa=Qr(ni),xa=Gi(function(t,e){t=St(t);var n=-1,i=e.length,s=i>2?e[2]:r;for(s&&fs(e[0],e[1],s)&&(i=1);++n1),e}),Cr(t,Jr(t),n),i&&(n=ri(n,7,Yr));for(var r=e.length;r--;)or(n,e[r]);return n}),Ra=Qr(function(t,e){return null==t?{}:function(t,e){return Vi(t,e,function(e,n){return Ca(t,n)})}(t,e)});function Na(t,e){if(null==t)return{};var n=Ae(Jr(t),function(t){return[t]});return e=is(e),Vi(t,n,function(t,n){return e(t,n[0])})}var La=Gr(Aa),ja=Gr(Pa);function Fa(t){return null==t?[]:Xe(t,Aa(t))}var Ba=Ir(function(t,e,n){return e=e.toLowerCase(),t+(n?Va(e):e)});function Va(t){return Xa(ma(t).toLowerCase())}function za(t){return(t=ma(t))&&t.replace(bt,Je).replace(Yt,"")}var Ua=Ir(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ha=Ir(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),$a=Pr("toLowerCase"),Ga=Ir(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Wa=Ir(function(t,e,n){return t+(n?" ":"")+Xa(e)}),qa=Ir(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Xa=Pr("toUpperCase");function Ya(t,e,n){return t=ma(t),(e=n?r:e)===r?function(t){return Jt.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(at)||[]}(t):t.match(e)||[]}var Ka=Gi(function(t,e){try{return we(t,r,e)}catch(Ms){return Xo(Ms)?Ms:new _t(Ms)}}),Qa=Qr(function(t,e){return Se(e,function(e){e=Rs(e),ei(t,e,To(t[e],t))}),t});function Za(t){return function(){return t}}var Ja=Rr(),tl=Rr(!0);function el(t){return t}function nl(t){return Ii("function"==typeof t?t:ri(t,1))}var il=Gi(function(t,e){return function(n){return Oi(n,t,e)}}),rl=Gi(function(t,e){return function(n){return Oi(t,n,e)}});function sl(t,e,n){var i=Aa(e),r=yi(e,i);null==n&&(!Zo(e)||!r.length&&i.length)&&(n=e,e=t,t=this,r=yi(e,Aa(e)));var s=!(Zo(n)&&"chain"in n&&!n.chain),o=Yo(t);return Se(r,function(n){var i=e[n];t[n]=i,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__),r=n.__actions__=Er(this.__actions__);return r.push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,Pe([this.value()],arguments))})}),t}function ol(){}var al=Fr(Ae),ll=Fr(Ce),cl=Fr(De);function ul(t){return gs(t)?ze(Rs(t)):function(t){return function(e){return vi(e,t)}}(t)}var hl=Vr(),dl=Vr(!0);function pl(){return[]}function fl(){return!1}var gl=jr(function(t,e){return t+e},0),ml=Hr("ceil"),bl=jr(function(t,e){return t/e},1),yl=Hr("floor"),vl=jr(function(t,e){return t*e},1),_l=Hr("round"),wl=jr(function(t,e){return t-e},0);return Ln.after=function(t,e){if("function"!=typeof e)throw new Ot(s);return t=da(t),function(){if(--t<1)return e.apply(this,arguments)}},Ln.ary=Co,Ln.assign=ba,Ln.assignIn=ya,Ln.assignInWith=va,Ln.assignWith=_a,Ln.at=wa,Ln.before=Oo,Ln.bind=To,Ln.bindAll=Qa,Ln.bindKey=ko,Ln.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Uo(t)?t:[t]},Ln.chain=co,Ln.chunk=function(t,e,n){e=(n?fs(t,e,n):e===r)?1:fn(da(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=i(ue(s/e));os?0:s+n),(i=i===r||i>s?s:da(i))<0&&(i+=s),i=n>i?0:pa(i);n>>0)?(t=ma(t))&&("string"==typeof e||null!=e&&!ia(e))&&!(e=rr(e))&&nn(t)?mr(cn(t),0,n):t.split(e,n):[]},Ln.spread=function(t,e){if("function"!=typeof t)throw new Ot(s);return e=null==e?0:fn(da(e),0),Gi(function(n){var i=n[e],r=mr(n,0,e);return i&&Pe(r,i),we(t,this,r)})},Ln.tail=function(t){var e=null==t?0:t.length;return e?Zi(t,1,e):[]},Ln.take=function(t,e,n){return t&&t.length?Zi(t,0,(e=n||e===r?1:da(e))<0?0:e):[]},Ln.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?Zi(t,(e=i-(e=n||e===r?1:da(e)))<0?0:e,i):[]},Ln.takeRightWhile=function(t,e){return t&&t.length?lr(t,is(e,3),!1,!0):[]},Ln.takeWhile=function(t,e){return t&&t.length?lr(t,is(e,3)):[]},Ln.tap=function(t,e){return e(t),t},Ln.throttle=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new Ot(s);return Zo(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Ao(t,e,{leading:i,maxWait:e,trailing:r})},Ln.thru=uo,Ln.toArray=ua,Ln.toPairs=La,Ln.toPairsIn=ja,Ln.toPath=function(t){return Uo(t)?Ae(t,Rs):oa(t)?[t]:Er(Ds(ma(t)))},Ln.toPlainObject=ga,Ln.transform=function(t,e,n){var i=Uo(t),r=i||Wo(t)||aa(t);if(e=is(e,4),null==n){var s=t&&t.constructor;n=r?i?new s:[]:Zo(t)&&Yo(s)?jn(Ut(t)):{}}return(r?Se:mi)(t,function(t,i,r){return e(n,t,i,r)}),n},Ln.unary=function(t){return Co(t,1)},Ln.union=Zs,Ln.unionBy=Js,Ln.unionWith=to,Ln.uniq=function(t){return t&&t.length?sr(t):[]},Ln.uniqBy=function(t,e){return t&&t.length?sr(t,is(e,2)):[]},Ln.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?sr(t,r,e):[]},Ln.unset=function(t,e){return null==t||or(t,e)},Ln.unzip=eo,Ln.unzipWith=no,Ln.update=function(t,e,n){return null==t?t:ar(t,e,pr(n))},Ln.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:ar(t,e,pr(n),i)},Ln.values=Fa,Ln.valuesIn=function(t){return null==t?[]:Xe(t,Pa(t))},Ln.without=io,Ln.words=Ya,Ln.wrap=function(t,e){return No(pr(e),t)},Ln.xor=ro,Ln.xorBy=so,Ln.xorWith=oo,Ln.zip=ao,Ln.zipObject=function(t,e){return hr(t||[],e||[],Qn)},Ln.zipObjectDeep=function(t,e){return hr(t||[],e||[],Xi)},Ln.zipWith=lo,Ln.entries=La,Ln.entriesIn=ja,Ln.extend=ya,Ln.extendWith=va,sl(Ln,Ln),Ln.add=gl,Ln.attempt=Ka,Ln.camelCase=Ba,Ln.capitalize=Va,Ln.ceil=ml,Ln.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=fa(n))==n?n:0),e!==r&&(e=(e=fa(e))==e?e:0),ii(fa(t),e,n)},Ln.clone=function(t){return ri(t,4)},Ln.cloneDeep=function(t){return ri(t,5)},Ln.cloneDeepWith=function(t,e){return ri(t,5,e="function"==typeof e?e:r)},Ln.cloneWith=function(t,e){return ri(t,4,e="function"==typeof e?e:r)},Ln.conformsTo=function(t,e){return null==e||si(t,e,Aa(e))},Ln.deburr=za,Ln.defaultTo=function(t,e){return null==t||t!=t?e:t},Ln.divide=bl,Ln.endsWith=function(t,e,n){t=ma(t),e=rr(e);var i=t.length,s=n=n===r?i:ii(da(n),0,i);return(n-=e.length)>=0&&t.slice(n,s)==e},Ln.eq=Fo,Ln.escape=function(t){return(t=ma(t))&&q.test(t)?t.replace(G,tn):t},Ln.escapeRegExp=function(t){return(t=ma(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Ln.every=function(t,e,n){var i=Uo(t)?Ce:ui;return n&&fs(t,e,n)&&(e=r),i(t,is(e,3))},Ln.find=fo,Ln.findIndex=Vs,Ln.findKey=function(t,e){return Ne(t,is(e,3),mi)},Ln.findLast=go,Ln.findLastIndex=zs,Ln.findLastKey=function(t,e){return Ne(t,is(e,3),bi)},Ln.floor=yl,Ln.forEach=mo,Ln.forEachRight=bo,Ln.forIn=function(t,e){return null==t?t:fi(t,is(e,3),Pa)},Ln.forInRight=function(t,e){return null==t?t:gi(t,is(e,3),Pa)},Ln.forOwn=function(t,e){return t&&mi(t,is(e,3))},Ln.forOwnRight=function(t,e){return t&&bi(t,is(e,3))},Ln.get=Ea,Ln.gt=Bo,Ln.gte=Vo,Ln.has=function(t,e){return null!=t&&us(t,e,Si)},Ln.hasIn=Ca,Ln.head=Hs,Ln.identity=el,Ln.includes=function(t,e,n,i){t=$o(t)?t:Fa(t),n=n&&!i?da(n):0;var r=t.length;return n<0&&(n=fn(r+n,0)),sa(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&je(t,e,n)>-1},Ln.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:da(n);return r<0&&(r=fn(i+r,0)),je(t,e,r)},Ln.inRange=function(t,e,n){return e=ha(e),n===r?(n=e,e=0):n=ha(n),function(t,e,n){return t>=gn(e,n)&&t=-h&&t<=h},Ln.isSet=ra,Ln.isString=sa,Ln.isSymbol=oa,Ln.isTypedArray=aa,Ln.isUndefined=function(t){return t===r},Ln.isWeakMap=function(t){return Jo(t)&&cs(t)==A},Ln.isWeakSet=function(t){return Jo(t)&&"[object WeakSet]"==wi(t)},Ln.join=function(t,e){return null==t?"":Ue.call(t,e)},Ln.kebabCase=Ua,Ln.last=qs,Ln.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var s=i;return n!==r&&(s=(s=da(n))<0?fn(i+s,0):gn(s,i-1)),e==e?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(t,e,s):Le(t,Be,s,!0)},Ln.lowerCase=Ha,Ln.lowerFirst=$a,Ln.lt=la,Ln.lte=ca,Ln.max=function(t){return t&&t.length?hi(t,el,xi):r},Ln.maxBy=function(t,e){return t&&t.length?hi(t,is(e,2),xi):r},Ln.mean=function(t){return Ve(t,el)},Ln.meanBy=function(t,e){return Ve(t,is(e,2))},Ln.min=function(t){return t&&t.length?hi(t,el,Di):r},Ln.minBy=function(t,e){return t&&t.length?hi(t,is(e,2),Di):r},Ln.stubArray=pl,Ln.stubFalse=fl,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=vl,Ln.nth=function(t,e){return t&&t.length?Fi(t,da(e)):r},Ln.noConflict=function(){return ce._===this&&(ce._=Lt),this},Ln.noop=ol,Ln.now=Eo,Ln.pad=function(t,e,n){t=ma(t);var i=(e=da(e))?ln(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return Br(he(r),n)+t+Br(ue(r),n)},Ln.padEnd=function(t,e,n){t=ma(t);var i=(e=da(e))?ln(t):0;return e&&ie){var i=t;t=e,e=i}if(n||t%1||e%1){var s=yn();return gn(t+s*(e-t+se("1e-"+((s+"").length-1))),e)}return Hi(t,e)},Ln.reduce=function(t,e,n){var i=Uo(t)?Ie:He,r=arguments.length<3;return i(t,is(e,4),n,r,li)},Ln.reduceRight=function(t,e,n){var i=Uo(t)?Me:He,r=arguments.length<3;return i(t,is(e,4),n,r,ci)},Ln.repeat=function(t,e,n){return e=(n?fs(t,e,n):e===r)?1:da(e),$i(ma(t),e)},Ln.replace=function(){var t=arguments,e=ma(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Ln.result=function(t,e,n){var i=-1,s=(e=fr(e,t)).length;for(s||(s=1,t=r);++ih)return[];var n=d,i=gn(t,d);e=is(e),t-=d;for(var r=Ge(i,e);++n=o)return t;var l=n-ln(i);if(l<1)return i;var c=a?mr(a,0,l).join(""):t.slice(0,l);if(s===r)return c+i;if(a&&(l+=c.length-l),ia(s)){if(t.slice(l).search(s)){var u,h=c;for(s.global||(s=Et(s.source,ma(ht.exec(s))+"g")),s.lastIndex=0;u=s.exec(h);)var d=u.index;c=c.slice(0,d===r?l:d)}}else if(t.indexOf(rr(s),l)!=l){var p=c.lastIndexOf(s);p>-1&&(c=c.slice(0,p))}return c+i},Ln.unescape=function(t){return(t=ma(t))&&W.test(t)?t.replace($,hn):t},Ln.uniqueId=function(t){var e=++Mt;return ma(t)+e},Ln.upperCase=qa,Ln.upperFirst=Xa,Ln.each=mo,Ln.eachRight=bo,Ln.first=Hs,sl(Ln,function(){var t={};return mi(Ln,function(e,n){It.call(Ln.prototype,n)||(t[n]=e)}),t}(),{chain:!1}),Ln.VERSION="4.17.21",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Ln[t].placeholder=Ln}),Se(["drop","take"],function(t,e){Vn.prototype[t]=function(n){n=n===r?1:fn(da(n),0);var i=this.__filtered__&&!e?new Vn(this):this.clone();return i.__filtered__?i.__takeCount__=gn(n,i.__takeCount__):i.__views__.push({size:gn(n,d),type:t+(i.__dir__<0?"Right":"")}),i},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Se(["filter","map","takeWhile"],function(t,e){var n=e+1,i=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:is(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}}),Se(["head","last"],function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}}),Se(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}}),Vn.prototype.compact=function(){return this.filter(el)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Gi(function(t,e){return"function"==typeof t?new Vn(this):this.map(function(n){return Oi(n,t,e)})}),Vn.prototype.reject=function(t){return this.filter(Do(is(t)))},Vn.prototype.slice=function(t,e){t=da(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=da(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(d)},mi(Vn.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),s=Ln[i?"take"+("last"==e?"Right":""):e],o=i||/^find/.test(e);!s||(Ln.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,l=e instanceof Vn,c=a[0],u=l||Uo(e),h=function(t){var e=s.apply(Ln,Pe([t],a));return i&&d?e[0]:e};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=o&&!d,g=l&&!p;if(!o&&u){e=g?e:new Vn(this);var m=t.apply(e,a);return m.__actions__.push({func:uo,args:[h],thisArg:r}),new Bn(m,d)}return f&&g?t.apply(this,a):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})}),Se(["pop","push","shift","sort","splice","unshift"],function(t){var e=Tt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Ln.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(Uo(r)?r:[],t)}return this[n](function(n){return e.apply(Uo(n)?n:[],t)})}}),mi(Vn.prototype,function(t,e){var n=Ln[e];if(n){var i=n.name+"";It.call(Tn,i)||(Tn[i]=[]),Tn[i].push({name:e,func:n})}}),Tn[Nr(r,2).name]=[{name:"wrapper",func:r}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Er(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Er(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Er(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Uo(t),i=e<0,r=n?t.length:0,s=function(t,e,n){for(var i=-1,r=n.length;++i=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Ln.prototype.plant=function(t){for(var e,n=this;n instanceof Fn;){var i=Ls(n);i.__index__=0,i.__values__=r,e?s.__wrapped__=i:e=i;var s=i;n=n.__wrapped__}return s.__wrapped__=t,e},Ln.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:uo,args:[Qs],thisArg:r}),new Bn(e,this.__chain__)}return this.thru(Qs)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return cr(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,qt&&(Ln.prototype[qt]=function(){return this}),Ln}();ce._=dn,(i=(function(){return dn}).call(e,n,e,t))!==r&&(t.exports=i)}).call(this)},5478:function(t){t.exports=function(){"use strict";function t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i={exports:{}};function r(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}i.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:r,changeDefaults:function(t){i.exports.defaults=t}};var s=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,c={"&":"&","<":"<",">":">",'"':""","'":"'"},u=function(t){return c[t]};var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(t){return t.replace(h,function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""})}var p=/(^|[^\[])\^/g;var f=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var m={},b=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(t,e){m[" "+t]||(m[" "+t]=b.test(t)?t+"/":w(t,"/",!0));var n=-1===(t=m[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(y,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(v,"$1")+e:t+e}function w(t,e,n){var i=t.length;if(0===i)return"";for(var r=0;r1;)1&e&&(n+=t),e>>=1,t+=t;return n+t},P=i.exports.defaults,I=w,M=function(t,e){var n=t.replace(/\|/g,function(t,e,n){for(var i=!1,r=e;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/),i=0;if(n.length>e)n.splice(e);else for(;n.length1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t){var e=this.rules.block.code.exec(t);if(e){var n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:I(n,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map(function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=i.length?t.slice(i.length):t}).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e){var n=e[2].trim();if(/#$/.test(n)){var i=I(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n}}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:M(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){var n,i,r,s,o,a,l,c,u,h=e[0],d=e[2],p=d.length>1,f={type:"list",raw:h,ordered:p,start:p?+d.slice(0,-1):"",loose:!1,items:[]},g=e[0].match(this.rules.block.item),m=!1,b=g.length;r=this.rules.block.listItemStart.exec(g[0]);for(var y=0;yr[1].length:s[1].length>=r[0].length||s[1].length>3){g.splice(y,2,g[y]+(!this.options.pedantic&&s[1].length/i.test(i[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):D(i[0]):i[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=e[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;var i=I(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=R(e[2],"()");if(r>-1){var s=(0===e[0].indexOf("!")?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,s).trim(),e[3]=""}}var o=e[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);l&&(o=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o.slice(1):o.slice(1,-1)),N(e,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:a&&a.replace(this.rules.inline._escapes,"$1")},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=e[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return N(n,i,n[0])}},e.emStrong=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(t);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var s,o,a=i[0].length-1,l=a,c=0,u="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+a);null!=(i=u.exec(e));)if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6]){if(o=s.length,i[3]||i[4]){l+=o;continue}if((i[5]||i[6])&&a%3&&!((a+o)%3)){c+=o;continue}if(!((l-=o)>0))return o=Math.min(o,o+l+c),Math.min(a,o)%2?{type:"em",raw:t.slice(0,a+i.index+o+1),text:t.slice(1,a+i.index+o)}:{type:"strong",raw:t.slice(0,a+i.index+o+1),text:t.slice(2,a+i.index+o-1)}}}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=D(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2]}},e.autolink=function(t,e){var n,i,r=this.rules.inline.autolink.exec(t);if(r)return i="@"===r[2]?"mailto:"+(n=D(this.options.mangle?e(r[1]):r[1])):n=D(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var i,r;if("@"===n[2])r="mailto:"+(i=D(this.options.mangle?e(n[0]):n[0]));else{var s;do{s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(s!==n[0]);i=D(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},e.inlineText=function(t,e,n){var i,r=this.rules.inline.text.exec(t);if(r)return i=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):D(r[0]):r[0]:D(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},t}(),j=O,F=E,B=T,V={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:j,table:j,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};V.def=F(V.def).replace("label",V._label).replace("title",V._title).getRegex(),V.bullet=/(?:[*+-]|\d{1,9}[.)])/,V.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,V.item=F(V.item,"gm").replace(/bull/g,V.bullet).getRegex(),V.listItemStart=F(/^( *)(bull) */).replace("bull",V.bullet).getRegex(),V.list=F(V.list).replace(/bull/g,V.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+V.def.source+")").getRegex(),V._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V._comment=/|$)/,V.html=F(V.html,"i").replace("comment",V._comment).replace("tag",V._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),V.paragraph=F(V._paragraph).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.blockquote=F(V.blockquote).replace("paragraph",V.paragraph).getRegex(),V.normal=B({},V),V.gfm=B({},V.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),V.gfm.nptable=F(V.gfm.nptable).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.gfm.table=F(V.gfm.table).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.pedantic=B({},V.normal,{html:F("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",V._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:j,paragraph:F(V.normal._paragraph).replace("hr",V.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",V.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:j,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};z.punctuation=F(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,z.escapedEmSt=/\\\*|\\_/g,z._comment=F(V._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),z.emStrong.lDelim=F(z.emStrong.lDelim).replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimAst=F(z.emStrong.rDelimAst,"g").replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimUnd=F(z.emStrong.rDelimUnd,"g").replace(/punct/g,z._punctuation).getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,z.autolink=F(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=F(z.tag).replace("comment",z._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=F(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=F(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=F(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=B({},z),z.pedantic=B({},z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:F(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=B({},z.normal,{escape:F(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var K=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||$,this.options.tokenizer=this.options.tokenizer||new H,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:G.normal,inline:W.normal};this.options.pedantic?(e.block=G.pedantic,e.inline=W.pedantic):this.options.gfm&&(e.block=G.gfm,e.inline=this.options.breaks?W.breaks:W.gfm),this.tokenizer.rules=e}e.lex=function(t,n){return new e(n).lex(t)},e.lexInline=function(t,n){return new e(n).inlineTokens(t)};var n=e.prototype;return n.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(t,e,n){var i,r,s,o,a,l,c=this;for(void 0===e&&(e=[]),void 0===n&&(n=!0),this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(n){return!!(i=n.call(c,t,e))&&(t=t.substring(i.raw.length),e.push(i),!0)}))){if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length),i.type&&e.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length),(o=e[e.length-1])&&"paragraph"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.nptable(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),e.push(i);continue}if(i=this.tokenizer.list(t)){for(t=t.substring(i.raw.length),s=i.items.length,r=0;r=0&&(e=Math.min(e,i))}),e<1/0&&e>=0&&(a=t.substring(0,e+1))}(),n&&(i=this.tokenizer.paragraph(a))){o=e[e.length-1],l&&"paragraph"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i),l=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length),(o=e[e.length-1])&&"text"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i);continue}if(t){var u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}throw new Error(u)}}return e},n.inline=function(t){var e,n,i,r,s,o,a=t.length;for(e=0;e0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,l.index)+"["+q("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,l.index)+"["+q("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,l.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(c||(u=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(n){return!!(s=n.call(r,t,e))&&(t=t.substring(s.raw.length),e.push(s),!0)}))){if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.tag(t,n,i)){t=t.substring(s.raw.length),n=s.inLink,i=s.inRawBlock,(o=e[e.length-1])&&"text"===s.type&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,i)),e.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length),o=e[e.length-1],"link"===s.type?(s.tokens=this.inlineTokens(s.text,[],!0,i),e.push(s)):o&&"text"===s.type&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(s=this.tokenizer.emStrong(t,h,u)){t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,i),e.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,i),e.push(s);continue}if(s=this.tokenizer.autolink(t,Y)){t=t.substring(s.raw.length),e.push(s);continue}if(!n&&(s=this.tokenizer.url(t,Y))){t=t.substring(s.raw.length),e.push(s);continue}if(a=t,this.options.extensions&&this.options.extensions.startInline&&function(){var e=1/0,n=t.slice(1),i=void 0;r.options.extensions.startInline.forEach(function(t){"number"==typeof(i=t.call(this,n))&&i>=0&&(e=Math.min(e,i))}),e<1/0&&e>=0&&(a=t.substring(0,e+1))}(),s=this.tokenizer.inlineText(a,i,X)){t=t.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(u=s.raw.slice(-1)),c=!0,(o=e[e.length-1])&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(t){var p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}throw new Error(p)}}return e},function(e,n,i){n&&t(e.prototype,n),i&&t(e,i)}(e,null,[{key:"rules",get:function(){return{block:G,inline:W}}}]),e}(),Q=i.exports.defaults,Z=C,J=x,tt=function(){function t(t){this.options=t||Q}var e=t.prototype;return e.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,i);null!=r&&r!==t&&(n=!0,t=r)}return t=t.replace(/\n$/,"")+"\n",i?'
    '+(n?t:J(t,!0))+"
    \n":"
    "+(n?t:J(t,!0))+"
    \n"},e.blockquote=function(t){return"
    \n"+t+"
    \n"},e.html=function(t){return t},e.heading=function(t,e,n,i){return this.options.headerIds?"'+t+"\n":""+t+"\n"},e.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},e.list=function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"\n"},e.listitem=function(t){return"
  • "+t+"
  • \n"},e.checkbox=function(t){return" "},e.paragraph=function(t){return"

    "+t+"

    \n"},e.table=function(t,e){return e&&(e=""+e+""),"\n\n"+t+"\n"+e+"
    \n"},e.tablerow=function(t){return"\n"+t+"\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"\n"},e.strong=function(t){return""+t+""},e.em=function(t){return""+t+""},e.codespan=function(t){return""+t+""},e.br=function(){return this.options.xhtml?"
    ":"
    "},e.del=function(t){return""+t+""},e.link=function(t,e,n){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return n;var i='"+n+""},e.image=function(t,e,n){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return n;var i=''+n+'":">")},e.text=function(t){return t},t}(),et=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),nt=function(){function t(){this.seen={}}var e=t.prototype;return e.serialize=function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},e.getNextSafeSlug=function(t,e){var n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do{n=t+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=i,this.seen[n]=0),n},e.slug=function(t,e){void 0===e&&(e={});var n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)},t}(),it=tt,rt=et,st=nt,ot=i.exports.defaults,at=S,lt=K,ct=function(){function t(t){this.options=t||ot,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rt,this.slugger=new st}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,i,r,s,o,a,l,c,u,h,d,p,f,g,m,b,y,v,_,w="",x=t.length;for(n=0;n0&&"text"===m.tokens[0].type?(m.tokens[0].text=v+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=v+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:v}):g+=v),g+=this.parse(m.tokens,f),u+=this.renderer.listitem(g,y,b);w+=this.renderer.list(u,d,p);continue;case"html":w+=this.renderer.html(h.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+mt(l.message+"",!0)+"
    ";throw l}}return _t.options=_t.setOptions=function(t){return ft(_t.defaults,t),yt(_t.defaults),_t},_t.getDefaults=bt,_t.defaults=vt,_t.use=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;iAn error occurred:

    "+mt(i.message+"",!0)+"
    ";throw i}},_t.Parser=ct,_t.parser=ct.parse,_t.Renderer=ht,_t.TextRenderer=dt,_t.Lexer=lt,_t.lexer=lt.lex,_t.Tokenizer=ut,_t.Slugger=pt,_t.parse=_t,_t}()},29369:function(t,e,n){var i=n(56284),r=n(67830);function s(){this.clear()}s.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},s.prototype.enqueue=function(t){return this.items.push(t),++this.size},s.prototype.dequeue=function(){if(this.size){var t=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,t}},s.prototype.peek=function(){if(this.size)return this.items[this.offset]},s.prototype.forEach=function(t,e){e=arguments.length>1?e:this;for(var n=this.offset,i=0,r=this.items.length;n=t.length)return{done:!0};var n=t[e];return e++,{value:n,done:!1}})},s.prototype.entries=function(){var t=this.items,e=this.offset,n=0;return new i(function(){if(e>=t.length)return{done:!0};var i=t[e];return e++,{value:[n++,i],done:!1}})},"undefined"!=typeof Symbol&&(s.prototype[Symbol.iterator]=s.prototype.values),s.prototype.toString=function(){return this.toArray().join(",")},s.prototype.toJSON=function(){return this.toArray()},s.prototype.inspect=function(){var t=this.toArray();return Object.defineProperty(t,"constructor",{value:s,enumerable:!1}),t},"undefined"!=typeof Symbol&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(t){var e=new s;return r(t,function(t){e.enqueue(t)}),e},s.of=function(){return s.from(arguments)},t.exports=s},65593:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(72293),o=function(t){function e(){t.apply(this,arguments),this.value=null,this.hasNext=!1,this.hasCompleted=!1}return i(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),s.Subscription.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(r.Subject);e.AsyncSubject=o},73907:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(6594),o=function(t){function e(e){t.call(this),this._value=e}return i(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new s.ObjectUnsubscribedError;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(r.Subject);e.BehaviorSubject=o},36888:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n,i){t.call(this),this.parent=e,this.outerValue=n,this.outerIndex=i,this.index=0}return i(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n(42109).Subscriber);e.InnerSubscriber=r},94429:function(t,e,n){"use strict";var i=n(18705),r=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return i.Observable.of(this.value);case"E":return i.Observable.throw(this.error);case"C":return i.Observable.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();e.Notification=r},18705:function(t,e,n){"use strict";var i=n(80019),r=n(18154),s=n(45783),o=n(10142),a=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var i=this.operator,s=r.toSubscriber(t,e,n);if(i?i.call(s,this.source):s.add(this.source||!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var n=this;if(e||(i.root.Rx&&i.root.Rx.config&&i.root.Rx.config.Promise?e=i.root.Rx.config.Promise:i.root.Promise&&(e=i.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,i){var r;r=n.subscribe(function(e){if(r)try{t(e)}catch(n){i(n),r.unsubscribe()}else t(e)},i,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[s.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;ee&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i},e}(r.Subject);e.ReplaySubject=u;var h=function(t,e){this.time=t,this.value=e}},25430:function(t,e,n){"use strict";var i=n(2369);e.xQ=i.Subject,n(18705),n(24769),n(95914),n(88007),n(3194),n(61898),n(16301),n(23276),n(66593),n(13745),n(57362),n(24518),n(68789),n(30520),n(67370),n(86866),n(11505),n(5031),n(36780),n(17038),n(15718),n(27915),n(90763),n(6846),n(65662),n(6799),n(81854),n(612),n(10838),n(6725),n(8827),n(43511),n(38922),n(25178),n(56937),n(22947),n(82894),n(11206),n(94183),n(16653),n(17930),n(81118),n(50317),n(90674),n(66460),n(79232),n(3945),n(44674),n(73505),n(38749),n(16479),n(22744),n(44475),n(97384),n(8237),n(24937),n(99013),n(84042),n(44436),n(7099),n(6217),n(57476),n(72646),n(91573),n(27387),n(27366),n(88859),n(65425),n(16733),n(23381),n(80404),n(63770),n(53626),n(98851),n(84878),n(26544),n(53582),n(61749),n(34838),n(49681),n(46227),n(56455),n(40881),n(94315),n(92910),n(52442),n(84664),n(61250),n(28310),n(43027),n(18252),n(49571),n(31782),n(9800),n(41854),n(74839),n(1305),n(99144),n(89952),n(85863),n(2865),n(92667),n(22185),n(72919),n(88630),n(75458),n(40780),n(35099),n(57502),n(81676),n(20579),n(71323),n(84950),n(57113),n(95073),n(75654),n(59889),n(96611),n(81845),n(7828),n(4881),n(74568),n(32352),n(50169),n(93543),n(61690),n(15914),n(68583),n(44808),n(49088),n(72293),n(42109),n(65593),n(81959),n(73907),n(51493),n(94429),n(44640),n(11758),n(6594),n(13815),n(84536),n(73390),n(62688),n(24482),n(18353);n(55298);n(10142);n(85522),n(90680),n(97088),n(12948),n(28592),n(72121),n(45783);n(39053)},11965:function(t,e){"use strict";var n=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=Date.now?Date.now:function(){return+new Date},t}();e.Scheduler=n},2369:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(42109),o=n(72293),a=n(6594),l=n(9060),c=n(28592),u=function(t){function e(e){t.call(this,e),this.destination=e}return i(e,t),e}(s.Subscriber);e.SubjectSubscriber=u;var h=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return i(e,t),e.prototype[c.rxSubscriber]=function(){return new u(this)},e.prototype.lift=function(t){var e=new d(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,n=e.length,i=e.slice(),r=0;r=t.length)return void i.complete();i.next(e[n]),t.index=n+1,this.schedule(t)}},e.prototype._subscribe=function(t){var n=this.arrayLike,i=this.scheduler,r=n.length;if(i)return i.schedule(e.dispatch,0,{arrayLike:n,index:0,length:r,subscriber:t});for(var s=0;s1?new e(t,i):1===r?new s.ScalarObservable(t[0],i):new o.EmptyObservable(i)},e.dispatch=function(t){var e=t.array,n=t.index,i=t.subscriber;n>=t.count?i.complete():(i.next(e[n]),!i.closed&&(t.index=n+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.array,i=n.length,r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{array:n,index:0,count:i,subscriber:t});for(var s=0;s1)this.connection=null;else{var n=this.connection,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null}}(o.Subscriber)},34078:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(93658),o=n(84308),a=function(t){function e(e){t.call(this),this.observableFactory=e}return i(e,t),e.create=function(t){return new e(t)},e.prototype._subscribe=function(t){return new l(t,this.observableFactory)},e}(r.Observable);e.DeferObservable=a;var l=function(t){function e(e,n){t.call(this,e),this.factory=n,this.tryDefer()}return i(e,t),e.prototype.tryDefer=function(){try{this._callFactory()}catch(t){this._error(t)}},e.prototype._callFactory=function(){var t=this.factory();t&&this.add(s.subscribeToResult(this,t))},e}(o.OuterSubscriber)},70481:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e){t.call(this),this.scheduler=e}return i(e,t),e.create=function(t){return new e(t)},e.dispatch=function(t){t.subscriber.complete()},e.prototype._subscribe=function(t){var n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{subscriber:t});t.complete()},e}(n(18705).Observable);e.EmptyObservable=r},72210:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this),this.error=e,this.scheduler=n}return i(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){t.subscriber.error(t.error)},e.prototype._subscribe=function(t){var n=this.error,i=this.scheduler;if(t.syncErrorThrowable=!0,i)return i.schedule(e.dispatch,0,{error:n,subscriber:t});t.error(n)},e}(n(18705).Observable);e.ErrorObservable=r},56064:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(70481),o=n(48242),a=n(93658),l=n(84308),c=function(t){function e(e,n){t.call(this),this.sources=e,this.resultSelector=n}return i(e,t),e.create=function(){for(var t=[],n=0;nu?u:e:e}(t)),this.arr=t,this.idx=e,this.len=n}return t.prototype[o.iterator]=function(){return this},t.prototype.next=function(){return this.idx=t.count?i.complete():(i.next(e),!i.closed&&(t.index=n+1,t.start=e+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=0,i=this.start,r=this._count,s=this.scheduler;if(s)return s.schedule(e.dispatch,0,{index:n,count:r,start:i,subscriber:t});for(;;){if(n++>=r){t.complete();break}if(t.next(i++),t.closed)break}},e}(n(18705).Observable);e.RangeObservable=r},80478:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this),this.value=e,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return i(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){var e=t.value,n=t.subscriber;t.done?n.complete():(n.next(e),!n.closed&&(t.done=!0,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.value,i=this.scheduler;if(i)return i.schedule(e.dispatch,0,{done:!1,value:n,subscriber:t});t.next(n),t.closed||t.complete()},e}(n(18705).Observable);e.ScalarObservable=r},82966:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(85522),o=n(39479),a=function(t){function e(e,n,i){void 0===n&&(n=0),void 0===i&&(i=s.asap),t.call(this),this.source=e,this.delayTime=n,this.scheduler=i,(!o.isNumeric(n)||n<0)&&(this.delayTime=0),(!i||"function"!=typeof i.schedule)&&(this.scheduler=s.asap)}return i(e,t),e.create=function(t,n,i){return void 0===n&&(n=0),void 0===i&&(i=s.asap),new e(t,n,i)},e.dispatch=function(t){return this.add(t.source.subscribe(t.subscriber))},e.prototype._subscribe=function(t){return this.scheduler.schedule(e.dispatch,this.delayTime,{source:this.source,subscriber:t})},e}(r.Observable);e.SubscribeOnObservable=a},92870:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(39479),s=n(18705),o=n(90680),a=n(41503),l=n(783),c=function(t){function e(e,n,i){void 0===e&&(e=0),t.call(this),this.period=-1,this.dueTime=0,r.isNumeric(n)?this.period=Number(n)<1?1:Number(n):a.isScheduler(n)&&(i=n),a.isScheduler(i)||(i=o.async),this.scheduler=i,this.dueTime=l.isDate(e)?+e-this.scheduler.now():e}return i(e,t),e.create=function(t,n,i){return void 0===t&&(t=0),new e(t,n,i)},e.dispatch=function(t){var e=t.index,n=t.period,i=t.subscriber;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}},e.prototype._subscribe=function(t){var n=this;return n.scheduler.schedule(e.dispatch,n.dueTime,{index:0,period:n.period,subscriber:t})},e}(s.Observable);e.TimerObservable=c},16196:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(93658),o=n(84308),a=function(t){function e(e,n){t.call(this),this.resourceFactory=e,this.observableFactory=n}return i(e,t),e.create=function(t,n){return new e(t,n)},e.prototype._subscribe=function(t){var e,n=this.resourceFactory,i=this.observableFactory;try{return e=n(),new l(t,e,i)}catch(r){t.error(r)}},e}(r.Observable);e.UsingObservable=a;var l=function(t){function e(e,n,i){t.call(this,e),this.resource=n,this.observableFactory=i,e.add(n),this.tryUse()}return i(e,t),e.prototype.tryUse=function(){try{var t=this.observableFactory.call(this,this.resource);t&&this.add(s.subscribeToResult(this,t))}catch(e){this._error(e)}},e}(o.OuterSubscriber)},59246:function(t,e,n){"use strict";var i=n(19183);e.bindCallback=i.BoundCallbackObservable.create},65571:function(t,e,n){"use strict";var i=n(78655);e.bindNodeCallback=i.BoundNodeCallbackObservable.create},24669:function(t,e,n){"use strict";var i=n(41503),r=n(48242),s=n(96177),o=n(49134);e.combineLatest=function(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof l&&(n=t.pop()),null===a&&1===t.length&&t[0]instanceof i.Observable?t[0]:o.mergeAll(n)(new r.ArrayObservable(t,a))}},94503:function(t,e,n){"use strict";var i=n(20143);e.never=i.NeverObservable.create},69657:function(t,e,n){"use strict";var i=n(96177);e.of=i.ArrayObservable.of},61395:function(t,e,n){"use strict";var i=n(46243);e.onErrorResumeNext=i.onErrorResumeNextStatic},95425:function(t,e,n){"use strict";var i=n(19770);e.pairs=i.PairsObservable.create},24330:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(48242),s=n(96177),o=n(84308),a=n(93658);e.race=function(){for(var t=[],e=0;e=2&&(o=arguments[1]);var a=Number.POSITIVE_INFINITY;return e>=3&&(a=arguments[2]),s.bufferTime(t,o,a,n)(this)}},92523:function(t,e,n){"use strict";var i=n(15440);e.bufferToggle=function(t,e){return i.bufferToggle(t,e)(this)}},49436:function(t,e,n){"use strict";var i=n(51786);e.bufferWhen=function(t){return i.bufferWhen(t)(this)}},64731:function(t,e,n){"use strict";var i=n(93017);e._catch=function(t){return i.catchError(t)(this)}},92273:function(t,e,n){"use strict";var i=n(17054);e.combineAll=function(t){return i.combineAll(t)(this)}},8709:function(t,e,n){"use strict";var i=n(49134);e.combineLatest=function(){for(var t=[],e=0;e=2?i.reduce(t,e)(this):i.reduce(t)(this)}},12931:function(t,e,n){"use strict";var i=n(15329);e.repeat=function(t){return void 0===t&&(t=-1),i.repeat(t)(this)}},68816:function(t,e,n){"use strict";var i=n(63964);e.repeatWhen=function(t){return i.repeatWhen(t)(this)}},17144:function(t,e,n){"use strict";var i=n(40241);e.retry=function(t){return void 0===t&&(t=-1),i.retry(t)(this)}},82766:function(t,e,n){"use strict";var i=n(23896);e.retryWhen=function(t){return i.retryWhen(t)(this)}},62068:function(t,e,n){"use strict";var i=n(92043);e.sample=function(t){return i.sample(t)(this)}},97013:function(t,e,n){"use strict";var i=n(90680),r=n(71239);e.sampleTime=function(t,e){return void 0===e&&(e=i.async),r.sampleTime(t,e)(this)}},98996:function(t,e,n){"use strict";var i=n(64949);e.scan=function(t,e){return arguments.length>=2?i.scan(t,e)(this):i.scan(t)(this)}},77033:function(t,e,n){"use strict";var i=n(88948);e.sequenceEqual=function(t,e){return i.sequenceEqual(t,e)(this)}},10377:function(t,e,n){"use strict";var i=n(35473);e.share=function(){return i.share()(this)}},71623:function(t,e,n){"use strict";var i=n(62704);e.shareReplay=function(t,e,n){return i.shareReplay(t,e,n)(this)}},91956:function(t,e,n){"use strict";var i=n(92223);e.single=function(t){return i.single(t)(this)}},72355:function(t,e,n){"use strict";var i=n(11189);e.skip=function(t){return i.skip(t)(this)}},69329:function(t,e,n){"use strict";var i=n(73346);e.skipLast=function(t){return i.skipLast(t)(this)}},68481:function(t,e,n){"use strict";var i=n(12928);e.skipUntil=function(t){return i.skipUntil(t)(this)}},587:function(t,e,n){"use strict";var i=n(69415);e.skipWhile=function(t){return i.skipWhile(t)(this)}},49292:function(t,e,n){"use strict";var i=n(30673);e.startWith=function(){for(var t=[],e=0;e0&&this.destination.next(e),t.prototype._complete.call(this)},e}(r.Subscriber),a=function(t){function e(e,n,i){t.call(this,e),this.bufferSize=n,this.startBufferEvery=i,this.buffers=[],this.count=0}return i(e,t),e.prototype._next=function(t){var e=this,n=e.bufferSize,i=e.startBufferEvery,r=e.buffers,s=e.count;this.count++,s%i==0&&r.push([]);for(var o=r.length;o--;){var a=r[o];a.push(t),a.length===n&&(r.splice(o,1),this.destination.next(a))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var i=e.shift();i.length>0&&n.next(i)}t.prototype._complete.call(this)},e}(r.Subscriber)},6489:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(90680),s=n(42109),o=n(41503);e.bufferTime=function(t){var e=arguments.length,n=r.async;o.isScheduler(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var i=null;e>=2&&(i=arguments[1]);var s=Number.POSITIVE_INFINITY;return e>=3&&(s=arguments[2]),function(e){return e.lift(new a(t,i,s,n))}};var a=function(){function t(t,e,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),l=function(){this.buffer=[]},c=function(t){function e(e,n,i,r,s){t.call(this,e),this.bufferTimeSpan=n,this.bufferCreationInterval=i,this.maxBufferSize=r,this.scheduler=s,this.contexts=[];var o=this.openContext();if(this.timespanOnly=null==i||i<0,this.timespanOnly)this.add(o.closeAction=s.schedule(u,n,{subscriber:this,context:o,bufferTimeSpan:n}));else{var a={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:this,scheduler:s};this.add(o.closeAction=s.schedule(d,n,{subscriber:this,context:o})),this.add(s.schedule(h,i,a))}}return i(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,i=n.length,r=0;r0;){var i=e.shift();n.next(i.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan;this.add(t.closeAction=this.scheduler.schedule(u,n,{subscriber:this,context:t,bufferTimeSpan:n}))}},e.prototype.openContext=function(){var t=new l;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(s.Subscriber);function u(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function h(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,i=t.subscriber,r=t.scheduler,s=i.openContext();i.closed||(i.add(s.closeAction=r.schedule(d,n,{subscriber:i,context:s})),this.schedule(t,e))}function d(t){t.subscriber.closeContext(t.context)}},15440:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(72293),s=n(93658),o=n(84308);e.bufferToggle=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.openings,this.closingSelector))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(s.subscribeToResult(this,n))}return i(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,i=0;i0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(n){this._error(n)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.subscription;this.destination.next(t.buffer),e.splice(e.indexOf(t),1),this.remove(n),n.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new r.Subscription,i={buffer:[],subscription:n};e.push(i);var o=s.subscribeToResult(this,t,i);!o||o.closed?this.closeBuffer(i):(o.context=i,this.add(o),n.add(o))},e}(o.OuterSubscriber)},51786:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(72293),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.bufferWhen=function(t){return function(e){return e.lift(new c(t))}};var c=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.closingSelector))},t}(),u=function(t){function e(e,n){t.call(this,e),this.closingSelector=n,this.subscribing=!1,this.openBuffer()}return i(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,i,r){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe()),this.buffer&&this.destination.next(this.buffer),this.buffer=[];var e=s.tryCatch(this.closingSelector)();e===o.errorObject?this.error(o.errorObject.e):(t=new r.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(l.subscribeToResult(this,e)),this.subscribing=!1)},e}(a.OuterSubscriber)},93017:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.catchError=function(t){return function(e){var n=new o(t),i=e.lift(n);return n.caught=i}};var o=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.selector,this.caught))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.selector=n,this.caught=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(i){return void t.prototype.error.call(this,i)}this._unsubscribeAndRecycle(),this.add(s.subscribeToResult(this,n))}},e}(r.OuterSubscriber)},17054:function(t,e,n){"use strict";var i=n(49134);e.combineAll=function(t){return function(e){return e.lift(new i.CombineLatestOperator(t))}}},49134:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(96177),s=n(48242),o=n(84308),a=n(93658),l={};e.combineLatest=function(){for(var t=[],e=0;e0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){var s=Math.max(0,n[0].time-i.now());this.schedule(t,s)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new u(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(a.Notification.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t)},e.prototype._complete=function(){this.scheduleNotification(a.Notification.createComplete())},e}(o.Subscriber),u=function(t,e){this.time=t,this.notification=e}},22944:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(18705),o=n(84308),a=n(93658);e.delayWhen=function(t,e){return e?function(n){return new u(n,e).lift(new l(t))}:function(e){return e.lift(new l(t))}};var l=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.delayDurationSelector))},t}(),c=function(t){function e(e,n){t.call(this,e),this.delayDurationSelector=n,this.completed=!1,this.delayNotifierSubscriptions=[],this.values=[]}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.destination.next(t),this.removeSubscription(r),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){try{var e=this.delayDurationSelector(t);e&&this.tryDelay(e,t)}catch(n){this.destination.error(n)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t),n=null;return-1!==e&&(n=this.values[e],this.delayNotifierSubscriptions.splice(e,1),this.values.splice(e,1)),n},e.prototype.tryDelay=function(t,e){var n=a.subscribeToResult(this,t,e);n&&!n.closed&&(this.add(n),this.delayNotifierSubscriptions.push(n)),this.values.push(e)},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(o.OuterSubscriber),u=function(t){function e(e,n){t.call(this),this.source=e,this.subscriptionDelay=n}return i(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new h(t,this.source))},e}(s.Observable),h=function(t){function e(e,n){t.call(this),this.parent=e,this.source=n,this.sourceSubscribed=!1}return i(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(r.Subscriber)},95591:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.dematerialize=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new o(t))},t}(),o=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(r.Subscriber)},25753:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658),o=n(40317);e.distinct=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.keySelector,this.flushes))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.keySelector=n,this.values=new o.Set,i&&this.add(s.subscribeToResult(this,i))}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(i){return void n.error(i)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(r.OuterSubscriber);e.DistinctSubscriber=l},65608:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(33463),o=n(85814);e.distinctUntilChanged=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.compare,this.keySelector))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.keySelector=i,this.hasKey=!1,"function"==typeof n&&(this.compare=n)}return i(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e=t;if(this.keySelector&&(e=s.tryCatch(this.keySelector)(t))===o.errorObject)return this.destination.error(o.errorObject.e);var n=!1;if(this.hasKey){if((n=s.tryCatch(this.compare)(this.key,e))===o.errorObject)return this.destination.error(o.errorObject.e)}else this.hasKey=!0;!1===Boolean(n)&&(this.key=e,this.destination.next(t))},e}(r.Subscriber)},8330:function(t,e,n){"use strict";var i=n(65608);e.distinctUntilKeyChanged=function(t,e){return i.distinctUntilChanged(function(n,i){return e?e(n[t],i[t]):n[t]===i[t]})}},29264:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758);e.elementAt=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){if(this.index=t,this.defaultValue=e,t<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.index,this.defaultValue))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.index=n,this.defaultValue=i}return i(e,t),e.prototype._next=function(t){0==this.index--&&(this.destination.next(t),this.destination.complete())},e.prototype._complete=function(){var t=this.destination;this.index>=0&&(void 0!==this.defaultValue?t.next(this.defaultValue):t.error(new s.ArgumentOutOfRangeError)),t.complete()},e}(r.Subscriber)},26285:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.every=function(t,e){return function(n){return n.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.thisArg,this.source))},t}(),o=function(t){function e(e,n,i,r){t.call(this,e),this.predicate=n,this.thisArg=i,this.source=r,this.index=0,this.thisArg=i||this}return i(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(n){return void this.destination.error(n)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(r.Subscriber)},93229:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.exhaust=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){t.call(this,e),this.hasCompleted=!1,this.hasSubscription=!1}return i(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(s.subscribeToResult(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber)},15758:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.exhaustMap=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.resultSelector=i,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}return i(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e=this.index++,n=this.destination;try{var i=this.project(t,e);this.hasSubscription=!0,this.add(s.subscribeToResult(this,i,t,e))}catch(r){n.error(r)}},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyNext=function(t,e,n,i,r){var s=this.destination;this.resultSelector?this.trySelectResult(t,e,n,i):s.next(e)},e.prototype.trySelectResult=function(t,e,n,i){var r=this.resultSelector,s=this.destination;try{var o=r(t,e,n,i);s.next(o)}catch(a){s.error(a)}},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber)},55364:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(33463),s=n(85814),o=n(84308),a=n(93658);e.expand=function(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(i){return i.lift(new l(t,e,n))}};var l=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.concurrent,this.scheduler))},t}();e.ExpandOperator=l;var c=function(t){function e(e,n,i,r){t.call(this,e),this.project=n,this.concurrent=i,this.scheduler=r,this.index=0,this.active=0,this.hasCompleted=!1,i0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(o.OuterSubscriber);e.ExpandSubscriber=c},27015:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.filter=function(t,e){return function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.thisArg))},t}(),o=function(t){function e(e,n,i){t.call(this,e),this.predicate=n,this.thisArg=i,this.count=0}return i(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)},e}(r.Subscriber)},94367:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(72293);e.finalize=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.callback))},t}(),a=function(t){function e(e,n){t.call(this,e),this.add(new s.Subscription(n))}return i(e,t),e}(r.Subscriber)},16700:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.find=function(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new s(t,n,!1,e))}};var s=function(){function t(t,e,n,i){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}();e.FindValueOperator=s;var o=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.source=i,this.yieldIndex=r,this.thisArg=s,this.index=0}return i(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,i=this.index++;try{e.call(n||this,t,i,this.source)&&this.notifyComplete(this.yieldIndex?i:t)}catch(r){this.destination.error(r)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(r.Subscriber);e.FindValueSubscriber=o},86452:function(t,e,n){"use strict";var i=n(16700);e.findIndex=function(t,e){return function(n){return n.lift(new i.FindValueOperator(t,n,!0,e))}}},12309:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.first=function(t,e,n){return function(i){return i.lift(new o(t,e,n,i))}};var o=function(){function t(t,e,n,i){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=i}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),a=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=s,this.index=0,this.hasCompleted=!1,this._emitted=!1}return i(e,t),e.prototype._next=function(t){var e=this.index++;this.predicate?this._tryPredicate(t,e):this._emit(t,e)},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(i){return void this.destination.error(i)}n&&this._emit(t,e)},e.prototype._emit=function(t,e){this.resultSelector?this._tryResultSelector(t,e):this._emitFinal(t)},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(i){return void this.destination.error(i)}this._emitFinal(n)},e.prototype._emitFinal=function(t){var e=this.destination;this._emitted||(this._emitted=!0,e.next(t),e.complete(),this.hasCompleted=!0)},e.prototype._complete=function(){var t=this.destination;this.hasCompleted||void 0===this.defaultValue?this.hasCompleted||t.error(new s.EmptyError):(t.next(this.defaultValue),t.complete())},e}(r.Subscriber)},92577:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(72293),o=n(18705),a=n(2369),l=n(49754),c=n(30764);e.groupBy=function(t,e,n,i){return function(r){return r.lift(new u(t,e,n,i))}};var u=function(){function t(t,e,n,i){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),h=function(t){function e(e,n,i,r,s){t.call(this,e),this.keySelector=n,this.elementSelector=i,this.durationSelector=r,this.subjectSelector=s,this.groups=null,this.attemptedToUnsubscribe=!1,this.count=0}return i(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(n){return void this.error(n)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups="string"==typeof e?new c.FastMap:new l.Map);var i,r=n.get(e);if(this.elementSelector)try{i=this.elementSelector(t)}catch(u){this.error(u)}else i=t;if(!r){r=this.subjectSelector?this.subjectSelector():new a.Subject,n.set(e,r);var s=new p(e,r,this);if(this.destination.next(s),this.durationSelector){var o=void 0;try{o=this.durationSelector(new p(e,r))}catch(u){return void this.error(u)}this.add(o.subscribe(new d(e,r,this)))}}r.closed||r.next(i)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach(function(e,n){e.error(t)}),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach(function(t,e){t.complete()}),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(r.Subscriber),d=function(t){function e(e,n,i){t.call(this,n),this.key=e,this.group=n,this.parent=i}return i(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(r.Subscriber),p=function(t){function e(e,n,i){t.call(this),this.key=e,this.groupSubject=n,this.refCountSubscription=i}return i(e,t),e.prototype._subscribe=function(t){var e=new s.Subscription,n=this.refCountSubscription,i=this.groupSubject;return n&&!n.closed&&e.add(new f(n)),e.add(i.subscribe(t)),e},e}(o.Observable);e.GroupedObservable=p;var f=function(t){function e(e){t.call(this),this.parent=e,e.count++}return i(e,t),e.prototype.unsubscribe=function(){var e=this.parent;!e.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(s.Subscription)},86898:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(68668);e.ignoreElements=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._next=function(t){s.noop()},e}(r.Subscriber)},89121:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.isEmpty=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new o(t))},t}(),o=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(r.Subscriber)},4636:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.last=function(t,e,n){return function(i){return i.lift(new o(t,e,n,i))}};var o=function(){function t(t,e,n,i){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=i}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),a=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=s,this.hasValue=!1,this.index=0,void 0!==r&&(this.lastValue=r,this.hasValue=!0)}return i(e,t),e.prototype._next=function(t){var e=this.index++;if(this.predicate)this._tryPredicate(t,e);else{if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(i){return void this.destination.error(i)}if(n){if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(i){return void this.destination.error(i)}this.lastValue=n,this.hasValue=!0},e.prototype._complete=function(){var t=this.destination;this.hasValue?(t.next(this.lastValue),t.complete()):t.error(new s.EmptyError)},e}(r.Subscriber)},40119:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.map=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.project,this.thisArg))},t}();e.MapOperator=s;var o=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.count=0,this.thisArg=i||this}return i(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(r.Subscriber)},23491:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.mapTo=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.value))},t}(),o=function(t){function e(e,n){t.call(this,e),this.value=n}return i(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(r.Subscriber)},71177:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(94429);e.materialize=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype._next=function(t){this.destination.next(s.Notification.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(s.Notification.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(s.Notification.createComplete()),t.complete()},e}(r.Subscriber)},33499:function(t,e,n){"use strict";var i=n(97369);e.max=function(t){return i.reduce("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}},56098:function(t,e,n){"use strict";var i=n(38781),r=n(38781);e.mergeStatic=r.merge,e.merge=function(){for(var t=[],e=0;e0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(s.OuterSubscriber);e.MergeMapSubscriber=a},6693:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.mergeMapTo=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"number"==typeof e&&(n=e,e=null),function(i){return i.lift(new o(t,e,n))}};var o=function(){function t(t,e,n){void 0===n&&(n=Number.POSITIVE_INFINITY),this.ish=t,this.resultSelector=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.ish,this.resultSelector,this.concurrent))},t}();e.MergeMapToOperator=o;var a=function(t){function e(e,n,i,r){void 0===r&&(r=Number.POSITIVE_INFINITY),t.call(this,e),this.ish=n,this.resultSelector=i,this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber);e.MergeMapToSubscriber=a},7550:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(33463),s=n(85814),o=n(93658),a=n(84308);e.mergeScan=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(i){return i.lift(new l(t,e,n))}};var l=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.accumulator,this.seed,this.concurrent))},t}();e.MergeScanOperator=l;var c=function(t){function e(e,n,i,r){t.call(this,e),this.accumulator=n,this.acc=i,this.concurrent=r,this.hasValue=!1,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(a.OuterSubscriber);e.MergeScanSubscriber=c},51213:function(t,e,n){"use strict";var i=n(97369);e.min=function(t){return i.reduce("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t=2?function(n){return o.pipe(i.scan(t,e),r.takeLast(1),s.defaultIfEmpty(e))(n)}:function(e){return o.pipe(i.scan(function(e,n,i){return t(e,n,i+1)}),r.takeLast(1))(e)}}},1694:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.refCount=function(){return function(t){return t.lift(new s(t))}};var s=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var i=new o(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r},t}(),o=function(t){function e(e,n){t.call(this,e),this.connectable=n}return i(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null},e}(r.Subscriber)},15329:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(70481);e.repeat=function(t){return void 0===t&&(t=-1),function(e){return 0===t?new s.EmptyObservable:e.lift(new o(t<0?-1:t-1,e))}};var o=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.count,this.source))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.count=n,this.source=i}return i(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(r.Subscriber)},63964:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.repeatWhen=function(t){return function(e){return e.lift(new c(t))}};var c=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,e))},t}(),u=function(t){function e(e,n,i){t.call(this,e),this.notifier=n,this.source=i,this.sourceIsBeingSubscribedTo=!0}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this,n=e.notifications,i=e.retries,r=e.retriesSubscription;return this.notifications=null,this.retries=null,this.retriesSubscription=null,t.prototype._unsubscribeAndRecycle.call(this),this.notifications=n,this.retries=i,this.retriesSubscription=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new r.Subject;var e=s.tryCatch(this.notifier)(this.notifications);if(e===o.errorObject)return t.prototype.complete.call(this);this.retries=e,this.retriesSubscription=l.subscribeToResult(this,e)},e}(a.OuterSubscriber)},40241:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.retry=function(t){return void 0===t&&(t=-1),function(e){return e.lift(new s(t,e))}};var s=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.count,this.source))},t}(),o=function(t){function e(e,n,i){t.call(this,e),this.count=n,this.source=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,i=this.count;if(0===i)return t.prototype.error.call(this,e);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(r.Subscriber)},23896:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.retryWhen=function(t){return function(e){return e.lift(new c(t,e))}};var c=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,this.source))},t}(),u=function(t){function e(e,n,i){t.call(this,e),this.notifier=n,this.source=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,i=this.retries,a=this.retriesSubscription;if(i)this.errors=null,this.retriesSubscription=null;else{if(n=new r.Subject,(i=s.tryCatch(this.notifier)(n))===o.errorObject)return t.prototype.error.call(this,o.errorObject.e);a=l.subscribeToResult(this,i)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=a,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,i,r){var s=this,o=s.errors,a=s.retries,l=s.retriesSubscription;this.errors=null,this.retries=null,this.retriesSubscription=null,this._unsubscribeAndRecycle(),this.errors=o,this.retries=a,this.retriesSubscription=l,this.source.subscribe(this)},e}(a.OuterSubscriber)},92043:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.sample=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new a(t),i=e.subscribe(n);return i.add(s.subscribeToResult(n,this.notifier)),i},t}(),a=function(t){function e(){t.apply(this,arguments),this.hasValue=!1}return i(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,i,r){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(r.OuterSubscriber)},71239:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(90680);e.sampleTime=function(t,e){return void 0===e&&(e=s.async),function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.period,this.scheduler))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.period=n,this.scheduler=i,this.hasValue=!1,this.add(i.schedule(l,n,{subscriber:this,period:n}))}return i(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(r.Subscriber);function l(t){var e=t.period;t.subscriber.notifyNext(),this.schedule(t,e)}},64949:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.scan=function(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.accumulator,this.seed,this.hasSeed))},t}(),o=function(t){function e(e,n,i,r){t.call(this,e),this.accumulator=n,this._seed=i,this.hasSeed=r,this.index=0}return i(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(i){this.destination.error(i)}this.seed=e,this.destination.next(e)},e}(r.Subscriber)},88948:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(33463),o=n(85814);e.sequenceEqual=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.compareTo=t,this.comparor=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.compareTo,this.comparor))},t}();e.SequenceEqualOperator=a;var l=function(t){function e(e,n,i){t.call(this,e),this.compareTo=n,this.comparor=i,this._a=[],this._b=[],this._oneComplete=!1,this.add(n.subscribe(new c(e,this)))}return i(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e.prototype.checkValues=function(){for(var t=this,e=t._a,n=t._b,i=t.comparor;e.length>0&&n.length>0;){var r=e.shift(),a=n.shift(),l=!1;i?(l=s.tryCatch(i)(r,a))===o.errorObject&&this.destination.error(o.errorObject.e):l=r===a,l||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e}(r.Subscriber);e.SequenceEqualSubscriber=l;var c=function(t){function e(e,n){t.call(this,e),this.parent=n}return i(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t)},e.prototype._complete=function(){this.parent._complete()},e}(r.Subscriber)},35473:function(t,e,n){"use strict";var i=n(27372),r=n(1694),s=n(2369);function o(){return new s.Subject}e.share=function(){return function(t){return r.refCount()(i.multicast(o)(t))}}},62704:function(t,e,n){"use strict";var i=n(81959);e.shareReplay=function(t,e,n){return function(r){return r.lift(function(t,e,n){var r,s,o=0,a=!1,l=!1;return function(c){o++,(!r||a)&&(a=!1,r=new i.ReplaySubject(t,e,n),s=c.subscribe({next:function(t){r.next(t)},error:function(t){a=!0,r.error(t)},complete:function(){l=!0,r.complete()}}));var u=r.subscribe(this);return function(){o--,u.unsubscribe(),s&&0===o&&l&&s.unsubscribe()}}}(t,e,n))}}},92223:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.single=function(t){return function(e){return e.lift(new o(t,e))}};var o=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.source))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.predicate=n,this.source=i,this.seenValue=!1,this.index=0}return i(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(n){this.destination.error(n)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new s.EmptyError)},e}(r.Subscriber)},11189:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.skip=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.total))},t}(),o=function(t){function e(e,n){t.call(this,e),this.total=n,this.count=0}return i(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(r.Subscriber)},73346:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758);e.skipLast=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(0===this._skipCount?new r.Subscriber(t):new a(t,this._skipCount))},t}(),a=function(t){function e(e,n){t.call(this,e),this._skipCount=n,this._count=0,this._ring=new Array(n)}return i(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n1?new i.ArrayObservable(t,n):new s.EmptyObservable(n),e)}}},10118:function(t,e,n){"use strict";var i=n(82966);e.subscribeOn=function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new r(t,e))}};var r=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new i.SubscribeOnObservable(e,this.delay,this.scheduler).subscribe(t)},t}()},77243:function(t,e,n){"use strict";var i=n(18483),r=n(5027);e.switchAll=function(){return i.switchMap(r.identity)}},18483:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.switchMap=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.resultSelector=i,this.index=0}return i(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var i=this.innerSubscription;i&&i.unsubscribe(),this.add(this.innerSubscription=s.subscribeToResult(this,t,e,n))},e.prototype._complete=function(){var e=this.innerSubscription;(!e||e.closed)&&t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){this.resultSelector?this._tryNotifyNext(t,e,n,i):this.destination.next(e)},e.prototype._tryNotifyNext=function(t,e,n,i){var r;try{r=this.resultSelector(t,e,n,i)}catch(s){return void this.destination.error(s)}this.destination.next(r)},e}(r.OuterSubscriber)},10684:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.switchMapTo=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.observable=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.observable,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.inner=n,this.resultSelector=i,this.index=0}return i(e,t),e.prototype._next=function(t){var e=this.innerSubscription;e&&e.unsubscribe(),this.add(this.innerSubscription=s.subscribeToResult(this,this.inner,t,this.index++))},e.prototype._complete=function(){var e=this.innerSubscription;(!e||e.closed)&&t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){var s=this.destination;this.resultSelector?this.tryResultSelector(t,e,n,i):s.next(e)},e.prototype.tryResultSelector=function(t,e,n,i){var r,s=this.resultSelector,o=this.destination;try{r=s(t,e,n,i)}catch(a){return void o.error(a)}o.next(r)},e}(r.OuterSubscriber)},44396:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758),o=n(70481);e.take=function(t){return function(e){return 0===t?new o.EmptyObservable:e.lift(new a(t))}};var a=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.total))},t}(),l=function(t){function e(e,n){t.call(this,e),this.total=n,this.count=0}return i(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(r.Subscriber)},73935:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758),o=n(70481);e.takeLast=function(t){return function(e){return 0===t?new o.EmptyObservable:e.lift(new a(t))}};var a=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.total))},t}(),l=function(t){function e(e,n){t.call(this,e),this.total=n,this.ring=new Array,this.count=0}return i(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,i=this.count++;e.length0)for(var n=this.count>=this.total?this.total:this.count,i=this.ring,r=0;r0?this.startWindowEvery:this.windowSize,n=this.destination,i=this.windowSize,r=this.windows,o=r.length,a=0;a=0&&l%e==0&&!this.closed&&r.shift().complete(),++this.count%e==0&&!this.closed){var c=new s.Subject;r.push(c),n.next(c)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(r.Subscriber)},42603:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(90680),o=n(42109),a=n(39479),l=n(41503);e.windowTime=function(t){var e=s.async,n=null,i=Number.POSITIVE_INFINITY;return l.isScheduler(arguments[3])&&(e=arguments[3]),l.isScheduler(arguments[2])?e=arguments[2]:a.isNumeric(arguments[2])&&(i=arguments[2]),l.isScheduler(arguments[1])?e=arguments[1]:a.isNumeric(arguments[1])&&(n=arguments[1]),function(r){return r.lift(new c(t,n,i,e))}};var c=function(){function t(t,e,n,i){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),u=function(t){function e(){t.apply(this,arguments),this._numberOfNextedValues=0}return i(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(r.Subject),h=function(t){function e(e,n,i,r,s){t.call(this,e),this.destination=e,this.windowTimeSpan=n,this.windowCreationInterval=i,this.maxWindowSize=r,this.scheduler=s,this.windows=[];var o=this.openWindow();if(null!==i&&i>=0){var a={windowTimeSpan:n,windowCreationInterval:i,subscriber:this,scheduler:s};this.add(s.schedule(f,n,{subscriber:this,window:o,context:null})),this.add(s.schedule(p,i,a))}else this.add(s.schedule(d,n,{subscriber:this,window:o,windowTimeSpan:n}))}return i(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,i=0;i=this.maxWindowSize&&this.closeWindow(r))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new u;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(o.Subscriber);function d(t){var e=t.subscriber,n=t.windowTimeSpan,i=t.window;i&&e.closeWindow(i),t.window=e.openWindow(),this.schedule(t,n)}function p(t){var e=t.windowTimeSpan,n=t.subscriber,i=t.scheduler,r=t.windowCreationInterval,s=n.openWindow(),o=this,a={action:o,subscription:null};a.subscription=i.schedule(f,e,{subscriber:n,window:s,context:a}),o.add(a.subscription),o.schedule(t,r)}function f(t){var e=t.subscriber,n=t.window,i=t.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),e.closeWindow(n)}},59048:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(72293),o=n(33463),a=n(85814),l=n(84308),c=n(93658);e.windowToggle=function(t,e){return function(n){return n.lift(new u(t,e))}};var u=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.openings,this.closingSelector))},t}(),h=function(t){function e(e,n,i){t.call(this,e),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(this.openSubscription=c.subscribeToResult(this,n,n))}return i(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,i=0;i0){var o=s.indexOf(n);-1!==o&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(r.OuterSubscriber)},9477:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(96177),s=n(48242),o=n(42109),a=n(84308),l=n(93658),c=n(72121);function u(){for(var t=[],e=0;ethis.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),g=function(t){function e(e,n,i){t.call(this,e),this.parent=n,this.observable=i,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return i(e,t),e.prototype[c.iterator]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,n,i,r){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return l.subscribeToResult(this,this.observable,this,e)},e}(a.OuterSubscriber)},33310:function(t,e,n){"use strict";var i=n(9477);e.zipAll=function(t){return function(e){return e.lift(new i.ZipOperator(t))}}},28101:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this)}return i(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(72293).Subscription);e.Action=r},67529:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(12624),s=n(95018),o=function(t){function e(e,n){t.call(this,e,n),this.scheduler=e,this.work=n}return i(e,t),e.prototype.requestAsyncId=function(e,n,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,n,i):(e.actions.push(this),e.scheduled||(e.scheduled=s.AnimationFrame.requestAnimationFrame(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,i);0===e.actions.length&&(s.AnimationFrame.cancelAnimationFrame(n),e.scheduled=void 0)},e}(r.AsyncAction);e.AnimationFrameAction=o},68909:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,i=-1,r=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i0?t.prototype.requestAsyncId.call(this,e,n,i):(e.actions.push(this),e.scheduled||(e.scheduled=r.Immediate.setImmediate(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,i);0===e.actions.length&&(r.Immediate.clearImmediate(n),e.scheduled=void 0)},e}(n(12624).AsyncAction);e.AsapAction=s},25766:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,i=-1,r=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,i):e.flush(this)},e}(n(12624).AsyncAction);e.QueueAction=r},77373:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e}(n(42704).AsyncScheduler);e.QueueScheduler=r},18353:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(12624),s=function(t){function e(e,n){var i=this;void 0===e&&(e=o),void 0===n&&(n=Number.POSITIVE_INFINITY),t.call(this,e,function(){return i.frame}),this.maxFrames=n,this.frame=0,this.index=-1}return i(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,i=this.maxFrames;(e=n.shift())&&(this.frame=e.delay)<=i&&!(t=e.execute(e.state,e.delay)););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(n(42704).AsyncScheduler);e.VirtualTimeScheduler=s;var o=function(t){function e(e,n,i){void 0===i&&(i=e.index+=1),t.call(this,e,n),this.scheduler=e,this.work=n,this.index=i,this.active=!0,this.index=e.index=i}return i(e,t),e.prototype.schedule=function(n,i){if(void 0===i&&(i=0),!this.id)return t.prototype.schedule.call(this,n,i);this.active=!1;var r=new e(this.scheduler,this.work);return this.add(r),r.schedule(n,i)},e.prototype.requestAsyncId=function(t,n,i){void 0===i&&(i=0),this.delay=t.frame+i;var r=t.actions;return r.push(this),r.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){void 0===n&&(n=0)},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(r.AsyncAction);e.VirtualAction=o},12948:function(t,e,n){"use strict";var i=n(67529),r=n(68909);e.animationFrame=new r.AnimationFrameScheduler(i.AnimationFrameAction)},85522:function(t,e,n){"use strict";var i=n(3496),r=n(25766);e.asap=new r.AsapScheduler(i.AsapAction)},90680:function(t,e,n){"use strict";var i=n(12624),r=n(42704);e.async=new r.AsyncScheduler(i.AsyncAction)},97088:function(t,e,n){"use strict";var i=n(7100),r=n(77373);e.queue=new r.QueueScheduler(i.QueueAction)},72121:function(t,e,n){"use strict";var i=n(80019);function r(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var n=t.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var i=t.Map;if(i)for(var r=Object.getOwnPropertyNames(i.prototype),s=0;s0;)e.shift().setup();t.prototype.flush.call(this);for(var n=this.flushTests.filter(function(t){return t.ready});n.length>0;){var i=n.shift();this.assertDeepEqual(i.actual,i.expected)}},e.parseMarblesAsSubscriptions=function(t){if("string"!=typeof t)return new l.SubscriptionLog(Number.POSITIVE_INFINITY);for(var e=t.length,n=-1,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,s=0;s-1?n:o;break;case"!":if(r!==Number.POSITIVE_INFINITY)throw new Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");r=n>-1?n:o;break;default:throw new Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+a+"'.")}}return r<0?new l.SubscriptionLog(i):new l.SubscriptionLog(i,r)},e.parseMarbles=function(t,e,n,i){if(void 0===i&&(i=!1),-1!==t.indexOf("!"))throw new Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var r=t.length,a=[],l=t.indexOf("^"),c=-1===l?0:l*-this.frameTimeFactor,u="object"!=typeof e?function(t){return t}:function(t){return i&&e[t]instanceof o.ColdObservable?e[t].messages:e[t]},h=-1,d=0;d-1?h:p,notification:f})}return a},e}(c.VirtualTimeScheduler);e.TestScheduler=u},95018:function(t,e,n){"use strict";var i=n(80019),r=function(t){t.requestAnimationFrame?(this.cancelAnimationFrame=t.cancelAnimationFrame.bind(t),this.requestAnimationFrame=t.requestAnimationFrame.bind(t)):t.mozRequestAnimationFrame?(this.cancelAnimationFrame=t.mozCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.mozRequestAnimationFrame.bind(t)):t.webkitRequestAnimationFrame?(this.cancelAnimationFrame=t.webkitCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.webkitRequestAnimationFrame.bind(t)):t.msRequestAnimationFrame?(this.cancelAnimationFrame=t.msCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.msRequestAnimationFrame.bind(t)):t.oRequestAnimationFrame?(this.cancelAnimationFrame=t.oCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.oRequestAnimationFrame.bind(t)):(this.cancelAnimationFrame=t.clearTimeout.bind(t),this.requestAnimationFrame=function(e){return t.setTimeout(e,1e3/60)})};e.RequestAnimationFrameDefinition=r,e.AnimationFrame=new r(i.root)},11758:function(t,e){"use strict";var n=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t){function e(){var e=t.call(this,"argument out of range");this.name=e.name="ArgumentOutOfRangeError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.ArgumentOutOfRangeError=i},44640:function(t,e){"use strict";var n=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t){function e(){var e=t.call(this,"no elements in sequence");this.name=e.name="EmptyError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.EmptyError=i},30764:function(t,e){"use strict";var n=function(){function t(){this.values={}}return t.prototype.delete=function(t){return this.values[t]=null,!0},t.prototype.set=function(t,e){return this.values[t]=e,this},t.prototype.get=function(t){return this.values[t]},t.prototype.forEach=function(t,e){var n=this.values;for(var i in n)n.hasOwnProperty(i)&&null!==n[i]&&t.call(e,n[i],i)},t.prototype.clear=function(){this.values={}},t}();e.FastMap=n},42982:function(t,e,n){"use strict";var i=n(80019),r=function(){function t(t){if(this.root=t,t.setImmediate&&"function"==typeof t.setImmediate)this.setImmediate=t.setImmediate.bind(t),this.clearImmediate=t.clearImmediate.bind(t);else{this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.setImmediate=this.canUseProcessNextTick()?this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.createReadyStateChangeSetImmediate():this.createSetTimeoutSetImmediate();var e=function t(e){delete t.instance.tasksByHandle[e]};e.instance=this,this.clearImmediate=e}}return t.prototype.identify=function(t){return this.root.Object.prototype.toString.call(t)},t.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)},t.prototype.canUseMessageChannel=function(){return Boolean(this.root.MessageChannel)},t.prototype.canUseReadyStateChange=function(){var t=this.root.document;return Boolean(t&&"onreadystatechange"in t.createElement("script"))},t.prototype.canUsePostMessage=function(){var t=this.root;if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}return!1},t.prototype.partiallyApplied=function(t){for(var e=[],n=1;n=0}},1856:function(t,e){"use strict";e.isObject=function(t){return null!=t&&"object"==typeof t}},35130:function(t,e){"use strict";e.isPromise=function(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}},41503:function(t,e){"use strict";e.isScheduler=function(t){return t&&"function"==typeof t.schedule}},68668:function(t,e){"use strict";e.noop=function(){}},67239:function(t,e){"use strict";e.not=function(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}},10142:function(t,e,n){"use strict";var i=n(68668);function r(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:i.noop}e.pipe=function(){for(var t=[],e=0;e=n?{done:!0}:{done:!1,value:t[i++]}})},e.empty=function(){var t=new e(null);return t.done=!0,t},e.is=function(t){return t instanceof e||"object"==typeof t&&null!==t&&"function"==typeof t.next},t.exports=e},97310:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.isMobile=function(){return void 0!==r.window.orientation},e.default=function(t){if(!t&&!(0,s.default)())return"Node";if((0,o.default)(t))return"Electron";var e="undefined"!=typeof navigator?navigator:{},n=t||e.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),a=-1!==n.indexOf("Trident/");return i||a?"IE":r.window.chrome?"Chrome":r.window.safari?"Safari":r.window.mozInnerScreenX?"Firefox":"Unknown"};var r=n(41151),s=i(n(61602)),o=i(n(22344))},41151:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.console=e.process=e.document=e.global=e.window=e.self=void 0;var r=i(n(34321)),s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&process};e.self=s.self||s.window||s.global,e.window=s.window||s.self||s.global,e.global=s.global||s.self||s.window,e.document=s.document||{},e.process=s.process||{};var o=console;e.console=o},84761:function(t,e,n){"use strict";var i=n(61948),r=n(34321);Object.defineProperty(e,"CO",{enumerable:!0,get:function(){return s.global}}),Object.defineProperty(e,"jU",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"qs",{enumerable:!0,get:function(){return a.default}});var s=n(41151),o=c(n(61602)),a=c(n(97310));i(n(22344));function l(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(l=function(t){return t?n:e})(t)}function c(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=l(e);if(n&&n.has(t))return n.get(t);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&Object.prototype.hasOwnProperty.call(t,o)){var a=s?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=t[o]}return i.default=t,n&&n.set(t,i),i}},61602:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,e.isBrowserMainThread=function(){return o()&&"undefined"!=typeof document};var r=i(n(34321)),s=i(n(22344));function o(){return!("object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,s.default)()}},22344:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("undefined"!=typeof window&&"object"===(0,r.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,r.default)(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":(0,r.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)};var r=i(n(34321))},86991:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(14180),e),r(n(75103),e),r(n(48965),e),r(n(32595),e),r(n(82417),e),r(n(92451),e),r(n(17735),e)},14180:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BlankNode=void 0,e.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&"BlankNode"===t.termType&&t.value===this.value}}},75103:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataFactory=void 0;const i=n(14180),r=n(48965),s=n(32595),o=n(82417),a=n(92451),l=n(17735);let c=0;e.DataFactory=class{constructor(t){this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||`df_${c++}_`}namedNode(t){return new o.NamedNode(t)}blankNode(t){return new i.BlankNode(t||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(t,e){return new s.Literal(t,e)}variable(t){return new l.Variable(t)}defaultGraph(){return r.DefaultGraph.INSTANCE}quad(t,e,n,i){return new a.Quad(t,e,n,i||this.defaultGraph())}fromTerm(t){switch(t.termType){case"NamedNode":return this.namedNode(t.value);case"BlankNode":return this.blankNode(t.value);case"Literal":return t.language?this.literal(t.value,t.language):t.datatype.equals(s.Literal.XSD_STRING)?this.literal(t.value):this.literal(t.value,this.fromTerm(t.datatype));case"Variable":return this.variable(t.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(t.subject),this.fromTerm(t.predicate),this.fromTerm(t.object),this.fromTerm(t.graph))}}fromQuad(t){return this.fromTerm(t)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},48965:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&"DefaultGraph"===t.termType}}e.DefaultGraph=n,n.INSTANCE=new n},32595:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Literal=void 0;const i=n(82417);class r{constructor(t,e){this.termType="Literal",this.value=t,"string"==typeof e?(this.language=e,this.datatype=r.RDF_LANGUAGE_STRING):e?(this.language="",this.datatype=e):(this.language="",this.datatype=r.XSD_STRING)}equals(t){return!!t&&"Literal"===t.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}e.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NamedNode=void 0,e.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&"NamedNode"===t.termType&&t.value===this.value}}},92451:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Quad=void 0,e.Quad=class{constructor(t,e,n,i){this.termType="Quad",this.value="",this.subject=t,this.predicate=e,this.object=n,this.graph=i}equals(t){return!!t&&("Quad"===t.termType||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},17735:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Variable=void 0,e.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&"Variable"===t.termType&&t.value===this.value}}},31609:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.getSupportedJavaScriptPrimitives=e.getSupportedRdfDatatypes=e.getTermRaw=e.toRdf=e.fromRdf=void 0;const s=n(86991),o=n(9938),a=n(66060);r(n(9938),e),r(n(88871),e),r(n(66060),e);const l=new s.DataFactory,c=new a.Translator;function u(t,e){return c.fromRdf(t,e)}c.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map(t=>l.namedNode(t)),["string"]),c.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map(t=>l.namedNode(t)),["boolean"]),c.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map(t=>l.namedNode(t)),["number"]),c.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map(t=>l.namedNode(t)),["number"]),c.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map(t=>l.namedNode(t)),["object"]),e.fromRdf=u,e.toRdf=function(t,e){return e&&"namedNode"in e&&(e={dataFactory:e}),(e=e||{})&&!e.dataFactory&&(e.dataFactory=l),c.toRdf(t,e)},e.getTermRaw=function(t,e){return"Literal"===t.termType?u(t,e):t.value},e.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},e.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},66060:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Translator=void 0,e.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,e,n){for(const i of e)this.supportedRdfDatatypes.push(i),this.fromRdfHandlers[i.value]=t;for(const i of n){let e=this.toRdfHandlers[i];e||(this.toRdfHandlers[i]=e=[]),e.push(t)}}fromRdf(t,e){const n=this.fromRdfHandlers[t.datatype.value];return n?n.fromRdf(t,e):t.value}toRdf(t,e){const n=this.toRdfHandlers[typeof t];if(n)for(const i of n){const n=i.toRdf(t,e);if(n)return n}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},80727:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerBoolean=void 0;const i=n(66060);class r{fromRdf(t,e){switch(t.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return e&&i.Translator.incorrectRdfDataType(t),!1}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(t?"true":"false",e||n.namedNode(r.TYPE))}}e.TypeHandlerBoolean=r,r.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerDate=void 0;const i=n(66060);class r{fromRdf(t,e){switch(e&&!t.value.match(r.VALIDATORS[t.datatype.value.substr(33,t.datatype.value.length)])&&i.Translator.incorrectRdfDataType(t),t.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(t.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const e=t.value.split("-");return new Date(0,parseInt(e[0],10)-1,parseInt(e[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(t.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(t.value+"-01");default:return new Date(t.value)}}toRdf(t,{datatype:e,dataFactory:n}){if(e=e||n.namedNode(r.TYPES[0]),!(t instanceof Date))return null;const i=t;let s;switch(e.value){case"http://www.w3.org/2001/XMLSchema#gDay":s=String(i.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":s=i.getUTCMonth()+1+"-"+i.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":s=String(i.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":s=i.getUTCFullYear()+"-"+(i.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":s=i.toISOString().replace(/T.*$/,"");break;default:s=i.toISOString()}return n.literal(s,e)}}e.TypeHandlerDate=r,r.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"],r.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]$/}},38554:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberDouble=void 0;const i=n(66060);class r{fromRdf(t,e){const n=parseFloat(t.value);return e&&isNaN(n)&&i.Translator.incorrectRdfDataType(t),n}toRdf(t,{datatype:e,dataFactory:n}){return e=e||n.namedNode(r.TYPES[0]),isNaN(t)?n.literal("NaN",e):isFinite(t)?t%1==0?null:n.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),e):n.literal(t>0?"INF":"-INF",e)}}e.TypeHandlerNumberDouble=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberInteger=void 0;const i=n(66060);class r{fromRdf(t,e){const n=parseInt(t.value,10);return e&&(isNaN(n)||t.value.indexOf(".")>=0)&&i.Translator.incorrectRdfDataType(t),n}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(String(t),e||n.namedNode(t<=r.MAX_INT&&t>=r.MIN_INT?r.TYPES[0]:r.TYPES[1]))}}e.TypeHandlerNumberInteger=r,r.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"],r.MAX_INT=2147483647,r.MIN_INT=-2147483648},14608:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerString=void 0;class n{fromRdf(t){return t.value}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(t,e)}}e.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(80727),e),r(n(52525),e),r(n(38554),e),r(n(37750),e),r(n(14608),e)},35090:function(t,e,n){"use strict";var i={};n.r(i),n.d(i,{decode:function(){return eL},encode:function(){return iL}});var r={};n.r(r),n.d(r,{decode:function(){return cL},encode:function(){return hL}});var s={};n.r(s),n.d(s,{decode:function(){return dL},encode:function(){return fL}});var o={};function a(t){return"function"==typeof t}n.r(o),n.d(o,{decode:function(){return mL},encode:function(){return yL}});let l=!1;const c={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else l&&console.log("RxJS: Back to a better error behavior. Thank you. <3");l=t},get useDeprecatedSynchronousErrorHandling(){return l}};function u(t){setTimeout(()=>{throw t},0)}const h={closed:!0,next(t){},error(t){if(c.useDeprecatedSynchronousErrorHandling)throw t;u(t)},complete(){}},d=Array.isArray||(t=>t&&"number"==typeof t.length);function p(t){return null!==t&&"object"==typeof t}const f=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();class g{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:e,_ctorUnsubscribe:n,_unsubscribe:i,_subscriptions:r}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,e instanceof g)e.remove(this);else if(null!==e)for(let a=0;at.concat(e instanceof f?e.errors:e),[])}g.EMPTY=((m=new g).closed=!0,m);const y="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class v extends g{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=h;break;case 1:if(!t){this.destination=h;break}if("object"==typeof t){t instanceof v?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new _(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new _(this,t,e,n)}}[y](){return this}static create(t,e,n){const i=new v(t,e,n);return i.syncErrorThrowable=!1,i}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class _ extends v{constructor(t,e,n,i){super(),this._parentSubscriber=t;let r,s=this;a(e)?r=e:e&&(r=e.next,n=e.error,i=e.complete,e!==h&&(s=Object.create(e),a(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=r,this._error=n,this._complete=i}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;c.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=c;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):u(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;u(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);c.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),c.useDeprecatedSynchronousErrorHandling)throw n;u(n)}}__tryOrSetError(t,e,n){if(!c.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(i){return c.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=i,t.syncErrorThrown=!0,!0):(u(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const w="function"==typeof Symbol&&Symbol.observable||"@@observable";function x(t){return t}function S(...t){return E(t)}function E(t){return 0===t.length?x:1===t.length?t[0]:function(e){return t.reduce((t,e)=>e(t),e)}}let C=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:i}=this,r=function(t,e,n){if(t){if(t instanceof v)return t;if(t[y])return t[y]()}return t||e||n?new v(t,e,n):new v(h)}(t,e,n);if(r.add(i?i.call(r,this.source):this.source||c.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),c.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(t){try{return this._subscribe(t)}catch(e){c.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:i}=t;if(e||i)return!1;t=n&&n instanceof v?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=O(e))((e,n)=>{let i;i=this.subscribe(e=>{try{t(e)}catch(r){n(r),i&&i.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[w](){return this}pipe(...t){return 0===t.length?this:E(t)(this)}toPromise(t){return new(t=O(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function O(t){if(t||(t=c.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const T=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class k extends g{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class A extends v{constructor(t){super(t),this.destination=t}}let P=(()=>{class t extends C{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[y](){return new A(this)}lift(t){const e=new I(this,this);return e.operator=t,e}next(t){if(this.closed)throw new T;if(!this.isStopped){const{observers:e}=this,n=e.length,i=e.slice();for(let r=0;rnew I(t,e),t})();class I extends P{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):g.EMPTY}}function M(t){return t&&"function"==typeof t.schedule}function D(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new R(t,e))}}class R{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new N(t,this.project,this.thisArg))}}class N extends v{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}const L=t=>e=>{for(let n=0,i=t.length;nt&&"number"==typeof t.length&&"function"!=typeof t;function B(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const V=t=>{if(t&&"function"==typeof t[w])return(t=>e=>{const n=t[w]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)})(t);if(F(t))return L(t);if(B(t))return(t=>e=>(t.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,u),e))(t);if(t&&"function"==typeof t[j])return(t=>e=>{const n=t[j]();for(;;){let t;try{t=n.next()}catch(i){return e.error(i),e}if(t.done){e.complete();break}if(e.next(t.value),e.closed)break}return"function"==typeof n.return&&e.add(()=>{n.return&&n.return()}),e})(t);{const e=`You provided ${p(t)?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(e)}};function z(t,e){return new C(n=>{const i=new g;let r=0;return i.add(e.schedule(function(){r!==t.length?(n.next(t[r++]),n.closed||i.add(this.schedule())):n.complete()})),i})}function U(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[w]}(t))return function(t,e){return new C(n=>{const i=new g;return i.add(e.schedule(()=>{const r=t[w]();i.add(r.subscribe({next(t){i.add(e.schedule(()=>n.next(t)))},error(t){i.add(e.schedule(()=>n.error(t)))},complete(){i.add(e.schedule(()=>n.complete()))}}))})),i})}(t,e);if(B(t))return function(t,e){return new C(n=>{const i=new g;return i.add(e.schedule(()=>t.then(t=>{i.add(e.schedule(()=>{n.next(t),i.add(e.schedule(()=>n.complete()))}))},t=>{i.add(e.schedule(()=>n.error(t)))}))),i})}(t,e);if(F(t))return z(t,e);if(function(t){return t&&"function"==typeof t[j]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new C(n=>{const i=new g;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=t[j](),i.add(e.schedule(function(){if(n.closed)return;let t,e;try{const n=r.next();t=n.value,e=n.done}catch(i){return void n.error(i)}e?n.complete():(n.next(t),this.schedule())}))})),i})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof C?t:new C(V(t))}class H extends v{constructor(t){super(),this.parent=t}_next(t){this.parent.notifyNext(t)}_error(t){this.parent.notifyError(t),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class $ extends v{notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.destination.complete()}}function G(t,e){if(e.closed)return;if(t instanceof C)return t.subscribe(e);let n;try{n=V(t)(e)}catch(i){e.error(i)}return n}function W(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(W((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))),n)):("number"==typeof e&&(n=e),e=>e.lift(new q(t,n)))}class q{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new X(t,this.project,this.concurrent))}}class X extends ${constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function Y(t=Number.POSITIVE_INFINITY){return W(x,t)}function K(t,e){return e?z(t,e):new C(L(t))}function Q(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return M(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof i&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof C?t[0]:Y(e)(K(t,n))}function Z(){return function(t){return t.lift(new J(t))}}class J{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const i=new tt(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class tt extends v{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}class et extends C{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new g,t.add(this.source.subscribe(new it(this.getSubject(),this))),t.closed&&(this._connection=null,t=g.EMPTY)),t}refCount(){return Z()(this)}}const nt=(()=>{const t=et.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class it extends A{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function rt(t,e){return function(n){let i;if(i="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new st(i,e));const r=Object.create(n,nt);return r.source=n,r.subjectFactory=i,r}}class st{constructor(t,e){this.subjectFactory=t,this.selector=e}call(t,e){const{selector:n}=this,i=this.subjectFactory(),r=n(i).subscribe(t);return r.add(e.subscribe(i)),r}}function ot(){return new P}function at(){return t=>Z()(rt(ot)(t))}function lt(t){for(let e in t)if(t[e]===lt)return e;throw Error("Could not find renamed property on target object.")}function ct(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function ut(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(ut).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function ht(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const dt=lt({__forward_ref__:lt});function pt(t){return t.__forward_ref__=pt,t.toString=function(){return ut(this())},t}function ft(t){return gt(t)?t():t}function gt(t){return"function"==typeof t&&t.hasOwnProperty(dt)&&t.__forward_ref__===pt}class mt extends Error{constructor(t,e){super(function(t,e){return`${t?`NG0${t}: `:""}${e}`}(t,e)),this.code=t}}function yt(t){return"string"==typeof t?t:null==t?"":String(t)}function vt(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():yt(t)}function _t(t,e){const n=e?` in ${e}`:"";throw new mt("201",`No provider for ${vt(t)} found${n}`)}function wt(t,e){null==t&&function(t,e,n,i){throw new Error(`ASSERTION ERROR: ${t}`+(null==i?"":` [Expected=> ${n} ${i} ${e} <=Actual]`))}(e,t,null,"!=")}function xt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function St(t){return{providers:t.providers||[],imports:t.imports||[]}}function Et(t){return Ct(t,Tt)||Ct(t,At)}function Ct(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ot(t){return t&&(t.hasOwnProperty(kt)||t.hasOwnProperty(Pt))?t[kt]:null}const Tt=lt({"\u0275prov":lt}),kt=lt({"\u0275inj":lt}),At=lt({ngInjectableDef:lt}),Pt=lt({ngInjectorDef:lt});var It=(()=>((It=It||{})[It.Default=0]="Default",It[It.Host=1]="Host",It[It.Self=2]="Self",It[It.SkipSelf=4]="SkipSelf",It[It.Optional=8]="Optional",It))();let Mt;function Dt(t){const e=Mt;return Mt=t,e}function Rt(t,e,n){const i=Et(t);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&It.Optional?null:void 0!==e?e:void _t(ut(t),"Injector")}function Nt(t){return{toString:t}.toString()}var Lt=(()=>((Lt=Lt||{})[Lt.OnPush=0]="OnPush",Lt[Lt.Default=1]="Default",Lt))(),jt=(()=>((jt=jt||{})[jt.Emulated=0]="Emulated",jt[jt.None=2]="None",jt[jt.ShadowDom=3]="ShadowDom",jt))();const Ft="undefined"!=typeof globalThis&&globalThis,Bt="undefined"!=typeof window&&window,Vt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,zt="undefined"!=typeof global&&global,Ut=Ft||zt||Bt||Vt,Ht={},$t=[],Gt=lt({"\u0275cmp":lt}),Wt=lt({"\u0275dir":lt}),qt=lt({"\u0275pipe":lt}),Xt=lt({"\u0275mod":lt}),Yt=lt({"\u0275loc":lt}),Kt=lt({"\u0275fac":lt}),Qt=lt({__NG_ELEMENT_ID__:lt});let Zt=0;function Jt(t){return Nt(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===Lt.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||$t,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||jt.Emulated,id:"c",styles:t.styles||$t,_:null,setInput:null,schemas:t.schemas||null,tView:null},i=t.directives,r=t.features,s=t.pipes;return n.id+=Zt++,n.inputs=re(t.inputs,e),n.outputs=re(t.outputs),r&&r.forEach(t=>t(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(te):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(ee):null,n})}function te(t){return ae(t)||function(t){return t[Wt]||null}(t)}function ee(t){return function(t){return t[qt]||null}(t)}const ne={};function ie(t){return Nt(()=>{const e={type:t.type,bootstrap:t.bootstrap||$t,declarations:t.declarations||$t,imports:t.imports||$t,exports:t.exports||$t,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&(ne[t.id]=t.type),e})}function re(t,e){if(null==t)return Ht;const n={};for(const i in t)if(t.hasOwnProperty(i)){let r=t[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,e&&(e[r]=s)}return n}const se=Jt;function oe(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,onDestroy:t.type.prototype.ngOnDestroy||null}}function ae(t){return t[Gt]||null}function le(t,e){const n=t[Xt]||null;if(!n&&!0===e)throw new Error(`Type ${ut(t)} does not have '\u0275mod' property.`);return n}function ce(t){return Array.isArray(t)&&"object"==typeof t[1]}function ue(t){return Array.isArray(t)&&!0===t[1]}function he(t){return 0!=(8&t.flags)}function de(t){return 2==(2&t.flags)}function pe(t){return 1==(1&t.flags)}function fe(t){return null!==t.template}function ge(t){return 0!=(512&t[2])}function me(t,e){return t.hasOwnProperty(Kt)?t[Kt]:null}class be{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function ye(){return ve}function ve(t){return t.type.prototype.ngOnChanges&&(t.setInput=we),_e}function _e(){const t=Se(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===Ht)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function we(t,e,n,i){const r=Se(t)||function(t,e){return t[xe]=e}(t,{previous:Ht,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],l=o[a];s[a]=new be(l&&l.currentValue,e,o===Ht),t[i]=e}ye.ngInherit=!0;const xe="__ngSimpleChanges__";function Se(t){return t[xe]||null}const Ee="http://www.w3.org/2000/svg";let Ce;function Oe(){return void 0!==Ce?Ce:"undefined"!=typeof document?document:void 0}function Te(t){return!!t.listen}const ke={createRenderer:(t,e)=>Oe()};function Ae(t){for(;Array.isArray(t);)t=t[0];return t}function Pe(t,e){return Ae(e[t])}function Ie(t,e){return Ae(e[t.index])}function Me(t,e){return t.data[e]}function De(t,e){return t[e]}function Re(t,e){const n=e[t];return ce(n)?n:n[0]}function Ne(t){return 4==(4&t[2])}function Le(t){return 128==(128&t[2])}function je(t,e){return null==e?null:t[e]}function Fe(t){t[18]=0}function Be(t,e){t[5]+=e;let n=t,i=t[3];for(;null!==i&&(1===e&&1===n[5]||-1===e&&0===n[5]);)i[5]+=e,n=i,i=i[3]}const Ve={lFrame:dn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function ze(){return Ve.bindingsEnabled}function Ue(){return Ve.lFrame.lView}function He(){return Ve.lFrame.tView}function $e(t){return Ve.lFrame.contextLView=t,t[8]}function Ge(){let t=We();for(;null!==t&&64===t.type;)t=t.parent;return t}function We(){return Ve.lFrame.currentTNode}function qe(t,e){const n=Ve.lFrame;n.currentTNode=t,n.isParent=e}function Xe(){return Ve.lFrame.isParent}function Ye(){Ve.lFrame.isParent=!1}function Ke(){return Ve.isInCheckNoChangesMode}function Qe(t){Ve.isInCheckNoChangesMode=t}function Ze(){const t=Ve.lFrame;let e=t.bindingRootIndex;return-1===e&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function Je(){return Ve.lFrame.bindingIndex}function tn(){return Ve.lFrame.bindingIndex++}function en(t){const e=Ve.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function nn(t,e){const n=Ve.lFrame;n.bindingIndex=n.bindingRootIndex=t,rn(e)}function rn(t){Ve.lFrame.currentDirectiveIndex=t}function sn(t){const e=Ve.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}function on(){return Ve.lFrame.currentQueryIndex}function an(t){Ve.lFrame.currentQueryIndex=t}function ln(t){const e=t[1];return 2===e.type?e.declTNode:1===e.type?t[6]:null}function cn(t,e,n){if(n&It.SkipSelf){let i=e,r=t;for(;!(i=i.parent,null!==i||n&It.Host||(i=ln(r),null===i||(r=r[15],10&i.type))););if(null===i)return!1;e=i,t=r}const i=Ve.lFrame=hn();return i.currentTNode=e,i.lView=t,!0}function un(t){const e=hn(),n=t[1];Ve.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function hn(){const t=Ve.lFrame,e=null===t?null:t.child;return null===e?dn(t):e}function dn(t){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=e),e}function pn(){const t=Ve.lFrame;return Ve.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const fn=pn;function gn(){const t=pn();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function mn(){return Ve.lFrame.selectedIndex}function bn(t){Ve.lFrame.selectedIndex=t}function yn(){const t=Ve.lFrame;return Me(t.tView,t.selectedIndex)}function vn(){Ve.lFrame.currentNamespace=Ee}function _n(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n=i)break}else e[a]<0&&(t[18]+=65536),(o>11>16&&(3&t[2])===e){t[2]+=2048;try{s.call(o)}finally{}}}else try{s.call(o)}finally{}}class On{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function Tn(t,e,n){const i=Te(t);let r=0;for(;re){o=s-1;break}}}for(;s>16}(t),i=e;for(;n>0;)i=i[15],n--;return i}let Nn=!0;function Ln(t){const e=Nn;return Nn=t,e}let jn=0;function Fn(t,e){const n=Vn(t,e);if(-1!==n)return n;const i=e[1];i.firstCreatePass&&(t.injectorIndex=e.length,Bn(i.data,t),Bn(e,null),Bn(i.blueprint,null));const r=zn(t,e),s=t.injectorIndex;if(Mn(r)){const t=Dn(r),n=Rn(r,e),i=n[1].data;for(let r=0;r<8;r++)e[s+r]=n[t+r]|i[t+r]}return e[s+8]=r,s}function Bn(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Vn(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===e[t.injectorIndex+8]?-1:t.injectorIndex}function zn(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=0,i=null,r=e;for(;null!==r;){const t=r[1],e=t.type;if(i=2===e?t.declTNode:1===e?r[6]:null,null===i)return-1;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return-1}function Un(t,e,n){!function(t,e,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Qt)&&(i=n[Qt]),null==i&&(i=n[Qt]=jn++);const r=255&i;e.data[t+(r>>5)]|=1<=0?255&e:qn:e}(n);if("function"==typeof s){if(!cn(e,t,i))return i&It.Host?Hn(r,n,i):$n(e,n,i,r);try{const t=s(i);if(null!=t||i&It.Optional)return t;_t(n)}finally{fn()}}else if("number"==typeof s){let r=null,o=Vn(t,e),a=-1,l=i&It.Host?e[16][6]:null;for((-1===o||i&It.SkipSelf)&&(a=-1===o?zn(t,e):e[o+8],-1!==a&&Zn(i,!1)?(r=e[1],o=Dn(a),e=Rn(a,e)):o=-1);-1!==o;){const t=e[1];if(Qn(s,o,t.data)){const t=Xn(o,e,n,r,i,l);if(t!==Wn)return t}a=e[o+8],-1!==a&&Zn(i,e[1].data[o+8]===l)&&Qn(s,o,e)?(r=t,o=Dn(a),e=Rn(a,e)):o=-1}}}return $n(e,n,i,r)}const Wn={};function qn(){return new Jn(Ge(),Ue())}function Xn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Yn(a,o,n,null==i?de(a)&&Nn:i!=o&&0!=(3&a.type),r&It.Host&&s===a);return null!==l?Kn(e,o,l,a):Wn}function Yn(t,e,n,i,r){const s=t.providerIndexes,o=e.data,a=1048575&s,l=t.directiveStart,c=s>>20,u=r?a+c:t.directiveEnd;for(let h=i?a:a+c;h=l&&t.type===n)return h}if(r){const t=o[l];if(t&&fe(t)&&t.type===n)return l}return null}function Kn(t,e,n,i){let r=t[n];const s=e.data;if(function(t){return t instanceof On}(r)){const o=r;o.resolving&&function(t,e){throw new mt("200",`Circular dependency in DI detected for ${t}`)}(vt(s[n]));const a=Ln(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Dt(o.injectImpl):null;cn(t,i,It.Default);try{r=t[n]=o.factory(void 0,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&function(t,e,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const i=ve(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,s))}(n,s[n],e)}finally{null!==l&&Dt(l),Ln(a),o.resolving=!1,fn()}}return r}function Qn(t,e,n){return!!(n[e+(t>>5)]&1<{const e=t.prototype.constructor,n=e[Kt]||ni(e),i=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==i;){const t=r[Kt]||ni(r);if(t&&t!==n)return t;r=Object.getPrototypeOf(r)}return t=>new t})}function ni(t){return gt(t)?()=>{const e=ni(ft(t));return e&&e()}:me(t)}function ii(t){return function(t,e){if("class"===e)return t.classes;if("style"===e)return t.styles;const n=t.attrs;if(n){const t=n.length;let i=0;for(;i{const i=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function r(...t){if(this instanceof r)return i.apply(this,t),this;const e=new r(...t);return n.annotation=e,n;function n(t,n,i){const r=t.hasOwnProperty(ri)?t[ri]:Object.defineProperty(t,ri,{value:[]})[ri];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(e),t}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}class oi{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=xt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return`InjectionToken ${this._desc}`}}const ai=Function;function li(t,e){void 0===e&&(e=t);for(let n=0;nArray.isArray(t)?ci(t,e):e(t))}function ui(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function hi(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function di(t,e){const n=[];for(let i=0;i=0?t[1|i]=n:(i=~i,function(t,e,n,i){let r=t.length;if(r==e)t.push(n,i);else if(1===r)t.push(i,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;)t[r]=t[r-2],r--;t[e]=n,t[e+1]=i}}(t,i,e,n)),i}function fi(t,e){const n=gi(t,e);if(n>=0)return t[1|n]}function gi(t,e){return function(t,e,n){let i=0,r=t.length>>n;for(;r!==i;){const s=i+(r-i>>1),o=t[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t.push(n+":"+("string"==typeof i?JSON.stringify(i):ut(i)))}r=`{${t.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${t.replace(vi,"\n ")}`}("\n"+t.message,r,n,i),t.ngTokenPath=r,t[yi]=null,t}const Ii=ki(si("Inject",t=>({token:t})),-1),Mi=ki(si("Optional"),8),Di=ki(si("SkipSelf"),4);let Ri,Ni;function Li(t){var e;return(null===(e=function(){if(void 0===Ri&&(Ri=null,Ut.trustedTypes))try{Ri=Ut.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(t){}return Ri}())||void 0===e?void 0:e.createHTML(t))||t}function ji(){if(void 0===Ni&&(Ni=null,Ut.trustedTypes))try{Ni=Ut.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(m){}return Ni}function Fi(t){var e;return(null===(e=ji())||void 0===e?void 0:e.createHTML(t))||t}function Bi(t){var e;return(null===(e=ji())||void 0===e?void 0:e.createScriptURL(t))||t}class Vi{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class zi extends Vi{getTypeName(){return"HTML"}}class Ui extends Vi{getTypeName(){return"Style"}}class Hi extends Vi{getTypeName(){return"Script"}}class $i extends Vi{getTypeName(){return"URL"}}class Gi extends Vi{getTypeName(){return"ResourceURL"}}function Wi(t){return t instanceof Vi?t.changingThisBreaksApplicationSecurity:t}function qi(t,e){const n=Xi(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===e}function Xi(t){return t instanceof Vi&&t.getTypeName()||null}class Yi{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t=""+t;try{const e=(new window.DOMParser).parseFromString(Li(t),"text/html").body;return null===e?this.inertDocumentHelper.getInertBodyElement(t):(e.removeChild(e.firstChild),e)}catch(e){return null}}}class Ki{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const e=this.inertDocument.createElement("body");t.appendChild(e)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=Li(t),e;const n=this.inertDocument.createElement("body");return n.innerHTML=Li(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(t){const e=t.attributes;for(let i=e.length-1;0Ji(t.trim())).join(", ")}function er(t){const e={};for(const n of t.split(","))e[n]=!0;return e}function nr(...t){const e={};for(const n of t)for(const t in n)n.hasOwnProperty(t)&&(e[t]=!0);return e}const ir=er("area,br,col,hr,img,wbr"),rr=er("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),sr=er("rp,rt"),or=nr(ir,nr(rr,er("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),nr(sr,er("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),nr(sr,rr)),ar=er("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),lr=er("srcset"),cr=nr(ar,lr,er("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),er("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),ur=er("script,style,template");class hr{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let e=t.firstChild,n=!0;for(;e;)if(e.nodeType===Node.ELEMENT_NODE?n=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,n&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);let t=this.checkClobberedElement(e,e.nextSibling);if(t){e=t;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")}startElement(t){const e=t.nodeName.toLowerCase();if(!or.hasOwnProperty(e))return this.sanitizedSomething=!0,!ur.hasOwnProperty(e);this.buf.push("<"),this.buf.push(e);const n=t.attributes;for(let i=0;i"),!0}endElement(t){const e=t.nodeName.toLowerCase();or.hasOwnProperty(e)&&!ir.hasOwnProperty(e)&&(this.buf.push(""))}chars(t){this.buf.push(fr(t))}checkClobberedElement(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`);return e}}const dr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,pr=/([^\#-~ |!])/g;function fr(t){return t.replace(/&/g,"&").replace(dr,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(pr,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let gr;function mr(t,e){let n=null;try{gr=gr||function(t){const e=new Ki(t);return function(){try{return!!(new window.DOMParser).parseFromString(Li(""),"text/html")}catch(t){return!1}}()?new Yi(e):e}(t);let i=e?String(e):"";n=gr.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=gr.getInertBodyElement(i)}while(i!==s);return Li((new hr).sanitizeChildren(br(n)||n))}finally{if(n){const t=br(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function br(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var yr=(()=>((yr=yr||{})[yr.NONE=0]="NONE",yr[yr.HTML=1]="HTML",yr[yr.STYLE=2]="STYLE",yr[yr.SCRIPT=3]="SCRIPT",yr[yr.URL=4]="URL",yr[yr.RESOURCE_URL=5]="RESOURCE_URL",yr))();function vr(t){const e=xr();return e?Fi(e.sanitize(yr.HTML,t)||""):qi(t,"HTML")?Fi(Wi(t)):mr(Oe(),yt(t))}function _r(t){const e=xr();return e?e.sanitize(yr.URL,t)||"":qi(t,"URL")?Wi(t):Ji(yt(t))}function wr(t){const e=xr();if(e)return Bi(e.sanitize(yr.RESOURCE_URL,t)||"");if(qi(t,"ResourceURL"))return Bi(Wi(t));throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)")}function xr(){const t=Ue();return t&&t[12]}const Sr="__ngContext__";function Er(t,e){t[Sr]=e}function Cr(t){const e=function(t){return t[Sr]||null}(t);return e?Array.isArray(e)?e:e.lView:null}function Or(t){return t.ngOriginalError}function Tr(t,...e){t.error(...e)}class kr{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),i=function(t){return t&&t.ngErrorLogger||Tr}(t);i(this._console,"ERROR",t),e&&i(this._console,"ORIGINAL ERROR",e),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?function(t){return t.ngDebugContext}(t)||this._findContext(Or(t)):null}_findOriginalError(t){let e=t&&Or(t);for(;e&&Or(e);)e=Or(e);return e||null}}const Ar=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Ut))();function Pr(t){return t.ownerDocument.defaultView}function Ir(t){return t.ownerDocument}function Mr(t){return t instanceof Function?t():t}var Dr=(()=>((Dr=Dr||{})[Dr.Important=1]="Important",Dr[Dr.DashCase=2]="DashCase",Dr))();function Rr(t,e){return undefined(t,e)}function Lr(t){const e=t[3];return ue(e)?e[3]:e}function jr(t){return Br(t[13])}function Fr(t){return Br(t[4])}function Br(t){for(;null!==t&&!ue(t);)t=t[4];return t}function Vr(t,e,n,i,r){if(null!=i){let s,o=!1;ue(i)?s=i:ce(i)&&(o=!0,i=i[0]);const a=Ae(i);0===t&&null!==n?null==r?Xr(e,n,a):qr(e,n,a,r||null,!0):1===t&&null!==n?qr(e,n,a,r||null,!0):2===t?function(t,e,n){const i=Kr(t,e);i&&function(t,e,n,i){Te(t)?t.removeChild(e,n,i):e.removeChild(n)}(t,i,e,n)}(e,a,o):3===t&&e.destroyNode(a),null!=s&&function(t,e,n,i,r){const s=n[7];s!==Ae(n)&&Vr(e,t,i,s,r);for(let o=10;o0&&(t[n-1][4]=i[4]);const s=hi(t,10+e);!function(t,e){rs(t,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function $r(t,e){if(!(256&e[2])){const n=e[11];Te(n)&&n.destroyNode&&rs(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Gr(t[1],t);for(;e;){let n=null;if(ce(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)ce(e)&&Gr(e[1],e),e=e[3];null===e&&(e=t),ce(e)&&Gr(e[1],e),n=e&&e[4]}e=n}}(e)}}function Gr(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let i=0;i=0?i[r=l]():i[r=-l].unsubscribe(),s+=2}else{const t=i[r=n[s+1]];n[s].call(t)}if(null!==i){for(let t=r+1;ts?"":r[u+1].toLowerCase();const e=8&i?t:null;if(e&&-1!==ls(e,c,0)||2&i&&c!==t){if(fs(i))return!1;o=!0}}}}else{if(!o&&!fs(i)&&!fs(l))return!1;if(o&&fs(l))continue;o=!1,i=l|1&i}}return fs(i)||o}function fs(t){return 0==(1&t)}function gs(t,e,n,i){if(null===e)return-1;let r=0;if(i||!n){let n=!1;for(;r-1)for(n++;n0?'="'+e+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!fs(o)&&(e+=ys(s,r),r=""),i=o,s=s||!fs(i);n++}return""!==r&&(e+=ys(s,r)),e}const _s={};function ws(t){xs(He(),Ue(),mn()+t,Ke())}function xs(t,e,n,i){if(!i)if(3==(3&e[2])){const i=t.preOrderCheckHooks;null!==i&&wn(e,i,n)}else{const i=t.preOrderHooks;null!==i&&xn(e,i,0,n)}bn(n)}function Ss(t,e){return t<<17|e<<2}function Es(t){return t>>17&32767}function Cs(t){return 2|t}function Os(t){return(131068&t)>>2}function Ts(t,e){return-131069&t|e<<2}function ks(t){return 1|t}function As(t,e){const n=t.contentQueries;if(null!==n)for(let i=0;i20&&xs(t,e,20,Ke()),n(i,r)}finally{bn(s)}}function js(t,e,n){if(he(e)){const i=e.directiveEnd;for(let r=e.directiveStart;r0;){const n=t[--e];if("number"==typeof n&&n<0)return n}return 0})(n)!=s&&n.push(s),n.push(i,r,o)}}function qs(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function Xs(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function Ys(t,e,n){if(n){if(e.exportAs)for(let i=0;i0&&ro(n)}}function ro(t){for(let n=jr(t);null!==n;n=Fr(n))for(let t=10;t0&&ro(e)}const e=t[1].components;if(null!==e)for(let n=0;n0&&ro(i)}}function so(t,e){const n=Re(e,t),i=n[1];(function(t,e){for(let n=e.length;nPromise.resolve(null))();function po(t){return t[7]||(t[7]=[])}function fo(t){return t.cleanup||(t.cleanup=[])}function go(t,e,n){return(null===t||fe(t))&&(n=function(t){for(;Array.isArray(t);){if("object"==typeof t[1])return t;t=t[0]}return null}(n[e.index])),n[11]}function mo(t,e){const n=t[9],i=n?n.get(kr,null):null;i&&i.handleError(e)}function bo(t,e,n,i,r){for(let s=0;sthis.processProvider(n,t,e)),ci([t],t=>this.processInjectorType(t,[],r)),this.records.set(_o,Io(void 0,this));const s=this.records.get(xo);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof t?null:ut(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=mi,n=It.Default){this.assertNotDestroyed();const i=Si(this),r=Dt(void 0);try{if(!(n&It.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=function(t){return"function"==typeof t||"object"==typeof t&&t instanceof oi}(t)&&Et(t);e=n&&this.injectableDefInScope(n)?Io(Ao(t),So):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&It.Self?Oo():this.parent).get(t,e=n&It.Optional&&e===mi?null:e)}catch(s){if("NullInjectorError"===s.name){if((s[yi]=s[yi]||[]).unshift(ut(t)),i)throw s;return Pi(s,t,"R3InjectorError",this.source)}throw s}finally{Dt(r),Si(i)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(ut(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=ft(t)))return!1;let i=Ot(t);const r=null==i&&t.ngModule||void 0,s=void 0===r?t:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=Ot(r)),null==i)return!1;if(null!=i.imports&&!o){let t;n.push(s);try{ci(i.imports,i=>{this.processInjectorType(i,e,n)&&(void 0===t&&(t=[]),t.push(i))})}finally{}if(void 0!==t)for(let e=0;ethis.processProvider(t,n,i||$t))}}this.injectorDefTypes.add(s);const a=me(s)||(()=>new s);this.records.set(s,Io(a,So));const l=i.providers;if(null!=l&&!o){const e=t;ci(l,t=>this.processProvider(t,e,l))}return void 0!==r&&void 0!==t.providers}processProvider(t,e,n){let i=Do(t=ft(t))?t:ft(t&&t.provide);const r=function(t,e,n){return Mo(t)?Io(void 0,t.useValue):Io(Po(t),So)}(t);if(Do(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=Io(void 0,So,!0),e.factory=()=>Ti(e.multi),this.records.set(i,e)),i=t,e.multi.push(t)}this.records.set(i,r)}hydrate(t,e){return e.value===So&&(e.value=Eo,e.value=e.factory()),"object"==typeof e.value&&e.value&&function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.ngOnDestroy}(e.value)&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){if(!t.providedIn)return!1;const e=ft(t.providedIn);return"string"==typeof e?"any"===e||e===this.scope:this.injectorDefTypes.has(e)}}function Ao(t){const e=Et(t),n=null!==e?e.factory:me(t);if(null!==n)return n;if(t instanceof oi)throw new Error(`Token ${ut(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=di(e,"?");throw new Error(`Can't resolve all parameters for ${ut(t)}: (${n.join(", ")}).`)}const n=function(t){const e=t&&(t[Tt]||t[At]);if(e){const n=function(t){if(t.hasOwnProperty("name"))return t.name;const e=(""+t).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),e}return null}(t);return null!==n?()=>n.factory(t):()=>new t}(t);throw new Error("unreachable")}function Po(t,e,n){let i;if(Do(t)){const e=ft(t);return me(e)||Ao(e)}if(Mo(t))i=()=>ft(t.useValue);else if(function(t){return!(!t||!t.useFactory)}(t))i=()=>t.useFactory(...Ti(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))i=()=>Ci(ft(t.useExisting));else{const e=ft(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return me(e)||Ao(e);i=()=>new e(...Ti(t.deps))}return i}function Io(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function Mo(t){return null!==t&&"object"==typeof t&&wi in t}function Do(t){return"function"==typeof t}const Ro=function(t,e,n){return function(t,e=null,n=null,i){const r=To(t,e,n,i);return r._resolveInjectorDefTypes(),r}({name:n},e,t,n)};class No{static create(t,e){return Array.isArray(t)?Ro(t,e,""):Ro(t.providers,t.parent,t.name||"")}}function Lo(t,e){_n(Cr(t)[1],Ge())}function jo(t){let e=function(t){return Object.getPrototypeOf(t.prototype).constructor}(t.type),n=!0;const i=[t];for(;e;){let r;if(fe(t))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(n){i.push(r);const e=t;e.inputs=Fo(t.inputs),e.declaredInputs=Fo(t.declaredInputs),e.outputs=Fo(t.outputs);const n=r.hostBindings;n&&zo(t,n);const s=r.viewQuery,o=r.contentQueries;if(s&&Bo(t,s),o&&Vo(t,o),ct(t.inputs,r.inputs),ct(t.declaredInputs,r.declaredInputs),ct(t.outputs,r.outputs),fe(r)&&r.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(r.data.animation)}}const e=r.features;if(e)for(let i=0;i=0;i--){const r=t[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Pn(r.hostAttrs,n=Pn(n,r.hostAttrs))}}(i)}function Fo(t){return t===Ht?{}:t===$t?[]:t}function Bo(t,e){const n=t.viewQuery;t.viewQuery=n?(t,i)=>{e(t,i),n(t,i)}:e}function Vo(t,e){const n=t.contentQueries;t.contentQueries=n?(t,i,r)=>{e(t,i,r),n(t,i,r)}:e}function zo(t,e){const n=t.hostBindings;t.hostBindings=n?(t,i)=>{e(t,i),n(t,i)}:e}No.THROW_IF_NOT_FOUND=mi,No.NULL=new wo,No.\u0275prov=xt({token:No,providedIn:"any",factory:()=>Ci(_o)}),No.__NG_ELEMENT_ID__=-1;let Uo=null;function Ho(){if(!Uo){const t=Ut.Symbol;if(t&&t.iterator)Uo=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;ea(Ae(t[i.index])):i.index;if(Te(n)){let o=null;if(!a&&l&&(o=function(t,e,n,i){const r=t.cleanup;if(null!=r)for(let s=0;sn?t[n]:null}"string"==typeof t&&(s+=2)}return null}(t,e,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,d=!1;else{s=ya(i,e,u,s,!1);const t=n.listen(f,r,s);h.push(s,t),c&&c.push(r,m,g,g+1)}}else s=ya(i,e,u,s,!0),f.addEventListener(r,s,o),h.push(s),c&&c.push(r,m,g,o)}else s=ya(i,e,u,s,!1);const p=i.outputs;let f;if(d&&null!==p&&(f=p[r])){const t=f.length;if(t)for(let n=0;n0;)e=e[15],t--;return e}(t,Ve.lFrame.contextLView))[8]}(t)}function _a(t,e){let n=null;const i=function(t){const e=t.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(t);for(let r=0;r=0}const Ta={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function ka(t){return t.substring(Ta.key,Ta.keyEnd)}function Aa(t){return t.substring(Ta.value,Ta.valueEnd)}function Pa(t,e){const n=Ta.textEnd;return n===e?-1:(e=Ta.keyEnd=function(t,e,n){for(;e32;)e++;return e}(t,Ta.key=e,n),Da(t,e,n))}function Ia(t,e){const n=Ta.textEnd;let i=Ta.key=Da(t,e,n);return n===i?-1:(i=Ta.keyEnd=function(t,e,n){let i;for(;e=65&&(-33&i)<=90||i>=48&&i<=57);)e++;return e}(t,i,n),i=Ra(t,i,n),i=Ta.value=Da(t,i,n),i=Ta.valueEnd=function(t,e,n){let i=-1,r=-1,s=-1,o=e,a=o;for(;o32&&(a=o),s=r,r=i,i=-33&l}return a}(t,i,n),Ra(t,i,n))}function Ma(t){Ta.key=0,Ta.keyEnd=0,Ta.value=0,Ta.valueEnd=0,Ta.textEnd=t.length}function Da(t,e,n){for(;e=0;n=Ia(e,n))qa(t,ka(e),Aa(e))}function Ba(t){Ua(pi,Va,t,!0)}function Va(t,e){for(let n=function(t){return Ma(t),Pa(t,Da(t,0,Ta.textEnd))}(e);n>=0;n=Pa(e,n))pi(t,ka(e),!0)}function za(t,e,n,i){const r=Ue(),s=He(),o=en(2);s.firstUpdatePass&&$a(s,t,o,i),e!==_s&&Xo(r,o,e)&&Xa(s,s.data[mn()],r,r[11],t,r[o+1]=function(t,e){return null==t||("string"==typeof e?t+=e:"object"==typeof t&&(t=ut(Wi(t)))),t}(e,n),i,o)}function Ua(t,e,n,i){const r=He(),s=en(2);r.firstUpdatePass&&$a(r,null,s,i);const o=Ue();if(n!==_s&&Xo(o,s,n)){const a=r.data[mn()];if(Qa(a,i)&&!Ha(r,s)){let t=i?a.classesWithoutHost:a.stylesWithoutHost;null!==t&&(n=ht(t,n||"")),ia(r,a,o,n,i)}else!function(t,e,n,i,r,s,o,a){r===_s&&(r=$t);let l=0,c=0,u=0=t.expandoStartIndex}function $a(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[mn()],o=Ha(t,n);Qa(s,i)&&null===e&&!o&&(e=!1),e=function(t,e,n,i){const r=sn(t);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(n=Wa(n=Ga(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=Ga(r,t,e,n,i),null===s){let n=function(t,e,n){const i=n?e.classBindings:e.styleBindings;if(0!==Os(i))return t[Es(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=Ga(null,t,e,n[1],i),n=Wa(n,e.attrs,i),function(t,e,n,i){t[Es(n?e.classBindings:e.styleBindings)]=i}(t,e,i,n))}else s=function(t,e,n){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(u=!0)}else c=n;if(r)if(0!==l){const e=Es(t[a+1]);t[i+1]=Ss(e,a),0!==e&&(t[e+1]=Ts(t[e+1],i)),t[a+1]=function(t,e){return 131071&t|e<<17}(t[a+1],i)}else t[i+1]=Ss(a,0),0!==a&&(t[a+1]=Ts(t[a+1],i)),a=i;else t[i+1]=Ss(l,0),0===a?a=i:t[l+1]=Ts(t[l+1],i),l=i;u&&(t[i+1]=Cs(t[i+1])),Ca(t,c,i,!0),Ca(t,c,i,!1),function(t,e,n,i,r){const s=r?t.residualClasses:t.residualStyles;null!=s&&"string"==typeof e&&gi(s,e)>=0&&(n[i+1]=ks(n[i+1]))}(e,c,t,i,s),o=Ss(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,n,o,i)}}function Ga(t,e,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a0;){const e=t[r],s=Array.isArray(e),l=s?e[1]:e,c=null===l;let u=n[r+1];u===_s&&(u=c?$t:void 0);let h=c?fi(u,i):l===i?u:void 0;if(s&&!Ka(h)&&(h=fi(e,i)),Ka(h)&&(a=h,o))return a;const d=t[r+1];r=o?Es(d):Os(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=fi(t,i))}return a}function Ka(t){return void 0!==t}function Qa(t,e){return 0!=(t.flags&(e?16:32))}function Za(t,e=""){const n=Ue(),i=He(),r=t+20,s=i.firstCreatePass?Is(i,r,1,e,null):i.data[r],o=n[r]=function(t,e){return Te(t)?t.createText(e):t.createTextNode(e)}(n[11],e);Jr(i,n,o,s),qe(s,!1)}function Ja(t){return tl("",t,""),Ja}function tl(t,e,n){const i=Ue(),r=Qo(i,t,e,n);return r!==_s&&yo(i,mn(),r),tl}function el(t,e,n,i,r){const s=Ue(),o=function(t,e,n,i,r,s){const o=Yo(t,Je(),n,r);return en(2),o?e+yt(n)+i+yt(r)+s:_s}(s,t,e,n,i,r);return o!==_s&&yo(s,mn(),o),el}function nl(t,e,n){Ua(pi,Va,Qo(Ue(),t,e,n),!0)}function il(t,e,n){const i=Ue();return Xo(i,tn(),e)&&$s(He(),yn(),i,t,e,i[11],n,!0),il}function rl(t,e,n){const i=Ue();if(Xo(i,tn(),e)){const r=He(),s=yn();$s(r,s,i,t,e,go(sn(r.data),s,i),n,!0)}return rl}const sl=void 0;var ol=["en",[["a","p"],["AM","PM"],sl],[["AM","PM"],sl,sl],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],sl,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],sl,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",sl,"{1} 'at' {0}",sl],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){const e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];let al={};function ll(t){return t in al||(al[t]=Ut.ng&&Ut.ng.common&&Ut.ng.common.locales&&Ut.ng.common.locales[t]),al[t]}var cl=(()=>((cl=cl||{})[cl.LocaleId=0]="LocaleId",cl[cl.DayPeriodsFormat=1]="DayPeriodsFormat",cl[cl.DayPeriodsStandalone=2]="DayPeriodsStandalone",cl[cl.DaysFormat=3]="DaysFormat",cl[cl.DaysStandalone=4]="DaysStandalone",cl[cl.MonthsFormat=5]="MonthsFormat",cl[cl.MonthsStandalone=6]="MonthsStandalone",cl[cl.Eras=7]="Eras",cl[cl.FirstDayOfWeek=8]="FirstDayOfWeek",cl[cl.WeekendRange=9]="WeekendRange",cl[cl.DateFormat=10]="DateFormat",cl[cl.TimeFormat=11]="TimeFormat",cl[cl.DateTimeFormat=12]="DateTimeFormat",cl[cl.NumberSymbols=13]="NumberSymbols",cl[cl.NumberFormats=14]="NumberFormats",cl[cl.CurrencyCode=15]="CurrencyCode",cl[cl.CurrencySymbol=16]="CurrencySymbol",cl[cl.CurrencyName=17]="CurrencyName",cl[cl.Currencies=18]="Currencies",cl[cl.Directionality=19]="Directionality",cl[cl.PluralCase=20]="PluralCase",cl[cl.ExtraData=21]="ExtraData",cl))();const ul="en-US";let hl=ul;function dl(t){wt(t,"Expected localeId to be defined"),"string"==typeof t&&(hl=t.toLowerCase().replace(/_/g,"-"))}function pl(t,e,n,i,r){if(t=ft(t),Array.isArray(t))for(let s=0;s>20;if(Do(t)||!t.multi){const i=new On(l,r,ea),p=ml(a,e,r?u:u+d,h);-1===p?(Un(Fn(c,o),s,a),fl(s,t,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(i),o.push(i)):(n[p]=i,o[p]=i)}else{const p=ml(a,e,u+d,h),f=ml(a,e,u,u+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Un(Fn(c,o),s,a);const u=function(t,e,n,i,r){const s=new On(t,n,ea);return s.multi=[],s.index=e,s.componentProviders=0,gl(s,r,i&&!n),s}(r?yl:bl,n.length,r,i,l);!r&&m&&(n[f].providerFactory=u),fl(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(u),o.push(u)}else fl(s,t,p>-1?p:f,gl(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function fl(t,e,n,i){const r=Do(e);if(r||function(t){return!!t.useClass}(e)){const s=(e.useClass||e).prototype.ngOnDestroy;if(s){const o=t.destroyHooks||(t.destroyHooks=[]);if(!r&&e.multi){const t=o.indexOf(n);-1===t?o.push(n,[i,s]):o[t+1].push(i,s)}else o.push(n,s)}}}function gl(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function ml(t,e,n,i){for(let r=n;r{n.providersResolver=(n,i)=>function(t,e,n){const i=He();if(i.firstCreatePass){const r=fe(t);pl(n,i.data,i.blueprint,r,!0),pl(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class wl{}const xl="ngComponent";class Sl{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${ut(t)}. Did you add it to @NgModule.entryComponents?`);return e[xl]=t,e}(t)}}class El{}function Cl(...t){}function Ol(t,e){return new kl(Ie(t,e))}El.NULL=new Sl;const Tl=function(){return Ol(Ge(),Ue())};let kl=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=Tl,t})();function Al(t){return t instanceof kl?t.nativeElement:t}class Pl{}let Il=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Ml(),t})();const Ml=function(){const t=Ue(),e=Re(Ge().index,t);return function(t){return t[11]}(ce(e)?e:t)};let Dl=(()=>{class t{}return t.\u0275prov=xt({token:t,providedIn:"root",factory:()=>null}),t})();class Rl{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Nl=new Rl("12.2.5");class Ll{constructor(){}supports(t){return Go(t)}create(t){return new Fl(t)}}const jl=(t,e)=>e;class Fl{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||jl}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,i=0,r=null;for(;e||n;){const s=!n||e&&e.currentIndex{i=this._trackByFn(e,t),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,t,i,e)),Object.is(r.item,t)||this._addIdentityChange(r,t)):(r=this._mismatch(r,t,i,e),s=!0),r=r._next,e++}),this.length=e;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,i){let r;return null===t?r=this._itTail:(r=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,r,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,r,i)):t=this._addAfter(new Bl(e,n),r,i),t}_verifyReinsertion(t,e,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?t=this._reinsertAfter(r,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,r=t._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const i=null===e?this._itHead:e._next;return t._next=i,t._prev=e,null===i?this._itTail=t:i._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new zl),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new zl),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class Bl{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Vl{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class zl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new Vl,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Ul(t,e,n){const i=t.previousIndex;if(null===i)return i;let r=0;return n&&i{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const i=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,i)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new Gl(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class Gl{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function Wl(){return new ql([new Ll])}let ql=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Wl()),deps:[[t,new Di,new Mi]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(t){return t.name||typeof t}(t)}'`)}}return t.\u0275prov=xt({token:t,providedIn:"root",factory:Wl}),t})();function Xl(){return new Yl([new Hl])}let Yl=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Xl()),deps:[[t,new Di,new Mi]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=xt({token:t,providedIn:"root",factory:Xl}),t})();function Kl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(Ae(s)),ue(s))for(let t=10;t-1&&(Hr(t,n),hi(e,n))}this._attachedToViewContainer=!1}$r(this._lView[1],this._lView)}onDestroy(t){Us(this._lView[1],this._lView,null,t)}markForCheck(){ao(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){lo(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){Qe(!0);try{lo(t,e,n)}finally{Qe(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(t,e){rs(t,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class Zl extends Ql{constructor(t){super(t),this._view=t}detectChanges(){co(this._view)}checkNoChanges(){!function(t){Qe(!0);try{co(t)}finally{Qe(!1)}}(this._view)}get context(){return null}}const Jl=function(t){return function(t,e,n){if(de(t)&&!n){const n=Re(t.index,e);return new Ql(n,n)}return 47&t.type?new Ql(e[16],e):null}(Ge(),Ue(),16==(16&t))};let tc=(()=>{class t{}return t.__NG_ELEMENT_ID__=Jl,t})();const ec=[new Hl],nc=new ql([new Ll]),ic=new Yl(ec),rc=function(){return lc(Ge(),Ue())};let sc=(()=>{class t{}return t.__NG_ELEMENT_ID__=rc,t})();const oc=sc,ac=class extends oc{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=Ps(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(e)),Ds(e,n,t),new Ql(n)}};function lc(t,e){return 4&t.type?new ac(e,t,Ol(t,e)):null}class cc{}const uc=function(){return mc(Ge(),Ue())};let hc=(()=>{class t{}return t.__NG_ELEMENT_ID__=uc,t})();const dc=hc,pc=class extends dc{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return Ol(this._hostTNode,this._hostLView)}get injector(){return new Jn(this._hostTNode,this._hostLView)}get parentInjector(){const t=zn(this._hostTNode,this._hostLView);if(Mn(t)){const e=Rn(t,this._hostLView),n=Dn(t);return new Jn(e[1].data[n+8],e)}return new Jn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=fc(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,e,n){const i=t.createEmbeddedView(e||{});return this.insert(i,n),i}createComponent(t,e,n,i,r){const s=n||this.parentInjector;if(!r&&null==t.ngModule&&s){const t=s.get(cc,null);t&&(r=t)}const o=t.create(s,i,void 0,r);return this.insert(o.hostView,e),o}insert(t,e){const n=t._lView,i=n[1];if(function(t){return ue(t[3])}(n)){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],i=new pc(e,e[6],e[3]);i.detach(i.indexOf(t))}}const r=this._adjustIndex(e),s=this._lContainer;!function(t,e,n,i){const r=10+i,s=n.length;i>0&&(n[r-1][4]=e),iAr});class wc extends wl{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=function(t){return t.map(vs).join(",")}(t.selectors),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return vc(this.componentDef.inputs)}get outputs(){return vc(this.componentDef.outputs)}create(t,e,n,i){const r=(i=i||this.ngModule)?function(t,e){return{get:(n,i,r)=>{const s=t.get(n,bc,r);return s!==bc||i===bc?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Pl,ke),o=r.get(Dl,null),a=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(Te(t))return t.selectRootElement(e,n===jt.ShadowDom);let i="string"==typeof e?t.querySelector(e):e;return i.textContent="",i}(a,n,this.componentDef.encapsulation):zr(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?Ee:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),u=this.componentDef.onPush?576:528,h=function(t,e){return{components:[],scheduler:t||Ar,clean:ho,playerHandler:e||null,flags:0}}(),d=zs(0,null,null,1,0,null,null,null,null,null),p=Ps(null,d,h,u,null,null,s,a,o,r);let f,g;un(p);try{const t=function(t,e,n,i,r,s){const o=n[1];n[20]=t;const a=Is(o,20,2,"#host",null),l=a.mergedAttrs=e.hostAttrs;null!==l&&(vo(a,l,!0),null!==t&&(Tn(r,t,l),null!==a.classes&&as(r,t,a.classes),null!==a.styles&&os(r,t,a.styles)));const c=i.createRenderer(t,e),u=Ps(n,Vs(e),null,e.onPush?64:16,n[20],a,i,c,s||null,null);return o.firstCreatePass&&(Un(Fn(a,n),o,e.type),Xs(o,a),Ks(a,n.length,1)),oo(n,u),n[20]=u}(c,this.componentDef,p,s,a);if(c)if(n)Tn(a,c,["ng-version",Nl.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let i=1,r=2;for(;i0&&as(a,c,e.join(" "))}if(g=Me(d,20),void 0!==e){const t=g.projection=[];for(let n=0;nt(o,e)),e.contentQueries){const t=Ge();e.contentQueries(1,o,t.directiveStart)}const a=Ge();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(bn(a.index),Ws(n[1],a,0,a.directiveStart,a.directiveEnd,e),qs(e,o)),o}(t,this.componentDef,p,h,[Lo]),Ds(d,p,null)}finally{gn()}return new xc(this.componentType,f,Ol(g,p),p,g)}}class xc extends class{}{constructor(t,e,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.instance=e,this.hostView=this.changeDetectorRef=new Zl(i),this.componentType=t}get injector(){return new Jn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Sc=new Map;class Ec extends cc{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new yc(this);const n=le(t),i=function(t){return t[Yt]||null}(t);i&&dl(i),this._bootstrapComponents=Mr(n.bootstrap),this._r3Injector=To(t,e,[{provide:cc,useValue:this},{provide:El,useValue:this.componentFactoryResolver}],ut(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=No.THROW_IF_NOT_FOUND,n=It.Default){return t===No||t===cc||t===_o?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Cc extends class{}{constructor(t){super(),this.moduleType=t,null!==le(t)&&function(t){const e=new Set;!function t(n){const i=le(n,!0),r=i.id;null!==r&&(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${ut(e)} vs ${ut(e.name)}`)}(r,Sc.get(r),n),Sc.set(r,n));const s=Mr(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Ec(this.moduleType,t)}}function Oc(t,e,n){const i=Ze()+t,r=Ue();return r[i]===_s?qo(r,i,n?e.call(n):e()):function(t,e){return t[e]}(r,i)}function Tc(t,e,n,i){return Pc(Ue(),Ze(),t,e,n,i)}function kc(t,e,n,i,r,s){return function(t,e,n,i,r,s,o,a){const l=e+n;return function(t,e,n,i,r){const s=Yo(t,e,n,i);return Xo(t,e+2,r)||s}(t,l,r,s,o)?qo(t,l+3,a?i.call(a,r,s,o):i(r,s,o)):Ac(t,l+3)}(Ue(),Ze(),t,e,n,i,r,s)}function Ac(t,e){const n=t[e];return n===_s?void 0:n}function Pc(t,e,n,i,r,s){const o=e+n;return Xo(t,o,r)?qo(t,o+1,s?i.call(s,r):i(r)):Ac(t,o+1)}function Ic(t,e){const n=He();let i;const r=t+20;n.firstCreatePass?(i=function(t,e){if(e)for(let n=e.length-1;n>=0;n--){const i=e[n];if(t===i.name)return i}throw new mt("302",`The pipe '${t}' could not be found!`)}(e,n.pipeRegistry),n.data[r]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(r,i.onDestroy)):i=n.data[r];const s=i.factory||(i.factory=me(i.type)),o=Dt(ea);try{const t=Ln(!1),e=s();return Ln(t),function(t,e,n,i){n>=t.data.length&&(t.data[n]=null,t.blueprint[n]=null),e[n]=i}(n,Ue(),r,e),e}finally{Dt(o)}}function Mc(t,e,n){const i=t+20,r=Ue(),s=De(r,i);return function(t,e){$o.isWrapped(e)&&(e=$o.unwrap(e),t[Je()]=_s);return e}(r,function(t,e){return t[1].data[e].pure}(r,i)?Pc(r,Ze(),e,s.transform,n,s):s.transform(n))}function Dc(t){return e=>{setTimeout(t,void 0,e)}}const Rc=class extends P{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){var i,r,s;let o=t,a=e||(()=>null),l=n;if(t&&"object"==typeof t){const e=t;o=null===(i=e.next)||void 0===i?void 0:i.bind(e),a=null===(r=e.error)||void 0===r?void 0:r.bind(e),l=null===(s=e.complete)||void 0===s?void 0:s.bind(e)}this.__isAsync&&(a=Dc(a),o&&(o=Dc(o)),l&&(l=Dc(l)));const c=super.subscribe({next:o,error:a,complete:l});return t instanceof g&&t.add(c),c}};function Nc(){return this._results[Ho()]()}class Lc{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const e=Ho(),n=Lc.prototype;n[e]||(n[e]=Nc)}get changes(){return this._changes||(this._changes=new Rc)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,e){const n=this;n.dirty=!1;const i=li(t);(this._changesDetected=!function(t,e,n){if(t.length!==e.length)return!1;for(let i=0;i0)i.push(o[t/2]);else{const r=s[t+1],o=e[-n];for(let t=10;t{class t{constructor(t){this.appInits=t,this.resolve=Cl,this.reject=Cl,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n{e.subscribe({complete:t,error:n})});t.push(n)}}Promise.all(t).then(()=>{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(Ci(tu,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const nu=new oi("AppId"),iu={provide:nu,useFactory:function(){return`${ru()}${ru()}${ru()}`},deps:[]};function ru(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const su=new oi("Platform Initializer"),ou=new oi("Platform ID"),au=new oi("appBootstrapListener");let lu=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const cu=new oi("LocaleId"),uu=new oi("DefaultCurrencyCode");class hu{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const du=function(t){return new Cc(t)},pu=du,fu=function(t){return Promise.resolve(du(t))},gu=function(t){const e=du(t),n=Mr(le(t).declarations).reduce((t,e)=>{const n=ae(e);return n&&t.push(new wc(n)),t},[]);return new hu(e,n)},mu=gu,bu=function(t){return Promise.resolve(gu(t))};let yu=(()=>{class t{constructor(){this.compileModuleSync=pu,this.compileModuleAsync=fu,this.compileModuleAndAllComponentsSync=mu,this.compileModuleAndAllComponentsAsync=bu}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const vu=new oi("compilerOptions"),_u=(()=>Promise.resolve(0))();function wu(t){"undefined"==typeof Zone?_u.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class xu{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Rc(!1),this.onMicrotaskEmpty=new Rc(!1),this.onStable=new Rc(!1),this.onError=new Rc(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const i=this;i._nesting=0,i._outer=i._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!n&&e,i.shouldCoalesceRunChangeDetection=n,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function(){let t=Ut.requestAnimationFrame,e=Ut.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=()=>{!function(t){t.isCheckStableRunning||-1!==t.lastRequestAnimationFrameId||(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(Ut,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,Cu(t),t.isCheckStableRunning=!0,Eu(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Cu(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,i,r,s,o,a)=>{try{return Ou(t),n.invokeTask(r,s,o,a)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||t.shouldCoalesceRunChangeDetection)&&e(),Tu(t)}},onInvoke:(n,i,r,s,o,a,l)=>{try{return Ou(t),n.invoke(r,s,o,a,l)}finally{t.shouldCoalesceRunChangeDetection&&e(),Tu(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Cu(t),Eu(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,i,r)=>(e.handleError(i,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}(i)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!xu.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(xu.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,t,Su,Cl,Cl);try{return r.runTask(s,e,n)}finally{r.cancelTask(s)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}const Su={};function Eu(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Cu(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function Ou(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Tu(t){t._nesting--,Eu(t)}class ku{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Rc,this.onMicrotaskEmpty=new Rc,this.onStable=new Rc,this.onError=new Rc}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,i){return t.apply(e,n)}}let Au=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{xu.assertNotInAngularZone(),wu(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())wu(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let i=-1;e&&e>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==i),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})}whenStable(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Pu=(()=>{class t{constructor(){this._applications=new Map,Mu.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return Mu.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Iu{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let Mu=new Iu,Du=!0,Ru=!1;function Nu(){return Ru=!0,Du}let Lu;const ju=new oi("AllowMultipleToken");function Fu(t,e,n=[]){const i=`Platform: ${e}`,r=new oi(i);return(e=[])=>{let s=Bu();if(!s||s.injector.get(ju,!1))if(t)t(n.concat(e).concat({provide:r,useValue:!0}));else{const t=n.concat(e).concat({provide:r,useValue:!0},{provide:xo,useValue:"platform"});!function(t){if(Lu&&!Lu.destroyed&&!Lu.injector.get(ju,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Lu=t.get(Vu);const e=t.get(su,null);e&&e.forEach(t=>t())}(No.create({providers:t,name:i}))}return function(t){const e=Bu();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function Bu(){return Lu&&!Lu.destroyed?Lu:null}let Vu=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new ku:("zone.js"===t?void 0:t)||new xu({enableLongStackTrace:Nu(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),n}(e?e.ngZone:void 0,{ngZoneEventCoalescing:e&&e.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:e&&e.ngZoneRunCoalescing||!1}),i=[{provide:xu,useValue:n}];return n.run(()=>{const r=No.create({providers:i,parent:this.injector,name:t.moduleType.name}),s=t.create(r),o=s.injector.get(kr,null);if(!o)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const t=n.onError.subscribe({next:t=>{o.handleError(t)}});s.onDestroy(()=>{Hu(this._modules,s),t.unsubscribe()})}),function(t,n,i){try{const e=i();return ha(e)?e.catch(e=>{throw n.runOutsideAngular(()=>t.handleError(e)),e}):e}catch(e){throw n.runOutsideAngular(()=>t.handleError(e)),e}}(o,n,()=>{const t=s.injector.get(eu);return t.runInitializers(),t.donePromise.then(()=>(dl(s.injector.get(cu,ul)||ul),this._moduleDoBootstrap(s),s))})})}bootstrapModule(t,e=[]){const n=zu({},e);return function(t,e,n){const i=new Cc(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(Uu);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${ut(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(e)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function zu(t,e){return Array.isArray(e)?e.reduce(zu,t):Object.assign(Object.assign({},t),e)}let Uu=(()=>{class t{constructor(t,e,n,i,r){this._zone=t,this._injector=e,this._exceptionHandler=n,this._componentFactoryResolver=i,this._initStatus=r,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const s=new C(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),o=new C(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{xu.assertNotInAngularZone(),wu(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{xu.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=Q(s,o.pipe(at()))}bootstrap(t,e){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=t instanceof wl?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=function(t){return t.isBoundToModule}(n)?void 0:this._injector.get(cc),r=n.create(No.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Au,null),a=o&&r.injector.get(Pu);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),Hu(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;Hu(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(au,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(No),Ci(kr),Ci(El),Ci(eu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Hu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const $u=Fu(null,"core",[{provide:ou,useValue:"unknown"},{provide:Vu,deps:[No]},{provide:Pu,deps:[]},{provide:lu,deps:[]}]),Gu=[{provide:Uu,useClass:Uu,deps:[xu,No,kr,El,eu]},{provide:_c,deps:[xu],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:eu,useClass:eu,deps:[[new Mi,tu]]},{provide:yu,useClass:yu,deps:[]},iu,{provide:ql,useFactory:function(){return nc},deps:[]},{provide:Yl,useFactory:function(){return ic},deps:[]},{provide:cu,useFactory:function(t){return dl(t=t||"undefined"!=typeof $localize&&$localize.locale||ul),t},deps:[[new Ii(cu),new Mi,new Di]]},{provide:uu,useValue:"USD"}];let Wu=(()=>{class t{constructor(t){}}return t.\u0275fac=function(e){return new(e||t)(Ci(Uu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Gu}),t})(),qu=null;function Xu(){return qu}const Yu=new oi("DocumentToken");let Ku=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:Qu,token:t,providedIn:"platform"}),t})();function Qu(){return Ci(Zu)}let Zu=(()=>{class t extends Ku{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Xu().getBaseHref(this._doc)}onPopState(t){const e=Xu().getGlobalEventTarget(this._doc,"window");return e.addEventListener("popstate",t,!1),()=>e.removeEventListener("popstate",t)}onHashChange(t){const e=Xu().getGlobalEventTarget(this._doc,"window");return e.addEventListener("hashchange",t,!1),()=>e.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){Ju()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){Ju()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:th,token:t,providedIn:"platform"}),t})();function Ju(){return!!window.history.pushState}function th(){return new Zu(Ci(Yu))}function eh(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}function nh(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}function ih(t){return t&&"?"!==t[0]?"?"+t:t}let rh=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:sh,token:t,providedIn:"root"}),t})();function sh(t){const e=Ci(Yu).location;return new ah(Ci(Ku),e&&e.origin||"")}const oh=new oi("appBaseHref");let ah=(()=>{class t extends rh{constructor(t,e){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=e}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return eh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+ih(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+ih(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+ih(i));this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var e,n;null===(n=(e=this._platformLocation).historyGo)||void 0===n||n.call(e,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ku),Ci(oh,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),lh=(()=>{class t{constructor(t,e){this._subject=new Rc,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=nh(uh(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+ih(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,uh(e)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ih(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ih(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var e,n;null===(n=(e=this._platformStrategy).historyGo)||void 0===n||n.call(e,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}))}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}}return t.\u0275fac=function(e){return new(e||t)(Ci(rh),Ci(Ku))},t.normalizeQueryParams=ih,t.joinWithSlash=eh,t.stripTrailingSlash=nh,t.\u0275prov=xt({factory:ch,token:t,providedIn:"root"}),t})();function ch(){return new lh(Ci(rh),Ci(Ku))}function uh(t){return t.replace(/\/index.html$/,"")}var hh=(()=>((hh=hh||{})[hh.Zero=0]="Zero",hh[hh.One=1]="One",hh[hh.Two=2]="Two",hh[hh.Few=3]="Few",hh[hh.Many=4]="Many",hh[hh.Other=5]="Other",hh))();const dh=function(t){return function(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=ll(e);if(n)return n;const i=e.split("-")[0];if(n=ll(i),n)return n;if("en"===i)return ol;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[cl.PluralCase]};class ph{}let fh=(()=>{class t extends ph{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(dh(e||this.locale)(t)){case hh.Zero:return"zero";case hh.One:return"one";case hh.Two:return"two";case hh.Few:return"few";case hh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(Ci(cu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function gh(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[i,r]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(i.trim()===e)return decodeURIComponent(r)}return null}let mh=(()=>{class t{constructor(t,e,n,i){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&(Go(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachChangedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachRemovedItem(t=>{t.previousValue&&this._toggleClass(t.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(t=>{if("string"!=typeof t.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${ut(t.item)}`);this._toggleClass(t.item,!0)}),t.forEachRemovedItem(t=>this._toggleClass(t.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!0)):Object.keys(t).forEach(e=>this._toggleClass(e,!!t[e])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!1)):Object.keys(t).forEach(t=>this._toggleClass(t,!1)))}_toggleClass(t,e){(t=t.trim())&&t.split(/\s+/g).forEach(t=>{e?this._renderer.addClass(this._ngEl.nativeElement,t):this._renderer.removeClass(this._ngEl.nativeElement,t)})}}return t.\u0275fac=function(e){return new(e||t)(ea(ql),ea(Yl),ea(kl),ea(Il))},t.\u0275dir=se({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class bh{constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let yh=(()=>{class t{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const e=this._ngForOf;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${e}' of type '${function(t){return t.name||typeof t}(e)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,i)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new bh(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new vh(t,n);e.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new vh(t,r);e.push(s)}});for(let n=0;n{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(ql))},t.\u0275dir=se({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class vh{constructor(t,e){this.record=t,this.view=e}}let _h=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new wh,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){xh("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){xh("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc))},t.\u0275dir=se({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class wh{constructor(){this.$implicit=null,this.ngIf=null}}function xh(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${ut(e)}'.`)}class Sh{constructor(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()}}let Eh=(()=>{class t{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let e=0;e{class t{constructor(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new Sh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(Eh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Oh=(()=>{class t{constructor(t,e,n){n._addDefault(new Sh(t,e))}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(Eh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchDefault",""]]}),t})(),Th=(()=>{class t{constructor(t,e,n){this._ngEl=t,this._differs=e,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,e){const[n,i]=t.split(".");null!=(e=null!=e&&i?`${e}${i}`:e)?this._renderer.setStyle(this._ngEl.nativeElement,n,e):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(t){t.forEachRemovedItem(t=>this._setStyle(t.key,null)),t.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),t.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Yl),ea(Il))},t.\u0275dir=se({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),kh=(()=>{class t{constructor(t){this._viewContainerRef=t,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(t){if(t.ngTemplateOutlet){const t=this._viewContainerRef;this._viewRef&&t.remove(t.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?t.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&t.ngTemplateOutletContext&&this.ngTemplateOutletContext&&(this._viewRef.context=this.ngTemplateOutletContext)}}return t.\u0275fac=function(e){return new(e||t)(ea(hc))},t.\u0275dir=se({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[ye]}),t})();class Ah{createSubscription(t,e){return t.subscribe({next:e,error:t=>{throw t}})}dispose(t){t.unsubscribe()}onDestroy(t){t.unsubscribe()}}class Ph{createSubscription(t,e){return t.then(e,t=>{throw t})}dispose(t){}onDestroy(t){}}const Ih=new Ph,Mh=new Ah;let Dh=(()=>{class t{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,e=>this._updateLatestValue(t,e))}_selectStrategy(e){if(ha(e))return Ih;if(da(e))return Mh;throw function(t,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${ut(t)}'`)}(t,e)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,e){t===this._obj&&(this._latestValue=e,this._ref.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(ea(tc,16))},t.\u0275pipe=oe({name:"async",type:t,pure:!1}),t})(),Rh=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:ph,useClass:fh}]}),t})();const Nh="browser";function Lh(t){return t===Nh}class jh{}class Fh extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(t){qu||(qu=t)}(new Fh)}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getBaseHref(t){const e=(Vh=Vh||document.querySelector("base"),Vh?Vh.getAttribute("href"):null);return null==e?null:function(t){Bh=Bh||document.createElement("a"),Bh.setAttribute("href",t);const e=Bh.pathname;return"/"===e.charAt(0)?e:`/${e}`}(e)}resetBaseElement(){Vh=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return gh(document.cookie,t)}}let Bh,Vh=null;const zh=new oi("TRANSITION_ID"),Uh=[{provide:tu,useFactory:function(t,e,n){return()=>{n.get(eu).donePromise.then(()=>{const n=Xu(),i=e.querySelectorAll(`style[ng-transition="${t}"]`);for(let t=0;t{const i=t.findTestabilityInTree(e,n);if(null==i)throw new Error("Could not find testability for element.");return i},Ut.getAllAngularTestabilities=()=>t.getAllTestabilities(),Ut.getAllAngularRootElements=()=>t.getAllRootElements(),Ut.frameworkStabilizers||(Ut.frameworkStabilizers=[]),Ut.frameworkStabilizers.push(t=>{const e=Ut.getAllAngularTestabilities();let n=e.length,i=!1;const r=function(e){i=i||e,n--,0==n&&t(i)};e.forEach(function(t){t.whenStable(r)})})}findTestabilityInTree(t,e,n){if(null==e)return null;const i=t.getTestability(e);return null!=i?i:n?Xu().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}let $h=(()=>{class t{build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Gh=new oi("EventManagerPlugins");let Wh=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let i=0;i{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Yh=(()=>{class t extends Xh{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,e,n){t.forEach(t=>{const i=this._doc.createElement("style");i.textContent=t,n.push(e.appendChild(i))})}addHost(t){const e=[];this._addStylesToHost(this._stylesSet,t,e),this._hostNodes.set(t,e)}removeHost(t){const e=this._hostNodes.get(t);e&&e.forEach(Kh),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((e,n)=>{this._addStylesToHost(t,n,e)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(Kh))}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Kh(t){Xu().remove(t)}const Qh={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Zh=/%COMP%/g;function Jh(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let ed=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new nd(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case jt.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new id(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case jt.ShadowDom:return new rd(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=Jh(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(Ci(Wh),Ci(Yh),Ci(nu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class nd{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(Qh[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,i){if(i){e=i+":"+e;const r=Qh[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=Qh[n];i?t.removeAttributeNS(i,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&(Dr.DashCase|Dr.Important)?t.style.setProperty(e,n,i&Dr.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&Dr.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,td(n)):this.eventManager.addEventListener(t,e,td(n))}}class id extends nd{constructor(t,e,n,i){super(t),this.component=n;const r=Jh(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr=function(t){return"_ngcontent-%COMP%".replace(Zh,t)}(i+"-"+n.id),this.hostAttr=function(t){return"_nghost-%COMP%".replace(Zh,t)}(i+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class rd extends nd{constructor(t,e,n,i){super(t),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=Jh(i.id,i.styles,[]);for(let s=0;s{class t extends qh{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const od=["alt","control","meta","shift"],ad={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},ld={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},cd={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let ud=(()=>{class t extends qh{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,i){const r=t.parseEventName(n),s=t.eventCallback(r.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Xu().onAndCancel(e,r.domEventName,s))}static parseEventName(e){const n=e.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=t._normalizeKey(n.pop());let s="";if(od.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),s+=t+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&ld.hasOwnProperty(e)&&(e=ld[e]))}return ad[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),od.forEach(i=>{i!=n&&cd[i](t)&&(e+=i+".")}),e+=n,e}static eventCallback(e,n,i){return r=>{t.getEventFullKey(r)===e&&i.runGuarded(()=>n(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),hd=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return Ci(dd)},token:t,providedIn:"root"}),t})(),dd=(()=>{class t extends hd{constructor(t){super(),this._doc=t}sanitize(t,e){if(null==e)return null;switch(t){case yr.NONE:return e;case yr.HTML:return qi(e,"HTML")?Wi(e):mr(this._doc,String(e)).toString();case yr.STYLE:return qi(e,"Style")?Wi(e):e;case yr.SCRIPT:if(qi(e,"Script"))return Wi(e);throw new Error("unsafe value used in a script context");case yr.URL:return Xi(e),qi(e,"URL")?Wi(e):Ji(String(e));case yr.RESOURCE_URL:if(qi(e,"ResourceURL"))return Wi(e);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function(t){return new zi(t)}(t)}bypassSecurityTrustStyle(t){return function(t){return new Ui(t)}(t)}bypassSecurityTrustScript(t){return function(t){return new Hi(t)}(t)}bypassSecurityTrustUrl(t){return function(t){return new $i(t)}(t)}bypassSecurityTrustResourceUrl(t){return function(t){return new Gi(t)}(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return function(t){return new dd(t.get(Yu))}(Ci(_o))},token:t,providedIn:"root"}),t})();const pd=Fu($u,"browser",[{provide:ou,useValue:Nh},{provide:su,useValue:function(){Fh.makeCurrent(),Hh.init()},multi:!0},{provide:Yu,useFactory:function(){return function(t){Ce=t}(document),document},deps:[]}]),fd=[[],{provide:xo,useValue:"root"},{provide:kr,useFactory:function(){return new kr},deps:[]},{provide:Gh,useClass:sd,multi:!0,deps:[Yu,xu,ou]},{provide:Gh,useClass:ud,multi:!0,deps:[Yu]},[],{provide:ed,useClass:ed,deps:[Wh,Yh,nu]},{provide:Pl,useExisting:ed},{provide:Xh,useExisting:Yh},{provide:Yh,useClass:Yh,deps:[Yu]},{provide:Au,useClass:Au,deps:[xu]},{provide:Wh,useClass:Wh,deps:[Gh,xu]},{provide:jh,useClass:$h,deps:[]},[]];let gd=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:nu,useValue:e.appId},{provide:zh,useExisting:nu},Uh]}}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:fd,imports:[Rh,Wu]}),t})();function md(t){return null!=t&&"false"!=`${t}`}function bd(t,e=0){return function(t){return!isNaN(parseFloat(t))&&!isNaN(Number(t))}(t)?Number(t):e}function yd(t){return Array.isArray(t)?t:[t]}function vd(t){return null==t?"":"string"==typeof t?t:`${t}px`}function _d(t){return t instanceof kl?t.nativeElement:t}function wd(...t){let e=t[t.length-1];return M(e)?(t.pop(),z(t,e)):K(t)}function xd(t,e,n,i){return a(n)&&(i=n,n=void 0),i?xd(t,e,n).pipe(D(t=>d(t)?i(...t):i(t))):new C(i=>{Sd(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Sd(t,e,n,i,r){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const i=t;t.addEventListener(e,n,r),s=()=>i.removeEventListener(e,n,r)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const i=t;t.on(e,n),s=()=>i.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const i=t;t.addListener(e,n),s=()=>i.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let s=0,o=t.length;s{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class Td extends Od{constructor(t,e=Od.now){super(t,()=>Td.delegate&&Td.delegate!==this?Td.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return Td.delegate&&Td.delegate!==this?Td.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}new class extends Td{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,i=-1,r=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++i0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame(()=>t.flush(null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(cancelAnimationFrame(e),t.scheduled=void 0)}});let kd=1;const Ad=Promise.resolve(),Pd={};function Id(t){return t in Pd&&(delete Pd[t],!0)}const Md={setImmediate(t){const e=kd++;return Pd[e]=!0,Ad.then(()=>Id(e)&&t()),e},clearImmediate(t){Id(t)}};new class extends Td{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,i=-1,r=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++i0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=Md.setImmediate(t.flush.bind(t,null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(Md.clearImmediate(e),t.scheduled=void 0)}});function Dd(t){return!!t&&(t instanceof C||"function"==typeof t.lift&&"function"==typeof t.subscribe)}function Rd(t,e){return n=>n.lift(new Nd(t,e))}class Nd{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new Ld(t,this.compare,this.keySelector))}}class Ld extends v{constructor(t,e,n){super(t),this.keySelector=n,this.hasKey=!1,"function"==typeof e&&(this.compare=e)}compare(t,e){return t===e}_next(t){let e;try{const{keySelector:n}=this;e=n?n(t):t}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:t}=this;n=t(this.key,e)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))}}const jd=new Td(Cd);class Fd{constructor(t){this.durationSelector=t}call(t,e){return e.subscribe(new Bd(t,this.durationSelector))}}class Bd extends ${constructor(t,e){super(t),this.durationSelector=e,this.hasValue=!1}_next(t){if(this.value=t,this.hasValue=!0,!this.throttled){let n;try{const{durationSelector:e}=this;n=e(t)}catch(e){return this.destination.error(e)}const i=G(n,new H(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:t,hasValue:e,throttled:n}=this;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),e&&(this.value=void 0,this.hasValue=!1,this.destination.next(t))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function Vd(t){return!d(t)&&t-parseFloat(t)+1>=0}function zd(t){const{index:e,period:n,subscriber:i}=t;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}}function Ud(t,e=jd){return function(t){return function(e){return e.lift(new Fd(t))}}(()=>function(t=0,e,n){let i=-1;return Vd(e)?i=Number(e)<1?1:Number(e):M(e)&&(n=e),M(n)||(n=jd),new C(e=>{const r=Vd(t)?t:+t-n.now();return n.schedule(zd,r,{index:0,period:i,subscriber:e})})}(t,e))}function Hd(t,e){return function(n){return n.lift(new $d(t,e))}}class $d{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new Gd(t,this.predicate,this.thisArg))}}class Gd extends v{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}function Wd(t){return e=>e.lift(new qd(t))}class qd{constructor(t){this.notifier=t}call(t,e){const n=new Xd(t),i=G(this.notifier,new H(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class Xd extends ${constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Yd(...t){return Y(1)(wd(...t))}function Kd(...t){const e=t[t.length-1];return M(e)?(t.pop(),n=>Yd(t,n,e)):e=>Yd(t,e)}function Qd(t,e){return"function"==typeof e?n=>n.pipe(Qd((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new Zd(t))}class Zd{constructor(t){this.project=t}call(t,e){return e.subscribe(new Jd(t,this.project))}}class Jd extends ${constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e)}_innerSub(t){const e=this.innerSubscription;e&&e.unsubscribe();const n=new H(this),i=this.destination;i.add(n),this.innerSubscription=G(t,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:t}=this;(!t||t.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(t){this.destination.next(t)}}const tp=new class extends Td{}(class extends Cd{constructor(t,e){super(t,e),this.scheduler=t,this.work=e}schedule(t,e=0){return e>0?super.schedule(t,e):(this.delay=e,this.state=t,this.scheduler.flush(this),this)}execute(t,e){return e>0||this.closed?super.execute(t,e):this._execute(t,e)}requestAsyncId(t,e,n=0){return null!==n&&n>0||null===n&&this.delay>0?super.requestAsyncId(t,e,n):t.flush(this)}}),ep=new C(t=>t.complete());function np(t){return t?function(t){return new C(e=>t.schedule(()=>e.complete()))}(t):ep}function ip(t,e){return new C(e?n=>e.schedule(rp,0,{error:t,subscriber:n}):e=>e.error(t))}function rp({error:t,subscriber:e}){e.error(t)}class sp{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return wd(this.value);case"E":return ip(this.error);case"C":return np()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new sp("N",t):sp.undefinedValueNotification}static createError(t){return new sp("E",void 0,t)}static createComplete(){return sp.completeNotification}}sp.completeNotification=new sp("C"),sp.undefinedValueNotification=new sp("N",void 0);class op extends v{constructor(t,e,n=0){super(t),this.scheduler=e,this.delay=n}static dispatch(t){const{notification:e,destination:n}=t;e.observe(n),this.unsubscribe()}scheduleMessage(t){this.destination.add(this.scheduler.schedule(op.dispatch,this.delay,new ap(t,this.destination)))}_next(t){this.scheduleMessage(sp.createNext(t))}_error(t){this.scheduleMessage(sp.createError(t)),this.unsubscribe()}_complete(){this.scheduleMessage(sp.createComplete()),this.unsubscribe()}}class ap{constructor(t,e){this.notification=t,this.destination=e}}class lp extends P{constructor(t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n){super(),this.scheduler=n,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=t<1?1:t,this._windowTime=e<1?1:e,e===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(t){if(!this.isStopped){const e=this._events;e.push(t),e.length>this._bufferSize&&e.shift()}super.next(t)}nextTimeWindow(t){this.isStopped||(this._events.push(new cp(this._getNow(),t)),this._trimBufferThenGetEvents()),super.next(t)}_subscribe(t){const e=this._infiniteTimeWindow,n=e?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,r=n.length;let s;if(this.closed)throw new T;if(this.isStopped||this.hasError?s=g.EMPTY:(this.observers.push(t),s=new k(this,t)),i&&t.add(t=new op(t,i)),e)for(let o=0;oe&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i}}class cp{constructor(t,e){this.time=t,this.value=e}}function up(t,e,n){let i;return i=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},t=>t.lift(function({bufferSize:t=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:n,scheduler:i}){let r,s,o=0,a=!1,l=!1;return function(c){let u;o++,!r||a?(a=!1,r=new lp(t,e,i),u=r.subscribe(this),s=c.subscribe({next(t){r.next(t)},error(t){a=!0,r.error(t)},complete(){l=!0,s=void 0,r.complete()}}),l&&(s=void 0)):u=r.subscribe(this),this.add(()=>{o--,u.unsubscribe(),u=void 0,s&&!l&&n&&0===o&&(s.unsubscribe(),s=void 0,r=void 0)})}}(i))}let hp;try{hp="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(m){hp=!1}let dp,pp=(()=>{class t{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Lh(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!hp)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return t.\u0275fac=function(e){return new(e||t)(Ci(ou))},t.\u0275prov=xt({factory:function(){return new t(Ci(ou))},token:t,providedIn:"root"}),t})(),fp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const gp=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function mp(){if(dp)return dp;if("object"!=typeof document||!document)return dp=new Set(gp),dp;let t=document.createElement("input");return dp=new Set(gp.filter(e=>(t.setAttribute("type",e),t.type===e))),dp}let bp,yp,vp;function _p(t){return function(){if(null==bp&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>bp=!0}))}finally{bp=bp||!1}return bp}()?t:!!t.capture}function wp(){if(null==yp){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return yp=!1,yp;if("scrollBehavior"in document.documentElement.style)yp=!0;else{const t=Element.prototype.scrollTo;yp=!!t&&!/\{\s*\[native code\]\s*\}/.test(t.toString())}}return yp}function xp(t){if(function(){if(null==vp){const t="undefined"!=typeof document?document.head:null;vp=!(!t||!t.createShadowRoot&&!t.attachShadow)}return vp}()){const e=t.getRootNode?t.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}function Sp(){let t="undefined"!=typeof document&&document?document.activeElement:null;for(;t&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}function Ep(t){return t.composedPath?t.composedPath()[0]:t.target}const Cp=new oi("cdk-dir-doc",{providedIn:"root",factory:function(){return Oi(Yu)}});let Op=(()=>{class t{constructor(t){if(this.value="ltr",this.change=new Rc,t){const e=t.documentElement?t.documentElement.dir:null,n=(t.body?t.body.dir:null)||e;this.value="ltr"===n||"rtl"===n?n:"ltr"}}ngOnDestroy(){this.change.complete()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Cp,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(Cp,8))},token:t,providedIn:"root"}),t})(),Tp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class kp{constructor(t=!1,e,n=!0){this._multiple=t,this._emitChanges=n,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new P,e&&e.length&&(t?e.forEach(t=>this._markSelected(t)):this._markSelected(e[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...t){this._verifyValueAssignment(t),t.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...t){this._verifyValueAssignment(t),t.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(t){this.isSelected(t)?this.deselect(t):this.select(t)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(t){return this._selection.has(t)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){this.isSelected(t)||(this._multiple||this._unmarkAll(),this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){}}let Ap=(()=>{class t{constructor(){this._listeners=[]}notify(t,e){for(let n of this._listeners)n(t,e)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(e=>t!==e)}}ngOnDestroy(){this._listeners=[]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),Pp=(()=>{class t{constructor(t,e,n){this._ngZone=t,this._platform=e,this._scrolled=new P,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=n}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const e=this.scrollContainers.get(t);e&&(e.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new C(e=>{this._globalSubscription||this._addGlobalListener();const n=t>0?this._scrolled.pipe(Ud(t)).subscribe(e):this._scrolled.subscribe(e);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):wd()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,e)=>this.deregister(e)),this._scrolled.complete()}ancestorScrolled(t,e){const n=this.getAncestorScrollContainers(t);return this.scrolled(e).pipe(Hd(t=>!t||n.indexOf(t)>-1))}getAncestorScrollContainers(t){const e=[];return this.scrollContainers.forEach((n,i)=>{this._scrollableContainsElement(i,t)&&e.push(i)}),e}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,e){let n=_d(e),i=t.getElementRef().nativeElement;do{if(n==i)return!0}while(n=n.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>xd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(pp),Ci(Yu,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(xu),Ci(pp),Ci(Yu,8))},token:t,providedIn:"root"}),t})(),Ip=(()=>{class t{constructor(t,e,n){this._platform=t,this._change=new P,this._changeListener=t=>{this._change.next(t)},this._document=n,e.runOutsideAngular(()=>{if(t.isBrowser){const t=this._getWindow();t.addEventListener("resize",this._changeListener),t.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){const t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:e,height:n}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+n,right:t.left+e,height:n,width:e}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,e=this._getWindow(),n=t.documentElement,i=n.getBoundingClientRect();return{top:-i.top||t.body.scrollTop||e.scrollY||n.scrollTop||0,left:-i.left||t.body.scrollLeft||e.scrollX||n.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(Ud(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu),Ci(Yu,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu),Ci(Yu,8))},token:t,providedIn:"root"}),t})(),Mp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),Dp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Tp,fp,Mp],Tp,Mp]}),t})();class Rp{attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;null!=t&&(this._attachedHost=null,t.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class Np extends Rp{constructor(t,e,n,i){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.componentFactoryResolver=i}}class Lp extends Rp{constructor(t,e,n){super(),this.templateRef=t,this.viewContainerRef=e,this.context=n}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}}class jp extends Rp{constructor(t){super(),this.element=t instanceof kl?t.nativeElement:t}}class Fp{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){return t instanceof Np?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof Lp?(this._attachedPortal=t,this.attachTemplatePortal(t)):this.attachDomPortal&&t instanceof jp?(this._attachedPortal=t,this.attachDomPortal(t)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class Bp extends Fp{constructor(t,e,n,i,r){super(),this.outletElement=t,this._componentFactoryResolver=e,this._appRef=n,this._defaultInjector=i,this.attachDomPortal=t=>{const e=t.element,n=this._document.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=r}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let n;return t.viewContainerRef?(n=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector),this.setDisposeFn(()=>n.destroy())):(n=e.create(t.injector||this._defaultInjector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(n)),this._attachedPortal=t,n}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context);return n.rootNodes.forEach(t=>this.outletElement.appendChild(t)),n.detectChanges(),this.setDisposeFn(()=>{let t=e.indexOf(n);-1!==t&&e.remove(t)}),this._attachedPortal=t,n}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let Vp=(()=>{class t extends Lp{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(ea(sc),ea(hc))},t.\u0275dir=se({type:t,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[jo]}),t})(),zp=(()=>{class t extends Vp{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","cdk-portal",""],["","portal",""]],exportAs:["cdkPortal"],features:[_l([{provide:Vp,useExisting:t}]),jo]}),t})(),Up=(()=>{class t extends Fp{constructor(t,e,n){super(),this._componentFactoryResolver=t,this._viewContainerRef=e,this._isInitialized=!1,this.attached=new Rc,this.attachDomPortal=t=>{const e=t.element,n=this._document.createComment("dom-portal");t.setAttachedHost(this),e.parentNode.insertBefore(n,e),this._getRootNode().appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=n}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedPortal=null,this._attachedRef=null}attachComponentPortal(t){t.setAttachedHost(this);const e=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,n=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),i=e.createComponent(n,e.length,t.injector||e.injector);return e!==this._viewContainerRef&&this._getRootNode().appendChild(i.hostView.rootNodes[0]),super.setDisposeFn(()=>i.destroy()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}attachTemplatePortal(t){t.setAttachedHost(this);const e=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=e,this.attached.emit(e),e}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return t.\u0275fac=function(e){return new(e||t)(ea(El),ea(hc),ea(Yu))},t.\u0275dir=se({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[jo]}),t})(),Hp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const $p=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})();function Gp(t){return e=>0===t?np():e.lift(new Wp(t))}class Wp{constructor(t){if(this.total=t,this.total<0)throw new $p}call(t,e){return e.subscribe(new qp(t,this.total))}}class qp extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}function Xp(t,e=!1){return n=>n.lift(new Yp(t,e))}class Yp{constructor(t,e){this.predicate=t,this.inclusive=e}call(t,e){return e.subscribe(new Kp(t,this.predicate,this.inclusive))}}class Kp extends v{constructor(t,e,n){super(t),this.predicate=e,this.inclusive=n,this.index=0}_next(t){const e=this.destination;let n;try{n=this.predicate(t,this.index++)}catch(i){return void e.error(i)}this.nextOrComplete(t,n)}nextOrComplete(t,e){const n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())}}function Qp(t,...e){return e.length?e.some(e=>t[e]):t.altKey||t.shiftKey||t.ctrlKey||t.metaKey}const Zp=wp();class Jp{constructor(t,e){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=e}attach(){}enable(){if(this._canBeEnabled()){const t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=vd(-this._previousScrollPosition.left),t.style.top=vd(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const t=this._document.documentElement,e=t.style,n=this._document.body.style,i=e.scrollBehavior||"",r=n.scrollBehavior||"";this._isEnabled=!1,e.left=this._previousHTMLStyles.left,e.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Zp&&(e.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Zp&&(e.scrollBehavior=i,n.scrollBehavior=r)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,e=this._viewportRuler.getViewportSize();return t.scrollHeight>e.height||t.scrollWidth>e.width}}class tf{constructor(t,e,n,i){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=n,this._config=i,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(t){this._overlayRef=t}enable(){if(this._scrollSubscription)return;const t=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class ef{enable(){}disable(){}attach(){}}function nf(t,e){return e.some(e=>t.bottome.bottom||t.righte.right)}function rf(t,e){return e.some(e=>t.tope.bottom||t.lefte.right)}class sf{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this._config=i,this._scrollSubscription=null}attach(t){this._overlayRef=t}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:e,height:n}=this._viewportRuler.getViewportSize();nf(t,[{width:e,height:n,bottom:n,right:e,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let of=(()=>{class t{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this.noop=()=>new ef,this.close=t=>new tf(this._scrollDispatcher,this._ngZone,this._viewportRuler,t),this.block=()=>new Jp(this._viewportRuler,this._document),this.reposition=t=>new sf(this._scrollDispatcher,this._viewportRuler,this._ngZone,t),this._document=i}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pp),Ci(Ip),Ci(xu),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Pp),Ci(Ip),Ci(xu),Ci(Yu))},token:t,providedIn:"root"}),t})();class af{constructor(t){if(this.scrollStrategy=new ef,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){const e=Object.keys(t);for(const n of e)void 0!==t[n]&&(this[n]=t[n])}}}class lf{constructor(t,e,n,i,r){this.offsetX=n,this.offsetY=i,this.panelClass=r,this.originX=t.originX,this.originY=t.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY}}class cf{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}}let uf=(()=>{class t{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),0===this._attachedOverlays.length&&this.detach()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})(),hf=(()=>{class t extends uf{constructor(t){super(t),this._keydownListener=t=>{const e=this._attachedOverlays;for(let n=e.length-1;n>-1;n--)if(e[n]._keydownEvents.observers.length>0){e[n]._keydownEvents.next(t);break}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})(),df=(()=>{class t extends uf{constructor(t,e){super(t),this._platform=e,this._cursorStyleIsSet=!1,this._clickListener=t=>{const e=Ep(t),n=this._attachedOverlays.slice();for(let i=n.length-1;i>-1;i--){const r=n[i];if(!(r._outsidePointerEvents.observers.length<1)&&r.hasAttached()){if(r.overlayElement.contains(e))break;r._outsidePointerEvents.next(t)}}}}add(t){if(super.add(t),!this._isAttached){const t=this._document.body;t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=t.style.cursor,t.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu),Ci(pp))},token:t,providedIn:"root"}),t})();const pf="undefined"!=typeof window?window:{},ff=void 0!==pf.__karma__&&!!pf.__karma__||void 0!==pf.jasmine&&!!pf.jasmine||void 0!==pf.jest&&!!pf.jest||void 0!==pf.Mocha&&!!pf.Mocha;let gf=(()=>{class t{constructor(t,e){this._platform=e,this._document=t}ngOnDestroy(){const t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||ff){const e=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let t=0;tthis._backdropClick.next(t),this._keydownEvents=new P,this._outsidePointerEvents=new P,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(t){let e=this._portalOutlet.attach(t);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(Gp(1)).subscribe(()=>{this.hasAttached()&&this.updatePosition()}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){const t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,t&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=Object.assign(Object.assign({},this._config),t),this._updateElementSize()}setDirection(t){this._config=Object.assign(Object.assign({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){const t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const t=this._pane.style;t.width=vd(this._config.width),t.height=vd(this._config.height),t.minWidth=vd(this._config.minWidth),t.minHeight=vd(this._config.minHeight),t.maxWidth=vd(this._config.maxWidth),t.maxHeight=vd(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){const t="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(t)})}):this._backdropElement.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let t=this._backdropElement;if(!t)return;let e,n=()=>{t&&(t.removeEventListener("click",this._backdropClickHandler),t.removeEventListener("transitionend",n),t.parentNode&&t.parentNode.removeChild(t)),this._backdropElement==t&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(t,this._config.backdropClass,!1),clearTimeout(e)};t.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{t.addEventListener("transitionend",n)}),t.style.pointerEvents="none",e=this._ngZone.runOutsideAngular(()=>setTimeout(n,500))}_toggleClasses(t,e,n){const i=t.classList;yd(e).forEach(t=>{t&&(n?i.add(t):i.remove(t))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const t=this._ngZone.onStable.pipe(Wd(Q(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._previousHostParent.removeChild(this._host)),t.unsubscribe())})})}_disposeScrollStrategy(){const t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())}}const bf="cdk-overlay-connected-position-bounding-box",yf=/([A-Za-z%]+)$/;class vf{constructor(t,e,n,i,r){this._viewportRuler=e,this._document=n,this._platform=i,this._overlayContainer=r,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new P,this._resizeSubscription=g.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}get positions(){return this._preferredPositions}attach(t){this._validatePositions(),t.hostElement.classList.add(bf),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();const t=this._originRect,e=this._overlayRect,n=this._viewportRect,i=[];let r;for(let s of this._preferredPositions){let o=this._getOriginPoint(t,s),a=this._getOverlayPoint(o,e,s),l=this._getOverlayFit(a,e,n,s);if(l.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(s,o);this._canFitWithFlexibleDimensions(l,a,n)?i.push({position:s,origin:o,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(o,s)}):(!r||r.overlayFit.visibleAreae&&(e=i,t=n)}return this._isPushed=!1,void this._applyPosition(t.position,t.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(r.position,r.originPoint);this._applyPosition(r.position,r.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&_f(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(bf),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();const t=this._lastPosition||this._preferredPositions[0],e=this._getOriginPoint(this._originRect,t);this._applyPosition(t,e)}}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e){let n,i;if("center"==e.originX)n=t.left+t.width/2;else{const i=this._isRtl()?t.right:t.left,r=this._isRtl()?t.left:t.right;n="start"==e.originX?i:r}return i="center"==e.originY?t.top+t.height/2:"top"==e.originY?t.top:t.bottom,{x:n,y:i}}_getOverlayPoint(t,e,n){let i,r;return i="center"==n.overlayX?-e.width/2:"start"===n.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,r="center"==n.overlayY?-e.height/2:"top"==n.overlayY?0:-e.height,{x:t.x+i,y:t.y+r}}_getOverlayFit(t,e,n,i){const r=xf(e);let{x:s,y:o}=t,a=this._getOffset(i,"x"),l=this._getOffset(i,"y");a&&(s+=a),l&&(o+=l);let c=0-o,u=o+r.height-n.height,h=this._subtractOverflows(r.width,0-s,s+r.width-n.width),d=this._subtractOverflows(r.height,c,u),p=h*d;return{visibleArea:p,isCompletelyWithinViewport:r.width*r.height===p,fitsInViewportVertically:d===r.height,fitsInViewportHorizontally:h==r.width}}_canFitWithFlexibleDimensions(t,e,n){if(this._hasFlexibleDimensions){const i=n.bottom-e.y,r=n.right-e.x,s=wf(this._overlayRef.getConfig().minHeight),o=wf(this._overlayRef.getConfig().minWidth),a=t.fitsInViewportHorizontally||null!=o&&o<=r;return(t.fitsInViewportVertically||null!=s&&s<=i)&&a}return!1}_pushOverlayOnScreen(t,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};const i=xf(e),r=this._viewportRect,s=Math.max(t.x+i.width-r.width,0),o=Math.max(t.y+i.height-r.height,0),a=Math.max(r.top-n.top-t.y,0),l=Math.max(r.left-n.left-t.x,0);let c=0,u=0;return c=i.width<=r.width?l||-s:t.xi&&!this._isInitialRender&&!this._growAfterOpen&&(s=t.y-i/2)}if("end"===e.overlayX&&!i||"start"===e.overlayX&&i)c=n.width-t.x+this._viewportMargin,a=t.x-this._viewportMargin;else if("start"===e.overlayX&&!i||"end"===e.overlayX&&i)l=t.x,a=n.right-t.x;else{const e=Math.min(n.right-t.x+n.left,t.x),i=this._lastBoundingBoxSize.width;a=2*e,l=t.x-e,a>i&&!this._isInitialRender&&!this._growAfterOpen&&(l=t.x-i/2)}return{top:s,left:l,bottom:o,right:c,width:a,height:r}}_setBoundingBoxStyles(t,e){const n=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));const i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{const t=this._overlayRef.getConfig().maxHeight,r=this._overlayRef.getConfig().maxWidth;i.height=vd(n.height),i.top=vd(n.top),i.bottom=vd(n.bottom),i.width=vd(n.width),i.left=vd(n.left),i.right=vd(n.right),i.alignItems="center"===e.overlayX?"center":"end"===e.overlayX?"flex-end":"flex-start",i.justifyContent="center"===e.overlayY?"center":"bottom"===e.overlayY?"flex-end":"flex-start",t&&(i.maxHeight=vd(t)),r&&(i.maxWidth=vd(r))}this._lastBoundingBoxSize=n,_f(this._boundingBox.style,i)}_resetBoundingBoxStyles(){_f(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){_f(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){const n={},i=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(i){const i=this._viewportRuler.getViewportScrollPosition();_f(n,this._getExactOverlayY(e,t,i)),_f(n,this._getExactOverlayX(e,t,i))}else n.position="static";let o="",a=this._getOffset(e,"x"),l=this._getOffset(e,"y");a&&(o+=`translateX(${a}px) `),l&&(o+=`translateY(${l}px)`),n.transform=o.trim(),s.maxHeight&&(i?n.maxHeight=vd(s.maxHeight):r&&(n.maxHeight="")),s.maxWidth&&(i?n.maxWidth=vd(s.maxWidth):r&&(n.maxWidth="")),_f(this._pane.style,n)}_getExactOverlayY(t,e,n){let i={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n));let s=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return r.y-=s,"bottom"===t.overlayY?i.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":i.top=vd(r.y),i}_getExactOverlayX(t,e,n){let i,r={left:"",right:""},s=this._getOverlayPoint(e,this._overlayRect,t);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,n)),i=this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left","right"===i?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=vd(s.x),r}_getScrollVisibility(){const t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(t=>t.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:rf(t,n),isOriginOutsideView:nf(t,n),isOverlayClipped:rf(e,n),isOverlayOutsideView:nf(e,n)}}_subtractOverflows(t,...e){return e.reduce((t,e)=>t-Math.max(e,0),t)}_getNarrowedViewportRect(){const t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+t-this._viewportMargin,bottom:n.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return"x"===e?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&yd(t).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){const t=this._origin;if(t instanceof kl)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();const e=t.width||0,n=t.height||0;return{top:t.y,bottom:t.y+n,left:t.x,right:t.x+e,height:n,width:e}}}function _f(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function wf(t){if("number"!=typeof t&&null!=t){const[e,n]=t.split(yf);return n&&"px"!==n?null:parseFloat(e)}return t||null}function xf(t){return{top:Math.floor(t.top),right:Math.floor(t.right),bottom:Math.floor(t.bottom),left:Math.floor(t.left),width:Math.floor(t.width),height:Math.floor(t.height)}}class Sf{constructor(t,e,n,i,r,s,o){this._preferredPositions=[],this._positionStrategy=new vf(n,i,r,s,o).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(t,e),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(t){this._overlayRef=t,this._positionStrategy.attach(t),this._direction&&(t.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(t){this._positionStrategy.withScrollableContainers(t)}withFallbackPosition(t,e,n,i){const r=new lf(t,e,n,i);return this._preferredPositions.push(r),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(t){return this._overlayRef?this._overlayRef.setDirection(t):this._direction=t,this}withOffsetX(t){return this._positionStrategy.withDefaultOffsetX(t),this}withOffsetY(t){return this._positionStrategy.withDefaultOffsetY(t),this}withLockedPosition(t){return this._positionStrategy.withLockedPosition(t),this}withPositions(t){return this._preferredPositions=t.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(t){return this._positionStrategy.setOrigin(t),this}}const Ef="cdk-global-overlay-wrapper";class Cf{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(t){const e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(Ef),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._rightOffset="",this._leftOffset=t,this._justifyContent="flex-start",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._leftOffset="",this._rightOffset=t,this._justifyContent="flex-end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._justifyContent="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:i,height:r,maxWidth:s,maxHeight:o}=n,a=!("100%"!==i&&"100vw"!==i||s&&"100%"!==s&&"100vw"!==s),l=!("100%"!==r&&"100vh"!==r||o&&"100%"!==o&&"100vh"!==o);t.position=this._cssPosition,t.marginLeft=a?"0":this._leftOffset,t.marginTop=l?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=this._rightOffset,a?e.justifyContent="flex-start":"center"===this._justifyContent?e.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?e.justifyContent="flex-end":"flex-end"===this._justifyContent&&(e.justifyContent="flex-start"):e.justifyContent=this._justifyContent,e.alignItems=l?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(Ef),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}}let Of=(()=>{class t{constructor(t,e,n,i){this._viewportRuler=t,this._document=e,this._platform=n,this._overlayContainer=i}global(){return new Cf}connectedTo(t,e,n){return new Sf(e,n,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new vf(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ip),Ci(Yu),Ci(pp),Ci(gf))},t.\u0275prov=xt({factory:function(){return new t(Ci(Ip),Ci(Yu),Ci(pp),Ci(gf))},token:t,providedIn:"root"}),t})(),Tf=0,kf=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u){this.scrollStrategies=t,this._overlayContainer=e,this._componentFactoryResolver=n,this._positionBuilder=i,this._keyboardDispatcher=r,this._injector=s,this._ngZone=o,this._document=a,this._directionality=l,this._location=c,this._outsideClickDispatcher=u}create(t){const e=this._createHostElement(),n=this._createPaneElement(e),i=this._createPortalOutlet(n),r=new af(t);return r.direction=r.direction||this._directionality.value,new mf(i,e,n,r,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const e=this._document.createElement("div");return e.id="cdk-overlay-"+Tf++,e.classList.add("cdk-overlay-pane"),t.appendChild(e),e}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Uu)),new Bp(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return t.\u0275fac=function(e){return new(e||t)(Ci(of),Ci(gf),Ci(El),Ci(Of),Ci(hf),Ci(No),Ci(xu),Ci(Yu),Ci(Op),Ci(lh),Ci(df))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Af=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],Pf=new oi("cdk-connected-overlay-scroll-strategy");let If=(()=>{class t{constructor(t){this.elementRef=t}}return t.\u0275fac=function(e){return new(e||t)(ea(kl))},t.\u0275dir=se({type:t,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),t})(),Mf=(()=>{class t{constructor(t,e,n,i,r){this._overlay=t,this._dir=r,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=g.EMPTY,this._attachSubscription=g.EMPTY,this._detachSubscription=g.EMPTY,this._positionSubscription=g.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Rc,this.positionChange=new Rc,this.attach=new Rc,this.detach=new Rc,this.overlayKeydown=new Rc,this.overlayOutsideClick=new Rc,this._templatePortal=new Lp(e,n),this._scrollStrategyFactory=i,this.scrollStrategy=this._scrollStrategyFactory()}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}get hasBackdrop(){return this._hasBackdrop}set hasBackdrop(t){this._hasBackdrop=md(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=md(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=md(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=md(t)}get push(){return this._push}set push(t){this._push=md(t)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Af);const t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(t=>{this.overlayKeydown.next(t),27===t.keyCode&&!this.disableClose&&!Qp(t)&&(t.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(t=>{this.overlayOutsideClick.next(t)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),e=new af({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(e.width=this.width),(this.height||0===this.height)&&(e.height=this.height),(this.minWidth||0===this.minWidth)&&(e.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(e.minHeight=this.minHeight),this.backdropClass&&(e.backdropClass=this.backdropClass),this.panelClass&&(e.panelClass=this.panelClass),e}_updatePositionStrategy(t){const e=this.positions.map(t=>({originX:t.originX,originY:t.originY,overlayX:t.overlayX,overlayY:t.overlayY,offsetX:t.offsetX||this.offsetX,offsetY:t.offsetY||this.offsetY,panelClass:t.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(e).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const t=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(t),t}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(Xp(()=>this.positionChange.observers.length>0)).subscribe(t=>{this.positionChange.emit(t),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()}))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(sc),ea(hc),ea(Pf),ea(Op,8))},t.\u0275dir=se({type:t,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[ye]}),t})();const Df={provide:Pf,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};let Rf=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[kf,Df],imports:[[Tp,Hp,Dp],Dp]}),t})(),Nf=(()=>{class t extends gf{constructor(){super(...arguments),this.attached=!1}setRootElement(t){this.attached&&(this.rootElement.nativeElement.removeChild(this._containerElement),this.attached=!1),this.rootElement=t,this.rootElement.nativeElement.style.display="block",this.rootElement.nativeElement.style.position="contents",this.rootElement.nativeElement.style.height="100%",this.appendToRoot()}_createContainer(){super._createContainer(),this.appendToRoot()}appendToRoot(){!this._containerElement||!this.rootElement||(this.rootElement.nativeElement.appendChild(this._containerElement),this.attached=!0)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const Lf={schedule(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)},scheduleBeforeRender(t){if("undefined"==typeof window)return Lf.schedule(t,0);if(void 0===window.requestAnimationFrame)return Lf.schedule(t,16);const e=window.requestAnimationFrame(t);return()=>window.cancelAnimationFrame(e)}};let jf;function Ff(t,e,n){let i=n;return function(t){return!!t&&t.nodeType===Node.ELEMENT_NODE}(t)&&e.some((e,n)=>!("*"===e||!function(t,e){if(!jf){const t=Element.prototype;jf=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE&&jf.call(t,e)}(t,e)||(i=n,0))),i}class Bf{constructor(t,e){this.componentFactory=e.get(El).resolveComponentFactory(t)}create(t){return new Vf(this.componentFactory,t)}}class Vf{constructor(t,e){this.componentFactory=t,this.injector=e,this.eventEmitters=new lp(1),this.events=this.eventEmitters.pipe(Qd(t=>Q(...t))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:t})=>t)),this.ngZone=this.injector.get(xu),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(t){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(t)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=Lf.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(t){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(t):this.componentRef.instance[t])}setInputValue(t,e){this.runInZone(()=>{null!==this.componentRef?function(t,e){return t===e||t!=t&&e!=e}(e,this.getInputValue(t))&&(void 0!==e||!this.unchangedInputs.has(t))||(this.recordInputChange(t,e),this.unchangedInputs.delete(t),this.hasInputChanges=!0,this.componentRef.instance[t]=e,this.scheduleDetectChanges()):this.initialInputValues.set(t,e)})}initializeComponent(t){const e=No.create({providers:[],parent:this.injector}),n=function(t,e){const n=t.childNodes,i=e.map(()=>[]);let r=-1;e.some((t,e)=>"*"===t&&(r=e,!0));for(let s=0,o=n.length;s{this.initialInputValues.has(t)&&this.setInputValue(t,this.initialInputValues.get(t))}),this.initialInputValues.clear()}initializeOutputs(t){const e=this.componentFactory.outputs.map(({propName:e,templateName:n})=>t.instance[e].pipe(D(t=>({name:n,value:t}))));this.eventEmitters.next(e)}callNgOnChanges(t){if(!this.implementsOnChanges||null===this.inputChanges)return;const e=this.inputChanges;this.inputChanges=null,t.instance.ngOnChanges(e)}markViewForCheck(t){this.hasInputChanges&&(this.hasInputChanges=!1,t.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=Lf.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(t,e){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const n=this.inputChanges[t];if(n)return void(n.currentValue=e);const i=this.unchangedInputs.has(t),r=i?void 0:this.getInputValue(t);this.inputChanges[t]=new be(r,e,i)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(t){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(t):t()}}class zf extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}class Uf extends P{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new T;return this._value}next(t){super.next(this._value=t)}}function Hf(){}function $f(t,e,n){return function(i){return i.lift(new Gf(t,e,n))}}class Gf{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new Wf(t,this.nextOrObserver,this.error,this.complete))}}class Wf extends v{constructor(t,e,n,i){super(t),this._tapNext=Hf,this._tapError=Hf,this._tapComplete=Hf,this._tapError=n||Hf,this._tapComplete=i||Hf,a(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||Hf,this._tapError=e.error||Hf,this._tapComplete=e.complete||Hf)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}function qf(t,e=jd){return n=>n.lift(new Xf(t,e))}class Xf{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new Yf(t,this.dueTime,this.scheduler))}}class Yf extends v{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Kf,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Kf(t){t.debouncedNext()}function Qf(t){return e=>e.lift(new Zf(t))}class Zf{constructor(t){this.total=t}call(t,e){return e.subscribe(new Jf(t,this.total))}}class Jf extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){++this.count>this.total&&this.destination.next(t)}}let tg=(()=>{class t{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),eg=(()=>{class t{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,e)=>this._cleanupObserver(e))}observe(t){const e=_d(t);return new C(t=>{const n=this._observeElement(e).subscribe(t);return()=>{n.unsubscribe(),this._unobserveElement(e)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const e=new P,n=this._mutationObserverFactory.create(t=>e.next(t));n&&n.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:n,stream:e,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:e,stream:n}=this._observedElements.get(t);e&&e.disconnect(),n.complete(),this._observedElements.delete(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(tg))},t.\u0275prov=xt({factory:function(){return new t(Ci(tg))},token:t,providedIn:"root"}),t})(),ng=(()=>{class t{constructor(t,e,n){this._contentObserver=t,this._elementRef=e,this._ngZone=n,this.event=new Rc,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=bd(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe(qf(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(eg),ea(kl),ea(xu))},t.\u0275dir=se({type:t,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),t})(),ig=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[tg]}),t})();function rg(t,e){return(t.getAttribute(e)||"").match(/\S+/g)||[]}const sg="cdk-describedby-message-container",og="cdk-describedby-message",ag="cdk-describedby-host";let lg=0;const cg=new Map;let ug=null,hg=(()=>{class t{constructor(t){this._document=t}describe(t,e,n){if(!this._canBeDescribed(t,e))return;const i=dg(e,n);"string"!=typeof e?(pg(e),cg.set(i,{messageElement:e,referenceCount:0})):cg.has(i)||this._createMessageElement(e,n),this._isElementDescribedByMessage(t,i)||this._addMessageReference(t,i)}removeDescription(t,e,n){if(!e||!this._isElementNode(t))return;const i=dg(e,n);if(this._isElementDescribedByMessage(t,i)&&this._removeMessageReference(t,i),"string"==typeof e){const t=cg.get(i);t&&0===t.referenceCount&&this._deleteMessageElement(i)}ug&&0===ug.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${ag}]`);for(let e=0;e0!=t.indexOf(og));t.setAttribute("aria-describedby",e.join(" "))}_addMessageReference(t,e){const n=cg.get(e);(function(t,e,n){const i=rg(t,e);i.some(t=>t.trim()==n.trim())||(i.push(n.trim()),t.setAttribute(e,i.join(" ")))})(t,"aria-describedby",n.messageElement.id),t.setAttribute(ag,""),n.referenceCount++}_removeMessageReference(t,e){const n=cg.get(e);n.referenceCount--,function(t,e,n){const i=rg(t,e).filter(t=>t!=n.trim());i.length?t.setAttribute(e,i.join(" ")):t.removeAttribute(e)}(t,"aria-describedby",n.messageElement.id),t.removeAttribute(ag)}_isElementDescribedByMessage(t,e){const n=rg(t,"aria-describedby"),i=cg.get(e),r=i&&i.messageElement.id;return!!r&&-1!=n.indexOf(r)}_canBeDescribed(t,e){if(!this._isElementNode(t))return!1;if(e&&"object"==typeof e)return!0;const n=null==e?"":`${e}`.trim(),i=t.getAttribute("aria-label");return!(!n||i&&i.trim()===n)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})();function dg(t,e){return"string"==typeof t?`${e||""}/${t}`:t}function pg(t){t.id||(t.id=`${og}-${lg++}`)}class fg extends class{constructor(t){this._items=t,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new P,this._typeaheadSubscription=g.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new P,this.change=new P,t instanceof Lc&&t.changes.subscribe(t=>{if(this._activeItem){const e=t.toArray().indexOf(this._activeItem);e>-1&&e!==this._activeItemIndex&&(this._activeItemIndex=e)}})}skipPredicate(t){return this._skipPredicateFn=t,this}withWrap(t=!0){return this._wrap=t,this}withVerticalOrientation(t=!0){return this._vertical=t,this}withHorizontalOrientation(t){return this._horizontal=t,this}withAllowedModifierKeys(t){return this._allowedModifierKeys=t,this}withTypeAhead(t=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe($f(t=>this._pressedLetters.push(t)),qf(t),Hd(()=>this._pressedLetters.length>0),D(()=>this._pressedLetters.join(""))).subscribe(t=>{const e=this._getItemsArray();for(let n=1;n!t[e]||this._allowedModifierKeys.indexOf(e)>-1);switch(e){case 9:return void this.tabOut.next();case 40:if(this._vertical&&n){this.setNextItemActive();break}return;case 38:if(this._vertical&&n){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&n){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&n){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&n){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&n){this.setLastItemActive();break}return;default:return void((n||Qp(t,"shiftKey"))&&(t.key&&1===t.key.length?this._letterKeyStream.next(t.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))))}this._pressedLetters=[],t.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem}isTyping(){return this._pressedLetters.length>0}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._items.length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(t){const e=this._getItemsArray(),n="number"==typeof t?t:e.indexOf(t),i=e[n];this._activeItem=null==i?null:i,this._activeItemIndex=n}_setActiveItemByDelta(t){this._wrap?this._setActiveInWrapMode(t):this._setActiveInDefaultMode(t)}_setActiveInWrapMode(t){const e=this._getItemsArray();for(let n=1;n<=e.length;n++){const i=(this._activeItemIndex+t*n+e.length)%e.length;if(!this._skipPredicateFn(e[i]))return void this.setActiveItem(i)}}_setActiveInDefaultMode(t){this._setActiveItemByIndex(this._activeItemIndex+t,t)}_setActiveItemByIndex(t,e){const n=this._getItemsArray();if(n[t]){for(;this._skipPredicateFn(n[t]);)if(!n[t+=e])return;this.setActiveItem(t)}}_getItemsArray(){return this._items instanceof Lc?this._items.toArray():this._items}}{setActiveItem(t){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(t),this.activeItem&&this.activeItem.setActiveStyles()}}let gg=(()=>{class t{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(t){return!!(t.offsetWidth||t.offsetHeight||"function"==typeof t.getClientRects&&t.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const e=function(t){try{return t.frameElement}catch(e){return null}}(function(t){return t.ownerDocument&&t.ownerDocument.defaultView||window}(t));if(e&&(-1===bg(e)||!this.isVisible(e)))return!1;let n=t.nodeName.toLowerCase(),i=bg(t);return t.hasAttribute("contenteditable")?-1!==i:!("iframe"===n||"object"===n||this._platform.WEBKIT&&this._platform.IOS&&!function(t){let e=t.nodeName.toLowerCase(),n="input"===e&&t.type;return"text"===n||"password"===n||"select"===e||"textarea"===e}(t))&&("audio"===n?!!t.hasAttribute("controls")&&-1!==i:"video"===n?-1!==i&&(null!==i||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,e){return function(t){return!function(t){return function(t){return"input"==t.nodeName.toLowerCase()}(t)&&"hidden"==t.type}(t)&&(function(t){let e=t.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(t)||function(t){return function(t){return"a"==t.nodeName.toLowerCase()}(t)&&t.hasAttribute("href")}(t)||t.hasAttribute("contenteditable")||mg(t))}(t)&&!this.isDisabled(t)&&((null==e?void 0:e.ignoreVisibility)||this.isVisible(t))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp))},token:t,providedIn:"root"}),t})();function mg(t){if(!t.hasAttribute("tabindex")||void 0===t.tabIndex)return!1;let e=t.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function bg(t){if(!mg(t))return null;const e=parseInt(t.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class yg{constructor(t,e,n,i,r=!1){this._element=t,this._checker=e,this._ngZone=n,this._document=i,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,r||this.attachAnchors()}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}destroy(){const t=this._startAnchor,e=this._endAnchor;t&&(t.removeEventListener("focus",this.startAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),e&&(e.removeEventListener("focus",this.endAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusInitialElement(t)))})}focusFirstTabbableElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusFirstTabbableElement(t)))})}focusLastTabbableElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusLastTabbableElement(t)))})}_getRegionBoundary(t){let e=this._element.querySelectorAll(`[cdk-focus-region-${t}], [cdkFocusRegion${t}], [cdk-focus-${t}]`);for(let n=0;n=0;n--){let t=e[n].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(e[n]):null;if(t)return t}return null}_createAnchor(){const t=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,t),t.classList.add("cdk-visually-hidden"),t.classList.add("cdk-focus-trap-anchor"),t.setAttribute("aria-hidden","true"),t}_toggleAnchorTabIndex(t,e){t?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}toggleAnchors(t){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}_executeOnStable(t){this._ngZone.isStable?t():this._ngZone.onStable.pipe(Gp(1)).subscribe(t)}}let vg=(()=>{class t{constructor(t,e,n){this._checker=t,this._ngZone=e,this._document=n}create(t,e=!1){return new yg(t,this._checker,this._ngZone,this._document,e)}}return t.\u0275fac=function(e){return new(e||t)(Ci(gg),Ci(xu),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(gg),Ci(xu),Ci(Yu))},token:t,providedIn:"root"}),t})();function _g(t){return 0===t.offsetX&&0===t.offsetY}function wg(t){const e=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const xg=new oi("cdk-input-modality-detector-options"),Sg={ignoreKeys:[18,17,224,91,16]},Eg=_p({passive:!0,capture:!0});let Cg=(()=>{class t{constructor(t,e,n,i){this._platform=t,this._mostRecentTarget=null,this._modality=new Uf(null),this._lastTouchMs=0,this._onKeydown=t=>{var e,n;(null===(n=null===(e=this._options)||void 0===e?void 0:e.ignoreKeys)||void 0===n?void 0:n.some(e=>e===t.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Ep(t))},this._onMousedown=t=>{Date.now()-this._lastTouchMs<650||(this._modality.next(_g(t)?"keyboard":"mouse"),this._mostRecentTarget=Ep(t))},this._onTouchstart=t=>{wg(t)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Ep(t))},this._options=Object.assign(Object.assign({},Sg),i),this.modalityDetected=this._modality.pipe(Qf(1)),this.modalityChanged=this.modalityDetected.pipe(Rd()),t.isBrowser&&e.runOutsideAngular(()=>{n.addEventListener("keydown",this._onKeydown,Eg),n.addEventListener("mousedown",this._onMousedown,Eg),n.addEventListener("touchstart",this._onTouchstart,Eg)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Eg),document.removeEventListener("mousedown",this._onMousedown,Eg),document.removeEventListener("touchstart",this._onTouchstart,Eg))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu),Ci(Yu),Ci(xg,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu),Ci(Yu),Ci(xg,8))},token:t,providedIn:"root"}),t})();const Og=new oi("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),Tg=new oi("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let kg=(()=>{class t{constructor(t,e,n,i){this._ngZone=e,this._defaultOptions=i,this._document=n,this._liveElement=t||this._createLiveElement()}announce(t,...e){const n=this._defaultOptions;let i,r;return 1===e.length&&"number"==typeof e[0]?r=e[0]:[i,r]=e,this.clear(),clearTimeout(this._previousTimeout),i||(i=n&&n.politeness?n.politeness:"polite"),null==r&&n&&(r=n.duration),this._liveElement.setAttribute("aria-live",i),this._ngZone.runOutsideAngular(()=>new Promise(e=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,e(),"number"==typeof r&&(this._previousTimeout=setTimeout(()=>this.clear(),r))},100)}))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement&&this._liveElement.parentNode&&(this._liveElement.parentNode.removeChild(this._liveElement),this._liveElement=null)}_createLiveElement(){const t="cdk-live-announcer-element",e=this._document.getElementsByClassName(t),n=this._document.createElement("div");for(let i=0;i{class t{constructor(t,e,n,i,r){this._ngZone=t,this._platform=e,this._inputModalityDetector=n,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new P,this._rootNodeFocusAndBlurListener=t=>{const e=Ep(t),n="focus"===t.type?this._onFocus:this._onBlur;for(let i=e;i;i=i.parentElement)n.call(this,t,i)},this._document=i,this._detectionMode=(null==r?void 0:r.detectionMode)||0}monitor(t,e=!1){const n=_d(t);if(!this._platform.isBrowser||1!==n.nodeType)return wd(null);const i=xp(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return e&&(r.checkChildren=!0),r.subject;const s={checkChildren:e,subject:new P,rootNode:i};return this._elementInfo.set(n,s),this._registerGlobalListeners(s),s.subject}stopMonitoring(t){const e=_d(t),n=this._elementInfo.get(e);n&&(n.subject.complete(),this._setClasses(e),this._elementInfo.delete(e),this._removeGlobalListeners(n))}focusVia(t,e,n){const i=_d(t);i===this._getDocument().activeElement?this._getClosestElementsInfo(i).forEach(([t,n])=>this._originChanged(t,e,n)):(this._setOrigin(e),"function"==typeof i.focus&&i.focus(n))}ngOnDestroy(){this._elementInfo.forEach((t,e)=>this.stopMonitoring(e))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,e,n){n?t.classList.add(e):t.classList.remove(e)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,e){this._toggleClass(t,"cdk-focused",!!e),this._toggleClass(t,"cdk-touch-focused","touch"===e),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===e),this._toggleClass(t,"cdk-mouse-focused","mouse"===e),this._toggleClass(t,"cdk-program-focused","program"===e)}_setOrigin(t,e=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&e,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,e){const n=this._elementInfo.get(e),i=Ep(t);!n||!n.checkChildren&&e!==i||this._originChanged(e,this._getFocusOrigin(i),n)}_onBlur(t,e){const n=this._elementInfo.get(e);!n||n.checkChildren&&t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||(this._setClasses(e),this._emitOrigin(n.subject,null))}_emitOrigin(t,e){this._ngZone.run(()=>t.next(e))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const e=t.rootNode,n=this._rootNodeFocusListenerCount.get(e)||0;n||this._ngZone.runOutsideAngular(()=>{e.addEventListener("focus",this._rootNodeFocusAndBlurListener,Pg),e.addEventListener("blur",this._rootNodeFocusAndBlurListener,Pg)}),this._rootNodeFocusListenerCount.set(e,n+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(Wd(this._stopInputModalityDetector)).subscribe(t=>{this._setOrigin(t,!0)}))}_removeGlobalListeners(t){const e=t.rootNode;if(this._rootNodeFocusListenerCount.has(e)){const t=this._rootNodeFocusListenerCount.get(e);t>1?this._rootNodeFocusListenerCount.set(e,t-1):(e.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Pg),e.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Pg),this._rootNodeFocusListenerCount.delete(e))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,e,n){this._setClasses(t,e),this._emitOrigin(n.subject,e),this._lastFocusOrigin=e}_getClosestElementsInfo(t){const e=[];return this._elementInfo.forEach((n,i)=>{(i===t||n.checkChildren&&i.contains(t))&&e.push([i,n])}),e}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(pp),Ci(Cg),Ci(Yu,8),Ci(Ag,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(xu),Ci(pp),Ci(Cg),Ci(Yu,8),Ci(Ag,8))},token:t,providedIn:"root"}),t})();const Mg="cdk-high-contrast-black-on-white",Dg="cdk-high-contrast-white-on-black",Rg="cdk-high-contrast-active";let Ng=(()=>{class t{constructor(t,e){this._platform=t,this._document=e}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const e=this._document.defaultView||window,n=e&&e.getComputedStyle?e.getComputedStyle(t):null,i=(n&&n.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),i){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(Rg),t.remove(Mg),t.remove(Dg),this._hasCheckedHighContrastMode=!0;const e=this.getHighContrastMode();1===e?(t.add(Rg),t.add(Mg)):2===e&&(t.add(Rg),t.add(Dg))}}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(Yu))},token:t,providedIn:"root"}),t})(),Lg=(()=>{class t{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ng))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[fp,ig]]}),t})();const jg=new Rl("12.2.5");class Fg{}const Bg="*";function Vg(t,e){return{type:7,name:t,definitions:e,options:{}}}function zg(t,e=null){return{type:4,styles:e,timings:t}}function Ug(t,e=null){return{type:2,steps:t,options:e}}function Hg(t){return{type:6,styles:t,offset:null}}function $g(t,e,n){return{type:0,name:t,styles:e,options:n}}function Gg(t){return{type:5,steps:t}}function Wg(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function qg(t=null){return{type:9,options:t}}function Xg(t,e,n=null){return{type:11,selector:t,animation:e,options:n}}function Yg(t){Promise.resolve(null).then(t)}class Kg{constructor(t=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Yg(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Qg{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let e=0,n=0,i=0;const r=this.players.length;0==r?Yg(()=>this._onFinish()):this.players.forEach(t=>{t.onDone(()=>{++e==r&&this._onFinish()}),t.onDestroy(()=>{++n==r&&this._onDestroy()}),t.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((t,e)=>Math.max(t,e.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const e=t*this.totalTime;this.players.forEach(t=>{const n=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(n)})}getPosition(){const t=this.players.reduce((t,e)=>null===t||e.totalTime>t.totalTime?e:t,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}function Zg(){return"undefined"!=typeof window&&void 0!==window.document}function Jg(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function tm(t){switch(t.length){case 0:return new Kg;case 1:return t[0];default:return new Qg(t)}}function em(t,e,n,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(t=>{const n=t.offset,i=n==l,u=i&&c||{};Object.keys(t).forEach(n=>{let i=n,a=t[n];if("offset"!==n)switch(i=e.normalizePropertyName(i,o),a){case"!":a=r[n];break;case Bg:a=s[n];break;default:a=e.normalizeStyleValue(n,i,a,o)}u[i]=a}),i||a.push(u),c=u,l=n}),o.length){const t="\n - ";throw new Error(`Unable to animate due to the following errors:${t}${o.join(t)}`)}return a}function nm(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&im(n,"start",t)));break;case"done":t.onDone(()=>i(n&&im(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&im(n,"destroy",t)))}}function im(t,e,n){const i=n.totalTime,r=rm(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,null==i?t.totalTime:i,!!n.disabled),s=t._data;return null!=s&&(r._data=s),r}function rm(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function sm(t,e,n){let i;return t instanceof Map?(i=t.get(e),i||t.set(e,i=n)):(i=t[e],i||(i=t[e]=n)),i}function om(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let am=(t,e)=>!1,lm=(t,e)=>!1,cm=(t,e,n)=>[];const um=Jg();(um||"undefined"!=typeof Element)&&(am=Zg()?(t,e)=>{for(;e&&e!==document.documentElement;){if(e===t)return!0;e=e.parentNode||e.host}return!1}:(t,e)=>t.contains(e),lm=(()=>{if(um||Element.prototype.matches)return(t,e)=>t.matches(e);{const t=Element.prototype,e=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return e?(t,n)=>e.apply(t,[n]):lm}})(),cm=(t,e,n)=>{let i=[];if(n){const n=t.querySelectorAll(e);for(let t=0;t{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=t[n]}),e}let ym=(()=>{class t{validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new Kg(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class vm{}vm.NOOP=new ym;const _m="ng-enter",wm="ng-leave",xm="ng-trigger",Sm=".ng-trigger",Em="ng-animating",Cm=".ng-animating";function Om(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Tm(parseFloat(e[1]),e[2])}function Tm(t,e){switch(e){case"s":return 1e3*t;default:return t}}function km(t,e,n){return t.hasOwnProperty("duration")?t:function(t,e,n){let i,r=0,s="";if("string"==typeof t){const n=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return e.push(`The provided timing value "${t}" is invalid.`),{duration:0,delay:0,easing:""};i=Tm(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=Tm(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=t;if(!n){let n=!1,s=e.length;i<0&&(e.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(e.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&e.splice(s,0,`The provided timing value "${t}" is invalid.`)}return{duration:i,delay:r,easing:s}}(t,e,n)}function Am(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function Pm(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else Am(t,n);return n}function Im(t,e,n){return n?e+":"+n+";":""}function Mm(t){let e="";for(let n=0;n{const r=zm(i);n&&!n.hasOwnProperty(i)&&(n[i]=t.style[r]),t.style[r]=e[i]}),Jg()&&Mm(t))}function Rm(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=zm(e);t.style[n]=""}),Jg()&&Mm(t))}function Nm(t){return Array.isArray(t)?1==t.length?t[0]:Ug(t):t}const Lm=new RegExp("{{\\s*(.+?)\\s*}}","g");function jm(t){let e=[];if("string"==typeof t){let n;for(;n=Lm.exec(t);)e.push(n[1]);Lm.lastIndex=0}return e}function Fm(t,e,n){const i=t.toString(),r=i.replace(Lm,(t,i)=>{let r=e[i];return e.hasOwnProperty(i)||(n.push(`Please provide a value for the animation param ${i}`),r=""),r.toString()});return r==i?t:r}function Bm(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Vm=/-+([a-z0-9])/g;function zm(t){return t.replace(Vm,(...t)=>t[1].toUpperCase())}function Um(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Hm(t,e){return 0===t||0===e}function $m(t,e,n){const i=Object.keys(n);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(t=>{s.hasOwnProperty(t)||o.push(t),s[t]=n[t]}),o.length)for(var r=1;rfunction(t,e,n){if(":"==t[0]){const i=function(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,e)=>parseFloat(e)>parseFloat(t);case":decrement":return(t,e)=>parseFloat(e) *"}}(t,n);if("function"==typeof i)return void e.push(i);t=i}const i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${t}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(Km(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(Km(o,r))}(t,n,e)):n.push(t),n}const Xm=new Set(["true","1"]),Ym=new Set(["false","0"]);function Km(t,e){const n=Xm.has(t)||Ym.has(t),i=Xm.has(e)||Ym.has(e);return(r,s)=>{let o="*"==t||t==r,a="*"==e||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?Xm.has(t):Ym.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?Xm.has(e):Ym.has(e)),o&&a}}const Qm=new RegExp("s*:selfs*,?","g");function Zm(t,e,n){return new Jm(t).build(e,n)}class Jm{constructor(t){this._driver=t}build(t,e){const n=new tb(e);return this._resetContextStyleTimingState(n),Gm(this,Nm(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,i=e.depCount=0;const r=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(t=>{if(this._resetContextStyleTimingState(e),0==t.type){const n=t,i=n.name;i.toString().split(/\s*,\s*/).forEach(t=>{n.name=t,r.push(this.visitState(n,e))}),n.name=i}else if(1==t.type){const r=this.visitTransition(t,e);n+=r.queryCount,i+=r.depCount,s.push(r)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(t,e){const n=this.visitStyle(t.styles,e),i=t.options&&t.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(t=>{if(eb(t)){const e=t;Object.keys(e).forEach(t=>{jm(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Bm(r.values());e.errors.push(`state("${t.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:t.name,style:n,options:i?{params:i}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;const n=Gm(this,Nm(t.animation),e);return{type:1,matchers:qm(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:nb(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>Gm(this,t,e)),options:nb(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=Gm(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:nb(t.options)}}visitAnimate(t,e){const n=function(t,e){let n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return ib(km(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=ib(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||km(i,e),ib(n.duration,n.delay,n.easing)}(t.timings,e.errors);e.currentAnimateTimings=n;let i,r=t.styles?t.styles:Hg({});if(5==r.type)i=this.visitKeyframes(r,e);else{let r=t.styles,s=!1;if(!r){s=!0;const t={};n.easing&&(t.easing=n.easing),r=Hg(t)}e.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,e);o.isEmptyStep=s,i=o}return e.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(t,e){const n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){const n=[];Array.isArray(t.styles)?t.styles.forEach(t=>{"string"==typeof t?t==Bg?n.push(t):e.errors.push(`The provided style string value ${t} is not allowed.`):n.push(t)}):n.push(t.styles);let i=!1,r=null;return n.forEach(t=>{if(eb(t)){const e=t,n=e.easing;if(n&&(r=n,delete e.easing),!i)for(let t in e)if(e[t].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:t.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(t,e){const n=e.currentAnimateTimings;let i=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),t.styles.forEach(t=>{"string"!=typeof t&&Object.keys(t).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void e.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=e.collectedStyles[e.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(e.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),e.options&&function(t,e,n){const i=e.params||{},r=jm(t);r.length&&r.forEach(t=>{i.hasOwnProperty(t)||n.push(`Unable to resolve the local animation param ${t} in the given list of values`)})}(t[n],e.options,e.errors)})})}visitKeyframes(t,e){const n={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const l=t.steps.map(t=>{const n=this._makeStyleAst(t,e);let l=null!=n.offset?n.offset:function(t){if("string"==typeof t)return null;let e=null;if(Array.isArray(t))t.forEach(t=>{if(eb(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(eb(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}return e}(n.styles),c=0;return null!=l&&(i++,c=n.offset=l),o=o||c<0||c>1,s=s||c0&&i{const s=u>0?i==h?1:u*i:r[i],o=s*f;e.currentTime=d+p.delay+o,p.duration=o,this._validateStyleAst(t,e),t.offset=s,n.styles.push(t)}),n}visitReference(t,e){return{type:8,animation:Gm(this,Nm(t.animation),e),options:nb(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:nb(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:nb(t.options)}}visitQuery(t,e){const n=e.currentQuerySelector,i=t.options||{};e.queryCount++,e.currentQuery=t;const[r,s]=function(t){const e=!!t.split(/\s*,\s*/).find(t=>":self"==t);return e&&(t=t.replace(Qm,"")),[t=t.replace(/@\*/g,Sm).replace(/@\w+/g,t=>Sm+"-"+t.substr(1)).replace(/:animating/g,Cm),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,sm(e.collectedStyles,e.currentQuerySelector,{});const o=Gm(this,Nm(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:t.selector,options:nb(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const n="full"===t.timings?{duration:0,delay:0,easing:"full"}:km(t.timings,e.errors,!0);return{type:12,animation:Gm(this,Nm(t.animation),e),timings:n,options:null}}}class tb{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function eb(t){return!Array.isArray(t)&&"object"==typeof t}function nb(t){return t?(t=Am(t)).params&&(t.params=function(t){return t?Am(t):null}(t.params)):t={},t}function ib(t,e,n){return{duration:t,delay:e,easing:n}}function rb(t,e,n,i,r,s,o=null,a=!1){return{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class sb{constructor(){this._map=new Map}consume(t){let e=this._map.get(t);return e?this._map.delete(t):e=[],e}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const ob=new RegExp(":enter","g"),ab=new RegExp(":leave","g");function lb(t,e,n,i,r,s={},o={},a,l,c=[]){return(new cb).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class cb{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new sb;const u=new hb(t,e,l,i,r,c,[]);u.options=a,u.currentTimeline.setStyles([s],null,u.errors,a),Gm(this,n,u);const h=u.timelines.filter(t=>t.containsAnimation());if(h.length&&Object.keys(o).length){const t=h[h.length-1];t.allowOnlyTimelineStyles()||t.setStyles([o],null,u.errors,a)}return h.length?h.map(t=>t.buildKeyframes()):[rb(e,[],[],[],0,0,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){const n=e.subInstructions.consume(e.element);if(n){const i=e.createSubContext(t.options),r=e.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&e.transformIntoNewTimeline(s)}e.previousNode=t}visitAnimateRef(t,e){const n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_visitSubInstructions(t,e,n){let i=e.currentTimeline.currentTime;const r=null!=n.duration?Om(n.duration):null,s=null!=n.delay?Om(n.delay):null;return 0!==r&&t.forEach(t=>{const n=e.appendInstructionToTimeline(t,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(t,e){e.updateOptions(t.options,!0),Gm(this,t.animation,e),e.previousNode=t}visitSequence(t,e){const n=e.subContextCount;let i=e;const r=t.options;if(r&&(r.params||r.delay)&&(i=e.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=ub);const t=Om(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>Gm(this,t,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){const n=[];let i=e.currentTimeline.currentTime;const r=t.options&&t.options.delay?Om(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),Gm(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(t=>e.currentTimeline.mergeTimelineCollectedStyles(t)),e.transformIntoNewTimeline(i),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){const n=t.strValue;return km(e.params?Fm(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){const n=e.currentAnimateTimings=this._visitTiming(t.timings,e),i=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),i.snapshotCurrentStyles());const r=t.style;5==r.type?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){const n=e.currentTimeline,i=e.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(r):n.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){const n=e.currentAnimateTimings,i=e.currentTimeline.duration,r=n.duration,s=e.createSubContext().currentTimeline;s.easing=n.easing,t.styles.forEach(t=>{s.forwardTime((t.offset||0)*r),s.setStyles(t.styles,t.easing,e.errors,e.options),s.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(s),e.transformIntoNewTimeline(i+r),e.previousNode=t}visitQuery(t,e){const n=e.currentTimeline.currentTime,i=t.options||{},r=i.delay?Om(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=ub);let s=n;const o=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{e.currentQueryIndex=i;const o=e.createSubContext(t.options,n);r&&o.delayNextStep(r),n===e.element&&(a=o.currentTimeline),Gm(this,t.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),a&&(e.currentTimeline.mergeTimelineCollectedStyles(a),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){const n=e.parentContext,i=e.currentTimeline,r=t.timings,s=Math.abs(r.duration),o=s*(e.currentQueryTotal-1);let a=s*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const l=e.currentTimeline;a&&l.delayNextStep(a);const c=l.currentTime;Gm(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const ub={};class hb{constructor(t,e,n,i,r,s,o,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=ub,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new db(this._driver,e,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;const n=t;let i=this.options;null!=n.duration&&(i.duration=Om(n.duration)),null!=n.delay&&(i.delay=Om(n.delay));const r=n.params;if(r){let t=i.params;t||(t=this.options.params={}),Object.keys(r).forEach(n=>{(!e||!t.hasOwnProperty(n))&&(t[n]=Fm(r[n],t,this.errors))})}}_copyOptions(){const t={};if(this.options){const e=this.options.params;if(e){const n=t.params={};Object.keys(e).forEach(t=>{n[t]=e[t]})}}return t}createSubContext(t=null,e,n){const i=e||this.element,r=new hb(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=ub,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){const i={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},r=new pb(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,i,t.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,i,r,s){let o=[];if(i&&o.push(this.element),t.length>0){t=(t=t.replace(ob,"."+this._enterClassName)).replace(ab,"."+this._leaveClassName);let e=this._driver.query(this.element,t,1!=n);0!==n&&(e=n<0?e.slice(e.length+n,e.length):e.slice(0,n)),o.push(...e)}return!r&&0==o.length&&s.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),o}}class db{constructor(t,e,n,i){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new db(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||Bg,this._currentKeyframe[t]=Bg}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,i){e&&(this._previousKeyframe.easing=e);const r=i&&i.params||{},s=function(t,e){const n={};let i;return t.forEach(t=>{"*"===t?(i=i||Object.keys(e),i.forEach(t=>{n[t]=Bg})):Pm(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=Fm(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Bg),this._updateStyle(t,e)})}applyStylesToKeyframe(){const t=this._pendingStyles,e=Object.keys(t);0!=e.length&&(this._pendingStyles={},e.forEach(e=>{this._currentKeyframe[e]=t[e]}),Object.keys(this._localTimelineStyles).forEach(t=>{this._currentKeyframe.hasOwnProperty(t)||(this._currentKeyframe[t]=this._localTimelineStyles[t])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(t=>{const e=this._localTimelineStyles[t];this._pendingStyles[t]=e,this._updateStyle(t,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){Object.keys(t._styleSummary).forEach(e=>{const n=this._styleSummary[e],i=t._styleSummary[e];(!n||i.time>n.time)&&this._updateStyle(e,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,e=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=Pm(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Bg&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Bm(t.values()):[],s=e.size?Bm(e.values()):[];if(n){const t=i[0],e=Am(t);t.offset=0,e.offset=1,i=[t,e]}return rb(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class pb extends db{constructor(t,e,n,i,r,s,o=!1){super(t,e,s.delay),this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){const r=[],s=n+e,o=e/s,a=Pm(t[0],!1);a.offset=0,r.push(a);const l=Pm(t[0],!1);l.offset=fb(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=Pm(t[i],!1);o.offset=fb((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return rb(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function fb(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class gb{}class mb extends gb{normalizePropertyName(t,e){return zm(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(bb[e]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const e=n.match(/^[+-]?[\d\.]+([a-z]*)$/);e&&0==e[1].length&&i.push(`Please provide a CSS unit value for ${t}:${n}`)}return s+r}}const bb=(()=>function(t){const e={};return t.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function yb(t,e,n,i,r,s,o,a,l,c,u,h,d){return{type:0,element:t,triggerName:e,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:u,totalTime:h,errors:d}}const vb={};class _b{constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,i){return function(t,e,n,i,r){return t.some(t=>t(e,n,i,r))}(this.ast.matchers,t,e,n,i)}buildStyles(t,e,n){const i=this._stateStyles["*"],r=this._stateStyles[t],s=i?i.buildStyles(e,n):{};return r?r.buildStyles(e,n):s}build(t,e,n,i,r,s,o,a,l,c){const u=[],h=this.ast.options&&this.ast.options.params||vb,d=this.buildStyles(n,o&&o.params||vb,u),p=a&&a.params||vb,f=this.buildStyles(i,p,u),g=new Set,m=new Map,b=new Map,y="void"===i,v={params:Object.assign(Object.assign({},h),p)},_=c?[]:lb(t,e,this.ast.animation,r,s,d,f,v,l,u);let w=0;if(_.forEach(t=>{w=Math.max(t.duration+t.delay,w)}),u.length)return yb(e,this._triggerName,n,i,y,d,f,[],[],m,b,w,u);_.forEach(t=>{const n=t.element,i=sm(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=sm(b,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const x=Bm(g.values());return yb(e,this._triggerName,n,i,y,d,f,_,x,m,b,w)}}class wb{constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){const n={},i=Am(this.defaultParams);return Object.keys(t).forEach(e=>{const n=t[e];null!=n&&(i[e]=n)}),this.styles.styles.forEach(t=>{if("string"!=typeof t){const r=t;Object.keys(r).forEach(t=>{let s=r[t];s.length>1&&(s=Fm(s,i,e));const o=this.normalizer.normalizePropertyName(t,e);s=this.normalizer.normalizeStyleValue(t,o,s,e),n[o]=s})}}),n}}class xb{constructor(t,e,n){this.name=t,this.ast=e,this._normalizer=n,this.transitionFactories=[],this.states={},e.states.forEach(t=>{this.states[t.name]=new wb(t.style,t.options&&t.options.params||{},n)}),Sb(this.states,"true","1"),Sb(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new _b(t,e,this.states))}),this.fallbackTransition=function(t,e,n){return new _b(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[(t,e)=>!0],options:null,queryCount:0,depCount:0},e)}(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,i){return this.transitionFactories.find(r=>r.match(t,e,n,i))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}}function Sb(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const Eb=new sb;class Cb{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(t,e){const n=[],i=Zm(this._driver,e,n);if(n.length)throw new Error(`Unable to build the animation due to the following errors: ${n.join("\n")}`);this._animations[t]=i}_buildPlayer(t,e,n){const i=t.element,r=em(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(i,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){const i=[],r=this._animations[t];let s;const o=new Map;if(r?(s=lb(this._driver,e,r,_m,wm,{},{},n,Eb,i),s.forEach(t=>{const e=sm(o,t.element,{});t.postStyleProps.forEach(t=>e[t]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error(`Unable to create the animation due to the following errors: ${i.join("\n")}`);o.forEach((t,e)=>{Object.keys(t).forEach(n=>{t[n]=this._driver.computeStyle(e,n,Bg)})});const a=tm(s.map(t=>{const e=o.get(t.element);return this._buildPlayer(t,{},e)}));return this._playersById[t]=a,a.onDestroy(()=>this.destroy(t)),this.players.push(a),a}destroy(t){const e=this._getPlayer(t);e.destroy(),delete this._playersById[t];const n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){const e=this._playersById[t];if(!e)throw new Error(`Unable to find the timeline player referenced by ${t}`);return e}listen(t,e,n,i){const r=rm(e,"","","");return nm(this._getPlayer(t),n,r,i),()=>{}}command(t,e,n,i){if("register"==n)return void this.register(t,i[0]);if("create"==n)return void this.create(t,e,i[0]||{});const r=this._getPlayer(t);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(t)}}}const Ob="ng-animate-queued",Tb="ng-animate-disabled",kb=".ng-animate-disabled",Ab=[],Pb={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ib={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Mb="__ng_removed";class Db{constructor(t,e=""){this.namespaceId=e;const n=t&&t.hasOwnProperty("value");if(this.value=function(t){return null!=t?t:null}(n?t.value:t),n){const e=Am(t);delete e.value,this.options=e}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(t){const e=t.params;if(e){const t=this.options.params;Object.keys(e).forEach(n=>{null==t[n]&&(t[n]=e[n])})}}}const Rb="void",Nb=new Db(Rb);class Lb{constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,$b(e,this._hostClassName)}listen(t,e,n,i){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${e}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if(!function(t){return"start"==t||"done"==t}(n))throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${e}" is not supported!`);const r=sm(this._elementListeners,t,[]),s={name:e,phase:n,callback:i};r.push(s);const o=sm(this._engine.statesByElement,t,{});return o.hasOwnProperty(e)||($b(t,xm),$b(t,xm+"-"+e),o[e]=Nb),()=>{this._engine.afterFlush(()=>{const t=r.indexOf(s);t>=0&&r.splice(t,1),this._triggers[e]||delete o[e]})}}register(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)}_getTrigger(t){const e=this._triggers[t];if(!e)throw new Error(`The provided animation trigger "${t}" has not been registered!`);return e}trigger(t,e,n,i=!0){const r=this._getTrigger(e),s=new Fb(this.id,e,t);let o=this._engine.statesByElement.get(t);o||($b(t,xm),$b(t,xm+"-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new Db(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=Nb),l.value!==Rb&&a.value===l.value){if(!function(t,e){const n=Object.keys(t),i=Object.keys(e);if(n.length!=i.length)return!1;for(let r=0;r{Rm(t,n),Dm(t,i)})}return}const c=sm(this._engine.playersByElement,t,[]);c.forEach(t=>{t.namespaceId==this.id&&t.triggerName==e&&t.queued&&t.destroy()});let u=r.matchTransition(a.value,l.value,t,l.params),h=!1;if(!u){if(!i)return;u=r.fallbackTransition,h=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:u,fromState:a,toState:l,player:s,isFallbackTransition:h}),h||($b(t,Ob),s.onStart(()=>{Gb(t,Ob)})),s.onDone(()=>{let e=this.players.indexOf(s);e>=0&&this.players.splice(e,1);const n=this._engine.playersByElement.get(t);if(n){let t=n.indexOf(s);t>=0&&n.splice(t,1)}}),this.players.push(s),c.push(s),s}deregister(t){delete this._triggers[t],this._engine.statesByElement.forEach((e,n)=>{delete e[t]}),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(e=>e.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const e=this._engine.playersByElement.get(t);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){const n=this._engine.driver.query(t,Sm,!0);n.forEach(t=>{if(t[Mb])return;const n=this._engine.fetchNamespacesByElement(t);n.size?n.forEach(n=>n.triggerLeaveAnimation(t,e,!1,!0)):this.clearElementCache(t)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(t=>this.clearElementCache(t)))}triggerLeaveAnimation(t,e,n,i){const r=this._engine.statesByElement.get(t);if(r){const s=[];if(Object.keys(r).forEach(e=>{if(this._triggers[e]){const n=this.trigger(t,e,Rb,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&tm(s).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const e=this._elementListeners.get(t),n=this._engine.statesByElement.get(t);if(e&&n){const i=new Set;e.forEach(e=>{const r=e.name;if(i.has(r))return;i.add(r);const s=this._triggers[r].fallbackTransition,o=n[r]||Nb,a=new Db(Rb),l=new Fb(this.id,r,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:r,transition:s,fromState:o,toState:a,player:l,isFallbackTransition:!0})})}}removeNode(t,e){const n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let i=!1;if(n.totalAnimations){const e=n.players.length?n.playersByQueriedElement.get(t):[];if(e&&e.length)i=!0;else{let e=t;for(;e=e.parentNode;)if(n.statesByElement.get(e)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(t),i)n.markElementAsRemoved(this.id,t,!1,e);else{const i=t[Mb];(!i||i===Pb)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){$b(t,this._hostClassName)}drainQueuedTransitions(t){const e=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(e=>{if(e.name==n.triggerName){const i=rm(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,nm(n.player,e.phase,i,e.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(n)}),this._queue=[],e.sort((t,e)=>{const n=t.transition.ast.depCount,i=e.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(t.element,e.element)?1:-1})}destroy(t){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}elementContainsData(t){let e=!1;return this._elementListeners.has(t)&&(e=!0),e=!!this._queue.find(e=>e.element===t)||e,e}}class jb{constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(t,e)=>{}}_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}get queuedPlayers(){const t=[];return this._namespaceList.forEach(e=>{e.players.forEach(e=>{e.queued&&t.push(e)})}),t}createNamespace(t,e){const n=new Lb(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,e)){this._namespaceList.splice(r+1,0,t),i=!0;break}i||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let i=this._namespaceLookup[t];i&&i.register(e,n)&&this.totalAnimations++}destroy(t,e){if(!t)return;const n=this._fetchNamespace(t);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[t];const e=this._namespaceList.indexOf(n);e>=0&&this._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(()=>n.destroy(e))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const e=new Set,n=this.statesByElement.get(t);if(n){const t=Object.keys(n);for(let i=0;i=0&&this.collectedLeaveElements.splice(t,1)}if(t){const i=this._fetchNamespace(t);i&&i.insertNode(e,n)}i&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),$b(t,Tb)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Gb(t,Tb))}removeNode(t,e,n,i){if(Bb(e)){const r=t?this._fetchNamespace(t):null;if(r?r.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i),n){const n=this.namespacesByHostElement.get(e);n&&n.id!==t&&n.removeNode(e,i)}}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,n,i){this.collectedLeaveElements.push(e),e[Mb]={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return Bb(e)?this._fetchNamespace(t).listen(e,n,i,r):()=>{}}_buildInstruction(t,e,n,i,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,i,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,Sm,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,Cm,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(t){const e=this.playersByElement.get(t);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(t){const e=this.playersByQueriedElement.get(t);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return tm(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t[Mb];if(e&&e.setForRemoval){if(t[Mb]=Pb,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,kb)&&this.markElementAsDisabled(t,!1),this.driver.query(t,kb,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,e)=>this._balanceNamespaceList(t,e)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nt()),this._flushFns=[],this._whenQuietFns.length){const t=this._whenQuietFns;this._whenQuietFns=[],e.length?tm(e).onDone(()=>{t.forEach(t=>t())}):t.forEach(t=>t())}}reportError(t){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${t.join("\n")}`)}_flushAnimations(t,e){const n=new sb,i=[],r=new Map,s=[],o=new Map,a=new Map,l=new Map,c=new Set;this.disabledNodes.forEach(t=>{c.add(t);const e=this.driver.query(t,".ng-animate-queued",!0);for(let n=0;n{const n=_m+f++;p.set(e,n),t.forEach(t=>$b(t,n))});const g=[],m=new Set,b=new Set;for(let P=0;Pm.add(t)):b.add(t))}const y=new Map,v=Ub(h,Array.from(m));v.forEach((t,e)=>{const n=wm+f++;y.set(e,n),t.forEach(t=>$b(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>Gb(t,n))}),v.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>Gb(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const _=[],w=[];for(let P=this._namespaceList.length-1;P>=0;P--)this._namespaceList[P].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(_.push(e),this.collectedEnterElements.length){const t=r[Mb];if(t&&t.setForMove)return void e.destroy()}const c=!u||!this.driver.containsElement(u,r),h=y.get(r),d=p.get(r),f=this._buildInstruction(t,n,d,h,c);if(f.errors&&f.errors.length)w.push(f);else{if(c)return e.onStart(()=>Rm(r,f.fromStyles)),e.onDestroy(()=>Dm(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>Rm(r,f.fromStyles)),e.onDestroy(()=>Dm(r,f.toStyles)),void i.push(e);f.timelines.forEach(t=>t.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:e,element:r}),f.queriedElements.forEach(t=>sm(o,t,[]).push(e)),f.preStyleProps.forEach((t,e)=>{const n=Object.keys(t);if(n.length){let t=a.get(e);t||a.set(e,t=new Set),n.forEach(e=>t.add(e))}}),f.postStyleProps.forEach((t,e)=>{const n=Object.keys(t);let i=l.get(e);i||l.set(e,i=new Set),n.forEach(t=>i.add(t))})}});if(w.length){const t=[];w.forEach(e=>{t.push(`@${e.triggerName} has failed due to:\n`),e.errors.forEach(e=>t.push(`- ${e}\n`))}),_.forEach(t=>t.destroy()),this.reportError(t)}const x=new Map,S=new Map;s.forEach(t=>{const e=t.element;n.has(e)&&(S.set(e,e),this._beforeAnimationBuild(t.player.namespaceId,t.instruction,x))}),i.forEach(t=>{const e=t.element;this._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(t=>{sm(x,e,[]).push(t),t.destroy()})});const E=g.filter(t=>Xb(t,a,l)),C=new Map;zb(C,this.driver,b,l,Bg).forEach(t=>{Xb(t,a,l)&&E.push(t)});const O=new Map;d.forEach((t,e)=>{zb(O,this.driver,new Set(t),a,"!")}),E.forEach(t=>{const e=C.get(t),n=O.get(t);C.set(t,Object.assign(Object.assign({},e),n))});const T=[],k=[],A={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>Dm(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=A;if(S.size>1){let n=e;const i=[];for(;n=n.parentNode;){const e=S.get(n);if(e){t=e;break}i.push(n)}i.forEach(e=>S.set(e,t))}const n=this._buildAnimation(s.namespaceId,o,x,r,O,C);if(s.setRealPlayer(n),t===A)T.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=tm(e)),i.push(s)}}else Rm(e,o.fromStyles),s.onDestroy(()=>Dm(e,o.toStyles)),k.push(s),c.has(e)&&i.push(s)}),k.forEach(t=>{const e=r.get(t.element);if(e&&e.length){const n=tm(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let P=0;P!t.destroyed);i.length?Wb(this,t,i):this.processLeaveNode(t)}return g.length=0,T.forEach(t=>{this.players.push(t),t.onDone(()=>{t.destroy();const e=this.players.indexOf(t);this.players.splice(e,1)}),t.play()}),T}elementContainsData(t,e){let n=!1;const i=e[Mb];return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,i,r){let s=[];if(e){const e=this.playersByQueriedElement.get(t);e&&(s=e)}else{const e=this.playersByElement.get(t);if(e){const t=!r||r==Rb;e.forEach(e=>{e.queued||!t&&e.triggerName!=i||s.push(e)})}}return(n||i)&&(s=s.filter(t=>!(n&&n!=t.namespaceId||i&&i!=t.triggerName))),s}_beforeAnimationBuild(t,e,n){const i=e.element,r=e.isRemovalTransition?void 0:t,s=e.isRemovalTransition?void 0:e.triggerName;for(const o of e.timelines){const t=o.element,a=t!==i,l=sm(n,t,[]);this._getPreviousPlayers(t,a,r,s,e.toState).forEach(t=>{const e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),l.push(t)})}Rm(i,e.fromStyles)}_buildAnimation(t,e,n,i,r,s){const o=e.triggerName,a=e.element,l=[],c=new Set,u=new Set,h=e.timelines.map(e=>{const h=e.element;c.add(h);const d=h[Mb];if(d&&d.removedBeforeQueried)return new Kg(e.duration,e.delay);const p=h!==a,f=function(t){const e=[];return qb(t,e),e}((n.get(h)||Ab).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===h),g=r.get(h),m=s.get(h),b=em(0,this._normalizer,0,e.keyframes,g,m),y=this._buildPlayer(e,b,f);if(e.subTimeline&&i&&u.add(h),p){const e=new Fb(t,o,h);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{sm(this.playersByQueriedElement,t.element,[]).push(t),t.onDone(()=>function(t,e,n){let i;if(t instanceof Map){if(i=t.get(e),i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&t.delete(e)}}else if(i=t[e],i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&delete t[e]}return i}(this.playersByQueriedElement,t.element,t))}),c.forEach(t=>$b(t,Em));const d=tm(h);return d.onDestroy(()=>{c.forEach(t=>Gb(t,Em)),Dm(a,e.toStyles)}),u.forEach(t=>{sm(i,t,[]).push(d)}),d}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new Kg(t.duration,t.delay)}}class Fb{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new Kg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(n=>nm(t,e,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){sm(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const e=this._player;e.triggerCallback&&e.triggerCallback(t)}}function Bb(t){return t&&1===t.nodeType}function Vb(t,e){const n=t.style.display;return t.style.display=null!=e?e:"none",n}function zb(t,e,n,i,r){const s=[];n.forEach(t=>s.push(Vb(t)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(t=>{const n=s[t]=e.computeStyle(i,t,r);(!n||0==n.length)&&(i[Mb]=Ib,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Vb(t,s[a++])),o}function Ub(t,e){const n=new Map;if(t.forEach(t=>n.set(t,[])),0==e.length)return n;const i=new Set(e),r=new Map;function s(t){if(!t)return 1;let e=r.get(t);if(e)return e;const o=t.parentNode;return e=n.has(o)?o:i.has(o)?1:s(o),r.set(t,e),e}return e.forEach(t=>{const e=s(t);1!==e&&n.get(e).push(t)}),n}const Hb="$$classes";function $b(t,e){if(t.classList)t.classList.add(e);else{let n=t[Hb];n||(n=t[Hb]={}),n[e]=!0}}function Gb(t,e){if(t.classList)t.classList.remove(e);else{let n=t[Hb];n&&delete n[e]}}function Wb(t,e,n){tm(n).onDone(()=>t.processLeaveNode(e))}function qb(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class Yb{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new jb(t,e,n),this._timelineEngine=new Cb(t,e,n),this._transitionEngine.onRemovalComplete=(t,e)=>this.onRemovalComplete(t,e)}registerTrigger(t,e,n,i,r){const s=t+"-"+i;let o=this._triggerCache[s];if(!o){const t=[],e=Zm(this._driver,r,t);if(t.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${t.join("\n - ")}`);o=function(t,e,n){return new xb(t,e,n)}(i,e,this._normalizer),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(e,i,o)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,i){this._transitionEngine.insertNode(t,e,n,i)}onRemove(t,e,n,i){this._transitionEngine.removeNode(t,e,i||!1,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,i){if("@"==n.charAt(0)){const[t,r]=om(n);this._timelineEngine.command(t,e,r,i)}else this._transitionEngine.trigger(t,e,n,i)}listen(t,e,n,i,r){if("@"==n.charAt(0)){const[t,i]=om(n);return this._timelineEngine.listen(t,e,i,r)}return this._transitionEngine.listen(t,e,n,i,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function Kb(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=Zb(e[0]),e.length>1&&(i=Zb(e[e.length-1]))):e&&(n=Zb(e)),n||i?new Qb(t,n,i):null}class Qb{constructor(t,e,n){this._element=t,this._startStyles=e,this._endStyles=n,this._state=0;let i=Qb.initialStylesByElement.get(t);i||Qb.initialStylesByElement.set(t,i={}),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&Dm(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Dm(this._element,this._initialStyles),this._endStyles&&(Dm(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Qb.initialStylesByElement.delete(this._element),this._startStyles&&(Rm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Rm(this._element,this._endStyles),this._endStyles=null),Dm(this._element,this._initialStyles),this._state=3)}}function Zb(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){(function(t,e){const n=ly(t,"").trim();let i=0;n.length&&(function(t,e){let n=0;for(let i=0;i=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),oy(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=ly(t,"").split(","),i=sy(n,e);i>=0&&(n.splice(i,1),ay(t,"",n.join(",")))}(this._element,this._name))}}function iy(t,e,n){ay(t,"PlayState",n,ry(t,e))}function ry(t,e){const n=ly(t,"");return n.indexOf(",")>0?sy(n.split(","),e):sy([n],e)}function sy(t,e){for(let n=0;n=0)return n;return-1}function oy(t,e,n){n?t.removeEventListener(ey,e):t.addEventListener(ey,e)}function ay(t,e,n,i){const r=ty+e;if(null!=i){const e=t.style[r];if(e.length){const t=e.split(",");t[i]=n,n=t.join(",")}}t.style[r]=n}function ly(t,e){return t.style[ty+e]||""}class cy{constructor(t,e,n,i,r,s,o,a){this.element=t,this.keyframes=e,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(t=>t()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(t){this._styler.setPosition(t)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new ny(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}beforeDestroy(){this.init();const t={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(t[n]=e?this._finalStyles[n]:Wm(this.element,n))})}this.currentSnapshot=t}}class uy extends Kg{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=bm(e)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(t=>{this._startingStyles[t]=this.element.style[t]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(t=>this.element.style.setProperty(t,this._styles[t])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(t=>{const e=this._startingStyles[t];e?this.element.style.setProperty(t,e):this.element.style.removeProperty(t)}),this._startingStyles=null,super.destroy())}}class hy{constructor(){this._count=0}validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>bm(t));let i=`@keyframes ${e} {\n`,r="";n.forEach(t=>{r=" ";const e=parseFloat(t.offset);i+=`${r}${100*e}% {\n`,r+=" ",Object.keys(t).forEach(e=>{const n=t[e];switch(e){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${e}: ${n};\n`)}}),i+=`${r}}\n`}),i+="}\n";const s=document.createElement("style");return s.textContent=i,s}animate(t,e,n,i,r,s=[],o){const a=s.filter(t=>t instanceof cy),l={};Hm(n,i)&&a.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const c=function(t){let e={};return t&&(Array.isArray(t)?t:[t]).forEach(t=>{Object.keys(t).forEach(n=>{"offset"==n||"easing"==n||(e[n]=t[n])})}),e}(e=$m(t,e,l));if(0==n)return new uy(t,c);const u="gen_css_kf_"+this._count++,h=this.buildKeyframeElement(t,u,e);(function(t){var e;const n=null===(e=t.getRootNode)||void 0===e?void 0:e.call(t);return"undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot?n:document.head})(t).appendChild(h);const d=Kb(t,e),p=new cy(t,e,u,n,i,r,c,d);return p.onDestroy(()=>function(t){t.parentNode.removeChild(t)}(h)),p}}class dy{constructor(t,e,n,i){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(t,e,n){return t.animate(e,n)}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(e=>{"offset"!=e&&(t[e]=this._finished?this._finalKeyframe[e]:Wm(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class py{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(fy().toString()),this._cssKeyframesDriver=new hy}validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}overrideWebAnimationsSupport(t){this._isNativeImpl=t}animate(t,e,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const l={},c=s.filter(t=>t instanceof dy);Hm(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const u=Kb(t,e=$m(t,e=e.map(t=>Pm(t,!1)),l));return new dy(t,e,a,u)}}function fy(){return Zg()&&Element.prototype.animate||{}}let gy=(()=>{class t extends Fg{constructor(t,e){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(e.body,{id:"0",encapsulation:jt.None,styles:[],data:{animation:[]}})}build(t){const e=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(t)?Ug(t):t;return yy(this._renderer,null,e,"register",[n]),new my(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pl),Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class my extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new by(this._id,t,e||{},this._renderer)}}class by{constructor(t,e,n,i){this.id=t,this.element=e,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(t,e){return this._renderer.listen(this.element,`@@${this.id}:${t}`,e)}_command(t,...e){return yy(this._renderer,this.element,this.id,t,e)}onDone(t){this._listen("done",t)}onStart(t){this._listen("start",t)}onDestroy(t){this._listen("destroy",t)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(t){this._command("setPosition",t)}getPosition(){var t,e;return null!==(e=null===(t=this._renderer.engine.players[+this.id])||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}}function yy(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const vy="@.disabled";let _y=(()=>{class t{constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),e.onRemovalComplete=(t,e)=>{e&&e.parentNode(t)&&e.removeChild(t.parentNode,t)}}createRenderer(t,e){const n=this.delegate.createRenderer(t,e);if(!(t&&e&&e.data&&e.data.animation)){let t=this._rendererCache.get(n);return t||(t=new wy("",n,this.engine),this._rendererCache.set(n,t)),t}const i=e.id,r=e.id+"-"+this._currentId;this._currentId++,this.engine.register(r,t);const s=e=>{Array.isArray(e)?e.forEach(s):this.engine.registerTrigger(i,r,t,e.name,e)};return e.data.animation.forEach(s),new xy(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){t>=0&&te(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(t=>{const[e,n]=t;e(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([e,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pl),Ci(Yb),Ci(xu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class wy{constructor(t,e,n){this.namespaceId=t,this.delegate=e,this.engine=n,this.destroyNode=this.delegate.destroyNode?t=>e.destroyNode(t):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,i=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,i)}removeChild(t,e,n){this.engine.onRemove(this.namespaceId,e,this.delegate,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,i){this.delegate.setAttribute(t,e,n,i)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,i){this.delegate.setStyle(t,e,n,i)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){"@"==e.charAt(0)&&e==vy?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.delegate.listen(t,e,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}}class xy extends wy{constructor(t,e,n,i){super(e,n,i),this.factory=t,this.namespaceId=e}setProperty(t,e,n){"@"==e.charAt(0)?"."==e.charAt(1)&&e==vy?this.disableAnimations(t,n=void 0===n||!!n):this.engine.process(this.namespaceId,t,e.substr(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n){if("@"==e.charAt(0)){const i=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(t);let r=e.substr(1),s="";return"@"!=r.charAt(0)&&([r,s]=function(t){const e=t.indexOf(".");return[t.substring(0,e),t.substr(e+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,t=>{this.factory.scheduleListenerCallback(t._data||-1,n,t)})}return this.delegate.listen(t,e,n)}}let Sy=(()=>{class t extends Yb{constructor(t,e,n){super(t.body,e,n)}ngOnDestroy(){this.flush()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(vm),Ci(gb))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Ey=new oi("AnimationModuleType"),Cy=[{provide:Fg,useClass:gy},{provide:gb,useFactory:function(){return new mb}},{provide:Yb,useClass:Sy},{provide:Pl,useFactory:function(t,e,n){return new _y(t,e,n)},deps:[ed,Yb,xu]}],Oy=[{provide:vm,useFactory:function(){return"function"==typeof fy()?new py:new hy}},{provide:Ey,useValue:"BrowserAnimations"},...Cy],Ty=[{provide:vm,useClass:ym},{provide:Ey,useValue:"NoopAnimations"},...Cy];let ky=(()=>{class t{static withConfig(e){return{ngModule:t,providers:e.disableAnimations?Ty:Oy}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Oy,imports:[gd]}),t})();function Ay(t,e){if(1&t&&oa(0,"mat-pseudo-checkbox",4),2&t){const t=va();na("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function Py(t,e){if(1&t&&(ra(0,"span",5),Za(1),sa()),2&t){const t=va();ws(1),tl("(",t.group.label,")")}}const Iy=["*"],My=new Rl("12.2.5"),Dy=new oi("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Ry,Ny=(()=>{class t{constructor(t,e,n){this._hasDoneGlobalChecks=!1,this._document=n,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=e,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!Nu()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const e=getComputedStyle(t);e&&"none"!==e.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&My.full!==jg.full&&console.warn("The Angular Material version ("+My.full+") does not match the Angular CDK version ("+jg.full+").\nPlease ensure the versions of these two packages exactly match.")}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ng),Ci(Dy,8),Ci(Yu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Tp],Tp]}),t})();function Ly(t){return class extends t{constructor(...t){super(...t),this._disabled=!1}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t)}}}function jy(t,e){return class extends t{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const e=t||this.defaultColor;e!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),e&&this._elementRef.nativeElement.classList.add(`mat-${e}`),this._color=e)}}}function Fy(t){return class extends t{constructor(...t){super(...t),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=md(t)}}}function By(t,e=0){return class extends t{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?bd(t):this.defaultTabIndex}}}function Vy(t){return class extends t{constructor(...t){super(...t),this.stateChanges=new P,this.errorState=!1}updateErrorState(){const t=this.errorState,e=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);e!==t&&(this.errorState=e,this.stateChanges.next())}}}try{Ry="undefined"!=typeof Intl}catch(m){Ry=!1}let zy=(()=>{class t{isErrorState(t,e){return!!(t&&t.invalid&&(t.touched||e&&e.submitted))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})();class Uy{constructor(t,e,n){this._renderer=t,this.element=e,this.config=n,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const Hy={enterDuration:225,exitDuration:150},$y=_p({passive:!0}),Gy=["mousedown","touchstart"],Wy=["mouseup","mouseleave","touchend","touchcancel"];class qy{constructor(t,e,n,i){this._target=t,this._ngZone=e,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,i.isBrowser&&(this._containerElement=_d(n))}fadeInRipple(t,e,n={}){const i=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),r=Object.assign(Object.assign({},Hy),n.animation);n.centered&&(t=i.left+i.width/2,e=i.top+i.height/2);const s=n.radius||function(t,e,n){const i=Math.max(Math.abs(t-n.left),Math.abs(t-n.right)),r=Math.max(Math.abs(e-n.top),Math.abs(e-n.bottom));return Math.sqrt(i*i+r*r)}(t,e,i),o=t-i.left,a=e-i.top,l=r.enterDuration,c=document.createElement("div");c.classList.add("mat-ripple-element"),c.style.left=o-s+"px",c.style.top=a-s+"px",c.style.height=2*s+"px",c.style.width=2*s+"px",null!=n.color&&(c.style.backgroundColor=n.color),c.style.transitionDuration=`${l}ms`,this._containerElement.appendChild(c),function(t){window.getComputedStyle(t).getPropertyValue("opacity")}(c),c.style.transform="scale(1)";const u=new Uy(this,c,n);return u.state=0,this._activeRipples.add(u),n.persistent||(this._mostRecentTransientRipple=u),this._runTimeoutOutsideZone(()=>{const t=u===this._mostRecentTransientRipple;u.state=1,!n.persistent&&(!t||!this._isPointerDown)&&u.fadeOut()},l),u}fadeOutRipple(t){const e=this._activeRipples.delete(t);if(t===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!e)return;const n=t.element,i=Object.assign(Object.assign({},Hy),t.config.animation);n.style.transitionDuration=`${i.exitDuration}ms`,n.style.opacity="0",t.state=2,this._runTimeoutOutsideZone(()=>{t.state=3,n.parentNode.removeChild(n)},i.exitDuration)}fadeOutAll(){this._activeRipples.forEach(t=>t.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(t=>{t.config.persistent||t.fadeOut()})}setupTriggerEvents(t){const e=_d(t);!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,this._registerEvents(Gy))}handleEvent(t){"mousedown"===t.type?this._onMousedown(t):"touchstart"===t.type?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(Wy),this._pointerUpEventsRegistered=!0)}_onMousedown(t){const e=_g(t),n=this._lastTouchStartEvent&&Date.now(){!t.config.persistent&&(1===t.state||t.config.terminateOnPointerUp&&0===t.state)&&t.fadeOut()}))}_runTimeoutOutsideZone(t,e=0){this._ngZone.runOutsideAngular(()=>setTimeout(t,e))}_registerEvents(t){this._ngZone.runOutsideAngular(()=>{t.forEach(t=>{this._triggerElement.addEventListener(t,this,$y)})})}_removeTriggerEvents(){this._triggerElement&&(Gy.forEach(t=>{this._triggerElement.removeEventListener(t,this,$y)}),this._pointerUpEventsRegistered&&Wy.forEach(t=>{this._triggerElement.removeEventListener(t,this,$y)}))}}const Xy=new oi("mat-ripple-global-options");let Yy=(()=>{class t{constructor(t,e,n,i,r){this._elementRef=t,this._animationMode=r,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=i||{},this._rippleRenderer=new qy(this,e,t,n)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,e=0,n){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,e,Object.assign(Object.assign({},this.rippleConfig),n)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(xu),ea(pp),ea(Xy,8),ea(Ey,8))},t.\u0275dir=se({type:t,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,e){2&t&&ja("mat-ripple-unbounded",e.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),t})(),Ky=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny,fp],Ny]}),t})(),Qy=(()=>{class t{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return t.\u0275fac=function(e){return new(e||t)(ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,e){2&t&&ja("mat-pseudo-checkbox-indeterminate","indeterminate"===e.state)("mat-pseudo-checkbox-checked","checked"===e.state)("mat-pseudo-checkbox-disabled",e.disabled)("_mat-animation-noopable","NoopAnimations"===e._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,e){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),t})(),Zy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny]]}),t})();const Jy=new oi("MAT_OPTION_PARENT_COMPONENT"),tv=Ly(class{});let ev=0,nv=(()=>{class t extends tv{constructor(t){var e;super(),this._labelId="mat-optgroup-label-"+ev++,this._inert=null!==(e=null==t?void 0:t.inertGroups)&&void 0!==e&&e}}return t.\u0275fac=function(e){return new(e||t)(ea(Jy,8))},t.\u0275dir=se({type:t,inputs:{label:"label"},features:[jo]}),t})();const iv=new oi("MatOptgroup");let rv=0;class sv{constructor(t,e=!1){this.source=t,this.isUserInput=e}}let ov=(()=>{class t{constructor(t,e,n,i){this._element=t,this._changeDetectorRef=e,this._parent=n,this.group=i,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+rv++,this.onSelectionChange=new Rc,this._stateChanges=new P}get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(t){this._disabled=md(t)}get disableRipple(){return this._parent&&this._parent.disableRipple}get active(){return this._active}get viewValue(){return(this._getHostElement().textContent||"").trim()}select(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}deselect(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}focus(t,e){const n=this._getHostElement();"function"==typeof n.focus&&n.focus(e)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!Qp(t)&&(this._selectViaInteraction(),t.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getAriaSelected(){return this.selected||!this.multiple&&null}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){const t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue=t,this._stateChanges.next())}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(t=!1){this.onSelectionChange.emit(new sv(this,t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(void 0),ea(nv))},t.\u0275dir=se({type:t,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),t})(),av=(()=>{class t extends ov{constructor(t,e,n,i){super(t,e,n,i)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(Jy,8),ea(iv,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,e){1&t&&fa("click",function(){return e._selectViaInteraction()})("keydown",function(t){return e._handleKeydown(t)}),2&t&&(il("id",e.id),Ko("tabindex",e._getTabIndex())("aria-selected",e._getAriaSelected())("aria-disabled",e.disabled.toString()),ja("mat-selected",e.selected)("mat-option-multiple",e.multiple)("mat-active",e.active)("mat-option-disabled",e.disabled))},exportAs:["matOption"],features:[jo],ngContentSelectors:Iy,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(t,e){1&t&&(wa(),Jo(0,Ay,1,2,"mat-pseudo-checkbox",0),ra(1,"span",1),xa(2),sa(),Jo(3,Py,2,1,"span",2),oa(4,"div",3)),2&t&&(na("ngIf",e.multiple),ws(3),na("ngIf",e.group&&e.group._inert),ws(1),na("matRippleTrigger",e._getHostElement())("matRippleDisabled",e.disabled||e.disableRipple))},directives:[_h,Yy,Qy],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),t})();function lv(t,e,n){if(n.length){let i=e.toArray(),r=n.toArray(),s=0;for(let e=0;en+i?Math.max(0,t-i+e):n}let uv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Rh,Ny,Zy]]}),t})();function hv(...t){if(1===t.length){const e=t[0];if(d(e))return dv(e,null);if(p(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return dv(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return dv(t=1===t.length&&d(t[0])?t[0]:t,null).pipe(D(t=>e(...t)))}return dv(t,null)}function dv(t,e){return new C(n=>{const i=t.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=t},error:t=>n.error(t),complete:()=>{s++,(s===i||!c)&&(o===i&&n.next(e?e.reduce((t,e,n)=>(t[e]=r[n],t),{}):r),n.complete())}}))}})}function pv(t){return function(e){const n=new fv(t),i=e.lift(n);return n.caught=i}}class fv{constructor(t){this.selector=t}call(t,e){return e.subscribe(new gv(t,this.selector,this.caught))}}class gv extends ${constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const i=new H(this);this.add(i);const r=G(n,i);r!==i&&this.add(r)}}}function mv(t){return e=>e.lift(new bv(t))}class bv{constructor(t){this.callback=t}call(t,e){return e.subscribe(new yv(t,this.callback))}}class yv extends v{constructor(t,e){super(t),this.add(new g(e))}}class vv{}class _v{}class wv{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),i=n.toLowerCase(),r=t.slice(e+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const i=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(e,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof wv?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new wv;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof wv?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const i=("a"===t.op?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":const r=t.value;if(r){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===r.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}}class xv{encodeKey(t){return Cv(t)}encodeValue(t){return Cv(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const Sv=/%(\d[a-f0-9])/gi,Ev={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Cv(t){return encodeURIComponent(t).replace(Sv,(t,e)=>{var n;return null!==(n=Ev[e])&&void 0!==n?n:t})}function Ov(t){return`${t}`}class Tv{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new xv,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(t=>{const i=t.indexOf("="),[r,s]=-1==i?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,i)),e.decodeValue(t.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){const e=[];return Object.keys(t).forEach(n=>{const i=t[n];Array.isArray(i)?i.forEach(t=>{e.push({param:n,value:t,op:"a"})}):e.push({param:n,value:i,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Tv({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(Ov(t.value)),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(Ov(t.value));-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}class kv{constructor(){this.map=new Map}set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}keys(){return this.map.keys()}}function Av(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function Pv(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Iv(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Mv{constructor(t,e,n,i){let r;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.context&&(this.context=r.context),r.params&&(this.params=r.params)),this.headers||(this.headers=new wv),this.context||(this.context=new kv),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),l)),t.setParams&&(c=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),c)),new Mv(n,i,s,{params:c,headers:l,context:u,reportProgress:a,responseType:r,withCredentials:o})}}var Dv=(()=>((Dv=Dv||{})[Dv.Sent=0]="Sent",Dv[Dv.UploadProgress=1]="UploadProgress",Dv[Dv.ResponseHeader=2]="ResponseHeader",Dv[Dv.DownloadProgress=3]="DownloadProgress",Dv[Dv.Response=4]="Response",Dv[Dv.User=5]="User",Dv))();class Rv{constructor(t,e=200,n="OK"){this.headers=t.headers||new wv,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class Nv extends Rv{constructor(t={}){super(t),this.type=Dv.ResponseHeader}clone(t={}){return new Nv({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class Lv extends Rv{constructor(t={}){super(t),this.type=Dv.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new Lv({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class jv extends Rv{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function Fv(t,e){return{body:e,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let Bv=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Mv)i=t;else{let r,s;r=n.headers instanceof wv?n.headers:new wv(n.headers),n.params&&(s=n.params instanceof Tv?n.params:new Tv({fromObject:n.params})),i=new Mv(t,e,void 0!==n.body?n.body:null,{headers:r,context:n.context,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const r=wd(i).pipe(function(t,e){return W(t,e,1)}(t=>this.handler.handle(t)));if(t instanceof Mv||"events"===n.observe)return r;const s=r.pipe(Hd(t=>t instanceof Lv));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return s.pipe(D(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return s.pipe(D(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return s.pipe(D(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return s.pipe(D(t=>t.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new Tv).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,Fv(n,e))}post(t,e,n={}){return this.request("POST",t,Fv(n,e))}put(t,e,n={}){return this.request("PUT",t,Fv(n,e))}}return t.\u0275fac=function(e){return new(e||t)(Ci(vv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Vv{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const zv=new oi("HTTP_INTERCEPTORS");let Uv=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Hv=/^\)\]\}',?\n/;let $v=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new C(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const i=t.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const e=1223===n.status?204:n.status,i=n.statusText||"OK",s=new wv(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return r=new Nv({headers:s,status:e,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),l=null;204!==r&&(l=void 0===n.response?n.responseText:n.response),0===r&&(r=l?200:0);let c=r>=200&&r<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(Hv,"");try{l=""!==l?JSON.parse(l):null}catch(u){l=t,c&&(c=!1,l={error:u,text:l})}}c?(e.next(new Lv({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new jv({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new jv({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});e.error(r)};let l=!1;const c=i=>{l||(e.next(s()),l=!0);let r={type:Dv.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===t.responseType&&!!n.responseText&&(r.partialText=n.responseText),e.next(r)},u=t=>{let n={type:Dv.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),n.addEventListener("timeout",a),n.addEventListener("abort",a),t.reportProgress&&(n.addEventListener("progress",c),null!==i&&n.upload&&n.upload.addEventListener("progress",u)),n.send(i),e.next({type:Dv.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("abort",a),n.removeEventListener("load",o),n.removeEventListener("timeout",a),t.reportProgress&&(n.removeEventListener("progress",c),null!==i&&n.upload&&n.upload.removeEventListener("progress",u)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(Ci(jh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Gv=new oi("XSRF_COOKIE_NAME"),Wv=new oi("XSRF_HEADER_NAME");class qv{}let Xv=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=gh(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(ou),Ci(Gv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Yv=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const i=this.tokenService.getToken();return null!==i&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,i)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(qv),Ci(Wv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Kv=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(zv,[]);this.chain=t.reduceRight((t,e)=>new Vv(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(_v),Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Qv=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:Yv,useClass:Uv}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:Gv,useValue:e.cookieName}:[],e.headerName?{provide:Wv,useValue:e.headerName}:[]]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Yv,{provide:zv,useExisting:Yv,multi:!0},{provide:qv,useClass:Xv},{provide:Gv,useValue:"XSRF-TOKEN"},{provide:Wv,useValue:"X-XSRF-TOKEN"}]}),t})(),Zv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Bv,{provide:vv,useClass:Kv},$v,{provide:_v,useExisting:$v}],imports:[[Qv.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();const Jv=["*"];function t_(t){return Error(`Unable to find icon with the name "${t}"`)}function e_(t){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${t}".`)}function n_(t){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${t}".`)}class i_{constructor(t,e,n){this.url=t,this.svgText=e,this.options=n}}let r_=(()=>{class t{constructor(t,e,n,i){this._httpClient=t,this._sanitizer=e,this._errorHandler=i,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=n}addSvgIcon(t,e,n){return this.addSvgIconInNamespace("",t,e,n)}addSvgIconLiteral(t,e,n){return this.addSvgIconLiteralInNamespace("",t,e,n)}addSvgIconInNamespace(t,e,n,i){return this._addSvgIconConfig(t,e,new i_(n,null,i))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,e,n,i){const r=this._sanitizer.sanitize(yr.HTML,n);if(!r)throw n_(n);return this._addSvgIconConfig(t,e,new i_("",r,i))}addSvgIconSet(t,e){return this.addSvgIconSetInNamespace("",t,e)}addSvgIconSetLiteral(t,e){return this.addSvgIconSetLiteralInNamespace("",t,e)}addSvgIconSetInNamespace(t,e,n){return this._addSvgIconSetConfig(t,new i_(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){const i=this._sanitizer.sanitize(yr.HTML,e);if(!i)throw n_(e);return this._addSvgIconSetConfig(t,new i_("",i,n))}registerFontClassAlias(t,e=t){return this._fontCssClassesByAlias.set(t,e),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const e=this._sanitizer.sanitize(yr.RESOURCE_URL,t);if(!e)throw e_(t);const n=this._cachedIconsByUrl.get(e);return n?wd(s_(n)):this._loadSvgIconFromConfig(new i_(t,null)).pipe($f(t=>this._cachedIconsByUrl.set(e,t)),D(t=>s_(t)))}getNamedSvgIcon(t,e=""){const n=o_(e,t);let i=this._svgIconConfigs.get(n);if(i)return this._getSvgFromConfig(i);if(i=this._getIconConfigFromResolvers(e,t),i)return this._svgIconConfigs.set(n,i),this._getSvgFromConfig(i);const r=this._iconSetConfigs.get(e);return r?this._getSvgFromIconSetConfigs(t,r):ip(t_(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?wd(s_(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(D(t=>s_(t)))}_getSvgFromIconSetConfigs(t,e){const n=this._extractIconWithNameFromAnySet(t,e);return n?wd(n):hv(e.filter(t=>!t.svgText).map(t=>this._loadSvgIconSetFromConfig(t).pipe(pv(e=>{const n=`Loading icon set URL: ${this._sanitizer.sanitize(yr.RESOURCE_URL,t.url)} failed: ${e.message}`;return this._errorHandler.handleError(new Error(n)),wd(null)})))).pipe(D(()=>{const n=this._extractIconWithNameFromAnySet(t,e);if(!n)throw t_(t);return n}))}_extractIconWithNameFromAnySet(t,e){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.svgText&&i.svgText.indexOf(t)>-1){const e=this._svgElementFromConfig(i),n=this._extractSvgIconFromSet(e,t,i.options);if(n)return n}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe($f(e=>t.svgText=e),D(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?wd(null):this._fetchIcon(t).pipe($f(e=>t.svgText=e))}_extractSvgIconFromSet(t,e,n){const i=t.querySelector(`[id="${e}"]`);if(!i)return null;const r=i.cloneNode(!0);if(r.removeAttribute("id"),"svg"===r.nodeName.toLowerCase())return this._setSvgAttributes(r,n);if("symbol"===r.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(r),n);const s=this._svgElementFromString("");return s.appendChild(r),this._setSvgAttributes(s,n)}_svgElementFromString(t){const e=this._document.createElement("DIV");e.innerHTML=t;const n=e.querySelector("svg");if(!n)throw Error(" tag not found");return n}_toSvgElement(t){const e=this._svgElementFromString(""),n=t.attributes;for(let i=0;ithis._inProgressUrlFetches.delete(s)),at());return this._inProgressUrlFetches.set(s,a),a}_addSvgIconConfig(t,e,n){return this._svgIconConfigs.set(o_(t,e),n),this}_addSvgIconSetConfig(t,e){const n=this._iconSetConfigs.get(t);return n?n.push(e):this._iconSetConfigs.set(t,[e]),this}_svgElementFromConfig(t){if(!t.svgElement){const e=this._svgElementFromString(t.svgText);this._setSvgAttributes(e,t.options),t.svgElement=e}return t.svgElement}_getIconConfigFromResolvers(t,e){for(let n=0;ne?e.pathname+e.search:""}}}),u_=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],h_=u_.map(t=>`[${t}]`).join(", "),d_=/^url\(['"]?#(.*?)['"]?\)$/;let p_=(()=>{class t extends l_{constructor(t,e,n,i,r){super(t),this._iconRegistry=e,this._location=i,this._errorHandler=r,this._inline=!1,this._currentIconFetch=g.EMPTY,n||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=md(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){const e=this._cleanupFontValue(t);e!==this._fontSet&&(this._fontSet=e,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const e=this._cleanupFontValue(t);e!==this._fontIcon&&(this._fontIcon=e,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const e=t.split(":");switch(e.length){case 1:return["",e[0]];case 2:return e;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const t=this._location.getPathname();t!==this._previousPath&&(this._previousPath=t,this._prependPathToReferences(t))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const e=t.querySelectorAll("style");for(let i=0;i{e.forEach(e=>{n.setAttribute(e.name,`url('${t}#${e.value}')`)})})}_cacheChildrenWithExternalReferences(t){const e=t.querySelectorAll(h_),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let i=0;i{const r=e[i],s=r.getAttribute(t),o=s?s.match(d_):null;if(o){let e=n.get(r);e||(e=[],n.set(r,e)),e.push({name:t,value:o[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[e,n]=this._splitIconName(t);e&&(this._svgNamespace=e),n&&(this._svgName=n),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(n,e).pipe(Gp(1)).subscribe(t=>this._setSvgElement(t),t=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${e}:${n}! ${t.message}`))})}}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(r_),ii("aria-hidden"),ea(c_),ea(kr))},t.\u0275cmp=Jt({type:t,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,e){2&t&&(Ko("data-mat-icon-type",e._usingFontIcon()?"font":"svg")("data-mat-icon-name",e._svgName||e.fontIcon)("data-mat-icon-namespace",e._svgNamespace||e.fontSet),ja("mat-icon-inline",e.inline)("mat-icon-no-color","primary"!==e.color&&"accent"!==e.color&&"warn"!==e.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[jo],ngContentSelectors:Jv,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:[".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0}),t})(),f_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny],Ny]}),t})();const g_=["mat-button",""],m_=["*"],b_=".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n",y_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],v_=jy(Ly(Fy(class{constructor(t){this._elementRef=t}})));let __=(()=>{class t extends v_{constructor(t,e,n){super(t),this._focusMonitor=e,this._animationMode=n,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const i of y_)this._hasHostAttributes(i)&&this._getHostElement().classList.add(i);t.nativeElement.classList.add("mat-button-base"),this.isRoundButton&&(this.color="accent")}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}focus(t,e){t?this._focusMonitor.focusVia(this._getHostElement(),t,e):this._getHostElement().focus(e)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(t=>this._getHostElement().hasAttribute(t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Ig),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-icon-button",""],["button","mat-fab",""],["button","mat-mini-fab",""],["button","mat-stroked-button",""],["button","mat-flat-button",""]],viewQuery:function(t,e){if(1&t&&qc(Yy,5),2&t){let t;Wc(t=Yc())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,e){2&t&&(Ko("disabled",e.disabled||null),ja("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-button-disabled",e.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[jo],attrs:g_,ngContentSelectors:m_,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,e){1&t&&(wa(),ra(0,"span",0),xa(1),sa(),oa(2,"span",1),oa(3,"span",2)),2&t&&(ws(2),ja("mat-button-ripple-round",e.isRoundButton||e.isIconButton),na("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",e.isIconButton)("matRippleTrigger",e._getHostElement()))},directives:[Yy],styles:[b_],encapsulation:2,changeDetection:0}),t})(),w_=(()=>{class t extends __{constructor(t,e,n){super(e,t,n)}_haltDisabledEvents(t){this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}}return t.\u0275fac=function(e){return new(e||t)(ea(Ig),ea(kl),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["a","mat-button",""],["a","mat-raised-button",""],["a","mat-icon-button",""],["a","mat-fab",""],["a","mat-mini-fab",""],["a","mat-stroked-button",""],["a","mat-flat-button",""]],hostAttrs:[1,"mat-focus-indicator"],hostVars:7,hostBindings:function(t,e){1&t&&fa("click",function(t){return e._haltDisabledEvents(t)}),2&t&&(Ko("tabindex",e.disabled?-1:e.tabIndex||0)("disabled",e.disabled||null)("aria-disabled",e.disabled.toString()),ja("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-button-disabled",e.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex"},exportAs:["matButton","matAnchor"],features:[jo],attrs:g_,ngContentSelectors:m_,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,e){1&t&&(wa(),ra(0,"span",0),xa(1),sa(),oa(2,"span",1),oa(3,"span",2)),2&t&&(ws(2),ja("mat-button-ripple-round",e.isRoundButton||e.isIconButton),na("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",e.isIconButton)("matRippleTrigger",e._getHostElement()))},directives:[Yy],styles:[b_],encapsulation:2,changeDetection:0}),t})(),x_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Ny],Ny]}),t})();class S_ extends v{notifyNext(t,e,n,i,r){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}class E_ extends v{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function C_(t,e,n,i,r=new E_(t,n,i)){if(!r.closed)return e instanceof C?e.subscribe(r):V(e)(r)}const O_={};function T_(...t){let e,n;return M(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&d(t[0])&&(t=t[0]),K(t,n).lift(new k_(e))}class k_{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new A_(t,this.resultSelector))}}class A_ extends S_{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(O_),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n{class t{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):D_}matchMedia(t){return this._platform.WEBKIT&&function(t){if(!P_.has(t))try{I_||(I_=document.createElement("style"),I_.setAttribute("type","text/css"),document.head.appendChild(I_)),I_.sheet&&(I_.sheet.insertRule(`@media ${t} {.fx-query-test{ }}`,0),P_.add(t))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp))},token:t,providedIn:"root"}),t})();function D_(t){return{matches:"all"===t||""===t,media:t,addListener:()=>{},removeListener:()=>{}}}let R_=(()=>{class t{constructor(t,e){this._mediaMatcher=t,this._zone=e,this._queries=new Map,this._destroySubject=new P}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return N_(yd(t)).some(t=>this._registerQuery(t).mql.matches)}observe(t){let e=T_(N_(yd(t)).map(t=>this._registerQuery(t).observable));return e=Yd(e.pipe(Gp(1)),e.pipe(Qf(1),qf(0))),e.pipe(D(t=>{const e={matches:!1,breakpoints:{}};return t.forEach(({matches:t,query:n})=>{e.matches=e.matches||t,e.breakpoints[n]=t}),e}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const e=this._mediaMatcher.matchMedia(t),n={observable:new C(t=>{const n=e=>this._zone.run(()=>t.next(e));return e.addListener(n),()=>{e.removeListener(n)}}).pipe(Kd(e),D(({matches:e})=>({query:t,matches:e})),Wd(this._destroySubject)),mql:e};return this._queries.set(t,n),n}}return t.\u0275fac=function(e){return new(e||t)(Ci(M_),Ci(xu))},t.\u0275prov=xt({factory:function(){return new t(Ci(M_),Ci(xu))},token:t,providedIn:"root"}),t})();function N_(t){return t.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}function L_(t,e){if(1&t){const t=ua();ra(0,"div",1),ra(1,"button",2),fa("click",function(){return $e(t),va().action()}),Za(2),sa(),sa()}if(2&t){const t=va();ws(2),Ja(t.data.action)}}function j_(t,e){}const F_=new oi("MatSnackBarData");class B_{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const V_=Math.pow(2,31)-1;class z_{constructor(t,e){this._overlayRef=e,this._afterDismissed=new P,this._afterOpened=new P,this._onAction=new P,this._dismissedByAction=!1,this.containerInstance=t,this.onAction().subscribe(()=>this.dismiss()),t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,V_))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}let U_=(()=>{class t{constructor(t,e){this.snackBarRef=t,this.data=e}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return t.\u0275fac=function(e){return new(e||t)(ea(z_),ea(F_))},t.\u0275cmp=Jt({type:t,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,e){1&t&&(ra(0,"span"),Za(1),sa(),Jo(2,L_,3,1,"div",0)),2&t&&(ws(1),Ja(e.data.message),ws(1),na("ngIf",e.hasAction))},directives:[_h,__],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),t})();const H_={snackBarState:Vg("state",[$g("void, hidden",Hg({transform:"scale(0.8)",opacity:0})),$g("visible",Hg({transform:"scale(1)",opacity:1})),Wg("* => visible",zg("150ms cubic-bezier(0, 0, 0.2, 1)")),Wg("* => void, * => hidden",zg("75ms cubic-bezier(0.4, 0.0, 1, 1)",Hg({opacity:0})))])};let $_=(()=>{class t extends Fp{constructor(t,e,n,i,r){super(),this._ngZone=t,this._elementRef=e,this._changeDetectorRef=n,this._platform=i,this.snackBarConfig=r,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new P,this._onExit=new P,this._onEnter=new P,this._animationState="void",this.attachDomPortal=t=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(t)),this._live="assertive"!==r.politeness||r.announcementMessage?"off"===r.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(t)}onAnimationEnd(t){const{fromState:e,toState:n}=t;if(("void"===n&&"void"!==e||"hidden"===n)&&this._completeExit(),"visible"===n){const t=this._onEnter;this._ngZone.run(()=>{t.next(),t.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}ngOnDestroy(){this._destroyed=!0,this._completeExit()}_completeExit(){this._ngZone.onMicrotaskEmpty.pipe(Gp(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,e=this.snackBarConfig.panelClass;e&&(Array.isArray(e)?e.forEach(e=>t.classList.add(e)):t.classList.add(e)),"center"===this.snackBarConfig.horizontalPosition&&t.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&t.classList.add("mat-snack-bar-top")}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),e=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&e){let n=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(n=document.activeElement),t.removeAttribute("aria-hidden"),e.appendChild(t),null==n||n.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(kl),ea(tc),ea(pp),ea(B_))},t.\u0275cmp=Jt({type:t,selectors:[["snack-bar-container"]],viewQuery:function(t,e){if(1&t&&qc(Up,7),2&t){let t;Wc(t=Yc())&&(e._portalOutlet=t.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,e){1&t&&ga("@state.done",function(t){return e.onAnimationEnd(t)}),2&t&&rl("@state",e._animationState)},features:[jo],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,e){1&t&&(ra(0,"div",0),Jo(1,j_,0,0,"ng-template",1),sa(),oa(2,"div")),2&t&&(ws(2),Ko("aria-live",e._live)("role",e._role))},directives:[Up],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[H_.snackBarState]}}),t})(),G_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rf,Hp,Rh,x_,Ny],Ny]}),t})();const W_=new oi("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new B_}});let q_=(()=>{class t{constructor(t,e,n,i,r,s){this._overlay=t,this._live=e,this._injector=n,this._breakpointObserver=i,this._parentSnackBar=r,this._defaultConfig=s,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=U_,this.snackBarContainerComponent=$_,this.handsetCssClass="mat-snack-bar-handset"}get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}openFromComponent(t,e){return this._attach(t,e)}openFromTemplate(t,e){return this._attach(t,e)}open(t,e="",n){const i=Object.assign(Object.assign({},this._defaultConfig),n);return i.data={message:t,action:e},i.announcementMessage===t&&(i.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,i)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,e){const n=No.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:B_,useValue:e}]}),i=new Np(this.snackBarContainerComponent,e.viewContainerRef,n),r=t.attach(i);return r.instance.snackBarConfig=e,r.instance}_attach(t,e){const n=Object.assign(Object.assign(Object.assign({},new B_),this._defaultConfig),e),i=this._createOverlay(n),r=this._attachSnackBarContainer(i,n),s=new z_(r,i);if(t instanceof sc){const e=new Lp(t,null,{$implicit:n.data,snackBarRef:s});s.instance=r.attachTemplatePortal(e)}else{const e=this._createInjector(n,s),i=new Np(t,void 0,e),o=r.attachComponentPortal(i);s.instance=o.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(Wd(i.detachments())).subscribe(t=>{const e=i.overlayElement.classList;t.matches?e.add(this.handsetCssClass):e.remove(this.handsetCssClass)}),n.announcementMessage&&r._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(s,n),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(t,e){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),e.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),e.duration&&e.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(e.duration))}_createOverlay(t){const e=new af;e.direction=t.direction;let n=this._overlay.position().global();const i="rtl"===t.direction,r="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!i||"end"===t.horizontalPosition&&i,s=!r&&"center"!==t.horizontalPosition;return r?n.left("0"):s?n.right("0"):n.centerHorizontally(),"top"===t.verticalPosition?n.top("0"):n.bottom("0"),e.positionStrategy=n,this._overlay.create(e)}_createInjector(t,e){return No.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:z_,useValue:e},{provide:F_,useValue:t.data}]})}}return t.\u0275fac=function(e){return new(e||t)(Ci(kf),Ci(kg),Ci(No),Ci(R_),Ci(t,12),Ci(W_))},t.\u0275prov=xt({factory:function(){return new t(Ci(kf),Ci(kg),Ci(_o),Ci(R_),Ci(t,12),Ci(W_))},token:t,providedIn:G_}),t})();const X_={tooltipState:Vg("state",[$g("initial, void, hidden",Hg({opacity:0,transform:"scale(0)"})),$g("visible",Hg({transform:"scale(1)"})),Wg("* => visible",zg("200ms cubic-bezier(0, 0, 0.2, 1)",Gg([Hg({opacity:0,transform:"scale(0)",offset:0}),Hg({opacity:.5,transform:"scale(0.99)",offset:.5}),Hg({opacity:1,transform:"scale(1)",offset:1})]))),Wg("* => hidden",zg("100ms cubic-bezier(0, 0, 0.2, 1)",Hg({opacity:0})))])},Y_="tooltip-panel",K_=_p({passive:!0}),Q_=new oi("mat-tooltip-scroll-strategy"),Z_={provide:Q_,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition({scrollThrottle:20})}},J_=new oi("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let tw=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u,h){this._overlay=t,this._elementRef=e,this._scrollDispatcher=n,this._viewContainerRef=i,this._ngZone=r,this._platform=s,this._ariaDescriber=o,this._focusMonitor=a,this._dir=c,this._defaultOptions=u,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new P,this._handleKeydown=t=>{this._isTooltipVisible()&&27===t.keyCode&&!Qp(t)&&(t.preventDefault(),t.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=l,this._document=h,u&&(u.position&&(this.position=u.position),u.touchGestures&&(this.touchGestures=u.touchGestures)),c.change.pipe(Wd(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),r.runOutsideAngular(()=>{e.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var e;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(e=this._tooltipInstance)||void 0===e||e.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}get message(){return this._message}set message(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")})}))}get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(Wd(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),t.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(([e,n])=>{t.removeEventListener(e,n,K_)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay){if(this.disabled||!this.message||this._isTooltipVisible()&&!this._tooltipInstance._showTimeoutId&&!this._tooltipInstance._hideTimeoutId)return;const e=this._createOverlay();this._detach(),this._portal=this._portal||new Np(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=e.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(Wd(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}hide(t=this.hideDelay){this._tooltipInstance&&this._tooltipInstance.hide(t)}toggle(){this._isTooltipVisible()?this.hide():this.show()}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(){if(this._overlayRef)return this._overlayRef;const t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),e=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return e.positionChanges.pipe(Wd(this._destroyed)).subscribe(t=>{this._updateCurrentPositionClass(t.connectionPair),this._tooltipInstance&&t.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:e,panelClass:`${this._cssClassPrefix}-${Y_}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Wd(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Wd(this._destroyed)).subscribe(()=>{var t;return null===(t=this._tooltipInstance)||void 0===t?void 0:t._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const e=t.getConfig().positionStrategy,n=this._getOrigin(),i=this._getOverlayPosition();e.withPositions([this._addOffset(Object.assign(Object.assign({},n.main),i.main)),this._addOffset(Object.assign(Object.assign({},n.fallback),i.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,e=this.position;let n;"above"==e||"below"==e?n={originX:"center",originY:"above"==e?"top":"bottom"}:"before"==e||"left"==e&&t||"right"==e&&!t?n={originX:"start",originY:"center"}:("after"==e||"right"==e&&t||"left"==e&&!t)&&(n={originX:"end",originY:"center"});const{x:i,y:r}=this._invertPosition(n.originX,n.originY);return{main:n,fallback:{originX:i,originY:r}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,e=this.position;let n;"above"==e?n={overlayX:"center",overlayY:"bottom"}:"below"==e?n={overlayX:"center",overlayY:"top"}:"before"==e||"left"==e&&t||"right"==e&&!t?n={overlayX:"end",overlayY:"center"}:("after"==e||"right"==e&&t||"left"==e&&!t)&&(n={overlayX:"start",overlayY:"center"});const{x:i,y:r}=this._invertPosition(n.overlayX,n.overlayY);return{main:n,fallback:{overlayX:i,overlayY:r}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(Gp(1),Wd(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,e){return"above"===this.position||"below"===this.position?"top"===e?e="bottom":"bottom"===e&&(e="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){const{overlayY:e,originX:n,originY:i}=t;let r;if(r="center"===e?this._dir&&"rtl"===this._dir.value?"end"===n?"left":"right":"start"===n?"left":"right":"bottom"===e&&"top"===i?"above":"below",r!==this._currentPosition){const t=this._overlayRef;if(t){const e=`${this._cssClassPrefix}-${Y_}-`;t.removePanelClass(e+this._currentPosition),t.addPanelClass(e+r)}this._currentPosition=r}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",()=>{this._setupPointerExitEventsIfNeeded(),this.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",()=>{this._setupPointerExitEventsIfNeeded(),clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>this.show(),500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",()=>this.hide()],["wheel",t=>this._wheelListener(t)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const e=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",e],["touchcancel",e])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([t,e])=>{this._elementRef.nativeElement.addEventListener(t,e,K_)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const e=this._document.elementFromPoint(t.clientX,t.clientY),n=this._elementRef.nativeElement;e!==n&&!n.contains(e)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const e=this._elementRef.nativeElement,n=e.style;("on"===t||"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName)&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),("on"===t||!e.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(Pp),ea(hc),ea(xu),ea(pp),ea(hg),ea(Ig),ea(void 0),ea(Op),ea(void 0),ea(Yu))},t.\u0275dir=se({type:t,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),t})(),ew=(()=>{class t extends tw{constructor(t,e,n,i,r,s,o,a,l,c,u,h){super(t,e,n,i,r,s,o,a,l,c,u,h),this._tooltipComponent=iw}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(Pp),ea(hc),ea(xu),ea(pp),ea(hg),ea(Ig),ea(Q_),ea(Op,8),ea(J_,8),ea(Yu))},t.\u0275dir=se({type:t,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[jo]}),t})(),nw=(()=>{class t{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new P}show(t){clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(()=>{this._visibility="visible",this._showTimeoutId=void 0,this._onShow(),this._markForCheck()},t)}hide(t){clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._visibility="hidden",this._hideTimeoutId=void 0,this._markForCheck()},t)}afterHidden(){return this._onHide}isVisible(){return"visible"===this._visibility}ngOnDestroy(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}_animationStart(){this._closeOnInteraction=!1}_animationDone(t){const e=t.toState;"hidden"===e&&!this.isVisible()&&this._onHide.next(),("visible"===e||"hidden"===e)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return t.\u0275fac=function(e){return new(e||t)(ea(tc))},t.\u0275dir=se({type:t}),t})(),iw=(()=>{class t extends nw{constructor(t,e){super(t),this._breakpointObserver=e,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(R_))},t.\u0275cmp=Jt({type:t,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,e){2&t&&La("zoom","visible"===e._visibility?1:null)},features:[jo],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,e){if(1&t&&(ra(0,"div",0),fa("@state.start",function(){return e._animationStart()})("@state.done",function(t){return e._animationDone(t)}),Ic(1,"async"),Za(2),sa()),2&t){let t;ja("mat-tooltip-handset",null==(t=Mc(1,5,e._isHandset))?null:t.matches),na("ngClass",e.tooltipClass)("@state",e._visibility),ws(2),Ja(e.message)}},directives:[mh],pipes:[Dh],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[X_.tooltipState]},changeDetection:0}),t})(),rw=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Z_],imports:[[Lg,Rh,Rf,Ny],Ny,Mp]}),t})();function sw(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}function ow(t,e){return function(n,i){e(n,i,t)}}function aw(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function lw(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(e){s(e)}}function a(t){try{l(i.throw(t))}catch(e){s(e)}}function l(t){t.done?r(t.value):function(t){return t instanceof n?t:new n(function(e){e(t)})}(t.value).then(o,a)}l((i=i.apply(t,e||[])).next())})}function cw(t){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)}function uw(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||cw()}const hw="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",dw=uw();class pw{constructor(t,e,n="sessionStorage"){this.storage=function(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(t){return null}}(n),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){return this.config={},this.updateConfiguration(t)}updateConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function fw(t,e,n,i=600){const r=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>i&&(n=Math.min(n,i/t.width));const s=t.width*n,o=t.height*n,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const gw={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function mw(t){return"string"==typeof t?gw[t.toUpperCase()]||gw.WHITE:t}function bw(t,e){if(!t)throw new Error(e||"Assertion failed")}const yw={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},vw=yw.window||yw.self||yw.global,_w=yw.process||{};function ww(){let t;if(dw&&vw.performance)t=vw.performance.now();else if(_w.hrtime){const e=_w.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}console;const xw={debug:dw&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Sw={enabled:!0,level:0};function Ew(){}const Cw={},Ow={once:!0};function Tw(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}let kw=(()=>{class t{constructor({id:t}={id:""}){this.id=t,this.VERSION=hw,this._startTs=ww(),this._deltaTs=ww(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new pw("__probe-".concat(this.id,"__"),Sw),this.userData={},this.timeStamp("".concat(this.id," started")),function(t,e=["constructor"]){const n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n);for(const r of i)"function"==typeof t[r]&&(e.find(t=>r===t)||(t[r]=t[r].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((ww()-this._startTs).toPrecision(10))}getDelta(){return Number((ww()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,e){bw(t,e)}warn(t){return this._getLogFunction(0,t,xw.warn,arguments,Ow)}error(t){return this._getLogFunction(0,t,xw.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,xw.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,xw.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,xw.debug||xw.info,arguments,Ow)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||Ew,n&&[n],{tag:Tw(e)}):Ew}image({logLevel:t,priority:e,image:i,message:r="",scale:s=1}){return this._shouldLog(t||e)?dw?function({image:t,message:e="",scale:n=1}){if("string"==typeof t){const i=new Image;return i.onload=()=>{const t=fw(i,e,n);console.log(...t)},i.src=t,Ew}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...fw(t,e,n)),Ew;if("canvas"===i.toLowerCase()){const i=new Image;return i.onload=()=>console.log(...fw(i,e,n)),i.src=t.toDataURL(),Ew}return Ew}({image:i,message:r,scale:s}):function({image:t,message:e="",scale:r=1}){let s=null;try{s=n(75307)}catch(i){}return s?()=>s(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(t=>console.log(t)):Ew}({image:i,message:r,scale:s}):Ew}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,e){this._storage.updateConfiguration({[t]:e})}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||Ew)}group(t,e,n={collapsed:!1}){n=Pw({logLevel:t,message:e,opts:n});const{collapsed:i}=n;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,e,n={}){return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Ew)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Aw(t)}_getLogFunction(t,e,n,i=[],r){if(this._shouldLog(t)){r=Pw({logLevel:t,message:e,args:i,opts:r}),bw(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=ww();const s=r.tag||r.message;if(r.once){if(Cw[s])return Ew;Cw[s]=ww()}return e=function(t,e,n){if("string"==typeof e){const i=n.time?function(t,e=8){const n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(n.total)):"";e=function(t,e,n){return!dw&&"string"==typeof t&&(e&&(e=mw(e),t="\x1b[".concat(e,"m").concat(t,"\x1b[39m")),n&&(e=mw(n),t="\x1b[".concat(n+10,"m").concat(t,"\x1b[49m"))),t}(e=n.time?"".concat(t,": ").concat(i," ").concat(e):"".concat(t,": ").concat(e),n.color,n.background)}return e}(this.id,r.message,r),n.bind(console,e,...r.args)}return Ew}}return t.VERSION=hw,t})();function Aw(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return bw(Number.isFinite(e)&&e>=0),e}function Pw(t){const{logLevel:e,message:n}=t;t.logLevel=Aw(e);const i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==n;);switch(t.args=i,typeof e){case"string":case"function":void 0!==n&&i.unshift(n),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());const r=typeof t.message;return bw("string"===r||"object"===r),Object.assign(t,t.opts)}var Iw=new kw({id:"deck"});const Mw={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mw,"IDENTITY",{get:()=>Iw.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Dw={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Rw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Nw=new kw({id:"luma.gl"});function Lw(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function jw(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version))}function Fw(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function Bw(t){return Lw(jw(t),"Invalid WebGLRenderingContext"),t}function Vw(t){return Lw(Fw(t),"Requires WebGL2"),t}var zw=n(84761);const Uw={};const Hw=function t(e){const n=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{zw.CO.console&&zw.CO.console.log&&zw.CO.console.log("OESVertexArrayObject emulation library context restored"),e.reset_()},!0),this.reset_()};$w.prototype.VERTEX_ARRAY_BINDING_OES=34229,$w.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;tFw(t)?void 0:0,Yw={3074:t=>Fw(t)?void 0:36064,35723:t=>Fw(t)?void 0:4352,35977:Xw,32937:Xw,36795:(t,e)=>{const n=Fw(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?e(n.GPU_DISJOINT_EXT):0},37445:(t,e)=>{const n=t.getExtension(qw);return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const n=t.getExtension(qw);return e(n&&n.UNMASKED_RENDERER_WEBGL||7937)},34047:(t,e)=>{const n=t.luma.extensions.EXT_texture_filter_anisotropic;return n?e(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:Xw,35071:Xw,37447:Xw,36063:(t,e)=>{if(!Fw(t)){const n=t.getExtension(Ww);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Xw,35374:Xw,35377:Xw,34852:t=>{if(!Fw(t)){const e=t.getExtension(Ww);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(Gw)?2147483647:65535,33001:t=>t.getExtension(Gw)?16777216:65535,33e3:t=>16777216,37157:Xw,35373:Xw,35657:Xw,36183:Xw,37137:Xw,34045:Xw,35978:Xw,35979:Xw,35968:Xw,35376:Xw,35375:Xw,35659:Xw,37154:Xw,35371:Xw,35658:Xw,35076:Xw,35077:Xw,35380:Xw},Kw="ANGLE_instanced_arrays",Qw={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Lw(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[Kw]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){Lw(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Lw(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Lw(!1)},deleteQuery:()=>{Lw(!1)},beginQuery:()=>{Lw(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},Zw={readBuffer:(t,e,n)=>{Fw(t)&&e(n)},getVertexAttrib:(t,e,n,i)=>{const{webgl2:r,ext:s}=function(t,e){return{webgl2:Fw(t),ext:t.getExtension("ANGLE_instanced_arrays")}}(t);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(n,i)},getProgramParameter:(t,e,n,i)=>{if(!Fw(t))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,i)},getInternalformatParameter:(t,e,n,i,r)=>{if(!Fw(t))switch(r){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(n,i,r)},getTexParameter(t,e,n,i){switch(i){case 34046:const{extensions:e}=t.luma,n=e.EXT_texture_filter_anisotropic;i=n&&n.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(n,i)},getParameter:function(t,e,n){const i=Yw[n],r="function"==typeof i?i(t,e,n):i;return void 0!==r?r:e(n)},hint:(t,e,n,i)=>e(n,i)};function Jw(t,{extension:e,target:n,target2:i}){const r=Qw[e];Lw(r);const{meta:s={}}=r,{suffix:o=""}=s,a=t.getExtension(e);for(const l of Object.keys(r)){const e=`${l}${o}`;let s=null;"meta"===l||"function"==typeof t[l]||(a&&"function"==typeof a[e]?s=(...t)=>a[e](...t):"function"==typeof r[l]&&(s=r[l].bind(n))),s&&(n[l]=s,i[l]=s)}}("undefined"!=typeof global?global:window).polyfillContext=function(t){t.luma=t.luma||{};const{luma:e}=t;return e.polyfilled||(function(t){if("function"==typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const n=t.getExtension;t.getExtension=function(e){return n.call(this,e)||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new $w(this)),this.__OESVertexArrayObject))}}(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const n of e)t.luma[n]=t.getExtension(n)}(t),function(t,e){for(const n of Object.getOwnPropertyNames(e))"overrides"!==n&&Jw(t,{extension:n,target:t.luma,target2:t})}(t,Qw),function(t,{target:e,target2:n}){Object.keys(Zw).forEach(i=>{if("function"==typeof Zw[i]){const r=t[i]?t[i].bind(t):()=>{},s=Zw[i].bind(null,t,r);e[i]=s,n[i]=s}})}(t,{target:e,target2:t}),e.polyfilled=!0),t};const tx={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ex=(t,e,n)=>e?t.enable(n):t.disable(n),nx=(t,e,n)=>t.hint(n,e),ix=(t,e,n)=>t.pixelStorei(n,e);function rx(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const sx={3042:ex,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:ex,2885:(t,e)=>t.cullFace(e),2929:ex,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:ex,35723:nx,36006:(t,e)=>{const n=Fw(t)?36009:36160;return t.bindFramebuffer(n,e)},2886:(t,e)=>t.frontFace(e),33170:nx,2849:(t,e)=>t.lineWidth(e),32823:ex,32824:"polygonOffset",10752:"polygonOffset",35977:ex,32938:"sampleCoverage",32939:"sampleCoverage",3089:ex,3088:(t,e)=>t.scissor(...e),2960:ex,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:ix,3317:ix,37440:ix,37441:ix,37443:ix,3330:ix,3332:ix,3331:ix,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:ix,32878:ix,3316:ix,3315:ix,32877:ix,framebuffer:(t,e)=>t.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=rx(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=rx(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=rx(e)?e:[e,e];const[n,i]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=rx(e)&&3===e.length?[...e,...e]:e;const[n,i,r,s,o,a]=e;t.stencilFuncSeparate(1028,n,i,r),t.stencilFuncSeparate(1029,s,o,a)},stencilOp:(t,e)=>{e=rx(e)&&3===e.length?[...e,...e]:e;const[n,i,r,s,o,a]=e;t.stencilOpSeparate(1028,n,i,r),t.stencilOpSeparate(1029,s,o,a)},viewport:(t,e)=>t.viewport(...e)};function ox(t,e,n){return void 0!==e[t]?e[t]:n[t]}const ax={blendEquation:(t,e,n)=>t.blendEquationSeparate(ox(32777,e,n),ox(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(ox(32969,e,n),ox(32968,e,n),ox(32971,e,n),ox(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(ox(32824,e,n),ox(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(ox(32938,e,n),ox(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,ox(2962,e,n),ox(2967,e,n),ox(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,ox(34816,e,n),ox(36003,e,n),ox(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,ox(2964,e,n),ox(2965,e,n),ox(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,ox(34817,e,n),ox(34818,e,n),ox(34819,e,n))},lx={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},blendColor:(t,e,n,i,r)=>t({32773:new Float32Array([e,n,i,r])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,i,r)=>t({32969:e,32968:n,32971:i,32970:r}),clearColor:(t,e,n,i,r)=>t({3106:new Float32Array([e,n,i,r])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,i,r)=>t({3107:[e,n,i,r]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,i,r)=>t({3088:new Int32Array([e,n,i,r])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[1028===e?2968:36005]:n}),stencilFunc:(t,e,n,i)=>t({2962:e,2967:n,2963:i,34816:e,36003:n,36004:i}),stencilFuncSeparate:(t,e,n,i,r)=>t({[1028===e?2962:34816]:n,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(t,e,n,i)=>t({2964:e,2965:n,2966:i,34817:e,34818:n,34819:i}),stencilOpSeparate:(t,e,n,i,r)=>t({[1028===e?2964:34817]:n,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(t,e,n,i,r)=>t({2978:[e,n,i,r]})},cx=(t,e)=>t.isEnabled(e),ux={3042:cx,2884:cx,2929:cx,3024:cx,32823:cx,32926:cx,32928:cx,3089:cx,2960:cx,35977:cx};function hx(t){for(const e in t)return!1;return!0}function dx(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&i&&t.length===e.length){for(let n=0;n{})}={}){this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?function(t,e){if("number"==typeof(e=e||tx)){const n=e,i=ux[n];return i?i(t,n):t.getParameter(n)}const n=Array.isArray(e)?e:Object.keys(e),i={};for(const r of n){const e=ux[r];i[r]=e?e(t,Number(r)):t.getParameter(Number(r))}return i}(t):Object.assign({},tx),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(t={}){this.stateStack.push({})}pop(){Lw(this.stateStack.length>0),yx(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(t){let e,n=!1;const i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const r in t){Lw(void 0!==r);const s=t[r],o=this.cache[r];dx(s,o)||(n=!0,e=o,i&&!(r in i)&&(i[r]=o),this.cache[r]=s)}return{valueChanged:n,oldValue:e}}}function mx(t,e={}){const{enable:n=!0,copyState:i}=e;if(Lw(void 0!==i),!t.state){const e="undefined"!=typeof global?global:window,{polyfillContext:n}=e;n&&n(t),t.state=new gx(t,{copyState:i}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(e(n),t.state.program=n)}}(t);for(const i in lx)fx(t,i,lx[i]);px(t,"getParameter"),px(t,"isEnabled")}return t.state.enable=n,t}function bx(t){Lw(t.state),t.state.pop()}function yx(t,e){if(Lw(jw(t),"setParameters requires a WebGL context"),hx(e))return;const n={};for(const r in e){const i=Number(r),s=sx[r];s&&("string"==typeof s?n[s]=!0:s(t,e[r],i))}const i=t.state&&t.state.cache;if(i)for(const r in n)ax[r](t,e,i)}function vx(t,e,n){if(hx(e))return n(t);const{nocatch:i=!0}=e;let r;if(function(t){t.state||mx(t,{copyState:!1}),t.state.push()}(t),yx(t,e),i)r=n(t),bx(t);else try{r=n(t)}finally{bx(t)}return r}function _x(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:n}=e.canvasSizeInfo;return n?t.drawingBufferWidth/n:1}return 1}function wx(t,e,n=!0){return function(t,e,n,i,r){const s=xx(t[0],e,n);let o=Sx(t[1],e,i,r),a=xx(t[0]+1,e,n);const l=a===n-1?a:a-1;let c;return a=Sx(t[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,_x(t),t.drawingBufferWidth,t.drawingBufferHeight,n)}function xx(t,e,n){return Math.min(Math.round(t*e),n-1)}function Sx(t,e,n,i){return i?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const Ex=(0,zw.jU)(),Cx=Ex&&"undefined"!=typeof document,Ox={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Tx(t={}){Lw(Ex,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},Ox,t);const{width:e,height:n}=t;function i(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let r;t.onError=i;const{canvas:s}=t,o=function({canvas:t,width:e=800,height:n=600,onError:i}){let r;return"string"==typeof t?(Cx&&"complete"===document.readyState||i(`createGLContext called on canvas '${t}' before page was loaded`),r=document.getElementById(t)):t?r=t:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(n)?`${n}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:n,onError:i});return r=function(t,e){const{onError:n}=e;let i=null;const r=t=>i=t.statusMessage||i;t.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||t.getContext("webgl2",e),a=a||t.getContext("experimental-webgl2",e)),s&&(a=a||t.getContext("webgl",e),a=a||t.getContext("experimental-webgl",e)),t.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):n(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,t),r?(r=kx(r,t),function(t){const e=Fw(t)?"WebGL2":"WebGL1",n=function(t){const e=t.getParameter(7936),n=t.getParameter(7937),i=t.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&t.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&t.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:e,rendererMasked:n,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t);Nw.info(1,`${e}${t.debug?" debug":""} context ${n?`(${n.vendor},${n.renderer})`:""}`)()}(r),r):null}function kx(t,e={}){if(!t||t._instrumented)return t;t._version=t._version||function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext?2:1}(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},Ox,e);const{manageState:n,debug:i}=e;return n&&mx(t,{copyState:!1,log:(...t)=>Nw.log(1,...t)()}),Ex&&i&&(zw.CO.makeDebugContext?(t=zw.CO.makeDebugContext(t,e),Nw.level=Math.max(Nw.level,1)):Nw.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function Ax(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}class Px{constructor(t,e){this.name=t,this.type=e,this.sampleSize=1,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ax(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ax()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class Ix{constructor({id:t,stats:e}){this.id=t,this.stats={},this._initializeStats(e),Object.seal(this)}get(t,e="count"){return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach(e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(t=>this._getOrCreate(t))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:n}=t;return this.stats[e]||(this.stats[e]=t instanceof Px?t:new Px(e,n)),this.stats[e]}}const Mx="8.5.7",Dx=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new Ix({id:t})),this.stats.get(t)}};if(zw.CO.luma&&zw.CO.luma.VERSION!==Mx)throw new Error(`luma.gl - multiple VERSIONs detected: ${zw.CO.luma.VERSION} vs 8.5.7`);function Rx(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Nx(t,e){if("string"!=typeof e)return e;const n=Number(e);if(!isNaN(n))return n;const i=t[e=e.replace(/^.*\./,"")];return Rx(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Lx(t,e){e=Number(e);for(const n in t)if(t[n]===e)return`GL.${n}`;return String(e)}zw.CO.luma||((0,zw.jU)()&&Nw.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),zw.CO.luma=zw.CO.luma||{VERSION:Mx,version:Mx,log:Nw,stats:Dx,globals:{modules:{},nodeIO:{}}});const jx={};function Fx(t="id"){return jx[t]=jx[t]||1,`${t}-${jx[t]++}`}function Bx(t){return Rx("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function Vx(t){let e=!0;for(const n in t){e=!1;break}return e}function zx(t,e,n,i){const r=`See luma.gl ${n} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(t);i.forEach(t=>{s.methodName||(s[t]=()=>{throw Nw.removed(`Calling removed method ${e}.${t}: `,r)(),new Error(t)})})}const Ux="Resource subclass must define virtual methods";class Hx{constructor(t,e={}){Bw(t);const{id:n,userData:i={}}=e;this.gl=t,this.gl2=t,this.id=n||Fx(this.constructor.name),this.userData=i,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:t=!1}={}){const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEach(t=>t.delete()),this}bind(t=this.handle){if("function"!=typeof t)return this._bindHandle(t),this;let e;return this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e}unbind(){this.bind(null)}getParameter(t,e={}){Rx(t=Nx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Fw(this.gl);if("webgl2"in n&&!t||"extension"in n&&!this.gl.getExtension(n.extension)){const e=n.webgl1,i="webgl2"in n?n.webgl2:n.webgl1;return t?i:e}}return this._getParameter(t,e)}getParameters(t={}){const{parameters:e,keys:n}=t,i=this.constructor.PARAMETERS||{},r=Fw(this.gl),s={},o=e||Object.keys(i);for(const a of o){const e=i[a];if(e&&(!("webgl2"in e)||r)&&(!("extension"in e)||this.gl.getExtension(e.extension))){const i=n?Lx(this.gl,a):a;s[i]=this.getParameter(a,t),n&&"GLenum"===e.type&&(s[i]=Lx(this.gl,s[i]))}}return s}setParameter(t,e){Rx(t=Nx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Fw(this.gl);if("webgl2"in n&&!t||"extension"in n&&!this.gl.getExtension(n.extension))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(e=Nx(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,n){return zx(this,t,e,n)}initialize(t){}_createHandle(){throw new Error(Ux)}_deleteHandle(){throw new Error(Ux)}_bindHandle(t){throw new Error(Ux)}_getOptsFromHandle(){throw new Error(Ux)}_getParameter(t,e){throw new Error(Ux)}_setParameter(t,e){throw new Error(Ux)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this.constructor.name,e=Dx.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}_removeStats(){const t=this.constructor.name;Dx.get("Resource Counts").get(`${t}s Active`).decrementCount()}_trackAllocatedMemory(t,e=this.constructor.name){const n=Dx.get("Memory Usage");n.get("GPU Memory").addCount(t),n.get(`${e} Memory`).addCount(t),this.byteLength=t}_trackDeallocatedMemory(t=this.constructor.name){const e=Dx.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get(`${t} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function $x(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Gx(t,{clamped:e=!0}={}){switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function Wx({data:t,width:e,height:n}){const i=Math.round(e/2),r=Math.round(n/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Kx.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Kx.getBytesPerVertex(this)}_assign(t={}){return void 0!==(t=qx("Accessor",t,Yx)).type&&(this.type=t.type,(5124===t.type||5125===t.type)&&(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&(this.index="boolean"==typeof t.index?t.index?1:0:t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}const Qx={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},Zx={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Qx},Jx={removedProps:Qx};class tS extends Hx{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(t=this.accessor){return Math.round(this.byteLength/Kx.getBytesPerElement(t))}getVertexCount(t=this.accessor){return Math.round(this.byteLength/Kx.getBytesPerVertex(t))}initialize(t={}){return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=qx("Buffer",t,Zx),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=qx("Buffer",t,Jx))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new Kx(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:n=0,srcOffset:i=0}=t,r=t.byteLength||t.length;Rx(e);const s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==i||void 0!==r?(Vw(this.gl),this.gl.bufferSubData(this.target,n,e,i,r)):this.gl.bufferSubData(s,n,e),this.gl.bindBuffer(s,null),this.debugData=null,this._inferType(e),this}copyData({sourceBuffer:t,readOffset:e=0,writeOffset:n=0,size:i}){const{gl:r}=this;return Vw(r),r.bindBuffer(36662,t.handle),r.bindBuffer(36663,this.handle),r.copyBufferSubData(36662,36663,e,n,i),r.bindBuffer(36662,null),r.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:t=null,srcByteOffset:e=0,dstOffset:n=0,length:i=0}={}){Vw(this.gl);const r=Gx(this.accessor.type||5126,{clamped:!1}),s=this._getAvailableElementCount(e),o=n;let a,l;t?(l=t.length,a=l-o):(a=Math.min(s,i||s),l=o+a);const c=Math.min(s,a);return Rx((i=i||c)<=c),t=t||new r(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,n,i),this.gl.bindBuffer(36662,null),t}bind({target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:n=0,size:i}={}){return 35345===t||35982===t?void 0!==i?this.gl.bindBufferRange(t,e,this.handle,n,i):(Rx(0===n),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind({target:t=this.target,index:e=this.accessor&&this.accessor.index}={}){return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t,e=0,n=t.byteLength+e){Rx(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const i=this._getTarget();this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,this.usage),this.gl.bufferSubData(i,e,t),this.gl.bindBuffer(i,null),this.debugData=t.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n);const r=$x(t);return Rx(r),this.setAccessor(new Kx(this.accessor,{type:r})),this}_setByteLength(t,e=this.usage){Rx(t>=0),this._trackDeallocatedMemory();let n=t;0===t&&(n=new Float32Array(0));const i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,e),this.gl.bindBuffer(i,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/Gx(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new Kx(this.accessor,{type:$x(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return Nw.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return Nw.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return Nw.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return Nw.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Kx(this.accessor,t),this}}const eS={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},nS={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},iS={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},rS=[9729,9728],sS=zw.CO.WebGLBuffer||function(){};class oS extends Hx{static isSupported(t,e={}){const{format:n,linearFiltering:i}=e;let r=!0;return n&&(r=r&&function(t,e){const n=eS[e];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;const i=Fw(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}(t,n),r=r&&(!i||function(t,e){const n=eS[e];switch(n&&n.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}(t,n))),r}constructor(t,e){const{id:n=Fx("texture"),handle:i,target:r}=e;super(t,{id:n,handle:i}),this.target=r,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(t={}){let e=t.data;if(e instanceof Promise)return e.then(e=>this.initialize(Object.assign({},t,{pixels:e,data:e}))),this;const n="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(n&&e.readyStatethis.initialize(t)),this;const{pixels:i=null,format:r=6408,border:s=0,recreate:o=!1,parameters:a={},pixelStore:l={},textureUnit:c}=t;e||(e=i);let{width:u,height:h,dataFormat:d,type:p,compressed:f=!1,mipmaps:g=!0}=t;const{depth:m=0}=t;return({width:u,height:h,compressed:f,dataFormat:d,type:p}=this._deduceParameters({format:r,type:p,dataFormat:d,compressed:f,data:e,width:u,height:h})),this.width=u,this.height=h,this.depth=m,this.format=r,this.type=p,this.dataFormat=d,this.border=s,this.textureUnit=c,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),g&&this._isNPOT()&&(Nw.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),g=!1,this._updateForNPOT(a)),this.mipmaps=g,this.setImageData({data:e,width:u,height:h,depth:m,format:r,type:p,dataFormat:d,border:s,mipmaps:g,parameters:l,compressed:f}),g&&this.generateMipmap(),this.setParameters(a),o&&(this.data=e),n&&(this._video={video:e,parameters:a,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:n}=this._video;if(n===t.currentTime||t.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:n=null,level:i=0,format:r=this.format,border:s=this.border,offset:o=0,parameters:a={}}=t;let{data:l=null,type:c=this.type,width:u=this.width,height:h=this.height,dataFormat:d=this.dataFormat,compressed:p=!1}=t;l||(l=n),({type:c,dataFormat:d,compressed:p,width:u,height:h}=this._deduceParameters({format:r,type:c,dataFormat:d,compressed:p,data:l,width:u,height:h}));const{gl:f}=this;f.bindTexture(this.target,this.handle);let g,m=null;return({data:l,dataType:m}=this._getDataType({data:l,compressed:p})),vx(this.gl,a,()=>{switch(m){case"null":f.texImage2D(e,i,r,u,h,s,d,c,l);break;case"typed-array":f.texImage2D(e,i,r,u,h,s,d,c,l,o);break;case"buffer":g=Vw(f),g.bindBuffer(35052,l.handle||l),g.texImage2D(e,i,r,u,h,s,d,c,o),g.bindBuffer(35052,null);break;case"browser-object":Fw(f)?f.texImage2D(e,i,r,u,h,s,d,c,l):f.texImage2D(e,i,r,d,c,l);break;case"compressed":for(const[t,n]of l.entries())f.compressedTexImage2D(e,t,n.format,n.width,n.height,s,n.data);break;default:Rx(!1,"Unknown image data type")}}),this._trackAllocatedMemory(l&&l.byteLength?l.byteLength:this.width*this.height*(nS[this.dataFormat]||4)*(iS[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:t=this.target,pixels:e=null,data:n=null,x:i=0,y:r=0,width:s=this.width,height:o=this.height,level:a=0,format:l=this.format,type:c=this.type,dataFormat:u=this.dataFormat,compressed:h=!1,offset:d=0,border:p=this.border,parameters:f={}}){if(({type:c,dataFormat:u,compressed:h,width:s,height:o}=this._deduceParameters({format:l,type:c,dataFormat:u,compressed:h,data:n,width:s,height:o})),Rx(0===this.depth,"texSubImage not supported for 3D textures"),n||(n=e),n&&n.data){const t=n;n=t.data,s=t.shape[0],o=t.shape[1]}n instanceof tS&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),vx(this.gl,f,()=>{if(h)this.gl.compressedTexSubImage2D(t,a,i,r,s,o,l,n);else if(null===n)this.gl.texSubImage2D(t,a,i,r,s,o,u,c,null);else if(ArrayBuffer.isView(n))this.gl.texSubImage2D(t,a,i,r,s,o,u,c,n,d);else if(n instanceof sS){const e=Vw(this.gl);e.bindBuffer(35052,n),e.texSubImage2D(t,a,i,r,s,o,u,c,d),e.bindBuffer(35052,null)}else Fw(this.gl)?Vw(this.gl).texSubImage2D(t,a,i,r,s,o,u,c,n):this.gl.texSubImage2D(t,a,i,r,u,c,n)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(t={}){return Nw.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType({data:t,compressed:e=!1}){return e?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof tS?{data:t.handle,dataType:"buffer"}:t instanceof sS?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:n}=t;let{width:i,height:r,dataFormat:s,type:o,compressed:a}=t;const l=eS[e];return s=s||l&&l.dataFormat,o=o||l&&l.types[0],a=a||l&&l.compressed,({width:i,height:r}=this._deduceImageSize(n,i,r)),{dataFormat:s,type:o,compressed:a,width:i,height:r,format:e,data:n}}_deduceImageSize(t,e,n){let i;return i="undefined"!=typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:n}:{width:e>=0?e:1,height:n>=0?n:1},Rx(i,"Could not deduced texture size"),Rx(void 0===e||i.width===e,"Deduced texture width does not match supplied width"),Rx(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Rx(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Fw(this.gl)||!this.width||!this.height||Bx(this.width)&&Bx(this.height))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===rS.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}function aS(t,e){return Rx("string"==typeof t),t=""+t,new Promise((n,i)=>{try{const r=new Image;r.onload=()=>n(r),r.onerror=()=>i(new Error(`Could not load image ${t}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=t}catch(r){i(r)}})}class lS extends oS{static isSupported(t,e){return oS.isSupported(t,e)}constructor(t,e={}){Bw(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:aS(e.data)})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}const cS="EXT_color_buffer_float";var uS={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:cS,bpp:2},33327:{gl2:cS,bpp:4},34842:{gl2:cS,bpp:8},33326:{gl2:cS,bpp:4},33328:{gl2:cS,bpp:8},34836:{gl2:cS,bpp:16},35898:{gl2:cS,bpp:4}};class hS extends Hx{static isSupported(t,{format:e}={format:null}){return!e||function(t,e,n){const i=n[e];if(!i)return!1;const r=Fw(t)&&i.gl2||i.gl1;return"string"==typeof r?t.getExtension(r):r}(t,e,uS)}static getSamplesForFormat(t,{format:e}){return t.getInternalformatParameter(36161,e,32937)}constructor(t,e={}){super(t,e),this.initialize(e),Object.seal(this)}initialize({format:t,width:e=1,height:n=1,samples:i=0}){return Rx(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==i&&Fw(this.gl)?this.gl.renderbufferStorageMultisample(36161,i,t,e,n):this.gl.renderbufferStorage(36161,t,e,n),this.format=t,this.width=e,this.height=n,this.samples=i,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*uS[this.format].bpp),this}resize({width:t,height:e}){return t!==this.width||e!==this.height?this.initialize({width:t,height:e,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}const dS="clear: bad arguments";function pS(t,{framebuffer:e=null,color:n=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;n&&(o|=16384,!0!==n&&(s.clearColor=n)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),Rx(0!==o,dS),vx(t,s,()=>{t.clear(o)})}function fS(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function gS(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var s=t.apply(e,n);function o(t){fS(s,i,r,o,a,"next",t)}function a(t){fS(s,i,r,o,a,"throw",t)}o(void 0)})}}const mS=[34069,34070,34071,34072,34073,34074];let bS=(()=>{class t extends oS{constructor(t,e={}){Bw(t),super(t,Object.assign({},e,{target:34067})),this.initialize(e),Object.seal(this)}initialize(t={}){const{mipmaps:e=!0,parameters:n={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(n)}),this}subImage({face:t,data:e,x:n=0,y:i=0,mipmapLevel:r=0}){return this._subImage({target:t,data:e,x:n,y:i,mipmapLevel:r})}setCubeMapImageData({width:t,height:e,pixels:n,data:i,border:r=0,format:s=6408,type:o=5121}){var a=this;return gS(function*(){const{gl:l}=a,c=n||i,u=yield Promise.all(mS.map(t=>{const e=c[t];return Promise.all(Array.isArray(e)?e:[e])}));a.bind(),mS.forEach((n,i)=>{u[i].length>1&&!1!==a.opts.mipmaps&&Nw.warn(`${a.id} has mipmap and multiple LODs.`)(),u[i].forEach((i,a)=>{t&&e?l.texImage2D(n,a,s,t,e,r,s,o,i):l.texImage2D(n,a,s,s,o,i)})}),a.unbind()})()}setImageDataForFace(t){const{face:e,width:n,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}=t,{gl:c}=this,u=r||s;return this.bind(),u instanceof Promise?u.then(n=>this.setImageDataForFace(Object.assign({},t,{face:e,data:n,pixels:n}))):this.width||this.height?c.texImage2D(e,0,a,n,i,o,a,l,u):c.texImage2D(e,0,a,a,l,u),this}}return t.FACES=mS,t})();class yS extends oS{static isSupported(t){return Fw(t)}constructor(t,e={}){Vw(t),super(t,e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1})),this.initialize(e),Object.seal(this)}setImageData({level:t=0,dataFormat:e=6408,width:n,height:i,depth:r=1,border:s=0,format:o,type:a=5121,offset:l=0,data:c,parameters:u={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),vx(this.gl,u,()=>{ArrayBuffer.isView(c)&&this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,c),c instanceof tS&&(this.gl.bindBuffer(35052,c.handle),this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,l))}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*this.depth*(nS[this.dataFormat]||4)*(iS[this.type]||1),"Texture"),this.loaded=!0,this}}function vS(t,e){const{gl:n,width:i,height:r,id:s}=t;return new SS(n,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:t}}))}function _S(t,e={}){const{sourceX:n=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:u,deleteFramebuffer:h}=function(t){return t instanceof SS?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:vS(t),deleteFramebuffer:!0}}(t);Rx(u);const{gl:d,handle:p,attachments:f}=u;a=a||u.width,l=l||u.height,36064===s&&null===p&&(s=1028),Rx(f[s]),c=c||f[s].type,o=function(t,e,n,i,r){if(t)return t;return new(Gx(e=e||5121,{clamped:!1}))(i*r*function(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Rx(!1),0}}(n))}(o,c,r,a,l),c=c||$x(o);const g=d.bindFramebuffer(36160,p);return d.readPixels(n,i,a,l,r,c,o),d.bindFramebuffer(36160,g||null),h&&u.delete(),o}function wS(t,{sourceAttachment:e=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}={}){let i=_S(t,{sourceAttachment:e}),{width:r,height:s}=t;for(;s>n;)({data:i,width:r,height:s}=Wx({data:i,width:r,height:s}));!function({data:t,width:e,height:n,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&e>=0,"Width and height need to be integers"),this.width=t,this.height=e,n)for(const c in n){const i=n[c];(Array.isArray(i)?i[0]:i).resize({width:t,height:e})}else n=this._createDefaultAttachments(i,r,s,t,e);this.update({clearAttachments:!0,attachments:n,readBuffer:a,drawBuffers:l}),n&&o&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update({attachments:t={},readBuffer:e,drawBuffers:n,clearAttachments:i=!1,resizeAttachments:r=!0}){this.attach(t,{clearAttachments:i,resizeAttachments:r});const{gl:s}=this,o=s.bindFramebuffer(36160,this.handle);return e&&this._setReadBuffer(e),n&&this._setDrawBuffers(n),s.bindFramebuffer(36160,o||null),this}resize(t={}){let{width:e,height:n}=t;if(null===this.handle)return Rx(void 0===e&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),e!==this.width&&n!==this.height&&Nw.log(2,`Resizing framebuffer ${this.id} to ${e}x${n}`)();for(const i in this.attachments)this.attachments[i].resize({width:e,height:n});return this.width=e,this.height=n,this}attach(t,{clearAttachments:e=!1,resizeAttachments:n=!0}={}){const i={};e&&Object.keys(this.attachments).forEach(t=>{i[t]=null}),Object.assign(i,t);const r=this.gl.bindFramebuffer(36160,this.handle);for(const s in i){Rx(void 0!==s,"Misspelled framebuffer binding point?");const t=Number(s),e=i[t];let r=e;if(r)if(r instanceof hS)this._attachRenderbuffer({attachment:t,renderbuffer:r});else if(Array.isArray(e)){const[n,i=0,s=0]=e;r=n,this._attachTexture({attachment:t,texture:n,layer:i,level:s})}else this._attachTexture({attachment:t,texture:r,layer:0,level:0});else this._unattach(t);n&&r&&r.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,r||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter(t=>!this.attachments[t]).forEach(t=>{delete this.attachments[t]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(t){return(SS.STATUS||{})[t]||`Framebuffer error ${t}`}(t));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),n=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),n}clear(t={}){const{color:e,depth:n,stencil:i,drawBuffers:r=[]}=t,s=this.gl.bindFramebuffer(36160,this.handle);return(e||n||i)&&pS(this.gl,{color:e,depth:n,stencil:i}),r.forEach((t,e)=>{!function(t,{framebuffer:e=null,buffer:n=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Vw(t),vx(t,{framebuffer:e},()=>{switch(n){case 6144:switch(r.constructor){case Int32Array:t.clearBufferiv(n,i,r);break;case Uint32Array:t.clearBufferuiv(n,i,r);break;case Float32Array:default:t.clearBufferfv(n,i,r)}break;case 6145:t.clearBufferfv(6145,0,[r]);break;case 6146:t.clearBufferiv(6146,0,[r]);break;case 34041:const[e,s]=r;t.clearBufferfi(34041,0,e,s);break;default:Rx(!1,dS)}})}(this.gl,{drawBuffer:e,value:t})}),this.gl.bindFramebuffer(36160,s||null),this}readPixels(t={}){return Nw.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(t={}){return Nw.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(t={}){return Nw.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(t={}){return Nw.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(t={}){return Nw.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(t={}){return Nw.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:t=[],x:e=0,y:n=0,width:i,height:r}){const s=Vw(this.gl),o=s.bindFramebuffer(36008,this.handle);return 0===e&&0===n&&void 0===i&&void 0===r?s.invalidateFramebuffer(36008,t):s.invalidateFramebuffer(36008,t,e,n,i,r),s.bindFramebuffer(36008,o),this}getAttachmentParameter(t,e,n){let i=this._getAttachmentParameterFallback(e);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Lx(this.gl,i)),i}getAttachmentParameters(t=36064,e,n=this.constructor.ATTACHMENT_PARAMETERS||[]){const i={};for(const r of n)i[e?Lx(this.gl,r):r]=this.getAttachmentParameter(t,r,e);return i}getParameters(t=!0){const e=Object.keys(this.attachments),n={};for(const i of e){const e=Number(i);n[t?Lx(this.gl,e):e]=this.getAttachmentParameters(e,t)}return n}show(){return"undefined"!=typeof window&&window.open(wS(this),"luma-debug-texture"),this}log(t=0,e=""){if(t>Nw.level||"undefined"==typeof window)return this;e=e||`Framebuffer ${this.id}`;const n=wS(this,{targetMaxHeight:100});return Nw.image({logLevel:t,message:e,image:n},e)(),this}bind({target:t=36160}={}){return this.gl.bindFramebuffer(t,this.handle),this}unbind({target:t=36160}={}){return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,n,i,r){let s=null;return t&&(s=s||{},s[36064]=new lS(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(s[36064])),e&&n?(s=s||{},s[33306]=new hS(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:i,height:111}),this.ownResources.push(s[33306])):e?(s=s||{},s[36096]=new hS(this.gl,{id:`${this.id}-depth`,format:33189,width:i,height:r}),this.ownResources.push(s[36096])):n&&Rx(!1),s}_unattach(t){const e=this.attachments[t];!e||(e instanceof hS?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer({attachment:t=36064,renderbuffer:e}){const{gl:n}=this;n.framebufferRenderbuffer(36160,t,36161,e.handle),this.attachments[t]=e}_attachTexture({attachment:t=36064,texture:e,layer:n,level:i}){const{gl:r}=this;switch(r.bindTexture(e.target,e.handle),e.target){case 35866:case 32879:Vw(r).framebufferTextureLayer(36160,t,e.target,i,n);break;case 34067:const s=function(t){return t<34069?t+34069:t}(n);r.framebufferTexture2D(36160,t,s,e.handle,i);break;case 3553:r.framebufferTexture2D(36160,t,3553,e.handle,i);break;default:Rx(!1,"Illegal texture type")}r.bindTexture(e.target,null),this.attachments[t]=e}_setReadBuffer(t){const e=function(t){return Fw(t)?t:null}(this.gl);e?e.readBuffer(t):Rx(36064===t||1029===t,xS),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,n=Vw(e);if(n)n.drawBuffers(t);else{const n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Rx(1===t.length&&(36064===t[0]||1029===t[0]),xS)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=function(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in ES)void 0===t.luma.caps[e]&&(t.luma.caps[e]=TS(t,e));return t.luma.caps}(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}SS.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var ES={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(t){const e=new lS(t,{format:6408,type:5126,dataFormat:6408}),n=new SS(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=n.getStatus();return e.delete(),n.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function CS(t,e){return OS(t,e)}function OS(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>TS(t,e))}function TS(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const n=ES[e];let i;Rx(n,e);const r=Fw(t)&&n[1]||n[0];if("function"==typeof r)i=r(t);else if(Array.isArray(r)){i=!0;for(const e of r)i=i&&Boolean(t.getExtension(e))}else"string"==typeof r?i=Boolean(t.getExtension(r)):"boolean"==typeof r?i=r:Rx(!1);return i}(t,e)),t.luma.caps[e]||Nw.log(2,`Feature: ${e} not supported`)(),t.luma.caps[e]}class kS{constructor(t,e){this.opts=e,this.source=t}get value(){return this.source.value}getValue(){const t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];const{value:n}=this.source,{size:i}=e;let r=n;if(n&&n.length!==i){r=new Float32Array(i);const t=e.elementOffset||0;for(let e=0;ei&&(r=i);const s=this._pool,o=t.BYTES_PER_ELEMENT*r,a=s.findIndex(t=>t.byteLength>=o);if(a>=0){const e=new t(s.splice(a,1)[0],0,r);return n&&e.fill(0),e}return new t(r)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:n}=t,{byteLength:i}=n,r=e.findIndex(t=>t.byteLength>=i);r<0?e.push(n):(r>0||e.lengththis.props.poolSize&&e.shift()}};Math;const PS=1/180*Math.PI,IS={};function MS(t,{precision:e=IS.precision||4}={}){return t=function(t){return Math.round(t/IS.EPSILON)*IS.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function DS(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function RS(t,e,n){if(DS(t)){n=n||function(t){return t.clone?t.clone():new Array(t.length)}(t);for(let i=0;it*PS,void 0)}(t)}function LS(t,e,n){return RS(t,t=>Math.max(e,Math.min(n,t)))}function jS(t,e,n){return DS(t)?t.map((t,i)=>jS(t,e[i],n)):n*e+(1-n)*t}function FS(t,e,n){const i=IS.EPSILON;n&&(IS.EPSILON=n);try{if(t===e)return!0;if(DS(t)&&DS(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+MS(this[n],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e=0&&t=0&&t0&&(dE.length=t.length,i=dE):i=hE,(e>0||Number.isFinite(n))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,n),r.index=e-1),{iterable:i,objectInfo:r}}function fE(t){return t&&t[Symbol.asyncIterator]}function gE(t,e=(()=>!0)){return Array.isArray(t)?mE(t,e,[]):e(t)?[t]:[]}function mE(t,e,n){let i=-1;for(;++ia)return void e.set(t.subarray(0,a),n);if(e.set(t,n),!s)return;let l=o;for(;lt},spring:{stiffness:.05,damping:.5}};function xE(t,e){return t?(Number.isFinite(t)&&(t={duration:t}),t.type=t.type||"interpolation",bt(bt(bt({},wE[t.type]),e),t)):null}function SE(t,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function EE(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function CE(t){t.push(t.shift())}function OE(t,e){const{doublePrecision:n,settings:i,value:r,size:s}=t,o=n&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function TE({buffer:t,numInstances:e,attribute:n,fromLength:i,fromStartIndices:r,getData:s=(t=>t)}){const o=n.doublePrecision&&n.value instanceof Float64Array?2:1,a=n.size*o,l=n.byteOffset,c=n.startIndices,u=r&&c,h=OE(n,e),d=n.state.constant;if(!u&&i>=h)return;const p=d?n.value:n.getBuffer().getData({srcByteOffset:l});if(n.settings.normalized&&!d){const t=s;s=(e,i)=>n._normalizeConstant(t(e,i))}const f=d?(t,e)=>s(p,e):(t,e)=>s(p.subarray(t,t+a),e),g=t.getData({length:i}),m=new Float32Array(h);(function({source:t,target:e,size:n,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return _E({source:t,target:e,size:n,getData:i}),e;let o=0,a=0;const l=i&&((t,e)=>i(t+a,e)),c=Math.min(r.length,s.length);for(let u=1;u(t+128)/255*2-1);case 5122:return new Float32Array(t).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(t).map(t=>t/255);case 5123:return new Float32Array(t).map(t=>t/65535);default:return t}}_normalizeValue(t,e,n){const{defaultValue:i,size:r}=this.settings;if(Number.isFinite(t))return e[n]=t,e;if(!t)return e[n]=i[0],e;switch(r){case 4:e[n+3]=Number.isFinite(t[3])?t[3]:i[3];case 3:e[n+2]=Number.isFinite(t[2])?t[2]:i[2];case 2:e[n+1]=Number.isFinite(t[1])?t[1]:i[1];case 1:e[n+0]=Number.isFinite(t[0])?t[0]:i[0];break;default:let s=r;for(;--s>=0;)e[n+s]=Number.isFinite(t[s])?t[s]:i[s]}return e}_areValuesEqual(t,e){if(!t||!e)return!1;const{size:n}=this;for(let i=0;it[e])]:t[e],n)}setNeedsUpdate(t=this.id,e){if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){const{startRow:t=0,endRow:n=1/0}=e;this.state.updateRanges=function(t,e){if(t===vE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return t;const n=[],i=t.length;let r=0;for(let s=0;se[1]?n.push(i):e=[Math.min(i[0],e[0]),Math.max(i[1],e[1])]}return n.splice(r,0,e),n}(this.state.updateRanges,[t,n])}else this.state.updateRanges=vE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=yE}setNeedsRedraw(t=this.id){this.state.needsRedraw=this.state.needsRedraw||t}update(t){this.setData(t)}allocate(t){const{state:e,settings:n}=this;return!n.noAlloc&&!!n.update&&(super.allocate({numInstances:t,copy:e.updateRanges!==vE}),!0)}updateBuffer({numInstances:t,data:e,props:n,context:i}){if(!this.needsUpdate())return!1;const{state:{updateRanges:r},settings:{update:s,noAlloc:o}}=this;let a=!0;if(s){for(const[o,a]of r)s.call(i,this,{data:e,startRow:o,endRow:a,props:n,numInstances:t});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const n=i*a+l;for(let i=0;ic?l.set(e,f):(t._normalizeValue(e,m.target,0),bE({target:l,source:m.target,start:f,count:n}));f+=n*c}else t._normalizeValue(e,l,f),f+=c}}_validateAttributeUpdaters(){const{settings:t}=this;if(!t.noAlloc&&"function"!=typeof t.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:t}=this,e=Math.min(4,this.size);if(t&&t.length>=e){let n=!0;switch(e){case 4:n=n&&Number.isFinite(t[3]);case 3:n=n&&Number.isFinite(t[2]);case 2:n=n&&Number.isFinite(t[1]);case 1:n=n&&Number.isFinite(t[0]);break;default:n=!1}if(!n)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let AE={};function PE(t){Iw.level>0&&AE[t]&&AE[t].call(...arguments)}function IE(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const ME="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",DE=`#version 300 es\n${ME}`;function RE(t,e){e=Array.isArray(e)?e:[e];const n=t.replace(/^\s+/,"").split(/\s+/),[i,r,s]=n;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function NE(t={}){const{version:e=100,input:n,inputType:i,output:r}=t;if(!n)return 300===e?DE:e>300?`#version ${e}\n${ME}`:"void main() {gl_FragColor = vec4(0);}";const s=function(t,e){switch(e){case"float":return`vec4(${t}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${t}, 0.0, 1.0)`;case"vec3":return`vec4(${t}, 1.0)`;case"vec4":return t;default:return IE(!1),null}}(n,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${n};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${n};\nvoid main() {\n gl_FragColor = ${s};\n}`}class LE extends Hx{static isSupported(t){return Fw(t)}constructor(t,e={}){Vw(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(t={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Vx(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(t={}){return this.bind(()=>{for(const e in t)this.setBuffer(e,t[e])}),this}setBuffer(t,e){const n=this._getVaryingIndex(t),{buffer:i,byteSize:r,byteOffset:s}=this._getBufferParams(e);return n<0?(this.unused[t]=i,Nw.warn(()=>`${this.id} unused varying buffer ${t}`)(),this):(this.buffers[n]=e,this.bindOnUse||this._bindBuffer(n,i,s,r),this)}begin(t=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,n,i;return t instanceof tS?i=t:(i=t.buffer,n=t.byteSize,e=t.byteOffset),(void 0!==e||void 0!==n)&&(e=e||0,n=n||i.byteLength-e),{buffer:i,byteOffset:e,byteSize:n}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:n,byteOffset:i}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,i,n)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e,n=0,i){const r=e&&e.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,t,r,n,i):this.gl.bindBufferBase(35982,t,r),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}class jE{constructor(t,e={}){this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(t={}){const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(t={}){const e=this.bindings[this.currentIndex],{sourceBuffers:n,transformFeedback:i}=e;return{attributes:Object.assign({},n,t.attributes),transformFeedback:i}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],n=t?e[t]:null;return n?n instanceof tS?n:n.buffer:null}getData(t={}){const{varyingName:e}=t,n=this.getBuffer(e);return n?n.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(t={}){this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Rx(Fw(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,n={};if(this.bindings[this.currentIndex]&&Object.assign(n,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const i in this.feedbackMap){const t=this.feedbackMap[i];i in e&&(n[t]=i)}Object.assign(n,t.feedbackBuffers);for(const i in n){const t=n[i];if("string"==typeof t){const r=e[t],{byteLength:s,usage:o,accessor:a}=r;n[i]=this._createNewBuffer(i,{byteLength:s,usage:o,accessor:a})}}return n}_setupBuffers(t={}){const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const n=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:n})}_setupTransformFeedback(t,{model:e}){const{program:n}=e;t.transformFeedback=new LE(this.gl,{program:n,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),n=Object.assign({},t.feedbackBuffers);for(const i in this.feedbackMap){const r=this.feedbackMap[i];e[i]=t.feedbackBuffers[r],n[r]=t.sourceBuffers[i],Rx(n[r]instanceof tS)}return{sourceBuffers:e,feedbackBuffers:n}}_createNewBuffer(t,e){const n=new tS(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}_getNextIndex(){return(this.currentIndex+1)%2}}function FE(t){let e=100;const n=t.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){const t=parseInt(n[1],10);Number.isFinite(t)&&(e=t)}return e}const BE="vs",VE={[BE]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},zE="__LUMA_INJECT_DECLARATIONS__",UE=/void\s+main\s*\([^)]*\)\s*\{\n?/,HE=/}\n?[^{}]*$/,$E=[];function GE(t,e,n,i=!1){const r=e===BE;for(const s in n){const e=n[s];e.sort((t,e)=>t.order-e.order),$E.length=e.length;for(let t=0,n=e.length;tt+i));break;case"vs:#main-end":r&&(t=t.replace(HE,t=>i+t));break;case"fs:#decl":r||(t=t.replace(zE,i));break;case"fs:#main-start":r||(t=t.replace(UE,t=>t+i));break;case"fs:#main-end":r||(t=t.replace(HE,t=>i+t));break;default:t=t.replace(s,t=>t+i)}}return t=t.replace(zE,""),i&&(t=t.replace(/\}\s*$/,t=>t+VE[e])),t}function WE(t){const e={};return IE(Array.isArray(t)&&t.length>1),t.forEach(t=>{for(const n in t)e[n]=e[n]?`${e[n]}\n${t[n]}`:t[n]}),e}const qE={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},XE="transform_uSize_",YE="transform_position";const KE={10241:9728,10240:9728,10242:33071,10243:33071};class QE{constructor(t,e={}){this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(t={}){const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(t={}){const{sourceBuffers:e,sourceTextures:n,framebuffer:i,targetTexture:r}=this.bindings[this.currentIndex],s=Object.assign({},e,t.attributes),o=Object.assign({},t.uniforms),a=Object.assign({},t.parameters);let l=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){s.transform_elementID=this.elementIDBuffer;for(const e in this.samplerTextureMap)o[e]=n[this.samplerTextureMap[e]];this._setSourceTextureParameters();const t=function({sourceTextureMap:t,targetTextureVarying:e,targetTexture:n}){const i={};let r,s;e&&(({width:r,height:s}=n),i[`${XE}${e}`]=[r,s]);for(const o in t)({width:r,height:s}=t[o]),i[`${XE}${o}`]=[r,s];return i}({sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:r});Object.assign(o,t)}return this.hasTargetTexture&&(l=!1,a.viewport=[0,0,i.width,i.height]),{attributes:s,framebuffer:i,uniforms:o,discard:l,parameters:a}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData({packed:t=!1}={}){const{framebuffer:e}=this.bindings[this.currentIndex],n=_S(e);if(!t)return n;const i=n.constructor,r=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return IE(!1),null}}(this.targetTextureType),s=new i(n.length*r/4);let o=0;for(let a=0;a0,this._updateBindings({sourceBuffers:e,sourceTextures:n,targetTexture:r}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}_updateElementIDBuffer(t){if("number"!=typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach((t,e,n)=>{n[e]=e}),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new tS(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:n,sourceTextures:i,targetTexture:r}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,i),Object.assign(t.sourceBuffers,n),r){t.targetTexture=r;const{width:e,height:n}=r,{framebuffer:i}=t;i?(i.update({attachments:{36064:r},resizeAttachments:!1}),i.resize({width:e,height:n})):t.framebuffer=new SS(this.gl,{id:"transform-framebuffer",width:e,height:n,attachments:{36064:r}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const n in e)e[n].setParameters(KE)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);return e[this._swapTexture]=t.targetTexture,{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=function(t,e){Rx(t instanceof lS||t instanceof bS||t instanceof yS);const n=t.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=t;return new n(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(t);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(t={}){const{sourceTextures:e,targetTexture:n}=this.bindings[this.currentIndex],{vs:i,uniforms:r,targetTextureType:s,inject:o,samplerTextureMap:a}=function({vs:t,sourceTextureMap:e,targetTextureVarying:n,targetTexture:i}){let r=Object.keys(e).length,s=null;const o={};let a=t,l={};if(r>0||n){const t=a.split("\n"),c=t.slice();if(t.forEach((t,i,a)=>{if(r>0){const n=function(t,e){const n={},i=function(t){return RE(t,["attribute","in"])}(t);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const e=`// ${t} => Replaced by Transform with a sampler`,{samplerName:i,sizeName:o,uniformDeclerations:a}=function(t){const e=`transform_uSampler_${t}`,n=`${XE}${t}`;return{samplerName:e,sizeName:n,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${n};`}}(s),l=` ${r} ${s} = transform_getInput(${i}, ${o}).${function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return IE(!1),null}}(r)};\n`;return n[i]=s,{updatedLine:e,inject:{"vs:#decl":a,"vs:#main-start":l},samplerTextureMap:n}}return null}(t,e);if(n){const{updatedLine:t,inject:e}=n;c[i]=t,l=WE([l,e]),Object.assign(o,n.samplerTextureMap),r--}}n&&!s&&(s=function(t,e){const n=RE(t,["varying","out"]);return n&&n.name===e?n.type:null}(t,n))}),n){Rx(i);const t=`${XE}${n}`;l=WE([l,{"vs:#decl":`uniform vec2 ${t};\n`,"vs:#main-start":` vec2 ${YE} = transform_getPos(${t});\n gl_Position = vec4(${YE}, 0, 1.);\n`}])}a=c.join("\n")}return{vs:a,targetTextureType:s,inject:l,samplerTextureMap:o}}({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:n}),l=WE([t.inject||{},o]);return this.targetTextureType=s,this.samplerTextureMap=a,{vs:i,fs:t._fs||NE({version:FE(i),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[qE].concat(t.modules||[]):t.modules,uniforms:r,inject:l}}}const ZE={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function JE(t){let e=tC(t);return"object"===e?t?"type"in t?Object.assign({},t,ZE[t.type]):"value"in t?(e=tC(t.value),Object.assign({type:e},t,ZE[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},ZE[e])}function tC(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class eC{constructor({name:t,vs:e,fs:n,dependencies:i=[],uniforms:r,getUniforms:s,deprecations:o=[],defines:a={},inject:l={},vertexShader:c,fragmentShader:u}){IE("string"==typeof t),this.name=t,this.vs=e||c,this.fs=n||u,this.getModuleUniforms=s,this.dependencies=i,this.deprecations=this._parseDeprecationDefinitions(o),this.defines=a,this.injections=function(t){const e={vs:{},fs:{}};for(const n in t){let i=t[n];const r=n.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][n]=i}return e}(l),r&&(this.uniforms=function(t){const e={};for(const n in t){const i=JE(t[n]);e[n]=i}return e}(r))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:IE(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${e}// END MODULE_${this.name}\n\n`}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach(n=>{n.regex.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())})}_parseDeprecationDefinitions(t){return t.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),t}_defaultGetUniforms(t={}){const e={},n=this.uniforms;for(const i in n){const r=n[i];i in t&&!r.private?(r.validate&&IE(r.validate(t[i],r),`${this.name}: invalid ${i}`),e[i]=t[i]):e[i]=r.value}return e}}function nC(t){return function(t){const e={},n={};return iC({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort((t,e)=>n[e]-n[t]).map(t=>e[t])}(rC(t))}function iC({modules:t,level:e,moduleMap:n,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of t)n[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof eC||(IE("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),IE(t.name,"shader module has no name"),(t=new eC(t)).dependencies=rC(t.dependencies)),t))}const sC={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},oC={};function aC(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/Apple/i)||e.match(/Apple/i)?"APPLE":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(sC).forEach(t=>{oC[t]=t});const lC={};function cC(t,e,n={}){const i=sC[e];if(IE(i,e),!function(t={}){const e="undefined"!=typeof window&&window.navigator||{},n=t.userAgent||e.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(e in lC)return lC[e];const r=`#extension GL_${i[0]} : ${n.behavior||"enable"}\nvoid main(void) {}`,s=t.createShader(35633);t.shaderSource(s,r),t.compileShader(s);const o=t.getShaderParameter(s,35713);return t.deleteShader(s),lC[e]=o,o}function uC(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>function(t,e){const n=sC[e];IE(n,e);const i=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&n[1]||n[0],r="string"==typeof i?Boolean(t.getExtension(i)):i;return IE(!1===r||!0===r),r}(t,e))}function hC(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const dC=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],pC=[...dC,[hC("attribute"),"in $1"],[hC("varying"),"out $1"]],fC=[...dC,[hC("varying"),"in $1"]],gC=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],mC=[...gC,[hC("in"),"attribute $1"],[hC("out"),"varying $1"]],bC=[...gC,[hC("in"),"varying $1"]],yC="gl_FragColor",vC=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,_C=/void\s+main\s*\([^)]*\)\s*\{\n?/;function wC(t,e){for(const[n,i]of e)t=t.replace(n,i);return t}const xC=`\n\n${zE}\n\n`,SC={[BE]:"vertex",fs:"fragment"};function EC(t,{id:e,source:n,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){IE("string"==typeof n,"shader source must be a string");const h=i===BE,d=n.split("\n");let p=100,f="",g=n;0===d[0].indexOf("#version ")?(p=300,f=d[0],g=d.slice(1).join("\n")):f=`#version ${p}`;const m={};r.forEach(t=>{Object.assign(m,t.getDefines())}),Object.assign(m,s);let b=c?`${f}\n${function({id:t,source:e,type:n}){return t&&"string"==typeof t&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${t}_${SC[n]}\n\n`:""}({id:e,source:n,type:i})}\n${function({type:t}){return`\n#define SHADER_TYPE_${SC[t].toUpperCase()}\n`}({type:i})}\n${function(t){switch(function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),n=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:aC(n,i),vendor:n,renderer:i,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(t)}\n${function(t,e,n){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return uC(t,oC.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),uC(t,oC.GLSL_DERIVATIVES)&&cC(t,oC.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),uC(t,oC.GLSL_FRAG_DATA)&&cC(t,oC.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),uC(t,oC.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(t)}\n${function(t={}){let e=0,n="";for(const i in t){0===e&&(n+="\n// APPLICATION DEFINES\n"),e++;const r=t[i];(r||Number.isFinite(r))&&(n+=`#define ${i.toUpperCase()} ${t[i]}\n`)}return 0===e&&(n+="\n"),n}(m)}\n${h?"":"precision highp float;\n\n"}\n`:`${f}\n`;const y=function(t){const e={vs:{},fs:{}};return t.forEach(t=>{let n;"string"!=typeof t?(n=t,t=n.hook):n={},t=t.trim();const[i,r]=t.split(":"),s=t.replace(/\(.+/,"");e[i][s]=Object.assign(n,{signature:r})}),e}(o),v={},_={},w={};for(const x in a){const t="string"==typeof a[x]?{injection:a[x],order:0}:a[x],e=x.match(/^(v|f)s:(#)?([\w-]+)$/);if(e){const n=e[3];e[2]?"decl"===n?_[x]=[t]:w[x]=[t]:v[x]=[t]}else w[x]=[t]}for(const x of r){u&&x.checkDeprecations(g,u),b+=x.getModuleSource(i,p);const t=x.injections[i];for(const e in t){const n=e.match(/^(v|f)s:#([\w-]+)$/);if(n){const i="decl"===n[2]?_:w;i[e]=i[e]||[],i[e].push(t[e])}else v[e]=v[e]||[],v[e].push(t[e])}}return b+=xC,b=GE(b,i,_),b+=function(t,e){let n="";for(const i in t){const r=t[i];if(n+=`void ${r.signature} {\n`,r.header&&(n+=` ${r.header}`),e[i]){const t=e[i];t.sort((t,e)=>t.order-e.order);for(const e of t)n+=` ${e.injection}\n`}r.footer&&(n+=` ${r.footer}`),n+="}\n"}return n}(y[i],v),b+=g,b=GE(b,i,w),b=function(t,e,n){switch(e){case 300:return n?wC(t,pC):function(t){const e=(t=wC(t,fC)).match(vC);if(e){const n=e[1];t=t.replace(new RegExp(`\\b${yC}\\b`,"g"),n)}else{const e="fragmentColor";t=t.replace(_C,t=>`out vec4 ${e};\n${t}`).replace(new RegExp(`\\b${yC}\\b`,"g"),e)}return t}(t);case 100:return n?wC(t,mC):function(t){const e=(t=wC(t,bC)).match(vC);if(e){const n=e[1];t=t.replace(vC,"").replace(new RegExp(`\\b${n}\\b`,"g"),yC)}return t}(t);default:throw new Error(`unknown GLSL version ${e}`)}}(b,l?100:p,h),b}function CC(t){return function(e){const n={};for(const i of t){const t=i.getUniforms(e,n);Object.assign(n,t)}return n}}const OC={5126:VC.bind(null,"uniform1fv",MC,1,zC),35664:VC.bind(null,"uniform2fv",MC,2,zC),35665:VC.bind(null,"uniform3fv",MC,3,zC),35666:VC.bind(null,"uniform4fv",MC,4,zC),5124:VC.bind(null,"uniform1iv",DC,1,zC),35667:VC.bind(null,"uniform2iv",DC,2,zC),35668:VC.bind(null,"uniform3iv",DC,3,zC),35669:VC.bind(null,"uniform4iv",DC,4,zC),35670:VC.bind(null,"uniform1iv",DC,1,zC),35671:VC.bind(null,"uniform2iv",DC,2,zC),35672:VC.bind(null,"uniform3iv",DC,3,zC),35673:VC.bind(null,"uniform4iv",DC,4,zC),35674:VC.bind(null,"uniformMatrix2fv",MC,4,UC),35675:VC.bind(null,"uniformMatrix3fv",MC,9,UC),35676:VC.bind(null,"uniformMatrix4fv",MC,16,UC),35678:BC,35680:BC,5125:VC.bind(null,"uniform1uiv",RC,1,zC),36294:VC.bind(null,"uniform2uiv",RC,2,zC),36295:VC.bind(null,"uniform3uiv",RC,3,zC),36296:VC.bind(null,"uniform4uiv",RC,4,zC),35685:VC.bind(null,"uniformMatrix2x3fv",MC,6,UC),35686:VC.bind(null,"uniformMatrix2x4fv",MC,8,UC),35687:VC.bind(null,"uniformMatrix3x2fv",MC,6,UC),35688:VC.bind(null,"uniformMatrix3x4fv",MC,12,UC),35689:VC.bind(null,"uniformMatrix4x2fv",MC,8,UC),35690:VC.bind(null,"uniformMatrix4x3fv",MC,12,UC),35678:BC,35680:BC,35679:BC,35682:BC,36289:BC,36292:BC,36293:BC,36298:BC,36299:BC,36300:BC,36303:BC,36306:BC,36307:BC,36308:BC,36311:BC},TC={},kC={},AC={},PC=[0];function IC(t,e,n,i){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(PC[0]=t,t=PC);const r=t.length;if(r%e&&Nw.warn(`Uniform size should be multiples of ${e}`,t)(),t instanceof n)return t;let s=i[r];s||(s=new n(r),i[r]=s);for(let o=0;o{const r=t!==i;return r&&(e.uniform1i(n,i),t=i),r}}function VC(t,e,n,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,n),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{Rx(s===u,"Uniform length cannot change.");for(let t=0;t{const s=String(i+e);return GC(s,r-s.length)+n+t})}(e);return{shaderName:l,errors:$C(s,c),warnings:$C(o,c)}}(t,this.source,this.shaderType,this.id);throw Nw.error(`GLSL compilation errors in ${e}\n${n}`)(),Nw.warn(`GLSL compilation warnings in ${e}\n${i}`)(),new Error(`GLSL compilation errors in ${e}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class qC extends WC{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class XC extends WC{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const YC=5126,KC=5124,QC=5125,ZC={[YC]:[YC,1,"float"],35664:[YC,2,"vec2"],35665:[YC,3,"vec3"],35666:[YC,4,"vec4"],[KC]:[KC,1,"int"],35667:[KC,2,"ivec2"],35668:[KC,3,"ivec3"],35669:[KC,4,"ivec4"],[QC]:[QC,1,"uint"],36294:[QC,2,"uvec2"],36295:[QC,3,"uvec3"],36296:[QC,4,"uvec4"],35670:[YC,1,"bool"],35671:[YC,2,"bvec2"],35672:[YC,3,"bvec3"],35673:[YC,4,"bvec4"],35674:[YC,8,"mat2"],35685:[YC,8,"mat2x3"],35686:[YC,8,"mat2x4"],35675:[YC,12,"mat3"],35687:[YC,12,"mat3x2"],35688:[YC,12,"mat3x4"],35676:[YC,16,"mat4"],35689:[YC,16,"mat4x2"],35690:[YC,16,"mat4x3"]};function JC(t){const e=ZC[t];if(!e)return null;const[n,i]=e;return{type:n,components:i}}function tO(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=YC}for(const n in ZC){const[i,r,s]=ZC[n];if(i===t&&r===e)return{glType:n,name:s}}return null}class eO{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,n=e.getProgramParameter(t.handle,35721);for(let i=0;i=0&&this._addAttribute(o,n,r,s)}this.attributeInfos.sort((t,e)=>t.location-e.location)}_readVaryingsFromProgram(t){const{gl:e}=t;if(!Fw(e))return;const n=e.getProgramParameter(t.handle,35971);for(let i=0;it.location-e.location)}_addAttribute(t,e,n,i){const{type:r,components:s}=JC(n),o={type:r,size:i*s};this._inferProperties(t,e,o);const a={location:t,name:e,accessor:new Kx(o)};this.attributeInfos.push(a),this.attributeInfosByLocation[t]=a,this.attributeInfosByName[a.name]=a}_inferProperties(t,e,n){/instance/i.test(e)&&(n.divisor=1)}_addVarying(t,e,n,i){const{type:r,components:s}=JC(n),o={location:t,name:e,accessor:new Kx({type:r,size:i*s})};this.varyingInfos.push(o),this.varyingInfosByName[o.name]=o}}const nO=35981,iO=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class rO extends Hx{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Program","v6.0",iO),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(t={}){const{hash:e,vs:n,fs:i,varyings:r,bufferMode:s=nO}=t;return this.hash=e||"",this.vs="string"==typeof n?new qC(this.gl,{id:`${t.id}-vs`,source:n}):n,this.fs="string"==typeof i?new XC(this.gl,{id:`${t.id}-fs`,source:i}):i,Rx(this.vs instanceof qC),Rx(this.fs instanceof XC),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(Vw(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,s)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new eO(this),this.setProps(t)}delete(t={}){return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw({logPriority:t,drawMode:e=4,vertexCount:n,offset:i=0,start:r,end:s,isIndexed:o=!1,indexType:a=5123,instanceCount:l=0,isInstanced:c=l>0,vertexArray:u=null,transformFeedback:h,framebuffer:d,parameters:p={},uniforms:f,samplers:g}){if((f||g)&&(Nw.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(f||{})),Nw.priority>=t){const i=d?d.id:"default",r=`mode=${Lx(this.gl,e)} verts=${n} instances=${l} indexType=${Lx(this.gl,a)} isInstanced=${c} isIndexed=${o} Framebuffer=${i}`;Nw.log(t,r)()}return Rx(u),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===n||c&&0===l||(u.bindForDraw(n,l,()=>{if(void 0!==d&&(p=Object.assign({},p,{framebuffer:d})),h){const t=function(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Rx(!1),0}}(e);h.begin(t)}this._bindTextures(),vx(this.gl,p,()=>{o&&c?this.gl2.drawElementsInstanced(e,n,a,i,l):o&&Fw(this.gl)&&!isNaN(r)&&!isNaN(s)?this.gl2.drawRangeElements(e,r,s,n,a,i):o?this.gl.drawElements(e,n,a,i):c?this.gl2.drawArraysInstanced(e,i,n,l):this.gl.drawArrays(e,i,n)}),h&&h.end()}),0))}setUniforms(t={}){Nw.priority>=2&&function(t,e,n){for(const i in t){const r=t[i];if((!n||Boolean(n[i]))&&!jC(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const e in t){const n=t[e],i=this._uniformSetters[e];if(i){let t=n,r=!1;if(t instanceof SS&&(t=t.texture),t instanceof oS)if(r=this.uniforms[e]!==n,r){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);const n=t,{textureIndex:r}=i;n.bind(r),t=r,this._textureUniforms[e]=n}else t=i.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(i(t)||r)&&FC(this.uniforms,e,n)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const n=this._textureUniforms[e];n.update(),t=t&&n.loaded}return t}_bindTextures(){for(const t in this._textureUniforms)this._textureUniforms[t].bind(this._uniformSetters[t].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),n={};for(const i of e)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new qC({handle:i});break;case 35632:n.fs=new XC({handle:i})}return n}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=Fx(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?`${t}-program`:"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),Nw.time(4,`linkProgram for ${this._getName()}`)(),t.linkProgram(this.handle),Nw.timeEnd(4,`linkProgram for ${this._getName()}`)(),t.debug||Nw.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${t.getProgramInfoLog(this.handle)}`);if(t.validateProgram(this.handle),!t.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${t.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e1)for(let e=0;ee.name===t.name)||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"==typeof t?t:t.name;this._defaultModules=this._defaultModules.filter(t=>t.name!==e),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(t={}){const{vs:e="",fs:n="",defines:i={},inject:r={},varyings:s=[],bufferMode:o=35981,transpileToGLSL100:a=!1}=t,l=this._getModuleList(t.modules),c=this._getHash(e),u=this._getHash(n),h=l.map(t=>this._getHash(t.name)).sort(),d=s.map(t=>this._getHash(t)),p=Object.keys(i).sort(),f=Object.keys(r).sort(),g=[],m=[];for(const y of p)g.push(this._getHash(y)),g.push(this._getHash(i[y]));for(const y of f)m.push(this._getHash(y)),m.push(this._getHash(r[y]));const b=`${c}/${u}D${g.join("/")}M${h.join("/")}I${m.join("/")}V${d.join("/")}H${this.stateHash}B${o}${a?"T":""}`;if(!this._programCache[b]){const t=function(t,e){const{vs:n,fs:i}=e,r=nC(e.modules||[]);return{gl:t,vs:EC(t,Object.assign({},e,{source:n,type:BE,modules:r})),fs:EC(t,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:CC(r)}}(this.gl,{vs:e,fs:n,modules:l,inject:r,defines:i,hookFunctions:this._hookFunctions,transpileToGLSL100:a});this._programCache[b]=new rO(this.gl,{hash:b,vs:t.vs,fs:t.fs,varyings:s,bufferMode:o}),this._getUniforms[b]=t.getUniforms||(t=>{}),this._useCounts[b]=0}return this._useCounts[b]++,this._programCache[b]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(t=[]){const e=new Array(this._defaultModules.length+t.length),n={};let i=0;for(let r=0,s=this._defaultModules.length;r-1)return"Edge";const n=-1!==e.indexOf("MSIE "),i=-1!==e.indexOf("Trident/");return n||i?"IE":vw.chrome?"Chrome":vw.safari?"Safari":vw.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new aO(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return aO.MAX_ATTRIBUTES=aO.MAX_ATTRIBUTES||t.getParameter(34921),aO.MAX_ATTRIBUTES}static setConstant(t,e,n){switch(n.constructor){case Float32Array:aO._setConstantFloatArray(t,e,n);break;case Int32Array:aO._setConstantIntArray(t,e,n);break;case Uint32Array:aO._setConstantUintArray(t,e,n);break;default:Rx(!1)}}constructor(t,e={}){super(t,Object.assign({},e,{id:e.id||e.program&&e.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return aO.getMaxAttributes(this.gl)}initialize(t={}){return this.setProps(t)}setProps(t){return this}setElementBuffer(t=null,e={}){return Rx(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,t?t.handle:null)}),this}setBuffer(t,e,n){if(34963===e.target)return this.setElementBuffer(e,n);const{size:i,type:r,stride:s,offset:o,normalized:a,integer:l,divisor:c}=n,{gl:u,gl2:h}=this;return t=Number(t),this.bind(()=>{u.bindBuffer(34962,e.handle),l?(Rx(Fw(u)),h.vertexAttribIPointer(t,i,r,s,o)):u.vertexAttribPointer(t,i,r,a,s,o),u.enableVertexAttribArray(t),h.vertexAttribDivisor(t,c||0)}),this}enable(t,e=!0){return!e&&0===t&&!aO.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind(()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t))),this}getConstantBuffer(t,e){const n=this._normalizeConstantArrayValue(e),i=n.byteLength*t,r=n.length*t;let s=!this.buffer;if(this.buffer=this.buffer||new tS(this.gl,i),s=s||this.buffer.reallocate(i),s=s||!this._compareConstantArrayValues(n,this.bufferValue),s){const t=function(t,e){return new t(function(t){return(!oO||oO.byteLength{switch(t){case 34373:return this.gl.getVertexAttribOffset(e,t);default:return this.gl.getVertexAttrib(e,t)}})}}const lO=/^(.+)__LOCATION_([0-9]+)$/,cO=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class uO{constructor(t,e={}){this.id=e.id||e.program&&e.program.id,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new aO(t),zx(this,"VertexArray","v6.0",cO),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(t={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind(()=>{for(const e in t)this._setAttribute(e,t[e]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(t=null,e={}){return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e,n={}){if(34963===e.target)return this.setElementBuffer(e,n);const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,e.accessor,n);return i>=0&&(this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,r)),this}setConstant(t,e,n={}){const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},n));return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new tS(this.gl,{accessor:{size:4}});for(let t=0;t{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t{this._setConstantAttributes(t,e),i=n()}),i}_resolveLocationAndAccessor(t,e,n,i){const r={location:-1,accessor:null},{location:s,name:o}=this._getAttributeIndex(t);if(!Number.isFinite(s)||s<0)return this.unused[t]=e,Nw.once(3,()=>`unused value ${t} in ${this.id}`)(),r;const a=this._getAttributeInfo(o||s);if(!a)return r;const l=Kx.resolve(a.accessor,this.accessors[s]||{},n,i),{size:c,type:u}=l;return Rx(Number.isFinite(c)&&Number.isFinite(u)),{location:s,accessor:l}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const n=lO.exec(t),i=n?n[1]:t,r=n?Number(n[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(i)+r,name:i}:{location:-1}}_setAttribute(t,e){if(e instanceof tS)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof tS)this.setBuffer(t,e[0],e[1]);else if(ArrayBuffer.isView(e)||Array.isArray(e))this.setConstant(t,e);else{if(!(e.buffer instanceof tS))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(t,e.buffer,e)}}_setConstantAttributes(t,e){const n=Math.max(0|t,0|e);let i=this.values[0];ArrayBuffer.isView(i)&&this._setConstantAttributeZero(i,n);for(let r=1;r0;if(t.isInstanced=t.isInstanced||s,n instanceof tS){const e=n;if(s){const n=e.getVertexCount(i);t.instanceCount=Math.min(t.instanceCount,n)}else{const n=e.getVertexCount(i);t.vertexCount=Math.min(t.vertexCount,n)}}}setElements(t=null,e={}){return Nw.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}function hO(t,e={}){const{isInteger:n=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){const{maxElts:n=16,size:i=1}=e;let r="[";for(let s=0;s0&&(r+=","+(s%i==0?" ":"")),r+=hO(t[s],e);return`${r}${t.length>n?"...":"]"}`}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return n?"0":"0.";if(n||Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const i=t.toPrecision(2);return i.indexOf(".0")===i.length-2?i.slice(0,-1):i}function dO(t,e,n,i){const{gl:r}=t;if(!e)return{[i]:"null","Format ":"N/A"};let s,o,a,l="NOT PROVIDED",c=1,u=0,h=0;if(n&&(l=n.type,c=n.size,l=String(l).replace("Array",""),s=-1!==l.indexOf("nt")),e instanceof tS){const t=e,{data:d,changed:p}=t.getDebugData();let f;return o=p?"*":"",a=d,h=t.byteLength,u=h/d.BYTES_PER_ELEMENT/c,n?f=`${n.divisor>0?"I ":"P "} ${u} (x${c}=${h} bytes ${Lx(r,l)})`:(s=!0,f=`${h} bytes`),{[i]:`${o}${hO(a,{size:c,isInteger:s})}`,"Format ":f}}return a=e,c=e.length,l=String(e.constructor.name).replace("Array",""),s=-1!==l.indexOf("nt"),{[i]:`${hO(a,{size:c,isInteger:s})} (constant)`,"Format ":`${c}x${l} (constant)`}}function pO(t,e){const{type:n,size:i}=e,r=tO(n,i);return r?`${t} (${r.name})`:t}function fO({header:t="Uniforms",program:e,uniforms:n,undefinedOnly:i=!1}){Rx(e);const r=".*Matrix",s={},o=Object.keys(e._uniformSetters).sort();let a=0;for(const u of o)!u.match(".*_.*")&&!u.match(r)&&gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)u.match(r)&&gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)s[u]||gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;let l=0;const c={};if(!i)for(const u in n){const e=n[u];s[u]||(l++,c[u]={Type:`NOT USED: ${e}`,[t]:hO(e)})}return{table:s,count:a,unusedTable:c,unusedCount:l}}function gO({table:t,header:e,uniforms:n,uniformName:i,undefinedOnly:r}){const s=n[i],o=function(t){return null!=t}(s);return!(r&&o||(t[i]={[e]:o?hO(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function mO(t){const{type:e,size:n}=t.accessor,i=tO(e,n);return i?`${i.name} ${t.name}`:t.name}const bO={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function yO(t,e){const{attributeMap:n=bO}=e||{};return n&&n[t]||t}function vO(t,e){let n;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Rx(Number.isFinite(e.size),`attribute ${t} needs size`)}const _O=()=>{},wO={};class xO{constructor(t,e={}){const{id:n=Fx("model")}=e;Rx(jw(t)),this.id=n,this.gl=t,this.id=e.id||Fx("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||sO.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},Rx(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return Rx(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return Rx(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,n){const i={};let r=e.indices;for(const s in e.attributes){const n=e.attributes[s],o=yO(s,undefined);if("indices"===s)r=n;else if(n.constant)i[o]=n.value;else{const e=n.value,r=bt({},n);delete r.value,i[o]=[new tS(t,e),r],vO(s,r)}}if(r){const e=r.value||r;Rx(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const n={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new tS(t,{data:e,target:34963}),n]}return i}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(t={}){if(Vx(t))return this;const e={};for(const n in t){const i=t[n];e[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(e),this}setUniforms(t={}){return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return pS(this.program.gl,t),this}draw(t={}){this._checkProgram();const{moduleSettings:e=null,framebuffer:n,uniforms:i={},attributes:r={},transformFeedback:s=this.transformFeedback,parameters:o={},vertexArray:a=this.vertexArray}=t;let l;this.setAttributes(r),this.updateModuleSettings(e),this.setUniforms(i),Nw.priority>=2&&(l=this._logDrawCallStart(2));const c=this.vertexArray.getDrawParams(),{isIndexed:u=c.isIndexed,indexType:h=c.indexType,indexOffset:d=c.indexOffset,vertexArrayInstanced:p=c.isInstanced}=this.props;p&&!this.isInstanced&&Nw.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:f,instanceCount:g}=this,{onBeforeRender:m=_O,onAfterRender:b=_O}=this.props;m(),this.program.setUniforms(this.uniforms);const y=this.program.draw(Object.assign(wO,t,{logPriority:l,uniforms:null,framebuffer:n,parameters:o,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:a,transformFeedback:s,isIndexed:u,indexType:h,isInstanced:f,instanceCount:g,offset:u?d:0}));return b(),Nw.priority>=2&&this._logDrawCallEnd(l,a,n),y}transform(t={}){const{discard:e=!0,feedbackBuffers:n,unbindModels:i=[]}=t;let{parameters:r}=t;n&&this._setFeedbackBuffers(n),e&&(r=Object.assign({},r,{35977:e})),i.forEach(t=>t.vertexArray.unbindBuffers());try{this.draw(Object.assign({},t,{parameters:r}))}finally{i.forEach(t=>t.vertexArray.bindBuffers())}return this}render(t={}){return Nw.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:n,modules:i,inject:r,defines:s,varyings:o,bufferMode:a,transpileToGLSL100:l}=this.programProps;t=this.programManager.get({vs:e,fs:n,modules:i,inject:r,defines:s,varyings:o,bufferMode:a,transpileToGLSL100:l}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Rx(t instanceof rO,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new uO(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof tS&&e.delete()}}_setAnimationProps(t){this.animated&&Rx(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(t={}){if(Vx(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new LE(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:Nw.level<=2})(),t}_logDrawCallEnd(t,e,n,i){if(void 0===t)return;const r=function({vertexArray:t,header:e="Attributes"}){if(!t.configuration)return{};const n={};t.elements&&(n.ELEMENT_ARRAY_BUFFER=dO(t,t.elements,null,e));const i=t.values;for(const r in i){const s=t._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=t.accessors[s.location];a&&(o=`${r}: ${pO(s.name,a)}`),n[o]=dO(t,i[r],a,e)}}return n}({vertexArray:e,header:`${this.id} attributes`,attributes:this._attributes}),{table:s,unusedTable:o,unusedCount:a}=fO({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),{table:l,count:c}=fO({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0});c>0&&Nw.log("MISSING UNIFORMS",Object.keys(l))(),a>0&&Nw.log("UNUSED UNIFORMS",Object.keys(o))();const u=function(t){const e={},n=`Accessors for ${t.id}`;for(const i of t.attributeInfos)i&&(e[`in ${mO(i)}`]={[n]:JSON.stringify(i.accessor)});for(const i of t.varyingInfos)i&&(e[`out ${mO(i)}`]={[n]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);Nw.table(t,r)(),Nw.table(t,s)(),Nw.table(t+1,u)(),i&&i.log({logLevel:2,message:`Rendered to ${i.id}`}),Nw.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class SO{static isSupported(t){return Fw(t)}constructor(t,e={}){this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:n}=this;t&&t.delete(),e&&e.delete(),n&&n.delete()}run(t={}){const{clearRenderTarget:e=!0}=t,n=this._updateDrawOptions(t);e&&n.framebuffer&&n.framebuffer.clear({color:!0}),this.model.transform(n)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)t=t||n.swap();Rx(t,"Nothing to swap")}getBuffer(t=null){return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(t={}){const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e){const e=n.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(t={}){"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)n.update(t)}_initialize(t={}){const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new xO(e,Object.assign({},t,{fs:t.fs||NE({version:FE(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=i.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){return!(Vx(t.feedbackBuffers)&&Vx(t.feedbackMap)&&!(t.varyings&&t.varyings.length>0))})(e)&&(this.bufferTransform=new jE(t,e)),function(t){return!(Vx(t._sourceTextures)&&!t._targetTexture&&!t._targetTextureVarying)}(e)&&(this.textureTransform=new QE(t,e)),Rx(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=Object.assign(e,i.getDrawOptions(e));return e}}function EO(){}const CO={onStart:EO,onUpdate:EO,onInterrupt:EO,onEnd:EO};class OO{constructor(t){this._inProgress=!1,this._handle=null,this.timeline=t,this.settings={}}get inProgress(){return this._inProgress}start(t){this.cancel(),this.settings=bt(bt({},CO),t),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const TO={interpolation:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="interpolation",this.transition=new OO(n),this.attribute=e,this.attributeInTransition=new kE(t,e.settings),this.currentStartIndices=e.startIndices,this.currentLength=0,this.transform=function(t,e){const n=EE(e.size);return new SO(t,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(t,e);const i={byteLength:0,usage:35050};this.buffers=[new tS(t,i),new tS(t,i)]}get inProgress(){return this.transition.inProgress}start(t,e){if(t.duration<=0)return void this.transition.cancel();const{buffers:n,attribute:i}=this;CE(n);const r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)TE(bt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=OE(i,e),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:n[0],aTo:SE(0,i)},feedbackBuffers:{vCurrent:n[1]}})}update(){const t=this.transition.update();if(t){const{time:t,settings:{duration:e,easing:n}}=this.transition,i=n(t/e);this.transform.run({uniforms:{time:i}})}return t}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="spring",this.transition=new OO(n),this.attribute=e,this.attributeInTransition=new kE(t,ti(bt({},e.settings),{normalized:!1})),this.currentStartIndices=e.startIndices,this.currentLength=0,this.texture=function(t){return new lS(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(t),this.framebuffer=function(t,e){return new SS(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(t,this.texture),this.transform=function(t,e,n){const i=EE(e.size);return new SO(t,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(t,e,this.framebuffer);const i={byteLength:0,usage:35050};this.buffers=[new tS(t,i),new tS(t,i),new tS(t,i)]}get inProgress(){return this.transition.inProgress}start(t,e){const{buffers:n,attribute:i}=this,r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)TE(bt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=OE(i,e),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aTo:SE(0,i)}})}update(){const{buffers:t,transform:e,framebuffer:n,transition:i}=this;return!!i.update()&&(e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:i.settings.stiffness,damping:i.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),CE(t),this.attributeInTransition.update({buffer:t[1],value:this.attribute.value}),_S(n)[0]>0||i.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class kO{constructor(t,{id:e,timeline:n}){this.id=e,this.gl=t,this.timeline=n,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=SO.isSupported(t)}finalize(){for(const t in this.transitions)this._removeTransition(t)}update({attributes:t,transitions:e,numInstances:n}){this.numInstances=n||1;for(const i in t){const n=t[i],r=n.getTransitionSetting(e);!r||this._updateAttribute(i,n,r)}for(const i in this.transitions){const n=t[i];(!n||!n.getTransitionSetting(e))&&this._removeTransition(i)}}hasAttribute(t){const e=this.transitions[t];return e&&e.inProgress}getAttributes(){const t={};for(const e in this.transitions){const n=this.transitions[e];n.inProgress&&(t[e]=n.attributeInTransition)}return t}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const e in this.transitions)this.transitions[e].update()&&(this.needsRedraw=!0);const t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].cancel(),delete this.transitions[t]}_updateAttribute(t,e,n){const i=this.transitions[t];let r=!i||i.type!==n.type;if(r){if(!this.isSupported)return void Iw.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();i&&this._removeTransition(t);const s=TO[n.type];s?this.transitions[t]=new s({attribute:e,timeline:this.timeline,gl:this.gl}):(Iw.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}const AO="attributeManager.invalidate";class PO{constructor(t,{id:e="attribute-manager",stats:n,timeline:i}={}){this.id=e,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=n,this.attributeTransitionManager=new kO(t,{id:"".concat(e,"-transitions"),timeline:i}),Object.seal(this)}finalize(){for(const t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(t={clearRedrawFlags:!1}){const e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}setNeedsRedraw(t=!0){return this.needsRedraw=!0,this}add(t,e){this._add(t,e)}addInstanced(t,e){this._add(t,e,{instanced:1})}remove(t){for(let e=0;e{t[n]||(t[n]=[]),t[n].push(e)});this.updateTriggers=t}_invalidateTrigger(t,e){const{attributes:n,updateTriggers:i}=this,r=i[t];return r&&r.forEach(t=>{const i=n[t];i&&i.setNeedsUpdate(i.id,e)}),r}_updateAttribute(t){const{attribute:e,numInstances:n}=t;PE("attribute.updateStart",e),e.allocate(n)&&PE("attribute.allocate",e,n),e.updateBuffer(t)&&(this.needsRedraw=!0,PE("attribute.updateEnd",e,n))}}function IO(t,e,n,i,r){const s=e-t;return(n-e)*r+-s*i+s+e}function MO(t,e){if(Array.isArray(t)){let n=0;for(let i=0;i0}add(t,e,n,i){const{transitions:r}=this;if(r.has(t)){const n=r.get(t),{value:i=n.settings.fromValue}=n;e=i,this.remove(t)}if(!(i=xE(i)))return;const s=DO[i.type];if(!s)return void Iw.error("unsupported transition type '".concat(i.type,"'"))();const o=new s(this.timeline);o.start(ti(bt({},i),{fromValue:e,toValue:n})),r.set(t,o)}remove(t){const{transitions:e}=this;e.has(t)&&(e.get(t).cancel(),e.delete(t))}update(){const t={};for(const[e,n]of this.transitions)n.update(),t[e]=n.value,n.inProgress||this.remove(e);return t}clear(){for(const t of this.transitions.keys())this.remove(t)}}const NO={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:LO}=NO;function jO(t,e){if(!t.transitions)return null;const n={},i=UO(t);for(const r in t.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&BO(t[r],e[r],s)&&(n[r]=!0)}return n}function FO({newProps:t,oldProps:e,ignoreProps:n={},propTypes:i={},triggerName:r="props"}={}){if(e===t)return null;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(t))if(!(s in n)){if(!(s in e))return"".concat(r,".").concat(s," added");const n=BO(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}for(const s of Object.keys(e))if(!(s in n)){if(!(s in t))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(t,s)){const n=BO(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}}return null}function BO(t,e,n){let i=n&&n.equal;return i&&!i(t,e,n)||!i&&(i=t&&e&&t.equals,i&&!i.call(t,e))?"changed deeply":i||e===t?null:"changed shallowly"}function VO(t,e){if(null===e)return"oldProps is null, initial diff";const n=e.extensions,{extensions:i}=t;if(i===n)return!1;if(i.length!==n.length)return!0;for(let r=0;r{for(const r in i)if(!HO(i[r],n[r])){e=t(i),n=i;break}return e}}function GO(t,e){if(!e)return t;const n=bt(bt({},t),e);if("defines"in e&&(n.defines=bt(bt({},t.defines),e.defines)),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some(t=>"project64"===t.name))){const t=n.modules.findIndex(t=>"project32"===t.name);t>=0&&n.modules.splice(t,1)}if("inject"in e)if(t.inject){const i=bt({},t.inject);for(const t in e.inject)i[t]=(i[t]||"")+e.inject[t];n.inject=i}else n.inject=e.inject;return n}function WO(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],g=e[13],m=e[14],b=e[15],y=n*a-i*o,v=n*l-r*o,_=n*c-s*o,w=i*l-r*a,x=i*c-s*a,S=r*c-s*l,E=u*g-h*f,C=u*m-d*f,O=u*b-p*f,T=h*m-d*g,k=h*b-p*g,A=d*b-p*m,P=y*A-v*k+_*T+w*O-x*C+S*E;return P?(t[0]=(a*A-l*k+c*T)*(P=1/P),t[1]=(r*k-i*A-s*T)*P,t[2]=(g*S-m*x+b*w)*P,t[3]=(d*x-h*S-p*w)*P,t[4]=(l*O-o*A-c*C)*P,t[5]=(n*A-r*O+s*C)*P,t[6]=(m*_-f*S-b*v)*P,t[7]=(u*S-d*_+p*v)*P,t[8]=(o*k-a*O+c*E)*P,t[9]=(i*O-n*k-s*E)*P,t[10]=(f*x-g*_+b*y)*P,t[11]=(h*_-u*x-p*y)*P,t[12]=(a*C-o*T-l*E)*P,t[13]=(n*T-i*C+r*E)*P,t[14]=(g*v-f*w-m*y)*P,t[15]=(u*w-h*v+d*y)*P,t):null}function qO(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],b=e[14],y=e[15],v=n[0],_=n[1],w=n[2],x=n[3];return t[0]=v*i+_*a+w*h+x*g,t[1]=v*r+_*l+w*d+x*m,t[2]=v*s+_*c+w*p+x*b,t[3]=v*o+_*u+w*f+x*y,t[4]=(v=n[4])*i+(_=n[5])*a+(w=n[6])*h+(x=n[7])*g,t[5]=v*r+_*l+w*d+x*m,t[6]=v*s+_*c+w*p+x*b,t[7]=v*o+_*u+w*f+x*y,t[8]=(v=n[8])*i+(_=n[9])*a+(w=n[10])*h+(x=n[11])*g,t[9]=v*r+_*l+w*d+x*m,t[10]=v*s+_*c+w*p+x*b,t[11]=v*o+_*u+w*f+x*y,t[12]=(v=n[12])*i+(_=n[13])*a+(w=n[14])*h+(x=n[15])*g,t[13]=v*r+_*l+w*d+x*m,t[14]=v*s+_*c+w*p+x*b,t[15]=v*o+_*u+w*f+x*y,t}function XO(t,e,n){var i,r,s,o,a,l,c,u,h,d,p,f,g=n[0],m=n[1],b=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*b+e[12],t[13]=e[1]*g+e[5]*m+e[9]*b+e[13],t[14]=e[2]*g+e[6]*m+e[10]*b+e[14],t[15]=e[3]*g+e[7]*m+e[11]*b+e[15]):(r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=i=e[0],t[1]=r,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=i*g+a*m+h*b+e[12],t[13]=r*g+l*m+d*b+e[13],t[14]=s*g+c*m+p*b+e[14],t[15]=o*g+u*m+f*b+e[15]),t}function YO(t,e,n){var i=n[0],r=n[1],s=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function KO(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*i,t[5]=o*r+u*i,t[6]=a*r+h*i,t[7]=l*r+d*i,t[8]=c*r-s*i,t[9]=u*r-o*i,t[10]=h*r-a*i,t[11]=d*r-l*i,t}function QO(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*i,t[1]=o*r+u*i,t[2]=a*r+h*i,t[3]=l*r+d*i,t[4]=c*r-s*i,t[5]=u*r-o*i,t[6]=h*r-a*i,t[7]=d*r-l*i,t}function ZO(t,e,n,i,r){var s,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+i)*(s=1/(i-r)),t[14]=2*r*i*s):(t[10]=-1,t[14]=-2*i),t}function JO(t,e){var n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],b=t[15],y=e[0],v=e[1],_=e[2],w=e[3],x=e[4],S=e[5],E=e[6],C=e[7],O=e[8],T=e[9],k=e[10],A=e[11],P=e[12],I=e[13],M=e[14],D=e[15];return Math.abs(n-y)<=WS*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-v)<=WS*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(r-_)<=WS*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(s-w)<=WS*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(o-x)<=WS*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-S)<=WS*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(l-E)<=WS*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-C)<=WS*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(u-O)<=WS*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(h-T)<=WS*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-k)<=WS*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-A)<=WS*Math.max(1,Math.abs(p),Math.abs(A))&&Math.abs(f-P)<=WS*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(g-I)<=WS*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(m-M)<=WS*Math.max(1,Math.abs(m),Math.abs(M))&&Math.abs(b-D)<=WS*Math.max(1,Math.abs(b),Math.abs(D))}function tT(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function eT(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*s+n[12]*o,t[1]=n[1]*i+n[5]*r+n[9]*s+n[13]*o,t[2]=n[2]*i+n[6]*r+n[10]*s+n[14]*o,t[3]=n[3]*i+n[7]*r+n[11]*s+n[15]*o,t}!function(){var t=new qS(4);qS!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();const nT=[0,0,0,0],iT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],rT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],sT=[0,0,0],oT=[0,0,0],aT=$O(function({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(t,e,n){const{viewMatrixUncentered:i,projectionMatrix:r}=t;let{viewMatrix:s,viewProjectionMatrix:o}=t,a=nT,l=nT,c=t.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:d}=lT(t,e,n);return d&&(l=t.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=eT([],l,o),s=i||s,o=qO([],r,s),o=qO([],o,iT)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(t,n,i),u=t.getDistanceScales(),h=[t.width*e,t.height*e],d=t.projectionMatrix.transform([0,0,-t.focalDistance,1])[3]||1,p={project_uCoordinateSystem:n,project_uProjectionMode:t.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:h,project_uDevicePixelRatio:e,project_uFocalDistance:d,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:sT,project_uScale:t.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const e=t.getDistanceScales(c);switch(n){case Mw.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerMeter2;break;case Mw.LNGLAT:case Mw.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerDegree2;break;case Mw.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,e.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,e.unitsPerMeter2[2]]}}return p});function lT(t,e,n=oT){let i,r=n,s=!0;switch(i=e===Mw.LNGLAT_OFFSETS||e===Mw.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case Dw.WEB_MERCATOR:(e===Mw.LNGLAT||e===Mw.CARTESIAN)&&(s=!1);break;case Dw.WEB_MERCATOR_AUTO_OFFSET:e===Mw.LNGLAT?r=i:e===Mw.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case Dw.IDENTITY:r=t.position.map(Math.fround);break;case Dw.GLOBE:s=!1,i=null;break;default:s=!1}return r[2]=r[2]||0,{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}class cT extends VS{get ELEMENTS(){return BS(!1),0}get RANK(){return BS(!1),0}toString(){let t="[";if(IS.printRowMajor){t+="row-major:";for(let e=0;e2*Math.PI)throw Error("radians");const s=n*Math.tan(t/2),o=s*e;return(new bT).ortho({left:-o,right:o,bottom:-s,top:s,near:i,far:r})}perspective({fovy:t,fov:e=45*Math.PI/180,aspect:n=1,near:i=.1,far:r=500}={}){if((t=t||e)>2*Math.PI)throw Error("radians");return ZO(this,t,n,i,r),this.check()}determinant(){return function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],p=t[12],f=t[13],g=t[14],m=t[15];return(e*o-n*s)*(h*m-d*g)-(e*a-i*s)*(u*m-d*f)+(e*l-r*s)*(u*g-h*f)+(n*a-i*o)*(c*m-d*p)-(n*l-r*o)*(c*g-h*p)+(i*l-r*a)*(c*f-u*p)}(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const n=this.getScale(e||[-0,-0,-0]),i=1/n[0],r=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*r,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*r,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const n=this.getScale(e||[-0,-0,-0]),i=1/n[0],r=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*s,t[3]=this[4]*i,t[4]=this[5]*r,t[5]=this[6]*s,t[6]=this[8]*i,t[7]=this[9]*r,t[8]=this[10]*s,t}transpose(){return function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=r,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]}(this,this),this.check()}invert(){return WO(this,this),this.check()}multiplyLeft(t){return qO(this,t,this),this.check()}multiplyRight(t){return qO(this,this,t),this.check()}rotateX(t){return KO(this,this,t),this.check()}rotateY(t){return function(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*i,t[1]=o*r-u*i,t[2]=a*r-h*i,t[3]=l*r-d*i,t[8]=s*i+c*r,t[9]=o*i+u*r,t[10]=a*i+h*r,t[11]=l*i+d*r}(this,this,t),this.check()}rotateZ(t){return QO(this,this,t),this.check()}rotateXYZ([t,e,n]){return this.rotateX(t).rotateY(e).rotateZ(n)}rotateAxis(t,e){return function(t,e,n,i){var r,s,o,a,l,c,u,h,d,p,f,g,m,b,y,v,_,w,x,S,E,C,O,T,k=i[0],A=i[1],P=i[2],I=Math.hypot(k,A,P);I=-90&&e<=90,"invalid latitude"),[512*(t*ET+xT)/(2*xT),512*(xT+Math.log(Math.tan(ST+e*ET*.5)))/(2*xT)]}function kT([t,e]){const n=t/512*(2*xT)-xT,i=2*(Math.atan(Math.exp(e/512*(2*xT)-xT))-ST);return[n*CT,i*CT]}function AT({latitude:t,longitude:e,highPrecision:n=!1}){wT(Number.isFinite(t)&&Number.isFinite(e));const i={},r=Math.cos(t*ET),s=512/360,o=s/r,a=512/OT/r;if(i.unitsPerMeter=[a,a,a],i.metersPerUnit=[1/a,1/a,1/a],i.unitsPerDegree=[s,o,a],i.degreesPerUnit=[1/s,1/o,1/a],n){const e=ET*Math.tan(t*ET)/r,n=512/OT*e,l=n/o*a;i.unitsPerDegree2=[0,s*e/2,n],i.unitsPerMeter2=[l,0,l]}return i}function PT(t,e){const[n,i,r]=t,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=AT({longitude:n,latitude:i,highPrecision:!0}),u=TT(t);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=kT(u),d=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],d]:h}function IT({height:t,pitch:e,bearing:n,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return XO(o,o,[0,0,-i]),KO(o,o,-e*ET),QO(o,o,n*ET),YO(o,o,[r/=t,r,r]),s&&XO(o,o,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],s)),o}function MT({width:t,height:e,fovy:n=DT(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(n=DT(i));const a=.5*n*ET,l=RT(n),c=r*ET,u=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:t/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}function DT(t){return 2*Math.atan(.5/t)*CT}function RT(t){return.5/Math.tan(.5*t*ET)}function NT(t,e){const[n,i,r=0]=t;return wT(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),yT(e,[n,i,r,1])}function LT(t,e,n=0){const[i,r,s]=t;if(wT(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return yT(e,[i,r,s,1]);const o=yT(e,[i,r,0,1]),a=yT(e,[i,r,1,1]),l=o[2],c=a[2];return dT([],o,a,l===c?0:((n||0)-l)/(c-l))}function jT({width:t,height:e,bounds:n,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=n;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:wT(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=new zT({width:t,height:e,longitude:0,latitude:0,zoom:0}),d=h.project([a,u]),p=h.project([c,l]),f=[Math.max(Math.abs(p[0]-d[0]),i),Math.max(Math.abs(p[1]-d[1]),i)],g=[t-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];wT(g[0]>0&&g[1]>0);const m=g[0]/f[0],b=g[1]/f[1],y=h.unproject([(p[0]+d[0])/2+(s.right-s.left)/2/m,(p[1]+d[1])/2+(s.bottom-s.top)/2/b]),v=Math.min(r,h.zoom+_T(Math.abs(Math.min(m,b))));return wT(Number.isFinite(v)),{longitude:y[0],latitude:y[1],zoom:v}}const FT=Math.PI/180;function BT(t,e=0){const{width:n,height:i,unproject:r}=t,s={targetZ:e},o=r([0,i],s),a=r([n,i],s);let l,c;return(t.fovy?.5*t.fovy*FT:Math.atan(.5/t.altitude))>(90-t.pitch)*FT-.01?(l=VT(t,0,e),c=VT(t,n,e)):(l=r([0,0],s),c=r([n,0],s)),[o,a,c,l]}function VT(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=yT(i,[e,0,1,1]),s=yT(i,[e,t.height,1,1]),o=kT(dT([],r,s,(n*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return o[2]=n,o}class zT{constructor({width:t,height:e,latitude:n=0,longitude:i=0,zoom:r=0,pitch:s=0,bearing:o=0,altitude:a=null,fovy:l=null,position:c=null,nearZMultiplier:u=.02,farZMultiplier:h=1.01}={width:1,height:1}){t=t||1,e=e||1,null===l&&null===a?l=DT(a=1.5):null===l?l=DT(a):null===a&&(a=RT(l));const d=function(t){return Math.pow(2,t)}(r);a=Math.max(.75,a);const p=AT({longitude:i,latitude:n}),f=TT([i,n]);f[2]=0,c&&function(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}(f,f,function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}([],c,p.unitsPerMeter)),this.projectionMatrix=function({width:t,height:e,pitch:n,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:u}=MT({width:t,height:e,altitude:i,fovy:r,pitch:n,nearZMultiplier:s,farZMultiplier:o});return ZO([],a,l,c,u)}({width:t,height:e,pitch:s,fovy:l,nearZMultiplier:u,farZMultiplier:h}),this.viewMatrix=IT({height:e,scale:d,center:f,pitch:s,bearing:o,altitude:a}),this.width=t,this.height=e,this.scale=d,this.latitude=n,this.longitude=i,this.zoom=r,this.pitch=s,this.bearing=o,this.altitude=a,this.fovy=l,this.center=f,this.meterOffset=c||[0,0,0],this.distanceScales=p,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:t,height:e,projectionMatrix:n,viewMatrix:i}=this,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];qO(r,r,n),qO(r,r,i),this.viewProjectionMatrix=r;const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];YO(s,s,[t/2,-e/2,1]),XO(s,s,[1,-1,0]),qO(s,s,r);const o=WO([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],s);if(!o)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=s,this.pixelUnprojectionMatrix=o}equals(t){return t instanceof zT&&t.width===this.width&&t.height===this.height&&JO(t.projectionMatrix,this.projectionMatrix)&&JO(t.viewMatrix,this.viewMatrix)}project(t,{topLeft:e=!0}={}){const n=NT(this.projectPosition(t),this.pixelProjectionMatrix),[i,r]=n,s=e?r:this.height-r;return 2===t.length?[i,s]:[i,s,n[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,r,s]=t,o=LT([i,e?r:this.height-r,s],this.pixelUnprojectionMatrix,n&&n*this.distanceScales.unitsPerMeter[2]),[a,l,c]=this.unprojectPosition(o);return Number.isFinite(s)?[a,l,c]:Number.isFinite(n)?[a,l,n]:[a,l]}projectPosition(t){const[e,n]=TT(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=kT(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return TT(t)}unprojectFlat(t){return kT(t)}getMapCenterByLngLatPosition({lngLat:t,pos:e}){const n=LT(e,this.pixelUnprojectionMatrix),i=uT([],TT(t),hT([],n));return kT(uT([],this.center,i))}getLocationAtPoint({lngLat:t,pos:e}){return this.getMapCenterByLngLatPosition({lngLat:t,pos:e})}fitBounds(t,e={}){const{width:n,height:i}=this,{longitude:r,latitude:s,zoom:o}=jT(Object.assign({width:n,height:i,bounds:t},e));return new zT({width:n,height:i,longitude:r,latitude:s,zoom:o})}getBounds(t){const e=this.getBoundingRegion(t),n=Math.min(...e.map(t=>t[0])),i=Math.max(...e.map(t=>t[0]));return[[n,Math.min(...e.map(t=>t[1]))],[i,Math.max(...e.map(t=>t[1]))]]}getBoundingRegion(t={}){return BT(this,t.z||0)}}const UT=Math.PI/180,HT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],$T=[0,0,0],GT={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let WT=(()=>{class t{constructor(t={}){const{id:e=null,x:n=0,y:i=0,width:r=1,height:s=1}=t;this.id=e||this.constructor.displayName||"viewport",this.x=n,this.y=i,this.width=r||1,this.height=s||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?Dw.WEB_MERCATOR:Dw.WEB_MERCATOR_AUTO_OFFSET:Dw.IDENTITY}equals(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&FS(e.projectionMatrix,this.projectionMatrix)&&FS(e.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const n=NT(this.projectPosition(t),this.pixelProjectionMatrix),[i,r]=n,s=e?r:this.height-r;return 2===t.length?[i,s]:[i,s,n[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,r,s]=t,o=LT([i,e?r:this.height-r,s],this.pixelUnprojectionMatrix,n&&n*this.distanceScales.unitsPerMeter[2]),[a,l,c]=this.unprojectPosition(o);return Number.isFinite(s)?[a,l,c]:Number.isFinite(n)?[a,l,n]:[a,l]}projectPosition(t){const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?TT(t):t}unprojectFlat(t){return this.isGeospatial?kT(t):t}getBounds(t={}){const e={targetZ:t.z||0},n=this.unproject([0,0],e),i=this.unproject([this.width,0],e),r=this.unproject([0,this.height],e),s=this.unproject([this.width,this.height],e);return[Math.min(n[0],i[0],r[0],s[0]),Math.min(n[1],i[1],r[1],s[1]),Math.max(n[0],i[0],r[0],s[0]),Math.max(n[1],i[1],r[1],s[1])]}getDistanceScales(t=null){return t?AT({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:e,width:n=1,height:i=1}){return t{class t extends WT{constructor(t={}){const{latitude:e=0,longitude:n=0,zoom:i=11,pitch:r=0,bearing:s=0,nearZMultiplier:o=.1,farZMultiplier:a=1.01,orthographic:l=!1,repeat:c=!1,worldOffset:u=0}=t;let{width:h,height:d,altitude:p=1.5}=t;const f=Math.pow(2,i);h=h||1,d=d||1,p=Math.max(.75,p);const{fov:g,aspect:m,focalDistance:b,near:y,far:v}=MT({width:h,height:d,pitch:r,altitude:p,nearZMultiplier:o,farZMultiplier:a});let _=IT({height:d,pitch:r,bearing:s,scale:f,altitude:p});u&&(_=(new bT).translate([512*u,0,0]).multiplyLeft(_)),super(ti(bt({},t),{width:h,height:d,viewMatrix:_,longitude:n,latitude:e,zoom:i,orthographic:l,fovyRadians:g,aspect:m,focalDistance:b,near:y,far:v})),this.latitude=e,this.longitude=n,this.zoom=i,this.pitch=r,this.bearing=s,this.altitude=p,this.orthographic=l,this._subViewports=c?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const e=this.getBounds(),n=Math.floor((e[0]+180)/360),i=Math.ceil((e[2]-180)/360);for(let r=n;r<=i;r++){const e=r?new t(ti(bt({},this),{worldOffset:r})):this;this._subViewports.push(e)}}return this._subViewports}addMetersToLngLat(t,e){return PT(t,e)}panByPosition(t,e){const n=LT(e,this.pixelUnprojectionMatrix),i=uT([],this.projectFlat(t),hT([],n)),r=uT([],this.center,i),[s,o]=this.unprojectFlat(r);return{longitude:s,latitude:o}}getBounds(t={}){const e=BT(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(e,n={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=jT(bt({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:s,latitude:o,zoom:a})}}return t.displayName="WebMercatorViewport",t})();function XT(t,e,n=!1){const i=e.projectPosition(t);if(n&&e instanceof qT){const[n,r,s=0]=t,o=e.getDistanceScales([n,r]);i[2]=s*o.unitsPerMeter[2]}return i}function KT(t,{viewport:e,modelMatrix:n,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=t;switch(n&&([o,a,l]=eT([],[o,a,l,1],n)),i){case Mw.LNGLAT:return XT([o,a,l],e,s);case Mw.LNGLAT_OFFSETS:return XT([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mw.METER_OFFSETS:return XT(PT(r,[o,a,l]),e,s);case Mw.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const QT={10241:9987,10240:9729,10242:33071,10243:33071},ZT={},JT={boolean:{validate:(t,e)=>!0,equal:(t,e,n)=>Boolean(t)===Boolean(e)},number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},color:{validate:(t,e)=>e.optional&&!t||ik(t)&&(3===t.length||4===t.length),equal:(t,e,n)=>tk(t,e)},accessor:{validate(t,e){const n=rk(t);return"function"===n||n===rk(e.value)},equal:(t,e,n)=>"function"==typeof e||tk(t,e)},array:{validate:(t,e)=>e.optional&&!t||ik(t),equal:(t,e,n)=>n.compare?tk(t,e):t===e},function:{validate:(t,e)=>e.optional&&!t||"function"==typeof t,equal:(t,e,n)=>!n.compare||t===e},data:{transform:(t,e,n)=>{const{dataTransform:i}=n?n.props:{};return i&&t?i(t):t}},image:{transform:(t,e,n)=>function(t,e){const n=t.context&&t.context.gl;if(!n||!e)return null;if(e instanceof lS)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new lS(n,ti(bt({},e),{parameters:bt(bt(bt({},QT),i),t.props.textureParameters)}));return ZT[r.id]=!0,r}(n,t),release:t=>{!function(t){!t||!(t instanceof lS)||ZT[t.id]&&(t.delete(),delete ZT[t.id])}(t)}}};function tk(t,e){if(t===e)return!0;if(!ik(t)||!ik(e))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i{},this.oldProps=yk,this.oldAsyncProps=null}finalize(){for(const t in this.asyncProps){const e=this.asyncProps[t];e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){const e=this.asyncProps[t];return e&&e.resolvedValue}isAsyncPropLoading(t){if(t){const e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(const e in this.asyncProps)if(this.isAsyncPropLoading(e))return!0;return!1}reloadAsyncProp(t,e){this._watchPromise(t,Promise.resolve(e))}setAsyncProps(t){const e=t[mk]||{},n=t[gk]||t,i=t[bk]||{};for(const r in e){const t=e[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t),e[r]=this.getAsyncProp(r)}for(const r in n){const t=n[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t)}}_updateAsyncProp(t,e){if(this._didAsyncInputValueChange(t,e)){if("string"==typeof e){var n;const i=null===(n=this.layer)||void 0===n?void 0:n.props.fetch;i&&(e=i(e,{propName:t,layer:this.layer}))}if(e instanceof Promise)return void this._watchPromise(t,e);if(fE(e))return void this._resolveAsyncIterable(t,e);this._setPropValue(t,e)}}_didAsyncInputValueChange(t,e){const n=this.asyncProps[t];return e!==n.resolvedValue&&e!==n.lastValue&&(n.lastValue=e,!0)}_setPropValue(t,e){const n=this.asyncProps[t];e=this._postProcessValue(n,e),n.resolvedValue=e,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}_setAsyncPropValue(t,e,n){const i=this.asyncProps[t];i&&n>=i.resolvedLoadCount&&void 0!==e&&(this.freezeAsyncOldProps(),i.resolvedValue=e,i.resolvedLoadCount=n,this.onAsyncPropUpdated(t,e))}_watchPromise(t,e){const n=this.asyncProps[t];n.pendingLoadCount++;const i=n.pendingLoadCount;e.then(e=>{var r;e=this._postProcessValue(n,e),this._setAsyncPropValue(t,e,i);const s=null===(r=this.layer)||void 0===r?void 0:r.props.onDataLoad;"data"===t&&s&&s(e,{propName:t,layer:this.layer})}).catch(e=>{var n;null===(n=this.layer)||void 0===n||n.raiseError(e,"loading ".concat(t," of ").concat(this.layer))})}_resolveAsyncIterable(t,e){var n=this;return gS(function*(){var i;"data"!==t&&n._setPropValue(t,e);const r=n.asyncProps[t];r.pendingLoadCount++;const s=r.pendingLoadCount;let o=[],a=0;var l,c=!0,u=!1;try{for(var h,d,p=fk(e);c=(h=yield p.next()).done,d=yield h.value,!c;c=!0){const e=d,{dataTransform:i}=n.component?n.component.props:{};o=i?i(e,o):o.concat(e),Object.defineProperty(o,"__diff",{enumerable:!1,value:[{startRow:a,endRow:o.length}]}),a=o.length,n._setAsyncPropValue(t,o,s)}}catch(g){u=!0,l=g}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(u)throw l}}const f=null===(i=n.layer)||void 0===i?void 0:i.props.onDataLoad;f&&f(o,{propName:t,layer:n.layer})})()}_postProcessValue(t,e){const n=t.type;return n&&(n.release&&n.release(t.resolvedValue,n,this.component),n.transform)?n.transform(e,n,this.component):e}_createAsyncPropData(t,e){if(!this.asyncProps[t]){const n=this.component&&this.component.constructor._propTypes;this.asyncProps[t]={type:n&&n[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:_k,ASYNC_RESOLVED:wk,ASYNC_DEFAULTS:xk}=NO,Sk={};let Ek=0,Ck=(()=>{class t{constructor(){this.props=ck.apply(this,arguments),this.id=this.props.id,this.count=Ek++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:e}=this,n={};for(const i in e[xk])i in e[wk]?n[i]=e[wk][i]:i in e[_k]&&(n[i]=e[_k][i]);return new this.constructor(bt(bt(bt({},e),n),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new vk({})}}return t.componentName="Component",t.defaultProps=Sk,t})();class Ok extends vk{constructor({attributeManager:t,layer:e}){super(e),this.attributeManager=t,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(t){this.component=t}}const Tk=t=>"function"==typeof t,kk=t=>null!==t&&"object"==typeof t,Ak=t=>kk(t)&&t.constructor==={}.constructor,Pk=t=>t&&"function"==typeof t[Symbol.iterator],Ik=t=>t&&"function"==typeof t[Symbol.asyncIterator],Mk=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Dk=t=>"undefined"!=typeof Blob&&t instanceof Blob,Rk=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||kk(t)&&Tk(t.tee)&&Tk(t.cancel)&&Tk(t.getReader))(t)||(t=>kk(t)&&Tk(t.read)&&Tk(t.pipe)&&(t=>"boolean"==typeof t)(t.readable))(t);function Nk(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function Lk(t){var e;return!!t&&(Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions))}function jk(t){var e,n;let i;return Nk(t,"null loader"),Nk(Lk(t),"invalid loader"),Array.isArray(t)&&(i=t[1],t=ti(bt({},t=t[0]),{options:bt(bt({},t.options),i)})),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(n=t)&&void 0!==n&&n.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const Fk={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Bk=Fk.global||Fk.self||Fk.window||{},Vk="object"!=typeof process||"[object process]"!==String(process)||process.browser,zk="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);zk&&parseFloat(zk[1]);const Uk={};function Hk(t){for(const e in Uk)t.startsWith(e)&&(t=t.replace(e,Uk[e]));return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${t}`),t}const $k=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Gk=/^([-\w.]+\/[-\w.+]+)/;function Wk(t){const e=Gk.exec(t);return e?e[1]:t}function qk(t){const e=$k.exec(t);return e?e[1]:""}const Xk=/\?.*/;function Yk(t){if(Mk(t)){const e=Qk(t.url||"");return{url:e,type:Wk(t.headers.get("content-type")||"")||qk(e)}}return Dk(t)?{url:Qk(t.name||""),type:t.type||""}:"string"==typeof t?{url:Qk(t),type:qk(t)}:{url:"",type:""}}function Kk(t){return Mk(t)?t.headers["content-length"]||-1:Dk(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function Qk(t){return t.replace(Xk,"")}function Zk(t){return Jk.apply(this,arguments)}function Jk(){return(Jk=gS(function*(t){if(Mk(t))return t;const e={},n=Kk(t);n>=0&&(e["content-length"]=String(n));const{url:i,type:r}=Yk(t);r&&(e["content-type"]=r);const s=yield rA(t);s&&(e["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t));const o=new Response(t,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function tA(t){return eA.apply(this,arguments)}function eA(){return(eA=gS(function*(t){if(!t.ok){const e=yield nA(t);throw new Error(e)}})).apply(this,arguments)}function nA(t){return iA.apply(this,arguments)}function iA(){return(iA=gS(function*(t){let e=`Failed to fetch resource ${t.url} (${t.status}): `;try{const n=t.headers.get("Content-Type");let i=t.statusText;n.includes("application/json")&&(i+=` ${yield t.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(n){}return e})).apply(this,arguments)}function rA(t){return sA.apply(this,arguments)}function sA(){return(sA=gS(function*(t){if("string"==typeof t)return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const e=t.slice(0,5);return yield new Promise(t=>{const n=new FileReader;n.onload=e=>{var n;return t(null==e||null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsDataURL(e)})}return t instanceof ArrayBuffer?`data:base64,${oA(t.slice(0,5))}`:null})).apply(this,arguments)}function oA(t){let e="";const n=new Uint8Array(t);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const dA={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){cA(this,"console",void 0),this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},pA={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function fA(){Bk.loaders=Bk.loaders||{};const{loaders:t}=Bk;return t._state=t._state||{},t._state}const gA=()=>{const t=fA();return t.globalOptions=t.globalOptions||bt({},dA),t.globalOptions};function mA(t,e,n,i){return n=n||[],function(t,e){yA(t,null,dA,pA,e);for(const n of e)yA(t&&t[n.id]||{},n.id,n.options&&n.options[n.id]||{},n.deprecatedOptions&&n.deprecatedOptions[n.id]||{},e)}(t,n=Array.isArray(n)?n:[n]),function(t,e,n){const i=bt({},t.options||{});return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,n),null===i.log&&(i.log=new hA),_A(i,gA()),_A(i,e),i}(e,t,i)}function bA(t,e){const n=gA(),i=t||n;return"function"==typeof i.fetch?i.fetch:kk(i.fetch)?t=>aA(t,i):null!=e&&e.fetch?null==e?void 0:e.fetch:aA}function yA(t,e,n,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in t){const l=!e&&kk(t[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in n)&&!c&&!u)if(a in i)uA.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const t=vA(a,r);uA.warn(`${s} loader option '${o}${a}' not recognized. ${t}`)()}}}function vA(t,e){const n=t.toLowerCase();let i="";for(const r of e)for(const e in r.options){if(t===e)return`Did you mean '${r.id}.${e}'?`;const s=e.toLowerCase();(n.startsWith(s)||s.startsWith(n))&&(i=i||`Did you mean '${r.id}.${e}'?`)}return i}function _A(t,e){for(const n in e)n in e&&(t[n]=Ak(e[n])&&Ak(t[n])?bt(bt({},t[n]),e[n]):e[n])}function wA(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}function xA(t,e="3.0.12"){return wA(t,"no worker provided"),!(!e||!t.version)}const SA={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},EA=SA.global||SA.self||SA.window||{},CA="object"!=typeof process||"[object process]"!==String(process)||process.browser,OA="function"==typeof importScripts,TA="undefined"!=typeof window&&void 0!==window.orientation,kA="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),AA=(kA&&parseFloat(kA[1]),new Map);function PA(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function IA(t,e=!0,n){const i=n||new Set;if(t)if(MA(t))i.add(t);else if(MA(t.buffer))i.add(t.buffer);else if(!ArrayBuffer.isView(t)&&e&&"object"==typeof t)for(const r in t)IA(t[r],e,i);return void 0===n?Array.from(i):[]}function MA(t){return!!t&&(t instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&t instanceof MessagePort||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)}const DA=()=>{};class RA{static isSupported(){return"undefined"!=typeof Worker}constructor(t){cA(this,"name",void 0),cA(this,"source",void 0),cA(this,"url",void 0),cA(this,"terminated",!1),cA(this,"worker",void 0),cA(this,"onMessage",void 0),cA(this,"onError",void 0),cA(this,"_loadableURL","");const{name:e,source:n,url:i}=t;wA(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=DA,this.onError=t=>console.log(t),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=DA,this.onError=DA,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||IA(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+=`worker ${this.name}. `,t.message&&(e+=`${t.message} in `),t.lineno&&(e+=`:${t.lineno}:${t.colno}`),new Error(e)}_createBrowserWorker(){this._loadableURL=function(t){wA(t.source&&!t.url||!t.source&&t.url);let e=AA.get(t.source||t.url);return e||(t.url&&(e=function(t){return t.startsWith("http")?PA(function(t){return`try {\n importScripts('${t}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(t)):t}(t.url),AA.set(t.url,e)),t.source&&(e=PA(t.source),AA.set(t.source,e))),wA(e),e}({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}}class NA{constructor(t,e){cA(this,"name",void 0),cA(this,"workerThread",void 0),cA(this,"isRunning",void 0),cA(this,"result",void 0),cA(this,"_resolve",void 0),cA(this,"_reject",void 0),this.name=t,this.workerThread=e,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e})}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){wA(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){wA(this.isRunning),this.isRunning=!1,this._reject(t)}}class LA{constructor(t){cA(this,"name","unnamed"),cA(this,"source",void 0),cA(this,"url",void 0),cA(this,"maxConcurrency",1),cA(this,"maxMobileConcurrency",1),cA(this,"onDebug",()=>{}),cA(this,"reuseWorkers",!0),cA(this,"props",{}),cA(this,"jobQueue",[]),cA(this,"idleQueue",[]),cA(this,"count",0),cA(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props=bt(bt({},this.props),t),void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}startJob(t,e=((t,e,n)=>t.done(n)),n=((t,e)=>t.error(e))){var i=this;return gS(function*(){const r=new Promise(r=>(i.jobQueue.push({name:t,onMessage:e,onError:n,onStart:r}),i));return i._startQueuedJob(),yield r})()}_startQueuedJob(){var t=this;return gS(function*(){if(!t.jobQueue.length)return;const e=t._getAvailableWorker();if(!e)return;const n=t.jobQueue.shift();if(n){t.onDebug({message:"Starting job",name:n.name,workerThread:e,backlog:t.jobQueue.length});const i=new NA(n.name,e);e.onMessage=t=>n.onMessage(i,t.type,t.payload),e.onError=t=>n.onError(i,t),n.onStart(i);try{yield i.result}finally{t.returnWorkerToQueue(e)}}})()}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class FA{static isSupported(){return RA.isSupported()}static getWorkerFarm(t={}){return FA._workerFarm=FA._workerFarm||new FA({}),FA._workerFarm.setProps(t),FA._workerFarm}constructor(t){cA(this,"props",void 0),cA(this,"workerPools",new Map),this.props=bt({},jA),this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy()}setProps(t){this.props=bt(bt({},this.props),t);for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:n,url:i}=t;let r=this.workerPools.get(e);return r||(r=new LA({name:e,source:n,url:i}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function BA(t,e={}){const n=`${t.id}-worker.js`;let i=(e[t.id]||{}).workerUrl;if("test"===e._workerType&&(i=`modules/${t.module}/dist/${n}`),!i){let e=t.version;"latest"===e&&(e="latest"),i=`https://unpkg.com/@loaders.gl/${t.module}${e?`@${e}`:""}/dist/${n}`}return wA(i),i}function VA(t,e){return!!FA.isSupported()&&t.worker&&(null==e?void 0:e.worker)}function zA(t,e,n,i,r){return UA.apply(this,arguments)}function UA(){return(UA=gS(function*(t,e,n,i,r){const s=t.id,o=BA(t,n),a=FA.getWorkerFarm(n).getWorkerPool({name:s,url:o});n=JSON.parse(JSON.stringify(n));const l=yield a.startJob("process-on-worker",HA.bind(null,r));return l.postMessage("process",{input:e,options:n}),yield(yield l.result).result})).apply(this,arguments)}function HA(t,e,n,i){return $A.apply(this,arguments)}function $A(){return($A=gS(function*(t,e,n,i){switch(n){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:s,input:o,options:a}=i;try{const n=yield t(o,a);e.postMessage("done",{id:s,result:n})}catch(r){const t=r instanceof Error?r.message:"unknown error";e.postMessage("error",{id:s,error:t})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}})).apply(this,arguments)}cA(FA,"_workerFarm",void 0);var GA=n(9521);function WA(t){if(function(t){return t&&"object"==typeof t&&t.isBuffer}(t)&&(t=function(t){return GA.toArrayBuffer?GA.toArrayBuffer(t):t}(t)),t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"==typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"==typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function qA(...t){const e=t.map(t=>t instanceof ArrayBuffer?new Uint8Array(t):t),n=e.reduce((t,e)=>t+e.byteLength,0),i=new Uint8Array(n);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function XA(t,e,n){const i=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(i).buffer}function YA(t){return KA.apply(this,arguments)}function KA(){return(KA=gS(function*(t){const e=[];var n,i=!0,r=!1;try{for(var s,o,a=fk(t);i=(s=yield a.next()).done,o=yield s.value,!i;i=!0)e.push(o)}catch(l){r=!0,n=l}finally{try{!i&&null!=a.return&&(yield a.return())}finally{if(r)throw n}}return qA(...e)})).apply(this,arguments)}const QA=262144;function ZA(t){this.wrapped=t}function JA(t){return new ZA(t)}function tP(t){var e,n;function i(e,n){try{var s=t[e](n),o=s.value,a=o instanceof ZA;Promise.resolve(a?o.wrapped:o).then(function(t){a?i("return"===e?"return":"next",t):r(s.done?"return":"normal",t)},function(t){i("throw",t)})}catch(l){r("throw",l)}}function r(t,r){switch(t){case"return":e.resolve({value:r,done:!0});break;case"throw":e.reject(r);break;default:e.resolve({value:r,done:!1})}(e=e.next)?i(e.key,e.arg):n=null}this._invoke=function(t,r){return new Promise(function(s,o){var a={key:t,arg:r,resolve:s,reject:o,next:null};n?n=n.next=a:(e=n=a,i(t,r))})},"function"!=typeof t.return&&(this.return=void 0)}function eP(t){return function(){return new tP(t.apply(this,arguments))}}function nP(){return(nP=eP(function*(t,e){const n=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;it&&"object"==typeof t&&t.isBuffer)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const n=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let n=t.buffer;const i=t.byteLength||t.length;return(0!==t.byteOffset||i!==n.byteLength)&&(n=n.slice(t.byteOffset,t.byteOffset+i)),n}throw new Error(aP)}function cP(t,e,n){return uP.apply(this,arguments)}function uP(){return(uP=gS(function*(t,e,n){const i=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||i)return lP(t,e);if(Dk(t)&&(t=yield Zk(t)),Mk(t)){const n=t;return yield tA(n),e.binary?yield n.arrayBuffer():yield n.text()}if(Rk(t)&&(t=oP(t,n)),Pk(t)||Ik(t))return YA(t);throw new Error(aP)})).apply(this,arguments)}function hP(t,e,n=null){if(n)return n;const i=bt({fetch:bA(e,t)},t);return Array.isArray(i.loaders)||(i.loaders=null),i}function dP(t,e){if(!e&&t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...t]:t}return n&&n.length?n:null}const pP=()=>{const t=fA();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function fP(t){const e=pP();t=Array.isArray(t)?t:[t];for(const n of t){const t=jk(n);e.find(e=>t===e)||e.unshift(t)}}const gP=/\.([^.]+)$/;function mP(t){return bP.apply(this,arguments)}function bP(){return(bP=gS(function*(t,e=[],n,i){if(!vP(t))return null;let r=yP(t,e,ti(bt({},n),{nothrow:!0}),i);if(r)return r;if(Dk(t)&&(r=yP(t=yield t.slice(0,10).arrayBuffer(),e,n,i)),!(r||null!=n&&n.nothrow))throw new Error(_P(t));return r})).apply(this,arguments)}function yP(t,e=[],n,i){if(!vP(t))return null;if(e&&!Array.isArray(e))return jk(e);let r=[];e&&(r=r.concat(e)),null!=n&&n.ignoreRegisteredLoaders||r.push(...pP()),function(t){for(const e of t)jk(e)}(r);const s=function(t,e,n,i){const{url:r,type:s}=Yk(t),o=r||(null==i?void 0:i.url);let a=null;return null!=n&&n.mimeType&&(a=wP(e,null==n?void 0:n.mimeType)),a=a||function(t,e){const n=e&&gP.exec(e),i=n&&n[1];return i?function(t,e){e=e.toLowerCase();for(const n of t)for(const t of n.extensions)if(t.toLowerCase()===e)return n;return null}(t,i):null}(e,o),a=a||wP(e,s),a=a||function(t,e){if(!e)return null;for(const n of t)if("string"==typeof e){if(xP(e,n))return n}else if(ArrayBuffer.isView(e)){if(SP(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&SP(e,0,n))return n;return null}(e,t),a=a||wP(e,null==n?void 0:n.fallbackMimeType),a}(t,r,n,i);if(!(s||null!=n&&n.nothrow))throw new Error(_P(t));return s}function vP(t){return!(t instanceof Response&&204===t.status)}function _P(t){const{url:e,type:n}=Yk(t);let i="No valid loader found";return t&&(i+=` data: "${function(t,e=5){return"string"==typeof t?t.slice(0,e):ArrayBuffer.isView(t)?EP(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?EP(t,0,e):""}(t)}", contentType: "${n}"`),e&&(i+=` url: ${e}`),i}function wP(t,e){for(const n of t)if(n.mimeTypes&&n.mimeTypes.includes(e)||e===`application/x.${n.id}`)return n;return null}function xP(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(e=>t.startsWith(e))}function SP(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(i=>function(t,e,n,i){if(i instanceof ArrayBuffer)return function(t,e,n){if(t.byteLength<(n=n||t.byteLength)||e.byteLengtht.equals(e));let RP=new Uint8ClampedArray(0);const NP={data:{type:"data",value:MP,async:!0},dataComparator:null,_dataDiff:{type:"function",value:t=>t&&t.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:n,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=n.context;var a;r=r||n.getLoadOptions(),i=i||n.props.loaders,s&&(r=ti(bt({},r),{fetch:ti(bt({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(t);return!l&&!r&&(o.add({resourceId:t,data:AP(t,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:t,onChange:t=>n.internalState.reloadAsyncProp(e,t),consumerId:n.id,requestId:e}):AP(t,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mw.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,100*-t],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let LP=(()=>{class t extends Ck{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,e){var n,i,r,s;e&&(t.message="".concat(e,": ").concat(t.message)),(null===(n=(i=this.props).onError)||void 0===n?void 0:n.call(i,t))||null===(r=this.context)||void 0===r||null===(s=r.onError)||void 0===s||s.call(r,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:e}=this.context,n=KT(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,r,s]=NT(n,e.pixelProjectionMatrix);return 2===t.length?[i,r]:[i,r,s]}unproject(t){const{viewport:e}=this.context;return e.unproject(t)}projectPosition(t){return function(t,e){const{viewport:n,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(t){const e=bt({},t);let{coordinateSystem:n}=t;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=t;return n===Mw.DEFAULT&&(n=i.isGeospatial?Mw.LNGLAT:Mw.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=n),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=n,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=lT(n,i,r),h=KT(t,{viewport:n,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}(h,h,n.projectPosition(l||c));return h}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mw.DEFAULT||t===Mw.LNGLAT||t===Mw.CARTESIAN}onHover(t,e){return!!this.props.onHover&&this.props.onHover(t,e)}onClick(t,e){return!!this.props.onClick&&this.props.onClick(t,e)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,e=[]){return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}decodePickingColor(t){uE(t instanceof Uint8Array);const[e,n,i]=t;return e+256*n+65536*i-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const e of this.props.extensions)t=GO(t,e.getShaders.call(this,e));return t}shouldUpdateState({changeFlags:t}){return t.propsOrDataChanged}updateState({oldProps:t,props:e,changeFlags:n}){const i=this.getAttributeManager();if(n.dataChanged&&i){const{dataChanged:t}=n;if(Array.isArray(t))for(const e of t)i.invalidateAll(e);else i.invalidateAll()}const r=e.highlightedObjectIndex>=0||e.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==r&&i){const{pickingColors:t,instancePickingColors:e}=i.attributes,n=t||e;n&&(r&&n.constant&&(n.constant=!1,i.invalidate(n.id)),!n.value&&!r&&(n.constant=!0,n.value=[0,0,0]))}}finalizeState(){for(const e of this.getModels())e.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const e of this.getModels())e.draw(t)}getPickingInfo({info:t}){const{index:e}=t;return e>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[e]),t}activateViewport(t){const e=this.internalState.viewport;this.internalState.viewport=t,(!e||!DP({oldViewport:e,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",e=""){const n=this.getAttributeManager();!n||("all"===t?n.invalidateAll():n.invalidate(t))}updateAttributes(t){for(const e of this.getModels())this._setModelAttributes(e,t)}_updateAttributes(t){const e=this.getAttributeManager();if(!e)return;const n=this.getNumInstances(t),i=this.getStartIndices(t);e.update({data:t.data,numInstances:n,startIndices:i,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const r=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const e=t.update(),n=Object.create(this.props);for(const t in e)Object.defineProperty(n,t,{value:e[t]});return n}return this.props}calculateInstancePickingColors(t,{numInstances:e}){if(t.constant)return;const n=Math.floor(RP.length/3);if(this.internalState.usesPickingColorCache=!0,nIP&&Iw.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),RP=AS.allocate(RP,e,{size:3,copy:!0,maxCount:Math.max(e,IP)});const t=Math.floor(RP.length/3),i=[];for(let e=n;e{const i={moduleParameters:t,uniforms:e,parameters:n,context:this.context};for(const t of this.props.extensions)t.draw.call(this,i,t);this.draw(i)})}finally{this.props=i}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:e}=this.internalState;for(const i in t)if(t[i]){let n=!1;switch(i){case"dataChanged":Array.isArray(e[i])&&(e[i]=Array.isArray(t[i])?e[i].concat(t[i]):t[i],n=!0);default:e[i]||(e[i]=t[i],n=!0)}n&&PE("layer.changeFlag",this,i,t)}const n=e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged;e.propsOrDataChanged=n,e.somethingChanged=n||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,e){const n=function(t,e){const n=FO({newProps:t,oldProps:e,propTypes:UO(t),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(t,e){if(null===e)return"oldProps is null, initial diff";let n=null;const{dataComparator:i,_dataDiff:r}=t;return i?i(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied"),n&&r&&(n=r(t.data,e.data)||n),n}(t,e);let r=!1;return i||(r=function(t,e){if(null===e)return"oldProps is null, initial diff";if("all"in t.updateTriggers&&zO(t,e,"all"))return{all:!0};const n={};let i=!1;for(const r in t.updateTriggers)"all"!==r&&zO(t,e,r)&&(n[r]=!0,i=n);return i}(t,e)),{dataChanged:i,propsChanged:n,updateTriggersChanged:r,extensionsChanged:VO(t,e),transitionsChanged:jO(t,e)}}(t,e);if(n.updateTriggersChanged)for(const i in n.updateTriggersChanged)n.updateTriggersChanged[i]&&this.invalidateAttribute(i);if(n.transitionsChanged)for(const i in n.transitionsChanged)this.internalState.uniformTransitions.add(i,e[i],t[i],t.transitions[i]);return this.setChangeFlags(n)}validateProps(){!function(t){const e=UO(t);for(const n in e){const i=e[n],{validate:r}=i;if(r&&!r(t[n],i))throw new Error("Invalid prop ".concat(n,": ").concat(t[n]))}}(this.props)}setModuleParameters(t){for(const e of this.getModels())e.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const e={pickingSelectedColor:t.picked?t.color:null},{highlightColor:n}=this.props;t.picked&&"function"==typeof n&&(e.pickingHighlightColor=n(t)),this.setModuleParameters(e),this.setNeedsRedraw()}_updateModules({props:t,oldProps:e},n){const{autoHighlight:i,highlightedObjectIndex:r,highlightColor:s}=t;if(n||e.autoHighlight!==i||e.highlightedObjectIndex!==r||e.highlightColor!==s){const t={};i||(t.pickingSelectedColor=null),Array.isArray(s)&&(t.pickingHighlightColor=s),Number.isInteger(r)&&(t.pickingSelectedColor=r>=0?this.encodePickingColor(r):null),this.setModuleParameters(t)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let e=!1;e=e||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const n=this.getAttributeManager(),i=n&&n.getNeedsRedraw(t);return e=e||i,e}_getAttributeManager(){return new PO(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){uE(!this.internalState&&!this.state),uE(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Ok({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Iw.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new RO(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){PE("layer.matched",this,this===t);const{state:e,internalState:n}=t;this!==t&&(this.internalState=n,this.internalState.layer=this,this.state=e,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return t.layerName="Layer",t.defaultProps=NP,t})(),jP=(()=>{class t extends LP{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:e}=t;return e&&e.__source&&e.__source.parent&&e.__source.parent.id===this.id&&(t.object=e.__source.object,t.index=e.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}getSubLayerClass(t,e){const{_subLayerProps:n}=this.props;return n&&n[t]&&n[t].type||e}getSubLayerRow(t,e,n){return t.__source={parent:this,object:e,index:n},t}getSubLayerAccessor(t){if("function"==typeof t){const e={data:this.props.data,target:[]};return(n,i)=>n&&n.__source?(e.index=n.__source.index,t(n.__source.object,e)):t(n,i)}return t}getSubLayerProps(t={}){const{opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:s,highlightedObjectIndex:o,autoHighlight:a,highlightColor:l,coordinateSystem:c,coordinateOrigin:u,wrapLongitude:h,positionFormat:d,modelMatrix:p,extensions:f,fetch:g,_subLayerProps:m}=this.props,b={opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:s,highlightedObjectIndex:o,autoHighlight:a,highlightColor:l,coordinateSystem:c,coordinateOrigin:u,wrapLongitude:h,positionFormat:d,modelMatrix:p,extensions:f,fetch:g},y=m&&m[t.id],v=y&&y.updateTriggers,_=t.id||"sublayer";if(y){const e=this.constructor._propTypes,n=t.type?t.type._propTypes:{};for(const t in y){const i=n[t]||e[t];i&&"accessor"===i.type&&(y[t]=this.getSubLayerAccessor(y[t]))}}Object.assign(b,t,y),b.id="".concat(this.props.id,"-").concat(_),b.updateTriggers=bt(bt({all:this.props.updateTriggers.all},t.updateTriggers),v);for(const w of f){const t=w.getSubLayerProps.call(this,w);t&&Object.assign(b,t,{updateTriggers:Object.assign(b.updateTriggers,t.updateTriggers)})}return b}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const e=!t||this.needsUpdate();e&&(t=this.renderLayers(),t=gE(t,Boolean),this.internalState.subLayers=t),PE("compositeLayer.renderLayers",this,e,t);for(const n of t)n.parent=this}}return t.layerName="CompositeLayer",t})();const FP=/([0-9]+\.?[0-9]*)(%|px)/;function BP(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=t.match(FP);if(e&&e.length>=3){const t="%"===e[2],n=parseFloat(e[1]);return{position:t?n/100:n,relative:t}}default:throw new Error("Could not parse position string ".concat(t))}}function VP(t,e){return t.relative?Math.round(t.position*e):t.position}function zP(t,e){if(t===e)return!0;if(!t||!e)return!1;for(const n in t){const i=t[n],r=e[n];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&zP(i,r)))return!1}return!0}class UP{constructor(t={}){const{id:e=null,x:n=0,y:i=0,width:r="100%",height:s="100%",projectionMatrix:o=null,fovy:a=50,near:l=.1,far:c=1e3,modelMatrix:u=null,viewportInstance:h=null,type:d=WT}=t;uE(!h||h instanceof WT),this.viewportInstance=h,this.id=e||this.constructor.displayName||"view",this.type=d,this.props=ti(bt({},t),{id:this.id,projectionMatrix:o,fovy:a,near:l,far:c,modelMatrix:u}),this._parseDimensions({x:n,y:i,width:r,height:s}),this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||(this.viewportInstance?t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):zP(this.props,t.props))}makeViewport({width:t,height:e,viewState:n}){if(this.viewportInstance)return this.viewportInstance;n=this.filterViewState(n);const i=this.getDimensions({width:t,height:e});return this._getViewport(n,i)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(t){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e=bt({},t);for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions({width:t,height:e}){return{x:VP(this._x,t),y:VP(this._y,e),width:VP(this._width,t),height:VP(this._height,e)}}_getControllerProps(t){let e=this.props.controller;return e?!0===e?t:("function"==typeof e&&(e={type:e}),bt(bt({},t),e)):null}_getViewport(t,e){const{type:n}=this;return new n(bt(bt(bt({},t),this.props),e))}_parseDimensions({x:t,y:e,width:n,height:i}){this._x=BP(t),this._y=BP(e),this._width=BP(n),this._height=BP(i)}}const HP=()=>{},$P={transitionEasing:t=>t,transitionInterruption:1,onTransitionStart:HP,onTransitionInterrupt:HP,onTransitionEnd:HP};class GP{constructor(t,e={}){this.ControllerState=t,this.props=bt(bt({},$P),e),this.propsInTransition=null,this.transition=new OO(e.timeline),this.onViewStateChange=e.onViewStateChange||HP,this.onStateChange=e.onStateChange||HP,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const n=this.props;if(t=bt(bt({},$P),t),this.props=t,this._shouldIgnoreViewportChange(n,t))return e;if(this._isTransitionEnabled(t)){const{interruption:i,endProps:r}=this.transition.settings,s=bt(bt({},n),2===i?r:this.propsInTransition||n);this._triggerTransition(s,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:n}=t;return(e>0||"auto"===e)&&Boolean(n)}_isUpdateDueToCurrentTransition(t){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const n=new this.ControllerState(t),i=new this.ControllerState(e).shortestPathFrom(n),{transitionInterpolator:r}=e,s=r.getDuration?r.getDuration(t,e):e.transitionDuration;if(0===s)return;const o=e.transitionInterpolator.initializeProps(t,i);this.propsInTransition={},this.duration=s,this.transition.start({duration:s,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startProps:o.start,endProps:o.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),t(e)}}_onTransitionUpdate(t){const{time:e,settings:{interpolator:n,startProps:i,endProps:r,duration:s,easing:o}}=t,a=o(e/s),l=n.interpolateProps(i,r,a);this.propsInTransition=new this.ControllerState(bt(bt({},this.props),l)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const WP=["longitude","latitude","zoom","bearing","pitch"],qP=["longitude","latitude","zoom"];class XP extends class{constructor(t={}){Array.isArray(t)&&(t={compare:t,extract:t,required:t});const{compare:e,extract:n,required:i}=t;this._propsToCompare=e,this._propsToExtract=n,this._requiredProps=i}arePropsEqual(t,e){for(const n of this._propsToCompare||Object.keys(e))if(!(n in t)||!(n in e)||!FS(t[n],e[n]))return!1;return!0}initializeProps(t,e){let n;if(this._propsToExtract){const i={},r={};for(const n of this._propsToExtract)i[n]=t[n],r[n]=e[n];n={start:i,end:r}}else n={start:t,end:e};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}interpolateProps(t,e,n){return e}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){!this._requiredProps||this._requiredProps.forEach(e=>{const n=t[e];uE(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))})}}{constructor(t={}){super((Array.isArray(t)?t:t.transitionProps)||{compare:WP,extract:WP,required:qP}),this.opts=t}initializeProps(t,e){const n=super.initializeProps(t,e),{makeViewport:i,around:r}=this.opts;if(i&&r){const s=i(t),o=i(e),a=s.unproject(r);n.start.around=r,Object.assign(n.end,{around:o.project(a),aroundPosition:a,width:e.width,height:e.height})}return n}interpolateProps(t,e,n){const i={};for(const r of this._propsToExtract)i[r]=jS(t[r]||0,e[r]||0,n);if(e.aroundPosition){const r=this.opts.makeViewport(bt(bt({},e),i));Object.assign(i,r.panByPosition(e.aroundPosition,jS(t.around,e.around,n)))}return i}}const YP={transitionDuration:0},KP={transitionDuration:300,transitionEasing:t=>t,transitionInterruption:1},QP=t=>1-(1-t)*(1-t),ZP=["wheel"],JP=["panstart","panmove","panend"],tI=["pinchstart","pinchmove","pinchend"],eI=["tripanstart","tripanmove","tripanend"],nI=["doubletap"],iI=["keydown"];class rI{constructor(t,e={}){this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new GP(t,ti(bt({},e),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const n=this.linearTransitionProps;this._transition=n&&ti(bt({},KP),{transitionInterpolator:new XP({transitionProps:n})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(e)}get linearTransitionProps(){return null}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.setProps(this.controllerStateProps)}finalize(){for(const t in this._events)this._events[t]&&this.eventManager.off(t,this.handleEvent);this.transitionManager.finalize()}handleEvent(t){const{ControllerState:e}=this;this.controllerState=new e(bt(bt({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const n=this._eventStartBlocked;switch(t.type){case"panstart":return!n&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!n&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!n&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}getCenter(t){const{x:e,y:n}=this.controllerStateProps,{offsetCenter:i}=t;return[i.x-e,i.y-n]}isPointInBounds(t,e){const{width:n,height:i}=this.controllerStateProps;if(e&&e.handled)return!1;const r=t[0]>=0&&t[0]<=n&&t[1]>=0&&t[1]<=i;return r&&e&&e.stopPropagation(),r}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(t){const e=setTimeout(()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)},t);this._eventStartBlocked=e}setProps(t){"onViewStateChange"in t&&(this.onViewStateChange=t.onViewStateChange),"onStateChange"in t&&(this.onStateChange=t.onStateChange),"makeViewport"in t&&(this.makeViewport=t.makeViewport),"dragMode"in t&&(this.dragMode=t.dragMode),this.controllerStateProps=t,"eventManager"in t&&this.eventManager!==t.eventManager&&(this.eventManager=t.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);let{inertia:e}=t;!0===e&&(e=300),this.inertia=e;const{scrollZoom:n=!0,dragPan:i=!0,dragRotate:r=!0,doubleClickZoom:s=!0,touchZoom:o=!0,touchRotate:a=!1,keyboard:l=!0}=t,c=Boolean(this.onViewStateChange);this.toggleEvents(ZP,c&&n),this.toggleEvents(JP,c&&(i||r)),this.toggleEvents(tI,c&&(o||a)),this.toggleEvents(eI,c&&a),this.toggleEvents(nI,c&&s),this.toggleEvents(iI,c&&l),this.scrollZoom=n,this.dragPan=i,this.dragRotate=r,this.doubleClickZoom=s,this.touchZoom=o,this.touchRotate=a,this.keyboard=l}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach(t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))})}updateViewport(t,e={},n={}){const i=bt(bt({},t.getViewportProps()),e),r=this.controllerState!==t;if(this._state=t.getState(),this._setInteractionState(n),r){const t=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:t})}}_onTransition(t){this.onViewStateChange&&(t.interactionState=this._interactionState,this.onViewStateChange(t))}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let n=this.isFunctionKeyPressed(t)||t.rightButton;(this.invertPan||"pan"===this.dragMode)&&(n=!n);const i=this.controllerState[n?"panStart":"rotateStart"]({pos:e});return this._panMove=n,this.updateViewport(i,YP,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),n=this.controllerState.pan({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const n=this.getCenter(t),i=this.controllerState.pan({pos:[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2]}).panEnd();this.updateViewport(i,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),n=this.controllerState.rotate({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const n=this.getCenter(t),i=this.controllerState.rotate({pos:[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2]}).rotateEnd();this.updateViewport(i,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;t.preventDefault();const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const{speed:n=.01,smooth:i=!1}=this.scrollZoom,{delta:r}=t;let s=2/(1+Math.exp(-Math.abs(r*n)));r<0&&0!==s&&(s=1/s);const o=this.controllerState.zoom({pos:e,scale:s});return this.updateViewport(o,ti(bt({},this._getTransitionProps({around:e})),{transitionDuration:i?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.rotateStart({pos:e});return this.updateViewport(n,YP,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate||!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const n=this.controllerState.rotate({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const n=this.getCenter(t),i=[n[0],n[1]+=t.velocityY*e/2],r=this.controllerState.rotate({pos:i});this.updateViewport(r,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(n,YP,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:n}=t,i=this.getCenter(t);e=e.zoom({pos:i,scale:n})}if(this.touchRotate){const{rotation:n}=t;e=e.rotate({deltaAngleX:this._startPinchRotation-n})}return this.updateViewport(e,YP,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e,_lastPinchEvent:n}=this;if(this.touchZoom&&e&&n&&t.scale!==n.scale){const i=this.getCenter(t);let r=this.controllerState.rotateEnd();const s=Math.log2(t.scale),o=(s-Math.log2(n.scale))/(t.deltaTime-n.deltaTime),a=Math.pow(2,s+o*e/2);r=r.zoom({pos:i,scale:a}).zoomEnd(),this.updateViewport(r,ti(bt({},this._getTransitionProps({around:i})),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.isFunctionKeyPressed(t),i=this.controllerState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:n,moveSpeed:i,rotateSpeedX:r,rotateSpeedY:s}=this.keyboard,{controllerState:o}=this;let a;const l={};switch(t.srcEvent.code){case"Minus":a=e?o.zoomOut(n).zoomOut(n):o.zoomOut(n),l.isZooming=!0;break;case"Equal":a=e?o.zoomIn(n).zoomIn(n):o.zoomIn(n),l.isZooming=!0;break;case"ArrowLeft":e?(a=o.rotateLeft(r),l.isRotating=!0):(a=o.moveLeft(i),l.isPanning=!0);break;case"ArrowRight":e?(a=o.rotateRight(r),l.isRotating=!0):(a=o.moveRight(i),l.isPanning=!0);break;case"ArrowUp":e?(a=o.rotateUp(s),l.isRotating=!0):(a=o.moveUp(i),l.isPanning=!0);break;case"ArrowDown":e?(a=o.rotateDown(s),l.isRotating=!0):(a=o.moveDown(i),l.isPanning=!0);break;default:return!1}return this.updateViewport(a,this._getTransitionProps(),l),!0}_getTransitionProps(t){const{_transition:e}=this;return e?t?ti(bt({},e),{transitionInterpolator:new XP(ti(bt({},t),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):e:YP}}class sI{constructor(t){this._viewportProps=this._applyConstraints(t)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(t){return this._viewportProps}_applyConstraints(t){return t}}const oI=[0,0,0];class aI extends sI{constructor({makeViewport:t,width:e,height:n,rotationX:i=0,rotationOrbit:r=0,target:s=oI,zoom:o=0,minRotationX:a=-90,maxRotationX:l=90,minZoom:c=-(1/0),maxZoom:u=Infinity,startPanPosition:h,startRotatePos:d,startRotationX:p,startRotationOrbit:f,startZoomPosition:g,startZoom:m}){super({width:e,height:n,rotationX:i,rotationOrbit:r,target:s,zoom:o,minRotationX:a,maxRotationX:l,minZoom:c,maxZoom:u}),this._state={startPanPosition:h,startRotatePos:d,startRotationX:p,startRotationOrbit:f,startZoomPosition:g,startZoom:m},this.makeViewport=t}panStart({pos:t}){return this._getUpdatedState({startPanPosition:this._unproject(t)})}pan({pos:t,startPosition:e}){const n=this._state.startPanPosition||e;if(!n)return this;const i=this.makeViewport(this._viewportProps).panByPosition(n,t);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){const{startRotatePos:i,startRotationX:r,startRotationOrbit:s}=this._state,{width:o,height:a}=this._viewportProps;if(!i||!Number.isFinite(r)||!Number.isFinite(s))return this;let l;if(t){let e=(t[0]-i[0])/o;(r<-90||r>90)&&(e*=-1),l={rotationX:r+(t[1]-i[1])/a*180,rotationOrbit:s+180*e}}else l={rotationX:r+n,rotationOrbit:s+e};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(t){const e=t.getViewportProps(),n=bt({},this._viewportProps),{rotationOrbit:i}=n;return Math.abs(i-e.rotationOrbit)>180&&(n.rotationOrbit=i<0?i+360:i-360),n}zoomStart({pos:t}){return this._getUpdatedState({startZoomPosition:this._unproject(t),startZoom:this._viewportProps.zoom})}zoom({pos:t,startPos:e,scale:n}){const{zoom:i}=this._viewportProps;let{startZoom:r,startZoomPosition:s}=this._state;Number.isFinite(r)||(r=i,s=this._unproject(e)||this._unproject(t));const o=this._calculateNewZoom({scale:n,startZoom:r}),a=this.makeViewport(ti(bt({},this._viewportProps),{zoom:o}));return this._getUpdatedState(bt({zoom:o},a.panByPosition(s,t)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}zoomOut(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}moveLeft(t=50){return this._panFromCenter([-t,0])}moveRight(t=50){return this._panFromCenter([t,0])}moveUp(t=50){return this._panFromCenter([0,-t])}moveDown(t=50){return this._panFromCenter([0,t])}rotateLeft(t=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-t})}rotateRight(t=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+t})}rotateUp(t=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-t})}rotateDown(t=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+t})}_unproject(t){const e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}_calculateNewZoom({scale:t,startZoom:e}){const{maxZoom:n,minZoom:i}=this._viewportProps;return Number.isFinite(e)||(e=this._viewportProps.zoom),LS(e+Math.log2(t),i,n)}_panFromCenter(t){const{width:e,height:n,target:i}=this._viewportProps;return this.pan({startPosition:i,pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new aI(bt(bt(bt({},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i,maxRotationX:r,minRotationX:s,rotationOrbit:o}=t;return t.zoom=LS(i,n,e),t.rotationX=LS(t.rotationX,s,r),(o<-180||o>180)&&(t.rotationOrbit=function(t,e){const n=t%360;return n<0?360+n:n}(o+180)-180),t}}class lI extends rI{constructor(t){super(aI,t)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class cI extends rI{constructor(t){t.dragMode=t.dragMode||"pan",super(aI,t)}_onPanRotate(t){return!1}get linearTransitionProps(){return["target","zoom"]}}const uI=(new bT).lookAt({eye:[0,0,1]});function hI({width:t,height:e,near:n,far:i}){return t=t||1,e=e||1,(new bT).ortho({left:-t/2,right:t/2,bottom:-e/2,top:e/2,near:n,far:i})}class dI extends WT{constructor(t){const{width:e,height:n,near:i=.1,far:r=1e3,zoom:s=0,target:o=[0,0,0],flipY:a=!0}=t,l=Math.pow(2,s);super(ti(bt({},t),{longitude:null,position:o,viewMatrix:uI.clone().scale([l,l*(a?-1:1),l]),projectionMatrix:hI({width:e,height:n,near:i,far:r}),zoom:s}))}panByPosition(t,e){const n=uT([],t,hT([],LT(e,this.pixelUnprojectionMatrix)));return{target:uT([],this.center,n)}}}let pI=(()=>{class t extends UP{constructor(t){super(ti(bt({},t),{type:dI}))}get controller(){return this._getControllerProps({type:cI})}}return t.displayName="OrthographicView",t})();const fI=Math.PI/180;function gI({height:t,fovy:e,orbitAxis:n,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*fI/2),a="Z"===n?[0,0,1]:[0,1,0],l="Z"===n?[0,-o,0]:[0,0,o],c=(new bT).lookAt({eye:l,up:a});c.rotateX(i*fI),"Z"===n?c.rotateZ(r*fI):c.rotateY(r*fI);const u=Math.pow(2,s)/(t||1);return c.scale(u),c}class mI extends WT{constructor(t){const{height:e,fovy:n,orbitAxis:i,target:r=[0,0,0],rotationX:s=0,rotationOrbit:o=0,zoom:a=0}=t;super(ti(bt({},t),{longitude:null,viewMatrix:gI({height:e,fovy:n,orbitAxis:i,rotationX:s,rotationOrbit:o,zoom:a}),fovy:n,position:r,zoom:a})),this.projectedCenter=this.project(this.center)}unproject(t,{topLeft:e=!0}={}){const[n,i,r=this.projectedCenter[2]]=t,s=e?i:this.height-i,[o,a,l]=LT([n,s,r],this.pixelUnprojectionMatrix);return[o,a,l]}panByPosition(t,e){const n=this.project(t);return{target:this.unproject([this.width/2+n[0]-e[0],this.height/2+n[1]-e[1],this.projectedCenter[2]])}}}let bI=(()=>{class t extends UP{constructor(t={}){const{orbitAxis:e="Z"}=t;super(ti(bt({},t),{orbitAxis:e,type:mI}))}get controller(){return this._getControllerProps({type:lI})}}return t.displayName="OrbitView",t})();const yI=[255,255,255],vI=1;let _I=0;class wI{constructor(t={}){const{color:e=yI}=t,{intensity:n=vI}=t;this.id=t.id||"ambient-".concat(_I++),this.color=e,this.intensity=n,this.type="ambient"}}const xI=[255,255,255],SI=1,EI=[0,0,-1];let CI=0;class OI{constructor(t={}){const{color:e=xI}=t,{intensity:n=SI}=t,{direction:i=EI}=t,{_shadow:r=!1}=t;this.id=t.id||"directional-".concat(CI++),this.color=e,this.intensity=n,this.type="directional",this.direction=new nE(i).normalize().toArray(),this.shadow=r}getProjectedLight(){return this}}class TI{constructor(t={}){const{id:e="effect"}=t;this.id=e,this.props=bt({},t)}preRender(){}getModuleParameters(){}cleanup(){}}class kI extends class{constructor(t,e={}){const{id:n="pass"}=e;this.id=n,this.gl=t,this.props=bt({},e)}setProps(t){Object.assign(this.props,t)}render(){}cleanup(){}}{render(t){return yx(this.gl,{framebuffer:t.target}),this._drawLayers(t)}_drawLayers(t){const{viewports:e,views:n,onViewportActive:i,clearCanvas:r=!0}=t;t.pass=t.pass||"unknown";const s=this.gl;r&&function(t){yx(t,{viewport:[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}),t.clear(16640)}(s);const o=[];for(const a of e){const e=a.viewport||a,r=n&&n[e.id];i(e);const l=this._getDrawLayerParams(e,t);t.view=r;const c=e.subViewports||[e];for(const n of c){t.viewport=n;const e=this._drawLayersInViewport(s,t,l);o.push(e)}}return o}_getDrawLayerParams(t,{layers:e,pass:n,layerFilter:i,effects:r,moduleParameters:s}){const o=[],a=AI(),l={viewport:t,isPicking:n.startsWith("picking"),renderPass:n};for(let c=0;cpS(t,e))}const a={totalCount:e.length,visibleCount:0,compositeCount:0,pickableCount:0};yx(t,{viewport:o});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in n){const t=n[l]=n[l]||AI(e[l],e);c=t(r,s),n[a]=t}else Number.isFinite(o)?(c=o+(e[l]||0),n[a]=null):c=t;return s&&c>=t&&(t=c+1),e[a]=c,c};return i}class PI extends kI{constructor(t,e){super(t,e),this.shadowMap=new lS(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new hS(t,{format:33189,width:1,height:1}),this.fbo=new SS(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;vx(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const n=t.viewports[0],i=_x(this.gl),r=n.width*i,s=n.height*i;(r!==e.width||s!==e.height)&&e.resize({width:r,height:s}),super.render(ti(bt({},t),{target:e,pass:"shadow"}))})}shouldDrawLayer(t){return!1!==t.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const II=Object.keys(Mw).map(t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(Mw[t],";")).join(""),MI=Object.keys(Dw).map(t=>"const int PROJECTION_MODE_".concat(t," = ").concat(Dw[t],";")).join("");var DI="".concat(II,"\n").concat(MI,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n");const RI={};var NI={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:DI,getUniforms:function(t=RI){return t.viewport?function({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:i=Mw.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mw.DEFAULT&&(i=t.isGeospatial?Mw.LNGLAT:Mw.CARTESIAN);const o=aT({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=n||rT,o}(t):{}}};const LI=$O(function({viewport:t,center:e}){return new bT(t.viewProjectionMatrix).invert().transform(e)}),jI=$O(function({viewport:t,shadowMatrices:e}){const n=[],i=t.pixelUnprojectionMatrix,r=t.isGeospatial?void 0:1,s=[[0,0,r],[t.width,0,r],[0,t.height,r],[t.width,t.height,r],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(t=>function(t,e){const[n,i,r]=t,s=LT([n,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(t,i));for(const o of e){const e=o.clone().translate(new nE(t.center).negate()),i=s.map(t=>e.transform(t)),r=(new bT).ortho({left:Math.min(...i.map(t=>t[0])),right:Math.max(...i.map(t=>t[0])),bottom:Math.min(...i.map(t=>t[1])),top:Math.max(...i.map(t=>t[1])),near:Math.min(...i.map(t=>-t[2])),far:Math.max(...i.map(t=>-t[2]))});n.push(r.multiplyRight(o))}return n}),FI=[0,0,0,1],BI=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];var VI={name:"shadow",dependencies:[NI],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(t={},e={})=>{if(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0){const{shadowEnabled:n=!0}=t;return n&&t.shadowMatrices&&t.shadowMatrices.length>0?function(t={},e={}){const n={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||FI,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},i=LI({viewport:t.viewport,center:e.project_uCenter}),r=[],s=jI({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let o=0;o0?t.shadowMaps[o]:t.dummyShadowMap;return n}(t,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}};const zI={color:[255,255,255],intensity:1},UI=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],HI=[0,0,0,200/255];class $I extends TI{constructor(t){super(t),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=HI,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const e in t){const n=t[e];switch(n.type){case"ambient":this.ambientLight=n;break;case"directional":this.directionalLights.push(n);break;case"point":this.pointLights.push(n)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(t,{layers:e,layerFilter:n,viewports:i,onViewportActive:r,views:s}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=sO.getDefaultProgramManager(t),VI&&this.programManager.addDefaultModule(VI)),this.dummyShadowMap||(this.dummyShadowMap=new lS(t,{width:1,height:1}));for(let t=0;te.getProjectedLight({layer:t})),pointLights:this.pointLights.map(e=>e.getProjectedLight({layer:t}))},e}cleanup(){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(VI),this.programManager=null)}_createLightMatrix(){const t=[];for(const e of this.directionalLights){const n=(new bT).lookAt({eye:new nE(e.direction).negate()});t.push(n)}return t}_createShadowPasses(t){for(let e=0;e=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const i of e)this._setChannelTime(i,this.time);const n=this.animations.values();for(const i of n){const{animation:t,channel:e}=i;t.setTime(this.getTime(e))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const n=WI++;return this.animations.set(n,{animation:t,channel:e}),t.setTime(this.getTime(e)),n}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const n=e-t.delay;n>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,n)%t.duration,t.time*=t.rate)}}class XI{constructor(t,e,n){this.id=t,this.context=n,this._loadCount=0,this._subscribers=new Set,this.setData(e)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(t,e){if(t===this._data&&!e)return;this._data=t;const n=++this._loadCount;let i=t;"string"==typeof t&&(i=AP(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then(t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=null,this._content=t)}).catch(t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=t||!0)})):(this.isLoaded=!0,this._error=null,this._content=t);for(const r of this._subscribers)r.onChange(this.getData())}}class YI{constructor({gl:t,protocol:e}){this.protocol=e||"resource://",this._context={gl:t,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return!!t.startsWith(this.protocol)||t in this._resources}add({resourceId:t,data:e,forceUpdate:n=!1,persistent:i=!0}){let r=this._resources[t];r?r.setData(e,n):(r=new XI(t,e,this._context),this._resources[t]=r),r.persistent=i}remove(t){const e=this._resources[t];e&&(e.delete(),delete this._resources[t])}unsubscribe({consumerId:t}){const e=this._consumers[t];if(e){for(const t in e){const n=e[t];n.resource&&n.resource.unsubscribe(n)}delete this._consumers[t],this.prune()}}subscribe({resourceId:t,onChange:e,consumerId:n,requestId:i="default"}){const{_resources:r,protocol:s}=this;t.startsWith(s)&&(r[t=t.replace(s,"")]||this.add({resourceId:t,data:null,persistent:!1}));const o=r[t];if(this._track(n,i,o,e),o)return o.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const t in this._resources)this._resources[t].delete()}_track(t,e,n,i){const r=this._consumers,s=r[t]=r[t]||{},o=s[e]||{};o.resource&&(o.resource.unsubscribe(o),o.resource=null,this.prune()),n&&(s[e]=o,o.onChange=i,o.resource=n,n.subscribe(o))}_prune(){this._pruneRequest=null;for(const t of Object.keys(this._resources)){const e=this._resources[t];!e.persistent&&!e.inUse()&&(e.delete(),delete this._resources[t])}}}const KI=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},NI],QI=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function ZI(t){const e=sO.getDefaultProgramManager(t);for(const n of KI)e.addDefaultModule(n);for(const n of QI)e.addShaderHook(n);return e}const JI=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class tM{constructor(t,{deck:e,stats:n,viewport:i,timeline:r}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new YI({gl:t,protocol:"deck://"}),this.context=ti(bt({},JI),{layerManager:this,gl:t,deck:e,programManager:t&&ZI(t),stats:n||new Ix({id:"deck.gl"}),viewport:i||new WT({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:r||new qI,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const t of this.layers)this._finalizeLayer(t)}needsRedraw(t={clearRedrawFlags:!1}){let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(const n of this.layers){const i=n.getNeedsRedraw(t);e=e||i}return e}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers({layerIds:t=null}={}){return t?this.layers.filter(e=>t.find(t=>0===e.id.indexOf(t))):this.layers}setProps(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}setLayers(t,e){PE("layerManager.setLayers",this,e,t),this.lastRenderedLayers=t,t=gE(t,Boolean);for(const n of t)n.context=this.context;return this._updateLayers(this.layers,t),this}updateLayers(){const t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this.lastRenderedLayers,t)),this._nextLayers=null}activateViewport(t){return PE("layerManager.activateViewport",this,t),t&&(this.context.viewport=t),this}_handleError(t,e,n){n.raiseError(e,"".concat(t," of ").concat(n))}_updateLayers(t,e){const n={};for(const s of t)n[s.id]?Iw.warn("Multiple old layers with same id ".concat(s.id))():n[s.id]=s;const i=[];this._updateSublayersRecursively(e,n,i),this._finalizeOldLayers(n);let r=!1;for(const s of i)if(s.hasUniformTransition()){r=!0;break}this._needsUpdate=r,this.layers=i}_updateSublayersRecursively(t,e,n){for(const r of t){r.context=this.context;const t=e[r.id];null===t&&Iw.warn("Multiple new layers with same id ".concat(r.id))(),e[r.id]=null;let s=null;try{this._debug&&t!==r&&r.validateProps(),t?(this._transferLayerState(t,r),this._updateLayer(r)):this._initializeLayer(r),n.push(r),s=r.isComposite&&r.getSubLayers()}catch(i){this._handleError("matching",i,r)}s&&this._updateSublayersRecursively(s,e,n)}}_finalizeOldLayers(t){for(const e in t){const n=t[e];n&&this._finalizeLayer(n)}}_initializeLayer(t){try{t._initialize(),t.lifecycle="Initialized"}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(t,e){e._transferState(t),e.lifecycle="Matched. State transferred from previous layer",e!==t&&(t.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle="No longer matched. Awaiting garbage collection";try{t._finalize(),t.lifecycle="Finalized! Awaiting garbage collection"}catch(e){this._handleError("finalization",e,t)}}}class eM{constructor(t={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(const t in this.controllers)this.controllers[t]&&this.controllers[t].finalize();this.controllers={}}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(const t in this.controllers){const e=this.controllers[t];e&&e.updateTransition()}}getViewports(t){return t?this._viewports.filter(e=>e.containsPixel(t)):this._viewports}getViews(){const t={};return this.views.forEach(e=>{t[e.id]=e}),t}getView(t){return"string"==typeof t?this.views.find(e=>e.id===t):t}getViewState(t){const e=this.getView(t),n=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(n):n}getViewport(t){return this._viewportMap[t]}unproject(t,e){const n=this.getViewports(),i={x:t[0],y:t[1]};for(let r=n.length-1;r>=0;--r){const s=n[r];if(s.containsPixel(i)){const n=t.slice();return n[0]-=s.x,n[1]-=s.y,s.unproject(n,e)}}return null}setProps(t){"views"in t&&this._setViews(t.views),"viewState"in t&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,e){(t!==this.width||e!==this.height)&&(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}_setViews(t){t=gE(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){t?(!zP(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):Iw.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(t,e){e.viewId=t,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(e)}_createController(t,e){return new(0,e.type)(bt({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>t._getViewport(e,{width:e.width,height:e.height})},e))}_updateController(t,e,n,i){let r=t.controller;return r?(r=ti(bt(bt(bt({},e),t.props),r),{id:t.id,x:n.x,y:n.y,width:n.width,height:n.height}),i?i.setProps(r):i=this._createController(t,r),i):null}_rebuildViewports(){const{width:t,height:e,views:n}=this,i=this.controllers;this._viewports=[],this.controllers={};let r=!1;for(let s=n.length;s--;){const o=n[s],a=this.getViewState(o),l=o.makeViewport({width:t,height:e,viewState:a});let c=i[o.id];o.controller&&!c&&(r=!0),(r||!o.controller)&&c&&(c.finalize(),c=null),this.controllers[o.id]=this._updateController(o,a,l,c),this._viewports.unshift(l)}for(const s in i)i[s]&&!this.controllers[s]&&i[s].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)})}_diffViews(t,e){return t.length!==e.length||t.some((n,i)=>!t[i].equals(e[i]))}}class nM extends sI{constructor({makeViewport:t,width:e,height:n,latitude:i,longitude:r,zoom:s,bearing:o=0,pitch:a=0,altitude:l=1.5,maxZoom:c=20,minZoom:u=0,maxPitch:h=60,minPitch:d=0,startPanLngLat:p,startZoomLngLat:f,startRotatePos:g,startBearing:m,startPitch:b,startZoom:y,normalize:v}={}){uE(Number.isFinite(r)),uE(Number.isFinite(i)),uE(Number.isFinite(s)),super({width:e,height:n,latitude:i,longitude:r,zoom:s,bearing:o,pitch:a,altitude:l,maxZoom:c,minZoom:u,maxPitch:h,minPitch:d,normalize:v}),this._state={startPanLngLat:p,startZoomLngLat:f,startRotatePos:g,startBearing:m,startPitch:b,startZoom:y},this.makeViewport=t}panStart({pos:t}){return this._getUpdatedState({startPanLngLat:this._unproject(t)})}pan({pos:t,startPos:e}){const n=this._state.startPanLngLat||this._unproject(e);if(!n)return this;const i=this.makeViewport(this._viewportProps).panByPosition(n,t);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){const{startRotatePos:i,startBearing:r,startPitch:s}=this._state;if(!i||!Number.isFinite(r)||!Number.isFinite(s))return this;let o;return o=t?this._calculateNewPitchAndBearing(ti(bt({},this._getRotationParams(t,i)),{startBearing:r,startPitch:s})):{bearing:r+e,pitch:s+n},this._getUpdatedState(o)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:t}){return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}zoom({pos:t,startPos:e,scale:n}){let{startZoom:i,startZoomLngLat:r}=this._state;Number.isFinite(i)||(i=this._viewportProps.zoom,r=this._unproject(e)||this._unproject(t));const s=this._calculateNewZoom({scale:n,startZoom:i}),o=this.makeViewport(ti(bt({},this._viewportProps),{zoom:s}));return this._getUpdatedState(bt({zoom:s},o.panByPosition(r,t)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(t=2){return this._zoomFromCenter(t)}zoomOut(t=2){return this._zoomFromCenter(1/t)}moveLeft(t=100){return this._panFromCenter([t,0])}moveRight(t=100){return this._panFromCenter([-t,0])}moveUp(t=100){return this._panFromCenter([0,t])}moveDown(t=100){return this._panFromCenter([0,-t])}rotateLeft(t=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-t})}rotateRight(t=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+t})}rotateUp(t=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+t})}rotateDown(t=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),n=bt({},this._viewportProps),{bearing:i,longitude:r}=n;return Math.abs(i-e.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-e.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}_zoomFromCenter(t){const{width:e,height:n}=this._viewportProps;return this.zoom({pos:[e/2,n/2],scale:t})}_panFromCenter(t){const{width:e,height:n}=this._viewportProps;return this.pan({startPos:[e/2,n/2],pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new this.constructor(bt(bt(bt({makeViewport:this.makeViewport},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i}=t;t.zoom=LS(i,n,e);const{maxPitch:r,minPitch:s,pitch:o}=t;t.pitch=LS(o,s,r);const{normalize:a=!0}=t;return a&&Object.assign(t,function({width:t,height:e,longitude:n,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(n<-180||n>180)&&(n=vT(n+180,360)-180),(o<-180||o>180)&&(o=vT(o+180,360)-180);const a=_T(e/512);if(r<=a)r=a,i=0;else{const t=e/2/Math.pow(2,r),n=kT([0,t])[1];if(ie&&(i=e)}}return{width:t,height:e,longitude:n,latitude:i,zoom:r,pitch:s,bearing:o}}(t)),t}_unproject(t){const e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}_calculateNewZoom({scale:t,startZoom:e}){const{maxZoom:n,minZoom:i}=this._viewportProps;return LS(e+Math.log2(t),i,n)}_calculateNewPitchAndBearing({deltaScaleX:t,deltaScaleY:e,startBearing:n,startPitch:i}){e=LS(e,-1,1);const{minPitch:r,maxPitch:s}=this._viewportProps;let o=i;return e>0?o=i+e*(s-i):e<0&&(o=i-e*(r-i)),{pitch:o,bearing:n+180*t}}_getRotationParams(t,e){const n=t[0]-e[0],i=t[1]-e[1],r=t[1],s=e[1],{width:o,height:a}=this._viewportProps,l=n/o;let c=0;return i>0?Math.abs(a-s)>5&&(c=i/(s-a)*1.2):i<0&&s>5&&(c=1-r/s),c=Math.min(1,Math.max(-1,c)),{deltaScaleX:l,deltaScaleY:c}}}class iM extends rI{constructor(t){t.dragMode=t.dragMode||"pan",super(nM,t)}setProps(t){const e=this.controllerStateProps;super.setProps(t),(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState(bt(bt({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let rM=(()=>{class t extends UP{constructor(t){super(ti(bt({},t),{type:qT}))}get controller(){return this._getControllerProps({type:iM})}}return t.displayName="MapView",t})();const sM=new $I;class oM{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(t){"effects"in t&&(t.effects.length!==this.effects.length||!zP(t.effects,this.effects))&&(this.setEffects(t.effects),this._needsRedraw="effects changed")}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(t=[]){this.cleanup(),this.effects=t,this._createInternalEffects()}cleanup(){for(const t of this.effects)t.cleanup();for(const t of this._internalEffects)t.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(t=>t instanceof $I)||this._internalEffects.push(sM)}}class aM extends kI{}const lM={blendFunc:[1,0,32771,0],blendEquation:32774};class cM extends kI{render(t){t.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(t)):(this.useAlpha=!1,super.render(t))}_drawPickingBuffer({layers:t,layerFilter:e,views:n,viewports:i,onViewportActive:r,pickingFBO:s,deviceRect:{x:o,y:a,width:l,height:c},pass:u="picking",redrawReason:h,pickZ:d}){const p=this.gl;return this.pickZ=d,vx(p,ti(bt({scissorTest:!0,scissor:[o,a,l,c],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},lM),{blend:!d}),()=>{super.render({target:s,layers:t,layerFilter:e,views:n,viewports:i,onViewportActive:r,pass:u,redrawReason:h})})}shouldDrawLayer(t){return t.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(t,e){const n=this.pickZ?{blend:!1}:ti(bt({},lM),{blend:!0,blendColor:[0,0,0,this.useAlpha?(e+1)/255:1]});return bt(bt({},t.props.parameters),n)}}class uM{constructor(t){this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new aM(t),this.pickLayersPass=new cM(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){"layerFilter"in t&&this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in t&&this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(t){const e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;t.layerFilter=this.layerFilter,t.effects=t.effects||[],t.target=t.target||SS.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);const n=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,i=e.render(ti(bt({},t),{target:n}));this._postRender(t.effects,t),this.renderCount++,PE("deckRenderer.renderLayers",this,i,t)}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}finalize(){const{renderBuffers:t}=this;for(const e of t)e.delete();t.length=0}_preRender(t,e){let n=null;for(const i of t)i.preRender(this.gl,e),i.postRender&&(n=i);n&&this._resizeRenderBuffers(),this.lastPostProcessEffect=n}_resizeRenderBuffers(){const{renderBuffers:t}=this;0===t.length&&t.push(new SS(this.gl),new SS(this.gl));for(const e of t)e.resize()}_postRender(t,e){const{renderBuffers:n}=this,i={inputBuffer:n[0],swapBuffer:n[1],target:null};for(const r of t)if(r.postRender){if(r===this.lastPostProcessEffect){i.target=e.target,r.postRender(this.gl,i);break}const t=r.postRender(this.gl,i);i.inputBuffer=t,i.swapBuffer=t===n[0]?n[1]:n[0]}}}const hM={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function dM({pickedColors:t,layers:e,deviceX:n,deviceY:i,deviceRadius:r,deviceRect:s}){if(t){const{x:o,y:a,width:l,height:c}=s;let u=r*r,h=-1,d=0;for(let e=0;eu)d+=4*l;else for(let e=0;e=0){const t=e+o-n,i=t*t+s;i<=u&&(u=i,h=d)}d+=4}}if(h>=0){const n=t[h+3]-1,i=t.slice(h,h+4),r=e[n];if(r){const t=r.decodePickingColor(i),e=Math.floor(h/4/l);return{pickedColor:i,pickedLayer:r,pickedObjectIndex:t,pickedX:o+(h/4-e*l),pickedY:a+e}}Iw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return hM}function pM({pickInfo:t,mode:e,viewports:n,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=t&&t.pickedLayer,c=function(t,e,n){for(let i=t.length-1;i>=0;i--){const r=t[i];if(r.containsPixel(e)&&(!n||n(r)))return r}return t[0]}(n,{x:s,y:o},i&&l&&(t=>i({layer:l,viewport:t,isPicking:!0,renderPass:"picking:".concat(e)}))),u=c&&c.unproject([s-c.x,o-c.y],{targetZ:a});return{color:null,layer:null,viewport:c,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:u,devicePixel:t&&[t.pickedX,t.pickedY],pixelRatio:r}}function fM(t){const{pickInfo:e,lastPickedInfo:n,mode:i,layers:r}=t,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const t=n.index,e=n.layerId,i=o&&o.props.id;if(i!==e||a!==t){if(i!==e){const t=r.find(t=>t.props.id===e);t&&l.unshift(t)}n.layerId=i,n.index=a,n.info=null}}const c=pM(t),u=new Map;return u.set(null,c),l.forEach(t=>{let e=bt({},c);t===o&&(e.color=s,e.index=a,e.picked=!0),e=gM({layer:t,info:e,mode:i}),t===o&&"hover"===i&&(n.info=e),u.set(e.layer.id,e),"hover"===i&&e.layer.updateAutoHighlight(e)}),u}function gM({layer:t,info:e,mode:n}){for(;t&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=t,e=t.getPickingInfo({info:e,mode:n,sourceLayer:i}),t=t.parent}return e}class mM{constructor(t){this.gl=t,this.pickingFBO=null,this.pickLayersPass=new cM(t),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject({x:t,y:e,layers:n,viewports:i},r=this.lastPickedInfo.info){const s=r&&r.layer&&r.layer.id,o=r&&r.viewport&&r.viewport.id,a=s?n.find(t=>t.id===s):null,l=o&&i.find(t=>t.id===o)||i[0],c=l&&l.unproject([t-l.x,e-l.y]),u={x:t,y:e,viewport:l,coordinate:c,layer:a};return a?bt(bt({},r),u):Object.assign(u,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:t}=this;return this.pickingFBO||(this.pickingFBO=new SS(t),SS.isSupported(t,{colorBufferFloat:!0})&&(this.depthFBO=new SS(t),this.depthFBO.attach({36064:new lS(t,{format:Fw(t)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.pickingFBO}_getPickable(t){if(!1===this._pickable)return null;const e=t.filter(t=>t.isPickable()&&!t.isComposite);return e.length>255?(Iw.warn("Too many pickable layers, only picking the first 255")(),e.slice(0,255)):e.length?e:null}_pickClosestObject({layers:t,views:e,viewports:n,x:i,y:r,radius:s=0,depth:o=1,mode:a="query",unproject3D:l,onViewportActive:c}){if(!(t=this._getPickable(t)))return{result:[],emptyInfo:pM({viewports:n,x:i,y:r})};this._resizeBuffer();const u=_x(this.gl),h=wx(this.gl,[i,r],!0),d=[h.x+Math.floor(h.width/2),h.y+Math.floor(h.height/2)],p=Math.round(s*u),{width:f,height:g}=this.pickingFBO,m=this._getPickingRect({deviceX:d[0],deviceY:d[1],deviceRadius:p,deviceWidth:f,deviceHeight:g});let b;const y=[],v={};for(let _=0;_=0){const s=t.slice(i,i+4),o=s.join(",");if(!n.has(o)){const t=e[r];t?n.set(o,{pickedColor:s,pickedLayer:t,pickedObjectIndex:t.decodePickingColor(s)}):Iw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}({pickedColors:this._drawAndSample({layers:t,views:e,viewports:n,onViewportActive:c,deviceRect:{x:d,y:g,width:f.x+f.width-d,height:p-g},pass:"picking:".concat(a),redrawReason:a}),layers:t}),b=new Map,y=Number.isFinite(l);for(let v=0;v=l);v++){const t=m[v];let e={color:t.pickedColor,layer:null,index:t.pickedObjectIndex,picked:!0,x:i,y:r,width:s,height:o,pixelRatio:u};e=gM({layer:t.pickedLayer,info:e,mode:a}),b.has(e.object)||b.set(e.object,e)}return Array.from(b.values())}_drawAndSample({layers:t,views:e,viewports:n,onViewportActive:i,deviceRect:r,pass:s,redrawReason:o,pickZ:a}){if(t.length<1)return null;const l=a?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:t,layerFilter:this.layerFilter,views:e,viewports:n,onViewportActive:i,pickingFBO:l,deviceRect:r,pass:s,redrawReason:o,pickZ:a});const{x:c,y:u,width:h,height:d}=r,p=new(a?Float32Array:Uint8Array)(h*d*4);return _S(l,{sourceX:c,sourceY:u,sourceWidth:h,sourceHeight:d,target:p}),p}_getPickingRect({deviceX:t,deviceY:e,deviceRadius:n,deviceWidth:i,deviceHeight:r}){const s=Math.max(0,t-n),o=Math.max(0,e-n),a=Math.min(i,t+n+1)-s,l=Math.min(r,e+n+1)-o;return a<=0||l<=0?null:{x:s,y:o,width:a,height:l}}}const bM={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class yM{constructor(t){const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,bM),e.appendChild(this.el)),this.isVisible=!1}setTooltip(t,e,n){const i=this.el;if("string"==typeof t)i.innerText=t;else{if(!t)return this.isVisible=!1,void(i.style.display="none");"text"in t&&(i.innerText=t.text),"html"in t&&(i.innerHTML=t.html),"className"in t&&(i.className=t.className),Object.assign(i.style,t.style)}this.isVisible=!0,i.style.display="block",i.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}remove(){this.el&&this.el.remove()}}function vM(t,e){if(!t)throw new Error(e)}const _M={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},wM=_M.global||_M.self||_M.window,xM="object"!=typeof process||"[object process]"!==String(process)||process.browser,SM="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:EM}=(SM&&parseFloat(SM[1]),wM),CM="undefined"!=typeof Image,OM="undefined"!=typeof ImageBitmap,TM=Boolean(EM),kM=!!xM||TM;function AM(t){const e=function(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}(t);if(!e)throw new Error("Not an image");return e}function PM(t){switch(AM(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}const IM=/^data:image\/svg\+xml/,MM=/\.svg((\?|#).*)?$/;function DM(t){return t&&(IM.test(t)||MM.test(t))}function RM(t,e){if(DM(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(e)}`}return NM(t,e)}function NM(t,e){if(DM(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function LM(t,e,n){return jM.apply(this,arguments)}function jM(){return(jM=gS(function*(t,e,n){const i=RM(t,n),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield FM(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function FM(t,e){return BM.apply(this,arguments)}function BM(){return(BM=gS(function*(t,e){const n=new Image;return n.src=t,e.image&&e.image.decode&&n.decode?(yield n.decode(),n):yield new Promise((e,i)=>{try{n.onload=()=>e(n),n.onerror=e=>i(new Error(`Could not load image ${t}: ${e}`))}catch(r){i(r)}})})).apply(this,arguments)}const VM={};let zM=!0;function UM(t,e,n){return HM.apply(this,arguments)}function HM(){return(HM=gS(function*(t,e,n){let i;i=DM(n)?yield LM(t,e,n):NM(t,n);const r=e&&e.imagebitmap;return yield $M(i,r)})).apply(this,arguments)}function $M(t){return GM.apply(this,arguments)}function GM(){return(GM=gS(function*(t,e=null){if((WM(e)||!zM)&&(e=null),e)try{return yield createImageBitmap(t,e)}catch(n){console.warn(n),zM=!1}return yield createImageBitmap(t)})).apply(this,arguments)}function WM(t){for(const e in t||VM)return!1;return!0}const qM=!1,XM=!0;function YM(t){const e=KM(t);return function(t){const e=KM(t);return e.byteLength>=24&&2303741511===e.getUint32(0,qM)?{mimeType:"image/png",width:e.getUint32(16,qM),height:e.getUint32(20,qM)}:null}(e)||function(t){const e=KM(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,qM)&&255===e.getUint8(2)))return null;const{tableMarkers:n,sofMarkers:i}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let r=2;for(;r+9=10&&1195984440===e.getUint32(0,qM)?{mimeType:"image/gif",width:e.getUint16(6,XM),height:e.getUint16(8,XM)}:null}(e)||function(t){const e=KM(t);return e.byteLength>=14&&16973===e.getUint16(0,qM)&&e.getUint32(2,XM)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,XM),height:e.getUint32(22,XM)}:null}(e)}function KM(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}function QM(t,e){const{mimeType:n}=YM(t)||{},{_parseImageNode:i}=wM;return vM(i),i(t,n,e)}function ZM(){return(ZM=gS(function*(t,e,n){const i=((e=e||{}).image||{}).type||"auto",{url:r}=n||{};let s;switch(JM(i)){case"imagebitmap":s=yield UM(t,e,r);break;case"image":s=yield LM(t,e,r);break;case"data":s=yield QM(t,e);break;default:vM(!1)}return"data"===i&&(s=PM(s)),s})).apply(this,arguments)}function JM(t){switch(t){case"auto":case"data":return function(){if(OM)return"imagebitmap";if(CM)return"image";if(kM)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return OM||CM||kM;case"imagebitmap":return OM;case"image":return CM;case"data":return kM;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}const tD={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(t,e,n){return ZM.apply(this,arguments)},tests:[t=>Boolean(YM(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};var eD={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){const e=t[0],n=t[t.length-1];return"{"===e&&"}"===n||"["===e&&"]"===n},parseTextSync:JSON.parse};const nD="8.5.8",iD=zw.CO.deck&&zw.CO.deck.VERSION;if(iD&&iD!==nD)throw new Error("deck.gl - multiple versions detected: ".concat(iD," vs ").concat(nD));iD||(Iw.log(1,"deck.gl ".concat(nD))(),zw.CO.deck=Object.assign(zw.CO.deck||{},{VERSION:nD,version:nD,log:Iw,_registerLoggers:function(t){AE=t}}),fP([eD,[tD,{imagebitmap:{premultiplyAlpha:"none"}}]]));var rD=zw.CO.deck;class sD extends Hx{static isSupported(t,e=[]){const n=Fw(t),i=OS(t,"TIMER_QUERY");let r=n||i;for(const s of e)switch(s){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Rx(!1)}return r}constructor(t,e={}){super(t,e),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:t=!1}={}){return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(t=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise((n,i)=>{const r=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):e++>t?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(r)};requestAnimationFrame(r)}),this._pollingPromise}_createHandle(){return sD.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const oD=(0,zw.jU)()&&"undefined"!=typeof document;let aD=0;class lD{constructor(t={}){const{onCreateContext:e=(t=>Tx(t)),onAddHTML:n=null,onInitialize:i=(()=>{}),onRender:r=(()=>{}),onFinalize:s=(()=>{}),onError:o,gl:a=null,glOptions:l={},debug:c=!1,createFramebuffer:u=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:d=!0,stats:p=Dx.get("animation-loop-"+aD++)}=t;let{useDevicePixels:f=!0}=t;"useDevicePixelRatio"in t&&(Nw.deprecated("useDevicePixelRatio","useDevicePixels")(),f=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:n,onInitialize:i,onRender:r,onFinalize:s,onError:o,gl:a,glOptions:l,debug:c,createFramebuffer:u},this.gl=a,this.needsRedraw=null,this.timeline=null,this.stats=p,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:d,useDevicePixels:f}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return Rx("string"==typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(t={}){if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=sD.isSupported(this.gl,["timers"])?new sD(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())});return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(t=>{this._resolveNextFrame=t})),this._nextFramePromise}toDataURL(){var t=this;return gS(function*(){return t.setNeedsRedraw("toDataURL"),yield t.waitForRender(),t.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...t){return this.props.onCreateContext(...t)}onInitialize(...t){return this.props.onInitialize(...t)}onRender(...t){return this.props.onRender(...t)}onFinalize(...t){return this.props.onFinalize(...t)}getHTMLControlValue(t,e=1){const n=document.getElementById(t);return n?Number(n.value):e}setViewParameters(){return Nw.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=oD?new Promise((t,e)=>{oD&&"complete"===document.readyState?t(document):window.addEventListener("load",()=>{t(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}(t)}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}(t)}_renderFrame(...t){this.display?this.display._renderFrame(...t):this.onRender(...t)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:n}=this._getSizeAndAspect();(t!==this.animationProps.width||e!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),n!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=n,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"==typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!=typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?kx(this.props.gl,t):this.onCreateContext(t),!jw(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(t){yx(t,tx)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const n=this.props.onAddHTML(e);n&&(e.innerHTML=n)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let n=1;const{canvas:i}=this.gl;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:t>0&&e>0&&(n=t/e),{width:t,height:e,aspect:n}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(t,e={}){if(t.canvas)return void function(t,e,n){let i="width"in n?n.width:t.canvas.clientWidth,r="height"in n?n.height:t.canvas.clientHeight;(!i||!r)&&(Nw.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=t.canvas.width||1,r=t.canvas.height||1),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};const s=t.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let n=e;const s=Math.floor(i*n),o=Math.floor(r*n);t.canvas.width=s,t.canvas.height=o,(t.drawingBufferWidth!==s||t.drawingBufferHeight!==o)&&(Nw.warn("Device pixel ratio clamped")(),n=Math.min(t.drawingBufferWidth/i,t.drawingBufferHeight/r),t.canvas.width=Math.floor(i*n),t.canvas.height=Math.floor(r*n)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(t,function(t){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e);const n=t.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in e&&"height"in e&&n.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new SS(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}var cD=n(11524),uD=n.n(cD);const hD={mousedown:1,mousemove:2,mouseup:4};(function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const n=this.store;t.button>0&&"pointerdown"===t.type&&(function(e,n){for(let i=0;i=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(uD().MouseInput);const dD=uD().Manager;var pD=uD();const fD=pD?[[pD.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[pD.Rotate,{enable:!1}],[pD.Pinch,{enable:!1}],[pD.Swipe,{enable:!1}],[pD.Pan,{threshold:0,enable:!1}],[pD.Press,{enable:!1}],[pD.Tap,{event:"doubletap",taps:2,enable:!1}],[pD.Tap,{event:"anytap",enable:!1}],[pD.Tap,{enable:!1}]]:null,gD={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},mD={doubletap:["tap"]},bD={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},yD={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},vD={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},_D={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},wD="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",xD="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let SD=!1;try{const t={get passive(){return SD=!0,!0}};xD.addEventListener("test",t,t),xD.removeEventListener("test",t,t)}catch(m){}const ED=-1!==wD.indexOf("firefox"),{WHEEL_EVENTS:CD}=yD,OD=4.000244140625;class TD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.events=CD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!SD&&{passive:!1}))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){"wheel"===t&&(this.options.enable=e)}handleEvent(t){if(!this.options.enable)return;let e=t.deltaY;xD.WheelEvent&&(ED&&t.deltaMode===xD.WheelEvent.DOM_DELTA_PIXEL&&(e/=xD.devicePixelRatio),t.deltaMode===xD.WheelEvent.DOM_DELTA_LINE&&(e*=40));const n={x:t.clientX,y:t.clientY};0!==e&&e%OD==0&&(e=Math.floor(e/OD)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}_onWheel(t,e,n){this.callback({type:"wheel",center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}const{MOUSE_EVENTS:kD}=yD,AD="pointermove",PD="pointerover",ID="pointerout",MD="pointerleave";class DD{constructor(t,e,n={}){this.element=t,this.callback=e,this.pressed=!1,this.options=Object.assign({enable:!0},n),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=kD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){t===AD&&(this.enableMoveEvent=e),t===PD&&(this.enableOverEvent=e),t===ID&&(this.enableOutEvent=e),t===MD&&(this.enableLeaveEvent=e)}handleEvent(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:PD,srcEvent:t,pointerType:"mouse",target:t.target})}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:ID,srcEvent:t,pointerType:"mouse",target:t.target})}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:MD,srcEvent:t,pointerType:"mouse",target:t.target})}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:AD,srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:RD}=yD,ND="keydown";class LD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=RD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=n.tabIndex||0,t.style.outline="none",this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){t===ND&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}handleEvent(t){const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:ND,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}const jD="contextmenu";class FD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===jD&&(this.options.enable=e)}handleEvent(t){!this.options.enable||this.callback({type:jD,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}const BD={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},VD={srcElement:"root",priority:0};class zD{constructor(t){this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(t,e,n,i=!1,r=!1){const{handlers:s,handlersByElement:o}=this;n&&("object"!=typeof n||n.addEventListener)&&(n={srcElement:n}),n=n?Object.assign({},VD,n):VD;let a=o.get(n.srcElement);a||(a=[],o.set(n.srcElement,a));const l={type:t,handler:e,srcElement:n.srcElement,priority:n.priority};i&&(l.once=!0),r&&(l.passive=!0),s.push(l),this._active=this._active||!l.passive;let c=a.length-1;for(;c>=0&&!(a[c].priority>=l.priority);)c--;a.splice(c+1,0,l)}remove(t,e){const{handlers:n,handlersByElement:i}=this;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.type===t&&s.handler===e){n.splice(r,1);const t=i.get(s.srcElement);t.splice(t.indexOf(s),1),0===t.length&&i.delete(s.srcElement)}}this._active=n.some(t=>!t.passive)}handleEvent(t){if(this.isEmpty())return;const e=this._normalizeEvent(t);let n=t.srcEvent.target;for(;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")}_emit(t,e){const n=this.handlersByElement.get(e);if(n){let e=!1;const i=()=>{t.handled=!0},r=()=>{t.handled=!0,e=!0},s=[];for(let o=0;o{const e=this.manager.get(t);e&&gD[t].forEach(t=>{e.recognizeWith(t)})});for(const n in e.recognizerOptions){const t=this.manager.get(n);if(t){const i=e.recognizerOptions[n];delete i.enable,t.set(i)}}this.wheelInput=new TD(t,this._onOtherEvent,{enable:!1}),this.moveInput=new DD(t,this._onOtherEvent,{enable:!1}),this.keyInput=new LD(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new FD(t,this._onOtherEvent,{enable:!1});for(const[n,i]of this.events)i.isEmpty()||(this._toggleRecognizer(i.recognizerName,!0),this.manager.on(n,i.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,n){this._addEventHandler(t,e,n,!1)}once(t,e,n){this._addEventHandler(t,e,n,!0)}watch(t,e,n){this._addEventHandler(t,e,n,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:n}=this;if(!n)return;const i=n.get(t);if(i&&i.options.enable!==e){i.set({enable:e});const r=mD[t];r&&!this.options.recognizers&&r.forEach(r=>{const s=n.get(r);e?(s.requireFailure(t),i.dropRequireFailure(r)):s.dropRequireFailure(t)})}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,n,i,r){if("string"!=typeof t){n=e;for(const e in t)this._addEventHandler(e,t[e],n,i,r);return}const{manager:s,events:o}=this,a=_D[t]||t;let l=o.get(a);l||(l=new zD(this),o.set(a,l),l.recognizerName=vD[a]||a,s&&s.on(a,l.handleEvent)),l.add(t,e,n,i,r),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:n}=this,i=n.get(_D[t]||t);if(i&&(i.remove(t,e),i.isEmpty())){const{recognizerName:t}=i;let e=!1;for(const i of n.values())if(i.recognizerName===t&&!i.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}_onBasicInput(t){const{srcEvent:e}=t,n=bD[e.type];n&&this.manager.emit(n,t)}_onOtherEvent(t){this.manager.emit(t.type,t)}}function $D(){}const GD={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:$D,onResize:$D,onViewStateChange:$D,onInteractionStateChange:$D,onBeforeRender:$D,onAfterRender:$D,onLoad:$D,onError:(t,e)=>Iw.error(t)(),_onMetrics:null,getCursor:({isDragging:t})=>t?"grabbing":"grab",debug:!1,drawPickingColors:!1};class WD{constructor(t){t=bt(bt({},GD),t),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),t.viewState&&t.initialViewState&&Iw.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,zw.qs)()&&Iw.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new Ix({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&AS.setProps(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&Iw.removed("onLayerHover","onHover")(),"onLayerClick"in t&&Iw.removed("onLayerClick","onClick")(),t.initialViewState&&!zP(this.props.initialViewState,t.initialViewState)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);const e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(t={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);const n=this.viewManager.needsRedraw(t),i=this.layerManager.needsRedraw(t),r=this.effectManager.needsRedraw(t),s=this.deckRenderer.needsRedraw(t);return e=e||n||i||r||s,e}redraw(t){if(!this.layerManager)return;const e=t||this.needsRedraw({clearRedrawFlags:!0});!e||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}getViews(){return this.viewManager.views}getViewports(t){return this.viewManager.getViewports(t)}pickObject(t){const e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}pickObjects(t){return this._pick("pickObjects","pickObjects Time",t)}_addResources(t,e=!1){for(const n in t)this.layerManager.resourceManager.add({resourceId:n,data:t[n],forceUpdate:e})}_removeResources(t){for(const e of t)this.layerManager.resourceManager.remove(e)}_pick(t,e,n){const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(e).timeStart();const r=this.deckPicker[t](bt({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport},n));return i.get(e).timeEnd(),r}_createCanvas(t){let e=t.canvas;return"string"==typeof e&&(e=document.getElementById(e),uE(e)),e||(e=document.createElement("canvas"),e.id=t.id||"deckgl-overlay",(t.parent||document.body).appendChild(e)),Object.assign(e.style,t.style),e}_setCanvasSize(t){if(!this.canvas)return;let{width:e,height:n}=t;(e||0===e)&&(e=Number.isFinite(e)?"".concat(e,"px"):e,this.canvas.style.width=e),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:t,height:e}=this;this.viewManager.setProps({width:t,height:e}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:t}=this;if(!t)return!1;const e=t.clientWidth||t.width,n=t.clientHeight||t.height;return(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,!0)}_createAnimationLoop(t){const{width:e,height:n,gl:i,glOptions:r,debug:s,onError:o,onBeforeRender:a,onAfterRender:l,useDevicePixels:c,autoResizeDrawingBuffer:u}=t;return new lD({width:e,height:n,useDevicePixels:c,autoResizeDrawingBuffer:u,autoResizeViewport:!1,gl:i,onCreateContext:t=>Tx(ti(bt(bt({},r),t),{canvas:this.canvas,debug:s,onContextLost:()=>this._onContextLost()})),onInitialize:t=>this._setGLContext(t.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:a,onAfterRender:l,onError:o})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let t=this.props.views||[new rM({id:"default-view"})];return t=Array.isArray(t)?t:[t],t.length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}_onContextLost(){const{onError:t}=this.props;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}_onPointerMove(t){const{_pickRequest:e}=this;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;{const n=t.offsetCenter;if(!n)return;e.x=n.x,e.y=n.y,e.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t,e.mode="hover"}_pickAndCallback(){const{_pickRequest:t}=this;if(t.event){const{result:e,emptyInfo:n}=this._pick("pickObject","pickObject Time",t);this.interactiveState.isHovering=e.length>0;let i=n,r=!1;for(const s of e)i=s,r=s.layer.onHover(s,t.event);if(!r&&this.props.onHover&&this.props.onHover(i,t.event),this.props.getTooltip){const t=this.props.getTooltip(i);this.tooltip.setTooltip(t,i.x,i.y)}t.event=null}}_updateCursor(){const t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(t){if(this.layerManager)return;this.canvas||(this.canvas=t.canvas,kx(t,{enable:!0,copyState:!0})),this.tooltip=new yM(this.canvas),yx(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new qI;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new HD(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const i in Rw)this.eventManager.on(i,this._onEvent);this.viewManager=new eM({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const n=this.viewManager.getViewports()[0];this.layerManager=new tM(t,{deck:this,stats:this.stats,viewport:n,timeline:e}),this.effectManager=new oM,this.deckRenderer=new uM(t),this.deckPicker=new mM(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:n}=this.layerManager.context;yx(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(bt({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:t,effects:this.effectManager.getEffects()},e)),this.props.onAfterRender({gl:n})}_onRenderFrame(t){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Iw.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){const e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState=ti(bt({},this.viewState),{[t.viewId]:e}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.interactiveState.isDragging=t.isDragging,this.props.onInteractionStateChange(t)}_onEvent(t){const e=Rw[t.type],n=t.offsetCenter;if(!e||!n)return;const i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),{layer:s}=r,o=s&&(s[e.handler]||s.props[e.handler]),a=this.props[e.handler];let l=!1;o&&(l=o.call(s,r,t)),!l&&a&&a(r,t)}_onPointerDown(t){const e=t.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:e.x,y:e.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:t}=this;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();const e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:t,stats:e}=this;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();const n=Dx.get("Memory Usage");t.bufferMemory=n.get("Buffer Memory").count,t.textureMemory=n.get("Texture Memory").count,t.renderbufferMemory=n.get("Renderbuffer Memory").count,t.gpuMemory=n.get("GPU Memory").count}}WD.getPropTypes=function(t){return{id:t.string,width:t.oneOfType([t.number,t.string]),height:t.oneOfType([t.number,t.string]),layers:t.oneOfType([t.object,t.array]),layerFilter:t.func,views:t.oneOfType([t.object,t.array]),viewState:t.object,effects:t.arrayOf(t.instanceOf(TI)),controller:t.oneOfType([t.func,t.bool,t.object]),gl:t.object,glOptions:t.object,parameters:t.object,pickingRadius:t.number,useDevicePixels:t.oneOfType([t.bool,t.number]),touchAction:t.string,eventRecognizerOptions:t.object,onWebGLInitialized:t.func,onResize:t.func,onViewStateChange:t.func,onInteractionStateChange:t.func,onBeforeRender:t.func,onAfterRender:t.func,onLoad:t.func,onError:t.func,debug:t.bool,drawPickingColors:t.bool,_framebuffer:t.object,_animate:t.bool,_pickable:t.bool,_typedArrayManagerProps:t.object}},WD.defaultProps=GD,WD.VERSION=rD.VERSION;var qD={name:"project32",dependencies:[NI],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},XD="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n";const YD={lightSources:{}};function KD({color:t=[0,0,0],intensity:e=1}={}){return t.map(t=>t*e/255)}const QD={name:"lights",vs:XD,fs:XD,getUniforms:function t(e=YD){if("lightSources"in e){const{ambientLight:t,pointLights:n,directionalLights:i}=e.lightSources||{};return t||n&&n.length>0||i&&i.length>0?Object.assign({},function({ambientLight:t,pointLights:e=[],directionalLights:n=[]}){const i={};return i["lighting_uAmbientLight.color"]=t?KD(t):[0,0,0],e.forEach((t,e)=>{i[`lighting_uPointLight[${e}].color`]=KD(t),i[`lighting_uPointLight[${e}].position`]=t.position,i[`lighting_uPointLight[${e}].attenuation`]=t.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,n.forEach((t,e)=>{i[`lighting_uDirectionalLight[${e}].color`]=KD(t),i[`lighting_uDirectionalLight[${e}].direction`]=t.direction}),i.lighting_uDirectionalLightCount=n.length,i}({ambientLight:t,pointLights:n,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const n={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":n.ambientLight=t;break;case"directional":n.directionalLights.push(t);break;case"point":n.pointLights.push(t)}return t({lightSources:n})}return{}},defines:{MAX_LIGHTS:3}};const ZD={};const JD={name:"phong-lighting",dependencies:[QD],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(t=ZD){if(!("material"in t))return{};const{material:e}=t;return e?function(t){const{ambient:e=.35,diffuse:n=.6,shininess:i=32,specularColor:r=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:n,lighting_uShininess:i,lighting_uSpecularColor:r.map(t=>t/255)}}(e):{lighting_uEnabled:!1}}},tR={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};var eR=bt({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(t=tR){const e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){const n=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=n}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){const n=Array.from(t.pickingHighlightColor,t=>t/255);Number.isFinite(n[3])||(n[3]=1),e.picking_uHighlightColor=n}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}});const nR={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class iR{static get DRAW_MODE(){return nR}constructor(t={}){const{id:e=Fx("geometry"),drawMode:n=nR.TRIANGLES,attributes:i={},indices:r=null,vertexCount:s=null}=t;this.id=e,this.drawMode=0|n,this.attributes={},this.userData={},this._setAttributes(i,r),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?bt({indices:this.indices},this.attributes):this.attributes}_print(t){return`Geometry ${this.id} attribute ${t}`}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const n in t){let e=t[n];e=ArrayBuffer.isView(e)?{value:e}:e,Rx(ArrayBuffer.isView(e.value),`${this._print(n)}: must be typed array or object with value as typed array`),("POSITION"===n||"positions"===n)&&!e.size&&(e.size=3),"indices"===n?(Rx(!this.indices),this.indices=e):this.attributes[n]=e}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(t,e){if(e)return e.value.length;let n=1/0;for(const i in t){const e=t[i],{value:r,size:s,constant:o}=e;!o&&r&&s>=1&&(n=Math.min(n,r.length/s))}return Rx(Number.isFinite(n)),n}}const rR=Math.PI/180,sR=new Float32Array(16),oR=new Float32Array(12);function aR(t,e,n){const i=e[0]*rR,r=e[1]*rR,s=e[2]*rR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),d=n[0],p=n[1],f=n[2];t[0]=d*h*u,t[1]=d*l*u,t[2]=d*-a,t[3]=p*(-l*c+h*a*o),t[4]=p*(h*c+l*a*o),t[5]=p*u*o,t[6]=f*(l*o+h*a*c),t[7]=f*(-h*o+l*a*c),t[8]=f*u*c}function lR(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}const cR={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(t,{startRow:e,endRow:n}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,u=Array.isArray(s),h=Array.isArray(r),d=Array.isArray(o),p=c||!l&&Boolean(a(i[0]));t.constant=p?c:h&&u&&d;const f=t.value;if(t.constant){let e;p?(sR.set(a),e=lR(sR)):(e=oR,aR(e,r,s),e.set(o,9)),t.value=new Float32Array(e)}else{let l=e*t.size;const{iterable:g,objectInfo:m}=pE(i,e,n);for(const t of g){let e;m.index++,p?(sR.set(c?a:a(t,m)),e=lR(sR)):(e=oR,aR(e,h?r:r(t,m),u?s:s(t,m)),e.set(d?o:o(t,m),9)),f[l++]=e[0],f[l++]=e[1],f[l++]=e[2],f[l++]=e[3],f[l++]=e[4],f[l++]=e[5],f[l++]=e[6],f[l++]=e[7],f[l++]=e[8],f[l++]=e[9],f[l++]=e[10],f[l++]=e[11]}}}};function uR(t,e){return e===Mw.CARTESIAN||e===Mw.METER_OFFSETS||e===Mw.DEFAULT&&!t.isGeospatial}function hR(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),Iw.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function dR(t,e){if(t.attributes)return hR(t.attributes,e),t instanceof iR?t:new iR(t);if(t.positions||t.POSITION)return hR(t,e),new iR({attributes:t});throw Error("Invalid mesh")}const pR={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let fR=(()=>{class t extends LP{getShaders(){const t=!Fw(this.context.gl),e={};return CS(this.context.gl,"GLSL_DERIVATIVES")&&(e.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[qD,JD,eR],transpileToGLSL100:t,defines:e})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:cR}),this.setState({emptyTexture:new lS(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:e,changeFlags:n}){if(super.updateState({props:t,oldProps:e,changeFlags:n}),t.mesh!==e.mesh||n.extensionsChanged){var i;if(null===(i=this.state.model)||void 0===i||i.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const e=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(e.NORMAL||e.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==e.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:e}=this.context,{sizeScale:n,coordinateSystem:i,_instanced:r}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:n,composeModelMatrix:!r||uR(e,i),flatShading:!this.state.hasNormals}).draw()}getModel(t){const e=new xO(this.context.gl,ti(bt({},this.getShaders()),{id:this.props.id,geometry:dR(t,this.props._useMeshColors),isInstanced:!0})),{texture:n}=this.props,{emptyTexture:i}=this.state;return e.setUniforms({sampler:n||i,hasTexture:Boolean(n)}),e}setTexture(t){const{emptyTexture:e,model:n}=this.state;null==n||n.setUniforms({sampler:t||e,hasTexture:Boolean(t)})}}return t.layerName="SimpleMeshLayer",t.defaultProps=pR,t})();const gR={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[QD]};class mR{constructor(t={}){const{id:e}=t;this.id=e||Fx(this.constructor.name),this.display=!0,this.position=new nE,this.rotation=new nE,this.scale=new nE(1,1,1),this.matrix=new bT,this.userData={},this.props={},this._setScenegraphNodeProps(t)}delete(){}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(t){return Rx(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return Rx(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return Rx(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t,e=!0){e?this.matrix.copy(t):this.matrix=t}setMatrixComponents({position:t,rotation:e,scale:n,update:i=!0}){return t&&this.setPosition(t),e&&this.setRotation(e),n&&this.setScale(n),i&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(n),this}update(t={}){const{position:e,rotation:n,scale:i}=t;return e&&this.setPosition(e),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}getCoordinateUniforms(t,e){Rx(t),e=e||this.matrix;const n=new bT(t).multiplyRight(e),i=n.invert(),r=i.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}class bR extends mR{constructor(t={}){t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;Nw.assert(e.every(t=>t instanceof mR),"every child must an instance of ScenegraphNode"),super(t),this.children=e}add(...t){for(const e of t)Array.isArray(e)?this.add(...e):this.children.push(e);return this}remove(t){const e=this.children,n=e.indexOf(t);return n>-1&&e.splice(n,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(t=>t.delete()),this.removeAll(),super.delete()}traverse(t,{worldMatrix:e=new bT}={}){const n=new bT(e).multiplyRight(this.matrix);for(const i of this.children)i instanceof bR?i.traverse(t,{worldMatrix:n}):t(i,{worldMatrix:n})}}function yR(){var t=new qS(4);return qS!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function vR(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function _R(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3],a=n[0],l=n[1],c=n[2],u=n[3];return t[0]=i*u+o*a+r*c-s*l,t[1]=r*u+o*l+s*a-i*c,t[2]=s*u+o*c+i*l-r*a,t[3]=o*u-i*a-r*l-s*c,t}var wR=tT,xR=function(){var t=XS(),e=YS(1,0,0),n=YS(0,1,0);return function(i,r,s){var o=KS(r,s);return o<-.999999?(QS(t,e,r),function(t){return Math.hypot(t[0],t[1],t[2])}(t)<1e-6&&QS(t,n,r),function(t,e){var n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s}(t,t),vR(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(QS(t,r,s),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=n*n+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=i*o,t[2]=r*o,t[3]=s*o,t}(i,i))}}();yR(),yR(),function(){var t=new qS(9);qS!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1}();const SR=[0,0,0,1],ER={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},CR={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function OR(t){if(!t._animation){const e=CR[t.componentType],n=ER[t.type],i=n*t.count,{buffer:r,byteOffset:s}=t.bufferView.data,o=new e(r,s+(t.byteOffset||0),i);if(1===n)t._animation=Array.from(o);else{const e=[];for(let t=0;t0)n=Math.sqrt(i+1),t[3]=.5*n,t[0]=(e[5]-e[7])*(n=.5/n),t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),t[r]=.5*n,t[3]=(e[3*s+o]-e[3*o+s])*(n=.5/n),t[s]=(e[3*s+r]+e[3*r+s])*n,t[o]=(e[3*o+r]+e[3*r+o])*n}}(this,t),this.check()}identity(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this),this.check()}fromAxisRotation(t,e){return vR(this,t,e),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=zS(t)}get y(){return this[1]}set y(t){this[1]=zS(t)}get z(){return this[2]}set z(t){this[2]=zS(t)}get w(){return this[3]}set w(t){this[3]=zS(t)}len(){return function(t){return Math.hypot(t[0],t[1],t[2],t[3])}(this)}lengthSquared(){return function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}(this)}dot(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}(this,t)}rotationTo(t,e){return xR(this,t,e),this.check()}add(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return function(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3]}(this,this,t),this.check()}calculateW(){return function(t,e){var n=e[0],i=e[1],r=e[2];t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r))}(this,this),this.check()}conjugate(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this,this),this.check()}invert(){return function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=n*n+i*i+r*r+s*s,a=o?1/o:0;t[0]=-n*a,t[1]=-i*a,t[2]=-r*a,t[3]=s*a}(this,this),this.check()}lerp(t,e,n){return function(t,e,n,i){var r=e[0],s=e[1],o=e[2],a=e[3];t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=o+i*(n[2]-o),t[3]=a+i*(n[3]-a)}(this,t,e,n),this.check()}multiplyRight(t,e){return BS(!e),_R(this,this,t),this.check()}multiplyLeft(t,e){return BS(!e),_R(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+o*a,t[1]=r*l+s*a,t[2]=s*l-r*a,t[3]=o*l-i*a}(this,this,t),this.check()}rotateY(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l-s*a,t[1]=r*l+o*a,t[2]=s*l+i*a,t[3]=o*l-r*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+r*a,t[1]=r*l-i*a,t[2]=s*l+o*a,t[3]=o*l-s*a}(this,this,t),this.check()}scale(t){return wR(this,this,t),this.check()}slerp(t,e,n){switch(arguments.length){case 1:({start:t=SR,target:e,ratio:n}=arguments[0]);break;case 2:[e,n]=arguments,t=this}return function(t,e,n,i){var r,s,o,a,l,c=e[0],u=e[1],h=e[2],d=e[3],p=n[0],f=n[1],g=n[2],m=n[3];(s=c*p+u*f+h*g+d*m)<0&&(s=-s,p=-p,f=-f,g=-g,m=-m),1-s>WS?(r=Math.acos(s),o=Math.sin(r),a=Math.sin((1-i)*r)/o,l=Math.sin(i*r)/o):(a=1-i,l=i),t[0]=a*c+l*p,t[1]=a*u+l*f,t[2]=a*h+l*g,t[3]=a*d+l*m}(this,t,e,n),this.check()}transformVector4(t,e=t){return function(t,e,n){var i=e[0],r=e[1],s=e[2],o=n[0],a=n[1],l=n[2],c=n[3],u=c*i+a*s-l*r,h=c*r+l*i-o*s,d=c*s+o*r-a*i,p=-o*i-a*r-l*s;t[0]=u*c+p*-o+h*-l-d*-a,t[1]=h*c+p*-a+d*-o-u*-l,t[2]=d*c+p*-l+u*-a-h*-o,t[3]=e[3]}(e,t,this),US(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t,e){return this.multiplyLeft(t,e)}multiply(t,e){return this.multiplyRight(t,e)}};class AR{constructor(t){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:t,target:n,path:i})=>{(function(t,{input:e,interpolation:n,output:i},r,s){const o=t%e[e.length-1],a=e.findIndex(t=>t>=o),l=Math.max(0,a-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:Nw.warn(`Bad animation path ${s}`)()}Rx(r[s].length===i[l].length);const c=e[l],u=e[a];switch(n){case"STEP":!function(t,e,n){for(let i=0;ic&&function(t,e,n,i,r){if("rotation"===e){kR.slerp({start:n,target:i,ratio:r});for(let n=0;nc&&function(t,e,{p0:n,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const i=e.name||`Animation-${n}`,r=e.samplers.map(({input:e,interpolation:n="LINEAR",output:i})=>({input:OR(t.accessors[e]),interpolation:n,output:OR(t.accessors[i])})),s=e.channels.map(({sampler:e,target:n})=>({sampler:r[e],target:t.nodes[n.node],path:n.path}));return new AR({name:i,channels:s})})}animate(t){this.setTime(t)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}class IR extends mR{constructor(t,e={}){super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof xO?(this.model=t,this._setModelNodeProps(e)):this.model=new xO(t,e),this.managedResources=e.managedResources||[]}setProps(t){return super.setProps(t),this._setModelNodeProps(t),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(t=>t.delete()),this.managedResources=[]}draw(...t){return this.model.draw(...t)}setUniforms(...t){return this.model.setUniforms(...t),this}setAttributes(...t){return this.model.setAttributes(...t),this}updateModuleSettings(...t){return this.model.updateModuleSettings(...t),this}_setModelNodeProps(t){this.model.setProps(t)}}class MR{constructor(t,{attributes:e,material:n,pbrDebug:i,imageBasedLightingEnvironment:r,lights:s,useTangents:o}){this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},CS(t,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],r&&(this.uniforms.u_DiffuseEnvSampler=r.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=r.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=r.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),i&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(e.NORMAL,"HAS_NORMALS"),this.defineIfPresent(e.TANGENT&&o,"HAS_TANGENTS"),this.defineIfPresent(e.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(r,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(i,"PBR_DEBUG"),n&&this.parseMaterial(n)}defineIfPresent(t,e){t&&(this.defines[e]=1)}parseTexture(t,e,n=null){const i=t.texture.source.image;let r,s={};i.compressed?(r=i,s={[this.gl.TEXTURE_MIN_FILTER]:i.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):r={data:i};const o=new lS(this.gl,bt({id:t.name||t.id,parameters:bt(bt({},t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{}),s),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},r));this.uniforms[e]=o,this.defineIfPresent(n,n),this.generatedTextures.push(o)}parsePbrMetallicRoughness(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:e=1,roughnessFactor:n=1}=t;this.uniforms.u_MetallicRoughnessValues=[e,n]}parseMaterial(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:e=1}=t.normalTexture;this.uniforms.u_NormalScale=e}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:e=1}=t.occlusionTexture;this.uniforms.u_OcclusionStrength=e}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){const{alphaCutoff:e=.5}=t;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=e}else"BLEND"===t.alphaMode&&(Nw.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function DR(t,e){return Fw(t)?`#version 300 es\n${e}`:e}const RR={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},NR={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class LR{constructor(t,e={}){this.gl=t,this.options=Object.assign({},NR,e)}instantiate(t){return this.gltf=t,(t.scenes||[]).map(t=>this.createScene(t))}createAnimator(){return Array.isArray(this.gltf.animations)?new PR(this.gltf):null}createScene(t){const e=(t.nodes||[]).map(t=>this.createNode(t));return new bR({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map(t=>this.createNode(t));t.mesh&&e.push(this.createMesh(t.mesh));const n=new bR({id:t.name||t.id,children:e});if(t.matrix)n.setMatrix(t.matrix);else{if(n.matrix.identity(),t.translation&&n.matrix.translate(t.translation),t.rotation){const e=(new bT).fromQuaternion(t.rotation);n.matrix.multiplyRight(e)}t.scale&&n.matrix.scale(t.scale)}t._node=n}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map((e,n)=>this.createPrimitive(e,n,t)),n=new bR({id:t.name||t.id,children:e});t._mesh=n}return t._mesh}getVertexCount(t){Nw.warn("getVertexCount() not found")()}createPrimitive(t,e,n){return function(t,e){const{id:n,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new MR(t,e);Nw.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(t=>t.buffer));const c=new IR(t,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[gR],defines:a.defines,parameters:a.parameters,vs:DR(t,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:DR(t,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:t.name||`${n.name||n.id}-primitive-${e}`,drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options))}createAttributes(t,e){const n={};return Object.keys(t).forEach(e=>{n[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))}),e&&(n.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),Nw.info(4,"glTF Attributes",{attributes:t,indices:e,generated:n})(),n}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:n}=t;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[e]||(n.lumaBuffers[e]=new tS(this.gl,{id:`from-${n.id}`,data:n.data||t.value,target:e})),n.lumaBuffers[e]}createAccessor(t,e){return new Kx({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:RR[t.type]})}createSampler(t){return t}needsPOT(){return!1}}function jR(t,e,n){if(t.byteLength<=e+n)return"";const i=new DataView(t);let r="";for(let s=0;se[t.name]);return new UR(n,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new UR(e,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof UR){const i=t;e=i.fields,n=HR(HR(new Map,this.metadata),i.metadata)}else e=t;const i=Object.create(null);for(const s of this.fields)i[s.name]=s;for(const s of e)i[s.name]=s;const r=Object.values(i);return new UR(r,n)}}function HR(t,e){return new Map([...t||new Map,...e||new Map])}let $R,GR,WR,qR,XR,YR,KR,QR;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}($R||($R={}));class ZR{static isNull(t){return t&&t.typeId===$R.Null}static isInt(t){return t&&t.typeId===$R.Int}static isFloat(t){return t&&t.typeId===$R.Float}static isBinary(t){return t&&t.typeId===$R.Binary}static isUtf8(t){return t&&t.typeId===$R.Utf8}static isBool(t){return t&&t.typeId===$R.Bool}static isDecimal(t){return t&&t.typeId===$R.Decimal}static isDate(t){return t&&t.typeId===$R.Date}static isTime(t){return t&&t.typeId===$R.Time}static isTimestamp(t){return t&&t.typeId===$R.Timestamp}static isInterval(t){return t&&t.typeId===$R.Interval}static isList(t){return t&&t.typeId===$R.List}static isStruct(t){return t&&t.typeId===$R.Struct}static isUnion(t){return t&&t.typeId===$R.Union}static isFixedSizeBinary(t){return t&&t.typeId===$R.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===$R.FixedSizeList}static isMap(t){return t&&t.typeId===$R.Map}static isDictionary(t){return t&&t.typeId===$R.Dictionary}get typeId(){return $R.NONE}compareTo(t){return this===t}}Symbol,Symbol,GR=Symbol.toStringTag;class JR extends ZR{constructor(t,e){super(),cA(this,"isSigned",void 0),cA(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return $R.Int}get[GR](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class tN extends JR{constructor(){super(!0,8)}}class eN extends JR{constructor(){super(!0,16)}}class nN extends JR{constructor(){super(!0,32)}}class iN extends JR{constructor(){super(!1,8)}}class rN extends JR{constructor(){super(!1,16)}}class sN extends JR{constructor(){super(!1,32)}}WR=Symbol.toStringTag;class oN extends ZR{constructor(t){super(),cA(this,"precision",void 0),this.precision=t}get typeId(){return $R.Float}get[WR](){return"Float"}toString(){return`Float${this.precision}`}}class aN extends oN{constructor(){super(32)}}class lN extends oN{constructor(){super(64)}}Symbol,Symbol,qR=Symbol.toStringTag,XR=Symbol.toStringTag,YR=Symbol.toStringTag,KR=Symbol.toStringTag,QR=Symbol.toStringTag;class cN extends ZR{constructor(t,e){super(),cA(this,"listSize",void 0),cA(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return $R.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[QR](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class uN{constructor(t,e,n=!1,i=new Map){cA(this,"name",void 0),cA(this,"type",void 0),cA(this,"nullable",void 0),cA(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=n,this.metadata=i}get typeId(){return this.type&&this.type.typeId}clone(){return new uN(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function hN(t,e,n){const i=n?dN(n.metadata):void 0,r=function(t){switch(t.constructor){case Int8Array:return new tN;case Uint8Array:return new iN;case Int16Array:return new eN;case Uint16Array:return new rN;case Int32Array:return new nN;case Uint32Array:return new sN;case Float32Array:return new aN;case Float64Array:return new lN;default:throw new Error("array type not supported")}}(e.value);return new uN(t,new cN(e.size,new uN("value",r)),!1,i)}function dN(t){const e=new Map;for(const n in t)e.set(`${n}.string`,JSON.stringify(t[n]));return e}const pN={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},fN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class gN{constructor(t){cA(this,"draco",void 0),cA(this,"decoder",void 0),cA(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){const n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const i=this.decoder.GetEncodedGeometryType(n),r=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(i){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(n,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(n,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e=`DRACO decompression failed: ${t.error_msg()}`;throw new Error(e)}const s=this._getDracoLoaderData(r,i,e),o=this._getMeshData(r,s,e),a=function(t){let e=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;cr?t:r,s=l>s?l:s,o=u>o?u:o}return[[e,n,i],[r,s,o]]}(o.attributes),l=function(t,e,n){const i=dN(e.metadata),r=[],s=function(t){const e={};for(const n in t){const i=t[n];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in t){const e=hN(o,t[o],s[o]);r.push(e)}if(n){const t=hN("indices",n);r.push(t)}return new UR(r,i)}(o.attributes,s,o.indices);return ti(bt({loader:"draco",loaderData:s,header:{vertexCount:r.num_points(),boundingBox:a}},o),{schema:l})}finally{this.draco.destroy(n),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,n){const i=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,n);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:r}}_getDracoAttributes(t,e){const n={};for(let i=0;ithis.decoder[t]).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map(t=>e.min_value(t))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:n=[]}=e,i=t.attribute_type();if(n.map(t=>this.decoder[t]).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}var mN=n(49125);const bN={};function yN(t){return vN.apply(this,arguments)}function vN(){return(vN=gS(function*(t,e=null,n={}){return e&&(t=_N(t,e,n)),bN[t]=bN[t]||wN(t),yield bN[t]})).apply(this,arguments)}function _N(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};return i[t]?i[t]:CA?n.CDN?(wA(n.CDN.startsWith("http")),`${n.CDN}/${e}@3.0.12/dist/libs/${t}`):OA?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}function wN(t){return xN.apply(this,arguments)}function xN(){return(xN=gS(function*(t){return t.endsWith("wasm")?yield(yield fetch(t)).arrayBuffer():CA?OA?importScripts(t):SN(yield(yield fetch(t)).text(),t):mN.requireFromFile&&(yield mN.requireFromFile(t))})).apply(this,arguments)}function SN(t,e){if(!CA)return mN.requireFromString&&mN.requireFromString(t,e);if(OA)return eval.call(EA,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(i){n.text=t}return document.body.appendChild(n),null}const EN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",CN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",ON="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let TN;function kN(t){return AN.apply(this,arguments)}function AN(){return(AN=gS(function*(t){const e=t.modules||{};return TN=e.draco3d?TN||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):TN||PN(t),yield TN})).apply(this,arguments)}function PN(t){return IN.apply(this,arguments)}function IN(){return(IN=gS(function*(t){let e,n;switch(t.draco&&t.draco.decoderType){case"js":e=yield yN(EN,"draco",t);break;case"wasm":default:[e,n]=yield Promise.all([yield yN(CN,"draco",t),yield yN(ON,"draco",t)])}return e=e||globalThis.DracoDecoderModule,yield MN(e,n)})).apply(this,arguments)}function MN(t,e){const n={};return e&&(n.wasmBinary=e),new Promise(e=>{t(ti(bt({},n),{onModuleLoaded:t=>e({draco:t})}))})}const DN=ti(bt({},zR),{parse:function(t,e){return RN.apply(this,arguments)}});function RN(){return(RN=gS(function*(t,e){const{draco:n}=yield kN(e),i=new gN(n);try{return i.parseSync(t,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function NN(t,e){return Nk(t>=0),Nk(e>0),t+(e-1)&~(e-1)}function LN(t,e,n){let i;return i=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer||t.arrayBuffer,t.byteOffset,t.byteLength),e.set(i,n),n+NN(i.byteLength,4)}const jN=["SCALAR","VEC2","VEC3","VEC4"],FN=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],BN=new Map(FN),VN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zN={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},UN={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function HN(t){return jN[t-1]||jN[0]}function $N(t){const e=BN.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function GN(t,e){const n=UN[t.componentType],i=VN[t.type],r=t.count*i,s=t.count*i*zN[t.componentType];return FR(s>=0&&s<=e.byteLength),{ArrayType:n,length:r,byteLength:s}}const WN={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class qN{constructor(t){cA(this,"gltf",void 0),cA(this,"sourceBuffers",void 0),cA(this,"byteLength",void 0),this.gltf=t||{json:bt({},WN),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){return this.getUsedExtensions().find(e=>e===t)?(this.json.extensions||{})[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(e=>e===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];if(!n)throw new Error(`glTF file error: Could not find ${t}[${e}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);const e=this.gltf.buffers[t.buffer];return FR(e),new Uint8Array(e.arrayBuffer,(t.byteOffset||0)+e.byteOffset,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,{ArrayType:i,length:r}=GN(t,e);return new i(n,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data;return new Uint8Array(n,e.byteOffset||0,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}setObjectExtension(t,e,n){(t.extensions||{})[e]=n}removeObjectExtension(t,e){const n=t.extensions||{},i=n[e];return delete n[e],i}addExtension(t,e={}){return FR(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return FR(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(e=>e===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(e=>e===t)||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:n}=t;this.json.nodes=this.json.nodes||[];const i={mesh:e};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:n,material:i,mode:r=4}=t,s={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(n){const t=this._addIndices(n);s.primitives[0].indices=t}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const n=YM(t),i=e||(null==n?void 0:n.mimeType),r={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;FR(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=NN(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(t,e){const n={bufferView:t,type:HN(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,e={size:3}){const n=this.addBufferView(t);let i={min:e.min,max:e.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:$N(t),count:Math.round(t.length/e.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,n={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const n=this.byteLength,i=new ArrayBuffer(n),r=new Uint8Array(i);let s=0;for(const o of this.sourceBuffers||[])s=LN(o,r,s);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}_removeStringFromArray(t,e){let n=!0;for(;n;){const i=t.indexOf(e);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){const e={};for(const n in t){const i=t[n],r=this._getGltfAttributeName(n),s=this.addBinaryBuffer(i.value,i);e[r]=s}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const n={min:null,max:null};if(t.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*lL(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}function cL(t){return uL.apply(this,arguments)}function uL(){return(uL=gS(function*(t){const e=new qN(t),{json:n}=e;e.removeExtension(QN);for(const i of n.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,QN)})).apply(this,arguments)}function hL(t){const e=new qN(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,QN,{}),e.addExtension(QN))}function dL(t){return pL.apply(this,arguments)}function pL(){return(pL=gS(function*(t){const e=new qN(t),{json:n}=e,i=e.getExtension(KN);i&&(e.json.lights=i.lights,e.removeExtension(KN));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,KN);t&&(r.light=t.light),e.removeObjectExtension(r,KN)}})).apply(this,arguments)}function fL(t){return gL.apply(this,arguments)}function gL(){return(gL=gS(function*(t){const e=new qN(t),{json:n}=e;if(n.lights){const t=e.addExtension(KN);FR(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights)e.addObjectExtension(t.node,KN,t);delete e.json.lights}})).apply(this,arguments)}function mL(t){return bL.apply(this,arguments)}function bL(){return(bL=gS(function*(t){const e=new qN(t),{json:n}=e,i=e.getExtension(ZN);if(i){const t=_L(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,ZN);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=wL(i.technique,e)),e.removeObjectExtension(i,ZN)}e.removeExtension(ZN)}})).apply(this,arguments)}function yL(t,e){return vL.apply(this,arguments)}function vL(){return(vL=gS(function*(t,e){})).apply(this,arguments)}function _L(t,e){const{programs:n=[],shaders:i=[],techniques:r=[]}=t,s=new TextDecoder;return i.forEach(t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=s.decode(e.getTypedArrayForBufferView(t.bufferView))}),n.forEach(t=>{t.fragmentShader=i[t.fragmentShader],t.vertexShader=i[t.vertexShader]}),r.forEach(t=>{t.program=n[t.program]}),r}function wL(t,e){const n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(e=>{t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)}),Object.keys(n).forEach(t=>{"object"==typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))}),n}const xL={KHR_draco_mesh_compression:i,KHR_materials_unlit:r,KHR_lights_punctual:s,KHR_techniques_webgl:o};function SL(t){return EL.apply(this,arguments)}function EL(){return(EL=gS(function*(t,e={},n){for(const r in xL){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield xL[r].decode(t,e,n))}})).apply(this,arguments)}const CL={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},OL={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class TL{constructor(t){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(t,e){this.json=t.json;const n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${n.asset.version}`)}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t){const e=new qN(t),{json:n}=e;for(const i of n.images||[]){const t=e.removeObjectExtension(i,XN);t&&Object.assign(i,t)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(XN)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in CL)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const n=t[e];if(n&&!Array.isArray(n)){t[e]=[];for(const i in n){const r=n[i];r.id=r.id||i;const s=t[e].length;t[e].push(r),this.idToIndexMap[e][i]=s}}}_convertObjectIdsToArrayIndices(t){for(const e in CL)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:n,material:i}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");n&&(e.indices=this._convertIdToIndex(n,"accessor")),i&&(e.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(t=>this._convertIdToIndex(t,"node"))),t.meshes&&(t.meshes=t.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(t,e){t[e]||(console.warn(`gltf v1: json doesn't contain attribute ${e}`),t[e]=[]);for(const n of t[e])for(const t in n){const e=this._convertIdToIndex(n[t],t);n[t]=e}}_convertIdToIndex(t,e){const n=OL[e];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${e} with id ${t}`);return i}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const e of t.materials){e.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const n=e.values&&e.values.tex,i=t.textures.findIndex(t=>t.id===n);-1!==i&&(e.pbrMetallicRoughness.baseColorTexture={index:i})}}}function kL(t,e={}){return(new TL).normalize(t,e)}const AL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},PL={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},IL={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},ML={magFilter:IL.TEXTURE_MAG_FILTER,minFilter:IL.TEXTURE_MIN_FILTER,wrapS:IL.TEXTURE_WRAP_S,wrapT:IL.TEXTURE_WRAP_T},DL={[IL.TEXTURE_MAG_FILTER]:IL.LINEAR,[IL.TEXTURE_MIN_FILTER]:IL.NEAREST_MIPMAP_LINEAR,[IL.TEXTURE_WRAP_S]:IL.REPEAT,[IL.TEXTURE_WRAP_]:IL.REPEAT};class RL{postProcess(t,e={}){const{json:n,buffers:i=[],images:r=[],baseUri:s=""}=t;return FR(n),this.baseUri=s,this.json=n,this.buffers=i,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t,e={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((t,e)=>this._resolveBufferView(t,e))),t.images&&(t.images=t.images.map((t,e)=>this._resolveImage(t,e))),t.samplers&&(t.samplers=t.samplers.map((t,e)=>this._resolveSampler(t,e))),t.textures&&(t.textures=t.textures.map((t,e)=>this._resolveTexture(t,e))),t.accessors&&(t.accessors=t.accessors.map((t,e)=>this._resolveAccessor(t,e))),t.materials&&(t.materials=t.materials.map((t,e)=>this._resolveMaterial(t,e))),t.meshes&&(t.meshes=t.meshes.map((t,e)=>this._resolveMesh(t,e))),t.nodes&&(t.nodes=t.nodes.map((t,e)=>this._resolveNode(t,e))),t.skins&&(t.skins=t.skins.map((t,e)=>this._resolveSkin(t,e))),t.scenes&&(t.scenes=t.scenes.map((t,e)=>this._resolveScene(t,e))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];return n||console.warn(`glTF file error: Could not find ${t}[${e}]`),n}_resolveScene(t,e){return t.id=t.id||`scene-${e}`,t.nodes=(t.nodes||[]).map(t=>this.getNode(t)),t}_resolveNode(t,e){return t.id=t.id||`node-${e}`,t.children&&(t.children=t.children.map(t=>this.getNode(t))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((t,e)=>{const n=this.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t},{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||`skin-${e}`,t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||`mesh-${e}`,t.primitives&&(t.primitives=t.primitives.map(t=>{const e=(t=bt({},t)).attributes;t.attributes={};for(const n in e)t.attributes[n]=this.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t})),t}_resolveMaterial(t,e){if(t.id=t.id||`material-${e}`,t.normalTexture&&(t.normalTexture=bt({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=bt({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=bt({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness=bt({},t.pbrMetallicRoughness);const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture=bt({},e.baseColorTexture),e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture=bt({},e.metallicRoughnessTexture),e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){if(t.id=t.id||`accessor-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=function(t){return PL[t]}(t.componentType),t.components=function(t){return AL[t]}(t.type),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:i}=GN(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset,s=e.arrayBuffer.slice(r,r+i);t.value=new n(s)}return t}_resolveTexture(t,e){return t.id=t.id||`texture-${e}`,t.sampler="sampler"in t?this.getSampler(t.sampler):DL,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||`sampler-${e}`,t.parameters={};for(const n in t){const e=this._enumSamplerParameter(n);void 0!==e&&(t.parameters[e]=t[n])}return t}_enumSamplerParameter(t){return ML[t]}_resolveImage(t,e){t.id=t.id||`image-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const n=this.images[e];return n&&(t.image=n),t}_resolveBufferView(t,e){t.id=t.id||`bufferView-${e}`;const n=t.buffer;t.buffer=this.buffers[n];let i=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(i+=t.byteOffset),t.data=new Uint8Array(this.buffers[n].arrayBuffer,i,t.byteLength),t}_resolveCamera(t,e){return t.id=t.id||`camera-${e}`,t}}function NL(t,e){return(new RL).postProcess(t,e)}const LL=1735152710,jL=!0;function FL(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),s=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(s),NN(i,4)}function BL(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),NN(i,4)}function VL(t,e){return zL.apply(this,arguments)}function zL(){return(zL=gS(function*(t,e,n=0,i,r){var s,o,a,l;UL(t,e,n,i),kL(t,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&t.json.buffers&&(yield HL(t,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const e=GL(t,i,r);c.push(e)}const u=SL(t,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?NL(t,i):t})).apply(this,arguments)}function UL(t,e,n,i){if(i.uri&&(t.baseUri=i.uri),e instanceof ArrayBuffer&&!function(t,e=0,n={}){const i=new DataView(t),{magic:r=LL}=n,s=i.getUint32(e,!1);return s===r||s===LL}(e,n,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)t.json=function(t){try{return JSON.parse(t)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(t,e=5){return"string"==typeof t?t.slice(0,e):ArrayBuffer.isView(t)?jR(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?jR(t,0,e):""}(t)}"`)}}(e);else if(e instanceof ArrayBuffer){const r={};n=function(t,e,n=0,i={}){const r=new DataView(e),s=function(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}(r,n+0),o=r.getUint32(n+4,jL),a=r.getUint32(n+8,jL);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),n+=12,t.version){case 1:return function(t,e,n){Nk(t.header.byteLength>20);const i=e.getUint32(n+0,jL),r=e.getUint32(n+4,jL);return n+=8,Nk(0===r),FL(t,e,n,i),(n+=i)+BL(t,e,n,t.header.byteLength)}(t,r,n);case 2:return function(t,e,n,i){return Nk(t.header.byteLength>20),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,jL),s=e.getUint32(n+4,jL);switch(n+=8,s){case 1313821514:FL(t,e,n,r);break;case 5130562:BL(t,e,n,r);break;case 0:i.strict||FL(t,e,n,r);break;case 1:i.strict||BL(t,e,n,r)}n+=NN(r,4)}}(t,e,n,{}),n+t.header.byteLength}(t,r,n);default:throw new Error(`Invalid GLB version ${t.version}. Only supports v1 and v2.`)}}(r,e,n,i.glb),FR("glTF"===r.type,`Invalid GLB magic string ${r.type}`),t._glb=r,t.json=r.json}else FR(!1,"GLTF: must be ArrayBuffer or string");if(t.buffers=new Array((t.json.buffers||[]).length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}t.images=new Array((t.json.images||[]).length).fill({})}function HL(t,e,n){return $L.apply(this,arguments)}function $L(){return($L=gS(function*(t,e,n){for(let s=0;s{t.traverse(t=>{Object.values(t.model.getUniforms()).forEach(t=>{!1===t.loaded&&e.push(t)})})}),yield ZL(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function ZL(t){return JL.apply(this,arguments)}function JL(){return(JL=gS(function*(t){for(;t();)yield new Promise(t=>requestAnimationFrame(t))})).apply(this,arguments)}const tj=[255,255,255,255],ej={scenegraph:{type:"object",value:null,async:!0},getScene:t=>t&&t.scenes?"object"==typeof t.scene?t.scene:t.scenes[t.scene||0]:t,getAnimator:t=>t&&t.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:tj},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[YL]};let nj=(()=>{class t extends LP{getShaders(){const t=[qD,eR];return"pbr"===this.props._lighting&&t.push(gR),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:tj,transition:!0},instanceModelMatrix:cR})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;e.scenegraph!==n.scenegraph?this._updateScenegraph(e):e._animations!==n._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:e}=this.context;let n=null;if(t.scenegraph instanceof mR)n={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const i=t.scenegraph,r=function(t,e,n){const i=new LR(t,n);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(e,i,this._getModelOptions());n=bt({gltf:i},r),function(t){return QL.apply(this,arguments)}(r).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Iw.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),n=t.scenegraph);const i={layer:this,gl:e},r=t.getScene(n,i),s=t.getAnimator(n,i);r instanceof mR?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,s,t._animations),this.setState({scenegraph:r,animator:s})):null!==r&&Iw.warn("invalid scenegraph:",r)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const e=this.getAttributeManager().getAttributes();t.traverse(t=>{this._setModelAttributes(t.model,e)})}}_applyAnimationsProp(t,e,n){if(!t||!e||!n)return;const i=e.getAnimations();Object.keys(n).sort().forEach(t=>{const e=n[t];if("*"===t)i.forEach(t=>{Object.assign(t,e)});else if(Number.isFinite(Number(t))){const n=Number(t);n>=0&&ne===t);n?Object.assign(n,e):Iw.warn("animation ".concat(t," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof mR&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let e=null;return t&&(e="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:e,modelOptions:bt({isInstanced:!0,transpileToGLSL100:!Fw(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(e=>{this._setModelAttributes(e.model,t)})}draw({moduleParameters:t=null,parameters:e={},context:n}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(n.timeline.getTime()),this.setNeedsRedraw());const{viewport:i}=this.context,{sizeScale:r,sizeMinPixels:s,sizeMaxPixels:o,opacity:a,coordinateSystem:l}=this.props,c=this.getNumInstances();this.state.scenegraph.traverse((n,{worldMatrix:u})=>{n.model.setInstanceCount(c),n.updateModuleSettings(t),n.draw({parameters:e,uniforms:{sizeScale:r,opacity:a,sizeMinPixels:s,sizeMaxPixels:o,composeModelMatrix:uR(i,l),sceneModelMatrix:u,u_Camera:n.model.getUniforms().project_uCameraPosition}})})}}return t.layerName="ScenegraphLayer",t.defaultProps=ej,t})();const ij=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),rj=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),sj=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),oj=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),aj={POSITION:{size:3,value:new Float32Array(rj)},NORMAL:{size:3,value:new Float32Array(sj)},TEXCOORD_0:{size:2,value:new Float32Array(oj)}};class lj extends iR{constructor(t={}){const{id:e=Fx("cube-geometry")}=t;super(ti(bt({},t),{id:e,indices:{size:1,value:new Uint16Array(ij)},attributes:bt(bt({},aj),t.attributes)}))}}class cj{constructor(t=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=t}identity(){const t=this.elements;t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1}setZero(){const t=this.elements;t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0}setTrace(t){const e=this.elements;e[0]=t.x,e[4]=t.y,e[8]=t.z}getTrace(t=new hj){const e=this.elements;return t.x=e[0],t.y=e[4],t.z=e[8],t}vmult(t,e=new hj){const n=this.elements,i=t.x,r=t.y,s=t.z;return e.x=n[0]*i+n[1]*r+n[2]*s,e.y=n[3]*i+n[4]*r+n[5]*s,e.z=n[6]*i+n[7]*r+n[8]*s,e}smult(t){for(let e=0;e0){const t=1/i;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return i}unit(t=new hj){const e=this.x,n=this.y,i=this.z;let r=Math.sqrt(e*e+n*n+i*i);return r>0?(r=1/r,t.x=e*r,t.y=n*r,t.z=i*r):(t.x=1,t.y=0,t.z=0),t}length(){const t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)}lengthSquared(){return this.dot(this)}distanceTo(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return Math.sqrt((r-e)*(r-e)+(s-n)*(s-n)+(o-i)*(o-i))}distanceSquared(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return(r-e)*(r-e)+(s-n)*(s-n)+(o-i)*(o-i)}scale(t,e=new hj){const n=this.y,i=this.z;return e.x=t*this.x,e.y=t*n,e.z=t*i,e}vmul(t,e=new hj){return e.x=t.x*this.x,e.y=t.y*this.y,e.z=t.z*this.z,e}addScaledVector(t,e,n=new hj){return n.x=this.x+t*e.x,n.y=this.y+t*e.y,n.z=this.z+t*e.z,n}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(t=new hj){return t.x=-this.x,t.y=-this.y,t.z=-this.z,t}tangents(t,e){const n=this.length();if(n>0){const i=dj,r=1/n;i.set(this.x*r,this.y*r,this.z*r);const s=pj;Math.abs(i.x)<.9?(s.set(1,0,0),i.cross(s,t)):(s.set(0,1,0),i.cross(s,t)),i.cross(t,e)}else t.set(1,0,0),e.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}lerp(t,e,n){const i=this.x,r=this.y,s=this.z;n.x=i+(t.x-i)*e,n.y=r+(t.y-r)*e,n.z=s+(t.z-s)*e}almostEquals(t,e=1e-6){return!(Math.abs(this.x-t.x)>e||Math.abs(this.y-t.y)>e||Math.abs(this.z-t.z)>e)}almostZero(t=1e-6){return!(Math.abs(this.x)>t||Math.abs(this.y)>t||Math.abs(this.z)>t)}isAntiparallelTo(t,e){return this.negate(fj),fj.almostEquals(t,e)}clone(){return new hj(this.x,this.y,this.z)}}hj.ZERO=void 0,hj.UNIT_X=void 0,hj.UNIT_Y=void 0,hj.UNIT_Z=void 0,hj.ZERO=new hj(0,0,0),hj.UNIT_X=new hj(1,0,0),hj.UNIT_Y=new hj(0,1,0),hj.UNIT_Z=new hj(0,0,1);const dj=new hj,pj=new hj,fj=new hj;class gj{constructor(t={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new hj,this.upperBound=new hj,t.lowerBound&&this.lowerBound.copy(t.lowerBound),t.upperBound&&this.upperBound.copy(t.upperBound)}setFromPoints(t,e,n,i){const r=this.lowerBound,s=this.upperBound,o=n;r.copy(t[0]),o&&o.vmult(r,r),s.copy(r);for(let a=1;as.x&&(s.x=e.x),e.xs.y&&(s.y=e.y),e.ys.z&&(s.z=e.z),e.z=r.x&&e.y<=i.y&&n.y>=r.y&&e.z<=i.z&&n.z>=r.z}getCorners(t,e,n,i,r,s,o,a){const l=this.lowerBound,c=this.upperBound;t.copy(l),e.set(c.x,l.y,l.z),n.set(c.x,c.y,l.z),i.set(l.x,c.y,c.z),r.set(c.x,l.y,c.z),s.set(l.x,c.y,l.z),o.set(l.x,l.y,c.z),a.copy(c)}toLocalFrame(t,e){const n=bj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(let i=0;8!==i;i++){const e=n[i];t.pointToLocal(e,e)}return e.setFromPoints(n)}toWorldFrame(t,e){const n=bj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(let i=0;8!==i;i++){const e=n[i];t.pointToWorld(e,e)}return e.setFromPoints(n)}overlapsRay(t){const{direction:e,from:n}=t,i=1/e.x,r=1/e.y,s=1/e.z,o=(this.lowerBound.x-n.x)*i,a=(this.upperBound.x-n.x)*i,l=(this.lowerBound.y-n.y)*r,c=(this.upperBound.y-n.y)*r,u=(this.lowerBound.z-n.z)*s,h=(this.upperBound.z-n.z)*s,d=Math.max(Math.max(Math.min(o,a),Math.min(l,c)),Math.min(u,h)),p=Math.min(Math.min(Math.max(o,a),Math.max(l,c)),Math.max(u,h));return!(p<0||d>p)}}const mj=new hj,bj=[new hj,new hj,new hj,new hj,new hj,new hj,new hj,new hj];class yj{constructor(t=0,e=0,n=0,i=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=t,this.y=e,this.z=n,this.w=i}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(t,e){const n=Math.sin(.5*e);return this.x=t.x*n,this.y=t.y*n,this.z=t.z*n,this.w=Math.cos(.5*e),this}toAxisAngle(t=new hj){this.normalize();const e=2*Math.acos(this.w),n=Math.sqrt(1-this.w*this.w);return n<.001?(t.x=this.x,t.y=this.y,t.z=this.z):(t.x=this.x/n,t.y=this.y/n,t.z=this.z/n),[t,e]}setFromVectors(t,e){if(t.isAntiparallelTo(e)){const e=vj;t.tangents(e,_j),this.setFromAxisAngle(e,Math.PI)}else{const n=t.cross(e);this.x=n.x,this.y=n.y,this.z=n.z,this.w=Math.sqrt(Nr(t.length(),2)*Nr(e.length(),2))+t.dot(e),this.normalize()}return this}mult(t,e=new yj){const n=this.x,i=this.y,r=this.z,s=this.w,o=t.x,a=t.y,l=t.z,c=t.w;return e.x=n*c+s*o+i*l-r*a,e.y=i*c+s*a+r*o-n*l,e.z=r*c+s*l+n*a-i*o,e.w=s*c-n*o-i*a-r*l,e}inverse(t=new yj){const e=this.x,n=this.y,i=this.z,r=this.w;this.conjugate(t);const s=1/(e*e+n*n+i*i+r*r);return t.x*=s,t.y*=s,t.z*=s,t.w*=s,t}conjugate(t=new yj){return t.x=-this.x,t.y=-this.y,t.z=-this.z,t.w=this.w,t}normalize(){let t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}normalizeFast(){const t=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}vmult(t,e=new hj){const n=t.x,i=t.y,r=t.z,s=this.x,o=this.y,a=this.z,l=this.w,c=l*n+o*r-a*i,u=l*i+a*n-s*r,h=l*r+s*i-o*n,d=-s*n-o*i-a*r;return e.x=c*l+d*-s+u*-a-h*-o,e.y=u*l+d*-o+h*-s-c*-a,e.z=h*l+d*-a+c*-o-u*-s,e}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}toEuler(t,e="YZX"){let n,i,r;const s=this.x,o=this.y,a=this.z,l=this.w;switch(e){case"YZX":const t=s*o+a*l;if(t>.499&&(n=2*Math.atan2(s,l),i=Math.PI/2,r=0),t<-.499&&(n=-2*Math.atan2(s,l),i=-Math.PI/2,r=0),void 0===n){const e=s*s,c=a*a;n=Math.atan2(2*o*l-2*s*a,1-o*o*2-2*c),i=Math.asin(2*t),r=Math.atan2(2*s*l-2*o*a,1-2*e-2*c)}break;default:throw new Error("Euler order "+e+" not supported yet.")}t.y=n,t.z=i,t.x=r}setFromEuler(t,e,n,i="XYZ"){const r=Math.cos(t/2),s=Math.cos(e/2),o=Math.cos(n/2),a=Math.sin(t/2),l=Math.sin(e/2),c=Math.sin(n/2);return"XYZ"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o-a*l*c):"YXZ"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o+a*l*c):"ZXY"===i?(this.x=a*s*o-r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o-a*l*c):"ZYX"===i?(this.x=a*s*o-r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o+a*l*c):"YZX"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o-a*l*c):"XZY"===i&&(this.x=a*s*o-r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o+a*l*c),this}clone(){return new yj(this.x,this.y,this.z,this.w)}slerp(t,e,n=new yj){const i=this.x,r=this.y,s=this.z,o=this.w;let a,l,c,u,h,d=t.x,p=t.y,f=t.z,g=t.w;return l=i*d+r*p+s*f+o*g,l<0&&(l=-l,d=-d,p=-p,f=-f,g=-g),1-l>1e-6?(a=Math.acos(l),c=Math.sin(a),u=Math.sin((1-e)*a)/c,h=Math.sin(e*a)/c):(u=1-e,h=e),n.x=u*i+h*d,n.y=u*r+h*p,n.z=u*s+h*f,n.w=u*o+h*g,n}integrate(t,e,n,i=new yj){const r=t.x*n.x,s=t.y*n.y,o=t.z*n.z,a=this.x,l=this.y,c=this.z,u=this.w,h=.5*e;return i.x+=h*(r*u+s*c-o*l),i.y+=h*(s*u+o*a-r*c),i.z+=h*(o*u+r*l-s*a),i.w+=h*(-r*a-s*l-o*c),i}}const vj=new hj,_j=new hj,wj={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let xj=(()=>{class t{constructor(e={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=t.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=!e.collisionResponse||e.collisionResponse,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:1,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,e){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,e,n,i){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return t.idCounter=0,t.types=wj,t})();class Sj{constructor(t={}){this.position=void 0,this.quaternion=void 0,this.position=new hj,this.quaternion=new yj,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}pointToLocal(t,e){return Sj.pointToLocalFrame(this.position,this.quaternion,t,e)}pointToWorld(t,e){return Sj.pointToWorldFrame(this.position,this.quaternion,t,e)}vectorToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e}static pointToLocalFrame(t,e,n,i=new hj){return n.vsub(t,i),e.conjugate(Ej),Ej.vmult(i,i),i}static pointToWorldFrame(t,e,n,i=new hj){return e.vmult(n,i),i.vadd(t,i),i}static vectorToWorldFrame(t,e,n=new hj){return t.vmult(e,n),n}static vectorToLocalFrame(t,e,n,i=new hj){return e.w*=-1,e.vmult(n,i),e.w*=-1,i}}const Ej=new yj;class Cj extends xj{constructor(t={}){const{vertices:e=[],faces:n=[],normals:i=[],axes:r,boundingSphereRadius:s}=t;super({type:xj.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=e,this.faces=n,this.faceNormals=i,0===this.faceNormals.length&&this.computeNormals(),s?this.boundingSphereRadius=s:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=r?r.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const t=this.faces,e=this.vertices,n=this.uniqueEdges;n.length=0;const i=new hj;for(let r=0;r!==t.length;r++){const s=t[r],o=s.length;for(let t=0;t!==o;t++){e[s[t]].vsub(e[s[(t+1)%o]],i),i.normalize();let r=!1;for(let t=0;t!==n.length;t++)if(n[t].almostEquals(i)||n[t].almostEquals(i)){r=!0;break}r||n.push(i.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let t=0;th&&(h=t,u=p)}const d=[];for(let p=0;p=0&&this.clipFaceAgainstHull(s,t,e,d,o,a,l)}findSeparatingAxis(t,e,n,i,r,s,o,a){const l=new hj,c=new hj,u=new hj,h=new hj,d=new hj,p=new hj;let f=Number.MAX_VALUE;const g=this;if(g.uniqueAxes)for(let m=0;m!==g.uniqueAxes.length;m++){n.vmult(g.uniqueAxes[m],l);const o=g.testSepAxis(l,t,e,n,i,r);if(!1===o)return!1;o0&&s.negate(s),!0}testSepAxis(t,e,n,i,r,s){Cj.project(this,t,n,i,Oj),Cj.project(e,t,r,s,Tj);const o=Oj[0],a=Oj[1],l=Tj[0],c=Tj[1];if(o0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?Dj.STATIC:Dj.DYNAMIC,typeof t.type==typeof Dj.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=Dj.AWAKE,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new hj,this.quaternion=new yj,this.initQuaternion=new yj,this.previousQuaternion=new yj,this.interpolatedQuaternion=new yj,t.quaternion&&(this.quaternion.copy(t.quaternion),this.initQuaternion.copy(t.quaternion),this.previousQuaternion.copy(t.quaternion),this.interpolatedQuaternion.copy(t.quaternion)),this.angularVelocity=new hj,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new hj,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new hj,this.invInertia=new hj,this.invInertiaWorld=new cj,this.invMassSolve=0,this.invInertiaSolve=new hj,this.invInertiaWorldSolve=new cj,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new hj(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new hj(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new gj,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new hj,this.isTrigger=Boolean(t.isTrigger),t.shape&&this.addShape(t.shape),this.updateMassProperties()}wakeUp(){const t=this.sleepState;this.sleepState=Dj.AWAKE,this.wakeUpAfterNarrowphase=!1,t===Dj.SLEEPING&&this.dispatchEvent(Dj.wakeupEvent)}sleep(){this.sleepState=Dj.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(t){if(this.allowSleep){const e=this.sleepState,n=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),i=Nr(this.sleepSpeedLimit,2);e===Dj.AWAKE&&ni?this.wakeUp():e===Dj.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(Dj.sleepEvent))}}updateSolveMassProperties(){this.sleepState===Dj.SLEEPING||this.type===Dj.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(t,e=new hj){return t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e}vectorToLocalFrame(t,e=new hj){return this.quaternion.conjugate().vmult(t,e),e}pointToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e.vadd(this.position,e),e}vectorToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e}addShape(t,e,n){const i=new hj,r=new yj;return e&&i.copy(e),n&&r.copy(n),this.shapes.push(t),this.shapeOffsets.push(i),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=this,this}removeShape(t){const e=this.shapes.indexOf(t);return-1===e?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(e,1),this.shapeOffsets.splice(e,1),this.shapeOrientations.splice(e,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=null,this)}updateBoundingRadius(){const t=this.shapes,e=this.shapeOffsets,n=t.length;let i=0;for(let r=0;r!==n;r++){const n=t[r];n.updateBoundingSphereRadius();const s=e[r].length(),o=n.boundingSphereRadius;s+o>i&&(i=s+o)}this.boundingRadius=i}updateAABB(){const t=this.shapes,e=this.shapeOffsets,n=this.shapeOrientations,i=t.length,r=Rj,s=Nj,o=this.quaternion,a=this.aabb,l=Lj;for(let c=0;c!==i;c++){const i=t[c];o.vmult(e[c],r),r.vadd(this.position,r),o.mult(n[c],s),i.calculateWorldAABB(r,s,l.lowerBound,l.upperBound),0===c?a.copy(l):a.extend(l)}this.aabbNeedsUpdate=!1}updateInertiaWorld(t){const e=this.invInertia;if(e.x!==e.y||e.y!==e.z||t){const t=jj,n=Fj;t.setRotationFromQuaternion(this.quaternion),t.transpose(n),t.scale(e,t),t.mmult(n,this.invInertiaWorld)}}applyForce(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;this.sleepState===Dj.SLEEPING&&this.wakeUp();const n=Bj;e.cross(t,n),this.force.vadd(t,this.force),this.torque.vadd(n,this.torque)}applyLocalForce(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;const n=Vj,i=zj;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyForce(n,i)}applyTorque(t){this.type===Dj.DYNAMIC&&(this.sleepState===Dj.SLEEPING&&this.wakeUp(),this.torque.vadd(t,this.torque))}applyImpulse(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;this.sleepState===Dj.SLEEPING&&this.wakeUp();const n=e,i=Uj;i.copy(t),i.scale(this.invMass,i),this.velocity.vadd(i,this.velocity);const r=Hj;n.cross(t,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;const n=$j,i=Gj;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyImpulse(n,i)}updateMassProperties(){const t=Wj;this.invMass=this.mass>0?1/this.mass:0;const e=this.inertia,n=this.fixedRotation;this.updateAABB(),t.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),Pj.calculateInertia(t,this.mass,e),this.invInertia.set(e.x>0&&!n?1/e.x:0,e.y>0&&!n?1/e.y:0,e.z>0&&!n?1/e.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(t,e){const n=new hj;return t.vsub(this.position,n),this.angularVelocity.cross(n,e),this.velocity.vadd(e,e),e}integrate(t,e,n){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==Dj.DYNAMIC&&this.type!==Dj.KINEMATIC||this.sleepState===Dj.SLEEPING)return;const i=this.velocity,r=this.angularVelocity,s=this.position,o=this.force,a=this.torque,l=this.quaternion,c=this.invInertiaWorld,u=this.linearFactor,h=this.invMass*t;i.x+=o.x*h*u.x,i.y+=o.y*h*u.y,i.z+=o.z*h*u.z;const d=c.elements,p=this.angularFactor,f=a.x*p.x,g=a.y*p.y,m=a.z*p.z;r.x+=t*(d[0]*f+d[1]*g+d[2]*m),r.y+=t*(d[3]*f+d[4]*g+d[5]*m),r.z+=t*(d[6]*f+d[7]*g+d[8]*m),s.x+=i.x*t,s.y+=i.y*t,s.z+=i.z*t,l.integrate(this.angularVelocity,t,this.angularFactor,l),e&&(n?l.normalizeFast():l.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}Dj.idCounter=0,Dj.COLLIDE_EVENT_NAME="collide",Dj.DYNAMIC=1,Dj.STATIC=2,Dj.KINEMATIC=4,Dj.AWAKE=0,Dj.SLEEPY=1,Dj.SLEEPING=2,Dj.wakeupEvent={type:"wakeup"},Dj.sleepyEvent={type:"sleepy"},Dj.sleepEvent={type:"sleep"};const Rj=new hj,Nj=new yj,Lj=new gj,jj=new cj,Fj=new cj,Bj=new hj,Vj=new hj,zj=new hj,Uj=new hj,Hj=new hj,$j=new hj,Gj=new hj,Wj=new hj;new hj,new hj;class qj{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new hj,this.rayToWorld=new hj,this.hitNormalWorld=new hj,this.hitPointWorld=new hj,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(t,e,n,i,r,s,o){this.rayFromWorld.copy(t),this.rayToWorld.copy(e),this.hitNormalWorld.copy(n),this.hitPointWorld.copy(i),this.shape=r,this.body=s,this.distance=o}}let Xj,Yj,Kj,Qj,Zj,Jj,tF;Xj=xj.types.SPHERE,Yj=xj.types.PLANE,Kj=xj.types.BOX,Qj=xj.types.CYLINDER,Zj=xj.types.CONVEXPOLYHEDRON,Jj=xj.types.HEIGHTFIELD,tF=xj.types.TRIMESH;class eF{get[Xj](){return this._intersectSphere}get[Yj](){return this._intersectPlane}get[Kj](){return this._intersectBox}get[Qj](){return this._intersectConvex}get[Zj](){return this._intersectConvex}get[Jj](){return this._intersectHeightfield}get[tF](){return this._intersectTrimesh}constructor(t=new hj,e=new hj){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=t.clone(),this.to=e.clone(),this.direction=new hj,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=eF.ANY,this.result=new qj,this.hasHit=!1,this.callback=t=>{}}intersectWorld(t,e){return this.mode=e.mode||eF.ANY,this.result=e.result||new qj,this.skipBackfaces=!!e.skipBackfaces,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===e.checkCollisionResponse||e.checkCollisionResponse,e.from&&this.from.copy(e.from),e.to&&this.to.copy(e.to),this.callback=e.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(nF),iF.length=0,t.broadphase.aabbQuery(t,nF,iF),this.intersectBodies(iF),this.hasHit}intersectBody(t,e){e&&(this.result=e,this.updateDirection());const n=this.checkCollisionResponse;if(n&&!t.collisionResponse||0==(this.collisionFilterGroup&t.collisionFilterMask)||0==(t.collisionFilterGroup&this.collisionFilterMask))return;const i=oF,r=aF;for(let s=0,o=t.shapes.length;st.boundingSphereRadius)return;const r=this[t.type];r&&r.call(this,t,e,n,i,t)}_intersectBox(t,e,n,i,r){return this._intersectConvex(t.convexPolyhedronRepresentation,e,n,i,r)}_intersectPlane(t,e,n,i,r){const s=this.from,o=this.to,a=this.direction,l=new hj(0,0,1);e.vmult(l,l);const c=new hj;s.vsub(n,c);const u=c.dot(l);if(o.vsub(n,c),u*c.dot(l)>0||s.distanceTo(o)=0&&t<=1&&(s.lerp(o,t,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1)),this.result.shouldStop)return;e>=0&&e<=1&&(s.lerp(o,e,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1))}}_intersectConvex(t,e,n,i,r,s){const o=yF,a=vF,l=s&&s.faceList||null,c=t.faces,u=t.vertices,h=t.faceNormals,d=this.direction,p=this.from,f=p.distanceTo(this.to),g=l?l.length:c.length,m=this.result;for(let b=0;!m.shouldStop&&bf||this.reportIntersection(o,lF,r,i,t)}}}}_intersectTrimesh(t,e,n,i,r,s){const o=_F,a=OF,l=TF,c=vF,u=wF,h=xF,d=SF,p=CF,f=EF,g=t.indices,m=this.from,b=this.to,y=this.direction;l.position.copy(n),l.quaternion.copy(e),Sj.vectorToLocalFrame(n,e,y,u),Sj.pointToLocalFrame(n,e,m,h),Sj.pointToLocalFrame(n,e,b,d),d.x*=t.scale.x,d.y*=t.scale.y,d.z*=t.scale.z,h.x*=t.scale.x,h.y*=t.scale.y,h.z*=t.scale.z,d.vsub(h,u),u.normalize();const v=h.distanceSquared(d);t.tree.rayQuery(this,l,a);for(let _=0,w=a.length;!this.result.shouldStop&&_!==w;_++){const s=a[_];t.getNormal(s,o),t.getVertex(g[3*s],cF),cF.vsub(h,c);const l=u.dot(o),d=o.dot(c)/l;if(d<0)continue;u.scale(d,lF),lF.vadd(h,lF),t.getVertex(g[3*s+1],uF),t.getVertex(g[3*s+2],hF);const m=lF.distanceSquared(h);!eF.pointInTriangle(lF,uF,cF,hF)&&!eF.pointInTriangle(lF,cF,uF,hF)||m>v||(Sj.vectorToWorldFrame(e,o,f),Sj.pointToWorldFrame(n,e,lF,p),this.reportIntersection(f,p,r,i,s))}a.length=0}reportIntersection(t,e,n,i,r){const s=this.from,o=this.to,a=s.distanceTo(e),l=this.result;if(!(this.skipBackfaces&&t.dot(this.direction)>0))switch(l.hitFaceIndex=void 0!==r?r:-1,this.mode){case eF.ALL:this.hasHit=!0,l.set(s,o,t,e,n,i,a),l.hasHit=!0,this.callback(l);break;case eF.CLOSEST:(a=0&&(u=r*l-s*o)>=0&&c+uDate.now()-t}var iB=n(24517);function rB(t,e,n){e||(e=new bT(bT.IDENTITY));const i=new bT(bT.IDENTITY);if(t.matrix)i.copy(t.matrix);else{if(i.identity(),t.translation&&i.translate(t.translation),t.rotation){const e=new bT(bT.IDENTITY).fromQuaternion(t.rotation);i.multiplyRight(e)}t.scale&&i.scale(t.scale)}const r=new bT(e).multiplyRight(i);if(!1===n(t,r,e))return!1;for(const s of t.nodes||t.children||[])if(!1===rB(s,r,n))return!1;return!0}function sB(){fP([zR,YL])}function oB(t,e){const n=e.nodes.find(e=>e.name===t);if(n){let i=!1;for(const t of e.scenes)i||rB(t,new bT(bT.IDENTITY),(t,e)=>t!==n||(t.matrix=e,t.translation=void 0,t.rotation=void 0,t.scale=void 0,i=!0,!1));return e.scene={id:t,name:t,nodes:[n]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function aB(t,e){return lw(this,void 0,void 0,function*(){const n=t.scenegraph;let i;i=e?e[n]||(e[n]=fetch(n).then(t=>t.blob())):fetch(n);const r=yield CP(i,YL,{DracoLoader:DN,gltf:{decompressMeshes:!0,postProcess:!0}});return oB(t.scenegraphNode,r)})}function lB(t,e){return lw(this,void 0,void 0,function*(){return oB(t,yield e)})}function cB(t,e,n){if(e&&0!==e.length)return new fR(Object.assign({id:t,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mw.CARTESIAN,data:e,mesh:new lj,wireframe:!1,getTransformMatrix:t=>t.transformMatrix,getColor:t=>t.color||[255,255,255,229.5]},n))}let uB=(()=>{class t extends jP{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),sB()}renderLayers(){const e=this.state,n=e.data.filter(t=>!t.scenegraph&&!t.wireframe&&t.unpickable),i=e.data.filter(t=>!t.scenegraph&&!t.wireframe&&!t.unpickable),r=e.data.filter(t=>!t.scenegraph&&t.wireframe),s=e.data.filter(t=>!!t.scenegraph);e.doCollisions&&function(t){lw(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=t.filter(t=>!t.scenegraph&&!t.wireframe).map(t=>{const e=new bT(t.transformMatrix),n=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return{"@id":t["@id"],name:t.tooltip,entityId:t.entityId,bbox:new gj({lowerBound:new hj(...n.map((t,e)=>Math.min(t,i[e]))),upperBound:new hj(...i.map((t,e)=>Math.max(t,n[e])))})}}),n=[];for(const o of t.filter(t=>!!t.scenegraph)){const t=yield AP(o.scenegraph,YL,{DracoLoader:DN,decompress:!0,postProcess:!0});for(const e of t.scenes)rB(e,new bT(o.transformMatrix),(e,i)=>{if(e.mesh&&e.mesh.primitives&&e.mesh.primitives.length>0)for(const r of e.mesh.primitives)if(r.attributes.POSITION&&r.attributes.POSITION.min){const s=i.transformAsPoint(r.attributes.POSITION.min,[]),a=i.transformAsPoint(r.attributes.POSITION.max,[]);n.push({"@id":o["@id"],name:e.name,entityId:o.entityId,bbox:new gj({lowerBound:new hj(...s.map((t,e)=>Math.min(t,a[e]))),upperBound:new hj(...a.map((t,e)=>Math.max(t,s[e])))}),gltf:t})}return!0})}const i=[],r=[];for(const t of e){const e=[];for(const i of n)t.bbox.overlaps(i.bbox)&&e.push({"@id":i["@id"],name:i.name});e.length>0?i.push({"@id":t.entityId,name:t.name,hits:e}):r.push(t)}console.log({sourceBoxes:e,targetBoxes:n,report:i,sad:r,maxHits:Math.max(...i.map(t=>t.hits.length))});const s=[];for(const t of i){s.push({"Tissue ID":t["@id"],"Tissue Name":t.name,"Hit ID":"","Hit Name":""});for(const e of t.hits)s.push({"Tissue ID":t["@id"],"Tissue Name":t.name,"Hit ID":e["@id"],"Hit Name":e.name})}return console.log(s),i})}(e.data);const o={};for(const a of s)a.scenegraph&&a.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,a.scenegraph)&&(o[a.scenegraph]=aB({scenegraph:a.scenegraph},t.gltfCache));return[cB("cubes",n,{wireframe:!1,pickable:!1}),cB("pickableCubes",i,{wireframe:!1,pickable:!0}),cB("wireframes",r,{wireframe:!0,pickable:!1}),...s.map(t=>{var n;return new nj({id:"models-"+t["@id"],opacity:t.zoomBasedOpacity?e.zoomOpacity:void 0!==t.opacity?t.opacity:1,pickable:!t.unpickable,coordinateSystem:Mw.CARTESIAN,data:[t],scenegraph:t.scenegraphNode?lB(t.scenegraphNode,o[t.scenegraph]):t.scenegraph,_lighting:t._lighting,getTransformMatrix:t.transformMatrix,getColor:null!==(n=t.color)&&void 0!==n?n:[0,255,0,127.5],parameters:{depthMask:!t.zoomBasedOpacity&&(void 0===t.opacity||1===t.opacity)}})})].filter(t=>!!t)}getPickingInfo(t){return t.info}}return t.layerName="BodyUILayer",t.gltfCache={},t})();function hB(t,e=[]){for(const n of t.nodes||t.children||[])e.push(n.name),hB(n,e);return e}let dB=(()=>{class t{constructor(t){var e,n,i,r,s;this.deckProps=t,this.bodyUILayer=new uB({}),this.nodeClickSubject=new P,this.nodeHoverStartSubject=new P,this.nodeHoverStopSubject=new P,this.sceneRotationSubject=new Uf([0,0]),this.nodeDragStartSubject=new P,this.nodeDragSubject=new P,this.nodeDragEndSubject=new P,this.nodeClick$=this.nodeClickSubject.pipe(at()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(at()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(at()),this.sceneRotation$=this.sceneRotationSubject.pipe(at()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(at()),this.nodeDrag$=this.nodeDragSubject.pipe(at()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(at());const o=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new pI({flipY:!1,near:-1e3}):new bI({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:t=>{var e;return null!==(e=this.cursor)&&void 0!==e?e:t.isDragging?"grabbing":"grab"}});t.legacyLighting&&(o.effects=[new $I({ambientLight:new wI({color:[255,255,255],intensity:10})})]),this.deck=new WD(o),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(e=t.minRotationX)&&void 0!==e?e:-15,maxRotationX:null!==(n=t.maxRotationX)&&void 0!==n?n:15,target:null!==(i=t.target)&&void 0!==i?i:[.5,.5,0],rotationX:0,rotationOrbit:null!==(r=t.rotation)&&void 0!==r?r:0,zoom:null!==(s=t.zoom)&&void 0!==s?s:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return lw(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let e=this.bodyUILayer.state.zoomOpacity,n=!1;for(const i of t)i.zoomToOnLoad&&(this.zoomTo(i),n=!0);e=n?.05:e,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,e):this.bodyUILayer.setState({data:t,zoomOpacity:e})}}debugSceneNodeProcessing(t,e){const n="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",i=new bT([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(t,e,n){return lw(this,void 0,void 0,function*(){sB();const n=yield aB({scenegraph:t,scenegraphNode:"VHF_Kidney_L_Low1"}),i={},r=[];for(const s of n.scenes)rB(s,e=new bT(e||bT.IDENTITY),(n,s)=>{const o={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new bT(s),wireframe:!0,node:n};if(r.push({"@id":`GLTF:${o["@id"]}`,"@type":"GLTFNode",scenegraph:t,scenegraphNode:o["@id"],transformMatrix:new bT(e||bT.IDENTITY),tooltip:n.name||n.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:n}),n.mesh&&n.mesh.primitives&&n.mesh.primitives.length>0)for(const t of n.mesh.primitives)if(t.attributes.POSITION&&t.attributes.POSITION.min){const e=s.transformAsPoint(t.attributes.POSITION.min,[]),n=s.transformAsPoint(t.attributes.POSITION.max,[]);o.bbox=new gj({lowerBound:new hj(...e.map((t,e)=>Math.min(t,n[e]))),upperBound:new hj(...n.map((t,n)=>Math.max(t,e[n])))})}return i[o["@id"]]=o,!0});for(const t of Object.values(i).filter(t=>!t.bbox)){for(const e of hB(t.node).map(t=>i[t]).filter(t=>t.bbox))t.bbox?t.bbox.extend(e.bbox):t.bbox=e.bbox.clone();t.bbox||delete i[t["@id"]]}for(const t of Object.values(i)){const e=t.bbox.lowerBound,n=(t.size=t.bbox.upperBound.clone().vsub(e)).clone().vmul(new hj(.5,.5,.5)),i=t.center=e.clone().vadd(n);t.transformMatrix=new bT(bT.IDENTITY).translate(i.toArray()).scale(n.toArray())}for(const t of r)i[t["@id"]]=t;return i})})(n,i).then(r=>{console.log("results",r),console.log("data",t),(t=t.concat(Object.values(r))).push({"@id":"TEST","@type":"TEST",scenegraph:n,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:i,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:e})})}zoomTo(t){const e=new bT(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:e.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:e}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?e!==t.object&&(e&&this.nodeHoverStopSubject.next(e),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):e&&(this.nodeHoverStopSubject.next(e),this.lastHovered=void 0)}_onClick(t,e){var n,i;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(i=null===(n=null==e?void 0:e.srcEvent)||void 0===n?void 0:n.ctrlKey)&&void 0!==i?i:void 0})}_onViewStateChange(t){var e;if(null===(e=t.interactionState)||void 0===e?void 0:e.isZooming){const e=this.bodyUILayer.state,n=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);e.zoomOpacity!==n&&this.bodyUILayer.setState({data:e.data,zoomOpacity:n})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,e){this._dragEvent(t,e,this.nodeDragStartSubject)}_onDrag(t,e){this._dragEvent(t,e,this.nodeDragSubject)}_onDragEnd(t,e){this._dragEvent(t,e,this.nodeDragEndSubject)}_dragEvent(t,e,n){var i;(null===(i=null==t?void 0:t.object)||void 0===i?void 0:i["@id"])&&n.next({node:t.object,info:t,e})}}return sw([iB.ZP],t.prototype,"_onHover",null),sw([iB.ZP],t.prototype,"_onClick",null),sw([iB.ZP],t.prototype,"_onViewStateChange",null),sw([iB.ZP],t.prototype,"_onDragStart",null),sw([iB.ZP],t.prototype,"_onDrag",null),sw([iB.ZP],t.prototype,"_onDragEnd",null),t})();function pB(t,e){return t===e}function fB(t,e,n){if(null===e||null===n||e.length!==n.length)return!1;const i=e.length;for(let r=0;r(t&&t.providers||[]).some(t=>t&&t.provide&&"MockNgModuleResolver"===t.provide.name||!1))});let bB=(()=>{class t{constructor(){this.bootstrap$=new lp(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const yB=new oi("INITIAL_STATE_TOKEN");let vB=(()=>{class t{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return t.value={},t})();const _B=new oi("Internals.StateContextFactory"),wB=new oi("Internals.StateFactory");function xB(t,e){return e?n=>n.pipe(xB((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new SB(t))}class SB{constructor(t){this.project=t}call(t,e){return e.subscribe(new EB(t,this.project))}}class EB extends ${constructor(t,e){super(t),this.project=e,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(t){this.hasSubscription||this.tryNext(t)}tryNext(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this.hasSubscription=!0,this._innerSub(e)}_innerSub(t){const e=new H(this),n=this.destination;n.add(e);const i=G(t,e);i!==e&&n.add(i)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function CB(t=null){return e=>e.lift(new OB(t))}class OB{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new TB(t,this.defaultValue))}}class TB extends v{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}const kB={STATE_NAME:t=>`${t} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(t,e,n)=>`State name '${t}' from ${e} already exists in ${n}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:t=>`'${t}' class should be decorated with @Injectable() right after the @State() decorator`};let AB=(()=>{class t{constructor(t,e){this._ngZone=t,this._platformId=e,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(t){return"server"===t}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return xu.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return xu.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof xu||console.warn(kB.ZONE_WARNING())}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(ou))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const PB=new oi("ROOT_STATE_TOKEN"),IB=new oi("FEATURE_STATE_TOKEN"),MB=new oi("NGXS_PLUGINS"),DB=new oi("NG_TEST_MODE"),RB=new oi("NG_DEV_MODE"),NB="NGXS_META",LB="NGXS_OPTIONS_META";let jB=(()=>{class t{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=AB}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class FB{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}}const BB=new oi("NGXS_EXECUTION_STRATEGY");function VB(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}const zB=(t,e,n)=>{t=Object.assign({},t);const i=e.split("."),r=i.length-1;return i.reduce((t,e,i)=>(t[e]=i===r?n:Array.isArray(t[e])?t[e].slice():Object.assign({},t[e]),t&&t[e]),t),t},UB=(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t),HB=t=>t&&"object"==typeof t&&!Array.isArray(t),$B=(t,...e)=>{if(!e.length)return t;const n=e.shift();if(HB(t)&&HB(n))for(const i in n)HB(n[i])?(t[i]||Object.assign(t,{[i]:{}}),$B(t[i],n[i])):Object.assign(t,{[i]:n[i]});return $B(t,...e)};function GB(t){return t[NB]}function WB(t,e){const n=UB(e.currentAppState,t.path),i=UB(e.newAppState,t.path);return new FB(n,i,!t.isInitialised)}function qB(...t){return function(t,e,n=XB){const i=function(t){return t.reduce((t,e)=>(t[VB(e)]=!0,t),{})}(t),r=e&&function(t){return t.reduce((t,e)=>(t[e]=!0,t),{})}(e);return function(t){return t.pipe(function(t,e){return Hd(n=>{const i=VB(n.action);return t[i]&&(!e||e[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function XB(){return D(t=>t.action)}function YB(t){return e=>new C(n=>e.subscribe({next(e){t.leave(()=>n.next(e))},error(e){t.leave(()=>n.error(e))},complete(){t.leave(()=>n.complete())}}))}let KB=(()=>{class t{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(BB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class QB extends P{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(t){if(this._busyPushingNext)this._itemQueue.unshift(t);else{for(this._busyPushingNext=!0,super.next(t);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let ZB=(()=>{class t extends QB{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),JB=(()=>{class t extends C{constructor(t,e){super(n=>{const i=t.pipe(YB(e)).subscribe({next:t=>n.next(t),error:t=>n.error(t),complete:()=>n.complete()});n.add(i)})}}return t.\u0275fac=function(e){return new(e||t)(Ci(ZB),Ci(KB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const tV=t=>(...e)=>t.shift()(...e,(...e)=>tV(t)(...e));let eV=(()=>{class t extends Uf{constructor(){super({})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),nV=(()=>{class t{constructor(t,e){this._parentManager=t,this._pluginHandlers=e,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(t=>t.handle?t.handle.bind(t):t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12),Ci(MB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),iV=(()=>{class t extends P{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),rV=(()=>{class t{constructor(t,e,n,i,r,s){this._injector=t,this._actions=e,this._actionResults=n,this._pluginManager=i,this._stateStream=r,this._ngxsExecutionStrategy=s}dispatch(t){const e=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return e.subscribe({error:t=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(kr),this._errorHandler.handleError(t)}catch(e){}})}),e.pipe(YB(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?wd(this._stateStream.getValue()):hv(t.map(t=>this.dispatchSingle(t))):this.dispatchSingle(t)}dispatchSingle(t){if(!VB(t))return ip(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const e=this._stateStream.getValue();return tV([...this._pluginManager.plugins,(t,n)=>{t!==e&&this._stateStream.next(t);const i=this.getActionResultStream(n);return i.subscribe(t=>this._actions.next(t)),this._actions.next({action:n,status:"DISPATCHED"}),this.createDispatchObservable(i)}])(e,t).pipe(up())}getActionResultStream(t){return this._actionResults.pipe(Hd(e=>e.action===t&&"DISPATCHED"!==e.status),Gp(1),up())}createDispatchObservable(t){return t.pipe(xB(t=>{switch(t.status){case"SUCCESSFUL":return wd(this._stateStream.getValue());case"ERRORED":return ip(t.error);default:return ep}})).pipe(up())}}return t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(ZB),Ci(iV),Ci(nV),Ci(eV),Ci(KB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const sV=t=>{Object.freeze(t);const e="function"==typeof t,n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(function(i){n.call(t,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==t[i]&&("object"==typeof t[i]||"function"==typeof t[i])&&!Object.isFrozen(t[i])&&sV(t[i])}),t};let oV=(()=>{class t{constructor(t,e){this.isDevMode=t,this.isTestMode=e}}return t.\u0275fac=function(e){return new(e||t)(Ci(RB),Ci(DB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),aV=(()=>{class t{constructor(t,e){this._host=t,this._config=e}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(kB.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(kB.INCORRECT_DEVELOPMENT()))}}return t.\u0275fac=function(e){return new(e||t)(Ci(oV),Ci(jB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),lV=(()=>{class t{constructor(t,e,n,i){this._stateStream=t,this._dispatcher=e,this._config=n,i.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:t=>this._stateStream.next(t),dispatch:t=>this._dispatcher.dispatch(t)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:e=>{const n=sV(e);return t.setState(n)},dispatch:e=>t.dispatch(e)}}setStateToTheCurrentWithNew(t){const e=this.getRootStateOperations(),n=e.getState();e.setState(Object.assign({},n,t.defaults))}}return t.\u0275fac=function(e){return new(e||t)(Ci(eV),Ci(rV),Ci(jB),Ci(aV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),cV=(()=>{class t{constructor(t){this._internalStateOperations=t}createStateContext(t){const e=this._internalStateOperations.getRootStateOperations();function n(e){return UB(e,t.path)}function i(n,i){const r=zB(n,t.path,i),s=t.instance;if(s.ngxsOnChanges){const e=WB(t,{currentAppState:n,newAppState:r});s.ngxsOnChanges(e)}return e.setState(r),r}function r(t,e){return i(t,e(n(t)))}return{getState:()=>n(e.getState()),patchState:t=>r(e.getState(),function(t){return e=>{if(Array.isArray(t))throw new Error(kB.PATCHING_ARRAY());if("object"!=typeof t)throw new Error(kB.PATCHING_PRIMITIVE());const n=Object.assign({},e);for(const i in t)n[i]=t[i];return n}}(t)),setState(t){const n=e.getState();return function(t){return"function"==typeof t}(t)?r(n,t):i(n,t)},dispatch:t=>e.dispatch(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(lV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class uV{static stateNameErrorMessage(t){return kB.STATE_NAME(t)}static checkCorrectStateName(t){if(!t)throw new Error(kB.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(t))throw new Error(this.stateNameErrorMessage(t))}static checkStateNameIsUnique(t,e){const n=this.getValidStateMeta(t).name,i=e[n];if(i&&i!==t)throw new Error(kB.STATE_UNIQUE(n,t.name,i.name));return n}static getValidStateMeta(t){const e=GB(t);if(!e)throw new Error(kB.STATE_DECORATOR());return e}}uV.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let hV=(()=>{class t{constructor(t,e,n,i,r,s,o){this._injector=t,this._config=e,this._parentFactory=n,this._actions=i,this._actionResults=r,this._stateContextFactory=s,this._initialState=o,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=gB(()=>{const t=this;function e(e){const n=t.statePaths[e];return n?function(t,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(t){const e=t.slice();return t=>e.reduce((t,e)=>t&&t[e],t)}(t):function(t){const e=t;let n="store."+e[0],i=0;const r=e.length;let s=n;for(;++i(n||(n=e(t)),n?n(...i):void 0))},getSelectorOptions:e=>Object.assign({},t._config.selectorOptions,e||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let e={};return e=Array.isArray(t)?t.slice():function(t){return"object"==typeof t&&null!==t||"function"==typeof t}(t)?Object.assign({},t):void 0===t?{}:t,e}static checkStatesAreValid(t){t.forEach(uV.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(e){t.checkStatesAreValid(e);const{newStates:n}=this.addToStatesMap(e);if(!n.length)return[];const i=function(t){const e=e=>{const n=t.find(t=>t===e);if(!n)throw new Error(`Child state not found: ${e}. \r\nYou may have forgotten to add states to module`);return n[NB].name};return t.reduce((t,n)=>{const{name:i,children:r}=n[NB];return t[i]=(r||[]).map(e),t},{})}(n),r=function(t){const e=[],n={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),n[r]=!0,t[r].forEach(t=>{if(s.indexOf(t)>=0)throw new Error(`Circular dependency '${t}' is required by '${r}': ${s.join(" -> ")}`);n[t]||i(t,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(t).forEach(t=>i(t)),e.reverse()}(i),s=function(t,e={}){const n=(t,e)=>{for(const i in t)if(t.hasOwnProperty(i)&&t[i].indexOf(e)>=0){const e=n(t,i);return null!==e?`${e}.${i}`:i}return null};for(const i in t)if(t.hasOwnProperty(i)){const r=n(t,i);e[i]=r?`${r}.${i}`:i}return e}(i),o=function(t){return t.reduce((t,e)=>(t[e[NB].name]=e,t),{})}(n),a=[];for(const l of r){const e=o[l],n=s[l],i=e[NB];this.addRuntimeInfoToMeta(i,n);const r={name:l,path:n,isInitialised:!1,actions:i.actions,instance:this._injector.get(e),defaults:t.cloneDefaults(i.defaults)};this.hasBeenMountedAndBootstrapped(l,n)||a.push(r),this.states.push(r)}return a}addAndReturnDefaults(t){const e=this.add(t||[]);return{defaults:e.reduce((t,e)=>zB(t,e.path,e.defaults),{}),states:e}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Hd(t=>"DISPATCHED"===t.status),W(({action:t})=>this.invokeActions(this._actions,t).pipe(D(()=>({action:t,status:"SUCCESSFUL"})),CB({action:t,status:"CANCELED"}),pv(e=>wd({action:t,status:"ERRORED",error:e}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,e){const n=VB(e),i=[];for(const s of this.states){const o=s.actions[n];if(o)for(const n of o){const o=this._stateContextFactory.createStateContext(s);try{let r=s.instance[n.fn](o,e);r instanceof Promise&&(r=U(r)),r instanceof C?(r=r.pipe(CB({})),n.options.cancelUncompleted&&(r=r.pipe(Wd(t.pipe(qB(e)))))):r=wd({}).pipe(up()),i.push(r)}catch(r){i.push(ip(r))}}}return i.length||i.push(wd({})),hv(i)}addToStatesMap(t){const e=[],n=this.statesByName;for(const i of t){const t=uV.checkStateNameIsUnique(i,n);!n[t]&&(e.push(i),n[t]=i)}return{newStates:e}}addRuntimeInfoToMeta(t,e){this.statePaths[t.name]=e,t.path=e}hasBeenMountedAndBootstrapped(t,e){const n=void 0!==UB(this._initialState,e);return this.statesByName[t]&&n}}return t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(jB),Ci(t,12),Ci(ZB),Ci(iV),Ci(cV),Ci(yB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),dV=(()=>{class t{constructor(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}ngxsBootstrap(t,e){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Hd(()=>!!e),$f(()=>this.invokeInit(e.states)),W(()=>this.bootstrapper.appBootstrapped$),Hd(t=>!!t)).subscribe(()=>this.invokeBootstrap(e.states))}invokeInit(t){for(const e of t){const t=e.instance;if(t.ngxsOnChanges){const n=WB(e,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});t.ngxsOnChanges(n)}t.ngxsOnInit&&t.ngxsOnInit(this.getStateContext(e)),e.isInitialised=!0}}invokeBootstrap(t){for(const e of t){const t=e.instance;t.ngxsAfterBootstrap&&t.ngxsAfterBootstrap(this.getStateContext(e))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(lV),Ci(cV),Ci(bB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();let pV=(()=>{class t{constructor(t,e,n,i,r,s){this._stateStream=t,this._internalStateOperations=e,this._config=n,this._internalExecutionStrategy=i,this._stateFactory=r,this.initStateStream(s)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const e=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(D(e),pv(t=>{const{suppressErrors:e}=this._config.selectorOptions;return t instanceof TypeError&&e?wd(void 0):ip(t)}),Rd(),YB(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Gp(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(YB(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(t){const e=function(t){return t.NGXS_SELECTOR_META}(t)||GB(t);return e&&e.makeRootSelector||(()=>t)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const e=this._stateStream.value;if(!e||0===Object.keys(e).length){const e=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(e)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(eV),Ci(lV),Ci(jB),Ci(KB),Ci(hV),Ci(yB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),fV=(()=>{class t{constructor(e,n){t.store=e,t.config=n}ngOnDestroy(){t.store=null,t.config=null}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV),Ci(jB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t.store=null,t.config=null,t})();class gV{static get type(){return"@@INIT"}}class mV{constructor(t){this.addedStates=t}static get type(){return"@@UPDATE_STATE"}}const bV=new lp(1);let yV=(()=>{class t{constructor(e,n,i,r,s=[],o){!function(){try{const t=window.ng,e=!(t.probe&&t.coreTokens)&&Nu();bV.next(e)}catch(t){bV.next(!1)}finally{bV.complete()}}();const a=e.addAndReturnDefaults(s);n.setStateToTheCurrentWithNew(a),e.connectActionHandlers(),o.ngxsBootstrap(new gV,a)}}return t.\u0275fac=function(e){return new(e||t)(Ci(hV),Ci(lV),Ci(pV),Ci(fV),Ci(PB,8),Ci(dV))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),vV=(()=>{class t{constructor(e,n,i,r=[],s){const o=t.flattenStates(r),a=i.addAndReturnDefaults(o);a.states.length&&(n.setStateToTheCurrentWithNew(a),s.ngxsBootstrap(new mV(a.defaults),a))}static flattenStates(t=[]){return t.reduce((t,e)=>t.concat(e),[])}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV),Ci(lV),Ci(hV),Ci(IB,8),Ci(dV))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class _V{static forRoot(t=[],e={}){return{ngModule:yV,providers:[hV,cV,JB,ZB,bB,aV,oV,dV,rV,iV,lV,KB,pV,eV,fV,nV,...t,..._V.ngxsTokenProviders(t,e)]}}static forFeature(t=[]){return{ngModule:vV,providers:[hV,nV,...t,{provide:IB,multi:!0,useValue:t}]}}static ngxsTokenProviders(t,e){return[{provide:DB,useValue:mB},{provide:RB,useValue:Nu},{provide:BB,useClass:e.executionStrategy||AB},{provide:PB,useValue:t},{provide:_V.ROOT_OPTIONS,useValue:e},{provide:jB,useFactory:_V.ngxsConfigFactory,deps:[_V.ROOT_OPTIONS]},{provide:au,useFactory:_V.appBootstrapListenerFactory,multi:!0,deps:[bB]},{provide:yB,useFactory:_V.getInitialState},{provide:_B,useExisting:cV},{provide:wB,useExisting:hV}]}static ngxsConfigFactory(t){return $B(new jB,t)}static appBootstrapListenerFactory(t){return()=>t.bootstrap()}static getInitialState(){return vB.pop()}}function wV(t){return e=>{!function(t){bV.subscribe(e=>{e&&(t.\u0275prov||console.warn(kB.UNDECORATED_STATE_IN_IVY(t.name)))})}(e);const n=e,i=function(t){if(!t.hasOwnProperty(NB)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,NB,{value:e})}return GB(t)}(n),r=Object.getPrototypeOf(n),s=function(e){return Object.assign({},e[LB]||{},t)}(r);(function(t){const{meta:e,inheritedStateClass:n,optionsWithInheritance:i}=t,{children:r,defaults:s,name:o}=i,a="string"==typeof o?o:o&&o.getName()||null;uV.checkCorrectStateName(a),n.hasOwnProperty(NB)&&(e.actions=Object.assign({},e.actions,(n[NB]||{}).actions)),e.children=r,e.defaults=s,e.name=a})({meta:i,inheritedStateClass:r,optionsWithInheritance:s}),n[LB]=s}}_V.\u0275fac=function(t){return new(t||_V)},_V.\u0275mod=ie({type:_V}),_V.\u0275inj=St({}),_V.ROOT_OPTIONS=new oi("ROOT_OPTIONS");let xV=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}setProperty(t,e){this._renderer.setProperty(this._elementRef.nativeElement,t,e)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl))},t.\u0275dir=se({type:t}),t})(),SV=(()=>{class t extends xV{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,features:[jo]}),t})();const EV=new oi("NgValueAccessor"),CV={provide:EV,useExisting:pt(()=>TV),multi:!0},OV=new oi("CompositionEventMode");let TV=(()=>{class t extends xV{constructor(t,e,n){super(t,e),this._compositionMode=n,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=Xu()?Xu().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl),ea(OV,8))},t.\u0275dir=se({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,e){1&t&&fa("input",function(t){return e._handleInput(t.target.value)})("blur",function(){return e.onTouched()})("compositionstart",function(){return e._compositionStart()})("compositionend",function(t){return e._compositionEnd(t.target.value)})},features:[_l([CV]),jo]}),t})();const kV=new oi("NgValidators"),AV=new oi("NgAsyncValidators");function PV(t){return null!=t}function IV(t){const e=ha(t)?U(t):t;return pa(e),e}function MV(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function DV(t,e){return e.map(e=>e(t))}function RV(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function NV(t){return null!=t?function(t){if(!t)return null;const e=t.filter(PV);return 0==e.length?null:function(t){return MV(DV(t,e))}}(RV(t)):null}function LV(t){return null!=t?function(t){if(!t)return null;const e=t.filter(PV);return 0==e.length?null:function(t){return hv(DV(t,e).map(IV)).pipe(D(MV))}}(RV(t)):null}function jV(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function FV(t){return t._rawValidators}function BV(t){return t._rawAsyncValidators}function VV(t){return t?Array.isArray(t)?t:[t]:[]}function zV(t,e){return Array.isArray(t)?t.includes(e):t===e}function UV(t,e){const n=VV(e);return VV(t).forEach(t=>{zV(n,t)||n.push(t)}),n}function HV(t,e){return VV(e).filter(e=>!zV(t,e))}let $V=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=NV(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=LV(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})(),GV=(()=>{class t extends $V{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,features:[jo]}),t})();class WV extends $V{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class qV{constructor(t){this._cd=t}is(t){var e,n,i;return"submitted"===t?!!(null===(e=this._cd)||void 0===e?void 0:e.submitted):!!(null===(i=null===(n=this._cd)||void 0===n?void 0:n.control)||void 0===i?void 0:i[t])}}let XV=(()=>{class t extends qV{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(WV,2))},t.\u0275dir=se({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,e){2&t&&ja("ng-untouched",e.is("untouched"))("ng-touched",e.is("touched"))("ng-pristine",e.is("pristine"))("ng-dirty",e.is("dirty"))("ng-valid",e.is("valid"))("ng-invalid",e.is("invalid"))("ng-pending",e.is("pending"))},features:[jo]}),t})(),YV=(()=>{class t extends qV{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(GV,10))},t.\u0275dir=se({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(t,e){2&t&&ja("ng-untouched",e.is("untouched"))("ng-touched",e.is("touched"))("ng-pristine",e.is("pristine"))("ng-dirty",e.is("dirty"))("ng-valid",e.is("valid"))("ng-invalid",e.is("invalid"))("ng-pending",e.is("pending"))("ng-submitted",e.is("submitted"))},features:[jo]}),t})();function KV(t,e){JV(t,e),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&ez(t,e)})}(t,e),function(t,e){const n=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&ez(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),function(t,e){if(e.valueAccessor.setDisabledState){const n=t=>{e.valueAccessor.setDisabledState(t)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}(t,e)}function QV(t,e,n=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),tz(t,e),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function ZV(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function JV(t,e){const n=FV(t);null!==e.validator?t.setValidators(jV(n,e.validator)):"function"==typeof n&&t.setValidators([n]);const i=BV(t);null!==e.asyncValidator?t.setAsyncValidators(jV(i,e.asyncValidator)):"function"==typeof i&&t.setAsyncValidators([i]);const r=()=>t.updateValueAndValidity();ZV(e._rawValidators,r),ZV(e._rawAsyncValidators,r)}function tz(t,e){let n=!1;if(null!==t){if(null!==e.validator){const i=FV(t);if(Array.isArray(i)&&i.length>0){const r=i.filter(t=>t!==e.validator);r.length!==i.length&&(n=!0,t.setValidators(r))}}if(null!==e.asyncValidator){const i=BV(t);if(Array.isArray(i)&&i.length>0){const r=i.filter(t=>t!==e.asyncValidator);r.length!==i.length&&(n=!0,t.setAsyncValidators(r))}}}const i=()=>{};return ZV(e._rawValidators,i),ZV(e._rawAsyncValidators,i),n}function ez(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function nz(t,e){JV(t,e)}function iz(t,e){t._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)})}function rz(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const sz="VALID",oz="INVALID",az="PENDING",lz="DISABLED";function cz(t){return(pz(t)?t.validators:t)||null}function uz(t){return Array.isArray(t)?NV(t):t||null}function hz(t,e){return(pz(e)?e.asyncValidators:t)||null}function dz(t){return Array.isArray(t)?LV(t):t||null}function pz(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class fz{constructor(t,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=uz(this._rawValidators),this._composedAsyncValidatorFn=dz(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===sz}get invalid(){return this.status===oz}get pending(){return this.status==az}get disabled(){return this.status===lz}get enabled(){return this.status!==lz}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=uz(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=dz(t)}addValidators(t){this.setValidators(UV(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(UV(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(HV(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(HV(t,this._rawAsyncValidators))}hasValidator(t){return zV(this._rawValidators,t)}hasAsyncValidator(t){return zV(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=az,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=lz,this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=sz,this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===sz||this.status===az)&&this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?lz:sz}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=az,this._hasOwnPendingAsyncValidator=!0;const e=IV(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(e,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=t;return e.forEach(t=>{i=i instanceof mz?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof bz&&i.at(t)||null}),i}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new Rc,this.statusChanges=new Rc}_calculateStatus(){return this._allControlsDisabled()?lz:this.errors?oz:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(az)?az:this._anyControlsHaveStatus(oz)?oz:sz}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){pz(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class gz extends fz{constructor(t=null,e,n){super(cz(e),hz(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){rz(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){rz(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class mz extends fz{constructor(t,e,n){super(cz(e),hz(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,n={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof gz?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>{const n=this.controls[e];n&&t(n,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,i)=>{n=e(n,t,i)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class bz extends fz{constructor(t,e,n){super(cz(e),hz(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(t){return this.controls[t]}push(t,e={}){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(t,e,n={}){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:n.emitEvent})}removeAt(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t=[],e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof gz?t.value:t.getRawValue())}clear(t={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:t.emitEvent}))}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error(`Cannot find form control at index ${t}`)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}const yz={provide:GV,useExisting:pt(()=>_z)},vz=(()=>Promise.resolve(null))();let _z=(()=>{class t extends GV{constructor(t,e){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Rc,this.form=new mz({},NV(t),LV(e))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){vz.then(()=>{const e=this._findContainer(t.path);t.control=e.registerControl(t.name,t.control),KV(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){vz.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name),rz(this._directives,t)})}addFormGroup(t){vz.then(()=>{const e=this._findContainer(t.path),n=new mz({});nz(n,t),e.registerControl(t.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){vz.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,e){vz.then(()=>{this.form.get(t.path).setValue(e)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,iz(this.form,this._directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10))},t.\u0275dir=se({type:t,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,e){1&t&&fa("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_l([yz]),jo]}),t})(),wz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),t})(),xz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Sz=new oi("NgModelWithFormControlWarning"),Ez={provide:WV,useExisting:pt(()=>Cz)};let Cz=(()=>{class t extends WV{constructor(t,e,n,i){super(),this._ngModelWarningConfig=i,this.update=new Rc,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(e),this.valueAccessor=function(t,e){if(!e)return null;let n,i,r;return Array.isArray(e),e.forEach(t=>{t.constructor===TV?n=t:function(t){return Object.getPrototypeOf(t.constructor)===SV}(t)?i=t:r=t}),r||i||n||null}(0,n)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const e=t.form.previousValue;e&&QV(e,this,!1),KV(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}(function(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)})(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&QV(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10),ea(EV,10),ea(Sz,8))},t.\u0275dir=se({type:t,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[_l([Ez]),jo,ye]}),t._ngModelWarningSentOnce=!1,t})();const Oz={provide:GV,useExisting:pt(()=>Tz)};let Tz=(()=>{class t extends GV{constructor(t,e){super(),this.validators=t,this.asyncValidators=e,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Rc,this._setValidators(t),this._setAsyncValidators(e)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(tz(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const e=this.form.get(t.path);return KV(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){QV(t.control||null,t,!1),rz(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,e){this.form.get(t.path).setValue(e)}onSubmit(t){return this.submitted=!0,iz(this.form,this.directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const e=t.control,n=this.form.get(t.path);e!==n&&(QV(e||null,t),n instanceof gz&&(KV(n,t),t.control=n))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const e=this.form.get(t.path);nz(e,t),e.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const e=this.form.get(t.path);e&&function(t,e){return tz(t,e)}(e,t)&&e.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){JV(this.form,this),this._oldForm&&tz(this._oldForm,this)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10))},t.\u0275dir=se({type:t,selectors:[["","formGroup",""]],hostBindings:function(t,e){1&t&&fa("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_l([Oz]),jo,ye]}),t})(),kz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[xz]]}),t})(),Az=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[kz]}),t})(),Pz=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:Sz,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[kz]}),t})();function Iz(t){return new C(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?U(n):np()).subscribe(e)})}const Mz=["underline"],Dz=["connectionContainer"],Rz=["inputContainer"],Nz=["label"];function Lz(t,e){1&t&&(aa(0),ra(1,"div",14),oa(2,"div",15),oa(3,"div",16),oa(4,"div",17),sa(),ra(5,"div",18),oa(6,"div",15),oa(7,"div",16),oa(8,"div",17),sa(),la())}function jz(t,e){1&t&&(ra(0,"div",19),xa(1,1),sa())}function Fz(t,e){if(1&t&&(aa(0),xa(1,2),ra(2,"span"),Za(3),sa(),la()),2&t){const t=va(2);ws(3),Ja(t._control.placeholder)}}function Bz(t,e){1&t&&xa(0,3,["*ngSwitchCase","true"])}function Vz(t,e){1&t&&(ra(0,"span",23),Za(1," *"),sa())}function zz(t,e){if(1&t){const t=ua();ra(0,"label",20,21),fa("cdkObserveContent",function(){return $e(t),va().updateOutlineGap()}),Jo(2,Fz,4,1,"ng-container",12),Jo(3,Bz,1,0,"ng-content",12),Jo(4,Vz,2,0,"span",22),sa()}if(2&t){const t=va();ja("mat-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-form-field-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-accent","accent"==t.color)("mat-warn","warn"==t.color),na("cdkObserveContentDisabled","outline"!=t.appearance)("id",t._labelId)("ngSwitch",t._hasLabel()),Ko("for",t._control.id)("aria-owns",t._control.id),ws(2),na("ngSwitchCase",!1),ws(1),na("ngSwitchCase",!0),ws(1),na("ngIf",!t.hideRequiredMarker&&t._control.required&&!t._control.disabled)}}function Uz(t,e){1&t&&(ra(0,"div",24),xa(1,4),sa())}function Hz(t,e){if(1&t&&(ra(0,"div",25,26),oa(2,"span",27),sa()),2&t){const t=va();ws(2),ja("mat-accent","accent"==t.color)("mat-warn","warn"==t.color)}}function $z(t,e){1&t&&(ra(0,"div"),xa(1,5),sa()),2&t&&na("@transitionMessages",va()._subscriptAnimationState)}function Gz(t,e){if(1&t&&(ra(0,"div",31),Za(1),sa()),2&t){const t=va(2);na("id",t._hintLabelId),ws(1),Ja(t.hintLabel)}}function Wz(t,e){if(1&t&&(ra(0,"div",28),Jo(1,Gz,2,2,"div",29),xa(2,6),oa(3,"div",30),xa(4,7),sa()),2&t){const t=va();na("@transitionMessages",t._subscriptAnimationState),ws(1),na("ngIf",t.hintLabel)}}const qz=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Xz=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Yz=new oi("MatError"),Kz={transitionMessages:Vg("transitionMessages",[$g("enter",Hg({opacity:1,transform:"translateY(0%)"})),Wg("void => enter",[Hg({opacity:0,transform:"translateY(-5px)"}),zg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let Qz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})();const Zz=new oi("MatHint");let Jz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-label"]]}),t})(),tU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-placeholder"]]}),t})();const eU=new oi("MatPrefix");let nU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","matPrefix",""]],features:[_l([{provide:eU,useExisting:t}])]}),t})();const iU=new oi("MatSuffix");let rU=0;const sU=jy(class{constructor(t){this._elementRef=t}},"primary"),oU=new oi("MAT_FORM_FIELD_DEFAULT_OPTIONS"),aU=new oi("MatFormField");let lU=(()=>{class t extends sU{constructor(t,e,n,i,r,s,o,a){super(t),this._changeDetectorRef=e,this._dir=i,this._defaults=r,this._platform=s,this._ngZone=o,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new P,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+rU++,this._labelId="mat-form-field-label-"+rU++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==a,this.appearance=r&&r.appearance?r.appearance:"legacy",this._hideRequiredMarker=!(!r||null==r.hideRequiredMarker)&&r.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const e=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&e!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=md(t)}_shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}_canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(t){this._explicitFormFieldControl=t}getLabelId(){return this._hasFloatingLabel()?this._labelId:null}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add(`mat-form-field-type-${t.controlType}`),t.stateChanges.pipe(Kd(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(Wd(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Wd(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),Q(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Kd(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Kd(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(Wd(this._destroyed)).subscribe(()=>{"function"==typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this.updateOutlineGap())}):this.updateOutlineGap()})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(t){const e=this._control?this._control.ngControl:null;return e&&e[t]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}_shouldLabelFloat(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,xd(this._label.nativeElement,"transitionend").pipe(Gp(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_getDefaultFloatLabelState(){return this._defaults&&this._defaults.floatLabel||"auto"}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const e=this._hintChildren?this._hintChildren.find(t=>"start"===t.align):null,n=this._hintChildren?this._hintChildren.find(t=>"end"===t.align):null;e?t.push(e.id):this._hintLabel&&t.push(this._hintLabelId),n&&t.push(n.id)}else this._errorChildren&&t.push(...this._errorChildren.map(t=>t.id));this._control.setDescribedByIds(t)}}_validateControlChild(){}updateOutlineGap(){const t=this._label?this._label.nativeElement:null;if(!("outline"===this.appearance&&t&&t.children.length&&t.textContent.trim()&&this._platform.isBrowser))return;if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);let e=0,n=0;const i=this._connectionContainerRef.nativeElement,r=i.querySelectorAll(".mat-form-field-outline-start"),s=i.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const r=i.getBoundingClientRect();if(0===r.width&&0===r.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const s=this._getStartEnd(r),o=t.children,a=this._getStartEnd(o[0].getBoundingClientRect());let l=0;for(let t=0;t0?.75*l+10:0}for(let o=0;o{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny,ig],Ny]}),t})();function uU(t,e=jd){const n=function(t){return t instanceof Date&&!isNaN(+t)}(t)?+t-e.now():Math.abs(t);return t=>t.lift(new hU(n,e))}class hU{constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new dU(t,this.delay,this.scheduler))}}class dU extends v{constructor(t,e,n){super(t),this.delay=e,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(t){const e=t.source,n=e.queue,i=t.scheduler,r=t.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const e=Math.max(0,n[0].time-i.now());this.schedule(t,e)}else this.unsubscribe(),e.active=!1}_schedule(t){this.active=!0,this.destination.add(t.schedule(dU.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new pU(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(sp.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(sp.createComplete()),this.unsubscribe()}}class pU{constructor(t,e){this.time=t,this.notification=e}}const fU=["panel"];function gU(t,e){if(1&t&&(ra(0,"div",0,1),xa(2),sa()),2&t){const t=e.id,n=va();na("id",n.id)("ngClass",n._classList),Ko("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}const mU=["*"];let bU=0;class yU{constructor(t,e){this.source=t,this.option=e}}const vU=Fy(class{}),_U=new oi("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}});let wU=(()=>{class t extends vU{constructor(t,e,n,i){super(),this._changeDetectorRef=t,this._elementRef=e,this._activeOptionChanges=g.EMPTY,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new Rc,this.opened=new Rc,this.closed=new Rc,this.optionActivated=new Rc,this._classList={},this.id="mat-autocomplete-"+bU++,this.inertGroups=(null==i?void 0:i.SAFARI)||!1,this._autoActiveFirstOption=!!n.autoActiveFirstOption}get isOpen(){return this._isOpen&&this.showPanel}get autoActiveFirstOption(){return this._autoActiveFirstOption}set autoActiveFirstOption(t){this._autoActiveFirstOption=md(t)}set classList(t){this._classList=t&&t.length?function(t,e=/\s+/){const n=[];if(null!=t){const i=Array.isArray(t)?t:`${t}`.split(e);for(const t of i){const e=`${t}`.trim();e&&n.push(e)}}return n}(t).reduce((t,e)=>(t[e]=!0,t),{}):{},this._setVisibilityClasses(this._classList),this._elementRef.nativeElement.className=""}ngAfterContentInit(){this._keyManager=new fg(this.options).withWrap(),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._activeOptionChanges.unsubscribe()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._setVisibilityClasses(this._classList),this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){const e=new yU(this,t);this.optionSelected.emit(e)}_getPanelAriaLabelledby(t){return this.ariaLabel?null:this.ariaLabelledby?(t?t+" ":"")+this.ariaLabelledby:t}_setVisibilityClasses(t){t[this._visibleClass]=this.showPanel,t[this._hiddenClass]=!this.showPanel}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(kl),ea(_U),ea(pp))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(qc(sc,7),qc(fU,5)),2&t){let t;Wc(t=Yc())&&(e.template=t.first),Wc(t=Yc())&&(e.panel=t.first)}},inputs:{displayWith:"displayWith",autoActiveFirstOption:"autoActiveFirstOption",classList:["class","classList"],ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],panelWidth:"panelWidth"},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},features:[jo]}),t})(),xU=(()=>{class t extends wU{constructor(){super(...arguments),this._visibleClass="mat-autocomplete-visible",this._hiddenClass="mat-autocomplete-hidden"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,iv,5),Xc(n,av,5)),2&t){let t;Wc(t=Yc())&&(e.optionGroups=t),Wc(t=Yc())&&(e.options=t)}},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[_l([{provide:Jy,useExisting:t}]),jo],ngContentSelectors:mU,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(t,e){1&t&&(wa(),Jo(0,gU,3,4,"ng-template"))},directives:[mh],styles:[".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}\n"],encapsulation:2,changeDetection:0}),t})();const SU=new oi("mat-autocomplete-scroll-strategy"),EU={provide:SU,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}},CU={provide:EV,useExisting:pt(()=>TU),multi:!0};let OU=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u){this._element=t,this._overlay=e,this._viewContainerRef=n,this._zone=i,this._changeDetectorRef=r,this._dir=o,this._formField=a,this._document=l,this._viewportRuler=c,this._defaults=u,this._componentDestroyed=!1,this._autocompleteDisabled=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=g.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new P,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=Iz(()=>this.autocomplete&&this.autocomplete.options?Q(...this.autocomplete.options.map(t=>t.onSelectionChange)):this._zone.onStable.pipe(Gp(1),Qd(()=>this.optionSelections))),this._scrollStrategy=s}get autocompleteDisabled(){return this._autocompleteDisabled}set autocompleteDisabled(t){this._autocompleteDisabled=md(t)}ngAfterViewInit(){const t=this._getWindow();void 0!==t&&this._zone.runOutsideAngular(()=>t.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){const t=this._getWindow();void 0!==t&&t.removeEventListener("blur",this._windowBlurHandler),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._attachOverlay(),this._floatLabel()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this.autocomplete.closed.emit(),this.autocomplete._isOpen=this._overlayAttached=!1,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._componentDestroyed||this._changeDetectorRef.detectChanges())}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Q(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Hd(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Hd(()=>this._overlayAttached)):wd()).pipe(D(t=>t instanceof sv?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Q(xd(this._document,"click"),xd(this._document,"auxclick"),xd(this._document,"touchend")).pipe(Hd(t=>{const e=Ep(t),n=this._formField?this._formField._elementRef.nativeElement:null,i=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&e!==this._element.nativeElement&&(!n||!n.contains(e))&&(!i||!i.contains(e))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(e)}))}writeValue(t){Promise.resolve(null).then(()=>this._setTriggerValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){const e=t.keyCode;if(27===e&&!Qp(t)&&t.preventDefault(),this.activeOption&&13===e&&this.panelOpen)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){const n=this.autocomplete._keyManager.activeItem,i=38===e||40===e;this.panelOpen||9===e?this.autocomplete._keyManager.onKeydown(t):i&&this._canOpen()&&this.openPanel(),(i||this.autocomplete._keyManager.activeItem!==n)&&this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0)}}_handleInput(t){let e=t.target,n=e.value;"number"===e.type&&(n=""==n?null:parseFloat(n)),this._previousValue!==n&&(this._previousValue=n,this._onChange(n),this._canOpen()&&this._document.activeElement===t.target&&this.openPanel())}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_floatLabel(t=!1){this._formField&&"auto"===this._formField.floatLabel&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField.floatLabel="auto",this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){return Q(this._zone.onStable.pipe(Gp(1)),this.autocomplete.options.changes.pipe($f(()=>this._positionStrategy.reapplyLastPosition()),uU(0))).pipe(Qd(()=>{const t=this.panelOpen;return this._resetActiveItem(),this.autocomplete._setVisibility(),this.panelOpen&&(this._overlayRef.updatePosition(),t!==this.panelOpen&&this.autocomplete.opened.emit()),this.panelClosingActions}),Gp(1)).subscribe(t=>this._setValueAndClose(t))}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_setTriggerValue(t){const e=this.autocomplete&&this.autocomplete.displayWith?this.autocomplete.displayWith(t):t,n=null!=e?e:"";this._formField?this._formField._control.value=n:this._element.nativeElement.value=n,this._previousValue=n}_setValueAndClose(t){t&&t.source&&(this._clearPreviousSelectedOption(t.source),this._setTriggerValue(t.source.value),this._onChange(t.source.value),this._element.nativeElement.focus(),this.autocomplete._emitSelectEvent(t.source)),this.closePanel()}_clearPreviousSelectedOption(t){this.autocomplete.options.forEach(e=>{e!==t&&e.selected&&e.deselect()})}_attachOverlay(){var t;let e=this._overlayRef;e?(this._positionStrategy.setOrigin(this._getConnectedElement()),e.updateSize({width:this._getPanelWidth()})):(this._portal=new Lp(this.autocomplete.template,this._viewContainerRef,{id:null===(t=this._formField)||void 0===t?void 0:t.getLabelId()}),e=this._overlay.create(this._getOverlayConfig()),this._overlayRef=e,e.keydownEvents().subscribe(t=>{(27===t.keyCode&&!Qp(t)||38===t.keyCode&&Qp(t,"altKey"))&&(this._closeKeyEventStream.next(),this._resetActiveItem(),t.stopPropagation(),t.preventDefault())}),this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&e&&e.updateSize({width:this._getPanelWidth()})})),e&&!e.hasAttached()&&(e.attach(this._portal),this._closingActionsSubscription=this._subscribeToClosingActions());const n=this.panelOpen;this.autocomplete._setVisibility(),this.autocomplete._isOpen=this._overlayAttached=!0,this.panelOpen&&n!==this.panelOpen&&this.autocomplete.opened.emit()}_getOverlayConfig(){var t;return new af({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir,panelClass:null===(t=this._defaults)||void 0===t?void 0:t.overlayPanelClass})}_getOverlayPosition(){const t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){const e=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],n=this._aboveClass,i=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:n},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:n}];let r;r="above"===this.position?i:"below"===this.position?e:[...e,...i],t.withPositions(r)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){const t=this.autocomplete;t.autoActiveFirstOption?t._keyManager.setFirstItemActive():t._keyManager.setActiveItem(-1)}_canOpen(){const t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this._autocompleteDisabled}_getWindow(){var t;return(null===(t=this._document)||void 0===t?void 0:t.defaultView)||window}_scrollToOption(t){const e=this.autocomplete,n=lv(t,e.options,e.optionGroups);if(0===t&&1===n)e._setScrollTop(0);else if(e.panel){const n=e.options.toArray()[t];if(n){const t=n._getHostElement(),i=cv(t.offsetTop,t.offsetHeight,e._getScrollTop(),e.panel.nativeElement.offsetHeight);e._setScrollTop(i)}}}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(kf),ea(hc),ea(xu),ea(tc),ea(SU),ea(Op,8),ea(aU,9),ea(Yu,8),ea(Ip),ea(_U,8))},t.\u0275dir=se({type:t,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[ye]}),t})(),TU=(()=>{class t extends OU{constructor(){super(...arguments),this._aboveClass="mat-autocomplete-panel-above"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(t,e){1&t&&fa("focusin",function(){return e._handleFocus()})("blur",function(){return e._onTouched()})("input",function(t){return e._handleInput(t)})("keydown",function(t){return e._handleKeydown(t)}),2&t&&Ko("autocomplete",e.autocompleteAttribute)("role",e.autocompleteDisabled?null:"combobox")("aria-autocomplete",e.autocompleteDisabled?null:"list")("aria-activedescendant",e.panelOpen&&e.activeOption?e.activeOption.id:null)("aria-expanded",e.autocompleteDisabled?null:e.panelOpen.toString())("aria-owns",e.autocompleteDisabled||!e.panelOpen||null==e.autocomplete?null:e.autocomplete.id)("aria-haspopup",!e.autocompleteDisabled)},exportAs:["matAutocompleteTrigger"],features:[_l([CU]),jo]}),t})(),kU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[EU],imports:[[Rf,uv,Ny,Rh],Mp,uv,Ny]}),t})();const AU=_p({passive:!0});let PU=(()=>{class t{constructor(t,e){this._platform=t,this._ngZone=e,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return ep;const e=_d(t),n=this._monitoredElements.get(e);if(n)return n.subject;const i=new P,r="cdk-text-field-autofilled",s=t=>{"cdk-text-field-autofill-start"!==t.animationName||e.classList.contains(r)?"cdk-text-field-autofill-end"===t.animationName&&e.classList.contains(r)&&(e.classList.remove(r),this._ngZone.run(()=>i.next({target:t.target,isAutofilled:!1}))):(e.classList.add(r),this._ngZone.run(()=>i.next({target:t.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{e.addEventListener("animationstart",s,AU),e.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(e,{subject:i,unlisten:()=>{e.removeEventListener("animationstart",s,AU)}}),i}stopMonitoring(t){const e=_d(t),n=this._monitoredElements.get(e);n&&(n.unlisten(),n.subject.complete(),e.classList.remove("cdk-text-field-autofill-monitored"),e.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(e))}ngOnDestroy(){this._monitoredElements.forEach((t,e)=>this.stopMonitoring(e))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu))},token:t,providedIn:"root"}),t})(),IU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[fp]]}),t})();const MU=new oi("MAT_INPUT_VALUE_ACCESSOR"),DU=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let RU=0;const NU=Vy(class{constructor(t,e,n,i){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=n,this.ngControl=i}});let LU=(()=>{class t extends NU{constructor(t,e,n,i,r,s,o,a,l,c){super(s,i,r,n),this._elementRef=t,this._platform=e,this._autofillMonitor=a,this._formField=c,this._uid="mat-input-"+RU++,this.focused=!1,this.stateChanges=new P,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._required=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(t=>mp().has(t));const u=this._elementRef.nativeElement,h=u.nodeName.toLowerCase();this._inputValueAccessor=o||u,this._previousNativeValue=this.value,this.id=this.id,e.IOS&&l.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",t=>{const e=t.target;!e.value&&0===e.selectionStart&&0===e.selectionEnd&&(e.setSelectionRange(1,1),e.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===h,this._isTextarea="textarea"===h,this._isInFormField=!!c,this._isNativeSelect&&(this.controlType=u.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=md(t),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(t){this._id=t||this._uid}get required(){return this._required}set required(t){this._required=md(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&mp().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(t){t!==this.value&&(this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=md(t)}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}_focusChanged(t){t!==this.focused&&(this.focused=t,this.stateChanges.next())}_onInput(){}_dirtyCheckPlaceholder(){var t,e;const n=(null===(e=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===e?void 0:e.call(t))?null:this.placeholder;if(n!==this._previousPlaceholder){const t=this._elementRef.nativeElement;this._previousPlaceholder=n,n?t.setAttribute("placeholder",n):t.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){DU.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,e=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&e&&e.label)}return this.focused||!this.empty}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(WV,10),ea(_z,8),ea(Tz,8),ea(zy),ea(MU,10),ea(PU),ea(xu),ea(aU,8))},t.\u0275dir=se({type:t,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._focusChanged(!0)})("blur",function(){return e._focusChanged(!1)})("input",function(){return e._onInput()}),2&t&&(il("disabled",e.disabled)("required",e.required),Ko("id",e.id)("data-placeholder",e.placeholder)("readonly",e.readonly&&!e._isNativeSelect||null)("aria-invalid",e.empty&&e.required?null:e.errorState)("aria-required",e.required),ja("mat-input-server",e._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[_l([{provide:Qz,useExisting:t}]),jo,ye]}),t})(),jU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[zy],imports:[[IU,cU,Ny],IU,cU]}),t})();function FU(...t){const e=t.length;if(0===e)throw new Error("list of properties cannot be empty.");return n=>D(function(t,e){return n=>{let i=n;for(let r=0;rYU),multi:!0};class qU{}const XU=By(jy(Ly(class{constructor(t){this._elementRef=t}}),"accent"));let YU=(()=>{class t extends XU{constructor(t,e,n,i,r,s,o,a){super(t),this._focusMonitor=e,this._changeDetectorRef=n,this._dir=i,this._ngZone=s,this._animationMode=a,this._invert=!1,this._max=100,this._min=0,this._step=1,this._thumbLabel=!1,this._tickInterval=0,this._value=null,this._vertical=!1,this.change=new Rc,this.input=new Rc,this.valueChange=new Rc,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=g.EMPTY,this._pointerDown=t=>{this.disabled||this._isSliding||!KU(t)&&0!==t.button||this._ngZone.run(()=>{this._touchId=KU(t)?function(t,e){for(let n=0;n{if("pointer"===this._isSliding){const e=QU(t,this._touchId);if(e){t.preventDefault();const n=this.value;this._lastPointerEvent=t,this._updateValueFromPosition(e),n!=this.value&&this._emitInputEvent()}}},this._pointerUp=t=>{"pointer"===this._isSliding&&(!KU(t)||"number"!=typeof this._touchId||ZU(t.changedTouches,this._touchId))&&(t.preventDefault(),this._removeGlobalEvents(),this._isSliding=null,this._touchId=void 0,this._valueOnSlideStart!=this.value&&!this.disabled&&this._emitChangeEvent(),this._valueOnSlideStart=this._lastPointerEvent=null)},this._windowBlur=()=>{this._lastPointerEvent&&this._pointerUp(this._lastPointerEvent)},this._document=o,this.tabIndex=parseInt(r)||0,s.runOutsideAngular(()=>{const e=t.nativeElement;e.addEventListener("mousedown",this._pointerDown,GU),e.addEventListener("touchstart",this._pointerDown,GU)})}get invert(){return this._invert}set invert(t){this._invert=md(t)}get max(){return this._max}set max(t){this._max=bd(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=bd(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=bd(t,this._step),this._step%1!=0&&(this._roundToDecimal=this._step.toString().split(".").pop().length),this._changeDetectorRef.markForCheck()}get thumbLabel(){return this._thumbLabel}set thumbLabel(t){this._thumbLabel=md(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?bd(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let e=bd(t,0);this._roundToDecimal&&e!==this.min&&e!==this.max&&(e=parseFloat(e.toFixed(this._roundToDecimal))),this._value=e,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=md(t)}get displayValue(){return this.displayWith?this.displayWith(this.value):this._roundToDecimal&&this.value&&this.value%1!=0?this.value.toFixed(this._roundToDecimal):this.value||0}focus(t){this._focusHostElement(t)}blur(){this._blurHostElement()}get percent(){return this._clamp(this._percent)}_shouldInvertAxis(){return this.vertical?!this.invert:this.invert}_isMinValue(){return 0===this.percent}_getThumbGap(){return this.disabled?7:this._isMinValue()&&!this.thumbLabel?this._isActive?10:7:0}_getTrackBackgroundStyles(){const t=this.vertical?`1, ${1-this.percent}, 1`:1-this.percent+", 1, 1";return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"-":""}${this._getThumbGap()}px) scale3d(${t})`}}_getTrackFillStyles(){const t=this.percent,e=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${e})`,display:0===t?"none":""}}_getTicksContainerStyles(){return{transform:`translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"-":""}${this._tickIntervalPercent/2*100}%)`}}_getTicksStyles(){let t=100*this._tickIntervalPercent,e={backgroundSize:this.vertical?`2px ${t}%`:`${t}% 2px`,transform:`translateZ(0) translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"":"-"}${t/2}%)${this.vertical||"rtl"!=this._getDirection()?"":" rotate(180deg)"}`};if(this._isMinValue()&&this._getThumbGap()){const t=this._shouldInvertAxis();let n;n=this.vertical?t?"Bottom":"Top":t?"Right":"Left",e[`padding${n}`]=`${this._getThumbGap()}px`}return e}_getThumbContainerStyles(){const t=this._shouldInvertAxis();return{transform:`translate${this.vertical?"Y":"X"}(-${100*(("rtl"!=this._getDirection()||this.vertical?t:!t)?this.percent:1-this.percent)}%)`}}_shouldInvertMouseCoords(){const t=this._shouldInvertAxis();return"rtl"!=this._getDirection()||this.vertical?t:!t}_getDirection(){return this._dir&&"rtl"==this._dir.value?"rtl":"ltr"}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{this._isActive=!!t&&"keyboard"!==t,this._changeDetectorRef.detectChanges()}),this._dir&&(this._dirChangeSubscription=this._dir.change.subscribe(()=>{this._changeDetectorRef.markForCheck()}))}ngOnDestroy(){const t=this._elementRef.nativeElement;t.removeEventListener("mousedown",this._pointerDown,GU),t.removeEventListener("touchstart",this._pointerDown,GU),this._lastPointerEvent=null,this._removeGlobalEvents(),this._focusMonitor.stopMonitoring(this._elementRef),this._dirChangeSubscription.unsubscribe()}_onMouseenter(){this.disabled||(this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent())}_onFocus(){this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent()}_onBlur(){this.onTouched()}_onKeydown(t){if(this.disabled||Qp(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const e=this.value;switch(t.keyCode){case 33:this._increment(10);break;case 34:this._increment(-10);break;case 35:this.value=this.max;break;case 36:this.value=this.min;break;case 37:this._increment("rtl"==this._getDirection()?1:-1);break;case 38:this._increment(1);break;case 39:this._increment("rtl"==this._getDirection()?-1:1);break;case 40:this._increment(-1);break;default:return}e!=this.value&&(this._emitInputEvent(),this._emitChangeEvent()),this._isSliding="keyboard",t.preventDefault()}_onKeyup(){"keyboard"===this._isSliding&&(this._isSliding=null)}_getWindow(){return this._document.defaultView||window}_bindGlobalEvents(t){const e=this._document,n=KU(t),i=n?"touchend":"mouseup";e.addEventListener(n?"touchmove":"mousemove",this._pointerMove,GU),e.addEventListener(i,this._pointerUp,GU),n&&e.addEventListener("touchcancel",this._pointerUp,GU);const r=this._getWindow();void 0!==r&&r&&r.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,GU),t.removeEventListener("mouseup",this._pointerUp,GU),t.removeEventListener("touchmove",this._pointerMove,GU),t.removeEventListener("touchend",this._pointerUp,GU),t.removeEventListener("touchcancel",this._pointerUp,GU);const e=this._getWindow();void 0!==e&&e&&e.removeEventListener("blur",this._windowBlur)}_increment(t){this.value=this._clamp((this.value||0)+this.step*t,this.min,this.max)}_updateValueFromPosition(t){if(!this._sliderDimensions)return;let e=this._clamp(((this.vertical?t.y:t.x)-(this.vertical?this._sliderDimensions.top:this._sliderDimensions.left))/(this.vertical?this._sliderDimensions.height:this._sliderDimensions.width));if(this._shouldInvertMouseCoords()&&(e=1-e),0===e)this.value=this.min;else if(1===e)this.value=this.max;else{const t=this._calculateValue(e),n=Math.round((t-this.min)/this.step)*this.step+this.min;this.value=this._clamp(n,this.min,this.max)}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.value),this.valueChange.emit(this.value),this.change.emit(this._createChangeEvent())}_emitInputEvent(){this.input.emit(this._createChangeEvent())}_updateTickIntervalPercent(){if(this.tickInterval&&this._sliderDimensions)if("auto"==this.tickInterval){let t=this.vertical?this._sliderDimensions.height:this._sliderDimensions.width,e=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=e/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let e=new qU;return e.source=this,e.value=t,e}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,e=0,n=1){return Math.max(e,Math.min(t,n))}_getSliderDimensions(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}_focusHostElement(t){this._elementRef.nativeElement.focus(t)}_blurHostElement(){this._elementRef.nativeElement.blur()}writeValue(t){this.value=t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Ig),ea(tc),ea(Op,8),ii("tabindex"),ea(xu),ea(Yu),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-slider"]],viewQuery:function(t,e){if(1&t&&qc($U,5),2&t){let t;Wc(t=Yc())&&(e._sliderWrapper=t.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._onFocus()})("blur",function(){return e._onBlur()})("keydown",function(t){return e._onKeydown(t)})("keyup",function(){return e._onKeyup()})("mouseenter",function(){return e._onMouseenter()})("selectstart",function(t){return t.preventDefault()}),2&t&&(il("tabIndex",e.tabIndex),Ko("aria-disabled",e.disabled)("aria-valuemax",e.max)("aria-valuemin",e.min)("aria-valuenow",e.value)("aria-valuetext",null==e.valueText?e.displayValue:e.valueText)("aria-orientation",e.vertical?"vertical":"horizontal"),ja("mat-slider-disabled",e.disabled)("mat-slider-has-ticks",e.tickInterval)("mat-slider-horizontal",!e.vertical)("mat-slider-axis-inverted",e._shouldInvertAxis())("mat-slider-invert-mouse-coords",e._shouldInvertMouseCoords())("mat-slider-sliding",e._isSliding)("mat-slider-thumb-label-showing",e.thumbLabel)("mat-slider-vertical",e.vertical)("mat-slider-min-value",e._isMinValue())("mat-slider-hide-last-tick",e.disabled||e._isMinValue()&&e._getThumbGap()&&e._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[_l([WU]),jo],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(t,e){1&t&&(ra(0,"div",0,1),ra(2,"div",2),oa(3,"div",3),oa(4,"div",4),sa(),ra(5,"div",5),oa(6,"div",6),sa(),ra(7,"div",7),oa(8,"div",8),oa(9,"div",9),ra(10,"div",10),ra(11,"span",11),Za(12),sa(),sa(),sa(),sa()),2&t&&(ws(3),na("ngStyle",e._getTrackBackgroundStyles()),ws(1),na("ngStyle",e._getTrackFillStyles()),ws(1),na("ngStyle",e._getTicksContainerStyles()),ws(1),na("ngStyle",e._getTicksStyles()),ws(1),na("ngStyle",e._getThumbContainerStyles()),ws(5),Ja(e.displayValue))},directives:[Th],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),t})();function KU(t){return"t"===t.type[0]}function QU(t,e){let n;return n=KU(t)?"number"==typeof e?ZU(t.touches,e)||ZU(t.changedTouches,e):t.touches[0]||t.changedTouches[0]:t,n?{x:n.clientX,y:n.clientY}:void 0}function ZU(t,e){for(let n=0;n{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny],Ny]}),t})();function tH(t,e){}class eH{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.maxWidth="80vw",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.autoFocus=!0,this.restoreFocus=!0,this.closeOnNavigation=!0}}const nH={dialogContainer:Vg("dialogContainer",[$g("void, exit",Hg({opacity:0,transform:"scale(0.7)"})),$g("enter",Hg({transform:"none"})),Wg("* => enter",zg("150ms cubic-bezier(0, 0, 0.2, 1)",Hg({transform:"none",opacity:1}))),Wg("* => void, * => exit",zg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",Hg({opacity:0})))])};let iH=(()=>{class t extends Fp{constructor(t,e,n,i,r,s){super(),this._elementRef=t,this._focusTrapFactory=e,this._changeDetectorRef=n,this._config=r,this._focusMonitor=s,this._animationStateChanged=new Rc,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=t=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(t)),this._ariaLabelledBy=r.ariaLabelledBy||null,this._document=i}_initializeWithAttachedContent(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}attachComponentPortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(t)}_recaptureFocus(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}_trapFocus(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}_restoreFocus(){const t=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&t&&"function"==typeof t.focus){const e=Sp(),n=this._elementRef.nativeElement;(!e||e===this._document.body||e===n||n.contains(e))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_setupFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}_capturePreviouslyFocusedElement(){this._document&&(this._elementFocusedBeforeDialogWasOpened=Sp())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,e=Sp();return t===e||t.contains(e)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(vg),ea(tc),ea(Yu,8),ea(eH),ea(Ig))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&qc(Up,7),2&t){let t;Wc(t=Yc())&&(e._portalOutlet=t.first)}},features:[jo]}),t})(),rH=(()=>{class t extends iH{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:e}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:e}))}_onAnimationStart({toState:t,totalTime:e}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:e}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:e})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,e){1&t&&ga("@dialogContainer.start",function(t){return e._onAnimationStart(t)})("@dialogContainer.done",function(t){return e._onAnimationDone(t)}),2&t&&(il("id",e._id),Ko("role",e._config.role)("aria-labelledby",e._config.ariaLabel?null:e._ariaLabelledBy)("aria-label",e._config.ariaLabel)("aria-describedby",e._config.ariaDescribedBy||null),rl("@dialogContainer",e._state))},features:[jo],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,e){1&t&&Jo(0,tH,0,0,"ng-template",0)},directives:[Up],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[nH.dialogContainer]}}),t})(),sH=0;class oH{constructor(t,e,n="mat-dialog-"+sH++){this._overlayRef=t,this._containerInstance=e,this.id=n,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new P,this._afterClosed=new P,this._beforeClosed=new P,this._state=0,e._id=n,e._animationStateChanged.pipe(Hd(t=>"opened"===t.state),Gp(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),e._animationStateChanged.pipe(Hd(t=>"closed"===t.state),Gp(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),t.keydownEvents().pipe(Hd(t=>27===t.keyCode&&!this.disableClose&&!Qp(t))).subscribe(t=>{t.preventDefault(),aH(this,"keyboard")}),t.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():aH(this,"mouse")})}close(t){this._result=t,this._containerInstance._animationStateChanged.pipe(Hd(t=>"closing"===t.state),Gp(1)).subscribe(e=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),e.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}afterOpened(){return this._afterOpened}afterClosed(){return this._afterClosed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._overlayRef.backdropClick()}keydownEvents(){return this._overlayRef.keydownEvents()}updatePosition(t){let e=this._getPositionStrategy();return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._overlayRef.updatePosition(),this}updateSize(t="",e=""){return this._overlayRef.updateSize({width:t,height:e}),this._overlayRef.updatePosition(),this}addPanelClass(t){return this._overlayRef.addPanelClass(t),this}removePanelClass(t){return this._overlayRef.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function aH(t,e,n){return void 0!==t._containerInstance&&(t._containerInstance._closeInteractionType=e),t.close(n)}const lH=new oi("MatDialogData"),cH=new oi("mat-dialog-default-options"),uH=new oi("mat-dialog-scroll-strategy"),hH={provide:uH,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.block()}};let dH=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l){this._overlay=t,this._injector=e,this._defaultOptions=n,this._parentDialog=i,this._overlayContainer=r,this._dialogRefConstructor=o,this._dialogContainerType=a,this._dialogDataToken=l,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new P,this._afterOpenedAtThisLevel=new P,this._ariaHiddenElements=new Map,this.afterAllClosed=Iz(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Kd(void 0))),this._scrollStrategy=s}get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){const t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}open(t,e){(e=function(t,e){return Object.assign(Object.assign({},e),t)}(e,this._defaultOptions||new eH)).id&&this.getDialogById(e.id);const n=this._createOverlay(e),i=this._attachDialogContainer(n,e),r=this._attachDialogContent(t,i,n,e);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(r),r.afterClosed().subscribe(()=>this._removeOpenDialog(r)),this.afterOpened.next(r),i._initializeWithAttachedContent(),r}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(e=>e.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const e=this._getOverlayConfig(t);return this._overlay.create(e)}_getOverlayConfig(t){const e=new af({positionStrategy:this._overlay.position().global(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,disposeOnNavigation:t.closeOnNavigation});return t.backdropClass&&(e.backdropClass=t.backdropClass),e}_attachDialogContainer(t,e){const n=No.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:eH,useValue:e}]}),i=new Np(this._dialogContainerType,e.viewContainerRef,n,e.componentFactoryResolver);return t.attach(i).instance}_attachDialogContent(t,e,n,i){const r=new this._dialogRefConstructor(n,e,i.id);if(t instanceof sc)e.attachTemplatePortal(new Lp(t,null,{$implicit:i.data,dialogRef:r}));else{const n=this._createInjector(i,r,e),s=e.attachComponentPortal(new Np(t,i.viewContainerRef,n));r.componentInstance=s.instance}return r.updateSize(i.width,i.height).updatePosition(i.position),r}_createInjector(t,e,n){const i=t&&t.viewContainerRef&&t.viewContainerRef.injector,r=[{provide:this._dialogContainerType,useValue:n},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:e}];return t.direction&&(!i||!i.get(Op,null,It.Optional))&&r.push({provide:Op,useValue:{value:t.direction,change:wd()}}),No.create({parent:i||this._injector,providers:r})}_removeOpenDialog(t){const e=this.openDialogs.indexOf(t);e>-1&&(this.openDialogs.splice(e,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const e=t.parentElement.children;for(let n=e.length-1;n>-1;n--){let i=e[n];i!==t&&"SCRIPT"!==i.nodeName&&"STYLE"!==i.nodeName&&!i.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(i,i.getAttribute("aria-hidden")),i.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let e=t.length;for(;e--;)t[e].close()}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(No),ea(void 0),ea(void 0),ea(gf),ea(void 0),ea(ai),ea(ai),ea(oi))},t.\u0275dir=se({type:t}),t})(),pH=(()=>{class t extends dH{constructor(t,e,n,i,r,s,o){super(t,e,i,s,o,r,oH,rH,lH)}}return t.\u0275fac=function(e){return new(e||t)(Ci(kf),Ci(No),Ci(lh,8),Ci(cH,8),Ci(uH),Ci(t,12),Ci(gf))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),fH=0,gH=(()=>{class t{constructor(t,e,n){this._dialogRef=t,this._elementRef=e,this._dialog=n,this.id="mat-dialog-title-"+fH++}ngOnInit(){this._dialogRef||(this._dialogRef=function(t,e){let n=t.nativeElement.parentElement;for(;n&&!n.classList.contains("mat-dialog-container");)n=n.parentElement;return n?e.find(t=>t.id===n.id):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{const t=this._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=this.id)})}}return t.\u0275fac=function(e){return new(e||t)(ea(oH,8),ea(kl),ea(pH))},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,e){2&t&&il("id",e.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),t})(),mH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),t})();let bH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[pH,hH],imports:[[Rf,Hp,Ny],Ny]}),t})();const yH=new oi("CdkAccordion");let vH=0,_H=(()=>{class t{constructor(t,e,n){this.accordion=t,this._changeDetectorRef=e,this._expansionDispatcher=n,this._openCloseAllSubscription=g.EMPTY,this.closed=new Rc,this.opened=new Rc,this.destroyed=new Rc,this.expandedChange=new Rc,this.id="cdk-accordion-child-"+vH++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=n.listen((t,e)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===e&&this.id!==t&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=md(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return t.\u0275fac=function(e){return new(e||t)(ea(yH,12),ea(tc),ea(Ap))},t.\u0275dir=se({type:t,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[_l([{provide:yH,useValue:void 0}])]}),t})(),wH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const xH=["body"];function SH(t,e){}const EH=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],CH=["mat-expansion-panel-header","*","mat-action-row"];function OH(t,e){1&t&&oa(0,"span",2),2&t&&na("@indicatorRotate",va()._getExpandedState())}const TH=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],kH=["mat-panel-title","mat-panel-description","*"],AH=new oi("MAT_ACCORDION"),PH="225ms cubic-bezier(0.4,0.0,0.2,1)",IH={indicatorRotate:Vg("indicatorRotate",[$g("collapsed, void",Hg({transform:"rotate(0deg)"})),$g("expanded",Hg({transform:"rotate(180deg)"})),Wg("expanded <=> collapsed, void => collapsed",zg(PH))]),bodyExpansion:Vg("bodyExpansion",[$g("collapsed, void",Hg({height:"0px",visibility:"hidden"})),$g("expanded",Hg({height:"*",visibility:"visible"})),Wg("expanded <=> collapsed, void => collapsed",zg(PH))])};let MH=(()=>{class t{constructor(t){this._template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["ng-template","matExpansionPanelContent",""]]}),t})(),DH=0;const RH=new oi("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let NH=(()=>{class t extends _H{constructor(t,e,n,i,r,s,o){super(t,e,n),this._viewContainerRef=i,this._animationMode=s,this._hideToggle=!1,this.afterExpand=new Rc,this.afterCollapse=new Rc,this._inputChanges=new P,this._headerId="mat-expansion-panel-header-"+DH++,this._bodyAnimationDone=new P,this.accordion=t,this._document=r,this._bodyAnimationDone.pipe(Rd((t,e)=>t.fromState===e.fromState&&t.toState===e.toState)).subscribe(t=>{"void"!==t.fromState&&("expanded"===t.toState?this.afterExpand.emit():"collapsed"===t.toState&&this.afterCollapse.emit())}),o&&(this.hideToggle=o.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=md(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe(Kd(null),Hd(()=>this.expanded&&!this._portal),Gp(1)).subscribe(()=>{this._portal=new Lp(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,e=this._body.nativeElement;return t===e||e.contains(t)}return!1}}return t.\u0275fac=function(e){return new(e||t)(ea(AH,12),ea(tc),ea(Ap),ea(hc),ea(Yu),ea(Ey,8),ea(RH,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,MH,5),2&t){let t;Wc(t=Yc())&&(e._lazyContent=t.first)}},viewQuery:function(t,e){if(1&t&&qc(xH,5),2&t){let t;Wc(t=Yc())&&(e._body=t.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,e){2&t&&ja("mat-expanded",e.expanded)("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-expansion-panel-spacing",e._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[_l([{provide:AH,useValue:void 0}]),jo,ye],ngContentSelectors:CH,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,e){1&t&&(wa(EH),xa(0),ra(1,"div",0,1),fa("@bodyExpansion.done",function(t){return e._bodyAnimationDone.next(t)}),ra(3,"div",2),xa(4,1),Jo(5,SH,0,0,"ng-template",3),sa(),xa(6,2),sa()),2&t&&(ws(1),na("@bodyExpansion",e._getExpandedState())("id",e.id),Ko("aria-labelledby",e._headerId),ws(4),na("cdkPortalOutlet",e._portal))},directives:[Up],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[IH.bodyExpansion]},changeDetection:0}),t})();class LH{}const jH=By(LH);let FH=(()=>{class t extends jH{constructor(t,e,n,i,r,s,o){super(),this.panel=t,this._element=e,this._focusMonitor=n,this._changeDetectorRef=i,this._animationMode=s,this._parentChangeSubscription=g.EMPTY;const a=t.accordion?t.accordion._stateChanges.pipe(Hd(t=>!(!t.hideToggle&&!t.togglePosition))):ep;this.tabIndex=parseInt(o||"")||0,this._parentChangeSubscription=Q(t.opened,t.closed,a,t._inputChanges.pipe(Hd(t=>!!(t.hideToggle||t.disabled||t.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Hd(()=>t._containsFocus())).subscribe(()=>n.focusVia(e,"program")),r&&(this.expandedHeight=r.expandedHeight,this.collapsedHeight=r.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Qp(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,e){t?this._focusMonitor.focusVia(this._element,t,e):this._element.nativeElement.focus(e)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return t.\u0275fac=function(e){return new(e||t)(ea(NH,1),ea(kl),ea(Ig),ea(tc),ea(RH,8),ea(Ey,8),ii("tabindex"))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,e){1&t&&fa("click",function(){return e._toggle()})("keydown",function(t){return e._keydown(t)}),2&t&&(Ko("id",e.panel._headerId)("tabindex",e.tabIndex)("aria-controls",e._getPanelId())("aria-expanded",e._isExpanded())("aria-disabled",e.panel.disabled),La("height",e._getHeaderHeight()),ja("mat-expanded",e._isExpanded())("mat-expansion-toggle-indicator-after","after"===e._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===e._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[jo],ngContentSelectors:kH,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,e){1&t&&(wa(TH),ra(0,"span",0),xa(1),xa(2,1),xa(3,2),sa(),Jo(4,OH,1,1,"span",1)),2&t&&(ws(4),na("ngIf",e._showToggle()))},directives:[_h],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[IH.indicatorRotate]},changeDetection:0}),t})(),BH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny,wH,Hp]]}),t})();var VH=n(5478);Object.create(Error.prototype);const zH=["*"];var UH=(()=>(function(t){t.LineHighlight="line-highlight",t.LineNumbers="line-numbers"}(UH||(UH={})),UH))();class HH{}const $H=new oi("SECURITY_CONTEXT");let GH=(()=>{class t{constructor(t,e,n,i,r){this.platform=t,this.securityContext=e,this.http=n,this.sanitizer=r,this.initialMarkedOptions={renderer:new VH.Renderer},this.options=i}get options(){return this._options}set options(t){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),t)}get renderer(){return this.options.renderer}set renderer(t){this.options.renderer=t}compile(t,e=!1,n=!1,i=this.options){const r=this.trimIndentation(t),s=e?this.decodeHtml(r):r,o=n?this.renderEmoji(s):s,a=VH.parse(o,i);return this.sanitizer.sanitize(this.securityContext,a)||""}getSource(t){if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(t,{responseType:"text"}).pipe(D(e=>this.handleExtension(t,e)))}highlight(t){if(Lh(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const e=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(e,t=>t.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,e){if(!Lh(this.platform))return t;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return t.replace(/\$([^\s][^$]*?[^\s])\$/gm,(t,n)=>katex.renderToString(n,e))}decodeHtml(t){if(!Lh(this.platform))return t;const e=document.createElement("textarea");return e.innerHTML=t,e.value}handleExtension(t,e){const n=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==n?"```"+n+"\n"+e+"\n```":e}renderEmoji(t){if(!Lh(this.platform))return t;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(t)}trimIndentation(t){if(!t)return"";let e;return t.split("\n").map(t=>{let n=e;return t.length>0&&(n=isNaN(n)?t.search(/\S|$/):Math.min(t.search(/\S|$/),n)),isNaN(e)&&(e=n),n?t.substring(n):t}).join("\n")}}return t.\u0275fac=function(e){return new(e||t)(Ci(ou),Ci($H),Ci(Bv,8),Ci(HH,8),Ci(hd))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),WH=(()=>{class t{constructor(t,e){this.element=t,this.markdownService=e,this.error=new Rc,this.load=new Rc,this.ready=new Rc,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}get emoji(){return this._emoji}set emoji(t){this._emoji=this.coerceBooleanProperty(t)}get katex(){return this._katex}set katex(t){this._katex=this.coerceBooleanProperty(t)}get lineHighlight(){return this._lineHighlight}set lineHighlight(t){this._lineHighlight=this.coerceBooleanProperty(t)}get lineNumbers(){return this._lineNumbers}set lineNumbers(t){this._lineNumbers=this.coerceBooleanProperty(t)}ngOnChanges(){null==this.data?null==this.src||this.handleSrc():this.handleData()}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion()}render(t,e=!1){let n=this.markdownService.compile(t,e,this.emoji);n=this.katex?this.markdownService.renderKatex(n,this.katexOptions):n,this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}coerceBooleanProperty(t){return null!=t&&"false"!=`${String(t)}`}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe(t=>{this.render(t),this.load.emit(t)},t=>this.error.emit(t))}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,UH.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,e){const n=t.querySelectorAll("pre");for(let i=0;i{const r=e[t];if(r){const e=this.toLispCase(t);n.item(i).setAttribute(e,r.toString())}})}toLispCase(t){const e=t.match(/([A-Z])/g);if(!e)return t;let n=t.toString();for(let i=0,r=e.length;i{class t{static forRoot(e){return{ngModule:t,providers:[GH,e&&e.loader||[],e&&e.markedOptions||[],{provide:$H,useValue:e&&null!=e.sanitize?e.sanitize:yr.HTML}]}}static forChild(){return{ngModule:t}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function XH(t,e,n){return n?XH(t,e).pipe(D(t=>d(t)?n(...t):n(t))):new C(n=>{const i=(...t)=>n.next(1===t.length?t[0]:t);let r;try{r=t(i)}catch(s){return void n.error(s)}if(a(e))return()=>e(i,r)})}function YH(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new KH(t,n))}}class KH{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new QH(t,this.observables,this.project))}}class QH extends S_{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const i=e.length;this.values=new Array(i);for(let r=0;r0){const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}class ZH{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new JH(t,this.accumulator,this.seed,this.hasSeed))}}class JH extends v{constructor(t,e,n,i){super(t),this.accumulator=e,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}class t${constructor(t){this.predicate=t}call(t,e){return e.subscribe(new e$(t,this.predicate))}}class e$ extends v{constructor(t,e){super(t),this.predicate=e,this.skipping=!0,this.index=0}_next(t){const e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)}tryCallPredicate(t){try{const e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(e){this.destination.error(e)}}}const n$=["youtubeContainer"];let i$=(()=>{class t{constructor(t,e){this._ngZone=t,this._youtubeContainer=new P,this._destroyed=new P,this._playerChanges=new Uf(void 0),this._videoId=new Uf(void 0),this._height=new Uf(390),this._width=new Uf(640),this._startSeconds=new Uf(void 0),this._endSeconds=new Uf(void 0),this._suggestedQuality=new Uf(void 0),this._playerVars=new Uf(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=Lh(e)}get videoId(){return this._videoId.value}set videoId(t){this._videoId.next(t)}get height(){return this._height.value}set height(t){this._height.next(t||390)}get width(){return this._width.value}set width(t){this._width.next(t||640)}set startSeconds(t){this._startSeconds.next(t)}set endSeconds(t){this._endSeconds.next(t)}set suggestedQuality(t){this._suggestedQuality.next(t)}get playerVars(){return this._playerVars.value}set playerVars(t){this._playerVars.next(t)}ngOnInit(){if(!this._isBrowser)return;let t=wd(!0);if(!window.YT||!window.YT.Player){const e=new P;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>e.next(!0))},t=e.pipe(Gp(1),Kd(!1))}const e=function(t,e,n,i,r,s,o){const a=T_([e,s]).pipe(YH(T_([i,r])),D(([t,e])=>{const[n,i]=t,[r,s]=e;return n?{videoId:n,playerVars:i,width:r,height:s}:void 0}));return T_([t,a,wd(o)]).pipe(function(t){return S(function(...t){let e=null;return"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&d(t[0])&&(t=t[0].slice()),n=>n.lift.call(U([n,...t]),new k_(e))}(t),function(t){return e=>e.lift(new t$(t))}(([t,e])=>!e),D(([t])=>t))}(n),function(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new ZH(t,e,n))}}(r$,void 0),Rd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe($f(t=>{this._playerChanges.next(t)}),W(t=>t?s$(t)?wd(t):new C(e=>{let n=!1,i=!1;const r=t=>{i=!0,n||(t.target.removeEventListener("onReady",r),e.next(t.target))};return t.addEventListener("onReady",r),()=>{n=!0,i||(t=>{s$(t)||t.destroy()})(t)}}).pipe(Gp(1),Kd(void 0)):wd(void 0)),Wd(this._destroyed),rt(new P));e.subscribe(t=>{this._player=t,t&&this._pendingPlayerState&&this._initializePlayer(t,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(t,e,n){T_([t,e,n]).subscribe(([t,e,n])=>t&&t.setSize(e,n))}(e,this._width,this._height),function(t,e){T_([t,e]).subscribe(([t,e])=>t&&e&&t.setPlaybackQuality(e))}(e,this._suggestedQuality),function(t,e,n,i,r,s){const o=T_([n,i]).pipe(D(([t,e])=>({startSeconds:t,endSeconds:e}))),a=o.pipe(o$(t,t=>!!t&&!function(t){const e=t.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(t))),l=e.pipe(o$(t,(t,e)=>!!t&&t.videoId!==e));Q(t.pipe(o$(T_([e,o]),([t,e],n)=>!(!n||t==n.videoId&&!e.startSeconds&&!e.endSeconds))),l,a).pipe(YH(T_([t,e,o,r])),D(([t,e])=>e),Wd(s)).subscribe(([t,e,n,i])=>{!e||!t||(t.videoId=e,t.cueVideoById(Object.assign({videoId:e,suggestedQuality:i},n)))})}(e,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),e.connect()}createEventsBoundInZone(){return{}}ngAfterViewInit(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}ngOnDestroy(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,e){this._player?this._player.seekTo(t,e):this._getPendingState().seek={seconds:t,allowSeekAhead:e}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_initializePlayer(t,e){const{playbackState:n,playbackRate:i,volume:r,muted:s,seek:o}=e;switch(n){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=i&&t.setPlaybackRate(i),null!=r&&t.setVolume(r),null!=s&&(s?t.mute():t.unMute()),null!=o&&t.seekTo(o.seconds,o.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Qd(e=>e?XH(n=>{e.addEventListener(t,n)},n=>{try{e.removeEventListener&&e.removeEventListener(t,n)}catch(i){}}):wd()),t=>new C(e=>t.subscribe({next:t=>this._ngZone.run(()=>e.next(t)),error:t=>e.error(t),complete:()=>e.complete()})),Wd(this._destroyed))}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(ou))},t.\u0275cmp=Jt({type:t,selectors:[["youtube-player"]],viewQuery:function(t,e){if(1&t&&qc(n$,5),2&t){let t;Wc(t=Yc())&&(e.youtubeContainer=t.first)}},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(t,e){1&t&&oa(0,"div",null,0)},encapsulation:2,changeDetection:0}),t})();function r$(t,[e,n,i]){if(t&&n&&t.playerVars!==n.playerVars)t.destroy();else{if(!n)return void(t&&t.destroy());if(t)return t}const r=i.runOutsideAngular(()=>new YT.Player(e,n));return r.videoId=n.videoId,r.playerVars=n.playerVars,r}function s$(t){return"getPlayerStatus"in t}function o$(t,e){return S(YH(t),Hd(([t,n])=>e(n,t)),D(([t])=>t))}let a$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function l$(t){return!0===t}function c$(t){return null==t}function u$(t){return!c$(t)}function h$(t){return Boolean(t)}function d$(t){return c$(t)?t:JSON.parse(JSON.stringify(t))}const p$=t=>{const e=t instanceof Date;if("object"!=typeof t||null===t||e)return t;Object.freeze(t);const n="function"==typeof t,i=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(e=>{i.call(t,e)&&(!n||"caller"!==e&&"callee"!==e&&"arguments"!==e)&&null!==t[e]&&("object"==typeof t[e]||"function"==typeof t[e])&&!Object.isFrozen(t[e])&&p$(t[e])}),t};function f$(t){return u$(t)&&"object"==typeof t&&function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)}const g$="NGXS_DATA_META",m$="NGXS_META",b$="NGXS_ARGUMENT_REGISTRY_META";let y$=(()=>{class t{constructor(t){this.sequence$=new Uf(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function v$(t){return t[g$]}let _$=(()=>{class t{constructor(e,n,i){t.store=e.get(pV),t.ngZone=e.get(xu),t.factory=n,t.context=i,t.computed=e.get(y$)}}return t.store=null,t.computed=null,t.context=null,t.factory=null,t.ngZone=null,t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(wB),Ci(_B))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class w${constructor(){w$.statesCachedMeta.clear()}static createStateContext(t){return _$.context.createStateContext(t)}static ensureMappedState(t){if(c$(_$.factory)||c$(t))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(u$(t.name)?w$.statesCachedMeta.get(t.name):null)||w$.ensureMeta(t)}static getRepositoryByInstance(t){var e;const n=null!==(e=v$(w$.getStateClassByInstance(t)))&&void 0!==e?e:null;if(c$(n))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return n}static getStateClassByInstance(t){return(null!=t?t:{}).constructor}static clearMetaByInstance(t){const e=w$.getRepositoryByInstance(t);e.stateMeta.actions={},e.operations={}}static createPayload(t,e){const n={},i=Array.from(t);for(let r=0;r0?n:null}static createAction(t,e,n){const i=w$.createPayload(e,n);return new(function(t){return class{constructor(t){t&&Object.keys(t).forEach(e=>{this[e]=t[e]})}static get type(){return t}}}(t.type))(i)}static ensureMeta(t){var e;const n=u$(t.name)?null===(e=_$.factory.states)||void 0===e?void 0:e.find(e=>e.name===t.name):null;return u$(n)&&u$(t.name)&&w$.statesCachedMeta.set(t.name,n),n}}w$.statesCachedMeta=new Map,w$.\u0275fac=function(t){return new(t||w$)},w$.\u0275prov=xt({token:w$,factory:w$.\u0275fac}),new lp(1);class x$ extends Error{constructor(t){super(`Child states can only be added to an object. Cannot convert ${u$(null==t?void 0:t.constructor)?t.constructor.name:t} to PlainObject`)}}function S$(t){var e;return null!==(e=t.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function E$(t){var e;const n=S$(t),i=null!==(e=n.children)&&void 0!==e?e:[],r=d$(void 0===n.defaults?{}:n.defaults);if(i.length){if(f$(r))return function(t,e){return e.reduce((t,e)=>{const n=S$(e);if(function(t){const e="string"==typeof t?t.trim():t;return[void 0,null,NaN,"",1/0].includes(e)}(n.name))throw new Error("State name not provided in class");return t[n.name.toString()]=E$(e),t},null!=t?t:{})}(r,i);throw new x$(r)}return r}function C$(t){var e;return null!==(e=t.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function O$(){var t,e;return null!==(e=null===(t=null==_$?void 0:_$.computed)||void 0===t?void 0:t.sequenceValue)&&void 0!==e?e:0}function T$(t){let e=!1;return Dd(t)&&(e=!0),e}function k$(t){return t[b$]}class A$ extends Error{constructor(t,e){super(`An argument with the name '${t}' already exists in the method '${e}'`)}}class P${constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(t){var e;return null!==(e=this.payloadMap.get(t))&&void 0!==e?e:null}getArgumentNameByIndex(t){var e;return null!==(e=this.argumentMap.get(t))&&void 0!==e?e:null}createPayloadType(t,e,n){this.checkDuplicateName(t,e),this.payloadMap.set(n,t),this.payloadMap.set(t,t)}createArgumentName(t,e,n){this.checkDuplicateName(t,e),this.argumentMap.set(n,t),this.argumentMap.set(t,t)}checkDuplicateName(t,e){if(h$(this.argumentMap.has(t))||h$(this.payloadMap.has(t)))throw new A$(t,e)}}function I$(t){return Nu()?p$(t):t}function M$(t){return{enumerable:!0,configurable:!0,get(){const e=v$(t),n=w$.ensureMappedState(e.stateMeta);return w$.createStateContext(n)}}}function D$(t){if(!t)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},t),{getState:()=>Nu()?p$(t.getState()):t.getState(),setState(e){t.setState(e)},patchState(e){t.patchState(e)}})}function R$(){return(t,e,n)=>{!function(t,e){if(!function(t,e){var n;let i=t,r=!1;if(f$(i))for(;null!==i;){if(l$(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(n=Object.getOwnPropertyDescriptor(i,e))||void 0===n?void 0:n.get);break}i=Object.getPrototypeOf(i)}return r}(t,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(t,e);const i=n.get;return n.get=function(...t){const e=function(t){return c$(C$(t))&&Object.defineProperties(t,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),C$(t)}(this),n=null==e?void 0:e.get(i);if(l$(null==n?void 0:n.isObservable))return null==n?void 0:n.value;if(c$(n)||n.sequenceId!==O$()){e.delete(i);const n=i.apply(this,t);return e.set(i,{value:n,sequenceId:O$(),isObservable:T$(n)}),n}return n.value},n}}const N$={cancelUncompleted:!0,insideZone:!1};function L$(t=N$){return(e,n,i)=>{!function(t,e){if(t.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=n.toString();return i.value=function(...e){const n=this;let i=null;const o=w$.getRepositoryByInstance(n),a=o.operations;let l=a[s];const c=o.stateMeta,u=k$(r);if(c$(l)){const e=function(t){var e,n,i;return null!==(i=null===(n=null===(e=(t+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===n?void 0:n.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),n=function(t){const{statePath:e,argumentsNames:n,methodName:i,argumentRegistry:r}=t;let s="";for(let o=0;o{var s;return l$(t.insideZone)?null===(s=_$.ngZone)||void 0===s||s.run(()=>{i=r.apply(n,e)}):i=r.apply(n,e),Dd(i)?wd(null).pipe(D(()=>i)):i};const h=w$.createAction(l,e,u),d=_$.store.dispatch(h);return Dd(i)?function(t,e){return hv([t,e]).pipe(D(t=>t.pop()))}(d,i):i},i}}function j$(t){return(e,n,i)=>{const r=t.trim();if(!r)throw new Error("Payload name should be initialized");(function(t,e){const n=t[e];return c$(k$(n))&&Object.defineProperties(n,{[b$]:{enumerable:!0,configurable:!0,value:new P$}}),k$(n)})(e,n).createPayloadType(r,n,i)}}function F$(){return t=>{const e=function(t){if(function(t){return!h$(t)}(t.hasOwnProperty(m$))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,m$,{value:e})}return function(t){var e;return null===(e=t)||void 0===e?void 0:e[m$]}(t)}(t);if(c$(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(t,e){(function(t){var e;const n=null!==(e=v$(t))&&void 0!==e?e:null;return(c$(n)||(null==n?void 0:n.stateClass)!==t)&&function(t){Object.defineProperty(t,g$,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:t}})}(t),v$(t)}(t)).stateMeta=e}(t,e),function(t,e,n){Object.defineProperties(t.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>d$(n)},context:M$(t)})}(t,e,E$(t)),function(t){var e,n;const i=v$(t),r=null!==(n=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==n?n:null;if(u$(r)){const e=`__${r}__selector`;Object.defineProperties(t.prototype,{[e]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(u$(this[e]))return this[e];if(c$(_$.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[e]=_$.store.select(t).pipe(D(t=>Nu()?p$(t):t),up({refCount:!0,bufferSize:1})),this[e]}}})}}(t)}}let B$=(()=>{class t{constructor(){this.browserStorageEvents$=new P,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var e;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(e=this.ngxsDataDoCheck)||void 0===e||e.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var t;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(t=this.ngxsDataDoCheck)||void 0===t||t.call(this))}markAsDirtyAfterReset(){var t;this.dirty=!0,null===(t=this.ngxsDataAfterReset)||void 0===t||t.call(this)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),V$=(()=>{class t extends B${get snapshot(){return I$(this.getState())}get ctx(){return D$(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$(),aw("design:type",Object),aw("design:paramtypes",[])],t.prototype,"snapshot",null),sw([L$(),ow(0,j$("patchValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"patchState",null),sw([L$(),ow(0,j$("stateValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"setState",null),sw([L$(),aw("design:type",Function),aw("design:paramtypes",[]),aw("design:returntype",void 0)],t.prototype,"reset",null),t})(),z$=(()=>{class t extends B${get snapshot(){return I$(this.getState())}get ctx(){return D$(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$(),aw("design:type",Object),aw("design:paramtypes",[])],t.prototype,"snapshot",null),sw([L$(),ow(0,j$("patchValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"patchState",null),sw([L$(),ow(0,j$("stateValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"setState",null),sw([L$(),aw("design:type",Function),aw("design:paramtypes",[]),aw("design:returntype",void 0)],t.prototype,"reset",null),t})();const U$=new oi("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),H$=new oi("ngx-window",{providedIn:"root",factory:()=>function(t){return Lh(t)?window:null}(Oi(ou))}),$$=new oi("ngx-data-layer",{providedIn:"root",factory:()=>function(t){return t?t.dataLayer=t.dataLayer||[]:null}(Oi(H$))}),G$=new oi("ngx-gtag-fn",{providedIn:"root",factory:()=>function(t,e){return t?t.gtag=t.gtag||function(){e.push(arguments)}:null}(Oi(H$),Oi($$))});let W$=(()=>{class t{constructor(t,e,n){this.settings=t,this._document=e,this._gtag=n}get document(){return this._document}throw(t){(this.settings.enableTracing||Nu())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((t,[e,n])=>Object.defineProperty(t,e,{value:n,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(t=>void 0!==t))}catch(e){this.throw(e)}}event(t,e,n,i,r){try{const s=new Map;e&&s.set("event_category",e),n&&s.set("event_label",n),i&&s.set("value",i),void 0!==r&&s.set("interaction",r);const o=this.toKeyValue(s);o?this.gtag("event",t,o):this.gtag("event",t)}catch(s){this.throw(s)}}pageView(t,e,n,i){try{const r=new Map([["page_path",t]]);e&&r.set("page_title",e),(n||this.document)&&r.set("page_location",n||this.document.location.href),i&&Object.entries(i).map(([t,e])=>r.set(t,e)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(r))}catch(r){this.throw(r)}}appView(t,e,n,i,r){try{const s=new Map([["screen_name",t],["app_name",e]]);n&&s.set("app_id",n),i&&s.set("app_version",i),r&&s.set("app_installer_id",r),this.gtag("event","screen_view",this.toKeyValue(s))}catch(s){this.throw(s)}}set(...t){try{this._gtag("set",...t)}catch(e){this.throw(e)}}exception(t,e){try{const n=new Map;t&&n.set("description",t),e&&n.set("fatal",e),this.toKeyValue(n)?this.gtag("event","exception",this.toKeyValue(n)):this.gtag("event","exception")}catch(n){this.throw(n)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(U$),Ci(Yu),Ci(G$))},t.\u0275prov=xt({factory:function(){return new t(Ci(U$),Ci(Yu),Ci(G$))},token:t,providedIn:"root"}),t})();const q$={provide:tu,multi:!0,useFactory:function(t,e,n){return()=>lw(this,void 0,void 0,function*(){var i;if(!t.trackingCode)return void(Nu()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Nu()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));n||Nu()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),t.uri=t.uri||`https://www.googletagmanager.com/gtag/js?id=${t.trackingCode}`,t.initCommands=null!==(i=null==t?void 0:t.initCommands)&&void 0!==i?i:[],t.initCommands.find(t=>"config"===t.command)||t.initCommands.unshift({command:"config",values:[t.trackingCode]}),t.initCommands.find(t=>"js"===t.command)||t.initCommands.unshift({command:"js",values:[new Date]});for(const n of t.initCommands)e(n.command,...n.values);const r=n.createElement("script");r.async=!0,r.src=t.uri,t.nonce&&r.setAttribute("nonce",t.nonce),n.getElementsByTagName("head")[0].appendChild(r)})},deps:[U$,G$,Yu]};new oi("ngx-google-analytics-routing-settings",{factory:()=>({})});let X$=(()=>{class t{static forRoot(e,n=[],i,r,s){return{ngModule:t,providers:[{provide:U$,useValue:{trackingCode:e,initCommands:n,uri:i,enableTracing:r,nonce:s}},q$]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[]]}),t})(),Y$=(()=>{class t{constructor(){this.consent="not-set",this.consentChange=new lp(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),K$=(()=>{class t{constructor(t,e,{trackingCode:n}){this.window=e,this.subscriptions=new g,this.token=n,this.subscriptions.add(t.consentChange.subscribe(t=>this.toggleGoogleAnalytics("rescinded"===t)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Y$),Ci(H$),Ci(U$))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Q$=new oi("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),Z$=[Y$,K$,(()=>{class t{constructor(t,e){this.key=e,this.subscriptions=new g;try{this.storage=localStorage}catch(n){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(t=>this.saveConsent(t)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,e;const n=null===(e=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===e?void 0:e.call(t,this.key);if(null==n)return"not-set";const i=n.trim().toLowerCase();switch(i){case"given":case"rescinded":return i;default:return"not-set"}}saveConsent(t){var e,n;null===(n=null===(e=this.storage)||void 0===e?void 0:e.setItem)||void 0===n||n.call(e,this.key,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Y$),Ci(Q$))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})()];function J$(t){return Object.entries(t).reduce((t,[e,n])=>(null!=n&&(t[e]=`${n}`),t),{})}let tG=(()=>{class t{static forRoot(e){const{providers:n=[]}=X$.forRoot(e.gaToken,function(t){const{appName:e,projectName:n,developmentMode:i}=t;return[{command:"set",values:[J$({appName:e,projectName:n,developmentMode:i})]}]}(e));return{ngModule:t,providers:n}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[...Z$,{provide:tu,multi:!0,useFactory:()=>()=>{},deps:Z$}],imports:[[X$]]}),t})();const eG=["bodyCanvas"];let nG=(()=>{class t{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Rc,this.nodeDrag=new Rc,this.nodeClick=new Rc,this.nodeHoverStart=new Rc,this.nodeHoverStop=new Rc,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var e;this._scene=t,null===(e=this.bodyUI)||void 0===e||e.setScene(t)}get rotation(){return this._rotation}set rotation(t){var e;this._rotation=t,null===(e=this.bodyUI)||void 0===e||e.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var e;this._rotationX=t,null===(e=this.bodyUI)||void 0===e||e.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var e;this._zoom=t,null===(e=this.bodyUI)||void 0===e||e.setZoom(t)}get target(){return this._target}set target(t){var e;this._target=t,null===(e=this.bodyUI)||void 0===e||e.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,e={x:48,y:48}){if(this.bodyCanvas){const{width:n,height:i}=this.bodyCanvas.nativeElement,r=window.devicePixelRatio,s=Math.min(Math.log2((n-e.x)/r/t.x),Math.log2((i-e.y)/r/t.y));this.zoom=s}}setupBodyUI(){var t;return lw(this,void 0,void 0,function*(){const e=this.bodyCanvas.nativeElement,n=new dB({id:"body-ui",canvas:e,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});e.addEventListener("contextmenu",t=>t.preventDefault()),yield n.initialize(),this.bodyUI=n,window.bodyUI=n,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(t=>this.rotationChange.next(t)),this.bodyUI.nodeDrag$.subscribe(t=>this.nodeDrag.emit(t)),this.bodyUI.nodeClick$.subscribe(t=>this.nodeClick.emit(t)),this.bodyUI.nodeHoverStart$.subscribe(t=>this.nodeHoverStart.emit(t)),this.bodyUI.nodeHoverStop$.subscribe(t=>this.nodeHoverStop.emit(t))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-body-ui"]],viewQuery:function(t,e){if(1&t&&qc(eG,5,kl),2&t){let t;Wc(t=Yc())&&(e.bodyCanvas=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,e){1&t&&oa(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),t})(),iG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})();new oi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const rG=["carouselContainer"],sG=["itemlist"],oG=["itemcontainer"];function aG(t,e){if(1&t&&(ra(0,"div",14),Za(1),sa()),2&t){const t=va().$implicit,e=va();ws(1),Ja(e.occurenceData[t.id]||0)}}function lG(t,e){if(1&t){const t=ua();ra(0,"div",9),fa("click",function(){const e=$e(t).$implicit;return va().selectOrgan(e)}),oa(1,"mat-icon",10),ra(2,"div",11),ra(3,"div",12),Za(4),sa(),Jo(5,aG,2,1,"div",13),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ja("disabled",t.disabled)("selected",n.isSelected(t)),ws(1),Sa("svgIcon",t.src),ws(3),Ja(t.name),ws(1),na("ngIf",void 0!==t.numResults)}}const cG=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}],uG=cG.filter(t=>!0!==t.disabled);let hG=(()=>{class t{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=uG,this.selectedOrgans=[],this.organsChanged=new Rc,this.onLeft=!0,this.onRight=!1,this.step=72}set occurenceData(t){this._occurenceData=t}get occurenceData(){return this._occurenceData}ngAfterViewInit(){const{carouselContainer:t}=this;this.sensor=new HU.ResizeSensor(t.nativeElement,()=>{this.set()})}ngOnChanges(t){"organList"in t&&this.set()}ngOnDestroy(){this.sensor.detach()}get error(){return!(!this.displayErrors||0===this.selectedOrgans.length)}shift(t){const{itemList:e}=this;let n=parseInt(e.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(n="right"===t?n-this.step:n+this.step,e.nativeElement.style.left=n+"px",this.setLeftRight(n))}scroll(t){this.timeoutHandler=setInterval(()=>{this.shift(t)},200)}stopScroll(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}selectOrgan(t){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(t)?this.selectedOrgans.filter(e=>t!==e):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:e,carouselContainer:n}=this,i=parseInt(t.nativeElement.style.left,10)||0;if(t.nativeElement.offsetWidth>=this.organList.length*this.step)t.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(i);const t=this.step*Math.floor(n.nativeElement.offsetWidth/this.step)-64;e.nativeElement.style.width=`${t}px`}}setWidth(){const{itemContainer:t,carouselContainer:e}=this,n=this.step*Math.floor(e.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${n}px`}setLeftRight(t){const{itemContainer:e}=this;this.onLeft=0===t,this.onRight=t<=e.nativeElement.offsetWidth-this.organList.length*this.step}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-organ-selector"]],viewQuery:function(t,e){if(1&t&&(qc(rG,7),qc(sG,7),qc(oG,7)),2&t){let t;Wc(t=Yc())&&(e.carouselContainer=t.first),Wc(t=Yc())&&(e.itemList=t.first),Wc(t=Yc())&&(e.itemContainer=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[ye],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(t,e){1&t&&(ra(0,"div",0,1),ra(2,"mat-icon",2),fa("touchstart",function(){return e.scroll("left")})("touchend",function(){return e.stopScroll()})("click",function(){return e.shift("left")})("mousedown",function(){return e.scroll("left")})("mouseup",function(){return e.stopScroll()}),Za(3,"chevron_left"),sa(),ra(4,"div",3,4),ra(6,"div",5,6),Jo(8,lG,6,7,"div",7),sa(),sa(),ra(9,"mat-icon",8),fa("touchstart",function(){return e.scroll("right")})("touchend",function(){return e.stopScroll()})("click",function(){return e.shift("right")})("mousedown",function(){return e.scroll("right")})("mouseup",function(){return e.stopScroll()}),Za(10,"chevron_right"),sa(),sa()),2&t&&(ja("error",e.error),na("matTooltipDisabled",e.multiselect),ws(2),ja("disabled",e.onLeft),ws(6),na("ngForOf",e.organList),ws(1),ja("disabled",e.onRight))},directives:[ew,p_,yh,_h],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),t})(),dG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,rw]]}),t})(),pG=(()=>{class t{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Rc,this.visibilityToggle=new Rc,this.opacityReset=new Rc}ngOnInit(){this.prevOpacity=this.visible?0:20}reset(){this.prevOpacity=20}changeOpacity(t){this.opacity=parseInt(t,10),this.opacityChange.emit(this.opacity)}toggleVisibility(){const t=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=t,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}resetOpacity(){this.prevOpacity=0,this.opacityReset.emit()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"mat-slider",2),fa("input",function(t){return e.changeOpacity(t.value)}),sa(),ra(3,"span",3),Za(4),sa(),sa(),ra(5,"div",4),ra(6,"mat-icon",5),fa("click",function(){return e.toggleVisibility()}),sa(),ra(7,"mat-icon",6),fa("click",function(){return e.toggleVisibility()}),sa(),ra(8,"mat-icon",7),fa("click",function(){return e.resetOpacity()}),Za(9,"refresh"),sa(),sa(),sa()),2&t&&(ws(2),ja("disabled",!e.visible),na("step",1)("min",0)("max",100)("value",e.opacity),ws(2),tl("",e.opacity,"%"),ws(2),ja("hidden",e.visible),na("matRippleCentered",!0)("matRippleUnbounded",!0),ws(1),ja("hidden",!e.visible),na("matRippleCentered",!0)("matRippleUnbounded",!0),ws(1),na("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[YU,p_,Yy],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})(),fG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,JU,Ky]]}),t})();function gG(t,e){if(1&t&&(ra(0,"div",15),oa(1,"youtube-player",16),sa()),2&t){const t=va(3);ws(1),Sa("videoId",t.videoID)}}function mG(t,e){if(1&t&&(ra(0,"mat-expansion-panel",10),ra(1,"mat-expansion-panel-header"),ra(2,"h2",11),Za(3),sa(),sa(),ra(4,"div",12),oa(5,"markdown",13),Jo(6,gG,2,1,"div",14),sa(),sa()),2&t){const t=va(),e=t.index,n=t.$implicit;na("expanded",0===e),ws(3),Ja(n.title),ws(2),ja("first",0===e),na("data",n.content),ws(1),na("ngIf",0===e)}}function bG(t,e){if(1&t&&(ra(0,"div",8),Jo(1,mG,7,6,"mat-expansion-panel",9),sa()),2&t){const t=e.$implicit;ws(1),na("ngIf",t)}}let yG=(()=>{class t{constructor(t,e){this.dialogRef=t,this.data=e,this.documentationContents=e.content||[],this.infoTitle=e.title||"",this.videoID=e.videoID}ngOnInit(){const t=document.createElement("script");t.src="https://www.youtube.com/iframe_api",document.body.appendChild(t)}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return t.\u0275fac=function(e){return new(e||t)(ea(oH),ea(lH))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),ra(3,"mat-icon",3),fa("click",function(){return e.close()}),Za(4,"clear"),sa(),sa(),ra(5,"div",4),ra(6,"h2",5),Za(7),sa(),ra(8,"mat-dialog-content",6),Jo(9,bG,2,1,"div",7),sa(),sa(),sa(),sa()),2&t&&(ws(7),Ja(e.infoTitle),ws(2),na("ngForOf",e.documentationContents))},directives:[p_,gH,mH,yh,_h,NH,FH,WH,i$],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),t})(),vG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,bH,f_,BH,a$,qH.forRoot({})]]}),t})(),_G=(()=>{class t{constructor(t){this.http=t,this.markdownContent=new Uf([])}readMarkdown(){this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(t=>{const e=this.parseMarkdown(t);this.markdownContent.next(e)})}parseMarkdown(t){const e=[],n=t.split("# ");for(const i of n)if(i.length){const t=i.split("\n\n");e.push({title:t[0],content:t.splice(1).join("\n\n")})}return e}}return t.\u0275fac=function(e){return new(e||t)(Ci(Bv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),wG=(()=>{class t{constructor(t,e){this.dialog=t,this.infoButtonService=e,this.infoTitle="",this.subscriptions=new g,this.subscriptions.add(e.markdownContent.subscribe(t=>{t.length&&this.launchInfoDialog(t)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){this.dialog.open(yG,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:t,videoID:this.videoID}})}onDialogButtonClick(){this.infoButtonService.readMarkdown()}}return t.\u0275fac=function(e){return new(e||t)(ea(pH),ea(_G))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"mat-icon",1),fa("click",function(){return e.onDialogButtonClick()}),Za(2," info "),sa(),sa())},directives:[p_],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),t})(),xG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,vG,f_,Zv]]}),t})(),SG=(()=>{let t=class extends z${constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Hd(t=>null!=t),up(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(FU(...t),Rd(),up(1))}getOption(...t){const e=this.getPathKey(t);if(this.optionCache.has(e))return this.optionCache.get(e);const n=this.config$.pipe(FU(...t),Rd(),up(1));return this.optionCache.set(e,n),n}getPathKey(t){return`${t.length}:${t.join(".")}`}};return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$()],t.prototype,"config$",null),t=sw([F$(),wV({name:"globalConfig",defaults:null})],t),t})();!function(){const t=localStorage.getItem("ALLOW_TELEMETRY");null===t||t.toLowerCase()}();let EG=(()=>{class t{constructor(t,e){t&&function(t,e){xd(t,"mousemove").pipe(function(t,e=jd,n=BU){return i=>i.lift(new VU(t,e,n.leading,n.trailing))}(1e3),D(e=>{const{clientWidth:n,clientHeight:i}=t,{clientX:r,clientY:s}=e;return[r,s,n,i].join("_")})).subscribe(t=>e.event("webpage","mousemove",t))}(t.body,e)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(W$))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function CG(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!0)}),Za(1),sa()}if(2&t){const t=va();ws(1),tl(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function OG(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!1)}),Za(1,"Opt out"),sa()}}let TG=(()=>{class t{constructor(t,e,n){this.consentService=e,this.data=n,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}get allowTelemetry(){return this.consentService.consent}dismiss(){this.data.preClose()}submit(t){this.consentService.setConsent(t?"given":"rescinded"),this.dismiss()}showButton(t){const{allowTelemetry:e}=this;return"not-set"===e||("opt-in"===t?"rescinded"===e:"given"===e)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Y$),ea(F_))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,e){1&t&&(ra(0,"p"),Za(1,"We log usage to improve this service."),sa(),Jo(2,CG,2,1,"button",0),Jo(3,OG,2,0,"button",0)),2&t&&(ws(2),na("ngIf",e.showButton("opt-in")),ws(1),na("ngIf",e.showButton("opt-out")))},directives:[_h,__],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),t})(),kG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_]]}),t})();const AG=new oi("Default theme class"),PG="light-theme",IG="dark-theme";let MG=(()=>{class t{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(e){const{injector:n,location:i}=e;n.get(t).initialize(i,n)}getTheme(){return this.theme}setTheme(t){t!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(t),this.theme=t)}resetTheme(){this.setTheme(this.defaultTheme)}initialize(t,e){this.element=t,this.injector=e,this.applyThemeClass(this.getTheme())}applyThemeClass(t,e="add"){var n;const{element:i,injector:r}=this;if(!t||!i||!r)return;const s=r.get(Il,null);if(!s)return;const o=i.nativeElement,a=null===(n=r.get(gf,null))||void 0===n?void 0:n.getContainerElement(),l="add"===e?"addClass":"removeClass";s[l](o,t),a&&s[l](a,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(AG,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();var DG;const RG={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["assets/kpmp/data/rui_locations.jsonld","assets/sparc/data/rui_locations.jsonld","assets/gtex/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(DG=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==DG?DG:"",useRemoteApi:!0,remoteApiEndpoint:"https://ccf-api.herokuapp.com/v1"},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"},NG=["*",[["mat-toolbar-row"]]],LG=["*","mat-toolbar-row"],jG=jy(class{constructor(t){this._elementRef=t}});let FG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]}),t})(),BG=(()=>{class t extends jG{constructor(t,e,n){super(t),this._platform=e,this._document=n}ngAfterViewInit(){this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(()=>this._checkToolbarMixedModes()))}_checkToolbarMixedModes(){}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(Yu))},t.\u0275cmp=Jt({type:t,selectors:[["mat-toolbar"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,FG,5),2&t){let t;Wc(t=Yc())&&(e._toolbarRows=t)}},hostAttrs:[1,"mat-toolbar"],hostVars:4,hostBindings:function(t,e){2&t&&ja("mat-toolbar-multiple-rows",e._toolbarRows.length>0)("mat-toolbar-single-row",0===e._toolbarRows.length)},inputs:{color:"color"},exportAs:["matToolbar"],features:[jo],ngContentSelectors:LG,decls:2,vars:0,template:function(t,e){1&t&&(wa(NG),xa(0),xa(1,1))},styles:[".cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}\n"],encapsulation:2,changeDetection:0}),t})(),VG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny],Ny]}),t})(),zG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,VG,rw]]}),t})();function UG(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}let HG;function $G(){return HG||(HG=function(t,e){const n=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let t;return new Promise(e=>{const n=()=>indexedDB.databases().finally(e);t=setInterval(n,100),n()}).finally(()=>clearInterval(t))}().then(()=>{const t=indexedDB.open("keyval-store");return t.onupgradeneeded=()=>t.result.createObjectStore(e),UG(t)});return(t,i)=>n.then(n=>i(n.transaction(e,t).objectStore(e)))}(0,"keyval")),HG}function GG(t,e=$G()){return e("readonly",e=>UG(e.get(t)))}var WG=n(71440),qG=n(70698),XG=n(7445),YG=n.n(XG),KG=n(23815),QG=n(31609);const ZG=WG.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},WG.DataFactory),JG={x:ZG("rdf"),type:ZG("rdf")("type")},tW={x:ZG("rdfs"),label:ZG("rdfs")("label"),comment:ZG("rdfs")("comment"),isDefinedBy:ZG("rdfs")("isDefinedBy"),seeAlso:ZG("rdfs")("seeAlso")},eW={x:ZG("entity"),id:ZG("entity")("id"),label:tW.label,description:tW.comment,link:tW.seeAlso,sex:ZG("entity")("sex"),age:ZG("entity")("age"),bmi:ZG("entity")("bmi"),Male:WG.DataFactory.literal("Male"),Female:WG.DataFactory.literal("Female"),consortiumName:ZG("entity")("consortium_name"),providerName:ZG("entity")("provider_name"),providerUUID:ZG("entity")("provider_uuid"),donor:ZG("entity")("has_donor"),sections:ZG("entity")("has_tissue_section"),datasets:ZG("entity")("has_dataset"),sampleType:ZG("entity")("sample_type"),TissueBlock:WG.DataFactory.literal("Tissue Block"),TissueSection:WG.DataFactory.literal("Tissue Section"),NonStandard:WG.DataFactory.literal("Non-standard"),sectionCount:ZG("entity")("section_count"),sectionSize:ZG("entity")("section_size"),sectionUnits:ZG("entity")("section_units"),sectionNumber:ZG("entity")("section_number"),spatialEntity:ZG("entity")("has_spatial_entity"),ontologyTerms:ZG("entity")("has_ontology_term"),technology:ZG("entity")("technology"),thumbnail:ZG("entity")("has_thumbnail")},nW=ZG("ccf"),iW={x:nW,ontologyNode:{label:nW("ccf_preferred_label"),parent:nW("ccf_part_of"),children:nW("ccf_part_of"),rui_rank:nW("ccf_rui_rank"),synonymLabels:WG.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:nW("VHFemale"),Male:nW("VHMale"),BothSexes:nW("VHBothSexes"),FemaleOrgans:nW("VHFemaleOrgans"),MaleOrgans:nW("VHMaleOrgans")},SpatialObjectReference:nW("SpatialObjectReference"),SpatialEntity:nW("SpatialEntity"),SpatialPlacement:nW("SpatialPlacement"),spatialObjectReference:{file:nW("has_object_file"),file_format:nW("has_object_file_format"),file_subpath:nW("has_object_file_subpath")},extractionSet:{label:tW.label,rui_rank:nW("ccf_rui_rank")},spatialEntity:{label:tW.label,comment:tW.comment,creator:ZG("dc")("creator"),creator_first_name:nW("creator_first_name"),creator_last_name:nW("creator_last_name"),creator_orcid:nW("creator_orcid"),creation_date:nW("creation_date"),updated_date:nW("updated_date"),ccf_annotations:nW("ccf_annotation"),representation_of:nW("ccf_representation_of"),reference_organ:nW("anatomical_structure_of"),extraction_set_for:nW("extraction_set_for"),extraction_set:nW("extraction_site_for"),sex:nW("has_sex"),side:nW("has_side"),rui_rank:nW("ccf_rui_rank"),slice_thickness:nW("ccf_slice_thickness"),slice_count:nW("ccf_slice_count"),x_dimension:nW("has_x_dimension"),y_dimension:nW("has_y_dimension"),z_dimension:nW("has_z_dimension"),dimension_units:nW("has_dimension_units"),object:nW("has_object_reference")},spatialPlacement:{source:nW("has_placement_source"),target:nW("has_placement_target"),placement_date:nW("has_placement_date"),x_scaling:nW("has_x_scaling"),y_scaling:nW("has_y_scaling"),z_scaling:nW("has_z_scaling"),scaling_units:nW("has_scaling_units"),x_rotation:nW("has_x_rotation"),y_rotation:nW("has_y_rotation"),z_rotation:nW("has_z_rotation"),w_rotation:nW("has_theta_rotation"),rotation_order:nW("has_rotation_order"),rotation_units:nW("has_rotation_units"),x_translation:nW("has_x_translation"),y_translation:nW("has_y_translation"),z_translation:nW("has_z_translation"),translation_units:nW("has_translation_units")}},rW={x:ZG("uberon")},sW=(ZG("lmha"),{bladder:rW.x("0001255"),body:rW.x("0013702"),brain:rW.x("0000955"),colon:rW.x("0001155"),heart:rW.x("0000948"),kidney:rW.x("0002113"),large_intestine:rW.x("0000059"),left_kidney:rW.x("0004538"),left_lung:rW.x("0002168"),left_ureter:rW.x("0001223"),liver:rW.x("0002107"),lung:rW.x("0002048"),respiratory_system:rW.x("0001004"),lymph_node:rW.x("0000029"),pelvis:rW.x("0001270"),rectum:rW.x("0001052"),right_kidney:rW.x("0004539"),right_lung:rW.x("0002167"),right_ureter:rW.x("0001222"),skin:rW.x("0002097"),small_intestine:rW.x("0002108"),spleen:rW.x("0002106"),thymus:rW.x("0002370"),ureter:rW.x("0000056"),vasculature:rW.x("0002049")});function oW(t){const e={};return Object.entries(t).forEach(([t,n])=>{e[n.id]=t}),e}const aW={spatialObjectReference:oW(iW.spatialObjectReference),spatialEntity:oW(iW.spatialEntity),spatialPlacement:oW(iW.spatialPlacement)};function lW(t,e,n,i){const r={"@id":e,"@type":n};return t.some(t=>{const e=i[t.predicate.id];if(e){const n="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(r,e,n)}return!1},WG.DataFactory.namedNode(e),null,null,null),r}const cW=(0,KG.memoize)(function(t,e){return lW(t,e,"SpatialObjectReference",aW.spatialObjectReference)},(t,e)=>e),uW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"ExtractionSet",aW.spatialEntity);return n.extractionSites=(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.extraction_set,e,null).map(e=>fW(t,e.id)),["rui_rank"]),n},(t,e)=>e),hW=(0,KG.memoize)(function(t,e){return(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.extraction_set_for,e,null).map(e=>uW(t,e.id)),["rui_rank"])},(t,e)=>e),dW=(0,KG.memoize)(function(t,e){return(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.reference_organ,e,null).map(e=>fW(t,e.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(t,e)=>e),pW=(0,KG.memoize)(function(t){const e=[];return t.forEach(n=>{n.subject.id===n.object.id&&e.push(fW(t,n.subject.id))},null,iW.spatialEntity.reference_organ,null,null),(0,KG.sortBy)(e,["rui_rank"])}),fW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"SpatialEntity",aW.spatialEntity);return n.object&&(n.object=cW(t,n.object)),n.ccf_annotations&&(n.ccf_annotations=t.getObjects(e,iW.spatialEntity.ccf_annotations,null).map(t=>t.id)),t.forSubjects(t=>n.entityId=t.id,eW.spatialEntity,e,null),n},(t,e)=>e),gW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"SpatialPlacement",aW.spatialPlacement);return n.source&&(n.source=fW(t,n.source)),n.target&&(n.target=fW(t,n.target)),n},(t,e)=>e),mW=(0,KG.memoize)(function(t,e){const n=t.getObjects(WG.DataFactory.namedNode(e),eW.spatialEntity,null);if(n.length>0)return fW(t,n[0].id)},(t,e)=>e);function bW(t,e){const n=e;let i;switch(n.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[n.x_translation,n.y_translation,n.z_translation].map(t=>t*i),s=[n.x_rotation,n.y_rotation,n.z_rotation].map(NS),o=[n.x_scaling,n.y_scaling,n.z_scaling];return t.translate(r).rotateXYZ(s).scale(o)}class yW{constructor(t){this.db=t,this.createGraph()}createGraph(){this.graph=new qG.DirectedGraph;const t=this.db.store;t.forSubjects(t=>{this.addNode(t.id,"SpatialObjectReference")},JG.type,iW.SpatialObjectReference,null),t.forSubjects(t=>{this.addNode(t.id,"SpatialEntity")},JG.type,iW.SpatialEntity,null);const e={};t.some(t=>(e[t.subject.id]=t.object.id,!1),null,iW.spatialPlacement.source,null,null),t.some(t=>{const n=e[t.subject.id];return n&&this.addEdge(t.subject.id,n,t.object.id,"SpatialPlacement"),!1},null,iW.spatialPlacement.target,null,null)}addNode(t,e){this.graph.mergeNode(t,{type:e})}addEdge(t,e,n,i){this.graph.mergeDirectedEdge(e,n,{type:i,id:t})}getTransformationMatrix(t,e){if(t===e)return new bT(bT.IDENTITY);if(!this.graph.hasNode(t)||!this.graph.hasNode(e))return;const n=this.db.store,i=new bT(bT.IDENTITY),r=YG()(this.graph,t,e);if(r&&r.length>0){r.reverse();let t="";for(const e of r){if(t){const r=this.graph.getEdgeAttribute(e,t,"id");bW(i,gW(n,r))}t=e}return i}}}class vW{constructor(t){this.db=t}getSpatialEntity(t){return fW(this.db.store,t)}getExtractionSets(t){return hW(this.db.store,t)}getExtractionSet(t){return uW(this.db.store,t)}getAnatomicalStructures(t){return dW(this.db.store,t)}getReferenceOrgans(){return pW(this.db.store)}getReferenceBody(t){let e;switch(null==t?void 0:t.sex){case"Male":e=iW.spatial.Male.id;break;case"Female":e=iW.spatial.Female.id;break;case"Both":default:e=iW.spatial.BothSexes.id}return this.getSpatialEntity(e)}getReferenceOrganSets(t){let e=this.getReferenceOrgans();switch(null==t?void 0:t.sex){case"Male":e=e.filter(t=>"Male"===t.sex);break;case"Female":e=e.filter(t=>"Female"===t.sex)}return(null==t?void 0:t.debug)&&(e=e.map(t=>[[t],this.getAnatomicalStructures(t["@id"])]).reduce((t,[e,n])=>t.concat(n.length>0?n:e),[])),e}getReferenceSceneNodes(t){const e=this.getReferenceBody(t);let n=[...this.getReferenceOrganSets(t).map(t=>{const n="http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of;return this.getSceneNode(t,e,{color:[255,255,255,255],opacity:n?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!n})})];return(null==t?void 0:t.debug)&&(n=n.concat([this.getSceneNode(this.getSpatialEntity(iW.x("VHRightKidney").id),e,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHLeftKidney").id),e,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC1").id),e,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC2").id),e,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC3").id),e,{color:[0,255,0,127.5],wireframe:!0})])),n.filter(t=>void 0!==t)}getReferenceOrganScene(t,e){var n,i;const r=null!==(n=void 0!==(null==e?void 0:e.sex))&&void 0!==n&&n,s=this.getReferenceOrgans().filter(n=>n.representation_of===t&&(!r||n.sex===(null==e?void 0:e.sex)));if(s.length>0){const t=s[0],n=this.getSceneNode(t,t,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),r=(null!==(i=this.db.getSpatialEntities(e))&&void 0!==i?i:[]).map(e=>this.getSceneNode(e,t,{color:[255,255,255,229.5]}));return[n].concat(r).filter(t=>void 0!==t)}return[]}getEntitySceneNodes(t){const e=this.getReferenceBody(t);return this.db.getSpatialEntities(t).map(t=>this.getSceneNode(t,e,{color:[255,255,255,229.5]})).filter(t=>void 0!==t)}getSceneNode(t,e,n={}){var i,r,s,o;const a=null===(r=null===(i=null==t?void 0:t.object)||void 0===i?void 0:i.file_format)||void 0===r?void 0:r.startsWith("model/gltf");let l=this.db.graph.getTransformationMatrix(a&&t.object?t.object["@id"]:t["@id"],e["@id"]);if(l){if(a)l=new bT(bT.IDENTITY).rotateX(NS(90)).multiplyLeft(l);else{let e;switch(t.dimension_units){case"centimeter":e=.01;break;case"millimeter":e=.001;break;case"meter":default:e=1}const n=[t.x_dimension,t.y_dimension,t.z_dimension].map(t=>t*e/2);l.scale(n)}return Object.assign({"@id":t["@id"],"@type":"SpatialSceneNode",entityId:t.entityId,ccf_annotations:t.ccf_annotations,representation_of:t.representation_of,reference_organ:t.reference_organ,scenegraph:a?null===(s=t.object)||void 0===s?void 0:s.file:void 0,scenegraphNode:a?null===(o=t.object)||void 0===o?void 0:o.file_subpath:void 0,transformMatrix:l,tooltip:t.label},n)}}getScene(t){return[...this.getReferenceSceneNodes(t),...this.getEntitySceneNodes(t)]}}const _W="https://entity.api.hubmapconsortium.org/entities/",wW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),xW={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},SW={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},EW=function(){const t={};return Object.entries(sW).forEach(([e,n])=>t[e]=n.id),t}(),CW={BL:[EW.body,EW.bladder],RK:[EW.body,EW.kidney,EW.right_kidney],LK:[EW.body,EW.kidney,EW.left_kidney],HT:[EW.body,EW.heart],LI:[EW.body,EW.large_intestine,EW.colon],SI:[EW.body,EW.small_instestine],LL:[EW.body,EW.respiratory_system,EW.lung,EW.left_lung],RL:[EW.body,EW.respiratory_system,EW.lung,EW.right_lung],LY:[EW.body,EW.lymph_node],SP:[EW.body,EW.spleen],TH:[EW.body,EW.thymus],UR:[EW.body,EW.ureter],LV:[EW.body,EW.liver],OT:[EW.body]},OW={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class TW{constructor(t,e="",n="",i){var r,s;if(this.data=t,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const o=this.data.descendants||[],a=(this.data.ancestors||[]).find(t=>"Donor"===t.entity_type);this.donor=this.getDonor(a,n);const l=this.getRuiLocation(t,this.donor);l?this.rui_location=l:this.bad=!0;const c=new Date(t.last_modified_timestamp).toLocaleDateString(),u=SW[t.group_uuid]||t.group_name,h=t.created_by_user_displayname;this["@id"]=_W+t.uuid,this.label=`Registered ${c}, ${h}, ${u}`,this.link=`${n}browse/sample/${t.uuid}`;const d={},p=[];this.sections=p;const f=[];this.datasets=f;for(const v of o.filter(t=>"Sample"===t.entity_type)){const e=this.getSection(v,t,n);d[v.submission_id]=e,p.push(e),e.section_number=null!==(r=e.section_number)&&void 0!==r?r:p.length}for(const v of o)if("Dataset"===v.entity_type){const t=this.getDataset(v,e,n,i),r=(0,KG.get)(v,["ingest_metadata","metadata","tissue_id"]);d[r]?null===(s=d[r].datasets)||void 0===s||s.push(t):f.push(t)}const g=null!=l?l:{},m=`${g.x_dimension} x ${g.y_dimension} x ${g.z_dimension} ${g.dimension_units}`;this.section_count=g.slice_count||p.length;const b=parseFloat((g.slice_thickness||(g.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=b;const y=g.dimension_units||"millimeter";this.section_units=y,this.description=`${m}, ${b} ${y}, ${t.specimen_type}, ${this.section_count} Sections`,p.forEach((t,e)=>{t.description=`${g.x_dimension} x ${g.y_dimension} x ${b} ${y}, ${b} ${y}, ${t.description}`,t.section_number=e+1})}getSection(t,e,n){const i=new Date(t.last_modified_timestamp).toLocaleDateString();return{"@id":_W+t.uuid,"@type":"Sample",label:`Registered ${i}, ${t.created_by_user_displayname}, ${SW[t.group_uuid]||t.group_name}`,description:`${e.specimen_type}`,link:`${n}browse/sample/${t.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(t,e="",n="",i){var r;const s=new Date(t.last_modified_timestamp).toLocaleDateString(),o=SW[t.group_uuid]||t.group_name,a=t.created_by_user_displayname,l=[...t.data_types,(0,KG.get)(t,["ingest_metadata","metadata","assay_type"],"")],c=l.join("|").toLowerCase();let u,h="assets/icons/ico-unknown.svg";return-1!==c.indexOf("10x")?(u="10x",h="assets/icons/ico-bulk-10x.svg"):-1!==c.indexOf("af")?(u="AF",h="assets/icons/ico-spatial-af.svg"):-1!==c.indexOf("codex")?(u="CODEX",h="assets/icons/ico-spatial-codex.svg"):-1!==c.indexOf("imc")?(u="IMC",h="assets/icons/ico-spatial-imc.svg"):-1!==c.indexOf("lc")&&-1===c.indexOf("af")?(u="LC",h="assets/icons/ico-bulk-lc.svg"):u=-1!==c.indexOf("maldi")?"MALDI":-1!==c.indexOf("pas")?"PAS":"OTHER",h=null!==(r=this.getDatasetThumbnail(t,e,i))&&void 0!==r?r:h,{"@id":_W+t.uuid,"@type":"Dataset",label:`Registered ${s}, ${a}, ${o}`,description:`Data/Assay Types: ${l.join(", ")}`,link:`${n}browse/dataset/${t.uuid}`,technology:u,thumbnail:h}}getDatasetThumbnail(t,e,n){if(t.thumbnail_file){const i=t.thumbnail_file;return`${e}/${i.file_uuid}/${i.filename}`+(n?`?token=${n}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===t.group_uuid){const i=(0,KG.get)(t,"metadata.files",[]).filter(t=>/\.(ome\.tif|ome\.tiff)$/.test(t.rel_path)).filter(t=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(t.rel_path)).filter(t=>wW.has(t.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(i=>`${e}/${t.uuid}/${i.rel_path}`+(n?`?token=${n}`:""));if(i.length>0){const t=i[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(wW.has(t))return`assets/thumbnails/TMC-Vanderbilt/DR1/${t}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===t.group_uuid){const e=xW[t.hubmap_id];if(e)return`assets/thumbnails/TMC-Florida/${e}`}}getDonor(t,e){const n=(t.description||"").toLowerCase();let i;n.includes("female")?i="Female":n.includes("male")&&(i="Male");const r=n.match(/age ([0-9]+)/);let s,o;r&&(s=(0,KG.toNumber)(r[1]));for(const u of(0,KG.get)(t,"metadata.organ_donor_data",[]))"Feminine gender"===u.preferred_term||"Female"===u.preferred_term?i="Female":"Masculine gender"===u.preferred_term||"Male"===u.preferred_term?i="Male":"Current chronological age"===u.preferred_term||"Age"===u.preferred_term?s=(0,KG.toNumber)(u.data_value):"Body mass index"===u.preferred_term&&(o=(0,KG.toNumber)(u.data_value));let a="";i&&s&&(a+=`${i}, Age ${s}`,o&&(a+=`, BMI ${o.toFixed(1)}`));const l=new Date(t.last_modified_timestamp).toLocaleDateString(),c=SW[t.group_uuid]||t.group_name;return{"@id":_W+t.uuid,"@type":"Donor",label:a,description:`Entered ${l}, ${t.created_by_user_displayname}, ${c}`,link:`${e}browse/donor/${t.uuid}`,age:s,sex:i,bmi:o,consortium_name:"HuBMAP",provider_name:c,provider_uuid:t.group_uuid,samples:[]}}getRuiLocation(t,e){var n;const i=(t.ancestors||[]).find(t=>"Sample"===t.entity_type&&"organ"===t.specimen_type),r=CW[null==i?void 0:i.organ]||[EW.body];let s,o=t.rui_location;if(o&&("string"==typeof o&&(o=JSON.parse(o)),o.alignment_id?console.log("Detected a deprecated rui_location",t.uuid):o["@id"]&&(s=o)),s){s.ccf_annotations=r.concat(s.ccf_annotations||[]);const t=null!==(n=(0,KG.get)(s,["placement","target"]))&&void 0!==n?n:"";t.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,KG.set)(s,["placement","target"],t.replace("#VHSpleenCC","Male"===e.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===t||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===t)&&(0,KG.set)(s,["placement","target"],"Male"===e.sex?t.replace("#VH","#VHM")+"_Patch":t.replace("#VH","#VHF")+"_Patch")}return s}getTissueBlock(){return(0,KG.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function kW(t,e,n,i,r="",s=""){return lw(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(t).then(t=>t.ok?t.json():void 0).catch(()=>{});else if("search-api"===e){const e={"Content-type":"application/json"};i&&i.length>0&&(e.Authorization=`Bearer ${i}`),o=yield fetch(t,{method:"POST",headers:e,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:{exists:{field:"rui_location"}}})}).then(t=>t.ok?t.json():void 0).catch(()=>{})}if(o)return function(t,e="",n="",i,r=!1){const s={},o=(0,KG.get)(t,"hits.hits",[]).map(t=>(0,KG.get)(t,"_source",{})).map(t=>new TW(t,e,n,i).toJsonLd());for(const l of o){const t=l["@id"];s[t]?s[t].samples.push(l.samples[0]):s[t]=l}const a=Object.values(s);return r&&(function(t){let e=[],n=0;for(const i of t.filter(t=>t.samples.length>1)){const t=i.samples;for(let i=0;it["@id"]===r)&&(t[i].deleteMe=!0,n++)}i.samples=t.filter(t=>!0!==t.deleteMe)}n>0&&console.log(`\u26a0 ${n} sections identified as blocks`)}(a),console.log(a.map(t=>Object.assign({"@context":OW},t)))),{"@context":OW,"@graph":a}}(o,r,s,i);console.warn(`Unable to load ${t} as HuBMAP Data`)})}function AW(t,e,n){var i;const r=new Map,s=new Set;t.some(t=>{var n;return e.has(t.subject.id)&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.donor,null,null);const o=n(s),a=new Set;for(const l of o)for(const t of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(t);return a}function PW(t,e){return n=>t.has(n.id)?e.add(n.id):void 0}const IW={[iW.ontologyNode.label.id]:"label",[iW.ontologyNode.parent.id]:"parent",[iW.ontologyNode.synonymLabels.id]:"synonymLabels"};function MW(t,e){const n=WG.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return t.some(t=>{const e=IW[t.predicate.id];if(e){const n="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;"synonymLabels"===e?i.synonymLabels.push(n):(0,KG.set)(i,e,n)}return!1},n,null,null,null),i.children=t.getSubjects(iW.ontologyNode.children,n,null).map(t=>t.id),i}const DW={[eW.label.id]:"label",[eW.description.id]:"description",[eW.link.id]:"link"},RW=Object.assign(Object.assign({},DW),{[eW.providerName.id]:"providerName"}),NW=Object.assign(Object.assign({},DW),{[eW.technology.id]:"technology",[eW.thumbnail.id]:"thumbnail"}),LW=Object.assign(Object.assign({},DW),{[eW.sampleType.id]:"sampleType",[eW.sectionNumber.id]:"sectionNumber",[eW.datasets.id]:"datasets"}),jW=Object.assign(Object.assign({},DW),{[eW.sampleType.id]:"sampleType",[eW.sectionCount.id]:"sectionCount",[eW.sectionSize.id]:"sectionSize",[eW.sectionUnits.id]:"sectionUnits",[eW.donor.id]:"donor",[eW.spatialEntity.id]:"spatialEntityId",[eW.sections.id]:"sections",[eW.datasets.id]:"datasets"}),FW=(0,KG.memoize)(function(t,e){const n={"@id":e,"@type":"Donor"};return t.some(t=>{const e=RW[t.predicate.id];if(e){const i="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(n,e,i)}return!1},WG.DataFactory.namedNode(e),null,null,null),n},(t,e)=>e);function BW(t,e){const n={"@id":e,"@type":"Dataset"};return t.some(t=>{const e=NW[t.predicate.id];if(e){const i="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(n,e,i)}return!1},WG.DataFactory.namedNode(e),null,null,null),n}const VW=(0,KG.memoize)(function(t,e){const n={"@id":e,"@type":"Sample",sections:[],datasets:[]};return t.some(e=>{const i=jW[e.predicate.id];if(i){const r="Literal"===e.object.termType?(0,QG.fromRdf)(e.object):e.object.id;if("sections"===i){const e=function(t,e){const n={"@id":e,"@type":"Sample",datasets:[]};return t.some(e=>{const i=LW[e.predicate.id];if(i){const r="Literal"===e.object.termType?(0,QG.fromRdf)(e.object):e.object.id;if("datasets"===i){const e=BW(t,r);n[i].push(e)}else(0,KG.set)(n,i,r)}return!1},WG.DataFactory.namedNode(e),null,null,null),n}(t,r);n[i].push(e)}else if("datasets"===i){const e=BW(t,r);n[i].push(e)}else"donor"===i?n[i]=FW(t,r):(0,KG.set)(n,i,r)}return!1},WG.DataFactory.namedNode(e),null,null,null),n},(t,e)=>e),zW={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class UW{constructor(t=zW){this.options=t,this.store=new WG.Store(void 0,{factory:WG.DataFactory}),this.graph=new yW(this),this.scene=new vW(this)}connect(t,e=!1){return lw(this,void 0,void 0,function*(){return t&&(this.options=t),this.initializing||(this.initializing=e?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return lw(this,void 0,void 0,function*(){const t=(new Date).getTime(),e="ccf-database.last_modified",n="ccf-database",i=yield GG(e).catch(()=>{});let r;i&&t-new Date(+i).getTime()>36e5?yield function(t,e=$G()){return e("readwrite",e=>(t.forEach(t=>e.delete(t)),UG(e.transaction)))}([n,e]).catch(()=>{}):r=yield GG(n).catch(()=>{}),r?yield this.deserialize(r):(yield this.doConnect(),function(t,e=$G()){return e("readwrite",e=>(t.forEach(t=>e.put(t[1],t[0])),UG(e.transaction)))}([[n,this.serialize()],[e,""+t]]).catch(()=>{}))})}doConnect(){var t,e;return lw(this,void 0,void 0,function*(){const n=[],i=null!==(e=null===(t=this.options.dataSources)||void 0===t?void 0:t.concat())&&void 0!==e?e:[],r=this.options.ccfOwlUrl;if(r.endsWith(".n3store.json")){const t=yield fetch(r).then(t=>t.text()).catch(()=>console.log("Couldn't locate serialized store."));t&&(this.store=(0,WG.deserializeN3Store)(t,WG.DataFactory))}else(null==r?void 0:r.length)>0&&i.push(r);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?i.push(this.options.hubmapDataUrl):n.push(kW(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(t=>{if(t)return this.addDataSources([t])}))),n.push(this.addDataSources(i)),yield Promise.all(n),yield this.synchronize()})}addDataSources(t,e){return lw(this,void 0,void 0,function*(){const n=null!=e?e:this.store;return yield Promise.all(t.map(t=>lw(this,void 0,void 0,function*(){"string"==typeof t?t.endsWith("jsonld")?yield(0,WG.addJsonLdToStore)(t,n):t.endsWith("n3")?yield(0,WG.addN3ToStore)(t,n):t.endsWith("rdf")||t.endsWith("owl")||t.endsWith("xml")?yield(0,WG.addRdfXmlToStore)(t,n):yield(0,WG.addJsonLdToStore)(t,n):yield(0,WG.addJsonLdToStore)(t,n)}))),this})}synchronize(){return lw(this,void 0,void 0,function*(){return yield new Promise(t=>{setTimeout(t,500)}),this.graph.createGraph(),this})}serialize(){return(0,WG.serializeN3Store)(this.store)}deserialize(t){return lw(this,void 0,void 0,function*(){this.store=(0,WG.deserializeN3Store)(t,WG.DataFactory),this.graph=new yW(this),this.scene=new vW(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(t={}){return function(t,e){var n,i,r,s,o;let a=function(t){const e=new Set;return t.forSubjects(t=>e.add(t.id),eW.spatialEntity,null,null),e}(t);if(a.size>0&&(a=function(t,e,n=!0){const i=new Set;if(t.forSubjects(PW(e,i),eW.spatialEntity,null,null),!n){const t=new Set;return e.forEach(e=>i.has(e)?void 0:t.add(e)),t}return i}(t,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const n=e.sex;a=AW(t,a,e=>function(t,e,n){const i=new Set;return t.forSubjects(PW(e,i),eW.sex,eW[n],null),i}(t,e,n))}if(a.size>0&&(null===(n=e.tmc)||void 0===n?void 0:n.length)>0&&(a=AW(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.literal(r);t.forSubjects(PW(e,i),eW.providerName,n,null)}return i}(t,n,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(t,e,n){var i;const r=new Map,s=new Set,o=new Set;t.some(t=>(e.has(t.subject.id)&&o.add(t.object.id),!1),null,eW.sections,null,null),t.some(t=>{var n;return(e.has(t.subject.id)||o.has(t.subject.id))&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.datasets,null,null);const a=n(s),l=new Set;for(const c of a)for(const t of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(t);return l}(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.literal(r);t.forSubjects(PW(e,i),eW.technology,n,null)}return i}(t,n,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(t,e,n){var i;const r=new Map,s=new Set;t.some(t=>{var n;return e.has(t.subject.id)&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.spatialEntity,null,null);const o=n(s),a=new Set;for(const l of o)for(const t of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(t);return a}(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.namedNode(r);t.forSubjects(PW(e,i),iW.spatialEntity.ccf_annotations,n,null)}return i}(t,n,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,KG.isFinite)(e.ageRange[0])&&(0,KG.isFinite)(e.ageRange[1])){const n=Math.max(...e.ageRange),i=Math.min(...e.ageRange);1===i&&110===n||(a=AW(t,a,e=>function(t,e,n,i){const r=new Set;return t.some(t=>{if(e.has(t.subject.id)){const e=(0,QG.fromRdf)(t.object);e>=n&&e<=i&&r.add(t.subject.id)}return!1},null,eW.age,null,null),r}(t,e,i,n)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,KG.isFinite)(e.bmiRange[0])&&(0,KG.isFinite)(e.bmiRange[1])){const n=Math.max(...e.bmiRange),i=Math.min(...e.bmiRange);13===i&&83===n||(a=AW(t,a,e=>function(t,e,n,i){const r=new Set;return t.some(t=>{if(e.has(t.subject.id)){const e=(0,QG.fromRdf)(t.object);e>=n&&e<=i&&r.add(t.subject.id)}return!1},null,eW.bmi,null,null),r}(t,e,i,n)))}return a}(this.store,t)}get(t){return this.store.getQuads(WG.DataFactory.namedNode(t),null,null,null)}search(t={}){return[...this.getIds(t)].map(t=>this.get(t))}getSpatialEntities(t){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>mW(this.store,t))}getDatasetTechnologyNames(){return lw(this,void 0,void 0,function*(){return function(t){const e=new Set;return t.some(t=>(e.add(t.object.value),!1),null,eW.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return lw(this,void 0,void 0,function*(){return function(t){const e=new Set;return t.some(t=>(e.add(t.object.value),!1),null,eW.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(t){return lw(this,void 0,void 0,function*(){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>VW(this.store,t))})}getAggregateResults(t){return lw(this,void 0,void 0,function*(){return function(t,e){const n=new Set;e.some(e=>(t.has(e.subject.id)&&n.add(e.object.id),!1),null,eW.donor,null,null);const i=new Set;e.some(t=>(n.has(t.subject.id)&&i.add(t.object.id),!1),null,eW.providerUUID,null,null);const r=new Set;e.forSubjects(e=>{t.has(e.id)&&r.add(e.id)},eW.spatialEntity,null,null);const s=new Set;e.some(t=>(r.has(t.subject.id)&&s.add(t.object.id),!1),null,eW.sections,null,null);const o=new Set;return e.some(t=>{const e=t.subject;return(r.has(e.id)||s.has(e.id))&&o.add(t.object.id),!1},null,eW.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:n.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([t,e])=>({label:t,count:e}))}(this.getIds(t),this.store)})}getOntologyTermOccurences(t){return lw(this,void 0,void 0,function*(){return function(t,e){const n=new Map;e.some(e=>(t.has(e.subject.id)&&(n.has(e.object.id)?n.get(e.object.id).push(e.subject.id):n.set(e.object.id,[e.subject.id])),!1),null,eW.spatialEntity,null,null);const i={};return e.some(t=>{var e,r;if(n.has(t.subject.id)){const s=null!==(r=null===(e=n.get(t.subject.id))||void 0===e?void 0:e.length)&&void 0!==r?r:0;i[t.object.id]=s+(i[t.object.id]||0)}return!1},null,iW.spatialEntity.ccf_annotations,null,null),i}(this.getIds(t),this.store)})}getOntologyTreeModel(){return lw(this,void 0,void 0,function*(){return function(t){const e={root:sW.body.id,nodes:{}},n=new Set;t.some(t=>(n.add(t.subject.id),n.add(t.predicate.id),!1),null,iW.ontologyNode.parent,null,null);for(const i of n)e.nodes[i]=MW(t,i);return e}(this.store)})}getReferenceOrgans(){return lw(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(t){return lw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(t)})}getReferenceOrganScene(t,e){return lw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(t,e)})}}const HW=Symbol("Comlink.proxy"),$W=Symbol("Comlink.endpoint"),GW=Symbol("Comlink.releaseProxy"),WW=Symbol("Comlink.thrown"),qW=t=>"object"==typeof t&&null!==t||"function"==typeof t,XW=new Map([["proxy",{canHandle:t=>qW(t)&&t[HW],serialize(t){const{port1:e,port2:n}=new MessageChannel;return YW(t,e),[n,[n]]},deserialize:t=>(t.start(),QW(t))}],["throw",{canHandle:t=>qW(t)&&WW in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}}]]);function YW(t,e=self){e.addEventListener("message",function n(i){if(!i||!i.data)return;const{id:r,type:s,path:o}=Object.assign({path:[]},i.data),a=(i.data.argumentList||[]).map(rq);let l;try{const e=o.slice(0,-1).reduce((t,e)=>t[e],t),n=o.reduce((t,e)=>t[e],t);switch(s){case"GET":l=n;break;case"SET":e[o.slice(-1)[0]]=rq(i.data.value),l=!0;break;case"APPLY":l=n.apply(e,a);break;case"CONSTRUCT":l=function(t){return Object.assign(t,{[HW]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;YW(t,n),l=function(t,e){return nq.set(t,e),t}(e,[e])}break;case"RELEASE":l=void 0;break;default:return}}catch(c){l={value:c,[WW]:0}}Promise.resolve(l).catch(t=>({value:t,[WW]:0})).then(t=>{const[i,o]=iq(t);e.postMessage(Object.assign(Object.assign({},i),{id:r}),o),"RELEASE"===s&&(e.removeEventListener("message",n),KW(e))})}),e.start&&e.start()}function KW(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function QW(t,e){return JW(t,[],e)}function ZW(t){if(t)throw new Error("Proxy has been released and is not useable")}function JW(t,e=[],n=function(){}){let i=!1;const r=new Proxy(n,{get(n,s){if(ZW(i),s===GW)return()=>sq(t,{type:"RELEASE",path:e.map(t=>t.toString())}).then(()=>{KW(t),i=!0});if("then"===s){if(0===e.length)return{then:()=>r};const n=sq(t,{type:"GET",path:e.map(t=>t.toString())}).then(rq);return n.then.bind(n)}return JW(t,[...e,s])},set(n,r,s){ZW(i);const[o,a]=iq(s);return sq(t,{type:"SET",path:[...e,r].map(t=>t.toString()),value:o},a).then(rq)},apply(n,r,s){ZW(i);const o=e[e.length-1];if(o===$W)return sq(t,{type:"ENDPOINT"}).then(rq);if("bind"===o)return JW(t,e.slice(0,-1));const[a,l]=eq(s);return sq(t,{type:"APPLY",path:e.map(t=>t.toString()),argumentList:a},l).then(rq)},construct(n,r){ZW(i);const[s,o]=eq(r);return sq(t,{type:"CONSTRUCT",path:e.map(t=>t.toString()),argumentList:s},o).then(rq)}});return r}function tq(t){return Array.prototype.concat.apply([],t)}function eq(t){const e=t.map(iq);return[e.map(t=>t[0]),tq(e.map(t=>t[1]))]}const nq=new WeakMap;function iq(t){for(const[e,n]of XW)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},nq.get(t)||[]]}function rq(t){switch(t.type){case"HANDLER":return XW.get(t.name).deserialize(t.value);case"RAW":return t.value}}function sq(t,e,n){return new Promise(i=>{const r=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.addEventListener("message",function e(n){!n.data||!n.data.id||n.data.id!==r||(t.removeEventListener("message",e),i(n.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:r},e),n)})}function oq(t,e){return t===e}let aq=(()=>{class t{constructor(t,e){this.locator=e,this.subscriptions=new g,this.dataSource=t.config$.pipe(Hd(t=>Object.keys(t).length>0),D(t=>t),Rd(oq),Qd(t=>function(t,e){return new C(n=>{let i,r;try{i=t()}catch(o){return void n.error(o)}try{r=e(i)}catch(o){return void n.error(o)}const s=(r?U(r):ep).subscribe(n);return()=>{s.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),e=>this.connectDataSource(e.source,t))),up(1))}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Qd(e=>e.getTissueBlockResults(t)),Gp(1))}getDatasetTechnologyNames(){return this.dataSource.pipe(Qd(t=>t.getDatasetTechnologyNames()),Gp(1))}getProviderNames(){return this.dataSource.pipe(Qd(t=>t.getProviderNames()),Gp(1))}getAggregateResults(t){return this.dataSource.pipe(Qd(e=>e.getAggregateResults(t)),Gp(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Qd(e=>e.getOntologyTermOccurences(t)),Gp(1))}getOntologyTreeModel(){return this.dataSource.pipe(Qd(t=>t.getOntologyTreeModel()),Gp(1))}getReferenceOrgans(){return this.dataSource.pipe(Qd(t=>t.getReferenceOrgans()),Gp(1))}getScene(t){return this.dataSource.pipe(Qd(e=>e.getScene(t)),Gp(1))}createDataSource(){let t,e=()=>{};if("undefined"==typeof Worker||RG.disableDbWorker)t=new UW;else{let n;({source:t,worker:n}=this.getWebWorkerDataSource(!0)),e=()=>lw(this,void 0,void 0,function*(){yield t[GW](),n.terminate()})}return{source:t,unsubscribe:e}}connectDataSource(t,e){return lw(this,void 0,void 0,function*(){RG.disableDbWorker&&(yield new Promise(t=>{setTimeout(t,100)}));const n=(new Date).getTime();return yield t.connect(e,!0),RG.production||console.info(`Loaded CCF database in ${((new Date).getTime()-n)/1e3}s`),t})}getWebWorkerDataSource(t=!1){let e;if(t)e=new Worker(n.tu(new URL(n.p+n.u(10),n.b)),{type:void 0});else{const t=this.locator.prepareExternalUrl("0-es2015.worker.js"),n=new Blob([`importScripts('${t}')`],{type:"application/javascript"});e=new Worker(URL.createObjectURL(n),{type:"module"})}return{source:QW(e),worker:e}}}return t.\u0275fac=function(e){return new(e||t)(Ci(SG),Ci(rh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function lq(t,e,n,i){n&&"function"!=typeof n&&(i=n);const r="function"==typeof n?n:void 0,s=new lp(t,e,i);return t=>rt(()=>s,r)(t)}const cq=(t,e)=>JSON.stringify(t)===JSON.stringify(e),uq=t=>t.map(t=>void 0!==t?JSON.parse(JSON.stringify(t)):t),hq={storageStrategy:class extends class{}{constructor(){super(...arguments),this.cachePairs=[]}add(t,e,n){this.cachePairs.push(t)}addMany(t){this.cachePairs=t}updateAtIndex(t,e){Object.assign(this.cachePairs[t],e)}update(t,e){Object.assign(this.cachePairs[t],e)}getAll(){return this.cachePairs}removeAtIndex(t){this.cachePairs.splice(t,1)}remove(t){this.cachePairs.splice(t,1)}removeAll(){this.cachePairs.length=0}},globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},dq=new P;function pq(t={}){return function(e,n,i){const r=t.cacheKey||e.constructor.name+"#"+n,s=i.value;if(i&&i.value){let e=t.storageStrategy?new t.storageStrategy:new hq.storageStrategy;const n=[];t.cacheModifier&&t.cacheModifier.subscribe(t=>e.addMany(t(e.getAll(r,this)),r,this)),Q(dq.asObservable(),t.cacheBusterObserver?t.cacheBusterObserver:np()).subscribe(t=>{e.removeAll(r,this),n.length=0}),t.cacheResolver=t.cacheResolver||hq.cacheResolver||cq,t.cacheHasher=t.cacheHasher||hq.cacheHasher||uq,i.value=function(...i){const o=e.getAll(r,this);let a=t.cacheHasher(i),l=o.find(e=>t.cacheResolver(e.parameters,a));const c=n.find(e=>t.cacheResolver(e.parameters,a));if((t.maxAge||hq.maxAge)&&l&&l.created&&((new Date).getTime()-new Date(l.created).getTime()>(t.maxAge||hq.maxAge)?(e.remove?e.remove(o.indexOf(l),l,r,this):e.removeAtIndex(o.indexOf(l),r,this),l=null):(t.slidingExpiration||hq.slidingExpiration)&&(l.created=new Date,e.update?e.update(o.indexOf(l),l,r,this):e.updateAtIndex(o.indexOf(l),l,r,this))),l){const e=wd(l.response);return t.async?e.pipe(uU(0)):e}if(c)return c.response;{const l=s.call(this,...i).pipe(mv(()=>{const e=n.find(e=>t.cacheResolver(e.parameters,a));n.splice(n.indexOf(e),1)}),$f(n=>{(!t.shouldCacheDecider||t.shouldCacheDecider(n))&&((!(t.maxCacheCount||hq.maxCacheCount)||1===(t.maxCacheCount||hq.maxCacheCount)||(t.maxCacheCount||hq.maxCacheCount)&&(t.maxCacheCount||hq.maxCacheCount)t.map(t=>Object.assign(Object.assign({},t),{transformMatrix:new bT(t.transformMatrix)}))))}doFetch(t,e){const{globalConfig:n,http:i}=this,r=this.filterToParams(e);return n.getOption("remoteApiEndpoint").pipe(D(e=>`${e}/${t}`),Qd(t=>i.get(t,{params:this.withToken(r),responseType:"json"})),up(1))}filterToParams(t={}){return Object.keys(t).sort().reduce((e,n)=>{const i=t[n];return(t=>null==t||""===t||Array.isArray(t)&&0===t.length)(i)?e:e.set(n,(t=>Array.isArray(t)?t.join(","):`${t}`)(i))},new Tv)}withToken(t){const{globalConfig:{snapshot:{hubmapToken:e}}}=this;return e?t.set("token",e):t}}fq.\u0275fac=function(t){return new(t||fq)(Ci(SG),Ci(Bv))},fq.\u0275prov=xt({token:fq,factory:fq.\u0275fac,providedIn:"root"}),sw([pq()],fq.prototype,"getProviderNames",null),sw([pq()],fq.prototype,"getDatasetTechnologyNames",null),sw([pq()],fq.prototype,"getOntologyTreeModel",null),sw([pq()],fq.prototype,"getReferenceOrgans",null),sw([pq()],fq.prototype,"getTissueBlockResults",null),sw([pq()],fq.prototype,"getAggregateResults",null),sw([pq()],fq.prototype,"getOntologyTermOccurences",null),sw([pq()],fq.prototype,"getScene",null);let gq=(()=>{class t{constructor(t,e,n){this.impl$=t.config$.pipe(D(t=>!!t.useRemoteApi&&!!t.remoteApiEndpoint),D(t=>t?n:e),Rd(),up(1))}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getReferenceOrgans(){return this.forwardCall("getReferenceOrgans")}getTissueBlockResults(t){return this.forwardCall("getTissueBlockResults",t)}getAggregateResults(t){return this.forwardCall("getAggregateResults",t)}getOntologyTermOccurences(t){return this.forwardCall("getOntologyTermOccurences",t)}getScene(t){return this.forwardCall("getScene",t)}forwardCall(t,...e){return this.impl$.pipe(Qd(n=>n[t](...e)))}}return t.\u0275fac=function(e){return new(e||t)(Ci(SG),Ci(aq),Ci(fq))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),mq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),bq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:au,useValue:MG.initialize,multi:!0},MG]}),t})(),yq=(()=>{class t{constructor(t,e){this.accessor=t,this.injector=e}static forRoot(e=[]){return{ngModule:t,providers:[w$,_$,y$,...e]}}}return t.\u0275fac=function(e){return new(e||t)(Ci(w$,2),Ci(_$,2))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const vq=(t,e)=>((t,e)=>new Array(e+1).join("0"))(0,e-t.toString().length)+t;class _q{constructor(t,e,n){this.action=t,this.store=e,this.logWriter=n}dispatched(t){const e=VB(this.action),n=function(t){return vq(t.getHours(),2)+":"+vq(t.getMinutes(),2)+":"+vq(t.getSeconds(),2)+"."+vq(t.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${e} @ ${n}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",t)}completed(t){this.logWriter.logGreen("next state",t),this.logWriter.endGroup()}errored(t){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",t),this.logWriter.endGroup()}_hasPayload(t){return this._getNonEmptyProperties(t).length>0}_getNonEmptyProperties(t){return Object.keys(t).map(e=>t[e]).filter(t=>void 0!==t)}}class wq{constructor(t){this.options=t,this.options=this.options||{},this.logger=t.logger||console}startGroup(t){const e=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{e.call(this.logger,t)}catch(n){console.log(t)}}endGroup(){try{this.logger.groupEnd()}catch(t){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(t,e){this.log(t,"color: #9E9E9E; font-weight: bold",e)}logGreen(t,e){this.log(t,"color: #4CAF50; font-weight: bold",e)}logRedish(t,e){this.log(t,"color: #FD8182; font-weight: bold",e)}log(t,e,n){this.isIE()?this.logger.log(t,n):this.logger.log("%c "+t,e,n)}isIE(){const t="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let e=!1;const n=t.indexOf("MSIE "),i=t.indexOf("Trident/");return(n>-1||i>-1)&&(e=!0),e}}const xq=new oi("NGXS_LOGGER_PLUGIN_OPTIONS");let Sq=(()=>{class t{constructor(t,e){this._options=t,this._injector=e}handle(t,e,n){if(this._options.disabled||!this._options.filter(e,t))return n(t,e);this._logWriter=this._logWriter||new wq(this._options),this._store=this._store||this._injector.get(pV);const i=new _q(e,this._store,this._logWriter);return i.dispatched(t),n(t,e).pipe($f(t=>{i.completed(t)}),pv(t=>{throw i.errored(t),t}))}}return t.\u0275fac=function(e){return new(e||t)(Ci(xq),Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Eq=new oi("LOGGER_USER_OPTIONS");function Cq(t){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},t)}let Oq=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[{provide:MB,useClass:Sq,multi:!0},{provide:Eq,useValue:e},{provide:xq,useFactory:Cq,deps:[Eq]}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Tq=new RegExp("[^#a-f\\d]","gi"),kq=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),Aq=["#FF8800","#2979ff","#ffd740","#b92dff","#da326f","#7323e2","#acf32b","#82B1FF","#E040FB","#00E5FF"].map((t,e)=>{const n=function(t,e={}){if("string"!=typeof t||Tq.test(t)||!kq.test(t))throw new TypeError("Expected a valid hex string");let n=1;8===(t=t.replace(/^#/,"")).length&&(n=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(n=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const i=Number.parseInt(t,16),r=i>>16,s=i>>8&255,o=255&i,a="number"==typeof e.alpha?e.alpha:n;return"array"===e.format?[r,s,o,a]:"css"===e.format?`rgb(${r} ${s} ${o}${1===a?"":` / ${Number((100*a).toFixed(2))}%`})`:{red:r,green:s,blue:o,alpha:a}}(t,{format:"array"});return n[3]=255,{color:t,rgba:n,rank:e}});let Pq=class extends z${constructor(){super(...arguments),this.forcedUnassignment=new P,this.forcedUnassignment$=this.forcedUnassignment.asObservable(),this.colorAssignments$=this.state$.pipe(FU("colorAssignments"),Rd()),this.colorAssignmentsList$=this.state$.pipe(FU("colorAssignmentsList"),Rd())}getColor(t){const{colorAssignments:e}=this.snapshot;return e[t]}assignColor(t,e=!1){let{colorAssignments:n,colorAssignmentsList:i,colorsAvailable:r}=this.snapshot;e&&(r=this.snapshot.colorPalette.concat(),i=[],n={});let s=n[t];return s||(r.length>0?s=r[0]:(s=i[i.length-1].color,i=i.slice(0,-1),this.forcedUnassignment.next()),r=r.filter(t=>t.color!==s.color),i=[{color:s,key:t}].concat(i),n=i.reduce((t,e,n)=>(t[e.key]=Object.assign(Object.assign({},e.color),{rank:n}),t),{}),this.ctx.patchState({colorsAvailable:r,colorAssignments:n,colorAssignmentsList:i})),s}unassignColor(t){let{colorAssignments:e,colorAssignmentsList:n,colorsAvailable:i}=this.snapshot;const r=e[t];r&&(i=[r].concat(i),n=n.filter(t=>t.color.color!==r.color),e=n.reduce((t,e,n)=>(t[e.key]=Object.assign(Object.assign({},e.color),{rank:n}),t),{}),this.ctx.patchState({colorsAvailable:i,colorAssignments:e,colorAssignmentsList:n}))}};function Iq(t,e){return n=>n.lift(new Mq(t,e))}Pq.\u0275fac=function(){let t;return function(e){return(t||(t=ei(Pq)))(e||Pq)}}(),Pq.\u0275prov=xt({token:Pq,factory:Pq.\u0275fac}),sw([L$(),ow(0,j$("key")),ow(1,j$("doReset"))],Pq.prototype,"assignColor",null),sw([L$(),ow(0,j$("key"))],Pq.prototype,"unassignColor",null),Pq=sw([F$(),wV({name:"colors",defaults:{colorPalette:Aq.concat(),colorsAvailable:Aq.concat(),colorAssignments:{},colorAssignmentsList:[]}})],Pq);class Mq{constructor(t,e){this.keySelector=t,this.flushes=e}call(t,e){return e.subscribe(new Dq(t,this.keySelector,this.flushes))}}class Dq extends ${constructor(t,e,n){super(t),this.keySelector=e,this.values=new Set,n&&this.add(G(n,new H(this)))}notifyNext(){this.values.clear()}notifyError(t){this._error(t)}_next(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)}_useKeySelector(t){let e;const{destination:n}=this;try{e=this.keySelector(t)}catch(i){return void n.error(i)}this._finalizeNext(e,t)}_finalizeNext(t,e){const{values:n}=this;n.has(t)||(n.add(t),this.destination.next(e))}}const Rq={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"]};var Nq=(()=>(function(t){t.Running="running",t.Completed="completed"}(Nq||(Nq={})),Nq))();function Lq(t){return()=>t.next(Nq.Completed)}function jq(t,e){return n=>n.pipe(Qd(t),$f(e),lq(1),Z())}let Fq=class extends V${constructor(t){super(),this.source=t,this._tissueBlockDataQueryStatus$=new lp(1),this._aggregateDataQueryStatus$=new lp(1),this._termOccurencesDataQueryStatus$=new lp(1),this._sceneDataQueryStatus$=new lp(1),this._technologyFilterQueryStatus$=new lp(1),this._providerFilterQueryStatus$=new lp(1),this.ontologyTermsFullData$=new lp(1),this.filter$=this.state$.pipe(FU("filter")),this.tissueBlockData$=this.filter$.pipe(jq(this.tissueBlockData,Lq(this._tissueBlockDataQueryStatus$))),this.aggregateData$=this.filter$.pipe(jq(this.aggregateData,Lq(this._aggregateDataQueryStatus$))),this.termOccurencesData$=this.filter$.pipe(jq(this.termOccurencesData,Lq(this._termOccurencesDataQueryStatus$))),this.sceneData$=this.filter$.pipe(jq(this.sceneData,Lq(this._sceneDataQueryStatus$))),this.technologyFilterData$=this.filter$.pipe(jq(this.technologyFilterData,Lq(this._technologyFilterQueryStatus$))),this.providerFilterData$=this.filter$.pipe(jq(this.providerFilterData,Lq(this._providerFilterQueryStatus$))),this.tissueBlockDataQueryStatus$=this._tissueBlockDataQueryStatus$.pipe(Iq()),this.aggregateDataQueryStatus$=this._aggregateDataQueryStatus$.pipe(Iq()),this.termOccurencesDataQueryStatus$=this._termOccurencesDataQueryStatus$.pipe(Iq()),this.sceneDataQueryStatus$=this._sceneDataQueryStatus$.pipe(Iq()),this.technologyFilterQueryStatus$=this._technologyFilterQueryStatus$.pipe(Iq()),this.providerFilterQueryStatus$=this._providerFilterQueryStatus$.pipe(Iq()),this.queryStatus$=T_([this.tissueBlockDataQueryStatus$,this.aggregateDataQueryStatus$,this.termOccurencesDataQueryStatus$,this.sceneDataQueryStatus$,this.technologyFilterQueryStatus$,this.providerFilterQueryStatus$]).pipe(D(t=>function(t){return t.every(t=>t===Nq.Completed)}(t)?Nq.Completed:Nq.Running),Iq()),this._tissueBlockDataQueryStatus$.next(Nq.Completed),this._aggregateDataQueryStatus$.next(Nq.Completed),this._termOccurencesDataQueryStatus$.next(Nq.Completed),this._sceneDataQueryStatus$.next(Nq.Completed),this._technologyFilterQueryStatus$.next(Nq.Completed),this._providerFilterQueryStatus$.next(Nq.Completed)}ngxsOnInit(){const{ontologyTermsFullData$:t,termOccurencesData$:e,source:n,snapshot:{filter:i}}=this;i===Rq?e.pipe(Gp(1)).subscribe(t):n.getOntologyTermOccurences().pipe(Gp(1)).subscribe(t)}updateFilter(t){this.patchState({filter:Object.assign(Object.assign({},this.getState().filter),t)})}tissueBlockData(t){return this._tissueBlockDataQueryStatus$.next(Nq.Running),this.source.getTissueBlockResults(t)}aggregateData(t){return this._aggregateDataQueryStatus$.next(Nq.Running),this.source.getAggregateResults(t)}termOccurencesData(t){return this._termOccurencesDataQueryStatus$.next(Nq.Running),this.source.getOntologyTermOccurences(t)}sceneData(t){return this._sceneDataQueryStatus$.next(Nq.Running),this.source.getScene(t)}technologyFilterData(){return this._technologyFilterQueryStatus$.next(Nq.Running),this.source.getDatasetTechnologyNames()}providerFilterData(){return this._providerFilterQueryStatus$.next(Nq.Running),this.source.getProviderNames()}};Fq.\u0275fac=function(t){return new(t||Fq)(Ci(mq))},Fq.\u0275prov=xt({token:Fq,factory:Fq.\u0275fac}),sw([L$(),ow(0,j$("filter"))],Fq.prototype,"updateFilter",null),sw([iB.ak],Fq.prototype,"tissueBlockData",null),sw([iB.ak],Fq.prototype,"aggregateData",null),sw([iB.ak],Fq.prototype,"termOccurencesData",null),sw([iB.ak],Fq.prototype,"sceneData",null),sw([iB.ak],Fq.prototype,"technologyFilterData",null),sw([iB.ak],Fq.prototype,"providerFilterData",null),Fq=sw([F$(),wV({name:"data",defaults:{filter:Rq}})],Fq);const Bq=[{name:"logo",namespace:"app",url:"assets/icons/app/hubmap-logo.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs_bladder.svg"},{name:"bone_marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs_brain.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs_heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs_kidney.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"large_intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs_liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs_lung.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lymph_nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small_intestine",namespace:"app",url:"assets/icons/organs/ico-organs_small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs_spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"vasculature",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"expand_more",namespace:"app",url:"assets/icons/expand_more-24px.svg"},{name:"expand_less",namespace:"app",url:"assets/icons/expand_less-24px.svg"},{name:"filter",url:"assets/icons/filter.svg"}];let Vq=class extends V${constructor(t,e){super(),this.registry=t;for(const{name:n,namespace:i,url:r,html:s}of Bq){const t={name:n,namespace:i,url:r&&e.bypassSecurityTrustResourceUrl(r),html:s&&e.bypassSecurityTrustHtml(s)};this.registerIconImpl(t)}}registerIcon(t){return this.registerIconImpl(t)}registerIconImpl(t){if(!this.registry||!t.url&&!t.html)return!1;const e=this.registry,n=e[this.getMethodName(t)],i=this.getArguments(t);if(!n)return!1;try{return n.apply(e,i),!0}catch(r){return!1}}getMethodName({name:t,namespace:e,url:n}){const i=["addSvgIcon"];return t||i.push("Set"),n||i.push("Literal"),e&&i.push("InNamespace"),i.join("")}getArguments({name:t,namespace:e,url:n,html:i}){return[e,t,null!=n?n:i].filter(t=>!!t)}};Vq.\u0275fac=function(t){return new(t||Vq)(Ci(r_,8),Ci(hd))},Vq.\u0275prov=xt({token:Vq,factory:Vq.\u0275fac}),sw([L$()],Vq.prototype,"registerIcon",null),Vq=sw([F$(),wV({name:"iconRegistry"})],Vq);let zq=class extends z${constructor(t,e){super(),this.dataService=t,this.injector=e,this.listResults$=this.state$.pipe(FU("listResults"),Rd()),this.highlightedNodeId$=this.state$.pipe(FU("highlightedNodeId"),Rd())}setListResults(t){this.ctx.patchState({listResults:t})}selectListResult(t){this.colorAssignments.assignColor(t.tissueBlock.spatialEntityId)}deselectListResult(t){this.colorAssignments.unassignColor(t.tissueBlock.spatialEntityId)}highlightNode(t){this.ctx.patchState({highlightedNodeId:t})}unHighlightNode(){this.ctx.patchState({highlightedNodeId:void 0})}ngxsOnInit(){super.ngxsOnInit(),this.dataState=this.injector.get(Fq),this.colorAssignments=this.injector.get(Pq),T_([this.dataState.tissueBlockData$,this.colorAssignments.colorAssignments$]).pipe(D(([t,e])=>{const n=[],i=[];for(const r of t){const t=e[r.spatialEntityId];t?n.push({selected:!0,color:t.color,tissueBlock:r,rank:t.rank}):i.push({selected:!1,tissueBlock:r})}return(0,KG.sortBy)(n,["rank"]).concat(i)}),$f(t=>this.setListResults(t))).subscribe()}};function Uq(t,e,n){e[n.id]=n,(0,KG.forEach)(n.children,n=>Uq(t,e,t[n]))}function Hq(t,e){const n={"@id":t.root,"@type":"OntologyTreeNode",id:t.root,label:"body",parent:"",children:e,synonymLabels:[]},i=(0,KG.at)(t.nodes,e),r={[n.id]:n};return(0,KG.forEach)(i,t=>t.parent=n.id),(0,KG.forEach)(i,e=>Uq(t.nodes,r,e)),{root:n.id,nodes:r}}zq.\u0275fac=function(t){return new(t||zq)(Ci(mq),Ci(No))},zq.\u0275prov=xt({token:zq,factory:zq.\u0275fac}),sw([L$(),ow(0,j$("listResults"))],zq.prototype,"setListResults",null),zq=sw([F$(),wV({name:"listResults",defaults:{listResults:[]}})],zq);let $q=class extends z${constructor(t){super(),this.dataService=t,this.nodes$=this.state$.pipe(D(t=>Object.values(t.nodes))),this.rootNode$=this.state$.pipe(D(t=>t.nodes[t.root]))}setOntology(t){this.ctx.setState(t)}ngxsOnInit(){super.ngxsOnInit(),this.loadOntology()}loadOntology(){hv([this.dataService.getOntologyTreeModel().pipe(Gp(1)),this.dataService.getReferenceOrgans().pipe(Gp(1))]).subscribe(([t,e])=>{const n=RG.organNodes.concat(),i=(0,KG.partial)(Hq,KG.partial.placeholder,n)(t);this.setOntology(i)})}};$q.\u0275fac=function(t){return new(t||$q)(Ci(mq))},$q.\u0275prov=xt({token:$q,factory:$q.\u0275fac}),sw([L$()],$q.prototype,"setOntology",null),$q=sw([F$(),wV({name:"ontology",defaults:{root:"",nodes:{}}})],$q);const Gq=new Set(["Skin","Heart","Kidney","Spleen"]);let Wq=class extends z${constructor(t,e){super(),this.dataService=t,this.injector=e,this.referenceOrgans$=this.state$.pipe(FU("referenceOrgans"),Rd()),this.selectedReferenceOrgans$=this.state$.pipe(FU("selectedReferenceOrgans"),Rd()),this.scene$=this.state$.pipe(FU("scene"),Rd()),this.highlightedId$=this.state$.pipe(FU("highlightedId"),Rd())}setSelectedReferenceOrgans(t){this.ctx.patchState({selectedReferenceOrgans:t})}setReferenceOrgans(t){this.ctx.patchState({referenceOrgans:t})}setScene(t){this.ctx.patchState({scene:t})}sceneNodeClicked({node:t,ctrlClick:e}){t.representation_of&&"http://purl.org/ccf/latest/ccf.owl#VHFSkin"!==t["@id"]&&t.entityId?this.dataState.updateFilter({ontologyTerms:[t.representation_of]}):t.entityId&&this.colorAssignments.assignColor(t["@id"],!e)}sceneNodeHovered(t){this.listResults.highlightNode(t["@id"])}sceneNodeUnhover(){this.listResults.unHighlightNode()}ngxsOnInit(){super.ngxsOnInit(),this.dataState=this.injector.get(Fq),this.colorAssignments=this.injector.get(Pq),this.listResults=this.injector.get(zq),this.dataService.getReferenceOrgans().pipe(D(t=>{const e=new Set(t.map(t=>t.representation_of));return cG.filter(t=>e.has(t.id)).map(t=>Object.assign(Object.assign({},t),{disabled:!1,numResults:0}))}),Gp(1),$f(t=>{this.setReferenceOrgans(t),this.setSelectedReferenceOrgans(t.filter(t=>Gq.has(t.organ)))})).subscribe(),T_([this.dataState.sceneData$,this.selectedReferenceOrgans$,this.colorAssignments.colorAssignments$,this.dataService.getReferenceOrgans(),this.listResults.highlightedNodeId$]).pipe(D(([t,e,n,i,r])=>{const s=new Set(e.map(t=>t.id)),o=new Set(i.filter(t=>s.has(t.representation_of)).map(t=>t["@id"]));return t.filter(t=>{var e,n;return(null===(n=null===(e=t.ccf_annotations)||void 0===e?void 0:e.some)||void 0===n?void 0:n.call(e,t=>s.has(t)))||t.reference_organ&&o.has(t.reference_organ)}).map(t=>t.entityId&&(Object.prototype.hasOwnProperty.call(n,t["@id"])||r===t["@id"])?Object.assign(Object.assign({},t),{color:r===t["@id"]?[30,136,229,255]:n[t["@id"]].rgba}):t)}),$f(t=>this.setScene(t))).subscribe()}};Wq.\u0275fac=function(t){return new(t||Wq)(Ci(mq),Ci(No))},Wq.\u0275prov=xt({token:Wq,factory:Wq.\u0275fac}),sw([L$(),ow(0,j$("selectedReferenceOrgans"))],Wq.prototype,"setSelectedReferenceOrgans",null),sw([L$(),ow(0,j$("referenceOrgans"))],Wq.prototype,"setReferenceOrgans",null),sw([L$(),ow(0,j$("scene"))],Wq.prototype,"setScene",null),Wq=sw([F$(),wV({name:"scene",defaults:{scene:[],referenceOrgans:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],Wq);const qq=[SG,Pq,Vq,zq,Fq,$q,Wq];let Xq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[yq.forRoot(),_V.forRoot(qq,{developmentMode:!RG.production}),Oq.forRoot({disabled:RG.production})]]}),t})(),Yq=(()=>{class t{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:mq,useExisting:gq}],imports:[[Zv,tG.forRoot({gaToken:RG.googleAnalyticsToken,appName:"eui"}),EG,zG,Xq,bq],zG]}),t})();const Kq=["input"],Qq=function(t){return{enterDuration:t}},Zq=["*"],Jq=new oi("mat-checkbox-default-options",{providedIn:"root",factory:tX});function tX(){return{color:"accent",clickAction:"check-indeterminate"}}let eX=0;const nX=tX(),iX={provide:EV,useExisting:pt(()=>oX),multi:!0};class rX{}const sX=By(jy(Fy(Ly(class{constructor(t){this._elementRef=t}}))));let oX=(()=>{class t extends sX{constructor(t,e,n,i,r,s,o){super(t),this._changeDetectorRef=e,this._focusMonitor=n,this._ngZone=i,this._animationMode=s,this._options=o,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++eX,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Rc,this.indeterminateChange=new Rc,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||nX,this.color=this.defaultColor=this._options.color||nX.color,this.tabIndex=parseInt(r)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=md(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t||Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}ngAfterViewChecked(){}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}get checked(){return this._checked}set checked(t){t!=this.checked&&(this._checked=t,this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){const e=md(t);e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const e=t!=this._indeterminate;this._indeterminate=md(t),e&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(t){this.checked=!!t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_getAriaChecked(){return this.checked?"true":this.indeterminate?"mixed":"false"}_transitionCheckState(t){let e=this._currentCheckState,n=this._elementRef.nativeElement;if(e!==t&&(this._currentAnimationClass.length>0&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(e,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);const t=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{n.classList.remove(t)},1e3)})}}_emitChangeEvent(){const t=new rX;t.source=this,t.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(t),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked}_onInputClick(t){var e;const n=null===(e=this._options)||void 0===e?void 0:e.clickAction;t.stopPropagation(),this.disabled||"noop"===n?!this.disabled&&"noop"===n&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==n&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,e){t?this._focusMonitor.focusVia(this._inputElement,t,e):this._inputElement.nativeElement.focus(e)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,e){if("NoopAnimations"===this._animationMode)return"";let n="";switch(t){case 0:if(1===e)n="unchecked-checked";else{if(3!=e)return"";n="unchecked-indeterminate"}break;case 2:n=1===e?"unchecked-checked":"unchecked-indeterminate";break;case 1:n=2===e?"checked-unchecked":"checked-indeterminate";break;case 3:n=1===e?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${n}`}_syncIndeterminate(t){const e=this._inputElement;e&&(e.nativeElement.indeterminate=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(Ig),ea(xu),ii("tabindex"),ea(Ey,8),ea(Jq,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-checkbox"]],viewQuery:function(t,e){if(1&t&&(qc(Kq,5),qc(Yy,5)),2&t){let t;Wc(t=Yc())&&(e._inputElement=t.first),Wc(t=Yc())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,e){2&t&&(il("id",e.id),Ko("tabindex",null),ja("mat-checkbox-indeterminate",e.indeterminate)("mat-checkbox-checked",e.checked)("mat-checkbox-disabled",e.disabled)("mat-checkbox-label-before","before"==e.labelPosition)("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[_l([iX]),jo],ngContentSelectors:Zq,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(t,e){if(1&t&&(wa(),ra(0,"label",0,1),ra(2,"span",2),ra(3,"input",3,4),fa("change",function(t){return e._onInteractionEvent(t)})("click",function(t){return e._onInputClick(t)}),sa(),ra(5,"span",5),oa(6,"span",6),sa(),oa(7,"span",7),ra(8,"span",8),vn(),ra(9,"svg",9),oa(10,"path",10),sa(),Ve.lFrame.currentNamespace=null,oa(11,"span",11),sa(),sa(),ra(12,"span",12,13),fa("cdkObserveContent",function(){return e._onLabelTextChange()}),ra(14,"span",14),Za(15,"\xa0"),sa(),xa(16),sa(),sa()),2&t){const t=ta(1),n=ta(13);Ko("for",e.inputId),ws(2),ja("mat-checkbox-inner-container-no-side-margin",!n.textContent||!n.textContent.trim()),ws(1),na("id",e.inputId)("required",e.required)("checked",e.checked)("disabled",e.disabled)("tabIndex",e.tabIndex),Ko("value",e.value)("name",e.name)("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby)("aria-checked",e._getAriaChecked())("aria-describedby",e.ariaDescribedby),ws(2),na("matRippleTrigger",t)("matRippleDisabled",e._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Tc(19,Qq,"NoopAnimations"===e._animationMode?0:150))}},directives:[Yy,ng],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),t})(),aX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),lX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Ny,ig,aX],Ny,aX]}),t})(),cX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,lX]]}),t})();const uX=["trigger"],hX=["panel"];function dX(t,e){if(1&t&&(ra(0,"span",8),Za(1),sa()),2&t){const t=va();ws(1),Ja(t.placeholder)}}function pX(t,e){if(1&t&&(ra(0,"span",12),Za(1),sa()),2&t){const t=va(2);ws(1),Ja(t.triggerValue)}}function fX(t,e){1&t&&xa(0,0,["*ngSwitchCase","true"])}function gX(t,e){1&t&&(ra(0,"span",9),Jo(1,pX,2,1,"span",10),Jo(2,fX,1,0,"ng-content",11),sa()),2&t&&(na("ngSwitch",!!va().customTrigger),ws(2),na("ngSwitchCase",!0))}function mX(t,e){if(1&t){const t=ua();ra(0,"div",13),ra(1,"div",14,15),fa("@transformPanel.done",function(e){return $e(t),va()._panelDoneAnimatingStream.next(e.toState)})("keydown",function(e){return $e(t),va()._handleKeydown(e)}),xa(3,1),sa(),sa()}if(2&t){const t=va();na("@transformPanelWrap",void 0),ws(1),nl("mat-select-panel ",t._getPanelTheme(),""),La("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),na("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),Ko("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const bX=[[["mat-select-trigger"]],"*"],yX=["mat-select-trigger","*"],vX={transformPanelWrap:Vg("transformPanelWrap",[Wg("* => void",Xg("@transformPanel",[qg()],{optional:!0}))]),transformPanel:Vg("transformPanel",[$g("void",Hg({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),$g("showing",Hg({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),$g("showing-multiple",Hg({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Wg("void => *",zg("120ms cubic-bezier(0, 0, 0.2, 1)")),Wg("* => void",zg("100ms 25ms linear",Hg({opacity:0})))])};let _X=0;const wX=new oi("mat-select-scroll-strategy"),xX=new oi("MAT_SELECT_CONFIG"),SX={provide:wX,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};class EX{constructor(t,e){this.source=t,this.value=e}}const CX=Fy(By(Ly(Vy(class{constructor(t,e,n,i,r){this._elementRef=t,this._defaultErrorStateMatcher=e,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}})))),OX=new oi("MatSelectTrigger");let TX=(()=>{class t extends CX{constructor(t,e,n,i,r,s,o,a,l,c,u,h,d,p){var f,g,m;super(r,i,o,a,c),this._viewportRuler=t,this._changeDetectorRef=e,this._ngZone=n,this._dir=s,this._parentFormField=l,this._liveAnnouncer=d,this._defaultOptions=p,this._panelOpen=!1,this._compareWith=(t,e)=>t===e,this._uid="mat-select-"+_X++,this._triggerAriaLabelledBy=null,this._destroy=new P,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+_X++,this._panelDoneAnimatingStream=new P,this._overlayPanelClass=(null===(f=this._defaultOptions)||void 0===f?void 0:f.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(m=null===(g=this._defaultOptions)||void 0===g?void 0:g.disableOptionCentering)&&void 0!==m&&m,this.ariaLabel="",this.optionSelectionChanges=Iz(()=>{const t=this.options;return t?t.changes.pipe(Kd(t),Qd(()=>Q(...t.map(t=>t.onSelectionChange)))):this._ngZone.onStable.pipe(Gp(1),Qd(()=>this.optionSelectionChanges))}),this.openedChange=new Rc,this._openedStream=this.openedChange.pipe(Hd(t=>t),D(()=>{})),this._closedStream=this.openedChange.pipe(Hd(t=>!t),D(()=>{})),this.selectionChange=new Rc,this.valueChange=new Rc,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==p?void 0:p.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=p.typeaheadDebounceInterval),this._scrollStrategyFactory=h,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(u)||0,this.id=this.id}get focused(){return this._focused||this._panelOpen}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get required(){return this._required}set required(t){this._required=md(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=md(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=md(t)}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){(t!==this._value||this._multiple&&Array.isArray(t))&&(this.options&&this._setSelectionByValue(t),this._value=t)}get typeaheadDebounceInterval(){return this._typeaheadDebounceInterval}set typeaheadDebounceInterval(t){this._typeaheadDebounceInterval=bd(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new kp(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Rd(),Wd(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(Wd(this._destroy)).subscribe(t=>{t.added.forEach(t=>t.select()),t.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(Kd(null),Wd(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const e=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?e.setAttribute("aria-labelledby",t):e.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}ngOnChanges(t){t.disabled&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}ngOnDestroy(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}writeValue(t){this.value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){const t=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}_isRtl(){return!!this._dir&&"rtl"===this._dir.value}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){const e=t.keyCode,n=40===e||38===e||37===e||39===e,i=13===e||32===e,r=this._keyManager;if(!r.isTyping()&&i&&!Qp(t)||(this.multiple||t.altKey)&&n)t.preventDefault(),this.open();else if(!this.multiple){const e=this.selected;r.onKeydown(t);const n=this.selected;n&&e!==n&&this._liveAnnouncer.announce(n.viewValue,1e4)}}_handleOpenKeydown(t){const e=this._keyManager,n=t.keyCode,i=40===n||38===n,r=e.isTyping();if(i&&t.altKey)t.preventDefault(),this.close();else if(r||13!==n&&32!==n||!e.activeItem||Qp(t))if(!r&&this._multiple&&65===n&&t.ctrlKey){t.preventDefault();const e=this.options.some(t=>!t.disabled&&!t.selected);this.options.forEach(t=>{t.disabled||(e?t.select():t.deselect())})}else{const n=e.activeItemIndex;e.onKeydown(t),this._multiple&&i&&t.shiftKey&&e.activeItem&&e.activeItemIndex!==n&&e.activeItem._selectViaInteraction()}else t.preventDefault(),e.activeItem._selectViaInteraction()}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(Gp(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this._selectionModel.selected.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(t=>this._selectValue(t)),this._sortValues();else{const e=this._selectValue(t);e?this._keyManager.updateActiveItem(e):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const e=this.options.find(e=>{if(this._selectionModel.isSelected(e))return!1;try{return null!=e.value&&this._compareWith(e.value,t)}catch(n){return!1}});return e&&this._selectionModel.select(e),e}_initKeyManager(){this._keyManager=new fg(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(Wd(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(Wd(this._destroy)).subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){const t=Q(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Wd(t)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Q(...this.options.map(t=>t._stateChanges)).pipe(Wd(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,e){const n=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(n!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),e&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),e&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),n!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((e,n)=>this.sortComparator?this.sortComparator(e,n,t):t.indexOf(e)-t.indexOf(n)),this.stateChanges.next()}}_propagateChanges(t){let e=null;e=this.multiple?this.selected.map(t=>t.value):this.selected?this.selected.value:t,this._value=e,this.valueChange.emit(e),this._onChange(e),this.selectionChange.emit(this._getChangeEvent(e)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}_canOpen(){var t;return!this._panelOpen&&!this.disabled&&(null===(t=this.options)||void 0===t?void 0:t.length)>0}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){var t;if(this.ariaLabel)return null;const e=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(e?e+" ":"")+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const e=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let n=(e?e+" ":"")+this._valueId;return this.ariaLabelledby&&(n+=" "+this.ariaLabelledby),n}_panelDoneAnimating(t){this.openedChange.emit(t)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}return t.\u0275fac=function(e){return new(e||t)(ea(Ip),ea(tc),ea(xu),ea(zy),ea(kl),ea(Op,8),ea(_z,8),ea(Tz,8),ea(aU,8),ea(WV,10),ii("tabindex"),ea(wX),ea(kg),ea(xX,8))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(qc(uX,5),qc(hX,5),qc(Mf,5)),2&t){let t;Wc(t=Yc())&&(e.trigger=t.first),Wc(t=Yc())&&(e.panel=t.first),Wc(t=Yc())&&(e._overlayDir=t.first)}},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[jo,ye]}),t})(),kX=(()=>{class t extends TX{constructor(){super(...arguments),this._scrollTop=0,this._triggerFontSize=0,this._transformOrigin="top",this._offsetY=0,this._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}]}_calculateOverlayScroll(t,e,n){const i=this._getItemHeight();return Math.min(Math.max(0,i*t-e+i/2),n)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(Wd(this._destroy)).subscribe(()=>{this.panelOpen&&(this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._changeDetectorRef.markForCheck())})}open(){super._canOpen()&&(super.open(),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(Gp(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const e=lv(t,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===e?0:cv((t+e)*n,n,this.panel.nativeElement.scrollTop,256)}_positioningSettled(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}_panelDoneAnimating(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),super._panelDoneAnimating(t)}_getChangeEvent(t){return new EX(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),e=this._viewportRuler.getViewportSize(),n=this._isRtl(),i=this.multiple?56:32;let r;if(this.multiple)r=40;else if(this.disableOptionCentering)r=16;else{let t=this._selectionModel.selected[0]||this.options.first;r=t&&t.group?32:16}n||(r*=-1);const s=0-(t.left+r-(n?i:0)),o=t.right+r-e.width+(n?0:i);s>0?r+=s+8:o>0&&(r-=o+8),this._overlayDir.offsetX=Math.round(r),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,e,n){const i=this._getItemHeight(),r=(i-this._triggerRect.height)/2,s=Math.floor(256/i);let o;return this.disableOptionCentering?0:(o=0===this._scrollTop?t*i:this._scrollTop===n?(t-(this._getItemCount()-s))*i+(i-(this._getItemCount()*i-256)%i):e-i/2,Math.round(-1*o-r))}_checkOverlayWithinViewport(t){const e=this._getItemHeight(),n=this._viewportRuler.getViewportSize(),i=this._triggerRect.top-8,r=n.height-this._triggerRect.bottom-8,s=Math.abs(this._offsetY),o=Math.min(this._getItemCount()*e,256)-s-this._triggerRect.height;o>r?this._adjustPanelUp(o,r):s>i?this._adjustPanelDown(s,i,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,e){const n=Math.round(t-e);this._scrollTop-=n,this._offsetY-=n,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,e,n){const i=Math.round(t-e);if(this._scrollTop+=i,this._offsetY+=i,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=n)return this._scrollTop=n,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),e=this._getItemCount(),n=Math.min(e*t,256),i=e*t-n;let r;r=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),r+=lv(r,this.options,this.optionGroups);const s=n/2;this._scrollTop=this._calculateOverlayScroll(r,s,i),this._offsetY=this._calculateOverlayOffsetY(r,s,i),this._checkOverlayWithinViewport(i)}_getOriginBasedOnOption(){const t=this._getItemHeight(),e=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-e+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-select"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,OX,5),Xc(n,av,5),Xc(n,iv,5)),2&t){let t;Wc(t=Yc())&&(e.customTrigger=t.first),Wc(t=Yc())&&(e.options=t),Wc(t=Yc())&&(e.optionGroups=t)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,e){1&t&&fa("keydown",function(t){return e._handleKeydown(t)})("focus",function(){return e._onFocus()})("blur",function(){return e._onBlur()}),2&t&&(Ko("id",e.id)("tabindex",e.tabIndex)("aria-controls",e.panelOpen?e.id+"-panel":null)("aria-expanded",e.panelOpen)("aria-label",e.ariaLabel||null)("aria-required",e.required.toString())("aria-disabled",e.disabled.toString())("aria-invalid",e.errorState)("aria-describedby",e._ariaDescribedby||null)("aria-activedescendant",e._getAriaActiveDescendant()),ja("mat-select-disabled",e.disabled)("mat-select-invalid",e.errorState)("mat-select-required",e.required)("mat-select-empty",e.empty)("mat-select-multiple",e.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[_l([{provide:Qz,useExisting:t},{provide:Jy,useExisting:t}]),jo],ngContentSelectors:yX,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(t,e){if(1&t&&(wa(bX),ra(0,"div",0,1),fa("click",function(){return e.toggle()}),ra(3,"div",2),Jo(4,dX,2,1,"span",3),Jo(5,gX,3,2,"span",4),sa(),ra(6,"div",5),oa(7,"div",6),sa(),sa(),Jo(8,mX,4,14,"ng-template",7),fa("backdropClick",function(){return e.close()})("attach",function(){return e._onAttached()})("detach",function(){return e.close()})),2&t){const t=ta(1);Ko("aria-owns",e.panelOpen?e.id+"-panel":null),ws(3),na("ngSwitch",e.empty),Ko("id",e._valueId),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1),ws(3),na("cdkConnectedOverlayPanelClass",e._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",e._scrollStrategy)("cdkConnectedOverlayOrigin",t)("cdkConnectedOverlayOpen",e.panelOpen)("cdkConnectedOverlayPositions",e._positions)("cdkConnectedOverlayMinWidth",null==e._triggerRect?null:e._triggerRect.width)("cdkConnectedOverlayOffsetY",e._offsetY)}},directives:[If,Eh,Ch,Mf,Oh,mh],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[vX.transformPanelWrap,vX.transformPanel]},changeDetection:0}),t})(),AX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[SX],imports:[[Rh,Rf,uv,Ny],Mp,cU,uv,Ny]}),t})(),PX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,cU,AX]]}),t})();var IX=n(25430),MX=n(39053),DX=n(26202);const RX=["tooltipTemplate"],NX=["leftOuterSelectionBar"],LX=["rightOuterSelectionBar"],jX=["fullBar"],FX=["selectionBar"],BX=["minHandle"],VX=["maxHandle"],zX=["floorLabel"],UX=["ceilLabel"],HX=["minHandleLabel"],$X=["maxHandleLabel"],GX=["combinedLabel"],WX=["ticksElement"];function qX(t,e){if(1&t&&oa(0,"ng5-slider-tooltip-wrapper",31),2&t){const t=va().$implicit;na("template",va().tooltipTemplate)("tooltip",t.valueTooltip)("placement",t.valueTooltipPlacement)("content",t.value)}}function XX(t,e){1&t&&oa(0,"span",32),2&t&&na("innerHTML",va().$implicit.legend,vr)}const YX=function(t){return{"ng5-slider-selected":t}};function KX(t,e){if(1&t&&(ra(0,"span",27),oa(1,"ng5-slider-tooltip-wrapper",28),Jo(2,qX,1,4,"ng5-slider-tooltip-wrapper",29),Jo(3,XX,1,1,"span",30),sa()),2&t){const t=e.$implicit,n=va();na("ngClass",Tc(7,YX,t.selected))("ngStyle",t.style),ws(1),na("template",n.tooltipTemplate)("tooltip",t.tooltip)("placement",t.tooltipPlacement),ws(1),na("ngIf",null!=t.value),ws(1),na("ngIf",null!=t.legend)}}function QX(t,e){}function ZX(t,e){1&t&&Jo(0,QX,0,0,"ng-template")}const JX=function(t,e,n){return{tooltip:t,placement:e,content:n}};function tY(t,e){if(1&t&&(aa(0),Jo(1,ZX,1,0,void 0,1),la()),2&t){const t=va();ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",kc(2,JX,t.tooltip,t.placement,t.content))}}function eY(t,e){if(1&t&&(aa(0),ra(1,"div",2),Za(2),sa(),la()),2&t){const t=va();ws(1),Ko("title",t.tooltip)("data-tooltip-placement",t.placement),ws(1),tl(" ",t.content," ")}}const nY={Min:0,Max:1};nY[nY.Min]="Min",nY[nY.Max]="Max";const iY={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};iY[iY.Low]="Low",iY[iY.High]="High",iY[iY.Floor]="Floor",iY[iY.Ceil]="Ceil",iY[iY.TickValue]="TickValue";class rY{constructor(){this.floor=0,this.ceil=null,this.step=1,this.minRange=null,this.maxRange=null,this.pushRange=!1,this.minLimit=null,this.maxLimit=null,this.translate=null,this.combineLabels=null,this.getLegend=null,this.stepsArray=null,this.bindIndexForStepsArray=!1,this.draggableRange=!1,this.draggableRangeOnly=!1,this.showSelectionBar=!1,this.showSelectionBarEnd=!1,this.showSelectionBarFromValue=null,this.showOuterSelectionBars=!1,this.hidePointerLabels=!1,this.hideLimitLabels=!1,this.autoHideLimitLabels=!0,this.readOnly=!1,this.disabled=!1,this.mouseEventsInterval=50,this.touchEventsInterval=50,this.inputEventsInterval=100,this.outputEventsInterval=100,this.showTicks=!1,this.showTicksValues=!1,this.tickStep=null,this.tickValueStep=1,this.ticksArray=null,this.ticksTooltip=null,this.ticksValuesTooltip=null,this.vertical=!1,this.getSelectionBarColor=null,this.getTickColor=null,this.getPointerColor=null,this.keyboardSupport=!0,this.scale=1,this.enforceStep=!0,this.enforceRange=!0,this.noSwitching=!1,this.onlyBindHandles=!1,this.rightToLeft=!1,this.reversedControls=!1,this.boundPointerLabels=!0,this.logScale=!1,this.customValueToPosition=null,this.customPositionToValue=null,this.precisionLimit=12,this.selectionBarGradient=null,this.ariaLabel=null,this.ariaLabelledBy=null,this.ariaLabelHigh=null,this.ariaLabelledByHigh=null,this.handleDimension=null,this.barDimension=null,this.animate=!0}}class sY{}class oY{static isNullOrUndefined(t){return null==t}static linearValueToPosition(t,e,n){return(t-e)/(n-e)}static logValueToPosition(t,e,n){return((t=Math.log(t))-(e=Math.log(e)))/((n=Math.log(n))-e)}static linearPositionToValue(t,e,n){return t*(n-e)+e}static logPositionToValue(t,e,n){return e=Math.log(e),n=Math.log(n),Math.exp(t*(n-e)+e)}static findStepIndex(t,e){const n=e.map(e=>Math.abs(t-e.value));let i=0;for(let r=0;r{r.events.next(t)};return t.addEventListener(e,s,{passive:!0,capture:!1}),r.teardownCallback=()=>{t.removeEventListener(e,s,{passive:!0,capture:!1})},r.eventsSubscription=r.events.pipe(oY.isNullOrUndefined(i)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}detachEventListener(t){oY.isNullOrUndefined(t.eventsSubscription)||(t.eventsSubscription.unsubscribe(),t.eventsSubscription=null),oY.isNullOrUndefined(t.events)||(t.events.complete(),t.events=null),oY.isNullOrUndefined(t.teardownCallback)||(t.teardownCallback(),t.teardownCallback=null)}attachEventListener(t,e,n,i){const r=new cY;return r.eventName=e,r.events=new IX.xQ,r.teardownCallback=this.renderer.listen(t,e,t=>{r.events.next(t)}),r.eventsSubscription=r.events.pipe(oY.isNullOrUndefined(i)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}}let hY=(()=>{class t{constructor(t,e,n){this.elemRef=t,this.renderer=e,this.changeDetectionRef=n,this._position=0,this._dimension=0,this._alwaysHide=!1,this._vertical=!1,this._scale=1,this.opacity=1,this.visibility="visible",this.left="",this.bottom="",this.height="",this.width="",this.eventListeners=[],this.eventListenerHelper=new uY(this.renderer)}get position(){return this._position}get dimension(){return this._dimension}get alwaysHide(){return this._alwaysHide}get vertical(){return this._vertical}get scale(){return this._scale}setAlwaysHide(t){this._alwaysHide=t,this.visibility=t?"hidden":"visible"}hide(){this.opacity=0}show(){this.alwaysHide||(this.opacity=1)}isVisible(){return!this.alwaysHide&&0!==this.opacity}setVertical(t){this._vertical=t,this._vertical?(this.left="",this.width=""):(this.bottom="",this.height="")}setScale(t){this._scale=t}setPosition(t){this._position!==t&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._position=t,this._vertical?this.bottom=Math.round(t)+"px":this.left=Math.round(t)+"px"}calculateDimension(){const t=this.getBoundingClientRect();this._dimension=this.vertical?(t.bottom-t.top)*this.scale:(t.right-t.left)*this.scale}setDimension(t){this._dimension!==t&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._dimension=t,this._vertical?this.height=Math.round(t)+"px":this.width=Math.round(t)+"px"}getBoundingClientRect(){return this.elemRef.nativeElement.getBoundingClientRect()}on(t,e,n){const i=this.eventListenerHelper.attachEventListener(this.elemRef.nativeElement,t,e,n);this.eventListeners.push(i)}onPassive(t,e,n){const i=this.eventListenerHelper.attachPassiveEventListener(this.elemRef.nativeElement,t,e,n);this.eventListeners.push(i)}off(t){let e,n;oY.isNullOrUndefined(t)?(e=[],n=this.eventListeners):(e=this.eventListeners.filter(e=>e.eventName!==t),n=this.eventListeners.filter(e=>e.eventName===t));for(const i of n)this.eventListenerHelper.detachEventListener(i);this.eventListeners=e}isRefDestroyed(){return oY.isNullOrUndefined(this.changeDetectionRef)||this.changeDetectionRef.destroyed}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderElement",""]],hostVars:12,hostBindings:function(t,e){2&t&&La("opacity",e.opacity)("visibility",e.visibility)("left",e.left)("bottom",e.bottom)("height",e.height)("width",e.width)}}),t})(),dY=(()=>{class t extends hY{constructor(t,e,n){super(t,e,n),this.active=!1,this.role="",this.tabindex="",this.ariaOrientation="",this.ariaLabel="",this.ariaLabelledBy="",this.ariaValueNow="",this.ariaValueText="",this.ariaValueMin="",this.ariaValueMax=""}focus(){this.elemRef.nativeElement.focus()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderHandle",""]],hostVars:11,hostBindings:function(t,e){2&t&&(Ko("role",e.role)("tabindex",e.tabindex)("aria-orientation",e.ariaOrientation)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledBy)("aria-valuenow",e.ariaValueNow)("aria-valuetext",e.ariaValueText)("aria-valuemin",e.ariaValueMin)("aria-valuemax",e.ariaValueMax),ja("ng5-slider-active",e.active))},features:[jo]}),t})(),pY=(()=>{class t extends hY{constructor(t,e,n){super(t,e,n),this._value=null}get value(){return this._value}setValue(t){let e=!1;!this.alwaysHide&&(oY.isNullOrUndefined(this.value)||this.value.length!==t.length||this.value.length>0&&0===this.dimension)&&(e=!0),this._value=t,this.elemRef.nativeElement.innerHTML=t,e&&this.calculateDimension()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderLabel",""]],features:[jo]}),t})();class fY{constructor(){this.selected=!1,this.style={},this.tooltip=null,this.tooltipPlacement=null,this.value=null,this.valueTooltip=null,this.valueTooltipPlacement=null,this.legend=null}}class gY{constructor(){this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0}}class mY{static compare(t,e){return!(oY.isNullOrUndefined(t)&&oY.isNullOrUndefined(e)||oY.isNullOrUndefined(t)!==oY.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue}}class bY extends mY{static compare(t,e){return!(oY.isNullOrUndefined(t)&&oY.isNullOrUndefined(e)||oY.isNullOrUndefined(t)!==oY.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue&&t.forceChange===e.forceChange}}const yY={provide:EV,useExisting:pt(()=>vY),multi:!0};let vY=(()=>{class t{constructor(t,e,n,i){this.renderer=t,this.elementRef=e,this.changeDetectionRef=n,this.zone=i,this.value=null,this.valueChange=new Rc,this.highValue=null,this.highValueChange=new Rc,this.options=new rY,this.userChangeStart=new Rc,this.userChange=new Rc,this.userChangeEnd=new Rc,this.initHasRun=!1,this.inputModelChangeSubject=new IX.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new IX.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new rY,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new gY,this.sliderElementVerticalClass=!1,this.sliderElementAnimateClass=!1,this.sliderElementDisabledAttr=null,this.barStyle={},this.minPointerStyle={},this.maxPointerStyle={},this.fullBarTransparentClass=!1,this.selectionBarDraggableClass=!1,this.ticksUnderValuesClass=!1,this.intermediateTicks=!1,this.ticks=[],this.eventListenerHelper=null,this.onMoveEventListener=null,this.onEndEventListener=null,this.resizeObserver=null,this.onTouchedCallback=null,this.onChangeCallback=null,this.eventListenerHelper=new uY(this.renderer)}set manualRefresh(t){this.unsubscribeManualRefresh(),this.manualRefreshSubscription=t.subscribe(()=>{setTimeout(()=>this.calculateViewDimensionsAndDetectChanges())})}set triggerFocus(t){this.unsubscribeTriggerFocus(),this.triggerFocusSubscription=t.subscribe(t=>{this.focusPointer(t)})}get range(){return!oY.isNullOrUndefined(this.value)&&!oY.isNullOrUndefined(this.highValue)}get showTicks(){return this.viewOptions.showTicks}ngOnInit(){this.viewOptions=new rY,Object.assign(this.viewOptions,this.options),this.updateDisabledState(),this.updateVerticalState()}ngAfterViewInit(){this.applyOptions(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval),this.subscribeOutputModelChangeSubject(this.viewOptions.outputEventsInterval),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.updateVerticalState(),this.manageElementsStyle(),this.updateDisabledState(),this.calculateViewDimensions(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.initHandles(),this.manageEventsBindings(),this.subscribeResizeObserver(),this.initHasRun=!0,this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}ngOnChanges(t){oY.isNullOrUndefined(t.options)||this.onChangeOptions(),(!oY.isNullOrUndefined(t.value)||!oY.isNullOrUndefined(t.highValue))&&this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}ngOnDestroy(){this.unbindEvents(),this.unsubscribeResizeObserver(),this.unsubscribeInputModelChangeSubject(),this.unsubscribeOutputModelChangeSubject(),this.unsubscribeManualRefresh(),this.unsubscribeTriggerFocus()}writeValue(t){t instanceof Array?(this.value=t[0],this.highValue=t[1]):this.value=t,this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}registerOnChange(t){this.onChangeCallback=t}registerOnTouched(t){this.onTouchedCallback=t}setDisabledState(t){this.viewOptions.disabled=t,this.updateDisabledState()}onResize(t){this.calculateViewDimensionsAndDetectChanges()}subscribeInputModelChangeSubject(t){this.inputModelChangeSubscription=this.inputModelChangeSubject.pipe((0,MX.distinctUntilChanged)(bY.compare),(0,MX.filter)(t=>!t.forceChange&&!t.internalChange),oY.isNullOrUndefined(t)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.applyInputModelChange(t))}subscribeOutputModelChangeSubject(t){this.outputModelChangeSubscription=this.outputModelChangeSubject.pipe((0,MX.distinctUntilChanged)(bY.compare),oY.isNullOrUndefined(t)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.publishOutputModelChange(t))}subscribeResizeObserver(){aY.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(()=>this.calculateViewDimensionsAndDetectChanges()),this.resizeObserver.observe(this.elementRef.nativeElement))}unsubscribeResizeObserver(){aY.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}unsubscribeOnMove(){oY.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}unsubscribeOnEnd(){oY.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}unsubscribeInputModelChangeSubject(){oY.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}unsubscribeOutputModelChangeSubject(){oY.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}unsubscribeManualRefresh(){oY.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}unsubscribeTriggerFocus(){oY.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}getPointerElement(t){return t===nY.Min?this.minHandleElement:t===nY.Max?this.maxHandleElement:null}getCurrentTrackingValue(){return this.currentTrackingPointer===nY.Min?this.viewLowValue:this.currentTrackingPointer===nY.Max?this.viewHighValue:null}modelValueToViewValue(t){return oY.isNullOrUndefined(t)?NaN:oY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+t:oY.findStepIndex(+t,this.viewOptions.stepsArray)}viewValueToModelValue(t){return oY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?t:this.getStepValue(t)}getStepValue(t){const e=this.viewOptions.stepsArray[t];return oY.isNullOrUndefined(e)?NaN:e.value}applyViewChange(){this.value=this.viewValueToModelValue(this.viewLowValue),this.range&&(this.highValue=this.viewValueToModelValue(this.viewHighValue)),this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,userEventInitiated:!0,forceChange:!1}),this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!0})}applyInputModelChange(t){const e=this.normaliseModelValues(t),n=!mY.compare(t,e);n&&(this.value=e.value,this.highValue=e.highValue),this.viewLowValue=this.modelValueToViewValue(e.value),this.viewHighValue=this.range?this.modelValueToViewValue(e.highValue):null,this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCombinedLabel(),this.outputModelChangeSubject.next({value:e.value,highValue:e.highValue,forceChange:n,userEventInitiated:!1})}publishOutputModelChange(t){const e=()=>{this.valueChange.emit(t.value),this.range&&this.highValueChange.emit(t.highValue),oY.isNullOrUndefined(this.onChangeCallback)||this.onChangeCallback(this.range?[t.value,t.highValue]:t.value),oY.isNullOrUndefined(this.onTouchedCallback)||this.onTouchedCallback(this.range?[t.value,t.highValue]:t.value)};t.userEventInitiated?(e(),this.userChange.emit(this.getChangeContext())):setTimeout(()=>{e()})}normaliseModelValues(t){const e=new mY;if(e.value=t.value,e.highValue=t.highValue,this.viewOptions.enforceStep&&(e.value=this.roundStep(e.value),this.range&&(e.highValue=this.roundStep(e.highValue))),!oY.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return e;if(e.value=lY.clampToRange(e.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(e.highValue=lY.clampToRange(e.highValue,this.viewOptions.floor,this.viewOptions.ceil)),this.range&&t.value>t.highValue)if(this.viewOptions.noSwitching)e.value=e.highValue;else{const n=t.value;e.value=t.highValue,e.highValue=n}return e}renormaliseModelValues(){const t={value:this.value,highValue:this.highValue},e=this.normaliseModelValues(t);mY.compare(e,t)||(this.value=e.value,this.highValue=e.highValue,this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!0,userEventInitiated:!1}))}onChangeOptions(){if(!this.initHasRun)return;const t=this.viewOptions.inputEventsInterval,e=this.viewOptions.outputEventsInterval;this.applyOptions(),t!==this.viewOptions.inputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval)),e!==this.viewOptions.outputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.outputEventsInterval)),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.resetSlider()}applyOptions(){if(this.viewOptions=new rY,Object.assign(this.viewOptions,this.options),this.viewOptions.draggableRange=this.range&&this.viewOptions.draggableRange,this.viewOptions.draggableRangeOnly=this.range&&this.viewOptions.draggableRangeOnly,this.viewOptions.draggableRangeOnly&&(this.viewOptions.draggableRange=!0),this.viewOptions.showTicks=this.viewOptions.showTicks||this.viewOptions.showTicksValues||!oY.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!oY.isNullOrUndefined(this.viewOptions.tickStep)||!oY.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),oY.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),oY.isNullOrUndefined(this.viewOptions.combineLabels)&&(this.viewOptions.combineLabels=(t,e)=>t+" - "+e),this.viewOptions.logScale&&0===this.viewOptions.floor)throw Error("Can't use floor=0 with logarithmic scale")}applyStepsArrayOptions(){this.viewOptions.floor=0,this.viewOptions.ceil=this.viewOptions.stepsArray.length-1,this.viewOptions.step=1,oY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=t=>String(this.viewOptions.bindIndexForStepsArray?this.getStepValue(t):t)),this.viewOptions.getLegend=t=>this.viewOptions.stepsArray[t].legend}applyFloorCeilOptions(){if(oY.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),oY.isNullOrUndefined(this.viewOptions.ceil)||oY.isNullOrUndefined(this.viewOptions.floor))throw Error("floor and ceil options must be supplied");this.viewOptions.ceil=+this.viewOptions.ceil,this.viewOptions.floor=+this.viewOptions.floor,oY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=t=>String(t))}resetSlider(){this.manageElementsStyle(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.unbindEvents(),this.manageEventsBindings(),this.updateDisabledState(),this.calculateViewDimensions(),this.refocusPointerIfNeeded()}focusPointer(t){t!==nY.Min&&t!==nY.Max&&(t=nY.Min),t===nY.Min?this.minHandleElement.focus():this.range&&t===nY.Max&&this.maxHandleElement.focus()}refocusPointerIfNeeded(){oY.isNullOrUndefined(this.currentFocusPointer)||(this.onPointerFocus(this.currentFocusPointer),this.getPointerElement(this.currentFocusPointer).focus())}manageElementsStyle(){this.updateScale(),this.floorLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels),this.ceilLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels);const t=this.viewOptions.showTicksValues&&!this.intermediateTicks;this.minHandleLabelElement.setAlwaysHide(t||this.viewOptions.hidePointerLabels),this.maxHandleLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.combinedLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.selectionBarElement.setAlwaysHide(!this.range&&!this.viewOptions.showSelectionBar),this.leftOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.rightOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.fullBarTransparentClass=this.range&&this.viewOptions.showOuterSelectionBars,this.selectionBarDraggableClass=this.viewOptions.draggableRange&&!this.viewOptions.onlyBindHandles,this.ticksUnderValuesClass=this.intermediateTicks&&this.options.showTicksValues,this.sliderElementVerticalClass!==this.viewOptions.vertical&&(this.updateVerticalState(),setTimeout(()=>{this.resetSlider()})),this.sliderElementAnimateClass!==this.viewOptions.animate&&setTimeout(()=>{this.sliderElementAnimateClass=this.viewOptions.animate})}manageEventsBindings(){this.viewOptions.disabled||this.viewOptions.readOnly?this.unbindEvents():this.bindEvents()}updateDisabledState(){this.sliderElementDisabledAttr=this.viewOptions.disabled?"disabled":null}updateVerticalState(){this.sliderElementVerticalClass=this.viewOptions.vertical;for(const t of this.getAllSliderElements())oY.isNullOrUndefined(t)||t.setVertical(this.viewOptions.vertical)}updateScale(){for(const t of this.getAllSliderElements())t.setScale(this.viewOptions.scale)}getAllSliderElements(){return[this.leftOuterSelectionBarElement,this.rightOuterSelectionBarElement,this.fullBarElement,this.selectionBarElement,this.minHandleElement,this.maxHandleElement,this.floorLabelElement,this.ceilLabelElement,this.minHandleLabelElement,this.maxHandleLabelElement,this.combinedLabelElement,this.ticksElement]}initHandles(){this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.range&&this.updateCombinedLabel(),this.updateTicksScale()}addAccessibility(){this.updateAriaAttributes(),this.minHandleElement.role="slider",this.minHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.viewOptions.vertical&&(this.minHandleElement.ariaOrientation="vertical"),oY.isNullOrUndefined(this.viewOptions.ariaLabel)?oY.isNullOrUndefined(this.viewOptions.ariaLabelledBy)||(this.minHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledBy):this.minHandleElement.ariaLabel=this.viewOptions.ariaLabel,this.range&&(this.maxHandleElement.role="slider",this.maxHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.maxHandleElement.ariaOrientation=this.viewOptions.vertical?"vertical":"horizontal",oY.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?oY.isNullOrUndefined(this.viewOptions.ariaLabelledByHigh)||(this.maxHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledByHigh):this.maxHandleElement.ariaLabel=this.viewOptions.ariaLabelHigh)}updateAriaAttributes(){this.minHandleElement.ariaValueNow=(+this.value).toString(),this.minHandleElement.ariaValueText=this.viewOptions.translate(+this.value,iY.Low),this.minHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.minHandleElement.ariaValueMax=this.viewOptions.ceil.toString(),this.range&&(this.maxHandleElement.ariaValueNow=(+this.highValue).toString(),this.maxHandleElement.ariaValueText=this.viewOptions.translate(+this.highValue,iY.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}calculateViewDimensions(){oY.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);const t=this.minHandleElement.dimension;this.handleHalfDimension=t/2,oY.isNullOrUndefined(this.viewOptions.barDimension)?this.fullBarElement.calculateDimension():this.fullBarElement.setDimension(this.viewOptions.barDimension),this.maxHandlePosition=this.fullBarElement.dimension-t,this.initHasRun&&(this.updateFloorLabel(),this.updateCeilLabel(),this.initHandles())}calculateViewDimensionsAndDetectChanges(){this.calculateViewDimensions(),this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}isRefDestroyed(){return this.changeDetectionRef.destroyed}updateTicksScale(){if(!this.viewOptions.showTicks)return;const t=oY.isNullOrUndefined(this.viewOptions.ticksArray)?this.getTicksArray():this.viewOptions.ticksArray,e=this.viewOptions.vertical?"translateY":"translateX";this.viewOptions.rightToLeft&&t.reverse();const n=t.map(t=>{let n=this.valueToPosition(t);this.viewOptions.vertical&&(n=this.maxHandlePosition-n);const i=e+"("+Math.round(n)+"px)",r=new fY;if(r.selected=this.isTickSelected(t),r.style={"-webkit-transform":i,"-moz-transform":i,"-o-transform":i,"-ms-transform":i,transform:i},r.selected&&!oY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)&&(r.style["background-color"]=this.getSelectionBarColor()),!r.selected&&!oY.isNullOrUndefined(this.viewOptions.getTickColor)&&(r.style["background-color"]=this.getTickColor(t)),oY.isNullOrUndefined(this.viewOptions.ticksTooltip)||(r.tooltip=this.viewOptions.ticksTooltip(t),r.tooltipPlacement=this.viewOptions.vertical?"right":"top"),this.viewOptions.showTicksValues&&t%this.viewOptions.tickValueStep==0&&(r.value=this.getDisplayValue(t,iY.TickValue),oY.isNullOrUndefined(this.viewOptions.ticksValuesTooltip)||(r.valueTooltip=this.viewOptions.ticksValuesTooltip(t),r.valueTooltipPlacement=this.viewOptions.vertical?"right":"top")),!oY.isNullOrUndefined(this.viewOptions.getLegend)){const e=this.viewOptions.getLegend(t);oY.isNullOrUndefined(e)||(r.legend=e)}return r});if(oY.isNullOrUndefined(this.ticks)||this.ticks.length!==n.length)this.ticks=n;else for(let i=0;i=this.viewLowValue)return!0}else if(this.viewOptions.showSelectionBar&&t<=this.viewLowValue)return!0}else{const e=this.viewOptions.showSelectionBarFromValue;if(this.viewLowValue>e&&t>=e&&t<=this.viewLowValue)return!0;if(this.viewLowValue=this.viewLowValue)return!0}return!!(this.range&&t>=this.viewLowValue&&t<=this.viewHighValue)}updateFloorLabel(){this.floorLabelElement.alwaysHide||(this.floorLabelElement.setValue(this.getDisplayValue(this.viewOptions.floor,iY.Floor)),this.floorLabelElement.calculateDimension(),this.floorLabelElement.setPosition(this.viewOptions.rightToLeft?this.fullBarElement.dimension-this.floorLabelElement.dimension:0))}updateCeilLabel(){this.ceilLabelElement.alwaysHide||(this.ceilLabelElement.setValue(this.getDisplayValue(this.viewOptions.ceil,iY.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}updateHandles(t,e){t===nY.Min?this.updateLowHandle(e):t===nY.Max&&this.updateHighHandle(e),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}getHandleLabelPos(t,e){const n=t===nY.Min?this.minHandleLabelElement.dimension:this.maxHandleLabelElement.dimension,i=e-n/2+this.handleHalfDimension,r=this.fullBarElement.dimension-n;return this.viewOptions.boundPointerLabels?this.viewOptions.rightToLeft&&t===nY.Min||!this.viewOptions.rightToLeft&&t===nY.Max?Math.min(i,r):Math.min(Math.max(i,0),r):i}updateLowHandle(t){this.minHandleElement.setPosition(t),this.minHandleLabelElement.setValue(this.getDisplayValue(this.viewLowValue,iY.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(nY.Min,t)),oY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(nY.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateHighHandle(t){this.maxHandleElement.setPosition(t),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,iY.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(nY.Max,t)),oY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(nY.Max)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateFloorAndCeilLabelsVisibility(){if(this.viewOptions.hidePointerLabels)return;let t=!1,e=!1;const n=this.isLabelBelowFloorLabel(this.minHandleLabelElement),i=this.isLabelAboveCeilLabel(this.minHandleLabelElement),r=this.isLabelAboveCeilLabel(this.maxHandleLabelElement),s=this.isLabelBelowFloorLabel(this.combinedLabelElement),o=this.isLabelAboveCeilLabel(this.combinedLabelElement);if(n?(t=!0,this.floorLabelElement.hide()):(t=!1,this.floorLabelElement.show()),i?(e=!0,this.ceilLabelElement.hide()):(e=!1,this.ceilLabelElement.show()),this.range){const i=this.combinedLabelElement.isVisible()?o:r,a=this.combinedLabelElement.isVisible()?s:n;i?this.ceilLabelElement.hide():e||this.ceilLabelElement.show(),a?this.floorLabelElement.hide():t||this.floorLabelElement.show()}}isLabelBelowFloorLabel(t){const e=t.position,n=this.floorLabelElement.position;return this.viewOptions.rightToLeft?e+t.dimension>=n-2:e<=n+this.floorLabelElement.dimension+2}isLabelAboveCeilLabel(t){const e=t.position,n=this.ceilLabelElement.position;return this.viewOptions.rightToLeft?e<=n+this.ceilLabelElement.dimension+2:e+t.dimension>=n-2}updateSelectionBar(){let t=0,e=0;const n=this.viewOptions.rightToLeft?!this.viewOptions.showSelectionBarEnd:this.viewOptions.showSelectionBarEnd,i=this.viewOptions.rightToLeft?this.maxHandleElement.position+this.handleHalfDimension:this.minHandleElement.position+this.handleHalfDimension;if(this.range)e=Math.abs(this.maxHandleElement.position-this.minHandleElement.position),t=i;else if(oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue))n?(e=Math.ceil(Math.abs(this.maxHandlePosition-this.minHandleElement.position)+this.handleHalfDimension),t=Math.floor(this.minHandleElement.position+this.handleHalfDimension)):(e=this.minHandleElement.position+this.handleHalfDimension,t=0);else{const n=this.viewOptions.showSelectionBarFromValue,i=this.valueToPosition(n);(this.viewOptions.rightToLeft?this.viewLowValue<=n:this.viewLowValue>n)?(e=this.minHandleElement.position-i,t=i+this.handleHalfDimension):(e=i-this.minHandleElement.position,t=this.minHandleElement.position+this.handleHalfDimension)}if(this.selectionBarElement.setDimension(e),this.selectionBarElement.setPosition(t),this.range&&this.viewOptions.showOuterSelectionBars&&(this.viewOptions.rightToLeft?(this.rightOuterSelectionBarElement.setDimension(t),this.rightOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.leftOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(t+e)),this.leftOuterSelectionBarElement.setPosition(t+e)):(this.leftOuterSelectionBarElement.setDimension(t),this.leftOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.rightOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(t+e)),this.rightOuterSelectionBarElement.setPosition(t+e))),oY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!oY.isNullOrUndefined(this.viewOptions.selectionBarGradient)){const i=oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue)?0:this.valueToPosition(this.viewOptions.showSelectionBarFromValue),r=i-t>0&&!n||i-t<=0&&n;this.barStyle={backgroundImage:"linear-gradient(to "+(this.viewOptions.vertical?r?"bottom":"top":r?"left":"right")+", "+this.viewOptions.selectionBarGradient.from+" 0%,"+this.viewOptions.selectionBarGradient.to+" 100%)"},this.viewOptions.vertical?(this.barStyle.backgroundPosition="center "+(i+e+t+(r?-this.handleHalfDimension:0))+"px",this.barStyle.backgroundSize="100% "+(this.fullBarElement.dimension-this.handleHalfDimension)+"px"):(this.barStyle.backgroundPosition=i-t+(r?this.handleHalfDimension:0)+"px center",this.barStyle.backgroundSize=this.fullBarElement.dimension-this.handleHalfDimension+"px 100%")}}else{const t=this.getSelectionBarColor();this.barStyle={backgroundColor:t}}}getSelectionBarColor(){return this.range?this.viewOptions.getSelectionBarColor(this.value,this.highValue):this.viewOptions.getSelectionBarColor(this.value)}getPointerColor(t){return this.viewOptions.getPointerColor(t===nY.Max?this.highValue:this.value,t)}getTickColor(t){return this.viewOptions.getTickColor(t)}updateCombinedLabel(){let t=null;if(t=this.viewOptions.rightToLeft?this.minHandleLabelElement.position-this.minHandleLabelElement.dimension-10<=this.maxHandleLabelElement.position:this.minHandleLabelElement.position+this.minHandleLabelElement.dimension+10>=this.maxHandleLabelElement.position,t){const t=this.getDisplayValue(this.viewLowValue,iY.Low),e=this.getDisplayValue(this.viewHighValue,iY.High),n=this.viewOptions.rightToLeft?this.viewOptions.combineLabels(e,t):this.viewOptions.combineLabels(t,e);this.combinedLabelElement.setValue(n);const i=this.viewOptions.boundPointerLabels?Math.min(Math.max(this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2,0),this.fullBarElement.dimension-this.combinedLabelElement.dimension):this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2;this.combinedLabelElement.setPosition(i),this.minHandleLabelElement.hide(),this.maxHandleLabelElement.hide(),this.combinedLabelElement.show()}else this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.maxHandleLabelElement.show(),this.minHandleLabelElement.show(),this.combinedLabelElement.hide();this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}getDisplayValue(t,e){return!oY.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(t=this.getStepValue(t)),this.viewOptions.translate(t,e)}roundStep(t,e){const n=oY.isNullOrUndefined(e)?this.viewOptions.step:e;let i=lY.roundToPrecisionLimit((t-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,lY.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}valueToPosition(t){let e=oY.linearValueToPosition;oY.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(e=oY.logValueToPosition):e=this.viewOptions.customValueToPosition;let n=e(t=lY.clampToRange(t,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return oY.isNullOrUndefined(n)&&(n=0),this.viewOptions.rightToLeft&&(n=1-n),n*this.maxHandlePosition}positionToValue(t){let e=t/this.maxHandlePosition;this.viewOptions.rightToLeft&&(e=1-e);let n=oY.linearPositionToValue;oY.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=oY.logPositionToValue):n=this.viewOptions.customPositionToValue;const i=n(e,this.viewOptions.floor,this.viewOptions.ceil);return oY.isNullOrUndefined(i)?0:i}getEventXY(t,e){if(t instanceof MouseEvent)return this.viewOptions.vertical?t.clientY:t.clientX;let n=0;const i=t.touches;if(!oY.isNullOrUndefined(e))for(let r=0;ri?nY.Max:this.viewOptions.rightToLeft?e>this.minHandleElement.position?nY.Min:nY.Max:ethis.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.on("mousedown",e=>this.onBarStart(nY.Min,t,e,!0,!0)),this.maxHandleElement.on("mousedown",e=>this.onBarStart(nY.Max,t,e,!0,!0))):(this.minHandleElement.on("mousedown",t=>this.onStart(nY.Min,t,!0,!0)),this.range&&this.maxHandleElement.on("mousedown",t=>this.onStart(nY.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0,!0)))),this.viewOptions.onlyBindHandles||this.selectionBarElement.onPassive("touchstart",e=>this.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.onPassive("touchstart",e=>this.onBarStart(nY.Min,t,e,!0,!0)),this.maxHandleElement.onPassive("touchstart",e=>this.onBarStart(nY.Max,t,e,!0,!0))):(this.minHandleElement.onPassive("touchstart",t=>this.onStart(nY.Min,t,!0,!0)),this.range&&this.maxHandleElement.onPassive("touchstart",t=>this.onStart(nY.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.onPassive("touchstart",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.onPassive("touchstart",t=>this.onStart(null,t,!1,!1,!0,!0)))),this.viewOptions.keyboardSupport&&(this.minHandleElement.on("focus",()=>this.onPointerFocus(nY.Min)),this.range&&this.maxHandleElement.on("focus",()=>this.onPointerFocus(nY.Max)))}unbindEvents(){this.unsubscribeOnMove(),this.unsubscribeOnEnd();for(const t of this.getAllSliderElements())oY.isNullOrUndefined(t)||t.off()}onBarStart(t,e,n,i,r,s,o){e?this.onDragStart(t,n,i,r):this.onStart(t,n,i,r,s,o)}onStart(t,e,n,i,r,s){e.stopPropagation(),(!aY.isTouchEvent(e)||!DX.Z.hasSupport)&&e.preventDefault(),this.calculateViewDimensions(),oY.isNullOrUndefined(t)&&(t=this.getNearestHandle(e)),this.currentTrackingPointer=t;const o=this.getPointerElement(t);if(o.active=!0,this.viewOptions.keyboardSupport&&o.focus(),n){this.unsubscribeOnMove();const t=t=>this.dragging.active?this.onDragMove(t):this.onMove(t);this.onMoveEventListener=aY.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchmove",t,this.viewOptions.touchEventsInterval):this.eventListenerHelper.attachEventListener(document,"mousemove",t,this.viewOptions.mouseEventsInterval)}if(i){this.unsubscribeOnEnd();const t=t=>this.onEnd(t);this.onEndEventListener=aY.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchend",t):this.eventListenerHelper.attachEventListener(document,"mouseup",t)}this.userChangeStart.emit(this.getChangeContext()),aY.isTouchEvent(e)&&!oY.isNullOrUndefined(e.changedTouches)&&oY.isNullOrUndefined(this.touchId)&&(this.touchId=e.changedTouches[0].identifier),r&&this.onMove(e,!0),s&&this.onEnd(e)}onMove(t,e){let n=null;if(aY.isTouchEvent(t)){const e=t.changedTouches;for(let t=0;t=this.maxHandlePosition?r=this.viewOptions.rightToLeft?this.viewOptions.floor:this.viewOptions.ceil:(r=this.positionToValue(i),r=e&&!oY.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(r,this.viewOptions.tickStep):this.roundStep(r)),this.positionTrackingHandle(r)}onEnd(t){aY.isTouchEvent(t)&&t.changedTouches[0].identifier!==this.touchId||(this.touchId=null,this.viewOptions.keyboardSupport||(this.minHandleElement.active=!1,this.maxHandleElement.active=!1,this.currentTrackingPointer=null),this.dragging.active=!1,this.unsubscribeOnMove(),this.unsubscribeOnEnd(),this.userChangeEnd.emit(this.getChangeContext()))}onPointerFocus(t){const e=this.getPointerElement(t);e.on("blur",()=>this.onPointerBlur(e)),e.on("keydown",t=>this.onKeyboardEvent(t)),e.on("keyup",()=>this.onKeyUp()),e.active=!0,this.currentTrackingPointer=t,this.currentFocusPointer=t,this.firstKeyDown=!0}onKeyUp(){this.firstKeyDown=!0,this.userChangeEnd.emit(this.getChangeContext())}onPointerBlur(t){t.off("blur"),t.off("keydown"),t.off("keyup"),t.active=!1,oY.isNullOrUndefined(this.touchId)&&(this.currentTrackingPointer=null,this.currentFocusPointer=null)}getKeyActions(t){const e=this.viewOptions.ceil-this.viewOptions.floor;let n=t+this.viewOptions.step,i=t-this.viewOptions.step,r=t+e/10,s=t-e/10;this.viewOptions.reversedControls&&(n=t-this.viewOptions.step,i=t+this.viewOptions.step,r=t-e/10,s=t+e/10);const o={UP:n,DOWN:i,LEFT:i,RIGHT:n,PAGEUP:r,PAGEDOWN:s,HOME:this.viewOptions.reversedControls?this.viewOptions.ceil:this.viewOptions.floor,END:this.viewOptions.reversedControls?this.viewOptions.floor:this.viewOptions.ceil};return this.viewOptions.rightToLeft&&(o.LEFT=n,o.RIGHT=i,this.viewOptions.vertical&&(o.UP=i,o.DOWN=n)),o}onKeyboardEvent(t){const e=this.getCurrentTrackingValue(),n=oY.isNullOrUndefined(t.keyCode)?t.which:t.keyCode,i=this.getKeyActions(e)[{38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"}[n]];if(oY.isNullOrUndefined(i)||oY.isNullOrUndefined(this.currentTrackingPointer))return;t.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));const r=lY.clampToRange(i,this.viewOptions.floor,this.viewOptions.ceil),s=this.roundStep(r);if(this.viewOptions.draggableRangeOnly){const t=this.viewHighValue-this.viewLowValue;let e,n;this.currentTrackingPointer===nY.Min?(e=s,n=s+t,n>this.viewOptions.ceil&&(n=this.viewOptions.ceil,e=n-t)):this.currentTrackingPointer===nY.Max&&(n=s,e=s-t,e=this.maxHandlePosition-n;let a,l;if(e<=i){if(0===r.position)return;a=this.getMinValue(e,!0,!1),l=this.getMaxValue(e,!0,!1)}else if(o){if(s.position===this.maxHandlePosition)return;l=this.getMaxValue(e,!0,!0),a=this.getMinValue(e,!0,!0)}else a=this.getMinValue(e,!1,!1),l=this.getMaxValue(e,!1,!1);this.positionTrackingBar(a,l)}positionTrackingBar(t,e){!oY.isNullOrUndefined(this.viewOptions.minLimit)&&tthis.viewOptions.maxLimit&&(t=lY.roundToPrecisionLimit((e=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=t,this.viewHighValue=e,this.applyViewChange(),this.updateHandles(nY.Min,this.valueToPosition(t)),this.updateHandles(nY.Max,this.valueToPosition(e))}positionTrackingHandle(t){t=this.applyMinMaxLimit(t),this.range&&(this.viewOptions.pushRange?t=this.applyPushRange(t):(this.viewOptions.noSwitching&&(this.currentTrackingPointer===nY.Min&&t>this.viewHighValue?t=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===nY.Max&&tthis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(nY.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=nY.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===nY.Max&&tthis.viewOptions.maxLimit?this.viewOptions.maxLimit:t}applyMinMaxRange(t){const e=Math.abs(t-(this.currentTrackingPointer===nY.Min?this.viewHighValue:this.viewLowValue));if(!oY.isNullOrUndefined(this.viewOptions.minRange)&&ethis.viewOptions.maxRange){if(this.currentTrackingPointer===nY.Min)return lY.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===nY.Max)return lY.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return t}applyPushRange(t){const e=this.currentTrackingPointer===nY.Min?this.viewHighValue-t:t-this.viewLowValue,n=oY.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ei&&(this.currentTrackingPointer===nY.Min?(this.viewHighValue=lY.roundToPrecisionLimit(t+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(nY.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===nY.Max&&(this.viewLowValue=lY.roundToPrecisionLimit(t-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(nY.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),t}getChangeContext(){const t=new sY;return t.pointerType=this.currentTrackingPointer,t.value=+this.value,this.range&&(t.highValue=+this.highValue),t}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl),ea(tc),ea(xu))},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,RX,5),2&t){let t;Wc(t=Yc())&&(e.tooltipTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&(qc(NX,5,hY),qc(LX,5,hY),qc(jX,5,hY),qc(FX,5,hY),qc(BX,5,dY),qc(VX,5,dY),qc(zX,5,pY),qc(UX,5,pY),qc(HX,5,pY),qc($X,5,pY),qc(GX,5,pY),qc(WX,5,hY)),2&t){let t;Wc(t=Yc())&&(e.leftOuterSelectionBarElement=t.first),Wc(t=Yc())&&(e.rightOuterSelectionBarElement=t.first),Wc(t=Yc())&&(e.fullBarElement=t.first),Wc(t=Yc())&&(e.selectionBarElement=t.first),Wc(t=Yc())&&(e.minHandleElement=t.first),Wc(t=Yc())&&(e.maxHandleElement=t.first),Wc(t=Yc())&&(e.floorLabelElement=t.first),Wc(t=Yc())&&(e.ceilLabelElement=t.first),Wc(t=Yc())&&(e.minHandleLabelElement=t.first),Wc(t=Yc())&&(e.maxHandleLabelElement=t.first),Wc(t=Yc())&&(e.combinedLabelElement=t.first),Wc(t=Yc())&&(e.ticksElement=t.first)}},hostAttrs:[1,"ng5-slider"],hostVars:5,hostBindings:function(t,e){1&t&&fa("resize",function(t){return e.onResize(t)},!1,Pr),2&t&&(Ko("disabled",e.sliderElementDisabledAttr),ja("vertical",e.sliderElementVerticalClass)("animate",e.sliderElementAnimateClass))},inputs:{value:"value",highValue:"highValue",options:"options",manualRefresh:"manualRefresh",triggerFocus:"triggerFocus"},outputs:{valueChange:"valueChange",highValueChange:"highValueChange",userChangeStart:"userChangeStart",userChange:"userChange",userChangeEnd:"userChangeEnd"},features:[_l([yY]),ye],decls:29,vars:13,consts:[["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-left-out-selection"],["leftOuterSelectionBar",""],[1,"ng5-slider-span","ng5-slider-bar"],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-right-out-selection"],["rightOuterSelectionBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-full-bar"],["fullBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-selection-bar"],["selectionBar",""],[1,"ng5-slider-span","ng5-slider-bar","ng5-slider-selection",3,"ngStyle"],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-min",3,"ngStyle"],["minHandle",""],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-max",3,"ngStyle"],["maxHandle",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-floor"],["floorLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-ceil"],["ceilLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-value"],["minHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-high"],["maxHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-combined"],["combinedLabel",""],["ng5SliderElement","",1,"ng5-slider-ticks",3,"hidden"],["ticksElement",""],["class","ng5-slider-tick",3,"ngClass","ngStyle",4,"ngFor","ngForOf"],[1,"ng5-slider-tick",3,"ngClass","ngStyle"],[3,"template","tooltip","placement"],["class","ng5-slider-span ng5-slider-tick-value",3,"template","tooltip","placement","content",4,"ngIf"],["class","ng5-slider-span ng5-slider-tick-legend",3,"innerHTML",4,"ngIf"],[1,"ng5-slider-span","ng5-slider-tick-value",3,"template","tooltip","placement","content"],[1,"ng5-slider-span","ng5-slider-tick-legend",3,"innerHTML"]],template:function(t,e){1&t&&(ra(0,"span",0,1),oa(2,"span",2),sa(),ra(3,"span",3,4),oa(5,"span",2),sa(),ra(6,"span",5,6),oa(8,"span",2),sa(),ra(9,"span",7,8),oa(11,"span",9),sa(),oa(12,"span",10,11),oa(14,"span",12,13),oa(16,"span",14,15),oa(18,"span",16,17),oa(20,"span",18,19),oa(22,"span",20,21),oa(24,"span",22,23),ra(26,"span",24,25),Jo(28,KX,4,9,"span",26),sa()),2&t&&(ws(6),ja("ng5-slider-transparent",e.fullBarTransparentClass),ws(3),ja("ng5-slider-draggable",e.selectionBarDraggableClass),ws(2),na("ngStyle",e.barStyle),ws(1),na("ngStyle",e.minPointerStyle),ws(2),La("display",e.range?"inherit":"none"),na("ngStyle",e.maxPointerStyle),ws(12),ja("ng5-slider-ticks-values-under",e.ticksUnderValuesClass),na("hidden",!e.showTicks),ws(2),na("ngForOf",e.ticks))},directives:function(){return[hY,Th,dY,pY,yh,mh,_Y,_h]},styles:[".ng5-slider{display:inline-block;position:relative;height:4px;width:100%;margin:35px 0 15px;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y} .ng5-slider.with-legend{margin-bottom:40px} .ng5-slider[disabled]{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-pointer{cursor:not-allowed;background-color:#d8e0f3} .ng5-slider[disabled] .ng5-slider-draggable{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-selection{background:#8b91a2} .ng5-slider[disabled] .ng5-slider-tick{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-tick.ng5-slider-selected{background:#8b91a2} .ng5-slider .ng5-slider-span{white-space:nowrap;position:absolute;display:inline-block} .ng5-slider .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider .ng5-slider-bar-wrapper{left:0;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:-16px;padding-top:16px;width:100%;height:32px;z-index:1} .ng5-slider .ng5-slider-draggable{cursor:move} .ng5-slider .ng5-slider-bar{left:0;width:100%;height:4px;z-index:1;background:#d8e0f3;border-radius:2px} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-transparent .ng5-slider-bar{background:0 0} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-left-out-selection .ng5-slider-bar{background:#df002d} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-right-out-selection .ng5-slider-bar{background:#03a688} .ng5-slider .ng5-slider-selection{z-index:2;background:#0db9f0;border-radius:2px} .ng5-slider .ng5-slider-pointer{cursor:pointer;width:32px;height:32px;top:-14px;background-color:#0db9f0;z-index:3;border-radius:16px} .ng5-slider .ng5-slider-pointer:after{content:'';width:8px;height:8px;position:absolute;top:12px;left:12px;border-radius:4px;background:#fff} .ng5-slider .ng5-slider-pointer:hover:after{background-color:#fff} .ng5-slider .ng5-slider-pointer.ng5-slider-active{z-index:4} .ng5-slider .ng5-slider-pointer.ng5-slider-active:after{background-color:#451aff} .ng5-slider .ng5-slider-bubble{cursor:default;bottom:16px;padding:1px 3px;color:#55637d;font-size:16px} .ng5-slider .ng5-slider-bubble.ng5-slider-limit{color:#55637d} .ng5-slider .ng5-slider-ticks{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:0;position:absolute;left:0;top:-3px;margin:0;z-index:1;list-style:none} .ng5-slider .ng5-slider-ticks-values-under .ng5-slider-tick-value{top:auto;bottom:-36px} .ng5-slider .ng5-slider-tick{text-align:center;cursor:pointer;width:10px;height:10px;background:#d8e0f3;border-radius:50%;position:absolute;top:0;left:0;margin-left:11px} .ng5-slider .ng5-slider-tick.ng5-slider-selected{background:#0db9f0} .ng5-slider .ng5-slider-tick-value{position:absolute;top:-34px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0)} .ng5-slider .ng5-slider-tick-legend{position:absolute;top:24px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0);max-width:50px;white-space:normal} .ng5-slider.vertical{position:relative;width:4px;height:100%;margin:0 20px;padding:0;vertical-align:baseline;-ms-touch-action:pan-x;touch-action:pan-x} .ng5-slider.vertical .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider.vertical .ng5-slider-bar-wrapper{top:auto;left:0;margin:0 0 0 -16px;padding:0 0 0 16px;height:100%;width:32px} .ng5-slider.vertical .ng5-slider-bar{bottom:0;left:auto;width:4px;height:100%} .ng5-slider.vertical .ng5-slider-pointer{left:-14px!important;top:auto;bottom:0} .ng5-slider.vertical .ng5-slider-bubble{left:16px!important;bottom:0} .ng5-slider.vertical .ng5-slider-ticks{height:100%;width:0;left:-3px;top:0;z-index:1} .ng5-slider.vertical .ng5-slider-tick{vertical-align:middle;margin-left:auto;margin-top:11px} .ng5-slider.vertical .ng5-slider-tick-value{left:24px;top:auto;-webkit-transform:translate(0,-28%);transform:translate(0,-28%)} .ng5-slider.vertical .ng5-slider-tick-legend{top:auto;right:24px;-webkit-transform:translate(0,-28%);transform:translate(0,-28%);max-width:none;white-space:nowrap} .ng5-slider.vertical .ng5-slider-ticks-values-under .ng5-slider-tick-value{bottom:auto;left:auto;right:24px} .ng5-slider *{-webkit-transition:none;transition:none} .ng5-slider.animate .ng5-slider-bar-wrapper{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-selection{-webkit-transition:background-color linear .3s;transition:background-color linear .3s} .ng5-slider.animate .ng5-slider-pointer{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-limit{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-combined{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-tick{-webkit-transition:background-color linear .3s;transition:background-color linear .3s}"]}),t})(),_Y=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider-tooltip-wrapper"]],inputs:{template:"template",tooltip:"tooltip",placement:"placement",content:"content"},decls:2,vars:2,consts:[[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ng5-slider-inner-tooltip"]],template:function(t,e){1&t&&(Jo(0,tY,2,6,"ng-container",0),Jo(1,eY,3,3,"ng-container",0)),2&t&&(na("ngIf",e.template),ws(1),na("ngIf",!e.template))},directives:[_h,kh],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),t})(),wY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})(),xY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Rf,Hp,cU,AX,wY]]}),t})(),SY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,cX,PX,xY,x_,f_]]}),t})(),EY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,SY]]}),t})(),CY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Az,Pz,kU,cU,jU,f_]]}),t})();class OY extends class{constructor(){this.expansionModel=new kp(!0)}toggle(t){this.expansionModel.toggle(this._trackByValue(t))}expand(t){this.expansionModel.select(this._trackByValue(t))}collapse(t){this.expansionModel.deselect(this._trackByValue(t))}isExpanded(t){return this.expansionModel.isSelected(this._trackByValue(t))}toggleDescendants(t){this.expansionModel.isSelected(this._trackByValue(t))?this.collapseDescendants(t):this.expandDescendants(t)}collapseAll(){this.expansionModel.clear()}expandDescendants(t){let e=[t];e.push(...this.getDescendants(t)),this.expansionModel.select(...e.map(t=>this._trackByValue(t)))}collapseDescendants(t){let e=[t];e.push(...this.getDescendants(t)),this.expansionModel.deselect(...e.map(t=>this._trackByValue(t)))}_trackByValue(t){return this.trackBy?this.trackBy(t):t}}{constructor(t,e,n){super(),this.getLevel=t,this.isExpandable=e,this.options=n,this.options&&(this.trackBy=this.options.trackBy)}getDescendants(t){const e=[];for(let n=this.dataNodes.indexOf(t)+1;nthis._trackByValue(t)))}}const TY=new oi("CDK_TREE_NODE_OUTLET_NODE");let kY=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(TY,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeOutlet",""]]}),t})();class AY{constructor(t){this.$implicit=t}}let PY=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:["cdkTreeNodeDefWhen","when"]}}),t})(),IY=(()=>{class t{constructor(t,e){this._differs=t,this._changeDetectorRef=e,this._onDestroy=new P,this._levels=new Map,this.viewChange=new Uf({start:0,end:Number.MAX_VALUE})}get dataSource(){return this._dataSource}set dataSource(t){this._dataSource!==t&&this._switchDataSource(t)}ngOnInit(){this._dataDiffer=this._differs.find([]).create(this.trackBy)}ngOnDestroy(){this._nodeOutlet.viewContainer.clear(),this.viewChange.complete(),this._onDestroy.next(),this._onDestroy.complete(),this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null)}ngAfterContentChecked(){const t=this._nodeDefs.filter(t=>!t.when);this._defaultNodeDef=t[0],this.dataSource&&this._nodeDefs&&!this._dataSubscription&&this._observeRenderChanges()}_switchDataSource(t){this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null),t||this._nodeOutlet.viewContainer.clear(),this._dataSource=t,this._nodeDefs&&this._observeRenderChanges()}_observeRenderChanges(){let t;!function(t){return t&&"function"==typeof t.connect}(this._dataSource)?Dd(this._dataSource)?t=this._dataSource:Array.isArray(this._dataSource)&&(t=wd(this._dataSource)):t=this._dataSource.connect(this),t&&(this._dataSubscription=t.pipe(Wd(this._onDestroy)).subscribe(t=>this.renderNodeChanges(t)))}renderNodeChanges(t,e=this._dataDiffer,n=this._nodeOutlet.viewContainer,i){const r=e.diff(t);!r||(r.forEachOperation((e,r,s)=>{if(null==e.previousIndex)this.insertNode(t[s],s,n,i);else if(null==s)n.remove(r),this._levels.delete(e.item);else{const t=n.get(r);n.move(t,s)}}),this._changeDetectorRef.detectChanges())}_getNodeDef(t,e){return 1===this._nodeDefs.length?this._nodeDefs.first:this._nodeDefs.find(n=>n.when&&n.when(e,t))||this._defaultNodeDef}insertNode(t,e,n,i){const r=this._getNodeDef(t,e),s=new AY(t);s.level=this.treeControl.getLevel?this.treeControl.getLevel(t):void 0!==i&&this._levels.has(i)?this._levels.get(i)+1:0,this._levels.set(t,s.level),(n||this._nodeOutlet.viewContainer).createEmbeddedView(r.template,s,e),MY.mostRecentTreeNode&&(MY.mostRecentTreeNode.data=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(ql),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["cdk-tree"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,PY,5),2&t){let t;Wc(t=Yc())&&(e._nodeDefs=t)}},viewQuery:function(t,e){if(1&t&&qc(kY,7),2&t){let t;Wc(t=Yc())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"cdk-tree"],inputs:{dataSource:"dataSource",treeControl:"treeControl",trackBy:"trackBy"},exportAs:["cdkTree"],decls:1,vars:0,consts:[["cdkTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[kY],encapsulation:2}),t})(),MY=(()=>{class t{constructor(e,n){this._elementRef=e,this._tree=n,this._destroyed=new P,this._dataChanges=new P,t.mostRecentTreeNode=this,this._elementRef.nativeElement.classList.add("cdk-tree-node"),this.role="treeitem"}get role(){return"treeitem"}set role(t){this._elementRef.nativeElement.setAttribute("role",t)}get data(){return this._data}set data(t){t!==this._data&&(this._data=t,this._setRoleFromData(),this._dataChanges.next())}get isExpanded(){return this._tree.treeControl.isExpanded(this._data)}_setExpanded(t){this._isAriaExpanded=t,this._elementRef.nativeElement.setAttribute("aria-expanded",`${t}`)}get level(){return this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._data):this._parentNodeAriaLevel}ngOnInit(){this._parentNodeAriaLevel=function(t){let e=t.parentElement;for(;e&&!DY(e);)e=e.parentElement;return e?e.classList.contains("cdk-nested-tree-node")?bd(e.getAttribute("aria-level")):0:-1}(this._elementRef.nativeElement),this._elementRef.nativeElement.setAttribute("aria-level",`${this.level+1}`)}ngDoCheck(){this.isExpanded!=this._isAriaExpanded&&this._setExpanded(this.isExpanded)}ngOnDestroy(){t.mostRecentTreeNode===this&&(t.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}focus(){this._elementRef.nativeElement.focus()}_setRoleFromData(){this.role="treeitem"}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(IY))},t.\u0275dir=se({type:t,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),t.mostRecentTreeNode=null,t})();function DY(t){const e=t.classList;return!(!(null==e?void 0:e.contains("cdk-nested-tree-node"))&&!(null==e?void 0:e.contains("cdk-tree")))}const RY=/([A-Za-z%]+)$/;let NY=(()=>{class t{constructor(t,e,n,i){this._treeNode=t,this._tree=e,this._element=n,this._dir=i,this._destroyed=new P,this.indentUnits="px",this._indent=40,this._setPadding(),i&&i.change.pipe(Wd(this._destroyed)).subscribe(()=>this._setPadding(!0)),t._dataChanges.subscribe(()=>this._setPadding())}get level(){return this._level}set level(t){this._setLevelInput(t)}get indent(){return this._indent}set indent(t){this._setIndentInput(t)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_paddingIndent(){const t=this._treeNode.data&&this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._treeNode.data):null,e=null==this._level?t:this._level;return"number"==typeof e?`${e*this._indent}${this.indentUnits}`:null}_setPadding(t=!1){const e=this._paddingIndent();if(e!==this._currentPadding||t){const t=this._element.nativeElement,n=this._dir&&"rtl"===this._dir.value?"paddingRight":"paddingLeft",i="paddingLeft"===n?"paddingRight":"paddingLeft";t.style[n]=e||"",t.style[i]="",this._currentPadding=e}}_setLevelInput(t){this._level=bd(t,null),this._setPadding()}_setIndentInput(t){let e=t,n="px";if("string"==typeof t){const i=t.split(RY);e=i[0],n=i[1]||n}this.indentUnits=n,this._indent=bd(e),this._setPadding()}}return t.\u0275fac=function(e){return new(e||t)(ea(MY),ea(IY),ea(kl),ea(Op,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),t})(),LY=(()=>{class t{constructor(t,e){this._tree=t,this._treeNode=e,this._recursive=!1}get recursive(){return this._recursive}set recursive(t){this._recursive=md(t)}_toggle(t){this.recursive?this._tree.treeControl.toggleDescendants(this._treeNode.data):this._tree.treeControl.toggle(this._treeNode.data),t.stopPropagation()}}return t.\u0275fac=function(e){return new(e||t)(ea(IY),ea(MY))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeToggle",""]],hostBindings:function(t,e){1&t&&fa("click",function(t){return e._toggle(t)})},inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]}}),t})(),jY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const FY=By(Ly(MY));let BY=(()=>{class t extends FY{constructor(t,e,n){super(t,e),this.tabIndex=Number(n)||0,t.nativeElement.classList.add("mat-tree-node")}ngOnInit(){super.ngOnInit()}ngDoCheck(){super.ngDoCheck()}ngOnDestroy(){super.ngOnDestroy()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(IY),ii("tabindex"))},t.\u0275dir=se({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[_l([{provide:MY,useExisting:t}]),jo]}),t})(),VY=(()=>{class t extends PY{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodeDef",""]],inputs:{when:["matTreeNodeDefWhen","when"],data:["matTreeNode","data"]},features:[_l([{provide:PY,useExisting:t}]),jo]}),t})(),zY=(()=>{class t extends NY{get level(){return this._level}set level(t){this._setLevelInput(t)}get indent(){return this._indent}set indent(t){this._setIndentInput(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodePadding",""]],inputs:{level:["matTreeNodePadding","level"],indent:["matTreeNodePaddingIndent","indent"]},features:[_l([{provide:NY,useExisting:t}]),jo]}),t})(),UY=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(TY,8))},t.\u0275dir=se({type:t,selectors:[["","matTreeNodeOutlet",""]],features:[_l([{provide:kY,useExisting:t}])]}),t})(),HY=(()=>{class t extends IY{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-tree"]],viewQuery:function(t,e){if(1&t&&qc(UY,7),2&t){let t;Wc(t=Yc())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[_l([{provide:IY,useExisting:t}]),jo],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[UY],styles:[".mat-tree{display:block}.mat-tree-node{display:flex;align-items:center;flex:1;word-wrap:break-word}.mat-nested-tree-node{border-bottom-width:0}\n"],encapsulation:2}),t})(),$Y=(()=>{class t extends LY{get recursive(){return this._recursive}set recursive(t){this._recursive=md(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodeToggle",""]],inputs:{recursive:["matTreeNodeToggleRecursive","recursive"]},features:[_l([{provide:LY,useExisting:t}]),jo]}),t})(),GY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[jY,Ny],Ny]}),t})();class WY{constructor(t,e,n,i){this.transformFunction=t,this.getLevel=e,this.isExpandable=n,this.getChildren=i}_flattenNode(t,e,n,i){const r=this.transformFunction(t,e);if(n.push(r),this.isExpandable(r)){const r=this.getChildren(t);r&&(Array.isArray(r)?this._flattenChildren(r,e,n,i):r.pipe(Gp(1)).subscribe(t=>{this._flattenChildren(t,e,n,i)}))}return n}_flattenChildren(t,e,n,i){t.forEach((r,s)=>{let o=i.slice();o.push(s!=t.length-1),this._flattenNode(r,e+1,n,o)})}flattenNodes(t){let e=[];return t.forEach(t=>this._flattenNode(t,0,e,[])),e}expandFlattenedNodes(t,e){let n=[],i=[];return i[0]=!0,t.forEach(t=>{let r=!0;for(let e=0;e<=this.getLevel(t);e++)r=r&&i[e];r&&n.push(t),this.isExpandable(t)&&(i[this.getLevel(t)+1]=e.isExpanded(t))}),n}}class qY extends class{}{constructor(t,e,n){super(),this._treeControl=t,this._treeFlattener=e,this._flattenedData=new Uf([]),this._expandedData=new Uf([]),this._data=new Uf([]),n&&(this.data=n)}get data(){return this._data.value}set data(t){this._data.next(t),this._flattenedData.next(this._treeFlattener.flattenNodes(this.data)),this._treeControl.dataNodes=this._flattenedData.value}connect(t){return Q(t.viewChange,this._treeControl.expansionModel.changed,this._flattenedData).pipe(D(()=>(this._expandedData.next(this._treeFlattener.expandFlattenedNodes(this._flattenedData.value,this._treeControl)),this._expandedData.value)))}disconnect(){}}let XY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,rw,GY,fG]]}),t})(),YY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,CY,XY]]}),t})(),KY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,CY,XY,YY],CY,XY,YY]}),t})();function QY(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function ZY(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(e).forEach(function(n){void 0===t[n]?t[n]=e[n]:QY(e[n])&&QY(t[n])&&Object.keys(e[n]).length>0&&ZY(t[n],e[n])})}var JY={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function tK(){var t="undefined"!=typeof document?document:{};return ZY(t,JY),t}var eK={document:JY,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(t){return"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0)},cancelAnimationFrame:function(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function nK(){var t="undefined"!=typeof window?window:{};return ZY(t,eK),t}function iK(t){return(iK=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rK(t,e){return(rK=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function sK(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(m){return!1}}function oK(t,e,n){return(oK=sK()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&rK(r,n.prototype),r}).apply(null,arguments)}function aK(t){var e="function"==typeof Map?new Map:void 0;return(aK=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return oK(t,arguments,iK(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),rK(n,t)})(t)}var lK=function(t){function e(e){var n;return function(t){var e=t.__proto__;Object.defineProperty(t,"__proto__",{get:function(){return e},set:function(t){e.__proto__=t}})}(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n=t.call.apply(t,[this].concat(e))||this)),n}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t),e}(aK(Array));function cK(t){void 0===t&&(t=[]);var e=[];return t.forEach(function(t){Array.isArray(t)?e.push.apply(e,cK(t)):e.push(t)}),e}function uK(t,e){return Array.prototype.filter.call(t,e)}function hK(t,e){var n=nK(),i=tK(),r=[];if(!e&&t instanceof lK)return t;if(!t)return new lK(r);if("string"==typeof t){var s=t.trim();if(s.indexOf("<")>=0&&s.indexOf(">")>=0){var o="div";0===s.indexOf("0}).length>0},toggleClass:function(){for(var t=arguments.length,e=new Array(t),n=0;n=0;p-=1){var f=d[p];s&&f.listener===s||s&&f.listener&&f.listener.dom7proxy&&f.listener.dom7proxy===s?(h.removeEventListener(c,f.proxyListener,o),d.splice(p,1)):s||(h.removeEventListener(c,f.proxyListener,o),d.splice(p,1))}}return this},trigger:function(){for(var t=nK(),e=arguments.length,n=new Array(e),i=0;i0}),c.dispatchEvent(u),c.dom7EventData=[],delete c.dom7EventData}}return this},transitionEnd:function(t){var e=this;return t&&e.on("transitionend",function n(i){i.target===this&&(t.call(this,i),e.off("transitionend",n))}),this},outerWidth:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetWidth+parseFloat(e.getPropertyValue("margin-right"))+parseFloat(e.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetHeight+parseFloat(e.getPropertyValue("margin-top"))+parseFloat(e.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},styles:function(){var t=nK();return this[0]?t.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var t=nK(),e=tK(),n=this[0],i=n.getBoundingClientRect(),r=e.body;return{top:i.top+(n===t?t.scrollY:n.scrollTop)-(n.clientTop||r.clientTop||0),left:i.left+(n===t?t.scrollX:n.scrollLeft)-(n.clientLeft||r.clientLeft||0)}}return null},css:function(t,e){var n,i=nK();if(1===arguments.length){if("string"!=typeof t){for(n=0;ne-1)return hK([]);if(t<0){var n=e+t;return hK(n<0?[]:[this[n]])}return hK([this[t]])},append:function(){for(var t,e=tK(),n=0;n=0;n-=1)this[e].insertBefore(r.childNodes[n],this[e].childNodes[0])}else if(t instanceof lK)for(n=0;n0?t?this[0].nextElementSibling&&hK(this[0].nextElementSibling).is(t)?hK([this[0].nextElementSibling]):hK([]):hK(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):hK([])},nextAll:function(t){var e=[],n=this[0];if(!n)return hK([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;t?hK(i).is(t)&&e.push(i):e.push(i),n=i}return hK(e)},prev:function(t){if(this.length>0){var e=this[0];return t?e.previousElementSibling&&hK(e.previousElementSibling).is(t)?hK([e.previousElementSibling]):hK([]):hK(e.previousElementSibling?[e.previousElementSibling]:[])}return hK([])},prevAll:function(t){var e=[],n=this[0];if(!n)return hK([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;t?hK(i).is(t)&&e.push(i):e.push(i),n=i}return hK(e)},parent:function(t){for(var e=[],n=0;n=0,observer:"MutationObserver"in t||"WebkitMutationObserver"in t,passiveListener:function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});t.addEventListener("testPassiveListener",null,n)}catch(i){}return e}(),gestures:"ongesturestart"in t}}()),gK}function OK(t){return void 0===t&&(t={}),mK||(mK=function(t){var e=(void 0===t?{}:t).userAgent,n=CK(),i=nK(),r=i.navigator.platform,s=e||i.navigator.userAgent,o={ios:!1,android:!1},a=i.screen.width,l=i.screen.height,c=s.match(/(Android);?[\s\/]+([\d.]+)?/),u=s.match(/(iPad).*OS\s([\d_]+)/),h=s.match(/(iPod)(.*OS\s([\d_]+))?/),d=!u&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),p="Win32"===r,f="MacIntel"===r;return!u&&f&&n.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(a+"x"+l)>=0&&((u=s.match(/(Version)\/([\d.]+)/))||(u=[0,1,"13_0_0"]),f=!1),c&&!p&&(o.os="android",o.android=!0),(u||d||h)&&(o.os="ios",o.ios=!0),o}(t)),mK}function TK(){return bK||(bK=function(){var t,e=nK();return{isEdge:!!e.navigator.userAgent.match(/Edge/g),isSafari:(t=e.navigator.userAgent.toLowerCase(),t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0),isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),bK}var kK={name:"resize",create:function(){var t=this;SK(t,{resize:{observer:null,createObserver:function(){!t||t.destroyed||!t.initialized||(t.resize.observer=new ResizeObserver(function(e){var n=t.width,i=t.height,r=n,s=i;e.forEach(function(e){var n=e.contentBoxSize,i=e.contentRect,o=e.target;o&&o!==t.el||(r=i?i.width:(n[0]||n).inlineSize,s=i?i.height:(n[0]||n).blockSize)}),(r!==n||s!==i)&&t.resize.resizeHandler()}),t.resize.observer.observe(t.el))},removeObserver:function(){t.resize.observer&&t.resize.observer.unobserve&&t.el&&(t.resize.observer.unobserve(t.el),t.resize.observer=null)},resizeHandler:function(){!t||t.destroyed||!t.initialized||(t.emit("beforeResize"),t.emit("resize"))},orientationChangeHandler:function(){!t||t.destroyed||!t.initialized||t.emit("orientationchange")}}})},on:{init:function(t){var e=nK();t.params.resizeObserver&&void 0!==nK().ResizeObserver?t.resize.createObserver():(e.addEventListener("resize",t.resize.resizeHandler),e.addEventListener("orientationchange",t.resize.orientationChangeHandler))},destroy:function(t){var e=nK();t.resize.removeObserver(),e.removeEventListener("resize",t.resize.resizeHandler),e.removeEventListener("orientationchange",t.resize.orientationChangeHandler)}}};function AK(){return(AK=Object.assign||function(t){for(var e=1;e0)&&(!r.isTouched||!r.isMoved))){s.noSwipingClass&&""!==s.noSwipingClass&&a.target&&a.target.shadowRoot&&t.path&&t.path[0]&&(l=yK(t.path[0]));var c=s.noSwipingSelector?s.noSwipingSelector:"."+s.noSwipingClass;if(s.noSwiping&&(a.target&&a.target.shadowRoot?function(t,e){return void 0===e&&(e=this),function e(n){return n&&n!==tK()&&n!==nK()?(n.assignedSlot&&(n=n.assignedSlot),n.closest(t)||e(n.getRootNode().host)):null}(e)}(c,a.target):l.closest(c)[0]))return void(e.allowClick=!0);if(!s.swipeHandler||l.closest(s.swipeHandler)[0]){o.currentX="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,o.currentY="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY;var u=o.currentX,h=o.currentY,d=s.edgeSwipeDetection||s.iOSEdgeSwipeDetection,p=s.edgeSwipeThreshold||s.iOSEdgeSwipeThreshold;if(d&&(u<=p||u>=i.innerWidth-p)){if("prevent"!==d)return;t.preventDefault()}if(SK(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=u,o.startY=h,r.touchStartTime=_K(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,s.threshold>0&&(r.allowThresholdMove=!1),"touchstart"!==a.type){var f=!0;l.is(r.focusableElements)&&(f=!1),n.activeElement&&yK(n.activeElement).is(r.focusableElements)&&n.activeElement!==l[0]&&n.activeElement.blur(),(s.touchStartForcePreventDefault||f&&e.allowTouchMove&&s.touchStartPreventDefault)&&!l[0].isContentEditable&&a.preventDefault()}e.emit("touchStart",a)}}}}function DK(t){var e=tK(),n=this,i=n.touchEventsData,r=n.params,s=n.touches,o=n.rtlTranslate;if(n.enabled){var a=t;if(a.originalEvent&&(a=a.originalEvent),!i.isTouched)return void(i.startMoving&&i.isScrolling&&n.emit("touchMoveOpposite",a));if(!i.isTouchEvent||"touchmove"===a.type){var l="touchmove"===a.type&&a.targetTouches&&(a.targetTouches[0]||a.changedTouches[0]),c="touchmove"===a.type?l.pageX:a.pageX,u="touchmove"===a.type?l.pageY:a.pageY;if(a.preventedByNestedSwiper)return s.startX=c,void(s.startY=u);if(!n.allowTouchMove)return n.allowClick=!1,void(i.isTouched&&(SK(s,{startX:c,startY:u,currentX:c,currentY:u}),i.touchStartTime=_K()));if(i.isTouchEvent&&r.touchReleaseOnEdges&&!r.loop)if(n.isVertical()){if(us.startY&&n.translate>=n.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(cs.startX&&n.translate>=n.minTranslate())return;if(i.isTouchEvent&&e.activeElement&&a.target===e.activeElement&&yK(a.target).is(i.focusableElements))return i.isMoved=!0,void(n.allowClick=!1);if(i.allowTouchCallbacks&&n.emit("touchMove",a),!(a.targetTouches&&a.targetTouches.length>1)){s.currentX=c,s.currentY=u;var h=s.currentX-s.startX,d=s.currentY-s.startY;if(!(n.params.threshold&&Math.sqrt(Math.pow(h,2)+Math.pow(d,2))=25&&(p=180*Math.atan2(Math.abs(d),Math.abs(h))/Math.PI,i.isScrolling=n.isHorizontal()?p>r.touchAngle:90-p>r.touchAngle)),i.isScrolling&&n.emit("touchMoveOpposite",a),void 0===i.startMoving&&(s.currentX!==s.startX||s.currentY!==s.startY)&&(i.startMoving=!0),i.isScrolling)return void(i.isTouched=!1);if(i.startMoving){n.allowClick=!1,!r.cssMode&&a.cancelable&&a.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&a.stopPropagation(),i.isMoved||(r.loop&&n.loopFix(),i.startTranslate=n.getTranslate(),n.setTransition(0),n.animating&&n.$wrapperEl.trigger("webkitTransitionEnd transitionend"),i.allowMomentumBounce=!1,r.grabCursor&&(!0===n.allowSlideNext||!0===n.allowSlidePrev)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",a)),n.emit("sliderMove",a),i.isMoved=!0;var f=n.isHorizontal()?h:d;s.diff=f,f*=r.touchRatio,o&&(f=-f),n.swipeDirection=f>0?"prev":"next",i.currentTranslate=f+i.startTranslate;var g=!0,m=r.resistanceRatio;if(r.touchReleaseOnEdges&&(m=0),f>0&&i.currentTranslate>n.minTranslate()?(g=!1,r.resistance&&(i.currentTranslate=n.minTranslate()-1+Math.pow(-n.minTranslate()+i.startTranslate+f,m))):f<0&&i.currentTranslatei.startTranslate&&(i.currentTranslate=i.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(f)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,i.currentTranslate=i.startTranslate,void(s.diff=n.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}!r.followFinger||r.cssMode||((r.freeMode||r.watchSlidesProgress||r.watchSlidesVisibility)&&(n.updateActiveIndex(),n.updateSlidesClasses()),r.freeMode&&(0===i.velocities.length&&i.velocities.push({position:s[n.isHorizontal()?"startX":"startY"],time:i.touchStartTime}),i.velocities.push({position:s[n.isHorizontal()?"currentX":"currentY"],time:_K()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function RK(t){var e=this,n=e.touchEventsData,i=e.params,r=e.touches,s=e.rtlTranslate,o=e.$wrapperEl,a=e.slidesGrid,l=e.snapGrid;if(e.enabled){var c=t;if(c.originalEvent&&(c=c.originalEvent),n.allowTouchCallbacks&&e.emit("touchEnd",c),n.allowTouchCallbacks=!1,!n.isTouched)return n.isMoved&&i.grabCursor&&e.setGrabCursor(!1),n.isMoved=!1,void(n.startMoving=!1);i.grabCursor&&n.isMoved&&n.isTouched&&(!0===e.allowSlideNext||!0===e.allowSlidePrev)&&e.setGrabCursor(!1);var u,h=_K(),d=h-n.touchStartTime;if(e.allowClick&&(e.updateClickedSlide(c),e.emit("tap click",c),d<300&&h-n.lastClickTime<300&&e.emit("doubleTap doubleClick",c)),n.lastClickTime=_K(),vK(function(){e.destroyed||(e.allowClick=!0)}),!n.isTouched||!n.isMoved||!e.swipeDirection||0===r.diff||n.currentTranslate===n.startTranslate)return n.isTouched=!1,n.isMoved=!1,void(n.startMoving=!1);if(n.isTouched=!1,n.isMoved=!1,n.startMoving=!1,u=i.followFinger?s?e.translate:-e.translate:-n.currentTranslate,!i.cssMode){if(i.freeMode){if(u<-e.minTranslate())return void e.slideTo(e.activeIndex);if(u>-e.maxTranslate())return void e.slideTo(e.slides.length1){var p=n.velocities.pop(),f=n.velocities.pop(),g=p.time-f.time;e.velocity=(p.position-f.position)/g,e.velocity/=2,Math.abs(e.velocity)150||_K()-p.time>300)&&(e.velocity=0)}else e.velocity=0;e.velocity*=i.freeModeMomentumVelocityRatio,n.velocities.length=0;var m=1e3*i.freeModeMomentumRatio,b=e.translate+e.velocity*m;s&&(b=-b);var y,v,_=!1,w=20*Math.abs(e.velocity)*i.freeModeMomentumBounceRatio;if(be.minTranslate())i.freeModeMomentumBounce?(b-e.minTranslate()>w&&(b=e.minTranslate()+w),y=e.minTranslate(),_=!0,n.allowMomentumBounce=!0):b=e.minTranslate(),i.loop&&i.centeredSlides&&(v=!0);else if(i.freeModeSticky){for(var x,S=0;S-b){x=S;break}b=-(b=Math.abs(l[x]-b)=i.longSwipesMs)&&(e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses()))}for(var O=0,T=e.slidesSizesGrid[0],k=0;k=a[k]&&u=a[k]&&(O=k,T=a[a.length-1]-a[a.length-2])}var P=(u-a[O])/T,I=Oi.longSwipesMs){if(!i.longSwipes)return void e.slideTo(e.activeIndex);"next"===e.swipeDirection&&e.slideTo(P>=i.longSwipesRatio?O+I:O),"prev"===e.swipeDirection&&e.slideTo(P>1-i.longSwipesRatio?O+I:O)}else{if(!i.shortSwipes)return void e.slideTo(e.activeIndex);!e.navigation||c.target!==e.navigation.nextEl&&c.target!==e.navigation.prevEl?("next"===e.swipeDirection&&e.slideTo(O+I),"prev"===e.swipeDirection&&e.slideTo(O)):e.slideTo(c.target===e.navigation.nextEl?O+I:O)}}}}function NK(){var t=this,e=t.params,n=t.el;if(!n||0!==n.offsetWidth){e.breakpoints&&t.setBreakpoint();var i=t.allowSlideNext,r=t.allowSlidePrev,s=t.snapGrid;t.allowSlideNext=!0,t.allowSlidePrev=!0,t.updateSize(),t.updateSlides(),t.updateSlidesClasses(),t.slideTo(("auto"===e.slidesPerView||e.slidesPerView>1)&&t.isEnd&&!t.isBeginning&&!t.params.centeredSlides?t.slides.length-1:t.activeIndex,0,!1,!0),t.autoplay&&t.autoplay.running&&t.autoplay.paused&&t.autoplay.run(),t.allowSlidePrev=r,t.allowSlideNext=i,t.params.watchOverflow&&s!==t.snapGrid&&t.checkOverflow()}}function LK(t){var e=this;!e.enabled||e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation()))}function jK(){var t=this,e=t.wrapperEl,n=t.rtlTranslate;if(t.enabled){t.previousTranslate=t.translate,t.translate=t.isHorizontal()?n?e.scrollWidth-e.offsetWidth-e.scrollLeft:-e.scrollLeft:-e.scrollTop,-0===t.translate&&(t.translate=0),t.updateActiveIndex(),t.updateSlidesClasses();var i=t.maxTranslate()-t.minTranslate();(0===i?0:(t.translate-t.minTranslate())/i)!==t.progress&&t.updateProgress(n?-t.translate:t.translate),t.emit("setTranslate",t.translate,!1)}}var FK=!1;function BK(){}var VK={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!1,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,slidesPerGroupSkip:0,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,loopPreventsSlide:!0,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0,_emitClasses:!1};function zK(t,e){for(var n=0;n=0&&e.eventsAnyListeners.splice(n,1),e},off:function(t,e){var n=this;return n.eventsListeners&&t.split(" ").forEach(function(t){void 0===e?n.eventsListeners[t]=[]:n.eventsListeners[t]&&n.eventsListeners[t].forEach(function(i,r){(i===e||i.__emitterProxy&&i.__emitterProxy===e)&&n.eventsListeners[t].splice(r,1)})}),n},emit:function(){var t=this;if(!t.eventsListeners)return t;for(var e,n,i,r=arguments.length,s=new Array(r),o=0;o=0&&(v=parseFloat(v.replace("%",""))/100*s),t.virtualSize=-v,u.css(o?{marginLeft:"",marginBottom:"",marginTop:""}:{marginRight:"",marginBottom:"",marginTop:""}),i.slidesPerColumn>1&&(S=Math.floor(h/i.slidesPerColumn)===h/t.params.slidesPerColumn?h:Math.ceil(h/i.slidesPerColumn)*i.slidesPerColumn,"auto"!==i.slidesPerView&&"row"===i.slidesPerColumnFill&&(S=Math.max(S,i.slidesPerView*i.slidesPerColumn)));for(var T,k=i.slidesPerColumn,A=S/k,P=Math.floor(h/i.slidesPerColumn),I=0;I1){var D=void 0,R=void 0,N=void 0;if("row"===i.slidesPerColumnFill&&i.slidesPerGroup>1){var L=Math.floor(I/(i.slidesPerGroup*i.slidesPerColumn)),j=I-i.slidesPerColumn*i.slidesPerGroup*L,F=0===L?i.slidesPerGroup:Math.min(Math.ceil((h-L*k*i.slidesPerGroup)/k),i.slidesPerGroup);N=Math.floor(j/F),M.css({"-webkit-box-ordinal-group":D=(R=j-N*F+L*i.slidesPerGroup)+N*S/k,"-moz-box-ordinal-group":D,"-ms-flex-order":D,"-webkit-order":D,order:D})}else"column"===i.slidesPerColumnFill?(N=I-(R=Math.floor(I/k))*k,(R>P||R===P&&N===k-1)&&(N+=1)>=k&&(N=0,R+=1)):R=I-(N=Math.floor(I/A))*A;M.css(e("margin-top"),0!==N?i.spaceBetween&&i.spaceBetween+"px":"")}if("none"!==M.css("display")){if("auto"===i.slidesPerView){var B=getComputedStyle(M[0]),V=M[0].style.transform,z=M[0].style.webkitTransform;if(V&&(M[0].style.transform="none"),z&&(M[0].style.webkitTransform="none"),i.roundLengths)T=t.isHorizontal()?M.outerWidth(!0):M.outerHeight(!0);else{var U=n(B,"width"),H=n(B,"padding-left"),$=n(B,"padding-right"),G=n(B,"margin-left"),W=n(B,"margin-right"),q=B.getPropertyValue("box-sizing");if(q&&"border-box"===q)T=U+G+W;else{var X=M[0];T=U+H+$+G+W+(X.offsetWidth-X.clientWidth)}}V&&(M[0].style.transform=V),z&&(M[0].style.webkitTransform=z),i.roundLengths&&(T=Math.floor(T))}else T=(s-(i.slidesPerView-1)*v)/i.slidesPerView,i.roundLengths&&(T=Math.floor(T)),u[I]&&(u[I].style[e("width")]=T+"px");u[I]&&(u[I].swiperSlideSize=T),f.push(T),i.centeredSlides?(_=_+T/2+w/2+v,0===w&&0!==I&&(_=_-s/2-v),0===I&&(_=_-s/2-v),Math.abs(_)<.001&&(_=0),i.roundLengths&&(_=Math.floor(_)),x%i.slidesPerGroup==0&&d.push(_),p.push(_)):(i.roundLengths&&(_=Math.floor(_)),(x-Math.min(t.params.slidesPerGroupSkip,x))%t.params.slidesPerGroup==0&&d.push(_),p.push(_),_=_+T+v),t.virtualSize+=T+v,w=T,x+=1}}if(t.virtualSize=Math.max(t.virtualSize,s)+m,o&&a&&("slide"===i.effect||"coverflow"===i.effect)&&r.css({width:t.virtualSize+i.spaceBetween+"px"}),i.setWrapperSize&&r.css(((C={})[e("width")]=t.virtualSize+i.spaceBetween+"px",C)),i.slidesPerColumn>1&&(t.virtualSize=(T+i.spaceBetween)*S,t.virtualSize=Math.ceil(t.virtualSize/i.slidesPerColumn)-i.spaceBetween,r.css(((O={})[e("width")]=t.virtualSize+i.spaceBetween+"px",O)),i.centeredSlides)){E=[];for(var Y=0;Y1&&d.push(t.virtualSize-s)}if(0===d.length&&(d=[0]),0!==i.spaceBetween){var J,tt=t.isHorizontal()&&o?"marginLeft":e("marginRight");u.filter(function(t,e){return!i.cssMode||e!==u.length-1}).css(((J={})[tt]=v+"px",J))}if(i.centeredSlides&&i.centeredSlidesBounds){var et=0;f.forEach(function(t){et+=t+(i.spaceBetween?i.spaceBetween:0)});var nt=(et-=i.spaceBetween)-s;d=d.map(function(t){return t<0?-g:t>nt?nt+m:t})}if(i.centerInsufficientSlides){var it=0;if(f.forEach(function(t){it+=t+(i.spaceBetween?i.spaceBetween:0)}),(it-=i.spaceBetween)1)if(n.params.centeredSlides)n.visibleSlides.each(function(t){i.push(t)});else for(e=0;en.slides.length&&!r)break;i.push(o(a))}else i.push(o(n.activeIndex));for(e=0;es?l:s}s&&n.$wrapperEl.css("height",s+"px")},updateSlidesOffset:function(){for(var t=this.slides,e=0;e=0&&c1&&u<=e.size||c<=0&&u>=e.size)&&(e.visibleSlides.push(a),e.visibleSlidesIndexes.push(o),i.eq(o).addClass(n.slideVisibleClass))}a.progress=r?-l:l}e.visibleSlides=yK(e.visibleSlides)}},updateProgress:function(t){var e=this;void 0===t&&(t=e&&e.translate&&e.translate*(e.rtlTranslate?-1:1)||0);var n=e.params,i=e.maxTranslate()-e.minTranslate(),r=e.progress,s=e.isBeginning,o=e.isEnd,a=s,l=o;0===i?(r=0,s=!0,o=!0):(s=(r=(t-e.minTranslate())/i)<=0,o=r>=1),SK(e,{progress:r,isBeginning:s,isEnd:o}),(n.watchSlidesProgress||n.watchSlidesVisibility||n.centeredSlides&&n.autoHeight)&&e.updateSlidesProgress(t),s&&!a&&e.emit("reachBeginning toEdge"),o&&!l&&e.emit("reachEnd toEdge"),(a&&!s||l&&!o)&&e.emit("fromEdge"),e.emit("progress",r)},updateSlidesClasses:function(){var t,e=this,n=e.slides,i=e.params,r=e.$wrapperEl,s=e.activeIndex,o=e.realIndex,a=e.virtual&&i.virtual.enabled;n.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(t=a?e.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+s+'"]'):n.eq(s)).addClass(i.slideActiveClass),i.loop&&(t.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+o+'"]').addClass(i.slideDuplicateActiveClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+o+'"]').addClass(i.slideDuplicateActiveClass));var l=t.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===l.length&&(l=n.eq(0)).addClass(i.slideNextClass);var c=t.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===c.length&&(c=n.eq(-1)).addClass(i.slidePrevClass),i.loop&&(l.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),c.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass)),e.emitSlidesClasses()},updateActiveIndex:function(t){var e,n=this,i=n.rtlTranslate?n.translate:-n.translate,r=n.slidesGrid,s=n.snapGrid,o=n.params,a=n.activeIndex,l=n.realIndex,c=n.snapIndex,u=t;if(void 0===u){for(var h=0;h=r[h]&&i=r[h]&&i=r[h]&&(u=h);o.normalizeSlideIndex&&(u<0||void 0===u)&&(u=0)}if(s.indexOf(i)>=0)e=s.indexOf(i);else{var d=Math.min(o.slidesPerGroupSkip,u);e=d+Math.floor((u-d)/o.slidesPerGroup)}if(e>=s.length&&(e=s.length-1),u!==a){var p=parseInt(n.slides.eq(u).attr("data-swiper-slide-index")||u,10);SK(n,{snapIndex:e,realIndex:p,previousIndex:a,activeIndex:u}),n.emit("activeIndexChange"),n.emit("snapIndexChange"),l!==p&&n.emit("realIndexChange"),(n.initialized||n.params.runCallbacksOnInit)&&n.emit("slideChange")}else e!==c&&(n.snapIndex=e,n.emit("snapIndexChange"))},updateClickedSlide:function(t){var e,n=this,i=n.params,r=yK(t.target).closest("."+i.slideClass)[0],s=!1;if(r)for(var o=0;o6&&(i=i.split(", ").map(function(t){return t.replace(",",".")}).join(", ")),r=new s.WebKitCSSMatrix("none"===i?"":i)):n=(r=o.MozTransform||o.OTransform||o.MsTransform||o.msTransform||o.transform||o.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===e&&(i=s.WebKitCSSMatrix?r.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===e&&(i=s.WebKitCSSMatrix?r.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),i||0}(e.$wrapperEl[0],t);return i&&(s=-s),s||0},setTranslate:function(t,e){var n=this,i=n.rtlTranslate,r=n.params,s=n.$wrapperEl,o=n.wrapperEl,a=n.progress,l=0,c=0;n.isHorizontal()?l=i?-t:t:c=t,r.roundLengths&&(l=Math.floor(l),c=Math.floor(c)),r.cssMode?o[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-l:-c:r.virtualTranslate||s.transform("translate3d("+l+"px, "+c+"px, 0px)"),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?l:c;var u=n.maxTranslate()-n.minTranslate();(0===u?0:(t-n.minTranslate())/u)!==a&&n.updateProgress(t),n.emit("setTranslate",n.translate,e)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(t,e,n,i,r){void 0===t&&(t=0),void 0===e&&(e=this.params.speed),void 0===n&&(n=!0),void 0===i&&(i=!0);var s=this,o=s.params,a=s.wrapperEl;if(s.animating&&o.preventInteractionOnTransition)return!1;var l,c=s.minTranslate(),u=s.maxTranslate();if(s.updateProgress(l=i&&t>c?c:i&&ts?"next":ir?"next":i=c.length&&(m=c.length-1),(d||l.initialSlide||0)===(h||0)&&n&&o.emit("beforeSlideChangeStart");var b,y=-c[m];if(o.updateProgress(y),l.normalizeSlideIndex)for(var v=0;v=w&&_=w&&_=w&&(a=v)}if(o.initialized&&a!==d&&(!o.allowSlideNext&&yo.translate&&y>o.maxTranslate()&&(d||0)!==a))return!1;if(b=a>d?"next":a=t&&(d=t)}),void 0!==d&&(c=o.indexOf(d))<0&&(c=i.activeIndex-1),i.slideTo(c,t,e,n)},slideReset:function(t,e,n){return void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),this.slideTo(this.activeIndex,t,e,n)},slideToClosest:function(t,e,n,i){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),void 0===i&&(i=.5);var r=this,s=r.activeIndex,o=Math.min(r.params.slidesPerGroupSkip,s),a=o+Math.floor((s-o)/r.params.slidesPerGroup),l=r.rtlTranslate?r.translate:-r.translate;if(l>=r.snapGrid[a]){var c=r.snapGrid[a];l-c>(r.snapGrid[a+1]-c)*i&&(s+=r.params.slidesPerGroup)}else{var u=r.snapGrid[a-1];l-u<=(r.snapGrid[a]-u)*i&&(s-=r.params.slidesPerGroup)}return s=Math.max(s,0),s=Math.min(s,r.slidesGrid.length-1),r.slideTo(s,t,e,n)},slideToClickedSlide:function(){var t,e=this,n=e.params,i=e.$wrapperEl,r="auto"===n.slidesPerView?e.slidesPerViewDynamic():n.slidesPerView,s=e.clickedIndex;if(n.loop){if(e.animating)return;t=parseInt(yK(e.clickedSlide).attr("data-swiper-slide-index"),10),n.centeredSlides?se.slides.length-e.loopedSlides+r/2?(e.loopFix(),s=i.children("."+n.slideClass+'[data-swiper-slide-index="'+t+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),vK(function(){e.slideTo(s)})):e.slideTo(s):s>e.slides.length-r?(e.loopFix(),s=i.children("."+n.slideClass+'[data-swiper-slide-index="'+t+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),vK(function(){e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}},loop:{loopCreate:function(){var t=this,e=tK(),n=t.params,i=t.$wrapperEl;i.children("."+n.slideClass+"."+n.slideDuplicateClass).remove();var r=i.children("."+n.slideClass);if(n.loopFillGroupWithBlank){var s=n.slidesPerGroup-r.length%n.slidesPerGroup;if(s!==n.slidesPerGroup){for(var o=0;or.length&&(t.loopedSlides=r.length);var l=[],c=[];r.each(function(e,n){var i=yK(e);n=r.length-t.loopedSlides&&l.push(e),i.attr("data-swiper-slide-index",n)});for(var u=0;u=0;h-=1)i.prepend(yK(l[h].cloneNode(!0)).addClass(n.slideDuplicateClass))},loopFix:function(){var t=this;t.emit("beforeLoopFix");var e,n=t.activeIndex,i=t.slides,r=t.loopedSlides,s=t.allowSlidePrev,o=t.allowSlideNext,a=t.snapGrid,l=t.rtlTranslate;t.allowSlidePrev=!0,t.allowSlideNext=!0;var c=-a[n]-t.getTranslate();n=i.length-r&&(e=-i.length+n+r,t.slideTo(e+=r,0,!1,!0)&&0!==c&&t.setTranslate((l?-t.translate:t.translate)-c)),t.allowSlidePrev=s,t.allowSlideNext=o,t.emit("loopFix")},loopDestroy:function(){var t=this,e=t.params,n=t.slides;t.$wrapperEl.children("."+e.slideClass+"."+e.slideDuplicateClass+",."+e.slideClass+"."+e.slideBlankClass).remove(),n.removeAttr("data-swiper-slide-index")}},grabCursor:{setGrabCursor:function(t){var e=this;if(!(e.support.touch||!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)){var n=e.el;n.style.cursor="move",n.style.cursor=t?"-webkit-grabbing":"-webkit-grab",n.style.cursor=t?"-moz-grabbin":"-moz-grab",n.style.cursor=t?"grabbing":"grab"}},unsetGrabCursor:function(){var t=this;t.support.touch||t.params.watchOverflow&&t.isLocked||t.params.cssMode||(t.el.style.cursor="")}},manipulation:{appendSlide:function(t){var e=this,n=e.$wrapperEl,i=e.params;if(i.loop&&e.loopDestroy(),"object"==typeof t&&"length"in t)for(var r=0;r=o)n.appendSlide(e);else{for(var a=s>t?s+1:s,l=[],c=o-1;c>=t;c-=1){var u=n.slides.eq(c);u.remove(),l.unshift(u)}if("object"==typeof e&&"length"in e){for(var h=0;ht?s+e.length:s}else i.append(e);for(var d=0;d1,d=u.slidesPerColumn>1,p=s.enabled;h&&!d?(o.removeClass(s.containerModifierClass+"multirow "+s.containerModifierClass+"multirow-column"),t.emitContainerClasses()):!h&&d&&(o.addClass(s.containerModifierClass+"multirow"),(u.slidesPerColumnFill&&"column"===u.slidesPerColumnFill||!u.slidesPerColumnFill&&"column"===s.slidesPerColumnFill)&&o.addClass(s.containerModifierClass+"multirow-column"),t.emitContainerClasses());var f=u.direction&&u.direction!==s.direction,g=s.loop&&(u.slidesPerView!==s.slidesPerView||f);f&&n&&t.changeDirection(),SK(t.params,u);var m=t.params.enabled;SK(t,{allowTouchMove:t.params.allowTouchMove,allowSlideNext:t.params.allowSlideNext,allowSlidePrev:t.params.allowSlidePrev}),p&&!m?t.disable():!p&&m&&t.enable(),t.currentBreakpoint=l,t.emit("_beforeBreakpoint",u),g&&n&&(t.loopDestroy(),t.loopCreate(),t.updateSlides(),t.slideTo(e-r+t.loopedSlides,0,!1)),t.emit("breakpoint",u)}}},getBreakpoint:function(t,e,n){if(void 0===e&&(e="window"),t&&("container"!==e||n)){var i=!1,r=nK(),s="window"===e?r.innerHeight:n.clientHeight,o=Object.keys(t).map(function(t){if("string"==typeof t&&0===t.indexOf("@")){var e=parseFloat(t.substr(1));return{value:s*e,point:t}}return{value:t,point:t}});o.sort(function(t,e){return parseInt(t.value,10)-parseInt(e.value,10)});for(var a=0;a0&&e.slidesOffsetBefore+e.spaceBetween*(t.slides.length-1)+t.slides[0].offsetWidth*t.slides.length;t.isLocked=e.slidesOffsetBefore&&e.slidesOffsetAfter&&i?i<=t.size:1===t.snapGrid.length,t.allowSlideNext=!t.isLocked,t.allowSlidePrev=!t.isLocked,n!==t.isLocked&&t.emit(t.isLocked?"lock":"unlock"),n&&n!==t.isLocked&&(t.isEnd=!1,t.navigation&&t.navigation.update())}},classes:{addClasses:function(){var t=this,e=t.classNames,n=t.params,i=t.$el,r=t.device,s=t.support,o=function(t,e){var n=[];return t.forEach(function(t){"object"==typeof t?Object.keys(t).forEach(function(i){t[i]&&n.push(e+i)}):"string"==typeof t&&n.push(e+t)}),n}(["initialized",n.direction,{"pointer-events":s.pointerEvents&&!s.touch},{"free-mode":n.freeMode},{autoheight:n.autoHeight},{rtl:t.rtl},{multirow:n.slidesPerColumn>1},{"multirow-column":n.slidesPerColumn>1&&"column"===n.slidesPerColumnFill},{android:r.android},{ios:r.ios},{"css-mode":n.cssMode}],n.containerModifierClass);e.push.apply(e,o),i.addClass([].concat(e).join(" ")),t.emitContainerClasses()},removeClasses:function(){var t=this;t.$el.removeClass(t.classNames.join(" ")),t.emitContainerClasses()}},images:{loadImage:function(t,e,n,i,r,s){var o,a=nK();function l(){s&&s()}yK(t).parent("picture")[0]||t.complete&&r||!e?l():((o=new a.Image).onload=l,o.onerror=l,i&&(o.sizes=i),n&&(o.srcset=n),e&&(o.src=e))},preloadImages:function(){var t=this;function e(){null==t||!t||t.destroyed||(void 0!==t.imagesLoaded&&(t.imagesLoaded+=1),t.imagesLoaded===t.imagesToLoad.length&&(t.params.updateOnImagesReady&&t.update(),t.emit("imagesReady")))}t.imagesToLoad=t.$el.find("img");for(var n=0;n1){var o=[];return yK(n.el).each(function(e){var i=SK({},n,{el:e});o.push(new t(i))}),o}var a=this;a.__swiper__=!0,a.support=CK(),a.device=OK({userAgent:n.userAgent}),a.browser=TK(),a.eventsListeners={},a.eventsAnyListeners=[],void 0===a.modules&&(a.modules={}),Object.keys(a.modules).forEach(function(t){var e=a.modules[t];if(e.params){var i=Object.keys(e.params)[0],r=e.params[i];if("object"!=typeof r||null===r||(["navigation","pagination","scrollbar"].indexOf(i)>=0&&!0===n[i]&&(n[i]={auto:!0}),!(i in n)||!("enabled"in r)))return;!0===n[i]&&(n[i]={enabled:!0}),"object"==typeof n[i]&&!("enabled"in n[i])&&(n[i].enabled=!0),n[i]||(n[i]={enabled:!1})}});var l,c,u=SK({},VK);return a.useParams(u),a.params=SK({},u,HK,n),a.originalParams=SK({},a.params),a.passedParams=SK({},n),a.params&&a.params.on&&Object.keys(a.params.on).forEach(function(t){a.on(t,a.params.on[t])}),a.params&&a.params.onAny&&a.onAny(a.params.onAny),a.$=yK,SK(a,{enabled:a.params.enabled,el:e,classNames:[],slides:yK(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===a.params.direction},isVertical:function(){return"vertical"===a.params.direction},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEvents:(l=["touchstart","touchmove","touchend","touchcancel"],c=["mousedown","mousemove","mouseup"],a.support.pointerEvents&&(c=["pointerdown","pointermove","pointerup"]),a.touchEventsTouch={start:l[0],move:l[1],end:l[2],cancel:l[3]},a.touchEventsDesktop={start:c[0],move:c[1],end:c[2]},a.support.touch||!a.params.simulateTouch?a.touchEventsTouch:a.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:_K(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.useModules(),a.emit("_swiper"),a.params.init&&a.init(),a}var e=t.prototype;return e.enable=function(){var t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))},e.disable=function(){var t=this;!t.enabled||(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))},e.setProgress=function(t,e){var n=this;t=Math.min(Math.max(t,0),1);var i=n.minTranslate(),r=n.maxTranslate();n.translateTo((r-i)*t+i,void 0===e?0:e),n.updateActiveIndex(),n.updateSlidesClasses()},e.emitContainerClasses=function(){var t=this;if(t.params._emitClasses&&t.el){var e=t.el.className.split(" ").filter(function(e){return 0===e.indexOf("swiper-container")||0===e.indexOf(t.params.containerModifierClass)});t.emit("_containerClasses",e.join(" "))}},e.getSlideClasses=function(t){var e=this;return t.className.split(" ").filter(function(t){return 0===t.indexOf("swiper-slide")||0===t.indexOf(e.params.slideClass)}).join(" ")},e.emitSlidesClasses=function(){var t=this;if(t.params._emitClasses&&t.el){var e=[];t.slides.each(function(n){var i=t.getSlideClasses(n);e.push({slideEl:n,classNames:i}),t.emit("_slideClass",n,i)}),t.emit("_slideClasses",e)}},e.slidesPerViewDynamic=function(){var t=this,e=t.slides,n=t.slidesGrid,i=t.size,r=t.activeIndex,s=1;if(t.params.centeredSlides){for(var o,a=e[r].swiperSlideSize,l=r+1;li&&(o=!0));for(var c=r-1;c>=0;c-=1)e[c]&&!o&&(s+=1,(a+=e[c].swiperSlideSize)>i&&(o=!0))}else for(var u=r+1;u1)&&t.isEnd&&!t.params.centeredSlides?t.slides.length-1:t.activeIndex,0,!1,!0)||i(),n.watchOverflow&&e!==t.snapGrid&&t.checkOverflow(),t.emit("update")}function i(){var e=Math.min(Math.max(t.rtlTranslate?-1*t.translate:t.translate,t.maxTranslate()),t.minTranslate());t.setTranslate(e),t.updateActiveIndex(),t.updateSlidesClasses()}},e.changeDirection=function(t,e){void 0===e&&(e=!0);var n=this,i=n.params.direction;return t||(t="horizontal"===i?"vertical":"horizontal"),t===i||"horizontal"!==t&&"vertical"!==t||(n.$el.removeClass(""+n.params.containerModifierClass+i).addClass(""+n.params.containerModifierClass+t),n.emitContainerClasses(),n.params.direction=t,n.slides.each(function(e){"vertical"===t?e.style.width="":e.style.height=""}),n.emit("changeDirection"),e&&n.update()),n},e.mount=function(t){var e=this;if(e.mounted)return!0;var n=yK(t||e.params.el);if(!(t=n[0]))return!1;t.swiper=e;var i=function(){return"."+(e.params.wrapperClass||"").trim().split(" ").join(".")},r=function(){if(t&&t.shadowRoot&&t.shadowRoot.querySelector){var e=yK(t.shadowRoot.querySelector(i()));return e.children=function(t){return n.children(t)},e}return n.children(i())}();if(0===r.length&&e.params.createElements){var s=tK().createElement("div");r=yK(s),s.className=e.params.wrapperClass,n.append(s),n.children("."+e.params.slideClass).each(function(t){r.append(t)})}return SK(e,{$el:n,el:t,$wrapperEl:r,wrapperEl:r[0],mounted:!0,rtl:"rtl"===t.dir.toLowerCase()||"rtl"===n.css("direction"),rtlTranslate:"horizontal"===e.params.direction&&("rtl"===t.dir.toLowerCase()||"rtl"===n.css("direction")),wrongRTL:"-webkit-box"===r.css("display")}),!0},e.init=function(t){var e=this;return e.initialized||!1===e.mount(t)||(e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.params.loop&&e.loopCreate(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.enabled&&e.setGrabCursor(),e.params.preloadImages&&e.preloadImages(),e.slideTo(e.params.loop?e.params.initialSlide+e.loopedSlides:e.params.initialSlide,0,e.params.runCallbacksOnInit,!1,!0),e.attachEvents(),e.initialized=!0,e.emit("init"),e.emit("afterInit")),e},e.destroy=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0);var n=this,i=n.params,r=n.$el,s=n.$wrapperEl,o=n.slides;return void 0===n.params||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),i.loop&&n.loopDestroy(),e&&(n.removeClasses(),r.removeAttr("style"),s.removeAttr("style"),o&&o.length&&o.removeClass([i.slideVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(function(t){n.off(t)}),!1!==t&&(n.$el[0].swiper=null,function(e){var n=e;Object.keys(n).forEach(function(e){try{n[e]=null}catch(t){}try{delete n[e]}catch(t){}})}(n)),n.destroyed=!0),null},t.extendDefaults=function(t){SK(HK,t)},t.installModule=function(e){t.prototype.modules||(t.prototype.modules={});var n=e.name||Object.keys(t.prototype.modules).length+"_"+_K();t.prototype.modules[n]=e},t.use=function(e){return Array.isArray(e)?(e.forEach(function(e){return t.installModule(e)}),t):(t.installModule(e),t)},function(t,e,n){n&&zK(t,n)}(t,0,[{key:"extendedDefaults",get:function(){return HK}},{key:"defaults",get:function(){return VK}}]),t}();Object.keys(UK).forEach(function(t){Object.keys(UK[t]).forEach(function(e){$K.prototype[e]=UK[t][e]})}),$K.use([kK,IK]);var GK=$K;const WK=["prevElRef"],qK=["nextElRef"],XK=["scrollbarElRef"],YK=["paginationElRef"];function KK(t,e){1&t&&(aa(0),oa(1,"div",6,7),oa(3,"div",8,9),la())}function QK(t,e){1&t&&oa(0,"div",10,11)}function ZK(t,e){1&t&&oa(0,"div",12,13)}function JK(t,e){}function tQ(t,e){1&t&&Jo(0,JK,0,0,"ng-template")}function eQ(t,e){}function nQ(t,e){1&t&&Jo(0,eQ,0,0,"ng-template")}function iQ(t,e){}function rQ(t,e){1&t&&Jo(0,iQ,0,0,"ng-template")}function sQ(t,e){}const oQ=function(t){return{$implicit:t}};function aQ(t,e){if(1&t&&(ra(0,"div",3),Jo(1,sQ,0,0,"ng-template",18),sa()),2&t){const t=va().$implicit;na("ngClass",va(2).zoomContainerClass),ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Tc(3,oQ,t.slideData))}}function lQ(t,e){}function cQ(t,e){if(1&t&&(aa(0),Jo(1,lQ,0,0,"ng-template",18),la()),2&t){const t=va().$implicit;ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Tc(2,oQ,t.slideData))}}function uQ(t,e){if(1&t&&(ra(0,"div",15),Jo(1,aQ,2,5,"div",16),Jo(2,cQ,2,4,"ng-container",17),sa()),2&t){const t=e.$implicit,n=va().key,i=va();(function(t){Ua(qa,Fa,t,!1)})(i.style),na("ngClass",(t.class?t.class+" ":"")+i.slideClass+(""!==n?" "+i.slideDuplicateClass:""))("ngSwitch",t.zoom),Ko("data-swiper-slide-index",t.virtualIndex?t.virtualIndex:t.slideIndex),ws(1),na("ngSwitchCase",!0)}}function hQ(t,e){1&t&&(Jo(0,uQ,3,6,"div",14),Ic(1,"async")),2&t&&na("ngForOf",Mc(1,1,e.loopSlides))}const dQ=[[["","slot","container-start"]],[["","slot","wrapper-start"]],[["","slot","wrapper-end"]],[["","slot","container-end"]]],pQ=function(t){return{loopSlides:t,key:"prepend"}},fQ=function(t){return{loopSlides:t,key:""}},gQ=function(t){return{loopSlides:t,key:"append"}},mQ=["[slot=container-start]","[slot=wrapper-start]","[slot=wrapper-end]","[slot=container-end]"];function bQ(t){return"object"==typeof t&&null!==t&&t.constructor&&"Object"===Object.prototype.toString.call(t).slice(8,-1)}function yQ(t,e,n){return!0===_Q(t)&&e&&!e.el||!("boolean"!=typeof e&&e.el!==(null==n?void 0:n.nativeElement)&&("string"==typeof e.el||"object"==typeof e.el))}function vQ(t,e){const n=["__proto__","constructor","prototype"];Object.keys(e).filter(t=>n.indexOf(t)<0).forEach(n=>{void 0!==t[n]?t[n]&&!e[n]||(bQ(e[n])&&bQ(t[n])&&Object.keys(e[n]).length>0?e[n].__swiper__?t[n]=e[n]:vQ(t[n],e[n]):t[n]=e[n]):t[n]=e[n]})}function _Q(t){return null!=t&&"false"!=`${t}`}const wQ=["pagination","navigation","scrollbar","virtual"];function xQ(t,e={}){return bQ(t)?t:!0===_Q(t)&&e}const SQ=["init","_direction","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_freeModeMomentum","_freeModeMomentumRatio","_freeModeMomentumBounce","_freeModeMomentumBounceRatio","_freeModeMomentumVelocityRatio","_freeModeSticky","_freeModeMinimumVelocity","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","_slidesPerColumn","_slidesPerColumnFill","_slidesPerGroup","_slidesPerGroupSkip","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_watchSlidesVisibility","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_preloadImages","updateOnImagesReady","_loop","_loopAdditionalSlides","_loopedSlides","_loopFillGroupWithBlank","loopPreventsSlide","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","hashNavigation","history","keyboard","lazy","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom"].map(t=>t.replace(/_/,""));function EQ(t={}){const e={on:{}},n={};vQ(e,GK.defaults),vQ(e,GK.extendedDefaults),e._emitClasses=!0;const i={};return Object.keys(t).forEach(r=>{const s=r.replace(/^_/,"");void 0!==t[s]&&(SQ.indexOf(s)>=0?bQ(t[s])?(e[s]={},n[s]={},vQ(e[s],t[s]),vQ(n[s],t[s])):(e[s]=t[s],n[s]=t[s]):i[s]=t[s])}),{params:e,passedParams:n,rest:i}}let CQ=(()=>{class t{constructor(t){this.template=t,this.class="",this.slideData={isActive:!1,isPrev:!1,isNext:!1,isVisible:!1,isDuplicate:!1}}set zoom(t){this._zoom=_Q(t)}get zoom(){return this._zoom}get classNames(){return this._classNames}set classNames(t){this._classNames!==t&&(this._classNames=t,this.slideData={isActive:this._hasClass(["swiper-slide-active","swiper-slide-duplicate-active"]),isVisible:this._hasClass(["swiper-slide-visible"]),isDuplicate:this._hasClass(["swiper-slide-duplicate"]),isPrev:this._hasClass(["swiper-slide-prev","swiper-slide-duplicate-prev"]),isNext:this._hasClass(["swiper-slide-next","swiper-slide-duplicate-next"])})}_hasClass(t){return t.some(t=>this._classNames.indexOf(t)>=0)}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),t})(),OQ=(()=>{class t{constructor(t,e,n,i){this._ngZone=t,this.elementRef=e,this._changeDetectorRef=n,this._platformId=i,this.slideClass="swiper-slide",this.wrapperClass="swiper-wrapper",this.showNavigation=!0,this.showPagination=!0,this.showScrollbar=!0,this.s__beforeBreakpoint=new Rc,this.s__containerClasses=new Rc,this.s__slideClass=new Rc,this.s__swiper=new Rc,this.s_activeIndexChange=new Rc,this.s_afterInit=new Rc,this.s_autoplay=new Rc,this.s_autoplayStart=new Rc,this.s_autoplayStop=new Rc,this.s_beforeDestroy=new Rc,this.s_beforeInit=new Rc,this.s_beforeLoopFix=new Rc,this.s_beforeResize=new Rc,this.s_beforeSlideChangeStart=new Rc,this.s_beforeTransitionStart=new Rc,this.s_breakpoint=new Rc,this.s_changeDirection=new Rc,this.s_click=new Rc,this.s_doubleTap=new Rc,this.s_doubleClick=new Rc,this.s_destroy=new Rc,this.s_fromEdge=new Rc,this.s_hashChange=new Rc,this.s_hashSet=new Rc,this.s_imagesReady=new Rc,this.s_init=new Rc,this.s_keyPress=new Rc,this.s_lazyImageLoad=new Rc,this.s_lazyImageReady=new Rc,this.s_loopFix=new Rc,this.s_momentumBounce=new Rc,this.s_navigationHide=new Rc,this.s_navigationShow=new Rc,this.s_observerUpdate=new Rc,this.s_orientationchange=new Rc,this.s_paginationHide=new Rc,this.s_paginationRender=new Rc,this.s_paginationShow=new Rc,this.s_paginationUpdate=new Rc,this.s_progress=new Rc,this.s_reachBeginning=new Rc,this.s_reachEnd=new Rc,this.s_realIndexChange=new Rc,this.s_resize=new Rc,this.s_scroll=new Rc,this.s_scrollbarDragEnd=new Rc,this.s_scrollbarDragMove=new Rc,this.s_scrollbarDragStart=new Rc,this.s_setTransition=new Rc,this.s_setTranslate=new Rc,this.s_slideChange=new Rc,this.s_slideChangeTransitionEnd=new Rc,this.s_slideChangeTransitionStart=new Rc,this.s_slideNextTransitionEnd=new Rc,this.s_slideNextTransitionStart=new Rc,this.s_slidePrevTransitionEnd=new Rc,this.s_slidePrevTransitionStart=new Rc,this.s_slideResetTransitionStart=new Rc,this.s_slideResetTransitionEnd=new Rc,this.s_sliderMove=new Rc,this.s_sliderFirstMove=new Rc,this.s_slidesLengthChange=new Rc,this.s_slidesGridLengthChange=new Rc,this.s_snapGridLengthChange=new Rc,this.s_snapIndexChange=new Rc,this.s_tap=new Rc,this.s_toEdge=new Rc,this.s_touchEnd=new Rc,this.s_touchMove=new Rc,this.s_touchMoveOpposite=new Rc,this.s_touchStart=new Rc,this.s_transitionEnd=new Rc,this.s_transitionStart=new Rc,this.s_update=new Rc,this.s_zoomChange=new Rc,this.s_swiper=new Rc,this.indexChange=new Rc,this._activeSlides=new P,this.containerClasses="swiper-container",this.slidesChanges=t=>{this.slides=t.map((t,e)=>(t.slideIndex=e,t.classNames=this.slideClass,t)),this.loop&&!this.loopedSlides&&this.calcLoopedSlides(),this.virtual?this.swiperRef&&this.swiperRef.virtual&&this._ngZone.runOutsideAngular(()=>{this.swiperRef.virtual.slides=this.slides,this.swiperRef.virtual.update(!0)}):(this.prependSlides=wd(this.slides.slice(this.slides.length-this.loopedSlides)),this.appendSlides=wd(this.slides.slice(0,this.loopedSlides))),this._changeDetectorRef.detectChanges()},this.style=null,this.updateVirtualSlides=t=>{!this.swiperRef||this.currentVirtualData&&this.currentVirtualData.from===t.from&&this.currentVirtualData.to===t.to&&this.currentVirtualData.offset===t.offset||(this.style=this.swiperRef.isHorizontal()?{[this.swiperRef.rtlTranslate?"right":"left"]:`${t.offset}px`}:{top:`${t.offset}px`},this.currentVirtualData=t,this._activeSlides.next(t.slides),this._ngZone.run(()=>{this._changeDetectorRef.detectChanges()}),this._ngZone.runOutsideAngular(()=>{this.swiperRef.updateSlides(),this.swiperRef.updateProgress(),this.swiperRef.updateSlidesClasses(),this.swiperRef.lazy&&this.swiperRef.params.lazy.enabled&&this.swiperRef.lazy.load(),this.swiperRef.virtual.update(!0)}))}}set navigation(t){var e,n,i;const r="boolean"!=typeof this._navigation?null===(e=this._navigation)||void 0===e?void 0:e.nextEl:null,s="boolean"!=typeof this._navigation?null===(n=this._navigation)||void 0===n?void 0:n.prevEl:null;this._navigation=xQ(t,{nextEl:r||null,prevEl:s||null}),this.showNavigation=!(!0!==_Q(t)||this._navigation&&"boolean"!=typeof this._navigation&&this._navigation.prevEl!==(null===(i=this._prevElRef)||void 0===i?void 0:i.nativeElement)&&(null!==this._navigation.prevEl||null!==this._navigation.nextEl)&&("string"==typeof this._navigation.nextEl||"string"==typeof this._navigation.prevEl||"object"==typeof this._navigation.nextEl||"object"==typeof this._navigation.prevEl))}get navigation(){return this._navigation}set pagination(t){var e;const n="boolean"!=typeof this._pagination?null===(e=this._pagination)||void 0===e?void 0:e.el:null;this._pagination=xQ(t,{el:n||null}),this.showPagination=yQ(t,this._pagination,this._paginationElRef)}get pagination(){return this._pagination}set scrollbar(t){var e;const n="boolean"!=typeof this._scrollbar?null===(e=this._scrollbar)||void 0===e?void 0:e.el:null;this._scrollbar=xQ(t,{el:n||null}),this.showScrollbar=yQ(t,this._scrollbar,this._scrollbarElRef)}get scrollbar(){return this._scrollbar}set virtual(t){this._virtual=xQ(t)}get virtual(){return this._virtual}set index(t){this.setIndex(t)}set config(t){this.updateSwiper(t);const{params:e}=EQ(t);Object.assign(this,e)}set prevElRef(t){this._prevElRef=t,this._setElement(t,this.navigation,"navigation","prevEl")}set nextElRef(t){this._nextElRef=t,this._setElement(t,this.navigation,"navigation","nextEl")}set scrollbarElRef(t){this._scrollbarElRef=t,this._setElement(t,this.scrollbar,"scrollbar")}set paginationElRef(t){this._paginationElRef=t,this._setElement(t,this.pagination,"pagination")}get activeSlides(){return this.virtual?this._activeSlides:wd(this.slides)}get zoomContainerClass(){return"boolean"!=typeof this.zoom?this.zoom.containerClass:"swiper-zoom-container"}_setElement(t,e,n,i="el"){if(!t||!e)return;if(e&&t.nativeElement){if(e[i]===t.nativeElement)return;e[i]=t.nativeElement}const r={};r[n]=!0,this.updateInitSwiper(r)}ngOnInit(){const{params:t}=EQ(this);Object.assign(this,t)}ngAfterViewInit(){this.childrenSlidesInit(),this.initSwiper(),this._changeDetectorRef.detectChanges(),setTimeout(()=>{this.s_swiper.emit(this.swiperRef)})}childrenSlidesInit(){this.slidesChanges(this.slidesEl),this.slidesEl.changes.subscribe(this.slidesChanges)}get isSwiperActive(){return this.swiperRef&&!this.swiperRef.destroyed}initSwiper(){const{params:t}=EQ(this);Object.assign(this,t),this._ngZone.runOutsideAngular(()=>{t.init=!1,t.virtual||(t.observer=!0),t.onAny=(t,...e)=>{const n=this[`s_${t}`];n&&n.emit(...e)},Object.assign(t.on,{_containerClasses(t,e){this.containerClasses=e},_slideClasses:(t,e)=>{e.forEach(({slideEl:t,classNames:e},n)=>{const i=parseInt(t.getAttribute("data-swiper-slide-index"))||n;if(this.virtual){const t=this.slides.find(t=>t.virtualIndex&&t.virtualIndex===i);if(t)return void(t.classNames=e)}this.slides[i]&&(this.slides[i].classNames=e)}),this._changeDetectorRef.detectChanges()}});const e=new GK(t);if(e.loopCreate=()=>{},e.loopDestroy=()=>{},t.loop&&(e.loopedSlides=this.loopedSlides),e.virtual&&e.params.virtual.enabled){e.virtual.slides=this.slides;const t={cache:!1,renderExternal:this.updateVirtualSlides,renderExternalUpdate:!1};vQ(e.params.virtual,t),vQ(e.originalParams.virtual,t)}Lh(this._platformId)&&(this.swiperRef=e.init(this.elementRef.nativeElement),this.swiperRef.virtual&&this.swiperRef.params.virtual.enabled&&this.swiperRef.virtual.update(!0),this._changeDetectorRef.detectChanges(),e.on("slideChange",()=>{this.indexChange.emit(this.swiperRef.realIndex)}))})}ngOnChanges(t){this.updateSwiper(t),this._changeDetectorRef.detectChanges()}updateInitSwiper(t){!t||!this.swiperRef||this.swiperRef.destroyed||this._ngZone.runOutsideAngular(()=>{const{pagination:e,navigation:n,scrollbar:i,thumbs:r}=this.swiperRef;t.pagination&&(this.pagination&&"boolean"!=typeof this.pagination&&this.pagination.el&&e&&!e.el?(this.updateParameter("pagination",this.pagination),e.init(),e.render(),e.update()):(e.destroy(),e.el=null)),t.scrollbar&&(this.scrollbar&&"boolean"!=typeof this.scrollbar&&this.scrollbar.el&&i&&!i.el?(this.updateParameter("scrollbar",this.scrollbar),i.init(),i.updateSize(),i.setTranslate()):(i.destroy(),i.el=null)),t.navigation&&(this.navigation&&"boolean"!=typeof this.navigation&&this.navigation.prevEl&&this.navigation.nextEl&&n&&!n.prevEl&&!n.nextEl?(this.updateParameter("navigation",this.navigation),n.init(),n.update()):n.prevEl&&n.nextEl&&(n.destroy(),n.nextEl=null,n.prevEl=null)),t.thumbs&&this.thumbs&&this.thumbs.swiper&&(this.updateParameter("thumbs",this.thumbs),r.init()&&r.update(!0)),t.controller&&this.controller&&this.controller.control&&(this.swiperRef.controller.control=this.controller.control),this.swiperRef.update()})}updateSwiper(t){this._ngZone.runOutsideAngular(()=>{var e,n;if(!t.config&&t&&this.swiperRef&&!this.swiperRef.destroyed){for(const i in t){if(wQ.indexOf(i)>=0)continue;const r=null!==(n=null===(e=t[i])||void 0===e?void 0:e.currentValue)&&void 0!==n?n:t[i];this.updateParameter(i,r)}t.allowSlideNext&&(this.swiperRef.allowSlideNext=this.allowSlideNext),t.allowSlidePrev&&(this.swiperRef.allowSlidePrev=this.allowSlidePrev),t.direction&&this.swiperRef.changeDirection(this.direction,!1),t.breakpoints&&(this.loop&&!this.loopedSlides&&this.calcLoopedSlides(),this.swiperRef.currentBreakpoint=null,this.swiperRef.setBreakpoint()),(t.thumbs||t.controller)&&this.updateInitSwiper(t),this.swiperRef.update()}})}calcLoopedSlides(){if(!this.loop)return;let t=this.slidesPerView;if(this.breakpoints){const e=GK.prototype.getBreakpoint(this.breakpoints),n=e in this.breakpoints?this.breakpoints[e]:void 0;n&&n.slidesPerView&&(t=n.slidesPerView)}if("auto"===t)return this.loopedSlides=this.slides.length,this.slides.length;let e=this.loopedSlides||t;return e+=this.loopAdditionalSlides,e>this.slides.length&&(e=this.slides.length),this.loopedSlides=e,e}updateParameter(t,e){if(!this.swiperRef||this.swiperRef.destroyed)return;const n=t.replace(/^_/,""),i=bQ(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){const t=this.swiperRef.modules[n].params[n];i?vQ(this.swiperRef.params[n],t):this.swiperRef.params[n]=t}i&&bQ(e)?vQ(this.swiperRef.params[n],e):this.swiperRef.params[n]=e}setIndex(t,e,n){this.isSwiperActive?t!==this.swiperRef.activeIndex&&this._ngZone.runOutsideAngular(()=>{this.loop?this.swiperRef.slideToLoop(t,e,!n):this.swiperRef.slideTo(t,e,!n)}):this.initialSlide=t}ngOnDestroy(){this._ngZone.runOutsideAngular(()=>{var t;null===(t=this.swiperRef)||void 0===t||t.destroy(!0,!1)})}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(kl),ea(tc),ea(ou))},t.\u0275cmp=Jt({type:t,selectors:[["swiper"],["","swiper",""]],contentQueries:function(t,e,n){if(1&t&&Xc(n,CQ,4),2&t){let t;Wc(t=Yc())&&(e.slidesEl=t)}},viewQuery:function(t,e){if(1&t&&(qc(WK,5),qc(qK,5),qc(XK,5),qc(YK,5)),2&t){let t;Wc(t=Yc())&&(e.prevElRef=t.first),Wc(t=Yc())&&(e.nextElRef=t.first),Wc(t=Yc())&&(e.scrollbarElRef=t.first),Wc(t=Yc())&&(e.paginationElRef=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.containerClasses)},inputs:{slideClass:"slideClass",wrapperClass:"wrapperClass",navigation:"navigation",pagination:"pagination",scrollbar:"scrollbar",virtual:"virtual",index:"index",config:"config",loopedSlides:"loopedSlides",initialSlide:"initialSlide",direction:"direction",touchEventsTarget:"touchEventsTarget",speed:"speed",cssMode:"cssMode",updateOnWindowResize:"updateOnWindowResize",resizeObserver:"resizeObserver",nested:"nested",focusableElements:"focusableElements",width:"width",height:"height",preventInteractionOnTransition:"preventInteractionOnTransition",userAgent:"userAgent",url:"url",edgeSwipeDetection:"edgeSwipeDetection",edgeSwipeThreshold:"edgeSwipeThreshold",freeMode:"freeMode",freeModeMomentum:"freeModeMomentum",freeModeMomentumRatio:"freeModeMomentumRatio",freeModeMomentumBounce:"freeModeMomentumBounce",freeModeMomentumBounceRatio:"freeModeMomentumBounceRatio",freeModeMomentumVelocityRatio:"freeModeMomentumVelocityRatio",freeModeSticky:"freeModeSticky",freeModeMinimumVelocity:"freeModeMinimumVelocity",autoHeight:"autoHeight",setWrapperSize:"setWrapperSize",virtualTranslate:"virtualTranslate",effect:"effect",breakpoints:"breakpoints",spaceBetween:"spaceBetween",slidesPerView:"slidesPerView",slidesPerColumn:"slidesPerColumn",slidesPerColumnFill:"slidesPerColumnFill",slidesPerGroup:"slidesPerGroup",slidesPerGroupSkip:"slidesPerGroupSkip",centeredSlides:"centeredSlides",centeredSlidesBounds:"centeredSlidesBounds",slidesOffsetBefore:"slidesOffsetBefore",slidesOffsetAfter:"slidesOffsetAfter",normalizeSlideIndex:"normalizeSlideIndex",centerInsufficientSlides:"centerInsufficientSlides",watchOverflow:"watchOverflow",roundLengths:"roundLengths",touchRatio:"touchRatio",touchAngle:"touchAngle",simulateTouch:"simulateTouch",shortSwipes:"shortSwipes",longSwipes:"longSwipes",longSwipesRatio:"longSwipesRatio",longSwipesMs:"longSwipesMs",followFinger:"followFinger",allowTouchMove:"allowTouchMove",threshold:"threshold",touchMoveStopPropagation:"touchMoveStopPropagation",touchStartPreventDefault:"touchStartPreventDefault",touchStartForcePreventDefault:"touchStartForcePreventDefault",touchReleaseOnEdges:"touchReleaseOnEdges",uniqueNavElements:"uniqueNavElements",resistance:"resistance",resistanceRatio:"resistanceRatio",watchSlidesProgress:"watchSlidesProgress",watchSlidesVisibility:"watchSlidesVisibility",grabCursor:"grabCursor",preventClicks:"preventClicks",preventClicksPropagation:"preventClicksPropagation",slideToClickedSlide:"slideToClickedSlide",preloadImages:"preloadImages",updateOnImagesReady:"updateOnImagesReady",loop:"loop",loopAdditionalSlides:"loopAdditionalSlides",loopFillGroupWithBlank:"loopFillGroupWithBlank",loopPreventsSlide:"loopPreventsSlide",allowSlidePrev:"allowSlidePrev",allowSlideNext:"allowSlideNext",swipeHandler:"swipeHandler",noSwiping:"noSwiping",noSwipingClass:"noSwipingClass",noSwipingSelector:"noSwipingSelector",passiveListeners:"passiveListeners",containerModifierClass:"containerModifierClass",slideBlankClass:"slideBlankClass",slideActiveClass:"slideActiveClass",slideDuplicateActiveClass:"slideDuplicateActiveClass",slideVisibleClass:"slideVisibleClass",slideDuplicateClass:"slideDuplicateClass",slideNextClass:"slideNextClass",slideDuplicateNextClass:"slideDuplicateNextClass",slidePrevClass:"slidePrevClass",slideDuplicatePrevClass:"slideDuplicatePrevClass",runCallbacksOnInit:"runCallbacksOnInit",observeParents:"observeParents",observeSlideChildren:"observeSlideChildren",a11y:"a11y",autoplay:"autoplay",controller:"controller",coverflowEffect:"coverflowEffect",cubeEffect:"cubeEffect",fadeEffect:"fadeEffect",flipEffect:"flipEffect",hashNavigation:"hashNavigation",history:"history",keyboard:"keyboard",lazy:"lazy",mousewheel:"mousewheel",parallax:"parallax",thumbs:"thumbs",zoom:"zoom",class:"class",id:"id"},outputs:{s__beforeBreakpoint:"_beforeBreakpoint",s__containerClasses:"_containerClasses",s__slideClass:"_slideClass",s__swiper:"_swiper",s_activeIndexChange:"activeIndexChange",s_afterInit:"afterInit",s_autoplay:"autoplay",s_autoplayStart:"autoplayStart",s_autoplayStop:"autoplayStop",s_beforeDestroy:"beforeDestroy",s_beforeInit:"beforeInit",s_beforeLoopFix:"beforeLoopFix",s_beforeResize:"beforeResize",s_beforeSlideChangeStart:"beforeSlideChangeStart",s_beforeTransitionStart:"beforeTransitionStart",s_breakpoint:"breakpoint",s_changeDirection:"changeDirection",s_click:"click",s_doubleTap:"doubleTap",s_doubleClick:"doubleClick",s_destroy:"destroy",s_fromEdge:"fromEdge",s_hashChange:"hashChange",s_hashSet:"hashSet",s_imagesReady:"imagesReady",s_init:"init",s_keyPress:"keyPress",s_lazyImageLoad:"lazyImageLoad",s_lazyImageReady:"lazyImageReady",s_loopFix:"loopFix",s_momentumBounce:"momentumBounce",s_navigationHide:"navigationHide",s_navigationShow:"navigationShow",s_observerUpdate:"observerUpdate",s_orientationchange:"orientationchange",s_paginationHide:"paginationHide",s_paginationRender:"paginationRender",s_paginationShow:"paginationShow",s_paginationUpdate:"paginationUpdate",s_progress:"progress",s_reachBeginning:"reachBeginning",s_reachEnd:"reachEnd",s_realIndexChange:"realIndexChange",s_resize:"resize",s_scroll:"scroll",s_scrollbarDragEnd:"scrollbarDragEnd",s_scrollbarDragMove:"scrollbarDragMove",s_scrollbarDragStart:"scrollbarDragStart",s_setTransition:"setTransition",s_setTranslate:"setTranslate",s_slideChange:"slideChange",s_slideChangeTransitionEnd:"slideChangeTransitionEnd",s_slideChangeTransitionStart:"slideChangeTransitionStart",s_slideNextTransitionEnd:"slideNextTransitionEnd",s_slideNextTransitionStart:"slideNextTransitionStart",s_slidePrevTransitionEnd:"slidePrevTransitionEnd",s_slidePrevTransitionStart:"slidePrevTransitionStart",s_slideResetTransitionStart:"slideResetTransitionStart",s_slideResetTransitionEnd:"slideResetTransitionEnd",s_sliderMove:"sliderMove",s_sliderFirstMove:"sliderFirstMove",s_slidesLengthChange:"slidesLengthChange",s_slidesGridLengthChange:"slidesGridLengthChange",s_snapGridLengthChange:"snapGridLengthChange",s_snapIndexChange:"snapIndexChange",s_tap:"tap",s_toEdge:"toEdge",s_touchEnd:"touchEnd",s_touchMove:"touchMove",s_touchMoveOpposite:"touchMoveOpposite",s_touchStart:"touchStart",s_transitionEnd:"transitionEnd",s_transitionStart:"transitionStart",s_update:"update",s_zoomChange:"zoomChange",s_swiper:"swiper",indexChange:"indexChange"},features:[ye],ngContentSelectors:mQ,decls:13,vars:17,consts:[[4,"ngIf"],["class","swiper-scrollbar",4,"ngIf"],["class","swiper-pagination",4,"ngIf"],[3,"ngClass"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["slidesTemplate",""],[1,"swiper-button-prev"],["prevElRef",""],[1,"swiper-button-next"],["nextElRef",""],[1,"swiper-scrollbar"],["scrollbarElRef",""],[1,"swiper-pagination"],["paginationElRef",""],[3,"ngClass","style","ngSwitch",4,"ngFor","ngForOf"],[3,"ngClass","ngSwitch"],[3,"ngClass",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(t,e){if(1&t&&(wa(dQ),xa(0),Jo(1,KK,5,0,"ng-container",0),Jo(2,QK,2,0,"div",1),Jo(3,ZK,2,0,"div",2),ra(4,"div",3),xa(5,1),Jo(6,tQ,1,0,void 0,4),Jo(7,nQ,1,0,void 0,4),Jo(8,rQ,1,0,void 0,4),xa(9,2),sa(),xa(10,3),Jo(11,hQ,2,3,"ng-template",null,5,Jc)),2&t){const t=ta(12);ws(1),na("ngIf",e.navigation&&e.showNavigation),ws(1),na("ngIf",e.scrollbar&&e.showScrollbar),ws(1),na("ngIf",e.pagination&&e.showPagination),ws(1),na("ngClass",e.wrapperClass),Ko("id",e.id),ws(2),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(11,pQ,e.prependSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(13,fQ,e.activeSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(15,gQ,e.appendSlides))}},directives:[_h,mh,kh,yh,Eh,Ch,Oh],pipes:[Dh],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),t})(),TQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})();function kQ(){return(kQ=Object.assign||function(t){for(var e=1;e0&&(n(s,!!t.isBeginning),t.params.watchOverflow&&t.enabled&&s[t.isLocked?"addClass":"removeClass"](e.lockClass)),r&&r.length>0&&(n(r,!!t.isEnd),t.params.watchOverflow&&t.enabled&&r[t.isLocked?"addClass":"removeClass"](e.lockClass))}},onPrevClick:function(t){var e=this;t.preventDefault(),(!e.isBeginning||e.params.loop)&&e.slidePrev()},onNextClick:function(t){var e=this;t.preventDefault(),(!e.isEnd||e.params.loop)&&e.slideNext()},init:function(){var t,e,n=this,i=n.params.navigation;n.params.navigation=function(t,e,n,i){var r=tK();return n&&Object.keys(i).forEach(function(n){if(!e[n]&&!0===e.auto){var s=r.createElement("div");s.className=i[n],t.append(s),e[n]=s}}),e}(n.$el,n.params.navigation,n.params.createElements,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),(i.nextEl||i.prevEl)&&(i.nextEl&&(t=yK(i.nextEl),n.params.uniqueNavElements&&"string"==typeof i.nextEl&&t.length>1&&1===n.$el.find(i.nextEl).length&&(t=n.$el.find(i.nextEl))),i.prevEl&&(e=yK(i.prevEl),n.params.uniqueNavElements&&"string"==typeof i.prevEl&&e.length>1&&1===n.$el.find(i.prevEl).length&&(e=n.$el.find(i.prevEl))),t&&t.length>0&&t.on("click",n.navigation.onNextClick),e&&e.length>0&&e.on("click",n.navigation.onPrevClick),SK(n.navigation,{$nextEl:t,nextEl:t&&t[0],$prevEl:e,prevEl:e&&e[0]}),n.enabled||(t&&t.addClass(i.lockClass),e&&e.addClass(i.lockClass)))},destroy:function(){var t=this,e=t.navigation,n=e.$nextEl,i=e.$prevEl;n&&n.length&&(n.off("click",t.navigation.onNextClick),n.removeClass(t.params.navigation.disabledClass)),i&&i.length&&(i.off("click",t.navigation.onPrevClick),i.removeClass(t.params.navigation.disabledClass))}},PQ={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){EK(this,{navigation:kQ({},AQ)})},on:{init:function(t){t.navigation.init(),t.navigation.update()},toEdge:function(t){t.navigation.update()},fromEdge:function(t){t.navigation.update()},destroy:function(t){t.navigation.destroy()},"enable disable":function(t){var e=t.navigation,n=e.$nextEl,i=e.$prevEl;n&&n[t.enabled?"removeClass":"addClass"](t.params.navigation.lockClass),i&&i[t.enabled?"removeClass":"addClass"](t.params.navigation.lockClass)},click:function(t,e){var n=t.navigation,i=n.$nextEl,r=n.$prevEl,s=e.target;if(t.params.navigation.hideOnClick&&!yK(s).is(r)&&!yK(s).is(i)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===s||t.pagination.el.contains(s)))return;var o;i?o=i.hasClass(t.params.navigation.hiddenClass):r&&(o=r.hasClass(t.params.navigation.hiddenClass)),t.emit(!0===o?"navigationShow":"navigationHide"),i&&i.toggleClass(t.params.navigation.hiddenClass),r&&r.toggleClass(t.params.navigation.hiddenClass)}}}};let IQ=(()=>{class t{constructor(){GK.use([PQ])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,TQ]]}),t})(),MQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})(),DQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,lX,f_,IQ,MQ]]}),t})(),RQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Dp,DQ]]}),t})();const NQ={isolated:!0},LQ=new oi("Message service configuration",{providedIn:"root",factory:()=>NQ});let jQ=(()=>{class t{constructor(t,e,n){this.source=t,this.channel=e,this.messages=n}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Hd(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Hd(e=>e.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Hd(e=>t.includes(e.source)))}nextMessageId(){return t.counter++}}return t.counter=0,t})(),FQ=(()=>{class t{constructor(t,e){this.config=t,this.parent=e,this.channel=new P,this.messages=t.isolated||!e?this.channel.asObservable():U([this.channel,e.messages.pipe(Xp(()=>!this.channel.closed))]).pipe(Y())}ngOnDestroy(){this.channel.complete()}connect(t){return new jQ(t,this.channel,this.messages)}}return t.\u0275fac=function(e){return new(e||t)(Ci(LQ),Ci(t,12))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),BQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:LQ,useValue:NQ}],imports:[[gd,ky,f_]]}),t})();function VQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function zQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function UQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function HQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}const $Q=".mat-progress-spinner{display:block;position:relative;overflow:hidden}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}._mat-animation-noopable.mat-progress-spinner circle{transition:none;animation:none}.cdk-high-contrast-active .mat-progress-spinner circle{stroke:currentColor;stroke:CanvasText}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{animation:mat-progress-spinner-linear-rotate 2000ms linear infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4000ms;animation-timing-function:cubic-bezier(0.35, 0, 0.25, 1);animation-iteration-count:infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{animation:mat-progress-spinner-stroke-rotate-fallback 10000ms cubic-bezier(0.87, 0.03, 0.33, 1) infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition:none;animation:none}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.606171575px;transform:rotate(0)}12.5%{stroke-dashoffset:56.5486677px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.606171575px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.5486677px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.606171575px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.5486677px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.606171575px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.5486677px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0deg)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}\n",GQ=jy(class{constructor(t){this._elementRef=t}},"primary"),WQ=new oi("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}});class qQ extends GQ{constructor(t,e,n,i,r){super(t),this._document=n,this._diameter=100,this._value=0,this._fallbackAnimation=!1,this.mode="determinate";const s=qQ._diameters;this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),s.has(n.head)||s.set(n.head,new Set([100])),this._fallbackAnimation=e.EDGE||e.TRIDENT,this._noopAnimations="NoopAnimations"===i&&!!r&&!r._forceAnimations,r&&(r.diameter&&(this.diameter=r.diameter),r.strokeWidth&&(this.strokeWidth=r.strokeWidth))}get diameter(){return this._diameter}set diameter(t){this._diameter=bd(t),this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()}get strokeWidth(){return this._strokeWidth||this.diameter/10}set strokeWidth(t){this._strokeWidth=bd(t)}get value(){return"determinate"===this.mode?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,bd(t)))}ngOnInit(){const t=this._elementRef.nativeElement;this._styleRoot=xp(t)||this._document.head,this._attachStyleNode(),t.classList.add(`mat-progress-spinner-indeterminate${this._fallbackAnimation?"-fallback":""}-animation`)}_getCircleRadius(){return(this.diameter-10)/2}_getViewBox(){const t=2*this._getCircleRadius()+this.strokeWidth;return`0 0 ${t} ${t}`}_getStrokeCircumference(){return 2*Math.PI*this._getCircleRadius()}_getStrokeDashOffset(){return"determinate"===this.mode?this._getStrokeCircumference()*(100-this._value)/100:this._fallbackAnimation&&"indeterminate"===this.mode?.2*this._getStrokeCircumference():null}_getCircleStrokeWidth(){return this.strokeWidth/this.diameter*100}_attachStyleNode(){const t=this._styleRoot,e=this._diameter,n=qQ._diameters;let i=n.get(t);if(!i||!i.has(e)){const r=this._document.createElement("style");r.setAttribute("mat-spinner-animation",this._spinnerAnimationLabel),r.textContent=this._getAnimationText(),t.appendChild(r),i||(i=new Set,n.set(t,i)),i.add(e)}}_getAnimationText(){const t=this._getStrokeCircumference();return"\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n".replace(/START_VALUE/g,""+.95*t).replace(/END_VALUE/g,""+.2*t).replace(/DIAMETER/g,`${this._spinnerAnimationLabel}`)}_getSpinnerAnimationLabel(){return this.diameter.toString().replace(".","_")}}qQ.\u0275fac=function(t){return new(t||qQ)(ea(kl),ea(pp),ea(Yu,8),ea(Ey,8),ea(WQ))},qQ.\u0275cmp=Jt({type:qQ,selectors:[["mat-progress-spinner"]],hostAttrs:["role","progressbar","tabindex","-1",1,"mat-progress-spinner"],hostVars:10,hostBindings:function(t,e){2&t&&(Ko("aria-valuemin","determinate"===e.mode?0:null)("aria-valuemax","determinate"===e.mode?100:null)("aria-valuenow","determinate"===e.mode?e.value:null)("mode",e.mode),La("width",e.diameter,"px")("height",e.diameter,"px"),ja("_mat-animation-noopable",e._noopAnimations))},inputs:{color:"color",mode:"mode",diameter:"diameter",strokeWidth:"strokeWidth",value:"value"},exportAs:["matProgressSpinner"],features:[jo],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,e){1&t&&(vn(),ra(0,"svg",0),Jo(1,VQ,1,9,"circle",1),Jo(2,zQ,1,7,"circle",2),sa()),2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),na("ngSwitch","indeterminate"===e.mode),Ko("viewBox",e._getViewBox()),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1))},directives:[Eh,Ch],styles:[$Q],encapsulation:2,changeDetection:0}),qQ._diameters=new WeakMap;let XQ=(()=>{class t extends qQ{constructor(t,e,n,i,r){super(t,e,n,i,r),this.mode="indeterminate"}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(Yu,8),ea(Ey,8),ea(WQ))},t.\u0275cmp=Jt({type:t,selectors:[["mat-spinner"]],hostAttrs:["role","progressbar","mode","indeterminate",1,"mat-spinner","mat-progress-spinner"],hostVars:6,hostBindings:function(t,e){2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),ja("_mat-animation-noopable",e._noopAnimations))},inputs:{color:"color"},features:[jo],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,e){1&t&&(vn(),ra(0,"svg",0),Jo(1,UQ,1,9,"circle",1),Jo(2,HQ,1,7,"circle",2),sa()),2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),na("ngSwitch","indeterminate"===e.mode),Ko("viewBox",e._getViewBox()),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1))},directives:[Eh,Ch],styles:[$Q],encapsulation:2,changeDetection:0}),t})(),YQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny,Rh],Ny]}),t})(),KQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,YQ]]}),t})(),QQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,YQ]]}),t})();const ZQ={initialConfig:{},parse:{},rename:{}};class JQ{constructor(t,e){this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},ZQ),e)}addChanges(t){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),t)}applyChanges(t,e={}){void 0===t&&(t=this.storedChanges,this.storedChanges={});const{configState:n,options:{initialConfig:i}}=this,r=n.snapshot,s=Object.assign(Object.assign(Object.assign({},i),r),e);for(const[o,a]of Object.entries(t))this.processChange(o,a,s);n.setConfig(s)}processChange(t,e,n){var i,r;const{options:{parse:s,rename:o}}=this,a=null!==(i=o[t])&&void 0!==i?i:t,l=e.currentValue,c=null!==(r=s[t])&&void 0!==r?r:s[a];if(null==l)delete n[a];else if(c)try{n[a]=c(l)}catch(u){console.warn(`Failed to parse ${t} = ${l}`,u.message)}else n[a]=l}}let tZ=(()=>{class t{constructor(t,e,n={}){this.configState=t,this.cdr=e,this.options=n,this.initialized=!1,this.configManager=new JQ(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return t.\u0275fac=function(t){!function(){throw new Error("invalid")}()},t.\u0275dir=se({type:t,features:[ye]}),t})();const eZ={boolean:t=>"false"!=`${t}`,json:t=>"string"==typeof t?JSON.parse(t):t,function:t=>{if("function"!=typeof t)throw new Error("Expected a javascript function");return t}};let nZ=(()=>{class t{constructor(){this.className="ccf-spinner-overlay",this.active=!1}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spinner-overlay"]],hostVars:4,hostBindings:function(t,e){2&t&&(Ba(e.className),ja("active",e.active))},inputs:{active:"active",text:"text"},decls:3,vars:1,consts:[[1,"content"]],template:function(t,e){1&t&&(oa(0,"mat-spinner"),ra(1,"div",0),Za(2),sa()),2&t&&(ws(2),Ja(e.text))},directives:[XQ],styles:["[_nghost-%COMP%]{display:flex;position:absolute;width:100%;height:100%;z-index:99;flex-direction:column;justify-content:center;align-items:center;pointer-events:none;visibility:hidden;opacity:0;transition:visibility .6s,opacity .4s ease-in-out}[_nghost-%COMP%] mat-spinner[_ngcontent-%COMP%]{margin-bottom:1rem;opacity:0;transition:opacity .3s ease-in-out .3s}.active[_nghost-%COMP%]{pointer-events:auto;visibility:visible;opacity:1}.active[_nghost-%COMP%] mat-spinner[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0}),t})();const iZ=FQ,rZ=["*"];let sZ=(()=>{class t{constructor(t,e){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new g;const n=t.connect(this).getMessages();this.subscriptions.add(n.subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){switch(t.payload.type){case"drawer-containers-changed":return this.drawers=t.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":{const e=t.source.position,{opened:n,width:i,margin:r}=t.payload;return this.updateMargin(e,n,i,r),this.updateFaded(),!0}default:return!1}}updateMargin(t,e,n,i){const r=e?n+i:i;"start"===t?this.leftMargin=r:this.rightMargin=r}updateFaded(){const[t,e]=this.drawers;this.faded=(null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==e?void 0:e.opened)&&(null==e?void 0:e.expanded)}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,e){2&t&&(rl("@fadeInOut",e.faded),Ba(e.className),La("margin-left",e.leftMargin,"px")("margin-right",e.rightMargin,"px"),ja("cff-drawer-content-animations",e.animationsEnabled))},ngContentSelectors:rZ,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 5.5rem);z-index:2;overflow:auto}.cff-drawer-content-animations[_nghost-%COMP%]{transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:margin-left,margin-right}"],data:{animation:[Vg("fadeInOut",[$g("false",Hg({opacity:1})),$g("true",Hg({opacity:0})),Wg("false <=> true",zg("1s"))])]},changeDetection:0}),t})();const oZ=["*"],aZ={params:{width:0,margin:0,margin2:0}};class lZ{constructor(){this.initialized=!1,this.deferred=new Promise(t=>{this.resolve=t})}set(){this.initialized=!0,this.resolve()}wait(){return lw(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let cZ=(()=>{class t{constructor(t,e,n){this.element=n,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Rc(!0),this.expandedChange=new Rc(!0),this.stateChange=new Rc(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new lZ,this.subscriptions=new g,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}get classEnd(){return"end"===this.position}get position(){return this._position}set position(t){this._position=t||"start"}get opened(){return this._opened}set opened(t){this.toggle(md(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(md(t))}get expandedStateObj(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}get measuredWidth(){if(this._measuredWidth>0)return this._measuredWidth;const t=this.element.nativeElement;if(!t)return 0;const e=t.getBoundingClientRect(),n=e.right-e.left;return 0===n?0:(this._measuredWidth=n,n)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const e=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),n=Number(e.slice(0,-2));return this._measuredMargin=n,n}ngAfterViewInit(){this.initialized.set(),setTimeout(()=>this.channel.sendMessage({type:"drawer-initialized"}))}ngOnDestroy(){this.subscriptions.unsubscribe()}open(){this.toggle(!0)}close(){this.toggle(!1)}toggle(t=!this.opened){this.opened!==t&&(t?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=t,this.sendToggle())}openExpanded(){this.toggleExpanded(!0)}closeExpanded(){this.toggleExpanded(!1)}toggleExpanded(t=!this.expanded){this.expanded!==t&&(t?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=t,this.sendToggle())}closeOpenDone(){this.openedChange.emit(this.opened)}expandCollapseDone(){this.expandedChange.emit(this.expanded)}sendToggle(){return lw(this,void 0,void 0,function*(){yield this.initialized.wait(),this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit()})}handleMessage(t){switch(t.payload.type){case"drawer-toggled":return this.syncExpanded(t.source),!0;default:return!1}}syncExpanded(t){(this.expanded||t.expanded)&&(this.expanded&&t.expanded?this.expandedState2=t.expandedState2="half":this.expanded?t.opened?(this.expandedState2="extended",this.width=t.measuredWidth+t.measuredMargin):(this.expandedState2="full",this.margin2=t.measuredMargin):this.opened?(t.expandedState2="extended",t.width=this.measuredWidth+this.measuredMargin):(t.expandedState2="full",t.margin2=this.measuredMargin))}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc),ea(kl))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,e){1&t&&ga("@openClose.done",function(){return e.closeOpenDone()})("@expandCollapse.done",function(){return e.expandCollapseDone()}),2&t&&(rl("@openClose",e.openedState)("@expandCollapse",e.expandedStateObj),Ba(e.className),ja("ccf-drawer-end",e.classEnd)("ccf-drawer-opened",e.opened)("ccf-drawer-expanded",e.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:oZ,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,e){1&t&&(wa(),ra(0,"div",0),xa(1),sa())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%);background-color:#fff}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[Vg("openClose",[$g("open, open-instant",Hg({transform:"none"})),$g("closed",Hg({})),Wg("closed => open-instant",zg(0)),Wg("closed <=> open, open-instant => closed",zg(".5s ease-in-out"))]),Vg("expandCollapse",[$g("collapsed",Hg({})),$g("half",Hg({width:"calc(50% - {{ margin }}px)"}),aZ),$g("extended",Hg({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),aZ),$g("full",Hg({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),aZ),Wg("* <=> *",zg(".5s ease-in-out"))])]},changeDetection:0}),t})();function uZ(t,e){1&t&&(ra(0,"ccf-drawer-content"),xa(1,2),sa())}const hZ=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],dZ=["ccf-drawer","ccf-drawer-content","*"];function pZ(t){throw new Error(`Multiple drawers in position ${t}`)}let fZ=(()=>{class t{constructor(t,e){this.cdr=e,this.className="ccf-drawer-container",this.subscriptions=new g,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}get content(){var t;return null!==(t=this.content1.first)&&void 0!==t?t:this.content2.first}get hasWrappedContent(){return 0!==this.content1.length}ngAfterViewInit(){this.drawers.changes.pipe(Kd(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(Kd(null)).subscribe(()=>{this.channel.sendMessage({type:"content-container-changed",content:this.content}),this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return!0}validateDrawers(){const t=this.drawers.toArray(),e=t.filter(t=>"start"===t.position),n=t.filter(t=>"end"===t.position);return e.length>1&&pZ("start"),n.length>1&&pZ("end"),[e[0],n[0]]}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-container"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,cZ,5),Xc(n,sZ,5)),2&t){let t;Wc(t=Yc())&&(e.drawers=t),Wc(t=Yc())&&(e.content1=t)}},viewQuery:function(t,e){if(1&t&&qc(sZ,5),2&t){let t;Wc(t=Yc())&&(e.content2=t)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},exportAs:["ccfDrawerContainer"],features:[_l([iZ])],ngContentSelectors:dZ,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&(wa(hZ),xa(0),xa(1,1),Jo(2,uZ,2,0,"ccf-drawer-content",0)),2&t&&(ws(2),na("ngIf",!e.hasWrappedContent))},directives:[_h,sZ],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),t})();function gZ(t,e){if(1&t&&(ra(0,"mat-option",6),ra(1,"div"),Za(2),sa(),sa()),2&t){const t=e.$implicit,n=va();na("value",t),ws(1),Ba(n.optionsVisible),ws(1),tl(" ",t," ")}}let mZ=(()=>{class t{constructor(t){this.ga=t,this.selectionChange=new Rc,this.optionsVisible="invisible"}toggleOptions(){this.optionsVisible="visible"===this.optionsVisible?"invisible":"visible"}selectionChanged(t){this.selection=t,this.ga.event("selection_change","dropdown",`${this.label}:${t}`),this.selectionChange.emit(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dropdown"]],inputs:{label:"label",options:"options",selection:"selection"},outputs:{selectionChange:"selectionChange"},decls:7,vars:3,consts:[[1,"ccf-dropdown","wrapper"],[1,"container"],[1,"dropdown-form-field"],[1,"label"],["disableOptionCentering","true","panelClass","option-panel","disableRipple","true",1,"selected-value",3,"value","selectionChange","openedChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"mat-form-field",2),ra(3,"div",3),Za(4),sa(),ra(5,"mat-select",4),fa("selectionChange",function(t){return e.selectionChanged(t.value)})("openedChange",function(){return e.toggleOptions()}),Jo(6,gZ,3,5,"mat-option",5),sa(),sa(),sa(),sa()),2&t&&(ws(4),tl(" ",e.label," "),ws(1),na("value",e.selection),ws(1),na("ngForOf",e.options))},directives:[lU,kX,yh,av],styles:["@-webkit-keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.dropdown-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:1em;padding-right:1em;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{font-size:.875rem;border:none}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix mat-select{font-size:1rem;font-weight:bold}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .option-panel{-webkit-animation:slideInHorizontalDropdown .3s;animation:slideInHorizontalDropdown .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;position:absolute!important;top:1.55rem;max-width:9.5rem} .option-panel .mat-option{border-bottom-width:1px;border-bottom-style:solid;padding-left:1em} .option-panel :last-child{border-bottom:none} .cdk-overlay-pane{min-width:0rem!important}.dropdown-form-field[_ngcontent-%COMP%]{height:3rem;width:100%}.dropdown-form-field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{padding-bottom:.063rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem} .ccf-dropdown .mat-select-arrow-wrapper{transform:translatey(-.5em)}"],changeDetection:0}),t})();const bZ=["popover"];function yZ(t,e){if(1&t){const t=ua();ra(0,"div",7,8),ra(2,"div"),ra(3,"div",9),Za(4),sa(),ra(5,"input",10),fa("keyup",function(e){return $e(t),va().onKeyLow(e)}),sa(),sa(),ra(6,"ng5-slider",11),fa("valueChange",function(e){return $e(t),va().lowValue=e})("highValueChange",function(e){return $e(t),va().highValue=e})("userChangeEnd",function(){return $e(t),va().sliderValueChanged()}),sa(),ra(7,"div"),ra(8,"div",12),Za(9),sa(),ra(10,"input",13),fa("keyup",function(e){return $e(t),va().onKeyHigh(e)}),sa(),sa(),sa()}if(2&t){const t=va();ws(2),nl("label min fade-in ",t.contentsVisible,""),ws(2),tl(" ",t.options.floor,"> "),ws(1),Sa("value",t.lowValue),ws(1),nl("slider fade-in ",t.contentsVisible,""),na("options",t.options)("value",t.lowValue)("highValue",t.highValue),ws(1),nl("label max fade-in ",t.contentsVisible,""),ws(2),tl(" ",t.options.ceil," "),ws(1),Sa("value",t.highValue)}}let vZ=(()=>{class t{constructor(t,e,n){this.element=e,this.ga=n,this.selectionChange=new Rc,this.isSliderOpen=!1,this.contentsVisible="invisible",this.isSliderInitialized=!1;const i=t.position().flexibleConnectedTo(e).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"}]);this.overlayRef=t.create({panelClass:"slider-pane",positionStrategy:i})}get rangeLabel(){const{lowValue:t,highValue:e}=this;return t===e?`${t}`:`${t}-${e}`}ngOnChanges(t){t.valueRange&&this.optionsChanged(),t.selection&&(this.lowValue=Math.min(...this.selection),this.highValue=Math.max(...this.selection))}optionsChanged(){var t,e;this.options={floor:this.valueRange?this.valueRange[0]:0,ceil:this.valueRange?this.valueRange[1]:0,step:1,hideLimitLabels:!0,hidePointerLabels:!0},this.lowValue=null!==(t=this.options.floor)&&void 0!==t?t:0,this.highValue=null!==(e=this.options.ceil)&&void 0!==e?e:0}ngOnDestroy(){this.overlayRef.dispose()}closeSliderPopover(t){var e,n;const{element:i,isSliderOpen:r,popoverElement:s}=this;r&&(i.nativeElement.contains(t)||(null===(n=null===(e=null==s?void 0:s.nativeElement)||void 0===e?void 0:e.contains)||void 0===n?void 0:n.call(e,t))||(this.overlayRef.detach(),this.isSliderInitialized=!1,this.isSliderOpen=!1,this.contentsVisible="invisible"))}toggleSliderPopover(){const{isSliderOpen:t,isSliderInitialized:e}=this;e?(this.overlayRef.detach(),this.isSliderInitialized=!1):!e&&!t&&this.initializeSliderPopover(),this.contentsVisible="visible"===this.contentsVisible?"invisible":"visible",this.isSliderOpen=!t}sliderValueChanged(){const{lowValue:t,highValue:e}=this;this.selection=[t,e],this.ga.event("slider_range_change","dual_slider",`${this.label}:${t}:${e}`),this.selectionChange.emit(this.selection)}initializeSliderPopover(){const{overlayRef:t,popoverPortal:e}=this;t.attach(e),t.updatePosition(),this.isSliderInitialized=!0}onKeyLow(t){const e=Number(t.target.value);"Enter"===t.key&&(e>=Number(this.options.floor)&&e<=Number(this.options.ceil)&&(this.lowValue=e),t.target.value=String(this.lowValue),t.target.blur(),this.sliderValueChanged())}onKeyHigh(t){const e=Number(t.target.value);"Enter"===t.key&&(e>=Number(this.options.floor)&&e<=Number(this.options.ceil)&&(this.highValue=e),t.target.value=String(this.highValue),t.target.blur(),this.sliderValueChanged())}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dual-slider"]],viewQuery:function(t,e){if(1&t&&(qc(Vp,7),qc(bZ,5,kl)),2&t){let t;Wc(t=Yc())&&(e.popoverPortal=t.first),Wc(t=Yc())&&(e.popoverElement=t.first)}},hostBindings:function(t,e){1&t&&fa("click",function(t){return e.closeSliderPopover(t.target)},!1,Ir)("touchstart",function(t){return e.closeSliderPopover(t.target)},!1,Ir)},inputs:{label:"label",valueRange:"valueRange",selection:"selection"},outputs:{selectionChange:"selectionChange"},features:[ye],decls:10,vars:4,consts:[[1,"ccf-slider","wrapper"],[1,"container"],["class","ccf-slider detached",4,"cdk-portal"],[1,"slider-form-field",3,"click"],[1,"slider-labels"],[1,"name-label"],[1,"range-label"],[1,"ccf-slider","detached"],["popover",""],[1,"label","floor"],["type","text",1,"input-low",3,"value","keyup"],[3,"options","value","highValue","valueChange","highValueChange","userChangeEnd"],[1,"label","ceil"],["type","text",1,"input-high",3,"value","keyup"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Jo(2,yZ,11,16,"div",2),ra(3,"mat-form-field",3),fa("click",function(){return e.toggleSliderPopover()}),ra(4,"div",4),ra(5,"span",5),Za(6),sa(),ra(7,"span",6),Za(8),sa(),sa(),oa(9,"mat-select"),sa(),sa(),sa()),2&t&&(ws(3),ja("highlight",e.isSliderOpen),ws(3),Ja(e.label),ws(2),Ja(e.rangeLabel))},directives:[zp,lU,kX,vY],styles:[".slider-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;font-size:.875rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.slider-labels[_ngcontent-%COMP%]{display:flex;flex-direction:column}.slider-labels[_ngcontent-%COMP%] .name-label[_ngcontent-%COMP%]{padding-bottom:.25rem}.slider-labels[_ngcontent-%COMP%] .range-label[_ngcontent-%COMP%]{font-weight:bold} .ccf-slider.wrapper .mat-select-arrow-wrapper{transform:translatey(-1.5em)}@-webkit-keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .slider-pane{position:absolute!important;top:-1px}.ccf-slider.detached[_ngcontent-%COMP%]{-webkit-animation:slideInHorizontalSlider .3s;animation:slideInHorizontalSlider .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;display:flex;justify-content:center;align-items:center;width:0rem;height:4.375rem;padding:.75rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] {visibility:hidden;margin-top:.9375rem;margin-bottom:.9375rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-bar{opacity:.2;height:.15rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-selection{opacity:1}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer{width:1rem;height:1rem;top:-.405rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer:after{display:none}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:2rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.min[_ngcontent-%COMP%]{margin-right:1rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%]{margin-left:1rem;align-items:flex-end}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-align:right}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .floor[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%]{font-size:.875rem}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border:none;width:1.75rem;font-size:1rem;font-weight:bold;padding:0}"]}),t})();function _Z(t,e){if(1&t){const t=ua();ra(0,"div",4),ra(1,"mat-checkbox",5),fa("change",function(e){const n=$e(t).$implicit;return va().filterOnChange(e,n)}),Za(2),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ws(1),na("checked",null==n.selection?null:n.selection.includes(t)),ws(1),tl(" ",t," ")}}let wZ=(()=>{class t{constructor(t){this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new Rc}filterOnChange(t,e){t.checked?(this.selection=[...this.selection,e],this.ga.event("filter_added","filter_checkbox",e)):(this.selection=this.selection.filter(t=>t!==e),this.ga.event("filter_removed","filter_checkbox",e)),this.selectionChange.emit(this.selection)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-checkbox"]],inputs:{label:"label",options:"options",selection:"selection",columns:"columns"},outputs:{selectionChange:"selectionChange"},decls:5,vars:6,consts:[[1,"filter-container"],[1,"filter-label"],[1,"options-container"],["class","option",4,"ngFor","ngForOf"],[1,"option"],[3,"checked","change"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Za(2),sa(),ra(3,"div",2),Jo(4,_Z,3,2,"div",3),sa(),sa()),2&t&&(ws(2),Ja(e.label),ws(1),ja("three",3===e.columns)("four",4===e.columns),ws(1),na("ngForOf",e.options))},directives:[yh,oX],styles:[".mat-checkbox.mat-accent .mat-checkbox-checkmark-path{stroke:#fff!important} .mat-checkbox.mat-accent .mat-checkbox-inner-container{margin-right:1rem}.filter-label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}.options-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap}.options-container.three[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:33%}.options-container.four[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:25%}.option[_ngcontent-%COMP%]{color:#fafafa}"],changeDetection:0}),t})();const xZ=function(){return["Both","Male","Female"]},SZ=function(){return[1,110]},EZ=function(){return[13,83]};let CZ=(()=>{class t{constructor(t){this.ga=t,this.filtersChange=new Rc,this.applyFilters=new Rc}updateFilter(t,e){this.filters=Object.assign(Object.assign({},this.filters),{[e]:t}),this.ga.event("filter_update","filter_content",`${e}:${t}`),this.filtersChange.emit(this.filters)}applyButtonClick(){this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}refreshFilters(){this.filters=Object.assign(Object.assign({},this.filters),{sex:"Both",ageRange:[1,110],bmiRange:[13,83],technologies:[],tmc:[]}),this.ga.event("filters_reset","filter_content"),this.filtersChange.emit(this.filters)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange",applyFilters:"applyFilters"},decls:14,vars:23,consts:[[1,"patient-filters"],["label","Sex",3,"options","selection","selectionChange"],["label","Age",3,"valueRange","selection","selectionChange"],["label","BMI",3,"valueRange","selection","selectionChange"],[1,"filter","assays"],["label","Assay Types",3,"columns","options","selection","selectionChange"],[1,"filter","providers"],["label","Tissue Providers",3,"columns","options","selection","selectionChange"],[1,"button-container"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"ccf-dropdown",1),fa("selectionChange",function(t){return e.updateFilter(t,"sex")}),sa(),ra(2,"ccf-dual-slider",2),fa("selectionChange",function(t){return e.updateFilter(t,"ageRange")}),sa(),ra(3,"ccf-dual-slider",3),fa("selectionChange",function(t){return e.updateFilter(t,"bmiRange")}),sa(),sa(),ra(4,"div",4),ra(5,"ccf-checkbox",5),fa("selectionChange",function(t){return e.updateFilter(t,"technologies")}),sa(),sa(),ra(6,"div",6),ra(7,"ccf-checkbox",7),fa("selectionChange",function(t){return e.updateFilter(t,"tmc")}),sa(),sa(),ra(8,"div",8),ra(9,"button",9),fa("click",function(){return e.applyButtonClick()}),Za(10,"APPLY FILTERS"),sa(),ra(11,"div",10),ra(12,"mat-icon",11),fa("click",function(){return e.refreshFilters()}),Za(13,"refresh"),sa(),sa(),sa()),2&t&&(ja("hidden",e.hidden),ws(1),na("options",Oc(20,xZ))("selection",null==e.filters?null:e.filters.sex),ws(1),na("valueRange",Oc(21,SZ))("selection",null==e.filters?null:e.filters.ageRange),ws(1),na("valueRange",Oc(22,EZ))("selection",null==e.filters?null:e.filters.bmiRange),ws(1),ja("hidden",e.hidden),ws(1),na("columns",4)("options",e.technologyFilters)("selection",null==e.filters?null:e.filters.technologies),ws(1),ja("hidden",e.hidden),ws(1),na("columns",3)("options",e.providerFilters)("selection",null==e.filters?null:e.filters.tmc),ws(1),ja("hidden",e.hidden))},directives:[mZ,vZ,wZ,__,p_],styles:[".filter[_ngcontent-%COMP%]{margin-top:2rem}.filter.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.filter.assays[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{margin-right:0 rem;width:25%}.button-container[_ngcontent-%COMP%]{margin-top:2rem;display:flex;flex-direction:row-reverse;align-items:center}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.refresh-icon[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{cursor:pointer;transition:.6s;transition-property:background}.patient-filters[_ngcontent-%COMP%]{display:flex;width:90%;padding-top:1rem}.patient-filters.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.patient-filters[_ngcontent-%COMP%] ccf-dual-slider[_ngcontent-%COMP%]{margin-left:.5rem;width:33%}.patient-filters[_ngcontent-%COMP%] ccf-dropdown[_ngcontent-%COMP%]{width:33%}"],changeDetection:0}),t})();function OZ(t,e){1&t&&(ra(0,"div"),ra(1,"mat-icon",7),Za(2,"close"),sa(),sa())}function TZ(t,e){1&t&&oa(0,"mat-icon",8)}let kZ=(()=>{class t{constructor(){this.filtersChange=new Rc,this.filtersVisible=!1}toggleFilterVisible(){this.filtersVisible=!this.filtersVisible}removeBox(){this.filtersVisible=!1}applyFilters(t){this.filters=t,this.filtersChange.emit(t),this.removeBox()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange"},decls:8,vars:12,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","hidden","filters","applyFilters"],[1,"icon"],["svgIcon","filter",1,"icon","funnel"]],template:function(t,e){if(1&t&&(ra(0,"div",0),ra(1,"button",1),fa("click",function(){return e.toggleFilterVisible()}),Jo(2,OZ,3,0,"div",2),Jo(3,TZ,1,0,"ng-template",null,3,Jc),sa(),ra(5,"div",4),ra(6,"div",5),ra(7,"ccf-filters-content",6),fa("applyFilters",function(t){return e.applyFilters(t)}),sa(),sa(),sa(),sa()),2&t){const t=ta(4);ja("expanded",e.drawerExpanded),ws(2),na("ngIf",e.filtersVisible)("ngIfElse",t),ws(3),ja("visible",e.filtersVisible)("hidden",!e.filtersVisible),ws(2),na("technologyFilters",e.technologyFilters)("providerFilters",e.providerFilters)("hidden",!e.filtersVisible)("filters",e.filters)}},directives:[_h,CZ,p_],styles:[".filters-popover[_ngcontent-%COMP%]{position:inherit}.filters-popover.expanded[_ngcontent-%COMP%]{position:relative}.filters-popover.expanded[_ngcontent-%COMP%] .popup-container[_ngcontent-%COMP%]{right:inherit}.filters-popover.expanded[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding-left:4em!important}.popup-container[_ngcontent-%COMP%]{position:absolute;z-index:5;top:1.2rem;left:1.48rem;box-shadow:.2rem .2rem 1rem #00000058}.popup-container[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding:1.5rem;position:relative;height:26.5rem}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;height:26.5rem;transition:width .2s ease-in-out;border-width:1px}.popup-container.visible[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:1;transition-delay:.3s;transition-duration:.2s}.popup-container.hidden[_ngcontent-%COMP%]{width:0;height:0;transition:all .2s ease-out;transition-delay:.3s;pointer-events:none}.popup-container.hidden[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out}.show-hide[_ngcontent-%COMP%]{background:none;border:none;z-index:10;position:relative;cursor:pointer;outline:none;padding:.5rem;border-radius:.25rem;transition:.6s}"],changeDetection:0}),t})();class AZ{constructor(t,e){this.original=t,this.level=e,this.visible=!0,this.opacity=20}get label(){return this.original.label}get expandable(){return this.original.children.length>0}static create(t,e){return new AZ(t,e)}}function PZ(t,e){if(1&t){const t=ua();ra(0,"div",5),fa("click",function(e){const n=$e(t).node,i=va();return i.select(e.ctrlKey,n,!0,!i.isSelected(n))}),Za(1),sa()}if(2&t){const t=e.node,n=va();ja("hidden",t.label===(null==n.highlightedNode?null:n.highlightedNode.label))("filtered-out",!n.occurenceData[t.original.id]&&!!n.termData[t.original.id])("unavailable",!n.termData[t.original.id])("selected",n.isSelected(t)),ws(1),Ja("colon"===t.label?"large intestine":t.label)}}function IZ(t,e){1&t&&ca(0)}const MZ=function(t){return{node:t}};function DZ(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",6),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",7),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",8),ra(4,"ccf-opacity-slider",9,10),fa("opacityChange",function(e){const n=$e(t).$implicit;return va().updateOpacity(n,e)})("opacityReset",function(){const e=$e(t).$implicit;return va().resetNode(e)})("visibilityToggle",function(){const e=$e(t).$implicit;return va().toggleVisibility(e)}),sa(),sa(),sa(),oa(6,"div",11),Jo(7,IZ,1,0,"ng-container",12),ra(8,"div",13),Za(9),sa(),sa()}if(2&t){const t=e.$implicit,n=va(),i=ta(2);na("matTreeNodePaddingIndent",n.indent),ws(1),La("display",-1!==t.opacity?"none":"block"),ws(1),La("left",n.getLeftIndent(t.level)),ja("fade",!0!==t.visible),ws(1),La("left",n.getLeftIndent(t.level)),ja("hidden",t.label!==(null==n.highlightedNode?null:n.highlightedNode.label)),ws(1),na("visible",t.visible)("opacity",t.opacity),ws(3),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Tc(18,MZ,t)),ws(1),ja("suborgan",t.level>1),ws(1),Ja(n.occurenceData[t.original.id]||0)}}function RZ(t,e){1&t&&ca(0)}function NZ(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",14),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",7),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",8),ra(4,"ccf-opacity-slider",9,15),fa("opacityChange",function(e){const n=$e(t).$implicit;return va().updateOpacity(n,e)})("opacityReset",function(){const e=$e(t).$implicit;return va().resetNode(e)})("visibilityToggle",function(){const e=$e(t).$implicit;return va().toggleVisibility(e)}),sa(),sa(),sa(),ra(6,"button",16),ra(7,"mat-icon",17),Za(8),sa(),sa(),Jo(9,RZ,1,0,"ng-container",12),ra(10,"div",13),Za(11),sa(),sa()}if(2&t){const t=e.$implicit,n=va(),i=ta(2);na("matTreeNodePaddingIndent",n.indent),ws(1),La("display",-1!==t.opacity?"none":"block"),ws(1),La("left",n.getLeftIndent(t.level)),ja("fade",!0!==t.visible),ws(1),La("left",n.getLeftIndent(t.level)),ja("hidden",t.label!==(null==n.highlightedNode?null:n.highlightedNode.label)),ws(1),na("visible",t.visible)("opacity",t.opacity),ws(2),ja("hidden",t.label===(null==n.highlightedNode?null:n.highlightedNode.label)),Zo("aria-label","Toggle ",t.label,""),ws(2),tl(" ",n.control.isExpanded(t)?"expand_less":"expand_more"," "),ws(1),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Tc(22,MZ,t)),ws(1),ja("suborgan",t.level>1),ws(1),Ja(n.occurenceData[t.original.id]||0)}}const LZ=(0,KG.property)("level"),jZ=(0,KG.property)("expandable");let FZ=(()=>{class t{constructor(t,e){this.cdr=t,this.ga=e,this.atScrollBottom=!1,this.nodeSelected=new Rc,this.nodeChanged=new Rc,this.indent="1.5rem",this.control=new OY(LZ,jZ),this.flattener=new WY(AZ.create,LZ,jZ,KG.invoke.bind(void 0,this,"getChildren")),this.dataSource=new qY(this.control,this.flattener),this._nodes=void 0,this.bodyNode=new AZ({"@id":"http://purl.obolibrary.org/obo/UBERON_0013702","@type":"OntologyTreeNode",id:"http://purl.obolibrary.org/obo/UBERON_0013702",label:"body",parent:"",children:[],synonymLabels:[]},0),this.anySelectionsMade=!1,this.selectedNodes=[]}set nodes(t){var e;this._nodes=t,this.control&&(this.dataSource.data=null!==(e=this._nodes)&&void 0!==e?e:[])}get nodes(){return this._nodes}set getChildren(t){var e;this._getChildren=t,this.dataSource.data=null!==(e=this.nodes)&&void 0!==e?e:[]}get getChildren(){return this._getChildren}set occurenceData(t){this._occurenceData=t||{}}get occurenceData(){return this._occurenceData}set termData(t){this._termData=t||{}}get termData(){return this._termData}ngOnInit(){this.control.dataNodes&&this.control.expand(this.control.dataNodes[0])}ngOnChanges(t){if(t.ontologyFilter){const e=t.ontologyFilter.currentValue;this.selectByIDs((null==e?void 0:e.length)>=0?e:[this.bodyNode.original.id])}}selectByIDs(t){const e=this.control.dataNodes,n=e.filter(e=>t.indexOf(e.original.id)>-1);(null==n?void 0:n.length)>0&&(this.selectedNodes=n,this.ga.event("nodes_selected_by_ids","ontology_tree",n.map(t=>t.label).join(",")),this.control.collapseAll(),this.selectedNodes.forEach(t=>{this.expandAndSelect(t.original,t=>{var n;return null===(n=e.find(e=>e.original.id===t.parent))||void 0===n?void 0:n.original},!0)}))}expandAndSelect(t,e,n=!1){var i;const{cdr:r,control:s}=this,o=new Set;let a=e(t);for(;a;)o.add(a),a=e(a);const l=(0,KG.filter)(s.dataNodes,t=>o.has(t.original)),c=s.dataNodes.find(e=>e.original===t);n||(this.selectedNodes=[],s.collapseAll());for(const u of l)s.expand(u);"body"===t.label&&(null===(i=s.dataNodes)||void 0===i?void 0:i.length)>0&&s.expand(s.dataNodes[0]),this.select(n,c,!1,!0),r.detectChanges()}isInnerNode(t,e){return e.expandable}isSelected(t){return this.selectedNodes.filter(e=>(null==t?void 0:t.original.label)===(null==e?void 0:e.original.label)).length>0}select(t,e,n,i){if(this.anySelectionsMade||(this.selectedNodes=[],this.anySelectionsMade=!0),void 0===e)return this.selectedNodes=[],void this.ga.event("nodes_unselected","ontology_tree");t?i?this.selectedNodes.indexOf(e)<0&&this.selectedNodes.push(e):this.selectedNodes.splice(this.selectedNodes.indexOf(e),1):(this.selectedNodes=[],i&&this.selectedNodes.push(e)),this.ga.event("nodes_selected","ontology_tree",this.selectedNodes.map(t=>t.label).join(",")),n&&this.nodeSelected.emit(this.selectedNodes.map(t=>null==t?void 0:t.original))}mouseOver(t){this.highlightedNode=t}mouseOut(){this.highlightedNode=void 0}updateOpacity(t,e){t.opacity=e,this.ga.event("opacity_update","ontology_tree",t.label,e),this.nodeChanged.emit(t)}resetNode(t){t.opacity=20,t.visible=!0,this.ga.event("node_reset","ontology_tree",t.label),this.nodeChanged.emit(t)}toggleVisibility(t){t.visible=!0!==t.visible,this.ga.event("visibility_update","ontology_tree",t.label,+t.visible),this.nodeChanged.emit(t)}getLeftIndent(t){return-1.5*t+"rem"}onScroll(t){if(!t.target)return;const{clientHeight:e,scrollHeight:n,scrollTop:i}=t.target;this.atScrollBottom=n-i-e<20}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[ye],decls:6,vars:5,consts:[[1,"ccf-ontology-tree",3,"dataSource","treeControl","scroll"],["selectableRegion",""],["class","node leaf-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef"],["class","node inner-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef","matTreeNodeDefWhen"],[1,"scroll-gradient"],[1,"text",3,"click"],["matTreeNodePadding","",1,"node","leaf-node",3,"matTreeNodePaddingIndent","mouseleave"],["svgIcon","app:opacity",1,"icon","opacity",3,"mouseenter"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider1",""],[1,"non-expandable"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"num-results"],["matTreeNodePadding","",1,"node","inner-node",3,"matTreeNodePaddingIndent","mouseleave"],["slider2",""],["mat-icon-button","","matTreeNodeToggle","",1,"toggle"],[1,"icon","font-icon"]],template:function(t,e){1&t&&(ra(0,"mat-tree",0),fa("scroll",function(t){return e.onScroll(t)}),Jo(1,PZ,2,9,"ng-template",null,1,Jc),Jo(3,DZ,10,20,"mat-tree-node",2),Jo(4,NZ,12,24,"mat-tree-node",3),sa(),oa(5,"div",4)),2&t&&(na("dataSource",e.dataSource)("treeControl",e.control),ws(4),na("matTreeNodeDefWhen",e.isInnerNode),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[HY,VY,BY,zY,p_,pG,kh,__,$Y],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;height:100%;width:25.25rem;overflow:auto;overflow-x:hidden}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .toggle[_ngcontent-%COMP%]{z-index:-1;opacity:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .text[_ngcontent-%COMP%]{margin-left:.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]{min-height:0;font-size:1rem;margin-bottom:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:width;position:relative;z-index:1}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{width:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%] ccf-opacity-slider[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider{height:1.5rem;margin-left:1rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box .slider-and-label{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider{height:1.5rem;width:15rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider .mat-slider-wrapper{top:12px}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .opacity-value{width:3rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-right:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node.inner-node[_ngcontent-%COMP%] button.hidden[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{position:relative;min-width:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:normal}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .autocomplete-open[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{border-bottom:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .non-expandable[_ngcontent-%COMP%]{margin-left:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{white-space:nowrap;cursor:pointer;margin-left:1rem;opacity:1;width:50%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:opacity,width}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.hidden[_ngcontent-%COMP%]{opacity:0;width:0%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.unavailable[_ngcontent-%COMP%]{pointer-events:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-left:auto}.scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();class BZ{constructor(t){this.ontologyState=t}get rootNode(){return this.ontologyState.rootNode$}filter(t){return this.ontologyState.nodes$.pipe(D(e=>this.lookup(e,t.toLowerCase())))}lookup(t,e){const n=new Map;return t&&t.forEach(t=>{if(t.label.toLowerCase().includes(e)&&!n.get(t.id))n.set(t.id,{index:this.getIndexOfMatch(t.label,e),displayLabel:this.formatLabel(t.label,e),node:t});else{const i=t.synonymLabels.find(t=>t.toLowerCase().includes(e));i&&!n.get(t.id)&&n.set(t.id,{index:this.getIndexOfMatch(t.label+" ("+i+")",e),displayLabel:this.formatLabel(t.label+" ("+i+")",e),node:t})}}),Array.from(n.values())}getIndexOfMatch(t,e){return t.toLowerCase().indexOf(e)}formatLabel(t,e){const n=this.getIndexOfMatch(t,e);return[t.substr(0,n),t.substr(n,e.length),t.substr(n+e.length,t.length)]}getChildren(t){return(0,KG.at)(this.ontologyState.snapshot.nodes,t.children)}}function VZ(t,e){if(1&t&&(ra(0,"mat-option",8),ra(1,"span",9),Za(2),sa(),ra(3,"span",10),Za(4),sa(),ra(5,"span",11),Za(6),sa(),sa()),2&t){const t=e.$implicit;na("value",t),ws(2),Ja(t.displayLabel[0]),ws(2),Ja(t.displayLabel[1]),ws(2),Ja(t.displayLabel[2])}}BZ.\u0275fac=function(t){return new(t||BZ)(Ci($q))},BZ.\u0275prov=xt({token:BZ,factory:BZ.\u0275fac,providedIn:"root"}),sw([iB.ak],BZ.prototype,"getChildren",null);let zZ=(()=>{class t{constructor(t,e){this.ontologyService=t,this.ga=e,this.selected=new Rc,this.formControl=new gz(""),this.autoCompleteOpen=!1}ngOnInit(){this.filteredResults$=this.formControl.valueChanges.pipe(Hd(t=>"string"==typeof t),Kd(""),Qd(t=>this.ontologyService.filter(t)),D(t=>(0,KG.sortBy)(t,[this.sortBySynonymResult,"index",this.sortLexically])))}displayFormatter(t){var e;return(null!==(e=null==t?void 0:t.displayLabel)&&void 0!==e?e:[]).join("")}sortBySynonymResult(t){return t.displayLabel.join().includes("(")?1:-1}sortLexically(t){return t.node.label.toLowerCase()}onSelect(t){const e=(0,KG.get)(t,["option","value","node"]);e&&(this.ga.event("search","ontology_search",e.id),this.selected.emit(e),this.formControl.reset())}}return t.\u0275fac=function(e){return new(e||t)(ea(BZ),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-search"]],outputs:{selected:"selected"},decls:10,vars:8,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","placeholder","Search ontology terms ...","matInput","",1,"input",3,"formControl","matAutocomplete"],[1,"ccf-ontology-search","detached","autocomplete",3,"displayWith","optionSelected","opened","closed"],["autocomplete",""],[1,"results-container"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"prefix"],[1,"search-term"],[1,"suffix"]],template:function(t,e){if(1&t&&(ra(0,"form",0),ra(1,"mat-form-field",1),ra(2,"mat-icon",2),Za(3,"search"),sa(),oa(4,"input",3),ra(5,"mat-autocomplete",4,5),fa("optionSelected",function(t){return e.onSelect(t)})("opened",function(){return e.autoCompleteOpen=!0})("closed",function(){return e.autoCompleteOpen=!1}),ra(7,"div",6),Jo(8,VZ,7,4,"mat-option",7),Ic(9,"async"),sa(),sa(),sa(),sa()),2&t){const t=ta(6);ja("autocomplete-open",e.autoCompleteOpen),ws(4),na("formControl",e.formControl)("matAutocomplete",t),ws(1),na("displayWith",e.displayFormatter),ws(3),na("ngForOf",Mc(9,6,e.filteredResults$))}},directives:[wz,YV,_z,lU,p_,nU,LU,TV,TU,XV,Cz,xU,yh,av],pipes:[Dh],styles:[".ccf-ontology-search[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem .25rem 0;margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;height:3rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix input{margin-left:.4rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-prefix{top:.5rem;border:none}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0 .25rem;min-width:2.5rem} .ccf-ontology-search.detached{border:.125rem solid;border-top:none;border-radius:0 0 .25rem .25rem;max-height:18rem} .ccf-ontology-search.detached .results-container{width:23.75rem;margin-bottom:1rem;overflow:auto;max-height:15rem;scrollbar-width:thin} .ccf-ontology-search.detached .results-container mat-option{height:1.5rem;width:23.75rem} .ccf-ontology-search.detached .results-container mat-option .search-term{text-decoration:underline}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0;border-bottom:none}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem 0 0;border-bottom:none}"],changeDetection:0}),t})();const UZ=function(t){return[t]};function HZ(t,e){if(1&t){const t=ua();ra(0,"ccf-ontology-tree",2),fa("nodeSelected",function(e){return $e(t),va().ontologySelection.emit(e)}),sa()}if(2&t){const t=e.ngIf,n=va();na("nodes",Tc(5,UZ,t))("getChildren",n.ontologySearchService.getChildren)("occurenceData",n.occurenceData)("termData",n.termData)("ontologyFilter",n.ontologyFilter)}}let $Z=(()=>{class t{constructor(t,e){this.ontologySearchService=t,this.store=e,this.ontologySelection=new Rc}selected(t){const{nodes:e}=this.store.selectSnapshot($q);this.tree.expandAndSelect(t,t=>e[t.parent])}}return t.\u0275fac=function(e){return new(e||t)(ea(BZ),ea(pV))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-selection"]],viewQuery:function(t,e){if(1&t&&qc(FZ,5),2&t){let t;Wc(t=Yc())&&(e.tree=t.first)}},inputs:{occurenceData:"occurenceData",termData:"termData",ontologyFilter:"ontologyFilter"},outputs:{ontologySelection:"ontologySelection"},decls:3,vars:3,consts:[[3,"selected"],["class","tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected"]],template:function(t,e){1&t&&(ra(0,"ccf-ontology-search",0),fa("selected",function(t){return e.selected(t)}),sa(),Jo(1,HZ,1,7,"ccf-ontology-tree",1),Ic(2,"async")),2&t&&(ws(1),na("ngIf",Mc(2,1,e.ontologySearchService.rootNode)))},directives:[zZ,_h,FZ],pipes:[Dh],styles:[""],changeDetection:0}),t})(),GZ=(()=>{class t{constructor(t,e,n){this.drawer=t,this.cdr=n,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new g;const i=e.connect(this);this.subscriptions.add(i.getMessagesFromSource(t).subscribe(t=>{this.handleMessage(t)&&n.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",e="arrow_left";return"end"===this.position&&([t,e]=[e,t]),this.opened?e:t}ngAfterViewInit(){setTimeout(()=>{this.position=this.drawer.position,this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return"drawer-toggled"===t.payload.type&&(this.opened=t.payload.opened,!0)}toggle(){const t=this.drawer,{opened:e,expanded:n}=t;e?n?t.closeExpanded():t.close():t.open()}}return t.\u0275fac=function(e){return new(e||t)(ea(cZ),ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,e){2&t&&(Ba(e.className),ja("ccf-drawer-toggle-button-end",e.classEnd))},decls:2,vars:1,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,e){1&t&&(ra(0,"mat-icon",0),fa("click",function(){return e.toggle()}),Za(1),sa()),2&t&&(ws(1),tl(" ",e.icon,"\n"))},directives:[p_],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;display:flex;align-items:center;transition:.6s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:relative;right:.25rem;transition:all .5s}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}"],changeDetection:0}),t})();function WZ(t,e){1&t&&(ra(0,"div",7),oa(1,"mat-spinner",8),ra(2,"span",3),Za(3,"Loading External Site"),sa(),sa())}function qZ(t,e){if(1&t){const t=ua();ra(0,"iframe",9),fa("load",function(){return $e(t),va().loading=!1}),sa()}2&t&&Ko("src",va().safeUrl,wr)}let XZ=(()=>{class t{constructor(t){this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new Rc,this.loading=!0,this.safeUrl=null}ngOnChanges(t){"url"in t&&this.updateUrl()}updateUrl(){const{sanitizer:t,url:e}=this;this.safeUrl=null,e&&(this.safeUrl=t.bypassSecurityTrustResourceUrl(e),this.loading=!0)}}return t.\u0275fac=function(e){return new(e||t)(ea(hd))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},inputs:{url:"url"},outputs:{closed:"closed"},features:[ye],decls:11,vars:4,consts:[[1,"toolbar"],["mat-flat-button","","target","_blank","rel","noopener noreferrer",1,"launch",3,"href","disabled"],[1,"icon"],[1,"text"],["mat-flat-button","",1,"close",3,"click"],["class","overlay",4,"ngIf"],["class","frame","title","Portal Data Viewer","referrerpolicy","no-referrer",3,"load",4,"ngIf"],[1,"overlay"],[1,"spinner"],["title","Portal Data Viewer","referrerpolicy","no-referrer",1,"frame",3,"load"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"a",1),ra(2,"mat-icon",2),Za(3,"launch"),sa(),ra(4,"span",3),Za(5,"Open in Portal"),sa(),sa(),ra(6,"button",4),fa("click",function(){return e.closed.emit()}),ra(7,"mat-icon",2),Za(8,"clear"),sa(),sa(),sa(),Jo(9,WZ,4,0,"div",5),Jo(10,qZ,1,1,"iframe",6)),2&t&&(ws(1),na("href",e.safeUrl,_r)("disabled",!e.safeUrl),ws(8),na("ngIf",e.loading),ws(1),na("ngIf",e.safeUrl))},directives:[w_,p_,__,_h,XQ],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;width:100%;height:1.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%]{margin-right:3.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch.mat-button-disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.25rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{min-width:0;padding:0;line-height:1.5rem;border-radius:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:1.5rem;bottom:0;left:0;right:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{margin-bottom:.5rem}[_nghost-%COMP%] .frame[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0}),t})();function YZ(t,e){if(1&t&&oa(0,"div",3),2&t){const t=e.index;ja("line-tick-visible",va().tissueSectionExists(t+1))}}const KZ=function(){return[]};let QZ=(()=>{class t{constructor(){this.clsName="ccf-tissue-section-vis"}tissueSectionExists(t){return this.tissueSections.filter(e=>e.sectionNumber===t).length>0}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tissue-section-vis"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{totalTissueSections:"totalTissueSections",tissueSections:"tissueSections"},decls:7,vars:3,consts:[[1,"container"],["class","line-tick",3,"line-tick-visible",4,"ngFor","ngForOf"],[1,"x-axis"],[1,"line-tick"]],template:function(t,e){1&t&&(ra(0,"div"),Za(1,"0"),sa(),ra(2,"div",0),Jo(3,YZ,1,2,"div",1),oa(4,"div",2),sa(),ra(5,"div"),Za(6),sa()),2&t&&(ws(3),na("ngForOf",Oc(2,KZ).constructor(e.totalTissueSections)),ws(3),Ja(e.totalTissueSections))},directives:[yh],styles:["[_nghost-%COMP%]{width:100%;height:2.5rem;padding:.5rem 1rem;display:flex}[_nghost-%COMP%] .container[_ngcontent-%COMP%]{margin-right:.5rem;margin-left:.5rem;flex-grow:1;display:flex;position:relative;justify-content:space-evenly}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .line-tick[_ngcontent-%COMP%]{height:100%;width:1px;z-index:2}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .x-axis[_ngcontent-%COMP%]{width:100%;height:2px;position:absolute;top:calc(50% - 1px);right:0;z-index:1}"],changeDetection:0}),t})();function ZZ(t,e){if(1&t){const t=ua();ra(0,"div",7),ra(1,"div",8),Za(2),sa(),ra(3,"a",9),fa("click",function(){$e(t);const e=va().$implicit;return va().linkClicked.emit(e)}),Za(4," DATA "),ra(5,"mat-icon"),Za(6,"open_in_new"),sa(),sa(),sa()}if(2&t){const t=va().$implicit;ws(1),La("background-image","url("+t.thumbnail+")"),ws(1),tl(" ",t.technology," ")}}function JZ(t,e){1&t&&(aa(0),Jo(1,ZZ,7,3,"ng-template",6),la())}const tJ=(()=>{let t=-1;return()=>(t+=1,t)})();let eJ=(()=>{class t{constructor(){this.className="ccf-thumbnail-carousel",this.linkClicked=new Rc,this.uid=tJ(),this.config={allowTouchMove:!1,slidesOffsetBefore:4,slidesOffsetAfter:4,slidesPerView:"auto",spaceBetween:4,watchOverflow:!0},this.navigation={prevEl:"#"+this.prevButtonId,nextEl:"#"+this.nextButtonId}}get prevButtonId(){return`ccf-thumbnail-carousel-prev-button-${this.uid}`}get nextButtonId(){return`ccf-thumbnail-carousel-next-button-${this.uid}`}itemId(t,e){return e.thumbnail}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-thumbnail-carousel"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},inputs:{data:"data"},outputs:{linkClicked:"linkClicked"},decls:11,vars:6,consts:[[1,"prev"],["mat-icon-button","","disableRipple",""],[1,"swiper",3,"config","navigation"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"next"],[1,"fade"],["swiperSlide",""],[1,"slide"],[1,"thumbnail"],[1,"link",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"button",1),ra(2,"mat-icon"),Za(3,"navigate_before"),sa(),sa(),sa(),ra(4,"swiper",2),Jo(5,JZ,2,0,"ng-container",3),sa(),ra(6,"div",4),ra(7,"button",1),oa(8,"div",5),ra(9,"mat-icon"),Za(10,"navigate_next"),sa(),sa(),sa()),2&t&&(ws(1),Ko("id",e.prevButtonId),ws(3),na("config",e.config)("navigation",e.navigation),ws(1),na("ngForOf",e.data)("ngForTrackBy",e.itemId),ws(2),Ko("id",e.nextButtonId))},directives:[__,p_,OQ,yh,CQ],styles:['[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%]{flex-grow:1;padding-bottom:.3125rem}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%] .swiper-slide{width:3.75rem;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:1.5rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{position:absolute;top:-.625rem;left:-2rem;z-index:10;width:2rem;height:3.125rem;opacity:1;transition:opacity ease-in-out .3s;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%]{cursor:default;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background-size:cover;position:relative;width:calc(100% - 2 * .125rem);height:calc(100% - 2 * .125rem);border-style:solid;border-width:.125rem;border-radius:.25rem;background-origin:padding-box;background-clip:padding-box;font-size:.875rem;font-weight:bold}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-.125rem;left:-.125rem;width:.125rem;height:.125rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;bottom:0;right:0;left:0;opacity:0;transition:opacity ease-in-out .3s;box-shadow:0 2px 4px #0009;font-size:.75rem;line-height:.75rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%], [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:link, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:visited, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:focus, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:active{cursor:pointer;text-decoration:none}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]:hover .link[_ngcontent-%COMP%]{opacity:1}'],changeDetection:0}),t})();function nJ(t,e){if(1&t){const t=ua();ra(0,"mat-icon",14),fa("click",function(){return $e(t),va().toggleExpansion()}),Za(1),sa()}if(2&t){const t=va();ws(1),Ja(t.expanded?"expand_less":"expand_more")}}function iJ(t,e){if(1&t&&oa(0,"ccf-tissue-section-vis",20),2&t){const t=va(2);na("totalTissueSections",t.tissueBlock.sectionCount)("tissueSections",t.tissueBlock.sections)}}function rJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"ccf-thumbnail-carousel",21),fa("linkClicked",function(e){return $e(t),va(2).linkHandler(e.link)}),sa(),la()}if(2&t){const t=va(2);ws(1),na("data",t.tissueBlock.datasets)}}function sJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"ccf-thumbnail-carousel",21),fa("linkClicked",function(e){return $e(t),va(3).linkHandler(e.link)}),sa(),la()}if(2&t){const t=va().$implicit;ws(1),na("data",t.datasets)}}function oJ(t,e){if(1&t){const t=ua();ra(0,"div",22),ra(1,"div",23),ra(2,"mat-icon",24),Za(3,"bubble_chart"),sa(),ra(4,"div",17),ra(5,"div",8),Za(6),sa(),ra(7,"div",8),Za(8),sa(),sa(),ra(9,"div",9),fa("click",function(){const e=$e(t).$implicit;return va(2).linkHandler(e.link)}),ra(10,"div",10),Za(11,"TISSUE SECTION"),sa(),ra(12,"mat-icon",11),Za(13,"open_in_new"),sa(),sa(),sa(),Jo(14,sJ,2,1,"ng-container",13),sa()}if(2&t){const t=e.$implicit;ws(6),Ja(t.label),ws(2),Ja(t.description),ws(6),na("ngIf",t.datasets.length>0)}}function aJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"div",15),ra(2,"div",16),ra(3,"mat-icon",5),Za(4,"bubble_chart"),sa(),ra(5,"div",17),ra(6,"div",8),Za(7),sa(),ra(8,"div",8),Za(9),sa(),sa(),ra(10,"div",9),fa("click",function(){$e(t);const e=va();return e.linkHandler(e.tissueBlock.link)}),ra(11,"div",10),Za(12,"TISSUE BLOCK"),sa(),ra(13,"mat-icon",11),Za(14,"open_in_new"),sa(),sa(),sa(),Jo(15,iJ,1,2,"ccf-tissue-section-vis",18),Jo(16,rJ,2,1,"ng-container",13),sa(),Jo(17,oJ,15,3,"div",19),la()}if(2&t){const t=va();ws(7),Ja(t.tissueBlock.label),ws(2),Ja(t.tissueBlock.description),ws(6),na("ngIf",t.tissueBlock.sections.length>1),ws(1),na("ngIf",t.tissueBlock.datasets.length>0),ws(1),na("ngForOf",t.tissueBlock.sections)}}const lJ=function(t){return{"background-color":t}};let cJ=(()=>{class t{constructor(t){this.ga=t,this.clsName="ccf-donor-card",this.selected=!1,this.expanded=!1,this.highlighted=!1,this.checked=new Rc,this.linkClick=new Rc,this.hoverState=""}handleCheckbox(){this.selected=!this.selected,this.ga.event("selected_toggled","donor_card",this.tissueBlock.label,+this.selected),this.checked.emit(this.selected),this.expanded=!1}toggleExpansion(){this.selected&&(this.expanded=!this.expanded,this.ga.event("expanded_toggled","donor_card",this.tissueBlock.label,+this.expanded))}linkHandler(t){this.ga.event("link_clicked","donor_card",this.tissueBlock.label),this.selected?this.linkClick.emit(t):(this.selected=!0,this.checked.emit(this.selected))}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{tissueBlock:"tissueBlock",selected:"selected",color:"color",expanded:"expanded",highlighted:"highlighted"},outputs:{checked:"checked",linkClick:"linkClick"},decls:19,vars:20,consts:[[1,"main-container"],[1,"checkbox-background",3,"ngStyle","click"],[1,"checkbox",3,"checked"],[1,"hoverable","default-padding","donor","mat-elevation-z2"],[1,"d-flex"],[1,"icon-size","icon-dark","mr-5"],[1,"donor-info"],[1,"title","description"],[1,"description"],[1,"hover-state","mat-elevation-z4",3,"click"],[1,"hover-title"],[1,"icon-size","hover-icon"],["class","icon-size ml-5 selectable",3,"click",4,"ngIf"],[4,"ngIf"],[1,"icon-size","ml-5","selectable",3,"click"],[1,"expanded-view","mat-elevation-z2","align-end"],[1,"info-block","hover-enabled","default-padding"],[1,"text-content"],[3,"totalTissueSections","tissueSections",4,"ngIf"],["class","expanded-view w-80 mat-elevation-z2 align-end",4,"ngFor","ngForOf"],[3,"totalTissueSections","tissueSections"],[1,"mt-05",3,"data","linkClicked"],[1,"expanded-view","w-80","mat-elevation-z2","align-end"],[1,"default-padding","info-block","hover-enabled"],[1,"icon-size","mr-5","icon-light"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),fa("click",function(){return e.handleCheckbox()}),oa(2,"mat-checkbox",2),sa(),ra(3,"div",3),ra(4,"div",4),ra(5,"mat-icon",5),Za(6,"person"),sa(),ra(7,"div",6),ra(8,"div",7),Za(9),sa(),ra(10,"div",8),Za(11),sa(),sa(),sa(),ra(12,"div",9),fa("click",function(){return e.linkHandler(e.tissueBlock.donor.link)}),ra(13,"div",10),Za(14,"DONOR"),sa(),ra(15,"mat-icon",11),Za(16,"open_in_new"),sa(),sa(),Jo(17,nJ,2,1,"mat-icon",12),sa(),sa(),Jo(18,aJ,18,5,"ng-container",13)),2&t&&(ws(1),ja("selected",e.selected)("highlighted",e.highlighted),na("ngStyle",Tc(18,lJ,e.selected?e.color:"transparent")),ws(1),ja("checkselected",e.selected),na("checked",e.selected),ws(1),ja("hover-enabled",e.selected)("expanded",e.expanded)("highlighted",e.highlighted),ws(6),Ja(e.tissueBlock.donor.label),ws(2),Ja(e.tissueBlock.donor.description),ws(6),na("ngIf",e.selected),ws(1),na("ngIf",e.expanded))},directives:[Th,oX,p_,_h,yh,QZ,eJ],styles:["[_nghost-%COMP%]{width:100%}[_nghost-%COMP%] .main-container[_ngcontent-%COMP%]{display:flex;min-height:3rem;width:100%;align-items:center;padding-left:.5rem}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%]{height:2rem;width:2rem;border-radius:50%;margin-right:.5rem;display:flex;justify-content:center;align-items:center;cursor:pointer}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-checked.mat-accent .mat-checkbox-background, [_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-indeterminate.mat-accent[_ngcontent-%COMP%] .mat-checkbox-background[_ngcontent-%COMP%]{background-color:transparent}[_nghost-%COMP%] .checkbox-background.highlighted[_ngcontent-%COMP%] .mat-ripple-element{opacity:.04}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkselected[_ngcontent-%COMP%] .mat-checkbox-frame{border-color:#fff!important}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{margin-left:1.12rem;margin-bottom:.12rem}[_nghost-%COMP%] .align-end[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;width:100%;align-items:center}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]:not(:first-child){margin-top:.5rem}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .donor.highlighted[_ngcontent-%COMP%]{box-shadow:0 6px 2px -2px #0003,0 4px 4px #00000024,0 2px 10px #0000001f}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .hover-state[_ngcontent-%COMP%]{width:19.5rem!important}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .hoverable[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]:hover .hover-state[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%]{transition:opacity .15s ease-in-out;opacity:0;cursor:pointer;position:absolute;height:100%;width:100%;top:0;margin-left:-.5rem;align-items:center;display:flex;justify-content:flex-end;padding-right:1rem;font-size:.75rem}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-title[_ngcontent-%COMP%]{font-weight:lighter}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-icon[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .default-padding[_ngcontent-%COMP%]{padding:.25rem .5rem}[_nghost-%COMP%] .expanded-view[_ngcontent-%COMP%]{margin-top:.25rem;width:85%;margin-bottom:.25rem}[_nghost-%COMP%] .d-flex[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .icon-size[_ngcontent-%COMP%]{height:1.5rem;width:1.5rem;font-size:1.5rem}[_nghost-%COMP%] .selectable[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%]{width:80%!important}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:16rem!important}[_nghost-%COMP%] .ml-5[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .mr-5[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .mt-05[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),t})();function uJ(t,e){if(1&t&&(ra(0,"div",7),ra(1,"div",8),Za(2),sa(),ra(3,"div",9),Za(4),sa(),sa()),2&t){const t=e.$implicit;ws(2),Ja(t.count),ws(2),Ja(t.label)}}function hJ(t,e){if(1&t){const t=ua();ra(0,"div",10),fa("mouseenter",function(){const e=$e(t).$implicit;return va().handleHover(e.tissueBlock.spatialEntityId)})("mouseleave",function(){return $e(t),va().handleUnhover()}),ra(1,"ccf-donor-card",11),fa("checked",function(e){const n=$e(t).$implicit;return va().handleSelection(n,e)})("linkClick",function(e){return $e(t),va().handleLinkClick(e)}),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ws(1),na("tissueBlock",t.tissueBlock)("selected",t.selected)("color",t.color)("highlighted",t.tissueBlock.spatialEntityId===n.highlighted)}}let dJ=(()=>{class t{constructor(t){this.ga=t,this.linkClicked=new Rc,this.listResultSelected=new Rc,this.listResultDeselected=new Rc,this.itemHovered=new Rc,this.itemUnhovered=new Rc,this.atScrollBottom=!1}handleSelection(t,e){this.ga.event("list_result_selected","results_browser",this.resultLabel,+e),e?this.listResultSelected.next(t):this.listResultDeselected.next(t)}handleLinkClick(t){this.linkClicked.emit(t)}onScroll(t){if(!t.target)return;const{clientHeight:e,scrollHeight:n,scrollTop:i}=t.target;this.atScrollBottom=n-i-e<64}handleHover(t){this.itemHovered.emit(t)}handleUnhover(){this.itemUnhovered.emit()}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:5,consts:[[1,"results-browser-container"],[1,"stat-box"],["id","title"],["class","stat-row",4,"ngFor","ngForOf"],[1,"results-browser-list",3,"scroll"],["class","browser-item-container",3,"mouseenter","mouseleave",4,"ngFor","ngForOf"],[1,"scroll-gradient"],[1,"stat-row"],[1,"stat-value"],[1,"stat-label"],[1,"browser-item-container",3,"mouseenter","mouseleave"],[3,"tissueBlock","selected","color","highlighted","checked","linkClick"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),Za(3),sa(),Jo(4,uJ,5,2,"div",3),sa(),ra(5,"div",4),fa("scroll",function(t){return e.onScroll(t)}),Jo(6,hJ,2,4,"div",5),sa(),oa(7,"div",6),sa()),2&t&&(ws(3),Ja(e.resultLabel),ws(1),na("ngForOf",e.aggregateData),ws(2),na("ngForOf",e.listResults),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[yh,cJ],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 7rem);padding:0 1.5rem 1.5rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%]{margin-bottom:1.5rem;line-height:1.25;min-height:7.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] #title[_ngcontent-%COMP%]{font-size:1.25rem;margin-bottom:.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-value[_ngcontent-%COMP%]{margin-right:1rem;width:5.5rem;text-align:right;font-weight:600}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-label[_ngcontent-%COMP%]{font-weight:300}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;overflow-y:scroll;scrollbar-width:thin;padding-right:.5rem;margin-bottom:2rem}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%] .browser-item-container[_ngcontent-%COMP%]{width:100%}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();function pJ(t,e){1&t&&(ra(0,"a",5),Za(1,"LOGIN"),sa()),2&t&&na("href",va().hubmapPortalUrl+"login",_r)}function fJ(t,e){1&t&&(ra(0,"a",5),Za(1,"LOGOUT"),sa()),2&t&&na("href",va().hubmapPortalUrl+"logout",_r)}let gJ=(()=>{class t{constructor(){this.refreshClicked=new Rc,this.downloadClicked=new Rc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-header"]],inputs:{hubmapPortalUrl:"hubmapPortalUrl",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:3,consts:[[1,"ccf-header"],[1,"portal-home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right","svgIcon","app:logo",1,"logo"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"href",4,"ngIf"],["mat-button","","rel","noreferrer noopener","target","_blank",1,"authentication",3,"href"]],template:function(t,e){1&t&&(ra(0,"mat-toolbar",0),ra(1,"a",1),oa(2,"mat-icon",2),sa(),oa(3,"div",3),Jo(4,pJ,2,1,"a",4),Jo(5,fJ,2,1,"a",4),sa()),2&t&&(ws(1),na("href",e.hubmapPortalUrl,_r),ws(3),na("ngIf",!e.loggedIn),ws(1),na("ngIf",e.loggedIn))},directives:[BG,p_,ew,_h,w_],styles:[".ccf-header[_ngcontent-%COMP%]{height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid;display:flex}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%}.ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%]{height:1.5rem}.ccf-header[_ngcontent-%COMP%] .authentication[_ngcontent-%COMP%]{width:8.25rem;border-radius:.125rem;font-weight:500}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{display:flex;align-items:center;transition:color 1s;cursor:pointer;text-decoration:none}.ccf-header[_ngcontent-%COMP%] [_ngcontent-%COMP%]:not(:last-child){margin-right:1.5rem}.ccf-header[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}.ccf-header[_ngcontent-%COMP%] .filter-labels[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;font:400 1rem/1.25rem Inter,sans-serif}"],changeDetection:0}),t})();const mJ=["bodyUI"];function bJ(t,e){if(1&t&&(oa(0,"ccf-header",33),Ic(1,"async")),2&t){const t=va();na("hubmapPortalUrl",Mc(1,2,t.portalUrl$))("loggedIn",t.loggedIn)}}const yJ=function(){return{}},vJ=function(){return{x:2.2,y:2,z:.4}};let _J=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c){this.data=n,this.theming=i,this.scene=r,this.listResultsState=s,this.consentService=o,this.snackbar=a,this.globalConfig=c,this.ontologySelectionLabel="Body",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=RG.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(D(t=>t===Nq.Running)),this.portalUrl$=this.globalConfig.getOption("hubmapPortalUrl"),i.initialize(t,e),l.setRootElement(t),n.tissueBlockData$.subscribe(),n.aggregateData$.subscribe(),n.termOccurencesData$.subscribe(),n.sceneData$.subscribe(),n.filter$.subscribe(),n.technologyFilterData$.subscribe(),n.providerFilterData$.subscribe(),this.ontologyTerms$=n.filter$.pipe(FU("ontologyTerms"))}ngOnInit(){const t=this.snackbar.openFromComponent(TG,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia&&(window.matchMedia("(prefers-color-scheme: dark)").matches&&this.theming.setTheme(IG),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.theming.setTheme(t.matches?IG:PG)}))}reset(t,e,n){t.open(),t.closeExpanded(),e.open(),e.closeExpanded(),n.removeBox(),this.resetView()}resetView(){this.bodyUI.target=[0,0,0],this.bodyUI.rotation=0,this.bodyUI.rotationX=0,this.bodyUI.bounds={x:2.2,y:2,z:.4}}toggleScheme(){this.theming.setTheme(this.theming.getTheme()===PG?IG:PG)}ontologySelected(t){if(t)return this.data.updateFilter({ontologyTerms:t.map(t=>t.id)}),this.ontologySelectionLabel=this.createSelectionLabel(t),void(t[0]&&"body"===t[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[]}),this.ontologySelectionLabel=""}createSelectionLabel(t){if(0===t.length)return"";if(1===t.length)return t[0].label;let e="";return t.forEach((n,i)=>{e+=n.label,inull==t?void 0:t.startsWith(e))?(this.url=t,this.viewerOpen=!!t):(window.open(t,"_blank"),this.closeiFrameViewer())}closeiFrameViewer(){this.viewerOpen=!1}get loggedIn(){var t;return(null!==(t=this.globalConfig.snapshot.hubmapToken)&&void 0!==t?t:"").length>0}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(No),ea(Fq),ea(MG),ea(Wq),ea(zq),ea(Y$),ea(q_),ea(Nf),ea(SG))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-root"]],viewQuery:function(t,e){if(1&t&&qc(mJ,5),2&t){let t;Wc(t=Yc())&&(e.bodyUI=t.first)}},decls:70,vars:77,consts:[[1,"ccf-app","mat-app-background"],["text","Loading CCF Exploration User Interface (EUI)",3,"active"],[3,"hubmapPortalUrl","loggedIn",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","filtersChange"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],[3,"termData","occurenceData","ontologySelection"],["position","end","opened","",1,"right-drawer",3,"stateChange"],["right",""],[1,"portal-view",3,"url","closed"],[1,"drawer-icons"],[1,"drawer-icons-left"],[1,"button",3,"matTooltip","click"],[1,"icon"],[1,"scheme-toggle","button",3,"matTooltip","click"],[1,"button"],["matTooltip","Reset View",1,"refresh","icon",3,"click"],["videoID","YAHJqvD3Q_8","infoTitle","HuBMAP CCF Exploration User Interface","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],[1,"close-button-wrapper"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"hubmapPortalUrl","loggedIn"]],template:function(t,e){if(1&t){const t=ua();ra(0,"div",0),oa(1,"ccf-spinner-overlay",1),Ic(2,"async"),Jo(3,bJ,2,4,"ccf-header",2),Ic(4,"async"),ra(5,"ccf-drawer-container",3),ra(6,"ccf-drawer",4,5),fa("stateChange",function(){return $e(t),ta(11).removeBox()}),ra(8,"div"),ra(9,"div",6),ra(10,"ccf-filters-popover",7,8),fa("filtersChange",function(t){return e.data.updateFilter(t)}),Ic(12,"async"),Ic(13,"async"),Ic(14,"async"),sa(),ra(15,"div",9),ra(16,"div",10),Za(17,"Sex: "),ra(18,"strong"),Za(19),Ic(20,"async"),sa(),sa(),ra(21,"div",11),Za(22,"Age: "),ra(23,"strong"),Za(24),Ic(25,"async"),Ic(26,"async"),sa(),sa(),ra(27,"div",12),Za(28,"BMI: "),ra(29,"strong"),Za(30),Ic(31,"async"),Ic(32,"async"),sa(),sa(),sa(),sa(),ra(33,"ccf-ontology-selection",13),fa("ontologySelection",function(t){return e.ontologySelected(t)}),Ic(34,"async"),Ic(35,"async"),sa(),oa(36,"ccf-drawer-toggle-button"),sa(),sa(),ra(37,"ccf-drawer",14,15),fa("stateChange",function(){return $e(t),ta(11).removeBox()}),ra(39,"ccf-viewer",16),fa("closed",function(){return e.viewerOpen=!1}),sa(),ra(40,"div",17),ra(41,"div",18),ra(42,"button",19),fa("click",function(){$e(t);const e=ta(11),n=ta(38);return e.removeBox(),n.toggleExpanded()}),ra(43,"mat-icon",20),Za(44),sa(),sa(),ra(45,"button",21),fa("click",function(){return e.toggleScheme()}),ra(46,"mat-icon",20),Za(47),sa(),sa(),ra(48,"button",22),ra(49,"mat-icon",23),fa("click",function(){$e(t);const n=ta(7),i=ta(38),r=ta(11);return e.reset(n,i,r)}),Za(50,"refresh "),sa(),sa(),sa(),oa(51,"ccf-info-button",24),sa(),ra(52,"ccf-results-browser",25),fa("listResultSelected",function(t){return e.listResultsState.selectListResult(t)})("listResultDeselected",function(t){return e.listResultsState.deselectListResult(t)})("linkClicked",function(t){return e.openiFrameViewer(t)})("itemHovered",function(t){return e.listResultsState.highlightNode(t)})("itemUnhovered",function(){return e.listResultsState.unHighlightNode()}),Ic(53,"async"),Ic(54,"async"),Ic(55,"async"),sa(),oa(56,"ccf-drawer-toggle-button"),sa(),ra(57,"ccf-drawer-content"),ra(58,"div",26),ra(59,"ccf-organ-selector",27),fa("organsChanged",function(t){return e.scene.setSelectedReferenceOrgans(t)}),Ic(60,"async"),Ic(61,"async"),Ic(62,"async"),sa(),sa(),ra(63,"div",28),ra(64,"div",29),fa("click",function(){return e.organListVisible=!e.organListVisible}),ra(65,"mat-icon",30),Za(66),sa(),sa(),sa(),ra(67,"ccf-body-ui",31,32),fa("nodeClick",function(t){return e.scene.sceneNodeClicked(t)})("nodeHoverStart",function(t){return e.scene.sceneNodeHovered(t)})("nodeHoverStop",function(){return e.scene.sceneNodeUnhover()}),Ic(69,"async"),sa(),sa(),sa(),sa()}if(2&t){const t=ta(38);let n,i,r,s;ws(1),na("active",Mc(2,37,e.spinnerActive$)),ws(2),na("ngIf",!1===Mc(4,39,e.spinnerActive$)),ws(7),na("filters",Mc(12,41,e.data.filter$))("drawerExpanded",t.expanded)("technologyFilters",Mc(13,43,e.data.technologyFilterData$))("providerFilters",Mc(14,45,e.data.providerFilterData$)),ws(9),Ja(null==(n=Mc(20,47,e.data.filter$))?null:n.sex),ws(5),el("",null==(i=Mc(25,49,e.data.filter$))?null:i.ageRange[0],"-",null==(i=Mc(26,51,e.data.filter$))?null:i.ageRange[1],""),ws(6),el("",null==(r=Mc(31,53,e.data.filter$))?null:r.bmiRange[0],"-",null==(r=Mc(32,55,e.data.filter$))?null:r.bmiRange[1],""),ws(3),na("termData",Mc(34,57,e.data.ontologyTermsFullData$))("occurenceData",Mc(35,59,e.data.termOccurencesData$)),ws(6),ja("opened",e.viewerOpen),na("url",e.url),ws(3),na("matTooltip",t.expanded?"Exit Fullscreen":"Enter Fullscreen"),ws(2),Ja(t.expanded?"fullscreen_exit":"fullscreen"),ws(1),na("matTooltip","light-theme"===e.theming.getTheme()?"Enter Dark Mode":"Enter Light Mode"),ws(2),tl("","light-theme"===e.theming.getTheme()?"brightness_2":"brightness_5"," "),ws(5),na("listResults",Mc(53,61,e.listResultsState.listResults$))("aggregateData",Mc(54,63,e.data.aggregateData$))("resultLabel",e.ontologySelectionLabel)("highlighted",Mc(55,65,e.listResultsState.highlightedNodeId$)),ws(6),ja("closed",!e.organListVisible),ws(1),na("multiselect",!0)("occurenceData",null!==(s=Mc(60,67,e.data.termOccurencesData$))&&void 0!==s?s:Oc(75,yJ))("organList",Mc(61,69,e.scene.referenceOrgans$))("selectedOrgans",Mc(62,71,e.scene.selectedReferenceOrgans$)),ws(4),ja("closed",!e.organListVisible),ws(3),tl(" ",e.organListVisible?"arrow_drop_up":"arrow_drop_down"," "),ws(1),ja("expanded-stage",!e.organListVisible),na("scene",Mc(69,73,e.scene.scene$))("bounds",Oc(76,vJ))}},directives:[nZ,_h,fZ,cZ,kZ,$Z,GZ,XZ,ew,p_,wG,dJ,sZ,hG,nG,gJ],pipes:[Dh],styles:[".cdk-overlay-container{position:absolute;font-size:1.2rem}[_nghost-%COMP%]{display:block;position:relative}.ccf-app[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;position:relative;text-align:left}.ccf-app[_ngcontent-%COMP%] ccf-header[_ngcontent-%COMP%]{z-index:99}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{flex-grow:1;height:100%;width:100%;opacity:1;overflow:visible;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{overflow:hidden;margin-bottom:1.5rem;border-radius:.5rem;height:100%;padding-bottom:4rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .organ-selector[_ngcontent-%COMP%]{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:28.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%]{display:flex;padding-left:1.5rem;height:5rem;padding-right:1.5rem;align-items:center;justify-content:space-between}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;padding:.65rem;transition:.6s}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5rem;transition:all .5s ease-in-out}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-4.25rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{transition:all .5s ease-in-out;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem;height:calc(100% - 6rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:100%;padding-bottom:3rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;border-top-right-radius:.5rem;border-top-left-radius:.5rem;height:0}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{display:flex;justify-content:center;height:1.0625rem;width:3rem;align-self:center;border-radius:0 0 .25rem .25rem;cursor:pointer;transition:.6s;position:relative;top:.5rem;z-index:1}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{position:relative;bottom:.2rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%]{padding-left:1.5rem;padding-right:1.5rem;height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%]{height:5rem;display:flex;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:75%;margin-left:1.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%]{font-weight:300}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600!important}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view[_ngcontent-%COMP%]{position:fixed;left:0;top:0;bottom:0;right:425%;height:100%;transform:translate(-425%);width:calc(100% - 28.5rem);transition:transform .5s cubic-bezier(.82,.085,.395,.895)}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view.opened[_ngcontent-%COMP%]{transform:translate(0);transition:width 0s .5s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view[_ngcontent-%COMP%]{width:100vw}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view.opened[_ngcontent-%COMP%]{transition:width 0s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .shaded-toggle[_ngcontent-%COMP%]{box-shadow:-1px 0 4px #212121}[_ngcontent-%COMP%]::-webkit-scrollbar{width:7.5rem}"],changeDetection:0}),t})();function wJ(t,e){1&t&&oa(0,"ccf-root")}function xJ(t){const e=t=>"string"==typeof t,n=t=>Array.isArray(t)&&t.every(e);if("string"==typeof t){const e=eZ.json(t);if(n(e))return e}else if(n(t))return t;throw new Error("Invalid data sources")}let SJ=(()=>{class t extends tZ{constructor(t,e){super(t,e,{initialDelay:10,initialConfig:Object.assign(Object.assign({},RG.dbOptions),globalThis.dbOptions),parse:{dataSources:xJ,useRemoteApi:eZ.boolean}})}}return t.\u0275fac=function(e){return new(e||t)(ea(SG),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-root-wc"]],inputs:{dataSources:"dataSources",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[jo],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&Jo(0,wJ,1,0,"ccf-root",0),2&t&&na("ngIf",e.initialized)},directives:[_h,_J],encapsulation:2,changeDetection:0}),t})(),EJ=(()=>{class t{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(t,e){const n=function(t,e){return e.get(El).resolveComponentFactory(t).inputs}(t,e.injector),i=e.strategyFactory||new Bf(t,e.injector),r=function(t){const e={};return t.forEach(({propName:t,templateName:n})=>{e[function(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}(n)]=t}),e}(n);class s extends zf{constructor(t){super(),this.injector=t}get ngElementStrategy(){if(!this._ngElementStrategy){const t=this._ngElementStrategy=i.create(this.injector||e.injector);n.forEach(({propName:e})=>{if(!this.hasOwnProperty(e))return;const n=this[e];delete this[e],t.setInputValue(e,n)})}return this._ngElementStrategy}attributeChangedCallback(t,e,n,i){this.ngElementStrategy.setInputValue(r[t],n)}connectedCallback(){let t=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),t=!0),this.ngElementStrategy.connect(this),t||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(t=>{const e=function(t,e,n){if("function"!=typeof CustomEvent){const i=t.createEvent("CustomEvent");return i.initCustomEvent(e,!1,!1,n),i}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:n})}(this.ownerDocument,t.name,t.value);this.dispatchEvent(e)})}}return s.observedAttributes=Object.keys(r),n.forEach(({propName:t})=>{Object.defineProperty(s.prototype,t,{get(){return this.ngElementStrategy.getInputValue(t)},set(e){this.ngElementStrategy.setInputValue(t,e)},configurable:!0,enumerable:!0})}),s}(SJ,{injector:this.injector});customElements.define("ccf-eui",t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(No))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:AG,useValue:"light-theme"},{provide:gf,useExisting:Nf}],imports:[[ky,gd,Yq,BQ,EY,KY,f_,xY,RQ,KQ,iG,dG,xG,rw,QQ,kG,G_]]}),t})();RG.production&&function(){if(Ru)throw new Error("Cannot enable prod mode after platform setup.");Du=!1}(),pd().bootstrapModule(EJ).catch(t=>console.error(t))},91052:function(t){function e(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(i,r)}t.exports=function(t){return function(){var n=this,i=arguments;return new Promise(function(r,s){var o=t.apply(n,i);function a(t){e(o,r,s,a,l,"next",t)}function l(t){e(o,r,s,a,l,"throw",t)}a(void 0)})}},t.exports.default=t.exports,t.exports.__esModule=!0},61948:function(t){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},34321:function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},91741:function(t){function e(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}e.keys=function(){return[]},e.resolve=e,e.id=91741,t.exports=e},9521:function(){},49125:function(){},75307:function(){}},function(t){t(t.s=35090)}]); \ No newline at end of file diff --git a/main-es5.js b/main-es5.js index 414c43e69..fead3a199 100644 --- a/main-es5.js +++ b/main-es5.js @@ -1 +1 @@ -!function(){function e(t,n,i){return(e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(t,n,i||t)}function t(e,t){return r(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);a=!0);}catch(u){s=!0,r=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return o}(e,t)||w(e,t)||i()}function n(e){return r(e)||g(e)||w(e)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(e){if(Array.isArray(e))return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function s(e){var t=f();return function(){var n,i=p(e);if(t){var r=p(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return u(this,n)}}function u(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return h(e,arguments,p(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),d(i,e)})(e)}function h(e,t,n){return(h=f()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&d(r,n.prototype),r}).apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e){return function(e){if(Array.isArray(e))return k(e)}(e)||g(e)||w(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function w(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&r[r.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,o=[],a=16383,s=0,u=n-r;su?u:s+a));return 1===r?o.push(i[(t=e[n-1])>>2]+i[t<<4&63]+"=="):2===r&&o.push(i[(t=(e[n-2]<<8)+e[n-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),o.join("")};for(var i=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e){return i[e>>18&63]+i[e>>12&63]+i[e>>6&63]+i[63&e]}function h(e,t,n){for(var i=[],r=t;r>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(r>0&&(e.lastNeed=r-1),r):--i=0?(r>0&&(e.lastNeed=r-2),r):--i=0?(r>0&&(2===r?r=0:e.lastNeed=r-3),r):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":4}],6:[function(e,t,n){(function(t){(function(){"use strict";var t=e("base64-js"),i=e("ieee754");n.Buffer=a,n.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function o(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|f(e,t),i=o(n),r=i.write(e,t);return r!==n&&(i=i.slice(0,r)),i}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return i?-1:L(e).length;t=(""+t).toLowerCase(),r=!0}}function d(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return E(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function p(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function v(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=a.from(t,i)),a.isBuffer(t))return 0===t.length?-1:g(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,i,r){var o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var h=!0,f=0;fr&&(i=r):i=r;var o=t.length;i>o/2&&(i=o/2);for(var a=0;a>8,r.push(n%256),r.push(i);return r}(t,e.length-n),e,n,i)}function x(e,n,i){return t.fromByteArray(0===n&&i===e.length?e:e.slice(n,i))}function S(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r239?4:c>223?3:c>191?2:1;if(r+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[r+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:a=e[r+2],128==(192&(o=e[r+1]))&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[r+2],s=e[r+3],128==(192&(o=e[r+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(i.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),i.push(l),r+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",i=0;ii)&&(n=i);for(var r="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,i,r,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function M(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}n.kMaxLength=r,!(a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}())&&"undefined"!=typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(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}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(e,t,n){return s(e,t,n)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,r=0,o=Math.min(n,i);rt&&(e+=" ... "),""},a.prototype.compare=function(e,t,n,i,r){if(B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(r>>>=0)-(i>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(o,s),c=this.slice(i,r),l=e.slice(t,n),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return m(this,e,t,n);case"utf8":case"utf-8":return y(this,e,t,n);case"ascii":return b(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||A(e,t,this.length);for(var i=this[e],r=1,o=0;++o>>=0,t>>>=0,n||A(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},a.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);for(var i=this[e],r=1,o=0;++o=(r*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||P(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,i||P(this,e,t,n,Math.pow(2,8*n)-1,0);var r=n-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,i){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&0!==i&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),t);return r},a.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var r=e.charCodeAt(0);("utf8"===i&&r<128||"latin1"===i)&&(e=r)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,i){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(e,t,n){"use strict";t.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(function(t,n,i){return t+(0===i?"":",")+e(void 0===n||"symbol"==typeof n?null:n)},"")+"]":"{"+Object.keys(t).sort().reduce(function(n,i,r){return void 0===t[i]||"symbol"==typeof t[i]?n:n+(0===n.length?"":",")+e(i)+":"+e(t[i])},"")+"}"}},{}],8:[function(e,t,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise(function(n,i){function r(n){e.removeListener(t,o),i(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,r)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function h(e,t,n,i){var r,o,a;if(c(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=i?[n,a]:[a,n]:i?a.unshift(n):a.push(n),(r=l(e))>0&&a.length>r&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=f.bind(i);return r.listener=n,i.wrapFn=r,r}function p(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=r[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,l=g(u,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},s.prototype.listenerCount=v,s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},{}],9:[function(e,t,n){n.read=function(e,t,n,i,r){var o,a,s=8*r-i-1,u=(1<>1,l=-7,h=n?r-1:0,f=n?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=i;l>0;a=256*a+e[t+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),o-=c}return(d?-1:1)*a*Math.pow(2,o-i)},n.write=function(e,t,n,i,r,o){var a,s,u,c=8*o-r-1,l=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*u-1)*Math.pow(2,r),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[n+d]=255&s,d+=p,s/=256,r-=8);for(a=a<0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*v}},{}],10:[function(e,t,n){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t,n){"use strict";var i=e("./types"),r=i.isArray,o=i.isObject,a=i.isString,s=e("./util").asArray,u=e("./url").prependBase,c=e("./JsonLdError"),l=e("./ResolvedContext");function f(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function d(e){var t=e.context,n=e.base;if(t){var i=t["@context"];if(a(i))t["@context"]=u(n,i);else if(r(i))for(var s=0;s10)){e.next=2;break}throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});case 2:if(!s.has(n)){e.next=4;break}throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:n});case 4:return s.add(n),e.prev=5,e.next=8,i(n);case 8:l=e.sent,u=l.document||null,a(u)&&(u=JSON.parse(u)),e.next=16;break;case 13:throw e.prev=13,e.t0=e.catch(5),new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:n,cause:e.t0});case 16:if(o(u)){e.next=18;break}throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:n});case 18:return e.abrupt("return",(u="@context"in u?{"@context":u["@context"]}:{"@context":{}},l.contextUrl&&(r(u["@context"])||(u["@context"]=[u["@context"]]),u["@context"].push(l.contextUrl)),{context:u,remoteDoc:l}));case 19:case"end":return e.stop()}},e,null,[[5,13]])}))()}}]),e}()},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(e,t,n){"use strict";t.exports=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"An unspecified JSON-LD error occurred.",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"jsonld.Error",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m(this,n),(e=t.call(this,i)).name=r,e.message=i,e.details=o,e}return n}(l(Error))},{}],13:[function(e,t,n){"use strict";t.exports=function(e){var t=function(){function e(){m(this,e)}return b(e,[{key:"toString",value:function(){return"[object JsonLdProcessor]"}}]),e}();return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],14:[function(e,t,n){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(e,t,n){"use strict";t.exports=function(){function e(){m(this,e),this._requests={}}return b(e,[{key:"wrapLoader",value:function(e){var t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}},{key:"add",value:function(e){var t=this;return h(regeneratorRuntime.mark(function n(){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=t._requests[e])){n.next=3;break}return n.abrupt("return",Promise.resolve(i));case 3:return i=t._requests[e]=t._loader(e),n.prev=4,n.next=7,i;case 7:return n.abrupt("return",n.sent);case 8:return n.prev=8,delete t._requests[e],n.finish(8);case 11:case"end":return n.stop()}},n,null,[[4,,8,11]])}))()}}]),e}()},{}],16:[function(e,t,n){"use strict";var i=e("lru-cache");t.exports=function(){function e(t){var n=t.document;m(this,e),this.document=n,this.cache=new i({max:10})}return b(e,[{key:"getProcessed",value:function(e){return this.cache.get(e)}},{key:"setProcessed",value:function(e,t){this.cache.set(e,t)}}]),e}()},{"lru-cache":33}],17:[function(e,i,r){"use strict";var a,s=e("./JsonLdError"),u=e("./types"),c=u.isArray,l=u.isObject,f=u.isString,d=u.isUndefined,p=e("./graphTypes"),v=p.isList,g=p.isValue,m=p.isGraph,y=p.isSimpleGraph,b=p.isSubjectReference,w=e("./context"),k=w.expandIri,x=w.getContextValue,S=w.isKeyword,E=w.process,C=w.processingMode,O=e("./url"),T=O.removeBase,A=O.prependBase,P=e("./util"),M=P.addValue,I=P.asArray,R=P.compareShortestLeast,D={};function N(e,t,n){if("@nest"!==k(e,t,{vocab:!0},n))throw new s("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}i.exports=D,D.compact=(a=h(regeneratorRuntime.mark(function e(t){var i,r,a,u,h,p,w,k,O,T,A,P,R;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.activeCtx,r=t.activeProperty,a=void 0===r?null:r,u=t.element,h=t.options,p=void 0===h?{}:h,w=t.compactionMap,k=void 0===w?function(){}:w,!c(u)){e.next=21;break}O=[],T=0;case 4:if(!(T1&&(L=Array.from(L).sort()),j=i,F=_(L),e.prev=27,F.s();case 29:if((B=F.n()).done){e.next=39;break}if(V=B.value,z=D.compactIri({activeCtx:j,iri:V,relativeTo:{vocab:!0}}),U=x(P,z,"@context"),e.t1=d(U),e.t1){e.next=37;break}return e.next=36,E({activeCtx:i,localCtx:U,options:p,propagate:!1});case 36:i=e.sent;case 37:e.next=29;break;case 39:e.next=44;break;case 41:e.prev=41,e.t2=e.catch(27),F.e(e.t2);case 44:return e.prev=44,F.f(),e.finish(44);case 47:H=Object.keys(u).sort(),G=_(H),e.prev=49,G.s();case 51:if((W=G.n()).done){e.next=184;break}if(q=W.value,X=u[q],"@id"===q){e.next=180;break}if("@type"===q){e.next=174;break}if("@reverse"===q){e.next=167;break}if("@preserve"===q){e.next=161;break}if("@index"===q){e.next=155;break}if("@graph"===q||"@list"===q||"@included"===q||!S(q)){e.next=64;break}Y=D.compactIri({activeCtx:i,iri:q,relativeTo:{vocab:!0}}),M(A,Y,X),e.next=153;break;case 64:if(c(X)){e.next=66;break}throw new s("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");case 66:0===X.length&&(K=D.compactIri({activeCtx:i,iri:q,value:X,relativeTo:{vocab:!0},reverse:T}),Q=i.mappings.has(K)?i.mappings.get(K)["@nest"]:null,$=A,Q&&(N(i,Q,p),l(A[Q])||(A[Q]={}),$=A[Q]),M($,K,X,{propertyIsArray:!0})),Z=_(X),e.prev=68,Z.s();case 70:if((J=Z.n()).done){e.next=145;break}return ee=J.value,te=D.compactIri({activeCtx:i,iri:q,value:ee,relativeTo:{vocab:!0},reverse:T}),ne=i.mappings.has(te)?i.mappings.get(te)["@nest"]:null,ie=A,ne&&(N(i,ne,p),l(A[ne])||(A[ne]={}),ie=A[ne]),re=x(i,te,"@container")||[],oe=m(ee),ae=v(ee),se=void 0,ae?se=ee["@list"]:oe&&(se=ee["@graph"]),e.next=80,D.compact({activeCtx:i,activeProperty:te,element:ae||oe?se:ee,options:p,compactionMap:k});case 80:if(ue=e.sent,!ae){e.next=86;break}if(c(ue)||(ue=[ue]),!re.includes("@list")){e.next=85;break}return M(ie,te,ue,{valueIsArray:!0,allowDuplicate:!0}),e.abrupt("continue",143);case 85:ue=o({},D.compactIri({activeCtx:i,iri:"@list",relativeTo:{vocab:!0}}),ue),"@index"in ee&&(ue[D.compactIri({activeCtx:i,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]);case 86:if(!oe){e.next=90;break}re.includes("@graph")&&(re.includes("@id")||re.includes("@index")&&y(ee))?(ce=void 0,ie.hasOwnProperty(te)?ce=ie[te]:ie[te]=ce={},le=(re.includes("@id")?ee["@id"]:ee["@index"])||D.compactIri({activeCtx:i,iri:"@none",relativeTo:{vocab:!0}}),M(ce,le,ue,{propertyIsArray:!p.compactArrays||re.includes("@set")})):re.includes("@graph")&&y(ee)?(c(ue)&&ue.length>1&&(ue={"@included":ue}),M(ie,te,ue,{propertyIsArray:!p.compactArrays||re.includes("@set")})):(c(ue)&&1===ue.length&&p.compactArrays&&(ue=ue[0]),ue=o({},D.compactIri({activeCtx:i,iri:"@graph",relativeTo:{vocab:!0}}),ue),"@id"in ee&&(ue[D.compactIri({activeCtx:i,iri:"@id",relativeTo:{vocab:!0}})]=ee["@id"]),"@index"in ee&&(ue[D.compactIri({activeCtx:i,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]),M(ie,te,ue,{propertyIsArray:!p.compactArrays||re.includes("@set")})),e.next=143;break;case 90:if(!(re.includes("@language")||re.includes("@index")||re.includes("@id")||re.includes("@type"))){e.next=141;break}if(he=void 0,fe=void 0,ie.hasOwnProperty(te)?he=ie[te]:ie[te]=he={},!re.includes("@language")){e.next=96;break}g(ue)&&(ue=ue["@value"]),fe=ee["@language"],e.next=138;break;case 96:if(!re.includes("@index")){e.next=117;break}if(de=x(i,te,"@index")||"@index",pe=D.compactIri({activeCtx:i,iri:de,relativeTo:{vocab:!0}}),"@index"!==de){e.next=102;break}fe=ee["@index"],delete ue[pe],e.next=115;break;case 102:if(me=void 0,ve=I(ue[de]||[]),ge=n(ve),fe=ge[0],me=ge.slice(1),!f(fe)){e.next=114;break}e.t3=me.length,e.next=0===e.t3?107:1===e.t3?109:111;break;case 107:return delete ue[de],e.abrupt("break",112);case 109:return ue[de]=me[0],e.abrupt("break",112);case 111:ue[de]=me;case 112:e.next=115;break;case 114:fe=null;case 115:e.next=138;break;case 117:if(!re.includes("@id")){e.next=122;break}ye=D.compactIri({activeCtx:i,iri:"@id",relativeTo:{vocab:!0}}),fe=ue[ye],delete ue[ye],e.next=138;break;case 122:if(!re.includes("@type")){e.next=138;break}be=D.compactIri({activeCtx:i,iri:"@type",relativeTo:{vocab:!0}}),_e=void 0,e.t4=(t=I(ue[be]||[]),r=n(t),fe=r[0],(_e=r.slice(1)).length),e.next=0===e.t4?128:1===e.t4?130:132;break;case 128:return delete ue[be],e.abrupt("break",133);case 130:return ue[be]=_e[0],e.abrupt("break",133);case 132:ue[be]=_e;case 133:if(e.t5=1===Object.keys(ue).length&&"@id"in ee,!e.t5){e.next=138;break}return e.next=137,D.compact({activeCtx:i,activeProperty:te,element:{"@id":ee["@id"]},options:p,compactionMap:k});case 137:ue=e.sent;case 138:fe||(fe=D.compactIri({activeCtx:i,iri:"@none",relativeTo:{vocab:!0}})),M(he,fe,ue,{propertyIsArray:re.includes("@set")}),e.next=143;break;case 141:we=!p.compactArrays||re.includes("@set")||re.includes("@list")||c(ue)&&0===ue.length||"@list"===q||"@graph"===q,M(ie,te,ue,{propertyIsArray:we});case 143:e.next=70;break;case 145:e.next=150;break;case 147:e.prev=147,e.t6=e.catch(68),Z.e(e.t6);case 150:return e.prev=150,Z.f(),e.finish(150);case 153:e.next=159;break;case 155:if(!(x(i,a,"@container")||[]).includes("@index")){e.next=157;break}return e.abrupt("continue",182);case 157:ke=D.compactIri({activeCtx:i,iri:q,relativeTo:{vocab:!0}}),M(A,ke,X);case 159:e.next=165;break;case 161:return e.next=163,D.compact({activeCtx:i,activeProperty:a,element:X,options:p,compactionMap:k});case 163:xe=e.sent,c(xe)&&0===xe.length||M(A,q,xe);case 165:e.next=172;break;case 167:return e.next=169,D.compact({activeCtx:i,activeProperty:"@reverse",element:X,options:p,compactionMap:k});case 169:for(Ee in Se=e.sent)i.mappings.has(Ee)&&i.mappings.get(Ee).reverse&&(Ce=Se[Ee],Oe=(x(i,Ee,"@container")||[]).includes("@set")||!p.compactArrays,M(A,Ee,Ce,{propertyIsArray:Oe}),delete Se[Ee]);Object.keys(Se).length>0&&(Te=D.compactIri({activeCtx:i,iri:q,relativeTo:{vocab:!0}}),M(A,Te,Se));case 172:e.next=178;break;case 174:1===(Ae=I(X).map(function(e){return D.compactIri({activeCtx:P,iri:e,relativeTo:{vocab:!0}})})).length&&(Ae=Ae[0]),Pe=D.compactIri({activeCtx:i,iri:"@type",relativeTo:{vocab:!0}}),Me=(x(i,Pe,"@container")||[]).includes("@set")&&C(i,1.1)||c(Ae)&&0===X.length,M(A,Pe,Ae,{propertyIsArray:Me});case 178:e.next=182;break;case 180:1===(Ie=I(X).map(function(e){return D.compactIri({activeCtx:i,iri:e,relativeTo:{vocab:!1},base:p.base})})).length&&(Ie=Ie[0]),A[D.compactIri({activeCtx:i,iri:"@id",relativeTo:{vocab:!0}})]=Ie;case 182:e.next=51;break;case 184:e.next=189;break;case 186:e.prev=186,e.t7=e.catch(49),G.e(e.t7);case 189:return e.prev=189,G.f(),e.finish(189);case 192:return e.abrupt("return",{v:A});case 193:case"end":return e.stop()}},e,null,[[27,41,44,47],[49,186,189,192],[68,147,150,153]])})(),"t3",29);case 29:if("object"!=typeof(R=e.t3)){e.next=32;break}return e.abrupt("return",R.v);case 32:return e.abrupt("return",u);case 33:case"end":return e.stop()}},e)})),function(e){return a.apply(this,arguments)}),D.compactIri=function(e){var n=e.activeCtx,i=e.iri,r=e.value,o=void 0===r?null:r,a=e.relativeTo,u=void 0===a?{vocab:!1}:a,c=e.reverse,h=void 0!==c&&c,f=e.base,d=void 0===f?null:f;if(null===i)return i;n.isPropertyTermScoped&&n.previousContext&&(n=n.previousContext);var p=n.getInverse();if(S(i)&&i in p&&"@none"in p[i]&&"@type"in p[i]["@none"]&&"@none"in p[i]["@none"]["@type"])return p[i]["@none"]["@type"]["@none"];if(u.vocab&&i in p){var y=n["@language"]||"@none",b=[];l(o)&&"@index"in o&&!("@graph"in o)&&b.push("@index","@index@set"),l(o)&&"@preserve"in o&&(o=o["@preserve"][0]),m(o)?("@index"in o&&b.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in o&&b.push("@graph@id","@graph@id@set"),b.push("@graph","@graph@set","@set"),"@index"in o||b.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in o||b.push("@graph@id","@graph@id@set")):l(o)&&!g(o)&&b.push("@id","@id@set","@type","@set@type");var w="@language",k="@null";if(h)w="@type",k="@reverse",b.push("@set");else if(v(o)){"@index"in o||b.push("@list");var x=o["@list"];if(0===x.length)w="@any",k="@none";else{for(var E=0===x.length?y:null,C=null,O=0;O=0;--G){var W,q=V[G],X=_(q.terms);try{for(X.s();!(W=X.n()).done;){var Y=W.value,K=Y+":"+i.substr(q.iri.length);n.mappings.get(Y)._prefix&&(!n.mappings.has(K)||null===o&&n.mappings.get(K)["@id"]===i)&&(null===B||R(K,B)<0)&&(B=K)}}catch(te){X.e(te)}finally{X.f()}}if(null!==B)return B;var Q,$=_(n.mappings);try{for($.s();!(Q=$.n()).done;){var Z=t(Q.value,2),J=Z[0],ee=Z[1];if(ee&&ee._prefix&&i.startsWith(J+":"))throw new s('Absolute IRI "'.concat(i,'" confused with prefix "').concat(J,'".'),"jsonld.SyntaxError",{code:"IRI confused with prefix",context:n})}}catch(te){$.e(te)}finally{$.f()}return u.vocab?i:"@base"in n?n["@base"]?T(A(d,n["@base"]),i):i:T(d,i)},D.compactValue=function(e){var t=e.activeCtx,n=e.activeProperty,i=e.value,r=e.options;if(g(i)){var a=x(t,n,"@type"),s=x(t,n,"@language"),u=x(t,n,"@direction"),c=x(t,n,"@container")||[],l="@index"in i&&!c.includes("@index");if(!l&&"@none"!==a&&(i["@type"]===a||"@language"in i&&i["@language"]===s&&"@direction"in i&&i["@direction"]===u||"@language"in i&&i["@language"]===s||"@direction"in i&&i["@direction"]===u))return i["@value"];var h=Object.keys(i).length,d=1===h||2===h&&"@index"in i&&!l,p="@language"in t,v=f(i["@value"]),m=t.mappings.has(n)&&null===t.mappings.get(n)["@language"];if(d&&"@none"!==a&&(!p||!v||m))return i["@value"];var y={};return l&&(y[D.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=i["@index"]),"@type"in i?y[D.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=D.compactIri({activeCtx:t,iri:i["@type"],relativeTo:{vocab:!0}}):"@language"in i&&(y[D.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=i["@language"]),"@direction"in i&&(y[D.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=i["@direction"]),y[D.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=i["@value"],y}var b=k(t,n,{vocab:!0},r),_=x(t,n,"@type"),w=D.compactIri({activeCtx:t,iri:i["@id"],relativeTo:{vocab:"@vocab"===_},base:r.base});return"@id"===_||"@vocab"===_||"@graph"===b?w:o({},D.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}}),w)}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(e,t,n){"use strict";var i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";t.exports={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:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},{}],19:[function(e,n,i){"use strict";var r,o=e("./util"),a=e("./JsonLdError"),s=e("./types"),u=s.isArray,c=s.isObject,l=s.isString,f=s.isUndefined,d=e("./url"),p=d.isAbsolute,g=d.isRelative,m=d.prependBase,y=e("./util"),b=y.asArray,w=y.compareShortestLeast,k=new Map,x=/^@[a-zA-Z]+$/,S={};function E(e,t,n,i,r,o){if(null===t||!l(t)||S.isKeyword(t))return t;if(t.match(x))return null;if(i&&i.hasOwnProperty(t)&&!0!==r.get(t)&&S.createTermDefinition({activeCtx:e,localCtx:i,term:t,defined:r,options:o}),(n=n||{}).vocab){var a=e.mappings.get(t);if(null===a)return null;if(c(a)&&"@id"in a)return a["@id"]}var s=t.indexOf(":");if(s>0){var u=t.substr(0,s),h=t.substr(s+1);if("_"===u||0===h.indexOf("//"))return t;i&&i.hasOwnProperty(u)&&S.createTermDefinition({activeCtx:e,localCtx:i,term:u,defined:r,options:o});var f=e.mappings.get(u);if(f&&f._prefix)return f["@id"]+h;if(p(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return m(m(o.base,e["@base"]),t)}else if(n.base)return m(o.base,t);return t}function C(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;var n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(var i=0;i0,"@reverse"in t){if("@id"in t)throw new a("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:i});if("@nest"in t)throw new a("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:i});var k=t["@reverse"];if(!l(k))throw new a("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:i});if(!S.isKeyword(k)&&k.match(x))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:k}),void(g?n.mappings.set(r,g):n.mappings.delete(r));var O=E(n,k,{vocab:!0,base:!1},i,o,s);if(!p(O))throw new a("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:i});y["@id"]=O,y.reverse=!0}else if("@id"in t){var T=t["@id"];if(T&&!l(T))throw new a("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:i});if(null===T)y["@id"]=null;else{if(!S.isKeyword(T)&&T.match(x))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:T}),void(g?n.mappings.set(r,g):n.mappings.delete(r));if(T!==r){if(T=E(n,T,{vocab:!0,base:!1},i,o,s),!p(T)&&!S.isKeyword(T))throw new a("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:i});if(r.match(/(?::[^:])|\//)&&E(n,r,{vocab:!0,base:!1},i,new Map(o).set(r,!0),s)!==T)throw new a("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:i});y["@id"]=T,y._prefix=m&&!y._termHasColon&&T.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){var A=r.substr(0,w);if(i.hasOwnProperty(A)&&S.createTermDefinition({activeCtx:n,localCtx:i,term:A,defined:o,options:s}),n.mappings.has(A)){var P=r.substr(w+1);y["@id"]=n.mappings.get(A)["@id"]+P}else y["@id"]=r}else if("@type"===r)y["@id"]=r;else{if(!("@vocab"in n))throw new a("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:i,term:r});y["@id"]=n["@vocab"]+r}if((!0===t["@protected"]||!0===o.get("@protected")&&!1!==t["@protected"])&&(n.protected[r]=!0,y.protected=!0),o.set(r,!0),"@type"in t){var M=t["@type"];if(!l(M))throw new a("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:i});if("@json"===M||"@none"===M){if(S.processingMode(n,1))throw new a('Invalid JSON-LD syntax; an @context @type value must not be "'.concat(M,'" in JSON-LD 1.0 mode.'),"jsonld.SyntaxError",{code:"invalid type mapping",context:i})}else if("@id"!==M&&"@vocab"!==M){if(M=E(n,M,{vocab:!0,base:!1},i,o,s),!p(M))throw new a("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:i});if(0===M.indexOf("_:"))throw new a("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:i})}y["@type"]=M}if("@container"in t){var I=l(t["@container"])?[t["@container"]]:t["@container"]||[],R=["@list","@set","@index","@language"],D=!0,N=I.includes("@set");if(S.processingMode(n,1.1)){if(R.push("@graph","@id","@type"),I.includes("@list")){if(1!==I.length)throw new a("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:i})}else if(I.includes("@graph")){if(I.some(function(e){return"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e}))throw new a("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:i})}else D&=I.length<=(N?2:1);if(I.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new a("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:i})}else D&=!u(t["@container"]),D&=I.length<=1;if(D&=I.every(function(e){return R.includes(e)}),!(D&=!(N&&I.includes("@list"))))throw new a("Invalid JSON-LD syntax; @context @container value must be one of the following: "+R.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:i});if(y.reverse&&!I.every(function(e){return["@index","@set"].includes(e)}))throw new a("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:i});y["@container"]=I}if("@index"in t){if(!("@container"in t)||!y["@container"].includes("@index"))throw new a('Invalid JSON-LD syntax; @index without @index in @container: "'.concat(t["@index"],'" on term "').concat(r,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:i});if(!l(t["@index"])||0===t["@index"].indexOf("@"))throw new a('Invalid JSON-LD syntax; @index must expand to an IRI: "'.concat(t["@index"],'" on term "').concat(r,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:i});y["@index"]=t["@index"]}if("@context"in t&&(y["@context"]=t["@context"]),"@language"in t&&!("@type"in t)){var L=t["@language"];if(null!==L&&!l(L))throw new a("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:i});null!==L&&(L=L.toLowerCase()),y["@language"]=L}if("@prefix"in t){if(r.match(/:|\//))throw new a("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:i});if(S.isKeyword(y["@id"]))throw new a("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:i});if("boolean"!=typeof t["@prefix"])throw new a("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:i});y._prefix=!0===t["@prefix"]}if("@direction"in t){var j=t["@direction"];if(null!==j&&"ltr"!==j&&"rtl"!==j)throw new a('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:i});y["@direction"]=j}if("@nest"in t){var F=t["@nest"];if(!l(F)||"@nest"!==F&&0===F.indexOf("@"))throw new a("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:i});y["@nest"]=F}var B=y["@id"];if("@context"===B||"@preserve"===B)throw new a("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:i});if(g&&g.protected&&!f&&(n.protected[r]=!0,y.protected=!0,!C(g,y))){var V=s&&s.protectedMode||"error";if("error"===V)throw new a('Invalid JSON-LD syntax; tried to redefine "'.concat(r,'" which is a protected term.'),"jsonld.SyntaxError",{code:"protected term redefinition",context:i,term:r});if("warn"===V)return void console.warn("WARNING: protected term redefinition",{term:r});throw new a("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:i,term:r,protectedMode:V})}},S.expandIri=function(e,t,n,i){return E(e,t,n,void 0,void 0,i)},S.getInitialContext=function(e){var t=JSON.stringify({processingMode:e.processingMode}),n=k.get(t);if(n)return n;var i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){var e=this;if(e.inverse)return e.inverse;var t,n=e.inverse={},i=e.fastCurieMap={},o={},s=(e["@language"]||"@none").toLowerCase(),u=e["@direction"],c=e.mappings,l=_(v(c.keys()).sort(w));try{for(l.s();!(t=l.n()).done;){var h=t.value,f=c.get(h);if(null!==f){var d=f["@container"]||"@none";if(d=[].concat(d).sort().join(""),null!==f["@id"]){var p,g=_(b(f["@id"]));try{for(g.s();!(p=g.n()).done;){var m=p.value,y=n[m],k=S.isKeyword(m);if(y)!k&&!f._termHasColon&&o[m].push(h);else if(n[m]=y={},!k&&!f._termHasColon){o[m]=[h];var x={iri:m,terms:o[m]};m[0]in i?i[m[0]].push(x):i[m[0]]=[x]}if(y[d]||(y[d]={"@language":{},"@type":{},"@any":{}}),a(h,(y=y[d])["@any"],"@none"),f.reverse)a(h,y["@type"],"@reverse");else if("@none"===f["@type"])a(h,y["@any"],"@none"),a(h,y["@language"],"@none"),a(h,y["@type"],"@none");else if("@type"in f)a(h,y["@type"],f["@type"]);else if("@language"in f&&"@direction"in f){var E=f["@language"],C=f["@direction"];a(h,y["@language"],E&&C?"".concat(E,"_").concat(C).toLowerCase():E?E.toLowerCase():C?"_".concat(C):"@null")}else"@language"in f?a(h,y["@language"],(f["@language"]||"@null").toLowerCase()):"@direction"in f?a(h,y["@language"],f["@direction"]?"_".concat(f["@direction"]):"@none"):u?(a(h,y["@language"],"_".concat(u)),a(h,y["@language"],"@none"),a(h,y["@type"],"@none")):(a(h,y["@language"],s),a(h,y["@language"],"@none"),a(h,y["@type"],"@none"))}}catch(T){g.e(T)}finally{g.f()}}}}}catch(T){l.e(T)}finally{l.f()}for(var O in i)r(i,O,1);return n},clone:function(){var e={};return e.mappings=o.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=o.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===k.size&&k.clear(),k.set(t,i),i;function r(e,t,n){var i,o,a,s=e[t],u=e[t]={},c=_(s);try{for(c.s();!(a=c.n()).done;){var l=a.value;(o=n>=(i=l.iri).length?"":i[n])in u?u[o].push(l):u[o]=[l]}}catch(f){c.e(f)}finally{c.f()}for(var h in u)""!==h&&r(u,h,n+1)}function a(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},S.getContextValue=function(e,t,n){if(null===t)return"@context"===n?void 0:null;if(e.mappings.has(t)){var i=e.mappings.get(t);if(f(n))return i;if(i.hasOwnProperty(n))return i[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},S.processingMode=function(e,t){return t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode},S.isKeyword=function(e){if(!l(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(e,t,n){"use strict";var i=e("../util"),r=i.parseLinkHeader,o=i.buildHeaders,a=e("../constants").LINK_HEADER_CONTEXT,s=e("../JsonLdError"),u=e("../RequestQueue"),c=e("../url").prependBase,l=/(^|(\r\n))link:/i;function f(e,t,n){var i=new(e=e||XMLHttpRequest);return new Promise(function(e,r){for(var o in i.onload=function(){return e(i)},i.onerror=function(e){return r(e)},i.open("GET",t,!0),n)i.setRequestHeader(o,n[o]);i.send()})}t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{headers:{}},t=e.secure,n=e.headers,i=void 0===n?{}:n,d=e.xhr;return i=o(i),(new u).wrapLoader(p);function p(e){return v.apply(this,arguments)}function v(){return(v=h(regeneratorRuntime.mark(function e(n){var o,u,h,v,g,m,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===n.indexOf("http:")||0===n.indexOf("https:")){e.next=2;break}throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n});case 2:if(!t||0===n.indexOf("https")){e.next=4;break}throw new s('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n});case 4:return e.prev=4,e.next=7,f(d,n,i);case 7:o=e.sent,e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n,cause:e.t0});case 13:if(!(o.status>=400)){e.next=15;break}throw new s("URL could not be dereferenced: "+o.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:n,httpStatusCode:o.status});case 15:if(u={contextUrl:null,documentUrl:n,document:o.response},h=null,v=o.getResponseHeader("Content-Type"),l.test(o.getAllResponseHeaders())&&(g=o.getResponseHeader("Link")),!g||"application/ld+json"===v){e.next=28;break}if(m=r(g),y=m[a],!Array.isArray(y)){e.next=21;break}throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n});case 21:if(y&&(u.contextUrl=y.target),h=m.alternate,e.t1=h&&"application/ld+json"==h.type&&!(v||"").match(/^application\/(\w*\+)?json$/),!e.t1){e.next=28;break}return e.next=27,p(c(n,h.target));case 27:u=e.sent;case 28:return e.abrupt("return",u);case 29:case"end":return e.stop()}},e,null,[[4,10]])}))).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(e,n,i){"use strict";var r=e("./JsonLdError"),o=e("./types"),a=o.isArray,s=o.isObject,u=o.isEmptyObject,c=o.isString,l=o.isUndefined,f=e("./graphTypes"),d=f.isList,p=f.isValue,v=f.isGraph,g=f.isSubject,m=e("./context"),y=m.expandIri,b=m.getContextValue,w=m.isKeyword,k=m.process,x=m.processingMode,S=e("./url").isAbsolute,E=e("./util"),C=E.addValue,O=E.asArray,T=E.getValues,A=E.validateTypeValue,P={};n.exports=P;var M,I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function R(e){return D.apply(this,arguments)}function D(){return(D=h(regeneratorRuntime.mark(function e(n){var i,o,h,f,v,m,E,T,M,D,N,F,B,V,z,U,H,G,W,q,X,Y,K,Q,$,Z,J,ee,te,ne,ie,re,oe,ae,se,ue,ce,le,he,fe,de,pe,ve,ge,me,ye,be,_e,we,ke,xe,Se,Ee;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=n.activeCtx,o=n.activeProperty,h=n.expandedActiveProperty,f=n.element,v=n.expandedParent,m=n.options,E=void 0===m?{}:m,T=n.insideList,M=n.typeKey,D=n.typeScopedContext,N=n.expansionMap,F=Object.keys(f).sort(),B=[],z=f[M]&&"@json"===y(i,a(f[M])?f[M][0]:f[M],{vocab:!0},E),U=_(F),e.prev=4,U.s();case 6:if((H=U.n()).done){e.next=187;break}if(G=H.value,W=void 0,q=f[G],"@context"!==G){e.next=11;break}return e.abrupt("continue",185);case 11:if(null!==(X=y(i,G,{vocab:!0},E))&&(S(X)||w(X))||void 0!==(X=N({unmappedProperty:G,activeCtx:i,activeProperty:o,parent:f,options:E,insideList:T,value:q,expandedParent:v}))){e.next=14;break}return e.abrupt("continue",185);case 14:if(!w(X)){e.next=19;break}if("@reverse"!==h){e.next=17;break}throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});case 17:if(!(X in v)||"@included"===X||"@type"===X){e.next=19;break}throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:X});case 19:if("@id"!==X){e.next=34;break}if(c(q)){e.next=32;break}if(E.isFrame){e.next=23;break}throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});case 23:if(!s(q)){e.next=28;break}if(u(q)){e.next=26;break}throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:q});case 26:e.next=32;break;case 28:if(a(q)){e.next=30;break}throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:q});case 30:if(q.every(function(e){return c(e)})){e.next=32;break}throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:q});case 32:return C(v,"@id",O(q).map(function(e){return c(e)?y(i,e,{base:!0},E):e}),{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 34:if("@type"!==X){e.next=37;break}return s(q)&&(q=Object.fromEntries(Object.entries(q).map(function(e){var n=t(e,2),i=n[0],r=n[1];return[y(D,i,{vocab:!0}),O(r).map(function(e){return y(D,e,{base:!0,vocab:!0})})]}))),A(q,E.isFrame),C(v,"@type",O(q).map(function(e){return c(e)?y(D,e,{base:!0,vocab:!0},E):e}),{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 37:if("@included"!==X||!x(i,1.1)){e.next=47;break}return e.t0=O,e.next=41,P.expand({activeCtx:i,activeProperty:o,element:q,options:E,expansionMap:N});case 41:if(e.t1=e.sent,(Y=(0,e.t0)(e.t1)).every(function(e){return g(e)})){e.next=45;break}throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});case 45:return C(v,"@included",Y,{propertyIsArray:!0}),e.abrupt("continue",185);case 47:if("@graph"!==X||s(q)||a(q)){e.next=49;break}throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});case 49:if("@value"!==X){e.next=52;break}return V=q,z&&x(i,1.1)?v["@value"]=q:C(v,"@value",q,{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 52:if("@language"!==X){e.next=62;break}if(null!==q){e.next=55;break}return e.abrupt("continue",185);case 55:if(c(q)||E.isFrame){e.next=57;break}throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});case 57:q=O(q).map(function(e){return c(e)?e.toLowerCase():e}),K=_(q);try{for(K.s();!(Q=K.n()).done;)$=Q.value,c($)&&!$.match(I)&&console.warn("@language must be valid BCP47: ".concat($))}catch(Ce){K.e(Ce)}finally{K.f()}return C(v,"@language",q,{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 62:if("@direction"!==X){e.next=85;break}if(c(q)||E.isFrame){e.next=65;break}throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});case 65:q=O(q),Z=_(q),e.prev=67,Z.s();case 69:if((J=Z.n()).done){e.next=75;break}if(ee=J.value,!c(ee)||"ltr"===ee||"rtl"===ee){e.next=73;break}throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:q});case 73:e.next=69;break;case 75:e.next=80;break;case 77:e.prev=77,e.t2=e.catch(67),Z.e(e.t2);case 80:return e.prev=80,Z.f(),e.finish(80);case 83:return C(v,"@direction",q,{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 85:if("@index"!==X){e.next=90;break}if(c(q)){e.next=88;break}throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});case 88:return C(v,"@index",q),e.abrupt("continue",185);case 90:if("@reverse"!==X){e.next=118;break}if(s(q)){e.next=93;break}throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});case 93:return e.next=95,P.expand({activeCtx:i,activeProperty:"@reverse",element:q,options:E,expansionMap:N});case 95:if(!("@reverse"in(W=e.sent))){e.next=98;break}for(te in W["@reverse"])C(v,te,W["@reverse"][te],{propertyIsArray:!0});case 98:ne=v["@reverse"]||null,e.t3=regeneratorRuntime.keys(W);case 100:if((e.t4=e.t3()).done){e.next=117;break}if("@reverse"!==(ie=e.t4.value)){e.next=104;break}return e.abrupt("continue",100);case 104:null===ne&&(ne=v["@reverse"]={}),C(ne,ie,[],{propertyIsArray:!0}),re=W[ie],oe=0;case 107:if(!(oe1?Q.slice().sort():Q:[Q],Z=_($),e.prev=81,Z.s();case 83:if((J=Z.n()).done){e.next=93;break}if(ee=J.value,te=b(E,ee,"@context"),e.t5=l(te),e.t5){e.next=91;break}return e.next=90,k({activeCtx:n,localCtx:te,options:d,propagate:!1});case 90:n=e.sent;case 91:e.next=83;break;case 93:e.next=98;break;case 95:e.prev=95,e.t6=e.catch(81),Z.e(e.t6);case 98:return e.prev=98,Z.f(),e.finish(98);case 101:e.next=75;break;case 103:e.next=108;break;case 105:e.prev=105,e.t7=e.catch(73),X.e(e.t7);case 108:return e.prev=108,X.f(),e.finish(108);case 111:return ne={},e.next=114,R({activeCtx:n,activeProperty:o,expandedActiveProperty:F,element:h,expandedParent:ne,options:d,insideList:v,typeKey:q,typeScopedContext:E,expansionMap:A});case 114:if(V=Object.keys(ne),ie=V.length,!("@value"in ne)){e.next=137;break}if(!("@type"in ne)||!("@language"in ne)&&!("@direction"in ne)){e.next=119;break}throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:ne});case 119:if(re=ie-1,"@type"in ne&&(re-=1),"@index"in ne&&(re-=1),"@language"in ne&&(re-=1),"@direction"in ne&&(re-=1),0===re){e.next=122;break}throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:ne});case 122:if(oe=null===ne["@value"]?[]:O(ne["@value"]),ae=T(ne,"@type"),x(n,1.1)&&ae.includes("@json")&&1===ae.length){e.next=135;break}if(0!==oe.length){e.next=131;break}return e.next=127,A({unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:d,insideList:v});case 127:se=e.sent,ne=void 0!==se?se:null,e.next=135;break;case 131:if(oe.every(function(e){return c(e)||u(e)})||!("@language"in ne)){e.next=133;break}throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:ne});case 133:if(ae.every(function(e){return S(e)&&!(c(e)&&0===e.indexOf("_:"))||u(e)})){e.next=135;break}throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:ne});case 135:e.next=152;break;case 137:if(!("@type"in ne)||a(ne["@type"])){e.next=141;break}ne["@type"]=[ne["@type"]],e.next=152;break;case 141:if(!("@set"in ne)&&!("@list"in ne)){e.next=147;break}if(!(ie>1)||2===ie&&"@index"in ne){e.next=144;break}throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:ne});case 144:"@set"in ne&&(ne=ne["@set"],V=Object.keys(ne),ie=V.length),e.next=152;break;case 147:if(1!==ie||!("@language"in ne)){e.next=152;break}return e.next=150,A(ne,{unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:d,insideList:v});case 150:ue=e.sent,ne=void 0!==ue?ue:null;case 152:if(!s(ne)||d.keepFreeFloatingNodes||v||null!==o&&"@graph"!==F||!(0===ie||"@value"in ne||"@list"in ne||1===ie&&"@id"in ne)){e.next=157;break}return e.next=155,A({unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:d,insideList:v});case 155:ce=e.sent,ne=void 0!==ce?ce:null;case 157:return e.abrupt("return",ne);case 158:case"end":return e.stop()}},e,null,[[38,53,56,59],[73,105,108,111],[81,95,98,101]])})),function(e){return M.apply(this,arguments)})},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(e,t,n){"use strict";var i=e("./graphTypes").isSubjectReference,r=e("./nodeMap").createMergedNodeMap,o={};t.exports=o,o.flatten=function(e){for(var t=r(e),n=[],o=Object.keys(t).sort(),a=0;a=0;--i){var r=n[i];if(r.graph===t&&r.subject["@id"]===e["@id"])return!0}return!1}function g(e,t,n){var i="@"+n,r=i in e?e[i][0]:t[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return r}function m(e){if(!a.isArray(e)||1!==e.length||!a.isObject(e[0]))throw new c("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0]){var t,n=_(s.asArray(e[0]["@id"]));try{for(n.s();!(t=n.n()).done;){var i=t.value;if(!a.isObject(i)&&!u.isAbsolute(i)||a.isString(i)&&0===i.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(h){n.e(h)}finally{n.f()}}if("@type"in e[0]){var r,o=_(s.asArray(e[0]["@type"]));try{for(o.s();!(r=o.n()).done;){var l=r.value;if(!a.isObject(l)&&!u.isAbsolute(l)||a.isString(l)&&0===l.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(h){o.e(h)}finally{o.f()}}}function y(e,t,n,o){var u=!0,c=!1;for(var l in n){var h=!1,f=s.getValues(t,l),d=0===s.getValues(n,l).length;if("@id"===l){if(a.isEmptyObject(n["@id"][0]||{})?h=!0:n["@id"].length>=0&&(h=n["@id"].includes(f[0])),!o.requireAll)return h}else if("@type"===l){if(u=!1,d){if(f.length>0)return!1;h=!0}else if(1===n["@type"].length&&a.isEmptyObject(n["@type"][0]))h=f.length>0;else{var p,v=_(n["@type"]);try{var g=function(){var e=p.value;h=!(!a.isObject(e)||!("@default"in e))||h||f.some(function(t){return t===e})};for(v.s();!(p=v.n()).done;)g()}catch(b){v.e(b)}finally{v.f()}}if(!o.requireAll)return h}else{if(i(l))continue;var y=function(){var t=s.getValues(n,l)[0],i=!1;if(t&&(m([t]),i="@default"in t),u=!1,0===f.length&&i)return"continue";if(f.length>0&&d)return{v:!1};if(void 0===t){if(f.length>0)return{v:!1};h=!0}else if(r.isList(t)){var c=t["@list"][0];if(r.isList(f[0])){var p=f[0]["@list"];r.isValue(c)?h=p.some(function(e){return S(c,e)}):(r.isSubject(c)||r.isSubjectReference(c))&&(h=p.some(function(t){return x(e,c,t,o)}))}}else h=r.isValue(t)?f.some(function(e){return S(t,e)}):r.isSubjectReference(t)?f.some(function(n){return x(e,t,n,o)}):!!a.isObject(t)&&f.length>0}();if("continue"===y)continue;if("object"==typeof y)return y.v}if(!h&&o.requireAll)return!1;c=c||h}return u||c}function b(e,t){var n=e.uniqueEmbeds[e.graph],i=n[t],r=i.parent,o=i.property,u={"@id":t};if(a.isArray(r)){for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:null;m(n);var h=e.options,f={embed:g(n=n[0],h,"embed"),explicit:g(n,h,"explicit"),requireAll:g(n,h,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});var w,x=e.link[e.graph],E=function(e,t,n,i){var r,o={},a=_(t);try{for(a.s();!(r=a.n()).done;){var s=r.value,u=e.graphMap[e.graph][s];y(e,u,n,i)&&(o[s]=u)}}catch(c){a.e(c)}finally{a.f()}return o}(e,t,n,f),C=Object.keys(E).sort(),O=_(C);try{var T=function(){var m=w.value,y=E[m];if(null===l?e.uniqueEmbeds=o({},e.graph,{}):e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===f.embed&&m in x)return k(u,l,x[m]),"continue";var C={"@id":m};if(0===m.indexOf("_:")&&s.addValue(e.bnodeMap,m,C,{propertyIsArray:!0}),x[m]=C,("@first"===f.embed||"@last"===f.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(m)){if(e.embedded&&("@never"===f.embed||v(y,e.graph,e.subjectStack)))return k(u,l,C),"continue";if(e.embedded&&("@first"==f.embed||"@once"==f.embed)&&e.uniqueEmbeds[e.graph].hasOwnProperty(m))return k(u,l,C),"continue";if("@last"===f.embed&&m in e.uniqueEmbeds[e.graph]&&b(e,m),e.uniqueEmbeds[e.graph][m]={parent:u,property:l},e.subjectStack.push({subject:y,graph:e.graph}),m in e.graphMap){var O=!1,T=null;"@graph"in n?(T=n["@graph"][0],O=!("@merged"===m||"@default"===m),a.isObject(T)||(T={})):(O="@merged"!==e.graph,T={}),O&&d.frame(I(M({},e),{graph:m,embedded:!1}),Object.keys(e.graphMap[m]).sort(),[T],C,"@graph")}"@included"in n&&d.frame(I(M({},e),{embedded:!1}),t,n["@included"],C,"@included");var A,P=_(Object.keys(y).sort());try{for(P.s();!(A=P.n()).done;){var R=A.value;if(i(R)){if(C[R]=s.clone(y[R]),"@type"===R){var D,N=_(y["@type"]);try{for(N.s();!(D=N.n()).done;){var L=D.value;0===L.indexOf("_:")&&s.addValue(e.bnodeMap,L,C,{propertyIsArray:!0})}}catch(re){N.e(re)}finally{N.f()}}}else if(!f.explicit||R in n){var j,F=_(y[R]);try{for(F.s();!(j=F.n()).done;){var B=j.value,V=R in n?n[R]:p(f);if(r.isList(B)){var z=n[R]&&n[R][0]&&n[R][0]["@list"]?n[R][0]["@list"]:p(f),U={"@list":[]};k(C,R,U);var H,G=_(B["@list"]);try{for(G.s();!(H=G.n()).done;){var W=H.value;r.isSubjectReference(W)?d.frame(I(M({},e),{embedded:!0}),[W["@id"]],z,U,"@list"):k(U,"@list",s.clone(W))}}catch(re){G.e(re)}finally{G.f()}}else r.isSubjectReference(B)?d.frame(I(M({},e),{embedded:!0}),[B["@id"]],V,C,R):S(V[0],B)&&k(C,R,s.clone(B))}}catch(re){F.e(re)}finally{F.f()}}}}catch(re){P.e(re)}finally{P.f()}var q,X=_(Object.keys(n).sort());try{for(X.s();!(q=X.n()).done;){var Y=q.value;if("@type"===Y){if(!a.isObject(n[Y][0])||!("@default"in n[Y][0]))continue}else if(i(Y))continue;var K=n[Y][0]||{};if(!g(K,h,"omitDefault")&&!(Y in C)){var Q="@null";"@default"in K&&(Q=s.clone(K["@default"])),a.isArray(Q)||(Q=[Q]),C[Y]=[{"@preserve":Q}]}}}catch(re){X.e(re)}finally{X.f()}var $,Z=_(Object.keys(n["@reverse"]||{}).sort());try{for(Z.s();!($=Z.n()).done;)for(var J=$.value,ee=n["@reverse"][J],te=0,ne=Object.keys(e.subjects);te0&&(r["@language"]=l,l.match(k)||console.warn("@language must be valid BCP47: ".concat(l))),r["@direction"]=h}else a!==w&&(r["@type"]=a)}return r}n.exports=x,x.fromRDF=(r=h(regeneratorRuntime.mark(function e(t,n){var i,r,o,c,h,g,m,y,b,w,k,x,E,C,O,T,A,P,M,I,R,D,N,L,j,F,B,V,z,U,H,G,W,q,X,Y,K,Q,$,Z,J,ee,te,ne,ie,re,oe,ae,se;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=n.useRdfType,r=void 0!==i&&i,o=n.useNativeTypes,c=void 0!==o&&o,h=n.rdfDirection,g=void 0===h?null:h,y={"@default":m={}},b={},w=_(t),e.prev=3,w.s();case 5:if((k=w.n()).done){e.next=19;break}if(x=k.value,(E="DefaultGraph"===x.graph.termType?"@default":x.graph.value)in y||(y[E]={}),"@default"!==E&&!(E in m)&&(m[E]={"@id":E}),C=y[E],O=x.subject.value,T=x.predicate.value,A=x.object,O in C||(C[O]={"@id":O}),P=C[O],(M=A.termType.endsWith("Node"))&&!(A.value in C)&&(C[A.value]={"@id":A.value}),T!==v||r||!M){e.next=15;break}return u.addValue(P,"@type",A.value,{propertyIsArray:!0}),e.abrupt("continue",17);case 15:I=S(A,c,g),u.addValue(P,T,I,{propertyIsArray:!0}),M&&(A.value===p?("usages"in(R=C[A.value])||(R.usages=[]),R.usages.push({node:P,property:T,value:I})):b[A.value]=!(A.value in b)&&{node:P,property:T,value:I});case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(3),w.e(e.t0);case 24:return e.prev=24,w.f(),e.finish(24);case 27:e.t1=regeneratorRuntime.keys(y);case 28:if((e.t2=e.t1()).done){e.next=37;break}if(D=e.t2.value,N=y[D],p in N){e.next=33;break}return e.abrupt("continue",28);case 33:if((L=N[p]).usages){j=_(L.usages);try{for(j.s();!(F=j.n()).done;){for(B=F.value,V=B.node,z=B.property,U=B.value,H=[],G=[],W=Object.keys(V).length;z===d&&s.isObject(b[V["@id"]])&&s.isArray(V[f])&&1===V[f].length&&s.isArray(V[d])&&1===V[d].length&&(3===W||4===W&&s.isArray(V["@type"])&&1===V["@type"].length&&V["@type"][0]===l)&&(H.push(V[f][0]),G.push(V["@id"]),B=b[V["@id"]],V=B.node,z=B.property,U=B.value,W=Object.keys(V).length,a.isBlankNode(V)););for(delete U["@id"],U["@list"]=H.reverse(),q=0,X=G;q1||!("@id"in e))},r.isSubjectReference=function(e){return i.isObject(e)&&1===Object.keys(e).length&&"@id"in e},r.isValue=function(e){return i.isObject(e)&&"@value"in e},r.isList=function(e){return i.isObject(e)&&"@list"in e},r.isGraph=function(e){return i.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(function(e){return"@id"!==e&&"@index"!==e}).length},r.isSimpleGraph=function(e){return r.isGraph(e)&&!("@id"in e)},r.isBlankNode=function(e){return!!i.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))}},{"./types":30}],26:[function(e,t,n){var i=e("rdf-canonize"),r=e("./platform"),o=e("./util"),a=e("./ContextResolver"),s=o.IdentifierIssuer,u=e("./JsonLdError"),c=e("lru-cache"),l=e("./NQuads"),f=e("./expand").expand,d=e("./flatten").flatten,p=e("./fromRdf").fromRDF,v=e("./toRdf").toRDF,g=e("./frame"),m=g.frameMergedOrDefault,y=g.cleanupNull,b=e("./types"),w=b.isArray,k=b.isObject,x=b.isString,S=e("./graphTypes").isSubjectReference,E=e("./context"),A=E.expandIri,P=E.getInitialContext,I=E.process,R=E.processingMode,D=e("./compact"),N=D.compact,L=D.compactIri,j=e("./nodeMap"),F=j.createNodeMap,B=j.createMergedNodeMap,V=j.mergeNodeMaps,z=function(t){var n,g={},b=new c({max:100});function E(e,n){var i=n,r=i.documentLoader,o=void 0===r?t.documentLoader:r,a=function(e,t){var n={};for(var i in e)O.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&C){var r,o=_(C(e));try{for(o.s();!(r=o.n()).done;)i=r.value,t.indexOf(i)<0&&T.call(e,i)&&(n[i]=e[i])}catch(a){o.e(a)}finally{o.f()}}return n}(i,["documentLoader"]);return Object.assign({},{documentLoader:o},a,e)}return t.compact=(n=h(regeneratorRuntime.mark(function e(n,i,r){var c,l,h,f,d,p,v,g,m,y,_=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(_.length<2)){e.next=2;break}throw new TypeError("Could not compact, too few arguments.");case 2:if(null!==i){e.next=4;break}throw new u("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});case 4:if(null!==n){e.next=6;break}return e.abrupt("return",null);case 6:if((r=E(r,{base:x(n)?n:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new a({sharedCache:b})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,!r.skipExpansion){e.next=12;break}e.t0=n,e.next=15;break;case 12:return e.next=14,t.expand(n,r);case 14:e.t0=e.sent;case 15:return c=e.t0,e.next=18,t.processContext(P(r),i,r);case 18:return l=e.sent,e.next=21,N({activeCtx:l,element:c,options:r,compactionMap:r.compactionMap});case 21:h=e.sent,r.compactArrays&&!r.graph&&w(h)?1===h.length?h=h[0]:0===h.length&&(h={}):r.graph&&k(h)&&(h=[h]),k(i)&&"@context"in i&&(i=i["@context"]),i=o.clone(i),w(i)||(i=[i]),f=i,i=[];for(d=0;d0)&&i.push(f[d]);if(p=i.length>0,1===i.length&&(i=i[0]),w(h))v=L({activeCtx:l,iri:"@graph",relativeTo:{vocab:!0}}),g=h,h={},p&&(h["@context"]=i),h[v]=g;else if(k(h)&&p)for(y in m=h,h={"@context":i},m)h[y]=m[y];return e.abrupt("return",h);case 29:case"end":return e.stop()}},e)})),function(e,t,i){return n.apply(this,arguments)}),t.expand=function(){var e=h(regeneratorRuntime.mark(function e(n,i){var r,s,u,c,l,h,d,p,v,g,m=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.length<1)){e.next=2;break}throw new TypeError("Could not expand, too few arguments.");case 2:if(!1===(i=E(i,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:b})})).expansionMap&&(i.expansionMap=void 0),r={},s=[],"expandContext"in i&&(u=o.clone(i.expandContext),r.expandContext=k(u)&&"@context"in u?u:{"@context":u},s.push(r.expandContext)),!x(n)){e.next=12;break}return e.next=8,t.get(n,i);case 8:l=e.sent,c=l.documentUrl,r.input=l.document,l.contextUrl&&(r.remoteContext={"@context":l.contextUrl},s.push(r.remoteContext)),e.next=13;break;case 12:r.input=o.clone(n);case 13:"base"in i||(i.base=c||""),h=P(i),d=0,p=s;case 16:if(!(d=1e21)},i.isEmptyObject=function(e){return i.isObject(e)&&0===Object.keys(e).length},i.isNumber=function(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)},i.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},i.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},i.isString=function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},i.isUndefined=function(e){return void 0===e}},{}],31:[function(e,t,n){"use strict";var i=e("./types"),r={};t.exports=r,r.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=function(e,t){for(var n={},i=r.parsers[t||"full"],o=i.regex.exec(e),a=i.keys.length;a--;)n[i.keys[a]]=void 0===o[a]?null:o[a];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=function(e,t){if(null===e||r.isAbsolute(t))return t;(!e||i.isString(e))&&(e=r.parse(e||""));var n=r.parse(t),o={protocol:e.protocol||""};if(null!==n.authority)o.authority=n.authority,o.path=n.path,o.query=n.query;else if(o.authority=e.authority,""===n.path)o.path=e.path,o.query=null!==n.query?n.query:e.query;else{if(0===n.path.indexOf("/"))o.path=n.path;else{var a=e.path;((a=a.substr(0,a.lastIndexOf("/")+1)).length>0||e.authority)&&"/"!==a.substr(-1)&&(a+="/"),a+=n.path,o.path=a}o.query=n.query}""!==n.path&&(o.path=r.removeDotSegments(o.path));var s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==n.fragment&&(s+="#"+n.fragment),""===s&&(s="./"),s},r.removeBase=function(e,t){if(null===e)return t;(!e||i.isString(e))&&(e=r.parse(e||""));var n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;for(var o=r.parse(t.substr(n.length)),a=e.normalizedPath.split("/"),s=o.normalizedPath.split("/"),u=o.fragment||o.query?0:1;a.length>0&&s.length>u&&a[0]===s[0];)a.shift(),s.shift();var c="";if(a.length>0){a.pop();for(var l=0;l0;){var i=t.shift(),r=0===t.length;"."!==i?".."!==i?n.push(i):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};var o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=function(e){return i.isString(e)&&o.test(e)},r.isRelative=function(e){return i.isString(e)}},{"./types":30}],32:[function(e,n,i){"use strict";var r=e("./graphTypes"),o=e("./types"),a=e("rdf-canonize").IdentifierIssuer,s=e("./JsonLdError"),u=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,l=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,h="application/ld+json, application/json",f={};function d(e,t){if(o.isArray(t))for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(Object.keys(e).some(function(e){return"accept"===e.toLowerCase()}))throw new RangeError('Accept header may not be specified; only "'+h+'" is supported.');return Object.assign({Accept:h},e)},f.parseLinkHeader=function(e){for(var t={},n=e.match(u),i=0;i0}return!1},f.hasValue=function(e,t,n){if(f.hasProperty(e,t)){var i=e[t],a=r.isList(i);if(o.isArray(i)||a){a&&(i=i["@list"]);for(var s=0;st.maxAge:e[u]&&n>e[u]},y=function(e){if(e[o]>e[r])for(var t=e[h].tail;e[o]>e[r]&&null!==t;){var n=t.prev;_(e,t),t=n}},_=function(e,t){if(t){var n=t.value;e[c]&&e[c](n.key,n.value),e[o]-=n.length,e[f].delete(n.key),e[h].removeNode(t)}},w=function e(t,n,i,r,o){m(this,e),this.key=t,this.value=n,this.length=i,this.now=r,this.maxAge=o||0},k=function(e,t,n,i){var r=n.value;g(e,r)&&(_(e,n),e[s]||(r=void 0)),r&&t.call(i,r.value,r.key,e)};t.exports=function(){function e(t){if(m(this,e),"number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[r]=t.max||1/0;var n=t.length||p;if(this[a]="function"!=typeof n?p:n,this[s]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}return b(e,[{key:"max",get:function(){return this[r]},set:function(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[r]=e||1/0,y(this)}},{key:"allowStale",get:function(){return this[s]},set:function(e){this[s]=!!e}},{key:"maxAge",get:function(){return this[u]},set:function(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,y(this)}},{key:"lengthCalculator",get:function(){return this[a]},set:function(e){var t=this;"function"!=typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[o]=0,this[h].forEach(function(e){e.length=t[a](e.value,e.key),t[o]+=e.length})),y(this)}},{key:"length",get:function(){return this[o]}},{key:"itemCount",get:function(){return this[h].length}},{key:"rforEach",value:function(e,t){t=t||this;for(var n=this[h].tail;null!==n;){var i=n.prev;k(this,e,n,t),n=i}}},{key:"forEach",value:function(e,t){t=t||this;for(var n=this[h].head;null!==n;){var i=n.next;k(this,e,n,t),n=i}}},{key:"keys",value:function(){return this[h].toArray().map(function(e){return e.key})}},{key:"values",value:function(){return this[h].toArray().map(function(e){return e.value})}},{key:"reset",value:function(){var e=this;this[c]&&this[h]&&this[h].length&&this[h].forEach(function(t){return e[c](t.key,t.value)}),this[f]=new Map,this[h]=new i,this[o]=0}},{key:"dump",value:function(){var e=this;return this[h].map(function(t){return!g(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}}).toArray().filter(function(e){return e})}},{key:"dumpLru",value:function(){return this[h]}},{key:"set",value:function(e,t,n){if((n=n||this[u])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var i=n?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[r])return _(this,this[f].get(e)),!1;var d=this[f].get(e).value;return this[c]&&(this[l]||this[c](e,d.value)),d.now=i,d.maxAge=n,d.value=t,this[o]+=s-d.length,d.length=s,this.get(e),y(this),!0}var p=new w(e,t,s,i,n);return p.length>this[r]?(this[c]&&this[c](e,t),!1):(this[o]+=p.length,this[h].unshift(p),this[f].set(e,this[h].head),y(this),!0)}},{key:"has",value:function(e){if(!this[f].has(e))return!1;var t=this[f].get(e).value;return!g(this,t)}},{key:"get",value:function(e){return v(this,e,!0)}},{key:"peek",value:function(e){return v(this,e,!1)}},{key:"pop",value:function(){var e=this[h].tail;return e?(_(this,e),e.value):null}},{key:"del",value:function(e){_(this,this[f].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var i=e[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{var o=r-t;o>0&&this.set(i.k,i.v,o)}}}},{key:"prune",value:function(){var e=this;this[f].forEach(function(t,n){return v(e,n,!1)})}}]),e}()},{yallist:92}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#",o="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:"".concat(r,"decimal"),boolean:"".concat(r,"boolean"),double:"".concat(r,"double"),integer:"".concat(r,"integer"),string:"".concat(r,"string")},rdf:{type:"".concat(i,"type"),nil:"".concat(i,"nil"),first:"".concat(i,"first"),rest:"".concat(i,"rest"),langString:"".concat(i,"langString")},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:"".concat(o,"reify#forSome"),forAll:"".concat(o,"reify#forAll")},log:{implies:"".concat(o,"log#implies")}}},{}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function e(t,n){if(n=n||y,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===y)return new k(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));var i=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,i-1),"@"===t[i+1]?t.substr(i+2):n.namedNode(t.substr(i+3)));case"<":var r=g.exec(t);return n.quad(e(T(r[1]),n),e(T(r[2]),n),e(T(r[3]),n),r[4]&&e(T(r[4]),n));default:return n.namedNode(t)}},n.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof _&&"Quad"!==t.termType)return t.id;if(!t)return r.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return"_:".concat(t.value);case"Variable":return"?".concat(t.value);case"DefaultGraph":return"";case"Literal":return'"'.concat(t.value,'"').concat(t.language?"@".concat(t.language):t.datatype&&t.datatype.value!==d.string?"^^".concat(t.datatype.value):"");case"Quad":return"<<".concat(O(e(t.subject))," ").concat(O(e(t.predicate))," ").concat(O(e(t.object))).concat((0,l.isDefaultGraph)(t.graph)?"":" ".concat(e(t.graph)),">>");default:throw new Error("Unexpected termType: ".concat(t.termType))}},n.escapeQuotes=O,n.unescapeQuotes=T,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var i,r,o=(i=e("./IRIs"))&&i.__esModule?i:{default:i},l=e("./N3Util"),h=o.default,f=h.rdf,d=h.xsd,p=0,v=/^"(.*".*)(?="[^"]*$)/,g=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,y={namedNode:function(e){return new w(e)},blankNode:function(e){return new x(e||"n3-"+p++)},variable:function(e){return new S(e)},literal:function(e,t){if("string"==typeof t)return new k('"'.concat(e,'"@').concat(t.toLowerCase()));var n=t?t.value:"";return""===n&&("boolean"==typeof e?n=d.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?d.integer:d.double:(n=d.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new k(""===n||n===d.string?'"'.concat(e,'"'):'"'.concat(e,'"^^').concat(n))},defaultGraph:function(){return r},quad:A,triple:A};n.default=y;var _=function(){function e(t){m(this,e),this.id=t}return b(e,[{key:"value",get:function(){return this.id}},{key:"equals",value:function(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}},{key:"toJSON",value:function(){return{termType:this.termType,value:this.value}}}]),e}();n.Term=_;var w=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"termType",get:function(){return"NamedNode"}}]),n}(_);n.NamedNode=w;var k=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"termType",get:function(){return"Literal"}},{key:"value",get:function(){return this.id.substring(1,this.id.lastIndexOf('"'))}},{key:"language",get:function(){var e=this.id,t=e.lastIndexOf('"')+1;return t\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},h=/$0^/;n.default=function(){function e(t){if(m(this,e),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]*)?$/,this._lineMode=!!(t=t||{}).lineMode)for(var n in this._n3Mode=!1,this)!(n in l)&&this[n]instanceof RegExp&&(this[n]=h);else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}return b(e,[{key:"_tokenizeToEnd",value:function(e,t){for(var n,i=this._input,r=this._comments;;){for(var o=void 0,s=void 0;o=this._newline.exec(i);)r&&(s=this._comment.exec(o[0]))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),i=i.substr(o[0].length,i.length),this._line++;if(!o&&(o=this._whitespace.exec(i))&&(i=i.substr(o[0].length,i.length)),this._endOfFile.test(i))return t&&(r&&(s=this._comment.exec(i))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),e(i=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=i;var u=this._line,l=i[0],h="",f="",d="",p=null,v=0,g=!1;switch(l){case"^":if(i.length<3)break;if("^"!==i[1]){this._n3Mode&&(v=1,h="^");break}if(this._previousMarker="^^","<"!==(i=i.substr(2))[0]){g=!0;break}case"<":if(p=this._unescapedIri.exec(i))h="IRI",f=p[1];else if(p=this._iri.exec(i)){if(null===(f=this._unescape(p[1]))||c.test(f))return b(this);h="IRI"}else i.length>1&&"<"===i[1]?(h="<<",v=2):this._n3Mode&&i.length>1&&"="===i[1]&&(h="inverse",v=2,f=">");break;case">":i.length>1&&">"===i[1]&&(h=">>",v=2);break;case"_":((p=this._blank.exec(i))||t&&(p=this._blank.exec("".concat(i," "))))&&(h="blank",d="_",f=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(i))f=p[1];else if(f=(n=this._parseLiteral(i)).value,v=n.matchLength,null===f)return b(this);(null!==p||0!==v)&&(h="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){var m;if(p=this._simpleApostropheString.exec(i))f=p[1];else if(f=(m=this._parseLiteral(i)).value,v=m.matchLength,null===f)return b(this);(null!==p||0!==v)&&(h="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(i))&&(h="var",f=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(i))?(h="langcode",f=p[1]):(p=this._keyword.exec(i))&&(h=p[0]);break;case".":if(1===i.length?t:i[1]<"0"||i[1]>"9"){h=".",v=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(i)||t&&(p=this._number.exec("".concat(i," "))))&&(h="literal",f=p[0],d="string"==typeof p[1]?a.double:"string"==typeof p[2]?a.decimal:a.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(i))?h=p[0].toUpperCase():g=!0;break;case"f":case"t":(p=this._boolean.exec(i))?(h="literal",f=p[0],d=a.boolean):g=!0;break;case"a":(p=this._shortPredicates.exec(i))?(h="abbreviation",f="a"):g=!0;break;case"=":this._n3Mode&&i.length>1&&(h="abbreviation",">"!==i[1]?(v=1,f="="):(v=2,f=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(v=1,h=l);break;default:g=!0}if(g&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(i))?((p=this._prefixed.exec(i))||t&&(p=this._prefixed.exec("".concat(i," "))))&&(h="prefixed",d=p[1]||"",f=this._unescape(p[2])):(h="prefix",f=p[1]||"")),"^^"===this._previousMarker)switch(h){case"prefixed":h="type";break;case"IRI":h="typeIRI";break;default:h=""}if(!h)return t||!/^'''|^"""/.test(i)&&/\n|\r/.test(i)?b(this):this._input=i;var y={line:u,type:h,value:f,prefix:d};e(null,y),this.previousToken=y,this._previousMarker=h,i=i.substr(v||p[0].length,i.length)}function b(t){e(t._syntaxError(/^\S*/.exec(i)[0]))}}},{key:"_unescape",value:function(e){var t=!1,n=e.replace(s,function(e,n,i,r){if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof i){var o=Number.parseInt(i,16);return o<=65535?String.fromCharCode(Number.parseInt(i,16)):String.fromCharCode(55296+((o-=65536)>>10),56320+(1023&o))}return r in u?u[r]:(t=!0,"")});return t?null:n}},{key:"_parseLiteral",value:function(e){if(e.length>=3){for(var t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length,i=Math.max(this._literalClosingPos,n);(i=e.indexOf(t,i))>0;){for(var r=0;"\\"===e[i-r-1];)r++;if(r%2==0){var o=e.substring(n,i),a=o.split(/\r\n|\r|\n/).length-1,s=i+n;if(1===n&&0!==a||3===n&&this._lineMode)break;return this._line+=a,{value:this._unescape(o),matchLength:s}}i++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}},{key:"_syntaxError",value:function(e){this._input=null;var t=new Error('Unexpected "'.concat(e,'" on line ').concat(this._line,"."));return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}},{key:"_readStartingBom",value:function(e){return e.startsWith("\ufeff")?e.substr(1):e}},{key:"tokenize",value:function(e,n){var i=this;if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof n){var o,a=[];if(this._tokenizeToEnd(function(e,t){return e?o=e:a.push(t)},!0),o)throw o;return a}(0,r.default)(function(){return i._tokenizeToEnd(n,!0)})}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",function(e){null!==i._input&&0!==e.length&&(i._pendingBuffer&&(e=t.concat([i._pendingBuffer,e]),i._pendingBuffer=null),128&e[e.length-1]?i._pendingBuffer=e:(void 0===i._input?i._input=i._readStartingBom("string"==typeof e?e:e.toString()):i._input+=e,i._tokenizeToEnd(n,!1)))}),e.on("end",function(){"string"==typeof i._input&&i._tokenizeToEnd(n,!0)}),e.on("error",n)}}]),e}()}).call(this)}).call(this,e("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=a(e("./N3Lexer")),r=a(e("./N3DataFactory")),o=a(e("./IRIs"));function a(e){return e&&e.__esModule?e:{default:e}}var s=0,u=function(){function e(t){m(this,e),this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&l(this,t.factory);var n="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(n),o=/trig/.test(n),a=/triple/.test(n),s=/quad/.test(n),u=this._n3Mode=/n3/.test(n),c=a||s;(this._supportsNamedGraphs=!(r||u))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||o||a||u),this._supportsRDFStar=""===n||/star|\*$/.test(n),c&&(this._resolveRelativeIRI=function(e){return null}),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new i.default({lineMode:c,n3:u}),this._explicitQuantifiers=!!t.explicitQuantifiers}return b(e,[{key:"_setBase",value:function(e){if(e){var t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}},{key:"_saveContext",value:function(e,t,n,i,r){var o=this._n3Mode;this._contextStack.push({subject:n,predicate:i,object:r,graph:t,type:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?"".concat(this._graph.id.substr(2),"."):".",this._quantified=Object.create(this._quantified))}},{key:"_restoreContext",value:function(){var e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}},{key:"_readInTopContext",value:function(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}},{key:"_readEntity",value:function(e,t){var n;switch(e.type){case"IRI":case"typeIRI":var i=this._resolveIRI(e.value);if(null===i)return this._error("Invalid IRI",e);n=this._namedNode(i);break;case"type":case"prefixed":var r=this._prefixes[e.prefix];if(void 0===r)return this._error('Undefined prefix "'.concat(e.prefix,':"'),e);n=this._namedNode(r+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error("Expected entity but got ".concat(e.type),e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}},{key:"_readSubject",value:function(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}},{key:"_readPredicate",value:function(e){var t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected ".concat(t),e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}},{key:"_readObject",value:function(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}},{key:"_readPredicateOrNamedGraph",value:function(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}},{key:"_readGraph",value:function(e){return"{"!==e.type?this._error("Expected graph but got ".concat(e.type),e):(this._graph=this._subject,this._subject=null,this._readSubject)}},{key:"_readBlankNodeHead",value:function(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}},{key:"_readBlankNodeTail",value:function(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);var t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}},{key:"_readPredicateAfterBlank",value:function(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}},{key:"_readListItem",value:function(e){var t=null,n=null,i=this._readListItem,r=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,i=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===r?null===a.predicate?a.subject=n:a.object=n:this._emit(r,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return i}},{key:"_readDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!1)}},{key:"_readListItemDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!0)}},{key:"_completeLiteral",value:function(e){var t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":var n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}},{key:"_completeSubjectLiteral",value:function(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}},{key:"_completeObjectLiteral",value:function(e,t){var n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}},{key:"_readFormulaTail",value:function(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}},{key:"_readPunctuation",value:function(e){var t,n=this._graph,i=this._subject,r=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,r&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}if(null!==i){var o=this._predicate,a=this._object;r?this._emit(a,o,i,n):this._emit(i,o,a,n)}return t}},{key:"_readBlankNodePunctuation",value:function(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}},{key:"_readQuadPunctuation",value:function(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}},{key:"_readPrefix",value:function(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}},{key:"_readPrefixIRI",value:function(e){if("IRI"!==e.type)return this._error('Expected IRI to follow prefix "'.concat(this._prefix,':"'),e);var t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}},{key:"_readBaseIRI",value:function(e){var t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}},{key:"_readNamedGraphLabel",value:function(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)}}},{key:"_readNamedGraphBlankLabel",value:function(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}},{key:"_readDeclarationPunctuation",value:function(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}},{key:"_readQuantifierList",value:function(e){var t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error("Unexpected ".concat(e.type),e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}},{key:"_readQuantifierPunctuation",value:function(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))}},{key:"_getPathReader",value:function(e){return this._afterPath=e,this._readPath}},{key:"_readPath",value:function(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){var i=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,i,this._graph)}return this._afterPath(e)}}},{key:"_readForwardPath",value:function(e){var t,n,i=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=i):(t=this._object,this._object=i),this._emit(t,n,i,this._graph),this._readPath}},{key:"_readBackwardPath",value:function(e){var t,n,i=this._blankNode();if(void 0!==(t=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=i):(n=this._object,this._object=i),this._emit(i,t,n,this._graph),this._readPath}},{key:"_readRDFStarTailOrGraph",value:function(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error('Expected >> to follow "'.concat(this._object.id,'"'),e):this._readRDFStarTail(e)}},{key:"_readRDFStarTail",value:function(e){if(">>"!==e.type)return this._error("Expected >> but got ".concat(e.type),e);var t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}},{key:"_getContextEndReader",value:function(){var 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}}},{key:"_emit",value:function(e,t,n,i){this._callback(null,this._quad(e,t,n,i||this.DEFAULTGRAPH))}},{key:"_error",value:function(e,t){var n=new Error("".concat(e," on line ").concat(t.line,"."));n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}},{key:"_resolveIRI",value:function(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}},{key:"_resolveRelativeIRI",value:function(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)}}},{key:"_removeDotSegments",value:function(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;for(var t=e.length,n="",i=-1,r=-1,o=0,a="/";i=r&&(n=n.substr(0,o)),"/"!==a)return"".concat(n,"/").concat(e.substr(i+1));o=i+1}}}a=e[++i]}return n+e.substring(o)}},{key:"parse",value:function(e,t,n){var i=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):"b".concat(s++,"_"),this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){var r,o=[];if(this._callback=function(e,t){e?r=e:t&&o.push(t)},this._lexer.tokenize(e).every(function(e){return i._readCallback=i._readCallback(e)}),r)throw r;return o}this._callback=t,this._lexer.tokenize(e,function(e,t){null!==e?(i._callback(e),i._callback=c):i._readCallback&&(i._readCallback=i._readCallback(t))})}}],[{key:"_resetBlankNodePrefix",value:function(){s=0}}]),e}();function c(){}function l(e,t){var n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(o.default.rdf.first),e.RDF_REST=n(o.default.rdf.rest),e.RDF_NIL=n(o.default.rdf.nil),e.N3_FORALL=n(o.default.r.forAll),e.N3_FORSOME=n(o.default.r.forSome),e.ABBREVIATIONS={a:n(o.default.rdf.type),"=":n(o.default.owl.sameAs),">":n(o.default.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=u,l(u.prototype,r.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,n&&n.set(e,i),i}(e("./N3DataFactory")),o=e("readable-stream"),u=(i=e("./IRIs"))&&i.__esModule?i:{default:i};function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}var h=function(e){function t(e,n){m(this,t),this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!n&&e&&!e[0]&&(n=e,e=null),this._factory=(n=n||{}).factory||r.default,e&&this.addQuads(e)}return b(t,[{key:"size",get:function(){var e=this._size;if(null!==e)return e;e=0;var t,n,i=this._graphs;for(var r in i)for(var o in t=i[r].subjects)for(var a in n=t[o])e+=Object.keys(n[a]).length;return this._size=e}},{key:"_addToIndex",value:function(e,t,n,i){var r=e[t]||(e[t]={}),o=r[n]||(r[n]={}),a=i in o;return a||(o[i]=null),!a}},{key:"_removeFromIndex",value:function(e,t,n,i){var r=e[t],o=r[n];for(var a in delete o[i],o)return;for(var s in delete r[n],r)return;delete e[t]}},{key:"_findInIndex",value:function(e,t,n,i,o,a,s,u,c,l){var h,f,d,p=!t+!n+!i>1?Object.keys(this._ids):this._entities;for(var v in t&&((h=e,e={})[t]=h[t]),e){var g=p[v];if(f=e[v])for(var m in n&&((h=f,f={})[n]=h[n]),f){var y=p[m];if(d=f[m])for(var b=(i?i in d?[i]:[]:Object.keys(d)),_=0;_0&&void 0!==arguments[0]?arguments[0]:{},n=t.remove,i=void 0!==n&&n,r=t.ignoreErrors,o=void 0!==r&&r,a={},s=o?function(){return!0}:function(e,t){throw new Error("".concat(e.value," ").concat(t))},c=this.getQuads(null,u.default.rdf.rest,u.default.rdf.nil,null),l=i?v(c):[];return c.forEach(function(t){for(var n,r,o=[],c=!1,h=t.graph,f=t.subject;f&&!c;){for(var d=e.getQuads(null,null,f,null),p=e.getQuads(f,null,null,null),v=void 0,g=null,m=null,y=null,b=0;b")}},{key:"_encodeLiteral",value:function(e){var t=e.value;if(p.test(t)&&(t=t.replace(v,_)),e.language)return'"'.concat(t,'"@').concat(e.language);if(this._lineMode){if(e.datatype.value===d.string)return'"'.concat(t,'"')}else switch(e.datatype.value){case d.string:return'"'.concat(t,'"');case d.boolean:if("true"===t||"false"===t)return t;break;case d.integer:if(/^[+-]?\d+$/.test(t))return t;break;case d.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case d.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return'"'.concat(t,'"^^').concat(this._encodeIriOrBlank(e.datatype))}},{key:"_encodePredicate",value:function(e){return e.value===f.type?"a":this._encodeIriOrBlank(e)}},{key:"_encodeObject",value:function(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}},{key:"_encodeQuad",value:function(e){var t=e.subject,n=e.predicate,i=e.object,r=e.graph;return"<<".concat(this._encodeSubject(t)," ").concat(this._encodePredicate(n)," ").concat(this._encodeObject(i)).concat((0,u.isDefaultGraph)(r)?"":" ".concat(this._encodeIriOrBlank(r)),">>")}},{key:"_blockedWrite",value:function(){throw new Error("Cannot write because the writer has been closed.")}},{key:"addQuad",value:function(e,t,n,i,r){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof i?this._writeQuad(e,t,n,l,i):this._writeQuad(e,t,n,i||l,r)}},{key:"addQuads",value:function(e){for(var t=0;t.\n"))}if(n){var o="",a="";for(var s in this._prefixIRIs)o+=o?"|".concat(s):s,a+=(a?"|":"")+this._prefixIRIs[s];o=o.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:".concat(a,")[^/]*$|^(").concat(o,")([a-zA-Z][\\-_a-zA-Z0-9]*)$"))}this._write(n?"\n":"",t)}},{key:"blank",value:function(e,t){var n,i,r=e;switch(void 0===e?r=[]:e.termType?r=[{predicate:e,object:t}]:"length"in e||(r=[e]),i=r.length){case 0:return new y("[]");case 1:if(!((n=r[0]).object instanceof y))return new y("[ ".concat(this._encodePredicate(n.predicate)," ").concat(this._encodeObject(n.object)," ]"));default:for(var o="[",a=0;a1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:new Map,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;m(this,e),this.prefix=t,this._existing=n,this.counter=i}return b(e,[{key:"clone",value:function(){var t=this.prefix,n=this._existing,i=this.counter;return new e(t,new Map(n),i)}},{key:"getId",value:function(e){var t=e&&this._existing.get(e);if(t)return t;var n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}},{key:"hasId",value:function(e){return this._existing.has(e)}},{key:"getOldIds",value:function(){return v(this._existing.keys())}}]),e}()},{}],48:[function(e,t,n){"use strict";e("setimmediate");var i=self.crypto||self.msCrypto;t.exports=function(){function e(t){if(m(this,e),!i||!i.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error('Unsupport algorithm "'.concat(t,'".'));this.algorithm={name:"SHA-1"}}this._content=""}return b(e,[{key:"update",value:function(e){this._content+=e}},{key:"digest",value:function(){var e=this;return h(regeneratorRuntime.mark(function t(){var n,r,o,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(new TextEncoder).encode(e._content),t.t0=Uint8Array,t.next=4,i.subtle.digest(e.algorithm,n);case 4:for(t.t1=t.sent,r=new t.t0(t.t1),o="",a=0;a]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),t.exports=function(){function e(){m(this,e)}return b(e,null,[{key:"parse",value:function(e){var t,n=[],h={},d=0,p=_(e.split(c.eoln));try{for(p.s();!(t=p.n()).done;){var v=t.value;if(d++,!c.empty.test(v)){var g=v.match(c.quad);if(null===g)throw new Error("N-Quads parse error on line "+d+".");var m={subject:null,predicate:null,object:null,graph:null};if(m.subject=void 0!==g[1]?{termType:o,value:g[1]}:{termType:a,value:g[2]},m.predicate={termType:o,value:g[3]},void 0!==g[4]?m.object={termType:o,value:g[4]}:void 0!==g[5]?m.object={termType:a,value:g[5]}:(m.object={termType:s,value:void 0,datatype:{termType:o}},void 0!==g[7]?m.object.datatype.value=g[7]:void 0!==g[8]?(m.object.datatype.value=i,m.object.language=g[8]):m.object.datatype.value=r,m.object.value=g[6].replace(f,function(e,t,n,i){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(i)throw new Error("Unsupported U escape")})),m.graph=void 0!==g[9]?{termType:o,value:g[9]}:void 0!==g[10]?{termType:a,value:g[10]}:{termType:u,value:""},m.graph.value in h){var y,b=!0,w=h[m.graph.value],k=_(w);try{for(k.s();!(y=k.n()).done;){if(l(y.value,m)){b=!1;break}}}catch(x){k.e(x)}finally{k.f()}b&&(w.push(m),n.push(m))}else h[m.graph.value]=[m],n.push(m)}}}catch(x){p.e(x)}finally{p.f()}return n}},{key:"serialize",value:function(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));var n,i=[],r=_(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.push(e.serializeQuad(o))}}catch(a){r.e(a)}finally{r.f()}return i.sort().join("")}},{key:"serializeQuad",value:function(e){var t=e.subject,n=e.object,s=e.graph,u="";return u+=t.termType===o?"<".concat(t.value,">"):"".concat(t.value),u+=" <".concat(e.predicate.value,"> "),n.termType===o?u+="<".concat(n.value,">"):n.termType===a?u+=n.value:(u+='"'.concat(n.value.replace(h,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}),'"'),n.datatype.value===i?n.language&&(u+="@".concat(n.language)):n.datatype.value!==r&&(u+="^^<".concat(n.datatype.value,">"))),s.termType===o?u+=" <".concat(s.value,">"):s.termType===a&&(u+=" ".concat(s.value)),u+=" .\n"}},{key:"legacyDatasetToQuads",value:function(e){var t=[],n={"blank node":a,IRI:o,literal:s},c=function(c){e[c].forEach(function(e){var l={};for(var h in e){var f=e[h],d={termType:n[f.type],value:f.value};d.termType===s&&(d.datatype={termType:o},"datatype"in f&&(d.datatype.value=f.datatype),"language"in f?("datatype"in f||(d.datatype.value=i),d.language=f.language):"datatype"in f||(d.datatype.value=r)),l[h]=d}l.graph="@default"===c?{termType:u,value:""}:{termType:c.startsWith("_:")?a:o,value:c},t.push(l)})};for(var l in e)c(l);return t}}]),e}();var h=/["\\\n\r]/g,f=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(e,t,n){"use strict";t.exports=function(){function e(t){m(this,e),this.current=t.sort(),this.done=!1,this.dir=new Map;for(var n=0;ni)&&(u&&a>0&&s>e[a-1]||!u&&ae[a+1])&&(i=s,r=a)}if(null===i)this.done=!0;else{var c=t.get(i)?r-1:r+1;e[r]=e[c],e[c]=i;var l,h=_(e);try{for(h.s();!(l=h.n()).done;){var f=l.value;f>i&&t.set(f,!t.get(f))}}catch(d){h.e(d)}finally{h.f()}}return n}}]),e}()},{}],51:[function(e,t,n){(function(n){(function(){"use strict";var i=e("./IdentifierIssuer"),r=e("./MessageDigest"),o=e("./Permuter"),a=e("./NQuads");function s(e,t){return e.hasht.hash?1:0}t.exports=function(){function e(){m(this,e),this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}return b(e,[{key:"main",value:function(e){var t=this;return h(regeneratorRuntime.mark(function n(){var r,o,u,c,l,h,f,d,p,g,m,y,b,w,k,x,S,E,C,O,T,A,P,I,R,D,N,L,j,F,B,V,z,U,H,G;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:t.quads=e,r=_(e);try{for(r.s();!(o=r.n()).done;)u=o.value,t._addBlankNodeQuadInfo({quad:u,component:u.subject}),t._addBlankNodeQuadInfo({quad:u,component:u.object}),t._addBlankNodeQuadInfo({quad:u,component:u.graph})}catch(W){r.e(W)}finally{r.f()}c=new Map,l=v(t.blankNodeInfo.keys()),h=0,f=_(l),n.prev=6,f.s();case 8:if((d=f.n()).done){n.next=18;break}if(p=d.value,n.t0=++h%100==0,!n.t0){n.next=14;break}return n.next=14,t._yield();case 14:return n.next=16,t._hashAndTrackBlankNode({id:p,hashToBlankNodes:c});case 16:n.next=8;break;case 18:n.next=23;break;case 20:n.prev=20,n.t1=n.catch(6),f.e(n.t1);case 23:return n.prev=23,f.f(),n.finish(23);case 26:g=v(c.keys()).sort(),m=[],y=_(g);try{for(y.s();!(b=y.n()).done;)w=b.value,(k=c.get(w)).length>1?m.push(k):t.canonicalIssuer.getId(k[0])}catch(W){y.e(W)}finally{y.f()}x=0,S=m;case 30:if(!(xd)){i.next=31;break}return k=!0,i.abrupt("break",33);case 31:i.next=26;break;case 33:i.next=38;break;case 35:i.prev=35,i.t1=i.catch(24),x.e(i.t1);case 38:return i.prev=38,x.f(),i.finish(38);case 41:if(k){i.next=64;break}C=_(w),i.prev=43,C.s();case 45:if((O=C.n()).done){i.next=55;break}return T=O.value,i.next=49,n.hashNDegreeQuads(T,y);case 49:if(A=i.sent,b+=y.getId(T),b+="<".concat(A.hash,">"),y=A.issuer,!(0!==d.length&&b>d)){i.next=53;break}return k=!0,i.abrupt("break",55);case 53:i.next=45;break;case 55:i.next=60;break;case 57:i.prev=57,i.t2=i.catch(43),C.e(i.t2);case 60:return i.prev=60,C.f(),i.finish(60);case 63:k||(0===d.length||b")}},{key:"createHashToRelated",value:function(e,t){var n=this;return h(regeneratorRuntime.mark(function i(){var r,o,a,s,u,c;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:r=new Map,o=n.blankNodeInfo.get(e).quads,a=0,s=_(o),i.prev=3,s.s();case 5:if((u=s.n()).done){i.next=15;break}if(c=u.value,i.t0=++a%100==0,!i.t0){i.next=11;break}return i.next=11,n._yield();case 11:return i.next=13,Promise.all([n._addRelatedBlankNodeHash({quad:c,component:c.subject,position:"s",id:e,issuer:t,hashToRelated:r}),n._addRelatedBlankNodeHash({quad:c,component:c.object,position:"o",id:e,issuer:t,hashToRelated:r}),n._addRelatedBlankNodeHash({quad:c,component:c.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);case 13:i.next=5;break;case 15:i.next=20;break;case 17:i.prev=17,i.t1=i.catch(3),s.e(i.t1);case 20:return i.prev=20,s.f(),i.finish(20);case 23:return i.abrupt("return",r);case 24:case"end":return i.stop()}},i,null,[[3,17,20,23]])}))()}},{key:"_hashAndTrackBlankNode",value:function(e){var t=e.id,n=e.hashToBlankNodes,i=this;return h(regeneratorRuntime.mark(function e(){var r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.hashFirstDegreeQuads(t);case 2:r=e.sent,(o=n.get(r))?o.push(t):n.set(r,[t]);case 5:case"end":return e.stop()}},e)}))()}},{key:"_addBlankNodeQuadInfo",value:function(e){var t=e.quad,n=e.component;if("BlankNode"===n.termType){var i=n.value,r=this.blankNodeInfo.get(i);r?r.quads.add(t):this.blankNodeInfo.set(i,{quads:new Set([t]),hash:null})}}},{key:"_addRelatedBlankNodeHash",value:function(e){var t=e.quad,n=e.component,i=e.position,r=e.id,o=e.issuer,a=e.hashToRelated,s=this;return h(regeneratorRuntime.mark(function e(){var u,c,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("BlankNode"===n.termType&&n.value!==r){e.next=2;break}return e.abrupt("return");case 2:return u=n.value,e.next=5,s.hashRelatedBlankNode(u,t,o,i);case 5:c=e.sent,(l=a.get(c))?l.push(u):a.set(c,[u]);case 8:case"end":return e.stop()}},e)}))()}},{key:"_useCanonicalId",value:function(e){var t=e.component;return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}},{key:"_yield",value:function(){return h(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){return n(e)}));case 1:case"end":return e.stop()}},e)}))()}}]),e}()}).call(this)}).call(this,e("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(e,t,n){"use strict";var i=e("./IdentifierIssuer"),r=e("./MessageDigest"),o=e("./Permuter"),a=e("./NQuads");function s(e,t){return e.hasht.hash?1:0}t.exports=function(){function e(){m(this,e),this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}return b(e,[{key:"main",value:function(e){this.quads=e;var t,n=_(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this._addBlankNodeQuadInfo({quad:r,component:r.subject}),this._addBlankNodeQuadInfo({quad:r,component:r.object}),this._addBlankNodeQuadInfo({quad:r,component:r.graph})}}catch(j){n.e(j)}finally{n.f()}var o,u=new Map,c=_(v(this.blankNodeInfo.keys()));try{for(c.s();!(o=c.n()).done;){var l=o.value;this._hashAndTrackBlankNode({id:l,hashToBlankNodes:u})}}catch(j){c.e(j)}finally{c.f()}var h,f=[],d=_(v(u.keys()).sort());try{for(d.s();!(h=d.n()).done;){var p=h.value,g=u.get(p);g.length>1?f.push(g):this.canonicalIssuer.getId(g[0])}}catch(j){d.e(j)}finally{d.f()}for(var m=0,y=f;ml){y=!0;break}}}catch(C){b.e(C)}finally{b.f()}if(!y){var k,x=_(m);try{for(x.s();!(k=x.n()).done;){var S=k.value,E=this.hashNDegreeQuads(S,p);if(g+=p.getId(S),g+="<".concat(E.hash,">"),p=E.issuer,0!==l.length&&g>l){y=!0;break}}}catch(C){x.e(C)}finally{x.f()}y||(0===l.length||g")}},{key:"createHashToRelated",value:function(e,t){var n,i=new Map,r=_(this.blankNodeInfo.get(e).quads);try{for(r.s();!(n=r.n()).done;){var o=n.value;this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:i}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:i}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:i})}}catch(a){r.e(a)}finally{r.f()}return i}},{key:"_hashAndTrackBlankNode",value:function(e){var t=e.id,n=e.hashToBlankNodes,i=this.hashFirstDegreeQuads(t),r=n.get(i);r?r.push(t):n.set(i,[t])}},{key:"_addBlankNodeQuadInfo",value:function(e){var t=e.quad,n=e.component;if("BlankNode"===n.termType){var i=n.value,r=this.blankNodeInfo.get(i);r?r.quads.add(t):this.blankNodeInfo.set(i,{quads:new Set([t]),hash:null})}}},{key:"_addRelatedBlankNodeHash",value:function(e){var t=e.quad,n=e.component,i=e.position,r=e.id,o=e.issuer,a=e.hashToRelated;if("BlankNode"===n.termType&&n.value!==r){var s=n.value,u=this.hashRelatedBlankNode(s,t,o,i),c=a.get(u);c?c.push(s):a.set(u,[s])}}},{key:"_useCanonicalId",value:function(e){var t=e.component;return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}]),e}()},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(e,t,n){"use strict";var i=e("./URDNA2015");t.exports=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.call(this)).name="URGNA2012",e.hashAlgorithm="sha1",e}return b(n,[{key:"modifyFirstDegreeComponent",value:function(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}},{key:"getRelatedPredicate",value:function(e){return e.predicate.value}},{key:"createHashToRelated",value:function(e,t){var n=this;return h(regeneratorRuntime.mark(function i(){var r,o,a,s,u,c,l,h,f,d;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:r=new Map,o=n.blankNodeInfo.get(e).quads,a=0,s=_(o),i.prev=3,s.s();case 5:if((u=s.n()).done){i.next=26;break}if(c=u.value,l=void 0,h=void 0,"BlankNode"!==c.subject.termType||c.subject.value===e){i.next=12;break}h=c.subject.value,l="p",i.next=15;break;case 12:if("BlankNode"===c.object.termType&&c.object.value!==e){i.next=14;break}return i.abrupt("continue",24);case 14:h=c.object.value,l="r";case 15:if(i.t0=++a%100==0,!i.t0){i.next=19;break}return i.next=19,n._yield();case 19:return i.next=21,n.hashRelatedBlankNode(h,c,t,l);case 21:f=i.sent,(d=r.get(f))?d.push(h):r.set(f,[h]);case 24:i.next=5;break;case 26:i.next=31;break;case 28:i.prev=28,i.t1=i.catch(3),s.e(i.t1);case 31:return i.prev=31,s.f(),i.finish(31);case 34:return i.abrupt("return",r);case 35:case"end":return i.stop()}},i,null,[[3,28,31,34]])}))()}}]),n}(i)},{"./URDNA2015":51}],54:[function(e,t,n){"use strict";var i=e("./URDNA2015Sync");t.exports=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.call(this)).name="URGNA2012",e.hashAlgorithm="sha1",e}return b(n,[{key:"modifyFirstDegreeComponent",value:function(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}},{key:"getRelatedPredicate",value:function(e){return e.predicate.value}},{key:"createHashToRelated",value:function(e,t){var n,i=new Map,r=_(this.blankNodeInfo.get(e).quads);try{for(r.s();!(n=r.n()).done;){var o=n.value,a=void 0,s=void 0;if("BlankNode"===o.subject.termType&&o.subject.value!==e)s=o.subject.value,a="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;s=o.object.value,a="r"}var u=this.hashRelatedBlankNode(s,o,t,a),c=i.get(u);c?c.push(s):i.set(u,[s])}}catch(l){r.e(l)}finally{r.f()}return i}}]),n}(i)},{"./URDNA2015Sync":52}],55:[function(e,t,n){"use strict";var i,r=e("./URDNA2015"),o=e("./URGNA2012"),a=e("./URDNA2015Sync"),s=e("./URGNA2012Sync");try{i=e("rdf-canonize-native")}catch(u){}var u,c={};t.exports=c,c.NQuads=e("./NQuads"),c.IdentifierIssuer=e("./IdentifierIssuer"),c._rdfCanonizeNative=function(e){return e&&(i=e),i},c.canonize=(u=h(regeneratorRuntime.mark(function e(t,n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),!n.useNative){e.next=4;break}if(i){e.next=3;break}throw new Error("rdf-canonize-native not available");case 3:return e.abrupt("return",new Promise(function(e,r){return i.canonize(t,n,function(t,n){return t?r(t):e(n)})}));case 4:if("URDNA2015"!==n.algorithm){e.next=6;break}return e.abrupt("return",new r(n).main(t));case 6:if("URGNA2012"!==n.algorithm){e.next=8;break}return e.abrupt("return",new o(n).main(t));case 8:throw"algorithm"in n?new Error("Invalid RDF Dataset Canonicalization algorithm: "+n.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.");case 9:case"end":return e.stop()}},e)})),function(e,t){return u.apply(this,arguments)}),c._canonizeSync=function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(i)return i.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new a(t).main(e);if("URGNA2012"===t.algorithm)return new s(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(e("./lib/BlankNode"),n),r(e("./lib/DataFactory"),n),r(e("./lib/DefaultGraph"),n),r(e("./lib/Literal"),n),r(e("./lib/NamedNode"),n),r(e("./lib/Quad"),n),r(e("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0,n.BlankNode=function(){function e(t){m(this,e),this.termType="BlankNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}]),e}()},{}],58:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;var i=e("./BlankNode"),r=e("./DefaultGraph"),o=e("./Literal"),a=e("./NamedNode"),s=e("./Quad"),u=e("./Variable"),c=0;n.DataFactory=function(){function e(t){m(this,e),this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||"df_".concat(c++,"_")}return b(e,[{key:"namedNode",value:function(e){return new a.NamedNode(e)}},{key:"blankNode",value:function(e){return new i.BlankNode(e||"".concat(this.blankNodePrefix).concat(this.blankNodeCounter++))}},{key:"literal",value:function(e,t){return new o.Literal(e,t)}},{key:"variable",value:function(e){return new u.Variable(e)}},{key:"defaultGraph",value:function(){return r.DefaultGraph.INSTANCE}},{key:"quad",value:function(e,t,n,i){return new s.Quad(e,t,n,i||this.defaultGraph())}},{key:"fromTerm",value:function(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(o.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}},{key:"fromQuad",value:function(e){return this.fromTerm(e)}},{key:"resetBlankNodeCounter",value:function(){this.blankNodeCounter=0}}]),e}()},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;var i=function(){function e(){m(this,e),this.termType="DefaultGraph",this.value=""}return b(e,[{key:"equals",value:function(e){return!!e&&"DefaultGraph"===e.termType}}]),e}();n.DefaultGraph=i,i.INSTANCE=new i},{}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;var i=e("./NamedNode"),r=function(){function e(t,n){m(this,e),this.termType="Literal",this.value=t,"string"==typeof n?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING):n?(this.language="",this.datatype=n):(this.language="",this.datatype=e.XSD_STRING)}return b(e,[{key:"equals",value:function(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}]),e}();n.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0,n.NamedNode=function(){function e(t){m(this,e),this.termType="NamedNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}]),e}()},{}],62:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0,n.Quad=function(){function e(t,n,i,r){m(this,e),this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=i,this.graph=r}return b(e,[{key:"equals",value:function(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}]),e}()},{}],63:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0,n.Variable=function(){function e(t){m(this,e),this.termType="Variable",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}]),e}()},{}],64:[function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(e("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;var i=function(e){a(n,e);var t=s(n);function n(e,i){m(this,n);var r=e.saxStream._parser;return t.call(this,e.trackPosition?"Line ".concat(r.line+1," column ").concat(r.column+1,": ").concat(i):i)}return n}(l(Error));n.ParseError=i},{}],66:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;var i,r,o=e("relative-to-absolute-iri"),u=e("sax"),l=e("stream"),h=e("./ParseError"),f=e("rdf-data-factory"),d=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,{readableObjectMode:!0})).activeTagStack=[],i.nodeIds={},e&&(Object.assign(c(i),e),i.options=e),i.dataFactory||(i.dataFactory=new f.DataFactory),i.baseIRI||(i.baseIRI=""),i.defaultGraph||(i.defaultGraph=i.dataFactory.defaultGraph()),i.saxStream=u.createStream(i.strict,{xmlns:!1,position:i.trackPosition}),i.strict||(i.saxStream._parser.looseCase="toString"),i.attachSaxListeners(),i}return b(n,[{key:"import",value:function(e){var t=new l.PassThrough({readableObjectMode:!0});e.on("error",function(e){return i.emit("error",e)}),e.on("data",function(e){return t.push(e)}),e.on("end",function(){return t.push(null)});var i=t.pipe(new n(this.options));return i}},{key:"_transform",value:function(e,t,n){try{this.saxStream.write(e,t)}catch(i){return n(i)}n()}},{key:"newParseError",value:function(e){return new h.ParseError(this,e)}},{key:"valueToUri",value:function(e,t){return this.uriToNamedNode(o.resolve(e,t.baseIRI))}},{key:"uriToNamedNode",value:function(e){if(!n.isValidIri(e))throw this.newParseError("Invalid URI: ".concat(e));return this.dataFactory.namedNode(e)}},{key:"validateNcname",value:function(e){if(!n.NCNAME_MATCHER.test(e))throw this.newParseError("Not a valid NCName: ".concat(e))}},{key:"attachSaxListeners",value:function(){var e=this;this.saxStream.on("error",function(t){return e.emit("error",t)}),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}},{key:"onTag",value:function(e){var t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null,r=i.RESOURCE;if(t&&(t.hadChildren=!0,r=t.childrenParseType),t&&t.childrenStringTags){var o=e.name,a="";for(var s in e.attributes)a+=" ".concat(s,'="').concat(e.attributes[s],'"');t.childrenStringTags.push("<".concat(o).concat(a,">"));var u={childrenStringTags:t.childrenStringTags};return u.childrenStringEmitClosingTag=""),void this.activeTagStack.push(u)}var c={};t?(c.language=t.language,c.baseIRI=t.baseIRI):c.baseIRI=this.baseIRI,this.activeTagStack.push(c),c.ns=n.parseNamespace(e,t),r===i.RESOURCE?this.onTagResource(e,c,t,!t):this.onTagProperty(e,c,t)}},{key:"onTagResource",value:function(e,t,r,a){var s=n.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=i.PROPERTY;var u=!0;if(s.uri===n.RDF){if(!a&&n.FORBIDDEN_NODE_ELEMENTS.indexOf(s.local)>=0)throw this.newParseError("Illegal node element name: ".concat(s.local));switch(s.local){case"RDF":t.childrenParseType=i.RESOURCE;case"Description":u=!1}}var c=[],l=[],h=null,f=!1,d=!1,p=null;for(var v in e.attributes){var g=e.attributes[v],m=n.expandPrefixedTerm(v,t.ns,this);if(r&&m.uri===n.RDF)switch(m.local){case"about":if(h)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(h," where found."));h=g;continue;case"ID":if(h)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(h," where found."));this.validateNcname(g),h="#"+g,f=!0;continue;case"nodeID":if(h)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(h," where found."));this.validateNcname(g),h=g,d=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=g;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===n.XML){if("lang"===m.local){t.language=""===g?null:g.toLowerCase();continue}if("base"===m.local){t.baseIRI=o.resolve(g,t.baseIRI);continue}}"xml"!==m.prefix&&m.uri&&(c.push(this.uriToNamedNode(m.uri+m.local)),l.push(g))}if(null!==h&&(t.subject=d?this.dataFactory.blankNode(h):this.valueToUri(h,t),f&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),u){var y=this.uriToNamedNode(s.uri+s.local);this.emitTriple(t.subject,this.dataFactory.namedNode(n.RDF+"type"),y,r?r.reifiedStatementId:null)}if(r){if(r.predicate)if(r.childrenCollectionSubject){var b=this.dataFactory.blankNode();this.emitTriple(r.childrenCollectionSubject,r.childrenCollectionPredicate,b,r.reifiedStatementId),this.emitTriple(b,this.dataFactory.namedNode(n.RDF+"first"),t.subject,t.reifiedStatementId),r.childrenCollectionSubject=b,r.childrenCollectionPredicate=this.dataFactory.namedNode(n.RDF+"rest")}else{this.emitTriple(r.subject,r.predicate,t.subject,r.reifiedStatementId);for(var _=0;_=0)throw this.newParseError("Illegal property element name: ".concat(o.local));t.predicateSubPredicates=[],t.predicateSubObjects=[];var a=!1,s=!1,u=null,c=!0,l=[],h=[];for(var f in e.attributes){var d=e.attributes[f],p=n.expandPrefixedTerm(f,t.ns,this);if(p.uri===n.RDF)switch(p.local){case"resource":if(u)throw this.newParseError("Found both rdf:resource (".concat(d,") and rdf:nodeID (").concat(u,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:resource (".concat(d,")"));t.hadChildren=!0,u=d,c=!1;continue;case"datatype":if(s)throw this.newParseError("Found both non-rdf:* property attributes and rdf:datatype (".concat(d,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(d,")"));t.datatype=this.valueToUri(d,t);continue;case"nodeID":if(s)throw this.newParseError("Found both non-rdf:* property attributes and rdf:nodeID (".concat(d,")."));if(t.hadChildren)throw this.newParseError("Found both rdf:resource and rdf:nodeID (".concat(d,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID (".concat(d,")"));this.validateNcname(d),t.hadChildren=!0,u=d,c=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(s)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(t.datatype.value,")"));if(u)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (".concat(u,")"));if("Resource"===d){a=!0,t.childrenParseType=i.PROPERTY;var v=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,v,t.reifiedStatementId),t.subject=v,t.predicate=null}else"Collection"===d?(a=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,c=!1):"Literal"===d&&(a=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(d),t.reifiedStatementId=this.valueToUri("#"+d,t),this.claimNodeId(t.reifiedStatementId);continue}else if(p.uri===n.XML&&"lang"===p.local){t.language=""===d?null:d.toLowerCase();continue}if("xml"!==p.prefix&&"xmlns"!==p.prefix&&p.uri){if(a||t.datatype)throw this.newParseError("Found illegal rdf:* properties on property element with attribute: ".concat(d));t.hadChildren=!0,s=!0,l.push(this.uriToNamedNode(p.uri+p.local)),h.push(this.dataFactory.literal(d,t.datatype||t.language))}}if(null!==u){var g=t.subject;t.subject=c?this.dataFactory.blankNode(u):this.valueToUri(u,t),this.emitTriple(g,t.predicate,t.subject,t.reifiedStatementId);for(var m=0;m/g,function(e,n,i){return t.saxStream._parser.ENTITIES[n]=i,""})}}],[{key:"parseNamespace",value:function(e,t){var i={},r=!1;for(var o in e.attributes)o.startsWith("xmlns")&&(5===o.length?(r=!0,i[""]=e.attributes[o]):":"===o.charAt(5)&&(r=!0,i[o.substr(6)]=e.attributes[o]));var a=t&&t.ns?t.ns:[n.DEFAULT_NS];return r?a.concat([i]):a}},{key:"expandPrefixedTerm",value:function(e,t,n){var i,r,o=e.indexOf(":");o>=0?(i=e.substr(0,o),r=e.substr(o+1)):(i="",r=e);for(var a=null,s=null,u=t.length-1;u>=0;u--){var c=t[u][i];if(c){a=c;break}s||(s=t[u][""])}if(!a){if(i&&"xmlns"!==i)throw new h.ParseError(n,"The prefix '".concat(i,"' in term '").concat(e,"' was not bound."));a=s||""}return{prefix:i,local:r,uri:a}}},{key:"isValidIri",value:function(e){return n.IRI_REGEX.test(e)}}]),n}(l.Transform);n.RdfXmlParser=d,d.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,d.MIME_TYPE="application/rdf+xml",d.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",d.XML="http://www.w3.org/XML/1998/namespace",d.XMLNS="http://www.w3.org/2000/xmlns/",d.DEFAULT_NS={xml:d.XML},d.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],d.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],d.NCNAME_MATCHER=/^((?:[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]))((?:[#\x2D\.0-9A-Z_a-z\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]))*$/,(r=i=n.ParseType||(n.ParseType={}))[r.RESOURCE=0]="RESOURCE",r[r.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(e,t,n){"use strict";var i={};function r(e,t,n){n||(n=Error);var r=function(e){function n(n,i,r){return e.call(this,function(e,n,i){return"string"==typeof t?t:t(e,n,i)}(n,i,r))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(n,e),n}(n);r.prototype.name=n.name,r.prototype.code=e,i[e]=r}function o(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,n){var i,r;if("string"==typeof t&&function(e,t,n){return e.substr(0,t.length)===t}(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))r="The ".concat(e," ").concat(i," ").concat(o(t,"type"));else{var a=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";r='The "'.concat(e,'" ').concat(a," ").concat(i," ").concat(o(t,"type"))}return r+". Received type ".concat(typeof n)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],68:[function(e,t,n){(function(n){(function(){"use strict";var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var r=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(c,r);for(var a=i(o.prototype),s=0;s0)if("string"!=typeof t&&!s.objectMode&&Object.getPrototypeOf(t)!==u.prototype&&(t=function(e){return u.from(e)}(t)),i)s.endEmitted?k(e,new w):O(e,s,t,!0);else if(s.ended)k(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?O(e,s,t,!1):I(e,s)):O(e,s,t,!1)}else i||(s.reading=!1,I(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function P(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(M,e))}function M(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function I(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){o("readable nexttick read 0"),e.read(0)}function L(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(V,t,e))}function V(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function z(e,t){for(var n=0,i=e.length;n=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):P(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&B(this),null;var i,r=t.needReadable;return o("need readable",r),(0===t.length||t.length-e0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),null!==i&&this.emit("data",i),i},E.prototype._read=function(e){k(this,new _("_read()"))},E.prototype.pipe=function(e,t){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,o("pipe count=%d opts=%j",r.pipesCount,t);var s=t&&!1===t.end||e===n.stdout||e===n.stderr?v:u;function u(){o("onend"),e.end()}r.endEmitted?n.nextTick(s):i.once("end",s),e.on("unpipe",function t(n,a){o("onunpipe"),n===i&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),i.removeListener("end",u),i.removeListener("end",v),i.removeListener("data",h),l=!0,r.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c())});var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,j(e))}}(i);e.on("drain",c);var l=!1;function h(t){o("ondata");var n=e.write(t);o("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==z(r.pipes,e))&&!l&&(o("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function f(t){o("onerror",t),v(),e.removeListener("error",f),0===a(e,"error")&&k(e,t)}function d(){e.removeListener("finish",p),v()}function p(){o("onfinish"),e.removeListener("close",d),v()}function v(){o("unpipe"),i.unpipe(e)}return i.on("data",h),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",f),e.once("close",d),e.once("finish",p),e.emit("pipe",i),r.flowing||(o("pipe resume"),i.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var i=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==r.flowing&&this.resume()):"readable"===e&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,o("on readable",r.length,r.reading),r.length?P(this):r.reading||n.nextTick(N,this)),i},E.prototype.removeListener=function(e,t){var i=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(D,this),i},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(D,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(L,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,n=this._readableState,i=!1;for(var r in e.on("end",function(){if(o("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(r){o("wrapped data"),n.decoder&&(r=n.decoder.write(r)),n.objectMode&&null==r||!(n.objectMode||r&&r.length)||t.push(r)||(i=!0,e.pause())}),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var a=0;a-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,n){n(new v("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,i){var r=this._writableState;return"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,i){t.ending=!0,M(e,t),i&&(t.finished?n.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}(this,r,i),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}}),E.prototype.destroy=h.destroy,E.prototype._undestroy=h.undestroy,E.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(e,t,n){(function(n){(function(){"use strict";var i;function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=e("./end-of-stream"),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),f=Symbol("stream");function d(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[f].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(d(n,!1)))}}function v(e){n.nextTick(p,e)}var g=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((r(i={get stream(){return this[f]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(d(void 0,!0));if(this[f].destroyed)return new Promise(function(t,i){n.nextTick(function(){e[u]?i(e[u]):t(d(void 0,!0))})});var i,r=this[l];if(r)i=new Promise(function(e,t){return function(n,i){e.then(function(){t[c]?n(d(void 0,!0)):t[h](n,i)},i)}}(r,this));else{var o=this[f].read();if(null!==o)return Promise.resolve(d(o,!1));i=new Promise(this[h])}return this[l]=i,i}},Symbol.asyncIterator,function(){return this}),r(i,"return",function(){var e=this;return new Promise(function(t,n){e[f].destroy(null,function(e){e?n(e):t(d(void 0,!0))})})}),i),g);t.exports=function(e){var t,n=Object.create(m,(r(t={},f,{value:e,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,u,{value:null,writable:!0}),r(t,c,{value:e._readableState.endEmitted,writable:!0}),r(t,h,{value:function(e,t){var i=n[f].read();i?(n[l]=null,n[a]=null,n[s]=null,e(d(i,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[l]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[l]=null,n[a]=null,n[s]=null,t(e)),void(n[u]=e)}var i=n[a];null!==i&&(n[l]=null,n[a]=null,n[s]=null,i(d(void 0,!0))),n[c]=!0}),e.on("readable",v.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":76,_process:44}],74:[function(e,t,n){"use strict";function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),n=this.head,i=0;n;)c(n.data,t,i),i+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return er.length?r.length:e;if(i+=o===r.length?r:r.slice(0,e),0==(e-=o)){o===r.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=r.slice(o));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,i=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var r=n.data,o=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,o),0==(e-=o)){o===r.length?(++i,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=r.slice(o));break}++i}return this.length-=i,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t0,function(e){r||(r=e),e&&a.forEach(c),!o&&(a.forEach(c),i(r))})});return t.reduce(l)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(e,t,n){"use strict";var i=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,r){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,r,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new i(r?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":67}],80:[function(e,t,n){t.exports=e("events").EventEmitter},{events:8}],81:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(e,t,n){"use strict";function i(e){for(var t=[],n=0;n=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);var r=e.indexOf("/",n);return r<0?e:e.substr(0,r)+i(e.substr(r))}function o(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(e,t){var n=(t=t||"").indexOf("#");if(n>0&&(t=t.substr(0,n)),!e.length){if(t.indexOf(":")<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));return t}if(e.startsWith("?")){var o=t.indexOf("?");return o>0&&(t=t.substr(0,o)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){var a=e.indexOf(":");if(a<0)throw new Error("Found invalid relative IRI '".concat(e,"' for a missing baseIRI"));return r(e,a)}var s=e.indexOf(":");if(s>=0)return r(e,s);var u=t.indexOf(":");if(u<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));var c,l=t.substr(0,u+1);if(0===e.indexOf("//"))return l+r(e,s);if(t.indexOf("//",u)===u+1){if((c=t.indexOf("/",u+3))<0)return t.length>u+3?t+"/"+r(e,s):l+r(e,s)}else if((c=t.indexOf("/",u+1))<0)return l+r(e,s);if(0===e.indexOf("/"))return t.substr(0,c)+i(e);var h=t.substr(c),f=h.lastIndexOf("/");return f>=0&&f"===o?(C(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=x.TEXT):(g(o)&&(t.state=x.SGML_DECL_QUOTED),t.sgmlDecl+=o);continue;case x.SGML_DECL_QUOTED:o===t.q&&(t.state=x.SGML_DECL,t.q=""),t.sgmlDecl+=o;continue;case x.DOCTYPE:">"===o?(t.state=x.TEXT,C(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=o,"["===o?t.state=x.DOCTYPE_DTD:g(o)&&(t.state=x.DOCTYPE_QUOTED,t.q=o));continue;case x.DOCTYPE_QUOTED:t.doctype+=o,o===t.q&&(t.q="",t.state=x.DOCTYPE);continue;case x.DOCTYPE_DTD:t.doctype+=o,"]"===o?t.state=x.DOCTYPE:g(o)&&(t.state=x.DOCTYPE_DTD_QUOTED,t.q=o);continue;case x.DOCTYPE_DTD_QUOTED:t.doctype+=o,o===t.q&&(t.state=x.DOCTYPE_DTD,t.q="");continue;case x.COMMENT:"-"===o?t.state=x.COMMENT_ENDING:t.comment+=o;continue;case x.COMMENT_ENDING:"-"===o?(t.state=x.COMMENT_ENDED,t.comment=T(t.opt,t.comment),t.comment&&C(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+o,t.state=x.COMMENT);continue;case x.COMMENT_ENDED:">"!==o?(M(t,"Malformed comment"),t.comment+="--"+o,t.state=x.COMMENT):t.state=x.TEXT;continue;case x.CDATA:"]"===o?t.state=x.CDATA_ENDING:t.cdata+=o;continue;case x.CDATA_ENDING:"]"===o?t.state=x.CDATA_ENDING_2:(t.cdata+="]"+o,t.state=x.CDATA);continue;case x.CDATA_ENDING_2:">"===o?(t.cdata&&C(t,"oncdata",t.cdata),C(t,"onclosecdata"),t.cdata="",t.state=x.TEXT):"]"===o?t.cdata+="]":(t.cdata+="]]"+o,t.state=x.CDATA);continue;case x.PROC_INST:"?"===o?t.state=x.PROC_INST_ENDING:v(o)?t.state=x.PROC_INST_BODY:t.procInstName+=o;continue;case x.PROC_INST_BODY:if(!t.procInstBody&&v(o))continue;"?"===o?t.state=x.PROC_INST_ENDING:t.procInstBody+=o;continue;case x.PROC_INST_ENDING:">"===o?(C(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=x.TEXT):(t.procInstBody+="?"+o,t.state=x.PROC_INST_BODY);continue;case x.OPEN_TAG:y(f,o)?t.tagName+=o:(I(t),">"===o?N(t):"/"===o?t.state=x.OPEN_TAG_SLASH:(v(o)||M(t,"Invalid character in tag name"),t.state=x.ATTRIB));continue;case x.OPEN_TAG_SLASH:">"===o?(N(t,!0),L(t)):(M(t,"Forward-slash in opening tag not followed by >"),t.state=x.ATTRIB);continue;case x.ATTRIB:if(v(o))continue;">"===o?N(t):"/"===o?t.state=x.OPEN_TAG_SLASH:y(h,o)?(t.attribName=o,t.attribValue="",t.state=x.ATTRIB_NAME):M(t,"Invalid attribute name");continue;case x.ATTRIB_NAME:"="===o?t.state=x.ATTRIB_VALUE:">"===o?(M(t,"Attribute without value"),t.attribValue=t.attribName,D(t),N(t)):v(o)?t.state=x.ATTRIB_NAME_SAW_WHITE:y(f,o)?t.attribName+=o:M(t,"Invalid attribute name");continue;case x.ATTRIB_NAME_SAW_WHITE:if("="===o)t.state=x.ATTRIB_VALUE;else{if(v(o))continue;M(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",C(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===o?N(t):y(h,o)?(t.attribName=o,t.state=x.ATTRIB_NAME):(M(t,"Invalid attribute name"),t.state=x.ATTRIB)}continue;case x.ATTRIB_VALUE:if(v(o))continue;g(o)?(t.q=o,t.state=x.ATTRIB_VALUE_QUOTED):(M(t,"Unquoted attribute value"),t.state=x.ATTRIB_VALUE_UNQUOTED,t.attribValue=o);continue;case x.ATTRIB_VALUE_QUOTED:if(o!==t.q){"&"===o?t.state=x.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=o;continue}D(t),t.q="",t.state=x.ATTRIB_VALUE_CLOSED;continue;case x.ATTRIB_VALUE_CLOSED:v(o)?t.state=x.ATTRIB:">"===o?N(t):"/"===o?t.state=x.OPEN_TAG_SLASH:y(h,o)?(M(t,"No whitespace between attributes"),t.attribName=o,t.attribValue="",t.state=x.ATTRIB_NAME):M(t,"Invalid attribute name");continue;case x.ATTRIB_VALUE_UNQUOTED:if(!m(o)){"&"===o?t.state=x.ATTRIB_VALUE_ENTITY_U:t.attribValue+=o;continue}D(t),">"===o?N(t):t.state=x.ATTRIB;continue;case x.CLOSE_TAG:if(t.tagName)">"===o?L(t):y(f,o)?t.tagName+=o:t.script?(t.script+=""===o?L(t):M(t,"Invalid characters in closing tag");continue;case x.TEXT_ENTITY:case x.ATTRIB_VALUE_ENTITY_Q:case x.ATTRIB_VALUE_ENTITY_U:var s,u;switch(t.state){case x.TEXT_ENTITY:s=x.TEXT,u="textNode";break;case x.ATTRIB_VALUE_ENTITY_Q:s=x.ATTRIB_VALUE_QUOTED,u="attribValue";break;case x.ATTRIB_VALUE_ENTITY_U:s=x.ATTRIB_VALUE_UNQUOTED,u="attribValue"}";"===o?(t[u]+=j(t),t.entity="",t.state=s):y(t.entity.length?p:d,o)?t.entity+=o:(M(t,"Invalid character in entity name"),t[u]+="&"+t.entity+o,t.entity="",t.state=s);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&function(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),i=0,o=0,a=r.length;ot)switch(r[o]){case"textNode":O(e);break;case"cdata":C(e,"oncdata",e.cdata),e.cdata="";break;case"script":C(e,"onscript",e.script),e.script="";break;default:A(e,"Max buffer length exceeded: "+r[o])}i=Math.max(i,s)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-i+e.position}(t),t},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(e){O(e),""!==e.cdata&&(C(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(C(e,"onscript",e.script),e.script="")}(this)}};try{i=e("stream").Stream}catch(_){i=function(){}}var a=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function s(e,t){if(!(this instanceof s))return new s(e,t);i.apply(this),this._parser=new o(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,a.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})})}(s.prototype=Object.create(i.prototype,{constructor:{value:s}})).write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var i=e("string_decoder").StringDecoder;this._decoder=new i("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var n=this;return!n._parser["on"+e]&&-1!==a.indexOf(e)&&(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),i.prototype.on.call(n,e,t)};var u="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",l={xml:u,xmlns:c},h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function v(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function g(e){return'"'===e||"'"===e}function m(e){return">"===e||v(e)}function y(e,t){return e.test(t)}function b(e,t){return!y(e,t)}var _,w,k,x=0;for(var S in n.STATE={BEGIN:x++,BEGIN_WHITESPACE:x++,TEXT:x++,TEXT_ENTITY:x++,OPEN_WAKA:x++,SGML_DECL:x++,SGML_DECL_QUOTED:x++,DOCTYPE:x++,DOCTYPE_QUOTED:x++,DOCTYPE_DTD:x++,DOCTYPE_DTD_QUOTED:x++,COMMENT_STARTING:x++,COMMENT:x++,COMMENT_ENDING:x++,COMMENT_ENDED:x++,CDATA:x++,CDATA_ENDING:x++,CDATA_ENDING_2:x++,PROC_INST:x++,PROC_INST_BODY:x++,PROC_INST_ENDING:x++,OPEN_TAG:x++,OPEN_TAG_SLASH:x++,ATTRIB:x++,ATTRIB_NAME:x++,ATTRIB_NAME_SAW_WHITE:x++,ATTRIB_VALUE:x++,ATTRIB_VALUE_QUOTED:x++,ATTRIB_VALUE_CLOSED:x++,ATTRIB_VALUE_UNQUOTED:x++,ATTRIB_VALUE_ENTITY_Q:x++,ATTRIB_VALUE_ENTITY_U:x++,CLOSE_TAG:x++,CLOSE_TAG_SAW_WHITE:x++,SCRIPT:x++,SCRIPT_ENDING:x++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],i="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=i}),n.STATE)n.STATE[n.STATE[S]]=S;function E(e,t,n){e[t]&&e[t](n)}function C(e,t,n){e.textNode&&O(e),E(e,t,n)}function O(e){e.textNode=T(e.opt,e.textNode),e.textNode&&E(e,"ontext",e.textNode),e.textNode=""}function T(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function A(e,t){return O(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,E(e,"onerror",t),e}function P(e){return e.sawRoot&&!e.closedRoot&&M(e,"Unclosed root tag"),e.state!==x.BEGIN&&e.state!==x.BEGIN_WHITESPACE&&e.state!==x.TEXT&&A(e,"Unexpected end"),O(e),e.c="",e.closed=!0,E(e,"onend"),o.call(e,e.strict,e.opt),e}function M(e,t){if("object"!=typeof e||!(e instanceof o))throw new Error("bad call to strictFail");e.strict&&A(e,t)}function I(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,C(e,"onopentagstart",n)}function R(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),i=n[0],r=n[1];return t&&"xmlns"===e&&(i="xmlns",r=""),{prefix:i,local:r}}function D(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=R(e.attribName,!0),n=t.local;if("xmlns"===t.prefix)if("xml"===n&&e.attribValue!==u)M(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==c)M(e,"xmlns: prefix must be bound to "+c+"\nActual: "+e.attribValue);else{var i=e.tag,r=e.tags[e.tags.length-1]||e;i.ns===r.ns&&(i.ns=Object.create(r.ns)),i.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,C(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function N(e,t){if(e.opt.xmlns){var n=e.tag,i=R(e.tagName);n.prefix=i.prefix,n.local=i.local,n.uri=n.ns[i.prefix]||"",n.prefix&&!n.uri&&(M(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=i.prefix),n.ns&&(e.tags[e.tags.length-1]||e).ns!==n.ns&&Object.keys(n.ns).forEach(function(t){C(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var r=0,o=e.attribList.length;r",e.tagName="",void(e.state=x.SCRIPT);C(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var i=n;t--&&e.tags[t].name!==i;)M(e,"Unexpected close tag");if(t<0)return M(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=x.TEXT);e.tagName=n;for(var r=e.tags.length;r-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,C(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];e.opt.xmlns&&o.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(o.ns).forEach(function(t){C(e,"onclosenamespace",{prefix:t,uri:o.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=x.TEXT}function j(e){var t,n=e.entity,i=n.toLowerCase(),r="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[i]?e.ENTITIES[i]:("#"===(n=i).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),r=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),r=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||r.toLowerCase()!==n?(M(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function F(e,t){"<"===t?(e.state=x.OPEN_WAKA,e.startTagPosition=e.position):v(t)||(M(e,"Non-whitespace before first tag."),e.textNode=t,e.state=x.TEXT)}function B(e,t){var n="";return t1114111||w(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?t.push(o):t.push(55296+((o-=65536)>>10),o%1024+56320),(n+1===i||t.length>e)&&(r+=_.apply(null,t),t.length=0)}return r},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:k,configurable:!0,writable:!0}):String.fromCodePoint=k)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,e("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(e,t,n){(function(e,t){(function(){!function(t,n){"use strict";if(!t.setImmediate){var i,r=1,o={},a=!1,s=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){f(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(c="setImmediate$"+Math.random()+"$",l=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(c)&&f(+e.data.slice(c.length))},t.addEventListener?t.addEventListener("message",l,!1):t.attachEvent("onmessage",l),i=function(e){t.postMessage(c+e,"*")}):t.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){f(e.data)},i=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;i=function(t){var n=s.createElement("script");n.onreadystatechange=function(){f(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():i=function(e){setTimeout(f,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=u++,i=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,r(function(){s[t]&&(i?e.apply(null,i):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof i?i:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(e,t,n){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(i){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(e,t,n){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}},e,this)})}},{}],92:[function(e,t,n){"use strict";function i(e){var t=this;if(t instanceof i||(t=new i),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=e(n,i.value,r),i=i.next;return n},i.prototype.reduceReverse=function(e,t){var n,i=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=e(n,i.value,r),i=i.prev;return n},i.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},i.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},i.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new i;if(tthis.length&&(t=this.length);for(var r=0,o=this.head;null!==o&&rthis.length&&(t=this.length);for(var r=this.length,o=this.tail;null!==o&&r>t;r--)o=o.prev;for(;null!==o&&r>e;r--,o=o.prev)n.push(o.value);return n},i.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n is not a method!");return{configurable:i.boolTrue,get:function(){var e=n.value.bind(this);return Object.defineProperty(this,t,{value:e,configurable:i.boolTrue,writable:i.boolTrue}),e}}}t.ak=r,t.ZP=r},97266:function(e,t,n){e.exports={ResizeSensor:n(69835),ElementQueries:n(54845)}},54845:function(e,t,n){"use strict";var i,r,o;"undefined"!=typeof window&&window,r=[n(69835)],void 0!==(o="function"==typeof(i=function(e){var t=function(){var t,n={},i=[];function r(e){e||(e=document.documentElement);var t=window.getComputedStyle(e,null).fontSize;return parseFloat(t)||16}function o(e,t){var n=t.split(/\d/),i=n[n.length-1];switch(t=parseFloat(t),i){case"px":return t;case"em":return t*r(e);case"rem":return t*r();case"vw":return t*document.documentElement.clientWidth/100;case"vh":return t*document.documentElement.clientHeight/100;case"vmin":case"vmax":var o=document.documentElement.clientWidth/100,a=document.documentElement.clientHeight/100;return t*(0,Math["vmin"===i?"min":"max"])(o,a);default:return t}}function a(e,t){this.element=e;var i,r,a,s,u,c,l,h,f=["min-width","min-height","max-width","max-height"];this.call=function(){for(i in a=function(e){if(!e.getBoundingClientRect)return{width:e.offsetWidth,height:e.offsetHeight};var t=e.getBoundingClientRect();return{width:Math.round(t.width),height:Math.round(t.height)}}(this.element),c={},n[t])!n[t].hasOwnProperty(i)||(s=o(this.element,(r=n[t][i]).value),u="width"===r.property?a.width:a.height,l="","min"===r.mode&&u>=s&&(l+=r.value),"max"===r.mode&&u<=s&&(l+=r.value),c[h=r.mode+"-"+r.property]||(c[h]=""),l&&-1===(" "+c[h]+" ").indexOf(" "+l+" ")&&(c[h]+=" "+l));for(var e in f)!f.hasOwnProperty(e)||(c[f[e]]?this.element.setAttribute(f[e],c[f[e]].substr(1)):this.element.removeAttribute(f[e]))}}function s(t,n){t.elementQueriesSetupInformation||(t.elementQueriesSetupInformation=new a(t,n)),t.elementQueriesSensor||(t.elementQueriesSensor=new e(t,function(){t.elementQueriesSetupInformation.call()}))}function u(e,r,o,a){if(void 0===n[e]){n[e]=[];var s=i.length;t.innerHTML+="\n"+e+" {animation: 0.1s element-queries;}",t.innerHTML+="\n"+e+" > .resize-sensor {min-width: "+s+"px;}",i.push(e)}n[e].push({mode:r,property:o,value:a})}function c(e){var t;if(document.querySelectorAll&&(t=e?e.querySelectorAll.bind(e):document.querySelectorAll.bind(document)),!t&&"undefined"!=typeof $$&&(t=$$),!t&&"undefined"!=typeof jQuery&&(t=jQuery),!t)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return t}function l(t){var n=[],i=[],r=[],o=0,a=-1,s=[];for(var u in t.children)if(t.children.hasOwnProperty(u)&&t.children[u].tagName&&"img"===t.children[u].tagName.toLowerCase()){n.push(t.children[u]);var c=t.children[u].getAttribute("min-width")||t.children[u].getAttribute("data-min-width"),l=t.children[u].getAttribute("data-src")||t.children[u].getAttribute("url");r.push(l),i.push({minWidth:c}),c?t.children[u].style.display="none":(o=n.length-1,t.children[u].style.display="block")}function h(){var e,u=!1;for(e in n)!n.hasOwnProperty(e)||i[e].minWidth&&t.offsetWidth>i[e].minWidth&&(u=e);if(u||(u=o),a!==u)if(s[u])n[a].style.display="none",n[u].style.display="block",a=u;else{var c=new Image;c.onload=function(){n[u].src=r[u],n[a].style.display="none",n[u].style.display="block",s[u]=!0,a=u},c.src=r[u]}else n[u].src=r[u]}a=o,t.resizeSensorInstance=new e(t,h),h()}var h=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,f=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function d(e){var t,n,i,r;for(e=e.replace(/'/g,'"');null!==(t=h.exec(e));)for(n=t[1]+t[3],i=t[2];null!==(r=f.exec(i));)u(n,r[1],r[2],r[3])}function p(e){var t="";if(e)if("string"==typeof e)(-1!==(e=e.toLowerCase()).indexOf("min-width")||-1!==e.indexOf("max-width"))&&d(e);else for(var n=0,i=e.length;n img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",t.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(t),v=!0);for(var r=0,o=document.styleSheets.length;r0&&a.length>r&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,console&&console.warn&&console.warn(s)}return e}function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function O(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=C.bind(i);return r.listener=n,i.wrapFn=r,r}function T(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=r[e];if(void 0===s)return!1;if("function"==typeof s)b(s,this,t);else{var u=s.length,c=P(s,u);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},w.prototype.listeners=function(e){return T(this,e,!0)},w.prototype.rawListeners=function(e){return T(this,e,!1)},w.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):A.call(e,t)},w.prototype.listenerCount=A,w.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]},I.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(I.prototype[Symbol.iterator]=function(){return this}),I.of=function(){var e=arguments,t=e.length,n=0;return new I(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},I.empty=function(){var e=new I(null);return e.done=!0,e},I.is=function(e){return e instanceof I||"object"==typeof e&&null!==e&&"function"==typeof e.next};var R=I,D=function(e,t){for(var n,i=arguments.length>1?t:1/0,r=i!==1/0?new Array(i):[],o=0;;){if(o===i)return r;if((n=e.next()).done)return o!==t?r.slice(0,o):r;r[o++]=n.value}},N=function(e){function n(t,n){var i;return(i=e.call(this)||this).name="GraphError",i.message=t||"",i.data=n||{},i}return t(n,e),n}(a(Error)),L=function(e){function n(t,i){var r;return(r=e.call(this,t,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(r),n.prototype.constructor),r}return t(n,e),n}(N),j=function(e){function n(t,i){var r;return(r=e.call(this,t,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(r),n.prototype.constructor),r}return t(n,e),n}(N),F=function(e){function n(t,i){var r;return(r=e.call(this,t,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(r),n.prototype.constructor),r}return t(n,e),n}(N);function B(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function V(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function z(e,t){this.key=e,this.attributes=t,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function U(e,t,n,i,r,o){this.key=t,this.attributes=o,this.undirected=e,this.source=i,this.target=r,this.generatedKey=n}function H(e,t,n,i,r,o,a){var s,u,c="out",l="in";if(t&&(c=l="undirected"),e.multi){if(void 0===(u=(s=o[c])[r])&&(u=new Set,s[r]=u),u.add(n),i===r&&t)return;void 0===(s=a[l])[i]&&(s[i]=u)}else{if(o[c][r]=n,i===r&&t)return;a[l][i]=n}}function G(e,t,n){var i=e.multi,r=n.source,o=n.target,a=r.key,s=o.key,u=r[t?"undirected":"out"],c=t?"undirected":"in";if(s in u)if(i){var l=u[s];1===l.size?(delete u[s],delete o[c][a]):l.delete(n)}else delete u[s];i||delete o[c][a]}V.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},z.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var W=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var r=""+e,o=""+arguments[1];if(!(i=c(this,r,o,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(r,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],r=arguments[3],!(o=c(this,a,s,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&o.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]=r,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],r=arguments[3],!(o=c(this,a,s,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof r)throw new L("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&o.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]=r(o.attributes[i]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete r.attributes[i],this.emit("edgeAttributesUpdated",{key:r.key,type:"remove",attributes:r.attributes,name:i}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes=i,this.emit("edgeAttributesUpdated",{key:r.key,type:"replace",attributes:r.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return u(r.attributes,i),this.emit("edgeAttributesUpdated",{key:r.key,type:"merge",attributes:r.attributes,data:i}),this}}}],q=R,X=function(){var e,t=arguments,n=-1;return new q(function i(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var r=e.next();return r.done?(e=null,i()):r})},Y=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function K(e,t){for(var n in t)e.push(t[n].key)}function Q(e,t){for(var n in t)t[n].forEach(function(t){return e.push(t.key)})}function $(e,t,n){for(var i in e)if(i!==n){var r=e[i];t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey)}}function Z(e,t,n){for(var i in e)i!==n&&e[i].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function J(e,t,n){for(var i in e)if(i!==n){var r=e[i];if(t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey))return!0}return!1}function ee(e,t,n){var i,r,o,a,s;for(var u in e)if(u!==n)for(i=e[u].values();!0!==(r=i.next()).done;)if(a=(o=r.value).source,t(o.key,o.attributes,a.key,(s=o.target).key,a.attributes,s.attributes,o.undirected,o.generatedKey))return!0;return!1}function te(e,t){var n=Object.keys(e),i=n.length,r=null,o=0;return new R(function a(){var s;if(r){var u=r.next();if(u.done)return r=null,o++,a();s=u.value}else{if(o>=i)return{done:!0};var c=n[o];if(c===t)return o++,a();if((s=e[c])instanceof Set)return r=s.values(),a();o++}return{done:!1,value:[s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes]}})}function ne(e,t,n){var i=t[n];i&&e.push(i.key)}function ie(e,t,n){var i=t[n];i&&i.forEach(function(t){return e.push(t.key)})}function re(e,t,n){var i=e[t];if(i){var r=i.source,o=i.target;n(i.key,i.attributes,r.key,o.key,r.attributes,o.attributes,i.undirected,i.generatedKey)}}function oe(e,t,n){var i=e[t];i&&i.forEach(function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function ae(e,t,n){var i=e[t];if(i){var r=i.source,o=i.target;return n(i.key,i.attributes,r.key,o.key,r.attributes,o.attributes,i.undirected,i.generatedKey)}}function se(e,t,n){var i=e[t];if(i){for(var r,o,a=i.values();!0!==(r=a.next()).done;)if(n((o=r.value).key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected,o.generatedKey))return!0;return!1}}function ue(e,t){var n=e[t];if(n instanceof Set){var i=n.values();return new R(function(){var e=i.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return R.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ce(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return"function"==typeof Array.from?Array.from(e._edges.keys()):D(e._edges.keys(),e._edges.size);for(var n,i,r=new Array("undirected"===t?e.undirectedSize:e.directedSize),o="undirected"===t,a=e._edges.values(),s=0;!0!==(n=a.next()).done;)(i=n.value).undirected===o&&(r[s++]=i.key);return r}function le(e,t,n){if(0!==e.size)for(var i,r,o="mixed"!==t&&t!==e.type,a="undirected"===t,s=e._edges.values();!0!==(i=s.next()).done;)if(r=i.value,!o||r.undirected===a){var u=r.source,c=r.target;n(r.key,r.attributes,u.key,c.key,u.attributes,c.attributes,r.undirected,r.generatedKey)}}function he(e,t,n){if(0!==e.size)for(var i,r,o="mixed"!==t&&t!==e.type,a="undirected"===t,s=e._edges.values();!0!==(i=s.next()).done;)if(r=i.value,!o||r.undirected===a){var u=r.source,c=r.target;if(n(r.key,r.attributes,u.key,c.key,u.attributes,c.attributes,r.undirected,r.generatedKey))break}}function fe(e,t){if(0===e.size)return R.empty();var n="mixed"!==t&&t!==e.type,i="undirected"===t,r=e._edges.values();return new R(function(){for(var e,t;;){if((e=r.next()).done)return e;if(t=e.value,!n||t.undirected===i)break}return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})}function de(e,t,n,i){var r=[],o=e?Q:K;return"undirected"!==t&&("out"!==n&&o(r,i.in),"in"!==n&&o(r,i.out),!n&&i.directedSelfLoops>0&&r.splice(r.lastIndexOf(i.key),1)),"directed"!==t&&o(r,i.undirected),r}function pe(e,t,n,i,r){var o=e?Z:$;"undirected"!==t&&("out"!==n&&o(i.in,r),"in"!==n&&o(i.out,r,n?null:i.key)),"directed"!==t&&o(i.undirected,r)}function ve(e,t,n,i,r){var o=e?ee:J;"undirected"!==t&&("out"!==n&&o(i.in,r)||"in"!==n&&o(i.out,r,n?null:i.key))||"directed"===t||o(i.undirected,r)}function ge(e,t,n){var i=R.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(i=X(i,te(n.in))),"in"!==t&&void 0!==n.out&&(i=X(i,te(n.out,t?null:n.key)))),"directed"!==e&&void 0!==n.undirected&&(i=X(i,te(n.undirected))),i}function me(e,t,n,i,r){var o=t?ie:ne,a=[];return"undirected"!==e&&(void 0!==i.in&&"out"!==n&&o(a,i.in,r),void 0!==i.out&&"in"!==n&&o(a,i.out,r),!n&&i.directedSelfLoops>0&&a.splice(a.lastIndexOf(i.key),1)),"directed"!==e&&void 0!==i.undirected&&o(a,i.undirected,r),a}function ye(e,t,n,i,r,o){var a=t?oe:re;"undirected"!==e&&(void 0!==i.in&&"out"!==n&&a(i.in,r,o),i.key!==r&&void 0!==i.out&&"in"!==n&&a(i.out,r,o)),"directed"!==e&&void 0!==i.undirected&&a(i.undirected,r,o)}function be(e,t,n,i,r,o){var a=t?se:ae;"undirected"!==e&&(void 0!==i.in&&"out"!==n&&a(i.in,r,o)||i.key!==r&&void 0!==i.out&&"in"!==n&&a(i.out,r,o,n?null:i.key))||"directed"===e||void 0===i.undirected||a(i.undirected,r,o)}function _e(e,t,n,i){var r=R.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&i in n.in&&(r=X(r,ue(n.in,i))),void 0!==n.out&&"in"!==t&&i in n.out&&(r=X(r,ue(n.out,i)))),"directed"!==e&&void 0!==n.undirected&&i in n.undirected&&(r=X(r,ue(n.undirected,i))),r}var we=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function ke(e,t){if(void 0!==t)for(var n in t)e.add(n)}function xe(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var i=new Set;return"undirected"!==e&&("out"!==t&&ke(i,n.in),"in"!==t&&ke(i,n.out)),"directed"!==e&&ke(i,n.undirected),D(i.values(),i.size)}function Se(e,t,n){for(var i in t){var r=t[i];r instanceof Set&&(r=r.values().next().value);var o=r.source,a=o===e?r.target:o;n(a.key,a.attributes)}}function Ee(e,t,n,i){for(var r in n){var o=n[r];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;e.has(s.key)||(e.add(s.key),i(s.key,s.attributes))}}function Ce(e,t,n){for(var i in t){var r=t[i];r instanceof Set&&(r=r.values().next().value);var o=r.source,a=o===e?r.target:o;if(n(a.key,a.attributes))return!0}return!1}function Oe(e,t,n,i){for(var r in n){var o=n[r];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;if(!e.has(s.key)&&(e.add(s.key),i(s.key,s.attributes)))return!0}return!1}function Te(e,t){var n=Object.keys(t),i=n.length,r=0;return new R(function(){if(r>=i)return{done:!0};var o=t[n[r++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===e?o.target:a;return{done:!1,value:[s.key,s.attributes]}})}function Ae(e,t,n){var i=Object.keys(n),r=i.length,o=0;return new R(function a(){if(o>=r)return{done:!0};var s=n[i[o++]];s instanceof Set&&(s=s.values().next().value);var u=s.source,c=u===t?s.target:u;return e.has(c.key)?a():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function Pe(e,t,n,i,r){var o=e._nodes.get(i);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===r)return!0;if("in"!==n&&void 0!==o.out)for(var s in o.out)if(s===r)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===r)return!0;return!1}function Me(e,t,n){for(var i,r,o,a,s,u,c,l=t._nodes.values(),h=t.type;!0!==(i=l.next()).done;){if(r=i.value,"undirected"!==h)for(o in a=r.out)if(u=(s=a[o]).target,c=n(r.key,u.key,r.attributes,u.attributes,s.key,s.attributes,s.undirected,s.generatedKey),e&&c)return;if("directed"!==h)for(o in a=r.undirected)if((u=(s=a[o]).target).key!==o&&(u=s.source),c=n(r.key,u.key,r.attributes,u.attributes,s.key,s.attributes,s.undirected,s.generatedKey),e&&c)return}}function Ie(e,t,n){for(var i,r,o,a,s,u,c,l,h,f=t._nodes.values(),d=t.type;!0!==(i=f.next()).done;){if(r=i.value,"undirected"!==d)for(o in u=r.out)for(a=u[o].values();!0!==(s=a.next()).done;)if(l=(c=s.value).target,h=n(r.key,l.key,r.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&h)return;if("directed"!==d)for(o in u=r.undirected)for(a=u[o].values();!0!==(s=a.next()).done;)if((l=(c=s.value).target).key!==o&&(l=c.source),h=n(r.key,l.key,r.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&h)return}}function Re(e,t){var n={key:e};return f(t.attributes)||(n.attributes=u({},t.attributes)),n}function De(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),f(t.attributes)||(n.attributes=u({},t.attributes)),t.undirected&&(n.undirected=!0),n}function Ne(e){return h(e)?"key"in e?!("attributes"in e)||h(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function Le(e){return h(e)?"source"in e?"target"in e?!("attributes"in e)||h(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var je=new Set(["directed","undirected","mixed"]),Fe=new Set(["domain","_events","_eventsCount","_maxListeners"]),Be={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Ve(e,t,n){var i=new e.NodeDataClass(t,n);return e._nodes.set(t,i),e.emit("nodeAdded",{key:t,attributes:n}),i}function ze(e,t,n,i,r,o,a,s){if(!i&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!h(s))throw new L("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!e.allowSelfLoops&&o===a)throw new F("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=e._nodes.get(o),c=e._nodes.get(a);if(!u)throw new j("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!c)throw new j("Graph.".concat(t,': target node "').concat(a,'" not found.'));var l={key:null,undirected:i,source:o,target:a,attributes:s};if(n&&(r=e._edgeKeyGenerator(l)),e._edges.has(r=""+r))throw new F("Graph.".concat(t,': the "').concat(r,'" edge already exists in the graph.'));if(!e.multi&&(i?void 0!==u.undirected[a]:void 0!==u.out[a]))throw new F("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var f=new U(i,r,n,u,c,s);return e._edges.set(r,f),o===a?i?(u.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(u.directedSelfLoops++,e._directedSelfLoopCount++):i?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),H(e,i,f,o,a,u,c),i?e._undirectedSize++:e._directedSize++,l.key=r,e.emit("edgeAdded",l),r}function Ue(e,t,n,i,r,o,a,s,c){if(!i&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s)if(c){if("function"!=typeof s)throw new L("Graph.".concat(t,': invalid updater function. Expecting a function but got "').concat(s,'"'))}else if(!h(s))throw new L("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));var l;if(o=""+o,a=""+a,c&&(l=s,s=void 0),!e.allowSelfLoops&&o===a)throw new F("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var f,d,p=e._nodes.get(o),v=e._nodes.get(a);if(!n&&(f=e._edges.get(r))){if(f.source.key!==o||f.target.key!==a||i&&(f.source.key!==a||f.target.key!==o))throw new F("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(r,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(f.source.key,'", "').concat(f.target.key,'").'));d=f}if(d||e.multi||!p||(d=i?p.undirected[a]:p.out[a]),d)return(c?l:s)?(c?(d.attributes=l(d.attributes),e.emit("edgeAttributesUpdated",{type:"replace",key:d.key,attributes:d.attributes})):(u(d.attributes,s),e.emit("edgeAttributesUpdated",{type:"merge",key:d.key,attributes:d.attributes,data:s})),d.key):d.key;s=s||{},c&&l&&(s=l(s));var g={key:null,undirected:i,source:o,target:a,attributes:s};if(n&&(r=e._edgeKeyGenerator(g)),e._edges.has(r=""+r))throw new F("Graph.".concat(t,': the "').concat(r,'" edge already exists in the graph.'));return p||(p=Ve(e,o,{}),o===a&&(v=p)),v||(v=Ve(e,a,{})),f=new U(i,r,n,p,v,s),e._edges.set(r,f),o===a?i?(p.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(p.directedSelfLoops++,e._directedSelfLoopCount++):i?(p.undirectedDegree++,v.undirectedDegree++):(p.outDegree++,v.inDegree++),H(e,i,f,o,a,p,v),i?e._undirectedSize++:e._directedSize++,g.key=r,e.emit("edgeAdded",g),r}var He,Ge=function(e){function n(t){var n;if(n=e.call(this)||this,(t=u({},Be,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new L("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new L("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!je.has(t.type))throw new L('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new L("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var i,r="mixed"===t.type?B:"directed"===t.type?V:z;return d(s(n),"NodeDataClass",r),d(s(n),"_attributes",{}),d(s(n),"_nodes",new Map),d(s(n),"_edges",new Map),d(s(n),"_directedSize",0),d(s(n),"_undirectedSize",0),d(s(n),"_directedSelfLoopCount",0),d(s(n),"_undirectedSelfLoopCount",0),d(s(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(i=0,function(){return i++})),d(s(n),"_options",t),Fe.forEach(function(e){return d(s(n),e,n[e])}),p(s(n),"order",function(){return n._nodes.size}),p(s(n),"size",function(){return n._edges.size}),p(s(n),"directedSize",function(){return n._directedSize}),p(s(n),"undirectedSize",function(){return n._undirectedSize}),p(s(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),p(s(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),p(s(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),p(s(n),"multi",n._options.multi),p(s(n),"type",n._options.type),p(s(n),"allowSelfLoops",n._options.allowSelfLoops),p(s(n),"implementation",function(){return"graphology"}),n}t(n,e);var i=n.prototype;return i.hasNode=function(e){return this._nodes.has(""+e)},i.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&!n.undirected}if(2===arguments.length){t=""+t;var i=this._nodes.get(e=""+e);if(!i)return!1;var r=i.out[t];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n.undirected}if(2===arguments.length){t=""+t;var i=this._nodes.get(e=""+e);if(!i)return!1;var r=i.undirected[t];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var i=void 0!==n.out&&n.out[t];return i||(i=void 0!==n.undirected&&n.undirected[t]),!(!i||this.multi&&!i.size)}throw new L("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new j('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var i=n.out&&n.out[t]||void 0;return i?i.key:void 0}},i.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new j('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var i=n.undirected&&n.undirected[t]||void 0;return i?i.key:void 0}},i.edge=function(e,t){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var i=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(i)return i.key},i.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(t?n.directedSelfLoops:0)},i.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(t?n.directedSelfLoops:0)},i.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var i=t?n.directedSelfLoops:0;return n.inDegree+i+(n.outDegree+i)},i.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(t?n.undirectedSelfLoops:0)},i.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var i=0,r=0;return"directed"!==this.type&&(t&&(r=n.undirectedSelfLoops),i+=n.undirectedDegree+2*r),"undirected"!==this.type&&(t&&(r=n.directedSelfLoops),i+=n.inDegree+n.outDegree+2*r),i},i.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},i.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},i.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},i.opposite=function(e,t){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new j('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var i=n.source.key,r=n.target.key;if(e!==i&&e!==r)throw new j('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(i,", ").concat(r,")."));return e===i?r:i},i.hasExtremity=function(e,t){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new j('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return n.source.key===t||n.target.key===t},i.isUndirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},i.isDirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},i.isSelfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},i.hasGeneratedKey=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.hasGeneratedKey: could not find the "'.concat(e,'" edge in the graph.'));return t.generatedKey},i.addNode=function(e,t){return function(e,t,n){if(n&&!h(n))throw new L('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},e._nodes.has(t=""+t))throw new F('Graph.addNode: the "'.concat(t,'" node already exist in the graph.'));var i=new e.NodeDataClass(t,n);return e._nodes.set(t,i),e.emit("nodeAdded",{key:t,attributes:n}),i}(this,e,t).key},i.mergeNode=function(e,t){if(t&&!h(t))throw new L('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var n=this._nodes.get(e=""+e);return n?(t&&(u(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},i.updateNode=function(e,t){if(t&&"function"!=typeof t)throw new L('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));var n=this._nodes.get(e=""+e);if(n)return t&&(n.attributes=t(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})),e;var i=t?t({}):{};return n=new this.NodeDataClass(e,i),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:i}),e},i.dropNode=function(e){var t=this,n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));this.forEachEdge(e,function(e){t.dropEdge(e)}),this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},i.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],i=""+arguments[1];if(!(t=c(this,n,i,this.type)))throw new j('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(i,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new j('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var r=t.source,o=t.target,a=t.attributes,s=t.undirected;return r===o?s?(r.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(r.directedSelfLoops--,this._directedSelfLoopCount--):s?(r.undirectedDegree--,o.undirectedDegree--):(r.outDegree--,o.inDegree--),G(this,s,t),s?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:a,source:r.key,target:o.key,undirected:s}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(e){return this._attributes[e]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},i.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},i.updateAttribute=function(e,t){if("function"!=typeof t)throw new L("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},i.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},i.replaceAttributes=function(e){if(!h(e))throw new L("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(e){if(!h(e))throw new L("Graph.mergeAttributes: provided attributes are not a plain object.");return u(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},i.getNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},i.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new j('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},i.hasNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},i.setNodeAttribute=function(e,t,n){var i=this._nodes.get(e=""+e);if(!i)throw new j('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return i.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:i.attributes,name:t}),this},i.updateNodeAttribute=function(e,t,n){var i=this._nodes.get(e=""+e);if(!i)throw new j('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new L("Graph.updateAttribute: updater should be a function.");var r=i.attributes,o=n(r[t]);return r[t]=o,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:i.attributes,name:t}),this},i.removeNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",attributes:n.attributes,name:t}),this},i.replaceNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!h(t))throw new L("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",attributes:n.attributes}),this},i.mergeNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!h(t))throw new L("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return u(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",attributes:n.attributes,data:t}),this},i.updateEachNodeAttributes=function(e,t){if("function"!=typeof e)throw new L("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!v(t))throw new L("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._nodes.values();!0!==(n=r.next()).done;)(i=n.value).attributes=e(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},i.updateEachEdgeAttributes=function(e,t){if("function"!=typeof e)throw new L("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!v(t))throw new L("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._edges.values();!0!==(n=r.next()).done;)(i=n.value).attributes=e(i.key,i.attributes);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},i.forEach=function(e){if("function"!=typeof e)throw new L("Graph.forEach: expecting a callback.");this.multi?Ie(!1,this,e):Me(!1,this,e)},i.forEachUntil=function(e){if("function"!=typeof e)throw new L("Graph.forEach: expecting a callback.");this.multi?Ie(!0,this,e):Me(!0,this,e)},i.adjacency=function(){return this.multi?(d=(u=this)._nodes.values(),p=u.type,v="outer",g=null,new R(function e(){var t;if("outer"===v)return!0===(t=d.next()).done?t:(c=t.value,v="directed",e());if("directed"===v)return"undirected"===p?(v="undirected",e()):(h=c.out,l=Object.keys(c.out),f=0,v="inner-directed",e());if("undirected"===v){if("directed"===p)return v="outer",e();h=c.undirected,l=Object.keys(c.undirected),f=0,v="inner-undirected"}if(!g&&f>=l.length)return v="inner-undirected"===v?"outer":"undirected",e();if(!g){var n=l[f++];return g=h[n].values(),e()}if((t=g.next()).done)return g=null,e();var i=t.value,r=i.target;return"inner-undirected"===v&&r.key===c.key&&(r=i.source),{done:!1,value:[c.key,r.key,c.attributes,r.attributes,i.key,i.attributes]}})):(o=(e=this)._nodes.values(),a=e.type,s="outer",new R(function e(){var u;if("outer"===s)return!0===(u=o.next()).done?u:(t=u.value,s="directed",e());if("directed"===s)return"undirected"===a?(s="undirected",e()):(i=t.out,n=Object.keys(t.out),r=0,s="inner-directed",e());if("undirected"===s){if("directed"===a)return s="outer",e();i=t.undirected,n=Object.keys(t.undirected),r=0,s="inner-undirected"}if(r>=n.length)return s="inner-undirected"===s?"outer":"undirected",e();var c=n[r++],l=i[c],h=l.target;return"inner-undirected"===s&&h.key===t.key&&(h=l.source),{done:!1,value:[t.key,h.key,t.attributes,h.attributes,l.key,l.attributes]}}));var e,t,n,i,r,o,a,s,u,c,l,h,f,d,p,v,g},i.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):D(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(e){if("function"!=typeof e)throw new L("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,n){e(n,t.attributes)})},i.forEachNodeUntil=function(e){if("function"!=typeof e)throw new L("Graph.forEachNode: expecting a callback.");for(var t,n,i=this._nodes.values();!0!==(t=i.next())&&!e((n=t.value).key,n.attributes););},i.nodeEntries=function(){var e=this._nodes.values();return new R(function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}})},i.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new j('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return Re(e,t)},i.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return De(e,t)},i.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(n,i){e[t++]=Re(i,n)});var n=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,i){n[t++]=De(i,e)}),{attributes:this.getAttributes(),nodes:e,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},i.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ne(e);if(n){if("not-object"===n)throw new L('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new L("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new L("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var i=e.key,r=e.attributes,o=void 0===r?{}:r;return t?this.mergeNode(i,o):this.addNode(i,o),this},i.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Le(e);if(n){if("not-object"===n)throw new L('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new L("Graph.importEdge: missing souce.");if("no-target"===n)throw new L("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new L("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new L("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var i=e.source,r=e.target,o=e.attributes,a=void 0===o?{}:o,s=e.undirected,u=void 0!==s&&s;return"key"in e?(t?u?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:u?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,i,r,a):(t?u?this.mergeUndirectedEdge:this.mergeDirectedEdge:u?this.addUndirectedEdge:this.addDirectedEdge).call(this,i,r,a),this},i.import=function(e){var t,n,i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),r),this;if(!h(e))throw new L("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!h(e.attributes))throw new L("Graph.import: invalid attributes. Expecting a plain object.");r?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}if(e.nodes){if(i=e.nodes,!Array.isArray(i))throw new L("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=i.length;tn)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this;var e},i.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},i.toJSON=function(){return this.export()},i.toString=function(){return"[object Graph]"},i.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,n){t[n]=e.attributes});var n={},i={};this._edges.forEach(function(t,r){var o=t.undirected?"--":"->",a="",s="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===i[s]?i[s]=0:i[s]++,a+="".concat(i[s],". ")):a+="[".concat(r,"]: "),n[a+=s]=t.attributes});var r={};for(var o in this)this.hasOwnProperty(o)&&!Fe.has(o)&&"function"!=typeof this[o]&&(r[o]=this[o]);return r.attributes=this._attributes,r.nodes=t,r.edges=n,d(r,"constructor",this.constructor),r},n}(m.exports.EventEmitter);"undefined"!=typeof Symbol&&(Ge.prototype[Symbol.for("nodejs.util.inspect.custom")]=Ge.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge","update"].forEach(function(t){var n=e.name(t),i="add"===t?ze:Ue;Ge.prototype[n]=e.generateKey?function(r,o,a){return i(this,n,!0,"undirected"===(e.type||this.type),null,r,o,a,"update"===t)}:function(r,o,a,s){return i(this,n,!1,"undirected"===(e.type||this.type),r,o,a,s,"update"===t)}})}),"undefined"!=typeof Symbol&&(Ge.prototype[Symbol.iterator]=Ge.prototype.adjacency),He=Ge,W.forEach(function(e){var t=e.name,n=e.attacher;n(He,t("Edge"),"mixed"),n(He,t("DirectedEdge"),"directed"),n(He,t("UndirectedEdge"),"undirected")}),function(e){Y.forEach(function(t){var n,i,r,o;r=(n=t).type,o=n.direction,e.prototype[i=n.name]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return ce(this,r);if(1===arguments.length){var n=this._nodes.get(e=""+e);if(void 0===n)throw new j("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return de(this.multi,"mixed"===r?this.type:r,o,n)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new j("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return me(r,this.multi,o,a,t)}throw new L("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return le(this,i,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return pe(this.multi,"mixed"===i?this.type:i,r,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return ye(i,this.multi,r,s,t,n)}throw new L("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[o]=function(e,t,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return he(this,i,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return ve(this.multi,"mixed"===i?this.type:i,r,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return be(i,this.multi,r,s,t,n)}throw new L("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.type,i=t.direction,r=t.name.slice(0,-1)+"Entries";e.prototype[r]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return R.empty();if(!arguments.length)return fe(this,n);if(1===arguments.length){var o=this._nodes.get(e=""+e);if(!o)throw new j("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return ge(n,i,o)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new j("Graph.".concat(r,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j("Graph.".concat(r,': could not find the "').concat(t,'" target node in the graph.'));return _e(n,i,a,t)}throw new L("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(Ge),function(e){we.forEach(function(t){var n,i,r,o;r=(n=t).type,o=n.direction,e.prototype[i=n.name]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(t))throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(n))throw new j("Graph.".concat(i,': could not find the "').concat(n,'" node in the graph.'));return Pe(this,r,o,t,n)}if(1===arguments.length){var a=this._nodes.get(e=""+e);if(void 0===a)throw new j("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return xe("mixed"===r?this.type:r,o,a)}throw new L("Graph.".concat(i,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,i){if("mixed"!==e){if("undirected"===e)return Se(n,n.undirected,i);if("string"==typeof t)return Se(n,n[t],i)}var r=new Set;"undirected"!==e&&("out"!==t&&Ee(r,n,n.in,i),"in"!==t&&Ee(r,n,n.out,i)),"directed"!==e&&Ee(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,t)}}}(e,t),function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[o]=function(e,t){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,i){if("mixed"!==e){if("undirected"===e)return Ce(n,n.undirected,i);if("string"==typeof t)return Ce(n,n[t],i)}var r=new Set;"undirected"!==e&&("out"!==t&&Oe(r,n,n.in,i)||"in"!==t&&Oe(r,n,n.out,i))||"directed"===e||Oe(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,t)}}}(e,t),function(e,t){var n=t.type,i=t.direction,r=t.name.slice(0,-1)+"Entries";e.prototype[r]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return R.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new j("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return Te(n,n.undirected);if("string"==typeof t)return Te(n,n[t])}var i=R.empty(),r=new Set;return"undirected"!==e&&("out"!==t&&(i=X(i,Ae(r,n,n.in))),"in"!==t&&(i=X(i,Ae(r,n,n.out)))),"directed"!==e&&(i=X(i,Ae(r,n,n.undirected))),i}("mixed"===n?this.type:n,i,t)}}(e,t)})}(Ge);var We=function(e){function n(t){var n=u({type:"directed"},t);if("multi"in n&&!1!==n.multi)throw new L("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new L('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Ge),qe=function(e){function n(t){var n=u({type:"undirected"},t);if("multi"in n&&!1!==n.multi)throw new L("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new L('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Ge),Xe=function(e){function n(t){var n=u({multi:!0},t);if("multi"in n&&!0!==n.multi)throw new L("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return e.call(this,n)||this}return t(n,e),n}(Ge),Ye=function(e){function n(t){var n=u({type:"directed",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new L("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new L('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Ge),Ke=function(e){function n(t){var n=u({type:"undirected",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new L("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new L('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Ge);function Qe(e){e.from=function(t,n){var i=u({},t.options,n),r=new e(i);return r.import(t),r}}return Qe(Ge),Qe(We),Qe(qe),Qe(Xe),Qe(Ye),Qe(Ke),Ge.Graph=Ge,Ge.DirectedGraph=We,Ge.UndirectedGraph=qe,Ge.MultiGraph=Xe,Ge.MultiDirectedGraph=Ye,Ge.MultiUndirectedGraph=Ke,Ge.InvalidArgumentsGraphError=L,Ge.NotFoundGraphError=j,Ge.UsageGraphError=F,Ge}()},11524:function(e,t,n){var i;!function(r,o,a,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),h=Math.round,f=Math.abs,d=Date.now;function p(e,t,n){return setTimeout(w(e,n),t)}function v(e,t,n){return!!Array.isArray(e)&&(g(e,n[t],n),!0)}function g(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function T(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function I(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=G(t):1===r&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,u=a?a.center:o.center,c=t.center=W(i);t.timeStamp=d(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=K(u,c),t.distance=Y(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};(1===t.eventType||4===o.eventType)&&(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=X(t.deltaX,t.deltaY);var l=q(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=f(l.x)>f(l.y)?l.x:l.y,t.scale=a?function(e,t){return Y(t[0],t[1],z)/Y(e[0],e[1],z)}(a.pointers,i):1,t.rotation=a?function(e,t){return K(t[1],t[0],z)+K(e[1],e[0],z)}(a.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,o,a=e.lastInterval||t,u=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(u>25||a.velocity===s)){var c=t.deltaX-a.deltaX,l=t.deltaY-a.deltaY,h=q(u,c,l);i=h.x,r=h.y,n=f(h.x)>f(h.y)?h.x:h.y,o=X(c,l),e.lastInterval=t}else n=a.velocity,i=a.velocityX,r=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=o}(n,t);var h=e.element;C(t.srcEvent.target,h)&&(h=t.srcEvent.target),t.target=h}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function G(e){for(var t=[],n=0;n=f(t)?e<0?2:4:t<0?8:16}function Y(e,t,n){n||(n=V);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function K(e,t,n){return n||(n=V),180*Math.atan2(t[n[1]]-e[n[1]],t[n[0]]-e[n[0]])/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};var Q={mousedown:1,mousemove:2,mouseup:4},$="mousedown",Z="mousemove mouseup";function J(){this.evEl=$,this.evWin=Z,this.pressed=!1,U.apply(this,arguments)}_(J,U,{handler:function(e){var t=Q[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:B,srcEvent:e}))}});var ee={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},te={2:F,3:"pen",4:B,5:"kinect"},ne="pointerdown",ie="pointermove pointerup pointercancel";function re(){this.evEl=ne,this.evWin=ie,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ne="MSPointerDown",ie="MSPointerMove MSPointerUp MSPointerCancel"),_(re,U,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=ee[i],o=te[e.pointerType]||e.pointerType,a=o==F,s=A(t,e.pointerId,"pointerId");1&r&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&r&&(n=!0),!(s<0)&&(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var oe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart",se="touchstart touchmove touchend touchcancel";function ue(){this.evTarget=ae,this.evWin=se,this.started=!1,U.apply(this,arguments)}function ce(e,t){var n=P(e.touches),i=P(e.changedTouches);return 12&t&&(n=M(n.concat(i),"identifier",!0)),[n,i]}_(ue,U,{handler:function(e){var t=oe[e.type];if(1===t&&(this.started=!0),this.started){var n=ce.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:F,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},he="touchstart touchmove touchend touchcancel";function fe(){this.evTarget=he,this.targetIds={},U.apply(this,arguments)}function de(e,t){var n=P(e.touches),i=this.targetIds;if(3&t&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=P(e.changedTouches),s=[],u=this.target;if(o=n.filter(function(e){return C(e.target,u)}),1===t)for(r=0;r-1&&i.splice(e,1)},2500)}}function me(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+Te(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+Te(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return Me.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ae(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),_(Re,Me,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ke]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){1!==e.scale&&(e.additionalEvent=this.options.event+(e.scale<1?"in":"out")),this._super.emit.call(this,e)}}),_(De,Oe,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=p(function(){this.state=8,this.tryEmit()},t.time,this);else if(4&e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),_(Ne,Me,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ke]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),_(Le,Me,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ie.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&f(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ae(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),_(je,Oe,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[we]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance"']/g,q=RegExp(G.source),X=RegExp(W.source),Y=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,ie=/\s/,re=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,de=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,be=/['\n\r\u2028\u2029\\]/g,_e="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Oe="["+_e+"]",Te="["+Ce+"]",Ae="["+we+"]",Pe="\\d+",Me="["+ke+"]",Ie="["+xe+"]",Re="[^"+_e+Ce+Pe+ke+xe+Se+"]",De="\\ud83c[\\udffb-\\udfff]",Ne="[^"+_e+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Se+"]",Be="(?:"+Ie+"|"+Re+")",Ve="(?:"+Fe+"|"+Re+")",ze="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ue="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Ae+"|"+De+")?",Ge="["+Ee+"]?",We=Ge+He+"(?:\\u200d(?:"+[Ne,Le,je].join("|")+")"+Ge+He+")*",qe="(?:"+[Me,Le,je].join("|")+")"+We,Xe="(?:"+[Ne+Ae+"?",Ae,Le,je,Oe].join("|")+")",Ye=RegExp("['\u2019]","g"),Ke=RegExp(Ae,"g"),Qe=RegExp(De+"(?="+De+")|"+Xe+We,"g"),$e=RegExp([Fe+"?"+Ie+"+"+ze+"(?="+[Te,Fe,"$"].join("|")+")",Ve+"+"+Ue+"(?="+[Te,Fe+Be,"$"].join("|")+")",Fe+"?"+Be+"+"+ze,Fe+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,qe].join("|"),"g"),Ze=RegExp("[\\u200d"+_e+we+Ee+"]"),Je=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tt=-1,nt={};nt[I]=nt[R]=nt[D]=nt[N]=nt[L]=nt[j]=nt[F]=nt[B]=nt[V]=!0,nt[p]=nt[v]=nt[P]=nt[g]=nt[M]=nt[m]=nt[y]=nt[b]=nt[w]=nt[k]=nt[x]=nt[E]=nt[C]=nt[O]=nt[A]=!1;var it={};it[p]=it[v]=it[P]=it[M]=it[g]=it[m]=it[I]=it[R]=it[D]=it[N]=it[L]=it[w]=it[k]=it[x]=it[E]=it[C]=it[O]=it[T]=it[j]=it[F]=it[B]=it[V]=!0,it[y]=it[b]=it[A]=!1;var rt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,at=parseInt,st="object"==typeof global&&global&&global.Object===Object&&global,ut="object"==typeof self&&self&&self.Object===Object&&self,ct=st||ut||Function("return this")(),lt=t&&!t.nodeType&&t,ht=lt&&e&&!e.nodeType&&e,ft=ht&&ht.exports===lt,dt=ft&&st.process,pt=function(){try{return ht&&ht.require&&ht.require("util").types||dt&&dt.binding&&dt.binding("util")}catch(e){}}(),vt=pt&&pt.isArrayBuffer,gt=pt&&pt.isDate,mt=pt&&pt.isMap,yt=pt&&pt.isRegExp,bt=pt&&pt.isSet,_t=pt&&pt.isTypedArray;function wt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function kt(e,t,n,i){for(var r=-1,o=null==e?0:e.length;++r-1}function Tt(e,t,n){for(var i=-1,r=null==e?0:e.length;++i-1;);return n}function $t(e,t){for(var n=e.length;n--&&jt(t,e[n],0)>-1;);return n}function Zt(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i}var Jt=Ut({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),en=Ut({"&":"&","<":"<",">":">",'"':""","'":"'"});function tn(e){return"\\"+rt[e]}function nn(e){return Ze.test(e)}function rn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function on(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,i=e.length,r=0,o=[];++n",""":'"',"'":"'"}),fn=function e(t){var n,i=(t=null==t?ct:fn.defaults(ct.Object(),t,fn.pick(ct,et))).Array,ie=t.Date,_e=t.Error,we=t.Function,ke=t.Math,xe=t.Object,Se=t.RegExp,Ee=t.String,Ce=t.TypeError,Oe=i.prototype,Te=xe.prototype,Ae=t["__core-js_shared__"],Pe=we.prototype.toString,Me=Te.hasOwnProperty,Ie=0,Re=(n=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=Te.toString,Ne=Pe.call(xe),Le=ct._,je=Se("^"+Pe.call(Me).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=ft?t.Buffer:r,Be=t.Symbol,Ve=t.Uint8Array,ze=Fe?Fe.allocUnsafe:r,Ue=on(xe.getPrototypeOf,xe),He=xe.create,Ge=Te.propertyIsEnumerable,We=Oe.splice,qe=Be?Be.isConcatSpreadable:r,Xe=Be?Be.iterator:r,Qe=Be?Be.toStringTag:r,Ze=function(){try{var e=ao(xe,"defineProperty");return e({},"",{}),e}catch(Io){}}(),rt=t.clearTimeout!==ct.clearTimeout&&t.clearTimeout,st=ie&&ie.now!==ct.Date.now&&ie.now,ut=t.setTimeout!==ct.setTimeout&&t.setTimeout,lt=ke.ceil,ht=ke.floor,dt=xe.getOwnPropertySymbols,pt=Fe?Fe.isBuffer:r,Dt=t.isFinite,Ut=Oe.join,dn=on(xe.keys,xe),pn=ke.max,vn=ke.min,gn=ie.now,mn=t.parseInt,yn=ke.random,bn=Oe.reverse,_n=ao(t,"DataView"),wn=ao(t,"Map"),kn=ao(t,"Promise"),xn=ao(t,"Set"),Sn=ao(t,"WeakMap"),En=ao(xe,"create"),Cn=Sn&&new Sn,On={},Tn=Lo(_n),An=Lo(wn),Pn=Lo(kn),Mn=Lo(xn),In=Lo(Sn),Rn=Be?Be.prototype:r,Dn=Rn?Rn.valueOf:r,Nn=Rn?Rn.toString:r;function Ln(e){if(Ja(e)&&!Ua(e)&&!(e instanceof Vn)){if(e instanceof Bn)return e;if(Me.call(e,"__wrapped__"))return jo(e)}return new Bn(e)}var jn=function(){function e(){}return function(t){if(!Za(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Fn(){}function Bn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ri(e,t,n,i,o,a){var s,u=1&t,c=2&t,l=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!Za(e))return e;var h=Ua(e);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return Sr(e,s)}else{var f=co(e),d=f==b||f==_;if(qa(e))return yr(e,u);if(f==x||f==p||d&&!o){if(s=c||d?{}:ho(e),!u)return c?function(e,t){return Er(e,uo(e),t)}(e,function(e,t){return e&&Er(t,Ps(t),e)}(s,e)):function(e,t){return Er(e,so(e),t)}(e,ei(s,e))}else{if(!it[f])return o?e:{};s=function(e,t,n){var i=e.constructor;switch(t){case P:return br(e);case g:case m:return new i(+e);case M:return function(e,t){var n=t?br(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case I:case R:case D:case N:case L:case j:case F:case B:case V:return _r(e,n);case w:return new i;case k:case O:return new i(e);case E:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new i;case T:return function(e){return Dn?xe(Dn.call(e)):{}}(e)}}(e,f,u)}}a||(a=new Wn);var v=a.get(e);if(v)return v;a.set(e,s),rs(e)?e.forEach(function(i){s.add(ri(i,t,n,i,e,a))}):es(e)&&e.forEach(function(i,r){s.set(r,ri(i,t,n,r,e,a))});var y=h?r:(l?c?Jr:Zr:c?Ps:As)(e);return xt(y||e,function(i,r){y&&(i=e[r=i]),$n(s,r,ri(i,t,n,r,e,a))}),s}function oi(e,t,n){var i=n.length;if(null==e)return!i;for(e=xe(e);i--;){var o=n[i],a=e[o];if(a===r&&!(o in e)||!(0,t[o])(a))return!1}return!0}function ai(e,t,n){if("function"!=typeof e)throw new Ce(o);return Oo(function(){e.apply(r,n)},t)}function si(e,t,n,i){var r=-1,o=Ot,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=At(t,Xt(n))),i?(o=Tt,a=!1):t.length>=200&&(o=Kt,a=!1,t=new Gn(t));e:for(;++r-1},Un.prototype.set=function(e,t){var n=this.__data__,i=Zn(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new zn,map:new(wn||Un),string:new zn}},Hn.prototype.delete=function(e){var t=ro(this,e).delete(e);return this.size-=t?1:0,t},Hn.prototype.get=function(e){return ro(this,e).get(e)},Hn.prototype.has=function(e){return ro(this,e).has(e)},Hn.prototype.set=function(e,t){var n=ro(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},Gn.prototype.add=Gn.prototype.push=function(e){return this.__data__.set(e,a),this},Gn.prototype.has=function(e){return this.__data__.has(e)},Wn.prototype.clear=function(){this.__data__=new Un,this.size=0},Wn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Wn.prototype.get=function(e){return this.__data__.get(e)},Wn.prototype.has=function(e){return this.__data__.has(e)},Wn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Un){var i=n.__data__;if(!wn||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Hn(i)}return n.set(e,t),this.size=n.size,this};var ui=Tr(gi),ci=Tr(mi,!0);function li(e,t){var n=!0;return ui(e,function(e,i,r){return n=!!t(e,i,r)}),n}function hi(e,t,n){for(var i=-1,o=e.length;++i0&&n(s)?t>1?di(s,t-1,n,i,r):Pt(r,s):i||(r[r.length]=s)}return r}var pi=Ar(),vi=Ar(!0);function gi(e,t){return e&&pi(e,t,As)}function mi(e,t){return e&&vi(e,t,As)}function yi(e,t){return Ct(t,function(t){return Ka(e[t])})}function bi(e,t){for(var n=0,i=(t=pr(t,e)).length;null!=e&&nt}function xi(e,t){return null!=e&&Me.call(e,t)}function Si(e,t){return null!=e&&t in xe(e)}function Ei(e,t,n){for(var o=n?Tt:Ot,a=e[0].length,s=e.length,u=s,c=i(s),l=1/0,h=[];u--;){var f=e[u];u&&t&&(f=At(f,Xt(t))),l=vn(f.length,l),c[u]=!n&&(t||a>=120&&f.length>=120)?new Gn(u&&f):r}f=e[0];var d=-1,p=c[0];e:for(;++d=s?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}(e,t,n)});i--;)e[i]=e[i].value;return e}(Di(e,function(e,n,r){return{criteria:At(t,function(t){return t(e)}),index:++i,value:e}}))}function Vi(e,t,n){for(var i=-1,r=t.length,o={};++i-1;)s!==e&&We.call(s,u,1),We.call(e,u,1);return e}function Ui(e,t){for(var n=e?t.length:0,i=n-1;n--;){var r=t[n];if(n==i||r!==o){var o=r;po(r)?We.call(e,r,1):ar(e,r)}}return e}function Hi(e,t){return e+ht(yn()*(t-e+1))}function Gi(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=ht(t/2))&&(e+=e)}while(t);return n}function Wi(e,t){return To(ko(e,t,tu),e+"")}function qi(e){return Xn(Fs(e))}function Xi(e,t){var n=Fs(e);return Mo(n,ii(t,0,n.length))}function Yi(e,t,n,i){if(!Za(e))return e;for(var o=-1,a=(t=pr(t,e)).length,s=a-1,u=e;null!=u&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=i(o);++r>>1,a=e[o];null!==a&&!as(a)&&(n?a<=t:a=200){var c=t?null:Gr(e);if(c)return sn(c);a=!1,r=Kt,u=new Gn}else u=t?[]:s;e:for(;++i=i?e:Zi(e,t,n)}var mr=rt||function(e){return ct.clearTimeout(e)};function yr(e,t){if(t)return e.slice();var n=e.length,i=ze?ze(n):new e.constructor(n);return e.copy(i),i}function br(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function _r(e,t){var n=t?br(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function wr(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=as(e),s=t!==r,u=null===t,c=t==t,l=as(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!l&&e1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&vo(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=xe(t);++i-1?o[a?t[s]:s]:r}}function Dr(e){return $r(function(t){var n=t.length,i=n,a=Bn.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Ce(o);if(a&&!u&&"wrapper"==to(s))var u=new Bn([],!0)}for(i=u?i:n;++i1&&b.reverse(),d&&hu))return!1;var l=a.get(e),h=a.get(t);if(l&&h)return l==t&&h==e;var f=-1,d=!0,p=2&n?new Gn:r;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(re,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return xt(d,function(n){var i="_."+n[0];t&n[1]&&!Ot(e,i)&&e.push(i)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(i),n)))}function Po(e){var t=0,n=0;return function(){var i=gn(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Mo(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ia(e,n)});function la(e){var t=Ln(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var fa=$r(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return ni(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Vn&&po(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ha,args:[o],thisArg:r}),new Bn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),da=Cr(function(e,t,n){Me.call(e,n)?++e[n]:ti(e,n,1)}),pa=Rr(zo),va=Rr(Uo);function ga(e,t){return(Ua(e)?xt:ui)(e,io(t,3))}function ma(e,t){return(Ua(e)?St:ci)(e,io(t,3))}var ya=Cr(function(e,t,n){Me.call(e,n)?e[n].push(t):ti(e,n,[t])}),ba=Wi(function(e,t,n){var r=-1,o="function"==typeof t,a=Ga(e)?i(e.length):[];return ui(e,function(e){a[++r]=o?wt(t,e,n):Ci(e,t,n)}),a}),_a=Cr(function(e,t,n){ti(e,n,t)});function wa(e,t){return(Ua(e)?At:Di)(e,io(t,3))}var ka=Cr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),xa=Wi(function(e,t){if(null==e)return[];var n=t.length;return n>1&&vo(e,t[0],t[1])?t=[]:n>2&&vo(t[0],t[1],t[2])&&(t=[t[0]]),Bi(e,di(t,1),[])}),Sa=st||function(){return ct.Date.now()};function Ea(e,t,n){return t=n?r:t,qr(e,c,r,r,r,r,t=e&&null==t?e.length:t)}function Ca(e,t){var n;if("function"!=typeof t)throw new Ce(o);return e=fs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var Oa=Wi(function(e,t,n){var i=1;if(n.length){var r=an(n,no(Oa));i|=u}return qr(e,i,t,n,r)}),Ta=Wi(function(e,t,n){var i=3;if(n.length){var r=an(n,no(Ta));i|=u}return qr(t,i,e,n,r)});function Aa(e,t,n){var i,a,s,u,c,l,h=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new Ce(o);function v(t){var n=i,o=a;return i=a=r,h=t,u=e.apply(o,n)}function g(e){return h=e,c=Oo(y,t),f?v(e):u}function m(e){var n=e-l;return l===r||n>=t||n<0||d&&e-h>=s}function y(){var e=Sa();if(m(e))return b(e);c=Oo(y,function(e){var n=t-(e-l);return d?vn(n,s-(e-h)):n}(e))}function b(e){return c=r,p&&i?v(e):(i=a=r,u)}function _(){var e=Sa(),n=m(e);if(i=arguments,a=this,l=e,n){if(c===r)return g(l);if(d)return mr(c),c=Oo(y,t),v(l)}return c===r&&(c=Oo(y,t)),u}return t=ps(t)||0,Za(n)&&(f=!!n.leading,s=(d="maxWait"in n)?pn(ps(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==r&&mr(c),h=0,i=l=a=c=r},_.flush=function(){return c===r?u:b(Sa())},_}var Pa=Wi(function(e,t){return ai(e,1,t)}),Ma=Wi(function(e,t,n){return ai(e,ps(t)||0,n)});function Ia(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ce(o);var n=function n(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(Ia.Cache||Hn),n}function Ra(e){if("function"!=typeof e)throw new Ce(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ia.Cache=Hn;var Da=vr(function(e,t){var n=(t=1==t.length&&Ua(t[0])?At(t[0],Xt(io())):At(di(t,1),Xt(io()))).length;return Wi(function(i){for(var r=-1,o=vn(i.length,n);++r=t}),za=Oi(function(){return arguments}())?Oi:function(e){return Ja(e)&&Me.call(e,"callee")&&!Ge.call(e,"callee")},Ua=i.isArray,Ha=vt?Xt(vt):function(e){return Ja(e)&&wi(e)==P};function Ga(e){return null!=e&&$a(e.length)&&!Ka(e)}function Wa(e){return Ja(e)&&Ga(e)}var qa=pt||pu,Xa=gt?Xt(gt):function(e){return Ja(e)&&wi(e)==m};function Ya(e){if(!Ja(e))return!1;var t=wi(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Ka(e){if(!Za(e))return!1;var t=wi(e);return t==b||t==_||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qa(e){return"number"==typeof e&&e==fs(e)}function $a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function Za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ja(e){return null!=e&&"object"==typeof e}var es=mt?Xt(mt):function(e){return Ja(e)&&co(e)==w};function ts(e){return"number"==typeof e||Ja(e)&&wi(e)==k}function ns(e){if(!Ja(e)||wi(e)!=x)return!1;var t=Ue(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Pe.call(n)==Ne}var is=yt?Xt(yt):function(e){return Ja(e)&&wi(e)==E},rs=bt?Xt(bt):function(e){return Ja(e)&&co(e)==C};function os(e){return"string"==typeof e||!Ua(e)&&Ja(e)&&wi(e)==O}function as(e){return"symbol"==typeof e||Ja(e)&&wi(e)==T}var ss=_t?Xt(_t):function(e){return Ja(e)&&$a(e.length)&&!!nt[wi(e)]},us=zr(Ri),cs=zr(function(e,t){return e<=t});function ls(e){if(!e)return[];if(Ga(e))return os(e)?cn(e):Sr(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=co(e);return(t==w?rn:t==C?sn:Fs)(e)}function hs(e){return e?(e=ps(e))===l||e===-l?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=hs(e),n=t%1;return t==t?n?t-n:t:0}function ds(e){return e?ii(fs(e),0,f):0}function ps(e){if("number"==typeof e)return e;if(as(e))return NaN;if(Za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qt(e);var n=de.test(e);return n||ve.test(e)?at(e.slice(2),n?2:8):fe.test(e)?NaN:+e}function vs(e){return Er(e,Ps(e))}function gs(e){return null==e?"":rr(e)}var ms=Or(function(e,t){if(bo(t)||Ga(t))Er(t,As(t),e);else for(var n in t)Me.call(t,n)&&$n(e,n,t[n])}),ys=Or(function(e,t){Er(t,Ps(t),e)}),bs=Or(function(e,t,n,i){Er(t,Ps(t),e,i)}),_s=Or(function(e,t,n,i){Er(t,As(t),e,i)}),ws=$r(ni),ks=Wi(function(e,t){e=xe(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&vo(t[0],t[1],o)&&(i=1);++n1),t}),Er(e,Jr(e),n),i&&(n=ri(n,7,Kr));for(var r=t.length;r--;)ar(n,t[r]);return n}),Ds=$r(function(e,t){return null==e?{}:function(e,t){return Vi(e,t,function(t,n){return Es(e,n)})}(e,t)});function Ns(e,t){if(null==e)return{};var n=At(Jr(e),function(e){return[e]});return t=io(t),Vi(e,n,function(e,n){return t(e,n[0])})}var Ls=Wr(As),js=Wr(Ps);function Fs(e){return null==e?[]:Yt(e,As(e))}var Bs=Mr(function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)});function Vs(e){return Ys(gs(e).toLowerCase())}function zs(e){return(e=gs(e))&&e.replace(me,Jt).replace(Ke,"")}var Us=Mr(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Hs=Mr(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Gs=Pr("toLowerCase"),Ws=Mr(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),qs=Mr(function(e,t,n){return e+(n?" ":"")+Ys(t)}),Xs=Mr(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ys=Pr("toUpperCase");function Ks(e,t,n){return e=gs(e),(t=n?r:t)===r?function(e){return Je.test(e)}(e)?function(e){return e.match($e)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Qs=Wi(function(e,t){try{return wt(e,r,t)}catch(Ro){return Ya(Ro)?Ro:new _e(Ro)}}),$s=$r(function(e,t){return xt(t,function(t){t=No(t),ti(e,t,Oa(e[t],e))}),e});function Zs(e){return function(){return e}}var Js=Dr(),eu=Dr(!0);function tu(e){return e}function nu(e){return Mi("function"==typeof e?e:ri(e,1))}var iu=Wi(function(e,t){return function(n){return Ci(n,e,t)}}),ru=Wi(function(e,t){return function(n){return Ci(e,n,t)}});function ou(e,t,n){var i=As(t),r=yi(t,i);null==n&&(!Za(t)||!r.length&&i.length)&&(n=t,t=e,e=this,r=yi(t,As(t)));var o=!(Za(n)&&"chain"in n&&!n.chain),a=Ka(e);return xt(r,function(n){var i=t[n];e[n]=i,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),r=n.__actions__=Sr(this.__actions__);return r.push({func:i,args:arguments,thisArg:e}),n.__chain__=t,n}return i.apply(e,Pt([this.value()],arguments))})}),e}function au(){}var su=Fr(At),uu=Fr(Et),cu=Fr(Rt);function lu(e){return go(e)?zt(No(e)):function(e){return function(t){return bi(t,e)}}(e)}var hu=Vr(),fu=Vr(!0);function du(){return[]}function pu(){return!1}var vu=jr(function(e,t){return e+t},0),gu=Hr("ceil"),mu=jr(function(e,t){return e/t},1),yu=Hr("floor"),bu=jr(function(e,t){return e*t},1),_u=Hr("round"),wu=jr(function(e,t){return e-t},0);return Ln.after=function(e,t){if("function"!=typeof t)throw new Ce(o);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Ea,Ln.assign=ms,Ln.assignIn=ys,Ln.assignInWith=bs,Ln.assignWith=_s,Ln.at=ws,Ln.before=Ca,Ln.bind=Oa,Ln.bindAll=$s,Ln.bindKey=Ta,Ln.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ua(e)?e:[e]},Ln.chain=la,Ln.chunk=function(e,t,n){t=(n?vo(e,t,n):t===r)?1:pn(fs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,u=i(lt(o/t));ao?0:o+n),(i=i===r||i>o?o:fs(i))<0&&(i+=o),i=n>i?0:ds(i);n>>0)?(e=gs(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=rr(t))&&nn(e)?gr(cn(e),0,n):e.split(t,n):[]},Ln.spread=function(e,t){if("function"!=typeof e)throw new Ce(o);return t=null==t?0:pn(fs(t),0),Wi(function(n){var i=n[t],r=gr(n,0,t);return i&&Pt(r,i),wt(e,this,r)})},Ln.tail=function(e){var t=null==e?0:e.length;return t?Zi(e,1,t):[]},Ln.take=function(e,t,n){return e&&e.length?Zi(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Ln.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?Zi(e,(t=i-(t=n||t===r?1:fs(t)))<0?0:t,i):[]},Ln.takeRightWhile=function(e,t){return e&&e.length?ur(e,io(t,3),!1,!0):[]},Ln.takeWhile=function(e,t){return e&&e.length?ur(e,io(t,3)):[]},Ln.tap=function(e,t){return t(e),e},Ln.throttle=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new Ce(o);return Za(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Aa(e,t,{leading:i,maxWait:t,trailing:r})},Ln.thru=ha,Ln.toArray=ls,Ln.toPairs=Ls,Ln.toPairsIn=js,Ln.toPath=function(e){return Ua(e)?At(e,No):as(e)?[e]:Sr(Do(gs(e)))},Ln.toPlainObject=vs,Ln.transform=function(e,t,n){var i=Ua(e),r=i||qa(e)||ss(e);if(t=io(t,4),null==n){var o=e&&e.constructor;n=r?i?new o:[]:Za(e)&&Ka(o)?jn(Ue(e)):{}}return(r?xt:gi)(e,function(e,i,r){return t(n,e,i,r)}),n},Ln.unary=function(e){return Ea(e,1)},Ln.union=Jo,Ln.unionBy=ea,Ln.unionWith=ta,Ln.uniq=function(e){return e&&e.length?or(e):[]},Ln.uniqBy=function(e,t){return e&&e.length?or(e,io(t,2)):[]},Ln.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?or(e,r,t):[]},Ln.unset=function(e,t){return null==e||ar(e,t)},Ln.unzip=na,Ln.unzipWith=ia,Ln.update=function(e,t,n){return null==e?e:sr(e,t,dr(n))},Ln.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:sr(e,t,dr(n),i)},Ln.values=Fs,Ln.valuesIn=function(e){return null==e?[]:Yt(e,Ps(e))},Ln.without=ra,Ln.words=Ks,Ln.wrap=function(e,t){return Na(dr(t),e)},Ln.xor=oa,Ln.xorBy=aa,Ln.xorWith=sa,Ln.zip=ua,Ln.zipObject=function(e,t){return hr(e||[],t||[],$n)},Ln.zipObjectDeep=function(e,t){return hr(e||[],t||[],Yi)},Ln.zipWith=ca,Ln.entries=Ls,Ln.entriesIn=js,Ln.extend=ys,Ln.extendWith=bs,ou(Ln,Ln),Ln.add=vu,Ln.attempt=Qs,Ln.camelCase=Bs,Ln.capitalize=Vs,Ln.ceil=gu,Ln.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ps(n))==n?n:0),t!==r&&(t=(t=ps(t))==t?t:0),ii(ps(e),t,n)},Ln.clone=function(e){return ri(e,4)},Ln.cloneDeep=function(e){return ri(e,5)},Ln.cloneDeepWith=function(e,t){return ri(e,5,t="function"==typeof t?t:r)},Ln.cloneWith=function(e,t){return ri(e,4,t="function"==typeof t?t:r)},Ln.conformsTo=function(e,t){return null==t||oi(e,t,As(t))},Ln.deburr=zs,Ln.defaultTo=function(e,t){return null==e||e!=e?t:e},Ln.divide=mu,Ln.endsWith=function(e,t,n){e=gs(e),t=rr(t);var i=e.length,o=n=n===r?i:ii(fs(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Ln.eq=Fa,Ln.escape=function(e){return(e=gs(e))&&X.test(e)?e.replace(W,en):e},Ln.escapeRegExp=function(e){return(e=gs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Ln.every=function(e,t,n){var i=Ua(e)?Et:li;return n&&vo(e,t,n)&&(t=r),i(e,io(t,3))},Ln.find=pa,Ln.findIndex=zo,Ln.findKey=function(e,t){return Nt(e,io(t,3),gi)},Ln.findLast=va,Ln.findLastIndex=Uo,Ln.findLastKey=function(e,t){return Nt(e,io(t,3),mi)},Ln.floor=yu,Ln.forEach=ga,Ln.forEachRight=ma,Ln.forIn=function(e,t){return null==e?e:pi(e,io(t,3),Ps)},Ln.forInRight=function(e,t){return null==e?e:vi(e,io(t,3),Ps)},Ln.forOwn=function(e,t){return e&&gi(e,io(t,3))},Ln.forOwnRight=function(e,t){return e&&mi(e,io(t,3))},Ln.get=Ss,Ln.gt=Ba,Ln.gte=Va,Ln.has=function(e,t){return null!=e&&lo(e,t,xi)},Ln.hasIn=Es,Ln.head=Go,Ln.identity=tu,Ln.includes=function(e,t,n,i){e=Ga(e)?e:Fs(e),n=n&&!i?fs(n):0;var r=e.length;return n<0&&(n=pn(r+n,0)),os(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&jt(e,t,n)>-1},Ln.indexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:fs(n);return r<0&&(r=pn(i+r,0)),jt(e,t,r)},Ln.inRange=function(e,t,n){return t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,n){return e>=vn(t,n)&&e=-h&&e<=h},Ln.isSet=rs,Ln.isString=os,Ln.isSymbol=as,Ln.isTypedArray=ss,Ln.isUndefined=function(e){return e===r},Ln.isWeakMap=function(e){return Ja(e)&&co(e)==A},Ln.isWeakSet=function(e){return Ja(e)&&"[object WeakSet]"==wi(e)},Ln.join=function(e,t){return null==e?"":Ut.call(e,t)},Ln.kebabCase=Us,Ln.last=Yo,Ln.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=fs(n))<0?pn(i+o,0):vn(o,i-1)),t==t?function(e,t,n){for(var i=n+1;i--;)if(e[i]===t)return i;return i}(e,t,o):Lt(e,Bt,o,!0)},Ln.lowerCase=Hs,Ln.lowerFirst=Gs,Ln.lt=us,Ln.lte=cs,Ln.max=function(e){return e&&e.length?hi(e,tu,ki):r},Ln.maxBy=function(e,t){return e&&e.length?hi(e,io(t,2),ki):r},Ln.mean=function(e){return Vt(e,tu)},Ln.meanBy=function(e,t){return Vt(e,io(t,2))},Ln.min=function(e){return e&&e.length?hi(e,tu,Ri):r},Ln.minBy=function(e,t){return e&&e.length?hi(e,io(t,2),Ri):r},Ln.stubArray=du,Ln.stubFalse=pu,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=bu,Ln.nth=function(e,t){return e&&e.length?Fi(e,fs(t)):r},Ln.noConflict=function(){return ct._===this&&(ct._=Le),this},Ln.noop=au,Ln.now=Sa,Ln.pad=function(e,t,n){e=gs(e);var i=(t=fs(t))?un(e):0;if(!t||i>=t)return e;var r=(t-i)/2;return Br(ht(r),n)+e+Br(lt(r),n)},Ln.padEnd=function(e,t,n){e=gs(e);var i=(t=fs(t))?un(e):0;return t&&it){var i=e;e=t,t=i}if(n||e%1||t%1){var o=yn();return vn(e+o*(t-e+ot("1e-"+((o+"").length-1))),t)}return Hi(e,t)},Ln.reduce=function(e,t,n){var i=Ua(e)?Mt:Ht,r=arguments.length<3;return i(e,io(t,4),n,r,ui)},Ln.reduceRight=function(e,t,n){var i=Ua(e)?It:Ht,r=arguments.length<3;return i(e,io(t,4),n,r,ci)},Ln.repeat=function(e,t,n){return t=(n?vo(e,t,n):t===r)?1:fs(t),Gi(gs(e),t)},Ln.replace=function(){var e=arguments,t=gs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ln.result=function(e,t,n){var i=-1,o=(t=pr(t,e)).length;for(o||(o=1,e=r);++ih)return[];var n=f,i=vn(e,f);t=io(t),e-=f;for(var r=Wt(i,t);++n=a)return e;var u=n-un(i);if(u<1)return i;var c=s?gr(s,0,u).join(""):e.slice(0,u);if(o===r)return c+i;if(s&&(u+=c.length-u),is(o)){if(e.slice(u).search(o)){var l,h=c;for(o.global||(o=Se(o.source,gs(he.exec(o))+"g")),o.lastIndex=0;l=o.exec(h);)var f=l.index;c=c.slice(0,f===r?u:f)}}else if(e.indexOf(rr(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+i},Ln.unescape=function(e){return(e=gs(e))&&q.test(e)?e.replace(G,hn):e},Ln.uniqueId=function(e){var t=++Ie;return gs(e)+t},Ln.upperCase=Xs,Ln.upperFirst=Ys,Ln.each=ga,Ln.eachRight=ma,Ln.first=Go,ou(Ln,function(){var e={};return gi(Ln,function(t,n){Me.call(Ln.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),Ln.VERSION="4.17.21",xt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Ln[e].placeholder=Ln}),xt(["drop","take"],function(e,t){Vn.prototype[e]=function(n){n=n===r?1:pn(fs(n),0);var i=this.__filtered__&&!t?new Vn(this):this.clone();return i.__filtered__?i.__takeCount__=vn(n,i.__takeCount__):i.__views__.push({size:vn(n,f),type:e+(i.__dir__<0?"Right":"")}),i},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),xt(["filter","map","takeWhile"],function(e,t){var n=t+1,i=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}}),xt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}}),xt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}}),Vn.prototype.compact=function(){return this.filter(tu)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=Wi(function(e,t){return"function"==typeof e?new Vn(this):this.map(function(n){return Ci(n,e,t)})}),Vn.prototype.reject=function(e){return this.filter(Ra(io(e)))},Vn.prototype.slice=function(e,t){e=fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(f)},gi(Vn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Ln[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);!o||(Ln.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,u=t instanceof Vn,c=s[0],l=u||Ua(t),h=function(e){var t=o.apply(Ln,Pt([e],s));return i&&f?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var f=this.__chain__,d=!!this.__actions__.length,p=a&&!f,v=u&&!d;if(!a&&l){t=v?t:new Vn(this);var g=e.apply(t,s);return g.__actions__.push({func:ha,args:[h],thisArg:r}),new Bn(g,f)}return p&&v?e.apply(this,s):(g=this.thru(h),p?i?g.value()[0]:g.value():g)})}),xt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Ln.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var r=this.value();return t.apply(Ua(r)?r:[],e)}return this[n](function(n){return t.apply(Ua(n)?n:[],e)})}}),gi(Vn.prototype,function(e,t){var n=Ln[t];if(n){var i=n.name+"";Me.call(On,i)||(On[i]=[]),On[i].push({name:t,func:n})}}),On[Nr(r,2).name]=[{name:"wrapper",func:r}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=Sr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Sr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Sr(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ua(e),i=t<0,r=n?e.length:0,o=function(e,t,n){for(var i=-1,r=n.length;++i=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Ln.prototype.plant=function(e){for(var t,n=this;n instanceof Fn;){var i=jo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Ln.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:ha,args:[Zo],thisArg:r}),new Bn(t,this.__chain__)}return this.thru(Zo)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return cr(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,Xe&&(Ln.prototype[Xe]=function(){return this}),Ln}();ct._=fn,(i=(function(){return fn}).call(t,n,t,e))!==r&&(e.exports=i)}).call(this)},5478:function(e){e.exports=function(){"use strict";function e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i={exports:{}};i.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:function(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}},changeDefaults:function(e){i.exports.defaults=e}};var r=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,u={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(e){return u[e]},l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(e){return e.replace(l,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}var f=/(^|[^\[])\^/g,d=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,v={},g=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(e,t,n){var i=e.length;if(0===i)return"";for(var r=0;r=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/),i=0;if(n.length>t)n.splice(t);else for(;n.length1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:S(n,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map(function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=i.length?e.slice(i.length):e}).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:i}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var i=S(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n}}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:E(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,i,r,o,a,s,u,c,l,h=t[0],f=t[2],d=f.length>1,p={type:"list",raw:h,ordered:d,start:d?+f.slice(0,-1):"",loose:!1,items:[]},v=t[0].match(this.rules.block.item),g=!1,m=v.length;r=this.rules.block.listItemStart.exec(v[0]);for(var y=0;yr[1].length:o[1].length>=r[0].length||o[1].length>3){v.splice(y,2,v[y]+(!this.options.pedantic&&o[1].length/i.test(i[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):C(i[0]):i[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;var i=S(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,i=0,r=0;r-1){var o=(0===t[0].indexOf("!")?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,o).trim(),t[3]=""}}var a=t[2],s="";if(this.options.pedantic){var u=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);u&&(a=u[1],s=u[3])}else s=t[3]?t[3].slice(1,-1):"";return a=a.trim(),/^$/.test(n)?a.slice(1):a.slice(1,-1)),O(t,{href:a&&a.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=t[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return O(n,i,n[0])}},t.emStrong=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(e);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var o,a,s=i[0].length-1,u=s,c=0,l="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+s);null!=(i=l.exec(t));)if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6]){if(a=o.length,i[3]||i[4]){u+=a;continue}if((i[5]||i[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(!((u-=a)>0))return a=Math.min(a,a+u+c),Math.min(s,a)%2?{type:"em",raw:e.slice(0,s+i.index+a+1),text:e.slice(1,s+i.index+a)}:{type:"strong",raw:e.slice(0,s+i.index+a+1),text:e.slice(2,s+i.index+a-1)}}}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=C(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}},t.autolink=function(e,t){var n,i,r=this.rules.inline.autolink.exec(e);if(r)return i="@"===r[2]?"mailto:"+(n=C(this.options.mangle?t(r[1]):r[1])):n=C(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var i,r;if("@"===n[2])r="mailto:"+(i=C(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=C(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},t.inlineText=function(e,t,n){var i,r=this.rules.inline.text.exec(e);if(r)return i=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):C(r[0]):r[0]:C(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},e}(),A={exec:function(){}},P=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,i){return i=(i=i.source||i).replace(f,"$1"),e=e.replace(t,i),n},getRegex:function(){return new RegExp(e,t)}};return n},M=k,I={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:A,table:A,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};I.def=P(I.def).replace("label",I._label).replace("title",I._title).getRegex(),I.bullet=/(?:[*+-]|\d{1,9}[.)])/,I.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,I.item=P(I.item,"gm").replace(/bull/g,I.bullet).getRegex(),I.listItemStart=P(/^( *)(bull) */).replace("bull",I.bullet).getRegex(),I.list=P(I.list).replace(/bull/g,I.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+I.def.source+")").getRegex(),I._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",I._comment=/|$)/,I.html=P(I.html,"i").replace("comment",I._comment).replace("tag",I._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),I.paragraph=P(I._paragraph).replace("hr",I.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",I._tag).getRegex(),I.blockquote=P(I.blockquote).replace("paragraph",I.paragraph).getRegex(),I.normal=M({},I),I.gfm=M({},I.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),I.gfm.nptable=P(I.gfm.nptable).replace("hr",I.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",I._tag).getRegex(),I.gfm.table=P(I.gfm.table).replace("hr",I.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",I._tag).getRegex(),I.pedantic=M({},I.normal,{html:P("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",I._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,paragraph:P(I.normal._paragraph).replace("hr",I.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",I.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var R={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:A,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:A,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};R.punctuation=P(R.punctuation).replace(/punctuation/g,R._punctuation).getRegex(),R.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,R.escapedEmSt=/\\\*|\\_/g,R._comment=P(I._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),R.emStrong.lDelim=P(R.emStrong.lDelim).replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimAst=P(R.emStrong.rDelimAst,"g").replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimUnd=P(R.emStrong.rDelimUnd,"g").replace(/punct/g,R._punctuation).getRegex(),R._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,R._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,R._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,R.autolink=P(R.autolink).replace("scheme",R._scheme).replace("email",R._email).getRegex(),R._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,R.tag=P(R.tag).replace("comment",R._comment).replace("attribute",R._attribute).getRegex(),R._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,R._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,R.link=P(R.link).replace("label",R._label).replace("href",R._href).replace("title",R._title).getRegex(),R.reflink=P(R.reflink).replace("label",R._label).getRegex(),R.reflinkSearch=P(R.reflinkSearch,"g").replace("reflink",R.reflink).replace("nolink",R.nolink).getRegex(),R.normal=M({},R),R.pedantic=M({},R.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:P(/^!?\[(label)\]\((.*?)\)/).replace("label",R._label).getRegex(),reflink:P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",R._label).getRegex()}),R.gfm=M({},R.normal,{escape:P(R.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\1;)1&t&&(n+=e),t>>=1,e+=e;return n+e};function V(e){return e.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026")}function z(e){var t,n,i="",r=e.length;for(t=0;t.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var U=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||L,this.options.tokenizer=this.options.tokenizer||new N,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:j.normal,inline:F.normal};this.options.pedantic?(t.block=j.pedantic,t.inline=F.pedantic):this.options.gfm&&(t.block=j.gfm,t.inline=this.options.breaks?F.breaks:F.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)},t.lexInline=function(e,n){return new t(n).inlineTokens(e)};var n=t.prototype;return n.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(e,t,n){var i,r,o,a,s,u,c=this;for(void 0===t&&(t=[]),void 0===n&&(n=!0),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(n){return!!(i=n.call(c,e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.type&&t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),(a=t[t.length-1])&&"paragraph"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.nptable(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),t.push(i);continue}if(i=this.tokenizer.list(e)){for(e=e.substring(i.raw.length),o=i.items.length,r=0;r=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),n&&(i=this.tokenizer.paragraph(s))){a=t[t.length-1],u&&"paragraph"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text):t.push(i),u=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),(a=t[t.length-1])&&"text"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text):t.push(i);continue}if(e){var l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}}return t},n.inline=function(e){var t,n,i,r,o,a,s=e.length;for(t=0;t0)for(;null!=(u=this.tokenizer.rules.inline.reflinkSearch.exec(h));)f.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,u.index)+"["+B("a",u[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(u=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,u.index)+"["+B("a",u[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(u=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,u.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(c||(l=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(n){return!!(o=n.call(r,e,t))&&(e=e.substring(o.raw.length),t.push(o),!0)}))){if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e,n,i)){e=e.substring(o.raw.length),n=o.inLink,i=o.inRawBlock,(a=t[t.length-1])&&"text"===o.type&&"text"===a.type?(a.raw+=o.raw,a.text+=o.text):t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length),a=t[t.length-1],"link"===o.type?(o.tokens=this.inlineTokens(o.text,[],!0,i),t.push(o)):a&&"text"===o.type&&"text"===a.type?(a.raw+=o.raw,a.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,h,l)){e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);continue}if(o=this.tokenizer.autolink(e,z)){e=e.substring(o.raw.length),t.push(o);continue}if(!n&&(o=this.tokenizer.url(e,z))){e=e.substring(o.raw.length),t.push(o);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,n=e.slice(1),i=void 0;r.options.extensions.startInline.forEach(function(e){"number"==typeof(i=e.call(this,n))&&i>=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),o=this.tokenizer.inlineText(s,i,V)){e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(l=o.raw.slice(-1)),c=!0,(a=t[t.length-1])&&"text"===a.type?(a.raw+=o.raw,a.text+=o.text):t.push(o);continue}if(e){var d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}throw new Error(d)}}return t},function(t,n,i){i&&e(t,i)}(t,0,[{key:"rules",get:function(){return{block:j,inline:F}}}]),t}(),H=i.exports.defaults,G=function(e,t,n){if(e){var i;try{i=decodeURIComponent(h(n)).replace(d,"").toLowerCase()}catch(r){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}t&&!p.test(n)&&(n=function(e,t){v[" "+e]||(v[" "+e]=g.test(e)?e+"/":b(e,"/",!0));var n=-1===(e=v[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(y,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(r){return null}return n},W=_,q=function(){function e(e){this.options=e||H}var t=e.prototype;return t.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(e,i);null!=r&&r!==e&&(n=!0,e=r)}return e=e.replace(/\n$/,"")+"\n",i?'
    '+(n?e:W(e,!0))+"
    \n":"
    "+(n?e:W(e,!0))+"
    \n"},t.blockquote=function(e){return"
    \n"+e+"
    \n"},t.html=function(e){return e},t.heading=function(e,t,n,i){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},t.list=function(e,t,n){var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;var i='"+n+""},t.image=function(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;var i=''+n+'":">")},t.text=function(e){return e},e}(),X=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),Y=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var n=e,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[e];do{n=e+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=i,this.seen[n]=0),n},t.slug=function(e,t){void 0===t&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),K=q,Q=X,$=Y,Z=i.exports.defaults,J=w,ee=U,te=function(){function e(e){this.options=e||Z,this.options.renderer=this.options.renderer||new K,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Q,this.slugger=new $}e.parse=function(t,n){return new e(n).parse(t)},e.parseInline=function(t,n){return new e(n).parseInline(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,i,r,o,a,s,u,c,l,h,f,d,p,v,g,m,y,b,_,w="",k=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):v+=b),v+=this.parse(g.tokens,p),l+=this.renderer.listitem(v,y,m);w+=this.renderer.list(l,f,d);continue;case"html":w+=this.renderer.html(h.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(l=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+ue(u.message+"",!0)+"
    ";throw u}}return fe.options=fe.setOptions=function(e){return ae(fe.defaults,e),le(fe.defaults),fe},fe.getDefaults=ce,fe.defaults=he,fe.use=function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;iAn error occurred:

    "+ue(i.message+"",!0)+"
    ";throw i}},fe.Parser=te,fe.parser=te.parse,fe.Renderer=ie,fe.TextRenderer=re,fe.Lexer=ee,fe.lexer=ee.lex,fe.Tokenizer=ne,fe.Slugger=oe,fe.parse=fe,fe}()},29369:function(e,t,n){var i=n(56284),r=n(67830);function o(){this.clear()}o.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},o.prototype.enqueue=function(e){return this.items.push(e),++this.size},o.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},o.prototype.peek=function(){if(this.size)return this.items[this.offset]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.offset,i=0,r=this.items.length;n=e.length)return{done:!0};var n=e[t];return t++,{value:n,done:!1}})},o.prototype.entries=function(){var e=this.items,t=this.offset,n=0;return new i(function(){if(t>=e.length)return{done:!0};var i=e[t];return t++,{value:[n++,i],done:!1}})},"undefined"!=typeof Symbol&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(",")},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:o,enumerable:!1}),e},"undefined"!=typeof Symbol&&(o.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.prototype.inspect),o.from=function(e){var t=new o;return r(e,function(e){t.enqueue(e)}),t},o.of=function(){return o.from(arguments)},e.exports=o},65593:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(72293),a=function(e){function t(){e.apply(this,arguments),this.value=null,this.hasNext=!1,this.hasCompleted=!1}return i(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),o.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),o.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(r.Subject);t.AsyncSubject=a},73907:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(6594),a=function(e){function t(t){e.call(this),this._value=t}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new o.ObjectUnsubscribedError;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r.Subject);t.BehaviorSubject=a},36888:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t,n,i){e.call(this),this.parent=t,this.outerValue=n,this.outerIndex=i,this.index=0}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(n(42109).Subscriber);t.InnerSubscriber=r},94429:function(e,t,n){"use strict";var i=n(18705),r=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return i.Observable.of(this.value);case"E":return i.Observable.throw(this.error);case"C":return i.Observable.empty()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();t.Notification=r},18705:function(e,t,n){"use strict";var i=n(80019),r=n(18154),o=n(45783),a=n(10142),s=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var i=this.operator,o=r.toSubscriber(e,t,n);if(i?i.call(o,this.source):o.add(this.source||!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.syncErrorThrown=!0,e.syncErrorValue=t,e.error(t)}},e.prototype.forEach=function(e,t){var n=this;if(t||(i.root.Rx&&i.root.Rx.config&&i.root.Rx.config.Promise?t=i.root.Rx.config.Promise:i.root.Promise&&(t=i.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,i){var r;r=n.subscribe(function(t){if(r)try{e(t)}catch(n){i(n),r.unsubscribe()}else e(t)},i,t)})},e.prototype._subscribe=function(e){return this.source.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;tt&&(o=Math.max(o,r-t)),o>0&&i.splice(0,o),i},t}(r.Subject);t.ReplaySubject=l;var h=function(e,t){this.time=e,this.value=t}},25430:function(e,t,n){"use strict";var i=n(2369);t.xQ=i.Subject,n(18705),n(24769),n(95914),n(88007),n(3194),n(61898),n(16301),n(23276),n(66593),n(13745),n(57362),n(24518),n(68789),n(30520),n(67370),n(86866),n(11505),n(5031),n(36780),n(17038),n(15718),n(27915),n(90763),n(6846),n(65662),n(6799),n(81854),n(612),n(10838),n(6725),n(8827),n(43511),n(38922),n(25178),n(56937),n(22947),n(82894),n(11206),n(94183),n(16653),n(17930),n(81118),n(50317),n(90674),n(66460),n(79232),n(3945),n(44674),n(73505),n(38749),n(16479),n(22744),n(44475),n(97384),n(8237),n(24937),n(99013),n(84042),n(44436),n(7099),n(6217),n(57476),n(72646),n(91573),n(27387),n(27366),n(88859),n(65425),n(16733),n(23381),n(80404),n(63770),n(53626),n(98851),n(84878),n(26544),n(53582),n(61749),n(34838),n(49681),n(46227),n(56455),n(40881),n(94315),n(92910),n(52442),n(84664),n(61250),n(28310),n(43027),n(18252),n(49571),n(31782),n(9800),n(41854),n(74839),n(1305),n(99144),n(89952),n(85863),n(2865),n(92667),n(22185),n(72919),n(88630),n(75458),n(40780),n(35099),n(57502),n(81676),n(20579),n(71323),n(84950),n(57113),n(95073),n(75654),n(59889),n(96611),n(81845),n(7828),n(4881),n(74568),n(32352),n(50169),n(93543),n(61690),n(15914),n(68583),n(44808),n(49088),n(72293),n(42109),n(65593),n(81959),n(73907),n(51493),n(94429),n(44640),n(11758),n(6594),n(13815),n(84536),n(73390),n(62688),n(24482),n(18353),n(55298),n(10142),n(85522),n(90680),n(97088),n(12948),n(28592),n(72121),n(45783),n(39053)},11965:function(e,t){"use strict";var n=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=Date.now?Date.now:function(){return+new Date},e}();t.Scheduler=n},2369:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(42109),a=n(72293),s=n(6594),u=n(9060),c=n(28592),l=function(e){function t(t){e.call(this,t),this.destination=t}return i(t,e),t}(o.Subscriber);t.SubjectSubscriber=l;var h=function(e){function t(){e.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return i(t,e),t.prototype[c.rxSubscriber]=function(){return new l(this)},t.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new s.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,n=t.length,i=t.slice(),r=0;r=e.length)return void i.complete();i.next(t[n]),e.index=n+1,this.schedule(e)}},t.prototype._subscribe=function(e){var n=this.arrayLike,i=this.scheduler,r=n.length;if(i)return i.schedule(t.dispatch,0,{arrayLike:n,index:0,length:r,subscriber:e});for(var o=0;o1?new t(e,i):1===r?new o.ScalarObservable(e[0],i):new a.EmptyObservable(i)},t.dispatch=function(e){var t=e.array,n=e.index,i=e.subscriber;n>=e.count?i.complete():(i.next(t[n]),!i.closed&&(e.index=n+1,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.array,i=n.length,r=this.scheduler;if(r)return r.schedule(t.dispatch,0,{array:n,index:0,count:i,subscriber:e});for(var o=0;o1)this.connection=null;else{var n=this.connection,i=e._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null}}(a.Subscriber)},34078:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(93658),a=n(84308),s=function(e){function t(t){e.call(this),this.observableFactory=t}return i(t,e),t.create=function(e){return new t(e)},t.prototype._subscribe=function(e){return new u(e,this.observableFactory)},t}(r.Observable);t.DeferObservable=s;var u=function(e){function t(t,n){e.call(this,t),this.factory=n,this.tryDefer()}return i(t,e),t.prototype.tryDefer=function(){try{this._callFactory()}catch(e){this._error(e)}},t.prototype._callFactory=function(){var e=this.factory();e&&this.add(o.subscribeToResult(this,e))},t}(a.OuterSubscriber)},70481:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t){e.call(this),this.scheduler=t}return i(t,e),t.create=function(e){return new t(e)},t.dispatch=function(e){e.subscriber.complete()},t.prototype._subscribe=function(e){var n=this.scheduler;if(n)return n.schedule(t.dispatch,0,{subscriber:e});e.complete()},t}(n(18705).Observable);t.EmptyObservable=r},72210:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t,n){e.call(this),this.error=t,this.scheduler=n}return i(t,e),t.create=function(e,n){return new t(e,n)},t.dispatch=function(e){e.subscriber.error(e.error)},t.prototype._subscribe=function(e){var n=this.error,i=this.scheduler;if(e.syncErrorThrowable=!0,i)return i.schedule(t.dispatch,0,{error:n,subscriber:e});e.error(n)},t}(n(18705).Observable);t.ErrorObservable=r},56064:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(70481),a=n(48242),s=n(93658),u=n(84308),c=function(e){function t(t,n){e.call(this),this.sources=t,this.resultSelector=n}return i(t,e),t.create=function(){for(var e=[],n=0;nl?l:t:t}(e)),this.arr=e,this.idx=t,this.len=n}return e.prototype[a.iterator]=function(){return this},e.prototype.next=function(){return this.idx=e.count?i.complete():(i.next(t),!i.closed&&(e.index=n+1,e.start=t+1,this.schedule(e)))},t.prototype._subscribe=function(e){var n=0,i=this.start,r=this._count,o=this.scheduler;if(o)return o.schedule(t.dispatch,0,{index:n,count:r,start:i,subscriber:e});for(;;){if(n++>=r){e.complete();break}if(e.next(i++),e.closed)break}},t}(n(18705).Observable);t.RangeObservable=r},80478:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t,n){e.call(this),this.value=t,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return i(t,e),t.create=function(e,n){return new t(e,n)},t.dispatch=function(e){var t=e.value,n=e.subscriber;e.done?n.complete():(n.next(t),!n.closed&&(e.done=!0,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.value,i=this.scheduler;if(i)return i.schedule(t.dispatch,0,{done:!1,value:n,subscriber:e});e.next(n),e.closed||e.complete()},t}(n(18705).Observable);t.ScalarObservable=r},82966:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(85522),a=n(39479),s=function(e){function t(t,n,i){void 0===n&&(n=0),void 0===i&&(i=o.asap),e.call(this),this.source=t,this.delayTime=n,this.scheduler=i,(!a.isNumeric(n)||n<0)&&(this.delayTime=0),(!i||"function"!=typeof i.schedule)&&(this.scheduler=o.asap)}return i(t,e),t.create=function(e,n,i){return void 0===n&&(n=0),void 0===i&&(i=o.asap),new t(e,n,i)},t.dispatch=function(e){return this.add(e.source.subscribe(e.subscriber))},t.prototype._subscribe=function(e){return this.scheduler.schedule(t.dispatch,this.delayTime,{source:this.source,subscriber:e})},t}(r.Observable);t.SubscribeOnObservable=s},92870:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(39479),o=n(18705),a=n(90680),s=n(41503),u=n(783),c=function(e){function t(t,n,i){void 0===t&&(t=0),e.call(this),this.period=-1,this.dueTime=0,r.isNumeric(n)?this.period=Number(n)<1?1:Number(n):s.isScheduler(n)&&(i=n),s.isScheduler(i)||(i=a.async),this.scheduler=i,this.dueTime=u.isDate(t)?+t-this.scheduler.now():t}return i(t,e),t.create=function(e,n,i){return void 0===e&&(e=0),new t(e,n,i)},t.dispatch=function(e){var t=e.index,n=e.period,i=e.subscriber;if(i.next(t),!i.closed){if(-1===n)return i.complete();e.index=t+1,this.schedule(e,n)}},t.prototype._subscribe=function(e){var n=this;return n.scheduler.schedule(t.dispatch,n.dueTime,{index:0,period:n.period,subscriber:e})},t}(o.Observable);t.TimerObservable=c},16196:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(93658),a=n(84308),s=function(e){function t(t,n){e.call(this),this.resourceFactory=t,this.observableFactory=n}return i(t,e),t.create=function(e,n){return new t(e,n)},t.prototype._subscribe=function(e){var t,n=this.resourceFactory,i=this.observableFactory;try{return t=n(),new u(e,t,i)}catch(r){e.error(r)}},t}(r.Observable);t.UsingObservable=s;var u=function(e){function t(t,n,i){e.call(this,t),this.resource=n,this.observableFactory=i,t.add(n),this.tryUse()}return i(t,e),t.prototype.tryUse=function(){try{var e=this.observableFactory.call(this,this.resource);e&&this.add(o.subscribeToResult(this,e))}catch(t){this._error(t)}},t}(a.OuterSubscriber)},59246:function(e,t,n){"use strict";var i=n(19183);t.bindCallback=i.BoundCallbackObservable.create},65571:function(e,t,n){"use strict";var i=n(78655);t.bindNodeCallback=i.BoundNodeCallbackObservable.create},24669:function(e,t,n){"use strict";var i=n(41503),r=n(48242),o=n(96177),a=n(49134);t.combineLatest=function(){for(var e=[],t=0;t1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof u&&(n=e.pop()),null===s&&1===e.length&&e[0]instanceof i.Observable?e[0]:a.mergeAll(n)(new r.ArrayObservable(e,s))}},94503:function(e,t,n){"use strict";var i=n(20143);t.never=i.NeverObservable.create},69657:function(e,t,n){"use strict";var i=n(96177);t.of=i.ArrayObservable.of},61395:function(e,t,n){"use strict";var i=n(46243);t.onErrorResumeNext=i.onErrorResumeNextStatic},95425:function(e,t,n){"use strict";var i=n(19770);t.pairs=i.PairsObservable.create},24330:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(48242),o=n(96177),a=n(84308),s=n(93658);t.race=function(){for(var e=[],t=0;t=2&&(a=arguments[1]);var s=Number.POSITIVE_INFINITY;return t>=3&&(s=arguments[2]),o.bufferTime(e,a,s,n)(this)}},92523:function(e,t,n){"use strict";var i=n(15440);t.bufferToggle=function(e,t){return i.bufferToggle(e,t)(this)}},49436:function(e,t,n){"use strict";var i=n(51786);t.bufferWhen=function(e){return i.bufferWhen(e)(this)}},64731:function(e,t,n){"use strict";var i=n(93017);t._catch=function(e){return i.catchError(e)(this)}},92273:function(e,t,n){"use strict";var i=n(17054);t.combineAll=function(e){return i.combineAll(e)(this)}},8709:function(e,t,n){"use strict";var i=n(49134);t.combineLatest=function(){for(var e=[],t=0;t=2?i.reduce(e,t)(this):i.reduce(e)(this)}},12931:function(e,t,n){"use strict";var i=n(15329);t.repeat=function(e){return void 0===e&&(e=-1),i.repeat(e)(this)}},68816:function(e,t,n){"use strict";var i=n(63964);t.repeatWhen=function(e){return i.repeatWhen(e)(this)}},17144:function(e,t,n){"use strict";var i=n(40241);t.retry=function(e){return void 0===e&&(e=-1),i.retry(e)(this)}},82766:function(e,t,n){"use strict";var i=n(23896);t.retryWhen=function(e){return i.retryWhen(e)(this)}},62068:function(e,t,n){"use strict";var i=n(92043);t.sample=function(e){return i.sample(e)(this)}},97013:function(e,t,n){"use strict";var i=n(90680),r=n(71239);t.sampleTime=function(e,t){return void 0===t&&(t=i.async),r.sampleTime(e,t)(this)}},98996:function(e,t,n){"use strict";var i=n(64949);t.scan=function(e,t){return arguments.length>=2?i.scan(e,t)(this):i.scan(e)(this)}},77033:function(e,t,n){"use strict";var i=n(88948);t.sequenceEqual=function(e,t){return i.sequenceEqual(e,t)(this)}},10377:function(e,t,n){"use strict";var i=n(35473);t.share=function(){return i.share()(this)}},71623:function(e,t,n){"use strict";var i=n(62704);t.shareReplay=function(e,t,n){return i.shareReplay(e,t,n)(this)}},91956:function(e,t,n){"use strict";var i=n(92223);t.single=function(e){return i.single(e)(this)}},72355:function(e,t,n){"use strict";var i=n(11189);t.skip=function(e){return i.skip(e)(this)}},69329:function(e,t,n){"use strict";var i=n(73346);t.skipLast=function(e){return i.skipLast(e)(this)}},68481:function(e,t,n){"use strict";var i=n(12928);t.skipUntil=function(e){return i.skipUntil(e)(this)}},587:function(e,t,n){"use strict";var i=n(69415);t.skipWhile=function(e){return i.skipWhile(e)(this)}},49292:function(e,t,n){"use strict";var i=n(30673);t.startWith=function(){for(var e=[],t=0;t0&&this.destination.next(t),e.prototype._complete.call(this)},t}(r.Subscriber),s=function(e){function t(t,n,i){e.call(this,t),this.bufferSize=n,this.startBufferEvery=i,this.buffers=[],this.count=0}return i(t,e),t.prototype._next=function(e){var t=this,n=t.bufferSize,i=t.startBufferEvery,r=t.buffers,o=t.count;this.count++,o%i==0&&r.push([]);for(var a=r.length;a--;){var s=r[a];s.push(e),s.length===n&&(r.splice(a,1),this.destination.next(s))}},t.prototype._complete=function(){for(var t=this.buffers,n=this.destination;t.length>0;){var i=t.shift();i.length>0&&n.next(i)}e.prototype._complete.call(this)},t}(r.Subscriber)},6489:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(90680),o=n(42109),a=n(41503);t.bufferTime=function(e){var t=arguments.length,n=r.async;a.isScheduler(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],t--);var i=null;t>=2&&(i=arguments[1]);var o=Number.POSITIVE_INFINITY;return t>=3&&(o=arguments[2]),function(t){return t.lift(new s(e,i,o,n))}};var s=function(){function e(e,t,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=n,this.scheduler=i}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),u=function(){this.buffer=[]},c=function(e){function t(t,n,i,r,o){e.call(this,t),this.bufferTimeSpan=n,this.bufferCreationInterval=i,this.maxBufferSize=r,this.scheduler=o,this.contexts=[];var a=this.openContext();if(this.timespanOnly=null==i||i<0,this.timespanOnly)this.add(a.closeAction=o.schedule(l,n,{subscriber:this,context:a,bufferTimeSpan:n}));else{var s={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:this,scheduler:o};this.add(a.closeAction=o.schedule(f,n,{subscriber:this,context:a})),this.add(o.schedule(h,i,s))}}return i(t,e),t.prototype._next=function(e){for(var t,n=this.contexts,i=n.length,r=0;r0;){var i=t.shift();n.next(i.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var n=this.bufferTimeSpan;this.add(e.closeAction=this.scheduler.schedule(l,n,{subscriber:this,context:e,bufferTimeSpan:n}))}},t.prototype.openContext=function(){var e=new u;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(o.Subscriber);function l(e){var t=e.subscriber,n=e.context;n&&t.closeContext(n),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function h(e){var t=e.bufferCreationInterval,n=e.bufferTimeSpan,i=e.subscriber,r=e.scheduler,o=i.openContext();i.closed||(i.add(o.closeAction=r.schedule(f,n,{subscriber:i,context:o})),this.schedule(e,t))}function f(e){e.subscriber.closeContext(e.context)}},15440:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(72293),o=n(93658),a=n(84308);t.bufferToggle=function(e,t){return function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.openings,this.closingSelector))},e}(),u=function(e){function t(t,n,i){e.call(this,t),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(o.subscribeToResult(this,n))}return i(t,e),t.prototype._next=function(e){for(var t=this.contexts,n=t.length,i=0;i0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var n=t.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,i,r){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(n){this._error(n)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var n=e.subscription;this.destination.next(e.buffer),t.splice(t.indexOf(e),1),this.remove(n),n.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,n=new r.Subscription,i={buffer:[],subscription:n};t.push(i);var a=o.subscribeToResult(this,e,i);!a||a.closed?this.closeBuffer(i):(a.context=i,this.add(a),n.add(a))},t}(a.OuterSubscriber)},51786:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(72293),o=n(33463),a=n(85814),s=n(84308),u=n(93658);t.bufferWhen=function(e){return function(t){return t.lift(new c(e))}};var c=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,n){e.call(this,t),this.closingSelector=n,this.subscribing=!1,this.openBuffer()}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},t.prototype.notifyNext=function(e,t,n,i,r){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e=this.closingSubscription;e&&(this.remove(e),e.unsubscribe()),this.buffer&&this.destination.next(this.buffer),this.buffer=[];var t=o.tryCatch(this.closingSelector)();t===a.errorObject?this.error(a.errorObject.e):(e=new r.Subscription,this.closingSubscription=e,this.add(e),this.subscribing=!0,e.add(u.subscribeToResult(this,t)),this.subscribing=!1)},t}(s.OuterSubscriber)},93017:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.catchError=function(e){return function(t){var n=new a(e),i=t.lift(n);return n.caught=i}};var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.selector=n,this.caught=i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(i){return void e.prototype.error.call(this,i)}this._unsubscribeAndRecycle(),this.add(o.subscribeToResult(this,n))}},t}(r.OuterSubscriber)},17054:function(e,t,n){"use strict";var i=n(49134);t.combineAll=function(e){return function(t){return t.lift(new i.CombineLatestOperator(e))}}},49134:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(96177),o=n(48242),a=n(84308),s=n(93658),u={};t.combineLatest=function(){for(var e=[],t=0;t0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){var o=Math.max(0,n[0].time-i.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,n=new l(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(s.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e)},t.prototype._complete=function(){this.scheduleNotification(s.Notification.createComplete())},t}(a.Subscriber),l=function(e,t){this.time=e,this.notification=t}},22944:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(18705),a=n(84308),s=n(93658);t.delayWhen=function(e,t){return t?function(n){return new l(n,t).lift(new u(e))}:function(t){return t.lift(new u(e))}};var u=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delayDurationSelector))},e}(),c=function(e){function t(t,n){e.call(this,t),this.delayDurationSelector=n,this.completed=!1,this.delayNotifierSubscriptions=[],this.values=[]}return i(t,e),t.prototype.notifyNext=function(e,t,n,i,r){this.destination.next(e),this.removeSubscription(r),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){try{var t=this.delayDurationSelector(e);t&&this.tryDelay(t,e)}catch(n){this.destination.error(n)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e),n=null;return-1!==t&&(n=this.values[t],this.delayNotifierSubscriptions.splice(t,1),this.values.splice(t,1)),n},t.prototype.tryDelay=function(e,t){var n=s.subscribeToResult(this,e,t);n&&!n.closed&&(this.add(n),this.delayNotifierSubscriptions.push(n)),this.values.push(t)},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(a.OuterSubscriber),l=function(e){function t(t,n){e.call(this),this.source=t,this.subscriptionDelay=n}return i(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new h(e,this.source))},t}(o.Observable),h=function(e){function t(t,n){e.call(this),this.parent=t,this.source=n,this.sourceSubscribed=!1}return i(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(r.Subscriber)},95591:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.dematerialize=function(){return function(e){return e.lift(new o)}};var o=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new a(e))},e}(),a=function(e){function t(t){e.call(this,t)}return i(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(r.Subscriber)},25753:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658),a=n(40317);t.distinct=function(e,t){return function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.keySelector,this.flushes))},e}(),u=function(e){function t(t,n,i){e.call(this,t),this.keySelector=n,this.values=new a.Set,i&&this.add(o.subscribeToResult(this,i))}return i(t,e),t.prototype.notifyNext=function(e,t,n,i,r){this.values.clear()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,n=this.destination;try{t=this.keySelector(e)}catch(i){return void n.error(i)}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))},t}(r.OuterSubscriber);t.DistinctSubscriber=u},65608:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(33463),a=n(85814);t.distinctUntilChanged=function(e,t){return function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.compare,this.keySelector))},e}(),u=function(e){function t(t,n,i){e.call(this,t),this.keySelector=i,this.hasKey=!1,"function"==typeof n&&(this.compare=n)}return i(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t=e;if(this.keySelector&&(t=o.tryCatch(this.keySelector)(e))===a.errorObject)return this.destination.error(a.errorObject.e);var n=!1;if(this.hasKey){if((n=o.tryCatch(this.compare)(this.key,t))===a.errorObject)return this.destination.error(a.errorObject.e)}else this.hasKey=!0;!1===Boolean(n)&&(this.key=t,this.destination.next(e))},t}(r.Subscriber)},8330:function(e,t,n){"use strict";var i=n(65608);t.distinctUntilKeyChanged=function(e,t){return i.distinctUntilChanged(function(n,i){return t?t(n[e],i[e]):n[e]===i[e]})}},29264:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(11758);t.elementAt=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){if(this.index=e,this.defaultValue=t,e<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.index,this.defaultValue))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.index=n,this.defaultValue=i}return i(t,e),t.prototype._next=function(e){0==this.index--&&(this.destination.next(e),this.destination.complete())},t.prototype._complete=function(){var e=this.destination;this.index>=0&&(void 0!==this.defaultValue?e.next(this.defaultValue):e.error(new o.ArgumentOutOfRangeError)),e.complete()},t}(r.Subscriber)},26285:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.every=function(e,t){return function(n){return n.lift(new o(e,t,n))}};var o=function(){function e(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.thisArg,this.source))},e}(),a=function(e){function t(t,n,i,r){e.call(this,t),this.predicate=n,this.thisArg=i,this.source=r,this.index=0,this.thisArg=i||this}return i(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(n){return void this.destination.error(n)}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(r.Subscriber)},93229:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.exhaust=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){e.call(this,t),this.hasCompleted=!1,this.hasSubscription=!1}return i(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(o.subscribeToResult(this,e)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(e){this.remove(e),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(r.OuterSubscriber)},15758:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.exhaustMap=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.resultSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.resultSelector))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.project=n,this.resultSelector=i,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}return i(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t=this.index++,n=this.destination;try{var i=this.project(e,t);this.hasSubscription=!0,this.add(o.subscribeToResult(this,i,e,t))}catch(r){n.error(r)}},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyNext=function(e,t,n,i,r){var o=this.destination;this.resultSelector?this.trySelectResult(e,t,n,i):o.next(t)},t.prototype.trySelectResult=function(e,t,n,i){var r=this.resultSelector,o=this.destination;try{var a=r(e,t,n,i);o.next(a)}catch(s){o.error(s)}},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.remove(e),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(r.OuterSubscriber)},55364:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(33463),o=n(85814),a=n(84308),s=n(93658);t.expand=function(e,t,n){return void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(i){return i.lift(new u(e,t,n))}};var u=function(){function e(e,t,n){this.project=e,this.concurrent=t,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.concurrent,this.scheduler))},e}();t.ExpandOperator=u;var c=function(e){function t(t,n,i,r){e.call(this,t),this.project=n,this.concurrent=i,this.scheduler=r,this.index=0,this.active=0,this.hasCompleted=!1,i0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(a.OuterSubscriber);t.ExpandSubscriber=c},27015:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.filter=function(e,t){return function(n){return n.lift(new o(e,t))}};var o=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.thisArg))},e}(),a=function(e){function t(t,n,i){e.call(this,t),this.predicate=n,this.thisArg=i,this.count=0}return i(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}t&&this.destination.next(e)},t}(r.Subscriber)},94367:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(72293);t.finalize=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.callback))},e}(),s=function(e){function t(t,n){e.call(this,t),this.add(new o.Subscription(n))}return i(t,e),t}(r.Subscriber)},16700:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.find=function(e,t){if("function"!=typeof e)throw new TypeError("predicate is not a function");return function(n){return n.lift(new o(e,n,!1,t))}};var o=function(){function e(e,t,n,i){this.predicate=e,this.source=t,this.yieldIndex=n,this.thisArg=i}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();t.FindValueOperator=o;var a=function(e){function t(t,n,i,r,o){e.call(this,t),this.predicate=n,this.source=i,this.yieldIndex=r,this.thisArg=o,this.index=0}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){var t=this.predicate,n=this.thisArg,i=this.index++;try{t.call(n||this,e,i,this.source)&&this.notifyComplete(this.yieldIndex?i:e)}catch(r){this.destination.error(r)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(r.Subscriber);t.FindValueSubscriber=a},86452:function(e,t,n){"use strict";var i=n(16700);t.findIndex=function(e,t){return function(n){return n.lift(new i.FindValueOperator(e,n,!0,t))}}},12309:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(44640);t.first=function(e,t,n){return function(i){return i.lift(new a(e,t,n,i))}};var a=function(){function e(e,t,n,i){this.predicate=e,this.resultSelector=t,this.defaultValue=n,this.source=i}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.resultSelector,this.defaultValue,this.source))},e}(),s=function(e){function t(t,n,i,r,o){e.call(this,t),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=o,this.index=0,this.hasCompleted=!1,this._emitted=!1}return i(t,e),t.prototype._next=function(e){var t=this.index++;this.predicate?this._tryPredicate(e,t):this._emit(e,t)},t.prototype._tryPredicate=function(e,t){var n;try{n=this.predicate(e,t,this.source)}catch(i){return void this.destination.error(i)}n&&this._emit(e,t)},t.prototype._emit=function(e,t){this.resultSelector?this._tryResultSelector(e,t):this._emitFinal(e)},t.prototype._tryResultSelector=function(e,t){var n;try{n=this.resultSelector(e,t)}catch(i){return void this.destination.error(i)}this._emitFinal(n)},t.prototype._emitFinal=function(e){var t=this.destination;this._emitted||(this._emitted=!0,t.next(e),t.complete(),this.hasCompleted=!0)},t.prototype._complete=function(){var e=this.destination;this.hasCompleted||void 0===this.defaultValue?this.hasCompleted||e.error(new o.EmptyError):(e.next(this.defaultValue),e.complete())},t}(r.Subscriber)},92577:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(72293),a=n(18705),s=n(2369),u=n(49754),c=n(30764);t.groupBy=function(e,t,n,i){return function(r){return r.lift(new l(e,t,n,i))}};var l=function(){function e(e,t,n,i){this.keySelector=e,this.elementSelector=t,this.durationSelector=n,this.subjectSelector=i}return e.prototype.call=function(e,t){return t.subscribe(new h(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),h=function(e){function t(t,n,i,r,o){e.call(this,t),this.keySelector=n,this.elementSelector=i,this.durationSelector=r,this.subjectSelector=o,this.groups=null,this.attemptedToUnsubscribe=!1,this.count=0}return i(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(n){return void this.error(n)}this._group(e,t)},t.prototype._group=function(e,t){var n=this.groups;n||(n=this.groups="string"==typeof t?new c.FastMap:new u.Map);var i,r=n.get(t);if(this.elementSelector)try{i=this.elementSelector(e)}catch(l){this.error(l)}else i=e;if(!r){r=this.subjectSelector?this.subjectSelector():new s.Subject,n.set(t,r);var o=new d(t,r,this);if(this.destination.next(o),this.durationSelector){var a=void 0;try{a=this.durationSelector(new d(t,r))}catch(l){return void this.error(l)}this.add(a.subscribe(new f(t,r,this)))}}r.closed||r.next(i)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach(function(t,n){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(r.Subscriber),f=function(e){function t(t,n,i){e.call(this,n),this.key=t,this.group=n,this.parent=i}return i(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(r.Subscriber),d=function(e){function t(t,n,i){e.call(this),this.key=t,this.groupSubject=n,this.refCountSubscription=i}return i(t,e),t.prototype._subscribe=function(e){var t=new o.Subscription,n=this.refCountSubscription,i=this.groupSubject;return n&&!n.closed&&t.add(new p(n)),t.add(i.subscribe(e)),t},t}(a.Observable);t.GroupedObservable=d;var p=function(e){function t(t){e.call(this),this.parent=t,t.count++}return i(t,e),t.prototype.unsubscribe=function(){var t=this.parent;!t.closed&&!this.closed&&(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(o.Subscription)},86898:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(68668);t.ignoreElements=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(){e.apply(this,arguments)}return i(t,e),t.prototype._next=function(e){o.noop()},t}(r.Subscriber)},89121:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.isEmpty=function(){return function(e){return e.lift(new o)}};var o=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new a(e))},e}(),a=function(e){function t(t){e.call(this,t)}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(r.Subscriber)},4636:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(44640);t.last=function(e,t,n){return function(i){return i.lift(new a(e,t,n,i))}};var a=function(){function e(e,t,n,i){this.predicate=e,this.resultSelector=t,this.defaultValue=n,this.source=i}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.resultSelector,this.defaultValue,this.source))},e}(),s=function(e){function t(t,n,i,r,o){e.call(this,t),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=o,this.hasValue=!1,this.index=0,void 0!==r&&(this.lastValue=r,this.hasValue=!0)}return i(t,e),t.prototype._next=function(e){var t=this.index++;if(this.predicate)this._tryPredicate(e,t);else{if(this.resultSelector)return void this._tryResultSelector(e,t);this.lastValue=e,this.hasValue=!0}},t.prototype._tryPredicate=function(e,t){var n;try{n=this.predicate(e,t,this.source)}catch(i){return void this.destination.error(i)}if(n){if(this.resultSelector)return void this._tryResultSelector(e,t);this.lastValue=e,this.hasValue=!0}},t.prototype._tryResultSelector=function(e,t){var n;try{n=this.resultSelector(e,t)}catch(i){return void this.destination.error(i)}this.lastValue=n,this.hasValue=!0},t.prototype._complete=function(){var e=this.destination;this.hasValue?(e.next(this.lastValue),e.complete()):e.error(new o.EmptyError)},t}(r.Subscriber)},40119:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.map=function(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new o(e,t))}};var o=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.project,this.thisArg))},e}();t.MapOperator=o;var a=function(e){function t(t,n,i){e.call(this,t),this.project=n,this.count=0,this.thisArg=i||this}return i(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(r.Subscriber)},23491:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.mapTo=function(e){return function(t){return t.lift(new o(e))}};var o=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.value))},e}(),a=function(e){function t(t,n){e.call(this,t),this.value=n}return i(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(r.Subscriber)},71177:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(94429);t.materialize=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){e.call(this,t)}return i(t,e),t.prototype._next=function(e){this.destination.next(o.Notification.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(o.Notification.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(o.Notification.createComplete()),e.complete()},t}(r.Subscriber)},33499:function(e,t,n){"use strict";var i=n(97369);t.max=function(e){return i.reduce("function"==typeof e?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t})}},56098:function(e,t,n){"use strict";var i=n(38781),r=n(38781);t.mergeStatic=r.merge,t.merge=function(){for(var e=[],t=0;t0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(o.OuterSubscriber);t.MergeMapSubscriber=s},6693:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.mergeMapTo=function(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"number"==typeof t&&(n=t,t=null),function(i){return i.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){void 0===n&&(n=Number.POSITIVE_INFINITY),this.ish=e,this.resultSelector=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.ish,this.resultSelector,this.concurrent))},e}();t.MergeMapToOperator=a;var s=function(e){function t(t,n,i,r){void 0===r&&(r=Number.POSITIVE_INFINITY),e.call(this,t),this.ish=n,this.resultSelector=i,this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(t,e),t.prototype._next=function(e){if(this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(r.OuterSubscriber);t.MergeMapToSubscriber=s},7550:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(33463),o=n(85814),a=n(93658),s=n(84308);t.mergeScan=function(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(i){return i.lift(new u(e,t,n))}};var u=function(){function e(e,t,n){this.accumulator=e,this.seed=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.accumulator,this.seed,this.concurrent))},e}();t.MergeScanOperator=u;var c=function(e){function t(t,n,i,r){e.call(this,t),this.accumulator=n,this.acc=i,this.concurrent=r,this.hasValue=!1,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(t,e),t.prototype._next=function(e){if(this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(s.OuterSubscriber);t.MergeScanSubscriber=c},51213:function(e,t,n){"use strict";var i=n(97369);t.min=function(e){return i.reduce("function"==typeof e?function(t,n){return e(t,n)<0?t:n}:function(e,t){return e=2?function(n){return a.pipe(i.scan(e,t),r.takeLast(1),o.defaultIfEmpty(t))(n)}:function(t){return a.pipe(i.scan(function(t,n,i){return e(t,n,i+1)}),r.takeLast(1))(t)}}},1694:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.refCount=function(){return function(e){return e.lift(new o(e))}};var o=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var i=new a(e,n),r=t.subscribe(i);return i.closed||(i.connection=n.connect()),r},e}(),a=function(e){function t(t,n){e.call(this,t),this.connectable=n}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,i=e._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null},t}(r.Subscriber)},15329:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(70481);t.repeat=function(e){return void 0===e&&(e=-1),function(t){return 0===e?new o.EmptyObservable:t.lift(new a(e<0?-1:e-1,t))}};var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.count,this.source))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.count=n,this.source=i}return i(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,n=this.count;if(0===n)return e.prototype.complete.call(this);n>-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(r.Subscriber)},63964:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(33463),a=n(85814),s=n(84308),u=n(93658);t.repeatWhen=function(e){return function(t){return t.lift(new c(e))}};var c=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,t))},e}(),l=function(e){function t(t,n,i){e.call(this,t),this.notifier=n,this.source=i,this.sourceIsBeingSubscribedTo=!0}return i(t,e),t.prototype.notifyNext=function(e,t,n,i,r){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(t){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=null),t&&(t.unsubscribe(),this.retriesSubscription=null),this.retries=null},t.prototype._unsubscribeAndRecycle=function(){var t=this,n=t.notifications,i=t.retries,r=t.retriesSubscription;return this.notifications=null,this.retries=null,this.retriesSubscription=null,e.prototype._unsubscribeAndRecycle.call(this),this.notifications=n,this.retries=i,this.retriesSubscription=r,this},t.prototype.subscribeToRetries=function(){this.notifications=new r.Subject;var t=o.tryCatch(this.notifier)(this.notifications);if(t===a.errorObject)return e.prototype.complete.call(this);this.retries=t,this.retriesSubscription=u.subscribeToResult(this,t)},t}(s.OuterSubscriber)},40241:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.retry=function(e){return void 0===e&&(e=-1),function(t){return t.lift(new o(e,t))}};var o=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.count,this.source))},e}(),a=function(e){function t(t,n,i){e.call(this,t),this.count=n,this.source=i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.source,i=this.count;if(0===i)return e.prototype.error.call(this,t);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},t}(r.Subscriber)},23896:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(33463),a=n(85814),s=n(84308),u=n(93658);t.retryWhen=function(e){return function(t){return t.lift(new c(e,t))}};var c=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,this.source))},e}(),l=function(e){function t(t,n,i){e.call(this,t),this.notifier=n,this.source=i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=null,this.retriesSubscription=null;else{if(n=new r.Subject,(i=o.tryCatch(this.notifier)(n))===a.errorObject)return e.prototype.error.call(this,a.errorObject.e);s=u.subscribeToResult(this,i)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=s,n.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=null),t&&(t.unsubscribe(),this.retriesSubscription=null),this.retries=null},t.prototype.notifyNext=function(e,t,n,i,r){var o=this,a=o.errors,s=o.retries,u=o.retriesSubscription;this.errors=null,this.retries=null,this.retriesSubscription=null,this._unsubscribeAndRecycle(),this.errors=a,this.retries=s,this.retriesSubscription=u,this.source.subscribe(this)},t}(s.OuterSubscriber)},92043:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.sample=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new s(e),i=t.subscribe(n);return i.add(o.subscribeToResult(n,this.notifier)),i},e}(),s=function(e){function t(){e.apply(this,arguments),this.hasValue=!1}return i(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(e,t,n,i,r){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(r.OuterSubscriber)},71239:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(90680);t.sampleTime=function(e,t){return void 0===t&&(t=o.async),function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.period,this.scheduler))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.period=n,this.scheduler=i,this.hasValue=!1,this.add(i.schedule(u,n,{subscriber:this,period:n}))}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(r.Subscriber);function u(e){var t=e.period;e.subscriber.notifyNext(),this.schedule(e,t)}},64949:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.scan=function(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new o(e,t,n))}};var o=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.accumulator,this.seed,this.hasSeed))},e}(),a=function(e){function t(t,n,i,r){e.call(this,t),this.accumulator=n,this._seed=i,this.hasSeed=r,this.index=0}return i(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(i){this.destination.error(i)}this.seed=t,this.destination.next(t)},t}(r.Subscriber)},88948:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(33463),a=n(85814);t.sequenceEqual=function(e,t){return function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.compareTo=e,this.comparor=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.compareTo,this.comparor))},e}();t.SequenceEqualOperator=s;var u=function(e){function t(t,n,i){e.call(this,t),this.compareTo=n,this.comparor=i,this._a=[],this._b=[],this._oneComplete=!1,this.add(n.subscribe(new c(t,this)))}return i(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t.prototype.checkValues=function(){for(var e=this,t=e._a,n=e._b,i=e.comparor;t.length>0&&n.length>0;){var r=t.shift(),s=n.shift(),u=!1;i?(u=o.tryCatch(i)(r,s))===a.errorObject&&this.destination.error(a.errorObject.e):u=r===s,u||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t}(r.Subscriber);t.SequenceEqualSubscriber=u;var c=function(e){function t(t,n){e.call(this,t),this.parent=n}return i(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent._complete()},t}(r.Subscriber)},35473:function(e,t,n){"use strict";var i=n(27372),r=n(1694),o=n(2369);function a(){return new o.Subject}t.share=function(){return function(e){return r.refCount()(i.multicast(a)(e))}}},62704:function(e,t,n){"use strict";var i=n(81959);t.shareReplay=function(e,t,n){return function(r){return r.lift(function(e,t,n){var r,o,a=0,s=!1,u=!1;return function(c){a++,(!r||s)&&(s=!1,r=new i.ReplaySubject(e,t,n),o=c.subscribe({next:function(e){r.next(e)},error:function(e){s=!0,r.error(e)},complete:function(){u=!0,r.complete()}}));var l=r.subscribe(this);return function(){a--,l.unsubscribe(),o&&0===a&&u&&o.unsubscribe()}}}(e,t,n))}}},92223:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(44640);t.single=function(e){return function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.predicate=n,this.source=i,this.seenValue=!1,this.index=0}return i(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(n){this.destination.error(n)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new o.EmptyError)},t}(r.Subscriber)},11189:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.skip=function(e){return function(t){return t.lift(new o(e))}};var o=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.total))},e}(),a=function(e){function t(t,n){e.call(this,t),this.total=n,this.count=0}return i(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(r.Subscriber)},73346:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(11758);t.skipLast=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(0===this._skipCount?new r.Subscriber(e):new s(e,this._skipCount))},e}(),s=function(e){function t(t,n){e.call(this,t),this._skipCount=n,this._count=0,this._ring=new Array(n)}return i(t,e),t.prototype._next=function(e){var t=this._skipCount,n=this._count++;if(n1?new i.ArrayObservable(e,n):new o.EmptyObservable(n),t)}}},10118:function(e,t,n){"use strict";var i=n(82966);t.subscribeOn=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new r(e,t))}};var r=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new i.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(e)},e}()},77243:function(e,t,n){"use strict";var i=n(18483),r=n(5027);t.switchAll=function(){return i.switchMap(r.identity)}},18483:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.switchMap=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.resultSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.resultSelector))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.project=n,this.resultSelector=i,this.index=0}return i(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(i){return void this.destination.error(i)}this._innerSub(t,e,n)},t.prototype._innerSub=function(e,t,n){var i=this.innerSubscription;i&&i.unsubscribe(),this.add(this.innerSubscription=o.subscribeToResult(this,e,t,n))},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.innerSubscription=null},t.prototype.notifyComplete=function(t){this.remove(t),this.innerSubscription=null,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,i,r){this.resultSelector?this._tryNotifyNext(e,t,n,i):this.destination.next(t)},t.prototype._tryNotifyNext=function(e,t,n,i){var r;try{r=this.resultSelector(e,t,n,i)}catch(o){return void this.destination.error(o)}this.destination.next(r)},t}(r.OuterSubscriber)},10684:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.switchMapTo=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.observable=e,this.resultSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.observable,this.resultSelector))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.inner=n,this.resultSelector=i,this.index=0}return i(t,e),t.prototype._next=function(e){var t=this.innerSubscription;t&&t.unsubscribe(),this.add(this.innerSubscription=o.subscribeToResult(this,this.inner,e,this.index++))},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.innerSubscription=null},t.prototype.notifyComplete=function(t){this.remove(t),this.innerSubscription=null,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,i,r){var o=this.destination;this.resultSelector?this.tryResultSelector(e,t,n,i):o.next(t)},t.prototype.tryResultSelector=function(e,t,n,i){var r,o=this.resultSelector,a=this.destination;try{r=o(e,t,n,i)}catch(s){return void a.error(s)}a.next(r)},t}(r.OuterSubscriber)},44396:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(11758),a=n(70481);t.take=function(e){return function(t){return 0===e?new a.EmptyObservable:t.lift(new s(e))}};var s=function(){function e(e){if(this.total=e,this.total<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){e.call(this,t),this.total=n,this.count=0}return i(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(r.Subscriber)},73935:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(11758),a=n(70481);t.takeLast=function(e){return function(t){return 0===e?new a.EmptyObservable:t.lift(new s(e))}};var s=function(){function e(e){if(this.total=e,this.total<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){e.call(this,t),this.total=n,this.ring=new Array,this.count=0}return i(t,e),t.prototype._next=function(e){var t=this.ring,n=this.total,i=this.count++;t.length0)for(var n=this.count>=this.total?this.total:this.count,i=this.ring,r=0;r0?this.startWindowEvery:this.windowSize,n=this.destination,i=this.windowSize,r=this.windows,a=r.length,s=0;s=0&&u%t==0&&!this.closed&&r.shift().complete(),++this.count%t==0&&!this.closed){var c=new o.Subject;r.push(c),n.next(c)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(r.Subscriber)},42603:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(90680),a=n(42109),s=n(39479),u=n(41503);t.windowTime=function(e){var t=o.async,n=null,i=Number.POSITIVE_INFINITY;return u.isScheduler(arguments[3])&&(t=arguments[3]),u.isScheduler(arguments[2])?t=arguments[2]:s.isNumeric(arguments[2])&&(i=arguments[2]),u.isScheduler(arguments[1])?t=arguments[1]:s.isNumeric(arguments[1])&&(n=arguments[1]),function(r){return r.lift(new c(e,n,i,t))}};var c=function(){function e(e,t,n,i){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=n,this.scheduler=i}return e.prototype.call=function(e,t){return t.subscribe(new h(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),l=function(e){function t(){e.apply(this,arguments),this._numberOfNextedValues=0}return i(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(r.Subject),h=function(e){function t(t,n,i,r,o){e.call(this,t),this.destination=t,this.windowTimeSpan=n,this.windowCreationInterval=i,this.maxWindowSize=r,this.scheduler=o,this.windows=[];var a=this.openWindow();if(null!==i&&i>=0){var s={windowTimeSpan:n,windowCreationInterval:i,subscriber:this,scheduler:o};this.add(o.schedule(p,n,{subscriber:this,window:a,context:null})),this.add(o.schedule(d,i,s))}else this.add(o.schedule(f,n,{subscriber:this,window:a,windowTimeSpan:n}))}return i(t,e),t.prototype._next=function(e){for(var t=this.windows,n=t.length,i=0;i=this.maxWindowSize&&this.closeWindow(r))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new l;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(a.Subscriber);function f(e){var t=e.subscriber,n=e.windowTimeSpan,i=e.window;i&&t.closeWindow(i),e.window=t.openWindow(),this.schedule(e,n)}function d(e){var t=e.windowTimeSpan,n=e.subscriber,i=e.scheduler,r=e.windowCreationInterval,o=n.openWindow(),a=this,s={action:a,subscription:null};s.subscription=i.schedule(p,t,{subscriber:n,window:o,context:s}),a.add(s.subscription),a.schedule(e,r)}function p(e){var t=e.subscriber,n=e.window,i=e.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),t.closeWindow(n)}},59048:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(72293),a=n(33463),s=n(85814),u=n(84308),c=n(93658);t.windowToggle=function(e,t){return function(n){return n.lift(new l(e,t))}};var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new h(e,this.openings,this.closingSelector))},e}(),h=function(e){function t(t,n,i){e.call(this,t),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(this.openSubscription=c.subscribeToResult(this,n,n))}return i(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var n=t.length,i=0;i0){var a=o.indexOf(n);-1!==a&&o.splice(a,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(r.OuterSubscriber)},9477:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(96177),o=n(48242),a=n(42109),s=n(84308),u=n(93658),c=n(72121);function l(){for(var e=[],t=0;tthis.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),v=function(e){function t(t,n,i){e.call(this,t),this.parent=n,this.observable=i,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return i(t,e),t.prototype[c.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e,t,n,i,r){this.buffer.push(t),this.parent.checkIterators()},t.prototype.subscribe=function(e,t){return u.subscribeToResult(this,this.observable,this,t)},t}(s.OuterSubscriber)},33310:function(e,t,n){"use strict";var i=n(9477);t.zipAll=function(e){return function(t){return t.lift(new i.ZipOperator(e))}}},28101:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t,n){e.call(this)}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(72293).Subscription);t.Action=r},67529:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(12624),o=n(95018),a=function(e){function t(t,n){e.call(this,t,n),this.scheduler=t,this.work=n}return i(t,e),t.prototype.requestAsyncId=function(t,n,i){return void 0===i&&(i=0),null!==i&&i>0?e.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t.scheduled||(t.scheduled=o.AnimationFrame.requestAnimationFrame(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,i);0===t.actions.length&&(o.AnimationFrame.cancelAnimationFrame(n),t.scheduled=void 0)},t}(r.AsyncAction);t.AnimationFrameAction=a},68909:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(){e.apply(this,arguments)}return i(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,i=-1,r=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++i0?e.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t.scheduled||(t.scheduled=r.Immediate.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,i);0===t.actions.length&&(r.Immediate.clearImmediate(n),t.scheduled=void 0)},t}(n(12624).AsyncAction);t.AsapAction=o},25766:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(){e.apply(this,arguments)}return i(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,i=-1,r=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++i0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,i):t.flush(this)},t}(n(12624).AsyncAction);t.QueueAction=r},77373:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(){e.apply(this,arguments)}return i(t,e),t}(n(42704).AsyncScheduler);t.QueueScheduler=r},18353:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(12624),o=function(e){function t(t,n){var i=this;void 0===t&&(t=a),void 0===n&&(n=Number.POSITIVE_INFINITY),e.call(this,t,function(){return i.frame}),this.maxFrames=n,this.frame=0,this.index=-1}return i(t,e),t.prototype.flush=function(){for(var e,t,n=this.actions,i=this.maxFrames;(t=n.shift())&&(this.frame=t.delay)<=i&&!(e=t.execute(t.state,t.delay)););if(e){for(;t=n.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(n(42704).AsyncScheduler);t.VirtualTimeScheduler=o;var a=function(e){function t(t,n,i){void 0===i&&(i=t.index+=1),e.call(this,t,n),this.scheduler=t,this.work=n,this.index=i,this.active=!0,this.index=t.index=i}return i(t,e),t.prototype.schedule=function(n,i){if(void 0===i&&(i=0),!this.id)return e.prototype.schedule.call(this,n,i);this.active=!1;var r=new t(this.scheduler,this.work);return this.add(r),r.schedule(n,i)},t.prototype.requestAsyncId=function(e,n,i){void 0===i&&(i=0),this.delay=e.frame+i;var r=e.actions;return r.push(this),r.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,n){void 0===n&&(n=0)},t.prototype._execute=function(t,n){if(!0===this.active)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(r.AsyncAction);t.VirtualAction=a},12948:function(e,t,n){"use strict";var i=n(67529),r=n(68909);t.animationFrame=new r.AnimationFrameScheduler(i.AnimationFrameAction)},85522:function(e,t,n){"use strict";var i=n(3496),r=n(25766);t.asap=new r.AsapScheduler(i.AsapAction)},90680:function(e,t,n){"use strict";var i=n(12624),r=n(42704);t.async=new r.AsyncScheduler(i.AsyncAction)},97088:function(e,t,n){"use strict";var i=n(7100),r=n(77373);t.queue=new r.QueueScheduler(i.QueueAction)},72121:function(e,t,n){"use strict";var i=n(80019);function r(e){var t=e.Symbol;if("function"==typeof t)return t.iterator||(t.iterator=t("iterator polyfill")),t.iterator;var n=e.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var i=e.Map;if(i)for(var r=Object.getOwnPropertyNames(i.prototype),o=0;o0;)t.shift().setup();e.prototype.flush.call(this);for(var n=this.flushTests.filter(function(e){return e.ready});n.length>0;){var i=n.shift();this.assertDeepEqual(i.actual,i.expected)}},t.parseMarblesAsSubscriptions=function(e){if("string"!=typeof e)return new u.SubscriptionLog(Number.POSITIVE_INFINITY);for(var t=e.length,n=-1,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=0;o-1?n:a;break;case"!":if(r!==Number.POSITIVE_INFINITY)throw new Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");r=n>-1?n:a;break;default:throw new Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+s+"'.")}}return r<0?new u.SubscriptionLog(i):new u.SubscriptionLog(i,r)},t.parseMarbles=function(e,t,n,i){if(void 0===i&&(i=!1),-1!==e.indexOf("!"))throw new Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var r=e.length,s=[],u=e.indexOf("^"),c=-1===u?0:u*-this.frameTimeFactor,l="object"!=typeof t?function(e){return e}:function(e){return i&&t[e]instanceof a.ColdObservable?t[e].messages:t[e]},h=-1,f=0;f-1?h:d,notification:p})}return s},t}(c.VirtualTimeScheduler);t.TestScheduler=l},95018:function(e,t,n){"use strict";var i=n(80019),r=function(e){e.requestAnimationFrame?(this.cancelAnimationFrame=e.cancelAnimationFrame.bind(e),this.requestAnimationFrame=e.requestAnimationFrame.bind(e)):e.mozRequestAnimationFrame?(this.cancelAnimationFrame=e.mozCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.mozRequestAnimationFrame.bind(e)):e.webkitRequestAnimationFrame?(this.cancelAnimationFrame=e.webkitCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.webkitRequestAnimationFrame.bind(e)):e.msRequestAnimationFrame?(this.cancelAnimationFrame=e.msCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.msRequestAnimationFrame.bind(e)):e.oRequestAnimationFrame?(this.cancelAnimationFrame=e.oCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.oRequestAnimationFrame.bind(e)):(this.cancelAnimationFrame=e.clearTimeout.bind(e),this.requestAnimationFrame=function(t){return e.setTimeout(t,1e3/60)})};t.RequestAnimationFrameDefinition=r,t.AnimationFrame=new r(i.root)},11758:function(e,t){"use strict";var n=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},i=function(e){function t(){var t=e.call(this,"argument out of range");this.name=t.name="ArgumentOutOfRangeError",this.stack=t.stack,this.message=t.message}return n(t,e),t}(Error);t.ArgumentOutOfRangeError=i},44640:function(e,t){"use strict";var n=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},i=function(e){function t(){var t=e.call(this,"no elements in sequence");this.name=t.name="EmptyError",this.stack=t.stack,this.message=t.message}return n(t,e),t}(Error);t.EmptyError=i},30764:function(e,t){"use strict";var n=function(){function e(){this.values={}}return e.prototype.delete=function(e){return this.values[e]=null,!0},e.prototype.set=function(e,t){return this.values[e]=t,this},e.prototype.get=function(e){return this.values[e]},e.prototype.forEach=function(e,t){var n=this.values;for(var i in n)n.hasOwnProperty(i)&&null!==n[i]&&e.call(t,n[i],i)},e.prototype.clear=function(){this.values={}},e}();t.FastMap=n},42982:function(e,t,n){"use strict";var i=n(80019),r=function(){function e(e){if(this.root=e,e.setImmediate&&"function"==typeof e.setImmediate)this.setImmediate=e.setImmediate.bind(e),this.clearImmediate=e.clearImmediate.bind(e);else{this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.setImmediate=this.canUseProcessNextTick()?this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.createReadyStateChangeSetImmediate():this.createSetTimeoutSetImmediate();var t=function e(t){delete e.instance.tasksByHandle[t]};t.instance=this,this.clearImmediate=t}}return e.prototype.identify=function(e){return this.root.Object.prototype.toString.call(e)},e.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)},e.prototype.canUseMessageChannel=function(){return Boolean(this.root.MessageChannel)},e.prototype.canUseReadyStateChange=function(){var e=this.root.document;return Boolean(e&&"onreadystatechange"in e.createElement("script"))},e.prototype.canUsePostMessage=function(){var e=this.root;if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}return!1},e.prototype.partiallyApplied=function(e){for(var t=[],n=1;n=0}},1856:function(e,t){"use strict";t.isObject=function(e){return null!=e&&"object"==typeof e}},35130:function(e,t){"use strict";t.isPromise=function(e){return e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},41503:function(e,t){"use strict";t.isScheduler=function(e){return e&&"function"==typeof e.schedule}},68668:function(e,t){"use strict";t.noop=function(){}},67239:function(e,t){"use strict";t.not=function(e,t){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=e,n.thisArg=t,n}},10142:function(e,t,n){"use strict";var i=n(68668);function r(e){return e?1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}:i.noop}t.pipe=function(){for(var e=[],t=0;t=n?{done:!0}:{done:!1,value:e[i++]}})},t.empty=function(){var e=new t(null);return e.done=!0,e},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},97310:function(e,t,n){"use strict";var i=n(61948);Object.defineProperty(t,"__esModule",{value:!0}),t.isMobile=function(){return void 0!==r.window.orientation},t.default=function(e){if(!e&&!(0,o.default)())return"Node";if((0,a.default)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),s=-1!==n.indexOf("Trident/");return i||s?"IE":r.window.chrome?"Chrome":r.window.safari?"Safari":r.window.mozInnerScreenX?"Firefox":"Unknown"};var r=n(41151),o=i(n(61602)),a=i(n(22344))},41151:function(e,t,n){"use strict";var i=n(61948);Object.defineProperty(t,"__esModule",{value:!0}),t.console=t.process=t.document=t.global=t.window=t.self=void 0;var r=i(n(34321)),o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&process};t.self=o.self||o.window||o.global,t.window=o.window||o.self||o.global,t.global=o.global||o.self||o.window,t.document=o.document||{},t.process=o.process||{};var a=console;t.console=a},84761:function(e,t,n){"use strict";var i=n(61948),r=n(34321);Object.defineProperty(t,"CO",{enumerable:!0,get:function(){return o.global}}),Object.defineProperty(t,"jU",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"qs",{enumerable:!0,get:function(){return s.default}});var o=n(41151),a=c(n(61602)),s=c(n(97310));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}i(n(22344))},61602:function(e,t,n){"use strict";var i=n(61948);Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.isBrowserMainThread=function(){return a()&&"undefined"!=typeof document};var r=i(n(34321)),o=i(n(22344));function a(){return!("object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,o.default)()}},22344:function(e,t,n){"use strict";var i=n(61948);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("undefined"!=typeof window&&"object"===(0,r.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,r.default)(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":(0,r.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||t;return!!(n&&n.indexOf("Electron")>=0)};var r=i(n(34321))},86991:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(14180),t),r(n(75103),t),r(n(48965),t),r(n(32595),t),r(n(82417),t),r(n(92451),t),r(n(17735),t)},14180:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=function(){function e(t){m(this,e),this.termType="BlankNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}]),e}()},75103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;var i=n(14180),r=n(48965),o=n(32595),a=n(82417),s=n(92451),u=n(17735),c=0;t.DataFactory=function(){function e(t){m(this,e),this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||"df_".concat(c++,"_")}return b(e,[{key:"namedNode",value:function(e){return new a.NamedNode(e)}},{key:"blankNode",value:function(e){return new i.BlankNode(e||"".concat(this.blankNodePrefix).concat(this.blankNodeCounter++))}},{key:"literal",value:function(e,t){return new o.Literal(e,t)}},{key:"variable",value:function(e){return new u.Variable(e)}},{key:"defaultGraph",value:function(){return r.DefaultGraph.INSTANCE}},{key:"quad",value:function(e,t,n,i){return new s.Quad(e,t,n,i||this.defaultGraph())}},{key:"fromTerm",value:function(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(o.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}},{key:"fromQuad",value:function(e){return this.fromTerm(e)}},{key:"resetBlankNodeCounter",value:function(){this.blankNodeCounter=0}}]),e}()},48965:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;var n=function(){function e(){m(this,e),this.termType="DefaultGraph",this.value=""}return b(e,[{key:"equals",value:function(e){return!!e&&"DefaultGraph"===e.termType}}]),e}();t.DefaultGraph=n,n.INSTANCE=new n},32595:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;var i=n(82417),r=function(){function e(t,n){m(this,e),this.termType="Literal",this.value=t,"string"==typeof n?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING):n?(this.language="",this.datatype=n):(this.language="",this.datatype=e.XSD_STRING)}return b(e,[{key:"equals",value:function(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}]),e}();t.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=function(){function e(t){m(this,e),this.termType="NamedNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}]),e}()},92451:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=function(){function e(t,n,i,r){m(this,e),this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=i,this.graph=r}return b(e,[{key:"equals",value:function(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}]),e}()},17735:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=function(){function e(t){m(this,e),this.termType="Variable",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}]),e}()},31609:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedJavaScriptPrimitives=t.getSupportedRdfDatatypes=t.getTermRaw=t.toRdf=t.fromRdf=void 0;var o=n(86991),a=n(9938),s=n(66060);r(n(9938),t),r(n(88871),t),r(n(66060),t);var u=new o.DataFactory,c=new s.Translator;function l(e,t){return c.fromRdf(e,t)}c.registerHandler(new a.TypeHandlerString,a.TypeHandlerString.TYPES.map(function(e){return u.namedNode(e)}),["string"]),c.registerHandler(new a.TypeHandlerBoolean,[a.TypeHandlerBoolean.TYPE].map(function(e){return u.namedNode(e)}),["boolean"]),c.registerHandler(new a.TypeHandlerNumberDouble,a.TypeHandlerNumberDouble.TYPES.map(function(e){return u.namedNode(e)}),["number"]),c.registerHandler(new a.TypeHandlerNumberInteger,a.TypeHandlerNumberInteger.TYPES.map(function(e){return u.namedNode(e)}),["number"]),c.registerHandler(new a.TypeHandlerDate,a.TypeHandlerDate.TYPES.map(function(e){return u.namedNode(e)}),["object"]),t.fromRdf=l,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=u),c.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?l(e,t):e.value},t.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66060:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=function(){function e(){m(this,e),this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}return b(e,[{key:"registerHandler",value:function(e,t,n){var i,r=_(t);try{for(r.s();!(i=r.n()).done;){var o=i.value;this.supportedRdfDatatypes.push(o),this.fromRdfHandlers[o.value]=e}}catch(l){r.e(l)}finally{r.f()}var a,s=_(n);try{for(s.s();!(a=s.n()).done;){var u=a.value,c=this.toRdfHandlers[u];c||(this.toRdfHandlers[u]=c=[]),c.push(e)}}catch(l){s.e(l)}finally{s.f()}}},{key:"fromRdf",value:function(e,t){var n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}},{key:"toRdf",value:function(e,t){var n=this.toRdfHandlers[typeof e];if(n){var i,r=_(n);try{for(r.s();!(i=r.n()).done;){var o=i.value.toRdf(e,t);if(o)return o}}catch(a){r.e(a)}finally{r.f()}}throw new Error("Invalid JavaScript value: '".concat(e,"'"))}},{key:"getSupportedRdfDatatypes",value:function(){return this.supportedRdfDatatypes}},{key:"getSupportedJavaScriptPrimitives",value:function(){return Object.keys(this.toRdfHandlers)}}],[{key:"incorrectRdfDataType",value:function(e){throw new Error("Invalid RDF ".concat(e.datatype.value," value: '").concat(e.value,"'"))}}]),e}()},80727:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;var i=n(66060),r=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&i.Translator.incorrectRdfDataType(e),!1}},{key:"toRdf",value:function(t,n){var i=n.datatype,r=n.dataFactory;return r.literal(t?"true":"false",i||r.namedNode(e.TYPE))}}]),e}();t.TypeHandlerBoolean=r,r.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;var i=n(66060),r=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(t,n){switch(n&&!t.value.match(e.VALIDATORS[t.datatype.value.substr(33,t.datatype.value.length)])&&i.Translator.incorrectRdfDataType(t),t.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(t.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":var r=t.value.split("-");return new Date(0,parseInt(r[0],10)-1,parseInt(r[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(t.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(t.value+"-01");default:return new Date(t.value)}}},{key:"toRdf",value:function(t,n){var i=n.datatype,r=n.dataFactory;if(i=i||r.namedNode(e.TYPES[0]),!(t instanceof Date))return null;var o,a=t;switch(i.value){case"http://www.w3.org/2001/XMLSchema#gDay":o=String(a.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":o=a.getUTCMonth()+1+"-"+a.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":o=String(a.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":o=a.getUTCFullYear()+"-"+(a.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":o=a.toISOString().replace(/T.*$/,"");break;default:o=a.toISOString()}return r.literal(o,i)}}]),e}();t.TypeHandlerDate=r,r.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"],r.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]$/}},38554:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;var i=n(66060),r=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){var n=parseFloat(e.value);return t&&isNaN(n)&&i.Translator.incorrectRdfDataType(e),n}},{key:"toRdf",value:function(t,n){var i=n.datatype,r=n.dataFactory;return i=i||r.namedNode(e.TYPES[0]),isNaN(t)?r.literal("NaN",i):isFinite(t)?t%1==0?null:r.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),i):r.literal(t>0?"INF":"-INF",i)}}]),e}();t.TypeHandlerNumberDouble=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;var i=n(66060),r=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){var n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&i.Translator.incorrectRdfDataType(e),n}},{key:"toRdf",value:function(t,n){var i=n.datatype,r=n.dataFactory;return r.literal(String(t),i||r.namedNode(t<=e.MAX_INT&&t>=e.MIN_INT?e.TYPES[0]:e.TYPES[1]))}}]),e}();t.TypeHandlerNumberInteger=r,r.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"],r.MAX_INT=2147483647,r.MIN_INT=-2147483648},14608:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;var n=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(e){return e.value}},{key:"toRdf",value:function(e,t){var n=t.datatype;return t.dataFactory.literal(e,n)}}]),e}();t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(80727),t),r(n(52525),t),r(n(38554),t),r(n(37750),t),r(n(14608),t)},35090:function(n,i,r){"use strict";var f,d,g,y,w,k,x,S,E,C,O,T=regeneratorRuntime.mark(cL),P={};r.r(P),r.d(P,{decode:function(){return nL},encode:function(){return rL}});var R={};r.r(R),r.d(R,{decode:function(){return lL},encode:function(){return fL}});var D={};r.r(D),r.d(D,{decode:function(){return dL},encode:function(){return vL}});var N={};function L(e){return"function"==typeof e}r.r(N),r.d(N,{decode:function(){return mL},encode:function(){return bL}});var j=!1,F={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){var t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else j&&console.log("RxJS: Back to a better error behavior. Thank you. <3");j=e},get useDeprecatedSynchronousErrorHandling(){return j}};function B(e){setTimeout(function(){throw e},0)}var V={closed:!0,next:function(e){},error:function(e){if(F.useDeprecatedSynchronousErrorHandling)throw e;B(e)},complete:function(){}},z=Array.isArray||function(e){return e&&"number"==typeof e.length};function U(e){return null!==e&&"object"==typeof e}var H,G=function(){function e(e){return Error.call(this),this.message=e?"".concat(e.length," errors occurred during unsubscription:\n").concat(e.map(function(e,t){return"".concat(t+1,") ").concat(e.toString())}).join("\n ")):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),W=function(){function e(t){m(this,e),this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return b(e,[{key:"unsubscribe",value:function(){var t;if(!this.closed){var n=this._parentOrParents,i=this._ctorUnsubscribe,r=this._unsubscribe,o=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:Number.POSITIVE_INFINITY;return"function"==typeof t?function(i){return i.pipe(we(function(n,i){return me(e(n,i)).pipe(ue(function(e,r){return t(n,e,i,r)}))},n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new ke(e,n))})}var ke=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY;m(this,e),this.project=t,this.concurrent=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new xe(e,this.project,this.concurrent))}}]),e}(),xe=function(e){a(n,e);var t=s(n);function n(e,i){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.POSITIVE_INFINITY;return m(this,n),(r=t.call(this,e)).project=i,r.concurrent=o,r.hasCompleted=!1,r.buffer=[],r.active=0,r.index=0,r}return b(n,[{key:"_next",value:function(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}]),n}(be);function Se(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;return we($,e)}function Ee(e,t){return t?ge(e,t):new ee(he(e))}function Ce(){for(var e=arguments.length,t=new Array(e),n=0;n1&&"number"==typeof t[t.length-1]&&(i=t.pop())):"number"==typeof o&&(i=t.pop()),null===r&&1===t.length&&t[0]instanceof ee?t[0]:Se(i)(Ee(t,r))}function Oe(){return function(e){return e.lift(new Te(e))}}var Te=function(){function e(t){m(this,e),this.connectable=t}return b(e,[{key:"call",value:function(e,t){var n=this.connectable;n._refCount++;var i=new Ae(e,n),r=t.subscribe(i);return i.closed||(i.connection=n.connect()),r}}]),e}(),Ae=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).connectable=i,r}return b(n,[{key:"_unsubscribe",value:function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,i=e._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null}}]),n}(Y),Pe=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this)).source=e,r.subjectFactory=i,r._refCount=0,r._isComplete=!1,r}return b(n,[{key:"_subscribe",value:function(e){return this.getSubject().subscribe(e)}},{key:"getSubject",value:function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}},{key:"connect",value:function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new W).add(this.source.subscribe(new Ie(this.getSubject(),this))),e.closed&&(this._connection=null,e=W.EMPTY)),e}},{key:"refCount",value:function(){return Oe()(this)}}]),n}(ee),Me=function(){var e=Pe.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}(),Ie=function(t){a(i,t);var n=s(i);function i(e,t){var r;return m(this,i),(r=n.call(this,e)).connectable=t,r}return b(i,[{key:"_error",value:function(t){this._unsubscribe(),e(p(i.prototype),"_error",this).call(this,t)}},{key:"_complete",value:function(){this.connectable._isComplete=!0,this._unsubscribe(),e(p(i.prototype),"_complete",this).call(this)}},{key:"_unsubscribe",value:function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}]),i}(re);function Re(e,t){return function(n){var i;if(i="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new De(i,t));var r=Object.create(n,Me);return r.source=n,r.subjectFactory=i,r}}var De=function(){function e(t,n){m(this,e),this.subjectFactory=t,this.selector=n}return b(e,[{key:"call",value:function(e,t){var n=this.selector,i=this.subjectFactory(),r=n(i).subscribe(e);return r.add(t.subscribe(i)),r}}]),e}();function Ne(){return new oe}function Le(){return function(e){return Oe()(Re(Ne)(e))}}function je(e){for(var t in e)if(e[t]===je)return t;throw Error("Could not find renamed property on target object.")}function Fe(e,t){for(var n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function Be(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Be).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return"".concat(e.overriddenName);if(e.name)return"".concat(e.name);var t=e.toString();if(null==t)return""+t;var n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function Ve(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}var ze=je({__forward_ref__:je});function Ue(e){return e.__forward_ref__=Ue,e.toString=function(){return Be(this())},e}function He(e){return Ge(e)?e():e}function Ge(e){return"function"==typeof e&&e.hasOwnProperty(ze)&&e.__forward_ref__===Ue}var We=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,function(e,t){return"".concat(e?"NG0".concat(e,": "):"").concat(t)}(e,i))).code=e,r}return n}(l(Error));function qe(e){return"string"==typeof e?e:null==e?"":String(e)}function Xe(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():qe(e)}function Ye(e,t){var n=t?" in ".concat(t):"";throw new We("201","No provider for ".concat(Xe(e)," found").concat(n))}function Ke(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Qe(e){return{providers:e.providers||[],imports:e.imports||[]}}function $e(e){return Ze(e,tt)||Ze(e,it)}function Ze(e,t){return e.hasOwnProperty(t)?e[t]:null}function Je(e){return e&&(e.hasOwnProperty(nt)||e.hasOwnProperty(rt))?e[nt]:null}var et,tt=je({"\u0275prov":je}),nt=je({"\u0275inj":je}),it=je({ngInjectableDef:je}),rt=je({ngInjectorDef:je}),ot=((ot=ot||{})[ot.Default=0]="Default",ot[ot.Host=1]="Host",ot[ot.Self=2]="Self",ot[ot.SkipSelf=4]="SkipSelf",ot[ot.Optional=8]="Optional",ot);function at(e){var t=et;return et=e,t}function st(e,t,n){var i=$e(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&ot.Optional?null:void 0!==t?t:void Ye(Be(e),"Injector")}function ut(e){return{toString:e}.toString()}var ct=((ct=ct||{})[ct.OnPush=0]="OnPush",ct[ct.Default=1]="Default",ct),lt=((lt=lt||{})[lt.Emulated=0]="Emulated",lt[lt.None=2]="None",lt[lt.ShadowDom=3]="ShadowDom",lt),ht="undefined"!=typeof globalThis&&globalThis,ft="undefined"!=typeof window&&window,dt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,pt="undefined"!=typeof global&&global,vt=ht||pt||ft||dt,gt={},mt=[],yt=je({"\u0275cmp":je}),bt=je({"\u0275dir":je}),_t=je({"\u0275pipe":je}),wt=je({"\u0275mod":je}),kt=je({"\u0275loc":je}),xt=je({"\u0275fac":je}),St=je({__NG_ELEMENT_ID__:je}),Et=0;function Ct(e){return ut(function(){var t={},n={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===ct.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors||mt,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||lt.Emulated,id:"c",styles:e.styles||mt,_:null,setInput:null,schemas:e.schemas||null,tView:null},i=e.directives,r=e.features,o=e.pipes;return n.id+=Et++,n.inputs=Mt(e.inputs,t),n.outputs=Mt(e.outputs),r&&r.forEach(function(e){return e(n)}),n.directiveDefs=i?function(){return("function"==typeof i?i():i).map(Ot)}:null,n.pipeDefs=o?function(){return("function"==typeof o?o():o).map(Tt)}:null,n})}function Ot(e){return Rt(e)||function(e){return e[bt]||null}(e)}function Tt(e){return function(e){return e[_t]||null}(e)}var At={};function Pt(e){return ut(function(){var t={type:e.type,bootstrap:e.bootstrap||mt,declarations:e.declarations||mt,imports:e.imports||mt,exports:e.exports||mt,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null};return null!=e.id&&(At[e.id]=e.type),t})}function Mt(e,t){if(null==e)return gt;var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i],o=r;Array.isArray(r)&&(o=r[1],r=r[0]),n[r]=i,t&&(t[r]=o)}return n}var It=Ct;function Rt(e){return e[yt]||null}function Dt(e,t){var n=e[wt]||null;if(!n&&!0===t)throw new Error("Type ".concat(Be(e)," does not have '\u0275mod' property."));return n}function Nt(e){return Array.isArray(e)&&"object"==typeof e[1]}function Lt(e){return Array.isArray(e)&&!0===e[1]}function jt(e){return 0!=(8&e.flags)}function Ft(e){return 2==(2&e.flags)}function Bt(e){return 1==(1&e.flags)}function Vt(e){return null!==e.template}function zt(e){return 0!=(512&e[2])}function Ut(e,t){return e.hasOwnProperty(xt)?e[xt]:null}var Ht=function(){function e(t,n,i){m(this,e),this.previousValue=t,this.currentValue=n,this.firstChange=i}return b(e,[{key:"isFirstChange",value:function(){return this.firstChange}}]),e}();function Gt(){return Wt}function Wt(e){return e.type.prototype.ngOnChanges&&(e.setInput=Xt),qt}function qt(){var e=Kt(this),t=null==e?void 0:e.current;if(t){var n=e.previous;if(n===gt)e.previous=t;else for(var i in t)n[i]=t[i];e.current=null,this.ngOnChanges(t)}}function Xt(e,t,n,i){var r=Kt(e)||function(e,t){return e[Yt]=t}(e,{previous:gt,current:null}),o=r.current||(r.current={}),a=r.previous,s=this.declaredInputs[n],u=a[s];o[s]=new Ht(u&&u.currentValue,t,a===gt),e[i]=t}Gt.ngInherit=!0;var Yt="__ngSimpleChanges__";function Kt(e){return e[Yt]||null}var Qt,$t="http://www.w3.org/2000/svg";function Zt(){return void 0!==Qt?Qt:"undefined"!=typeof document?document:void 0}function Jt(e){return!!e.listen}var en={createRenderer:function(e,t){return Zt()}};function tn(e){for(;Array.isArray(e);)e=e[0];return e}function nn(e,t){return tn(t[e])}function rn(e,t){return tn(t[e.index])}function on(e,t){return e.data[t]}function an(e,t){return e[t]}function sn(e,t){var n=t[e];return Nt(n)?n:n[0]}function un(e){return 4==(4&e[2])}function cn(e){return 128==(128&e[2])}function ln(e,t){return null==t?null:e[t]}function hn(e){e[18]=0}function fn(e,t){e[5]+=t;for(var n=e,i=e[3];null!==i&&(1===t&&1===n[5]||-1===t&&0===n[5]);)i[5]+=t,n=i,i=i[3]}var dn={lFrame:Fn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function pn(){return dn.bindingsEnabled}function vn(){return dn.lFrame.lView}function gn(){return dn.lFrame.tView}function mn(e){return dn.lFrame.contextLView=e,e[8]}function yn(){for(var e=bn();null!==e&&64===e.type;)e=e.parent;return e}function bn(){return dn.lFrame.currentTNode}function _n(e,t){var n=dn.lFrame;n.currentTNode=e,n.isParent=t}function wn(){return dn.lFrame.isParent}function kn(){dn.lFrame.isParent=!1}function xn(){return dn.isInCheckNoChangesMode}function Sn(e){dn.isInCheckNoChangesMode=e}function En(){var e=dn.lFrame,t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Cn(){return dn.lFrame.bindingIndex}function On(){return dn.lFrame.bindingIndex++}function Tn(e){var t=dn.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function An(e,t){var n=dn.lFrame;n.bindingIndex=n.bindingRootIndex=e,Pn(t)}function Pn(e){dn.lFrame.currentDirectiveIndex=e}function Mn(e){var t=dn.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function In(){return dn.lFrame.currentQueryIndex}function Rn(e){dn.lFrame.currentQueryIndex=e}function Dn(e){var t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function Nn(e,t,n){if(n&ot.SkipSelf){for(var i=t,r=e;!(null!==(i=i.parent)||n&ot.Host||(i=Dn(r),null===i||(r=r[15],10&i.type))););if(null===i)return!1;t=i,e=r}var o=dn.lFrame=jn();return o.currentTNode=t,o.lView=e,!0}function Ln(e){var t=jn(),n=e[1];dn.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function jn(){var e=dn.lFrame,t=null===e?null:e.child;return null===t?Fn(e):t}function Fn(e){var t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function Bn(){var e=dn.lFrame;return dn.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}var Vn=Bn;function zn(){var e=Bn();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Un(){return dn.lFrame.selectedIndex}function Hn(e){dn.lFrame.selectedIndex=e}function Gn(){var e=dn.lFrame;return on(e.tView,e.selectedIndex)}function Wn(){dn.lFrame.currentNamespace=$t}function qn(e,t){for(var n=t.directiveStart,i=t.directiveEnd;n=i)break}else t[s]<0&&(e[18]+=65536),(a>11>16&&(3&e[2])===t){e[2]+=2048;try{o.call(a)}finally{}}}else try{o.call(a)}finally{}}var Zn=function e(t,n,i){m(this,e),this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=i};function Jn(e,t,n){for(var i=Jt(e),r=0;rt){a=o-1;break}}}for(;o>16}(e),i=t;n>0;)i=i[15],n--;return i}var si=!0;function ui(e){var t=si;return si=e,t}var ci=0;function li(e,t){var n=fi(e,t);if(-1!==n)return n;var i=t[1];i.firstCreatePass&&(e.injectorIndex=t.length,hi(i.data,e),hi(t,null),hi(i.blueprint,null));var r=di(e,t),o=e.injectorIndex;if(ri(r))for(var a=oi(r),s=ai(r,t),u=s[1].data,c=0;c<8;c++)t[o+c]=s[a+c]|u[a+c];return t[o+8]=r,o}function hi(e,t){e.push(0,0,0,0,0,0,0,0,t)}function fi(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function di(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;for(var n=0,i=null,r=t;null!==r;){var o=r[1],a=o.type;if(null===(i=2===a?o.declTNode:1===a?r[6]:null))return-1;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return-1}function pi(e,t,n){!function(e,t,n){var i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(St)&&(i=n[St]),null==i&&(i=n[St]=ci++);var r=255&i;t.data[e+(r>>5)]|=1<3&&void 0!==arguments[3]?arguments[3]:ot.Default,r=arguments.length>4?arguments[4]:void 0;if(null!==e){var o=function(e){if("string"==typeof e)return e.charCodeAt(0)||0;var t=e.hasOwnProperty(St)?e[St]:void 0;return"number"==typeof t?t>=0?255&t:bi:t}(n);if("function"==typeof o){if(!Nn(t,e,i))return i&ot.Host?vi(r,n,i):gi(t,n,i,r);try{var a=o(i);if(null!=a||i&ot.Optional)return a;Ye(n)}finally{Vn()}}else if("number"==typeof o){var s=null,u=fi(e,t),c=-1,l=i&ot.Host?t[16][6]:null;for((-1===u||i&ot.SkipSelf)&&(-1!==(c=-1===u?di(e,t):t[u+8])&&Si(i,!1)?(s=t[1],u=oi(c),t=ai(c,t)):u=-1);-1!==u;){var h=t[1];if(xi(o,u,h.data)){var f=_i(u,t,n,s,i,l);if(f!==yi)return f}-1!==(c=t[u+8])&&Si(i,t[1].data[u+8]===l)&&xi(o,u,t)?(s=h,u=oi(c),t=ai(c,t)):u=-1}}}return gi(t,n,i,r)}var yi={};function bi(){return new Ei(yn(),vn())}function _i(e,t,n,i,r,o){var a=t[1],s=a.data[e+8],u=wi(s,a,n,null==i?Ft(s)&&si:i!=a&&0!=(3&s.type),r&ot.Host&&o===s);return null!==u?ki(t,a,u,s):yi}function wi(e,t,n,i,r){for(var o=e.providerIndexes,a=t.data,s=1048575&o,u=e.directiveStart,c=o>>20,l=r?s+c:e.directiveEnd,h=i?s:s+c;h=u&&f.type===n)return h}if(r){var d=a[u];if(d&&Vt(d)&&d.type===n)return u}return null}function ki(e,t,n,i){var r=e[n],o=t.data;if(function(e){return e instanceof Zn}(r)){var a=r;a.resolving&&function(e,t){throw new We("200","Circular dependency in DI detected for ".concat(e))}(Xe(o[n]));var s=ui(a.canSeeViewProviders);a.resolving=!0;var u=a.injectImpl?at(a.injectImpl):null;Nn(e,i,ot.Default);try{r=e[n]=a.factory(void 0,o,e,i),t.firstCreatePass&&n>=i.directiveStart&&function(e,t,n){var i=t.type.prototype,r=i.ngOnChanges,o=i.ngOnInit,a=i.ngDoCheck;if(r){var s=Wt(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,s)}o&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,o),a&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,a),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,a))}(n,o[n],t)}finally{null!==u&&at(u),ui(s),a.resolving=!1,Vn()}}return r}function xi(e,t,n){return!!(n[t+(e>>5)]&1<=e.length?e.push(n):e.splice(t,0,n)}function Li(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function ji(e,t){for(var n=[],i=0;i=0?e[1|i]=n:function(e,t,n,i){var r=e.length;if(r==t)e.push(n,i);else if(1===r)e.push(i,e[0]),e[0]=n;else{for(r--,e.push(e[r-1],e[r]);r>t;)e[r]=e[r-2],r--;e[t]=n,e[t+1]=i}}(e,i=~i,t,n),i}function Bi(e,t){var n=Vi(e,t);if(n>=0)return e[1|n]}function Vi(e,t){return function(e,t,n){for(var i=0,r=e.length>>1;r!==i;){var o=i+(r-i>>1),a=e[o<<1];if(t===a)return o<<1;a>t?r=o:i=o+1}return~(r<<1)}(e,t)}var zi,Ui={},Hi="__NG_DI_FLAG__",Gi="ngTempTokenPath",Wi=/\n/gm,qi="__source",Xi=je({provide:String,useValue:je});function Yi(e){var t=zi;return zi=e,t}function Ki(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ot.Default;if(void 0===zi)throw new Error("inject() must be called from an injection context");return null===zi?st(e,void 0,t):zi.get(e,t&ot.Optional?null:void 0,t)}function Qi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ot.Default;return(et||Ki)(He(e),t)}var $i=Qi;function Zi(e){for(var t=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:null;e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.substr(2):e;var r=Be(t);if(Array.isArray(t))r=t.map(Be).join(" -> ");else if("object"==typeof t){var o=[];for(var a in t)if(t.hasOwnProperty(a)){var s=t[a];o.push(a+":"+("string"==typeof s?JSON.stringify(s):Be(s)))}r="{".concat(o.join(", "),"}")}return"".concat(n).concat(i?"("+i+")":"","[").concat(r,"]: ").concat(e.replace(Wi,"\n "))}("\n"+e.message,r,n,i),e.ngTokenPath=r,e[Gi]=null,e}var nr,ir,rr=Ji(Pi("Inject",function(e){return{token:e}}),-1),or=Ji(Pi("Optional"),8),ar=Ji(Pi("SkipSelf"),4);function sr(e){var t;return(null===(t=function(){if(void 0===nr&&(nr=null,vt.trustedTypes))try{nr=vt.trustedTypes.createPolicy("angular",{createHTML:function(e){return e},createScript:function(e){return e},createScriptURL:function(e){return e}})}catch(e){}return nr}())||void 0===t?void 0:t.createHTML(e))||e}function ur(){if(void 0===ir&&(ir=null,vt.trustedTypes))try{ir=vt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:function(e){return e},createScript:function(e){return e},createScriptURL:function(e){return e}})}catch(H){}return ir}function cr(e){var t;return(null===(t=ur())||void 0===t?void 0:t.createHTML(e))||e}function lr(e){var t;return(null===(t=ur())||void 0===t?void 0:t.createScriptURL(e))||e}var hr=function(){function e(t){m(this,e),this.changingThisBreaksApplicationSecurity=t}return b(e,[{key:"toString",value:function(){return"SafeValue must use [property]=binding: ".concat(this.changingThisBreaksApplicationSecurity," (see https://g.co/ng/security#xss)")}}]),e}(),fr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"HTML"}}]),n}(hr),dr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"Style"}}]),n}(hr),pr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"Script"}}]),n}(hr),vr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"URL"}}]),n}(hr),gr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"ResourceURL"}}]),n}(hr);function mr(e){return e instanceof hr?e.changingThisBreaksApplicationSecurity:e}function yr(e,t){var n=br(e);if(null!=n&&n!==t){if("ResourceURL"===n&&"URL"===t)return!0;throw new Error("Required a safe ".concat(t,", got a ").concat(n," (see https://g.co/ng/security#xss)"))}return n===t}function br(e){return e instanceof hr&&e.getTypeName()||null}var _r=function(){function e(t){m(this,e),this.inertDocumentHelper=t}return b(e,[{key:"getInertBodyElement",value:function(e){e=""+e;try{var t=(new window.DOMParser).parseFromString(sr(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}]),e}(),wr=function(){function e(t){if(m(this,e),this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){var n=this.inertDocument.createElement("html");this.inertDocument.appendChild(n);var i=this.inertDocument.createElement("body");n.appendChild(i)}}return b(e,[{key:"getInertBodyElement",value:function(e){var t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=sr(e),t;var n=this.inertDocument.createElement("body");return n.innerHTML=sr(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}},{key:"stripCustomNsAttrs",value:function(e){for(var t=e.attributes,n=t.length-1;0"),!0}},{key:"endElement",value:function(e){var t=e.nodeName.toLowerCase();Ir.hasOwnProperty(t)&&!Ar.hasOwnProperty(t)&&(this.buf.push(""))}},{key:"chars",value:function(e){this.buf.push(Vr(e))}},{key:"checkClobberedElement",value:function(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: ".concat(e.outerHTML));return t}}]),e}(),Fr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Br=/([^\#-~ |!])/g;function Vr(e){return e.replace(/&/g,"&").replace(Fr,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Br,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}function zr(e,t){var n=null;try{Tr=Tr||function(e){var t=new wr(e);return function(){try{return!!(new window.DOMParser).parseFromString(sr(""),"text/html")}catch(e){return!1}}()?new _r(t):t}(e);var i=t?String(t):"";n=Tr.getInertBodyElement(i);var r=5,o=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=o,o=n.innerHTML,n=Tr.getInertBodyElement(i)}while(i!==o);return sr((new jr).sanitizeChildren(Ur(n)||n))}finally{if(n)for(var a=Ur(n)||n;a.firstChild;)a.removeChild(a.firstChild)}}function Ur(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Hr=((Hr=Hr||{})[Hr.NONE=0]="NONE",Hr[Hr.HTML=1]="HTML",Hr[Hr.STYLE=2]="STYLE",Hr[Hr.SCRIPT=3]="SCRIPT",Hr[Hr.URL=4]="URL",Hr[Hr.RESOURCE_URL=5]="RESOURCE_URL",Hr);function Gr(e){var t=Xr();return t?cr(t.sanitize(Hr.HTML,e)||""):yr(e,"HTML")?cr(mr(e)):zr(Zt(),qe(e))}function Wr(e){var t=Xr();return t?t.sanitize(Hr.URL,e)||"":yr(e,"URL")?mr(e):Sr(qe(e))}function qr(e){var t=Xr();if(t)return lr(t.sanitize(Hr.RESOURCE_URL,e)||"");if(yr(e,"ResourceURL"))return lr(mr(e));throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)")}function Xr(){var e=vn();return e&&e[12]}var Yr="__ngContext__";function Kr(e,t){e[Yr]=t}function Qr(e){var t=function(e){return e[Yr]||null}(e);return t?Array.isArray(t)?t:t.lView:null}function $r(e){return e.ngOriginalError}function Zr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(e[n-1][4]=i[4]);var o=Li(e,10+t);!function(e,t){Ao(e,t,t[11],2,null,null),t[0]=null,t[6]=null}(i[1],i);var a=o[19];null!==a&&a.detachView(o[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}}function vo(e,t){if(!(256&t[2])){var n=t[11];Jt(n)&&n.destroyNode&&Ao(e,t,n,3,null,null),function(e){var t=e[13];if(!t)return go(e[1],e);for(;t;){var n=null;if(Nt(t))n=t[13];else{var i=t[10];i&&(n=i)}if(!n){for(;t&&!t[4]&&t!==e;)Nt(t)&&go(t[1],t),t=t[3];null===t&&(t=e),Nt(t)&&go(t[1],t),n=t&&t[4]}t=n}}(t)}}function go(e,t){if(!(256&t[2])){t[2]&=-129,t[2]|=256,function(e,t){var n;if(null!=e&&null!=(n=e.destroyHooks))for(var i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),o+=2}else{var l=i[r=n[o+1]];n[o].call(l)}if(null!==i){for(var h=r+1;ho?"":r[l+1].toLowerCase();var f=8&i?h:null;if(f&&-1!==Ro(f,c,0)||2&i&&c!==h){if(Bo(i))return!1;a=!0}}}}else{if(!a&&!Bo(i)&&!Bo(u))return!1;if(a&&Bo(u))continue;a=!1,i=u|1&i}}return Bo(i)||a}function Bo(e){return 0==(1&e)}function Vo(e,t,n,i){if(null===t)return-1;var r=0;if(i||!n){for(var o=!1;r-1)for(n++;n2&&void 0!==arguments[2]&&arguments[2],i=0;i0?'="'+s+'"':"")+"]"}else 8&i?r+="."+a:4&i&&(r+=" "+a);else""!==r&&!Bo(a)&&(t+=Ho(o,r),r=""),i=a,o=o||!Bo(i);n++}return""!==r&&(t+=Ho(o,r)),t}var Wo={};function qo(e){Xo(gn(),vn(),Un()+e,xn())}function Xo(e,t,n,i){if(!i)if(3==(3&t[2])){var r=e.preOrderCheckHooks;null!==r&&Xn(t,r,n)}else{var o=e.preOrderHooks;null!==o&&Yn(t,o,0,n)}Hn(n)}function Yo(e,t){return e<<17|t<<2}function Ko(e){return e>>17&32767}function Qo(e){return 2|e}function $o(e){return(131068&e)>>2}function Zo(e,t){return-131069&e|t<<2}function Jo(e){return 1|e}function ea(e,t){var n=e.contentQueries;if(null!==n)for(var i=0;i20&&Xo(e,t,20,xn()),n(i,r)}finally{Hn(o)}}function ua(e,t,n){if(jt(t))for(var i=t.directiveEnd,r=t.directiveStart;r2&&void 0!==arguments[2]?arguments[2]:rn,i=t.localNames;if(null!==i)for(var r=t.index+1,o=0;o0;){var n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(s)!=u&&s.push(u),s.push(i,r,a)}}function ya(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function ba(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function _a(e,t,n){if(n){if(t.exportAs)for(var i=0;i0&&Aa(n)}}function Aa(e){for(var t=so(e);null!==t;t=uo(t))for(var n=10;n0&&Aa(i)}var o=e[1].components;if(null!==o)for(var a=0;a0&&Aa(s)}}function Pa(e,t){var n=sn(t,e),i=n[1];(function(e,t){for(var n=t.length;n1&&void 0!==arguments[1]?arguments[1]:Ui;if(t===Ui){var n=new Error("NullInjectorError: No provider for ".concat(Be(e),"!"));throw n.name="NullInjectorError",n}return t}}]),e}(),Xa=new Mi("Set Injector scope."),Ya={},Ka={};function Qa(){return void 0===Ga&&(Ga=new qa),Ga}function $a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return new Za(e,n,t||Qa(),i)}var Za=function(){function e(t,n,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;m(this,e),this.parent=i,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;var a=[];n&&Di(n,function(e){return r.processProvider(e,t,n)}),Di([t],function(e){return r.processInjectorType(e,[],a)}),this.records.set(Wa,ts(void 0,this));var s=this.records.get(Xa);this.scope=null!=s?s.value:null,this.source=o||("object"==typeof t?null:Be(t))}return b(e,[{key:"destroyed",get:function(){return this._destroyed}},{key:"destroy",value:function(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(function(e){return e.ngOnDestroy()})}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ui,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ot.Default;this.assertNotDestroyed();var i=Yi(this),r=at(void 0);try{if(!(n&ot.SkipSelf)){var o=this.records.get(e);if(void 0===o){var a=function(e){return"function"==typeof e||"object"==typeof e&&e instanceof Mi}(e)&&$e(e);o=a&&this.injectableDefInScope(a)?ts(Ja(e),Ya):null,this.records.set(e,o)}if(null!=o)return this.hydrate(e,o)}return(n&ot.Self?Qa():this.parent).get(e,t=n&ot.Optional&&t===Ui?null:t)}catch(s){if("NullInjectorError"===s.name){if((s[Gi]=s[Gi]||[]).unshift(Be(e)),i)throw s;return tr(s,e,"R3InjectorError",this.source)}throw s}finally{at(r),Yi(i)}}},{key:"_resolveInjectorDefTypes",value:function(){var e=this;this.injectorDefTypes.forEach(function(t){return e.get(t)})}},{key:"toString",value:function(){var e=[];return this.records.forEach(function(t,n){return e.push(Be(n))}),"R3Injector[".concat(e.join(", "),"]")}},{key:"assertNotDestroyed",value:function(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}},{key:"processInjectorType",value:function(e,t,n){var i=this;if(!(e=He(e)))return!1;var r=Je(e),o=null==r&&e.ngModule||void 0,a=void 0===o?e:o,s=-1!==n.indexOf(a);if(void 0!==o&&(r=Je(o)),null==r)return!1;if(null!=r.imports&&!s){var u;n.push(a);try{Di(r.imports,function(e){i.processInjectorType(e,t,n)&&(void 0===u&&(u=[]),u.push(e))})}finally{}if(void 0!==u)for(var c=function(e){var t=u[e],n=t.ngModule,r=t.providers;Di(r,function(e){return i.processProvider(e,n,r||mt)})},l=0;l0){var n=ji(t,"?");throw new Error("Can't resolve all parameters for ".concat(Be(e),": (").concat(n.join(", "),")."))}var i=function(e){var t=e&&(e[tt]||e[it]);if(t){var n=function(e){if(e.hasOwnProperty("name"))return e.name;var t=(""+e).match(/^function\s*([^\s(]+)/);return null===t?"":t[1]}(e);return console.warn('DEPRECATED: DI is instantiating a token "'.concat(n,'" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "').concat(n,'" class.')),t}return null}(e);return null!==i?function(){return i.factory(e)}:function(){return new e}}(e);throw new Error("unreachable")}function es(e,t,n){var i;if(is(e)){var r=He(e);return Ut(r)||Ja(r)}if(ns(e))i=function(){return He(e.useValue)};else if(function(e){return!(!e||!e.useFactory)}(e))i=function(){return e.useFactory.apply(e,v(Zi(e.deps||[])))};else if(function(e){return!(!e||!e.useExisting)}(e))i=function(){return Qi(He(e.useExisting))};else{var o=He(e&&(e.useClass||e.provide));if(!function(e){return!!e.deps}(e))return Ut(o)||Ja(o);i=function(){return h(o,v(Zi(e.deps)))}}return i}function ts(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{factory:e,value:t,multi:n?[]:void 0}}function ns(e){return null!==e&&"object"==typeof e&&Xi in e}function is(e){return"function"==typeof e}var rs=function(e,t,n){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0,r=$a(e,t,n,i);return r._resolveInjectorDefTypes(),r}({name:n},t,e,n)},os=function(){function e(){m(this,e)}return b(e,null,[{key:"create",value:function(e,t){return Array.isArray(e)?rs(e,t,""):rs(e.providers,e.parent,e.name||"")}}]),e}();function as(e,t){qn(Qr(e)[1],yn())}function ss(e){for(var t=function(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),n=!0,i=[e];t;){var r=void 0;if(Vt(e))r=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new Error("Directives cannot inherit Components");r=t.\u0275dir}if(r){if(n){i.push(r);var o=e;o.inputs=us(e.inputs),o.declaredInputs=us(e.declaredInputs),o.outputs=us(e.outputs);var a=r.hostBindings;a&&hs(e,a);var s=r.viewQuery,u=r.contentQueries;if(s&&cs(e,s),u&&ls(e,u),Fe(e.inputs,r.inputs),Fe(e.declaredInputs,r.declaredInputs),Fe(e.outputs,r.outputs),Vt(r)&&r.data.animation){var c=e.data;c.animation=(c.animation||[]).concat(r.data.animation)}}var l=r.features;if(l)for(var h=0;h=0;i--){var r=e[i];r.hostVars=t+=r.hostVars,r.hostAttrs=ni(r.hostAttrs,n=ni(n,r.hostAttrs))}}(i)}function us(e){return e===gt?{}:e===mt?[]:e}function cs(e,t){var n=e.viewQuery;e.viewQuery=n?function(e,i){t(e,i),n(e,i)}:t}function ls(e,t){var n=e.contentQueries;e.contentQueries=n?function(e,i,r){t(e,i,r),n(e,i,r)}:t}function hs(e,t){var n=e.hostBindings;e.hostBindings=n?function(e,i){t(e,i),n(e,i)}:t}os.THROW_IF_NOT_FOUND=Ui,os.NULL=new qa,os.\u0275prov=Ke({token:os,providedIn:"any",factory:function(){return Qi(Wa)}}),os.__NG_ELEMENT_ID__=-1;var fs=null;function ds(){if(!fs){var e=vt.Symbol;if(e&&e.iterator)fs=e.iterator;else for(var t=Object.getOwnPropertyNames(Map.prototype),n=0;n1&&void 0!==arguments[1]?arguments[1]:ot.Default,n=vn();return null===n?Qi(e,t):mi(yn(),n,He(e),t)}function Cs(e,t,n){var i=vn();return ys(i,On(),t)&&va(gn(),Gn(),i,e,t,i[11],n,!1),Cs}function Os(e,t,n,i,r){var o=r?"class":"style";za(e,n,t.inputs[o],o,i)}function Ts(e,t,n,i){var r=vn(),o=gn(),a=20+e,s=r[11],u=r[a]=ho(s,t,dn.lFrame.currentNamespace),c=o.firstCreatePass?function(e,t,n,i,r,o,a){var s=t.consts,u=na(t,e,2,r,ln(s,o));return ga(t,n,u,ln(s,a)),null!==u.attrs&&Ha(u,u.attrs,!1),null!==u.mergedAttrs&&Ha(u,u.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,u),u}(a,o,r,0,t,n,i):o.data[a];_n(c,!0);var l=c.mergedAttrs;null!==l&&Jn(s,u,l);var h=c.classes;null!==h&&Io(s,u,h);var f=c.styles;null!==f&&Mo(s,u,f),64!=(64&c.flags)&&So(o,r,u,c),0===dn.lFrame.elementDepthCount&&Kr(u,r),dn.lFrame.elementDepthCount++,Bt(c)&&(ca(o,r,c),ua(o,c,r)),null!==i&&la(r,c)}function As(){var e=yn();wn()?kn():_n(e=e.parent,!1);var t=e;dn.lFrame.elementDepthCount--;var n=gn();n.firstCreatePass&&(qn(n,e),jt(e)&&n.queries.elementEnd(e)),null!=t.classesWithoutHost&&function(e){return 0!=(16&e.flags)}(t)&&Os(n,t,vn(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function(e){return 0!=(32&e.flags)}(t)&&Os(n,t,vn(),t.stylesWithoutHost,!1)}function Ps(e,t,n,i){Ts(e,t,n,i),As()}function Ms(e,t,n){var i=vn(),r=gn(),o=e+20,a=r.firstCreatePass?function(e,t,n,i,r){var o=t.consts,a=ln(o,i),s=na(t,e,8,"ng-container",a);return null!==a&&Ha(s,a,!0),ga(t,n,s,ln(o,r)),null!==t.queries&&t.queries.elementStart(t,s),s}(o,r,i,t,n):r.data[o];_n(a,!0);var s=i[o]=i[11].createComment("");So(r,i,s,a),Kr(s,i),Bt(a)&&(ca(r,i,a),ua(r,a,i)),null!=n&&la(i,a)}function Is(){var e=yn(),t=gn();wn()?kn():_n(e=e.parent,!1),t.firstCreatePass&&(qn(t,e),jt(e)&&t.queries.elementEnd(e))}function Rs(e,t,n){Ms(e,t,n),Is()}function Ds(){return vn()}function Ns(e){return!!e&&"function"==typeof e.then}function Ls(e){return!!e&&"function"==typeof e.subscribe}var js=Ls;function Fs(e,t,n,i){var r=vn(),o=gn(),a=yn();return Vs(o,r,r[11],a,e,t,!!n,i),Fs}function Bs(e,t){var n=yn(),i=vn(),r=gn();return Vs(r,i,Ba(Mn(r.data),n,i),n,e,t,!1),Bs}function Vs(e,t,n,i,r,o,a,s){var u=Bt(i),c=e.firstCreatePass&&Fa(e),l=t[8],h=ja(t),f=!0;if(3&i.type||s){var d=rn(i,t),p=s?s(d):d,v=h.length,g=s?function(e){return s(tn(e[i.index]))}:i.index;if(Jt(n)){var m=null;if(!s&&u&&(m=function(e,t,n,i){var r=e.cleanup;if(null!=r)for(var o=0;ou?s[u]:null}"string"==typeof a&&(o+=2)}return null}(e,t,r,i.index)),null!==m)(m.__ngLastListenerFn__||m).__ngNextListenerFn__=o,m.__ngLastListenerFn__=o,f=!1;else{o=Us(i,t,l,o,!1);var y=n.listen(p,r,o);h.push(o,y),c&&c.push(r,g,v,v+1)}}else o=Us(i,t,l,o,!0),p.addEventListener(r,o,a),h.push(o),c&&c.push(r,g,v,a)}else o=Us(i,t,l,o,!1);var b,_=i.outputs;if(f&&null!==_&&(b=_[r])){var w=b.length;if(w)for(var k=0;k0&&void 0!==arguments[0]?arguments[0]:1;return function(e){return(dn.lFrame.contextLView=function(e,t){for(;e>0;)t=t[15],e--;return t}(e,dn.lFrame.contextLView))[8]}(e)}function Gs(e,t){for(var n=null,i=function(e){var t=e.attrs;if(null!=t){var n=t.indexOf(5);if(0==(1&n))return t[n+1]}return null}(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=vn(),r=gn(),o=na(r,20+e,16,null,n||null);null===o.projection&&(o.projection=t),kn(),64!=(64&o.flags)&&function(e,t,n){Po(t[11],0,t,n,mo(e,n,t),ko(n.parent||t[6],n,t))}(r,i,o)}function Xs(e,t,n){return Ys(e,"",t,"",n),Xs}function Ys(e,t,n,i,r){var o=vn(),a=ws(o,t,n,i);return a!==Wo&&va(gn(),Gn(),o,e,a,o[11],r,!1),Ys}function Ks(e,t,n,i,r){for(var o=e[n+1],a=null===t,s=i?Ko(o):$o(o),u=!1;0!==s&&(!1===u||a);){var c=e[s+1];Qs(e[s],t)&&(u=!0,e[s+1]=i?Jo(c):Qo(c)),s=i?Ko(c):$o(c)}u&&(e[n+1]=i?Qo(o):Jo(o))}function Qs(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Vi(e,t)>=0}var $s={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function Zs(e){return e.substring($s.key,$s.keyEnd)}function Js(e){return e.substring($s.value,$s.valueEnd)}function eu(e,t){var n=$s.textEnd;return n===t?-1:(t=$s.keyEnd=function(e,t,n){for(;t32;)t++;return t}(e,$s.key=t,n),iu(e,t,n))}function tu(e,t){var n=$s.textEnd,i=$s.key=iu(e,t,n);return n===i?-1:(i=$s.keyEnd=function(e,t,n){for(var i;t=65&&(-33&i)<=90||i>=48&&i<=57);)t++;return t}(e,i,n),i=ru(e,i,n),i=$s.value=iu(e,i,n),i=$s.valueEnd=function(e,t,n){for(var i=-1,r=-1,o=-1,a=t,s=a;a32&&(s=a),o=r,r=i,i=-33&u}return s}(e,i,n),ru(e,i,n))}function nu(e){$s.key=0,$s.keyEnd=0,$s.value=0,$s.valueEnd=0,$s.textEnd=e.length}function iu(e,t,n){for(;t=0;n=tu(t,n))mu(e,Zs(t),Js(t))}function cu(e){fu(Fi,lu,e,!0)}function lu(e,t){for(var n=function(e){return nu(e),eu(e,iu(e,0,$s.textEnd))}(t);n>=0;n=eu(t,n))Fi(e,Zs(t),!0)}function hu(e,t,n,i){var r=vn(),o=gn(),a=Tn(2);o.firstUpdatePass&&pu(o,e,a,i),t!==Wo&&ys(r,a,t)&&yu(o,o.data[Un()],r,r[11],e,r[a+1]=function(e,t){return null==e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Be(mr(e)))),e}(t,n),i,a)}function fu(e,t,n,i){var r=gn(),o=Tn(2);r.firstUpdatePass&&pu(r,null,o,i);var a=vn();if(n!==Wo&&ys(a,o,n)){var s=r.data[Un()];if(wu(s,i)&&!du(r,o)){var u=i?s.classesWithoutHost:s.stylesWithoutHost;null!==u&&(n=Ve(u,n||"")),Os(r,s,a,n,i)}else!function(e,t,n,i,r,o,a,s){r===Wo&&(r=mt);for(var u=0,c=0,l=0=e.expandoStartIndex}function pu(e,t,n,i){var r=e.data;if(null===r[n+1]){var o=r[Un()],a=du(e,n);wu(o,i)&&null===t&&!a&&(t=!1),t=function(e,t,n,i){var r=Mn(e),o=i?t.residualClasses:t.residualStyles;if(null===r)0===(i?t.classBindings:t.styleBindings)&&(n=gu(n=vu(null,e,t,n,i),t.attrs,i),o=null);else{var a=t.directiveStylingLast;if(-1===a||e[a]!==r)if(n=vu(r,e,t,n,i),null===o){var s=function(e,t,n){var i=n?t.classBindings:t.styleBindings;if(0!==$o(i))return e[Ko(i)]}(e,t,i);void 0!==s&&Array.isArray(s)&&function(e,t,n,i){e[Ko(n?t.classBindings:t.styleBindings)]=i}(e,t,i,s=gu(s=vu(null,e,t,s[1],i),t.attrs,i))}else o=function(e,t,n){for(var i,r=t.directiveEnd,o=1+t.directiveStylingLast;o0)&&(l=!0)}else c=n;if(r)if(0!==u){var f=Ko(e[s+1]);e[i+1]=Yo(f,s),0!==f&&(e[f+1]=Zo(e[f+1],i)),e[s+1]=function(e,t){return 131071&e|t<<17}(e[s+1],i)}else e[i+1]=Yo(s,0),0!==s&&(e[s+1]=Zo(e[s+1],i)),s=i;else e[i+1]=Yo(u,0),0===s?s=i:e[u+1]=Zo(e[u+1],i),u=i;l&&(e[i+1]=Qo(e[i+1])),Ks(e,c,i,!0),Ks(e,c,i,!1),function(e,t,n,i,r){var o=r?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&Vi(o,t)>=0&&(n[i+1]=Jo(n[i+1]))}(t,c,e,i,o),a=Yo(s,u),o?t.classBindings=a:t.styleBindings=a}(r,o,t,n,a,i)}}function vu(e,t,n,i,r){var o=null,a=n.directiveEnd,s=n.directiveStylingLast;for(-1===s?s=n.directiveStart:s++;s0;){var u=e[r],c=Array.isArray(u),l=c?u[1]:u,h=null===l,f=n[r+1];f===Wo&&(f=h?mt:void 0);var d=h?Bi(f,i):l===i?f:void 0;if(c&&!_u(d)&&(d=Bi(u,i)),_u(d)&&(a=d,s))return a;var p=e[r+1];r=s?Ko(p):$o(p)}if(null!==t){var v=o?t.residualClasses:t.residualStyles;null!=v&&(a=Bi(v,i))}return a}function _u(e){return void 0!==e}function wu(e,t){return 0!=(e.flags&(t?16:32))}function ku(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=vn(),i=gn(),r=e+20,o=i.firstCreatePass?na(i,r,1,t,null):i.data[r],a=n[r]=function(e,t){return Jt(e)?e.createText(t):e.createTextNode(t)}(n[11],t);So(i,n,a,o),_n(o,!1)}function xu(e){return Su("",e,""),xu}function Su(e,t,n){var i=vn(),r=ws(i,e,t,n);return r!==Wo&&Ua(i,Un(),r),Su}function Eu(e,t,n,i,r){var o=vn(),a=function(e,t,n,i,r,o){var a=bs(e,Cn(),n,r);return Tn(2),a?t+qe(n)+i+qe(r)+o:Wo}(o,e,t,n,i,r);return a!==Wo&&Ua(o,Un(),a),Eu}function Cu(e,t,n){fu(Fi,lu,ws(vn(),e,t,n),!0)}function Ou(e,t,n){var i=vn();return ys(i,On(),t)&&va(gn(),Gn(),i,e,t,i[11],n,!0),Ou}function Tu(e,t,n){var i=vn();if(ys(i,On(),t)){var r=gn(),o=Gn();va(r,o,i,e,t,Ba(Mn(r.data),o,i),n,!0)}return Tu}var Au=void 0,Pu=["en",[["a","p"],["AM","PM"],Au],[["AM","PM"],Au,Au],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Au,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Au,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Au,"{1} 'at' {0}",Au],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(e){var t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}],Mu={};function Iu(e){return e in Mu||(Mu[e]=vt.ng&&vt.ng.common&&vt.ng.common.locales&&vt.ng.common.locales[e]),Mu[e]}var Ru=((Ru=Ru||{})[Ru.LocaleId=0]="LocaleId",Ru[Ru.DayPeriodsFormat=1]="DayPeriodsFormat",Ru[Ru.DayPeriodsStandalone=2]="DayPeriodsStandalone",Ru[Ru.DaysFormat=3]="DaysFormat",Ru[Ru.DaysStandalone=4]="DaysStandalone",Ru[Ru.MonthsFormat=5]="MonthsFormat",Ru[Ru.MonthsStandalone=6]="MonthsStandalone",Ru[Ru.Eras=7]="Eras",Ru[Ru.FirstDayOfWeek=8]="FirstDayOfWeek",Ru[Ru.WeekendRange=9]="WeekendRange",Ru[Ru.DateFormat=10]="DateFormat",Ru[Ru.TimeFormat=11]="TimeFormat",Ru[Ru.DateTimeFormat=12]="DateTimeFormat",Ru[Ru.NumberSymbols=13]="NumberSymbols",Ru[Ru.NumberFormats=14]="NumberFormats",Ru[Ru.CurrencyCode=15]="CurrencyCode",Ru[Ru.CurrencySymbol=16]="CurrencySymbol",Ru[Ru.CurrencyName=17]="CurrencyName",Ru[Ru.Currencies=18]="Currencies",Ru[Ru.Directionality=19]="Directionality",Ru[Ru.PluralCase=20]="PluralCase",Ru[Ru.ExtraData=21]="ExtraData",Ru),Du="en-US";function Nu(e){(function(e,t){null==e&&function(e,t,n,i){throw new Error("ASSERTION ERROR: ".concat(e)+" [Expected=> ".concat(null," ").concat("!="," ").concat(t," <=Actual]"))}(t,e)})(e,"Expected localeId to be defined"),"string"==typeof e&&e.toLowerCase().replace(/_/g,"-")}function Lu(e,t,n,i,r){if(e=He(e),Array.isArray(e))for(var o=0;o>20;if(is(e)||!e.multi){var p=new Zn(c,r,Es),v=Bu(u,t,r?h:h+d,f);-1===v?(pi(li(l,s),a,u),ju(a,e,t.length),t.push(u),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(p),s.push(p)):(n[v]=p,s[v]=p)}else{var g=Bu(u,t,h+d,f),m=Bu(u,t,h,h+d),y=g>=0&&n[g],b=m>=0&&n[m];if(r&&!b||!r&&!y){pi(li(l,s),a,u);var _=function(e,t,n,i,r){var o=new Zn(e,n,Es);return o.multi=[],o.index=t,o.componentProviders=0,Fu(o,r,i&&!n),o}(r?zu:Vu,n.length,r,i,c);!r&&b&&(n[m].providerFactory=_),ju(a,e,t.length,0),t.push(u),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(_),s.push(_)}else ju(a,e,g>-1?g:m,Fu(n[r?m:g],c,!r&&i));!r&&i&&b&&n[m].componentProviders++}}}function ju(e,t,n,i){var r=is(t);if(r||function(e){return!!e.useClass}(t)){var o=(t.useClass||t).prototype.ngOnDestroy;if(o){var a=e.destroyHooks||(e.destroyHooks=[]);if(!r&&t.multi){var s=a.indexOf(n);-1===s?a.push(n,[i,o]):a[s+1].push(i,o)}else a.push(n,o)}}}function Fu(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function Bu(e,t,n,i){for(var r=n;r1&&void 0!==arguments[1]?arguments[1]:[];return function(n){n.providersResolver=function(n,i){return function(e,t,n){var i=gn();if(i.firstCreatePass){var r=Vt(e);Lu(n,i.data,i.blueprint,r,!0),Lu(t,i.data,i.blueprint,r,!1)}}(n,i?i(e):e,t)}}}var Gu=function e(){m(this,e)},Wu=function e(){m(this,e)};function qu(){}function Xu(e,t){return new Ku(rn(e,t))}Wu.NULL=new(function(){function e(){m(this,e)}return b(e,[{key:"resolveComponentFactory",value:function(e){throw function(e){var t=Error("No component factory found for ".concat(Be(e),". Did you add it to @NgModule.entryComponents?"));return t.ngComponent=e,t}(e)}}]),e}());var Yu=function(){return Xu(yn(),vn())},Ku=function(){var e=function e(t){m(this,e),this.nativeElement=t};return e.__NG_ELEMENT_ID__=Yu,e}();function Qu(e){return e instanceof Ku?e.nativeElement:e}var $u=function e(){m(this,e)},Zu=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=function(){return Ju()},e}(),Ju=function(){var e=vn(),t=sn(yn().index,e);return function(e){return e[11]}(Nt(t)?t:e)},ec=function(){var e=function e(){m(this,e)};return e.\u0275prov=Ke({token:e,providedIn:"root",factory:function(){return null}}),e}(),tc=function e(t){m(this,e),this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")},nc=new tc("12.2.5"),ic=function(){function e(){m(this,e)}return b(e,[{key:"supports",value:function(e){return vs(e)}},{key:"create",value:function(e){return new oc(e)}}]),e}(),rc=function(e,t){return t},oc=function(){function e(t){m(this,e),this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||rc}return b(e,[{key:"forEachItem",value:function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)}},{key:"forEachOperation",value:function(e){for(var t=this._itHead,n=this._removalsHead,i=0,r=null;t||n;){var o=!n||t&&t.currentIndex4&&void 0!==arguments[4]&&arguments[4];null!==n;){var o=t[n.index];if(null!==o&&i.push(tn(o)),Lt(o))for(var a=10;a-1&&(po(e,n),Li(t,n))}this._attachedToViewContainer=!1}vo(this._lView[1],this._lView)}},{key:"onDestroy",value:function(e){da(this._lView[1],this._lView,null,e)}},{key:"markForCheck",value:function(){Ia(this._cdRefInjectingView||this._lView)}},{key:"detach",value:function(){this._lView[2]&=-129}},{key:"reattach",value:function(){this._lView[2]|=128}},{key:"detectChanges",value:function(){Ra(this._lView[1],this._lView,this.context)}},{key:"checkNoChanges",value:function(){!function(e,t,n){Sn(!0);try{Ra(e,t,n)}finally{Sn(!1)}}(this._lView[1],this._lView,this.context)}},{key:"attachToViewContainerRef",value:function(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}},{key:"detachFromAppRef",value:function(){this._appRef=null,function(e,t){Ao(e,t,t[11],2,null,null)}(this._lView[1],this._lView)}},{key:"attachToAppRef",value:function(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}]),e}(),bc=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,e))._view=e,i}return b(n,[{key:"detectChanges",value:function(){Da(this._view)}},{key:"checkNoChanges",value:function(){!function(e){Sn(!0);try{Da(e)}finally{Sn(!1)}}(this._view)}},{key:"context",get:function(){return null}}]),n}(yc),_c=function(e){return function(e,t,n){if(Ft(e)&&!n){var i=sn(e.index,t);return new yc(i,i)}return 47&e.type?new yc(t[16],t):null}(yn(),vn(),16==(16&e))},wc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=_c,e}(),kc=[new lc],xc=new pc([new ic]),Sc=new gc(kc),Ec=function(){return Tc(yn(),vn())},Cc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Ec,e}(),Oc=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this))._declarationLView=e,o._declarationTContainer=i,o.elementRef=r,o}return b(n,[{key:"createEmbeddedView",value:function(e){var t=this._declarationTContainer.tViews,n=ta(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];var i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(t)),ra(t,n,e),new yc(n)}}]),n}(Cc);function Tc(e,t){return 4&e.type?new Oc(t,e,Xu(e,t)):null}var Ac=function e(){m(this,e)},Pc=function(){return Nc(yn(),vn())},Mc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Pc,e}(),Ic=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this))._lContainer=e,o._hostTNode=i,o._hostLView=r,o}return b(n,[{key:"element",get:function(){return Xu(this._hostTNode,this._hostLView)}},{key:"injector",get:function(){return new Ei(this._hostTNode,this._hostLView)}},{key:"parentInjector",get:function(){var e=di(this._hostTNode,this._hostLView);if(ri(e)){var t=ai(e,this._hostLView),n=oi(e);return new Ei(t[1].data[n+8],t)}return new Ei(null,this._hostLView)}},{key:"clear",value:function(){for(;this.length>0;)this.remove(this.length-1)}},{key:"get",value:function(e){var t=Rc(this._lContainer);return null!==t&&t[e]||null}},{key:"length",get:function(){return this._lContainer.length-10}},{key:"createEmbeddedView",value:function(e,t,n){var i=e.createEmbeddedView(t||{});return this.insert(i,n),i}},{key:"createComponent",value:function(e,t,n,i,r){var o=n||this.parentInjector;if(!r&&null==e.ngModule&&o){var a=o.get(Ac,null);a&&(r=a)}var s=e.create(o,i,void 0,r);return this.insert(s.hostView,t),s}},{key:"insert",value:function(e,t){var i=e._lView,r=i[1];if(function(e){return Lt(e[3])}(i)){var o=this.indexOf(e);if(-1!==o)this.detach(o);else{var a=i[3],s=new n(a,a[6],a[3]);s.detach(s.indexOf(e))}}var u=this._adjustIndex(t),c=this._lContainer;!function(e,t,n,i){var r=10+i,o=n.length;i>0&&(n[r-1][4]=t),i1&&void 0!==arguments[1]?arguments[1]:0;return null==e?this.length+t:e}}]),n}(Mc);function Rc(e){return e[8]}function Dc(e){return e[8]||(e[8]=[])}function Nc(e,t){var n,i=t[e.index];if(Lt(i))n=i;else{var r;if(8&e.type)r=tn(i);else{var o=t[11];r=o.createComment("");var a=rn(e,t);yo(o,wo(o,a),r,function(e,t){return Jt(e)?e.nextSibling(t):t.nextSibling}(o,a),!1)}t[e.index]=n=Oa(i,t,r,e),Ma(t,n)}return new Ic(n,e,t)}var Lc={},jc=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).ngModule=e,i}return b(n,[{key:"resolveComponentFactory",value:function(e){var t=Rt(e);return new Vc(t,this.ngModule)}}]),n}(Wu);function Fc(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}var Bc=new Mi("SCHEDULER_TOKEN",{providedIn:"root",factory:function(){return eo}}),Vc=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this)).componentDef=e,r.ngModule=i,r.componentType=e.type,r.selector=function(e){return e.map(Go).join(",")}(e.selectors),r.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],r.isBoundToModule=!!i,r}return b(n,[{key:"inputs",get:function(){return Fc(this.componentDef.inputs)}},{key:"outputs",get:function(){return Fc(this.componentDef.outputs)}},{key:"create",value:function(e,t,n,i){var r,o,a=(i=i||this.ngModule)?function(e,t){return{get:function(n,i,r){var o=e.get(n,Lc,r);return o!==Lc||i===Lc?o:t.get(n,i,r)}}}(e,i.injector):e,s=a.get($u,en),u=a.get(ec,null),c=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",h=n?function(e,t,n){if(Jt(e))return e.selectRootElement(t,n===lt.ShadowDom);var i="string"==typeof t?e.querySelector(t):t;return i.textContent="",i}(c,n,this.componentDef.encapsulation):ho(s.createRenderer(null,this.componentDef),l,function(e){var t=e.toLowerCase();return"svg"===t?$t:"math"===t?"http://www.w3.org/1998/MathML/":null}(l)),f=this.componentDef.onPush?576:528,d={components:[],scheduler:eo,clean:La,playerHandler:null,flags:0},p=fa(0,null,null,1,0,null,null,null,null,null),v=ta(null,p,d,f,null,null,s,c,u,a);Ln(v);try{var g=function(e,t,n,i,r,o){var a=n[1];n[20]=e;var s=na(a,20,2,"#host",null),u=s.mergedAttrs=t.hostAttrs;null!==u&&(Ha(s,u,!0),null!==e&&(Jn(r,e,u),null!==s.classes&&Io(r,e,s.classes),null!==s.styles&&Mo(r,e,s.styles)));var c=i.createRenderer(e,t),l=ta(n,ha(t),null,t.onPush?64:16,n[20],s,i,c,null,null);return a.firstCreatePass&&(pi(li(s,n),a,t.type),ba(a,s),wa(s,n.length,1)),Ma(n,l),n[20]=l}(h,this.componentDef,v,s,c);if(h)if(n)Jn(c,h,["ng-version",nc.full]);else{var m=function(e){for(var t=[],n=[],i=1,r=2;i0&&Io(c,h,b.join(" "))}if(o=on(p,20),void 0!==t)for(var _=o.projection=[],w=0;w1&&void 0!==arguments[1]?arguments[1]:os.THROW_IF_NOT_FOUND,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ot.Default;return e===os||e===Ac||e===Wa?this:this._r3Injector.get(e,t,n)}},{key:"destroy",value:function(){var e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(function(e){return e()}),this.destroyCbs=null}},{key:"onDestroy",value:function(e){this.destroyCbs.push(e)}}]),n}(Ac),Gc=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).moduleType=e,null!==Dt(e)&&function(e){var t=new Set;!function e(n){var i=Dt(n,!0),r=i.id;null!==r&&(function(e,t,n){if(t&&t!==n)throw new Error("Duplicate module registered for ".concat(e," - ").concat(Be(t)," vs ").concat(Be(t.name)))}(r,Uc.get(r),n),Uc.set(r,n));var o,a=_(io(i.imports));try{for(a.s();!(o=a.n()).done;){var s=o.value;t.has(s)||(t.add(s),e(s))}}catch(u){a.e(u)}finally{a.f()}}(e)}(e),i}return b(n,[{key:"create",value:function(e){return new Hc(this.moduleType,e)}}]),n}(function(){return function e(){m(this,e)}}());function Wc(e,t,n){var i=En()+e,r=vn();return r[i]===Wo?ms(r,i,n?t.call(n):t()):function(e,t){return e[t]}(r,i)}function qc(e,t,n,i){return Yc(vn(),En(),e,t,n,i)}function Xc(e,t){var n=e[t];return n===Wo?void 0:n}function Yc(e,t,n,i,r,o){var a=t+n;return ys(e,a,r)?ms(e,a+1,o?i.call(o,r):i(r)):Xc(e,a+1)}function Kc(e,t){var n,i=gn(),r=e+20;i.firstCreatePass?(n=function(e,t){if(t)for(var n=t.length-1;n>=0;n--){var i=t[n];if(e===i.name)return i}throw new We("302","The pipe '".concat(e,"' could not be found!"))}(t,i.pipeRegistry),i.data[r]=n,n.onDestroy&&(i.destroyHooks||(i.destroyHooks=[])).push(r,n.onDestroy)):n=i.data[r];var o=n.factory||(n.factory=Ut(n.type)),a=at(Es);try{var s=ui(!1),u=o();return ui(s),function(e,t,n,i){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=i}(i,vn(),r,u),u}finally{at(a)}}function Qc(e,t,n){var i=e+20,r=vn(),o=an(r,i);return function(e,t){return ps.isWrapped(t)&&(t=ps.unwrap(t),e[Cn()]=Wo),t}(r,function(e,t){return e[1].data[t].pure}(r,i)?Yc(r,En(),t,o.transform,n,o):o.transform(n))}function $c(e){return function(t){setTimeout(e,void 0,t)}}var Zc=function(t){a(i,t);var n=s(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return m(this,i),(e=n.call(this)).__isAsync=t,e}return b(i,[{key:"emit",value:function(t){e(p(i.prototype),"next",this).call(this,t)}},{key:"subscribe",value:function(t,n,r){var o,a,s,u=t,c=n||function(){return null},l=r;if(t&&"object"==typeof t){var h=t;u=null===(o=h.next)||void 0===o?void 0:o.bind(h),c=null===(a=h.error)||void 0===a?void 0:a.bind(h),l=null===(s=h.complete)||void 0===s?void 0:s.bind(h)}this.__isAsync&&(c=$c(c),u&&(u=$c(u)),l&&(l=$c(l)));var f=e(p(i.prototype),"subscribe",this).call(this,{next:u,error:c,complete:l});return t instanceof W&&t.add(f),f}}]),i}(oe);function Jc(){return this._results[ds()]()}var el=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];m(this,e),this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;var n=ds(),i=e.prototype;i[n]||(i[n]=Jc)}return b(e,[{key:"changes",get:function(){return this._changes||(this._changes=new Zc)}},{key:"get",value:function(e){return this._results[e]}},{key:"map",value:function(e){return this._results.map(e)}},{key:"filter",value:function(e){return this._results.filter(e)}},{key:"find",value:function(e){return this._results.find(e)}},{key:"reduce",value:function(e,t){return this._results.reduce(e,t)}},{key:"forEach",value:function(e){this._results.forEach(e)}},{key:"some",value:function(e){return this._results.some(e)}},{key:"toArray",value:function(){return this._results.slice()}},{key:"toString",value:function(){return this._results.toString()}},{key:"reset",value:function(e,t){var n=this;n.dirty=!1;var i=Ri(e);(this._changesDetected=!function(e,t,n){if(e.length!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[];m(this,e),this.queries=t}return b(e,[{key:"createEmbeddedView",value:function(t){var n=t.queries;if(null!==n){for(var i=null!==t.contentQueries?t.contentQueries[0]:n.length,r=[],o=0;o2&&void 0!==arguments[2]?arguments[2]:null;m(this,e),this.predicate=t,this.flags=n,this.read=i},rl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];m(this,e),this.queries=t}return b(e,[{key:"elementStart",value:function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:-1;m(this,e),this.metadata=t,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=n}return b(e,[{key:"elementStart",value:function(e,t){this.isApplyingToNode(t)&&this.matchTNode(e,t)}},{key:"elementEnd",value:function(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}},{key:"template",value:function(e,t){this.elementStart(e,t)}},{key:"embeddedTView",value:function(t,n){return this.isApplyingToNode(t)?(this.crossesNgTemplate=!0,this.addMatch(-t.index,n),new e(this.metadata)):null}},{key:"isApplyingToNode",value:function(e){if(this._appliesToNextNode&&1!=(1&this.metadata.flags)){for(var t=this._declarationNodeIndex,n=e.parent;null!==n&&8&n.type&&n.index!==t;)n=n.parent;return t===(null!==n?n.index:-1)}return this._appliesToNextNode}},{key:"matchTNode",value:function(e,t){var n=this.metadata.predicate;if(Array.isArray(n))for(var i=0;i0)i.push(a[s/2]);else{for(var c=o[s+1],l=t[-u],h=10;h0&&(r=setTimeout(function(){i._callbacks=i._callbacks.filter(function(e){return e.timeoutId!==r}),e(i._didWork,i.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:r,updateCb:n})}},{key:"whenStable",value:function(e,t,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(e,t,n),this._runCallbacksIfReady()}},{key:"getPendingRequestCount",value:function(){return this._pendingCount}},{key:"findProviders",value:function(e,t,n){return[]}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Kl=function(){var e=function(){function e(){m(this,e),this._applications=new Map,Ql.addToWindow(this)}return b(e,[{key:"registerApplication",value:function(e,t){this._applications.set(e,t)}},{key:"unregisterApplication",value:function(e){this._applications.delete(e)}},{key:"unregisterAllApplications",value:function(){this._applications.clear()}},{key:"getTestability",value:function(e){return this._applications.get(e)||null}},{key:"getAllTestabilities",value:function(){return Array.from(this._applications.values())}},{key:"getAllRootElements",value:function(){return Array.from(this._applications.keys())}},{key:"findTestabilityInTree",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ql.findTestabilityInTree(this,e,t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Ql=new(function(){function e(){m(this,e)}return b(e,[{key:"addToWindow",value:function(e){}},{key:"findTestabilityInTree",value:function(e,t,n){return null}}]),e}()),$l=!0,Zl=!1;function Jl(){return Zl=!0,$l}var eh=new Mi("AllowMultipleToken");function th(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i="Platform: ".concat(t),r=new Mi(i);return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=nh();if(!o||o.injector.get(eh,!1))if(e)e(n.concat(t).concat({provide:r,useValue:!0}));else{var a=n.concat(t).concat({provide:r,useValue:!0},{provide:Xa,useValue:"platform"});!function(e){if(ql&&!ql.destroyed&&!ql.injector.get(eh,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ql=e.get(ih);var t=e.get(xl,null);t&&t.forEach(function(e){return e()})}(os.create({providers:a,name:i}))}return function(e){var t=nh();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(r)}}function nh(){return ql&&!ql.destroyed?ql:null}var ih=function(){var e=function(){function e(t){m(this,e),this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return b(e,[{key:"bootstrapModuleFactory",value:function(e,t){var n=this,i=function(e,t){return"noop"===e?new Xl:("zone.js"===e?void 0:e)||new Vl({enableLongStackTrace:Jl(),shouldCoalesceEventChangeDetection:!!(null==t?void 0:t.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==t?void 0:t.ngZoneRunCoalescing)})}(t?t.ngZone:void 0,{ngZoneEventCoalescing:t&&t.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:t&&t.ngZoneRunCoalescing||!1}),r=[{provide:Vl,useValue:i}];return i.run(function(){var o=os.create({providers:r,parent:n.injector,name:e.moduleType.name}),a=e.create(o),s=a.injector.get(Jr,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return i.runOutsideAngular(function(){var e=i.onError.subscribe({next:function(e){s.handleError(e)}});a.onDestroy(function(){ah(n._modules,a),e.unsubscribe()})}),function(e,i,r){try{var o=((s=a.injector.get(bl)).runInitializers(),s.donePromise.then(function(){return Nu(a.injector.get(Ol,Du)||Du),n._moduleDoBootstrap(a),a}));return Ns(o)?o.catch(function(t){throw i.runOutsideAngular(function(){return e.handleError(t)}),t}):o}catch(t){throw i.runOutsideAngular(function(){return e.handleError(t)}),t}var s}(s,i)})}},{key:"bootstrapModule",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=rh({},n);return function(e,t,n){var i=new Gc(n);return Promise.resolve(i)}(0,0,e).then(function(e){return t.bootstrapModuleFactory(e,i)})}},{key:"_moduleDoBootstrap",value:function(e){var t=e.injector.get(oh);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(function(e){return t.bootstrap(e)});else{if(!e.instance.ngDoBootstrap)throw new Error("The module ".concat(Be(e.instance.constructor),' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.'));e.instance.ngDoBootstrap(t)}this._modules.push(e)}},{key:"onDestroy",value:function(e){this._destroyListeners.push(e)}},{key:"injector",get:function(){return this._injector}},{key:"destroy",value:function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(e){return e.destroy()}),this._destroyListeners.forEach(function(e){return e()}),this._destroyed=!0}},{key:"destroyed",get:function(){return this._destroyed}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(os))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}();function rh(e,t){return Array.isArray(t)?t.reduce(rh,e):Object.assign(Object.assign({},e),t)}var oh=function(){var e=function(){function e(t,n,i,r,o){var a=this;m(this,e),this._zone=t,this._injector=n,this._exceptionHandler=i,this._componentFactoryResolver=r,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:function(){a._zone.run(function(){a.tick()})}});var s=new ee(function(e){a._stable=a._zone.isStable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks,a._zone.runOutsideAngular(function(){e.next(a._stable),e.complete()})}),u=new ee(function(e){var t;a._zone.runOutsideAngular(function(){t=a._zone.onStable.subscribe(function(){Vl.assertNotInAngularZone(),Bl(function(){!a._stable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks&&(a._stable=!0,e.next(!0))})})});var n=a._zone.onUnstable.subscribe(function(){Vl.assertInAngularZone(),a._stable&&(a._stable=!1,a._zone.runOutsideAngular(function(){e.next(!1)}))});return function(){t.unsubscribe(),n.unsubscribe()}});this.isStable=Ce(s,u.pipe(Le()))}return b(e,[{key:"bootstrap",value:function(e,t){var n,i=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=e instanceof Gu?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);var r=function(e){return e.isBoundToModule}(n)?void 0:this._injector.get(Ac),o=n.create(os.NULL,[],t||n.selector,r),a=o.location.nativeElement,s=o.injector.get(Yl,null),u=s&&o.injector.get(Kl);return s&&u&&u.registerApplication(a,s),o.onDestroy(function(){i.detachView(o.hostView),ah(i.components,o),u&&u.unregisterApplication(a)}),this._loadComponent(o),o}},{key:"tick",value:function(){var e=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;var t,n=_(this._views);try{for(n.s();!(t=n.n()).done;){var i;t.value.detectChanges()}}catch(r){n.e(r)}finally{n.f()}}catch(i){this._zone.runOutsideAngular(function(){return e._exceptionHandler.handleError(i)})}finally{this._runningTick=!1}}},{key:"attachView",value:function(e){var t=e;this._views.push(t),t.attachToAppRef(this)}},{key:"detachView",value:function(e){var t=e;ah(this._views,t),t.detachFromAppRef()}},{key:"_loadComponent",value:function(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(El,[]).concat(this._bootstrapListeners).forEach(function(t){return t(e)})}},{key:"ngOnDestroy",value:function(){this._views.slice().forEach(function(e){return e.destroy()}),this._onMicrotaskEmptySubscription.unsubscribe()}},{key:"viewCount",get:function(){return this._views.length}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl),Qi(os),Qi(Jr),Qi(Wu),Qi(bl))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}();function ah(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var sh=th(null,"core",[{provide:Sl,useValue:"unknown"},{provide:ih,deps:[os]},{provide:Kl,deps:[]},{provide:Cl,deps:[]}]),uh=[{provide:oh,useClass:oh,deps:[Vl,os,Jr,Wu,bl]},{provide:Bc,deps:[Vl],useFactory:function(e){var t=[];return e.onStable.subscribe(function(){for(;t.length;)t.pop()()}),function(e){t.push(e)}}},{provide:bl,useClass:bl,deps:[[new or,yl]]},{provide:Ll,useClass:Ll,deps:[]},wl,{provide:pc,useFactory:function(){return xc},deps:[]},{provide:gc,useFactory:function(){return Sc},deps:[]},{provide:Ol,useFactory:function(e){return Nu(e=e||"undefined"!=typeof $localize&&$localize.locale||Du),e},deps:[[new rr(Ol),new or,new ar]]},{provide:Tl,useValue:"USD"}],ch=function(){var e=function e(t){m(this,e)};return e.\u0275fac=function(t){return new(t||e)(Qi(oh))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:uh}),e}(),lh=null;function hh(){return lh}var fh=new Mi("DocumentToken"),dh=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"historyGo",value:function(e){throw new Error("Not implemented")}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({factory:ph,token:e,providedIn:"platform"}),e}();function ph(){return Qi(vh)}var vh=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this))._doc=e,i._init(),i}return b(n,[{key:"_init",value:function(){this.location=window.location,this._history=window.history}},{key:"getBaseHrefFromDOM",value:function(){return hh().getBaseHref(this._doc)}},{key:"onPopState",value:function(e){var t=hh().getGlobalEventTarget(this._doc,"window");return t.addEventListener("popstate",e,!1),function(){return t.removeEventListener("popstate",e)}}},{key:"onHashChange",value:function(e){var t=hh().getGlobalEventTarget(this._doc,"window");return t.addEventListener("hashchange",e,!1),function(){return t.removeEventListener("hashchange",e)}}},{key:"href",get:function(){return this.location.href}},{key:"protocol",get:function(){return this.location.protocol}},{key:"hostname",get:function(){return this.location.hostname}},{key:"port",get:function(){return this.location.port}},{key:"pathname",get:function(){return this.location.pathname},set:function(e){this.location.pathname=e}},{key:"search",get:function(){return this.location.search}},{key:"hash",get:function(){return this.location.hash}},{key:"pushState",value:function(e,t,n){gh()?this._history.pushState(e,t,n):this.location.hash=n}},{key:"replaceState",value:function(e,t,n){gh()?this._history.replaceState(e,t,n):this.location.hash=n}},{key:"forward",value:function(){this._history.forward()}},{key:"back",value:function(){this._history.back()}},{key:"historyGo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._history.go(e)}},{key:"getState",value:function(){return this._history.state}}]),n}(dh);return e.\u0275fac=function(t){return new(t||e)(Qi(fh))},e.\u0275prov=Ke({factory:mh,token:e,providedIn:"platform"}),e}();function gh(){return!!window.history.pushState}function mh(){return new vh(Qi(fh))}function yh(e,t){if(0==e.length)return t;if(0==t.length)return e;var n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}function bh(e){var t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}function _h(e){return e&&"?"!==e[0]?"?"+e:e}var wh=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"historyGo",value:function(e){throw new Error("Not implemented")}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({factory:kh,token:e,providedIn:"root"}),e}();function kh(e){var t=Qi(fh).location;return new Sh(Qi(dh),t&&t.origin||"")}var xh=new Mi("appBaseHref"),Sh=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;if(m(this,n),(r=t.call(this))._platformLocation=e,r._removeListenerFns=[],null==i&&(i=r._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return r._baseHref=i,u(r)}return b(n,[{key:"ngOnDestroy",value:function(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}},{key:"onPopState",value:function(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}},{key:"getBaseHref",value:function(){return this._baseHref}},{key:"prepareExternalUrl",value:function(e){return yh(this._baseHref,e)}},{key:"path",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._platformLocation.pathname+_h(this._platformLocation.search),n=this._platformLocation.hash;return n&&e?"".concat(t).concat(n):t}},{key:"pushState",value:function(e,t,n,i){var r=this.prepareExternalUrl(n+_h(i));this._platformLocation.pushState(e,t,r)}},{key:"replaceState",value:function(e,t,n,i){var r=this.prepareExternalUrl(n+_h(i));this._platformLocation.replaceState(e,t,r)}},{key:"forward",value:function(){this._platformLocation.forward()}},{key:"back",value:function(){this._platformLocation.back()}},{key:"historyGo",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null===(t=(e=this._platformLocation).historyGo)||void 0===t||t.call(e,n)}}]),n}(wh);return e.\u0275fac=function(t){return new(t||e)(Qi(dh),Qi(xh,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Eh=function(){var e=function(){function e(t,n){var i=this;m(this,e),this._subject=new Zc,this._urlChangeListeners=[],this._platformStrategy=t;var r=this._platformStrategy.getBaseHref();this._platformLocation=n,this._baseHref=bh(Oh(r)),this._platformStrategy.onPopState(function(e){i._subject.emit({url:i.path(!0),pop:!0,state:e.state,type:e.type})})}return b(e,[{key:"path",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.normalize(this._platformStrategy.path(e))}},{key:"getState",value:function(){return this._platformLocation.getState()}},{key:"isCurrentPathEqualTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this.path()==this.normalize(e+_h(t))}},{key:"normalize",value:function(t){return e.stripTrailingSlash(function(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,Oh(t)))}},{key:"prepareExternalUrl",value:function(e){return e&&"/"!==e[0]&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)}},{key:"go",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._platformStrategy.pushState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+_h(t)),n)}},{key:"replaceState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._platformStrategy.replaceState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+_h(t)),n)}},{key:"forward",value:function(){this._platformStrategy.forward()}},{key:"back",value:function(){this._platformStrategy.back()}},{key:"historyGo",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null===(t=(e=this._platformStrategy).historyGo)||void 0===t||t.call(e,n)}},{key:"onUrlChange",value:function(e){var t=this;this._urlChangeListeners.push(e),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(function(e){t._notifyUrlChangeListeners(e.url,e.state)}))}},{key:"_notifyUrlChangeListeners",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;this._urlChangeListeners.forEach(function(n){return n(e,t)})}},{key:"subscribe",value:function(e,t,n){return this._subject.subscribe({next:e,error:t,complete:n})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(wh),Qi(dh))},e.normalizeQueryParams=_h,e.joinWithSlash=yh,e.stripTrailingSlash=bh,e.\u0275prov=Ke({factory:Ch,token:e,providedIn:"root"}),e}();function Ch(){return new Eh(Qi(wh),Qi(dh))}function Oh(e){return e.replace(/\/index.html$/,"")}var Th=((Th=Th||{})[Th.Zero=0]="Zero",Th[Th.One=1]="One",Th[Th.Two=2]="Two",Th[Th.Few=3]="Few",Th[Th.Many=4]="Many",Th[Th.Other=5]="Other",Th),Ah=function e(){m(this,e)},Ph=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).locale=e,i}return b(n,[{key:"getPluralCategory",value:function(e,t){switch(function(e){return function(e){var t=function(e){return e.toLowerCase().replace(/_/g,"-")}(e),n=Iu(t);if(n)return n;var i=t.split("-")[0];if(n=Iu(i))return n;if("en"===i)return Pu;throw new Error('Missing locale data for the locale "'.concat(e,'".'))}(e)[Ru.PluralCase]}(t||this.locale)(e)){case Th.Zero:return"zero";case Th.One:return"one";case Th.Two:return"two";case Th.Few:return"few";case Th.Many:return"many";default:return"other"}}}]),n}(Ah);return e.\u0275fac=function(t){return new(t||e)(Qi(Ol))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}();function Mh(e,n){n=encodeURIComponent(n);var i,r=_(e.split(";"));try{for(r.s();!(i=r.n()).done;){var o=i.value,a=o.indexOf("="),s=t(-1==a?[o,""]:[o.slice(0,a),o.slice(a+1)],2),u=s[0],c=s[1];if(u.trim()===n)return decodeURIComponent(c)}}catch(l){r.e(l)}finally{r.f()}return null}var Ih=function(){var e=function(){function e(t,n,i,r){m(this,e),this._iterableDiffers=t,this._keyValueDiffers=n,this._ngEl=i,this._renderer=r,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}return b(e,[{key:"klass",set:function(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}},{key:"ngClass",set:function(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(vs(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}},{key:"ngDoCheck",value:function(){if(this._iterableDiffer){var e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){var t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}},{key:"_applyKeyValueChanges",value:function(e){var t=this;e.forEachAddedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachChangedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){e.previousValue&&t._toggleClass(e.key,!1)})}},{key:"_applyIterableChanges",value:function(e){var t=this;e.forEachAddedItem(function(e){if("string"!=typeof e.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got ".concat(Be(e.item)));t._toggleClass(e.item,!0)}),e.forEachRemovedItem(function(e){return t._toggleClass(e.item,!1)})}},{key:"_applyClasses",value:function(e){var t=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return t._toggleClass(e,!0)}):Object.keys(e).forEach(function(n){return t._toggleClass(n,!!e[n])}))}},{key:"_removeClasses",value:function(e){var t=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return t._toggleClass(e,!1)}):Object.keys(e).forEach(function(e){return t._toggleClass(e,!1)}))}},{key:"_toggleClass",value:function(e,t){var n=this;(e=e.trim())&&e.split(/\s+/g).forEach(function(e){t?n._renderer.addClass(n._ngEl.nativeElement,e):n._renderer.removeClass(n._ngEl.nativeElement,e)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(pc),Es(gc),Es(Ku),Es(Zu))},e.\u0275dir=It({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),e}(),Rh=function(){function e(t,n,i,r){m(this,e),this.$implicit=t,this.ngForOf=n,this.index=i,this.count=r}return b(e,[{key:"first",get:function(){return 0===this.index}},{key:"last",get:function(){return this.index===this.count-1}},{key:"even",get:function(){return this.index%2==0}},{key:"odd",get:function(){return!this.even}}]),e}(),Dh=function(){var e=function(){function e(t,n,i){m(this,e),this._viewContainer=t,this._template=n,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}return b(e,[{key:"ngForOf",set:function(e){this._ngForOf=e,this._ngForOfDirty=!0}},{key:"ngForTrackBy",get:function(){return this._trackByFn},set:function(e){this._trackByFn=e}},{key:"ngForTemplate",set:function(e){e&&(this._template=e)}},{key:"ngDoCheck",value:function(){if(this._ngForOfDirty){this._ngForOfDirty=!1;var e=this._ngForOf;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(n){throw new Error("Cannot find a differ supporting object '".concat(e,"' of type '").concat(function(e){return e.name||typeof e}(e),"'. NgFor only supports binding to Iterables such as Arrays."))}}if(this._differ){var t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}},{key:"_applyChanges",value:function(e){var t=this,n=[];e.forEachOperation(function(e,i,r){if(null==e.previousIndex){var o=t._viewContainer.createEmbeddedView(t._template,new Rh(null,t._ngForOf,-1,-1),null===r?void 0:r),a=new Nh(e,o);n.push(a)}else if(null==r)t._viewContainer.remove(null===i?void 0:i);else if(null!==i){var s=t._viewContainer.get(i);t._viewContainer.move(s,r);var u=new Nh(e,s);n.push(u)}});for(var i=0;i1&&void 0!==arguments[1])||arguments[1],i=e.findTestabilityInTree(t,n);if(null==i)throw new Error("Could not find testability for element.");return i},vt.getAllAngularTestabilities=function(){return e.getAllTestabilities()},vt.getAllAngularRootElements=function(){return e.getAllRootElements()},vt.frameworkStabilizers||(vt.frameworkStabilizers=[]),vt.frameworkStabilizers.push(function(e){var t=vt.getAllAngularTestabilities(),n=t.length,i=!1,r=function(t){i=i||t,0==--n&&e(i)};t.forEach(function(e){e.whenStable(r)})})}},{key:"findTestabilityInTree",value:function(e,t,n){if(null==t)return null;var i=e.getTestability(t);return null!=i?i:n?hh().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}],[{key:"init",value:function(){!function(e){Ql=e}(new e)}}]),e}(),af=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"build",value:function(){return new XMLHttpRequest}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),sf=new Mi("EventManagerPlugins"),uf=function(){var e=function(){function e(t,n){var i=this;m(this,e),this._zone=n,this._eventNameToPlugin=new Map,t.forEach(function(e){return e.manager=i}),this._plugins=t.slice().reverse()}return b(e,[{key:"addEventListener",value:function(e,t,n){return this._findPluginFor(t).addEventListener(e,t,n)}},{key:"addGlobalEventListener",value:function(e,t,n){return this._findPluginFor(t).addGlobalEventListener(e,t,n)}},{key:"getZone",value:function(){return this._zone}},{key:"_findPluginFor",value:function(e){var t=this._eventNameToPlugin.get(e);if(t)return t;for(var n=this._plugins,i=0;i-1&&(t.splice(n,1),o+=e+".")}),o+=r,0!=t.length||0===r.length)return null;var a={};return a.domEventName=i,a.fullKey=o,a}},{key:"getEventFullKey",value:function(e){var t="",n=function(e){var t=e.key;if(null==t){if(null==(t=e.keyIdentifier))return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),3===e.location&&Sf.hasOwnProperty(t)&&(t=Sf[t]))}return xf[t]||t}(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),kf.forEach(function(i){i!=n&&Ef[i](e)&&(t+=i+".")}),t+=n}},{key:"eventCallback",value:function(e,t,i){return function(r){n.getEventFullKey(r)===e&&i.runGuarded(function(){return t(r)})}}},{key:"_normalizeKey",value:function(e){switch(e){case"esc":return"escape";default:return e}}}]),n}(cf);return e.\u0275fac=function(t){return new(t||e)(Qi(fh))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Of=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({factory:function(){return Qi(Tf)},token:e,providedIn:"root"}),e}(),Tf=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this))._doc=e,i}return b(n,[{key:"sanitize",value:function(e,t){if(null==t)return null;switch(e){case Hr.NONE:return t;case Hr.HTML:return yr(t,"HTML")?mr(t):zr(this._doc,String(t)).toString();case Hr.STYLE:return yr(t,"Style")?mr(t):t;case Hr.SCRIPT:if(yr(t,"Script"))return mr(t);throw new Error("unsafe value used in a script context");case Hr.URL:return br(t),yr(t,"URL")?mr(t):Sr(String(t));case Hr.RESOURCE_URL:if(yr(t,"ResourceURL"))return mr(t);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext ".concat(e," (see https://g.co/ng/security#xss)"))}}},{key:"bypassSecurityTrustHtml",value:function(e){return function(e){return new fr(e)}(e)}},{key:"bypassSecurityTrustStyle",value:function(e){return function(e){return new dr(e)}(e)}},{key:"bypassSecurityTrustScript",value:function(e){return function(e){return new pr(e)}(e)}},{key:"bypassSecurityTrustUrl",value:function(e){return function(e){return new vr(e)}(e)}},{key:"bypassSecurityTrustResourceUrl",value:function(e){return function(e){return new gr(e)}(e)}}]),n}(Of);return e.\u0275fac=function(t){return new(t||e)(Qi(fh))},e.\u0275prov=Ke({factory:function(){return function(e){return new Tf(e.get(fh))}(Qi(Wa))},token:e,providedIn:"root"}),e}(),Af=th(sh,"browser",[{provide:Sl,useValue:Qh},{provide:xl,useValue:function(){ef.makeCurrent(),of.init()},multi:!0},{provide:fh,useFactory:function(){return function(e){Qt=e}(document),document},deps:[]}]),Pf=[[],{provide:Xa,useValue:"root"},{provide:Jr,useFactory:function(){return new Jr},deps:[]},{provide:sf,useClass:wf,multi:!0,deps:[fh,Vl,Sl]},{provide:sf,useClass:Cf,multi:!0,deps:[fh]},[],{provide:mf,useClass:mf,deps:[uf,hf,_l]},{provide:$u,useExisting:mf},{provide:lf,useExisting:hf},{provide:hf,useClass:hf,deps:[fh]},{provide:Yl,useClass:Yl,deps:[Vl]},{provide:uf,useClass:uf,deps:[sf,Vl]},{provide:Jh,useClass:af,deps:[]},[]],Mf=function(){var e=function(){function e(t){if(m(this,e),t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}return b(e,null,[{key:"withServerTransition",value:function(t){return{ngModule:e,providers:[{provide:_l,useValue:t.appId},{provide:nf,useExisting:_l},rf]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(e,12))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:Pf,imports:[Kh,ch]}),e}();function If(e){return null!=e&&"false"!="".concat(e)}function Rf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(e){return!isNaN(parseFloat(e))&&!isNaN(Number(e))}(e)?Number(e):t}function Df(e){return Array.isArray(e)?e:[e]}function Nf(e){return null==e?"":"string"==typeof e?e:"".concat(e,"px")}function Lf(e){return e instanceof Ku?e.nativeElement:e}function jf(){for(var e=arguments.length,t=new Array(e),n=0;n1?Array.prototype.slice.call(arguments):e)},i,n)})}function Bf(e,t,n,i,r){var o;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(e)){var a=e;e.addEventListener(t,n,r),o=function(){return a.removeEventListener(t,n,r)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(e)){var s=e;e.on(t,n),o=function(){return s.off(t,n)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(e)){var u=e;e.addListener(t,n),o=function(){return u.removeListener(t,n)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var c=0,l=e.length;c1&&void 0!==arguments[1]?arguments[1]:0;if(this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(i,this.id,t),this}},{key:"requestAsyncId",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return setInterval(e.flush.bind(e,this),n)}},{key:"recycleAsyncId",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)}},{key:"execute",value:function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}},{key:"_execute",value:function(e,t){var n,i=!1;try{this.work(e)}catch(r){i=!0,n=!!r&&r||new Error(r)}if(i)return this.unsubscribe(),n}},{key:"_unsubscribe",value:function(){var e=this.id,t=this.scheduler,n=t.actions,i=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&n.splice(i,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}]),n}(function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this)}return b(n,[{key:"schedule",value:function(e){return this}}]),n}(W)),zf=function(){var e=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.now;m(this,e),this.SchedulerAction=t,this.now=n}return b(e,[{key:"schedule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;return new this.SchedulerAction(this,e).schedule(n,t)}}]),e}();return e.now=function(){return Date.now()},e}(),Uf=function(t){a(i,t);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zf.now;return m(this,i),(t=n.call(this,e,function(){return i.delegate&&i.delegate!==c(t)?i.delegate.now():r()})).actions=[],t.active=!1,t.scheduled=void 0,t}return b(i,[{key:"schedule",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return i.delegate&&i.delegate!==this?i.delegate.schedule(t,n,r):e(p(i.prototype),"schedule",this).call(this,t,n,r)}},{key:"flush",value:function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}}}]),i}(zf);new(function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"flush",value:function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,i=-1,r=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++i2&&void 0!==arguments[2]?arguments[2]:0;return null!==r&&r>0?e(p(i.prototype),"requestAsyncId",this).call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame(function(){return t.flush(null)})))}},{key:"recycleAsyncId",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==r&&r>0||null===r&&this.delay>0)return e(p(i.prototype),"recycleAsyncId",this).call(this,t,n,r);0===t.actions.length&&(cancelAnimationFrame(n),t.scheduled=void 0)}}]),i}(Vf));var Hf=1,Gf=Promise.resolve(),Wf={};function qf(e){return e in Wf&&(delete Wf[e],!0)}var Xf=function(e){var t=Hf++;return Wf[t]=!0,Gf.then(function(){return qf(t)&&e()}),t},Yf=function(e){qf(e)};function Kf(e){return!!e&&(e instanceof ee||"function"==typeof e.lift&&"function"==typeof e.subscribe)}function Qf(e,t){return function(n){return n.lift(new $f(e,t))}}new(function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"flush",value:function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,i=-1,r=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++i2&&void 0!==arguments[2]?arguments[2]:0;return null!==r&&r>0?e(p(i.prototype),"requestAsyncId",this).call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=Xf(t.flush.bind(t,null))))}},{key:"recycleAsyncId",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==r&&r>0||null===r&&this.delay>0)return e(p(i.prototype),"recycleAsyncId",this).call(this,t,n,r);0===t.actions.length&&(Yf(n),t.scheduled=void 0)}}]),i}(Vf));var $f=function(){function e(t,n){m(this,e),this.compare=t,this.keySelector=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new Zf(e,this.compare,this.keySelector))}}]),e}(),Zf=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).keySelector=r,o.hasKey=!1,"function"==typeof i&&(o.compare=i),o}return b(n,[{key:"compare",value:function(e,t){return e===t}},{key:"_next",value:function(e){var t;try{var n=this.keySelector;t=n?n(e):e}catch(n){return this.destination.error(n)}var i=!1;if(this.hasKey)try{i=(0,this.compare)(this.key,t)}catch(n){return this.destination.error(n)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}]),n}(Y),Jf=new Uf(Vf),ed=function(){function e(t){m(this,e),this.durationSelector=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new td(e,this.durationSelector))}}]),e}(),td=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).durationSelector=i,r.hasValue=!1,r}return b(n,[{key:"_next",value:function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t;try{var n;t=(0,this.durationSelector)(e)}catch(n){return this.destination.error(n)}var i=_e(t,new ye(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}},{key:"clearThrottle",value:function(){var e=this.value,t=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}},{key:"notifyNext",value:function(){this.clearThrottle()}},{key:"notifyComplete",value:function(){this.clearThrottle()}}]),n}(be);function nd(e){return!z(e)&&e-parseFloat(e)+1>=0}function id(e){var t=e.index,n=e.period,i=e.subscriber;if(i.next(t),!i.closed){if(-1===n)return i.complete();e.index=t+1,this.schedule(e,n)}}function rd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jf;return function(e){return function(t){return t.lift(new ed(e))}}(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=-1;return nd(t)?i=Number(t)<1?1:Number(t):se(t)&&(n=t),se(n)||(n=Jf),new ee(function(t){var r=nd(e)?e:+e-n.now();return n.schedule(id,r,{index:0,period:i,subscriber:t})})}(e,t)})}function od(e,t){return function(n){return n.lift(new ad(e,t))}}var ad=function(){function e(t,n){m(this,e),this.predicate=t,this.thisArg=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new sd(e,this.predicate,this.thisArg))}}]),e}(),sd=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).predicate=i,o.thisArg=r,o.count=0,o}return b(n,[{key:"_next",value:function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}t&&this.destination.next(e)}}]),n}(Y);function ud(e){return function(t){return t.lift(new cd(e))}}var cd=function(){function e(t){m(this,e),this.notifier=t}return b(e,[{key:"call",value:function(e,t){var n=new ld(e),i=_e(this.notifier,new ye(n));return i&&!n.seenValue?(n.add(i),t.subscribe(n)):n}}]),e}(),ld=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,e)).seenValue=!1,i}return b(n,[{key:"notifyNext",value:function(){this.seenValue=!0,this.complete()}},{key:"notifyComplete",value:function(){}}]),n}(be);function hd(){return Se(1)(jf.apply(void 0,arguments))}function fd(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return n>0?e(p(i.prototype),"schedule",this).call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)}},{key:"execute",value:function(t,n){return n>0||this.closed?e(p(i.prototype),"execute",this).call(this,t,n):this._execute(t,n)}},{key:"requestAsyncId",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null!==r&&r>0||null===r&&this.delay>0?e(p(i.prototype),"requestAsyncId",this).call(this,t,n,r):t.flush(this)}}]),i}(Vf)),md=new ee(function(e){return e.complete()});function yd(e){return e?function(e){return new ee(function(t){return e.schedule(function(){return t.complete()})})}(e):md}function bd(e,t){return new ee(t?function(n){return t.schedule(_d,0,{error:e,subscriber:n})}:function(t){return t.error(e)})}function _d(e){var t=e.error;e.subscriber.error(t)}var wd=function(){function e(t,n,i){m(this,e),this.kind=t,this.value=n,this.error=i,this.hasValue="N"===t}return b(e,[{key:"observe",value:function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}},{key:"do",value:function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}}},{key:"accept",value:function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)}},{key:"toObservable",value:function(){switch(this.kind){case"N":return jf(this.value);case"E":return bd(this.error);case"C":return yd()}throw new Error("unexpected notification kind value")}}],[{key:"createNext",value:function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification}},{key:"createError",value:function(t){return new e("E",void 0,t)}},{key:"createComplete",value:function(){return e.completeNotification}}]),e}();wd.completeNotification=new wd("C"),wd.undefinedValueNotification=new wd("N",void 0);var kd,xd=function(e){a(n,e);var t=s(n);function n(e,i){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return m(this,n),(r=t.call(this,e)).scheduler=i,r.delay=o,r}return b(n,[{key:"scheduleMessage",value:function(e){this.destination.add(this.scheduler.schedule(n.dispatch,this.delay,new Sd(e,this.destination)))}},{key:"_next",value:function(e){this.scheduleMessage(wd.createNext(e))}},{key:"_error",value:function(e){this.scheduleMessage(wd.createError(e)),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleMessage(wd.createComplete()),this.unsubscribe()}}],[{key:"dispatch",value:function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()}}]),n}(Y),Sd=function e(t,n){m(this,e),this.notification=t,this.destination=n},Ed=function(t){a(i,t);var n=s(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY,o=arguments.length>2?arguments[2]:void 0;return m(this,i),(e=n.call(this)).scheduler=o,e._events=[],e._infiniteTimeWindow=!1,e._bufferSize=t<1?1:t,e._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(e._infiniteTimeWindow=!0,e.next=e.nextInfiniteTimeWindow):e.next=e.nextTimeWindow,e}return b(i,[{key:"nextInfiniteTimeWindow",value:function(t){if(!this.isStopped){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift()}e(p(i.prototype),"next",this).call(this,t)}},{key:"nextTimeWindow",value:function(t){this.isStopped||(this._events.push(new Cd(this._getNow(),t)),this._trimBufferThenGetEvents()),e(p(i.prototype),"next",this).call(this,t)}},{key:"_subscribe",value:function(e){var t,n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,o=i.length;if(this.closed)throw new ne;if(this.isStopped||this.hasError?t=W.EMPTY:(this.observers.push(e),t=new ie(this,e)),r&&e.add(e=new xd(e,r)),n)for(var a=0;at&&(o=Math.max(o,r-t)),o>0&&i.splice(0,o),i}}]),i}(oe),Cd=function e(t,n){m(this,e),this.time=t,this.value=n};function Od(e,t,n){var i;return i=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n},function(e){return e.lift(function(e){var t,n,i=e.bufferSize,r=void 0===i?Number.POSITIVE_INFINITY:i,o=e.windowTime,a=void 0===o?Number.POSITIVE_INFINITY:o,s=e.refCount,u=e.scheduler,c=0,l=!1,h=!1;return function(e){var i;c++,!t||l?(l=!1,t=new Ed(r,a,u),i=t.subscribe(this),n=e.subscribe({next:function(e){t.next(e)},error:function(e){l=!0,t.error(e)},complete:function(){h=!0,n=void 0,t.complete()}}),h&&(n=void 0)):i=t.subscribe(this),this.add(function(){c--,i.unsubscribe(),i=void 0,n&&!h&&s&&0===c&&(n.unsubscribe(),n=void 0,t=void 0)})}}(i))}}try{kd="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(H){kd=!1}var Td,Ad,Pd,Md,Id=function(){var e=function e(t){m(this,e),this._platformId=t,this.isBrowser=this._platformId?$h(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!kd)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT};return e.\u0275fac=function(t){return new(t||e)(Qi(Sl))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Sl))},token:e,providedIn:"root"}),e}(),Rd=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),Dd=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function Nd(){if(Td)return Td;if("object"!=typeof document||!document)return Td=new Set(Dd);var e=document.createElement("input");return Td=new Set(Dd.filter(function(t){return e.setAttribute("type",t),e.type===t}))}function Ld(e){return function(){if(null==Ad&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Ad=!0}}))}finally{Ad=Ad||!1}return Ad}()?e:!!e.capture}function jd(e){if(function(){if(null==Md){var e="undefined"!=typeof document?document.head:null;Md=!(!e||!e.createShadowRoot&&!e.attachShadow)}return Md}()){var t=e.getRootNode?e.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&t instanceof ShadowRoot)return t}return null}function Fd(){for(var e="undefined"!=typeof document&&document?document.activeElement:null;e&&e.shadowRoot;){var t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}function Bd(e){return e.composedPath?e.composedPath()[0]:e.target}var Vd=new Mi("cdk-dir-doc",{providedIn:"root",factory:function(){return $i(fh)}}),zd=function(){var e=function(){function e(t){if(m(this,e),this.value="ltr",this.change=new Zc,t){var n=t.documentElement?t.documentElement.dir:null,i=(t.body?t.body.dir:null)||n;this.value="ltr"===i||"rtl"===i?i:"ltr"}}return b(e,[{key:"ngOnDestroy",value:function(){this.change.complete()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vd,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Vd,8))},token:e,providedIn:"root"}),e}(),Ud=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),Hd=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];m(this,e),this._multiple=n,this._emitChanges=r,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new oe,i&&i.length&&(n?i.forEach(function(e){return t._markSelected(e)}):this._markSelected(i[0]),this._selectedToEmit.length=0)}return b(e,[{key:"selected",get:function(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}},{key:"select",value:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i0&&void 0!==arguments[0]?arguments[0]:20;return this._platform.isBrowser?new ee(function(n){e._globalSubscription||e._addGlobalListener();var i=t>0?e._scrolled.pipe(rd(t)).subscribe(n):e._scrolled.subscribe(n);return e._scrolledCount++,function(){i.unsubscribe(),e._scrolledCount--,e._scrolledCount||e._removeGlobalListener()}}):jf()}},{key:"ngOnDestroy",value:function(){var e=this;this._removeGlobalListener(),this.scrollContainers.forEach(function(t,n){return e.deregister(n)}),this._scrolled.complete()}},{key:"ancestorScrolled",value:function(e,t){var n=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(od(function(e){return!e||n.indexOf(e)>-1}))}},{key:"getAncestorScrollContainers",value:function(e){var t=this,n=[];return this.scrollContainers.forEach(function(i,r){t._scrollableContainsElement(r,e)&&n.push(r)}),n}},{key:"_getWindow",value:function(){return this._document.defaultView||window}},{key:"_scrollableContainsElement",value:function(e,t){var n=Lf(t),i=e.getElementRef().nativeElement;do{if(n==i)return!0}while(n=n.parentElement);return!1}},{key:"_addGlobalListener",value:function(){var e=this;this._globalSubscription=this._ngZone.runOutsideAngular(function(){return Ff(e._getWindow().document,"scroll").subscribe(function(){return e._scrolled.next()})})}},{key:"_removeGlobalListener",value:function(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl),Qi(Id),Qi(fh,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Vl),Qi(Id),Qi(fh,8))},token:e,providedIn:"root"}),e}(),qd=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this._platform=t,this._change=new oe,this._changeListener=function(e){r._change.next(e)},this._document=i,n.runOutsideAngular(function(){if(t.isBrowser){var e=r._getWindow();e.addEventListener("resize",r._changeListener),e.addEventListener("orientationchange",r._changeListener)}r.change().subscribe(function(){return r._viewportSize=null})})}return b(e,[{key:"ngOnDestroy",value:function(){if(this._platform.isBrowser){var e=this._getWindow();e.removeEventListener("resize",this._changeListener),e.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}},{key:"getViewportSize",value:function(){this._viewportSize||this._updateViewportSize();var e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}},{key:"getViewportRect",value:function(){var e=this.getViewportScrollPosition(),t=this.getViewportSize(),n=t.width,i=t.height;return{top:e.top,left:e.left,bottom:e.top+i,right:e.left+n,height:i,width:n}}},{key:"getViewportScrollPosition",value:function(){if(!this._platform.isBrowser)return{top:0,left:0};var e=this._document,t=this._getWindow(),n=e.documentElement,i=n.getBoundingClientRect();return{top:-i.top||e.body.scrollTop||t.scrollY||n.scrollTop||0,left:-i.left||e.body.scrollLeft||t.scrollX||n.scrollLeft||0}}},{key:"change",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return e>0?this._change.pipe(rd(e)):this._change}},{key:"_getWindow",value:function(){return this._document.defaultView||window}},{key:"_updateViewportSize",value:function(){var e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id),Qi(Vl),Qi(fh,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id),Qi(Vl),Qi(fh,8))},token:e,providedIn:"root"}),e}(),Xd=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),Yd=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Ud,Rd,Xd],Ud,Xd]}),e}(),Kd=function(){function e(){m(this,e)}return b(e,[{key:"attach",value:function(e){return this._attachedHost=e,e.attach(this)}},{key:"detach",value:function(){var e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}},{key:"isAttached",get:function(){return null!=this._attachedHost}},{key:"setAttachedHost",value:function(e){this._attachedHost=e}}]),e}(),Qd=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;return m(this,n),(a=t.call(this)).component=e,a.viewContainerRef=i,a.injector=r,a.componentFactoryResolver=o,a}return n}(Kd),$d=function(t){a(i,t);var n=s(i);function i(e,t,r){var o;return m(this,i),(o=n.call(this)).templateRef=e,o.viewContainerRef=t,o.context=r,o}return b(i,[{key:"origin",get:function(){return this.templateRef.elementRef}},{key:"attach",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.context;return this.context=n,e(p(i.prototype),"attach",this).call(this,t)}},{key:"detach",value:function(){return this.context=void 0,e(p(i.prototype),"detach",this).call(this)}}]),i}(Kd),Zd=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).element=e instanceof Ku?e.nativeElement:e,i}return n}(Kd),Jd=function(){function e(){m(this,e),this._isDisposed=!1,this.attachDomPortal=null}return b(e,[{key:"hasAttached",value:function(){return!!this._attachedPortal}},{key:"attach",value:function(e){return e instanceof Qd?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof $d?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof Zd?(this._attachedPortal=e,this.attachDomPortal(e)):void 0}},{key:"detach",value:function(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}},{key:"dispose",value:function(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}},{key:"setDisposeFn",value:function(e){this._disposeFn=e}},{key:"_invokeDisposeFn",value:function(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}]),e}(),ep=function(t){a(i,t);var n=s(i);function i(t,r,o,a,s){var u,l;return m(this,i),(l=n.call(this)).outletElement=t,l._componentFactoryResolver=r,l._appRef=o,l._defaultInjector=a,l.attachDomPortal=function(t){var n=t.element,r=l._document.createComment("dom-portal");n.parentNode.insertBefore(r,n),l.outletElement.appendChild(n),l._attachedPortal=t,e((u=c(l),p(i.prototype)),"setDisposeFn",u).call(u,function(){r.parentNode&&r.parentNode.replaceChild(n,r)})},l._document=s,l}return b(i,[{key:"attachComponentPortal",value:function(e){var t,n=this,i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);return e.viewContainerRef?(t=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(function(){return t.destroy()})):(t=i.create(e.injector||this._defaultInjector),this._appRef.attachView(t.hostView),this.setDisposeFn(function(){n._appRef.detachView(t.hostView),t.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(t)),this._attachedPortal=e,t}},{key:"attachTemplatePortal",value:function(e){var t=this,n=e.viewContainerRef,i=n.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(function(e){return t.outletElement.appendChild(e)}),i.detectChanges(),this.setDisposeFn(function(){var e=n.indexOf(i);-1!==e&&n.remove(e)}),this._attachedPortal=e,i}},{key:"dispose",value:function(){e(p(i.prototype),"dispose",this).call(this),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}},{key:"_getComponentRootNode",value:function(e){return e.hostView.rootNodes[0]}}]),i}(Jd),tp=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this,e,i)}return n}($d);return e.\u0275fac=function(t){return new(t||e)(Es(Cc),Es(Mc))},e.\u0275dir=It({type:e,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[ss]}),e}(),np=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(tp);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["","cdk-portal",""],["","portal",""]],exportAs:["cdkPortal"],features:[Hu([{provide:tp,useExisting:t}]),ss]}),t}(),ip=function(){var t=function(t){a(i,t);var n=s(i);function i(t,r,o){var a,s;return m(this,i),(s=n.call(this))._componentFactoryResolver=t,s._viewContainerRef=r,s._isInitialized=!1,s.attached=new Zc,s.attachDomPortal=function(t){var n=t.element,r=s._document.createComment("dom-portal");t.setAttachedHost(c(s)),n.parentNode.insertBefore(r,n),s._getRootNode().appendChild(n),s._attachedPortal=t,e((a=c(s),p(i.prototype)),"setDisposeFn",a).call(a,function(){r.parentNode&&r.parentNode.replaceChild(n,r)})},s._document=o,s}return b(i,[{key:"portal",get:function(){return this._attachedPortal},set:function(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&e(p(i.prototype),"detach",this).call(this),t&&e(p(i.prototype),"attach",this).call(this,t),this._attachedPortal=t)}},{key:"attachedRef",get:function(){return this._attachedRef}},{key:"ngOnInit",value:function(){this._isInitialized=!0}},{key:"ngOnDestroy",value:function(){e(p(i.prototype),"dispose",this).call(this),this._attachedPortal=null,this._attachedRef=null}},{key:"attachComponentPortal",value:function(t){t.setAttachedHost(this);var n=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,r=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=n.createComponent(r,n.length,t.injector||n.injector);return n!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),e(p(i.prototype),"setDisposeFn",this).call(this,function(){return o.destroy()}),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}},{key:"attachTemplatePortal",value:function(t){var n=this;t.setAttachedHost(this);var r=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return e(p(i.prototype),"setDisposeFn",this).call(this,function(){return n._viewContainerRef.clear()}),this._attachedPortal=t,this._attachedRef=r,this.attached.emit(r),r}},{key:"_getRootNode",value:function(){var e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}}]),i}(Jd);return t.\u0275fac=function(e){return new(e||t)(Es(Wu),Es(Mc),Es(fh))},t.\u0275dir=It({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ss]}),t}(),rp=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),op=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}();function ap(e){return function(t){return 0===e?yd():t.lift(new sp(e))}}var sp=function(){function e(t){if(m(this,e),this.total=t,this.total<0)throw new op}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new up(e,this.total))}}]),e}(),up=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).total=i,r.count=0,r}return b(n,[{key:"_next",value:function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))}}]),n}(Y);function cp(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){return n.lift(new lp(e,t))}}var lp=function(){function e(t,n){m(this,e),this.predicate=t,this.inclusive=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new hp(e,this.predicate,this.inclusive))}}]),e}(),hp=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).predicate=i,o.inclusive=r,o.index=0,o}return b(n,[{key:"_next",value:function(e){var t,n=this.destination;try{t=this.predicate(e,this.index++)}catch(i){return void n.error(i)}this.nextOrComplete(e,t)}},{key:"nextOrComplete",value:function(e,t){var n=this.destination;Boolean(t)?n.next(e):(this.inclusive&&n.next(e),n.complete())}}]),n}(Y);function fp(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;it.height||e.scrollWidth>t.width}}]),e}(),vp=function(){function e(t,n,i,r){var o=this;m(this,e),this._scrollDispatcher=t,this._ngZone=n,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=function(){o.disable(),o._overlayRef.hasAttached()&&o._ngZone.run(function(){return o._overlayRef.detach()})}}return b(e,[{key:"attach",value:function(e){this._overlayRef=e}},{key:"enable",value:function(){var e=this;if(!this._scrollSubscription){var t=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(function(){var t=e._viewportRuler.getViewportScrollPosition().top;Math.abs(t-e._initialScrollPosition)>e._config.threshold?e._detach():e._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}}},{key:"disable",value:function(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}},{key:"detach",value:function(){this.disable(),this._overlayRef=null}}]),e}(),gp=function(){function e(){m(this,e)}return b(e,[{key:"enable",value:function(){}},{key:"disable",value:function(){}},{key:"attach",value:function(){}}]),e}();function mp(e,t){return t.some(function(t){return e.bottomt.bottom||e.rightt.right})}function yp(e,t){return t.some(function(t){return e.topt.bottom||e.leftt.right})}var bp=function(){function e(t,n,i,r){m(this,e),this._scrollDispatcher=t,this._viewportRuler=n,this._ngZone=i,this._config=r,this._scrollSubscription=null}return b(e,[{key:"attach",value:function(e){this._overlayRef=e}},{key:"enable",value:function(){var e=this;this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(function(){if(e._overlayRef.updatePosition(),e._config&&e._config.autoClose){var t=e._overlayRef.overlayElement.getBoundingClientRect(),n=e._viewportRuler.getViewportSize(),i=n.width,r=n.height;mp(t,[{width:i,height:r,bottom:r,right:i,top:0,left:0}])&&(e.disable(),e._ngZone.run(function(){return e._overlayRef.detach()}))}}))}},{key:"disable",value:function(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}},{key:"detach",value:function(){this.disable(),this._overlayRef=null}}]),e}(),_p=function(){var e=function e(t,n,i,r){var o=this;m(this,e),this._scrollDispatcher=t,this._viewportRuler=n,this._ngZone=i,this.noop=function(){return new gp},this.close=function(e){return new vp(o._scrollDispatcher,o._ngZone,o._viewportRuler,e)},this.block=function(){return new pp(o._viewportRuler,o._document)},this.reposition=function(e){return new bp(o._scrollDispatcher,o._viewportRuler,o._ngZone,e)},this._document=r};return e.\u0275fac=function(t){return new(t||e)(Qi(Wd),Qi(qd),Qi(Vl),Qi(fh))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Wd),Qi(qd),Qi(Vl),Qi(fh))},token:e,providedIn:"root"}),e}(),wp=function e(t){if(m(this,e),this.scrollStrategy=new gp,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t)for(var n=0,i=Object.keys(t);n-1&&this._attachedOverlays.splice(t,1),0===this._attachedOverlays.length&&this.detach()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(fh))},e.\u0275prov=Ke({factory:function(){return new e(Qi(fh))},token:e,providedIn:"root"}),e}(),Ep=function(){var t=function(t){a(i,t);var n=s(i);function i(e){var t;return m(this,i),(t=n.call(this,e))._keydownListener=function(e){for(var n=t._attachedOverlays,i=n.length-1;i>-1;i--)if(n[i]._keydownEvents.observers.length>0){n[i]._keydownEvents.next(e);break}},t}return b(i,[{key:"add",value:function(t){e(p(i.prototype),"add",this).call(this,t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}},{key:"detach",value:function(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}]),i}(Sp);return t.\u0275fac=function(e){return new(e||t)(Qi(fh))},t.\u0275prov=Ke({factory:function(){return new t(Qi(fh))},token:t,providedIn:"root"}),t}(),Cp=function(){var t=function(t){a(i,t);var n=s(i);function i(e,t){var r;return m(this,i),(r=n.call(this,e))._platform=t,r._cursorStyleIsSet=!1,r._clickListener=function(e){for(var t=Bd(e),n=r._attachedOverlays.slice(),i=n.length-1;i>-1;i--){var o=n[i];if(!(o._outsidePointerEvents.observers.length<1)&&o.hasAttached()){if(o.overlayElement.contains(t))break;o._outsidePointerEvents.next(e)}}},r}return b(i,[{key:"add",value:function(t){if(e(p(i.prototype),"add",this).call(this,t),!this._isAttached){var n=this._document.body;n.addEventListener("click",this._clickListener,!0),n.addEventListener("auxclick",this._clickListener,!0),n.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}},{key:"detach",value:function(){if(this._isAttached){var e=this._document.body;e.removeEventListener("click",this._clickListener,!0),e.removeEventListener("auxclick",this._clickListener,!0),e.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(e.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}]),i}(Sp);return t.\u0275fac=function(e){return new(e||t)(Qi(fh),Qi(Id))},t.\u0275prov=Ke({factory:function(){return new t(Qi(fh),Qi(Id))},token:t,providedIn:"root"}),t}(),Op="undefined"!=typeof window?window:{},Tp=void 0!==Op.__karma__&&!!Op.__karma__||void 0!==Op.jasmine&&!!Op.jasmine||void 0!==Op.jest&&!!Op.jest||void 0!==Op.Mocha&&!!Op.Mocha,Ap=function(){var e=function(){function e(t,n){m(this,e),this._platform=n,this._document=t}return b(e,[{key:"ngOnDestroy",value:function(){var e=this._containerElement;e&&e.parentNode&&e.parentNode.removeChild(e)}},{key:"getContainerElement",value:function(){return this._containerElement||this._createContainer(),this._containerElement}},{key:"_createContainer",value:function(){var e="cdk-overlay-container";if(this._platform.isBrowser||Tp)for(var t=this._document.querySelectorAll(".".concat(e,'[platform="server"], .').concat(e,'[platform="test"]')),n=0;nd&&(d=g,f=v)}}catch(m){p.e(m)}finally{p.f()}return this._isPushed=!1,void this._applyPosition(f.position,f.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(e.position,e.originPoint);this._applyPosition(e.position,e.originPoint)}}},{key:"detach",value:function(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}},{key:"dispose",value:function(){this._isDisposed||(this._boundingBox&&Dp(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Mp),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}},{key:"reapplyLastPosition",value:function(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();var e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}},{key:"withScrollableContainers",value:function(e){return this._scrollables=e,this}},{key:"withPositions",value:function(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}},{key:"withViewportMargin",value:function(e){return this._viewportMargin=e,this}},{key:"withFlexibleDimensions",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._hasFlexibleDimensions=e,this}},{key:"withGrowAfterOpen",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._growAfterOpen=e,this}},{key:"withPush",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._canPush=e,this}},{key:"withLockedPosition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._positionLocked=e,this}},{key:"setOrigin",value:function(e){return this._origin=e,this}},{key:"withDefaultOffsetX",value:function(e){return this._offsetX=e,this}},{key:"withDefaultOffsetY",value:function(e){return this._offsetY=e,this}},{key:"withTransformOriginOn",value:function(e){return this._transformOriginSelector=e,this}},{key:"_getOriginPoint",value:function(e,t){var n;if("center"==t.originX)n=e.left+e.width/2;else{var i=this._isRtl()?e.right:e.left,r=this._isRtl()?e.left:e.right;n="start"==t.originX?i:r}return{x:n,y:"center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom}}},{key:"_getOverlayPoint",value:function(e,t,n){var i,r;return i="center"==n.overlayX?-t.width/2:"start"===n.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,r="center"==n.overlayY?-t.height/2:"top"==n.overlayY?0:-t.height,{x:e.x+i,y:e.y+r}}},{key:"_getOverlayFit",value:function(e,t,n,i){var r=Lp(t),o=e.x,a=e.y,s=this._getOffset(i,"x"),u=this._getOffset(i,"y");s&&(o+=s),u&&(a+=u);var c=0-a,l=a+r.height-n.height,h=this._subtractOverflows(r.width,0-o,o+r.width-n.width),f=this._subtractOverflows(r.height,c,l),d=h*f;return{visibleArea:d,isCompletelyWithinViewport:r.width*r.height===d,fitsInViewportVertically:f===r.height,fitsInViewportHorizontally:h==r.width}}},{key:"_canFitWithFlexibleDimensions",value:function(e,t,n){if(this._hasFlexibleDimensions){var i=n.bottom-t.y,r=n.right-t.x,o=Np(this._overlayRef.getConfig().minHeight),a=Np(this._overlayRef.getConfig().minWidth),s=e.fitsInViewportHorizontally||null!=a&&a<=r;return(e.fitsInViewportVertically||null!=o&&o<=i)&&s}return!1}},{key:"_pushOverlayOnScreen",value:function(e,t,n){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};var i,r,o=Lp(t),a=this._viewportRect,s=Math.max(e.x+o.width-a.width,0),u=Math.max(e.y+o.height-a.height,0),c=Math.max(a.top-n.top-e.y,0),l=Math.max(a.left-n.left-e.x,0);return i=o.width<=a.width?l||-s:e.xh&&!this._isInitialRender&&!this._growAfterOpen&&(i=e.y-h/2)}if("end"===t.overlayX&&!c||"start"===t.overlayX&&c)s=u.width-e.x+this._viewportMargin,o=e.x-this._viewportMargin;else if("start"===t.overlayX&&!c||"end"===t.overlayX&&c)a=e.x,o=u.right-e.x;else{var f=Math.min(u.right-e.x+u.left,e.x),d=this._lastBoundingBoxSize.width;o=2*f,a=e.x-f,o>d&&!this._isInitialRender&&!this._growAfterOpen&&(a=e.x-d/2)}return{top:i,left:a,bottom:r,right:s,width:o,height:n}}},{key:"_setBoundingBoxStyles",value:function(e,t){var n=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));var i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{var r=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;i.height=Nf(n.height),i.top=Nf(n.top),i.bottom=Nf(n.bottom),i.width=Nf(n.width),i.left=Nf(n.left),i.right=Nf(n.right),i.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",i.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",r&&(i.maxHeight=Nf(r)),o&&(i.maxWidth=Nf(o))}this._lastBoundingBoxSize=n,Dp(this._boundingBox.style,i)}},{key:"_resetBoundingBoxStyles",value:function(){Dp(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}},{key:"_resetOverlayElementStyles",value:function(){Dp(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}},{key:"_setOverlayElementStyles",value:function(e,t){var n={},i=this._hasExactPosition(),r=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(i){var a=this._viewportRuler.getViewportScrollPosition();Dp(n,this._getExactOverlayY(t,e,a)),Dp(n,this._getExactOverlayX(t,e,a))}else n.position="static";var s="",u=this._getOffset(t,"x"),c=this._getOffset(t,"y");u&&(s+="translateX(".concat(u,"px) ")),c&&(s+="translateY(".concat(c,"px)")),n.transform=s.trim(),o.maxHeight&&(i?n.maxHeight=Nf(o.maxHeight):r&&(n.maxHeight="")),o.maxWidth&&(i?n.maxWidth=Nf(o.maxWidth):r&&(n.maxWidth="")),Dp(this._pane.style,n)}},{key:"_getExactOverlayY",value:function(e,t,n){var i={top:"",bottom:""},r=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n));var o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return r.y-=o,"bottom"===e.overlayY?i.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":i.top=Nf(r.y),i}},{key:"_getExactOverlayX",value:function(e,t,n){var i={left:"",right:""},r=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n)),"right"===(this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left")?i.right=this._document.documentElement.clientWidth-(r.x+this._overlayRect.width)+"px":i.left=Nf(r.x),i}},{key:"_getScrollVisibility",value:function(){var e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),n=this._scrollables.map(function(e){return e.getElementRef().nativeElement.getBoundingClientRect()});return{isOriginClipped:yp(e,n),isOriginOutsideView:mp(e,n),isOverlayClipped:yp(t,n),isOverlayOutsideView:mp(t,n)}}},{key:"_subtractOverflows",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"";return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}},{key:"left",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}},{key:"bottom",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}},{key:"right",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}},{key:"width",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}},{key:"height",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}},{key:"centerHorizontally",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.left(e),this._justifyContent="center",this}},{key:"centerVertically",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.top(e),this._alignItems="center",this}},{key:"apply",value:function(){if(this._overlayRef&&this._overlayRef.hasAttached()){var e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),i=n.width,r=n.height,o=n.maxWidth,a=n.maxHeight,s=!("100%"!==i&&"100vw"!==i||o&&"100%"!==o&&"100vw"!==o),u=!("100%"!==r&&"100vh"!==r||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=s?"0":this._leftOffset,e.marginTop=u?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,s?t.justifyContent="flex-start":"center"===this._justifyContent?t.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?t.justifyContent="flex-end":"flex-end"===this._justifyContent&&(t.justifyContent="flex-start"):t.justifyContent=this._justifyContent,t.alignItems=u?"flex-start":this._alignItems}}},{key:"dispose",value:function(){if(!this._isDisposed&&this._overlayRef){var e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,n=t.style;t.classList.remove(Bp),n.justifyContent=n.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}}]),e}(),zp=function(){var e=function(){function e(t,n,i,r){m(this,e),this._viewportRuler=t,this._document=n,this._platform=i,this._overlayContainer=r}return b(e,[{key:"global",value:function(){return new Vp}},{key:"connectedTo",value:function(e,t,n){return new Fp(t,n,e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}},{key:"flexibleConnectedTo",value:function(e){return new Rp(e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(qd),Qi(fh),Qi(Id),Qi(Ap))},e.\u0275prov=Ke({factory:function(){return new e(Qi(qd),Qi(fh),Qi(Id),Qi(Ap))},token:e,providedIn:"root"}),e}(),Up=0,Hp=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h){m(this,e),this.scrollStrategies=t,this._overlayContainer=n,this._componentFactoryResolver=i,this._positionBuilder=r,this._keyboardDispatcher=o,this._injector=a,this._ngZone=s,this._document=u,this._directionality=c,this._location=l,this._outsideClickDispatcher=h}return b(e,[{key:"create",value:function(e){var t=this._createHostElement(),n=this._createPaneElement(t),i=this._createPortalOutlet(n),r=new wp(e);return r.direction=r.direction||this._directionality.value,new Pp(i,t,n,r,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}},{key:"position",value:function(){return this._positionBuilder}},{key:"_createPaneElement",value:function(e){var t=this._document.createElement("div");return t.id="cdk-overlay-"+Up++,t.classList.add("cdk-overlay-pane"),e.appendChild(t),t}},{key:"_createHostElement",value:function(){var e=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(e),e}},{key:"_createPortalOutlet",value:function(e){return this._appRef||(this._appRef=this._injector.get(oh)),new ep(e,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(_p),Qi(Ap),Qi(Wu),Qi(zp),Qi(Ep),Qi(os),Qi(Vl),Qi(fh),Qi(zd),Qi(Eh),Qi(Cp))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Gp=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],Wp=new Mi("cdk-connected-overlay-scroll-strategy"),qp=function(){var e=function e(t){m(this,e),this.elementRef=t};return e.\u0275fac=function(t){return new(t||e)(Es(Ku))},e.\u0275dir=It({type:e,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),e}(),Xp=function(){var e=function(){function e(t,n,i,r,o){m(this,e),this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=W.EMPTY,this._attachSubscription=W.EMPTY,this._detachSubscription=W.EMPTY,this._positionSubscription=W.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Zc,this.positionChange=new Zc,this.attach=new Zc,this.detach=new Zc,this.overlayKeydown=new Zc,this.overlayOutsideClick=new Zc,this._templatePortal=new $d(n,i),this._scrollStrategyFactory=r,this.scrollStrategy=this._scrollStrategyFactory()}return b(e,[{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}},{key:"hasBackdrop",get:function(){return this._hasBackdrop},set:function(e){this._hasBackdrop=If(e)}},{key:"lockPosition",get:function(){return this._lockPosition},set:function(e){this._lockPosition=If(e)}},{key:"flexibleDimensions",get:function(){return this._flexibleDimensions},set:function(e){this._flexibleDimensions=If(e)}},{key:"growAfterOpen",get:function(){return this._growAfterOpen},set:function(e){this._growAfterOpen=If(e)}},{key:"push",get:function(){return this._push},set:function(e){this._push=If(e)}},{key:"overlayRef",get:function(){return this._overlayRef}},{key:"dir",get:function(){return this._dir?this._dir.value:"ltr"}},{key:"ngOnDestroy",value:function(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}},{key:"ngOnChanges",value:function(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this._attachOverlay():this._detachOverlay())}},{key:"_createOverlay",value:function(){var e=this;(!this.positions||!this.positions.length)&&(this.positions=Gp);var t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(function(){return e.attach.emit()}),this._detachSubscription=t.detachments().subscribe(function(){return e.detach.emit()}),t.keydownEvents().subscribe(function(t){e.overlayKeydown.next(t),27===t.keyCode&&!e.disableClose&&!fp(t)&&(t.preventDefault(),e._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(function(t){e.overlayOutsideClick.next(t)})}},{key:"_buildConfig",value:function(){var e=this._position=this.positionStrategy||this._createPositionStrategy(),t=new wp({direction:this._dir,positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(t.width=this.width),(this.height||0===this.height)&&(t.height=this.height),(this.minWidth||0===this.minWidth)&&(t.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(t.minHeight=this.minHeight),this.backdropClass&&(t.backdropClass=this.backdropClass),this.panelClass&&(t.panelClass=this.panelClass),t}},{key:"_updatePositionStrategy",value:function(e){var t=this,n=this.positions.map(function(e){return{originX:e.originX,originY:e.originY,overlayX:e.overlayX,overlayY:e.overlayY,offsetX:e.offsetX||t.offsetX,offsetY:e.offsetY||t.offsetY,panelClass:e.panelClass||void 0}});return e.setOrigin(this.origin.elementRef).withPositions(n).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}},{key:"_createPositionStrategy",value:function(){var e=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(e),e}},{key:"_attachOverlay",value:function(){var e=this;this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(function(t){e.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(cp(function(){return e.positionChange.observers.length>0})).subscribe(function(t){e.positionChange.emit(t),0===e.positionChange.observers.length&&e._positionSubscription.unsubscribe()}))}},{key:"_detachOverlay",value:function(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(Cc),Es(Mc),Es(Wp),Es(zd,8))},e.\u0275dir=It({type:e,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[Gt]}),e}(),Yp={provide:Wp,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},Kp=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[Hp,Yp],imports:[[Ud,rp,Yd],Yd]}),e}(),Qp=function(){var t,n=function(t){a(i,t);var n=s(i);function i(){var e;return m(this,i),(e=n.apply(this,arguments)).attached=!1,e}return b(i,[{key:"setRootElement",value:function(e){this.attached&&(this.rootElement.nativeElement.removeChild(this._containerElement),this.attached=!1),this.rootElement=e,this.rootElement.nativeElement.style.display="block",this.rootElement.nativeElement.style.position="contents",this.rootElement.nativeElement.style.height="100%",this.appendToRoot()}},{key:"_createContainer",value:function(){e(p(i.prototype),"_createContainer",this).call(this),this.appendToRoot()}},{key:"appendToRoot",value:function(){!this._containerElement||!this.rootElement||(this.rootElement.nativeElement.appendChild(this._containerElement),this.attached=!0)}}]),i}(Ap);return n.\u0275fac=function(e){return(t||(t=Ci(n)))(e||n)},n.\u0275prov=Ke({token:n,factory:n.\u0275fac,providedIn:"root"}),n}(),$p={schedule:function(e,t){var n=setTimeout(e,t);return function(){return clearTimeout(n)}},scheduleBeforeRender:function(e){if("undefined"==typeof window)return $p.schedule(e,0);if(void 0===window.requestAnimationFrame)return $p.schedule(e,16);var t=window.requestAnimationFrame(e);return function(){return window.cancelAnimationFrame(t)}}};function Zp(e,t,n){var i=n;return function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE}(e)&&t.some(function(t,n){return!("*"===t||!function(e,t){if(!jp){var n=Element.prototype;jp=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}return e.nodeType===Node.ELEMENT_NODE&&jp.call(e,t)}(e,t)||(i=n,0))}),i}var Jp=function(){function e(t,n){m(this,e),this.componentFactory=n.get(Wu).resolveComponentFactory(t)}return b(e,[{key:"create",value:function(e){return new ev(this.componentFactory,e)}}]),e}(),ev=function(){function e(t,n){m(this,e),this.componentFactory=t,this.injector=n,this.eventEmitters=new Ed(1),this.events=this.eventEmitters.pipe(dd(function(e){return Ce.apply(void 0,v(e))})),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(function(e){return e.propName})),this.ngZone=this.injector.get(Vl),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(function(){return Zone.current})}return b(e,[{key:"connect",value:function(e){var t=this;this.runInZone(function(){if(null!==t.scheduledDestroyFn)return t.scheduledDestroyFn(),void(t.scheduledDestroyFn=null);null===t.componentRef&&t.initializeComponent(e)})}},{key:"disconnect",value:function(){var e=this;this.runInZone(function(){null===e.componentRef||null!==e.scheduledDestroyFn||(e.scheduledDestroyFn=$p.schedule(function(){null!==e.componentRef&&(e.componentRef.destroy(),e.componentRef=null,e.viewChangeDetectorRef=null)},10))})}},{key:"getInputValue",value:function(e){var t=this;return this.runInZone(function(){return null===t.componentRef?t.initialInputValues.get(e):t.componentRef.instance[e]})}},{key:"setInputValue",value:function(e,t){var n=this;this.runInZone(function(){null!==n.componentRef?function(e,t){return e===t||e!=e&&t!=t}(t,n.getInputValue(e))&&(void 0!==t||!n.unchangedInputs.has(e))||(n.recordInputChange(e,t),n.unchangedInputs.delete(e),n.hasInputChanges=!0,n.componentRef.instance[e]=t,n.scheduleDetectChanges()):n.initialInputValues.set(e,t)})}},{key:"initializeComponent",value:function(e){var t=os.create({providers:[],parent:this.injector}),n=function(e,t){var n=e.childNodes,i=t.map(function(){return[]}),r=-1;t.some(function(e,t){return"*"===e&&(r=t,!0)});for(var o=0,a=n.length;o1&&void 0!==arguments[1]?arguments[1]:Jf;return function(n){return n.lift(new uv(e,t))}}var uv=function(){function e(t,n){m(this,e),this.dueTime=t,this.scheduler=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new cv(e,this.dueTime,this.scheduler))}}]),e}(),cv=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).dueTime=i,o.scheduler=r,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return b(n,[{key:"_next",value:function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(lv,this.dueTime,this))}},{key:"_complete",value:function(){this.debouncedNext(),this.destination.complete()}},{key:"debouncedNext",value:function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}},{key:"clearDebounce",value:function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}]),n}(Y);function lv(e){e.debouncedNext()}function hv(e){return function(t){return t.lift(new fv(e))}}var fv=function(){function e(t){m(this,e),this.total=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new dv(e,this.total))}}]),e}(),dv=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).total=i,r.count=0,r}return b(n,[{key:"_next",value:function(e){++this.count>this.total&&this.destination.next(e)}}]),n}(Y),pv=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"create",value:function(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({factory:function(){return new e},token:e,providedIn:"root"}),e}(),vv=function(){var e=function(){function e(t){m(this,e),this._mutationObserverFactory=t,this._observedElements=new Map}return b(e,[{key:"ngOnDestroy",value:function(){var e=this;this._observedElements.forEach(function(t,n){return e._cleanupObserver(n)})}},{key:"observe",value:function(e){var t=this,n=Lf(e);return new ee(function(e){var i=t._observeElement(n).subscribe(e);return function(){i.unsubscribe(),t._unobserveElement(n)}})}},{key:"_observeElement",value:function(e){if(this._observedElements.has(e))this._observedElements.get(e).count++;else{var t=new oe,n=this._mutationObserverFactory.create(function(e){return t.next(e)});n&&n.observe(e,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(e,{observer:n,stream:t,count:1})}return this._observedElements.get(e).stream}},{key:"_unobserveElement",value:function(e){this._observedElements.has(e)&&(this._observedElements.get(e).count--,this._observedElements.get(e).count||this._cleanupObserver(e))}},{key:"_cleanupObserver",value:function(e){if(this._observedElements.has(e)){var t=this._observedElements.get(e),n=t.observer,i=t.stream;n&&n.disconnect(),i.complete(),this._observedElements.delete(e)}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(pv))},e.\u0275prov=Ke({factory:function(){return new e(Qi(pv))},token:e,providedIn:"root"}),e}(),gv=function(){var e=function(){function e(t,n,i){m(this,e),this._contentObserver=t,this._elementRef=n,this._ngZone=i,this.event=new Zc,this._disabled=!1,this._currentSubscription=null}return b(e,[{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=If(e),this._disabled?this._unsubscribe():this._subscribe()}},{key:"debounce",get:function(){return this._debounce},set:function(e){this._debounce=Rf(e),this._subscribe()}},{key:"ngAfterContentInit",value:function(){!this._currentSubscription&&!this.disabled&&this._subscribe()}},{key:"ngOnDestroy",value:function(){this._unsubscribe()}},{key:"_subscribe",value:function(){var e=this;this._unsubscribe();var t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(function(){e._currentSubscription=(e.debounce?t.pipe(sv(e.debounce)):t).subscribe(e.event)})}},{key:"_unsubscribe",value:function(){var e;null===(e=this._currentSubscription)||void 0===e||e.unsubscribe()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(vv),Es(Ku),Es(Vl))},e.\u0275dir=It({type:e,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),e}(),mv=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[pv]}),e}();function yv(e,t){return(e.getAttribute(t)||"").match(/\S+/g)||[]}var bv="cdk-describedby-message-container",_v="cdk-describedby-message",wv="cdk-describedby-host",kv=0,xv=new Map,Sv=null,Ev=function(){var e=function(){function e(t){m(this,e),this._document=t}return b(e,[{key:"describe",value:function(e,t,n){if(this._canBeDescribed(e,t)){var i=Cv(t,n);"string"!=typeof t?(Ov(t),xv.set(i,{messageElement:t,referenceCount:0})):xv.has(i)||this._createMessageElement(t,n),this._isElementDescribedByMessage(e,i)||this._addMessageReference(e,i)}}},{key:"removeDescription",value:function(e,t,n){if(t&&this._isElementNode(e)){var i=Cv(t,n);if(this._isElementDescribedByMessage(e,i)&&this._removeMessageReference(e,i),"string"==typeof t){var r=xv.get(i);r&&0===r.referenceCount&&this._deleteMessageElement(i)}Sv&&0===Sv.childNodes.length&&this._deleteMessagesContainer()}}},{key:"ngOnDestroy",value:function(){for(var e=this._document.querySelectorAll("[".concat(wv,"]")),t=0;t-1&&t!==n._activeItemIndex&&(n._activeItemIndex=t)}})}return b(e,[{key:"skipPredicate",value:function(e){return this._skipPredicateFn=e,this}},{key:"withWrap",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._wrap=e,this}},{key:"withVerticalOrientation",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._vertical=e,this}},{key:"withHorizontalOrientation",value:function(e){return this._horizontal=e,this}},{key:"withAllowedModifierKeys",value:function(e){return this._allowedModifierKeys=e,this}},{key:"withTypeAhead",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(rv(function(t){return e._pressedLetters.push(t)}),sv(t),od(function(){return e._pressedLetters.length>0}),ue(function(){return e._pressedLetters.join("")})).subscribe(function(t){for(var n=e._getItemsArray(),i=1;i0&&void 0!==arguments[0])||arguments[0];return this._homeAndEnd=e,this}},{key:"setActiveItem",value:function(e){var t=this._activeItem;this.updateActiveItem(e),this._activeItem!==t&&this.change.next(this._activeItemIndex)}},{key:"onKeydown",value:function(e){var t=this,n=e.keyCode,i=["altKey","ctrlKey","metaKey","shiftKey"].every(function(n){return!e[n]||t._allowedModifierKeys.indexOf(n)>-1});switch(n){case 9:return void this.tabOut.next();case 40:if(this._vertical&&i){this.setNextItemActive();break}return;case 38:if(this._vertical&&i){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&i){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&i){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&i){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&i){this.setLastItemActive();break}return;default:return void((i||fp(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(n>=65&&n<=90||n>=48&&n<=57)&&this._letterKeyStream.next(String.fromCharCode(n))))}this._pressedLetters=[],e.preventDefault()}},{key:"activeItemIndex",get:function(){return this._activeItemIndex}},{key:"activeItem",get:function(){return this._activeItem}},{key:"isTyping",value:function(){return this._pressedLetters.length>0}},{key:"setFirstItemActive",value:function(){this._setActiveItemByIndex(0,1)}},{key:"setLastItemActive",value:function(){this._setActiveItemByIndex(this._items.length-1,-1)}},{key:"setNextItemActive",value:function(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}},{key:"setPreviousItemActive",value:function(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}},{key:"updateActiveItem",value:function(e){var t=this._getItemsArray(),n="number"==typeof e?e:t.indexOf(e),i=t[n];this._activeItem=null==i?null:i,this._activeItemIndex=n}},{key:"_setActiveItemByDelta",value:function(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}},{key:"_setActiveInWrapMode",value:function(e){for(var t=this._getItemsArray(),n=1;n<=t.length;n++){var i=(this._activeItemIndex+e*n+t.length)%t.length;if(!this._skipPredicateFn(t[i]))return void this.setActiveItem(i)}}},{key:"_setActiveInDefaultMode",value:function(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}},{key:"_setActiveItemByIndex",value:function(e,t){var n=this._getItemsArray();if(n[e]){for(;this._skipPredicateFn(n[e]);)if(!n[e+=t])return;this.setActiveItem(e)}}},{key:"_getItemsArray",value:function(){return this._items instanceof el?this._items.toArray():this._items}}]),e}()),Av=function(){var e=function(){function e(t){m(this,e),this._platform=t}return b(e,[{key:"isDisabled",value:function(e){return e.hasAttribute("disabled")}},{key:"isVisible",value:function(e){return function(e){return!!(e.offsetWidth||e.offsetHeight||"function"==typeof e.getClientRects&&e.getClientRects().length)}(e)&&"visible"===getComputedStyle(e).visibility}},{key:"isTabbable",value:function(e){if(!this._platform.isBrowser)return!1;var t=function(e){try{return e.frameElement}catch(t){return null}}(function(e){return e.ownerDocument&&e.ownerDocument.defaultView||window}(e));if(t&&(-1===Mv(t)||!this.isVisible(t)))return!1;var n=e.nodeName.toLowerCase(),i=Mv(e);return e.hasAttribute("contenteditable")?-1!==i:!("iframe"===n||"object"===n||this._platform.WEBKIT&&this._platform.IOS&&!function(e){var t=e.nodeName.toLowerCase(),n="input"===t&&e.type;return"text"===n||"password"===n||"select"===t||"textarea"===t}(e))&&("audio"===n?!!e.hasAttribute("controls")&&-1!==i:"video"===n?-1!==i&&(null!==i||this._platform.FIREFOX||e.hasAttribute("controls")):e.tabIndex>=0)}},{key:"isFocusable",value:function(e,t){return function(e){return!function(e){return function(e){return"input"==e.nodeName.toLowerCase()}(e)&&"hidden"==e.type}(e)&&(function(e){var t=e.nodeName.toLowerCase();return"input"===t||"select"===t||"button"===t||"textarea"===t}(e)||function(e){return function(e){return"a"==e.nodeName.toLowerCase()}(e)&&e.hasAttribute("href")}(e)||e.hasAttribute("contenteditable")||Pv(e))}(e)&&!this.isDisabled(e)&&((null==t?void 0:t.ignoreVisibility)||this.isVisible(e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id))},token:e,providedIn:"root"}),e}();function Pv(e){if(!e.hasAttribute("tabindex")||void 0===e.tabIndex)return!1;var t=e.getAttribute("tabindex");return"-32768"!=t&&!(!t||isNaN(parseInt(t,10)))}function Mv(e){if(!Pv(e))return null;var t=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(t)?-1:t}var Iv=function(){function e(t,n,i,r){var o=this,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];m(this,e),this._element=t,this._checker=n,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=function(){return o.focusLastTabbableElement()},this.endAnchorListener=function(){return o.focusFirstTabbableElement()},this._enabled=!0,a||this.attachAnchors()}return b(e,[{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}},{key:"destroy",value:function(){var e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),t&&(t.removeEventListener("focus",this.endAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}},{key:"attachAnchors",value:function(){var e=this;return!!this._hasAttached||(this._ngZone.runOutsideAngular(function(){e._startAnchor||(e._startAnchor=e._createAnchor(),e._startAnchor.addEventListener("focus",e.startAnchorListener)),e._endAnchor||(e._endAnchor=e._createAnchor(),e._endAnchor.addEventListener("focus",e.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}},{key:"focusInitialElementWhenReady",value:function(e){var t=this;return new Promise(function(n){t._executeOnStable(function(){return n(t.focusInitialElement(e))})})}},{key:"focusFirstTabbableElementWhenReady",value:function(e){var t=this;return new Promise(function(n){t._executeOnStable(function(){return n(t.focusFirstTabbableElement(e))})})}},{key:"focusLastTabbableElementWhenReady",value:function(e){var t=this;return new Promise(function(n){t._executeOnStable(function(){return n(t.focusLastTabbableElement(e))})})}},{key:"_getRegionBoundary",value:function(e){for(var t=this._element.querySelectorAll("[cdk-focus-region-".concat(e,"], [cdkFocusRegion").concat(e,"], [cdk-focus-").concat(e,"]")),n=0;n=0;n--){var i=t[n].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[n]):null;if(i)return i}return null}},{key:"_createAnchor",value:function(){var e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}},{key:"_toggleAnchorTabIndex",value:function(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}},{key:"toggleAnchors",value:function(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}},{key:"_executeOnStable",value:function(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(ap(1)).subscribe(e)}}]),e}(),Rv=function(){var e=function(){function e(t,n,i){m(this,e),this._checker=t,this._ngZone=n,this._document=i}return b(e,[{key:"create",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Iv(e,this._checker,this._ngZone,this._document,t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Av),Qi(Vl),Qi(fh))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Av),Qi(Vl),Qi(fh))},token:e,providedIn:"root"}),e}();function Dv(e){return 0===e.offsetX&&0===e.offsetY}function Nv(e){var t=e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0];return!(!t||-1!==t.identifier||null!=t.radiusX&&1!==t.radiusX||null!=t.radiusY&&1!==t.radiusY)}"undefined"!=typeof Element&∈var Lv=new Mi("cdk-input-modality-detector-options"),jv={ignoreKeys:[18,17,224,91,16]},Fv=Ld({passive:!0,capture:!0}),Bv=function(){var e=function(){function e(t,n,i,r){var o=this;m(this,e),this._platform=t,this._mostRecentTarget=null,this._modality=new nv(null),this._lastTouchMs=0,this._onKeydown=function(e){var t,n;(null===(n=null===(t=o._options)||void 0===t?void 0:t.ignoreKeys)||void 0===n?void 0:n.some(function(t){return t===e.keyCode}))||(o._modality.next("keyboard"),o._mostRecentTarget=Bd(e))},this._onMousedown=function(e){Date.now()-o._lastTouchMs<650||(o._modality.next(Dv(e)?"keyboard":"mouse"),o._mostRecentTarget=Bd(e))},this._onTouchstart=function(e){Nv(e)?o._modality.next("keyboard"):(o._lastTouchMs=Date.now(),o._modality.next("touch"),o._mostRecentTarget=Bd(e))},this._options=Object.assign(Object.assign({},jv),r),this.modalityDetected=this._modality.pipe(hv(1)),this.modalityChanged=this.modalityDetected.pipe(Qf()),t.isBrowser&&n.runOutsideAngular(function(){i.addEventListener("keydown",o._onKeydown,Fv),i.addEventListener("mousedown",o._onMousedown,Fv),i.addEventListener("touchstart",o._onTouchstart,Fv)})}return b(e,[{key:"mostRecentModality",get:function(){return this._modality.value}},{key:"ngOnDestroy",value:function(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Fv),document.removeEventListener("mousedown",this._onMousedown,Fv),document.removeEventListener("touchstart",this._onTouchstart,Fv))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id),Qi(Vl),Qi(fh),Qi(Lv,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id),Qi(Vl),Qi(fh),Qi(Lv,8))},token:e,providedIn:"root"}),e}(),Vv=new Mi("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),zv=new Mi("LIVE_ANNOUNCER_DEFAULT_OPTIONS"),Uv=function(){var e=function(){function e(t,n,i,r){m(this,e),this._ngZone=n,this._defaultOptions=r,this._document=i,this._liveElement=t||this._createLiveElement()}return b(e,[{key:"announce",value:function(e){for(var n,i,r,o=this,a=this._defaultOptions,s=arguments.length,u=new Array(s>1?s-1:0),c=1;c1&&void 0!==arguments[1]&&arguments[1],n=Lf(e);if(!this._platform.isBrowser||1!==n.nodeType)return jf(null);var i=jd(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return t&&(r.checkChildren=!0),r.subject;var o={checkChildren:t,subject:new oe,rootNode:i};return this._elementInfo.set(n,o),this._registerGlobalListeners(o),o.subject}},{key:"stopMonitoring",value:function(e){var t=Lf(e),n=this._elementInfo.get(t);n&&(n.subject.complete(),this._setClasses(t),this._elementInfo.delete(t),this._removeGlobalListeners(n))}},{key:"focusVia",value:function(e,n,i){var r=this,o=Lf(e);o===this._getDocument().activeElement?this._getClosestElementsInfo(o).forEach(function(e){var i=t(e,2),o=i[0],a=i[1];return r._originChanged(o,n,a)}):(this._setOrigin(n),"function"==typeof o.focus&&o.focus(i))}},{key:"ngOnDestroy",value:function(){var e=this;this._elementInfo.forEach(function(t,n){return e.stopMonitoring(n)})}},{key:"_getDocument",value:function(){return this._document||document}},{key:"_getWindow",value:function(){return this._getDocument().defaultView||window}},{key:"_toggleClass",value:function(e,t,n){n?e.classList.add(t):e.classList.remove(t)}},{key:"_getFocusOrigin",value:function(e){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(e)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}},{key:"_shouldBeAttributedToTouch",value:function(e){return 1===this._detectionMode||!!(null==e?void 0:e.contains(this._inputModalityDetector._mostRecentTarget))}},{key:"_setClasses",value:function(e,t){this._toggleClass(e,"cdk-focused",!!t),this._toggleClass(e,"cdk-touch-focused","touch"===t),this._toggleClass(e,"cdk-keyboard-focused","keyboard"===t),this._toggleClass(e,"cdk-mouse-focused","mouse"===t),this._toggleClass(e,"cdk-program-focused","program"===t)}},{key:"_setOrigin",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._ngZone.runOutsideAngular(function(){t._origin=e,t._originFromTouchInteraction="touch"===e&&n,0===t._detectionMode&&(clearTimeout(t._originTimeoutId),t._originTimeoutId=setTimeout(function(){return t._origin=null},t._originFromTouchInteraction?650:1))})}},{key:"_onFocus",value:function(e,t){var n=this._elementInfo.get(t),i=Bd(e);!n||!n.checkChildren&&t!==i||this._originChanged(t,this._getFocusOrigin(i),n)}},{key:"_onBlur",value:function(e,t){var n=this._elementInfo.get(t);!n||n.checkChildren&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(this._setClasses(t),this._emitOrigin(n.subject,null))}},{key:"_emitOrigin",value:function(e,t){this._ngZone.run(function(){return e.next(t)})}},{key:"_registerGlobalListeners",value:function(e){var t=this;if(this._platform.isBrowser){var n=e.rootNode,i=this._rootNodeFocusListenerCount.get(n)||0;i||this._ngZone.runOutsideAngular(function(){n.addEventListener("focus",t._rootNodeFocusAndBlurListener,Gv),n.addEventListener("blur",t._rootNodeFocusAndBlurListener,Gv)}),this._rootNodeFocusListenerCount.set(n,i+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(function(){t._getWindow().addEventListener("focus",t._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(ud(this._stopInputModalityDetector)).subscribe(function(e){t._setOrigin(e,!0)}))}}},{key:"_removeGlobalListeners",value:function(e){var t=e.rootNode;if(this._rootNodeFocusListenerCount.has(t)){var n=this._rootNodeFocusListenerCount.get(t);n>1?this._rootNodeFocusListenerCount.set(t,n-1):(t.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Gv),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Gv),this._rootNodeFocusListenerCount.delete(t))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}},{key:"_originChanged",value:function(e,t,n){this._setClasses(e,t),this._emitOrigin(n.subject,t),this._lastFocusOrigin=t}},{key:"_getClosestElementsInfo",value:function(e){var t=[];return this._elementInfo.forEach(function(n,i){(i===e||n.checkChildren&&i.contains(e))&&t.push([i,n])}),t}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl),Qi(Id),Qi(Bv),Qi(fh,8),Qi(Hv,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Vl),Qi(Id),Qi(Bv),Qi(fh,8),Qi(Hv,8))},token:e,providedIn:"root"}),e}(),qv="cdk-high-contrast-black-on-white",Xv="cdk-high-contrast-white-on-black",Yv="cdk-high-contrast-active",Kv=function(){var e=function(){function e(t,n){m(this,e),this._platform=t,this._document=n}return b(e,[{key:"getHighContrastMode",value:function(){if(!this._platform.isBrowser)return 0;var e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);var t=this._document.defaultView||window,n=t&&t.getComputedStyle?t.getComputedStyle(e):null,i=(n&&n.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(e),i){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}},{key:"_applyBodyHighContrastModeCssClasses",value:function(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){var e=this._document.body.classList;e.remove(Yv),e.remove(qv),e.remove(Xv),this._hasCheckedHighContrastMode=!0;var t=this.getHighContrastMode();1===t?(e.add(Yv),e.add(qv)):2===t&&(e.add(Yv),e.add(Xv))}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id),Qi(fh))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id),Qi(fh))},token:e,providedIn:"root"}),e}(),Qv=function(){var e=function e(t){m(this,e),t._applyBodyHighContrastModeCssClasses()};return e.\u0275fac=function(t){return new(t||e)(Qi(Kv))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Rd,mv]]}),e}(),$v=new tc("12.2.5"),Zv=function e(){m(this,e)},Jv="*";function eg(e,t){return{type:7,name:e,definitions:t,options:{}}}function tg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:4,styles:t,timings:e}}function ng(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:2,steps:e,options:t}}function ig(e){return{type:6,styles:e,offset:null}}function rg(e,t,n){return{type:0,name:e,styles:t,options:n}}function og(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:1,expr:e,animation:t,options:n}}function ag(e){Promise.resolve(null).then(e)}var sg=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;m(this,e),this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+n}return b(e,[{key:"_onFinish",value:function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])}},{key:"onStart",value:function(e){this._onStartFns.push(e)}},{key:"onDone",value:function(e){this._onDoneFns.push(e)}},{key:"onDestroy",value:function(e){this._onDestroyFns.push(e)}},{key:"hasStarted",value:function(){return this._started}},{key:"init",value:function(){}},{key:"play",value:function(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}},{key:"triggerMicrotask",value:function(){var e=this;ag(function(){return e._onFinish()})}},{key:"_onStart",value:function(){this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[]}},{key:"pause",value:function(){}},{key:"restart",value:function(){}},{key:"finish",value:function(){this._onFinish()}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])}},{key:"reset",value:function(){this._started=!1}},{key:"setPosition",value:function(e){this._position=this.totalTime?e*this.totalTime:1}},{key:"getPosition",value:function(){return this.totalTime?this._position/this.totalTime:1}},{key:"triggerCallback",value:function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0}}]),e}(),ug=function(){function e(t){var n=this;m(this,e),this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;var i=0,r=0,o=0,a=this.players.length;0==a?ag(function(){return n._onFinish()}):this.players.forEach(function(e){e.onDone(function(){++i==a&&n._onFinish()}),e.onDestroy(function(){++r==a&&n._onDestroy()}),e.onStart(function(){++o==a&&n._onStart()})}),this.totalTime=this.players.reduce(function(e,t){return Math.max(e,t.totalTime)},0)}return b(e,[{key:"_onFinish",value:function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])}},{key:"init",value:function(){this.players.forEach(function(e){return e.init()})}},{key:"onStart",value:function(e){this._onStartFns.push(e)}},{key:"_onStart",value:function(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[])}},{key:"onDone",value:function(e){this._onDoneFns.push(e)}},{key:"onDestroy",value:function(e){this._onDestroyFns.push(e)}},{key:"hasStarted",value:function(){return this._started}},{key:"play",value:function(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(function(e){return e.play()})}},{key:"pause",value:function(){this.players.forEach(function(e){return e.pause()})}},{key:"restart",value:function(){this.players.forEach(function(e){return e.restart()})}},{key:"finish",value:function(){this._onFinish(),this.players.forEach(function(e){return e.finish()})}},{key:"destroy",value:function(){this._onDestroy()}},{key:"_onDestroy",value:function(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(function(e){return e.destroy()}),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])}},{key:"reset",value:function(){this.players.forEach(function(e){return e.reset()}),this._destroyed=!1,this._finished=!1,this._started=!1}},{key:"setPosition",value:function(e){var t=e*this.totalTime;this.players.forEach(function(e){var n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})}},{key:"getPosition",value:function(){var e=this.players.reduce(function(e,t){return null===e||t.totalTime>e.totalTime?t:e},null);return null!=e?e.getPosition():0}},{key:"beforeDestroy",value:function(){this.players.forEach(function(e){e.beforeDestroy&&e.beforeDestroy()})}},{key:"triggerCallback",value:function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0}}]),e}();function cg(){return"undefined"!=typeof window&&void 0!==window.document}function lg(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function hg(e){switch(e.length){case 0:return new sg;case 1:return e[0];default:return new ug(e)}}function fg(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=[],s=[],u=-1,c=null;if(i.forEach(function(e){var n=e.offset,i=n==u,l=i&&c||{};Object.keys(e).forEach(function(n){var i=n,s=e[n];if("offset"!==n)switch(i=t.normalizePropertyName(i,a),s){case"!":s=r[n];break;case Jv:s=o[n];break;default:s=t.normalizeStyleValue(n,i,s,a)}l[i]=s}),i||s.push(l),c=l,u=n}),a.length){var l="\n - ";throw new Error("Unable to animate due to the following errors:".concat(l).concat(a.join(l)))}return s}function dg(e,t,n,i){switch(t){case"start":e.onStart(function(){return i(n&&pg(n,"start",e))});break;case"done":e.onDone(function(){return i(n&&pg(n,"done",e))});break;case"destroy":e.onDestroy(function(){return i(n&&pg(n,"destroy",e))})}}function pg(e,t,n){var i=n.totalTime,r=vg(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,null==i?e.totalTime:i,!!n.disabled),o=e._data;return null!=o&&(r._data=o),r}function vg(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;return{element:e,triggerName:t,fromState:n,toState:i,phaseName:r,totalTime:o,disabled:!!a}}function gg(e,t,n){var i;return e instanceof Map?(i=e.get(t))||e.set(t,i=n):(i=e[t])||(i=e[t]=n),i}function mg(e){var t=e.indexOf(":");return[e.substring(1,t),e.substr(t+1)]}var yg=function(e,t){return!1},bg=function(e,t){return!1},_g=function(e,t,n){return[]},wg=lg();(wg||"undefined"!=typeof Element)&&(yg=cg()?function(e,t){for(;t&&t!==document.documentElement;){if(t===e)return!0;t=t.parentNode||t.host}return!1}:function(e,t){return e.contains(t)},bg=function(){if(wg||Element.prototype.matches)return function(e,t){return e.matches(t)};var e=Element.prototype,t=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;return t?function(e,n){return t.apply(e,[n])}:bg}(),_g=function(e,t,n){var i=[];if(n)for(var r=e.querySelectorAll(t),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).forEach(function(n){t[n]=e[n]}),t}function zg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t)for(var i in e)n[i]=e[i];else Vg(e,n);return n}function Ug(e,t,n){return n?t+":"+n+";":""}function Hg(e){for(var t="",n=0;n *";case":leave":return"* => void";case":increment":return function(e,t){return parseFloat(t)>parseFloat(e)};case":decrement":return function(e,t){return parseFloat(t) *"}}(e,n);if("function"==typeof i)return void t.push(i);e=i}var r=e.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==r||r.length<4)return n.push('The provided transition expression "'.concat(e,'" is not supported')),t;var o=r[1],a=r[2],s=r[3];t.push(sm(o,s)),"<"==a[0]&&("*"!=o||"*"!=s)&&t.push(sm(s,o))}(e,n,t)}):n.push(e),n}var om=new Set(["true","1"]),am=new Set(["false","0"]);function sm(e,t){var n=om.has(e)||am.has(e),i=om.has(t)||am.has(t);return function(r,o){var a="*"==e||e==r,s="*"==t||t==o;return!a&&n&&"boolean"==typeof r&&(a=r?om.has(e):am.has(e)),!s&&i&&"boolean"==typeof o&&(s=o?om.has(t):am.has(t)),a&&s}}var um=new RegExp("s*:selfs*,?","g");function cm(e,t,n){return new lm(e).build(t,n)}var lm=function(){function e(t){m(this,e),this._driver=t}return b(e,[{key:"build",value:function(e,t){var n=new hm(t);return this._resetContextStyleTimingState(n),nm(this,qg(e),n)}},{key:"_resetContextStyleTimingState",value:function(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}},{key:"visitTrigger",value:function(e,t){var n=this,i=t.queryCount=0,r=t.depCount=0,o=[],a=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(function(e){if(n._resetContextStyleTimingState(t),0==e.type){var s=e,u=s.name;u.toString().split(/\s*,\s*/).forEach(function(e){s.name=e,o.push(n.visitState(s,t))}),s.name=u}else if(1==e.type){var c=n.visitTransition(e,t);i+=c.queryCount,r+=c.depCount,a.push(c)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:o,transitions:a,queryCount:i,depCount:r,options:null}}},{key:"visitState",value:function(e,t){var n=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(n.containsDynamicStyles){var r=new Set,o=i||{};if(n.styles.forEach(function(e){if(fm(e)){var t=e;Object.keys(t).forEach(function(e){Yg(t[e]).forEach(function(e){o.hasOwnProperty(e)||r.add(e)})})}}),r.size){var a=Qg(r.values());t.errors.push('state("'.concat(e.name,'", ...) must define default values for all the following style substitutions: ').concat(a.join(", ")))}}return{type:0,name:e.name,style:n,options:i?{params:i}:null}}},{key:"visitTransition",value:function(e,t){t.queryCount=0,t.depCount=0;var n=nm(this,qg(e.animation),t);return{type:1,matchers:rm(e.expr,t.errors),animation:n,queryCount:t.queryCount,depCount:t.depCount,options:dm(e.options)}}},{key:"visitSequence",value:function(e,t){var n=this;return{type:2,steps:e.steps.map(function(e){return nm(n,e,t)}),options:dm(e.options)}}},{key:"visitGroup",value:function(e,t){var n=this,i=t.currentTime,r=0,o=e.steps.map(function(e){t.currentTime=i;var o=nm(n,e,t);return r=Math.max(r,t.currentTime),o});return t.currentTime=r,{type:3,steps:o,options:dm(e.options)}}},{key:"visitAnimate",value:function(e,t){var n=function(e,t){var n=null;if(e.hasOwnProperty("duration"))n=e;else if("number"==typeof e)return pm(Bg(e,t).duration,0,"");var i=e;if(i.split(/\s+/).some(function(e){return"{"==e.charAt(0)&&"{"==e.charAt(1)})){var r=pm(0,0,"");return r.dynamic=!0,r.strValue=i,r}return pm((n=n||Bg(i,t)).duration,n.delay,n.easing)}(e.timings,t.errors);t.currentAnimateTimings=n;var i,r=e.styles?e.styles:ig({});if(5==r.type)i=this.visitKeyframes(r,t);else{var o=e.styles,a=!1;if(!o){a=!0;var s={};n.easing&&(s.easing=n.easing),o=ig(s)}t.currentTime+=n.duration+n.delay;var u=this.visitStyle(o,t);u.isEmptyStep=a,i=u}return t.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}},{key:"visitStyle",value:function(e,t){var n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}},{key:"_makeStyleAst",value:function(e,t){var n=[];Array.isArray(e.styles)?e.styles.forEach(function(e){"string"==typeof e?e==Jv?n.push(e):t.errors.push("The provided style string value ".concat(e," is not allowed.")):n.push(e)}):n.push(e.styles);var i=!1,r=null;return n.forEach(function(e){if(fm(e)){var t=e,n=t.easing;if(n&&(r=n,delete t.easing),!i)for(var o in t)if(t[o].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:e.offset,containsDynamicStyles:i,options:null}}},{key:"_validateStyleAst",value:function(e,t){var n=this,i=t.currentAnimateTimings,r=t.currentTime,o=t.currentTime;i&&o>0&&(o-=i.duration+i.delay),e.styles.forEach(function(e){"string"!=typeof e&&Object.keys(e).forEach(function(i){if(n._driver.validateStyleProperty(i)){var a=t.collectedStyles[t.currentQuerySelector],s=a[i],u=!0;s&&(o!=r&&o>=s.startTime&&r<=s.endTime&&(t.errors.push('The CSS property "'.concat(i,'" that exists between the times of "').concat(s.startTime,'ms" and "').concat(s.endTime,'ms" is also being animated in a parallel animation between the times of "').concat(o,'ms" and "').concat(r,'ms"')),u=!1),o=s.startTime),u&&(a[i]={startTime:o,endTime:r}),t.options&&function(e,t,n){var i=t.params||{},r=Yg(e);r.length&&r.forEach(function(e){i.hasOwnProperty(e)||n.push("Unable to resolve the local animation param ".concat(e," in the given list of values"))})}(e[i],t.options,t.errors)}else t.errors.push('The provided animation property "'.concat(i,'" is not a supported CSS property for animations'))})})}},{key:"visitKeyframes",value:function(e,t){var n=this,i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;var r=0,o=[],a=!1,s=!1,u=0,c=e.steps.map(function(e){var i=n._makeStyleAst(e,t),c=null!=i.offset?i.offset:function(e){if("string"==typeof e)return null;var t=null;if(Array.isArray(e))e.forEach(function(e){if(fm(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}});else if(fm(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}return t}(i.styles),l=0;return null!=c&&(r++,l=i.offset=c),s=s||l<0||l>1,a=a||l0&&r0?r==f?1:h*r:o[r],s=a*v;t.currentTime=d+p.delay+s,p.duration=s,n._validateStyleAst(e,t),e.offset=a,i.styles.push(e)}),i}},{key:"visitReference",value:function(e,t){return{type:8,animation:nm(this,qg(e.animation),t),options:dm(e.options)}}},{key:"visitAnimateChild",value:function(e,t){return t.depCount++,{type:9,options:dm(e.options)}}},{key:"visitAnimateRef",value:function(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:dm(e.options)}}},{key:"visitQuery",value:function(e,n){var i=n.currentQuerySelector,r=e.options||{};n.queryCount++,n.currentQuery=e;var o=t(function(e){var t=!!e.split(/\s*,\s*/).find(function(e){return":self"==e});return t&&(e=e.replace(um,"")),[e=e.replace(/@\*/g,Dg).replace(/@\w+/g,function(e){return Dg+"-"+e.substr(1)}).replace(/:animating/g,Lg),t]}(e.selector),2),a=o[0],s=o[1];n.currentQuerySelector=i.length?i+" "+a:a,gg(n.collectedStyles,n.currentQuerySelector,{});var u=nm(this,qg(e.animation),n);return n.currentQuery=null,n.currentQuerySelector=i,{type:11,selector:a,limit:r.limit||0,optional:!!r.optional,includeSelf:s,animation:u,originalSelector:e.selector,options:dm(e.options)}}},{key:"visitStagger",value:function(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");var n="full"===e.timings?{duration:0,delay:0,easing:"full"}:Bg(e.timings,t.errors,!0);return{type:12,animation:nm(this,qg(e.animation),t),timings:n,options:null}}}]),e}(),hm=function e(t){m(this,e),this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null};function fm(e){return!Array.isArray(e)&&"object"==typeof e}function dm(e){return e?(e=Vg(e)).params&&(e.params=function(e){return e?Vg(e):null}(e.params)):e={},e}function pm(e,t,n){return{duration:e,delay:t,easing:n}}function vm(e,t,n,i,r,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];return{type:1,element:e,keyframes:t,preStyleProps:n,postStyleProps:i,duration:r,delay:o,totalTime:r+o,easing:a,subTimeline:s}}var gm=function(){function e(){m(this,e),this._map=new Map}return b(e,[{key:"consume",value:function(e){var t=this._map.get(e);return t?this._map.delete(e):t=[],t}},{key:"append",value:function(e,t){var n,i=this._map.get(e);i||this._map.set(e,i=[]),(n=i).push.apply(n,v(t))}},{key:"has",value:function(e){return this._map.has(e)}},{key:"clear",value:function(){this._map.clear()}}]),e}(),mm=new RegExp(":enter","g"),ym=new RegExp(":leave","g");function bm(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7?arguments[7]:void 0,u=arguments.length>8?arguments[8]:void 0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:[];return(new _m).buildKeyframes(e,t,n,i,r,o,a,s,u,c)}var _m=function(){function e(){m(this,e)}return b(e,[{key:"buildKeyframes",value:function(e,t,n,i,r,o,a,s,u){var c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:[];u=u||new gm;var l=new km(e,t,u,i,r,c,[]);l.options=s,l.currentTimeline.setStyles([o],null,l.errors,s),nm(this,n,l);var h=l.timelines.filter(function(e){return e.containsAnimation()});if(h.length&&Object.keys(a).length){var f=h[h.length-1];f.allowOnlyTimelineStyles()||f.setStyles([a],null,l.errors,s)}return h.length?h.map(function(e){return e.buildKeyframes()}):[vm(t,[],[],[],0,0,"",!1)]}},{key:"visitTrigger",value:function(e,t){}},{key:"visitState",value:function(e,t){}},{key:"visitTransition",value:function(e,t){}},{key:"visitAnimateChild",value:function(e,t){var n=t.subInstructions.consume(t.element);if(n){var i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,i,i.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}},{key:"visitAnimateRef",value:function(e,t){var n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}},{key:"_visitSubInstructions",value:function(e,t,n){var i=t.currentTimeline.currentTime,r=null!=n.duration?jg(n.duration):null,o=null!=n.delay?jg(n.delay):null;return 0!==r&&e.forEach(function(e){var n=t.appendInstructionToTimeline(e,r,o);i=Math.max(i,n.duration+n.delay)}),i}},{key:"visitReference",value:function(e,t){t.updateOptions(e.options,!0),nm(this,e.animation,t),t.previousNode=e}},{key:"visitSequence",value:function(e,t){var n=this,i=t.subContextCount,r=t,o=e.options;if(o&&(o.params||o.delay)&&((r=t.createSubContext(o)).transformIntoNewTimeline(),null!=o.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=wm);var a=jg(o.delay);r.delayNextStep(a)}e.steps.length&&(e.steps.forEach(function(e){return nm(n,e,r)}),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}},{key:"visitGroup",value:function(e,t){var n=this,i=[],r=t.currentTimeline.currentTime,o=e.options&&e.options.delay?jg(e.options.delay):0;e.steps.forEach(function(a){var s=t.createSubContext(e.options);o&&s.delayNextStep(o),nm(n,a,s),r=Math.max(r,s.currentTimeline.currentTime),i.push(s.currentTimeline)}),i.forEach(function(e){return t.currentTimeline.mergeTimelineCollectedStyles(e)}),t.transformIntoNewTimeline(r),t.previousNode=e}},{key:"_visitTiming",value:function(e,t){if(e.dynamic){var n=e.strValue;return Bg(t.params?Kg(n,t.params,t.errors):n,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}},{key:"visitAnimate",value:function(e,t){var n=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),i.snapshotCurrentStyles());var r=e.style;5==r.type?this.visitKeyframes(r,t):(t.incrementTime(n.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}},{key:"visitStyle",value:function(e,t){var n=t.currentTimeline,i=t.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();var r=i&&i.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(r):n.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}},{key:"visitKeyframes",value:function(e,t){var n=t.currentAnimateTimings,i=t.currentTimeline.duration,r=n.duration,o=t.createSubContext().currentTimeline;o.easing=n.easing,e.styles.forEach(function(e){o.forwardTime((e.offset||0)*r),o.setStyles(e.styles,e.easing,t.errors,t.options),o.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(o),t.transformIntoNewTimeline(i+r),t.previousNode=e}},{key:"visitQuery",value:function(e,t){var n=this,i=t.currentTimeline.currentTime,r=e.options||{},o=r.delay?jg(r.delay):0;o&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=wm);var a=i,s=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=s.length;var u=null;s.forEach(function(i,r){t.currentQueryIndex=r;var s=t.createSubContext(e.options,i);o&&s.delayNextStep(o),i===t.element&&(u=s.currentTimeline),nm(n,e.animation,s),s.currentTimeline.applyStylesToKeyframe(),a=Math.max(a,s.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(a),u&&(t.currentTimeline.mergeTimelineCollectedStyles(u),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}},{key:"visitStagger",value:function(e,t){var n=t.parentContext,i=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),s=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":s=a-s;break;case"full":s=n.currentStaggerTime}var u=t.currentTimeline;s&&u.delayNextStep(s);var c=u.currentTime;nm(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}]),e}(),wm={},km=function(){function e(t,n,i,r,o,a,s,u){m(this,e),this._driver=t,this.element=n,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=o,this.errors=a,this.timelines=s,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=wm,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=u||new xm(this._driver,n,0),s.push(this.currentTimeline)}return b(e,[{key:"params",get:function(){return this.options.params}},{key:"updateOptions",value:function(e,t){var n=this;if(e){var i=e,r=this.options;null!=i.duration&&(r.duration=jg(i.duration)),null!=i.delay&&(r.delay=jg(i.delay));var o=i.params;if(o){var a=r.params;a||(a=this.options.params={}),Object.keys(o).forEach(function(e){(!t||!a.hasOwnProperty(e))&&(a[e]=Kg(o[e],a,n.errors))})}}}},{key:"_copyOptions",value:function(){var e={};if(this.options){var t=this.options.params;if(t){var n=e.params={};Object.keys(t).forEach(function(e){n[e]=t[e]})}}return e}},{key:"createSubContext",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=n||this.element,o=new e(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}},{key:"transformIntoNewTimeline",value:function(e){return this.previousNode=wm,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}},{key:"appendInstructionToTimeline",value:function(e,t,n){var i={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+e.delay,easing:""},r=new Sm(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(r),i}},{key:"incrementTime",value:function(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}},{key:"delayNextStep",value:function(e){e>0&&this.currentTimeline.delayNextStep(e)}},{key:"invokeQuery",value:function(e,t,n,i,r,o){var a=[];if(i&&a.push(this.element),e.length>0){e=(e=e.replace(mm,"."+this._enterClassName)).replace(ym,"."+this._leaveClassName);var s=this._driver.query(this.element,e,1!=n);0!==n&&(s=n<0?s.slice(s.length+n,s.length):s.slice(0,n)),a.push.apply(a,v(s))}return!r&&0==a.length&&o.push('`query("'.concat(t,'")` returned zero elements. (Use `query("').concat(t,'", { optional: true })` if you wish to allow this.)')),a}}]),e}(),xm=function(){function e(t,n,i,r){m(this,e),this._driver=t,this.element=n,this.startTime=i,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(n),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(n,this._localTimelineStyles)),this._loadKeyframe()}return b(e,[{key:"containsAnimation",value:function(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}},{key:"getCurrentStyleProperties",value:function(){return Object.keys(this._currentKeyframe)}},{key:"currentTime",get:function(){return this.startTime+this.duration}},{key:"delayNextStep",value:function(e){var t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}},{key:"fork",value:function(t,n){return this.applyStylesToKeyframe(),new e(this._driver,t,n||this.currentTime,this._elementTimelineStylesLookup)}},{key:"_loadKeyframe",value:function(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}},{key:"forwardFrame",value:function(){this.duration+=1,this._loadKeyframe()}},{key:"forwardTime",value:function(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}},{key:"_updateStyle",value:function(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}},{key:"allowOnlyTimelineStyles",value:function(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}},{key:"applyEmptyStep",value:function(e){var t=this;e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(function(e){t._backFill[e]=t._globalTimelineStyles[e]||Jv,t._currentKeyframe[e]=Jv}),this._currentEmptyStepKeyframe=this._currentKeyframe}},{key:"setStyles",value:function(e,t,n,i){var r=this;t&&(this._previousKeyframe.easing=t);var o=i&&i.params||{},a=function(e,t){var n,i={};return e.forEach(function(e){"*"===e?(n=n||Object.keys(t)).forEach(function(e){i[e]=Jv}):zg(e,!1,i)}),i}(e,this._globalTimelineStyles);Object.keys(a).forEach(function(e){var t=Kg(a[e],o,n);r._pendingStyles[e]=t,r._localTimelineStyles.hasOwnProperty(e)||(r._backFill[e]=r._globalTimelineStyles.hasOwnProperty(e)?r._globalTimelineStyles[e]:Jv),r._updateStyle(e,t)})}},{key:"applyStylesToKeyframe",value:function(){var e=this,t=this._pendingStyles,n=Object.keys(t);0!=n.length&&(this._pendingStyles={},n.forEach(function(n){e._currentKeyframe[n]=t[n]}),Object.keys(this._localTimelineStyles).forEach(function(t){e._currentKeyframe.hasOwnProperty(t)||(e._currentKeyframe[t]=e._localTimelineStyles[t])}))}},{key:"snapshotCurrentStyles",value:function(){var e=this;Object.keys(this._localTimelineStyles).forEach(function(t){var n=e._localTimelineStyles[t];e._pendingStyles[t]=n,e._updateStyle(t,n)})}},{key:"getFinalKeyframe",value:function(){return this._keyframes.get(this.duration)}},{key:"properties",get:function(){var e=[];for(var t in this._currentKeyframe)e.push(t);return e}},{key:"mergeTimelineCollectedStyles",value:function(e){var t=this;Object.keys(e._styleSummary).forEach(function(n){var i=t._styleSummary[n],r=e._styleSummary[n];(!i||r.time>i.time)&&t._updateStyle(n,r.value)})}},{key:"buildKeyframes",value:function(){var e=this;this.applyStylesToKeyframe();var t=new Set,n=new Set,i=1===this._keyframes.size&&0===this.duration,r=[];this._keyframes.forEach(function(o,a){var s=zg(o,!0);Object.keys(s).forEach(function(e){var i=s[e];"!"==i?t.add(e):i==Jv&&n.add(e)}),i||(s.offset=a/e.duration),r.push(s)});var o=t.size?Qg(t.values()):[],a=n.size?Qg(n.values()):[];if(i){var s=r[0],u=Vg(s);s.offset=0,u.offset=1,r=[s,u]}return vm(this.element,r,o,a,this.duration,this.startTime,this.easing,!1)}}]),e}(),Sm=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s){var u,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return m(this,n),(u=t.call(this,e,i,s.delay)).keyframes=r,u.preStyleProps=o,u.postStyleProps=a,u._stretchStartingKeyframe=c,u.timings={duration:s.duration,delay:s.delay,easing:s.easing},u}return b(n,[{key:"containsAnimation",value:function(){return this.keyframes.length>1}},{key:"buildKeyframes",value:function(){var e=this.keyframes,t=this.timings,n=t.delay,i=t.duration,r=t.easing;if(this._stretchStartingKeyframe&&n){var o=[],a=i+n,s=n/a,u=zg(e[0],!1);u.offset=0,o.push(u);var c=zg(e[0],!1);c.offset=Em(s),o.push(c);for(var l=e.length-1,h=1;h<=l;h++){var f=zg(e[h],!1);f.offset=Em((n+f.offset*i)/a),o.push(f)}i=a,n=0,r="",e=o}return vm(this.element,e,this.preStyleProps,this.postStyleProps,i,n,r,!0)}}]),n}(xm);function Em(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=Math.pow(10,t-1);return Math.round(e*n)/n}var Cm=function e(){m(this,e)},Om=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"normalizePropertyName",value:function(e,t){return Zg(e)}},{key:"normalizeStyleValue",value:function(e,t,n,i){var r="",o=n.toString().trim();if(Tm[t]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{var a=n.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&i.push("Please provide a CSS unit value for ".concat(e,":").concat(n))}return o+r}}]),n}(Cm),Tm=function(e){var t={};return e.forEach(function(e){return t[e]=!0}),t}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(","));function Am(e,t,n,i,r,o,a,s,u,c,l,h,f){return{type:0,element:e,triggerName:t,isRemovalTransition:r,fromState:n,fromStyles:o,toState:i,toStyles:a,timelines:s,queriedElements:u,preStyleProps:c,postStyleProps:l,totalTime:h,errors:f}}var Pm={},Mm=function(){function e(t,n,i){m(this,e),this._triggerName=t,this.ast=n,this._stateStyles=i}return b(e,[{key:"match",value:function(e,t,n,i){return function(e,t,n,i,r){return e.some(function(e){return e(t,n,i,r)})}(this.ast.matchers,e,t,n,i)}},{key:"buildStyles",value:function(e,t,n){var i=this._stateStyles["*"],r=this._stateStyles[e],o=i?i.buildStyles(t,n):{};return r?r.buildStyles(t,n):o}},{key:"build",value:function(e,t,n,i,r,o,a,s,u,c){var l=[],h=this.ast.options&&this.ast.options.params||Pm,f=this.buildStyles(n,a&&a.params||Pm,l),d=s&&s.params||Pm,p=this.buildStyles(i,d,l),v=new Set,g=new Map,m=new Map,y="void"===i,b={params:Object.assign(Object.assign({},h),d)},_=c?[]:bm(e,t,this.ast.animation,r,o,f,p,b,u,l),w=0;if(_.forEach(function(e){w=Math.max(e.duration+e.delay,w)}),l.length)return Am(t,this._triggerName,n,i,y,f,p,[],[],g,m,w,l);_.forEach(function(e){var n=e.element,i=gg(g,n,{});e.preStyleProps.forEach(function(e){return i[e]=!0});var r=gg(m,n,{});e.postStyleProps.forEach(function(e){return r[e]=!0}),n!==t&&v.add(n)});var k=Qg(v.values());return Am(t,this._triggerName,n,i,y,f,p,_,k,g,m,w)}}]),e}(),Im=function(){function e(t,n,i){m(this,e),this.styles=t,this.defaultParams=n,this.normalizer=i}return b(e,[{key:"buildStyles",value:function(e,t){var n=this,i={},r=Vg(this.defaultParams);return Object.keys(e).forEach(function(t){var n=e[t];null!=n&&(r[t]=n)}),this.styles.styles.forEach(function(e){if("string"!=typeof e){var o=e;Object.keys(o).forEach(function(e){var a=o[e];a.length>1&&(a=Kg(a,r,t));var s=n.normalizer.normalizePropertyName(e,t);a=n.normalizer.normalizeStyleValue(e,s,a,t),i[s]=a})}}),i}}]),e}(),Rm=function(){function e(t,n,i){var r=this;m(this,e),this.name=t,this.ast=n,this._normalizer=i,this.transitionFactories=[],this.states={},n.states.forEach(function(e){r.states[e.name]=new Im(e.style,e.options&&e.options.params||{},i)}),Dm(this.states,"true","1"),Dm(this.states,"false","0"),n.transitions.forEach(function(e){r.transitionFactories.push(new Mm(t,e,r.states))}),this.fallbackTransition=function(e,t,n){return new Mm(e,{type:1,animation:{type:2,steps:[],options:null},matchers:[function(e,t){return!0}],options:null,queryCount:0,depCount:0},t)}(t,this.states)}return b(e,[{key:"containsQueries",get:function(){return this.ast.queryCount>0}},{key:"matchTransition",value:function(e,t,n,i){return this.transitionFactories.find(function(r){return r.match(e,t,n,i)})||null}},{key:"matchStyles",value:function(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}}]),e}();function Dm(e,t,n){e.hasOwnProperty(t)?e.hasOwnProperty(n)||(e[n]=e[t]):e.hasOwnProperty(n)&&(e[t]=e[n])}var Nm=new gm,Lm=function(){function e(t,n,i){m(this,e),this.bodyNode=t,this._driver=n,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}return b(e,[{key:"register",value:function(e,t){var n=[],i=cm(this._driver,t,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: ".concat(n.join("\n")));this._animations[e]=i}},{key:"_buildPlayer",value:function(e,t,n){var i=e.element,r=fg(0,this._normalizer,0,e.keyframes,t,n);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}},{key:"create",value:function(e,t){var n,i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[],a=this._animations[e],s=new Map;if(a?(n=bm(this._driver,t,a,Mg,Ig,{},{},r,Nm,o)).forEach(function(e){var t=gg(s,e.element,{});e.postStyleProps.forEach(function(e){return t[e]=null})}):(o.push("The requested animation doesn't exist or has already been destroyed"),n=[]),o.length)throw new Error("Unable to create the animation due to the following errors: ".concat(o.join("\n")));s.forEach(function(e,t){Object.keys(e).forEach(function(n){e[n]=i._driver.computeStyle(t,n,Jv)})});var u=hg(n.map(function(e){var t=s.get(e.element);return i._buildPlayer(e,{},t)}));return this._playersById[e]=u,u.onDestroy(function(){return i.destroy(e)}),this.players.push(u),u}},{key:"destroy",value:function(e){var t=this._getPlayer(e);t.destroy(),delete this._playersById[e];var n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}},{key:"_getPlayer",value:function(e){var t=this._playersById[e];if(!t)throw new Error("Unable to find the timeline player referenced by ".concat(e));return t}},{key:"listen",value:function(e,t,n,i){var r=vg(t,"","","");return dg(this._getPlayer(e),n,r,i),function(){}}},{key:"command",value:function(e,t,n,i){if("register"!=n)if("create"!=n){var r=this._getPlayer(e);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e)}}else this.create(e,t,i[0]||{});else this.register(e,i[0])}}]),e}(),jm="ng-animate-queued",Fm="ng-animate-disabled",Bm=".ng-animate-disabled",Vm=[],zm={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Um={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Hm="__ng_removed",Gm=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";m(this,e),this.namespaceId=n;var i=t&&t.hasOwnProperty("value");if(this.value=function(e){return null!=e?e:null}(i?t.value:t),i){var r=Vg(t);delete r.value,this.options=r}else this.options={};this.options.params||(this.options.params={})}return b(e,[{key:"params",get:function(){return this.options.params}},{key:"absorbOptions",value:function(e){var t=e.params;if(t){var n=this.options.params;Object.keys(t).forEach(function(e){null==n[e]&&(n[e]=t[e])})}}}]),e}(),Wm="void",qm=new Gm(Wm),Xm=function(){function e(t,n,i){m(this,e),this.id=t,this.hostElement=n,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,ty(n,this._hostClassName)}return b(e,[{key:"listen",value:function(e,t,n,i){var r=this;if(!this._triggers.hasOwnProperty(t))throw new Error('Unable to listen on the animation trigger event "'.concat(n,'" because the animation trigger "').concat(t,"\" doesn't exist!"));if(null==n||0==n.length)throw new Error('Unable to listen on the animation trigger "'.concat(t,'" because the provided event is undefined!'));if(!function(e){return"start"==e||"done"==e}(n))throw new Error('The provided animation trigger event "'.concat(n,'" for the animation trigger "').concat(t,'" is not supported!'));var o=gg(this._elementListeners,e,[]),a={name:t,phase:n,callback:i};o.push(a);var s=gg(this._engine.statesByElement,e,{});return s.hasOwnProperty(t)||(ty(e,Rg),ty(e,Rg+"-"+t),s[t]=qm),function(){r._engine.afterFlush(function(){var e=o.indexOf(a);e>=0&&o.splice(e,1),r._triggers[t]||delete s[t]})}}},{key:"register",value:function(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}},{key:"_getTrigger",value:function(e){var t=this._triggers[e];if(!t)throw new Error('The provided animation trigger "'.concat(e,'" has not been registered!'));return t}},{key:"trigger",value:function(e,t,n){var i=this,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this._getTrigger(t),a=new Km(this.id,t,e),s=this._engine.statesByElement.get(e);s||(ty(e,Rg),ty(e,Rg+"-"+t),this._engine.statesByElement.set(e,s={}));var u=s[t],c=new Gm(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&c.absorbOptions(u.options),s[t]=c,u||(u=qm),c.value===Wm||u.value!==c.value){var l=gg(this._engine.playersByElement,e,[]);l.forEach(function(e){e.namespaceId==i.id&&e.triggerName==t&&e.queued&&e.destroy()});var h=o.matchTransition(u.value,c.value,e,c.params),f=!1;if(!h){if(!r)return;h=o.fallbackTransition,f=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:h,fromState:u,toState:c,player:a,isFallbackTransition:f}),f||(ty(e,jm),a.onStart(function(){ny(e,jm)})),a.onDone(function(){var t=i.players.indexOf(a);t>=0&&i.players.splice(t,1);var n=i._engine.playersByElement.get(e);if(n){var r=n.indexOf(a);r>=0&&n.splice(r,1)}}),this.players.push(a),l.push(a),a}if(!function(e,t){var n=Object.keys(e),i=Object.keys(t);if(n.length!=i.length)return!1;for(var r=0;r=0){for(var i=!1,r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,t)){this._namespaceList.splice(r+1,0,e),i=!0;break}i||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}},{key:"register",value:function(e,t){var n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}},{key:"registerTrigger",value:function(e,t,n){var i=this._namespaceLookup[e];i&&i.register(t,n)&&this.totalAnimations++}},{key:"destroy",value:function(e,t){var n=this;if(e){var i=this._fetchNamespace(e);this.afterFlush(function(){n.namespacesByHostElement.delete(i.hostElement),delete n._namespaceLookup[e];var t=n._namespaceList.indexOf(i);t>=0&&n._namespaceList.splice(t,1)}),this.afterFlushAnimationsDone(function(){return i.destroy(t)})}}},{key:"_fetchNamespace",value:function(e){return this._namespaceLookup[e]}},{key:"fetchNamespacesByElement",value:function(e){var t=new Set,n=this.statesByElement.get(e);if(n)for(var i=Object.keys(n),r=0;r=0&&this.collectedLeaveElements.splice(o,1)}if(e){var a=this._fetchNamespace(e);a&&a.insertNode(t,n)}i&&this.collectEnterElement(t)}}},{key:"collectEnterElement",value:function(e){this.collectedEnterElements.push(e)}},{key:"markElementAsDisabled",value:function(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),ty(e,Fm)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ny(e,Fm))}},{key:"removeNode",value:function(e,t,n,i){if(Qm(t)){var r=e?this._fetchNamespace(e):null;if(r?r.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i),n){var o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,i)}}else this._onRemovalComplete(t,i)}},{key:"markElementAsRemoved",value:function(e,t,n,i){this.collectedLeaveElements.push(t),t[Hm]={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}},{key:"listen",value:function(e,t,n,i,r){return Qm(t)?this._fetchNamespace(e).listen(t,n,i,r):function(){}}},{key:"_buildInstruction",value:function(e,t,n,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,i,e.fromState.options,e.toState.options,t,r)}},{key:"destroyInnerAnimations",value:function(e){var t=this,n=this.driver.query(e,Dg,!0);n.forEach(function(e){return t.destroyActiveAnimationsForElement(e)}),0!=this.playersByQueriedElement.size&&(n=this.driver.query(e,Lg,!0)).forEach(function(e){return t.finishActiveQueriedAnimationOnElement(e)})}},{key:"destroyActiveAnimationsForElement",value:function(e){var t=this.playersByElement.get(e);t&&t.forEach(function(e){e.queued?e.markedForDestroy=!0:e.destroy()})}},{key:"finishActiveQueriedAnimationOnElement",value:function(e){var t=this.playersByQueriedElement.get(e);t&&t.forEach(function(e){return e.finish()})}},{key:"whenRenderingDone",value:function(){var e=this;return new Promise(function(t){if(e.players.length)return hg(e.players).onDone(function(){return t()});t()})}},{key:"processLeaveNode",value:function(e){var t=this,n=e[Hm];if(n&&n.setForRemoval){if(e[Hm]=zm,n.namespaceId){this.destroyInnerAnimations(e);var i=this._fetchNamespace(n.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,n.setForRemoval)}this.driver.matchesElement(e,Bm)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Bm,!0).forEach(function(e){t.markElementAsDisabled(e,!1)})}},{key:"flush",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=[];if(this.newHostElements.size&&(this.newHostElements.forEach(function(t,n){return e._balanceNamespaceList(t,n)}),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var i=0;i=0;O--)this._namespaceList[O].drainQueuedTransitions(t).forEach(function(e){var t=e.player,o=e.element;if(E.push(t),n.collectedEnterElements.length){var l=o[Hm];if(l&&l.setForMove)return void t.destroy()}var f=!h||!n.driver.containsElement(h,o),d=x.get(o),v=p.get(o),g=n._buildInstruction(e,i,v,d,f);if(g.errors&&g.errors.length)C.push(g);else{if(f)return t.onStart(function(){return Wg(o,g.fromStyles)}),t.onDestroy(function(){return Gg(o,g.toStyles)}),void r.push(t);if(e.isFallbackTransition)return t.onStart(function(){return Wg(o,g.fromStyles)}),t.onDestroy(function(){return Gg(o,g.toStyles)}),void r.push(t);g.timelines.forEach(function(e){return e.stretchStartingKeyframe=!0}),i.append(o,g.timelines),a.push({instruction:g,player:t,element:o}),g.queriedElements.forEach(function(e){return gg(s,e,[]).push(t)}),g.preStyleProps.forEach(function(e,t){var n=Object.keys(e);if(n.length){var i=u.get(t);i||u.set(t,i=new Set),n.forEach(function(e){return i.add(e)})}}),g.postStyleProps.forEach(function(e,t){var n=Object.keys(e),i=c.get(t);i||c.set(t,i=new Set),n.forEach(function(e){return i.add(e)})})}});if(C.length){var T=[];C.forEach(function(e){T.push("@".concat(e.triggerName," has failed due to:\n")),e.errors.forEach(function(e){return T.push("- ".concat(e,"\n"))})}),E.forEach(function(e){return e.destroy()}),this.reportError(T)}var A=new Map,P=new Map;a.forEach(function(e){var t=e.element;i.has(t)&&(P.set(t,t),n._beforeAnimationBuild(e.player.namespaceId,e.instruction,A))}),r.forEach(function(e){var t=e.element;n._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach(function(e){gg(A,t,[]).push(e),e.destroy()})});var M=m.filter(function(e){return oy(e,u,c)}),I=new Map;Zm(I,this.driver,b,c,Jv).forEach(function(e){oy(e,u,c)&&M.push(e)});var R=new Map;d.forEach(function(e,t){Zm(R,n.driver,new Set(e),u,"!")}),M.forEach(function(e){var t=I.get(e),n=R.get(e);I.set(e,Object.assign(Object.assign({},t),n))});var D=[],N=[],L={};a.forEach(function(e){var t=e.element,a=e.player,s=e.instruction;if(i.has(t)){if(l.has(t))return a.onDestroy(function(){return Gg(t,s.toStyles)}),a.disabled=!0,a.overrideTotalTime(s.totalTime),void r.push(a);var u=L;if(P.size>1){for(var c=t,h=[];c=c.parentNode;){var f=P.get(c);if(f){u=f;break}h.push(c)}h.forEach(function(e){return P.set(e,u)})}var d=n._buildAnimation(a.namespaceId,s,A,o,R,I);if(a.setRealPlayer(d),u===L)D.push(a);else{var p=n.playersByElement.get(u);p&&p.length&&(a.parentPlayer=hg(p)),r.push(a)}}else Wg(t,s.fromStyles),a.onDestroy(function(){return Gg(t,s.toStyles)}),N.push(a),l.has(t)&&r.push(a)}),N.forEach(function(e){var t=o.get(e.element);if(t&&t.length){var n=hg(t);e.setRealPlayer(n)}}),r.forEach(function(e){e.parentPlayer?e.syncPlayerEvents(e.parentPlayer):e.destroy()});for(var j=0;j0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new sg(e.duration,e.delay)}}]),e}(),Km=function(){function e(t,n,i){m(this,e),this.namespaceId=t,this.triggerName=n,this.element=i,this._player=new sg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}return b(e,[{key:"setRealPlayer",value:function(e){var t=this;this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(function(n){t._queuedCallbacks[n].forEach(function(t){return dg(e,n,void 0,t)})}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}},{key:"getRealPlayer",value:function(){return this._player}},{key:"overrideTotalTime",value:function(e){this.totalTime=e}},{key:"syncPlayerEvents",value:function(e){var t=this,n=this._player;n.triggerCallback&&e.onStart(function(){return n.triggerCallback("start")}),e.onDone(function(){return t.finish()}),e.onDestroy(function(){return t.destroy()})}},{key:"_queueEvent",value:function(e,t){gg(this._queuedCallbacks,e,[]).push(t)}},{key:"onDone",value:function(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}},{key:"onStart",value:function(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}},{key:"onDestroy",value:function(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}},{key:"init",value:function(){this._player.init()}},{key:"hasStarted",value:function(){return!this.queued&&this._player.hasStarted()}},{key:"play",value:function(){!this.queued&&this._player.play()}},{key:"pause",value:function(){!this.queued&&this._player.pause()}},{key:"restart",value:function(){!this.queued&&this._player.restart()}},{key:"finish",value:function(){this._player.finish()}},{key:"destroy",value:function(){this.destroyed=!0,this._player.destroy()}},{key:"reset",value:function(){!this.queued&&this._player.reset()}},{key:"setPosition",value:function(e){this.queued||this._player.setPosition(e)}},{key:"getPosition",value:function(){return this.queued?0:this._player.getPosition()}},{key:"triggerCallback",value:function(e){var t=this._player;t.triggerCallback&&t.triggerCallback(e)}}]),e}();function Qm(e){return e&&1===e.nodeType}function $m(e,t){var n=e.style.display;return e.style.display=null!=t?t:"none",n}function Zm(e,t,n,i,r){var o=[];n.forEach(function(e){return o.push($m(e))});var a=[];i.forEach(function(n,i){var o={};n.forEach(function(e){var n=o[e]=t.computeStyle(i,e,r);(!n||0==n.length)&&(i[Hm]=Um,a.push(i))}),e.set(i,o)});var s=0;return n.forEach(function(e){return $m(e,o[s++])}),a}function Jm(e,t){var n=new Map;if(e.forEach(function(e){return n.set(e,[])}),0==t.length)return n;var i=new Set(t),r=new Map;function o(e){if(!e)return 1;var t=r.get(e);if(t)return t;var a=e.parentNode;return t=n.has(a)?a:i.has(a)?1:o(a),r.set(e,t),t}return t.forEach(function(e){var t=o(e);1!==t&&n.get(t).push(e)}),n}var ey="$$classes";function ty(e,t){if(e.classList)e.classList.add(t);else{var n=e[ey];n||(n=e[ey]={}),n[t]=!0}}function ny(e,t){if(e.classList)e.classList.remove(t);else{var n=e[ey];n&&delete n[t]}}function iy(e,t,n){hg(n).onDone(function(){return e.processLeaveNode(t)})}function ry(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:-1;this._transitionEngine.flush(e)}},{key:"players",get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)}},{key:"whenRenderingDone",value:function(){return this._transitionEngine.whenRenderingDone()}}]),e}();function sy(e,t){var n=null,i=null;return Array.isArray(t)&&t.length?(n=cy(t[0]),t.length>1&&(i=cy(t[t.length-1]))):t&&(n=cy(t)),n||i?new uy(e,n,i):null}var uy=function(){function e(t,n,i){m(this,e),this._element=t,this._startStyles=n,this._endStyles=i,this._state=0;var r=e.initialStylesByElement.get(t);r||e.initialStylesByElement.set(t,r={}),this._initialStyles=r}return b(e,[{key:"start",value:function(){this._state<1&&(this._startStyles&&Gg(this._element,this._startStyles,this._initialStyles),this._state=1)}},{key:"finish",value:function(){this.start(),this._state<2&&(Gg(this._element,this._initialStyles),this._endStyles&&(Gg(this._element,this._endStyles),this._endStyles=null),this._state=1)}},{key:"destroy",value:function(){this.finish(),this._state<3&&(e.initialStylesByElement.delete(this._element),this._startStyles&&(Wg(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Wg(this._element,this._endStyles),this._endStyles=null),Gg(this._element,this._initialStyles),this._state=3)}}]),e}();function cy(e){for(var t=null,n=Object.keys(e),i=0;i=this._delay&&n>=this._duration&&this.finish()}},{key:"finish",value:function(){this._finished||(this._finished=!0,this._onDoneFn(),my(this._element,this._eventFn,!0))}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.finish(),function(e,t){var n=by(e,"").split(","),i=gy(n,t);i>=0&&(n.splice(i,1),yy(e,"",n.join(",")))}(this._element,this._name))}}]),e}();function py(e,t,n){yy(e,"PlayState",n,vy(e,t))}function vy(e,t){var n=by(e,"");return n.indexOf(",")>0?gy(n.split(","),t):gy([n],t)}function gy(e,t){for(var n=0;n=0)return n;return-1}function my(e,t,n){n?e.removeEventListener(fy,t):e.addEventListener(fy,t)}function yy(e,t,n,i){var r=hy+t;if(null!=i){var o=e.style[r];if(o.length){var a=o.split(",");a[i]=n,n=a.join(",")}}e.style[r]=n}function by(e,t){return e.style[hy+t]||""}var _y=function(){function e(t,n,i,r,o,a,s,u){m(this,e),this.element=t,this.keyframes=n,this.animationName=i,this._duration=r,this._delay=o,this._finalStyles=s,this._specialStyles=u,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=a||"linear",this.totalTime=r+o,this._buildStyler()}return b(e,[{key:"onStart",value:function(e){this._onStartFns.push(e)}},{key:"onDone",value:function(e){this._onDoneFns.push(e)}},{key:"onDestroy",value:function(e){this._onDestroyFns.push(e)}},{key:"destroy",value:function(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])}},{key:"_flushDoneFns",value:function(){this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[]}},{key:"_flushStartFns",value:function(){this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[]}},{key:"finish",value:function(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}},{key:"setPosition",value:function(e){this._styler.setPosition(e)}},{key:"getPosition",value:function(){return this._styler.getPosition()}},{key:"hasStarted",value:function(){return this._state>=2}},{key:"init",value:function(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}},{key:"play",value:function(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}},{key:"pause",value:function(){this.init(),this._styler.pause()}},{key:"restart",value:function(){this.reset(),this.play()}},{key:"reset",value:function(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}},{key:"_buildStyler",value:function(){var e=this;this._styler=new dy(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",function(){return e.finish()})}},{key:"triggerCallback",value:function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0}},{key:"beforeDestroy",value:function(){var e=this;this.init();var t={};if(this.hasStarted()){var n=this._state>=3;Object.keys(this._finalStyles).forEach(function(i){"offset"!=i&&(t[i]=n?e._finalStyles[i]:im(e.element,i))})}this.currentSnapshot=t}}]),e}(),wy=function(t){a(i,t);var n=s(i);function i(e,t){var r;return m(this,i),(r=n.call(this)).element=e,r._startingStyles={},r.__initialized=!1,r._styles=Tg(t),r}return b(i,[{key:"init",value:function(){var t=this;this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(function(e){t._startingStyles[e]=t.element.style[e]}),e(p(i.prototype),"init",this).call(this))}},{key:"play",value:function(){var t=this;!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(function(e){return t.element.style.setProperty(e,t._styles[e])}),e(p(i.prototype),"play",this).call(this))}},{key:"destroy",value:function(){var t=this;!this._startingStyles||(Object.keys(this._startingStyles).forEach(function(e){var n=t._startingStyles[e];n?t.element.style.setProperty(e,n):t.element.style.removeProperty(e)}),this._startingStyles=null,e(p(i.prototype),"destroy",this).call(this))}}]),i}(sg),ky=function(){function e(){m(this,e),this._count=0}return b(e,[{key:"validateStyleProperty",value:function(e){return Sg(e)}},{key:"matchesElement",value:function(e,t){return Eg(e,t)}},{key:"containsElement",value:function(e,t){return Cg(e,t)}},{key:"query",value:function(e,t,n){return Og(e,t,n)}},{key:"computeStyle",value:function(e,t,n){return window.getComputedStyle(e)[t]}},{key:"buildKeyframeElement",value:function(e,t,n){n=n.map(function(e){return Tg(e)});var i="@keyframes ".concat(t," {\n"),r="";n.forEach(function(e){r=" ";var t=parseFloat(e.offset);i+="".concat(r).concat(100*t,"% {\n"),r+=" ",Object.keys(e).forEach(function(t){var n=e[t];switch(t){case"offset":return;case"easing":return void(n&&(i+="".concat(r,"animation-timing-function: ").concat(n,";\n")));default:return void(i+="".concat(r).concat(t,": ").concat(n,";\n"))}}),i+="".concat(r,"}\n")}),i+="}\n";var o=document.createElement("style");return o.textContent=i,o}},{key:"animate",value:function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=o.filter(function(e){return e instanceof _y}),s={};em(n,i)&&a.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return s[e]=t[e]})});var u=function(e){var t={};return e&&(Array.isArray(e)?e:[e]).forEach(function(e){Object.keys(e).forEach(function(n){"offset"==n||"easing"==n||(t[n]=e[n])})}),t}(t=tm(e,t,s));if(0==n)return new wy(e,u);var c="gen_css_kf_"+this._count++,l=this.buildKeyframeElement(e,c,t);(function(e){var t,n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e);return"undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot?n:document.head})(e).appendChild(l);var h=sy(e,t),f=new _y(e,t,c,n,i,r,u,h);return f.onDestroy(function(){return function(e){e.parentNode.removeChild(e)}(l)}),f}}]),e}(),xy=function(){function e(t,n,i,r){m(this,e),this.element=t,this.keyframes=n,this.options=i,this._specialStyles=r,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}return b(e,[{key:"_onFinish",value:function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])}},{key:"init",value:function(){this._buildPlayer(),this._preparePlayerBeforeStart()}},{key:"_buildPlayer",value:function(){var e=this;if(!this._initialized){this._initialized=!0;var t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",function(){return e._onFinish()})}}},{key:"_preparePlayerBeforeStart",value:function(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}},{key:"_triggerWebAnimation",value:function(e,t,n){return e.animate(t,n)}},{key:"onStart",value:function(e){this._onStartFns.push(e)}},{key:"onDone",value:function(e){this._onDoneFns.push(e)}},{key:"onDestroy",value:function(e){this._onDestroyFns.push(e)}},{key:"play",value:function(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}},{key:"pause",value:function(){this.init(),this.domPlayer.pause()}},{key:"finish",value:function(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}},{key:"reset",value:function(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}},{key:"_resetDomPlayerState",value:function(){this.domPlayer&&this.domPlayer.cancel()}},{key:"restart",value:function(){this.reset(),this.play()}},{key:"hasStarted",value:function(){return this._started}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])}},{key:"setPosition",value:function(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}},{key:"getPosition",value:function(){return this.domPlayer.currentTime/this.time}},{key:"totalTime",get:function(){return this._delay+this._duration}},{key:"beforeDestroy",value:function(){var e=this,t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(function(n){"offset"!=n&&(t[n]=e._finished?e._finalKeyframe[n]:im(e.element,n))}),this.currentSnapshot=t}},{key:"triggerCallback",value:function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0}}]),e}(),Sy=function(){function e(){m(this,e),this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Ey().toString()),this._cssKeyframesDriver=new ky}return b(e,[{key:"validateStyleProperty",value:function(e){return Sg(e)}},{key:"matchesElement",value:function(e,t){return Eg(e,t)}},{key:"containsElement",value:function(e,t){return Cg(e,t)}},{key:"query",value:function(e,t,n){return Og(e,t,n)}},{key:"computeStyle",value:function(e,t,n){return window.getComputedStyle(e)[t]}},{key:"overrideWebAnimationsSupport",value:function(e){this._isNativeImpl=e}},{key:"animate",value:function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=arguments.length>6?arguments[6]:void 0;if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,n,i,r,o);var s={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(s.easing=r);var u={},c=o.filter(function(e){return e instanceof xy});em(n,i)&&c.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return u[e]=t[e]})});var l=sy(e,t=tm(e,t=t.map(function(e){return zg(e,!1)}),u));return new xy(e,t,s,l)}}]),e}();function Ey(){return cg()&&Element.prototype.animate||{}}var Cy=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this))._nextAnimationId=0,r._renderer=e.createRenderer(i.body,{id:"0",encapsulation:lt.None,styles:[],data:{animation:[]}}),r}return b(n,[{key:"build",value:function(e){var t=this._nextAnimationId.toString();this._nextAnimationId++;var n=Array.isArray(e)?ng(e):e;return Ay(this._renderer,null,t,"register",[n]),new Oy(t,this._renderer)}}]),n}(Zv);return e.\u0275fac=function(t){return new(t||e)(Qi($u),Qi(fh))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Oy=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this))._id=e,r._renderer=i,r}return b(n,[{key:"create",value:function(e,t){return new Ty(this._id,e,t||{},this._renderer)}}]),n}(function(){return function e(){m(this,e)}}()),Ty=function(){function e(t,n,i,r){m(this,e),this.id=t,this.element=n,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}return b(e,[{key:"_listen",value:function(e,t){return this._renderer.listen(this.element,"@@".concat(this.id,":").concat(e),t)}},{key:"_command",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i=0&&e3&&void 0!==arguments[3])||arguments[3];this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,i)}},{key:"removeChild",value:function(e,t,n){this.engine.onRemove(this.namespaceId,t,this.delegate,n)}},{key:"selectRootElement",value:function(e,t){return this.delegate.selectRootElement(e,t)}},{key:"parentNode",value:function(e){return this.delegate.parentNode(e)}},{key:"nextSibling",value:function(e){return this.delegate.nextSibling(e)}},{key:"setAttribute",value:function(e,t,n,i){this.delegate.setAttribute(e,t,n,i)}},{key:"removeAttribute",value:function(e,t,n){this.delegate.removeAttribute(e,t,n)}},{key:"addClass",value:function(e,t){this.delegate.addClass(e,t)}},{key:"removeClass",value:function(e,t){this.delegate.removeClass(e,t)}},{key:"setStyle",value:function(e,t,n,i){this.delegate.setStyle(e,t,n,i)}},{key:"removeStyle",value:function(e,t,n){this.delegate.removeStyle(e,t,n)}},{key:"setProperty",value:function(e,t,n){"@"==t.charAt(0)&&t==Py?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}},{key:"setValue",value:function(e,t){this.delegate.setValue(e,t)}},{key:"listen",value:function(e,t,n){return this.delegate.listen(e,t,n)}},{key:"disableAnimations",value:function(e,t){this.engine.disableAnimations(e,t)}}]),e}(),Ry=function(e){a(i,e);var n=s(i);function i(e,t,r,o){var a;return m(this,i),(a=n.call(this,t,r,o)).factory=e,a.namespaceId=t,a}return b(i,[{key:"setProperty",value:function(e,t,n){"@"==t.charAt(0)?"."==t.charAt(1)&&t==Py?this.disableAnimations(e,n=void 0===n||!!n):this.engine.process(this.namespaceId,e,t.substr(1),n):this.delegate.setProperty(e,t,n)}},{key:"listen",value:function(e,n,i){var r=this;if("@"==n.charAt(0)){var o,a=function(e){switch(e){case"body":return document.body;case"document":return document;case"window":return window;default:return e}}(e),s=n.substr(1),u="";return"@"!=s.charAt(0)&&(s=(o=t(function(e){var t=e.indexOf(".");return[e.substring(0,t),e.substr(t+1)]}(s),2))[0],u=o[1]),this.engine.listen(this.namespaceId,a,s,u,function(e){r.factory.scheduleListenerCallback(e._data||-1,i,e)})}return this.delegate.listen(e,n,i)}}]),i}(Iy),Dy=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r){return m(this,n),t.call(this,e.body,i,r)}return b(n,[{key:"ngOnDestroy",value:function(){this.flush()}}]),n}(ay);return e.\u0275fac=function(t){return new(t||e)(Qi(fh),Qi(Pg),Qi(Cm))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Ny=new Mi("AnimationModuleType"),Ly=[{provide:Zv,useClass:Cy},{provide:Cm,useFactory:function(){return new Om}},{provide:ay,useClass:Dy},{provide:$u,useFactory:function(e,t,n){return new My(e,t,n)},deps:[mf,ay,Vl]}],jy=[{provide:Pg,useFactory:function(){return"function"==typeof Ey()?new Sy:new ky}},{provide:Ny,useValue:"BrowserAnimations"}].concat(Ly),Fy=[{provide:Pg,useClass:Ag},{provide:Ny,useValue:"NoopAnimations"}].concat(Ly),By=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"withConfig",value:function(t){return{ngModule:e,providers:t.disableAnimations?Fy:jy}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:jy,imports:[Mf]}),e}();function Vy(e,t){if(1&e&&Ps(0,"mat-pseudo-checkbox",4),2&e){var n=Hs();Cs("state",n.selected?"checked":"unchecked")("disabled",n.disabled)}}function zy(e,t){if(1&e&&(Ts(0,"span",5),ku(1),As()),2&e){var n=Hs();qo(1),Su("(",n.group.label,")")}}var Uy=["*"],Hy=new tc("12.2.5"),Gy=new Mi("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}}),Wy=function(){var e=function(){function e(t,n,i){m(this,e),this._hasDoneGlobalChecks=!1,this._document=i,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=n,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}return b(e,[{key:"_getWindow",value:function(){var e=this._document.defaultView||window;return"object"==typeof e&&e?e:null}},{key:"_checkIsEnabled",value:function(e){return!(!Jl()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[e])}},{key:"_isTestEnv",value:function(){var e=this._getWindow();return e&&(e.__karma__||e.jasmine)}},{key:"_checkDoctypeIsDefined",value:function(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}},{key:"_checkThemeIsPresent",value:function(){if(this._checkIsEnabled("theme")&&this._document.body&&"function"==typeof getComputedStyle){var e=this._document.createElement("div");e.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(e);var t=getComputedStyle(e);t&&"none"!==t.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(e)}}},{key:"_checkCdkVersionMatch",value:function(){this._checkIsEnabled("version")&&Hy.full!==$v.full&&console.warn("The Angular Material version ("+Hy.full+") does not match the Angular CDK version ("+$v.full+").\nPlease ensure the versions of these two packages exactly match.")}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Kv),Qi(Gy,8),Qi(fh))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Ud],Ud]}),e}();function qy(e){return function(e){a(n,e);var t=s(n);function n(){var e;m(this,n);for(var i=arguments.length,r=new Array(i),o=0;o1&&void 0!==arguments[1]?arguments[1]:0;return function(e){a(i,e);var n=s(i);function i(){var e;m(this,i);for(var r=arguments.length,o=new Array(r),a=0;a2&&void 0!==arguments[2]?arguments[2]:{},r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),o=Object.assign(Object.assign({},Jy),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);var a=i.radius||function(e,t,n){var i=Math.max(Math.abs(e-n.left),Math.abs(e-n.right)),r=Math.max(Math.abs(t-n.top),Math.abs(t-n.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),s=e-r.left,u=t-r.top,c=o.enterDuration,l=document.createElement("div");l.classList.add("mat-ripple-element"),l.style.left=s-a+"px",l.style.top=u-a+"px",l.style.height=2*a+"px",l.style.width=2*a+"px",null!=i.color&&(l.style.backgroundColor=i.color),l.style.transitionDuration="".concat(c,"ms"),this._containerElement.appendChild(l),function(e){window.getComputedStyle(e).getPropertyValue("opacity")}(l),l.style.transform="scale(1)";var h=new Zy(this,l,i);return h.state=0,this._activeRipples.add(h),i.persistent||(this._mostRecentTransientRipple=h),this._runTimeoutOutsideZone(function(){var e=h===n._mostRecentTransientRipple;h.state=1,!i.persistent&&(!e||!n._isPointerDown)&&h.fadeOut()},c),h}},{key:"fadeOutRipple",value:function(e){var t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),t){var n=e.element,i=Object.assign(Object.assign({},Jy),e.config.animation);n.style.transitionDuration="".concat(i.exitDuration,"ms"),n.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(function(){e.state=3,n.parentNode.removeChild(n)},i.exitDuration)}}},{key:"fadeOutAll",value:function(){this._activeRipples.forEach(function(e){return e.fadeOut()})}},{key:"fadeOutAllNonPersistent",value:function(){this._activeRipples.forEach(function(e){e.config.persistent||e.fadeOut()})}},{key:"setupTriggerEvents",value:function(e){var t=Lf(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(tb))}},{key:"handleEvent",value:function(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(nb),this._pointerUpEventsRegistered=!0)}},{key:"_onMousedown",value:function(e){var t=Dv(e),n=this._lastTouchStartEvent&&Date.now()1&&void 0!==arguments[1]?arguments[1]:0;this._ngZone.runOutsideAngular(function(){return setTimeout(e,t)})}},{key:"_registerEvents",value:function(e){var t=this;this._ngZone.runOutsideAngular(function(){e.forEach(function(e){t._triggerElement.addEventListener(e,t,eb)})})}},{key:"_removeTriggerEvents",value:function(){var e=this;this._triggerElement&&(tb.forEach(function(t){e._triggerElement.removeEventListener(t,e,eb)}),this._pointerUpEventsRegistered&&nb.forEach(function(t){e._triggerElement.removeEventListener(t,e,eb)}))}}]),e}(),rb=new Mi("mat-ripple-global-options"),ob=function(){var e=function(){function e(t,n,i,r,o){m(this,e),this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=r||{},this._rippleRenderer=new ib(this,n,t,i)}return b(e,[{key:"disabled",get:function(){return this._disabled},set:function(e){e&&this.fadeOutAllNonPersistent(),this._disabled=e,this._setupTriggerEventsIfEnabled()}},{key:"trigger",get:function(){return this._trigger||this._elementRef.nativeElement},set:function(e){this._trigger=e,this._setupTriggerEventsIfEnabled()}},{key:"ngOnInit",value:function(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}},{key:"ngOnDestroy",value:function(){this._rippleRenderer._removeTriggerEvents()}},{key:"fadeOutAll",value:function(){this._rippleRenderer.fadeOutAll()}},{key:"fadeOutAllNonPersistent",value:function(){this._rippleRenderer.fadeOutAllNonPersistent()}},{key:"rippleConfig",get:function(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}},{key:"rippleDisabled",get:function(){return this.disabled||!!this._globalOptions.disabled}},{key:"_setupTriggerEventsIfEnabled",value:function(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}},{key:"launch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;return"number"==typeof e?this._rippleRenderer.fadeInRipple(e,t,Object.assign(Object.assign({},this.rippleConfig),n)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Vl),Es(Id),Es(rb,8),Es(Ny,8))},e.\u0275dir=It({type:e,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(e,t){2&e&&su("mat-ripple-unbounded",t.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),e}(),ab=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Wy,Rd],Wy]}),e}(),sb=function(){var e=function e(t){m(this,e),this._animationMode=t,this.state="unchecked",this.disabled=!1};return e.\u0275fac=function(t){return new(t||e)(Es(Ny,8))},e.\u0275cmp=Ct({type:e,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(e,t){2&e&&su("mat-pseudo-checkbox-indeterminate","indeterminate"===t.state)("mat-pseudo-checkbox-checked","checked"===t.state)("mat-pseudo-checkbox-disabled",t.disabled)("_mat-animation-noopable","NoopAnimations"===t._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(e,t){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),e}(),ub=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Wy]]}),e}(),cb=new Mi("MAT_OPTION_PARENT_COMPONENT"),lb=qy(function(){return function e(){m(this,e)}}()),hb=0,fb=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i,r;return m(this,n),(i=t.call(this))._labelId="mat-optgroup-label-"+hb++,i._inert=null!==(r=null==e?void 0:e.inertGroups)&&void 0!==r&&r,i}return n}(lb);return e.\u0275fac=function(t){return new(t||e)(Es(cb,8))},e.\u0275dir=It({type:e,inputs:{label:"label"},features:[ss]}),e}(),db=new Mi("MatOptgroup"),pb=0,vb=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e),this.source=t,this.isUserInput=n},gb=function(){var e=function(){function e(t,n,i,r){m(this,e),this._element=t,this._changeDetectorRef=n,this._parent=i,this.group=r,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+pb++,this.onSelectionChange=new Zc,this._stateChanges=new oe}return b(e,[{key:"multiple",get:function(){return this._parent&&this._parent.multiple}},{key:"selected",get:function(){return this._selected}},{key:"disabled",get:function(){return this.group&&this.group.disabled||this._disabled},set:function(e){this._disabled=If(e)}},{key:"disableRipple",get:function(){return this._parent&&this._parent.disableRipple}},{key:"active",get:function(){return this._active}},{key:"viewValue",get:function(){return(this._getHostElement().textContent||"").trim()}},{key:"select",value:function(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}},{key:"deselect",value:function(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}},{key:"focus",value:function(e,t){var n=this._getHostElement();"function"==typeof n.focus&&n.focus(t)}},{key:"setActiveStyles",value:function(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}},{key:"setInactiveStyles",value:function(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}},{key:"getLabel",value:function(){return this.viewValue}},{key:"_handleKeydown",value:function(e){(13===e.keyCode||32===e.keyCode)&&!fp(e)&&(this._selectViaInteraction(),e.preventDefault())}},{key:"_selectViaInteraction",value:function(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}},{key:"_getAriaSelected",value:function(){return this.selected||!this.multiple&&null}},{key:"_getTabIndex",value:function(){return this.disabled?"-1":"0"}},{key:"_getHostElement",value:function(){return this._element.nativeElement}},{key:"ngAfterViewChecked",value:function(){if(this._selected){var e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue=e,this._stateChanges.next())}}},{key:"ngOnDestroy",value:function(){this._stateChanges.complete()}},{key:"_emitSelectionChangeEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.onSelectionChange.emit(new vb(this,e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(wc),Es(void 0),Es(fb))},e.\u0275dir=It({type:e,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),e}(),mb=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o){return m(this,n),t.call(this,e,i,r,o)}return n}(gb);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(wc),Es(cb,8),Es(db,8))},e.\u0275cmp=Ct({type:e,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(e,t){1&e&&Fs("click",function(){return t._selectViaInteraction()})("keydown",function(e){return t._handleKeydown(e)}),2&e&&(Ou("id",t.id),_s("tabindex",t._getTabIndex())("aria-selected",t._getAriaSelected())("aria-disabled",t.disabled.toString()),su("mat-selected",t.selected)("mat-option-multiple",t.multiple)("mat-active",t.active)("mat-option-disabled",t.disabled))},exportAs:["matOption"],features:[ss],ngContentSelectors:Uy,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(e,t){1&e&&(Ws(),xs(0,Vy,1,2,"mat-pseudo-checkbox",0),Ts(1,"span",1),qs(2),As(),xs(3,zy,2,1,"span",2),Ps(4,"div",3)),2&e&&(Cs("ngIf",t.multiple),qo(3),Cs("ngIf",t.group&&t.group._inert),qo(1),Cs("matRippleTrigger",t._getHostElement())("matRippleDisabled",t.disabled||t.disableRipple))},directives:[Lh,ob,sb],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),e}();function yb(e,t,n){if(n.length){for(var i=t.toArray(),r=n.toArray(),o=0,a=0;an+i?Math.max(0,e-i+t):n}var _b=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[ab,Kh,Wy,ub]]}),e}();function wb(){for(var e=arguments.length,t=new Array(e),n=0;n0){var i=e.slice(0,t),r=i.toLowerCase(),o=e.slice(t+1).trim();n.maybeSetNormalizedName(i,r),n.headers.has(r)?n.headers.get(r).push(o):n.headers.set(r,[o])}})}:function(){n.headers=new Map,Object.keys(t).forEach(function(e){var i=t[e],r=e.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(n.headers.set(r,i),n.maybeSetNormalizedName(e,r))})}:this.headers=new Map}return b(e,[{key:"has",value:function(e){return this.init(),this.headers.has(e.toLowerCase())}},{key:"get",value:function(e){this.init();var t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}},{key:"keys",value:function(){return this.init(),Array.from(this.normalizedNames.values())}},{key:"getAll",value:function(e){return this.init(),this.headers.get(e.toLowerCase())||null}},{key:"append",value:function(e,t){return this.clone({name:e,value:t,op:"a"})}},{key:"set",value:function(e,t){return this.clone({name:e,value:t,op:"s"})}},{key:"delete",value:function(e,t){return this.clone({name:e,value:t,op:"d"})}},{key:"maybeSetNormalizedName",value:function(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}},{key:"init",value:function(){var t=this;this.lazyInit&&(this.lazyInit instanceof e?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(function(e){return t.applyUpdate(e)}),this.lazyUpdate=null))}},{key:"copyFrom",value:function(e){var t=this;e.init(),Array.from(e.headers.keys()).forEach(function(n){t.headers.set(n,e.headers.get(n)),t.normalizedNames.set(n,e.normalizedNames.get(n))})}},{key:"clone",value:function(t){var n=new e;return n.lazyInit=this.lazyInit&&this.lazyInit instanceof e?this.lazyInit:this,n.lazyUpdate=(this.lazyUpdate||[]).concat([t]),n}},{key:"applyUpdate",value:function(e){var t=e.name.toLowerCase();switch(e.op){case"a":case"s":var n=e.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(e.name,t);var i=("a"===e.op?this.headers.get(t):void 0)||[];i.push.apply(i,v(n)),this.headers.set(t,i);break;case"d":var r=e.value;if(r){var o=this.headers.get(t);if(!o)return;0===(o=o.filter(function(e){return-1===r.indexOf(e)})).length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}},{key:"forEach",value:function(e){var t=this;this.init(),Array.from(this.normalizedNames.keys()).forEach(function(n){return e(t.normalizedNames.get(n),t.headers.get(n))})}}]),e}(),Ib=function(){function e(){m(this,e)}return b(e,[{key:"encodeKey",value:function(e){return Nb(e)}},{key:"encodeValue",value:function(e){return Nb(e)}},{key:"decodeKey",value:function(e){return decodeURIComponent(e)}},{key:"decodeValue",value:function(e){return decodeURIComponent(e)}}]),e}(),Rb=/%(\d[a-f0-9])/gi,Db={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Nb(e){return encodeURIComponent(e).replace(Rb,function(e,t){var n;return null!==(n=Db[t])&&void 0!==n?n:e})}function Lb(e){return"".concat(e)}var jb=function(){function e(){var n=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(m(this,e),this.updates=null,this.cloneFrom=null,this.encoder=i.encoder||new Ib,i.fromString){if(i.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,n){var i=new Map;return e.length>0&&e.replace(/^\?/,"").split("&").forEach(function(e){var r=e.indexOf("="),o=t(-1==r?[n.decodeKey(e),""]:[n.decodeKey(e.slice(0,r)),n.decodeValue(e.slice(r+1))],2),a=o[0],s=o[1],u=i.get(a)||[];u.push(s),i.set(a,u)}),i}(i.fromString,this.encoder)}else i.fromObject?(this.map=new Map,Object.keys(i.fromObject).forEach(function(e){var t=i.fromObject[e];n.map.set(e,Array.isArray(t)?t:[t])})):this.map=null}return b(e,[{key:"has",value:function(e){return this.init(),this.map.has(e)}},{key:"get",value:function(e){this.init();var t=this.map.get(e);return t?t[0]:null}},{key:"getAll",value:function(e){return this.init(),this.map.get(e)||null}},{key:"keys",value:function(){return this.init(),Array.from(this.map.keys())}},{key:"append",value:function(e,t){return this.clone({param:e,value:t,op:"a"})}},{key:"appendAll",value:function(e){var t=[];return Object.keys(e).forEach(function(n){var i=e[n];Array.isArray(i)?i.forEach(function(e){t.push({param:n,value:e,op:"a"})}):t.push({param:n,value:i,op:"a"})}),this.clone(t)}},{key:"set",value:function(e,t){return this.clone({param:e,value:t,op:"s"})}},{key:"delete",value:function(e,t){return this.clone({param:e,value:t,op:"d"})}},{key:"toString",value:function(){var e=this;return this.init(),this.keys().map(function(t){var n=e.encoder.encodeKey(t);return e.map.get(t).map(function(t){return n+"="+e.encoder.encodeValue(t)}).join("&")}).filter(function(e){return""!==e}).join("&")}},{key:"clone",value:function(t){var n=new e({encoder:this.encoder});return n.cloneFrom=this.cloneFrom||this,n.updates=(this.updates||[]).concat(t),n}},{key:"init",value:function(){var e=this;null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(function(t){return e.map.set(t,e.cloneFrom.map.get(t))}),this.updates.forEach(function(t){switch(t.op){case"a":case"s":var n=("a"===t.op?e.map.get(t.param):void 0)||[];n.push(Lb(t.value)),e.map.set(t.param,n);break;case"d":if(void 0===t.value){e.map.delete(t.param);break}var i=e.map.get(t.param)||[],r=i.indexOf(Lb(t.value));-1!==r&&i.splice(r,1),i.length>0?e.map.set(t.param,i):e.map.delete(t.param)}}),this.cloneFrom=this.updates=null)}}]),e}(),Fb=function(){function e(){m(this,e),this.map=new Map}return b(e,[{key:"set",value:function(e,t){return this.map.set(e,t),this}},{key:"get",value:function(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}},{key:"delete",value:function(e){return this.map.delete(e),this}},{key:"keys",value:function(){return this.map.keys()}}]),e}();function Bb(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function Vb(e){return"undefined"!=typeof Blob&&e instanceof Blob}function zb(e){return"undefined"!=typeof FormData&&e instanceof FormData}var Ub=function(){function e(t,n,i,r){var o;if(m(this,e),this.url=n,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==i?i:null,o=r):o=i,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params)),this.headers||(this.headers=new Mb),this.context||(this.context=new Fb),this.params){var a=this.params.toString();if(0===a.length)this.urlWithParams=n;else{var s=n.indexOf("?");this.urlWithParams=n+(-1===s?"?":s0&&void 0!==arguments[0]?arguments[0]:{},i=n.method||this.method,r=n.url||this.url,o=n.responseType||this.responseType,a=void 0!==n.body?n.body:this.body,s=void 0!==n.withCredentials?n.withCredentials:this.withCredentials,u=void 0!==n.reportProgress?n.reportProgress:this.reportProgress,c=n.headers||this.headers,l=n.params||this.params,h=null!==(t=n.context)&&void 0!==t?t:this.context;return void 0!==n.setHeaders&&(c=Object.keys(n.setHeaders).reduce(function(e,t){return e.set(t,n.setHeaders[t])},c)),n.setParams&&(l=Object.keys(n.setParams).reduce(function(e,t){return e.set(t,n.setParams[t])},l)),new e(i,r,a,{params:l,headers:c,context:h,reportProgress:u,responseType:o,withCredentials:s})}}]),e}(),Hb=((Hb=Hb||{})[Hb.Sent=0]="Sent",Hb[Hb.UploadProgress=1]="UploadProgress",Hb[Hb.ResponseHeader=2]="ResponseHeader",Hb[Hb.DownloadProgress=3]="DownloadProgress",Hb[Hb.Response=4]="Response",Hb[Hb.User=5]="User",Hb),Gb=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"OK";m(this,e),this.headers=t.headers||new Mb,this.status=void 0!==t.status?t.status:n,this.statusText=t.statusText||i,this.url=t.url||null,this.ok=this.status>=200&&this.status<300},Wb=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m(this,n),(e=t.call(this,i)).type=Hb.ResponseHeader,e}return b(n,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new n({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}]),n}(Gb),qb=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m(this,n),(e=t.call(this,i)).type=Hb.Response,e.body=void 0!==i.body?i.body:null,e}return b(n,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new n({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}]),n}(Gb),Xb=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,e,0,"Unknown Error")).name="HttpErrorResponse",i.ok=!1,i.message=i.status>=200&&i.status<300?"Http failure during parsing for ".concat(e.url||"(unknown url)"):"Http failure response for ".concat(e.url||"(unknown url)",": ").concat(e.status," ").concat(e.statusText),i.error=e.error||null,i}return n}(Gb);function Yb(e,t){return{body:t,headers:e.headers,context:e.context,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}var Kb=function(){var e=function(){function e(t){m(this,e),this.handler=t}return b(e,[{key:"request",value:function(e,t){var n,i,r,o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e instanceof Ub?n=e:(i=a.headers instanceof Mb?a.headers:new Mb(a.headers),a.params&&(r=a.params instanceof jb?a.params:new jb({fromObject:a.params})),n=new Ub(e,t,void 0!==a.body?a.body:null,{headers:i,context:a.context,params:r,reportProgress:a.reportProgress,responseType:a.responseType||"json",withCredentials:a.withCredentials}));var s=jf(n).pipe(we(function(e){return o.handler.handle(e)},void 0,1));if(e instanceof Ub||"events"===a.observe)return s;var u=s.pipe(od(function(e){return e instanceof qb}));switch(a.observe||"body"){case"body":switch(n.responseType){case"arraybuffer":return u.pipe(ue(function(e){if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body}));case"blob":return u.pipe(ue(function(e){if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body}));case"text":return u.pipe(ue(function(e){if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body}));case"json":default:return u.pipe(ue(function(e){return e.body}))}case"response":return u;default:throw new Error("Unreachable: unhandled observe type ".concat(a.observe,"}"))}}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("DELETE",e,t)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("GET",e,t)}},{key:"head",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("HEAD",e,t)}},{key:"jsonp",value:function(e,t){return this.request("JSONP",e,{params:(new jb).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}},{key:"options",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("OPTIONS",e,t)}},{key:"patch",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PATCH",e,Yb(n,t))}},{key:"post",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",e,Yb(n,t))}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",e,Yb(n,t))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Ab))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Qb=function(){function e(t,n){m(this,e),this.next=t,this.interceptor=n}return b(e,[{key:"handle",value:function(e){return this.interceptor.intercept(e,this.next)}}]),e}(),$b=new Mi("HTTP_INTERCEPTORS"),Zb=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"intercept",value:function(e,t){return t.handle(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Jb=/^\)\]\}',?\n/,e_=function(){var e=function(){function e(t){m(this,e),this.xhrFactory=t}return b(e,[{key:"handle",value:function(e){var t=this;if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new ee(function(n){var i=t.xhrFactory.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach(function(e,t){return i.setRequestHeader(e,t.join(","))}),e.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){var r=e.detectContentTypeHeader();null!==r&&i.setRequestHeader("Content-Type",r)}if(e.responseType){var o=e.responseType.toLowerCase();i.responseType="json"!==o?o:"text"}var a=e.serializeBody(),s=null,u=function(){if(null!==s)return s;var t=1223===i.status?204:i.status,n=i.statusText||"OK",r=new Mb(i.getAllResponseHeaders()),o=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(i)||e.url;return s=new Wb({headers:r,status:t,statusText:n,url:o})},c=function(){var t=u(),r=t.headers,o=t.status,a=t.statusText,s=t.url,c=null;204!==o&&(c=void 0===i.response?i.responseText:i.response),0===o&&(o=c?200:0);var l=o>=200&&o<300;if("json"===e.responseType&&"string"==typeof c){var h=c;c=c.replace(Jb,"");try{c=""!==c?JSON.parse(c):null}catch(f){c=h,l&&(l=!1,c={error:f,text:c})}}l?(n.next(new qb({body:c,headers:r,status:o,statusText:a,url:s||void 0})),n.complete()):n.error(new Xb({error:c,headers:r,status:o,statusText:a,url:s||void 0}))},l=function(e){var t=u().url,r=new Xb({error:e,status:i.status||0,statusText:i.statusText||"Unknown Error",url:t||void 0});n.error(r)},h=!1,f=function(t){h||(n.next(u()),h=!0);var r={type:Hb.DownloadProgress,loaded:t.loaded};t.lengthComputable&&(r.total=t.total),"text"===e.responseType&&!!i.responseText&&(r.partialText=i.responseText),n.next(r)},d=function(e){var t={type:Hb.UploadProgress,loaded:e.loaded};e.lengthComputable&&(t.total=e.total),n.next(t)};return i.addEventListener("load",c),i.addEventListener("error",l),i.addEventListener("timeout",l),i.addEventListener("abort",l),e.reportProgress&&(i.addEventListener("progress",f),null!==a&&i.upload&&i.upload.addEventListener("progress",d)),i.send(a),n.next({type:Hb.Sent}),function(){i.removeEventListener("error",l),i.removeEventListener("abort",l),i.removeEventListener("load",c),i.removeEventListener("timeout",l),e.reportProgress&&(i.removeEventListener("progress",f),null!==a&&i.upload&&i.upload.removeEventListener("progress",d)),i.readyState!==i.DONE&&i.abort()}})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Jh))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),t_=new Mi("XSRF_COOKIE_NAME"),n_=new Mi("XSRF_HEADER_NAME"),i_=function e(){m(this,e)},r_=function(){var e=function(){function e(t,n,i){m(this,e),this.doc=t,this.platform=n,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}return b(e,[{key:"getToken",value:function(){if("server"===this.platform)return null;var e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=Mh(e,this.cookieName),this.lastCookieString=e),this.lastToken}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(fh),Qi(Sl),Qi(t_))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),o_=function(){var e=function(){function e(t,n){m(this,e),this.tokenService=t,this.headerName=n}return b(e,[{key:"intercept",value:function(e,t){var n=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||n.startsWith("http://")||n.startsWith("https://"))return t.handle(e);var i=this.tokenService.getToken();return null!==i&&!e.headers.has(this.headerName)&&(e=e.clone({headers:e.headers.set(this.headerName,i)})),t.handle(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(i_),Qi(n_))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),a_=function(){var e=function(){function e(t,n){m(this,e),this.backend=t,this.injector=n,this.chain=null}return b(e,[{key:"handle",value:function(e){if(null===this.chain){var t=this.injector.get($b,[]);this.chain=t.reduceRight(function(e,t){return new Qb(e,t)},this.backend)}return this.chain.handle(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Pb),Qi(os))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),s_=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"disable",value:function(){return{ngModule:e,providers:[{provide:o_,useClass:Zb}]}}},{key:"withOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{ngModule:e,providers:[t.cookieName?{provide:t_,useValue:t.cookieName}:[],t.headerName?{provide:n_,useValue:t.headerName}:[]]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[o_,{provide:$b,useExisting:o_,multi:!0},{provide:i_,useClass:r_},{provide:t_,useValue:"XSRF-TOKEN"},{provide:n_,useValue:"X-XSRF-TOKEN"}]}),e}(),u_=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[Kb,{provide:Ab,useClass:a_},e_,{provide:Pb,useExisting:e_}],imports:[[s_.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),e}(),c_=["*"];function l_(e){return Error('Unable to find icon with the name "'.concat(e,'"'))}function h_(e){return Error("The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was \"".concat(e,'".'))}function f_(e){return Error("The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was \"".concat(e,'".'))}var d_=function e(t,n,i){m(this,e),this.url=t,this.svgText=n,this.options=i},p_=function(){var e=function(){function e(t,n,i,r){m(this,e),this._httpClient=t,this._sanitizer=n,this._errorHandler=r,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=i}return b(e,[{key:"addSvgIcon",value:function(e,t,n){return this.addSvgIconInNamespace("",e,t,n)}},{key:"addSvgIconLiteral",value:function(e,t,n){return this.addSvgIconLiteralInNamespace("",e,t,n)}},{key:"addSvgIconInNamespace",value:function(e,t,n,i){return this._addSvgIconConfig(e,t,new d_(n,null,i))}},{key:"addSvgIconResolver",value:function(e){return this._resolvers.push(e),this}},{key:"addSvgIconLiteralInNamespace",value:function(e,t,n,i){var r=this._sanitizer.sanitize(Hr.HTML,n);if(!r)throw f_(n);return this._addSvgIconConfig(e,t,new d_("",r,i))}},{key:"addSvgIconSet",value:function(e,t){return this.addSvgIconSetInNamespace("",e,t)}},{key:"addSvgIconSetLiteral",value:function(e,t){return this.addSvgIconSetLiteralInNamespace("",e,t)}},{key:"addSvgIconSetInNamespace",value:function(e,t,n){return this._addSvgIconSetConfig(e,new d_(t,null,n))}},{key:"addSvgIconSetLiteralInNamespace",value:function(e,t,n){var i=this._sanitizer.sanitize(Hr.HTML,t);if(!i)throw f_(t);return this._addSvgIconSetConfig(e,new d_("",i,n))}},{key:"registerFontClassAlias",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this._fontCssClassesByAlias.set(e,t),this}},{key:"classNameForFontAlias",value:function(e){return this._fontCssClassesByAlias.get(e)||e}},{key:"setDefaultFontSetClass",value:function(e){return this._defaultFontSetClass=e,this}},{key:"getDefaultFontSetClass",value:function(){return this._defaultFontSetClass}},{key:"getSvgIconFromUrl",value:function(e){var t=this,n=this._sanitizer.sanitize(Hr.RESOURCE_URL,e);if(!n)throw h_(e);var i=this._cachedIconsByUrl.get(n);return i?jf(v_(i)):this._loadSvgIconFromConfig(new d_(e,null)).pipe(rv(function(e){return t._cachedIconsByUrl.set(n,e)}),ue(function(e){return v_(e)}))}},{key:"getNamedSvgIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=g_(t,e),i=this._svgIconConfigs.get(n);if(i)return this._getSvgFromConfig(i);if(i=this._getIconConfigFromResolvers(t,e))return this._svgIconConfigs.set(n,i),this._getSvgFromConfig(i);var r=this._iconSetConfigs.get(t);return r?this._getSvgFromIconSetConfigs(e,r):bd(l_(n))}},{key:"ngOnDestroy",value:function(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}},{key:"_getSvgFromConfig",value:function(e){return e.svgText?jf(v_(this._svgElementFromConfig(e))):this._loadSvgIconFromConfig(e).pipe(ue(function(e){return v_(e)}))}},{key:"_getSvgFromIconSetConfigs",value:function(e,t){var n=this,i=this._extractIconWithNameFromAnySet(e,t);return i?jf(i):wb(t.filter(function(e){return!e.svgText}).map(function(e){return n._loadSvgIconSetFromConfig(e).pipe(xb(function(t){var i="Loading icon set URL: ".concat(n._sanitizer.sanitize(Hr.RESOURCE_URL,e.url)," failed: ").concat(t.message);return n._errorHandler.handleError(new Error(i)),jf(null)}))})).pipe(ue(function(){var i=n._extractIconWithNameFromAnySet(e,t);if(!i)throw l_(e);return i}))}},{key:"_extractIconWithNameFromAnySet",value:function(e,t){for(var n=t.length-1;n>=0;n--){var i=t[n];if(i.svgText&&i.svgText.indexOf(e)>-1){var r=this._svgElementFromConfig(i),o=this._extractSvgIconFromSet(r,e,i.options);if(o)return o}}return null}},{key:"_loadSvgIconFromConfig",value:function(e){var t=this;return this._fetchIcon(e).pipe(rv(function(t){return e.svgText=t}),ue(function(){return t._svgElementFromConfig(e)}))}},{key:"_loadSvgIconSetFromConfig",value:function(e){return e.svgText?jf(null):this._fetchIcon(e).pipe(rv(function(t){return e.svgText=t}))}},{key:"_extractSvgIconFromSet",value:function(e,t,n){var i=e.querySelector('[id="'.concat(t,'"]'));if(!i)return null;var r=i.cloneNode(!0);if(r.removeAttribute("id"),"svg"===r.nodeName.toLowerCase())return this._setSvgAttributes(r,n);if("symbol"===r.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(r),n);var o=this._svgElementFromString("");return o.appendChild(r),this._setSvgAttributes(o,n)}},{key:"_svgElementFromString",value:function(e){var t=this._document.createElement("DIV");t.innerHTML=e;var n=t.querySelector("svg");if(!n)throw Error(" tag not found");return n}},{key:"_toSvgElement",value:function(e){for(var t=this._svgElementFromString(""),n=e.attributes,i=0;i*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n",T_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],A_=Xy(qy(Yy(function(){return function e(t){m(this,e),this._elementRef=t}}()))),P_=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;m(this,n),(o=t.call(this,e))._focusMonitor=i,o._animationMode=r,o.isRoundButton=o._hasHostAttributes("mat-fab","mat-mini-fab"),o.isIconButton=o._hasHostAttributes("mat-icon-button");var a,s=_(T_);try{for(s.s();!(a=s.n()).done;){var u=a.value;o._hasHostAttributes(u)&&o._getHostElement().classList.add(u)}}catch(c){s.e(c)}finally{s.f()}return e.nativeElement.classList.add("mat-button-base"),o.isRoundButton&&(o.color="accent"),o}return b(n,[{key:"ngAfterViewInit",value:function(){this._focusMonitor.monitor(this._elementRef,!0)}},{key:"ngOnDestroy",value:function(){this._focusMonitor.stopMonitoring(this._elementRef)}},{key:"focus",value:function(e,t){e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t)}},{key:"_getHostElement",value:function(){return this._elementRef.nativeElement}},{key:"_isRippleDisabled",value:function(){return this.disableRipple||this.disabled}},{key:"_hasHostAttributes",value:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i4&&void 0!==arguments[4]?arguments[4]:new D_(e,n,i);if(!r.closed)return t instanceof ee?t.subscribe(r):ve(t)(r)}var L_={};function j_(){for(var e=arguments.length,t=new Array(e),n=0;n visible",tg("150ms cubic-bezier(0, 0, 0.2, 1)")),og("* => void, * => hidden",tg("75ms cubic-bezier(0.4, 0.0, 1, 1)",ig({opacity:0})))])},ew=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a){var s;return m(this,n),(s=t.call(this))._ngZone=e,s._elementRef=i,s._changeDetectorRef=r,s._platform=o,s.snackBarConfig=a,s._announceDelay=150,s._destroyed=!1,s._onAnnounce=new oe,s._onExit=new oe,s._onEnter=new oe,s._animationState="void",s.attachDomPortal=function(e){return s._assertNotAttached(),s._applySnackBarClasses(),s._portalOutlet.attachDomPortal(e)},s._live="assertive"!==a.politeness||a.announcementMessage?"off"===a.politeness?"off":"polite":"assertive",s._platform.FIREFOX&&("polite"===s._live&&(s._role="status"),"assertive"===s._live&&(s._role="alert")),s}return b(n,[{key:"attachComponentPortal",value:function(e){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(e)}},{key:"attachTemplatePortal",value:function(e){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(e)}},{key:"onAnimationEnd",value:function(e){var t=e.fromState,n=e.toState;if(("void"===n&&"void"!==t||"hidden"===n)&&this._completeExit(),"visible"===n){var i=this._onEnter;this._ngZone.run(function(){i.next(),i.complete()})}}},{key:"enter",value:function(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}},{key:"exit",value:function(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}},{key:"ngOnDestroy",value:function(){this._destroyed=!0,this._completeExit()}},{key:"_completeExit",value:function(){var e=this;this._ngZone.onMicrotaskEmpty.pipe(ap(1)).subscribe(function(){e._onExit.next(),e._onExit.complete()})}},{key:"_applySnackBarClasses",value:function(){var e=this._elementRef.nativeElement,t=this.snackBarConfig.panelClass;t&&(Array.isArray(t)?t.forEach(function(t){return e.classList.add(t)}):e.classList.add(t)),"center"===this.snackBarConfig.horizontalPosition&&e.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&e.classList.add("mat-snack-bar-top")}},{key:"_assertNotAttached",value:function(){this._portalOutlet.hasAttached()}},{key:"_screenReaderAnnounce",value:function(){var e=this;this._announceTimeoutId||this._ngZone.runOutsideAngular(function(){e._announceTimeoutId=setTimeout(function(){var t=e._elementRef.nativeElement.querySelector("[aria-hidden]"),n=e._elementRef.nativeElement.querySelector("[aria-live]");if(t&&n){var i=null;e._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(i=document.activeElement),t.removeAttribute("aria-hidden"),n.appendChild(t),null==i||i.focus(),e._onAnnounce.next(),e._onAnnounce.complete()}},e._announceDelay)})}}]),n}(Jd);return e.\u0275fac=function(t){return new(t||e)(Es(Vl),Es(Ku),Es(wc),Es(Id),Es(K_))},e.\u0275cmp=Ct({type:e,selectors:[["snack-bar-container"]],viewQuery:function(e,t){var n;(1&e&&hl(ip,7),2&e)&&(ll(n=dl())&&(t._portalOutlet=n.first))},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(e,t){1&e&&Bs("@state.done",function(e){return t.onAnimationEnd(e)}),2&e&&Tu("@state",t._animationState)},features:[ss],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(e,t){1&e&&(Ts(0,"div",0),xs(1,X_,0,0,"ng-template",1),As(),Ps(2,"div")),2&e&&(qo(2),_s("aria-live",t._live)("role",t._role))},directives:[ip],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[J_.snackBarState]}}),e}(),tw=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kp,rp,Kh,I_,Wy],Wy]}),e}(),nw=new Mi("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new K_}}),iw=function(){var e=function(){function e(t,n,i,r,o,a){m(this,e),this._overlay=t,this._live=n,this._injector=i,this._breakpointObserver=r,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=Z_,this.snackBarContainerComponent=ew,this.handsetCssClass="mat-snack-bar-handset"}return b(e,[{key:"_openedSnackBarRef",get:function(){var e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel},set:function(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}},{key:"openFromComponent",value:function(e,t){return this._attach(e,t)}},{key:"openFromTemplate",value:function(e,t){return this._attach(e,t)}},{key:"open",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=Object.assign(Object.assign({},this._defaultConfig),n);return i.data={message:e,action:t},i.announcementMessage===e&&(i.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,i)}},{key:"dismiss",value:function(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}},{key:"ngOnDestroy",value:function(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}},{key:"_attachSnackBarContainer",value:function(e,t){var n=os.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:K_,useValue:t}]}),i=new Qd(this.snackBarContainerComponent,t.viewContainerRef,n),r=e.attach(i);return r.instance.snackBarConfig=t,r.instance}},{key:"_attach",value:function(e,t){var n=this,i=Object.assign(Object.assign(Object.assign({},new K_),this._defaultConfig),t),r=this._createOverlay(i),o=this._attachSnackBarContainer(r,i),a=new $_(o,r);if(e instanceof Cc){var s=new $d(e,null,{$implicit:i.data,snackBarRef:a});a.instance=o.attachTemplatePortal(s)}else{var u=this._createInjector(i,a),c=new Qd(e,void 0,u),l=o.attachComponentPortal(c);a.instance=l.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(ud(r.detachments())).subscribe(function(e){var t=r.overlayElement.classList;e.matches?t.add(n.handsetCssClass):t.remove(n.handsetCssClass)}),i.announcementMessage&&o._onAnnounce.subscribe(function(){n._live.announce(i.announcementMessage,i.politeness)}),this._animateSnackBar(a,i),this._openedSnackBarRef=a,this._openedSnackBarRef}},{key:"_animateSnackBar",value:function(e,t){var n=this;e.afterDismissed().subscribe(function(){n._openedSnackBarRef==e&&(n._openedSnackBarRef=null),t.announcementMessage&&n._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(function(){e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter(),t.duration&&t.duration>0&&e.afterOpened().subscribe(function(){return e._dismissAfter(t.duration)})}},{key:"_createOverlay",value:function(e){var t=new wp;t.direction=e.direction;var n=this._overlay.position().global(),i="rtl"===e.direction,r="left"===e.horizontalPosition||"start"===e.horizontalPosition&&!i||"end"===e.horizontalPosition&&i,o=!r&&"center"!==e.horizontalPosition;return r?n.left("0"):o?n.right("0"):n.centerHorizontally(),"top"===e.verticalPosition?n.top("0"):n.bottom("0"),t.positionStrategy=n,this._overlay.create(t)}},{key:"_createInjector",value:function(e,t){return os.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:$_,useValue:t},{provide:Y_,useValue:e.data}]})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Hp),Qi(Uv),Qi(os),Qi(G_),Qi(e,12),Qi(nw))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Hp),Qi(Uv),Qi(Wa),Qi(G_),Qi(e,12),Qi(nw))},token:e,providedIn:tw}),e}(),rw={tooltipState:eg("state",[rg("initial, void, hidden",ig({opacity:0,transform:"scale(0)"})),rg("visible",ig({transform:"scale(1)"})),og("* => visible",tg("200ms cubic-bezier(0, 0, 0.2, 1)",function(e){return{type:5,steps:e}}([ig({opacity:0,transform:"scale(0)",offset:0}),ig({opacity:.5,transform:"scale(0.99)",offset:.5}),ig({opacity:1,transform:"scale(1)",offset:1})]))),og("* => hidden",tg("100ms cubic-bezier(0, 0, 0.2, 1)",ig({opacity:0})))])},ow="tooltip-panel",aw=Ld({passive:!0}),sw=new Mi("mat-tooltip-scroll-strategy"),uw={provide:sw,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.reposition({scrollThrottle:20})}}},cw=new Mi("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}}),lw=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h,f){var d=this;m(this,e),this._overlay=t,this._elementRef=n,this._scrollDispatcher=i,this._viewContainerRef=r,this._ngZone=o,this._platform=a,this._ariaDescriber=s,this._focusMonitor=u,this._dir=l,this._defaultOptions=h,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new oe,this._handleKeydown=function(e){d._isTooltipVisible()&&27===e.keyCode&&!fp(e)&&(e.preventDefault(),e.stopPropagation(),d._ngZone.run(function(){return d.hide(0)}))},this._scrollStrategy=c,this._document=f,h&&(h.position&&(this.position=h.position),h.touchGestures&&(this.touchGestures=h.touchGestures)),l.change.pipe(ud(this._destroyed)).subscribe(function(){d._overlayRef&&d._updatePosition(d._overlayRef)}),o.runOutsideAngular(function(){n.nativeElement.addEventListener("keydown",d._handleKeydown)})}return b(e,[{key:"position",get:function(){return this._position},set:function(e){var t;e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(t=this._tooltipInstance)||void 0===t||t.show(0),this._overlayRef.updatePosition()))}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=If(e),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}},{key:"message",get:function(){return this._message},set:function(e){var t=this;this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=e?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(function(){Promise.resolve().then(function(){t._ariaDescriber.describe(t._elementRef.nativeElement,t.message,"tooltip")})}))}},{key:"tooltipClass",get:function(){return this._tooltipClass},set:function(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}},{key:"ngAfterViewInit",value:function(){var e=this;this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(ud(this._destroyed)).subscribe(function(t){t?"keyboard"===t&&e._ngZone.run(function(){return e.show()}):e._ngZone.run(function(){return e.hide(0)})})}},{key:"ngOnDestroy",value:function(){var e=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),e.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(function(n){var i=t(n,2),r=i[0],o=i[1];e.removeEventListener(r,o,aw)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}},{key:"show",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.showDelay;if(!this.disabled&&this.message&&(!this._isTooltipVisible()||this._tooltipInstance._showTimeoutId||this._tooltipInstance._hideTimeoutId)){var n=this._createOverlay();this._detach(),this._portal=this._portal||new Qd(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=n.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(ud(this._destroyed)).subscribe(function(){return e._detach()}),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hideDelay;this._tooltipInstance&&this._tooltipInstance.hide(e)}},{key:"toggle",value:function(){this._isTooltipVisible()?this.hide():this.show()}},{key:"_isTooltipVisible",value:function(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}},{key:"_createOverlay",value:function(){var e=this;if(this._overlayRef)return this._overlayRef;var t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),n=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(".".concat(this._cssClassPrefix,"-tooltip")).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return n.positionChanges.pipe(ud(this._destroyed)).subscribe(function(t){e._updateCurrentPositionClass(t.connectionPair),e._tooltipInstance&&t.scrollableViewProperties.isOverlayClipped&&e._tooltipInstance.isVisible()&&e._ngZone.run(function(){return e.hide(0)})}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:n,panelClass:"".concat(this._cssClassPrefix,"-").concat(ow),scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(ud(this._destroyed)).subscribe(function(){return e._detach()}),this._overlayRef.outsidePointerEvents().pipe(ud(this._destroyed)).subscribe(function(){var t;return null===(t=e._tooltipInstance)||void 0===t?void 0:t._handleBodyInteraction()}),this._overlayRef}},{key:"_detach",value:function(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}},{key:"_updatePosition",value:function(e){var t=e.getConfig().positionStrategy,n=this._getOrigin(),i=this._getOverlayPosition();t.withPositions([this._addOffset(Object.assign(Object.assign({},n.main),i.main)),this._addOffset(Object.assign(Object.assign({},n.fallback),i.fallback))])}},{key:"_addOffset",value:function(e){return e}},{key:"_getOrigin",value:function(){var e,t=!this._dir||"ltr"==this._dir.value,n=this.position;"above"==n||"below"==n?e={originX:"center",originY:"above"==n?"top":"bottom"}:"before"==n||"left"==n&&t||"right"==n&&!t?e={originX:"start",originY:"center"}:("after"==n||"right"==n&&t||"left"==n&&!t)&&(e={originX:"end",originY:"center"});var i=this._invertPosition(e.originX,e.originY);return{main:e,fallback:{originX:i.x,originY:i.y}}}},{key:"_getOverlayPosition",value:function(){var e,t=!this._dir||"ltr"==this._dir.value,n=this.position;"above"==n?e={overlayX:"center",overlayY:"bottom"}:"below"==n?e={overlayX:"center",overlayY:"top"}:"before"==n||"left"==n&&t||"right"==n&&!t?e={overlayX:"end",overlayY:"center"}:("after"==n||"right"==n&&t||"left"==n&&!t)&&(e={overlayX:"start",overlayY:"center"});var i=this._invertPosition(e.overlayX,e.overlayY);return{main:e,fallback:{overlayX:i.x,overlayY:i.y}}}},{key:"_updateTooltipMessage",value:function(){var e=this;this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(ap(1),ud(this._destroyed)).subscribe(function(){e._tooltipInstance&&e._overlayRef.updatePosition()}))}},{key:"_setTooltipClass",value:function(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}},{key:"_invertPosition",value:function(e,t){return"above"===this.position||"below"===this.position?"top"===t?t="bottom":"bottom"===t&&(t="top"):"end"===e?e="start":"start"===e&&(e="end"),{x:e,y:t}}},{key:"_updateCurrentPositionClass",value:function(e){var t,n=e.overlayY,i=e.originX,r=e.originY;if((t="center"===n?this._dir&&"rtl"===this._dir.value?"end"===i?"left":"right":"start"===i?"left":"right":"bottom"===n&&"top"===r?"above":"below")!==this._currentPosition){var o=this._overlayRef;if(o){var a="".concat(this._cssClassPrefix,"-").concat(ow,"-");o.removePanelClass(a+this._currentPosition),o.addPanelClass(a+t)}this._currentPosition=t}}},{key:"_setupPointerEnterEventsIfNeeded",value:function(){var e=this;this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",function(){e._setupPointerExitEventsIfNeeded(),e.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",function(){e._setupPointerExitEventsIfNeeded(),clearTimeout(e._touchstartTimeout),e._touchstartTimeout=setTimeout(function(){return e.show()},500)}])),this._addListeners(this._passiveListeners))}},{key:"_setupPointerExitEventsIfNeeded",value:function(){var e,t=this;if(!this._pointerExitEventsInitialized){this._pointerExitEventsInitialized=!0;var n=[];if(this._platformSupportsMouseEvents())n.push(["mouseleave",function(){return t.hide()}],["wheel",function(e){return t._wheelListener(e)}]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();var i=function(){clearTimeout(t._touchstartTimeout),t.hide(t._defaultOptions.touchendHideDelay)};n.push(["touchend",i],["touchcancel",i])}this._addListeners(n),(e=this._passiveListeners).push.apply(e,n)}}},{key:"_addListeners",value:function(e){var n=this;e.forEach(function(e){var i=t(e,2),r=i[0],o=i[1];n._elementRef.nativeElement.addEventListener(r,o,aw)})}},{key:"_platformSupportsMouseEvents",value:function(){return!this._platform.IOS&&!this._platform.ANDROID}},{key:"_wheelListener",value:function(e){if(this._isTooltipVisible()){var t=this._document.elementFromPoint(e.clientX,e.clientY),n=this._elementRef.nativeElement;t!==n&&!n.contains(t)&&this.hide()}}},{key:"_disableNativeGesturesIfNecessary",value:function(){var e=this.touchGestures;if("off"!==e){var t=this._elementRef.nativeElement,n=t.style;("on"===e||"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName)&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),("on"===e||!t.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(Ku),Es(Wd),Es(Mc),Es(Vl),Es(Id),Es(Ev),Es(Wv),Es(void 0),Es(zd),Es(void 0),Es(fh))},e.\u0275dir=It({type:e,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),e}(),hw=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c,l,h,f,d){var p;return m(this,n),(p=t.call(this,e,i,r,o,a,s,u,c,l,h,f,d))._tooltipComponent=dw,p}return n}(lw);return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(Ku),Es(Wd),Es(Mc),Es(Vl),Es(Id),Es(Ev),Es(Wv),Es(sw),Es(zd,8),Es(cw,8),Es(fh))},e.\u0275dir=It({type:e,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ss]}),e}(),fw=function(){var e=function(){function e(t){m(this,e),this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new oe}return b(e,[{key:"show",value:function(e){var t=this;clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(function(){t._visibility="visible",t._showTimeoutId=void 0,t._onShow(),t._markForCheck()},e)}},{key:"hide",value:function(e){var t=this;clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(function(){t._visibility="hidden",t._hideTimeoutId=void 0,t._markForCheck()},e)}},{key:"afterHidden",value:function(){return this._onHide}},{key:"isVisible",value:function(){return"visible"===this._visibility}},{key:"ngOnDestroy",value:function(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}},{key:"_animationStart",value:function(){this._closeOnInteraction=!1}},{key:"_animationDone",value:function(e){var t=e.toState;"hidden"===t&&!this.isVisible()&&this._onHide.next(),("visible"===t||"hidden"===t)&&(this._closeOnInteraction=!0)}},{key:"_handleBodyInteraction",value:function(){this._closeOnInteraction&&this.hide(0)}},{key:"_markForCheck",value:function(){this._changeDetectorRef.markForCheck()}},{key:"_onShow",value:function(){}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(wc))},e.\u0275dir=It({type:e}),e}(),dw=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e))._breakpointObserver=i,r._isHandset=r._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)"),r}return n}(fw);return e.\u0275fac=function(t){return new(t||e)(Es(wc),Es(G_))},e.\u0275cmp=Ct({type:e,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(e,t){2&e&&au("zoom","visible"===t._visibility?1:null)},features:[ss],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(e,t){var n;(1&e&&(Ts(0,"div",0),Fs("@state.start",function(){return t._animationStart()})("@state.done",function(e){return t._animationDone(e)}),Kc(1,"async"),ku(2),As()),2&e)&&(su("mat-tooltip-handset",null==(n=Qc(1,5,t._isHandset))?null:n.matches),Cs("ngClass",t.tooltipClass)("@state",t._visibility),qo(2),xu(t.message))},directives:[Ih],pipes:[Yh],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[rw.tooltipState]},changeDetection:0}),e}(),pw=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[uw],imports:[[Qv,Kh,Kp,Wy],Wy,Xd]}),e}();function vw(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function gw(e,t){return function(n,i){t(n,i,e)}}function mw(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function yw(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{u(i.next(e))}catch(t){o(t)}}function s(e){try{u(i.throw(e))}catch(t){o(t)}}function u(e){e.done?r(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(a,s)}u((i=i.apply(e,t||[])).next())})}function bw(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;var t="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||t;return!!(n&&n.indexOf("Electron")>=0)}function _w(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||bw()}var ww="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",kw=_w(),xw=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";m(this,e),this.storage=function(e){try{var n=window[e],i="__storage_test__";return n.setItem(i,i),n.removeItem(i),n}catch(t){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return b(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Sw(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var o=e.width*n,a=e.height*n,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(r,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var Ew={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function Cw(e){return"string"==typeof e?Ew[e.toUpperCase()]||Ew.WHITE:e}function Ow(e,t){if(!e)throw new Error(t||"Assertion failed")}var Tw={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},Aw=Tw.window||Tw.self||Tw.global,Pw=Tw.process||{};function Mw(){var e;if(kw&&Aw.performance)e=Aw.performance.now();else if(Pw.hrtime){var t=Pw.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}console;var Iw={debug:kw&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Rw={enabled:!0,level:0};function Dw(){}var Nw={},Lw={once:!0};function jw(e){for(var t in e)for(var n in e[t])return n||"untitled";return"empty"}var Fw=function(){var e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},n=t.id;m(this,e),this.id=n,this.VERSION=ww,this._startTs=Mw(),this._deltaTs=Mw(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new xw("__probe-".concat(this.id,"__"),Rw),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],i=Object.getPrototypeOf(e),r=Object.getOwnPropertyNames(i),o=_(r);try{var a=function(){var i=t.value;"function"==typeof e[i]&&(n.find(function(e){return i===e})||(e[i]=e[i].bind(e)))};for(o.s();!(t=o.n()).done;)a()}catch(s){o.e(s)}finally{o.f()}}(this),Object.seal(this)}return b(e,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Mw()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Mw()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"assert",value:function(e,t){Ow(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Iw.warn,arguments,Lw)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Iw.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Iw.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Iw.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){return this._getLogFunction(e,t,Iw.debug||Iw.info,arguments,Lw)}},{key:"table",value:function(e,t,n){return t?this._getLogFunction(e,t,console.table||Dw,n&&[n],{tag:jw(t)}):Dw}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,o=e.message,a=void 0===o?"":o,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?kw?function(e){var t,n=e.image,i=e.message,r=void 0===i?"":i,o=e.scale,a=void 0===o?1:o;if("string"==typeof n){var s=new Image;return s.onload=function(){var e,t=Sw(s,r,a);(e=console).log.apply(e,v(t))},s.src=n,Dw}var u=n.nodeName||"";if("img"===u.toLowerCase())return(t=console).log.apply(t,v(Sw(n,r,a))),Dw;if("canvas"===u.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,v(Sw(c,r,a)))},c.src=n.toDataURL(),Dw}return Dw}({image:i,message:a,scale:u}):function(e){var t=e.image,n=e.scale,o=void 0===n?1:n,a=null;try{a=r(75307)}catch(i){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*o),"%")}).then(function(e){return console.log(e)})}:Dw}({image:i,message:a,scale:u}):Dw}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(o({},e,t))}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||Dw)}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=n=Vw({logLevel:e,message:t,opts:n}),r=i.collapsed;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Dw)}},{key:"withGroup",value:function(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=Bw(e)}},{key:"_getLogFunction",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(e)){var o;r=Vw({logLevel:e,message:t,args:i,opts:r}),Ow(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Mw();var a=r.tag||r.message;if(r.once){if(Nw[a])return Dw;Nw[a]=Mw()}return t=function(e,t,n){if("string"==typeof t){var i=n.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}(function(e){return e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s")}(n.total)):"";t=function(e,t,n){return!kw&&"string"==typeof e&&(t&&(t=Cw(t),e="\x1b[".concat(t,"m").concat(e,"\x1b[39m")),n&&(t=Cw(n),e="\x1b[".concat(n+10,"m").concat(e,"\x1b[49m"))),e}(t=n.time?"".concat(e,": ").concat(i," ").concat(t):"".concat(e,": ").concat(t),n.color,n.background)}return t}(this.id,r.message,r),(o=n).bind.apply(o,[console,t].concat(v(r.args)))}return Dw}}]),e}();return e.VERSION=ww,e}();function Bw(e){if(!e)return 0;var t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Ow(Number.isFinite(t)&&t>=0),t}function Vw(e){var t=e.logLevel,n=e.message;e.logLevel=Bw(t);for(var i=e.args?Array.from(e.args):[];i.length&&i.shift()!==n;);switch(e.args=i,typeof t){case"string":case"function":void 0!==n&&i.unshift(n),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var r=typeof e.message;return Ow("string"===r||"object"===r),Object.assign(e,e.opts)}var zw=new Fw({id:"deck"}),Uw={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Uw,"IDENTITY",{get:function(){return zw.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0}});var Hw={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Gw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Ww=new Fw({id:"luma.gl"});function qw(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function Xw(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version))}function Yw(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function Kw(e){return qw(Xw(e),"Invalid WebGLRenderingContext"),e}function Qw(e){return qw(Yw(e),"Requires WebGL2"),e}var $w=r(84761),Zw={},Jw=function e(t){var n=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},i=n.copyState,r=void 0!==i&&i,o=n.log,a=void 0===o?function(){}:o;m(this,e),this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=r?function(e,t){if("number"==typeof(t=t||ck)){var n=t,i=bk[n];return i?i(e,n):e.getParameter(n)}var r,o={},a=_(Array.isArray(t)?t:Object.keys(t));try{for(a.s();!(r=a.n()).done;){var s=r.value,u=bk[s];o[s]=u?u(e,Number(s)):e.getParameter(Number(s))}}catch(c){a.e(c)}finally{a.f()}return o}(t):Object.assign({},ck),this.log=a,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return b(e,[{key:"push",value:function(){this.stateStack.push({})}},{key:"pop",value:function(){qw(this.stateStack.length>0),Ok(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e){qw(void 0!==r);var o=e[r],a=this.cache[r];wk(o,a)||(n=!0,t=a,i&&!(r in i)&&(i[r]=a),this.cache[r]=o)}return{valueChanged:n,oldValue:t}}}]),e}();function Ek(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.enable,i=void 0===n||n,r=t.copyState;if(qw(void 0!==r),!e.state){var o="undefined"!=typeof global?global:window,a=o.polyfillContext;for(var s in a&&a(e),e.state=new Sk(e,{copyState:r}),function(e){var t=e.useProgram.bind(e);e.useProgram=function(n){e.state.program!==n&&(t(n),e.state.program=n)}}(e),mk)xk(e,s,mk[s]);kk(e,"getParameter"),kk(e,"isEnabled")}return e.state.enable=i,e}function Ck(e){qw(e.state),e.state.pop()}function Ok(e,t){if(qw(Xw(e),"setParameters requires a WebGL context"),!_k(t)){var n={};for(var i in t){var r=Number(i),o=pk[i];o&&("string"==typeof o?n[o]=!0:o(e,t[i],r))}var a=e.state&&e.state.cache;if(a)for(var s in n)gk[s](e,t,a)}}function Tk(e,t,n){if(_k(t))return n(e);var i,r=t.nocatch,o=void 0===r||r;if(function(e){e.state||Ek(e,{copyState:!1}),e.state.push()}(e),Ok(e,t),o)i=n(e),Ck(e);else try{i=n(e)}finally{Ck(e)}return i}function Ak(e){var t=e.luma;if(e.canvas&&t){var n=t.canvasSizeInfo.clientWidth;return n?e.drawingBufferWidth/n:1}return 1}function Pk(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(e,t,n,i,r){var o,a=Mk(e[0],t,n),s=Ik(e[1],t,i,r),u=Mk(e[0]+1,t,n),c=u===n-1?u:u-1;return u=Ik(e[1]+1,t,i,r),r?(o=s,s=u=0===u?u:u+1):o=u===i-1?u:u-1,{x:a,y:s,width:Math.max(c-a+1,1),height:Math.max(o-s+1,1)}}(t,Ak(e),e.drawingBufferWidth,e.drawingBufferHeight,n)}function Mk(e,t,n){return Math.min(Math.round(e*t),n-1)}function Ik(e,t,n,i){return i?Math.max(0,n-1-Math.round(e*t)):Math.min(Math.round(e*t),n-1)}var Rk=(0,$w.jU)(),Dk=Rk&&"undefined"!=typeof document,Nk={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Lk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qw(Rk,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils");var t,n=e=Object.assign({},Nk,e),i=n.width,r=n.height;function o(t){if(e.throwOnError)throw new Error(t);return console.error(t),null}e.onError=o;var a=e,s=a.canvas,u=function(e){var t,n=e.canvas,i=e.width,r=void 0===i?800:i,o=e.height,a=void 0===o?600:o,s=e.onError;return"string"==typeof n?(Dk&&"complete"===document.readyState||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):n?t=n:((t=document.createElement("canvas")).id="lumagl-canvas",t.style.width=Number.isFinite(r)?"".concat(r,"px"):"100%",t.style.height=Number.isFinite(a)?"".concat(a,"px"):"100%",document.body.insertBefore(t,document.body.firstChild)),t}({canvas:s,width:i,height:r,onError:o});return(t=function(e,t){var n=t.onError,i=null,r=function(e){return i=e.statusMessage||i};e.addEventListener("webglcontextcreationerror",r,!1);var o=t.webgl1,a=void 0===o||o,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),a&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c?(t.onContextLost&&e.addEventListener("webglcontextlost",t.onContextLost,!1),t.onContextRestored&&e.addEventListener("webglcontextrestored",t.onContextRestored,!1),c):n("Failed to create ".concat(u&&!a?"WebGL2":"WebGL"," context: ").concat(i||"Unknown error"))}(u,e))?(function(e){var t=Yw(e)?"WebGL2":"WebGL1",n=function(e){var t=e.getParameter(7936),n=e.getParameter(7937),i=e.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&e.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||t,renderer:i&&e.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}(e);Ww.info(1,"".concat(t).concat(e.debug?" debug":""," context ").concat(n?"(".concat(n.vendor,",").concat(n.renderer,")"):""))()}(t=jk(t,e)),t):null}function jk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||e._instrumented)return e;e._version=e._version||function(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext?2:1}(e),e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{};var n=t=Object.assign({},Nk,t),i=n.manageState,r=n.debug;return i&&Ek(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}},{key:"_checkSampling",value:function(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}]),e}(),Vk=function(){function e(t){var n=t.id,i=t.stats;m(this,e),this.id=n,this.stats={},this._initializeStats(i),Object.seal(this)}return b(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}},{key:"_initializeStats",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){return e._getOrCreate(t)})}},{key:"_getOrCreate",value:function(e){if(!e||!e.name)return null;var t=e.name,n=e.type;return this.stats[t]||(this.stats[t]=e instanceof Bk?e:new Bk(t,n)),this.stats[t]}}]),e}(),zk="8.5.7",Uk=new(function(){function e(){m(this,e),this.stats=new Map}return b(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new Vk({id:e})),this.stats.get(e)}}]),e}());if($w.CO.luma&&$w.CO.luma.VERSION!==zk)throw new Error("luma.gl - multiple VERSIONs detected: ".concat($w.CO.luma.VERSION," vs 8.5.7"));function Hk(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function Gk(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var i=e[t=t.replace(/^.*\./,"")];return Hk(void 0!==i,"Accessing undefined constant GL.".concat(t)),i}function Wk(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}$w.CO.luma||((0,$w.jU)()&&Ww.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),$w.CO.luma=$w.CO.luma||{VERSION:zk,version:zk,log:Ww,stats:Uk,globals:{modules:{},nodeIO:{}}});var qk={};function Xk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return qk[e]=qk[e]||1,"".concat(e,"-").concat(qk[e]++)}function Yk(e){return Hk("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function Kk(e){var t=!0;for(var n in e){t=!1;break}return t}function Qk(e,t,n,i){var r="See luma.gl ".concat(n," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),o=Object.getPrototypeOf(e);i.forEach(function(e){o.methodName||(o[e]=function(){throw Ww.removed("Calling removed method ".concat(t,".").concat(e,": "),r)(),new Error(e)})})}var $k="Resource subclass must define virtual methods",Zk=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),Kw(t);var i=n.id,r=n.userData,o=void 0===r?{}:r;this.gl=t,this.gl2=t,this.id=i||Xk(this.constructor.name),this.userData=o,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return b(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.deleteChildren,n=void 0!==t&&t,i=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,i&&n&&i.filter(Boolean).forEach(function(e){return e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Hk(e=Gk(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Yw(this.gl);if("webgl2"in n&&!i||"extension"in n&&!this.gl.getExtension(n.extension)){var r=n.webgl1,o="webgl2"in n?n.webgl2:n.webgl1;return i?o:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},o=Yw(this.gl),a={},s=n||Object.keys(r),u=_(s);try{for(u.s();!(e=u.n()).done;){var c=e.value,l=r[c];if(l&&(!("webgl2"in l)||o)&&(!("extension"in l)||this.gl.getExtension(l.extension))){var h=i?Wk(this.gl,c):c;a[h]=this.getParameter(c,t),i&&"GLenum"===l.type&&(a[h]=Wk(this.gl,a[h]))}}}catch(f){u.e(f)}finally{u.f()}return a}},{key:"setParameter",value:function(e,t){Hk(e=Gk(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Yw(this.gl);if("webgl2"in n&&!i||"extension"in n&&!this.gl.getExtension(n.extension))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Gk(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return Qk(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error($k)}},{key:"_deleteHandle",value:function(){throw new Error($k)}},{key:"_bindHandle",value:function(e){throw new Error($k)}},{key:"_getOptsFromHandle",value:function(){throw new Error($k)}},{key:"_getParameter",value:function(e,t){throw new Error($k)}},{key:"_setParameter",value:function(e,t){throw new Error($k)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=Uk.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;Uk.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=Uk.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=Uk.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),e}();function Jk(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function ex(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clamped,i=void 0===n||n;switch(e){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return i?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function tx(e){for(var t=e.data,n=e.width,i=e.height,r=Math.round(n/2),o=Math.round(i/2),a=new Uint8Array(r*o*4),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=nx("Accessor",e,rx)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}],[{key:"getBytesPerElement",value:function(e){return ex(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return Hk(e.size),ex(e.type||5126).BYTES_PER_ELEMENT*e.size}},{key:"resolve",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),(i=t.call(this,e,r)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),i.target=r.target||(i.gl.webgl2?36662:34962),i.initialize(r),Object.seal(c(i)),i}return b(n,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ox.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ox.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=nx("Buffer",e,sx),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=nx("Buffer",e,ux))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ox(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,o=t.srcOffset,a=void 0===o?0:o,s=e.byteLength||e.length;Hk(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==a||void 0!==s?(Qw(this.gl),this.gl.bufferSubData(this.target,r,n,a,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,o=void 0===r?0:r,a=e.size,s=this.gl;return Qw(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,o,a),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,o=e.dstOffset,a=void 0===o?0:o,s=e.length,u=void 0===s?0:s;Qw(this.gl);var c,l,h=ex(this.accessor.type||5126,{clamped:!1}),f=this._getAvailableElementCount(r),d=a;n?c=(l=n.length)-d:l=d+(c=Math.min(f,u||f));var p=Math.min(f,c);return Hk((u=u||p)<=p),n=n||new h(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,a,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,o=e.offset,a=void 0===o?0:o,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,a,s):(Hk(0===a),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.byteLength+t;Hk(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var i=this._getTarget();this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,this.usage),this.gl.bufferSubData(i,t,e),this.gl.bindBuffer(i,null),this.debugData=e.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n);var r=Jk(e);return Hk(r),this.setAccessor(new ox(this.accessor,{type:r})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Hk(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/ex(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new ox(this.accessor,{type:Jk(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"type",get:function(){return Ww.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return Ww.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return Ww.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return Ww.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ox(this.accessor,e),this}}]),n}(Zk),lx={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},hx={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},fx={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},dx=[9729,9728],px=$w.CO.WebGLBuffer||function(){},vx=function(e){a(i,e);var n=s(i);function i(e,t){var r;m(this,i);var o=t.id,a=void 0===o?Xk("texture"):o,s=t.handle,u=t.target;return(r=n.call(this,e,{id:a,handle:s})).target=u,r.textureUnit=void 0,r.loaded=!1,r.width=void 0,r.height=void 0,r.depth=void 0,r.format=void 0,r.type=void 0,r.dataFormat=void 0,r.border=void 0,r.textureUnit=void 0,r.mipmaps=void 0,r}return b(i,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.data;if(i instanceof Promise)return i.then(function(e){return t.initialize(Object.assign({},n,{pixels:e,data:e}))}),this;var r="undefined"!=typeof HTMLVideoElement&&i instanceof HTMLVideoElement;if(r&&i.readyState=HTMLVideoElement.HAVE_CURRENT_DATA?i.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var e=this._video,t=e.video,n=e.parameters;if(e.lastTime===t.currentTime||t.readyState0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(Ww.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Tk(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){var n,i;this._trackDeallocatedMemory("Texture");var r=e.target,o=void 0===r?this.target:r,a=e.pixels,s=void 0===a?null:a,u=e.level,c=void 0===u?0:u,l=e.format,h=void 0===l?this.format:l,f=e.border,d=void 0===f?this.border:f,p=e.offset,v=void 0===p?0:p,g=e.parameters,m=void 0===g?{}:g,y=e.data,b=void 0===y?null:y,w=e.type,k=void 0===w?this.type:w,x=e.width,S=void 0===x?this.width:x,E=e.height,C=void 0===E?this.height:E,O=e.dataFormat,T=void 0===O?this.dataFormat:O,A=e.compressed,P=void 0!==A&&A;b||(b=s),n=this._deduceParameters({format:h,type:k,dataFormat:T,compressed:P,data:b,width:S,height:C}),k=n.type,T=n.dataFormat,P=n.compressed,S=n.width,C=n.height;var M=this.gl;M.bindTexture(this.target,this.handle);var I,R;return i=this._getDataType({data:b,compressed:P}),b=i.data,R=i.dataType,Tk(this.gl,m,function(){switch(R){case"null":M.texImage2D(o,c,h,S,C,d,T,k,b);break;case"typed-array":M.texImage2D(o,c,h,S,C,d,T,k,b,v);break;case"buffer":(I=Qw(M)).bindBuffer(35052,b.handle||b),I.texImage2D(o,c,h,S,C,d,T,k,v),I.bindBuffer(35052,null);break;case"browser-object":Yw(M)?M.texImage2D(o,c,h,S,C,d,T,k,b):M.texImage2D(o,c,h,T,k,b);break;case"compressed":var e,n=_(b.entries());try{for(n.s();!(e=n.n()).done;){var i=t(e.value,2),r=i[0],a=i[1];M.compressedTexImage2D(o,r,a.format,a.width,a.height,d,a.data)}}catch(s){n.e(s)}finally{n.f()}break;default:Hk(!1,"Unknown image data type")}}),this._trackAllocatedMemory(b&&b.byteLength?b.byteLength:this.width*this.height*(hx[this.dataFormat]||4)*(fx[this.type]||1),"Texture"),this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t,n=this,i=e.target,r=void 0===i?this.target:i,o=e.pixels,a=void 0===o?null:o,s=e.data,u=void 0===s?null:s,c=e.x,l=void 0===c?0:c,h=e.y,f=void 0===h?0:h,d=e.width,p=void 0===d?this.width:d,v=e.height,g=void 0===v?this.height:v,m=e.level,y=void 0===m?0:m,b=e.format,_=void 0===b?this.format:b,w=e.type,k=void 0===w?this.type:w,x=e.dataFormat,S=void 0===x?this.dataFormat:x,E=e.compressed,C=void 0!==E&&E,O=e.offset,T=void 0===O?0:O,A=e.border,P=(void 0===A&&this.border,e.parameters),M=void 0===P?{}:P;if(t=this._deduceParameters({format:_,type:k,dataFormat:S,compressed:C,data:u,width:p,height:g}),k=t.type,S=t.dataFormat,C=t.compressed,p=t.width,g=t.height,Hk(0===this.depth,"texSubImage not supported for 3D textures"),u||(u=a),u&&u.data){var I=u;u=I.data,p=I.shape[0],g=I.shape[1]}u instanceof cx&&(u=u.handle),this.gl.bindTexture(this.target,this.handle),Tk(this.gl,M,function(){if(C)n.gl.compressedTexSubImage2D(r,y,l,f,p,g,_,u);else if(null===u)n.gl.texSubImage2D(r,y,l,f,p,g,S,k,null);else if(ArrayBuffer.isView(u))n.gl.texSubImage2D(r,y,l,f,p,g,S,k,u,T);else if(u instanceof px){var e=Qw(n.gl);e.bindBuffer(35052,u),e.texSubImage2D(r,y,l,f,p,g,S,k,T),e.bindBuffer(35052,null)}else Yw(n.gl)?Qw(n.gl).texSubImage2D(r,y,l,f,p,g,S,k,u):n.gl.texSubImage2D(r,y,l,f,S,k,u)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){return Ww.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof cx?{data:t.handle,dataType:"buffer"}:t instanceof px?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t,n=e.format,i=e.data,r=e.width,o=e.height,a=e.dataFormat,s=e.type,u=e.compressed,c=lx[n];return{dataFormat:a=a||c&&c.dataFormat,type:s=s||c&&c.types[0],compressed:u=u||c&&c.compressed,width:r=(t=this._deduceImageSize(i,r,o)).width,height:o=t.height,format:n,data:i}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return Hk(i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},"Could not deduced texture size"),Hk(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Hk(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Hk(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!(Yw(this.gl)||!this.width||!this.height||Yk(this.width)&&Yk(this.height))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===dx.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&function(e,t){var n=lx[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=Yw(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}(e,n))&&(!i||function(e,t){var n=lx[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}(e,n))),r}}]),i}(Zk);function gx(e,t){return Hk("string"==typeof e),e=""+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(r){i(r)}})}var mx=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),Kw(e),(r instanceof Promise||"string"==typeof r)&&(r={data:r}),"string"==typeof r.data&&(r=Object.assign({},r,{data:gx(r.data)})),(i=t.call(this,e,Object.assign({},r,{target:3553}))).initialize(r),Object.seal(c(i)),i}return b(n,null,[{key:"isSupported",value:function(e,t){return vx.isSupported(e,t)}}]),n}(vx),yx="EXT_color_buffer_float",bx={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:yx,bpp:2},33327:{gl2:yx,bpp:4},34842:{gl2:yx,bpp:8},33326:{gl2:yx,bpp:4},33328:{gl2:yx,bpp:8},34836:{gl2:yx,bpp:16},35898:{gl2:yx,bpp:4}},_x=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),(i=t.call(this,e,r)).initialize(r),Object.seal(c(i)),i}return b(n,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,o=void 0===r?1:r,a=e.samples,s=void 0===a?0:a;return Hk(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Yw(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,o):this.gl.renderbufferStorage(36161,t,i,o),this.format=t,this.width=i,this.height=o,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*bx[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},n=t.format;return!n||function(e,t,n){var i=n[t];if(!i)return!1;var r=Yw(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,n,bx)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),n}(Zk),wx="clear: bad arguments";function kx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.color,o=void 0===r?null:r,a=t.depth,s=void 0===a?null:a,u=t.stencil,c=void 0===u?null:u,l={};i&&(l.framebuffer=i);var h=0;o&&(h|=16384,!0!==o&&(l.clearColor=o)),s&&(h|=256,!0!==s&&(l.clearDepth=s)),c&&(h|=1024,!0!==s&&(l.clearStencil=s)),Hk(0!==h,wx),Tk(e,l,function(){e.clear(h)})}function xx(e,t,n,i,r,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(i,r)}function Sx(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function a(e){xx(o,i,r,a,s,"next",e)}function s(e){xx(o,i,r,a,s,"throw",e)}a(void 0)})}}var Ex=[34069,34070,34071,34072,34073,34074],Cx=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),Kw(e),(i=t.call(this,e,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(c(i)),i}return b(n,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,o=void 0===r?{}:r;return this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(o)}),this}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,o=e.y,a=void 0===o?0:o,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:a,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(e){var t=e.width,n=e.height,i=e.pixels,r=e.data,o=e.border,a=void 0===o?0:o,s=e.format,u=void 0===s?6408:s,c=e.type,l=void 0===c?5121:c,h=this;return Sx(regeneratorRuntime.mark(function e(){var o,s,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=h.gl,s=i||r,e.next=4,Promise.all(Ex.map(function(e){var t=s[e];return Promise.all(Array.isArray(t)?t:[t])}));case 4:c=e.sent,h.bind(),Ex.forEach(function(e,i){c[i].length>1&&!1!==h.opts.mipmaps&&Ww.warn("".concat(h.id," has mipmap and multiple LODs."))(),c[i].forEach(function(i,r){t&&n?o.texImage2D(e,r,u,t,n,a,u,l,i):o.texImage2D(e,r,u,u,l,i)})}),h.unbind();case 6:case"end":return e.stop()}},e)}))()}},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,o=e.pixels,a=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,h=e.type,f=void 0===h?5121:h,d=this.gl,p=o||a;return this.bind(),p instanceof Promise?p.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,f,p):d.texImage2D(n,0,l,l,f,p),this}}]),n}(vx);return e.FACES=Ex,e}(),Ox=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),Qw(e),(i=t.call(this,e,r=Object.assign({depth:1},r,{target:32879,unpackFlipY:!1}))).initialize(r),Object.seal(c(i)),i}return b(n,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,o=void 0===r?6408:r,a=e.width,s=e.height,u=e.depth,c=void 0===u?1:u,l=e.border,h=void 0===l?0:l,f=e.format,d=e.type,p=void 0===d?5121:d,v=e.offset,g=void 0===v?0:v,m=e.data,y=e.parameters,b=void 0===y?{}:y;return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Tk(this.gl,b,function(){ArrayBuffer.isView(m)&&t.gl.texImage3D(t.target,i,o,a,s,c,h,f,p,m),m instanceof cx&&(t.gl.bindBuffer(35052,m.handle),t.gl.texImage3D(t.target,i,o,a,s,c,h,f,p,g))}),this._trackAllocatedMemory(m&&m.byteLength?m.byteLength:this.width*this.height*this.depth*(hx[this.dataFormat]||4)*(fx[this.type]||1),"Texture"),this.loaded=!0,this}}],[{key:"isSupported",value:function(e){return Yw(e)}}]),n}(vx);function Tx(e,t){var n=e.gl,i=e.width,r=e.height,o=e.id;return new Ix(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:i,height:r,attachments:{36064:e}}))}function Ax(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,o=void 0===r?0:r,a=t.sourceFormat,s=void 0===a?6408:a,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,h=void 0===l?null:l,f=t.sourceWidth,d=t.sourceHeight,p=t.sourceType,v=function(e){return e instanceof Ix?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Tx(e),deleteFramebuffer:!0}}(e),g=v.framebuffer,m=v.deleteFramebuffer;Hk(g);var y=g.gl,b=g.handle,_=g.attachments;f=f||g.width,d=d||g.height,36064===c&&null===b&&(c=1028),Hk(_[c]),h=function(e,t,n,i,r){return e||new(ex(t=t||5121,{clamped:!1}))(i*r*function(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Hk(!1),0}}(n))}(h,p=p||_[c].type,s,f,d),p=p||Jk(h);var w=y.bindFramebuffer(36160,b);return y.readPixels(i,o,f,d,s,p,h),y.bindFramebuffer(36160,w||null),m&&g.delete(),h}function Px(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,o=void 0===r?Number.MAX_SAFE_INTEGER:r,a=Ax(e,{sourceAttachment:i}),s=e.width,u=e.height;u>o;){var c=tx({data:a,width:s,height:u});a=c.data,s=c.width,u=c.height}!function(e){var t=e.data,n=e.height,i=e.bytesPerPixel,r=e.temp,o=e.width*(void 0===i?4:i);r=r||new Uint8Array(o);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:{};return m(this,r),(t=i.call(this,e,n)).width=null,t.height=null,t.attachments={},t.readBuffer=36064,t.drawBuffers=[36064],t.ownResources=[],t.initialize(n),Object.seal(c(t)),t}return b(r,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=Qw(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=Qw(this.gl);return e.getParameter(e.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}},{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,o=e.attachments,a=void 0===o?null:o,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,h=e.stencil,f=void 0!==h&&h,d=e.check,p=void 0===d||d,v=e.readBuffer,g=e.drawBuffers;if(Hk(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,a)for(var m in a){var y=a[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else a=this._createDefaultAttachments(u,l,f,n,r);this.update({clearAttachments:!0,attachments:a,readBuffer:v,drawBuffers:g}),a&&p&&this.checkStatus()}},{key:"delete",value:function(){var t,n=_(this.ownResources);try{for(n.s();!(t=n.n()).done;){t.value.delete()}}catch(i){n.e(i)}finally{n.f()}return e(p(r.prototype),"delete",this).call(this),this}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,o=e.clearAttachments,a=void 0!==o&&o,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:a,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Hk(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&Ww.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.clearAttachments,o=void 0!==r&&r,a=i.resizeAttachments,s=void 0===a||a,u={};o&&Object.keys(this.attachments).forEach(function(e){u[e]=null}),Object.assign(u,e);var c=this.gl.bindFramebuffer(36160,this.handle);for(var l in u){Hk(void 0!==l,"Misspelled framebuffer binding point?");var h=Number(l),f=u[h],d=f;if(d)if(d instanceof _x)this._attachRenderbuffer({attachment:h,renderbuffer:d});else if(Array.isArray(f)){var p=t(f,3),v=p[0],g=p[1],m=void 0===g?0:g,y=p[2],b=void 0===y?0:y;d=v,this._attachTexture({attachment:h,texture:v,layer:m,level:b})}else this._attachTexture({attachment:h,texture:d,layer:0,level:0});else this._unattach(h);s&&d&&d.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!n.attachments[e]}).forEach(function(e){delete n.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.getStatus();if(36053!==e)throw new Error(function(e){return(r.STATUS||{})[e]||"Framebuffer error ".concat(e)}(e));return this}},{key:"getStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),n}},{key:"clear",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.color,r=n.depth,o=n.stencil,a=n.drawBuffers,s=void 0===a?[]:a,u=this.gl.bindFramebuffer(36160,this.handle);return(i||r||o)&&kx(this.gl,{color:i,depth:r,stencil:o}),s.forEach(function(n,i){!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.framebuffer,r=void 0===i?null:i,o=n.buffer,a=void 0===o?6144:o,s=n.drawBuffer,u=void 0===s?0:s,c=n.value,l=void 0===c?[0,0,0,0]:c;Qw(e),Tk(e,{framebuffer:r},function(){switch(a){case 6144:switch(l.constructor){case Int32Array:e.clearBufferiv(a,u,l);break;case Uint32Array:e.clearBufferuiv(a,u,l);break;case Float32Array:default:e.clearBufferfv(a,u,l)}break;case 6145:e.clearBufferfv(6145,0,[l]);break;case 6146:e.clearBufferiv(6146,0,[l]);break;case 34041:var n=t(l,2),i=n[0],r=n[1];e.clearBufferfi(34041,0,i,r);break;default:Hk(!1,wx)}})}(e.gl,{drawBuffer:i,value:n})}),this.gl.bindFramebuffer(36160,u||null),this}},{key:"readPixels",value:function(){return Ww.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){return Ww.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){return Ww.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){return Ww.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){return Ww.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){return Ww.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,o=e.y,a=void 0===o?0:o,s=e.width,u=e.height,c=Qw(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===a&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,a,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Wk(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],r={},o=_(i);try{for(o.s();!(e=o.n()).done;){var a=e.value;r[n?Wk(this.gl,a):a]=this.getAttachmentParameter(t,a,n)}}catch(s){o.e(s)}finally{o.f()}return r}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Object.keys(this.attachments),n={},i=0,r=t;i0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>Ww.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Px(this,{targetMaxHeight:100});return Ww.image({logLevel:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?36160:t;return this.gl.bindFramebuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?36160:t;return this.gl.bindFramebuffer(n,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,i,r){var o=null;return e&&((o=o||{})[36064]=new mx(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&n?((o=o||{})[33306]=new _x(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new _x(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}),this.ownResources.push(o[36096])):n&&Hk(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];!t||(t instanceof _x?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,o=e.level,a=this.gl;switch(a.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:Qw(a).framebufferTextureLayer(36160,n,i.target,o,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);a.framebufferTexture2D(36160,n,s,i.handle,o);break;case 3553:a.framebufferTexture2D(36160,n,3553,i.handle,o);break;default:Hk(!1,"Illegal texture type")}a.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=function(e){return Yw(e)?e:null}(this.gl);t?t.readBuffer(e):Hk(36064===e||1029===e,Mx),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,n=Qw(t);if(n)n.drawBuffers(e);else{var i=t.getExtension("WEBGL_draw_buffers");i?i.drawBuffersWEBGL(e):Hk(1===e.length&&(36064===e[0]||1029===e[0]),Mx)}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=function(e){for(var t in e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},Rx)void 0===e.luma.caps[t]&&(e.luma.caps[t]=Lx(e,t));return e.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat,r=!0;return n&&(r=Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("WEBGL_color_buffer_float")||e.getExtension("OES_texture_float"))),i&&(r=r&&Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("EXT_color_buffer_half_float"))),r}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new r(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),r}(Zk);Ix.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var Rx={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(e){var t=new mx(e,{format:6408,type:5126,dataFormat:6408}),n=new Ix(e,{id:"test-framebuffer",check:!1,attachments:{36064:t}}),i=n.getStatus();return t.delete(),n.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function Dx(e,t){return Nx(e,t)}function Nx(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return Lx(e,t)})}function Lx(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},void 0===e.luma.caps[t]&&(e.luma.caps[t]=function(e,t){var n,i=Rx[t];Hk(i,t);var r=Yw(e)&&i[1]||i[0];if("function"==typeof r)n=r(e);else if(Array.isArray(r)){n=!0;var o,a=_(r);try{for(a.s();!(o=a.n()).done;){var s=o.value;n=n&&Boolean(e.getExtension(s))}}catch(u){a.e(u)}finally{a.f()}}else"string"==typeof r?n=Boolean(e.getExtension(r)):"boolean"==typeof r?n=r:Hk(!1);return n}(e,t)),e.luma.caps[t]||Ww.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}var jx=function(){function e(t,n){m(this,e),this.opts=n,this.source=t}return b(e,[{key:"value",get:function(){return this.source.value}},{key:"getValue",value:function(){var e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];var n=this.source.value,i=t.size,r=n;if(n&&n.length!==i){r=new Float32Array(i);for(var o=t.elementOffset||0,a=0;ai&&(r=i);var o=this._pool,a=e.BYTES_PER_ELEMENT*r,s=o.findIndex(function(e){return e.byteLength>=a});if(s>=0){var u=new e(o.splice(s,1)[0],0,r);return n&&u.fill(0),u}return new e(r)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.props.poolSize&&t.shift()}}}]),e}());Math;var Bx=1/180*Math.PI,Vx={};function zx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,i=void 0===n?Vx.precision||4:n;return e=function(e){return Math.round(e/Vx.EPSILON)*Vx.EPSILON}(e),"".concat(parseFloat(e.toPrecision(i)))}function Ux(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hx(e,t,n){if(Ux(e)){n=n||function(e){return e.clone?e.clone():new Array(e.length)}(e);for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+zx(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t2&&void 0!==arguments[2]?arguments[2]:"";if(Vx.debug&&!function(e,t){if(e.length!==t)return!1;for(var n=0;n=0&&e=0&&e0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return m(this,n),e=t.call(this,-0,-0,-0),1===arguments.length&&Ux(i)?e.copy(i):(Vx.debug&&(Qx(i),Qx(r),Qx(o)),e[0]=i,e[1]=r,e[2]=o),e}return b(n,[{key:"set",value:function(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}},{key:"fromObject",value:function(e){return Vx.debug&&(Qx(e.x),Qx(e.y),Qx(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=Qx(e)}},{key:"angle",value:function(e){return function(e,t){var n=e[0],i=e[1],r=e[2],o=t[0],a=t[1],s=t[2],u=Math.sqrt(n*n+i*i+r*r)*Math.sqrt(o*o+a*a+s*s),c=u&&oS(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}(this,e)}},{key:"cross",value:function(e){return aS(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin;return function(e,t,n,i){var r=[],o=[];r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],o[0]=r[0],o[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),o[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2]}(this,this,void 0===n?lS:n,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin;return function(e,t,n,i){var r=[],o=[];r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],o[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),o[1]=r[1],o[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2]}(this,this,void 0===n?lS:n,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin;return function(e,t,n,i){var r=[],o=[];r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],o[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),o[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),o[2]=r[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2]}(this,this,void 0===n?lS:n,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return sS(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return uS(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return function(e,t,n){var i=t[0],r=t[1],o=t[2];e[0]=i*n[0]+r*n[3]+o*n[6],e[1]=i*n[1]+r*n[4]+o*n[7],e[2]=i*n[2]+r*n[5]+o*n[8]}(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,n){var i=t[0],r=t[1];e[0]=n[0]*i+n[2]*r,e[1]=n[1]*i+n[3]*r,e[2]=t[2]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return function(e,t,n){var i=n[0],r=n[1],o=n[2],a=t[0],s=t[1],u=t[2],c=r*u-o*s,l=o*a-i*u,h=i*s-r*a,f=r*h-o*l,d=o*c-i*h,p=i*l-r*c,v=2*n[3];l*=v,h*=v,d*=2,p*=2,e[0]=a+(c*=v)+(f*=2),e[1]=s+l+d,e[2]=u+h+p}(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return hS.ZERO=hS.ZERO||Object.freeze(new n(0,0,0,0))}}]),n}(eS),dS=new fS;function pS(e,t,n,i){dS.set(e,t,n);var r=dS.len();return{distance:i/r,normal:new fS(-e/r,-t/r,-n/r)}}function vS(e){return e-Math.fround(e)}function gS(e,t){var n=t.size,i=void 0===n?1:n,r=t.startIndex,o=void 0===r?0:r,a=t.endIndex;Number.isFinite(a)||(a=e.length);var s=(a-o)/i;cS=Fx.allocate(cS,s,{type:Float32Array,size:2*i});for(var u=o,c=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=_S,r={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?i=e:e.length>0&&(wS.length=e.length,i=wS):i=_S,(t>0||Number.isFinite(n))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(t,n),r.index=t-1),{iterable:i,objectInfo:r}}function xS(e){return e&&e[Symbol.asyncIterator]}function SS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};return Array.isArray(e)?ES(e,t,[]):t(e)?[e]:[]}function ES(e,t,n){for(var i=-1;++ic)n.set(t.subarray(0,c),r);else if(n.set(t,r),s)for(var l=u;l=d)){var v=p?i.value:i.getBuffer().getData({srcByteOffset:l});if(i.settings.normalized&&!p){var g=s;s=function(e,t){return i._normalizeConstant(g(e,t))}}var m=p?function(e,t){return s(v,t)}:function(e,t){return s(v.subarray(e,e+c),t)},y=t.getData({length:r}),b=new Float32Array(d);(function(e){var t=e.source,n=e.target,i=e.size,r=e.getData,o=e.sourceStartIndices,a=e.targetStartIndices;if(!Array.isArray(a))return AS({source:t,target:n,size:i,getData:r}),n;for(var s=0,u=0,c=r&&function(e,t){return r(e+u,t)},l=Math.min(o.length,a.length),h=1;h1&&void 0!==arguments[1]?arguments[1]:{};m(this,r),t=i.call(this,e,n);var o=n.transition,a=void 0!==o&&o,s=n.noAlloc,u=void 0!==s&&s,c=n.update,l=void 0===c?null:c,h=n.accessor,f=void 0===h?null:h,d=n.transform,p=void 0===d?null:d,v=n.startIndices,g=void 0===v?null:v;return Object.assign(t.settings,{transition:a,noAlloc:u,update:l||f&&t._autoUpdater,accessor:f,transform:p}),Object.assign(t.state,{lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:TS,startIndices:g}),Object.seal(t.settings),Object.seal(t.state),t._validateAttributeUpdaters(),t}return b(r,[{key:"startIndices",get:function(){return this.state.startIndices},set:function(e){this.state.startIndices=e}},{key:"needsUpdate",value:function(){return this.state.needsUpdate}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.clearChangedFlags,n=void 0!==t&&t,i=this.state.needsRedraw;return this.state.needsRedraw=i&&!n,i}},{key:"getUpdateTriggers",value:function(){var e=this.settings.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"supportsTransition",value:function(){return Boolean(this.settings.transition)}},{key:"getTransitionSetting",value:function(e){if(!e||!this.supportsTransition())return null;var t=this.settings.accessor,n=this.settings.transition;return MS(Array.isArray(t)?e[t.find(function(t){return e[t]})]:e[t],n)}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,o=void 0===r?1/0:r;this.state.updateRanges=function(e,t){if(e===TS||(t[0]<0&&(t[0]=0),t[0]>=t[1]))return e;for(var n=[],i=e.length,r=0,o=0;ot[1]?n.push(a):t=[Math.min(a[0],t[0]),Math.max(a[1],t[1])]}return n.splice(r,0,t),n}(this.state.updateRanges,[i,o])}else this.state.updateRanges=TS}},{key:"clearNeedsUpdate",value:function(){this.state.needsUpdate=!1,this.state.updateRanges=OS}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||e}},{key:"update",value:function(e){this.setData(e)}},{key:"allocate",value:function(t){var n=this.state,i=this.settings;return!i.noAlloc&&!!i.update&&(e(p(r.prototype),"allocate",this).call(this,{numInstances:t,copy:n.updateRanges!==TS}),!0)}},{key:"updateBuffer",value:function(n){var i=n.numInstances,o=n.data,a=n.props,s=n.context;if(!this.needsUpdate())return!1;var u=this.state.updateRanges,c=this.settings,l=c.update,h=c.noAlloc,f=!0;if(l){var d,v=_(u);try{for(v.s();!(d=v.n()).done;){var g=t(d.value,2),m=g[0],y=g[1];l.call(s,this,{data:o,startRow:m,endRow:y,props:a,numInstances:i})}}catch(O){v.e(O)}finally{v.f()}if(this.value)if(this.constant||this.buffer.byteLength1&&void 0!==arguments[1]?arguments[1]:null,n=this.state,i=this.settings;return e?!(i.noAlloc||(n.binaryValue===e?(this.clearNeedsUpdate(),0):(n.binaryValue=e,this.setNeedsRedraw(),ArrayBuffer.isView(e)&&(e={value:e}),i.transform||t!==this.startIndices?(bS(ArrayBuffer.isView(e.value),"invalid ".concat(i.accessor)),n.binaryAccessor=function(e,t){var n=t.size,i=t.stride,r=t.offset,o=t.startIndices,a=t.nested,s=e.BYTES_PER_ELEMENT,u=i?i/s:n,c=r?r/s:0,l=Math.floor((e.length-c)/u);return function(t,i){var r=i.index,s=i.target;if(!o){for(var h=r*u+c,f=0;fl?c.set(x,g):(e._normalizeValue(x,b.target,0),CS({target:c,source:b.target,start:g,count:S}));g+=S*l}else e._normalizeValue(x,c,g),g+=l}}catch(A){w.e(A)}finally{w.f()}}}},{key:"_validateAttributeUpdaters",value:function(){var e=this.settings;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}},{key:"_checkAttributeArray",value:function(){var e=this.value,t=Math.min(4,this.size);if(e&&e.length>=t){var n=!0;switch(t){case 4:n=n&&Number.isFinite(e[3]);case 3:n=n&&Number.isFinite(e[2]);case 2:n=n&&Number.isFinite(e[1]);case 1:n=n&&Number.isFinite(e[0]);break;default:n=!1}if(!n)throw new Error("Illegal attribute generated for ".concat(this.id))}}}]),r}(function(){function e(t,n){m(this,e),this.gl=t,this.id=n.id,this.size=n.size;var i=n.logicalType||n.type,r=5130===i,o=n.defaultValue;o=Number.isFinite(o)?[o]:o||new Array(this.size).fill(0),n.defaultValue=o;var a=i;r?a=5126:!a&&n.isIndexed?a=t&&Dx(t,"ELEMENT_INDEX_UINT32")?5125:5123:a||(a=5126),n.logicalType=i,n.type=a;var s=function(e){switch(e){case 5126:return Float32Array;case 5130:return Float64Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return Uint8ClampedArray;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Unknown GL type")}}(i||a||5126);this.shaderAttributes={},this.doublePrecision=r,r&&!1===n.fp64&&(s=Float32Array),n.bytesPerElement=s.BYTES_PER_ELEMENT,this.defaultType=s,this.value=null,this.settings=n,this.state={externalBuffer:null,bufferAccessor:n,allocatedValue:null,constant:!1},this._buffer=null,this.setData(n)}return b(e,[{key:"buffer",get:function(){if(!this._buffer){var e=this.settings,t=e.isIndexed,n=e.type;this._buffer=new cx(this.gl,{id:this.id,target:t?34963:34962,accessor:{type:n}})}return this._buffer}},{key:"byteOffset",get:function(){var e=this.getAccessor();return e.vertexOffset?e.vertexOffset*mS(e):0}},{key:"delete",value:function(){this._buffer&&(this._buffer.delete(),this._buffer=null),Fx.release(this.state.allocatedValue)}},{key:"getShaderAttributes",value:function(e,t){if(this.doublePrecision){var n={},i=this.value instanceof Float64Array,r=function(e,t){var n=yS(e,t);return{high:n,low:I(M({},n),{offset:n.offset+4*e.size})}}(this.getAccessor(),t||{});return n[e]=new jx(this,r.high),n["".concat(e,"64Low")]=i?new jx(this,r.low):new Float32Array(this.size),n}if(t){var a=yS(this.getAccessor(),t);return o({},e,new jx(this,a))}return o({},e,this)}},{key:"getBuffer",value:function(){return this.state.constant?null:this.state.externalBuffer||this._buffer}},{key:"getValue",value:function(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}},{key:"getAccessor",value:function(){return this.state.bufferAccessor}},{key:"setData",value:function(e){var t=this.state;ArrayBuffer.isView(e)?e={value:e}:e instanceof cx&&(e={buffer:e});var n=M(M({},this.settings),e);if(t.bufferAccessor=n,e.constant){var i=e.value;if(i=this._normalizeValue(i,[],0),this.settings.normalized&&(i=this._normalizeConstant(i)),t.constant&&this._areValuesEqual(i,this.value))return!1;t.externalBuffer=null,t.constant=!0,this.value=i}else if(e.buffer){var r=e.buffer;t.externalBuffer=r,t.constant=!1,this.value=e.value;var o=e.value instanceof Float64Array;n.type=e.type||r.accessor.type,n.bytesPerElement=r.accessor.BYTES_PER_ELEMENT*(o?2:1),n.stride=mS(n)}else if(e.value){this._checkExternalBuffer(e);var a=e.value;t.externalBuffer=null,t.constant=!1,this.value=a,n.bytesPerElement=a.BYTES_PER_ELEMENT,n.stride=mS(n);var s=this.buffer,u=this.byteOffset;this.doublePrecision&&a instanceof Float64Array&&(a=gS(a,n));var c=a.byteLength+u+2*n.stride;s.byteLength0&&void 0!==arguments[0]?arguments[0]:{},t=this.value,n=e.startOffset,i=void 0===n?0:n,r=e.endOffset;this.buffer.subData({data:this.doublePrecision&&t instanceof Float64Array?gS(t,{size:this.size,startIndex:i,endIndex:r}):t.subarray(i,r),offset:i*t.BYTES_PER_ELEMENT+this.byteOffset})}},{key:"allocate",value:function(e){var t=e.numInstances,n=e.copy,i=void 0!==n&&n,r=this.state,o=r.allocatedValue,a=Fx.allocate(o,t+1,{size:this.size,type:this.defaultType,copy:i});this.value=a;var s=this.buffer,u=this.byteOffset;return s.byteLength=0;)t[n+a]=Number.isFinite(e[a])?e[a]:r[a]}return t}},{key:"_areValuesEqual",value:function(e,t){if(!e||!t)return!1;for(var n=this.size,i=0;i0&&FS[e]&&(t=FS[e]).call.apply(t,arguments)}function VS(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}var zS="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",US="#version 300 es\n".concat(zS);function HS(e,n){n=Array.isArray(n)?n:[n];var i=t(e.replace(/^\s+/,"").split(/\s+/),3),r=i[0],o=i[1],a=i[2];return n.includes(r)&&o&&a?{qualifier:r,type:o,name:a.split(";")[0]}:null}function GS(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,o=e.output;if(!i)return 300===n?US:n>300?"#version ".concat(n,"\n").concat(zS):"void main() {gl_FragColor = vec4(0);}";var a=function(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return VS(!1),null}}(i,r);return n>=300?"#version ".concat(n," ").concat(300===n?"es":"","\nin ").concat(r," ").concat(i,";\nout vec4 ").concat(o,";\nvoid main() {\n ").concat(o," = ").concat(a,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(a,";\n}")}var WS=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),Qw(e),(i=t.call(this,e,r)).initialize(r),i.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(c(i)),i}return b(n,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Kk(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),o=r.buffer,a=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=o,Ww.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,o,s,a),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof cx?i=e:(i=e.buffer,n=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==n)&&(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}],[{key:"isSupported",value:function(e){return Yw(e)}}]),n}(Zk),qS=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(n),Object.seal(this)}return b(e,[{key:"setupResources",value:function(e){var t,n=_(this.bindings);try{for(n.s();!(t=n.n()).done;){var i=t.value;this._setupTransformFeedback(i,e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"updateModelProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.varyings;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}},{key:"getDrawOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.bindings[this.currentIndex],n=t.sourceBuffers,i=t.transformFeedback;return{attributes:Object.assign({},n,e.attributes),transformFeedback:i}}},{key:"swap",value:function(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(e)}},{key:"getBuffer",value:function(e){var t=this.bindings[this.currentIndex].feedbackBuffers,n=e?t[e]:null;return n?n instanceof cx?n:n.buffer:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=this.getBuffer(t);return n?n.getData():null}},{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete()}},{key:"_initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Hk(Yw(this.gl))}},{key:"_getFeedbackBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?{}:t,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(var r in this.feedbackMap){var o=this.feedbackMap[r];r in n&&(i[o]=r)}for(var a in Object.assign(i,e.feedbackBuffers),i){var s=i[a];if("string"==typeof s){var u=n[s],c=u.byteLength,l=u.usage,h=u.accessor;i[a]=this._createNewBuffer(a,{byteLength:c,usage:l,accessor:h})}}return i}},{key:"_setupBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.sourceBuffers,n=void 0===t?null:t;Object.assign(this.feedbackMap,e.feedbackMap);var i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:n,feedbackBuffers:i})}},{key:"_setupTransformFeedback",value:function(e,t){var n=t.model.program;e.transformFeedback=new WS(this.gl,{program:n,buffers:e.feedbackBuffers})}},{key:"_updateBindings",value:function(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){var t=this._swapBuffers(this.bindings[this.currentIndex]),n=t.sourceBuffers,i=t.feedbackBuffers,r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:n,feedbackBuffers:i})}}},{key:"_updateBinding",value:function(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}},{key:"_swapBuffers",value:function(e){if(!this.feedbackMap)return null;var t=Object.assign({},e.sourceBuffers),n=Object.assign({},e.feedbackBuffers);for(var i in this.feedbackMap){var r=this.feedbackMap[i];t[i]=e.feedbackBuffers[r],n[r]=e.sourceBuffers[i],Hk(n[r]instanceof cx)}return{sourceBuffers:t,feedbackBuffers:n}}},{key:"_createNewBuffer",value:function(e,t){var n=new cx(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=n,n}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}}]),e}();function XS(e){var t=100,n=e.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}var YS="vs",KS=(o(d={},YS,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),o(d,"fs","#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),d),QS="__LUMA_INJECT_DECLARATIONS__",$S=/void\s+main\s*\([^)]*\)\s*\{\n?/,ZS=/}\n?[^{}]*$/,JS=[];function eE(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t===YS,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),JS.length=i.length;for(var o=0,a=i.length;o1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}var nE={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},iE="transform_uSize_",rE="transform_position",oE={10241:9728,10240:9728,10242:33071,10243:33071},aE=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(n),Object.seal(this)}return b(e,[{key:"updateModelProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e);return Object.assign({},e,t)}},{key:"getDrawOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.bindings[this.currentIndex],n=t.sourceBuffers,i=t.sourceTextures,r=t.framebuffer,o=t.targetTexture,a=Object.assign({},n,e.attributes),s=Object.assign({},e.uniforms),u=Object.assign({},e.parameters),c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){for(var l in a.transform_elementID=this.elementIDBuffer,this.samplerTextureMap)s[l]=i[this.samplerTextureMap[l]];this._setSourceTextureParameters();var h=function(e){var t,n,i,r=e.sourceTextureMap,o=e.targetTextureVarying,a=e.targetTexture,s={};for(var u in o&&(n=(t=a).width,i=t.height,s["".concat(iE).concat(o)]=[n,i]),r){var c;n=(c=r[u]).width,i=c.height,s["".concat(iE).concat(u)]=[n,i]}return s}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:o});Object.assign(s,h)}return this.hasTargetTexture&&(c=!1,u.viewport=[0,0,r.width,r.height]),{attributes:a,framebuffer:r,uniforms:s,discard:c,parameters:u}}},{key:"swap",value:function(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupTextures(e)}},{key:"getTargetTexture",value:function(){return this.bindings[this.currentIndex].targetTexture}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.packed,n=void 0!==t&&t,i=this.bindings[this.currentIndex].framebuffer,r=Ax(i);if(!n)return r;for(var o=r.constructor,a=function(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return VS(!1),null}}(this.targetTextureType),s=new o(r.length*a/4),u=0,c=0;c0&&void 0!==arguments[0]?arguments[0]:{},t=e._targetTextureVarying,n=e._swapTexture;this._swapTexture=n,this.targetTextureVarying=t,this.hasTargetTexture=t,this._setupTextures(e)}},{key:"_createTargetTexture",value:function(e){var t=e.sourceTextures,n=e.textureOrReference;if(n instanceof mx)return n;var i=t[n];return i?(this._targetRefTexName=n,this._createNewTexture(i)):null}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.sourceBuffers,n=e._sourceTextures,i=void 0===n?{}:n,r=e._targetTexture,o=this._createTargetTexture({sourceTextures:i,textureOrReference:r});this.hasSourceTextures=this.hasSourceTextures||i&&Object.keys(i).length>0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:o}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}},{key:"_updateElementIDBuffer",value:function(e){if(!("number"!=typeof e||this.elementCount>=e)){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new cx(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}}},{key:"_updateBindings",value:function(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){var t=this._swapTextures(this.bindings[this.currentIndex]),n=t.sourceTextures,i=t.targetTexture,r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:n,targetTexture:i})}}},{key:"_updateBinding",value:function(e,t){var n=t.sourceBuffers,i=t.sourceTextures,r=t.targetTexture;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,i),Object.assign(e.sourceBuffers,n),r){e.targetTexture=r;var o=r.width,a=r.height,s=e.framebuffer;s?(s.update({attachments:{36064:r},resizeAttachments:!1}),s.resize({width:o,height:a})):e.framebuffer=new Ix(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:r}})}return e}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex,t=this.bindings[e].sourceTextures;for(var n in t)t[n].setParameters(oE)}},{key:"_swapTextures",value:function(e){if(!this._swapTexture)return null;var t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}},{key:"_createNewTexture",value:function(e){var t=function(e,t){Hk(e instanceof mx||e instanceof Cx||e instanceof Ox);var n=e.constructor,i=e.gl,r=e.width,o=e.height,a=e.format,s=e.type,u=e.dataFormat,c=e.border,l=e.mipmaps;return new n(i,Object.assign({width:r,height:o,format:a,type:s,dataFormat:u,border:c,mipmaps:l},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}},{key:"_processVertexShader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.bindings[this.currentIndex],n=t.sourceTextures,i=t.targetTexture,r=function(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,o=Object.keys(n).length,a=null,s={},u=t,c={};if(o>0||i){var l=u.split("\n"),h=l.slice();if(l.forEach(function(e,t,r){if(o>0){var u=function(e,t){var n={},i=function(e){return HS(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,o=i.name;if(o&&t[o]){var a="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="transform_uSampler_".concat(e),n="".concat(iE).concat(e);return{samplerName:t,sizeName:n,uniformDeclerations:" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";")}}(o),u=s.samplerName,c=s.sizeName,l=s.uniformDeclerations,h=" ".concat(r," ").concat(o," = transform_getInput(").concat(u,", ").concat(c,").").concat(function(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return VS(!1),null}}(r),";\n");return n[u]=o,{updatedLine:a,inject:{"vs:#decl":l,"vs:#main-start":h},samplerTextureMap:n}}return null}(e,n);if(u){var l=u.updatedLine,f=u.inject;h[t]=l,c=tE([c,f]),Object.assign(s,u.samplerTextureMap),o--}}i&&!a&&(a=function(e,t){var n=HS(e,["varying","out"]);return n&&n.name===t?n.type:null}(e,i))}),i){Hk(r);var f="".concat(iE).concat(i);c=tE([c,{"vs:#decl":"uniform vec2 ".concat(f,";\n"),"vs:#main-start":" vec2 ".concat(rE," = transform_getPos(").concat(f,");\n gl_Position = vec4(").concat(rE,", 0, 1.);\n")}])}u=h.join("\n")}return{vs:u,targetTextureType:a,inject:c,samplerTextureMap:s}}({vs:e.vs,sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),o=r.vs,a=r.uniforms,s=r.targetTextureType,u=r.inject,c=r.samplerTextureMap,l=tE([e.inject||{},u]);return this.targetTextureType=s,this.samplerTextureMap=c,{vs:o,fs:e._fs||GS({version:XS(o),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[nE].concat(e.modules||[]):e.modules,uniforms:a,inject:l}}}]),e}(),sE={number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},array:{validate:function(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function uE(e){var t=cE(e);return"object"===t?e?"type"in e?Object.assign({},e,sE[e.type]):"value"in e?(t=cE(e.value),Object.assign({type:t},e,sE[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},sE[t])}function cE(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}var lE=function(){function e(t){var n=t.name,i=t.vs,r=t.fs,o=t.dependencies,a=void 0===o?[]:o,s=t.uniforms,u=t.getUniforms,c=t.deprecations,l=void 0===c?[]:c,h=t.defines,f=void 0===h?{}:h,d=t.inject,p=void 0===d?{}:d,v=t.vertexShader,g=t.fragmentShader;m(this,e),VS("string"==typeof n),this.name=n,this.vs=i||v,this.fs=r||g,this.getModuleUniforms=u,this.dependencies=a,this.deprecations=this._parseDeprecationDefinitions(l),this.defines=f,this.injections=function(e){var t={vs:{},fs:{}};for(var n in e){var i=e[n];"string"==typeof i&&(i={order:0,injection:i}),t[n.slice(0,2)][n]=i}return t}(p),s&&(this.uniforms=function(e){var t={};for(var n in e){var i=uE(e[n]);t[n]=i}return t}(s))}return b(e,[{key:"getModuleSource",value:function(e){var t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:VS(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(t,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,t){this.deprecations.forEach(function(n){n.regex.test(e)&&(n.deprecated?t.deprecated(n.old,n.new)():t.removed(n.old,n.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=this.uniforms;for(var i in n){var r=n[i];i in e&&!r.private?(r.validate&&VS(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function hE(e){return function(e){var t={},n={};return fE({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}(dE(e))}function fE(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var o,a=_(t);try{for(a.s();!(o=a.n()).done;){var s=o.value;i[s.name]=s,(void 0===r[s.name]||r[s.name]2&&void 0!==arguments[2]?arguments[2]:{},i=pE[t];if(VS(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in mE)return mE[t];var r="#extension GL_".concat(i[0]," : ").concat(n.behavior||"enable","\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,r),e.compileShader(o);var a=e.getShaderParameter(o,35713);return e.deleteShader(o),mE[t]=a,a}function bE(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return function(e,t){var n=pE[t];VS(n,t);var i=function(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return VS(!1===r||!0===r),r}(e,t)})}function _E(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}var wE=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],kE=[].concat(wE,[[_E("attribute"),"in $1"],[_E("varying"),"out $1"]]),xE=[].concat(wE,[[_E("varying"),"in $1"]]),SE=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],EE=[].concat(SE,[[_E("in"),"attribute $1"],[_E("out"),"varying $1"]]),CE=[].concat(SE,[[_E("in"),"varying $1"]]),OE="gl_FragColor",TE=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,AE=/void\s+main\s*\([^)]*\)\s*\{\n?/;function PE(e,n){var i,r=_(n);try{for(r.s();!(i=r.n()).done;){var o=t(i.value,2),a=o[0],s=o[1];e=e.replace(a,s)}}catch(u){r.e(u)}finally{r.f()}return e}var ME="\n\n".concat(QS,"\n\n"),IE=(o(g={},YS,"vertex"),o(g,"fs","fragment"),g);function RE(e,n){var i=n.id,r=n.source,o=n.type,a=n.modules,s=n.defines,u=void 0===s?{}:s,c=n.hookFunctions,l=void 0===c?[]:c,h=n.inject,f=void 0===h?{}:h,d=n.transpileToGLSL100,p=void 0!==d&&d,v=n.prologue,g=void 0===v||v,m=n.log;VS("string"==typeof r,"shader source must be a string");var y=o===YS,b=r.split("\n"),w=100,k="",x=r;0===b[0].indexOf("#version ")?(w=300,k=b[0],x=b.slice(1).join("\n")):k="#version ".concat(w);var S={};a.forEach(function(e){Object.assign(S,e.getDefines())}),Object.assign(S,u);var E,C=g?"".concat(k,"\n").concat(function(e){var t=e.id,n=e.type;return t&&"string"==typeof t&&-1===e.source.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(IE[n],"\n\n"):""}({id:i,source:r,type:o}),"\n").concat((E={type:o},"\n#define SHADER_TYPE_".concat(IE[E.type].toUpperCase(),"\n")),"\n").concat(function(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||7936),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:gE(n,i),vendor:n,renderer:i,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return bE(e,vE.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),bE(e,vE.GLSL_DERIVATIVES)&&yE(e,vE.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),bE(e,vE.GLSL_FRAG_DATA)&&yE(e,vE.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),bE(e,vE.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}return 0===t&&(n+="\n"),n}(S),"\n").concat(y?"":"precision highp float;\n\n","\n"):"".concat(k,"\n"),O=function(e){var n={vs:{},fs:{}};return e.forEach(function(e){var i;"string"!=typeof e?e=(i=e).hook:i={};var r=t((e=e.trim()).split(":"),2),o=r[0],a=r[1],s=e.replace(/\(.+/,"");n[o][s]=Object.assign(i,{signature:a})}),n}(l),T={},A={},P={};for(var M in f){var I="string"==typeof f[M]?{injection:f[M],order:0}:f[M],R=M.match(/^(v|f)s:(#)?([\w-]+)$/);if(R){var D=R[3];R[2]?"decl"===D?A[M]=[I]:P[M]=[I]:T[M]=[I]}else P[M]=[I]}var N,L=_(a);try{for(L.s();!(N=L.n()).done;){var j=N.value;m&&j.checkDeprecations(x,m),C+=j.getModuleSource(o,w);var F=j.injections[o];for(var B in F){var V=B.match(/^(v|f)s:#([\w-]+)$/);if(V){var z="decl"===V[2]?A:P;z[B]=z[B]||[],z[B].push(F[B])}else T[B]=T[B]||[],T[B].push(F[B])}}}catch(U){L.e(U)}finally{L.f()}return C=eE(C+=ME,o,A),C+=function(e,t){var n="";for(var i in e){var r=e[i];if(n+="void ".concat(r.signature," {\n"),r.header&&(n+=" ".concat(r.header)),t[i]){var o=t[i];o.sort(function(e,t){return e.order-t.order});var a,s=_(o);try{for(s.s();!(a=s.n()).done;){var u=a.value;n+=" ".concat(u.injection,"\n")}}catch(U){s.e(U)}finally{s.f()}}r.footer&&(n+=" ".concat(r.footer)),n+="}\n"}return n}(O[o],T),C=function(e,t,n){switch(t){case 300:return n?PE(e,kE):function(e){var t=(e=PE(e,xE)).match(TE);if(t){var n=t[1];e=e.replace(new RegExp("\\b".concat(OE,"\\b"),"g"),n)}else{var i="fragmentColor";e=e.replace(AE,function(e){return"out vec4 ".concat(i,";\n").concat(e)}).replace(new RegExp("\\b".concat(OE,"\\b"),"g"),i)}return e}(e);case 100:return n?PE(e,EE):function(e){var t=(e=PE(e,CE)).match(TE);if(t){var n=t[1];e=e.replace(TE,"").replace(new RegExp("\\b".concat(n,"\\b"),"g"),OE)}return e}(e);default:throw new Error("unknown GLSL version ".concat(t))}}(C=eE(C+=x,o,P),p?100:w,y)}function DE(e){return function(t){var n,i={},r=_(e);try{for(r.s();!(n=r.n()).done;){var o=n.value.getUniforms(t,i);Object.assign(i,o)}}catch(a){r.e(a)}finally{r.f()}return i}}var NE=(o(y={5126:KE.bind(null,"uniform1fv",zE,1,QE),35664:KE.bind(null,"uniform2fv",zE,2,QE),35665:KE.bind(null,"uniform3fv",zE,3,QE),35666:KE.bind(null,"uniform4fv",zE,4,QE),5124:KE.bind(null,"uniform1iv",UE,1,QE),35667:KE.bind(null,"uniform2iv",UE,2,QE),35668:KE.bind(null,"uniform3iv",UE,3,QE),35669:KE.bind(null,"uniform4iv",UE,4,QE),35670:KE.bind(null,"uniform1iv",UE,1,QE),35671:KE.bind(null,"uniform2iv",UE,2,QE),35672:KE.bind(null,"uniform3iv",UE,3,QE),35673:KE.bind(null,"uniform4iv",UE,4,QE),35674:KE.bind(null,"uniformMatrix2fv",zE,4,$E),35675:KE.bind(null,"uniformMatrix3fv",zE,9,$E),35676:KE.bind(null,"uniformMatrix4fv",zE,16,$E),35678:YE,35680:YE,5125:KE.bind(null,"uniform1uiv",HE,1,QE),36294:KE.bind(null,"uniform2uiv",HE,2,QE),36295:KE.bind(null,"uniform3uiv",HE,3,QE),36296:KE.bind(null,"uniform4uiv",HE,4,QE),35685:KE.bind(null,"uniformMatrix2x3fv",zE,6,$E),35686:KE.bind(null,"uniformMatrix2x4fv",zE,8,$E),35687:KE.bind(null,"uniformMatrix3x2fv",zE,6,$E),35688:KE.bind(null,"uniformMatrix3x4fv",zE,12,$E),35689:KE.bind(null,"uniformMatrix4x2fv",zE,8,$E),35690:KE.bind(null,"uniformMatrix4x3fv",zE,12,$E)},"35678",YE),o(y,"35680",YE),o(y,35679,YE),o(y,35682,YE),o(y,36289,YE),o(y,36292,YE),o(y,36293,YE),o(y,36298,YE),o(y,36299,YE),o(y,36300,YE),o(y,36303,YE),o(y,36306,YE),o(y,36307,YE),o(y,36308,YE),o(y,36311,YE),y),LE={},jE={},FE={},BE=[0];function VE(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(BE[0]=e,e=BE);var r=e.length;if(r%t&&Ww.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var o=i[r];o||(o=new n(r),i[r]=o);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}function JE(e,t){for(var n="",i=0;i0&&void 0!==arguments[0]?arguments[0]:this.source;if(e.startsWith("#version ")||(e="#version 100\n".concat(e)),this.source=e,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){var t=this.gl.getShaderInfoLog(this.handle),n=function(e,t,n,i){for(var r=e.split(/\r?\n/),o={},a={},s=i||ZE(t)||"(unnamed)",u="".concat(function(e){switch(e){case 35632:return"fragment";case 35633:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var o=String(i+t);return eC(o,r-o.length)+n+e})}(t);return{shaderName:u,errors:JE(o,p),warnings:JE(a,p)}}(t,this.source,this.shaderType,this.id),i=n.shaderName,r=n.errors,o=n.warnings;throw Ww.error("GLSL compilation errors in ".concat(i,"\n").concat(r))(),Ww.warn("GLSL compilation warnings in ".concat(i,"\n").concat(o))(),new Error("GLSL compilation errors in ".concat(i))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}],[{key:"getTypeName",value:function(e){switch(e){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Hk(!1),"unknown"}}}]),n}(Zk),nC=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),"string"==typeof i&&(i={source:i}),t.call(this,e,Object.assign({},i,{shaderType:35633}))}return b(n,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),n}(tC),iC=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),"string"==typeof i&&(i={source:i}),t.call(this,e,Object.assign({},i,{shaderType:35632}))}return b(n,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),n}(tC),rC=5126,oC=5124,aC=5125,sC=(o(w={},rC,[rC,1,"float"]),o(w,35664,[rC,2,"vec2"]),o(w,35665,[rC,3,"vec3"]),o(w,35666,[rC,4,"vec4"]),o(w,oC,[oC,1,"int"]),o(w,35667,[oC,2,"ivec2"]),o(w,35668,[oC,3,"ivec3"]),o(w,35669,[oC,4,"ivec4"]),o(w,aC,[aC,1,"uint"]),o(w,36294,[aC,2,"uvec2"]),o(w,36295,[aC,3,"uvec3"]),o(w,36296,[aC,4,"uvec4"]),o(w,35670,[rC,1,"bool"]),o(w,35671,[rC,2,"bvec2"]),o(w,35672,[rC,3,"bvec3"]),o(w,35673,[rC,4,"bvec4"]),o(w,35674,[rC,8,"mat2"]),o(w,35685,[rC,8,"mat2x3"]),o(w,35686,[rC,8,"mat2x4"]),o(w,35675,[rC,12,"mat3"]),o(w,35687,[rC,12,"mat3x2"]),o(w,35688,[rC,12,"mat3x4"]),o(w,35676,[rC,16,"mat4"]),o(w,35689,[rC,16,"mat4x2"]),o(w,35690,[rC,16,"mat4x3"]),w);function uC(e){var n=sC[e];if(!n)return null;var i=t(n,2);return{type:i[0],components:i[1]}}function cC(e,n){switch(e){case 5120:case 5121:case 5122:case 5123:e=rC}for(var i in sC){var r=t(sC[i],3),o=r[0],a=r[1],s=r[2];if(o===e&&a===n)return{glType:i,name:s}}return null}var lC=function(){function e(t){m(this,e),this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}return b(e,[{key:"getAttributeInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var t=this.getAttributeInfo(e);return t?t.location:-1}},{key:"getAttributeAccessor",value:function(e){var t=this.getAttributeInfo(e);return t?t.accessor:null}},{key:"getVaryingInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var t=this.getVaryingInfo();return t?t.location:-1}},{key:"getVaryingAccessor",value:function(e){var t=this.getVaryingInfo();return t?t.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var t=e.gl,n=t.getProgramParameter(e.handle,35721),i=0;i=0&&this._addAttribute(u,o,a,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(Yw(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,e,r)).stubRemovedMethods("Program","v6.0",hC),t._isCached=!1,t.initialize(r),Object.seal(c(t)),t._setId(r.id),t}return b(i,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hash,n=e.vs,i=e.fs,r=e.varyings,o=e.bufferMode,a=void 0===o?35981:o;return this.hash=t||"",this.vs="string"==typeof n?new nC(this.gl,{id:"".concat(e.id,"-vs"),source:n}):n,this.fs="string"==typeof i?new iC(this.gl,{id:"".concat(e.id,"-fs"),source:i}):i,Hk(this.vs instanceof nC),Hk(this.fs instanceof iC),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(Qw(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new lC(this),this.setProps(e)}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:e(p(i.prototype),"delete",this).call(this,t)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,o=e.vertexCount,a=e.offset,s=void 0===a?0:a,u=e.start,c=e.end,l=e.isIndexed,h=void 0!==l&&l,f=e.indexType,d=void 0===f?5123:f,p=e.instanceCount,v=void 0===p?0:p,g=e.isInstanced,m=void 0===g?v>0:g,y=e.vertexArray,b=void 0===y?null:y,_=e.transformFeedback,w=e.framebuffer,k=e.parameters,x=void 0===k?{}:k,S=e.uniforms,E=e.samplers;if((S||E)&&(Ww.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(S||{})),Ww.priority>=n){var C=w?w.id:"default",O="mode=".concat(Wk(this.gl,r)," verts=").concat(o," instances=").concat(v," indexType=").concat(Wk(this.gl,d)," isInstanced=").concat(m," isIndexed=").concat(h," Framebuffer=").concat(C);Ww.log(n,O)()}return Hk(b),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===o||m&&0===v||(b.bindForDraw(o,v,function(){if(void 0!==w&&(x=Object.assign({},x,{framebuffer:w})),_){var e=function(e){switch(e){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Hk(!1),0}}(r);_.begin(e)}t._bindTextures(),Tk(t.gl,x,function(){h&&m?t.gl2.drawElementsInstanced(r,o,d,s,v):h&&Yw(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl2.drawRangeElements(r,u,c,o,d,s):h?t.gl.drawElements(r,o,d,s):m?t.gl2.drawArraysInstanced(r,s,o,v):t.gl.drawArrays(r,s,o)}),_&&_.end()}),0))}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in Ww.priority>=2&&function(e,t,n){for(var i in e){var r=e[i];if((!n||Boolean(n[i]))&&!qE(r))throw t=t?"".concat(t," "):"",console.error("".concat(t," Bad uniform ").concat(i),r),new Error("".concat(t," Bad uniform ").concat(i))}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i){var r=n,o=!1;if(r instanceof Ix&&(r=r.texture),r instanceof vx)if(o=this.uniforms[t]!==n){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var a=r,s=i.textureIndex;a.bind(s),r=s,this._textureUniforms[t]=a}else r=i.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(i(r)||o)&&XE(this.uniforms,t,n)}}return this}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this._textureUniforms){var n=this._textureUniforms[t];n.update(),e=e&&n.loaded}return e}},{key:"_bindTextures",value:function(){for(var e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t,n={},i=_(this.gl.getAttachedShaders(e));try{for(i.s();!(t=i.n()).done;){var r=t.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new nC({handle:r});break;case 35632:n.fs=new iC({handle:r})}}}catch(o){i.e(o)}finally{i.f()}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Xk(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),Ww.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),Ww.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||Ww.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)));if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(e.getProgramInfoLog(this.handle)))}}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1)for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{},i=n.vs,r=void 0===i?"":i,o=n.fs,a=void 0===o?"":o,s=n.defines,u=void 0===s?{}:s,c=n.inject,l=void 0===c?{}:c,h=n.varyings,f=void 0===h?[]:h,d=n.bufferMode,p=void 0===d?35981:d,v=n.transpileToGLSL100,g=void 0!==v&&v,m=this._getModuleList(n.modules),y=this._getHash(r),b=this._getHash(a),w=m.map(function(e){return t._getHash(e.name)}).sort(),k=f.map(function(e){return t._getHash(e)}),x=Object.keys(u).sort(),S=Object.keys(l).sort(),E=[],C=[],O=_(x);try{for(O.s();!(e=O.n()).done;){var T=e.value;E.push(this._getHash(T)),E.push(this._getHash(u[T]))}}catch(D){O.e(D)}finally{O.f()}var A,P=_(S);try{for(P.s();!(A=P.n()).done;){var M=A.value;C.push(this._getHash(M)),C.push(this._getHash(l[M]))}}catch(D){P.e(D)}finally{P.f()}var I="".concat(y,"/").concat(b,"D").concat(E.join("/"),"M").concat(w.join("/"),"I").concat(C.join("/"),"V").concat(k.join("/"),"H").concat(this.stateHash,"B").concat(p).concat(g?"T":"");if(!this._programCache[I]){var R=function(e,t){var n=t.vs,i=t.fs,r=hE(t.modules||[]);return{gl:e,vs:RE(e,Object.assign({},t,{source:n,type:YS,modules:r})),fs:RE(e,Object.assign({},t,{source:i,type:"fs",modules:r})),getUniforms:DE(r)}}(this.gl,{vs:r,fs:a,modules:m,inject:l,defines:u,hookFunctions:this._hookFunctions,transpileToGLSL100:g});this._programCache[I]=new fC(this.gl,{hash:I,vs:R.vs,fs:R.fs,varyings:f,bufferMode:p}),this._getUniforms[I]=R.getUniforms||function(e){},this._useCounts[I]=0}return this._useCounts[I]++,this._programCache[I]}},{key:"getUniforms",value:function(e){return this._getUniforms[e.hash]||null}},{key:"release",value:function(e){var t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}},{key:"_getHash",value:function(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}},{key:"_getModuleList",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new Array(this._defaultModules.length+e.length),n={},i=0,r=0,o=this._defaultModules.length;r1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,e,Object.assign({},r,{id:r.id||r.program&&r.program.id}))).buffer=null,t.bufferValue=null,t.isDefaultArray=r.isDefaultArray||!1,t.gl2=e,t.initialize(r),Object.seal(c(t)),t}return b(i,[{key:"delete",value:function(){return e(p(i.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete(),this}},{key:"MAX_ATTRIBUTES",get:function(){return i.getMaxAttributes(this.gl)}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Hk(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,o=n.stride,a=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl,h=this.gl2;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Hk(Yw(l)),h.vertexAttribIPointer(e,i,r,o,a)):l.vertexAttribPointer(e,i,r,s,o,a),l.enableVertexAttribArray(e),h.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!n&&0===e&&!i.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return n?t.gl.enableVertexAttribArray(e):t.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t){var n=this._normalizeConstantArrayValue(t),i=n.byteLength*e,r=n.length*e,o=!this.buffer;if(this.buffer=this.buffer||new cx(this.gl,i),o=(o=o||this.buffer.reallocate(i))||!this._compareConstantArrayValues(n,this.bufferValue)){var a=function(e,t){return new e(function(e){return(!pC||pC.byteLength1&&void 0!==arguments[1]?arguments[1]:{};return!t.constantAttributeZero||Yw(e)||"Chrome"===function(e){if(!_w())return"Node";if(bw(void 0))return"Electron";var t=("undefined"!=typeof navigator?navigator:{}).userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";var n=-1!==t.indexOf("MSIE "),i=-1!==t.indexOf("Trident/");return n||i?"IE":Aw.chrome?"Chrome":Aw.safari?"Safari":Aw.mozInnerScreenX?"Firefox":"Unknown"}()}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new i(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return i.MAX_ATTRIBUTES=i.MAX_ATTRIBUTES||e.getParameter(34921),i.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,t,n){switch(n.constructor){case Float32Array:i._setConstantFloatArray(e,t,n);break;case Int32Array:i._setConstantIntArray(e,t,n);break;case Uint32Array:i._setConstantUintArray(e,t,n);break;default:Hk(!1)}}},{key:"_setConstantFloatArray",value:function(e,t,n){switch(n.length){case 1:e.vertexAttrib1fv(t,n);break;case 2:e.vertexAttrib2fv(t,n);break;case 3:e.vertexAttrib3fv(t,n);break;case 4:e.vertexAttrib4fv(t,n);break;default:Hk(!1)}}},{key:"_setConstantIntArray",value:function(e,t,n){switch(Hk(Yw(e)),n.length){case 1:e.vertexAttribI1iv(t,n);break;case 2:e.vertexAttribI2iv(t,n);break;case 3:e.vertexAttribI3iv(t,n);break;case 4:e.vertexAttribI4iv(t,n);break;default:Hk(!1)}}},{key:"_setConstantUintArray",value:function(e,t,n){switch(Hk(Yw(e)),n.length){case 1:e.vertexAttribI1uiv(t,n);break;case 2:e.vertexAttribI2uiv(t,n);break;case 3:e.vertexAttribI3uiv(t,n);break;case 4:e.vertexAttribI4uiv(t,n);break;default:Hk(!1)}}}]),i}(Zk),gC=/^(.+)__LOCATION_([0-9]+)$/,mC=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],yC=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.id=n.id||n.program&&n.program.id,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new vC(t),Qk(this,"VertexArray","v6.0",mC),this.initialize(n),Object.seal(this)}return b(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}},{key:"reset",value:function(){this.elements=null,this.elementsAccessor=null;var e=this.vertexArrayObject.MAX_ATTRIBUTES;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}},{key:"setProps",value:function(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}},{key:"clearDrawParams",value:function(){this.drawParams=null}},{key:"getDrawParams",value:function(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}},{key:"setAttributes",value:function(e){var t=this;return Object.assign(this.attributes,e),this.vertexArrayObject.bind(function(){for(var n in e)t._setAttribute(n,e[n]);t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,o=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=o,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,o)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,o=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=o,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.vertexArrayObject.setElementBuffer(null),e.buffer=e.buffer||new cx(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof cx){var o=n;if(r){var a=o.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,a)}else{var s=o.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,s)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ww.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}();function bC(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,i=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,i=void 0===n?16:n,r=t.size,o=void 0===r?1:r,a="[",s=0;s0&&(a+=","+(s%o==0?" ":"")),a+=bC(e[s],t);return"".concat(a).concat(e.length>i?"...":"]")}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return i?"0":"0.";if(i||Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var r=e.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function _C(e,t,n,i){var r,a,s=e.gl;if(!t)return o(r={},i,"null"),o(r,"Format ","N/A"),r;var u,c,l,h="NOT PROVIDED",f=1,d=0,p=0;if(n&&(h=n.type,f=n.size,u=-1!==(h=String(h).replace("Array","")).indexOf("nt")),t instanceof cx){var v,g,m=t,y=m.getDebugData(),b=y.data;return c=y.changed?"*":"",l=b,d=(p=m.byteLength)/b.BYTES_PER_ELEMENT/f,n?g="".concat(n.divisor>0?"I ":"P "," ").concat(d," (x").concat(f,"=").concat(p," bytes ").concat(Wk(s,h),")"):(u=!0,g="".concat(p," bytes")),o(v={},i,"".concat(c).concat(bC(l,{size:f,isInteger:u}))),o(v,"Format ",g),v}return l=t,f=t.length,u=-1!==(h=String(t.constructor.name).replace("Array","")).indexOf("nt"),o(a={},i,"".concat(bC(l,{size:f,isInteger:u})," (constant)")),o(a,"Format ","".concat(f,"x").concat(h," (constant)")),a}function wC(e,t){var n=cC(t.type,t.size);return n?"".concat(e," (").concat(n.name,")"):e}function kC(e){var t=e.header,n=void 0===t?"Uniforms":t,i=e.program,r=e.uniforms,a=e.undefinedOnly,s=void 0!==a&&a;Hk(i);var u,c=".*Matrix",l={},h=Object.keys(i._uniformSetters).sort(),f=0,d=_(h);try{for(d.s();!(u=d.n()).done;){var p=u.value;!p.match(".*_.*")&&!p.match(c)&&xC({table:l,header:n,uniforms:r,uniformName:p,undefinedOnly:s})&&f++}}catch(C){d.e(C)}finally{d.f()}var v,g=_(h);try{for(g.s();!(v=g.n()).done;){var m=v.value;m.match(c)&&xC({table:l,header:n,uniforms:r,uniformName:m,undefinedOnly:s})&&f++}}catch(C){g.e(C)}finally{g.f()}var y,b=_(h);try{for(b.s();!(y=b.n()).done;){var w=y.value;l[w]||xC({table:l,header:n,uniforms:r,uniformName:w,undefinedOnly:s})&&f++}}catch(C){b.e(C)}finally{b.f()}var k=0,x={};if(!s)for(var S in r){var E=r[S];l[S]||(k++,x[S]=o({Type:"NOT USED: ".concat(E)},n,bC(E)))}return{table:l,count:f,unusedTable:x,unusedCount:k}}function xC(e){var t,n=e.table,i=e.header,r=e.uniforms,a=e.uniformName,s=e.undefinedOnly,u=r[a],c=function(e){return null!=e}(u);return!(s&&c||(n[a]=(t={},o(t,i,c?bC(u):"N/A"),o(t,"Uniform Type",c?u:"NOT PROVIDED"),t),0))}function SC(e){var t=e.accessor,n=cC(t.type,t.size);return n?"".concat(n.name," ").concat(e.name):e.name}var EC={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function CC(e,t){var n=(t||{}).attributeMap,i=void 0===n?EC:n;return i&&i[e]||e}function OC(e,t){var n;switch(e){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2}Hk(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var TC=function(){},AC={},PC=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e);var i=n.id,r=void 0===i?Xk("model"):i;Hk(Xw(t)),this.id=r,this.gl=t,this.id=n.id||Xk("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(n)}return b(e,[{key:"initialize",value:function(e){this.props={},this.programManager=e.programManager||dC.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;var t=e.program,n=void 0===t?null:t,i=e.vs,r=e.fs,o=e.modules,a=e.defines,s=e.inject,u=e.varyings,c=e.bufferMode,l=e.transpileToGLSL100;this.programProps={program:n,vs:i,fs:r,modules:o,defines:a,inject:s,varyings:u,bufferMode:c,transpileToGLSL100:l},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},Hk(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){this._setModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}},{key:"getDrawMode",value:function(){return this.drawMode}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getInstanceCount",value:function(){return this.instanceCount}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getProgram",value:function(){return this.program}},{key:"setProgram",value:function(e){var t=e.program,n=e.vs,i=e.fs,r=e.modules,o=e.defines,a=e.inject,s=e.varyings,u=e.bufferMode,c=e.transpileToGLSL100;this.programProps={program:t,vs:n,fs:i,modules:r,defines:o,inject:a,varyings:s,bufferMode:u,transpileToGLSL100:c},this._programDirty=!0}},{key:"getUniforms",value:function(){return this.uniforms}},{key:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Hk(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Hk(Number.isFinite(e)),this.instanceCount=e,this}},{key:"setGeometry",value:function(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(e,t,n){var i={},r=t.indices;for(var o in t.attributes){var a=t.attributes[o],s=CC(o,void 0);if("indices"===o)r=a;else if(a.constant)i[s]=a.value;else{var u=a.value,c=M({},a);delete c.value,i[s]=[new cx(e,u),c],OC(o,c)}}if(r){var l=r.value||r;Hk(l instanceof Uint16Array||l instanceof Uint32Array,'attribute array for "indices" must be of integer type');var h={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new cx(e,{data:l,target:34963}),h]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Kk(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(this.uniforms,e),this}},{key:"getModuleUniforms",value:function(e){this._checkProgram();var t=this.programManager.getUniforms(this.program);return t?t(e):{}}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return kx(this.program.gl,e),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();var t,n=e.moduleSettings,i=void 0===n?null:n,r=e.framebuffer,o=e.uniforms,a=void 0===o?{}:o,s=e.attributes,u=void 0===s?{}:s,c=e.transformFeedback,l=void 0===c?this.transformFeedback:c,h=e.parameters,f=void 0===h?{}:h,d=e.vertexArray,p=void 0===d?this.vertexArray:d;this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(a),Ww.priority>=2&&(t=this._logDrawCallStart(2));var v=this.vertexArray.getDrawParams(),g=this.props,m=g.isIndexed,y=void 0===m?v.isIndexed:m,b=g.indexType,_=void 0===b?v.indexType:b,w=g.indexOffset,k=void 0===w?v.indexOffset:w,x=g.vertexArrayInstanced,S=void 0===x?v.isInstanced:x;S&&!this.isInstanced&&Ww.warn("Found instanced attributes on non-instanced model",this.id)();var E=this.isInstanced,C=this.instanceCount,O=this.props,T=O.onBeforeRender,A=void 0===T?TC:T,P=O.onAfterRender,M=void 0===P?TC:P;A(),this.program.setUniforms(this.uniforms);var I=this.program.draw(Object.assign(AC,e,{logPriority:t,uniforms:null,framebuffer:r,parameters:f,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:p,transformFeedback:l,isIndexed:y,indexType:_,isInstanced:E,instanceCount:C,offset:y?k:0}));return M(),Ww.priority>=2&&this._logDrawCallEnd(t,p,r),I}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,o=void 0===r?[]:r,a=e.parameters;i&&this._setFeedbackBuffers(i),n&&(a=Object.assign({},a,{35977:n})),o.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:a}))}finally{o.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ww.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}},{key:"_checkProgram",value:function(){if(this._programDirty||this.programManager.stateHash!==this._programManagerState){var e=this.programProps.program;if(e)this._managedProgram=!1;else{var t=this.programProps,n=t.vs,i=t.fs,r=t.modules,o=t.inject,a=t.defines,s=t.varyings,u=t.bufferMode,c=t.transpileToGLSL100;e=this.programManager.get({vs:n,fs:i,modules:r,inject:o,defines:a,varyings:s,bufferMode:u,transpileToGLSL100:c}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Hk(e instanceof fC,"Model needs a program"),this._programDirty=!1,e!==this.program&&(this.program=e,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new yC(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}}},{key:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof cx&&t.delete()}}},{key:"_setAnimationProps",value:function(e){this.animated&&Hk(e,"Model.draw(): animated uniforms but no animationProps")}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Kk(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new WS(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ".concat(this.id),{collapsed:Ww.level<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=function(e){var t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=_C(t,t.elements,null,i));var o=t.values;for(var a in o){var s=t._getAttributeInfo(a);if(s){var u="".concat(a,": ").concat(s.name),c=t.accessors[s.location];c&&(u="".concat(a,": ").concat(wC(s.name,c))),r[u]=_C(t,o[a],c,i)}}return r}({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=kC({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),s=a.table,u=a.unusedTable,c=a.unusedCount,l=kC({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),h=l.table;l.count>0&&Ww.log("MISSING UNIFORMS",Object.keys(h))(),c>0&&Ww.log("UNUSED UNIFORMS",Object.keys(u))();var f=function(e){var t,n={},i="Accessors for ".concat(e.id),r=_(e.attributeInfos);try{for(r.s();!(t=r.n()).done;){var a=t.value;a&&(n["in ".concat(SC(a))]=o({},i,JSON.stringify(a.accessor)))}}catch(l){r.e(l)}finally{r.f()}var s,u=_(e.varyingInfos);try{for(u.s();!(s=u.n()).done;){var c=s.value;c&&(n["out ".concat(SC(c))]=o({},i,JSON.stringify(c.accessor)))}}catch(l){u.e(l)}finally{u.f()}return n}(this.vertexArray.configuration);Ww.table(e,r)(),Ww.table(e,s)(),Ww.table(e+1,f)(),i&&i.log({logLevel:2,message:"Rendered to ".concat(i.id)}),Ww.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}(),MC=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(n),Object.seal(this)}return b(e,[{key:"delete",value:function(){var e=this.model,t=this.bufferTransform,n=this.textureTransform;e&&e.delete(),t&&t.delete(),n&&n.delete()}},{key:"run",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.clearRenderTarget,n=void 0===t||t,i=this._updateDrawOptions(e);n&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}},{key:"swap",value:function(){var e,t=!1,n=_([this.bufferTransform,this.textureTransform].filter(Boolean));try{for(n.s();!(e=n.n()).done;){var i=e.value;t=t||i.swap()}}catch(r){n.e(r)}finally{n.f()}Hk(t,"Nothing to swap")}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(e)}},{key:"getData",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[this.bufferTransform,this.textureTransform].filter(Boolean),i=_(n);try{for(i.s();!(e=i.n()).done;){var r=e.value,o=r.getData(t);if(o)return o}}catch(a){i.e(a)}finally{i.f()}return null}},{key:"getFramebuffer",value:function(){return this.textureTransform&&this.textureTransform.getFramebuffer()}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"elementCount"in e&&this.model.setVertexCount(e.elementCount);var t,n=[this.bufferTransform,this.textureTransform].filter(Boolean),i=_(n);try{for(i.s();!(t=i.n()).done;){var r=t.value;r.update(e)}}catch(o){i.e(o)}finally{i.f()}}},{key:"_initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.gl;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new PC(t,Object.assign({},e,{fs:e.fs||GS({version:XS(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}},{key:"_updateModelProps",value:function(e){var t,n=Object.assign({},e),i=_([this.bufferTransform,this.textureTransform].filter(Boolean));try{for(i.s();!(t=i.n()).done;){n=t.value.updateModelProps(n)}}catch(r){i.e(r)}finally{i.f()}return n}},{key:"_buildResourceTransforms",value:function(e,t){(function(e){return!(Kk(e.feedbackBuffers)&&Kk(e.feedbackMap)&&!(e.varyings&&e.varyings.length>0))})(t)&&(this.bufferTransform=new qS(e,t)),function(e){return!(Kk(e._sourceTextures)&&!e._targetTexture&&!e._targetTextureVarying)}(t)&&(this.textureTransform=new aE(e,t)),Hk(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}},{key:"_updateDrawOptions",value:function(e){var t,n=Object.assign({},e),i=_([this.bufferTransform,this.textureTransform].filter(Boolean));try{for(i.s();!(t=i.n()).done;){var r=t.value;n=Object.assign(n,r.getDrawOptions(n))}}catch(o){i.e(o)}finally{i.f()}return n}}],[{key:"isSupported",value:function(e){return Yw(e)}}]),e}();function IC(){}var RC={onStart:IC,onUpdate:IC,onInterrupt:IC,onEnd:IC},DC=function(){function e(t){m(this,e),this._inProgress=!1,this._handle=null,this.timeline=t,this.settings={}}return b(e,[{key:"inProgress",get:function(){return this._inProgress}},{key:"start",value:function(e){this.cancel(),this.settings=M(M({},RC),e),this._inProgress=!0,this.settings.onStart(this)}},{key:"end",value:function(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}},{key:"cancel",value:function(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}},{key:"update",value:function(){if(!this._inProgress)return!1;if(null===this._handle){var e=this.timeline,t=this.settings;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}},{key:"_onUpdate",value:function(){}}]),e}(),NC={interpolation:function(){function e(t){var n=t.gl,i=t.attribute,r=t.timeline;m(this,e),this.gl=n,this.type="interpolation",this.transition=new DC(r),this.attribute=i,this.attributeInTransition=new jS(n,i.settings),this.currentStartIndices=i.startIndices,this.currentLength=0,this.transform=function(e,t){var n=RS(t.size);return new MC(e,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(n,i);var o={byteLength:0,usage:35050};this.buffers=[new cx(n,o),new cx(n,o)]}return b(e,[{key:"inProgress",get:function(){return this.transition.inProgress}},{key:"start",value:function(e,t){if(e.duration<=0)this.transition.cancel();else{var n=this.buffers,i=this.attribute;DS(n);var r,o={numInstances:t,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter},a=_(n);try{for(a.s();!(r=a.n()).done;){var s=r.value;LS(M({buffer:s},o))}}catch(u){a.e(u)}finally{a.f()}this.currentStartIndices=i.startIndices,this.currentLength=NS(i,t),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:n[0],aTo:IS(0,i)},feedbackBuffers:{vCurrent:n[1]}})}}},{key:"update",value:function(){var e=this.transition.update();if(e){var t=this.transition,n=t.time,i=t.settings,r=i.duration,o=(0,i.easing)(n/r);this.transform.run({uniforms:{time:o}})}return e}},{key:"cancel",value:function(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}}]),e}(),spring:function(){function e(t){var n=t.gl,i=t.attribute,r=t.timeline;m(this,e),this.gl=n,this.type="spring",this.transition=new DC(r),this.attribute=i,this.attributeInTransition=new jS(n,I(M({},i.settings),{normalized:!1})),this.currentStartIndices=i.startIndices,this.currentLength=0,this.texture=function(e){return new mx(e,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(n),this.framebuffer=function(e,t){return new Ix(e,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:t}})}(n,this.texture),this.transform=function(e,t,n){var i=RS(t.size);return new MC(e,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(n,i,this.framebuffer);var o={byteLength:0,usage:35050};this.buffers=[new cx(n,o),new cx(n,o),new cx(n,o)]}return b(e,[{key:"inProgress",get:function(){return this.transition.inProgress}},{key:"start",value:function(e,t){var n,i=this.buffers,r=this.attribute,o={numInstances:t,attribute:r,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter},a=_(i);try{for(a.s();!(n=a.n()).done;){var s=n.value;LS(M({buffer:s},o))}}catch(u){a.e(u)}finally{a.f()}this.currentStartIndices=r.startIndices,this.currentLength=NS(r,t),this.attributeInTransition.update({buffer:i[1],value:r.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/r.size),sourceBuffers:{aTo:IS(0,r)}})}},{key:"update",value:function(){var e=this.buffers,t=this.transform,n=this.framebuffer,i=this.transition;return!!i.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:i.settings.stiffness,damping:i.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),DS(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),Ax(n)[0]>0||i.end(),!0)}},{key:"cancel",value:function(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}]),e}()},LC=function(){function e(t,n){var i=n.id,r=n.timeline;m(this,e),this.id=i,this.gl=t,this.timeline=r,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=MC.isSupported(t)}return b(e,[{key:"finalize",value:function(){for(var e in this.transitions)this._removeTransition(e)}},{key:"update",value:function(e){var t=e.attributes,n=e.transitions,i=e.numInstances;for(var r in this.numInstances=i||1,t){var o=t[r],a=o.getTransitionSetting(n);!a||this._updateAttribute(r,o,a)}for(var s in this.transitions){var u=t[s];(!u||!u.getTransitionSetting(n))&&this._removeTransition(s)}}},{key:"hasAttribute",value:function(e){var t=this.transitions[e];return t&&t.inProgress}},{key:"getAttributes",value:function(){var e={};for(var t in this.transitions){var n=this.transitions[t];n.inProgress&&(e[t]=n.attributeInTransition)}return e}},{key:"run",value:function(){if(!this.isSupported||0===this.numInstances)return!1;for(var e in this.transitions)this.transitions[e].update()&&(this.needsRedraw=!0);var t=this.needsRedraw;return this.needsRedraw=!1,t}},{key:"_removeTransition",value:function(e){this.transitions[e].cancel(),delete this.transitions[e]}},{key:"_updateAttribute",value:function(e,t,n){var i=this.transitions[e],r=!i||i.type!==n.type;if(r){if(!this.isSupported)return void zw.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();i&&this._removeTransition(e);var o=NC[n.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(zw.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(n,this.numInstances))}}]),e}(),jC="attributeManager.invalidate",FC=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,r=void 0===i?"attribute-manager":i,o=n.stats,a=n.timeline;m(this,e),this.id=r,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new LC(t,{id:"".concat(r,"-transitions"),timeline:a}),Object.seal(this)}return b(e,[{key:"finalize",value:function(){for(var e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.startIndices,r=void 0===i?null:i,o=e.transitions,a=e.props,s=void 0===a?{}:a,u=e.buffers,c=void 0===u?{}:u,l=e.context,h=void 0===l?{}:l,f=!1;for(var d in BS("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var p=this.attributes[d],v=p.settings.accessor;p.startIndices=r,s[d]&&zw.removed("props.".concat(d),"data.attributes.".concat(d))(),p.setExternalBuffer(c[d])||p.setBinaryValue(c[v],t.startIndices)||!c[v]&&p.setConstantValue(s[v])||p.needsUpdate()&&(f=!0,this._updateAttribute({attribute:p,numInstances:n,data:t,props:s,context:h})),this.needsRedraw|=p.needsRedraw()}f&&BS("attributeManager.updateEnd",this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:o})}},{key:"updateTransition",value:function(){var e=this.attributeTransitionManager.run();return this.needsRedraw=this.needsRedraw||e,e}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=M({},n.getAttributes());for(var r in t){var o=t[r];o.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=o)}return i}},{key:"getShaderAttributes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e||(e=this.getAttributes());var n={};for(var i in e)t[i]||Object.assign(n,e[i].getShaderAttributes());return n}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var i in t&&zw.warn("AttributeManager.add({updaters}) - updater map no longer supported")(),e)this.attributes[i]=this._createAttribute(i,e[i],n);this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i=I(M({},t),{id:e,isIndexed:t.isIndexed||t.elements||!1,constant:t.constant||!1,size:(t.elements?1:t.size)||1,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor||0});return new jS(this.gl,i)}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];return i&&i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)}),i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;BS("attribute.updateStart",t),t.allocate(n)&&BS("attribute.allocate",t,n),t.updateBuffer(e)&&(this.needsRedraw=!0,BS("attribute.updateEnd",t,n))}}]),e}();function BC(e,t,n,i,r){var o=t-e;return(n-t)*r+-o*i+o+t}function VC(e,t){if(Array.isArray(e)){for(var n=0,i=0;i0}},{key:"add",value:function(e,t,n,i){var r=this.transitions;if(r.has(e)){var o=r.get(e),a=o.value;t=void 0===a?o.settings.fromValue:a,this.remove(e)}if(i=MS(i)){var s=zC[i.type];if(s){var u=new s(this.timeline);u.start(I(M({},i),{fromValue:t,toValue:n})),r.set(e,u)}else zw.error("unsupported transition type '".concat(i.type,"'"))()}}},{key:"remove",value:function(e){var t=this.transitions;t.has(e)&&(t.get(e).cancel(),t.delete(e))}},{key:"update",value:function(){var e,n={},i=_(this.transitions);try{for(i.s();!(e=i.n()).done;){var r=t(e.value,2),o=r[0],a=r[1];a.update(),n[o]=a.value,a.inProgress||this.remove(o)}}catch(s){i.e(s)}finally{i.f()}return n}},{key:"clear",value:function(){var e,t=_(this.transitions.keys());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.remove(n)}}catch(i){t.e(i)}finally{t.f()}}}]),e}(),HC={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},GC=HC.COMPONENT;function WC(e,t){if(!e.transitions)return null;var n={},i=QC(e);for(var r in e.transitions){var o=i[r],a=o&&o.type;("number"===a||"color"===a||"array"===a)&&XC(e[r],t[r],o)&&(n[r]=!0)}return n}function qC(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,o=e.propTypes,a=void 0===o?{}:o,s=e.triggerName,u=void 0===s?"props":s;if(n===t)return null;if("object"!=typeof t||null===t||"object"!=typeof n||null===n)return"".concat(u," changed shallowly");for(var c=0,l=Object.keys(t);c=0&&n.modules.splice(i,1)}if("inject"in t)if(e.inject){var r=M({},e.inject);for(var o in t.inject)r[o]=(r[o]||"")+t.inject[o];n.inject=r}else n.inject=t.inject;return n}function eO(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],f=t[10],d=t[11],p=t[12],v=t[13],g=t[14],m=t[15],y=n*s-i*a,b=n*u-r*a,_=n*c-o*a,w=i*u-r*s,k=i*c-o*s,x=r*c-o*u,S=l*v-h*p,E=l*g-f*p,C=l*m-d*p,O=h*g-f*v,T=h*m-d*v,A=f*m-d*g,P=y*A-b*T+_*O+w*C-k*E+x*S;return P?(e[0]=(s*A-u*T+c*O)*(P=1/P),e[1]=(r*T-i*A-o*O)*P,e[2]=(v*x-g*k+m*w)*P,e[3]=(f*k-h*x-d*w)*P,e[4]=(u*C-a*A-c*E)*P,e[5]=(n*A-r*C+o*E)*P,e[6]=(g*_-p*x-m*b)*P,e[7]=(l*x-f*_+d*b)*P,e[8]=(a*T-s*C+c*S)*P,e[9]=(i*C-n*T-o*S)*P,e[10]=(p*k-v*_+m*y)*P,e[11]=(h*_-l*k-d*y)*P,e[12]=(s*E-a*O-u*S)*P,e[13]=(n*O-i*E+r*S)*P,e[14]=(v*b-p*w-g*y)*P,e[15]=(l*w-h*b+f*y)*P,e):null}function tO(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],v=t[12],g=t[13],m=t[14],y=t[15],b=n[0],_=n[1],w=n[2],k=n[3];return e[0]=b*i+_*s+w*h+k*v,e[1]=b*r+_*u+w*f+k*g,e[2]=b*o+_*c+w*d+k*m,e[3]=b*a+_*l+w*p+k*y,e[4]=(b=n[4])*i+(_=n[5])*s+(w=n[6])*h+(k=n[7])*v,e[5]=b*r+_*u+w*f+k*g,e[6]=b*o+_*c+w*d+k*m,e[7]=b*a+_*l+w*p+k*y,e[8]=(b=n[8])*i+(_=n[9])*s+(w=n[10])*h+(k=n[11])*v,e[9]=b*r+_*u+w*f+k*g,e[10]=b*o+_*c+w*d+k*m,e[11]=b*a+_*l+w*p+k*y,e[12]=(b=n[12])*i+(_=n[13])*s+(w=n[14])*h+(k=n[15])*v,e[13]=b*r+_*u+w*f+k*g,e[14]=b*o+_*c+w*d+k*m,e[15]=b*a+_*l+w*p+k*y,e}function nO(e,t,n){var i,r,o,a,s,u,c,l,h,f,d,p,v=n[0],g=n[1],m=n[2];return t===e?(e[12]=t[0]*v+t[4]*g+t[8]*m+t[12],e[13]=t[1]*v+t[5]*g+t[9]*m+t[13],e[14]=t[2]*v+t[6]*g+t[10]*m+t[14],e[15]=t[3]*v+t[7]*g+t[11]*m+t[15]):(r=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],e[0]=i=t[0],e[1]=r,e[2]=o,e[3]=a,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=h,e[9]=f,e[10]=d,e[11]=p,e[12]=i*v+s*g+h*m+t[12],e[13]=r*v+u*g+f*m+t[13],e[14]=o*v+c*g+d*m+t[14],e[15]=a*v+l*g+p*m+t[15]),e}function iO(e,t,n){var i=n[0],r=n[1],o=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function rO(e,t,n){var i=Math.sin(n),r=Math.cos(n),o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*r+c*i,e[5]=a*r+l*i,e[6]=s*r+h*i,e[7]=u*r+f*i,e[8]=c*r-o*i,e[9]=l*r-a*i,e[10]=h*r-s*i,e[11]=f*r-u*i,e}function oO(e,t,n){var i=Math.sin(n),r=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[4],l=t[5],h=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r+c*i,e[1]=a*r+l*i,e[2]=s*r+h*i,e[3]=u*r+f*i,e[4]=c*r-o*i,e[5]=l*r-a*i,e[6]=h*r-s*i,e[7]=f*r-u*i,e}function aO(e,t,n,i,r){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0?(e[10]=(r+i)*(o=1/(i-r)),e[14]=2*r*i*o):(e[10]=-1,e[14]=-2*i),e}function sO(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],v=e[13],g=e[14],m=e[15],y=t[0],b=t[1],_=t[2],w=t[3],k=t[4],x=t[5],S=t[6],E=t[7],C=t[8],O=t[9],T=t[10],A=t[11],P=t[12],M=t[13],I=t[14],R=t[15];return Math.abs(n-y)<=tS*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-b)<=tS*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(r-_)<=tS*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(o-w)<=tS*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-k)<=tS*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(s-x)<=tS*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(u-S)<=tS*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(c-E)<=tS*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-C)<=tS*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(h-O)<=tS*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(f-T)<=tS*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(d-A)<=tS*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-P)<=tS*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(v-M)<=tS*Math.max(1,Math.abs(v),Math.abs(M))&&Math.abs(g-I)<=tS*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(m-R)<=tS*Math.max(1,Math.abs(m),Math.abs(R))}function uO(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function cO(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*a,e[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*a,e[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*a,e[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*a,e}!function(){var e=new nS(4);nS!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var lO=[0,0,0,0],hO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],fO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],dO=[0,0,0],pO=[0,0,0],vO=ZC(function(e){var t=e.viewport,n=e.devicePixelRatio,i=e.coordinateSystem,r=function(e,t,n){var i=e.viewMatrixUncentered,r=e.projectionMatrix,o=e.viewMatrix,a=e.viewProjectionMatrix,s=lO,u=lO,c=e.cameraPosition,l=gO(e,t,n),h=l.geospatialOrigin,f=l.shaderCoordinateOrigin;return l.offsetMode&&(u=e.projectPosition(h||f),c=[c[0]-u[0],c[1]-u[1],c[2]-u[2]],u[3]=1,s=cO([],u,a),a=tO([],r,o=i||o),a=tO([],a,hO)),{viewMatrix:o,viewProjectionMatrix:a,projectionCenter:s,originCommon:u,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:h}}(t,i,e.coordinateOrigin),o=r.projectionCenter,a=r.viewProjectionMatrix,s=r.originCommon,u=r.cameraPosCommon,c=r.shaderCoordinateOrigin,l=r.geospatialOrigin,h=t.getDistanceScales(),f=[t.width*n,t.height*n],d=t.projectionMatrix.transform([0,0,-t.focalDistance,1])[3]||1,p={project_uCoordinateSystem:i,project_uProjectionMode:t.projectionMode,project_uCoordinateOrigin:c,project_uCommonOrigin:s.slice(0,3),project_uCenter:o,project_uViewportSize:f,project_uDevicePixelRatio:n,project_uFocalDistance:d,project_uCommonUnitsPerMeter:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:dO,project_uScale:t.scale,project_uViewProjectionMatrix:a,project_uCameraPosition:u};if(l){var v=t.getDistanceScales(l);switch(i){case Uw.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=v.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=v.unitsPerMeter2;break;case Uw.LNGLAT:case Uw.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=v.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=v.unitsPerDegree2;break;case Uw.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,v.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,v.unitsPerMeter2[2]]}}return p});function gO(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pO,r=i,o=!0;switch(n=t===Uw.LNGLAT_OFFSETS||t===Uw.METER_OFFSETS?i:e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case Hw.WEB_MERCATOR:(t===Uw.LNGLAT||t===Uw.CARTESIAN)&&(o=!1);break;case Hw.WEB_MERCATOR_AUTO_OFFSET:t===Uw.LNGLAT?r=n:t===Uw.CARTESIAN&&(r=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],n=e.unprojectPosition(r),r[0]-=i[0],r[1]-=i[1],r[2]-=i[2]);break;case Hw.IDENTITY:r=e.position.map(Math.fround);break;case Hw.GLOBE:o=!1,n=null;break;default:o=!1}return r[2]=r[2]||0,{geospatialOrigin:n,shaderCoordinateOrigin:r,offsetMode:o}}var mO=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"ELEMENTS",get:function(){return Yx(!1),0}},{key:"RANK",get:function(){return Yx(!1),0}},{key:"toString",value:function(){var e="[";if(Vx.printRowMajor){e+="row-major:";for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=e*this.RANK,i=0;i2*Math.PI)throw Error("radians");var f=s*Math.tan(n/2),d=f*o;return(new i).ortho({left:-d,right:d,bottom:-f,top:f,near:c,far:h})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,o=void 0===r?1:r,a=e.near,s=void 0===a?.1:a,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return aO(this,t,o,s,c),this.check()}},{key:"determinant",value:function(){return function(e){var t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11],d=e[12],p=e[13],v=e[14],g=e[15];return(t*a-n*o)*(h*g-f*v)-(t*s-i*o)*(l*g-f*p)+(t*u-r*o)*(l*v-h*p)+(n*s-i*a)*(c*g-f*d)-(n*u-r*a)*(c*v-h*d)+(i*u-r*s)*(c*p-l*d)}(this)}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),i=1/n[0],r=1/n[1],o=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*r,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*r,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*r,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),i=1/n[0],r=1/n[1],o=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*r,e[2]=this[2]*o,e[3]=this[4]*i,e[4]=this[5]*r,e[5]=this[6]*o,e[6]=this[8]*i,e[7]=this[9]*r,e[8]=this[10]*o,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=o,e[11]=t[14],e[12]=r,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return eO(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return tO(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return tO(this,this,e),this.check()}},{key:"rotateX",value:function(e){return rO(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){var i=Math.sin(n),r=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[8],l=t[9],h=t[10],f=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r-c*i,e[1]=a*r-l*i,e[2]=s*r-h*i,e[3]=u*r-f*i,e[8]=o*i+c*r,e[9]=a*i+l*r,e[10]=s*i+h*r,e[11]=u*i+f*r}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return oO(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var n=t(e,3),i=n[0],r=n[1],o=n[2];return this.rotateX(i).rotateY(r).rotateZ(o)}},{key:"rotateAxis",value:function(e,t){return function(e,t,n,i){var r,o,a,s,u,c,l,h,f,d,p,v,g,m,y,b,_,w,k,x,S,E,C,O,T=i[0],A=i[1],P=i[2],M=Math.hypot(T,A,P);M=-90&&r<=90,"invalid latitude"),[512*(i*IO+PO)/(2*PO),512*(PO+Math.log(Math.tan(MO+r*IO*.5)))/(2*PO)]}function LO(e){var n=t(e,2),i=n[0],r=n[1],o=i/512*(2*PO)-PO,a=2*(Math.atan(Math.exp(r/512*(2*PO)-PO))-MO);return[o*RO,a*RO]}function jO(e){var t=e.latitude,n=e.longitude,i=e.highPrecision,r=void 0!==i&&i;AO(Number.isFinite(t)&&Number.isFinite(n));var o={},a=Math.cos(t*IO),s=512/360,u=s/a,c=512/DO/a;if(o.unitsPerMeter=[c,c,c],o.metersPerUnit=[1/c,1/c,1/c],o.unitsPerDegree=[s,u,c],o.degreesPerUnit=[1/s,1/u,1/c],r){var l=IO*Math.tan(t*IO)/a,h=512/DO*l,f=h/u*c;o.unitsPerDegree2=[0,s*l/2,h],o.unitsPerMeter2=[f,0,f]}return o}function FO(e,n){var i=t(e,3),r=i[0],o=i[1],a=i[2],s=t(n,3),u=s[0],c=s[1],l=s[2],h=jO({longitude:r,latitude:o,highPrecision:!0}),f=h.unitsPerMeter,d=h.unitsPerMeter2,p=NO(e);p[0]+=u*(f[0]+d[0]*c),p[1]+=c*(f[1]+d[1]*c);var v=LO(p),g=(a||0)+(l||0);return Number.isFinite(a)||Number.isFinite(l)?[v[0],v[1],g]:v}function BO(e){var t=e.height,n=e.pitch,i=e.bearing,r=e.altitude,o=e.scale,a=e.center,s=void 0===a?null:a,u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return nO(u,u,[0,0,-r]),rO(u,u,-n*IO),oO(u,u,i*IO),iO(u,u,[o/=t,o,o]),s&&nO(u,u,function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}([],s)),u}function VO(e){var t=e.width,n=e.height,i=e.fovy,r=void 0===i?zO(1.5):i,o=e.altitude,a=e.pitch,s=void 0===a?0:a,u=e.nearZMultiplier,c=void 0===u?1:u,l=e.farZMultiplier,h=void 0===l?1:l;void 0!==o&&(r=zO(o));var f=.5*r*IO,d=UO(r),p=s*IO,v=Math.sin(f)*d/Math.sin(Math.min(Math.max(Math.PI/2-p-f,.01),Math.PI-.01));return{fov:2*f,aspect:t/n,focalDistance:d,near:c,far:(Math.sin(p)*v+d)*h}}function zO(e){return 2*Math.atan(.5/e)*RO}function UO(e){return.5/Math.tan(.5*e*IO)}function HO(e,n){var i=t(e,3),r=i[0],o=i[1],a=i[2],s=void 0===a?0:a;return AO(Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(s)),CO(n,[r,o,s,1])}function GO(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t(e,3),o=r[0],a=r[1],s=r[2];if(AO(Number.isFinite(o)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(s))return CO(n,[o,a,s,1]);var u=CO(n,[o,a,0,1]),c=CO(n,[o,a,1,1]),l=u[2],h=c[2];return _O([],u,c,l===h?0:((i||0)-l)/(h-l))}function WO(e){var n=e.width,i=e.height,r=e.bounds,o=e.minExtent,a=void 0===o?0:o,s=e.maxZoom,u=void 0===s?24:s,c=e.padding,l=void 0===c?0:c,h=e.offset,f=void 0===h?[0,0]:h,d=t(r,2),p=t(d[0],2),v=p[0],g=p[1],m=t(d[1],2),y=m[0],b=m[1];Number.isFinite(l)?l={top:l,bottom:l,left:l,right:l}:AO(Number.isFinite(l.top)&&Number.isFinite(l.bottom)&&Number.isFinite(l.left)&&Number.isFinite(l.right));var _=new KO({width:n,height:i,longitude:0,latitude:0,zoom:0}),w=_.project([v,b]),k=_.project([y,g]),x=[Math.max(Math.abs(k[0]-w[0]),a),Math.max(Math.abs(k[1]-w[1]),a)],S=[n-l.left-l.right-2*Math.abs(f[0]),i-l.top-l.bottom-2*Math.abs(f[1])];AO(S[0]>0&&S[1]>0);var E=S[0]/x[0],C=S[1]/x[1],O=_.unproject([(k[0]+w[0])/2+(l.right-l.left)/2/E,(k[1]+w[1])/2+(l.bottom-l.top)/2/C]),T=Math.min(u,_.zoom+TO(Math.abs(Math.min(E,C))));return AO(Number.isFinite(T)),{longitude:O[0],latitude:O[1],zoom:T}}var qO=Math.PI/180;function XO(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.width,o=e.height,a=e.unproject,s={targetZ:i},u=a([0,o],s),c=a([r,o],s);return(e.fovy?.5*e.fovy*qO:Math.atan(.5/e.altitude))>(90-e.pitch)*qO-.01?(t=YO(e,0,i),n=YO(e,r,i)):(t=a([0,0],s),n=a([r,0],s)),[u,c,n,t]}function YO(e,t,n){var i=e.pixelUnprojectionMatrix,r=CO(i,[t,0,1,1]),o=CO(i,[t,e.height,1,1]),a=LO(_O([],r,o,(n*e.distanceScales.unitsPerMeter[2]-r[2])/(o[2]-r[2])));return a[2]=n,a}var KO=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1},n=t.width,i=t.height,r=t.latitude,o=void 0===r?0:r,a=t.longitude,s=void 0===a?0:a,u=t.zoom,c=void 0===u?0:u,l=t.pitch,h=void 0===l?0:l,f=t.bearing,d=void 0===f?0:f,p=t.altitude,v=void 0===p?null:p,g=t.fovy,y=void 0===g?null:g,b=t.position,_=void 0===b?null:b,w=t.nearZMultiplier,k=void 0===w?.02:w,x=t.farZMultiplier,S=void 0===x?1.01:x;m(this,e),n=n||1,i=i||1,null===y&&null===v?y=zO(v=1.5):null===y?y=zO(v):null===v&&(v=UO(y));var E=function(e){return Math.pow(2,e)}(c);v=Math.max(.75,v);var C,O,T=jO({longitude:s,latitude:o}),A=NO([s,o]);A[2]=0,_&&function(e,t,n){e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2]}(A,A,function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}([],_,T.unitsPerMeter)),this.projectionMatrix=aO([],(O=VO({width:(C={width:n,height:i,pitch:h,fovy:y,nearZMultiplier:k,farZMultiplier:S}).width,height:C.height,altitude:C.altitude,fovy:C.fovy,pitch:C.pitch,nearZMultiplier:C.nearZMultiplier,farZMultiplier:C.farZMultiplier})).fov,O.aspect,O.near,O.far),this.viewMatrix=BO({height:i,scale:E,center:A,pitch:h,bearing:d,altitude:v}),this.width=n,this.height=i,this.scale=E,this.latitude=o,this.longitude=s,this.zoom=c,this.pitch=h,this.bearing=d,this.altitude=v,this.fovy=y,this.center=A,this.meterOffset=_||[0,0,0],this.distanceScales=T,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}return b(e,[{key:"_initMatrices",value:function(){var e=this.width,t=this.height,n=this.projectionMatrix,i=this.viewMatrix,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];tO(r,r,n),tO(r,r,i),this.viewProjectionMatrix=r;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];iO(o,o,[e/2,-t/2,1]),nO(o,o,[1,-1,0]),tO(o,o,r);var a=eO([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}},{key:"equals",value:function(t){return t instanceof e&&t.width===this.width&&t.height===this.height&&sO(t.projectionMatrix,this.projectionMatrix)&&sO(t.viewMatrix,this.viewMatrix)}},{key:"project",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=HO(this.projectPosition(e),this.pixelProjectionMatrix),a=t(o,2),s=a[0],u=a[1],c=r?u:this.height-u;return 2===e.length?[s,c]:[s,c,o[2]]}},{key:"unproject",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=n.targetZ,a=t(e,3),s=a[0],u=a[1],c=a[2],l=GO([s,r?u:this.height-u,c],this.pixelUnprojectionMatrix,o&&o*this.distanceScales.unitsPerMeter[2]),h=this.unprojectPosition(l),f=t(h,3),d=f[0],p=f[1],v=f[2];return Number.isFinite(c)?[d,p,v]:Number.isFinite(o)?[d,p,o]:[d,p]}},{key:"projectPosition",value:function(e){var n=t(NO(e),2);return[n[0],n[1],(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var n=t(LO(e),2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(e){return NO(e)}},{key:"unprojectFlat",value:function(e){return LO(e)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=GO(e.pos,this.pixelUnprojectionMatrix),i=yO([],NO(t),bO([],n));return LO(yO([],this.center,i))}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,o=WO(Object.assign({width:i,height:r,bounds:t},n)),a=o.longitude,s=o.latitude,u=o.zoom;return new e({width:i,height:r,longitude:a,latitude:s,zoom:u})}},{key:"getBounds",value:function(e){var t=this.getBoundingRegion(e),n=Math.min.apply(Math,v(t.map(function(e){return e[0]}))),i=Math.max.apply(Math,v(t.map(function(e){return e[0]})));return[[n,Math.min.apply(Math,v(t.map(function(e){return e[1]})))],[i,Math.max.apply(Math,v(t.map(function(e){return e[1]})))]]}},{key:"getBoundingRegion",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return XO(this,e.z||0)}}]),e}(),QO=Math.PI/180,$O=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZO=[0,0,0],JO={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]},eT=function(){var e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,o=void 0===r?0:r,a=t.y,s=void 0===a?0:a,u=t.width,c=void 0===u?1:u,l=t.height,h=void 0===l?1:l;this.id=i||this.constructor.displayName||"viewport",this.x=o,this.y=s,this.width=c||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return b(e,[{key:"metersPerPixel",get:function(){return this.distanceScales.metersPerUnit[2]/this.scale}},{key:"projectionMode",get:function(){return this.isGeospatial?this.zoom<12?Hw.WEB_MERCATOR:Hw.WEB_MERCATOR_AUTO_OFFSET:Hw.IDENTITY}},{key:"equals",value:function(t){return t instanceof e&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Xx(t.projectionMatrix,this.projectionMatrix)&&Xx(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=HO(this.projectPosition(e),this.pixelProjectionMatrix),a=t(o,2),s=a[0],u=a[1],c=r?u:this.height-u;return 2===e.length?[s,c]:[s,c,o[2]]}},{key:"unproject",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=n.targetZ,a=t(e,3),s=a[0],u=a[1],c=a[2],l=GO([s,r?u:this.height-u,c],this.pixelUnprojectionMatrix,o&&o*this.distanceScales.unitsPerMeter[2]),h=this.unprojectPosition(l),f=t(h,3),d=f[0],p=f[1],v=f[2];return Number.isFinite(c)?[d,p,v]:Number.isFinite(o)?[d,p,o]:[d,p]}},{key:"projectPosition",value:function(e){var n=t(this.projectFlat(e),2);return[n[0],n[1],(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var n=t(this.unprojectFlat(e),2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(e){return this.isGeospatial?NO(e):e}},{key:"unprojectFlat",value:function(e){return this.isGeospatial?LO(e):e}},{key:"getBounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={targetZ:e.z||0},n=this.unproject([0,0],t),i=this.unproject([this.width,0],t),r=this.unproject([0,this.height],t),o=this.unproject([this.width,this.height],t);return[Math.min(n[0],i[0],r[0],o[0]),Math.min(n[1],i[1],r[1],o[1]),Math.max(n[0],i[0],r[0],o[0]),Math.max(n[1],i[1],r[1],o[1])]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?jO({longitude:e[0],latitude:e[1],highPrecision:!0}):this.distanceScales}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,o=e.height,a=void 0===o?1:o;return t0&&void 0!==arguments[0]?arguments[0]:{};m(this,i);var r=t.latitude,o=void 0===r?0:r,a=t.longitude,s=void 0===a?0:a,u=t.zoom,l=void 0===u?11:u,h=t.pitch,f=void 0===h?0:h,d=t.bearing,p=void 0===d?0:d,v=t.nearZMultiplier,g=void 0===v?.1:v,y=t.farZMultiplier,b=void 0===y?1.01:y,_=t.orthographic,w=void 0!==_&&_,k=t.repeat,x=void 0!==k&&k,S=t.worldOffset,E=void 0===S?0:S,C=t.width,O=t.height,T=t.altitude,A=void 0===T?1.5:T,P=Math.pow(2,l),R=VO({width:C=C||1,height:O=O||1,pitch:f,altitude:A=Math.max(.75,A),nearZMultiplier:g,farZMultiplier:b}),D=R.fov,N=R.aspect,L=R.focalDistance,j=R.near,F=R.far,B=BO({height:O,pitch:f,bearing:p,scale:P,altitude:A});return E&&(B=(new EO).translate([512*E,0,0]).multiplyLeft(B)),(e=n.call(this,I(M({},t),{width:C,height:O,viewMatrix:B,longitude:s,latitude:o,zoom:l,orthographic:w,fovyRadians:D,aspect:N,focalDistance:L,near:j,far:F}))).latitude=o,e.longitude=s,e.zoom=l,e.pitch=f,e.bearing=p,e.altitude=A,e.orthographic=w,e._subViewports=x?[]:null,Object.freeze(c(e)),e}return b(i,[{key:"subViewports",get:function(){if(this._subViewports&&!this._subViewports.length)for(var e=this.getBounds(),t=Math.floor((e[0]+180)/360),n=Math.ceil((e[2]-180)/360),r=t;r<=n;r++){var o=r?new i(I(M({},this),{worldOffset:r})):this;this._subViewports.push(o)}return this._subViewports}},{key:"addMetersToLngLat",value:function(e,t){return FO(e,t)}},{key:"panByPosition",value:function(e,n){var i=GO(n,this.pixelUnprojectionMatrix),r=yO([],this.projectFlat(e),bO([],i)),o=yO([],this.center,r),a=t(this.unprojectFlat(o),2);return{longitude:a[0],latitude:a[1]}}},{key:"getBounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=XO(this,e.z||0);return[Math.min(t[0][0],t[1][0],t[2][0],t[3][0]),Math.min(t[0][1],t[1][1],t[2][1],t[3][1]),Math.max(t[0][0],t[1][0],t[2][0],t[3][0]),Math.max(t[0][1],t[1][1],t[2][1],t[3][1])]}},{key:"fitBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.width,r=this.height,o=WO(M({width:n,height:r,bounds:e},t)),a=o.longitude,s=o.latitude,u=o.zoom;return new i({width:n,height:r,longitude:a,latitude:s,zoom:u})}}]),i}(eT);return e.displayName="WebMercatorViewport",e}();function nT(e,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n.projectPosition(e);if(i&&n instanceof tT){var o=t(e,3),a=o[0],s=o[1],u=o[2],c=void 0===u?0:u,l=n.getDistanceScales([a,s]);r[2]=c*l.unitsPerMeter[2]}return r}function iT(e,n){var i,r=n.viewport,o=n.modelMatrix,a=n.coordinateSystem,s=n.coordinateOrigin,u=n.offsetMode,c=t(e,3),l=c[0],h=c[1],f=c[2],d=void 0===f?0:f;switch(o&&(l=(i=t(cO([],[l,h,d,1],o),3))[0],h=i[1],d=i[2]),a){case Uw.LNGLAT:return nT([l,h,d],r,u);case Uw.LNGLAT_OFFSETS:return nT([l+s[0],h+s[1],d+(s[2]||0)],r,u);case Uw.METER_OFFSETS:return nT(FO(s,[l,h,d]),r,u);case Uw.CARTESIAN:default:return r.isGeospatial?[l+s[0],h+s[1],d+s[2]]:r.projectPosition([l,h,d])}}var rT={10241:9987,10240:9729,10242:33071,10243:33071},oT={},aT={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return t.optional&&!e||lT(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return sT(e,t)}},accessor:{validate:function(e,t){var n=hT(e);return"function"===n||n===hT(t.value)},equal:function(e,t,n){return"function"==typeof t||sT(e,t)}},array:{validate:function(e,t){return t.optional&&!e||lT(e)},equal:function(e,t,n){return n.compare?sT(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}},data:{transform:function(e,t,n){var i=(n?n.props:{}).dataTransform;return i&&e?i(e):e}},image:{transform:function(e,t,n){return function(e,t){var n=e.context&&e.context.gl;if(!n||!t)return null;if(t instanceof mx)return t;t.constructor&&"Object"!==t.constructor.name&&(t={data:t});var i=null;t.compressed&&(i={10241:t.data.length>1?9985:9729});var r=new mx(n,I(M({},t),{parameters:M(M(M({},rT),i),e.props.textureParameters)}));return oT[r.id]=!0,r}(n,e)},release:function(e){!function(e){!e||!(e instanceof mx)||oT[e.id]&&(e.delete(),delete oT[e.id])}(e)}}};function sT(e,t){if(e===t)return!0;if(!lT(e)||!lT(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;m(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=ET,this.oldAsyncProps=null}return b(e,[{key:"finalize",value:function(){for(var e in this.asyncProps){var t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}},{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){if(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(var n in this.asyncProps)if(this.isAsyncPropLoading(n))return!0;return!1}},{key:"reloadAsyncProp",value:function(e,t){this._watchPromise(e,Promise.resolve(t))}},{key:"setAsyncProps",value:function(e){var t=e[xT]||{},n=e[kT]||e,i=e[ST]||{};for(var r in t){var o=t[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,o),t[r]=this.getAsyncProp(r)}for(var a in n){var s=n[a];this._createAsyncPropData(a,i[a]),this._updateAsyncProp(a,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var n,i=null===(n=this.layer)||void 0===n?void 0:n.props.fetch;i&&(t=i(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(xS(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.resolvedValue&&t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];t=this._postProcessValue(n,t),n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){var o;t=n._postProcessValue(i,t),n._setAsyncPropValue(e,t,r);var a=null===(o=n.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(t,{propName:e,layer:n.layer})}).catch(function(t){var i;null===(i=n.layer)||void 0===i||i.raiseError(t,"loading ".concat(e," of ").concat(n.layer))})}},{key:"_resolveAsyncIterable",value:function(e,t){var n=this;return Sx(regeneratorRuntime.mark(function i(){var r,o,a,s,u,c,l,h,f,d,p,v,g,m,y;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:"data"!==e&&n._setPropValue(e,t),(o=n.asyncProps[e]).pendingLoadCount++,a=o.pendingLoadCount,s=[],u=0,l=!0,h=!1,i.prev=6,p=wT(t);case 8:return i.next=10,p.next();case 10:return l=(f=i.sent).done,i.next=13,f.value;case 13:if(d=i.sent,l){i.next=20;break}v=d,g=n.component?n.component.props:{},m=g.dataTransform,s=m?m(v,s):s.concat(v),Object.defineProperty(s,"__diff",{enumerable:!1,value:[{startRow:u,endRow:s.length}]}),u=s.length,n._setAsyncPropValue(e,s,a);case 17:l=!0,i.next=8;break;case 20:i.next=25;break;case 22:i.prev=22,i.t0=i.catch(6),h=!0,c=i.t0;case 25:if(i.prev=25,i.prev=26,i.t1=!l&&null!=p.return,!i.t1){i.next=31;break}return i.next=31,p.return();case 31:if(i.prev=31,!h){i.next=34;break}throw c;case 34:return i.finish(31);case 35:return i.finish(25);case 36:(y=null===(r=n.layer)||void 0===r?void 0:r.props.onDataLoad)&&y(s,{propName:e,layer:n.layer});case 38:case"end":return i.stop()}},i,null,[[6,22,25,36],[26,,31,35]])}))()}},{key:"_postProcessValue",value:function(e,t){var n=e.type;return n&&(n.release&&n.release(e.resolvedValue,n,this.component),n.transform)?n.transform(t,n,this.component):t}},{key:"_createAsyncPropData",value:function(e,t){if(!this.asyncProps[e]){var n=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:n&&n[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}]),e}(),OT=HC.ASYNC_ORIGINAL,TT=HC.ASYNC_RESOLVED,AT=HC.ASYNC_DEFAULTS,PT={},MT=0,IT=function(){var e=function(){function e(){m(this,e),this.props=gT.apply(this,arguments),this.id=this.props.id,this.count=MT++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}return b(e,[{key:"clone",value:function(e){var t=this.props,n={};for(var i in t[AT])i in t[TT]?n[i]=t[TT][i]:i in t[OT]&&(n[i]=t[OT][i]);return new this.constructor(M(M(M({},t),n),e))}},{key:"stats",get:function(){return this.internalState.stats}},{key:"_initState",value:function(){this.internalState=new CT({})}}]),e}();return e.componentName="Component",e.defaultProps=PT,e}(),RT=function(e){a(n,e);var t=s(n);function n(e){var i,r=e.attributeManager,o=e.layer;return m(this,n),(i=t.call(this,o)).attributeManager=r,i.model=null,i.needsRedraw=!0,i.subLayers=null,i.usesPickingColorCache=!1,i}return b(n,[{key:"layer",get:function(){return this.component},set:function(e){this.component=e}}]),n}(CT),DT=function(e){return"function"==typeof e},NT=function(e){return null!==e&&"object"==typeof e},LT=function(e){return NT(e)&&e.constructor==={}.constructor},jT=function(e){return e&&"function"==typeof e[Symbol.iterator]},FT=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},BT=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},VT=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},zT=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||NT(e)&&DT(e.tee)&&DT(e.cancel)&&DT(e.getReader)}(e)||function(e){return NT(e)&&DT(e.read)&&DT(e.pipe)&&function(e){return"boolean"==typeof e}(e.readable)}(e)};function UT(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function HT(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function GT(e){var t,n,i;return UT(e,"null loader"),UT(HT(e),"invalid loader"),Array.isArray(e)&&(i=e[1],e=I(M({},e=e[0]),{options:M(M({},e.options),i)})),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(n=e)&&void 0!==n&&n.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var WT={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},qT=WT.global||WT.self||WT.window||{},XT="object"!=typeof process||"[object process]"!==String(process)||process.browser,KT="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);KT&&parseFloat(KT[1]);var QT={};function $T(e){for(var t in QT)e.startsWith(t)&&(e=e.replace(t,QT[t]));return!e.startsWith("http://")&&!e.startsWith("https://")&&(e="".concat(e)),e}var ZT=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,JT=/^([-\w.]+\/[-\w.+]+)/;function eA(e){var t=JT.exec(e);return t?t[1]:e}function tA(e){var t=ZT.exec(e);return t?t[1]:""}var nA=/\?.*/;function iA(e){if(BT(e)){var t=oA(e.url||"");return{url:t,type:eA(e.headers.get("content-type")||"")||tA(t)}}return VT(e)?{url:oA(e.name||""),type:e.type||""}:"string"==typeof e?{url:oA(e),type:tA(e)}:{url:"",type:""}}function rA(e){return BT(e)?e.headers["content-length"]||-1:VT(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}function oA(e){return e.replace(nA,"")}function aA(e){return sA.apply(this,arguments)}function sA(){return(sA=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!BT(t)){e.next=2;break}return e.abrupt("return",t);case 2:return n={},(i=rA(t))>=0&&(n["content-length"]=String(i)),r=iA(t),o=r.url,(a=r.type)&&(n["content-type"]=a),e.next=8,fA(t);case 8:return(s=e.sent)&&(n["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t)),u=new Response(t,{headers:n}),e.abrupt("return",(Object.defineProperty(u,"url",{value:o}),u));case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function uA(e){return cA.apply(this,arguments)}function cA(){return(cA=Sx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,lA(t);case 3:throw n=e.sent,new Error(n);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function lA(e){return hA.apply(this,arguments)}function hA(){return(hA=Sx(regeneratorRuntime.mark(function e(t){var n,i,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),e.prev=1,i=t.headers.get("Content-Type"),r=t.statusText,e.t0=i.includes("application/json"),!e.t0){e.next=12;break}return e.t1=r,e.t2=" ",e.next=10,t.text();case 10:e.t3=e.sent,r=e.t1+=e.t2.concat.call(e.t2,e.t3);case 12:n=(n+=r).length>60?"".concat(n.slice(60),"..."):n,e.next=18;break;case 16:e.prev=16,e.t4=e.catch(1);case 18:return e.abrupt("return",n);case 19:case"end":return e.stop()}},e,null,[[1,16]])}))).apply(this,arguments)}function fA(e){return dA.apply(this,arguments)}function dA(){return(dA=Sx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=2;break}return e.abrupt("return","data:,".concat(t.slice(0,5)));case 2:if(!(t instanceof Blob)){e.next=7;break}return n=t.slice(0,5),e.next=6,new Promise(function(e){var t=new FileReader;t.onload=function(t){var n;return e(null==t||null===(n=t.target)||void 0===n?void 0:n.result)},t.readAsDataURL(n)});case 6:return e.abrupt("return",e.sent);case 7:return e.abrupt("return",t instanceof ArrayBuffer?"data:base64,".concat(pA(t.slice(0,5))):null);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pA(e){for(var t="",n=new Uint8Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:"3.0.12";return AA(e,"no worker provided"),!(!t||!e.version)}var MA={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},IA=MA.global||MA.self||MA.window||{},RA="object"!=typeof process||"[object process]"!==String(process)||process.browser,DA="function"==typeof importScripts,NA="undefined"!=typeof window&&void 0!==window.orientation,LA="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),jA=(LA&&parseFloat(LA[1]),new Map);function FA(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function BA(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||new Set;if(e)if(VA(e))i.add(e);else if(VA(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)&&t&&"object"==typeof e)for(var r in e)BA(e[r],t,i);return void 0===n?Array.from(i):[]}function VA(e){return!!e&&(e instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&e instanceof MessagePort||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)}var zA=function(){},UA=function(){function e(t){m(this,e),mA(this,"name",void 0),mA(this,"source",void 0),mA(this,"url",void 0),mA(this,"terminated",!1),mA(this,"worker",void 0),mA(this,"onMessage",void 0),mA(this,"onError",void 0),mA(this,"_loadableURL","");var n=t.name,i=t.source,r=t.url;AA(i||r),this.name=n,this.source=i,this.url=r,this.onMessage=zA,this.onError=function(e){return console.log(e)},this.worker=this._createBrowserWorker()}return b(e,[{key:"destroy",value:function(){this.onMessage=zA,this.onError=zA,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||BA(e),this.worker.postMessage(e,t)}},{key:"_getErrorFromErrorEvent",value:function(e){var t="Failed to load ";return t+="worker ".concat(this.name,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=function(e){AA(e.source&&!e.url||!e.source&&e.url);var t=jA.get(e.source||e.url);return t||(e.url&&(t=function(e){return e.startsWith("http")?FA(function(e){return"try {\n importScripts('".concat(e,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")}(e)):e}(e.url),jA.set(e.url,t)),e.source&&(t=FA(e.source),jA.set(e.source,t))),AA(t),t}({source:this.source,url:this.url});var t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=function(t){t.data?e.onMessage(t.data):e.onError(new Error("No data received"))},t.onerror=function(t){e.onError(e._getErrorFromErrorEvent(t)),e.terminated=!0},t.onmessageerror=function(e){return console.error(e)},t}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker}}]),e}(),HA=function(){function e(t,n){var i=this;m(this,e),mA(this,"name",void 0),mA(this,"workerThread",void 0),mA(this,"isRunning",void 0),mA(this,"result",void 0),mA(this,"_resolve",void 0),mA(this,"_reject",void 0),this.name=t,this.workerThread=n,this.isRunning=!0,this._resolve=function(){},this._reject=function(){},this.result=new Promise(function(e,t){i._resolve=e,i._reject=t})}return b(e,[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){AA(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){AA(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}(),GA=function(){function e(t){m(this,e),mA(this,"name","unnamed"),mA(this,"source",void 0),mA(this,"url",void 0),mA(this,"maxConcurrency",1),mA(this,"maxMobileConcurrency",1),mA(this,"onDebug",function(){}),mA(this,"reuseWorkers",!0),mA(this,"props",{}),mA(this,"jobQueue",[]),mA(this,"idleQueue",[]),mA(this,"count",0),mA(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}return b(e,[{key:"destroy",value:function(){this.idleQueue.forEach(function(e){return e.destroy()}),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=M(M({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}},{key:"startJob",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t,n){return e.done(n)},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e,t){return e.error(t)},i=this;return Sx(regeneratorRuntime.mark(function r(){var o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return o=new Promise(function(r){return i.jobQueue.push({name:e,onMessage:t,onError:n,onStart:r}),i}),i._startQueuedJob(),r.next=4,o;case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}},r)}))()}},{key:"_startQueuedJob",value:function(){var e=this;return Sx(regeneratorRuntime.mark(function t(){var n,i,r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.jobQueue.length){t.next=2;break}return t.abrupt("return");case 2:if(n=e._getAvailableWorker()){t.next=5;break}return t.abrupt("return");case 5:if(!(i=e.jobQueue.shift())){t.next=16;break}return e.onDebug({message:"Starting job",name:i.name,workerThread:n,backlog:e.jobQueue.length}),r=new HA(i.name,n),n.onMessage=function(e){return i.onMessage(r,e.type,e.payload)},n.onError=function(e){return i.onError(r,e)},i.onStart(r),t.prev=10,t.next=13,r.result;case 13:return t.prev=13,e.returnWorkerToQueue(n),t.finish(13);case 16:case"end":return t.stop()}},t,null,[[10,,13,16]])}))()}},{key:"returnWorkerToQueue",value:function(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count0&&void 0!==arguments[0]?arguments[0]:{};return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}}]),e}();function XA(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="".concat(e.id,"-worker.js"),i=(t[e.id]||{}).workerUrl;if("test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){var r=e.version;"latest"===r&&(r="latest"),i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(r?"@".concat(r):"","/dist/").concat(n)}return AA(i),i}function YA(e,t){return!!qA.isSupported()&&e.worker&&(null==t?void 0:t.worker)}function KA(e,t,n,i,r){return QA.apply(this,arguments)}function QA(){return(QA=Sx(regeneratorRuntime.mark(function e(t,n,i,r,o){var a,s,u,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.id,s=XA(t,i),u=qA.getWorkerFarm(i).getWorkerPool({name:a,url:s}),i=JSON.parse(JSON.stringify(i)),e.next=4,u.startJob("process-on-worker",$A.bind(null,o));case 4:return(c=e.sent).postMessage("process",{input:n,options:i}),e.next=8,c.result;case 8:return e.next=10,e.sent.result;case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $A(e,t,n,i){return ZA.apply(this,arguments)}function ZA(){return(ZA=Sx(regeneratorRuntime.mark(function e(t,n,i,r){var o,a,s,u,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=i,e.next="done"===e.t0?3:"error"===e.t0?5:"process"===e.t0?7:20;break;case 3:return n.done(r),e.abrupt("break",21);case 5:return n.error(r.error),e.abrupt("break",21);case 7:return o=r.id,a=r.input,s=r.options,e.prev=8,e.next=11,t(a,s);case 11:u=e.sent,n.postMessage("done",{id:o,result:u}),e.next=19;break;case 15:e.prev=15,e.t1=e.catch(8),c=e.t1 instanceof Error?e.t1.message:"unknown error",n.postMessage("error",{id:o,error:c});case 19:return e.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(i));case 21:case"end":return e.stop()}},e,null,[[8,15]])}))).apply(this,arguments)}mA(qA,"_workerFarm",void 0);var JA=r(9521);function eP(e){if(function(e){return e&&"object"==typeof e&&e.isBuffer}(e)&&(e=function(e){return JA.toArrayBuffer?JA.toArrayBuffer(e):e}(e)),e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){var t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function tP(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==c[1]?c[1]:{},i=n.chunkSize,r=void 0===i?oP:i,o=0;case 3:if(!(o2&&void 0!==arguments[2]?arguments[2]:null;if(n)return n;var i=M({fetch:EA(t,e)},e);return Array.isArray(i.loaders)||(i.loaders=null),i}function _P(e,t){if(!t&&e&&!Array.isArray(e))return e;var n;if(e&&(n=Array.isArray(e)?e:[e]),t&&t.loaders){var i=Array.isArray(t.loaders)?t.loaders:[t.loaders];n=n?[].concat(v(n),v(i)):i}return n&&n.length?n:null}var wP=function(){var e=kA();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function kP(e){var t,n=wP(),i=_(e=Array.isArray(e)?e:[e]);try{var r=function(){var e=GT(t.value);n.find(function(t){return e===t})||n.unshift(e)};for(i.s();!(t=i.n()).done;)r()}catch(o){i.e(o)}finally{i.f()}}var xP=/\.([^.]+)$/;function SP(e){return EP.apply(this,arguments)}function EP(){return(EP=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]?a[1]:[],i=a.length>2?a[2]:void 0,r=a.length>3?a[3]:void 0,OP(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(o=CP(t,n,I(M({},i),{nothrow:!0}),r))){e.next=8;break}return e.abrupt("return",o);case 8:if(e.t0=VT(t),!e.t0){e.next=18;break}return e.t1=CP,e.next=13,t.slice(0,10).arrayBuffer();case 13:e.t2=t=e.sent,e.t3=n,e.t4=i,e.t5=r,o=(0,e.t1)(e.t2,e.t3,e.t4,e.t5);case 18:if(o||null!=i&&i.nothrow){e.next=20;break}throw new Error(TP(t));case 20:return e.abrupt("return",o);case 21:case"end":return e.stop()}},e)}))).apply(this,arguments)}function CP(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!OP(e))return null;if(n&&!Array.isArray(n))return GT(n);var o=[];n&&(o=o.concat(n)),null!=i&&i.ignoreRegisteredLoaders||(t=o).push.apply(t,v(wP())),function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){GT(t.value)}}catch(i){n.e(i)}finally{n.f()}}(o);var a=function(e,t,n,i){var r=iA(e),o=r.url,a=r.type,s=o||(null==i?void 0:i.url),u=null;return null!=n&&n.mimeType&&(u=AP(t,null==n?void 0:n.mimeType)),u=(u=(u=(u=u||function(e,t){var n=t&&xP.exec(t),i=n&&n[1];return i?function(e,t){t=t.toLowerCase();var n,i=_(e);try{for(i.s();!(n=i.n()).done;){var r,o=n.value,a=_(o.extensions);try{for(a.s();!(r=a.n()).done;){if(r.value.toLowerCase()===t)return o}}catch(s){a.e(s)}finally{a.f()}}}catch(s){i.e(s)}finally{i.f()}return null}(e,i):null}(t,s))||AP(t,a))||function(e,t){if(!t)return null;var n,i=_(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;if("string"==typeof t){if(PP(t,r))return r}else if(ArrayBuffer.isView(t)){if(MP(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&MP(t,0,r))return r}}catch(o){i.e(o)}finally{i.f()}return null}(t,e))||AP(t,null==n?void 0:n.fallbackMimeType)}(e,o,i,r);if(!(a||null!=i&&i.nothrow))throw new Error(TP(e));return a}function OP(e){return!(e instanceof Response&&204===e.status)}function TP(e){var t=iA(e),n=t.url,i=t.type,r="No valid loader found";return e&&(r+=' data: "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return"string"==typeof e?e.slice(0,t):ArrayBuffer.isView(e)?IP(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?IP(e,0,t):""}(e),'", contentType: "').concat(i,'"')),n&&(r+=" url: ".concat(n)),r}function AP(e,t){var n,i=_(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.mimeTypes&&r.mimeTypes.includes(t)||t==="application/x.".concat(r.id))return r}}catch(o){i.e(o)}finally{i.f()}return null}function PP(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(function(t){return e.startsWith(t)})}function MP(e,t,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(function(i){return function(e,t,n,i){if(i instanceof ArrayBuffer)return function(e,t,n){if(e.byteLength<(n=n||e.byteLength)||t.byteLength0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}},{key:"hasUniformTransition",value:function(){return this.internalState.uniformTransitions.active}},{key:"isLoaded",get:function(){return this.internalState&&!this.internalState.isAsyncPropLoading()}},{key:"wrapLongitude",get:function(){return this.props.wrapLongitude}},{key:"isPickable",value:function(){return this.props.pickable&&this.props.visible}},{key:"getModels",value:function(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getLoadOptions",value:function(){return this.props.loadOptions}},{key:"project",value:function(e){var n=this.context.viewport,i=t(HO(iT(e,{viewport:n,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),n.pixelProjectionMatrix),3),r=i[0],o=i[1],a=i[2];return 2===e.length?[r,o]:[r,o,a]}},{key:"unproject",value:function(e){return this.context.viewport.unproject(e)}},{key:"projectPosition",value:function(e){return function(e,t){var n=function(e){var t=M({},e),n=e.coordinateSystem,i=e.coordinateOrigin,r=e.fromCoordinateSystem,o=e.fromCoordinateOrigin;return n===Uw.DEFAULT&&(n=e.viewport.isGeospatial?Uw.LNGLAT:Uw.CARTESIAN),void 0===r&&(t.fromCoordinateSystem=n),void 0===o&&(t.fromCoordinateOrigin=i),t.coordinateSystem=n,t}(t),i=n.viewport,r=n.coordinateSystem,o=n.coordinateOrigin,a=n.modelMatrix,s=n.fromCoordinateSystem,u=n.fromCoordinateOrigin,c=gO(i,r,o),l=c.geospatialOrigin,h=c.shaderCoordinateOrigin,f=c.offsetMode,d=iT(e,{viewport:i,modelMatrix:a,coordinateSystem:s,coordinateOrigin:u,offsetMode:f});return f&&function(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2]}(d,d,i.projectPosition(l||h)),d}(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"use64bitPositions",value:function(){var e=this.props.coordinateSystem;return e===Uw.DEFAULT||e===Uw.LNGLAT||e===Uw.CARTESIAN}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){bS(e instanceof Uint8Array);var n=t(e,3);return n[0]+256*n[1]+65536*n[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t,n=_(this.props.extensions);try{for(n.s();!(t=n.n()).done;){var i=t.value;e=JC(e,i.getShaders.call(this,i))}}catch(r){n.e(r)}finally{n.f()}return e}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=this.getAttributeManager();if(i.dataChanged&&r){var o=i.dataChanged;if(Array.isArray(o)){var a,s=_(o);try{for(s.s();!(a=s.n()).done;){var u=a.value;r.invalidateAll(u)}}catch(p){s.e(p)}finally{s.f()}}else r.invalidateAll()}var c=n.highlightedObjectIndex>=0||n.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==c&&r){var l=r.attributes,h=l.pickingColors,f=l.instancePickingColors,d=h||f;d&&(c&&d.constant&&(d.constant=!1,r.invalidate(d.id)),!d.value&&!c&&(d.constant=!0,d.value=[0,0,0]))}}},{key:"finalizeState",value:function(){var e,t=_(this.getModels());try{for(t.s();!(e=t.n()).done;){e.value.delete()}}catch(i){t.e(i)}finally{t.f()}var n=this.getAttributeManager();n&&n.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}},{key:"draw",value:function(e){var t,n=_(this.getModels());try{for(n.s();!(t=n.n()).done;){t.value.draw(e)}}catch(i){n.e(i)}finally{n.f()}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.index;return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"activateViewport",value:function(e){var t=this.internalState.viewport;this.internalState.viewport=e,(!t||!zP({oldViewport:t,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=this.getAttributeManager();!t||("all"===e?t.invalidateAll():t.invalidate(e))}},{key:"updateAttributes",value:function(e){var t,n=_(this.getModels());try{for(n.s();!(t=n.n()).done;){var i=t.value;this._setModelAttributes(i,e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"_updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getStartIndices(e);t.update({data:e.data,numInstances:n,startIndices:i,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this,ignoreUnknownAttributes:!0});var r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}}},{key:"_updateAttributeTransition",value:function(){var e=this.getAttributeManager();e&&e.updateTransition()}},{key:"_updateUniformTransition",value:function(){var e=this.internalState.uniformTransitions;if(e.active){var t=e.update(),n=Object.create(this.props);for(var i in t)Object.defineProperty(n,i,{value:t[i]});return n}return this.props}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.numInstances;if(!e.constant){var i=Math.floor(UP.length/3);if(this.internalState.usesPickingColorCache=!0,iBP&&zw.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),UP=Fx.allocate(UP,n,{size:3,copy:!0,maxCount:Math.max(n,BP)});for(var r=Math.floor(UP.length/3),o=[],a=i;a=0?this.encodePickingColor(o):null),this.setModuleParameters(s)}}},{key:"_getUpdateParams",value:function(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}},{key:"_getNeedsRedraw",value:function(e){if(!this.internalState)return!1;var t=!1;t=t||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags;var n=this.getAttributeManager(),i=n&&n.getNeedsRedraw(e);return t=t||i}},{key:"_getAttributeManager",value:function(){return new FC(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}},{key:"_initState",value:function(){bS(!this.internalState&&!this.state),bS(isFinite(this.props.coordinateSystem));var e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new RT({attributeManager:e,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:function(){return zw.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),e}}),this.internalState.layer=this,this.internalState.uniformTransitions=new UC(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}},{key:"_transferState",value:function(e){BS("layer.matched",this,this===e);var t=e.state,n=e.internalState;this!==e&&(this.internalState=n,this.internalState.layer=this,this.state=t,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}},{key:"_onAsyncPropUpdated",value:function(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}]),i}(IT);return e.layerName="Layer",e.defaultProps=HP,e}(),WP=function(){var t=function(t){a(i,t);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"isComposite",get:function(){return!0}},{key:"isLoaded",get:function(){return e(p(i.prototype),"isLoaded",this)&&this.getSubLayers().every(function(e){return e.isLoaded})}},{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(t){e(p(i.prototype),"setState",this).call(this,t),this.setNeedsUpdate()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id&&(t.object=n.__source.object,t.index=n.__source.index),t}},{key:"renderLayers",value:function(){return null}},{key:"filterSubLayer",value:function(e){return!0}},{key:"shouldRenderSubLayer",value:function(e,t){return t&&t.length}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerRow",value:function(e,t,n){return e.__source={parent:this,object:t,index:n},e}},{key:"getSubLayerAccessor",value:function(e){if("function"==typeof e){var t={data:this.props.data,target:[]};return function(n,i){return n&&n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,i)}}return e}},{key:"getSubLayerProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.opacity,i=t.pickable,r=t.visible,o=t.parameters,a=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,h=t.coordinateOrigin,f=t.wrapLongitude,d=t.positionFormat,p=t.modelMatrix,v=t.extensions,g=t.fetch,m=t._subLayerProps,y={opacity:n,pickable:i,visible:r,parameters:o,getPolygonOffset:a,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:h,wrapLongitude:f,positionFormat:d,modelMatrix:p,extensions:v,fetch:g},b=m&&m[e.id],w=b&&b.updateTriggers,k=e.id||"sublayer";if(b){var x=this.constructor._propTypes,S=e.type?e.type._propTypes:{};for(var E in b){var C=S[E]||x[E];C&&"accessor"===C.type&&(b[E]=this.getSubLayerAccessor(b[E]))}}Object.assign(y,e,b),y.id="".concat(this.props.id,"-").concat(k),y.updateTriggers=M(M({all:this.props.updateTriggers.all},e.updateTriggers),w);var O,T=_(v);try{for(T.s();!(O=T.n()).done;){var A=O.value,P=A.getSubLayerProps.call(this,A);P&&Object.assign(y,P,{updateTriggers:Object.assign(y.updateTriggers,P.updateTriggers)})}}catch(I){T.e(I)}finally{T.f()}return y}},{key:"_updateAutoHighlight",value:function(e){var t,n=_(this.getSubLayers());try{for(n.s();!(t=n.n()).done;){t.value.updateAutoHighlight(e)}}catch(i){n.e(i)}finally{n.f()}}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers,t=!e||this.needsUpdate();t&&(e=SS(e=this.renderLayers(),Boolean),this.internalState.subLayers=e),BS("compositeLayer.renderLayers",this,t,e);var n,i=_(e);try{for(i.s();!(n=i.n()).done;){n.value.parent=this}}catch(r){i.e(r)}finally{i.f()}}}]),i}(GP);return t.layerName="CompositeLayer",t}(),qP=/([0-9]+\.?[0-9]*)(%|px)/;function XP(e){switch(typeof e){case"number":return{position:e,relative:!1};case"string":var t=e.match(qP);if(t&&t.length>=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function YP(e,t){return e.relative?Math.round(e.position*t):e.position}function KP(e,t){if(e===t)return!0;if(!e||!t)return!1;for(var n in e){var i=e[n],r=t[n];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&KP(i,r)))return!1}return!0}var QP=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,o=void 0===r?0:r,a=t.y,s=void 0===a?0:a,u=t.width,c=void 0===u?"100%":u,l=t.height,h=void 0===l?"100%":l,f=t.projectionMatrix,d=void 0===f?null:f,p=t.fovy,v=void 0===p?50:p,g=t.near,y=void 0===g?.1:g,b=t.far,_=void 0===b?1e3:b,w=t.modelMatrix,k=void 0===w?null:w,x=t.viewportInstance,S=void 0===x?null:x,E=t.type,C=void 0===E?eT:E;bS(!S||S instanceof eT),this.viewportInstance=S,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=I(M({},t),{id:this.id,projectionMatrix:d,fovy:v,near:y,far:_,modelMatrix:k}),this._parseDimensions({x:o,y:s,width:c,height:h}),this.equals=this.equals.bind(this),Object.seal(this)}return b(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):KP(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n});return this._getViewport(i,r)}},{key:"getViewStateId",value:function(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;var t=M({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:YP(this._x,t),y:YP(this._y,n),width:YP(this._width,t),height:YP(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),M(M({},e),t)):null}},{key:"_getViewport",value:function(e,t){return new(0,this.type)(M(M(M({},e),this.props),t))}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=XP(t),this._y=XP(n),this._width=XP(i),this._height=XP(r)}}]),e}(),$P=function(){},ZP={transitionEasing:function(e){return e},transitionInterruption:1,onTransitionStart:$P,onTransitionInterrupt:$P,onTransitionEnd:$P},JP=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.ControllerState=t,this.props=M(M({},ZP),n),this.propsInTransition=null,this.transition=new DC(n.timeline),this.onViewStateChange=n.onViewStateChange||$P,this.onStateChange=n.onStateChange||$P,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return b(e,[{key:"finalize",value:function(){this.transition.cancel()}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=M(M({},ZP),e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=this.transition.settings,r=i.interruption,o=i.endProps,a=M(M({},n),2===r?o:this.propsInTransition||n);this._triggerTransition(a,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(){this.transition.update()}},{key:"_isTransitionEnabled",value:function(e){var t=e.transitionDuration,n=e.transitionInterpolator;return(t>0||"auto"===t)&&Boolean(n)}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator,o=r.getDuration?r.getDuration(e,t):t.transitionDuration;if(0!==o){var a=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,t.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.time,n=e.settings,i=n.interpolator,r=n.startProps,o=n.endProps,a=n.duration,s=(0,n.easing)(t/a),u=i.interpolateProps(r,o,s);this.propsInTransition=new this.ControllerState(M(M({},this.props),u)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}]),e}(),eM=["longitude","latitude","zoom","bearing","pitch"],tM=["longitude","latitude","zoom"],nM=function(t){a(i,t);var n=s(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m(this,i),(e=n.call(this,(Array.isArray(t)?t:t.transitionProps)||{compare:eM,extract:eM,required:tM})).opts=t,e}return b(i,[{key:"initializeProps",value:function(t,n){var r=e(p(i.prototype),"initializeProps",this).call(this,t,n),o=this.opts,a=o.makeViewport,s=o.around;if(a&&s){var u=a(t),c=a(n),l=u.unproject(s);r.start.around=s,Object.assign(r.end,{around:c.project(l),aroundPosition:l,width:n.width,height:n.height})}return r}},{key:"interpolateProps",value:function(e,t,n){var i,r={},o=_(this._propsToExtract);try{for(o.s();!(i=o.n()).done;){var a=i.value;r[a]=qx(e[a]||0,t[a]||0,n)}}catch(u){o.e(u)}finally{o.f()}if(t.aroundPosition){var s=this.opts.makeViewport(M(M({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,qx(e.around,t.around,n)))}return r}}]),i}(function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,r=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=r,this._requiredProps=o}return b(e,[{key:"arePropsEqual",value:function(e,t){var n,i=_(this._propsToCompare||Object.keys(t));try{for(i.s();!(n=i.n()).done;){var r=n.value;if(!(r in e)||!(r in t)||!Xx(e[r],t[r]))return!1}}catch(o){i.e(o)}finally{i.f()}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i,r={},o={},a=_(this._propsToExtract);try{for(a.s();!(i=a.n()).done;){var s=i.value;r[s]=e[s],o[s]=t[s]}}catch(u){a.e(u)}finally{a.f()}n={start:r,end:o}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){return t}},{key:"getDuration",value:function(e,t){return t.transitionDuration}},{key:"_checkRequiredProps",value:function(e){!this._requiredProps||this._requiredProps.forEach(function(t){var n=e[t];bS(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()),iM={transitionDuration:0},rM={transitionDuration:300,transitionEasing:function(e){return e},transitionInterruption:1},oM=function(e){return 1-(1-e)*(1-e)},aM=["wheel"],sM=["panstart","panmove","panend"],uM=["pinchstart","pinchmove","pinchend"],cM=["tripanstart","tripanmove","tripanend"],lM=["doubletap"],hM=["keydown"],fM=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new JP(t,I(M({},n),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));var i=this.linearTransitionProps;this._transition=i&&I(M({},rM),{transitionInterpolator:new nM({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return b(e,[{key:"linearTransitionProps",get:function(){return null}},{key:"events",set:function(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}},{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;this.controllerState=new t(M(M({makeViewport:this.makeViewport},this.controllerStateProps),this._state));var n=this._eventStartBlocked;switch(e.type){case"panstart":return!n&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!n&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!n&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var o=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return o&&t&&t.stopPropagation(),o}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._interactionState.isDragging}},{key:"blockEvents",value:function(e){var t=this,n=setTimeout(function(){t._eventStartBlocked===n&&(t._eventStartBlocked=null)},e);this._eventStartBlocked=n}},{key:"setProps",value:function(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);var t=e.inertia;!0===t&&(t=300),this.inertia=t;var n=e.scrollZoom,i=void 0===n||n,r=e.dragPan,o=void 0===r||r,a=e.dragRotate,s=void 0===a||a,u=e.doubleClickZoom,c=void 0===u||u,l=e.touchZoom,h=void 0===l||l,f=e.touchRotate,d=void 0!==f&&f,p=e.keyboard,v=void 0===p||p,g=Boolean(this.onViewStateChange);this.toggleEvents(aM,g&&i),this.toggleEvents(sM,g&&(o||s)),this.toggleEvents(uM,g&&(h||d)),this.toggleEvents(cM,g&&d),this.toggleEvents(lM,g&&c),this.toggleEvents(hM,g&&v),this.scrollZoom=i,this.dragPan=o,this.dragRotate=s,this.doubleClickZoom=c,this.touchZoom=h,this.touchRotate=d,this.keyboard=v}},{key:"updateTransition",value:function(){this.transitionManager.updateTransition()}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=M(M({},e.getViewportProps()),t),r=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(n),r){var o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:o})}}},{key:"_onTransition",value:function(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}},{key:"_setInteractionState",value:function(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(n=!n);var i=this.controllerState[n?"panStart":"rotateStart"]({pos:t});return this._panMove=n,this.updateViewport(i,iM,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}},{key:"_onPanEnd",value:function(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,iM,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(e){var t=this.inertia;if(this.dragPan&&t&&e.velocity){var n=this.getCenter(e),i=this.controllerState.pan({pos:[n[0]+e.velocityX*t/2,n[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(i,I(M({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:oM}),{isDragging:!1,isPanning:!0})}else{var r=this.controllerState.panEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1})}return!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=this.getCenter(e),n=this.controllerState.rotate({pos:t});return this.updateViewport(n,iM,{isDragging:!0,isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(e){var t=this.inertia;if(this.dragRotate&&t&&e.velocity){var n=this.getCenter(e),i=this.controllerState.rotate({pos:[n[0]+e.velocityX*t/2,n[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(i,I(M({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:oM}),{isDragging:!1,isRotating:!0})}else{var r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.scrollZoom,i=n.speed,r=void 0===i?.01:i,o=n.smooth,a=void 0!==o&&o,s=e.delta,u=2/(1+Math.exp(-Math.abs(s*r)));s<0&&0!==u&&(u=1/u);var c=this.controllerState.zoom({pos:t,scale:u});return this.updateViewport(c,I(M({},this._getTransitionProps({around:t})),{transitionDuration:a?250:1}),{isZooming:!0,isPanning:!0}),!0}},{key:"_onTriplePanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.rotateStart({pos:t});return this.updateViewport(n,iM,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(e){if(!this.touchRotate||!this.isDragging())return!1;var t=this.getCenter(e);t[0]-=e.deltaX;var n=this.controllerState.rotate({pos:t});return this.updateViewport(n,iM,{isDragging:!0,isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(e){if(!this.isDragging())return!1;var t=this.inertia;if(this.touchRotate&&t&&e.velocityY){var n=this.getCenter(e),i=[n[0],n[1]+=e.velocityY*t/2],r=this.controllerState.rotate({pos:i});this.updateViewport(r,I(M({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:oM}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{var o=this.controllerState.rotateEnd();this.updateViewport(o,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(n,iM,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation;t=t.rotate({deltaAngleX:this._startPinchRotation-r})}return this.updateViewport(t,iM,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}},{key:"_onPinchEnd",value:function(e){if(!this.isDragging())return!1;var t=this.inertia,n=this._lastPinchEvent;if(this.touchZoom&&t&&n&&e.scale!==n.scale){var i=this.getCenter(e),r=this.controllerState.rotateEnd(),o=Math.log2(e.scale),a=(o-Math.log2(n.scale))/(e.deltaTime-n.deltaTime),s=Math.pow(2,o+a*t/2);r=r.zoom({pos:i,scale:s}).zoomEnd(),this.updateViewport(r,I(M({},this._getTransitionProps({around:i})),{transitionDuration:t,transitionEasing:oM}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{var u=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(u,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.keyboard,r=i.zoomSpeed,o=i.moveSpeed,a=i.rotateSpeedX,s=i.rotateSpeedY,u=this.controllerState,c={};switch(e.srcEvent.code){case"Minus":t=n?u.zoomOut(r).zoomOut(r):u.zoomOut(r),c.isZooming=!0;break;case"Equal":t=n?u.zoomIn(r).zoomIn(r):u.zoomIn(r),c.isZooming=!0;break;case"ArrowLeft":n?(t=u.rotateLeft(a),c.isRotating=!0):(t=u.moveLeft(o),c.isPanning=!0);break;case"ArrowRight":n?(t=u.rotateRight(a),c.isRotating=!0):(t=u.moveRight(o),c.isPanning=!0);break;case"ArrowUp":n?(t=u.rotateUp(s),c.isRotating=!0):(t=u.moveUp(o),c.isPanning=!0);break;case"ArrowDown":n?(t=u.rotateDown(s),c.isRotating=!0):(t=u.moveDown(o),c.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),c),!0}},{key:"_getTransitionProps",value:function(e){var t=this._transition;return t?e?I(M({},t),{transitionInterpolator:new nM(I(M({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:iM}}]),e}(),dM=function(){function e(t){m(this,e),this._viewportProps=this._applyConstraints(t)}return b(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}(),pM=[0,0,0],vM=function(e){a(n,e);var t=s(n);function n(e){var i,r=e.makeViewport,o=e.width,a=e.height,s=e.rotationX,u=void 0===s?0:s,c=e.rotationOrbit,l=void 0===c?0:c,h=e.target,f=void 0===h?pM:h,d=e.zoom,p=void 0===d?0:d,v=e.minRotationX,g=void 0===v?-90:v,y=e.maxRotationX,b=void 0===y?90:y,_=e.minZoom,w=void 0===_?-1/0:_,k=e.maxZoom,x=void 0===k?1/0:k,S=e.startPanPosition,E=e.startRotatePos,C=e.startRotationX,O=e.startRotationOrbit,T=e.startZoomPosition,A=e.startZoom;return m(this,n),(i=t.call(this,{width:o,height:a,rotationX:u,rotationOrbit:l,target:f,zoom:p,minRotationX:g,maxRotationX:b,minZoom:w,maxZoom:x}))._state={startPanPosition:S,startRotatePos:E,startRotationX:C,startRotationOrbit:O,startZoomPosition:T,startZoom:A},i.makeViewport=r,i}return b(n,[{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanPosition:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPosition,i=this._state.startPanPosition||n;if(!i)return this;var r=this.makeViewport(this._viewportProps).panByPosition(i,t);return this._getUpdatedState(r)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null})}},{key:"rotateStart",value:function(e){var t=e.pos;return this._getUpdatedState({startRotatePos:t,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t,n=e.pos,i=e.deltaAngleX,r=void 0===i?0:i,o=e.deltaAngleY,a=void 0===o?0:o,s=this._state,u=s.startRotatePos,c=s.startRotationX,l=s.startRotationOrbit,h=this._viewportProps,f=h.width,d=h.height;if(!u||!Number.isFinite(c)||!Number.isFinite(l))return this;if(n){var p=(n[0]-u[0])/f;(c<-90||c>90)&&(p*=-1),t={rotationX:c+(n[1]-u[1])/d*180,rotationOrbit:l+180*p}}else t={rotationX:c+a,rotationOrbit:l+r};return this._getUpdatedState(t)}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=M({},this._viewportProps),i=n.rotationOrbit;return Math.abs(i-t.rotationOrbit)>180&&(n.rotationOrbit=i<0?i+360:i-360),n}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps.zoom,o=this._state,a=o.startZoom,s=o.startZoomPosition;Number.isFinite(a)||(a=r,s=this._unproject(n)||this._unproject(t));var u=this._calculateNewZoom({scale:i,startZoom:a}),c=this.makeViewport(I(M({},this._viewportProps),{zoom:u}));return this._getUpdatedState(M({zoom:u},c.panByPosition(s,t)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}},{key:"zoomIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}},{key:"zoomOut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}},{key:"moveLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([-e,0])}},{key:"moveRight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([e,0])}},{key:"moveUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,-e])}},{key:"moveDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,e])}},{key:"rotateLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}},{key:"rotateRight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}},{key:"rotateUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}},{key:"rotateDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}},{key:"_unproject",value:function(e){var t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,o=i.minZoom;return Number.isFinite(n)||(n=this._viewportProps.zoom),Wx(n+Math.log2(t),o,r)}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height,r=t.target;return this.pan({startPosition:r,pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new n(M(M(M({},this._viewportProps),this._state),e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom,r=e.maxRotationX,o=e.minRotationX,a=e.rotationOrbit;return e.zoom=Wx(i,n,t),e.rotationX=Wx(e.rotationX,o,r),(a<-180||a>180)&&(e.rotationOrbit=function(e,t){var n=e%360;return n<0?360+n:n}(a+180)-180),e}}]),n}(dM),gM=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,vM,e)}return b(n,[{key:"linearTransitionProps",get:function(){return["target","zoom","rotationX","rotationOrbit"]}}]),n}(fM),mM=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),e.dragMode=e.dragMode||"pan",t.call(this,vM,e)}return b(n,[{key:"_onPanRotate",value:function(e){return!1}},{key:"linearTransitionProps",get:function(){return["target","zoom"]}}]),n}(fM),yM=(new EO).lookAt({eye:[0,0,1]});function bM(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new EO).ortho({left:-t/2,right:t/2,bottom:-n/2,top:n/2,near:i,far:r})}var _M=function(e){a(n,e);var t=s(n);function n(e){m(this,n);var i=e.width,r=e.height,o=e.near,a=void 0===o?.1:o,s=e.far,u=void 0===s?1e3:s,c=e.zoom,l=void 0===c?0:c,h=e.target,f=void 0===h?[0,0,0]:h,d=e.flipY,p=void 0===d||d,v=Math.pow(2,l);return t.call(this,I(M({},e),{longitude:null,position:f,viewMatrix:yM.clone().scale([v,v*(p?-1:1),v]),projectionMatrix:bM({width:i,height:r,near:a,far:u}),zoom:l}))}return b(n,[{key:"panByPosition",value:function(e,t){var n=yO([],e,bO([],GO(t,this.pixelUnprojectionMatrix)));return{target:yO([],this.center,n)}}}]),n}(eT),wM=function(){var e=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,I(M({},e),{type:_M}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:mM})}}]),n}(QP);return e.displayName="OrthographicView",e}(),kM=Math.PI/180;function xM(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,o=e.rotationOrbit,a=e.zoom,s=.5/Math.tan(n*kM/2),u="Z"===i?[0,0,1]:[0,1,0],c="Z"===i?[0,-s,0]:[0,0,s],l=(new EO).lookAt({eye:c,up:u});l.rotateX(r*kM),"Z"===i?l.rotateZ(o*kM):l.rotateY(o*kM);var h=Math.pow(2,a)/(t||1);return l.scale(h),l}var SM=function(e){a(i,e);var n=s(i);function i(e){var t;m(this,i);var r=e.height,o=e.fovy,a=e.orbitAxis,s=e.target,u=void 0===s?[0,0,0]:s,c=e.rotationX,l=void 0===c?0:c,h=e.rotationOrbit,f=void 0===h?0:h,d=e.zoom,p=void 0===d?0:d;return(t=n.call(this,I(M({},e),{longitude:null,viewMatrix:xM({height:r,fovy:o,orbitAxis:a,rotationX:l,rotationOrbit:f,zoom:p}),fovy:o,position:u,zoom:p}))).projectedCenter=t.project(t.center),t}return b(i,[{key:"unproject",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=t(e,3),a=o[0],s=o[1],u=o[2],c=void 0===u?this.projectedCenter[2]:u,l=r?s:this.height-s,h=GO([a,l,c],this.pixelUnprojectionMatrix),f=t(h,3),d=f[0],p=f[1],v=f[2];return[d,p,v]}},{key:"panByPosition",value:function(e,t){var n=this.project(e);return{target:this.unproject([this.width/2+n[0]-t[0],this.height/2+n[1]-t[1],this.projectedCenter[2]])}}}]),i}(eT),EM=function(){var e=function(e){a(n,e);var t=s(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var i=e.orbitAxis,r=void 0===i?"Z":i;return t.call(this,I(M({},e),{orbitAxis:r,type:SM}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:gM})}}]),n}(QP);return e.displayName="OrbitView",e}(),CM=[255,255,255],OM=0,TM=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.color,i=void 0===n?CM:n,r=t.intensity,o=void 0===r?1:r;this.id=t.id||"ambient-".concat(OM++),this.color=i,this.intensity=o,this.type="ambient"},AM=[255,255,255],PM=[0,0,-1],MM=0,IM=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.color,i=void 0===n?AM:n,r=t.intensity,o=void 0===r?1:r,a=t.direction,s=void 0===a?PM:a,u=t._shadow,c=void 0!==u&&u;this.id=t.id||"directional-".concat(MM++),this.color=i,this.intensity=o,this.type="directional",this.direction=new fS(s).normalize().toArray(),this.shadow=c}return b(e,[{key:"getProjectedLight",value:function(){return this}}]),e}(),RM=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props=M({},t)}return b(e,[{key:"preRender",value:function(){}},{key:"getModuleParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}(),DM=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"render",value:function(e){return Ok(this.gl,{framebuffer:e.target}),this._drawLayers(e)}},{key:"_drawLayers",value:function(e){var t=e.viewports,n=e.views,i=e.onViewportActive,r=e.clearCanvas,o=void 0===r||r;e.pass=e.pass||"unknown";var a=this.gl;o&&function(e){Ok(e,{viewport:[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}),e.clear(16640)}(a);var s,u=[],c=_(t);try{for(c.s();!(s=c.n()).done;){var l=s.value,h=l.viewport||l,f=n&&n[h.id];i(h);var d=this._getDrawLayerParams(h,e);e.view=f;var p,v=_(h.subViewports||[h]);try{for(v.s();!(p=v.n()).done;){var g=p.value;e.viewport=g;var m=this._drawLayersInViewport(a,e,d);u.push(m)}}catch(y){v.e(y)}finally{v.f()}}}catch(y){c.e(y)}finally{c.f()}return u}},{key:"_getDrawLayerParams",value:function(e,t){for(var n=t.layers,i=t.pass,r=t.layerFilter,o=t.effects,a=t.moduleParameters,s=[],u=NM(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i},l=0;l1&&void 0!==arguments[1]?arguments[1]:{};m(this,e);var i=n.id,r=void 0===i?"pass":i;this.id=r,this.gl=t,this.props=M({},n)}return b(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}());function NM(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},i=function i(r,o){var a,s=r.props._offset,u=r.id,c=r.parent&&r.parent.id;if(c&&!(c in t)&&i(r.parent,!1),c in n){var l=n[c]=n[c]||NM(t[c],t);a=l(r,o),n[u]=l}else Number.isFinite(s)?(a=s+(t[c]||0),n[u]=null):a=e;return o&&a>=e&&(e=a+1),t[u]=a,a};return i}var LM=function(t){a(i,t);var n=s(i);function i(e,t){var r;return m(this,i),(r=n.call(this,e,t)).shadowMap=new mx(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),r.depthBuffer=new _x(e,{format:33189,width:1,height:1}),r.fbo=new Ix(e,{id:"shadowmap",width:1,height:1,attachments:{36064:r.shadowMap,36096:r.depthBuffer}}),r}return b(i,[{key:"render",value:function(t){var n=this,r=this.fbo;Tk(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var o=t.viewports[0],a=Ak(n.gl),s=o.width*a,u=o.height*a;(s!==r.width||u!==r.height)&&r.resize({width:s,height:u}),e(p(i.prototype),"render",n).call(n,I(M({},t),{target:r,pass:"shadow"}))})}},{key:"shouldDrawLayer",value:function(e){return!1!==e.props.shadowEnabled}},{key:"getModuleParameters",value:function(){return{drawToShadowMap:!0}}},{key:"delete",value:function(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}]),i}(DM),jM=Object.keys(Uw).map(function(e){return"const int COORDINATE_SYSTEM_".concat(e," = ").concat(Uw[e],";")}).join(""),FM=Object.keys(Hw).map(function(e){return"const int PROJECTION_MODE_".concat(e," = ").concat(Hw[e],";")}).join(""),BM="".concat(jM,"\n").concat(FM,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),VM={},zM={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:BM,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:VM;return e.viewport?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,a=e.coordinateSystem,s=void 0===a?Uw.DEFAULT:a,u=e.coordinateOrigin,c=e.autoWrapLongitude,l=void 0!==c&&c;s===Uw.DEFAULT&&(s=t.isGeospatial?Uw.LNGLAT:Uw.CARTESIAN);var h=vO({viewport:t,devicePixelRatio:i,coordinateSystem:s,coordinateOrigin:u});return h.project_uWrapLongitude=l,h.project_uModelMatrix=o||fO,h}(e):{}}},UM=ZC(function(e){var t=e.viewport,n=e.center;return new EO(t.viewProjectionMatrix).invert().transform(n)}),HM=ZC(function(e){var n,i=e.viewport,r=e.shadowMatrices,o=[],a=i.pixelUnprojectionMatrix,s=i.isGeospatial?void 0:1,u=[[0,0,s],[i.width,0,s],[0,i.height,s],[i.width,i.height,s],[0,0,-1],[i.width,0,-1],[0,i.height,-1],[i.width,i.height,-1]].map(function(e){return function(e,n){var i=t(e,3),r=i[0],o=i[1],a=i[2],s=GO([r,o,a],n);return Number.isFinite(a)?s:[s[0],s[1],0]}(e,a)}),c=_(r);try{var l=function(){var e=n.value,t=e.clone().translate(new fS(i.center).negate()),r=u.map(function(e){return t.transform(e)}),a=(new EO).ortho({left:Math.min.apply(Math,v(r.map(function(e){return e[0]}))),right:Math.max.apply(Math,v(r.map(function(e){return e[0]}))),bottom:Math.min.apply(Math,v(r.map(function(e){return e[1]}))),top:Math.max.apply(Math,v(r.map(function(e){return e[1]}))),near:Math.min.apply(Math,v(r.map(function(e){return-e[2]}))),far:Math.max.apply(Math,v(r.map(function(e){return-e[2]})))});o.push(a.multiplyRight(e))};for(c.s();!(n=c.n()).done;)l()}catch(h){c.e(h)}finally{c.f()}return o}),GM=[0,0,0,1],WM=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],qM={name:"shadow",dependencies:[zM],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){var n=e.shadowEnabled,i=void 0===n||n;return i&&e.shadowMatrices&&e.shadowMatrices.length>0?function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||GM,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=UM({viewport:e.viewport,center:t.project_uCenter}),r=[],o=HM({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice(),a=0;a0?e.shadowMaps[c]:e.dummyShadowMap;return n}(e,t):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},XM={color:[255,255,255],intensity:1},YM=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],KM=[0,0,0,200/255],QM=function(e){a(n,e);var t=s(n);function n(e){var i;for(var r in m(this,n),(i=t.call(this,e)).ambientLight=null,i.directionalLights=[],i.pointLights=[],i.shadowColor=KM,i.shadowPasses=[],i.shadowMaps=[],i.dummyShadowMap=null,i.shadow=!1,i.programManager=null,e){var o=e[r];switch(o.type){case"ambient":i.ambientLight=o;break;case"directional":i.directionalLights.push(o);break;case"point":i.pointLights.push(o)}}return i._applyDefaultLights(),i.shadow=i.directionalLights.some(function(e){return e.shadow}),i}return b(n,[{key:"preRender",value:function(e,t){var n=t.layers,i=t.layerFilter,r=t.viewports,o=t.onViewportActive,a=t.views;if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=dC.getDefaultProgramManager(e),qM&&this.programManager.addDefaultModule(qM)),this.dummyShadowMap||(this.dummyShadowMap=new mx(e,{width:1,height:1}));for(var s=0;s=t.delay+t.duration*t.repeat}},{key:"getTime",value:function(e){if(void 0===e)return this.time;var t=this.channels.get(e);return void 0===t?-1:t.time}},{key:"setTime",value:function(e){this.time=Math.max(0,e);var t,n=_(this.channels.values());try{for(n.s();!(t=n.n()).done;){var i=t.value;this._setChannelTime(i,this.time)}}catch(c){n.e(c)}finally{n.f()}var r,o=_(this.animations.values());try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.animation,u=a.channel;s.setTime(this.getTime(u))}}catch(c){o.e(c)}finally{o.f()}}},{key:"play",value:function(){this.playing=!0}},{key:"pause",value:function(){this.playing=!1,this.lastEngineTime=-1}},{key:"reset",value:function(){this.setTime(0)}},{key:"attachAnimation",value:function(e,t){var n=ZM++;return this.animations.set(n,{animation:e,channel:t}),e.setTime(this.getTime(t)),n}},{key:"detachAnimation",value:function(e){this.animations.delete(e)}},{key:"update",value:function(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}},{key:"_setChannelTime",value:function(e,t){var n=t-e.delay;n>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,n)%e.duration,e.time*=e.rate)}}]),e}(),eI=function(){function e(t,n,i){m(this,e),this.id=t,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(n)}return b(e,[{key:"subscribe",value:function(e){this._subscribers.add(e)}},{key:"unsubscribe",value:function(e){this._subscribers.delete(e)}},{key:"inUse",value:function(){return this._subscribers.size>0}},{key:"delete",value:function(){}},{key:"getData",value:function(){var e=this;return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(function(){return e.getData()})}},{key:"setData",value:function(e,t){var n=this;if(e!==this._data||t){this._data=e;var i=++this._loadCount,r=e;"string"==typeof e&&(r=jP(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(function(e){n._loadCount===i&&(n.isLoaded=!0,n._error=null,n._content=e)}).catch(function(e){n._loadCount===i&&(n.isLoaded=!0,n._error=e||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);var o,a=_(this._subscribers);try{for(a.s();!(o=a.n()).done;){o.value.onChange(this.getData())}}catch(s){a.e(s)}finally{a.f()}}}}]),e}(),tI=function(){function e(t){var n=t.gl,i=t.protocol;m(this,e),this.protocol=i||"resource://",this._context={gl:n,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}return b(e,[{key:"contains",value:function(e){return!!e.startsWith(this.protocol)||e in this._resources}},{key:"add",value:function(e){var t=e.resourceId,n=e.data,i=e.forceUpdate,r=void 0!==i&&i,o=e.persistent,a=void 0===o||o,s=this._resources[t];s?s.setData(n,r):(s=new eI(t,n,this._context),this._resources[t]=s),s.persistent=a}},{key:"remove",value:function(e){var t=this._resources[e];t&&(t.delete(),delete this._resources[e])}},{key:"unsubscribe",value:function(e){var t=e.consumerId,n=this._consumers[t];if(n){for(var i in n){var r=n[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[t],this.prune()}}},{key:"subscribe",value:function(e){var t=e.resourceId,n=e.onChange,i=e.consumerId,r=e.requestId,o=void 0===r?"default":r,a=this._resources,s=this.protocol;t.startsWith(s)&&(a[t=t.replace(s,"")]||this.add({resourceId:t,data:null,persistent:!1}));var u=a[t];if(this._track(i,o,u,n),u)return u.getData()}},{key:"prune",value:function(){var e=this;this._pruneRequest||(this._pruneRequest=setTimeout(function(){return e._prune()},0))}},{key:"finalize",value:function(){for(var e in this._resources)this._resources[e].delete()}},{key:"_track",value:function(e,t,n,i){var r=this._consumers,o=r[e]=r[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),n&&(o[t]=a,a.onChange=i,a.resource=n,n.subscribe(a))}},{key:"_prune",value:function(){this._pruneRequest=null;for(var e=0,t=Object.keys(this._resources);e1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,o=n.viewport,a=n.timeline;m(this,e),this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new tI({gl:t,protocol:"deck://"}),this.context=I(M({},oI),{layerManager:this,gl:t,deck:i,programManager:t&&rI(t),stats:r||new Vk({id:"deck.gl"}),viewport:o||new eT({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:a||new JM,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}return b(e,[{key:"finalize",value:function(){this.resourceManager.finalize();var e,t=_(this.layers);try{for(t.s();!(e=t.n()).done;){var n=e.value;this._finalizeLayer(n)}}catch(i){t.e(i)}finally{t.f()}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n,i=_(this.layers);try{for(i.s();!(n=i.n()).done;){var r=n.value,o=r.getNeedsRedraw(e);t=t||o}}catch(a){i.e(a)}finally{i.f()}return t}},{key:"needsUpdate",value:function(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}},{key:"setNeedsRedraw",value:function(e){this._needsRedraw=this._needsRedraw||e}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e}},{key:"getLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layerIds,n=void 0===t?null:t;return n?this.layers.filter(function(e){return n.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}},{key:"setLayers",value:function(e,t){BS("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e;var n,i=_(e=SS(e,Boolean));try{for(i.s();!(n=i.n()).done;){n.value.context=this.context}}catch(r){i.e(r)}finally{i.f()}return this._updateLayers(this.layers,e),this}},{key:"updateLayers",value:function(){var e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}},{key:"activateViewport",value:function(e){return BS("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}},{key:"_handleError",value:function(e,t,n){n.raiseError(t,"".concat(e," of ").concat(n))}},{key:"_updateLayers",value:function(e,t){var n,i={},r=_(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;i[o.id]?zw.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o}}catch(l){r.e(l)}finally{r.f()}var a=[];this._updateSublayersRecursively(t,i,a),this._finalizeOldLayers(i);for(var s=!1,u=0,c=a;u0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}return b(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){for(var e in this.controllers){var t=this.controllers[e];t&&t.updateTransition()}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i={x:e[0],y:e[1]},r=n.length-1;r>=0;--r){var o=n[r];if(o.containsPixel(i)){var a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}},{key:"_update",value:function(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}},{key:"_setSize",value:function(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=SS(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!KP(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):zw.warn("missing `viewState` or `initialViewState`")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e,t){return new(0,t.type)(M({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:function(t){return e._getViewport(t,{width:t.width,height:t.height})}},t))}},{key:"_updateController",value:function(e,t,n,i){var r=e.controller;return r?(r=I(M(M(M({},t),e.props),r),{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height}),i?i.setProps(r):i=this._createController(e,r),i):null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=!1,o=n.length;o--;){var a=n[o],s=this.getViewState(a),u=a.makeViewport({width:e,height:t,viewState:s}),c=i[a.id];a.controller&&!c&&(r=!0),(r||!a.controller)&&c&&(c.finalize(),c=null),this.controllers[a.id]=this._updateController(a,s,u,c),this._viewports.unshift(u)}for(var l in i)i[l]&&!this.controllers[l]&&i[l].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),uI=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.makeViewport,o=i.width,a=i.height,s=i.latitude,u=i.longitude,c=i.zoom,l=i.bearing,h=void 0===l?0:l,f=i.pitch,d=void 0===f?0:f,p=i.altitude,v=void 0===p?1.5:p,g=i.maxZoom,y=void 0===g?20:g,b=i.minZoom,_=void 0===b?0:b,w=i.maxPitch,k=void 0===w?60:w,x=i.minPitch,S=void 0===x?0:x,E=i.startPanLngLat,C=i.startZoomLngLat,O=i.startRotatePos,T=i.startBearing,A=i.startPitch,P=i.startZoom,M=i.normalize;return m(this,n),bS(Number.isFinite(u)),bS(Number.isFinite(s)),bS(Number.isFinite(c)),(e=t.call(this,{width:o,height:a,latitude:s,longitude:u,zoom:c,bearing:h,pitch:d,altitude:v,maxZoom:y,minZoom:_,maxPitch:k,minPitch:S,normalize:M}))._state={startPanLngLat:E,startZoomLngLat:C,startRotatePos:O,startBearing:T,startPitch:A,startZoom:P},e.makeViewport=r,e}return b(n,[{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._state.startPanLngLat||this._unproject(n);if(!i)return this;var r=this.makeViewport(this._viewportProps).panByPosition(i,t);return this._getUpdatedState(r)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){var t=e.pos;return this._getUpdatedState({startRotatePos:t,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t,n=e.pos,i=e.deltaAngleX,r=void 0===i?0:i,o=e.deltaAngleY,a=void 0===o?0:o,s=this._state,u=s.startRotatePos,c=s.startBearing,l=s.startPitch;return u&&Number.isFinite(c)&&Number.isFinite(l)?(t=n?this._calculateNewPitchAndBearing(I(M({},this._getRotationParams(n,u)),{startBearing:c,startPitch:l})):{bearing:c+r,pitch:l+a},this._getUpdatedState(t)):this}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._state,o=r.startZoom,a=r.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,a=this._unproject(n)||this._unproject(t));var s=this._calculateNewZoom({scale:i,startZoom:o}),u=this.makeViewport(I(M({},this._viewportProps),{zoom:s}));return this._getUpdatedState(M({zoom:s},u.panByPosition(a,t)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(e)}},{key:"zoomOut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(1/e)}},{key:"moveLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([e,0])}},{key:"moveRight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([-e,0])}},{key:"moveUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,e])}},{key:"moveDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,-e])}},{key:"rotateLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}},{key:"rotateRight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}},{key:"rotateUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}},{key:"rotateDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=M({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new this.constructor(M(M(M({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Wx(i,n,t);var r=e.maxPitch,o=e.minPitch,a=e.pitch;e.pitch=Wx(a,o,r);var s=e.normalize;return(void 0===s||s)&&Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,o=e.zoom,a=e.pitch,s=void 0===a?0:a,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=OO(i+180,360)-180),(c<-180||c>180)&&(c=OO(c+180,360)-180);var l=TO(n/512);if(o<=l)o=l,r=0;else{var h=n/2/Math.pow(2,o),f=LO([0,h])[1];if(rd&&(r=d)}}return{width:t,height:n,longitude:i,latitude:r,zoom:o,pitch:s,bearing:c}}(e)),e}},{key:"_unproject",value:function(e){var t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,o=i.minZoom;return Wx(n+Math.log2(t),o,r)}},{key:"_calculateNewPitchAndBearing",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=e.startBearing,r=e.startPitch;n=Wx(n,-1,1);var o=this._viewportProps,a=o.minPitch,s=o.maxPitch,u=r;return n>0?u=r+n*(s-r):n<0&&(u=r-n*(a-r)),{pitch:u,bearing:i+180*t}}},{key:"_getRotationParams",value:function(e,t){var n=e[0]-t[0],i=e[1]-t[1],r=e[1],o=t[1],a=this._viewportProps,s=a.width,u=a.height,c=n/s,l=0;return i>0?Math.abs(u-o)>5&&(l=i/(o-u)*1.2):i<0&&o>5&&(l=1-r/o),{deltaScaleX:c,deltaScaleY:l=Math.min(1,Math.max(-1,l))}}}]),n}(dM),cI=function(t){a(i,t);var n=s(i);function i(e){return m(this,i),e.dragMode=e.dragMode||"pan",n.call(this,uI,e)}return b(i,[{key:"setProps",value:function(t){var n=this.controllerStateProps;e(p(i.prototype),"setProps",this).call(this,t),(!n||n.height!==t.height)&&this.updateViewport(new this.ControllerState(M(M({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}},{key:"linearTransitionProps",get:function(){return["longitude","latitude","zoom","bearing","pitch"]}}]),i}(fM),lI=function(){var e=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,I(M({},e),{type:tT}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:cI})}}]),n}(QP);return e.displayName="MapView",e}(),hI=new QM,fI=function(){function e(){m(this,e),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return b(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length!==this.effects.length||!KP(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e,this._createInternalEffects()}},{key:"cleanup",value:function(){var e,t=_(this.effects);try{for(t.s();!(e=t.n()).done;){e.value.cleanup()}}catch(r){t.e(r)}finally{t.f()}var n,i=_(this._internalEffects);try{for(i.s();!(n=i.n()).done;){n.value.cleanup()}}catch(r){i.e(r)}finally{i.f()}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some(function(e){return e instanceof QM})||this._internalEffects.push(hI)}}]),e}(),dI=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(DM),pI={blendFunc:[1,0,32771,0],blendEquation:32774},vI=function(t){a(i,t);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"render",value:function(t){t.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(t)):(this.useAlpha=!1,e(p(i.prototype),"render",this).call(this,t))}},{key:"_drawPickingBuffer",value:function(t){var n=this,r=t.layers,o=t.layerFilter,a=t.views,s=t.viewports,u=t.onViewportActive,c=t.pickingFBO,l=t.deviceRect,h=l.x,f=l.y,d=l.width,v=l.height,g=t.pass,m=void 0===g?"picking":g,y=t.redrawReason,b=t.pickZ,_=this.gl;return this.pickZ=b,Tk(_,I(M({scissorTest:!0,scissor:[h,f,d,v],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},pI),{blend:!b}),function(){e(p(i.prototype),"render",n).call(n,{target:c,layers:r,layerFilter:o,views:a,viewports:s,onViewportActive:u,pass:m,redrawReason:y})})}},{key:"shouldDrawLayer",value:function(e){return e.props.pickable}},{key:"getModuleParameters",value:function(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}},{key:"getLayerParameters",value:function(e,t){var n=this.pickZ?{blend:!1}:I(M({},pI),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return M(M({},e.props.parameters),n)}}]),i}(DM),gI=function(){function e(t){m(this,e),this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new dI(t),this.pickLayersPass=new vI(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}return b(e,[{key:"setProps",value:function(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}},{key:"renderLayers",value:function(e){var t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Ix.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);var n=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,i=t.render(I(M({},e),{target:n}));this._postRender(e.effects,e),this.renderCount++,BS("deckRenderer.renderLayers",this,i,e)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){var e,t=this.renderBuffers,n=_(t);try{for(n.s();!(e=n.n()).done;){e.value.delete()}}catch(i){n.e(i)}finally{n.f()}t.length=0}},{key:"_preRender",value:function(e,t){var n,i=null,r=_(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;o.preRender(this.gl,t),o.postRender&&(i=o)}}catch(a){r.e(a)}finally{r.f()}i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}},{key:"_resizeRenderBuffers",value:function(){var e=this.renderBuffers;0===e.length&&e.push(new Ix(this.gl),new Ix(this.gl));var t,n=_(e);try{for(n.s();!(t=n.n()).done;){t.value.resize()}}catch(i){n.e(i)}finally{n.f()}}},{key:"_postRender",value:function(e,t){var n,i=this.renderBuffers,r={inputBuffer:i[0],swapBuffer:i[1],target:null},o=_(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.postRender){if(a===this.lastPostProcessEffect){r.target=t.target,a.postRender(this.gl,r);break}var s=a.postRender(this.gl,r);r.inputBuffer=s,r.swapBuffer=s===i[0]?i[1]:i[0]}}}catch(u){o.e(u)}finally{o.f()}}}]),e}(),mI={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function yI(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,o=e.deviceRadius,a=e.deviceRect;if(t){for(var s=a.x,u=a.y,c=a.width,l=a.height,h=o*o,f=-1,d=0,p=0;ph)d+=4*c;else for(var m=0;m=0){var y=m+s-i,b=y*y+g;b<=h&&(h=b,f=d)}d+=4}}if(f>=0){var _=t[f+3]-1,w=t.slice(f,f+4),k=n[_];if(k){var x=k.decodePickingColor(w),S=Math.floor(f/4/c);return{pickedColor:w,pickedLayer:k,pickedObjectIndex:x,pickedX:s+(f/4-S*c),pickedY:u+S}}zw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return mI}function bI(e){var t=e.pickInfo,n=e.mode,i=e.viewports,r=e.layerFilter,o=e.pixelRatio,a=e.x,s=e.y,u=e.z,c=t&&t.pickedLayer,l=function(e,t,n){for(var i=e.length-1;i>=0;i--){var r=e[i];if(r.containsPixel(t)&&(!n||n(r)))return r}return e[0]}(i,{x:a,y:s},r&&c&&function(e){return r({layer:c,viewport:e,isPicking:!0,renderPass:"picking:".concat(n)})}),h=l&&l.unproject([a-l.x,s-l.y],{targetZ:u});return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:a,y:s,pixel:[a,s],coordinate:h,devicePixel:t&&[t.pickedX,t.pickedY],pixelRatio:o}}function _I(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,o=t.pickedColor,a=t.pickedLayer,s=t.pickedObjectIndex,u=a?[a]:[];if("hover"===i){var c=n.index,l=n.layerId,h=a&&a.props.id;if(h!==l||s!==c){if(h!==l){var f=r.find(function(e){return e.props.id===l});f&&u.unshift(f)}n.layerId=h,n.index=s,n.info=null}}var d=bI(e),p=new Map;return p.set(null,d),u.forEach(function(e){var t=M({},d);e===a&&(t.color=o,t.index=s,t.picked=!0),t=wI({layer:e,info:t,mode:i}),e===a&&"hover"===i&&(n.info=t),p.set(t.layer.id,t),"hover"===i&&t.layer.updateAutoHighlight(t)}),p}function wI(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||null;n.sourceLayer=r,n.layer=t,n=t.getPickingInfo({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var kI=function(){function e(t){m(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new vI(t),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return b(e,[{key:"setProps",value:function(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}},{key:"finalize",value:function(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}},{key:"pickObject",value:function(e){return this._pickClosestObject(e)}},{key:"pickObjects",value:function(e){return this._pickVisibleObjects(e)}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,a=o&&o.layer&&o.layer.id,s=o&&o.viewport&&o.viewport.id,u=a?i.find(function(e){return e.id===a}):null,c=s&&r.find(function(e){return e.id===s})||r[0],l=c&&c.unproject([t-c.x,n-c.y]),h={x:t,y:n,viewport:c,coordinate:l,layer:u};return u?M(M({},o),h):Object.assign(h,{color:null,object:null,index:-1})}},{key:"_resizeBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new Ix(e),Ix.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Ix(e),this.depthFBO.attach({36064:new mx(e,{format:Yw(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"_getPickable",value:function(e){if(!1===this._pickable)return null;var t=e.filter(function(e){return e.isPickable()&&!e.isComposite});return t.length>255?(zw.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}},{key:"_pickClosestObject",value:function(e){var t=e.layers,n=e.views,i=e.viewports,r=e.x,o=e.y,a=e.radius,s=void 0===a?0:a,u=e.depth,c=void 0===u?1:u,l=e.mode,h=void 0===l?"query":l,f=e.unproject3D,d=e.onViewportActive;if(!(t=this._getPickable(t)))return{result:[],emptyInfo:bI({viewports:i,x:r,y:o})};this._resizeBuffer();for(var p,v=Ak(this.gl),g=Pk(this.gl,[r,o],!0),m=[g.x+Math.floor(g.width/2),g.y+Math.floor(g.height/2)],y=Math.round(s*v),b=this.pickingFBO,w=b.width,k=b.height,x=this._getPickingRect({deviceX:m[0],deviceY:m[1],deviceRadius:y,deviceWidth:w,deviceHeight:k}),S=[],E={},C=0;C=0){var a=t.slice(r,r+4),s=a.join(",");if(!i.has(s)){var u=n[o];u?i.set(s,{pickedColor:a,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(a)}):zw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this._drawAndSample({layers:t,views:n,viewports:i,onViewportActive:p,deviceRect:{x:m,y:_,width:b.x+b.width-m,height:y-_},pass:"picking:".concat(h),redrawReason:h}),layers:t}),k=new Map,x=Number.isFinite(d),S=0;S=d);S++){var E=w[S],C={color:E.pickedColor,layer:null,index:E.pickedObjectIndex,picked:!0,x:r,y:o,width:s,height:c,pixelRatio:v};C=wI({layer:E.pickedLayer,info:C,mode:h}),k.has(C.object)||k.set(C.object,C)}return Array.from(k.values())}},{key:"_drawAndSample",value:function(e){var t=e.layers,n=e.views,i=e.viewports,r=e.onViewportActive,o=e.deviceRect,a=e.pass,s=e.redrawReason,u=e.pickZ;if(t.length<1)return null;var c=u?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:t,layerFilter:this.layerFilter,views:n,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:o,pass:a,redrawReason:s,pickZ:u});var l=o.x,h=o.y,f=o.width,d=o.height,p=new(u?Float32Array:Uint8Array)(f*d*4);return Ax(c,{sourceX:l,sourceY:h,sourceWidth:f,sourceHeight:d,target:p}),p}},{key:"_getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,o=e.deviceHeight,a=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-a,c=Math.min(o,n+i+1)-s;return u<=0||c<=0?null:{x:a,y:s,width:u,height:c}}}]),e}(),xI={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"},SI=function(){function e(t){m(this,e);var n=t.parentElement;n&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,xI),n.appendChild(this.el)),this.isVisible=!1}return b(e,[{key:"setTooltip",value:function(e,t,n){var i=this.el;if("string"==typeof e)i.innerText=e;else{if(!e)return this.isVisible=!1,void(i.style.display="none");"text"in e&&(i.innerText=e.text),"html"in e&&(i.innerHTML=e.html),"className"in e&&(i.className=e.className),Object.assign(i.style,e.style)}this.isVisible=!0,i.style.display="block",i.style.transform="translate(".concat(t,"px, ").concat(n,"px)")}},{key:"remove",value:function(){this.el&&this.el.remove()}}]),e}();function EI(e,t){if(!e)throw new Error(t)}var CI={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},OI=CI.global||CI.self||CI.window,TI="object"!=typeof process||"[object process]"!==String(process)||process.browser,AI="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),PI=(AI&&parseFloat(AI[1]),OI)._parseImageNode,MI="undefined"!=typeof Image,II="undefined"!=typeof ImageBitmap,RI=Boolean(PI),DI=!!TI||RI;function NI(e){switch(function(e){var t=function(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"==typeof e&&e.data&&e.width&&e.height?"data":null}(e);if(!t)throw new Error("Not an image");return t}(e)){case"data":return e;case"image":case"imagebitmap":var t=document.createElement("canvas"),n=t.getContext("2d");if(!n)throw new Error("getImageData");return t.width=e.width,t.height=e.height,n.drawImage(e,0,0),n.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}var LI=/^data:image\/svg\+xml/,jI=/\.svg((\?|#).*)?$/;function FI(e){return e&&(LI.test(e)||jI.test(e))}function BI(e,t){if(FI(t)){var n=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return"data:image/svg+xml;base64,".concat(btoa(n))}return VI(e,t)}function VI(e,t){if(FI(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function zI(e,t,n){return UI.apply(this,arguments)}function UI(){return(UI=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=BI(t,i),o=self.URL||self.webkitURL,a="string"!=typeof r&&o.createObjectURL(r),e.prev=1,e.next=4,HI(a||r,n);case 4:return e.abrupt("return",e.sent);case 5:return e.prev=5,a&&o.revokeObjectURL(a),e.finish(5);case 8:case"end":return e.stop()}},e,null,[[1,,5,8]])}))).apply(this,arguments)}function HI(e,t){return GI.apply(this,arguments)}function GI(){return(GI=Sx(regeneratorRuntime.mark(function e(t,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=new Image).src=t,!(n.image&&n.image.decode&&i.decode)){e.next=8;break}return e.next=5,i.decode();case 5:e.t0=i,e.next=11;break;case 8:return e.next=10,new Promise(function(e,n){try{i.onload=function(){return e(i)},i.onerror=function(e){return n(new Error("Could not load image ".concat(t,": ").concat(e)))}}catch(r){n(r)}});case 10:e.t0=e.sent;case 11:return e.abrupt("return",e.t0);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}var WI={},qI=!0;function XI(e,t,n){return YI.apply(this,arguments)}function YI(){return(YI=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!FI(i)){e.next=6;break}return e.next=3,zI(t,n,i);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=VI(t,i);case 7:return r=e.t0,o=n&&n.imagebitmap,e.next=11,KI(r,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function KI(e){return QI.apply(this,arguments)}function QI(){return(QI=Sx(regeneratorRuntime.mark(function e(t){var n,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(($I(n=i.length>1&&void 0!==i[1]?i[1]:null)||!qI)&&(n=null),!n){e.next=11;break}return e.prev=2,e.next=5,createImageBitmap(t,n);case 5:return e.abrupt("return",e.sent);case 8:e.prev=8,e.t0=e.catch(2),console.warn(e.t0),qI=!1;case 11:return e.next=13,createImageBitmap(t);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}},e,null,[[2,8]])}))).apply(this,arguments)}function $I(e){for(var t in e||WI)return!1;return!0}var ZI=!1,JI=!0;function eR(e){var t=tR(e);return function(e){var t=tR(e);return t.byteLength>=24&&2303741511===t.getUint32(0,ZI)?{mimeType:"image/png",width:t.getUint32(16,ZI),height:t.getUint32(20,ZI)}:null}(t)||function(e){var t=tR(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,ZI)&&255===t.getUint8(2)))return null;for(var n=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}(),i=n.tableMarkers,r=n.sofMarkers,o=2;o+9=10&&1195984440===t.getUint32(0,ZI)?{mimeType:"image/gif",width:t.getUint16(6,JI),height:t.getUint16(8,JI)}:null}(t)||function(e){var t=tR(e);return t.byteLength>=14&&16973===t.getUint16(0,ZI)&&t.getUint32(2,JI)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,JI),height:t.getUint32(22,JI)}:null}(t)}function tR(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function nR(e,t){var n=(eR(e)||{}).mimeType,i=OI._parseImageNode;return EI(i),i(e,n,t)}function iR(){return(iR=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=((n=n||{}).image||{}).type||"auto",o=(i||{}).url,e.t0=rR(r),e.next="imagebitmap"===e.t0?4:"image"===e.t0?8:"data"===e.t0?12:16;break;case 4:return e.next=6,XI(t,n,o);case 6:return a=e.sent,e.abrupt("break",17);case 8:return e.next=10,zI(t,n,o);case 10:return a=e.sent,e.abrupt("break",17);case 12:return e.next=14,nR(t,n);case 14:return a=e.sent,e.abrupt("break",17);case 16:EI(!1);case 17:return e.abrupt("return",("data"===r&&(a=NI(a)),a));case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function rR(e){switch(e){case"auto":case"data":return function(){if(II)return"imagebitmap";if(MI)return"image";if(DI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return II||MI||DI;case"imagebitmap":return II;case"image":return MI;case"data":return DI;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var oR={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(e,t,n){return iR.apply(this,arguments)},tests:[function(e){return Boolean(eR(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}},aR={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},sR="8.5.8",uR=$w.CO.deck&&$w.CO.deck.VERSION;if(uR&&uR!==sR)throw new Error("deck.gl - multiple versions detected: ".concat(uR," vs ").concat(sR));uR||(zw.log(1,"deck.gl ".concat(sR))(),$w.CO.deck=Object.assign($w.CO.deck||{},{VERSION:sR,version:sR,log:zw,_registerLoggers:function(e){FS=e}}),kP([aR,[oR,{imagebitmap:{premultiplyAlpha:"none"}}]]));var cR=$w.CO.deck,lR=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),(i=t.call(this,e,r)).target=null,i._queryPending=!1,i._pollingPromise=null,Object.seal(c(i)),i}return b(n,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.conservative,n=void 0!==t&&t;return this.begin(n?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}},{key:"end",value:function(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl2.getParameter(36795)}},{key:"getResult",value:function(){return this.gl2.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function o(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(o)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return n.isSupported(this.gl)?this.gl2.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl2.deleteQuery(this.handle)}}],[{key:"isSupported",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=Yw(e),r=Nx(e,"TIMER_QUERY"),o=i||r,a=_(n);try{for(a.s();!(t=a.n()).done;){var s=t.value;switch(s){case"queries":o=o&&i;break;case"timers":o=o&&r;break;default:Hk(!1)}}}catch(u){a.e(u)}finally{a.f()}return o}}]),n}(Zk),hR=(0,$w.jU)()&&"undefined"!=typeof document,fR=0,dR=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.onCreateContext,i=void 0===n?function(e){return Lk(e)}:n,r=t.onAddHTML,o=void 0===r?null:r,a=t.onInitialize,s=void 0===a?function(){}:a,u=t.onRender,c=void 0===u?function(){}:u,l=t.onFinalize,h=void 0===l?function(){}:l,f=t.onError,d=t.gl,p=void 0===d?null:d,v=t.glOptions,g=void 0===v?{}:v,y=t.debug,b=void 0!==y&&y,_=t.createFramebuffer,w=void 0!==_&&_,k=t.autoResizeViewport,x=void 0===k||k,S=t.autoResizeDrawingBuffer,E=void 0===S||S,C=t.stats,O=void 0===C?Uk.get("animation-loop-"+fR++):C,T=t.useDevicePixels,A=void 0===T||T;"useDevicePixelRatio"in t&&(Ww.deprecated("useDevicePixelRatio","useDevicePixels")(),A=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:o,onInitialize:s,onRender:c,onFinalize:h,onError:f,gl:p,glOptions:g,debug:b,createFramebuffer:w},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=O,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:x,autoResizeDrawingBuffer:E,useDevicePixels:A}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return b(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Hk("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}},{key:"setProps",value:function(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._running)return this;this._running=!0;var n=this._getPageLoadPromise().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=lR.isSupported(e.gl,["timers"])?new lR(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())});return this.props.onError&&n.catch(this.props.onError),this}},{key:"redraw",value:function(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}},{key:"stop",value:function(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}},{key:"attachTimeline",value:function(e){return this.timeline=e,this.timeline}},{key:"detachTimeline",value:function(){this.timeline=null}},{key:"waitForRender",value:function(){var e=this;return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(function(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=this;return Sx(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.setNeedsRedraw("toDataURL"),t.next=3,e.waitForRender();case 3:return t.abrupt("return",e.gl.canvas.toDataURL());case 4:case"end":return t.stop()}},t)}))()}},{key:"isContextLost",value:function(){return this.gl.isContextLost()}},{key:"onCreateContext",value:function(){var e;return(e=this.props).onCreateContext.apply(e,arguments)}},{key:"onInitialize",value:function(){var e;return(e=this.props).onInitialize.apply(e,arguments)}},{key:"onRender",value:function(){var e;return(e=this.props).onRender.apply(e,arguments)}},{key:"onFinalize",value:function(){var e;return(e=this.props).onFinalize.apply(e,arguments)}},{key:"getHTMLControlValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return Ww.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){!e._running||(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_getPageLoadPromise",value:function(){return this._pageLoadPromise||(this._pageLoadPromise=hR?new Promise(function(e,t){hR&&"complete"===document.readyState?e(document):window.addEventListener("load",function(){e(document)})}):Promise.resolve({})),this._pageLoadPromise}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_cancelAnimationFrame",value:function(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(e){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}(e)}},{key:"_requestAnimationFrame",value:function(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(e){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}},{key:"_initializeCallbackData",value:function(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}},{key:"_updateCallbackData",value:function(){var e=this._getSizeAndAspect(),t=e.width,n=e.height,i=e.aspect;(t!==this.animationProps.width||n!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}},{key:"_finalizeCallbackData",value:function(){this.onFinalize(this.animationProps)}},{key:"_addCallbackData",value:function(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?jk(this.props.gl,e):this.onCreateContext(e),!Xw(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(e){Ok(e,ck)})(this.gl),this._createInfoDiv()}},{key:"_createInfoDiv",value:function(){if(this.gl.canvas&&this.props.onAddHTML){var e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";var t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas)!function(e,t,n){var i="width"in n?n.width:e.canvas.clientWidth,r="height"in n?n.height:e.canvas.clientHeight;(!i||!r)&&(Ww.log(1,"Canvas clientWidth/clientHeight is 0")(),t=1,i=e.canvas.width||1,r=e.canvas.height||1),e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{};var o=e.luma.canvasSizeInfo;if(o.clientWidth!==i||o.clientHeight!==r||o.devicePixelRatio!==t){var a=t,s=Math.floor(i*a),u=Math.floor(r*a);e.canvas.width=s,e.canvas.height=u,(e.drawingBufferWidth!==s||e.drawingBufferHeight!==u)&&(Ww.warn("Device pixel ratio clamped")(),a=Math.min(e.drawingBufferWidth/i,e.drawingBufferHeight/r),e.canvas.width=Math.floor(i*a),e.canvas.height=Math.floor(r*a)),Object.assign(e.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:t})}}(e,function(e){var t="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(e)?e<=0?1:e:e?t:1}(t.useDevicePixels),t);else{var n=e.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in t&&"height"in t&&n.resize(t.width,t.height)}}(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new Ix(this.gl))}},{key:"_resizeFramebuffer",value:function(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}},{key:"_beginTimers",value:function(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}},{key:"_endTimers",value:function(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}},{key:"_startEventHandling",value:function(){var e=this.gl.canvas;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}},{key:"_onMousemove",value:function(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}},{key:"_onMouseleave",value:function(e){this.animationProps._mousePosition=null}}]),e}(),pR=r(11524),vR=r.n(pR),gR={mousedown:1,mousemove:2,mouseup:4};(function(e){var t=e.prototype.handler;e.prototype.handler=function(e){var n=this.store;e.button>0&&"pointerdown"===e.type&&(function(t,n){for(var i=0;i=0&&(this.pressed=!0),2&t&&0===e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}}(vR().MouseInput);var mR=vR().Manager,yR=vR(),bR=yR?[[yR.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[yR.Rotate,{enable:!1}],[yR.Pinch,{enable:!1}],[yR.Swipe,{enable:!1}],[yR.Pan,{threshold:0,enable:!1}],[yR.Press,{enable:!1}],[yR.Tap,{event:"doubletap",taps:2,enable:!1}],[yR.Tap,{event:"anytap",enable:!1}],[yR.Tap,{enable:!1}]]:null,_R={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},wR={doubletap:["tap"]},kR={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},xR=["keydown","keyup"],SR=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],ER=["wheel","mousewheel"],CR={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},OR={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},TR="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",AR="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;var PR=!1;try{var MR={get passive(){return PR=!0,!0}};AR.addEventListener("test",MR,MR),AR.removeEventListener("test",MR,MR)}catch(H){}var IR=-1!==TR.indexOf("firefox"),RR=ER,DR=4.000244140625,NR=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=RR.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!PR&&{passive:!1})})}return b(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;AR.WheelEvent&&(IR&&e.deltaMode===AR.WheelEvent.DOM_DELTA_PIXEL&&(t/=AR.devicePixelRatio),e.deltaMode===AR.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%DR==0&&(t=Math.floor(t/DR)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),LR=SR,jR="pointermove",FR="pointerover",BR="pointerout",VR="pointerleave",zR=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=LR.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return b(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){e===jR&&(this.enableMoveEvent=t),e===FR&&(this.enableOverEvent=t),e===BR&&(this.enableOutEvent=t),e===VR&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:FR,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:BR,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:VR,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:jR,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),UR=xR,HR="keydown",GR=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=UR.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=r.tabIndex||0,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return b(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){e===HR&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:HR,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),WR="contextmenu",qR=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return b(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){e===WR&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){!this.options.enable||this.callback({type:WR,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),XR={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},YR={srcElement:"root",priority:0},KR=function(){function e(t){m(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}return b(e,[{key:"isEmpty",value:function(){return!this._active}},{key:"add",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this.handlers,a=this.handlersByElement;n&&("object"!=typeof n||n.addEventListener)&&(n={srcElement:n}),n=n?Object.assign({},YR,n):YR;var s=a.get(n.srcElement);s||(s=[],a.set(n.srcElement,s));var u={type:e,handler:t,srcElement:n.srcElement,priority:n.priority};i&&(u.once=!0),r&&(u.passive=!0),o.push(u),this._active=this._active||!u.passive;for(var c=s.length-1;c>=0&&!(s[c].priority>=u.priority);)c--;s.splice(c+1,0,u)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var o=n[r];if(o.type===e&&o.handler===t){n.splice(r,1);var a=i.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&i.delete(o.srcElement)}}this._active=n.some(function(e){return!e.passive})}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n){for(var i=!1,r=function(){e.handled=!0},o=function(){e.handled=!0,i=!0},a=[],s=0;s0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.options=Object.assign({},QR,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return b(e,[{key:"setElement",value:function(e){var n=this;if(this.element&&this.destroy(),this.element=e,e){var i=this.options;for(var r in this.manager=new(0,i.Manager)(e,{touchAction:i.touchAction,recognizers:i.recognizers||bR}).on("hammer.input",this._onBasicInput),i.recognizers||Object.keys(_R).forEach(function(e){var t=n.manager.get(e);t&&_R[e].forEach(function(e){t.recognizeWith(e)})}),i.recognizerOptions){var o=this.manager.get(r);if(o){var a=i.recognizerOptions[r];delete a.enable,o.set(a)}}this.wheelInput=new NR(e,this._onOtherEvent,{enable:!1}),this.moveInput=new zR(e,this._onOtherEvent,{enable:!1}),this.keyInput=new GR(e,this._onOtherEvent,{enable:!1,tabIndex:i.tabIndex}),this.contextmenuInput=new qR(e,this._onOtherEvent,{enable:!1});var s,u=_(this.events);try{for(u.s();!(s=u.n()).done;){var c=t(s.value,2),l=c[0],h=c[1];h.isEmpty()||(this._toggleRecognizer(h.recognizerName,!0),this.manager.on(l,h.handleEvent))}}catch(f){u.e(f)}finally{u.f()}}}},{key:"destroy",value:function(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(e,t,n){this._addEventHandler(e,t,n,!1)}},{key:"once",value:function(e,t,n){this._addEventHandler(e,t,n,!0)}},{key:"watch",value:function(e,t,n){this._addEventHandler(e,t,n,!1,!0)}},{key:"off",value:function(e,t){this._removeEventHandler(e,t)}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=wR[e];r&&!this.options.recognizers&&r.forEach(function(r){var o=n.get(r);t?(o.requireFailure(e),i.dropRequireFailure(r)):o.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n,i,r){if("string"==typeof e){var o=this.manager,a=this.events,s=OR[e]||e,u=a.get(s);u||(u=new KR(this),a.set(s,u),u.recognizerName=CR[s]||s,o&&o.on(s,u.handleEvent)),u.add(e,t,n,i,r),u.isEmpty()||this._toggleRecognizer(u.recognizerName,!0)}else for(var c in n=t,e)this._addEventHandler(c,e[c],n,i,r)}},{key:"_removeEventHandler",value:function(e,t){if("string"==typeof e){var n=this.events,i=n.get(OR[e]||e);if(i&&(i.remove(e,t),i.isEmpty())){var r,o=i.recognizerName,a=!1,s=_(n.values());try{for(s.s();!(r=s.n()).done;){var u=r.value;if(u.recognizerName===o&&!u.isEmpty()){a=!0;break}}}catch(l){s.e(l)}finally{s.f()}a||this._toggleRecognizer(o,!1)}}else for(var c in e)this._removeEventHandler(c,e[c])}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=kR[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}();function ZR(){}var JR={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:ZR,onResize:ZR,onViewStateChange:ZR,onInteractionStateChange:ZR,onBeforeRender:ZR,onAfterRender:ZR,onLoad:ZR,onError:function(e,t){return zw.error(e)()},_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},eD=function(){function e(t){m(this,e),t=M(M({},JR),t),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),t.viewState&&t.initialViewState&&zw.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,$w.qs)()&&zw.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new Vk({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&Fx.setProps(t._typedArrayManagerProps),this.animationLoop.start()}return b(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&zw.removed("onLayerHover","onHover")(),"onLayerClick"in e&&zw.removed("onLayerClick","onClick")(),e.initialViewState&&!KP(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);var t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||o}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}},{key:"pickMultipleObjects",value:function(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}},{key:"pickObjects",value:function(e){return this._pick("pickObjects","pickObjects Time",e)}},{key:"_addResources",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in e)this.layerManager.resourceManager.add({resourceId:n,data:e[n],forceUpdate:t})}},{key:"_removeResources",value:function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.layerManager.resourceManager.remove(i)}}catch(r){n.e(r)}finally{n.f()}}},{key:"_pick",value:function(e,t,n){var i=this.stats;i.get("Pick Count").incrementCount(),i.get(t).timeStart();var r=this.deckPicker[e](M({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport},n));return i.get(t).timeEnd(),r}},{key:"_createCanvas",value:function(e){var t=e.canvas;return"string"==typeof t&&bS(t=document.getElementById(t)),t||((t=document.createElement("canvas")).id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,o=e.glOptions,a=e.debug,s=e.onError,u=e.onBeforeRender,c=e.onAfterRender,l=e.useDevicePixels,h=e.autoResizeDrawingBuffer;return new dR({width:n,height:i,useDevicePixels:l,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:function(e){return Lk(I(M(M({},o),e),{canvas:t.canvas,debug:a,onContextLost:function(){return t._onContextLost()}}))},onInitialize:function(e){return t._setGLContext(e.gl)},onRender:this._onRenderFrame.bind(this),onBeforeRender:u,onAfterRender:c,onError:s})}},{key:"_getViewState",value:function(){return this.props.viewState||this.viewState}},{key:"_getViews",value:function(){var e=this.props.views||[new lI({id:"default-view"})];return(e=Array.isArray(e)?e:[e]).length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}},{key:"_onContextLost",value:function(){var e=this.props.onError;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.event){var t=this._pick("pickObject","pickObject Time",e),n=t.result,i=t.emptyInfo;this.interactiveState.isHovering=n.length>0;var r,o=i,a=!1,s=_(n);try{for(s.s();!(r=s.n()).done;){var u=r.value;o=u,a=u.layer.onHover(u,e.event)}}catch(l){s.e(l)}finally{s.f()}if(!a&&this.props.onHover&&this.props.onHover(o,e.event),this.props.getTooltip){var c=this.props.getTooltip(o);this.tooltip.setTooltip(c,o.x,o.y)}e.event=null}}},{key:"_updateCursor",value:function(){var e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_setGLContext",value:function(e){if(!this.layerManager){this.canvas||(this.canvas=e.canvas,jk(e,{enable:!0,copyState:!0})),this.tooltip=new SI(this.canvas),Ok(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);var t=new JM;for(var n in t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new $R(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Gw)this.eventManager.on(n,this._onEvent);this.viewManager=new sI({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});var i=this.viewManager.getViewports()[0];this.layerManager=new aI(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new fI,this.deckRenderer=new gI(e),this.deckPicker=new kI(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Ok(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(M({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),zw.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=I(M({},this.viewState),o({},e.viewId,t)),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}},{key:"_onInteractionStateChange",value:function(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}},{key:"_onEvent",value:function(e){var t=Gw[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),o=r.layer,a=o&&(o[t.handler]||o.props[t.handler]),s=this.props[t.handler],u=!1;a&&(u=a.call(o,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){var e=this.stats;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();var t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var e=this.metrics,t=this.stats;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();var n=Uk.get("Memory Usage");e.bufferMemory=n.get("Buffer Memory").count,e.textureMemory=n.get("Texture Memory").count,e.renderbufferMemory=n.get("Renderbuffer Memory").count,e.gpuMemory=n.get("GPU Memory").count}}]),e}();eD.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(RM)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.oneOfType([e.bool,e.number]),touchAction:e.string,eventRecognizerOptions:e.object,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onInteractionStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,onError:e.func,debug:e.bool,drawPickingColors:e.bool,_framebuffer:e.object,_animate:e.bool,_pickable:e.bool,_typedArrayManagerProps:e.object}},eD.defaultProps=JR,eD.VERSION=cR.VERSION;var tD={name:"project32",dependencies:[zM],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},nD="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",iD={lightSources:{}};function rD(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}var oD={name:"lights",vs:nD,fs:nD,getUniforms:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:iD;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,r=n.pointLights,o=n.directionalLights;return i||r&&r.length>0||o&&o.length>0?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,o=void 0===r?[]:r,a={};return a["lighting_uAmbientLight.color"]=t?rD(t):[0,0,0],i.forEach(function(e,t){a["lighting_uPointLight[".concat(t,"].color")]=rD(e),a["lighting_uPointLight[".concat(t,"].position")]=e.position,a["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation||[1,0,0]}),a.lighting_uPointLightCount=i.length,o.forEach(function(e,t){a["lighting_uDirectionalLight[".concat(t,"].color")]=rD(e),a["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),a.lighting_uDirectionalLightCount=o.length,a}({ambientLight:i,pointLights:r,directionalLights:o}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var a,s={pointLights:[],directionalLights:[]},u=_(t.lights||[]);try{for(u.s();!(a=u.n()).done;){var c=a.value;switch(c.type){case"ambient":s.ambientLight=c;break;case"directional":s.directionalLights.push(c);break;case"point":s.pointLights.push(c)}}}catch(l){u.e(l)}finally{u.f()}return e({lightSources:s})}return{}},defines:{MAX_LIGHTS:3}},aD={},sD={name:"phong-lighting",dependencies:[oD],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:aD;if(!("material"in e))return{};var t=e.material;return t?function(e){var t=e.ambient,n=void 0===t?.35:t,i=e.diffuse,r=void 0===i?.6:i,o=e.shininess,a=void 0===o?32:o,s=e.specularColor;return{lighting_uAmbient:n,lighting_uDiffuse:r,lighting_uShininess:a,lighting_uSpecularColor:(void 0===s?[30,30,30]:s).map(function(e){return e/255})}}(t):{lighting_uEnabled:!1}}},uD={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},cD=M({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uD,t={};if(void 0!==e.pickingSelectedColor)if(e.pickingSelectedColor){var n=e.pickingSelectedColor.slice(0,3);t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}else t.picking_uSelectedColorValid=0;if(e.pickingHighlightColor){var i=Array.from(e.pickingHighlightColor,function(e){return e/255});Number.isFinite(i[3])||(i[3]=1),t.picking_uHighlightColor=i}return void 0!==e.pickingActive&&(t.picking_uActive=Boolean(e.pickingActive),t.picking_uAttribute=Boolean(e.pickingAttribute)),t}}),lD={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},hD=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id,i=void 0===n?Xk("geometry"):n,r=t.drawMode,o=void 0===r?lD.TRIANGLES:r,a=t.attributes,s=void 0===a?{}:a,u=t.indices,c=void 0===u?null:u,l=t.vertexCount,h=void 0===l?null:l;this.id=i,this.drawMode=0|o,this.attributes={},this.userData={},this._setAttributes(s,c),this.vertexCount=h||this._calculateVertexCount(this.attributes,this.indices)}return b(e,[{key:"mode",get:function(){return this.drawMode}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?M({indices:this.indices},this.attributes):this.attributes}},{key:"_print",value:function(e){return"Geometry ".concat(this.id," attribute ").concat(e)}},{key:"_setAttributes",value:function(e,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Hk(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),("POSITION"===n||"positions"===n)&&!i.size&&(i.size=3),"indices"===n?(Hk(!this.indices),this.indices=i):this.attributes[n]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],o=r.value,a=r.size;!r.constant&&o&&a>=1&&(n=Math.min(n,o.length/a))}return Hk(Number.isFinite(n)),n}}],[{key:"DRAW_MODE",get:function(){return lD}}]),e}(),fD=Math.PI/180,dD=new Float32Array(16),pD=new Float32Array(12);function vD(e,t,n){var i=t[0]*fD,r=t[1]*fD,o=t[2]*fD,a=Math.sin(o),s=Math.sin(i),u=Math.sin(r),c=Math.cos(o),l=Math.cos(i),h=Math.cos(r),f=n[0],d=n[1],p=n[2];e[0]=f*h*l,e[1]=f*u*l,e[2]=f*-s,e[3]=d*(-u*c+h*s*a),e[4]=d*(h*c+u*s*a),e[5]=d*l*a,e[6]=p*(u*a+h*s*c),e[7]=p*(-h*a+u*s*c),e[8]=p*l*c}function gD(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var mD={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,o=r.data,a=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),h=l&&16===c.length,f=Array.isArray(s),d=Array.isArray(a),p=Array.isArray(u),v=h||!l&&Boolean(c(o[0]));e.constant=v?h:d&&f&&p;var g=e.value;if(e.constant){var m;v?(dD.set(c),m=gD(dD)):(vD(m=pD,a,s),m.set(u,9)),e.value=new Float32Array(m)}else{var y,b=n*e.size,w=kS(o,n,i),k=w.iterable,x=w.objectInfo,S=_(k);try{for(S.s();!(y=S.n()).done;){var E=y.value,C=void 0;x.index++,v?(dD.set(h?c:c(E,x)),C=gD(dD)):(vD(C=pD,d?a:a(E,x),f?s:s(E,x)),C.set(p?u:u(E,x),9)),g[b++]=C[0],g[b++]=C[1],g[b++]=C[2],g[b++]=C[3],g[b++]=C[4],g[b++]=C[5],g[b++]=C[6],g[b++]=C[7],g[b++]=C[8],g[b++]=C[9],g[b++]=C[10],g[b++]=C[11]}}catch(O){S.e(O)}finally{S.f()}}}};function yD(e,t){return t===Uw.CARTESIAN||t===Uw.METER_OFFSETS||t===Uw.DEFAULT&&!e.isGeospatial}function bD(e,t){(e.COLOR_0||e.colors)&&t||(e.colors={constant:!0,value:new Float32Array([1,1,1])}),zw.assert(e.positions||e.POSITION,'no "postions" or "POSITION" attribute in mesh')}function _D(e,t){if(e.attributes)return bD(e.attributes,t),e instanceof hD?e:new hD(e);if(e.positions||e.POSITION)return bD(e,t),new hD({attributes:e});throw Error("Invalid mesh")}var wD={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},kD=function(){var t=function(t){a(i,t);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"getShaders",value:function(){var t=!Yw(this.context.gl),n={};return Dx(this.context.gl,"GLSL_DERIVATIVES")&&(n.DERIVATIVES_AVAILABLE=1),e(p(i.prototype),"getShaders",this).call(this,{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[tD,sD,cD],transpileToGLSL100:t,defines:n})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:mD}),this.setState({emptyTexture:new mx(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(t){var n=t.props,r=t.oldProps,o=t.changeFlags;if(e(p(i.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:o}),n.mesh!==r.mesh||o.extensionsChanged){var a;if(null===(a=this.state.model)||void 0===a||a.delete(),n.mesh){this.state.model=this.getModel(n.mesh);var s=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(s.NORMAL||s.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==r.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){e(p(i.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.context.viewport,i=this.props,r=i.sizeScale,o=i.coordinateSystem,a=i._instanced;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!a||yD(n,o),flatShading:!this.state.hasNormals}).draw()}}},{key:"getModel",value:function(e){var t=new PC(this.context.gl,I(M({},this.getShaders()),{id:this.props.id,geometry:_D(e,this.props._useMeshColors),isInstanced:!0})),n=this.props.texture,i=this.state.emptyTexture;return t.setUniforms({sampler:n||i,hasTexture:Boolean(n)}),t}},{key:"setTexture",value:function(e){var t=this.state,n=t.emptyTexture,i=t.model;null==i||i.setUniforms({sampler:e||n,hasTexture:Boolean(e)})}}]),i}(GP);return t.layerName="SimpleMeshLayer",t.defaultProps=wD,t}(),xD={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[oD]},SD=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id;this.id=n||Xk(this.constructor.name),this.display=!0,this.position=new fS,this.rotation=new fS,this.scale=new fS(1,1,1),this.matrix=new EO,this.userData={},this.props={},this._setScenegraphNodeProps(t)}return b(e,[{key:"delete",value:function(){}},{key:"setProps",value:function(e){return this._setScenegraphNodeProps(e),this}},{key:"toString",value:function(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")}},{key:"setPosition",value:function(e){return Hk(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return Hk(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return Hk(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,o=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),o&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Hk(e),t=t||this.matrix;var n=new EO(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{key:"_setScenegraphNodeProps",value:function(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}]),e}(),ED=function(t){a(i,t);var n=s(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,i);var r=t=Array.isArray(t)?{children:t}:t,o=r.children,a=void 0===o?[]:o;return Ww.assert(a.every(function(e){return e instanceof SD}),"every child must an instance of ScenegraphNode"),(e=n.call(this,t)).children=a,e}return b(i,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),e(p(i.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.worldMatrix,o=void 0===r?new EO:r,a=new EO(o).multiplyRight(this.matrix),s=_(this.children);try{for(s.s();!(t=s.n()).done;){var u=t.value;u instanceof i?u.traverse(e,{worldMatrix:a}):e(u,{worldMatrix:a})}}catch(c){s.e(c)}finally{s.f()}}}]),i}(SD);function CD(){var e=new nS(4);return nS!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function OD(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function TD(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=i*l+a*s+r*c-o*u,e[1]=r*l+a*u+o*s-i*c,e[2]=o*l+a*c+i*u-r*s,e[3]=a*l-i*s-r*u-o*c,e}var AD=uO,PD=function(){var e=iS(),t=rS(1,0,0),n=rS(0,1,0);return function(i,r,o){var a=oS(r,o);return a<-.999999?(aS(e,t,r),function(e){return Math.hypot(e[0],e[1],e[2])}(e)<1e-6&&aS(e,n,r),function(e,t){var n=t[0],i=t[1],r=t[2],o=n*n+i*i+r*r;o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o}(e,e),OD(i,e,Math.PI),i):a>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(aS(e,r,o),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+a,function(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=n*n+i*i+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=i*a,e[2]=r*a,e[3]=o*a,e}(i,i))}}();CD(),CD(),function(){var e=new nS(9);nS!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1}();var MD=[0,0,0,1],ID={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},RD={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function DD(e){if(!e._animation){var t=RD[e.componentType],n=ID[e.type],i=n*e.count,r=e.bufferView.data,o=new t(r.buffer,r.byteOffset+(e.byteOffset||0),i);if(1===n)e._animation=Array.from(o);else{for(var a=[],s=0;s0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return m(this,i),e=n.call(this,-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?e.copy(t):e.set(t,r,o,a),e}return b(i,[{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"set",value:function(e,t,n,i){return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this.check()}},{key:"fromMatrix3",value:function(e){return function(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,e[0]=(t[5]-t[7])*(n=.5/n),e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var o=(r+1)%3,a=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*o+o]-t[3*a+a]+1),e[r]=.5*n,e[3]=(t[3*o+a]-t[3*a+o])*(n=.5/n),e[o]=(t[3*o+r]+t[3*r+o])*n,e[a]=(t[3*a+r]+t[3*r+a])*n}}(this,e),this.check()}},{key:"identity",value:function(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}},{key:"fromAxisRotation",value:function(e,t){return OD(this,e,t),this.check()}},{key:"setAxisAngle",value:function(e,t){return this.fromAxisRotation(e,t)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=Qx(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=Qx(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=Qx(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=Qx(e)}},{key:"len",value:function(){return function(e){return Math.hypot(e[0],e[1],e[2],e[3])}(this)}},{key:"lengthSquared",value:function(){return function(e){var t=e[0],n=e[1],i=e[2],r=e[3];return t*t+n*n+i*i+r*r}(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}(this,e)}},{key:"rotationTo",value:function(e,t){return PD(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(e,t,n){e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3]}(this,this,e),this.check()}},{key:"calculateW",value:function(){return function(e,t){var n=t[0],i=t[1],r=t[2];e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=n*n+i*i+r*r+o*o,s=a?1/a:0;e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=o*s}(this,this),this.check()}},{key:"lerp",value:function(e,t,n){return function(e,t,n,i){var r=t[0],o=t[1],a=t[2],s=t[3];e[0]=r+i*(n[0]-r),e[1]=o+i*(n[1]-o),e[2]=a+i*(n[2]-a),e[3]=s+i*(n[3]-s)}(this,e,t,n),this.check()}},{key:"multiplyRight",value:function(e,t){return Yx(!t),TD(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e,t){return Yx(!t),TD(this,e,this),this.check()}},{key:"normalize",value:function(){var e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+a*s,e[1]=r*u+o*s,e[2]=o*u-r*s,e[3]=a*u-i*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u-o*s,e[1]=r*u+a*s,e[2]=o*u+i*s,e[3]=a*u-r*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=o*u+a*s,e[3]=a*u-o*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return AD(this,this,e),this.check()}},{key:"slerp",value:function(e,n,i){var r;switch(arguments.length){case 1:var o=arguments[0],a=o.start;e=void 0===a?MD:a,n=o.target,i=o.ratio;break;case 2:n=(r=t(arguments,2))[0],i=r[1],e=this}return function(e,t,n,i){var r,o,a,s,u,c=t[0],l=t[1],h=t[2],f=t[3],d=n[0],p=n[1],v=n[2],g=n[3];(o=c*d+l*p+h*v+f*g)<0&&(o=-o,d=-d,p=-p,v=-v,g=-g),1-o>tS?(r=Math.acos(o),a=Math.sin(r),s=Math.sin((1-i)*r)/a,u=Math.sin(i*r)/a):(s=1-i,u=i),e[0]=s*c+u*d,e[1]=s*l+u*p,e[2]=s*h+u*v,e[3]=s*f+u*g}(this,e,n,i),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return function(e,t,n){var i=t[0],r=t[1],o=t[2],a=n[0],s=n[1],u=n[2],c=n[3],l=c*i+s*o-u*r,h=c*r+u*i-a*o,f=c*o+a*r-s*i,d=-a*i-s*r-u*o;e[0]=l*c+d*-a+h*-u-f*-s,e[1]=h*c+d*-s+f*-a-l*-u,e[2]=f*c+d*-u+l*-s-h*-a,e[3]=t[3]}(t,e,this),$x(t,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(e,t){return this.setAxisAngle(e,t)}},{key:"premultiply",value:function(e,t){return this.multiplyLeft(e,t)}},{key:"multiply",value:function(e,t){return this.multiplyRight(e,t)}}]),i}(Kx)),jD=function(){function e(t){m(this,e),this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}return b(e,[{key:"animate",value:function(e){if(this.playing){var t=(e/1e3-this.startTime)*this.speed;this.channels.forEach(function(e){var n=e.sampler,i=e.target,r=e.path;(function(e,t,n,i){var r=t.input,o=t.interpolation,a=t.output,s=e%r[r.length-1],u=r.findIndex(function(e){return e>=s}),c=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:Ww.warn("Bad animation path ".concat(i))()}Hk(n[i].length===a[c].length);var l=r[c],h=r[u];switch(o){case"STEP":!function(e,t,n){for(var i=0;il&&function(e,t,n,i,r){if("rotation"===t){LD.slerp({start:n,target:i,ratio:r});for(var o=0;ol&&function(e,t,n){for(var i=n.p0,r=n.outTangent0,o=n.inTangent1,a=n.p1,s=n.tDiff,u=n.ratio,c=0;c1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,r)).onBeforeRender=null,t.AfterRender=null,e instanceof PC?(t.model=e,t._setModelNodeProps(r)):t.model=new PC(e,r),t.managedResources=r.managedResources||[],t}return b(i,[{key:"setProps",value:function(t){return e(p(i.prototype),"setProps",this).call(this,t),this._setModelNodeProps(t),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),i}(SD),VD=function(){function e(t,n){var i=n.attributes,r=n.material,o=n.pbrDebug,a=n.imageBasedLightingEnvironment,s=n.lights,u=n.useTangents;m(this,e),this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Dx(t,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],a&&(this.uniforms.u_DiffuseEnvSampler=a.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=a.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=a.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),o&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(i.NORMAL,"HAS_NORMALS"),this.defineIfPresent(i.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(i.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(a,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(o,"PBR_DEBUG"),r&&this.parseMaterial(r)}return b(e,[{key:"defineIfPresent",value:function(e,t){e&&(this.defines[t]=1)}},{key:"parseTexture",value:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.texture.source.image,a={};r.compressed?(n=r,a=o({},this.gl.TEXTURE_MIN_FILTER,r.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):n={data:r};var s=new mx(this.gl,M({id:e.name||e.id,parameters:M(M({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:o({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},n));this.uniforms[t]=s,this.defineIfPresent(i,i),this.generatedTextures.push(s)}},{key:"parsePbrMetallicRoughness",value:function(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var t=e.metallicFactor,n=void 0===t?1:t,i=e.roughnessFactor,r=void 0===i?1:i;this.uniforms.u_MetallicRoughnessValues=[n,r]}},{key:"parseMaterial",value:function(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,n=void 0===t?1:t;this.uniforms.u_NormalScale=n}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,r=void 0===i?1:i;this.uniforms.u_OcclusionStrength=r}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var o=e.alphaCutoff,a=void 0===o?.5:o;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=a}else"BLEND"===e.alphaMode&&(Ww.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}]),e}();function zD(e,t){return Yw(e)?"#version 300 es\n".concat(t):t}var UD={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},HD={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},GD=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.gl=t,this.options=Object.assign({},HD,n)}return b(e,[{key:"instantiate",value:function(e){var t=this;return this.gltf=e,(e.scenes||[]).map(function(e){return t.createScene(e)})}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new FD(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new ED({id:e.name||e.id,children:n})}},{key:"createNode",value:function(e){var t=this;if(!e._node){var n=(e.children||[]).map(function(e){return t.createNode(e)});e.mesh&&n.push(this.createMesh(e.mesh));var i=new ED({id:e.name||e.id,children:n});if(e.matrix)i.setMatrix(e.matrix);else{if(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation){var r=(new EO).fromQuaternion(e.rotation);i.matrix.multiplyRight(r)}e.scale&&i.matrix.scale(e.scale)}e._node=i}return e._node}},{key:"createMesh",value:function(e){var t=this;if(!e._mesh){var n=(e.primitives||[]).map(function(n,i){return t.createPrimitive(n,i,e)}),i=new ED({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){Ww.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,t,n){return function(e,t){var n=t.id,i=t.drawMode,r=t.vertexCount,o=t.attributes,a=t.modelOptions,s=new VD(e,t);Ww.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,v(s.generatedTextures)),u.push.apply(u,v(Object.values(o).map(function(e){return e.buffer})));var c=new BD(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[xD],defines:s.defines,parameters:s.parameters,vs:zD(e,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:zD(e,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:u},a));return c.setProps({attributes:o}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:e.name||"".concat(n.name||n.id,"-primitive-").concat(t),drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}},{key:"createAttributes",value:function(e,t){var n=this,i={};return Object.keys(e).forEach(function(t){i[t]=n.createAccessor(e[t],n.createBuffer(e[t],n.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),Ww.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}},{key:"createBuffer",value:function(e,t){e.bufferView||(e.bufferView={});var n=e.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new cx(this.gl,{id:"from-".concat(n.id),data:n.data||e.value,target:t})),n.lumaBuffers[t]}},{key:"createAccessor",value:function(e,t){return new ox({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:UD[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();function WD(e,t,n){if(e.byteLength<=t+n)return"";for(var i=new DataView(e),r="",o=0;o")}}]),i}(JD,Symbol.toStringTag),hN=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;m(this,e),mA(this,"name",void 0),mA(this,"type",void 0),mA(this,"nullable",void 0),mA(this,"metadata",void 0),this.name=t,this.type=n,this.nullable=i,this.metadata=r}return b(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),e}();function fN(e,t,n){var i=n?dN(n.metadata):void 0,r=function(e){switch(e.constructor){case Int8Array:return new tN;case Uint8Array:return new rN;case Int16Array:return new nN;case Uint16Array:return new oN;case Int32Array:return new iN;case Uint32Array:return new aN;case Float32Array:return new uN;case Float64Array:return new cN;default:throw new Error("array type not supported")}}(t.value);return new hN(e,new lN(t.size,new hN("value",r)),!1,i)}function dN(e){var t=new Map;for(var n in e)t.set("".concat(n,".string"),JSON.stringify(e[n]));return t}var pN={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},vN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},gN=function(){function e(t){m(this,e),mA(this,"draco",void 0),mA(this,"decoder",void 0),mA(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return b(e,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);var i=this.decoder.GetEncodedGeometryType(n),r=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,r);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!r.ptr){var a="DRACO decompression failed: ".concat(o.error_msg());throw new Error(a)}var s=this._getDracoLoaderData(r,i,t),u=this._getMeshData(r,s,t),c=function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length,c=0;cr?l:r,o=h>o?h:o,a=f>a?f:a}return[[t,n,i],[r,o,a]]}(u.attributes),l=function(e,t,n){var i=dN(t.metadata),r=[],o=function(e){var t={};for(var n in e){var i=e[n];t[i.name||"undefined"]=i}return t}(t.attributes);for(var a in e){var s=fN(a,e[a],o[a]);r.push(s)}if(n){var u=fN("indices",n);r.push(u)}return new $D(r,i)}(u.attributes,s,u.indices);return I(M({loader:"draco",loaderData:s,header:{vertexCount:r.num_points(),boundingBox:c}},u),{schema:l})}finally{this.draco.destroy(n),r&&this.draco.destroy(r)}}},{key:"_getDracoLoaderData",value:function(e,t,n){var i=this._getTopLevelMetadata(e),r=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:i,attributes:r}}},{key:"_getDracoAttributes",value:function(e,t){for(var n={},i=0;i1&&void 0!==r[1]?r[1]:null,i=r.length>2&&void 0!==r[2]?r[2]:{},n&&(t=wN(t,n,i)),yN[t]=yN[t]||kN(t),e.next=6,yN[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function wN(e,t,n){if(e.startsWith("http"))return e;var i=n.modules||{};return i[e]?i[e]:RA?n.CDN?(AA(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(t,"@3.0.12/dist/libs/").concat(e)):DA?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function kN(e){return xN.apply(this,arguments)}function xN(){return(xN=Sx(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=8;break}return e.next=3,fetch(t);case 3:return e.next=5,e.sent.arrayBuffer();case 5:e.t0=e.sent,e.next=31;break;case 8:if(!RA){e.next=24;break}if(!DA){e.next=13;break}e.t2=importScripts(t),e.next=21;break;case 13:return e.t3=SN,e.next=16,fetch(t);case 16:return e.next=18,e.sent.text();case 18:e.t4=e.sent,e.t5=t,e.t2=(0,e.t3)(e.t4,e.t5);case 21:e.t1=e.t2,e.next=30;break;case 24:if(e.t6=mN.requireFromFile,!e.t6){e.next=29;break}return e.next=28,mN.requireFromFile(t);case 28:e.t6=e.sent;case 29:e.t1=e.t6;case 30:e.t0=e.t1;case 31:return e.abrupt("return",e.t0);case 32:case"end":return e.stop()}},e)}))).apply(this,arguments)}function SN(e,t){if(!RA)return mN.requireFromString&&mN.requireFromString(e,t);if(DA)return eval.call(IA,e),null;var n=document.createElement("script");n.id=t;try{n.appendChild(document.createTextNode(e))}catch(i){n.text=e}return document.body.appendChild(n),null}var EN,CN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",ON="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",TN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";function AN(e){return PN.apply(this,arguments)}function PN(){return(PN=Sx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.modules||{},EN=n.draco3d?EN||n.draco3d.createDecoderModule({}).then(function(e){return{draco:e}}):EN||MN(t),e.next=4,EN;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function MN(e){return IN.apply(this,arguments)}function IN(){return(IN=Sx(regeneratorRuntime.mark(function e(n){var i,r,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.draco&&n.draco.decoderType,e.next="js"===e.t0?3:(e.t0,7);break;case 3:return e.next=5,bN(CN,"draco",n);case 5:return i=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,bN(ON,"draco",n);case 10:return e.t2=e.sent,e.next=13,bN(TN,"draco",n);case 13:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=17,e.t1.all.call(e.t1,e.t4);case 17:o=e.sent,a=t(o,2),i=a[0],r=a[1];case 21:return i=i||globalThis.DracoDecoderModule,e.next=24,RN(i,r);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}},e)}))).apply(this,arguments)}function RN(e,t){var n={};return t&&(n.wasmBinary=t),new Promise(function(t){e(I(M({},n),{onModuleLoaded:function(e){return t({draco:e})}}))})}var DN=I(M({},QD),{parse:function(e,t){return NN.apply(this,arguments)}});function NN(){return(NN=Sx(regeneratorRuntime.mark(function e(t,n){var i,r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,AN(n);case 2:return i=e.sent,r=i.draco,o=new gN(r),e.prev=5,e.abrupt("return",o.parseSync(t,null==n?void 0:n.draco));case 7:return e.prev=7,o.destroy(),e.finish(7);case 10:case"end":return e.stop()}},e,null,[[5,,7,10]])}))).apply(this,arguments)}function LN(e,t){return UT(e>=0),UT(t>0),e+(t-1)&~(t-1)}function jN(e,t,n){var i;return i=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer||e.arrayBuffer,e.byteOffset,e.byteLength),t.set(i,n),n+LN(i.byteLength,4)}var FN=["SCALAR","VEC2","VEC3","VEC4"],BN=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],VN=new Map(BN),zN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},UN={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},HN={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function GN(e){return FN[e-1]||FN[0]}function WN(e){var t=VN.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function qN(e,t){var n=HN[e.componentType],i=zN[e.type],r=e.count*i,o=e.count*i*UN[e.componentType];return qD(o>=0&&o<=t.byteLength),{ArrayType:n,length:r,byteLength:o}}var XN={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},YN=function(){function e(t){m(this,e),mA(this,"gltf",void 0),mA(this,"sourceBuffers",void 0),mA(this,"byteLength",void 0),this.gltf=t||{json:M({},XN),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}return b(e,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){return this.json[e]}},{key:"getExtraData",value:function(e){return(this.json.extras||{})[e]}},{key:"getExtension",value:function(e){return this.getUsedExtensions().find(function(t){return t===e})?(this.json.extensions||{})[e]||!0:null}},{key:"getRequiredExtension",value:function(e){return this.getRequiredExtensions().find(function(t){return t===e})?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(e,t){return(e.extensions||{})[t]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,t){if("object"==typeof t)return t;var n=this.json[e]&&this.json[e][t];if(!n)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return n}},{key:"getTypedArrayForBufferView",value:function(e){e=this.getBufferView(e);var t=this.gltf.buffers[e.buffer];return qD(t),new Uint8Array(t.arrayBuffer,(e.byteOffset||0)+t.byteOffset,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),n=this.getBuffer(t.buffer).data,i=qN(e,t),r=i.ArrayType,o=i.length;return new r(n,t.byteOffset+e.byteOffset,o)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),n=this.getBuffer(t.buffer).data;return new Uint8Array(n,t.byteOffset||0,t.byteLength)}},{key:"addApplicationData",value:function(e,t){return this.json[e]=t,this}},{key:"addExtraData",value:function(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}},{key:"addObjectExtension",value:function(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}},{key:"setObjectExtension",value:function(e,t,n){(e.extensions||{})[t]=n}},{key:"removeObjectExtension",value:function(e,t){var n=e.extensions||{},i=n[t];return delete n[t],i}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qD(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}},{key:"addRequiredExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qD(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(function(t){return t===e})||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(function(t){return t===e})||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var t=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var t=e.meshIndex,n=e.matrix;this.json.nodes=this.json.nodes||[];var i={mesh:t};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var t=e.attributes,n=e.indices,i=e.material,r=e.mode,o=void 0===r?4:r,a={primitives:[{attributes:this._addAttributes(t),mode:o}]};if(n){var s=this._addIndices(n);a.primitives[0].indices=s}return Number.isFinite(i)&&(a.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}},{key:"addImage",value:function(e,t){var n=eR(e),i=t||(null==n?void 0:n.mimeType),r={bufferView:this.addBufferView(e),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}},{key:"addBufferView",value:function(e){var t=e.byteLength;qD(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var n={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=LN(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,t){var n={bufferView:e,type:GN(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},n=this.addBufferView(e),i={min:t.min,max:t.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(e,t.size));var r={size:t.size,componentType:WN(e),count:Math.round(e.length/t.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,t))}},{key:"addTexture",value:function(e){var t={source:e.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(t),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,t;this.gltf.buffers=[];var n,i=this.byteLength,r=new ArrayBuffer(i),o=new Uint8Array(r),a=0,s=_(this.sourceBuffers||[]);try{for(s.s();!(n=s.n()).done;){a=jN(n.value,o,a)}}catch(u){s.e(u)}finally{s.f()}null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}},{key:"_removeStringFromArray",value:function(e,t){for(var n=!0;n;){var i=e.indexOf(t);i>-1?e.splice(i,1):n=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};for(var n in e){var i=e[n],r=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);t[r]=o}return t}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}},{key:"_getAccessorMinMax",value:function(e,t){var n={min:null,max:null};if(e.length2&&void 0!==arguments[2]&&arguments[2];return e?Array.isArray(e)?new t(e):!n||e instanceof t?e:new t(e):null}(t,Float32Array)),i=t.length/n),{buffer:t,size:n,count:i}}(e),n=t.buffer,i=t.size;return{value:n,size:i,byteOffset:0,count:t.count,type:GN(i),componentType:WN(n)}}function nL(e,t,n){return iL.apply(this,arguments)}function iL(){return(iL=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o,a,s,u,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=n&&null!==(r=n.gltf)&&void 0!==r&&r.decompressMeshes){e.next=2;break}return e.abrupt("return");case 2:o=new YN(t),a=[],s=_(cL(o));try{for(s.s();!(u=s.n()).done;)c=u.value,o.getObjectExtension(c,QN)&&a.push(oL(o,c,n,i))}catch(l){s.e(l)}finally{s.f()}return e.next=7,Promise.all(a);case 7:o.removeExtension(QN);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function rL(e){var t,n=new YN(e),i=_(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var r=t.value;sL(r),n.addRequiredExtension(QN)}}catch(o){i.e(o)}finally{i.f()}}function oL(e,t,n,i){return aL.apply(this,arguments)}function aL(){return(aL=Sx(regeneratorRuntime.mark(function e(n,i,r,o){var a,s,u,c,l,h,f,d,p,v,g,m,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getObjectExtension(i,QN)){e.next=3;break}return e.abrupt("return");case 3:return s=n.getTypedArrayForBufferView(a.bufferView),u=nP(s.buffer,s.byteOffset),c=o.parse,delete(l=M({},r))["3d-tiles"],e.next=7,c(u,DN,l,o);case 7:for(h=e.sent,f=eL(h.attributes),d=0,p=Object.entries(f);d2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var s=r.DracoWriter.encodeSync({attributes:e}),u=null==a||null===(n=a.parseSync)||void 0===n?void 0:n.call(a,{attributes:e}),c=r._addFauxAttributes(u.attributes),l=r.addBufferView(s);return{primitives:[{attributes:c,mode:i,extensions:o({},QN,{bufferView:l,attributes:c})}]}}function uL(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function cL(e){var t,n,i,r,o,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:t=_(e.json.meshes||[]),s.prev=1,t.s();case 3:if((n=t.n()).done){s.next=24;break}i=n.value,r=_(i.primitives),s.prev=6,r.s();case 8:if((o=r.n()).done){s.next=14;break}return a=o.value,s.next=12,a;case 12:s.next=8;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(6),r.e(s.t0);case 19:return s.prev=19,r.f(),s.finish(19);case 22:s.next=3;break;case 24:s.next=29;break;case 26:s.prev=26,s.t1=s.catch(1),t.e(s.t1);case 29:return s.prev=29,t.f(),s.finish(29);case 32:case"end":return s.stop()}},T,null,[[1,26,29,32],[6,16,19,22]])}function lL(e){return hL.apply(this,arguments)}function hL(){return(hL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=new YN(t),i=n.json,n.removeExtension(ZN),r=_(i.materials||[]);try{for(r.s();!(o=r.n()).done;)(a=o.value).extensions&&a.extensions.KHR_materials_unlit&&(a.unlit=!0),n.removeObjectExtension(a,ZN)}catch(s){r.e(s)}finally{r.f()}case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function fL(e){var t=new YN(e),n=t.json;if(t.materials){var i,r=_(n.materials||[]);try{for(r.s();!(i=r.n()).done;){var o=i.value;o.unlit&&(delete o.unlit,t.addObjectExtension(o,ZN,{}),t.addExtension(ZN))}}catch(a){r.e(a)}finally{r.f()}}}function dL(e){return pL.apply(this,arguments)}function pL(){return(pL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=new YN(t),i=n.json,(r=n.getExtension($N))&&(n.json.lights=r.lights,n.removeExtension($N)),o=_(i.nodes||[]);try{for(o.s();!(a=o.n()).done;)s=a.value,(u=n.getObjectExtension(s,$N))&&(s.light=u.light),n.removeObjectExtension(s,$N)}catch(c){o.e(c)}finally{o.f()}case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function vL(e){return gL.apply(this,arguments)}function gL(){return(gL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new YN(t),(i=n.json).lights&&(qD(!(r=n.addExtension($N)).lights),r.lights=i.lights,delete i.lights),n.json.lights){o=_(n.json.lights);try{for(o.s();!(a=o.n()).done;)s=a.value,n.addObjectExtension(s.node,$N,s)}catch(u){o.e(u)}finally{o.f()}delete n.json.lights}case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function mL(e){return yL.apply(this,arguments)}function yL(){return(yL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s,u,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new YN(t),i=n.json,r=n.getExtension(JN)){o=wL(r,n),a=_(i.materials||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,(c=n.getObjectExtension(u,JN))&&(u.technique=Object.assign({},c,o[c.technique]),u.technique.values=kL(u.technique,n)),n.removeObjectExtension(u,JN)}catch(l){a.e(l)}finally{a.f()}n.removeExtension(JN)}case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function bL(e,t){return _L.apply(this,arguments)}function _L(){return(_L=Sx(regeneratorRuntime.mark(function e(t,n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)}))).apply(this,arguments)}function wL(e,t){var n=e.programs,i=void 0===n?[]:n,r=e.shaders,o=void 0===r?[]:r,a=e.techniques,s=void 0===a?[]:a,u=new TextDecoder;return o.forEach(function(e){if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=u.decode(t.getTypedArrayForBufferView(e.bufferView))}),i.forEach(function(e){e.fragmentShader=o[e.fragmentShader],e.vertexShader=o[e.vertexShader]}),s.forEach(function(e){e.program=i[e.program]}),s}function kL(e,t){var n=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(function(t){e.uniforms[t].value&&!(t in n)&&(n[t]=e.uniforms[t].value)}),Object.keys(n).forEach(function(e){"object"==typeof n[e]&&void 0!==n[e].index&&(n[e].texture=t.getTexture(n[e].index))}),n}var xL={KHR_draco_mesh_compression:P,KHR_materials_unlit:R,KHR_lights_punctual:D,KHR_techniques_webgl:N};function SL(e){return EL.apply(this,arguments)}function EL(){return(EL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=s.length>1&&void 0!==s[1]?s[1]:{},i=s.length>2?s[2]:void 0,e.t0=regeneratorRuntime.keys(xL);case 3:if((e.t1=e.t0()).done){e.next=12;break}if(r=e.t1.value,a=(null==n||null===(o=n.gltf)||void 0===o?void 0:o.excludeExtensions)||{},e.t2=r in a&&!a[r],e.t2){e.next=10;break}return e.next=10,xL[r].decode(t,n,i);case 10:e.next=3;break;case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}var CL={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},OL={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},TL=function(){function e(t){m(this,e),this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}return b(e,[{key:"normalize",value:function(e,t){this.json=e.json;var n=e.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(n.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(e){var t,n=new YN(e),i=n.json,r=_(i.images||[]);try{for(r.s();!(t=r.n()).done;){var o=t.value,a=n.removeObjectExtension(o,KN);a&&Object.assign(o,a)}}catch(s){r.e(s)}finally{r.f()}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,n.removeExtension(KN)}(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var t in CL)this._convertTopLevelObjectToArray(e,t)}},{key:"_convertTopLevelObjectToArray",value:function(e,t){var n=e[t];if(n&&!Array.isArray(n))for(var i in e[t]=[],n){var r=n[i];r.id=r.id||i;var o=e[t].length;e[t].push(r),this.idToIndexMap[t][i]=o}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var t in CL)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var n,i=_(e.textures);try{for(i.s();!(n=i.n()).done;){var r=n.value;this._convertTextureIds(r)}}catch(p){i.e(p)}finally{i.f()}var o,a=_(e.meshes);try{for(a.s();!(o=a.n()).done;){var s=o.value;this._convertMeshIds(s)}}catch(p){a.e(p)}finally{a.f()}var u,c=_(e.nodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;this._convertNodeIds(l)}}catch(p){c.e(p)}finally{c.f()}var h,f=_(e.scenes);try{for(f.s();!(h=f.n()).done;){var d=h.value;this._convertSceneIds(d)}}catch(p){f.e(p)}finally{f.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var t,n=_(e.primitives);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.attributes,o=i.indices,a=i.material;for(var s in r)r[s]=this._convertIdToIndex(r[s],"accessor");o&&(i.indices=this._convertIdToIndex(o,"accessor")),a&&(i.material=this._convertIdToIndex(a,"material"))}}catch(u){n.e(u)}finally{n.f()}}},{key:"_convertNodeIds",value:function(e){var t=this;e.children&&(e.children=e.children.map(function(e){return t._convertIdToIndex(e,"node")})),e.meshes&&(e.meshes=e.meshes.map(function(e){return t._convertIdToIndex(e,"mesh")}))}},{key:"_convertSceneIds",value:function(e){var t=this;e.nodes&&(e.nodes=e.nodes.map(function(e){return t._convertIdToIndex(e,"node")}))}},{key:"_convertIdsToIndices",value:function(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);var n,i=_(e[t]);try{for(i.s();!(n=i.n()).done;){var r=n.value;for(var o in r){var a=this._convertIdToIndex(r[o],o);r[o]=a}}}catch(s){i.e(s)}finally{i.f()}}},{key:"_convertIdToIndex",value:function(e,t){var n=OL[t];if(n in this.idToIndexMap){var i=this.idToIndexMap[n][e];if(!Number.isFinite(i))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return i}return e}},{key:"_updateObjects",value:function(e){var t,n=_(this.json.buffers);try{for(n.s();!(t=n.n()).done;){delete t.value.type}}catch(i){n.e(i)}finally{n.f()}}},{key:"_updateMaterial",value:function(e){var t,n=_(e.materials);try{var i=function(){var n=t.value;n.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var i=n.values&&n.values.tex,r=e.textures.findIndex(function(e){return e.id===i});-1!==r&&(n.pbrMetallicRoughness.baseColorTexture={index:r})};for(n.s();!(t=n.n()).done;)i()}catch(r){n.e(r)}finally{n.f()}}}]),e}();function AL(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new TL).normalize(e,t)}var PL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ML={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},IL={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},RL={magFilter:IL.TEXTURE_MAG_FILTER,minFilter:IL.TEXTURE_MIN_FILTER,wrapS:IL.TEXTURE_WRAP_S,wrapT:IL.TEXTURE_WRAP_T},DL=(o(k={},IL.TEXTURE_MAG_FILTER,IL.LINEAR),o(k,IL.TEXTURE_MIN_FILTER,IL.NEAREST_MIPMAP_LINEAR),o(k,IL.TEXTURE_WRAP_S,IL.REPEAT),o(k,IL.TEXTURE_WRAP_,IL.REPEAT),k),NL=function(){function e(){m(this,e)}return b(e,[{key:"postProcess",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.json,i=e.buffers,r=void 0===i?[]:i,o=e.images,a=void 0===o?[]:o,s=e.baseUri,u=void 0===s?"":s;return qD(n),this.baseUri=u,this.json=n,this.buffers=r,this.images=a,this._resolveTree(this.json,t),this.json}},{key:"_resolveTree",value:function(e){var t=this;e.bufferViews&&(e.bufferViews=e.bufferViews.map(function(e,n){return t._resolveBufferView(e,n)})),e.images&&(e.images=e.images.map(function(e,n){return t._resolveImage(e,n)})),e.samplers&&(e.samplers=e.samplers.map(function(e,n){return t._resolveSampler(e,n)})),e.textures&&(e.textures=e.textures.map(function(e,n){return t._resolveTexture(e,n)})),e.accessors&&(e.accessors=e.accessors.map(function(e,n){return t._resolveAccessor(e,n)})),e.materials&&(e.materials=e.materials.map(function(e,n){return t._resolveMaterial(e,n)})),e.meshes&&(e.meshes=e.meshes.map(function(e,n){return t._resolveMesh(e,n)})),e.nodes&&(e.nodes=e.nodes.map(function(e,n){return t._resolveNode(e,n)})),e.skins&&(e.skins=e.skins.map(function(e,n){return t._resolveSkin(e,n)})),e.scenes&&(e.scenes=e.scenes.map(function(e,n){return t._resolveScene(e,n)})),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,t){if("object"==typeof t)return t;var n=this.json[e]&&this.json[e][t];return n||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),n}},{key:"_resolveScene",value:function(e,t){var n=this;return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map(function(e){return n.getNode(e)}),e}},{key:"_resolveNode",value:function(e,t){var n=this;return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map(function(e){return n.getNode(e)})),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce(function(e,t){var i=n.getMesh(t);return e.id=i.id,e.primitives=e.primitives.concat(i.primitives),e},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,t){var n=this;return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map(function(e){var t=(e=M({},e)).attributes;for(var i in e.attributes={},t)e.attributes[i]=n.getAccessor(t[i]);return void 0!==e.indices&&(e.indices=n.getAccessor(e.indices)),void 0!==e.material&&(e.material=n.getMaterial(e.material)),e})),e}},{key:"_resolveMaterial",value:function(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture=M({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=M({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=M({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=M({},e.pbrMetallicRoughness);var n=e.pbrMetallicRoughness;n.baseColorTexture&&(n.baseColorTexture=M({},n.baseColorTexture),n.baseColorTexture.texture=this.getTexture(n.baseColorTexture.index)),n.metallicRoughnessTexture&&(n.metallicRoughnessTexture=M({},n.metallicRoughnessTexture),n.metallicRoughnessTexture.texture=this.getTexture(n.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,t){if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(e){return ML[e]}(e.componentType),e.components=function(e){return PL[e]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var n=e.bufferView.buffer,i=qN(e,e.bufferView),r=i.ArrayType,o=i.byteLength,a=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+n.byteOffset,s=n.arrayBuffer.slice(a,a+o);e.value=new r(s)}return e}},{key:"_resolveTexture",value:function(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):DL,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,t){for(var n in e.id=e.id||"sampler-".concat(t),e.parameters={},e){var i=this._enumSamplerParameter(n);void 0!==i&&(e.parameters[i]=e[n])}return e}},{key:"_enumSamplerParameter",value:function(e){return RL[e]}},{key:"_resolveImage",value:function(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));var n=this.images[t];return n&&(e.image=n),e}},{key:"_resolveBufferView",value:function(e,t){e.id=e.id||"bufferView-".concat(t);var n=e.buffer;e.buffer=this.buffers[n];var i=this.buffers[n].byteOffset||0;return"byteOffset"in e&&(i+=e.byteOffset),e.data=new Uint8Array(this.buffers[n].arrayBuffer,i,e.byteLength),e}},{key:"_resolveCamera",value:function(e,t){return e.id=e.id||"camera-".concat(t),e}}]),e}();function LL(e,t){return(new NL).postProcess(e,t)}var jL=1735152710,FL=!0;function BL(e,t,n,i){var r=new Uint8Array(t.buffer,n,i),o=new TextDecoder("utf8").decode(r);return e.json=JSON.parse(o),LN(i,4)}function VL(e,t,n,i){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:t.buffer}),LN(i,4)}function zL(e,t){return UL.apply(this,arguments)}function UL(){return(UL=Sx(regeneratorRuntime.mark(function e(t,n){var i,r,o,a,s,u,c,l,h,f,d=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=d.length>2&&void 0!==d[2]?d[2]:0,r=d.length>3?d[3]:void 0,o=d.length>4?d[4]:void 0,HL(t,n,i,r),AL(t,{normalize:null==r||null===(a=r.gltf)||void 0===a?void 0:a.normalize}),l=[],e.t0=null!=r&&null!==(s=r.gltf)&&void 0!==s&&s.loadBuffers&&t.json.buffers,!e.t0){e.next=9;break}return e.next=9,GL(t,r,o);case 9:if(null==r||null===(u=r.gltf)||void 0===u||!u.loadImages){e.next=12;break}h=qL(t,r,o),l.push(h);case 12:return f=SL(t,r,o),l.push(f),e.next=16,Promise.all(l);case 16:return e.abrupt("return",null!=r&&null!==(c=r.gltf)&&void 0!==c&&c.postProcess?LL(t,r):t);case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function HL(e,t,n,i){if(i.uri&&(e.baseUri=i.uri),t instanceof ArrayBuffer&&!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new DataView(e),r=n.magic,o=void 0===r?jL:r,a=i.getUint32(t,!1);return a===o||a===jL}(t,n,i)&&(t=(new TextDecoder).decode(t)),"string"==typeof t)e.json=function(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return"string"==typeof e?e.slice(0,t):ArrayBuffer.isView(e)?WD(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?WD(e,0,t):""}(e),'"'))}}(t);else if(t instanceof ArrayBuffer){var r={};n=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=new DataView(t),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}(i,n+0),o=i.getUint32(n+4,FL),a=i.getUint32(n+8,FL);switch(Object.assign(e,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:r,version:o,json:{},binChunks:[]}),n+=12,e.version){case 1:return function(e,t,n){UT(e.header.byteLength>20);var i=t.getUint32(n+0,FL),r=t.getUint32(n+4,FL);return n+=8,UT(0===r),BL(e,t,n,i),(n+=i)+VL(e,t,n,e.header.byteLength)}(e,i,n);case 2:return function(e,t,n,i){return UT(e.header.byteLength>20),function(e,t,n,i){for(;n+8<=e.header.byteLength;){var r=t.getUint32(n+0,FL),o=t.getUint32(n+4,FL);switch(n+=8,o){case 1313821514:BL(e,t,n,r);break;case 5130562:VL(e,t,n,r);break;case 0:i.strict||BL(e,t,n,r);break;case 1:i.strict||VL(e,t,n,r)}n+=LN(r,4)}}(e,t,n,{}),n+e.header.byteLength}(e,i,n);default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}(r,t,n,i.glb),qD("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),e._glb=r,e.json=r.json}else qD(!1,"GLTF: must be ArrayBuffer or string");if(e.buffers=new Array((e.json.buffers||[]).length).fill(null),e._glb&&e._glb.header.hasBinChunk){var o=e._glb.binChunks;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}e.images=new Array((e.json.images||[]).length).fill({})}function GL(e,t,n){return WL.apply(this,arguments)}function WL(){return(WL=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o,a,s,u,c,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r1&&void 0!==a[1]?a[1]:{},i=a.length>2?a[2]:void 0,(n=M(M({},QL.options),n)).gltf=M(M({},QL.options.gltf),n.gltf),r=n.byteOffset,o=void 0===r?0:r,e.next=6,zL({},t,o,n,i);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ZL(){return(ZL=Sx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach(function(e){e.traverse(function(e){Object.values(e.model.getUniforms()).forEach(function(e){!1===e.loaded&&n.push(e)})})}),e.next=4,JL(function(){return n.some(function(e){return!e.loaded})});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function JL(e){return ej.apply(this,arguments)}function ej(){return(ej=Sx(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise(function(e){return requestAnimationFrame(e)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}var tj=[255,255,255,255],nj={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"==typeof e.scene?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:tj},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[QL]},ij=function(){var t=function(t){a(i,t);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"getShaders",value:function(){var e=[tD,cD];return"pbr"===this.props._lighting&&e.push(xD),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:e}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:tj,transition:!0},instanceModelMatrix:mD})}},{key:"updateState",value:function(t){e(p(i.prototype),"updateState",this).call(this,t);var n=t.props,r=t.oldProps;n.scenegraph!==r.scenegraph?this._updateScenegraph(n):n._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){e(p(i.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t=this,n=this.context.gl,i=null;if(e.scenegraph instanceof SD)i={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,o=function(e,t,n){var i=new GD(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(n,r,this._getModelOptions());i=M({gltf:r},o),function(e){return ZL.apply(this,arguments)}(o).then(function(){return t.setNeedsRedraw()})}else e.scenegraph&&(zw.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),i=e.scenegraph);var a={layer:this,gl:n},s=e.getScene(i,a),u=e.getAnimator(i,a);s instanceof SD?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&zw.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).sort().forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var i=e.id,r=void 0===i?Xk("cube-geometry"):i;return t.call(this,I(M({},e),{id:r,indices:{size:1,value:new Uint16Array(rj)},attributes:M(M({},uj),e.attributes)}))}return n}(hD),lj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0,0,0,0,0,0,0];m(this,e),this.elements=void 0,this.elements=t}return b(e,[{key:"identity",value:function(){var e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}},{key:"setZero",value:function(){var e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}},{key:"setTrace",value:function(e){var t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}},{key:"getTrace",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fj,t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}},{key:"vmult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj,n=this.elements,i=e.x,r=e.y,o=e.z;return t.x=n[0]*i+n[1]*r+n[2]*o,t.y=n[3]*i+n[4]*r+n[5]*o,t.z=n[6]*i+n[7]*r+n[8]*o,t}},{key:"smult",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:new e,i=this.elements,r=t.elements,o=n.elements,a=i[0],s=i[1],u=i[2],c=i[3],l=i[4],h=i[5],f=i[6],d=i[7],p=i[8],v=r[0],g=r[1],m=r[2],y=r[3],b=r[4],_=r[5],w=r[6],k=r[7],x=r[8];return o[0]=a*v+s*y+u*w,o[1]=a*g+s*b+u*k,o[2]=a*m+s*_+u*x,o[3]=c*v+l*y+h*w,o[4]=c*g+l*b+h*k,o[5]=c*m+l*_+h*x,o[6]=f*v+d*y+p*w,o[7]=f*g+d*b+p*k,o[8]=f*m+d*_+p*x,n}},{key:"scale",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e,i=this.elements,r=n.elements,o=0;3!==o;o++)r[3*o+0]=t.x*i[3*o+0],r[3*o+1]=t.y*i[3*o+1],r[3*o+2]=t.z*i[3*o+2];return n}},{key:"solve",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj,r=[];for(t=0;t<12;t++)r.push(0);for(t=0;t<3;t++)for(n=0;n<3;n++)r[t+4*n]=this.elements[t+3*n];r[3]=e.x,r[7]=e.y,r[11]=e.z;var o,a,s=3,u=s;do{if(0===r[(t=u-s)+4*t])for(n=t+1;n0&&void 0!==arguments[0]?arguments[0]:new e,r=hj;for(t=0;t<3;t++)for(n=0;n<3;n++)r[t+6*n]=this.elements[t+3*n];r[3]=1,r[9]=0,r[15]=0,r[4]=0,r[10]=1,r[16]=0,r[5]=0,r[11]=0,r[17]=1;var o,a,s=3,u=s;do{if(0===r[(t=u-s)+6*t])for(n=t+1;n0&&void 0!==arguments[0]?arguments[0]:new e,i=this.elements,r=n.elements;return r[0]=i[0],r[4]=i[4],r[8]=i[8],t=i[1],r[1]=i[3],r[3]=t,t=i[2],r[2]=i[6],r[6]=t,t=i[5],r[5]=i[7],r[7]=t,n}}]),e}(),hj=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],fj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;m(this,e),this.x=void 0,this.y=void 0,this.z=void 0,this.x=t,this.y=n,this.z=i}return b(e,[{key:"cross",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e,i=t.x,r=t.y,o=t.z,a=this.x,s=this.y,u=this.z;return n.x=s*o-u*r,n.y=u*i-a*o,n.z=a*r-s*i,n}},{key:"set",value:function(e,t,n){return this.x=e,this.y=t,this.z=n,this}},{key:"setZero",value:function(){this.x=this.y=this.z=0}},{key:"vadd",value:function(t,n){if(!n)return new e(this.x+t.x,this.y+t.y,this.z+t.z);n.x=t.x+this.x,n.y=t.y+this.y,n.z=t.z+this.z}},{key:"vsub",value:function(t,n){if(!n)return new e(this.x-t.x,this.y-t.y,this.z-t.z);n.x=this.x-t.x,n.y=this.y-t.y,n.z=this.z-t.z}},{key:"crossmat",value:function(){return new lj([0,-this.z,this.y,this.z,0,-this.x,-this.y,this.x,0])}},{key:"normalize",value:function(){var e=this.x,t=this.y,n=this.z,i=Math.sqrt(e*e+t*t+n*n);if(i>0){var r=1/i;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return i}},{key:"unit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new e,n=this.x,i=this.y,r=this.z,o=Math.sqrt(n*n+i*i+r*r);return o>0?(o=1/o,t.x=n*o,t.y=i*o,t.z=r*o):(t.x=1,t.y=0,t.z=0),t}},{key:"length",value:function(){var e=this.x,t=this.y,n=this.z;return Math.sqrt(e*e+t*t+n*n)}},{key:"lengthSquared",value:function(){return this.dot(this)}},{key:"distanceTo",value:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,o=e.y,a=e.z;return Math.sqrt((r-t)*(r-t)+(o-n)*(o-n)+(a-i)*(a-i))}},{key:"distanceSquared",value:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,o=e.y,a=e.z;return(r-t)*(r-t)+(o-n)*(o-n)+(a-i)*(a-i)}},{key:"scale",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e,i=this.y,r=this.z;return n.x=t*this.x,n.y=t*i,n.z=t*r,n}},{key:"vmul",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e;return n.x=t.x*this.x,n.y=t.y*this.y,n.z=t.z*this.z,n}},{key:"addScaledVector",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new e;return i.x=this.x+t*n.x,i.y=this.y+t*n.y,i.z=this.z+t*n.z,i}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"isZero",value:function(){return 0===this.x&&0===this.y&&0===this.z}},{key:"negate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new e;return t.x=-this.x,t.y=-this.y,t.z=-this.z,t}},{key:"tangents",value:function(e,t){var n=this.length();if(n>0){var i=dj,r=1/n;i.set(this.x*r,this.y*r,this.z*r);var o=pj;Math.abs(i.x)<.9?(o.set(1,0,0),i.cross(o,e)):(o.set(0,1,0),i.cross(o,e)),i.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}},{key:"toString",value:function(){return this.x+","+this.y+","+this.z}},{key:"toArray",value:function(){return[this.x,this.y,this.z]}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"lerp",value:function(e,t,n){var i=this.x,r=this.y,o=this.z;n.x=i+(e.x-i)*t,n.y=r+(e.y-r)*t,n.z=o+(e.z-o)*t}},{key:"almostEquals",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-6;return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}},{key:"almostZero",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e-6;return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}},{key:"isAntiparallelTo",value:function(e,t){return this.negate(vj),vj.almostEquals(e,t)}},{key:"clone",value:function(){return new e(this.x,this.y,this.z)}}]),e}();fj.ZERO=void 0,fj.UNIT_X=void 0,fj.UNIT_Y=void 0,fj.UNIT_Z=void 0,fj.ZERO=new fj(0,0,0),fj.UNIT_X=new fj(1,0,0),fj.UNIT_Y=new fj(0,1,0),fj.UNIT_Z=new fj(0,0,1);var dj=new fj,pj=new fj,vj=new fj,gj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new fj,this.upperBound=new fj,t.lowerBound&&this.lowerBound.copy(t.lowerBound),t.upperBound&&this.upperBound.copy(t.upperBound)}return b(e,[{key:"setFromPoints",value:function(e,t,n,i){var r=this.lowerBound,o=this.upperBound,a=n;r.copy(e[0]),a&&a.vmult(r,r),o.copy(r);for(var s=1;so.x&&(o.x=u.x),u.xo.y&&(o.y=u.y),u.yo.z&&(o.z=u.z),u.z=r.x&&t.y<=i.y&&n.y>=r.y&&t.z<=i.z&&n.z>=r.z}},{key:"getCorners",value:function(e,t,n,i,r,o,a,s){var u=this.lowerBound,c=this.upperBound;e.copy(u),t.set(c.x,u.y,u.z),n.set(c.x,c.y,u.z),i.set(u.x,c.y,c.z),r.set(c.x,u.y,c.z),o.set(u.x,c.y,u.z),a.set(u.x,u.y,c.z),s.copy(c)}},{key:"toLocalFrame",value:function(e,t){var n=yj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(var i=0;8!==i;i++){var r=n[i];e.pointToLocal(r,r)}return t.setFromPoints(n)}},{key:"toWorldFrame",value:function(e,t){var n=yj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(var i=0;8!==i;i++){var r=n[i];e.pointToWorld(r,r)}return t.setFromPoints(n)}},{key:"overlapsRay",value:function(e){var t=e.direction,n=e.from,i=1/t.x,r=1/t.y,o=1/t.z,a=(this.lowerBound.x-n.x)*i,s=(this.upperBound.x-n.x)*i,u=(this.lowerBound.y-n.y)*r,c=(this.upperBound.y-n.y)*r,l=(this.lowerBound.z-n.z)*o,h=(this.upperBound.z-n.z)*o,f=Math.max(Math.max(Math.min(a,s),Math.min(u,c)),Math.min(l,h)),d=Math.min(Math.min(Math.max(a,s),Math.max(u,c)),Math.max(l,h));return!(d<0||f>d)}}]),e}(),mj=new fj,yj=[new fj,new fj,new fj,new fj,new fj,new fj,new fj,new fj],bj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;m(this,e),this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=t,this.y=n,this.z=i,this.w=r}return b(e,[{key:"set",value:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}},{key:"toString",value:function(){return this.x+","+this.y+","+this.z+","+this.w}},{key:"toArray",value:function(){return[this.x,this.y,this.z,this.w]}},{key:"setFromAxisAngle",value:function(e,t){var n=Math.sin(.5*t);return this.x=e.x*n,this.y=e.y*n,this.z=e.z*n,this.w=Math.cos(.5*t),this}},{key:"toAxisAngle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fj;this.normalize();var t=2*Math.acos(this.w),n=Math.sqrt(1-this.w*this.w);return n<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/n,e.y=this.y/n,e.z=this.z/n),[e,t]}},{key:"setFromVectors",value:function(e,t){if(e.isAntiparallelTo(t)){var n=_j;e.tangents(n,wj),this.setFromAxisAngle(n,Math.PI)}else{var i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(A(e.length(),2)*A(t.length(),2))+e.dot(t),this.normalize()}return this}},{key:"mult",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e,i=this.x,r=this.y,o=this.z,a=this.w,s=t.x,u=t.y,c=t.z,l=t.w;return n.x=i*l+a*s+r*c-o*u,n.y=r*l+a*u+o*s-i*c,n.z=o*l+a*c+i*u-r*s,n.w=a*l-i*s-r*u-o*c,n}},{key:"inverse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new e,n=this.x,i=this.y,r=this.z,o=this.w;this.conjugate(t);var a=1/(n*n+i*i+r*r+o*o);return t.x*=a,t.y*=a,t.z*=a,t.w*=a,t}},{key:"conjugate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new e;return t.x=-this.x,t.y=-this.y,t.z=-this.z,t.w=this.w,t}},{key:"normalize",value:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}},{key:"normalizeFast",value:function(){var e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}},{key:"vmult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj,n=e.x,i=e.y,r=e.z,o=this.x,a=this.y,s=this.z,u=this.w,c=u*n+a*r-s*i,l=u*i+s*n-o*r,h=u*r+o*i-a*n,f=-o*n-a*i-s*r;return t.x=c*u+f*-o+l*-s-h*-a,t.y=l*u+f*-a+h*-o-c*-s,t.z=h*u+f*-s+c*-a-l*-o,t}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}},{key:"toEuler",value:function(e){var t,n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YZX",o=this.x,a=this.y,s=this.z,u=this.w;switch(r){case"YZX":var c=o*a+s*u;if(c>.499&&(t=2*Math.atan2(o,u),n=Math.PI/2,i=0),c<-.499&&(t=-2*Math.atan2(o,u),n=-Math.PI/2,i=0),void 0===t){var l=o*o,h=s*s;t=Math.atan2(2*a*u-2*o*s,1-a*a*2-2*h),n=Math.asin(2*c),i=Math.atan2(2*o*u-2*a*s,1-2*l-2*h)}break;default:throw new Error("Euler order "+r+" not supported yet.")}e.y=t,e.z=n,e.x=i}},{key:"setFromEuler",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"XYZ",r=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(n/2),s=Math.sin(e/2),u=Math.sin(t/2),c=Math.sin(n/2);return"XYZ"===i?(this.x=s*o*a+r*u*c,this.y=r*u*a-s*o*c,this.z=r*o*c+s*u*a,this.w=r*o*a-s*u*c):"YXZ"===i?(this.x=s*o*a+r*u*c,this.y=r*u*a-s*o*c,this.z=r*o*c-s*u*a,this.w=r*o*a+s*u*c):"ZXY"===i?(this.x=s*o*a-r*u*c,this.y=r*u*a+s*o*c,this.z=r*o*c+s*u*a,this.w=r*o*a-s*u*c):"ZYX"===i?(this.x=s*o*a-r*u*c,this.y=r*u*a+s*o*c,this.z=r*o*c-s*u*a,this.w=r*o*a+s*u*c):"YZX"===i?(this.x=s*o*a+r*u*c,this.y=r*u*a+s*o*c,this.z=r*o*c-s*u*a,this.w=r*o*a-s*u*c):"XZY"===i&&(this.x=s*o*a-r*u*c,this.y=r*u*a-s*o*c,this.z=r*o*c+s*u*a,this.w=r*o*a+s*u*c),this}},{key:"clone",value:function(){return new e(this.x,this.y,this.z,this.w)}},{key:"slerp",value:function(t,n){var i,r,o,a,s,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new e,c=this.x,l=this.y,h=this.z,f=this.w,d=t.x,p=t.y,v=t.z,g=t.w;return(r=c*d+l*p+h*v+f*g)<0&&(r=-r,d=-d,p=-p,v=-v,g=-g),1-r>1e-6?(i=Math.acos(r),o=Math.sin(i),a=Math.sin((1-n)*i)/o,s=Math.sin(n*i)/o):(a=1-n,s=n),u.x=a*c+s*d,u.y=a*l+s*p,u.z=a*h+s*v,u.w=a*f+s*g,u}},{key:"integrate",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new e,o=t.x*i.x,a=t.y*i.y,s=t.z*i.z,u=this.x,c=this.y,l=this.z,h=this.w,f=.5*n;return r.x+=f*(o*h+a*l-s*c),r.y+=f*(a*h+s*u-o*l),r.z+=f*(s*h+o*c-a*u),r.w+=f*(-o*u-a*c-s*l),r}}]),e}(),_j=new fj,wj=new fj,kj={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256},xj=function(){var e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=e.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}return b(e,[{key:"updateBoundingSphereRadius",value:function(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}},{key:"volume",value:function(){throw"volume() not implemented for shape type "+this.type}},{key:"calculateLocalInertia",value:function(e,t){throw"calculateLocalInertia() not implemented for shape type "+this.type}},{key:"calculateWorldAABB",value:function(e,t,n,i){throw"calculateWorldAABB() not implemented for shape type "+this.type}}]),e}();return e.idCounter=0,e.types=kj,e}(),Sj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.position=void 0,this.quaternion=void 0,this.position=new fj,this.quaternion=new bj,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}return b(e,[{key:"pointToLocal",value:function(t,n){return e.pointToLocalFrame(this.position,this.quaternion,t,n)}},{key:"pointToWorld",value:function(t,n){return e.pointToWorldFrame(this.position,this.quaternion,t,n)}},{key:"vectorToWorldFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return this.quaternion.vmult(e,t),t}}],[{key:"pointToLocalFrame",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fj;return n.vsub(e,i),t.conjugate(Ej),Ej.vmult(i,i),i}},{key:"pointToWorldFrame",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fj;return t.vmult(n,i),i.vadd(e,i),i}},{key:"vectorToWorldFrame",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new fj;return e.vmult(t,n),n}},{key:"vectorToLocalFrame",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fj;return t.w*=-1,t.vmult(n,i),t.w*=-1,i}}]),e}(),Ej=new bj,Cj=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var r=i.vertices,o=void 0===r?[]:r,a=i.faces,s=void 0===a?[]:a,u=i.normals,c=void 0===u?[]:u,l=i.axes,h=i.boundingSphereRadius;return(e=t.call(this,{type:xj.types.CONVEXPOLYHEDRON})).vertices=void 0,e.faces=void 0,e.faceNormals=void 0,e.worldVertices=void 0,e.worldVerticesNeedsUpdate=void 0,e.worldFaceNormals=void 0,e.worldFaceNormalsNeedsUpdate=void 0,e.uniqueAxes=void 0,e.uniqueEdges=void 0,e.vertices=o,e.faces=s,e.faceNormals=c,0===e.faceNormals.length&&e.computeNormals(),h?e.boundingSphereRadius=h:e.updateBoundingSphereRadius(),e.worldVertices=[],e.worldVerticesNeedsUpdate=!0,e.worldFaceNormals=[],e.worldFaceNormalsNeedsUpdate=!0,e.uniqueAxes=l?l.slice():null,e.uniqueEdges=[],e.computeEdges(),e}return b(n,[{key:"computeEdges",value:function(){var e=this.faces,t=this.vertices,n=this.uniqueEdges;n.length=0;for(var i=new fj,r=0;r!==e.length;r++)for(var o=e[r],a=o.length,s=0;s!==a;s++){t[o[s]].vsub(t[o[(s+1)%a]],i),i.normalize();for(var u=!1,c=0;c!==n.length;c++)if(n[c].almostEquals(i)||n[c].almostEquals(i)){u=!0;break}u||n.push(i.clone())}}},{key:"computeNormals",value:function(){this.faceNormals.length=this.faces.length;for(var e=0;eh&&(h=d,l=f)}for(var p=[],v=0;v=0&&this.clipFaceAgainstHull(o,e,t,p,a,s,u)}},{key:"findSeparatingAxis",value:function(e,t,n,i,r,o,a,s){var u=new fj,c=new fj,l=new fj,h=new fj,f=new fj,d=new fj,p=Number.MAX_VALUE,v=this;if(v.uniqueAxes)for(var g=0;g!==v.uniqueAxes.length;g++){n.vmult(v.uniqueAxes[g],u);var m=v.testSepAxis(u,e,t,n,i,r);if(!1===m)return!1;m0&&o.negate(o),!0}},{key:"testSepAxis",value:function(e,t,i,r,o,a){n.project(this,e,i,r,Oj),n.project(t,e,o,a,Tj);var s=Oj[0],u=Oj[1],c=Tj[0],l=Tj[1];if(st.x&&(t.x=r.x),r.yt.y&&(t.y=r.y),r.zt.z&&(t.z=r.z)}}},{key:"computeWorldFaceNormals",value:function(e){for(var t=this.faceNormals.length;this.worldFaceNormals.lengthe&&(e=i)}this.boundingSphereRadius=Math.sqrt(e)}},{key:"calculateWorldAABB",value:function(e,t,n,i){for(var r,o,a,s,u,c,l=this.vertices,h=new fj,f=0;fs)&&(s=d.x),(void 0===o||d.yu)&&(u=d.y),(void 0===a||d.zc)&&(c=d.z)}n.set(r,o,a),i.set(s,u,c)}},{key:"volume",value:function(){return 4*Math.PI*this.boundingSphereRadius/3}},{key:"getAveragePointLocal",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fj,t=this.vertices,n=0;n0||c>0&&h<0)return!1}return-1}}],[{key:"computeNormal",value:function(e,t,n,i){var r=new fj,o=new fj;t.vsub(e,o),n.vsub(t,r),r.cross(o,i),i.isZero()||i.normalize()}},{key:"project",value:function(e,t,n,i,r){var o=e.vertices.length,a=Aj,s=0,u=0,c=Pj,l=e.vertices;c.setZero(),Sj.vectorToLocalFrame(n,i,t,a),Sj.pointToLocalFrame(n,i,c,c);var h=c.dot(a);u=s=l[0].dot(a);for(var f=1;fs&&(s=d),d(s-=h)){var p=u;u=s,s=p}r[0]=s,r[1]=u}}]),n}(xj),Oj=[],Tj=[],Aj=new fj,Pj=new fj,Mj=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,{type:xj.types.BOX})).halfExtents=void 0,i.convexPolyhedronRepresentation=void 0,i.halfExtents=e,i.convexPolyhedronRepresentation=null,i.updateConvexPolyhedronRepresentation(),i.updateBoundingSphereRadius(),i}return b(n,[{key:"updateConvexPolyhedronRepresentation",value:function(){var e=this.halfExtents.x,t=this.halfExtents.y,n=this.halfExtents.z,i=fj,r=[new i(-e,-t,-n),new i(e,-t,-n),new i(e,t,-n),new i(-e,t,-n),new i(-e,-t,n),new i(e,-t,n),new i(e,t,n),new i(-e,t,n)],o=[new i(0,0,1),new i(0,1,0),new i(1,0,0)],a=new Cj({vertices:r,faces:[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]],axes:o});this.convexPolyhedronRepresentation=a,a.material=this.material}},{key:"calculateLocalInertia",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return n.calculateInertia(this.halfExtents,e,t),t}},{key:"getSideNormals",value:function(e,t){var n=e,i=this.halfExtents;if(n[0].set(i.x,0,0),n[1].set(0,i.y,0),n[2].set(0,0,i.z),n[3].set(-i.x,0,0),n[4].set(0,-i.y,0),n[5].set(0,0,-i.z),void 0!==t)for(var r=0;r!==n.length;r++)t.vmult(n[r],n[r]);return n}},{key:"volume",value:function(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z}},{key:"updateBoundingSphereRadius",value:function(){this.boundingSphereRadius=this.halfExtents.length()}},{key:"forEachWorldCorner",value:function(e,t,n){for(var i=this.halfExtents,r=[[i.x,i.y,i.z],[-i.x,i.y,i.z],[-i.x,-i.y,i.z],[-i.x,-i.y,-i.z],[i.x,-i.y,-i.z],[i.x,i.y,-i.z],[-i.x,i.y,-i.z],[i.x,-i.y,i.z]],o=0;oi.x&&(i.x=u),c>i.y&&(i.y=c),l>i.z&&(i.z=l),u0&&void 0!==arguments[0]?arguments[0]:{};m(this,n),(e=t.call(this)).id=void 0,e.index=void 0,e.world=void 0,e.preStep=void 0,e.postStep=void 0,e.vlambda=void 0,e.collisionFilterGroup=void 0,e.collisionFilterMask=void 0,e.collisionResponse=void 0,e.position=void 0,e.previousPosition=void 0,e.interpolatedPosition=void 0,e.initPosition=void 0,e.velocity=void 0,e.initVelocity=void 0,e.force=void 0,e.mass=void 0,e.invMass=void 0,e.material=void 0,e.linearDamping=void 0,e.type=void 0,e.allowSleep=void 0,e.sleepState=void 0,e.sleepSpeedLimit=void 0,e.sleepTimeLimit=void 0,e.timeLastSleepy=void 0,e.wakeUpAfterNarrowphase=void 0,e.torque=void 0,e.quaternion=void 0,e.initQuaternion=void 0,e.previousQuaternion=void 0,e.interpolatedQuaternion=void 0,e.angularVelocity=void 0,e.initAngularVelocity=void 0,e.shapes=void 0,e.shapeOffsets=void 0,e.shapeOrientations=void 0,e.inertia=void 0,e.invInertia=void 0,e.invInertiaWorld=void 0,e.invMassSolve=void 0,e.invInertiaSolve=void 0,e.invInertiaWorldSolve=void 0,e.fixedRotation=void 0,e.angularDamping=void 0,e.linearFactor=void 0,e.angularFactor=void 0,e.aabb=void 0,e.aabbNeedsUpdate=void 0,e.boundingRadius=void 0,e.wlambda=void 0,e.isTrigger=void 0,e.id=n.idCounter++,e.index=-1,e.world=null,e.preStep=null,e.postStep=null,e.vlambda=new fj,e.collisionFilterGroup="number"==typeof i.collisionFilterGroup?i.collisionFilterGroup:1,e.collisionFilterMask="number"==typeof i.collisionFilterMask?i.collisionFilterMask:-1,e.collisionResponse="boolean"!=typeof i.collisionResponse||i.collisionResponse,e.position=new fj,e.previousPosition=new fj,e.interpolatedPosition=new fj,e.initPosition=new fj,i.position&&(e.position.copy(i.position),e.previousPosition.copy(i.position),e.interpolatedPosition.copy(i.position),e.initPosition.copy(i.position)),e.velocity=new fj,i.velocity&&e.velocity.copy(i.velocity),e.initVelocity=new fj,e.force=new fj;var r="number"==typeof i.mass?i.mass:0;return e.mass=r,e.invMass=r>0?1/r:0,e.material=i.material||null,e.linearDamping="number"==typeof i.linearDamping?i.linearDamping:.01,e.type=r<=0?n.STATIC:n.DYNAMIC,typeof i.type==typeof n.STATIC&&(e.type=i.type),e.allowSleep=void 0===i.allowSleep||i.allowSleep,e.sleepState=n.AWAKE,e.sleepSpeedLimit=void 0!==i.sleepSpeedLimit?i.sleepSpeedLimit:.1,e.sleepTimeLimit=void 0!==i.sleepTimeLimit?i.sleepTimeLimit:1,e.timeLastSleepy=0,e.wakeUpAfterNarrowphase=!1,e.torque=new fj,e.quaternion=new bj,e.initQuaternion=new bj,e.previousQuaternion=new bj,e.interpolatedQuaternion=new bj,i.quaternion&&(e.quaternion.copy(i.quaternion),e.initQuaternion.copy(i.quaternion),e.previousQuaternion.copy(i.quaternion),e.interpolatedQuaternion.copy(i.quaternion)),e.angularVelocity=new fj,i.angularVelocity&&e.angularVelocity.copy(i.angularVelocity),e.initAngularVelocity=new fj,e.shapes=[],e.shapeOffsets=[],e.shapeOrientations=[],e.inertia=new fj,e.invInertia=new fj,e.invInertiaWorld=new lj,e.invMassSolve=0,e.invInertiaSolve=new fj,e.invInertiaWorldSolve=new lj,e.fixedRotation=void 0!==i.fixedRotation&&i.fixedRotation,e.angularDamping=void 0!==i.angularDamping?i.angularDamping:.01,e.linearFactor=new fj(1,1,1),i.linearFactor&&e.linearFactor.copy(i.linearFactor),e.angularFactor=new fj(1,1,1),i.angularFactor&&e.angularFactor.copy(i.angularFactor),e.aabb=new gj,e.aabbNeedsUpdate=!0,e.boundingRadius=0,e.wlambda=new fj,e.isTrigger=Boolean(i.isTrigger),i.shape&&e.addShape(i.shape),e.updateMassProperties(),e}return b(n,[{key:"wakeUp",value:function(){var e=this.sleepState;this.sleepState=n.AWAKE,this.wakeUpAfterNarrowphase=!1,e===n.SLEEPING&&this.dispatchEvent(n.wakeupEvent)}},{key:"sleep",value:function(){this.sleepState=n.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}},{key:"sleepTick",value:function(e){if(this.allowSleep){var t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=A(this.sleepSpeedLimit,2);t===n.AWAKE&&ir?this.wakeUp():t===n.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(n.sleepEvent))}}},{key:"updateSolveMassProperties",value:function(){this.sleepState===n.SLEEPING||this.type===n.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}},{key:"pointToLocalFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}},{key:"vectorToLocalFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return this.quaternion.conjugate().vmult(e,t),t}},{key:"pointToWorldFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}},{key:"vectorToWorldFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return this.quaternion.vmult(e,t),t}},{key:"addShape",value:function(e,t,n){var i=new fj,r=new bj;return t&&i.copy(t),n&&r.copy(n),this.shapes.push(e),this.shapeOffsets.push(i),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}},{key:"removeShape",value:function(e){var t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}},{key:"updateBoundingRadius",value:function(){for(var e=this.shapes,t=this.shapeOffsets,n=e.length,i=0,r=0;r!==n;r++){var o=e[r];o.updateBoundingSphereRadius();var a=t[r].length(),s=o.boundingSphereRadius;a+s>i&&(i=a+s)}this.boundingRadius=i}},{key:"updateAABB",value:function(){for(var e=this.shapes,t=this.shapeOffsets,n=this.shapeOrientations,i=e.length,r=Nj,o=Lj,a=this.quaternion,s=this.aabb,u=jj,c=0;c!==i;c++){var l=e[c];a.vmult(t[c],r),r.vadd(this.position,r),a.mult(n[c],o),l.calculateWorldAABB(r,o,u.lowerBound,u.upperBound),0===c?s.copy(u):s.extend(u)}this.aabbNeedsUpdate=!1}},{key:"updateInertiaWorld",value:function(e){var t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){var n=Fj,i=Bj;n.setRotationFromQuaternion(this.quaternion),n.transpose(i),n.scale(t,n),n.mmult(i,this.invInertiaWorld)}}},{key:"applyForce",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;if(this.type===n.DYNAMIC){this.sleepState===n.SLEEPING&&this.wakeUp();var i=Vj;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}}},{key:"applyLocalForce",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;if(this.type===n.DYNAMIC){var i=zj,r=Uj;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}}},{key:"applyTorque",value:function(e){this.type===n.DYNAMIC&&(this.sleepState===n.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}},{key:"applyImpulse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;if(this.type===n.DYNAMIC){this.sleepState===n.SLEEPING&&this.wakeUp();var i=t,r=Hj;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);var o=Gj;i.cross(e,o),this.invInertiaWorld.vmult(o,o),this.angularVelocity.vadd(o,this.angularVelocity)}}},{key:"applyLocalImpulse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;if(this.type===n.DYNAMIC){var i=Wj,r=qj;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}}},{key:"updateMassProperties",value:function(){var e=Xj;this.invMass=this.mass>0?1/this.mass:0;var t=this.inertia,n=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),Mj.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!n?1/t.x:0,t.y>0&&!n?1/t.y:0,t.z>0&&!n?1/t.z:0),this.updateInertiaWorld(!0)}},{key:"getVelocityAtWorldPoint",value:function(e,t){var n=new fj;return e.vsub(this.position,n),this.angularVelocity.cross(n,t),this.velocity.vadd(t,t),t}},{key:"integrate",value:function(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),(this.type===n.DYNAMIC||this.type===n.KINEMATIC)&&this.sleepState!==n.SLEEPING){var r=this.velocity,o=this.angularVelocity,a=this.position,s=this.force,u=this.torque,c=this.quaternion,l=this.invInertiaWorld,h=this.linearFactor,f=this.invMass*e;r.x+=s.x*f*h.x,r.y+=s.y*f*h.y,r.z+=s.z*f*h.z;var d=l.elements,p=this.angularFactor,v=u.x*p.x,g=u.y*p.y,m=u.z*p.z;o.x+=e*(d[0]*v+d[1]*g+d[2]*m),o.y+=e*(d[3]*v+d[4]*g+d[5]*m),o.z+=e*(d[6]*v+d[7]*g+d[8]*m),a.x+=r.x*e,a.y+=r.y*e,a.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}}]),n}(function(){function e(){m(this,e),this._listeners=void 0}return b(e,[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;return void 0===n[e]&&(n[e]=[]),n[e].includes(t)||n[e].push(t),this}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return!(void 0===n[e]||!n[e].includes(t))}},{key:"hasAnyEventListener",value:function(e){return void 0!==this._listeners&&void 0!==this._listeners[e]}},{key:"removeEventListener",value:function(e,t){if(void 0===this._listeners)return this;var n=this._listeners;if(void 0===n[e])return this;var i=n[e].indexOf(t);return-1!==i&&n[e].splice(i,1),this}},{key:"dispatchEvent",value:function(e){if(void 0===this._listeners)return this;var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=0,i=t.length;n0&&void 0!==arguments[0]?arguments[0]:new fj,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;m(this,s),this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new fj,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=s.ANY,this.result=new Yj,this.hasHit=!1,this.callback=function(e){}}return b(s,[{key:e,get:function(){return this._intersectSphere}},{key:t,get:function(){return this._intersectPlane}},{key:n,get:function(){return this._intersectBox}},{key:i,get:function(){return this._intersectConvex}},{key:r,get:function(){return this._intersectConvex}},{key:o,get:function(){return this._intersectHeightfield}},{key:a,get:function(){return this._intersectTrimesh}},{key:"intersectWorld",value:function(e,t){return this.mode=t.mode||s.ANY,this.result=t.result||new Yj,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||function(){},this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Qj),$j.length=0,e.broadphase.aabbQuery(e,Qj,$j),this.intersectBodies($j),this.hasHit}},{key:"intersectBody",value:function(e,t){t&&(this.result=t,this.updateDirection());var n=this.checkCollisionResponse;if((!n||e.collisionResponse)&&0!=(this.collisionFilterGroup&e.collisionFilterMask)&&0!=(e.collisionFilterGroup&this.collisionFilterMask))for(var i=eF,r=tF,o=0,a=e.shapes.length;oe.boundingSphereRadius)){var r=this[e.type];r&&r.call(this,e,t,n,i,e)}}},{key:"_intersectBox",value:function(e,t,n,i,r){return this._intersectConvex(e.convexPolyhedronRepresentation,t,n,i,r)}},{key:"_intersectPlane",value:function(e,t,n,i,r){var o=this.from,a=this.to,s=this.direction,u=new fj(0,0,1);t.vmult(u,u);var c=new fj;o.vsub(n,c);var l=c.dot(u);if(a.vsub(n,c),!(l*c.dot(u)>0||o.distanceTo(a)=0&&p<=1&&(o.lerp(a,p,f),f.vsub(n,d),d.normalize(),this.reportIntersection(d,f,r,i,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,f),f.vsub(n,d),d.normalize(),this.reportIntersection(d,f,r,i,-1))}}},{key:"_intersectConvex",value:function(e,t,n,i,r,o){for(var a=fF,u=dF,c=o&&o.faceList||null,l=e.faces,h=e.vertices,f=e.faceNormals,d=this.direction,p=this.from,v=p.distanceTo(this.to),g=c?c.length:l.length,m=this.result,y=0;!m.shouldStop&&yv||this.reportIntersection(a,nF,r,i,b)}}}}}},{key:"_intersectTrimesh",value:function(e,t,n,i,r,o){var a=pF,u=_F,c=wF,l=dF,h=vF,f=gF,d=mF,p=bF,v=yF,g=e.indices,m=this.from,y=this.to,b=this.direction;c.position.copy(n),c.quaternion.copy(t),Sj.vectorToLocalFrame(n,t,b,h),Sj.pointToLocalFrame(n,t,m,f),Sj.pointToLocalFrame(n,t,y,d),d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,f.x*=e.scale.x,f.y*=e.scale.y,f.z*=e.scale.z,d.vsub(f,h),h.normalize();var _=f.distanceSquared(d);e.tree.rayQuery(this,c,u);for(var w=0,k=u.length;!this.result.shouldStop&&w!==k;w++){var x=u[w];e.getNormal(x,a),e.getVertex(g[3*x],iF),iF.vsub(f,l);var S=h.dot(a),E=a.dot(l)/S;if(!(E<0)){h.scale(E,nF),nF.vadd(f,nF),e.getVertex(g[3*x+1],rF),e.getVertex(g[3*x+2],oF);var C=nF.distanceSquared(f);!s.pointInTriangle(nF,rF,iF,oF)&&!s.pointInTriangle(nF,iF,rF,oF)||C>_||(Sj.vectorToWorldFrame(t,a,v),Sj.pointToWorldFrame(n,t,nF,p),this.reportIntersection(v,p,r,i,x))}}u.length=0}},{key:"reportIntersection",value:function(e,t,n,i,r){var o=this.from,a=this.to,u=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==r?r:-1,this.mode){case s.ALL:this.hasHit=!0,c.set(o,a,e,t,n,i,u),c.hasHit=!0,this.callback(c);break;case s.CLOSEST:(u=0&&(o=a*l-s*u)>=0&&r+o0){var o,a=_(e.mesh.primitives);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.attributes.POSITION&&s.attributes.POSITION.min&&function(){var o=r.transformAsPoint(s.attributes.POSITION.min,[]),a=r.transformAsPoint(s.attributes.POSITION.max,[]);i.push({"@id":t["@id"],name:e.name,entityId:t.entityId,bbox:new gj({lowerBound:h(fj,v(o.map(function(e,t){return Math.min(e,a[t])}))),upperBound:h(fj,v(a.map(function(e,t){return Math.max(e,o[t])})))}),gltf:n})}()}}catch(u){a.e(u)}finally{a.f()}}return!0})}catch(s){r.e(s)}finally{r.f()}case 6:case"end":return e.stop()}},e)}),r.s();case 6:if((o=r.n()).done){t.next=10;break}return t.delegateYield(a(),"t0",8);case 8:t.next=6;break;case 10:t.next=15;break;case 12:t.prev=12,t.t1=t.catch(3),r.e(t.t1);case 15:return t.prev=15,r.f(),t.finish(15);case 18:s=[],u=[],c=_(n);try{for(c.s();!(l=c.n()).done;){f=l.value,d=[],p=_(i);try{for(p.s();!(g=p.n()).done;)m=g.value,f.bbox.overlaps(m.bbox)&&d.push({"@id":m["@id"],name:m.name})}catch(C){p.e(C)}finally{p.f()}d.length>0?s.push({"@id":f.entityId,name:f.name,hits:d}):u.push(f)}}catch(C){c.e(C)}finally{c.f()}for(console.log({sourceBoxes:n,targetBoxes:i,report:s,sad:u,maxHits:Math.max.apply(Math,v(s.map(function(e){return e.hits.length})))}),y=[],b=0,w=s;b1&&void 0!==arguments[1]?arguments[1]:[],i=_(e.nodes||e.children||[]);try{for(i.s();!(t=i.n()).done;){var r=t.value;n.push(r.name),NF(r,n)}}catch(o){i.e(o)}finally{i.f()}return n}var LF=function(){var e=function(){function e(t){var n,i,r,o,a,s=this;m(this,e),this.deckProps=t,this.bodyUILayer=new DF({}),this.nodeClickSubject=new oe,this.nodeHoverStartSubject=new oe,this.nodeHoverStopSubject=new oe,this.sceneRotationSubject=new nv([0,0]),this.nodeDragStartSubject=new oe,this.nodeDragSubject=new oe,this.nodeDragEndSubject=new oe,this.nodeClick$=this.nodeClickSubject.pipe(Le()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Le()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Le()),this.sceneRotation$=this.sceneRotationSubject.pipe(Le()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Le()),this.nodeDrag$=this.nodeDragSubject.pipe(Le()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Le());var u=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new wM({flipY:!1,near:-1e3}):new EM({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:function(e){var t;return null!==(t=s.cursor)&&void 0!==t?t:e.isDragging?"grabbing":"grab"}});t.legacyLighting&&(u.effects=[new QM({ambientLight:new TM({color:[255,255,255],intensity:10})})]),this.deck=new eD(u),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(n=t.minRotationX)&&void 0!==n?n:-15,maxRotationX:null!==(i=t.maxRotationX)&&void 0!==i?i:15,target:null!==(r=t.target)&&void 0!==r?r:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}return b(e,[{key:"initialize",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.bodyUILayer.state){e.next=5;break}return e.next=3,new Promise(function(e){setTimeout(e,200)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e,this)}))}},{key:"finalize",value:function(){this.deck.finalize()}},{key:"setScene",value:function(e){if((null==e?void 0:e.length)>0){var t,n=this.bodyUILayer.state.zoomOpacity,i=!1,r=_(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;o.zoomToOnLoad&&(this.zoomTo(o),i=!0)}}catch(a){r.e(a)}finally{r.f()}n=i?.05:n,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(e,n):this.bodyUILayer.setState({data:e,zoomOpacity:n})}}},{key:"debugSceneNodeProcessing",value:function(e,t){var n=this,i="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",r=new EO([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(e,t,n){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,r,o,a,s,u,c,l,f,d,p,g,m,y,b,w,k,x,S,E;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return AF(),n.next=3,MF({scenegraph:e,scenegraphNode:"VHF_Kidney_L_Low1"});case 3:i=n.sent,r={},o=[],a=_(i.scenes);try{for(a.s();!(s=a.n()).done;)TF(s.value,t=new EO(t||EO.IDENTITY),function(n,i){var a={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new EO(i),wireframe:!0,node:n};if(o.push({"@id":"GLTF:".concat(a["@id"]),"@type":"GLTFNode",scenegraph:e,scenegraphNode:a["@id"],transformMatrix:new EO(t||EO.IDENTITY),tooltip:n.name||n.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:n}),n.mesh&&n.mesh.primitives&&n.mesh.primitives.length>0){var s,u=_(n.mesh.primitives);try{for(u.s();!(s=u.n()).done;){var c=s.value;c.attributes.POSITION&&c.attributes.POSITION.min&&function(){var e=i.transformAsPoint(c.attributes.POSITION.min,[]),t=i.transformAsPoint(c.attributes.POSITION.max,[]);a.bbox=new gj({lowerBound:h(fj,v(e.map(function(e,n){return Math.min(e,t[n])}))),upperBound:h(fj,v(t.map(function(t,n){return Math.max(t,e[n])})))})}()}}catch(l){u.e(l)}finally{u.f()}}return r[a["@id"]]=a,!0})}catch(C){a.e(C)}finally{a.f()}u=_(Object.values(r).filter(function(e){return!e.bbox}));try{for(u.s();!(c=u.n()).done;){l=c.value,f=_(NF(l.node).map(function(e){return r[e]}).filter(function(e){return e.bbox}));try{for(f.s();!(d=f.n()).done;)p=d.value,l.bbox?l.bbox.extend(p.bbox):l.bbox=p.bbox.clone()}catch(C){f.e(C)}finally{f.f()}l.bbox||delete r[l["@id"]]}}catch(C){u.e(C)}finally{u.f()}for(g=0,m=Object.values(r);g1&&void 0!==arguments[1]?arguments[1]:jF,n=null,i=null;function r(){return FF(t,n,arguments)||(i=e.apply(null,arguments)),n=arguments,i}return r.reset=function(){n=null,i=null},r}var VF=BF(function(){var e=nh();if(!e)return!1;var t=e.injector.get(jl,null);return!!t&&t.some(function(e){return(e&&e.providers||[]).some(function(e){return e&&e.provide&&"MockNgModuleResolver"===e.provide.name||!1})})}),zF=function(){var e=function(){function e(){m(this,e),this.bootstrap$=new Ed(1)}return b(e,[{key:"appBootstrapped$",get:function(){return this.bootstrap$.asObservable()}},{key:"bootstrap",value:function(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),UF=new Mi("INITIAL_STATE_TOKEN"),HF=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"set",value:function(e){this.value=e}},{key:"pop",value:function(){var e=this.value;return this.value={},e}}]),e}();return e.value={},e}(),GF=new Mi("Internals.StateContextFactory"),WF=new Mi("Internals.StateFactory");function qF(e,t){return t?function(n){return n.pipe(qF(function(n,i){return me(e(n,i)).pipe(ue(function(e,r){return t(n,e,i,r)}))}))}:function(t){return t.lift(new XF(e))}}var XF=function(){function e(t){m(this,e),this.project=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new YF(e,this.project))}}]),e}(),YF=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).project=i,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return b(n,[{key:"_next",value:function(e){this.hasSubscription||this.tryNext(e)}},{key:"tryNext",value:function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(i){return void this.destination.error(i)}this.hasSubscription=!0,this._innerSub(t)}},{key:"_innerSub",value:function(e){var t=new ye(this),n=this.destination;n.add(t);var i=_e(e,t);i!==t&&n.add(i)}},{key:"_complete",value:function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}},{key:"notifyNext",value:function(e){this.destination.next(e)}},{key:"notifyError",value:function(e){this.destination.error(e)}},{key:"notifyComplete",value:function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}]),n}(be);function KF(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t.lift(new QF(e))}}var QF=function(){function e(t){m(this,e),this.defaultValue=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new $F(e,this.defaultValue))}}]),e}(),$F=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).defaultValue=i,r.isEmpty=!0,r}return b(n,[{key:"_next",value:function(e){this.isEmpty=!1,this.destination.next(e)}},{key:"_complete",value:function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}]),n}(Y),ZF=function(e){return"".concat(e," is not a valid state name. It needs to be a valid object property name.")},JF=function(){return"States must register a 'name' property"},eB=function(e,t,n){return"State name '".concat(e,"' from ").concat(t," already exists in ").concat(n)},tB=function(){return"States must be decorated with @State() decorator"},nB=function(){return"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},iB=function(){return"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},rB=function(){return"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })"},oB=function(){return"Patching arrays is not supported."},aB=function(){return"Patching primitives is not supported."},sB=function(e){return"'".concat(e,"' class should be decorated with @Injectable() right after the @State() decorator")},uB=function(){var e=function(){function e(t,n){m(this,e),this._ngZone=t,this._platformId=n,this.verifyZoneIsNotNooped(this._ngZone)}return b(e,[{key:"enter",value:function(e){return function(e){return"server"===e}(this._platformId)?this.runInsideAngular(e):this.runOutsideAngular(e)}},{key:"leave",value:function(e){return this.runInsideAngular(e)}},{key:"runInsideAngular",value:function(e){return Vl.isInAngularZone()?e():this._ngZone.run(e)}},{key:"runOutsideAngular",value:function(e){return Vl.isInAngularZone()?this._ngZone.runOutsideAngular(e):e()}},{key:"verifyZoneIsNotNooped",value:function(e){e instanceof Vl||console.warn(rB())}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl),Qi(Sl))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),cB=new Mi("ROOT_STATE_TOKEN"),lB=new Mi("FEATURE_STATE_TOKEN"),hB=new Mi("NGXS_PLUGINS"),fB=new Mi("NG_TEST_MODE"),dB=new Mi("NG_DEV_MODE"),pB="NGXS_META",vB="NGXS_OPTIONS_META",gB=function(){var e=function e(){m(this,e),this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=uB};return e.\u0275prov=Ke({token:e,factory:e.\u0275fac=function(t){return new(t||e)}}),e}(),mB=function e(t,n,i){m(this,e),this.previousValue=t,this.currentValue=n,this.firstChange=i},yB=new Mi("NGXS_EXECUTION_STRATEGY");function bB(e){return e.constructor&&e.constructor.type?e.constructor.type:e.type}var _B=function(e,t,n){e=Object.assign({},e);var i=t.split("."),r=i.length-1;return i.reduce(function(e,t,i){return e[t]=i===r?n:Array.isArray(e[t])?e[t].slice():Object.assign({},e[t]),e&&e[t]},e),e},wB=function(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)},kB=function(e){return e&&"object"==typeof e&&!Array.isArray(e)},xB=function e(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:OB,i=function(e){return e.reduce(function(e,t){return e[bB(t)]=!0,e},{})}(e),r=t&&function(e){return e.reduce(function(e,t){return e[t]=!0,e},{})}(t);return function(e){return e.pipe(function(e,t){return od(function(n){var i=bB(n.action);return e[i]&&(!t||t[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function OB(){return ue(function(e){return e.action})}function TB(e){return function(t){return new ee(function(n){return t.subscribe({next:function(t){e.leave(function(){return n.next(t)})},error:function(t){e.leave(function(){return n.error(t)})},complete:function(){e.leave(function(){return n.complete()})}})})}}var AB=function(){var e=function(){function e(t){m(this,e),this._executionStrategy=t}return b(e,[{key:"enter",value:function(e){return this._executionStrategy.enter(e)}},{key:"leave",value:function(e){return this._executionStrategy.leave(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(yB))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),PB=function(t){a(i,t);var n=s(i);function i(){var e;return m(this,i),(e=n.apply(this,arguments))._itemQueue=[],e._busyPushingNext=!1,e}return b(i,[{key:"next",value:function(t){if(this._busyPushingNext)this._itemQueue.unshift(t);else{for(this._busyPushingNext=!0,e(p(i.prototype),"next",this).call(this,t);this._itemQueue.length>0;){var n=this._itemQueue.pop();e(p(i.prototype),"next",this).call(this,n)}this._busyPushingNext=!1}}}]),i}(oe),MB=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(PB);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275prov=Ke({token:t,factory:t.\u0275fac}),t}(),IB=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this,function(t){var n=e.pipe(TB(i)).subscribe({next:function(e){return t.next(e)},error:function(e){return t.error(e)},complete:function(){return t.complete()}});t.add(n)})}return n}(ee);return e.\u0275fac=function(t){return new(t||e)(Qi(MB),Qi(AB))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),RB=function e(t){return function(){for(var n=arguments.length,i=new Array(n),r=0;r1&&void 0!==arguments[1]?arguments[1]:[];Array.isArray(o)||(o=[]),o.push(r),n[r]=!0,e[r].forEach(function(e){if(o.indexOf(e)>=0)throw new Error("Circular dependency '".concat(e,"' is required by '").concat(r,"': ").concat(o.join(" -> ")));n[e]||i(e,o.slice(0))}),t.indexOf(r)<0&&t.push(r)};return Object.keys(e).forEach(function(e){return i(e)}),t.reverse()}(r),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function e(t,n){for(var i in t)if(t.hasOwnProperty(i)&&t[i].indexOf(n)>=0){var r=e(t,i);return null!==r?"".concat(r,".").concat(i):i}return null};for(var i in e)if(e.hasOwnProperty(i)){var r=n(e,i);t[i]=r?"".concat(r,".").concat(i):i}return t}(r),s=function(e){return e.reduce(function(e,t){return e[t[pB].name]=t,e},{})}(n),u=[],c=_(o);try{for(c.s();!(i=c.n()).done;){var l=i.value,h=s[l],f=a[l],d=h[pB];this.addRuntimeInfoToMeta(d,f);var p={name:l,path:f,isInitialised:!1,actions:d.actions,instance:this._injector.get(h),defaults:e.cloneDefaults(d.defaults)};this.hasBeenMountedAndBootstrapped(l,f)||u.push(p),this.states.push(p)}}catch(v){c.e(v)}finally{c.f()}return u}},{key:"addAndReturnDefaults",value:function(e){var t=this.add(e||[]);return{defaults:t.reduce(function(e,t){return _B(e,t.path,t.defaults)},{}),states:t}}},{key:"connectActionHandlers",value:function(){var e=this;null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(od(function(e){return"DISPATCHED"===e.status}),we(function(t){var n=t.action;return e.invokeActions(e._actions,n).pipe(ue(function(){return{action:n,status:"SUCCESSFUL"}}),KF({action:n,status:"CANCELED"}),xb(function(e){return jf({action:n,status:"ERRORED",error:e})}))})).subscribe(function(t){return e._actionResults.next(t)}))}},{key:"invokeActions",value:function(e,t){var n,i=bB(t),r=[],o=_(this.states);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=a.actions[i];if(s){var u,c=_(s);try{for(c.s();!(u=c.n()).done;){var l=u.value,h=this._stateContextFactory.createStateContext(a);try{var f=a.instance[l.fn](h,t);f instanceof Promise&&(f=me(f)),f instanceof ee?(f=f.pipe(KF({})),l.options.cancelUncompleted&&(f=f.pipe(ud(e.pipe(CB(t)))))):f=jf({}).pipe(Od()),r.push(f)}catch(f){r.push(bd(f))}}}catch(d){c.e(d)}finally{c.f()}}}}catch(d){o.e(d)}finally{o.f()}return r.length||r.push(jf({})),wb(r)}},{key:"addToStatesMap",value:function(e){var t,n=[],i=this.statesByName,r=_(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,a=HB.checkStateNameIsUnique(o,i);!i[a]&&(n.push(o),i[a]=o)}}catch(s){r.e(s)}finally{r.f()}return{newStates:n}}},{key:"addRuntimeInfoToMeta",value:function(e,t){this.statePaths[e.name]=t,e.path=t}},{key:"hasBeenMountedAndBootstrapped",value:function(e,t){var n=void 0!==wB(this._initialState,t);return this.statesByName[e]&&n}}],[{key:"cloneDefaults",value:function(e){return Array.isArray(e)?e.slice():function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e)?Object.assign({},e):void 0===e?{}:e}},{key:"checkStatesAreValid",value:function(e){e.forEach(HB.getValidStateMeta)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(os),Qi(gB),Qi(e,12),Qi(MB),Qi(LB),Qi(UB),Qi(UF,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),WB=function(){var e=function(){function e(t,n,i){m(this,e),this.internalStateOperations=t,this.stateContextFactory=n,this.bootstrapper=i}return b(e,[{key:"ngxsBootstrap",value:function(e,t){var n=this;this.internalStateOperations.getRootStateOperations().dispatch(e).pipe(od(function(){return!!t}),rv(function(){return n.invokeInit(t.states)}),we(function(){return n.bootstrapper.appBootstrapped$}),od(function(e){return!!e})).subscribe(function(){return n.invokeBootstrap(t.states)})}},{key:"invokeInit",value:function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.instance;if(r.ngxsOnChanges){var o=EB(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(o)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}catch(a){n.e(a)}finally{n.f()}}},{key:"invokeBootstrap",value:function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}catch(o){n.e(o)}finally{n.f()}}},{key:"getStateContext",value:function(e){return this.stateContextFactory.createStateContext(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(zB),Qi(UB),Qi(zF))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),qB=function(){var e=function(){function e(t,n,i,r,o,a){m(this,e),this._stateStream=t,this._internalStateOperations=n,this._config=i,this._internalExecutionStrategy=r,this._stateFactory=o,this.initStateStream(a)}return b(e,[{key:"dispatch",value:function(e){return this._internalStateOperations.getRootStateOperations().dispatch(e)}},{key:"select",value:function(e){var t=this,n=this.getStoreBoundSelectorFn(e);return this._stateStream.pipe(ue(n),xb(function(e){var n=t._config.selectorOptions.suppressErrors;return e instanceof TypeError&&n?jf(void 0):bd(e)}),Qf(),TB(this._internalExecutionStrategy))}},{key:"selectOnce",value:function(e){return this.select(e).pipe(ap(1))}},{key:"selectSnapshot",value:function(e){return this.getStoreBoundSelectorFn(e)(this._stateStream.getValue())}},{key:"subscribe",value:function(e){return this._stateStream.pipe(TB(this._internalExecutionStrategy)).subscribe(e)}},{key:"snapshot",value:function(){return this._internalStateOperations.getRootStateOperations().getState()}},{key:"reset",value:function(e){return this._internalStateOperations.getRootStateOperations().setState(e)}},{key:"getStoreBoundSelectorFn",value:function(e){return function(e){var t=function(e){return e.NGXS_SELECTOR_META}(e)||SB(e);return t&&t.makeRootSelector||function(){return e}}(e)(this._stateFactory.getRuntimeSelectorContext())}},{key:"initStateStream",value:function(e){var t=this._stateStream.value;if(!t||0===Object.keys(t).length){var n=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,e):e;this._stateStream.next(n)}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(DB),Qi(zB),Qi(gB),Qi(AB),Qi(GB),Qi(UF,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),XB=function(){var e=function(){function e(t,n){m(this,e),e.store=t,e.config=n}return b(e,[{key:"ngOnDestroy",value:function(){e.store=null,e.config=null}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(qB),Qi(gB))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e.store=null,e.config=null,e}(),YB=function(){function e(){m(this,e)}return b(e,null,[{key:"type",get:function(){return"@@INIT"}}]),e}(),KB=function(){function e(t){m(this,e),this.addedStates=t}return b(e,null,[{key:"type",get:function(){return"@@UPDATE_STATE"}}]),e}(),QB=new Ed(1),$B=function(){var e=function e(t,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0;m(this,e),function(){try{var t=window.ng,n=!(t.probe&&t.coreTokens)&&Jl();QB.next(n)}catch(e){QB.next(!1)}finally{QB.complete()}}();var s=t.addAndReturnDefaults(o);n.setStateToTheCurrentWithNew(s),t.connectActionHandlers(),a.ngxsBootstrap(new YB,s)};return e.\u0275fac=function(t){return new(t||e)(Qi(GB),Qi(zB),Qi(qB),Qi(XB),Qi(cB,8),Qi(WB))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),ZB=function(){var e=function(){function e(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0;m(this,e);var a=e.flattenStates(r),s=i.addAndReturnDefaults(a);s.states.length&&(n.setStateToTheCurrentWithNew(s),o.ngxsBootstrap(new KB(s.defaults),s))}return b(e,null,[{key:"flattenStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(function(e,t){return e.concat(t)},[])}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(qB),Qi(zB),Qi(GB),Qi(lB,8),Qi(WB))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),JB=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{ngModule:$B,providers:[GB,UB,IB,MB,zF,VB,BB,WB,jB,LB,zB,AB,qB,DB,XB,NB].concat(v(t),v(e.ngxsTokenProviders(t,n)))}}},{key:"forFeature",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{ngModule:ZB,providers:[GB,NB].concat(v(e),[{provide:lB,multi:!0,useValue:e}])}}},{key:"ngxsTokenProviders",value:function(t,n){return[{provide:fB,useValue:VF},{provide:dB,useValue:Jl},{provide:yB,useClass:n.executionStrategy||uB},{provide:cB,useValue:t},{provide:e.ROOT_OPTIONS,useValue:n},{provide:gB,useFactory:e.ngxsConfigFactory,deps:[e.ROOT_OPTIONS]},{provide:El,useFactory:e.appBootstrapListenerFactory,multi:!0,deps:[zF]},{provide:UF,useFactory:e.getInitialState},{provide:GF,useExisting:UB},{provide:WF,useExisting:GB}]}},{key:"ngxsConfigFactory",value:function(e){return xB(new gB,e)}},{key:"appBootstrapListenerFactory",value:function(e){return function(){return e.bootstrap()}}},{key:"getInitialState",value:function(){return HF.pop()}}]),e}();function eV(e){return function(t){!function(e){QB.subscribe(function(t){t&&(e.\u0275prov||console.warn(sB(e.name)))})}(t);var n=t,i=function(e){if(!e.hasOwnProperty(pB)){var t={name:null,actions:{},defaults:{},path:null,makeRootSelector:function(e){return e.getStateGetter(t.name)},children:[]};Object.defineProperty(e,pB,{value:t})}return SB(e)}(n),r=Object.getPrototypeOf(n),o=function(t){return Object.assign({},t[vB]||{},e)}(r);(function(e){var t=e.meta,n=e.inheritedStateClass,i=e.optionsWithInheritance,r=i.children,o=i.defaults,a=i.name,s="string"==typeof a?a:a&&a.getName()||null;HB.checkCorrectStateName(s),n.hasOwnProperty(pB)&&(t.actions=Object.assign({},t.actions,(n[pB]||{}).actions)),t.children=r,t.defaults=o,t.name=s})({meta:i,inheritedStateClass:r,optionsWithInheritance:o}),n[vB]=o}}JB.\u0275fac=function(e){return new(e||JB)},JB.\u0275mod=Pt({type:JB}),JB.\u0275inj=Qe({}),JB.ROOT_OPTIONS=new Mi("ROOT_OPTIONS");var tV=function(){var e=function(){function e(t,n){m(this,e),this._renderer=t,this._elementRef=n,this.onChange=function(e){},this.onTouched=function(){}}return b(e,[{key:"setProperty",value:function(e,t){this._renderer.setProperty(this._elementRef.nativeElement,e,t)}},{key:"registerOnTouched",value:function(e){this.onTouched=e}},{key:"registerOnChange",value:function(e){this.onChange=e}},{key:"setDisabledState",value:function(e){this.setProperty("disabled",e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Zu),Es(Ku))},e.\u0275dir=It({type:e}),e}(),nV=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(tV);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,features:[ss]}),t}(),iV=new Mi("NgValueAccessor"),rV={provide:iV,useExisting:Ue(function(){return aV}),multi:!0},oV=new Mi("CompositionEventMode"),aV=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e,i))._compositionMode=r,o._composing=!1,null==o._compositionMode&&(o._compositionMode=!function(){var e=hh()?hh().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}()),o}return b(n,[{key:"writeValue",value:function(e){this.setProperty("value",null==e?"":e)}},{key:"_handleInput",value:function(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}},{key:"_compositionStart",value:function(){this._composing=!0}},{key:"_compositionEnd",value:function(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}]),n}(tV);return e.\u0275fac=function(t){return new(t||e)(Es(Zu),Es(Ku),Es(oV,8))},e.\u0275dir=It({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(e,t){1&e&&Fs("input",function(e){return t._handleInput(e.target.value)})("blur",function(){return t.onTouched()})("compositionstart",function(){return t._compositionStart()})("compositionend",function(e){return t._compositionEnd(e.target.value)})},features:[Hu([rV]),ss]}),e}(),sV=new Mi("NgValidators"),uV=new Mi("NgAsyncValidators");function cV(e){return null!=e}function lV(e){var t=Ns(e)?me(e):e;return js(t),t}function hV(e){var t={};return e.forEach(function(e){t=null!=e?Object.assign(Object.assign({},t),e):t}),0===Object.keys(t).length?null:t}function fV(e,t){return t.map(function(t){return t(e)})}function dV(e){return e.map(function(e){return function(e){return!e.validate}(e)?e:function(t){return e.validate(t)}})}function pV(e){return null!=e?function(e){if(!e)return null;var t=e.filter(cV);return 0==t.length?null:function(e){return hV(fV(e,t))}}(dV(e)):null}function vV(e){return null!=e?function(e){if(!e)return null;var t=e.filter(cV);return 0==t.length?null:function(e){return wb(fV(e,t).map(lV)).pipe(ue(hV))}}(dV(e)):null}function gV(e,t){return null===e?[t]:Array.isArray(e)?[].concat(v(e),[t]):[e,t]}function mV(e){return e._rawValidators}function yV(e){return e._rawAsyncValidators}function bV(e){return e?Array.isArray(e)?e:[e]:[]}function _V(e,t){return Array.isArray(e)?e.includes(t):e===t}function wV(e,t){var n=bV(t);return bV(e).forEach(function(e){_V(n,e)||n.push(e)}),n}function kV(e,t){return bV(t).filter(function(t){return!_V(e,t)})}var xV=function(){var e=function(){function e(){m(this,e),this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}return b(e,[{key:"value",get:function(){return this.control?this.control.value:null}},{key:"valid",get:function(){return this.control?this.control.valid:null}},{key:"invalid",get:function(){return this.control?this.control.invalid:null}},{key:"pending",get:function(){return this.control?this.control.pending:null}},{key:"disabled",get:function(){return this.control?this.control.disabled:null}},{key:"enabled",get:function(){return this.control?this.control.enabled:null}},{key:"errors",get:function(){return this.control?this.control.errors:null}},{key:"pristine",get:function(){return this.control?this.control.pristine:null}},{key:"dirty",get:function(){return this.control?this.control.dirty:null}},{key:"touched",get:function(){return this.control?this.control.touched:null}},{key:"status",get:function(){return this.control?this.control.status:null}},{key:"untouched",get:function(){return this.control?this.control.untouched:null}},{key:"statusChanges",get:function(){return this.control?this.control.statusChanges:null}},{key:"valueChanges",get:function(){return this.control?this.control.valueChanges:null}},{key:"path",get:function(){return null}},{key:"_setValidators",value:function(e){this._rawValidators=e||[],this._composedValidatorFn=pV(this._rawValidators)}},{key:"_setAsyncValidators",value:function(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=vV(this._rawAsyncValidators)}},{key:"validator",get:function(){return this._composedValidatorFn||null}},{key:"asyncValidator",get:function(){return this._composedAsyncValidatorFn||null}},{key:"_registerOnDestroy",value:function(e){this._onDestroyCallbacks.push(e)}},{key:"_invokeOnDestroyCallbacks",value:function(){this._onDestroyCallbacks.forEach(function(e){return e()}),this._onDestroyCallbacks=[]}},{key:"reset",value:function(e){this.control&&this.control.reset(e)}},{key:"hasError",value:function(e,t){return!!this.control&&this.control.hasError(e,t)}},{key:"getError",value:function(e,t){return this.control?this.control.getError(e,t):null}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e}),e}(),SV=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"formDirective",get:function(){return null}},{key:"path",get:function(){return null}}]),n}(xV);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,features:[ss]}),t}(),EV=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments))._parent=null,e.name=null,e.valueAccessor=null,e}return n}(xV),CV=function(){function e(t){m(this,e),this._cd=t}return b(e,[{key:"is",value:function(e){var t,n,i;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(i=null===(n=this._cd)||void 0===n?void 0:n.control)||void 0===i?void 0:i[e])}}]),e}(),OV=function(){var e=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,e)}return n}(CV);return e.\u0275fac=function(t){return new(t||e)(Es(EV,2))},e.\u0275dir=It({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,t){2&e&&su("ng-untouched",t.is("untouched"))("ng-touched",t.is("touched"))("ng-pristine",t.is("pristine"))("ng-dirty",t.is("dirty"))("ng-valid",t.is("valid"))("ng-invalid",t.is("invalid"))("ng-pending",t.is("pending"))},features:[ss]}),e}(),TV=function(){var e=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,e)}return n}(CV);return e.\u0275fac=function(t){return new(t||e)(Es(SV,10))},e.\u0275dir=It({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(e,t){2&e&&su("ng-untouched",t.is("untouched"))("ng-touched",t.is("touched"))("ng-pristine",t.is("pristine"))("ng-dirty",t.is("dirty"))("ng-valid",t.is("valid"))("ng-invalid",t.is("invalid"))("ng-pending",t.is("pending"))("ng-submitted",t.is("submitted"))},features:[ss]}),e}();function AV(e,t){IV(e,t),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(function(n){e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&DV(e,t)})}(e,t),function(e,t){var n=function(e,n){t.valueAccessor.writeValue(e),n&&t.viewToModelUpdate(e)};e.registerOnChange(n),t._registerOnDestroy(function(){e._unregisterOnChange(n)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(function(){e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&DV(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),function(e,t){if(t.valueAccessor.setDisabledState){var n=function(e){t.valueAccessor.setDisabledState(e)};e.registerOnDisabledChange(n),t._registerOnDestroy(function(){e._unregisterOnDisabledChange(n)})}}(e,t)}function PV(e,t){var n=function(){};t.valueAccessor&&(t.valueAccessor.registerOnChange(n),t.valueAccessor.registerOnTouched(n)),RV(e,t),e&&(t._invokeOnDestroyCallbacks(),e._registerOnCollectionChange(function(){}))}function MV(e,t){e.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function IV(e,t){var n=mV(e);null!==t.validator?e.setValidators(gV(n,t.validator)):"function"==typeof n&&e.setValidators([n]);var i=yV(e);null!==t.asyncValidator?e.setAsyncValidators(gV(i,t.asyncValidator)):"function"==typeof i&&e.setAsyncValidators([i]);var r=function(){return e.updateValueAndValidity()};MV(t._rawValidators,r),MV(t._rawAsyncValidators,r)}function RV(e,t){var n=!1;if(null!==e){if(null!==t.validator){var i=mV(e);if(Array.isArray(i)&&i.length>0){var r=i.filter(function(e){return e!==t.validator});r.length!==i.length&&(n=!0,e.setValidators(r))}}if(null!==t.asyncValidator){var o=yV(e);if(Array.isArray(o)&&o.length>0){var a=o.filter(function(e){return e!==t.asyncValidator});a.length!==o.length&&(n=!0,e.setAsyncValidators(a))}}}var s=function(){};return MV(t._rawValidators,s),MV(t._rawAsyncValidators,s),n}function DV(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function NV(e,t){IV(e,t)}function LV(e,t){e._syncPendingControls(),t.forEach(function(e){var t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)})}function jV(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var FV="VALID",BV="INVALID",VV="PENDING",zV="DISABLED";function UV(e){return(qV(e)?e.validators:e)||null}function HV(e){return Array.isArray(e)?pV(e):e||null}function GV(e,t){return(qV(t)?t.asyncValidators:e)||null}function WV(e){return Array.isArray(e)?vV(e):e||null}function qV(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}var XV=function(){function e(t,n){m(this,e),this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=function(){},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=n,this._composedValidatorFn=HV(this._rawValidators),this._composedAsyncValidatorFn=WV(this._rawAsyncValidators)}return b(e,[{key:"validator",get:function(){return this._composedValidatorFn},set:function(e){this._rawValidators=this._composedValidatorFn=e}},{key:"asyncValidator",get:function(){return this._composedAsyncValidatorFn},set:function(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}},{key:"parent",get:function(){return this._parent}},{key:"valid",get:function(){return this.status===FV}},{key:"invalid",get:function(){return this.status===BV}},{key:"pending",get:function(){return this.status==VV}},{key:"disabled",get:function(){return this.status===zV}},{key:"enabled",get:function(){return this.status!==zV}},{key:"dirty",get:function(){return!this.pristine}},{key:"untouched",get:function(){return!this.touched}},{key:"updateOn",get:function(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}},{key:"setValidators",value:function(e){this._rawValidators=e,this._composedValidatorFn=HV(e)}},{key:"setAsyncValidators",value:function(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=WV(e)}},{key:"addValidators",value:function(e){this.setValidators(wV(e,this._rawValidators))}},{key:"addAsyncValidators",value:function(e){this.setAsyncValidators(wV(e,this._rawAsyncValidators))}},{key:"removeValidators",value:function(e){this.setValidators(kV(e,this._rawValidators))}},{key:"removeAsyncValidators",value:function(e){this.setAsyncValidators(kV(e,this._rawAsyncValidators))}},{key:"hasValidator",value:function(e){return _V(this._rawValidators,e)}},{key:"hasAsyncValidator",value:function(e){return _V(this._rawAsyncValidators,e)}},{key:"clearValidators",value:function(){this.validator=null}},{key:"clearAsyncValidators",value:function(){this.asyncValidator=null}},{key:"markAsTouched",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}},{key:"markAllAsTouched",value:function(){this.markAsTouched({onlySelf:!0}),this._forEachChild(function(e){return e.markAllAsTouched()})}},{key:"markAsUntouched",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.touched=!1,this._pendingTouched=!1,this._forEachChild(function(e){e.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}},{key:"markAsDirty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}},{key:"markAsPristine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pristine=!0,this._pendingDirty=!1,this._forEachChild(function(e){e.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}},{key:"markAsPending",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.status=VV,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}},{key:"disable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._parentMarkedDirty(e.onlySelf);this.status=zV,this.errors=null,this._forEachChild(function(t){t.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(function(e){return e(!0)})}},{key:"enable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._parentMarkedDirty(e.onlySelf);this.status=FV,this._forEachChild(function(t){t.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(function(e){return e(!1)})}},{key:"_updateAncestors",value:function(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}},{key:"setParent",value:function(e){this._parent=e}},{key:"updateValueAndValidity",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===FV||this.status===VV)&&this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}},{key:"_updateTreeValidity",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{emitEvent:!0};this._forEachChild(function(t){return t._updateTreeValidity(e)}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}},{key:"_setInitialStatus",value:function(){this.status=this._allControlsDisabled()?zV:FV}},{key:"_runValidator",value:function(){return this.validator?this.validator(this):null}},{key:"_runAsyncValidator",value:function(e){var t=this;if(this.asyncValidator){this.status=VV,this._hasOwnPendingAsyncValidator=!0;var n=lV(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(function(n){t._hasOwnPendingAsyncValidator=!1,t.setErrors(n,{emitEvent:e})})}}},{key:"_cancelExistingSubscription",value:function(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}},{key:"setErrors",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}},{key:"get",value:function(e){return function(e,t,n){if(null==t||(Array.isArray(t)||(t=t.split(".")),Array.isArray(t)&&0===t.length))return null;var i=e;return t.forEach(function(e){i=i instanceof KV?i.controls.hasOwnProperty(e)?i.controls[e]:null:i instanceof QV&&i.at(e)||null}),i}(this,e)}},{key:"getError",value:function(e,t){var n=t?this.get(t):this;return n&&n.errors?n.errors[e]:null}},{key:"hasError",value:function(e,t){return!!this.getError(e,t)}},{key:"root",get:function(){for(var e=this;e._parent;)e=e._parent;return e}},{key:"_updateControlsErrors",value:function(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}},{key:"_initObservables",value:function(){this.valueChanges=new Zc,this.statusChanges=new Zc}},{key:"_calculateStatus",value:function(){return this._allControlsDisabled()?zV:this.errors?BV:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(VV)?VV:this._anyControlsHaveStatus(BV)?BV:FV}},{key:"_anyControlsHaveStatus",value:function(e){return this._anyControls(function(t){return t.status===e})}},{key:"_anyControlsDirty",value:function(){return this._anyControls(function(e){return e.dirty})}},{key:"_anyControlsTouched",value:function(){return this._anyControls(function(e){return e.touched})}},{key:"_updatePristine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}},{key:"_updateTouched",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}},{key:"_isBoxedValue",value:function(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}},{key:"_registerOnCollectionChange",value:function(e){this._onCollectionChange=e}},{key:"_setUpdateStrategy",value:function(e){qV(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}},{key:"_parentMarkedDirty",value:function(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}]),e}(),YV=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;return m(this,n),(e=t.call(this,UV(r),GV(o,r)))._onChange=[],e._applyFormState(i),e._setUpdateStrategy(r),e._initObservables(),e.updateValueAndValidity({onlySelf:!0,emitEvent:!!e.asyncValidator}),e}return b(n,[{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.value=this._pendingValue=e,this._onChange.length&&!1!==n.emitModelToViewChange&&this._onChange.forEach(function(e){return e(t.value,!1!==n.emitViewToModelChange)}),this.updateValueAndValidity(n)}},{key:"patchValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.setValue(e,t)}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}},{key:"_updateValue",value:function(){}},{key:"_anyControls",value:function(e){return!1}},{key:"_allControlsDisabled",value:function(){return this.disabled}},{key:"registerOnChange",value:function(e){this._onChange.push(e)}},{key:"_unregisterOnChange",value:function(e){jV(this._onChange,e)}},{key:"registerOnDisabledChange",value:function(e){this._onDisabledChange.push(e)}},{key:"_unregisterOnDisabledChange",value:function(e){jV(this._onDisabledChange,e)}},{key:"_forEachChild",value:function(e){}},{key:"_syncPendingControls",value:function(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}},{key:"_applyFormState",value:function(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}]),n}(XV),KV=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,UV(i),GV(r,i))).controls=e,o._initObservables(),o._setUpdateStrategy(i),o._setUpControls(),o.updateValueAndValidity({onlySelf:!0,emitEvent:!!o.asyncValidator}),o}return b(n,[{key:"registerControl",value:function(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}},{key:"addControl",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.registerControl(e,t),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}},{key:"removeControl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}},{key:"setControl",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}},{key:"contains",value:function(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkAllValuesPresent(e),Object.keys(e).forEach(function(i){t._throwIfControlMissing(i),t.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:n.emitEvent})}),this.updateValueAndValidity(n)}},{key:"patchValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null!=e&&(Object.keys(e).forEach(function(i){t.controls[i]&&t.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:n.emitEvent})}),this.updateValueAndValidity(n))}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._forEachChild(function(n,i){n.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}},{key:"getRawValue",value:function(){return this._reduceChildren({},function(e,t,n){return e[n]=t instanceof YV?t.value:t.getRawValue(),e})}},{key:"_syncPendingControls",value:function(){var e=this._reduceChildren(!1,function(e,t){return!!t._syncPendingControls()||e});return e&&this.updateValueAndValidity({onlySelf:!0}),e}},{key:"_throwIfControlMissing",value:function(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error("Cannot find form control with name: ".concat(e,"."))}},{key:"_forEachChild",value:function(e){var t=this;Object.keys(this.controls).forEach(function(n){var i=t.controls[n];i&&e(i,n)})}},{key:"_setUpControls",value:function(){var e=this;this._forEachChild(function(t){t.setParent(e),t._registerOnCollectionChange(e._onCollectionChange)})}},{key:"_updateValue",value:function(){this.value=this._reduceValue()}},{key:"_anyControls",value:function(e){for(var t=0,n=Object.keys(this.controls);t0||this.disabled}},{key:"_checkAllValuesPresent",value:function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control with name: '".concat(n,"'."))})}}]),n}(XV),QV=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,UV(i),GV(r,i))).controls=e,o._initObservables(),o._setUpdateStrategy(i),o._setUpControls(),o.updateValueAndValidity({onlySelf:!0,emitEvent:!!o.asyncValidator}),o}return b(n,[{key:"at",value:function(e){return this.controls[e]}},{key:"push",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}},{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:n.emitEvent})}},{key:"removeAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}},{key:"setControl",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}},{key:"length",get:function(){return this.controls.length}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkAllValuesPresent(e),e.forEach(function(e,i){t._throwIfControlMissing(i),t.at(i).setValue(e,{onlySelf:!0,emitEvent:n.emitEvent})}),this.updateValueAndValidity(n)}},{key:"patchValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null!=e&&(e.forEach(function(e,i){t.at(i)&&t.at(i).patchValue(e,{onlySelf:!0,emitEvent:n.emitEvent})}),this.updateValueAndValidity(n))}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._forEachChild(function(n,i){n.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}},{key:"getRawValue",value:function(){return this.controls.map(function(e){return e instanceof YV?e.value:e.getRawValue()})}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.controls.length<1||(this._forEachChild(function(e){return e._registerOnCollectionChange(function(){})}),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}},{key:"_syncPendingControls",value:function(){var e=this.controls.reduce(function(e,t){return!!t._syncPendingControls()||e},!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}},{key:"_throwIfControlMissing",value:function(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index ".concat(e))}},{key:"_forEachChild",value:function(e){this.controls.forEach(function(t,n){e(t,n)})}},{key:"_updateValue",value:function(){var e=this;this.value=this.controls.filter(function(t){return t.enabled||e.disabled}).map(function(e){return e.value})}},{key:"_anyControls",value:function(e){return this.controls.some(function(t){return t.enabled&&e(t)})}},{key:"_setUpControls",value:function(){var e=this;this._forEachChild(function(t){return e._registerControl(t)})}},{key:"_checkAllValuesPresent",value:function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control at index: ".concat(n,"."))})}},{key:"_allControlsDisabled",value:function(){var e,t=_(this.controls);try{for(t.s();!(e=t.n()).done;){if(e.value.enabled)return!1}}catch(n){t.e(n)}finally{t.f()}return this.controls.length>0||this.disabled}},{key:"_registerControl",value:function(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}]),n}(XV),$V={provide:SV,useExisting:Ue(function(){return JV})},ZV=Promise.resolve(null),JV=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this)).submitted=!1,r._directives=[],r.ngSubmit=new Zc,r.form=new KV({},pV(e),vV(i)),r}return b(n,[{key:"ngAfterViewInit",value:function(){this._setUpdateStrategy()}},{key:"formDirective",get:function(){return this}},{key:"control",get:function(){return this.form}},{key:"path",get:function(){return[]}},{key:"controls",get:function(){return this.form.controls}},{key:"addControl",value:function(e){var t=this;ZV.then(function(){var n=t._findContainer(e.path);e.control=n.registerControl(e.name,e.control),AV(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),t._directives.push(e)})}},{key:"getControl",value:function(e){return this.form.get(e.path)}},{key:"removeControl",value:function(e){var t=this;ZV.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name),jV(t._directives,e)})}},{key:"addFormGroup",value:function(e){var t=this;ZV.then(function(){var n=t._findContainer(e.path),i=new KV({});NV(i,e),n.registerControl(e.name,i),i.updateValueAndValidity({emitEvent:!1})})}},{key:"removeFormGroup",value:function(e){var t=this;ZV.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name)})}},{key:"getFormGroup",value:function(e){return this.form.get(e.path)}},{key:"updateModel",value:function(e,t){var n=this;ZV.then(function(){n.form.get(e.path).setValue(t)})}},{key:"setValue",value:function(e){this.control.setValue(e)}},{key:"onSubmit",value:function(e){return this.submitted=!0,LV(this.form,this._directives),this.ngSubmit.emit(e),!1}},{key:"onReset",value:function(){this.resetForm()}},{key:"resetForm",value:function(e){this.form.reset(e),this.submitted=!1}},{key:"_setUpdateStrategy",value:function(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}},{key:"_findContainer",value:function(e){return e.pop(),e.length?this.form.get(e):this.form}}]),n}(SV);return e.\u0275fac=function(t){return new(t||e)(Es(sV,10),Es(uV,10))},e.\u0275dir=It({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(e,t){1&e&&Fs("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Hu([$V]),ss]}),e}(),ez=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),e}(),tz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),nz=new Mi("NgModelWithFormControlWarning"),iz={provide:EV,useExisting:Ue(function(){return rz})},rz=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;return m(this,n),(a=t.call(this))._ngModelWarningConfig=o,a.update=new Zc,a._ngModelWarningSent=!1,a._setValidators(e),a._setAsyncValidators(i),a.valueAccessor=function(e,t){return t?(Array.isArray(t),t.forEach(function(e){e.constructor===aV?n=e:function(e){return Object.getPrototypeOf(e.constructor)===nV}(e)?i=e:r=e}),r||i||n||null):null;var n,i,r}(0,r),a}return b(n,[{key:"isDisabled",set:function(e){}},{key:"ngOnChanges",value:function(e){if(this._isControlChanged(e)){var t=e.form.previousValue;t&&PV(t,this,!1),AV(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}(function(e,t){if(!e.hasOwnProperty("model"))return!1;var n=e.model;return!!n.isFirstChange()||!Object.is(t,n.currentValue)})(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}},{key:"ngOnDestroy",value:function(){this.form&&PV(this.form,this,!1)}},{key:"path",get:function(){return[]}},{key:"control",get:function(){return this.form}},{key:"viewToModelUpdate",value:function(e){this.viewModel=e,this.update.emit(e)}},{key:"_isControlChanged",value:function(e){return e.hasOwnProperty("form")}}]),n}(EV);return e.\u0275fac=function(t){return new(t||e)(Es(sV,10),Es(uV,10),Es(iV,10),Es(nz,8))},e.\u0275dir=It({type:e,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[Hu([iz]),ss,Gt]}),e._ngModelWarningSentOnce=!1,e}(),oz={provide:SV,useExisting:Ue(function(){return az})},az=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this)).validators=e,r.asyncValidators=i,r.submitted=!1,r._onCollectionChange=function(){return r._updateDomValue()},r.directives=[],r.form=null,r.ngSubmit=new Zc,r._setValidators(e),r._setAsyncValidators(i),r}return b(n,[{key:"ngOnChanges",value:function(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}},{key:"ngOnDestroy",value:function(){this.form&&(RV(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(function(){}))}},{key:"formDirective",get:function(){return this}},{key:"control",get:function(){return this.form}},{key:"path",get:function(){return[]}},{key:"addControl",value:function(e){var t=this.form.get(e.path);return AV(t,e),t.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),t}},{key:"getControl",value:function(e){return this.form.get(e.path)}},{key:"removeControl",value:function(e){PV(e.control||null,e,!1),jV(this.directives,e)}},{key:"addFormGroup",value:function(e){this._setUpFormContainer(e)}},{key:"removeFormGroup",value:function(e){this._cleanUpFormContainer(e)}},{key:"getFormGroup",value:function(e){return this.form.get(e.path)}},{key:"addFormArray",value:function(e){this._setUpFormContainer(e)}},{key:"removeFormArray",value:function(e){this._cleanUpFormContainer(e)}},{key:"getFormArray",value:function(e){return this.form.get(e.path)}},{key:"updateModel",value:function(e,t){this.form.get(e.path).setValue(t)}},{key:"onSubmit",value:function(e){return this.submitted=!0,LV(this.form,this.directives),this.ngSubmit.emit(e),!1}},{key:"onReset",value:function(){this.resetForm()}},{key:"resetForm",value:function(e){this.form.reset(e),this.submitted=!1}},{key:"_updateDomValue",value:function(){var e=this;this.directives.forEach(function(t){var n=t.control,i=e.form.get(t.path);n!==i&&(PV(n||null,t),i instanceof YV&&(AV(i,t),t.control=i))}),this.form._updateTreeValidity({emitEvent:!1})}},{key:"_setUpFormContainer",value:function(e){var t=this.form.get(e.path);NV(t,e),t.updateValueAndValidity({emitEvent:!1})}},{key:"_cleanUpFormContainer",value:function(e){if(this.form){var t=this.form.get(e.path);t&&function(e,t){return RV(e,t)}(t,e)&&t.updateValueAndValidity({emitEvent:!1})}}},{key:"_updateRegistrations",value:function(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(function(){})}},{key:"_updateValidators",value:function(){IV(this.form,this),this._oldForm&&RV(this._oldForm,this)}},{key:"_checkFormPresent",value:function(){}}]),n}(SV);return e.\u0275fac=function(t){return new(t||e)(Es(sV,10),Es(uV,10))},e.\u0275dir=It({type:e,selectors:[["","formGroup",""]],hostBindings:function(e,t){1&e&&Fs("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Hu([oz]),ss,Gt]}),e}(),sz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[tz]]}),e}(),uz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[sz]}),e}(),cz=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"withConfig",value:function(t){return{ngModule:e,providers:[{provide:nz,useValue:t.warnOnNgModelWithFormControl}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[sz]}),e}();function lz(e){return new ee(function(t){var n;try{n=e()}catch(i){return void t.error(i)}return(n?me(n):yd()).subscribe(t)})}var hz=["underline"],fz=["connectionContainer"],dz=["inputContainer"],pz=["label"];function vz(e,t){1&e&&(Ms(0),Ts(1,"div",14),Ps(2,"div",15),Ps(3,"div",16),Ps(4,"div",17),As(),Ts(5,"div",18),Ps(6,"div",15),Ps(7,"div",16),Ps(8,"div",17),As(),Is())}function gz(e,t){1&e&&(Ts(0,"div",19),qs(1,1),As())}function mz(e,t){if(1&e&&(Ms(0),qs(1,2),Ts(2,"span"),ku(3),As(),Is()),2&e){var n=Hs(2);qo(3),xu(n._control.placeholder)}}function yz(e,t){1&e&&qs(0,3,["*ngSwitchCase","true"])}function bz(e,t){1&e&&(Ts(0,"span",23),ku(1," *"),As())}function _z(e,t){if(1&e){var n=Ds();Ts(0,"label",20,21),Fs("cdkObserveContent",function(){return mn(n),Hs().updateOutlineGap()}),xs(2,mz,4,1,"ng-container",12),xs(3,yz,1,0,"ng-content",12),xs(4,bz,2,0,"span",22),As()}if(2&e){var i=Hs();su("mat-empty",i._control.empty&&!i._shouldAlwaysFloat())("mat-form-field-empty",i._control.empty&&!i._shouldAlwaysFloat())("mat-accent","accent"==i.color)("mat-warn","warn"==i.color),Cs("cdkObserveContentDisabled","outline"!=i.appearance)("id",i._labelId)("ngSwitch",i._hasLabel()),_s("for",i._control.id)("aria-owns",i._control.id),qo(2),Cs("ngSwitchCase",!1),qo(1),Cs("ngSwitchCase",!0),qo(1),Cs("ngIf",!i.hideRequiredMarker&&i._control.required&&!i._control.disabled)}}function wz(e,t){1&e&&(Ts(0,"div",24),qs(1,4),As())}function kz(e,t){if(1&e&&(Ts(0,"div",25,26),Ps(2,"span",27),As()),2&e){var n=Hs();qo(2),su("mat-accent","accent"==n.color)("mat-warn","warn"==n.color)}}function xz(e,t){1&e&&(Ts(0,"div"),qs(1,5),As()),2&e&&Cs("@transitionMessages",Hs()._subscriptAnimationState)}function Sz(e,t){if(1&e&&(Ts(0,"div",31),ku(1),As()),2&e){var n=Hs(2);Cs("id",n._hintLabelId),qo(1),xu(n.hintLabel)}}function Ez(e,t){if(1&e&&(Ts(0,"div",28),xs(1,Sz,2,2,"div",29),qs(2,6),Ps(3,"div",30),qs(4,7),As()),2&e){var n=Hs();Cs("@transitionMessages",n._subscriptAnimationState),qo(1),Cs("ngIf",n.hintLabel)}}var Cz=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Oz=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Tz=new Mi("MatError"),Az={transitionMessages:eg("transitionMessages",[rg("enter",ig({opacity:1,transform:"translateY(0%)"})),og("void => enter",[ig({opacity:0,transform:"translateY(-5px)"}),tg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},Pz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e}),e}(),Mz=new Mi("MatHint"),Iz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["mat-label"]]}),e}(),Rz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["mat-placeholder"]]}),e}(),Dz=new Mi("MatPrefix"),Nz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["","matPrefix",""]],features:[Hu([{provide:Dz,useExisting:e}])]}),e}(),Lz=new Mi("MatSuffix"),jz=0,Fz=Xy(function(){return function e(t){m(this,e),this._elementRef=t}}(),"primary"),Bz=new Mi("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Vz=new Mi("MatFormField"),zz=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c){var l;return m(this,n),(l=t.call(this,e))._changeDetectorRef=i,l._dir=o,l._defaults=a,l._platform=s,l._ngZone=u,l._outlineGapCalculationNeededImmediately=!1,l._outlineGapCalculationNeededOnStable=!1,l._destroyed=new oe,l._showAlwaysAnimate=!1,l._subscriptAnimationState="",l._hintLabel="",l._hintLabelId="mat-hint-"+jz++,l._labelId="mat-form-field-label-"+jz++,l.floatLabel=l._getDefaultFloatLabelState(),l._animationsEnabled="NoopAnimations"!==c,l.appearance=a&&a.appearance?a.appearance:"legacy",l._hideRequiredMarker=!(!a||null==a.hideRequiredMarker)&&a.hideRequiredMarker,l}return b(n,[{key:"appearance",get:function(){return this._appearance},set:function(e){var t=this._appearance;this._appearance=e||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&t!==e&&(this._outlineGapCalculationNeededOnStable=!0)}},{key:"hideRequiredMarker",get:function(){return this._hideRequiredMarker},set:function(e){this._hideRequiredMarker=If(e)}},{key:"_shouldAlwaysFloat",value:function(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}},{key:"_canLabelFloat",value:function(){return"never"!==this.floatLabel}},{key:"hintLabel",get:function(){return this._hintLabel},set:function(e){this._hintLabel=e,this._processHints()}},{key:"floatLabel",get:function(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel},set:function(e){e!==this._floatLabel&&(this._floatLabel=e||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}},{key:"_control",get:function(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic},set:function(e){this._explicitFormFieldControl=e}},{key:"getLabelId",value:function(){return this._hasFloatingLabel()?this._labelId:null}},{key:"getConnectedOverlayOrigin",value:function(){return this._connectionContainerRef||this._elementRef}},{key:"ngAfterContentInit",value:function(){var e=this;this._validateControlChild();var t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add("mat-form-field-type-".concat(t.controlType)),t.stateChanges.pipe(fd(null)).subscribe(function(){e._validatePlaceholders(),e._syncDescribedByIds(),e._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(ud(this._destroyed)).subscribe(function(){return e._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(function(){e._ngZone.onStable.pipe(ud(e._destroyed)).subscribe(function(){e._outlineGapCalculationNeededOnStable&&e.updateOutlineGap()})}),Ce(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(function(){e._outlineGapCalculationNeededOnStable=!0,e._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(fd(null)).subscribe(function(){e._processHints(),e._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(fd(null)).subscribe(function(){e._syncDescribedByIds(),e._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(ud(this._destroyed)).subscribe(function(){"function"==typeof requestAnimationFrame?e._ngZone.runOutsideAngular(function(){requestAnimationFrame(function(){return e.updateOutlineGap()})}):e.updateOutlineGap()})}},{key:"ngAfterContentChecked",value:function(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}},{key:"ngAfterViewInit",value:function(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}},{key:"ngOnDestroy",value:function(){this._destroyed.next(),this._destroyed.complete()}},{key:"_shouldForward",value:function(e){var t=this._control?this._control.ngControl:null;return t&&t[e]}},{key:"_hasPlaceholder",value:function(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}},{key:"_hasLabel",value:function(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}},{key:"_shouldLabelFloat",value:function(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}},{key:"_hideControlPlaceholder",value:function(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}},{key:"_hasFloatingLabel",value:function(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}},{key:"_getDisplayedMessages",value:function(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}},{key:"_animateAndLockLabel",value:function(){var e=this;this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,Ff(this._label.nativeElement,"transitionend").pipe(ap(1)).subscribe(function(){e._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}},{key:"_validatePlaceholders",value:function(){}},{key:"_processHints",value:function(){this._validateHints(),this._syncDescribedByIds()}},{key:"_validateHints",value:function(){}},{key:"_getDefaultFloatLabelState",value:function(){return this._defaults&&this._defaults.floatLabel||"auto"}},{key:"_syncDescribedByIds",value:function(){if(this._control){var e=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&e.push.apply(e,v(this._control.userAriaDescribedBy.split(" "))),"hint"===this._getDisplayedMessages()){var t=this._hintChildren?this._hintChildren.find(function(e){return"start"===e.align}):null,n=this._hintChildren?this._hintChildren.find(function(e){return"end"===e.align}):null;t?e.push(t.id):this._hintLabel&&e.push(this._hintLabelId),n&&e.push(n.id)}else this._errorChildren&&e.push.apply(e,v(this._errorChildren.map(function(e){return e.id})));this._control.setDescribedByIds(e)}}},{key:"_validateControlChild",value:function(){}},{key:"updateOutlineGap",value:function(){var e=this._label?this._label.nativeElement:null;if("outline"===this.appearance&&e&&e.children.length&&e.textContent.trim()&&this._platform.isBrowser)if(this._isAttachedToDOM()){var t=0,n=0,i=this._connectionContainerRef.nativeElement,r=i.querySelectorAll(".mat-form-field-outline-start"),o=i.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){var a=i.getBoundingClientRect();if(0===a.width&&0===a.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);for(var s=this._getStartEnd(a),u=e.children,c=this._getStartEnd(u[0].getBoundingClientRect()),l=0,h=0;h0?.75*l+10:0}for(var f=0;f1&&void 0!==arguments[1]?arguments[1]:Jf,n=function(e){return e instanceof Date&&!isNaN(+e)}(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new Gz(n,t))}}var Gz=function(){function e(t,n){m(this,e),this.delay=t,this.scheduler=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new Wz(e,this.delay,this.scheduler))}}]),e}(),Wz=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).delay=i,o.scheduler=r,o.queue=[],o.active=!1,o.errored=!1,o}return b(n,[{key:"_schedule",value:function(e){this.active=!0,this.destination.add(e.schedule(n.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}},{key:"scheduleNotification",value:function(e){if(!0!==this.errored){var t=this.scheduler,n=new qz(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}}},{key:"_next",value:function(e){this.scheduleNotification(wd.createNext(e))}},{key:"_error",value:function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleNotification(wd.createComplete()),this.unsubscribe()}}],[{key:"dispatch",value:function(e){for(var t=e.source,n=t.queue,i=e.scheduler,r=e.destination;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){var o=Math.max(0,n[0].time-i.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}}]),n}(Y),qz=function e(t,n){m(this,e),this.time=t,this.notification=n},Xz=["panel"];function Yz(e,t){if(1&e&&(Ts(0,"div",0,1),qs(2),As()),2&e){var n=t.id,i=Hs();Cs("id",i.id)("ngClass",i._classList),_s("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby(n))}}var Kz=["*"],Qz=0,$z=function e(t,n){m(this,e),this.source=t,this.option=n},Zz=Yy(function(){return function e(){m(this,e)}}()),Jz=new Mi("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}}),eU=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;return m(this,n),(a=t.call(this))._changeDetectorRef=e,a._elementRef=i,a._activeOptionChanges=W.EMPTY,a.showPanel=!1,a._isOpen=!1,a.displayWith=null,a.optionSelected=new Zc,a.opened=new Zc,a.closed=new Zc,a.optionActivated=new Zc,a._classList={},a.id="mat-autocomplete-"+Qz++,a.inertGroups=(null==o?void 0:o.SAFARI)||!1,a._autoActiveFirstOption=!!r.autoActiveFirstOption,a}return b(n,[{key:"isOpen",get:function(){return this._isOpen&&this.showPanel}},{key:"autoActiveFirstOption",get:function(){return this._autoActiveFirstOption},set:function(e){this._autoActiveFirstOption=If(e)}},{key:"classList",set:function(e){this._classList=e&&e.length?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\s+/,n=[];if(null!=e){var i,r=Array.isArray(e)?e:"".concat(e).split(t),o=_(r);try{for(o.s();!(i=o.n()).done;){var a=i.value,s="".concat(a).trim();s&&n.push(s)}}catch(u){o.e(u)}finally{o.f()}}return n}(e).reduce(function(e,t){return e[t]=!0,e},{}):{},this._setVisibilityClasses(this._classList),this._elementRef.nativeElement.className=""}},{key:"ngAfterContentInit",value:function(){var e=this;this._keyManager=new Tv(this.options).withWrap(),this._activeOptionChanges=this._keyManager.change.subscribe(function(t){e.isOpen&&e.optionActivated.emit({source:e,option:e.options.toArray()[t]||null})}),this._setVisibility()}},{key:"ngOnDestroy",value:function(){this._activeOptionChanges.unsubscribe()}},{key:"_setScrollTop",value:function(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}},{key:"_getScrollTop",value:function(){return this.panel?this.panel.nativeElement.scrollTop:0}},{key:"_setVisibility",value:function(){this.showPanel=!!this.options.length,this._setVisibilityClasses(this._classList),this._changeDetectorRef.markForCheck()}},{key:"_emitSelectEvent",value:function(e){var t=new $z(this,e);this.optionSelected.emit(t)}},{key:"_getPanelAriaLabelledby",value:function(e){return this.ariaLabel?null:this.ariaLabelledby?(e?e+" ":"")+this.ariaLabelledby:e}},{key:"_setVisibilityClasses",value:function(e){e[this._visibleClass]=this.showPanel,e[this._hiddenClass]=!this.showPanel}}]),n}(Zz);return e.\u0275fac=function(t){return new(t||e)(Es(wc),Es(Ku),Es(Jz),Es(Id))},e.\u0275dir=It({type:e,viewQuery:function(e,t){var n;(1&e&&(hl(Cc,7),hl(Xz,5)),2&e)&&(ll(n=dl())&&(t.template=n.first),ll(n=dl())&&(t.panel=n.first))},inputs:{displayWith:"displayWith",autoActiveFirstOption:"autoActiveFirstOption",classList:["class","classList"],ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],panelWidth:"panelWidth"},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},features:[ss]}),e}(),tU=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments))._visibleClass="mat-autocomplete-visible",e._hiddenClass="mat-autocomplete-hidden",e}return n}(eU);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275cmp=Ct({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(e,t,n){var i;(1&e&&(fl(n,db,5),fl(n,mb,5)),2&e)&&(ll(i=dl())&&(t.optionGroups=i),ll(i=dl())&&(t.options=i))},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[Hu([{provide:cb,useExisting:t}]),ss],ngContentSelectors:Kz,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(e,t){1&e&&(Ws(),xs(0,Yz,3,4,"ng-template"))},directives:[Ih],styles:[".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}\n"],encapsulation:2,changeDetection:0}),t}(),nU=new Mi("mat-autocomplete-scroll-strategy"),iU={provide:nU,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},rU={provide:iV,useExisting:Ue(function(){return aU}),multi:!0},oU=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h){var f=this;m(this,e),this._element=t,this._overlay=n,this._viewContainerRef=i,this._zone=r,this._changeDetectorRef=o,this._dir=s,this._formField=u,this._document=c,this._viewportRuler=l,this._defaults=h,this._componentDestroyed=!1,this._autocompleteDisabled=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=W.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new oe,this._windowBlurHandler=function(){f._canOpenOnNextFocus=f._document.activeElement!==f._element.nativeElement||f.panelOpen},this._onChange=function(){},this._onTouched=function(){},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=lz(function(){return f.autocomplete&&f.autocomplete.options?Ce.apply(void 0,v(f.autocomplete.options.map(function(e){return e.onSelectionChange}))):f._zone.onStable.pipe(ap(1),dd(function(){return f.optionSelections}))}),this._scrollStrategy=a}return b(e,[{key:"autocompleteDisabled",get:function(){return this._autocompleteDisabled},set:function(e){this._autocompleteDisabled=If(e)}},{key:"ngAfterViewInit",value:function(){var e=this,t=this._getWindow();void 0!==t&&this._zone.runOutsideAngular(function(){return t.addEventListener("blur",e._windowBlurHandler)})}},{key:"ngOnChanges",value:function(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}},{key:"ngOnDestroy",value:function(){var e=this._getWindow();void 0!==e&&e.removeEventListener("blur",this._windowBlurHandler),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete()}},{key:"panelOpen",get:function(){return this._overlayAttached&&this.autocomplete.showPanel}},{key:"openPanel",value:function(){this._attachOverlay(),this._floatLabel()}},{key:"closePanel",value:function(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this.autocomplete.closed.emit(),this.autocomplete._isOpen=this._overlayAttached=!1,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._componentDestroyed||this._changeDetectorRef.detectChanges())}},{key:"updatePosition",value:function(){this._overlayAttached&&this._overlayRef.updatePosition()}},{key:"panelClosingActions",get:function(){var e=this;return Ce(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(od(function(){return e._overlayAttached})),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(od(function(){return e._overlayAttached})):jf()).pipe(ue(function(e){return e instanceof vb?e:null}))}},{key:"activeOption",get:function(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}},{key:"_getOutsideClickStream",value:function(){var e=this;return Ce(Ff(this._document,"click"),Ff(this._document,"auxclick"),Ff(this._document,"touchend")).pipe(od(function(t){var n=Bd(t),i=e._formField?e._formField._elementRef.nativeElement:null,r=e.connectedTo?e.connectedTo.elementRef.nativeElement:null;return e._overlayAttached&&n!==e._element.nativeElement&&(!i||!i.contains(n))&&(!r||!r.contains(n))&&!!e._overlayRef&&!e._overlayRef.overlayElement.contains(n)}))}},{key:"writeValue",value:function(e){var t=this;Promise.resolve(null).then(function(){return t._setTriggerValue(e)})}},{key:"registerOnChange",value:function(e){this._onChange=e}},{key:"registerOnTouched",value:function(e){this._onTouched=e}},{key:"setDisabledState",value:function(e){this._element.nativeElement.disabled=e}},{key:"_handleKeydown",value:function(e){var t=e.keyCode;if(27===t&&!fp(e)&&e.preventDefault(),this.activeOption&&13===t&&this.panelOpen)this.activeOption._selectViaInteraction(),this._resetActiveItem(),e.preventDefault();else if(this.autocomplete){var n=this.autocomplete._keyManager.activeItem,i=38===t||40===t;this.panelOpen||9===t?this.autocomplete._keyManager.onKeydown(e):i&&this._canOpen()&&this.openPanel(),(i||this.autocomplete._keyManager.activeItem!==n)&&this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0)}}},{key:"_handleInput",value:function(e){var t=e.target,n=t.value;"number"===t.type&&(n=""==n?null:parseFloat(n)),this._previousValue!==n&&(this._previousValue=n,this._onChange(n),this._canOpen()&&this._document.activeElement===e.target&&this.openPanel())}},{key:"_handleFocus",value:function(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}},{key:"_floatLabel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._formField&&"auto"===this._formField.floatLabel&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}},{key:"_resetLabel",value:function(){this._manuallyFloatingLabel&&(this._formField.floatLabel="auto",this._manuallyFloatingLabel=!1)}},{key:"_subscribeToClosingActions",value:function(){var e=this;return Ce(this._zone.onStable.pipe(ap(1)),this.autocomplete.options.changes.pipe(rv(function(){return e._positionStrategy.reapplyLastPosition()}),Hz(0))).pipe(dd(function(){var t=e.panelOpen;return e._resetActiveItem(),e.autocomplete._setVisibility(),e.panelOpen&&(e._overlayRef.updatePosition(),t!==e.panelOpen&&e.autocomplete.opened.emit()),e.panelClosingActions}),ap(1)).subscribe(function(t){return e._setValueAndClose(t)})}},{key:"_destroyPanel",value:function(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}},{key:"_setTriggerValue",value:function(e){var t=this.autocomplete&&this.autocomplete.displayWith?this.autocomplete.displayWith(e):e,n=null!=t?t:"";this._formField?this._formField._control.value=n:this._element.nativeElement.value=n,this._previousValue=n}},{key:"_setValueAndClose",value:function(e){e&&e.source&&(this._clearPreviousSelectedOption(e.source),this._setTriggerValue(e.source.value),this._onChange(e.source.value),this._element.nativeElement.focus(),this.autocomplete._emitSelectEvent(e.source)),this.closePanel()}},{key:"_clearPreviousSelectedOption",value:function(e){this.autocomplete.options.forEach(function(t){t!==e&&t.selected&&t.deselect()})}},{key:"_attachOverlay",value:function(){var e,t=this,n=this._overlayRef;n?(this._positionStrategy.setOrigin(this._getConnectedElement()),n.updateSize({width:this._getPanelWidth()})):(this._portal=new $d(this.autocomplete.template,this._viewContainerRef,{id:null===(e=this._formField)||void 0===e?void 0:e.getLabelId()}),n=this._overlay.create(this._getOverlayConfig()),this._overlayRef=n,n.keydownEvents().subscribe(function(e){(27===e.keyCode&&!fp(e)||38===e.keyCode&&fp(e,"altKey"))&&(t._closeKeyEventStream.next(),t._resetActiveItem(),e.stopPropagation(),e.preventDefault())}),this._viewportSubscription=this._viewportRuler.change().subscribe(function(){t.panelOpen&&n&&n.updateSize({width:t._getPanelWidth()})})),n&&!n.hasAttached()&&(n.attach(this._portal),this._closingActionsSubscription=this._subscribeToClosingActions());var i=this.panelOpen;this.autocomplete._setVisibility(),this.autocomplete._isOpen=this._overlayAttached=!0,this.panelOpen&&i!==this.panelOpen&&this.autocomplete.opened.emit()}},{key:"_getOverlayConfig",value:function(){var e;return new wp({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir,panelClass:null===(e=this._defaults)||void 0===e?void 0:e.overlayPanelClass})}},{key:"_getOverlayPosition",value:function(){var e=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(e),this._positionStrategy=e,e}},{key:"_setStrategyPositions",value:function(e){var t,n=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],i=this._aboveClass,r=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}];t="above"===this.position?r:"below"===this.position?n:[].concat(n,r),e.withPositions(t)}},{key:"_getConnectedElement",value:function(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}},{key:"_getPanelWidth",value:function(){return this.autocomplete.panelWidth||this._getHostWidth()}},{key:"_getHostWidth",value:function(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}},{key:"_resetActiveItem",value:function(){var e=this.autocomplete;e.autoActiveFirstOption?e._keyManager.setFirstItemActive():e._keyManager.setActiveItem(-1)}},{key:"_canOpen",value:function(){var e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this._autocompleteDisabled}},{key:"_getWindow",value:function(){var e;return(null===(e=this._document)||void 0===e?void 0:e.defaultView)||window}},{key:"_scrollToOption",value:function(e){var t=this.autocomplete,n=yb(e,t.options,t.optionGroups);if(0===e&&1===n)t._setScrollTop(0);else if(t.panel){var i=t.options.toArray()[e];if(i){var r=i._getHostElement(),o=bb(r.offsetTop,r.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(o)}}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Hp),Es(Mc),Es(Vl),Es(wc),Es(nU),Es(zd,8),Es(Vz,9),Es(fh,8),Es(qd),Es(Jz,8))},e.\u0275dir=It({type:e,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[Gt]}),e}(),aU=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments))._aboveClass="mat-autocomplete-panel-above",e}return n}(oU);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(e,t){1&e&&Fs("focusin",function(){return t._handleFocus()})("blur",function(){return t._onTouched()})("input",function(e){return t._handleInput(e)})("keydown",function(e){return t._handleKeydown(e)}),2&e&&_s("autocomplete",t.autocompleteAttribute)("role",t.autocompleteDisabled?null:"combobox")("aria-autocomplete",t.autocompleteDisabled?null:"list")("aria-activedescendant",t.panelOpen&&t.activeOption?t.activeOption.id:null)("aria-expanded",t.autocompleteDisabled?null:t.panelOpen.toString())("aria-owns",t.autocompleteDisabled||!t.panelOpen||null==t.autocomplete?null:t.autocomplete.id)("aria-haspopup",!t.autocompleteDisabled)},exportAs:["matAutocompleteTrigger"],features:[Hu([rU]),ss]}),t}(),sU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[iU],imports:[[Kp,_b,Wy,Kh],Xd,_b,Wy]}),e}(),uU=Ld({passive:!0}),cU=function(){var e=function(){function e(t,n){m(this,e),this._platform=t,this._ngZone=n,this._monitoredElements=new Map}return b(e,[{key:"monitor",value:function(e){var t=this;if(!this._platform.isBrowser)return md;var n=Lf(e),i=this._monitoredElements.get(n);if(i)return i.subject;var r=new oe,o="cdk-text-field-autofilled",a=function(e){"cdk-text-field-autofill-start"!==e.animationName||n.classList.contains(o)?"cdk-text-field-autofill-end"===e.animationName&&n.classList.contains(o)&&(n.classList.remove(o),t._ngZone.run(function(){return r.next({target:e.target,isAutofilled:!1})})):(n.classList.add(o),t._ngZone.run(function(){return r.next({target:e.target,isAutofilled:!0})}))};return this._ngZone.runOutsideAngular(function(){n.addEventListener("animationstart",a,uU),n.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(n,{subject:r,unlisten:function(){n.removeEventListener("animationstart",a,uU)}}),r}},{key:"stopMonitoring",value:function(e){var t=Lf(e),n=this._monitoredElements.get(t);n&&(n.unlisten(),n.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))}},{key:"ngOnDestroy",value:function(){var e=this;this._monitoredElements.forEach(function(t,n){return e.stopMonitoring(n)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id),Qi(Vl))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id),Qi(Vl))},token:e,providedIn:"root"}),e}(),lU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Rd]]}),e}(),hU=new Mi("MAT_INPUT_VALUE_ACCESSOR"),fU=["button","checkbox","file","hidden","image","radio","range","reset","submit"],dU=0,pU=Qy(function(){return function e(t,n,i,r){m(this,e),this._defaultErrorStateMatcher=t,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}}()),vU=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c,l,h){var f;m(this,n),(f=t.call(this,s,o,a,r))._elementRef=e,f._platform=i,f._autofillMonitor=c,f._formField=h,f._uid="mat-input-"+dU++,f.focused=!1,f.stateChanges=new oe,f.controlType="mat-input",f.autofilled=!1,f._disabled=!1,f._required=!1,f._type="text",f._readonly=!1,f._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(function(e){return Nd().has(e)});var d=f._elementRef.nativeElement,p=d.nodeName.toLowerCase();return f._inputValueAccessor=u||d,f._previousNativeValue=f.value,f.id=f.id,i.IOS&&l.runOutsideAngular(function(){e.nativeElement.addEventListener("keyup",function(e){var t=e.target;!t.value&&0===t.selectionStart&&0===t.selectionEnd&&(t.setSelectionRange(1,1),t.setSelectionRange(0,0))})}),f._isServer=!f._platform.isBrowser,f._isNativeSelect="select"===p,f._isTextarea="textarea"===p,f._isInFormField=!!h,f._isNativeSelect&&(f.controlType=d.multiple?"mat-native-select-multiple":"mat-native-select"),f}return b(n,[{key:"disabled",get:function(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled},set:function(e){this._disabled=If(e),this.focused&&(this.focused=!1,this.stateChanges.next())}},{key:"id",get:function(){return this._id},set:function(e){this._id=e||this._uid}},{key:"required",get:function(){return this._required},set:function(e){this._required=If(e)}},{key:"type",get:function(){return this._type},set:function(e){this._type=e||"text",this._validateType(),!this._isTextarea&&Nd().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}},{key:"value",get:function(){return this._inputValueAccessor.value},set:function(e){e!==this.value&&(this._inputValueAccessor.value=e,this.stateChanges.next())}},{key:"readonly",get:function(){return this._readonly},set:function(e){this._readonly=If(e)}},{key:"ngAfterViewInit",value:function(){var e=this;this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(function(t){e.autofilled=t.isAutofilled,e.stateChanges.next()})}},{key:"ngOnChanges",value:function(){this.stateChanges.next()}},{key:"ngOnDestroy",value:function(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}},{key:"ngDoCheck",value:function(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}},{key:"focus",value:function(e){this._elementRef.nativeElement.focus(e)}},{key:"_focusChanged",value:function(e){e!==this.focused&&(this.focused=e,this.stateChanges.next())}},{key:"_onInput",value:function(){}},{key:"_dirtyCheckPlaceholder",value:function(){var e,t,n=(null===(t=null===(e=this._formField)||void 0===e?void 0:e._hideControlPlaceholder)||void 0===t?void 0:t.call(e))?null:this.placeholder;if(n!==this._previousPlaceholder){var i=this._elementRef.nativeElement;this._previousPlaceholder=n,n?i.setAttribute("placeholder",n):i.removeAttribute("placeholder")}}},{key:"_dirtyCheckNativeValue",value:function(){var e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}},{key:"_validateType",value:function(){fU.indexOf(this._type)}},{key:"_isNeverEmpty",value:function(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}},{key:"_isBadInput",value:function(){var e=this._elementRef.nativeElement.validity;return e&&e.badInput}},{key:"empty",get:function(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}},{key:"shouldLabelFloat",get:function(){if(this._isNativeSelect){var e=this._elementRef.nativeElement,t=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&t&&t.label)}return this.focused||!this.empty}},{key:"setDescribedByIds",value:function(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}},{key:"onContainerClick",value:function(){this.focused||this.focus()}}]),n}(pU);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Id),Es(EV,10),Es(JV,8),Es(az,8),Es($y),Es(hU,10),Es(cU),Es(Vl),Es(Vz,8))},e.\u0275dir=It({type:e,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(e,t){1&e&&Fs("focus",function(){return t._focusChanged(!0)})("blur",function(){return t._focusChanged(!1)})("input",function(){return t._onInput()}),2&e&&(Ou("disabled",t.disabled)("required",t.required),_s("id",t.id)("data-placeholder",t.placeholder)("readonly",t.readonly&&!t._isNativeSelect||null)("aria-invalid",t.empty&&t.required?null:t.errorState)("aria-required",t.required),su("mat-input-server",t._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[Hu([{provide:Pz,useExisting:e}]),ss,Gt]}),e}(),gU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[$y],imports:[[lU,Uz,Wy],lU,Uz]}),e}();function mU(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:this.value,t=new CU;return t.source=this,t.value=e,t}},{key:"_calculatePercentage",value:function(e){return((e||0)-this.min)/(this.max-this.min)}},{key:"_calculateValue",value:function(e){return this.min+e*(this.max-this.min)}},{key:"_clamp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.max(t,Math.min(e,n))}},{key:"_getSliderDimensions",value:function(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}},{key:"_focusHostElement",value:function(e){this._elementRef.nativeElement.focus(e)}},{key:"_blurHostElement",value:function(){this._elementRef.nativeElement.blur()}},{key:"writeValue",value:function(e){this.value=e}},{key:"registerOnChange",value:function(e){this._controlValueAccessorChangeFn=e}},{key:"registerOnTouched",value:function(e){this.onTouched=e}},{key:"setDisabledState",value:function(e){this.disabled=e}}]),n}(OU);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Wv),Es(wc),Es(zd,8),Ti("tabindex"),Es(Vl),Es(fh),Es(Ny,8))},e.\u0275cmp=Ct({type:e,selectors:[["mat-slider"]],viewQuery:function(e,t){var n;(1&e&&hl(xU,5),2&e)&&(ll(n=dl())&&(t._sliderWrapper=n.first))},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(e,t){1&e&&Fs("focus",function(){return t._onFocus()})("blur",function(){return t._onBlur()})("keydown",function(e){return t._onKeydown(e)})("keyup",function(){return t._onKeyup()})("mouseenter",function(){return t._onMouseenter()})("selectstart",function(e){return e.preventDefault()}),2&e&&(Ou("tabIndex",t.tabIndex),_s("aria-disabled",t.disabled)("aria-valuemax",t.max)("aria-valuemin",t.min)("aria-valuenow",t.value)("aria-valuetext",null==t.valueText?t.displayValue:t.valueText)("aria-orientation",t.vertical?"vertical":"horizontal"),su("mat-slider-disabled",t.disabled)("mat-slider-has-ticks",t.tickInterval)("mat-slider-horizontal",!t.vertical)("mat-slider-axis-inverted",t._shouldInvertAxis())("mat-slider-invert-mouse-coords",t._shouldInvertMouseCoords())("mat-slider-sliding",t._isSliding)("mat-slider-thumb-label-showing",t.thumbLabel)("mat-slider-vertical",t.vertical)("mat-slider-min-value",t._isMinValue())("mat-slider-hide-last-tick",t.disabled||t._isMinValue()&&t._getThumbGap()&&t._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===t._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[Hu([EU]),ss],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(e,t){1&e&&(Ts(0,"div",0,1),Ts(2,"div",2),Ps(3,"div",3),Ps(4,"div",4),As(),Ts(5,"div",5),Ps(6,"div",6),As(),Ts(7,"div",7),Ps(8,"div",8),Ps(9,"div",9),Ts(10,"div",10),Ts(11,"span",11),ku(12),As(),As(),As(),As()),2&e&&(qo(3),Cs("ngStyle",t._getTrackBackgroundStyles()),qo(1),Cs("ngStyle",t._getTrackFillStyles()),qo(1),Cs("ngStyle",t._getTicksContainerStyles()),qo(1),Cs("ngStyle",t._getTicksStyles()),qo(1),Cs("ngStyle",t._getThumbContainerStyles()),qo(5),xu(t.displayValue))},directives:[Hh],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),e}();function AU(e){return"t"===e.type[0]}function PU(e,t){var n;return(n=AU(e)?"number"==typeof t?MU(e.touches,t)||MU(e.changedTouches,t):e.touches[0]||e.changedTouches[0]:e)?{x:n.clientX,y:n.clientY}:void 0}function MU(e,t){for(var n=0;n enter",tg("150ms cubic-bezier(0, 0, 0.2, 1)",ig({transform:"none",opacity:1}))),og("* => void, * => exit",tg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ig({opacity:0})))])},LU=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s){var u;return m(this,n),(u=t.call(this))._elementRef=e,u._focusTrapFactory=i,u._changeDetectorRef=r,u._config=a,u._focusMonitor=s,u._animationStateChanged=new Zc,u._elementFocusedBeforeDialogWasOpened=null,u._closeInteractionType=null,u.attachDomPortal=function(e){return u._portalOutlet.hasAttached(),u._portalOutlet.attachDomPortal(e)},u._ariaLabelledBy=a.ariaLabelledBy||null,u._document=o,u}return b(n,[{key:"_initializeWithAttachedContent",value:function(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}},{key:"attachComponentPortal",value:function(e){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(e)}},{key:"attachTemplatePortal",value:function(e){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(e)}},{key:"_recaptureFocus",value:function(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}},{key:"_trapFocus",value:function(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}},{key:"_restoreFocus",value:function(){var e=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&e&&"function"==typeof e.focus){var t=Fd(),n=this._elementRef.nativeElement;(!t||t===this._document.body||t===n||n.contains(t))&&(this._focusMonitor?(this._focusMonitor.focusVia(e,this._closeInteractionType),this._closeInteractionType=null):e.focus())}this._focusTrap&&this._focusTrap.destroy()}},{key:"_setupFocusTrap",value:function(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}},{key:"_capturePreviouslyFocusedElement",value:function(){this._document&&(this._elementFocusedBeforeDialogWasOpened=Fd())}},{key:"_focusDialogContainer",value:function(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}},{key:"_containsFocus",value:function(){var e=this._elementRef.nativeElement,t=Fd();return e===t||e.contains(t)}}]),n}(Jd);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Rv),Es(wc),Es(fh,8),Es(DU),Es(Wv))},e.\u0275dir=It({type:e,viewQuery:function(e,t){var n;(1&e&&hl(ip,7),2&e)&&(ll(n=dl())&&(t._portalOutlet=n.first))},features:[ss]}),e}(),jU=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments))._state="enter",e}return b(n,[{key:"_onAnimationDone",value:function(e){var t=e.toState,n=e.totalTime;"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:n})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:n}))}},{key:"_onAnimationStart",value:function(e){var t=e.toState,n=e.totalTime;"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:n}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:n})}},{key:"_startExitAnimation",value:function(){this._state="exit",this._changeDetectorRef.markForCheck()}}]),n}(LU);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275cmp=Ct({type:t,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(e,t){1&e&&Bs("@dialogContainer.start",function(e){return t._onAnimationStart(e)})("@dialogContainer.done",function(e){return t._onAnimationDone(e)}),2&e&&(Ou("id",t._id),_s("role",t._config.role)("aria-labelledby",t._config.ariaLabel?null:t._ariaLabelledBy)("aria-label",t._config.ariaLabel)("aria-describedby",t._config.ariaDescribedBy||null),Tu("@dialogContainer",t._state))},features:[ss],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(e,t){1&e&&xs(0,RU,0,0,"ng-template",0)},directives:[ip],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[NU.dialogContainer]}}),t}(),FU=0,BU=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mat-dialog-"+FU++;m(this,e),this._overlayRef=t,this._containerInstance=n,this.id=r,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new oe,this._afterClosed=new oe,this._beforeClosed=new oe,this._state=0,n._id=r,n._animationStateChanged.pipe(od(function(e){return"opened"===e.state}),ap(1)).subscribe(function(){i._afterOpened.next(),i._afterOpened.complete()}),n._animationStateChanged.pipe(od(function(e){return"closed"===e.state}),ap(1)).subscribe(function(){clearTimeout(i._closeFallbackTimeout),i._finishDialogClose()}),t.detachments().subscribe(function(){i._beforeClosed.next(i._result),i._beforeClosed.complete(),i._afterClosed.next(i._result),i._afterClosed.complete(),i.componentInstance=null,i._overlayRef.dispose()}),t.keydownEvents().pipe(od(function(e){return 27===e.keyCode&&!i.disableClose&&!fp(e)})).subscribe(function(e){e.preventDefault(),VU(i,"keyboard")}),t.backdropClick().subscribe(function(){i.disableClose?i._containerInstance._recaptureFocus():VU(i,"mouse")})}return b(e,[{key:"close",value:function(e){var t=this;this._result=e,this._containerInstance._animationStateChanged.pipe(od(function(e){return"closing"===e.state}),ap(1)).subscribe(function(n){t._beforeClosed.next(e),t._beforeClosed.complete(),t._overlayRef.detachBackdrop(),t._closeFallbackTimeout=setTimeout(function(){return t._finishDialogClose()},n.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}},{key:"afterOpened",value:function(){return this._afterOpened}},{key:"afterClosed",value:function(){return this._afterClosed}},{key:"beforeClosed",value:function(){return this._beforeClosed}},{key:"backdropClick",value:function(){return this._overlayRef.backdropClick()}},{key:"keydownEvents",value:function(){return this._overlayRef.keydownEvents()}},{key:"updatePosition",value:function(e){var t=this._getPositionStrategy();return e&&(e.left||e.right)?e.left?t.left(e.left):t.right(e.right):t.centerHorizontally(),e&&(e.top||e.bottom)?e.top?t.top(e.top):t.bottom(e.bottom):t.centerVertically(),this._overlayRef.updatePosition(),this}},{key:"updateSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}},{key:"addPanelClass",value:function(e){return this._overlayRef.addPanelClass(e),this}},{key:"removePanelClass",value:function(e){return this._overlayRef.removePanelClass(e),this}},{key:"getState",value:function(){return this._state}},{key:"_finishDialogClose",value:function(){this._state=2,this._overlayRef.dispose()}},{key:"_getPositionStrategy",value:function(){return this._overlayRef.getConfig().positionStrategy}}]),e}();function VU(e,t,n){return void 0!==e._containerInstance&&(e._containerInstance._closeInteractionType=t),e.close(n)}var zU=new Mi("MatDialogData"),UU=new Mi("mat-dialog-default-options"),HU=new Mi("mat-dialog-scroll-strategy"),GU={provide:HU,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.block()}}},WU=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c){var l=this;m(this,e),this._overlay=t,this._injector=n,this._defaultOptions=i,this._parentDialog=r,this._overlayContainer=o,this._dialogRefConstructor=s,this._dialogContainerType=u,this._dialogDataToken=c,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new oe,this._afterOpenedAtThisLevel=new oe,this._ariaHiddenElements=new Map,this.afterAllClosed=lz(function(){return l.openDialogs.length?l._getAfterAllClosed():l._getAfterAllClosed().pipe(fd(void 0))}),this._scrollStrategy=a}return b(e,[{key:"openDialogs",get:function(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}},{key:"afterOpened",get:function(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}},{key:"_getAfterAllClosed",value:function(){var e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}},{key:"open",value:function(e,t){var n=this;(t=function(e,t){return Object.assign(Object.assign({},t),e)}(t,this._defaultOptions||new DU)).id&&this.getDialogById(t.id);var i=this._createOverlay(t),r=this._attachDialogContainer(i,t),o=this._attachDialogContent(e,r,i,t);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(function(){return n._removeOpenDialog(o)}),this.afterOpened.next(o),r._initializeWithAttachedContent(),o}},{key:"closeAll",value:function(){this._closeDialogs(this.openDialogs)}},{key:"getDialogById",value:function(e){return this.openDialogs.find(function(t){return t.id===e})}},{key:"ngOnDestroy",value:function(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}},{key:"_createOverlay",value:function(e){var t=this._getOverlayConfig(e);return this._overlay.create(t)}},{key:"_getOverlayConfig",value:function(e){var t=new wp({positionStrategy:this._overlay.position().global(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,disposeOnNavigation:e.closeOnNavigation});return e.backdropClass&&(t.backdropClass=e.backdropClass),t}},{key:"_attachDialogContainer",value:function(e,t){var n=os.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:DU,useValue:t}]}),i=new Qd(this._dialogContainerType,t.viewContainerRef,n,t.componentFactoryResolver);return e.attach(i).instance}},{key:"_attachDialogContent",value:function(e,t,n,i){var r=new this._dialogRefConstructor(n,t,i.id);if(e instanceof Cc)t.attachTemplatePortal(new $d(e,null,{$implicit:i.data,dialogRef:r}));else{var o=this._createInjector(i,r,t),a=t.attachComponentPortal(new Qd(e,i.viewContainerRef,o));r.componentInstance=a.instance}return r.updateSize(i.width,i.height).updatePosition(i.position),r}},{key:"_createInjector",value:function(e,t,n){var i=e&&e.viewContainerRef&&e.viewContainerRef.injector,r=[{provide:this._dialogContainerType,useValue:n},{provide:this._dialogDataToken,useValue:e.data},{provide:this._dialogRefConstructor,useValue:t}];return e.direction&&(!i||!i.get(zd,null,ot.Optional))&&r.push({provide:zd,useValue:{value:e.direction,change:jf()}}),os.create({parent:i||this._injector,providers:r})}},{key:"_removeOpenDialog",value:function(e){var t=this.openDialogs.indexOf(e);t>-1&&(this.openDialogs.splice(t,1),this.openDialogs.length||(this._ariaHiddenElements.forEach(function(e,t){e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}},{key:"_hideNonDialogContentFromAssistiveTechnology",value:function(){var e=this._overlayContainer.getContainerElement();if(e.parentElement)for(var t=e.parentElement.children,n=t.length-1;n>-1;n--){var i=t[n];i!==e&&"SCRIPT"!==i.nodeName&&"STYLE"!==i.nodeName&&!i.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(i,i.getAttribute("aria-hidden")),i.setAttribute("aria-hidden","true"))}}},{key:"_closeDialogs",value:function(e){for(var t=e.length;t--;)e[t].close()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(os),Es(void 0),Es(void 0),Es(Ap),Es(void 0),Es(Ii),Es(Ii),Es(Mi))},e.\u0275dir=It({type:e}),e}(),qU=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u){return m(this,n),t.call(this,e,i,o,s,u,a,BU,jU,zU)}return n}(WU);return e.\u0275fac=function(t){return new(t||e)(Qi(Hp),Qi(os),Qi(Eh,8),Qi(UU,8),Qi(HU),Qi(e,12),Qi(Ap))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),XU=0,YU=function(){var e=function(){function e(t,n,i){m(this,e),this._dialogRef=t,this._elementRef=n,this._dialog=i,this.id="mat-dialog-title-"+XU++}return b(e,[{key:"ngOnInit",value:function(){var e=this;this._dialogRef||(this._dialogRef=function(e,t){for(var n=e.nativeElement.parentElement;n&&!n.classList.contains("mat-dialog-container");)n=n.parentElement;return n?t.find(function(e){return e.id===n.id}):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(function(){var t=e._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=e.id)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(BU,8),Es(Ku),Es(qU))},e.\u0275dir=It({type:e,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(e,t){2&e&&Ou("id",t.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),e}(),KU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),e}(),QU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[qU,GU],imports:[[Kp,rp,Wy],Wy]}),e}(),$U=new Mi("CdkAccordion"),ZU=0,JU=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this.accordion=t,this._changeDetectorRef=n,this._expansionDispatcher=i,this._openCloseAllSubscription=W.EMPTY,this.closed=new Zc,this.opened=new Zc,this.destroyed=new Zc,this.expandedChange=new Zc,this.id="cdk-accordion-child-"+ZU++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=function(){},this._removeUniqueSelectionListener=i.listen(function(e,t){r.accordion&&!r.accordion.multi&&r.accordion.id===t&&r.id!==e&&(r.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}return b(e,[{key:"expanded",get:function(){return this._expanded},set:function(e){e=If(e),this._expanded!==e&&(this._expanded=e,this.expandedChange.emit(e),e?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=If(e)}},{key:"ngOnDestroy",value:function(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}},{key:"toggle",value:function(){this.disabled||(this.expanded=!this.expanded)}},{key:"close",value:function(){this.disabled||(this.expanded=!1)}},{key:"open",value:function(){this.disabled||(this.expanded=!0)}},{key:"_subscribeToOpenCloseAllActions",value:function(){var e=this;return this.accordion._openCloseAllActions.subscribe(function(t){e.disabled||(e.expanded=t)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es($U,12),Es(wc),Es(Gd))},e.\u0275dir=It({type:e,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Hu([{provide:$U,useValue:void 0}])]}),e}(),eH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),tH=["body"];function nH(e,t){}var iH=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],rH=["mat-expansion-panel-header","*","mat-action-row"];function oH(e,t){1&e&&Ps(0,"span",2),2&e&&Cs("@indicatorRotate",Hs()._getExpandedState())}var aH=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],sH=["mat-panel-title","mat-panel-description","*"],uH=new Mi("MAT_ACCORDION"),cH="225ms cubic-bezier(0.4,0.0,0.2,1)",lH={indicatorRotate:eg("indicatorRotate",[rg("collapsed, void",ig({transform:"rotate(0deg)"})),rg("expanded",ig({transform:"rotate(180deg)"})),og("expanded <=> collapsed, void => collapsed",tg(cH))]),bodyExpansion:eg("bodyExpansion",[rg("collapsed, void",ig({height:"0px",visibility:"hidden"})),rg("expanded",ig({height:"*",visibility:"visible"})),og("expanded <=> collapsed, void => collapsed",tg(cH))])},hH=function(){var e=function e(t){m(this,e),this._template=t};return e.\u0275fac=function(t){return new(t||e)(Es(Cc))},e.\u0275dir=It({type:e,selectors:[["ng-template","matExpansionPanelContent",""]]}),e}(),fH=0,dH=new Mi("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),pH=function(){var t=function(t){a(i,t);var n=s(i);function i(e,t,r,o,a,s,u){var c;return m(this,i),(c=n.call(this,e,t,r))._viewContainerRef=o,c._animationMode=s,c._hideToggle=!1,c.afterExpand=new Zc,c.afterCollapse=new Zc,c._inputChanges=new oe,c._headerId="mat-expansion-panel-header-"+fH++,c._bodyAnimationDone=new oe,c.accordion=e,c._document=a,c._bodyAnimationDone.pipe(Qf(function(e,t){return e.fromState===t.fromState&&e.toState===t.toState})).subscribe(function(e){"void"!==e.fromState&&("expanded"===e.toState?c.afterExpand.emit():"collapsed"===e.toState&&c.afterCollapse.emit())}),u&&(c.hideToggle=u.hideToggle),c}return b(i,[{key:"hideToggle",get:function(){return this._hideToggle||this.accordion&&this.accordion.hideToggle},set:function(e){this._hideToggle=If(e)}},{key:"togglePosition",get:function(){return this._togglePosition||this.accordion&&this.accordion.togglePosition},set:function(e){this._togglePosition=e}},{key:"_hasSpacing",value:function(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}},{key:"_getExpandedState",value:function(){return this.expanded?"expanded":"collapsed"}},{key:"toggle",value:function(){this.expanded=!this.expanded}},{key:"close",value:function(){this.expanded=!1}},{key:"open",value:function(){this.expanded=!0}},{key:"ngAfterContentInit",value:function(){var e=this;this._lazyContent&&this.opened.pipe(fd(null),od(function(){return e.expanded&&!e._portal}),ap(1)).subscribe(function(){e._portal=new $d(e._lazyContent._template,e._viewContainerRef)})}},{key:"ngOnChanges",value:function(e){this._inputChanges.next(e)}},{key:"ngOnDestroy",value:function(){e(p(i.prototype),"ngOnDestroy",this).call(this),this._bodyAnimationDone.complete(),this._inputChanges.complete()}},{key:"_containsFocus",value:function(){if(this._body){var e=this._document.activeElement,t=this._body.nativeElement;return e===t||t.contains(e)}return!1}}]),i}(JU);return t.\u0275fac=function(e){return new(e||t)(Es(uH,12),Es(wc),Es(Gd),Es(Mc),Es(fh),Es(Ny,8),Es(dH,8))},t.\u0275cmp=Ct({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,hH,5),2&e)&&(ll(i=dl())&&(t._lazyContent=i.first))},viewQuery:function(e,t){var n;(1&e&&hl(tH,5),2&e)&&(ll(n=dl())&&(t._body=n.first))},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(e,t){2&e&&su("mat-expanded",t.expanded)("_mat-animation-noopable","NoopAnimations"===t._animationMode)("mat-expansion-panel-spacing",t._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Hu([{provide:uH,useValue:void 0}]),ss,Gt],ngContentSelectors:rH,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(e,t){1&e&&(Ws(iH),qs(0),Ts(1,"div",0,1),Fs("@bodyExpansion.done",function(e){return t._bodyAnimationDone.next(e)}),Ts(3,"div",2),qs(4,1),xs(5,nH,0,0,"ng-template",3),As(),qs(6,2),As()),2&e&&(qo(1),Cs("@bodyExpansion",t._getExpandedState())("id",t.id),_s("aria-labelledby",t._headerId),qo(4),Cs("cdkPortalOutlet",t._portal))},directives:[ip],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[lH.bodyExpansion]},changeDetection:0}),t}(),vH=Ky(function e(){m(this,e)}),gH=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u){var c;m(this,n),(c=t.call(this)).panel=e,c._element=i,c._focusMonitor=r,c._changeDetectorRef=o,c._animationMode=s,c._parentChangeSubscription=W.EMPTY;var l=e.accordion?e.accordion._stateChanges.pipe(od(function(e){return!(!e.hideToggle&&!e.togglePosition)})):md;return c.tabIndex=parseInt(u||"")||0,c._parentChangeSubscription=Ce(e.opened,e.closed,l,e._inputChanges.pipe(od(function(e){return!!(e.hideToggle||e.disabled||e.togglePosition)}))).subscribe(function(){return c._changeDetectorRef.markForCheck()}),e.closed.pipe(od(function(){return e._containsFocus()})).subscribe(function(){return r.focusVia(i,"program")}),a&&(c.expandedHeight=a.expandedHeight,c.collapsedHeight=a.collapsedHeight),c}return b(n,[{key:"disabled",get:function(){return this.panel.disabled}},{key:"_toggle",value:function(){this.disabled||this.panel.toggle()}},{key:"_isExpanded",value:function(){return this.panel.expanded}},{key:"_getExpandedState",value:function(){return this.panel._getExpandedState()}},{key:"_getPanelId",value:function(){return this.panel.id}},{key:"_getTogglePosition",value:function(){return this.panel.togglePosition}},{key:"_showToggle",value:function(){return!this.panel.hideToggle&&!this.panel.disabled}},{key:"_getHeaderHeight",value:function(){var e=this._isExpanded();return e&&this.expandedHeight?this.expandedHeight:!e&&this.collapsedHeight?this.collapsedHeight:null}},{key:"_keydown",value:function(e){switch(e.keyCode){case 32:case 13:fp(e)||(e.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(e))}}},{key:"focus",value:function(e,t){e?this._focusMonitor.focusVia(this._element,e,t):this._element.nativeElement.focus(t)}},{key:"ngAfterViewInit",value:function(){var e=this;this._focusMonitor.monitor(this._element).subscribe(function(t){t&&e.panel.accordion&&e.panel.accordion._handleHeaderFocus(e)})}},{key:"ngOnDestroy",value:function(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}]),n}(vH);return e.\u0275fac=function(t){return new(t||e)(Es(pH,1),Es(Ku),Es(Wv),Es(wc),Es(dH,8),Es(Ny,8),Ti("tabindex"))},e.\u0275cmp=Ct({type:e,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(e,t){1&e&&Fs("click",function(){return t._toggle()})("keydown",function(e){return t._keydown(e)}),2&e&&(_s("id",t.panel._headerId)("tabindex",t.tabIndex)("aria-controls",t._getPanelId())("aria-expanded",t._isExpanded())("aria-disabled",t.panel.disabled),au("height",t._getHeaderHeight()),su("mat-expanded",t._isExpanded())("mat-expansion-toggle-indicator-after","after"===t._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===t._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===t._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ss],ngContentSelectors:sH,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(e,t){1&e&&(Ws(aH),Ts(0,"span",0),qs(1),qs(2,1),qs(3,2),As(),xs(4,oH,1,1,"span",1)),2&e&&(qo(4),Cs("ngIf",t._showToggle()))},directives:[Lh],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[lH.indicatorRotate]},changeDetection:0}),e}(),mH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,Wy,eH,rp]]}),e}(),yH=r(5478);Object.create(Error.prototype);var bH=["*"],_H=(function(e){e.LineHighlight="line-highlight",e.LineNumbers="line-numbers"}(_H||(_H={})),_H),wH=function e(){m(this,e)},kH=new Mi("SECURITY_CONTEXT"),xH=function(){var e=function(){function e(t,n,i,r,o){m(this,e),this.platform=t,this.securityContext=n,this.http=i,this.sanitizer=o,this.initialMarkedOptions={renderer:new yH.Renderer},this.options=r}return b(e,[{key:"options",get:function(){return this._options},set:function(e){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),e)}},{key:"renderer",get:function(){return this.options.renderer},set:function(e){this.options.renderer=e}},{key:"compile",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.options,r=this.trimIndentation(e),o=t?this.decodeHtml(r):r,a=n?this.renderEmoji(o):o,s=yH.parse(a,i);return this.sanitizer.sanitize(this.securityContext,s)||""}},{key:"getSource",value:function(e){var t=this;if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(e,{responseType:"text"}).pipe(ue(function(n){return t.handleExtension(e,n)}))}},{key:"highlight",value:function(e){if($h(this.platform)&&"undefined"!=typeof Prism){e||(e=document);var t=e.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(t,function(e){return e.classList.add("language-none")}),Prism.highlightAllUnder(e)}}},{key:"renderKatex",value:function(e,t){if(!$h(this.platform))return e;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return e.replace(/\$([^\s][^$]*?[^\s])\$/gm,function(e,n){return katex.renderToString(n,t)})}},{key:"decodeHtml",value:function(e){if(!$h(this.platform))return e;var t=document.createElement("textarea");return t.innerHTML=e,t.value}},{key:"handleExtension",value:function(e,t){var n=e?e.split("?")[0].split(".").splice(-1).join():"";return"md"!==n?"```"+n+"\n"+t+"\n```":t}},{key:"renderEmoji",value:function(e){if(!$h(this.platform))return e;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(e)}},{key:"trimIndentation",value:function(e){return e?e.split("\n").map(function(e){var n=t;return e.length>0&&(n=isNaN(n)?e.search(/\S|$/):Math.min(e.search(/\S|$/),n)),isNaN(t)&&(t=n),n?e.substring(n):e}).join("\n"):"";var t}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Sl),Qi(kH),Qi(Kb,8),Qi(wH,8),Qi(Of))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),SH=function(){var e=function(){function e(t,n){m(this,e),this.element=t,this.markdownService=n,this.error=new Zc,this.load=new Zc,this.ready=new Zc,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}return b(e,[{key:"emoji",get:function(){return this._emoji},set:function(e){this._emoji=this.coerceBooleanProperty(e)}},{key:"katex",get:function(){return this._katex},set:function(e){this._katex=this.coerceBooleanProperty(e)}},{key:"lineHighlight",get:function(){return this._lineHighlight},set:function(e){this._lineHighlight=this.coerceBooleanProperty(e)}},{key:"lineNumbers",get:function(){return this._lineNumbers},set:function(e){this._lineNumbers=this.coerceBooleanProperty(e)}},{key:"ngOnChanges",value:function(){null==this.data?null==this.src||this.handleSrc():this.handleData()}},{key:"ngAfterViewInit",value:function(){!this.data&&!this.src&&this.handleTransclusion()}},{key:"render",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.markdownService.compile(e,t,this.emoji);n=this.katex?this.markdownService.renderKatex(n,this.katexOptions):n,this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}},{key:"coerceBooleanProperty",value:function(e){return null!=e&&"false"!="".concat(String(e))}},{key:"handleData",value:function(){this.render(this.data)}},{key:"handleSrc",value:function(){var e=this;this.markdownService.getSource(this.src).subscribe(function(t){e.render(t),e.load.emit(t)},function(t){return e.error.emit(t)})}},{key:"handleTransclusion",value:function(){this.render(this.element.nativeElement.innerHTML,!0)}},{key:"handlePlugins",value:function(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,_H.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}},{key:"setPluginClass",value:function(e,t){for(var n=e.querySelectorAll("pre"),i=0;i0){var r=i.indexOf(n);-1!==r&&i.splice(r,1)}}},{key:"notifyComplete",value:function(){}},{key:"_next",value:function(e){if(0===this.toRespond.length){var t=[e].concat(v(this.values));this.project?this._tryProject(t):this.destination.next(t)}}},{key:"_tryProject",value:function(e){var t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}]),n}(R_),PH=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];m(this,e),this.accumulator=t,this.seed=n,this.hasSeed=i}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new MH(e,this.accumulator,this.seed,this.hasSeed))}}]),e}(),MH=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;return m(this,n),(a=t.call(this,e)).accumulator=i,a._seed=r,a.hasSeed=o,a.index=0,a}return b(n,[{key:"seed",get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e}},{key:"_next",value:function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}},{key:"_tryNext",value:function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(i){this.destination.error(i)}this.seed=t,this.destination.next(t)}}]),n}(Y),IH=function(){function e(t){m(this,e),this.predicate=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new RH(e,this.predicate))}}]),e}(),RH=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).predicate=i,r.skipping=!0,r.index=0,r}return b(n,[{key:"_next",value:function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}},{key:"tryCallPredicate",value:function(e){try{var t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}]),n}(Y),DH=["youtubeContainer"],NH=function(){var e=function(){function e(t,n){m(this,e),this._ngZone=t,this._youtubeContainer=new oe,this._destroyed=new oe,this._playerChanges=new nv(void 0),this._videoId=new nv(void 0),this._height=new nv(390),this._width=new nv(640),this._startSeconds=new nv(void 0),this._endSeconds=new nv(void 0),this._suggestedQuality=new nv(void 0),this._playerVars=new nv(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=$h(n)}return b(e,[{key:"videoId",get:function(){return this._videoId.value},set:function(e){this._videoId.next(e)}},{key:"height",get:function(){return this._height.value},set:function(e){this._height.next(e||390)}},{key:"width",get:function(){return this._width.value},set:function(e){this._width.next(e||640)}},{key:"startSeconds",set:function(e){this._startSeconds.next(e)}},{key:"endSeconds",set:function(e){this._endSeconds.next(e)}},{key:"suggestedQuality",set:function(e){this._suggestedQuality.next(e)}},{key:"playerVars",get:function(){return this._playerVars.value},set:function(e){this._playerVars.next(e)}},{key:"ngOnInit",value:function(){var e=this;if(this._isBrowser){var n=jf(!0);if(!window.YT||!window.YT.Player){var i=new oe;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=function(){e._existingApiReadyCallback&&e._existingApiReadyCallback(),e._ngZone.run(function(){return i.next(!0)})},n=i.pipe(ap(1),fd(!1))}var r=function(e,n,i,r,o,a,s){var u=j_([n,a]).pipe(OH(j_([r,o])),ue(function(e){var n=t(e,2),i=n[0],r=n[1],o=t(i,2),a=o[0],s=o[1],u=t(r,2),c=u[0],l=u[1];return a?{videoId:a,playerVars:s,width:c,height:l}:void 0}));return j_([e,u,jf(s)]).pipe(function(e){return Z(function(){for(var e=arguments.length,t=new Array(e),n=0;n=2&&(n=!0),function(i){return i.lift(new PH(e,t,n))}}(LH,void 0),Qf())}(this._youtubeContainer,this._videoId,n,this._width,this._height,this._playerVars,this._ngZone).pipe(rv(function(t){e._playerChanges.next(t)}),we(function(e){return e?jH(e)?jf(e):new ee(function(t){var n=!1,i=!1;return e.addEventListener("onReady",function e(r){i=!0,n||(r.target.removeEventListener("onReady",e),t.next(r.target))}),function(){n=!0,i||function(e){jH(e)||e.destroy()}(e)}}).pipe(ap(1),fd(void 0)):jf(void 0)}),ud(this._destroyed),Re(new oe));r.subscribe(function(t){e._player=t,t&&e._pendingPlayerState&&e._initializePlayer(t,e._pendingPlayerState),e._pendingPlayerState=void 0}),function(e,n,i){j_([e,n,i]).subscribe(function(e){var n=t(e,3),i=n[0],r=n[1],o=n[2];return i&&i.setSize(r,o)})}(r,this._width,this._height),function(e,n){j_([e,n]).subscribe(function(e){var n=t(e,2),i=n[0],r=n[1];return i&&r&&i.setPlaybackQuality(r)})}(r,this._suggestedQuality),function(e,n,i,r,o,a){var s=j_([i,r]).pipe(ue(function(e){var n=t(e,2);return{startSeconds:n[0],endSeconds:n[1]}})),u=s.pipe(FH(e,function(e){return!!e&&!function(e){var t=e.getPlayerState();return t!==YT.PlayerState.UNSTARTED&&t!==YT.PlayerState.CUED}(e)})),c=n.pipe(FH(e,function(e,t){return!!e&&e.videoId!==t}));Ce(e.pipe(FH(j_([n,s]),function(e,n){var i=t(e,2),r=i[0],o=i[1];return!(!n||r==n.videoId&&!o.startSeconds&&!o.endSeconds)})),c,u).pipe(OH(j_([e,n,s,o])),ue(function(e){var n=t(e,2);n[0];return n[1]}),ud(a)).subscribe(function(e){var n=t(e,4),i=n[0],r=n[1],o=n[2],a=n[3];!r||!i||(i.videoId=r,i.cueVideoById(Object.assign({videoId:r,suggestedQuality:a},o)))})}(r,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),r.connect()}}},{key:"createEventsBoundInZone",value:function(){return{}}},{key:"ngAfterViewInit",value:function(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}},{key:"ngOnDestroy",value:function(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}},{key:"playVideo",value:function(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}},{key:"pauseVideo",value:function(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}},{key:"stopVideo",value:function(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}},{key:"seekTo",value:function(e,t){this._player?this._player.seekTo(e,t):this._getPendingState().seek={seconds:e,allowSeekAhead:t}}},{key:"mute",value:function(){this._player?this._player.mute():this._getPendingState().muted=!0}},{key:"unMute",value:function(){this._player?this._player.unMute():this._getPendingState().muted=!1}},{key:"isMuted",value:function(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}},{key:"setVolume",value:function(e){this._player?this._player.setVolume(e):this._getPendingState().volume=e}},{key:"getVolume",value:function(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}},{key:"setPlaybackRate",value:function(e){if(this._player)return this._player.setPlaybackRate(e);this._getPendingState().playbackRate=e}},{key:"getPlaybackRate",value:function(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}},{key:"getAvailablePlaybackRates",value:function(){return this._player?this._player.getAvailablePlaybackRates():[]}},{key:"getVideoLoadedFraction",value:function(){return this._player?this._player.getVideoLoadedFraction():0}},{key:"getPlayerState",value:function(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}},{key:"getCurrentTime",value:function(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}},{key:"getPlaybackQuality",value:function(){return this._player?this._player.getPlaybackQuality():"default"}},{key:"getAvailableQualityLevels",value:function(){return this._player?this._player.getAvailableQualityLevels():[]}},{key:"getDuration",value:function(){return this._player?this._player.getDuration():0}},{key:"getVideoUrl",value:function(){return this._player?this._player.getVideoUrl():""}},{key:"getVideoEmbedCode",value:function(){return this._player?this._player.getVideoEmbedCode():""}},{key:"_getPendingState",value:function(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}},{key:"_initializePlayer",value:function(e,t){var n=t.playbackState,i=t.playbackRate,r=t.volume,o=t.muted,a=t.seek;switch(n){case YT.PlayerState.PLAYING:e.playVideo();break;case YT.PlayerState.PAUSED:e.pauseVideo();break;case YT.PlayerState.CUED:e.stopVideo()}null!=i&&e.setPlaybackRate(i),null!=r&&e.setVolume(r),null!=o&&(o?e.mute():e.unMute()),null!=a&&e.seekTo(a.seconds,a.allowSeekAhead)}},{key:"_getLazyEmitter",value:function(e){var t=this;return this._playerChanges.pipe(dd(function(t){return t?CH(function(n){t.addEventListener(e,n)},function(n){try{t.removeEventListener&&t.removeEventListener(e,n)}catch(i){}}):jf()}),function(e){return new ee(function(n){return e.subscribe({next:function(e){return t._ngZone.run(function(){return n.next(e)})},error:function(e){return n.error(e)},complete:function(){return n.complete()}})})},ud(this._destroyed))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Vl),Es(Sl))},e.\u0275cmp=Ct({type:e,selectors:[["youtube-player"]],viewQuery:function(e,t){var n;(1&e&&hl(DH,5),2&e)&&(ll(n=dl())&&(t.youtubeContainer=n.first))},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(e,t){1&e&&Ps(0,"div",null,0)},encapsulation:2,changeDetection:0}),e}();function LH(e,n){var i=t(n,3),r=i[0],o=i[1],a=i[2];if(e&&o&&e.playerVars!==o.playerVars)e.destroy();else{if(!o)return void(e&&e.destroy());if(e)return e}var s=a.runOutsideAngular(function(){return new YT.Player(r,o)});return s.videoId=o.videoId,s.playerVars=o.playerVars,s}function jH(e){return"getPlayerStatus"in e}function FH(e,n){return Z(OH(e),od(function(e){var i=t(e,2),r=i[0],o=i[1];return n(o,r)}),ue(function(e){return t(e,1)[0]}))}var BH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}();function VH(e){return!0===e}function zH(e){return null==e}function UH(e){return!zH(e)}function HH(e){return Boolean(e)}function GH(e){return zH(e)?e:JSON.parse(JSON.stringify(e))}var WH=function e(t){var n=t instanceof Date;if("object"!=typeof t||null===t||n)return t;Object.freeze(t);var i="function"==typeof t,r=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(function(n){r.call(t,n)&&(!i||"caller"!==n&&"callee"!==n&&"arguments"!==n)&&null!==t[n]&&("object"==typeof t[n]||"function"==typeof t[n])&&!Object.isFrozen(t[n])&&e(t[n])}),t};function qH(e){return UH(e)&&"object"==typeof e&&function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)}var XH="NGXS_DATA_META",YH="NGXS_META",KH="NGXS_ARGUMENT_REGISTRY_META",QH=function(){var e=function(){function e(t){var n=this;m(this,e),this.sequence$=new nv(0),this.subscription=null,t&&(this.subscription=t.subscribe(function(){return n.updateSequence()}))}return b(e,[{key:"sequenceValue",get:function(){return this.sequence$.getValue()}},{key:"ngOnDestroy",value:function(){var e;this.sequence$.next(0),null===(e=this.subscription)||void 0===e||e.unsubscribe()}},{key:"updateSequence",value:function(){this.sequence$.next(this.sequenceValue+1)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(qB,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}();function $H(e){return e[XH]}var ZH=function(){var e=function e(t,n,i){m(this,e),e.store=t.get(qB),e.ngZone=t.get(Vl),e.factory=n,e.context=i,e.computed=t.get(QH)};return e.store=null,e.computed=null,e.context=null,e.factory=null,e.ngZone=null,e.\u0275prov=Ke({token:e,factory:e.\u0275fac=function(t){return new(t||e)(Qi(os),Qi(WF),Qi(GF))}}),e}(),JH=function(){function e(){m(this,e),e.statesCachedMeta.clear()}return b(e,null,[{key:"createStateContext",value:function(e){return ZH.context.createStateContext(e)}},{key:"ensureMappedState",value:function(t){if(zH(ZH.factory)||zH(t))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(UH(t.name)?e.statesCachedMeta.get(t.name):null)||e.ensureMeta(t)}},{key:"getRepositoryByInstance",value:function(t){var n,i=null!==(n=$H(e.getStateClassByInstance(t)))&&void 0!==n?n:null;if(zH(i))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return i}},{key:"getStateClassByInstance",value:function(e){return(null!=e?e:{}).constructor}},{key:"clearMetaByInstance",value:function(t){var n=e.getRepositoryByInstance(t);n.stateMeta.actions={},n.operations={}}},{key:"createPayload",value:function(e,t){for(var n={},i=Array.from(e),r=0;r0?n:null}},{key:"createAction",value:function(t,n,i){var r=e.createPayload(n,i);return new(function(e){return function(){function t(e){var n=this;m(this,t),e&&Object.keys(e).forEach(function(t){n[t]=e[t]})}return b(t,null,[{key:"type",get:function(){return e}}]),t}()}(t.type))(r)}},{key:"ensureMeta",value:function(t){var n,i=UH(t.name)?null===(n=ZH.factory.states)||void 0===n?void 0:n.find(function(e){return e.name===t.name}):null;return UH(i)&&UH(t.name)&&e.statesCachedMeta.set(t.name,i),i}}]),e}();JH.statesCachedMeta=new Map,JH.\u0275fac=function(e){return new(e||JH)},JH.\u0275prov=Ke({token:JH,factory:JH.\u0275fac}),new Ed(1);var eG=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,"Child states can only be added to an object. Cannot convert ".concat(UH(null==e?void 0:e.constructor)?e.constructor.name:e," to PlainObject"))}return n}(l(Error));function tG(e){var t;return null!==(t=e.NGXS_OPTIONS_META)&&void 0!==t?t:{name:""}}function nG(e){var t,n=tG(e),i=null!==(t=n.children)&&void 0!==t?t:[],r=GH(void 0===n.defaults?{}:n.defaults);if(i.length){if(qH(r))return function(e,t){return t.reduce(function(e,t){var n=tG(t);if(function(e){var t="string"==typeof e?e.trim():e;return[void 0,null,NaN,"",1/0].includes(t)}(n.name))throw new Error("State name not provided in class");return e[n.name.toString()]=nG(t),e},null!=e?e:{})}(r,i);throw new eG(r)}return r}function iG(e){var t;return null!==(t=e.__NGXS_COMPUTED_OPTION__)&&void 0!==t?t:null}function rG(){var e,t;return null!==(t=null===(e=null==ZH?void 0:ZH.computed)||void 0===e?void 0:e.sequenceValue)&&void 0!==t?t:0}function oG(e){var t=!1;return Kf(e)&&(t=!0),t}function aG(e){return e[KH]}var sG=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this,"An argument with the name '".concat(e,"' already exists in the method '").concat(i,"'"))}return n}(l(Error)),uG=function(){function e(){m(this,e),this.payloadMap=new Map,this.argumentMap=new Map}return b(e,[{key:"getPayloadTypeByIndex",value:function(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}},{key:"getArgumentNameByIndex",value:function(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}},{key:"createPayloadType",value:function(e,t,n){this.checkDuplicateName(e,t),this.payloadMap.set(n,e),this.payloadMap.set(e,e)}},{key:"createArgumentName",value:function(e,t,n){this.checkDuplicateName(e,t),this.argumentMap.set(n,e),this.argumentMap.set(e,e)}},{key:"checkDuplicateName",value:function(e,t){if(HH(this.argumentMap.has(e))||HH(this.payloadMap.has(e)))throw new sG(e,t)}}]),e}();function cG(e){return Jl()?WH(e):e}function lG(e){return{enumerable:!0,configurable:!0,get:function(){var t=$H(e),n=JH.ensureMappedState(t.stateMeta);return JH.createStateContext(n)}}}function hG(e){if(!e)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},e),{getState:function(){return Jl()?WH(e.getState()):e.getState()},setState:function(t){e.setState(t)},patchState:function(t){e.patchState(t)}})}function fG(){return function(e,t,n){!function(e,t){if(!function(e,t){var n,i=e,r=!1;if(qH(i))for(;null!==i;){if(VH(null==i?void 0:i.hasOwnProperty(t))){r=!!(null===(n=Object.getOwnPropertyDescriptor(i,t))||void 0===n?void 0:n.get);break}i=Object.getPrototypeOf(i)}return r}(e,null==t?void 0:t.toString()))throw new Error("The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ".concat(t.toString(),"() { \n\t .. \n}"))}(e,t);var i=n.get;return n.get=function(){var e=function(e){return zH(iG(e))&&Object.defineProperties(e,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),iG(e)}(this),t=null==e?void 0:e.get(i);if(VH(null==t?void 0:t.isObservable))return null==t?void 0:t.value;if(zH(t)||t.sequenceId!==rG()){e.delete(i);for(var n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]?arguments[0]:dG;return function(t,n,i){!function(e,t){if(e.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===t)throw new Error("@DataAction() can only decorate a method implementation")}(t,i);var r=i.value,o=n.toString();return i.value=function(){for(var t=arguments.length,n=new Array(t),i=0;i0?Array.from(e).reduce(function(e,n){var i=t(n,2),r=i[0],o=i[1];return Object.defineProperty(e,r,{value:o,enumerable:!0})},{}):void 0}},{key:"gtag",value:function(){try{for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return{ngModule:e,providers:[{provide:_G,useValue:{trackingCode:t,initCommands:n,uri:i,enableTracing:r,nonce:o}},EG]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[]]}),e}(),OG=function(){var e=function(){function e(){m(this,e),this.consent="not-set",this.consentChange=new Ed(1),this.consentChange.next(this.consent)}return b(e,[{key:"ngOnDestroy",value:function(){this.consentChange.complete()}},{key:"setConsent",value:function(e){this.consent!==e&&(this.consent=e,this.consentChange.next(e))}},{key:"unsetConsent",value:function(){this.setConsent("not-set")}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),TG=function(){var e=function(){function e(t,n,i){var r=this,o=i.trackingCode;m(this,e),this.window=n,this.subscriptions=new W,this.token=o,this.subscriptions.add(t.consentChange.subscribe(function(e){return r.toggleGoogleAnalytics("rescinded"===e)}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"toggleGoogleAnalytics",value:function(e){this.window&&(this.window["ga-disable-".concat(this.token)]=e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(OG),Qi(wG),Qi(_G))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),AG=new Mi("Key under which consent is stored",{providedIn:"root",factory:function(){return"ALLOW_TELEMETRY"}}),PG=[OG,TG,function(){var e=function(){function e(t,n){var i=this;m(this,e),this.key=n,this.subscriptions=new W;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(function(e){return i.saveConsent(e)}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"loadConsent",value:function(){var e,t,n=null===(t=null===(e=this.storage)||void 0===e?void 0:e.getItem)||void 0===t?void 0:t.call(e,this.key);if(null==n)return"not-set";var i=n.trim().toLowerCase();switch(i){case"given":case"rescinded":return i;default:return"not-set"}}},{key:"saveConsent",value:function(e){var t,n;null===(n=null===(t=this.storage)||void 0===t?void 0:t.setItem)||void 0===n||n.call(t,this.key,e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(OG),Qi(AG))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}()];function MG(e){return Object.entries(e).reduce(function(e,n){var i=t(n,2),r=i[0],o=i[1];return null!=o&&(e[r]="".concat(o)),e},{})}var IG=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(t){var n=CG.forRoot(t.gaToken,function(e){return[{command:"set",values:[MG({appName:e.appName,projectName:e.projectName,developmentMode:e.developmentMode})]}]}(t)).providers;return{ngModule:e,providers:void 0===n?[]:n}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[].concat(PG,[{provide:yl,multi:!0,useFactory:function(){return function(){}},deps:PG}]),imports:[[CG]]}),e}(),RG=["bodyCanvas"],DG=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-body-ui",this.rotationChange=new Zc,this.nodeDrag=new Zc,this.nodeClick=new Zc,this.nodeHoverStart=new Zc,this.nodeHoverStop=new Zc,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}return b(e,[{key:"scene",get:function(){return this._scene},set:function(e){var t;this._scene=e,null===(t=this.bodyUI)||void 0===t||t.setScene(e)}},{key:"rotation",get:function(){return this._rotation},set:function(e){var t;this._rotation=e,null===(t=this.bodyUI)||void 0===t||t.setRotation(e)}},{key:"rotationX",get:function(){return this._rotationX},set:function(e){var t;this._rotationX=e,null===(t=this.bodyUI)||void 0===t||t.setRotationX(e)}},{key:"zoom",get:function(){return this._zoom},set:function(e){var t;this._zoom=e,null===(t=this.bodyUI)||void 0===t||t.setZoom(e)}},{key:"target",get:function(){return this._target},set:function(e){var t;this._target=e,null===(t=this.bodyUI)||void 0===t||t.setTarget(e)}},{key:"bounds",get:function(){return this._bounds},set:function(e){this._bounds=e,this.zoomToBounds(e)}},{key:"camera",get:function(){return this._camera},set:function(e){this._camera=e}},{key:"interactive",get:function(){return this._interactive},set:function(e){this._interactive=e,this.bodyUI&&this.recreateBodyUI()}},{key:"ngAfterViewInit",value:function(){this.setupBodyUI()}},{key:"zoomToBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:48,y:48};if(this.bodyCanvas){var n=this.bodyCanvas.nativeElement,i=n.width,r=n.height,o=window.devicePixelRatio,a=Math.min(Math.log2((i-t.x)/o/e.x),Math.log2((r-t.y)/o/e.y));this.zoom=a}}},{key:"setupBodyUI",value:function(){var e;return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,i,r=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.bodyCanvas.nativeElement,i=new LF({id:"body-ui",canvas:n,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera}),n.addEventListener("contextmenu",function(e){return e.preventDefault()}),t.next=4,i.initialize();case 4:this.bodyUI=i,window.bodyUI=i,(null===(e=this.scene)||void 0===e?void 0:e.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(function(e){return r.rotationChange.next(e)}),this.bodyUI.nodeDrag$.subscribe(function(e){return r.nodeDrag.emit(e)}),this.bodyUI.nodeClick$.subscribe(function(e){return r.nodeClick.emit(e)}),this.bodyUI.nodeHoverStart$.subscribe(function(e){return r.nodeHoverStart.emit(e)}),this.bodyUI.nodeHoverStop$.subscribe(function(e){return r.nodeHoverStop.emit(e)})];case 9:case"end":return t.stop()}},t,this)}))}},{key:"recreateBodyUI",value:function(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}},{key:"clearSubscriptions",value:function(){this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions=[]}},{key:"ngOnDestroy",value:function(){this.clearSubscriptions()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-body-ui"]],viewQuery:function(e,t){var n;(1&e&&hl(RG,5,Ku),2&e)&&(ll(n=dl())&&(t.bodyCanvas=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(e,t){1&e&&Ps(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),e}(),NG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh]]}),e}();new Mi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:function(){return 10}});var LG=["carouselContainer"],jG=["itemlist"],FG=["itemcontainer"];function BG(e,t){if(1&e&&(Ts(0,"div",14),ku(1),As()),2&e){var n=Hs().$implicit,i=Hs();qo(1),xu(i.occurenceData[n.id]||0)}}function VG(e,t){if(1&e){var n=Ds();Ts(0,"div",9),Fs("click",function(){var e=mn(n).$implicit;return Hs().selectOrgan(e)}),Ps(1,"mat-icon",10),Ts(2,"div",11),Ts(3,"div",12),ku(4),As(),xs(5,BG,2,1,"div",13),As(),As()}if(2&e){var i=t.$implicit,r=Hs();su("disabled",i.disabled)("selected",r.isSelected(i)),qo(1),Xs("svgIcon",i.src),qo(3),xu(i.name),qo(1),Cs("ngIf",void 0!==i.numResults)}}var zG=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}],UG=zG.filter(function(e){return!0!==e.disabled}),HG=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=UG,this.selectedOrgans=[],this.organsChanged=new Zc,this.onLeft=!0,this.onRight=!1,this.step=72}return b(e,[{key:"occurenceData",get:function(){return this._occurenceData},set:function(e){this._occurenceData=e}},{key:"ngAfterViewInit",value:function(){var e=this,t=this.carouselContainer;this.sensor=new kU.ResizeSensor(t.nativeElement,function(){e.set()})}},{key:"ngOnChanges",value:function(e){"organList"in e&&this.set()}},{key:"ngOnDestroy",value:function(){this.sensor.detach()}},{key:"error",get:function(){return!(!this.displayErrors||0===this.selectedOrgans.length)}},{key:"shift",value:function(e){var t=this.itemList,n=parseInt(t.nativeElement.style.left,10)||0;this.onLeft&&"left"===e||this.onRight&&"right"===e||(n="right"===e?n-this.step:n+this.step,t.nativeElement.style.left=n+"px",this.setLeftRight(n))}},{key:"scroll",value:function(e){var t=this;this.timeoutHandler=setInterval(function(){t.shift(e)},200)}},{key:"stopScroll",value:function(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}},{key:"selectOrgan",value:function(e){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(e)?this.selectedOrgans.filter(function(t){return e!==t}):this.selectedOrgans.concat([e]):[e],this.organsChanged.emit(this.selectedOrgans)}},{key:"isSelected",value:function(e){return!!this.selectedOrgans.includes(e)}},{key:"set",value:function(){var e=this.itemList,t=this.itemContainer,n=this.carouselContainer,i=parseInt(e.nativeElement.style.left,10)||0;if(e.nativeElement.offsetWidth>=this.organList.length*this.step)e.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(i);var r=this.step*Math.floor(n.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width="".concat(r,"px")}}},{key:"setWidth",value:function(){var e=this.itemContainer,t=this.carouselContainer,n=this.step*Math.floor(t.nativeElement.offsetWidth/this.step)-64;e.nativeElement.style.width="".concat(n,"px")}},{key:"setLeftRight",value:function(e){var t=this.itemContainer;this.onLeft=0===e,this.onRight=e<=t.nativeElement.offsetWidth-this.organList.length*this.step}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-organ-selector"]],viewQuery:function(e,t){var n;(1&e&&(hl(LG,7),hl(jG,7),hl(FG,7)),2&e)&&(ll(n=dl())&&(t.carouselContainer=n.first),ll(n=dl())&&(t.itemList=n.first),ll(n=dl())&&(t.itemContainer=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[Gt],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(e,t){1&e&&(Ts(0,"div",0,1),Ts(2,"mat-icon",2),Fs("touchstart",function(){return t.scroll("left")})("touchend",function(){return t.stopScroll()})("click",function(){return t.shift("left")})("mousedown",function(){return t.scroll("left")})("mouseup",function(){return t.stopScroll()}),ku(3,"chevron_left"),As(),Ts(4,"div",3,4),Ts(6,"div",5,6),xs(8,VG,6,7,"div",7),As(),As(),Ts(9,"mat-icon",8),Fs("touchstart",function(){return t.scroll("right")})("touchend",function(){return t.stopScroll()})("click",function(){return t.shift("right")})("mousedown",function(){return t.scroll("right")})("mouseup",function(){return t.stopScroll()}),ku(10,"chevron_right"),As(),As()),2&e&&(su("error",t.error),Cs("matTooltipDisabled",t.multiselect),qo(2),su("disabled",t.onLeft),qo(6),Cs("ngForOf",t.organList),qo(1),su("disabled",t.onRight))},directives:[hw,x_,Dh,Lh],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),e}(),GG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,S_,pw]]}),e}(),WG=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Zc,this.visibilityToggle=new Zc,this.opacityReset=new Zc}return b(e,[{key:"ngOnInit",value:function(){this.prevOpacity=this.visible?0:20}},{key:"reset",value:function(){this.prevOpacity=20}},{key:"changeOpacity",value:function(e){this.opacity=parseInt(e,10),this.opacityChange.emit(this.opacity)}},{key:"toggleVisibility",value:function(){var e=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=e,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}},{key:"resetOpacity",value:function(){this.prevOpacity=0,this.opacityReset.emit()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Ts(2,"mat-slider",2),Fs("input",function(e){return t.changeOpacity(e.value)}),As(),Ts(3,"span",3),ku(4),As(),As(),Ts(5,"div",4),Ts(6,"mat-icon",5),Fs("click",function(){return t.toggleVisibility()}),As(),Ts(7,"mat-icon",6),Fs("click",function(){return t.toggleVisibility()}),As(),Ts(8,"mat-icon",7),Fs("click",function(){return t.resetOpacity()}),ku(9,"refresh"),As(),As(),As()),2&e&&(qo(2),su("disabled",!t.visible),Cs("step",1)("min",0)("max",100)("value",t.opacity),qo(2),Su("",t.opacity,"%"),qo(2),su("hidden",t.visible),Cs("matRippleCentered",!0)("matRippleUnbounded",!0),qo(1),su("hidden",!t.visible),Cs("matRippleCentered",!0)("matRippleUnbounded",!0),qo(1),Cs("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[TU,x_,ob],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}(),qG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,S_,IU,ab]]}),e}();function XG(e,t){if(1&e&&(Ts(0,"div",15),Ps(1,"youtube-player",16),As()),2&e){var n=Hs(3);qo(1),Xs("videoId",n.videoID)}}function YG(e,t){if(1&e&&(Ts(0,"mat-expansion-panel",10),Ts(1,"mat-expansion-panel-header"),Ts(2,"h2",11),ku(3),As(),As(),Ts(4,"div",12),Ps(5,"markdown",13),xs(6,XG,2,1,"div",14),As(),As()),2&e){var n=Hs(),i=n.index,r=n.$implicit;Cs("expanded",0===i),qo(3),xu(r.title),qo(2),su("first",0===i),Cs("data",r.content),qo(1),Cs("ngIf",0===i)}}function KG(e,t){if(1&e&&(Ts(0,"div",8),xs(1,YG,7,6,"mat-expansion-panel",9),As()),2&e){var n=t.$implicit;qo(1),Cs("ngIf",n)}}var QG=function(){var e=function(){function e(t,n){m(this,e),this.dialogRef=t,this.data=n,this.documentationContents=n.content||[],this.infoTitle=n.title||"",this.videoID=n.videoID}return b(e,[{key:"ngOnInit",value:function(){var e=document.createElement("script");e.src="https://www.youtube.com/iframe_api",document.body.appendChild(e)}},{key:"close",value:function(){var e,t=this;null===(e=document.getElementsByClassName("modal-animated")[0])||void 0===e||e.classList.add("modal-animate-fade-out"),setTimeout(function(){t.dialogRef.close()},250)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(BU),Es(zU))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Ts(2,"div",2),Ts(3,"mat-icon",3),Fs("click",function(){return t.close()}),ku(4,"clear"),As(),As(),Ts(5,"div",4),Ts(6,"h2",5),ku(7),As(),Ts(8,"mat-dialog-content",6),xs(9,KG,2,1,"div",7),As(),As(),As(),As()),2&e&&(qo(7),xu(t.infoTitle),qo(2),Cs("ngForOf",t.documentationContents))},directives:[x_,YU,KU,Dh,Lh,pH,gH,SH,NH],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),e}(),$G=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,QU,S_,mH,BH,EH.forRoot({})]]}),e}(),ZG=function(){var e=function(){function e(t){m(this,e),this.http=t,this.markdownContent=new nv([])}return b(e,[{key:"readMarkdown",value:function(){var e=this;this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(function(t){var n=e.parseMarkdown(t);e.markdownContent.next(n)})}},{key:"parseMarkdown",value:function(e){var t,n=[],i=_(e.split("# "));try{for(i.s();!(t=i.n()).done;){var r=t.value;if(r.length){var o=r.split("\n\n");n.push({title:o[0],content:o.splice(1).join("\n\n")})}}}catch(a){i.e(a)}finally{i.f()}return n}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Kb))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),JG=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.dialog=t,this.infoButtonService=n,this.infoTitle="",this.subscriptions=new W,this.subscriptions.add(n.markdownContent.subscribe(function(e){e.length&&i.launchInfoDialog(e)}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"launchInfoDialog",value:function(e){this.dialog.open(QG,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:e,videoID:this.videoID}})}},{key:"onDialogButtonClick",value:function(){this.infoButtonService.readMarkdown()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(qU),Es(ZG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"mat-icon",1),Fs("click",function(){return t.onDialogButtonClick()}),ku(2," info "),As(),As())},directives:[x_],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),e}(),eW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,$G,S_,u_]]}),e}(),tW=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).optionCache=new Map,e}return b(n,[{key:"config$",get:function(){return this.state$.pipe(od(function(e){return null!=e}),Od(1))}},{key:"setConfig",value:function(e){this.setState(e)}},{key:"patchConfig",value:function(e){this.patchState(e)}},{key:"getProperty",value:function(e){return this.config$.pipe(mU.apply(void 0,v(e)),Qf(),Od(1))}},{key:"getOption",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:Jf,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yU;return function(i){return i.lift(new bU(e,t,n.leading,n.trailing))}}(1e3),ue(function(t){var n=e.clientWidth,i=e.clientHeight;return[t.clientX,t.clientY,n,i].join("_")})).subscribe(function(e){return t.event("webpage","mousemove",e)})}(t.body,n)};return e.\u0275fac=function(t){return new(t||e)(Qi(fh),Qi(SG))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}();function iW(e,t){if(1&e){var n=Ds();Ts(0,"button",1),Fs("click",function(){return mn(n),Hs().submit(!0)}),ku(1),As()}if(2&e){var i=Hs();qo(1),Su(" ","not-set"===i.allowTelemetry?"I understand":"Opt in","\n")}}function rW(e,t){if(1&e){var n=Ds();Ts(0,"button",1),Fs("click",function(){return mn(n),Hs().submit(!1)}),ku(1,"Opt out"),As()}}var oW,aW,sW=function(){var e=function(){function e(t,n,i){m(this,e),this.consentService=n,this.data=i,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}return b(e,[{key:"allowTelemetry",get:function(){return this.consentService.consent}},{key:"dismiss",value:function(){this.data.preClose()}},{key:"submit",value:function(e){this.consentService.setConsent(e?"given":"rescinded"),this.dismiss()}},{key:"showButton",value:function(e){var t=this.allowTelemetry;return"not-set"===t||("opt-in"===e?"rescinded"===t:"given"===t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(OG),Es(Y_))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(e,t){1&e&&(Ts(0,"p"),ku(1,"We log usage to improve this service."),As(),xs(2,iW,2,1,"button",0),xs(3,rW,2,0,"button",0)),2&e&&(qo(2),Cs("ngIf",t.showButton("opt-in")),qo(1),Cs("ngIf",t.showButton("opt-out")))},directives:[Lh,P_],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),e}(),uW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_]]}),e}(),cW=new Mi("Default theme class"),lW="light-theme",hW="dark-theme",fW=function(){var e=function(){function e(t){m(this,e),this.defaultTheme=this.theme=null!=t?t:""}return b(e,[{key:"getTheme",value:function(){return this.theme}},{key:"setTheme",value:function(e){e!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(e),this.theme=e)}},{key:"resetTheme",value:function(){this.setTheme(this.defaultTheme)}},{key:"initialize",value:function(e,t){this.element=e,this.injector=t,this.applyThemeClass(this.getTheme())}},{key:"applyThemeClass",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"add",i=this.element,r=this.injector;if(e&&i&&r){var o=r.get(Zu,null);if(o){var a=i.nativeElement,s=null===(t=r.get(Ap,null))||void 0===t?void 0:t.getContainerElement(),u="add"===n?"addClass":"removeClass";o[u](a,e),s&&o[u](s,e)}}}}],[{key:"initialize",value:function(t){var n=t.injector,i=t.location;n.get(e).initialize(i,n)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(cW,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),dW={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["assets/kpmp/data/rui_locations.jsonld","assets/sparc/data/rui_locations.jsonld","assets/gtex/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(oW=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==oW?oW:"",useRemoteApi:!0,remoteApiEndpoint:"https://ccf-api.herokuapp.com/v1"},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"},pW=["*",[["mat-toolbar-row"]]],vW=["*","mat-toolbar-row"],gW=Xy(function(){return function e(t){m(this,e),this._elementRef=t}}()),mW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]}),e}(),yW=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e))._platform=i,o._document=r,o}return b(n,[{key:"ngAfterViewInit",value:function(){var e=this;this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(function(){return e._checkToolbarMixedModes()}))}},{key:"_checkToolbarMixedModes",value:function(){}}]),n}(gW);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Id),Es(fh))},e.\u0275cmp=Ct({type:e,selectors:[["mat-toolbar"]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,mW,5),2&e)&&(ll(i=dl())&&(t._toolbarRows=i))},hostAttrs:[1,"mat-toolbar"],hostVars:4,hostBindings:function(e,t){2&e&&su("mat-toolbar-multiple-rows",t._toolbarRows.length>0)("mat-toolbar-single-row",0===t._toolbarRows.length)},inputs:{color:"color"},exportAs:["matToolbar"],features:[ss],ngContentSelectors:vW,decls:2,vars:0,template:function(e,t){1&e&&(Ws(pW),qs(0),qs(1,1))},styles:[".cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}\n"],encapsulation:2,changeDetection:0}),e}(),bW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Wy],Wy]}),e}(),_W=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_,S_,bW,pw]]}),e}();function wW(e){return new Promise(function(t,n){e.oncomplete=e.onsuccess=function(){return t(e.result)},e.onabort=e.onerror=function(){return n(e.error)}})}function kW(){return aW||(e="keyval",t=function(){return navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases?Promise.resolve():new Promise(function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()}).finally(function(){return clearInterval(e)});var e}().then(function(){var t=indexedDB.open("keyval-store");return t.onupgradeneeded=function(){return t.result.createObjectStore(e)},wW(t)}),aW=function(n,i){return t.then(function(t){return i(t.transaction(e,n).objectStore(e))})}),aW;var e,t}function xW(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kW();return t("readonly",function(t){return wW(t.get(e))})}var SW=r(71440),EW=r(70698),CW=r(7445),OW=r.n(CW),TW=r(23815),AW=r(31609),PW=SW.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},SW.DataFactory),MW={x:PW("rdf"),type:PW("rdf")("type")},IW={x:PW("rdfs"),label:PW("rdfs")("label"),comment:PW("rdfs")("comment"),isDefinedBy:PW("rdfs")("isDefinedBy"),seeAlso:PW("rdfs")("seeAlso")},RW={x:PW("entity"),id:PW("entity")("id"),label:IW.label,description:IW.comment,link:IW.seeAlso,sex:PW("entity")("sex"),age:PW("entity")("age"),bmi:PW("entity")("bmi"),Male:SW.DataFactory.literal("Male"),Female:SW.DataFactory.literal("Female"),consortiumName:PW("entity")("consortium_name"),providerName:PW("entity")("provider_name"),providerUUID:PW("entity")("provider_uuid"),donor:PW("entity")("has_donor"),sections:PW("entity")("has_tissue_section"),datasets:PW("entity")("has_dataset"),sampleType:PW("entity")("sample_type"),TissueBlock:SW.DataFactory.literal("Tissue Block"),TissueSection:SW.DataFactory.literal("Tissue Section"),NonStandard:SW.DataFactory.literal("Non-standard"),sectionCount:PW("entity")("section_count"),sectionSize:PW("entity")("section_size"),sectionUnits:PW("entity")("section_units"),sectionNumber:PW("entity")("section_number"),spatialEntity:PW("entity")("has_spatial_entity"),ontologyTerms:PW("entity")("has_ontology_term"),technology:PW("entity")("technology"),thumbnail:PW("entity")("has_thumbnail")},DW=PW("ccf"),NW={x:DW,ontologyNode:{label:DW("ccf_preferred_label"),parent:DW("ccf_part_of"),children:DW("ccf_part_of"),rui_rank:DW("ccf_rui_rank"),synonymLabels:SW.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:DW("VHFemale"),Male:DW("VHMale"),BothSexes:DW("VHBothSexes"),FemaleOrgans:DW("VHFemaleOrgans"),MaleOrgans:DW("VHMaleOrgans")},SpatialObjectReference:DW("SpatialObjectReference"),SpatialEntity:DW("SpatialEntity"),SpatialPlacement:DW("SpatialPlacement"),spatialObjectReference:{file:DW("has_object_file"),file_format:DW("has_object_file_format"),file_subpath:DW("has_object_file_subpath")},extractionSet:{label:IW.label,rui_rank:DW("ccf_rui_rank")},spatialEntity:{label:IW.label,comment:IW.comment,creator:PW("dc")("creator"),creator_first_name:DW("creator_first_name"),creator_last_name:DW("creator_last_name"),creator_orcid:DW("creator_orcid"),creation_date:DW("creation_date"),updated_date:DW("updated_date"),ccf_annotations:DW("ccf_annotation"),representation_of:DW("ccf_representation_of"),reference_organ:DW("anatomical_structure_of"),extraction_set_for:DW("extraction_set_for"),extraction_set:DW("extraction_site_for"),sex:DW("has_sex"),side:DW("has_side"),rui_rank:DW("ccf_rui_rank"),slice_thickness:DW("ccf_slice_thickness"),slice_count:DW("ccf_slice_count"),x_dimension:DW("has_x_dimension"),y_dimension:DW("has_y_dimension"),z_dimension:DW("has_z_dimension"),dimension_units:DW("has_dimension_units"),object:DW("has_object_reference")},spatialPlacement:{source:DW("has_placement_source"),target:DW("has_placement_target"),placement_date:DW("has_placement_date"),x_scaling:DW("has_x_scaling"),y_scaling:DW("has_y_scaling"),z_scaling:DW("has_z_scaling"),scaling_units:DW("has_scaling_units"),x_rotation:DW("has_x_rotation"),y_rotation:DW("has_y_rotation"),z_rotation:DW("has_z_rotation"),w_rotation:DW("has_theta_rotation"),rotation_order:DW("has_rotation_order"),rotation_units:DW("has_rotation_units"),x_translation:DW("has_x_translation"),y_translation:DW("has_y_translation"),z_translation:DW("has_z_translation"),translation_units:DW("has_translation_units")}},LW={x:PW("uberon")},jW=(PW("lmha"),{bladder:LW.x("0001255"),body:LW.x("0013702"),brain:LW.x("0000955"),colon:LW.x("0001155"),heart:LW.x("0000948"),kidney:LW.x("0002113"),large_intestine:LW.x("0000059"),left_kidney:LW.x("0004538"),left_lung:LW.x("0002168"),left_ureter:LW.x("0001223"),liver:LW.x("0002107"),lung:LW.x("0002048"),respiratory_system:LW.x("0001004"),lymph_node:LW.x("0000029"),pelvis:LW.x("0001270"),rectum:LW.x("0001052"),right_kidney:LW.x("0004539"),right_lung:LW.x("0002167"),right_ureter:LW.x("0001222"),skin:LW.x("0002097"),small_intestine:LW.x("0002108"),spleen:LW.x("0002106"),thymus:LW.x("0002370"),ureter:LW.x("0000056"),vasculature:LW.x("0002049")});function FW(e){var n={};return Object.entries(e).forEach(function(e){var i=t(e,2),r=i[0],o=i[1];n[o.id]=r}),n}var BW={spatialObjectReference:FW(NW.spatialObjectReference),spatialEntity:FW(NW.spatialEntity),spatialPlacement:FW(NW.spatialPlacement)};function VW(e,t,n,i){var r={"@id":t,"@type":n};return e.some(function(e){var t=i[e.predicate.id];if(t){var n="Literal"===e.object.termType?(0,AW.fromRdf)(e.object):e.object.id;(0,TW.set)(r,t,n)}return!1},SW.DataFactory.namedNode(t),null,null,null),r}var zW=(0,TW.memoize)(function(e,t){return VW(e,t,"SpatialObjectReference",BW.spatialObjectReference)},function(e,t){return t}),UW=(0,TW.memoize)(function(e,t){var n=VW(e,t,"ExtractionSet",BW.spatialEntity);return n.extractionSites=(0,TW.sortBy)(e.getSubjects(NW.spatialEntity.extraction_set,t,null).map(function(t){return qW(e,t.id)}),["rui_rank"]),n},function(e,t){return t}),HW=(0,TW.memoize)(function(e,t){return(0,TW.sortBy)(e.getSubjects(NW.spatialEntity.extraction_set_for,t,null).map(function(t){return UW(e,t.id)}),["rui_rank"])},function(e,t){return t}),GW=(0,TW.memoize)(function(e,t){return(0,TW.sortBy)(e.getSubjects(NW.spatialEntity.reference_organ,t,null).map(function(t){return qW(e,t.id)}).filter(function(e){return e["@id"]!==t}),["rui_rank"])},function(e,t){return t}),WW=(0,TW.memoize)(function(e){var t=[];return e.forEach(function(n){n.subject.id===n.object.id&&t.push(qW(e,n.subject.id))},null,NW.spatialEntity.reference_organ,null,null),(0,TW.sortBy)(t,["rui_rank"])}),qW=(0,TW.memoize)(function(e,t){var n=VW(e,t,"SpatialEntity",BW.spatialEntity);return n.object&&(n.object=zW(e,n.object)),n.ccf_annotations&&(n.ccf_annotations=e.getObjects(t,NW.spatialEntity.ccf_annotations,null).map(function(e){return e.id})),e.forSubjects(function(e){return n.entityId=e.id},RW.spatialEntity,t,null),n},function(e,t){return t}),XW=(0,TW.memoize)(function(e,t){var n=VW(e,t,"SpatialPlacement",BW.spatialPlacement);return n.source&&(n.source=qW(e,n.source)),n.target&&(n.target=qW(e,n.target)),n},function(e,t){return t}),YW=(0,TW.memoize)(function(e,t){var n=e.getObjects(SW.DataFactory.namedNode(t),RW.spatialEntity,null);if(n.length>0)return qW(e,n[0].id)},function(e,t){return t});function KW(e,t){var n,i=t;switch(i.translation_units){case"centimeter":n=.01;break;case"millimeter":n=.001;break;case"meter":default:n=1}var r=[i.x_translation,i.y_translation,i.z_translation].map(function(e){return e*n}),o=[i.x_rotation,i.y_rotation,i.z_rotation].map(Gx),a=[i.x_scaling,i.y_scaling,i.z_scaling];return e.translate(r).rotateXYZ(o).scale(a)}var QW=function(){function e(t){m(this,e),this.db=t,this.createGraph()}return b(e,[{key:"createGraph",value:function(){var e=this;this.graph=new EW.DirectedGraph;var t=this.db.store;t.forSubjects(function(t){e.addNode(t.id,"SpatialObjectReference")},MW.type,NW.SpatialObjectReference,null),t.forSubjects(function(t){e.addNode(t.id,"SpatialEntity")},MW.type,NW.SpatialEntity,null);var n={};t.some(function(e){return n[e.subject.id]=e.object.id,!1},null,NW.spatialPlacement.source,null,null),t.some(function(t){var i=n[t.subject.id];return i&&e.addEdge(t.subject.id,i,t.object.id,"SpatialPlacement"),!1},null,NW.spatialPlacement.target,null,null)}},{key:"addNode",value:function(e,t){this.graph.mergeNode(e,{type:t})}},{key:"addEdge",value:function(e,t,n,i){this.graph.mergeDirectedEdge(t,n,{type:i,id:e})}},{key:"getTransformationMatrix",value:function(e,t){if(e===t)return new EO(EO.IDENTITY);if(this.graph.hasNode(e)&&this.graph.hasNode(t)){var n=this.db.store,i=new EO(EO.IDENTITY),r=OW()(this.graph,e,t);if(r&&r.length>0){r.reverse();var o,a="",s=_(r);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(a){var c=this.graph.getEdgeAttribute(u,a,"id");KW(i,XW(n,c))}a=u}}catch(l){s.e(l)}finally{s.f()}return i}}}}]),e}(),$W=function(){function e(t){m(this,e),this.db=t}return b(e,[{key:"getSpatialEntity",value:function(e){return qW(this.db.store,e)}},{key:"getExtractionSets",value:function(e){return HW(this.db.store,e)}},{key:"getExtractionSet",value:function(e){return UW(this.db.store,e)}},{key:"getAnatomicalStructures",value:function(e){return GW(this.db.store,e)}},{key:"getReferenceOrgans",value:function(){return WW(this.db.store)}},{key:"getReferenceBody",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=NW.spatial.Male.id;break;case"Female":t=NW.spatial.Female.id;break;case"Both":default:t=NW.spatial.BothSexes.id}return this.getSpatialEntity(t)}},{key:"getReferenceOrganSets",value:function(e){var n=this,i=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":i=i.filter(function(e){return"Male"===e.sex});break;case"Female":i=i.filter(function(e){return"Female"===e.sex})}return(null==e?void 0:e.debug)&&(i=i.map(function(e){return[[e],n.getAnatomicalStructures(e["@id"])]}).reduce(function(e,n){var i=t(n,2),r=i[0],o=i[1];return e.concat(o.length>0?o:r)},[])),i}},{key:"getReferenceSceneNodes",value:function(e){var t=this,n=this.getReferenceBody(e),i=v(this.getReferenceOrganSets(e).map(function(e){var i="http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of;return t.getSceneNode(e,n,{color:[255,255,255,255],opacity:i?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!i})}));return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(NW.x("VHRightKidney").id),n,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(NW.x("VHLeftKidney").id),n,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(NW.x("VHSpleenCC1").id),n,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(NW.x("VHSpleenCC2").id),n,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(NW.x("VHSpleenCC3").id),n,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(function(e){return void 0!==e})}},{key:"getReferenceOrganScene",value:function(e,t){var n,i,r=this,o=null!==(n=void 0!==(null==t?void 0:t.sex))&&void 0!==n&&n,a=this.getReferenceOrgans().filter(function(n){return n.representation_of===e&&(!o||n.sex===(null==t?void 0:t.sex))});if(a.length>0){var s=a[0],u=this.getSceneNode(s,s,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),c=(null!==(i=this.db.getSpatialEntities(t))&&void 0!==i?i:[]).map(function(e){return r.getSceneNode(e,s,{color:[255,255,255,229.5]})});return[u].concat(c).filter(function(e){return void 0!==e})}return[]}},{key:"getEntitySceneNodes",value:function(e){var t=this,n=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(function(e){return t.getSceneNode(e,n,{color:[255,255,255,229.5]})}).filter(function(e){return void 0!==e})}},{key:"getSceneNode",value:function(e,t){var n,i,r,o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=null===(i=null===(n=null==e?void 0:e.object)||void 0===n?void 0:n.file_format)||void 0===i?void 0:i.startsWith("model/gltf"),u=this.db.graph.getTransformationMatrix(s&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(s)u=new EO(EO.IDENTITY).rotateX(Gx(90)).multiplyLeft(u);else{var c;switch(e.dimension_units){case"centimeter":c=.01;break;case"millimeter":c=.001;break;case"meter":default:c=1}var l=[e.x_dimension,e.y_dimension,e.z_dimension].map(function(e){return e*c/2});u.scale(l)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:s?null===(r=e.object)||void 0===r?void 0:r.file:void 0,scenegraphNode:s?null===(o=e.object)||void 0===o?void 0:o.file_subpath:void 0,transformMatrix:u,tooltip:e.label},a)}}},{key:"getScene",value:function(e){return[].concat(v(this.getReferenceSceneNodes(e)),v(this.getEntitySceneNodes(e)))}}]),e}(),ZW="https://entity.api.hubmapconsortium.org/entities/",JW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),eq={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},tq={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},nq=function(){var e={};return Object.entries(jW).forEach(function(n){var i=t(n,2),r=i[0],o=i[1];return e[r]=o.id}),e}(),iq={BL:[nq.body,nq.bladder],RK:[nq.body,nq.kidney,nq.right_kidney],LK:[nq.body,nq.kidney,nq.left_kidney],HT:[nq.body,nq.heart],LI:[nq.body,nq.large_intestine,nq.colon],SI:[nq.body,nq.small_instestine],LL:[nq.body,nq.respiratory_system,nq.lung,nq.left_lung],RL:[nq.body,nq.respiratory_system,nq.lung,nq.right_lung],LY:[nq.body,nq.lymph_node],SP:[nq.body,nq.spleen],TH:[nq.body,nq.thymus],UR:[nq.body,nq.ureter],LV:[nq.body,nq.liver],OT:[nq.body]},rq={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}},oq=function(){function e(t){var n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;if(m(this,e),this.data=t,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"===this.data.entity_type){var s=this.data.descendants||[],u=(this.data.ancestors||[]).find(function(e){return"Donor"===e.entity_type});this.donor=this.getDonor(u,o);var c=this.getRuiLocation(t,this.donor);c?this.rui_location=c:this.bad=!0;var l=new Date(t.last_modified_timestamp).toLocaleDateString(),h=tq[t.group_uuid]||t.group_name,f=t.created_by_user_displayname;this["@id"]=ZW+t.uuid,this.label="Registered ".concat(l,", ").concat(f,", ").concat(h),this.link="".concat(o,"browse/sample/").concat(t.uuid);var d={},p=[];this.sections=p;var v=[];this.datasets=v;var g,y=_(s.filter(function(e){return"Sample"===e.entity_type}));try{for(y.s();!(g=y.n()).done;){var b=g.value,w=this.getSection(b,t,o);d[b.submission_id]=w,p.push(w),w.section_number=null!==(n=w.section_number)&&void 0!==n?n:p.length}}catch(M){y.e(M)}finally{y.f()}var k,x=_(s);try{for(x.s();!(k=x.n()).done;){var S=k.value;if("Dataset"===S.entity_type){var E=this.getDataset(S,r,o,a),C=(0,TW.get)(S,["ingest_metadata","metadata","tissue_id"]);d[C]?null===(i=d[C].datasets)||void 0===i||i.push(E):v.push(E)}}}catch(M){x.e(M)}finally{x.f()}var O=null!=c?c:{},T="".concat(O.x_dimension," x ").concat(O.y_dimension," x ").concat(O.z_dimension," ").concat(O.dimension_units);this.section_count=O.slice_count||p.length;var A=parseFloat((O.slice_thickness||(O.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=A;var P=O.dimension_units||"millimeter";this.section_units=P,this.description="".concat(T,", ").concat(A," ").concat(P,", ").concat(t.specimen_type,", ").concat(this.section_count," Sections"),p.forEach(function(e,t){e.description="".concat(O.x_dimension," x ").concat(O.y_dimension," x ").concat(A," ").concat(P,", ").concat(A," ").concat(P,", ").concat(e.description),e.section_number=t+1})}else this.bad=!0}return b(e,[{key:"getSection",value:function(e,t,n){var i=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":ZW+e.uuid,"@type":"Sample",label:"Registered ".concat(i,", ").concat(e.created_by_user_displayname,", ").concat(tq[e.group_uuid]||e.group_name),description:"".concat(t.specimen_type),link:"".concat(n,"browse/sample/").concat(e.uuid),sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}},{key:"getDataset",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0,a=new Date(e.last_modified_timestamp).toLocaleDateString(),s=tq[e.group_uuid]||e.group_name,u=e.created_by_user_displayname,c=[].concat(v(e.data_types),[(0,TW.get)(e,["ingest_metadata","metadata","assay_type"],"")]),l=c.join("|").toLowerCase(),h="assets/icons/ico-unknown.svg";return-1!==l.indexOf("10x")?(n="10x",h="assets/icons/ico-bulk-10x.svg"):-1!==l.indexOf("af")?(n="AF",h="assets/icons/ico-spatial-af.svg"):-1!==l.indexOf("codex")?(n="CODEX",h="assets/icons/ico-spatial-codex.svg"):-1!==l.indexOf("imc")?(n="IMC",h="assets/icons/ico-spatial-imc.svg"):-1!==l.indexOf("lc")&&-1===l.indexOf("af")?(n="LC",h="assets/icons/ico-bulk-lc.svg"):n=-1!==l.indexOf("maldi")?"MALDI":-1!==l.indexOf("pas")?"PAS":"OTHER",h=null!==(t=this.getDatasetThumbnail(e,i,o))&&void 0!==t?t:h,{"@id":ZW+e.uuid,"@type":"Dataset",label:"Registered ".concat(a,", ").concat(u,", ").concat(s),description:"Data/Assay Types: ".concat(c.join(", ")),link:"".concat(r,"browse/dataset/").concat(e.uuid),technology:n,thumbnail:h}}},{key:"getDatasetThumbnail",value:function(e,t,n){if(e.thumbnail_file){var i=e.thumbnail_file;return"".concat(t,"/").concat(i.file_uuid,"/").concat(i.filename)+(n?"?token=".concat(n):"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){var r=(0,TW.get)(e,"metadata.files",[]).filter(function(e){return/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)}).filter(function(e){return!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(e.rel_path)}).filter(function(e){return JW.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))}).map(function(i){return"".concat(t,"/").concat(e.uuid,"/").concat(i.rel_path)+(n?"?token=".concat(n):"")});if(r.length>0){var o=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(JW.has(o))return"assets/thumbnails/TMC-Vanderbilt/DR1/".concat(o)}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){var a=eq[e.hubmap_id];if(a)return"assets/thumbnails/TMC-Florida/".concat(a)}}},{key:"getDonor",value:function(e,t){var n,i=(e.description||"").toLowerCase();i.includes("female")?n="Female":i.includes("male")&&(n="Male");var r,o,a=i.match(/age ([0-9]+)/);a&&(r=(0,TW.toNumber)(a[1]));var s,u=_((0,TW.get)(e,"metadata.organ_donor_data",[]));try{for(u.s();!(s=u.n()).done;){var c=s.value;"Feminine gender"===c.preferred_term||"Female"===c.preferred_term?n="Female":"Masculine gender"===c.preferred_term||"Male"===c.preferred_term?n="Male":"Current chronological age"===c.preferred_term||"Age"===c.preferred_term?r=(0,TW.toNumber)(c.data_value):"Body mass index"===c.preferred_term&&(o=(0,TW.toNumber)(c.data_value))}}catch(d){u.e(d)}finally{u.f()}var l="";n&&r&&(l+="".concat(n,", Age ").concat(r),o&&(l+=", BMI ".concat(o.toFixed(1))));var h=new Date(e.last_modified_timestamp).toLocaleDateString(),f=tq[e.group_uuid]||e.group_name;return{"@id":ZW+e.uuid,"@type":"Donor",label:l,description:"Entered ".concat(h,", ").concat(e.created_by_user_displayname,", ").concat(f),link:"".concat(t,"browse/donor/").concat(e.uuid),age:r,sex:n,bmi:o,consortium_name:"HuBMAP",provider_name:f,provider_uuid:e.group_uuid,samples:[]}}},{key:"getRuiLocation",value:function(e,t){var n,i,r=(e.ancestors||[]).find(function(e){return"Sample"===e.entity_type&&"organ"===e.specimen_type}),o=iq[null==r?void 0:r.organ]||[nq.body],a=e.rui_location;if(a&&("string"==typeof a&&(a=JSON.parse(a)),a.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):a["@id"]&&(i=a)),i){i.ccf_annotations=o.concat(i.ccf_annotations||[]);var s=null!==(n=(0,TW.get)(i,["placement","target"]))&&void 0!==n?n:"";s.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,TW.set)(i,["placement","target"],s.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===s||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===s)&&(0,TW.set)(i,["placement","target"],"Male"===t.sex?s.replace("#VH","#VHM")+"_Patch":s.replace("#VH","#VHF")+"_Patch")}return i}},{key:"getTissueBlock",value:function(){return(0,TW.omit)(Object.assign({},this),["data","bad","donor"])}},{key:"toJsonLd",value:function(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}]),e}();function aq(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return yw(this,void 0,void 0,regeneratorRuntime.mark(function a(){var s,u;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if("static"!==t){a.next=6;break}return a.next=3,fetch(e).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 3:s=a.sent,a.next=12;break;case 6:if("search-api"!==t){a.next=12;break}return u={"Content-type":"application/json"},i&&i.length>0&&(u.Authorization="Bearer ".concat(i)),a.next=11,fetch(e,{method:"POST",headers:u,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:{exists:{field:"rui_location"}}})}).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 11:s=a.sent;case 12:if(!s){a.next=14;break}return a.abrupt("return",function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={},s=(0,TW.get)(e,"hits.hits",[]).map(function(e){return(0,TW.get)(e,"_source",{})}).map(function(e){return new oq(e,n,i,r).toJsonLd()}),u=_(s);try{for(u.s();!(t=u.n()).done;){var c=t.value,l=c["@id"];a[l]?a[l].samples.push(c.samples[0]):a[l]=c}}catch(f){u.e(f)}finally{u.f()}var h=Object.values(a);return o&&(function(e){var t,n=[],i=0,r=_(e.filter(function(e){return e.samples.length>1}));try{for(r.s();!(t=r.n()).done;){for(var o=t.value,a=o.samples,s=function(e){var t=a[e]["@id"];n=n.concat(a[e].datasets);var r,o=_(a[e].sections);try{for(o.s();!(r=o.n()).done;){var s=r.value;n=n.concat(s.datasets)}}catch(f){o.e(f)}finally{o.f()}for(var u=e+1;u0&&console.log("\u26a0 ".concat(i," sections identified as blocks"))}(h),console.log(h.map(function(e){return Object.assign({"@context":rq},e)}))),{"@context":rq,"@graph":h}}(s,r,o,i));case 14:console.warn("Unable to load ".concat(e," as HuBMAP Data"));case 15:case"end":return a.stop()}},a)}))}function sq(e,t,n){var i,r=new Map,o=new Set;e.some(function(e){var n;return t.has(e.subject.id)&&(o.add(e.object.id),r.has(e.object.id)?null===(n=r.get(e.object.id))||void 0===n||n.push(e.subject.id):r.set(e.object.id,[e.subject.id])),!1},null,RW.donor,null,null);var a,s=n(o),u=new Set,c=_(s);try{for(c.s();!(a=c.n()).done;){var l,h=a.value,f=_(null!==(i=r.get(h))&&void 0!==i?i:[]);try{for(f.s();!(l=f.n()).done;){var d=l.value;u.add(d)}}catch(p){f.e(p)}finally{f.f()}}}catch(p){c.e(p)}finally{c.f()}return u}function uq(e,t){return function(n){return e.has(n.id)?t.add(n.id):void 0}}var cq=(o(x={},NW.ontologyNode.label.id,"label"),o(x,NW.ontologyNode.parent.id,"parent"),o(x,NW.ontologyNode.synonymLabels.id,"synonymLabels"),x);function lq(e,t){var n=SW.DataFactory.namedNode(t),i={"@id":t,"@type":"OntologyTreeNode",id:t,parent:"",children:[],synonymLabels:[],label:""};return e.some(function(e){var t=cq[e.predicate.id];if(t){var n="Literal"===e.object.termType?(0,AW.fromRdf)(e.object):e.object.id;"synonymLabels"===t?i.synonymLabels.push(n):(0,TW.set)(i,t,n)}return!1},n,null,null,null),i.children=e.getSubjects(NW.ontologyNode.children,n,null).map(function(e){return e.id}),i}var hq=(o(S={},RW.label.id,"label"),o(S,RW.description.id,"description"),o(S,RW.link.id,"link"),S),fq=Object.assign(Object.assign({},hq),o({},RW.providerName.id,"providerName")),dq=Object.assign(Object.assign({},hq),(o(E={},RW.technology.id,"technology"),o(E,RW.thumbnail.id,"thumbnail"),E)),pq=Object.assign(Object.assign({},hq),(o(C={},RW.sampleType.id,"sampleType"),o(C,RW.sectionNumber.id,"sectionNumber"),o(C,RW.datasets.id,"datasets"),C)),vq=Object.assign(Object.assign({},hq),(o(O={},RW.sampleType.id,"sampleType"),o(O,RW.sectionCount.id,"sectionCount"),o(O,RW.sectionSize.id,"sectionSize"),o(O,RW.sectionUnits.id,"sectionUnits"),o(O,RW.donor.id,"donor"),o(O,RW.spatialEntity.id,"spatialEntityId"),o(O,RW.sections.id,"sections"),o(O,RW.datasets.id,"datasets"),O)),gq=(0,TW.memoize)(function(e,t){var n={"@id":t,"@type":"Donor"};return e.some(function(e){var t=fq[e.predicate.id];if(t){var i="Literal"===e.object.termType?(0,AW.fromRdf)(e.object):e.object.id;(0,TW.set)(n,t,i)}return!1},SW.DataFactory.namedNode(t),null,null,null),n},function(e,t){return t});function mq(e,t){var n={"@id":t,"@type":"Dataset"};return e.some(function(e){var t=dq[e.predicate.id];if(t){var i="Literal"===e.object.termType?(0,AW.fromRdf)(e.object):e.object.id;(0,TW.set)(n,t,i)}return!1},SW.DataFactory.namedNode(t),null,null,null),n}var yq=(0,TW.memoize)(function(e,t){var n={"@id":t,"@type":"Sample",sections:[],datasets:[]};return e.some(function(t){var i=vq[t.predicate.id];if(i){var r="Literal"===t.object.termType?(0,AW.fromRdf)(t.object):t.object.id;if("sections"===i){var o=function(e,t){var n={"@id":t,"@type":"Sample",datasets:[]};return e.some(function(t){var i=pq[t.predicate.id];if(i){var r="Literal"===t.object.termType?(0,AW.fromRdf)(t.object):t.object.id;if("datasets"===i){var o=mq(e,r);n[i].push(o)}else(0,TW.set)(n,i,r)}return!1},SW.DataFactory.namedNode(t),null,null,null),n}(e,r);n[i].push(o)}else if("datasets"===i){var a=mq(e,r);n[i].push(a)}else"donor"===i?n[i]=gq(e,r):(0,TW.set)(n,i,r)}return!1},SW.DataFactory.namedNode(t),null,null,null),n},function(e,t){return t}),bq={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},_q=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bq;m(this,e),this.options=t,this.store=new SW.Store(void 0,{factory:SW.DataFactory}),this.graph=new QW(this),this.scene=new $W(this)}return b(e,[{key:"connect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),n.next=4,this.initializing;case 4:return n.abrupt("return",this.store.size>0);case 5:case"end":return n.stop()}},n,this)}))}},{key:"cachedConnect",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,n,i,r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(new Date).getTime(),n="ccf-database.last_modified",i="ccf-database",e.next=5,xW(n).catch(function(){});case 5:if(!((r=e.sent)&&t-new Date(+r).getTime()>36e5)){e.next=11;break}return e.next=9,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kW();return t("readwrite",function(t){return e.forEach(function(e){return t.delete(e)}),wW(t.transaction)})}([i,n]).catch(function(){});case 9:e.next=14;break;case 11:return e.next=13,xW(i).catch(function(){});case 13:o=e.sent;case 14:if(!o){e.next=19;break}return e.next=17,this.deserialize(o);case 17:e.next=22;break;case 19:return e.next=21,this.doConnect();case 21:(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kW();return t("readwrite",function(t){return e.forEach(function(e){return t.put(e[1],e[0])}),wW(t.transaction)})})([[i,this.serialize()],[n,""+t]]).catch(function(){});case 22:case"end":return e.stop()}},e,this)}))}},{key:"doConnect",value:function(){var e,t;return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,r,o,a,s=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],!(o=this.options.ccfOwlUrl).endsWith(".n3store.json")){n.next=8;break}return n.next=4,fetch(o).then(function(e){return e.text()}).catch(function(){return console.log("Couldn't locate serialized store.")});case 4:(a=n.sent)&&(this.store=(0,SW.deserializeN3Store)(a,SW.DataFactory)),n.next=9;break;case 8:(null==o?void 0:o.length)>0&&r.push(o);case 9:return this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(aq(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(function(e){if(e)return s.addDataSources([e])}))),i.push(this.addDataSources(r)),n.next=13,Promise.all(i);case 13:return n.next=15,this.synchronize();case 15:case"end":return n.stop()}},n,this)}))}},{key:"addDataSources",value:function(e,t){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,r=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=null!=t?t:this.store,n.next=3,Promise.all(e.map(function(e){return yw(r,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!=typeof e){t.next=17;break}if(!e.endsWith("jsonld")){t.next=6;break}return t.next=4,(0,SW.addJsonLdToStore)(e,i);case 4:t.next=15;break;case 6:if(!e.endsWith("n3")){t.next=11;break}return t.next=9,(0,SW.addN3ToStore)(e,i);case 9:t.next=15;break;case 11:if(t.t0=e.endsWith("rdf")||e.endsWith("owl")||e.endsWith("xml"),!t.t0){t.next=15;break}return t.next=15,(0,SW.addRdfXmlToStore)(e,i);case 15:t.next=19;break;case 17:return t.next=19,(0,SW.addJsonLdToStore)(e,i);case 19:case"end":return t.stop()}},t)}))}));case 3:return n.abrupt("return",this);case 4:case"end":return n.stop()}},n,this)}))}},{key:"synchronize",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise(function(e){setTimeout(e,500)});case 2:return this.graph.createGraph(),e.abrupt("return",this);case 4:case"end":return e.stop()}},e,this)}))}},{key:"serialize",value:function(){return(0,SW.serializeN3Store)(this.store)}},{key:"deserialize",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.store=(0,SW.deserializeN3Store)(e,SW.DataFactory),this.graph=new QW(this),this.scene=new $W(this),t.next=5,new Promise(function(e){setTimeout(e,10)});case 5:case"end":return t.stop()}},t,this)}))}},{key:"getIds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){var n,i,r,o,a,s=function(e){var t=new Set;return e.forSubjects(function(e){return t.add(e.id)},RW.spatialEntity,null,null),t}(e);if(s.size>0&&(s=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=new Set;if(e.forSubjects(uq(t,i),RW.spatialEntity,null,null),!n){var r=new Set;return t.forEach(function(e){return i.has(e)?void 0:r.add(e)}),r}return i}(e,s)),s.size>0&&("Male"===t.sex||"Female"===t.sex)){var u=t.sex;s=sq(e,s,function(t){return function(e,t,n){var i=new Set;return e.forSubjects(uq(t,i),RW.sex,RW[n],null),i}(e,t,u)})}if(s.size>0&&(null===(n=t.tmc)||void 0===n?void 0:n.length)>0&&(s=sq(e,s,function(n){return function(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=SW.DataFactory.literal(a);e.forSubjects(uq(t,r),RW.providerName,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,n,t.tmc)})),s.size>0&&(null===(i=t.technologies)||void 0===i?void 0:i.length)>0&&(s=function(e,t,n){var i,r=new Map,o=new Set,a=new Set;e.some(function(e){return t.has(e.subject.id)&&a.add(e.object.id),!1},null,RW.sections,null,null),e.some(function(e){var n;return(t.has(e.subject.id)||a.has(e.subject.id))&&(o.add(e.object.id),r.has(e.object.id)?null===(n=r.get(e.object.id))||void 0===n||n.push(e.subject.id):r.set(e.object.id,[e.subject.id])),!1},null,RW.datasets,null,null);var s,u=n(o),c=new Set,l=_(u);try{for(l.s();!(s=l.n()).done;){var h,f=s.value,d=_(null!==(i=r.get(f))&&void 0!==i?i:[]);try{for(d.s();!(h=d.n()).done;){var p=h.value;c.add(p)}}catch(v){d.e(v)}finally{d.f()}}}catch(v){l.e(v)}finally{l.f()}return c}(e,s,function(n){return function(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=SW.DataFactory.literal(a);e.forSubjects(uq(t,r),RW.technology,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,n,t.technologies)})),s.size>0&&(null===(r=t.ontologyTerms)||void 0===r?void 0:r.length)>0&&(s=function(e,t,n){var i,r=new Map,o=new Set;e.some(function(e){var n;return t.has(e.subject.id)&&(o.add(e.object.id),r.has(e.object.id)?null===(n=r.get(e.object.id))||void 0===n||n.push(e.subject.id):r.set(e.object.id,[e.subject.id])),!1},null,RW.spatialEntity,null,null);var a,s=n(o),u=new Set,c=_(s);try{for(c.s();!(a=c.n()).done;){var l,h=a.value,f=_(null!==(i=r.get(h))&&void 0!==i?i:[]);try{for(f.s();!(l=f.n()).done;){var d=l.value;u.add(d)}}catch(p){f.e(p)}finally{f.f()}}}catch(p){c.e(p)}finally{c.f()}return u}(e,s,function(n){return function(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=SW.DataFactory.namedNode(a);e.forSubjects(uq(t,r),NW.spatialEntity.ccf_annotations,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,n,t.ontologyTerms)})),s.size>0&&2===(null===(o=t.ageRange)||void 0===o?void 0:o.length)&&(0,TW.isFinite)(t.ageRange[0])&&(0,TW.isFinite)(t.ageRange[1])){var c=Math.max.apply(Math,v(t.ageRange)),l=Math.min.apply(Math,v(t.ageRange));1===l&&110===c||(s=sq(e,s,function(t){return function(e,t,n,i){var r=new Set;return e.some(function(e){if(t.has(e.subject.id)){var o=(0,AW.fromRdf)(e.object);o>=n&&o<=i&&r.add(e.subject.id)}return!1},null,RW.age,null,null),r}(e,t,l,c)}))}if(s.size>0&&2===(null===(a=t.bmiRange)||void 0===a?void 0:a.length)&&(0,TW.isFinite)(t.bmiRange[0])&&(0,TW.isFinite)(t.bmiRange[1])){var h=Math.max.apply(Math,v(t.bmiRange)),f=Math.min.apply(Math,v(t.bmiRange));13===f&&83===h||(s=sq(e,s,function(t){return function(e,t,n,i){var r=new Set;return e.some(function(e){if(t.has(e.subject.id)){var o=(0,AW.fromRdf)(e.object);o>=n&&o<=i&&r.add(e.subject.id)}return!1},null,RW.bmi,null,null),r}(e,t,f,h)}))}return s}(this.store,e)}},{key:"get",value:function(e){return this.store.getQuads(SW.DataFactory.namedNode(e),null,null,null)}},{key:"search",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v(this.getIds(t)).map(function(t){return e.get(t)})}},{key:"getSpatialEntities",value:function(e){var t=this;return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),v(this.getIds(e)).map(function(e){return YW(t.store,e)})}},{key:"getDatasetTechnologyNames",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t=new Set;return e.some(function(e){return t.add(e.object.value),!1},null,RW.technology,null,null),Array.from(t).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getProviderNames",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t=new Set;return e.some(function(e){return t.add(e.object.value),!1},null,RW.providerName,null,null),Array.from(t).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getTissueBlockResults",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),v(this.getIds(e)).map(function(e){return yq(n.store,e)})));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getAggregateResults",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",function(e,n){var i=new Set;n.some(function(t){return e.has(t.subject.id)&&i.add(t.object.id),!1},null,RW.donor,null,null);var r=new Set;n.some(function(e){return i.has(e.subject.id)&&r.add(e.object.id),!1},null,RW.providerUUID,null,null);var o=new Set;n.forSubjects(function(t){e.has(t.id)&&o.add(t.id)},RW.spatialEntity,null,null);var a=new Set;n.some(function(e){return o.has(e.subject.id)&&a.add(e.object.id),!1},null,RW.sections,null,null);var s=new Set;return n.some(function(e){var t=e.subject;return(o.has(t.id)||a.has(t.id))&&s.add(e.object.id),!1},null,RW.datasets,null,null),Object.entries({"Tissue Data Providers":r.size,Donors:i.size,"Tissue Blocks":o.size,"Tissue Sections":a.size,"Tissue Datasets":s.size}).map(function(e){var n=t(e,2);return{label:n[0],count:n[1]}})}(this.getIds(e),this.store));case 1:case"end":return n.stop()}},n,this)}))}},{key:"getOntologyTermOccurences",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var n=new Map;t.some(function(t){return e.has(t.subject.id)&&(n.has(t.object.id)?n.get(t.object.id).push(t.subject.id):n.set(t.object.id,[t.subject.id])),!1},null,RW.spatialEntity,null,null);var i={};return t.some(function(e){var t,r;if(n.has(e.subject.id)){var o=null!==(r=null===(t=n.get(e.subject.id))||void 0===t?void 0:t.length)&&void 0!==r?r:0;i[e.object.id]=o+(i[e.object.id]||0)}return!1},null,NW.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getOntologyTreeModel",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t={root:jW.body.id,nodes:{}},n=new Set;e.some(function(e){return n.add(e.subject.id),n.add(e.predicate.id),!1},null,NW.ontologyNode.parent,null,null);var i,r=_(n);try{for(r.s();!(i=r.n()).done;){var o=i.value;t.nodes[o]=lq(e,o)}}catch(a){r.e(a)}finally{r.f()}return t}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getReferenceOrgans",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.scene.getReferenceOrgans());case 1:case"end":return e.stop()}},e,this)}))}},{key:"getScene",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(this.graph.createGraph(),this.scene.getScene(e)));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getReferenceOrganScene",value:function(e,t){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)));case 1:case"end":return n.stop()}},n,this)}))}}]),e}(),wq=Symbol("Comlink.proxy"),kq=Symbol("Comlink.endpoint"),xq=Symbol("Comlink.releaseProxy"),Sq=Symbol("Comlink.thrown"),Eq=function(e){return"object"==typeof e&&null!==e||"function"==typeof e},Cq=new Map([["proxy",{canHandle:function(e){return Eq(e)&&e[wq]},serialize:function(e){var t=new MessageChannel,n=t.port1,i=t.port2;return Oq(e,n),[i,[i]]},deserialize:function(e){return e.start(),Aq(e)}}],["throw",{canHandle:function(e){return Eq(e)&&Sq in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}}]]);function Oq(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;n.addEventListener("message",function i(r){if(r&&r.data){var a,s=Object.assign({path:[]},r.data),u=s.id,c=s.type,l=s.path,f=(r.data.argumentList||[]).map(Lq);try{var d=l.slice(0,-1).reduce(function(e,t){return e[t]},e),p=l.reduce(function(e,t){return e[t]},e);switch(c){case"GET":a=p;break;case"SET":d[l.slice(-1)[0]]=Lq(r.data.value),a=!0;break;case"APPLY":a=p.apply(d,f);break;case"CONSTRUCT":a=function(e){return Object.assign(e,o({},wq,!0))}(h(p,v(f)));break;case"ENDPOINT":var g=new MessageChannel,m=g.port1,y=g.port2;Oq(e,y),a=function(e,t){return Dq.set(e,t),e}(m,[m]);break;case"RELEASE":a=void 0;break;default:return}}catch(d){a=o({value:d},Sq,0)}Promise.resolve(a).catch(function(e){return o({value:e},Sq,0)}).then(function(e){var r=t(Nq(e),2),o=r[0],a=r[1];n.postMessage(Object.assign(Object.assign({},o),{id:u}),a),"RELEASE"===c&&(n.removeEventListener("message",i),Tq(n))})}}),n.start&&n.start()}function Tq(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function Aq(e,t){return Mq(e,[],t)}function Pq(e){if(e)throw new Error("Proxy has been released and is not useable")}function Mq(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=!1,o=new Proxy(i,{get:function(t,i){if(Pq(r),i===xq)return function(){return jq(e,{type:"RELEASE",path:n.map(function(e){return e.toString()})}).then(function(){Tq(e),r=!0})};if("then"===i){if(0===n.length)return{then:function(){return o}};var a=jq(e,{type:"GET",path:n.map(function(e){return e.toString()})}).then(Lq);return a.then.bind(a)}return Mq(e,[].concat(v(n),[i]))},set:function(i,o,a){Pq(r);var s=t(Nq(a),2),u=s[0],c=s[1];return jq(e,{type:"SET",path:[].concat(v(n),[o]).map(function(e){return e.toString()}),value:u},c).then(Lq)},apply:function(i,o,a){Pq(r);var s=n[n.length-1];if(s===kq)return jq(e,{type:"ENDPOINT"}).then(Lq);if("bind"===s)return Mq(e,n.slice(0,-1));var u=t(Rq(a),2),c=u[0],l=u[1];return jq(e,{type:"APPLY",path:n.map(function(e){return e.toString()}),argumentList:c},l).then(Lq)},construct:function(i,o){Pq(r);var a=t(Rq(o),2),s=a[0],u=a[1];return jq(e,{type:"CONSTRUCT",path:n.map(function(e){return e.toString()}),argumentList:s},u).then(Lq)}});return o}function Iq(e){return Array.prototype.concat.apply([],e)}function Rq(e){var t=e.map(Nq);return[t.map(function(e){return e[0]}),Iq(t.map(function(e){return e[1]}))]}var Dq=new WeakMap;function Nq(e){var n,i=_(Cq);try{for(i.s();!(n=i.n()).done;){var r=t(n.value,2),o=r[0],a=r[1];if(a.canHandle(e)){var s=t(a.serialize(e),2);return[{type:"HANDLER",name:o,value:s[0]},s[1]]}}}catch(u){i.e(u)}finally{i.f()}return[{type:"RAW",value:e},Dq.get(e)||[]]}function Lq(e){switch(e.type){case"HANDLER":return Cq.get(e.name).deserialize(e.value);case"RAW":return e.value}}function jq(e,t,n){return new Promise(function(i){var r=new Array(4).fill(0).map(function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}).join("-");e.addEventListener("message",function t(n){!n.data||!n.data.id||n.data.id!==r||(e.removeEventListener("message",t),i(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:r},t),n)})}function Fq(e,t){return e===t}var Bq=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.locator=n,this.subscriptions=new W,this.dataSource=t.config$.pipe(od(function(e){return Object.keys(e).length>0}),ue(function(e){return e}),Qf(Fq),dd(function(e){return t=function(t){return i.connectDataSource(t.source,e)},new ee(function(e){var n,r;try{n=i.createDataSource()}catch(a){return void e.error(a)}try{r=t(n)}catch(a){return void e.error(a)}var o=(r?me(r):md).subscribe(e);return function(){o.unsubscribe(),n&&n.unsubscribe()}});var t}),Od(1))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"getTissueBlockResults",value:function(e){return this.dataSource.pipe(dd(function(t){return t.getTissueBlockResults(e)}),ap(1))}},{key:"getDatasetTechnologyNames",value:function(){return this.dataSource.pipe(dd(function(e){return e.getDatasetTechnologyNames()}),ap(1))}},{key:"getProviderNames",value:function(){return this.dataSource.pipe(dd(function(e){return e.getProviderNames()}),ap(1))}},{key:"getAggregateResults",value:function(e){return this.dataSource.pipe(dd(function(t){return t.getAggregateResults(e)}),ap(1))}},{key:"getOntologyTermOccurences",value:function(e){return this.dataSource.pipe(dd(function(t){return t.getOntologyTermOccurences(e)}),ap(1))}},{key:"getOntologyTreeModel",value:function(){return this.dataSource.pipe(dd(function(e){return e.getOntologyTreeModel()}),ap(1))}},{key:"getReferenceOrgans",value:function(){return this.dataSource.pipe(dd(function(e){return e.getReferenceOrgans()}),ap(1))}},{key:"getScene",value:function(e){return this.dataSource.pipe(dd(function(t){return t.getScene(e)}),ap(1))}},{key:"createDataSource",value:function(){var e,t,n,i=this,r=function(){};"undefined"==typeof Worker||dW.disableDbWorker?e=new _q:(t=this.getWebWorkerDataSource(!0),e=t.source,n=t.worker,r=function(){return yw(i,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e[xq]();case 2:n.terminate();case 3:case"end":return t.stop()}},t)}))});return{source:e,unsubscribe:r}}},{key:"connectDataSource",value:function(e,t){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=dW.disableDbWorker,!n.t0){n.next=4;break}return n.next=4,new Promise(function(e){setTimeout(e,100)});case 4:return i=(new Date).getTime(),n.next=7,e.connect(t,!0);case 7:return dW.production||console.info("Loaded CCF database in ".concat(((new Date).getTime()-i)/1e3,"s")),n.abrupt("return",e);case 9:case"end":return n.stop()}},n)}))}},{key:"getWebWorkerDataSource",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t)e=new Worker(r.tu(new URL(r.p+r.u(10),r.b)),{type:void 0});else{var n=this.locator.prepareExternalUrl("0-es2015.worker.js"),i=new Blob(["importScripts('".concat(n,"')")],{type:"application/javascript"});e=new Worker(URL.createObjectURL(i),{type:"module"})}return{source:Aq(e),worker:e}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(tW),Qi(wh))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac,providedIn:"root"}),e}();function Vq(e,t,n,i){n&&"function"!=typeof n&&(i=n);var r="function"==typeof n?n:void 0,o=new Ed(e,t,i);return function(e){return Re(function(){return o},r)(e)}}var zq=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},Uq=function(e){return e.map(function(e){return void 0!==e?JSON.parse(JSON.stringify(e)):e})},Hq={storageStrategy:function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).cachePairs=[],e}return b(n,[{key:"add",value:function(e,t,n){this.cachePairs.push(e)}},{key:"addMany",value:function(e){this.cachePairs=e}},{key:"updateAtIndex",value:function(e,t){Object.assign(this.cachePairs[e],t)}},{key:"update",value:function(e,t){Object.assign(this.cachePairs[e],t)}},{key:"getAll",value:function(){return this.cachePairs}},{key:"removeAtIndex",value:function(e){this.cachePairs.splice(e,1)}},{key:"remove",value:function(e){this.cachePairs.splice(e,1)}},{key:"removeAll",value:function(){this.cachePairs.length=0}}]),n}(function(){return function e(){m(this,e)}}()),globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},Gq=new oe;function Wq(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,n,i){var r=this,o=e.cacheKey||t.constructor.name+"#"+n,a=i.value;if(i&&i.value){var s=e.storageStrategy?new e.storageStrategy:new Hq.storageStrategy,u=[];e.cacheModifier&&e.cacheModifier.subscribe(function(e){return s.addMany(e(s.getAll(o,r)),o,r)}),Ce(Gq.asObservable(),e.cacheBusterObserver?e.cacheBusterObserver:yd()).subscribe(function(e){s.removeAll(o,r),u.length=0}),e.cacheResolver=e.cacheResolver||Hq.cacheResolver||zq,e.cacheHasher=e.cacheHasher||Hq.cacheHasher||Uq,i.value=function(){for(var t=this,n=s.getAll(o,this),i=arguments.length,r=new Array(i),c=0;c(e.maxAge||Hq.maxAge)?(s.remove?s.remove(n.indexOf(h),h,o,this):s.removeAtIndex(n.indexOf(h),o,this),h=null):(e.slidingExpiration||Hq.slidingExpiration)&&(h.created=new Date,s.update?s.update(n.indexOf(h),h,o,this):s.updateAtIndex(n.indexOf(h),h,o,this))),h){var d=jf(h.response);return e.async?d.pipe(Hz(0)):d}if(f)return f.response;var p=a.call.apply(a,[this].concat(r)).pipe(Cb(function(){var t=u.find(function(t){return e.cacheResolver(t.parameters,l)});u.splice(u.indexOf(t),1)}),rv(function(i){(!e.shouldCacheDecider||e.shouldCacheDecider(i))&&((!(e.maxCacheCount||Hq.maxCacheCount)||1===(e.maxCacheCount||Hq.maxCacheCount)||(e.maxCacheCount||Hq.maxCacheCount)&&(e.maxCacheCount||Hq.maxCacheCount)0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).sort().reduce(function(t,n){var i=e[n];return function(e){return null==e||""===e||Array.isArray(e)&&0===e.length}(i)?t:t.set(n,function(e){return Array.isArray(e)?e.join(","):"".concat(e)}(i))},new jb)}},{key:"withToken",value:function(e){var t=this.globalConfig.snapshot.hubmapToken;return t?e.set("token",t):e}}]),e}();qq.\u0275fac=function(e){return new(e||qq)(Qi(tW),Qi(Kb))},qq.\u0275prov=Ke({token:qq,factory:qq.\u0275fac,providedIn:"root"}),vw([Wq()],qq.prototype,"getProviderNames",null),vw([Wq()],qq.prototype,"getDatasetTechnologyNames",null),vw([Wq()],qq.prototype,"getOntologyTreeModel",null),vw([Wq()],qq.prototype,"getReferenceOrgans",null),vw([Wq()],qq.prototype,"getTissueBlockResults",null),vw([Wq()],qq.prototype,"getAggregateResults",null),vw([Wq()],qq.prototype,"getOntologyTermOccurences",null),vw([Wq()],qq.prototype,"getScene",null);var Xq=function(){var e=function(){function e(t,n,i){m(this,e),this.impl$=t.config$.pipe(ue(function(e){return!!e.useRemoteApi&&!!e.remoteApiEndpoint}),ue(function(e){return e?i:n}),Qf(),Od(1))}return b(e,[{key:"getProviderNames",value:function(){return this.forwardCall("getProviderNames")}},{key:"getDatasetTechnologyNames",value:function(){return this.forwardCall("getDatasetTechnologyNames")}},{key:"getOntologyTreeModel",value:function(){return this.forwardCall("getOntologyTreeModel")}},{key:"getReferenceOrgans",value:function(){return this.forwardCall("getReferenceOrgans")}},{key:"getTissueBlockResults",value:function(e){return this.forwardCall("getTissueBlockResults",e)}},{key:"getAggregateResults",value:function(e){return this.forwardCall("getAggregateResults",e)}},{key:"getOntologyTermOccurences",value:function(e){return this.forwardCall("getOntologyTermOccurences",e)}},{key:"getScene",value:function(e){return this.forwardCall("getScene",e)}},{key:"forwardCall",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:[];return{ngModule:e,providers:[JH,ZH,QH].concat(v(t))}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(JH,2),Qi(ZH,2))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),$q=function(e,t){return function(e,t){return new Array(t+1).join("0")}(0,t-e.toString().length)+e},Zq=function(){function e(t,n,i){m(this,e),this.action=t,this.store=n,this.logWriter=i}return b(e,[{key:"dispatched",value:function(e){var t=bB(this.action),n=function(e){return $q(e.getHours(),2)+":"+$q(e.getMinutes(),2)+":"+$q(e.getSeconds(),2)+"."+$q(e.getMilliseconds(),3)}(new Date);this.logWriter.startGroup("action ".concat(t," @ ").concat(n)),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}},{key:"completed",value:function(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}},{key:"errored",value:function(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}},{key:"_hasPayload",value:function(e){return this._getNonEmptyProperties(e).length>0}},{key:"_getNonEmptyProperties",value:function(e){return Object.keys(e).map(function(t){return e[t]}).filter(function(e){return void 0!==e})}}]),e}(),Jq=function(){function e(t){m(this,e),this.options=t,this.options=this.options||{},this.logger=t.logger||console}return b(e,[{key:"startGroup",value:function(e){var t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(n){console.log(e)}}},{key:"endGroup",value:function(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}},{key:"logGrey",value:function(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}},{key:"logGreen",value:function(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}},{key:"logRedish",value:function(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}},{key:"log",value:function(e,t,n){this.isIE()?this.logger.log(e,n):this.logger.log("%c "+e,t,n)}},{key:"isIE",value:function(){var e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"",t=!1,n=e.indexOf("MSIE "),i=e.indexOf("Trident/");return(n>-1||i>-1)&&(t=!0),t}}]),e}(),eX=new Mi("NGXS_LOGGER_PLUGIN_OPTIONS"),tX=function(){var e=function(){function e(t,n){m(this,e),this._options=t,this._injector=n}return b(e,[{key:"handle",value:function(e,t,n){if(this._options.disabled||!this._options.filter(t,e))return n(e,t);this._logWriter=this._logWriter||new Jq(this._options),this._store=this._store||this._injector.get(qB);var i=new Zq(t,this._store,this._logWriter);return i.dispatched(e),n(e,t).pipe(rv(function(e){i.completed(e)}),xb(function(e){throw i.errored(e),e}))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(eX),Qi(os))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),nX=new Mi("LOGGER_USER_OPTIONS");function iX(e){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:function(){return!0}},e)}var rX=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(t){return{ngModule:e,providers:[{provide:hB,useClass:tX,multi:!0},{provide:nX,useValue:t},{provide:eX,useFactory:iX,deps:[nX]}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),oX=new RegExp("[^#a-f\\d]","gi"),aX=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),sX=["#FF8800","#2979ff","#ffd740","#b92dff","#da326f","#7323e2","#acf32b","#82B1FF","#E040FB","#00E5FF"].map(function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e||oX.test(e)||!aX.test(e))throw new TypeError("Expected a valid hex string");var n=1;8===(e=e.replace(/^#/,"")).length&&(n=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),4===e.length&&(n=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var i=Number.parseInt(e,16),r=i>>16,o=i>>8&255,a=255&i,s="number"==typeof t.alpha?t.alpha:n;return"array"===t.format?[r,o,a,s]:"css"===t.format?"rgb(".concat(r," ").concat(o," ").concat(a).concat(1===s?"":" / ".concat(Number((100*s).toFixed(2)),"%"),")"):{red:r,green:o,blue:a,alpha:s}}(e,{format:"array"});return n[3]=255,{color:e,rgba:n,rank:t}}),uX=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).forcedUnassignment=new oe,e.forcedUnassignment$=e.forcedUnassignment.asObservable(),e.colorAssignments$=e.state$.pipe(mU("colorAssignments"),Qf()),e.colorAssignmentsList$=e.state$.pipe(mU("colorAssignmentsList"),Qf()),e}return b(n,[{key:"getColor",value:function(e){return this.snapshot.colorAssignments[e]}},{key:"assignColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.snapshot,i=n.colorAssignments,r=n.colorAssignmentsList,o=n.colorsAvailable;t&&(o=this.snapshot.colorPalette.concat(),r=[],i={});var a=i[e];return a||(o.length>0?a=o[0]:(a=r[r.length-1].color,r=r.slice(0,-1),this.forcedUnassignment.next()),o=o.filter(function(e){return e.color!==a.color}),i=(r=[{color:a,key:e}].concat(r)).reduce(function(e,t,n){return e[t.key]=Object.assign(Object.assign({},t.color),{rank:n}),e},{}),this.ctx.patchState({colorsAvailable:o,colorAssignments:i,colorAssignmentsList:r})),a}},{key:"unassignColor",value:function(e){var t=this.snapshot,n=t.colorAssignments,i=t.colorAssignmentsList,r=t.colorsAvailable,o=n[e];o&&(r=[o].concat(r),n=(i=i.filter(function(e){return e.color.color!==o.color})).reduce(function(e,t,n){return e[t.key]=Object.assign(Object.assign({},t.color),{rank:n}),e},{}),this.ctx.patchState({colorsAvailable:r,colorAssignments:n,colorAssignmentsList:i}))}}]),n}(bG);function cX(e,t){return function(n){return n.lift(new lX(e,t))}}uX.\u0275fac=function(){var e;return function(t){return(e||(e=Ci(uX)))(t||uX)}}(),uX.\u0275prov=Ke({token:uX,factory:uX.\u0275fac}),vw([pG(),gw(0,vG("key")),gw(1,vG("doReset"))],uX.prototype,"assignColor",null),vw([pG(),gw(0,vG("key"))],uX.prototype,"unassignColor",null),uX=vw([gG(),eV({name:"colors",defaults:{colorPalette:sX.concat(),colorsAvailable:sX.concat(),colorAssignments:{},colorAssignmentsList:[]}})],uX);var lX=function(){function e(t,n){m(this,e),this.keySelector=t,this.flushes=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new hX(e,this.keySelector,this.flushes))}}]),e}(),hX=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).keySelector=i,o.values=new Set,r&&o.add(_e(r,new ye(c(o)))),o}return b(n,[{key:"notifyNext",value:function(){this.values.clear()}},{key:"notifyError",value:function(e){this._error(e)}},{key:"_next",value:function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)}},{key:"_useKeySelector",value:function(e){var t,n=this.destination;try{t=this.keySelector(e)}catch(i){return void n.error(i)}this._finalizeNext(t,e)}},{key:"_finalizeNext",value:function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))}}]),n}(be),fX={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"]},dX=(function(e){e.Running="running",e.Completed="completed"}(dX||(dX={})),dX);function pX(e){return function(){return e.next(dX.Completed)}}function vX(e,t){return function(n){return n.pipe(dd(e),rv(t),Vq(1),Oe())}}var gX=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).source=e,i._tissueBlockDataQueryStatus$=new Ed(1),i._aggregateDataQueryStatus$=new Ed(1),i._termOccurencesDataQueryStatus$=new Ed(1),i._sceneDataQueryStatus$=new Ed(1),i._technologyFilterQueryStatus$=new Ed(1),i._providerFilterQueryStatus$=new Ed(1),i.ontologyTermsFullData$=new Ed(1),i.filter$=i.state$.pipe(mU("filter")),i.tissueBlockData$=i.filter$.pipe(vX(i.tissueBlockData,pX(i._tissueBlockDataQueryStatus$))),i.aggregateData$=i.filter$.pipe(vX(i.aggregateData,pX(i._aggregateDataQueryStatus$))),i.termOccurencesData$=i.filter$.pipe(vX(i.termOccurencesData,pX(i._termOccurencesDataQueryStatus$))),i.sceneData$=i.filter$.pipe(vX(i.sceneData,pX(i._sceneDataQueryStatus$))),i.technologyFilterData$=i.filter$.pipe(vX(i.technologyFilterData,pX(i._technologyFilterQueryStatus$))),i.providerFilterData$=i.filter$.pipe(vX(i.providerFilterData,pX(i._providerFilterQueryStatus$))),i.tissueBlockDataQueryStatus$=i._tissueBlockDataQueryStatus$.pipe(cX()),i.aggregateDataQueryStatus$=i._aggregateDataQueryStatus$.pipe(cX()),i.termOccurencesDataQueryStatus$=i._termOccurencesDataQueryStatus$.pipe(cX()),i.sceneDataQueryStatus$=i._sceneDataQueryStatus$.pipe(cX()),i.technologyFilterQueryStatus$=i._technologyFilterQueryStatus$.pipe(cX()),i.providerFilterQueryStatus$=i._providerFilterQueryStatus$.pipe(cX()),i.queryStatus$=j_([i.tissueBlockDataQueryStatus$,i.aggregateDataQueryStatus$,i.termOccurencesDataQueryStatus$,i.sceneDataQueryStatus$,i.technologyFilterQueryStatus$,i.providerFilterQueryStatus$]).pipe(ue(function(e){return function(e){return e.every(function(e){return e===dX.Completed})}(e)?dX.Completed:dX.Running}),cX()),i._tissueBlockDataQueryStatus$.next(dX.Completed),i._aggregateDataQueryStatus$.next(dX.Completed),i._termOccurencesDataQueryStatus$.next(dX.Completed),i._sceneDataQueryStatus$.next(dX.Completed),i._technologyFilterQueryStatus$.next(dX.Completed),i._providerFilterQueryStatus$.next(dX.Completed),i}return b(n,[{key:"ngxsOnInit",value:function(){var e=this.ontologyTermsFullData$,t=this.termOccurencesData$,n=this.source;this.snapshot.filter===fX?t.pipe(ap(1)).subscribe(e):n.getOntologyTermOccurences().pipe(ap(1)).subscribe(e)}},{key:"updateFilter",value:function(e){this.patchState({filter:Object.assign(Object.assign({},this.getState().filter),e)})}},{key:"tissueBlockData",value:function(e){return this._tissueBlockDataQueryStatus$.next(dX.Running),this.source.getTissueBlockResults(e)}},{key:"aggregateData",value:function(e){return this._aggregateDataQueryStatus$.next(dX.Running),this.source.getAggregateResults(e)}},{key:"termOccurencesData",value:function(e){return this._termOccurencesDataQueryStatus$.next(dX.Running),this.source.getOntologyTermOccurences(e)}},{key:"sceneData",value:function(e){return this._sceneDataQueryStatus$.next(dX.Running),this.source.getScene(e)}},{key:"technologyFilterData",value:function(){return this._technologyFilterQueryStatus$.next(dX.Running),this.source.getDatasetTechnologyNames()}},{key:"providerFilterData",value:function(){return this._providerFilterQueryStatus$.next(dX.Running),this.source.getProviderNames()}}]),n}(yG);gX.\u0275fac=function(e){return new(e||gX)(Qi(Yq))},gX.\u0275prov=Ke({token:gX,factory:gX.\u0275fac}),vw([pG(),gw(0,vG("filter"))],gX.prototype,"updateFilter",null),vw([OF.ak],gX.prototype,"tissueBlockData",null),vw([OF.ak],gX.prototype,"aggregateData",null),vw([OF.ak],gX.prototype,"termOccurencesData",null),vw([OF.ak],gX.prototype,"sceneData",null),vw([OF.ak],gX.prototype,"technologyFilterData",null),vw([OF.ak],gX.prototype,"providerFilterData",null),gX=vw([gG(),eV({name:"data",defaults:{filter:fX}})],gX);var mX=[{name:"logo",namespace:"app",url:"assets/icons/app/hubmap-logo.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs_bladder.svg"},{name:"bone_marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs_brain.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs_heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs_kidney.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"large_intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs_liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs_lung.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lymph_nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small_intestine",namespace:"app",url:"assets/icons/organs/ico-organs_small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs_spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"vasculature",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"expand_more",namespace:"app",url:"assets/icons/expand_more-24px.svg"},{name:"expand_less",namespace:"app",url:"assets/icons/expand_less-24px.svg"},{name:"filter",url:"assets/icons/filter.svg"}],yX=function(e){a(n,e);var t=s(n);function n(e,i){var r;m(this,n),(r=t.call(this)).registry=e;var o,a=_(mX);try{for(a.s();!(o=a.n()).done;){var s=o.value,u=s.name,c=s.namespace,l=s.url,h=s.html,f={name:u,namespace:c,url:l&&i.bypassSecurityTrustResourceUrl(l),html:h&&i.bypassSecurityTrustHtml(h)};r.registerIconImpl(f)}}catch(d){a.e(d)}finally{a.f()}return r}return b(n,[{key:"registerIcon",value:function(e){return this.registerIconImpl(e)}},{key:"registerIconImpl",value:function(e){if(!this.registry||!e.url&&!e.html)return!1;var t=this.registry,n=t[this.getMethodName(e)],i=this.getArguments(e);if(!n)return!1;try{return n.apply(t,i),!0}catch(r){return!1}}},{key:"getMethodName",value:function(e){var t=e.name,n=e.namespace,i=e.url,r=["addSvgIcon"];return t||r.push("Set"),i||r.push("Literal"),n&&r.push("InNamespace"),r.join("")}},{key:"getArguments",value:function(e){var t=e.name,n=e.namespace,i=e.url,r=e.html;return[n,t,null!=i?i:r].filter(function(e){return!!e})}}]),n}(yG);yX.\u0275fac=function(e){return new(e||yX)(Qi(p_,8),Qi(Of))},yX.\u0275prov=Ke({token:yX,factory:yX.\u0275fac}),vw([pG()],yX.prototype,"registerIcon",null),yX=vw([gG(),eV({name:"iconRegistry"})],yX);var bX=function(n){a(r,n);var i=s(r);function r(e,t){var n;return m(this,r),(n=i.call(this)).dataService=e,n.injector=t,n.listResults$=n.state$.pipe(mU("listResults"),Qf()),n.highlightedNodeId$=n.state$.pipe(mU("highlightedNodeId"),Qf()),n}return b(r,[{key:"setListResults",value:function(e){this.ctx.patchState({listResults:e})}},{key:"selectListResult",value:function(e){this.colorAssignments.assignColor(e.tissueBlock.spatialEntityId)}},{key:"deselectListResult",value:function(e){this.colorAssignments.unassignColor(e.tissueBlock.spatialEntityId)}},{key:"highlightNode",value:function(e){this.ctx.patchState({highlightedNodeId:e})}},{key:"unHighlightNode",value:function(){this.ctx.patchState({highlightedNodeId:void 0})}},{key:"ngxsOnInit",value:function(){var n=this;e(p(r.prototype),"ngxsOnInit",this).call(this),this.dataState=this.injector.get(gX),this.colorAssignments=this.injector.get(uX),j_([this.dataState.tissueBlockData$,this.colorAssignments.colorAssignments$]).pipe(ue(function(e){var n,i=t(e,2),r=i[0],o=i[1],a=[],s=[],u=_(r);try{for(u.s();!(n=u.n()).done;){var c=n.value,l=o[c.spatialEntityId];l?a.push({selected:!0,color:l.color,tissueBlock:c,rank:l.rank}):s.push({selected:!1,tissueBlock:c})}}catch(h){u.e(h)}finally{u.f()}return(0,TW.sortBy)(a,["rank"]).concat(s)}),rv(function(e){return n.setListResults(e)})).subscribe()}}]),r}(bG);function _X(e,t,n){t[n.id]=n,(0,TW.forEach)(n.children,function(n){return _X(e,t,e[n])})}function wX(e,t){var n={"@id":e.root,"@type":"OntologyTreeNode",id:e.root,label:"body",parent:"",children:t,synonymLabels:[]},i=(0,TW.at)(e.nodes,t),r=o({},n.id,n);return(0,TW.forEach)(i,function(e){return e.parent=n.id}),(0,TW.forEach)(i,function(t){return _X(e.nodes,r,t)}),{root:n.id,nodes:r}}bX.\u0275fac=function(e){return new(e||bX)(Qi(Yq),Qi(os))},bX.\u0275prov=Ke({token:bX,factory:bX.\u0275fac}),vw([pG(),gw(0,vG("listResults"))],bX.prototype,"setListResults",null),bX=vw([gG(),eV({name:"listResults",defaults:{listResults:[]}})],bX);var kX=function(n){a(r,n);var i=s(r);function r(e){var t;return m(this,r),(t=i.call(this)).dataService=e,t.nodes$=t.state$.pipe(ue(function(e){return Object.values(e.nodes)})),t.rootNode$=t.state$.pipe(ue(function(e){return e.nodes[e.root]})),t}return b(r,[{key:"setOntology",value:function(e){this.ctx.setState(e)}},{key:"ngxsOnInit",value:function(){e(p(r.prototype),"ngxsOnInit",this).call(this),this.loadOntology()}},{key:"loadOntology",value:function(){var e=this;wb([this.dataService.getOntologyTreeModel().pipe(ap(1)),this.dataService.getReferenceOrgans().pipe(ap(1))]).subscribe(function(n){var i=t(n,2),r=i[0],o=(i[1],dW.organNodes.concat()),a=(0,TW.partial)(wX,TW.partial.placeholder,o)(r);e.setOntology(a)})}}]),r}(bG);kX.\u0275fac=function(e){return new(e||kX)(Qi(Yq))},kX.\u0275prov=Ke({token:kX,factory:kX.\u0275fac}),vw([pG()],kX.prototype,"setOntology",null),kX=vw([gG(),eV({name:"ontology",defaults:{root:"",nodes:{}}})],kX);var xX=new Set(["Skin","Heart","Kidney","Spleen"]),SX=function(n){a(r,n);var i=s(r);function r(e,t){var n;return m(this,r),(n=i.call(this)).dataService=e,n.injector=t,n.referenceOrgans$=n.state$.pipe(mU("referenceOrgans"),Qf()),n.selectedReferenceOrgans$=n.state$.pipe(mU("selectedReferenceOrgans"),Qf()),n.scene$=n.state$.pipe(mU("scene"),Qf()),n.highlightedId$=n.state$.pipe(mU("highlightedId"),Qf()),n}return b(r,[{key:"setSelectedReferenceOrgans",value:function(e){this.ctx.patchState({selectedReferenceOrgans:e})}},{key:"setReferenceOrgans",value:function(e){this.ctx.patchState({referenceOrgans:e})}},{key:"setScene",value:function(e){this.ctx.patchState({scene:e})}},{key:"sceneNodeClicked",value:function(e){var t=e.node,n=e.ctrlClick;t.representation_of&&"http://purl.org/ccf/latest/ccf.owl#VHFSkin"!==t["@id"]&&t.entityId?this.dataState.updateFilter({ontologyTerms:[t.representation_of]}):t.entityId&&this.colorAssignments.assignColor(t["@id"],!n)}},{key:"sceneNodeHovered",value:function(e){this.listResults.highlightNode(e["@id"])}},{key:"sceneNodeUnhover",value:function(){this.listResults.unHighlightNode()}},{key:"ngxsOnInit",value:function(){var n=this;e(p(r.prototype),"ngxsOnInit",this).call(this),this.dataState=this.injector.get(gX),this.colorAssignments=this.injector.get(uX),this.listResults=this.injector.get(bX),this.dataService.getReferenceOrgans().pipe(ue(function(e){var t=new Set(e.map(function(e){return e.representation_of}));return zG.filter(function(e){return t.has(e.id)}).map(function(e){return Object.assign(Object.assign({},e),{disabled:!1,numResults:0})})}),ap(1),rv(function(e){n.setReferenceOrgans(e),n.setSelectedReferenceOrgans(e.filter(function(e){return xX.has(e.organ)}))})).subscribe(),j_([this.dataState.sceneData$,this.selectedReferenceOrgans$,this.colorAssignments.colorAssignments$,this.dataService.getReferenceOrgans(),this.listResults.highlightedNodeId$]).pipe(ue(function(e){var n=t(e,5),i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],u=new Set(r.map(function(e){return e.id})),c=new Set(a.filter(function(e){return u.has(e.representation_of)}).map(function(e){return e["@id"]}));return i.filter(function(e){var t,n;return(null===(n=null===(t=e.ccf_annotations)||void 0===t?void 0:t.some)||void 0===n?void 0:n.call(t,function(e){return u.has(e)}))||e.reference_organ&&c.has(e.reference_organ)}).map(function(e){return e.entityId&&(Object.prototype.hasOwnProperty.call(o,e["@id"])||s===e["@id"])?Object.assign(Object.assign({},e),{color:s===e["@id"]?[30,136,229,255]:o[e["@id"]].rgba}):e})}),rv(function(e){return n.setScene(e)})).subscribe()}}]),r}(bG);SX.\u0275fac=function(e){return new(e||SX)(Qi(Yq),Qi(os))},SX.\u0275prov=Ke({token:SX,factory:SX.\u0275fac}),vw([pG(),gw(0,vG("selectedReferenceOrgans"))],SX.prototype,"setSelectedReferenceOrgans",null),vw([pG(),gw(0,vG("referenceOrgans"))],SX.prototype,"setReferenceOrgans",null),vw([pG(),gw(0,vG("scene"))],SX.prototype,"setScene",null),SX=vw([gG(),eV({name:"scene",defaults:{scene:[],referenceOrgans:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],SX);var EX=[tW,uX,yX,bX,gX,kX,SX],CX=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Qq.forRoot(),JB.forRoot(EX,{developmentMode:!dW.production}),rX.forRoot({disabled:dW.production})]]}),e}(),OX=function(){var e=function e(t){if(m(this,e),t)throw new Error("The core module should only be imported once in the root module")};return e.\u0275fac=function(t){return new(t||e)(Qi(e,12))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[{provide:Yq,useExisting:Xq}],imports:[[u_,IG.forRoot({gaToken:dW.googleAnalyticsToken,appName:"eui"}),nW,_W,CX,Kq],_W]}),e}(),TX=["input"],AX=function(e){return{enterDuration:e}},PX=["*"],MX=new Mi("mat-checkbox-default-options",{providedIn:"root",factory:IX});function IX(){return{color:"accent",clickAction:"check-indeterminate"}}var RX=0,DX={color:"accent",clickAction:"check-indeterminate"},NX={provide:iV,useExisting:Ue(function(){return FX}),multi:!0},LX=function e(){m(this,e)},jX=Ky(Xy(Yy(qy(function(){return function e(t){m(this,e),this._elementRef=t}}())))),FX=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u){var c;return m(this,n),(c=t.call(this,e))._changeDetectorRef=i,c._focusMonitor=r,c._ngZone=o,c._animationMode=s,c._options=u,c.ariaLabel="",c.ariaLabelledby=null,c._uniqueId="mat-checkbox-"+ ++RX,c.id=c._uniqueId,c.labelPosition="after",c.name=null,c.change=new Zc,c.indeterminateChange=new Zc,c._onTouched=function(){},c._currentAnimationClass="",c._currentCheckState=0,c._controlValueAccessorChangeFn=function(){},c._checked=!1,c._disabled=!1,c._indeterminate=!1,c._options=c._options||DX,c.color=c.defaultColor=c._options.color||DX.color,c.tabIndex=parseInt(a)||0,c}return b(n,[{key:"inputId",get:function(){return"".concat(this.id||this._uniqueId,"-input")}},{key:"required",get:function(){return this._required},set:function(e){this._required=If(e)}},{key:"ngAfterViewInit",value:function(){var e=this;this._focusMonitor.monitor(this._elementRef,!0).subscribe(function(t){t||Promise.resolve().then(function(){e._onTouched(),e._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}},{key:"ngAfterViewChecked",value:function(){}},{key:"ngOnDestroy",value:function(){this._focusMonitor.stopMonitoring(this._elementRef)}},{key:"checked",get:function(){return this._checked},set:function(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck())}},{key:"disabled",get:function(){return this._disabled},set:function(e){var t=If(e);t!==this.disabled&&(this._disabled=t,this._changeDetectorRef.markForCheck())}},{key:"indeterminate",get:function(){return this._indeterminate},set:function(e){var t=e!=this._indeterminate;this._indeterminate=If(e),t&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}},{key:"_isRippleDisabled",value:function(){return this.disableRipple||this.disabled}},{key:"_onLabelTextChange",value:function(){this._changeDetectorRef.detectChanges()}},{key:"writeValue",value:function(e){this.checked=!!e}},{key:"registerOnChange",value:function(e){this._controlValueAccessorChangeFn=e}},{key:"registerOnTouched",value:function(e){this._onTouched=e}},{key:"setDisabledState",value:function(e){this.disabled=e}},{key:"_getAriaChecked",value:function(){return this.checked?"true":this.indeterminate?"mixed":"false"}},{key:"_transitionCheckState",value:function(e){var t=this._currentCheckState,n=this._elementRef.nativeElement;if(t!==e&&(this._currentAnimationClass.length>0&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(t,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);var i=this._currentAnimationClass;this._ngZone.runOutsideAngular(function(){setTimeout(function(){n.classList.remove(i)},1e3)})}}},{key:"_emitChangeEvent",value:function(){var e=new LX;e.source=this,e.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(e),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}},{key:"toggle",value:function(){this.checked=!this.checked}},{key:"_onInputClick",value:function(e){var t,n=this,i=null===(t=this._options)||void 0===t?void 0:t.clickAction;e.stopPropagation(),this.disabled||"noop"===i?!this.disabled&&"noop"===i&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==i&&Promise.resolve().then(function(){n._indeterminate=!1,n.indeterminateChange.emit(n._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}},{key:"focus",value:function(e,t){e?this._focusMonitor.focusVia(this._inputElement,e,t):this._inputElement.nativeElement.focus(t)}},{key:"_onInteractionEvent",value:function(e){e.stopPropagation()}},{key:"_getAnimationClassForCheckStateTransition",value:function(e,t){if("NoopAnimations"===this._animationMode)return"";var n="";switch(e){case 0:if(1===t)n="unchecked-checked";else{if(3!=t)return"";n="unchecked-indeterminate"}break;case 2:n=1===t?"unchecked-checked":"unchecked-indeterminate";break;case 1:n=2===t?"checked-unchecked":"checked-indeterminate";break;case 3:n=1===t?"indeterminate-checked":"indeterminate-unchecked"}return"mat-checkbox-anim-".concat(n)}},{key:"_syncIndeterminate",value:function(e){var t=this._inputElement;t&&(t.nativeElement.indeterminate=e)}}]),n}(jX);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(wc),Es(Wv),Es(Vl),Ti("tabindex"),Es(Ny,8),Es(MX,8))},e.\u0275cmp=Ct({type:e,selectors:[["mat-checkbox"]],viewQuery:function(e,t){var n;(1&e&&(hl(TX,5),hl(ob,5)),2&e)&&(ll(n=dl())&&(t._inputElement=n.first),ll(n=dl())&&(t.ripple=n.first))},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(e,t){2&e&&(Ou("id",t.id),_s("tabindex",null),su("mat-checkbox-indeterminate",t.indeterminate)("mat-checkbox-checked",t.checked)("mat-checkbox-disabled",t.disabled)("mat-checkbox-label-before","before"==t.labelPosition)("_mat-animation-noopable","NoopAnimations"===t._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[Hu([NX]),ss],ngContentSelectors:PX,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(e,t){if(1&e&&(Ws(),Ts(0,"label",0,1),Ts(2,"span",2),Ts(3,"input",3,4),Fs("change",function(e){return t._onInteractionEvent(e)})("click",function(e){return t._onInputClick(e)}),As(),Ts(5,"span",5),Ps(6,"span",6),As(),Ps(7,"span",7),Ts(8,"span",8),Wn(),Ts(9,"svg",9),Ps(10,"path",10),As(),dn.lFrame.currentNamespace=null,Ps(11,"span",11),As(),As(),Ts(12,"span",12,13),Fs("cdkObserveContent",function(){return t._onLabelTextChange()}),Ts(14,"span",14),ku(15,"\xa0"),As(),qs(16),As(),As()),2&e){var n=Ss(1),i=Ss(13);_s("for",t.inputId),qo(2),su("mat-checkbox-inner-container-no-side-margin",!i.textContent||!i.textContent.trim()),qo(1),Cs("id",t.inputId)("required",t.required)("checked",t.checked)("disabled",t.disabled)("tabIndex",t.tabIndex),_s("value",t.value)("name",t.name)("aria-label",t.ariaLabel||null)("aria-labelledby",t.ariaLabelledby)("aria-checked",t._getAriaChecked())("aria-describedby",t.ariaDescribedby),qo(2),Cs("matRippleTrigger",n)("matRippleDisabled",t._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",qc(19,AX,"NoopAnimations"===t._animationMode?0:150))}},directives:[ob,gv],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),e}(),BX=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),VX=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[ab,Wy,mv,BX],Wy,BX]}),e}(),zX=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,VX]]}),e}(),UX=["trigger"],HX=["panel"];function GX(e,t){if(1&e&&(Ts(0,"span",8),ku(1),As()),2&e){var n=Hs();qo(1),xu(n.placeholder)}}function WX(e,t){if(1&e&&(Ts(0,"span",12),ku(1),As()),2&e){var n=Hs(2);qo(1),xu(n.triggerValue)}}function qX(e,t){1&e&&qs(0,0,["*ngSwitchCase","true"])}function XX(e,t){1&e&&(Ts(0,"span",9),xs(1,WX,2,1,"span",10),xs(2,qX,1,0,"ng-content",11),As()),2&e&&(Cs("ngSwitch",!!Hs().customTrigger),qo(2),Cs("ngSwitchCase",!0))}function YX(e,t){if(1&e){var n=Ds();Ts(0,"div",13),Ts(1,"div",14,15),Fs("@transformPanel.done",function(e){return mn(n),Hs()._panelDoneAnimatingStream.next(e.toState)})("keydown",function(e){return mn(n),Hs()._handleKeydown(e)}),qs(3,1),As(),As()}if(2&e){var i=Hs();Cs("@transformPanelWrap",void 0),qo(1),Cu("mat-select-panel ",i._getPanelTheme(),""),au("transform-origin",i._transformOrigin)("font-size",i._triggerFontSize,"px"),Cs("ngClass",i.panelClass)("@transformPanel",i.multiple?"showing-multiple":"showing"),_s("id",i.id+"-panel")("aria-multiselectable",i.multiple)("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby())}}var KX=[[["mat-select-trigger"]],"*"],QX=["mat-select-trigger","*"],$X={transformPanelWrap:eg("transformPanelWrap",[og("* => void",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:11,selector:e,animation:t,options:n}}("@transformPanel",[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return{type:9,options:e}}()],{optional:!0}))]),transformPanel:eg("transformPanel",[rg("void",ig({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),rg("showing",ig({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),rg("showing-multiple",ig({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),og("void => *",tg("120ms cubic-bezier(0, 0, 0.2, 1)")),og("* => void",tg("100ms 25ms linear",ig({opacity:0})))])},ZX=0,JX=new Mi("mat-select-scroll-strategy"),eY=new Mi("MAT_SELECT_CONFIG"),tY={provide:JX,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},nY=function e(t,n){m(this,e),this.source=t,this.value=n},iY=Yy(Ky(qy(Qy(function(){return function e(t,n,i,r,o){m(this,e),this._elementRef=t,this._defaultErrorStateMatcher=n,this._parentForm=i,this._parentFormGroup=r,this.ngControl=o}}())))),rY=new Mi("MatSelectTrigger"),oY=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,l,h,f,d,p,g,y){var b,_,w,k;return m(this,n),(b=t.call(this,a,o,u,l,f))._viewportRuler=e,b._changeDetectorRef=i,b._ngZone=r,b._dir=s,b._parentFormField=h,b._liveAnnouncer=g,b._defaultOptions=y,b._panelOpen=!1,b._compareWith=function(e,t){return e===t},b._uid="mat-select-"+ZX++,b._triggerAriaLabelledBy=null,b._destroy=new oe,b._onChange=function(){},b._onTouched=function(){},b._valueId="mat-select-value-"+ZX++,b._panelDoneAnimatingStream=new oe,b._overlayPanelClass=(null===(_=b._defaultOptions)||void 0===_?void 0:_.overlayPanelClass)||"",b._focused=!1,b.controlType="mat-select",b._required=!1,b._multiple=!1,b._disableOptionCentering=null!==(k=null===(w=b._defaultOptions)||void 0===w?void 0:w.disableOptionCentering)&&void 0!==k&&k,b.ariaLabel="",b.optionSelectionChanges=lz(function(){var e=b.options;return e?e.changes.pipe(fd(e),dd(function(){return Ce.apply(void 0,v(e.map(function(e){return e.onSelectionChange})))})):b._ngZone.onStable.pipe(ap(1),dd(function(){return b.optionSelectionChanges}))}),b.openedChange=new Zc,b._openedStream=b.openedChange.pipe(od(function(e){return e}),ue(function(){})),b._closedStream=b.openedChange.pipe(od(function(e){return!e}),ue(function(){})),b.selectionChange=new Zc,b.valueChange=new Zc,b.ngControl&&(b.ngControl.valueAccessor=c(b)),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(b._typeaheadDebounceInterval=y.typeaheadDebounceInterval),b._scrollStrategyFactory=p,b._scrollStrategy=b._scrollStrategyFactory(),b.tabIndex=parseInt(d)||0,b.id=b.id,b}return b(n,[{key:"focused",get:function(){return this._focused||this._panelOpen}},{key:"placeholder",get:function(){return this._placeholder},set:function(e){this._placeholder=e,this.stateChanges.next()}},{key:"required",get:function(){return this._required},set:function(e){this._required=If(e),this.stateChanges.next()}},{key:"multiple",get:function(){return this._multiple},set:function(e){this._multiple=If(e)}},{key:"disableOptionCentering",get:function(){return this._disableOptionCentering},set:function(e){this._disableOptionCentering=If(e)}},{key:"compareWith",get:function(){return this._compareWith},set:function(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}},{key:"value",get:function(){return this._value},set:function(e){(e!==this._value||this._multiple&&Array.isArray(e))&&(this.options&&this._setSelectionByValue(e),this._value=e)}},{key:"typeaheadDebounceInterval",get:function(){return this._typeaheadDebounceInterval},set:function(e){this._typeaheadDebounceInterval=Rf(e)}},{key:"id",get:function(){return this._id},set:function(e){this._id=e||this._uid,this.stateChanges.next()}},{key:"ngOnInit",value:function(){var e=this;this._selectionModel=new Hd(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Qf(),ud(this._destroy)).subscribe(function(){return e._panelDoneAnimating(e.panelOpen)})}},{key:"ngAfterContentInit",value:function(){var e=this;this._initKeyManager(),this._selectionModel.changed.pipe(ud(this._destroy)).subscribe(function(e){e.added.forEach(function(e){return e.select()}),e.removed.forEach(function(e){return e.deselect()})}),this.options.changes.pipe(fd(null),ud(this._destroy)).subscribe(function(){e._resetOptions(),e._initializeSelection()})}},{key:"ngDoCheck",value:function(){var e=this._getTriggerAriaLabelledby();if(e!==this._triggerAriaLabelledBy){var t=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?t.setAttribute("aria-labelledby",e):t.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}},{key:"ngOnChanges",value:function(e){e.disabled&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}},{key:"ngOnDestroy",value:function(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}},{key:"toggle",value:function(){this.panelOpen?this.close():this.open()}},{key:"open",value:function(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}},{key:"close",value:function(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}},{key:"writeValue",value:function(e){this.value=e}},{key:"registerOnChange",value:function(e){this._onChange=e}},{key:"registerOnTouched",value:function(e){this._onTouched=e}},{key:"setDisabledState",value:function(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}},{key:"panelOpen",get:function(){return this._panelOpen}},{key:"selected",get:function(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}},{key:"triggerValue",get:function(){if(this.empty)return"";if(this._multiple){var e=this._selectionModel.selected.map(function(e){return e.viewValue});return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}},{key:"_isRtl",value:function(){return!!this._dir&&"rtl"===this._dir.value}},{key:"_handleKeydown",value:function(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}},{key:"_handleClosedKeydown",value:function(e){var t=e.keyCode,n=40===t||38===t||37===t||39===t,i=13===t||32===t,r=this._keyManager;if(!r.isTyping()&&i&&!fp(e)||(this.multiple||e.altKey)&&n)e.preventDefault(),this.open();else if(!this.multiple){var o=this.selected;r.onKeydown(e);var a=this.selected;a&&o!==a&&this._liveAnnouncer.announce(a.viewValue,1e4)}}},{key:"_handleOpenKeydown",value:function(e){var t=this._keyManager,n=e.keyCode,i=40===n||38===n,r=t.isTyping();if(i&&e.altKey)e.preventDefault(),this.close();else if(r||13!==n&&32!==n||!t.activeItem||fp(e))if(!r&&this._multiple&&65===n&&e.ctrlKey){e.preventDefault();var o=this.options.some(function(e){return!e.disabled&&!e.selected});this.options.forEach(function(e){e.disabled||(o?e.select():e.deselect())})}else{var a=t.activeItemIndex;t.onKeydown(e),this._multiple&&i&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==a&&t.activeItem._selectViaInteraction()}else e.preventDefault(),t.activeItem._selectViaInteraction()}},{key:"_onFocus",value:function(){this.disabled||(this._focused=!0,this.stateChanges.next())}},{key:"_onBlur",value:function(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}},{key:"_onAttached",value:function(){var e=this;this._overlayDir.positionChange.pipe(ap(1)).subscribe(function(){e._changeDetectorRef.detectChanges(),e._positioningSettled()})}},{key:"_getPanelTheme",value:function(){return this._parentFormField?"mat-".concat(this._parentFormField.color):""}},{key:"empty",get:function(){return!this._selectionModel||this._selectionModel.isEmpty()}},{key:"_initializeSelection",value:function(){var e=this;Promise.resolve().then(function(){e._setSelectionByValue(e.ngControl?e.ngControl.value:e._value),e.stateChanges.next()})}},{key:"_setSelectionByValue",value:function(e){var t=this;if(this._selectionModel.selected.forEach(function(e){return e.setInactiveStyles()}),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(function(e){return t._selectValue(e)}),this._sortValues();else{var n=this._selectValue(e);n?this._keyManager.updateActiveItem(n):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}},{key:"_selectValue",value:function(e){var t=this,n=this.options.find(function(n){if(t._selectionModel.isSelected(n))return!1;try{return null!=n.value&&t._compareWith(n.value,e)}catch(i){return!1}});return n&&this._selectionModel.select(n),n}},{key:"_initKeyManager",value:function(){var e=this;this._keyManager=new Tv(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(ud(this._destroy)).subscribe(function(){e.panelOpen&&(!e.multiple&&e._keyManager.activeItem&&e._keyManager.activeItem._selectViaInteraction(),e.focus(),e.close())}),this._keyManager.change.pipe(ud(this._destroy)).subscribe(function(){e._panelOpen&&e.panel?e._scrollOptionIntoView(e._keyManager.activeItemIndex||0):!e._panelOpen&&!e.multiple&&e._keyManager.activeItem&&e._keyManager.activeItem._selectViaInteraction()})}},{key:"_resetOptions",value:function(){var e=this,t=Ce(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(ud(t)).subscribe(function(t){e._onSelect(t.source,t.isUserInput),t.isUserInput&&!e.multiple&&e._panelOpen&&(e.close(),e.focus())}),Ce.apply(void 0,v(this.options.map(function(e){return e._stateChanges}))).pipe(ud(t)).subscribe(function(){e._changeDetectorRef.markForCheck(),e.stateChanges.next()})}},{key:"_onSelect",value:function(e,t){var n=this._selectionModel.isSelected(e);null!=e.value||this._multiple?(n!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())):(e.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(e.value)),n!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}},{key:"_sortValues",value:function(){var e=this;if(this.multiple){var t=this.options.toArray();this._selectionModel.sort(function(n,i){return e.sortComparator?e.sortComparator(n,i,t):t.indexOf(n)-t.indexOf(i)}),this.stateChanges.next()}}},{key:"_propagateChanges",value:function(e){var t;t=this.multiple?this.selected.map(function(e){return e.value}):this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck()}},{key:"_highlightCorrectOption",value:function(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}},{key:"_canOpen",value:function(){var e;return!this._panelOpen&&!this.disabled&&(null===(e=this.options)||void 0===e?void 0:e.length)>0}},{key:"focus",value:function(e){this._elementRef.nativeElement.focus(e)}},{key:"_getPanelAriaLabelledby",value:function(){var e;if(this.ariaLabel)return null;var t=null===(e=this._parentFormField)||void 0===e?void 0:e.getLabelId();return this.ariaLabelledby?(t?t+" ":"")+this.ariaLabelledby:t}},{key:"_getAriaActiveDescendant",value:function(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}},{key:"_getTriggerAriaLabelledby",value:function(){var e;if(this.ariaLabel)return null;var t=null===(e=this._parentFormField)||void 0===e?void 0:e.getLabelId(),n=(t?t+" ":"")+this._valueId;return this.ariaLabelledby&&(n+=" "+this.ariaLabelledby),n}},{key:"_panelDoneAnimating",value:function(e){this.openedChange.emit(e)}},{key:"setDescribedByIds",value:function(e){this._ariaDescribedby=e.join(" ")}},{key:"onContainerClick",value:function(){this.focus(),this.open()}},{key:"shouldLabelFloat",get:function(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}]),n}(iY);return e.\u0275fac=function(t){return new(t||e)(Es(qd),Es(wc),Es(Vl),Es($y),Es(Ku),Es(zd,8),Es(JV,8),Es(az,8),Es(Vz,8),Es(EV,10),Ti("tabindex"),Es(JX),Es(Uv),Es(eY,8))},e.\u0275dir=It({type:e,viewQuery:function(e,t){var n;(1&e&&(hl(UX,5),hl(HX,5),hl(Xp,5)),2&e)&&(ll(n=dl())&&(t.trigger=n.first),ll(n=dl())&&(t.panel=n.first),ll(n=dl())&&(t._overlayDir=n.first))},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[ss,Gt]}),e}(),aY=function(){var t,n=function(t){a(i,t);var n=s(i);function i(){var e;return m(this,i),(e=n.apply(this,arguments))._scrollTop=0,e._triggerFontSize=0,e._transformOrigin="top",e._offsetY=0,e._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}],e}return b(i,[{key:"_calculateOverlayScroll",value:function(e,t,n){var i=this._getItemHeight();return Math.min(Math.max(0,i*e-t+i/2),n)}},{key:"ngOnInit",value:function(){var t=this;e(p(i.prototype),"ngOnInit",this).call(this),this._viewportRuler.change().pipe(ud(this._destroy)).subscribe(function(){t.panelOpen&&(t._triggerRect=t.trigger.nativeElement.getBoundingClientRect(),t._changeDetectorRef.markForCheck())})}},{key:"open",value:function(){var t=this;e(p(i.prototype),"_canOpen",this).call(this)&&(e(p(i.prototype),"open",this).call(this),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(ap(1)).subscribe(function(){t._triggerFontSize&&t._overlayDir.overlayRef&&t._overlayDir.overlayRef.overlayElement&&(t._overlayDir.overlayRef.overlayElement.style.fontSize="".concat(t._triggerFontSize,"px"))}))}},{key:"_scrollOptionIntoView",value:function(e){var t=yb(e,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===e&&1===t?0:bb((e+t)*n,n,this.panel.nativeElement.scrollTop,256)}},{key:"_positioningSettled",value:function(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}},{key:"_panelDoneAnimating",value:function(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),e(p(i.prototype),"_panelDoneAnimating",this).call(this,t)}},{key:"_getChangeEvent",value:function(e){return new nY(this,e)}},{key:"_calculateOverlayOffsetX",value:function(){var e,t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),n=this._viewportRuler.getViewportSize(),i=this._isRtl(),r=this.multiple?56:32;if(this.multiple)e=40;else if(this.disableOptionCentering)e=16;else{var o=this._selectionModel.selected[0]||this.options.first;e=o&&o.group?32:16}i||(e*=-1);var a=0-(t.left+e-(i?r:0)),s=t.right+e-n.width+(i?0:r);a>0?e+=a+8:s>0&&(e-=s+8),this._overlayDir.offsetX=Math.round(e),this._overlayDir.overlayRef.updatePosition()}},{key:"_calculateOverlayOffsetY",value:function(e,t,n){var i,r=this._getItemHeight(),o=(r-this._triggerRect.height)/2,a=Math.floor(256/r);return this.disableOptionCentering?0:(i=0===this._scrollTop?e*r:this._scrollTop===n?(e-(this._getItemCount()-a))*r+(r-(this._getItemCount()*r-256)%r):t-r/2,Math.round(-1*i-o))}},{key:"_checkOverlayWithinViewport",value:function(e){var t=this._getItemHeight(),n=this._viewportRuler.getViewportSize(),i=this._triggerRect.top-8,r=n.height-this._triggerRect.bottom-8,o=Math.abs(this._offsetY),a=Math.min(this._getItemCount()*t,256)-o-this._triggerRect.height;a>r?this._adjustPanelUp(a,r):o>i?this._adjustPanelDown(o,i,e):this._transformOrigin=this._getOriginBasedOnOption()}},{key:"_adjustPanelUp",value:function(e,t){var n=Math.round(e-t);this._scrollTop-=n,this._offsetY-=n,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}},{key:"_adjustPanelDown",value:function(e,t,n){var i=Math.round(e-t);if(this._scrollTop+=i,this._offsetY+=i,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=n)return this._scrollTop=n,this._offsetY=0,void(this._transformOrigin="50% top 0px")}},{key:"_calculateOverlayPosition",value:function(){var e,t=this._getItemHeight(),n=this._getItemCount(),i=Math.min(n*t,256),r=n*t-i;e=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),e+=yb(e,this.options,this.optionGroups);var o=i/2;this._scrollTop=this._calculateOverlayScroll(e,o,r),this._offsetY=this._calculateOverlayOffsetY(e,o,r),this._checkOverlayWithinViewport(r)}},{key:"_getOriginBasedOnOption",value:function(){var e=this._getItemHeight(),t=(e-this._triggerRect.height)/2;return"50% ".concat(Math.abs(this._offsetY)-t+e/2,"px 0px")}},{key:"_getItemHeight",value:function(){return 3*this._triggerFontSize}},{key:"_getItemCount",value:function(){return this.options.length+this.optionGroups.length}}]),i}(oY);return n.\u0275fac=function(e){return(t||(t=Ci(n)))(e||n)},n.\u0275cmp=Ct({type:n,selectors:[["mat-select"]],contentQueries:function(e,t,n){var i;(1&e&&(fl(n,rY,5),fl(n,mb,5),fl(n,db,5)),2&e)&&(ll(i=dl())&&(t.customTrigger=i.first),ll(i=dl())&&(t.options=i),ll(i=dl())&&(t.optionGroups=i))},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(e,t){1&e&&Fs("keydown",function(e){return t._handleKeydown(e)})("focus",function(){return t._onFocus()})("blur",function(){return t._onBlur()}),2&e&&(_s("id",t.id)("tabindex",t.tabIndex)("aria-controls",t.panelOpen?t.id+"-panel":null)("aria-expanded",t.panelOpen)("aria-label",t.ariaLabel||null)("aria-required",t.required.toString())("aria-disabled",t.disabled.toString())("aria-invalid",t.errorState)("aria-describedby",t._ariaDescribedby||null)("aria-activedescendant",t._getAriaActiveDescendant()),su("mat-select-disabled",t.disabled)("mat-select-invalid",t.errorState)("mat-select-required",t.required)("mat-select-empty",t.empty)("mat-select-multiple",t.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[Hu([{provide:Pz,useExisting:n},{provide:cb,useExisting:n}]),ss],ngContentSelectors:QX,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(e,t){if(1&e&&(Ws(KX),Ts(0,"div",0,1),Fs("click",function(){return t.toggle()}),Ts(3,"div",2),xs(4,GX,2,1,"span",3),xs(5,XX,3,2,"span",4),As(),Ts(6,"div",5),Ps(7,"div",6),As(),As(),xs(8,YX,4,14,"ng-template",7),Fs("backdropClick",function(){return t.close()})("attach",function(){return t._onAttached()})("detach",function(){return t.close()})),2&e){var n=Ss(1);_s("aria-owns",t.panelOpen?t.id+"-panel":null),qo(3),Cs("ngSwitch",t.empty),_s("id",t._valueId),qo(1),Cs("ngSwitchCase",!0),qo(1),Cs("ngSwitchCase",!1),qo(3),Cs("cdkConnectedOverlayPanelClass",t._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",t._scrollStrategy)("cdkConnectedOverlayOrigin",n)("cdkConnectedOverlayOpen",t.panelOpen)("cdkConnectedOverlayPositions",t._positions)("cdkConnectedOverlayMinWidth",null==t._triggerRect?null:t._triggerRect.width)("cdkConnectedOverlayOffsetY",t._offsetY)}},directives:[qp,Vh,zh,Xp,Uh,Ih],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[$X.transformPanelWrap,$X.transformPanel]},changeDetection:0}),n}(),sY=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[tY],imports:[[Kh,Kp,_b,Wy],Xd,Uz,_b,Wy]}),e}(),uY=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,Uz,sY]]}),e}(),cY=r(25430),lY=r(39053),hY=r(26202),fY=["tooltipTemplate"],dY=["leftOuterSelectionBar"],pY=["rightOuterSelectionBar"],vY=["fullBar"],gY=["selectionBar"],mY=["minHandle"],yY=["maxHandle"],bY=["floorLabel"],_Y=["ceilLabel"],wY=["minHandleLabel"],kY=["maxHandleLabel"],xY=["combinedLabel"],SY=["ticksElement"];function EY(e,t){if(1&e&&Ps(0,"ng5-slider-tooltip-wrapper",31),2&e){var n=Hs().$implicit;Cs("template",Hs().tooltipTemplate)("tooltip",n.valueTooltip)("placement",n.valueTooltipPlacement)("content",n.value)}}function CY(e,t){1&e&&Ps(0,"span",32),2&e&&Cs("innerHTML",Hs().$implicit.legend,Gr)}var OY=function(e){return{"ng5-slider-selected":e}};function TY(e,t){if(1&e&&(Ts(0,"span",27),Ps(1,"ng5-slider-tooltip-wrapper",28),xs(2,EY,1,4,"ng5-slider-tooltip-wrapper",29),xs(3,CY,1,1,"span",30),As()),2&e){var n=t.$implicit,i=Hs();Cs("ngClass",qc(7,OY,n.selected))("ngStyle",n.style),qo(1),Cs("template",i.tooltipTemplate)("tooltip",n.tooltip)("placement",n.tooltipPlacement),qo(1),Cs("ngIf",null!=n.value),qo(1),Cs("ngIf",null!=n.legend)}}function AY(e,t){}function PY(e,t){1&e&&xs(0,AY,0,0,"ng-template")}var MY=function(e,t,n){return{tooltip:e,placement:t,content:n}};function IY(e,t){if(1&e&&(Ms(0),xs(1,PY,1,0,void 0,1),Is()),2&e){var n=Hs();qo(1),Cs("ngTemplateOutlet",n.template)("ngTemplateOutletContext",function(e,t,n,i,r,o){return function(e,t,n,i,r,o,a,s){var u=t+n;return function(e,t,n,i,r){var o=bs(e,t,n,i);return ys(e,t+2,r)||o}(e,u,r,o,a)?ms(e,u+3,s?i.call(s,r,o,a):i(r,o,a)):Xc(e,u+3)}(vn(),En(),e,t,n,i,r,o)}(2,MY,n.tooltip,n.placement,n.content))}}function RY(e,t){if(1&e&&(Ms(0),Ts(1,"div",2),ku(2),As(),Is()),2&e){var n=Hs();qo(1),_s("title",n.tooltip)("data-tooltip-placement",n.placement),qo(1),Su(" ",n.content," ")}}var DY={Min:0,Max:1};DY[DY.Min]="Min",DY[DY.Max]="Max";var NY={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};NY[NY.Low]="Low",NY[NY.High]="High",NY[NY.Floor]="Floor",NY[NY.Ceil]="Ceil",NY[NY.TickValue]="TickValue";var LY=function e(){m(this,e),this.floor=0,this.ceil=null,this.step=1,this.minRange=null,this.maxRange=null,this.pushRange=!1,this.minLimit=null,this.maxLimit=null,this.translate=null,this.combineLabels=null,this.getLegend=null,this.stepsArray=null,this.bindIndexForStepsArray=!1,this.draggableRange=!1,this.draggableRangeOnly=!1,this.showSelectionBar=!1,this.showSelectionBarEnd=!1,this.showSelectionBarFromValue=null,this.showOuterSelectionBars=!1,this.hidePointerLabels=!1,this.hideLimitLabels=!1,this.autoHideLimitLabels=!0,this.readOnly=!1,this.disabled=!1,this.mouseEventsInterval=50,this.touchEventsInterval=50,this.inputEventsInterval=100,this.outputEventsInterval=100,this.showTicks=!1,this.showTicksValues=!1,this.tickStep=null,this.tickValueStep=1,this.ticksArray=null,this.ticksTooltip=null,this.ticksValuesTooltip=null,this.vertical=!1,this.getSelectionBarColor=null,this.getTickColor=null,this.getPointerColor=null,this.keyboardSupport=!0,this.scale=1,this.enforceStep=!0,this.enforceRange=!0,this.noSwitching=!1,this.onlyBindHandles=!1,this.rightToLeft=!1,this.reversedControls=!1,this.boundPointerLabels=!0,this.logScale=!1,this.customValueToPosition=null,this.customPositionToValue=null,this.precisionLimit=12,this.selectionBarGradient=null,this.ariaLabel=null,this.ariaLabelledBy=null,this.ariaLabelHigh=null,this.ariaLabelledByHigh=null,this.handleDimension=null,this.barDimension=null,this.animate=!0},jY=function e(){m(this,e)},FY=function(){function e(){m(this,e)}return b(e,null,[{key:"isNullOrUndefined",value:function(e){return null==e}},{key:"linearValueToPosition",value:function(e,t,n){return(e-t)/(n-t)}},{key:"logValueToPosition",value:function(e,t,n){return((e=Math.log(e))-(t=Math.log(t)))/((n=Math.log(n))-t)}},{key:"linearPositionToValue",value:function(e,t,n){return e*(n-t)+t}},{key:"logPositionToValue",value:function(e,t,n){return t=Math.log(t),n=Math.log(n),Math.exp(e*(n-t)+t)}},{key:"findStepIndex",value:function(e,t){for(var n=t.map(function(t){return Math.abs(e-t.value)}),i=0,r=0;r0&&0===this.dimension)&&(t=!0),this._value=e,this.elemRef.nativeElement.innerHTML=e,t&&this.calculateDimension()}}]),n}(HY);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Zu),Es(wc))},e.\u0275dir=It({type:e,selectors:[["","ng5SliderLabel",""]],features:[ss]}),e}(),qY=function e(){m(this,e),this.selected=!1,this.style={},this.tooltip=null,this.tooltipPlacement=null,this.value=null,this.valueTooltip=null,this.valueTooltipPlacement=null,this.legend=null},XY=function e(){m(this,e),this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0},YY=function(){function e(){m(this,e)}return b(e,null,[{key:"compare",value:function(e,t){return!(FY.isNullOrUndefined(e)&&FY.isNullOrUndefined(t)||FY.isNullOrUndefined(e)!==FY.isNullOrUndefined(t))&&e.value===t.value&&e.highValue===t.highValue}}]),e}(),KY=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,null,[{key:"compare",value:function(e,t){return!(FY.isNullOrUndefined(e)&&FY.isNullOrUndefined(t)||FY.isNullOrUndefined(e)!==FY.isNullOrUndefined(t))&&e.value===t.value&&e.highValue===t.highValue&&e.forceChange===t.forceChange}}]),n}(YY),QY={provide:iV,useExisting:Ue(function(){return $Y}),multi:!0},$Y=function(){var e=function(){function e(t,n,i,r){m(this,e),this.renderer=t,this.elementRef=n,this.changeDetectionRef=i,this.zone=r,this.value=null,this.valueChange=new Zc,this.highValue=null,this.highValueChange=new Zc,this.options=new LY,this.userChangeStart=new Zc,this.userChange=new Zc,this.userChangeEnd=new Zc,this.initHasRun=!1,this.inputModelChangeSubject=new cY.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new cY.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new LY,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new XY,this.sliderElementVerticalClass=!1,this.sliderElementAnimateClass=!1,this.sliderElementDisabledAttr=null,this.barStyle={},this.minPointerStyle={},this.maxPointerStyle={},this.fullBarTransparentClass=!1,this.selectionBarDraggableClass=!1,this.ticksUnderValuesClass=!1,this.intermediateTicks=!1,this.ticks=[],this.eventListenerHelper=null,this.onMoveEventListener=null,this.onEndEventListener=null,this.resizeObserver=null,this.onTouchedCallback=null,this.onChangeCallback=null,this.eventListenerHelper=new UY(this.renderer)}return b(e,[{key:"manualRefresh",set:function(e){var t=this;this.unsubscribeManualRefresh(),this.manualRefreshSubscription=e.subscribe(function(){setTimeout(function(){return t.calculateViewDimensionsAndDetectChanges()})})}},{key:"triggerFocus",set:function(e){var t=this;this.unsubscribeTriggerFocus(),this.triggerFocusSubscription=e.subscribe(function(e){t.focusPointer(e)})}},{key:"range",get:function(){return!FY.isNullOrUndefined(this.value)&&!FY.isNullOrUndefined(this.highValue)}},{key:"showTicks",get:function(){return this.viewOptions.showTicks}},{key:"ngOnInit",value:function(){this.viewOptions=new LY,Object.assign(this.viewOptions,this.options),this.updateDisabledState(),this.updateVerticalState()}},{key:"ngAfterViewInit",value:function(){this.applyOptions(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval),this.subscribeOutputModelChangeSubject(this.viewOptions.outputEventsInterval),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.updateVerticalState(),this.manageElementsStyle(),this.updateDisabledState(),this.calculateViewDimensions(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.initHandles(),this.manageEventsBindings(),this.subscribeResizeObserver(),this.initHasRun=!0,this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}},{key:"ngOnChanges",value:function(e){FY.isNullOrUndefined(e.options)||this.onChangeOptions(),(!FY.isNullOrUndefined(e.value)||!FY.isNullOrUndefined(e.highValue))&&this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}},{key:"ngOnDestroy",value:function(){this.unbindEvents(),this.unsubscribeResizeObserver(),this.unsubscribeInputModelChangeSubject(),this.unsubscribeOutputModelChangeSubject(),this.unsubscribeManualRefresh(),this.unsubscribeTriggerFocus()}},{key:"writeValue",value:function(e){e instanceof Array?(this.value=e[0],this.highValue=e[1]):this.value=e,this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}},{key:"registerOnChange",value:function(e){this.onChangeCallback=e}},{key:"registerOnTouched",value:function(e){this.onTouchedCallback=e}},{key:"setDisabledState",value:function(e){this.viewOptions.disabled=e,this.updateDisabledState()}},{key:"onResize",value:function(e){this.calculateViewDimensionsAndDetectChanges()}},{key:"subscribeInputModelChangeSubject",value:function(e){var t=this;this.inputModelChangeSubscription=this.inputModelChangeSubject.pipe((0,lY.distinctUntilChanged)(KY.compare),(0,lY.filter)(function(e){return!e.forceChange&&!e.internalChange}),FY.isNullOrUndefined(e)?(0,lY.tap)(function(){}):(0,lY.throttleTime)(e,void 0,{leading:!0,trailing:!0})).subscribe(function(e){return t.applyInputModelChange(e)})}},{key:"subscribeOutputModelChangeSubject",value:function(e){var t=this;this.outputModelChangeSubscription=this.outputModelChangeSubject.pipe((0,lY.distinctUntilChanged)(KY.compare),FY.isNullOrUndefined(e)?(0,lY.tap)(function(){}):(0,lY.throttleTime)(e,void 0,{leading:!0,trailing:!0})).subscribe(function(e){return t.publishOutputModelChange(e)})}},{key:"subscribeResizeObserver",value:function(){var e=this;BY.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(function(){return e.calculateViewDimensionsAndDetectChanges()}),this.resizeObserver.observe(this.elementRef.nativeElement))}},{key:"unsubscribeResizeObserver",value:function(){BY.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"unsubscribeOnMove",value:function(){FY.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}},{key:"unsubscribeOnEnd",value:function(){FY.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}},{key:"unsubscribeInputModelChangeSubject",value:function(){FY.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}},{key:"unsubscribeOutputModelChangeSubject",value:function(){FY.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}},{key:"unsubscribeManualRefresh",value:function(){FY.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}},{key:"unsubscribeTriggerFocus",value:function(){FY.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}},{key:"getPointerElement",value:function(e){return e===DY.Min?this.minHandleElement:e===DY.Max?this.maxHandleElement:null}},{key:"getCurrentTrackingValue",value:function(){return this.currentTrackingPointer===DY.Min?this.viewLowValue:this.currentTrackingPointer===DY.Max?this.viewHighValue:null}},{key:"modelValueToViewValue",value:function(e){return FY.isNullOrUndefined(e)?NaN:FY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+e:FY.findStepIndex(+e,this.viewOptions.stepsArray)}},{key:"viewValueToModelValue",value:function(e){return FY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?e:this.getStepValue(e)}},{key:"getStepValue",value:function(e){var t=this.viewOptions.stepsArray[e];return FY.isNullOrUndefined(t)?NaN:t.value}},{key:"applyViewChange",value:function(){this.value=this.viewValueToModelValue(this.viewLowValue),this.range&&(this.highValue=this.viewValueToModelValue(this.viewHighValue)),this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,userEventInitiated:!0,forceChange:!1}),this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!0})}},{key:"applyInputModelChange",value:function(e){var t=this.normaliseModelValues(e),n=!YY.compare(e,t);n&&(this.value=t.value,this.highValue=t.highValue),this.viewLowValue=this.modelValueToViewValue(t.value),this.viewHighValue=this.range?this.modelValueToViewValue(t.highValue):null,this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCombinedLabel(),this.outputModelChangeSubject.next({value:t.value,highValue:t.highValue,forceChange:n,userEventInitiated:!1})}},{key:"publishOutputModelChange",value:function(e){var t=this,n=function(){t.valueChange.emit(e.value),t.range&&t.highValueChange.emit(e.highValue),FY.isNullOrUndefined(t.onChangeCallback)||t.onChangeCallback(t.range?[e.value,e.highValue]:e.value),FY.isNullOrUndefined(t.onTouchedCallback)||t.onTouchedCallback(t.range?[e.value,e.highValue]:e.value)};e.userEventInitiated?(n(),this.userChange.emit(this.getChangeContext())):setTimeout(function(){n()})}},{key:"normaliseModelValues",value:function(e){var t=new YY;if(t.value=e.value,t.highValue=e.highValue,this.viewOptions.enforceStep&&(t.value=this.roundStep(t.value),this.range&&(t.highValue=this.roundStep(t.highValue))),!FY.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return t;if(t.value=VY.clampToRange(t.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(t.highValue=VY.clampToRange(t.highValue,this.viewOptions.floor,this.viewOptions.ceil)),this.range&&e.value>e.highValue)if(this.viewOptions.noSwitching)t.value=t.highValue;else{var n=e.value;t.value=e.highValue,t.highValue=n}return t}},{key:"renormaliseModelValues",value:function(){var e={value:this.value,highValue:this.highValue},t=this.normaliseModelValues(e);YY.compare(t,e)||(this.value=t.value,this.highValue=t.highValue,this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!0,userEventInitiated:!1}))}},{key:"onChangeOptions",value:function(){if(this.initHasRun){var e=this.viewOptions.inputEventsInterval,t=this.viewOptions.outputEventsInterval;this.applyOptions(),e!==this.viewOptions.inputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval)),t!==this.viewOptions.outputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.outputEventsInterval)),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.resetSlider()}}},{key:"applyOptions",value:function(){if(this.viewOptions=new LY,Object.assign(this.viewOptions,this.options),this.viewOptions.draggableRange=this.range&&this.viewOptions.draggableRange,this.viewOptions.draggableRangeOnly=this.range&&this.viewOptions.draggableRangeOnly,this.viewOptions.draggableRangeOnly&&(this.viewOptions.draggableRange=!0),this.viewOptions.showTicks=this.viewOptions.showTicks||this.viewOptions.showTicksValues||!FY.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!FY.isNullOrUndefined(this.viewOptions.tickStep)||!FY.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!FY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),FY.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),FY.isNullOrUndefined(this.viewOptions.combineLabels)&&(this.viewOptions.combineLabels=function(e,t){return e+" - "+t}),this.viewOptions.logScale&&0===this.viewOptions.floor)throw Error("Can't use floor=0 with logarithmic scale")}},{key:"applyStepsArrayOptions",value:function(){var e=this;this.viewOptions.floor=0,this.viewOptions.ceil=this.viewOptions.stepsArray.length-1,this.viewOptions.step=1,FY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=function(t){return String(e.viewOptions.bindIndexForStepsArray?e.getStepValue(t):t)}),this.viewOptions.getLegend=function(t){return e.viewOptions.stepsArray[t].legend}}},{key:"applyFloorCeilOptions",value:function(){if(FY.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),FY.isNullOrUndefined(this.viewOptions.ceil)||FY.isNullOrUndefined(this.viewOptions.floor))throw Error("floor and ceil options must be supplied");this.viewOptions.ceil=+this.viewOptions.ceil,this.viewOptions.floor=+this.viewOptions.floor,FY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=function(e){return String(e)})}},{key:"resetSlider",value:function(){this.manageElementsStyle(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.unbindEvents(),this.manageEventsBindings(),this.updateDisabledState(),this.calculateViewDimensions(),this.refocusPointerIfNeeded()}},{key:"focusPointer",value:function(e){e!==DY.Min&&e!==DY.Max&&(e=DY.Min),e===DY.Min?this.minHandleElement.focus():this.range&&e===DY.Max&&this.maxHandleElement.focus()}},{key:"refocusPointerIfNeeded",value:function(){FY.isNullOrUndefined(this.currentFocusPointer)||(this.onPointerFocus(this.currentFocusPointer),this.getPointerElement(this.currentFocusPointer).focus())}},{key:"manageElementsStyle",value:function(){var e=this;this.updateScale(),this.floorLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels),this.ceilLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels);var t=this.viewOptions.showTicksValues&&!this.intermediateTicks;this.minHandleLabelElement.setAlwaysHide(t||this.viewOptions.hidePointerLabels),this.maxHandleLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.combinedLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.selectionBarElement.setAlwaysHide(!this.range&&!this.viewOptions.showSelectionBar),this.leftOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.rightOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.fullBarTransparentClass=this.range&&this.viewOptions.showOuterSelectionBars,this.selectionBarDraggableClass=this.viewOptions.draggableRange&&!this.viewOptions.onlyBindHandles,this.ticksUnderValuesClass=this.intermediateTicks&&this.options.showTicksValues,this.sliderElementVerticalClass!==this.viewOptions.vertical&&(this.updateVerticalState(),setTimeout(function(){e.resetSlider()})),this.sliderElementAnimateClass!==this.viewOptions.animate&&setTimeout(function(){e.sliderElementAnimateClass=e.viewOptions.animate})}},{key:"manageEventsBindings",value:function(){this.viewOptions.disabled||this.viewOptions.readOnly?this.unbindEvents():this.bindEvents()}},{key:"updateDisabledState",value:function(){this.sliderElementDisabledAttr=this.viewOptions.disabled?"disabled":null}},{key:"updateVerticalState",value:function(){this.sliderElementVerticalClass=this.viewOptions.vertical;var e,t=_(this.getAllSliderElements());try{for(t.s();!(e=t.n()).done;){var n=e.value;FY.isNullOrUndefined(n)||n.setVertical(this.viewOptions.vertical)}}catch(i){t.e(i)}finally{t.f()}}},{key:"updateScale",value:function(){var e,t=_(this.getAllSliderElements());try{for(t.s();!(e=t.n()).done;){e.value.setScale(this.viewOptions.scale)}}catch(n){t.e(n)}finally{t.f()}}},{key:"getAllSliderElements",value:function(){return[this.leftOuterSelectionBarElement,this.rightOuterSelectionBarElement,this.fullBarElement,this.selectionBarElement,this.minHandleElement,this.maxHandleElement,this.floorLabelElement,this.ceilLabelElement,this.minHandleLabelElement,this.maxHandleLabelElement,this.combinedLabelElement,this.ticksElement]}},{key:"initHandles",value:function(){this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.range&&this.updateCombinedLabel(),this.updateTicksScale()}},{key:"addAccessibility",value:function(){this.updateAriaAttributes(),this.minHandleElement.role="slider",this.minHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.viewOptions.vertical&&(this.minHandleElement.ariaOrientation="vertical"),FY.isNullOrUndefined(this.viewOptions.ariaLabel)?FY.isNullOrUndefined(this.viewOptions.ariaLabelledBy)||(this.minHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledBy):this.minHandleElement.ariaLabel=this.viewOptions.ariaLabel,this.range&&(this.maxHandleElement.role="slider",this.maxHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.maxHandleElement.ariaOrientation=this.viewOptions.vertical?"vertical":"horizontal",FY.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?FY.isNullOrUndefined(this.viewOptions.ariaLabelledByHigh)||(this.maxHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledByHigh):this.maxHandleElement.ariaLabel=this.viewOptions.ariaLabelHigh)}},{key:"updateAriaAttributes",value:function(){this.minHandleElement.ariaValueNow=(+this.value).toString(),this.minHandleElement.ariaValueText=this.viewOptions.translate(+this.value,NY.Low),this.minHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.minHandleElement.ariaValueMax=this.viewOptions.ceil.toString(),this.range&&(this.maxHandleElement.ariaValueNow=(+this.highValue).toString(),this.maxHandleElement.ariaValueText=this.viewOptions.translate(+this.highValue,NY.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}},{key:"calculateViewDimensions",value:function(){FY.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);var e=this.minHandleElement.dimension;this.handleHalfDimension=e/2,FY.isNullOrUndefined(this.viewOptions.barDimension)?this.fullBarElement.calculateDimension():this.fullBarElement.setDimension(this.viewOptions.barDimension),this.maxHandlePosition=this.fullBarElement.dimension-e,this.initHasRun&&(this.updateFloorLabel(),this.updateCeilLabel(),this.initHandles())}},{key:"calculateViewDimensionsAndDetectChanges",value:function(){this.calculateViewDimensions(),this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}},{key:"isRefDestroyed",value:function(){return this.changeDetectionRef.destroyed}},{key:"updateTicksScale",value:function(){var e=this;if(this.viewOptions.showTicks){var t=FY.isNullOrUndefined(this.viewOptions.ticksArray)?this.getTicksArray():this.viewOptions.ticksArray,n=this.viewOptions.vertical?"translateY":"translateX";this.viewOptions.rightToLeft&&t.reverse();var i=t.map(function(t){var i=e.valueToPosition(t);e.viewOptions.vertical&&(i=e.maxHandlePosition-i);var r=n+"("+Math.round(i)+"px)",o=new qY;if(o.selected=e.isTickSelected(t),o.style={"-webkit-transform":r,"-moz-transform":r,"-o-transform":r,"-ms-transform":r,transform:r},o.selected&&!FY.isNullOrUndefined(e.viewOptions.getSelectionBarColor)&&(o.style["background-color"]=e.getSelectionBarColor()),!o.selected&&!FY.isNullOrUndefined(e.viewOptions.getTickColor)&&(o.style["background-color"]=e.getTickColor(t)),FY.isNullOrUndefined(e.viewOptions.ticksTooltip)||(o.tooltip=e.viewOptions.ticksTooltip(t),o.tooltipPlacement=e.viewOptions.vertical?"right":"top"),e.viewOptions.showTicksValues&&t%e.viewOptions.tickValueStep==0&&(o.value=e.getDisplayValue(t,NY.TickValue),FY.isNullOrUndefined(e.viewOptions.ticksValuesTooltip)||(o.valueTooltip=e.viewOptions.ticksValuesTooltip(t),o.valueTooltipPlacement=e.viewOptions.vertical?"right":"top")),!FY.isNullOrUndefined(e.viewOptions.getLegend)){var a=e.viewOptions.getLegend(t);FY.isNullOrUndefined(a)||(o.legend=a)}return o});if(FY.isNullOrUndefined(this.ticks)||this.ticks.length!==i.length)this.ticks=i;else for(var r=0;r=this.viewLowValue)return!0}else if(this.viewOptions.showSelectionBar&&e<=this.viewLowValue)return!0}else{var t=this.viewOptions.showSelectionBarFromValue;if(this.viewLowValue>t&&e>=t&&e<=this.viewLowValue)return!0;if(this.viewLowValue=this.viewLowValue)return!0}return!!(this.range&&e>=this.viewLowValue&&e<=this.viewHighValue)}},{key:"updateFloorLabel",value:function(){this.floorLabelElement.alwaysHide||(this.floorLabelElement.setValue(this.getDisplayValue(this.viewOptions.floor,NY.Floor)),this.floorLabelElement.calculateDimension(),this.floorLabelElement.setPosition(this.viewOptions.rightToLeft?this.fullBarElement.dimension-this.floorLabelElement.dimension:0))}},{key:"updateCeilLabel",value:function(){this.ceilLabelElement.alwaysHide||(this.ceilLabelElement.setValue(this.getDisplayValue(this.viewOptions.ceil,NY.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}},{key:"updateHandles",value:function(e,t){e===DY.Min?this.updateLowHandle(t):e===DY.Max&&this.updateHighHandle(t),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}},{key:"getHandleLabelPos",value:function(e,t){var n=e===DY.Min?this.minHandleLabelElement.dimension:this.maxHandleLabelElement.dimension,i=t-n/2+this.handleHalfDimension,r=this.fullBarElement.dimension-n;return this.viewOptions.boundPointerLabels?this.viewOptions.rightToLeft&&e===DY.Min||!this.viewOptions.rightToLeft&&e===DY.Max?Math.min(i,r):Math.min(Math.max(i,0),r):i}},{key:"updateLowHandle",value:function(e){this.minHandleElement.setPosition(e),this.minHandleLabelElement.setValue(this.getDisplayValue(this.viewLowValue,NY.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(DY.Min,e)),FY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(DY.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}},{key:"updateHighHandle",value:function(e){this.maxHandleElement.setPosition(e),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,NY.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(DY.Max,e)),FY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(DY.Max)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}},{key:"updateFloorAndCeilLabelsVisibility",value:function(){if(!this.viewOptions.hidePointerLabels){var e=!1,t=!1,n=this.isLabelBelowFloorLabel(this.minHandleLabelElement),i=this.isLabelAboveCeilLabel(this.minHandleLabelElement),r=this.isLabelAboveCeilLabel(this.maxHandleLabelElement),o=this.isLabelBelowFloorLabel(this.combinedLabelElement),a=this.isLabelAboveCeilLabel(this.combinedLabelElement);if(n?(e=!0,this.floorLabelElement.hide()):(e=!1,this.floorLabelElement.show()),i?(t=!0,this.ceilLabelElement.hide()):(t=!1,this.ceilLabelElement.show()),this.range){var s=this.combinedLabelElement.isVisible()?a:r,u=this.combinedLabelElement.isVisible()?o:n;s?this.ceilLabelElement.hide():t||this.ceilLabelElement.show(),u?this.floorLabelElement.hide():e||this.floorLabelElement.show()}}}},{key:"isLabelBelowFloorLabel",value:function(e){var t=e.position,n=this.floorLabelElement.position;return this.viewOptions.rightToLeft?t+e.dimension>=n-2:t<=n+this.floorLabelElement.dimension+2}},{key:"isLabelAboveCeilLabel",value:function(e){var t=e.position,n=this.ceilLabelElement.position;return this.viewOptions.rightToLeft?t<=n+this.ceilLabelElement.dimension+2:t+e.dimension>=n-2}},{key:"updateSelectionBar",value:function(){var e=0,t=0,n=this.viewOptions.rightToLeft?!this.viewOptions.showSelectionBarEnd:this.viewOptions.showSelectionBarEnd,i=this.viewOptions.rightToLeft?this.maxHandleElement.position+this.handleHalfDimension:this.minHandleElement.position+this.handleHalfDimension;if(this.range)t=Math.abs(this.maxHandleElement.position-this.minHandleElement.position),e=i;else if(FY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue))n?(t=Math.ceil(Math.abs(this.maxHandlePosition-this.minHandleElement.position)+this.handleHalfDimension),e=Math.floor(this.minHandleElement.position+this.handleHalfDimension)):(t=this.minHandleElement.position+this.handleHalfDimension,e=0);else{var r=this.viewOptions.showSelectionBarFromValue,o=this.valueToPosition(r);(this.viewOptions.rightToLeft?this.viewLowValue<=r:this.viewLowValue>r)?(t=this.minHandleElement.position-o,e=o+this.handleHalfDimension):(t=o-this.minHandleElement.position,e=this.minHandleElement.position+this.handleHalfDimension)}if(this.selectionBarElement.setDimension(t),this.selectionBarElement.setPosition(e),this.range&&this.viewOptions.showOuterSelectionBars&&(this.viewOptions.rightToLeft?(this.rightOuterSelectionBarElement.setDimension(e),this.rightOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.leftOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(e+t)),this.leftOuterSelectionBarElement.setPosition(e+t)):(this.leftOuterSelectionBarElement.setDimension(e),this.leftOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.rightOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(e+t)),this.rightOuterSelectionBarElement.setPosition(e+t))),FY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!FY.isNullOrUndefined(this.viewOptions.selectionBarGradient)){var a=FY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue)?0:this.valueToPosition(this.viewOptions.showSelectionBarFromValue),s=a-e>0&&!n||a-e<=0&&n;this.barStyle={backgroundImage:"linear-gradient(to "+(this.viewOptions.vertical?s?"bottom":"top":s?"left":"right")+", "+this.viewOptions.selectionBarGradient.from+" 0%,"+this.viewOptions.selectionBarGradient.to+" 100%)"},this.viewOptions.vertical?(this.barStyle.backgroundPosition="center "+(a+t+e+(s?-this.handleHalfDimension:0))+"px",this.barStyle.backgroundSize="100% "+(this.fullBarElement.dimension-this.handleHalfDimension)+"px"):(this.barStyle.backgroundPosition=a-e+(s?this.handleHalfDimension:0)+"px center",this.barStyle.backgroundSize=this.fullBarElement.dimension-this.handleHalfDimension+"px 100%")}}else{var u=this.getSelectionBarColor();this.barStyle={backgroundColor:u}}}},{key:"getSelectionBarColor",value:function(){return this.range?this.viewOptions.getSelectionBarColor(this.value,this.highValue):this.viewOptions.getSelectionBarColor(this.value)}},{key:"getPointerColor",value:function(e){return this.viewOptions.getPointerColor(e===DY.Max?this.highValue:this.value,e)}},{key:"getTickColor",value:function(e){return this.viewOptions.getTickColor(e)}},{key:"updateCombinedLabel",value:function(){if(this.viewOptions.rightToLeft?this.minHandleLabelElement.position-this.minHandleLabelElement.dimension-10<=this.maxHandleLabelElement.position:this.minHandleLabelElement.position+this.minHandleLabelElement.dimension+10>=this.maxHandleLabelElement.position){var e=this.getDisplayValue(this.viewLowValue,NY.Low),t=this.getDisplayValue(this.viewHighValue,NY.High),n=this.viewOptions.rightToLeft?this.viewOptions.combineLabels(t,e):this.viewOptions.combineLabels(e,t);this.combinedLabelElement.setValue(n);var i=this.viewOptions.boundPointerLabels?Math.min(Math.max(this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2,0),this.fullBarElement.dimension-this.combinedLabelElement.dimension):this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2;this.combinedLabelElement.setPosition(i),this.minHandleLabelElement.hide(),this.maxHandleLabelElement.hide(),this.combinedLabelElement.show()}else this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.maxHandleLabelElement.show(),this.minHandleLabelElement.show(),this.combinedLabelElement.hide();this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}},{key:"getDisplayValue",value:function(e,t){return!FY.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(e=this.getStepValue(e)),this.viewOptions.translate(e,t)}},{key:"roundStep",value:function(e,t){var n=FY.isNullOrUndefined(t)?this.viewOptions.step:t,i=VY.roundToPrecisionLimit((e-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,VY.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}},{key:"valueToPosition",value:function(e){var t=FY.linearValueToPosition;FY.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(t=FY.logValueToPosition):t=this.viewOptions.customValueToPosition;var n=t(e=VY.clampToRange(e,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return FY.isNullOrUndefined(n)&&(n=0),this.viewOptions.rightToLeft&&(n=1-n),n*this.maxHandlePosition}},{key:"positionToValue",value:function(e){var t=e/this.maxHandlePosition;this.viewOptions.rightToLeft&&(t=1-t);var n=FY.linearPositionToValue;FY.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=FY.logPositionToValue):n=this.viewOptions.customPositionToValue;var i=n(t,this.viewOptions.floor,this.viewOptions.ceil);return FY.isNullOrUndefined(i)?0:i}},{key:"getEventXY",value:function(e,t){if(e instanceof MouseEvent)return this.viewOptions.vertical?e.clientY:e.clientX;var n=0,i=e.touches;if(!FY.isNullOrUndefined(t))for(var r=0;ri?DY.Max:this.viewOptions.rightToLeft?t>this.minHandleElement.position?DY.Min:DY.Max:t=this.maxHandlePosition?o=this.viewOptions.rightToLeft?this.viewOptions.floor:this.viewOptions.ceil:(o=this.positionToValue(a),o=t&&!FY.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(o,this.viewOptions.tickStep):this.roundStep(o)),this.positionTrackingHandle(o)}},{key:"onEnd",value:function(e){BY.isTouchEvent(e)&&e.changedTouches[0].identifier!==this.touchId||(this.touchId=null,this.viewOptions.keyboardSupport||(this.minHandleElement.active=!1,this.maxHandleElement.active=!1,this.currentTrackingPointer=null),this.dragging.active=!1,this.unsubscribeOnMove(),this.unsubscribeOnEnd(),this.userChangeEnd.emit(this.getChangeContext()))}},{key:"onPointerFocus",value:function(e){var t=this,n=this.getPointerElement(e);n.on("blur",function(){return t.onPointerBlur(n)}),n.on("keydown",function(e){return t.onKeyboardEvent(e)}),n.on("keyup",function(){return t.onKeyUp()}),n.active=!0,this.currentTrackingPointer=e,this.currentFocusPointer=e,this.firstKeyDown=!0}},{key:"onKeyUp",value:function(){this.firstKeyDown=!0,this.userChangeEnd.emit(this.getChangeContext())}},{key:"onPointerBlur",value:function(e){e.off("blur"),e.off("keydown"),e.off("keyup"),e.active=!1,FY.isNullOrUndefined(this.touchId)&&(this.currentTrackingPointer=null,this.currentFocusPointer=null)}},{key:"getKeyActions",value:function(e){var t=this.viewOptions.ceil-this.viewOptions.floor,n=e+this.viewOptions.step,i=e-this.viewOptions.step,r=e+t/10,o=e-t/10;this.viewOptions.reversedControls&&(n=e-this.viewOptions.step,i=e+this.viewOptions.step,r=e-t/10,o=e+t/10);var a={UP:n,DOWN:i,LEFT:i,RIGHT:n,PAGEUP:r,PAGEDOWN:o,HOME:this.viewOptions.reversedControls?this.viewOptions.ceil:this.viewOptions.floor,END:this.viewOptions.reversedControls?this.viewOptions.floor:this.viewOptions.ceil};return this.viewOptions.rightToLeft&&(a.LEFT=n,a.RIGHT=i,this.viewOptions.vertical&&(a.UP=i,a.DOWN=n)),a}},{key:"onKeyboardEvent",value:function(e){var t=this.getCurrentTrackingValue(),n=FY.isNullOrUndefined(e.keyCode)?e.which:e.keyCode,i=this.getKeyActions(t)[{38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"}[n]];if(!FY.isNullOrUndefined(i)&&!FY.isNullOrUndefined(this.currentTrackingPointer)){e.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));var r=VY.clampToRange(i,this.viewOptions.floor,this.viewOptions.ceil),o=this.roundStep(r);if(this.viewOptions.draggableRangeOnly){var a,s,u=this.viewHighValue-this.viewLowValue;this.currentTrackingPointer===DY.Min?(a=o,(s=o+u)>this.viewOptions.ceil&&(a=(s=this.viewOptions.ceil)-u)):this.currentTrackingPointer===DY.Max&&(s=o,(a=o-u)=this.maxHandlePosition-t;if(o<=n){if(0===i.position)return;a=this.getMinValue(o,!0,!1),s=this.getMaxValue(o,!0,!1)}else if(u){if(r.position===this.maxHandlePosition)return;s=this.getMaxValue(o,!0,!0),a=this.getMinValue(o,!0,!0)}else a=this.getMinValue(o,!1,!1),s=this.getMaxValue(o,!1,!1);this.positionTrackingBar(a,s)}},{key:"positionTrackingBar",value:function(e,t){!FY.isNullOrUndefined(this.viewOptions.minLimit)&&ethis.viewOptions.maxLimit&&(e=VY.roundToPrecisionLimit((t=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=e,this.viewHighValue=t,this.applyViewChange(),this.updateHandles(DY.Min,this.valueToPosition(e)),this.updateHandles(DY.Max,this.valueToPosition(t))}},{key:"positionTrackingHandle",value:function(e){e=this.applyMinMaxLimit(e),this.range&&(this.viewOptions.pushRange?e=this.applyPushRange(e):(this.viewOptions.noSwitching&&(this.currentTrackingPointer===DY.Min&&e>this.viewHighValue?e=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===DY.Max&&ethis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(DY.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=DY.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===DY.Max&&ethis.viewOptions.maxLimit?this.viewOptions.maxLimit:e}},{key:"applyMinMaxRange",value:function(e){var t=Math.abs(e-(this.currentTrackingPointer===DY.Min?this.viewHighValue:this.viewLowValue));if(!FY.isNullOrUndefined(this.viewOptions.minRange)&&tthis.viewOptions.maxRange){if(this.currentTrackingPointer===DY.Min)return VY.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===DY.Max)return VY.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return e}},{key:"applyPushRange",value:function(e){var t=this.currentTrackingPointer===DY.Min?this.viewHighValue-e:e-this.viewLowValue,n=FY.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ti&&(this.currentTrackingPointer===DY.Min?(this.viewHighValue=VY.roundToPrecisionLimit(e+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(DY.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===DY.Max&&(this.viewLowValue=VY.roundToPrecisionLimit(e-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(DY.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),e}},{key:"getChangeContext",value:function(){var e=new jY;return e.pointerType=this.currentTrackingPointer,e.value=+this.value,this.range&&(e.highValue=+this.highValue),e}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Zu),Es(Ku),Es(wc),Es(Vl))},e.\u0275cmp=Ct({type:e,selectors:[["ng5-slider"]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,fY,5),2&e)&&(ll(i=dl())&&(t.tooltipTemplate=i.first))},viewQuery:function(e,t){var n;(1&e&&(hl(dY,5,HY),hl(pY,5,HY),hl(vY,5,HY),hl(gY,5,HY),hl(mY,5,GY),hl(yY,5,GY),hl(bY,5,WY),hl(_Y,5,WY),hl(wY,5,WY),hl(kY,5,WY),hl(xY,5,WY),hl(SY,5,HY)),2&e)&&(ll(n=dl())&&(t.leftOuterSelectionBarElement=n.first),ll(n=dl())&&(t.rightOuterSelectionBarElement=n.first),ll(n=dl())&&(t.fullBarElement=n.first),ll(n=dl())&&(t.selectionBarElement=n.first),ll(n=dl())&&(t.minHandleElement=n.first),ll(n=dl())&&(t.maxHandleElement=n.first),ll(n=dl())&&(t.floorLabelElement=n.first),ll(n=dl())&&(t.ceilLabelElement=n.first),ll(n=dl())&&(t.minHandleLabelElement=n.first),ll(n=dl())&&(t.maxHandleLabelElement=n.first),ll(n=dl())&&(t.combinedLabelElement=n.first),ll(n=dl())&&(t.ticksElement=n.first))},hostAttrs:[1,"ng5-slider"],hostVars:5,hostBindings:function(e,t){1&e&&Fs("resize",function(e){return t.onResize(e)},!1,to),2&e&&(_s("disabled",t.sliderElementDisabledAttr),su("vertical",t.sliderElementVerticalClass)("animate",t.sliderElementAnimateClass))},inputs:{value:"value",highValue:"highValue",options:"options",manualRefresh:"manualRefresh",triggerFocus:"triggerFocus"},outputs:{valueChange:"valueChange",highValueChange:"highValueChange",userChangeStart:"userChangeStart",userChange:"userChange",userChangeEnd:"userChangeEnd"},features:[Hu([QY]),Gt],decls:29,vars:13,consts:[["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-left-out-selection"],["leftOuterSelectionBar",""],[1,"ng5-slider-span","ng5-slider-bar"],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-right-out-selection"],["rightOuterSelectionBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-full-bar"],["fullBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-selection-bar"],["selectionBar",""],[1,"ng5-slider-span","ng5-slider-bar","ng5-slider-selection",3,"ngStyle"],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-min",3,"ngStyle"],["minHandle",""],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-max",3,"ngStyle"],["maxHandle",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-floor"],["floorLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-ceil"],["ceilLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-value"],["minHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-high"],["maxHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-combined"],["combinedLabel",""],["ng5SliderElement","",1,"ng5-slider-ticks",3,"hidden"],["ticksElement",""],["class","ng5-slider-tick",3,"ngClass","ngStyle",4,"ngFor","ngForOf"],[1,"ng5-slider-tick",3,"ngClass","ngStyle"],[3,"template","tooltip","placement"],["class","ng5-slider-span ng5-slider-tick-value",3,"template","tooltip","placement","content",4,"ngIf"],["class","ng5-slider-span ng5-slider-tick-legend",3,"innerHTML",4,"ngIf"],[1,"ng5-slider-span","ng5-slider-tick-value",3,"template","tooltip","placement","content"],[1,"ng5-slider-span","ng5-slider-tick-legend",3,"innerHTML"]],template:function(e,t){1&e&&(Ts(0,"span",0,1),Ps(2,"span",2),As(),Ts(3,"span",3,4),Ps(5,"span",2),As(),Ts(6,"span",5,6),Ps(8,"span",2),As(),Ts(9,"span",7,8),Ps(11,"span",9),As(),Ps(12,"span",10,11),Ps(14,"span",12,13),Ps(16,"span",14,15),Ps(18,"span",16,17),Ps(20,"span",18,19),Ps(22,"span",20,21),Ps(24,"span",22,23),Ts(26,"span",24,25),xs(28,TY,4,9,"span",26),As()),2&e&&(qo(6),su("ng5-slider-transparent",t.fullBarTransparentClass),qo(3),su("ng5-slider-draggable",t.selectionBarDraggableClass),qo(2),Cs("ngStyle",t.barStyle),qo(1),Cs("ngStyle",t.minPointerStyle),qo(2),au("display",t.range?"inherit":"none"),Cs("ngStyle",t.maxPointerStyle),qo(12),su("ng5-slider-ticks-values-under",t.ticksUnderValuesClass),Cs("hidden",!t.showTicks),qo(2),Cs("ngForOf",t.ticks))},directives:function(){return[HY,Hh,GY,WY,Dh,Ih,ZY,Lh]},styles:[".ng5-slider{display:inline-block;position:relative;height:4px;width:100%;margin:35px 0 15px;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y} .ng5-slider.with-legend{margin-bottom:40px} .ng5-slider[disabled]{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-pointer{cursor:not-allowed;background-color:#d8e0f3} .ng5-slider[disabled] .ng5-slider-draggable{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-selection{background:#8b91a2} .ng5-slider[disabled] .ng5-slider-tick{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-tick.ng5-slider-selected{background:#8b91a2} .ng5-slider .ng5-slider-span{white-space:nowrap;position:absolute;display:inline-block} .ng5-slider .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider .ng5-slider-bar-wrapper{left:0;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:-16px;padding-top:16px;width:100%;height:32px;z-index:1} .ng5-slider .ng5-slider-draggable{cursor:move} .ng5-slider .ng5-slider-bar{left:0;width:100%;height:4px;z-index:1;background:#d8e0f3;border-radius:2px} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-transparent .ng5-slider-bar{background:0 0} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-left-out-selection .ng5-slider-bar{background:#df002d} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-right-out-selection .ng5-slider-bar{background:#03a688} .ng5-slider .ng5-slider-selection{z-index:2;background:#0db9f0;border-radius:2px} .ng5-slider .ng5-slider-pointer{cursor:pointer;width:32px;height:32px;top:-14px;background-color:#0db9f0;z-index:3;border-radius:16px} .ng5-slider .ng5-slider-pointer:after{content:'';width:8px;height:8px;position:absolute;top:12px;left:12px;border-radius:4px;background:#fff} .ng5-slider .ng5-slider-pointer:hover:after{background-color:#fff} .ng5-slider .ng5-slider-pointer.ng5-slider-active{z-index:4} .ng5-slider .ng5-slider-pointer.ng5-slider-active:after{background-color:#451aff} .ng5-slider .ng5-slider-bubble{cursor:default;bottom:16px;padding:1px 3px;color:#55637d;font-size:16px} .ng5-slider .ng5-slider-bubble.ng5-slider-limit{color:#55637d} .ng5-slider .ng5-slider-ticks{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:0;position:absolute;left:0;top:-3px;margin:0;z-index:1;list-style:none} .ng5-slider .ng5-slider-ticks-values-under .ng5-slider-tick-value{top:auto;bottom:-36px} .ng5-slider .ng5-slider-tick{text-align:center;cursor:pointer;width:10px;height:10px;background:#d8e0f3;border-radius:50%;position:absolute;top:0;left:0;margin-left:11px} .ng5-slider .ng5-slider-tick.ng5-slider-selected{background:#0db9f0} .ng5-slider .ng5-slider-tick-value{position:absolute;top:-34px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0)} .ng5-slider .ng5-slider-tick-legend{position:absolute;top:24px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0);max-width:50px;white-space:normal} .ng5-slider.vertical{position:relative;width:4px;height:100%;margin:0 20px;padding:0;vertical-align:baseline;-ms-touch-action:pan-x;touch-action:pan-x} .ng5-slider.vertical .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider.vertical .ng5-slider-bar-wrapper{top:auto;left:0;margin:0 0 0 -16px;padding:0 0 0 16px;height:100%;width:32px} .ng5-slider.vertical .ng5-slider-bar{bottom:0;left:auto;width:4px;height:100%} .ng5-slider.vertical .ng5-slider-pointer{left:-14px!important;top:auto;bottom:0} .ng5-slider.vertical .ng5-slider-bubble{left:16px!important;bottom:0} .ng5-slider.vertical .ng5-slider-ticks{height:100%;width:0;left:-3px;top:0;z-index:1} .ng5-slider.vertical .ng5-slider-tick{vertical-align:middle;margin-left:auto;margin-top:11px} .ng5-slider.vertical .ng5-slider-tick-value{left:24px;top:auto;-webkit-transform:translate(0,-28%);transform:translate(0,-28%)} .ng5-slider.vertical .ng5-slider-tick-legend{top:auto;right:24px;-webkit-transform:translate(0,-28%);transform:translate(0,-28%);max-width:none;white-space:nowrap} .ng5-slider.vertical .ng5-slider-ticks-values-under .ng5-slider-tick-value{bottom:auto;left:auto;right:24px} .ng5-slider *{-webkit-transition:none;transition:none} .ng5-slider.animate .ng5-slider-bar-wrapper{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-selection{-webkit-transition:background-color linear .3s;transition:background-color linear .3s} .ng5-slider.animate .ng5-slider-pointer{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-limit{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-combined{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-tick{-webkit-transition:background-color linear .3s;transition:background-color linear .3s}"]}),e}(),ZY=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ng5-slider-tooltip-wrapper"]],inputs:{template:"template",tooltip:"tooltip",placement:"placement",content:"content"},decls:2,vars:2,consts:[[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ng5-slider-inner-tooltip"]],template:function(e,t){1&e&&(xs(0,IY,2,6,"ng-container",0),xs(1,RY,3,3,"ng-container",0)),2&e&&(Cs("ngIf",t.template),qo(1),Cs("ngIf",!t.template))},directives:[Lh,Gh],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),e}(),JY=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh]]}),e}(),eK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,Kp,rp,Uz,sY,JY]]}),e}(),tK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,zX,uY,eK,I_,S_]]}),e}(),nK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,S_,tK]]}),e}(),iK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,uz,cz,sU,Uz,gU,S_]]}),e}(),rK=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this)).getLevel=e,o.isExpandable=i,o.options=r,o.options&&(o.trackBy=o.options.trackBy),o}return b(n,[{key:"getDescendants",value:function(e){for(var t=[],n=this.dataNodes.indexOf(e)+1;n1&&void 0!==arguments[1]?arguments[1]:this._dataDiffer,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._nodeOutlet.viewContainer,r=arguments.length>3?arguments[3]:void 0,o=n.diff(e);!o||(o.forEachOperation(function(n,o,a){if(null==n.previousIndex)t.insertNode(e[a],a,i,r);else if(null==a)i.remove(o),t._levels.delete(n.item);else{var s=i.get(o);i.move(s,a)}}),this._changeDetectorRef.detectChanges())}},{key:"_getNodeDef",value:function(e,t){return 1===this._nodeDefs.length?this._nodeDefs.first:this._nodeDefs.find(function(n){return n.when&&n.when(t,e)})||this._defaultNodeDef}},{key:"insertNode",value:function(e,t,n,i){var r=this._getNodeDef(e,t),o=new sK(e);o.level=this.treeControl.getLevel?this.treeControl.getLevel(e):void 0!==i&&this._levels.has(i)?this._levels.get(i)+1:0,this._levels.set(e,o.level),(n||this._nodeOutlet.viewContainer).createEmbeddedView(r.template,o,t),lK.mostRecentTreeNode&&(lK.mostRecentTreeNode.data=e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(pc),Es(wc))},e.\u0275cmp=Ct({type:e,selectors:[["cdk-tree"]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,uK,5),2&e)&&(ll(i=dl())&&(t._nodeDefs=i))},viewQuery:function(e,t){var n;(1&e&&hl(aK,7),2&e)&&(ll(n=dl())&&(t._nodeOutlet=n.first))},hostAttrs:["role","tree",1,"cdk-tree"],inputs:{dataSource:"dataSource",treeControl:"treeControl",trackBy:"trackBy"},exportAs:["cdkTree"],decls:1,vars:0,consts:[["cdkTreeNodeOutlet",""]],template:function(e,t){1&e&&Rs(0,0)},directives:[aK],encapsulation:2}),e}(),lK=function(){var e=function(){function e(t,n){m(this,e),this._elementRef=t,this._tree=n,this._destroyed=new oe,this._dataChanges=new oe,e.mostRecentTreeNode=this,this._elementRef.nativeElement.classList.add("cdk-tree-node"),this.role="treeitem"}return b(e,[{key:"role",get:function(){return"treeitem"},set:function(e){this._elementRef.nativeElement.setAttribute("role",e)}},{key:"data",get:function(){return this._data},set:function(e){e!==this._data&&(this._data=e,this._setRoleFromData(),this._dataChanges.next())}},{key:"isExpanded",get:function(){return this._tree.treeControl.isExpanded(this._data)}},{key:"_setExpanded",value:function(e){this._isAriaExpanded=e,this._elementRef.nativeElement.setAttribute("aria-expanded","".concat(e))}},{key:"level",get:function(){return this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._data):this._parentNodeAriaLevel}},{key:"ngOnInit",value:function(){this._parentNodeAriaLevel=function(e){for(var t=e.parentElement;t&&!hK(t);)t=t.parentElement;return t?t.classList.contains("cdk-nested-tree-node")?Rf(t.getAttribute("aria-level")):0:-1}(this._elementRef.nativeElement),this._elementRef.nativeElement.setAttribute("aria-level","".concat(this.level+1))}},{key:"ngDoCheck",value:function(){this.isExpanded!=this._isAriaExpanded&&this._setExpanded(this.isExpanded)}},{key:"ngOnDestroy",value:function(){e.mostRecentTreeNode===this&&(e.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}},{key:"focus",value:function(){this._elementRef.nativeElement.focus()}},{key:"_setRoleFromData",value:function(){this.role="treeitem"}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(cK))},e.\u0275dir=It({type:e,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),e.mostRecentTreeNode=null,e}();function hK(e){var t=e.classList;return!(!(null==t?void 0:t.contains("cdk-nested-tree-node"))&&!(null==t?void 0:t.contains("cdk-tree")))}var fK=/([A-Za-z%]+)$/,dK=function(){var e=function(){function e(t,n,i,r){var o=this;m(this,e),this._treeNode=t,this._tree=n,this._element=i,this._dir=r,this._destroyed=new oe,this.indentUnits="px",this._indent=40,this._setPadding(),r&&r.change.pipe(ud(this._destroyed)).subscribe(function(){return o._setPadding(!0)}),t._dataChanges.subscribe(function(){return o._setPadding()})}return b(e,[{key:"level",get:function(){return this._level},set:function(e){this._setLevelInput(e)}},{key:"indent",get:function(){return this._indent},set:function(e){this._setIndentInput(e)}},{key:"ngOnDestroy",value:function(){this._destroyed.next(),this._destroyed.complete()}},{key:"_paddingIndent",value:function(){var e=this._treeNode.data&&this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._treeNode.data):null,t=null==this._level?e:this._level;return"number"==typeof t?"".concat(t*this._indent).concat(this.indentUnits):null}},{key:"_setPadding",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._paddingIndent();if(t!==this._currentPadding||e){var n=this._element.nativeElement,i=this._dir&&"rtl"===this._dir.value?"paddingRight":"paddingLeft",r="paddingLeft"===i?"paddingRight":"paddingLeft";n.style[i]=t||"",n.style[r]="",this._currentPadding=t}}},{key:"_setLevelInput",value:function(e){this._level=Rf(e,null),this._setPadding()}},{key:"_setIndentInput",value:function(e){var t=e,n="px";if("string"==typeof e){var i=e.split(fK);t=i[0],n=i[1]||n}this.indentUnits=n,this._indent=Rf(t),this._setPadding()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(lK),Es(cK),Es(Ku),Es(zd,8))},e.\u0275dir=It({type:e,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),e}(),pK=function(){var e=function(){function e(t,n){m(this,e),this._tree=t,this._treeNode=n,this._recursive=!1}return b(e,[{key:"recursive",get:function(){return this._recursive},set:function(e){this._recursive=If(e)}},{key:"_toggle",value:function(e){this.recursive?this._tree.treeControl.toggleDescendants(this._treeNode.data):this._tree.treeControl.toggle(this._treeNode.data),e.stopPropagation()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(cK),Es(lK))},e.\u0275dir=It({type:e,selectors:[["","cdkTreeNodeToggle",""]],hostBindings:function(e,t){1&e&&Fs("click",function(e){return t._toggle(e)})},inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]}}),e}(),vK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),gK=Ky(qy(lK)),mK=function(){var t=function(t){a(i,t);var n=s(i);function i(e,t,r){var o;return m(this,i),(o=n.call(this,e,t)).tabIndex=Number(r)||0,e.nativeElement.classList.add("mat-tree-node"),o}return b(i,[{key:"ngOnInit",value:function(){e(p(i.prototype),"ngOnInit",this).call(this)}},{key:"ngDoCheck",value:function(){e(p(i.prototype),"ngDoCheck",this).call(this)}},{key:"ngOnDestroy",value:function(){e(p(i.prototype),"ngOnDestroy",this).call(this)}}]),i}(gK);return t.\u0275fac=function(e){return new(e||t)(Es(Ku),Es(cK),Ti("tabindex"))},t.\u0275dir=It({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[Hu([{provide:lK,useExisting:t}]),ss]}),t}(),yK=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(uK);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["","matTreeNodeDef",""]],inputs:{when:["matTreeNodeDefWhen","when"],data:["matTreeNode","data"]},features:[Hu([{provide:uK,useExisting:t}]),ss]}),t}(),bK=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"level",get:function(){return this._level},set:function(e){this._setLevelInput(e)}},{key:"indent",get:function(){return this._indent},set:function(e){this._setIndentInput(e)}}]),n}(dK);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["","matTreeNodePadding",""]],inputs:{level:["matTreeNodePadding","level"],indent:["matTreeNodePaddingIndent","indent"]},features:[Hu([{provide:dK,useExisting:t}]),ss]}),t}(),_K=function(){var e=function e(t,n){m(this,e),this.viewContainer=t,this._node=n};return e.\u0275fac=function(t){return new(t||e)(Es(Mc),Es(oK,8))},e.\u0275dir=It({type:e,selectors:[["","matTreeNodeOutlet",""]],features:[Hu([{provide:aK,useExisting:e}])]}),e}(),wK=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(cK);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275cmp=Ct({type:t,selectors:[["mat-tree"]],viewQuery:function(e,t){var n;(1&e&&hl(_K,7),2&e)&&(ll(n=dl())&&(t._nodeOutlet=n.first))},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[Hu([{provide:cK,useExisting:t}]),ss],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(e,t){1&e&&Rs(0,0)},directives:[_K],styles:[".mat-tree{display:block}.mat-tree-node{display:flex;align-items:center;flex:1;word-wrap:break-word}.mat-nested-tree-node{border-bottom-width:0}\n"],encapsulation:2}),t}(),kK=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"recursive",get:function(){return this._recursive},set:function(e){this._recursive=If(e)}}]),n}(pK);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["","matTreeNodeToggle",""]],inputs:{recursive:["matTreeNodeToggleRecursive","recursive"]},features:[Hu([{provide:pK,useExisting:t}]),ss]}),t}(),xK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[vK,Wy],Wy]}),e}(),SK=function(){function e(t,n,i,r){m(this,e),this.transformFunction=t,this.getLevel=n,this.isExpandable=i,this.getChildren=r}return b(e,[{key:"_flattenNode",value:function(e,t,n,i){var r=this,o=this.transformFunction(e,t);if(n.push(o),this.isExpandable(o)){var a=this.getChildren(e);a&&(Array.isArray(a)?this._flattenChildren(a,t,n,i):a.pipe(ap(1)).subscribe(function(e){r._flattenChildren(e,t,n,i)}))}return n}},{key:"_flattenChildren",value:function(e,t,n,i){var r=this;e.forEach(function(o,a){var s=i.slice();s.push(a!=e.length-1),r._flattenNode(o,t+1,n,s)})}},{key:"flattenNodes",value:function(e){var t=this,n=[];return e.forEach(function(e){return t._flattenNode(e,0,n,[])}),n}},{key:"expandFlattenedNodes",value:function(e,t){var n=this,i=[],r=[];return r[0]=!0,e.forEach(function(e){for(var o=!0,a=0;a<=n.getLevel(e);a++)o=o&&r[a];o&&i.push(e),n.isExpandable(e)&&(r[n.getLevel(e)+1]=t.isExpanded(e))}),i}}]),e}(),EK=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this))._treeControl=e,o._treeFlattener=i,o._flattenedData=new nv([]),o._expandedData=new nv([]),o._data=new nv([]),r&&(o.data=r),o}return b(n,[{key:"data",get:function(){return this._data.value},set:function(e){this._data.next(e),this._flattenedData.next(this._treeFlattener.flattenNodes(this.data)),this._treeControl.dataNodes=this._flattenedData.value}},{key:"connect",value:function(e){var t=this;return Ce(e.viewChange,this._treeControl.expansionModel.changed,this._flattenedData).pipe(ue(function(){return t._expandedData.next(t._treeFlattener.expandFlattenedNodes(t._flattenedData.value,t._treeControl)),t._expandedData.value}))}},{key:"disconnect",value:function(){}}]),n}(function(){return function e(){m(this,e)}}()),CK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_,S_,pw,xK,qG]]}),e}(),OK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,iK,CK]]}),e}(),TK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,iK,CK,OK],iK,CK,OK]}),e}();function AK(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function PK(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach(function(n){void 0===e[n]?e[n]=t[n]:AK(t[n])&&AK(e[n])&&Object.keys(t[n]).length>0&&PK(e[n],t[n])})}var MK={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function IK(){var e="undefined"!=typeof document?document:{};return PK(e,MK),e}var RK={document:MK,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(e){return"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function DK(){var e="undefined"!=typeof window?window:{};return PK(e,RK),e}function NK(e){return(NK=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function LK(e,t){return(LK=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jK(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(H){return!1}}function FK(e,t,n){return(FK=jK()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&LK(r,n.prototype),r}).apply(null,arguments)}function BK(e){var t="function"==typeof Map?new Map:void 0;return(BK=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return FK(e,arguments,NK(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),LK(n,e)})(e)}var VK=function(e){function t(t){var n;return function(e){var t=e.__proto__;Object.defineProperty(e,"__proto__",{get:function(){return t},set:function(e){t.__proto__=e}})}(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n=e.call.apply(e,[this].concat(t))||this)),n}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t}(BK(Array));function zK(e){void 0===e&&(e=[]);var t=[];return e.forEach(function(e){Array.isArray(e)?t.push.apply(t,zK(e)):t.push(e)}),t}function UK(e,t){return Array.prototype.filter.call(e,t)}function HK(e,t){var n=DK(),i=IK(),r=[];if(!t&&e instanceof VK)return e;if(!e)return new VK(r);if("string"==typeof e){var o=e.trim();if(o.indexOf("<")>=0&&o.indexOf(">")>=0){var a="div";0===o.indexOf("0}).length>0},toggleClass:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0;d-=1){var p=f[d];o&&p.listener===o||o&&p.listener&&p.listener.dom7proxy&&p.listener.dom7proxy===o?(h.removeEventListener(c,p.proxyListener,a),f.splice(d,1)):o||(h.removeEventListener(c,p.proxyListener,a),f.splice(d,1))}}return this},trigger:function(){for(var e=DK(),t=arguments.length,n=new Array(t),i=0;i0}),c.dispatchEvent(l),c.dom7EventData=[],delete c.dom7EventData}}return this},transitionEnd:function(e){var t=this;return e&&t.on("transitionend",function n(i){i.target===this&&(e.call(this,i),t.off("transitionend",n))}),this},outerWidth:function(e){if(this.length>0){if(e){var t=this.styles();return this[0].offsetWidth+parseFloat(t.getPropertyValue("margin-right"))+parseFloat(t.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(e){if(this.length>0){if(e){var t=this.styles();return this[0].offsetHeight+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},styles:function(){var e=DK();return this[0]?e.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var e=DK(),t=IK(),n=this[0],i=n.getBoundingClientRect(),r=t.body;return{top:i.top+(n===e?e.scrollY:n.scrollTop)-(n.clientTop||r.clientTop||0),left:i.left+(n===e?e.scrollX:n.scrollLeft)-(n.clientLeft||r.clientLeft||0)}}return null},css:function(e,t){var n,i=DK();if(1===arguments.length){if("string"!=typeof e){for(n=0;nt-1)return HK([]);if(e<0){var n=t+e;return HK(n<0?[]:[this[n]])}return HK([this[e]])},append:function(){for(var e,t=IK(),n=0;n=0;n-=1)this[t].insertBefore(r.childNodes[n],this[t].childNodes[0])}else if(e instanceof VK)for(n=0;n0?e?this[0].nextElementSibling&&HK(this[0].nextElementSibling).is(e)?HK([this[0].nextElementSibling]):HK([]):HK(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):HK([])},nextAll:function(e){var t=[],n=this[0];if(!n)return HK([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;e?HK(i).is(e)&&t.push(i):t.push(i),n=i}return HK(t)},prev:function(e){if(this.length>0){var t=this[0];return e?t.previousElementSibling&&HK(t.previousElementSibling).is(e)?HK([t.previousElementSibling]):HK([]):HK(t.previousElementSibling?[t.previousElementSibling]:[])}return HK([])},prevAll:function(e){var t=[],n=this[0];if(!n)return HK([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;e?HK(i).is(e)&&t.push(i):t.push(i),n=i}return HK(t)},parent:function(e){for(var t=[],n=0;n=0,observer:"MutationObserver"in e||"WebkitMutationObserver"in e,passiveListener:function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassiveListener",null,n)}catch(i){}return t}(),gestures:"ongesturestart"in e}}()),XK}function rQ(e){return void 0===e&&(e={}),YK||(YK=function(e){var t=(void 0===e?{}:e).userAgent,n=iQ(),i=DK(),r=i.navigator.platform,o=t||i.navigator.userAgent,a={ios:!1,android:!1},s=i.screen.width,u=i.screen.height,c=o.match(/(Android);?[\s\/]+([\d.]+)?/),l=o.match(/(iPad).*OS\s([\d_]+)/),h=o.match(/(iPod)(.*OS\s([\d_]+))?/),f=!l&&o.match(/(iPhone\sOS|iOS)\s([\d_]+)/),d="Win32"===r,p="MacIntel"===r;return!l&&p&&n.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(s+"x"+u)>=0&&((l=o.match(/(Version)\/([\d.]+)/))||(l=[0,1,"13_0_0"]),p=!1),c&&!d&&(a.os="android",a.android=!0),(l||f||h)&&(a.os="ios",a.ios=!0),a}(e)),YK}function oQ(){return KK||(KK=function(){var e,t=DK();return{isEdge:!!t.navigator.userAgent.match(/Edge/g),isSafari:(e=t.navigator.userAgent.toLowerCase(),e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0),isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(t.navigator.userAgent)}}()),KK}var aQ={name:"resize",create:function(){var e=this;tQ(e,{resize:{observer:null,createObserver:function(){!e||e.destroyed||!e.initialized||(e.resize.observer=new ResizeObserver(function(t){var n=e.width,i=e.height,r=n,o=i;t.forEach(function(t){var n=t.contentBoxSize,i=t.contentRect,a=t.target;a&&a!==e.el||(r=i?i.width:(n[0]||n).inlineSize,o=i?i.height:(n[0]||n).blockSize)}),(r!==n||o!==i)&&e.resize.resizeHandler()}),e.resize.observer.observe(e.el))},removeObserver:function(){e.resize.observer&&e.resize.observer.unobserve&&e.el&&(e.resize.observer.unobserve(e.el),e.resize.observer=null)},resizeHandler:function(){!e||e.destroyed||!e.initialized||(e.emit("beforeResize"),e.emit("resize"))},orientationChangeHandler:function(){!e||e.destroyed||!e.initialized||e.emit("orientationchange")}}})},on:{init:function(e){var t=DK();e.params.resizeObserver&&void 0!==DK().ResizeObserver?e.resize.createObserver():(t.addEventListener("resize",e.resize.resizeHandler),t.addEventListener("orientationchange",e.resize.orientationChangeHandler))},destroy:function(e){var t=DK();e.resize.removeObserver(),t.removeEventListener("resize",e.resize.resizeHandler),t.removeEventListener("orientationchange",e.resize.orientationChangeHandler)}}};function sQ(){return(sQ=Object.assign||function(e){for(var t=1;t0)&&(!r.isTouched||!r.isMoved))){o.noSwipingClass&&""!==o.noSwipingClass&&s.target&&s.target.shadowRoot&&e.path&&e.path[0]&&(u=QK(e.path[0]));var c=o.noSwipingSelector?o.noSwipingSelector:"."+o.noSwipingClass;if(o.noSwiping&&(s.target&&s.target.shadowRoot?function(e,t){return void 0===t&&(t=this),function t(n){return n&&n!==IK()&&n!==DK()?(n.assignedSlot&&(n=n.assignedSlot),n.closest(e)||t(n.getRootNode().host)):null}(t)}(c,s.target):u.closest(c)[0]))return void(t.allowClick=!0);if(!o.swipeHandler||u.closest(o.swipeHandler)[0]){a.currentX="touchstart"===s.type?s.targetTouches[0].pageX:s.pageX,a.currentY="touchstart"===s.type?s.targetTouches[0].pageY:s.pageY;var l=a.currentX,h=a.currentY,f=o.edgeSwipeDetection||o.iOSEdgeSwipeDetection,d=o.edgeSwipeThreshold||o.iOSEdgeSwipeThreshold;if(f&&(l<=d||l>=i.innerWidth-d)){if("prevent"!==f)return;e.preventDefault()}if(tQ(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=l,a.startY=h,r.touchStartTime=ZK(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,o.threshold>0&&(r.allowThresholdMove=!1),"touchstart"!==s.type){var p=!0;u.is(r.focusableElements)&&(p=!1),n.activeElement&&QK(n.activeElement).is(r.focusableElements)&&n.activeElement!==u[0]&&n.activeElement.blur(),(o.touchStartForcePreventDefault||p&&t.allowTouchMove&&o.touchStartPreventDefault)&&!u[0].isContentEditable&&s.preventDefault()}t.emit("touchStart",s)}}}}function hQ(e){var t=IK(),n=this,i=n.touchEventsData,r=n.params,o=n.touches,a=n.rtlTranslate;if(n.enabled){var s=e;if(s.originalEvent&&(s=s.originalEvent),!i.isTouched)return void(i.startMoving&&i.isScrolling&&n.emit("touchMoveOpposite",s));if(!i.isTouchEvent||"touchmove"===s.type){var u="touchmove"===s.type&&s.targetTouches&&(s.targetTouches[0]||s.changedTouches[0]),c="touchmove"===s.type?u.pageX:s.pageX,l="touchmove"===s.type?u.pageY:s.pageY;if(s.preventedByNestedSwiper)return o.startX=c,void(o.startY=l);if(!n.allowTouchMove)return n.allowClick=!1,void(i.isTouched&&(tQ(o,{startX:c,startY:l,currentX:c,currentY:l}),i.touchStartTime=ZK()));if(i.isTouchEvent&&r.touchReleaseOnEdges&&!r.loop)if(n.isVertical()){if(lo.startY&&n.translate>=n.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(co.startX&&n.translate>=n.minTranslate())return;if(i.isTouchEvent&&t.activeElement&&s.target===t.activeElement&&QK(s.target).is(i.focusableElements))return i.isMoved=!0,void(n.allowClick=!1);if(i.allowTouchCallbacks&&n.emit("touchMove",s),!(s.targetTouches&&s.targetTouches.length>1)){o.currentX=c,o.currentY=l;var h=o.currentX-o.startX,f=o.currentY-o.startY;if(!(n.params.threshold&&Math.sqrt(Math.pow(h,2)+Math.pow(f,2))=25&&(d=180*Math.atan2(Math.abs(f),Math.abs(h))/Math.PI,i.isScrolling=n.isHorizontal()?d>r.touchAngle:90-d>r.touchAngle)),i.isScrolling&&n.emit("touchMoveOpposite",s),void 0===i.startMoving&&(o.currentX!==o.startX||o.currentY!==o.startY)&&(i.startMoving=!0),i.isScrolling)return void(i.isTouched=!1);if(i.startMoving){n.allowClick=!1,!r.cssMode&&s.cancelable&&s.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&s.stopPropagation(),i.isMoved||(r.loop&&n.loopFix(),i.startTranslate=n.getTranslate(),n.setTransition(0),n.animating&&n.$wrapperEl.trigger("webkitTransitionEnd transitionend"),i.allowMomentumBounce=!1,r.grabCursor&&(!0===n.allowSlideNext||!0===n.allowSlidePrev)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",s)),n.emit("sliderMove",s),i.isMoved=!0;var p=n.isHorizontal()?h:f;o.diff=p,p*=r.touchRatio,a&&(p=-p),n.swipeDirection=p>0?"prev":"next",i.currentTranslate=p+i.startTranslate;var v=!0,g=r.resistanceRatio;if(r.touchReleaseOnEdges&&(g=0),p>0&&i.currentTranslate>n.minTranslate()?(v=!1,r.resistance&&(i.currentTranslate=n.minTranslate()-1+Math.pow(-n.minTranslate()+i.startTranslate+p,g))):p<0&&i.currentTranslatei.startTranslate&&(i.currentTranslate=i.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(p)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,o.startX=o.currentX,o.startY=o.currentY,i.currentTranslate=i.startTranslate,void(o.diff=n.isHorizontal()?o.currentX-o.startX:o.currentY-o.startY)}!r.followFinger||r.cssMode||((r.freeMode||r.watchSlidesProgress||r.watchSlidesVisibility)&&(n.updateActiveIndex(),n.updateSlidesClasses()),r.freeMode&&(0===i.velocities.length&&i.velocities.push({position:o[n.isHorizontal()?"startX":"startY"],time:i.touchStartTime}),i.velocities.push({position:o[n.isHorizontal()?"currentX":"currentY"],time:ZK()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function fQ(e){var t=this,n=t.touchEventsData,i=t.params,r=t.touches,o=t.rtlTranslate,a=t.$wrapperEl,s=t.slidesGrid,u=t.snapGrid;if(t.enabled){var c=e;if(c.originalEvent&&(c=c.originalEvent),n.allowTouchCallbacks&&t.emit("touchEnd",c),n.allowTouchCallbacks=!1,!n.isTouched)return n.isMoved&&i.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,void(n.startMoving=!1);i.grabCursor&&n.isMoved&&n.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);var l,h=ZK(),f=h-n.touchStartTime;if(t.allowClick&&(t.updateClickedSlide(c),t.emit("tap click",c),f<300&&h-n.lastClickTime<300&&t.emit("doubleTap doubleClick",c)),n.lastClickTime=ZK(),$K(function(){t.destroyed||(t.allowClick=!0)}),!n.isTouched||!n.isMoved||!t.swipeDirection||0===r.diff||n.currentTranslate===n.startTranslate)return n.isTouched=!1,n.isMoved=!1,void(n.startMoving=!1);if(n.isTouched=!1,n.isMoved=!1,n.startMoving=!1,l=i.followFinger?o?t.translate:-t.translate:-n.currentTranslate,!i.cssMode){if(i.freeMode){if(l<-t.minTranslate())return void t.slideTo(t.activeIndex);if(l>-t.maxTranslate())return void t.slideTo(t.slides.length1){var d=n.velocities.pop(),p=n.velocities.pop(),v=d.time-p.time;t.velocity=(d.position-p.position)/v,t.velocity/=2,Math.abs(t.velocity)150||ZK()-d.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=i.freeModeMomentumVelocityRatio,n.velocities.length=0;var g=1e3*i.freeModeMomentumRatio,m=t.translate+t.velocity*g;o&&(m=-m);var y,b,_=!1,w=20*Math.abs(t.velocity)*i.freeModeMomentumBounceRatio;if(mt.minTranslate())i.freeModeMomentumBounce?(m-t.minTranslate()>w&&(m=t.minTranslate()+w),y=t.minTranslate(),_=!0,n.allowMomentumBounce=!0):m=t.minTranslate(),i.loop&&i.centeredSlides&&(b=!0);else if(i.freeModeSticky){for(var k,x=0;x-m){k=x;break}m=-(m=Math.abs(u[k]-m)=i.longSwipesMs)&&(t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses()))}for(var C=0,O=t.slidesSizesGrid[0],T=0;T=s[T]&&l=s[T]&&(C=T,O=s[s.length-1]-s[s.length-2])}var P=(l-s[C])/O,M=Ci.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&t.slideTo(P>=i.longSwipesRatio?C+M:C),"prev"===t.swipeDirection&&t.slideTo(P>1-i.longSwipesRatio?C+M:C)}else{if(!i.shortSwipes)return void t.slideTo(t.activeIndex);!t.navigation||c.target!==t.navigation.nextEl&&c.target!==t.navigation.prevEl?("next"===t.swipeDirection&&t.slideTo(C+M),"prev"===t.swipeDirection&&t.slideTo(C)):t.slideTo(c.target===t.navigation.nextEl?C+M:C)}}}}function dQ(){var e=this,t=e.params,n=e.el;if(!n||0!==n.offsetWidth){t.breakpoints&&e.setBreakpoint();var i=e.allowSlideNext,r=e.allowSlidePrev,o=e.snapGrid;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses(),e.slideTo(("auto"===t.slidesPerView||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides?e.slides.length-1:e.activeIndex,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.run(),e.allowSlidePrev=r,e.allowSlideNext=i,e.params.watchOverflow&&o!==e.snapGrid&&e.checkOverflow()}}function pQ(e){var t=this;!t.enabled||t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))}function vQ(){var e=this,t=e.wrapperEl,n=e.rtlTranslate;if(e.enabled){e.previousTranslate=e.translate,e.translate=e.isHorizontal()?n?t.scrollWidth-t.offsetWidth-t.scrollLeft:-t.scrollLeft:-t.scrollTop,-0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();var i=e.maxTranslate()-e.minTranslate();(0===i?0:(e.translate-e.minTranslate())/i)!==e.progress&&e.updateProgress(n?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}}var gQ=!1;function mQ(){}var yQ={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!1,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,slidesPerGroupSkip:0,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,loopPreventsSlide:!0,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0,_emitClasses:!1};var bQ={modular:{useParams:function(e){var t=this;!t.modules||Object.keys(t.modules).forEach(function(n){var i=t.modules[n];i.params&&tQ(e,i.params)})},useModules:function(e){void 0===e&&(e={});var t=this;!t.modules||Object.keys(t.modules).forEach(function(n){var i=t.modules[n],r=e[n]||{};i.on&&t.on&&Object.keys(i.on).forEach(function(e){t.on(e,i.on[e])}),i.create&&i.create.bind(t)(r)})}},eventsEmitter:{on:function(e,t,n){var i=this;if("function"!=typeof t)return i;var r=n?"unshift":"push";return e.split(" ").forEach(function(e){i.eventsListeners[e]||(i.eventsListeners[e]=[]),i.eventsListeners[e][r](t)}),i},once:function(e,t,n){var i=this;if("function"!=typeof t)return i;function r(){i.off(e,r),r.__emitterProxy&&delete r.__emitterProxy;for(var n=arguments.length,o=new Array(n),a=0;a=0&&t.eventsAnyListeners.splice(n,1),t},off:function(e,t){var n=this;return n.eventsListeners&&e.split(" ").forEach(function(e){void 0===t?n.eventsListeners[e]=[]:n.eventsListeners[e]&&n.eventsListeners[e].forEach(function(i,r){(i===t||i.__emitterProxy&&i.__emitterProxy===t)&&n.eventsListeners[e].splice(r,1)})}),n},emit:function(){var e=this;if(!e.eventsListeners)return e;for(var t,n,i,r=arguments.length,o=new Array(r),a=0;a=0&&(b=parseFloat(b.replace("%",""))/100*o),e.virtualSize=-b,l.css(a?{marginLeft:"",marginBottom:"",marginTop:""}:{marginRight:"",marginBottom:"",marginTop:""}),i.slidesPerColumn>1&&(x=Math.floor(h/i.slidesPerColumn)===h/e.params.slidesPerColumn?h:Math.ceil(h/i.slidesPerColumn)*i.slidesPerColumn,"auto"!==i.slidesPerView&&"row"===i.slidesPerColumnFill&&(x=Math.max(x,i.slidesPerView*i.slidesPerColumn)));for(var O,T=i.slidesPerColumn,A=x/T,P=Math.floor(h/i.slidesPerColumn),M=0;M1){var R=void 0,D=void 0,N=void 0;if("row"===i.slidesPerColumnFill&&i.slidesPerGroup>1){var L=Math.floor(M/(i.slidesPerGroup*i.slidesPerColumn)),j=M-i.slidesPerColumn*i.slidesPerGroup*L,F=0===L?i.slidesPerGroup:Math.min(Math.ceil((h-L*T*i.slidesPerGroup)/T),i.slidesPerGroup);N=Math.floor(j/F),I.css({"-webkit-box-ordinal-group":R=(D=j-N*F+L*i.slidesPerGroup)+N*x/T,"-moz-box-ordinal-group":R,"-ms-flex-order":R,"-webkit-order":R,order:R})}else"column"===i.slidesPerColumnFill?(N=M-(D=Math.floor(M/T))*T,(D>P||D===P&&N===T-1)&&(N+=1)>=T&&(N=0,D+=1)):D=M-(N=Math.floor(M/A))*A;I.css(t("margin-top"),0!==N?i.spaceBetween&&i.spaceBetween+"px":"")}if("none"!==I.css("display")){if("auto"===i.slidesPerView){var B=getComputedStyle(I[0]),V=I[0].style.transform,z=I[0].style.webkitTransform;if(V&&(I[0].style.transform="none"),z&&(I[0].style.webkitTransform="none"),i.roundLengths)O=e.isHorizontal()?I.outerWidth(!0):I.outerHeight(!0);else{var U=n(B,"width"),H=n(B,"padding-left"),G=n(B,"padding-right"),W=n(B,"margin-left"),q=n(B,"margin-right"),X=B.getPropertyValue("box-sizing");if(X&&"border-box"===X)O=U+W+q;else{var Y=I[0];O=U+H+G+W+q+(Y.offsetWidth-Y.clientWidth)}}V&&(I[0].style.transform=V),z&&(I[0].style.webkitTransform=z),i.roundLengths&&(O=Math.floor(O))}else O=(o-(i.slidesPerView-1)*b)/i.slidesPerView,i.roundLengths&&(O=Math.floor(O)),l[M]&&(l[M].style[t("width")]=O+"px");l[M]&&(l[M].swiperSlideSize=O),p.push(O),i.centeredSlides?(_=_+O/2+w/2+b,0===w&&0!==M&&(_=_-o/2-b),0===M&&(_=_-o/2-b),Math.abs(_)<.001&&(_=0),i.roundLengths&&(_=Math.floor(_)),k%i.slidesPerGroup==0&&f.push(_),d.push(_)):(i.roundLengths&&(_=Math.floor(_)),(k-Math.min(e.params.slidesPerGroupSkip,k))%e.params.slidesPerGroup==0&&f.push(_),d.push(_),_=_+O+b),e.virtualSize+=O+b,w=O,k+=1}}if(e.virtualSize=Math.max(e.virtualSize,o)+g,a&&s&&("slide"===i.effect||"coverflow"===i.effect)&&r.css({width:e.virtualSize+i.spaceBetween+"px"}),i.setWrapperSize&&r.css(((E={})[t("width")]=e.virtualSize+i.spaceBetween+"px",E)),i.slidesPerColumn>1&&(e.virtualSize=(O+i.spaceBetween)*x,e.virtualSize=Math.ceil(e.virtualSize/i.slidesPerColumn)-i.spaceBetween,r.css(((C={})[t("width")]=e.virtualSize+i.spaceBetween+"px",C)),i.centeredSlides)){S=[];for(var K=0;K1&&f.push(e.virtualSize-o)}if(0===f.length&&(f=[0]),0!==i.spaceBetween){var J,ee=e.isHorizontal()&&a?"marginLeft":t("marginRight");l.filter(function(e,t){return!i.cssMode||t!==l.length-1}).css(((J={})[ee]=b+"px",J))}if(i.centeredSlides&&i.centeredSlidesBounds){var te=0;p.forEach(function(e){te+=e+(i.spaceBetween?i.spaceBetween:0)});var ne=(te-=i.spaceBetween)-o;f=f.map(function(e){return e<0?-v:e>ne?ne+g:e})}if(i.centerInsufficientSlides){var ie=0;if(p.forEach(function(e){ie+=e+(i.spaceBetween?i.spaceBetween:0)}),(ie-=i.spaceBetween)1)if(n.params.centeredSlides)n.visibleSlides.each(function(e){i.push(e)});else for(t=0;tn.slides.length&&!r)break;i.push(a(s))}else i.push(a(n.activeIndex));for(t=0;to?u:o}o&&n.$wrapperEl.css("height",o+"px")},updateSlidesOffset:function(){for(var e=this.slides,t=0;t=0&&c1&&l<=t.size||c<=0&&l>=t.size)&&(t.visibleSlides.push(s),t.visibleSlidesIndexes.push(a),i.eq(a).addClass(n.slideVisibleClass))}s.progress=r?-u:u}t.visibleSlides=QK(t.visibleSlides)}},updateProgress:function(e){var t=this;void 0===e&&(e=t&&t.translate&&t.translate*(t.rtlTranslate?-1:1)||0);var n=t.params,i=t.maxTranslate()-t.minTranslate(),r=t.progress,o=t.isBeginning,a=t.isEnd,s=o,u=a;0===i?(r=0,o=!0,a=!0):(o=(r=(e-t.minTranslate())/i)<=0,a=r>=1),tQ(t,{progress:r,isBeginning:o,isEnd:a}),(n.watchSlidesProgress||n.watchSlidesVisibility||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),o&&!s&&t.emit("reachBeginning toEdge"),a&&!u&&t.emit("reachEnd toEdge"),(s&&!o||u&&!a)&&t.emit("fromEdge"),t.emit("progress",r)},updateSlidesClasses:function(){var e,t=this,n=t.slides,i=t.params,r=t.$wrapperEl,o=t.activeIndex,a=t.realIndex,s=t.virtual&&i.virtual.enabled;n.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(e=s?t.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+o+'"]'):n.eq(o)).addClass(i.slideActiveClass),i.loop&&(e.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+a+'"]').addClass(i.slideDuplicateActiveClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+a+'"]').addClass(i.slideDuplicateActiveClass));var u=e.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===u.length&&(u=n.eq(0)).addClass(i.slideNextClass);var c=e.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===c.length&&(c=n.eq(-1)).addClass(i.slidePrevClass),i.loop&&(u.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+u.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+u.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),c.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass)),t.emitSlidesClasses()},updateActiveIndex:function(e){var t,n=this,i=n.rtlTranslate?n.translate:-n.translate,r=n.slidesGrid,o=n.snapGrid,a=n.params,s=n.activeIndex,u=n.realIndex,c=n.snapIndex,l=e;if(void 0===l){for(var h=0;h=r[h]&&i=r[h]&&i=r[h]&&(l=h);a.normalizeSlideIndex&&(l<0||void 0===l)&&(l=0)}if(o.indexOf(i)>=0)t=o.indexOf(i);else{var f=Math.min(a.slidesPerGroupSkip,l);t=f+Math.floor((l-f)/a.slidesPerGroup)}if(t>=o.length&&(t=o.length-1),l!==s){var d=parseInt(n.slides.eq(l).attr("data-swiper-slide-index")||l,10);tQ(n,{snapIndex:t,realIndex:d,previousIndex:s,activeIndex:l}),n.emit("activeIndexChange"),n.emit("snapIndexChange"),u!==d&&n.emit("realIndexChange"),(n.initialized||n.params.runCallbacksOnInit)&&n.emit("slideChange")}else t!==c&&(n.snapIndex=t,n.emit("snapIndexChange"))},updateClickedSlide:function(e){var t,n=this,i=n.params,r=QK(e.target).closest("."+i.slideClass)[0],o=!1;if(r)for(var a=0;a6&&(i=i.split(", ").map(function(e){return e.replace(",",".")}).join(", ")),r=new o.WebKitCSSMatrix("none"===i?"":i)):n=(r=a.MozTransform||a.OTransform||a.MsTransform||a.msTransform||a.transform||a.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===t&&(i=o.WebKitCSSMatrix?r.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===t&&(i=o.WebKitCSSMatrix?r.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),i||0}(t.$wrapperEl[0],e);return i&&(o=-o),o||0},setTranslate:function(e,t){var n=this,i=n.rtlTranslate,r=n.params,o=n.$wrapperEl,a=n.wrapperEl,s=n.progress,u=0,c=0;n.isHorizontal()?u=i?-e:e:c=e,r.roundLengths&&(u=Math.floor(u),c=Math.floor(c)),r.cssMode?a[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-u:-c:r.virtualTranslate||o.transform("translate3d("+u+"px, "+c+"px, 0px)"),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?u:c;var l=n.maxTranslate()-n.minTranslate();(0===l?0:(e-n.minTranslate())/l)!==s&&n.updateProgress(e),n.emit("setTranslate",n.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e,t,n,i,r){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===n&&(n=!0),void 0===i&&(i=!0);var o=this,a=o.params,s=o.wrapperEl;if(o.animating&&a.preventInteractionOnTransition)return!1;var u,c=o.minTranslate(),l=o.maxTranslate();if(o.updateProgress(u=i&&e>c?c:i&&eo?"next":ir?"next":i=c.length&&(g=c.length-1),(f||u.initialSlide||0)===(h||0)&&n&&a.emit("beforeSlideChangeStart");var m,y=-c[g];if(a.updateProgress(y),u.normalizeSlideIndex)for(var b=0;b=w&&_=w&&_=w&&(s=b)}if(a.initialized&&s!==f&&(!a.allowSlideNext&&ya.translate&&y>a.maxTranslate()&&(f||0)!==s))return!1;if(m=s>f?"next":s=e&&(f=e)}),void 0!==f&&(c=a.indexOf(f))<0&&(c=i.activeIndex-1),i.slideTo(c,e,t,n)},slideReset:function(e,t,n){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,n)},slideToClosest:function(e,t,n,i){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),void 0===i&&(i=.5);var r=this,o=r.activeIndex,a=Math.min(r.params.slidesPerGroupSkip,o),s=a+Math.floor((o-a)/r.params.slidesPerGroup),u=r.rtlTranslate?r.translate:-r.translate;if(u>=r.snapGrid[s]){var c=r.snapGrid[s];u-c>(r.snapGrid[s+1]-c)*i&&(o+=r.params.slidesPerGroup)}else{var l=r.snapGrid[s-1];u-l<=(r.snapGrid[s]-l)*i&&(o-=r.params.slidesPerGroup)}return o=Math.max(o,0),o=Math.min(o,r.slidesGrid.length-1),r.slideTo(o,e,t,n)},slideToClickedSlide:function(){var e,t=this,n=t.params,i=t.$wrapperEl,r="auto"===n.slidesPerView?t.slidesPerViewDynamic():n.slidesPerView,o=t.clickedIndex;if(n.loop){if(t.animating)return;e=parseInt(QK(t.clickedSlide).attr("data-swiper-slide-index"),10),n.centeredSlides?ot.slides.length-t.loopedSlides+r/2?(t.loopFix(),o=i.children("."+n.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),$K(function(){t.slideTo(o)})):t.slideTo(o):o>t.slides.length-r?(t.loopFix(),o=i.children("."+n.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),$K(function(){t.slideTo(o)})):t.slideTo(o)}else t.slideTo(o)}},loop:{loopCreate:function(){var e=this,t=IK(),n=e.params,i=e.$wrapperEl;i.children("."+n.slideClass+"."+n.slideDuplicateClass).remove();var r=i.children("."+n.slideClass);if(n.loopFillGroupWithBlank){var o=n.slidesPerGroup-r.length%n.slidesPerGroup;if(o!==n.slidesPerGroup){for(var a=0;ar.length&&(e.loopedSlides=r.length);var u=[],c=[];r.each(function(t,n){var i=QK(t);n=r.length-e.loopedSlides&&u.push(t),i.attr("data-swiper-slide-index",n)});for(var l=0;l=0;h-=1)i.prepend(QK(u[h].cloneNode(!0)).addClass(n.slideDuplicateClass))},loopFix:function(){var e=this;e.emit("beforeLoopFix");var t,n=e.activeIndex,i=e.slides,r=e.loopedSlides,o=e.allowSlidePrev,a=e.allowSlideNext,s=e.snapGrid,u=e.rtlTranslate;e.allowSlidePrev=!0,e.allowSlideNext=!0;var c=-s[n]-e.getTranslate();n=i.length-r&&(t=-i.length+n+r,e.slideTo(t+=r,0,!1,!0)&&0!==c&&e.setTranslate((u?-e.translate:e.translate)-c)),e.allowSlidePrev=o,e.allowSlideNext=a,e.emit("loopFix")},loopDestroy:function(){var e=this,t=e.params,n=e.slides;e.$wrapperEl.children("."+t.slideClass+"."+t.slideDuplicateClass+",."+t.slideClass+"."+t.slideBlankClass).remove(),n.removeAttr("data-swiper-slide-index")}},grabCursor:{setGrabCursor:function(e){var t=this;if(!(t.support.touch||!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)){var n=t.el;n.style.cursor="move",n.style.cursor=e?"-webkit-grabbing":"-webkit-grab",n.style.cursor=e?"-moz-grabbin":"-moz-grab",n.style.cursor=e?"grabbing":"grab"}},unsetGrabCursor:function(){var e=this;e.support.touch||e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.el.style.cursor="")}},manipulation:{appendSlide:function(e){var t=this,n=t.$wrapperEl,i=t.params;if(i.loop&&t.loopDestroy(),"object"==typeof e&&"length"in e)for(var r=0;r=a)n.appendSlide(t);else{for(var s=o>e?o+1:o,u=[],c=a-1;c>=e;c-=1){var l=n.slides.eq(c);l.remove(),u.unshift(l)}if("object"==typeof t&&"length"in t){for(var h=0;he?o+t.length:o}else i.append(t);for(var f=0;f1,f=l.slidesPerColumn>1,d=o.enabled;h&&!f?(a.removeClass(o.containerModifierClass+"multirow "+o.containerModifierClass+"multirow-column"),e.emitContainerClasses()):!h&&f&&(a.addClass(o.containerModifierClass+"multirow"),(l.slidesPerColumnFill&&"column"===l.slidesPerColumnFill||!l.slidesPerColumnFill&&"column"===o.slidesPerColumnFill)&&a.addClass(o.containerModifierClass+"multirow-column"),e.emitContainerClasses());var p=l.direction&&l.direction!==o.direction,v=o.loop&&(l.slidesPerView!==o.slidesPerView||p);p&&n&&e.changeDirection(),tQ(e.params,l);var g=e.params.enabled;tQ(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),d&&!g?e.disable():!d&&g&&e.enable(),e.currentBreakpoint=u,e.emit("_beforeBreakpoint",l),v&&n&&(e.loopDestroy(),e.loopCreate(),e.updateSlides(),e.slideTo(t-r+e.loopedSlides,0,!1)),e.emit("breakpoint",l)}}},getBreakpoint:function(e,t,n){if(void 0===t&&(t="window"),e&&("container"!==t||n)){var i=!1,r=DK(),o="window"===t?r.innerHeight:n.clientHeight,a=Object.keys(e).map(function(e){if("string"==typeof e&&0===e.indexOf("@")){var t=parseFloat(e.substr(1));return{value:o*t,point:e}}return{value:e,point:e}});a.sort(function(e,t){return parseInt(e.value,10)-parseInt(t.value,10)});for(var s=0;s0&&t.slidesOffsetBefore+t.spaceBetween*(e.slides.length-1)+e.slides[0].offsetWidth*e.slides.length;e.isLocked=t.slidesOffsetBefore&&t.slidesOffsetAfter&&i?i<=e.size:1===e.snapGrid.length,e.allowSlideNext=!e.isLocked,e.allowSlidePrev=!e.isLocked,n!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock"),n&&n!==e.isLocked&&(e.isEnd=!1,e.navigation&&e.navigation.update())}},classes:{addClasses:function(){var e=this,t=e.classNames,n=e.params,i=e.$el,r=e.device,o=e.support,a=function(e,t){var n=[];return e.forEach(function(e){"object"==typeof e?Object.keys(e).forEach(function(i){e[i]&&n.push(t+i)}):"string"==typeof e&&n.push(t+e)}),n}(["initialized",n.direction,{"pointer-events":o.pointerEvents&&!o.touch},{"free-mode":n.freeMode},{autoheight:n.autoHeight},{rtl:e.rtl},{multirow:n.slidesPerColumn>1},{"multirow-column":n.slidesPerColumn>1&&"column"===n.slidesPerColumnFill},{android:r.android},{ios:r.ios},{"css-mode":n.cssMode}],n.containerModifierClass);t.push.apply(t,a),i.addClass([].concat(t).join(" ")),e.emitContainerClasses()},removeClasses:function(){var e=this;e.$el.removeClass(e.classNames.join(" ")),e.emitContainerClasses()}},images:{loadImage:function(e,t,n,i,r,o){var a,s=DK();function u(){o&&o()}QK(e).parent("picture")[0]||e.complete&&r||!t?u():((a=new s.Image).onload=u,a.onerror=u,i&&(a.sizes=i),n&&(a.srcset=n),t&&(a.src=t))},preloadImages:function(){var e=this;function t(){null==e||!e||e.destroyed||(void 0!==e.imagesLoaded&&(e.imagesLoaded+=1),e.imagesLoaded===e.imagesToLoad.length&&(e.params.updateOnImagesReady&&e.update(),e.emit("imagesReady")))}e.imagesToLoad=e.$el.find("img");for(var n=0;n1){var a=[];return QK(n.el).each(function(t){var i=tQ({},n,{el:t});a.push(new e(i))}),a}var s=this;s.__swiper__=!0,s.support=iQ(),s.device=rQ({userAgent:n.userAgent}),s.browser=oQ(),s.eventsListeners={},s.eventsAnyListeners=[],void 0===s.modules&&(s.modules={}),Object.keys(s.modules).forEach(function(e){var t=s.modules[e];if(t.params){var i=Object.keys(t.params)[0],r=t.params[i];if("object"!=typeof r||null===r||(["navigation","pagination","scrollbar"].indexOf(i)>=0&&!0===n[i]&&(n[i]={auto:!0}),!(i in n)||!("enabled"in r)))return;!0===n[i]&&(n[i]={enabled:!0}),"object"==typeof n[i]&&!("enabled"in n[i])&&(n[i].enabled=!0),n[i]||(n[i]={enabled:!1})}});var u,c,l=tQ({},yQ);return s.useParams(l),s.params=tQ({},l,_Q,n),s.originalParams=tQ({},s.params),s.passedParams=tQ({},n),s.params&&s.params.on&&Object.keys(s.params.on).forEach(function(e){s.on(e,s.params.on[e])}),s.params&&s.params.onAny&&s.onAny(s.params.onAny),s.$=QK,tQ(s,{enabled:s.params.enabled,el:t,classNames:[],slides:QK(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===s.params.direction},isVertical:function(){return"vertical"===s.params.direction},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:s.params.allowSlideNext,allowSlidePrev:s.params.allowSlidePrev,touchEvents:(u=["touchstart","touchmove","touchend","touchcancel"],c=["mousedown","mousemove","mouseup"],s.support.pointerEvents&&(c=["pointerdown","pointermove","pointerup"]),s.touchEventsTouch={start:u[0],move:u[1],end:u[2],cancel:u[3]},s.touchEventsDesktop={start:c[0],move:c[1],end:c[2]},s.support.touch||!s.params.simulateTouch?s.touchEventsTouch:s.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:s.params.focusableElements,lastClickTime:ZK(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:s.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),s.useModules(),s.emit("_swiper"),s.params.init&&s.init(),s}var t=e.prototype;return t.enable=function(){var e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))},t.disable=function(){var e=this;!e.enabled||(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))},t.setProgress=function(e,t){var n=this;e=Math.min(Math.max(e,0),1);var i=n.minTranslate(),r=n.maxTranslate();n.translateTo((r-i)*e+i,void 0===t?0:t),n.updateActiveIndex(),n.updateSlidesClasses()},t.emitContainerClasses=function(){var e=this;if(e.params._emitClasses&&e.el){var t=e.el.className.split(" ").filter(function(t){return 0===t.indexOf("swiper-container")||0===t.indexOf(e.params.containerModifierClass)});e.emit("_containerClasses",t.join(" "))}},t.getSlideClasses=function(e){var t=this;return e.className.split(" ").filter(function(e){return 0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass)}).join(" ")},t.emitSlidesClasses=function(){var e=this;if(e.params._emitClasses&&e.el){var t=[];e.slides.each(function(n){var i=e.getSlideClasses(n);t.push({slideEl:n,classNames:i}),e.emit("_slideClass",n,i)}),e.emit("_slideClasses",t)}},t.slidesPerViewDynamic=function(){var e=this,t=e.slides,n=e.slidesGrid,i=e.size,r=e.activeIndex,o=1;if(e.params.centeredSlides){for(var a,s=t[r].swiperSlideSize,u=r+1;ui&&(a=!0));for(var c=r-1;c>=0;c-=1)t[c]&&!a&&(o+=1,(s+=t[c].swiperSlideSize)>i&&(a=!0))}else for(var l=r+1;l1)&&e.isEnd&&!e.params.centeredSlides?e.slides.length-1:e.activeIndex,0,!1,!0)||i(),n.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}function i(){var t=Math.min(Math.max(e.rtlTranslate?-1*e.translate:e.translate,e.maxTranslate()),e.minTranslate());e.setTranslate(t),e.updateActiveIndex(),e.updateSlidesClasses()}},t.changeDirection=function(e,t){void 0===t&&(t=!0);var n=this,i=n.params.direction;return e||(e="horizontal"===i?"vertical":"horizontal"),e===i||"horizontal"!==e&&"vertical"!==e||(n.$el.removeClass(""+n.params.containerModifierClass+i).addClass(""+n.params.containerModifierClass+e),n.emitContainerClasses(),n.params.direction=e,n.slides.each(function(t){"vertical"===e?t.style.width="":t.style.height=""}),n.emit("changeDirection"),t&&n.update()),n},t.mount=function(e){var t=this;if(t.mounted)return!0;var n=QK(e||t.params.el);if(!(e=n[0]))return!1;e.swiper=t;var i=function(){return"."+(t.params.wrapperClass||"").trim().split(" ").join(".")},r=function(){if(e&&e.shadowRoot&&e.shadowRoot.querySelector){var t=QK(e.shadowRoot.querySelector(i()));return t.children=function(e){return n.children(e)},t}return n.children(i())}();if(0===r.length&&t.params.createElements){var o=IK().createElement("div");r=QK(o),o.className=t.params.wrapperClass,n.append(o),n.children("."+t.params.slideClass).each(function(e){r.append(e)})}return tQ(t,{$el:n,el:e,$wrapperEl:r,wrapperEl:r[0],mounted:!0,rtl:"rtl"===e.dir.toLowerCase()||"rtl"===n.css("direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===e.dir.toLowerCase()||"rtl"===n.css("direction")),wrongRTL:"-webkit-box"===r.css("display")}),!0},t.init=function(e){var t=this;return t.initialized||!1===t.mount(e)||(t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.params.loop&&t.loopCreate(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.preloadImages&&t.preloadImages(),t.slideTo(t.params.loop?t.params.initialSlide+t.loopedSlides:t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.attachEvents(),t.initialized=!0,t.emit("init"),t.emit("afterInit")),t},t.destroy=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);var n=this,i=n.params,r=n.$el,o=n.$wrapperEl,a=n.slides;return void 0===n.params||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),i.loop&&n.loopDestroy(),t&&(n.removeClasses(),r.removeAttr("style"),o.removeAttr("style"),a&&a.length&&a.removeClass([i.slideVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(function(e){n.off(e)}),!1!==e&&(n.$el[0].swiper=null,function(t){var n=t;Object.keys(n).forEach(function(t){try{n[t]=null}catch(e){}try{delete n[t]}catch(e){}})}(n)),n.destroyed=!0),null},e.extendDefaults=function(e){tQ(_Q,e)},e.installModule=function(t){e.prototype.modules||(e.prototype.modules={});var n=t.name||Object.keys(e.prototype.modules).length+"_"+ZK();e.prototype.modules[n]=t},e.use=function(t){return Array.isArray(t)?(t.forEach(function(t){return e.installModule(t)}),e):(e.installModule(t),e)},function(e,t,n){n&&function(e,t){for(var n=0;n0?t[n].__swiper__?e[n]=t[n]:QQ(e[n],t[n]):e[n]=t[n]):e[n]=t[n]})}function $Q(e){return null!=e&&"false"!="".concat(e)}var ZQ=["pagination","navigation","scrollbar","virtual"];function JQ(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return YQ(e)?e:!0===$Q(e)&&t}var e$=["init","_direction","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_freeModeMomentum","_freeModeMomentumRatio","_freeModeMomentumBounce","_freeModeMomentumBounceRatio","_freeModeMomentumVelocityRatio","_freeModeSticky","_freeModeMinimumVelocity","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","_slidesPerColumn","_slidesPerColumnFill","_slidesPerGroup","_slidesPerGroupSkip","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_watchSlidesVisibility","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_preloadImages","updateOnImagesReady","_loop","_loopAdditionalSlides","_loopedSlides","_loopFillGroupWithBlank","loopPreventsSlide","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","hashNavigation","history","keyboard","lazy","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom"].map(function(e){return e.replace(/_/,"")});function t$(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={on:{}},n={};QQ(t,kQ.defaults),QQ(t,kQ.extendedDefaults),t._emitClasses=!0;var i={};return Object.keys(e).forEach(function(r){var o=r.replace(/^_/,"");void 0!==e[o]&&(e$.indexOf(o)>=0?YQ(e[o])?(t[o]={},n[o]={},QQ(t[o],e[o]),QQ(n[o],e[o])):(t[o]=e[o],n[o]=e[o]):i[o]=e[o])}),{params:t,passedParams:n,rest:i}}var n$=function(){var e=function(){function e(t){m(this,e),this.template=t,this.class="",this.slideData={isActive:!1,isPrev:!1,isNext:!1,isVisible:!1,isDuplicate:!1}}return b(e,[{key:"zoom",get:function(){return this._zoom},set:function(e){this._zoom=$Q(e)}},{key:"classNames",get:function(){return this._classNames},set:function(e){this._classNames!==e&&(this._classNames=e,this.slideData={isActive:this._hasClass(["swiper-slide-active","swiper-slide-duplicate-active"]),isVisible:this._hasClass(["swiper-slide-visible"]),isDuplicate:this._hasClass(["swiper-slide-duplicate"]),isPrev:this._hasClass(["swiper-slide-prev","swiper-slide-duplicate-prev"]),isNext:this._hasClass(["swiper-slide-next","swiper-slide-duplicate-next"])})}},{key:"_hasClass",value:function(e){var t=this;return e.some(function(e){return t._classNames.indexOf(e)>=0})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Cc))},e.\u0275dir=It({type:e,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),e}(),i$=function(){var e=function(){function e(t,n,i,r){var a=this;m(this,e),this._ngZone=t,this.elementRef=n,this._changeDetectorRef=i,this._platformId=r,this.slideClass="swiper-slide",this.wrapperClass="swiper-wrapper",this.showNavigation=!0,this.showPagination=!0,this.showScrollbar=!0,this.s__beforeBreakpoint=new Zc,this.s__containerClasses=new Zc,this.s__slideClass=new Zc,this.s__swiper=new Zc,this.s_activeIndexChange=new Zc,this.s_afterInit=new Zc,this.s_autoplay=new Zc,this.s_autoplayStart=new Zc,this.s_autoplayStop=new Zc,this.s_beforeDestroy=new Zc,this.s_beforeInit=new Zc,this.s_beforeLoopFix=new Zc,this.s_beforeResize=new Zc,this.s_beforeSlideChangeStart=new Zc,this.s_beforeTransitionStart=new Zc,this.s_breakpoint=new Zc,this.s_changeDirection=new Zc,this.s_click=new Zc,this.s_doubleTap=new Zc,this.s_doubleClick=new Zc,this.s_destroy=new Zc,this.s_fromEdge=new Zc,this.s_hashChange=new Zc,this.s_hashSet=new Zc,this.s_imagesReady=new Zc,this.s_init=new Zc,this.s_keyPress=new Zc,this.s_lazyImageLoad=new Zc,this.s_lazyImageReady=new Zc,this.s_loopFix=new Zc,this.s_momentumBounce=new Zc,this.s_navigationHide=new Zc,this.s_navigationShow=new Zc,this.s_observerUpdate=new Zc,this.s_orientationchange=new Zc,this.s_paginationHide=new Zc,this.s_paginationRender=new Zc,this.s_paginationShow=new Zc,this.s_paginationUpdate=new Zc,this.s_progress=new Zc,this.s_reachBeginning=new Zc,this.s_reachEnd=new Zc,this.s_realIndexChange=new Zc,this.s_resize=new Zc,this.s_scroll=new Zc,this.s_scrollbarDragEnd=new Zc,this.s_scrollbarDragMove=new Zc,this.s_scrollbarDragStart=new Zc,this.s_setTransition=new Zc,this.s_setTranslate=new Zc,this.s_slideChange=new Zc,this.s_slideChangeTransitionEnd=new Zc,this.s_slideChangeTransitionStart=new Zc,this.s_slideNextTransitionEnd=new Zc,this.s_slideNextTransitionStart=new Zc,this.s_slidePrevTransitionEnd=new Zc,this.s_slidePrevTransitionStart=new Zc,this.s_slideResetTransitionStart=new Zc,this.s_slideResetTransitionEnd=new Zc,this.s_sliderMove=new Zc,this.s_sliderFirstMove=new Zc,this.s_slidesLengthChange=new Zc,this.s_slidesGridLengthChange=new Zc,this.s_snapGridLengthChange=new Zc,this.s_snapIndexChange=new Zc,this.s_tap=new Zc,this.s_toEdge=new Zc,this.s_touchEnd=new Zc,this.s_touchMove=new Zc,this.s_touchMoveOpposite=new Zc,this.s_touchStart=new Zc,this.s_transitionEnd=new Zc,this.s_transitionStart=new Zc,this.s_update=new Zc,this.s_zoomChange=new Zc,this.s_swiper=new Zc,this.indexChange=new Zc,this._activeSlides=new oe,this.containerClasses="swiper-container",this.slidesChanges=function(e){a.slides=e.map(function(e,t){return e.slideIndex=t,e.classNames=a.slideClass,e}),a.loop&&!a.loopedSlides&&a.calcLoopedSlides(),a.virtual?a.swiperRef&&a.swiperRef.virtual&&a._ngZone.runOutsideAngular(function(){a.swiperRef.virtual.slides=a.slides,a.swiperRef.virtual.update(!0)}):(a.prependSlides=jf(a.slides.slice(a.slides.length-a.loopedSlides)),a.appendSlides=jf(a.slides.slice(0,a.loopedSlides))),a._changeDetectorRef.detectChanges()},this.style=null,this.updateVirtualSlides=function(e){!a.swiperRef||a.currentVirtualData&&a.currentVirtualData.from===e.from&&a.currentVirtualData.to===e.to&&a.currentVirtualData.offset===e.offset||(a.style=a.swiperRef.isHorizontal()?o({},a.swiperRef.rtlTranslate?"right":"left","".concat(e.offset,"px")):{top:"".concat(e.offset,"px")},a.currentVirtualData=e,a._activeSlides.next(e.slides),a._ngZone.run(function(){a._changeDetectorRef.detectChanges()}),a._ngZone.runOutsideAngular(function(){a.swiperRef.updateSlides(),a.swiperRef.updateProgress(),a.swiperRef.updateSlidesClasses(),a.swiperRef.lazy&&a.swiperRef.params.lazy.enabled&&a.swiperRef.lazy.load(),a.swiperRef.virtual.update(!0)}))}}return b(e,[{key:"navigation",get:function(){return this._navigation},set:function(e){var t,n,i,r="boolean"!=typeof this._navigation?null===(t=this._navigation)||void 0===t?void 0:t.nextEl:null,o="boolean"!=typeof this._navigation?null===(n=this._navigation)||void 0===n?void 0:n.prevEl:null;this._navigation=JQ(e,{nextEl:r||null,prevEl:o||null}),this.showNavigation=!(!0!==$Q(e)||this._navigation&&"boolean"!=typeof this._navigation&&this._navigation.prevEl!==(null===(i=this._prevElRef)||void 0===i?void 0:i.nativeElement)&&(null!==this._navigation.prevEl||null!==this._navigation.nextEl)&&("string"==typeof this._navigation.nextEl||"string"==typeof this._navigation.prevEl||"object"==typeof this._navigation.nextEl||"object"==typeof this._navigation.prevEl))}},{key:"pagination",get:function(){return this._pagination},set:function(e){var t,n="boolean"!=typeof this._pagination?null===(t=this._pagination)||void 0===t?void 0:t.el:null;this._pagination=JQ(e,{el:n||null}),this.showPagination=KQ(e,this._pagination,this._paginationElRef)}},{key:"scrollbar",get:function(){return this._scrollbar},set:function(e){var t,n="boolean"!=typeof this._scrollbar?null===(t=this._scrollbar)||void 0===t?void 0:t.el:null;this._scrollbar=JQ(e,{el:n||null}),this.showScrollbar=KQ(e,this._scrollbar,this._scrollbarElRef)}},{key:"virtual",get:function(){return this._virtual},set:function(e){this._virtual=JQ(e)}},{key:"index",set:function(e){this.setIndex(e)}},{key:"config",set:function(e){this.updateSwiper(e);var t=t$(e).params;Object.assign(this,t)}},{key:"prevElRef",set:function(e){this._prevElRef=e,this._setElement(e,this.navigation,"navigation","prevEl")}},{key:"nextElRef",set:function(e){this._nextElRef=e,this._setElement(e,this.navigation,"navigation","nextEl")}},{key:"scrollbarElRef",set:function(e){this._scrollbarElRef=e,this._setElement(e,this.scrollbar,"scrollbar")}},{key:"paginationElRef",set:function(e){this._paginationElRef=e,this._setElement(e,this.pagination,"pagination")}},{key:"activeSlides",get:function(){return this.virtual?this._activeSlides:jf(this.slides)}},{key:"zoomContainerClass",get:function(){return"boolean"!=typeof this.zoom?this.zoom.containerClass:"swiper-zoom-container"}},{key:"_setElement",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"el";if(e&&t){if(t&&e.nativeElement){if(t[i]===e.nativeElement)return;t[i]=e.nativeElement}var r={};r[n]=!0,this.updateInitSwiper(r)}}},{key:"ngOnInit",value:function(){var e=t$(this).params;Object.assign(this,e)}},{key:"ngAfterViewInit",value:function(){var e=this;this.childrenSlidesInit(),this.initSwiper(),this._changeDetectorRef.detectChanges(),setTimeout(function(){e.s_swiper.emit(e.swiperRef)})}},{key:"childrenSlidesInit",value:function(){this.slidesChanges(this.slidesEl),this.slidesEl.changes.subscribe(this.slidesChanges)}},{key:"isSwiperActive",get:function(){return this.swiperRef&&!this.swiperRef.destroyed}},{key:"initSwiper",value:function(){var e=this,t=t$(this).params;Object.assign(this,t),this._ngZone.runOutsideAngular(function(){t.init=!1,t.virtual||(t.observer=!0),t.onAny=function(t){for(var n=e["s_".concat(t)],i=arguments.length,r=new Array(i>1?i-1:0),o=1;o=0)){var o=null!==(i=null===(n=e[r])||void 0===n?void 0:n.currentValue)&&void 0!==i?i:e[r];t.updateParameter(r,o)}e.allowSlideNext&&(t.swiperRef.allowSlideNext=t.allowSlideNext),e.allowSlidePrev&&(t.swiperRef.allowSlidePrev=t.allowSlidePrev),e.direction&&t.swiperRef.changeDirection(t.direction,!1),e.breakpoints&&(t.loop&&!t.loopedSlides&&t.calcLoopedSlides(),t.swiperRef.currentBreakpoint=null,t.swiperRef.setBreakpoint()),(e.thumbs||e.controller)&&t.updateInitSwiper(e),t.swiperRef.update()}})}},{key:"calcLoopedSlides",value:function(){if(this.loop){var e=this.slidesPerView;if(this.breakpoints){var t=kQ.prototype.getBreakpoint(this.breakpoints),n=t in this.breakpoints?this.breakpoints[t]:void 0;n&&n.slidesPerView&&(e=n.slidesPerView)}if("auto"===e)return this.loopedSlides=this.slides.length,this.slides.length;var i=this.loopedSlides||e;return(i+=this.loopAdditionalSlides)>this.slides.length&&(i=this.slides.length),this.loopedSlides=i,i}}},{key:"updateParameter",value:function(e,t){if(this.swiperRef&&!this.swiperRef.destroyed){var n=e.replace(/^_/,""),i=YQ(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){var r=this.swiperRef.modules[n].params[n];i?QQ(this.swiperRef.params[n],r):this.swiperRef.params[n]=r}i&&YQ(t)?QQ(this.swiperRef.params[n],t):this.swiperRef.params[n]=t}}},{key:"setIndex",value:function(e,t,n){var i=this;this.isSwiperActive?e!==this.swiperRef.activeIndex&&this._ngZone.runOutsideAngular(function(){i.loop?i.swiperRef.slideToLoop(e,t,!n):i.swiperRef.slideTo(e,t,!n)}):this.initialSlide=e}},{key:"ngOnDestroy",value:function(){var e=this;this._ngZone.runOutsideAngular(function(){var t;null===(t=e.swiperRef)||void 0===t||t.destroy(!0,!1)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Vl),Es(Ku),Es(wc),Es(Sl))},e.\u0275cmp=Ct({type:e,selectors:[["swiper"],["","swiper",""]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,n$,4),2&e)&&(ll(i=dl())&&(t.slidesEl=i))},viewQuery:function(e,t){var n;(1&e&&(hl(xQ,5),hl(SQ,5),hl(EQ,5),hl(CQ,5)),2&e)&&(ll(n=dl())&&(t.prevElRef=n.first),ll(n=dl())&&(t.nextElRef=n.first),ll(n=dl())&&(t.scrollbarElRef=n.first),ll(n=dl())&&(t.paginationElRef=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&cu(t.containerClasses)},inputs:{slideClass:"slideClass",wrapperClass:"wrapperClass",navigation:"navigation",pagination:"pagination",scrollbar:"scrollbar",virtual:"virtual",index:"index",config:"config",loopedSlides:"loopedSlides",initialSlide:"initialSlide",direction:"direction",touchEventsTarget:"touchEventsTarget",speed:"speed",cssMode:"cssMode",updateOnWindowResize:"updateOnWindowResize",resizeObserver:"resizeObserver",nested:"nested",focusableElements:"focusableElements",width:"width",height:"height",preventInteractionOnTransition:"preventInteractionOnTransition",userAgent:"userAgent",url:"url",edgeSwipeDetection:"edgeSwipeDetection",edgeSwipeThreshold:"edgeSwipeThreshold",freeMode:"freeMode",freeModeMomentum:"freeModeMomentum",freeModeMomentumRatio:"freeModeMomentumRatio",freeModeMomentumBounce:"freeModeMomentumBounce",freeModeMomentumBounceRatio:"freeModeMomentumBounceRatio",freeModeMomentumVelocityRatio:"freeModeMomentumVelocityRatio",freeModeSticky:"freeModeSticky",freeModeMinimumVelocity:"freeModeMinimumVelocity",autoHeight:"autoHeight",setWrapperSize:"setWrapperSize",virtualTranslate:"virtualTranslate",effect:"effect",breakpoints:"breakpoints",spaceBetween:"spaceBetween",slidesPerView:"slidesPerView",slidesPerColumn:"slidesPerColumn",slidesPerColumnFill:"slidesPerColumnFill",slidesPerGroup:"slidesPerGroup",slidesPerGroupSkip:"slidesPerGroupSkip",centeredSlides:"centeredSlides",centeredSlidesBounds:"centeredSlidesBounds",slidesOffsetBefore:"slidesOffsetBefore",slidesOffsetAfter:"slidesOffsetAfter",normalizeSlideIndex:"normalizeSlideIndex",centerInsufficientSlides:"centerInsufficientSlides",watchOverflow:"watchOverflow",roundLengths:"roundLengths",touchRatio:"touchRatio",touchAngle:"touchAngle",simulateTouch:"simulateTouch",shortSwipes:"shortSwipes",longSwipes:"longSwipes",longSwipesRatio:"longSwipesRatio",longSwipesMs:"longSwipesMs",followFinger:"followFinger",allowTouchMove:"allowTouchMove",threshold:"threshold",touchMoveStopPropagation:"touchMoveStopPropagation",touchStartPreventDefault:"touchStartPreventDefault",touchStartForcePreventDefault:"touchStartForcePreventDefault",touchReleaseOnEdges:"touchReleaseOnEdges",uniqueNavElements:"uniqueNavElements",resistance:"resistance",resistanceRatio:"resistanceRatio",watchSlidesProgress:"watchSlidesProgress",watchSlidesVisibility:"watchSlidesVisibility",grabCursor:"grabCursor",preventClicks:"preventClicks",preventClicksPropagation:"preventClicksPropagation",slideToClickedSlide:"slideToClickedSlide",preloadImages:"preloadImages",updateOnImagesReady:"updateOnImagesReady",loop:"loop",loopAdditionalSlides:"loopAdditionalSlides",loopFillGroupWithBlank:"loopFillGroupWithBlank",loopPreventsSlide:"loopPreventsSlide",allowSlidePrev:"allowSlidePrev",allowSlideNext:"allowSlideNext",swipeHandler:"swipeHandler",noSwiping:"noSwiping",noSwipingClass:"noSwipingClass",noSwipingSelector:"noSwipingSelector",passiveListeners:"passiveListeners",containerModifierClass:"containerModifierClass",slideBlankClass:"slideBlankClass",slideActiveClass:"slideActiveClass",slideDuplicateActiveClass:"slideDuplicateActiveClass",slideVisibleClass:"slideVisibleClass",slideDuplicateClass:"slideDuplicateClass",slideNextClass:"slideNextClass",slideDuplicateNextClass:"slideDuplicateNextClass",slidePrevClass:"slidePrevClass",slideDuplicatePrevClass:"slideDuplicatePrevClass",runCallbacksOnInit:"runCallbacksOnInit",observeParents:"observeParents",observeSlideChildren:"observeSlideChildren",a11y:"a11y",autoplay:"autoplay",controller:"controller",coverflowEffect:"coverflowEffect",cubeEffect:"cubeEffect",fadeEffect:"fadeEffect",flipEffect:"flipEffect",hashNavigation:"hashNavigation",history:"history",keyboard:"keyboard",lazy:"lazy",mousewheel:"mousewheel",parallax:"parallax",thumbs:"thumbs",zoom:"zoom",class:"class",id:"id"},outputs:{s__beforeBreakpoint:"_beforeBreakpoint",s__containerClasses:"_containerClasses",s__slideClass:"_slideClass",s__swiper:"_swiper",s_activeIndexChange:"activeIndexChange",s_afterInit:"afterInit",s_autoplay:"autoplay",s_autoplayStart:"autoplayStart",s_autoplayStop:"autoplayStop",s_beforeDestroy:"beforeDestroy",s_beforeInit:"beforeInit",s_beforeLoopFix:"beforeLoopFix",s_beforeResize:"beforeResize",s_beforeSlideChangeStart:"beforeSlideChangeStart",s_beforeTransitionStart:"beforeTransitionStart",s_breakpoint:"breakpoint",s_changeDirection:"changeDirection",s_click:"click",s_doubleTap:"doubleTap",s_doubleClick:"doubleClick",s_destroy:"destroy",s_fromEdge:"fromEdge",s_hashChange:"hashChange",s_hashSet:"hashSet",s_imagesReady:"imagesReady",s_init:"init",s_keyPress:"keyPress",s_lazyImageLoad:"lazyImageLoad",s_lazyImageReady:"lazyImageReady",s_loopFix:"loopFix",s_momentumBounce:"momentumBounce",s_navigationHide:"navigationHide",s_navigationShow:"navigationShow",s_observerUpdate:"observerUpdate",s_orientationchange:"orientationchange",s_paginationHide:"paginationHide",s_paginationRender:"paginationRender",s_paginationShow:"paginationShow",s_paginationUpdate:"paginationUpdate",s_progress:"progress",s_reachBeginning:"reachBeginning",s_reachEnd:"reachEnd",s_realIndexChange:"realIndexChange",s_resize:"resize",s_scroll:"scroll",s_scrollbarDragEnd:"scrollbarDragEnd",s_scrollbarDragMove:"scrollbarDragMove",s_scrollbarDragStart:"scrollbarDragStart",s_setTransition:"setTransition",s_setTranslate:"setTranslate",s_slideChange:"slideChange",s_slideChangeTransitionEnd:"slideChangeTransitionEnd",s_slideChangeTransitionStart:"slideChangeTransitionStart",s_slideNextTransitionEnd:"slideNextTransitionEnd",s_slideNextTransitionStart:"slideNextTransitionStart",s_slidePrevTransitionEnd:"slidePrevTransitionEnd",s_slidePrevTransitionStart:"slidePrevTransitionStart",s_slideResetTransitionStart:"slideResetTransitionStart",s_slideResetTransitionEnd:"slideResetTransitionEnd",s_sliderMove:"sliderMove",s_sliderFirstMove:"sliderFirstMove",s_slidesLengthChange:"slidesLengthChange",s_slidesGridLengthChange:"slidesGridLengthChange",s_snapGridLengthChange:"snapGridLengthChange",s_snapIndexChange:"snapIndexChange",s_tap:"tap",s_toEdge:"toEdge",s_touchEnd:"touchEnd",s_touchMove:"touchMove",s_touchMoveOpposite:"touchMoveOpposite",s_touchStart:"touchStart",s_transitionEnd:"transitionEnd",s_transitionStart:"transitionStart",s_update:"update",s_zoomChange:"zoomChange",s_swiper:"swiper",indexChange:"indexChange"},features:[Gt],ngContentSelectors:XQ,decls:13,vars:17,consts:[[4,"ngIf"],["class","swiper-scrollbar",4,"ngIf"],["class","swiper-pagination",4,"ngIf"],[3,"ngClass"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["slidesTemplate",""],[1,"swiper-button-prev"],["prevElRef",""],[1,"swiper-button-next"],["nextElRef",""],[1,"swiper-scrollbar"],["scrollbarElRef",""],[1,"swiper-pagination"],["paginationElRef",""],[3,"ngClass","style","ngSwitch",4,"ngFor","ngForOf"],[3,"ngClass","ngSwitch"],[3,"ngClass",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){if(1&e&&(Ws(HQ),qs(0),xs(1,OQ,5,0,"ng-container",0),xs(2,TQ,2,0,"div",1),xs(3,AQ,2,0,"div",2),Ts(4,"div",3),qs(5,1),xs(6,MQ,1,0,void 0,4),xs(7,RQ,1,0,void 0,4),xs(8,NQ,1,0,void 0,4),qs(9,2),As(),qs(10,3),xs(11,UQ,2,3,"ng-template",null,5,ml)),2&e){var n=Ss(12);qo(1),Cs("ngIf",t.navigation&&t.showNavigation),qo(1),Cs("ngIf",t.scrollbar&&t.showScrollbar),qo(1),Cs("ngIf",t.pagination&&t.showPagination),qo(1),Cs("ngClass",t.wrapperClass),_s("id",t.id),qo(2),Cs("ngTemplateOutlet",n)("ngTemplateOutletContext",qc(11,GQ,t.prependSlides)),qo(1),Cs("ngTemplateOutlet",n)("ngTemplateOutletContext",qc(13,WQ,t.activeSlides)),qo(1),Cs("ngTemplateOutlet",n)("ngTemplateOutletContext",qc(15,qQ,t.appendSlides))}},directives:[Lh,Ih,Gh,Dh,Vh,zh,Uh],pipes:[Yh],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),e}(),r$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh]]}),e}();function o$(){return(o$=Object.assign||function(e){for(var t=1;t0&&(n(o,!!e.isBeginning),e.params.watchOverflow&&e.enabled&&o[e.isLocked?"addClass":"removeClass"](t.lockClass)),r&&r.length>0&&(n(r,!!e.isEnd),e.params.watchOverflow&&e.enabled&&r[e.isLocked?"addClass":"removeClass"](t.lockClass))}},onPrevClick:function(e){var t=this;e.preventDefault(),(!t.isBeginning||t.params.loop)&&t.slidePrev()},onNextClick:function(e){var t=this;e.preventDefault(),(!t.isEnd||t.params.loop)&&t.slideNext()},init:function(){var e,t,n=this,i=n.params.navigation;n.params.navigation=function(e,t,n,i){var r=IK();return n&&Object.keys(i).forEach(function(n){if(!t[n]&&!0===t.auto){var o=r.createElement("div");o.className=i[n],e.append(o),t[n]=o}}),t}(n.$el,n.params.navigation,n.params.createElements,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),(i.nextEl||i.prevEl)&&(i.nextEl&&(e=QK(i.nextEl),n.params.uniqueNavElements&&"string"==typeof i.nextEl&&e.length>1&&1===n.$el.find(i.nextEl).length&&(e=n.$el.find(i.nextEl))),i.prevEl&&(t=QK(i.prevEl),n.params.uniqueNavElements&&"string"==typeof i.prevEl&&t.length>1&&1===n.$el.find(i.prevEl).length&&(t=n.$el.find(i.prevEl))),e&&e.length>0&&e.on("click",n.navigation.onNextClick),t&&t.length>0&&t.on("click",n.navigation.onPrevClick),tQ(n.navigation,{$nextEl:e,nextEl:e&&e[0],$prevEl:t,prevEl:t&&t[0]}),n.enabled||(e&&e.addClass(i.lockClass),t&&t.addClass(i.lockClass)))},destroy:function(){var e=this,t=e.navigation,n=t.$nextEl,i=t.$prevEl;n&&n.length&&(n.off("click",e.navigation.onNextClick),n.removeClass(e.params.navigation.disabledClass)),i&&i.length&&(i.off("click",e.navigation.onPrevClick),i.removeClass(e.params.navigation.disabledClass))}},s$={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){nQ(this,{navigation:o$({},a$)})},on:{init:function(e){e.navigation.init(),e.navigation.update()},toEdge:function(e){e.navigation.update()},fromEdge:function(e){e.navigation.update()},destroy:function(e){e.navigation.destroy()},"enable disable":function(e){var t=e.navigation,n=t.$nextEl,i=t.$prevEl;n&&n[e.enabled?"removeClass":"addClass"](e.params.navigation.lockClass),i&&i[e.enabled?"removeClass":"addClass"](e.params.navigation.lockClass)},click:function(e,t){var n=e.navigation,i=n.$nextEl,r=n.$prevEl,o=t.target;if(e.params.navigation.hideOnClick&&!QK(o).is(r)&&!QK(o).is(i)){if(e.pagination&&e.params.pagination&&e.params.pagination.clickable&&(e.pagination.el===o||e.pagination.el.contains(o)))return;var a;i?a=i.hasClass(e.params.navigation.hiddenClass):r&&(a=r.hasClass(e.params.navigation.hiddenClass)),e.emit(!0===a?"navigationShow":"navigationHide"),i&&i.toggleClass(e.params.navigation.hiddenClass),r&&r.toggleClass(e.params.navigation.hiddenClass)}}}},u$=function(){var e=function e(){m(this,e),kQ.use([s$])};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_,S_,r$]]}),e}(),c$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh]]}),e}(),l$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,VX,S_,u$,c$]]}),e}(),h$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,Yd,l$]]}),e}(),f$={isolated:!0},d$=new Mi("Message service configuration",{providedIn:"root",factory:function(){return f$}}),p$=function(){var e=function(){function e(t,n,i){m(this,e),this.source=t,this.channel=n,this.messages=i}return b(e,[{key:"sendMessage",value:function(e){this.channel.next({id:this.nextMessageId(),source:this.source,payload:e})}},{key:"getMessages",value:function(){var e=this;return this.messages.pipe(od(function(t){return t.source!==e.source}))}},{key:"getMessagesFromSource",value:function(e){return this.getMessages().pipe(od(function(t){return t.source===e}))}},{key:"getMessagesFromSources",value:function(e){return this.getMessages().pipe(od(function(t){return e.includes(t.source)}))}},{key:"nextMessageId",value:function(){return e.counter++}}]),e}();return e.counter=0,e}(),v$=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.config=t,this.parent=n,this.channel=new oe,this.messages=t.isolated||!n?this.channel.asObservable():me([this.channel,n.messages.pipe(cp(function(){return!i.channel.closed}))]).pipe(Se())}return b(e,[{key:"ngOnDestroy",value:function(){this.channel.complete()}},{key:"connect",value:function(e){return new p$(e,this.channel,this.messages)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(d$),Qi(e,12))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),g$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[{provide:d$,useValue:f$}],imports:[[Mf,By,S_]]}),e}();function m$(e,t){if(1&e&&(Wn(),Ps(0,"circle",3)),2&e){var n=Hs();au("animation-name","mat-progress-spinner-stroke-rotate-"+n._spinnerAnimationLabel)("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),_s("r",n._getCircleRadius())}}function y$(e,t){if(1&e&&(Wn(),Ps(0,"circle",3)),2&e){var n=Hs();au("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),_s("r",n._getCircleRadius())}}function b$(e,t){if(1&e&&(Wn(),Ps(0,"circle",3)),2&e){var n=Hs();au("animation-name","mat-progress-spinner-stroke-rotate-"+n._spinnerAnimationLabel)("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),_s("r",n._getCircleRadius())}}function _$(e,t){if(1&e&&(Wn(),Ps(0,"circle",3)),2&e){var n=Hs();au("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),_s("r",n._getCircleRadius())}}var w$=".mat-progress-spinner{display:block;position:relative;overflow:hidden}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}._mat-animation-noopable.mat-progress-spinner circle{transition:none;animation:none}.cdk-high-contrast-active .mat-progress-spinner circle{stroke:currentColor;stroke:CanvasText}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{animation:mat-progress-spinner-linear-rotate 2000ms linear infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4000ms;animation-timing-function:cubic-bezier(0.35, 0, 0.25, 1);animation-iteration-count:infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{animation:mat-progress-spinner-stroke-rotate-fallback 10000ms cubic-bezier(0.87, 0.03, 0.33, 1) infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition:none;animation:none}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.606171575px;transform:rotate(0)}12.5%{stroke-dashoffset:56.5486677px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.606171575px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.5486677px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.606171575px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.5486677px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.606171575px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.5486677px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0deg)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}\n",k$=Xy(function(){return function e(t){m(this,e),this._elementRef=t}}(),"primary"),x$=new Mi("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}}),S$=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a){var s;m(this,n),(s=t.call(this,e))._document=r,s._diameter=100,s._value=0,s._fallbackAnimation=!1,s.mode="determinate";var u=n._diameters;return s._spinnerAnimationLabel=s._getSpinnerAnimationLabel(),u.has(r.head)||u.set(r.head,new Set([100])),s._fallbackAnimation=i.EDGE||i.TRIDENT,s._noopAnimations="NoopAnimations"===o&&!!a&&!a._forceAnimations,a&&(a.diameter&&(s.diameter=a.diameter),a.strokeWidth&&(s.strokeWidth=a.strokeWidth)),s}return b(n,[{key:"diameter",get:function(){return this._diameter},set:function(e){this._diameter=Rf(e),this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()}},{key:"strokeWidth",get:function(){return this._strokeWidth||this.diameter/10},set:function(e){this._strokeWidth=Rf(e)}},{key:"value",get:function(){return"determinate"===this.mode?this._value:0},set:function(e){this._value=Math.max(0,Math.min(100,Rf(e)))}},{key:"ngOnInit",value:function(){var e=this._elementRef.nativeElement;this._styleRoot=jd(e)||this._document.head,this._attachStyleNode(),e.classList.add("mat-progress-spinner-indeterminate".concat(this._fallbackAnimation?"-fallback":"","-animation"))}},{key:"_getCircleRadius",value:function(){return(this.diameter-10)/2}},{key:"_getViewBox",value:function(){var e=2*this._getCircleRadius()+this.strokeWidth;return"0 0 ".concat(e," ").concat(e)}},{key:"_getStrokeCircumference",value:function(){return 2*Math.PI*this._getCircleRadius()}},{key:"_getStrokeDashOffset",value:function(){return"determinate"===this.mode?this._getStrokeCircumference()*(100-this._value)/100:this._fallbackAnimation&&"indeterminate"===this.mode?.2*this._getStrokeCircumference():null}},{key:"_getCircleStrokeWidth",value:function(){return this.strokeWidth/this.diameter*100}},{key:"_attachStyleNode",value:function(){var e=this._styleRoot,t=this._diameter,i=n._diameters,r=i.get(e);if(!r||!r.has(t)){var o=this._document.createElement("style");o.setAttribute("mat-spinner-animation",this._spinnerAnimationLabel),o.textContent=this._getAnimationText(),e.appendChild(o),r||(r=new Set,i.set(e,r)),r.add(t)}}},{key:"_getAnimationText",value:function(){var e=this._getStrokeCircumference();return"\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n".replace(/START_VALUE/g,""+.95*e).replace(/END_VALUE/g,""+.2*e).replace(/DIAMETER/g,"".concat(this._spinnerAnimationLabel))}},{key:"_getSpinnerAnimationLabel",value:function(){return this.diameter.toString().replace(".","_")}}]),n}(k$);S$.\u0275fac=function(e){return new(e||S$)(Es(Ku),Es(Id),Es(fh,8),Es(Ny,8),Es(x$))},S$.\u0275cmp=Ct({type:S$,selectors:[["mat-progress-spinner"]],hostAttrs:["role","progressbar","tabindex","-1",1,"mat-progress-spinner"],hostVars:10,hostBindings:function(e,t){2&e&&(_s("aria-valuemin","determinate"===t.mode?0:null)("aria-valuemax","determinate"===t.mode?100:null)("aria-valuenow","determinate"===t.mode?t.value:null)("mode",t.mode),au("width",t.diameter,"px")("height",t.diameter,"px"),su("_mat-animation-noopable",t._noopAnimations))},inputs:{color:"color",mode:"mode",diameter:"diameter",strokeWidth:"strokeWidth",value:"value"},exportAs:["matProgressSpinner"],features:[ss],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(e,t){1&e&&(Wn(),Ts(0,"svg",0),xs(1,m$,1,9,"circle",1),xs(2,y$,1,7,"circle",2),As()),2&e&&(au("width",t.diameter,"px")("height",t.diameter,"px"),Cs("ngSwitch","indeterminate"===t.mode),_s("viewBox",t._getViewBox()),qo(1),Cs("ngSwitchCase",!0),qo(1),Cs("ngSwitchCase",!1))},directives:[Vh,zh],styles:[w$],encapsulation:2,changeDetection:0}),S$._diameters=new WeakMap;var E$=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a){var s;return m(this,n),(s=t.call(this,e,i,r,o,a)).mode="indeterminate",s}return n}(S$);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Id),Es(fh,8),Es(Ny,8),Es(x$))},e.\u0275cmp=Ct({type:e,selectors:[["mat-spinner"]],hostAttrs:["role","progressbar","mode","indeterminate",1,"mat-spinner","mat-progress-spinner"],hostVars:6,hostBindings:function(e,t){2&e&&(au("width",t.diameter,"px")("height",t.diameter,"px"),su("_mat-animation-noopable",t._noopAnimations))},inputs:{color:"color"},features:[ss],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(e,t){1&e&&(Wn(),Ts(0,"svg",0),xs(1,b$,1,9,"circle",1),xs(2,_$,1,7,"circle",2),As()),2&e&&(au("width",t.diameter,"px")("height",t.diameter,"px"),Cs("ngSwitch","indeterminate"===t.mode),_s("viewBox",t._getViewBox()),qo(1),Cs("ngSwitchCase",!0),qo(1),Cs("ngSwitchCase",!1))},directives:[Vh,zh],styles:[w$],encapsulation:2,changeDetection:0}),e}(),C$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Wy,Kh],Wy]}),e}(),O$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,C$]]}),e}(),T$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_,S_,C$]]}),e}(),A$={initialConfig:{},parse:{},rename:{}},P$=function(){function e(t,n){m(this,e),this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},A$),n)}return b(e,[{key:"addChanges",value:function(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}},{key:"applyChanges",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===e&&(e=this.storedChanges,this.storedChanges={});for(var i=this.configState,r=this.options.initialConfig,o=i.snapshot,a=Object.assign(Object.assign(Object.assign({},r),o),n),s=0,u=Object.entries(e);s true",tg("1s"))])]},changeDetection:0}),e}(),j$=["*"],F$={params:{width:0,margin:0,margin2:0}},B$=function(){function e(){var t=this;m(this,e),this.initialized=!1,this.deferred=new Promise(function(e){t.resolve=e})}return b(e,[{key:"set",value:function(){this.initialized=!0,this.resolve()}},{key:"wait",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.deferred);case 1:case"end":return e.stop()}},e,this)}))}},{key:"valueOf",value:function(){return this.initialized}}]),e}(),V$=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this.element=i,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Zc(!0),this.expandedChange=new Zc(!0),this.stateChange=new Zc(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new B$,this.subscriptions=new W,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(function(e){r.handleMessage(e)&&n.markForCheck()}))}return b(e,[{key:"classEnd",get:function(){return"end"===this.position}},{key:"position",get:function(){return this._position},set:function(e){this._position=e||"start"}},{key:"opened",get:function(){return this._opened},set:function(e){this.toggle(If(e))}},{key:"expanded",get:function(){return this._expanded},set:function(e){this.toggleExpanded(If(e))}},{key:"expandedStateObj",get:function(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}},{key:"measuredWidth",get:function(){if(this._measuredWidth>0)return this._measuredWidth;var e=this.element.nativeElement;if(!e)return 0;var t=e.getBoundingClientRect(),n=t.right-t.left;return 0===n?0:(this._measuredWidth=n,n)}},{key:"measuredMargin",get:function(){if(this._measuredMargin>0)return this._measuredMargin;var e=this.element.nativeElement;if(!e)return 0;var t=globalThis.getComputedStyle(e).getPropertyValue("start"===this.position?"margin-right":"margin-left"),n=Number(t.slice(0,-2));return this._measuredMargin=n,n}},{key:"ngAfterViewInit",value:function(){var e=this;this.initialized.set(),setTimeout(function(){return e.channel.sendMessage({type:"drawer-initialized"})})}},{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"open",value:function(){this.toggle(!0)}},{key:"close",value:function(){this.toggle(!1)}},{key:"toggle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!this.opened;this.opened!==e&&(e?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=e,this.sendToggle())}},{key:"openExpanded",value:function(){this.toggleExpanded(!0)}},{key:"closeExpanded",value:function(){this.toggleExpanded(!1)}},{key:"toggleExpanded",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!this.expanded;this.expanded!==e&&(e?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=e,this.sendToggle())}},{key:"closeOpenDone",value:function(){this.openedChange.emit(this.opened)}},{key:"expandCollapseDone",value:function(){this.expandedChange.emit(this.expanded)}},{key:"sendToggle",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initialized.wait();case 2:this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit();case 4:case"end":return e.stop()}},e,this)}))}},{key:"handleMessage",value:function(e){switch(e.payload.type){case"drawer-toggled":return this.syncExpanded(e.source),!0;default:return!1}}},{key:"syncExpanded",value:function(e){(this.expanded||e.expanded)&&(this.expanded&&e.expanded?this.expandedState2=e.expandedState2="half":this.expanded?e.opened?(this.expandedState2="extended",this.width=e.measuredWidth+e.measuredMargin):(this.expandedState2="full",this.margin2=e.measuredMargin):this.opened?(e.expandedState2="extended",e.width=this.measuredWidth+this.measuredMargin):(e.expandedState2="full",e.margin2=this.measuredMargin))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(D$),Es(wc),Es(Ku))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(e,t){1&e&&Bs("@openClose.done",function(){return t.closeOpenDone()})("@expandCollapse.done",function(){return t.expandCollapseDone()}),2&e&&(Tu("@openClose",t.openedState)("@expandCollapse",t.expandedStateObj),cu(t.className),su("ccf-drawer-end",t.classEnd)("ccf-drawer-opened",t.opened)("ccf-drawer-expanded",t.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:j$,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(e,t){1&e&&(Ws(),Ts(0,"div",0),qs(1),As())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%);background-color:#fff}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[eg("openClose",[rg("open, open-instant",ig({transform:"none"})),rg("closed",ig({})),og("closed => open-instant",tg(0)),og("closed <=> open, open-instant => closed",tg(".5s ease-in-out"))]),eg("expandCollapse",[rg("collapsed",ig({})),rg("half",ig({width:"calc(50% - {{ margin }}px)"}),F$),rg("extended",ig({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),F$),rg("full",ig({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),F$),og("* <=> *",tg(".5s ease-in-out"))])]},changeDetection:0}),e}();function z$(e,t){1&e&&(Ts(0,"ccf-drawer-content"),qs(1,2),As())}var U$=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],H$=["ccf-drawer","ccf-drawer-content","*"];function G$(e){throw new Error("Multiple drawers in position ".concat(e))}var W$=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.cdr=n,this.className="ccf-drawer-container",this.subscriptions=new W,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(function(e){i.handleMessage(e)&&n.markForCheck()}))}return b(e,[{key:"content",get:function(){var e;return null!==(e=this.content1.first)&&void 0!==e?e:this.content2.first}},{key:"hasWrappedContent",get:function(){return 0!==this.content1.length}},{key:"ngAfterViewInit",value:function(){var e=this;this.drawers.changes.pipe(fd(null)).subscribe(function(){var t=e.validateDrawers();e.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),e.cdr.markForCheck()}),this.content1.changes.pipe(fd(null)).subscribe(function(){e.channel.sendMessage({type:"content-container-changed",content:e.content}),e.cdr.markForCheck()})}},{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"handleMessage",value:function(e){return!0}},{key:"validateDrawers",value:function(){var e=this.drawers.toArray(),t=e.filter(function(e){return"start"===e.position}),n=e.filter(function(e){return"end"===e.position});return t.length>1&&G$("start"),n.length>1&&G$("end"),[t[0],n[0]]}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(D$),Es(wc))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-drawer-container"]],contentQueries:function(e,t,n){var i;(1&e&&(fl(n,V$,5),fl(n,L$,5)),2&e)&&(ll(i=dl())&&(t.drawers=i),ll(i=dl())&&(t.content1=i))},viewQuery:function(e,t){var n;(1&e&&hl(L$,5),2&e)&&(ll(n=dl())&&(t.content2=n))},hostVars:2,hostBindings:function(e,t){2&e&&cu(t.className)},exportAs:["ccfDrawerContainer"],features:[Hu([D$])],ngContentSelectors:H$,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(e,t){1&e&&(Ws(U$),qs(0),qs(1,1),xs(2,z$,2,0,"ccf-drawer-content",0)),2&e&&(qo(2),Cs("ngIf",!t.hasWrappedContent))},directives:[Lh,L$],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),e}();function q$(e,t){if(1&e&&(Ts(0,"mat-option",6),Ts(1,"div"),ku(2),As(),As()),2&e){var n=t.$implicit,i=Hs();Cs("value",n),qo(1),cu(i.optionsVisible),qo(1),Su(" ",n," ")}}var X$=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.selectionChange=new Zc,this.optionsVisible="invisible"}return b(e,[{key:"toggleOptions",value:function(){this.optionsVisible="visible"===this.optionsVisible?"invisible":"visible"}},{key:"selectionChanged",value:function(e){this.selection=e,this.ga.event("selection_change","dropdown","".concat(this.label,":").concat(e)),this.selectionChange.emit(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-dropdown"]],inputs:{label:"label",options:"options",selection:"selection"},outputs:{selectionChange:"selectionChange"},decls:7,vars:3,consts:[[1,"ccf-dropdown","wrapper"],[1,"container"],[1,"dropdown-form-field"],[1,"label"],["disableOptionCentering","true","panelClass","option-panel","disableRipple","true",1,"selected-value",3,"value","selectionChange","openedChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Ts(2,"mat-form-field",2),Ts(3,"div",3),ku(4),As(),Ts(5,"mat-select",4),Fs("selectionChange",function(e){return t.selectionChanged(e.value)})("openedChange",function(){return t.toggleOptions()}),xs(6,q$,3,5,"mat-option",5),As(),As(),As(),As()),2&e&&(qo(4),Su(" ",t.label," "),qo(1),Cs("value",t.selection),qo(1),Cs("ngForOf",t.options))},directives:[zz,aY,Dh,mb],styles:["@-webkit-keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.dropdown-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:1em;padding-right:1em;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{font-size:.875rem;border:none}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix mat-select{font-size:1rem;font-weight:bold}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .option-panel{-webkit-animation:slideInHorizontalDropdown .3s;animation:slideInHorizontalDropdown .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;position:absolute!important;top:1.55rem;max-width:9.5rem} .option-panel .mat-option{border-bottom-width:1px;border-bottom-style:solid;padding-left:1em} .option-panel :last-child{border-bottom:none} .cdk-overlay-pane{min-width:0rem!important}.dropdown-form-field[_ngcontent-%COMP%]{height:3rem;width:100%}.dropdown-form-field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{padding-bottom:.063rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem} .ccf-dropdown .mat-select-arrow-wrapper{transform:translatey(-.5em)}"],changeDetection:0}),e}(),Y$=["popover"];function K$(e,t){if(1&e){var n=Ds();Ts(0,"div",7,8),Ts(2,"div"),Ts(3,"div",9),ku(4),As(),Ts(5,"input",10),Fs("keyup",function(e){return mn(n),Hs().onKeyLow(e)}),As(),As(),Ts(6,"ng5-slider",11),Fs("valueChange",function(e){return mn(n),Hs().lowValue=e})("highValueChange",function(e){return mn(n),Hs().highValue=e})("userChangeEnd",function(){return mn(n),Hs().sliderValueChanged()}),As(),Ts(7,"div"),Ts(8,"div",12),ku(9),As(),Ts(10,"input",13),Fs("keyup",function(e){return mn(n),Hs().onKeyHigh(e)}),As(),As(),As()}if(2&e){var i=Hs();qo(2),Cu("label min fade-in ",i.contentsVisible,""),qo(2),Su(" ",i.options.floor,"> "),qo(1),Xs("value",i.lowValue),qo(1),Cu("slider fade-in ",i.contentsVisible,""),Cs("options",i.options)("value",i.lowValue)("highValue",i.highValue),qo(1),Cu("label max fade-in ",i.contentsVisible,""),qo(2),Su(" ",i.options.ceil," "),qo(1),Xs("value",i.highValue)}}var Q$=function(){var e=function(){function e(t,n,i){m(this,e),this.element=n,this.ga=i,this.selectionChange=new Zc,this.isSliderOpen=!1,this.contentsVisible="invisible",this.isSliderInitialized=!1;var r=t.position().flexibleConnectedTo(n).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"}]);this.overlayRef=t.create({panelClass:"slider-pane",positionStrategy:r})}return b(e,[{key:"rangeLabel",get:function(){var e=this.lowValue,t=this.highValue;return e===t?"".concat(e):"".concat(e,"-").concat(t)}},{key:"ngOnChanges",value:function(e){e.valueRange&&this.optionsChanged(),e.selection&&(this.lowValue=Math.min.apply(Math,v(this.selection)),this.highValue=Math.max.apply(Math,v(this.selection)))}},{key:"optionsChanged",value:function(){var e,t;this.options={floor:this.valueRange?this.valueRange[0]:0,ceil:this.valueRange?this.valueRange[1]:0,step:1,hideLimitLabels:!0,hidePointerLabels:!0},this.lowValue=null!==(e=this.options.floor)&&void 0!==e?e:0,this.highValue=null!==(t=this.options.ceil)&&void 0!==t?t:0}},{key:"ngOnDestroy",value:function(){this.overlayRef.dispose()}},{key:"closeSliderPopover",value:function(e){var t,n,i=this.element,r=this.isSliderOpen,o=this.popoverElement;r&&(i.nativeElement.contains(e)||(null===(n=null===(t=null==o?void 0:o.nativeElement)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,e))||(this.overlayRef.detach(),this.isSliderInitialized=!1,this.isSliderOpen=!1,this.contentsVisible="invisible"))}},{key:"toggleSliderPopover",value:function(){var e=this.isSliderOpen,t=this.isSliderInitialized;t?(this.overlayRef.detach(),this.isSliderInitialized=!1):!t&&!e&&this.initializeSliderPopover(),this.contentsVisible="visible"===this.contentsVisible?"invisible":"visible",this.isSliderOpen=!e}},{key:"sliderValueChanged",value:function(){var e=this.lowValue,t=this.highValue;this.selection=[e,t],this.ga.event("slider_range_change","dual_slider","".concat(this.label,":").concat(e,":").concat(t)),this.selectionChange.emit(this.selection)}},{key:"initializeSliderPopover",value:function(){var e=this.overlayRef,t=this.popoverPortal;e.attach(t),e.updatePosition(),this.isSliderInitialized=!0}},{key:"onKeyLow",value:function(e){var t=Number(e.target.value);"Enter"===e.key&&(t>=Number(this.options.floor)&&t<=Number(this.options.ceil)&&(this.lowValue=t),e.target.value=String(this.lowValue),e.target.blur(),this.sliderValueChanged())}},{key:"onKeyHigh",value:function(e){var t=Number(e.target.value);"Enter"===e.key&&(t>=Number(this.options.floor)&&t<=Number(this.options.ceil)&&(this.highValue=t),e.target.value=String(this.highValue),e.target.blur(),this.sliderValueChanged())}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(Ku),Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-dual-slider"]],viewQuery:function(e,t){var n;(1&e&&(hl(tp,7),hl(Y$,5,Ku)),2&e)&&(ll(n=dl())&&(t.popoverPortal=n.first),ll(n=dl())&&(t.popoverElement=n.first))},hostBindings:function(e,t){1&e&&Fs("click",function(e){return t.closeSliderPopover(e.target)},!1,no)("touchstart",function(e){return t.closeSliderPopover(e.target)},!1,no)},inputs:{label:"label",valueRange:"valueRange",selection:"selection"},outputs:{selectionChange:"selectionChange"},features:[Gt],decls:10,vars:4,consts:[[1,"ccf-slider","wrapper"],[1,"container"],["class","ccf-slider detached",4,"cdk-portal"],[1,"slider-form-field",3,"click"],[1,"slider-labels"],[1,"name-label"],[1,"range-label"],[1,"ccf-slider","detached"],["popover",""],[1,"label","floor"],["type","text",1,"input-low",3,"value","keyup"],[3,"options","value","highValue","valueChange","highValueChange","userChangeEnd"],[1,"label","ceil"],["type","text",1,"input-high",3,"value","keyup"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),xs(2,K$,11,16,"div",2),Ts(3,"mat-form-field",3),Fs("click",function(){return t.toggleSliderPopover()}),Ts(4,"div",4),Ts(5,"span",5),ku(6),As(),Ts(7,"span",6),ku(8),As(),As(),Ps(9,"mat-select"),As(),As(),As()),2&e&&(qo(3),su("highlight",t.isSliderOpen),qo(3),xu(t.label),qo(2),xu(t.rangeLabel))},directives:[np,zz,aY,$Y],styles:[".slider-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;font-size:.875rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.slider-labels[_ngcontent-%COMP%]{display:flex;flex-direction:column}.slider-labels[_ngcontent-%COMP%] .name-label[_ngcontent-%COMP%]{padding-bottom:.25rem}.slider-labels[_ngcontent-%COMP%] .range-label[_ngcontent-%COMP%]{font-weight:bold} .ccf-slider.wrapper .mat-select-arrow-wrapper{transform:translatey(-1.5em)}@-webkit-keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .slider-pane{position:absolute!important;top:-1px}.ccf-slider.detached[_ngcontent-%COMP%]{-webkit-animation:slideInHorizontalSlider .3s;animation:slideInHorizontalSlider .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;display:flex;justify-content:center;align-items:center;width:0rem;height:4.375rem;padding:.75rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] {visibility:hidden;margin-top:.9375rem;margin-bottom:.9375rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-bar{opacity:.2;height:.15rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-selection{opacity:1}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer{width:1rem;height:1rem;top:-.405rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer:after{display:none}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:2rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.min[_ngcontent-%COMP%]{margin-right:1rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%]{margin-left:1rem;align-items:flex-end}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-align:right}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .floor[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%]{font-size:.875rem}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border:none;width:1.75rem;font-size:1rem;font-weight:bold;padding:0}"]}),e}();function $$(e,t){if(1&e){var n=Ds();Ts(0,"div",4),Ts(1,"mat-checkbox",5),Fs("change",function(e){var t=mn(n).$implicit;return Hs().filterOnChange(e,t)}),ku(2),As(),As()}if(2&e){var i=t.$implicit,r=Hs();qo(1),Cs("checked",null==r.selection?null:r.selection.includes(i)),qo(1),Su(" ",i," ")}}var Z$=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new Zc}return b(e,[{key:"filterOnChange",value:function(e,t){e.checked?(this.selection=[].concat(v(this.selection),[t]),this.ga.event("filter_added","filter_checkbox",t)):(this.selection=this.selection.filter(function(e){return e!==t}),this.ga.event("filter_removed","filter_checkbox",t)),this.selectionChange.emit(this.selection)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-checkbox"]],inputs:{label:"label",options:"options",selection:"selection",columns:"columns"},outputs:{selectionChange:"selectionChange"},decls:5,vars:6,consts:[[1,"filter-container"],[1,"filter-label"],[1,"options-container"],["class","option",4,"ngFor","ngForOf"],[1,"option"],[3,"checked","change"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),ku(2),As(),Ts(3,"div",2),xs(4,$$,3,2,"div",3),As(),As()),2&e&&(qo(2),xu(t.label),qo(1),su("three",3===t.columns)("four",4===t.columns),qo(1),Cs("ngForOf",t.options))},directives:[Dh,FX],styles:[".mat-checkbox.mat-accent .mat-checkbox-checkmark-path{stroke:#fff!important} .mat-checkbox.mat-accent .mat-checkbox-inner-container{margin-right:1rem}.filter-label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}.options-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap}.options-container.three[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:33%}.options-container.four[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:25%}.option[_ngcontent-%COMP%]{color:#fafafa}"],changeDetection:0}),e}(),J$=function(){return["Both","Male","Female"]},eZ=function(){return[1,110]},tZ=function(){return[13,83]},nZ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.filtersChange=new Zc,this.applyFilters=new Zc}return b(e,[{key:"updateFilter",value:function(e,t){this.filters=Object.assign(Object.assign({},this.filters),o({},t,e)),this.ga.event("filter_update","filter_content","".concat(t,":").concat(e)),this.filtersChange.emit(this.filters)}},{key:"applyButtonClick",value:function(){this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}},{key:"refreshFilters",value:function(){this.filters=Object.assign(Object.assign({},this.filters),{sex:"Both",ageRange:[1,110],bmiRange:[13,83],technologies:[],tmc:[]}),this.ga.event("filters_reset","filter_content"),this.filtersChange.emit(this.filters)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange",applyFilters:"applyFilters"},decls:14,vars:23,consts:[[1,"patient-filters"],["label","Sex",3,"options","selection","selectionChange"],["label","Age",3,"valueRange","selection","selectionChange"],["label","BMI",3,"valueRange","selection","selectionChange"],[1,"filter","assays"],["label","Assay Types",3,"columns","options","selection","selectionChange"],[1,"filter","providers"],["label","Tissue Providers",3,"columns","options","selection","selectionChange"],[1,"button-container"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"ccf-dropdown",1),Fs("selectionChange",function(e){return t.updateFilter(e,"sex")}),As(),Ts(2,"ccf-dual-slider",2),Fs("selectionChange",function(e){return t.updateFilter(e,"ageRange")}),As(),Ts(3,"ccf-dual-slider",3),Fs("selectionChange",function(e){return t.updateFilter(e,"bmiRange")}),As(),As(),Ts(4,"div",4),Ts(5,"ccf-checkbox",5),Fs("selectionChange",function(e){return t.updateFilter(e,"technologies")}),As(),As(),Ts(6,"div",6),Ts(7,"ccf-checkbox",7),Fs("selectionChange",function(e){return t.updateFilter(e,"tmc")}),As(),As(),Ts(8,"div",8),Ts(9,"button",9),Fs("click",function(){return t.applyButtonClick()}),ku(10,"APPLY FILTERS"),As(),Ts(11,"div",10),Ts(12,"mat-icon",11),Fs("click",function(){return t.refreshFilters()}),ku(13,"refresh"),As(),As(),As()),2&e&&(su("hidden",t.hidden),qo(1),Cs("options",Wc(20,J$))("selection",null==t.filters?null:t.filters.sex),qo(1),Cs("valueRange",Wc(21,eZ))("selection",null==t.filters?null:t.filters.ageRange),qo(1),Cs("valueRange",Wc(22,tZ))("selection",null==t.filters?null:t.filters.bmiRange),qo(1),su("hidden",t.hidden),qo(1),Cs("columns",4)("options",t.technologyFilters)("selection",null==t.filters?null:t.filters.technologies),qo(1),su("hidden",t.hidden),qo(1),Cs("columns",3)("options",t.providerFilters)("selection",null==t.filters?null:t.filters.tmc),qo(1),su("hidden",t.hidden))},directives:[X$,Q$,Z$,P_,x_],styles:[".filter[_ngcontent-%COMP%]{margin-top:2rem}.filter.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.filter.assays[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{margin-right:0 rem;width:25%}.button-container[_ngcontent-%COMP%]{margin-top:2rem;display:flex;flex-direction:row-reverse;align-items:center}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.refresh-icon[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{cursor:pointer;transition:.6s;transition-property:background}.patient-filters[_ngcontent-%COMP%]{display:flex;width:90%;padding-top:1rem}.patient-filters.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.patient-filters[_ngcontent-%COMP%] ccf-dual-slider[_ngcontent-%COMP%]{margin-left:.5rem;width:33%}.patient-filters[_ngcontent-%COMP%] ccf-dropdown[_ngcontent-%COMP%]{width:33%}"],changeDetection:0}),e}();function iZ(e,t){1&e&&(Ts(0,"div"),Ts(1,"mat-icon",7),ku(2,"close"),As(),As())}function rZ(e,t){1&e&&Ps(0,"mat-icon",8)}var oZ=function(){var e=function(){function e(){m(this,e),this.filtersChange=new Zc,this.filtersVisible=!1}return b(e,[{key:"toggleFilterVisible",value:function(){this.filtersVisible=!this.filtersVisible}},{key:"removeBox",value:function(){this.filtersVisible=!1}},{key:"applyFilters",value:function(e){this.filters=e,this.filtersChange.emit(e),this.removeBox()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange"},decls:8,vars:12,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","hidden","filters","applyFilters"],[1,"icon"],["svgIcon","filter",1,"icon","funnel"]],template:function(e,t){if(1&e&&(Ts(0,"div",0),Ts(1,"button",1),Fs("click",function(){return t.toggleFilterVisible()}),xs(2,iZ,3,0,"div",2),xs(3,rZ,1,0,"ng-template",null,3,ml),As(),Ts(5,"div",4),Ts(6,"div",5),Ts(7,"ccf-filters-content",6),Fs("applyFilters",function(e){return t.applyFilters(e)}),As(),As(),As(),As()),2&e){var n=Ss(4);su("expanded",t.drawerExpanded),qo(2),Cs("ngIf",t.filtersVisible)("ngIfElse",n),qo(3),su("visible",t.filtersVisible)("hidden",!t.filtersVisible),qo(2),Cs("technologyFilters",t.technologyFilters)("providerFilters",t.providerFilters)("hidden",!t.filtersVisible)("filters",t.filters)}},directives:[Lh,nZ,x_],styles:[".filters-popover[_ngcontent-%COMP%]{position:inherit}.filters-popover.expanded[_ngcontent-%COMP%]{position:relative}.filters-popover.expanded[_ngcontent-%COMP%] .popup-container[_ngcontent-%COMP%]{right:inherit}.filters-popover.expanded[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding-left:4em!important}.popup-container[_ngcontent-%COMP%]{position:absolute;z-index:5;top:1.2rem;left:1.48rem;box-shadow:.2rem .2rem 1rem #00000058}.popup-container[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding:1.5rem;position:relative;height:26.5rem}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;height:26.5rem;transition:width .2s ease-in-out;border-width:1px}.popup-container.visible[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:1;transition-delay:.3s;transition-duration:.2s}.popup-container.hidden[_ngcontent-%COMP%]{width:0;height:0;transition:all .2s ease-out;transition-delay:.3s;pointer-events:none}.popup-container.hidden[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out}.show-hide[_ngcontent-%COMP%]{background:none;border:none;z-index:10;position:relative;cursor:pointer;outline:none;padding:.5rem;border-radius:.25rem;transition:.6s}"],changeDetection:0}),e}(),aZ=function(){function e(t,n){m(this,e),this.original=t,this.level=n,this.visible=!0,this.opacity=20}return b(e,[{key:"label",get:function(){return this.original.label}},{key:"expandable",get:function(){return this.original.children.length>0}}],[{key:"create",value:function(t,n){return new e(t,n)}}]),e}();function sZ(e,t){if(1&e){var n=Ds();Ts(0,"div",5),Fs("click",function(e){var t=mn(n).node,i=Hs();return i.select(e.ctrlKey,t,!0,!i.isSelected(t))}),ku(1),As()}if(2&e){var i=t.node,r=Hs();su("hidden",i.label===(null==r.highlightedNode?null:r.highlightedNode.label))("filtered-out",!r.occurenceData[i.original.id]&&!!r.termData[i.original.id])("unavailable",!r.termData[i.original.id])("selected",r.isSelected(i)),qo(1),xu("colon"===i.label?"large intestine":i.label)}}function uZ(e,t){1&e&&Rs(0)}var cZ=function(e){return{node:e}};function lZ(e,t){if(1&e){var n=Ds();Ts(0,"mat-tree-node",6),Fs("mouseleave",function(){mn(n);var e=Ss(5);return Hs().mouseOut(),e.reset()}),Ts(1,"div"),Ts(2,"mat-icon",7),Fs("mouseenter",function(){var e=mn(n).$implicit;return Hs().mouseOver(e)}),As(),Ts(3,"div",8),Ts(4,"ccf-opacity-slider",9,10),Fs("opacityChange",function(e){var t=mn(n).$implicit;return Hs().updateOpacity(t,e)})("opacityReset",function(){var e=mn(n).$implicit;return Hs().resetNode(e)})("visibilityToggle",function(){var e=mn(n).$implicit;return Hs().toggleVisibility(e)}),As(),As(),As(),Ps(6,"div",11),xs(7,uZ,1,0,"ng-container",12),Ts(8,"div",13),ku(9),As(),As()}if(2&e){var i=t.$implicit,r=Hs(),o=Ss(2);Cs("matTreeNodePaddingIndent",r.indent),qo(1),au("display",-1!==i.opacity?"none":"block"),qo(1),au("left",r.getLeftIndent(i.level)),su("fade",!0!==i.visible),qo(1),au("left",r.getLeftIndent(i.level)),su("hidden",i.label!==(null==r.highlightedNode?null:r.highlightedNode.label)),qo(1),Cs("visible",i.visible)("opacity",i.opacity),qo(3),Cs("ngTemplateOutlet",o)("ngTemplateOutletContext",qc(18,cZ,i)),qo(1),su("suborgan",i.level>1),qo(1),xu(r.occurenceData[i.original.id]||0)}}function hZ(e,t){1&e&&Rs(0)}function fZ(e,t){if(1&e){var n=Ds();Ts(0,"mat-tree-node",14),Fs("mouseleave",function(){mn(n);var e=Ss(5);return Hs().mouseOut(),e.reset()}),Ts(1,"div"),Ts(2,"mat-icon",7),Fs("mouseenter",function(){var e=mn(n).$implicit;return Hs().mouseOver(e)}),As(),Ts(3,"div",8),Ts(4,"ccf-opacity-slider",9,15),Fs("opacityChange",function(e){var t=mn(n).$implicit;return Hs().updateOpacity(t,e)})("opacityReset",function(){var e=mn(n).$implicit;return Hs().resetNode(e)})("visibilityToggle",function(){var e=mn(n).$implicit;return Hs().toggleVisibility(e)}),As(),As(),As(),Ts(6,"button",16),Ts(7,"mat-icon",17),ku(8),As(),As(),xs(9,hZ,1,0,"ng-container",12),Ts(10,"div",13),ku(11),As(),As()}if(2&e){var i=t.$implicit,r=Hs(),o=Ss(2);Cs("matTreeNodePaddingIndent",r.indent),qo(1),au("display",-1!==i.opacity?"none":"block"),qo(1),au("left",r.getLeftIndent(i.level)),su("fade",!0!==i.visible),qo(1),au("left",r.getLeftIndent(i.level)),su("hidden",i.label!==(null==r.highlightedNode?null:r.highlightedNode.label)),qo(1),Cs("visible",i.visible)("opacity",i.opacity),qo(2),su("hidden",i.label===(null==r.highlightedNode?null:r.highlightedNode.label)),ks("aria-label","Toggle ",i.label,""),qo(2),Su(" ",r.control.isExpanded(i)?"expand_less":"expand_more"," "),qo(1),Cs("ngTemplateOutlet",o)("ngTemplateOutletContext",qc(22,cZ,i)),qo(1),su("suborgan",i.level>1),qo(1),xu(r.occurenceData[i.original.id]||0)}}var dZ=(0,TW.property)("level"),pZ=(0,TW.property)("expandable"),vZ=function(){var e=function(){function e(t,n){m(this,e),this.cdr=t,this.ga=n,this.atScrollBottom=!1,this.nodeSelected=new Zc,this.nodeChanged=new Zc,this.indent="1.5rem",this.control=new rK(dZ,pZ),this.flattener=new SK(aZ.create,dZ,pZ,TW.invoke.bind(void 0,this,"getChildren")),this.dataSource=new EK(this.control,this.flattener),this._nodes=void 0,this.bodyNode=new aZ({"@id":"http://purl.obolibrary.org/obo/UBERON_0013702","@type":"OntologyTreeNode",id:"http://purl.obolibrary.org/obo/UBERON_0013702",label:"body",parent:"",children:[],synonymLabels:[]},0),this.anySelectionsMade=!1,this.selectedNodes=[]}return b(e,[{key:"nodes",get:function(){return this._nodes},set:function(e){var t;this._nodes=e,this.control&&(this.dataSource.data=null!==(t=this._nodes)&&void 0!==t?t:[])}},{key:"getChildren",get:function(){return this._getChildren},set:function(e){var t;this._getChildren=e,this.dataSource.data=null!==(t=this.nodes)&&void 0!==t?t:[]}},{key:"occurenceData",get:function(){return this._occurenceData},set:function(e){this._occurenceData=e||{}}},{key:"termData",get:function(){return this._termData},set:function(e){this._termData=e||{}}},{key:"ngOnInit",value:function(){this.control.dataNodes&&this.control.expand(this.control.dataNodes[0])}},{key:"ngOnChanges",value:function(e){if(e.ontologyFilter){var t=e.ontologyFilter.currentValue;this.selectByIDs((null==t?void 0:t.length)>=0?t:[this.bodyNode.original.id])}}},{key:"selectByIDs",value:function(e){var t=this,n=this.control.dataNodes,i=n.filter(function(t){return e.indexOf(t.original.id)>-1});(null==i?void 0:i.length)>0&&(this.selectedNodes=i,this.ga.event("nodes_selected_by_ids","ontology_tree",i.map(function(e){return e.label}).join(",")),this.control.collapseAll(),this.selectedNodes.forEach(function(e){t.expandAndSelect(e.original,function(e){var t;return null===(t=n.find(function(t){return t.original.id===e.parent}))||void 0===t?void 0:t.original},!0)}))}},{key:"expandAndSelect",value:function(e,t){for(var n,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.cdr,o=this.control,a=new Set,s=t(e);s;)a.add(s),s=t(s);var u=(0,TW.filter)(o.dataNodes,function(e){return a.has(e.original)}),c=o.dataNodes.find(function(t){return t.original===e});i||(this.selectedNodes=[],o.collapseAll());var l,h=_(u);try{for(h.s();!(l=h.n()).done;){var f=l.value;o.expand(f)}}catch(d){h.e(d)}finally{h.f()}"body"===e.label&&(null===(n=o.dataNodes)||void 0===n?void 0:n.length)>0&&o.expand(o.dataNodes[0]),this.select(i,c,!1,!0),r.detectChanges()}},{key:"isInnerNode",value:function(e,t){return t.expandable}},{key:"isSelected",value:function(e){return this.selectedNodes.filter(function(t){return(null==e?void 0:e.original.label)===(null==t?void 0:t.original.label)}).length>0}},{key:"select",value:function(e,t,n,i){if(this.anySelectionsMade||(this.selectedNodes=[],this.anySelectionsMade=!0),void 0===t)return this.selectedNodes=[],void this.ga.event("nodes_unselected","ontology_tree");e?i?this.selectedNodes.indexOf(t)<0&&this.selectedNodes.push(t):this.selectedNodes.splice(this.selectedNodes.indexOf(t),1):(this.selectedNodes=[],i&&this.selectedNodes.push(t)),this.ga.event("nodes_selected","ontology_tree",this.selectedNodes.map(function(e){return e.label}).join(",")),n&&this.nodeSelected.emit(this.selectedNodes.map(function(e){return null==e?void 0:e.original}))}},{key:"mouseOver",value:function(e){this.highlightedNode=e}},{key:"mouseOut",value:function(){this.highlightedNode=void 0}},{key:"updateOpacity",value:function(e,t){e.opacity=t,this.ga.event("opacity_update","ontology_tree",e.label,t),this.nodeChanged.emit(e)}},{key:"resetNode",value:function(e){e.opacity=20,e.visible=!0,this.ga.event("node_reset","ontology_tree",e.label),this.nodeChanged.emit(e)}},{key:"toggleVisibility",value:function(e){e.visible=!0!==e.visible,this.ga.event("visibility_update","ontology_tree",e.label,+e.visible),this.nodeChanged.emit(e)}},{key:"getLeftIndent",value:function(e){return-1.5*e+"rem"}},{key:"onScroll",value:function(e){if(e.target){var t=e.target,n=t.clientHeight,i=t.scrollHeight,r=t.scrollTop;this.atScrollBottom=i-r-n<20}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(wc),Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[Gt],decls:6,vars:5,consts:[[1,"ccf-ontology-tree",3,"dataSource","treeControl","scroll"],["selectableRegion",""],["class","node leaf-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef"],["class","node inner-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef","matTreeNodeDefWhen"],[1,"scroll-gradient"],[1,"text",3,"click"],["matTreeNodePadding","",1,"node","leaf-node",3,"matTreeNodePaddingIndent","mouseleave"],["svgIcon","app:opacity",1,"icon","opacity",3,"mouseenter"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider1",""],[1,"non-expandable"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"num-results"],["matTreeNodePadding","",1,"node","inner-node",3,"matTreeNodePaddingIndent","mouseleave"],["slider2",""],["mat-icon-button","","matTreeNodeToggle","",1,"toggle"],[1,"icon","font-icon"]],template:function(e,t){1&e&&(Ts(0,"mat-tree",0),Fs("scroll",function(e){return t.onScroll(e)}),xs(1,sZ,2,9,"ng-template",null,1,ml),xs(3,lZ,10,20,"mat-tree-node",2),xs(4,fZ,12,24,"mat-tree-node",3),As(),Ps(5,"div",4)),2&e&&(Cs("dataSource",t.dataSource)("treeControl",t.control),qo(4),Cs("matTreeNodeDefWhen",t.isInnerNode),qo(1),su("hidden",!!t.atScrollBottom))},directives:[wK,yK,mK,bK,x_,WG,Gh,P_,kK],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;height:100%;width:25.25rem;overflow:auto;overflow-x:hidden}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .toggle[_ngcontent-%COMP%]{z-index:-1;opacity:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .text[_ngcontent-%COMP%]{margin-left:.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]{min-height:0;font-size:1rem;margin-bottom:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:width;position:relative;z-index:1}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{width:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%] ccf-opacity-slider[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider{height:1.5rem;margin-left:1rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box .slider-and-label{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider{height:1.5rem;width:15rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider .mat-slider-wrapper{top:12px}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .opacity-value{width:3rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-right:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node.inner-node[_ngcontent-%COMP%] button.hidden[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{position:relative;min-width:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:normal}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .autocomplete-open[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{border-bottom:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .non-expandable[_ngcontent-%COMP%]{margin-left:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{white-space:nowrap;cursor:pointer;margin-left:1rem;opacity:1;width:50%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:opacity,width}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.hidden[_ngcontent-%COMP%]{opacity:0;width:0%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.unavailable[_ngcontent-%COMP%]{pointer-events:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-left:auto}.scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}(),gZ=function(){function e(t){m(this,e),this.ontologyState=t}return b(e,[{key:"rootNode",get:function(){return this.ontologyState.rootNode$}},{key:"filter",value:function(e){var t=this;return this.ontologyState.nodes$.pipe(ue(function(n){return t.lookup(n,e.toLowerCase())}))}},{key:"lookup",value:function(e,t){var n=this,i=new Map;return e&&e.forEach(function(e){if(e.label.toLowerCase().includes(t)&&!i.get(e.id))i.set(e.id,{index:n.getIndexOfMatch(e.label,t),displayLabel:n.formatLabel(e.label,t),node:e});else{var r=e.synonymLabels.find(function(e){return e.toLowerCase().includes(t)});r&&!i.get(e.id)&&i.set(e.id,{index:n.getIndexOfMatch(e.label+" ("+r+")",t),displayLabel:n.formatLabel(e.label+" ("+r+")",t),node:e})}}),Array.from(i.values())}},{key:"getIndexOfMatch",value:function(e,t){return e.toLowerCase().indexOf(t)}},{key:"formatLabel",value:function(e,t){var n=this.getIndexOfMatch(e,t);return[e.substr(0,n),e.substr(n,t.length),e.substr(n+t.length,e.length)]}},{key:"getChildren",value:function(e){return(0,TW.at)(this.ontologyState.snapshot.nodes,e.children)}}]),e}();function mZ(e,t){if(1&e&&(Ts(0,"mat-option",8),Ts(1,"span",9),ku(2),As(),Ts(3,"span",10),ku(4),As(),Ts(5,"span",11),ku(6),As(),As()),2&e){var n=t.$implicit;Cs("value",n),qo(2),xu(n.displayLabel[0]),qo(2),xu(n.displayLabel[1]),qo(2),xu(n.displayLabel[2])}}gZ.\u0275fac=function(e){return new(e||gZ)(Qi(kX))},gZ.\u0275prov=Ke({token:gZ,factory:gZ.\u0275fac,providedIn:"root"}),vw([OF.ak],gZ.prototype,"getChildren",null);var yZ=function(){var e=function(){function e(t,n){m(this,e),this.ontologyService=t,this.ga=n,this.selected=new Zc,this.formControl=new YV(""),this.autoCompleteOpen=!1}return b(e,[{key:"ngOnInit",value:function(){var e=this;this.filteredResults$=this.formControl.valueChanges.pipe(od(function(e){return"string"==typeof e}),fd(""),dd(function(t){return e.ontologyService.filter(t)}),ue(function(t){return(0,TW.sortBy)(t,[e.sortBySynonymResult,"index",e.sortLexically])}))}},{key:"displayFormatter",value:function(e){var t;return(null!==(t=null==e?void 0:e.displayLabel)&&void 0!==t?t:[]).join("")}},{key:"sortBySynonymResult",value:function(e){return e.displayLabel.join().includes("(")?1:-1}},{key:"sortLexically",value:function(e){return e.node.label.toLowerCase()}},{key:"onSelect",value:function(e){var t=(0,TW.get)(e,["option","value","node"]);t&&(this.ga.event("search","ontology_search",t.id),this.selected.emit(t),this.formControl.reset())}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(gZ),Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-ontology-search"]],outputs:{selected:"selected"},decls:10,vars:8,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","placeholder","Search ontology terms ...","matInput","",1,"input",3,"formControl","matAutocomplete"],[1,"ccf-ontology-search","detached","autocomplete",3,"displayWith","optionSelected","opened","closed"],["autocomplete",""],[1,"results-container"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"prefix"],[1,"search-term"],[1,"suffix"]],template:function(e,t){if(1&e&&(Ts(0,"form",0),Ts(1,"mat-form-field",1),Ts(2,"mat-icon",2),ku(3,"search"),As(),Ps(4,"input",3),Ts(5,"mat-autocomplete",4,5),Fs("optionSelected",function(e){return t.onSelect(e)})("opened",function(){return t.autoCompleteOpen=!0})("closed",function(){return t.autoCompleteOpen=!1}),Ts(7,"div",6),xs(8,mZ,7,4,"mat-option",7),Kc(9,"async"),As(),As(),As(),As()),2&e){var n=Ss(6);su("autocomplete-open",t.autoCompleteOpen),qo(4),Cs("formControl",t.formControl)("matAutocomplete",n),qo(1),Cs("displayWith",t.displayFormatter),qo(3),Cs("ngForOf",Qc(9,6,t.filteredResults$))}},directives:[ez,TV,JV,zz,x_,Nz,vU,aV,aU,OV,rz,tU,Dh,mb],pipes:[Yh],styles:[".ccf-ontology-search[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem .25rem 0;margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;height:3rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix input{margin-left:.4rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-prefix{top:.5rem;border:none}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0 .25rem;min-width:2.5rem} .ccf-ontology-search.detached{border:.125rem solid;border-top:none;border-radius:0 0 .25rem .25rem;max-height:18rem} .ccf-ontology-search.detached .results-container{width:23.75rem;margin-bottom:1rem;overflow:auto;max-height:15rem;scrollbar-width:thin} .ccf-ontology-search.detached .results-container mat-option{height:1.5rem;width:23.75rem} .ccf-ontology-search.detached .results-container mat-option .search-term{text-decoration:underline}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0;border-bottom:none}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem 0 0;border-bottom:none}"],changeDetection:0}),e}(),bZ=function(e){return[e]};function _Z(e,t){if(1&e){var n=Ds();Ts(0,"ccf-ontology-tree",2),Fs("nodeSelected",function(e){return mn(n),Hs().ontologySelection.emit(e)}),As()}if(2&e){var i=t.ngIf,r=Hs();Cs("nodes",qc(5,bZ,i))("getChildren",r.ontologySearchService.getChildren)("occurenceData",r.occurenceData)("termData",r.termData)("ontologyFilter",r.ontologyFilter)}}var wZ=function(){var e=function(){function e(t,n){m(this,e),this.ontologySearchService=t,this.store=n,this.ontologySelection=new Zc}return b(e,[{key:"selected",value:function(e){var t=this.store.selectSnapshot(kX).nodes;this.tree.expandAndSelect(e,function(e){return t[e.parent]})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(gZ),Es(qB))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-ontology-selection"]],viewQuery:function(e,t){var n;(1&e&&hl(vZ,5),2&e)&&(ll(n=dl())&&(t.tree=n.first))},inputs:{occurenceData:"occurenceData",termData:"termData",ontologyFilter:"ontologyFilter"},outputs:{ontologySelection:"ontologySelection"},decls:3,vars:3,consts:[[3,"selected"],["class","tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected"]],template:function(e,t){1&e&&(Ts(0,"ccf-ontology-search",0),Fs("selected",function(e){return t.selected(e)}),As(),xs(1,_Z,1,7,"ccf-ontology-tree",1),Kc(2,"async")),2&e&&(qo(1),Cs("ngIf",Qc(2,1,t.ontologySearchService.rootNode)))},directives:[yZ,Lh,vZ],pipes:[Yh],styles:[""],changeDetection:0}),e}(),kZ=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this.drawer=t,this.cdr=i,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new W;var o=n.connect(this);this.subscriptions.add(o.getMessagesFromSource(t).subscribe(function(e){r.handleMessage(e)&&i.markForCheck()}))}return b(e,[{key:"classEnd",get:function(){return"end"===this.position}},{key:"icon",get:function(){var e,t="arrow_right",n="arrow_left";return"end"===this.position&&(t=(e=[n,t])[0],n=e[1]),this.opened?n:t}},{key:"ngAfterViewInit",value:function(){var e=this;setTimeout(function(){e.position=e.drawer.position,e.cdr.markForCheck()})}},{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"handleMessage",value:function(e){return"drawer-toggled"===e.payload.type&&(this.opened=e.payload.opened,!0)}},{key:"toggle",value:function(){var e=this.drawer,t=e.opened,n=e.expanded;t?n?e.closeExpanded():e.close():e.open()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(V$),Es(D$),Es(wc))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(e,t){2&e&&(cu(t.className),su("ccf-drawer-toggle-button-end",t.classEnd))},decls:2,vars:1,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(e,t){1&e&&(Ts(0,"mat-icon",0),Fs("click",function(){return t.toggle()}),ku(1),As()),2&e&&(qo(1),Su(" ",t.icon,"\n"))},directives:[x_],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;display:flex;align-items:center;transition:.6s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:relative;right:.25rem;transition:all .5s}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}"],changeDetection:0}),e}();function xZ(e,t){1&e&&(Ts(0,"div",7),Ps(1,"mat-spinner",8),Ts(2,"span",3),ku(3,"Loading External Site"),As(),As())}function SZ(e,t){if(1&e){var n=Ds();Ts(0,"iframe",9),Fs("load",function(){return mn(n),Hs().loading=!1}),As()}2&e&&_s("src",Hs().safeUrl,qr)}var EZ=function(){var e=function(){function e(t){m(this,e),this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new Zc,this.loading=!0,this.safeUrl=null}return b(e,[{key:"ngOnChanges",value:function(e){"url"in e&&this.updateUrl()}},{key:"updateUrl",value:function(){var e=this.sanitizer,t=this.url;this.safeUrl=null,t&&(this.safeUrl=e.bypassSecurityTrustResourceUrl(t),this.loading=!0)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Of))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.className)},inputs:{url:"url"},outputs:{closed:"closed"},features:[Gt],decls:11,vars:4,consts:[[1,"toolbar"],["mat-flat-button","","target","_blank","rel","noopener noreferrer",1,"launch",3,"href","disabled"],[1,"icon"],[1,"text"],["mat-flat-button","",1,"close",3,"click"],["class","overlay",4,"ngIf"],["class","frame","title","Portal Data Viewer","referrerpolicy","no-referrer",3,"load",4,"ngIf"],[1,"overlay"],[1,"spinner"],["title","Portal Data Viewer","referrerpolicy","no-referrer",1,"frame",3,"load"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"a",1),Ts(2,"mat-icon",2),ku(3,"launch"),As(),Ts(4,"span",3),ku(5,"Open in Portal"),As(),As(),Ts(6,"button",4),Fs("click",function(){return t.closed.emit()}),Ts(7,"mat-icon",2),ku(8,"clear"),As(),As(),As(),xs(9,xZ,4,0,"div",5),xs(10,SZ,1,1,"iframe",6)),2&e&&(qo(1),Cs("href",t.safeUrl,Wr)("disabled",!t.safeUrl),qo(8),Cs("ngIf",t.loading),qo(1),Cs("ngIf",t.safeUrl))},directives:[M_,x_,P_,Lh,E$],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;width:100%;height:1.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%]{margin-right:3.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch.mat-button-disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.25rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{min-width:0;padding:0;line-height:1.5rem;border-radius:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:1.5rem;bottom:0;left:0;right:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{margin-bottom:.5rem}[_nghost-%COMP%] .frame[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0}),e}();function CZ(e,t){if(1&e&&Ps(0,"div",3),2&e){var n=t.index;su("line-tick-visible",Hs().tissueSectionExists(n+1))}}var OZ=function(){return[]},TZ=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-tissue-section-vis"}return b(e,[{key:"tissueSectionExists",value:function(e){return this.tissueSections.filter(function(t){return t.sectionNumber===e}).length>0}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-tissue-section-vis"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{totalTissueSections:"totalTissueSections",tissueSections:"tissueSections"},decls:7,vars:3,consts:[[1,"container"],["class","line-tick",3,"line-tick-visible",4,"ngFor","ngForOf"],[1,"x-axis"],[1,"line-tick"]],template:function(e,t){1&e&&(Ts(0,"div"),ku(1,"0"),As(),Ts(2,"div",0),xs(3,CZ,1,2,"div",1),Ps(4,"div",2),As(),Ts(5,"div"),ku(6),As()),2&e&&(qo(3),Cs("ngForOf",Wc(2,OZ).constructor(t.totalTissueSections)),qo(3),xu(t.totalTissueSections))},directives:[Dh],styles:["[_nghost-%COMP%]{width:100%;height:2.5rem;padding:.5rem 1rem;display:flex}[_nghost-%COMP%] .container[_ngcontent-%COMP%]{margin-right:.5rem;margin-left:.5rem;flex-grow:1;display:flex;position:relative;justify-content:space-evenly}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .line-tick[_ngcontent-%COMP%]{height:100%;width:1px;z-index:2}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .x-axis[_ngcontent-%COMP%]{width:100%;height:2px;position:absolute;top:calc(50% - 1px);right:0;z-index:1}"],changeDetection:0}),e}();function AZ(e,t){if(1&e){var n=Ds();Ts(0,"div",7),Ts(1,"div",8),ku(2),As(),Ts(3,"a",9),Fs("click",function(){mn(n);var e=Hs().$implicit;return Hs().linkClicked.emit(e)}),ku(4," DATA "),Ts(5,"mat-icon"),ku(6,"open_in_new"),As(),As(),As()}if(2&e){var i=Hs().$implicit;qo(1),au("background-image","url("+i.thumbnail+")"),qo(1),Su(" ",i.technology," ")}}function PZ(e,t){1&e&&(Ms(0),xs(1,AZ,7,3,"ng-template",6),Is())}var MZ=function(){var e=-1;return function(){return e+=1}}(),IZ=function(){var e=function(){function e(){m(this,e),this.className="ccf-thumbnail-carousel",this.linkClicked=new Zc,this.uid=MZ(),this.config={allowTouchMove:!1,slidesOffsetBefore:4,slidesOffsetAfter:4,slidesPerView:"auto",spaceBetween:4,watchOverflow:!0},this.navigation={prevEl:"#"+this.prevButtonId,nextEl:"#"+this.nextButtonId}}return b(e,[{key:"prevButtonId",get:function(){return"ccf-thumbnail-carousel-prev-button-".concat(this.uid)}},{key:"nextButtonId",get:function(){return"ccf-thumbnail-carousel-next-button-".concat(this.uid)}},{key:"itemId",value:function(e,t){return t.thumbnail}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-thumbnail-carousel"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.className)},inputs:{data:"data"},outputs:{linkClicked:"linkClicked"},decls:11,vars:6,consts:[[1,"prev"],["mat-icon-button","","disableRipple",""],[1,"swiper",3,"config","navigation"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"next"],[1,"fade"],["swiperSlide",""],[1,"slide"],[1,"thumbnail"],[1,"link",3,"click"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"button",1),Ts(2,"mat-icon"),ku(3,"navigate_before"),As(),As(),As(),Ts(4,"swiper",2),xs(5,PZ,2,0,"ng-container",3),As(),Ts(6,"div",4),Ts(7,"button",1),Ps(8,"div",5),Ts(9,"mat-icon"),ku(10,"navigate_next"),As(),As(),As()),2&e&&(qo(1),_s("id",t.prevButtonId),qo(3),Cs("config",t.config)("navigation",t.navigation),qo(1),Cs("ngForOf",t.data)("ngForTrackBy",t.itemId),qo(2),_s("id",t.nextButtonId))},directives:[P_,x_,i$,Dh,n$],styles:['[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%]{flex-grow:1;padding-bottom:.3125rem}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%] .swiper-slide{width:3.75rem;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:1.5rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{position:absolute;top:-.625rem;left:-2rem;z-index:10;width:2rem;height:3.125rem;opacity:1;transition:opacity ease-in-out .3s;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%]{cursor:default;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background-size:cover;position:relative;width:calc(100% - 2 * .125rem);height:calc(100% - 2 * .125rem);border-style:solid;border-width:.125rem;border-radius:.25rem;background-origin:padding-box;background-clip:padding-box;font-size:.875rem;font-weight:bold}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-.125rem;left:-.125rem;width:.125rem;height:.125rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;bottom:0;right:0;left:0;opacity:0;transition:opacity ease-in-out .3s;box-shadow:0 2px 4px #0009;font-size:.75rem;line-height:.75rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%], [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:link, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:visited, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:focus, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:active{cursor:pointer;text-decoration:none}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]:hover .link[_ngcontent-%COMP%]{opacity:1}'],changeDetection:0}),e}();function RZ(e,t){if(1&e){var n=Ds();Ts(0,"mat-icon",14),Fs("click",function(){return mn(n),Hs().toggleExpansion()}),ku(1),As()}if(2&e){var i=Hs();qo(1),xu(i.expanded?"expand_less":"expand_more")}}function DZ(e,t){if(1&e&&Ps(0,"ccf-tissue-section-vis",20),2&e){var n=Hs(2);Cs("totalTissueSections",n.tissueBlock.sectionCount)("tissueSections",n.tissueBlock.sections)}}function NZ(e,t){if(1&e){var n=Ds();Ms(0),Ts(1,"ccf-thumbnail-carousel",21),Fs("linkClicked",function(e){return mn(n),Hs(2).linkHandler(e.link)}),As(),Is()}if(2&e){var i=Hs(2);qo(1),Cs("data",i.tissueBlock.datasets)}}function LZ(e,t){if(1&e){var n=Ds();Ms(0),Ts(1,"ccf-thumbnail-carousel",21),Fs("linkClicked",function(e){return mn(n),Hs(3).linkHandler(e.link)}),As(),Is()}if(2&e){var i=Hs().$implicit;qo(1),Cs("data",i.datasets)}}function jZ(e,t){if(1&e){var n=Ds();Ts(0,"div",22),Ts(1,"div",23),Ts(2,"mat-icon",24),ku(3,"bubble_chart"),As(),Ts(4,"div",17),Ts(5,"div",8),ku(6),As(),Ts(7,"div",8),ku(8),As(),As(),Ts(9,"div",9),Fs("click",function(){var e=mn(n).$implicit;return Hs(2).linkHandler(e.link)}),Ts(10,"div",10),ku(11,"TISSUE SECTION"),As(),Ts(12,"mat-icon",11),ku(13,"open_in_new"),As(),As(),As(),xs(14,LZ,2,1,"ng-container",13),As()}if(2&e){var i=t.$implicit;qo(6),xu(i.label),qo(2),xu(i.description),qo(6),Cs("ngIf",i.datasets.length>0)}}function FZ(e,t){if(1&e){var n=Ds();Ms(0),Ts(1,"div",15),Ts(2,"div",16),Ts(3,"mat-icon",5),ku(4,"bubble_chart"),As(),Ts(5,"div",17),Ts(6,"div",8),ku(7),As(),Ts(8,"div",8),ku(9),As(),As(),Ts(10,"div",9),Fs("click",function(){mn(n);var e=Hs();return e.linkHandler(e.tissueBlock.link)}),Ts(11,"div",10),ku(12,"TISSUE BLOCK"),As(),Ts(13,"mat-icon",11),ku(14,"open_in_new"),As(),As(),As(),xs(15,DZ,1,2,"ccf-tissue-section-vis",18),xs(16,NZ,2,1,"ng-container",13),As(),xs(17,jZ,15,3,"div",19),Is()}if(2&e){var i=Hs();qo(7),xu(i.tissueBlock.label),qo(2),xu(i.tissueBlock.description),qo(6),Cs("ngIf",i.tissueBlock.sections.length>1),qo(1),Cs("ngIf",i.tissueBlock.datasets.length>0),qo(1),Cs("ngForOf",i.tissueBlock.sections)}}var BZ=function(e){return{"background-color":e}},VZ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.clsName="ccf-donor-card",this.selected=!1,this.expanded=!1,this.highlighted=!1,this.checked=new Zc,this.linkClick=new Zc,this.hoverState=""}return b(e,[{key:"handleCheckbox",value:function(){this.selected=!this.selected,this.ga.event("selected_toggled","donor_card",this.tissueBlock.label,+this.selected),this.checked.emit(this.selected),this.expanded=!1}},{key:"toggleExpansion",value:function(){this.selected&&(this.expanded=!this.expanded,this.ga.event("expanded_toggled","donor_card",this.tissueBlock.label,+this.expanded))}},{key:"linkHandler",value:function(e){this.ga.event("link_clicked","donor_card",this.tissueBlock.label),this.selected?this.linkClick.emit(e):(this.selected=!0,this.checked.emit(this.selected))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{tissueBlock:"tissueBlock",selected:"selected",color:"color",expanded:"expanded",highlighted:"highlighted"},outputs:{checked:"checked",linkClick:"linkClick"},decls:19,vars:20,consts:[[1,"main-container"],[1,"checkbox-background",3,"ngStyle","click"],[1,"checkbox",3,"checked"],[1,"hoverable","default-padding","donor","mat-elevation-z2"],[1,"d-flex"],[1,"icon-size","icon-dark","mr-5"],[1,"donor-info"],[1,"title","description"],[1,"description"],[1,"hover-state","mat-elevation-z4",3,"click"],[1,"hover-title"],[1,"icon-size","hover-icon"],["class","icon-size ml-5 selectable",3,"click",4,"ngIf"],[4,"ngIf"],[1,"icon-size","ml-5","selectable",3,"click"],[1,"expanded-view","mat-elevation-z2","align-end"],[1,"info-block","hover-enabled","default-padding"],[1,"text-content"],[3,"totalTissueSections","tissueSections",4,"ngIf"],["class","expanded-view w-80 mat-elevation-z2 align-end",4,"ngFor","ngForOf"],[3,"totalTissueSections","tissueSections"],[1,"mt-05",3,"data","linkClicked"],[1,"expanded-view","w-80","mat-elevation-z2","align-end"],[1,"default-padding","info-block","hover-enabled"],[1,"icon-size","mr-5","icon-light"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Fs("click",function(){return t.handleCheckbox()}),Ps(2,"mat-checkbox",2),As(),Ts(3,"div",3),Ts(4,"div",4),Ts(5,"mat-icon",5),ku(6,"person"),As(),Ts(7,"div",6),Ts(8,"div",7),ku(9),As(),Ts(10,"div",8),ku(11),As(),As(),As(),Ts(12,"div",9),Fs("click",function(){return t.linkHandler(t.tissueBlock.donor.link)}),Ts(13,"div",10),ku(14,"DONOR"),As(),Ts(15,"mat-icon",11),ku(16,"open_in_new"),As(),As(),xs(17,RZ,2,1,"mat-icon",12),As(),As(),xs(18,FZ,18,5,"ng-container",13)),2&e&&(qo(1),su("selected",t.selected)("highlighted",t.highlighted),Cs("ngStyle",qc(18,BZ,t.selected?t.color:"transparent")),qo(1),su("checkselected",t.selected),Cs("checked",t.selected),qo(1),su("hover-enabled",t.selected)("expanded",t.expanded)("highlighted",t.highlighted),qo(6),xu(t.tissueBlock.donor.label),qo(2),xu(t.tissueBlock.donor.description),qo(6),Cs("ngIf",t.selected),qo(1),Cs("ngIf",t.expanded))},directives:[Hh,FX,x_,Lh,Dh,TZ,IZ],styles:["[_nghost-%COMP%]{width:100%}[_nghost-%COMP%] .main-container[_ngcontent-%COMP%]{display:flex;min-height:3rem;width:100%;align-items:center;padding-left:.5rem}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%]{height:2rem;width:2rem;border-radius:50%;margin-right:.5rem;display:flex;justify-content:center;align-items:center;cursor:pointer}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-checked.mat-accent .mat-checkbox-background, [_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-indeterminate.mat-accent[_ngcontent-%COMP%] .mat-checkbox-background[_ngcontent-%COMP%]{background-color:transparent}[_nghost-%COMP%] .checkbox-background.highlighted[_ngcontent-%COMP%] .mat-ripple-element{opacity:.04}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkselected[_ngcontent-%COMP%] .mat-checkbox-frame{border-color:#fff!important}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{margin-left:1.12rem;margin-bottom:.12rem}[_nghost-%COMP%] .align-end[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;width:100%;align-items:center}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]:not(:first-child){margin-top:.5rem}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .donor.highlighted[_ngcontent-%COMP%]{box-shadow:0 6px 2px -2px #0003,0 4px 4px #00000024,0 2px 10px #0000001f}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .hover-state[_ngcontent-%COMP%]{width:19.5rem!important}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .hoverable[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]:hover .hover-state[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%]{transition:opacity .15s ease-in-out;opacity:0;cursor:pointer;position:absolute;height:100%;width:100%;top:0;margin-left:-.5rem;align-items:center;display:flex;justify-content:flex-end;padding-right:1rem;font-size:.75rem}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-title[_ngcontent-%COMP%]{font-weight:lighter}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-icon[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .default-padding[_ngcontent-%COMP%]{padding:.25rem .5rem}[_nghost-%COMP%] .expanded-view[_ngcontent-%COMP%]{margin-top:.25rem;width:85%;margin-bottom:.25rem}[_nghost-%COMP%] .d-flex[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .icon-size[_ngcontent-%COMP%]{height:1.5rem;width:1.5rem;font-size:1.5rem}[_nghost-%COMP%] .selectable[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%]{width:80%!important}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:16rem!important}[_nghost-%COMP%] .ml-5[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .mr-5[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .mt-05[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),e}();function zZ(e,t){if(1&e&&(Ts(0,"div",7),Ts(1,"div",8),ku(2),As(),Ts(3,"div",9),ku(4),As(),As()),2&e){var n=t.$implicit;qo(2),xu(n.count),qo(2),xu(n.label)}}function UZ(e,t){if(1&e){var n=Ds();Ts(0,"div",10),Fs("mouseenter",function(){var e=mn(n).$implicit;return Hs().handleHover(e.tissueBlock.spatialEntityId)})("mouseleave",function(){return mn(n),Hs().handleUnhover()}),Ts(1,"ccf-donor-card",11),Fs("checked",function(e){var t=mn(n).$implicit;return Hs().handleSelection(t,e)})("linkClick",function(e){return mn(n),Hs().handleLinkClick(e)}),As(),As()}if(2&e){var i=t.$implicit,r=Hs();qo(1),Cs("tissueBlock",i.tissueBlock)("selected",i.selected)("color",i.color)("highlighted",i.tissueBlock.spatialEntityId===r.highlighted)}}var HZ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.linkClicked=new Zc,this.listResultSelected=new Zc,this.listResultDeselected=new Zc,this.itemHovered=new Zc,this.itemUnhovered=new Zc,this.atScrollBottom=!1}return b(e,[{key:"handleSelection",value:function(e,t){this.ga.event("list_result_selected","results_browser",this.resultLabel,+t),t?this.listResultSelected.next(e):this.listResultDeselected.next(e)}},{key:"handleLinkClick",value:function(e){this.linkClicked.emit(e)}},{key:"onScroll",value:function(e){if(e.target){var t=e.target,n=t.clientHeight,i=t.scrollHeight,r=t.scrollTop;this.atScrollBottom=i-r-n<64}}},{key:"handleHover",value:function(e){this.itemHovered.emit(e)}},{key:"handleUnhover",value:function(){this.itemUnhovered.emit()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:5,consts:[[1,"results-browser-container"],[1,"stat-box"],["id","title"],["class","stat-row",4,"ngFor","ngForOf"],[1,"results-browser-list",3,"scroll"],["class","browser-item-container",3,"mouseenter","mouseleave",4,"ngFor","ngForOf"],[1,"scroll-gradient"],[1,"stat-row"],[1,"stat-value"],[1,"stat-label"],[1,"browser-item-container",3,"mouseenter","mouseleave"],[3,"tissueBlock","selected","color","highlighted","checked","linkClick"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Ts(2,"div",2),ku(3),As(),xs(4,zZ,5,2,"div",3),As(),Ts(5,"div",4),Fs("scroll",function(e){return t.onScroll(e)}),xs(6,UZ,2,4,"div",5),As(),Ps(7,"div",6),As()),2&e&&(qo(3),xu(t.resultLabel),qo(1),Cs("ngForOf",t.aggregateData),qo(2),Cs("ngForOf",t.listResults),qo(1),su("hidden",!!t.atScrollBottom))},directives:[Dh,VZ],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 7rem);padding:0 1.5rem 1.5rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%]{margin-bottom:1.5rem;line-height:1.25;min-height:7.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] #title[_ngcontent-%COMP%]{font-size:1.25rem;margin-bottom:.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-value[_ngcontent-%COMP%]{margin-right:1rem;width:5.5rem;text-align:right;font-weight:600}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-label[_ngcontent-%COMP%]{font-weight:300}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;overflow-y:scroll;scrollbar-width:thin;padding-right:.5rem;margin-bottom:2rem}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%] .browser-item-container[_ngcontent-%COMP%]{width:100%}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}();function GZ(e,t){1&e&&(Ts(0,"a",5),ku(1,"LOGIN"),As()),2&e&&Cs("href",Hs().hubmapPortalUrl+"login",Wr)}function WZ(e,t){1&e&&(Ts(0,"a",5),ku(1,"LOGOUT"),As()),2&e&&Cs("href",Hs().hubmapPortalUrl+"logout",Wr)}var qZ=function(){var e=function e(){m(this,e),this.refreshClicked=new Zc,this.downloadClicked=new Zc};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-header"]],inputs:{hubmapPortalUrl:"hubmapPortalUrl",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:3,consts:[[1,"ccf-header"],[1,"portal-home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right","svgIcon","app:logo",1,"logo"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"href",4,"ngIf"],["mat-button","","rel","noreferrer noopener","target","_blank",1,"authentication",3,"href"]],template:function(e,t){1&e&&(Ts(0,"mat-toolbar",0),Ts(1,"a",1),Ps(2,"mat-icon",2),As(),Ps(3,"div",3),xs(4,GZ,2,1,"a",4),xs(5,WZ,2,1,"a",4),As()),2&e&&(qo(1),Cs("href",t.hubmapPortalUrl,Wr),qo(3),Cs("ngIf",!t.loggedIn),qo(1),Cs("ngIf",t.loggedIn))},directives:[yW,x_,hw,Lh,M_],styles:[".ccf-header[_ngcontent-%COMP%]{height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid;display:flex}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%}.ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%]{height:1.5rem}.ccf-header[_ngcontent-%COMP%] .authentication[_ngcontent-%COMP%]{width:8.25rem;border-radius:.125rem;font-weight:500}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{display:flex;align-items:center;transition:color 1s;cursor:pointer;text-decoration:none}.ccf-header[_ngcontent-%COMP%] [_ngcontent-%COMP%]:not(:last-child){margin-right:1.5rem}.ccf-header[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}.ccf-header[_ngcontent-%COMP%] .filter-labels[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;font:400 1rem/1.25rem Inter,sans-serif}"],changeDetection:0}),e}(),XZ=["bodyUI"];function YZ(e,t){if(1&e&&(Ps(0,"ccf-header",33),Kc(1,"async")),2&e){var n=Hs();Cs("hubmapPortalUrl",Qc(1,2,n.portalUrl$))("loggedIn",n.loggedIn)}}var KZ=function(){return{}},QZ=function(){return{x:2.2,y:2,z:.4}},$Z=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l){m(this,e),this.data=i,this.theming=r,this.scene=o,this.listResultsState=a,this.consentService=s,this.snackbar=u,this.globalConfig=l,this.ontologySelectionLabel="Body",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=dW.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(ue(function(e){return e===dX.Running})),this.portalUrl$=this.globalConfig.getOption("hubmapPortalUrl"),r.initialize(t,n),c.setRootElement(t),i.tissueBlockData$.subscribe(),i.aggregateData$.subscribe(),i.termOccurencesData$.subscribe(),i.sceneData$.subscribe(),i.filter$.subscribe(),i.technologyFilterData$.subscribe(),i.providerFilterData$.subscribe(),this.ontologyTerms$=i.filter$.pipe(mU("ontologyTerms"))}return b(e,[{key:"ngOnInit",value:function(){var e=this,t=this.snackbar.openFromComponent(sW,{data:{preClose:function(){t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia&&(window.matchMedia("(prefers-color-scheme: dark)").matches&&this.theming.setTheme(hW),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(t){e.theming.setTheme(t.matches?hW:lW)}))}},{key:"reset",value:function(e,t,n){e.open(),e.closeExpanded(),t.open(),t.closeExpanded(),n.removeBox(),this.resetView()}},{key:"resetView",value:function(){this.bodyUI.target=[0,0,0],this.bodyUI.rotation=0,this.bodyUI.rotationX=0,this.bodyUI.bounds={x:2.2,y:2,z:.4}}},{key:"toggleScheme",value:function(){this.theming.setTheme(this.theming.getTheme()===lW?hW:lW)}},{key:"ontologySelected",value:function(e){if(e)return this.data.updateFilter({ontologyTerms:e.map(function(e){return e.id})}),this.ontologySelectionLabel=this.createSelectionLabel(e),void(e[0]&&"body"===e[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[]}),this.ontologySelectionLabel=""}},{key:"createSelectionLabel",value:function(e){if(0===e.length)return"";if(1===e.length)return e[0].label;var t="";return e.forEach(function(n,i){t+=n.label,i0}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(os),Es(gX),Es(fW),Es(SX),Es(bX),Es(OG),Es(iw),Es(Qp),Es(tW))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-root"]],viewQuery:function(e,t){var n;(1&e&&hl(XZ,5),2&e)&&(ll(n=dl())&&(t.bodyUI=n.first))},decls:70,vars:77,consts:[[1,"ccf-app","mat-app-background"],["text","Loading CCF Exploration User Interface (EUI)",3,"active"],[3,"hubmapPortalUrl","loggedIn",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","filtersChange"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],[3,"termData","occurenceData","ontologySelection"],["position","end","opened","",1,"right-drawer",3,"stateChange"],["right",""],[1,"portal-view",3,"url","closed"],[1,"drawer-icons"],[1,"drawer-icons-left"],[1,"button",3,"matTooltip","click"],[1,"icon"],[1,"scheme-toggle","button",3,"matTooltip","click"],[1,"button"],["matTooltip","Reset View",1,"refresh","icon",3,"click"],["videoID","YAHJqvD3Q_8","infoTitle","HuBMAP CCF Exploration User Interface","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],[1,"close-button-wrapper"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"hubmapPortalUrl","loggedIn"]],template:function(e,t){if(1&e){var n=Ds();Ts(0,"div",0),Ps(1,"ccf-spinner-overlay",1),Kc(2,"async"),xs(3,YZ,2,4,"ccf-header",2),Kc(4,"async"),Ts(5,"ccf-drawer-container",3),Ts(6,"ccf-drawer",4,5),Fs("stateChange",function(){return mn(n),Ss(11).removeBox()}),Ts(8,"div"),Ts(9,"div",6),Ts(10,"ccf-filters-popover",7,8),Fs("filtersChange",function(e){return t.data.updateFilter(e)}),Kc(12,"async"),Kc(13,"async"),Kc(14,"async"),As(),Ts(15,"div",9),Ts(16,"div",10),ku(17,"Sex: "),Ts(18,"strong"),ku(19),Kc(20,"async"),As(),As(),Ts(21,"div",11),ku(22,"Age: "),Ts(23,"strong"),ku(24),Kc(25,"async"),Kc(26,"async"),As(),As(),Ts(27,"div",12),ku(28,"BMI: "),Ts(29,"strong"),ku(30),Kc(31,"async"),Kc(32,"async"),As(),As(),As(),As(),Ts(33,"ccf-ontology-selection",13),Fs("ontologySelection",function(e){return t.ontologySelected(e)}),Kc(34,"async"),Kc(35,"async"),As(),Ps(36,"ccf-drawer-toggle-button"),As(),As(),Ts(37,"ccf-drawer",14,15),Fs("stateChange",function(){return mn(n),Ss(11).removeBox()}),Ts(39,"ccf-viewer",16),Fs("closed",function(){return t.viewerOpen=!1}),As(),Ts(40,"div",17),Ts(41,"div",18),Ts(42,"button",19),Fs("click",function(){mn(n);var e=Ss(11),t=Ss(38);return e.removeBox(),t.toggleExpanded()}),Ts(43,"mat-icon",20),ku(44),As(),As(),Ts(45,"button",21),Fs("click",function(){return t.toggleScheme()}),Ts(46,"mat-icon",20),ku(47),As(),As(),Ts(48,"button",22),Ts(49,"mat-icon",23),Fs("click",function(){mn(n);var e=Ss(7),i=Ss(38),r=Ss(11);return t.reset(e,i,r)}),ku(50,"refresh "),As(),As(),As(),Ps(51,"ccf-info-button",24),As(),Ts(52,"ccf-results-browser",25),Fs("listResultSelected",function(e){return t.listResultsState.selectListResult(e)})("listResultDeselected",function(e){return t.listResultsState.deselectListResult(e)})("linkClicked",function(e){return t.openiFrameViewer(e)})("itemHovered",function(e){return t.listResultsState.highlightNode(e)})("itemUnhovered",function(){return t.listResultsState.unHighlightNode()}),Kc(53,"async"),Kc(54,"async"),Kc(55,"async"),As(),Ps(56,"ccf-drawer-toggle-button"),As(),Ts(57,"ccf-drawer-content"),Ts(58,"div",26),Ts(59,"ccf-organ-selector",27),Fs("organsChanged",function(e){return t.scene.setSelectedReferenceOrgans(e)}),Kc(60,"async"),Kc(61,"async"),Kc(62,"async"),As(),As(),Ts(63,"div",28),Ts(64,"div",29),Fs("click",function(){return t.organListVisible=!t.organListVisible}),Ts(65,"mat-icon",30),ku(66),As(),As(),As(),Ts(67,"ccf-body-ui",31,32),Fs("nodeClick",function(e){return t.scene.sceneNodeClicked(e)})("nodeHoverStart",function(e){return t.scene.sceneNodeHovered(e)})("nodeHoverStop",function(){return t.scene.sceneNodeUnhover()}),Kc(69,"async"),As(),As(),As(),As()}if(2&e){var i,r,o,a,s=Ss(38);qo(1),Cs("active",Qc(2,37,t.spinnerActive$)),qo(2),Cs("ngIf",!1===Qc(4,39,t.spinnerActive$)),qo(7),Cs("filters",Qc(12,41,t.data.filter$))("drawerExpanded",s.expanded)("technologyFilters",Qc(13,43,t.data.technologyFilterData$))("providerFilters",Qc(14,45,t.data.providerFilterData$)),qo(9),xu(null==(i=Qc(20,47,t.data.filter$))?null:i.sex),qo(5),Eu("",null==(r=Qc(25,49,t.data.filter$))?null:r.ageRange[0],"-",null==(r=Qc(26,51,t.data.filter$))?null:r.ageRange[1],""),qo(6),Eu("",null==(o=Qc(31,53,t.data.filter$))?null:o.bmiRange[0],"-",null==(o=Qc(32,55,t.data.filter$))?null:o.bmiRange[1],""),qo(3),Cs("termData",Qc(34,57,t.data.ontologyTermsFullData$))("occurenceData",Qc(35,59,t.data.termOccurencesData$)),qo(6),su("opened",t.viewerOpen),Cs("url",t.url),qo(3),Cs("matTooltip",s.expanded?"Exit Fullscreen":"Enter Fullscreen"),qo(2),xu(s.expanded?"fullscreen_exit":"fullscreen"),qo(1),Cs("matTooltip","light-theme"===t.theming.getTheme()?"Enter Dark Mode":"Enter Light Mode"),qo(2),Su("","light-theme"===t.theming.getTheme()?"brightness_2":"brightness_5"," "),qo(5),Cs("listResults",Qc(53,61,t.listResultsState.listResults$))("aggregateData",Qc(54,63,t.data.aggregateData$))("resultLabel",t.ontologySelectionLabel)("highlighted",Qc(55,65,t.listResultsState.highlightedNodeId$)),qo(6),su("closed",!t.organListVisible),qo(1),Cs("multiselect",!0)("occurenceData",null!==(a=Qc(60,67,t.data.termOccurencesData$))&&void 0!==a?a:Wc(75,KZ))("organList",Qc(61,69,t.scene.referenceOrgans$))("selectedOrgans",Qc(62,71,t.scene.selectedReferenceOrgans$)),qo(4),su("closed",!t.organListVisible),qo(3),Su(" ",t.organListVisible?"arrow_drop_up":"arrow_drop_down"," "),qo(1),su("expanded-stage",!t.organListVisible),Cs("scene",Qc(69,73,t.scene.scene$))("bounds",Wc(76,QZ))}},directives:[R$,Lh,W$,V$,oZ,wZ,kZ,EZ,hw,x_,JG,HZ,L$,HG,DG,qZ],pipes:[Yh],styles:[".cdk-overlay-container{position:absolute;font-size:1.2rem}[_nghost-%COMP%]{display:block;position:relative}.ccf-app[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;position:relative;text-align:left}.ccf-app[_ngcontent-%COMP%] ccf-header[_ngcontent-%COMP%]{z-index:99}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{flex-grow:1;height:100%;width:100%;opacity:1;overflow:visible;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{overflow:hidden;margin-bottom:1.5rem;border-radius:.5rem;height:100%;padding-bottom:4rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .organ-selector[_ngcontent-%COMP%]{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:28.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%]{display:flex;padding-left:1.5rem;height:5rem;padding-right:1.5rem;align-items:center;justify-content:space-between}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;padding:.65rem;transition:.6s}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5rem;transition:all .5s ease-in-out}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-4.25rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{transition:all .5s ease-in-out;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem;height:calc(100% - 6rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:100%;padding-bottom:3rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;border-top-right-radius:.5rem;border-top-left-radius:.5rem;height:0}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{display:flex;justify-content:center;height:1.0625rem;width:3rem;align-self:center;border-radius:0 0 .25rem .25rem;cursor:pointer;transition:.6s;position:relative;top:.5rem;z-index:1}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{position:relative;bottom:.2rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%]{padding-left:1.5rem;padding-right:1.5rem;height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%]{height:5rem;display:flex;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:75%;margin-left:1.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%]{font-weight:300}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600!important}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view[_ngcontent-%COMP%]{position:fixed;left:0;top:0;bottom:0;right:425%;height:100%;transform:translate(-425%);width:calc(100% - 28.5rem);transition:transform .5s cubic-bezier(.82,.085,.395,.895)}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view.opened[_ngcontent-%COMP%]{transform:translate(0);transition:width 0s .5s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view[_ngcontent-%COMP%]{width:100vw}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view.opened[_ngcontent-%COMP%]{transition:width 0s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .shaded-toggle[_ngcontent-%COMP%]{box-shadow:-1px 0 4px #212121}[_ngcontent-%COMP%]::-webkit-scrollbar{width:7.5rem}"],changeDetection:0}),e}();function ZZ(e,t){1&e&&Ps(0,"ccf-root")}function JZ(e){var t=function(e){return"string"==typeof e},n=function(e){return Array.isArray(e)&&e.every(t)};if("string"==typeof e){var i=I$.json(e);if(n(i))return i}else if(n(e))return e;throw new Error("Invalid data sources")}var eJ=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this,e,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},dW.dbOptions),globalThis.dbOptions),parse:{dataSources:JZ,useRemoteApi:I$.boolean}})}return n}(M$);return e.\u0275fac=function(t){return new(t||e)(Es(tW),Es(wc))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-root-wc"]],inputs:{dataSources:"dataSources",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[ss],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(e,t){1&e&&xs(0,ZZ,1,0,"ccf-root",0),2&e&&Cs("ngIf",t.initialized)},directives:[Lh,$Z],encapsulation:2,changeDetection:0}),e}(),tJ=function(){var e=function(){function e(t){m(this,e),this.injector=t}return b(e,[{key:"ngDoBootstrap",value:function(){var e=function(e,t){var n=function(e,t){return t.get(Wu).resolveComponentFactory(e).inputs}(e,t.injector),i=t.strategyFactory||new Jp(e,t.injector),r=function(e){var t={};return e.forEach(function(e){var n=e.propName,i=e.templateName;t[function(e){return e.replace(/[A-Z]/g,function(e){return"-".concat(e.toLowerCase())})}(i)]=n}),t}(n),o=function(e){a(u,e);var o=s(u);function u(e){var t;return m(this,u),(t=o.call(this)).injector=e,t}return b(u,[{key:"ngElementStrategy",get:function(){var e=this;if(!this._ngElementStrategy){var r=this._ngElementStrategy=i.create(this.injector||t.injector);n.forEach(function(t){var n=t.propName;if(e.hasOwnProperty(n)){var i=e[n];delete e[n],r.setInputValue(n,i)}})}return this._ngElementStrategy}},{key:"attributeChangedCallback",value:function(e,t,n,i){this.ngElementStrategy.setInputValue(r[e],n)}},{key:"connectedCallback",value:function(){var e=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),e=!0),this.ngElementStrategy.connect(this),e||this.subscribeToEvents()}},{key:"disconnectedCallback",value:function(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}},{key:"subscribeToEvents",value:function(){var e=this;this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(function(t){var n=function(e,t,n){if("function"!=typeof CustomEvent){var i=e.createEvent("CustomEvent");return i.initCustomEvent(t,!1,!1,n),i}return new CustomEvent(t,{bubbles:!1,cancelable:!1,detail:n})}(e.ownerDocument,t.name,t.value);e.dispatchEvent(n)})}}]),u}(tv);return o.observedAttributes=Object.keys(r),n.forEach(function(e){var t=e.propName;Object.defineProperty(o.prototype,t,{get:function(){return this.ngElementStrategy.getInputValue(t)},set:function(e){this.ngElementStrategy.setInputValue(t,e)},configurable:!0,enumerable:!0})}),o}(eJ,{injector:this.injector});customElements.define("ccf-eui",e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(os))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[{provide:cW,useValue:"light-theme"},{provide:Ap,useExisting:Qp}],imports:[[By,Mf,OX,g$,nK,TK,S_,eK,h$,O$,NG,GG,eW,pw,T$,uW,tw]]}),e}();dW.production&&function(){if(Zl)throw new Error("Cannot enable prod mode after platform setup.");$l=!1}(),Af().bootstrapModule(tJ).catch(function(e){return console.error(e)})},91052:function(e){function t(e,t,n,i,r,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var n=this,i=arguments;return new Promise(function(r,o){var a=e.apply(n,i);function s(e){t(a,r,o,s,u,"next",e)}function u(e){t(a,r,o,s,u,"throw",e)}s(void 0)})}},e.exports.default=e.exports,e.exports.__esModule=!0},61948:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},34321:function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},91741:function(e){function t(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}t.keys=function(){return[]},t.resolve=t,t.id=91741,e.exports=t},9521:function(){},49125:function(){},75307:function(){}},function(e){e(e.s=35090)}])}(); \ No newline at end of file +!function(){function e(t,n,i){return(e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(t,n,i||t)}function t(e,t){return r(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);a=!0);}catch(u){s=!0,r=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return o}(e,t)||w(e,t)||i()}function n(e){return r(e)||g(e)||w(e)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(e){if(Array.isArray(e))return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function s(e){var t=f();return function(){var n,i=p(e);if(t){var r=p(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return u(this,n)}}function u(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return h(e,arguments,p(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),d(i,e)})(e)}function h(e,t,n){return(h=f()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&d(r,n.prototype),r}).apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e){return function(e){if(Array.isArray(e))return k(e)}(e)||g(e)||w(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function w(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&r[r.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,o=[],a=16383,s=0,u=n-r;su?u:s+a));return 1===r?o.push(i[(t=e[n-1])>>2]+i[t<<4&63]+"=="):2===r&&o.push(i[(t=(e[n-2]<<8)+e[n-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),o.join("")};for(var i=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e){return i[e>>18&63]+i[e>>12&63]+i[e>>6&63]+i[63&e]}function h(e,t,n){for(var i=[],r=t;r>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(r>0&&(e.lastNeed=r-1),r):--i=0?(r>0&&(e.lastNeed=r-2),r):--i=0?(r>0&&(2===r?r=0:e.lastNeed=r-3),r):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":4}],6:[function(e,t,n){(function(t){(function(){"use strict";var t=e("base64-js"),i=e("ieee754");n.Buffer=a,n.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function o(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|f(e,t),i=o(n),r=i.write(e,t);return r!==n&&(i=i.slice(0,r)),i}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return i?-1:L(e).length;t=(""+t).toLowerCase(),r=!0}}function d(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return E(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function p(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function v(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=a.from(t,i)),a.isBuffer(t))return 0===t.length?-1:g(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,i,r){var o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var h=!0,f=0;fr&&(i=r):i=r;var o=t.length;i>o/2&&(i=o/2);for(var a=0;a>8,r.push(n%256),r.push(i);return r}(t,e.length-n),e,n,i)}function x(e,n,i){return t.fromByteArray(0===n&&i===e.length?e:e.slice(n,i))}function S(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r239?4:c>223?3:c>191?2:1;if(r+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[r+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:a=e[r+2],128==(192&(o=e[r+1]))&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[r+2],s=e[r+3],128==(192&(o=e[r+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(i.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),i.push(l),r+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",i=0;ii)&&(n=i);for(var r="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,i,r,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function M(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}n.kMaxLength=r,!(a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}())&&"undefined"!=typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(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}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(e,t,n){return s(e,t,n)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,r=0,o=Math.min(n,i);rt&&(e+=" ... "),""},a.prototype.compare=function(e,t,n,i,r){if(B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(r>>>=0)-(i>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(o,s),c=this.slice(i,r),l=e.slice(t,n),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return m(this,e,t,n);case"utf8":case"utf-8":return y(this,e,t,n);case"ascii":return b(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||A(e,t,this.length);for(var i=this[e],r=1,o=0;++o>>=0,t>>>=0,n||A(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},a.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);for(var i=this[e],r=1,o=0;++o=(r*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||P(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,i||P(this,e,t,n,Math.pow(2,8*n)-1,0);var r=n-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,i){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&0!==i&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),t);return r},a.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var r=e.charCodeAt(0);("utf8"===i&&r<128||"latin1"===i)&&(e=r)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,i){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(e,t,n){"use strict";t.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(function(t,n,i){return t+(0===i?"":",")+e(void 0===n||"symbol"==typeof n?null:n)},"")+"]":"{"+Object.keys(t).sort().reduce(function(n,i,r){return void 0===t[i]||"symbol"==typeof t[i]?n:n+(0===n.length?"":",")+e(i)+":"+e(t[i])},"")+"}"}},{}],8:[function(e,t,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise(function(n,i){function r(n){e.removeListener(t,o),i(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,r)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function h(e,t,n,i){var r,o,a;if(c(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=i?[n,a]:[a,n]:i?a.unshift(n):a.push(n),(r=l(e))>0&&a.length>r&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=f.bind(i);return r.listener=n,i.wrapFn=r,r}function p(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=r[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,l=g(u,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},s.prototype.listenerCount=v,s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},{}],9:[function(e,t,n){n.read=function(e,t,n,i,r){var o,a,s=8*r-i-1,u=(1<>1,l=-7,h=n?r-1:0,f=n?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=i;l>0;a=256*a+e[t+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),o-=c}return(d?-1:1)*a*Math.pow(2,o-i)},n.write=function(e,t,n,i,r,o){var a,s,u,c=8*o-r-1,l=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*u-1)*Math.pow(2,r),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[n+d]=255&s,d+=p,s/=256,r-=8);for(a=a<0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*v}},{}],10:[function(e,t,n){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t,n){"use strict";var i=e("./types"),r=i.isArray,o=i.isObject,a=i.isString,s=e("./util").asArray,u=e("./url").prependBase,c=e("./JsonLdError"),l=e("./ResolvedContext");function f(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function d(e){var t=e.context,n=e.base;if(t){var i=t["@context"];if(a(i))t["@context"]=u(n,i);else if(r(i))for(var s=0;s10)){e.next=2;break}throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});case 2:if(!s.has(n)){e.next=4;break}throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:n});case 4:return s.add(n),e.prev=5,e.next=8,i(n);case 8:l=e.sent,u=l.document||null,a(u)&&(u=JSON.parse(u)),e.next=16;break;case 13:throw e.prev=13,e.t0=e.catch(5),new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:n,cause:e.t0});case 16:if(o(u)){e.next=18;break}throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:n});case 18:return e.abrupt("return",(u="@context"in u?{"@context":u["@context"]}:{"@context":{}},l.contextUrl&&(r(u["@context"])||(u["@context"]=[u["@context"]]),u["@context"].push(l.contextUrl)),{context:u,remoteDoc:l}));case 19:case"end":return e.stop()}},e,null,[[5,13]])}))()}}]),e}()},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(e,t,n){"use strict";t.exports=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"An unspecified JSON-LD error occurred.",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"jsonld.Error",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m(this,n),(e=t.call(this,i)).name=r,e.message=i,e.details=o,e}return n}(l(Error))},{}],13:[function(e,t,n){"use strict";t.exports=function(e){var t=function(){function e(){m(this,e)}return b(e,[{key:"toString",value:function(){return"[object JsonLdProcessor]"}}]),e}();return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],14:[function(e,t,n){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(e,t,n){"use strict";t.exports=function(){function e(){m(this,e),this._requests={}}return b(e,[{key:"wrapLoader",value:function(e){var t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}},{key:"add",value:function(e){var t=this;return h(regeneratorRuntime.mark(function n(){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=t._requests[e])){n.next=3;break}return n.abrupt("return",Promise.resolve(i));case 3:return i=t._requests[e]=t._loader(e),n.prev=4,n.next=7,i;case 7:return n.abrupt("return",n.sent);case 8:return n.prev=8,delete t._requests[e],n.finish(8);case 11:case"end":return n.stop()}},n,null,[[4,,8,11]])}))()}}]),e}()},{}],16:[function(e,t,n){"use strict";var i=e("lru-cache");t.exports=function(){function e(t){var n=t.document;m(this,e),this.document=n,this.cache=new i({max:10})}return b(e,[{key:"getProcessed",value:function(e){return this.cache.get(e)}},{key:"setProcessed",value:function(e,t){this.cache.set(e,t)}}]),e}()},{"lru-cache":33}],17:[function(e,i,r){"use strict";var a,s=e("./JsonLdError"),u=e("./types"),c=u.isArray,l=u.isObject,f=u.isString,d=u.isUndefined,p=e("./graphTypes"),v=p.isList,g=p.isValue,m=p.isGraph,y=p.isSimpleGraph,b=p.isSubjectReference,w=e("./context"),k=w.expandIri,x=w.getContextValue,S=w.isKeyword,E=w.process,C=w.processingMode,O=e("./url"),T=O.removeBase,A=O.prependBase,P=e("./util"),M=P.addValue,I=P.asArray,R=P.compareShortestLeast,D={};function N(e,t,n){if("@nest"!==k(e,t,{vocab:!0},n))throw new s("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}i.exports=D,D.compact=(a=h(regeneratorRuntime.mark(function e(t){var i,r,a,u,h,p,w,k,O,T,A,P,R;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.activeCtx,r=t.activeProperty,a=void 0===r?null:r,u=t.element,h=t.options,p=void 0===h?{}:h,w=t.compactionMap,k=void 0===w?function(){}:w,!c(u)){e.next=21;break}O=[],T=0;case 4:if(!(T1&&(L=Array.from(L).sort()),j=i,F=_(L),e.prev=27,F.s();case 29:if((B=F.n()).done){e.next=39;break}if(V=B.value,z=D.compactIri({activeCtx:j,iri:V,relativeTo:{vocab:!0}}),U=x(P,z,"@context"),e.t1=d(U),e.t1){e.next=37;break}return e.next=36,E({activeCtx:i,localCtx:U,options:p,propagate:!1});case 36:i=e.sent;case 37:e.next=29;break;case 39:e.next=44;break;case 41:e.prev=41,e.t2=e.catch(27),F.e(e.t2);case 44:return e.prev=44,F.f(),e.finish(44);case 47:H=Object.keys(u).sort(),G=_(H),e.prev=49,G.s();case 51:if((W=G.n()).done){e.next=184;break}if(q=W.value,X=u[q],"@id"===q){e.next=180;break}if("@type"===q){e.next=174;break}if("@reverse"===q){e.next=167;break}if("@preserve"===q){e.next=161;break}if("@index"===q){e.next=155;break}if("@graph"===q||"@list"===q||"@included"===q||!S(q)){e.next=64;break}Y=D.compactIri({activeCtx:i,iri:q,relativeTo:{vocab:!0}}),M(A,Y,X),e.next=153;break;case 64:if(c(X)){e.next=66;break}throw new s("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");case 66:0===X.length&&(K=D.compactIri({activeCtx:i,iri:q,value:X,relativeTo:{vocab:!0},reverse:T}),Q=i.mappings.has(K)?i.mappings.get(K)["@nest"]:null,$=A,Q&&(N(i,Q,p),l(A[Q])||(A[Q]={}),$=A[Q]),M($,K,X,{propertyIsArray:!0})),Z=_(X),e.prev=68,Z.s();case 70:if((J=Z.n()).done){e.next=145;break}return ee=J.value,te=D.compactIri({activeCtx:i,iri:q,value:ee,relativeTo:{vocab:!0},reverse:T}),ne=i.mappings.has(te)?i.mappings.get(te)["@nest"]:null,ie=A,ne&&(N(i,ne,p),l(A[ne])||(A[ne]={}),ie=A[ne]),re=x(i,te,"@container")||[],oe=m(ee),ae=v(ee),se=void 0,ae?se=ee["@list"]:oe&&(se=ee["@graph"]),e.next=80,D.compact({activeCtx:i,activeProperty:te,element:ae||oe?se:ee,options:p,compactionMap:k});case 80:if(ue=e.sent,!ae){e.next=86;break}if(c(ue)||(ue=[ue]),!re.includes("@list")){e.next=85;break}return M(ie,te,ue,{valueIsArray:!0,allowDuplicate:!0}),e.abrupt("continue",143);case 85:ue=o({},D.compactIri({activeCtx:i,iri:"@list",relativeTo:{vocab:!0}}),ue),"@index"in ee&&(ue[D.compactIri({activeCtx:i,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]);case 86:if(!oe){e.next=90;break}re.includes("@graph")&&(re.includes("@id")||re.includes("@index")&&y(ee))?(ce=void 0,ie.hasOwnProperty(te)?ce=ie[te]:ie[te]=ce={},le=(re.includes("@id")?ee["@id"]:ee["@index"])||D.compactIri({activeCtx:i,iri:"@none",relativeTo:{vocab:!0}}),M(ce,le,ue,{propertyIsArray:!p.compactArrays||re.includes("@set")})):re.includes("@graph")&&y(ee)?(c(ue)&&ue.length>1&&(ue={"@included":ue}),M(ie,te,ue,{propertyIsArray:!p.compactArrays||re.includes("@set")})):(c(ue)&&1===ue.length&&p.compactArrays&&(ue=ue[0]),ue=o({},D.compactIri({activeCtx:i,iri:"@graph",relativeTo:{vocab:!0}}),ue),"@id"in ee&&(ue[D.compactIri({activeCtx:i,iri:"@id",relativeTo:{vocab:!0}})]=ee["@id"]),"@index"in ee&&(ue[D.compactIri({activeCtx:i,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]),M(ie,te,ue,{propertyIsArray:!p.compactArrays||re.includes("@set")})),e.next=143;break;case 90:if(!(re.includes("@language")||re.includes("@index")||re.includes("@id")||re.includes("@type"))){e.next=141;break}if(he=void 0,fe=void 0,ie.hasOwnProperty(te)?he=ie[te]:ie[te]=he={},!re.includes("@language")){e.next=96;break}g(ue)&&(ue=ue["@value"]),fe=ee["@language"],e.next=138;break;case 96:if(!re.includes("@index")){e.next=117;break}if(de=x(i,te,"@index")||"@index",pe=D.compactIri({activeCtx:i,iri:de,relativeTo:{vocab:!0}}),"@index"!==de){e.next=102;break}fe=ee["@index"],delete ue[pe],e.next=115;break;case 102:if(me=void 0,ve=I(ue[de]||[]),ge=n(ve),fe=ge[0],me=ge.slice(1),!f(fe)){e.next=114;break}e.t3=me.length,e.next=0===e.t3?107:1===e.t3?109:111;break;case 107:return delete ue[de],e.abrupt("break",112);case 109:return ue[de]=me[0],e.abrupt("break",112);case 111:ue[de]=me;case 112:e.next=115;break;case 114:fe=null;case 115:e.next=138;break;case 117:if(!re.includes("@id")){e.next=122;break}ye=D.compactIri({activeCtx:i,iri:"@id",relativeTo:{vocab:!0}}),fe=ue[ye],delete ue[ye],e.next=138;break;case 122:if(!re.includes("@type")){e.next=138;break}be=D.compactIri({activeCtx:i,iri:"@type",relativeTo:{vocab:!0}}),_e=void 0,e.t4=(t=I(ue[be]||[]),r=n(t),fe=r[0],(_e=r.slice(1)).length),e.next=0===e.t4?128:1===e.t4?130:132;break;case 128:return delete ue[be],e.abrupt("break",133);case 130:return ue[be]=_e[0],e.abrupt("break",133);case 132:ue[be]=_e;case 133:if(e.t5=1===Object.keys(ue).length&&"@id"in ee,!e.t5){e.next=138;break}return e.next=137,D.compact({activeCtx:i,activeProperty:te,element:{"@id":ee["@id"]},options:p,compactionMap:k});case 137:ue=e.sent;case 138:fe||(fe=D.compactIri({activeCtx:i,iri:"@none",relativeTo:{vocab:!0}})),M(he,fe,ue,{propertyIsArray:re.includes("@set")}),e.next=143;break;case 141:we=!p.compactArrays||re.includes("@set")||re.includes("@list")||c(ue)&&0===ue.length||"@list"===q||"@graph"===q,M(ie,te,ue,{propertyIsArray:we});case 143:e.next=70;break;case 145:e.next=150;break;case 147:e.prev=147,e.t6=e.catch(68),Z.e(e.t6);case 150:return e.prev=150,Z.f(),e.finish(150);case 153:e.next=159;break;case 155:if(!(x(i,a,"@container")||[]).includes("@index")){e.next=157;break}return e.abrupt("continue",182);case 157:ke=D.compactIri({activeCtx:i,iri:q,relativeTo:{vocab:!0}}),M(A,ke,X);case 159:e.next=165;break;case 161:return e.next=163,D.compact({activeCtx:i,activeProperty:a,element:X,options:p,compactionMap:k});case 163:xe=e.sent,c(xe)&&0===xe.length||M(A,q,xe);case 165:e.next=172;break;case 167:return e.next=169,D.compact({activeCtx:i,activeProperty:"@reverse",element:X,options:p,compactionMap:k});case 169:for(Ee in Se=e.sent)i.mappings.has(Ee)&&i.mappings.get(Ee).reverse&&(Ce=Se[Ee],Oe=(x(i,Ee,"@container")||[]).includes("@set")||!p.compactArrays,M(A,Ee,Ce,{propertyIsArray:Oe}),delete Se[Ee]);Object.keys(Se).length>0&&(Te=D.compactIri({activeCtx:i,iri:q,relativeTo:{vocab:!0}}),M(A,Te,Se));case 172:e.next=178;break;case 174:1===(Ae=I(X).map(function(e){return D.compactIri({activeCtx:P,iri:e,relativeTo:{vocab:!0}})})).length&&(Ae=Ae[0]),Pe=D.compactIri({activeCtx:i,iri:"@type",relativeTo:{vocab:!0}}),Me=(x(i,Pe,"@container")||[]).includes("@set")&&C(i,1.1)||c(Ae)&&0===X.length,M(A,Pe,Ae,{propertyIsArray:Me});case 178:e.next=182;break;case 180:1===(Ie=I(X).map(function(e){return D.compactIri({activeCtx:i,iri:e,relativeTo:{vocab:!1},base:p.base})})).length&&(Ie=Ie[0]),A[D.compactIri({activeCtx:i,iri:"@id",relativeTo:{vocab:!0}})]=Ie;case 182:e.next=51;break;case 184:e.next=189;break;case 186:e.prev=186,e.t7=e.catch(49),G.e(e.t7);case 189:return e.prev=189,G.f(),e.finish(189);case 192:return e.abrupt("return",{v:A});case 193:case"end":return e.stop()}},e,null,[[27,41,44,47],[49,186,189,192],[68,147,150,153]])})(),"t3",29);case 29:if("object"!=typeof(R=e.t3)){e.next=32;break}return e.abrupt("return",R.v);case 32:return e.abrupt("return",u);case 33:case"end":return e.stop()}},e)})),function(e){return a.apply(this,arguments)}),D.compactIri=function(e){var n=e.activeCtx,i=e.iri,r=e.value,o=void 0===r?null:r,a=e.relativeTo,u=void 0===a?{vocab:!1}:a,c=e.reverse,h=void 0!==c&&c,f=e.base,d=void 0===f?null:f;if(null===i)return i;n.isPropertyTermScoped&&n.previousContext&&(n=n.previousContext);var p=n.getInverse();if(S(i)&&i in p&&"@none"in p[i]&&"@type"in p[i]["@none"]&&"@none"in p[i]["@none"]["@type"])return p[i]["@none"]["@type"]["@none"];if(u.vocab&&i in p){var y=n["@language"]||"@none",b=[];l(o)&&"@index"in o&&!("@graph"in o)&&b.push("@index","@index@set"),l(o)&&"@preserve"in o&&(o=o["@preserve"][0]),m(o)?("@index"in o&&b.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in o&&b.push("@graph@id","@graph@id@set"),b.push("@graph","@graph@set","@set"),"@index"in o||b.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in o||b.push("@graph@id","@graph@id@set")):l(o)&&!g(o)&&b.push("@id","@id@set","@type","@set@type");var w="@language",k="@null";if(h)w="@type",k="@reverse",b.push("@set");else if(v(o)){"@index"in o||b.push("@list");var x=o["@list"];if(0===x.length)w="@any",k="@none";else{for(var E=0===x.length?y:null,C=null,O=0;O=0;--G){var W,q=V[G],X=_(q.terms);try{for(X.s();!(W=X.n()).done;){var Y=W.value,K=Y+":"+i.substr(q.iri.length);n.mappings.get(Y)._prefix&&(!n.mappings.has(K)||null===o&&n.mappings.get(K)["@id"]===i)&&(null===B||R(K,B)<0)&&(B=K)}}catch(te){X.e(te)}finally{X.f()}}if(null!==B)return B;var Q,$=_(n.mappings);try{for($.s();!(Q=$.n()).done;){var Z=t(Q.value,2),J=Z[0],ee=Z[1];if(ee&&ee._prefix&&i.startsWith(J+":"))throw new s('Absolute IRI "'.concat(i,'" confused with prefix "').concat(J,'".'),"jsonld.SyntaxError",{code:"IRI confused with prefix",context:n})}}catch(te){$.e(te)}finally{$.f()}return u.vocab?i:"@base"in n?n["@base"]?T(A(d,n["@base"]),i):i:T(d,i)},D.compactValue=function(e){var t=e.activeCtx,n=e.activeProperty,i=e.value,r=e.options;if(g(i)){var a=x(t,n,"@type"),s=x(t,n,"@language"),u=x(t,n,"@direction"),c=x(t,n,"@container")||[],l="@index"in i&&!c.includes("@index");if(!l&&"@none"!==a&&(i["@type"]===a||"@language"in i&&i["@language"]===s&&"@direction"in i&&i["@direction"]===u||"@language"in i&&i["@language"]===s||"@direction"in i&&i["@direction"]===u))return i["@value"];var h=Object.keys(i).length,d=1===h||2===h&&"@index"in i&&!l,p="@language"in t,v=f(i["@value"]),m=t.mappings.has(n)&&null===t.mappings.get(n)["@language"];if(d&&"@none"!==a&&(!p||!v||m))return i["@value"];var y={};return l&&(y[D.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=i["@index"]),"@type"in i?y[D.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=D.compactIri({activeCtx:t,iri:i["@type"],relativeTo:{vocab:!0}}):"@language"in i&&(y[D.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=i["@language"]),"@direction"in i&&(y[D.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=i["@direction"]),y[D.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=i["@value"],y}var b=k(t,n,{vocab:!0},r),_=x(t,n,"@type"),w=D.compactIri({activeCtx:t,iri:i["@id"],relativeTo:{vocab:"@vocab"===_},base:r.base});return"@id"===_||"@vocab"===_||"@graph"===b?w:o({},D.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}}),w)}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(e,t,n){"use strict";var i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";t.exports={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:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},{}],19:[function(e,n,i){"use strict";var r,o=e("./util"),a=e("./JsonLdError"),s=e("./types"),u=s.isArray,c=s.isObject,l=s.isString,f=s.isUndefined,d=e("./url"),p=d.isAbsolute,g=d.isRelative,m=d.prependBase,y=e("./util"),b=y.asArray,w=y.compareShortestLeast,k=new Map,x=/^@[a-zA-Z]+$/,S={};function E(e,t,n,i,r,o){if(null===t||!l(t)||S.isKeyword(t))return t;if(t.match(x))return null;if(i&&i.hasOwnProperty(t)&&!0!==r.get(t)&&S.createTermDefinition({activeCtx:e,localCtx:i,term:t,defined:r,options:o}),(n=n||{}).vocab){var a=e.mappings.get(t);if(null===a)return null;if(c(a)&&"@id"in a)return a["@id"]}var s=t.indexOf(":");if(s>0){var u=t.substr(0,s),h=t.substr(s+1);if("_"===u||0===h.indexOf("//"))return t;i&&i.hasOwnProperty(u)&&S.createTermDefinition({activeCtx:e,localCtx:i,term:u,defined:r,options:o});var f=e.mappings.get(u);if(f&&f._prefix)return f["@id"]+h;if(p(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return m(m(o.base,e["@base"]),t)}else if(n.base)return m(o.base,t);return t}function C(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;var n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(var i=0;i0,"@reverse"in t){if("@id"in t)throw new a("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:i});if("@nest"in t)throw new a("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:i});var k=t["@reverse"];if(!l(k))throw new a("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:i});if(!S.isKeyword(k)&&k.match(x))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:k}),void(g?n.mappings.set(r,g):n.mappings.delete(r));var O=E(n,k,{vocab:!0,base:!1},i,o,s);if(!p(O))throw new a("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:i});y["@id"]=O,y.reverse=!0}else if("@id"in t){var T=t["@id"];if(T&&!l(T))throw new a("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:i});if(null===T)y["@id"]=null;else{if(!S.isKeyword(T)&&T.match(x))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:T}),void(g?n.mappings.set(r,g):n.mappings.delete(r));if(T!==r){if(T=E(n,T,{vocab:!0,base:!1},i,o,s),!p(T)&&!S.isKeyword(T))throw new a("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:i});if(r.match(/(?::[^:])|\//)&&E(n,r,{vocab:!0,base:!1},i,new Map(o).set(r,!0),s)!==T)throw new a("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:i});y["@id"]=T,y._prefix=m&&!y._termHasColon&&T.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){var A=r.substr(0,w);if(i.hasOwnProperty(A)&&S.createTermDefinition({activeCtx:n,localCtx:i,term:A,defined:o,options:s}),n.mappings.has(A)){var P=r.substr(w+1);y["@id"]=n.mappings.get(A)["@id"]+P}else y["@id"]=r}else if("@type"===r)y["@id"]=r;else{if(!("@vocab"in n))throw new a("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:i,term:r});y["@id"]=n["@vocab"]+r}if((!0===t["@protected"]||!0===o.get("@protected")&&!1!==t["@protected"])&&(n.protected[r]=!0,y.protected=!0),o.set(r,!0),"@type"in t){var M=t["@type"];if(!l(M))throw new a("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:i});if("@json"===M||"@none"===M){if(S.processingMode(n,1))throw new a('Invalid JSON-LD syntax; an @context @type value must not be "'.concat(M,'" in JSON-LD 1.0 mode.'),"jsonld.SyntaxError",{code:"invalid type mapping",context:i})}else if("@id"!==M&&"@vocab"!==M){if(M=E(n,M,{vocab:!0,base:!1},i,o,s),!p(M))throw new a("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:i});if(0===M.indexOf("_:"))throw new a("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:i})}y["@type"]=M}if("@container"in t){var I=l(t["@container"])?[t["@container"]]:t["@container"]||[],R=["@list","@set","@index","@language"],D=!0,N=I.includes("@set");if(S.processingMode(n,1.1)){if(R.push("@graph","@id","@type"),I.includes("@list")){if(1!==I.length)throw new a("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:i})}else if(I.includes("@graph")){if(I.some(function(e){return"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e}))throw new a("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:i})}else D&=I.length<=(N?2:1);if(I.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new a("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:i})}else D&=!u(t["@container"]),D&=I.length<=1;if(D&=I.every(function(e){return R.includes(e)}),!(D&=!(N&&I.includes("@list"))))throw new a("Invalid JSON-LD syntax; @context @container value must be one of the following: "+R.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:i});if(y.reverse&&!I.every(function(e){return["@index","@set"].includes(e)}))throw new a("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:i});y["@container"]=I}if("@index"in t){if(!("@container"in t)||!y["@container"].includes("@index"))throw new a('Invalid JSON-LD syntax; @index without @index in @container: "'.concat(t["@index"],'" on term "').concat(r,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:i});if(!l(t["@index"])||0===t["@index"].indexOf("@"))throw new a('Invalid JSON-LD syntax; @index must expand to an IRI: "'.concat(t["@index"],'" on term "').concat(r,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:i});y["@index"]=t["@index"]}if("@context"in t&&(y["@context"]=t["@context"]),"@language"in t&&!("@type"in t)){var L=t["@language"];if(null!==L&&!l(L))throw new a("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:i});null!==L&&(L=L.toLowerCase()),y["@language"]=L}if("@prefix"in t){if(r.match(/:|\//))throw new a("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:i});if(S.isKeyword(y["@id"]))throw new a("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:i});if("boolean"!=typeof t["@prefix"])throw new a("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:i});y._prefix=!0===t["@prefix"]}if("@direction"in t){var j=t["@direction"];if(null!==j&&"ltr"!==j&&"rtl"!==j)throw new a('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:i});y["@direction"]=j}if("@nest"in t){var F=t["@nest"];if(!l(F)||"@nest"!==F&&0===F.indexOf("@"))throw new a("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:i});y["@nest"]=F}var B=y["@id"];if("@context"===B||"@preserve"===B)throw new a("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:i});if(g&&g.protected&&!f&&(n.protected[r]=!0,y.protected=!0,!C(g,y))){var V=s&&s.protectedMode||"error";if("error"===V)throw new a('Invalid JSON-LD syntax; tried to redefine "'.concat(r,'" which is a protected term.'),"jsonld.SyntaxError",{code:"protected term redefinition",context:i,term:r});if("warn"===V)return void console.warn("WARNING: protected term redefinition",{term:r});throw new a("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:i,term:r,protectedMode:V})}},S.expandIri=function(e,t,n,i){return E(e,t,n,void 0,void 0,i)},S.getInitialContext=function(e){var t=JSON.stringify({processingMode:e.processingMode}),n=k.get(t);if(n)return n;var i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){var e=this;if(e.inverse)return e.inverse;var t,n=e.inverse={},i=e.fastCurieMap={},o={},s=(e["@language"]||"@none").toLowerCase(),u=e["@direction"],c=e.mappings,l=_(v(c.keys()).sort(w));try{for(l.s();!(t=l.n()).done;){var h=t.value,f=c.get(h);if(null!==f){var d=f["@container"]||"@none";if(d=[].concat(d).sort().join(""),null!==f["@id"]){var p,g=_(b(f["@id"]));try{for(g.s();!(p=g.n()).done;){var m=p.value,y=n[m],k=S.isKeyword(m);if(y)!k&&!f._termHasColon&&o[m].push(h);else if(n[m]=y={},!k&&!f._termHasColon){o[m]=[h];var x={iri:m,terms:o[m]};m[0]in i?i[m[0]].push(x):i[m[0]]=[x]}if(y[d]||(y[d]={"@language":{},"@type":{},"@any":{}}),a(h,(y=y[d])["@any"],"@none"),f.reverse)a(h,y["@type"],"@reverse");else if("@none"===f["@type"])a(h,y["@any"],"@none"),a(h,y["@language"],"@none"),a(h,y["@type"],"@none");else if("@type"in f)a(h,y["@type"],f["@type"]);else if("@language"in f&&"@direction"in f){var E=f["@language"],C=f["@direction"];a(h,y["@language"],E&&C?"".concat(E,"_").concat(C).toLowerCase():E?E.toLowerCase():C?"_".concat(C):"@null")}else"@language"in f?a(h,y["@language"],(f["@language"]||"@null").toLowerCase()):"@direction"in f?a(h,y["@language"],f["@direction"]?"_".concat(f["@direction"]):"@none"):u?(a(h,y["@language"],"_".concat(u)),a(h,y["@language"],"@none"),a(h,y["@type"],"@none")):(a(h,y["@language"],s),a(h,y["@language"],"@none"),a(h,y["@type"],"@none"))}}catch(T){g.e(T)}finally{g.f()}}}}}catch(T){l.e(T)}finally{l.f()}for(var O in i)r(i,O,1);return n},clone:function(){var e={};return e.mappings=o.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=o.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===k.size&&k.clear(),k.set(t,i),i;function r(e,t,n){var i,o,a,s=e[t],u=e[t]={},c=_(s);try{for(c.s();!(a=c.n()).done;){var l=a.value;(o=n>=(i=l.iri).length?"":i[n])in u?u[o].push(l):u[o]=[l]}}catch(f){c.e(f)}finally{c.f()}for(var h in u)""!==h&&r(u,h,n+1)}function a(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},S.getContextValue=function(e,t,n){if(null===t)return"@context"===n?void 0:null;if(e.mappings.has(t)){var i=e.mappings.get(t);if(f(n))return i;if(i.hasOwnProperty(n))return i[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},S.processingMode=function(e,t){return t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode},S.isKeyword=function(e){if(!l(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(e,t,n){"use strict";var i=e("../util"),r=i.parseLinkHeader,o=i.buildHeaders,a=e("../constants").LINK_HEADER_CONTEXT,s=e("../JsonLdError"),u=e("../RequestQueue"),c=e("../url").prependBase,l=/(^|(\r\n))link:/i;function f(e,t,n){var i=new(e=e||XMLHttpRequest);return new Promise(function(e,r){for(var o in i.onload=function(){return e(i)},i.onerror=function(e){return r(e)},i.open("GET",t,!0),n)i.setRequestHeader(o,n[o]);i.send()})}t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{headers:{}},t=e.secure,n=e.headers,i=void 0===n?{}:n,d=e.xhr;return i=o(i),(new u).wrapLoader(p);function p(e){return v.apply(this,arguments)}function v(){return(v=h(regeneratorRuntime.mark(function e(n){var o,u,h,v,g,m,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===n.indexOf("http:")||0===n.indexOf("https:")){e.next=2;break}throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n});case 2:if(!t||0===n.indexOf("https")){e.next=4;break}throw new s('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n});case 4:return e.prev=4,e.next=7,f(d,n,i);case 7:o=e.sent,e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n,cause:e.t0});case 13:if(!(o.status>=400)){e.next=15;break}throw new s("URL could not be dereferenced: "+o.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:n,httpStatusCode:o.status});case 15:if(u={contextUrl:null,documentUrl:n,document:o.response},h=null,v=o.getResponseHeader("Content-Type"),l.test(o.getAllResponseHeaders())&&(g=o.getResponseHeader("Link")),!g||"application/ld+json"===v){e.next=28;break}if(m=r(g),y=m[a],!Array.isArray(y)){e.next=21;break}throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n});case 21:if(y&&(u.contextUrl=y.target),h=m.alternate,e.t1=h&&"application/ld+json"==h.type&&!(v||"").match(/^application\/(\w*\+)?json$/),!e.t1){e.next=28;break}return e.next=27,p(c(n,h.target));case 27:u=e.sent;case 28:return e.abrupt("return",u);case 29:case"end":return e.stop()}},e,null,[[4,10]])}))).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(e,n,i){"use strict";var r=e("./JsonLdError"),o=e("./types"),a=o.isArray,s=o.isObject,u=o.isEmptyObject,c=o.isString,l=o.isUndefined,f=e("./graphTypes"),d=f.isList,p=f.isValue,v=f.isGraph,g=f.isSubject,m=e("./context"),y=m.expandIri,b=m.getContextValue,w=m.isKeyword,k=m.process,x=m.processingMode,S=e("./url").isAbsolute,E=e("./util"),C=E.addValue,O=E.asArray,T=E.getValues,A=E.validateTypeValue,P={};n.exports=P;var M,I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function R(e){return D.apply(this,arguments)}function D(){return(D=h(regeneratorRuntime.mark(function e(n){var i,o,h,f,v,m,E,T,M,D,N,F,B,V,z,U,H,G,W,q,X,Y,K,Q,$,Z,J,ee,te,ne,ie,re,oe,ae,se,ue,ce,le,he,fe,de,pe,ve,ge,me,ye,be,_e,we,ke,xe,Se,Ee;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=n.activeCtx,o=n.activeProperty,h=n.expandedActiveProperty,f=n.element,v=n.expandedParent,m=n.options,E=void 0===m?{}:m,T=n.insideList,M=n.typeKey,D=n.typeScopedContext,N=n.expansionMap,F=Object.keys(f).sort(),B=[],z=f[M]&&"@json"===y(i,a(f[M])?f[M][0]:f[M],{vocab:!0},E),U=_(F),e.prev=4,U.s();case 6:if((H=U.n()).done){e.next=187;break}if(G=H.value,W=void 0,q=f[G],"@context"!==G){e.next=11;break}return e.abrupt("continue",185);case 11:if(null!==(X=y(i,G,{vocab:!0},E))&&(S(X)||w(X))||void 0!==(X=N({unmappedProperty:G,activeCtx:i,activeProperty:o,parent:f,options:E,insideList:T,value:q,expandedParent:v}))){e.next=14;break}return e.abrupt("continue",185);case 14:if(!w(X)){e.next=19;break}if("@reverse"!==h){e.next=17;break}throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});case 17:if(!(X in v)||"@included"===X||"@type"===X){e.next=19;break}throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:X});case 19:if("@id"!==X){e.next=34;break}if(c(q)){e.next=32;break}if(E.isFrame){e.next=23;break}throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});case 23:if(!s(q)){e.next=28;break}if(u(q)){e.next=26;break}throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:q});case 26:e.next=32;break;case 28:if(a(q)){e.next=30;break}throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:q});case 30:if(q.every(function(e){return c(e)})){e.next=32;break}throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:q});case 32:return C(v,"@id",O(q).map(function(e){return c(e)?y(i,e,{base:!0},E):e}),{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 34:if("@type"!==X){e.next=37;break}return s(q)&&(q=Object.fromEntries(Object.entries(q).map(function(e){var n=t(e,2),i=n[0],r=n[1];return[y(D,i,{vocab:!0}),O(r).map(function(e){return y(D,e,{base:!0,vocab:!0})})]}))),A(q,E.isFrame),C(v,"@type",O(q).map(function(e){return c(e)?y(D,e,{base:!0,vocab:!0},E):e}),{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 37:if("@included"!==X||!x(i,1.1)){e.next=47;break}return e.t0=O,e.next=41,P.expand({activeCtx:i,activeProperty:o,element:q,options:E,expansionMap:N});case 41:if(e.t1=e.sent,(Y=(0,e.t0)(e.t1)).every(function(e){return g(e)})){e.next=45;break}throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});case 45:return C(v,"@included",Y,{propertyIsArray:!0}),e.abrupt("continue",185);case 47:if("@graph"!==X||s(q)||a(q)){e.next=49;break}throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});case 49:if("@value"!==X){e.next=52;break}return V=q,z&&x(i,1.1)?v["@value"]=q:C(v,"@value",q,{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 52:if("@language"!==X){e.next=62;break}if(null!==q){e.next=55;break}return e.abrupt("continue",185);case 55:if(c(q)||E.isFrame){e.next=57;break}throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});case 57:q=O(q).map(function(e){return c(e)?e.toLowerCase():e}),K=_(q);try{for(K.s();!(Q=K.n()).done;)$=Q.value,c($)&&!$.match(I)&&console.warn("@language must be valid BCP47: ".concat($))}catch(Ce){K.e(Ce)}finally{K.f()}return C(v,"@language",q,{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 62:if("@direction"!==X){e.next=85;break}if(c(q)||E.isFrame){e.next=65;break}throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});case 65:q=O(q),Z=_(q),e.prev=67,Z.s();case 69:if((J=Z.n()).done){e.next=75;break}if(ee=J.value,!c(ee)||"ltr"===ee||"rtl"===ee){e.next=73;break}throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:q});case 73:e.next=69;break;case 75:e.next=80;break;case 77:e.prev=77,e.t2=e.catch(67),Z.e(e.t2);case 80:return e.prev=80,Z.f(),e.finish(80);case 83:return C(v,"@direction",q,{propertyIsArray:E.isFrame}),e.abrupt("continue",185);case 85:if("@index"!==X){e.next=90;break}if(c(q)){e.next=88;break}throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});case 88:return C(v,"@index",q),e.abrupt("continue",185);case 90:if("@reverse"!==X){e.next=118;break}if(s(q)){e.next=93;break}throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});case 93:return e.next=95,P.expand({activeCtx:i,activeProperty:"@reverse",element:q,options:E,expansionMap:N});case 95:if(!("@reverse"in(W=e.sent))){e.next=98;break}for(te in W["@reverse"])C(v,te,W["@reverse"][te],{propertyIsArray:!0});case 98:ne=v["@reverse"]||null,e.t3=regeneratorRuntime.keys(W);case 100:if((e.t4=e.t3()).done){e.next=117;break}if("@reverse"!==(ie=e.t4.value)){e.next=104;break}return e.abrupt("continue",100);case 104:null===ne&&(ne=v["@reverse"]={}),C(ne,ie,[],{propertyIsArray:!0}),re=W[ie],oe=0;case 107:if(!(oe1?Q.slice().sort():Q:[Q],Z=_($),e.prev=81,Z.s();case 83:if((J=Z.n()).done){e.next=93;break}if(ee=J.value,te=b(E,ee,"@context"),e.t5=l(te),e.t5){e.next=91;break}return e.next=90,k({activeCtx:n,localCtx:te,options:d,propagate:!1});case 90:n=e.sent;case 91:e.next=83;break;case 93:e.next=98;break;case 95:e.prev=95,e.t6=e.catch(81),Z.e(e.t6);case 98:return e.prev=98,Z.f(),e.finish(98);case 101:e.next=75;break;case 103:e.next=108;break;case 105:e.prev=105,e.t7=e.catch(73),X.e(e.t7);case 108:return e.prev=108,X.f(),e.finish(108);case 111:return ne={},e.next=114,R({activeCtx:n,activeProperty:o,expandedActiveProperty:F,element:h,expandedParent:ne,options:d,insideList:v,typeKey:q,typeScopedContext:E,expansionMap:A});case 114:if(V=Object.keys(ne),ie=V.length,!("@value"in ne)){e.next=137;break}if(!("@type"in ne)||!("@language"in ne)&&!("@direction"in ne)){e.next=119;break}throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:ne});case 119:if(re=ie-1,"@type"in ne&&(re-=1),"@index"in ne&&(re-=1),"@language"in ne&&(re-=1),"@direction"in ne&&(re-=1),0===re){e.next=122;break}throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:ne});case 122:if(oe=null===ne["@value"]?[]:O(ne["@value"]),ae=T(ne,"@type"),x(n,1.1)&&ae.includes("@json")&&1===ae.length){e.next=135;break}if(0!==oe.length){e.next=131;break}return e.next=127,A({unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:d,insideList:v});case 127:se=e.sent,ne=void 0!==se?se:null,e.next=135;break;case 131:if(oe.every(function(e){return c(e)||u(e)})||!("@language"in ne)){e.next=133;break}throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:ne});case 133:if(ae.every(function(e){return S(e)&&!(c(e)&&0===e.indexOf("_:"))||u(e)})){e.next=135;break}throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:ne});case 135:e.next=152;break;case 137:if(!("@type"in ne)||a(ne["@type"])){e.next=141;break}ne["@type"]=[ne["@type"]],e.next=152;break;case 141:if(!("@set"in ne)&&!("@list"in ne)){e.next=147;break}if(!(ie>1)||2===ie&&"@index"in ne){e.next=144;break}throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:ne});case 144:"@set"in ne&&(ne=ne["@set"],V=Object.keys(ne),ie=V.length),e.next=152;break;case 147:if(1!==ie||!("@language"in ne)){e.next=152;break}return e.next=150,A(ne,{unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:d,insideList:v});case 150:ue=e.sent,ne=void 0!==ue?ue:null;case 152:if(!s(ne)||d.keepFreeFloatingNodes||v||null!==o&&"@graph"!==F||!(0===ie||"@value"in ne||"@list"in ne||1===ie&&"@id"in ne)){e.next=157;break}return e.next=155,A({unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:d,insideList:v});case 155:ce=e.sent,ne=void 0!==ce?ce:null;case 157:return e.abrupt("return",ne);case 158:case"end":return e.stop()}},e,null,[[38,53,56,59],[73,105,108,111],[81,95,98,101]])})),function(e){return M.apply(this,arguments)})},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(e,t,n){"use strict";var i=e("./graphTypes").isSubjectReference,r=e("./nodeMap").createMergedNodeMap,o={};t.exports=o,o.flatten=function(e){for(var t=r(e),n=[],o=Object.keys(t).sort(),a=0;a=0;--i){var r=n[i];if(r.graph===t&&r.subject["@id"]===e["@id"])return!0}return!1}function g(e,t,n){var i="@"+n,r=i in e?e[i][0]:t[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return r}function m(e){if(!a.isArray(e)||1!==e.length||!a.isObject(e[0]))throw new c("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0]){var t,n=_(s.asArray(e[0]["@id"]));try{for(n.s();!(t=n.n()).done;){var i=t.value;if(!a.isObject(i)&&!u.isAbsolute(i)||a.isString(i)&&0===i.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(h){n.e(h)}finally{n.f()}}if("@type"in e[0]){var r,o=_(s.asArray(e[0]["@type"]));try{for(o.s();!(r=o.n()).done;){var l=r.value;if(!a.isObject(l)&&!u.isAbsolute(l)||a.isString(l)&&0===l.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(h){o.e(h)}finally{o.f()}}}function y(e,t,n,o){var u=!0,c=!1;for(var l in n){var h=!1,f=s.getValues(t,l),d=0===s.getValues(n,l).length;if("@id"===l){if(a.isEmptyObject(n["@id"][0]||{})?h=!0:n["@id"].length>=0&&(h=n["@id"].includes(f[0])),!o.requireAll)return h}else if("@type"===l){if(u=!1,d){if(f.length>0)return!1;h=!0}else if(1===n["@type"].length&&a.isEmptyObject(n["@type"][0]))h=f.length>0;else{var p,v=_(n["@type"]);try{var g=function(){var e=p.value;h=!(!a.isObject(e)||!("@default"in e))||h||f.some(function(t){return t===e})};for(v.s();!(p=v.n()).done;)g()}catch(b){v.e(b)}finally{v.f()}}if(!o.requireAll)return h}else{if(i(l))continue;var y=function(){var t=s.getValues(n,l)[0],i=!1;if(t&&(m([t]),i="@default"in t),u=!1,0===f.length&&i)return"continue";if(f.length>0&&d)return{v:!1};if(void 0===t){if(f.length>0)return{v:!1};h=!0}else if(r.isList(t)){var c=t["@list"][0];if(r.isList(f[0])){var p=f[0]["@list"];r.isValue(c)?h=p.some(function(e){return S(c,e)}):(r.isSubject(c)||r.isSubjectReference(c))&&(h=p.some(function(t){return x(e,c,t,o)}))}}else h=r.isValue(t)?f.some(function(e){return S(t,e)}):r.isSubjectReference(t)?f.some(function(n){return x(e,t,n,o)}):!!a.isObject(t)&&f.length>0}();if("continue"===y)continue;if("object"==typeof y)return y.v}if(!h&&o.requireAll)return!1;c=c||h}return u||c}function b(e,t){var n=e.uniqueEmbeds[e.graph],i=n[t],r=i.parent,o=i.property,u={"@id":t};if(a.isArray(r)){for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:null;m(n);var h=e.options,f={embed:g(n=n[0],h,"embed"),explicit:g(n,h,"explicit"),requireAll:g(n,h,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});var w,x=e.link[e.graph],E=function(e,t,n,i){var r,o={},a=_(t);try{for(a.s();!(r=a.n()).done;){var s=r.value,u=e.graphMap[e.graph][s];y(e,u,n,i)&&(o[s]=u)}}catch(c){a.e(c)}finally{a.f()}return o}(e,t,n,f),C=Object.keys(E).sort(),O=_(C);try{var T=function(){var m=w.value,y=E[m];if(null===l?e.uniqueEmbeds=o({},e.graph,{}):e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===f.embed&&m in x)return k(u,l,x[m]),"continue";var C={"@id":m};if(0===m.indexOf("_:")&&s.addValue(e.bnodeMap,m,C,{propertyIsArray:!0}),x[m]=C,("@first"===f.embed||"@last"===f.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(m)){if(e.embedded&&("@never"===f.embed||v(y,e.graph,e.subjectStack)))return k(u,l,C),"continue";if(e.embedded&&("@first"==f.embed||"@once"==f.embed)&&e.uniqueEmbeds[e.graph].hasOwnProperty(m))return k(u,l,C),"continue";if("@last"===f.embed&&m in e.uniqueEmbeds[e.graph]&&b(e,m),e.uniqueEmbeds[e.graph][m]={parent:u,property:l},e.subjectStack.push({subject:y,graph:e.graph}),m in e.graphMap){var O=!1,T=null;"@graph"in n?(T=n["@graph"][0],O=!("@merged"===m||"@default"===m),a.isObject(T)||(T={})):(O="@merged"!==e.graph,T={}),O&&d.frame(I(M({},e),{graph:m,embedded:!1}),Object.keys(e.graphMap[m]).sort(),[T],C,"@graph")}"@included"in n&&d.frame(I(M({},e),{embedded:!1}),t,n["@included"],C,"@included");var A,P=_(Object.keys(y).sort());try{for(P.s();!(A=P.n()).done;){var R=A.value;if(i(R)){if(C[R]=s.clone(y[R]),"@type"===R){var D,N=_(y["@type"]);try{for(N.s();!(D=N.n()).done;){var L=D.value;0===L.indexOf("_:")&&s.addValue(e.bnodeMap,L,C,{propertyIsArray:!0})}}catch(re){N.e(re)}finally{N.f()}}}else if(!f.explicit||R in n){var j,F=_(y[R]);try{for(F.s();!(j=F.n()).done;){var B=j.value,V=R in n?n[R]:p(f);if(r.isList(B)){var z=n[R]&&n[R][0]&&n[R][0]["@list"]?n[R][0]["@list"]:p(f),U={"@list":[]};k(C,R,U);var H,G=_(B["@list"]);try{for(G.s();!(H=G.n()).done;){var W=H.value;r.isSubjectReference(W)?d.frame(I(M({},e),{embedded:!0}),[W["@id"]],z,U,"@list"):k(U,"@list",s.clone(W))}}catch(re){G.e(re)}finally{G.f()}}else r.isSubjectReference(B)?d.frame(I(M({},e),{embedded:!0}),[B["@id"]],V,C,R):S(V[0],B)&&k(C,R,s.clone(B))}}catch(re){F.e(re)}finally{F.f()}}}}catch(re){P.e(re)}finally{P.f()}var q,X=_(Object.keys(n).sort());try{for(X.s();!(q=X.n()).done;){var Y=q.value;if("@type"===Y){if(!a.isObject(n[Y][0])||!("@default"in n[Y][0]))continue}else if(i(Y))continue;var K=n[Y][0]||{};if(!g(K,h,"omitDefault")&&!(Y in C)){var Q="@null";"@default"in K&&(Q=s.clone(K["@default"])),a.isArray(Q)||(Q=[Q]),C[Y]=[{"@preserve":Q}]}}}catch(re){X.e(re)}finally{X.f()}var $,Z=_(Object.keys(n["@reverse"]||{}).sort());try{for(Z.s();!($=Z.n()).done;)for(var J=$.value,ee=n["@reverse"][J],te=0,ne=Object.keys(e.subjects);te0&&(r["@language"]=l,l.match(k)||console.warn("@language must be valid BCP47: ".concat(l))),r["@direction"]=h}else a!==w&&(r["@type"]=a)}return r}n.exports=x,x.fromRDF=(r=h(regeneratorRuntime.mark(function e(t,n){var i,r,o,c,h,g,m,y,b,w,k,x,E,C,O,T,A,P,M,I,R,D,N,L,j,F,B,V,z,U,H,G,W,q,X,Y,K,Q,$,Z,J,ee,te,ne,ie,re,oe,ae,se;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=n.useRdfType,r=void 0!==i&&i,o=n.useNativeTypes,c=void 0!==o&&o,h=n.rdfDirection,g=void 0===h?null:h,y={"@default":m={}},b={},w=_(t),e.prev=3,w.s();case 5:if((k=w.n()).done){e.next=19;break}if(x=k.value,(E="DefaultGraph"===x.graph.termType?"@default":x.graph.value)in y||(y[E]={}),"@default"!==E&&!(E in m)&&(m[E]={"@id":E}),C=y[E],O=x.subject.value,T=x.predicate.value,A=x.object,O in C||(C[O]={"@id":O}),P=C[O],(M=A.termType.endsWith("Node"))&&!(A.value in C)&&(C[A.value]={"@id":A.value}),T!==v||r||!M){e.next=15;break}return u.addValue(P,"@type",A.value,{propertyIsArray:!0}),e.abrupt("continue",17);case 15:I=S(A,c,g),u.addValue(P,T,I,{propertyIsArray:!0}),M&&(A.value===p?("usages"in(R=C[A.value])||(R.usages=[]),R.usages.push({node:P,property:T,value:I})):b[A.value]=!(A.value in b)&&{node:P,property:T,value:I});case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(3),w.e(e.t0);case 24:return e.prev=24,w.f(),e.finish(24);case 27:e.t1=regeneratorRuntime.keys(y);case 28:if((e.t2=e.t1()).done){e.next=37;break}if(D=e.t2.value,N=y[D],p in N){e.next=33;break}return e.abrupt("continue",28);case 33:if((L=N[p]).usages){j=_(L.usages);try{for(j.s();!(F=j.n()).done;){for(B=F.value,V=B.node,z=B.property,U=B.value,H=[],G=[],W=Object.keys(V).length;z===d&&s.isObject(b[V["@id"]])&&s.isArray(V[f])&&1===V[f].length&&s.isArray(V[d])&&1===V[d].length&&(3===W||4===W&&s.isArray(V["@type"])&&1===V["@type"].length&&V["@type"][0]===l)&&(H.push(V[f][0]),G.push(V["@id"]),B=b[V["@id"]],V=B.node,z=B.property,U=B.value,W=Object.keys(V).length,a.isBlankNode(V)););for(delete U["@id"],U["@list"]=H.reverse(),q=0,X=G;q1||!("@id"in e))},r.isSubjectReference=function(e){return i.isObject(e)&&1===Object.keys(e).length&&"@id"in e},r.isValue=function(e){return i.isObject(e)&&"@value"in e},r.isList=function(e){return i.isObject(e)&&"@list"in e},r.isGraph=function(e){return i.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(function(e){return"@id"!==e&&"@index"!==e}).length},r.isSimpleGraph=function(e){return r.isGraph(e)&&!("@id"in e)},r.isBlankNode=function(e){return!!i.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))}},{"./types":30}],26:[function(e,t,n){var i=e("rdf-canonize"),r=e("./platform"),o=e("./util"),a=e("./ContextResolver"),s=o.IdentifierIssuer,u=e("./JsonLdError"),c=e("lru-cache"),l=e("./NQuads"),f=e("./expand").expand,d=e("./flatten").flatten,p=e("./fromRdf").fromRDF,v=e("./toRdf").toRDF,g=e("./frame"),m=g.frameMergedOrDefault,y=g.cleanupNull,b=e("./types"),w=b.isArray,k=b.isObject,x=b.isString,S=e("./graphTypes").isSubjectReference,E=e("./context"),A=E.expandIri,P=E.getInitialContext,I=E.process,R=E.processingMode,D=e("./compact"),N=D.compact,L=D.compactIri,j=e("./nodeMap"),F=j.createNodeMap,B=j.createMergedNodeMap,V=j.mergeNodeMaps,z=function(t){var n,g={},b=new c({max:100});function E(e,n){var i=n,r=i.documentLoader,o=void 0===r?t.documentLoader:r,a=function(e,t){var n={};for(var i in e)O.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&C){var r,o=_(C(e));try{for(o.s();!(r=o.n()).done;)i=r.value,t.indexOf(i)<0&&T.call(e,i)&&(n[i]=e[i])}catch(a){o.e(a)}finally{o.f()}}return n}(i,["documentLoader"]);return Object.assign({},{documentLoader:o},a,e)}return t.compact=(n=h(regeneratorRuntime.mark(function e(n,i,r){var c,l,h,f,d,p,v,g,m,y,_=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(_.length<2)){e.next=2;break}throw new TypeError("Could not compact, too few arguments.");case 2:if(null!==i){e.next=4;break}throw new u("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});case 4:if(null!==n){e.next=6;break}return e.abrupt("return",null);case 6:if((r=E(r,{base:x(n)?n:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new a({sharedCache:b})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,!r.skipExpansion){e.next=12;break}e.t0=n,e.next=15;break;case 12:return e.next=14,t.expand(n,r);case 14:e.t0=e.sent;case 15:return c=e.t0,e.next=18,t.processContext(P(r),i,r);case 18:return l=e.sent,e.next=21,N({activeCtx:l,element:c,options:r,compactionMap:r.compactionMap});case 21:h=e.sent,r.compactArrays&&!r.graph&&w(h)?1===h.length?h=h[0]:0===h.length&&(h={}):r.graph&&k(h)&&(h=[h]),k(i)&&"@context"in i&&(i=i["@context"]),i=o.clone(i),w(i)||(i=[i]),f=i,i=[];for(d=0;d0)&&i.push(f[d]);if(p=i.length>0,1===i.length&&(i=i[0]),w(h))v=L({activeCtx:l,iri:"@graph",relativeTo:{vocab:!0}}),g=h,h={},p&&(h["@context"]=i),h[v]=g;else if(k(h)&&p)for(y in m=h,h={"@context":i},m)h[y]=m[y];return e.abrupt("return",h);case 29:case"end":return e.stop()}},e)})),function(e,t,i){return n.apply(this,arguments)}),t.expand=function(){var e=h(regeneratorRuntime.mark(function e(n,i){var r,s,u,c,l,h,d,p,v,g,m=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.length<1)){e.next=2;break}throw new TypeError("Could not expand, too few arguments.");case 2:if(!1===(i=E(i,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:b})})).expansionMap&&(i.expansionMap=void 0),r={},s=[],"expandContext"in i&&(u=o.clone(i.expandContext),r.expandContext=k(u)&&"@context"in u?u:{"@context":u},s.push(r.expandContext)),!x(n)){e.next=12;break}return e.next=8,t.get(n,i);case 8:l=e.sent,c=l.documentUrl,r.input=l.document,l.contextUrl&&(r.remoteContext={"@context":l.contextUrl},s.push(r.remoteContext)),e.next=13;break;case 12:r.input=o.clone(n);case 13:"base"in i||(i.base=c||""),h=P(i),d=0,p=s;case 16:if(!(d=1e21)},i.isEmptyObject=function(e){return i.isObject(e)&&0===Object.keys(e).length},i.isNumber=function(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)},i.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},i.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},i.isString=function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},i.isUndefined=function(e){return void 0===e}},{}],31:[function(e,t,n){"use strict";var i=e("./types"),r={};t.exports=r,r.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=function(e,t){for(var n={},i=r.parsers[t||"full"],o=i.regex.exec(e),a=i.keys.length;a--;)n[i.keys[a]]=void 0===o[a]?null:o[a];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=function(e,t){if(null===e||r.isAbsolute(t))return t;(!e||i.isString(e))&&(e=r.parse(e||""));var n=r.parse(t),o={protocol:e.protocol||""};if(null!==n.authority)o.authority=n.authority,o.path=n.path,o.query=n.query;else if(o.authority=e.authority,""===n.path)o.path=e.path,o.query=null!==n.query?n.query:e.query;else{if(0===n.path.indexOf("/"))o.path=n.path;else{var a=e.path;((a=a.substr(0,a.lastIndexOf("/")+1)).length>0||e.authority)&&"/"!==a.substr(-1)&&(a+="/"),a+=n.path,o.path=a}o.query=n.query}""!==n.path&&(o.path=r.removeDotSegments(o.path));var s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==n.fragment&&(s+="#"+n.fragment),""===s&&(s="./"),s},r.removeBase=function(e,t){if(null===e)return t;(!e||i.isString(e))&&(e=r.parse(e||""));var n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;for(var o=r.parse(t.substr(n.length)),a=e.normalizedPath.split("/"),s=o.normalizedPath.split("/"),u=o.fragment||o.query?0:1;a.length>0&&s.length>u&&a[0]===s[0];)a.shift(),s.shift();var c="";if(a.length>0){a.pop();for(var l=0;l0;){var i=t.shift(),r=0===t.length;"."!==i?".."!==i?n.push(i):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};var o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=function(e){return i.isString(e)&&o.test(e)},r.isRelative=function(e){return i.isString(e)}},{"./types":30}],32:[function(e,n,i){"use strict";var r=e("./graphTypes"),o=e("./types"),a=e("rdf-canonize").IdentifierIssuer,s=e("./JsonLdError"),u=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,l=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,h="application/ld+json, application/json",f={};function d(e,t){if(o.isArray(t))for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(Object.keys(e).some(function(e){return"accept"===e.toLowerCase()}))throw new RangeError('Accept header may not be specified; only "'+h+'" is supported.');return Object.assign({Accept:h},e)},f.parseLinkHeader=function(e){for(var t={},n=e.match(u),i=0;i0}return!1},f.hasValue=function(e,t,n){if(f.hasProperty(e,t)){var i=e[t],a=r.isList(i);if(o.isArray(i)||a){a&&(i=i["@list"]);for(var s=0;st.maxAge:e[u]&&n>e[u]},y=function(e){if(e[o]>e[r])for(var t=e[h].tail;e[o]>e[r]&&null!==t;){var n=t.prev;_(e,t),t=n}},_=function(e,t){if(t){var n=t.value;e[c]&&e[c](n.key,n.value),e[o]-=n.length,e[f].delete(n.key),e[h].removeNode(t)}},w=function e(t,n,i,r,o){m(this,e),this.key=t,this.value=n,this.length=i,this.now=r,this.maxAge=o||0},k=function(e,t,n,i){var r=n.value;g(e,r)&&(_(e,n),e[s]||(r=void 0)),r&&t.call(i,r.value,r.key,e)};t.exports=function(){function e(t){if(m(this,e),"number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[r]=t.max||1/0;var n=t.length||p;if(this[a]="function"!=typeof n?p:n,this[s]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}return b(e,[{key:"max",get:function(){return this[r]},set:function(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[r]=e||1/0,y(this)}},{key:"allowStale",get:function(){return this[s]},set:function(e){this[s]=!!e}},{key:"maxAge",get:function(){return this[u]},set:function(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,y(this)}},{key:"lengthCalculator",get:function(){return this[a]},set:function(e){var t=this;"function"!=typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[o]=0,this[h].forEach(function(e){e.length=t[a](e.value,e.key),t[o]+=e.length})),y(this)}},{key:"length",get:function(){return this[o]}},{key:"itemCount",get:function(){return this[h].length}},{key:"rforEach",value:function(e,t){t=t||this;for(var n=this[h].tail;null!==n;){var i=n.prev;k(this,e,n,t),n=i}}},{key:"forEach",value:function(e,t){t=t||this;for(var n=this[h].head;null!==n;){var i=n.next;k(this,e,n,t),n=i}}},{key:"keys",value:function(){return this[h].toArray().map(function(e){return e.key})}},{key:"values",value:function(){return this[h].toArray().map(function(e){return e.value})}},{key:"reset",value:function(){var e=this;this[c]&&this[h]&&this[h].length&&this[h].forEach(function(t){return e[c](t.key,t.value)}),this[f]=new Map,this[h]=new i,this[o]=0}},{key:"dump",value:function(){var e=this;return this[h].map(function(t){return!g(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}}).toArray().filter(function(e){return e})}},{key:"dumpLru",value:function(){return this[h]}},{key:"set",value:function(e,t,n){if((n=n||this[u])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var i=n?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[r])return _(this,this[f].get(e)),!1;var d=this[f].get(e).value;return this[c]&&(this[l]||this[c](e,d.value)),d.now=i,d.maxAge=n,d.value=t,this[o]+=s-d.length,d.length=s,this.get(e),y(this),!0}var p=new w(e,t,s,i,n);return p.length>this[r]?(this[c]&&this[c](e,t),!1):(this[o]+=p.length,this[h].unshift(p),this[f].set(e,this[h].head),y(this),!0)}},{key:"has",value:function(e){if(!this[f].has(e))return!1;var t=this[f].get(e).value;return!g(this,t)}},{key:"get",value:function(e){return v(this,e,!0)}},{key:"peek",value:function(e){return v(this,e,!1)}},{key:"pop",value:function(){var e=this[h].tail;return e?(_(this,e),e.value):null}},{key:"del",value:function(e){_(this,this[f].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var i=e[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{var o=r-t;o>0&&this.set(i.k,i.v,o)}}}},{key:"prune",value:function(){var e=this;this[f].forEach(function(t,n){return v(e,n,!1)})}}]),e}()},{yallist:92}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#",o="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:"".concat(r,"decimal"),boolean:"".concat(r,"boolean"),double:"".concat(r,"double"),integer:"".concat(r,"integer"),string:"".concat(r,"string")},rdf:{type:"".concat(i,"type"),nil:"".concat(i,"nil"),first:"".concat(i,"first"),rest:"".concat(i,"rest"),langString:"".concat(i,"langString")},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:"".concat(o,"reify#forSome"),forAll:"".concat(o,"reify#forAll")},log:{implies:"".concat(o,"log#implies")}}},{}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function e(t,n){if(n=n||y,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===y)return new k(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));var i=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,i-1),"@"===t[i+1]?t.substr(i+2):n.namedNode(t.substr(i+3)));case"<":var r=g.exec(t);return n.quad(e(T(r[1]),n),e(T(r[2]),n),e(T(r[3]),n),r[4]&&e(T(r[4]),n));default:return n.namedNode(t)}},n.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof _&&"Quad"!==t.termType)return t.id;if(!t)return r.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return"_:".concat(t.value);case"Variable":return"?".concat(t.value);case"DefaultGraph":return"";case"Literal":return'"'.concat(t.value,'"').concat(t.language?"@".concat(t.language):t.datatype&&t.datatype.value!==d.string?"^^".concat(t.datatype.value):"");case"Quad":return"<<".concat(O(e(t.subject))," ").concat(O(e(t.predicate))," ").concat(O(e(t.object))).concat((0,l.isDefaultGraph)(t.graph)?"":" ".concat(e(t.graph)),">>");default:throw new Error("Unexpected termType: ".concat(t.termType))}},n.escapeQuotes=O,n.unescapeQuotes=T,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var i,r,o=(i=e("./IRIs"))&&i.__esModule?i:{default:i},l=e("./N3Util"),h=o.default,f=h.rdf,d=h.xsd,p=0,v=/^"(.*".*)(?="[^"]*$)/,g=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,y={namedNode:function(e){return new w(e)},blankNode:function(e){return new x(e||"n3-"+p++)},variable:function(e){return new S(e)},literal:function(e,t){if("string"==typeof t)return new k('"'.concat(e,'"@').concat(t.toLowerCase()));var n=t?t.value:"";return""===n&&("boolean"==typeof e?n=d.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?d.integer:d.double:(n=d.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new k(""===n||n===d.string?'"'.concat(e,'"'):'"'.concat(e,'"^^').concat(n))},defaultGraph:function(){return r},quad:A,triple:A};n.default=y;var _=function(){function e(t){m(this,e),this.id=t}return b(e,[{key:"value",get:function(){return this.id}},{key:"equals",value:function(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}},{key:"toJSON",value:function(){return{termType:this.termType,value:this.value}}}]),e}();n.Term=_;var w=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"termType",get:function(){return"NamedNode"}}]),n}(_);n.NamedNode=w;var k=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"termType",get:function(){return"Literal"}},{key:"value",get:function(){return this.id.substring(1,this.id.lastIndexOf('"'))}},{key:"language",get:function(){var e=this.id,t=e.lastIndexOf('"')+1;return t\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},h=/$0^/;n.default=function(){function e(t){if(m(this,e),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]*)?$/,this._lineMode=!!(t=t||{}).lineMode)for(var n in this._n3Mode=!1,this)!(n in l)&&this[n]instanceof RegExp&&(this[n]=h);else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}return b(e,[{key:"_tokenizeToEnd",value:function(e,t){for(var n,i=this._input,r=this._comments;;){for(var o=void 0,s=void 0;o=this._newline.exec(i);)r&&(s=this._comment.exec(o[0]))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),i=i.substr(o[0].length,i.length),this._line++;if(!o&&(o=this._whitespace.exec(i))&&(i=i.substr(o[0].length,i.length)),this._endOfFile.test(i))return t&&(r&&(s=this._comment.exec(i))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),e(i=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=i;var u=this._line,l=i[0],h="",f="",d="",p=null,v=0,g=!1;switch(l){case"^":if(i.length<3)break;if("^"!==i[1]){this._n3Mode&&(v=1,h="^");break}if(this._previousMarker="^^","<"!==(i=i.substr(2))[0]){g=!0;break}case"<":if(p=this._unescapedIri.exec(i))h="IRI",f=p[1];else if(p=this._iri.exec(i)){if(null===(f=this._unescape(p[1]))||c.test(f))return b(this);h="IRI"}else i.length>1&&"<"===i[1]?(h="<<",v=2):this._n3Mode&&i.length>1&&"="===i[1]&&(h="inverse",v=2,f=">");break;case">":i.length>1&&">"===i[1]&&(h=">>",v=2);break;case"_":((p=this._blank.exec(i))||t&&(p=this._blank.exec("".concat(i," "))))&&(h="blank",d="_",f=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(i))f=p[1];else if(f=(n=this._parseLiteral(i)).value,v=n.matchLength,null===f)return b(this);(null!==p||0!==v)&&(h="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){var m;if(p=this._simpleApostropheString.exec(i))f=p[1];else if(f=(m=this._parseLiteral(i)).value,v=m.matchLength,null===f)return b(this);(null!==p||0!==v)&&(h="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(i))&&(h="var",f=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(i))?(h="langcode",f=p[1]):(p=this._keyword.exec(i))&&(h=p[0]);break;case".":if(1===i.length?t:i[1]<"0"||i[1]>"9"){h=".",v=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(i)||t&&(p=this._number.exec("".concat(i," "))))&&(h="literal",f=p[0],d="string"==typeof p[1]?a.double:"string"==typeof p[2]?a.decimal:a.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(i))?h=p[0].toUpperCase():g=!0;break;case"f":case"t":(p=this._boolean.exec(i))?(h="literal",f=p[0],d=a.boolean):g=!0;break;case"a":(p=this._shortPredicates.exec(i))?(h="abbreviation",f="a"):g=!0;break;case"=":this._n3Mode&&i.length>1&&(h="abbreviation",">"!==i[1]?(v=1,f="="):(v=2,f=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(v=1,h=l);break;default:g=!0}if(g&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(i))?((p=this._prefixed.exec(i))||t&&(p=this._prefixed.exec("".concat(i," "))))&&(h="prefixed",d=p[1]||"",f=this._unescape(p[2])):(h="prefix",f=p[1]||"")),"^^"===this._previousMarker)switch(h){case"prefixed":h="type";break;case"IRI":h="typeIRI";break;default:h=""}if(!h)return t||!/^'''|^"""/.test(i)&&/\n|\r/.test(i)?b(this):this._input=i;var y={line:u,type:h,value:f,prefix:d};e(null,y),this.previousToken=y,this._previousMarker=h,i=i.substr(v||p[0].length,i.length)}function b(t){e(t._syntaxError(/^\S*/.exec(i)[0]))}}},{key:"_unescape",value:function(e){var t=!1,n=e.replace(s,function(e,n,i,r){if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof i){var o=Number.parseInt(i,16);return o<=65535?String.fromCharCode(Number.parseInt(i,16)):String.fromCharCode(55296+((o-=65536)>>10),56320+(1023&o))}return r in u?u[r]:(t=!0,"")});return t?null:n}},{key:"_parseLiteral",value:function(e){if(e.length>=3){for(var t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length,i=Math.max(this._literalClosingPos,n);(i=e.indexOf(t,i))>0;){for(var r=0;"\\"===e[i-r-1];)r++;if(r%2==0){var o=e.substring(n,i),a=o.split(/\r\n|\r|\n/).length-1,s=i+n;if(1===n&&0!==a||3===n&&this._lineMode)break;return this._line+=a,{value:this._unescape(o),matchLength:s}}i++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}},{key:"_syntaxError",value:function(e){this._input=null;var t=new Error('Unexpected "'.concat(e,'" on line ').concat(this._line,"."));return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}},{key:"_readStartingBom",value:function(e){return e.startsWith("\ufeff")?e.substr(1):e}},{key:"tokenize",value:function(e,n){var i=this;if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof n){var o,a=[];if(this._tokenizeToEnd(function(e,t){return e?o=e:a.push(t)},!0),o)throw o;return a}(0,r.default)(function(){return i._tokenizeToEnd(n,!0)})}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",function(e){null!==i._input&&0!==e.length&&(i._pendingBuffer&&(e=t.concat([i._pendingBuffer,e]),i._pendingBuffer=null),128&e[e.length-1]?i._pendingBuffer=e:(void 0===i._input?i._input=i._readStartingBom("string"==typeof e?e:e.toString()):i._input+=e,i._tokenizeToEnd(n,!1)))}),e.on("end",function(){"string"==typeof i._input&&i._tokenizeToEnd(n,!0)}),e.on("error",n)}}]),e}()}).call(this)}).call(this,e("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=a(e("./N3Lexer")),r=a(e("./N3DataFactory")),o=a(e("./IRIs"));function a(e){return e&&e.__esModule?e:{default:e}}var s=0,u=function(){function e(t){m(this,e),this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&l(this,t.factory);var n="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(n),o=/trig/.test(n),a=/triple/.test(n),s=/quad/.test(n),u=this._n3Mode=/n3/.test(n),c=a||s;(this._supportsNamedGraphs=!(r||u))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||o||a||u),this._supportsRDFStar=""===n||/star|\*$/.test(n),c&&(this._resolveRelativeIRI=function(e){return null}),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new i.default({lineMode:c,n3:u}),this._explicitQuantifiers=!!t.explicitQuantifiers}return b(e,[{key:"_setBase",value:function(e){if(e){var t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}},{key:"_saveContext",value:function(e,t,n,i,r){var o=this._n3Mode;this._contextStack.push({subject:n,predicate:i,object:r,graph:t,type:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?"".concat(this._graph.id.substr(2),"."):".",this._quantified=Object.create(this._quantified))}},{key:"_restoreContext",value:function(){var e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}},{key:"_readInTopContext",value:function(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}},{key:"_readEntity",value:function(e,t){var n;switch(e.type){case"IRI":case"typeIRI":var i=this._resolveIRI(e.value);if(null===i)return this._error("Invalid IRI",e);n=this._namedNode(i);break;case"type":case"prefixed":var r=this._prefixes[e.prefix];if(void 0===r)return this._error('Undefined prefix "'.concat(e.prefix,':"'),e);n=this._namedNode(r+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error("Expected entity but got ".concat(e.type),e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}},{key:"_readSubject",value:function(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}},{key:"_readPredicate",value:function(e){var t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected ".concat(t),e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}},{key:"_readObject",value:function(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}},{key:"_readPredicateOrNamedGraph",value:function(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}},{key:"_readGraph",value:function(e){return"{"!==e.type?this._error("Expected graph but got ".concat(e.type),e):(this._graph=this._subject,this._subject=null,this._readSubject)}},{key:"_readBlankNodeHead",value:function(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}},{key:"_readBlankNodeTail",value:function(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);var t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}},{key:"_readPredicateAfterBlank",value:function(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}},{key:"_readListItem",value:function(e){var t=null,n=null,i=this._readListItem,r=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,i=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===r?null===a.predicate?a.subject=n:a.object=n:this._emit(r,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return i}},{key:"_readDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!1)}},{key:"_readListItemDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!0)}},{key:"_completeLiteral",value:function(e){var t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":var n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}},{key:"_completeSubjectLiteral",value:function(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}},{key:"_completeObjectLiteral",value:function(e,t){var n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}},{key:"_readFormulaTail",value:function(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}},{key:"_readPunctuation",value:function(e){var t,n=this._graph,i=this._subject,r=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,r&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}if(null!==i){var o=this._predicate,a=this._object;r?this._emit(a,o,i,n):this._emit(i,o,a,n)}return t}},{key:"_readBlankNodePunctuation",value:function(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}},{key:"_readQuadPunctuation",value:function(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}},{key:"_readPrefix",value:function(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}},{key:"_readPrefixIRI",value:function(e){if("IRI"!==e.type)return this._error('Expected IRI to follow prefix "'.concat(this._prefix,':"'),e);var t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}},{key:"_readBaseIRI",value:function(e){var t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}},{key:"_readNamedGraphLabel",value:function(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)}}},{key:"_readNamedGraphBlankLabel",value:function(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}},{key:"_readDeclarationPunctuation",value:function(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}},{key:"_readQuantifierList",value:function(e){var t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error("Unexpected ".concat(e.type),e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}},{key:"_readQuantifierPunctuation",value:function(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))}},{key:"_getPathReader",value:function(e){return this._afterPath=e,this._readPath}},{key:"_readPath",value:function(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){var i=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,i,this._graph)}return this._afterPath(e)}}},{key:"_readForwardPath",value:function(e){var t,n,i=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=i):(t=this._object,this._object=i),this._emit(t,n,i,this._graph),this._readPath}},{key:"_readBackwardPath",value:function(e){var t,n,i=this._blankNode();if(void 0!==(t=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=i):(n=this._object,this._object=i),this._emit(i,t,n,this._graph),this._readPath}},{key:"_readRDFStarTailOrGraph",value:function(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error('Expected >> to follow "'.concat(this._object.id,'"'),e):this._readRDFStarTail(e)}},{key:"_readRDFStarTail",value:function(e){if(">>"!==e.type)return this._error("Expected >> but got ".concat(e.type),e);var t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}},{key:"_getContextEndReader",value:function(){var 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}}},{key:"_emit",value:function(e,t,n,i){this._callback(null,this._quad(e,t,n,i||this.DEFAULTGRAPH))}},{key:"_error",value:function(e,t){var n=new Error("".concat(e," on line ").concat(t.line,"."));n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}},{key:"_resolveIRI",value:function(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}},{key:"_resolveRelativeIRI",value:function(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)}}},{key:"_removeDotSegments",value:function(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;for(var t=e.length,n="",i=-1,r=-1,o=0,a="/";i=r&&(n=n.substr(0,o)),"/"!==a)return"".concat(n,"/").concat(e.substr(i+1));o=i+1}}}a=e[++i]}return n+e.substring(o)}},{key:"parse",value:function(e,t,n){var i=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):"b".concat(s++,"_"),this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){var r,o=[];if(this._callback=function(e,t){e?r=e:t&&o.push(t)},this._lexer.tokenize(e).every(function(e){return i._readCallback=i._readCallback(e)}),r)throw r;return o}this._callback=t,this._lexer.tokenize(e,function(e,t){null!==e?(i._callback(e),i._callback=c):i._readCallback&&(i._readCallback=i._readCallback(t))})}}],[{key:"_resetBlankNodePrefix",value:function(){s=0}}]),e}();function c(){}function l(e,t){var n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(o.default.rdf.first),e.RDF_REST=n(o.default.rdf.rest),e.RDF_NIL=n(o.default.rdf.nil),e.N3_FORALL=n(o.default.r.forAll),e.N3_FORSOME=n(o.default.r.forSome),e.ABBREVIATIONS={a:n(o.default.rdf.type),"=":n(o.default.owl.sameAs),">":n(o.default.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=u,l(u.prototype,r.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,n&&n.set(e,i),i}(e("./N3DataFactory")),o=e("readable-stream"),u=(i=e("./IRIs"))&&i.__esModule?i:{default:i};function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}var h=function(e){function t(e,n){m(this,t),this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!n&&e&&!e[0]&&(n=e,e=null),this._factory=(n=n||{}).factory||r.default,e&&this.addQuads(e)}return b(t,[{key:"size",get:function(){var e=this._size;if(null!==e)return e;e=0;var t,n,i=this._graphs;for(var r in i)for(var o in t=i[r].subjects)for(var a in n=t[o])e+=Object.keys(n[a]).length;return this._size=e}},{key:"_addToIndex",value:function(e,t,n,i){var r=e[t]||(e[t]={}),o=r[n]||(r[n]={}),a=i in o;return a||(o[i]=null),!a}},{key:"_removeFromIndex",value:function(e,t,n,i){var r=e[t],o=r[n];for(var a in delete o[i],o)return;for(var s in delete r[n],r)return;delete e[t]}},{key:"_findInIndex",value:function(e,t,n,i,o,a,s,u,c,l){var h,f,d,p=!t+!n+!i>1?Object.keys(this._ids):this._entities;for(var v in t&&((h=e,e={})[t]=h[t]),e){var g=p[v];if(f=e[v])for(var m in n&&((h=f,f={})[n]=h[n]),f){var y=p[m];if(d=f[m])for(var b=(i?i in d?[i]:[]:Object.keys(d)),_=0;_0&&void 0!==arguments[0]?arguments[0]:{},n=t.remove,i=void 0!==n&&n,r=t.ignoreErrors,o=void 0!==r&&r,a={},s=o?function(){return!0}:function(e,t){throw new Error("".concat(e.value," ").concat(t))},c=this.getQuads(null,u.default.rdf.rest,u.default.rdf.nil,null),l=i?v(c):[];return c.forEach(function(t){for(var n,r,o=[],c=!1,h=t.graph,f=t.subject;f&&!c;){for(var d=e.getQuads(null,null,f,null),p=e.getQuads(f,null,null,null),v=void 0,g=null,m=null,y=null,b=0;b")}},{key:"_encodeLiteral",value:function(e){var t=e.value;if(p.test(t)&&(t=t.replace(v,_)),e.language)return'"'.concat(t,'"@').concat(e.language);if(this._lineMode){if(e.datatype.value===d.string)return'"'.concat(t,'"')}else switch(e.datatype.value){case d.string:return'"'.concat(t,'"');case d.boolean:if("true"===t||"false"===t)return t;break;case d.integer:if(/^[+-]?\d+$/.test(t))return t;break;case d.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case d.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return'"'.concat(t,'"^^').concat(this._encodeIriOrBlank(e.datatype))}},{key:"_encodePredicate",value:function(e){return e.value===f.type?"a":this._encodeIriOrBlank(e)}},{key:"_encodeObject",value:function(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}},{key:"_encodeQuad",value:function(e){var t=e.subject,n=e.predicate,i=e.object,r=e.graph;return"<<".concat(this._encodeSubject(t)," ").concat(this._encodePredicate(n)," ").concat(this._encodeObject(i)).concat((0,u.isDefaultGraph)(r)?"":" ".concat(this._encodeIriOrBlank(r)),">>")}},{key:"_blockedWrite",value:function(){throw new Error("Cannot write because the writer has been closed.")}},{key:"addQuad",value:function(e,t,n,i,r){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof i?this._writeQuad(e,t,n,l,i):this._writeQuad(e,t,n,i||l,r)}},{key:"addQuads",value:function(e){for(var t=0;t.\n"))}if(n){var o="",a="";for(var s in this._prefixIRIs)o+=o?"|".concat(s):s,a+=(a?"|":"")+this._prefixIRIs[s];o=o.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:".concat(a,")[^/]*$|^(").concat(o,")([a-zA-Z][\\-_a-zA-Z0-9]*)$"))}this._write(n?"\n":"",t)}},{key:"blank",value:function(e,t){var n,i,r=e;switch(void 0===e?r=[]:e.termType?r=[{predicate:e,object:t}]:"length"in e||(r=[e]),i=r.length){case 0:return new y("[]");case 1:if(!((n=r[0]).object instanceof y))return new y("[ ".concat(this._encodePredicate(n.predicate)," ").concat(this._encodeObject(n.object)," ]"));default:for(var o="[",a=0;a1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:new Map,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;m(this,e),this.prefix=t,this._existing=n,this.counter=i}return b(e,[{key:"clone",value:function(){var t=this.prefix,n=this._existing,i=this.counter;return new e(t,new Map(n),i)}},{key:"getId",value:function(e){var t=e&&this._existing.get(e);if(t)return t;var n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}},{key:"hasId",value:function(e){return this._existing.has(e)}},{key:"getOldIds",value:function(){return v(this._existing.keys())}}]),e}()},{}],48:[function(e,t,n){"use strict";e("setimmediate");var i=self.crypto||self.msCrypto;t.exports=function(){function e(t){if(m(this,e),!i||!i.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error('Unsupport algorithm "'.concat(t,'".'));this.algorithm={name:"SHA-1"}}this._content=""}return b(e,[{key:"update",value:function(e){this._content+=e}},{key:"digest",value:function(){var e=this;return h(regeneratorRuntime.mark(function t(){var n,r,o,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(new TextEncoder).encode(e._content),t.t0=Uint8Array,t.next=4,i.subtle.digest(e.algorithm,n);case 4:for(t.t1=t.sent,r=new t.t0(t.t1),o="",a=0;a]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),t.exports=function(){function e(){m(this,e)}return b(e,null,[{key:"parse",value:function(e){var t,n=[],h={},d=0,p=_(e.split(c.eoln));try{for(p.s();!(t=p.n()).done;){var v=t.value;if(d++,!c.empty.test(v)){var g=v.match(c.quad);if(null===g)throw new Error("N-Quads parse error on line "+d+".");var m={subject:null,predicate:null,object:null,graph:null};if(m.subject=void 0!==g[1]?{termType:o,value:g[1]}:{termType:a,value:g[2]},m.predicate={termType:o,value:g[3]},void 0!==g[4]?m.object={termType:o,value:g[4]}:void 0!==g[5]?m.object={termType:a,value:g[5]}:(m.object={termType:s,value:void 0,datatype:{termType:o}},void 0!==g[7]?m.object.datatype.value=g[7]:void 0!==g[8]?(m.object.datatype.value=i,m.object.language=g[8]):m.object.datatype.value=r,m.object.value=g[6].replace(f,function(e,t,n,i){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(i)throw new Error("Unsupported U escape")})),m.graph=void 0!==g[9]?{termType:o,value:g[9]}:void 0!==g[10]?{termType:a,value:g[10]}:{termType:u,value:""},m.graph.value in h){var y,b=!0,w=h[m.graph.value],k=_(w);try{for(k.s();!(y=k.n()).done;){if(l(y.value,m)){b=!1;break}}}catch(x){k.e(x)}finally{k.f()}b&&(w.push(m),n.push(m))}else h[m.graph.value]=[m],n.push(m)}}}catch(x){p.e(x)}finally{p.f()}return n}},{key:"serialize",value:function(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));var n,i=[],r=_(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.push(e.serializeQuad(o))}}catch(a){r.e(a)}finally{r.f()}return i.sort().join("")}},{key:"serializeQuad",value:function(e){var t=e.subject,n=e.object,s=e.graph,u="";return u+=t.termType===o?"<".concat(t.value,">"):"".concat(t.value),u+=" <".concat(e.predicate.value,"> "),n.termType===o?u+="<".concat(n.value,">"):n.termType===a?u+=n.value:(u+='"'.concat(n.value.replace(h,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}),'"'),n.datatype.value===i?n.language&&(u+="@".concat(n.language)):n.datatype.value!==r&&(u+="^^<".concat(n.datatype.value,">"))),s.termType===o?u+=" <".concat(s.value,">"):s.termType===a&&(u+=" ".concat(s.value)),u+=" .\n"}},{key:"legacyDatasetToQuads",value:function(e){var t=[],n={"blank node":a,IRI:o,literal:s},c=function(c){e[c].forEach(function(e){var l={};for(var h in e){var f=e[h],d={termType:n[f.type],value:f.value};d.termType===s&&(d.datatype={termType:o},"datatype"in f&&(d.datatype.value=f.datatype),"language"in f?("datatype"in f||(d.datatype.value=i),d.language=f.language):"datatype"in f||(d.datatype.value=r)),l[h]=d}l.graph="@default"===c?{termType:u,value:""}:{termType:c.startsWith("_:")?a:o,value:c},t.push(l)})};for(var l in e)c(l);return t}}]),e}();var h=/["\\\n\r]/g,f=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(e,t,n){"use strict";t.exports=function(){function e(t){m(this,e),this.current=t.sort(),this.done=!1,this.dir=new Map;for(var n=0;ni)&&(u&&a>0&&s>e[a-1]||!u&&ae[a+1])&&(i=s,r=a)}if(null===i)this.done=!0;else{var c=t.get(i)?r-1:r+1;e[r]=e[c],e[c]=i;var l,h=_(e);try{for(h.s();!(l=h.n()).done;){var f=l.value;f>i&&t.set(f,!t.get(f))}}catch(d){h.e(d)}finally{h.f()}}return n}}]),e}()},{}],51:[function(e,t,n){(function(n){(function(){"use strict";var i=e("./IdentifierIssuer"),r=e("./MessageDigest"),o=e("./Permuter"),a=e("./NQuads");function s(e,t){return e.hasht.hash?1:0}t.exports=function(){function e(){m(this,e),this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}return b(e,[{key:"main",value:function(e){var t=this;return h(regeneratorRuntime.mark(function n(){var r,o,u,c,l,h,f,d,p,g,m,y,b,w,k,x,S,E,C,O,T,A,P,I,R,D,N,L,j,F,B,V,z,U,H,G;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:t.quads=e,r=_(e);try{for(r.s();!(o=r.n()).done;)u=o.value,t._addBlankNodeQuadInfo({quad:u,component:u.subject}),t._addBlankNodeQuadInfo({quad:u,component:u.object}),t._addBlankNodeQuadInfo({quad:u,component:u.graph})}catch(W){r.e(W)}finally{r.f()}c=new Map,l=v(t.blankNodeInfo.keys()),h=0,f=_(l),n.prev=6,f.s();case 8:if((d=f.n()).done){n.next=18;break}if(p=d.value,n.t0=++h%100==0,!n.t0){n.next=14;break}return n.next=14,t._yield();case 14:return n.next=16,t._hashAndTrackBlankNode({id:p,hashToBlankNodes:c});case 16:n.next=8;break;case 18:n.next=23;break;case 20:n.prev=20,n.t1=n.catch(6),f.e(n.t1);case 23:return n.prev=23,f.f(),n.finish(23);case 26:g=v(c.keys()).sort(),m=[],y=_(g);try{for(y.s();!(b=y.n()).done;)w=b.value,(k=c.get(w)).length>1?m.push(k):t.canonicalIssuer.getId(k[0])}catch(W){y.e(W)}finally{y.f()}x=0,S=m;case 30:if(!(xd)){i.next=31;break}return k=!0,i.abrupt("break",33);case 31:i.next=26;break;case 33:i.next=38;break;case 35:i.prev=35,i.t1=i.catch(24),x.e(i.t1);case 38:return i.prev=38,x.f(),i.finish(38);case 41:if(k){i.next=64;break}C=_(w),i.prev=43,C.s();case 45:if((O=C.n()).done){i.next=55;break}return T=O.value,i.next=49,n.hashNDegreeQuads(T,y);case 49:if(A=i.sent,b+=y.getId(T),b+="<".concat(A.hash,">"),y=A.issuer,!(0!==d.length&&b>d)){i.next=53;break}return k=!0,i.abrupt("break",55);case 53:i.next=45;break;case 55:i.next=60;break;case 57:i.prev=57,i.t2=i.catch(43),C.e(i.t2);case 60:return i.prev=60,C.f(),i.finish(60);case 63:k||(0===d.length||b")}},{key:"createHashToRelated",value:function(e,t){var n=this;return h(regeneratorRuntime.mark(function i(){var r,o,a,s,u,c;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:r=new Map,o=n.blankNodeInfo.get(e).quads,a=0,s=_(o),i.prev=3,s.s();case 5:if((u=s.n()).done){i.next=15;break}if(c=u.value,i.t0=++a%100==0,!i.t0){i.next=11;break}return i.next=11,n._yield();case 11:return i.next=13,Promise.all([n._addRelatedBlankNodeHash({quad:c,component:c.subject,position:"s",id:e,issuer:t,hashToRelated:r}),n._addRelatedBlankNodeHash({quad:c,component:c.object,position:"o",id:e,issuer:t,hashToRelated:r}),n._addRelatedBlankNodeHash({quad:c,component:c.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);case 13:i.next=5;break;case 15:i.next=20;break;case 17:i.prev=17,i.t1=i.catch(3),s.e(i.t1);case 20:return i.prev=20,s.f(),i.finish(20);case 23:return i.abrupt("return",r);case 24:case"end":return i.stop()}},i,null,[[3,17,20,23]])}))()}},{key:"_hashAndTrackBlankNode",value:function(e){var t=e.id,n=e.hashToBlankNodes,i=this;return h(regeneratorRuntime.mark(function e(){var r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.hashFirstDegreeQuads(t);case 2:r=e.sent,(o=n.get(r))?o.push(t):n.set(r,[t]);case 5:case"end":return e.stop()}},e)}))()}},{key:"_addBlankNodeQuadInfo",value:function(e){var t=e.quad,n=e.component;if("BlankNode"===n.termType){var i=n.value,r=this.blankNodeInfo.get(i);r?r.quads.add(t):this.blankNodeInfo.set(i,{quads:new Set([t]),hash:null})}}},{key:"_addRelatedBlankNodeHash",value:function(e){var t=e.quad,n=e.component,i=e.position,r=e.id,o=e.issuer,a=e.hashToRelated,s=this;return h(regeneratorRuntime.mark(function e(){var u,c,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("BlankNode"===n.termType&&n.value!==r){e.next=2;break}return e.abrupt("return");case 2:return u=n.value,e.next=5,s.hashRelatedBlankNode(u,t,o,i);case 5:c=e.sent,(l=a.get(c))?l.push(u):a.set(c,[u]);case 8:case"end":return e.stop()}},e)}))()}},{key:"_useCanonicalId",value:function(e){var t=e.component;return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}},{key:"_yield",value:function(){return h(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){return n(e)}));case 1:case"end":return e.stop()}},e)}))()}}]),e}()}).call(this)}).call(this,e("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(e,t,n){"use strict";var i=e("./IdentifierIssuer"),r=e("./MessageDigest"),o=e("./Permuter"),a=e("./NQuads");function s(e,t){return e.hasht.hash?1:0}t.exports=function(){function e(){m(this,e),this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}return b(e,[{key:"main",value:function(e){this.quads=e;var t,n=_(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this._addBlankNodeQuadInfo({quad:r,component:r.subject}),this._addBlankNodeQuadInfo({quad:r,component:r.object}),this._addBlankNodeQuadInfo({quad:r,component:r.graph})}}catch(j){n.e(j)}finally{n.f()}var o,u=new Map,c=_(v(this.blankNodeInfo.keys()));try{for(c.s();!(o=c.n()).done;){var l=o.value;this._hashAndTrackBlankNode({id:l,hashToBlankNodes:u})}}catch(j){c.e(j)}finally{c.f()}var h,f=[],d=_(v(u.keys()).sort());try{for(d.s();!(h=d.n()).done;){var p=h.value,g=u.get(p);g.length>1?f.push(g):this.canonicalIssuer.getId(g[0])}}catch(j){d.e(j)}finally{d.f()}for(var m=0,y=f;ml){y=!0;break}}}catch(C){b.e(C)}finally{b.f()}if(!y){var k,x=_(m);try{for(x.s();!(k=x.n()).done;){var S=k.value,E=this.hashNDegreeQuads(S,p);if(g+=p.getId(S),g+="<".concat(E.hash,">"),p=E.issuer,0!==l.length&&g>l){y=!0;break}}}catch(C){x.e(C)}finally{x.f()}y||(0===l.length||g")}},{key:"createHashToRelated",value:function(e,t){var n,i=new Map,r=_(this.blankNodeInfo.get(e).quads);try{for(r.s();!(n=r.n()).done;){var o=n.value;this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:i}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:i}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:i})}}catch(a){r.e(a)}finally{r.f()}return i}},{key:"_hashAndTrackBlankNode",value:function(e){var t=e.id,n=e.hashToBlankNodes,i=this.hashFirstDegreeQuads(t),r=n.get(i);r?r.push(t):n.set(i,[t])}},{key:"_addBlankNodeQuadInfo",value:function(e){var t=e.quad,n=e.component;if("BlankNode"===n.termType){var i=n.value,r=this.blankNodeInfo.get(i);r?r.quads.add(t):this.blankNodeInfo.set(i,{quads:new Set([t]),hash:null})}}},{key:"_addRelatedBlankNodeHash",value:function(e){var t=e.quad,n=e.component,i=e.position,r=e.id,o=e.issuer,a=e.hashToRelated;if("BlankNode"===n.termType&&n.value!==r){var s=n.value,u=this.hashRelatedBlankNode(s,t,o,i),c=a.get(u);c?c.push(s):a.set(u,[s])}}},{key:"_useCanonicalId",value:function(e){var t=e.component;return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}]),e}()},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(e,t,n){"use strict";var i=e("./URDNA2015");t.exports=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.call(this)).name="URGNA2012",e.hashAlgorithm="sha1",e}return b(n,[{key:"modifyFirstDegreeComponent",value:function(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}},{key:"getRelatedPredicate",value:function(e){return e.predicate.value}},{key:"createHashToRelated",value:function(e,t){var n=this;return h(regeneratorRuntime.mark(function i(){var r,o,a,s,u,c,l,h,f,d;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:r=new Map,o=n.blankNodeInfo.get(e).quads,a=0,s=_(o),i.prev=3,s.s();case 5:if((u=s.n()).done){i.next=26;break}if(c=u.value,l=void 0,h=void 0,"BlankNode"!==c.subject.termType||c.subject.value===e){i.next=12;break}h=c.subject.value,l="p",i.next=15;break;case 12:if("BlankNode"===c.object.termType&&c.object.value!==e){i.next=14;break}return i.abrupt("continue",24);case 14:h=c.object.value,l="r";case 15:if(i.t0=++a%100==0,!i.t0){i.next=19;break}return i.next=19,n._yield();case 19:return i.next=21,n.hashRelatedBlankNode(h,c,t,l);case 21:f=i.sent,(d=r.get(f))?d.push(h):r.set(f,[h]);case 24:i.next=5;break;case 26:i.next=31;break;case 28:i.prev=28,i.t1=i.catch(3),s.e(i.t1);case 31:return i.prev=31,s.f(),i.finish(31);case 34:return i.abrupt("return",r);case 35:case"end":return i.stop()}},i,null,[[3,28,31,34]])}))()}}]),n}(i)},{"./URDNA2015":51}],54:[function(e,t,n){"use strict";var i=e("./URDNA2015Sync");t.exports=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.call(this)).name="URGNA2012",e.hashAlgorithm="sha1",e}return b(n,[{key:"modifyFirstDegreeComponent",value:function(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}},{key:"getRelatedPredicate",value:function(e){return e.predicate.value}},{key:"createHashToRelated",value:function(e,t){var n,i=new Map,r=_(this.blankNodeInfo.get(e).quads);try{for(r.s();!(n=r.n()).done;){var o=n.value,a=void 0,s=void 0;if("BlankNode"===o.subject.termType&&o.subject.value!==e)s=o.subject.value,a="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;s=o.object.value,a="r"}var u=this.hashRelatedBlankNode(s,o,t,a),c=i.get(u);c?c.push(s):i.set(u,[s])}}catch(l){r.e(l)}finally{r.f()}return i}}]),n}(i)},{"./URDNA2015Sync":52}],55:[function(e,t,n){"use strict";var i,r=e("./URDNA2015"),o=e("./URGNA2012"),a=e("./URDNA2015Sync"),s=e("./URGNA2012Sync");try{i=e("rdf-canonize-native")}catch(u){}var u,c={};t.exports=c,c.NQuads=e("./NQuads"),c.IdentifierIssuer=e("./IdentifierIssuer"),c._rdfCanonizeNative=function(e){return e&&(i=e),i},c.canonize=(u=h(regeneratorRuntime.mark(function e(t,n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),!n.useNative){e.next=4;break}if(i){e.next=3;break}throw new Error("rdf-canonize-native not available");case 3:return e.abrupt("return",new Promise(function(e,r){return i.canonize(t,n,function(t,n){return t?r(t):e(n)})}));case 4:if("URDNA2015"!==n.algorithm){e.next=6;break}return e.abrupt("return",new r(n).main(t));case 6:if("URGNA2012"!==n.algorithm){e.next=8;break}return e.abrupt("return",new o(n).main(t));case 8:throw"algorithm"in n?new Error("Invalid RDF Dataset Canonicalization algorithm: "+n.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.");case 9:case"end":return e.stop()}},e)})),function(e,t){return u.apply(this,arguments)}),c._canonizeSync=function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(i)return i.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new a(t).main(e);if("URGNA2012"===t.algorithm)return new s(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(e("./lib/BlankNode"),n),r(e("./lib/DataFactory"),n),r(e("./lib/DefaultGraph"),n),r(e("./lib/Literal"),n),r(e("./lib/NamedNode"),n),r(e("./lib/Quad"),n),r(e("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0,n.BlankNode=function(){function e(t){m(this,e),this.termType="BlankNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}]),e}()},{}],58:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;var i=e("./BlankNode"),r=e("./DefaultGraph"),o=e("./Literal"),a=e("./NamedNode"),s=e("./Quad"),u=e("./Variable"),c=0;n.DataFactory=function(){function e(t){m(this,e),this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||"df_".concat(c++,"_")}return b(e,[{key:"namedNode",value:function(e){return new a.NamedNode(e)}},{key:"blankNode",value:function(e){return new i.BlankNode(e||"".concat(this.blankNodePrefix).concat(this.blankNodeCounter++))}},{key:"literal",value:function(e,t){return new o.Literal(e,t)}},{key:"variable",value:function(e){return new u.Variable(e)}},{key:"defaultGraph",value:function(){return r.DefaultGraph.INSTANCE}},{key:"quad",value:function(e,t,n,i){return new s.Quad(e,t,n,i||this.defaultGraph())}},{key:"fromTerm",value:function(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(o.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}},{key:"fromQuad",value:function(e){return this.fromTerm(e)}},{key:"resetBlankNodeCounter",value:function(){this.blankNodeCounter=0}}]),e}()},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;var i=function(){function e(){m(this,e),this.termType="DefaultGraph",this.value=""}return b(e,[{key:"equals",value:function(e){return!!e&&"DefaultGraph"===e.termType}}]),e}();n.DefaultGraph=i,i.INSTANCE=new i},{}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;var i=e("./NamedNode"),r=function(){function e(t,n){m(this,e),this.termType="Literal",this.value=t,"string"==typeof n?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING):n?(this.language="",this.datatype=n):(this.language="",this.datatype=e.XSD_STRING)}return b(e,[{key:"equals",value:function(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}]),e}();n.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0,n.NamedNode=function(){function e(t){m(this,e),this.termType="NamedNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}]),e}()},{}],62:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0,n.Quad=function(){function e(t,n,i,r){m(this,e),this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=i,this.graph=r}return b(e,[{key:"equals",value:function(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}]),e}()},{}],63:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0,n.Variable=function(){function e(t){m(this,e),this.termType="Variable",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}]),e}()},{}],64:[function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(e("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;var i=function(e){a(n,e);var t=s(n);function n(e,i){m(this,n);var r=e.saxStream._parser;return t.call(this,e.trackPosition?"Line ".concat(r.line+1," column ").concat(r.column+1,": ").concat(i):i)}return n}(l(Error));n.ParseError=i},{}],66:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;var i,r,o=e("relative-to-absolute-iri"),u=e("sax"),l=e("stream"),h=e("./ParseError"),f=e("rdf-data-factory"),d=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,{readableObjectMode:!0})).activeTagStack=[],i.nodeIds={},e&&(Object.assign(c(i),e),i.options=e),i.dataFactory||(i.dataFactory=new f.DataFactory),i.baseIRI||(i.baseIRI=""),i.defaultGraph||(i.defaultGraph=i.dataFactory.defaultGraph()),i.saxStream=u.createStream(i.strict,{xmlns:!1,position:i.trackPosition}),i.strict||(i.saxStream._parser.looseCase="toString"),i.attachSaxListeners(),i}return b(n,[{key:"import",value:function(e){var t=new l.PassThrough({readableObjectMode:!0});e.on("error",function(e){return i.emit("error",e)}),e.on("data",function(e){return t.push(e)}),e.on("end",function(){return t.push(null)});var i=t.pipe(new n(this.options));return i}},{key:"_transform",value:function(e,t,n){try{this.saxStream.write(e,t)}catch(i){return n(i)}n()}},{key:"newParseError",value:function(e){return new h.ParseError(this,e)}},{key:"valueToUri",value:function(e,t){return this.uriToNamedNode(o.resolve(e,t.baseIRI))}},{key:"uriToNamedNode",value:function(e){if(!n.isValidIri(e))throw this.newParseError("Invalid URI: ".concat(e));return this.dataFactory.namedNode(e)}},{key:"validateNcname",value:function(e){if(!n.NCNAME_MATCHER.test(e))throw this.newParseError("Not a valid NCName: ".concat(e))}},{key:"attachSaxListeners",value:function(){var e=this;this.saxStream.on("error",function(t){return e.emit("error",t)}),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}},{key:"onTag",value:function(e){var t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null,r=i.RESOURCE;if(t&&(t.hadChildren=!0,r=t.childrenParseType),t&&t.childrenStringTags){var o=e.name,a="";for(var s in e.attributes)a+=" ".concat(s,'="').concat(e.attributes[s],'"');t.childrenStringTags.push("<".concat(o).concat(a,">"));var u={childrenStringTags:t.childrenStringTags};return u.childrenStringEmitClosingTag=""),void this.activeTagStack.push(u)}var c={};t?(c.language=t.language,c.baseIRI=t.baseIRI):c.baseIRI=this.baseIRI,this.activeTagStack.push(c),c.ns=n.parseNamespace(e,t),r===i.RESOURCE?this.onTagResource(e,c,t,!t):this.onTagProperty(e,c,t)}},{key:"onTagResource",value:function(e,t,r,a){var s=n.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=i.PROPERTY;var u=!0;if(s.uri===n.RDF){if(!a&&n.FORBIDDEN_NODE_ELEMENTS.indexOf(s.local)>=0)throw this.newParseError("Illegal node element name: ".concat(s.local));switch(s.local){case"RDF":t.childrenParseType=i.RESOURCE;case"Description":u=!1}}var c=[],l=[],h=null,f=!1,d=!1,p=null;for(var v in e.attributes){var g=e.attributes[v],m=n.expandPrefixedTerm(v,t.ns,this);if(r&&m.uri===n.RDF)switch(m.local){case"about":if(h)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(h," where found."));h=g;continue;case"ID":if(h)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(h," where found."));this.validateNcname(g),h="#"+g,f=!0;continue;case"nodeID":if(h)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(h," where found."));this.validateNcname(g),h=g,d=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=g;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===n.XML){if("lang"===m.local){t.language=""===g?null:g.toLowerCase();continue}if("base"===m.local){t.baseIRI=o.resolve(g,t.baseIRI);continue}}"xml"!==m.prefix&&m.uri&&(c.push(this.uriToNamedNode(m.uri+m.local)),l.push(g))}if(null!==h&&(t.subject=d?this.dataFactory.blankNode(h):this.valueToUri(h,t),f&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),u){var y=this.uriToNamedNode(s.uri+s.local);this.emitTriple(t.subject,this.dataFactory.namedNode(n.RDF+"type"),y,r?r.reifiedStatementId:null)}if(r){if(r.predicate)if(r.childrenCollectionSubject){var b=this.dataFactory.blankNode();this.emitTriple(r.childrenCollectionSubject,r.childrenCollectionPredicate,b,r.reifiedStatementId),this.emitTriple(b,this.dataFactory.namedNode(n.RDF+"first"),t.subject,t.reifiedStatementId),r.childrenCollectionSubject=b,r.childrenCollectionPredicate=this.dataFactory.namedNode(n.RDF+"rest")}else{this.emitTriple(r.subject,r.predicate,t.subject,r.reifiedStatementId);for(var _=0;_=0)throw this.newParseError("Illegal property element name: ".concat(o.local));t.predicateSubPredicates=[],t.predicateSubObjects=[];var a=!1,s=!1,u=null,c=!0,l=[],h=[];for(var f in e.attributes){var d=e.attributes[f],p=n.expandPrefixedTerm(f,t.ns,this);if(p.uri===n.RDF)switch(p.local){case"resource":if(u)throw this.newParseError("Found both rdf:resource (".concat(d,") and rdf:nodeID (").concat(u,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:resource (".concat(d,")"));t.hadChildren=!0,u=d,c=!1;continue;case"datatype":if(s)throw this.newParseError("Found both non-rdf:* property attributes and rdf:datatype (".concat(d,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(d,")"));t.datatype=this.valueToUri(d,t);continue;case"nodeID":if(s)throw this.newParseError("Found both non-rdf:* property attributes and rdf:nodeID (".concat(d,")."));if(t.hadChildren)throw this.newParseError("Found both rdf:resource and rdf:nodeID (".concat(d,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID (".concat(d,")"));this.validateNcname(d),t.hadChildren=!0,u=d,c=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(s)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(t.datatype.value,")"));if(u)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (".concat(u,")"));if("Resource"===d){a=!0,t.childrenParseType=i.PROPERTY;var v=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,v,t.reifiedStatementId),t.subject=v,t.predicate=null}else"Collection"===d?(a=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,c=!1):"Literal"===d&&(a=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(d),t.reifiedStatementId=this.valueToUri("#"+d,t),this.claimNodeId(t.reifiedStatementId);continue}else if(p.uri===n.XML&&"lang"===p.local){t.language=""===d?null:d.toLowerCase();continue}if("xml"!==p.prefix&&"xmlns"!==p.prefix&&p.uri){if(a||t.datatype)throw this.newParseError("Found illegal rdf:* properties on property element with attribute: ".concat(d));t.hadChildren=!0,s=!0,l.push(this.uriToNamedNode(p.uri+p.local)),h.push(this.dataFactory.literal(d,t.datatype||t.language))}}if(null!==u){var g=t.subject;t.subject=c?this.dataFactory.blankNode(u):this.valueToUri(u,t),this.emitTriple(g,t.predicate,t.subject,t.reifiedStatementId);for(var m=0;m/g,function(e,n,i){return t.saxStream._parser.ENTITIES[n]=i,""})}}],[{key:"parseNamespace",value:function(e,t){var i={},r=!1;for(var o in e.attributes)o.startsWith("xmlns")&&(5===o.length?(r=!0,i[""]=e.attributes[o]):":"===o.charAt(5)&&(r=!0,i[o.substr(6)]=e.attributes[o]));var a=t&&t.ns?t.ns:[n.DEFAULT_NS];return r?a.concat([i]):a}},{key:"expandPrefixedTerm",value:function(e,t,n){var i,r,o=e.indexOf(":");o>=0?(i=e.substr(0,o),r=e.substr(o+1)):(i="",r=e);for(var a=null,s=null,u=t.length-1;u>=0;u--){var c=t[u][i];if(c){a=c;break}s||(s=t[u][""])}if(!a){if(i&&"xmlns"!==i)throw new h.ParseError(n,"The prefix '".concat(i,"' in term '").concat(e,"' was not bound."));a=s||""}return{prefix:i,local:r,uri:a}}},{key:"isValidIri",value:function(e){return n.IRI_REGEX.test(e)}}]),n}(l.Transform);n.RdfXmlParser=d,d.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,d.MIME_TYPE="application/rdf+xml",d.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",d.XML="http://www.w3.org/XML/1998/namespace",d.XMLNS="http://www.w3.org/2000/xmlns/",d.DEFAULT_NS={xml:d.XML},d.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],d.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],d.NCNAME_MATCHER=/^((?:[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]))((?:[#\x2D\.0-9A-Z_a-z\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]))*$/,(r=i=n.ParseType||(n.ParseType={}))[r.RESOURCE=0]="RESOURCE",r[r.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(e,t,n){"use strict";var i={};function r(e,t,n){n||(n=Error);var r=function(e){function n(n,i,r){return e.call(this,function(e,n,i){return"string"==typeof t?t:t(e,n,i)}(n,i,r))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(n,e),n}(n);r.prototype.name=n.name,r.prototype.code=e,i[e]=r}function o(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,n){var i,r;if("string"==typeof t&&function(e,t,n){return e.substr(0,t.length)===t}(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))r="The ".concat(e," ").concat(i," ").concat(o(t,"type"));else{var a=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";r='The "'.concat(e,'" ').concat(a," ").concat(i," ").concat(o(t,"type"))}return r+". Received type ".concat(typeof n)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],68:[function(e,t,n){(function(n){(function(){"use strict";var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var r=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(c,r);for(var a=i(o.prototype),s=0;s0)if("string"!=typeof t&&!s.objectMode&&Object.getPrototypeOf(t)!==u.prototype&&(t=function(e){return u.from(e)}(t)),i)s.endEmitted?k(e,new w):O(e,s,t,!0);else if(s.ended)k(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?O(e,s,t,!1):I(e,s)):O(e,s,t,!1)}else i||(s.reading=!1,I(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function P(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(M,e))}function M(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function I(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){o("readable nexttick read 0"),e.read(0)}function L(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(V,t,e))}function V(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function z(e,t){for(var n=0,i=e.length;n=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):P(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&B(this),null;var i,r=t.needReadable;return o("need readable",r),(0===t.length||t.length-e0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),null!==i&&this.emit("data",i),i},E.prototype._read=function(e){k(this,new _("_read()"))},E.prototype.pipe=function(e,t){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,o("pipe count=%d opts=%j",r.pipesCount,t);var s=t&&!1===t.end||e===n.stdout||e===n.stderr?v:u;function u(){o("onend"),e.end()}r.endEmitted?n.nextTick(s):i.once("end",s),e.on("unpipe",function t(n,a){o("onunpipe"),n===i&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),i.removeListener("end",u),i.removeListener("end",v),i.removeListener("data",h),l=!0,r.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c())});var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,j(e))}}(i);e.on("drain",c);var l=!1;function h(t){o("ondata");var n=e.write(t);o("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==z(r.pipes,e))&&!l&&(o("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function f(t){o("onerror",t),v(),e.removeListener("error",f),0===a(e,"error")&&k(e,t)}function d(){e.removeListener("finish",p),v()}function p(){o("onfinish"),e.removeListener("close",d),v()}function v(){o("unpipe"),i.unpipe(e)}return i.on("data",h),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",f),e.once("close",d),e.once("finish",p),e.emit("pipe",i),r.flowing||(o("pipe resume"),i.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var i=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==r.flowing&&this.resume()):"readable"===e&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,o("on readable",r.length,r.reading),r.length?P(this):r.reading||n.nextTick(N,this)),i},E.prototype.removeListener=function(e,t){var i=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(D,this),i},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(D,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(L,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,n=this._readableState,i=!1;for(var r in e.on("end",function(){if(o("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(r){o("wrapped data"),n.decoder&&(r=n.decoder.write(r)),n.objectMode&&null==r||!(n.objectMode||r&&r.length)||t.push(r)||(i=!0,e.pause())}),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var a=0;a-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,n){n(new v("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,i){var r=this._writableState;return"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,i){t.ending=!0,M(e,t),i&&(t.finished?n.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}(this,r,i),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}}),E.prototype.destroy=h.destroy,E.prototype._undestroy=h.undestroy,E.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(e,t,n){(function(n){(function(){"use strict";var i;function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=e("./end-of-stream"),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),f=Symbol("stream");function d(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[f].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(d(n,!1)))}}function v(e){n.nextTick(p,e)}var g=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((r(i={get stream(){return this[f]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(d(void 0,!0));if(this[f].destroyed)return new Promise(function(t,i){n.nextTick(function(){e[u]?i(e[u]):t(d(void 0,!0))})});var i,r=this[l];if(r)i=new Promise(function(e,t){return function(n,i){e.then(function(){t[c]?n(d(void 0,!0)):t[h](n,i)},i)}}(r,this));else{var o=this[f].read();if(null!==o)return Promise.resolve(d(o,!1));i=new Promise(this[h])}return this[l]=i,i}},Symbol.asyncIterator,function(){return this}),r(i,"return",function(){var e=this;return new Promise(function(t,n){e[f].destroy(null,function(e){e?n(e):t(d(void 0,!0))})})}),i),g);t.exports=function(e){var t,n=Object.create(m,(r(t={},f,{value:e,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,u,{value:null,writable:!0}),r(t,c,{value:e._readableState.endEmitted,writable:!0}),r(t,h,{value:function(e,t){var i=n[f].read();i?(n[l]=null,n[a]=null,n[s]=null,e(d(i,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[l]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[l]=null,n[a]=null,n[s]=null,t(e)),void(n[u]=e)}var i=n[a];null!==i&&(n[l]=null,n[a]=null,n[s]=null,i(d(void 0,!0))),n[c]=!0}),e.on("readable",v.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":76,_process:44}],74:[function(e,t,n){"use strict";function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),n=this.head,i=0;n;)c(n.data,t,i),i+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return er.length?r.length:e;if(i+=o===r.length?r:r.slice(0,e),0==(e-=o)){o===r.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=r.slice(o));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,i=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var r=n.data,o=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,o),0==(e-=o)){o===r.length?(++i,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=r.slice(o));break}++i}return this.length-=i,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t0,function(e){r||(r=e),e&&a.forEach(c),!o&&(a.forEach(c),i(r))})});return t.reduce(l)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(e,t,n){"use strict";var i=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,r){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,r,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new i(r?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":67}],80:[function(e,t,n){t.exports=e("events").EventEmitter},{events:8}],81:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(e,t,n){"use strict";function i(e){for(var t=[],n=0;n=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);var r=e.indexOf("/",n);return r<0?e:e.substr(0,r)+i(e.substr(r))}function o(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(e,t){var n=(t=t||"").indexOf("#");if(n>0&&(t=t.substr(0,n)),!e.length){if(t.indexOf(":")<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));return t}if(e.startsWith("?")){var o=t.indexOf("?");return o>0&&(t=t.substr(0,o)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){var a=e.indexOf(":");if(a<0)throw new Error("Found invalid relative IRI '".concat(e,"' for a missing baseIRI"));return r(e,a)}var s=e.indexOf(":");if(s>=0)return r(e,s);var u=t.indexOf(":");if(u<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));var c,l=t.substr(0,u+1);if(0===e.indexOf("//"))return l+r(e,s);if(t.indexOf("//",u)===u+1){if((c=t.indexOf("/",u+3))<0)return t.length>u+3?t+"/"+r(e,s):l+r(e,s)}else if((c=t.indexOf("/",u+1))<0)return l+r(e,s);if(0===e.indexOf("/"))return t.substr(0,c)+i(e);var h=t.substr(c),f=h.lastIndexOf("/");return f>=0&&f"===o?(C(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=x.TEXT):(g(o)&&(t.state=x.SGML_DECL_QUOTED),t.sgmlDecl+=o);continue;case x.SGML_DECL_QUOTED:o===t.q&&(t.state=x.SGML_DECL,t.q=""),t.sgmlDecl+=o;continue;case x.DOCTYPE:">"===o?(t.state=x.TEXT,C(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=o,"["===o?t.state=x.DOCTYPE_DTD:g(o)&&(t.state=x.DOCTYPE_QUOTED,t.q=o));continue;case x.DOCTYPE_QUOTED:t.doctype+=o,o===t.q&&(t.q="",t.state=x.DOCTYPE);continue;case x.DOCTYPE_DTD:t.doctype+=o,"]"===o?t.state=x.DOCTYPE:g(o)&&(t.state=x.DOCTYPE_DTD_QUOTED,t.q=o);continue;case x.DOCTYPE_DTD_QUOTED:t.doctype+=o,o===t.q&&(t.state=x.DOCTYPE_DTD,t.q="");continue;case x.COMMENT:"-"===o?t.state=x.COMMENT_ENDING:t.comment+=o;continue;case x.COMMENT_ENDING:"-"===o?(t.state=x.COMMENT_ENDED,t.comment=T(t.opt,t.comment),t.comment&&C(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+o,t.state=x.COMMENT);continue;case x.COMMENT_ENDED:">"!==o?(M(t,"Malformed comment"),t.comment+="--"+o,t.state=x.COMMENT):t.state=x.TEXT;continue;case x.CDATA:"]"===o?t.state=x.CDATA_ENDING:t.cdata+=o;continue;case x.CDATA_ENDING:"]"===o?t.state=x.CDATA_ENDING_2:(t.cdata+="]"+o,t.state=x.CDATA);continue;case x.CDATA_ENDING_2:">"===o?(t.cdata&&C(t,"oncdata",t.cdata),C(t,"onclosecdata"),t.cdata="",t.state=x.TEXT):"]"===o?t.cdata+="]":(t.cdata+="]]"+o,t.state=x.CDATA);continue;case x.PROC_INST:"?"===o?t.state=x.PROC_INST_ENDING:v(o)?t.state=x.PROC_INST_BODY:t.procInstName+=o;continue;case x.PROC_INST_BODY:if(!t.procInstBody&&v(o))continue;"?"===o?t.state=x.PROC_INST_ENDING:t.procInstBody+=o;continue;case x.PROC_INST_ENDING:">"===o?(C(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=x.TEXT):(t.procInstBody+="?"+o,t.state=x.PROC_INST_BODY);continue;case x.OPEN_TAG:y(f,o)?t.tagName+=o:(I(t),">"===o?N(t):"/"===o?t.state=x.OPEN_TAG_SLASH:(v(o)||M(t,"Invalid character in tag name"),t.state=x.ATTRIB));continue;case x.OPEN_TAG_SLASH:">"===o?(N(t,!0),L(t)):(M(t,"Forward-slash in opening tag not followed by >"),t.state=x.ATTRIB);continue;case x.ATTRIB:if(v(o))continue;">"===o?N(t):"/"===o?t.state=x.OPEN_TAG_SLASH:y(h,o)?(t.attribName=o,t.attribValue="",t.state=x.ATTRIB_NAME):M(t,"Invalid attribute name");continue;case x.ATTRIB_NAME:"="===o?t.state=x.ATTRIB_VALUE:">"===o?(M(t,"Attribute without value"),t.attribValue=t.attribName,D(t),N(t)):v(o)?t.state=x.ATTRIB_NAME_SAW_WHITE:y(f,o)?t.attribName+=o:M(t,"Invalid attribute name");continue;case x.ATTRIB_NAME_SAW_WHITE:if("="===o)t.state=x.ATTRIB_VALUE;else{if(v(o))continue;M(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",C(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===o?N(t):y(h,o)?(t.attribName=o,t.state=x.ATTRIB_NAME):(M(t,"Invalid attribute name"),t.state=x.ATTRIB)}continue;case x.ATTRIB_VALUE:if(v(o))continue;g(o)?(t.q=o,t.state=x.ATTRIB_VALUE_QUOTED):(M(t,"Unquoted attribute value"),t.state=x.ATTRIB_VALUE_UNQUOTED,t.attribValue=o);continue;case x.ATTRIB_VALUE_QUOTED:if(o!==t.q){"&"===o?t.state=x.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=o;continue}D(t),t.q="",t.state=x.ATTRIB_VALUE_CLOSED;continue;case x.ATTRIB_VALUE_CLOSED:v(o)?t.state=x.ATTRIB:">"===o?N(t):"/"===o?t.state=x.OPEN_TAG_SLASH:y(h,o)?(M(t,"No whitespace between attributes"),t.attribName=o,t.attribValue="",t.state=x.ATTRIB_NAME):M(t,"Invalid attribute name");continue;case x.ATTRIB_VALUE_UNQUOTED:if(!m(o)){"&"===o?t.state=x.ATTRIB_VALUE_ENTITY_U:t.attribValue+=o;continue}D(t),">"===o?N(t):t.state=x.ATTRIB;continue;case x.CLOSE_TAG:if(t.tagName)">"===o?L(t):y(f,o)?t.tagName+=o:t.script?(t.script+=""===o?L(t):M(t,"Invalid characters in closing tag");continue;case x.TEXT_ENTITY:case x.ATTRIB_VALUE_ENTITY_Q:case x.ATTRIB_VALUE_ENTITY_U:var s,u;switch(t.state){case x.TEXT_ENTITY:s=x.TEXT,u="textNode";break;case x.ATTRIB_VALUE_ENTITY_Q:s=x.ATTRIB_VALUE_QUOTED,u="attribValue";break;case x.ATTRIB_VALUE_ENTITY_U:s=x.ATTRIB_VALUE_UNQUOTED,u="attribValue"}";"===o?(t[u]+=j(t),t.entity="",t.state=s):y(t.entity.length?p:d,o)?t.entity+=o:(M(t,"Invalid character in entity name"),t[u]+="&"+t.entity+o,t.entity="",t.state=s);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&function(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),i=0,o=0,a=r.length;ot)switch(r[o]){case"textNode":O(e);break;case"cdata":C(e,"oncdata",e.cdata),e.cdata="";break;case"script":C(e,"onscript",e.script),e.script="";break;default:A(e,"Max buffer length exceeded: "+r[o])}i=Math.max(i,s)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-i+e.position}(t),t},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(e){O(e),""!==e.cdata&&(C(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(C(e,"onscript",e.script),e.script="")}(this)}};try{i=e("stream").Stream}catch(_){i=function(){}}var a=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function s(e,t){if(!(this instanceof s))return new s(e,t);i.apply(this),this._parser=new o(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,a.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})})}(s.prototype=Object.create(i.prototype,{constructor:{value:s}})).write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var i=e("string_decoder").StringDecoder;this._decoder=new i("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var n=this;return!n._parser["on"+e]&&-1!==a.indexOf(e)&&(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),i.prototype.on.call(n,e,t)};var u="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",l={xml:u,xmlns:c},h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function v(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function g(e){return'"'===e||"'"===e}function m(e){return">"===e||v(e)}function y(e,t){return e.test(t)}function b(e,t){return!y(e,t)}var _,w,k,x=0;for(var S in n.STATE={BEGIN:x++,BEGIN_WHITESPACE:x++,TEXT:x++,TEXT_ENTITY:x++,OPEN_WAKA:x++,SGML_DECL:x++,SGML_DECL_QUOTED:x++,DOCTYPE:x++,DOCTYPE_QUOTED:x++,DOCTYPE_DTD:x++,DOCTYPE_DTD_QUOTED:x++,COMMENT_STARTING:x++,COMMENT:x++,COMMENT_ENDING:x++,COMMENT_ENDED:x++,CDATA:x++,CDATA_ENDING:x++,CDATA_ENDING_2:x++,PROC_INST:x++,PROC_INST_BODY:x++,PROC_INST_ENDING:x++,OPEN_TAG:x++,OPEN_TAG_SLASH:x++,ATTRIB:x++,ATTRIB_NAME:x++,ATTRIB_NAME_SAW_WHITE:x++,ATTRIB_VALUE:x++,ATTRIB_VALUE_QUOTED:x++,ATTRIB_VALUE_CLOSED:x++,ATTRIB_VALUE_UNQUOTED:x++,ATTRIB_VALUE_ENTITY_Q:x++,ATTRIB_VALUE_ENTITY_U:x++,CLOSE_TAG:x++,CLOSE_TAG_SAW_WHITE:x++,SCRIPT:x++,SCRIPT_ENDING:x++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],i="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=i}),n.STATE)n.STATE[n.STATE[S]]=S;function E(e,t,n){e[t]&&e[t](n)}function C(e,t,n){e.textNode&&O(e),E(e,t,n)}function O(e){e.textNode=T(e.opt,e.textNode),e.textNode&&E(e,"ontext",e.textNode),e.textNode=""}function T(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function A(e,t){return O(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,E(e,"onerror",t),e}function P(e){return e.sawRoot&&!e.closedRoot&&M(e,"Unclosed root tag"),e.state!==x.BEGIN&&e.state!==x.BEGIN_WHITESPACE&&e.state!==x.TEXT&&A(e,"Unexpected end"),O(e),e.c="",e.closed=!0,E(e,"onend"),o.call(e,e.strict,e.opt),e}function M(e,t){if("object"!=typeof e||!(e instanceof o))throw new Error("bad call to strictFail");e.strict&&A(e,t)}function I(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,C(e,"onopentagstart",n)}function R(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),i=n[0],r=n[1];return t&&"xmlns"===e&&(i="xmlns",r=""),{prefix:i,local:r}}function D(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=R(e.attribName,!0),n=t.local;if("xmlns"===t.prefix)if("xml"===n&&e.attribValue!==u)M(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==c)M(e,"xmlns: prefix must be bound to "+c+"\nActual: "+e.attribValue);else{var i=e.tag,r=e.tags[e.tags.length-1]||e;i.ns===r.ns&&(i.ns=Object.create(r.ns)),i.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,C(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function N(e,t){if(e.opt.xmlns){var n=e.tag,i=R(e.tagName);n.prefix=i.prefix,n.local=i.local,n.uri=n.ns[i.prefix]||"",n.prefix&&!n.uri&&(M(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=i.prefix),n.ns&&(e.tags[e.tags.length-1]||e).ns!==n.ns&&Object.keys(n.ns).forEach(function(t){C(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var r=0,o=e.attribList.length;r",e.tagName="",void(e.state=x.SCRIPT);C(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var i=n;t--&&e.tags[t].name!==i;)M(e,"Unexpected close tag");if(t<0)return M(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=x.TEXT);e.tagName=n;for(var r=e.tags.length;r-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,C(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];e.opt.xmlns&&o.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(o.ns).forEach(function(t){C(e,"onclosenamespace",{prefix:t,uri:o.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=x.TEXT}function j(e){var t,n=e.entity,i=n.toLowerCase(),r="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[i]?e.ENTITIES[i]:("#"===(n=i).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),r=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),r=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||r.toLowerCase()!==n?(M(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function F(e,t){"<"===t?(e.state=x.OPEN_WAKA,e.startTagPosition=e.position):v(t)||(M(e,"Non-whitespace before first tag."),e.textNode=t,e.state=x.TEXT)}function B(e,t){var n="";return t1114111||w(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?t.push(o):t.push(55296+((o-=65536)>>10),o%1024+56320),(n+1===i||t.length>e)&&(r+=_.apply(null,t),t.length=0)}return r},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:k,configurable:!0,writable:!0}):String.fromCodePoint=k)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,e("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(e,t,n){(function(e,t){(function(){!function(t,n){"use strict";if(!t.setImmediate){var i,r=1,o={},a=!1,s=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){f(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(c="setImmediate$"+Math.random()+"$",l=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(c)&&f(+e.data.slice(c.length))},t.addEventListener?t.addEventListener("message",l,!1):t.attachEvent("onmessage",l),i=function(e){t.postMessage(c+e,"*")}):t.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){f(e.data)},i=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;i=function(t){var n=s.createElement("script");n.onreadystatechange=function(){f(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():i=function(e){setTimeout(f,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=u++,i=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,r(function(){s[t]&&(i?e.apply(null,i):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof i?i:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(e,t,n){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(i){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(e,t,n){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}},e,this)})}},{}],92:[function(e,t,n){"use strict";function i(e){var t=this;if(t instanceof i||(t=new i),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=e(n,i.value,r),i=i.next;return n},i.prototype.reduceReverse=function(e,t){var n,i=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=e(n,i.value,r),i=i.prev;return n},i.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},i.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},i.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new i;if(tthis.length&&(t=this.length);for(var r=0,o=this.head;null!==o&&rthis.length&&(t=this.length);for(var r=this.length,o=this.tail;null!==o&&r>t;r--)o=o.prev;for(;null!==o&&r>e;r--,o=o.prev)n.push(o.value);return n},i.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n is not a method!");return{configurable:i.boolTrue,get:function(){var e=n.value.bind(this);return Object.defineProperty(this,t,{value:e,configurable:i.boolTrue,writable:i.boolTrue}),e}}}t.ak=r,t.ZP=r},97266:function(e,t,n){e.exports={ResizeSensor:n(69835),ElementQueries:n(54845)}},54845:function(e,t,n){"use strict";var i,r,o;"undefined"!=typeof window&&window,r=[n(69835)],void 0!==(o="function"==typeof(i=function(e){var t=function(){var t,n={},i=[];function r(e){e||(e=document.documentElement);var t=window.getComputedStyle(e,null).fontSize;return parseFloat(t)||16}function o(e,t){var n=t.split(/\d/),i=n[n.length-1];switch(t=parseFloat(t),i){case"px":return t;case"em":return t*r(e);case"rem":return t*r();case"vw":return t*document.documentElement.clientWidth/100;case"vh":return t*document.documentElement.clientHeight/100;case"vmin":case"vmax":var o=document.documentElement.clientWidth/100,a=document.documentElement.clientHeight/100;return t*(0,Math["vmin"===i?"min":"max"])(o,a);default:return t}}function a(e,t){this.element=e;var i,r,a,s,u,c,l,h,f=["min-width","min-height","max-width","max-height"];this.call=function(){for(i in a=function(e){if(!e.getBoundingClientRect)return{width:e.offsetWidth,height:e.offsetHeight};var t=e.getBoundingClientRect();return{width:Math.round(t.width),height:Math.round(t.height)}}(this.element),c={},n[t])!n[t].hasOwnProperty(i)||(s=o(this.element,(r=n[t][i]).value),u="width"===r.property?a.width:a.height,l="","min"===r.mode&&u>=s&&(l+=r.value),"max"===r.mode&&u<=s&&(l+=r.value),c[h=r.mode+"-"+r.property]||(c[h]=""),l&&-1===(" "+c[h]+" ").indexOf(" "+l+" ")&&(c[h]+=" "+l));for(var e in f)!f.hasOwnProperty(e)||(c[f[e]]?this.element.setAttribute(f[e],c[f[e]].substr(1)):this.element.removeAttribute(f[e]))}}function s(t,n){t.elementQueriesSetupInformation||(t.elementQueriesSetupInformation=new a(t,n)),t.elementQueriesSensor||(t.elementQueriesSensor=new e(t,function(){t.elementQueriesSetupInformation.call()}))}function u(e,r,o,a){if(void 0===n[e]){n[e]=[];var s=i.length;t.innerHTML+="\n"+e+" {animation: 0.1s element-queries;}",t.innerHTML+="\n"+e+" > .resize-sensor {min-width: "+s+"px;}",i.push(e)}n[e].push({mode:r,property:o,value:a})}function c(e){var t;if(document.querySelectorAll&&(t=e?e.querySelectorAll.bind(e):document.querySelectorAll.bind(document)),!t&&"undefined"!=typeof $$&&(t=$$),!t&&"undefined"!=typeof jQuery&&(t=jQuery),!t)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return t}function l(t){var n=[],i=[],r=[],o=0,a=-1,s=[];for(var u in t.children)if(t.children.hasOwnProperty(u)&&t.children[u].tagName&&"img"===t.children[u].tagName.toLowerCase()){n.push(t.children[u]);var c=t.children[u].getAttribute("min-width")||t.children[u].getAttribute("data-min-width"),l=t.children[u].getAttribute("data-src")||t.children[u].getAttribute("url");r.push(l),i.push({minWidth:c}),c?t.children[u].style.display="none":(o=n.length-1,t.children[u].style.display="block")}function h(){var e,u=!1;for(e in n)!n.hasOwnProperty(e)||i[e].minWidth&&t.offsetWidth>i[e].minWidth&&(u=e);if(u||(u=o),a!==u)if(s[u])n[a].style.display="none",n[u].style.display="block",a=u;else{var c=new Image;c.onload=function(){n[u].src=r[u],n[a].style.display="none",n[u].style.display="block",s[u]=!0,a=u},c.src=r[u]}else n[u].src=r[u]}a=o,t.resizeSensorInstance=new e(t,h),h()}var h=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,f=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function d(e){var t,n,i,r;for(e=e.replace(/'/g,'"');null!==(t=h.exec(e));)for(n=t[1]+t[3],i=t[2];null!==(r=f.exec(i));)u(n,r[1],r[2],r[3])}function p(e){var t="";if(e)if("string"==typeof e)(-1!==(e=e.toLowerCase()).indexOf("min-width")||-1!==e.indexOf("max-width"))&&d(e);else for(var n=0,i=e.length;n img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",t.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(t),v=!0);for(var r=0,o=document.styleSheets.length;r0&&a.length>r&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,console&&console.warn&&console.warn(s)}return e}function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function O(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=C.bind(i);return r.listener=n,i.wrapFn=r,r}function T(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=r[e];if(void 0===s)return!1;if("function"==typeof s)b(s,this,t);else{var u=s.length,c=P(s,u);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},w.prototype.listeners=function(e){return T(this,e,!0)},w.prototype.rawListeners=function(e){return T(this,e,!1)},w.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):A.call(e,t)},w.prototype.listenerCount=A,w.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]},I.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(I.prototype[Symbol.iterator]=function(){return this}),I.of=function(){var e=arguments,t=e.length,n=0;return new I(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},I.empty=function(){var e=new I(null);return e.done=!0,e},I.is=function(e){return e instanceof I||"object"==typeof e&&null!==e&&"function"==typeof e.next};var R=I,D=function(e,t){for(var n,i=arguments.length>1?t:1/0,r=i!==1/0?new Array(i):[],o=0;;){if(o===i)return r;if((n=e.next()).done)return o!==t?r.slice(0,o):r;r[o++]=n.value}},N=function(e){function n(t,n){var i;return(i=e.call(this)||this).name="GraphError",i.message=t||"",i.data=n||{},i}return t(n,e),n}(a(Error)),L=function(e){function n(t,i){var r;return(r=e.call(this,t,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(r),n.prototype.constructor),r}return t(n,e),n}(N),j=function(e){function n(t,i){var r;return(r=e.call(this,t,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(r),n.prototype.constructor),r}return t(n,e),n}(N),F=function(e){function n(t,i){var r;return(r=e.call(this,t,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(r),n.prototype.constructor),r}return t(n,e),n}(N);function B(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function V(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function z(e,t){this.key=e,this.attributes=t,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function U(e,t,n,i,r,o){this.key=t,this.attributes=o,this.undirected=e,this.source=i,this.target=r,this.generatedKey=n}function H(e,t,n,i,r,o,a){var s,u,c="out",l="in";if(t&&(c=l="undirected"),e.multi){if(void 0===(u=(s=o[c])[r])&&(u=new Set,s[r]=u),u.add(n),i===r&&t)return;void 0===(s=a[l])[i]&&(s[i]=u)}else{if(o[c][r]=n,i===r&&t)return;a[l][i]=n}}function G(e,t,n){var i=e.multi,r=n.source,o=n.target,a=r.key,s=o.key,u=r[t?"undirected":"out"],c=t?"undirected":"in";if(s in u)if(i){var l=u[s];1===l.size?(delete u[s],delete o[c][a]):l.delete(n)}else delete u[s];i||delete o[c][a]}V.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},z.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var W=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var r=""+e,o=""+arguments[1];if(!(i=c(this,r,o,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(r,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],r=arguments[3],!(o=c(this,a,s,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&o.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]=r,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],r=arguments[3],!(o=c(this,a,s,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof r)throw new L("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&o.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]=r(o.attributes[i]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete r.attributes[i],this.emit("edgeAttributesUpdated",{key:r.key,type:"remove",attributes:r.attributes,name:i}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return r.attributes=i,this.emit("edgeAttributesUpdated",{key:r.key,type:"replace",attributes:r.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=c(this,o,a,n)))throw new j("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(r=this._edges.get(e=""+e)))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return u(r.attributes,i),this.emit("edgeAttributesUpdated",{key:r.key,type:"merge",attributes:r.attributes,data:i}),this}}}],q=R,X=function(){var e,t=arguments,n=-1;return new q(function i(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var r=e.next();return r.done?(e=null,i()):r})},Y=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function K(e,t){for(var n in t)e.push(t[n].key)}function Q(e,t){for(var n in t)t[n].forEach(function(t){return e.push(t.key)})}function $(e,t,n){for(var i in e)if(i!==n){var r=e[i];t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey)}}function Z(e,t,n){for(var i in e)i!==n&&e[i].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function J(e,t,n){for(var i in e)if(i!==n){var r=e[i];if(t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey))return!0}return!1}function ee(e,t,n){var i,r,o,a,s;for(var u in e)if(u!==n)for(i=e[u].values();!0!==(r=i.next()).done;)if(a=(o=r.value).source,t(o.key,o.attributes,a.key,(s=o.target).key,a.attributes,s.attributes,o.undirected,o.generatedKey))return!0;return!1}function te(e,t){var n=Object.keys(e),i=n.length,r=null,o=0;return new R(function a(){var s;if(r){var u=r.next();if(u.done)return r=null,o++,a();s=u.value}else{if(o>=i)return{done:!0};var c=n[o];if(c===t)return o++,a();if((s=e[c])instanceof Set)return r=s.values(),a();o++}return{done:!1,value:[s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes]}})}function ne(e,t,n){var i=t[n];i&&e.push(i.key)}function ie(e,t,n){var i=t[n];i&&i.forEach(function(t){return e.push(t.key)})}function re(e,t,n){var i=e[t];if(i){var r=i.source,o=i.target;n(i.key,i.attributes,r.key,o.key,r.attributes,o.attributes,i.undirected,i.generatedKey)}}function oe(e,t,n){var i=e[t];i&&i.forEach(function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes,e.undirected,e.generatedKey)})}function ae(e,t,n){var i=e[t];if(i){var r=i.source,o=i.target;return n(i.key,i.attributes,r.key,o.key,r.attributes,o.attributes,i.undirected,i.generatedKey)}}function se(e,t,n){var i=e[t];if(i){for(var r,o,a=i.values();!0!==(r=a.next()).done;)if(n((o=r.value).key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected,o.generatedKey))return!0;return!1}}function ue(e,t){var n=e[t];if(n instanceof Set){var i=n.values();return new R(function(){var e=i.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return R.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ce(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return"function"==typeof Array.from?Array.from(e._edges.keys()):D(e._edges.keys(),e._edges.size);for(var n,i,r=new Array("undirected"===t?e.undirectedSize:e.directedSize),o="undirected"===t,a=e._edges.values(),s=0;!0!==(n=a.next()).done;)(i=n.value).undirected===o&&(r[s++]=i.key);return r}function le(e,t,n){if(0!==e.size)for(var i,r,o="mixed"!==t&&t!==e.type,a="undirected"===t,s=e._edges.values();!0!==(i=s.next()).done;)if(r=i.value,!o||r.undirected===a){var u=r.source,c=r.target;n(r.key,r.attributes,u.key,c.key,u.attributes,c.attributes,r.undirected,r.generatedKey)}}function he(e,t,n){if(0!==e.size)for(var i,r,o="mixed"!==t&&t!==e.type,a="undirected"===t,s=e._edges.values();!0!==(i=s.next()).done;)if(r=i.value,!o||r.undirected===a){var u=r.source,c=r.target;if(n(r.key,r.attributes,u.key,c.key,u.attributes,c.attributes,r.undirected,r.generatedKey))break}}function fe(e,t){if(0===e.size)return R.empty();var n="mixed"!==t&&t!==e.type,i="undirected"===t,r=e._edges.values();return new R(function(){for(var e,t;;){if((e=r.next()).done)return e;if(t=e.value,!n||t.undirected===i)break}return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})}function de(e,t,n,i){var r=[],o=e?Q:K;return"undirected"!==t&&("out"!==n&&o(r,i.in),"in"!==n&&o(r,i.out),!n&&i.directedSelfLoops>0&&r.splice(r.lastIndexOf(i.key),1)),"directed"!==t&&o(r,i.undirected),r}function pe(e,t,n,i,r){var o=e?Z:$;"undirected"!==t&&("out"!==n&&o(i.in,r),"in"!==n&&o(i.out,r,n?null:i.key)),"directed"!==t&&o(i.undirected,r)}function ve(e,t,n,i,r){var o=e?ee:J;"undirected"!==t&&("out"!==n&&o(i.in,r)||"in"!==n&&o(i.out,r,n?null:i.key))||"directed"===t||o(i.undirected,r)}function ge(e,t,n){var i=R.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(i=X(i,te(n.in))),"in"!==t&&void 0!==n.out&&(i=X(i,te(n.out,t?null:n.key)))),"directed"!==e&&void 0!==n.undirected&&(i=X(i,te(n.undirected))),i}function me(e,t,n,i,r){var o=t?ie:ne,a=[];return"undirected"!==e&&(void 0!==i.in&&"out"!==n&&o(a,i.in,r),void 0!==i.out&&"in"!==n&&o(a,i.out,r),!n&&i.directedSelfLoops>0&&a.splice(a.lastIndexOf(i.key),1)),"directed"!==e&&void 0!==i.undirected&&o(a,i.undirected,r),a}function ye(e,t,n,i,r,o){var a=t?oe:re;"undirected"!==e&&(void 0!==i.in&&"out"!==n&&a(i.in,r,o),i.key!==r&&void 0!==i.out&&"in"!==n&&a(i.out,r,o)),"directed"!==e&&void 0!==i.undirected&&a(i.undirected,r,o)}function be(e,t,n,i,r,o){var a=t?se:ae;"undirected"!==e&&(void 0!==i.in&&"out"!==n&&a(i.in,r,o)||i.key!==r&&void 0!==i.out&&"in"!==n&&a(i.out,r,o,n?null:i.key))||"directed"===e||void 0===i.undirected||a(i.undirected,r,o)}function _e(e,t,n,i){var r=R.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&i in n.in&&(r=X(r,ue(n.in,i))),void 0!==n.out&&"in"!==t&&i in n.out&&(r=X(r,ue(n.out,i)))),"directed"!==e&&void 0!==n.undirected&&i in n.undirected&&(r=X(r,ue(n.undirected,i))),r}var we=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function ke(e,t){if(void 0!==t)for(var n in t)e.add(n)}function xe(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var i=new Set;return"undirected"!==e&&("out"!==t&&ke(i,n.in),"in"!==t&&ke(i,n.out)),"directed"!==e&&ke(i,n.undirected),D(i.values(),i.size)}function Se(e,t,n){for(var i in t){var r=t[i];r instanceof Set&&(r=r.values().next().value);var o=r.source,a=o===e?r.target:o;n(a.key,a.attributes)}}function Ee(e,t,n,i){for(var r in n){var o=n[r];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;e.has(s.key)||(e.add(s.key),i(s.key,s.attributes))}}function Ce(e,t,n){for(var i in t){var r=t[i];r instanceof Set&&(r=r.values().next().value);var o=r.source,a=o===e?r.target:o;if(n(a.key,a.attributes))return!0}return!1}function Oe(e,t,n,i){for(var r in n){var o=n[r];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;if(!e.has(s.key)&&(e.add(s.key),i(s.key,s.attributes)))return!0}return!1}function Te(e,t){var n=Object.keys(t),i=n.length,r=0;return new R(function(){if(r>=i)return{done:!0};var o=t[n[r++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===e?o.target:a;return{done:!1,value:[s.key,s.attributes]}})}function Ae(e,t,n){var i=Object.keys(n),r=i.length,o=0;return new R(function a(){if(o>=r)return{done:!0};var s=n[i[o++]];s instanceof Set&&(s=s.values().next().value);var u=s.source,c=u===t?s.target:u;return e.has(c.key)?a():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function Pe(e,t,n,i,r){var o=e._nodes.get(i);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===r)return!0;if("in"!==n&&void 0!==o.out)for(var s in o.out)if(s===r)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===r)return!0;return!1}function Me(e,t,n){for(var i,r,o,a,s,u,c,l=t._nodes.values(),h=t.type;!0!==(i=l.next()).done;){if(r=i.value,"undirected"!==h)for(o in a=r.out)if(u=(s=a[o]).target,c=n(r.key,u.key,r.attributes,u.attributes,s.key,s.attributes,s.undirected,s.generatedKey),e&&c)return;if("directed"!==h)for(o in a=r.undirected)if((u=(s=a[o]).target).key!==o&&(u=s.source),c=n(r.key,u.key,r.attributes,u.attributes,s.key,s.attributes,s.undirected,s.generatedKey),e&&c)return}}function Ie(e,t,n){for(var i,r,o,a,s,u,c,l,h,f=t._nodes.values(),d=t.type;!0!==(i=f.next()).done;){if(r=i.value,"undirected"!==d)for(o in u=r.out)for(a=u[o].values();!0!==(s=a.next()).done;)if(l=(c=s.value).target,h=n(r.key,l.key,r.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&h)return;if("directed"!==d)for(o in u=r.undirected)for(a=u[o].values();!0!==(s=a.next()).done;)if((l=(c=s.value).target).key!==o&&(l=c.source),h=n(r.key,l.key,r.attributes,l.attributes,c.key,c.attributes,c.undirected,c.generatedKey),e&&h)return}}function Re(e,t){var n={key:e};return f(t.attributes)||(n.attributes=u({},t.attributes)),n}function De(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),f(t.attributes)||(n.attributes=u({},t.attributes)),t.undirected&&(n.undirected=!0),n}function Ne(e){return h(e)?"key"in e?!("attributes"in e)||h(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function Le(e){return h(e)?"source"in e?"target"in e?!("attributes"in e)||h(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var je=new Set(["directed","undirected","mixed"]),Fe=new Set(["domain","_events","_eventsCount","_maxListeners"]),Be={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Ve(e,t,n){var i=new e.NodeDataClass(t,n);return e._nodes.set(t,i),e.emit("nodeAdded",{key:t,attributes:n}),i}function ze(e,t,n,i,r,o,a,s){if(!i&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!h(s))throw new L("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!e.allowSelfLoops&&o===a)throw new F("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=e._nodes.get(o),c=e._nodes.get(a);if(!u)throw new j("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!c)throw new j("Graph.".concat(t,': target node "').concat(a,'" not found.'));var l={key:null,undirected:i,source:o,target:a,attributes:s};if(n&&(r=e._edgeKeyGenerator(l)),e._edges.has(r=""+r))throw new F("Graph.".concat(t,': the "').concat(r,'" edge already exists in the graph.'));if(!e.multi&&(i?void 0!==u.undirected[a]:void 0!==u.out[a]))throw new F("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var f=new U(i,r,n,u,c,s);return e._edges.set(r,f),o===a?i?(u.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(u.directedSelfLoops++,e._directedSelfLoopCount++):i?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),H(e,i,f,o,a,u,c),i?e._undirectedSize++:e._directedSize++,l.key=r,e.emit("edgeAdded",l),r}function Ue(e,t,n,i,r,o,a,s,c){if(!i&&"undirected"===e.type)throw new F("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===e.type)throw new F("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s)if(c){if("function"!=typeof s)throw new L("Graph.".concat(t,': invalid updater function. Expecting a function but got "').concat(s,'"'))}else if(!h(s))throw new L("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));var l;if(o=""+o,a=""+a,c&&(l=s,s=void 0),!e.allowSelfLoops&&o===a)throw new F("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var f,d,p=e._nodes.get(o),v=e._nodes.get(a);if(!n&&(f=e._edges.get(r))){if(f.source.key!==o||f.target.key!==a||i&&(f.source.key!==a||f.target.key!==o))throw new F("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(r,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(f.source.key,'", "').concat(f.target.key,'").'));d=f}if(d||e.multi||!p||(d=i?p.undirected[a]:p.out[a]),d)return(c?l:s)?(c?(d.attributes=l(d.attributes),e.emit("edgeAttributesUpdated",{type:"replace",key:d.key,attributes:d.attributes})):(u(d.attributes,s),e.emit("edgeAttributesUpdated",{type:"merge",key:d.key,attributes:d.attributes,data:s})),d.key):d.key;s=s||{},c&&l&&(s=l(s));var g={key:null,undirected:i,source:o,target:a,attributes:s};if(n&&(r=e._edgeKeyGenerator(g)),e._edges.has(r=""+r))throw new F("Graph.".concat(t,': the "').concat(r,'" edge already exists in the graph.'));return p||(p=Ve(e,o,{}),o===a&&(v=p)),v||(v=Ve(e,a,{})),f=new U(i,r,n,p,v,s),e._edges.set(r,f),o===a?i?(p.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(p.directedSelfLoops++,e._directedSelfLoopCount++):i?(p.undirectedDegree++,v.undirectedDegree++):(p.outDegree++,v.inDegree++),H(e,i,f,o,a,p,v),i?e._undirectedSize++:e._directedSize++,g.key=r,e.emit("edgeAdded",g),r}var He,Ge=function(e){function n(t){var n;if(n=e.call(this)||this,(t=u({},Be,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new L("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new L("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!je.has(t.type))throw new L('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new L("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var i,r="mixed"===t.type?B:"directed"===t.type?V:z;return d(s(n),"NodeDataClass",r),d(s(n),"_attributes",{}),d(s(n),"_nodes",new Map),d(s(n),"_edges",new Map),d(s(n),"_directedSize",0),d(s(n),"_undirectedSize",0),d(s(n),"_directedSelfLoopCount",0),d(s(n),"_undirectedSelfLoopCount",0),d(s(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(i=0,function(){return i++})),d(s(n),"_options",t),Fe.forEach(function(e){return d(s(n),e,n[e])}),p(s(n),"order",function(){return n._nodes.size}),p(s(n),"size",function(){return n._edges.size}),p(s(n),"directedSize",function(){return n._directedSize}),p(s(n),"undirectedSize",function(){return n._undirectedSize}),p(s(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),p(s(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),p(s(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),p(s(n),"multi",n._options.multi),p(s(n),"type",n._options.type),p(s(n),"allowSelfLoops",n._options.allowSelfLoops),p(s(n),"implementation",function(){return"graphology"}),n}t(n,e);var i=n.prototype;return i.hasNode=function(e){return this._nodes.has(""+e)},i.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&!n.undirected}if(2===arguments.length){t=""+t;var i=this._nodes.get(e=""+e);if(!i)return!1;var r=i.out[t];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n.undirected}if(2===arguments.length){t=""+t;var i=this._nodes.get(e=""+e);if(!i)return!1;var r=i.undirected[t];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var i=void 0!==n.out&&n.out[t];return i||(i=void 0!==n.undirected&&n.undirected[t]),!(!i||this.multi&&!i.size)}throw new L("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new j('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var i=n.out&&n.out[t]||void 0;return i?i.key:void 0}},i.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new j('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var i=n.undirected&&n.undirected[t]||void 0;return i?i.key:void 0}},i.edge=function(e,t){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var i=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(i)return i.key},i.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(t?n.directedSelfLoops:0)},i.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(t?n.directedSelfLoops:0)},i.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var i=t?n.directedSelfLoops:0;return n.inDegree+i+(n.outDegree+i)},i.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(t?n.undirectedSelfLoops:0)},i.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new L('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var i=0,r=0;return"directed"!==this.type&&(t&&(r=n.undirectedSelfLoops),i+=n.undirectedDegree+2*r),"undirected"!==this.type&&(t&&(r=n.directedSelfLoops),i+=n.inDegree+n.outDegree+2*r),i},i.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},i.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},i.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},i.opposite=function(e,t){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new j('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var i=n.source.key,r=n.target.key;if(e!==i&&e!==r)throw new j('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(i,", ").concat(r,")."));return e===i?r:i},i.hasExtremity=function(e,t){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new j('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return n.source.key===t||n.target.key===t},i.isUndirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},i.isDirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},i.isSelfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},i.hasGeneratedKey=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.hasGeneratedKey: could not find the "'.concat(e,'" edge in the graph.'));return t.generatedKey},i.addNode=function(e,t){return function(e,t,n){if(n&&!h(n))throw new L('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},e._nodes.has(t=""+t))throw new F('Graph.addNode: the "'.concat(t,'" node already exist in the graph.'));var i=new e.NodeDataClass(t,n);return e._nodes.set(t,i),e.emit("nodeAdded",{key:t,attributes:n}),i}(this,e,t).key},i.mergeNode=function(e,t){if(t&&!h(t))throw new L('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var n=this._nodes.get(e=""+e);return n?(t&&(u(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},i.updateNode=function(e,t){if(t&&"function"!=typeof t)throw new L('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));var n=this._nodes.get(e=""+e);if(n)return t&&(n.attributes=t(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})),e;var i=t?t({}):{};return n=new this.NodeDataClass(e,i),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:i}),e},i.dropNode=function(e){var t=this,n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));this.forEachEdge(e,function(e){t.dropEdge(e)}),this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},i.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],i=""+arguments[1];if(!(t=c(this,n,i,this.type)))throw new j('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(i,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new j('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var r=t.source,o=t.target,a=t.attributes,s=t.undirected;return r===o?s?(r.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(r.directedSelfLoops--,this._directedSelfLoopCount--):s?(r.undirectedDegree--,o.undirectedDegree--):(r.outDegree--,o.inDegree--),G(this,s,t),s?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:a,source:r.key,target:o.key,undirected:s}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(e){return this._attributes[e]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},i.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},i.updateAttribute=function(e,t){if("function"!=typeof t)throw new L("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},i.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},i.replaceAttributes=function(e){if(!h(e))throw new L("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(e){if(!h(e))throw new L("Graph.mergeAttributes: provided attributes are not a plain object.");return u(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},i.getNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},i.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new j('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},i.hasNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},i.setNodeAttribute=function(e,t,n){var i=this._nodes.get(e=""+e);if(!i)throw new j('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return i.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:i.attributes,name:t}),this},i.updateNodeAttribute=function(e,t,n){var i=this._nodes.get(e=""+e);if(!i)throw new j('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new L("Graph.updateAttribute: updater should be a function.");var r=i.attributes,o=n(r[t]);return r[t]=o,this.emit("nodeAttributesUpdated",{key:e,type:"set",attributes:i.attributes,name:t}),this},i.removeNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",attributes:n.attributes,name:t}),this},i.replaceNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!h(t))throw new L("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",attributes:n.attributes}),this},i.mergeNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new j('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!h(t))throw new L("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return u(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",attributes:n.attributes,data:t}),this},i.updateEachNodeAttributes=function(e,t){if("function"!=typeof e)throw new L("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!v(t))throw new L("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._nodes.values();!0!==(n=r.next()).done;)(i=n.value).attributes=e(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},i.updateEachEdgeAttributes=function(e,t){if("function"!=typeof e)throw new L("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!v(t))throw new L("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._edges.values();!0!==(n=r.next()).done;)(i=n.value).attributes=e(i.key,i.attributes);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},i.forEach=function(e){if("function"!=typeof e)throw new L("Graph.forEach: expecting a callback.");this.multi?Ie(!1,this,e):Me(!1,this,e)},i.forEachUntil=function(e){if("function"!=typeof e)throw new L("Graph.forEach: expecting a callback.");this.multi?Ie(!0,this,e):Me(!0,this,e)},i.adjacency=function(){return this.multi?(d=(u=this)._nodes.values(),p=u.type,v="outer",g=null,new R(function e(){var t;if("outer"===v)return!0===(t=d.next()).done?t:(c=t.value,v="directed",e());if("directed"===v)return"undirected"===p?(v="undirected",e()):(h=c.out,l=Object.keys(c.out),f=0,v="inner-directed",e());if("undirected"===v){if("directed"===p)return v="outer",e();h=c.undirected,l=Object.keys(c.undirected),f=0,v="inner-undirected"}if(!g&&f>=l.length)return v="inner-undirected"===v?"outer":"undirected",e();if(!g){var n=l[f++];return g=h[n].values(),e()}if((t=g.next()).done)return g=null,e();var i=t.value,r=i.target;return"inner-undirected"===v&&r.key===c.key&&(r=i.source),{done:!1,value:[c.key,r.key,c.attributes,r.attributes,i.key,i.attributes]}})):(o=(e=this)._nodes.values(),a=e.type,s="outer",new R(function e(){var u;if("outer"===s)return!0===(u=o.next()).done?u:(t=u.value,s="directed",e());if("directed"===s)return"undirected"===a?(s="undirected",e()):(i=t.out,n=Object.keys(t.out),r=0,s="inner-directed",e());if("undirected"===s){if("directed"===a)return s="outer",e();i=t.undirected,n=Object.keys(t.undirected),r=0,s="inner-undirected"}if(r>=n.length)return s="inner-undirected"===s?"outer":"undirected",e();var c=n[r++],l=i[c],h=l.target;return"inner-undirected"===s&&h.key===t.key&&(h=l.source),{done:!1,value:[t.key,h.key,t.attributes,h.attributes,l.key,l.attributes]}}));var e,t,n,i,r,o,a,s,u,c,l,h,f,d,p,v,g},i.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):D(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(e){if("function"!=typeof e)throw new L("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,n){e(n,t.attributes)})},i.forEachNodeUntil=function(e){if("function"!=typeof e)throw new L("Graph.forEachNode: expecting a callback.");for(var t,n,i=this._nodes.values();!0!==(t=i.next())&&!e((n=t.value).key,n.attributes););},i.nodeEntries=function(){var e=this._nodes.values();return new R(function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}})},i.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new j('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return Re(e,t)},i.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new j('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return De(e,t)},i.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(n,i){e[t++]=Re(i,n)});var n=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,i){n[t++]=De(i,e)}),{attributes:this.getAttributes(),nodes:e,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},i.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ne(e);if(n){if("not-object"===n)throw new L('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new L("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new L("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var i=e.key,r=e.attributes,o=void 0===r?{}:r;return t?this.mergeNode(i,o):this.addNode(i,o),this},i.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Le(e);if(n){if("not-object"===n)throw new L('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new L("Graph.importEdge: missing souce.");if("no-target"===n)throw new L("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new L("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new L("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var i=e.source,r=e.target,o=e.attributes,a=void 0===o?{}:o,s=e.undirected,u=void 0!==s&&s;return"key"in e?(t?u?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:u?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,i,r,a):(t?u?this.mergeUndirectedEdge:this.mergeDirectedEdge:u?this.addUndirectedEdge:this.addDirectedEdge).call(this,i,r,a),this},i.import=function(e){var t,n,i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),r),this;if(!h(e))throw new L("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!h(e.attributes))throw new L("Graph.import: invalid attributes. Expecting a plain object.");r?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}if(e.nodes){if(i=e.nodes,!Array.isArray(i))throw new L("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=i.length;tn)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this;var e},i.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},i.toJSON=function(){return this.export()},i.toString=function(){return"[object Graph]"},i.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,n){t[n]=e.attributes});var n={},i={};this._edges.forEach(function(t,r){var o=t.undirected?"--":"->",a="",s="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===i[s]?i[s]=0:i[s]++,a+="".concat(i[s],". ")):a+="[".concat(r,"]: "),n[a+=s]=t.attributes});var r={};for(var o in this)this.hasOwnProperty(o)&&!Fe.has(o)&&"function"!=typeof this[o]&&(r[o]=this[o]);return r.attributes=this._attributes,r.nodes=t,r.edges=n,d(r,"constructor",this.constructor),r},n}(m.exports.EventEmitter);"undefined"!=typeof Symbol&&(Ge.prototype[Symbol.for("nodejs.util.inspect.custom")]=Ge.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge","update"].forEach(function(t){var n=e.name(t),i="add"===t?ze:Ue;Ge.prototype[n]=e.generateKey?function(r,o,a){return i(this,n,!0,"undirected"===(e.type||this.type),null,r,o,a,"update"===t)}:function(r,o,a,s){return i(this,n,!1,"undirected"===(e.type||this.type),r,o,a,s,"update"===t)}})}),"undefined"!=typeof Symbol&&(Ge.prototype[Symbol.iterator]=Ge.prototype.adjacency),He=Ge,W.forEach(function(e){var t=e.name,n=e.attacher;n(He,t("Edge"),"mixed"),n(He,t("DirectedEdge"),"directed"),n(He,t("UndirectedEdge"),"undirected")}),function(e){Y.forEach(function(t){var n,i,r,o;r=(n=t).type,o=n.direction,e.prototype[i=n.name]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return ce(this,r);if(1===arguments.length){var n=this._nodes.get(e=""+e);if(void 0===n)throw new j("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return de(this.multi,"mixed"===r?this.type:r,o,n)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new j("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return me(r,this.multi,o,a,t)}throw new L("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return le(this,i,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return pe(this.multi,"mixed"===i?this.type:i,r,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return ye(i,this.multi,r,s,t,n)}throw new L("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[o]=function(e,t,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return he(this,i,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return ve(this.multi,"mixed"===i?this.type:i,r,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return be(i,this.multi,r,s,t,n)}throw new L("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.type,i=t.direction,r=t.name.slice(0,-1)+"Entries";e.prototype[r]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return R.empty();if(!arguments.length)return fe(this,n);if(1===arguments.length){var o=this._nodes.get(e=""+e);if(!o)throw new j("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return ge(n,i,o)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new j("Graph.".concat(r,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new j("Graph.".concat(r,': could not find the "').concat(t,'" target node in the graph.'));return _e(n,i,a,t)}throw new L("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(Ge),function(e){we.forEach(function(t){var n,i,r,o;r=(n=t).type,o=n.direction,e.prototype[i=n.name]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(t))throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(n))throw new j("Graph.".concat(i,': could not find the "').concat(n,'" node in the graph.'));return Pe(this,r,o,t,n)}if(1===arguments.length){var a=this._nodes.get(e=""+e);if(void 0===a)throw new j("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return xe("mixed"===r?this.type:r,o,a)}throw new L("Graph.".concat(i,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,i){if("mixed"!==e){if("undirected"===e)return Se(n,n.undirected,i);if("string"==typeof t)return Se(n,n[t],i)}var r=new Set;"undirected"!==e&&("out"!==t&&Ee(r,n,n.in,i),"in"!==t&&Ee(r,n,n.out,i)),"directed"!==e&&Ee(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,t)}}}(e,t),function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";e.prototype[o]=function(e,t){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new j("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,i){if("mixed"!==e){if("undirected"===e)return Ce(n,n.undirected,i);if("string"==typeof t)return Ce(n,n[t],i)}var r=new Set;"undirected"!==e&&("out"!==t&&Oe(r,n,n.in,i)||"in"!==t&&Oe(r,n,n.out,i))||"directed"===e||Oe(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,t)}}}(e,t),function(e,t){var n=t.type,i=t.direction,r=t.name.slice(0,-1)+"Entries";e.prototype[r]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return R.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new j("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return Te(n,n.undirected);if("string"==typeof t)return Te(n,n[t])}var i=R.empty(),r=new Set;return"undirected"!==e&&("out"!==t&&(i=X(i,Ae(r,n,n.in))),"in"!==t&&(i=X(i,Ae(r,n,n.out)))),"directed"!==e&&(i=X(i,Ae(r,n,n.undirected))),i}("mixed"===n?this.type:n,i,t)}}(e,t)})}(Ge);var We=function(e){function n(t){var n=u({type:"directed"},t);if("multi"in n&&!1!==n.multi)throw new L("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new L('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Ge),qe=function(e){function n(t){var n=u({type:"undirected"},t);if("multi"in n&&!1!==n.multi)throw new L("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new L('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Ge),Xe=function(e){function n(t){var n=u({multi:!0},t);if("multi"in n&&!0!==n.multi)throw new L("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return e.call(this,n)||this}return t(n,e),n}(Ge),Ye=function(e){function n(t){var n=u({type:"directed",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new L("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new L('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Ge),Ke=function(e){function n(t){var n=u({type:"undirected",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new L("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new L('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Ge);function Qe(e){e.from=function(t,n){var i=u({},t.options,n),r=new e(i);return r.import(t),r}}return Qe(Ge),Qe(We),Qe(qe),Qe(Xe),Qe(Ye),Qe(Ke),Ge.Graph=Ge,Ge.DirectedGraph=We,Ge.UndirectedGraph=qe,Ge.MultiGraph=Xe,Ge.MultiDirectedGraph=Ye,Ge.MultiUndirectedGraph=Ke,Ge.InvalidArgumentsGraphError=L,Ge.NotFoundGraphError=j,Ge.UsageGraphError=F,Ge}()},11524:function(e,t,n){var i;!function(r,o,a,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),h=Math.round,f=Math.abs,d=Date.now;function p(e,t,n){return setTimeout(w(e,n),t)}function v(e,t,n){return!!Array.isArray(e)&&(g(e,n[t],n),!0)}function g(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function T(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function I(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=G(t):1===r&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,u=a?a.center:o.center,c=t.center=W(i);t.timeStamp=d(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=K(u,c),t.distance=Y(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};(1===t.eventType||4===o.eventType)&&(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=X(t.deltaX,t.deltaY);var l=q(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=f(l.x)>f(l.y)?l.x:l.y,t.scale=a?function(e,t){return Y(t[0],t[1],z)/Y(e[0],e[1],z)}(a.pointers,i):1,t.rotation=a?function(e,t){return K(t[1],t[0],z)+K(e[1],e[0],z)}(a.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,o,a=e.lastInterval||t,u=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(u>25||a.velocity===s)){var c=t.deltaX-a.deltaX,l=t.deltaY-a.deltaY,h=q(u,c,l);i=h.x,r=h.y,n=f(h.x)>f(h.y)?h.x:h.y,o=X(c,l),e.lastInterval=t}else n=a.velocity,i=a.velocityX,r=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=o}(n,t);var h=e.element;C(t.srcEvent.target,h)&&(h=t.srcEvent.target),t.target=h}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function G(e){for(var t=[],n=0;n=f(t)?e<0?2:4:t<0?8:16}function Y(e,t,n){n||(n=V);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function K(e,t,n){return n||(n=V),180*Math.atan2(t[n[1]]-e[n[1]],t[n[0]]-e[n[0]])/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};var Q={mousedown:1,mousemove:2,mouseup:4},$="mousedown",Z="mousemove mouseup";function J(){this.evEl=$,this.evWin=Z,this.pressed=!1,U.apply(this,arguments)}_(J,U,{handler:function(e){var t=Q[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:B,srcEvent:e}))}});var ee={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},te={2:F,3:"pen",4:B,5:"kinect"},ne="pointerdown",ie="pointermove pointerup pointercancel";function re(){this.evEl=ne,this.evWin=ie,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ne="MSPointerDown",ie="MSPointerMove MSPointerUp MSPointerCancel"),_(re,U,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=ee[i],o=te[e.pointerType]||e.pointerType,a=o==F,s=A(t,e.pointerId,"pointerId");1&r&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&r&&(n=!0),!(s<0)&&(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var oe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart",se="touchstart touchmove touchend touchcancel";function ue(){this.evTarget=ae,this.evWin=se,this.started=!1,U.apply(this,arguments)}function ce(e,t){var n=P(e.touches),i=P(e.changedTouches);return 12&t&&(n=M(n.concat(i),"identifier",!0)),[n,i]}_(ue,U,{handler:function(e){var t=oe[e.type];if(1===t&&(this.started=!0),this.started){var n=ce.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:F,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},he="touchstart touchmove touchend touchcancel";function fe(){this.evTarget=he,this.targetIds={},U.apply(this,arguments)}function de(e,t){var n=P(e.touches),i=this.targetIds;if(3&t&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=P(e.changedTouches),s=[],u=this.target;if(o=n.filter(function(e){return C(e.target,u)}),1===t)for(r=0;r-1&&i.splice(e,1)},2500)}}function me(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+Te(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+Te(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return Me.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ae(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),_(Re,Me,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ke]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){1!==e.scale&&(e.additionalEvent=this.options.event+(e.scale<1?"in":"out")),this._super.emit.call(this,e)}}),_(De,Oe,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=p(function(){this.state=8,this.tryEmit()},t.time,this);else if(4&e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),_(Ne,Me,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ke]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),_(Le,Me,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ie.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&f(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ae(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),_(je,Oe,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[we]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance"']/g,q=RegExp(G.source),X=RegExp(W.source),Y=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,ie=/\s/,re=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,de=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,be=/['\n\r\u2028\u2029\\]/g,_e="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Oe="["+_e+"]",Te="["+Ce+"]",Ae="["+we+"]",Pe="\\d+",Me="["+ke+"]",Ie="["+xe+"]",Re="[^"+_e+Ce+Pe+ke+xe+Se+"]",De="\\ud83c[\\udffb-\\udfff]",Ne="[^"+_e+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Se+"]",Be="(?:"+Ie+"|"+Re+")",Ve="(?:"+Fe+"|"+Re+")",ze="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ue="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Ae+"|"+De+")?",Ge="["+Ee+"]?",We=Ge+He+"(?:\\u200d(?:"+[Ne,Le,je].join("|")+")"+Ge+He+")*",qe="(?:"+[Me,Le,je].join("|")+")"+We,Xe="(?:"+[Ne+Ae+"?",Ae,Le,je,Oe].join("|")+")",Ye=RegExp("['\u2019]","g"),Ke=RegExp(Ae,"g"),Qe=RegExp(De+"(?="+De+")|"+Xe+We,"g"),$e=RegExp([Fe+"?"+Ie+"+"+ze+"(?="+[Te,Fe,"$"].join("|")+")",Ve+"+"+Ue+"(?="+[Te,Fe+Be,"$"].join("|")+")",Fe+"?"+Be+"+"+ze,Fe+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,qe].join("|"),"g"),Ze=RegExp("[\\u200d"+_e+we+Ee+"]"),Je=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tt=-1,nt={};nt[I]=nt[R]=nt[D]=nt[N]=nt[L]=nt[j]=nt[F]=nt[B]=nt[V]=!0,nt[p]=nt[v]=nt[P]=nt[g]=nt[M]=nt[m]=nt[y]=nt[b]=nt[w]=nt[k]=nt[x]=nt[E]=nt[C]=nt[O]=nt[A]=!1;var it={};it[p]=it[v]=it[P]=it[M]=it[g]=it[m]=it[I]=it[R]=it[D]=it[N]=it[L]=it[w]=it[k]=it[x]=it[E]=it[C]=it[O]=it[T]=it[j]=it[F]=it[B]=it[V]=!0,it[y]=it[b]=it[A]=!1;var rt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,at=parseInt,st="object"==typeof global&&global&&global.Object===Object&&global,ut="object"==typeof self&&self&&self.Object===Object&&self,ct=st||ut||Function("return this")(),lt=t&&!t.nodeType&&t,ht=lt&&e&&!e.nodeType&&e,ft=ht&&ht.exports===lt,dt=ft&&st.process,pt=function(){try{return ht&&ht.require&&ht.require("util").types||dt&&dt.binding&&dt.binding("util")}catch(e){}}(),vt=pt&&pt.isArrayBuffer,gt=pt&&pt.isDate,mt=pt&&pt.isMap,yt=pt&&pt.isRegExp,bt=pt&&pt.isSet,_t=pt&&pt.isTypedArray;function wt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function kt(e,t,n,i){for(var r=-1,o=null==e?0:e.length;++r-1}function Tt(e,t,n){for(var i=-1,r=null==e?0:e.length;++i-1;);return n}function $t(e,t){for(var n=e.length;n--&&jt(t,e[n],0)>-1;);return n}function Zt(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i}var Jt=Ut({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),en=Ut({"&":"&","<":"<",">":">",'"':""","'":"'"});function tn(e){return"\\"+rt[e]}function nn(e){return Ze.test(e)}function rn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function on(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,i=e.length,r=0,o=[];++n",""":'"',"'":"'"}),fn=function e(t){var n,i=(t=null==t?ct:fn.defaults(ct.Object(),t,fn.pick(ct,et))).Array,ie=t.Date,_e=t.Error,we=t.Function,ke=t.Math,xe=t.Object,Se=t.RegExp,Ee=t.String,Ce=t.TypeError,Oe=i.prototype,Te=xe.prototype,Ae=t["__core-js_shared__"],Pe=we.prototype.toString,Me=Te.hasOwnProperty,Ie=0,Re=(n=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=Te.toString,Ne=Pe.call(xe),Le=ct._,je=Se("^"+Pe.call(Me).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=ft?t.Buffer:r,Be=t.Symbol,Ve=t.Uint8Array,ze=Fe?Fe.allocUnsafe:r,Ue=on(xe.getPrototypeOf,xe),He=xe.create,Ge=Te.propertyIsEnumerable,We=Oe.splice,qe=Be?Be.isConcatSpreadable:r,Xe=Be?Be.iterator:r,Qe=Be?Be.toStringTag:r,Ze=function(){try{var e=ao(xe,"defineProperty");return e({},"",{}),e}catch(Io){}}(),rt=t.clearTimeout!==ct.clearTimeout&&t.clearTimeout,st=ie&&ie.now!==ct.Date.now&&ie.now,ut=t.setTimeout!==ct.setTimeout&&t.setTimeout,lt=ke.ceil,ht=ke.floor,dt=xe.getOwnPropertySymbols,pt=Fe?Fe.isBuffer:r,Dt=t.isFinite,Ut=Oe.join,dn=on(xe.keys,xe),pn=ke.max,vn=ke.min,gn=ie.now,mn=t.parseInt,yn=ke.random,bn=Oe.reverse,_n=ao(t,"DataView"),wn=ao(t,"Map"),kn=ao(t,"Promise"),xn=ao(t,"Set"),Sn=ao(t,"WeakMap"),En=ao(xe,"create"),Cn=Sn&&new Sn,On={},Tn=Lo(_n),An=Lo(wn),Pn=Lo(kn),Mn=Lo(xn),In=Lo(Sn),Rn=Be?Be.prototype:r,Dn=Rn?Rn.valueOf:r,Nn=Rn?Rn.toString:r;function Ln(e){if(Ja(e)&&!Ua(e)&&!(e instanceof Vn)){if(e instanceof Bn)return e;if(Me.call(e,"__wrapped__"))return jo(e)}return new Bn(e)}var jn=function(){function e(){}return function(t){if(!Za(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Fn(){}function Bn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ri(e,t,n,i,o,a){var s,u=1&t,c=2&t,l=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!Za(e))return e;var h=Ua(e);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return Sr(e,s)}else{var f=co(e),d=f==b||f==_;if(qa(e))return yr(e,u);if(f==x||f==p||d&&!o){if(s=c||d?{}:ho(e),!u)return c?function(e,t){return Er(e,uo(e),t)}(e,function(e,t){return e&&Er(t,Ps(t),e)}(s,e)):function(e,t){return Er(e,so(e),t)}(e,ei(s,e))}else{if(!it[f])return o?e:{};s=function(e,t,n){var i=e.constructor;switch(t){case P:return br(e);case g:case m:return new i(+e);case M:return function(e,t){var n=t?br(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case I:case R:case D:case N:case L:case j:case F:case B:case V:return _r(e,n);case w:return new i;case k:case O:return new i(e);case E:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new i;case T:return function(e){return Dn?xe(Dn.call(e)):{}}(e)}}(e,f,u)}}a||(a=new Wn);var v=a.get(e);if(v)return v;a.set(e,s),rs(e)?e.forEach(function(i){s.add(ri(i,t,n,i,e,a))}):es(e)&&e.forEach(function(i,r){s.set(r,ri(i,t,n,r,e,a))});var y=h?r:(l?c?Jr:Zr:c?Ps:As)(e);return xt(y||e,function(i,r){y&&(i=e[r=i]),$n(s,r,ri(i,t,n,r,e,a))}),s}function oi(e,t,n){var i=n.length;if(null==e)return!i;for(e=xe(e);i--;){var o=n[i],a=e[o];if(a===r&&!(o in e)||!(0,t[o])(a))return!1}return!0}function ai(e,t,n){if("function"!=typeof e)throw new Ce(o);return Oo(function(){e.apply(r,n)},t)}function si(e,t,n,i){var r=-1,o=Ot,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=At(t,Xt(n))),i?(o=Tt,a=!1):t.length>=200&&(o=Kt,a=!1,t=new Gn(t));e:for(;++r-1},Un.prototype.set=function(e,t){var n=this.__data__,i=Zn(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new zn,map:new(wn||Un),string:new zn}},Hn.prototype.delete=function(e){var t=ro(this,e).delete(e);return this.size-=t?1:0,t},Hn.prototype.get=function(e){return ro(this,e).get(e)},Hn.prototype.has=function(e){return ro(this,e).has(e)},Hn.prototype.set=function(e,t){var n=ro(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},Gn.prototype.add=Gn.prototype.push=function(e){return this.__data__.set(e,a),this},Gn.prototype.has=function(e){return this.__data__.has(e)},Wn.prototype.clear=function(){this.__data__=new Un,this.size=0},Wn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Wn.prototype.get=function(e){return this.__data__.get(e)},Wn.prototype.has=function(e){return this.__data__.has(e)},Wn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Un){var i=n.__data__;if(!wn||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Hn(i)}return n.set(e,t),this.size=n.size,this};var ui=Tr(gi),ci=Tr(mi,!0);function li(e,t){var n=!0;return ui(e,function(e,i,r){return n=!!t(e,i,r)}),n}function hi(e,t,n){for(var i=-1,o=e.length;++i0&&n(s)?t>1?di(s,t-1,n,i,r):Pt(r,s):i||(r[r.length]=s)}return r}var pi=Ar(),vi=Ar(!0);function gi(e,t){return e&&pi(e,t,As)}function mi(e,t){return e&&vi(e,t,As)}function yi(e,t){return Ct(t,function(t){return Ka(e[t])})}function bi(e,t){for(var n=0,i=(t=pr(t,e)).length;null!=e&&nt}function xi(e,t){return null!=e&&Me.call(e,t)}function Si(e,t){return null!=e&&t in xe(e)}function Ei(e,t,n){for(var o=n?Tt:Ot,a=e[0].length,s=e.length,u=s,c=i(s),l=1/0,h=[];u--;){var f=e[u];u&&t&&(f=At(f,Xt(t))),l=vn(f.length,l),c[u]=!n&&(t||a>=120&&f.length>=120)?new Gn(u&&f):r}f=e[0];var d=-1,p=c[0];e:for(;++d=s?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}(e,t,n)});i--;)e[i]=e[i].value;return e}(Di(e,function(e,n,r){return{criteria:At(t,function(t){return t(e)}),index:++i,value:e}}))}function Vi(e,t,n){for(var i=-1,r=t.length,o={};++i-1;)s!==e&&We.call(s,u,1),We.call(e,u,1);return e}function Ui(e,t){for(var n=e?t.length:0,i=n-1;n--;){var r=t[n];if(n==i||r!==o){var o=r;po(r)?We.call(e,r,1):ar(e,r)}}return e}function Hi(e,t){return e+ht(yn()*(t-e+1))}function Gi(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=ht(t/2))&&(e+=e)}while(t);return n}function Wi(e,t){return To(ko(e,t,tu),e+"")}function qi(e){return Xn(Fs(e))}function Xi(e,t){var n=Fs(e);return Mo(n,ii(t,0,n.length))}function Yi(e,t,n,i){if(!Za(e))return e;for(var o=-1,a=(t=pr(t,e)).length,s=a-1,u=e;null!=u&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=i(o);++r>>1,a=e[o];null!==a&&!as(a)&&(n?a<=t:a=200){var c=t?null:Gr(e);if(c)return sn(c);a=!1,r=Kt,u=new Gn}else u=t?[]:s;e:for(;++i=i?e:Zi(e,t,n)}var mr=rt||function(e){return ct.clearTimeout(e)};function yr(e,t){if(t)return e.slice();var n=e.length,i=ze?ze(n):new e.constructor(n);return e.copy(i),i}function br(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function _r(e,t){var n=t?br(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function wr(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=as(e),s=t!==r,u=null===t,c=t==t,l=as(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!l&&e1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&vo(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=xe(t);++i-1?o[a?t[s]:s]:r}}function Dr(e){return $r(function(t){var n=t.length,i=n,a=Bn.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Ce(o);if(a&&!u&&"wrapper"==to(s))var u=new Bn([],!0)}for(i=u?i:n;++i1&&b.reverse(),d&&hu))return!1;var l=a.get(e),h=a.get(t);if(l&&h)return l==t&&h==e;var f=-1,d=!0,p=2&n?new Gn:r;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(re,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return xt(d,function(n){var i="_."+n[0];t&n[1]&&!Ot(e,i)&&e.push(i)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(i),n)))}function Po(e){var t=0,n=0;return function(){var i=gn(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Mo(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ia(e,n)});function la(e){var t=Ln(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var fa=$r(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return ni(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Vn&&po(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ha,args:[o],thisArg:r}),new Bn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),da=Cr(function(e,t,n){Me.call(e,n)?++e[n]:ti(e,n,1)}),pa=Rr(zo),va=Rr(Uo);function ga(e,t){return(Ua(e)?xt:ui)(e,io(t,3))}function ma(e,t){return(Ua(e)?St:ci)(e,io(t,3))}var ya=Cr(function(e,t,n){Me.call(e,n)?e[n].push(t):ti(e,n,[t])}),ba=Wi(function(e,t,n){var r=-1,o="function"==typeof t,a=Ga(e)?i(e.length):[];return ui(e,function(e){a[++r]=o?wt(t,e,n):Ci(e,t,n)}),a}),_a=Cr(function(e,t,n){ti(e,n,t)});function wa(e,t){return(Ua(e)?At:Di)(e,io(t,3))}var ka=Cr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),xa=Wi(function(e,t){if(null==e)return[];var n=t.length;return n>1&&vo(e,t[0],t[1])?t=[]:n>2&&vo(t[0],t[1],t[2])&&(t=[t[0]]),Bi(e,di(t,1),[])}),Sa=st||function(){return ct.Date.now()};function Ea(e,t,n){return t=n?r:t,qr(e,c,r,r,r,r,t=e&&null==t?e.length:t)}function Ca(e,t){var n;if("function"!=typeof t)throw new Ce(o);return e=fs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var Oa=Wi(function(e,t,n){var i=1;if(n.length){var r=an(n,no(Oa));i|=u}return qr(e,i,t,n,r)}),Ta=Wi(function(e,t,n){var i=3;if(n.length){var r=an(n,no(Ta));i|=u}return qr(t,i,e,n,r)});function Aa(e,t,n){var i,a,s,u,c,l,h=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new Ce(o);function v(t){var n=i,o=a;return i=a=r,h=t,u=e.apply(o,n)}function g(e){return h=e,c=Oo(y,t),f?v(e):u}function m(e){var n=e-l;return l===r||n>=t||n<0||d&&e-h>=s}function y(){var e=Sa();if(m(e))return b(e);c=Oo(y,function(e){var n=t-(e-l);return d?vn(n,s-(e-h)):n}(e))}function b(e){return c=r,p&&i?v(e):(i=a=r,u)}function _(){var e=Sa(),n=m(e);if(i=arguments,a=this,l=e,n){if(c===r)return g(l);if(d)return mr(c),c=Oo(y,t),v(l)}return c===r&&(c=Oo(y,t)),u}return t=ps(t)||0,Za(n)&&(f=!!n.leading,s=(d="maxWait"in n)?pn(ps(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==r&&mr(c),h=0,i=l=a=c=r},_.flush=function(){return c===r?u:b(Sa())},_}var Pa=Wi(function(e,t){return ai(e,1,t)}),Ma=Wi(function(e,t,n){return ai(e,ps(t)||0,n)});function Ia(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ce(o);var n=function n(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(Ia.Cache||Hn),n}function Ra(e){if("function"!=typeof e)throw new Ce(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ia.Cache=Hn;var Da=vr(function(e,t){var n=(t=1==t.length&&Ua(t[0])?At(t[0],Xt(io())):At(di(t,1),Xt(io()))).length;return Wi(function(i){for(var r=-1,o=vn(i.length,n);++r=t}),za=Oi(function(){return arguments}())?Oi:function(e){return Ja(e)&&Me.call(e,"callee")&&!Ge.call(e,"callee")},Ua=i.isArray,Ha=vt?Xt(vt):function(e){return Ja(e)&&wi(e)==P};function Ga(e){return null!=e&&$a(e.length)&&!Ka(e)}function Wa(e){return Ja(e)&&Ga(e)}var qa=pt||pu,Xa=gt?Xt(gt):function(e){return Ja(e)&&wi(e)==m};function Ya(e){if(!Ja(e))return!1;var t=wi(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Ka(e){if(!Za(e))return!1;var t=wi(e);return t==b||t==_||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qa(e){return"number"==typeof e&&e==fs(e)}function $a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function Za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ja(e){return null!=e&&"object"==typeof e}var es=mt?Xt(mt):function(e){return Ja(e)&&co(e)==w};function ts(e){return"number"==typeof e||Ja(e)&&wi(e)==k}function ns(e){if(!Ja(e)||wi(e)!=x)return!1;var t=Ue(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Pe.call(n)==Ne}var is=yt?Xt(yt):function(e){return Ja(e)&&wi(e)==E},rs=bt?Xt(bt):function(e){return Ja(e)&&co(e)==C};function os(e){return"string"==typeof e||!Ua(e)&&Ja(e)&&wi(e)==O}function as(e){return"symbol"==typeof e||Ja(e)&&wi(e)==T}var ss=_t?Xt(_t):function(e){return Ja(e)&&$a(e.length)&&!!nt[wi(e)]},us=zr(Ri),cs=zr(function(e,t){return e<=t});function ls(e){if(!e)return[];if(Ga(e))return os(e)?cn(e):Sr(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=co(e);return(t==w?rn:t==C?sn:Fs)(e)}function hs(e){return e?(e=ps(e))===l||e===-l?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=hs(e),n=t%1;return t==t?n?t-n:t:0}function ds(e){return e?ii(fs(e),0,f):0}function ps(e){if("number"==typeof e)return e;if(as(e))return NaN;if(Za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qt(e);var n=de.test(e);return n||ve.test(e)?at(e.slice(2),n?2:8):fe.test(e)?NaN:+e}function vs(e){return Er(e,Ps(e))}function gs(e){return null==e?"":rr(e)}var ms=Or(function(e,t){if(bo(t)||Ga(t))Er(t,As(t),e);else for(var n in t)Me.call(t,n)&&$n(e,n,t[n])}),ys=Or(function(e,t){Er(t,Ps(t),e)}),bs=Or(function(e,t,n,i){Er(t,Ps(t),e,i)}),_s=Or(function(e,t,n,i){Er(t,As(t),e,i)}),ws=$r(ni),ks=Wi(function(e,t){e=xe(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&vo(t[0],t[1],o)&&(i=1);++n1),t}),Er(e,Jr(e),n),i&&(n=ri(n,7,Kr));for(var r=t.length;r--;)ar(n,t[r]);return n}),Ds=$r(function(e,t){return null==e?{}:function(e,t){return Vi(e,t,function(t,n){return Es(e,n)})}(e,t)});function Ns(e,t){if(null==e)return{};var n=At(Jr(e),function(e){return[e]});return t=io(t),Vi(e,n,function(e,n){return t(e,n[0])})}var Ls=Wr(As),js=Wr(Ps);function Fs(e){return null==e?[]:Yt(e,As(e))}var Bs=Mr(function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)});function Vs(e){return Ys(gs(e).toLowerCase())}function zs(e){return(e=gs(e))&&e.replace(me,Jt).replace(Ke,"")}var Us=Mr(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Hs=Mr(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Gs=Pr("toLowerCase"),Ws=Mr(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),qs=Mr(function(e,t,n){return e+(n?" ":"")+Ys(t)}),Xs=Mr(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ys=Pr("toUpperCase");function Ks(e,t,n){return e=gs(e),(t=n?r:t)===r?function(e){return Je.test(e)}(e)?function(e){return e.match($e)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Qs=Wi(function(e,t){try{return wt(e,r,t)}catch(Ro){return Ya(Ro)?Ro:new _e(Ro)}}),$s=$r(function(e,t){return xt(t,function(t){t=No(t),ti(e,t,Oa(e[t],e))}),e});function Zs(e){return function(){return e}}var Js=Dr(),eu=Dr(!0);function tu(e){return e}function nu(e){return Mi("function"==typeof e?e:ri(e,1))}var iu=Wi(function(e,t){return function(n){return Ci(n,e,t)}}),ru=Wi(function(e,t){return function(n){return Ci(e,n,t)}});function ou(e,t,n){var i=As(t),r=yi(t,i);null==n&&(!Za(t)||!r.length&&i.length)&&(n=t,t=e,e=this,r=yi(t,As(t)));var o=!(Za(n)&&"chain"in n&&!n.chain),a=Ka(e);return xt(r,function(n){var i=t[n];e[n]=i,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),r=n.__actions__=Sr(this.__actions__);return r.push({func:i,args:arguments,thisArg:e}),n.__chain__=t,n}return i.apply(e,Pt([this.value()],arguments))})}),e}function au(){}var su=Fr(At),uu=Fr(Et),cu=Fr(Rt);function lu(e){return go(e)?zt(No(e)):function(e){return function(t){return bi(t,e)}}(e)}var hu=Vr(),fu=Vr(!0);function du(){return[]}function pu(){return!1}var vu=jr(function(e,t){return e+t},0),gu=Hr("ceil"),mu=jr(function(e,t){return e/t},1),yu=Hr("floor"),bu=jr(function(e,t){return e*t},1),_u=Hr("round"),wu=jr(function(e,t){return e-t},0);return Ln.after=function(e,t){if("function"!=typeof t)throw new Ce(o);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Ea,Ln.assign=ms,Ln.assignIn=ys,Ln.assignInWith=bs,Ln.assignWith=_s,Ln.at=ws,Ln.before=Ca,Ln.bind=Oa,Ln.bindAll=$s,Ln.bindKey=Ta,Ln.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ua(e)?e:[e]},Ln.chain=la,Ln.chunk=function(e,t,n){t=(n?vo(e,t,n):t===r)?1:pn(fs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,u=i(lt(o/t));ao?0:o+n),(i=i===r||i>o?o:fs(i))<0&&(i+=o),i=n>i?0:ds(i);n>>0)?(e=gs(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=rr(t))&&nn(e)?gr(cn(e),0,n):e.split(t,n):[]},Ln.spread=function(e,t){if("function"!=typeof e)throw new Ce(o);return t=null==t?0:pn(fs(t),0),Wi(function(n){var i=n[t],r=gr(n,0,t);return i&&Pt(r,i),wt(e,this,r)})},Ln.tail=function(e){var t=null==e?0:e.length;return t?Zi(e,1,t):[]},Ln.take=function(e,t,n){return e&&e.length?Zi(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Ln.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?Zi(e,(t=i-(t=n||t===r?1:fs(t)))<0?0:t,i):[]},Ln.takeRightWhile=function(e,t){return e&&e.length?ur(e,io(t,3),!1,!0):[]},Ln.takeWhile=function(e,t){return e&&e.length?ur(e,io(t,3)):[]},Ln.tap=function(e,t){return t(e),e},Ln.throttle=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new Ce(o);return Za(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Aa(e,t,{leading:i,maxWait:t,trailing:r})},Ln.thru=ha,Ln.toArray=ls,Ln.toPairs=Ls,Ln.toPairsIn=js,Ln.toPath=function(e){return Ua(e)?At(e,No):as(e)?[e]:Sr(Do(gs(e)))},Ln.toPlainObject=vs,Ln.transform=function(e,t,n){var i=Ua(e),r=i||qa(e)||ss(e);if(t=io(t,4),null==n){var o=e&&e.constructor;n=r?i?new o:[]:Za(e)&&Ka(o)?jn(Ue(e)):{}}return(r?xt:gi)(e,function(e,i,r){return t(n,e,i,r)}),n},Ln.unary=function(e){return Ea(e,1)},Ln.union=Jo,Ln.unionBy=ea,Ln.unionWith=ta,Ln.uniq=function(e){return e&&e.length?or(e):[]},Ln.uniqBy=function(e,t){return e&&e.length?or(e,io(t,2)):[]},Ln.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?or(e,r,t):[]},Ln.unset=function(e,t){return null==e||ar(e,t)},Ln.unzip=na,Ln.unzipWith=ia,Ln.update=function(e,t,n){return null==e?e:sr(e,t,dr(n))},Ln.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:sr(e,t,dr(n),i)},Ln.values=Fs,Ln.valuesIn=function(e){return null==e?[]:Yt(e,Ps(e))},Ln.without=ra,Ln.words=Ks,Ln.wrap=function(e,t){return Na(dr(t),e)},Ln.xor=oa,Ln.xorBy=aa,Ln.xorWith=sa,Ln.zip=ua,Ln.zipObject=function(e,t){return hr(e||[],t||[],$n)},Ln.zipObjectDeep=function(e,t){return hr(e||[],t||[],Yi)},Ln.zipWith=ca,Ln.entries=Ls,Ln.entriesIn=js,Ln.extend=ys,Ln.extendWith=bs,ou(Ln,Ln),Ln.add=vu,Ln.attempt=Qs,Ln.camelCase=Bs,Ln.capitalize=Vs,Ln.ceil=gu,Ln.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ps(n))==n?n:0),t!==r&&(t=(t=ps(t))==t?t:0),ii(ps(e),t,n)},Ln.clone=function(e){return ri(e,4)},Ln.cloneDeep=function(e){return ri(e,5)},Ln.cloneDeepWith=function(e,t){return ri(e,5,t="function"==typeof t?t:r)},Ln.cloneWith=function(e,t){return ri(e,4,t="function"==typeof t?t:r)},Ln.conformsTo=function(e,t){return null==t||oi(e,t,As(t))},Ln.deburr=zs,Ln.defaultTo=function(e,t){return null==e||e!=e?t:e},Ln.divide=mu,Ln.endsWith=function(e,t,n){e=gs(e),t=rr(t);var i=e.length,o=n=n===r?i:ii(fs(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Ln.eq=Fa,Ln.escape=function(e){return(e=gs(e))&&X.test(e)?e.replace(W,en):e},Ln.escapeRegExp=function(e){return(e=gs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Ln.every=function(e,t,n){var i=Ua(e)?Et:li;return n&&vo(e,t,n)&&(t=r),i(e,io(t,3))},Ln.find=pa,Ln.findIndex=zo,Ln.findKey=function(e,t){return Nt(e,io(t,3),gi)},Ln.findLast=va,Ln.findLastIndex=Uo,Ln.findLastKey=function(e,t){return Nt(e,io(t,3),mi)},Ln.floor=yu,Ln.forEach=ga,Ln.forEachRight=ma,Ln.forIn=function(e,t){return null==e?e:pi(e,io(t,3),Ps)},Ln.forInRight=function(e,t){return null==e?e:vi(e,io(t,3),Ps)},Ln.forOwn=function(e,t){return e&&gi(e,io(t,3))},Ln.forOwnRight=function(e,t){return e&&mi(e,io(t,3))},Ln.get=Ss,Ln.gt=Ba,Ln.gte=Va,Ln.has=function(e,t){return null!=e&&lo(e,t,xi)},Ln.hasIn=Es,Ln.head=Go,Ln.identity=tu,Ln.includes=function(e,t,n,i){e=Ga(e)?e:Fs(e),n=n&&!i?fs(n):0;var r=e.length;return n<0&&(n=pn(r+n,0)),os(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&jt(e,t,n)>-1},Ln.indexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:fs(n);return r<0&&(r=pn(i+r,0)),jt(e,t,r)},Ln.inRange=function(e,t,n){return t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,n){return e>=vn(t,n)&&e=-h&&e<=h},Ln.isSet=rs,Ln.isString=os,Ln.isSymbol=as,Ln.isTypedArray=ss,Ln.isUndefined=function(e){return e===r},Ln.isWeakMap=function(e){return Ja(e)&&co(e)==A},Ln.isWeakSet=function(e){return Ja(e)&&"[object WeakSet]"==wi(e)},Ln.join=function(e,t){return null==e?"":Ut.call(e,t)},Ln.kebabCase=Us,Ln.last=Yo,Ln.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=fs(n))<0?pn(i+o,0):vn(o,i-1)),t==t?function(e,t,n){for(var i=n+1;i--;)if(e[i]===t)return i;return i}(e,t,o):Lt(e,Bt,o,!0)},Ln.lowerCase=Hs,Ln.lowerFirst=Gs,Ln.lt=us,Ln.lte=cs,Ln.max=function(e){return e&&e.length?hi(e,tu,ki):r},Ln.maxBy=function(e,t){return e&&e.length?hi(e,io(t,2),ki):r},Ln.mean=function(e){return Vt(e,tu)},Ln.meanBy=function(e,t){return Vt(e,io(t,2))},Ln.min=function(e){return e&&e.length?hi(e,tu,Ri):r},Ln.minBy=function(e,t){return e&&e.length?hi(e,io(t,2),Ri):r},Ln.stubArray=du,Ln.stubFalse=pu,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=bu,Ln.nth=function(e,t){return e&&e.length?Fi(e,fs(t)):r},Ln.noConflict=function(){return ct._===this&&(ct._=Le),this},Ln.noop=au,Ln.now=Sa,Ln.pad=function(e,t,n){e=gs(e);var i=(t=fs(t))?un(e):0;if(!t||i>=t)return e;var r=(t-i)/2;return Br(ht(r),n)+e+Br(lt(r),n)},Ln.padEnd=function(e,t,n){e=gs(e);var i=(t=fs(t))?un(e):0;return t&&it){var i=e;e=t,t=i}if(n||e%1||t%1){var o=yn();return vn(e+o*(t-e+ot("1e-"+((o+"").length-1))),t)}return Hi(e,t)},Ln.reduce=function(e,t,n){var i=Ua(e)?Mt:Ht,r=arguments.length<3;return i(e,io(t,4),n,r,ui)},Ln.reduceRight=function(e,t,n){var i=Ua(e)?It:Ht,r=arguments.length<3;return i(e,io(t,4),n,r,ci)},Ln.repeat=function(e,t,n){return t=(n?vo(e,t,n):t===r)?1:fs(t),Gi(gs(e),t)},Ln.replace=function(){var e=arguments,t=gs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ln.result=function(e,t,n){var i=-1,o=(t=pr(t,e)).length;for(o||(o=1,e=r);++ih)return[];var n=f,i=vn(e,f);t=io(t),e-=f;for(var r=Wt(i,t);++n=a)return e;var u=n-un(i);if(u<1)return i;var c=s?gr(s,0,u).join(""):e.slice(0,u);if(o===r)return c+i;if(s&&(u+=c.length-u),is(o)){if(e.slice(u).search(o)){var l,h=c;for(o.global||(o=Se(o.source,gs(he.exec(o))+"g")),o.lastIndex=0;l=o.exec(h);)var f=l.index;c=c.slice(0,f===r?u:f)}}else if(e.indexOf(rr(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+i},Ln.unescape=function(e){return(e=gs(e))&&q.test(e)?e.replace(G,hn):e},Ln.uniqueId=function(e){var t=++Ie;return gs(e)+t},Ln.upperCase=Xs,Ln.upperFirst=Ys,Ln.each=ga,Ln.eachRight=ma,Ln.first=Go,ou(Ln,function(){var e={};return gi(Ln,function(t,n){Me.call(Ln.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),Ln.VERSION="4.17.21",xt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Ln[e].placeholder=Ln}),xt(["drop","take"],function(e,t){Vn.prototype[e]=function(n){n=n===r?1:pn(fs(n),0);var i=this.__filtered__&&!t?new Vn(this):this.clone();return i.__filtered__?i.__takeCount__=vn(n,i.__takeCount__):i.__views__.push({size:vn(n,f),type:e+(i.__dir__<0?"Right":"")}),i},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),xt(["filter","map","takeWhile"],function(e,t){var n=t+1,i=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}}),xt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}}),xt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}}),Vn.prototype.compact=function(){return this.filter(tu)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=Wi(function(e,t){return"function"==typeof e?new Vn(this):this.map(function(n){return Ci(n,e,t)})}),Vn.prototype.reject=function(e){return this.filter(Ra(io(e)))},Vn.prototype.slice=function(e,t){e=fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(f)},gi(Vn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Ln[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);!o||(Ln.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,u=t instanceof Vn,c=s[0],l=u||Ua(t),h=function(e){var t=o.apply(Ln,Pt([e],s));return i&&f?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var f=this.__chain__,d=!!this.__actions__.length,p=a&&!f,v=u&&!d;if(!a&&l){t=v?t:new Vn(this);var g=e.apply(t,s);return g.__actions__.push({func:ha,args:[h],thisArg:r}),new Bn(g,f)}return p&&v?e.apply(this,s):(g=this.thru(h),p?i?g.value()[0]:g.value():g)})}),xt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Ln.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var r=this.value();return t.apply(Ua(r)?r:[],e)}return this[n](function(n){return t.apply(Ua(n)?n:[],e)})}}),gi(Vn.prototype,function(e,t){var n=Ln[t];if(n){var i=n.name+"";Me.call(On,i)||(On[i]=[]),On[i].push({name:t,func:n})}}),On[Nr(r,2).name]=[{name:"wrapper",func:r}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=Sr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Sr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Sr(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ua(e),i=t<0,r=n?e.length:0,o=function(e,t,n){for(var i=-1,r=n.length;++i=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Ln.prototype.plant=function(e){for(var t,n=this;n instanceof Fn;){var i=jo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Ln.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:ha,args:[Zo],thisArg:r}),new Bn(t,this.__chain__)}return this.thru(Zo)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return cr(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,Xe&&(Ln.prototype[Xe]=function(){return this}),Ln}();ct._=fn,(i=(function(){return fn}).call(t,n,t,e))!==r&&(e.exports=i)}).call(this)},5478:function(e){e.exports=function(){"use strict";function e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i={exports:{}};i.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:function(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}},changeDefaults:function(e){i.exports.defaults=e}};var r=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,u={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(e){return u[e]},l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(e){return e.replace(l,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}var f=/(^|[^\[])\^/g,d=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,v={},g=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(e,t,n){var i=e.length;if(0===i)return"";for(var r=0;r=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/),i=0;if(n.length>t)n.splice(t);else for(;n.length1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:S(n,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map(function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=i.length?e.slice(i.length):e}).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:i}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var i=S(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n}}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:E(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,i,r,o,a,s,u,c,l,h=t[0],f=t[2],d=f.length>1,p={type:"list",raw:h,ordered:d,start:d?+f.slice(0,-1):"",loose:!1,items:[]},v=t[0].match(this.rules.block.item),g=!1,m=v.length;r=this.rules.block.listItemStart.exec(v[0]);for(var y=0;yr[1].length:o[1].length>=r[0].length||o[1].length>3){v.splice(y,2,v[y]+(!this.options.pedantic&&o[1].length/i.test(i[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):C(i[0]):i[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;var i=S(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,i=0,r=0;r-1){var o=(0===t[0].indexOf("!")?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,o).trim(),t[3]=""}}var a=t[2],s="";if(this.options.pedantic){var u=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);u&&(a=u[1],s=u[3])}else s=t[3]?t[3].slice(1,-1):"";return a=a.trim(),/^$/.test(n)?a.slice(1):a.slice(1,-1)),O(t,{href:a&&a.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=t[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return O(n,i,n[0])}},t.emStrong=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(e);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var o,a,s=i[0].length-1,u=s,c=0,l="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+s);null!=(i=l.exec(t));)if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6]){if(a=o.length,i[3]||i[4]){u+=a;continue}if((i[5]||i[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(!((u-=a)>0))return a=Math.min(a,a+u+c),Math.min(s,a)%2?{type:"em",raw:e.slice(0,s+i.index+a+1),text:e.slice(1,s+i.index+a)}:{type:"strong",raw:e.slice(0,s+i.index+a+1),text:e.slice(2,s+i.index+a-1)}}}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=C(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}},t.autolink=function(e,t){var n,i,r=this.rules.inline.autolink.exec(e);if(r)return i="@"===r[2]?"mailto:"+(n=C(this.options.mangle?t(r[1]):r[1])):n=C(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var i,r;if("@"===n[2])r="mailto:"+(i=C(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=C(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},t.inlineText=function(e,t,n){var i,r=this.rules.inline.text.exec(e);if(r)return i=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):C(r[0]):r[0]:C(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},e}(),A={exec:function(){}},P=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,i){return i=(i=i.source||i).replace(f,"$1"),e=e.replace(t,i),n},getRegex:function(){return new RegExp(e,t)}};return n},M=k,I={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:A,table:A,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};I.def=P(I.def).replace("label",I._label).replace("title",I._title).getRegex(),I.bullet=/(?:[*+-]|\d{1,9}[.)])/,I.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,I.item=P(I.item,"gm").replace(/bull/g,I.bullet).getRegex(),I.listItemStart=P(/^( *)(bull) */).replace("bull",I.bullet).getRegex(),I.list=P(I.list).replace(/bull/g,I.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+I.def.source+")").getRegex(),I._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",I._comment=/|$)/,I.html=P(I.html,"i").replace("comment",I._comment).replace("tag",I._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),I.paragraph=P(I._paragraph).replace("hr",I.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",I._tag).getRegex(),I.blockquote=P(I.blockquote).replace("paragraph",I.paragraph).getRegex(),I.normal=M({},I),I.gfm=M({},I.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),I.gfm.nptable=P(I.gfm.nptable).replace("hr",I.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",I._tag).getRegex(),I.gfm.table=P(I.gfm.table).replace("hr",I.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",I._tag).getRegex(),I.pedantic=M({},I.normal,{html:P("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",I._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,paragraph:P(I.normal._paragraph).replace("hr",I.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",I.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var R={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:A,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:A,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};R.punctuation=P(R.punctuation).replace(/punctuation/g,R._punctuation).getRegex(),R.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,R.escapedEmSt=/\\\*|\\_/g,R._comment=P(I._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),R.emStrong.lDelim=P(R.emStrong.lDelim).replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimAst=P(R.emStrong.rDelimAst,"g").replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimUnd=P(R.emStrong.rDelimUnd,"g").replace(/punct/g,R._punctuation).getRegex(),R._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,R._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,R._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,R.autolink=P(R.autolink).replace("scheme",R._scheme).replace("email",R._email).getRegex(),R._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,R.tag=P(R.tag).replace("comment",R._comment).replace("attribute",R._attribute).getRegex(),R._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,R._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,R.link=P(R.link).replace("label",R._label).replace("href",R._href).replace("title",R._title).getRegex(),R.reflink=P(R.reflink).replace("label",R._label).getRegex(),R.reflinkSearch=P(R.reflinkSearch,"g").replace("reflink",R.reflink).replace("nolink",R.nolink).getRegex(),R.normal=M({},R),R.pedantic=M({},R.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:P(/^!?\[(label)\]\((.*?)\)/).replace("label",R._label).getRegex(),reflink:P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",R._label).getRegex()}),R.gfm=M({},R.normal,{escape:P(R.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\1;)1&t&&(n+=e),t>>=1,e+=e;return n+e};function V(e){return e.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026")}function z(e){var t,n,i="",r=e.length;for(t=0;t.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var U=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||L,this.options.tokenizer=this.options.tokenizer||new N,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:j.normal,inline:F.normal};this.options.pedantic?(t.block=j.pedantic,t.inline=F.pedantic):this.options.gfm&&(t.block=j.gfm,t.inline=this.options.breaks?F.breaks:F.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)},t.lexInline=function(e,n){return new t(n).inlineTokens(e)};var n=t.prototype;return n.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(e,t,n){var i,r,o,a,s,u,c=this;for(void 0===t&&(t=[]),void 0===n&&(n=!0),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(n){return!!(i=n.call(c,e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.type&&t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),(a=t[t.length-1])&&"paragraph"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.nptable(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),t.push(i);continue}if(i=this.tokenizer.list(e)){for(e=e.substring(i.raw.length),o=i.items.length,r=0;r=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),n&&(i=this.tokenizer.paragraph(s))){a=t[t.length-1],u&&"paragraph"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text):t.push(i),u=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),(a=t[t.length-1])&&"text"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text):t.push(i);continue}if(e){var l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}}return t},n.inline=function(e){var t,n,i,r,o,a,s=e.length;for(t=0;t0)for(;null!=(u=this.tokenizer.rules.inline.reflinkSearch.exec(h));)f.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,u.index)+"["+B("a",u[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(u=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,u.index)+"["+B("a",u[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(u=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,u.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(c||(l=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(n){return!!(o=n.call(r,e,t))&&(e=e.substring(o.raw.length),t.push(o),!0)}))){if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e,n,i)){e=e.substring(o.raw.length),n=o.inLink,i=o.inRawBlock,(a=t[t.length-1])&&"text"===o.type&&"text"===a.type?(a.raw+=o.raw,a.text+=o.text):t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length),a=t[t.length-1],"link"===o.type?(o.tokens=this.inlineTokens(o.text,[],!0,i),t.push(o)):a&&"text"===o.type&&"text"===a.type?(a.raw+=o.raw,a.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,h,l)){e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);continue}if(o=this.tokenizer.autolink(e,z)){e=e.substring(o.raw.length),t.push(o);continue}if(!n&&(o=this.tokenizer.url(e,z))){e=e.substring(o.raw.length),t.push(o);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,n=e.slice(1),i=void 0;r.options.extensions.startInline.forEach(function(e){"number"==typeof(i=e.call(this,n))&&i>=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),o=this.tokenizer.inlineText(s,i,V)){e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(l=o.raw.slice(-1)),c=!0,(a=t[t.length-1])&&"text"===a.type?(a.raw+=o.raw,a.text+=o.text):t.push(o);continue}if(e){var d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}throw new Error(d)}}return t},function(t,n,i){i&&e(t,i)}(t,0,[{key:"rules",get:function(){return{block:j,inline:F}}}]),t}(),H=i.exports.defaults,G=function(e,t,n){if(e){var i;try{i=decodeURIComponent(h(n)).replace(d,"").toLowerCase()}catch(r){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}t&&!p.test(n)&&(n=function(e,t){v[" "+e]||(v[" "+e]=g.test(e)?e+"/":b(e,"/",!0));var n=-1===(e=v[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(y,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(r){return null}return n},W=_,q=function(){function e(e){this.options=e||H}var t=e.prototype;return t.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(e,i);null!=r&&r!==e&&(n=!0,e=r)}return e=e.replace(/\n$/,"")+"\n",i?'
    '+(n?e:W(e,!0))+"
    \n":"
    "+(n?e:W(e,!0))+"
    \n"},t.blockquote=function(e){return"
    \n"+e+"
    \n"},t.html=function(e){return e},t.heading=function(e,t,n,i){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},t.list=function(e,t,n){var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;var i='"+n+""},t.image=function(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;var i=''+n+'":">")},t.text=function(e){return e},e}(),X=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),Y=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var n=e,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[e];do{n=e+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=i,this.seen[n]=0),n},t.slug=function(e,t){void 0===t&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),K=q,Q=X,$=Y,Z=i.exports.defaults,J=w,ee=U,te=function(){function e(e){this.options=e||Z,this.options.renderer=this.options.renderer||new K,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Q,this.slugger=new $}e.parse=function(t,n){return new e(n).parse(t)},e.parseInline=function(t,n){return new e(n).parseInline(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,i,r,o,a,s,u,c,l,h,f,d,p,v,g,m,y,b,_,w="",k=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):v+=b),v+=this.parse(g.tokens,p),l+=this.renderer.listitem(v,y,m);w+=this.renderer.list(l,f,d);continue;case"html":w+=this.renderer.html(h.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(l=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+ue(u.message+"",!0)+"
    ";throw u}}return fe.options=fe.setOptions=function(e){return ae(fe.defaults,e),le(fe.defaults),fe},fe.getDefaults=ce,fe.defaults=he,fe.use=function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;iAn error occurred:

    "+ue(i.message+"",!0)+"
    ";throw i}},fe.Parser=te,fe.parser=te.parse,fe.Renderer=ie,fe.TextRenderer=re,fe.Lexer=ee,fe.lexer=ee.lex,fe.Tokenizer=ne,fe.Slugger=oe,fe.parse=fe,fe}()},29369:function(e,t,n){var i=n(56284),r=n(67830);function o(){this.clear()}o.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},o.prototype.enqueue=function(e){return this.items.push(e),++this.size},o.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},o.prototype.peek=function(){if(this.size)return this.items[this.offset]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.offset,i=0,r=this.items.length;n=e.length)return{done:!0};var n=e[t];return t++,{value:n,done:!1}})},o.prototype.entries=function(){var e=this.items,t=this.offset,n=0;return new i(function(){if(t>=e.length)return{done:!0};var i=e[t];return t++,{value:[n++,i],done:!1}})},"undefined"!=typeof Symbol&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(",")},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:o,enumerable:!1}),e},"undefined"!=typeof Symbol&&(o.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.prototype.inspect),o.from=function(e){var t=new o;return r(e,function(e){t.enqueue(e)}),t},o.of=function(){return o.from(arguments)},e.exports=o},65593:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(72293),a=function(e){function t(){e.apply(this,arguments),this.value=null,this.hasNext=!1,this.hasCompleted=!1}return i(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),o.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),o.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(r.Subject);t.AsyncSubject=a},73907:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(6594),a=function(e){function t(t){e.call(this),this._value=t}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new o.ObjectUnsubscribedError;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r.Subject);t.BehaviorSubject=a},36888:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t,n,i){e.call(this),this.parent=t,this.outerValue=n,this.outerIndex=i,this.index=0}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(n(42109).Subscriber);t.InnerSubscriber=r},94429:function(e,t,n){"use strict";var i=n(18705),r=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return i.Observable.of(this.value);case"E":return i.Observable.throw(this.error);case"C":return i.Observable.empty()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();t.Notification=r},18705:function(e,t,n){"use strict";var i=n(80019),r=n(18154),o=n(45783),a=n(10142),s=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var i=this.operator,o=r.toSubscriber(e,t,n);if(i?i.call(o,this.source):o.add(this.source||!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.syncErrorThrown=!0,e.syncErrorValue=t,e.error(t)}},e.prototype.forEach=function(e,t){var n=this;if(t||(i.root.Rx&&i.root.Rx.config&&i.root.Rx.config.Promise?t=i.root.Rx.config.Promise:i.root.Promise&&(t=i.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,i){var r;r=n.subscribe(function(t){if(r)try{e(t)}catch(n){i(n),r.unsubscribe()}else e(t)},i,t)})},e.prototype._subscribe=function(e){return this.source.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;tt&&(o=Math.max(o,r-t)),o>0&&i.splice(0,o),i},t}(r.Subject);t.ReplaySubject=l;var h=function(e,t){this.time=e,this.value=t}},25430:function(e,t,n){"use strict";var i=n(2369);t.xQ=i.Subject,n(18705),n(24769),n(95914),n(88007),n(3194),n(61898),n(16301),n(23276),n(66593),n(13745),n(57362),n(24518),n(68789),n(30520),n(67370),n(86866),n(11505),n(5031),n(36780),n(17038),n(15718),n(27915),n(90763),n(6846),n(65662),n(6799),n(81854),n(612),n(10838),n(6725),n(8827),n(43511),n(38922),n(25178),n(56937),n(22947),n(82894),n(11206),n(94183),n(16653),n(17930),n(81118),n(50317),n(90674),n(66460),n(79232),n(3945),n(44674),n(73505),n(38749),n(16479),n(22744),n(44475),n(97384),n(8237),n(24937),n(99013),n(84042),n(44436),n(7099),n(6217),n(57476),n(72646),n(91573),n(27387),n(27366),n(88859),n(65425),n(16733),n(23381),n(80404),n(63770),n(53626),n(98851),n(84878),n(26544),n(53582),n(61749),n(34838),n(49681),n(46227),n(56455),n(40881),n(94315),n(92910),n(52442),n(84664),n(61250),n(28310),n(43027),n(18252),n(49571),n(31782),n(9800),n(41854),n(74839),n(1305),n(99144),n(89952),n(85863),n(2865),n(92667),n(22185),n(72919),n(88630),n(75458),n(40780),n(35099),n(57502),n(81676),n(20579),n(71323),n(84950),n(57113),n(95073),n(75654),n(59889),n(96611),n(81845),n(7828),n(4881),n(74568),n(32352),n(50169),n(93543),n(61690),n(15914),n(68583),n(44808),n(49088),n(72293),n(42109),n(65593),n(81959),n(73907),n(51493),n(94429),n(44640),n(11758),n(6594),n(13815),n(84536),n(73390),n(62688),n(24482),n(18353),n(55298),n(10142),n(85522),n(90680),n(97088),n(12948),n(28592),n(72121),n(45783),n(39053)},11965:function(e,t){"use strict";var n=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=Date.now?Date.now:function(){return+new Date},e}();t.Scheduler=n},2369:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(42109),a=n(72293),s=n(6594),u=n(9060),c=n(28592),l=function(e){function t(t){e.call(this,t),this.destination=t}return i(t,e),t}(o.Subscriber);t.SubjectSubscriber=l;var h=function(e){function t(){e.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return i(t,e),t.prototype[c.rxSubscriber]=function(){return new l(this)},t.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new s.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,n=t.length,i=t.slice(),r=0;r=e.length)return void i.complete();i.next(t[n]),e.index=n+1,this.schedule(e)}},t.prototype._subscribe=function(e){var n=this.arrayLike,i=this.scheduler,r=n.length;if(i)return i.schedule(t.dispatch,0,{arrayLike:n,index:0,length:r,subscriber:e});for(var o=0;o1?new t(e,i):1===r?new o.ScalarObservable(e[0],i):new a.EmptyObservable(i)},t.dispatch=function(e){var t=e.array,n=e.index,i=e.subscriber;n>=e.count?i.complete():(i.next(t[n]),!i.closed&&(e.index=n+1,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.array,i=n.length,r=this.scheduler;if(r)return r.schedule(t.dispatch,0,{array:n,index:0,count:i,subscriber:e});for(var o=0;o1)this.connection=null;else{var n=this.connection,i=e._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null}}(a.Subscriber)},34078:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(93658),a=n(84308),s=function(e){function t(t){e.call(this),this.observableFactory=t}return i(t,e),t.create=function(e){return new t(e)},t.prototype._subscribe=function(e){return new u(e,this.observableFactory)},t}(r.Observable);t.DeferObservable=s;var u=function(e){function t(t,n){e.call(this,t),this.factory=n,this.tryDefer()}return i(t,e),t.prototype.tryDefer=function(){try{this._callFactory()}catch(e){this._error(e)}},t.prototype._callFactory=function(){var e=this.factory();e&&this.add(o.subscribeToResult(this,e))},t}(a.OuterSubscriber)},70481:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t){e.call(this),this.scheduler=t}return i(t,e),t.create=function(e){return new t(e)},t.dispatch=function(e){e.subscriber.complete()},t.prototype._subscribe=function(e){var n=this.scheduler;if(n)return n.schedule(t.dispatch,0,{subscriber:e});e.complete()},t}(n(18705).Observable);t.EmptyObservable=r},72210:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t,n){e.call(this),this.error=t,this.scheduler=n}return i(t,e),t.create=function(e,n){return new t(e,n)},t.dispatch=function(e){e.subscriber.error(e.error)},t.prototype._subscribe=function(e){var n=this.error,i=this.scheduler;if(e.syncErrorThrowable=!0,i)return i.schedule(t.dispatch,0,{error:n,subscriber:e});e.error(n)},t}(n(18705).Observable);t.ErrorObservable=r},56064:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(70481),a=n(48242),s=n(93658),u=n(84308),c=function(e){function t(t,n){e.call(this),this.sources=t,this.resultSelector=n}return i(t,e),t.create=function(){for(var e=[],n=0;nl?l:t:t}(e)),this.arr=e,this.idx=t,this.len=n}return e.prototype[a.iterator]=function(){return this},e.prototype.next=function(){return this.idx=e.count?i.complete():(i.next(t),!i.closed&&(e.index=n+1,e.start=t+1,this.schedule(e)))},t.prototype._subscribe=function(e){var n=0,i=this.start,r=this._count,o=this.scheduler;if(o)return o.schedule(t.dispatch,0,{index:n,count:r,start:i,subscriber:e});for(;;){if(n++>=r){e.complete();break}if(e.next(i++),e.closed)break}},t}(n(18705).Observable);t.RangeObservable=r},80478:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t,n){e.call(this),this.value=t,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return i(t,e),t.create=function(e,n){return new t(e,n)},t.dispatch=function(e){var t=e.value,n=e.subscriber;e.done?n.complete():(n.next(t),!n.closed&&(e.done=!0,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.value,i=this.scheduler;if(i)return i.schedule(t.dispatch,0,{done:!1,value:n,subscriber:e});e.next(n),e.closed||e.complete()},t}(n(18705).Observable);t.ScalarObservable=r},82966:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(85522),a=n(39479),s=function(e){function t(t,n,i){void 0===n&&(n=0),void 0===i&&(i=o.asap),e.call(this),this.source=t,this.delayTime=n,this.scheduler=i,(!a.isNumeric(n)||n<0)&&(this.delayTime=0),(!i||"function"!=typeof i.schedule)&&(this.scheduler=o.asap)}return i(t,e),t.create=function(e,n,i){return void 0===n&&(n=0),void 0===i&&(i=o.asap),new t(e,n,i)},t.dispatch=function(e){return this.add(e.source.subscribe(e.subscriber))},t.prototype._subscribe=function(e){return this.scheduler.schedule(t.dispatch,this.delayTime,{source:this.source,subscriber:e})},t}(r.Observable);t.SubscribeOnObservable=s},92870:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(39479),o=n(18705),a=n(90680),s=n(41503),u=n(783),c=function(e){function t(t,n,i){void 0===t&&(t=0),e.call(this),this.period=-1,this.dueTime=0,r.isNumeric(n)?this.period=Number(n)<1?1:Number(n):s.isScheduler(n)&&(i=n),s.isScheduler(i)||(i=a.async),this.scheduler=i,this.dueTime=u.isDate(t)?+t-this.scheduler.now():t}return i(t,e),t.create=function(e,n,i){return void 0===e&&(e=0),new t(e,n,i)},t.dispatch=function(e){var t=e.index,n=e.period,i=e.subscriber;if(i.next(t),!i.closed){if(-1===n)return i.complete();e.index=t+1,this.schedule(e,n)}},t.prototype._subscribe=function(e){var n=this;return n.scheduler.schedule(t.dispatch,n.dueTime,{index:0,period:n.period,subscriber:e})},t}(o.Observable);t.TimerObservable=c},16196:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(18705),o=n(93658),a=n(84308),s=function(e){function t(t,n){e.call(this),this.resourceFactory=t,this.observableFactory=n}return i(t,e),t.create=function(e,n){return new t(e,n)},t.prototype._subscribe=function(e){var t,n=this.resourceFactory,i=this.observableFactory;try{return t=n(),new u(e,t,i)}catch(r){e.error(r)}},t}(r.Observable);t.UsingObservable=s;var u=function(e){function t(t,n,i){e.call(this,t),this.resource=n,this.observableFactory=i,t.add(n),this.tryUse()}return i(t,e),t.prototype.tryUse=function(){try{var e=this.observableFactory.call(this,this.resource);e&&this.add(o.subscribeToResult(this,e))}catch(t){this._error(t)}},t}(a.OuterSubscriber)},59246:function(e,t,n){"use strict";var i=n(19183);t.bindCallback=i.BoundCallbackObservable.create},65571:function(e,t,n){"use strict";var i=n(78655);t.bindNodeCallback=i.BoundNodeCallbackObservable.create},24669:function(e,t,n){"use strict";var i=n(41503),r=n(48242),o=n(96177),a=n(49134);t.combineLatest=function(){for(var e=[],t=0;t1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof u&&(n=e.pop()),null===s&&1===e.length&&e[0]instanceof i.Observable?e[0]:a.mergeAll(n)(new r.ArrayObservable(e,s))}},94503:function(e,t,n){"use strict";var i=n(20143);t.never=i.NeverObservable.create},69657:function(e,t,n){"use strict";var i=n(96177);t.of=i.ArrayObservable.of},61395:function(e,t,n){"use strict";var i=n(46243);t.onErrorResumeNext=i.onErrorResumeNextStatic},95425:function(e,t,n){"use strict";var i=n(19770);t.pairs=i.PairsObservable.create},24330:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(48242),o=n(96177),a=n(84308),s=n(93658);t.race=function(){for(var e=[],t=0;t=2&&(a=arguments[1]);var s=Number.POSITIVE_INFINITY;return t>=3&&(s=arguments[2]),o.bufferTime(e,a,s,n)(this)}},92523:function(e,t,n){"use strict";var i=n(15440);t.bufferToggle=function(e,t){return i.bufferToggle(e,t)(this)}},49436:function(e,t,n){"use strict";var i=n(51786);t.bufferWhen=function(e){return i.bufferWhen(e)(this)}},64731:function(e,t,n){"use strict";var i=n(93017);t._catch=function(e){return i.catchError(e)(this)}},92273:function(e,t,n){"use strict";var i=n(17054);t.combineAll=function(e){return i.combineAll(e)(this)}},8709:function(e,t,n){"use strict";var i=n(49134);t.combineLatest=function(){for(var e=[],t=0;t=2?i.reduce(e,t)(this):i.reduce(e)(this)}},12931:function(e,t,n){"use strict";var i=n(15329);t.repeat=function(e){return void 0===e&&(e=-1),i.repeat(e)(this)}},68816:function(e,t,n){"use strict";var i=n(63964);t.repeatWhen=function(e){return i.repeatWhen(e)(this)}},17144:function(e,t,n){"use strict";var i=n(40241);t.retry=function(e){return void 0===e&&(e=-1),i.retry(e)(this)}},82766:function(e,t,n){"use strict";var i=n(23896);t.retryWhen=function(e){return i.retryWhen(e)(this)}},62068:function(e,t,n){"use strict";var i=n(92043);t.sample=function(e){return i.sample(e)(this)}},97013:function(e,t,n){"use strict";var i=n(90680),r=n(71239);t.sampleTime=function(e,t){return void 0===t&&(t=i.async),r.sampleTime(e,t)(this)}},98996:function(e,t,n){"use strict";var i=n(64949);t.scan=function(e,t){return arguments.length>=2?i.scan(e,t)(this):i.scan(e)(this)}},77033:function(e,t,n){"use strict";var i=n(88948);t.sequenceEqual=function(e,t){return i.sequenceEqual(e,t)(this)}},10377:function(e,t,n){"use strict";var i=n(35473);t.share=function(){return i.share()(this)}},71623:function(e,t,n){"use strict";var i=n(62704);t.shareReplay=function(e,t,n){return i.shareReplay(e,t,n)(this)}},91956:function(e,t,n){"use strict";var i=n(92223);t.single=function(e){return i.single(e)(this)}},72355:function(e,t,n){"use strict";var i=n(11189);t.skip=function(e){return i.skip(e)(this)}},69329:function(e,t,n){"use strict";var i=n(73346);t.skipLast=function(e){return i.skipLast(e)(this)}},68481:function(e,t,n){"use strict";var i=n(12928);t.skipUntil=function(e){return i.skipUntil(e)(this)}},587:function(e,t,n){"use strict";var i=n(69415);t.skipWhile=function(e){return i.skipWhile(e)(this)}},49292:function(e,t,n){"use strict";var i=n(30673);t.startWith=function(){for(var e=[],t=0;t0&&this.destination.next(t),e.prototype._complete.call(this)},t}(r.Subscriber),s=function(e){function t(t,n,i){e.call(this,t),this.bufferSize=n,this.startBufferEvery=i,this.buffers=[],this.count=0}return i(t,e),t.prototype._next=function(e){var t=this,n=t.bufferSize,i=t.startBufferEvery,r=t.buffers,o=t.count;this.count++,o%i==0&&r.push([]);for(var a=r.length;a--;){var s=r[a];s.push(e),s.length===n&&(r.splice(a,1),this.destination.next(s))}},t.prototype._complete=function(){for(var t=this.buffers,n=this.destination;t.length>0;){var i=t.shift();i.length>0&&n.next(i)}e.prototype._complete.call(this)},t}(r.Subscriber)},6489:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(90680),o=n(42109),a=n(41503);t.bufferTime=function(e){var t=arguments.length,n=r.async;a.isScheduler(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],t--);var i=null;t>=2&&(i=arguments[1]);var o=Number.POSITIVE_INFINITY;return t>=3&&(o=arguments[2]),function(t){return t.lift(new s(e,i,o,n))}};var s=function(){function e(e,t,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=n,this.scheduler=i}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),u=function(){this.buffer=[]},c=function(e){function t(t,n,i,r,o){e.call(this,t),this.bufferTimeSpan=n,this.bufferCreationInterval=i,this.maxBufferSize=r,this.scheduler=o,this.contexts=[];var a=this.openContext();if(this.timespanOnly=null==i||i<0,this.timespanOnly)this.add(a.closeAction=o.schedule(l,n,{subscriber:this,context:a,bufferTimeSpan:n}));else{var s={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:this,scheduler:o};this.add(a.closeAction=o.schedule(f,n,{subscriber:this,context:a})),this.add(o.schedule(h,i,s))}}return i(t,e),t.prototype._next=function(e){for(var t,n=this.contexts,i=n.length,r=0;r0;){var i=t.shift();n.next(i.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var n=this.bufferTimeSpan;this.add(e.closeAction=this.scheduler.schedule(l,n,{subscriber:this,context:e,bufferTimeSpan:n}))}},t.prototype.openContext=function(){var e=new u;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(o.Subscriber);function l(e){var t=e.subscriber,n=e.context;n&&t.closeContext(n),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function h(e){var t=e.bufferCreationInterval,n=e.bufferTimeSpan,i=e.subscriber,r=e.scheduler,o=i.openContext();i.closed||(i.add(o.closeAction=r.schedule(f,n,{subscriber:i,context:o})),this.schedule(e,t))}function f(e){e.subscriber.closeContext(e.context)}},15440:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(72293),o=n(93658),a=n(84308);t.bufferToggle=function(e,t){return function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.openings,this.closingSelector))},e}(),u=function(e){function t(t,n,i){e.call(this,t),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(o.subscribeToResult(this,n))}return i(t,e),t.prototype._next=function(e){for(var t=this.contexts,n=t.length,i=0;i0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var n=t.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,i,r){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(n){this._error(n)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var n=e.subscription;this.destination.next(e.buffer),t.splice(t.indexOf(e),1),this.remove(n),n.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,n=new r.Subscription,i={buffer:[],subscription:n};t.push(i);var a=o.subscribeToResult(this,e,i);!a||a.closed?this.closeBuffer(i):(a.context=i,this.add(a),n.add(a))},t}(a.OuterSubscriber)},51786:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(72293),o=n(33463),a=n(85814),s=n(84308),u=n(93658);t.bufferWhen=function(e){return function(t){return t.lift(new c(e))}};var c=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,n){e.call(this,t),this.closingSelector=n,this.subscribing=!1,this.openBuffer()}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},t.prototype.notifyNext=function(e,t,n,i,r){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e=this.closingSubscription;e&&(this.remove(e),e.unsubscribe()),this.buffer&&this.destination.next(this.buffer),this.buffer=[];var t=o.tryCatch(this.closingSelector)();t===a.errorObject?this.error(a.errorObject.e):(e=new r.Subscription,this.closingSubscription=e,this.add(e),this.subscribing=!0,e.add(u.subscribeToResult(this,t)),this.subscribing=!1)},t}(s.OuterSubscriber)},93017:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.catchError=function(e){return function(t){var n=new a(e),i=t.lift(n);return n.caught=i}};var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.selector=n,this.caught=i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(i){return void e.prototype.error.call(this,i)}this._unsubscribeAndRecycle(),this.add(o.subscribeToResult(this,n))}},t}(r.OuterSubscriber)},17054:function(e,t,n){"use strict";var i=n(49134);t.combineAll=function(e){return function(t){return t.lift(new i.CombineLatestOperator(e))}}},49134:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(96177),o=n(48242),a=n(84308),s=n(93658),u={};t.combineLatest=function(){for(var e=[],t=0;t0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){var o=Math.max(0,n[0].time-i.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,n=new l(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(s.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e)},t.prototype._complete=function(){this.scheduleNotification(s.Notification.createComplete())},t}(a.Subscriber),l=function(e,t){this.time=e,this.notification=t}},22944:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(18705),a=n(84308),s=n(93658);t.delayWhen=function(e,t){return t?function(n){return new l(n,t).lift(new u(e))}:function(t){return t.lift(new u(e))}};var u=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delayDurationSelector))},e}(),c=function(e){function t(t,n){e.call(this,t),this.delayDurationSelector=n,this.completed=!1,this.delayNotifierSubscriptions=[],this.values=[]}return i(t,e),t.prototype.notifyNext=function(e,t,n,i,r){this.destination.next(e),this.removeSubscription(r),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){try{var t=this.delayDurationSelector(e);t&&this.tryDelay(t,e)}catch(n){this.destination.error(n)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e),n=null;return-1!==t&&(n=this.values[t],this.delayNotifierSubscriptions.splice(t,1),this.values.splice(t,1)),n},t.prototype.tryDelay=function(e,t){var n=s.subscribeToResult(this,e,t);n&&!n.closed&&(this.add(n),this.delayNotifierSubscriptions.push(n)),this.values.push(t)},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(a.OuterSubscriber),l=function(e){function t(t,n){e.call(this),this.source=t,this.subscriptionDelay=n}return i(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new h(e,this.source))},t}(o.Observable),h=function(e){function t(t,n){e.call(this),this.parent=t,this.source=n,this.sourceSubscribed=!1}return i(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(r.Subscriber)},95591:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.dematerialize=function(){return function(e){return e.lift(new o)}};var o=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new a(e))},e}(),a=function(e){function t(t){e.call(this,t)}return i(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(r.Subscriber)},25753:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658),a=n(40317);t.distinct=function(e,t){return function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.keySelector,this.flushes))},e}(),u=function(e){function t(t,n,i){e.call(this,t),this.keySelector=n,this.values=new a.Set,i&&this.add(o.subscribeToResult(this,i))}return i(t,e),t.prototype.notifyNext=function(e,t,n,i,r){this.values.clear()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,n=this.destination;try{t=this.keySelector(e)}catch(i){return void n.error(i)}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))},t}(r.OuterSubscriber);t.DistinctSubscriber=u},65608:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(33463),a=n(85814);t.distinctUntilChanged=function(e,t){return function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.compare,this.keySelector))},e}(),u=function(e){function t(t,n,i){e.call(this,t),this.keySelector=i,this.hasKey=!1,"function"==typeof n&&(this.compare=n)}return i(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t=e;if(this.keySelector&&(t=o.tryCatch(this.keySelector)(e))===a.errorObject)return this.destination.error(a.errorObject.e);var n=!1;if(this.hasKey){if((n=o.tryCatch(this.compare)(this.key,t))===a.errorObject)return this.destination.error(a.errorObject.e)}else this.hasKey=!0;!1===Boolean(n)&&(this.key=t,this.destination.next(e))},t}(r.Subscriber)},8330:function(e,t,n){"use strict";var i=n(65608);t.distinctUntilKeyChanged=function(e,t){return i.distinctUntilChanged(function(n,i){return t?t(n[e],i[e]):n[e]===i[e]})}},29264:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(11758);t.elementAt=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){if(this.index=e,this.defaultValue=t,e<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.index,this.defaultValue))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.index=n,this.defaultValue=i}return i(t,e),t.prototype._next=function(e){0==this.index--&&(this.destination.next(e),this.destination.complete())},t.prototype._complete=function(){var e=this.destination;this.index>=0&&(void 0!==this.defaultValue?e.next(this.defaultValue):e.error(new o.ArgumentOutOfRangeError)),e.complete()},t}(r.Subscriber)},26285:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.every=function(e,t){return function(n){return n.lift(new o(e,t,n))}};var o=function(){function e(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.thisArg,this.source))},e}(),a=function(e){function t(t,n,i,r){e.call(this,t),this.predicate=n,this.thisArg=i,this.source=r,this.index=0,this.thisArg=i||this}return i(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(n){return void this.destination.error(n)}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(r.Subscriber)},93229:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.exhaust=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){e.call(this,t),this.hasCompleted=!1,this.hasSubscription=!1}return i(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(o.subscribeToResult(this,e)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(e){this.remove(e),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(r.OuterSubscriber)},15758:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.exhaustMap=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.resultSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.resultSelector))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.project=n,this.resultSelector=i,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}return i(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t=this.index++,n=this.destination;try{var i=this.project(e,t);this.hasSubscription=!0,this.add(o.subscribeToResult(this,i,e,t))}catch(r){n.error(r)}},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyNext=function(e,t,n,i,r){var o=this.destination;this.resultSelector?this.trySelectResult(e,t,n,i):o.next(t)},t.prototype.trySelectResult=function(e,t,n,i){var r=this.resultSelector,o=this.destination;try{var a=r(e,t,n,i);o.next(a)}catch(s){o.error(s)}},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.remove(e),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(r.OuterSubscriber)},55364:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(33463),o=n(85814),a=n(84308),s=n(93658);t.expand=function(e,t,n){return void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(i){return i.lift(new u(e,t,n))}};var u=function(){function e(e,t,n){this.project=e,this.concurrent=t,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.concurrent,this.scheduler))},e}();t.ExpandOperator=u;var c=function(e){function t(t,n,i,r){e.call(this,t),this.project=n,this.concurrent=i,this.scheduler=r,this.index=0,this.active=0,this.hasCompleted=!1,i0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(a.OuterSubscriber);t.ExpandSubscriber=c},27015:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.filter=function(e,t){return function(n){return n.lift(new o(e,t))}};var o=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.thisArg))},e}(),a=function(e){function t(t,n,i){e.call(this,t),this.predicate=n,this.thisArg=i,this.count=0}return i(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}t&&this.destination.next(e)},t}(r.Subscriber)},94367:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(72293);t.finalize=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.callback))},e}(),s=function(e){function t(t,n){e.call(this,t),this.add(new o.Subscription(n))}return i(t,e),t}(r.Subscriber)},16700:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.find=function(e,t){if("function"!=typeof e)throw new TypeError("predicate is not a function");return function(n){return n.lift(new o(e,n,!1,t))}};var o=function(){function e(e,t,n,i){this.predicate=e,this.source=t,this.yieldIndex=n,this.thisArg=i}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();t.FindValueOperator=o;var a=function(e){function t(t,n,i,r,o){e.call(this,t),this.predicate=n,this.source=i,this.yieldIndex=r,this.thisArg=o,this.index=0}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){var t=this.predicate,n=this.thisArg,i=this.index++;try{t.call(n||this,e,i,this.source)&&this.notifyComplete(this.yieldIndex?i:e)}catch(r){this.destination.error(r)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(r.Subscriber);t.FindValueSubscriber=a},86452:function(e,t,n){"use strict";var i=n(16700);t.findIndex=function(e,t){return function(n){return n.lift(new i.FindValueOperator(e,n,!0,t))}}},12309:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(44640);t.first=function(e,t,n){return function(i){return i.lift(new a(e,t,n,i))}};var a=function(){function e(e,t,n,i){this.predicate=e,this.resultSelector=t,this.defaultValue=n,this.source=i}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.resultSelector,this.defaultValue,this.source))},e}(),s=function(e){function t(t,n,i,r,o){e.call(this,t),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=o,this.index=0,this.hasCompleted=!1,this._emitted=!1}return i(t,e),t.prototype._next=function(e){var t=this.index++;this.predicate?this._tryPredicate(e,t):this._emit(e,t)},t.prototype._tryPredicate=function(e,t){var n;try{n=this.predicate(e,t,this.source)}catch(i){return void this.destination.error(i)}n&&this._emit(e,t)},t.prototype._emit=function(e,t){this.resultSelector?this._tryResultSelector(e,t):this._emitFinal(e)},t.prototype._tryResultSelector=function(e,t){var n;try{n=this.resultSelector(e,t)}catch(i){return void this.destination.error(i)}this._emitFinal(n)},t.prototype._emitFinal=function(e){var t=this.destination;this._emitted||(this._emitted=!0,t.next(e),t.complete(),this.hasCompleted=!0)},t.prototype._complete=function(){var e=this.destination;this.hasCompleted||void 0===this.defaultValue?this.hasCompleted||e.error(new o.EmptyError):(e.next(this.defaultValue),e.complete())},t}(r.Subscriber)},92577:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(72293),a=n(18705),s=n(2369),u=n(49754),c=n(30764);t.groupBy=function(e,t,n,i){return function(r){return r.lift(new l(e,t,n,i))}};var l=function(){function e(e,t,n,i){this.keySelector=e,this.elementSelector=t,this.durationSelector=n,this.subjectSelector=i}return e.prototype.call=function(e,t){return t.subscribe(new h(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),h=function(e){function t(t,n,i,r,o){e.call(this,t),this.keySelector=n,this.elementSelector=i,this.durationSelector=r,this.subjectSelector=o,this.groups=null,this.attemptedToUnsubscribe=!1,this.count=0}return i(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(n){return void this.error(n)}this._group(e,t)},t.prototype._group=function(e,t){var n=this.groups;n||(n=this.groups="string"==typeof t?new c.FastMap:new u.Map);var i,r=n.get(t);if(this.elementSelector)try{i=this.elementSelector(e)}catch(l){this.error(l)}else i=e;if(!r){r=this.subjectSelector?this.subjectSelector():new s.Subject,n.set(t,r);var o=new d(t,r,this);if(this.destination.next(o),this.durationSelector){var a=void 0;try{a=this.durationSelector(new d(t,r))}catch(l){return void this.error(l)}this.add(a.subscribe(new f(t,r,this)))}}r.closed||r.next(i)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach(function(t,n){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(r.Subscriber),f=function(e){function t(t,n,i){e.call(this,n),this.key=t,this.group=n,this.parent=i}return i(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(r.Subscriber),d=function(e){function t(t,n,i){e.call(this),this.key=t,this.groupSubject=n,this.refCountSubscription=i}return i(t,e),t.prototype._subscribe=function(e){var t=new o.Subscription,n=this.refCountSubscription,i=this.groupSubject;return n&&!n.closed&&t.add(new p(n)),t.add(i.subscribe(e)),t},t}(a.Observable);t.GroupedObservable=d;var p=function(e){function t(t){e.call(this),this.parent=t,t.count++}return i(t,e),t.prototype.unsubscribe=function(){var t=this.parent;!t.closed&&!this.closed&&(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(o.Subscription)},86898:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(68668);t.ignoreElements=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(){e.apply(this,arguments)}return i(t,e),t.prototype._next=function(e){o.noop()},t}(r.Subscriber)},89121:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.isEmpty=function(){return function(e){return e.lift(new o)}};var o=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new a(e))},e}(),a=function(e){function t(t){e.call(this,t)}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(r.Subscriber)},4636:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(44640);t.last=function(e,t,n){return function(i){return i.lift(new a(e,t,n,i))}};var a=function(){function e(e,t,n,i){this.predicate=e,this.resultSelector=t,this.defaultValue=n,this.source=i}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.resultSelector,this.defaultValue,this.source))},e}(),s=function(e){function t(t,n,i,r,o){e.call(this,t),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=o,this.hasValue=!1,this.index=0,void 0!==r&&(this.lastValue=r,this.hasValue=!0)}return i(t,e),t.prototype._next=function(e){var t=this.index++;if(this.predicate)this._tryPredicate(e,t);else{if(this.resultSelector)return void this._tryResultSelector(e,t);this.lastValue=e,this.hasValue=!0}},t.prototype._tryPredicate=function(e,t){var n;try{n=this.predicate(e,t,this.source)}catch(i){return void this.destination.error(i)}if(n){if(this.resultSelector)return void this._tryResultSelector(e,t);this.lastValue=e,this.hasValue=!0}},t.prototype._tryResultSelector=function(e,t){var n;try{n=this.resultSelector(e,t)}catch(i){return void this.destination.error(i)}this.lastValue=n,this.hasValue=!0},t.prototype._complete=function(){var e=this.destination;this.hasValue?(e.next(this.lastValue),e.complete()):e.error(new o.EmptyError)},t}(r.Subscriber)},40119:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.map=function(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new o(e,t))}};var o=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.project,this.thisArg))},e}();t.MapOperator=o;var a=function(e){function t(t,n,i){e.call(this,t),this.project=n,this.count=0,this.thisArg=i||this}return i(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(r.Subscriber)},23491:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.mapTo=function(e){return function(t){return t.lift(new o(e))}};var o=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.value))},e}(),a=function(e){function t(t,n){e.call(this,t),this.value=n}return i(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(r.Subscriber)},71177:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(94429);t.materialize=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){e.call(this,t)}return i(t,e),t.prototype._next=function(e){this.destination.next(o.Notification.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(o.Notification.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(o.Notification.createComplete()),e.complete()},t}(r.Subscriber)},33499:function(e,t,n){"use strict";var i=n(97369);t.max=function(e){return i.reduce("function"==typeof e?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t})}},56098:function(e,t,n){"use strict";var i=n(38781),r=n(38781);t.mergeStatic=r.merge,t.merge=function(){for(var e=[],t=0;t0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(o.OuterSubscriber);t.MergeMapSubscriber=s},6693:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.mergeMapTo=function(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"number"==typeof t&&(n=t,t=null),function(i){return i.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){void 0===n&&(n=Number.POSITIVE_INFINITY),this.ish=e,this.resultSelector=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.ish,this.resultSelector,this.concurrent))},e}();t.MergeMapToOperator=a;var s=function(e){function t(t,n,i,r){void 0===r&&(r=Number.POSITIVE_INFINITY),e.call(this,t),this.ish=n,this.resultSelector=i,this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(t,e),t.prototype._next=function(e){if(this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(r.OuterSubscriber);t.MergeMapToSubscriber=s},7550:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(33463),o=n(85814),a=n(93658),s=n(84308);t.mergeScan=function(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(i){return i.lift(new u(e,t,n))}};var u=function(){function e(e,t,n){this.accumulator=e,this.seed=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.accumulator,this.seed,this.concurrent))},e}();t.MergeScanOperator=u;var c=function(e){function t(t,n,i,r){e.call(this,t),this.accumulator=n,this.acc=i,this.concurrent=r,this.hasValue=!1,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(t,e),t.prototype._next=function(e){if(this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(s.OuterSubscriber);t.MergeScanSubscriber=c},51213:function(e,t,n){"use strict";var i=n(97369);t.min=function(e){return i.reduce("function"==typeof e?function(t,n){return e(t,n)<0?t:n}:function(e,t){return e=2?function(n){return a.pipe(i.scan(e,t),r.takeLast(1),o.defaultIfEmpty(t))(n)}:function(t){return a.pipe(i.scan(function(t,n,i){return e(t,n,i+1)}),r.takeLast(1))(t)}}},1694:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.refCount=function(){return function(e){return e.lift(new o(e))}};var o=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var i=new a(e,n),r=t.subscribe(i);return i.closed||(i.connection=n.connect()),r},e}(),a=function(e){function t(t,n){e.call(this,t),this.connectable=n}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,i=e._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null},t}(r.Subscriber)},15329:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(70481);t.repeat=function(e){return void 0===e&&(e=-1),function(t){return 0===e?new o.EmptyObservable:t.lift(new a(e<0?-1:e-1,t))}};var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.count,this.source))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.count=n,this.source=i}return i(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,n=this.count;if(0===n)return e.prototype.complete.call(this);n>-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(r.Subscriber)},63964:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(33463),a=n(85814),s=n(84308),u=n(93658);t.repeatWhen=function(e){return function(t){return t.lift(new c(e))}};var c=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,t))},e}(),l=function(e){function t(t,n,i){e.call(this,t),this.notifier=n,this.source=i,this.sourceIsBeingSubscribedTo=!0}return i(t,e),t.prototype.notifyNext=function(e,t,n,i,r){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(t){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=null),t&&(t.unsubscribe(),this.retriesSubscription=null),this.retries=null},t.prototype._unsubscribeAndRecycle=function(){var t=this,n=t.notifications,i=t.retries,r=t.retriesSubscription;return this.notifications=null,this.retries=null,this.retriesSubscription=null,e.prototype._unsubscribeAndRecycle.call(this),this.notifications=n,this.retries=i,this.retriesSubscription=r,this},t.prototype.subscribeToRetries=function(){this.notifications=new r.Subject;var t=o.tryCatch(this.notifier)(this.notifications);if(t===a.errorObject)return e.prototype.complete.call(this);this.retries=t,this.retriesSubscription=u.subscribeToResult(this,t)},t}(s.OuterSubscriber)},40241:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.retry=function(e){return void 0===e&&(e=-1),function(t){return t.lift(new o(e,t))}};var o=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.count,this.source))},e}(),a=function(e){function t(t,n,i){e.call(this,t),this.count=n,this.source=i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.source,i=this.count;if(0===i)return e.prototype.error.call(this,t);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},t}(r.Subscriber)},23896:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(33463),a=n(85814),s=n(84308),u=n(93658);t.retryWhen=function(e){return function(t){return t.lift(new c(e,t))}};var c=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,this.source))},e}(),l=function(e){function t(t,n,i){e.call(this,t),this.notifier=n,this.source=i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=null,this.retriesSubscription=null;else{if(n=new r.Subject,(i=o.tryCatch(this.notifier)(n))===a.errorObject)return e.prototype.error.call(this,a.errorObject.e);s=u.subscribeToResult(this,i)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=s,n.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=null),t&&(t.unsubscribe(),this.retriesSubscription=null),this.retries=null},t.prototype.notifyNext=function(e,t,n,i,r){var o=this,a=o.errors,s=o.retries,u=o.retriesSubscription;this.errors=null,this.retries=null,this.retriesSubscription=null,this._unsubscribeAndRecycle(),this.errors=a,this.retries=s,this.retriesSubscription=u,this.source.subscribe(this)},t}(s.OuterSubscriber)},92043:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.sample=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new s(e),i=t.subscribe(n);return i.add(o.subscribeToResult(n,this.notifier)),i},e}(),s=function(e){function t(){e.apply(this,arguments),this.hasValue=!1}return i(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(e,t,n,i,r){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(r.OuterSubscriber)},71239:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(90680);t.sampleTime=function(e,t){return void 0===t&&(t=o.async),function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.period,this.scheduler))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.period=n,this.scheduler=i,this.hasValue=!1,this.add(i.schedule(u,n,{subscriber:this,period:n}))}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(r.Subscriber);function u(e){var t=e.period;e.subscriber.notifyNext(),this.schedule(e,t)}},64949:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.scan=function(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new o(e,t,n))}};var o=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.accumulator,this.seed,this.hasSeed))},e}(),a=function(e){function t(t,n,i,r){e.call(this,t),this.accumulator=n,this._seed=i,this.hasSeed=r,this.index=0}return i(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(i){this.destination.error(i)}this.seed=t,this.destination.next(t)},t}(r.Subscriber)},88948:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(33463),a=n(85814);t.sequenceEqual=function(e,t){return function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.compareTo=e,this.comparor=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.compareTo,this.comparor))},e}();t.SequenceEqualOperator=s;var u=function(e){function t(t,n,i){e.call(this,t),this.compareTo=n,this.comparor=i,this._a=[],this._b=[],this._oneComplete=!1,this.add(n.subscribe(new c(t,this)))}return i(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t.prototype.checkValues=function(){for(var e=this,t=e._a,n=e._b,i=e.comparor;t.length>0&&n.length>0;){var r=t.shift(),s=n.shift(),u=!1;i?(u=o.tryCatch(i)(r,s))===a.errorObject&&this.destination.error(a.errorObject.e):u=r===s,u||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t}(r.Subscriber);t.SequenceEqualSubscriber=u;var c=function(e){function t(t,n){e.call(this,t),this.parent=n}return i(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent._complete()},t}(r.Subscriber)},35473:function(e,t,n){"use strict";var i=n(27372),r=n(1694),o=n(2369);function a(){return new o.Subject}t.share=function(){return function(e){return r.refCount()(i.multicast(a)(e))}}},62704:function(e,t,n){"use strict";var i=n(81959);t.shareReplay=function(e,t,n){return function(r){return r.lift(function(e,t,n){var r,o,a=0,s=!1,u=!1;return function(c){a++,(!r||s)&&(s=!1,r=new i.ReplaySubject(e,t,n),o=c.subscribe({next:function(e){r.next(e)},error:function(e){s=!0,r.error(e)},complete:function(){u=!0,r.complete()}}));var l=r.subscribe(this);return function(){a--,l.unsubscribe(),o&&0===a&&u&&o.unsubscribe()}}}(e,t,n))}}},92223:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(44640);t.single=function(e){return function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.predicate=n,this.source=i,this.seenValue=!1,this.index=0}return i(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(n){this.destination.error(n)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new o.EmptyError)},t}(r.Subscriber)},11189:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109);t.skip=function(e){return function(t){return t.lift(new o(e))}};var o=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.total))},e}(),a=function(e){function t(t,n){e.call(this,t),this.total=n,this.count=0}return i(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(r.Subscriber)},73346:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(11758);t.skipLast=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(0===this._skipCount?new r.Subscriber(e):new s(e,this._skipCount))},e}(),s=function(e){function t(t,n){e.call(this,t),this._skipCount=n,this._count=0,this._ring=new Array(n)}return i(t,e),t.prototype._next=function(e){var t=this._skipCount,n=this._count++;if(n1?new i.ArrayObservable(e,n):new o.EmptyObservable(n),t)}}},10118:function(e,t,n){"use strict";var i=n(82966);t.subscribeOn=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new r(e,t))}};var r=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new i.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(e)},e}()},77243:function(e,t,n){"use strict";var i=n(18483),r=n(5027);t.switchAll=function(){return i.switchMap(r.identity)}},18483:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.switchMap=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.resultSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.resultSelector))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.project=n,this.resultSelector=i,this.index=0}return i(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(i){return void this.destination.error(i)}this._innerSub(t,e,n)},t.prototype._innerSub=function(e,t,n){var i=this.innerSubscription;i&&i.unsubscribe(),this.add(this.innerSubscription=o.subscribeToResult(this,e,t,n))},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.innerSubscription=null},t.prototype.notifyComplete=function(t){this.remove(t),this.innerSubscription=null,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,i,r){this.resultSelector?this._tryNotifyNext(e,t,n,i):this.destination.next(t)},t.prototype._tryNotifyNext=function(e,t,n,i){var r;try{r=this.resultSelector(e,t,n,i)}catch(o){return void this.destination.error(o)}this.destination.next(r)},t}(r.OuterSubscriber)},10684:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(84308),o=n(93658);t.switchMapTo=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.observable=e,this.resultSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.observable,this.resultSelector))},e}(),s=function(e){function t(t,n,i){e.call(this,t),this.inner=n,this.resultSelector=i,this.index=0}return i(t,e),t.prototype._next=function(e){var t=this.innerSubscription;t&&t.unsubscribe(),this.add(this.innerSubscription=o.subscribeToResult(this,this.inner,e,this.index++))},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.innerSubscription=null},t.prototype.notifyComplete=function(t){this.remove(t),this.innerSubscription=null,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,i,r){var o=this.destination;this.resultSelector?this.tryResultSelector(e,t,n,i):o.next(t)},t.prototype.tryResultSelector=function(e,t,n,i){var r,o=this.resultSelector,a=this.destination;try{r=o(e,t,n,i)}catch(s){return void a.error(s)}a.next(r)},t}(r.OuterSubscriber)},44396:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(11758),a=n(70481);t.take=function(e){return function(t){return 0===e?new a.EmptyObservable:t.lift(new s(e))}};var s=function(){function e(e){if(this.total=e,this.total<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){e.call(this,t),this.total=n,this.count=0}return i(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(r.Subscriber)},73935:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(42109),o=n(11758),a=n(70481);t.takeLast=function(e){return function(t){return 0===e?new a.EmptyObservable:t.lift(new s(e))}};var s=function(){function e(e){if(this.total=e,this.total<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){e.call(this,t),this.total=n,this.ring=new Array,this.count=0}return i(t,e),t.prototype._next=function(e){var t=this.ring,n=this.total,i=this.count++;t.length0)for(var n=this.count>=this.total?this.total:this.count,i=this.ring,r=0;r0?this.startWindowEvery:this.windowSize,n=this.destination,i=this.windowSize,r=this.windows,a=r.length,s=0;s=0&&u%t==0&&!this.closed&&r.shift().complete(),++this.count%t==0&&!this.closed){var c=new o.Subject;r.push(c),n.next(c)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(r.Subscriber)},42603:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(90680),a=n(42109),s=n(39479),u=n(41503);t.windowTime=function(e){var t=o.async,n=null,i=Number.POSITIVE_INFINITY;return u.isScheduler(arguments[3])&&(t=arguments[3]),u.isScheduler(arguments[2])?t=arguments[2]:s.isNumeric(arguments[2])&&(i=arguments[2]),u.isScheduler(arguments[1])?t=arguments[1]:s.isNumeric(arguments[1])&&(n=arguments[1]),function(r){return r.lift(new c(e,n,i,t))}};var c=function(){function e(e,t,n,i){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=n,this.scheduler=i}return e.prototype.call=function(e,t){return t.subscribe(new h(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),l=function(e){function t(){e.apply(this,arguments),this._numberOfNextedValues=0}return i(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(r.Subject),h=function(e){function t(t,n,i,r,o){e.call(this,t),this.destination=t,this.windowTimeSpan=n,this.windowCreationInterval=i,this.maxWindowSize=r,this.scheduler=o,this.windows=[];var a=this.openWindow();if(null!==i&&i>=0){var s={windowTimeSpan:n,windowCreationInterval:i,subscriber:this,scheduler:o};this.add(o.schedule(p,n,{subscriber:this,window:a,context:null})),this.add(o.schedule(d,i,s))}else this.add(o.schedule(f,n,{subscriber:this,window:a,windowTimeSpan:n}))}return i(t,e),t.prototype._next=function(e){for(var t=this.windows,n=t.length,i=0;i=this.maxWindowSize&&this.closeWindow(r))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new l;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(a.Subscriber);function f(e){var t=e.subscriber,n=e.windowTimeSpan,i=e.window;i&&t.closeWindow(i),e.window=t.openWindow(),this.schedule(e,n)}function d(e){var t=e.windowTimeSpan,n=e.subscriber,i=e.scheduler,r=e.windowCreationInterval,o=n.openWindow(),a=this,s={action:a,subscription:null};s.subscription=i.schedule(p,t,{subscriber:n,window:o,context:s}),a.add(s.subscription),a.schedule(e,r)}function p(e){var t=e.subscriber,n=e.window,i=e.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),t.closeWindow(n)}},59048:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(2369),o=n(72293),a=n(33463),s=n(85814),u=n(84308),c=n(93658);t.windowToggle=function(e,t){return function(n){return n.lift(new l(e,t))}};var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new h(e,this.openings,this.closingSelector))},e}(),h=function(e){function t(t,n,i){e.call(this,t),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(this.openSubscription=c.subscribeToResult(this,n,n))}return i(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var n=t.length,i=0;i0){var a=o.indexOf(n);-1!==a&&o.splice(a,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(r.OuterSubscriber)},9477:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(96177),o=n(48242),a=n(42109),s=n(84308),u=n(93658),c=n(72121);function l(){for(var e=[],t=0;tthis.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),v=function(e){function t(t,n,i){e.call(this,t),this.parent=n,this.observable=i,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return i(t,e),t.prototype[c.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e,t,n,i,r){this.buffer.push(t),this.parent.checkIterators()},t.prototype.subscribe=function(e,t){return u.subscribeToResult(this,this.observable,this,t)},t}(s.OuterSubscriber)},33310:function(e,t,n){"use strict";var i=n(9477);t.zipAll=function(e){return function(t){return t.lift(new i.ZipOperator(e))}}},28101:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(t,n){e.call(this)}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(72293).Subscription);t.Action=r},67529:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(12624),o=n(95018),a=function(e){function t(t,n){e.call(this,t,n),this.scheduler=t,this.work=n}return i(t,e),t.prototype.requestAsyncId=function(t,n,i){return void 0===i&&(i=0),null!==i&&i>0?e.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t.scheduled||(t.scheduled=o.AnimationFrame.requestAnimationFrame(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,i);0===t.actions.length&&(o.AnimationFrame.cancelAnimationFrame(n),t.scheduled=void 0)},t}(r.AsyncAction);t.AnimationFrameAction=a},68909:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(){e.apply(this,arguments)}return i(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,i=-1,r=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++i0?e.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t.scheduled||(t.scheduled=r.Immediate.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,i);0===t.actions.length&&(r.Immediate.clearImmediate(n),t.scheduled=void 0)},t}(n(12624).AsyncAction);t.AsapAction=o},25766:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(){e.apply(this,arguments)}return i(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,i=-1,r=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++i0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,i):t.flush(this)},t}(n(12624).AsyncAction);t.QueueAction=r},77373:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=function(e){function t(){e.apply(this,arguments)}return i(t,e),t}(n(42704).AsyncScheduler);t.QueueScheduler=r},18353:function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},r=n(12624),o=function(e){function t(t,n){var i=this;void 0===t&&(t=a),void 0===n&&(n=Number.POSITIVE_INFINITY),e.call(this,t,function(){return i.frame}),this.maxFrames=n,this.frame=0,this.index=-1}return i(t,e),t.prototype.flush=function(){for(var e,t,n=this.actions,i=this.maxFrames;(t=n.shift())&&(this.frame=t.delay)<=i&&!(e=t.execute(t.state,t.delay)););if(e){for(;t=n.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(n(42704).AsyncScheduler);t.VirtualTimeScheduler=o;var a=function(e){function t(t,n,i){void 0===i&&(i=t.index+=1),e.call(this,t,n),this.scheduler=t,this.work=n,this.index=i,this.active=!0,this.index=t.index=i}return i(t,e),t.prototype.schedule=function(n,i){if(void 0===i&&(i=0),!this.id)return e.prototype.schedule.call(this,n,i);this.active=!1;var r=new t(this.scheduler,this.work);return this.add(r),r.schedule(n,i)},t.prototype.requestAsyncId=function(e,n,i){void 0===i&&(i=0),this.delay=e.frame+i;var r=e.actions;return r.push(this),r.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,n){void 0===n&&(n=0)},t.prototype._execute=function(t,n){if(!0===this.active)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(r.AsyncAction);t.VirtualAction=a},12948:function(e,t,n){"use strict";var i=n(67529),r=n(68909);t.animationFrame=new r.AnimationFrameScheduler(i.AnimationFrameAction)},85522:function(e,t,n){"use strict";var i=n(3496),r=n(25766);t.asap=new r.AsapScheduler(i.AsapAction)},90680:function(e,t,n){"use strict";var i=n(12624),r=n(42704);t.async=new r.AsyncScheduler(i.AsyncAction)},97088:function(e,t,n){"use strict";var i=n(7100),r=n(77373);t.queue=new r.QueueScheduler(i.QueueAction)},72121:function(e,t,n){"use strict";var i=n(80019);function r(e){var t=e.Symbol;if("function"==typeof t)return t.iterator||(t.iterator=t("iterator polyfill")),t.iterator;var n=e.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var i=e.Map;if(i)for(var r=Object.getOwnPropertyNames(i.prototype),o=0;o0;)t.shift().setup();e.prototype.flush.call(this);for(var n=this.flushTests.filter(function(e){return e.ready});n.length>0;){var i=n.shift();this.assertDeepEqual(i.actual,i.expected)}},t.parseMarblesAsSubscriptions=function(e){if("string"!=typeof e)return new u.SubscriptionLog(Number.POSITIVE_INFINITY);for(var t=e.length,n=-1,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=0;o-1?n:a;break;case"!":if(r!==Number.POSITIVE_INFINITY)throw new Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");r=n>-1?n:a;break;default:throw new Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+s+"'.")}}return r<0?new u.SubscriptionLog(i):new u.SubscriptionLog(i,r)},t.parseMarbles=function(e,t,n,i){if(void 0===i&&(i=!1),-1!==e.indexOf("!"))throw new Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var r=e.length,s=[],u=e.indexOf("^"),c=-1===u?0:u*-this.frameTimeFactor,l="object"!=typeof t?function(e){return e}:function(e){return i&&t[e]instanceof a.ColdObservable?t[e].messages:t[e]},h=-1,f=0;f-1?h:d,notification:p})}return s},t}(c.VirtualTimeScheduler);t.TestScheduler=l},95018:function(e,t,n){"use strict";var i=n(80019),r=function(e){e.requestAnimationFrame?(this.cancelAnimationFrame=e.cancelAnimationFrame.bind(e),this.requestAnimationFrame=e.requestAnimationFrame.bind(e)):e.mozRequestAnimationFrame?(this.cancelAnimationFrame=e.mozCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.mozRequestAnimationFrame.bind(e)):e.webkitRequestAnimationFrame?(this.cancelAnimationFrame=e.webkitCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.webkitRequestAnimationFrame.bind(e)):e.msRequestAnimationFrame?(this.cancelAnimationFrame=e.msCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.msRequestAnimationFrame.bind(e)):e.oRequestAnimationFrame?(this.cancelAnimationFrame=e.oCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.oRequestAnimationFrame.bind(e)):(this.cancelAnimationFrame=e.clearTimeout.bind(e),this.requestAnimationFrame=function(t){return e.setTimeout(t,1e3/60)})};t.RequestAnimationFrameDefinition=r,t.AnimationFrame=new r(i.root)},11758:function(e,t){"use strict";var n=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},i=function(e){function t(){var t=e.call(this,"argument out of range");this.name=t.name="ArgumentOutOfRangeError",this.stack=t.stack,this.message=t.message}return n(t,e),t}(Error);t.ArgumentOutOfRangeError=i},44640:function(e,t){"use strict";var n=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},i=function(e){function t(){var t=e.call(this,"no elements in sequence");this.name=t.name="EmptyError",this.stack=t.stack,this.message=t.message}return n(t,e),t}(Error);t.EmptyError=i},30764:function(e,t){"use strict";var n=function(){function e(){this.values={}}return e.prototype.delete=function(e){return this.values[e]=null,!0},e.prototype.set=function(e,t){return this.values[e]=t,this},e.prototype.get=function(e){return this.values[e]},e.prototype.forEach=function(e,t){var n=this.values;for(var i in n)n.hasOwnProperty(i)&&null!==n[i]&&e.call(t,n[i],i)},e.prototype.clear=function(){this.values={}},e}();t.FastMap=n},42982:function(e,t,n){"use strict";var i=n(80019),r=function(){function e(e){if(this.root=e,e.setImmediate&&"function"==typeof e.setImmediate)this.setImmediate=e.setImmediate.bind(e),this.clearImmediate=e.clearImmediate.bind(e);else{this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.setImmediate=this.canUseProcessNextTick()?this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.createReadyStateChangeSetImmediate():this.createSetTimeoutSetImmediate();var t=function e(t){delete e.instance.tasksByHandle[t]};t.instance=this,this.clearImmediate=t}}return e.prototype.identify=function(e){return this.root.Object.prototype.toString.call(e)},e.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)},e.prototype.canUseMessageChannel=function(){return Boolean(this.root.MessageChannel)},e.prototype.canUseReadyStateChange=function(){var e=this.root.document;return Boolean(e&&"onreadystatechange"in e.createElement("script"))},e.prototype.canUsePostMessage=function(){var e=this.root;if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}return!1},e.prototype.partiallyApplied=function(e){for(var t=[],n=1;n=0}},1856:function(e,t){"use strict";t.isObject=function(e){return null!=e&&"object"==typeof e}},35130:function(e,t){"use strict";t.isPromise=function(e){return e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},41503:function(e,t){"use strict";t.isScheduler=function(e){return e&&"function"==typeof e.schedule}},68668:function(e,t){"use strict";t.noop=function(){}},67239:function(e,t){"use strict";t.not=function(e,t){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=e,n.thisArg=t,n}},10142:function(e,t,n){"use strict";var i=n(68668);function r(e){return e?1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}:i.noop}t.pipe=function(){for(var e=[],t=0;t=n?{done:!0}:{done:!1,value:e[i++]}})},t.empty=function(){var e=new t(null);return e.done=!0,e},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},97310:function(e,t,n){"use strict";var i=n(61948);Object.defineProperty(t,"__esModule",{value:!0}),t.isMobile=function(){return void 0!==r.window.orientation},t.default=function(e){if(!e&&!(0,o.default)())return"Node";if((0,a.default)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),s=-1!==n.indexOf("Trident/");return i||s?"IE":r.window.chrome?"Chrome":r.window.safari?"Safari":r.window.mozInnerScreenX?"Firefox":"Unknown"};var r=n(41151),o=i(n(61602)),a=i(n(22344))},41151:function(e,t,n){"use strict";var i=n(61948);Object.defineProperty(t,"__esModule",{value:!0}),t.console=t.process=t.document=t.global=t.window=t.self=void 0;var r=i(n(34321)),o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&process};t.self=o.self||o.window||o.global,t.window=o.window||o.self||o.global,t.global=o.global||o.self||o.window,t.document=o.document||{},t.process=o.process||{};var a=console;t.console=a},84761:function(e,t,n){"use strict";var i=n(61948),r=n(34321);Object.defineProperty(t,"CO",{enumerable:!0,get:function(){return o.global}}),Object.defineProperty(t,"jU",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"qs",{enumerable:!0,get:function(){return s.default}});var o=n(41151),a=c(n(61602)),s=c(n(97310));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}i(n(22344))},61602:function(e,t,n){"use strict";var i=n(61948);Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.isBrowserMainThread=function(){return a()&&"undefined"!=typeof document};var r=i(n(34321)),o=i(n(22344));function a(){return!("object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,o.default)()}},22344:function(e,t,n){"use strict";var i=n(61948);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("undefined"!=typeof window&&"object"===(0,r.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,r.default)(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":(0,r.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||t;return!!(n&&n.indexOf("Electron")>=0)};var r=i(n(34321))},86991:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(14180),t),r(n(75103),t),r(n(48965),t),r(n(32595),t),r(n(82417),t),r(n(92451),t),r(n(17735),t)},14180:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=function(){function e(t){m(this,e),this.termType="BlankNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}]),e}()},75103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;var i=n(14180),r=n(48965),o=n(32595),a=n(82417),s=n(92451),u=n(17735),c=0;t.DataFactory=function(){function e(t){m(this,e),this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||"df_".concat(c++,"_")}return b(e,[{key:"namedNode",value:function(e){return new a.NamedNode(e)}},{key:"blankNode",value:function(e){return new i.BlankNode(e||"".concat(this.blankNodePrefix).concat(this.blankNodeCounter++))}},{key:"literal",value:function(e,t){return new o.Literal(e,t)}},{key:"variable",value:function(e){return new u.Variable(e)}},{key:"defaultGraph",value:function(){return r.DefaultGraph.INSTANCE}},{key:"quad",value:function(e,t,n,i){return new s.Quad(e,t,n,i||this.defaultGraph())}},{key:"fromTerm",value:function(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(o.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}},{key:"fromQuad",value:function(e){return this.fromTerm(e)}},{key:"resetBlankNodeCounter",value:function(){this.blankNodeCounter=0}}]),e}()},48965:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;var n=function(){function e(){m(this,e),this.termType="DefaultGraph",this.value=""}return b(e,[{key:"equals",value:function(e){return!!e&&"DefaultGraph"===e.termType}}]),e}();t.DefaultGraph=n,n.INSTANCE=new n},32595:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;var i=n(82417),r=function(){function e(t,n){m(this,e),this.termType="Literal",this.value=t,"string"==typeof n?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING):n?(this.language="",this.datatype=n):(this.language="",this.datatype=e.XSD_STRING)}return b(e,[{key:"equals",value:function(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}]),e}();t.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=function(){function e(t){m(this,e),this.termType="NamedNode",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}]),e}()},92451:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=function(){function e(t,n,i,r){m(this,e),this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=i,this.graph=r}return b(e,[{key:"equals",value:function(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}]),e}()},17735:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=function(){function e(t){m(this,e),this.termType="Variable",this.value=t}return b(e,[{key:"equals",value:function(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}]),e}()},31609:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedJavaScriptPrimitives=t.getSupportedRdfDatatypes=t.getTermRaw=t.toRdf=t.fromRdf=void 0;var o=n(86991),a=n(9938),s=n(66060);r(n(9938),t),r(n(88871),t),r(n(66060),t);var u=new o.DataFactory,c=new s.Translator;function l(e,t){return c.fromRdf(e,t)}c.registerHandler(new a.TypeHandlerString,a.TypeHandlerString.TYPES.map(function(e){return u.namedNode(e)}),["string"]),c.registerHandler(new a.TypeHandlerBoolean,[a.TypeHandlerBoolean.TYPE].map(function(e){return u.namedNode(e)}),["boolean"]),c.registerHandler(new a.TypeHandlerNumberDouble,a.TypeHandlerNumberDouble.TYPES.map(function(e){return u.namedNode(e)}),["number"]),c.registerHandler(new a.TypeHandlerNumberInteger,a.TypeHandlerNumberInteger.TYPES.map(function(e){return u.namedNode(e)}),["number"]),c.registerHandler(new a.TypeHandlerDate,a.TypeHandlerDate.TYPES.map(function(e){return u.namedNode(e)}),["object"]),t.fromRdf=l,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=u),c.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?l(e,t):e.value},t.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66060:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=function(){function e(){m(this,e),this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}return b(e,[{key:"registerHandler",value:function(e,t,n){var i,r=_(t);try{for(r.s();!(i=r.n()).done;){var o=i.value;this.supportedRdfDatatypes.push(o),this.fromRdfHandlers[o.value]=e}}catch(l){r.e(l)}finally{r.f()}var a,s=_(n);try{for(s.s();!(a=s.n()).done;){var u=a.value,c=this.toRdfHandlers[u];c||(this.toRdfHandlers[u]=c=[]),c.push(e)}}catch(l){s.e(l)}finally{s.f()}}},{key:"fromRdf",value:function(e,t){var n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}},{key:"toRdf",value:function(e,t){var n=this.toRdfHandlers[typeof e];if(n){var i,r=_(n);try{for(r.s();!(i=r.n()).done;){var o=i.value.toRdf(e,t);if(o)return o}}catch(a){r.e(a)}finally{r.f()}}throw new Error("Invalid JavaScript value: '".concat(e,"'"))}},{key:"getSupportedRdfDatatypes",value:function(){return this.supportedRdfDatatypes}},{key:"getSupportedJavaScriptPrimitives",value:function(){return Object.keys(this.toRdfHandlers)}}],[{key:"incorrectRdfDataType",value:function(e){throw new Error("Invalid RDF ".concat(e.datatype.value," value: '").concat(e.value,"'"))}}]),e}()},80727:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;var i=n(66060),r=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&i.Translator.incorrectRdfDataType(e),!1}},{key:"toRdf",value:function(t,n){var i=n.datatype,r=n.dataFactory;return r.literal(t?"true":"false",i||r.namedNode(e.TYPE))}}]),e}();t.TypeHandlerBoolean=r,r.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;var i=n(66060),r=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(t,n){switch(n&&!t.value.match(e.VALIDATORS[t.datatype.value.substr(33,t.datatype.value.length)])&&i.Translator.incorrectRdfDataType(t),t.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(t.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":var r=t.value.split("-");return new Date(0,parseInt(r[0],10)-1,parseInt(r[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(t.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(t.value+"-01");default:return new Date(t.value)}}},{key:"toRdf",value:function(t,n){var i=n.datatype,r=n.dataFactory;if(i=i||r.namedNode(e.TYPES[0]),!(t instanceof Date))return null;var o,a=t;switch(i.value){case"http://www.w3.org/2001/XMLSchema#gDay":o=String(a.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":o=a.getUTCMonth()+1+"-"+a.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":o=String(a.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":o=a.getUTCFullYear()+"-"+(a.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":o=a.toISOString().replace(/T.*$/,"");break;default:o=a.toISOString()}return r.literal(o,i)}}]),e}();t.TypeHandlerDate=r,r.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"],r.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]$/}},38554:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;var i=n(66060),r=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){var n=parseFloat(e.value);return t&&isNaN(n)&&i.Translator.incorrectRdfDataType(e),n}},{key:"toRdf",value:function(t,n){var i=n.datatype,r=n.dataFactory;return i=i||r.namedNode(e.TYPES[0]),isNaN(t)?r.literal("NaN",i):isFinite(t)?t%1==0?null:r.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),i):r.literal(t>0?"INF":"-INF",i)}}]),e}();t.TypeHandlerNumberDouble=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;var i=n(66060),r=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(e,t){var n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&i.Translator.incorrectRdfDataType(e),n}},{key:"toRdf",value:function(t,n){var i=n.datatype,r=n.dataFactory;return r.literal(String(t),i||r.namedNode(t<=e.MAX_INT&&t>=e.MIN_INT?e.TYPES[0]:e.TYPES[1]))}}]),e}();t.TypeHandlerNumberInteger=r,r.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"],r.MAX_INT=2147483647,r.MIN_INT=-2147483648},14608:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;var n=function(){function e(){m(this,e)}return b(e,[{key:"fromRdf",value:function(e){return e.value}},{key:"toRdf",value:function(e,t){var n=t.datatype;return t.dataFactory.literal(e,n)}}]),e}();t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(80727),t),r(n(52525),t),r(n(38554),t),r(n(37750),t),r(n(14608),t)},35090:function(n,i,r){"use strict";var f,d,g,y,w,k,x,S,E,C,O,T=regeneratorRuntime.mark(cL),P={};r.r(P),r.d(P,{decode:function(){return nL},encode:function(){return rL}});var R={};r.r(R),r.d(R,{decode:function(){return lL},encode:function(){return fL}});var D={};r.r(D),r.d(D,{decode:function(){return dL},encode:function(){return vL}});var N={};function L(e){return"function"==typeof e}r.r(N),r.d(N,{decode:function(){return mL},encode:function(){return bL}});var j=!1,F={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){var t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else j&&console.log("RxJS: Back to a better error behavior. Thank you. <3");j=e},get useDeprecatedSynchronousErrorHandling(){return j}};function B(e){setTimeout(function(){throw e},0)}var V={closed:!0,next:function(e){},error:function(e){if(F.useDeprecatedSynchronousErrorHandling)throw e;B(e)},complete:function(){}},z=Array.isArray||function(e){return e&&"number"==typeof e.length};function U(e){return null!==e&&"object"==typeof e}var H,G=function(){function e(e){return Error.call(this),this.message=e?"".concat(e.length," errors occurred during unsubscription:\n").concat(e.map(function(e,t){return"".concat(t+1,") ").concat(e.toString())}).join("\n ")):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),W=function(){function e(t){m(this,e),this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return b(e,[{key:"unsubscribe",value:function(){var t;if(!this.closed){var n=this._parentOrParents,i=this._ctorUnsubscribe,r=this._unsubscribe,o=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:Number.POSITIVE_INFINITY;return"function"==typeof t?function(i){return i.pipe(we(function(n,i){return me(e(n,i)).pipe(ue(function(e,r){return t(n,e,i,r)}))},n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new ke(e,n))})}var ke=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY;m(this,e),this.project=t,this.concurrent=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new xe(e,this.project,this.concurrent))}}]),e}(),xe=function(e){a(n,e);var t=s(n);function n(e,i){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.POSITIVE_INFINITY;return m(this,n),(r=t.call(this,e)).project=i,r.concurrent=o,r.hasCompleted=!1,r.buffer=[],r.active=0,r.index=0,r}return b(n,[{key:"_next",value:function(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}]),n}(be);function Se(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;return we($,e)}function Ee(e,t){return t?ge(e,t):new ee(he(e))}function Ce(){for(var e=arguments.length,t=new Array(e),n=0;n1&&"number"==typeof t[t.length-1]&&(i=t.pop())):"number"==typeof o&&(i=t.pop()),null===r&&1===t.length&&t[0]instanceof ee?t[0]:Se(i)(Ee(t,r))}function Oe(){return function(e){return e.lift(new Te(e))}}var Te=function(){function e(t){m(this,e),this.connectable=t}return b(e,[{key:"call",value:function(e,t){var n=this.connectable;n._refCount++;var i=new Ae(e,n),r=t.subscribe(i);return i.closed||(i.connection=n.connect()),r}}]),e}(),Ae=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).connectable=i,r}return b(n,[{key:"_unsubscribe",value:function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,i=e._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null}}]),n}(Y),Pe=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this)).source=e,r.subjectFactory=i,r._refCount=0,r._isComplete=!1,r}return b(n,[{key:"_subscribe",value:function(e){return this.getSubject().subscribe(e)}},{key:"getSubject",value:function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}},{key:"connect",value:function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new W).add(this.source.subscribe(new Ie(this.getSubject(),this))),e.closed&&(this._connection=null,e=W.EMPTY)),e}},{key:"refCount",value:function(){return Oe()(this)}}]),n}(ee),Me=function(){var e=Pe.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}(),Ie=function(t){a(i,t);var n=s(i);function i(e,t){var r;return m(this,i),(r=n.call(this,e)).connectable=t,r}return b(i,[{key:"_error",value:function(t){this._unsubscribe(),e(p(i.prototype),"_error",this).call(this,t)}},{key:"_complete",value:function(){this.connectable._isComplete=!0,this._unsubscribe(),e(p(i.prototype),"_complete",this).call(this)}},{key:"_unsubscribe",value:function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}]),i}(re);function Re(e,t){return function(n){var i;if(i="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new De(i,t));var r=Object.create(n,Me);return r.source=n,r.subjectFactory=i,r}}var De=function(){function e(t,n){m(this,e),this.subjectFactory=t,this.selector=n}return b(e,[{key:"call",value:function(e,t){var n=this.selector,i=this.subjectFactory(),r=n(i).subscribe(e);return r.add(t.subscribe(i)),r}}]),e}();function Ne(){return new oe}function Le(){return function(e){return Oe()(Re(Ne)(e))}}function je(e){for(var t in e)if(e[t]===je)return t;throw Error("Could not find renamed property on target object.")}function Fe(e,t){for(var n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function Be(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Be).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return"".concat(e.overriddenName);if(e.name)return"".concat(e.name);var t=e.toString();if(null==t)return""+t;var n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function Ve(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}var ze=je({__forward_ref__:je});function Ue(e){return e.__forward_ref__=Ue,e.toString=function(){return Be(this())},e}function He(e){return Ge(e)?e():e}function Ge(e){return"function"==typeof e&&e.hasOwnProperty(ze)&&e.__forward_ref__===Ue}var We=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,function(e,t){return"".concat(e?"NG0".concat(e,": "):"").concat(t)}(e,i))).code=e,r}return n}(l(Error));function qe(e){return"string"==typeof e?e:null==e?"":String(e)}function Xe(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():qe(e)}function Ye(e,t){var n=t?" in ".concat(t):"";throw new We("201","No provider for ".concat(Xe(e)," found").concat(n))}function Ke(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Qe(e){return{providers:e.providers||[],imports:e.imports||[]}}function $e(e){return Ze(e,tt)||Ze(e,it)}function Ze(e,t){return e.hasOwnProperty(t)?e[t]:null}function Je(e){return e&&(e.hasOwnProperty(nt)||e.hasOwnProperty(rt))?e[nt]:null}var et,tt=je({"\u0275prov":je}),nt=je({"\u0275inj":je}),it=je({ngInjectableDef:je}),rt=je({ngInjectorDef:je}),ot=((ot=ot||{})[ot.Default=0]="Default",ot[ot.Host=1]="Host",ot[ot.Self=2]="Self",ot[ot.SkipSelf=4]="SkipSelf",ot[ot.Optional=8]="Optional",ot);function at(e){var t=et;return et=e,t}function st(e,t,n){var i=$e(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&ot.Optional?null:void 0!==t?t:void Ye(Be(e),"Injector")}function ut(e){return{toString:e}.toString()}var ct=((ct=ct||{})[ct.OnPush=0]="OnPush",ct[ct.Default=1]="Default",ct),lt=((lt=lt||{})[lt.Emulated=0]="Emulated",lt[lt.None=2]="None",lt[lt.ShadowDom=3]="ShadowDom",lt),ht="undefined"!=typeof globalThis&&globalThis,ft="undefined"!=typeof window&&window,dt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,pt="undefined"!=typeof global&&global,vt=ht||pt||ft||dt,gt={},mt=[],yt=je({"\u0275cmp":je}),bt=je({"\u0275dir":je}),_t=je({"\u0275pipe":je}),wt=je({"\u0275mod":je}),kt=je({"\u0275loc":je}),xt=je({"\u0275fac":je}),St=je({__NG_ELEMENT_ID__:je}),Et=0;function Ct(e){return ut(function(){var t={},n={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===ct.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors||mt,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||lt.Emulated,id:"c",styles:e.styles||mt,_:null,setInput:null,schemas:e.schemas||null,tView:null},i=e.directives,r=e.features,o=e.pipes;return n.id+=Et++,n.inputs=Mt(e.inputs,t),n.outputs=Mt(e.outputs),r&&r.forEach(function(e){return e(n)}),n.directiveDefs=i?function(){return("function"==typeof i?i():i).map(Ot)}:null,n.pipeDefs=o?function(){return("function"==typeof o?o():o).map(Tt)}:null,n})}function Ot(e){return Rt(e)||function(e){return e[bt]||null}(e)}function Tt(e){return function(e){return e[_t]||null}(e)}var At={};function Pt(e){return ut(function(){var t={type:e.type,bootstrap:e.bootstrap||mt,declarations:e.declarations||mt,imports:e.imports||mt,exports:e.exports||mt,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null};return null!=e.id&&(At[e.id]=e.type),t})}function Mt(e,t){if(null==e)return gt;var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i],o=r;Array.isArray(r)&&(o=r[1],r=r[0]),n[r]=i,t&&(t[r]=o)}return n}var It=Ct;function Rt(e){return e[yt]||null}function Dt(e,t){var n=e[wt]||null;if(!n&&!0===t)throw new Error("Type ".concat(Be(e)," does not have '\u0275mod' property."));return n}function Nt(e){return Array.isArray(e)&&"object"==typeof e[1]}function Lt(e){return Array.isArray(e)&&!0===e[1]}function jt(e){return 0!=(8&e.flags)}function Ft(e){return 2==(2&e.flags)}function Bt(e){return 1==(1&e.flags)}function Vt(e){return null!==e.template}function zt(e){return 0!=(512&e[2])}function Ut(e,t){return e.hasOwnProperty(xt)?e[xt]:null}var Ht=function(){function e(t,n,i){m(this,e),this.previousValue=t,this.currentValue=n,this.firstChange=i}return b(e,[{key:"isFirstChange",value:function(){return this.firstChange}}]),e}();function Gt(){return Wt}function Wt(e){return e.type.prototype.ngOnChanges&&(e.setInput=Xt),qt}function qt(){var e=Kt(this),t=null==e?void 0:e.current;if(t){var n=e.previous;if(n===gt)e.previous=t;else for(var i in t)n[i]=t[i];e.current=null,this.ngOnChanges(t)}}function Xt(e,t,n,i){var r=Kt(e)||function(e,t){return e[Yt]=t}(e,{previous:gt,current:null}),o=r.current||(r.current={}),a=r.previous,s=this.declaredInputs[n],u=a[s];o[s]=new Ht(u&&u.currentValue,t,a===gt),e[i]=t}Gt.ngInherit=!0;var Yt="__ngSimpleChanges__";function Kt(e){return e[Yt]||null}var Qt,$t="http://www.w3.org/2000/svg";function Zt(){return void 0!==Qt?Qt:"undefined"!=typeof document?document:void 0}function Jt(e){return!!e.listen}var en={createRenderer:function(e,t){return Zt()}};function tn(e){for(;Array.isArray(e);)e=e[0];return e}function nn(e,t){return tn(t[e])}function rn(e,t){return tn(t[e.index])}function on(e,t){return e.data[t]}function an(e,t){return e[t]}function sn(e,t){var n=t[e];return Nt(n)?n:n[0]}function un(e){return 4==(4&e[2])}function cn(e){return 128==(128&e[2])}function ln(e,t){return null==t?null:e[t]}function hn(e){e[18]=0}function fn(e,t){e[5]+=t;for(var n=e,i=e[3];null!==i&&(1===t&&1===n[5]||-1===t&&0===n[5]);)i[5]+=t,n=i,i=i[3]}var dn={lFrame:Fn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function pn(){return dn.bindingsEnabled}function vn(){return dn.lFrame.lView}function gn(){return dn.lFrame.tView}function mn(e){return dn.lFrame.contextLView=e,e[8]}function yn(){for(var e=bn();null!==e&&64===e.type;)e=e.parent;return e}function bn(){return dn.lFrame.currentTNode}function _n(e,t){var n=dn.lFrame;n.currentTNode=e,n.isParent=t}function wn(){return dn.lFrame.isParent}function kn(){dn.lFrame.isParent=!1}function xn(){return dn.isInCheckNoChangesMode}function Sn(e){dn.isInCheckNoChangesMode=e}function En(){var e=dn.lFrame,t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Cn(){return dn.lFrame.bindingIndex}function On(){return dn.lFrame.bindingIndex++}function Tn(e){var t=dn.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function An(e,t){var n=dn.lFrame;n.bindingIndex=n.bindingRootIndex=e,Pn(t)}function Pn(e){dn.lFrame.currentDirectiveIndex=e}function Mn(e){var t=dn.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function In(){return dn.lFrame.currentQueryIndex}function Rn(e){dn.lFrame.currentQueryIndex=e}function Dn(e){var t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function Nn(e,t,n){if(n&ot.SkipSelf){for(var i=t,r=e;!(null!==(i=i.parent)||n&ot.Host||(i=Dn(r),null===i||(r=r[15],10&i.type))););if(null===i)return!1;t=i,e=r}var o=dn.lFrame=jn();return o.currentTNode=t,o.lView=e,!0}function Ln(e){var t=jn(),n=e[1];dn.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function jn(){var e=dn.lFrame,t=null===e?null:e.child;return null===t?Fn(e):t}function Fn(e){var t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function Bn(){var e=dn.lFrame;return dn.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}var Vn=Bn;function zn(){var e=Bn();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Un(){return dn.lFrame.selectedIndex}function Hn(e){dn.lFrame.selectedIndex=e}function Gn(){var e=dn.lFrame;return on(e.tView,e.selectedIndex)}function Wn(){dn.lFrame.currentNamespace=$t}function qn(e,t){for(var n=t.directiveStart,i=t.directiveEnd;n=i)break}else t[s]<0&&(e[18]+=65536),(a>11>16&&(3&e[2])===t){e[2]+=2048;try{o.call(a)}finally{}}}else try{o.call(a)}finally{}}var Zn=function e(t,n,i){m(this,e),this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=i};function Jn(e,t,n){for(var i=Jt(e),r=0;rt){a=o-1;break}}}for(;o>16}(e),i=t;n>0;)i=i[15],n--;return i}var si=!0;function ui(e){var t=si;return si=e,t}var ci=0;function li(e,t){var n=fi(e,t);if(-1!==n)return n;var i=t[1];i.firstCreatePass&&(e.injectorIndex=t.length,hi(i.data,e),hi(t,null),hi(i.blueprint,null));var r=di(e,t),o=e.injectorIndex;if(ri(r))for(var a=oi(r),s=ai(r,t),u=s[1].data,c=0;c<8;c++)t[o+c]=s[a+c]|u[a+c];return t[o+8]=r,o}function hi(e,t){e.push(0,0,0,0,0,0,0,0,t)}function fi(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function di(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;for(var n=0,i=null,r=t;null!==r;){var o=r[1],a=o.type;if(null===(i=2===a?o.declTNode:1===a?r[6]:null))return-1;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return-1}function pi(e,t,n){!function(e,t,n){var i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(St)&&(i=n[St]),null==i&&(i=n[St]=ci++);var r=255&i;t.data[e+(r>>5)]|=1<3&&void 0!==arguments[3]?arguments[3]:ot.Default,r=arguments.length>4?arguments[4]:void 0;if(null!==e){var o=function(e){if("string"==typeof e)return e.charCodeAt(0)||0;var t=e.hasOwnProperty(St)?e[St]:void 0;return"number"==typeof t?t>=0?255&t:bi:t}(n);if("function"==typeof o){if(!Nn(t,e,i))return i&ot.Host?vi(r,n,i):gi(t,n,i,r);try{var a=o(i);if(null!=a||i&ot.Optional)return a;Ye(n)}finally{Vn()}}else if("number"==typeof o){var s=null,u=fi(e,t),c=-1,l=i&ot.Host?t[16][6]:null;for((-1===u||i&ot.SkipSelf)&&(-1!==(c=-1===u?di(e,t):t[u+8])&&Si(i,!1)?(s=t[1],u=oi(c),t=ai(c,t)):u=-1);-1!==u;){var h=t[1];if(xi(o,u,h.data)){var f=_i(u,t,n,s,i,l);if(f!==yi)return f}-1!==(c=t[u+8])&&Si(i,t[1].data[u+8]===l)&&xi(o,u,t)?(s=h,u=oi(c),t=ai(c,t)):u=-1}}}return gi(t,n,i,r)}var yi={};function bi(){return new Ei(yn(),vn())}function _i(e,t,n,i,r,o){var a=t[1],s=a.data[e+8],u=wi(s,a,n,null==i?Ft(s)&&si:i!=a&&0!=(3&s.type),r&ot.Host&&o===s);return null!==u?ki(t,a,u,s):yi}function wi(e,t,n,i,r){for(var o=e.providerIndexes,a=t.data,s=1048575&o,u=e.directiveStart,c=o>>20,l=r?s+c:e.directiveEnd,h=i?s:s+c;h=u&&f.type===n)return h}if(r){var d=a[u];if(d&&Vt(d)&&d.type===n)return u}return null}function ki(e,t,n,i){var r=e[n],o=t.data;if(function(e){return e instanceof Zn}(r)){var a=r;a.resolving&&function(e,t){throw new We("200","Circular dependency in DI detected for ".concat(e))}(Xe(o[n]));var s=ui(a.canSeeViewProviders);a.resolving=!0;var u=a.injectImpl?at(a.injectImpl):null;Nn(e,i,ot.Default);try{r=e[n]=a.factory(void 0,o,e,i),t.firstCreatePass&&n>=i.directiveStart&&function(e,t,n){var i=t.type.prototype,r=i.ngOnChanges,o=i.ngOnInit,a=i.ngDoCheck;if(r){var s=Wt(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,s)}o&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,o),a&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,a),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,a))}(n,o[n],t)}finally{null!==u&&at(u),ui(s),a.resolving=!1,Vn()}}return r}function xi(e,t,n){return!!(n[t+(e>>5)]&1<=e.length?e.push(n):e.splice(t,0,n)}function Li(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function ji(e,t){for(var n=[],i=0;i=0?e[1|i]=n:function(e,t,n,i){var r=e.length;if(r==t)e.push(n,i);else if(1===r)e.push(i,e[0]),e[0]=n;else{for(r--,e.push(e[r-1],e[r]);r>t;)e[r]=e[r-2],r--;e[t]=n,e[t+1]=i}}(e,i=~i,t,n),i}function Bi(e,t){var n=Vi(e,t);if(n>=0)return e[1|n]}function Vi(e,t){return function(e,t,n){for(var i=0,r=e.length>>1;r!==i;){var o=i+(r-i>>1),a=e[o<<1];if(t===a)return o<<1;a>t?r=o:i=o+1}return~(r<<1)}(e,t)}var zi,Ui={},Hi="__NG_DI_FLAG__",Gi="ngTempTokenPath",Wi=/\n/gm,qi="__source",Xi=je({provide:String,useValue:je});function Yi(e){var t=zi;return zi=e,t}function Ki(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ot.Default;if(void 0===zi)throw new Error("inject() must be called from an injection context");return null===zi?st(e,void 0,t):zi.get(e,t&ot.Optional?null:void 0,t)}function Qi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ot.Default;return(et||Ki)(He(e),t)}var $i=Qi;function Zi(e){for(var t=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:null;e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.substr(2):e;var r=Be(t);if(Array.isArray(t))r=t.map(Be).join(" -> ");else if("object"==typeof t){var o=[];for(var a in t)if(t.hasOwnProperty(a)){var s=t[a];o.push(a+":"+("string"==typeof s?JSON.stringify(s):Be(s)))}r="{".concat(o.join(", "),"}")}return"".concat(n).concat(i?"("+i+")":"","[").concat(r,"]: ").concat(e.replace(Wi,"\n "))}("\n"+e.message,r,n,i),e.ngTokenPath=r,e[Gi]=null,e}var nr,ir,rr=Ji(Pi("Inject",function(e){return{token:e}}),-1),or=Ji(Pi("Optional"),8),ar=Ji(Pi("SkipSelf"),4);function sr(e){var t;return(null===(t=function(){if(void 0===nr&&(nr=null,vt.trustedTypes))try{nr=vt.trustedTypes.createPolicy("angular",{createHTML:function(e){return e},createScript:function(e){return e},createScriptURL:function(e){return e}})}catch(e){}return nr}())||void 0===t?void 0:t.createHTML(e))||e}function ur(){if(void 0===ir&&(ir=null,vt.trustedTypes))try{ir=vt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:function(e){return e},createScript:function(e){return e},createScriptURL:function(e){return e}})}catch(H){}return ir}function cr(e){var t;return(null===(t=ur())||void 0===t?void 0:t.createHTML(e))||e}function lr(e){var t;return(null===(t=ur())||void 0===t?void 0:t.createScriptURL(e))||e}var hr=function(){function e(t){m(this,e),this.changingThisBreaksApplicationSecurity=t}return b(e,[{key:"toString",value:function(){return"SafeValue must use [property]=binding: ".concat(this.changingThisBreaksApplicationSecurity," (see https://g.co/ng/security#xss)")}}]),e}(),fr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"HTML"}}]),n}(hr),dr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"Style"}}]),n}(hr),pr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"Script"}}]),n}(hr),vr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"URL"}}]),n}(hr),gr=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"getTypeName",value:function(){return"ResourceURL"}}]),n}(hr);function mr(e){return e instanceof hr?e.changingThisBreaksApplicationSecurity:e}function yr(e,t){var n=br(e);if(null!=n&&n!==t){if("ResourceURL"===n&&"URL"===t)return!0;throw new Error("Required a safe ".concat(t,", got a ").concat(n," (see https://g.co/ng/security#xss)"))}return n===t}function br(e){return e instanceof hr&&e.getTypeName()||null}var _r=function(){function e(t){m(this,e),this.inertDocumentHelper=t}return b(e,[{key:"getInertBodyElement",value:function(e){e=""+e;try{var t=(new window.DOMParser).parseFromString(sr(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}]),e}(),wr=function(){function e(t){if(m(this,e),this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){var n=this.inertDocument.createElement("html");this.inertDocument.appendChild(n);var i=this.inertDocument.createElement("body");n.appendChild(i)}}return b(e,[{key:"getInertBodyElement",value:function(e){var t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=sr(e),t;var n=this.inertDocument.createElement("body");return n.innerHTML=sr(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}},{key:"stripCustomNsAttrs",value:function(e){for(var t=e.attributes,n=t.length-1;0"),!0}},{key:"endElement",value:function(e){var t=e.nodeName.toLowerCase();Ir.hasOwnProperty(t)&&!Ar.hasOwnProperty(t)&&(this.buf.push(""))}},{key:"chars",value:function(e){this.buf.push(Vr(e))}},{key:"checkClobberedElement",value:function(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: ".concat(e.outerHTML));return t}}]),e}(),Fr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Br=/([^\#-~ |!])/g;function Vr(e){return e.replace(/&/g,"&").replace(Fr,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Br,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}function zr(e,t){var n=null;try{Tr=Tr||function(e){var t=new wr(e);return function(){try{return!!(new window.DOMParser).parseFromString(sr(""),"text/html")}catch(e){return!1}}()?new _r(t):t}(e);var i=t?String(t):"";n=Tr.getInertBodyElement(i);var r=5,o=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=o,o=n.innerHTML,n=Tr.getInertBodyElement(i)}while(i!==o);return sr((new jr).sanitizeChildren(Ur(n)||n))}finally{if(n)for(var a=Ur(n)||n;a.firstChild;)a.removeChild(a.firstChild)}}function Ur(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Hr=((Hr=Hr||{})[Hr.NONE=0]="NONE",Hr[Hr.HTML=1]="HTML",Hr[Hr.STYLE=2]="STYLE",Hr[Hr.SCRIPT=3]="SCRIPT",Hr[Hr.URL=4]="URL",Hr[Hr.RESOURCE_URL=5]="RESOURCE_URL",Hr);function Gr(e){var t=Xr();return t?cr(t.sanitize(Hr.HTML,e)||""):yr(e,"HTML")?cr(mr(e)):zr(Zt(),qe(e))}function Wr(e){var t=Xr();return t?t.sanitize(Hr.URL,e)||"":yr(e,"URL")?mr(e):Sr(qe(e))}function qr(e){var t=Xr();if(t)return lr(t.sanitize(Hr.RESOURCE_URL,e)||"");if(yr(e,"ResourceURL"))return lr(mr(e));throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)")}function Xr(){var e=vn();return e&&e[12]}var Yr="__ngContext__";function Kr(e,t){e[Yr]=t}function Qr(e){var t=function(e){return e[Yr]||null}(e);return t?Array.isArray(t)?t:t.lView:null}function $r(e){return e.ngOriginalError}function Zr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(e[n-1][4]=i[4]);var o=Li(e,10+t);!function(e,t){Ao(e,t,t[11],2,null,null),t[0]=null,t[6]=null}(i[1],i);var a=o[19];null!==a&&a.detachView(o[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}}function vo(e,t){if(!(256&t[2])){var n=t[11];Jt(n)&&n.destroyNode&&Ao(e,t,n,3,null,null),function(e){var t=e[13];if(!t)return go(e[1],e);for(;t;){var n=null;if(Nt(t))n=t[13];else{var i=t[10];i&&(n=i)}if(!n){for(;t&&!t[4]&&t!==e;)Nt(t)&&go(t[1],t),t=t[3];null===t&&(t=e),Nt(t)&&go(t[1],t),n=t&&t[4]}t=n}}(t)}}function go(e,t){if(!(256&t[2])){t[2]&=-129,t[2]|=256,function(e,t){var n;if(null!=e&&null!=(n=e.destroyHooks))for(var i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),o+=2}else{var l=i[r=n[o+1]];n[o].call(l)}if(null!==i){for(var h=r+1;ho?"":r[l+1].toLowerCase();var f=8&i?h:null;if(f&&-1!==Ro(f,c,0)||2&i&&c!==h){if(Bo(i))return!1;a=!0}}}}else{if(!a&&!Bo(i)&&!Bo(u))return!1;if(a&&Bo(u))continue;a=!1,i=u|1&i}}return Bo(i)||a}function Bo(e){return 0==(1&e)}function Vo(e,t,n,i){if(null===t)return-1;var r=0;if(i||!n){for(var o=!1;r-1)for(n++;n2&&void 0!==arguments[2]&&arguments[2],i=0;i0?'="'+s+'"':"")+"]"}else 8&i?r+="."+a:4&i&&(r+=" "+a);else""!==r&&!Bo(a)&&(t+=Ho(o,r),r=""),i=a,o=o||!Bo(i);n++}return""!==r&&(t+=Ho(o,r)),t}var Wo={};function qo(e){Xo(gn(),vn(),Un()+e,xn())}function Xo(e,t,n,i){if(!i)if(3==(3&t[2])){var r=e.preOrderCheckHooks;null!==r&&Xn(t,r,n)}else{var o=e.preOrderHooks;null!==o&&Yn(t,o,0,n)}Hn(n)}function Yo(e,t){return e<<17|t<<2}function Ko(e){return e>>17&32767}function Qo(e){return 2|e}function $o(e){return(131068&e)>>2}function Zo(e,t){return-131069&e|t<<2}function Jo(e){return 1|e}function ea(e,t){var n=e.contentQueries;if(null!==n)for(var i=0;i20&&Xo(e,t,20,xn()),n(i,r)}finally{Hn(o)}}function ua(e,t,n){if(jt(t))for(var i=t.directiveEnd,r=t.directiveStart;r2&&void 0!==arguments[2]?arguments[2]:rn,i=t.localNames;if(null!==i)for(var r=t.index+1,o=0;o0;){var n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(s)!=u&&s.push(u),s.push(i,r,a)}}function ya(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function ba(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function _a(e,t,n){if(n){if(t.exportAs)for(var i=0;i0&&Aa(n)}}function Aa(e){for(var t=so(e);null!==t;t=uo(t))for(var n=10;n0&&Aa(i)}var o=e[1].components;if(null!==o)for(var a=0;a0&&Aa(s)}}function Pa(e,t){var n=sn(t,e),i=n[1];(function(e,t){for(var n=t.length;n1&&void 0!==arguments[1]?arguments[1]:Ui;if(t===Ui){var n=new Error("NullInjectorError: No provider for ".concat(Be(e),"!"));throw n.name="NullInjectorError",n}return t}}]),e}(),Xa=new Mi("Set Injector scope."),Ya={},Ka={};function Qa(){return void 0===Ga&&(Ga=new qa),Ga}function $a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return new Za(e,n,t||Qa(),i)}var Za=function(){function e(t,n,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;m(this,e),this.parent=i,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;var a=[];n&&Di(n,function(e){return r.processProvider(e,t,n)}),Di([t],function(e){return r.processInjectorType(e,[],a)}),this.records.set(Wa,ts(void 0,this));var s=this.records.get(Xa);this.scope=null!=s?s.value:null,this.source=o||("object"==typeof t?null:Be(t))}return b(e,[{key:"destroyed",get:function(){return this._destroyed}},{key:"destroy",value:function(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(function(e){return e.ngOnDestroy()})}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ui,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ot.Default;this.assertNotDestroyed();var i=Yi(this),r=at(void 0);try{if(!(n&ot.SkipSelf)){var o=this.records.get(e);if(void 0===o){var a=function(e){return"function"==typeof e||"object"==typeof e&&e instanceof Mi}(e)&&$e(e);o=a&&this.injectableDefInScope(a)?ts(Ja(e),Ya):null,this.records.set(e,o)}if(null!=o)return this.hydrate(e,o)}return(n&ot.Self?Qa():this.parent).get(e,t=n&ot.Optional&&t===Ui?null:t)}catch(s){if("NullInjectorError"===s.name){if((s[Gi]=s[Gi]||[]).unshift(Be(e)),i)throw s;return tr(s,e,"R3InjectorError",this.source)}throw s}finally{at(r),Yi(i)}}},{key:"_resolveInjectorDefTypes",value:function(){var e=this;this.injectorDefTypes.forEach(function(t){return e.get(t)})}},{key:"toString",value:function(){var e=[];return this.records.forEach(function(t,n){return e.push(Be(n))}),"R3Injector[".concat(e.join(", "),"]")}},{key:"assertNotDestroyed",value:function(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}},{key:"processInjectorType",value:function(e,t,n){var i=this;if(!(e=He(e)))return!1;var r=Je(e),o=null==r&&e.ngModule||void 0,a=void 0===o?e:o,s=-1!==n.indexOf(a);if(void 0!==o&&(r=Je(o)),null==r)return!1;if(null!=r.imports&&!s){var u;n.push(a);try{Di(r.imports,function(e){i.processInjectorType(e,t,n)&&(void 0===u&&(u=[]),u.push(e))})}finally{}if(void 0!==u)for(var c=function(e){var t=u[e],n=t.ngModule,r=t.providers;Di(r,function(e){return i.processProvider(e,n,r||mt)})},l=0;l0){var n=ji(t,"?");throw new Error("Can't resolve all parameters for ".concat(Be(e),": (").concat(n.join(", "),")."))}var i=function(e){var t=e&&(e[tt]||e[it]);if(t){var n=function(e){if(e.hasOwnProperty("name"))return e.name;var t=(""+e).match(/^function\s*([^\s(]+)/);return null===t?"":t[1]}(e);return console.warn('DEPRECATED: DI is instantiating a token "'.concat(n,'" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "').concat(n,'" class.')),t}return null}(e);return null!==i?function(){return i.factory(e)}:function(){return new e}}(e);throw new Error("unreachable")}function es(e,t,n){var i;if(is(e)){var r=He(e);return Ut(r)||Ja(r)}if(ns(e))i=function(){return He(e.useValue)};else if(function(e){return!(!e||!e.useFactory)}(e))i=function(){return e.useFactory.apply(e,v(Zi(e.deps||[])))};else if(function(e){return!(!e||!e.useExisting)}(e))i=function(){return Qi(He(e.useExisting))};else{var o=He(e&&(e.useClass||e.provide));if(!function(e){return!!e.deps}(e))return Ut(o)||Ja(o);i=function(){return h(o,v(Zi(e.deps)))}}return i}function ts(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{factory:e,value:t,multi:n?[]:void 0}}function ns(e){return null!==e&&"object"==typeof e&&Xi in e}function is(e){return"function"==typeof e}var rs=function(e,t,n){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0,r=$a(e,t,n,i);return r._resolveInjectorDefTypes(),r}({name:n},t,e,n)},os=function(){function e(){m(this,e)}return b(e,null,[{key:"create",value:function(e,t){return Array.isArray(e)?rs(e,t,""):rs(e.providers,e.parent,e.name||"")}}]),e}();function as(e,t){qn(Qr(e)[1],yn())}function ss(e){for(var t=function(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),n=!0,i=[e];t;){var r=void 0;if(Vt(e))r=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new Error("Directives cannot inherit Components");r=t.\u0275dir}if(r){if(n){i.push(r);var o=e;o.inputs=us(e.inputs),o.declaredInputs=us(e.declaredInputs),o.outputs=us(e.outputs);var a=r.hostBindings;a&&hs(e,a);var s=r.viewQuery,u=r.contentQueries;if(s&&cs(e,s),u&&ls(e,u),Fe(e.inputs,r.inputs),Fe(e.declaredInputs,r.declaredInputs),Fe(e.outputs,r.outputs),Vt(r)&&r.data.animation){var c=e.data;c.animation=(c.animation||[]).concat(r.data.animation)}}var l=r.features;if(l)for(var h=0;h=0;i--){var r=e[i];r.hostVars=t+=r.hostVars,r.hostAttrs=ni(r.hostAttrs,n=ni(n,r.hostAttrs))}}(i)}function us(e){return e===gt?{}:e===mt?[]:e}function cs(e,t){var n=e.viewQuery;e.viewQuery=n?function(e,i){t(e,i),n(e,i)}:t}function ls(e,t){var n=e.contentQueries;e.contentQueries=n?function(e,i,r){t(e,i,r),n(e,i,r)}:t}function hs(e,t){var n=e.hostBindings;e.hostBindings=n?function(e,i){t(e,i),n(e,i)}:t}os.THROW_IF_NOT_FOUND=Ui,os.NULL=new qa,os.\u0275prov=Ke({token:os,providedIn:"any",factory:function(){return Qi(Wa)}}),os.__NG_ELEMENT_ID__=-1;var fs=null;function ds(){if(!fs){var e=vt.Symbol;if(e&&e.iterator)fs=e.iterator;else for(var t=Object.getOwnPropertyNames(Map.prototype),n=0;n1&&void 0!==arguments[1]?arguments[1]:ot.Default,n=vn();return null===n?Qi(e,t):mi(yn(),n,He(e),t)}function Cs(e,t,n){var i=vn();return ys(i,On(),t)&&va(gn(),Gn(),i,e,t,i[11],n,!1),Cs}function Os(e,t,n,i,r){var o=r?"class":"style";za(e,n,t.inputs[o],o,i)}function Ts(e,t,n,i){var r=vn(),o=gn(),a=20+e,s=r[11],u=r[a]=ho(s,t,dn.lFrame.currentNamespace),c=o.firstCreatePass?function(e,t,n,i,r,o,a){var s=t.consts,u=na(t,e,2,r,ln(s,o));return ga(t,n,u,ln(s,a)),null!==u.attrs&&Ha(u,u.attrs,!1),null!==u.mergedAttrs&&Ha(u,u.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,u),u}(a,o,r,0,t,n,i):o.data[a];_n(c,!0);var l=c.mergedAttrs;null!==l&&Jn(s,u,l);var h=c.classes;null!==h&&Io(s,u,h);var f=c.styles;null!==f&&Mo(s,u,f),64!=(64&c.flags)&&So(o,r,u,c),0===dn.lFrame.elementDepthCount&&Kr(u,r),dn.lFrame.elementDepthCount++,Bt(c)&&(ca(o,r,c),ua(o,c,r)),null!==i&&la(r,c)}function As(){var e=yn();wn()?kn():_n(e=e.parent,!1);var t=e;dn.lFrame.elementDepthCount--;var n=gn();n.firstCreatePass&&(qn(n,e),jt(e)&&n.queries.elementEnd(e)),null!=t.classesWithoutHost&&function(e){return 0!=(16&e.flags)}(t)&&Os(n,t,vn(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function(e){return 0!=(32&e.flags)}(t)&&Os(n,t,vn(),t.stylesWithoutHost,!1)}function Ps(e,t,n,i){Ts(e,t,n,i),As()}function Ms(e,t,n){var i=vn(),r=gn(),o=e+20,a=r.firstCreatePass?function(e,t,n,i,r){var o=t.consts,a=ln(o,i),s=na(t,e,8,"ng-container",a);return null!==a&&Ha(s,a,!0),ga(t,n,s,ln(o,r)),null!==t.queries&&t.queries.elementStart(t,s),s}(o,r,i,t,n):r.data[o];_n(a,!0);var s=i[o]=i[11].createComment("");So(r,i,s,a),Kr(s,i),Bt(a)&&(ca(r,i,a),ua(r,a,i)),null!=n&&la(i,a)}function Is(){var e=yn(),t=gn();wn()?kn():_n(e=e.parent,!1),t.firstCreatePass&&(qn(t,e),jt(e)&&t.queries.elementEnd(e))}function Rs(e,t,n){Ms(e,t,n),Is()}function Ds(){return vn()}function Ns(e){return!!e&&"function"==typeof e.then}function Ls(e){return!!e&&"function"==typeof e.subscribe}var js=Ls;function Fs(e,t,n,i){var r=vn(),o=gn(),a=yn();return Vs(o,r,r[11],a,e,t,!!n,i),Fs}function Bs(e,t){var n=yn(),i=vn(),r=gn();return Vs(r,i,Ba(Mn(r.data),n,i),n,e,t,!1),Bs}function Vs(e,t,n,i,r,o,a,s){var u=Bt(i),c=e.firstCreatePass&&Fa(e),l=t[8],h=ja(t),f=!0;if(3&i.type||s){var d=rn(i,t),p=s?s(d):d,v=h.length,g=s?function(e){return s(tn(e[i.index]))}:i.index;if(Jt(n)){var m=null;if(!s&&u&&(m=function(e,t,n,i){var r=e.cleanup;if(null!=r)for(var o=0;ou?s[u]:null}"string"==typeof a&&(o+=2)}return null}(e,t,r,i.index)),null!==m)(m.__ngLastListenerFn__||m).__ngNextListenerFn__=o,m.__ngLastListenerFn__=o,f=!1;else{o=Us(i,t,l,o,!1);var y=n.listen(p,r,o);h.push(o,y),c&&c.push(r,g,v,v+1)}}else o=Us(i,t,l,o,!0),p.addEventListener(r,o,a),h.push(o),c&&c.push(r,g,v,a)}else o=Us(i,t,l,o,!1);var b,_=i.outputs;if(f&&null!==_&&(b=_[r])){var w=b.length;if(w)for(var k=0;k0&&void 0!==arguments[0]?arguments[0]:1;return function(e){return(dn.lFrame.contextLView=function(e,t){for(;e>0;)t=t[15],e--;return t}(e,dn.lFrame.contextLView))[8]}(e)}function Gs(e,t){for(var n=null,i=function(e){var t=e.attrs;if(null!=t){var n=t.indexOf(5);if(0==(1&n))return t[n+1]}return null}(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=vn(),r=gn(),o=na(r,20+e,16,null,n||null);null===o.projection&&(o.projection=t),kn(),64!=(64&o.flags)&&function(e,t,n){Po(t[11],0,t,n,mo(e,n,t),ko(n.parent||t[6],n,t))}(r,i,o)}function Xs(e,t,n){return Ys(e,"",t,"",n),Xs}function Ys(e,t,n,i,r){var o=vn(),a=ws(o,t,n,i);return a!==Wo&&va(gn(),Gn(),o,e,a,o[11],r,!1),Ys}function Ks(e,t,n,i,r){for(var o=e[n+1],a=null===t,s=i?Ko(o):$o(o),u=!1;0!==s&&(!1===u||a);){var c=e[s+1];Qs(e[s],t)&&(u=!0,e[s+1]=i?Jo(c):Qo(c)),s=i?Ko(c):$o(c)}u&&(e[n+1]=i?Qo(o):Jo(o))}function Qs(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Vi(e,t)>=0}var $s={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function Zs(e){return e.substring($s.key,$s.keyEnd)}function Js(e){return e.substring($s.value,$s.valueEnd)}function eu(e,t){var n=$s.textEnd;return n===t?-1:(t=$s.keyEnd=function(e,t,n){for(;t32;)t++;return t}(e,$s.key=t,n),iu(e,t,n))}function tu(e,t){var n=$s.textEnd,i=$s.key=iu(e,t,n);return n===i?-1:(i=$s.keyEnd=function(e,t,n){for(var i;t=65&&(-33&i)<=90||i>=48&&i<=57);)t++;return t}(e,i,n),i=ru(e,i,n),i=$s.value=iu(e,i,n),i=$s.valueEnd=function(e,t,n){for(var i=-1,r=-1,o=-1,a=t,s=a;a32&&(s=a),o=r,r=i,i=-33&u}return s}(e,i,n),ru(e,i,n))}function nu(e){$s.key=0,$s.keyEnd=0,$s.value=0,$s.valueEnd=0,$s.textEnd=e.length}function iu(e,t,n){for(;t=0;n=tu(t,n))mu(e,Zs(t),Js(t))}function cu(e){fu(Fi,lu,e,!0)}function lu(e,t){for(var n=function(e){return nu(e),eu(e,iu(e,0,$s.textEnd))}(t);n>=0;n=eu(t,n))Fi(e,Zs(t),!0)}function hu(e,t,n,i){var r=vn(),o=gn(),a=Tn(2);o.firstUpdatePass&&pu(o,e,a,i),t!==Wo&&ys(r,a,t)&&yu(o,o.data[Un()],r,r[11],e,r[a+1]=function(e,t){return null==e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Be(mr(e)))),e}(t,n),i,a)}function fu(e,t,n,i){var r=gn(),o=Tn(2);r.firstUpdatePass&&pu(r,null,o,i);var a=vn();if(n!==Wo&&ys(a,o,n)){var s=r.data[Un()];if(wu(s,i)&&!du(r,o)){var u=i?s.classesWithoutHost:s.stylesWithoutHost;null!==u&&(n=Ve(u,n||"")),Os(r,s,a,n,i)}else!function(e,t,n,i,r,o,a,s){r===Wo&&(r=mt);for(var u=0,c=0,l=0=e.expandoStartIndex}function pu(e,t,n,i){var r=e.data;if(null===r[n+1]){var o=r[Un()],a=du(e,n);wu(o,i)&&null===t&&!a&&(t=!1),t=function(e,t,n,i){var r=Mn(e),o=i?t.residualClasses:t.residualStyles;if(null===r)0===(i?t.classBindings:t.styleBindings)&&(n=gu(n=vu(null,e,t,n,i),t.attrs,i),o=null);else{var a=t.directiveStylingLast;if(-1===a||e[a]!==r)if(n=vu(r,e,t,n,i),null===o){var s=function(e,t,n){var i=n?t.classBindings:t.styleBindings;if(0!==$o(i))return e[Ko(i)]}(e,t,i);void 0!==s&&Array.isArray(s)&&function(e,t,n,i){e[Ko(n?t.classBindings:t.styleBindings)]=i}(e,t,i,s=gu(s=vu(null,e,t,s[1],i),t.attrs,i))}else o=function(e,t,n){for(var i,r=t.directiveEnd,o=1+t.directiveStylingLast;o0)&&(l=!0)}else c=n;if(r)if(0!==u){var f=Ko(e[s+1]);e[i+1]=Yo(f,s),0!==f&&(e[f+1]=Zo(e[f+1],i)),e[s+1]=function(e,t){return 131071&e|t<<17}(e[s+1],i)}else e[i+1]=Yo(s,0),0!==s&&(e[s+1]=Zo(e[s+1],i)),s=i;else e[i+1]=Yo(u,0),0===s?s=i:e[u+1]=Zo(e[u+1],i),u=i;l&&(e[i+1]=Qo(e[i+1])),Ks(e,c,i,!0),Ks(e,c,i,!1),function(e,t,n,i,r){var o=r?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&Vi(o,t)>=0&&(n[i+1]=Jo(n[i+1]))}(t,c,e,i,o),a=Yo(s,u),o?t.classBindings=a:t.styleBindings=a}(r,o,t,n,a,i)}}function vu(e,t,n,i,r){var o=null,a=n.directiveEnd,s=n.directiveStylingLast;for(-1===s?s=n.directiveStart:s++;s0;){var u=e[r],c=Array.isArray(u),l=c?u[1]:u,h=null===l,f=n[r+1];f===Wo&&(f=h?mt:void 0);var d=h?Bi(f,i):l===i?f:void 0;if(c&&!_u(d)&&(d=Bi(u,i)),_u(d)&&(a=d,s))return a;var p=e[r+1];r=s?Ko(p):$o(p)}if(null!==t){var v=o?t.residualClasses:t.residualStyles;null!=v&&(a=Bi(v,i))}return a}function _u(e){return void 0!==e}function wu(e,t){return 0!=(e.flags&(t?16:32))}function ku(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=vn(),i=gn(),r=e+20,o=i.firstCreatePass?na(i,r,1,t,null):i.data[r],a=n[r]=function(e,t){return Jt(e)?e.createText(t):e.createTextNode(t)}(n[11],t);So(i,n,a,o),_n(o,!1)}function xu(e){return Su("",e,""),xu}function Su(e,t,n){var i=vn(),r=ws(i,e,t,n);return r!==Wo&&Ua(i,Un(),r),Su}function Eu(e,t,n,i,r){var o=vn(),a=function(e,t,n,i,r,o){var a=bs(e,Cn(),n,r);return Tn(2),a?t+qe(n)+i+qe(r)+o:Wo}(o,e,t,n,i,r);return a!==Wo&&Ua(o,Un(),a),Eu}function Cu(e,t,n){fu(Fi,lu,ws(vn(),e,t,n),!0)}function Ou(e,t,n){var i=vn();return ys(i,On(),t)&&va(gn(),Gn(),i,e,t,i[11],n,!0),Ou}function Tu(e,t,n){var i=vn();if(ys(i,On(),t)){var r=gn(),o=Gn();va(r,o,i,e,t,Ba(Mn(r.data),o,i),n,!0)}return Tu}var Au=void 0,Pu=["en",[["a","p"],["AM","PM"],Au],[["AM","PM"],Au,Au],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Au,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Au,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Au,"{1} 'at' {0}",Au],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(e){var t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}],Mu={};function Iu(e){return e in Mu||(Mu[e]=vt.ng&&vt.ng.common&&vt.ng.common.locales&&vt.ng.common.locales[e]),Mu[e]}var Ru=((Ru=Ru||{})[Ru.LocaleId=0]="LocaleId",Ru[Ru.DayPeriodsFormat=1]="DayPeriodsFormat",Ru[Ru.DayPeriodsStandalone=2]="DayPeriodsStandalone",Ru[Ru.DaysFormat=3]="DaysFormat",Ru[Ru.DaysStandalone=4]="DaysStandalone",Ru[Ru.MonthsFormat=5]="MonthsFormat",Ru[Ru.MonthsStandalone=6]="MonthsStandalone",Ru[Ru.Eras=7]="Eras",Ru[Ru.FirstDayOfWeek=8]="FirstDayOfWeek",Ru[Ru.WeekendRange=9]="WeekendRange",Ru[Ru.DateFormat=10]="DateFormat",Ru[Ru.TimeFormat=11]="TimeFormat",Ru[Ru.DateTimeFormat=12]="DateTimeFormat",Ru[Ru.NumberSymbols=13]="NumberSymbols",Ru[Ru.NumberFormats=14]="NumberFormats",Ru[Ru.CurrencyCode=15]="CurrencyCode",Ru[Ru.CurrencySymbol=16]="CurrencySymbol",Ru[Ru.CurrencyName=17]="CurrencyName",Ru[Ru.Currencies=18]="Currencies",Ru[Ru.Directionality=19]="Directionality",Ru[Ru.PluralCase=20]="PluralCase",Ru[Ru.ExtraData=21]="ExtraData",Ru),Du="en-US";function Nu(e){(function(e,t){null==e&&function(e,t,n,i){throw new Error("ASSERTION ERROR: ".concat(e)+" [Expected=> ".concat(null," ").concat("!="," ").concat(t," <=Actual]"))}(t,e)})(e,"Expected localeId to be defined"),"string"==typeof e&&e.toLowerCase().replace(/_/g,"-")}function Lu(e,t,n,i,r){if(e=He(e),Array.isArray(e))for(var o=0;o>20;if(is(e)||!e.multi){var p=new Zn(c,r,Es),v=Bu(u,t,r?h:h+d,f);-1===v?(pi(li(l,s),a,u),ju(a,e,t.length),t.push(u),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(p),s.push(p)):(n[v]=p,s[v]=p)}else{var g=Bu(u,t,h+d,f),m=Bu(u,t,h,h+d),y=g>=0&&n[g],b=m>=0&&n[m];if(r&&!b||!r&&!y){pi(li(l,s),a,u);var _=function(e,t,n,i,r){var o=new Zn(e,n,Es);return o.multi=[],o.index=t,o.componentProviders=0,Fu(o,r,i&&!n),o}(r?zu:Vu,n.length,r,i,c);!r&&b&&(n[m].providerFactory=_),ju(a,e,t.length,0),t.push(u),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(_),s.push(_)}else ju(a,e,g>-1?g:m,Fu(n[r?m:g],c,!r&&i));!r&&i&&b&&n[m].componentProviders++}}}function ju(e,t,n,i){var r=is(t);if(r||function(e){return!!e.useClass}(t)){var o=(t.useClass||t).prototype.ngOnDestroy;if(o){var a=e.destroyHooks||(e.destroyHooks=[]);if(!r&&t.multi){var s=a.indexOf(n);-1===s?a.push(n,[i,o]):a[s+1].push(i,o)}else a.push(n,o)}}}function Fu(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function Bu(e,t,n,i){for(var r=n;r1&&void 0!==arguments[1]?arguments[1]:[];return function(n){n.providersResolver=function(n,i){return function(e,t,n){var i=gn();if(i.firstCreatePass){var r=Vt(e);Lu(n,i.data,i.blueprint,r,!0),Lu(t,i.data,i.blueprint,r,!1)}}(n,i?i(e):e,t)}}}var Gu=function e(){m(this,e)},Wu=function e(){m(this,e)};function qu(){}function Xu(e,t){return new Ku(rn(e,t))}Wu.NULL=new(function(){function e(){m(this,e)}return b(e,[{key:"resolveComponentFactory",value:function(e){throw function(e){var t=Error("No component factory found for ".concat(Be(e),". Did you add it to @NgModule.entryComponents?"));return t.ngComponent=e,t}(e)}}]),e}());var Yu=function(){return Xu(yn(),vn())},Ku=function(){var e=function e(t){m(this,e),this.nativeElement=t};return e.__NG_ELEMENT_ID__=Yu,e}();function Qu(e){return e instanceof Ku?e.nativeElement:e}var $u=function e(){m(this,e)},Zu=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=function(){return Ju()},e}(),Ju=function(){var e=vn(),t=sn(yn().index,e);return function(e){return e[11]}(Nt(t)?t:e)},ec=function(){var e=function e(){m(this,e)};return e.\u0275prov=Ke({token:e,providedIn:"root",factory:function(){return null}}),e}(),tc=function e(t){m(this,e),this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")},nc=new tc("12.2.5"),ic=function(){function e(){m(this,e)}return b(e,[{key:"supports",value:function(e){return vs(e)}},{key:"create",value:function(e){return new oc(e)}}]),e}(),rc=function(e,t){return t},oc=function(){function e(t){m(this,e),this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||rc}return b(e,[{key:"forEachItem",value:function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)}},{key:"forEachOperation",value:function(e){for(var t=this._itHead,n=this._removalsHead,i=0,r=null;t||n;){var o=!n||t&&t.currentIndex4&&void 0!==arguments[4]&&arguments[4];null!==n;){var o=t[n.index];if(null!==o&&i.push(tn(o)),Lt(o))for(var a=10;a-1&&(po(e,n),Li(t,n))}this._attachedToViewContainer=!1}vo(this._lView[1],this._lView)}},{key:"onDestroy",value:function(e){da(this._lView[1],this._lView,null,e)}},{key:"markForCheck",value:function(){Ia(this._cdRefInjectingView||this._lView)}},{key:"detach",value:function(){this._lView[2]&=-129}},{key:"reattach",value:function(){this._lView[2]|=128}},{key:"detectChanges",value:function(){Ra(this._lView[1],this._lView,this.context)}},{key:"checkNoChanges",value:function(){!function(e,t,n){Sn(!0);try{Ra(e,t,n)}finally{Sn(!1)}}(this._lView[1],this._lView,this.context)}},{key:"attachToViewContainerRef",value:function(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}},{key:"detachFromAppRef",value:function(){this._appRef=null,function(e,t){Ao(e,t,t[11],2,null,null)}(this._lView[1],this._lView)}},{key:"attachToAppRef",value:function(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}]),e}(),bc=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,e))._view=e,i}return b(n,[{key:"detectChanges",value:function(){Da(this._view)}},{key:"checkNoChanges",value:function(){!function(e){Sn(!0);try{Da(e)}finally{Sn(!1)}}(this._view)}},{key:"context",get:function(){return null}}]),n}(yc),_c=function(e){return function(e,t,n){if(Ft(e)&&!n){var i=sn(e.index,t);return new yc(i,i)}return 47&e.type?new yc(t[16],t):null}(yn(),vn(),16==(16&e))},wc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=_c,e}(),kc=[new lc],xc=new pc([new ic]),Sc=new gc(kc),Ec=function(){return Tc(yn(),vn())},Cc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Ec,e}(),Oc=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this))._declarationLView=e,o._declarationTContainer=i,o.elementRef=r,o}return b(n,[{key:"createEmbeddedView",value:function(e){var t=this._declarationTContainer.tViews,n=ta(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];var i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(t)),ra(t,n,e),new yc(n)}}]),n}(Cc);function Tc(e,t){return 4&e.type?new Oc(t,e,Xu(e,t)):null}var Ac=function e(){m(this,e)},Pc=function(){return Nc(yn(),vn())},Mc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Pc,e}(),Ic=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this))._lContainer=e,o._hostTNode=i,o._hostLView=r,o}return b(n,[{key:"element",get:function(){return Xu(this._hostTNode,this._hostLView)}},{key:"injector",get:function(){return new Ei(this._hostTNode,this._hostLView)}},{key:"parentInjector",get:function(){var e=di(this._hostTNode,this._hostLView);if(ri(e)){var t=ai(e,this._hostLView),n=oi(e);return new Ei(t[1].data[n+8],t)}return new Ei(null,this._hostLView)}},{key:"clear",value:function(){for(;this.length>0;)this.remove(this.length-1)}},{key:"get",value:function(e){var t=Rc(this._lContainer);return null!==t&&t[e]||null}},{key:"length",get:function(){return this._lContainer.length-10}},{key:"createEmbeddedView",value:function(e,t,n){var i=e.createEmbeddedView(t||{});return this.insert(i,n),i}},{key:"createComponent",value:function(e,t,n,i,r){var o=n||this.parentInjector;if(!r&&null==e.ngModule&&o){var a=o.get(Ac,null);a&&(r=a)}var s=e.create(o,i,void 0,r);return this.insert(s.hostView,t),s}},{key:"insert",value:function(e,t){var i=e._lView,r=i[1];if(function(e){return Lt(e[3])}(i)){var o=this.indexOf(e);if(-1!==o)this.detach(o);else{var a=i[3],s=new n(a,a[6],a[3]);s.detach(s.indexOf(e))}}var u=this._adjustIndex(t),c=this._lContainer;!function(e,t,n,i){var r=10+i,o=n.length;i>0&&(n[r-1][4]=t),i1&&void 0!==arguments[1]?arguments[1]:0;return null==e?this.length+t:e}}]),n}(Mc);function Rc(e){return e[8]}function Dc(e){return e[8]||(e[8]=[])}function Nc(e,t){var n,i=t[e.index];if(Lt(i))n=i;else{var r;if(8&e.type)r=tn(i);else{var o=t[11];r=o.createComment("");var a=rn(e,t);yo(o,wo(o,a),r,function(e,t){return Jt(e)?e.nextSibling(t):t.nextSibling}(o,a),!1)}t[e.index]=n=Oa(i,t,r,e),Ma(t,n)}return new Ic(n,e,t)}var Lc={},jc=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).ngModule=e,i}return b(n,[{key:"resolveComponentFactory",value:function(e){var t=Rt(e);return new Vc(t,this.ngModule)}}]),n}(Wu);function Fc(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}var Bc=new Mi("SCHEDULER_TOKEN",{providedIn:"root",factory:function(){return eo}}),Vc=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this)).componentDef=e,r.ngModule=i,r.componentType=e.type,r.selector=function(e){return e.map(Go).join(",")}(e.selectors),r.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],r.isBoundToModule=!!i,r}return b(n,[{key:"inputs",get:function(){return Fc(this.componentDef.inputs)}},{key:"outputs",get:function(){return Fc(this.componentDef.outputs)}},{key:"create",value:function(e,t,n,i){var r,o,a=(i=i||this.ngModule)?function(e,t){return{get:function(n,i,r){var o=e.get(n,Lc,r);return o!==Lc||i===Lc?o:t.get(n,i,r)}}}(e,i.injector):e,s=a.get($u,en),u=a.get(ec,null),c=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",h=n?function(e,t,n){if(Jt(e))return e.selectRootElement(t,n===lt.ShadowDom);var i="string"==typeof t?e.querySelector(t):t;return i.textContent="",i}(c,n,this.componentDef.encapsulation):ho(s.createRenderer(null,this.componentDef),l,function(e){var t=e.toLowerCase();return"svg"===t?$t:"math"===t?"http://www.w3.org/1998/MathML/":null}(l)),f=this.componentDef.onPush?576:528,d={components:[],scheduler:eo,clean:La,playerHandler:null,flags:0},p=fa(0,null,null,1,0,null,null,null,null,null),v=ta(null,p,d,f,null,null,s,c,u,a);Ln(v);try{var g=function(e,t,n,i,r,o){var a=n[1];n[20]=e;var s=na(a,20,2,"#host",null),u=s.mergedAttrs=t.hostAttrs;null!==u&&(Ha(s,u,!0),null!==e&&(Jn(r,e,u),null!==s.classes&&Io(r,e,s.classes),null!==s.styles&&Mo(r,e,s.styles)));var c=i.createRenderer(e,t),l=ta(n,ha(t),null,t.onPush?64:16,n[20],s,i,c,null,null);return a.firstCreatePass&&(pi(li(s,n),a,t.type),ba(a,s),wa(s,n.length,1)),Ma(n,l),n[20]=l}(h,this.componentDef,v,s,c);if(h)if(n)Jn(c,h,["ng-version",nc.full]);else{var m=function(e){for(var t=[],n=[],i=1,r=2;i0&&Io(c,h,b.join(" "))}if(o=on(p,20),void 0!==t)for(var _=o.projection=[],w=0;w1&&void 0!==arguments[1]?arguments[1]:os.THROW_IF_NOT_FOUND,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ot.Default;return e===os||e===Ac||e===Wa?this:this._r3Injector.get(e,t,n)}},{key:"destroy",value:function(){var e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(function(e){return e()}),this.destroyCbs=null}},{key:"onDestroy",value:function(e){this.destroyCbs.push(e)}}]),n}(Ac),Gc=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).moduleType=e,null!==Dt(e)&&function(e){var t=new Set;!function e(n){var i=Dt(n,!0),r=i.id;null!==r&&(function(e,t,n){if(t&&t!==n)throw new Error("Duplicate module registered for ".concat(e," - ").concat(Be(t)," vs ").concat(Be(t.name)))}(r,Uc.get(r),n),Uc.set(r,n));var o,a=_(io(i.imports));try{for(a.s();!(o=a.n()).done;){var s=o.value;t.has(s)||(t.add(s),e(s))}}catch(u){a.e(u)}finally{a.f()}}(e)}(e),i}return b(n,[{key:"create",value:function(e){return new Hc(this.moduleType,e)}}]),n}(function(){return function e(){m(this,e)}}());function Wc(e,t,n){var i=En()+e,r=vn();return r[i]===Wo?ms(r,i,n?t.call(n):t()):function(e,t){return e[t]}(r,i)}function qc(e,t,n,i){return Yc(vn(),En(),e,t,n,i)}function Xc(e,t){var n=e[t];return n===Wo?void 0:n}function Yc(e,t,n,i,r,o){var a=t+n;return ys(e,a,r)?ms(e,a+1,o?i.call(o,r):i(r)):Xc(e,a+1)}function Kc(e,t){var n,i=gn(),r=e+20;i.firstCreatePass?(n=function(e,t){if(t)for(var n=t.length-1;n>=0;n--){var i=t[n];if(e===i.name)return i}throw new We("302","The pipe '".concat(e,"' could not be found!"))}(t,i.pipeRegistry),i.data[r]=n,n.onDestroy&&(i.destroyHooks||(i.destroyHooks=[])).push(r,n.onDestroy)):n=i.data[r];var o=n.factory||(n.factory=Ut(n.type)),a=at(Es);try{var s=ui(!1),u=o();return ui(s),function(e,t,n,i){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=i}(i,vn(),r,u),u}finally{at(a)}}function Qc(e,t,n){var i=e+20,r=vn(),o=an(r,i);return function(e,t){return ps.isWrapped(t)&&(t=ps.unwrap(t),e[Cn()]=Wo),t}(r,function(e,t){return e[1].data[t].pure}(r,i)?Yc(r,En(),t,o.transform,n,o):o.transform(n))}function $c(e){return function(t){setTimeout(e,void 0,t)}}var Zc=function(t){a(i,t);var n=s(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return m(this,i),(e=n.call(this)).__isAsync=t,e}return b(i,[{key:"emit",value:function(t){e(p(i.prototype),"next",this).call(this,t)}},{key:"subscribe",value:function(t,n,r){var o,a,s,u=t,c=n||function(){return null},l=r;if(t&&"object"==typeof t){var h=t;u=null===(o=h.next)||void 0===o?void 0:o.bind(h),c=null===(a=h.error)||void 0===a?void 0:a.bind(h),l=null===(s=h.complete)||void 0===s?void 0:s.bind(h)}this.__isAsync&&(c=$c(c),u&&(u=$c(u)),l&&(l=$c(l)));var f=e(p(i.prototype),"subscribe",this).call(this,{next:u,error:c,complete:l});return t instanceof W&&t.add(f),f}}]),i}(oe);function Jc(){return this._results[ds()]()}var el=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];m(this,e),this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;var n=ds(),i=e.prototype;i[n]||(i[n]=Jc)}return b(e,[{key:"changes",get:function(){return this._changes||(this._changes=new Zc)}},{key:"get",value:function(e){return this._results[e]}},{key:"map",value:function(e){return this._results.map(e)}},{key:"filter",value:function(e){return this._results.filter(e)}},{key:"find",value:function(e){return this._results.find(e)}},{key:"reduce",value:function(e,t){return this._results.reduce(e,t)}},{key:"forEach",value:function(e){this._results.forEach(e)}},{key:"some",value:function(e){return this._results.some(e)}},{key:"toArray",value:function(){return this._results.slice()}},{key:"toString",value:function(){return this._results.toString()}},{key:"reset",value:function(e,t){var n=this;n.dirty=!1;var i=Ri(e);(this._changesDetected=!function(e,t,n){if(e.length!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[];m(this,e),this.queries=t}return b(e,[{key:"createEmbeddedView",value:function(t){var n=t.queries;if(null!==n){for(var i=null!==t.contentQueries?t.contentQueries[0]:n.length,r=[],o=0;o2&&void 0!==arguments[2]?arguments[2]:null;m(this,e),this.predicate=t,this.flags=n,this.read=i},rl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];m(this,e),this.queries=t}return b(e,[{key:"elementStart",value:function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:-1;m(this,e),this.metadata=t,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=n}return b(e,[{key:"elementStart",value:function(e,t){this.isApplyingToNode(t)&&this.matchTNode(e,t)}},{key:"elementEnd",value:function(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}},{key:"template",value:function(e,t){this.elementStart(e,t)}},{key:"embeddedTView",value:function(t,n){return this.isApplyingToNode(t)?(this.crossesNgTemplate=!0,this.addMatch(-t.index,n),new e(this.metadata)):null}},{key:"isApplyingToNode",value:function(e){if(this._appliesToNextNode&&1!=(1&this.metadata.flags)){for(var t=this._declarationNodeIndex,n=e.parent;null!==n&&8&n.type&&n.index!==t;)n=n.parent;return t===(null!==n?n.index:-1)}return this._appliesToNextNode}},{key:"matchTNode",value:function(e,t){var n=this.metadata.predicate;if(Array.isArray(n))for(var i=0;i0)i.push(a[s/2]);else{for(var c=o[s+1],l=t[-u],h=10;h0&&(r=setTimeout(function(){i._callbacks=i._callbacks.filter(function(e){return e.timeoutId!==r}),e(i._didWork,i.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:r,updateCb:n})}},{key:"whenStable",value:function(e,t,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(e,t,n),this._runCallbacksIfReady()}},{key:"getPendingRequestCount",value:function(){return this._pendingCount}},{key:"findProviders",value:function(e,t,n){return[]}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Kl=function(){var e=function(){function e(){m(this,e),this._applications=new Map,Ql.addToWindow(this)}return b(e,[{key:"registerApplication",value:function(e,t){this._applications.set(e,t)}},{key:"unregisterApplication",value:function(e){this._applications.delete(e)}},{key:"unregisterAllApplications",value:function(){this._applications.clear()}},{key:"getTestability",value:function(e){return this._applications.get(e)||null}},{key:"getAllTestabilities",value:function(){return Array.from(this._applications.values())}},{key:"getAllRootElements",value:function(){return Array.from(this._applications.keys())}},{key:"findTestabilityInTree",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ql.findTestabilityInTree(this,e,t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Ql=new(function(){function e(){m(this,e)}return b(e,[{key:"addToWindow",value:function(e){}},{key:"findTestabilityInTree",value:function(e,t,n){return null}}]),e}()),$l=!0,Zl=!1;function Jl(){return Zl=!0,$l}var eh=new Mi("AllowMultipleToken");function th(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i="Platform: ".concat(t),r=new Mi(i);return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=nh();if(!o||o.injector.get(eh,!1))if(e)e(n.concat(t).concat({provide:r,useValue:!0}));else{var a=n.concat(t).concat({provide:r,useValue:!0},{provide:Xa,useValue:"platform"});!function(e){if(ql&&!ql.destroyed&&!ql.injector.get(eh,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ql=e.get(ih);var t=e.get(xl,null);t&&t.forEach(function(e){return e()})}(os.create({providers:a,name:i}))}return function(e){var t=nh();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(r)}}function nh(){return ql&&!ql.destroyed?ql:null}var ih=function(){var e=function(){function e(t){m(this,e),this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return b(e,[{key:"bootstrapModuleFactory",value:function(e,t){var n=this,i=function(e,t){return"noop"===e?new Xl:("zone.js"===e?void 0:e)||new Vl({enableLongStackTrace:Jl(),shouldCoalesceEventChangeDetection:!!(null==t?void 0:t.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==t?void 0:t.ngZoneRunCoalescing)})}(t?t.ngZone:void 0,{ngZoneEventCoalescing:t&&t.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:t&&t.ngZoneRunCoalescing||!1}),r=[{provide:Vl,useValue:i}];return i.run(function(){var o=os.create({providers:r,parent:n.injector,name:e.moduleType.name}),a=e.create(o),s=a.injector.get(Jr,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return i.runOutsideAngular(function(){var e=i.onError.subscribe({next:function(e){s.handleError(e)}});a.onDestroy(function(){ah(n._modules,a),e.unsubscribe()})}),function(e,i,r){try{var o=((s=a.injector.get(bl)).runInitializers(),s.donePromise.then(function(){return Nu(a.injector.get(Ol,Du)||Du),n._moduleDoBootstrap(a),a}));return Ns(o)?o.catch(function(t){throw i.runOutsideAngular(function(){return e.handleError(t)}),t}):o}catch(t){throw i.runOutsideAngular(function(){return e.handleError(t)}),t}var s}(s,i)})}},{key:"bootstrapModule",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=rh({},n);return function(e,t,n){var i=new Gc(n);return Promise.resolve(i)}(0,0,e).then(function(e){return t.bootstrapModuleFactory(e,i)})}},{key:"_moduleDoBootstrap",value:function(e){var t=e.injector.get(oh);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(function(e){return t.bootstrap(e)});else{if(!e.instance.ngDoBootstrap)throw new Error("The module ".concat(Be(e.instance.constructor),' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.'));e.instance.ngDoBootstrap(t)}this._modules.push(e)}},{key:"onDestroy",value:function(e){this._destroyListeners.push(e)}},{key:"injector",get:function(){return this._injector}},{key:"destroy",value:function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(e){return e.destroy()}),this._destroyListeners.forEach(function(e){return e()}),this._destroyed=!0}},{key:"destroyed",get:function(){return this._destroyed}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(os))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}();function rh(e,t){return Array.isArray(t)?t.reduce(rh,e):Object.assign(Object.assign({},e),t)}var oh=function(){var e=function(){function e(t,n,i,r,o){var a=this;m(this,e),this._zone=t,this._injector=n,this._exceptionHandler=i,this._componentFactoryResolver=r,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:function(){a._zone.run(function(){a.tick()})}});var s=new ee(function(e){a._stable=a._zone.isStable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks,a._zone.runOutsideAngular(function(){e.next(a._stable),e.complete()})}),u=new ee(function(e){var t;a._zone.runOutsideAngular(function(){t=a._zone.onStable.subscribe(function(){Vl.assertNotInAngularZone(),Bl(function(){!a._stable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks&&(a._stable=!0,e.next(!0))})})});var n=a._zone.onUnstable.subscribe(function(){Vl.assertInAngularZone(),a._stable&&(a._stable=!1,a._zone.runOutsideAngular(function(){e.next(!1)}))});return function(){t.unsubscribe(),n.unsubscribe()}});this.isStable=Ce(s,u.pipe(Le()))}return b(e,[{key:"bootstrap",value:function(e,t){var n,i=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=e instanceof Gu?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);var r=function(e){return e.isBoundToModule}(n)?void 0:this._injector.get(Ac),o=n.create(os.NULL,[],t||n.selector,r),a=o.location.nativeElement,s=o.injector.get(Yl,null),u=s&&o.injector.get(Kl);return s&&u&&u.registerApplication(a,s),o.onDestroy(function(){i.detachView(o.hostView),ah(i.components,o),u&&u.unregisterApplication(a)}),this._loadComponent(o),o}},{key:"tick",value:function(){var e=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;var t,n=_(this._views);try{for(n.s();!(t=n.n()).done;){var i;t.value.detectChanges()}}catch(r){n.e(r)}finally{n.f()}}catch(i){this._zone.runOutsideAngular(function(){return e._exceptionHandler.handleError(i)})}finally{this._runningTick=!1}}},{key:"attachView",value:function(e){var t=e;this._views.push(t),t.attachToAppRef(this)}},{key:"detachView",value:function(e){var t=e;ah(this._views,t),t.detachFromAppRef()}},{key:"_loadComponent",value:function(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(El,[]).concat(this._bootstrapListeners).forEach(function(t){return t(e)})}},{key:"ngOnDestroy",value:function(){this._views.slice().forEach(function(e){return e.destroy()}),this._onMicrotaskEmptySubscription.unsubscribe()}},{key:"viewCount",get:function(){return this._views.length}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl),Qi(os),Qi(Jr),Qi(Wu),Qi(bl))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}();function ah(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var sh=th(null,"core",[{provide:Sl,useValue:"unknown"},{provide:ih,deps:[os]},{provide:Kl,deps:[]},{provide:Cl,deps:[]}]),uh=[{provide:oh,useClass:oh,deps:[Vl,os,Jr,Wu,bl]},{provide:Bc,deps:[Vl],useFactory:function(e){var t=[];return e.onStable.subscribe(function(){for(;t.length;)t.pop()()}),function(e){t.push(e)}}},{provide:bl,useClass:bl,deps:[[new or,yl]]},{provide:Ll,useClass:Ll,deps:[]},wl,{provide:pc,useFactory:function(){return xc},deps:[]},{provide:gc,useFactory:function(){return Sc},deps:[]},{provide:Ol,useFactory:function(e){return Nu(e=e||"undefined"!=typeof $localize&&$localize.locale||Du),e},deps:[[new rr(Ol),new or,new ar]]},{provide:Tl,useValue:"USD"}],ch=function(){var e=function e(t){m(this,e)};return e.\u0275fac=function(t){return new(t||e)(Qi(oh))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:uh}),e}(),lh=null;function hh(){return lh}var fh=new Mi("DocumentToken"),dh=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"historyGo",value:function(e){throw new Error("Not implemented")}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({factory:ph,token:e,providedIn:"platform"}),e}();function ph(){return Qi(vh)}var vh=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this))._doc=e,i._init(),i}return b(n,[{key:"_init",value:function(){this.location=window.location,this._history=window.history}},{key:"getBaseHrefFromDOM",value:function(){return hh().getBaseHref(this._doc)}},{key:"onPopState",value:function(e){var t=hh().getGlobalEventTarget(this._doc,"window");return t.addEventListener("popstate",e,!1),function(){return t.removeEventListener("popstate",e)}}},{key:"onHashChange",value:function(e){var t=hh().getGlobalEventTarget(this._doc,"window");return t.addEventListener("hashchange",e,!1),function(){return t.removeEventListener("hashchange",e)}}},{key:"href",get:function(){return this.location.href}},{key:"protocol",get:function(){return this.location.protocol}},{key:"hostname",get:function(){return this.location.hostname}},{key:"port",get:function(){return this.location.port}},{key:"pathname",get:function(){return this.location.pathname},set:function(e){this.location.pathname=e}},{key:"search",get:function(){return this.location.search}},{key:"hash",get:function(){return this.location.hash}},{key:"pushState",value:function(e,t,n){gh()?this._history.pushState(e,t,n):this.location.hash=n}},{key:"replaceState",value:function(e,t,n){gh()?this._history.replaceState(e,t,n):this.location.hash=n}},{key:"forward",value:function(){this._history.forward()}},{key:"back",value:function(){this._history.back()}},{key:"historyGo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._history.go(e)}},{key:"getState",value:function(){return this._history.state}}]),n}(dh);return e.\u0275fac=function(t){return new(t||e)(Qi(fh))},e.\u0275prov=Ke({factory:mh,token:e,providedIn:"platform"}),e}();function gh(){return!!window.history.pushState}function mh(){return new vh(Qi(fh))}function yh(e,t){if(0==e.length)return t;if(0==t.length)return e;var n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}function bh(e){var t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}function _h(e){return e&&"?"!==e[0]?"?"+e:e}var wh=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"historyGo",value:function(e){throw new Error("Not implemented")}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({factory:kh,token:e,providedIn:"root"}),e}();function kh(e){var t=Qi(fh).location;return new Sh(Qi(dh),t&&t.origin||"")}var xh=new Mi("appBaseHref"),Sh=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;if(m(this,n),(r=t.call(this))._platformLocation=e,r._removeListenerFns=[],null==i&&(i=r._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return r._baseHref=i,u(r)}return b(n,[{key:"ngOnDestroy",value:function(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}},{key:"onPopState",value:function(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}},{key:"getBaseHref",value:function(){return this._baseHref}},{key:"prepareExternalUrl",value:function(e){return yh(this._baseHref,e)}},{key:"path",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._platformLocation.pathname+_h(this._platformLocation.search),n=this._platformLocation.hash;return n&&e?"".concat(t).concat(n):t}},{key:"pushState",value:function(e,t,n,i){var r=this.prepareExternalUrl(n+_h(i));this._platformLocation.pushState(e,t,r)}},{key:"replaceState",value:function(e,t,n,i){var r=this.prepareExternalUrl(n+_h(i));this._platformLocation.replaceState(e,t,r)}},{key:"forward",value:function(){this._platformLocation.forward()}},{key:"back",value:function(){this._platformLocation.back()}},{key:"historyGo",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null===(t=(e=this._platformLocation).historyGo)||void 0===t||t.call(e,n)}}]),n}(wh);return e.\u0275fac=function(t){return new(t||e)(Qi(dh),Qi(xh,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Eh=function(){var e=function(){function e(t,n){var i=this;m(this,e),this._subject=new Zc,this._urlChangeListeners=[],this._platformStrategy=t;var r=this._platformStrategy.getBaseHref();this._platformLocation=n,this._baseHref=bh(Oh(r)),this._platformStrategy.onPopState(function(e){i._subject.emit({url:i.path(!0),pop:!0,state:e.state,type:e.type})})}return b(e,[{key:"path",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.normalize(this._platformStrategy.path(e))}},{key:"getState",value:function(){return this._platformLocation.getState()}},{key:"isCurrentPathEqualTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this.path()==this.normalize(e+_h(t))}},{key:"normalize",value:function(t){return e.stripTrailingSlash(function(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,Oh(t)))}},{key:"prepareExternalUrl",value:function(e){return e&&"/"!==e[0]&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)}},{key:"go",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._platformStrategy.pushState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+_h(t)),n)}},{key:"replaceState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._platformStrategy.replaceState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+_h(t)),n)}},{key:"forward",value:function(){this._platformStrategy.forward()}},{key:"back",value:function(){this._platformStrategy.back()}},{key:"historyGo",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null===(t=(e=this._platformStrategy).historyGo)||void 0===t||t.call(e,n)}},{key:"onUrlChange",value:function(e){var t=this;this._urlChangeListeners.push(e),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(function(e){t._notifyUrlChangeListeners(e.url,e.state)}))}},{key:"_notifyUrlChangeListeners",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;this._urlChangeListeners.forEach(function(n){return n(e,t)})}},{key:"subscribe",value:function(e,t,n){return this._subject.subscribe({next:e,error:t,complete:n})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(wh),Qi(dh))},e.normalizeQueryParams=_h,e.joinWithSlash=yh,e.stripTrailingSlash=bh,e.\u0275prov=Ke({factory:Ch,token:e,providedIn:"root"}),e}();function Ch(){return new Eh(Qi(wh),Qi(dh))}function Oh(e){return e.replace(/\/index.html$/,"")}var Th=((Th=Th||{})[Th.Zero=0]="Zero",Th[Th.One=1]="One",Th[Th.Two=2]="Two",Th[Th.Few=3]="Few",Th[Th.Many=4]="Many",Th[Th.Other=5]="Other",Th),Ah=function e(){m(this,e)},Ph=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).locale=e,i}return b(n,[{key:"getPluralCategory",value:function(e,t){switch(function(e){return function(e){var t=function(e){return e.toLowerCase().replace(/_/g,"-")}(e),n=Iu(t);if(n)return n;var i=t.split("-")[0];if(n=Iu(i))return n;if("en"===i)return Pu;throw new Error('Missing locale data for the locale "'.concat(e,'".'))}(e)[Ru.PluralCase]}(t||this.locale)(e)){case Th.Zero:return"zero";case Th.One:return"one";case Th.Two:return"two";case Th.Few:return"few";case Th.Many:return"many";default:return"other"}}}]),n}(Ah);return e.\u0275fac=function(t){return new(t||e)(Qi(Ol))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}();function Mh(e,n){n=encodeURIComponent(n);var i,r=_(e.split(";"));try{for(r.s();!(i=r.n()).done;){var o=i.value,a=o.indexOf("="),s=t(-1==a?[o,""]:[o.slice(0,a),o.slice(a+1)],2),u=s[0],c=s[1];if(u.trim()===n)return decodeURIComponent(c)}}catch(l){r.e(l)}finally{r.f()}return null}var Ih=function(){var e=function(){function e(t,n,i,r){m(this,e),this._iterableDiffers=t,this._keyValueDiffers=n,this._ngEl=i,this._renderer=r,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}return b(e,[{key:"klass",set:function(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}},{key:"ngClass",set:function(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(vs(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}},{key:"ngDoCheck",value:function(){if(this._iterableDiffer){var e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){var t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}},{key:"_applyKeyValueChanges",value:function(e){var t=this;e.forEachAddedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachChangedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){e.previousValue&&t._toggleClass(e.key,!1)})}},{key:"_applyIterableChanges",value:function(e){var t=this;e.forEachAddedItem(function(e){if("string"!=typeof e.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got ".concat(Be(e.item)));t._toggleClass(e.item,!0)}),e.forEachRemovedItem(function(e){return t._toggleClass(e.item,!1)})}},{key:"_applyClasses",value:function(e){var t=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return t._toggleClass(e,!0)}):Object.keys(e).forEach(function(n){return t._toggleClass(n,!!e[n])}))}},{key:"_removeClasses",value:function(e){var t=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return t._toggleClass(e,!1)}):Object.keys(e).forEach(function(e){return t._toggleClass(e,!1)}))}},{key:"_toggleClass",value:function(e,t){var n=this;(e=e.trim())&&e.split(/\s+/g).forEach(function(e){t?n._renderer.addClass(n._ngEl.nativeElement,e):n._renderer.removeClass(n._ngEl.nativeElement,e)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(pc),Es(gc),Es(Ku),Es(Zu))},e.\u0275dir=It({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),e}(),Rh=function(){function e(t,n,i,r){m(this,e),this.$implicit=t,this.ngForOf=n,this.index=i,this.count=r}return b(e,[{key:"first",get:function(){return 0===this.index}},{key:"last",get:function(){return this.index===this.count-1}},{key:"even",get:function(){return this.index%2==0}},{key:"odd",get:function(){return!this.even}}]),e}(),Dh=function(){var e=function(){function e(t,n,i){m(this,e),this._viewContainer=t,this._template=n,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}return b(e,[{key:"ngForOf",set:function(e){this._ngForOf=e,this._ngForOfDirty=!0}},{key:"ngForTrackBy",get:function(){return this._trackByFn},set:function(e){this._trackByFn=e}},{key:"ngForTemplate",set:function(e){e&&(this._template=e)}},{key:"ngDoCheck",value:function(){if(this._ngForOfDirty){this._ngForOfDirty=!1;var e=this._ngForOf;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(n){throw new Error("Cannot find a differ supporting object '".concat(e,"' of type '").concat(function(e){return e.name||typeof e}(e),"'. NgFor only supports binding to Iterables such as Arrays."))}}if(this._differ){var t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}},{key:"_applyChanges",value:function(e){var t=this,n=[];e.forEachOperation(function(e,i,r){if(null==e.previousIndex){var o=t._viewContainer.createEmbeddedView(t._template,new Rh(null,t._ngForOf,-1,-1),null===r?void 0:r),a=new Nh(e,o);n.push(a)}else if(null==r)t._viewContainer.remove(null===i?void 0:i);else if(null!==i){var s=t._viewContainer.get(i);t._viewContainer.move(s,r);var u=new Nh(e,s);n.push(u)}});for(var i=0;i1&&void 0!==arguments[1])||arguments[1],i=e.findTestabilityInTree(t,n);if(null==i)throw new Error("Could not find testability for element.");return i},vt.getAllAngularTestabilities=function(){return e.getAllTestabilities()},vt.getAllAngularRootElements=function(){return e.getAllRootElements()},vt.frameworkStabilizers||(vt.frameworkStabilizers=[]),vt.frameworkStabilizers.push(function(e){var t=vt.getAllAngularTestabilities(),n=t.length,i=!1,r=function(t){i=i||t,0==--n&&e(i)};t.forEach(function(e){e.whenStable(r)})})}},{key:"findTestabilityInTree",value:function(e,t,n){if(null==t)return null;var i=e.getTestability(t);return null!=i?i:n?hh().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}],[{key:"init",value:function(){!function(e){Ql=e}(new e)}}]),e}(),af=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"build",value:function(){return new XMLHttpRequest}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),sf=new Mi("EventManagerPlugins"),uf=function(){var e=function(){function e(t,n){var i=this;m(this,e),this._zone=n,this._eventNameToPlugin=new Map,t.forEach(function(e){return e.manager=i}),this._plugins=t.slice().reverse()}return b(e,[{key:"addEventListener",value:function(e,t,n){return this._findPluginFor(t).addEventListener(e,t,n)}},{key:"addGlobalEventListener",value:function(e,t,n){return this._findPluginFor(t).addGlobalEventListener(e,t,n)}},{key:"getZone",value:function(){return this._zone}},{key:"_findPluginFor",value:function(e){var t=this._eventNameToPlugin.get(e);if(t)return t;for(var n=this._plugins,i=0;i-1&&(t.splice(n,1),o+=e+".")}),o+=r,0!=t.length||0===r.length)return null;var a={};return a.domEventName=i,a.fullKey=o,a}},{key:"getEventFullKey",value:function(e){var t="",n=function(e){var t=e.key;if(null==t){if(null==(t=e.keyIdentifier))return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),3===e.location&&Sf.hasOwnProperty(t)&&(t=Sf[t]))}return xf[t]||t}(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),kf.forEach(function(i){i!=n&&Ef[i](e)&&(t+=i+".")}),t+=n}},{key:"eventCallback",value:function(e,t,i){return function(r){n.getEventFullKey(r)===e&&i.runGuarded(function(){return t(r)})}}},{key:"_normalizeKey",value:function(e){switch(e){case"esc":return"escape";default:return e}}}]),n}(cf);return e.\u0275fac=function(t){return new(t||e)(Qi(fh))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Of=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({factory:function(){return Qi(Tf)},token:e,providedIn:"root"}),e}(),Tf=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this))._doc=e,i}return b(n,[{key:"sanitize",value:function(e,t){if(null==t)return null;switch(e){case Hr.NONE:return t;case Hr.HTML:return yr(t,"HTML")?mr(t):zr(this._doc,String(t)).toString();case Hr.STYLE:return yr(t,"Style")?mr(t):t;case Hr.SCRIPT:if(yr(t,"Script"))return mr(t);throw new Error("unsafe value used in a script context");case Hr.URL:return br(t),yr(t,"URL")?mr(t):Sr(String(t));case Hr.RESOURCE_URL:if(yr(t,"ResourceURL"))return mr(t);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext ".concat(e," (see https://g.co/ng/security#xss)"))}}},{key:"bypassSecurityTrustHtml",value:function(e){return function(e){return new fr(e)}(e)}},{key:"bypassSecurityTrustStyle",value:function(e){return function(e){return new dr(e)}(e)}},{key:"bypassSecurityTrustScript",value:function(e){return function(e){return new pr(e)}(e)}},{key:"bypassSecurityTrustUrl",value:function(e){return function(e){return new vr(e)}(e)}},{key:"bypassSecurityTrustResourceUrl",value:function(e){return function(e){return new gr(e)}(e)}}]),n}(Of);return e.\u0275fac=function(t){return new(t||e)(Qi(fh))},e.\u0275prov=Ke({factory:function(){return function(e){return new Tf(e.get(fh))}(Qi(Wa))},token:e,providedIn:"root"}),e}(),Af=th(sh,"browser",[{provide:Sl,useValue:Qh},{provide:xl,useValue:function(){ef.makeCurrent(),of.init()},multi:!0},{provide:fh,useFactory:function(){return function(e){Qt=e}(document),document},deps:[]}]),Pf=[[],{provide:Xa,useValue:"root"},{provide:Jr,useFactory:function(){return new Jr},deps:[]},{provide:sf,useClass:wf,multi:!0,deps:[fh,Vl,Sl]},{provide:sf,useClass:Cf,multi:!0,deps:[fh]},[],{provide:mf,useClass:mf,deps:[uf,hf,_l]},{provide:$u,useExisting:mf},{provide:lf,useExisting:hf},{provide:hf,useClass:hf,deps:[fh]},{provide:Yl,useClass:Yl,deps:[Vl]},{provide:uf,useClass:uf,deps:[sf,Vl]},{provide:Jh,useClass:af,deps:[]},[]],Mf=function(){var e=function(){function e(t){if(m(this,e),t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}return b(e,null,[{key:"withServerTransition",value:function(t){return{ngModule:e,providers:[{provide:_l,useValue:t.appId},{provide:nf,useExisting:_l},rf]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(e,12))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:Pf,imports:[Kh,ch]}),e}();function If(e){return null!=e&&"false"!="".concat(e)}function Rf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(e){return!isNaN(parseFloat(e))&&!isNaN(Number(e))}(e)?Number(e):t}function Df(e){return Array.isArray(e)?e:[e]}function Nf(e){return null==e?"":"string"==typeof e?e:"".concat(e,"px")}function Lf(e){return e instanceof Ku?e.nativeElement:e}function jf(){for(var e=arguments.length,t=new Array(e),n=0;n1?Array.prototype.slice.call(arguments):e)},i,n)})}function Bf(e,t,n,i,r){var o;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(e)){var a=e;e.addEventListener(t,n,r),o=function(){return a.removeEventListener(t,n,r)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(e)){var s=e;e.on(t,n),o=function(){return s.off(t,n)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(e)){var u=e;e.addListener(t,n),o=function(){return u.removeListener(t,n)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var c=0,l=e.length;c1&&void 0!==arguments[1]?arguments[1]:0;if(this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(i,this.id,t),this}},{key:"requestAsyncId",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return setInterval(e.flush.bind(e,this),n)}},{key:"recycleAsyncId",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)}},{key:"execute",value:function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}},{key:"_execute",value:function(e,t){var n,i=!1;try{this.work(e)}catch(r){i=!0,n=!!r&&r||new Error(r)}if(i)return this.unsubscribe(),n}},{key:"_unsubscribe",value:function(){var e=this.id,t=this.scheduler,n=t.actions,i=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&n.splice(i,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}]),n}(function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this)}return b(n,[{key:"schedule",value:function(e){return this}}]),n}(W)),zf=function(){var e=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.now;m(this,e),this.SchedulerAction=t,this.now=n}return b(e,[{key:"schedule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;return new this.SchedulerAction(this,e).schedule(n,t)}}]),e}();return e.now=function(){return Date.now()},e}(),Uf=function(t){a(i,t);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zf.now;return m(this,i),(t=n.call(this,e,function(){return i.delegate&&i.delegate!==c(t)?i.delegate.now():r()})).actions=[],t.active=!1,t.scheduled=void 0,t}return b(i,[{key:"schedule",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return i.delegate&&i.delegate!==this?i.delegate.schedule(t,n,r):e(p(i.prototype),"schedule",this).call(this,t,n,r)}},{key:"flush",value:function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}}}]),i}(zf);new(function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"flush",value:function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,i=-1,r=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++i2&&void 0!==arguments[2]?arguments[2]:0;return null!==r&&r>0?e(p(i.prototype),"requestAsyncId",this).call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame(function(){return t.flush(null)})))}},{key:"recycleAsyncId",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==r&&r>0||null===r&&this.delay>0)return e(p(i.prototype),"recycleAsyncId",this).call(this,t,n,r);0===t.actions.length&&(cancelAnimationFrame(n),t.scheduled=void 0)}}]),i}(Vf));var Hf=1,Gf=Promise.resolve(),Wf={};function qf(e){return e in Wf&&(delete Wf[e],!0)}var Xf=function(e){var t=Hf++;return Wf[t]=!0,Gf.then(function(){return qf(t)&&e()}),t},Yf=function(e){qf(e)};function Kf(e){return!!e&&(e instanceof ee||"function"==typeof e.lift&&"function"==typeof e.subscribe)}function Qf(e,t){return function(n){return n.lift(new $f(e,t))}}new(function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"flush",value:function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,i=-1,r=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++i2&&void 0!==arguments[2]?arguments[2]:0;return null!==r&&r>0?e(p(i.prototype),"requestAsyncId",this).call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=Xf(t.flush.bind(t,null))))}},{key:"recycleAsyncId",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==r&&r>0||null===r&&this.delay>0)return e(p(i.prototype),"recycleAsyncId",this).call(this,t,n,r);0===t.actions.length&&(Yf(n),t.scheduled=void 0)}}]),i}(Vf));var $f=function(){function e(t,n){m(this,e),this.compare=t,this.keySelector=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new Zf(e,this.compare,this.keySelector))}}]),e}(),Zf=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).keySelector=r,o.hasKey=!1,"function"==typeof i&&(o.compare=i),o}return b(n,[{key:"compare",value:function(e,t){return e===t}},{key:"_next",value:function(e){var t;try{var n=this.keySelector;t=n?n(e):e}catch(n){return this.destination.error(n)}var i=!1;if(this.hasKey)try{i=(0,this.compare)(this.key,t)}catch(n){return this.destination.error(n)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}]),n}(Y),Jf=new Uf(Vf),ed=function(){function e(t){m(this,e),this.durationSelector=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new td(e,this.durationSelector))}}]),e}(),td=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).durationSelector=i,r.hasValue=!1,r}return b(n,[{key:"_next",value:function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t;try{var n;t=(0,this.durationSelector)(e)}catch(n){return this.destination.error(n)}var i=_e(t,new ye(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}},{key:"clearThrottle",value:function(){var e=this.value,t=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}},{key:"notifyNext",value:function(){this.clearThrottle()}},{key:"notifyComplete",value:function(){this.clearThrottle()}}]),n}(be);function nd(e){return!z(e)&&e-parseFloat(e)+1>=0}function id(e){var t=e.index,n=e.period,i=e.subscriber;if(i.next(t),!i.closed){if(-1===n)return i.complete();e.index=t+1,this.schedule(e,n)}}function rd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jf;return function(e){return function(t){return t.lift(new ed(e))}}(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=-1;return nd(t)?i=Number(t)<1?1:Number(t):se(t)&&(n=t),se(n)||(n=Jf),new ee(function(t){var r=nd(e)?e:+e-n.now();return n.schedule(id,r,{index:0,period:i,subscriber:t})})}(e,t)})}function od(e,t){return function(n){return n.lift(new ad(e,t))}}var ad=function(){function e(t,n){m(this,e),this.predicate=t,this.thisArg=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new sd(e,this.predicate,this.thisArg))}}]),e}(),sd=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).predicate=i,o.thisArg=r,o.count=0,o}return b(n,[{key:"_next",value:function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}t&&this.destination.next(e)}}]),n}(Y);function ud(e){return function(t){return t.lift(new cd(e))}}var cd=function(){function e(t){m(this,e),this.notifier=t}return b(e,[{key:"call",value:function(e,t){var n=new ld(e),i=_e(this.notifier,new ye(n));return i&&!n.seenValue?(n.add(i),t.subscribe(n)):n}}]),e}(),ld=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,e)).seenValue=!1,i}return b(n,[{key:"notifyNext",value:function(){this.seenValue=!0,this.complete()}},{key:"notifyComplete",value:function(){}}]),n}(be);function hd(){return Se(1)(jf.apply(void 0,arguments))}function fd(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return n>0?e(p(i.prototype),"schedule",this).call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)}},{key:"execute",value:function(t,n){return n>0||this.closed?e(p(i.prototype),"execute",this).call(this,t,n):this._execute(t,n)}},{key:"requestAsyncId",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null!==r&&r>0||null===r&&this.delay>0?e(p(i.prototype),"requestAsyncId",this).call(this,t,n,r):t.flush(this)}}]),i}(Vf)),md=new ee(function(e){return e.complete()});function yd(e){return e?function(e){return new ee(function(t){return e.schedule(function(){return t.complete()})})}(e):md}function bd(e,t){return new ee(t?function(n){return t.schedule(_d,0,{error:e,subscriber:n})}:function(t){return t.error(e)})}function _d(e){var t=e.error;e.subscriber.error(t)}var wd=function(){function e(t,n,i){m(this,e),this.kind=t,this.value=n,this.error=i,this.hasValue="N"===t}return b(e,[{key:"observe",value:function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}},{key:"do",value:function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}}},{key:"accept",value:function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)}},{key:"toObservable",value:function(){switch(this.kind){case"N":return jf(this.value);case"E":return bd(this.error);case"C":return yd()}throw new Error("unexpected notification kind value")}}],[{key:"createNext",value:function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification}},{key:"createError",value:function(t){return new e("E",void 0,t)}},{key:"createComplete",value:function(){return e.completeNotification}}]),e}();wd.completeNotification=new wd("C"),wd.undefinedValueNotification=new wd("N",void 0);var kd,xd=function(e){a(n,e);var t=s(n);function n(e,i){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return m(this,n),(r=t.call(this,e)).scheduler=i,r.delay=o,r}return b(n,[{key:"scheduleMessage",value:function(e){this.destination.add(this.scheduler.schedule(n.dispatch,this.delay,new Sd(e,this.destination)))}},{key:"_next",value:function(e){this.scheduleMessage(wd.createNext(e))}},{key:"_error",value:function(e){this.scheduleMessage(wd.createError(e)),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleMessage(wd.createComplete()),this.unsubscribe()}}],[{key:"dispatch",value:function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()}}]),n}(Y),Sd=function e(t,n){m(this,e),this.notification=t,this.destination=n},Ed=function(t){a(i,t);var n=s(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY,o=arguments.length>2?arguments[2]:void 0;return m(this,i),(e=n.call(this)).scheduler=o,e._events=[],e._infiniteTimeWindow=!1,e._bufferSize=t<1?1:t,e._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(e._infiniteTimeWindow=!0,e.next=e.nextInfiniteTimeWindow):e.next=e.nextTimeWindow,e}return b(i,[{key:"nextInfiniteTimeWindow",value:function(t){if(!this.isStopped){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift()}e(p(i.prototype),"next",this).call(this,t)}},{key:"nextTimeWindow",value:function(t){this.isStopped||(this._events.push(new Cd(this._getNow(),t)),this._trimBufferThenGetEvents()),e(p(i.prototype),"next",this).call(this,t)}},{key:"_subscribe",value:function(e){var t,n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,o=i.length;if(this.closed)throw new ne;if(this.isStopped||this.hasError?t=W.EMPTY:(this.observers.push(e),t=new ie(this,e)),r&&e.add(e=new xd(e,r)),n)for(var a=0;at&&(o=Math.max(o,r-t)),o>0&&i.splice(0,o),i}}]),i}(oe),Cd=function e(t,n){m(this,e),this.time=t,this.value=n};function Od(e,t,n){var i;return i=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n},function(e){return e.lift(function(e){var t,n,i=e.bufferSize,r=void 0===i?Number.POSITIVE_INFINITY:i,o=e.windowTime,a=void 0===o?Number.POSITIVE_INFINITY:o,s=e.refCount,u=e.scheduler,c=0,l=!1,h=!1;return function(e){var i;c++,!t||l?(l=!1,t=new Ed(r,a,u),i=t.subscribe(this),n=e.subscribe({next:function(e){t.next(e)},error:function(e){l=!0,t.error(e)},complete:function(){h=!0,n=void 0,t.complete()}}),h&&(n=void 0)):i=t.subscribe(this),this.add(function(){c--,i.unsubscribe(),i=void 0,n&&!h&&s&&0===c&&(n.unsubscribe(),n=void 0,t=void 0)})}}(i))}}try{kd="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(H){kd=!1}var Td,Ad,Pd,Md,Id=function(){var e=function e(t){m(this,e),this._platformId=t,this.isBrowser=this._platformId?$h(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!kd)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT};return e.\u0275fac=function(t){return new(t||e)(Qi(Sl))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Sl))},token:e,providedIn:"root"}),e}(),Rd=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),Dd=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function Nd(){if(Td)return Td;if("object"!=typeof document||!document)return Td=new Set(Dd);var e=document.createElement("input");return Td=new Set(Dd.filter(function(t){return e.setAttribute("type",t),e.type===t}))}function Ld(e){return function(){if(null==Ad&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Ad=!0}}))}finally{Ad=Ad||!1}return Ad}()?e:!!e.capture}function jd(e){if(function(){if(null==Md){var e="undefined"!=typeof document?document.head:null;Md=!(!e||!e.createShadowRoot&&!e.attachShadow)}return Md}()){var t=e.getRootNode?e.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&t instanceof ShadowRoot)return t}return null}function Fd(){for(var e="undefined"!=typeof document&&document?document.activeElement:null;e&&e.shadowRoot;){var t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}function Bd(e){return e.composedPath?e.composedPath()[0]:e.target}var Vd=new Mi("cdk-dir-doc",{providedIn:"root",factory:function(){return $i(fh)}}),zd=function(){var e=function(){function e(t){if(m(this,e),this.value="ltr",this.change=new Zc,t){var n=t.documentElement?t.documentElement.dir:null,i=(t.body?t.body.dir:null)||n;this.value="ltr"===i||"rtl"===i?i:"ltr"}}return b(e,[{key:"ngOnDestroy",value:function(){this.change.complete()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vd,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Vd,8))},token:e,providedIn:"root"}),e}(),Ud=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),Hd=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];m(this,e),this._multiple=n,this._emitChanges=r,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new oe,i&&i.length&&(n?i.forEach(function(e){return t._markSelected(e)}):this._markSelected(i[0]),this._selectedToEmit.length=0)}return b(e,[{key:"selected",get:function(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}},{key:"select",value:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i0&&void 0!==arguments[0]?arguments[0]:20;return this._platform.isBrowser?new ee(function(n){e._globalSubscription||e._addGlobalListener();var i=t>0?e._scrolled.pipe(rd(t)).subscribe(n):e._scrolled.subscribe(n);return e._scrolledCount++,function(){i.unsubscribe(),e._scrolledCount--,e._scrolledCount||e._removeGlobalListener()}}):jf()}},{key:"ngOnDestroy",value:function(){var e=this;this._removeGlobalListener(),this.scrollContainers.forEach(function(t,n){return e.deregister(n)}),this._scrolled.complete()}},{key:"ancestorScrolled",value:function(e,t){var n=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(od(function(e){return!e||n.indexOf(e)>-1}))}},{key:"getAncestorScrollContainers",value:function(e){var t=this,n=[];return this.scrollContainers.forEach(function(i,r){t._scrollableContainsElement(r,e)&&n.push(r)}),n}},{key:"_getWindow",value:function(){return this._document.defaultView||window}},{key:"_scrollableContainsElement",value:function(e,t){var n=Lf(t),i=e.getElementRef().nativeElement;do{if(n==i)return!0}while(n=n.parentElement);return!1}},{key:"_addGlobalListener",value:function(){var e=this;this._globalSubscription=this._ngZone.runOutsideAngular(function(){return Ff(e._getWindow().document,"scroll").subscribe(function(){return e._scrolled.next()})})}},{key:"_removeGlobalListener",value:function(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl),Qi(Id),Qi(fh,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Vl),Qi(Id),Qi(fh,8))},token:e,providedIn:"root"}),e}(),qd=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this._platform=t,this._change=new oe,this._changeListener=function(e){r._change.next(e)},this._document=i,n.runOutsideAngular(function(){if(t.isBrowser){var e=r._getWindow();e.addEventListener("resize",r._changeListener),e.addEventListener("orientationchange",r._changeListener)}r.change().subscribe(function(){return r._viewportSize=null})})}return b(e,[{key:"ngOnDestroy",value:function(){if(this._platform.isBrowser){var e=this._getWindow();e.removeEventListener("resize",this._changeListener),e.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}},{key:"getViewportSize",value:function(){this._viewportSize||this._updateViewportSize();var e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}},{key:"getViewportRect",value:function(){var e=this.getViewportScrollPosition(),t=this.getViewportSize(),n=t.width,i=t.height;return{top:e.top,left:e.left,bottom:e.top+i,right:e.left+n,height:i,width:n}}},{key:"getViewportScrollPosition",value:function(){if(!this._platform.isBrowser)return{top:0,left:0};var e=this._document,t=this._getWindow(),n=e.documentElement,i=n.getBoundingClientRect();return{top:-i.top||e.body.scrollTop||t.scrollY||n.scrollTop||0,left:-i.left||e.body.scrollLeft||t.scrollX||n.scrollLeft||0}}},{key:"change",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return e>0?this._change.pipe(rd(e)):this._change}},{key:"_getWindow",value:function(){return this._document.defaultView||window}},{key:"_updateViewportSize",value:function(){var e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id),Qi(Vl),Qi(fh,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id),Qi(Vl),Qi(fh,8))},token:e,providedIn:"root"}),e}(),Xd=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),Yd=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Ud,Rd,Xd],Ud,Xd]}),e}(),Kd=function(){function e(){m(this,e)}return b(e,[{key:"attach",value:function(e){return this._attachedHost=e,e.attach(this)}},{key:"detach",value:function(){var e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}},{key:"isAttached",get:function(){return null!=this._attachedHost}},{key:"setAttachedHost",value:function(e){this._attachedHost=e}}]),e}(),Qd=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;return m(this,n),(a=t.call(this)).component=e,a.viewContainerRef=i,a.injector=r,a.componentFactoryResolver=o,a}return n}(Kd),$d=function(t){a(i,t);var n=s(i);function i(e,t,r){var o;return m(this,i),(o=n.call(this)).templateRef=e,o.viewContainerRef=t,o.context=r,o}return b(i,[{key:"origin",get:function(){return this.templateRef.elementRef}},{key:"attach",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.context;return this.context=n,e(p(i.prototype),"attach",this).call(this,t)}},{key:"detach",value:function(){return this.context=void 0,e(p(i.prototype),"detach",this).call(this)}}]),i}(Kd),Zd=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).element=e instanceof Ku?e.nativeElement:e,i}return n}(Kd),Jd=function(){function e(){m(this,e),this._isDisposed=!1,this.attachDomPortal=null}return b(e,[{key:"hasAttached",value:function(){return!!this._attachedPortal}},{key:"attach",value:function(e){return e instanceof Qd?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof $d?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof Zd?(this._attachedPortal=e,this.attachDomPortal(e)):void 0}},{key:"detach",value:function(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}},{key:"dispose",value:function(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}},{key:"setDisposeFn",value:function(e){this._disposeFn=e}},{key:"_invokeDisposeFn",value:function(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}]),e}(),ep=function(t){a(i,t);var n=s(i);function i(t,r,o,a,s){var u,l;return m(this,i),(l=n.call(this)).outletElement=t,l._componentFactoryResolver=r,l._appRef=o,l._defaultInjector=a,l.attachDomPortal=function(t){var n=t.element,r=l._document.createComment("dom-portal");n.parentNode.insertBefore(r,n),l.outletElement.appendChild(n),l._attachedPortal=t,e((u=c(l),p(i.prototype)),"setDisposeFn",u).call(u,function(){r.parentNode&&r.parentNode.replaceChild(n,r)})},l._document=s,l}return b(i,[{key:"attachComponentPortal",value:function(e){var t,n=this,i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);return e.viewContainerRef?(t=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(function(){return t.destroy()})):(t=i.create(e.injector||this._defaultInjector),this._appRef.attachView(t.hostView),this.setDisposeFn(function(){n._appRef.detachView(t.hostView),t.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(t)),this._attachedPortal=e,t}},{key:"attachTemplatePortal",value:function(e){var t=this,n=e.viewContainerRef,i=n.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(function(e){return t.outletElement.appendChild(e)}),i.detectChanges(),this.setDisposeFn(function(){var e=n.indexOf(i);-1!==e&&n.remove(e)}),this._attachedPortal=e,i}},{key:"dispose",value:function(){e(p(i.prototype),"dispose",this).call(this),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}},{key:"_getComponentRootNode",value:function(e){return e.hostView.rootNodes[0]}}]),i}(Jd),tp=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this,e,i)}return n}($d);return e.\u0275fac=function(t){return new(t||e)(Es(Cc),Es(Mc))},e.\u0275dir=It({type:e,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[ss]}),e}(),np=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(tp);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["","cdk-portal",""],["","portal",""]],exportAs:["cdkPortal"],features:[Hu([{provide:tp,useExisting:t}]),ss]}),t}(),ip=function(){var t=function(t){a(i,t);var n=s(i);function i(t,r,o){var a,s;return m(this,i),(s=n.call(this))._componentFactoryResolver=t,s._viewContainerRef=r,s._isInitialized=!1,s.attached=new Zc,s.attachDomPortal=function(t){var n=t.element,r=s._document.createComment("dom-portal");t.setAttachedHost(c(s)),n.parentNode.insertBefore(r,n),s._getRootNode().appendChild(n),s._attachedPortal=t,e((a=c(s),p(i.prototype)),"setDisposeFn",a).call(a,function(){r.parentNode&&r.parentNode.replaceChild(n,r)})},s._document=o,s}return b(i,[{key:"portal",get:function(){return this._attachedPortal},set:function(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&e(p(i.prototype),"detach",this).call(this),t&&e(p(i.prototype),"attach",this).call(this,t),this._attachedPortal=t)}},{key:"attachedRef",get:function(){return this._attachedRef}},{key:"ngOnInit",value:function(){this._isInitialized=!0}},{key:"ngOnDestroy",value:function(){e(p(i.prototype),"dispose",this).call(this),this._attachedPortal=null,this._attachedRef=null}},{key:"attachComponentPortal",value:function(t){t.setAttachedHost(this);var n=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,r=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=n.createComponent(r,n.length,t.injector||n.injector);return n!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),e(p(i.prototype),"setDisposeFn",this).call(this,function(){return o.destroy()}),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}},{key:"attachTemplatePortal",value:function(t){var n=this;t.setAttachedHost(this);var r=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return e(p(i.prototype),"setDisposeFn",this).call(this,function(){return n._viewContainerRef.clear()}),this._attachedPortal=t,this._attachedRef=r,this.attached.emit(r),r}},{key:"_getRootNode",value:function(){var e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}}]),i}(Jd);return t.\u0275fac=function(e){return new(e||t)(Es(Wu),Es(Mc),Es(fh))},t.\u0275dir=It({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ss]}),t}(),rp=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),op=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}();function ap(e){return function(t){return 0===e?yd():t.lift(new sp(e))}}var sp=function(){function e(t){if(m(this,e),this.total=t,this.total<0)throw new op}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new up(e,this.total))}}]),e}(),up=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).total=i,r.count=0,r}return b(n,[{key:"_next",value:function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))}}]),n}(Y);function cp(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){return n.lift(new lp(e,t))}}var lp=function(){function e(t,n){m(this,e),this.predicate=t,this.inclusive=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new hp(e,this.predicate,this.inclusive))}}]),e}(),hp=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).predicate=i,o.inclusive=r,o.index=0,o}return b(n,[{key:"_next",value:function(e){var t,n=this.destination;try{t=this.predicate(e,this.index++)}catch(i){return void n.error(i)}this.nextOrComplete(e,t)}},{key:"nextOrComplete",value:function(e,t){var n=this.destination;Boolean(t)?n.next(e):(this.inclusive&&n.next(e),n.complete())}}]),n}(Y);function fp(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;it.height||e.scrollWidth>t.width}}]),e}(),vp=function(){function e(t,n,i,r){var o=this;m(this,e),this._scrollDispatcher=t,this._ngZone=n,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=function(){o.disable(),o._overlayRef.hasAttached()&&o._ngZone.run(function(){return o._overlayRef.detach()})}}return b(e,[{key:"attach",value:function(e){this._overlayRef=e}},{key:"enable",value:function(){var e=this;if(!this._scrollSubscription){var t=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(function(){var t=e._viewportRuler.getViewportScrollPosition().top;Math.abs(t-e._initialScrollPosition)>e._config.threshold?e._detach():e._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}}},{key:"disable",value:function(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}},{key:"detach",value:function(){this.disable(),this._overlayRef=null}}]),e}(),gp=function(){function e(){m(this,e)}return b(e,[{key:"enable",value:function(){}},{key:"disable",value:function(){}},{key:"attach",value:function(){}}]),e}();function mp(e,t){return t.some(function(t){return e.bottomt.bottom||e.rightt.right})}function yp(e,t){return t.some(function(t){return e.topt.bottom||e.leftt.right})}var bp=function(){function e(t,n,i,r){m(this,e),this._scrollDispatcher=t,this._viewportRuler=n,this._ngZone=i,this._config=r,this._scrollSubscription=null}return b(e,[{key:"attach",value:function(e){this._overlayRef=e}},{key:"enable",value:function(){var e=this;this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(function(){if(e._overlayRef.updatePosition(),e._config&&e._config.autoClose){var t=e._overlayRef.overlayElement.getBoundingClientRect(),n=e._viewportRuler.getViewportSize(),i=n.width,r=n.height;mp(t,[{width:i,height:r,bottom:r,right:i,top:0,left:0}])&&(e.disable(),e._ngZone.run(function(){return e._overlayRef.detach()}))}}))}},{key:"disable",value:function(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}},{key:"detach",value:function(){this.disable(),this._overlayRef=null}}]),e}(),_p=function(){var e=function e(t,n,i,r){var o=this;m(this,e),this._scrollDispatcher=t,this._viewportRuler=n,this._ngZone=i,this.noop=function(){return new gp},this.close=function(e){return new vp(o._scrollDispatcher,o._ngZone,o._viewportRuler,e)},this.block=function(){return new pp(o._viewportRuler,o._document)},this.reposition=function(e){return new bp(o._scrollDispatcher,o._viewportRuler,o._ngZone,e)},this._document=r};return e.\u0275fac=function(t){return new(t||e)(Qi(Wd),Qi(qd),Qi(Vl),Qi(fh))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Wd),Qi(qd),Qi(Vl),Qi(fh))},token:e,providedIn:"root"}),e}(),wp=function e(t){if(m(this,e),this.scrollStrategy=new gp,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t)for(var n=0,i=Object.keys(t);n-1&&this._attachedOverlays.splice(t,1),0===this._attachedOverlays.length&&this.detach()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(fh))},e.\u0275prov=Ke({factory:function(){return new e(Qi(fh))},token:e,providedIn:"root"}),e}(),Ep=function(){var t=function(t){a(i,t);var n=s(i);function i(e){var t;return m(this,i),(t=n.call(this,e))._keydownListener=function(e){for(var n=t._attachedOverlays,i=n.length-1;i>-1;i--)if(n[i]._keydownEvents.observers.length>0){n[i]._keydownEvents.next(e);break}},t}return b(i,[{key:"add",value:function(t){e(p(i.prototype),"add",this).call(this,t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}},{key:"detach",value:function(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}]),i}(Sp);return t.\u0275fac=function(e){return new(e||t)(Qi(fh))},t.\u0275prov=Ke({factory:function(){return new t(Qi(fh))},token:t,providedIn:"root"}),t}(),Cp=function(){var t=function(t){a(i,t);var n=s(i);function i(e,t){var r;return m(this,i),(r=n.call(this,e))._platform=t,r._cursorStyleIsSet=!1,r._clickListener=function(e){for(var t=Bd(e),n=r._attachedOverlays.slice(),i=n.length-1;i>-1;i--){var o=n[i];if(!(o._outsidePointerEvents.observers.length<1)&&o.hasAttached()){if(o.overlayElement.contains(t))break;o._outsidePointerEvents.next(e)}}},r}return b(i,[{key:"add",value:function(t){if(e(p(i.prototype),"add",this).call(this,t),!this._isAttached){var n=this._document.body;n.addEventListener("click",this._clickListener,!0),n.addEventListener("auxclick",this._clickListener,!0),n.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}},{key:"detach",value:function(){if(this._isAttached){var e=this._document.body;e.removeEventListener("click",this._clickListener,!0),e.removeEventListener("auxclick",this._clickListener,!0),e.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(e.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}]),i}(Sp);return t.\u0275fac=function(e){return new(e||t)(Qi(fh),Qi(Id))},t.\u0275prov=Ke({factory:function(){return new t(Qi(fh),Qi(Id))},token:t,providedIn:"root"}),t}(),Op="undefined"!=typeof window?window:{},Tp=void 0!==Op.__karma__&&!!Op.__karma__||void 0!==Op.jasmine&&!!Op.jasmine||void 0!==Op.jest&&!!Op.jest||void 0!==Op.Mocha&&!!Op.Mocha,Ap=function(){var e=function(){function e(t,n){m(this,e),this._platform=n,this._document=t}return b(e,[{key:"ngOnDestroy",value:function(){var e=this._containerElement;e&&e.parentNode&&e.parentNode.removeChild(e)}},{key:"getContainerElement",value:function(){return this._containerElement||this._createContainer(),this._containerElement}},{key:"_createContainer",value:function(){var e="cdk-overlay-container";if(this._platform.isBrowser||Tp)for(var t=this._document.querySelectorAll(".".concat(e,'[platform="server"], .').concat(e,'[platform="test"]')),n=0;nd&&(d=g,f=v)}}catch(m){p.e(m)}finally{p.f()}return this._isPushed=!1,void this._applyPosition(f.position,f.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(e.position,e.originPoint);this._applyPosition(e.position,e.originPoint)}}},{key:"detach",value:function(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}},{key:"dispose",value:function(){this._isDisposed||(this._boundingBox&&Dp(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Mp),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}},{key:"reapplyLastPosition",value:function(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();var e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}},{key:"withScrollableContainers",value:function(e){return this._scrollables=e,this}},{key:"withPositions",value:function(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}},{key:"withViewportMargin",value:function(e){return this._viewportMargin=e,this}},{key:"withFlexibleDimensions",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._hasFlexibleDimensions=e,this}},{key:"withGrowAfterOpen",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._growAfterOpen=e,this}},{key:"withPush",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._canPush=e,this}},{key:"withLockedPosition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._positionLocked=e,this}},{key:"setOrigin",value:function(e){return this._origin=e,this}},{key:"withDefaultOffsetX",value:function(e){return this._offsetX=e,this}},{key:"withDefaultOffsetY",value:function(e){return this._offsetY=e,this}},{key:"withTransformOriginOn",value:function(e){return this._transformOriginSelector=e,this}},{key:"_getOriginPoint",value:function(e,t){var n;if("center"==t.originX)n=e.left+e.width/2;else{var i=this._isRtl()?e.right:e.left,r=this._isRtl()?e.left:e.right;n="start"==t.originX?i:r}return{x:n,y:"center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom}}},{key:"_getOverlayPoint",value:function(e,t,n){var i,r;return i="center"==n.overlayX?-t.width/2:"start"===n.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,r="center"==n.overlayY?-t.height/2:"top"==n.overlayY?0:-t.height,{x:e.x+i,y:e.y+r}}},{key:"_getOverlayFit",value:function(e,t,n,i){var r=Lp(t),o=e.x,a=e.y,s=this._getOffset(i,"x"),u=this._getOffset(i,"y");s&&(o+=s),u&&(a+=u);var c=0-a,l=a+r.height-n.height,h=this._subtractOverflows(r.width,0-o,o+r.width-n.width),f=this._subtractOverflows(r.height,c,l),d=h*f;return{visibleArea:d,isCompletelyWithinViewport:r.width*r.height===d,fitsInViewportVertically:f===r.height,fitsInViewportHorizontally:h==r.width}}},{key:"_canFitWithFlexibleDimensions",value:function(e,t,n){if(this._hasFlexibleDimensions){var i=n.bottom-t.y,r=n.right-t.x,o=Np(this._overlayRef.getConfig().minHeight),a=Np(this._overlayRef.getConfig().minWidth),s=e.fitsInViewportHorizontally||null!=a&&a<=r;return(e.fitsInViewportVertically||null!=o&&o<=i)&&s}return!1}},{key:"_pushOverlayOnScreen",value:function(e,t,n){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};var i,r,o=Lp(t),a=this._viewportRect,s=Math.max(e.x+o.width-a.width,0),u=Math.max(e.y+o.height-a.height,0),c=Math.max(a.top-n.top-e.y,0),l=Math.max(a.left-n.left-e.x,0);return i=o.width<=a.width?l||-s:e.xh&&!this._isInitialRender&&!this._growAfterOpen&&(i=e.y-h/2)}if("end"===t.overlayX&&!c||"start"===t.overlayX&&c)s=u.width-e.x+this._viewportMargin,o=e.x-this._viewportMargin;else if("start"===t.overlayX&&!c||"end"===t.overlayX&&c)a=e.x,o=u.right-e.x;else{var f=Math.min(u.right-e.x+u.left,e.x),d=this._lastBoundingBoxSize.width;o=2*f,a=e.x-f,o>d&&!this._isInitialRender&&!this._growAfterOpen&&(a=e.x-d/2)}return{top:i,left:a,bottom:r,right:s,width:o,height:n}}},{key:"_setBoundingBoxStyles",value:function(e,t){var n=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));var i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{var r=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;i.height=Nf(n.height),i.top=Nf(n.top),i.bottom=Nf(n.bottom),i.width=Nf(n.width),i.left=Nf(n.left),i.right=Nf(n.right),i.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",i.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",r&&(i.maxHeight=Nf(r)),o&&(i.maxWidth=Nf(o))}this._lastBoundingBoxSize=n,Dp(this._boundingBox.style,i)}},{key:"_resetBoundingBoxStyles",value:function(){Dp(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}},{key:"_resetOverlayElementStyles",value:function(){Dp(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}},{key:"_setOverlayElementStyles",value:function(e,t){var n={},i=this._hasExactPosition(),r=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(i){var a=this._viewportRuler.getViewportScrollPosition();Dp(n,this._getExactOverlayY(t,e,a)),Dp(n,this._getExactOverlayX(t,e,a))}else n.position="static";var s="",u=this._getOffset(t,"x"),c=this._getOffset(t,"y");u&&(s+="translateX(".concat(u,"px) ")),c&&(s+="translateY(".concat(c,"px)")),n.transform=s.trim(),o.maxHeight&&(i?n.maxHeight=Nf(o.maxHeight):r&&(n.maxHeight="")),o.maxWidth&&(i?n.maxWidth=Nf(o.maxWidth):r&&(n.maxWidth="")),Dp(this._pane.style,n)}},{key:"_getExactOverlayY",value:function(e,t,n){var i={top:"",bottom:""},r=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n));var o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return r.y-=o,"bottom"===e.overlayY?i.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":i.top=Nf(r.y),i}},{key:"_getExactOverlayX",value:function(e,t,n){var i={left:"",right:""},r=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n)),"right"===(this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left")?i.right=this._document.documentElement.clientWidth-(r.x+this._overlayRect.width)+"px":i.left=Nf(r.x),i}},{key:"_getScrollVisibility",value:function(){var e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),n=this._scrollables.map(function(e){return e.getElementRef().nativeElement.getBoundingClientRect()});return{isOriginClipped:yp(e,n),isOriginOutsideView:mp(e,n),isOverlayClipped:yp(t,n),isOverlayOutsideView:mp(t,n)}}},{key:"_subtractOverflows",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"";return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}},{key:"left",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}},{key:"bottom",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}},{key:"right",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}},{key:"width",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}},{key:"height",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}},{key:"centerHorizontally",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.left(e),this._justifyContent="center",this}},{key:"centerVertically",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.top(e),this._alignItems="center",this}},{key:"apply",value:function(){if(this._overlayRef&&this._overlayRef.hasAttached()){var e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),i=n.width,r=n.height,o=n.maxWidth,a=n.maxHeight,s=!("100%"!==i&&"100vw"!==i||o&&"100%"!==o&&"100vw"!==o),u=!("100%"!==r&&"100vh"!==r||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=s?"0":this._leftOffset,e.marginTop=u?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,s?t.justifyContent="flex-start":"center"===this._justifyContent?t.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?t.justifyContent="flex-end":"flex-end"===this._justifyContent&&(t.justifyContent="flex-start"):t.justifyContent=this._justifyContent,t.alignItems=u?"flex-start":this._alignItems}}},{key:"dispose",value:function(){if(!this._isDisposed&&this._overlayRef){var e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,n=t.style;t.classList.remove(Bp),n.justifyContent=n.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}}]),e}(),zp=function(){var e=function(){function e(t,n,i,r){m(this,e),this._viewportRuler=t,this._document=n,this._platform=i,this._overlayContainer=r}return b(e,[{key:"global",value:function(){return new Vp}},{key:"connectedTo",value:function(e,t,n){return new Fp(t,n,e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}},{key:"flexibleConnectedTo",value:function(e){return new Rp(e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(qd),Qi(fh),Qi(Id),Qi(Ap))},e.\u0275prov=Ke({factory:function(){return new e(Qi(qd),Qi(fh),Qi(Id),Qi(Ap))},token:e,providedIn:"root"}),e}(),Up=0,Hp=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h){m(this,e),this.scrollStrategies=t,this._overlayContainer=n,this._componentFactoryResolver=i,this._positionBuilder=r,this._keyboardDispatcher=o,this._injector=a,this._ngZone=s,this._document=u,this._directionality=c,this._location=l,this._outsideClickDispatcher=h}return b(e,[{key:"create",value:function(e){var t=this._createHostElement(),n=this._createPaneElement(t),i=this._createPortalOutlet(n),r=new wp(e);return r.direction=r.direction||this._directionality.value,new Pp(i,t,n,r,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}},{key:"position",value:function(){return this._positionBuilder}},{key:"_createPaneElement",value:function(e){var t=this._document.createElement("div");return t.id="cdk-overlay-"+Up++,t.classList.add("cdk-overlay-pane"),e.appendChild(t),t}},{key:"_createHostElement",value:function(){var e=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(e),e}},{key:"_createPortalOutlet",value:function(e){return this._appRef||(this._appRef=this._injector.get(oh)),new ep(e,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(_p),Qi(Ap),Qi(Wu),Qi(zp),Qi(Ep),Qi(os),Qi(Vl),Qi(fh),Qi(zd),Qi(Eh),Qi(Cp))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Gp=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],Wp=new Mi("cdk-connected-overlay-scroll-strategy"),qp=function(){var e=function e(t){m(this,e),this.elementRef=t};return e.\u0275fac=function(t){return new(t||e)(Es(Ku))},e.\u0275dir=It({type:e,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),e}(),Xp=function(){var e=function(){function e(t,n,i,r,o){m(this,e),this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=W.EMPTY,this._attachSubscription=W.EMPTY,this._detachSubscription=W.EMPTY,this._positionSubscription=W.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Zc,this.positionChange=new Zc,this.attach=new Zc,this.detach=new Zc,this.overlayKeydown=new Zc,this.overlayOutsideClick=new Zc,this._templatePortal=new $d(n,i),this._scrollStrategyFactory=r,this.scrollStrategy=this._scrollStrategyFactory()}return b(e,[{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}},{key:"hasBackdrop",get:function(){return this._hasBackdrop},set:function(e){this._hasBackdrop=If(e)}},{key:"lockPosition",get:function(){return this._lockPosition},set:function(e){this._lockPosition=If(e)}},{key:"flexibleDimensions",get:function(){return this._flexibleDimensions},set:function(e){this._flexibleDimensions=If(e)}},{key:"growAfterOpen",get:function(){return this._growAfterOpen},set:function(e){this._growAfterOpen=If(e)}},{key:"push",get:function(){return this._push},set:function(e){this._push=If(e)}},{key:"overlayRef",get:function(){return this._overlayRef}},{key:"dir",get:function(){return this._dir?this._dir.value:"ltr"}},{key:"ngOnDestroy",value:function(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}},{key:"ngOnChanges",value:function(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this._attachOverlay():this._detachOverlay())}},{key:"_createOverlay",value:function(){var e=this;(!this.positions||!this.positions.length)&&(this.positions=Gp);var t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(function(){return e.attach.emit()}),this._detachSubscription=t.detachments().subscribe(function(){return e.detach.emit()}),t.keydownEvents().subscribe(function(t){e.overlayKeydown.next(t),27===t.keyCode&&!e.disableClose&&!fp(t)&&(t.preventDefault(),e._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(function(t){e.overlayOutsideClick.next(t)})}},{key:"_buildConfig",value:function(){var e=this._position=this.positionStrategy||this._createPositionStrategy(),t=new wp({direction:this._dir,positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(t.width=this.width),(this.height||0===this.height)&&(t.height=this.height),(this.minWidth||0===this.minWidth)&&(t.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(t.minHeight=this.minHeight),this.backdropClass&&(t.backdropClass=this.backdropClass),this.panelClass&&(t.panelClass=this.panelClass),t}},{key:"_updatePositionStrategy",value:function(e){var t=this,n=this.positions.map(function(e){return{originX:e.originX,originY:e.originY,overlayX:e.overlayX,overlayY:e.overlayY,offsetX:e.offsetX||t.offsetX,offsetY:e.offsetY||t.offsetY,panelClass:e.panelClass||void 0}});return e.setOrigin(this.origin.elementRef).withPositions(n).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}},{key:"_createPositionStrategy",value:function(){var e=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(e),e}},{key:"_attachOverlay",value:function(){var e=this;this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(function(t){e.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(cp(function(){return e.positionChange.observers.length>0})).subscribe(function(t){e.positionChange.emit(t),0===e.positionChange.observers.length&&e._positionSubscription.unsubscribe()}))}},{key:"_detachOverlay",value:function(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(Cc),Es(Mc),Es(Wp),Es(zd,8))},e.\u0275dir=It({type:e,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[Gt]}),e}(),Yp={provide:Wp,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},Kp=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[Hp,Yp],imports:[[Ud,rp,Yd],Yd]}),e}(),Qp=function(){var t,n=function(t){a(i,t);var n=s(i);function i(){var e;return m(this,i),(e=n.apply(this,arguments)).attached=!1,e}return b(i,[{key:"setRootElement",value:function(e){this.attached&&(this.rootElement.nativeElement.removeChild(this._containerElement),this.attached=!1),this.rootElement=e,this.rootElement.nativeElement.style.display="block",this.rootElement.nativeElement.style.position="contents",this.rootElement.nativeElement.style.height="100%",this.appendToRoot()}},{key:"_createContainer",value:function(){e(p(i.prototype),"_createContainer",this).call(this),this.appendToRoot()}},{key:"appendToRoot",value:function(){!this._containerElement||!this.rootElement||(this.rootElement.nativeElement.appendChild(this._containerElement),this.attached=!0)}}]),i}(Ap);return n.\u0275fac=function(e){return(t||(t=Ci(n)))(e||n)},n.\u0275prov=Ke({token:n,factory:n.\u0275fac,providedIn:"root"}),n}(),$p={schedule:function(e,t){var n=setTimeout(e,t);return function(){return clearTimeout(n)}},scheduleBeforeRender:function(e){if("undefined"==typeof window)return $p.schedule(e,0);if(void 0===window.requestAnimationFrame)return $p.schedule(e,16);var t=window.requestAnimationFrame(e);return function(){return window.cancelAnimationFrame(t)}}};function Zp(e,t,n){var i=n;return function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE}(e)&&t.some(function(t,n){return!("*"===t||!function(e,t){if(!jp){var n=Element.prototype;jp=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}return e.nodeType===Node.ELEMENT_NODE&&jp.call(e,t)}(e,t)||(i=n,0))}),i}var Jp=function(){function e(t,n){m(this,e),this.componentFactory=n.get(Wu).resolveComponentFactory(t)}return b(e,[{key:"create",value:function(e){return new ev(this.componentFactory,e)}}]),e}(),ev=function(){function e(t,n){m(this,e),this.componentFactory=t,this.injector=n,this.eventEmitters=new Ed(1),this.events=this.eventEmitters.pipe(dd(function(e){return Ce.apply(void 0,v(e))})),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(function(e){return e.propName})),this.ngZone=this.injector.get(Vl),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(function(){return Zone.current})}return b(e,[{key:"connect",value:function(e){var t=this;this.runInZone(function(){if(null!==t.scheduledDestroyFn)return t.scheduledDestroyFn(),void(t.scheduledDestroyFn=null);null===t.componentRef&&t.initializeComponent(e)})}},{key:"disconnect",value:function(){var e=this;this.runInZone(function(){null===e.componentRef||null!==e.scheduledDestroyFn||(e.scheduledDestroyFn=$p.schedule(function(){null!==e.componentRef&&(e.componentRef.destroy(),e.componentRef=null,e.viewChangeDetectorRef=null)},10))})}},{key:"getInputValue",value:function(e){var t=this;return this.runInZone(function(){return null===t.componentRef?t.initialInputValues.get(e):t.componentRef.instance[e]})}},{key:"setInputValue",value:function(e,t){var n=this;this.runInZone(function(){null!==n.componentRef?function(e,t){return e===t||e!=e&&t!=t}(t,n.getInputValue(e))&&(void 0!==t||!n.unchangedInputs.has(e))||(n.recordInputChange(e,t),n.unchangedInputs.delete(e),n.hasInputChanges=!0,n.componentRef.instance[e]=t,n.scheduleDetectChanges()):n.initialInputValues.set(e,t)})}},{key:"initializeComponent",value:function(e){var t=os.create({providers:[],parent:this.injector}),n=function(e,t){var n=e.childNodes,i=t.map(function(){return[]}),r=-1;t.some(function(e,t){return"*"===e&&(r=t,!0)});for(var o=0,a=n.length;o1&&void 0!==arguments[1]?arguments[1]:Jf;return function(n){return n.lift(new uv(e,t))}}var uv=function(){function e(t,n){m(this,e),this.dueTime=t,this.scheduler=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new cv(e,this.dueTime,this.scheduler))}}]),e}(),cv=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).dueTime=i,o.scheduler=r,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return b(n,[{key:"_next",value:function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(lv,this.dueTime,this))}},{key:"_complete",value:function(){this.debouncedNext(),this.destination.complete()}},{key:"debouncedNext",value:function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}},{key:"clearDebounce",value:function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}]),n}(Y);function lv(e){e.debouncedNext()}function hv(e){return function(t){return t.lift(new fv(e))}}var fv=function(){function e(t){m(this,e),this.total=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new dv(e,this.total))}}]),e}(),dv=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).total=i,r.count=0,r}return b(n,[{key:"_next",value:function(e){++this.count>this.total&&this.destination.next(e)}}]),n}(Y),pv=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"create",value:function(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({factory:function(){return new e},token:e,providedIn:"root"}),e}(),vv=function(){var e=function(){function e(t){m(this,e),this._mutationObserverFactory=t,this._observedElements=new Map}return b(e,[{key:"ngOnDestroy",value:function(){var e=this;this._observedElements.forEach(function(t,n){return e._cleanupObserver(n)})}},{key:"observe",value:function(e){var t=this,n=Lf(e);return new ee(function(e){var i=t._observeElement(n).subscribe(e);return function(){i.unsubscribe(),t._unobserveElement(n)}})}},{key:"_observeElement",value:function(e){if(this._observedElements.has(e))this._observedElements.get(e).count++;else{var t=new oe,n=this._mutationObserverFactory.create(function(e){return t.next(e)});n&&n.observe(e,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(e,{observer:n,stream:t,count:1})}return this._observedElements.get(e).stream}},{key:"_unobserveElement",value:function(e){this._observedElements.has(e)&&(this._observedElements.get(e).count--,this._observedElements.get(e).count||this._cleanupObserver(e))}},{key:"_cleanupObserver",value:function(e){if(this._observedElements.has(e)){var t=this._observedElements.get(e),n=t.observer,i=t.stream;n&&n.disconnect(),i.complete(),this._observedElements.delete(e)}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(pv))},e.\u0275prov=Ke({factory:function(){return new e(Qi(pv))},token:e,providedIn:"root"}),e}(),gv=function(){var e=function(){function e(t,n,i){m(this,e),this._contentObserver=t,this._elementRef=n,this._ngZone=i,this.event=new Zc,this._disabled=!1,this._currentSubscription=null}return b(e,[{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=If(e),this._disabled?this._unsubscribe():this._subscribe()}},{key:"debounce",get:function(){return this._debounce},set:function(e){this._debounce=Rf(e),this._subscribe()}},{key:"ngAfterContentInit",value:function(){!this._currentSubscription&&!this.disabled&&this._subscribe()}},{key:"ngOnDestroy",value:function(){this._unsubscribe()}},{key:"_subscribe",value:function(){var e=this;this._unsubscribe();var t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(function(){e._currentSubscription=(e.debounce?t.pipe(sv(e.debounce)):t).subscribe(e.event)})}},{key:"_unsubscribe",value:function(){var e;null===(e=this._currentSubscription)||void 0===e||e.unsubscribe()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(vv),Es(Ku),Es(Vl))},e.\u0275dir=It({type:e,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),e}(),mv=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[pv]}),e}();function yv(e,t){return(e.getAttribute(t)||"").match(/\S+/g)||[]}var bv="cdk-describedby-message-container",_v="cdk-describedby-message",wv="cdk-describedby-host",kv=0,xv=new Map,Sv=null,Ev=function(){var e=function(){function e(t){m(this,e),this._document=t}return b(e,[{key:"describe",value:function(e,t,n){if(this._canBeDescribed(e,t)){var i=Cv(t,n);"string"!=typeof t?(Ov(t),xv.set(i,{messageElement:t,referenceCount:0})):xv.has(i)||this._createMessageElement(t,n),this._isElementDescribedByMessage(e,i)||this._addMessageReference(e,i)}}},{key:"removeDescription",value:function(e,t,n){if(t&&this._isElementNode(e)){var i=Cv(t,n);if(this._isElementDescribedByMessage(e,i)&&this._removeMessageReference(e,i),"string"==typeof t){var r=xv.get(i);r&&0===r.referenceCount&&this._deleteMessageElement(i)}Sv&&0===Sv.childNodes.length&&this._deleteMessagesContainer()}}},{key:"ngOnDestroy",value:function(){for(var e=this._document.querySelectorAll("[".concat(wv,"]")),t=0;t-1&&t!==n._activeItemIndex&&(n._activeItemIndex=t)}})}return b(e,[{key:"skipPredicate",value:function(e){return this._skipPredicateFn=e,this}},{key:"withWrap",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._wrap=e,this}},{key:"withVerticalOrientation",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._vertical=e,this}},{key:"withHorizontalOrientation",value:function(e){return this._horizontal=e,this}},{key:"withAllowedModifierKeys",value:function(e){return this._allowedModifierKeys=e,this}},{key:"withTypeAhead",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(rv(function(t){return e._pressedLetters.push(t)}),sv(t),od(function(){return e._pressedLetters.length>0}),ue(function(){return e._pressedLetters.join("")})).subscribe(function(t){for(var n=e._getItemsArray(),i=1;i0&&void 0!==arguments[0])||arguments[0];return this._homeAndEnd=e,this}},{key:"setActiveItem",value:function(e){var t=this._activeItem;this.updateActiveItem(e),this._activeItem!==t&&this.change.next(this._activeItemIndex)}},{key:"onKeydown",value:function(e){var t=this,n=e.keyCode,i=["altKey","ctrlKey","metaKey","shiftKey"].every(function(n){return!e[n]||t._allowedModifierKeys.indexOf(n)>-1});switch(n){case 9:return void this.tabOut.next();case 40:if(this._vertical&&i){this.setNextItemActive();break}return;case 38:if(this._vertical&&i){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&i){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&i){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&i){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&i){this.setLastItemActive();break}return;default:return void((i||fp(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(n>=65&&n<=90||n>=48&&n<=57)&&this._letterKeyStream.next(String.fromCharCode(n))))}this._pressedLetters=[],e.preventDefault()}},{key:"activeItemIndex",get:function(){return this._activeItemIndex}},{key:"activeItem",get:function(){return this._activeItem}},{key:"isTyping",value:function(){return this._pressedLetters.length>0}},{key:"setFirstItemActive",value:function(){this._setActiveItemByIndex(0,1)}},{key:"setLastItemActive",value:function(){this._setActiveItemByIndex(this._items.length-1,-1)}},{key:"setNextItemActive",value:function(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}},{key:"setPreviousItemActive",value:function(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}},{key:"updateActiveItem",value:function(e){var t=this._getItemsArray(),n="number"==typeof e?e:t.indexOf(e),i=t[n];this._activeItem=null==i?null:i,this._activeItemIndex=n}},{key:"_setActiveItemByDelta",value:function(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}},{key:"_setActiveInWrapMode",value:function(e){for(var t=this._getItemsArray(),n=1;n<=t.length;n++){var i=(this._activeItemIndex+e*n+t.length)%t.length;if(!this._skipPredicateFn(t[i]))return void this.setActiveItem(i)}}},{key:"_setActiveInDefaultMode",value:function(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}},{key:"_setActiveItemByIndex",value:function(e,t){var n=this._getItemsArray();if(n[e]){for(;this._skipPredicateFn(n[e]);)if(!n[e+=t])return;this.setActiveItem(e)}}},{key:"_getItemsArray",value:function(){return this._items instanceof el?this._items.toArray():this._items}}]),e}()),Av=function(){var e=function(){function e(t){m(this,e),this._platform=t}return b(e,[{key:"isDisabled",value:function(e){return e.hasAttribute("disabled")}},{key:"isVisible",value:function(e){return function(e){return!!(e.offsetWidth||e.offsetHeight||"function"==typeof e.getClientRects&&e.getClientRects().length)}(e)&&"visible"===getComputedStyle(e).visibility}},{key:"isTabbable",value:function(e){if(!this._platform.isBrowser)return!1;var t=function(e){try{return e.frameElement}catch(t){return null}}(function(e){return e.ownerDocument&&e.ownerDocument.defaultView||window}(e));if(t&&(-1===Mv(t)||!this.isVisible(t)))return!1;var n=e.nodeName.toLowerCase(),i=Mv(e);return e.hasAttribute("contenteditable")?-1!==i:!("iframe"===n||"object"===n||this._platform.WEBKIT&&this._platform.IOS&&!function(e){var t=e.nodeName.toLowerCase(),n="input"===t&&e.type;return"text"===n||"password"===n||"select"===t||"textarea"===t}(e))&&("audio"===n?!!e.hasAttribute("controls")&&-1!==i:"video"===n?-1!==i&&(null!==i||this._platform.FIREFOX||e.hasAttribute("controls")):e.tabIndex>=0)}},{key:"isFocusable",value:function(e,t){return function(e){return!function(e){return function(e){return"input"==e.nodeName.toLowerCase()}(e)&&"hidden"==e.type}(e)&&(function(e){var t=e.nodeName.toLowerCase();return"input"===t||"select"===t||"button"===t||"textarea"===t}(e)||function(e){return function(e){return"a"==e.nodeName.toLowerCase()}(e)&&e.hasAttribute("href")}(e)||e.hasAttribute("contenteditable")||Pv(e))}(e)&&!this.isDisabled(e)&&((null==t?void 0:t.ignoreVisibility)||this.isVisible(e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id))},token:e,providedIn:"root"}),e}();function Pv(e){if(!e.hasAttribute("tabindex")||void 0===e.tabIndex)return!1;var t=e.getAttribute("tabindex");return"-32768"!=t&&!(!t||isNaN(parseInt(t,10)))}function Mv(e){if(!Pv(e))return null;var t=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(t)?-1:t}var Iv=function(){function e(t,n,i,r){var o=this,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];m(this,e),this._element=t,this._checker=n,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=function(){return o.focusLastTabbableElement()},this.endAnchorListener=function(){return o.focusFirstTabbableElement()},this._enabled=!0,a||this.attachAnchors()}return b(e,[{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}},{key:"destroy",value:function(){var e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),t&&(t.removeEventListener("focus",this.endAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}},{key:"attachAnchors",value:function(){var e=this;return!!this._hasAttached||(this._ngZone.runOutsideAngular(function(){e._startAnchor||(e._startAnchor=e._createAnchor(),e._startAnchor.addEventListener("focus",e.startAnchorListener)),e._endAnchor||(e._endAnchor=e._createAnchor(),e._endAnchor.addEventListener("focus",e.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}},{key:"focusInitialElementWhenReady",value:function(e){var t=this;return new Promise(function(n){t._executeOnStable(function(){return n(t.focusInitialElement(e))})})}},{key:"focusFirstTabbableElementWhenReady",value:function(e){var t=this;return new Promise(function(n){t._executeOnStable(function(){return n(t.focusFirstTabbableElement(e))})})}},{key:"focusLastTabbableElementWhenReady",value:function(e){var t=this;return new Promise(function(n){t._executeOnStable(function(){return n(t.focusLastTabbableElement(e))})})}},{key:"_getRegionBoundary",value:function(e){for(var t=this._element.querySelectorAll("[cdk-focus-region-".concat(e,"], [cdkFocusRegion").concat(e,"], [cdk-focus-").concat(e,"]")),n=0;n=0;n--){var i=t[n].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[n]):null;if(i)return i}return null}},{key:"_createAnchor",value:function(){var e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}},{key:"_toggleAnchorTabIndex",value:function(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}},{key:"toggleAnchors",value:function(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}},{key:"_executeOnStable",value:function(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(ap(1)).subscribe(e)}}]),e}(),Rv=function(){var e=function(){function e(t,n,i){m(this,e),this._checker=t,this._ngZone=n,this._document=i}return b(e,[{key:"create",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Iv(e,this._checker,this._ngZone,this._document,t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Av),Qi(Vl),Qi(fh))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Av),Qi(Vl),Qi(fh))},token:e,providedIn:"root"}),e}();function Dv(e){return 0===e.offsetX&&0===e.offsetY}function Nv(e){var t=e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0];return!(!t||-1!==t.identifier||null!=t.radiusX&&1!==t.radiusX||null!=t.radiusY&&1!==t.radiusY)}"undefined"!=typeof Element&∈var Lv=new Mi("cdk-input-modality-detector-options"),jv={ignoreKeys:[18,17,224,91,16]},Fv=Ld({passive:!0,capture:!0}),Bv=function(){var e=function(){function e(t,n,i,r){var o=this;m(this,e),this._platform=t,this._mostRecentTarget=null,this._modality=new nv(null),this._lastTouchMs=0,this._onKeydown=function(e){var t,n;(null===(n=null===(t=o._options)||void 0===t?void 0:t.ignoreKeys)||void 0===n?void 0:n.some(function(t){return t===e.keyCode}))||(o._modality.next("keyboard"),o._mostRecentTarget=Bd(e))},this._onMousedown=function(e){Date.now()-o._lastTouchMs<650||(o._modality.next(Dv(e)?"keyboard":"mouse"),o._mostRecentTarget=Bd(e))},this._onTouchstart=function(e){Nv(e)?o._modality.next("keyboard"):(o._lastTouchMs=Date.now(),o._modality.next("touch"),o._mostRecentTarget=Bd(e))},this._options=Object.assign(Object.assign({},jv),r),this.modalityDetected=this._modality.pipe(hv(1)),this.modalityChanged=this.modalityDetected.pipe(Qf()),t.isBrowser&&n.runOutsideAngular(function(){i.addEventListener("keydown",o._onKeydown,Fv),i.addEventListener("mousedown",o._onMousedown,Fv),i.addEventListener("touchstart",o._onTouchstart,Fv)})}return b(e,[{key:"mostRecentModality",get:function(){return this._modality.value}},{key:"ngOnDestroy",value:function(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Fv),document.removeEventListener("mousedown",this._onMousedown,Fv),document.removeEventListener("touchstart",this._onTouchstart,Fv))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id),Qi(Vl),Qi(fh),Qi(Lv,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id),Qi(Vl),Qi(fh),Qi(Lv,8))},token:e,providedIn:"root"}),e}(),Vv=new Mi("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),zv=new Mi("LIVE_ANNOUNCER_DEFAULT_OPTIONS"),Uv=function(){var e=function(){function e(t,n,i,r){m(this,e),this._ngZone=n,this._defaultOptions=r,this._document=i,this._liveElement=t||this._createLiveElement()}return b(e,[{key:"announce",value:function(e){for(var n,i,r,o=this,a=this._defaultOptions,s=arguments.length,u=new Array(s>1?s-1:0),c=1;c1&&void 0!==arguments[1]&&arguments[1],n=Lf(e);if(!this._platform.isBrowser||1!==n.nodeType)return jf(null);var i=jd(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return t&&(r.checkChildren=!0),r.subject;var o={checkChildren:t,subject:new oe,rootNode:i};return this._elementInfo.set(n,o),this._registerGlobalListeners(o),o.subject}},{key:"stopMonitoring",value:function(e){var t=Lf(e),n=this._elementInfo.get(t);n&&(n.subject.complete(),this._setClasses(t),this._elementInfo.delete(t),this._removeGlobalListeners(n))}},{key:"focusVia",value:function(e,n,i){var r=this,o=Lf(e);o===this._getDocument().activeElement?this._getClosestElementsInfo(o).forEach(function(e){var i=t(e,2),o=i[0],a=i[1];return r._originChanged(o,n,a)}):(this._setOrigin(n),"function"==typeof o.focus&&o.focus(i))}},{key:"ngOnDestroy",value:function(){var e=this;this._elementInfo.forEach(function(t,n){return e.stopMonitoring(n)})}},{key:"_getDocument",value:function(){return this._document||document}},{key:"_getWindow",value:function(){return this._getDocument().defaultView||window}},{key:"_toggleClass",value:function(e,t,n){n?e.classList.add(t):e.classList.remove(t)}},{key:"_getFocusOrigin",value:function(e){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(e)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}},{key:"_shouldBeAttributedToTouch",value:function(e){return 1===this._detectionMode||!!(null==e?void 0:e.contains(this._inputModalityDetector._mostRecentTarget))}},{key:"_setClasses",value:function(e,t){this._toggleClass(e,"cdk-focused",!!t),this._toggleClass(e,"cdk-touch-focused","touch"===t),this._toggleClass(e,"cdk-keyboard-focused","keyboard"===t),this._toggleClass(e,"cdk-mouse-focused","mouse"===t),this._toggleClass(e,"cdk-program-focused","program"===t)}},{key:"_setOrigin",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._ngZone.runOutsideAngular(function(){t._origin=e,t._originFromTouchInteraction="touch"===e&&n,0===t._detectionMode&&(clearTimeout(t._originTimeoutId),t._originTimeoutId=setTimeout(function(){return t._origin=null},t._originFromTouchInteraction?650:1))})}},{key:"_onFocus",value:function(e,t){var n=this._elementInfo.get(t),i=Bd(e);!n||!n.checkChildren&&t!==i||this._originChanged(t,this._getFocusOrigin(i),n)}},{key:"_onBlur",value:function(e,t){var n=this._elementInfo.get(t);!n||n.checkChildren&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(this._setClasses(t),this._emitOrigin(n.subject,null))}},{key:"_emitOrigin",value:function(e,t){this._ngZone.run(function(){return e.next(t)})}},{key:"_registerGlobalListeners",value:function(e){var t=this;if(this._platform.isBrowser){var n=e.rootNode,i=this._rootNodeFocusListenerCount.get(n)||0;i||this._ngZone.runOutsideAngular(function(){n.addEventListener("focus",t._rootNodeFocusAndBlurListener,Gv),n.addEventListener("blur",t._rootNodeFocusAndBlurListener,Gv)}),this._rootNodeFocusListenerCount.set(n,i+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(function(){t._getWindow().addEventListener("focus",t._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(ud(this._stopInputModalityDetector)).subscribe(function(e){t._setOrigin(e,!0)}))}}},{key:"_removeGlobalListeners",value:function(e){var t=e.rootNode;if(this._rootNodeFocusListenerCount.has(t)){var n=this._rootNodeFocusListenerCount.get(t);n>1?this._rootNodeFocusListenerCount.set(t,n-1):(t.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Gv),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Gv),this._rootNodeFocusListenerCount.delete(t))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}},{key:"_originChanged",value:function(e,t,n){this._setClasses(e,t),this._emitOrigin(n.subject,t),this._lastFocusOrigin=t}},{key:"_getClosestElementsInfo",value:function(e){var t=[];return this._elementInfo.forEach(function(n,i){(i===e||n.checkChildren&&i.contains(e))&&t.push([i,n])}),t}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl),Qi(Id),Qi(Bv),Qi(fh,8),Qi(Hv,8))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Vl),Qi(Id),Qi(Bv),Qi(fh,8),Qi(Hv,8))},token:e,providedIn:"root"}),e}(),qv="cdk-high-contrast-black-on-white",Xv="cdk-high-contrast-white-on-black",Yv="cdk-high-contrast-active",Kv=function(){var e=function(){function e(t,n){m(this,e),this._platform=t,this._document=n}return b(e,[{key:"getHighContrastMode",value:function(){if(!this._platform.isBrowser)return 0;var e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);var t=this._document.defaultView||window,n=t&&t.getComputedStyle?t.getComputedStyle(e):null,i=(n&&n.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(e),i){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}},{key:"_applyBodyHighContrastModeCssClasses",value:function(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){var e=this._document.body.classList;e.remove(Yv),e.remove(qv),e.remove(Xv),this._hasCheckedHighContrastMode=!0;var t=this.getHighContrastMode();1===t?(e.add(Yv),e.add(qv)):2===t&&(e.add(Yv),e.add(Xv))}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id),Qi(fh))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id),Qi(fh))},token:e,providedIn:"root"}),e}(),Qv=function(){var e=function e(t){m(this,e),t._applyBodyHighContrastModeCssClasses()};return e.\u0275fac=function(t){return new(t||e)(Qi(Kv))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Rd,mv]]}),e}(),$v=new tc("12.2.5"),Zv=function e(){m(this,e)},Jv="*";function eg(e,t){return{type:7,name:e,definitions:t,options:{}}}function tg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:4,styles:t,timings:e}}function ng(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:2,steps:e,options:t}}function ig(e){return{type:6,styles:e,offset:null}}function rg(e,t,n){return{type:0,name:e,styles:t,options:n}}function og(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:1,expr:e,animation:t,options:n}}function ag(e){Promise.resolve(null).then(e)}var sg=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;m(this,e),this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+n}return b(e,[{key:"_onFinish",value:function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])}},{key:"onStart",value:function(e){this._onStartFns.push(e)}},{key:"onDone",value:function(e){this._onDoneFns.push(e)}},{key:"onDestroy",value:function(e){this._onDestroyFns.push(e)}},{key:"hasStarted",value:function(){return this._started}},{key:"init",value:function(){}},{key:"play",value:function(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}},{key:"triggerMicrotask",value:function(){var e=this;ag(function(){return e._onFinish()})}},{key:"_onStart",value:function(){this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[]}},{key:"pause",value:function(){}},{key:"restart",value:function(){}},{key:"finish",value:function(){this._onFinish()}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])}},{key:"reset",value:function(){this._started=!1}},{key:"setPosition",value:function(e){this._position=this.totalTime?e*this.totalTime:1}},{key:"getPosition",value:function(){return this.totalTime?this._position/this.totalTime:1}},{key:"triggerCallback",value:function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0}}]),e}(),ug=function(){function e(t){var n=this;m(this,e),this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;var i=0,r=0,o=0,a=this.players.length;0==a?ag(function(){return n._onFinish()}):this.players.forEach(function(e){e.onDone(function(){++i==a&&n._onFinish()}),e.onDestroy(function(){++r==a&&n._onDestroy()}),e.onStart(function(){++o==a&&n._onStart()})}),this.totalTime=this.players.reduce(function(e,t){return Math.max(e,t.totalTime)},0)}return b(e,[{key:"_onFinish",value:function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])}},{key:"init",value:function(){this.players.forEach(function(e){return e.init()})}},{key:"onStart",value:function(e){this._onStartFns.push(e)}},{key:"_onStart",value:function(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[])}},{key:"onDone",value:function(e){this._onDoneFns.push(e)}},{key:"onDestroy",value:function(e){this._onDestroyFns.push(e)}},{key:"hasStarted",value:function(){return this._started}},{key:"play",value:function(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(function(e){return e.play()})}},{key:"pause",value:function(){this.players.forEach(function(e){return e.pause()})}},{key:"restart",value:function(){this.players.forEach(function(e){return e.restart()})}},{key:"finish",value:function(){this._onFinish(),this.players.forEach(function(e){return e.finish()})}},{key:"destroy",value:function(){this._onDestroy()}},{key:"_onDestroy",value:function(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(function(e){return e.destroy()}),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])}},{key:"reset",value:function(){this.players.forEach(function(e){return e.reset()}),this._destroyed=!1,this._finished=!1,this._started=!1}},{key:"setPosition",value:function(e){var t=e*this.totalTime;this.players.forEach(function(e){var n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})}},{key:"getPosition",value:function(){var e=this.players.reduce(function(e,t){return null===e||t.totalTime>e.totalTime?t:e},null);return null!=e?e.getPosition():0}},{key:"beforeDestroy",value:function(){this.players.forEach(function(e){e.beforeDestroy&&e.beforeDestroy()})}},{key:"triggerCallback",value:function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0}}]),e}();function cg(){return"undefined"!=typeof window&&void 0!==window.document}function lg(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function hg(e){switch(e.length){case 0:return new sg;case 1:return e[0];default:return new ug(e)}}function fg(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=[],s=[],u=-1,c=null;if(i.forEach(function(e){var n=e.offset,i=n==u,l=i&&c||{};Object.keys(e).forEach(function(n){var i=n,s=e[n];if("offset"!==n)switch(i=t.normalizePropertyName(i,a),s){case"!":s=r[n];break;case Jv:s=o[n];break;default:s=t.normalizeStyleValue(n,i,s,a)}l[i]=s}),i||s.push(l),c=l,u=n}),a.length){var l="\n - ";throw new Error("Unable to animate due to the following errors:".concat(l).concat(a.join(l)))}return s}function dg(e,t,n,i){switch(t){case"start":e.onStart(function(){return i(n&&pg(n,"start",e))});break;case"done":e.onDone(function(){return i(n&&pg(n,"done",e))});break;case"destroy":e.onDestroy(function(){return i(n&&pg(n,"destroy",e))})}}function pg(e,t,n){var i=n.totalTime,r=vg(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,null==i?e.totalTime:i,!!n.disabled),o=e._data;return null!=o&&(r._data=o),r}function vg(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;return{element:e,triggerName:t,fromState:n,toState:i,phaseName:r,totalTime:o,disabled:!!a}}function gg(e,t,n){var i;return e instanceof Map?(i=e.get(t))||e.set(t,i=n):(i=e[t])||(i=e[t]=n),i}function mg(e){var t=e.indexOf(":");return[e.substring(1,t),e.substr(t+1)]}var yg=function(e,t){return!1},bg=function(e,t){return!1},_g=function(e,t,n){return[]},wg=lg();(wg||"undefined"!=typeof Element)&&(yg=cg()?function(e,t){for(;t&&t!==document.documentElement;){if(t===e)return!0;t=t.parentNode||t.host}return!1}:function(e,t){return e.contains(t)},bg=function(){if(wg||Element.prototype.matches)return function(e,t){return e.matches(t)};var e=Element.prototype,t=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;return t?function(e,n){return t.apply(e,[n])}:bg}(),_g=function(e,t,n){var i=[];if(n)for(var r=e.querySelectorAll(t),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).forEach(function(n){t[n]=e[n]}),t}function zg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t)for(var i in e)n[i]=e[i];else Vg(e,n);return n}function Ug(e,t,n){return n?t+":"+n+";":""}function Hg(e){for(var t="",n=0;n *";case":leave":return"* => void";case":increment":return function(e,t){return parseFloat(t)>parseFloat(e)};case":decrement":return function(e,t){return parseFloat(t) *"}}(e,n);if("function"==typeof i)return void t.push(i);e=i}var r=e.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==r||r.length<4)return n.push('The provided transition expression "'.concat(e,'" is not supported')),t;var o=r[1],a=r[2],s=r[3];t.push(sm(o,s)),"<"==a[0]&&("*"!=o||"*"!=s)&&t.push(sm(s,o))}(e,n,t)}):n.push(e),n}var om=new Set(["true","1"]),am=new Set(["false","0"]);function sm(e,t){var n=om.has(e)||am.has(e),i=om.has(t)||am.has(t);return function(r,o){var a="*"==e||e==r,s="*"==t||t==o;return!a&&n&&"boolean"==typeof r&&(a=r?om.has(e):am.has(e)),!s&&i&&"boolean"==typeof o&&(s=o?om.has(t):am.has(t)),a&&s}}var um=new RegExp("s*:selfs*,?","g");function cm(e,t,n){return new lm(e).build(t,n)}var lm=function(){function e(t){m(this,e),this._driver=t}return b(e,[{key:"build",value:function(e,t){var n=new hm(t);return this._resetContextStyleTimingState(n),nm(this,qg(e),n)}},{key:"_resetContextStyleTimingState",value:function(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}},{key:"visitTrigger",value:function(e,t){var n=this,i=t.queryCount=0,r=t.depCount=0,o=[],a=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(function(e){if(n._resetContextStyleTimingState(t),0==e.type){var s=e,u=s.name;u.toString().split(/\s*,\s*/).forEach(function(e){s.name=e,o.push(n.visitState(s,t))}),s.name=u}else if(1==e.type){var c=n.visitTransition(e,t);i+=c.queryCount,r+=c.depCount,a.push(c)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:o,transitions:a,queryCount:i,depCount:r,options:null}}},{key:"visitState",value:function(e,t){var n=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(n.containsDynamicStyles){var r=new Set,o=i||{};if(n.styles.forEach(function(e){if(fm(e)){var t=e;Object.keys(t).forEach(function(e){Yg(t[e]).forEach(function(e){o.hasOwnProperty(e)||r.add(e)})})}}),r.size){var a=Qg(r.values());t.errors.push('state("'.concat(e.name,'", ...) must define default values for all the following style substitutions: ').concat(a.join(", ")))}}return{type:0,name:e.name,style:n,options:i?{params:i}:null}}},{key:"visitTransition",value:function(e,t){t.queryCount=0,t.depCount=0;var n=nm(this,qg(e.animation),t);return{type:1,matchers:rm(e.expr,t.errors),animation:n,queryCount:t.queryCount,depCount:t.depCount,options:dm(e.options)}}},{key:"visitSequence",value:function(e,t){var n=this;return{type:2,steps:e.steps.map(function(e){return nm(n,e,t)}),options:dm(e.options)}}},{key:"visitGroup",value:function(e,t){var n=this,i=t.currentTime,r=0,o=e.steps.map(function(e){t.currentTime=i;var o=nm(n,e,t);return r=Math.max(r,t.currentTime),o});return t.currentTime=r,{type:3,steps:o,options:dm(e.options)}}},{key:"visitAnimate",value:function(e,t){var n=function(e,t){var n=null;if(e.hasOwnProperty("duration"))n=e;else if("number"==typeof e)return pm(Bg(e,t).duration,0,"");var i=e;if(i.split(/\s+/).some(function(e){return"{"==e.charAt(0)&&"{"==e.charAt(1)})){var r=pm(0,0,"");return r.dynamic=!0,r.strValue=i,r}return pm((n=n||Bg(i,t)).duration,n.delay,n.easing)}(e.timings,t.errors);t.currentAnimateTimings=n;var i,r=e.styles?e.styles:ig({});if(5==r.type)i=this.visitKeyframes(r,t);else{var o=e.styles,a=!1;if(!o){a=!0;var s={};n.easing&&(s.easing=n.easing),o=ig(s)}t.currentTime+=n.duration+n.delay;var u=this.visitStyle(o,t);u.isEmptyStep=a,i=u}return t.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}},{key:"visitStyle",value:function(e,t){var n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}},{key:"_makeStyleAst",value:function(e,t){var n=[];Array.isArray(e.styles)?e.styles.forEach(function(e){"string"==typeof e?e==Jv?n.push(e):t.errors.push("The provided style string value ".concat(e," is not allowed.")):n.push(e)}):n.push(e.styles);var i=!1,r=null;return n.forEach(function(e){if(fm(e)){var t=e,n=t.easing;if(n&&(r=n,delete t.easing),!i)for(var o in t)if(t[o].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:e.offset,containsDynamicStyles:i,options:null}}},{key:"_validateStyleAst",value:function(e,t){var n=this,i=t.currentAnimateTimings,r=t.currentTime,o=t.currentTime;i&&o>0&&(o-=i.duration+i.delay),e.styles.forEach(function(e){"string"!=typeof e&&Object.keys(e).forEach(function(i){if(n._driver.validateStyleProperty(i)){var a=t.collectedStyles[t.currentQuerySelector],s=a[i],u=!0;s&&(o!=r&&o>=s.startTime&&r<=s.endTime&&(t.errors.push('The CSS property "'.concat(i,'" that exists between the times of "').concat(s.startTime,'ms" and "').concat(s.endTime,'ms" is also being animated in a parallel animation between the times of "').concat(o,'ms" and "').concat(r,'ms"')),u=!1),o=s.startTime),u&&(a[i]={startTime:o,endTime:r}),t.options&&function(e,t,n){var i=t.params||{},r=Yg(e);r.length&&r.forEach(function(e){i.hasOwnProperty(e)||n.push("Unable to resolve the local animation param ".concat(e," in the given list of values"))})}(e[i],t.options,t.errors)}else t.errors.push('The provided animation property "'.concat(i,'" is not a supported CSS property for animations'))})})}},{key:"visitKeyframes",value:function(e,t){var n=this,i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;var r=0,o=[],a=!1,s=!1,u=0,c=e.steps.map(function(e){var i=n._makeStyleAst(e,t),c=null!=i.offset?i.offset:function(e){if("string"==typeof e)return null;var t=null;if(Array.isArray(e))e.forEach(function(e){if(fm(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}});else if(fm(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}return t}(i.styles),l=0;return null!=c&&(r++,l=i.offset=c),s=s||l<0||l>1,a=a||l0&&r0?r==f?1:h*r:o[r],s=a*v;t.currentTime=d+p.delay+s,p.duration=s,n._validateStyleAst(e,t),e.offset=a,i.styles.push(e)}),i}},{key:"visitReference",value:function(e,t){return{type:8,animation:nm(this,qg(e.animation),t),options:dm(e.options)}}},{key:"visitAnimateChild",value:function(e,t){return t.depCount++,{type:9,options:dm(e.options)}}},{key:"visitAnimateRef",value:function(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:dm(e.options)}}},{key:"visitQuery",value:function(e,n){var i=n.currentQuerySelector,r=e.options||{};n.queryCount++,n.currentQuery=e;var o=t(function(e){var t=!!e.split(/\s*,\s*/).find(function(e){return":self"==e});return t&&(e=e.replace(um,"")),[e=e.replace(/@\*/g,Dg).replace(/@\w+/g,function(e){return Dg+"-"+e.substr(1)}).replace(/:animating/g,Lg),t]}(e.selector),2),a=o[0],s=o[1];n.currentQuerySelector=i.length?i+" "+a:a,gg(n.collectedStyles,n.currentQuerySelector,{});var u=nm(this,qg(e.animation),n);return n.currentQuery=null,n.currentQuerySelector=i,{type:11,selector:a,limit:r.limit||0,optional:!!r.optional,includeSelf:s,animation:u,originalSelector:e.selector,options:dm(e.options)}}},{key:"visitStagger",value:function(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");var n="full"===e.timings?{duration:0,delay:0,easing:"full"}:Bg(e.timings,t.errors,!0);return{type:12,animation:nm(this,qg(e.animation),t),timings:n,options:null}}}]),e}(),hm=function e(t){m(this,e),this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null};function fm(e){return!Array.isArray(e)&&"object"==typeof e}function dm(e){return e?(e=Vg(e)).params&&(e.params=function(e){return e?Vg(e):null}(e.params)):e={},e}function pm(e,t,n){return{duration:e,delay:t,easing:n}}function vm(e,t,n,i,r,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];return{type:1,element:e,keyframes:t,preStyleProps:n,postStyleProps:i,duration:r,delay:o,totalTime:r+o,easing:a,subTimeline:s}}var gm=function(){function e(){m(this,e),this._map=new Map}return b(e,[{key:"consume",value:function(e){var t=this._map.get(e);return t?this._map.delete(e):t=[],t}},{key:"append",value:function(e,t){var n,i=this._map.get(e);i||this._map.set(e,i=[]),(n=i).push.apply(n,v(t))}},{key:"has",value:function(e){return this._map.has(e)}},{key:"clear",value:function(){this._map.clear()}}]),e}(),mm=new RegExp(":enter","g"),ym=new RegExp(":leave","g");function bm(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7?arguments[7]:void 0,u=arguments.length>8?arguments[8]:void 0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:[];return(new _m).buildKeyframes(e,t,n,i,r,o,a,s,u,c)}var _m=function(){function e(){m(this,e)}return b(e,[{key:"buildKeyframes",value:function(e,t,n,i,r,o,a,s,u){var c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:[];u=u||new gm;var l=new km(e,t,u,i,r,c,[]);l.options=s,l.currentTimeline.setStyles([o],null,l.errors,s),nm(this,n,l);var h=l.timelines.filter(function(e){return e.containsAnimation()});if(h.length&&Object.keys(a).length){var f=h[h.length-1];f.allowOnlyTimelineStyles()||f.setStyles([a],null,l.errors,s)}return h.length?h.map(function(e){return e.buildKeyframes()}):[vm(t,[],[],[],0,0,"",!1)]}},{key:"visitTrigger",value:function(e,t){}},{key:"visitState",value:function(e,t){}},{key:"visitTransition",value:function(e,t){}},{key:"visitAnimateChild",value:function(e,t){var n=t.subInstructions.consume(t.element);if(n){var i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,i,i.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}},{key:"visitAnimateRef",value:function(e,t){var n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}},{key:"_visitSubInstructions",value:function(e,t,n){var i=t.currentTimeline.currentTime,r=null!=n.duration?jg(n.duration):null,o=null!=n.delay?jg(n.delay):null;return 0!==r&&e.forEach(function(e){var n=t.appendInstructionToTimeline(e,r,o);i=Math.max(i,n.duration+n.delay)}),i}},{key:"visitReference",value:function(e,t){t.updateOptions(e.options,!0),nm(this,e.animation,t),t.previousNode=e}},{key:"visitSequence",value:function(e,t){var n=this,i=t.subContextCount,r=t,o=e.options;if(o&&(o.params||o.delay)&&((r=t.createSubContext(o)).transformIntoNewTimeline(),null!=o.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=wm);var a=jg(o.delay);r.delayNextStep(a)}e.steps.length&&(e.steps.forEach(function(e){return nm(n,e,r)}),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}},{key:"visitGroup",value:function(e,t){var n=this,i=[],r=t.currentTimeline.currentTime,o=e.options&&e.options.delay?jg(e.options.delay):0;e.steps.forEach(function(a){var s=t.createSubContext(e.options);o&&s.delayNextStep(o),nm(n,a,s),r=Math.max(r,s.currentTimeline.currentTime),i.push(s.currentTimeline)}),i.forEach(function(e){return t.currentTimeline.mergeTimelineCollectedStyles(e)}),t.transformIntoNewTimeline(r),t.previousNode=e}},{key:"_visitTiming",value:function(e,t){if(e.dynamic){var n=e.strValue;return Bg(t.params?Kg(n,t.params,t.errors):n,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}},{key:"visitAnimate",value:function(e,t){var n=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),i.snapshotCurrentStyles());var r=e.style;5==r.type?this.visitKeyframes(r,t):(t.incrementTime(n.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}},{key:"visitStyle",value:function(e,t){var n=t.currentTimeline,i=t.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();var r=i&&i.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(r):n.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}},{key:"visitKeyframes",value:function(e,t){var n=t.currentAnimateTimings,i=t.currentTimeline.duration,r=n.duration,o=t.createSubContext().currentTimeline;o.easing=n.easing,e.styles.forEach(function(e){o.forwardTime((e.offset||0)*r),o.setStyles(e.styles,e.easing,t.errors,t.options),o.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(o),t.transformIntoNewTimeline(i+r),t.previousNode=e}},{key:"visitQuery",value:function(e,t){var n=this,i=t.currentTimeline.currentTime,r=e.options||{},o=r.delay?jg(r.delay):0;o&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=wm);var a=i,s=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=s.length;var u=null;s.forEach(function(i,r){t.currentQueryIndex=r;var s=t.createSubContext(e.options,i);o&&s.delayNextStep(o),i===t.element&&(u=s.currentTimeline),nm(n,e.animation,s),s.currentTimeline.applyStylesToKeyframe(),a=Math.max(a,s.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(a),u&&(t.currentTimeline.mergeTimelineCollectedStyles(u),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}},{key:"visitStagger",value:function(e,t){var n=t.parentContext,i=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),s=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":s=a-s;break;case"full":s=n.currentStaggerTime}var u=t.currentTimeline;s&&u.delayNextStep(s);var c=u.currentTime;nm(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}]),e}(),wm={},km=function(){function e(t,n,i,r,o,a,s,u){m(this,e),this._driver=t,this.element=n,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=o,this.errors=a,this.timelines=s,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=wm,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=u||new xm(this._driver,n,0),s.push(this.currentTimeline)}return b(e,[{key:"params",get:function(){return this.options.params}},{key:"updateOptions",value:function(e,t){var n=this;if(e){var i=e,r=this.options;null!=i.duration&&(r.duration=jg(i.duration)),null!=i.delay&&(r.delay=jg(i.delay));var o=i.params;if(o){var a=r.params;a||(a=this.options.params={}),Object.keys(o).forEach(function(e){(!t||!a.hasOwnProperty(e))&&(a[e]=Kg(o[e],a,n.errors))})}}}},{key:"_copyOptions",value:function(){var e={};if(this.options){var t=this.options.params;if(t){var n=e.params={};Object.keys(t).forEach(function(e){n[e]=t[e]})}}return e}},{key:"createSubContext",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=n||this.element,o=new e(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}},{key:"transformIntoNewTimeline",value:function(e){return this.previousNode=wm,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}},{key:"appendInstructionToTimeline",value:function(e,t,n){var i={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+e.delay,easing:""},r=new Sm(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(r),i}},{key:"incrementTime",value:function(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}},{key:"delayNextStep",value:function(e){e>0&&this.currentTimeline.delayNextStep(e)}},{key:"invokeQuery",value:function(e,t,n,i,r,o){var a=[];if(i&&a.push(this.element),e.length>0){e=(e=e.replace(mm,"."+this._enterClassName)).replace(ym,"."+this._leaveClassName);var s=this._driver.query(this.element,e,1!=n);0!==n&&(s=n<0?s.slice(s.length+n,s.length):s.slice(0,n)),a.push.apply(a,v(s))}return!r&&0==a.length&&o.push('`query("'.concat(t,'")` returned zero elements. (Use `query("').concat(t,'", { optional: true })` if you wish to allow this.)')),a}}]),e}(),xm=function(){function e(t,n,i,r){m(this,e),this._driver=t,this.element=n,this.startTime=i,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(n),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(n,this._localTimelineStyles)),this._loadKeyframe()}return b(e,[{key:"containsAnimation",value:function(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}},{key:"getCurrentStyleProperties",value:function(){return Object.keys(this._currentKeyframe)}},{key:"currentTime",get:function(){return this.startTime+this.duration}},{key:"delayNextStep",value:function(e){var t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}},{key:"fork",value:function(t,n){return this.applyStylesToKeyframe(),new e(this._driver,t,n||this.currentTime,this._elementTimelineStylesLookup)}},{key:"_loadKeyframe",value:function(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}},{key:"forwardFrame",value:function(){this.duration+=1,this._loadKeyframe()}},{key:"forwardTime",value:function(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}},{key:"_updateStyle",value:function(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}},{key:"allowOnlyTimelineStyles",value:function(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}},{key:"applyEmptyStep",value:function(e){var t=this;e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(function(e){t._backFill[e]=t._globalTimelineStyles[e]||Jv,t._currentKeyframe[e]=Jv}),this._currentEmptyStepKeyframe=this._currentKeyframe}},{key:"setStyles",value:function(e,t,n,i){var r=this;t&&(this._previousKeyframe.easing=t);var o=i&&i.params||{},a=function(e,t){var n,i={};return e.forEach(function(e){"*"===e?(n=n||Object.keys(t)).forEach(function(e){i[e]=Jv}):zg(e,!1,i)}),i}(e,this._globalTimelineStyles);Object.keys(a).forEach(function(e){var t=Kg(a[e],o,n);r._pendingStyles[e]=t,r._localTimelineStyles.hasOwnProperty(e)||(r._backFill[e]=r._globalTimelineStyles.hasOwnProperty(e)?r._globalTimelineStyles[e]:Jv),r._updateStyle(e,t)})}},{key:"applyStylesToKeyframe",value:function(){var e=this,t=this._pendingStyles,n=Object.keys(t);0!=n.length&&(this._pendingStyles={},n.forEach(function(n){e._currentKeyframe[n]=t[n]}),Object.keys(this._localTimelineStyles).forEach(function(t){e._currentKeyframe.hasOwnProperty(t)||(e._currentKeyframe[t]=e._localTimelineStyles[t])}))}},{key:"snapshotCurrentStyles",value:function(){var e=this;Object.keys(this._localTimelineStyles).forEach(function(t){var n=e._localTimelineStyles[t];e._pendingStyles[t]=n,e._updateStyle(t,n)})}},{key:"getFinalKeyframe",value:function(){return this._keyframes.get(this.duration)}},{key:"properties",get:function(){var e=[];for(var t in this._currentKeyframe)e.push(t);return e}},{key:"mergeTimelineCollectedStyles",value:function(e){var t=this;Object.keys(e._styleSummary).forEach(function(n){var i=t._styleSummary[n],r=e._styleSummary[n];(!i||r.time>i.time)&&t._updateStyle(n,r.value)})}},{key:"buildKeyframes",value:function(){var e=this;this.applyStylesToKeyframe();var t=new Set,n=new Set,i=1===this._keyframes.size&&0===this.duration,r=[];this._keyframes.forEach(function(o,a){var s=zg(o,!0);Object.keys(s).forEach(function(e){var i=s[e];"!"==i?t.add(e):i==Jv&&n.add(e)}),i||(s.offset=a/e.duration),r.push(s)});var o=t.size?Qg(t.values()):[],a=n.size?Qg(n.values()):[];if(i){var s=r[0],u=Vg(s);s.offset=0,u.offset=1,r=[s,u]}return vm(this.element,r,o,a,this.duration,this.startTime,this.easing,!1)}}]),e}(),Sm=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s){var u,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return m(this,n),(u=t.call(this,e,i,s.delay)).keyframes=r,u.preStyleProps=o,u.postStyleProps=a,u._stretchStartingKeyframe=c,u.timings={duration:s.duration,delay:s.delay,easing:s.easing},u}return b(n,[{key:"containsAnimation",value:function(){return this.keyframes.length>1}},{key:"buildKeyframes",value:function(){var e=this.keyframes,t=this.timings,n=t.delay,i=t.duration,r=t.easing;if(this._stretchStartingKeyframe&&n){var o=[],a=i+n,s=n/a,u=zg(e[0],!1);u.offset=0,o.push(u);var c=zg(e[0],!1);c.offset=Em(s),o.push(c);for(var l=e.length-1,h=1;h<=l;h++){var f=zg(e[h],!1);f.offset=Em((n+f.offset*i)/a),o.push(f)}i=a,n=0,r="",e=o}return vm(this.element,e,this.preStyleProps,this.postStyleProps,i,n,r,!0)}}]),n}(xm);function Em(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=Math.pow(10,t-1);return Math.round(e*n)/n}var Cm=function e(){m(this,e)},Om=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"normalizePropertyName",value:function(e,t){return Zg(e)}},{key:"normalizeStyleValue",value:function(e,t,n,i){var r="",o=n.toString().trim();if(Tm[t]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{var a=n.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&i.push("Please provide a CSS unit value for ".concat(e,":").concat(n))}return o+r}}]),n}(Cm),Tm=function(e){var t={};return e.forEach(function(e){return t[e]=!0}),t}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(","));function Am(e,t,n,i,r,o,a,s,u,c,l,h,f){return{type:0,element:e,triggerName:t,isRemovalTransition:r,fromState:n,fromStyles:o,toState:i,toStyles:a,timelines:s,queriedElements:u,preStyleProps:c,postStyleProps:l,totalTime:h,errors:f}}var Pm={},Mm=function(){function e(t,n,i){m(this,e),this._triggerName=t,this.ast=n,this._stateStyles=i}return b(e,[{key:"match",value:function(e,t,n,i){return function(e,t,n,i,r){return e.some(function(e){return e(t,n,i,r)})}(this.ast.matchers,e,t,n,i)}},{key:"buildStyles",value:function(e,t,n){var i=this._stateStyles["*"],r=this._stateStyles[e],o=i?i.buildStyles(t,n):{};return r?r.buildStyles(t,n):o}},{key:"build",value:function(e,t,n,i,r,o,a,s,u,c){var l=[],h=this.ast.options&&this.ast.options.params||Pm,f=this.buildStyles(n,a&&a.params||Pm,l),d=s&&s.params||Pm,p=this.buildStyles(i,d,l),v=new Set,g=new Map,m=new Map,y="void"===i,b={params:Object.assign(Object.assign({},h),d)},_=c?[]:bm(e,t,this.ast.animation,r,o,f,p,b,u,l),w=0;if(_.forEach(function(e){w=Math.max(e.duration+e.delay,w)}),l.length)return Am(t,this._triggerName,n,i,y,f,p,[],[],g,m,w,l);_.forEach(function(e){var n=e.element,i=gg(g,n,{});e.preStyleProps.forEach(function(e){return i[e]=!0});var r=gg(m,n,{});e.postStyleProps.forEach(function(e){return r[e]=!0}),n!==t&&v.add(n)});var k=Qg(v.values());return Am(t,this._triggerName,n,i,y,f,p,_,k,g,m,w)}}]),e}(),Im=function(){function e(t,n,i){m(this,e),this.styles=t,this.defaultParams=n,this.normalizer=i}return b(e,[{key:"buildStyles",value:function(e,t){var n=this,i={},r=Vg(this.defaultParams);return Object.keys(e).forEach(function(t){var n=e[t];null!=n&&(r[t]=n)}),this.styles.styles.forEach(function(e){if("string"!=typeof e){var o=e;Object.keys(o).forEach(function(e){var a=o[e];a.length>1&&(a=Kg(a,r,t));var s=n.normalizer.normalizePropertyName(e,t);a=n.normalizer.normalizeStyleValue(e,s,a,t),i[s]=a})}}),i}}]),e}(),Rm=function(){function e(t,n,i){var r=this;m(this,e),this.name=t,this.ast=n,this._normalizer=i,this.transitionFactories=[],this.states={},n.states.forEach(function(e){r.states[e.name]=new Im(e.style,e.options&&e.options.params||{},i)}),Dm(this.states,"true","1"),Dm(this.states,"false","0"),n.transitions.forEach(function(e){r.transitionFactories.push(new Mm(t,e,r.states))}),this.fallbackTransition=function(e,t,n){return new Mm(e,{type:1,animation:{type:2,steps:[],options:null},matchers:[function(e,t){return!0}],options:null,queryCount:0,depCount:0},t)}(t,this.states)}return b(e,[{key:"containsQueries",get:function(){return this.ast.queryCount>0}},{key:"matchTransition",value:function(e,t,n,i){return this.transitionFactories.find(function(r){return r.match(e,t,n,i)})||null}},{key:"matchStyles",value:function(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}}]),e}();function Dm(e,t,n){e.hasOwnProperty(t)?e.hasOwnProperty(n)||(e[n]=e[t]):e.hasOwnProperty(n)&&(e[t]=e[n])}var Nm=new gm,Lm=function(){function e(t,n,i){m(this,e),this.bodyNode=t,this._driver=n,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}return b(e,[{key:"register",value:function(e,t){var n=[],i=cm(this._driver,t,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: ".concat(n.join("\n")));this._animations[e]=i}},{key:"_buildPlayer",value:function(e,t,n){var i=e.element,r=fg(0,this._normalizer,0,e.keyframes,t,n);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}},{key:"create",value:function(e,t){var n,i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[],a=this._animations[e],s=new Map;if(a?(n=bm(this._driver,t,a,Mg,Ig,{},{},r,Nm,o)).forEach(function(e){var t=gg(s,e.element,{});e.postStyleProps.forEach(function(e){return t[e]=null})}):(o.push("The requested animation doesn't exist or has already been destroyed"),n=[]),o.length)throw new Error("Unable to create the animation due to the following errors: ".concat(o.join("\n")));s.forEach(function(e,t){Object.keys(e).forEach(function(n){e[n]=i._driver.computeStyle(t,n,Jv)})});var u=hg(n.map(function(e){var t=s.get(e.element);return i._buildPlayer(e,{},t)}));return this._playersById[e]=u,u.onDestroy(function(){return i.destroy(e)}),this.players.push(u),u}},{key:"destroy",value:function(e){var t=this._getPlayer(e);t.destroy(),delete this._playersById[e];var n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}},{key:"_getPlayer",value:function(e){var t=this._playersById[e];if(!t)throw new Error("Unable to find the timeline player referenced by ".concat(e));return t}},{key:"listen",value:function(e,t,n,i){var r=vg(t,"","","");return dg(this._getPlayer(e),n,r,i),function(){}}},{key:"command",value:function(e,t,n,i){if("register"!=n)if("create"!=n){var r=this._getPlayer(e);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e)}}else this.create(e,t,i[0]||{});else this.register(e,i[0])}}]),e}(),jm="ng-animate-queued",Fm="ng-animate-disabled",Bm=".ng-animate-disabled",Vm=[],zm={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Um={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Hm="__ng_removed",Gm=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";m(this,e),this.namespaceId=n;var i=t&&t.hasOwnProperty("value");if(this.value=function(e){return null!=e?e:null}(i?t.value:t),i){var r=Vg(t);delete r.value,this.options=r}else this.options={};this.options.params||(this.options.params={})}return b(e,[{key:"params",get:function(){return this.options.params}},{key:"absorbOptions",value:function(e){var t=e.params;if(t){var n=this.options.params;Object.keys(t).forEach(function(e){null==n[e]&&(n[e]=t[e])})}}}]),e}(),Wm="void",qm=new Gm(Wm),Xm=function(){function e(t,n,i){m(this,e),this.id=t,this.hostElement=n,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,ty(n,this._hostClassName)}return b(e,[{key:"listen",value:function(e,t,n,i){var r=this;if(!this._triggers.hasOwnProperty(t))throw new Error('Unable to listen on the animation trigger event "'.concat(n,'" because the animation trigger "').concat(t,"\" doesn't exist!"));if(null==n||0==n.length)throw new Error('Unable to listen on the animation trigger "'.concat(t,'" because the provided event is undefined!'));if(!function(e){return"start"==e||"done"==e}(n))throw new Error('The provided animation trigger event "'.concat(n,'" for the animation trigger "').concat(t,'" is not supported!'));var o=gg(this._elementListeners,e,[]),a={name:t,phase:n,callback:i};o.push(a);var s=gg(this._engine.statesByElement,e,{});return s.hasOwnProperty(t)||(ty(e,Rg),ty(e,Rg+"-"+t),s[t]=qm),function(){r._engine.afterFlush(function(){var e=o.indexOf(a);e>=0&&o.splice(e,1),r._triggers[t]||delete s[t]})}}},{key:"register",value:function(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}},{key:"_getTrigger",value:function(e){var t=this._triggers[e];if(!t)throw new Error('The provided animation trigger "'.concat(e,'" has not been registered!'));return t}},{key:"trigger",value:function(e,t,n){var i=this,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this._getTrigger(t),a=new Km(this.id,t,e),s=this._engine.statesByElement.get(e);s||(ty(e,Rg),ty(e,Rg+"-"+t),this._engine.statesByElement.set(e,s={}));var u=s[t],c=new Gm(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&c.absorbOptions(u.options),s[t]=c,u||(u=qm),c.value===Wm||u.value!==c.value){var l=gg(this._engine.playersByElement,e,[]);l.forEach(function(e){e.namespaceId==i.id&&e.triggerName==t&&e.queued&&e.destroy()});var h=o.matchTransition(u.value,c.value,e,c.params),f=!1;if(!h){if(!r)return;h=o.fallbackTransition,f=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:h,fromState:u,toState:c,player:a,isFallbackTransition:f}),f||(ty(e,jm),a.onStart(function(){ny(e,jm)})),a.onDone(function(){var t=i.players.indexOf(a);t>=0&&i.players.splice(t,1);var n=i._engine.playersByElement.get(e);if(n){var r=n.indexOf(a);r>=0&&n.splice(r,1)}}),this.players.push(a),l.push(a),a}if(!function(e,t){var n=Object.keys(e),i=Object.keys(t);if(n.length!=i.length)return!1;for(var r=0;r=0){for(var i=!1,r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,t)){this._namespaceList.splice(r+1,0,e),i=!0;break}i||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}},{key:"register",value:function(e,t){var n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}},{key:"registerTrigger",value:function(e,t,n){var i=this._namespaceLookup[e];i&&i.register(t,n)&&this.totalAnimations++}},{key:"destroy",value:function(e,t){var n=this;if(e){var i=this._fetchNamespace(e);this.afterFlush(function(){n.namespacesByHostElement.delete(i.hostElement),delete n._namespaceLookup[e];var t=n._namespaceList.indexOf(i);t>=0&&n._namespaceList.splice(t,1)}),this.afterFlushAnimationsDone(function(){return i.destroy(t)})}}},{key:"_fetchNamespace",value:function(e){return this._namespaceLookup[e]}},{key:"fetchNamespacesByElement",value:function(e){var t=new Set,n=this.statesByElement.get(e);if(n)for(var i=Object.keys(n),r=0;r=0&&this.collectedLeaveElements.splice(o,1)}if(e){var a=this._fetchNamespace(e);a&&a.insertNode(t,n)}i&&this.collectEnterElement(t)}}},{key:"collectEnterElement",value:function(e){this.collectedEnterElements.push(e)}},{key:"markElementAsDisabled",value:function(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),ty(e,Fm)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ny(e,Fm))}},{key:"removeNode",value:function(e,t,n,i){if(Qm(t)){var r=e?this._fetchNamespace(e):null;if(r?r.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i),n){var o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,i)}}else this._onRemovalComplete(t,i)}},{key:"markElementAsRemoved",value:function(e,t,n,i){this.collectedLeaveElements.push(t),t[Hm]={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}},{key:"listen",value:function(e,t,n,i,r){return Qm(t)?this._fetchNamespace(e).listen(t,n,i,r):function(){}}},{key:"_buildInstruction",value:function(e,t,n,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,i,e.fromState.options,e.toState.options,t,r)}},{key:"destroyInnerAnimations",value:function(e){var t=this,n=this.driver.query(e,Dg,!0);n.forEach(function(e){return t.destroyActiveAnimationsForElement(e)}),0!=this.playersByQueriedElement.size&&(n=this.driver.query(e,Lg,!0)).forEach(function(e){return t.finishActiveQueriedAnimationOnElement(e)})}},{key:"destroyActiveAnimationsForElement",value:function(e){var t=this.playersByElement.get(e);t&&t.forEach(function(e){e.queued?e.markedForDestroy=!0:e.destroy()})}},{key:"finishActiveQueriedAnimationOnElement",value:function(e){var t=this.playersByQueriedElement.get(e);t&&t.forEach(function(e){return e.finish()})}},{key:"whenRenderingDone",value:function(){var e=this;return new Promise(function(t){if(e.players.length)return hg(e.players).onDone(function(){return t()});t()})}},{key:"processLeaveNode",value:function(e){var t=this,n=e[Hm];if(n&&n.setForRemoval){if(e[Hm]=zm,n.namespaceId){this.destroyInnerAnimations(e);var i=this._fetchNamespace(n.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,n.setForRemoval)}this.driver.matchesElement(e,Bm)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Bm,!0).forEach(function(e){t.markElementAsDisabled(e,!1)})}},{key:"flush",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=[];if(this.newHostElements.size&&(this.newHostElements.forEach(function(t,n){return e._balanceNamespaceList(t,n)}),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var i=0;i=0;O--)this._namespaceList[O].drainQueuedTransitions(t).forEach(function(e){var t=e.player,o=e.element;if(E.push(t),n.collectedEnterElements.length){var l=o[Hm];if(l&&l.setForMove)return void t.destroy()}var f=!h||!n.driver.containsElement(h,o),d=x.get(o),v=p.get(o),g=n._buildInstruction(e,i,v,d,f);if(g.errors&&g.errors.length)C.push(g);else{if(f)return t.onStart(function(){return Wg(o,g.fromStyles)}),t.onDestroy(function(){return Gg(o,g.toStyles)}),void r.push(t);if(e.isFallbackTransition)return t.onStart(function(){return Wg(o,g.fromStyles)}),t.onDestroy(function(){return Gg(o,g.toStyles)}),void r.push(t);g.timelines.forEach(function(e){return e.stretchStartingKeyframe=!0}),i.append(o,g.timelines),a.push({instruction:g,player:t,element:o}),g.queriedElements.forEach(function(e){return gg(s,e,[]).push(t)}),g.preStyleProps.forEach(function(e,t){var n=Object.keys(e);if(n.length){var i=u.get(t);i||u.set(t,i=new Set),n.forEach(function(e){return i.add(e)})}}),g.postStyleProps.forEach(function(e,t){var n=Object.keys(e),i=c.get(t);i||c.set(t,i=new Set),n.forEach(function(e){return i.add(e)})})}});if(C.length){var T=[];C.forEach(function(e){T.push("@".concat(e.triggerName," has failed due to:\n")),e.errors.forEach(function(e){return T.push("- ".concat(e,"\n"))})}),E.forEach(function(e){return e.destroy()}),this.reportError(T)}var A=new Map,P=new Map;a.forEach(function(e){var t=e.element;i.has(t)&&(P.set(t,t),n._beforeAnimationBuild(e.player.namespaceId,e.instruction,A))}),r.forEach(function(e){var t=e.element;n._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach(function(e){gg(A,t,[]).push(e),e.destroy()})});var M=m.filter(function(e){return oy(e,u,c)}),I=new Map;Zm(I,this.driver,b,c,Jv).forEach(function(e){oy(e,u,c)&&M.push(e)});var R=new Map;d.forEach(function(e,t){Zm(R,n.driver,new Set(e),u,"!")}),M.forEach(function(e){var t=I.get(e),n=R.get(e);I.set(e,Object.assign(Object.assign({},t),n))});var D=[],N=[],L={};a.forEach(function(e){var t=e.element,a=e.player,s=e.instruction;if(i.has(t)){if(l.has(t))return a.onDestroy(function(){return Gg(t,s.toStyles)}),a.disabled=!0,a.overrideTotalTime(s.totalTime),void r.push(a);var u=L;if(P.size>1){for(var c=t,h=[];c=c.parentNode;){var f=P.get(c);if(f){u=f;break}h.push(c)}h.forEach(function(e){return P.set(e,u)})}var d=n._buildAnimation(a.namespaceId,s,A,o,R,I);if(a.setRealPlayer(d),u===L)D.push(a);else{var p=n.playersByElement.get(u);p&&p.length&&(a.parentPlayer=hg(p)),r.push(a)}}else Wg(t,s.fromStyles),a.onDestroy(function(){return Gg(t,s.toStyles)}),N.push(a),l.has(t)&&r.push(a)}),N.forEach(function(e){var t=o.get(e.element);if(t&&t.length){var n=hg(t);e.setRealPlayer(n)}}),r.forEach(function(e){e.parentPlayer?e.syncPlayerEvents(e.parentPlayer):e.destroy()});for(var j=0;j0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new sg(e.duration,e.delay)}}]),e}(),Km=function(){function e(t,n,i){m(this,e),this.namespaceId=t,this.triggerName=n,this.element=i,this._player=new sg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}return b(e,[{key:"setRealPlayer",value:function(e){var t=this;this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(function(n){t._queuedCallbacks[n].forEach(function(t){return dg(e,n,void 0,t)})}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}},{key:"getRealPlayer",value:function(){return this._player}},{key:"overrideTotalTime",value:function(e){this.totalTime=e}},{key:"syncPlayerEvents",value:function(e){var t=this,n=this._player;n.triggerCallback&&e.onStart(function(){return n.triggerCallback("start")}),e.onDone(function(){return t.finish()}),e.onDestroy(function(){return t.destroy()})}},{key:"_queueEvent",value:function(e,t){gg(this._queuedCallbacks,e,[]).push(t)}},{key:"onDone",value:function(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}},{key:"onStart",value:function(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}},{key:"onDestroy",value:function(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}},{key:"init",value:function(){this._player.init()}},{key:"hasStarted",value:function(){return!this.queued&&this._player.hasStarted()}},{key:"play",value:function(){!this.queued&&this._player.play()}},{key:"pause",value:function(){!this.queued&&this._player.pause()}},{key:"restart",value:function(){!this.queued&&this._player.restart()}},{key:"finish",value:function(){this._player.finish()}},{key:"destroy",value:function(){this.destroyed=!0,this._player.destroy()}},{key:"reset",value:function(){!this.queued&&this._player.reset()}},{key:"setPosition",value:function(e){this.queued||this._player.setPosition(e)}},{key:"getPosition",value:function(){return this.queued?0:this._player.getPosition()}},{key:"triggerCallback",value:function(e){var t=this._player;t.triggerCallback&&t.triggerCallback(e)}}]),e}();function Qm(e){return e&&1===e.nodeType}function $m(e,t){var n=e.style.display;return e.style.display=null!=t?t:"none",n}function Zm(e,t,n,i,r){var o=[];n.forEach(function(e){return o.push($m(e))});var a=[];i.forEach(function(n,i){var o={};n.forEach(function(e){var n=o[e]=t.computeStyle(i,e,r);(!n||0==n.length)&&(i[Hm]=Um,a.push(i))}),e.set(i,o)});var s=0;return n.forEach(function(e){return $m(e,o[s++])}),a}function Jm(e,t){var n=new Map;if(e.forEach(function(e){return n.set(e,[])}),0==t.length)return n;var i=new Set(t),r=new Map;function o(e){if(!e)return 1;var t=r.get(e);if(t)return t;var a=e.parentNode;return t=n.has(a)?a:i.has(a)?1:o(a),r.set(e,t),t}return t.forEach(function(e){var t=o(e);1!==t&&n.get(t).push(e)}),n}var ey="$$classes";function ty(e,t){if(e.classList)e.classList.add(t);else{var n=e[ey];n||(n=e[ey]={}),n[t]=!0}}function ny(e,t){if(e.classList)e.classList.remove(t);else{var n=e[ey];n&&delete n[t]}}function iy(e,t,n){hg(n).onDone(function(){return e.processLeaveNode(t)})}function ry(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:-1;this._transitionEngine.flush(e)}},{key:"players",get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)}},{key:"whenRenderingDone",value:function(){return this._transitionEngine.whenRenderingDone()}}]),e}();function sy(e,t){var n=null,i=null;return Array.isArray(t)&&t.length?(n=cy(t[0]),t.length>1&&(i=cy(t[t.length-1]))):t&&(n=cy(t)),n||i?new uy(e,n,i):null}var uy=function(){function e(t,n,i){m(this,e),this._element=t,this._startStyles=n,this._endStyles=i,this._state=0;var r=e.initialStylesByElement.get(t);r||e.initialStylesByElement.set(t,r={}),this._initialStyles=r}return b(e,[{key:"start",value:function(){this._state<1&&(this._startStyles&&Gg(this._element,this._startStyles,this._initialStyles),this._state=1)}},{key:"finish",value:function(){this.start(),this._state<2&&(Gg(this._element,this._initialStyles),this._endStyles&&(Gg(this._element,this._endStyles),this._endStyles=null),this._state=1)}},{key:"destroy",value:function(){this.finish(),this._state<3&&(e.initialStylesByElement.delete(this._element),this._startStyles&&(Wg(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Wg(this._element,this._endStyles),this._endStyles=null),Gg(this._element,this._initialStyles),this._state=3)}}]),e}();function cy(e){for(var t=null,n=Object.keys(e),i=0;i=this._delay&&n>=this._duration&&this.finish()}},{key:"finish",value:function(){this._finished||(this._finished=!0,this._onDoneFn(),my(this._element,this._eventFn,!0))}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.finish(),function(e,t){var n=by(e,"").split(","),i=gy(n,t);i>=0&&(n.splice(i,1),yy(e,"",n.join(",")))}(this._element,this._name))}}]),e}();function py(e,t,n){yy(e,"PlayState",n,vy(e,t))}function vy(e,t){var n=by(e,"");return n.indexOf(",")>0?gy(n.split(","),t):gy([n],t)}function gy(e,t){for(var n=0;n=0)return n;return-1}function my(e,t,n){n?e.removeEventListener(fy,t):e.addEventListener(fy,t)}function yy(e,t,n,i){var r=hy+t;if(null!=i){var o=e.style[r];if(o.length){var a=o.split(",");a[i]=n,n=a.join(",")}}e.style[r]=n}function by(e,t){return e.style[hy+t]||""}var _y=function(){function e(t,n,i,r,o,a,s,u){m(this,e),this.element=t,this.keyframes=n,this.animationName=i,this._duration=r,this._delay=o,this._finalStyles=s,this._specialStyles=u,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=a||"linear",this.totalTime=r+o,this._buildStyler()}return b(e,[{key:"onStart",value:function(e){this._onStartFns.push(e)}},{key:"onDone",value:function(e){this._onDoneFns.push(e)}},{key:"onDestroy",value:function(e){this._onDestroyFns.push(e)}},{key:"destroy",value:function(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])}},{key:"_flushDoneFns",value:function(){this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[]}},{key:"_flushStartFns",value:function(){this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[]}},{key:"finish",value:function(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}},{key:"setPosition",value:function(e){this._styler.setPosition(e)}},{key:"getPosition",value:function(){return this._styler.getPosition()}},{key:"hasStarted",value:function(){return this._state>=2}},{key:"init",value:function(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}},{key:"play",value:function(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}},{key:"pause",value:function(){this.init(),this._styler.pause()}},{key:"restart",value:function(){this.reset(),this.play()}},{key:"reset",value:function(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}},{key:"_buildStyler",value:function(){var e=this;this._styler=new dy(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",function(){return e.finish()})}},{key:"triggerCallback",value:function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0}},{key:"beforeDestroy",value:function(){var e=this;this.init();var t={};if(this.hasStarted()){var n=this._state>=3;Object.keys(this._finalStyles).forEach(function(i){"offset"!=i&&(t[i]=n?e._finalStyles[i]:im(e.element,i))})}this.currentSnapshot=t}}]),e}(),wy=function(t){a(i,t);var n=s(i);function i(e,t){var r;return m(this,i),(r=n.call(this)).element=e,r._startingStyles={},r.__initialized=!1,r._styles=Tg(t),r}return b(i,[{key:"init",value:function(){var t=this;this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(function(e){t._startingStyles[e]=t.element.style[e]}),e(p(i.prototype),"init",this).call(this))}},{key:"play",value:function(){var t=this;!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(function(e){return t.element.style.setProperty(e,t._styles[e])}),e(p(i.prototype),"play",this).call(this))}},{key:"destroy",value:function(){var t=this;!this._startingStyles||(Object.keys(this._startingStyles).forEach(function(e){var n=t._startingStyles[e];n?t.element.style.setProperty(e,n):t.element.style.removeProperty(e)}),this._startingStyles=null,e(p(i.prototype),"destroy",this).call(this))}}]),i}(sg),ky=function(){function e(){m(this,e),this._count=0}return b(e,[{key:"validateStyleProperty",value:function(e){return Sg(e)}},{key:"matchesElement",value:function(e,t){return Eg(e,t)}},{key:"containsElement",value:function(e,t){return Cg(e,t)}},{key:"query",value:function(e,t,n){return Og(e,t,n)}},{key:"computeStyle",value:function(e,t,n){return window.getComputedStyle(e)[t]}},{key:"buildKeyframeElement",value:function(e,t,n){n=n.map(function(e){return Tg(e)});var i="@keyframes ".concat(t," {\n"),r="";n.forEach(function(e){r=" ";var t=parseFloat(e.offset);i+="".concat(r).concat(100*t,"% {\n"),r+=" ",Object.keys(e).forEach(function(t){var n=e[t];switch(t){case"offset":return;case"easing":return void(n&&(i+="".concat(r,"animation-timing-function: ").concat(n,";\n")));default:return void(i+="".concat(r).concat(t,": ").concat(n,";\n"))}}),i+="".concat(r,"}\n")}),i+="}\n";var o=document.createElement("style");return o.textContent=i,o}},{key:"animate",value:function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=o.filter(function(e){return e instanceof _y}),s={};em(n,i)&&a.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return s[e]=t[e]})});var u=function(e){var t={};return e&&(Array.isArray(e)?e:[e]).forEach(function(e){Object.keys(e).forEach(function(n){"offset"==n||"easing"==n||(t[n]=e[n])})}),t}(t=tm(e,t,s));if(0==n)return new wy(e,u);var c="gen_css_kf_"+this._count++,l=this.buildKeyframeElement(e,c,t);(function(e){var t,n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e);return"undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot?n:document.head})(e).appendChild(l);var h=sy(e,t),f=new _y(e,t,c,n,i,r,u,h);return f.onDestroy(function(){return function(e){e.parentNode.removeChild(e)}(l)}),f}}]),e}(),xy=function(){function e(t,n,i,r){m(this,e),this.element=t,this.keyframes=n,this.options=i,this._specialStyles=r,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}return b(e,[{key:"_onFinish",value:function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])}},{key:"init",value:function(){this._buildPlayer(),this._preparePlayerBeforeStart()}},{key:"_buildPlayer",value:function(){var e=this;if(!this._initialized){this._initialized=!0;var t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",function(){return e._onFinish()})}}},{key:"_preparePlayerBeforeStart",value:function(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}},{key:"_triggerWebAnimation",value:function(e,t,n){return e.animate(t,n)}},{key:"onStart",value:function(e){this._onStartFns.push(e)}},{key:"onDone",value:function(e){this._onDoneFns.push(e)}},{key:"onDestroy",value:function(e){this._onDestroyFns.push(e)}},{key:"play",value:function(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}},{key:"pause",value:function(){this.init(),this.domPlayer.pause()}},{key:"finish",value:function(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}},{key:"reset",value:function(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}},{key:"_resetDomPlayerState",value:function(){this.domPlayer&&this.domPlayer.cancel()}},{key:"restart",value:function(){this.reset(),this.play()}},{key:"hasStarted",value:function(){return this._started}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])}},{key:"setPosition",value:function(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}},{key:"getPosition",value:function(){return this.domPlayer.currentTime/this.time}},{key:"totalTime",get:function(){return this._delay+this._duration}},{key:"beforeDestroy",value:function(){var e=this,t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(function(n){"offset"!=n&&(t[n]=e._finished?e._finalKeyframe[n]:im(e.element,n))}),this.currentSnapshot=t}},{key:"triggerCallback",value:function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0}}]),e}(),Sy=function(){function e(){m(this,e),this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Ey().toString()),this._cssKeyframesDriver=new ky}return b(e,[{key:"validateStyleProperty",value:function(e){return Sg(e)}},{key:"matchesElement",value:function(e,t){return Eg(e,t)}},{key:"containsElement",value:function(e,t){return Cg(e,t)}},{key:"query",value:function(e,t,n){return Og(e,t,n)}},{key:"computeStyle",value:function(e,t,n){return window.getComputedStyle(e)[t]}},{key:"overrideWebAnimationsSupport",value:function(e){this._isNativeImpl=e}},{key:"animate",value:function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=arguments.length>6?arguments[6]:void 0;if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,n,i,r,o);var s={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(s.easing=r);var u={},c=o.filter(function(e){return e instanceof xy});em(n,i)&&c.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return u[e]=t[e]})});var l=sy(e,t=tm(e,t=t.map(function(e){return zg(e,!1)}),u));return new xy(e,t,s,l)}}]),e}();function Ey(){return cg()&&Element.prototype.animate||{}}var Cy=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this))._nextAnimationId=0,r._renderer=e.createRenderer(i.body,{id:"0",encapsulation:lt.None,styles:[],data:{animation:[]}}),r}return b(n,[{key:"build",value:function(e){var t=this._nextAnimationId.toString();this._nextAnimationId++;var n=Array.isArray(e)?ng(e):e;return Ay(this._renderer,null,t,"register",[n]),new Oy(t,this._renderer)}}]),n}(Zv);return e.\u0275fac=function(t){return new(t||e)(Qi($u),Qi(fh))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Oy=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this))._id=e,r._renderer=i,r}return b(n,[{key:"create",value:function(e,t){return new Ty(this._id,e,t||{},this._renderer)}}]),n}(function(){return function e(){m(this,e)}}()),Ty=function(){function e(t,n,i,r){m(this,e),this.id=t,this.element=n,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}return b(e,[{key:"_listen",value:function(e,t){return this._renderer.listen(this.element,"@@".concat(this.id,":").concat(e),t)}},{key:"_command",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i=0&&e3&&void 0!==arguments[3])||arguments[3];this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,i)}},{key:"removeChild",value:function(e,t,n){this.engine.onRemove(this.namespaceId,t,this.delegate,n)}},{key:"selectRootElement",value:function(e,t){return this.delegate.selectRootElement(e,t)}},{key:"parentNode",value:function(e){return this.delegate.parentNode(e)}},{key:"nextSibling",value:function(e){return this.delegate.nextSibling(e)}},{key:"setAttribute",value:function(e,t,n,i){this.delegate.setAttribute(e,t,n,i)}},{key:"removeAttribute",value:function(e,t,n){this.delegate.removeAttribute(e,t,n)}},{key:"addClass",value:function(e,t){this.delegate.addClass(e,t)}},{key:"removeClass",value:function(e,t){this.delegate.removeClass(e,t)}},{key:"setStyle",value:function(e,t,n,i){this.delegate.setStyle(e,t,n,i)}},{key:"removeStyle",value:function(e,t,n){this.delegate.removeStyle(e,t,n)}},{key:"setProperty",value:function(e,t,n){"@"==t.charAt(0)&&t==Py?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}},{key:"setValue",value:function(e,t){this.delegate.setValue(e,t)}},{key:"listen",value:function(e,t,n){return this.delegate.listen(e,t,n)}},{key:"disableAnimations",value:function(e,t){this.engine.disableAnimations(e,t)}}]),e}(),Ry=function(e){a(i,e);var n=s(i);function i(e,t,r,o){var a;return m(this,i),(a=n.call(this,t,r,o)).factory=e,a.namespaceId=t,a}return b(i,[{key:"setProperty",value:function(e,t,n){"@"==t.charAt(0)?"."==t.charAt(1)&&t==Py?this.disableAnimations(e,n=void 0===n||!!n):this.engine.process(this.namespaceId,e,t.substr(1),n):this.delegate.setProperty(e,t,n)}},{key:"listen",value:function(e,n,i){var r=this;if("@"==n.charAt(0)){var o,a=function(e){switch(e){case"body":return document.body;case"document":return document;case"window":return window;default:return e}}(e),s=n.substr(1),u="";return"@"!=s.charAt(0)&&(s=(o=t(function(e){var t=e.indexOf(".");return[e.substring(0,t),e.substr(t+1)]}(s),2))[0],u=o[1]),this.engine.listen(this.namespaceId,a,s,u,function(e){r.factory.scheduleListenerCallback(e._data||-1,i,e)})}return this.delegate.listen(e,n,i)}}]),i}(Iy),Dy=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r){return m(this,n),t.call(this,e.body,i,r)}return b(n,[{key:"ngOnDestroy",value:function(){this.flush()}}]),n}(ay);return e.\u0275fac=function(t){return new(t||e)(Qi(fh),Qi(Pg),Qi(Cm))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Ny=new Mi("AnimationModuleType"),Ly=[{provide:Zv,useClass:Cy},{provide:Cm,useFactory:function(){return new Om}},{provide:ay,useClass:Dy},{provide:$u,useFactory:function(e,t,n){return new My(e,t,n)},deps:[mf,ay,Vl]}],jy=[{provide:Pg,useFactory:function(){return"function"==typeof Ey()?new Sy:new ky}},{provide:Ny,useValue:"BrowserAnimations"}].concat(Ly),Fy=[{provide:Pg,useClass:Ag},{provide:Ny,useValue:"NoopAnimations"}].concat(Ly),By=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"withConfig",value:function(t){return{ngModule:e,providers:t.disableAnimations?Fy:jy}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:jy,imports:[Mf]}),e}();function Vy(e,t){if(1&e&&Ps(0,"mat-pseudo-checkbox",4),2&e){var n=Hs();Cs("state",n.selected?"checked":"unchecked")("disabled",n.disabled)}}function zy(e,t){if(1&e&&(Ts(0,"span",5),ku(1),As()),2&e){var n=Hs();qo(1),Su("(",n.group.label,")")}}var Uy=["*"],Hy=new tc("12.2.5"),Gy=new Mi("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}}),Wy=function(){var e=function(){function e(t,n,i){m(this,e),this._hasDoneGlobalChecks=!1,this._document=i,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=n,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}return b(e,[{key:"_getWindow",value:function(){var e=this._document.defaultView||window;return"object"==typeof e&&e?e:null}},{key:"_checkIsEnabled",value:function(e){return!(!Jl()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[e])}},{key:"_isTestEnv",value:function(){var e=this._getWindow();return e&&(e.__karma__||e.jasmine)}},{key:"_checkDoctypeIsDefined",value:function(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}},{key:"_checkThemeIsPresent",value:function(){if(this._checkIsEnabled("theme")&&this._document.body&&"function"==typeof getComputedStyle){var e=this._document.createElement("div");e.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(e);var t=getComputedStyle(e);t&&"none"!==t.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(e)}}},{key:"_checkCdkVersionMatch",value:function(){this._checkIsEnabled("version")&&Hy.full!==$v.full&&console.warn("The Angular Material version ("+Hy.full+") does not match the Angular CDK version ("+$v.full+").\nPlease ensure the versions of these two packages exactly match.")}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Kv),Qi(Gy,8),Qi(fh))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Ud],Ud]}),e}();function qy(e){return function(e){a(n,e);var t=s(n);function n(){var e;m(this,n);for(var i=arguments.length,r=new Array(i),o=0;o1&&void 0!==arguments[1]?arguments[1]:0;return function(e){a(i,e);var n=s(i);function i(){var e;m(this,i);for(var r=arguments.length,o=new Array(r),a=0;a2&&void 0!==arguments[2]?arguments[2]:{},r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),o=Object.assign(Object.assign({},Jy),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);var a=i.radius||function(e,t,n){var i=Math.max(Math.abs(e-n.left),Math.abs(e-n.right)),r=Math.max(Math.abs(t-n.top),Math.abs(t-n.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),s=e-r.left,u=t-r.top,c=o.enterDuration,l=document.createElement("div");l.classList.add("mat-ripple-element"),l.style.left=s-a+"px",l.style.top=u-a+"px",l.style.height=2*a+"px",l.style.width=2*a+"px",null!=i.color&&(l.style.backgroundColor=i.color),l.style.transitionDuration="".concat(c,"ms"),this._containerElement.appendChild(l),function(e){window.getComputedStyle(e).getPropertyValue("opacity")}(l),l.style.transform="scale(1)";var h=new Zy(this,l,i);return h.state=0,this._activeRipples.add(h),i.persistent||(this._mostRecentTransientRipple=h),this._runTimeoutOutsideZone(function(){var e=h===n._mostRecentTransientRipple;h.state=1,!i.persistent&&(!e||!n._isPointerDown)&&h.fadeOut()},c),h}},{key:"fadeOutRipple",value:function(e){var t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),t){var n=e.element,i=Object.assign(Object.assign({},Jy),e.config.animation);n.style.transitionDuration="".concat(i.exitDuration,"ms"),n.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(function(){e.state=3,n.parentNode.removeChild(n)},i.exitDuration)}}},{key:"fadeOutAll",value:function(){this._activeRipples.forEach(function(e){return e.fadeOut()})}},{key:"fadeOutAllNonPersistent",value:function(){this._activeRipples.forEach(function(e){e.config.persistent||e.fadeOut()})}},{key:"setupTriggerEvents",value:function(e){var t=Lf(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(tb))}},{key:"handleEvent",value:function(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(nb),this._pointerUpEventsRegistered=!0)}},{key:"_onMousedown",value:function(e){var t=Dv(e),n=this._lastTouchStartEvent&&Date.now()1&&void 0!==arguments[1]?arguments[1]:0;this._ngZone.runOutsideAngular(function(){return setTimeout(e,t)})}},{key:"_registerEvents",value:function(e){var t=this;this._ngZone.runOutsideAngular(function(){e.forEach(function(e){t._triggerElement.addEventListener(e,t,eb)})})}},{key:"_removeTriggerEvents",value:function(){var e=this;this._triggerElement&&(tb.forEach(function(t){e._triggerElement.removeEventListener(t,e,eb)}),this._pointerUpEventsRegistered&&nb.forEach(function(t){e._triggerElement.removeEventListener(t,e,eb)}))}}]),e}(),rb=new Mi("mat-ripple-global-options"),ob=function(){var e=function(){function e(t,n,i,r,o){m(this,e),this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=r||{},this._rippleRenderer=new ib(this,n,t,i)}return b(e,[{key:"disabled",get:function(){return this._disabled},set:function(e){e&&this.fadeOutAllNonPersistent(),this._disabled=e,this._setupTriggerEventsIfEnabled()}},{key:"trigger",get:function(){return this._trigger||this._elementRef.nativeElement},set:function(e){this._trigger=e,this._setupTriggerEventsIfEnabled()}},{key:"ngOnInit",value:function(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}},{key:"ngOnDestroy",value:function(){this._rippleRenderer._removeTriggerEvents()}},{key:"fadeOutAll",value:function(){this._rippleRenderer.fadeOutAll()}},{key:"fadeOutAllNonPersistent",value:function(){this._rippleRenderer.fadeOutAllNonPersistent()}},{key:"rippleConfig",get:function(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}},{key:"rippleDisabled",get:function(){return this.disabled||!!this._globalOptions.disabled}},{key:"_setupTriggerEventsIfEnabled",value:function(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}},{key:"launch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;return"number"==typeof e?this._rippleRenderer.fadeInRipple(e,t,Object.assign(Object.assign({},this.rippleConfig),n)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Vl),Es(Id),Es(rb,8),Es(Ny,8))},e.\u0275dir=It({type:e,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(e,t){2&e&&su("mat-ripple-unbounded",t.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),e}(),ab=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Wy,Rd],Wy]}),e}(),sb=function(){var e=function e(t){m(this,e),this._animationMode=t,this.state="unchecked",this.disabled=!1};return e.\u0275fac=function(t){return new(t||e)(Es(Ny,8))},e.\u0275cmp=Ct({type:e,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(e,t){2&e&&su("mat-pseudo-checkbox-indeterminate","indeterminate"===t.state)("mat-pseudo-checkbox-checked","checked"===t.state)("mat-pseudo-checkbox-disabled",t.disabled)("_mat-animation-noopable","NoopAnimations"===t._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(e,t){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),e}(),ub=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Wy]]}),e}(),cb=new Mi("MAT_OPTION_PARENT_COMPONENT"),lb=qy(function(){return function e(){m(this,e)}}()),hb=0,fb=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i,r;return m(this,n),(i=t.call(this))._labelId="mat-optgroup-label-"+hb++,i._inert=null!==(r=null==e?void 0:e.inertGroups)&&void 0!==r&&r,i}return n}(lb);return e.\u0275fac=function(t){return new(t||e)(Es(cb,8))},e.\u0275dir=It({type:e,inputs:{label:"label"},features:[ss]}),e}(),db=new Mi("MatOptgroup"),pb=0,vb=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e),this.source=t,this.isUserInput=n},gb=function(){var e=function(){function e(t,n,i,r){m(this,e),this._element=t,this._changeDetectorRef=n,this._parent=i,this.group=r,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+pb++,this.onSelectionChange=new Zc,this._stateChanges=new oe}return b(e,[{key:"multiple",get:function(){return this._parent&&this._parent.multiple}},{key:"selected",get:function(){return this._selected}},{key:"disabled",get:function(){return this.group&&this.group.disabled||this._disabled},set:function(e){this._disabled=If(e)}},{key:"disableRipple",get:function(){return this._parent&&this._parent.disableRipple}},{key:"active",get:function(){return this._active}},{key:"viewValue",get:function(){return(this._getHostElement().textContent||"").trim()}},{key:"select",value:function(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}},{key:"deselect",value:function(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}},{key:"focus",value:function(e,t){var n=this._getHostElement();"function"==typeof n.focus&&n.focus(t)}},{key:"setActiveStyles",value:function(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}},{key:"setInactiveStyles",value:function(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}},{key:"getLabel",value:function(){return this.viewValue}},{key:"_handleKeydown",value:function(e){(13===e.keyCode||32===e.keyCode)&&!fp(e)&&(this._selectViaInteraction(),e.preventDefault())}},{key:"_selectViaInteraction",value:function(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}},{key:"_getAriaSelected",value:function(){return this.selected||!this.multiple&&null}},{key:"_getTabIndex",value:function(){return this.disabled?"-1":"0"}},{key:"_getHostElement",value:function(){return this._element.nativeElement}},{key:"ngAfterViewChecked",value:function(){if(this._selected){var e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue=e,this._stateChanges.next())}}},{key:"ngOnDestroy",value:function(){this._stateChanges.complete()}},{key:"_emitSelectionChangeEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.onSelectionChange.emit(new vb(this,e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(wc),Es(void 0),Es(fb))},e.\u0275dir=It({type:e,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),e}(),mb=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o){return m(this,n),t.call(this,e,i,r,o)}return n}(gb);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(wc),Es(cb,8),Es(db,8))},e.\u0275cmp=Ct({type:e,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(e,t){1&e&&Fs("click",function(){return t._selectViaInteraction()})("keydown",function(e){return t._handleKeydown(e)}),2&e&&(Ou("id",t.id),_s("tabindex",t._getTabIndex())("aria-selected",t._getAriaSelected())("aria-disabled",t.disabled.toString()),su("mat-selected",t.selected)("mat-option-multiple",t.multiple)("mat-active",t.active)("mat-option-disabled",t.disabled))},exportAs:["matOption"],features:[ss],ngContentSelectors:Uy,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(e,t){1&e&&(Ws(),xs(0,Vy,1,2,"mat-pseudo-checkbox",0),Ts(1,"span",1),qs(2),As(),xs(3,zy,2,1,"span",2),Ps(4,"div",3)),2&e&&(Cs("ngIf",t.multiple),qo(3),Cs("ngIf",t.group&&t.group._inert),qo(1),Cs("matRippleTrigger",t._getHostElement())("matRippleDisabled",t.disabled||t.disableRipple))},directives:[Lh,ob,sb],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),e}();function yb(e,t,n){if(n.length){for(var i=t.toArray(),r=n.toArray(),o=0,a=0;an+i?Math.max(0,e-i+t):n}var _b=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[ab,Kh,Wy,ub]]}),e}();function wb(){for(var e=arguments.length,t=new Array(e),n=0;n0){var i=e.slice(0,t),r=i.toLowerCase(),o=e.slice(t+1).trim();n.maybeSetNormalizedName(i,r),n.headers.has(r)?n.headers.get(r).push(o):n.headers.set(r,[o])}})}:function(){n.headers=new Map,Object.keys(t).forEach(function(e){var i=t[e],r=e.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(n.headers.set(r,i),n.maybeSetNormalizedName(e,r))})}:this.headers=new Map}return b(e,[{key:"has",value:function(e){return this.init(),this.headers.has(e.toLowerCase())}},{key:"get",value:function(e){this.init();var t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}},{key:"keys",value:function(){return this.init(),Array.from(this.normalizedNames.values())}},{key:"getAll",value:function(e){return this.init(),this.headers.get(e.toLowerCase())||null}},{key:"append",value:function(e,t){return this.clone({name:e,value:t,op:"a"})}},{key:"set",value:function(e,t){return this.clone({name:e,value:t,op:"s"})}},{key:"delete",value:function(e,t){return this.clone({name:e,value:t,op:"d"})}},{key:"maybeSetNormalizedName",value:function(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}},{key:"init",value:function(){var t=this;this.lazyInit&&(this.lazyInit instanceof e?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(function(e){return t.applyUpdate(e)}),this.lazyUpdate=null))}},{key:"copyFrom",value:function(e){var t=this;e.init(),Array.from(e.headers.keys()).forEach(function(n){t.headers.set(n,e.headers.get(n)),t.normalizedNames.set(n,e.normalizedNames.get(n))})}},{key:"clone",value:function(t){var n=new e;return n.lazyInit=this.lazyInit&&this.lazyInit instanceof e?this.lazyInit:this,n.lazyUpdate=(this.lazyUpdate||[]).concat([t]),n}},{key:"applyUpdate",value:function(e){var t=e.name.toLowerCase();switch(e.op){case"a":case"s":var n=e.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(e.name,t);var i=("a"===e.op?this.headers.get(t):void 0)||[];i.push.apply(i,v(n)),this.headers.set(t,i);break;case"d":var r=e.value;if(r){var o=this.headers.get(t);if(!o)return;0===(o=o.filter(function(e){return-1===r.indexOf(e)})).length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}},{key:"forEach",value:function(e){var t=this;this.init(),Array.from(this.normalizedNames.keys()).forEach(function(n){return e(t.normalizedNames.get(n),t.headers.get(n))})}}]),e}(),Ib=function(){function e(){m(this,e)}return b(e,[{key:"encodeKey",value:function(e){return Nb(e)}},{key:"encodeValue",value:function(e){return Nb(e)}},{key:"decodeKey",value:function(e){return decodeURIComponent(e)}},{key:"decodeValue",value:function(e){return decodeURIComponent(e)}}]),e}(),Rb=/%(\d[a-f0-9])/gi,Db={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Nb(e){return encodeURIComponent(e).replace(Rb,function(e,t){var n;return null!==(n=Db[t])&&void 0!==n?n:e})}function Lb(e){return"".concat(e)}var jb=function(){function e(){var n=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(m(this,e),this.updates=null,this.cloneFrom=null,this.encoder=i.encoder||new Ib,i.fromString){if(i.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,n){var i=new Map;return e.length>0&&e.replace(/^\?/,"").split("&").forEach(function(e){var r=e.indexOf("="),o=t(-1==r?[n.decodeKey(e),""]:[n.decodeKey(e.slice(0,r)),n.decodeValue(e.slice(r+1))],2),a=o[0],s=o[1],u=i.get(a)||[];u.push(s),i.set(a,u)}),i}(i.fromString,this.encoder)}else i.fromObject?(this.map=new Map,Object.keys(i.fromObject).forEach(function(e){var t=i.fromObject[e];n.map.set(e,Array.isArray(t)?t:[t])})):this.map=null}return b(e,[{key:"has",value:function(e){return this.init(),this.map.has(e)}},{key:"get",value:function(e){this.init();var t=this.map.get(e);return t?t[0]:null}},{key:"getAll",value:function(e){return this.init(),this.map.get(e)||null}},{key:"keys",value:function(){return this.init(),Array.from(this.map.keys())}},{key:"append",value:function(e,t){return this.clone({param:e,value:t,op:"a"})}},{key:"appendAll",value:function(e){var t=[];return Object.keys(e).forEach(function(n){var i=e[n];Array.isArray(i)?i.forEach(function(e){t.push({param:n,value:e,op:"a"})}):t.push({param:n,value:i,op:"a"})}),this.clone(t)}},{key:"set",value:function(e,t){return this.clone({param:e,value:t,op:"s"})}},{key:"delete",value:function(e,t){return this.clone({param:e,value:t,op:"d"})}},{key:"toString",value:function(){var e=this;return this.init(),this.keys().map(function(t){var n=e.encoder.encodeKey(t);return e.map.get(t).map(function(t){return n+"="+e.encoder.encodeValue(t)}).join("&")}).filter(function(e){return""!==e}).join("&")}},{key:"clone",value:function(t){var n=new e({encoder:this.encoder});return n.cloneFrom=this.cloneFrom||this,n.updates=(this.updates||[]).concat(t),n}},{key:"init",value:function(){var e=this;null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(function(t){return e.map.set(t,e.cloneFrom.map.get(t))}),this.updates.forEach(function(t){switch(t.op){case"a":case"s":var n=("a"===t.op?e.map.get(t.param):void 0)||[];n.push(Lb(t.value)),e.map.set(t.param,n);break;case"d":if(void 0===t.value){e.map.delete(t.param);break}var i=e.map.get(t.param)||[],r=i.indexOf(Lb(t.value));-1!==r&&i.splice(r,1),i.length>0?e.map.set(t.param,i):e.map.delete(t.param)}}),this.cloneFrom=this.updates=null)}}]),e}(),Fb=function(){function e(){m(this,e),this.map=new Map}return b(e,[{key:"set",value:function(e,t){return this.map.set(e,t),this}},{key:"get",value:function(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}},{key:"delete",value:function(e){return this.map.delete(e),this}},{key:"keys",value:function(){return this.map.keys()}}]),e}();function Bb(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function Vb(e){return"undefined"!=typeof Blob&&e instanceof Blob}function zb(e){return"undefined"!=typeof FormData&&e instanceof FormData}var Ub=function(){function e(t,n,i,r){var o;if(m(this,e),this.url=n,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==i?i:null,o=r):o=i,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params)),this.headers||(this.headers=new Mb),this.context||(this.context=new Fb),this.params){var a=this.params.toString();if(0===a.length)this.urlWithParams=n;else{var s=n.indexOf("?");this.urlWithParams=n+(-1===s?"?":s0&&void 0!==arguments[0]?arguments[0]:{},i=n.method||this.method,r=n.url||this.url,o=n.responseType||this.responseType,a=void 0!==n.body?n.body:this.body,s=void 0!==n.withCredentials?n.withCredentials:this.withCredentials,u=void 0!==n.reportProgress?n.reportProgress:this.reportProgress,c=n.headers||this.headers,l=n.params||this.params,h=null!==(t=n.context)&&void 0!==t?t:this.context;return void 0!==n.setHeaders&&(c=Object.keys(n.setHeaders).reduce(function(e,t){return e.set(t,n.setHeaders[t])},c)),n.setParams&&(l=Object.keys(n.setParams).reduce(function(e,t){return e.set(t,n.setParams[t])},l)),new e(i,r,a,{params:l,headers:c,context:h,reportProgress:u,responseType:o,withCredentials:s})}}]),e}(),Hb=((Hb=Hb||{})[Hb.Sent=0]="Sent",Hb[Hb.UploadProgress=1]="UploadProgress",Hb[Hb.ResponseHeader=2]="ResponseHeader",Hb[Hb.DownloadProgress=3]="DownloadProgress",Hb[Hb.Response=4]="Response",Hb[Hb.User=5]="User",Hb),Gb=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"OK";m(this,e),this.headers=t.headers||new Mb,this.status=void 0!==t.status?t.status:n,this.statusText=t.statusText||i,this.url=t.url||null,this.ok=this.status>=200&&this.status<300},Wb=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m(this,n),(e=t.call(this,i)).type=Hb.ResponseHeader,e}return b(n,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new n({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}]),n}(Gb),qb=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m(this,n),(e=t.call(this,i)).type=Hb.Response,e.body=void 0!==i.body?i.body:null,e}return b(n,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new n({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}]),n}(Gb),Xb=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,e,0,"Unknown Error")).name="HttpErrorResponse",i.ok=!1,i.message=i.status>=200&&i.status<300?"Http failure during parsing for ".concat(e.url||"(unknown url)"):"Http failure response for ".concat(e.url||"(unknown url)",": ").concat(e.status," ").concat(e.statusText),i.error=e.error||null,i}return n}(Gb);function Yb(e,t){return{body:t,headers:e.headers,context:e.context,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}var Kb=function(){var e=function(){function e(t){m(this,e),this.handler=t}return b(e,[{key:"request",value:function(e,t){var n,i,r,o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e instanceof Ub?n=e:(i=a.headers instanceof Mb?a.headers:new Mb(a.headers),a.params&&(r=a.params instanceof jb?a.params:new jb({fromObject:a.params})),n=new Ub(e,t,void 0!==a.body?a.body:null,{headers:i,context:a.context,params:r,reportProgress:a.reportProgress,responseType:a.responseType||"json",withCredentials:a.withCredentials}));var s=jf(n).pipe(we(function(e){return o.handler.handle(e)},void 0,1));if(e instanceof Ub||"events"===a.observe)return s;var u=s.pipe(od(function(e){return e instanceof qb}));switch(a.observe||"body"){case"body":switch(n.responseType){case"arraybuffer":return u.pipe(ue(function(e){if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body}));case"blob":return u.pipe(ue(function(e){if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body}));case"text":return u.pipe(ue(function(e){if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body}));case"json":default:return u.pipe(ue(function(e){return e.body}))}case"response":return u;default:throw new Error("Unreachable: unhandled observe type ".concat(a.observe,"}"))}}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("DELETE",e,t)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("GET",e,t)}},{key:"head",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("HEAD",e,t)}},{key:"jsonp",value:function(e,t){return this.request("JSONP",e,{params:(new jb).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}},{key:"options",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("OPTIONS",e,t)}},{key:"patch",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PATCH",e,Yb(n,t))}},{key:"post",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",e,Yb(n,t))}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",e,Yb(n,t))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Ab))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Qb=function(){function e(t,n){m(this,e),this.next=t,this.interceptor=n}return b(e,[{key:"handle",value:function(e){return this.interceptor.intercept(e,this.next)}}]),e}(),$b=new Mi("HTTP_INTERCEPTORS"),Zb=function(){var e=function(){function e(){m(this,e)}return b(e,[{key:"intercept",value:function(e,t){return t.handle(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),Jb=/^\)\]\}',?\n/,e_=function(){var e=function(){function e(t){m(this,e),this.xhrFactory=t}return b(e,[{key:"handle",value:function(e){var t=this;if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new ee(function(n){var i=t.xhrFactory.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach(function(e,t){return i.setRequestHeader(e,t.join(","))}),e.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){var r=e.detectContentTypeHeader();null!==r&&i.setRequestHeader("Content-Type",r)}if(e.responseType){var o=e.responseType.toLowerCase();i.responseType="json"!==o?o:"text"}var a=e.serializeBody(),s=null,u=function(){if(null!==s)return s;var t=1223===i.status?204:i.status,n=i.statusText||"OK",r=new Mb(i.getAllResponseHeaders()),o=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(i)||e.url;return s=new Wb({headers:r,status:t,statusText:n,url:o})},c=function(){var t=u(),r=t.headers,o=t.status,a=t.statusText,s=t.url,c=null;204!==o&&(c=void 0===i.response?i.responseText:i.response),0===o&&(o=c?200:0);var l=o>=200&&o<300;if("json"===e.responseType&&"string"==typeof c){var h=c;c=c.replace(Jb,"");try{c=""!==c?JSON.parse(c):null}catch(f){c=h,l&&(l=!1,c={error:f,text:c})}}l?(n.next(new qb({body:c,headers:r,status:o,statusText:a,url:s||void 0})),n.complete()):n.error(new Xb({error:c,headers:r,status:o,statusText:a,url:s||void 0}))},l=function(e){var t=u().url,r=new Xb({error:e,status:i.status||0,statusText:i.statusText||"Unknown Error",url:t||void 0});n.error(r)},h=!1,f=function(t){h||(n.next(u()),h=!0);var r={type:Hb.DownloadProgress,loaded:t.loaded};t.lengthComputable&&(r.total=t.total),"text"===e.responseType&&!!i.responseText&&(r.partialText=i.responseText),n.next(r)},d=function(e){var t={type:Hb.UploadProgress,loaded:e.loaded};e.lengthComputable&&(t.total=e.total),n.next(t)};return i.addEventListener("load",c),i.addEventListener("error",l),i.addEventListener("timeout",l),i.addEventListener("abort",l),e.reportProgress&&(i.addEventListener("progress",f),null!==a&&i.upload&&i.upload.addEventListener("progress",d)),i.send(a),n.next({type:Hb.Sent}),function(){i.removeEventListener("error",l),i.removeEventListener("abort",l),i.removeEventListener("load",c),i.removeEventListener("timeout",l),e.reportProgress&&(i.removeEventListener("progress",f),null!==a&&i.upload&&i.upload.removeEventListener("progress",d)),i.readyState!==i.DONE&&i.abort()}})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Jh))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),t_=new Mi("XSRF_COOKIE_NAME"),n_=new Mi("XSRF_HEADER_NAME"),i_=function e(){m(this,e)},r_=function(){var e=function(){function e(t,n,i){m(this,e),this.doc=t,this.platform=n,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}return b(e,[{key:"getToken",value:function(){if("server"===this.platform)return null;var e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=Mh(e,this.cookieName),this.lastCookieString=e),this.lastToken}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(fh),Qi(Sl),Qi(t_))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),o_=function(){var e=function(){function e(t,n){m(this,e),this.tokenService=t,this.headerName=n}return b(e,[{key:"intercept",value:function(e,t){var n=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||n.startsWith("http://")||n.startsWith("https://"))return t.handle(e);var i=this.tokenService.getToken();return null!==i&&!e.headers.has(this.headerName)&&(e=e.clone({headers:e.headers.set(this.headerName,i)})),t.handle(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(i_),Qi(n_))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),a_=function(){var e=function(){function e(t,n){m(this,e),this.backend=t,this.injector=n,this.chain=null}return b(e,[{key:"handle",value:function(e){if(null===this.chain){var t=this.injector.get($b,[]);this.chain=t.reduceRight(function(e,t){return new Qb(e,t)},this.backend)}return this.chain.handle(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Pb),Qi(os))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),s_=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"disable",value:function(){return{ngModule:e,providers:[{provide:o_,useClass:Zb}]}}},{key:"withOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{ngModule:e,providers:[t.cookieName?{provide:t_,useValue:t.cookieName}:[],t.headerName?{provide:n_,useValue:t.headerName}:[]]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[o_,{provide:$b,useExisting:o_,multi:!0},{provide:i_,useClass:r_},{provide:t_,useValue:"XSRF-TOKEN"},{provide:n_,useValue:"X-XSRF-TOKEN"}]}),e}(),u_=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[Kb,{provide:Ab,useClass:a_},e_,{provide:Pb,useExisting:e_}],imports:[[s_.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),e}(),c_=["*"];function l_(e){return Error('Unable to find icon with the name "'.concat(e,'"'))}function h_(e){return Error("The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was \"".concat(e,'".'))}function f_(e){return Error("The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was \"".concat(e,'".'))}var d_=function e(t,n,i){m(this,e),this.url=t,this.svgText=n,this.options=i},p_=function(){var e=function(){function e(t,n,i,r){m(this,e),this._httpClient=t,this._sanitizer=n,this._errorHandler=r,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=i}return b(e,[{key:"addSvgIcon",value:function(e,t,n){return this.addSvgIconInNamespace("",e,t,n)}},{key:"addSvgIconLiteral",value:function(e,t,n){return this.addSvgIconLiteralInNamespace("",e,t,n)}},{key:"addSvgIconInNamespace",value:function(e,t,n,i){return this._addSvgIconConfig(e,t,new d_(n,null,i))}},{key:"addSvgIconResolver",value:function(e){return this._resolvers.push(e),this}},{key:"addSvgIconLiteralInNamespace",value:function(e,t,n,i){var r=this._sanitizer.sanitize(Hr.HTML,n);if(!r)throw f_(n);return this._addSvgIconConfig(e,t,new d_("",r,i))}},{key:"addSvgIconSet",value:function(e,t){return this.addSvgIconSetInNamespace("",e,t)}},{key:"addSvgIconSetLiteral",value:function(e,t){return this.addSvgIconSetLiteralInNamespace("",e,t)}},{key:"addSvgIconSetInNamespace",value:function(e,t,n){return this._addSvgIconSetConfig(e,new d_(t,null,n))}},{key:"addSvgIconSetLiteralInNamespace",value:function(e,t,n){var i=this._sanitizer.sanitize(Hr.HTML,t);if(!i)throw f_(t);return this._addSvgIconSetConfig(e,new d_("",i,n))}},{key:"registerFontClassAlias",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this._fontCssClassesByAlias.set(e,t),this}},{key:"classNameForFontAlias",value:function(e){return this._fontCssClassesByAlias.get(e)||e}},{key:"setDefaultFontSetClass",value:function(e){return this._defaultFontSetClass=e,this}},{key:"getDefaultFontSetClass",value:function(){return this._defaultFontSetClass}},{key:"getSvgIconFromUrl",value:function(e){var t=this,n=this._sanitizer.sanitize(Hr.RESOURCE_URL,e);if(!n)throw h_(e);var i=this._cachedIconsByUrl.get(n);return i?jf(v_(i)):this._loadSvgIconFromConfig(new d_(e,null)).pipe(rv(function(e){return t._cachedIconsByUrl.set(n,e)}),ue(function(e){return v_(e)}))}},{key:"getNamedSvgIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=g_(t,e),i=this._svgIconConfigs.get(n);if(i)return this._getSvgFromConfig(i);if(i=this._getIconConfigFromResolvers(t,e))return this._svgIconConfigs.set(n,i),this._getSvgFromConfig(i);var r=this._iconSetConfigs.get(t);return r?this._getSvgFromIconSetConfigs(e,r):bd(l_(n))}},{key:"ngOnDestroy",value:function(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}},{key:"_getSvgFromConfig",value:function(e){return e.svgText?jf(v_(this._svgElementFromConfig(e))):this._loadSvgIconFromConfig(e).pipe(ue(function(e){return v_(e)}))}},{key:"_getSvgFromIconSetConfigs",value:function(e,t){var n=this,i=this._extractIconWithNameFromAnySet(e,t);return i?jf(i):wb(t.filter(function(e){return!e.svgText}).map(function(e){return n._loadSvgIconSetFromConfig(e).pipe(xb(function(t){var i="Loading icon set URL: ".concat(n._sanitizer.sanitize(Hr.RESOURCE_URL,e.url)," failed: ").concat(t.message);return n._errorHandler.handleError(new Error(i)),jf(null)}))})).pipe(ue(function(){var i=n._extractIconWithNameFromAnySet(e,t);if(!i)throw l_(e);return i}))}},{key:"_extractIconWithNameFromAnySet",value:function(e,t){for(var n=t.length-1;n>=0;n--){var i=t[n];if(i.svgText&&i.svgText.indexOf(e)>-1){var r=this._svgElementFromConfig(i),o=this._extractSvgIconFromSet(r,e,i.options);if(o)return o}}return null}},{key:"_loadSvgIconFromConfig",value:function(e){var t=this;return this._fetchIcon(e).pipe(rv(function(t){return e.svgText=t}),ue(function(){return t._svgElementFromConfig(e)}))}},{key:"_loadSvgIconSetFromConfig",value:function(e){return e.svgText?jf(null):this._fetchIcon(e).pipe(rv(function(t){return e.svgText=t}))}},{key:"_extractSvgIconFromSet",value:function(e,t,n){var i=e.querySelector('[id="'.concat(t,'"]'));if(!i)return null;var r=i.cloneNode(!0);if(r.removeAttribute("id"),"svg"===r.nodeName.toLowerCase())return this._setSvgAttributes(r,n);if("symbol"===r.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(r),n);var o=this._svgElementFromString("");return o.appendChild(r),this._setSvgAttributes(o,n)}},{key:"_svgElementFromString",value:function(e){var t=this._document.createElement("DIV");t.innerHTML=e;var n=t.querySelector("svg");if(!n)throw Error(" tag not found");return n}},{key:"_toSvgElement",value:function(e){for(var t=this._svgElementFromString(""),n=e.attributes,i=0;i*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n",T_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],A_=Xy(qy(Yy(function(){return function e(t){m(this,e),this._elementRef=t}}()))),P_=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;m(this,n),(o=t.call(this,e))._focusMonitor=i,o._animationMode=r,o.isRoundButton=o._hasHostAttributes("mat-fab","mat-mini-fab"),o.isIconButton=o._hasHostAttributes("mat-icon-button");var a,s=_(T_);try{for(s.s();!(a=s.n()).done;){var u=a.value;o._hasHostAttributes(u)&&o._getHostElement().classList.add(u)}}catch(c){s.e(c)}finally{s.f()}return e.nativeElement.classList.add("mat-button-base"),o.isRoundButton&&(o.color="accent"),o}return b(n,[{key:"ngAfterViewInit",value:function(){this._focusMonitor.monitor(this._elementRef,!0)}},{key:"ngOnDestroy",value:function(){this._focusMonitor.stopMonitoring(this._elementRef)}},{key:"focus",value:function(e,t){e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t)}},{key:"_getHostElement",value:function(){return this._elementRef.nativeElement}},{key:"_isRippleDisabled",value:function(){return this.disableRipple||this.disabled}},{key:"_hasHostAttributes",value:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i4&&void 0!==arguments[4]?arguments[4]:new D_(e,n,i);if(!r.closed)return t instanceof ee?t.subscribe(r):ve(t)(r)}var L_={};function j_(){for(var e=arguments.length,t=new Array(e),n=0;n visible",tg("150ms cubic-bezier(0, 0, 0.2, 1)")),og("* => void, * => hidden",tg("75ms cubic-bezier(0.4, 0.0, 1, 1)",ig({opacity:0})))])},ew=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a){var s;return m(this,n),(s=t.call(this))._ngZone=e,s._elementRef=i,s._changeDetectorRef=r,s._platform=o,s.snackBarConfig=a,s._announceDelay=150,s._destroyed=!1,s._onAnnounce=new oe,s._onExit=new oe,s._onEnter=new oe,s._animationState="void",s.attachDomPortal=function(e){return s._assertNotAttached(),s._applySnackBarClasses(),s._portalOutlet.attachDomPortal(e)},s._live="assertive"!==a.politeness||a.announcementMessage?"off"===a.politeness?"off":"polite":"assertive",s._platform.FIREFOX&&("polite"===s._live&&(s._role="status"),"assertive"===s._live&&(s._role="alert")),s}return b(n,[{key:"attachComponentPortal",value:function(e){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(e)}},{key:"attachTemplatePortal",value:function(e){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(e)}},{key:"onAnimationEnd",value:function(e){var t=e.fromState,n=e.toState;if(("void"===n&&"void"!==t||"hidden"===n)&&this._completeExit(),"visible"===n){var i=this._onEnter;this._ngZone.run(function(){i.next(),i.complete()})}}},{key:"enter",value:function(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}},{key:"exit",value:function(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}},{key:"ngOnDestroy",value:function(){this._destroyed=!0,this._completeExit()}},{key:"_completeExit",value:function(){var e=this;this._ngZone.onMicrotaskEmpty.pipe(ap(1)).subscribe(function(){e._onExit.next(),e._onExit.complete()})}},{key:"_applySnackBarClasses",value:function(){var e=this._elementRef.nativeElement,t=this.snackBarConfig.panelClass;t&&(Array.isArray(t)?t.forEach(function(t){return e.classList.add(t)}):e.classList.add(t)),"center"===this.snackBarConfig.horizontalPosition&&e.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&e.classList.add("mat-snack-bar-top")}},{key:"_assertNotAttached",value:function(){this._portalOutlet.hasAttached()}},{key:"_screenReaderAnnounce",value:function(){var e=this;this._announceTimeoutId||this._ngZone.runOutsideAngular(function(){e._announceTimeoutId=setTimeout(function(){var t=e._elementRef.nativeElement.querySelector("[aria-hidden]"),n=e._elementRef.nativeElement.querySelector("[aria-live]");if(t&&n){var i=null;e._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(i=document.activeElement),t.removeAttribute("aria-hidden"),n.appendChild(t),null==i||i.focus(),e._onAnnounce.next(),e._onAnnounce.complete()}},e._announceDelay)})}}]),n}(Jd);return e.\u0275fac=function(t){return new(t||e)(Es(Vl),Es(Ku),Es(wc),Es(Id),Es(K_))},e.\u0275cmp=Ct({type:e,selectors:[["snack-bar-container"]],viewQuery:function(e,t){var n;(1&e&&hl(ip,7),2&e)&&(ll(n=dl())&&(t._portalOutlet=n.first))},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(e,t){1&e&&Bs("@state.done",function(e){return t.onAnimationEnd(e)}),2&e&&Tu("@state",t._animationState)},features:[ss],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(e,t){1&e&&(Ts(0,"div",0),xs(1,X_,0,0,"ng-template",1),As(),Ps(2,"div")),2&e&&(qo(2),_s("aria-live",t._live)("role",t._role))},directives:[ip],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[J_.snackBarState]}}),e}(),tw=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kp,rp,Kh,I_,Wy],Wy]}),e}(),nw=new Mi("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new K_}}),iw=function(){var e=function(){function e(t,n,i,r,o,a){m(this,e),this._overlay=t,this._live=n,this._injector=i,this._breakpointObserver=r,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=Z_,this.snackBarContainerComponent=ew,this.handsetCssClass="mat-snack-bar-handset"}return b(e,[{key:"_openedSnackBarRef",get:function(){var e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel},set:function(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}},{key:"openFromComponent",value:function(e,t){return this._attach(e,t)}},{key:"openFromTemplate",value:function(e,t){return this._attach(e,t)}},{key:"open",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=Object.assign(Object.assign({},this._defaultConfig),n);return i.data={message:e,action:t},i.announcementMessage===e&&(i.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,i)}},{key:"dismiss",value:function(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}},{key:"ngOnDestroy",value:function(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}},{key:"_attachSnackBarContainer",value:function(e,t){var n=os.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:K_,useValue:t}]}),i=new Qd(this.snackBarContainerComponent,t.viewContainerRef,n),r=e.attach(i);return r.instance.snackBarConfig=t,r.instance}},{key:"_attach",value:function(e,t){var n=this,i=Object.assign(Object.assign(Object.assign({},new K_),this._defaultConfig),t),r=this._createOverlay(i),o=this._attachSnackBarContainer(r,i),a=new $_(o,r);if(e instanceof Cc){var s=new $d(e,null,{$implicit:i.data,snackBarRef:a});a.instance=o.attachTemplatePortal(s)}else{var u=this._createInjector(i,a),c=new Qd(e,void 0,u),l=o.attachComponentPortal(c);a.instance=l.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(ud(r.detachments())).subscribe(function(e){var t=r.overlayElement.classList;e.matches?t.add(n.handsetCssClass):t.remove(n.handsetCssClass)}),i.announcementMessage&&o._onAnnounce.subscribe(function(){n._live.announce(i.announcementMessage,i.politeness)}),this._animateSnackBar(a,i),this._openedSnackBarRef=a,this._openedSnackBarRef}},{key:"_animateSnackBar",value:function(e,t){var n=this;e.afterDismissed().subscribe(function(){n._openedSnackBarRef==e&&(n._openedSnackBarRef=null),t.announcementMessage&&n._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(function(){e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter(),t.duration&&t.duration>0&&e.afterOpened().subscribe(function(){return e._dismissAfter(t.duration)})}},{key:"_createOverlay",value:function(e){var t=new wp;t.direction=e.direction;var n=this._overlay.position().global(),i="rtl"===e.direction,r="left"===e.horizontalPosition||"start"===e.horizontalPosition&&!i||"end"===e.horizontalPosition&&i,o=!r&&"center"!==e.horizontalPosition;return r?n.left("0"):o?n.right("0"):n.centerHorizontally(),"top"===e.verticalPosition?n.top("0"):n.bottom("0"),t.positionStrategy=n,this._overlay.create(t)}},{key:"_createInjector",value:function(e,t){return os.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:$_,useValue:t},{provide:Y_,useValue:e.data}]})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Hp),Qi(Uv),Qi(os),Qi(G_),Qi(e,12),Qi(nw))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Hp),Qi(Uv),Qi(Wa),Qi(G_),Qi(e,12),Qi(nw))},token:e,providedIn:tw}),e}(),rw={tooltipState:eg("state",[rg("initial, void, hidden",ig({opacity:0,transform:"scale(0)"})),rg("visible",ig({transform:"scale(1)"})),og("* => visible",tg("200ms cubic-bezier(0, 0, 0.2, 1)",function(e){return{type:5,steps:e}}([ig({opacity:0,transform:"scale(0)",offset:0}),ig({opacity:.5,transform:"scale(0.99)",offset:.5}),ig({opacity:1,transform:"scale(1)",offset:1})]))),og("* => hidden",tg("100ms cubic-bezier(0, 0, 0.2, 1)",ig({opacity:0})))])},ow="tooltip-panel",aw=Ld({passive:!0}),sw=new Mi("mat-tooltip-scroll-strategy"),uw={provide:sw,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.reposition({scrollThrottle:20})}}},cw=new Mi("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}}),lw=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h,f){var d=this;m(this,e),this._overlay=t,this._elementRef=n,this._scrollDispatcher=i,this._viewContainerRef=r,this._ngZone=o,this._platform=a,this._ariaDescriber=s,this._focusMonitor=u,this._dir=l,this._defaultOptions=h,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new oe,this._handleKeydown=function(e){d._isTooltipVisible()&&27===e.keyCode&&!fp(e)&&(e.preventDefault(),e.stopPropagation(),d._ngZone.run(function(){return d.hide(0)}))},this._scrollStrategy=c,this._document=f,h&&(h.position&&(this.position=h.position),h.touchGestures&&(this.touchGestures=h.touchGestures)),l.change.pipe(ud(this._destroyed)).subscribe(function(){d._overlayRef&&d._updatePosition(d._overlayRef)}),o.runOutsideAngular(function(){n.nativeElement.addEventListener("keydown",d._handleKeydown)})}return b(e,[{key:"position",get:function(){return this._position},set:function(e){var t;e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(t=this._tooltipInstance)||void 0===t||t.show(0),this._overlayRef.updatePosition()))}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=If(e),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}},{key:"message",get:function(){return this._message},set:function(e){var t=this;this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=e?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(function(){Promise.resolve().then(function(){t._ariaDescriber.describe(t._elementRef.nativeElement,t.message,"tooltip")})}))}},{key:"tooltipClass",get:function(){return this._tooltipClass},set:function(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}},{key:"ngAfterViewInit",value:function(){var e=this;this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(ud(this._destroyed)).subscribe(function(t){t?"keyboard"===t&&e._ngZone.run(function(){return e.show()}):e._ngZone.run(function(){return e.hide(0)})})}},{key:"ngOnDestroy",value:function(){var e=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),e.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(function(n){var i=t(n,2),r=i[0],o=i[1];e.removeEventListener(r,o,aw)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}},{key:"show",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.showDelay;if(!this.disabled&&this.message&&(!this._isTooltipVisible()||this._tooltipInstance._showTimeoutId||this._tooltipInstance._hideTimeoutId)){var n=this._createOverlay();this._detach(),this._portal=this._portal||new Qd(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=n.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(ud(this._destroyed)).subscribe(function(){return e._detach()}),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hideDelay;this._tooltipInstance&&this._tooltipInstance.hide(e)}},{key:"toggle",value:function(){this._isTooltipVisible()?this.hide():this.show()}},{key:"_isTooltipVisible",value:function(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}},{key:"_createOverlay",value:function(){var e=this;if(this._overlayRef)return this._overlayRef;var t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),n=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(".".concat(this._cssClassPrefix,"-tooltip")).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return n.positionChanges.pipe(ud(this._destroyed)).subscribe(function(t){e._updateCurrentPositionClass(t.connectionPair),e._tooltipInstance&&t.scrollableViewProperties.isOverlayClipped&&e._tooltipInstance.isVisible()&&e._ngZone.run(function(){return e.hide(0)})}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:n,panelClass:"".concat(this._cssClassPrefix,"-").concat(ow),scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(ud(this._destroyed)).subscribe(function(){return e._detach()}),this._overlayRef.outsidePointerEvents().pipe(ud(this._destroyed)).subscribe(function(){var t;return null===(t=e._tooltipInstance)||void 0===t?void 0:t._handleBodyInteraction()}),this._overlayRef}},{key:"_detach",value:function(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}},{key:"_updatePosition",value:function(e){var t=e.getConfig().positionStrategy,n=this._getOrigin(),i=this._getOverlayPosition();t.withPositions([this._addOffset(Object.assign(Object.assign({},n.main),i.main)),this._addOffset(Object.assign(Object.assign({},n.fallback),i.fallback))])}},{key:"_addOffset",value:function(e){return e}},{key:"_getOrigin",value:function(){var e,t=!this._dir||"ltr"==this._dir.value,n=this.position;"above"==n||"below"==n?e={originX:"center",originY:"above"==n?"top":"bottom"}:"before"==n||"left"==n&&t||"right"==n&&!t?e={originX:"start",originY:"center"}:("after"==n||"right"==n&&t||"left"==n&&!t)&&(e={originX:"end",originY:"center"});var i=this._invertPosition(e.originX,e.originY);return{main:e,fallback:{originX:i.x,originY:i.y}}}},{key:"_getOverlayPosition",value:function(){var e,t=!this._dir||"ltr"==this._dir.value,n=this.position;"above"==n?e={overlayX:"center",overlayY:"bottom"}:"below"==n?e={overlayX:"center",overlayY:"top"}:"before"==n||"left"==n&&t||"right"==n&&!t?e={overlayX:"end",overlayY:"center"}:("after"==n||"right"==n&&t||"left"==n&&!t)&&(e={overlayX:"start",overlayY:"center"});var i=this._invertPosition(e.overlayX,e.overlayY);return{main:e,fallback:{overlayX:i.x,overlayY:i.y}}}},{key:"_updateTooltipMessage",value:function(){var e=this;this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(ap(1),ud(this._destroyed)).subscribe(function(){e._tooltipInstance&&e._overlayRef.updatePosition()}))}},{key:"_setTooltipClass",value:function(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}},{key:"_invertPosition",value:function(e,t){return"above"===this.position||"below"===this.position?"top"===t?t="bottom":"bottom"===t&&(t="top"):"end"===e?e="start":"start"===e&&(e="end"),{x:e,y:t}}},{key:"_updateCurrentPositionClass",value:function(e){var t,n=e.overlayY,i=e.originX,r=e.originY;if((t="center"===n?this._dir&&"rtl"===this._dir.value?"end"===i?"left":"right":"start"===i?"left":"right":"bottom"===n&&"top"===r?"above":"below")!==this._currentPosition){var o=this._overlayRef;if(o){var a="".concat(this._cssClassPrefix,"-").concat(ow,"-");o.removePanelClass(a+this._currentPosition),o.addPanelClass(a+t)}this._currentPosition=t}}},{key:"_setupPointerEnterEventsIfNeeded",value:function(){var e=this;this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",function(){e._setupPointerExitEventsIfNeeded(),e.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",function(){e._setupPointerExitEventsIfNeeded(),clearTimeout(e._touchstartTimeout),e._touchstartTimeout=setTimeout(function(){return e.show()},500)}])),this._addListeners(this._passiveListeners))}},{key:"_setupPointerExitEventsIfNeeded",value:function(){var e,t=this;if(!this._pointerExitEventsInitialized){this._pointerExitEventsInitialized=!0;var n=[];if(this._platformSupportsMouseEvents())n.push(["mouseleave",function(){return t.hide()}],["wheel",function(e){return t._wheelListener(e)}]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();var i=function(){clearTimeout(t._touchstartTimeout),t.hide(t._defaultOptions.touchendHideDelay)};n.push(["touchend",i],["touchcancel",i])}this._addListeners(n),(e=this._passiveListeners).push.apply(e,n)}}},{key:"_addListeners",value:function(e){var n=this;e.forEach(function(e){var i=t(e,2),r=i[0],o=i[1];n._elementRef.nativeElement.addEventListener(r,o,aw)})}},{key:"_platformSupportsMouseEvents",value:function(){return!this._platform.IOS&&!this._platform.ANDROID}},{key:"_wheelListener",value:function(e){if(this._isTooltipVisible()){var t=this._document.elementFromPoint(e.clientX,e.clientY),n=this._elementRef.nativeElement;t!==n&&!n.contains(t)&&this.hide()}}},{key:"_disableNativeGesturesIfNecessary",value:function(){var e=this.touchGestures;if("off"!==e){var t=this._elementRef.nativeElement,n=t.style;("on"===e||"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName)&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),("on"===e||!t.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(Ku),Es(Wd),Es(Mc),Es(Vl),Es(Id),Es(Ev),Es(Wv),Es(void 0),Es(zd),Es(void 0),Es(fh))},e.\u0275dir=It({type:e,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),e}(),hw=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c,l,h,f,d){var p;return m(this,n),(p=t.call(this,e,i,r,o,a,s,u,c,l,h,f,d))._tooltipComponent=dw,p}return n}(lw);return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(Ku),Es(Wd),Es(Mc),Es(Vl),Es(Id),Es(Ev),Es(Wv),Es(sw),Es(zd,8),Es(cw,8),Es(fh))},e.\u0275dir=It({type:e,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ss]}),e}(),fw=function(){var e=function(){function e(t){m(this,e),this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new oe}return b(e,[{key:"show",value:function(e){var t=this;clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(function(){t._visibility="visible",t._showTimeoutId=void 0,t._onShow(),t._markForCheck()},e)}},{key:"hide",value:function(e){var t=this;clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(function(){t._visibility="hidden",t._hideTimeoutId=void 0,t._markForCheck()},e)}},{key:"afterHidden",value:function(){return this._onHide}},{key:"isVisible",value:function(){return"visible"===this._visibility}},{key:"ngOnDestroy",value:function(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}},{key:"_animationStart",value:function(){this._closeOnInteraction=!1}},{key:"_animationDone",value:function(e){var t=e.toState;"hidden"===t&&!this.isVisible()&&this._onHide.next(),("visible"===t||"hidden"===t)&&(this._closeOnInteraction=!0)}},{key:"_handleBodyInteraction",value:function(){this._closeOnInteraction&&this.hide(0)}},{key:"_markForCheck",value:function(){this._changeDetectorRef.markForCheck()}},{key:"_onShow",value:function(){}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(wc))},e.\u0275dir=It({type:e}),e}(),dw=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e))._breakpointObserver=i,r._isHandset=r._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)"),r}return n}(fw);return e.\u0275fac=function(t){return new(t||e)(Es(wc),Es(G_))},e.\u0275cmp=Ct({type:e,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(e,t){2&e&&au("zoom","visible"===t._visibility?1:null)},features:[ss],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(e,t){var n;(1&e&&(Ts(0,"div",0),Fs("@state.start",function(){return t._animationStart()})("@state.done",function(e){return t._animationDone(e)}),Kc(1,"async"),ku(2),As()),2&e)&&(su("mat-tooltip-handset",null==(n=Qc(1,5,t._isHandset))?null:n.matches),Cs("ngClass",t.tooltipClass)("@state",t._visibility),qo(2),xu(t.message))},directives:[Ih],pipes:[Yh],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[rw.tooltipState]},changeDetection:0}),e}(),pw=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[uw],imports:[[Qv,Kh,Kp,Wy],Wy,Xd]}),e}();function vw(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function gw(e,t){return function(n,i){t(n,i,e)}}function mw(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function yw(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{u(i.next(e))}catch(t){o(t)}}function s(e){try{u(i.throw(e))}catch(t){o(t)}}function u(e){e.done?r(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(a,s)}u((i=i.apply(e,t||[])).next())})}function bw(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;var t="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||t;return!!(n&&n.indexOf("Electron")>=0)}function _w(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||bw()}var ww="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",kw=_w(),xw=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";m(this,e),this.storage=function(e){try{var n=window[e],i="__storage_test__";return n.setItem(i,i),n.removeItem(i),n}catch(t){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return b(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Sw(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var o=e.width*n,a=e.height*n,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(r,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var Ew={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function Cw(e){return"string"==typeof e?Ew[e.toUpperCase()]||Ew.WHITE:e}function Ow(e,t){if(!e)throw new Error(t||"Assertion failed")}var Tw={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},Aw=Tw.window||Tw.self||Tw.global,Pw=Tw.process||{};function Mw(){var e;if(kw&&Aw.performance)e=Aw.performance.now();else if(Pw.hrtime){var t=Pw.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}console;var Iw={debug:kw&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Rw={enabled:!0,level:0};function Dw(){}var Nw={},Lw={once:!0};function jw(e){for(var t in e)for(var n in e[t])return n||"untitled";return"empty"}var Fw=function(){var e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},n=t.id;m(this,e),this.id=n,this.VERSION=ww,this._startTs=Mw(),this._deltaTs=Mw(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new xw("__probe-".concat(this.id,"__"),Rw),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],i=Object.getPrototypeOf(e),r=Object.getOwnPropertyNames(i),o=_(r);try{var a=function(){var i=t.value;"function"==typeof e[i]&&(n.find(function(e){return i===e})||(e[i]=e[i].bind(e)))};for(o.s();!(t=o.n()).done;)a()}catch(s){o.e(s)}finally{o.f()}}(this),Object.seal(this)}return b(e,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Mw()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Mw()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"assert",value:function(e,t){Ow(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Iw.warn,arguments,Lw)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Iw.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Iw.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Iw.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){return this._getLogFunction(e,t,Iw.debug||Iw.info,arguments,Lw)}},{key:"table",value:function(e,t,n){return t?this._getLogFunction(e,t,console.table||Dw,n&&[n],{tag:jw(t)}):Dw}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,o=e.message,a=void 0===o?"":o,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?kw?function(e){var t,n=e.image,i=e.message,r=void 0===i?"":i,o=e.scale,a=void 0===o?1:o;if("string"==typeof n){var s=new Image;return s.onload=function(){var e,t=Sw(s,r,a);(e=console).log.apply(e,v(t))},s.src=n,Dw}var u=n.nodeName||"";if("img"===u.toLowerCase())return(t=console).log.apply(t,v(Sw(n,r,a))),Dw;if("canvas"===u.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,v(Sw(c,r,a)))},c.src=n.toDataURL(),Dw}return Dw}({image:i,message:a,scale:u}):function(e){var t=e.image,n=e.scale,o=void 0===n?1:n,a=null;try{a=r(75307)}catch(i){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*o),"%")}).then(function(e){return console.log(e)})}:Dw}({image:i,message:a,scale:u}):Dw}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(o({},e,t))}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||Dw)}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=n=Vw({logLevel:e,message:t,opts:n}),r=i.collapsed;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Dw)}},{key:"withGroup",value:function(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=Bw(e)}},{key:"_getLogFunction",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(e)){var o;r=Vw({logLevel:e,message:t,args:i,opts:r}),Ow(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Mw();var a=r.tag||r.message;if(r.once){if(Nw[a])return Dw;Nw[a]=Mw()}return t=function(e,t,n){if("string"==typeof t){var i=n.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}(function(e){return e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s")}(n.total)):"";t=function(e,t,n){return!kw&&"string"==typeof e&&(t&&(t=Cw(t),e="\x1b[".concat(t,"m").concat(e,"\x1b[39m")),n&&(t=Cw(n),e="\x1b[".concat(n+10,"m").concat(e,"\x1b[49m"))),e}(t=n.time?"".concat(e,": ").concat(i," ").concat(t):"".concat(e,": ").concat(t),n.color,n.background)}return t}(this.id,r.message,r),(o=n).bind.apply(o,[console,t].concat(v(r.args)))}return Dw}}]),e}();return e.VERSION=ww,e}();function Bw(e){if(!e)return 0;var t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Ow(Number.isFinite(t)&&t>=0),t}function Vw(e){var t=e.logLevel,n=e.message;e.logLevel=Bw(t);for(var i=e.args?Array.from(e.args):[];i.length&&i.shift()!==n;);switch(e.args=i,typeof t){case"string":case"function":void 0!==n&&i.unshift(n),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var r=typeof e.message;return Ow("string"===r||"object"===r),Object.assign(e,e.opts)}var zw=new Fw({id:"deck"}),Uw={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Uw,"IDENTITY",{get:function(){return zw.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0}});var Hw={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Gw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Ww=new Fw({id:"luma.gl"});function qw(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function Xw(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version))}function Yw(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function Kw(e){return qw(Xw(e),"Invalid WebGLRenderingContext"),e}function Qw(e){return qw(Yw(e),"Requires WebGL2"),e}var $w=r(84761),Zw={},Jw=function e(t){var n=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},i=n.copyState,r=void 0!==i&&i,o=n.log,a=void 0===o?function(){}:o;m(this,e),this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=r?function(e,t){if("number"==typeof(t=t||ck)){var n=t,i=bk[n];return i?i(e,n):e.getParameter(n)}var r,o={},a=_(Array.isArray(t)?t:Object.keys(t));try{for(a.s();!(r=a.n()).done;){var s=r.value,u=bk[s];o[s]=u?u(e,Number(s)):e.getParameter(Number(s))}}catch(c){a.e(c)}finally{a.f()}return o}(t):Object.assign({},ck),this.log=a,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return b(e,[{key:"push",value:function(){this.stateStack.push({})}},{key:"pop",value:function(){qw(this.stateStack.length>0),Ok(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e){qw(void 0!==r);var o=e[r],a=this.cache[r];wk(o,a)||(n=!0,t=a,i&&!(r in i)&&(i[r]=a),this.cache[r]=o)}return{valueChanged:n,oldValue:t}}}]),e}();function Ek(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.enable,i=void 0===n||n,r=t.copyState;if(qw(void 0!==r),!e.state){var o="undefined"!=typeof global?global:window,a=o.polyfillContext;for(var s in a&&a(e),e.state=new Sk(e,{copyState:r}),function(e){var t=e.useProgram.bind(e);e.useProgram=function(n){e.state.program!==n&&(t(n),e.state.program=n)}}(e),mk)xk(e,s,mk[s]);kk(e,"getParameter"),kk(e,"isEnabled")}return e.state.enable=i,e}function Ck(e){qw(e.state),e.state.pop()}function Ok(e,t){if(qw(Xw(e),"setParameters requires a WebGL context"),!_k(t)){var n={};for(var i in t){var r=Number(i),o=pk[i];o&&("string"==typeof o?n[o]=!0:o(e,t[i],r))}var a=e.state&&e.state.cache;if(a)for(var s in n)gk[s](e,t,a)}}function Tk(e,t,n){if(_k(t))return n(e);var i,r=t.nocatch,o=void 0===r||r;if(function(e){e.state||Ek(e,{copyState:!1}),e.state.push()}(e),Ok(e,t),o)i=n(e),Ck(e);else try{i=n(e)}finally{Ck(e)}return i}function Ak(e){var t=e.luma;if(e.canvas&&t){var n=t.canvasSizeInfo.clientWidth;return n?e.drawingBufferWidth/n:1}return 1}function Pk(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(e,t,n,i,r){var o,a=Mk(e[0],t,n),s=Ik(e[1],t,i,r),u=Mk(e[0]+1,t,n),c=u===n-1?u:u-1;return u=Ik(e[1]+1,t,i,r),r?(o=s,s=u=0===u?u:u+1):o=u===i-1?u:u-1,{x:a,y:s,width:Math.max(c-a+1,1),height:Math.max(o-s+1,1)}}(t,Ak(e),e.drawingBufferWidth,e.drawingBufferHeight,n)}function Mk(e,t,n){return Math.min(Math.round(e*t),n-1)}function Ik(e,t,n,i){return i?Math.max(0,n-1-Math.round(e*t)):Math.min(Math.round(e*t),n-1)}var Rk=(0,$w.jU)(),Dk=Rk&&"undefined"!=typeof document,Nk={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Lk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qw(Rk,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils");var t,n=e=Object.assign({},Nk,e),i=n.width,r=n.height;function o(t){if(e.throwOnError)throw new Error(t);return console.error(t),null}e.onError=o;var a=e,s=a.canvas,u=function(e){var t,n=e.canvas,i=e.width,r=void 0===i?800:i,o=e.height,a=void 0===o?600:o,s=e.onError;return"string"==typeof n?(Dk&&"complete"===document.readyState||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):n?t=n:((t=document.createElement("canvas")).id="lumagl-canvas",t.style.width=Number.isFinite(r)?"".concat(r,"px"):"100%",t.style.height=Number.isFinite(a)?"".concat(a,"px"):"100%",document.body.insertBefore(t,document.body.firstChild)),t}({canvas:s,width:i,height:r,onError:o});return(t=function(e,t){var n=t.onError,i=null,r=function(e){return i=e.statusMessage||i};e.addEventListener("webglcontextcreationerror",r,!1);var o=t.webgl1,a=void 0===o||o,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),a&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c?(t.onContextLost&&e.addEventListener("webglcontextlost",t.onContextLost,!1),t.onContextRestored&&e.addEventListener("webglcontextrestored",t.onContextRestored,!1),c):n("Failed to create ".concat(u&&!a?"WebGL2":"WebGL"," context: ").concat(i||"Unknown error"))}(u,e))?(function(e){var t=Yw(e)?"WebGL2":"WebGL1",n=function(e){var t=e.getParameter(7936),n=e.getParameter(7937),i=e.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&e.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||t,renderer:i&&e.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}(e);Ww.info(1,"".concat(t).concat(e.debug?" debug":""," context ").concat(n?"(".concat(n.vendor,",").concat(n.renderer,")"):""))()}(t=jk(t,e)),t):null}function jk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||e._instrumented)return e;e._version=e._version||function(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext?2:1}(e),e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{};var n=t=Object.assign({},Nk,t),i=n.manageState,r=n.debug;return i&&Ek(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}},{key:"_checkSampling",value:function(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}]),e}(),Vk=function(){function e(t){var n=t.id,i=t.stats;m(this,e),this.id=n,this.stats={},this._initializeStats(i),Object.seal(this)}return b(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}},{key:"_initializeStats",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){return e._getOrCreate(t)})}},{key:"_getOrCreate",value:function(e){if(!e||!e.name)return null;var t=e.name,n=e.type;return this.stats[t]||(this.stats[t]=e instanceof Bk?e:new Bk(t,n)),this.stats[t]}}]),e}(),zk="8.5.7",Uk=new(function(){function e(){m(this,e),this.stats=new Map}return b(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new Vk({id:e})),this.stats.get(e)}}]),e}());if($w.CO.luma&&$w.CO.luma.VERSION!==zk)throw new Error("luma.gl - multiple VERSIONs detected: ".concat($w.CO.luma.VERSION," vs 8.5.7"));function Hk(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function Gk(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var i=e[t=t.replace(/^.*\./,"")];return Hk(void 0!==i,"Accessing undefined constant GL.".concat(t)),i}function Wk(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}$w.CO.luma||((0,$w.jU)()&&Ww.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),$w.CO.luma=$w.CO.luma||{VERSION:zk,version:zk,log:Ww,stats:Uk,globals:{modules:{},nodeIO:{}}});var qk={};function Xk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return qk[e]=qk[e]||1,"".concat(e,"-").concat(qk[e]++)}function Yk(e){return Hk("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function Kk(e){var t=!0;for(var n in e){t=!1;break}return t}function Qk(e,t,n,i){var r="See luma.gl ".concat(n," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),o=Object.getPrototypeOf(e);i.forEach(function(e){o.methodName||(o[e]=function(){throw Ww.removed("Calling removed method ".concat(t,".").concat(e,": "),r)(),new Error(e)})})}var $k="Resource subclass must define virtual methods",Zk=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),Kw(t);var i=n.id,r=n.userData,o=void 0===r?{}:r;this.gl=t,this.gl2=t,this.id=i||Xk(this.constructor.name),this.userData=o,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return b(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.deleteChildren,n=void 0!==t&&t,i=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,i&&n&&i.filter(Boolean).forEach(function(e){return e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Hk(e=Gk(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Yw(this.gl);if("webgl2"in n&&!i||"extension"in n&&!this.gl.getExtension(n.extension)){var r=n.webgl1,o="webgl2"in n?n.webgl2:n.webgl1;return i?o:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},o=Yw(this.gl),a={},s=n||Object.keys(r),u=_(s);try{for(u.s();!(e=u.n()).done;){var c=e.value,l=r[c];if(l&&(!("webgl2"in l)||o)&&(!("extension"in l)||this.gl.getExtension(l.extension))){var h=i?Wk(this.gl,c):c;a[h]=this.getParameter(c,t),i&&"GLenum"===l.type&&(a[h]=Wk(this.gl,a[h]))}}}catch(f){u.e(f)}finally{u.f()}return a}},{key:"setParameter",value:function(e,t){Hk(e=Gk(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Yw(this.gl);if("webgl2"in n&&!i||"extension"in n&&!this.gl.getExtension(n.extension))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Gk(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return Qk(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error($k)}},{key:"_deleteHandle",value:function(){throw new Error($k)}},{key:"_bindHandle",value:function(e){throw new Error($k)}},{key:"_getOptsFromHandle",value:function(){throw new Error($k)}},{key:"_getParameter",value:function(e,t){throw new Error($k)}},{key:"_setParameter",value:function(e,t){throw new Error($k)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=Uk.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;Uk.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=Uk.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=Uk.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),e}();function Jk(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function ex(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clamped,i=void 0===n||n;switch(e){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return i?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function tx(e){for(var t=e.data,n=e.width,i=e.height,r=Math.round(n/2),o=Math.round(i/2),a=new Uint8Array(r*o*4),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=nx("Accessor",e,rx)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}],[{key:"getBytesPerElement",value:function(e){return ex(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return Hk(e.size),ex(e.type||5126).BYTES_PER_ELEMENT*e.size}},{key:"resolve",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),(i=t.call(this,e,r)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),i.target=r.target||(i.gl.webgl2?36662:34962),i.initialize(r),Object.seal(c(i)),i}return b(n,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ox.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ox.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=nx("Buffer",e,sx),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=nx("Buffer",e,ux))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ox(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,o=t.srcOffset,a=void 0===o?0:o,s=e.byteLength||e.length;Hk(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==a||void 0!==s?(Qw(this.gl),this.gl.bufferSubData(this.target,r,n,a,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,o=void 0===r?0:r,a=e.size,s=this.gl;return Qw(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,o,a),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,o=e.dstOffset,a=void 0===o?0:o,s=e.length,u=void 0===s?0:s;Qw(this.gl);var c,l,h=ex(this.accessor.type||5126,{clamped:!1}),f=this._getAvailableElementCount(r),d=a;n?c=(l=n.length)-d:l=d+(c=Math.min(f,u||f));var p=Math.min(f,c);return Hk((u=u||p)<=p),n=n||new h(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,a,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,o=e.offset,a=void 0===o?0:o,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,a,s):(Hk(0===a),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.byteLength+t;Hk(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var i=this._getTarget();this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,this.usage),this.gl.bufferSubData(i,t,e),this.gl.bindBuffer(i,null),this.debugData=e.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n);var r=Jk(e);return Hk(r),this.setAccessor(new ox(this.accessor,{type:r})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Hk(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/ex(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new ox(this.accessor,{type:Jk(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"type",get:function(){return Ww.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return Ww.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return Ww.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return Ww.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ox(this.accessor,e),this}}]),n}(Zk),lx={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},hx={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},fx={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},dx=[9729,9728],px=$w.CO.WebGLBuffer||function(){},vx=function(e){a(i,e);var n=s(i);function i(e,t){var r;m(this,i);var o=t.id,a=void 0===o?Xk("texture"):o,s=t.handle,u=t.target;return(r=n.call(this,e,{id:a,handle:s})).target=u,r.textureUnit=void 0,r.loaded=!1,r.width=void 0,r.height=void 0,r.depth=void 0,r.format=void 0,r.type=void 0,r.dataFormat=void 0,r.border=void 0,r.textureUnit=void 0,r.mipmaps=void 0,r}return b(i,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.data;if(i instanceof Promise)return i.then(function(e){return t.initialize(Object.assign({},n,{pixels:e,data:e}))}),this;var r="undefined"!=typeof HTMLVideoElement&&i instanceof HTMLVideoElement;if(r&&i.readyState=HTMLVideoElement.HAVE_CURRENT_DATA?i.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var e=this._video,t=e.video,n=e.parameters;if(e.lastTime===t.currentTime||t.readyState0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(Ww.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Tk(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){var n,i;this._trackDeallocatedMemory("Texture");var r=e.target,o=void 0===r?this.target:r,a=e.pixels,s=void 0===a?null:a,u=e.level,c=void 0===u?0:u,l=e.format,h=void 0===l?this.format:l,f=e.border,d=void 0===f?this.border:f,p=e.offset,v=void 0===p?0:p,g=e.parameters,m=void 0===g?{}:g,y=e.data,b=void 0===y?null:y,w=e.type,k=void 0===w?this.type:w,x=e.width,S=void 0===x?this.width:x,E=e.height,C=void 0===E?this.height:E,O=e.dataFormat,T=void 0===O?this.dataFormat:O,A=e.compressed,P=void 0!==A&&A;b||(b=s),n=this._deduceParameters({format:h,type:k,dataFormat:T,compressed:P,data:b,width:S,height:C}),k=n.type,T=n.dataFormat,P=n.compressed,S=n.width,C=n.height;var M=this.gl;M.bindTexture(this.target,this.handle);var I,R;return i=this._getDataType({data:b,compressed:P}),b=i.data,R=i.dataType,Tk(this.gl,m,function(){switch(R){case"null":M.texImage2D(o,c,h,S,C,d,T,k,b);break;case"typed-array":M.texImage2D(o,c,h,S,C,d,T,k,b,v);break;case"buffer":(I=Qw(M)).bindBuffer(35052,b.handle||b),I.texImage2D(o,c,h,S,C,d,T,k,v),I.bindBuffer(35052,null);break;case"browser-object":Yw(M)?M.texImage2D(o,c,h,S,C,d,T,k,b):M.texImage2D(o,c,h,T,k,b);break;case"compressed":var e,n=_(b.entries());try{for(n.s();!(e=n.n()).done;){var i=t(e.value,2),r=i[0],a=i[1];M.compressedTexImage2D(o,r,a.format,a.width,a.height,d,a.data)}}catch(s){n.e(s)}finally{n.f()}break;default:Hk(!1,"Unknown image data type")}}),this._trackAllocatedMemory(b&&b.byteLength?b.byteLength:this.width*this.height*(hx[this.dataFormat]||4)*(fx[this.type]||1),"Texture"),this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t,n=this,i=e.target,r=void 0===i?this.target:i,o=e.pixels,a=void 0===o?null:o,s=e.data,u=void 0===s?null:s,c=e.x,l=void 0===c?0:c,h=e.y,f=void 0===h?0:h,d=e.width,p=void 0===d?this.width:d,v=e.height,g=void 0===v?this.height:v,m=e.level,y=void 0===m?0:m,b=e.format,_=void 0===b?this.format:b,w=e.type,k=void 0===w?this.type:w,x=e.dataFormat,S=void 0===x?this.dataFormat:x,E=e.compressed,C=void 0!==E&&E,O=e.offset,T=void 0===O?0:O,A=e.border,P=(void 0===A&&this.border,e.parameters),M=void 0===P?{}:P;if(t=this._deduceParameters({format:_,type:k,dataFormat:S,compressed:C,data:u,width:p,height:g}),k=t.type,S=t.dataFormat,C=t.compressed,p=t.width,g=t.height,Hk(0===this.depth,"texSubImage not supported for 3D textures"),u||(u=a),u&&u.data){var I=u;u=I.data,p=I.shape[0],g=I.shape[1]}u instanceof cx&&(u=u.handle),this.gl.bindTexture(this.target,this.handle),Tk(this.gl,M,function(){if(C)n.gl.compressedTexSubImage2D(r,y,l,f,p,g,_,u);else if(null===u)n.gl.texSubImage2D(r,y,l,f,p,g,S,k,null);else if(ArrayBuffer.isView(u))n.gl.texSubImage2D(r,y,l,f,p,g,S,k,u,T);else if(u instanceof px){var e=Qw(n.gl);e.bindBuffer(35052,u),e.texSubImage2D(r,y,l,f,p,g,S,k,T),e.bindBuffer(35052,null)}else Yw(n.gl)?Qw(n.gl).texSubImage2D(r,y,l,f,p,g,S,k,u):n.gl.texSubImage2D(r,y,l,f,S,k,u)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){return Ww.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof cx?{data:t.handle,dataType:"buffer"}:t instanceof px?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t,n=e.format,i=e.data,r=e.width,o=e.height,a=e.dataFormat,s=e.type,u=e.compressed,c=lx[n];return{dataFormat:a=a||c&&c.dataFormat,type:s=s||c&&c.types[0],compressed:u=u||c&&c.compressed,width:r=(t=this._deduceImageSize(i,r,o)).width,height:o=t.height,format:n,data:i}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return Hk(i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},"Could not deduced texture size"),Hk(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Hk(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Hk(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!(Yw(this.gl)||!this.width||!this.height||Yk(this.width)&&Yk(this.height))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===dx.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&function(e,t){var n=lx[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=Yw(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}(e,n))&&(!i||function(e,t){var n=lx[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}(e,n))),r}}]),i}(Zk);function gx(e,t){return Hk("string"==typeof e),e=""+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(r){i(r)}})}var mx=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),Kw(e),(r instanceof Promise||"string"==typeof r)&&(r={data:r}),"string"==typeof r.data&&(r=Object.assign({},r,{data:gx(r.data)})),(i=t.call(this,e,Object.assign({},r,{target:3553}))).initialize(r),Object.seal(c(i)),i}return b(n,null,[{key:"isSupported",value:function(e,t){return vx.isSupported(e,t)}}]),n}(vx),yx="EXT_color_buffer_float",bx={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:yx,bpp:2},33327:{gl2:yx,bpp:4},34842:{gl2:yx,bpp:8},33326:{gl2:yx,bpp:4},33328:{gl2:yx,bpp:8},34836:{gl2:yx,bpp:16},35898:{gl2:yx,bpp:4}},_x=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),(i=t.call(this,e,r)).initialize(r),Object.seal(c(i)),i}return b(n,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,o=void 0===r?1:r,a=e.samples,s=void 0===a?0:a;return Hk(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Yw(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,o):this.gl.renderbufferStorage(36161,t,i,o),this.format=t,this.width=i,this.height=o,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*bx[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},n=t.format;return!n||function(e,t,n){var i=n[t];if(!i)return!1;var r=Yw(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,n,bx)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),n}(Zk),wx="clear: bad arguments";function kx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.color,o=void 0===r?null:r,a=t.depth,s=void 0===a?null:a,u=t.stencil,c=void 0===u?null:u,l={};i&&(l.framebuffer=i);var h=0;o&&(h|=16384,!0!==o&&(l.clearColor=o)),s&&(h|=256,!0!==s&&(l.clearDepth=s)),c&&(h|=1024,!0!==s&&(l.clearStencil=s)),Hk(0!==h,wx),Tk(e,l,function(){e.clear(h)})}function xx(e,t,n,i,r,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(i,r)}function Sx(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function a(e){xx(o,i,r,a,s,"next",e)}function s(e){xx(o,i,r,a,s,"throw",e)}a(void 0)})}}var Ex=[34069,34070,34071,34072,34073,34074],Cx=function(){var e=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),Kw(e),(i=t.call(this,e,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(c(i)),i}return b(n,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,o=void 0===r?{}:r;return this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(o)}),this}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,o=e.y,a=void 0===o?0:o,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:a,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(e){var t=e.width,n=e.height,i=e.pixels,r=e.data,o=e.border,a=void 0===o?0:o,s=e.format,u=void 0===s?6408:s,c=e.type,l=void 0===c?5121:c,h=this;return Sx(regeneratorRuntime.mark(function e(){var o,s,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=h.gl,s=i||r,e.next=4,Promise.all(Ex.map(function(e){var t=s[e];return Promise.all(Array.isArray(t)?t:[t])}));case 4:c=e.sent,h.bind(),Ex.forEach(function(e,i){c[i].length>1&&!1!==h.opts.mipmaps&&Ww.warn("".concat(h.id," has mipmap and multiple LODs."))(),c[i].forEach(function(i,r){t&&n?o.texImage2D(e,r,u,t,n,a,u,l,i):o.texImage2D(e,r,u,u,l,i)})}),h.unbind();case 6:case"end":return e.stop()}},e)}))()}},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,o=e.pixels,a=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,h=e.type,f=void 0===h?5121:h,d=this.gl,p=o||a;return this.bind(),p instanceof Promise?p.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,f,p):d.texImage2D(n,0,l,l,f,p),this}}]),n}(vx);return e.FACES=Ex,e}(),Ox=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),Qw(e),(i=t.call(this,e,r=Object.assign({depth:1},r,{target:32879,unpackFlipY:!1}))).initialize(r),Object.seal(c(i)),i}return b(n,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,o=void 0===r?6408:r,a=e.width,s=e.height,u=e.depth,c=void 0===u?1:u,l=e.border,h=void 0===l?0:l,f=e.format,d=e.type,p=void 0===d?5121:d,v=e.offset,g=void 0===v?0:v,m=e.data,y=e.parameters,b=void 0===y?{}:y;return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Tk(this.gl,b,function(){ArrayBuffer.isView(m)&&t.gl.texImage3D(t.target,i,o,a,s,c,h,f,p,m),m instanceof cx&&(t.gl.bindBuffer(35052,m.handle),t.gl.texImage3D(t.target,i,o,a,s,c,h,f,p,g))}),this._trackAllocatedMemory(m&&m.byteLength?m.byteLength:this.width*this.height*this.depth*(hx[this.dataFormat]||4)*(fx[this.type]||1),"Texture"),this.loaded=!0,this}}],[{key:"isSupported",value:function(e){return Yw(e)}}]),n}(vx);function Tx(e,t){var n=e.gl,i=e.width,r=e.height,o=e.id;return new Ix(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:i,height:r,attachments:{36064:e}}))}function Ax(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,o=void 0===r?0:r,a=t.sourceFormat,s=void 0===a?6408:a,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,h=void 0===l?null:l,f=t.sourceWidth,d=t.sourceHeight,p=t.sourceType,v=function(e){return e instanceof Ix?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Tx(e),deleteFramebuffer:!0}}(e),g=v.framebuffer,m=v.deleteFramebuffer;Hk(g);var y=g.gl,b=g.handle,_=g.attachments;f=f||g.width,d=d||g.height,36064===c&&null===b&&(c=1028),Hk(_[c]),h=function(e,t,n,i,r){return e||new(ex(t=t||5121,{clamped:!1}))(i*r*function(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Hk(!1),0}}(n))}(h,p=p||_[c].type,s,f,d),p=p||Jk(h);var w=y.bindFramebuffer(36160,b);return y.readPixels(i,o,f,d,s,p,h),y.bindFramebuffer(36160,w||null),m&&g.delete(),h}function Px(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,o=void 0===r?Number.MAX_SAFE_INTEGER:r,a=Ax(e,{sourceAttachment:i}),s=e.width,u=e.height;u>o;){var c=tx({data:a,width:s,height:u});a=c.data,s=c.width,u=c.height}!function(e){var t=e.data,n=e.height,i=e.bytesPerPixel,r=e.temp,o=e.width*(void 0===i?4:i);r=r||new Uint8Array(o);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:{};return m(this,r),(t=i.call(this,e,n)).width=null,t.height=null,t.attachments={},t.readBuffer=36064,t.drawBuffers=[36064],t.ownResources=[],t.initialize(n),Object.seal(c(t)),t}return b(r,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=Qw(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=Qw(this.gl);return e.getParameter(e.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}},{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,o=e.attachments,a=void 0===o?null:o,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,h=e.stencil,f=void 0!==h&&h,d=e.check,p=void 0===d||d,v=e.readBuffer,g=e.drawBuffers;if(Hk(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,a)for(var m in a){var y=a[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else a=this._createDefaultAttachments(u,l,f,n,r);this.update({clearAttachments:!0,attachments:a,readBuffer:v,drawBuffers:g}),a&&p&&this.checkStatus()}},{key:"delete",value:function(){var t,n=_(this.ownResources);try{for(n.s();!(t=n.n()).done;){t.value.delete()}}catch(i){n.e(i)}finally{n.f()}return e(p(r.prototype),"delete",this).call(this),this}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,o=e.clearAttachments,a=void 0!==o&&o,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:a,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Hk(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&Ww.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.clearAttachments,o=void 0!==r&&r,a=i.resizeAttachments,s=void 0===a||a,u={};o&&Object.keys(this.attachments).forEach(function(e){u[e]=null}),Object.assign(u,e);var c=this.gl.bindFramebuffer(36160,this.handle);for(var l in u){Hk(void 0!==l,"Misspelled framebuffer binding point?");var h=Number(l),f=u[h],d=f;if(d)if(d instanceof _x)this._attachRenderbuffer({attachment:h,renderbuffer:d});else if(Array.isArray(f)){var p=t(f,3),v=p[0],g=p[1],m=void 0===g?0:g,y=p[2],b=void 0===y?0:y;d=v,this._attachTexture({attachment:h,texture:v,layer:m,level:b})}else this._attachTexture({attachment:h,texture:d,layer:0,level:0});else this._unattach(h);s&&d&&d.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!n.attachments[e]}).forEach(function(e){delete n.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.getStatus();if(36053!==e)throw new Error(function(e){return(r.STATUS||{})[e]||"Framebuffer error ".concat(e)}(e));return this}},{key:"getStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),n}},{key:"clear",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.color,r=n.depth,o=n.stencil,a=n.drawBuffers,s=void 0===a?[]:a,u=this.gl.bindFramebuffer(36160,this.handle);return(i||r||o)&&kx(this.gl,{color:i,depth:r,stencil:o}),s.forEach(function(n,i){!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.framebuffer,r=void 0===i?null:i,o=n.buffer,a=void 0===o?6144:o,s=n.drawBuffer,u=void 0===s?0:s,c=n.value,l=void 0===c?[0,0,0,0]:c;Qw(e),Tk(e,{framebuffer:r},function(){switch(a){case 6144:switch(l.constructor){case Int32Array:e.clearBufferiv(a,u,l);break;case Uint32Array:e.clearBufferuiv(a,u,l);break;case Float32Array:default:e.clearBufferfv(a,u,l)}break;case 6145:e.clearBufferfv(6145,0,[l]);break;case 6146:e.clearBufferiv(6146,0,[l]);break;case 34041:var n=t(l,2),i=n[0],r=n[1];e.clearBufferfi(34041,0,i,r);break;default:Hk(!1,wx)}})}(e.gl,{drawBuffer:i,value:n})}),this.gl.bindFramebuffer(36160,u||null),this}},{key:"readPixels",value:function(){return Ww.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){return Ww.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){return Ww.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){return Ww.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){return Ww.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){return Ww.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,o=e.y,a=void 0===o?0:o,s=e.width,u=e.height,c=Qw(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===a&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,a,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Wk(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],r={},o=_(i);try{for(o.s();!(e=o.n()).done;){var a=e.value;r[n?Wk(this.gl,a):a]=this.getAttachmentParameter(t,a,n)}}catch(s){o.e(s)}finally{o.f()}return r}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Object.keys(this.attachments),n={},i=0,r=t;i0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>Ww.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Px(this,{targetMaxHeight:100});return Ww.image({logLevel:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?36160:t;return this.gl.bindFramebuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?36160:t;return this.gl.bindFramebuffer(n,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,i,r){var o=null;return e&&((o=o||{})[36064]=new mx(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&n?((o=o||{})[33306]=new _x(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new _x(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}),this.ownResources.push(o[36096])):n&&Hk(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];!t||(t instanceof _x?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,o=e.level,a=this.gl;switch(a.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:Qw(a).framebufferTextureLayer(36160,n,i.target,o,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);a.framebufferTexture2D(36160,n,s,i.handle,o);break;case 3553:a.framebufferTexture2D(36160,n,3553,i.handle,o);break;default:Hk(!1,"Illegal texture type")}a.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=function(e){return Yw(e)?e:null}(this.gl);t?t.readBuffer(e):Hk(36064===e||1029===e,Mx),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,n=Qw(t);if(n)n.drawBuffers(e);else{var i=t.getExtension("WEBGL_draw_buffers");i?i.drawBuffersWEBGL(e):Hk(1===e.length&&(36064===e[0]||1029===e[0]),Mx)}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=function(e){for(var t in e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},Rx)void 0===e.luma.caps[t]&&(e.luma.caps[t]=Lx(e,t));return e.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat,r=!0;return n&&(r=Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("WEBGL_color_buffer_float")||e.getExtension("OES_texture_float"))),i&&(r=r&&Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("EXT_color_buffer_half_float"))),r}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new r(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),r}(Zk);Ix.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var Rx={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(e){var t=new mx(e,{format:6408,type:5126,dataFormat:6408}),n=new Ix(e,{id:"test-framebuffer",check:!1,attachments:{36064:t}}),i=n.getStatus();return t.delete(),n.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function Dx(e,t){return Nx(e,t)}function Nx(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return Lx(e,t)})}function Lx(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},void 0===e.luma.caps[t]&&(e.luma.caps[t]=function(e,t){var n,i=Rx[t];Hk(i,t);var r=Yw(e)&&i[1]||i[0];if("function"==typeof r)n=r(e);else if(Array.isArray(r)){n=!0;var o,a=_(r);try{for(a.s();!(o=a.n()).done;){var s=o.value;n=n&&Boolean(e.getExtension(s))}}catch(u){a.e(u)}finally{a.f()}}else"string"==typeof r?n=Boolean(e.getExtension(r)):"boolean"==typeof r?n=r:Hk(!1);return n}(e,t)),e.luma.caps[t]||Ww.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}var jx=function(){function e(t,n){m(this,e),this.opts=n,this.source=t}return b(e,[{key:"value",get:function(){return this.source.value}},{key:"getValue",value:function(){var e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];var n=this.source.value,i=t.size,r=n;if(n&&n.length!==i){r=new Float32Array(i);for(var o=t.elementOffset||0,a=0;ai&&(r=i);var o=this._pool,a=e.BYTES_PER_ELEMENT*r,s=o.findIndex(function(e){return e.byteLength>=a});if(s>=0){var u=new e(o.splice(s,1)[0],0,r);return n&&u.fill(0),u}return new e(r)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.props.poolSize&&t.shift()}}}]),e}());Math;var Bx=1/180*Math.PI,Vx={};function zx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,i=void 0===n?Vx.precision||4:n;return e=function(e){return Math.round(e/Vx.EPSILON)*Vx.EPSILON}(e),"".concat(parseFloat(e.toPrecision(i)))}function Ux(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hx(e,t,n){if(Ux(e)){n=n||function(e){return e.clone?e.clone():new Array(e.length)}(e);for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+zx(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t2&&void 0!==arguments[2]?arguments[2]:"";if(Vx.debug&&!function(e,t){if(e.length!==t)return!1;for(var n=0;n=0&&e=0&&e0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return m(this,n),e=t.call(this,-0,-0,-0),1===arguments.length&&Ux(i)?e.copy(i):(Vx.debug&&(Qx(i),Qx(r),Qx(o)),e[0]=i,e[1]=r,e[2]=o),e}return b(n,[{key:"set",value:function(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}},{key:"fromObject",value:function(e){return Vx.debug&&(Qx(e.x),Qx(e.y),Qx(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=Qx(e)}},{key:"angle",value:function(e){return function(e,t){var n=e[0],i=e[1],r=e[2],o=t[0],a=t[1],s=t[2],u=Math.sqrt(n*n+i*i+r*r)*Math.sqrt(o*o+a*a+s*s),c=u&&oS(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}(this,e)}},{key:"cross",value:function(e){return aS(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin;return function(e,t,n,i){var r=[],o=[];r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],o[0]=r[0],o[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),o[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2]}(this,this,void 0===n?lS:n,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin;return function(e,t,n,i){var r=[],o=[];r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],o[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),o[1]=r[1],o[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2]}(this,this,void 0===n?lS:n,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin;return function(e,t,n,i){var r=[],o=[];r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],o[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),o[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),o[2]=r[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2]}(this,this,void 0===n?lS:n,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return sS(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return uS(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return function(e,t,n){var i=t[0],r=t[1],o=t[2];e[0]=i*n[0]+r*n[3]+o*n[6],e[1]=i*n[1]+r*n[4]+o*n[7],e[2]=i*n[2]+r*n[5]+o*n[8]}(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,n){var i=t[0],r=t[1];e[0]=n[0]*i+n[2]*r,e[1]=n[1]*i+n[3]*r,e[2]=t[2]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return function(e,t,n){var i=n[0],r=n[1],o=n[2],a=t[0],s=t[1],u=t[2],c=r*u-o*s,l=o*a-i*u,h=i*s-r*a,f=r*h-o*l,d=o*c-i*h,p=i*l-r*c,v=2*n[3];l*=v,h*=v,d*=2,p*=2,e[0]=a+(c*=v)+(f*=2),e[1]=s+l+d,e[2]=u+h+p}(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return hS.ZERO=hS.ZERO||Object.freeze(new n(0,0,0,0))}}]),n}(eS),dS=new fS;function pS(e,t,n,i){dS.set(e,t,n);var r=dS.len();return{distance:i/r,normal:new fS(-e/r,-t/r,-n/r)}}function vS(e){return e-Math.fround(e)}function gS(e,t){var n=t.size,i=void 0===n?1:n,r=t.startIndex,o=void 0===r?0:r,a=t.endIndex;Number.isFinite(a)||(a=e.length);var s=(a-o)/i;cS=Fx.allocate(cS,s,{type:Float32Array,size:2*i});for(var u=o,c=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=_S,r={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?i=e:e.length>0&&(wS.length=e.length,i=wS):i=_S,(t>0||Number.isFinite(n))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(t,n),r.index=t-1),{iterable:i,objectInfo:r}}function xS(e){return e&&e[Symbol.asyncIterator]}function SS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};return Array.isArray(e)?ES(e,t,[]):t(e)?[e]:[]}function ES(e,t,n){for(var i=-1;++ic)n.set(t.subarray(0,c),r);else if(n.set(t,r),s)for(var l=u;l=d)){var v=p?i.value:i.getBuffer().getData({srcByteOffset:l});if(i.settings.normalized&&!p){var g=s;s=function(e,t){return i._normalizeConstant(g(e,t))}}var m=p?function(e,t){return s(v,t)}:function(e,t){return s(v.subarray(e,e+c),t)},y=t.getData({length:r}),b=new Float32Array(d);(function(e){var t=e.source,n=e.target,i=e.size,r=e.getData,o=e.sourceStartIndices,a=e.targetStartIndices;if(!Array.isArray(a))return AS({source:t,target:n,size:i,getData:r}),n;for(var s=0,u=0,c=r&&function(e,t){return r(e+u,t)},l=Math.min(o.length,a.length),h=1;h1&&void 0!==arguments[1]?arguments[1]:{};m(this,r),t=i.call(this,e,n);var o=n.transition,a=void 0!==o&&o,s=n.noAlloc,u=void 0!==s&&s,c=n.update,l=void 0===c?null:c,h=n.accessor,f=void 0===h?null:h,d=n.transform,p=void 0===d?null:d,v=n.startIndices,g=void 0===v?null:v;return Object.assign(t.settings,{transition:a,noAlloc:u,update:l||f&&t._autoUpdater,accessor:f,transform:p}),Object.assign(t.state,{lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:TS,startIndices:g}),Object.seal(t.settings),Object.seal(t.state),t._validateAttributeUpdaters(),t}return b(r,[{key:"startIndices",get:function(){return this.state.startIndices},set:function(e){this.state.startIndices=e}},{key:"needsUpdate",value:function(){return this.state.needsUpdate}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.clearChangedFlags,n=void 0!==t&&t,i=this.state.needsRedraw;return this.state.needsRedraw=i&&!n,i}},{key:"getUpdateTriggers",value:function(){var e=this.settings.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"supportsTransition",value:function(){return Boolean(this.settings.transition)}},{key:"getTransitionSetting",value:function(e){if(!e||!this.supportsTransition())return null;var t=this.settings.accessor,n=this.settings.transition;return MS(Array.isArray(t)?e[t.find(function(t){return e[t]})]:e[t],n)}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,o=void 0===r?1/0:r;this.state.updateRanges=function(e,t){if(e===TS||(t[0]<0&&(t[0]=0),t[0]>=t[1]))return e;for(var n=[],i=e.length,r=0,o=0;ot[1]?n.push(a):t=[Math.min(a[0],t[0]),Math.max(a[1],t[1])]}return n.splice(r,0,t),n}(this.state.updateRanges,[i,o])}else this.state.updateRanges=TS}},{key:"clearNeedsUpdate",value:function(){this.state.needsUpdate=!1,this.state.updateRanges=OS}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||e}},{key:"update",value:function(e){this.setData(e)}},{key:"allocate",value:function(t){var n=this.state,i=this.settings;return!i.noAlloc&&!!i.update&&(e(p(r.prototype),"allocate",this).call(this,{numInstances:t,copy:n.updateRanges!==TS}),!0)}},{key:"updateBuffer",value:function(n){var i=n.numInstances,o=n.data,a=n.props,s=n.context;if(!this.needsUpdate())return!1;var u=this.state.updateRanges,c=this.settings,l=c.update,h=c.noAlloc,f=!0;if(l){var d,v=_(u);try{for(v.s();!(d=v.n()).done;){var g=t(d.value,2),m=g[0],y=g[1];l.call(s,this,{data:o,startRow:m,endRow:y,props:a,numInstances:i})}}catch(O){v.e(O)}finally{v.f()}if(this.value)if(this.constant||this.buffer.byteLength1&&void 0!==arguments[1]?arguments[1]:null,n=this.state,i=this.settings;return e?!(i.noAlloc||(n.binaryValue===e?(this.clearNeedsUpdate(),0):(n.binaryValue=e,this.setNeedsRedraw(),ArrayBuffer.isView(e)&&(e={value:e}),i.transform||t!==this.startIndices?(bS(ArrayBuffer.isView(e.value),"invalid ".concat(i.accessor)),n.binaryAccessor=function(e,t){var n=t.size,i=t.stride,r=t.offset,o=t.startIndices,a=t.nested,s=e.BYTES_PER_ELEMENT,u=i?i/s:n,c=r?r/s:0,l=Math.floor((e.length-c)/u);return function(t,i){var r=i.index,s=i.target;if(!o){for(var h=r*u+c,f=0;fl?c.set(x,g):(e._normalizeValue(x,b.target,0),CS({target:c,source:b.target,start:g,count:S}));g+=S*l}else e._normalizeValue(x,c,g),g+=l}}catch(A){w.e(A)}finally{w.f()}}}},{key:"_validateAttributeUpdaters",value:function(){var e=this.settings;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}},{key:"_checkAttributeArray",value:function(){var e=this.value,t=Math.min(4,this.size);if(e&&e.length>=t){var n=!0;switch(t){case 4:n=n&&Number.isFinite(e[3]);case 3:n=n&&Number.isFinite(e[2]);case 2:n=n&&Number.isFinite(e[1]);case 1:n=n&&Number.isFinite(e[0]);break;default:n=!1}if(!n)throw new Error("Illegal attribute generated for ".concat(this.id))}}}]),r}(function(){function e(t,n){m(this,e),this.gl=t,this.id=n.id,this.size=n.size;var i=n.logicalType||n.type,r=5130===i,o=n.defaultValue;o=Number.isFinite(o)?[o]:o||new Array(this.size).fill(0),n.defaultValue=o;var a=i;r?a=5126:!a&&n.isIndexed?a=t&&Dx(t,"ELEMENT_INDEX_UINT32")?5125:5123:a||(a=5126),n.logicalType=i,n.type=a;var s=function(e){switch(e){case 5126:return Float32Array;case 5130:return Float64Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return Uint8ClampedArray;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Unknown GL type")}}(i||a||5126);this.shaderAttributes={},this.doublePrecision=r,r&&!1===n.fp64&&(s=Float32Array),n.bytesPerElement=s.BYTES_PER_ELEMENT,this.defaultType=s,this.value=null,this.settings=n,this.state={externalBuffer:null,bufferAccessor:n,allocatedValue:null,constant:!1},this._buffer=null,this.setData(n)}return b(e,[{key:"buffer",get:function(){if(!this._buffer){var e=this.settings,t=e.isIndexed,n=e.type;this._buffer=new cx(this.gl,{id:this.id,target:t?34963:34962,accessor:{type:n}})}return this._buffer}},{key:"byteOffset",get:function(){var e=this.getAccessor();return e.vertexOffset?e.vertexOffset*mS(e):0}},{key:"delete",value:function(){this._buffer&&(this._buffer.delete(),this._buffer=null),Fx.release(this.state.allocatedValue)}},{key:"getShaderAttributes",value:function(e,t){if(this.doublePrecision){var n={},i=this.value instanceof Float64Array,r=function(e,t){var n=yS(e,t);return{high:n,low:I(M({},n),{offset:n.offset+4*e.size})}}(this.getAccessor(),t||{});return n[e]=new jx(this,r.high),n["".concat(e,"64Low")]=i?new jx(this,r.low):new Float32Array(this.size),n}if(t){var a=yS(this.getAccessor(),t);return o({},e,new jx(this,a))}return o({},e,this)}},{key:"getBuffer",value:function(){return this.state.constant?null:this.state.externalBuffer||this._buffer}},{key:"getValue",value:function(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}},{key:"getAccessor",value:function(){return this.state.bufferAccessor}},{key:"setData",value:function(e){var t=this.state;ArrayBuffer.isView(e)?e={value:e}:e instanceof cx&&(e={buffer:e});var n=M(M({},this.settings),e);if(t.bufferAccessor=n,e.constant){var i=e.value;if(i=this._normalizeValue(i,[],0),this.settings.normalized&&(i=this._normalizeConstant(i)),t.constant&&this._areValuesEqual(i,this.value))return!1;t.externalBuffer=null,t.constant=!0,this.value=i}else if(e.buffer){var r=e.buffer;t.externalBuffer=r,t.constant=!1,this.value=e.value;var o=e.value instanceof Float64Array;n.type=e.type||r.accessor.type,n.bytesPerElement=r.accessor.BYTES_PER_ELEMENT*(o?2:1),n.stride=mS(n)}else if(e.value){this._checkExternalBuffer(e);var a=e.value;t.externalBuffer=null,t.constant=!1,this.value=a,n.bytesPerElement=a.BYTES_PER_ELEMENT,n.stride=mS(n);var s=this.buffer,u=this.byteOffset;this.doublePrecision&&a instanceof Float64Array&&(a=gS(a,n));var c=a.byteLength+u+2*n.stride;s.byteLength0&&void 0!==arguments[0]?arguments[0]:{},t=this.value,n=e.startOffset,i=void 0===n?0:n,r=e.endOffset;this.buffer.subData({data:this.doublePrecision&&t instanceof Float64Array?gS(t,{size:this.size,startIndex:i,endIndex:r}):t.subarray(i,r),offset:i*t.BYTES_PER_ELEMENT+this.byteOffset})}},{key:"allocate",value:function(e){var t=e.numInstances,n=e.copy,i=void 0!==n&&n,r=this.state,o=r.allocatedValue,a=Fx.allocate(o,t+1,{size:this.size,type:this.defaultType,copy:i});this.value=a;var s=this.buffer,u=this.byteOffset;return s.byteLength=0;)t[n+a]=Number.isFinite(e[a])?e[a]:r[a]}return t}},{key:"_areValuesEqual",value:function(e,t){if(!e||!t)return!1;for(var n=this.size,i=0;i0&&FS[e]&&(t=FS[e]).call.apply(t,arguments)}function VS(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}var zS="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",US="#version 300 es\n".concat(zS);function HS(e,n){n=Array.isArray(n)?n:[n];var i=t(e.replace(/^\s+/,"").split(/\s+/),3),r=i[0],o=i[1],a=i[2];return n.includes(r)&&o&&a?{qualifier:r,type:o,name:a.split(";")[0]}:null}function GS(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,o=e.output;if(!i)return 300===n?US:n>300?"#version ".concat(n,"\n").concat(zS):"void main() {gl_FragColor = vec4(0);}";var a=function(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return VS(!1),null}}(i,r);return n>=300?"#version ".concat(n," ").concat(300===n?"es":"","\nin ").concat(r," ").concat(i,";\nout vec4 ").concat(o,";\nvoid main() {\n ").concat(o," = ").concat(a,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(a,";\n}")}var WS=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),Qw(e),(i=t.call(this,e,r)).initialize(r),i.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(c(i)),i}return b(n,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Kk(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),o=r.buffer,a=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=o,Ww.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,o,s,a),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof cx?i=e:(i=e.buffer,n=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==n)&&(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}],[{key:"isSupported",value:function(e){return Yw(e)}}]),n}(Zk),qS=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(n),Object.seal(this)}return b(e,[{key:"setupResources",value:function(e){var t,n=_(this.bindings);try{for(n.s();!(t=n.n()).done;){var i=t.value;this._setupTransformFeedback(i,e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"updateModelProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.varyings;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}},{key:"getDrawOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.bindings[this.currentIndex],n=t.sourceBuffers,i=t.transformFeedback;return{attributes:Object.assign({},n,e.attributes),transformFeedback:i}}},{key:"swap",value:function(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(e)}},{key:"getBuffer",value:function(e){var t=this.bindings[this.currentIndex].feedbackBuffers,n=e?t[e]:null;return n?n instanceof cx?n:n.buffer:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=this.getBuffer(t);return n?n.getData():null}},{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete()}},{key:"_initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Hk(Yw(this.gl))}},{key:"_getFeedbackBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?{}:t,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(var r in this.feedbackMap){var o=this.feedbackMap[r];r in n&&(i[o]=r)}for(var a in Object.assign(i,e.feedbackBuffers),i){var s=i[a];if("string"==typeof s){var u=n[s],c=u.byteLength,l=u.usage,h=u.accessor;i[a]=this._createNewBuffer(a,{byteLength:c,usage:l,accessor:h})}}return i}},{key:"_setupBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.sourceBuffers,n=void 0===t?null:t;Object.assign(this.feedbackMap,e.feedbackMap);var i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:n,feedbackBuffers:i})}},{key:"_setupTransformFeedback",value:function(e,t){var n=t.model.program;e.transformFeedback=new WS(this.gl,{program:n,buffers:e.feedbackBuffers})}},{key:"_updateBindings",value:function(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){var t=this._swapBuffers(this.bindings[this.currentIndex]),n=t.sourceBuffers,i=t.feedbackBuffers,r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:n,feedbackBuffers:i})}}},{key:"_updateBinding",value:function(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}},{key:"_swapBuffers",value:function(e){if(!this.feedbackMap)return null;var t=Object.assign({},e.sourceBuffers),n=Object.assign({},e.feedbackBuffers);for(var i in this.feedbackMap){var r=this.feedbackMap[i];t[i]=e.feedbackBuffers[r],n[r]=e.sourceBuffers[i],Hk(n[r]instanceof cx)}return{sourceBuffers:t,feedbackBuffers:n}}},{key:"_createNewBuffer",value:function(e,t){var n=new cx(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=n,n}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}}]),e}();function XS(e){var t=100,n=e.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}var YS="vs",KS=(o(d={},YS,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),o(d,"fs","#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),d),QS="__LUMA_INJECT_DECLARATIONS__",$S=/void\s+main\s*\([^)]*\)\s*\{\n?/,ZS=/}\n?[^{}]*$/,JS=[];function eE(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t===YS,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),JS.length=i.length;for(var o=0,a=i.length;o1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}var nE={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},iE="transform_uSize_",rE="transform_position",oE={10241:9728,10240:9728,10242:33071,10243:33071},aE=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(n),Object.seal(this)}return b(e,[{key:"updateModelProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e);return Object.assign({},e,t)}},{key:"getDrawOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.bindings[this.currentIndex],n=t.sourceBuffers,i=t.sourceTextures,r=t.framebuffer,o=t.targetTexture,a=Object.assign({},n,e.attributes),s=Object.assign({},e.uniforms),u=Object.assign({},e.parameters),c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){for(var l in a.transform_elementID=this.elementIDBuffer,this.samplerTextureMap)s[l]=i[this.samplerTextureMap[l]];this._setSourceTextureParameters();var h=function(e){var t,n,i,r=e.sourceTextureMap,o=e.targetTextureVarying,a=e.targetTexture,s={};for(var u in o&&(n=(t=a).width,i=t.height,s["".concat(iE).concat(o)]=[n,i]),r){var c;n=(c=r[u]).width,i=c.height,s["".concat(iE).concat(u)]=[n,i]}return s}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:o});Object.assign(s,h)}return this.hasTargetTexture&&(c=!1,u.viewport=[0,0,r.width,r.height]),{attributes:a,framebuffer:r,uniforms:s,discard:c,parameters:u}}},{key:"swap",value:function(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupTextures(e)}},{key:"getTargetTexture",value:function(){return this.bindings[this.currentIndex].targetTexture}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.packed,n=void 0!==t&&t,i=this.bindings[this.currentIndex].framebuffer,r=Ax(i);if(!n)return r;for(var o=r.constructor,a=function(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return VS(!1),null}}(this.targetTextureType),s=new o(r.length*a/4),u=0,c=0;c0&&void 0!==arguments[0]?arguments[0]:{},t=e._targetTextureVarying,n=e._swapTexture;this._swapTexture=n,this.targetTextureVarying=t,this.hasTargetTexture=t,this._setupTextures(e)}},{key:"_createTargetTexture",value:function(e){var t=e.sourceTextures,n=e.textureOrReference;if(n instanceof mx)return n;var i=t[n];return i?(this._targetRefTexName=n,this._createNewTexture(i)):null}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.sourceBuffers,n=e._sourceTextures,i=void 0===n?{}:n,r=e._targetTexture,o=this._createTargetTexture({sourceTextures:i,textureOrReference:r});this.hasSourceTextures=this.hasSourceTextures||i&&Object.keys(i).length>0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:o}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}},{key:"_updateElementIDBuffer",value:function(e){if(!("number"!=typeof e||this.elementCount>=e)){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new cx(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}}},{key:"_updateBindings",value:function(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){var t=this._swapTextures(this.bindings[this.currentIndex]),n=t.sourceTextures,i=t.targetTexture,r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:n,targetTexture:i})}}},{key:"_updateBinding",value:function(e,t){var n=t.sourceBuffers,i=t.sourceTextures,r=t.targetTexture;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,i),Object.assign(e.sourceBuffers,n),r){e.targetTexture=r;var o=r.width,a=r.height,s=e.framebuffer;s?(s.update({attachments:{36064:r},resizeAttachments:!1}),s.resize({width:o,height:a})):e.framebuffer=new Ix(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:r}})}return e}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex,t=this.bindings[e].sourceTextures;for(var n in t)t[n].setParameters(oE)}},{key:"_swapTextures",value:function(e){if(!this._swapTexture)return null;var t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}},{key:"_createNewTexture",value:function(e){var t=function(e,t){Hk(e instanceof mx||e instanceof Cx||e instanceof Ox);var n=e.constructor,i=e.gl,r=e.width,o=e.height,a=e.format,s=e.type,u=e.dataFormat,c=e.border,l=e.mipmaps;return new n(i,Object.assign({width:r,height:o,format:a,type:s,dataFormat:u,border:c,mipmaps:l},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}},{key:"_processVertexShader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.bindings[this.currentIndex],n=t.sourceTextures,i=t.targetTexture,r=function(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,o=Object.keys(n).length,a=null,s={},u=t,c={};if(o>0||i){var l=u.split("\n"),h=l.slice();if(l.forEach(function(e,t,r){if(o>0){var u=function(e,t){var n={},i=function(e){return HS(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,o=i.name;if(o&&t[o]){var a="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="transform_uSampler_".concat(e),n="".concat(iE).concat(e);return{samplerName:t,sizeName:n,uniformDeclerations:" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";")}}(o),u=s.samplerName,c=s.sizeName,l=s.uniformDeclerations,h=" ".concat(r," ").concat(o," = transform_getInput(").concat(u,", ").concat(c,").").concat(function(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return VS(!1),null}}(r),";\n");return n[u]=o,{updatedLine:a,inject:{"vs:#decl":l,"vs:#main-start":h},samplerTextureMap:n}}return null}(e,n);if(u){var l=u.updatedLine,f=u.inject;h[t]=l,c=tE([c,f]),Object.assign(s,u.samplerTextureMap),o--}}i&&!a&&(a=function(e,t){var n=HS(e,["varying","out"]);return n&&n.name===t?n.type:null}(e,i))}),i){Hk(r);var f="".concat(iE).concat(i);c=tE([c,{"vs:#decl":"uniform vec2 ".concat(f,";\n"),"vs:#main-start":" vec2 ".concat(rE," = transform_getPos(").concat(f,");\n gl_Position = vec4(").concat(rE,", 0, 1.);\n")}])}u=h.join("\n")}return{vs:u,targetTextureType:a,inject:c,samplerTextureMap:s}}({vs:e.vs,sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),o=r.vs,a=r.uniforms,s=r.targetTextureType,u=r.inject,c=r.samplerTextureMap,l=tE([e.inject||{},u]);return this.targetTextureType=s,this.samplerTextureMap=c,{vs:o,fs:e._fs||GS({version:XS(o),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[nE].concat(e.modules||[]):e.modules,uniforms:a,inject:l}}}]),e}(),sE={number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},array:{validate:function(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function uE(e){var t=cE(e);return"object"===t?e?"type"in e?Object.assign({},e,sE[e.type]):"value"in e?(t=cE(e.value),Object.assign({type:t},e,sE[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},sE[t])}function cE(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}var lE=function(){function e(t){var n=t.name,i=t.vs,r=t.fs,o=t.dependencies,a=void 0===o?[]:o,s=t.uniforms,u=t.getUniforms,c=t.deprecations,l=void 0===c?[]:c,h=t.defines,f=void 0===h?{}:h,d=t.inject,p=void 0===d?{}:d,v=t.vertexShader,g=t.fragmentShader;m(this,e),VS("string"==typeof n),this.name=n,this.vs=i||v,this.fs=r||g,this.getModuleUniforms=u,this.dependencies=a,this.deprecations=this._parseDeprecationDefinitions(l),this.defines=f,this.injections=function(e){var t={vs:{},fs:{}};for(var n in e){var i=e[n];"string"==typeof i&&(i={order:0,injection:i}),t[n.slice(0,2)][n]=i}return t}(p),s&&(this.uniforms=function(e){var t={};for(var n in e){var i=uE(e[n]);t[n]=i}return t}(s))}return b(e,[{key:"getModuleSource",value:function(e){var t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:VS(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(t,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,t){this.deprecations.forEach(function(n){n.regex.test(e)&&(n.deprecated?t.deprecated(n.old,n.new)():t.removed(n.old,n.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=this.uniforms;for(var i in n){var r=n[i];i in e&&!r.private?(r.validate&&VS(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function hE(e){return function(e){var t={},n={};return fE({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}(dE(e))}function fE(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var o,a=_(t);try{for(a.s();!(o=a.n()).done;){var s=o.value;i[s.name]=s,(void 0===r[s.name]||r[s.name]2&&void 0!==arguments[2]?arguments[2]:{},i=pE[t];if(VS(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in mE)return mE[t];var r="#extension GL_".concat(i[0]," : ").concat(n.behavior||"enable","\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,r),e.compileShader(o);var a=e.getShaderParameter(o,35713);return e.deleteShader(o),mE[t]=a,a}function bE(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return function(e,t){var n=pE[t];VS(n,t);var i=function(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return VS(!1===r||!0===r),r}(e,t)})}function _E(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}var wE=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],kE=[].concat(wE,[[_E("attribute"),"in $1"],[_E("varying"),"out $1"]]),xE=[].concat(wE,[[_E("varying"),"in $1"]]),SE=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],EE=[].concat(SE,[[_E("in"),"attribute $1"],[_E("out"),"varying $1"]]),CE=[].concat(SE,[[_E("in"),"varying $1"]]),OE="gl_FragColor",TE=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,AE=/void\s+main\s*\([^)]*\)\s*\{\n?/;function PE(e,n){var i,r=_(n);try{for(r.s();!(i=r.n()).done;){var o=t(i.value,2),a=o[0],s=o[1];e=e.replace(a,s)}}catch(u){r.e(u)}finally{r.f()}return e}var ME="\n\n".concat(QS,"\n\n"),IE=(o(g={},YS,"vertex"),o(g,"fs","fragment"),g);function RE(e,n){var i=n.id,r=n.source,o=n.type,a=n.modules,s=n.defines,u=void 0===s?{}:s,c=n.hookFunctions,l=void 0===c?[]:c,h=n.inject,f=void 0===h?{}:h,d=n.transpileToGLSL100,p=void 0!==d&&d,v=n.prologue,g=void 0===v||v,m=n.log;VS("string"==typeof r,"shader source must be a string");var y=o===YS,b=r.split("\n"),w=100,k="",x=r;0===b[0].indexOf("#version ")?(w=300,k=b[0],x=b.slice(1).join("\n")):k="#version ".concat(w);var S={};a.forEach(function(e){Object.assign(S,e.getDefines())}),Object.assign(S,u);var E,C=g?"".concat(k,"\n").concat(function(e){var t=e.id,n=e.type;return t&&"string"==typeof t&&-1===e.source.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(IE[n],"\n\n"):""}({id:i,source:r,type:o}),"\n").concat((E={type:o},"\n#define SHADER_TYPE_".concat(IE[E.type].toUpperCase(),"\n")),"\n").concat(function(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||7936),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:gE(n,i),vendor:n,renderer:i,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return bE(e,vE.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),bE(e,vE.GLSL_DERIVATIVES)&&yE(e,vE.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),bE(e,vE.GLSL_FRAG_DATA)&&yE(e,vE.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),bE(e,vE.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}return 0===t&&(n+="\n"),n}(S),"\n").concat(y?"":"precision highp float;\n\n","\n"):"".concat(k,"\n"),O=function(e){var n={vs:{},fs:{}};return e.forEach(function(e){var i;"string"!=typeof e?e=(i=e).hook:i={};var r=t((e=e.trim()).split(":"),2),o=r[0],a=r[1],s=e.replace(/\(.+/,"");n[o][s]=Object.assign(i,{signature:a})}),n}(l),T={},A={},P={};for(var M in f){var I="string"==typeof f[M]?{injection:f[M],order:0}:f[M],R=M.match(/^(v|f)s:(#)?([\w-]+)$/);if(R){var D=R[3];R[2]?"decl"===D?A[M]=[I]:P[M]=[I]:T[M]=[I]}else P[M]=[I]}var N,L=_(a);try{for(L.s();!(N=L.n()).done;){var j=N.value;m&&j.checkDeprecations(x,m),C+=j.getModuleSource(o,w);var F=j.injections[o];for(var B in F){var V=B.match(/^(v|f)s:#([\w-]+)$/);if(V){var z="decl"===V[2]?A:P;z[B]=z[B]||[],z[B].push(F[B])}else T[B]=T[B]||[],T[B].push(F[B])}}}catch(U){L.e(U)}finally{L.f()}return C=eE(C+=ME,o,A),C+=function(e,t){var n="";for(var i in e){var r=e[i];if(n+="void ".concat(r.signature," {\n"),r.header&&(n+=" ".concat(r.header)),t[i]){var o=t[i];o.sort(function(e,t){return e.order-t.order});var a,s=_(o);try{for(s.s();!(a=s.n()).done;){var u=a.value;n+=" ".concat(u.injection,"\n")}}catch(U){s.e(U)}finally{s.f()}}r.footer&&(n+=" ".concat(r.footer)),n+="}\n"}return n}(O[o],T),C=function(e,t,n){switch(t){case 300:return n?PE(e,kE):function(e){var t=(e=PE(e,xE)).match(TE);if(t){var n=t[1];e=e.replace(new RegExp("\\b".concat(OE,"\\b"),"g"),n)}else{var i="fragmentColor";e=e.replace(AE,function(e){return"out vec4 ".concat(i,";\n").concat(e)}).replace(new RegExp("\\b".concat(OE,"\\b"),"g"),i)}return e}(e);case 100:return n?PE(e,EE):function(e){var t=(e=PE(e,CE)).match(TE);if(t){var n=t[1];e=e.replace(TE,"").replace(new RegExp("\\b".concat(n,"\\b"),"g"),OE)}return e}(e);default:throw new Error("unknown GLSL version ".concat(t))}}(C=eE(C+=x,o,P),p?100:w,y)}function DE(e){return function(t){var n,i={},r=_(e);try{for(r.s();!(n=r.n()).done;){var o=n.value.getUniforms(t,i);Object.assign(i,o)}}catch(a){r.e(a)}finally{r.f()}return i}}var NE=(o(y={5126:KE.bind(null,"uniform1fv",zE,1,QE),35664:KE.bind(null,"uniform2fv",zE,2,QE),35665:KE.bind(null,"uniform3fv",zE,3,QE),35666:KE.bind(null,"uniform4fv",zE,4,QE),5124:KE.bind(null,"uniform1iv",UE,1,QE),35667:KE.bind(null,"uniform2iv",UE,2,QE),35668:KE.bind(null,"uniform3iv",UE,3,QE),35669:KE.bind(null,"uniform4iv",UE,4,QE),35670:KE.bind(null,"uniform1iv",UE,1,QE),35671:KE.bind(null,"uniform2iv",UE,2,QE),35672:KE.bind(null,"uniform3iv",UE,3,QE),35673:KE.bind(null,"uniform4iv",UE,4,QE),35674:KE.bind(null,"uniformMatrix2fv",zE,4,$E),35675:KE.bind(null,"uniformMatrix3fv",zE,9,$E),35676:KE.bind(null,"uniformMatrix4fv",zE,16,$E),35678:YE,35680:YE,5125:KE.bind(null,"uniform1uiv",HE,1,QE),36294:KE.bind(null,"uniform2uiv",HE,2,QE),36295:KE.bind(null,"uniform3uiv",HE,3,QE),36296:KE.bind(null,"uniform4uiv",HE,4,QE),35685:KE.bind(null,"uniformMatrix2x3fv",zE,6,$E),35686:KE.bind(null,"uniformMatrix2x4fv",zE,8,$E),35687:KE.bind(null,"uniformMatrix3x2fv",zE,6,$E),35688:KE.bind(null,"uniformMatrix3x4fv",zE,12,$E),35689:KE.bind(null,"uniformMatrix4x2fv",zE,8,$E),35690:KE.bind(null,"uniformMatrix4x3fv",zE,12,$E)},"35678",YE),o(y,"35680",YE),o(y,35679,YE),o(y,35682,YE),o(y,36289,YE),o(y,36292,YE),o(y,36293,YE),o(y,36298,YE),o(y,36299,YE),o(y,36300,YE),o(y,36303,YE),o(y,36306,YE),o(y,36307,YE),o(y,36308,YE),o(y,36311,YE),y),LE={},jE={},FE={},BE=[0];function VE(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(BE[0]=e,e=BE);var r=e.length;if(r%t&&Ww.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var o=i[r];o||(o=new n(r),i[r]=o);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}function JE(e,t){for(var n="",i=0;i0&&void 0!==arguments[0]?arguments[0]:this.source;if(e.startsWith("#version ")||(e="#version 100\n".concat(e)),this.source=e,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){var t=this.gl.getShaderInfoLog(this.handle),n=function(e,t,n,i){for(var r=e.split(/\r?\n/),o={},a={},s=i||ZE(t)||"(unnamed)",u="".concat(function(e){switch(e){case 35632:return"fragment";case 35633:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var o=String(i+t);return eC(o,r-o.length)+n+e})}(t);return{shaderName:u,errors:JE(o,p),warnings:JE(a,p)}}(t,this.source,this.shaderType,this.id),i=n.shaderName,r=n.errors,o=n.warnings;throw Ww.error("GLSL compilation errors in ".concat(i,"\n").concat(r))(),Ww.warn("GLSL compilation warnings in ".concat(i,"\n").concat(o))(),new Error("GLSL compilation errors in ".concat(i))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}],[{key:"getTypeName",value:function(e){switch(e){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Hk(!1),"unknown"}}}]),n}(Zk),nC=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),"string"==typeof i&&(i={source:i}),t.call(this,e,Object.assign({},i,{shaderType:35633}))}return b(n,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),n}(tC),iC=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),"string"==typeof i&&(i={source:i}),t.call(this,e,Object.assign({},i,{shaderType:35632}))}return b(n,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),n}(tC),rC=5126,oC=5124,aC=5125,sC=(o(w={},rC,[rC,1,"float"]),o(w,35664,[rC,2,"vec2"]),o(w,35665,[rC,3,"vec3"]),o(w,35666,[rC,4,"vec4"]),o(w,oC,[oC,1,"int"]),o(w,35667,[oC,2,"ivec2"]),o(w,35668,[oC,3,"ivec3"]),o(w,35669,[oC,4,"ivec4"]),o(w,aC,[aC,1,"uint"]),o(w,36294,[aC,2,"uvec2"]),o(w,36295,[aC,3,"uvec3"]),o(w,36296,[aC,4,"uvec4"]),o(w,35670,[rC,1,"bool"]),o(w,35671,[rC,2,"bvec2"]),o(w,35672,[rC,3,"bvec3"]),o(w,35673,[rC,4,"bvec4"]),o(w,35674,[rC,8,"mat2"]),o(w,35685,[rC,8,"mat2x3"]),o(w,35686,[rC,8,"mat2x4"]),o(w,35675,[rC,12,"mat3"]),o(w,35687,[rC,12,"mat3x2"]),o(w,35688,[rC,12,"mat3x4"]),o(w,35676,[rC,16,"mat4"]),o(w,35689,[rC,16,"mat4x2"]),o(w,35690,[rC,16,"mat4x3"]),w);function uC(e){var n=sC[e];if(!n)return null;var i=t(n,2);return{type:i[0],components:i[1]}}function cC(e,n){switch(e){case 5120:case 5121:case 5122:case 5123:e=rC}for(var i in sC){var r=t(sC[i],3),o=r[0],a=r[1],s=r[2];if(o===e&&a===n)return{glType:i,name:s}}return null}var lC=function(){function e(t){m(this,e),this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}return b(e,[{key:"getAttributeInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var t=this.getAttributeInfo(e);return t?t.location:-1}},{key:"getAttributeAccessor",value:function(e){var t=this.getAttributeInfo(e);return t?t.accessor:null}},{key:"getVaryingInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var t=this.getVaryingInfo();return t?t.location:-1}},{key:"getVaryingAccessor",value:function(e){var t=this.getVaryingInfo();return t?t.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var t=e.gl,n=t.getProgramParameter(e.handle,35721),i=0;i=0&&this._addAttribute(u,o,a,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(Yw(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,e,r)).stubRemovedMethods("Program","v6.0",hC),t._isCached=!1,t.initialize(r),Object.seal(c(t)),t._setId(r.id),t}return b(i,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hash,n=e.vs,i=e.fs,r=e.varyings,o=e.bufferMode,a=void 0===o?35981:o;return this.hash=t||"",this.vs="string"==typeof n?new nC(this.gl,{id:"".concat(e.id,"-vs"),source:n}):n,this.fs="string"==typeof i?new iC(this.gl,{id:"".concat(e.id,"-fs"),source:i}):i,Hk(this.vs instanceof nC),Hk(this.fs instanceof iC),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(Qw(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new lC(this),this.setProps(e)}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:e(p(i.prototype),"delete",this).call(this,t)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,o=e.vertexCount,a=e.offset,s=void 0===a?0:a,u=e.start,c=e.end,l=e.isIndexed,h=void 0!==l&&l,f=e.indexType,d=void 0===f?5123:f,p=e.instanceCount,v=void 0===p?0:p,g=e.isInstanced,m=void 0===g?v>0:g,y=e.vertexArray,b=void 0===y?null:y,_=e.transformFeedback,w=e.framebuffer,k=e.parameters,x=void 0===k?{}:k,S=e.uniforms,E=e.samplers;if((S||E)&&(Ww.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(S||{})),Ww.priority>=n){var C=w?w.id:"default",O="mode=".concat(Wk(this.gl,r)," verts=").concat(o," instances=").concat(v," indexType=").concat(Wk(this.gl,d)," isInstanced=").concat(m," isIndexed=").concat(h," Framebuffer=").concat(C);Ww.log(n,O)()}return Hk(b),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===o||m&&0===v||(b.bindForDraw(o,v,function(){if(void 0!==w&&(x=Object.assign({},x,{framebuffer:w})),_){var e=function(e){switch(e){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Hk(!1),0}}(r);_.begin(e)}t._bindTextures(),Tk(t.gl,x,function(){h&&m?t.gl2.drawElementsInstanced(r,o,d,s,v):h&&Yw(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl2.drawRangeElements(r,u,c,o,d,s):h?t.gl.drawElements(r,o,d,s):m?t.gl2.drawArraysInstanced(r,s,o,v):t.gl.drawArrays(r,s,o)}),_&&_.end()}),0))}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in Ww.priority>=2&&function(e,t,n){for(var i in e){var r=e[i];if((!n||Boolean(n[i]))&&!qE(r))throw t=t?"".concat(t," "):"",console.error("".concat(t," Bad uniform ").concat(i),r),new Error("".concat(t," Bad uniform ").concat(i))}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i){var r=n,o=!1;if(r instanceof Ix&&(r=r.texture),r instanceof vx)if(o=this.uniforms[t]!==n){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var a=r,s=i.textureIndex;a.bind(s),r=s,this._textureUniforms[t]=a}else r=i.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(i(r)||o)&&XE(this.uniforms,t,n)}}return this}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this._textureUniforms){var n=this._textureUniforms[t];n.update(),e=e&&n.loaded}return e}},{key:"_bindTextures",value:function(){for(var e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t,n={},i=_(this.gl.getAttachedShaders(e));try{for(i.s();!(t=i.n()).done;){var r=t.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new nC({handle:r});break;case 35632:n.fs=new iC({handle:r})}}}catch(o){i.e(o)}finally{i.f()}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Xk(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),Ww.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),Ww.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||Ww.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)));if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(e.getProgramInfoLog(this.handle)))}}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1)for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{},i=n.vs,r=void 0===i?"":i,o=n.fs,a=void 0===o?"":o,s=n.defines,u=void 0===s?{}:s,c=n.inject,l=void 0===c?{}:c,h=n.varyings,f=void 0===h?[]:h,d=n.bufferMode,p=void 0===d?35981:d,v=n.transpileToGLSL100,g=void 0!==v&&v,m=this._getModuleList(n.modules),y=this._getHash(r),b=this._getHash(a),w=m.map(function(e){return t._getHash(e.name)}).sort(),k=f.map(function(e){return t._getHash(e)}),x=Object.keys(u).sort(),S=Object.keys(l).sort(),E=[],C=[],O=_(x);try{for(O.s();!(e=O.n()).done;){var T=e.value;E.push(this._getHash(T)),E.push(this._getHash(u[T]))}}catch(D){O.e(D)}finally{O.f()}var A,P=_(S);try{for(P.s();!(A=P.n()).done;){var M=A.value;C.push(this._getHash(M)),C.push(this._getHash(l[M]))}}catch(D){P.e(D)}finally{P.f()}var I="".concat(y,"/").concat(b,"D").concat(E.join("/"),"M").concat(w.join("/"),"I").concat(C.join("/"),"V").concat(k.join("/"),"H").concat(this.stateHash,"B").concat(p).concat(g?"T":"");if(!this._programCache[I]){var R=function(e,t){var n=t.vs,i=t.fs,r=hE(t.modules||[]);return{gl:e,vs:RE(e,Object.assign({},t,{source:n,type:YS,modules:r})),fs:RE(e,Object.assign({},t,{source:i,type:"fs",modules:r})),getUniforms:DE(r)}}(this.gl,{vs:r,fs:a,modules:m,inject:l,defines:u,hookFunctions:this._hookFunctions,transpileToGLSL100:g});this._programCache[I]=new fC(this.gl,{hash:I,vs:R.vs,fs:R.fs,varyings:f,bufferMode:p}),this._getUniforms[I]=R.getUniforms||function(e){},this._useCounts[I]=0}return this._useCounts[I]++,this._programCache[I]}},{key:"getUniforms",value:function(e){return this._getUniforms[e.hash]||null}},{key:"release",value:function(e){var t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}},{key:"_getHash",value:function(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}},{key:"_getModuleList",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new Array(this._defaultModules.length+e.length),n={},i=0,r=0,o=this._defaultModules.length;r1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,e,Object.assign({},r,{id:r.id||r.program&&r.program.id}))).buffer=null,t.bufferValue=null,t.isDefaultArray=r.isDefaultArray||!1,t.gl2=e,t.initialize(r),Object.seal(c(t)),t}return b(i,[{key:"delete",value:function(){return e(p(i.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete(),this}},{key:"MAX_ATTRIBUTES",get:function(){return i.getMaxAttributes(this.gl)}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Hk(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,o=n.stride,a=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl,h=this.gl2;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Hk(Yw(l)),h.vertexAttribIPointer(e,i,r,o,a)):l.vertexAttribPointer(e,i,r,s,o,a),l.enableVertexAttribArray(e),h.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!n&&0===e&&!i.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return n?t.gl.enableVertexAttribArray(e):t.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t){var n=this._normalizeConstantArrayValue(t),i=n.byteLength*e,r=n.length*e,o=!this.buffer;if(this.buffer=this.buffer||new cx(this.gl,i),o=(o=o||this.buffer.reallocate(i))||!this._compareConstantArrayValues(n,this.bufferValue)){var a=function(e,t){return new e(function(e){return(!pC||pC.byteLength1&&void 0!==arguments[1]?arguments[1]:{};return!t.constantAttributeZero||Yw(e)||"Chrome"===function(e){if(!_w())return"Node";if(bw(void 0))return"Electron";var t=("undefined"!=typeof navigator?navigator:{}).userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";var n=-1!==t.indexOf("MSIE "),i=-1!==t.indexOf("Trident/");return n||i?"IE":Aw.chrome?"Chrome":Aw.safari?"Safari":Aw.mozInnerScreenX?"Firefox":"Unknown"}()}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new i(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return i.MAX_ATTRIBUTES=i.MAX_ATTRIBUTES||e.getParameter(34921),i.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,t,n){switch(n.constructor){case Float32Array:i._setConstantFloatArray(e,t,n);break;case Int32Array:i._setConstantIntArray(e,t,n);break;case Uint32Array:i._setConstantUintArray(e,t,n);break;default:Hk(!1)}}},{key:"_setConstantFloatArray",value:function(e,t,n){switch(n.length){case 1:e.vertexAttrib1fv(t,n);break;case 2:e.vertexAttrib2fv(t,n);break;case 3:e.vertexAttrib3fv(t,n);break;case 4:e.vertexAttrib4fv(t,n);break;default:Hk(!1)}}},{key:"_setConstantIntArray",value:function(e,t,n){switch(Hk(Yw(e)),n.length){case 1:e.vertexAttribI1iv(t,n);break;case 2:e.vertexAttribI2iv(t,n);break;case 3:e.vertexAttribI3iv(t,n);break;case 4:e.vertexAttribI4iv(t,n);break;default:Hk(!1)}}},{key:"_setConstantUintArray",value:function(e,t,n){switch(Hk(Yw(e)),n.length){case 1:e.vertexAttribI1uiv(t,n);break;case 2:e.vertexAttribI2uiv(t,n);break;case 3:e.vertexAttribI3uiv(t,n);break;case 4:e.vertexAttribI4uiv(t,n);break;default:Hk(!1)}}}]),i}(Zk),gC=/^(.+)__LOCATION_([0-9]+)$/,mC=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],yC=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.id=n.id||n.program&&n.program.id,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new vC(t),Qk(this,"VertexArray","v6.0",mC),this.initialize(n),Object.seal(this)}return b(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}},{key:"reset",value:function(){this.elements=null,this.elementsAccessor=null;var e=this.vertexArrayObject.MAX_ATTRIBUTES;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}},{key:"setProps",value:function(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}},{key:"clearDrawParams",value:function(){this.drawParams=null}},{key:"getDrawParams",value:function(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}},{key:"setAttributes",value:function(e){var t=this;return Object.assign(this.attributes,e),this.vertexArrayObject.bind(function(){for(var n in e)t._setAttribute(n,e[n]);t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,o=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=o,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,o)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,o=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=o,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.vertexArrayObject.setElementBuffer(null),e.buffer=e.buffer||new cx(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof cx){var o=n;if(r){var a=o.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,a)}else{var s=o.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,s)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ww.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}();function bC(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,i=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,i=void 0===n?16:n,r=t.size,o=void 0===r?1:r,a="[",s=0;s0&&(a+=","+(s%o==0?" ":"")),a+=bC(e[s],t);return"".concat(a).concat(e.length>i?"...":"]")}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return i?"0":"0.";if(i||Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var r=e.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function _C(e,t,n,i){var r,a,s=e.gl;if(!t)return o(r={},i,"null"),o(r,"Format ","N/A"),r;var u,c,l,h="NOT PROVIDED",f=1,d=0,p=0;if(n&&(h=n.type,f=n.size,u=-1!==(h=String(h).replace("Array","")).indexOf("nt")),t instanceof cx){var v,g,m=t,y=m.getDebugData(),b=y.data;return c=y.changed?"*":"",l=b,d=(p=m.byteLength)/b.BYTES_PER_ELEMENT/f,n?g="".concat(n.divisor>0?"I ":"P "," ").concat(d," (x").concat(f,"=").concat(p," bytes ").concat(Wk(s,h),")"):(u=!0,g="".concat(p," bytes")),o(v={},i,"".concat(c).concat(bC(l,{size:f,isInteger:u}))),o(v,"Format ",g),v}return l=t,f=t.length,u=-1!==(h=String(t.constructor.name).replace("Array","")).indexOf("nt"),o(a={},i,"".concat(bC(l,{size:f,isInteger:u})," (constant)")),o(a,"Format ","".concat(f,"x").concat(h," (constant)")),a}function wC(e,t){var n=cC(t.type,t.size);return n?"".concat(e," (").concat(n.name,")"):e}function kC(e){var t=e.header,n=void 0===t?"Uniforms":t,i=e.program,r=e.uniforms,a=e.undefinedOnly,s=void 0!==a&&a;Hk(i);var u,c=".*Matrix",l={},h=Object.keys(i._uniformSetters).sort(),f=0,d=_(h);try{for(d.s();!(u=d.n()).done;){var p=u.value;!p.match(".*_.*")&&!p.match(c)&&xC({table:l,header:n,uniforms:r,uniformName:p,undefinedOnly:s})&&f++}}catch(C){d.e(C)}finally{d.f()}var v,g=_(h);try{for(g.s();!(v=g.n()).done;){var m=v.value;m.match(c)&&xC({table:l,header:n,uniforms:r,uniformName:m,undefinedOnly:s})&&f++}}catch(C){g.e(C)}finally{g.f()}var y,b=_(h);try{for(b.s();!(y=b.n()).done;){var w=y.value;l[w]||xC({table:l,header:n,uniforms:r,uniformName:w,undefinedOnly:s})&&f++}}catch(C){b.e(C)}finally{b.f()}var k=0,x={};if(!s)for(var S in r){var E=r[S];l[S]||(k++,x[S]=o({Type:"NOT USED: ".concat(E)},n,bC(E)))}return{table:l,count:f,unusedTable:x,unusedCount:k}}function xC(e){var t,n=e.table,i=e.header,r=e.uniforms,a=e.uniformName,s=e.undefinedOnly,u=r[a],c=function(e){return null!=e}(u);return!(s&&c||(n[a]=(t={},o(t,i,c?bC(u):"N/A"),o(t,"Uniform Type",c?u:"NOT PROVIDED"),t),0))}function SC(e){var t=e.accessor,n=cC(t.type,t.size);return n?"".concat(n.name," ").concat(e.name):e.name}var EC={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function CC(e,t){var n=(t||{}).attributeMap,i=void 0===n?EC:n;return i&&i[e]||e}function OC(e,t){var n;switch(e){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2}Hk(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var TC=function(){},AC={},PC=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e);var i=n.id,r=void 0===i?Xk("model"):i;Hk(Xw(t)),this.id=r,this.gl=t,this.id=n.id||Xk("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(n)}return b(e,[{key:"initialize",value:function(e){this.props={},this.programManager=e.programManager||dC.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;var t=e.program,n=void 0===t?null:t,i=e.vs,r=e.fs,o=e.modules,a=e.defines,s=e.inject,u=e.varyings,c=e.bufferMode,l=e.transpileToGLSL100;this.programProps={program:n,vs:i,fs:r,modules:o,defines:a,inject:s,varyings:u,bufferMode:c,transpileToGLSL100:l},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},Hk(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){this._setModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}},{key:"getDrawMode",value:function(){return this.drawMode}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getInstanceCount",value:function(){return this.instanceCount}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getProgram",value:function(){return this.program}},{key:"setProgram",value:function(e){var t=e.program,n=e.vs,i=e.fs,r=e.modules,o=e.defines,a=e.inject,s=e.varyings,u=e.bufferMode,c=e.transpileToGLSL100;this.programProps={program:t,vs:n,fs:i,modules:r,defines:o,inject:a,varyings:s,bufferMode:u,transpileToGLSL100:c},this._programDirty=!0}},{key:"getUniforms",value:function(){return this.uniforms}},{key:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Hk(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Hk(Number.isFinite(e)),this.instanceCount=e,this}},{key:"setGeometry",value:function(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(e,t,n){var i={},r=t.indices;for(var o in t.attributes){var a=t.attributes[o],s=CC(o,void 0);if("indices"===o)r=a;else if(a.constant)i[s]=a.value;else{var u=a.value,c=M({},a);delete c.value,i[s]=[new cx(e,u),c],OC(o,c)}}if(r){var l=r.value||r;Hk(l instanceof Uint16Array||l instanceof Uint32Array,'attribute array for "indices" must be of integer type');var h={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new cx(e,{data:l,target:34963}),h]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Kk(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(this.uniforms,e),this}},{key:"getModuleUniforms",value:function(e){this._checkProgram();var t=this.programManager.getUniforms(this.program);return t?t(e):{}}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return kx(this.program.gl,e),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();var t,n=e.moduleSettings,i=void 0===n?null:n,r=e.framebuffer,o=e.uniforms,a=void 0===o?{}:o,s=e.attributes,u=void 0===s?{}:s,c=e.transformFeedback,l=void 0===c?this.transformFeedback:c,h=e.parameters,f=void 0===h?{}:h,d=e.vertexArray,p=void 0===d?this.vertexArray:d;this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(a),Ww.priority>=2&&(t=this._logDrawCallStart(2));var v=this.vertexArray.getDrawParams(),g=this.props,m=g.isIndexed,y=void 0===m?v.isIndexed:m,b=g.indexType,_=void 0===b?v.indexType:b,w=g.indexOffset,k=void 0===w?v.indexOffset:w,x=g.vertexArrayInstanced,S=void 0===x?v.isInstanced:x;S&&!this.isInstanced&&Ww.warn("Found instanced attributes on non-instanced model",this.id)();var E=this.isInstanced,C=this.instanceCount,O=this.props,T=O.onBeforeRender,A=void 0===T?TC:T,P=O.onAfterRender,M=void 0===P?TC:P;A(),this.program.setUniforms(this.uniforms);var I=this.program.draw(Object.assign(AC,e,{logPriority:t,uniforms:null,framebuffer:r,parameters:f,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:p,transformFeedback:l,isIndexed:y,indexType:_,isInstanced:E,instanceCount:C,offset:y?k:0}));return M(),Ww.priority>=2&&this._logDrawCallEnd(t,p,r),I}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,o=void 0===r?[]:r,a=e.parameters;i&&this._setFeedbackBuffers(i),n&&(a=Object.assign({},a,{35977:n})),o.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:a}))}finally{o.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ww.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}},{key:"_checkProgram",value:function(){if(this._programDirty||this.programManager.stateHash!==this._programManagerState){var e=this.programProps.program;if(e)this._managedProgram=!1;else{var t=this.programProps,n=t.vs,i=t.fs,r=t.modules,o=t.inject,a=t.defines,s=t.varyings,u=t.bufferMode,c=t.transpileToGLSL100;e=this.programManager.get({vs:n,fs:i,modules:r,inject:o,defines:a,varyings:s,bufferMode:u,transpileToGLSL100:c}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Hk(e instanceof fC,"Model needs a program"),this._programDirty=!1,e!==this.program&&(this.program=e,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new yC(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}}},{key:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof cx&&t.delete()}}},{key:"_setAnimationProps",value:function(e){this.animated&&Hk(e,"Model.draw(): animated uniforms but no animationProps")}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Kk(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new WS(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ".concat(this.id),{collapsed:Ww.level<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=function(e){var t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=_C(t,t.elements,null,i));var o=t.values;for(var a in o){var s=t._getAttributeInfo(a);if(s){var u="".concat(a,": ").concat(s.name),c=t.accessors[s.location];c&&(u="".concat(a,": ").concat(wC(s.name,c))),r[u]=_C(t,o[a],c,i)}}return r}({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=kC({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),s=a.table,u=a.unusedTable,c=a.unusedCount,l=kC({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),h=l.table;l.count>0&&Ww.log("MISSING UNIFORMS",Object.keys(h))(),c>0&&Ww.log("UNUSED UNIFORMS",Object.keys(u))();var f=function(e){var t,n={},i="Accessors for ".concat(e.id),r=_(e.attributeInfos);try{for(r.s();!(t=r.n()).done;){var a=t.value;a&&(n["in ".concat(SC(a))]=o({},i,JSON.stringify(a.accessor)))}}catch(l){r.e(l)}finally{r.f()}var s,u=_(e.varyingInfos);try{for(u.s();!(s=u.n()).done;){var c=s.value;c&&(n["out ".concat(SC(c))]=o({},i,JSON.stringify(c.accessor)))}}catch(l){u.e(l)}finally{u.f()}return n}(this.vertexArray.configuration);Ww.table(e,r)(),Ww.table(e,s)(),Ww.table(e+1,f)(),i&&i.log({logLevel:2,message:"Rendered to ".concat(i.id)}),Ww.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}(),MC=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(n),Object.seal(this)}return b(e,[{key:"delete",value:function(){var e=this.model,t=this.bufferTransform,n=this.textureTransform;e&&e.delete(),t&&t.delete(),n&&n.delete()}},{key:"run",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.clearRenderTarget,n=void 0===t||t,i=this._updateDrawOptions(e);n&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}},{key:"swap",value:function(){var e,t=!1,n=_([this.bufferTransform,this.textureTransform].filter(Boolean));try{for(n.s();!(e=n.n()).done;){var i=e.value;t=t||i.swap()}}catch(r){n.e(r)}finally{n.f()}Hk(t,"Nothing to swap")}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(e)}},{key:"getData",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[this.bufferTransform,this.textureTransform].filter(Boolean),i=_(n);try{for(i.s();!(e=i.n()).done;){var r=e.value,o=r.getData(t);if(o)return o}}catch(a){i.e(a)}finally{i.f()}return null}},{key:"getFramebuffer",value:function(){return this.textureTransform&&this.textureTransform.getFramebuffer()}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"elementCount"in e&&this.model.setVertexCount(e.elementCount);var t,n=[this.bufferTransform,this.textureTransform].filter(Boolean),i=_(n);try{for(i.s();!(t=i.n()).done;){var r=t.value;r.update(e)}}catch(o){i.e(o)}finally{i.f()}}},{key:"_initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.gl;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new PC(t,Object.assign({},e,{fs:e.fs||GS({version:XS(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}},{key:"_updateModelProps",value:function(e){var t,n=Object.assign({},e),i=_([this.bufferTransform,this.textureTransform].filter(Boolean));try{for(i.s();!(t=i.n()).done;){n=t.value.updateModelProps(n)}}catch(r){i.e(r)}finally{i.f()}return n}},{key:"_buildResourceTransforms",value:function(e,t){(function(e){return!(Kk(e.feedbackBuffers)&&Kk(e.feedbackMap)&&!(e.varyings&&e.varyings.length>0))})(t)&&(this.bufferTransform=new qS(e,t)),function(e){return!(Kk(e._sourceTextures)&&!e._targetTexture&&!e._targetTextureVarying)}(t)&&(this.textureTransform=new aE(e,t)),Hk(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}},{key:"_updateDrawOptions",value:function(e){var t,n=Object.assign({},e),i=_([this.bufferTransform,this.textureTransform].filter(Boolean));try{for(i.s();!(t=i.n()).done;){var r=t.value;n=Object.assign(n,r.getDrawOptions(n))}}catch(o){i.e(o)}finally{i.f()}return n}}],[{key:"isSupported",value:function(e){return Yw(e)}}]),e}();function IC(){}var RC={onStart:IC,onUpdate:IC,onInterrupt:IC,onEnd:IC},DC=function(){function e(t){m(this,e),this._inProgress=!1,this._handle=null,this.timeline=t,this.settings={}}return b(e,[{key:"inProgress",get:function(){return this._inProgress}},{key:"start",value:function(e){this.cancel(),this.settings=M(M({},RC),e),this._inProgress=!0,this.settings.onStart(this)}},{key:"end",value:function(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}},{key:"cancel",value:function(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}},{key:"update",value:function(){if(!this._inProgress)return!1;if(null===this._handle){var e=this.timeline,t=this.settings;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}},{key:"_onUpdate",value:function(){}}]),e}(),NC={interpolation:function(){function e(t){var n=t.gl,i=t.attribute,r=t.timeline;m(this,e),this.gl=n,this.type="interpolation",this.transition=new DC(r),this.attribute=i,this.attributeInTransition=new jS(n,i.settings),this.currentStartIndices=i.startIndices,this.currentLength=0,this.transform=function(e,t){var n=RS(t.size);return new MC(e,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(n,i);var o={byteLength:0,usage:35050};this.buffers=[new cx(n,o),new cx(n,o)]}return b(e,[{key:"inProgress",get:function(){return this.transition.inProgress}},{key:"start",value:function(e,t){if(e.duration<=0)this.transition.cancel();else{var n=this.buffers,i=this.attribute;DS(n);var r,o={numInstances:t,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter},a=_(n);try{for(a.s();!(r=a.n()).done;){var s=r.value;LS(M({buffer:s},o))}}catch(u){a.e(u)}finally{a.f()}this.currentStartIndices=i.startIndices,this.currentLength=NS(i,t),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:n[0],aTo:IS(0,i)},feedbackBuffers:{vCurrent:n[1]}})}}},{key:"update",value:function(){var e=this.transition.update();if(e){var t=this.transition,n=t.time,i=t.settings,r=i.duration,o=(0,i.easing)(n/r);this.transform.run({uniforms:{time:o}})}return e}},{key:"cancel",value:function(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}}]),e}(),spring:function(){function e(t){var n=t.gl,i=t.attribute,r=t.timeline;m(this,e),this.gl=n,this.type="spring",this.transition=new DC(r),this.attribute=i,this.attributeInTransition=new jS(n,I(M({},i.settings),{normalized:!1})),this.currentStartIndices=i.startIndices,this.currentLength=0,this.texture=function(e){return new mx(e,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(n),this.framebuffer=function(e,t){return new Ix(e,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:t}})}(n,this.texture),this.transform=function(e,t,n){var i=RS(t.size);return new MC(e,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(n,i,this.framebuffer);var o={byteLength:0,usage:35050};this.buffers=[new cx(n,o),new cx(n,o),new cx(n,o)]}return b(e,[{key:"inProgress",get:function(){return this.transition.inProgress}},{key:"start",value:function(e,t){var n,i=this.buffers,r=this.attribute,o={numInstances:t,attribute:r,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter},a=_(i);try{for(a.s();!(n=a.n()).done;){var s=n.value;LS(M({buffer:s},o))}}catch(u){a.e(u)}finally{a.f()}this.currentStartIndices=r.startIndices,this.currentLength=NS(r,t),this.attributeInTransition.update({buffer:i[1],value:r.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/r.size),sourceBuffers:{aTo:IS(0,r)}})}},{key:"update",value:function(){var e=this.buffers,t=this.transform,n=this.framebuffer,i=this.transition;return!!i.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:i.settings.stiffness,damping:i.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),DS(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),Ax(n)[0]>0||i.end(),!0)}},{key:"cancel",value:function(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}]),e}()},LC=function(){function e(t,n){var i=n.id,r=n.timeline;m(this,e),this.id=i,this.gl=t,this.timeline=r,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=MC.isSupported(t)}return b(e,[{key:"finalize",value:function(){for(var e in this.transitions)this._removeTransition(e)}},{key:"update",value:function(e){var t=e.attributes,n=e.transitions,i=e.numInstances;for(var r in this.numInstances=i||1,t){var o=t[r],a=o.getTransitionSetting(n);!a||this._updateAttribute(r,o,a)}for(var s in this.transitions){var u=t[s];(!u||!u.getTransitionSetting(n))&&this._removeTransition(s)}}},{key:"hasAttribute",value:function(e){var t=this.transitions[e];return t&&t.inProgress}},{key:"getAttributes",value:function(){var e={};for(var t in this.transitions){var n=this.transitions[t];n.inProgress&&(e[t]=n.attributeInTransition)}return e}},{key:"run",value:function(){if(!this.isSupported||0===this.numInstances)return!1;for(var e in this.transitions)this.transitions[e].update()&&(this.needsRedraw=!0);var t=this.needsRedraw;return this.needsRedraw=!1,t}},{key:"_removeTransition",value:function(e){this.transitions[e].cancel(),delete this.transitions[e]}},{key:"_updateAttribute",value:function(e,t,n){var i=this.transitions[e],r=!i||i.type!==n.type;if(r){if(!this.isSupported)return void zw.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();i&&this._removeTransition(e);var o=NC[n.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(zw.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(n,this.numInstances))}}]),e}(),jC="attributeManager.invalidate",FC=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,r=void 0===i?"attribute-manager":i,o=n.stats,a=n.timeline;m(this,e),this.id=r,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new LC(t,{id:"".concat(r,"-transitions"),timeline:a}),Object.seal(this)}return b(e,[{key:"finalize",value:function(){for(var e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.startIndices,r=void 0===i?null:i,o=e.transitions,a=e.props,s=void 0===a?{}:a,u=e.buffers,c=void 0===u?{}:u,l=e.context,h=void 0===l?{}:l,f=!1;for(var d in BS("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var p=this.attributes[d],v=p.settings.accessor;p.startIndices=r,s[d]&&zw.removed("props.".concat(d),"data.attributes.".concat(d))(),p.setExternalBuffer(c[d])||p.setBinaryValue(c[v],t.startIndices)||!c[v]&&p.setConstantValue(s[v])||p.needsUpdate()&&(f=!0,this._updateAttribute({attribute:p,numInstances:n,data:t,props:s,context:h})),this.needsRedraw|=p.needsRedraw()}f&&BS("attributeManager.updateEnd",this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:o})}},{key:"updateTransition",value:function(){var e=this.attributeTransitionManager.run();return this.needsRedraw=this.needsRedraw||e,e}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=M({},n.getAttributes());for(var r in t){var o=t[r];o.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=o)}return i}},{key:"getShaderAttributes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e||(e=this.getAttributes());var n={};for(var i in e)t[i]||Object.assign(n,e[i].getShaderAttributes());return n}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var i in t&&zw.warn("AttributeManager.add({updaters}) - updater map no longer supported")(),e)this.attributes[i]=this._createAttribute(i,e[i],n);this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i=I(M({},t),{id:e,isIndexed:t.isIndexed||t.elements||!1,constant:t.constant||!1,size:(t.elements?1:t.size)||1,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor||0});return new jS(this.gl,i)}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];return i&&i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)}),i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;BS("attribute.updateStart",t),t.allocate(n)&&BS("attribute.allocate",t,n),t.updateBuffer(e)&&(this.needsRedraw=!0,BS("attribute.updateEnd",t,n))}}]),e}();function BC(e,t,n,i,r){var o=t-e;return(n-t)*r+-o*i+o+t}function VC(e,t){if(Array.isArray(e)){for(var n=0,i=0;i0}},{key:"add",value:function(e,t,n,i){var r=this.transitions;if(r.has(e)){var o=r.get(e),a=o.value;t=void 0===a?o.settings.fromValue:a,this.remove(e)}if(i=MS(i)){var s=zC[i.type];if(s){var u=new s(this.timeline);u.start(I(M({},i),{fromValue:t,toValue:n})),r.set(e,u)}else zw.error("unsupported transition type '".concat(i.type,"'"))()}}},{key:"remove",value:function(e){var t=this.transitions;t.has(e)&&(t.get(e).cancel(),t.delete(e))}},{key:"update",value:function(){var e,n={},i=_(this.transitions);try{for(i.s();!(e=i.n()).done;){var r=t(e.value,2),o=r[0],a=r[1];a.update(),n[o]=a.value,a.inProgress||this.remove(o)}}catch(s){i.e(s)}finally{i.f()}return n}},{key:"clear",value:function(){var e,t=_(this.transitions.keys());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.remove(n)}}catch(i){t.e(i)}finally{t.f()}}}]),e}(),HC={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},GC=HC.COMPONENT;function WC(e,t){if(!e.transitions)return null;var n={},i=QC(e);for(var r in e.transitions){var o=i[r],a=o&&o.type;("number"===a||"color"===a||"array"===a)&&XC(e[r],t[r],o)&&(n[r]=!0)}return n}function qC(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,o=e.propTypes,a=void 0===o?{}:o,s=e.triggerName,u=void 0===s?"props":s;if(n===t)return null;if("object"!=typeof t||null===t||"object"!=typeof n||null===n)return"".concat(u," changed shallowly");for(var c=0,l=Object.keys(t);c=0&&n.modules.splice(i,1)}if("inject"in t)if(e.inject){var r=M({},e.inject);for(var o in t.inject)r[o]=(r[o]||"")+t.inject[o];n.inject=r}else n.inject=t.inject;return n}function eO(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],f=t[10],d=t[11],p=t[12],v=t[13],g=t[14],m=t[15],y=n*s-i*a,b=n*u-r*a,_=n*c-o*a,w=i*u-r*s,k=i*c-o*s,x=r*c-o*u,S=l*v-h*p,E=l*g-f*p,C=l*m-d*p,O=h*g-f*v,T=h*m-d*v,A=f*m-d*g,P=y*A-b*T+_*O+w*C-k*E+x*S;return P?(e[0]=(s*A-u*T+c*O)*(P=1/P),e[1]=(r*T-i*A-o*O)*P,e[2]=(v*x-g*k+m*w)*P,e[3]=(f*k-h*x-d*w)*P,e[4]=(u*C-a*A-c*E)*P,e[5]=(n*A-r*C+o*E)*P,e[6]=(g*_-p*x-m*b)*P,e[7]=(l*x-f*_+d*b)*P,e[8]=(a*T-s*C+c*S)*P,e[9]=(i*C-n*T-o*S)*P,e[10]=(p*k-v*_+m*y)*P,e[11]=(h*_-l*k-d*y)*P,e[12]=(s*E-a*O-u*S)*P,e[13]=(n*O-i*E+r*S)*P,e[14]=(v*b-p*w-g*y)*P,e[15]=(l*w-h*b+f*y)*P,e):null}function tO(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],v=t[12],g=t[13],m=t[14],y=t[15],b=n[0],_=n[1],w=n[2],k=n[3];return e[0]=b*i+_*s+w*h+k*v,e[1]=b*r+_*u+w*f+k*g,e[2]=b*o+_*c+w*d+k*m,e[3]=b*a+_*l+w*p+k*y,e[4]=(b=n[4])*i+(_=n[5])*s+(w=n[6])*h+(k=n[7])*v,e[5]=b*r+_*u+w*f+k*g,e[6]=b*o+_*c+w*d+k*m,e[7]=b*a+_*l+w*p+k*y,e[8]=(b=n[8])*i+(_=n[9])*s+(w=n[10])*h+(k=n[11])*v,e[9]=b*r+_*u+w*f+k*g,e[10]=b*o+_*c+w*d+k*m,e[11]=b*a+_*l+w*p+k*y,e[12]=(b=n[12])*i+(_=n[13])*s+(w=n[14])*h+(k=n[15])*v,e[13]=b*r+_*u+w*f+k*g,e[14]=b*o+_*c+w*d+k*m,e[15]=b*a+_*l+w*p+k*y,e}function nO(e,t,n){var i,r,o,a,s,u,c,l,h,f,d,p,v=n[0],g=n[1],m=n[2];return t===e?(e[12]=t[0]*v+t[4]*g+t[8]*m+t[12],e[13]=t[1]*v+t[5]*g+t[9]*m+t[13],e[14]=t[2]*v+t[6]*g+t[10]*m+t[14],e[15]=t[3]*v+t[7]*g+t[11]*m+t[15]):(r=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],e[0]=i=t[0],e[1]=r,e[2]=o,e[3]=a,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=h,e[9]=f,e[10]=d,e[11]=p,e[12]=i*v+s*g+h*m+t[12],e[13]=r*v+u*g+f*m+t[13],e[14]=o*v+c*g+d*m+t[14],e[15]=a*v+l*g+p*m+t[15]),e}function iO(e,t,n){var i=n[0],r=n[1],o=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function rO(e,t,n){var i=Math.sin(n),r=Math.cos(n),o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*r+c*i,e[5]=a*r+l*i,e[6]=s*r+h*i,e[7]=u*r+f*i,e[8]=c*r-o*i,e[9]=l*r-a*i,e[10]=h*r-s*i,e[11]=f*r-u*i,e}function oO(e,t,n){var i=Math.sin(n),r=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[4],l=t[5],h=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r+c*i,e[1]=a*r+l*i,e[2]=s*r+h*i,e[3]=u*r+f*i,e[4]=c*r-o*i,e[5]=l*r-a*i,e[6]=h*r-s*i,e[7]=f*r-u*i,e}function aO(e,t,n,i,r){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0?(e[10]=(r+i)*(o=1/(i-r)),e[14]=2*r*i*o):(e[10]=-1,e[14]=-2*i),e}function sO(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],v=e[13],g=e[14],m=e[15],y=t[0],b=t[1],_=t[2],w=t[3],k=t[4],x=t[5],S=t[6],E=t[7],C=t[8],O=t[9],T=t[10],A=t[11],P=t[12],M=t[13],I=t[14],R=t[15];return Math.abs(n-y)<=tS*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-b)<=tS*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(r-_)<=tS*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(o-w)<=tS*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-k)<=tS*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(s-x)<=tS*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(u-S)<=tS*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(c-E)<=tS*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-C)<=tS*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(h-O)<=tS*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(f-T)<=tS*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(d-A)<=tS*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-P)<=tS*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(v-M)<=tS*Math.max(1,Math.abs(v),Math.abs(M))&&Math.abs(g-I)<=tS*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(m-R)<=tS*Math.max(1,Math.abs(m),Math.abs(R))}function uO(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function cO(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*a,e[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*a,e[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*a,e[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*a,e}!function(){var e=new nS(4);nS!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var lO=[0,0,0,0],hO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],fO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],dO=[0,0,0],pO=[0,0,0],vO=ZC(function(e){var t=e.viewport,n=e.devicePixelRatio,i=e.coordinateSystem,r=function(e,t,n){var i=e.viewMatrixUncentered,r=e.projectionMatrix,o=e.viewMatrix,a=e.viewProjectionMatrix,s=lO,u=lO,c=e.cameraPosition,l=gO(e,t,n),h=l.geospatialOrigin,f=l.shaderCoordinateOrigin;return l.offsetMode&&(u=e.projectPosition(h||f),c=[c[0]-u[0],c[1]-u[1],c[2]-u[2]],u[3]=1,s=cO([],u,a),a=tO([],r,o=i||o),a=tO([],a,hO)),{viewMatrix:o,viewProjectionMatrix:a,projectionCenter:s,originCommon:u,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:h}}(t,i,e.coordinateOrigin),o=r.projectionCenter,a=r.viewProjectionMatrix,s=r.originCommon,u=r.cameraPosCommon,c=r.shaderCoordinateOrigin,l=r.geospatialOrigin,h=t.getDistanceScales(),f=[t.width*n,t.height*n],d=t.projectionMatrix.transform([0,0,-t.focalDistance,1])[3]||1,p={project_uCoordinateSystem:i,project_uProjectionMode:t.projectionMode,project_uCoordinateOrigin:c,project_uCommonOrigin:s.slice(0,3),project_uCenter:o,project_uViewportSize:f,project_uDevicePixelRatio:n,project_uFocalDistance:d,project_uCommonUnitsPerMeter:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:dO,project_uScale:t.scale,project_uViewProjectionMatrix:a,project_uCameraPosition:u};if(l){var v=t.getDistanceScales(l);switch(i){case Uw.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=v.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=v.unitsPerMeter2;break;case Uw.LNGLAT:case Uw.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=v.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=v.unitsPerDegree2;break;case Uw.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,v.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,v.unitsPerMeter2[2]]}}return p});function gO(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pO,r=i,o=!0;switch(n=t===Uw.LNGLAT_OFFSETS||t===Uw.METER_OFFSETS?i:e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case Hw.WEB_MERCATOR:(t===Uw.LNGLAT||t===Uw.CARTESIAN)&&(o=!1);break;case Hw.WEB_MERCATOR_AUTO_OFFSET:t===Uw.LNGLAT?r=n:t===Uw.CARTESIAN&&(r=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],n=e.unprojectPosition(r),r[0]-=i[0],r[1]-=i[1],r[2]-=i[2]);break;case Hw.IDENTITY:r=e.position.map(Math.fround);break;case Hw.GLOBE:o=!1,n=null;break;default:o=!1}return r[2]=r[2]||0,{geospatialOrigin:n,shaderCoordinateOrigin:r,offsetMode:o}}var mO=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"ELEMENTS",get:function(){return Yx(!1),0}},{key:"RANK",get:function(){return Yx(!1),0}},{key:"toString",value:function(){var e="[";if(Vx.printRowMajor){e+="row-major:";for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=e*this.RANK,i=0;i2*Math.PI)throw Error("radians");var f=s*Math.tan(n/2),d=f*o;return(new i).ortho({left:-d,right:d,bottom:-f,top:f,near:c,far:h})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,o=void 0===r?1:r,a=e.near,s=void 0===a?.1:a,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return aO(this,t,o,s,c),this.check()}},{key:"determinant",value:function(){return function(e){var t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11],d=e[12],p=e[13],v=e[14],g=e[15];return(t*a-n*o)*(h*g-f*v)-(t*s-i*o)*(l*g-f*p)+(t*u-r*o)*(l*v-h*p)+(n*s-i*a)*(c*g-f*d)-(n*u-r*a)*(c*v-h*d)+(i*u-r*s)*(c*p-l*d)}(this)}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),i=1/n[0],r=1/n[1],o=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*r,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*r,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*r,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),i=1/n[0],r=1/n[1],o=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*r,e[2]=this[2]*o,e[3]=this[4]*i,e[4]=this[5]*r,e[5]=this[6]*o,e[6]=this[8]*i,e[7]=this[9]*r,e[8]=this[10]*o,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=o,e[11]=t[14],e[12]=r,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return eO(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return tO(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return tO(this,this,e),this.check()}},{key:"rotateX",value:function(e){return rO(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){var i=Math.sin(n),r=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[8],l=t[9],h=t[10],f=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r-c*i,e[1]=a*r-l*i,e[2]=s*r-h*i,e[3]=u*r-f*i,e[8]=o*i+c*r,e[9]=a*i+l*r,e[10]=s*i+h*r,e[11]=u*i+f*r}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return oO(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var n=t(e,3),i=n[0],r=n[1],o=n[2];return this.rotateX(i).rotateY(r).rotateZ(o)}},{key:"rotateAxis",value:function(e,t){return function(e,t,n,i){var r,o,a,s,u,c,l,h,f,d,p,v,g,m,y,b,_,w,k,x,S,E,C,O,T=i[0],A=i[1],P=i[2],M=Math.hypot(T,A,P);M=-90&&r<=90,"invalid latitude"),[512*(i*IO+PO)/(2*PO),512*(PO+Math.log(Math.tan(MO+r*IO*.5)))/(2*PO)]}function LO(e){var n=t(e,2),i=n[0],r=n[1],o=i/512*(2*PO)-PO,a=2*(Math.atan(Math.exp(r/512*(2*PO)-PO))-MO);return[o*RO,a*RO]}function jO(e){var t=e.latitude,n=e.longitude,i=e.highPrecision,r=void 0!==i&&i;AO(Number.isFinite(t)&&Number.isFinite(n));var o={},a=Math.cos(t*IO),s=512/360,u=s/a,c=512/DO/a;if(o.unitsPerMeter=[c,c,c],o.metersPerUnit=[1/c,1/c,1/c],o.unitsPerDegree=[s,u,c],o.degreesPerUnit=[1/s,1/u,1/c],r){var l=IO*Math.tan(t*IO)/a,h=512/DO*l,f=h/u*c;o.unitsPerDegree2=[0,s*l/2,h],o.unitsPerMeter2=[f,0,f]}return o}function FO(e,n){var i=t(e,3),r=i[0],o=i[1],a=i[2],s=t(n,3),u=s[0],c=s[1],l=s[2],h=jO({longitude:r,latitude:o,highPrecision:!0}),f=h.unitsPerMeter,d=h.unitsPerMeter2,p=NO(e);p[0]+=u*(f[0]+d[0]*c),p[1]+=c*(f[1]+d[1]*c);var v=LO(p),g=(a||0)+(l||0);return Number.isFinite(a)||Number.isFinite(l)?[v[0],v[1],g]:v}function BO(e){var t=e.height,n=e.pitch,i=e.bearing,r=e.altitude,o=e.scale,a=e.center,s=void 0===a?null:a,u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return nO(u,u,[0,0,-r]),rO(u,u,-n*IO),oO(u,u,i*IO),iO(u,u,[o/=t,o,o]),s&&nO(u,u,function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}([],s)),u}function VO(e){var t=e.width,n=e.height,i=e.fovy,r=void 0===i?zO(1.5):i,o=e.altitude,a=e.pitch,s=void 0===a?0:a,u=e.nearZMultiplier,c=void 0===u?1:u,l=e.farZMultiplier,h=void 0===l?1:l;void 0!==o&&(r=zO(o));var f=.5*r*IO,d=UO(r),p=s*IO,v=Math.sin(f)*d/Math.sin(Math.min(Math.max(Math.PI/2-p-f,.01),Math.PI-.01));return{fov:2*f,aspect:t/n,focalDistance:d,near:c,far:(Math.sin(p)*v+d)*h}}function zO(e){return 2*Math.atan(.5/e)*RO}function UO(e){return.5/Math.tan(.5*e*IO)}function HO(e,n){var i=t(e,3),r=i[0],o=i[1],a=i[2],s=void 0===a?0:a;return AO(Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(s)),CO(n,[r,o,s,1])}function GO(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t(e,3),o=r[0],a=r[1],s=r[2];if(AO(Number.isFinite(o)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(s))return CO(n,[o,a,s,1]);var u=CO(n,[o,a,0,1]),c=CO(n,[o,a,1,1]),l=u[2],h=c[2];return _O([],u,c,l===h?0:((i||0)-l)/(h-l))}function WO(e){var n=e.width,i=e.height,r=e.bounds,o=e.minExtent,a=void 0===o?0:o,s=e.maxZoom,u=void 0===s?24:s,c=e.padding,l=void 0===c?0:c,h=e.offset,f=void 0===h?[0,0]:h,d=t(r,2),p=t(d[0],2),v=p[0],g=p[1],m=t(d[1],2),y=m[0],b=m[1];Number.isFinite(l)?l={top:l,bottom:l,left:l,right:l}:AO(Number.isFinite(l.top)&&Number.isFinite(l.bottom)&&Number.isFinite(l.left)&&Number.isFinite(l.right));var _=new KO({width:n,height:i,longitude:0,latitude:0,zoom:0}),w=_.project([v,b]),k=_.project([y,g]),x=[Math.max(Math.abs(k[0]-w[0]),a),Math.max(Math.abs(k[1]-w[1]),a)],S=[n-l.left-l.right-2*Math.abs(f[0]),i-l.top-l.bottom-2*Math.abs(f[1])];AO(S[0]>0&&S[1]>0);var E=S[0]/x[0],C=S[1]/x[1],O=_.unproject([(k[0]+w[0])/2+(l.right-l.left)/2/E,(k[1]+w[1])/2+(l.bottom-l.top)/2/C]),T=Math.min(u,_.zoom+TO(Math.abs(Math.min(E,C))));return AO(Number.isFinite(T)),{longitude:O[0],latitude:O[1],zoom:T}}var qO=Math.PI/180;function XO(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.width,o=e.height,a=e.unproject,s={targetZ:i},u=a([0,o],s),c=a([r,o],s);return(e.fovy?.5*e.fovy*qO:Math.atan(.5/e.altitude))>(90-e.pitch)*qO-.01?(t=YO(e,0,i),n=YO(e,r,i)):(t=a([0,0],s),n=a([r,0],s)),[u,c,n,t]}function YO(e,t,n){var i=e.pixelUnprojectionMatrix,r=CO(i,[t,0,1,1]),o=CO(i,[t,e.height,1,1]),a=LO(_O([],r,o,(n*e.distanceScales.unitsPerMeter[2]-r[2])/(o[2]-r[2])));return a[2]=n,a}var KO=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1},n=t.width,i=t.height,r=t.latitude,o=void 0===r?0:r,a=t.longitude,s=void 0===a?0:a,u=t.zoom,c=void 0===u?0:u,l=t.pitch,h=void 0===l?0:l,f=t.bearing,d=void 0===f?0:f,p=t.altitude,v=void 0===p?null:p,g=t.fovy,y=void 0===g?null:g,b=t.position,_=void 0===b?null:b,w=t.nearZMultiplier,k=void 0===w?.02:w,x=t.farZMultiplier,S=void 0===x?1.01:x;m(this,e),n=n||1,i=i||1,null===y&&null===v?y=zO(v=1.5):null===y?y=zO(v):null===v&&(v=UO(y));var E=function(e){return Math.pow(2,e)}(c);v=Math.max(.75,v);var C,O,T=jO({longitude:s,latitude:o}),A=NO([s,o]);A[2]=0,_&&function(e,t,n){e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2]}(A,A,function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}([],_,T.unitsPerMeter)),this.projectionMatrix=aO([],(O=VO({width:(C={width:n,height:i,pitch:h,fovy:y,nearZMultiplier:k,farZMultiplier:S}).width,height:C.height,altitude:C.altitude,fovy:C.fovy,pitch:C.pitch,nearZMultiplier:C.nearZMultiplier,farZMultiplier:C.farZMultiplier})).fov,O.aspect,O.near,O.far),this.viewMatrix=BO({height:i,scale:E,center:A,pitch:h,bearing:d,altitude:v}),this.width=n,this.height=i,this.scale=E,this.latitude=o,this.longitude=s,this.zoom=c,this.pitch=h,this.bearing=d,this.altitude=v,this.fovy=y,this.center=A,this.meterOffset=_||[0,0,0],this.distanceScales=T,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}return b(e,[{key:"_initMatrices",value:function(){var e=this.width,t=this.height,n=this.projectionMatrix,i=this.viewMatrix,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];tO(r,r,n),tO(r,r,i),this.viewProjectionMatrix=r;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];iO(o,o,[e/2,-t/2,1]),nO(o,o,[1,-1,0]),tO(o,o,r);var a=eO([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}},{key:"equals",value:function(t){return t instanceof e&&t.width===this.width&&t.height===this.height&&sO(t.projectionMatrix,this.projectionMatrix)&&sO(t.viewMatrix,this.viewMatrix)}},{key:"project",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=HO(this.projectPosition(e),this.pixelProjectionMatrix),a=t(o,2),s=a[0],u=a[1],c=r?u:this.height-u;return 2===e.length?[s,c]:[s,c,o[2]]}},{key:"unproject",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=n.targetZ,a=t(e,3),s=a[0],u=a[1],c=a[2],l=GO([s,r?u:this.height-u,c],this.pixelUnprojectionMatrix,o&&o*this.distanceScales.unitsPerMeter[2]),h=this.unprojectPosition(l),f=t(h,3),d=f[0],p=f[1],v=f[2];return Number.isFinite(c)?[d,p,v]:Number.isFinite(o)?[d,p,o]:[d,p]}},{key:"projectPosition",value:function(e){var n=t(NO(e),2);return[n[0],n[1],(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var n=t(LO(e),2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(e){return NO(e)}},{key:"unprojectFlat",value:function(e){return LO(e)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=GO(e.pos,this.pixelUnprojectionMatrix),i=yO([],NO(t),bO([],n));return LO(yO([],this.center,i))}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,o=WO(Object.assign({width:i,height:r,bounds:t},n)),a=o.longitude,s=o.latitude,u=o.zoom;return new e({width:i,height:r,longitude:a,latitude:s,zoom:u})}},{key:"getBounds",value:function(e){var t=this.getBoundingRegion(e),n=Math.min.apply(Math,v(t.map(function(e){return e[0]}))),i=Math.max.apply(Math,v(t.map(function(e){return e[0]})));return[[n,Math.min.apply(Math,v(t.map(function(e){return e[1]})))],[i,Math.max.apply(Math,v(t.map(function(e){return e[1]})))]]}},{key:"getBoundingRegion",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return XO(this,e.z||0)}}]),e}(),QO=Math.PI/180,$O=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZO=[0,0,0],JO={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]},eT=function(){var e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,o=void 0===r?0:r,a=t.y,s=void 0===a?0:a,u=t.width,c=void 0===u?1:u,l=t.height,h=void 0===l?1:l;this.id=i||this.constructor.displayName||"viewport",this.x=o,this.y=s,this.width=c||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return b(e,[{key:"metersPerPixel",get:function(){return this.distanceScales.metersPerUnit[2]/this.scale}},{key:"projectionMode",get:function(){return this.isGeospatial?this.zoom<12?Hw.WEB_MERCATOR:Hw.WEB_MERCATOR_AUTO_OFFSET:Hw.IDENTITY}},{key:"equals",value:function(t){return t instanceof e&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Xx(t.projectionMatrix,this.projectionMatrix)&&Xx(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=HO(this.projectPosition(e),this.pixelProjectionMatrix),a=t(o,2),s=a[0],u=a[1],c=r?u:this.height-u;return 2===e.length?[s,c]:[s,c,o[2]]}},{key:"unproject",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=n.targetZ,a=t(e,3),s=a[0],u=a[1],c=a[2],l=GO([s,r?u:this.height-u,c],this.pixelUnprojectionMatrix,o&&o*this.distanceScales.unitsPerMeter[2]),h=this.unprojectPosition(l),f=t(h,3),d=f[0],p=f[1],v=f[2];return Number.isFinite(c)?[d,p,v]:Number.isFinite(o)?[d,p,o]:[d,p]}},{key:"projectPosition",value:function(e){var n=t(this.projectFlat(e),2);return[n[0],n[1],(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var n=t(this.unprojectFlat(e),2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(e){return this.isGeospatial?NO(e):e}},{key:"unprojectFlat",value:function(e){return this.isGeospatial?LO(e):e}},{key:"getBounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={targetZ:e.z||0},n=this.unproject([0,0],t),i=this.unproject([this.width,0],t),r=this.unproject([0,this.height],t),o=this.unproject([this.width,this.height],t);return[Math.min(n[0],i[0],r[0],o[0]),Math.min(n[1],i[1],r[1],o[1]),Math.max(n[0],i[0],r[0],o[0]),Math.max(n[1],i[1],r[1],o[1])]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?jO({longitude:e[0],latitude:e[1],highPrecision:!0}):this.distanceScales}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,o=e.height,a=void 0===o?1:o;return t0&&void 0!==arguments[0]?arguments[0]:{};m(this,i);var r=t.latitude,o=void 0===r?0:r,a=t.longitude,s=void 0===a?0:a,u=t.zoom,l=void 0===u?11:u,h=t.pitch,f=void 0===h?0:h,d=t.bearing,p=void 0===d?0:d,v=t.nearZMultiplier,g=void 0===v?.1:v,y=t.farZMultiplier,b=void 0===y?1.01:y,_=t.orthographic,w=void 0!==_&&_,k=t.repeat,x=void 0!==k&&k,S=t.worldOffset,E=void 0===S?0:S,C=t.width,O=t.height,T=t.altitude,A=void 0===T?1.5:T,P=Math.pow(2,l),R=VO({width:C=C||1,height:O=O||1,pitch:f,altitude:A=Math.max(.75,A),nearZMultiplier:g,farZMultiplier:b}),D=R.fov,N=R.aspect,L=R.focalDistance,j=R.near,F=R.far,B=BO({height:O,pitch:f,bearing:p,scale:P,altitude:A});return E&&(B=(new EO).translate([512*E,0,0]).multiplyLeft(B)),(e=n.call(this,I(M({},t),{width:C,height:O,viewMatrix:B,longitude:s,latitude:o,zoom:l,orthographic:w,fovyRadians:D,aspect:N,focalDistance:L,near:j,far:F}))).latitude=o,e.longitude=s,e.zoom=l,e.pitch=f,e.bearing=p,e.altitude=A,e.orthographic=w,e._subViewports=x?[]:null,Object.freeze(c(e)),e}return b(i,[{key:"subViewports",get:function(){if(this._subViewports&&!this._subViewports.length)for(var e=this.getBounds(),t=Math.floor((e[0]+180)/360),n=Math.ceil((e[2]-180)/360),r=t;r<=n;r++){var o=r?new i(I(M({},this),{worldOffset:r})):this;this._subViewports.push(o)}return this._subViewports}},{key:"addMetersToLngLat",value:function(e,t){return FO(e,t)}},{key:"panByPosition",value:function(e,n){var i=GO(n,this.pixelUnprojectionMatrix),r=yO([],this.projectFlat(e),bO([],i)),o=yO([],this.center,r),a=t(this.unprojectFlat(o),2);return{longitude:a[0],latitude:a[1]}}},{key:"getBounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=XO(this,e.z||0);return[Math.min(t[0][0],t[1][0],t[2][0],t[3][0]),Math.min(t[0][1],t[1][1],t[2][1],t[3][1]),Math.max(t[0][0],t[1][0],t[2][0],t[3][0]),Math.max(t[0][1],t[1][1],t[2][1],t[3][1])]}},{key:"fitBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.width,r=this.height,o=WO(M({width:n,height:r,bounds:e},t)),a=o.longitude,s=o.latitude,u=o.zoom;return new i({width:n,height:r,longitude:a,latitude:s,zoom:u})}}]),i}(eT);return e.displayName="WebMercatorViewport",e}();function nT(e,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n.projectPosition(e);if(i&&n instanceof tT){var o=t(e,3),a=o[0],s=o[1],u=o[2],c=void 0===u?0:u,l=n.getDistanceScales([a,s]);r[2]=c*l.unitsPerMeter[2]}return r}function iT(e,n){var i,r=n.viewport,o=n.modelMatrix,a=n.coordinateSystem,s=n.coordinateOrigin,u=n.offsetMode,c=t(e,3),l=c[0],h=c[1],f=c[2],d=void 0===f?0:f;switch(o&&(l=(i=t(cO([],[l,h,d,1],o),3))[0],h=i[1],d=i[2]),a){case Uw.LNGLAT:return nT([l,h,d],r,u);case Uw.LNGLAT_OFFSETS:return nT([l+s[0],h+s[1],d+(s[2]||0)],r,u);case Uw.METER_OFFSETS:return nT(FO(s,[l,h,d]),r,u);case Uw.CARTESIAN:default:return r.isGeospatial?[l+s[0],h+s[1],d+s[2]]:r.projectPosition([l,h,d])}}var rT={10241:9987,10240:9729,10242:33071,10243:33071},oT={},aT={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return t.optional&&!e||lT(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return sT(e,t)}},accessor:{validate:function(e,t){var n=hT(e);return"function"===n||n===hT(t.value)},equal:function(e,t,n){return"function"==typeof t||sT(e,t)}},array:{validate:function(e,t){return t.optional&&!e||lT(e)},equal:function(e,t,n){return n.compare?sT(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}},data:{transform:function(e,t,n){var i=(n?n.props:{}).dataTransform;return i&&e?i(e):e}},image:{transform:function(e,t,n){return function(e,t){var n=e.context&&e.context.gl;if(!n||!t)return null;if(t instanceof mx)return t;t.constructor&&"Object"!==t.constructor.name&&(t={data:t});var i=null;t.compressed&&(i={10241:t.data.length>1?9985:9729});var r=new mx(n,I(M({},t),{parameters:M(M(M({},rT),i),e.props.textureParameters)}));return oT[r.id]=!0,r}(n,e)},release:function(e){!function(e){!e||!(e instanceof mx)||oT[e.id]&&(e.delete(),delete oT[e.id])}(e)}}};function sT(e,t){if(e===t)return!0;if(!lT(e)||!lT(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;m(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=ET,this.oldAsyncProps=null}return b(e,[{key:"finalize",value:function(){for(var e in this.asyncProps){var t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}},{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){if(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(var n in this.asyncProps)if(this.isAsyncPropLoading(n))return!0;return!1}},{key:"reloadAsyncProp",value:function(e,t){this._watchPromise(e,Promise.resolve(t))}},{key:"setAsyncProps",value:function(e){var t=e[xT]||{},n=e[kT]||e,i=e[ST]||{};for(var r in t){var o=t[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,o),t[r]=this.getAsyncProp(r)}for(var a in n){var s=n[a];this._createAsyncPropData(a,i[a]),this._updateAsyncProp(a,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var n,i=null===(n=this.layer)||void 0===n?void 0:n.props.fetch;i&&(t=i(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(xS(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.resolvedValue&&t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];t=this._postProcessValue(n,t),n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){var o;t=n._postProcessValue(i,t),n._setAsyncPropValue(e,t,r);var a=null===(o=n.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(t,{propName:e,layer:n.layer})}).catch(function(t){var i;null===(i=n.layer)||void 0===i||i.raiseError(t,"loading ".concat(e," of ").concat(n.layer))})}},{key:"_resolveAsyncIterable",value:function(e,t){var n=this;return Sx(regeneratorRuntime.mark(function i(){var r,o,a,s,u,c,l,h,f,d,p,v,g,m,y;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:"data"!==e&&n._setPropValue(e,t),(o=n.asyncProps[e]).pendingLoadCount++,a=o.pendingLoadCount,s=[],u=0,l=!0,h=!1,i.prev=6,p=wT(t);case 8:return i.next=10,p.next();case 10:return l=(f=i.sent).done,i.next=13,f.value;case 13:if(d=i.sent,l){i.next=20;break}v=d,g=n.component?n.component.props:{},m=g.dataTransform,s=m?m(v,s):s.concat(v),Object.defineProperty(s,"__diff",{enumerable:!1,value:[{startRow:u,endRow:s.length}]}),u=s.length,n._setAsyncPropValue(e,s,a);case 17:l=!0,i.next=8;break;case 20:i.next=25;break;case 22:i.prev=22,i.t0=i.catch(6),h=!0,c=i.t0;case 25:if(i.prev=25,i.prev=26,i.t1=!l&&null!=p.return,!i.t1){i.next=31;break}return i.next=31,p.return();case 31:if(i.prev=31,!h){i.next=34;break}throw c;case 34:return i.finish(31);case 35:return i.finish(25);case 36:(y=null===(r=n.layer)||void 0===r?void 0:r.props.onDataLoad)&&y(s,{propName:e,layer:n.layer});case 38:case"end":return i.stop()}},i,null,[[6,22,25,36],[26,,31,35]])}))()}},{key:"_postProcessValue",value:function(e,t){var n=e.type;return n&&(n.release&&n.release(e.resolvedValue,n,this.component),n.transform)?n.transform(t,n,this.component):t}},{key:"_createAsyncPropData",value:function(e,t){if(!this.asyncProps[e]){var n=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:n&&n[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}]),e}(),OT=HC.ASYNC_ORIGINAL,TT=HC.ASYNC_RESOLVED,AT=HC.ASYNC_DEFAULTS,PT={},MT=0,IT=function(){var e=function(){function e(){m(this,e),this.props=gT.apply(this,arguments),this.id=this.props.id,this.count=MT++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}return b(e,[{key:"clone",value:function(e){var t=this.props,n={};for(var i in t[AT])i in t[TT]?n[i]=t[TT][i]:i in t[OT]&&(n[i]=t[OT][i]);return new this.constructor(M(M(M({},t),n),e))}},{key:"stats",get:function(){return this.internalState.stats}},{key:"_initState",value:function(){this.internalState=new CT({})}}]),e}();return e.componentName="Component",e.defaultProps=PT,e}(),RT=function(e){a(n,e);var t=s(n);function n(e){var i,r=e.attributeManager,o=e.layer;return m(this,n),(i=t.call(this,o)).attributeManager=r,i.model=null,i.needsRedraw=!0,i.subLayers=null,i.usesPickingColorCache=!1,i}return b(n,[{key:"layer",get:function(){return this.component},set:function(e){this.component=e}}]),n}(CT),DT=function(e){return"function"==typeof e},NT=function(e){return null!==e&&"object"==typeof e},LT=function(e){return NT(e)&&e.constructor==={}.constructor},jT=function(e){return e&&"function"==typeof e[Symbol.iterator]},FT=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},BT=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},VT=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},zT=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||NT(e)&&DT(e.tee)&&DT(e.cancel)&&DT(e.getReader)}(e)||function(e){return NT(e)&&DT(e.read)&&DT(e.pipe)&&function(e){return"boolean"==typeof e}(e.readable)}(e)};function UT(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function HT(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function GT(e){var t,n,i;return UT(e,"null loader"),UT(HT(e),"invalid loader"),Array.isArray(e)&&(i=e[1],e=I(M({},e=e[0]),{options:M(M({},e.options),i)})),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(n=e)&&void 0!==n&&n.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var WT={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},qT=WT.global||WT.self||WT.window||{},XT="object"!=typeof process||"[object process]"!==String(process)||process.browser,KT="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);KT&&parseFloat(KT[1]);var QT={};function $T(e){for(var t in QT)e.startsWith(t)&&(e=e.replace(t,QT[t]));return!e.startsWith("http://")&&!e.startsWith("https://")&&(e="".concat(e)),e}var ZT=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,JT=/^([-\w.]+\/[-\w.+]+)/;function eA(e){var t=JT.exec(e);return t?t[1]:e}function tA(e){var t=ZT.exec(e);return t?t[1]:""}var nA=/\?.*/;function iA(e){if(BT(e)){var t=oA(e.url||"");return{url:t,type:eA(e.headers.get("content-type")||"")||tA(t)}}return VT(e)?{url:oA(e.name||""),type:e.type||""}:"string"==typeof e?{url:oA(e),type:tA(e)}:{url:"",type:""}}function rA(e){return BT(e)?e.headers["content-length"]||-1:VT(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}function oA(e){return e.replace(nA,"")}function aA(e){return sA.apply(this,arguments)}function sA(){return(sA=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!BT(t)){e.next=2;break}return e.abrupt("return",t);case 2:return n={},(i=rA(t))>=0&&(n["content-length"]=String(i)),r=iA(t),o=r.url,(a=r.type)&&(n["content-type"]=a),e.next=8,fA(t);case 8:return(s=e.sent)&&(n["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t)),u=new Response(t,{headers:n}),e.abrupt("return",(Object.defineProperty(u,"url",{value:o}),u));case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function uA(e){return cA.apply(this,arguments)}function cA(){return(cA=Sx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,lA(t);case 3:throw n=e.sent,new Error(n);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function lA(e){return hA.apply(this,arguments)}function hA(){return(hA=Sx(regeneratorRuntime.mark(function e(t){var n,i,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),e.prev=1,i=t.headers.get("Content-Type"),r=t.statusText,e.t0=i.includes("application/json"),!e.t0){e.next=12;break}return e.t1=r,e.t2=" ",e.next=10,t.text();case 10:e.t3=e.sent,r=e.t1+=e.t2.concat.call(e.t2,e.t3);case 12:n=(n+=r).length>60?"".concat(n.slice(60),"..."):n,e.next=18;break;case 16:e.prev=16,e.t4=e.catch(1);case 18:return e.abrupt("return",n);case 19:case"end":return e.stop()}},e,null,[[1,16]])}))).apply(this,arguments)}function fA(e){return dA.apply(this,arguments)}function dA(){return(dA=Sx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=2;break}return e.abrupt("return","data:,".concat(t.slice(0,5)));case 2:if(!(t instanceof Blob)){e.next=7;break}return n=t.slice(0,5),e.next=6,new Promise(function(e){var t=new FileReader;t.onload=function(t){var n;return e(null==t||null===(n=t.target)||void 0===n?void 0:n.result)},t.readAsDataURL(n)});case 6:return e.abrupt("return",e.sent);case 7:return e.abrupt("return",t instanceof ArrayBuffer?"data:base64,".concat(pA(t.slice(0,5))):null);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pA(e){for(var t="",n=new Uint8Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:"3.0.12";return AA(e,"no worker provided"),!(!t||!e.version)}var MA={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},IA=MA.global||MA.self||MA.window||{},RA="object"!=typeof process||"[object process]"!==String(process)||process.browser,DA="function"==typeof importScripts,NA="undefined"!=typeof window&&void 0!==window.orientation,LA="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),jA=(LA&&parseFloat(LA[1]),new Map);function FA(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function BA(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||new Set;if(e)if(VA(e))i.add(e);else if(VA(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)&&t&&"object"==typeof e)for(var r in e)BA(e[r],t,i);return void 0===n?Array.from(i):[]}function VA(e){return!!e&&(e instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&e instanceof MessagePort||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)}var zA=function(){},UA=function(){function e(t){m(this,e),mA(this,"name",void 0),mA(this,"source",void 0),mA(this,"url",void 0),mA(this,"terminated",!1),mA(this,"worker",void 0),mA(this,"onMessage",void 0),mA(this,"onError",void 0),mA(this,"_loadableURL","");var n=t.name,i=t.source,r=t.url;AA(i||r),this.name=n,this.source=i,this.url=r,this.onMessage=zA,this.onError=function(e){return console.log(e)},this.worker=this._createBrowserWorker()}return b(e,[{key:"destroy",value:function(){this.onMessage=zA,this.onError=zA,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||BA(e),this.worker.postMessage(e,t)}},{key:"_getErrorFromErrorEvent",value:function(e){var t="Failed to load ";return t+="worker ".concat(this.name,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=function(e){AA(e.source&&!e.url||!e.source&&e.url);var t=jA.get(e.source||e.url);return t||(e.url&&(t=function(e){return e.startsWith("http")?FA(function(e){return"try {\n importScripts('".concat(e,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")}(e)):e}(e.url),jA.set(e.url,t)),e.source&&(t=FA(e.source),jA.set(e.source,t))),AA(t),t}({source:this.source,url:this.url});var t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=function(t){t.data?e.onMessage(t.data):e.onError(new Error("No data received"))},t.onerror=function(t){e.onError(e._getErrorFromErrorEvent(t)),e.terminated=!0},t.onmessageerror=function(e){return console.error(e)},t}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker}}]),e}(),HA=function(){function e(t,n){var i=this;m(this,e),mA(this,"name",void 0),mA(this,"workerThread",void 0),mA(this,"isRunning",void 0),mA(this,"result",void 0),mA(this,"_resolve",void 0),mA(this,"_reject",void 0),this.name=t,this.workerThread=n,this.isRunning=!0,this._resolve=function(){},this._reject=function(){},this.result=new Promise(function(e,t){i._resolve=e,i._reject=t})}return b(e,[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){AA(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){AA(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}(),GA=function(){function e(t){m(this,e),mA(this,"name","unnamed"),mA(this,"source",void 0),mA(this,"url",void 0),mA(this,"maxConcurrency",1),mA(this,"maxMobileConcurrency",1),mA(this,"onDebug",function(){}),mA(this,"reuseWorkers",!0),mA(this,"props",{}),mA(this,"jobQueue",[]),mA(this,"idleQueue",[]),mA(this,"count",0),mA(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}return b(e,[{key:"destroy",value:function(){this.idleQueue.forEach(function(e){return e.destroy()}),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=M(M({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}},{key:"startJob",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t,n){return e.done(n)},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e,t){return e.error(t)},i=this;return Sx(regeneratorRuntime.mark(function r(){var o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return o=new Promise(function(r){return i.jobQueue.push({name:e,onMessage:t,onError:n,onStart:r}),i}),i._startQueuedJob(),r.next=4,o;case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}},r)}))()}},{key:"_startQueuedJob",value:function(){var e=this;return Sx(regeneratorRuntime.mark(function t(){var n,i,r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.jobQueue.length){t.next=2;break}return t.abrupt("return");case 2:if(n=e._getAvailableWorker()){t.next=5;break}return t.abrupt("return");case 5:if(!(i=e.jobQueue.shift())){t.next=16;break}return e.onDebug({message:"Starting job",name:i.name,workerThread:n,backlog:e.jobQueue.length}),r=new HA(i.name,n),n.onMessage=function(e){return i.onMessage(r,e.type,e.payload)},n.onError=function(e){return i.onError(r,e)},i.onStart(r),t.prev=10,t.next=13,r.result;case 13:return t.prev=13,e.returnWorkerToQueue(n),t.finish(13);case 16:case"end":return t.stop()}},t,null,[[10,,13,16]])}))()}},{key:"returnWorkerToQueue",value:function(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count0&&void 0!==arguments[0]?arguments[0]:{};return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}}]),e}();function XA(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="".concat(e.id,"-worker.js"),i=(t[e.id]||{}).workerUrl;if("test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){var r=e.version;"latest"===r&&(r="latest"),i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(r?"@".concat(r):"","/dist/").concat(n)}return AA(i),i}function YA(e,t){return!!qA.isSupported()&&e.worker&&(null==t?void 0:t.worker)}function KA(e,t,n,i,r){return QA.apply(this,arguments)}function QA(){return(QA=Sx(regeneratorRuntime.mark(function e(t,n,i,r,o){var a,s,u,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.id,s=XA(t,i),u=qA.getWorkerFarm(i).getWorkerPool({name:a,url:s}),i=JSON.parse(JSON.stringify(i)),e.next=4,u.startJob("process-on-worker",$A.bind(null,o));case 4:return(c=e.sent).postMessage("process",{input:n,options:i}),e.next=8,c.result;case 8:return e.next=10,e.sent.result;case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $A(e,t,n,i){return ZA.apply(this,arguments)}function ZA(){return(ZA=Sx(regeneratorRuntime.mark(function e(t,n,i,r){var o,a,s,u,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=i,e.next="done"===e.t0?3:"error"===e.t0?5:"process"===e.t0?7:20;break;case 3:return n.done(r),e.abrupt("break",21);case 5:return n.error(r.error),e.abrupt("break",21);case 7:return o=r.id,a=r.input,s=r.options,e.prev=8,e.next=11,t(a,s);case 11:u=e.sent,n.postMessage("done",{id:o,result:u}),e.next=19;break;case 15:e.prev=15,e.t1=e.catch(8),c=e.t1 instanceof Error?e.t1.message:"unknown error",n.postMessage("error",{id:o,error:c});case 19:return e.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(i));case 21:case"end":return e.stop()}},e,null,[[8,15]])}))).apply(this,arguments)}mA(qA,"_workerFarm",void 0);var JA=r(9521);function eP(e){if(function(e){return e&&"object"==typeof e&&e.isBuffer}(e)&&(e=function(e){return JA.toArrayBuffer?JA.toArrayBuffer(e):e}(e)),e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){var t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function tP(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==c[1]?c[1]:{},i=n.chunkSize,r=void 0===i?oP:i,o=0;case 3:if(!(o2&&void 0!==arguments[2]?arguments[2]:null;if(n)return n;var i=M({fetch:EA(t,e)},e);return Array.isArray(i.loaders)||(i.loaders=null),i}function _P(e,t){if(!t&&e&&!Array.isArray(e))return e;var n;if(e&&(n=Array.isArray(e)?e:[e]),t&&t.loaders){var i=Array.isArray(t.loaders)?t.loaders:[t.loaders];n=n?[].concat(v(n),v(i)):i}return n&&n.length?n:null}var wP=function(){var e=kA();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function kP(e){var t,n=wP(),i=_(e=Array.isArray(e)?e:[e]);try{var r=function(){var e=GT(t.value);n.find(function(t){return e===t})||n.unshift(e)};for(i.s();!(t=i.n()).done;)r()}catch(o){i.e(o)}finally{i.f()}}var xP=/\.([^.]+)$/;function SP(e){return EP.apply(this,arguments)}function EP(){return(EP=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]?a[1]:[],i=a.length>2?a[2]:void 0,r=a.length>3?a[3]:void 0,OP(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(o=CP(t,n,I(M({},i),{nothrow:!0}),r))){e.next=8;break}return e.abrupt("return",o);case 8:if(e.t0=VT(t),!e.t0){e.next=18;break}return e.t1=CP,e.next=13,t.slice(0,10).arrayBuffer();case 13:e.t2=t=e.sent,e.t3=n,e.t4=i,e.t5=r,o=(0,e.t1)(e.t2,e.t3,e.t4,e.t5);case 18:if(o||null!=i&&i.nothrow){e.next=20;break}throw new Error(TP(t));case 20:return e.abrupt("return",o);case 21:case"end":return e.stop()}},e)}))).apply(this,arguments)}function CP(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!OP(e))return null;if(n&&!Array.isArray(n))return GT(n);var o=[];n&&(o=o.concat(n)),null!=i&&i.ignoreRegisteredLoaders||(t=o).push.apply(t,v(wP())),function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){GT(t.value)}}catch(i){n.e(i)}finally{n.f()}}(o);var a=function(e,t,n,i){var r=iA(e),o=r.url,a=r.type,s=o||(null==i?void 0:i.url),u=null;return null!=n&&n.mimeType&&(u=AP(t,null==n?void 0:n.mimeType)),u=(u=(u=(u=u||function(e,t){var n=t&&xP.exec(t),i=n&&n[1];return i?function(e,t){t=t.toLowerCase();var n,i=_(e);try{for(i.s();!(n=i.n()).done;){var r,o=n.value,a=_(o.extensions);try{for(a.s();!(r=a.n()).done;){if(r.value.toLowerCase()===t)return o}}catch(s){a.e(s)}finally{a.f()}}}catch(s){i.e(s)}finally{i.f()}return null}(e,i):null}(t,s))||AP(t,a))||function(e,t){if(!t)return null;var n,i=_(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;if("string"==typeof t){if(PP(t,r))return r}else if(ArrayBuffer.isView(t)){if(MP(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&MP(t,0,r))return r}}catch(o){i.e(o)}finally{i.f()}return null}(t,e))||AP(t,null==n?void 0:n.fallbackMimeType)}(e,o,i,r);if(!(a||null!=i&&i.nothrow))throw new Error(TP(e));return a}function OP(e){return!(e instanceof Response&&204===e.status)}function TP(e){var t=iA(e),n=t.url,i=t.type,r="No valid loader found";return e&&(r+=' data: "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return"string"==typeof e?e.slice(0,t):ArrayBuffer.isView(e)?IP(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?IP(e,0,t):""}(e),'", contentType: "').concat(i,'"')),n&&(r+=" url: ".concat(n)),r}function AP(e,t){var n,i=_(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.mimeTypes&&r.mimeTypes.includes(t)||t==="application/x.".concat(r.id))return r}}catch(o){i.e(o)}finally{i.f()}return null}function PP(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(function(t){return e.startsWith(t)})}function MP(e,t,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(function(i){return function(e,t,n,i){if(i instanceof ArrayBuffer)return function(e,t,n){if(e.byteLength<(n=n||e.byteLength)||t.byteLength0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}},{key:"hasUniformTransition",value:function(){return this.internalState.uniformTransitions.active}},{key:"isLoaded",get:function(){return this.internalState&&!this.internalState.isAsyncPropLoading()}},{key:"wrapLongitude",get:function(){return this.props.wrapLongitude}},{key:"isPickable",value:function(){return this.props.pickable&&this.props.visible}},{key:"getModels",value:function(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getLoadOptions",value:function(){return this.props.loadOptions}},{key:"project",value:function(e){var n=this.context.viewport,i=t(HO(iT(e,{viewport:n,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),n.pixelProjectionMatrix),3),r=i[0],o=i[1],a=i[2];return 2===e.length?[r,o]:[r,o,a]}},{key:"unproject",value:function(e){return this.context.viewport.unproject(e)}},{key:"projectPosition",value:function(e){return function(e,t){var n=function(e){var t=M({},e),n=e.coordinateSystem,i=e.coordinateOrigin,r=e.fromCoordinateSystem,o=e.fromCoordinateOrigin;return n===Uw.DEFAULT&&(n=e.viewport.isGeospatial?Uw.LNGLAT:Uw.CARTESIAN),void 0===r&&(t.fromCoordinateSystem=n),void 0===o&&(t.fromCoordinateOrigin=i),t.coordinateSystem=n,t}(t),i=n.viewport,r=n.coordinateSystem,o=n.coordinateOrigin,a=n.modelMatrix,s=n.fromCoordinateSystem,u=n.fromCoordinateOrigin,c=gO(i,r,o),l=c.geospatialOrigin,h=c.shaderCoordinateOrigin,f=c.offsetMode,d=iT(e,{viewport:i,modelMatrix:a,coordinateSystem:s,coordinateOrigin:u,offsetMode:f});return f&&function(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2]}(d,d,i.projectPosition(l||h)),d}(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"use64bitPositions",value:function(){var e=this.props.coordinateSystem;return e===Uw.DEFAULT||e===Uw.LNGLAT||e===Uw.CARTESIAN}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){bS(e instanceof Uint8Array);var n=t(e,3);return n[0]+256*n[1]+65536*n[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t,n=_(this.props.extensions);try{for(n.s();!(t=n.n()).done;){var i=t.value;e=JC(e,i.getShaders.call(this,i))}}catch(r){n.e(r)}finally{n.f()}return e}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=this.getAttributeManager();if(i.dataChanged&&r){var o=i.dataChanged;if(Array.isArray(o)){var a,s=_(o);try{for(s.s();!(a=s.n()).done;){var u=a.value;r.invalidateAll(u)}}catch(p){s.e(p)}finally{s.f()}}else r.invalidateAll()}var c=n.highlightedObjectIndex>=0||n.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==c&&r){var l=r.attributes,h=l.pickingColors,f=l.instancePickingColors,d=h||f;d&&(c&&d.constant&&(d.constant=!1,r.invalidate(d.id)),!d.value&&!c&&(d.constant=!0,d.value=[0,0,0]))}}},{key:"finalizeState",value:function(){var e,t=_(this.getModels());try{for(t.s();!(e=t.n()).done;){e.value.delete()}}catch(i){t.e(i)}finally{t.f()}var n=this.getAttributeManager();n&&n.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}},{key:"draw",value:function(e){var t,n=_(this.getModels());try{for(n.s();!(t=n.n()).done;){t.value.draw(e)}}catch(i){n.e(i)}finally{n.f()}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.index;return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"activateViewport",value:function(e){var t=this.internalState.viewport;this.internalState.viewport=e,(!t||!zP({oldViewport:t,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=this.getAttributeManager();!t||("all"===e?t.invalidateAll():t.invalidate(e))}},{key:"updateAttributes",value:function(e){var t,n=_(this.getModels());try{for(n.s();!(t=n.n()).done;){var i=t.value;this._setModelAttributes(i,e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"_updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getStartIndices(e);t.update({data:e.data,numInstances:n,startIndices:i,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this,ignoreUnknownAttributes:!0});var r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}}},{key:"_updateAttributeTransition",value:function(){var e=this.getAttributeManager();e&&e.updateTransition()}},{key:"_updateUniformTransition",value:function(){var e=this.internalState.uniformTransitions;if(e.active){var t=e.update(),n=Object.create(this.props);for(var i in t)Object.defineProperty(n,i,{value:t[i]});return n}return this.props}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.numInstances;if(!e.constant){var i=Math.floor(UP.length/3);if(this.internalState.usesPickingColorCache=!0,iBP&&zw.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),UP=Fx.allocate(UP,n,{size:3,copy:!0,maxCount:Math.max(n,BP)});for(var r=Math.floor(UP.length/3),o=[],a=i;a=0?this.encodePickingColor(o):null),this.setModuleParameters(s)}}},{key:"_getUpdateParams",value:function(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}},{key:"_getNeedsRedraw",value:function(e){if(!this.internalState)return!1;var t=!1;t=t||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags;var n=this.getAttributeManager(),i=n&&n.getNeedsRedraw(e);return t=t||i}},{key:"_getAttributeManager",value:function(){return new FC(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}},{key:"_initState",value:function(){bS(!this.internalState&&!this.state),bS(isFinite(this.props.coordinateSystem));var e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new RT({attributeManager:e,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:function(){return zw.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),e}}),this.internalState.layer=this,this.internalState.uniformTransitions=new UC(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}},{key:"_transferState",value:function(e){BS("layer.matched",this,this===e);var t=e.state,n=e.internalState;this!==e&&(this.internalState=n,this.internalState.layer=this,this.state=t,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}},{key:"_onAsyncPropUpdated",value:function(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}]),i}(IT);return e.layerName="Layer",e.defaultProps=HP,e}(),WP=function(){var t=function(t){a(i,t);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"isComposite",get:function(){return!0}},{key:"isLoaded",get:function(){return e(p(i.prototype),"isLoaded",this)&&this.getSubLayers().every(function(e){return e.isLoaded})}},{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(t){e(p(i.prototype),"setState",this).call(this,t),this.setNeedsUpdate()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id&&(t.object=n.__source.object,t.index=n.__source.index),t}},{key:"renderLayers",value:function(){return null}},{key:"filterSubLayer",value:function(e){return!0}},{key:"shouldRenderSubLayer",value:function(e,t){return t&&t.length}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerRow",value:function(e,t,n){return e.__source={parent:this,object:t,index:n},e}},{key:"getSubLayerAccessor",value:function(e){if("function"==typeof e){var t={data:this.props.data,target:[]};return function(n,i){return n&&n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,i)}}return e}},{key:"getSubLayerProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.opacity,i=t.pickable,r=t.visible,o=t.parameters,a=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,h=t.coordinateOrigin,f=t.wrapLongitude,d=t.positionFormat,p=t.modelMatrix,v=t.extensions,g=t.fetch,m=t._subLayerProps,y={opacity:n,pickable:i,visible:r,parameters:o,getPolygonOffset:a,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:h,wrapLongitude:f,positionFormat:d,modelMatrix:p,extensions:v,fetch:g},b=m&&m[e.id],w=b&&b.updateTriggers,k=e.id||"sublayer";if(b){var x=this.constructor._propTypes,S=e.type?e.type._propTypes:{};for(var E in b){var C=S[E]||x[E];C&&"accessor"===C.type&&(b[E]=this.getSubLayerAccessor(b[E]))}}Object.assign(y,e,b),y.id="".concat(this.props.id,"-").concat(k),y.updateTriggers=M(M({all:this.props.updateTriggers.all},e.updateTriggers),w);var O,T=_(v);try{for(T.s();!(O=T.n()).done;){var A=O.value,P=A.getSubLayerProps.call(this,A);P&&Object.assign(y,P,{updateTriggers:Object.assign(y.updateTriggers,P.updateTriggers)})}}catch(I){T.e(I)}finally{T.f()}return y}},{key:"_updateAutoHighlight",value:function(e){var t,n=_(this.getSubLayers());try{for(n.s();!(t=n.n()).done;){t.value.updateAutoHighlight(e)}}catch(i){n.e(i)}finally{n.f()}}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers,t=!e||this.needsUpdate();t&&(e=SS(e=this.renderLayers(),Boolean),this.internalState.subLayers=e),BS("compositeLayer.renderLayers",this,t,e);var n,i=_(e);try{for(i.s();!(n=i.n()).done;){n.value.parent=this}}catch(r){i.e(r)}finally{i.f()}}}]),i}(GP);return t.layerName="CompositeLayer",t}(),qP=/([0-9]+\.?[0-9]*)(%|px)/;function XP(e){switch(typeof e){case"number":return{position:e,relative:!1};case"string":var t=e.match(qP);if(t&&t.length>=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function YP(e,t){return e.relative?Math.round(e.position*t):e.position}function KP(e,t){if(e===t)return!0;if(!e||!t)return!1;for(var n in e){var i=e[n],r=t[n];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&KP(i,r)))return!1}return!0}var QP=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,o=void 0===r?0:r,a=t.y,s=void 0===a?0:a,u=t.width,c=void 0===u?"100%":u,l=t.height,h=void 0===l?"100%":l,f=t.projectionMatrix,d=void 0===f?null:f,p=t.fovy,v=void 0===p?50:p,g=t.near,y=void 0===g?.1:g,b=t.far,_=void 0===b?1e3:b,w=t.modelMatrix,k=void 0===w?null:w,x=t.viewportInstance,S=void 0===x?null:x,E=t.type,C=void 0===E?eT:E;bS(!S||S instanceof eT),this.viewportInstance=S,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=I(M({},t),{id:this.id,projectionMatrix:d,fovy:v,near:y,far:_,modelMatrix:k}),this._parseDimensions({x:o,y:s,width:c,height:h}),this.equals=this.equals.bind(this),Object.seal(this)}return b(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):KP(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n});return this._getViewport(i,r)}},{key:"getViewStateId",value:function(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;var t=M({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:YP(this._x,t),y:YP(this._y,n),width:YP(this._width,t),height:YP(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),M(M({},e),t)):null}},{key:"_getViewport",value:function(e,t){return new(0,this.type)(M(M(M({},e),this.props),t))}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=XP(t),this._y=XP(n),this._width=XP(i),this._height=XP(r)}}]),e}(),$P=function(){},ZP={transitionEasing:function(e){return e},transitionInterruption:1,onTransitionStart:$P,onTransitionInterrupt:$P,onTransitionEnd:$P},JP=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.ControllerState=t,this.props=M(M({},ZP),n),this.propsInTransition=null,this.transition=new DC(n.timeline),this.onViewStateChange=n.onViewStateChange||$P,this.onStateChange=n.onStateChange||$P,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return b(e,[{key:"finalize",value:function(){this.transition.cancel()}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=M(M({},ZP),e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=this.transition.settings,r=i.interruption,o=i.endProps,a=M(M({},n),2===r?o:this.propsInTransition||n);this._triggerTransition(a,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(){this.transition.update()}},{key:"_isTransitionEnabled",value:function(e){var t=e.transitionDuration,n=e.transitionInterpolator;return(t>0||"auto"===t)&&Boolean(n)}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator,o=r.getDuration?r.getDuration(e,t):t.transitionDuration;if(0!==o){var a=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,t.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.time,n=e.settings,i=n.interpolator,r=n.startProps,o=n.endProps,a=n.duration,s=(0,n.easing)(t/a),u=i.interpolateProps(r,o,s);this.propsInTransition=new this.ControllerState(M(M({},this.props),u)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}]),e}(),eM=["longitude","latitude","zoom","bearing","pitch"],tM=["longitude","latitude","zoom"],nM=function(t){a(i,t);var n=s(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m(this,i),(e=n.call(this,(Array.isArray(t)?t:t.transitionProps)||{compare:eM,extract:eM,required:tM})).opts=t,e}return b(i,[{key:"initializeProps",value:function(t,n){var r=e(p(i.prototype),"initializeProps",this).call(this,t,n),o=this.opts,a=o.makeViewport,s=o.around;if(a&&s){var u=a(t),c=a(n),l=u.unproject(s);r.start.around=s,Object.assign(r.end,{around:c.project(l),aroundPosition:l,width:n.width,height:n.height})}return r}},{key:"interpolateProps",value:function(e,t,n){var i,r={},o=_(this._propsToExtract);try{for(o.s();!(i=o.n()).done;){var a=i.value;r[a]=qx(e[a]||0,t[a]||0,n)}}catch(u){o.e(u)}finally{o.f()}if(t.aroundPosition){var s=this.opts.makeViewport(M(M({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,qx(e.around,t.around,n)))}return r}}]),i}(function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,r=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=r,this._requiredProps=o}return b(e,[{key:"arePropsEqual",value:function(e,t){var n,i=_(this._propsToCompare||Object.keys(t));try{for(i.s();!(n=i.n()).done;){var r=n.value;if(!(r in e)||!(r in t)||!Xx(e[r],t[r]))return!1}}catch(o){i.e(o)}finally{i.f()}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i,r={},o={},a=_(this._propsToExtract);try{for(a.s();!(i=a.n()).done;){var s=i.value;r[s]=e[s],o[s]=t[s]}}catch(u){a.e(u)}finally{a.f()}n={start:r,end:o}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){return t}},{key:"getDuration",value:function(e,t){return t.transitionDuration}},{key:"_checkRequiredProps",value:function(e){!this._requiredProps||this._requiredProps.forEach(function(t){var n=e[t];bS(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()),iM={transitionDuration:0},rM={transitionDuration:300,transitionEasing:function(e){return e},transitionInterruption:1},oM=function(e){return 1-(1-e)*(1-e)},aM=["wheel"],sM=["panstart","panmove","panend"],uM=["pinchstart","pinchmove","pinchend"],cM=["tripanstart","tripanmove","tripanend"],lM=["doubletap"],hM=["keydown"],fM=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new JP(t,I(M({},n),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));var i=this.linearTransitionProps;this._transition=i&&I(M({},rM),{transitionInterpolator:new nM({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return b(e,[{key:"linearTransitionProps",get:function(){return null}},{key:"events",set:function(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}},{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;this.controllerState=new t(M(M({makeViewport:this.makeViewport},this.controllerStateProps),this._state));var n=this._eventStartBlocked;switch(e.type){case"panstart":return!n&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!n&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!n&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var o=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return o&&t&&t.stopPropagation(),o}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._interactionState.isDragging}},{key:"blockEvents",value:function(e){var t=this,n=setTimeout(function(){t._eventStartBlocked===n&&(t._eventStartBlocked=null)},e);this._eventStartBlocked=n}},{key:"setProps",value:function(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);var t=e.inertia;!0===t&&(t=300),this.inertia=t;var n=e.scrollZoom,i=void 0===n||n,r=e.dragPan,o=void 0===r||r,a=e.dragRotate,s=void 0===a||a,u=e.doubleClickZoom,c=void 0===u||u,l=e.touchZoom,h=void 0===l||l,f=e.touchRotate,d=void 0!==f&&f,p=e.keyboard,v=void 0===p||p,g=Boolean(this.onViewStateChange);this.toggleEvents(aM,g&&i),this.toggleEvents(sM,g&&(o||s)),this.toggleEvents(uM,g&&(h||d)),this.toggleEvents(cM,g&&d),this.toggleEvents(lM,g&&c),this.toggleEvents(hM,g&&v),this.scrollZoom=i,this.dragPan=o,this.dragRotate=s,this.doubleClickZoom=c,this.touchZoom=h,this.touchRotate=d,this.keyboard=v}},{key:"updateTransition",value:function(){this.transitionManager.updateTransition()}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=M(M({},e.getViewportProps()),t),r=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(n),r){var o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:o})}}},{key:"_onTransition",value:function(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}},{key:"_setInteractionState",value:function(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(n=!n);var i=this.controllerState[n?"panStart":"rotateStart"]({pos:t});return this._panMove=n,this.updateViewport(i,iM,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}},{key:"_onPanEnd",value:function(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,iM,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(e){var t=this.inertia;if(this.dragPan&&t&&e.velocity){var n=this.getCenter(e),i=this.controllerState.pan({pos:[n[0]+e.velocityX*t/2,n[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(i,I(M({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:oM}),{isDragging:!1,isPanning:!0})}else{var r=this.controllerState.panEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1})}return!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=this.getCenter(e),n=this.controllerState.rotate({pos:t});return this.updateViewport(n,iM,{isDragging:!0,isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(e){var t=this.inertia;if(this.dragRotate&&t&&e.velocity){var n=this.getCenter(e),i=this.controllerState.rotate({pos:[n[0]+e.velocityX*t/2,n[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(i,I(M({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:oM}),{isDragging:!1,isRotating:!0})}else{var r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.scrollZoom,i=n.speed,r=void 0===i?.01:i,o=n.smooth,a=void 0!==o&&o,s=e.delta,u=2/(1+Math.exp(-Math.abs(s*r)));s<0&&0!==u&&(u=1/u);var c=this.controllerState.zoom({pos:t,scale:u});return this.updateViewport(c,I(M({},this._getTransitionProps({around:t})),{transitionDuration:a?250:1}),{isZooming:!0,isPanning:!0}),!0}},{key:"_onTriplePanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.rotateStart({pos:t});return this.updateViewport(n,iM,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(e){if(!this.touchRotate||!this.isDragging())return!1;var t=this.getCenter(e);t[0]-=e.deltaX;var n=this.controllerState.rotate({pos:t});return this.updateViewport(n,iM,{isDragging:!0,isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(e){if(!this.isDragging())return!1;var t=this.inertia;if(this.touchRotate&&t&&e.velocityY){var n=this.getCenter(e),i=[n[0],n[1]+=e.velocityY*t/2],r=this.controllerState.rotate({pos:i});this.updateViewport(r,I(M({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:oM}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{var o=this.controllerState.rotateEnd();this.updateViewport(o,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(n,iM,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation;t=t.rotate({deltaAngleX:this._startPinchRotation-r})}return this.updateViewport(t,iM,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}},{key:"_onPinchEnd",value:function(e){if(!this.isDragging())return!1;var t=this.inertia,n=this._lastPinchEvent;if(this.touchZoom&&t&&n&&e.scale!==n.scale){var i=this.getCenter(e),r=this.controllerState.rotateEnd(),o=Math.log2(e.scale),a=(o-Math.log2(n.scale))/(e.deltaTime-n.deltaTime),s=Math.pow(2,o+a*t/2);r=r.zoom({pos:i,scale:s}).zoomEnd(),this.updateViewport(r,I(M({},this._getTransitionProps({around:i})),{transitionDuration:t,transitionEasing:oM}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{var u=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(u,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.keyboard,r=i.zoomSpeed,o=i.moveSpeed,a=i.rotateSpeedX,s=i.rotateSpeedY,u=this.controllerState,c={};switch(e.srcEvent.code){case"Minus":t=n?u.zoomOut(r).zoomOut(r):u.zoomOut(r),c.isZooming=!0;break;case"Equal":t=n?u.zoomIn(r).zoomIn(r):u.zoomIn(r),c.isZooming=!0;break;case"ArrowLeft":n?(t=u.rotateLeft(a),c.isRotating=!0):(t=u.moveLeft(o),c.isPanning=!0);break;case"ArrowRight":n?(t=u.rotateRight(a),c.isRotating=!0):(t=u.moveRight(o),c.isPanning=!0);break;case"ArrowUp":n?(t=u.rotateUp(s),c.isRotating=!0):(t=u.moveUp(o),c.isPanning=!0);break;case"ArrowDown":n?(t=u.rotateDown(s),c.isRotating=!0):(t=u.moveDown(o),c.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),c),!0}},{key:"_getTransitionProps",value:function(e){var t=this._transition;return t?e?I(M({},t),{transitionInterpolator:new nM(I(M({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:iM}}]),e}(),dM=function(){function e(t){m(this,e),this._viewportProps=this._applyConstraints(t)}return b(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}(),pM=[0,0,0],vM=function(e){a(n,e);var t=s(n);function n(e){var i,r=e.makeViewport,o=e.width,a=e.height,s=e.rotationX,u=void 0===s?0:s,c=e.rotationOrbit,l=void 0===c?0:c,h=e.target,f=void 0===h?pM:h,d=e.zoom,p=void 0===d?0:d,v=e.minRotationX,g=void 0===v?-90:v,y=e.maxRotationX,b=void 0===y?90:y,_=e.minZoom,w=void 0===_?-1/0:_,k=e.maxZoom,x=void 0===k?1/0:k,S=e.startPanPosition,E=e.startRotatePos,C=e.startRotationX,O=e.startRotationOrbit,T=e.startZoomPosition,A=e.startZoom;return m(this,n),(i=t.call(this,{width:o,height:a,rotationX:u,rotationOrbit:l,target:f,zoom:p,minRotationX:g,maxRotationX:b,minZoom:w,maxZoom:x}))._state={startPanPosition:S,startRotatePos:E,startRotationX:C,startRotationOrbit:O,startZoomPosition:T,startZoom:A},i.makeViewport=r,i}return b(n,[{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanPosition:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPosition,i=this._state.startPanPosition||n;if(!i)return this;var r=this.makeViewport(this._viewportProps).panByPosition(i,t);return this._getUpdatedState(r)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null})}},{key:"rotateStart",value:function(e){var t=e.pos;return this._getUpdatedState({startRotatePos:t,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t,n=e.pos,i=e.deltaAngleX,r=void 0===i?0:i,o=e.deltaAngleY,a=void 0===o?0:o,s=this._state,u=s.startRotatePos,c=s.startRotationX,l=s.startRotationOrbit,h=this._viewportProps,f=h.width,d=h.height;if(!u||!Number.isFinite(c)||!Number.isFinite(l))return this;if(n){var p=(n[0]-u[0])/f;(c<-90||c>90)&&(p*=-1),t={rotationX:c+(n[1]-u[1])/d*180,rotationOrbit:l+180*p}}else t={rotationX:c+a,rotationOrbit:l+r};return this._getUpdatedState(t)}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=M({},this._viewportProps),i=n.rotationOrbit;return Math.abs(i-t.rotationOrbit)>180&&(n.rotationOrbit=i<0?i+360:i-360),n}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps.zoom,o=this._state,a=o.startZoom,s=o.startZoomPosition;Number.isFinite(a)||(a=r,s=this._unproject(n)||this._unproject(t));var u=this._calculateNewZoom({scale:i,startZoom:a}),c=this.makeViewport(I(M({},this._viewportProps),{zoom:u}));return this._getUpdatedState(M({zoom:u},c.panByPosition(s,t)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}},{key:"zoomIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}},{key:"zoomOut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}},{key:"moveLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([-e,0])}},{key:"moveRight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([e,0])}},{key:"moveUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,-e])}},{key:"moveDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,e])}},{key:"rotateLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}},{key:"rotateRight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}},{key:"rotateUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}},{key:"rotateDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}},{key:"_unproject",value:function(e){var t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,o=i.minZoom;return Number.isFinite(n)||(n=this._viewportProps.zoom),Wx(n+Math.log2(t),o,r)}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height,r=t.target;return this.pan({startPosition:r,pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new n(M(M(M({},this._viewportProps),this._state),e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom,r=e.maxRotationX,o=e.minRotationX,a=e.rotationOrbit;return e.zoom=Wx(i,n,t),e.rotationX=Wx(e.rotationX,o,r),(a<-180||a>180)&&(e.rotationOrbit=function(e,t){var n=e%360;return n<0?360+n:n}(a+180)-180),e}}]),n}(dM),gM=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,vM,e)}return b(n,[{key:"linearTransitionProps",get:function(){return["target","zoom","rotationX","rotationOrbit"]}}]),n}(fM),mM=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),e.dragMode=e.dragMode||"pan",t.call(this,vM,e)}return b(n,[{key:"_onPanRotate",value:function(e){return!1}},{key:"linearTransitionProps",get:function(){return["target","zoom"]}}]),n}(fM),yM=(new EO).lookAt({eye:[0,0,1]});function bM(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new EO).ortho({left:-t/2,right:t/2,bottom:-n/2,top:n/2,near:i,far:r})}var _M=function(e){a(n,e);var t=s(n);function n(e){m(this,n);var i=e.width,r=e.height,o=e.near,a=void 0===o?.1:o,s=e.far,u=void 0===s?1e3:s,c=e.zoom,l=void 0===c?0:c,h=e.target,f=void 0===h?[0,0,0]:h,d=e.flipY,p=void 0===d||d,v=Math.pow(2,l);return t.call(this,I(M({},e),{longitude:null,position:f,viewMatrix:yM.clone().scale([v,v*(p?-1:1),v]),projectionMatrix:bM({width:i,height:r,near:a,far:u}),zoom:l}))}return b(n,[{key:"panByPosition",value:function(e,t){var n=yO([],e,bO([],GO(t,this.pixelUnprojectionMatrix)));return{target:yO([],this.center,n)}}}]),n}(eT),wM=function(){var e=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,I(M({},e),{type:_M}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:mM})}}]),n}(QP);return e.displayName="OrthographicView",e}(),kM=Math.PI/180;function xM(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,o=e.rotationOrbit,a=e.zoom,s=.5/Math.tan(n*kM/2),u="Z"===i?[0,0,1]:[0,1,0],c="Z"===i?[0,-s,0]:[0,0,s],l=(new EO).lookAt({eye:c,up:u});l.rotateX(r*kM),"Z"===i?l.rotateZ(o*kM):l.rotateY(o*kM);var h=Math.pow(2,a)/(t||1);return l.scale(h),l}var SM=function(e){a(i,e);var n=s(i);function i(e){var t;m(this,i);var r=e.height,o=e.fovy,a=e.orbitAxis,s=e.target,u=void 0===s?[0,0,0]:s,c=e.rotationX,l=void 0===c?0:c,h=e.rotationOrbit,f=void 0===h?0:h,d=e.zoom,p=void 0===d?0:d;return(t=n.call(this,I(M({},e),{longitude:null,viewMatrix:xM({height:r,fovy:o,orbitAxis:a,rotationX:l,rotationOrbit:f,zoom:p}),fovy:o,position:u,zoom:p}))).projectedCenter=t.project(t.center),t}return b(i,[{key:"unproject",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.topLeft,r=void 0===i||i,o=t(e,3),a=o[0],s=o[1],u=o[2],c=void 0===u?this.projectedCenter[2]:u,l=r?s:this.height-s,h=GO([a,l,c],this.pixelUnprojectionMatrix),f=t(h,3),d=f[0],p=f[1],v=f[2];return[d,p,v]}},{key:"panByPosition",value:function(e,t){var n=this.project(e);return{target:this.unproject([this.width/2+n[0]-t[0],this.height/2+n[1]-t[1],this.projectedCenter[2]])}}}]),i}(eT),EM=function(){var e=function(e){a(n,e);var t=s(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var i=e.orbitAxis,r=void 0===i?"Z":i;return t.call(this,I(M({},e),{orbitAxis:r,type:SM}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:gM})}}]),n}(QP);return e.displayName="OrbitView",e}(),CM=[255,255,255],OM=0,TM=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.color,i=void 0===n?CM:n,r=t.intensity,o=void 0===r?1:r;this.id=t.id||"ambient-".concat(OM++),this.color=i,this.intensity=o,this.type="ambient"},AM=[255,255,255],PM=[0,0,-1],MM=0,IM=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.color,i=void 0===n?AM:n,r=t.intensity,o=void 0===r?1:r,a=t.direction,s=void 0===a?PM:a,u=t._shadow,c=void 0!==u&&u;this.id=t.id||"directional-".concat(MM++),this.color=i,this.intensity=o,this.type="directional",this.direction=new fS(s).normalize().toArray(),this.shadow=c}return b(e,[{key:"getProjectedLight",value:function(){return this}}]),e}(),RM=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props=M({},t)}return b(e,[{key:"preRender",value:function(){}},{key:"getModuleParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}(),DM=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"render",value:function(e){return Ok(this.gl,{framebuffer:e.target}),this._drawLayers(e)}},{key:"_drawLayers",value:function(e){var t=e.viewports,n=e.views,i=e.onViewportActive,r=e.clearCanvas,o=void 0===r||r;e.pass=e.pass||"unknown";var a=this.gl;o&&function(e){Ok(e,{viewport:[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}),e.clear(16640)}(a);var s,u=[],c=_(t);try{for(c.s();!(s=c.n()).done;){var l=s.value,h=l.viewport||l,f=n&&n[h.id];i(h);var d=this._getDrawLayerParams(h,e);e.view=f;var p,v=_(h.subViewports||[h]);try{for(v.s();!(p=v.n()).done;){var g=p.value;e.viewport=g;var m=this._drawLayersInViewport(a,e,d);u.push(m)}}catch(y){v.e(y)}finally{v.f()}}}catch(y){c.e(y)}finally{c.f()}return u}},{key:"_getDrawLayerParams",value:function(e,t){for(var n=t.layers,i=t.pass,r=t.layerFilter,o=t.effects,a=t.moduleParameters,s=[],u=NM(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i},l=0;l1&&void 0!==arguments[1]?arguments[1]:{};m(this,e);var i=n.id,r=void 0===i?"pass":i;this.id=r,this.gl=t,this.props=M({},n)}return b(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}());function NM(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},i=function i(r,o){var a,s=r.props._offset,u=r.id,c=r.parent&&r.parent.id;if(c&&!(c in t)&&i(r.parent,!1),c in n){var l=n[c]=n[c]||NM(t[c],t);a=l(r,o),n[u]=l}else Number.isFinite(s)?(a=s+(t[c]||0),n[u]=null):a=e;return o&&a>=e&&(e=a+1),t[u]=a,a};return i}var LM=function(t){a(i,t);var n=s(i);function i(e,t){var r;return m(this,i),(r=n.call(this,e,t)).shadowMap=new mx(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),r.depthBuffer=new _x(e,{format:33189,width:1,height:1}),r.fbo=new Ix(e,{id:"shadowmap",width:1,height:1,attachments:{36064:r.shadowMap,36096:r.depthBuffer}}),r}return b(i,[{key:"render",value:function(t){var n=this,r=this.fbo;Tk(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var o=t.viewports[0],a=Ak(n.gl),s=o.width*a,u=o.height*a;(s!==r.width||u!==r.height)&&r.resize({width:s,height:u}),e(p(i.prototype),"render",n).call(n,I(M({},t),{target:r,pass:"shadow"}))})}},{key:"shouldDrawLayer",value:function(e){return!1!==e.props.shadowEnabled}},{key:"getModuleParameters",value:function(){return{drawToShadowMap:!0}}},{key:"delete",value:function(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}]),i}(DM),jM=Object.keys(Uw).map(function(e){return"const int COORDINATE_SYSTEM_".concat(e," = ").concat(Uw[e],";")}).join(""),FM=Object.keys(Hw).map(function(e){return"const int PROJECTION_MODE_".concat(e," = ").concat(Hw[e],";")}).join(""),BM="".concat(jM,"\n").concat(FM,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),VM={},zM={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:BM,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:VM;return e.viewport?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,a=e.coordinateSystem,s=void 0===a?Uw.DEFAULT:a,u=e.coordinateOrigin,c=e.autoWrapLongitude,l=void 0!==c&&c;s===Uw.DEFAULT&&(s=t.isGeospatial?Uw.LNGLAT:Uw.CARTESIAN);var h=vO({viewport:t,devicePixelRatio:i,coordinateSystem:s,coordinateOrigin:u});return h.project_uWrapLongitude=l,h.project_uModelMatrix=o||fO,h}(e):{}}},UM=ZC(function(e){var t=e.viewport,n=e.center;return new EO(t.viewProjectionMatrix).invert().transform(n)}),HM=ZC(function(e){var n,i=e.viewport,r=e.shadowMatrices,o=[],a=i.pixelUnprojectionMatrix,s=i.isGeospatial?void 0:1,u=[[0,0,s],[i.width,0,s],[0,i.height,s],[i.width,i.height,s],[0,0,-1],[i.width,0,-1],[0,i.height,-1],[i.width,i.height,-1]].map(function(e){return function(e,n){var i=t(e,3),r=i[0],o=i[1],a=i[2],s=GO([r,o,a],n);return Number.isFinite(a)?s:[s[0],s[1],0]}(e,a)}),c=_(r);try{var l=function(){var e=n.value,t=e.clone().translate(new fS(i.center).negate()),r=u.map(function(e){return t.transform(e)}),a=(new EO).ortho({left:Math.min.apply(Math,v(r.map(function(e){return e[0]}))),right:Math.max.apply(Math,v(r.map(function(e){return e[0]}))),bottom:Math.min.apply(Math,v(r.map(function(e){return e[1]}))),top:Math.max.apply(Math,v(r.map(function(e){return e[1]}))),near:Math.min.apply(Math,v(r.map(function(e){return-e[2]}))),far:Math.max.apply(Math,v(r.map(function(e){return-e[2]})))});o.push(a.multiplyRight(e))};for(c.s();!(n=c.n()).done;)l()}catch(h){c.e(h)}finally{c.f()}return o}),GM=[0,0,0,1],WM=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],qM={name:"shadow",dependencies:[zM],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){var n=e.shadowEnabled,i=void 0===n||n;return i&&e.shadowMatrices&&e.shadowMatrices.length>0?function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||GM,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=UM({viewport:e.viewport,center:t.project_uCenter}),r=[],o=HM({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice(),a=0;a0?e.shadowMaps[c]:e.dummyShadowMap;return n}(e,t):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},XM={color:[255,255,255],intensity:1},YM=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],KM=[0,0,0,200/255],QM=function(e){a(n,e);var t=s(n);function n(e){var i;for(var r in m(this,n),(i=t.call(this,e)).ambientLight=null,i.directionalLights=[],i.pointLights=[],i.shadowColor=KM,i.shadowPasses=[],i.shadowMaps=[],i.dummyShadowMap=null,i.shadow=!1,i.programManager=null,e){var o=e[r];switch(o.type){case"ambient":i.ambientLight=o;break;case"directional":i.directionalLights.push(o);break;case"point":i.pointLights.push(o)}}return i._applyDefaultLights(),i.shadow=i.directionalLights.some(function(e){return e.shadow}),i}return b(n,[{key:"preRender",value:function(e,t){var n=t.layers,i=t.layerFilter,r=t.viewports,o=t.onViewportActive,a=t.views;if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=dC.getDefaultProgramManager(e),qM&&this.programManager.addDefaultModule(qM)),this.dummyShadowMap||(this.dummyShadowMap=new mx(e,{width:1,height:1}));for(var s=0;s=t.delay+t.duration*t.repeat}},{key:"getTime",value:function(e){if(void 0===e)return this.time;var t=this.channels.get(e);return void 0===t?-1:t.time}},{key:"setTime",value:function(e){this.time=Math.max(0,e);var t,n=_(this.channels.values());try{for(n.s();!(t=n.n()).done;){var i=t.value;this._setChannelTime(i,this.time)}}catch(c){n.e(c)}finally{n.f()}var r,o=_(this.animations.values());try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.animation,u=a.channel;s.setTime(this.getTime(u))}}catch(c){o.e(c)}finally{o.f()}}},{key:"play",value:function(){this.playing=!0}},{key:"pause",value:function(){this.playing=!1,this.lastEngineTime=-1}},{key:"reset",value:function(){this.setTime(0)}},{key:"attachAnimation",value:function(e,t){var n=ZM++;return this.animations.set(n,{animation:e,channel:t}),e.setTime(this.getTime(t)),n}},{key:"detachAnimation",value:function(e){this.animations.delete(e)}},{key:"update",value:function(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}},{key:"_setChannelTime",value:function(e,t){var n=t-e.delay;n>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,n)%e.duration,e.time*=e.rate)}}]),e}(),eI=function(){function e(t,n,i){m(this,e),this.id=t,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(n)}return b(e,[{key:"subscribe",value:function(e){this._subscribers.add(e)}},{key:"unsubscribe",value:function(e){this._subscribers.delete(e)}},{key:"inUse",value:function(){return this._subscribers.size>0}},{key:"delete",value:function(){}},{key:"getData",value:function(){var e=this;return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(function(){return e.getData()})}},{key:"setData",value:function(e,t){var n=this;if(e!==this._data||t){this._data=e;var i=++this._loadCount,r=e;"string"==typeof e&&(r=jP(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(function(e){n._loadCount===i&&(n.isLoaded=!0,n._error=null,n._content=e)}).catch(function(e){n._loadCount===i&&(n.isLoaded=!0,n._error=e||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);var o,a=_(this._subscribers);try{for(a.s();!(o=a.n()).done;){o.value.onChange(this.getData())}}catch(s){a.e(s)}finally{a.f()}}}}]),e}(),tI=function(){function e(t){var n=t.gl,i=t.protocol;m(this,e),this.protocol=i||"resource://",this._context={gl:n,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}return b(e,[{key:"contains",value:function(e){return!!e.startsWith(this.protocol)||e in this._resources}},{key:"add",value:function(e){var t=e.resourceId,n=e.data,i=e.forceUpdate,r=void 0!==i&&i,o=e.persistent,a=void 0===o||o,s=this._resources[t];s?s.setData(n,r):(s=new eI(t,n,this._context),this._resources[t]=s),s.persistent=a}},{key:"remove",value:function(e){var t=this._resources[e];t&&(t.delete(),delete this._resources[e])}},{key:"unsubscribe",value:function(e){var t=e.consumerId,n=this._consumers[t];if(n){for(var i in n){var r=n[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[t],this.prune()}}},{key:"subscribe",value:function(e){var t=e.resourceId,n=e.onChange,i=e.consumerId,r=e.requestId,o=void 0===r?"default":r,a=this._resources,s=this.protocol;t.startsWith(s)&&(a[t=t.replace(s,"")]||this.add({resourceId:t,data:null,persistent:!1}));var u=a[t];if(this._track(i,o,u,n),u)return u.getData()}},{key:"prune",value:function(){var e=this;this._pruneRequest||(this._pruneRequest=setTimeout(function(){return e._prune()},0))}},{key:"finalize",value:function(){for(var e in this._resources)this._resources[e].delete()}},{key:"_track",value:function(e,t,n,i){var r=this._consumers,o=r[e]=r[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),n&&(o[t]=a,a.onChange=i,a.resource=n,n.subscribe(a))}},{key:"_prune",value:function(){this._pruneRequest=null;for(var e=0,t=Object.keys(this._resources);e1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,o=n.viewport,a=n.timeline;m(this,e),this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new tI({gl:t,protocol:"deck://"}),this.context=I(M({},oI),{layerManager:this,gl:t,deck:i,programManager:t&&rI(t),stats:r||new Vk({id:"deck.gl"}),viewport:o||new eT({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:a||new JM,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}return b(e,[{key:"finalize",value:function(){this.resourceManager.finalize();var e,t=_(this.layers);try{for(t.s();!(e=t.n()).done;){var n=e.value;this._finalizeLayer(n)}}catch(i){t.e(i)}finally{t.f()}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n,i=_(this.layers);try{for(i.s();!(n=i.n()).done;){var r=n.value,o=r.getNeedsRedraw(e);t=t||o}}catch(a){i.e(a)}finally{i.f()}return t}},{key:"needsUpdate",value:function(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}},{key:"setNeedsRedraw",value:function(e){this._needsRedraw=this._needsRedraw||e}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e}},{key:"getLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layerIds,n=void 0===t?null:t;return n?this.layers.filter(function(e){return n.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}},{key:"setLayers",value:function(e,t){BS("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e;var n,i=_(e=SS(e,Boolean));try{for(i.s();!(n=i.n()).done;){n.value.context=this.context}}catch(r){i.e(r)}finally{i.f()}return this._updateLayers(this.layers,e),this}},{key:"updateLayers",value:function(){var e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}},{key:"activateViewport",value:function(e){return BS("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}},{key:"_handleError",value:function(e,t,n){n.raiseError(t,"".concat(e," of ").concat(n))}},{key:"_updateLayers",value:function(e,t){var n,i={},r=_(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;i[o.id]?zw.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o}}catch(l){r.e(l)}finally{r.f()}var a=[];this._updateSublayersRecursively(t,i,a),this._finalizeOldLayers(i);for(var s=!1,u=0,c=a;u0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}return b(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){for(var e in this.controllers){var t=this.controllers[e];t&&t.updateTransition()}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i={x:e[0],y:e[1]},r=n.length-1;r>=0;--r){var o=n[r];if(o.containsPixel(i)){var a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}},{key:"_update",value:function(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}},{key:"_setSize",value:function(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=SS(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!KP(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):zw.warn("missing `viewState` or `initialViewState`")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e,t){return new(0,t.type)(M({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:function(t){return e._getViewport(t,{width:t.width,height:t.height})}},t))}},{key:"_updateController",value:function(e,t,n,i){var r=e.controller;return r?(r=I(M(M(M({},t),e.props),r),{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height}),i?i.setProps(r):i=this._createController(e,r),i):null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=!1,o=n.length;o--;){var a=n[o],s=this.getViewState(a),u=a.makeViewport({width:e,height:t,viewState:s}),c=i[a.id];a.controller&&!c&&(r=!0),(r||!a.controller)&&c&&(c.finalize(),c=null),this.controllers[a.id]=this._updateController(a,s,u,c),this._viewports.unshift(u)}for(var l in i)i[l]&&!this.controllers[l]&&i[l].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),uI=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.makeViewport,o=i.width,a=i.height,s=i.latitude,u=i.longitude,c=i.zoom,l=i.bearing,h=void 0===l?0:l,f=i.pitch,d=void 0===f?0:f,p=i.altitude,v=void 0===p?1.5:p,g=i.maxZoom,y=void 0===g?20:g,b=i.minZoom,_=void 0===b?0:b,w=i.maxPitch,k=void 0===w?60:w,x=i.minPitch,S=void 0===x?0:x,E=i.startPanLngLat,C=i.startZoomLngLat,O=i.startRotatePos,T=i.startBearing,A=i.startPitch,P=i.startZoom,M=i.normalize;return m(this,n),bS(Number.isFinite(u)),bS(Number.isFinite(s)),bS(Number.isFinite(c)),(e=t.call(this,{width:o,height:a,latitude:s,longitude:u,zoom:c,bearing:h,pitch:d,altitude:v,maxZoom:y,minZoom:_,maxPitch:k,minPitch:S,normalize:M}))._state={startPanLngLat:E,startZoomLngLat:C,startRotatePos:O,startBearing:T,startPitch:A,startZoom:P},e.makeViewport=r,e}return b(n,[{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._state.startPanLngLat||this._unproject(n);if(!i)return this;var r=this.makeViewport(this._viewportProps).panByPosition(i,t);return this._getUpdatedState(r)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){var t=e.pos;return this._getUpdatedState({startRotatePos:t,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t,n=e.pos,i=e.deltaAngleX,r=void 0===i?0:i,o=e.deltaAngleY,a=void 0===o?0:o,s=this._state,u=s.startRotatePos,c=s.startBearing,l=s.startPitch;return u&&Number.isFinite(c)&&Number.isFinite(l)?(t=n?this._calculateNewPitchAndBearing(I(M({},this._getRotationParams(n,u)),{startBearing:c,startPitch:l})):{bearing:c+r,pitch:l+a},this._getUpdatedState(t)):this}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._state,o=r.startZoom,a=r.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,a=this._unproject(n)||this._unproject(t));var s=this._calculateNewZoom({scale:i,startZoom:o}),u=this.makeViewport(I(M({},this._viewportProps),{zoom:s}));return this._getUpdatedState(M({zoom:s},u.panByPosition(a,t)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(e)}},{key:"zoomOut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(1/e)}},{key:"moveLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([e,0])}},{key:"moveRight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([-e,0])}},{key:"moveUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,e])}},{key:"moveDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,-e])}},{key:"rotateLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}},{key:"rotateRight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}},{key:"rotateUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}},{key:"rotateDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=M({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new this.constructor(M(M(M({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Wx(i,n,t);var r=e.maxPitch,o=e.minPitch,a=e.pitch;e.pitch=Wx(a,o,r);var s=e.normalize;return(void 0===s||s)&&Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,o=e.zoom,a=e.pitch,s=void 0===a?0:a,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=OO(i+180,360)-180),(c<-180||c>180)&&(c=OO(c+180,360)-180);var l=TO(n/512);if(o<=l)o=l,r=0;else{var h=n/2/Math.pow(2,o),f=LO([0,h])[1];if(rd&&(r=d)}}return{width:t,height:n,longitude:i,latitude:r,zoom:o,pitch:s,bearing:c}}(e)),e}},{key:"_unproject",value:function(e){var t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,o=i.minZoom;return Wx(n+Math.log2(t),o,r)}},{key:"_calculateNewPitchAndBearing",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=e.startBearing,r=e.startPitch;n=Wx(n,-1,1);var o=this._viewportProps,a=o.minPitch,s=o.maxPitch,u=r;return n>0?u=r+n*(s-r):n<0&&(u=r-n*(a-r)),{pitch:u,bearing:i+180*t}}},{key:"_getRotationParams",value:function(e,t){var n=e[0]-t[0],i=e[1]-t[1],r=e[1],o=t[1],a=this._viewportProps,s=a.width,u=a.height,c=n/s,l=0;return i>0?Math.abs(u-o)>5&&(l=i/(o-u)*1.2):i<0&&o>5&&(l=1-r/o),{deltaScaleX:c,deltaScaleY:l=Math.min(1,Math.max(-1,l))}}}]),n}(dM),cI=function(t){a(i,t);var n=s(i);function i(e){return m(this,i),e.dragMode=e.dragMode||"pan",n.call(this,uI,e)}return b(i,[{key:"setProps",value:function(t){var n=this.controllerStateProps;e(p(i.prototype),"setProps",this).call(this,t),(!n||n.height!==t.height)&&this.updateViewport(new this.ControllerState(M(M({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}},{key:"linearTransitionProps",get:function(){return["longitude","latitude","zoom","bearing","pitch"]}}]),i}(fM),lI=function(){var e=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,I(M({},e),{type:tT}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:cI})}}]),n}(QP);return e.displayName="MapView",e}(),hI=new QM,fI=function(){function e(){m(this,e),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return b(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length!==this.effects.length||!KP(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e,this._createInternalEffects()}},{key:"cleanup",value:function(){var e,t=_(this.effects);try{for(t.s();!(e=t.n()).done;){e.value.cleanup()}}catch(r){t.e(r)}finally{t.f()}var n,i=_(this._internalEffects);try{for(i.s();!(n=i.n()).done;){n.value.cleanup()}}catch(r){i.e(r)}finally{i.f()}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some(function(e){return e instanceof QM})||this._internalEffects.push(hI)}}]),e}(),dI=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(DM),pI={blendFunc:[1,0,32771,0],blendEquation:32774},vI=function(t){a(i,t);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"render",value:function(t){t.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(t)):(this.useAlpha=!1,e(p(i.prototype),"render",this).call(this,t))}},{key:"_drawPickingBuffer",value:function(t){var n=this,r=t.layers,o=t.layerFilter,a=t.views,s=t.viewports,u=t.onViewportActive,c=t.pickingFBO,l=t.deviceRect,h=l.x,f=l.y,d=l.width,v=l.height,g=t.pass,m=void 0===g?"picking":g,y=t.redrawReason,b=t.pickZ,_=this.gl;return this.pickZ=b,Tk(_,I(M({scissorTest:!0,scissor:[h,f,d,v],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},pI),{blend:!b}),function(){e(p(i.prototype),"render",n).call(n,{target:c,layers:r,layerFilter:o,views:a,viewports:s,onViewportActive:u,pass:m,redrawReason:y})})}},{key:"shouldDrawLayer",value:function(e){return e.props.pickable}},{key:"getModuleParameters",value:function(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}},{key:"getLayerParameters",value:function(e,t){var n=this.pickZ?{blend:!1}:I(M({},pI),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return M(M({},e.props.parameters),n)}}]),i}(DM),gI=function(){function e(t){m(this,e),this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new dI(t),this.pickLayersPass=new vI(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}return b(e,[{key:"setProps",value:function(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}},{key:"renderLayers",value:function(e){var t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Ix.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);var n=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,i=t.render(I(M({},e),{target:n}));this._postRender(e.effects,e),this.renderCount++,BS("deckRenderer.renderLayers",this,i,e)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){var e,t=this.renderBuffers,n=_(t);try{for(n.s();!(e=n.n()).done;){e.value.delete()}}catch(i){n.e(i)}finally{n.f()}t.length=0}},{key:"_preRender",value:function(e,t){var n,i=null,r=_(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;o.preRender(this.gl,t),o.postRender&&(i=o)}}catch(a){r.e(a)}finally{r.f()}i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}},{key:"_resizeRenderBuffers",value:function(){var e=this.renderBuffers;0===e.length&&e.push(new Ix(this.gl),new Ix(this.gl));var t,n=_(e);try{for(n.s();!(t=n.n()).done;){t.value.resize()}}catch(i){n.e(i)}finally{n.f()}}},{key:"_postRender",value:function(e,t){var n,i=this.renderBuffers,r={inputBuffer:i[0],swapBuffer:i[1],target:null},o=_(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.postRender){if(a===this.lastPostProcessEffect){r.target=t.target,a.postRender(this.gl,r);break}var s=a.postRender(this.gl,r);r.inputBuffer=s,r.swapBuffer=s===i[0]?i[1]:i[0]}}}catch(u){o.e(u)}finally{o.f()}}}]),e}(),mI={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function yI(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,o=e.deviceRadius,a=e.deviceRect;if(t){for(var s=a.x,u=a.y,c=a.width,l=a.height,h=o*o,f=-1,d=0,p=0;ph)d+=4*c;else for(var m=0;m=0){var y=m+s-i,b=y*y+g;b<=h&&(h=b,f=d)}d+=4}}if(f>=0){var _=t[f+3]-1,w=t.slice(f,f+4),k=n[_];if(k){var x=k.decodePickingColor(w),S=Math.floor(f/4/c);return{pickedColor:w,pickedLayer:k,pickedObjectIndex:x,pickedX:s+(f/4-S*c),pickedY:u+S}}zw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return mI}function bI(e){var t=e.pickInfo,n=e.mode,i=e.viewports,r=e.layerFilter,o=e.pixelRatio,a=e.x,s=e.y,u=e.z,c=t&&t.pickedLayer,l=function(e,t,n){for(var i=e.length-1;i>=0;i--){var r=e[i];if(r.containsPixel(t)&&(!n||n(r)))return r}return e[0]}(i,{x:a,y:s},r&&c&&function(e){return r({layer:c,viewport:e,isPicking:!0,renderPass:"picking:".concat(n)})}),h=l&&l.unproject([a-l.x,s-l.y],{targetZ:u});return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:a,y:s,pixel:[a,s],coordinate:h,devicePixel:t&&[t.pickedX,t.pickedY],pixelRatio:o}}function _I(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,o=t.pickedColor,a=t.pickedLayer,s=t.pickedObjectIndex,u=a?[a]:[];if("hover"===i){var c=n.index,l=n.layerId,h=a&&a.props.id;if(h!==l||s!==c){if(h!==l){var f=r.find(function(e){return e.props.id===l});f&&u.unshift(f)}n.layerId=h,n.index=s,n.info=null}}var d=bI(e),p=new Map;return p.set(null,d),u.forEach(function(e){var t=M({},d);e===a&&(t.color=o,t.index=s,t.picked=!0),t=wI({layer:e,info:t,mode:i}),e===a&&"hover"===i&&(n.info=t),p.set(t.layer.id,t),"hover"===i&&t.layer.updateAutoHighlight(t)}),p}function wI(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||null;n.sourceLayer=r,n.layer=t,n=t.getPickingInfo({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var kI=function(){function e(t){m(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new vI(t),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return b(e,[{key:"setProps",value:function(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}},{key:"finalize",value:function(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}},{key:"pickObject",value:function(e){return this._pickClosestObject(e)}},{key:"pickObjects",value:function(e){return this._pickVisibleObjects(e)}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,a=o&&o.layer&&o.layer.id,s=o&&o.viewport&&o.viewport.id,u=a?i.find(function(e){return e.id===a}):null,c=s&&r.find(function(e){return e.id===s})||r[0],l=c&&c.unproject([t-c.x,n-c.y]),h={x:t,y:n,viewport:c,coordinate:l,layer:u};return u?M(M({},o),h):Object.assign(h,{color:null,object:null,index:-1})}},{key:"_resizeBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new Ix(e),Ix.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Ix(e),this.depthFBO.attach({36064:new mx(e,{format:Yw(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"_getPickable",value:function(e){if(!1===this._pickable)return null;var t=e.filter(function(e){return e.isPickable()&&!e.isComposite});return t.length>255?(zw.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}},{key:"_pickClosestObject",value:function(e){var t=e.layers,n=e.views,i=e.viewports,r=e.x,o=e.y,a=e.radius,s=void 0===a?0:a,u=e.depth,c=void 0===u?1:u,l=e.mode,h=void 0===l?"query":l,f=e.unproject3D,d=e.onViewportActive;if(!(t=this._getPickable(t)))return{result:[],emptyInfo:bI({viewports:i,x:r,y:o})};this._resizeBuffer();for(var p,v=Ak(this.gl),g=Pk(this.gl,[r,o],!0),m=[g.x+Math.floor(g.width/2),g.y+Math.floor(g.height/2)],y=Math.round(s*v),b=this.pickingFBO,w=b.width,k=b.height,x=this._getPickingRect({deviceX:m[0],deviceY:m[1],deviceRadius:y,deviceWidth:w,deviceHeight:k}),S=[],E={},C=0;C=0){var a=t.slice(r,r+4),s=a.join(",");if(!i.has(s)){var u=n[o];u?i.set(s,{pickedColor:a,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(a)}):zw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this._drawAndSample({layers:t,views:n,viewports:i,onViewportActive:p,deviceRect:{x:m,y:_,width:b.x+b.width-m,height:y-_},pass:"picking:".concat(h),redrawReason:h}),layers:t}),k=new Map,x=Number.isFinite(d),S=0;S=d);S++){var E=w[S],C={color:E.pickedColor,layer:null,index:E.pickedObjectIndex,picked:!0,x:r,y:o,width:s,height:c,pixelRatio:v};C=wI({layer:E.pickedLayer,info:C,mode:h}),k.has(C.object)||k.set(C.object,C)}return Array.from(k.values())}},{key:"_drawAndSample",value:function(e){var t=e.layers,n=e.views,i=e.viewports,r=e.onViewportActive,o=e.deviceRect,a=e.pass,s=e.redrawReason,u=e.pickZ;if(t.length<1)return null;var c=u?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:t,layerFilter:this.layerFilter,views:n,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:o,pass:a,redrawReason:s,pickZ:u});var l=o.x,h=o.y,f=o.width,d=o.height,p=new(u?Float32Array:Uint8Array)(f*d*4);return Ax(c,{sourceX:l,sourceY:h,sourceWidth:f,sourceHeight:d,target:p}),p}},{key:"_getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,o=e.deviceHeight,a=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-a,c=Math.min(o,n+i+1)-s;return u<=0||c<=0?null:{x:a,y:s,width:u,height:c}}}]),e}(),xI={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"},SI=function(){function e(t){m(this,e);var n=t.parentElement;n&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,xI),n.appendChild(this.el)),this.isVisible=!1}return b(e,[{key:"setTooltip",value:function(e,t,n){var i=this.el;if("string"==typeof e)i.innerText=e;else{if(!e)return this.isVisible=!1,void(i.style.display="none");"text"in e&&(i.innerText=e.text),"html"in e&&(i.innerHTML=e.html),"className"in e&&(i.className=e.className),Object.assign(i.style,e.style)}this.isVisible=!0,i.style.display="block",i.style.transform="translate(".concat(t,"px, ").concat(n,"px)")}},{key:"remove",value:function(){this.el&&this.el.remove()}}]),e}();function EI(e,t){if(!e)throw new Error(t)}var CI={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},OI=CI.global||CI.self||CI.window,TI="object"!=typeof process||"[object process]"!==String(process)||process.browser,AI="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),PI=(AI&&parseFloat(AI[1]),OI)._parseImageNode,MI="undefined"!=typeof Image,II="undefined"!=typeof ImageBitmap,RI=Boolean(PI),DI=!!TI||RI;function NI(e){switch(function(e){var t=function(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"==typeof e&&e.data&&e.width&&e.height?"data":null}(e);if(!t)throw new Error("Not an image");return t}(e)){case"data":return e;case"image":case"imagebitmap":var t=document.createElement("canvas"),n=t.getContext("2d");if(!n)throw new Error("getImageData");return t.width=e.width,t.height=e.height,n.drawImage(e,0,0),n.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}var LI=/^data:image\/svg\+xml/,jI=/\.svg((\?|#).*)?$/;function FI(e){return e&&(LI.test(e)||jI.test(e))}function BI(e,t){if(FI(t)){var n=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return"data:image/svg+xml;base64,".concat(btoa(n))}return VI(e,t)}function VI(e,t){if(FI(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function zI(e,t,n){return UI.apply(this,arguments)}function UI(){return(UI=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=BI(t,i),o=self.URL||self.webkitURL,a="string"!=typeof r&&o.createObjectURL(r),e.prev=1,e.next=4,HI(a||r,n);case 4:return e.abrupt("return",e.sent);case 5:return e.prev=5,a&&o.revokeObjectURL(a),e.finish(5);case 8:case"end":return e.stop()}},e,null,[[1,,5,8]])}))).apply(this,arguments)}function HI(e,t){return GI.apply(this,arguments)}function GI(){return(GI=Sx(regeneratorRuntime.mark(function e(t,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=new Image).src=t,!(n.image&&n.image.decode&&i.decode)){e.next=8;break}return e.next=5,i.decode();case 5:e.t0=i,e.next=11;break;case 8:return e.next=10,new Promise(function(e,n){try{i.onload=function(){return e(i)},i.onerror=function(e){return n(new Error("Could not load image ".concat(t,": ").concat(e)))}}catch(r){n(r)}});case 10:e.t0=e.sent;case 11:return e.abrupt("return",e.t0);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}var WI={},qI=!0;function XI(e,t,n){return YI.apply(this,arguments)}function YI(){return(YI=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!FI(i)){e.next=6;break}return e.next=3,zI(t,n,i);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=VI(t,i);case 7:return r=e.t0,o=n&&n.imagebitmap,e.next=11,KI(r,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function KI(e){return QI.apply(this,arguments)}function QI(){return(QI=Sx(regeneratorRuntime.mark(function e(t){var n,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(($I(n=i.length>1&&void 0!==i[1]?i[1]:null)||!qI)&&(n=null),!n){e.next=11;break}return e.prev=2,e.next=5,createImageBitmap(t,n);case 5:return e.abrupt("return",e.sent);case 8:e.prev=8,e.t0=e.catch(2),console.warn(e.t0),qI=!1;case 11:return e.next=13,createImageBitmap(t);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}},e,null,[[2,8]])}))).apply(this,arguments)}function $I(e){for(var t in e||WI)return!1;return!0}var ZI=!1,JI=!0;function eR(e){var t=tR(e);return function(e){var t=tR(e);return t.byteLength>=24&&2303741511===t.getUint32(0,ZI)?{mimeType:"image/png",width:t.getUint32(16,ZI),height:t.getUint32(20,ZI)}:null}(t)||function(e){var t=tR(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,ZI)&&255===t.getUint8(2)))return null;for(var n=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}(),i=n.tableMarkers,r=n.sofMarkers,o=2;o+9=10&&1195984440===t.getUint32(0,ZI)?{mimeType:"image/gif",width:t.getUint16(6,JI),height:t.getUint16(8,JI)}:null}(t)||function(e){var t=tR(e);return t.byteLength>=14&&16973===t.getUint16(0,ZI)&&t.getUint32(2,JI)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,JI),height:t.getUint32(22,JI)}:null}(t)}function tR(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function nR(e,t){var n=(eR(e)||{}).mimeType,i=OI._parseImageNode;return EI(i),i(e,n,t)}function iR(){return(iR=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=((n=n||{}).image||{}).type||"auto",o=(i||{}).url,e.t0=rR(r),e.next="imagebitmap"===e.t0?4:"image"===e.t0?8:"data"===e.t0?12:16;break;case 4:return e.next=6,XI(t,n,o);case 6:return a=e.sent,e.abrupt("break",17);case 8:return e.next=10,zI(t,n,o);case 10:return a=e.sent,e.abrupt("break",17);case 12:return e.next=14,nR(t,n);case 14:return a=e.sent,e.abrupt("break",17);case 16:EI(!1);case 17:return e.abrupt("return",("data"===r&&(a=NI(a)),a));case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function rR(e){switch(e){case"auto":case"data":return function(){if(II)return"imagebitmap";if(MI)return"image";if(DI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return II||MI||DI;case"imagebitmap":return II;case"image":return MI;case"data":return DI;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var oR={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(e,t,n){return iR.apply(this,arguments)},tests:[function(e){return Boolean(eR(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}},aR={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},sR="8.5.8",uR=$w.CO.deck&&$w.CO.deck.VERSION;if(uR&&uR!==sR)throw new Error("deck.gl - multiple versions detected: ".concat(uR," vs ").concat(sR));uR||(zw.log(1,"deck.gl ".concat(sR))(),$w.CO.deck=Object.assign($w.CO.deck||{},{VERSION:sR,version:sR,log:zw,_registerLoggers:function(e){FS=e}}),kP([aR,[oR,{imagebitmap:{premultiplyAlpha:"none"}}]]));var cR=$w.CO.deck,lR=function(e){a(n,e);var t=s(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,n),(i=t.call(this,e,r)).target=null,i._queryPending=!1,i._pollingPromise=null,Object.seal(c(i)),i}return b(n,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.conservative,n=void 0!==t&&t;return this.begin(n?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}},{key:"end",value:function(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl2.getParameter(36795)}},{key:"getResult",value:function(){return this.gl2.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function o(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(o)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return n.isSupported(this.gl)?this.gl2.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl2.deleteQuery(this.handle)}}],[{key:"isSupported",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=Yw(e),r=Nx(e,"TIMER_QUERY"),o=i||r,a=_(n);try{for(a.s();!(t=a.n()).done;){var s=t.value;switch(s){case"queries":o=o&&i;break;case"timers":o=o&&r;break;default:Hk(!1)}}}catch(u){a.e(u)}finally{a.f()}return o}}]),n}(Zk),hR=(0,$w.jU)()&&"undefined"!=typeof document,fR=0,dR=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.onCreateContext,i=void 0===n?function(e){return Lk(e)}:n,r=t.onAddHTML,o=void 0===r?null:r,a=t.onInitialize,s=void 0===a?function(){}:a,u=t.onRender,c=void 0===u?function(){}:u,l=t.onFinalize,h=void 0===l?function(){}:l,f=t.onError,d=t.gl,p=void 0===d?null:d,v=t.glOptions,g=void 0===v?{}:v,y=t.debug,b=void 0!==y&&y,_=t.createFramebuffer,w=void 0!==_&&_,k=t.autoResizeViewport,x=void 0===k||k,S=t.autoResizeDrawingBuffer,E=void 0===S||S,C=t.stats,O=void 0===C?Uk.get("animation-loop-"+fR++):C,T=t.useDevicePixels,A=void 0===T||T;"useDevicePixelRatio"in t&&(Ww.deprecated("useDevicePixelRatio","useDevicePixels")(),A=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:o,onInitialize:s,onRender:c,onFinalize:h,onError:f,gl:p,glOptions:g,debug:b,createFramebuffer:w},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=O,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:x,autoResizeDrawingBuffer:E,useDevicePixels:A}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return b(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Hk("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}},{key:"setProps",value:function(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._running)return this;this._running=!0;var n=this._getPageLoadPromise().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=lR.isSupported(e.gl,["timers"])?new lR(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())});return this.props.onError&&n.catch(this.props.onError),this}},{key:"redraw",value:function(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}},{key:"stop",value:function(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}},{key:"attachTimeline",value:function(e){return this.timeline=e,this.timeline}},{key:"detachTimeline",value:function(){this.timeline=null}},{key:"waitForRender",value:function(){var e=this;return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(function(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=this;return Sx(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.setNeedsRedraw("toDataURL"),t.next=3,e.waitForRender();case 3:return t.abrupt("return",e.gl.canvas.toDataURL());case 4:case"end":return t.stop()}},t)}))()}},{key:"isContextLost",value:function(){return this.gl.isContextLost()}},{key:"onCreateContext",value:function(){var e;return(e=this.props).onCreateContext.apply(e,arguments)}},{key:"onInitialize",value:function(){var e;return(e=this.props).onInitialize.apply(e,arguments)}},{key:"onRender",value:function(){var e;return(e=this.props).onRender.apply(e,arguments)}},{key:"onFinalize",value:function(){var e;return(e=this.props).onFinalize.apply(e,arguments)}},{key:"getHTMLControlValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return Ww.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){!e._running||(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_getPageLoadPromise",value:function(){return this._pageLoadPromise||(this._pageLoadPromise=hR?new Promise(function(e,t){hR&&"complete"===document.readyState?e(document):window.addEventListener("load",function(){e(document)})}):Promise.resolve({})),this._pageLoadPromise}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_cancelAnimationFrame",value:function(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(e){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}(e)}},{key:"_requestAnimationFrame",value:function(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(e){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}},{key:"_initializeCallbackData",value:function(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}},{key:"_updateCallbackData",value:function(){var e=this._getSizeAndAspect(),t=e.width,n=e.height,i=e.aspect;(t!==this.animationProps.width||n!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}},{key:"_finalizeCallbackData",value:function(){this.onFinalize(this.animationProps)}},{key:"_addCallbackData",value:function(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?jk(this.props.gl,e):this.onCreateContext(e),!Xw(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(e){Ok(e,ck)})(this.gl),this._createInfoDiv()}},{key:"_createInfoDiv",value:function(){if(this.gl.canvas&&this.props.onAddHTML){var e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";var t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas)!function(e,t,n){var i="width"in n?n.width:e.canvas.clientWidth,r="height"in n?n.height:e.canvas.clientHeight;(!i||!r)&&(Ww.log(1,"Canvas clientWidth/clientHeight is 0")(),t=1,i=e.canvas.width||1,r=e.canvas.height||1),e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{};var o=e.luma.canvasSizeInfo;if(o.clientWidth!==i||o.clientHeight!==r||o.devicePixelRatio!==t){var a=t,s=Math.floor(i*a),u=Math.floor(r*a);e.canvas.width=s,e.canvas.height=u,(e.drawingBufferWidth!==s||e.drawingBufferHeight!==u)&&(Ww.warn("Device pixel ratio clamped")(),a=Math.min(e.drawingBufferWidth/i,e.drawingBufferHeight/r),e.canvas.width=Math.floor(i*a),e.canvas.height=Math.floor(r*a)),Object.assign(e.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:t})}}(e,function(e){var t="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(e)?e<=0?1:e:e?t:1}(t.useDevicePixels),t);else{var n=e.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in t&&"height"in t&&n.resize(t.width,t.height)}}(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new Ix(this.gl))}},{key:"_resizeFramebuffer",value:function(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}},{key:"_beginTimers",value:function(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}},{key:"_endTimers",value:function(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}},{key:"_startEventHandling",value:function(){var e=this.gl.canvas;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}},{key:"_onMousemove",value:function(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}},{key:"_onMouseleave",value:function(e){this.animationProps._mousePosition=null}}]),e}(),pR=r(11524),vR=r.n(pR),gR={mousedown:1,mousemove:2,mouseup:4};(function(e){var t=e.prototype.handler;e.prototype.handler=function(e){var n=this.store;e.button>0&&"pointerdown"===e.type&&(function(t,n){for(var i=0;i=0&&(this.pressed=!0),2&t&&0===e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}}(vR().MouseInput);var mR=vR().Manager,yR=vR(),bR=yR?[[yR.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[yR.Rotate,{enable:!1}],[yR.Pinch,{enable:!1}],[yR.Swipe,{enable:!1}],[yR.Pan,{threshold:0,enable:!1}],[yR.Press,{enable:!1}],[yR.Tap,{event:"doubletap",taps:2,enable:!1}],[yR.Tap,{event:"anytap",enable:!1}],[yR.Tap,{enable:!1}]]:null,_R={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},wR={doubletap:["tap"]},kR={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},xR=["keydown","keyup"],SR=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],ER=["wheel","mousewheel"],CR={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},OR={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},TR="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",AR="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;var PR=!1;try{var MR={get passive(){return PR=!0,!0}};AR.addEventListener("test",MR,MR),AR.removeEventListener("test",MR,MR)}catch(H){}var IR=-1!==TR.indexOf("firefox"),RR=ER,DR=4.000244140625,NR=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=RR.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!PR&&{passive:!1})})}return b(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;AR.WheelEvent&&(IR&&e.deltaMode===AR.WheelEvent.DOM_DELTA_PIXEL&&(t/=AR.devicePixelRatio),e.deltaMode===AR.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%DR==0&&(t=Math.floor(t/DR)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),LR=SR,jR="pointermove",FR="pointerover",BR="pointerout",VR="pointerleave",zR=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=LR.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return b(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){e===jR&&(this.enableMoveEvent=t),e===FR&&(this.enableOverEvent=t),e===BR&&(this.enableOutEvent=t),e===VR&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:FR,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:BR,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:VR,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:jR,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),UR=xR,HR="keydown",GR=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=UR.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=r.tabIndex||0,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return b(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){e===HR&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:HR,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),WR="contextmenu",qR=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return b(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){e===WR&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){!this.options.enable||this.callback({type:WR,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),XR={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},YR={srcElement:"root",priority:0},KR=function(){function e(t){m(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}return b(e,[{key:"isEmpty",value:function(){return!this._active}},{key:"add",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this.handlers,a=this.handlersByElement;n&&("object"!=typeof n||n.addEventListener)&&(n={srcElement:n}),n=n?Object.assign({},YR,n):YR;var s=a.get(n.srcElement);s||(s=[],a.set(n.srcElement,s));var u={type:e,handler:t,srcElement:n.srcElement,priority:n.priority};i&&(u.once=!0),r&&(u.passive=!0),o.push(u),this._active=this._active||!u.passive;for(var c=s.length-1;c>=0&&!(s[c].priority>=u.priority);)c--;s.splice(c+1,0,u)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var o=n[r];if(o.type===e&&o.handler===t){n.splice(r,1);var a=i.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&i.delete(o.srcElement)}}this._active=n.some(function(e){return!e.passive})}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n){for(var i=!1,r=function(){e.handled=!0},o=function(){e.handled=!0,i=!0},a=[],s=0;s0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.options=Object.assign({},QR,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return b(e,[{key:"setElement",value:function(e){var n=this;if(this.element&&this.destroy(),this.element=e,e){var i=this.options;for(var r in this.manager=new(0,i.Manager)(e,{touchAction:i.touchAction,recognizers:i.recognizers||bR}).on("hammer.input",this._onBasicInput),i.recognizers||Object.keys(_R).forEach(function(e){var t=n.manager.get(e);t&&_R[e].forEach(function(e){t.recognizeWith(e)})}),i.recognizerOptions){var o=this.manager.get(r);if(o){var a=i.recognizerOptions[r];delete a.enable,o.set(a)}}this.wheelInput=new NR(e,this._onOtherEvent,{enable:!1}),this.moveInput=new zR(e,this._onOtherEvent,{enable:!1}),this.keyInput=new GR(e,this._onOtherEvent,{enable:!1,tabIndex:i.tabIndex}),this.contextmenuInput=new qR(e,this._onOtherEvent,{enable:!1});var s,u=_(this.events);try{for(u.s();!(s=u.n()).done;){var c=t(s.value,2),l=c[0],h=c[1];h.isEmpty()||(this._toggleRecognizer(h.recognizerName,!0),this.manager.on(l,h.handleEvent))}}catch(f){u.e(f)}finally{u.f()}}}},{key:"destroy",value:function(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(e,t,n){this._addEventHandler(e,t,n,!1)}},{key:"once",value:function(e,t,n){this._addEventHandler(e,t,n,!0)}},{key:"watch",value:function(e,t,n){this._addEventHandler(e,t,n,!1,!0)}},{key:"off",value:function(e,t){this._removeEventHandler(e,t)}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=wR[e];r&&!this.options.recognizers&&r.forEach(function(r){var o=n.get(r);t?(o.requireFailure(e),i.dropRequireFailure(r)):o.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n,i,r){if("string"==typeof e){var o=this.manager,a=this.events,s=OR[e]||e,u=a.get(s);u||(u=new KR(this),a.set(s,u),u.recognizerName=CR[s]||s,o&&o.on(s,u.handleEvent)),u.add(e,t,n,i,r),u.isEmpty()||this._toggleRecognizer(u.recognizerName,!0)}else for(var c in n=t,e)this._addEventHandler(c,e[c],n,i,r)}},{key:"_removeEventHandler",value:function(e,t){if("string"==typeof e){var n=this.events,i=n.get(OR[e]||e);if(i&&(i.remove(e,t),i.isEmpty())){var r,o=i.recognizerName,a=!1,s=_(n.values());try{for(s.s();!(r=s.n()).done;){var u=r.value;if(u.recognizerName===o&&!u.isEmpty()){a=!0;break}}}catch(l){s.e(l)}finally{s.f()}a||this._toggleRecognizer(o,!1)}}else for(var c in e)this._removeEventHandler(c,e[c])}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=kR[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}();function ZR(){}var JR={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:ZR,onResize:ZR,onViewStateChange:ZR,onInteractionStateChange:ZR,onBeforeRender:ZR,onAfterRender:ZR,onLoad:ZR,onError:function(e,t){return zw.error(e)()},_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},eD=function(){function e(t){m(this,e),t=M(M({},JR),t),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),t.viewState&&t.initialViewState&&zw.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,$w.qs)()&&zw.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new Vk({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&Fx.setProps(t._typedArrayManagerProps),this.animationLoop.start()}return b(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&zw.removed("onLayerHover","onHover")(),"onLayerClick"in e&&zw.removed("onLayerClick","onClick")(),e.initialViewState&&!KP(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);var t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||o}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}},{key:"pickMultipleObjects",value:function(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}},{key:"pickObjects",value:function(e){return this._pick("pickObjects","pickObjects Time",e)}},{key:"_addResources",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in e)this.layerManager.resourceManager.add({resourceId:n,data:e[n],forceUpdate:t})}},{key:"_removeResources",value:function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.layerManager.resourceManager.remove(i)}}catch(r){n.e(r)}finally{n.f()}}},{key:"_pick",value:function(e,t,n){var i=this.stats;i.get("Pick Count").incrementCount(),i.get(t).timeStart();var r=this.deckPicker[e](M({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport},n));return i.get(t).timeEnd(),r}},{key:"_createCanvas",value:function(e){var t=e.canvas;return"string"==typeof t&&bS(t=document.getElementById(t)),t||((t=document.createElement("canvas")).id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,o=e.glOptions,a=e.debug,s=e.onError,u=e.onBeforeRender,c=e.onAfterRender,l=e.useDevicePixels,h=e.autoResizeDrawingBuffer;return new dR({width:n,height:i,useDevicePixels:l,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:function(e){return Lk(I(M(M({},o),e),{canvas:t.canvas,debug:a,onContextLost:function(){return t._onContextLost()}}))},onInitialize:function(e){return t._setGLContext(e.gl)},onRender:this._onRenderFrame.bind(this),onBeforeRender:u,onAfterRender:c,onError:s})}},{key:"_getViewState",value:function(){return this.props.viewState||this.viewState}},{key:"_getViews",value:function(){var e=this.props.views||[new lI({id:"default-view"})];return(e=Array.isArray(e)?e:[e]).length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}},{key:"_onContextLost",value:function(){var e=this.props.onError;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.event){var t=this._pick("pickObject","pickObject Time",e),n=t.result,i=t.emptyInfo;this.interactiveState.isHovering=n.length>0;var r,o=i,a=!1,s=_(n);try{for(s.s();!(r=s.n()).done;){var u=r.value;o=u,a=u.layer.onHover(u,e.event)}}catch(l){s.e(l)}finally{s.f()}if(!a&&this.props.onHover&&this.props.onHover(o,e.event),this.props.getTooltip){var c=this.props.getTooltip(o);this.tooltip.setTooltip(c,o.x,o.y)}e.event=null}}},{key:"_updateCursor",value:function(){var e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_setGLContext",value:function(e){if(!this.layerManager){this.canvas||(this.canvas=e.canvas,jk(e,{enable:!0,copyState:!0})),this.tooltip=new SI(this.canvas),Ok(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);var t=new JM;for(var n in t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new $R(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Gw)this.eventManager.on(n,this._onEvent);this.viewManager=new sI({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});var i=this.viewManager.getViewports()[0];this.layerManager=new aI(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new fI,this.deckRenderer=new gI(e),this.deckPicker=new kI(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Ok(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(M({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),zw.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=I(M({},this.viewState),o({},e.viewId,t)),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}},{key:"_onInteractionStateChange",value:function(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}},{key:"_onEvent",value:function(e){var t=Gw[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),o=r.layer,a=o&&(o[t.handler]||o.props[t.handler]),s=this.props[t.handler],u=!1;a&&(u=a.call(o,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){var e=this.stats;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();var t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var e=this.metrics,t=this.stats;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();var n=Uk.get("Memory Usage");e.bufferMemory=n.get("Buffer Memory").count,e.textureMemory=n.get("Texture Memory").count,e.renderbufferMemory=n.get("Renderbuffer Memory").count,e.gpuMemory=n.get("GPU Memory").count}}]),e}();eD.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(RM)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.oneOfType([e.bool,e.number]),touchAction:e.string,eventRecognizerOptions:e.object,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onInteractionStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,onError:e.func,debug:e.bool,drawPickingColors:e.bool,_framebuffer:e.object,_animate:e.bool,_pickable:e.bool,_typedArrayManagerProps:e.object}},eD.defaultProps=JR,eD.VERSION=cR.VERSION;var tD={name:"project32",dependencies:[zM],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},nD="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",iD={lightSources:{}};function rD(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}var oD={name:"lights",vs:nD,fs:nD,getUniforms:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:iD;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,r=n.pointLights,o=n.directionalLights;return i||r&&r.length>0||o&&o.length>0?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,o=void 0===r?[]:r,a={};return a["lighting_uAmbientLight.color"]=t?rD(t):[0,0,0],i.forEach(function(e,t){a["lighting_uPointLight[".concat(t,"].color")]=rD(e),a["lighting_uPointLight[".concat(t,"].position")]=e.position,a["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation||[1,0,0]}),a.lighting_uPointLightCount=i.length,o.forEach(function(e,t){a["lighting_uDirectionalLight[".concat(t,"].color")]=rD(e),a["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),a.lighting_uDirectionalLightCount=o.length,a}({ambientLight:i,pointLights:r,directionalLights:o}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var a,s={pointLights:[],directionalLights:[]},u=_(t.lights||[]);try{for(u.s();!(a=u.n()).done;){var c=a.value;switch(c.type){case"ambient":s.ambientLight=c;break;case"directional":s.directionalLights.push(c);break;case"point":s.pointLights.push(c)}}}catch(l){u.e(l)}finally{u.f()}return e({lightSources:s})}return{}},defines:{MAX_LIGHTS:3}},aD={},sD={name:"phong-lighting",dependencies:[oD],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:aD;if(!("material"in e))return{};var t=e.material;return t?function(e){var t=e.ambient,n=void 0===t?.35:t,i=e.diffuse,r=void 0===i?.6:i,o=e.shininess,a=void 0===o?32:o,s=e.specularColor;return{lighting_uAmbient:n,lighting_uDiffuse:r,lighting_uShininess:a,lighting_uSpecularColor:(void 0===s?[30,30,30]:s).map(function(e){return e/255})}}(t):{lighting_uEnabled:!1}}},uD={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},cD=M({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uD,t={};if(void 0!==e.pickingSelectedColor)if(e.pickingSelectedColor){var n=e.pickingSelectedColor.slice(0,3);t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}else t.picking_uSelectedColorValid=0;if(e.pickingHighlightColor){var i=Array.from(e.pickingHighlightColor,function(e){return e/255});Number.isFinite(i[3])||(i[3]=1),t.picking_uHighlightColor=i}return void 0!==e.pickingActive&&(t.picking_uActive=Boolean(e.pickingActive),t.picking_uAttribute=Boolean(e.pickingAttribute)),t}}),lD={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},hD=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id,i=void 0===n?Xk("geometry"):n,r=t.drawMode,o=void 0===r?lD.TRIANGLES:r,a=t.attributes,s=void 0===a?{}:a,u=t.indices,c=void 0===u?null:u,l=t.vertexCount,h=void 0===l?null:l;this.id=i,this.drawMode=0|o,this.attributes={},this.userData={},this._setAttributes(s,c),this.vertexCount=h||this._calculateVertexCount(this.attributes,this.indices)}return b(e,[{key:"mode",get:function(){return this.drawMode}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?M({indices:this.indices},this.attributes):this.attributes}},{key:"_print",value:function(e){return"Geometry ".concat(this.id," attribute ").concat(e)}},{key:"_setAttributes",value:function(e,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Hk(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),("POSITION"===n||"positions"===n)&&!i.size&&(i.size=3),"indices"===n?(Hk(!this.indices),this.indices=i):this.attributes[n]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],o=r.value,a=r.size;!r.constant&&o&&a>=1&&(n=Math.min(n,o.length/a))}return Hk(Number.isFinite(n)),n}}],[{key:"DRAW_MODE",get:function(){return lD}}]),e}(),fD=Math.PI/180,dD=new Float32Array(16),pD=new Float32Array(12);function vD(e,t,n){var i=t[0]*fD,r=t[1]*fD,o=t[2]*fD,a=Math.sin(o),s=Math.sin(i),u=Math.sin(r),c=Math.cos(o),l=Math.cos(i),h=Math.cos(r),f=n[0],d=n[1],p=n[2];e[0]=f*h*l,e[1]=f*u*l,e[2]=f*-s,e[3]=d*(-u*c+h*s*a),e[4]=d*(h*c+u*s*a),e[5]=d*l*a,e[6]=p*(u*a+h*s*c),e[7]=p*(-h*a+u*s*c),e[8]=p*l*c}function gD(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var mD={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,o=r.data,a=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),h=l&&16===c.length,f=Array.isArray(s),d=Array.isArray(a),p=Array.isArray(u),v=h||!l&&Boolean(c(o[0]));e.constant=v?h:d&&f&&p;var g=e.value;if(e.constant){var m;v?(dD.set(c),m=gD(dD)):(vD(m=pD,a,s),m.set(u,9)),e.value=new Float32Array(m)}else{var y,b=n*e.size,w=kS(o,n,i),k=w.iterable,x=w.objectInfo,S=_(k);try{for(S.s();!(y=S.n()).done;){var E=y.value,C=void 0;x.index++,v?(dD.set(h?c:c(E,x)),C=gD(dD)):(vD(C=pD,d?a:a(E,x),f?s:s(E,x)),C.set(p?u:u(E,x),9)),g[b++]=C[0],g[b++]=C[1],g[b++]=C[2],g[b++]=C[3],g[b++]=C[4],g[b++]=C[5],g[b++]=C[6],g[b++]=C[7],g[b++]=C[8],g[b++]=C[9],g[b++]=C[10],g[b++]=C[11]}}catch(O){S.e(O)}finally{S.f()}}}};function yD(e,t){return t===Uw.CARTESIAN||t===Uw.METER_OFFSETS||t===Uw.DEFAULT&&!e.isGeospatial}function bD(e,t){(e.COLOR_0||e.colors)&&t||(e.colors={constant:!0,value:new Float32Array([1,1,1])}),zw.assert(e.positions||e.POSITION,'no "postions" or "POSITION" attribute in mesh')}function _D(e,t){if(e.attributes)return bD(e.attributes,t),e instanceof hD?e:new hD(e);if(e.positions||e.POSITION)return bD(e,t),new hD({attributes:e});throw Error("Invalid mesh")}var wD={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},kD=function(){var t=function(t){a(i,t);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"getShaders",value:function(){var t=!Yw(this.context.gl),n={};return Dx(this.context.gl,"GLSL_DERIVATIVES")&&(n.DERIVATIVES_AVAILABLE=1),e(p(i.prototype),"getShaders",this).call(this,{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[tD,sD,cD],transpileToGLSL100:t,defines:n})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:mD}),this.setState({emptyTexture:new mx(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(t){var n=t.props,r=t.oldProps,o=t.changeFlags;if(e(p(i.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:o}),n.mesh!==r.mesh||o.extensionsChanged){var a;if(null===(a=this.state.model)||void 0===a||a.delete(),n.mesh){this.state.model=this.getModel(n.mesh);var s=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(s.NORMAL||s.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==r.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){e(p(i.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.context.viewport,i=this.props,r=i.sizeScale,o=i.coordinateSystem,a=i._instanced;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!a||yD(n,o),flatShading:!this.state.hasNormals}).draw()}}},{key:"getModel",value:function(e){var t=new PC(this.context.gl,I(M({},this.getShaders()),{id:this.props.id,geometry:_D(e,this.props._useMeshColors),isInstanced:!0})),n=this.props.texture,i=this.state.emptyTexture;return t.setUniforms({sampler:n||i,hasTexture:Boolean(n)}),t}},{key:"setTexture",value:function(e){var t=this.state,n=t.emptyTexture,i=t.model;null==i||i.setUniforms({sampler:e||n,hasTexture:Boolean(e)})}}]),i}(GP);return t.layerName="SimpleMeshLayer",t.defaultProps=wD,t}(),xD={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[oD]},SD=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id;this.id=n||Xk(this.constructor.name),this.display=!0,this.position=new fS,this.rotation=new fS,this.scale=new fS(1,1,1),this.matrix=new EO,this.userData={},this.props={},this._setScenegraphNodeProps(t)}return b(e,[{key:"delete",value:function(){}},{key:"setProps",value:function(e){return this._setScenegraphNodeProps(e),this}},{key:"toString",value:function(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")}},{key:"setPosition",value:function(e){return Hk(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return Hk(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return Hk(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,o=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),o&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Hk(e),t=t||this.matrix;var n=new EO(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{key:"_setScenegraphNodeProps",value:function(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}]),e}(),ED=function(t){a(i,t);var n=s(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,i);var r=t=Array.isArray(t)?{children:t}:t,o=r.children,a=void 0===o?[]:o;return Ww.assert(a.every(function(e){return e instanceof SD}),"every child must an instance of ScenegraphNode"),(e=n.call(this,t)).children=a,e}return b(i,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),e(p(i.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.worldMatrix,o=void 0===r?new EO:r,a=new EO(o).multiplyRight(this.matrix),s=_(this.children);try{for(s.s();!(t=s.n()).done;){var u=t.value;u instanceof i?u.traverse(e,{worldMatrix:a}):e(u,{worldMatrix:a})}}catch(c){s.e(c)}finally{s.f()}}}]),i}(SD);function CD(){var e=new nS(4);return nS!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function OD(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function TD(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=i*l+a*s+r*c-o*u,e[1]=r*l+a*u+o*s-i*c,e[2]=o*l+a*c+i*u-r*s,e[3]=a*l-i*s-r*u-o*c,e}var AD=uO,PD=function(){var e=iS(),t=rS(1,0,0),n=rS(0,1,0);return function(i,r,o){var a=oS(r,o);return a<-.999999?(aS(e,t,r),function(e){return Math.hypot(e[0],e[1],e[2])}(e)<1e-6&&aS(e,n,r),function(e,t){var n=t[0],i=t[1],r=t[2],o=n*n+i*i+r*r;o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o}(e,e),OD(i,e,Math.PI),i):a>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(aS(e,r,o),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+a,function(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=n*n+i*i+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=i*a,e[2]=r*a,e[3]=o*a,e}(i,i))}}();CD(),CD(),function(){var e=new nS(9);nS!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1}();var MD=[0,0,0,1],ID={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},RD={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function DD(e){if(!e._animation){var t=RD[e.componentType],n=ID[e.type],i=n*e.count,r=e.bufferView.data,o=new t(r.buffer,r.byteOffset+(e.byteOffset||0),i);if(1===n)e._animation=Array.from(o);else{for(var a=[],s=0;s0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return m(this,i),e=n.call(this,-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?e.copy(t):e.set(t,r,o,a),e}return b(i,[{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"set",value:function(e,t,n,i){return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this.check()}},{key:"fromMatrix3",value:function(e){return function(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,e[0]=(t[5]-t[7])*(n=.5/n),e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var o=(r+1)%3,a=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*o+o]-t[3*a+a]+1),e[r]=.5*n,e[3]=(t[3*o+a]-t[3*a+o])*(n=.5/n),e[o]=(t[3*o+r]+t[3*r+o])*n,e[a]=(t[3*a+r]+t[3*r+a])*n}}(this,e),this.check()}},{key:"identity",value:function(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}},{key:"fromAxisRotation",value:function(e,t){return OD(this,e,t),this.check()}},{key:"setAxisAngle",value:function(e,t){return this.fromAxisRotation(e,t)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=Qx(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=Qx(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=Qx(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=Qx(e)}},{key:"len",value:function(){return function(e){return Math.hypot(e[0],e[1],e[2],e[3])}(this)}},{key:"lengthSquared",value:function(){return function(e){var t=e[0],n=e[1],i=e[2],r=e[3];return t*t+n*n+i*i+r*r}(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}(this,e)}},{key:"rotationTo",value:function(e,t){return PD(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(e,t,n){e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3]}(this,this,e),this.check()}},{key:"calculateW",value:function(){return function(e,t){var n=t[0],i=t[1],r=t[2];e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=n*n+i*i+r*r+o*o,s=a?1/a:0;e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=o*s}(this,this),this.check()}},{key:"lerp",value:function(e,t,n){return function(e,t,n,i){var r=t[0],o=t[1],a=t[2],s=t[3];e[0]=r+i*(n[0]-r),e[1]=o+i*(n[1]-o),e[2]=a+i*(n[2]-a),e[3]=s+i*(n[3]-s)}(this,e,t,n),this.check()}},{key:"multiplyRight",value:function(e,t){return Yx(!t),TD(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e,t){return Yx(!t),TD(this,e,this),this.check()}},{key:"normalize",value:function(){var e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+a*s,e[1]=r*u+o*s,e[2]=o*u-r*s,e[3]=a*u-i*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u-o*s,e[1]=r*u+a*s,e[2]=o*u+i*s,e[3]=a*u-r*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=o*u+a*s,e[3]=a*u-o*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return AD(this,this,e),this.check()}},{key:"slerp",value:function(e,n,i){var r;switch(arguments.length){case 1:var o=arguments[0],a=o.start;e=void 0===a?MD:a,n=o.target,i=o.ratio;break;case 2:n=(r=t(arguments,2))[0],i=r[1],e=this}return function(e,t,n,i){var r,o,a,s,u,c=t[0],l=t[1],h=t[2],f=t[3],d=n[0],p=n[1],v=n[2],g=n[3];(o=c*d+l*p+h*v+f*g)<0&&(o=-o,d=-d,p=-p,v=-v,g=-g),1-o>tS?(r=Math.acos(o),a=Math.sin(r),s=Math.sin((1-i)*r)/a,u=Math.sin(i*r)/a):(s=1-i,u=i),e[0]=s*c+u*d,e[1]=s*l+u*p,e[2]=s*h+u*v,e[3]=s*f+u*g}(this,e,n,i),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return function(e,t,n){var i=t[0],r=t[1],o=t[2],a=n[0],s=n[1],u=n[2],c=n[3],l=c*i+s*o-u*r,h=c*r+u*i-a*o,f=c*o+a*r-s*i,d=-a*i-s*r-u*o;e[0]=l*c+d*-a+h*-u-f*-s,e[1]=h*c+d*-s+f*-a-l*-u,e[2]=f*c+d*-u+l*-s-h*-a,e[3]=t[3]}(t,e,this),$x(t,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(e,t){return this.setAxisAngle(e,t)}},{key:"premultiply",value:function(e,t){return this.multiplyLeft(e,t)}},{key:"multiply",value:function(e,t){return this.multiplyRight(e,t)}}]),i}(Kx)),jD=function(){function e(t){m(this,e),this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}return b(e,[{key:"animate",value:function(e){if(this.playing){var t=(e/1e3-this.startTime)*this.speed;this.channels.forEach(function(e){var n=e.sampler,i=e.target,r=e.path;(function(e,t,n,i){var r=t.input,o=t.interpolation,a=t.output,s=e%r[r.length-1],u=r.findIndex(function(e){return e>=s}),c=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:Ww.warn("Bad animation path ".concat(i))()}Hk(n[i].length===a[c].length);var l=r[c],h=r[u];switch(o){case"STEP":!function(e,t,n){for(var i=0;il&&function(e,t,n,i,r){if("rotation"===t){LD.slerp({start:n,target:i,ratio:r});for(var o=0;ol&&function(e,t,n){for(var i=n.p0,r=n.outTangent0,o=n.inTangent1,a=n.p1,s=n.tDiff,u=n.ratio,c=0;c1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,r)).onBeforeRender=null,t.AfterRender=null,e instanceof PC?(t.model=e,t._setModelNodeProps(r)):t.model=new PC(e,r),t.managedResources=r.managedResources||[],t}return b(i,[{key:"setProps",value:function(t){return e(p(i.prototype),"setProps",this).call(this,t),this._setModelNodeProps(t),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),i}(SD),VD=function(){function e(t,n){var i=n.attributes,r=n.material,o=n.pbrDebug,a=n.imageBasedLightingEnvironment,s=n.lights,u=n.useTangents;m(this,e),this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Dx(t,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],a&&(this.uniforms.u_DiffuseEnvSampler=a.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=a.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=a.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),o&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(i.NORMAL,"HAS_NORMALS"),this.defineIfPresent(i.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(i.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(a,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(o,"PBR_DEBUG"),r&&this.parseMaterial(r)}return b(e,[{key:"defineIfPresent",value:function(e,t){e&&(this.defines[t]=1)}},{key:"parseTexture",value:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.texture.source.image,a={};r.compressed?(n=r,a=o({},this.gl.TEXTURE_MIN_FILTER,r.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):n={data:r};var s=new mx(this.gl,M({id:e.name||e.id,parameters:M(M({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:o({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},n));this.uniforms[t]=s,this.defineIfPresent(i,i),this.generatedTextures.push(s)}},{key:"parsePbrMetallicRoughness",value:function(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var t=e.metallicFactor,n=void 0===t?1:t,i=e.roughnessFactor,r=void 0===i?1:i;this.uniforms.u_MetallicRoughnessValues=[n,r]}},{key:"parseMaterial",value:function(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,n=void 0===t?1:t;this.uniforms.u_NormalScale=n}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,r=void 0===i?1:i;this.uniforms.u_OcclusionStrength=r}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var o=e.alphaCutoff,a=void 0===o?.5:o;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=a}else"BLEND"===e.alphaMode&&(Ww.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}]),e}();function zD(e,t){return Yw(e)?"#version 300 es\n".concat(t):t}var UD={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},HD={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},GD=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.gl=t,this.options=Object.assign({},HD,n)}return b(e,[{key:"instantiate",value:function(e){var t=this;return this.gltf=e,(e.scenes||[]).map(function(e){return t.createScene(e)})}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new FD(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new ED({id:e.name||e.id,children:n})}},{key:"createNode",value:function(e){var t=this;if(!e._node){var n=(e.children||[]).map(function(e){return t.createNode(e)});e.mesh&&n.push(this.createMesh(e.mesh));var i=new ED({id:e.name||e.id,children:n});if(e.matrix)i.setMatrix(e.matrix);else{if(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation){var r=(new EO).fromQuaternion(e.rotation);i.matrix.multiplyRight(r)}e.scale&&i.matrix.scale(e.scale)}e._node=i}return e._node}},{key:"createMesh",value:function(e){var t=this;if(!e._mesh){var n=(e.primitives||[]).map(function(n,i){return t.createPrimitive(n,i,e)}),i=new ED({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){Ww.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,t,n){return function(e,t){var n=t.id,i=t.drawMode,r=t.vertexCount,o=t.attributes,a=t.modelOptions,s=new VD(e,t);Ww.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,v(s.generatedTextures)),u.push.apply(u,v(Object.values(o).map(function(e){return e.buffer})));var c=new BD(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[xD],defines:s.defines,parameters:s.parameters,vs:zD(e,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:zD(e,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:u},a));return c.setProps({attributes:o}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:e.name||"".concat(n.name||n.id,"-primitive-").concat(t),drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}},{key:"createAttributes",value:function(e,t){var n=this,i={};return Object.keys(e).forEach(function(t){i[t]=n.createAccessor(e[t],n.createBuffer(e[t],n.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),Ww.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}},{key:"createBuffer",value:function(e,t){e.bufferView||(e.bufferView={});var n=e.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new cx(this.gl,{id:"from-".concat(n.id),data:n.data||e.value,target:t})),n.lumaBuffers[t]}},{key:"createAccessor",value:function(e,t){return new ox({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:UD[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();function WD(e,t,n){if(e.byteLength<=t+n)return"";for(var i=new DataView(e),r="",o=0;o")}}]),i}(JD,Symbol.toStringTag),hN=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;m(this,e),mA(this,"name",void 0),mA(this,"type",void 0),mA(this,"nullable",void 0),mA(this,"metadata",void 0),this.name=t,this.type=n,this.nullable=i,this.metadata=r}return b(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),e}();function fN(e,t,n){var i=n?dN(n.metadata):void 0,r=function(e){switch(e.constructor){case Int8Array:return new tN;case Uint8Array:return new rN;case Int16Array:return new nN;case Uint16Array:return new oN;case Int32Array:return new iN;case Uint32Array:return new aN;case Float32Array:return new uN;case Float64Array:return new cN;default:throw new Error("array type not supported")}}(t.value);return new hN(e,new lN(t.size,new hN("value",r)),!1,i)}function dN(e){var t=new Map;for(var n in e)t.set("".concat(n,".string"),JSON.stringify(e[n]));return t}var pN={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},vN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},gN=function(){function e(t){m(this,e),mA(this,"draco",void 0),mA(this,"decoder",void 0),mA(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return b(e,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);var i=this.decoder.GetEncodedGeometryType(n),r=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,r);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!r.ptr){var a="DRACO decompression failed: ".concat(o.error_msg());throw new Error(a)}var s=this._getDracoLoaderData(r,i,t),u=this._getMeshData(r,s,t),c=function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length,c=0;cr?l:r,o=h>o?h:o,a=f>a?f:a}return[[t,n,i],[r,o,a]]}(u.attributes),l=function(e,t,n){var i=dN(t.metadata),r=[],o=function(e){var t={};for(var n in e){var i=e[n];t[i.name||"undefined"]=i}return t}(t.attributes);for(var a in e){var s=fN(a,e[a],o[a]);r.push(s)}if(n){var u=fN("indices",n);r.push(u)}return new $D(r,i)}(u.attributes,s,u.indices);return I(M({loader:"draco",loaderData:s,header:{vertexCount:r.num_points(),boundingBox:c}},u),{schema:l})}finally{this.draco.destroy(n),r&&this.draco.destroy(r)}}},{key:"_getDracoLoaderData",value:function(e,t,n){var i=this._getTopLevelMetadata(e),r=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:i,attributes:r}}},{key:"_getDracoAttributes",value:function(e,t){for(var n={},i=0;i1&&void 0!==r[1]?r[1]:null,i=r.length>2&&void 0!==r[2]?r[2]:{},n&&(t=wN(t,n,i)),yN[t]=yN[t]||kN(t),e.next=6,yN[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function wN(e,t,n){if(e.startsWith("http"))return e;var i=n.modules||{};return i[e]?i[e]:RA?n.CDN?(AA(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(t,"@3.0.12/dist/libs/").concat(e)):DA?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function kN(e){return xN.apply(this,arguments)}function xN(){return(xN=Sx(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=8;break}return e.next=3,fetch(t);case 3:return e.next=5,e.sent.arrayBuffer();case 5:e.t0=e.sent,e.next=31;break;case 8:if(!RA){e.next=24;break}if(!DA){e.next=13;break}e.t2=importScripts(t),e.next=21;break;case 13:return e.t3=SN,e.next=16,fetch(t);case 16:return e.next=18,e.sent.text();case 18:e.t4=e.sent,e.t5=t,e.t2=(0,e.t3)(e.t4,e.t5);case 21:e.t1=e.t2,e.next=30;break;case 24:if(e.t6=mN.requireFromFile,!e.t6){e.next=29;break}return e.next=28,mN.requireFromFile(t);case 28:e.t6=e.sent;case 29:e.t1=e.t6;case 30:e.t0=e.t1;case 31:return e.abrupt("return",e.t0);case 32:case"end":return e.stop()}},e)}))).apply(this,arguments)}function SN(e,t){if(!RA)return mN.requireFromString&&mN.requireFromString(e,t);if(DA)return eval.call(IA,e),null;var n=document.createElement("script");n.id=t;try{n.appendChild(document.createTextNode(e))}catch(i){n.text=e}return document.body.appendChild(n),null}var EN,CN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",ON="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",TN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";function AN(e){return PN.apply(this,arguments)}function PN(){return(PN=Sx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.modules||{},EN=n.draco3d?EN||n.draco3d.createDecoderModule({}).then(function(e){return{draco:e}}):EN||MN(t),e.next=4,EN;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function MN(e){return IN.apply(this,arguments)}function IN(){return(IN=Sx(regeneratorRuntime.mark(function e(n){var i,r,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.draco&&n.draco.decoderType,e.next="js"===e.t0?3:(e.t0,7);break;case 3:return e.next=5,bN(CN,"draco",n);case 5:return i=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,bN(ON,"draco",n);case 10:return e.t2=e.sent,e.next=13,bN(TN,"draco",n);case 13:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=17,e.t1.all.call(e.t1,e.t4);case 17:o=e.sent,a=t(o,2),i=a[0],r=a[1];case 21:return i=i||globalThis.DracoDecoderModule,e.next=24,RN(i,r);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}},e)}))).apply(this,arguments)}function RN(e,t){var n={};return t&&(n.wasmBinary=t),new Promise(function(t){e(I(M({},n),{onModuleLoaded:function(e){return t({draco:e})}}))})}var DN=I(M({},QD),{parse:function(e,t){return NN.apply(this,arguments)}});function NN(){return(NN=Sx(regeneratorRuntime.mark(function e(t,n){var i,r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,AN(n);case 2:return i=e.sent,r=i.draco,o=new gN(r),e.prev=5,e.abrupt("return",o.parseSync(t,null==n?void 0:n.draco));case 7:return e.prev=7,o.destroy(),e.finish(7);case 10:case"end":return e.stop()}},e,null,[[5,,7,10]])}))).apply(this,arguments)}function LN(e,t){return UT(e>=0),UT(t>0),e+(t-1)&~(t-1)}function jN(e,t,n){var i;return i=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer||e.arrayBuffer,e.byteOffset,e.byteLength),t.set(i,n),n+LN(i.byteLength,4)}var FN=["SCALAR","VEC2","VEC3","VEC4"],BN=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],VN=new Map(BN),zN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},UN={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},HN={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function GN(e){return FN[e-1]||FN[0]}function WN(e){var t=VN.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function qN(e,t){var n=HN[e.componentType],i=zN[e.type],r=e.count*i,o=e.count*i*UN[e.componentType];return qD(o>=0&&o<=t.byteLength),{ArrayType:n,length:r,byteLength:o}}var XN={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},YN=function(){function e(t){m(this,e),mA(this,"gltf",void 0),mA(this,"sourceBuffers",void 0),mA(this,"byteLength",void 0),this.gltf=t||{json:M({},XN),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}return b(e,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){return this.json[e]}},{key:"getExtraData",value:function(e){return(this.json.extras||{})[e]}},{key:"getExtension",value:function(e){return this.getUsedExtensions().find(function(t){return t===e})?(this.json.extensions||{})[e]||!0:null}},{key:"getRequiredExtension",value:function(e){return this.getRequiredExtensions().find(function(t){return t===e})?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(e,t){return(e.extensions||{})[t]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,t){if("object"==typeof t)return t;var n=this.json[e]&&this.json[e][t];if(!n)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return n}},{key:"getTypedArrayForBufferView",value:function(e){e=this.getBufferView(e);var t=this.gltf.buffers[e.buffer];return qD(t),new Uint8Array(t.arrayBuffer,(e.byteOffset||0)+t.byteOffset,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),n=this.getBuffer(t.buffer).data,i=qN(e,t),r=i.ArrayType,o=i.length;return new r(n,t.byteOffset+e.byteOffset,o)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),n=this.getBuffer(t.buffer).data;return new Uint8Array(n,t.byteOffset||0,t.byteLength)}},{key:"addApplicationData",value:function(e,t){return this.json[e]=t,this}},{key:"addExtraData",value:function(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}},{key:"addObjectExtension",value:function(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}},{key:"setObjectExtension",value:function(e,t,n){(e.extensions||{})[t]=n}},{key:"removeObjectExtension",value:function(e,t){var n=e.extensions||{},i=n[t];return delete n[t],i}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qD(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}},{key:"addRequiredExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qD(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(function(t){return t===e})||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(function(t){return t===e})||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var t=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var t=e.meshIndex,n=e.matrix;this.json.nodes=this.json.nodes||[];var i={mesh:t};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var t=e.attributes,n=e.indices,i=e.material,r=e.mode,o=void 0===r?4:r,a={primitives:[{attributes:this._addAttributes(t),mode:o}]};if(n){var s=this._addIndices(n);a.primitives[0].indices=s}return Number.isFinite(i)&&(a.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}},{key:"addImage",value:function(e,t){var n=eR(e),i=t||(null==n?void 0:n.mimeType),r={bufferView:this.addBufferView(e),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}},{key:"addBufferView",value:function(e){var t=e.byteLength;qD(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var n={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=LN(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,t){var n={bufferView:e,type:GN(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},n=this.addBufferView(e),i={min:t.min,max:t.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(e,t.size));var r={size:t.size,componentType:WN(e),count:Math.round(e.length/t.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,t))}},{key:"addTexture",value:function(e){var t={source:e.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(t),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,t;this.gltf.buffers=[];var n,i=this.byteLength,r=new ArrayBuffer(i),o=new Uint8Array(r),a=0,s=_(this.sourceBuffers||[]);try{for(s.s();!(n=s.n()).done;){a=jN(n.value,o,a)}}catch(u){s.e(u)}finally{s.f()}null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}},{key:"_removeStringFromArray",value:function(e,t){for(var n=!0;n;){var i=e.indexOf(t);i>-1?e.splice(i,1):n=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};for(var n in e){var i=e[n],r=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);t[r]=o}return t}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}},{key:"_getAccessorMinMax",value:function(e,t){var n={min:null,max:null};if(e.length2&&void 0!==arguments[2]&&arguments[2];return e?Array.isArray(e)?new t(e):!n||e instanceof t?e:new t(e):null}(t,Float32Array)),i=t.length/n),{buffer:t,size:n,count:i}}(e),n=t.buffer,i=t.size;return{value:n,size:i,byteOffset:0,count:t.count,type:GN(i),componentType:WN(n)}}function nL(e,t,n){return iL.apply(this,arguments)}function iL(){return(iL=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o,a,s,u,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=n&&null!==(r=n.gltf)&&void 0!==r&&r.decompressMeshes){e.next=2;break}return e.abrupt("return");case 2:o=new YN(t),a=[],s=_(cL(o));try{for(s.s();!(u=s.n()).done;)c=u.value,o.getObjectExtension(c,QN)&&a.push(oL(o,c,n,i))}catch(l){s.e(l)}finally{s.f()}return e.next=7,Promise.all(a);case 7:o.removeExtension(QN);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function rL(e){var t,n=new YN(e),i=_(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var r=t.value;sL(r),n.addRequiredExtension(QN)}}catch(o){i.e(o)}finally{i.f()}}function oL(e,t,n,i){return aL.apply(this,arguments)}function aL(){return(aL=Sx(regeneratorRuntime.mark(function e(n,i,r,o){var a,s,u,c,l,h,f,d,p,v,g,m,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getObjectExtension(i,QN)){e.next=3;break}return e.abrupt("return");case 3:return s=n.getTypedArrayForBufferView(a.bufferView),u=nP(s.buffer,s.byteOffset),c=o.parse,delete(l=M({},r))["3d-tiles"],e.next=7,c(u,DN,l,o);case 7:for(h=e.sent,f=eL(h.attributes),d=0,p=Object.entries(f);d2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var s=r.DracoWriter.encodeSync({attributes:e}),u=null==a||null===(n=a.parseSync)||void 0===n?void 0:n.call(a,{attributes:e}),c=r._addFauxAttributes(u.attributes),l=r.addBufferView(s);return{primitives:[{attributes:c,mode:i,extensions:o({},QN,{bufferView:l,attributes:c})}]}}function uL(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function cL(e){var t,n,i,r,o,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:t=_(e.json.meshes||[]),s.prev=1,t.s();case 3:if((n=t.n()).done){s.next=24;break}i=n.value,r=_(i.primitives),s.prev=6,r.s();case 8:if((o=r.n()).done){s.next=14;break}return a=o.value,s.next=12,a;case 12:s.next=8;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(6),r.e(s.t0);case 19:return s.prev=19,r.f(),s.finish(19);case 22:s.next=3;break;case 24:s.next=29;break;case 26:s.prev=26,s.t1=s.catch(1),t.e(s.t1);case 29:return s.prev=29,t.f(),s.finish(29);case 32:case"end":return s.stop()}},T,null,[[1,26,29,32],[6,16,19,22]])}function lL(e){return hL.apply(this,arguments)}function hL(){return(hL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=new YN(t),i=n.json,n.removeExtension(ZN),r=_(i.materials||[]);try{for(r.s();!(o=r.n()).done;)(a=o.value).extensions&&a.extensions.KHR_materials_unlit&&(a.unlit=!0),n.removeObjectExtension(a,ZN)}catch(s){r.e(s)}finally{r.f()}case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function fL(e){var t=new YN(e),n=t.json;if(t.materials){var i,r=_(n.materials||[]);try{for(r.s();!(i=r.n()).done;){var o=i.value;o.unlit&&(delete o.unlit,t.addObjectExtension(o,ZN,{}),t.addExtension(ZN))}}catch(a){r.e(a)}finally{r.f()}}}function dL(e){return pL.apply(this,arguments)}function pL(){return(pL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=new YN(t),i=n.json,(r=n.getExtension($N))&&(n.json.lights=r.lights,n.removeExtension($N)),o=_(i.nodes||[]);try{for(o.s();!(a=o.n()).done;)s=a.value,(u=n.getObjectExtension(s,$N))&&(s.light=u.light),n.removeObjectExtension(s,$N)}catch(c){o.e(c)}finally{o.f()}case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function vL(e){return gL.apply(this,arguments)}function gL(){return(gL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new YN(t),(i=n.json).lights&&(qD(!(r=n.addExtension($N)).lights),r.lights=i.lights,delete i.lights),n.json.lights){o=_(n.json.lights);try{for(o.s();!(a=o.n()).done;)s=a.value,n.addObjectExtension(s.node,$N,s)}catch(u){o.e(u)}finally{o.f()}delete n.json.lights}case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function mL(e){return yL.apply(this,arguments)}function yL(){return(yL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s,u,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new YN(t),i=n.json,r=n.getExtension(JN)){o=wL(r,n),a=_(i.materials||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,(c=n.getObjectExtension(u,JN))&&(u.technique=Object.assign({},c,o[c.technique]),u.technique.values=kL(u.technique,n)),n.removeObjectExtension(u,JN)}catch(l){a.e(l)}finally{a.f()}n.removeExtension(JN)}case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function bL(e,t){return _L.apply(this,arguments)}function _L(){return(_L=Sx(regeneratorRuntime.mark(function e(t,n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)}))).apply(this,arguments)}function wL(e,t){var n=e.programs,i=void 0===n?[]:n,r=e.shaders,o=void 0===r?[]:r,a=e.techniques,s=void 0===a?[]:a,u=new TextDecoder;return o.forEach(function(e){if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=u.decode(t.getTypedArrayForBufferView(e.bufferView))}),i.forEach(function(e){e.fragmentShader=o[e.fragmentShader],e.vertexShader=o[e.vertexShader]}),s.forEach(function(e){e.program=i[e.program]}),s}function kL(e,t){var n=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(function(t){e.uniforms[t].value&&!(t in n)&&(n[t]=e.uniforms[t].value)}),Object.keys(n).forEach(function(e){"object"==typeof n[e]&&void 0!==n[e].index&&(n[e].texture=t.getTexture(n[e].index))}),n}var xL={KHR_draco_mesh_compression:P,KHR_materials_unlit:R,KHR_lights_punctual:D,KHR_techniques_webgl:N};function SL(e){return EL.apply(this,arguments)}function EL(){return(EL=Sx(regeneratorRuntime.mark(function e(t){var n,i,r,o,a,s=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=s.length>1&&void 0!==s[1]?s[1]:{},i=s.length>2?s[2]:void 0,e.t0=regeneratorRuntime.keys(xL);case 3:if((e.t1=e.t0()).done){e.next=12;break}if(r=e.t1.value,a=(null==n||null===(o=n.gltf)||void 0===o?void 0:o.excludeExtensions)||{},e.t2=r in a&&!a[r],e.t2){e.next=10;break}return e.next=10,xL[r].decode(t,n,i);case 10:e.next=3;break;case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}var CL={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},OL={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},TL=function(){function e(t){m(this,e),this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}return b(e,[{key:"normalize",value:function(e,t){this.json=e.json;var n=e.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(n.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(e){var t,n=new YN(e),i=n.json,r=_(i.images||[]);try{for(r.s();!(t=r.n()).done;){var o=t.value,a=n.removeObjectExtension(o,KN);a&&Object.assign(o,a)}}catch(s){r.e(s)}finally{r.f()}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,n.removeExtension(KN)}(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var t in CL)this._convertTopLevelObjectToArray(e,t)}},{key:"_convertTopLevelObjectToArray",value:function(e,t){var n=e[t];if(n&&!Array.isArray(n))for(var i in e[t]=[],n){var r=n[i];r.id=r.id||i;var o=e[t].length;e[t].push(r),this.idToIndexMap[t][i]=o}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var t in CL)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var n,i=_(e.textures);try{for(i.s();!(n=i.n()).done;){var r=n.value;this._convertTextureIds(r)}}catch(p){i.e(p)}finally{i.f()}var o,a=_(e.meshes);try{for(a.s();!(o=a.n()).done;){var s=o.value;this._convertMeshIds(s)}}catch(p){a.e(p)}finally{a.f()}var u,c=_(e.nodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;this._convertNodeIds(l)}}catch(p){c.e(p)}finally{c.f()}var h,f=_(e.scenes);try{for(f.s();!(h=f.n()).done;){var d=h.value;this._convertSceneIds(d)}}catch(p){f.e(p)}finally{f.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var t,n=_(e.primitives);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.attributes,o=i.indices,a=i.material;for(var s in r)r[s]=this._convertIdToIndex(r[s],"accessor");o&&(i.indices=this._convertIdToIndex(o,"accessor")),a&&(i.material=this._convertIdToIndex(a,"material"))}}catch(u){n.e(u)}finally{n.f()}}},{key:"_convertNodeIds",value:function(e){var t=this;e.children&&(e.children=e.children.map(function(e){return t._convertIdToIndex(e,"node")})),e.meshes&&(e.meshes=e.meshes.map(function(e){return t._convertIdToIndex(e,"mesh")}))}},{key:"_convertSceneIds",value:function(e){var t=this;e.nodes&&(e.nodes=e.nodes.map(function(e){return t._convertIdToIndex(e,"node")}))}},{key:"_convertIdsToIndices",value:function(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);var n,i=_(e[t]);try{for(i.s();!(n=i.n()).done;){var r=n.value;for(var o in r){var a=this._convertIdToIndex(r[o],o);r[o]=a}}}catch(s){i.e(s)}finally{i.f()}}},{key:"_convertIdToIndex",value:function(e,t){var n=OL[t];if(n in this.idToIndexMap){var i=this.idToIndexMap[n][e];if(!Number.isFinite(i))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return i}return e}},{key:"_updateObjects",value:function(e){var t,n=_(this.json.buffers);try{for(n.s();!(t=n.n()).done;){delete t.value.type}}catch(i){n.e(i)}finally{n.f()}}},{key:"_updateMaterial",value:function(e){var t,n=_(e.materials);try{var i=function(){var n=t.value;n.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var i=n.values&&n.values.tex,r=e.textures.findIndex(function(e){return e.id===i});-1!==r&&(n.pbrMetallicRoughness.baseColorTexture={index:r})};for(n.s();!(t=n.n()).done;)i()}catch(r){n.e(r)}finally{n.f()}}}]),e}();function AL(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new TL).normalize(e,t)}var PL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ML={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},IL={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},RL={magFilter:IL.TEXTURE_MAG_FILTER,minFilter:IL.TEXTURE_MIN_FILTER,wrapS:IL.TEXTURE_WRAP_S,wrapT:IL.TEXTURE_WRAP_T},DL=(o(k={},IL.TEXTURE_MAG_FILTER,IL.LINEAR),o(k,IL.TEXTURE_MIN_FILTER,IL.NEAREST_MIPMAP_LINEAR),o(k,IL.TEXTURE_WRAP_S,IL.REPEAT),o(k,IL.TEXTURE_WRAP_,IL.REPEAT),k),NL=function(){function e(){m(this,e)}return b(e,[{key:"postProcess",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.json,i=e.buffers,r=void 0===i?[]:i,o=e.images,a=void 0===o?[]:o,s=e.baseUri,u=void 0===s?"":s;return qD(n),this.baseUri=u,this.json=n,this.buffers=r,this.images=a,this._resolveTree(this.json,t),this.json}},{key:"_resolveTree",value:function(e){var t=this;e.bufferViews&&(e.bufferViews=e.bufferViews.map(function(e,n){return t._resolveBufferView(e,n)})),e.images&&(e.images=e.images.map(function(e,n){return t._resolveImage(e,n)})),e.samplers&&(e.samplers=e.samplers.map(function(e,n){return t._resolveSampler(e,n)})),e.textures&&(e.textures=e.textures.map(function(e,n){return t._resolveTexture(e,n)})),e.accessors&&(e.accessors=e.accessors.map(function(e,n){return t._resolveAccessor(e,n)})),e.materials&&(e.materials=e.materials.map(function(e,n){return t._resolveMaterial(e,n)})),e.meshes&&(e.meshes=e.meshes.map(function(e,n){return t._resolveMesh(e,n)})),e.nodes&&(e.nodes=e.nodes.map(function(e,n){return t._resolveNode(e,n)})),e.skins&&(e.skins=e.skins.map(function(e,n){return t._resolveSkin(e,n)})),e.scenes&&(e.scenes=e.scenes.map(function(e,n){return t._resolveScene(e,n)})),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,t){if("object"==typeof t)return t;var n=this.json[e]&&this.json[e][t];return n||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),n}},{key:"_resolveScene",value:function(e,t){var n=this;return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map(function(e){return n.getNode(e)}),e}},{key:"_resolveNode",value:function(e,t){var n=this;return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map(function(e){return n.getNode(e)})),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce(function(e,t){var i=n.getMesh(t);return e.id=i.id,e.primitives=e.primitives.concat(i.primitives),e},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,t){var n=this;return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map(function(e){var t=(e=M({},e)).attributes;for(var i in e.attributes={},t)e.attributes[i]=n.getAccessor(t[i]);return void 0!==e.indices&&(e.indices=n.getAccessor(e.indices)),void 0!==e.material&&(e.material=n.getMaterial(e.material)),e})),e}},{key:"_resolveMaterial",value:function(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture=M({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=M({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=M({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=M({},e.pbrMetallicRoughness);var n=e.pbrMetallicRoughness;n.baseColorTexture&&(n.baseColorTexture=M({},n.baseColorTexture),n.baseColorTexture.texture=this.getTexture(n.baseColorTexture.index)),n.metallicRoughnessTexture&&(n.metallicRoughnessTexture=M({},n.metallicRoughnessTexture),n.metallicRoughnessTexture.texture=this.getTexture(n.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,t){if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(e){return ML[e]}(e.componentType),e.components=function(e){return PL[e]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var n=e.bufferView.buffer,i=qN(e,e.bufferView),r=i.ArrayType,o=i.byteLength,a=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+n.byteOffset,s=n.arrayBuffer.slice(a,a+o);e.value=new r(s)}return e}},{key:"_resolveTexture",value:function(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):DL,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,t){for(var n in e.id=e.id||"sampler-".concat(t),e.parameters={},e){var i=this._enumSamplerParameter(n);void 0!==i&&(e.parameters[i]=e[n])}return e}},{key:"_enumSamplerParameter",value:function(e){return RL[e]}},{key:"_resolveImage",value:function(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));var n=this.images[t];return n&&(e.image=n),e}},{key:"_resolveBufferView",value:function(e,t){e.id=e.id||"bufferView-".concat(t);var n=e.buffer;e.buffer=this.buffers[n];var i=this.buffers[n].byteOffset||0;return"byteOffset"in e&&(i+=e.byteOffset),e.data=new Uint8Array(this.buffers[n].arrayBuffer,i,e.byteLength),e}},{key:"_resolveCamera",value:function(e,t){return e.id=e.id||"camera-".concat(t),e}}]),e}();function LL(e,t){return(new NL).postProcess(e,t)}var jL=1735152710,FL=!0;function BL(e,t,n,i){var r=new Uint8Array(t.buffer,n,i),o=new TextDecoder("utf8").decode(r);return e.json=JSON.parse(o),LN(i,4)}function VL(e,t,n,i){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:t.buffer}),LN(i,4)}function zL(e,t){return UL.apply(this,arguments)}function UL(){return(UL=Sx(regeneratorRuntime.mark(function e(t,n){var i,r,o,a,s,u,c,l,h,f,d=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=d.length>2&&void 0!==d[2]?d[2]:0,r=d.length>3?d[3]:void 0,o=d.length>4?d[4]:void 0,HL(t,n,i,r),AL(t,{normalize:null==r||null===(a=r.gltf)||void 0===a?void 0:a.normalize}),l=[],e.t0=null!=r&&null!==(s=r.gltf)&&void 0!==s&&s.loadBuffers&&t.json.buffers,!e.t0){e.next=9;break}return e.next=9,GL(t,r,o);case 9:if(null==r||null===(u=r.gltf)||void 0===u||!u.loadImages){e.next=12;break}h=qL(t,r,o),l.push(h);case 12:return f=SL(t,r,o),l.push(f),e.next=16,Promise.all(l);case 16:return e.abrupt("return",null!=r&&null!==(c=r.gltf)&&void 0!==c&&c.postProcess?LL(t,r):t);case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function HL(e,t,n,i){if(i.uri&&(e.baseUri=i.uri),t instanceof ArrayBuffer&&!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new DataView(e),r=n.magic,o=void 0===r?jL:r,a=i.getUint32(t,!1);return a===o||a===jL}(t,n,i)&&(t=(new TextDecoder).decode(t)),"string"==typeof t)e.json=function(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return"string"==typeof e?e.slice(0,t):ArrayBuffer.isView(e)?WD(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?WD(e,0,t):""}(e),'"'))}}(t);else if(t instanceof ArrayBuffer){var r={};n=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=new DataView(t),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}(i,n+0),o=i.getUint32(n+4,FL),a=i.getUint32(n+8,FL);switch(Object.assign(e,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:r,version:o,json:{},binChunks:[]}),n+=12,e.version){case 1:return function(e,t,n){UT(e.header.byteLength>20);var i=t.getUint32(n+0,FL),r=t.getUint32(n+4,FL);return n+=8,UT(0===r),BL(e,t,n,i),(n+=i)+VL(e,t,n,e.header.byteLength)}(e,i,n);case 2:return function(e,t,n,i){return UT(e.header.byteLength>20),function(e,t,n,i){for(;n+8<=e.header.byteLength;){var r=t.getUint32(n+0,FL),o=t.getUint32(n+4,FL);switch(n+=8,o){case 1313821514:BL(e,t,n,r);break;case 5130562:VL(e,t,n,r);break;case 0:i.strict||BL(e,t,n,r);break;case 1:i.strict||VL(e,t,n,r)}n+=LN(r,4)}}(e,t,n,{}),n+e.header.byteLength}(e,i,n);default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}(r,t,n,i.glb),qD("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),e._glb=r,e.json=r.json}else qD(!1,"GLTF: must be ArrayBuffer or string");if(e.buffers=new Array((e.json.buffers||[]).length).fill(null),e._glb&&e._glb.header.hasBinChunk){var o=e._glb.binChunks;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}e.images=new Array((e.json.images||[]).length).fill({})}function GL(e,t,n){return WL.apply(this,arguments)}function WL(){return(WL=Sx(regeneratorRuntime.mark(function e(t,n,i){var r,o,a,s,u,c,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r1&&void 0!==a[1]?a[1]:{},i=a.length>2?a[2]:void 0,(n=M(M({},QL.options),n)).gltf=M(M({},QL.options.gltf),n.gltf),r=n.byteOffset,o=void 0===r?0:r,e.next=6,zL({},t,o,n,i);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ZL(){return(ZL=Sx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach(function(e){e.traverse(function(e){Object.values(e.model.getUniforms()).forEach(function(e){!1===e.loaded&&n.push(e)})})}),e.next=4,JL(function(){return n.some(function(e){return!e.loaded})});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function JL(e){return ej.apply(this,arguments)}function ej(){return(ej=Sx(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise(function(e){return requestAnimationFrame(e)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}var tj=[255,255,255,255],nj={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"==typeof e.scene?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:tj},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[QL]},ij=function(){var t=function(t){a(i,t);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"getShaders",value:function(){var e=[tD,cD];return"pbr"===this.props._lighting&&e.push(xD),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:e}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:tj,transition:!0},instanceModelMatrix:mD})}},{key:"updateState",value:function(t){e(p(i.prototype),"updateState",this).call(this,t);var n=t.props,r=t.oldProps;n.scenegraph!==r.scenegraph?this._updateScenegraph(n):n._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){e(p(i.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t=this,n=this.context.gl,i=null;if(e.scenegraph instanceof SD)i={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,o=function(e,t,n){var i=new GD(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(n,r,this._getModelOptions());i=M({gltf:r},o),function(e){return ZL.apply(this,arguments)}(o).then(function(){return t.setNeedsRedraw()})}else e.scenegraph&&(zw.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),i=e.scenegraph);var a={layer:this,gl:n},s=e.getScene(i,a),u=e.getAnimator(i,a);s instanceof SD?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&zw.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).sort().forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var i=e.id,r=void 0===i?Xk("cube-geometry"):i;return t.call(this,I(M({},e),{id:r,indices:{size:1,value:new Uint16Array(rj)},attributes:M(M({},uj),e.attributes)}))}return n}(hD),lj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0,0,0,0,0,0,0];m(this,e),this.elements=void 0,this.elements=t}return b(e,[{key:"identity",value:function(){var e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}},{key:"setZero",value:function(){var e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}},{key:"setTrace",value:function(e){var t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}},{key:"getTrace",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fj,t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}},{key:"vmult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj,n=this.elements,i=e.x,r=e.y,o=e.z;return t.x=n[0]*i+n[1]*r+n[2]*o,t.y=n[3]*i+n[4]*r+n[5]*o,t.z=n[6]*i+n[7]*r+n[8]*o,t}},{key:"smult",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:new e,i=this.elements,r=t.elements,o=n.elements,a=i[0],s=i[1],u=i[2],c=i[3],l=i[4],h=i[5],f=i[6],d=i[7],p=i[8],v=r[0],g=r[1],m=r[2],y=r[3],b=r[4],_=r[5],w=r[6],k=r[7],x=r[8];return o[0]=a*v+s*y+u*w,o[1]=a*g+s*b+u*k,o[2]=a*m+s*_+u*x,o[3]=c*v+l*y+h*w,o[4]=c*g+l*b+h*k,o[5]=c*m+l*_+h*x,o[6]=f*v+d*y+p*w,o[7]=f*g+d*b+p*k,o[8]=f*m+d*_+p*x,n}},{key:"scale",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e,i=this.elements,r=n.elements,o=0;3!==o;o++)r[3*o+0]=t.x*i[3*o+0],r[3*o+1]=t.y*i[3*o+1],r[3*o+2]=t.z*i[3*o+2];return n}},{key:"solve",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj,r=[];for(t=0;t<12;t++)r.push(0);for(t=0;t<3;t++)for(n=0;n<3;n++)r[t+4*n]=this.elements[t+3*n];r[3]=e.x,r[7]=e.y,r[11]=e.z;var o,a,s=3,u=s;do{if(0===r[(t=u-s)+4*t])for(n=t+1;n0&&void 0!==arguments[0]?arguments[0]:new e,r=hj;for(t=0;t<3;t++)for(n=0;n<3;n++)r[t+6*n]=this.elements[t+3*n];r[3]=1,r[9]=0,r[15]=0,r[4]=0,r[10]=1,r[16]=0,r[5]=0,r[11]=0,r[17]=1;var o,a,s=3,u=s;do{if(0===r[(t=u-s)+6*t])for(n=t+1;n0&&void 0!==arguments[0]?arguments[0]:new e,i=this.elements,r=n.elements;return r[0]=i[0],r[4]=i[4],r[8]=i[8],t=i[1],r[1]=i[3],r[3]=t,t=i[2],r[2]=i[6],r[6]=t,t=i[5],r[5]=i[7],r[7]=t,n}}]),e}(),hj=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],fj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;m(this,e),this.x=void 0,this.y=void 0,this.z=void 0,this.x=t,this.y=n,this.z=i}return b(e,[{key:"cross",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e,i=t.x,r=t.y,o=t.z,a=this.x,s=this.y,u=this.z;return n.x=s*o-u*r,n.y=u*i-a*o,n.z=a*r-s*i,n}},{key:"set",value:function(e,t,n){return this.x=e,this.y=t,this.z=n,this}},{key:"setZero",value:function(){this.x=this.y=this.z=0}},{key:"vadd",value:function(t,n){if(!n)return new e(this.x+t.x,this.y+t.y,this.z+t.z);n.x=t.x+this.x,n.y=t.y+this.y,n.z=t.z+this.z}},{key:"vsub",value:function(t,n){if(!n)return new e(this.x-t.x,this.y-t.y,this.z-t.z);n.x=this.x-t.x,n.y=this.y-t.y,n.z=this.z-t.z}},{key:"crossmat",value:function(){return new lj([0,-this.z,this.y,this.z,0,-this.x,-this.y,this.x,0])}},{key:"normalize",value:function(){var e=this.x,t=this.y,n=this.z,i=Math.sqrt(e*e+t*t+n*n);if(i>0){var r=1/i;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return i}},{key:"unit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new e,n=this.x,i=this.y,r=this.z,o=Math.sqrt(n*n+i*i+r*r);return o>0?(o=1/o,t.x=n*o,t.y=i*o,t.z=r*o):(t.x=1,t.y=0,t.z=0),t}},{key:"length",value:function(){var e=this.x,t=this.y,n=this.z;return Math.sqrt(e*e+t*t+n*n)}},{key:"lengthSquared",value:function(){return this.dot(this)}},{key:"distanceTo",value:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,o=e.y,a=e.z;return Math.sqrt((r-t)*(r-t)+(o-n)*(o-n)+(a-i)*(a-i))}},{key:"distanceSquared",value:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,o=e.y,a=e.z;return(r-t)*(r-t)+(o-n)*(o-n)+(a-i)*(a-i)}},{key:"scale",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e,i=this.y,r=this.z;return n.x=t*this.x,n.y=t*i,n.z=t*r,n}},{key:"vmul",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e;return n.x=t.x*this.x,n.y=t.y*this.y,n.z=t.z*this.z,n}},{key:"addScaledVector",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new e;return i.x=this.x+t*n.x,i.y=this.y+t*n.y,i.z=this.z+t*n.z,i}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"isZero",value:function(){return 0===this.x&&0===this.y&&0===this.z}},{key:"negate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new e;return t.x=-this.x,t.y=-this.y,t.z=-this.z,t}},{key:"tangents",value:function(e,t){var n=this.length();if(n>0){var i=dj,r=1/n;i.set(this.x*r,this.y*r,this.z*r);var o=pj;Math.abs(i.x)<.9?(o.set(1,0,0),i.cross(o,e)):(o.set(0,1,0),i.cross(o,e)),i.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}},{key:"toString",value:function(){return this.x+","+this.y+","+this.z}},{key:"toArray",value:function(){return[this.x,this.y,this.z]}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"lerp",value:function(e,t,n){var i=this.x,r=this.y,o=this.z;n.x=i+(e.x-i)*t,n.y=r+(e.y-r)*t,n.z=o+(e.z-o)*t}},{key:"almostEquals",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-6;return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}},{key:"almostZero",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e-6;return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}},{key:"isAntiparallelTo",value:function(e,t){return this.negate(vj),vj.almostEquals(e,t)}},{key:"clone",value:function(){return new e(this.x,this.y,this.z)}}]),e}();fj.ZERO=void 0,fj.UNIT_X=void 0,fj.UNIT_Y=void 0,fj.UNIT_Z=void 0,fj.ZERO=new fj(0,0,0),fj.UNIT_X=new fj(1,0,0),fj.UNIT_Y=new fj(0,1,0),fj.UNIT_Z=new fj(0,0,1);var dj=new fj,pj=new fj,vj=new fj,gj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new fj,this.upperBound=new fj,t.lowerBound&&this.lowerBound.copy(t.lowerBound),t.upperBound&&this.upperBound.copy(t.upperBound)}return b(e,[{key:"setFromPoints",value:function(e,t,n,i){var r=this.lowerBound,o=this.upperBound,a=n;r.copy(e[0]),a&&a.vmult(r,r),o.copy(r);for(var s=1;so.x&&(o.x=u.x),u.xo.y&&(o.y=u.y),u.yo.z&&(o.z=u.z),u.z=r.x&&t.y<=i.y&&n.y>=r.y&&t.z<=i.z&&n.z>=r.z}},{key:"getCorners",value:function(e,t,n,i,r,o,a,s){var u=this.lowerBound,c=this.upperBound;e.copy(u),t.set(c.x,u.y,u.z),n.set(c.x,c.y,u.z),i.set(u.x,c.y,c.z),r.set(c.x,u.y,c.z),o.set(u.x,c.y,u.z),a.set(u.x,u.y,c.z),s.copy(c)}},{key:"toLocalFrame",value:function(e,t){var n=yj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(var i=0;8!==i;i++){var r=n[i];e.pointToLocal(r,r)}return t.setFromPoints(n)}},{key:"toWorldFrame",value:function(e,t){var n=yj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(var i=0;8!==i;i++){var r=n[i];e.pointToWorld(r,r)}return t.setFromPoints(n)}},{key:"overlapsRay",value:function(e){var t=e.direction,n=e.from,i=1/t.x,r=1/t.y,o=1/t.z,a=(this.lowerBound.x-n.x)*i,s=(this.upperBound.x-n.x)*i,u=(this.lowerBound.y-n.y)*r,c=(this.upperBound.y-n.y)*r,l=(this.lowerBound.z-n.z)*o,h=(this.upperBound.z-n.z)*o,f=Math.max(Math.max(Math.min(a,s),Math.min(u,c)),Math.min(l,h)),d=Math.min(Math.min(Math.max(a,s),Math.max(u,c)),Math.max(l,h));return!(d<0||f>d)}}]),e}(),mj=new fj,yj=[new fj,new fj,new fj,new fj,new fj,new fj,new fj,new fj],bj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;m(this,e),this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=t,this.y=n,this.z=i,this.w=r}return b(e,[{key:"set",value:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}},{key:"toString",value:function(){return this.x+","+this.y+","+this.z+","+this.w}},{key:"toArray",value:function(){return[this.x,this.y,this.z,this.w]}},{key:"setFromAxisAngle",value:function(e,t){var n=Math.sin(.5*t);return this.x=e.x*n,this.y=e.y*n,this.z=e.z*n,this.w=Math.cos(.5*t),this}},{key:"toAxisAngle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fj;this.normalize();var t=2*Math.acos(this.w),n=Math.sqrt(1-this.w*this.w);return n<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/n,e.y=this.y/n,e.z=this.z/n),[e,t]}},{key:"setFromVectors",value:function(e,t){if(e.isAntiparallelTo(t)){var n=_j;e.tangents(n,wj),this.setFromAxisAngle(n,Math.PI)}else{var i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(A(e.length(),2)*A(t.length(),2))+e.dot(t),this.normalize()}return this}},{key:"mult",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e,i=this.x,r=this.y,o=this.z,a=this.w,s=t.x,u=t.y,c=t.z,l=t.w;return n.x=i*l+a*s+r*c-o*u,n.y=r*l+a*u+o*s-i*c,n.z=o*l+a*c+i*u-r*s,n.w=a*l-i*s-r*u-o*c,n}},{key:"inverse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new e,n=this.x,i=this.y,r=this.z,o=this.w;this.conjugate(t);var a=1/(n*n+i*i+r*r+o*o);return t.x*=a,t.y*=a,t.z*=a,t.w*=a,t}},{key:"conjugate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new e;return t.x=-this.x,t.y=-this.y,t.z=-this.z,t.w=this.w,t}},{key:"normalize",value:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}},{key:"normalizeFast",value:function(){var e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}},{key:"vmult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj,n=e.x,i=e.y,r=e.z,o=this.x,a=this.y,s=this.z,u=this.w,c=u*n+a*r-s*i,l=u*i+s*n-o*r,h=u*r+o*i-a*n,f=-o*n-a*i-s*r;return t.x=c*u+f*-o+l*-s-h*-a,t.y=l*u+f*-a+h*-o-c*-s,t.z=h*u+f*-s+c*-a-l*-o,t}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}},{key:"toEuler",value:function(e){var t,n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YZX",o=this.x,a=this.y,s=this.z,u=this.w;switch(r){case"YZX":var c=o*a+s*u;if(c>.499&&(t=2*Math.atan2(o,u),n=Math.PI/2,i=0),c<-.499&&(t=-2*Math.atan2(o,u),n=-Math.PI/2,i=0),void 0===t){var l=o*o,h=s*s;t=Math.atan2(2*a*u-2*o*s,1-a*a*2-2*h),n=Math.asin(2*c),i=Math.atan2(2*o*u-2*a*s,1-2*l-2*h)}break;default:throw new Error("Euler order "+r+" not supported yet.")}e.y=t,e.z=n,e.x=i}},{key:"setFromEuler",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"XYZ",r=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(n/2),s=Math.sin(e/2),u=Math.sin(t/2),c=Math.sin(n/2);return"XYZ"===i?(this.x=s*o*a+r*u*c,this.y=r*u*a-s*o*c,this.z=r*o*c+s*u*a,this.w=r*o*a-s*u*c):"YXZ"===i?(this.x=s*o*a+r*u*c,this.y=r*u*a-s*o*c,this.z=r*o*c-s*u*a,this.w=r*o*a+s*u*c):"ZXY"===i?(this.x=s*o*a-r*u*c,this.y=r*u*a+s*o*c,this.z=r*o*c+s*u*a,this.w=r*o*a-s*u*c):"ZYX"===i?(this.x=s*o*a-r*u*c,this.y=r*u*a+s*o*c,this.z=r*o*c-s*u*a,this.w=r*o*a+s*u*c):"YZX"===i?(this.x=s*o*a+r*u*c,this.y=r*u*a+s*o*c,this.z=r*o*c-s*u*a,this.w=r*o*a-s*u*c):"XZY"===i&&(this.x=s*o*a-r*u*c,this.y=r*u*a-s*o*c,this.z=r*o*c+s*u*a,this.w=r*o*a+s*u*c),this}},{key:"clone",value:function(){return new e(this.x,this.y,this.z,this.w)}},{key:"slerp",value:function(t,n){var i,r,o,a,s,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new e,c=this.x,l=this.y,h=this.z,f=this.w,d=t.x,p=t.y,v=t.z,g=t.w;return(r=c*d+l*p+h*v+f*g)<0&&(r=-r,d=-d,p=-p,v=-v,g=-g),1-r>1e-6?(i=Math.acos(r),o=Math.sin(i),a=Math.sin((1-n)*i)/o,s=Math.sin(n*i)/o):(a=1-n,s=n),u.x=a*c+s*d,u.y=a*l+s*p,u.z=a*h+s*v,u.w=a*f+s*g,u}},{key:"integrate",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new e,o=t.x*i.x,a=t.y*i.y,s=t.z*i.z,u=this.x,c=this.y,l=this.z,h=this.w,f=.5*n;return r.x+=f*(o*h+a*l-s*c),r.y+=f*(a*h+s*u-o*l),r.z+=f*(s*h+o*c-a*u),r.w+=f*(-o*u-a*c-s*l),r}}]),e}(),_j=new fj,wj=new fj,kj={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256},xj=function(){var e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=e.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}return b(e,[{key:"updateBoundingSphereRadius",value:function(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}},{key:"volume",value:function(){throw"volume() not implemented for shape type "+this.type}},{key:"calculateLocalInertia",value:function(e,t){throw"calculateLocalInertia() not implemented for shape type "+this.type}},{key:"calculateWorldAABB",value:function(e,t,n,i){throw"calculateWorldAABB() not implemented for shape type "+this.type}}]),e}();return e.idCounter=0,e.types=kj,e}(),Sj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.position=void 0,this.quaternion=void 0,this.position=new fj,this.quaternion=new bj,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}return b(e,[{key:"pointToLocal",value:function(t,n){return e.pointToLocalFrame(this.position,this.quaternion,t,n)}},{key:"pointToWorld",value:function(t,n){return e.pointToWorldFrame(this.position,this.quaternion,t,n)}},{key:"vectorToWorldFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return this.quaternion.vmult(e,t),t}}],[{key:"pointToLocalFrame",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fj;return n.vsub(e,i),t.conjugate(Ej),Ej.vmult(i,i),i}},{key:"pointToWorldFrame",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fj;return t.vmult(n,i),i.vadd(e,i),i}},{key:"vectorToWorldFrame",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new fj;return e.vmult(t,n),n}},{key:"vectorToLocalFrame",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fj;return t.w*=-1,t.vmult(n,i),t.w*=-1,i}}]),e}(),Ej=new bj,Cj=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var r=i.vertices,o=void 0===r?[]:r,a=i.faces,s=void 0===a?[]:a,u=i.normals,c=void 0===u?[]:u,l=i.axes,h=i.boundingSphereRadius;return(e=t.call(this,{type:xj.types.CONVEXPOLYHEDRON})).vertices=void 0,e.faces=void 0,e.faceNormals=void 0,e.worldVertices=void 0,e.worldVerticesNeedsUpdate=void 0,e.worldFaceNormals=void 0,e.worldFaceNormalsNeedsUpdate=void 0,e.uniqueAxes=void 0,e.uniqueEdges=void 0,e.vertices=o,e.faces=s,e.faceNormals=c,0===e.faceNormals.length&&e.computeNormals(),h?e.boundingSphereRadius=h:e.updateBoundingSphereRadius(),e.worldVertices=[],e.worldVerticesNeedsUpdate=!0,e.worldFaceNormals=[],e.worldFaceNormalsNeedsUpdate=!0,e.uniqueAxes=l?l.slice():null,e.uniqueEdges=[],e.computeEdges(),e}return b(n,[{key:"computeEdges",value:function(){var e=this.faces,t=this.vertices,n=this.uniqueEdges;n.length=0;for(var i=new fj,r=0;r!==e.length;r++)for(var o=e[r],a=o.length,s=0;s!==a;s++){t[o[s]].vsub(t[o[(s+1)%a]],i),i.normalize();for(var u=!1,c=0;c!==n.length;c++)if(n[c].almostEquals(i)||n[c].almostEquals(i)){u=!0;break}u||n.push(i.clone())}}},{key:"computeNormals",value:function(){this.faceNormals.length=this.faces.length;for(var e=0;eh&&(h=d,l=f)}for(var p=[],v=0;v=0&&this.clipFaceAgainstHull(o,e,t,p,a,s,u)}},{key:"findSeparatingAxis",value:function(e,t,n,i,r,o,a,s){var u=new fj,c=new fj,l=new fj,h=new fj,f=new fj,d=new fj,p=Number.MAX_VALUE,v=this;if(v.uniqueAxes)for(var g=0;g!==v.uniqueAxes.length;g++){n.vmult(v.uniqueAxes[g],u);var m=v.testSepAxis(u,e,t,n,i,r);if(!1===m)return!1;m0&&o.negate(o),!0}},{key:"testSepAxis",value:function(e,t,i,r,o,a){n.project(this,e,i,r,Oj),n.project(t,e,o,a,Tj);var s=Oj[0],u=Oj[1],c=Tj[0],l=Tj[1];if(st.x&&(t.x=r.x),r.yt.y&&(t.y=r.y),r.zt.z&&(t.z=r.z)}}},{key:"computeWorldFaceNormals",value:function(e){for(var t=this.faceNormals.length;this.worldFaceNormals.lengthe&&(e=i)}this.boundingSphereRadius=Math.sqrt(e)}},{key:"calculateWorldAABB",value:function(e,t,n,i){for(var r,o,a,s,u,c,l=this.vertices,h=new fj,f=0;fs)&&(s=d.x),(void 0===o||d.yu)&&(u=d.y),(void 0===a||d.zc)&&(c=d.z)}n.set(r,o,a),i.set(s,u,c)}},{key:"volume",value:function(){return 4*Math.PI*this.boundingSphereRadius/3}},{key:"getAveragePointLocal",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fj,t=this.vertices,n=0;n0||c>0&&h<0)return!1}return-1}}],[{key:"computeNormal",value:function(e,t,n,i){var r=new fj,o=new fj;t.vsub(e,o),n.vsub(t,r),r.cross(o,i),i.isZero()||i.normalize()}},{key:"project",value:function(e,t,n,i,r){var o=e.vertices.length,a=Aj,s=0,u=0,c=Pj,l=e.vertices;c.setZero(),Sj.vectorToLocalFrame(n,i,t,a),Sj.pointToLocalFrame(n,i,c,c);var h=c.dot(a);u=s=l[0].dot(a);for(var f=1;fs&&(s=d),d(s-=h)){var p=u;u=s,s=p}r[0]=s,r[1]=u}}]),n}(xj),Oj=[],Tj=[],Aj=new fj,Pj=new fj,Mj=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,{type:xj.types.BOX})).halfExtents=void 0,i.convexPolyhedronRepresentation=void 0,i.halfExtents=e,i.convexPolyhedronRepresentation=null,i.updateConvexPolyhedronRepresentation(),i.updateBoundingSphereRadius(),i}return b(n,[{key:"updateConvexPolyhedronRepresentation",value:function(){var e=this.halfExtents.x,t=this.halfExtents.y,n=this.halfExtents.z,i=fj,r=[new i(-e,-t,-n),new i(e,-t,-n),new i(e,t,-n),new i(-e,t,-n),new i(-e,-t,n),new i(e,-t,n),new i(e,t,n),new i(-e,t,n)],o=[new i(0,0,1),new i(0,1,0),new i(1,0,0)],a=new Cj({vertices:r,faces:[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]],axes:o});this.convexPolyhedronRepresentation=a,a.material=this.material}},{key:"calculateLocalInertia",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return n.calculateInertia(this.halfExtents,e,t),t}},{key:"getSideNormals",value:function(e,t){var n=e,i=this.halfExtents;if(n[0].set(i.x,0,0),n[1].set(0,i.y,0),n[2].set(0,0,i.z),n[3].set(-i.x,0,0),n[4].set(0,-i.y,0),n[5].set(0,0,-i.z),void 0!==t)for(var r=0;r!==n.length;r++)t.vmult(n[r],n[r]);return n}},{key:"volume",value:function(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z}},{key:"updateBoundingSphereRadius",value:function(){this.boundingSphereRadius=this.halfExtents.length()}},{key:"forEachWorldCorner",value:function(e,t,n){for(var i=this.halfExtents,r=[[i.x,i.y,i.z],[-i.x,i.y,i.z],[-i.x,-i.y,i.z],[-i.x,-i.y,-i.z],[i.x,-i.y,-i.z],[i.x,i.y,-i.z],[-i.x,i.y,-i.z],[i.x,-i.y,i.z]],o=0;oi.x&&(i.x=u),c>i.y&&(i.y=c),l>i.z&&(i.z=l),u0&&void 0!==arguments[0]?arguments[0]:{};m(this,n),(e=t.call(this)).id=void 0,e.index=void 0,e.world=void 0,e.preStep=void 0,e.postStep=void 0,e.vlambda=void 0,e.collisionFilterGroup=void 0,e.collisionFilterMask=void 0,e.collisionResponse=void 0,e.position=void 0,e.previousPosition=void 0,e.interpolatedPosition=void 0,e.initPosition=void 0,e.velocity=void 0,e.initVelocity=void 0,e.force=void 0,e.mass=void 0,e.invMass=void 0,e.material=void 0,e.linearDamping=void 0,e.type=void 0,e.allowSleep=void 0,e.sleepState=void 0,e.sleepSpeedLimit=void 0,e.sleepTimeLimit=void 0,e.timeLastSleepy=void 0,e.wakeUpAfterNarrowphase=void 0,e.torque=void 0,e.quaternion=void 0,e.initQuaternion=void 0,e.previousQuaternion=void 0,e.interpolatedQuaternion=void 0,e.angularVelocity=void 0,e.initAngularVelocity=void 0,e.shapes=void 0,e.shapeOffsets=void 0,e.shapeOrientations=void 0,e.inertia=void 0,e.invInertia=void 0,e.invInertiaWorld=void 0,e.invMassSolve=void 0,e.invInertiaSolve=void 0,e.invInertiaWorldSolve=void 0,e.fixedRotation=void 0,e.angularDamping=void 0,e.linearFactor=void 0,e.angularFactor=void 0,e.aabb=void 0,e.aabbNeedsUpdate=void 0,e.boundingRadius=void 0,e.wlambda=void 0,e.isTrigger=void 0,e.id=n.idCounter++,e.index=-1,e.world=null,e.preStep=null,e.postStep=null,e.vlambda=new fj,e.collisionFilterGroup="number"==typeof i.collisionFilterGroup?i.collisionFilterGroup:1,e.collisionFilterMask="number"==typeof i.collisionFilterMask?i.collisionFilterMask:-1,e.collisionResponse="boolean"!=typeof i.collisionResponse||i.collisionResponse,e.position=new fj,e.previousPosition=new fj,e.interpolatedPosition=new fj,e.initPosition=new fj,i.position&&(e.position.copy(i.position),e.previousPosition.copy(i.position),e.interpolatedPosition.copy(i.position),e.initPosition.copy(i.position)),e.velocity=new fj,i.velocity&&e.velocity.copy(i.velocity),e.initVelocity=new fj,e.force=new fj;var r="number"==typeof i.mass?i.mass:0;return e.mass=r,e.invMass=r>0?1/r:0,e.material=i.material||null,e.linearDamping="number"==typeof i.linearDamping?i.linearDamping:.01,e.type=r<=0?n.STATIC:n.DYNAMIC,typeof i.type==typeof n.STATIC&&(e.type=i.type),e.allowSleep=void 0===i.allowSleep||i.allowSleep,e.sleepState=n.AWAKE,e.sleepSpeedLimit=void 0!==i.sleepSpeedLimit?i.sleepSpeedLimit:.1,e.sleepTimeLimit=void 0!==i.sleepTimeLimit?i.sleepTimeLimit:1,e.timeLastSleepy=0,e.wakeUpAfterNarrowphase=!1,e.torque=new fj,e.quaternion=new bj,e.initQuaternion=new bj,e.previousQuaternion=new bj,e.interpolatedQuaternion=new bj,i.quaternion&&(e.quaternion.copy(i.quaternion),e.initQuaternion.copy(i.quaternion),e.previousQuaternion.copy(i.quaternion),e.interpolatedQuaternion.copy(i.quaternion)),e.angularVelocity=new fj,i.angularVelocity&&e.angularVelocity.copy(i.angularVelocity),e.initAngularVelocity=new fj,e.shapes=[],e.shapeOffsets=[],e.shapeOrientations=[],e.inertia=new fj,e.invInertia=new fj,e.invInertiaWorld=new lj,e.invMassSolve=0,e.invInertiaSolve=new fj,e.invInertiaWorldSolve=new lj,e.fixedRotation=void 0!==i.fixedRotation&&i.fixedRotation,e.angularDamping=void 0!==i.angularDamping?i.angularDamping:.01,e.linearFactor=new fj(1,1,1),i.linearFactor&&e.linearFactor.copy(i.linearFactor),e.angularFactor=new fj(1,1,1),i.angularFactor&&e.angularFactor.copy(i.angularFactor),e.aabb=new gj,e.aabbNeedsUpdate=!0,e.boundingRadius=0,e.wlambda=new fj,e.isTrigger=Boolean(i.isTrigger),i.shape&&e.addShape(i.shape),e.updateMassProperties(),e}return b(n,[{key:"wakeUp",value:function(){var e=this.sleepState;this.sleepState=n.AWAKE,this.wakeUpAfterNarrowphase=!1,e===n.SLEEPING&&this.dispatchEvent(n.wakeupEvent)}},{key:"sleep",value:function(){this.sleepState=n.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}},{key:"sleepTick",value:function(e){if(this.allowSleep){var t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=A(this.sleepSpeedLimit,2);t===n.AWAKE&&ir?this.wakeUp():t===n.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(n.sleepEvent))}}},{key:"updateSolveMassProperties",value:function(){this.sleepState===n.SLEEPING||this.type===n.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}},{key:"pointToLocalFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}},{key:"vectorToLocalFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return this.quaternion.conjugate().vmult(e,t),t}},{key:"pointToWorldFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}},{key:"vectorToWorldFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;return this.quaternion.vmult(e,t),t}},{key:"addShape",value:function(e,t,n){var i=new fj,r=new bj;return t&&i.copy(t),n&&r.copy(n),this.shapes.push(e),this.shapeOffsets.push(i),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}},{key:"removeShape",value:function(e){var t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}},{key:"updateBoundingRadius",value:function(){for(var e=this.shapes,t=this.shapeOffsets,n=e.length,i=0,r=0;r!==n;r++){var o=e[r];o.updateBoundingSphereRadius();var a=t[r].length(),s=o.boundingSphereRadius;a+s>i&&(i=a+s)}this.boundingRadius=i}},{key:"updateAABB",value:function(){for(var e=this.shapes,t=this.shapeOffsets,n=this.shapeOrientations,i=e.length,r=Nj,o=Lj,a=this.quaternion,s=this.aabb,u=jj,c=0;c!==i;c++){var l=e[c];a.vmult(t[c],r),r.vadd(this.position,r),a.mult(n[c],o),l.calculateWorldAABB(r,o,u.lowerBound,u.upperBound),0===c?s.copy(u):s.extend(u)}this.aabbNeedsUpdate=!1}},{key:"updateInertiaWorld",value:function(e){var t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){var n=Fj,i=Bj;n.setRotationFromQuaternion(this.quaternion),n.transpose(i),n.scale(t,n),n.mmult(i,this.invInertiaWorld)}}},{key:"applyForce",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;if(this.type===n.DYNAMIC){this.sleepState===n.SLEEPING&&this.wakeUp();var i=Vj;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}}},{key:"applyLocalForce",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;if(this.type===n.DYNAMIC){var i=zj,r=Uj;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}}},{key:"applyTorque",value:function(e){this.type===n.DYNAMIC&&(this.sleepState===n.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}},{key:"applyImpulse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;if(this.type===n.DYNAMIC){this.sleepState===n.SLEEPING&&this.wakeUp();var i=t,r=Hj;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);var o=Gj;i.cross(e,o),this.invInertiaWorld.vmult(o,o),this.angularVelocity.vadd(o,this.angularVelocity)}}},{key:"applyLocalImpulse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;if(this.type===n.DYNAMIC){var i=Wj,r=qj;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}}},{key:"updateMassProperties",value:function(){var e=Xj;this.invMass=this.mass>0?1/this.mass:0;var t=this.inertia,n=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),Mj.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!n?1/t.x:0,t.y>0&&!n?1/t.y:0,t.z>0&&!n?1/t.z:0),this.updateInertiaWorld(!0)}},{key:"getVelocityAtWorldPoint",value:function(e,t){var n=new fj;return e.vsub(this.position,n),this.angularVelocity.cross(n,t),this.velocity.vadd(t,t),t}},{key:"integrate",value:function(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),(this.type===n.DYNAMIC||this.type===n.KINEMATIC)&&this.sleepState!==n.SLEEPING){var r=this.velocity,o=this.angularVelocity,a=this.position,s=this.force,u=this.torque,c=this.quaternion,l=this.invInertiaWorld,h=this.linearFactor,f=this.invMass*e;r.x+=s.x*f*h.x,r.y+=s.y*f*h.y,r.z+=s.z*f*h.z;var d=l.elements,p=this.angularFactor,v=u.x*p.x,g=u.y*p.y,m=u.z*p.z;o.x+=e*(d[0]*v+d[1]*g+d[2]*m),o.y+=e*(d[3]*v+d[4]*g+d[5]*m),o.z+=e*(d[6]*v+d[7]*g+d[8]*m),a.x+=r.x*e,a.y+=r.y*e,a.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}}]),n}(function(){function e(){m(this,e),this._listeners=void 0}return b(e,[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;return void 0===n[e]&&(n[e]=[]),n[e].includes(t)||n[e].push(t),this}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return!(void 0===n[e]||!n[e].includes(t))}},{key:"hasAnyEventListener",value:function(e){return void 0!==this._listeners&&void 0!==this._listeners[e]}},{key:"removeEventListener",value:function(e,t){if(void 0===this._listeners)return this;var n=this._listeners;if(void 0===n[e])return this;var i=n[e].indexOf(t);return-1!==i&&n[e].splice(i,1),this}},{key:"dispatchEvent",value:function(e){if(void 0===this._listeners)return this;var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=0,i=t.length;n0&&void 0!==arguments[0]?arguments[0]:new fj,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fj;m(this,s),this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new fj,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=s.ANY,this.result=new Yj,this.hasHit=!1,this.callback=function(e){}}return b(s,[{key:e,get:function(){return this._intersectSphere}},{key:t,get:function(){return this._intersectPlane}},{key:n,get:function(){return this._intersectBox}},{key:i,get:function(){return this._intersectConvex}},{key:r,get:function(){return this._intersectConvex}},{key:o,get:function(){return this._intersectHeightfield}},{key:a,get:function(){return this._intersectTrimesh}},{key:"intersectWorld",value:function(e,t){return this.mode=t.mode||s.ANY,this.result=t.result||new Yj,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||function(){},this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Qj),$j.length=0,e.broadphase.aabbQuery(e,Qj,$j),this.intersectBodies($j),this.hasHit}},{key:"intersectBody",value:function(e,t){t&&(this.result=t,this.updateDirection());var n=this.checkCollisionResponse;if((!n||e.collisionResponse)&&0!=(this.collisionFilterGroup&e.collisionFilterMask)&&0!=(e.collisionFilterGroup&this.collisionFilterMask))for(var i=eF,r=tF,o=0,a=e.shapes.length;oe.boundingSphereRadius)){var r=this[e.type];r&&r.call(this,e,t,n,i,e)}}},{key:"_intersectBox",value:function(e,t,n,i,r){return this._intersectConvex(e.convexPolyhedronRepresentation,t,n,i,r)}},{key:"_intersectPlane",value:function(e,t,n,i,r){var o=this.from,a=this.to,s=this.direction,u=new fj(0,0,1);t.vmult(u,u);var c=new fj;o.vsub(n,c);var l=c.dot(u);if(a.vsub(n,c),!(l*c.dot(u)>0||o.distanceTo(a)=0&&p<=1&&(o.lerp(a,p,f),f.vsub(n,d),d.normalize(),this.reportIntersection(d,f,r,i,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,f),f.vsub(n,d),d.normalize(),this.reportIntersection(d,f,r,i,-1))}}},{key:"_intersectConvex",value:function(e,t,n,i,r,o){for(var a=fF,u=dF,c=o&&o.faceList||null,l=e.faces,h=e.vertices,f=e.faceNormals,d=this.direction,p=this.from,v=p.distanceTo(this.to),g=c?c.length:l.length,m=this.result,y=0;!m.shouldStop&&yv||this.reportIntersection(a,nF,r,i,b)}}}}}},{key:"_intersectTrimesh",value:function(e,t,n,i,r,o){var a=pF,u=_F,c=wF,l=dF,h=vF,f=gF,d=mF,p=bF,v=yF,g=e.indices,m=this.from,y=this.to,b=this.direction;c.position.copy(n),c.quaternion.copy(t),Sj.vectorToLocalFrame(n,t,b,h),Sj.pointToLocalFrame(n,t,m,f),Sj.pointToLocalFrame(n,t,y,d),d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,f.x*=e.scale.x,f.y*=e.scale.y,f.z*=e.scale.z,d.vsub(f,h),h.normalize();var _=f.distanceSquared(d);e.tree.rayQuery(this,c,u);for(var w=0,k=u.length;!this.result.shouldStop&&w!==k;w++){var x=u[w];e.getNormal(x,a),e.getVertex(g[3*x],iF),iF.vsub(f,l);var S=h.dot(a),E=a.dot(l)/S;if(!(E<0)){h.scale(E,nF),nF.vadd(f,nF),e.getVertex(g[3*x+1],rF),e.getVertex(g[3*x+2],oF);var C=nF.distanceSquared(f);!s.pointInTriangle(nF,rF,iF,oF)&&!s.pointInTriangle(nF,iF,rF,oF)||C>_||(Sj.vectorToWorldFrame(t,a,v),Sj.pointToWorldFrame(n,t,nF,p),this.reportIntersection(v,p,r,i,x))}}u.length=0}},{key:"reportIntersection",value:function(e,t,n,i,r){var o=this.from,a=this.to,u=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==r?r:-1,this.mode){case s.ALL:this.hasHit=!0,c.set(o,a,e,t,n,i,u),c.hasHit=!0,this.callback(c);break;case s.CLOSEST:(u=0&&(o=a*l-s*u)>=0&&r+o0){var o,a=_(e.mesh.primitives);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.attributes.POSITION&&s.attributes.POSITION.min&&function(){var o=r.transformAsPoint(s.attributes.POSITION.min,[]),a=r.transformAsPoint(s.attributes.POSITION.max,[]);i.push({"@id":t["@id"],name:e.name,entityId:t.entityId,bbox:new gj({lowerBound:h(fj,v(o.map(function(e,t){return Math.min(e,a[t])}))),upperBound:h(fj,v(a.map(function(e,t){return Math.max(e,o[t])})))}),gltf:n})}()}}catch(u){a.e(u)}finally{a.f()}}return!0})}catch(s){r.e(s)}finally{r.f()}case 6:case"end":return e.stop()}},e)}),r.s();case 6:if((o=r.n()).done){t.next=10;break}return t.delegateYield(a(),"t0",8);case 8:t.next=6;break;case 10:t.next=15;break;case 12:t.prev=12,t.t1=t.catch(3),r.e(t.t1);case 15:return t.prev=15,r.f(),t.finish(15);case 18:s=[],u=[],c=_(n);try{for(c.s();!(l=c.n()).done;){f=l.value,d=[],p=_(i);try{for(p.s();!(g=p.n()).done;)m=g.value,f.bbox.overlaps(m.bbox)&&d.push({"@id":m["@id"],name:m.name})}catch(C){p.e(C)}finally{p.f()}d.length>0?s.push({"@id":f.entityId,name:f.name,hits:d}):u.push(f)}}catch(C){c.e(C)}finally{c.f()}for(console.log({sourceBoxes:n,targetBoxes:i,report:s,sad:u,maxHits:Math.max.apply(Math,v(s.map(function(e){return e.hits.length})))}),y=[],b=0,w=s;b1&&void 0!==arguments[1]?arguments[1]:[],i=_(e.nodes||e.children||[]);try{for(i.s();!(t=i.n()).done;){var r=t.value;n.push(r.name),NF(r,n)}}catch(o){i.e(o)}finally{i.f()}return n}var LF=function(){var e=function(){function e(t){var n,i,r,o,a,s=this;m(this,e),this.deckProps=t,this.bodyUILayer=new DF({}),this.nodeClickSubject=new oe,this.nodeHoverStartSubject=new oe,this.nodeHoverStopSubject=new oe,this.sceneRotationSubject=new nv([0,0]),this.nodeDragStartSubject=new oe,this.nodeDragSubject=new oe,this.nodeDragEndSubject=new oe,this.nodeClick$=this.nodeClickSubject.pipe(Le()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Le()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Le()),this.sceneRotation$=this.sceneRotationSubject.pipe(Le()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Le()),this.nodeDrag$=this.nodeDragSubject.pipe(Le()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Le());var u=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new wM({flipY:!1,near:-1e3}):new EM({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:function(e){var t;return null!==(t=s.cursor)&&void 0!==t?t:e.isDragging?"grabbing":"grab"}});t.legacyLighting&&(u.effects=[new QM({ambientLight:new TM({color:[255,255,255],intensity:10})})]),this.deck=new eD(u),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(n=t.minRotationX)&&void 0!==n?n:-15,maxRotationX:null!==(i=t.maxRotationX)&&void 0!==i?i:15,target:null!==(r=t.target)&&void 0!==r?r:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}return b(e,[{key:"initialize",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.bodyUILayer.state){e.next=5;break}return e.next=3,new Promise(function(e){setTimeout(e,200)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e,this)}))}},{key:"finalize",value:function(){this.deck.finalize()}},{key:"setScene",value:function(e){if((null==e?void 0:e.length)>0){var t,n=this.bodyUILayer.state.zoomOpacity,i=!1,r=_(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;o.zoomToOnLoad&&(this.zoomTo(o),i=!0)}}catch(a){r.e(a)}finally{r.f()}n=i?.05:n,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(e,n):this.bodyUILayer.setState({data:e,zoomOpacity:n})}}},{key:"debugSceneNodeProcessing",value:function(e,t){var n=this,i="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",r=new EO([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(e,t,n){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,r,o,a,s,u,c,l,f,d,p,g,m,y,b,w,k,x,S,E;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return AF(),n.next=3,MF({scenegraph:e,scenegraphNode:"VHF_Kidney_L_Low1"});case 3:i=n.sent,r={},o=[],a=_(i.scenes);try{for(a.s();!(s=a.n()).done;)TF(s.value,t=new EO(t||EO.IDENTITY),function(n,i){var a={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new EO(i),wireframe:!0,node:n};if(o.push({"@id":"GLTF:".concat(a["@id"]),"@type":"GLTFNode",scenegraph:e,scenegraphNode:a["@id"],transformMatrix:new EO(t||EO.IDENTITY),tooltip:n.name||n.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:n}),n.mesh&&n.mesh.primitives&&n.mesh.primitives.length>0){var s,u=_(n.mesh.primitives);try{for(u.s();!(s=u.n()).done;){var c=s.value;c.attributes.POSITION&&c.attributes.POSITION.min&&function(){var e=i.transformAsPoint(c.attributes.POSITION.min,[]),t=i.transformAsPoint(c.attributes.POSITION.max,[]);a.bbox=new gj({lowerBound:h(fj,v(e.map(function(e,n){return Math.min(e,t[n])}))),upperBound:h(fj,v(t.map(function(t,n){return Math.max(t,e[n])})))})}()}}catch(l){u.e(l)}finally{u.f()}}return r[a["@id"]]=a,!0})}catch(C){a.e(C)}finally{a.f()}u=_(Object.values(r).filter(function(e){return!e.bbox}));try{for(u.s();!(c=u.n()).done;){l=c.value,f=_(NF(l.node).map(function(e){return r[e]}).filter(function(e){return e.bbox}));try{for(f.s();!(d=f.n()).done;)p=d.value,l.bbox?l.bbox.extend(p.bbox):l.bbox=p.bbox.clone()}catch(C){f.e(C)}finally{f.f()}l.bbox||delete r[l["@id"]]}}catch(C){u.e(C)}finally{u.f()}for(g=0,m=Object.values(r);g1&&void 0!==arguments[1]?arguments[1]:jF,n=null,i=null;function r(){return FF(t,n,arguments)||(i=e.apply(null,arguments)),n=arguments,i}return r.reset=function(){n=null,i=null},r}var VF=BF(function(){var e=nh();if(!e)return!1;var t=e.injector.get(jl,null);return!!t&&t.some(function(e){return(e&&e.providers||[]).some(function(e){return e&&e.provide&&"MockNgModuleResolver"===e.provide.name||!1})})}),zF=function(){var e=function(){function e(){m(this,e),this.bootstrap$=new Ed(1)}return b(e,[{key:"appBootstrapped$",get:function(){return this.bootstrap$.asObservable()}},{key:"bootstrap",value:function(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),UF=new Mi("INITIAL_STATE_TOKEN"),HF=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"set",value:function(e){this.value=e}},{key:"pop",value:function(){var e=this.value;return this.value={},e}}]),e}();return e.value={},e}(),GF=new Mi("Internals.StateContextFactory"),WF=new Mi("Internals.StateFactory");function qF(e,t){return t?function(n){return n.pipe(qF(function(n,i){return me(e(n,i)).pipe(ue(function(e,r){return t(n,e,i,r)}))}))}:function(t){return t.lift(new XF(e))}}var XF=function(){function e(t){m(this,e),this.project=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new YF(e,this.project))}}]),e}(),YF=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).project=i,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return b(n,[{key:"_next",value:function(e){this.hasSubscription||this.tryNext(e)}},{key:"tryNext",value:function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(i){return void this.destination.error(i)}this.hasSubscription=!0,this._innerSub(t)}},{key:"_innerSub",value:function(e){var t=new ye(this),n=this.destination;n.add(t);var i=_e(e,t);i!==t&&n.add(i)}},{key:"_complete",value:function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}},{key:"notifyNext",value:function(e){this.destination.next(e)}},{key:"notifyError",value:function(e){this.destination.error(e)}},{key:"notifyComplete",value:function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}]),n}(be);function KF(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t.lift(new QF(e))}}var QF=function(){function e(t){m(this,e),this.defaultValue=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new $F(e,this.defaultValue))}}]),e}(),$F=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).defaultValue=i,r.isEmpty=!0,r}return b(n,[{key:"_next",value:function(e){this.isEmpty=!1,this.destination.next(e)}},{key:"_complete",value:function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}]),n}(Y),ZF=function(e){return"".concat(e," is not a valid state name. It needs to be a valid object property name.")},JF=function(){return"States must register a 'name' property"},eB=function(e,t,n){return"State name '".concat(e,"' from ").concat(t," already exists in ").concat(n)},tB=function(){return"States must be decorated with @State() decorator"},nB=function(){return"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},iB=function(){return"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},rB=function(){return"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })"},oB=function(){return"Patching arrays is not supported."},aB=function(){return"Patching primitives is not supported."},sB=function(e){return"'".concat(e,"' class should be decorated with @Injectable() right after the @State() decorator")},uB=function(){var e=function(){function e(t,n){m(this,e),this._ngZone=t,this._platformId=n,this.verifyZoneIsNotNooped(this._ngZone)}return b(e,[{key:"enter",value:function(e){return function(e){return"server"===e}(this._platformId)?this.runInsideAngular(e):this.runOutsideAngular(e)}},{key:"leave",value:function(e){return this.runInsideAngular(e)}},{key:"runInsideAngular",value:function(e){return Vl.isInAngularZone()?e():this._ngZone.run(e)}},{key:"runOutsideAngular",value:function(e){return Vl.isInAngularZone()?this._ngZone.runOutsideAngular(e):e()}},{key:"verifyZoneIsNotNooped",value:function(e){e instanceof Vl||console.warn(rB())}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Vl),Qi(Sl))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),cB=new Mi("ROOT_STATE_TOKEN"),lB=new Mi("FEATURE_STATE_TOKEN"),hB=new Mi("NGXS_PLUGINS"),fB=new Mi("NG_TEST_MODE"),dB=new Mi("NG_DEV_MODE"),pB="NGXS_META",vB="NGXS_OPTIONS_META",gB=function(){var e=function e(){m(this,e),this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=uB};return e.\u0275prov=Ke({token:e,factory:e.\u0275fac=function(t){return new(t||e)}}),e}(),mB=function e(t,n,i){m(this,e),this.previousValue=t,this.currentValue=n,this.firstChange=i},yB=new Mi("NGXS_EXECUTION_STRATEGY");function bB(e){return e.constructor&&e.constructor.type?e.constructor.type:e.type}var _B=function(e,t,n){e=Object.assign({},e);var i=t.split("."),r=i.length-1;return i.reduce(function(e,t,i){return e[t]=i===r?n:Array.isArray(e[t])?e[t].slice():Object.assign({},e[t]),e&&e[t]},e),e},wB=function(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)},kB=function(e){return e&&"object"==typeof e&&!Array.isArray(e)},xB=function e(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:OB,i=function(e){return e.reduce(function(e,t){return e[bB(t)]=!0,e},{})}(e),r=t&&function(e){return e.reduce(function(e,t){return e[t]=!0,e},{})}(t);return function(e){return e.pipe(function(e,t){return od(function(n){var i=bB(n.action);return e[i]&&(!t||t[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function OB(){return ue(function(e){return e.action})}function TB(e){return function(t){return new ee(function(n){return t.subscribe({next:function(t){e.leave(function(){return n.next(t)})},error:function(t){e.leave(function(){return n.error(t)})},complete:function(){e.leave(function(){return n.complete()})}})})}}var AB=function(){var e=function(){function e(t){m(this,e),this._executionStrategy=t}return b(e,[{key:"enter",value:function(e){return this._executionStrategy.enter(e)}},{key:"leave",value:function(e){return this._executionStrategy.leave(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(yB))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),PB=function(t){a(i,t);var n=s(i);function i(){var e;return m(this,i),(e=n.apply(this,arguments))._itemQueue=[],e._busyPushingNext=!1,e}return b(i,[{key:"next",value:function(t){if(this._busyPushingNext)this._itemQueue.unshift(t);else{for(this._busyPushingNext=!0,e(p(i.prototype),"next",this).call(this,t);this._itemQueue.length>0;){var n=this._itemQueue.pop();e(p(i.prototype),"next",this).call(this,n)}this._busyPushingNext=!1}}}]),i}(oe),MB=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(PB);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275prov=Ke({token:t,factory:t.\u0275fac}),t}(),IB=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this,function(t){var n=e.pipe(TB(i)).subscribe({next:function(e){return t.next(e)},error:function(e){return t.error(e)},complete:function(){return t.complete()}});t.add(n)})}return n}(ee);return e.\u0275fac=function(t){return new(t||e)(Qi(MB),Qi(AB))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),RB=function e(t){return function(){for(var n=arguments.length,i=new Array(n),r=0;r1&&void 0!==arguments[1]?arguments[1]:[];Array.isArray(o)||(o=[]),o.push(r),n[r]=!0,e[r].forEach(function(e){if(o.indexOf(e)>=0)throw new Error("Circular dependency '".concat(e,"' is required by '").concat(r,"': ").concat(o.join(" -> ")));n[e]||i(e,o.slice(0))}),t.indexOf(r)<0&&t.push(r)};return Object.keys(e).forEach(function(e){return i(e)}),t.reverse()}(r),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function e(t,n){for(var i in t)if(t.hasOwnProperty(i)&&t[i].indexOf(n)>=0){var r=e(t,i);return null!==r?"".concat(r,".").concat(i):i}return null};for(var i in e)if(e.hasOwnProperty(i)){var r=n(e,i);t[i]=r?"".concat(r,".").concat(i):i}return t}(r),s=function(e){return e.reduce(function(e,t){return e[t[pB].name]=t,e},{})}(n),u=[],c=_(o);try{for(c.s();!(i=c.n()).done;){var l=i.value,h=s[l],f=a[l],d=h[pB];this.addRuntimeInfoToMeta(d,f);var p={name:l,path:f,isInitialised:!1,actions:d.actions,instance:this._injector.get(h),defaults:e.cloneDefaults(d.defaults)};this.hasBeenMountedAndBootstrapped(l,f)||u.push(p),this.states.push(p)}}catch(v){c.e(v)}finally{c.f()}return u}},{key:"addAndReturnDefaults",value:function(e){var t=this.add(e||[]);return{defaults:t.reduce(function(e,t){return _B(e,t.path,t.defaults)},{}),states:t}}},{key:"connectActionHandlers",value:function(){var e=this;null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(od(function(e){return"DISPATCHED"===e.status}),we(function(t){var n=t.action;return e.invokeActions(e._actions,n).pipe(ue(function(){return{action:n,status:"SUCCESSFUL"}}),KF({action:n,status:"CANCELED"}),xb(function(e){return jf({action:n,status:"ERRORED",error:e})}))})).subscribe(function(t){return e._actionResults.next(t)}))}},{key:"invokeActions",value:function(e,t){var n,i=bB(t),r=[],o=_(this.states);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=a.actions[i];if(s){var u,c=_(s);try{for(c.s();!(u=c.n()).done;){var l=u.value,h=this._stateContextFactory.createStateContext(a);try{var f=a.instance[l.fn](h,t);f instanceof Promise&&(f=me(f)),f instanceof ee?(f=f.pipe(KF({})),l.options.cancelUncompleted&&(f=f.pipe(ud(e.pipe(CB(t)))))):f=jf({}).pipe(Od()),r.push(f)}catch(f){r.push(bd(f))}}}catch(d){c.e(d)}finally{c.f()}}}}catch(d){o.e(d)}finally{o.f()}return r.length||r.push(jf({})),wb(r)}},{key:"addToStatesMap",value:function(e){var t,n=[],i=this.statesByName,r=_(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,a=HB.checkStateNameIsUnique(o,i);!i[a]&&(n.push(o),i[a]=o)}}catch(s){r.e(s)}finally{r.f()}return{newStates:n}}},{key:"addRuntimeInfoToMeta",value:function(e,t){this.statePaths[e.name]=t,e.path=t}},{key:"hasBeenMountedAndBootstrapped",value:function(e,t){var n=void 0!==wB(this._initialState,t);return this.statesByName[e]&&n}}],[{key:"cloneDefaults",value:function(e){return Array.isArray(e)?e.slice():function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e)?Object.assign({},e):void 0===e?{}:e}},{key:"checkStatesAreValid",value:function(e){e.forEach(HB.getValidStateMeta)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(os),Qi(gB),Qi(e,12),Qi(MB),Qi(LB),Qi(UB),Qi(UF,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),WB=function(){var e=function(){function e(t,n,i){m(this,e),this.internalStateOperations=t,this.stateContextFactory=n,this.bootstrapper=i}return b(e,[{key:"ngxsBootstrap",value:function(e,t){var n=this;this.internalStateOperations.getRootStateOperations().dispatch(e).pipe(od(function(){return!!t}),rv(function(){return n.invokeInit(t.states)}),we(function(){return n.bootstrapper.appBootstrapped$}),od(function(e){return!!e})).subscribe(function(){return n.invokeBootstrap(t.states)})}},{key:"invokeInit",value:function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.instance;if(r.ngxsOnChanges){var o=EB(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(o)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}catch(a){n.e(a)}finally{n.f()}}},{key:"invokeBootstrap",value:function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}catch(o){n.e(o)}finally{n.f()}}},{key:"getStateContext",value:function(e){return this.stateContextFactory.createStateContext(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(zB),Qi(UB),Qi(zF))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),qB=function(){var e=function(){function e(t,n,i,r,o,a){m(this,e),this._stateStream=t,this._internalStateOperations=n,this._config=i,this._internalExecutionStrategy=r,this._stateFactory=o,this.initStateStream(a)}return b(e,[{key:"dispatch",value:function(e){return this._internalStateOperations.getRootStateOperations().dispatch(e)}},{key:"select",value:function(e){var t=this,n=this.getStoreBoundSelectorFn(e);return this._stateStream.pipe(ue(n),xb(function(e){var n=t._config.selectorOptions.suppressErrors;return e instanceof TypeError&&n?jf(void 0):bd(e)}),Qf(),TB(this._internalExecutionStrategy))}},{key:"selectOnce",value:function(e){return this.select(e).pipe(ap(1))}},{key:"selectSnapshot",value:function(e){return this.getStoreBoundSelectorFn(e)(this._stateStream.getValue())}},{key:"subscribe",value:function(e){return this._stateStream.pipe(TB(this._internalExecutionStrategy)).subscribe(e)}},{key:"snapshot",value:function(){return this._internalStateOperations.getRootStateOperations().getState()}},{key:"reset",value:function(e){return this._internalStateOperations.getRootStateOperations().setState(e)}},{key:"getStoreBoundSelectorFn",value:function(e){return function(e){var t=function(e){return e.NGXS_SELECTOR_META}(e)||SB(e);return t&&t.makeRootSelector||function(){return e}}(e)(this._stateFactory.getRuntimeSelectorContext())}},{key:"initStateStream",value:function(e){var t=this._stateStream.value;if(!t||0===Object.keys(t).length){var n=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,e):e;this._stateStream.next(n)}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(DB),Qi(zB),Qi(gB),Qi(AB),Qi(GB),Qi(UF,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),XB=function(){var e=function(){function e(t,n){m(this,e),e.store=t,e.config=n}return b(e,[{key:"ngOnDestroy",value:function(){e.store=null,e.config=null}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(qB),Qi(gB))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e.store=null,e.config=null,e}(),YB=function(){function e(){m(this,e)}return b(e,null,[{key:"type",get:function(){return"@@INIT"}}]),e}(),KB=function(){function e(t){m(this,e),this.addedStates=t}return b(e,null,[{key:"type",get:function(){return"@@UPDATE_STATE"}}]),e}(),QB=new Ed(1),$B=function(){var e=function e(t,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0;m(this,e),function(){try{var t=window.ng,n=!(t.probe&&t.coreTokens)&&Jl();QB.next(n)}catch(e){QB.next(!1)}finally{QB.complete()}}();var s=t.addAndReturnDefaults(o);n.setStateToTheCurrentWithNew(s),t.connectActionHandlers(),a.ngxsBootstrap(new YB,s)};return e.\u0275fac=function(t){return new(t||e)(Qi(GB),Qi(zB),Qi(qB),Qi(XB),Qi(cB,8),Qi(WB))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),ZB=function(){var e=function(){function e(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0;m(this,e);var a=e.flattenStates(r),s=i.addAndReturnDefaults(a);s.states.length&&(n.setStateToTheCurrentWithNew(s),o.ngxsBootstrap(new KB(s.defaults),s))}return b(e,null,[{key:"flattenStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(function(e,t){return e.concat(t)},[])}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(qB),Qi(zB),Qi(GB),Qi(lB,8),Qi(WB))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),JB=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{ngModule:$B,providers:[GB,UB,IB,MB,zF,VB,BB,WB,jB,LB,zB,AB,qB,DB,XB,NB].concat(v(t),v(e.ngxsTokenProviders(t,n)))}}},{key:"forFeature",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{ngModule:ZB,providers:[GB,NB].concat(v(e),[{provide:lB,multi:!0,useValue:e}])}}},{key:"ngxsTokenProviders",value:function(t,n){return[{provide:fB,useValue:VF},{provide:dB,useValue:Jl},{provide:yB,useClass:n.executionStrategy||uB},{provide:cB,useValue:t},{provide:e.ROOT_OPTIONS,useValue:n},{provide:gB,useFactory:e.ngxsConfigFactory,deps:[e.ROOT_OPTIONS]},{provide:El,useFactory:e.appBootstrapListenerFactory,multi:!0,deps:[zF]},{provide:UF,useFactory:e.getInitialState},{provide:GF,useExisting:UB},{provide:WF,useExisting:GB}]}},{key:"ngxsConfigFactory",value:function(e){return xB(new gB,e)}},{key:"appBootstrapListenerFactory",value:function(e){return function(){return e.bootstrap()}}},{key:"getInitialState",value:function(){return HF.pop()}}]),e}();function eV(e){return function(t){!function(e){QB.subscribe(function(t){t&&(e.\u0275prov||console.warn(sB(e.name)))})}(t);var n=t,i=function(e){if(!e.hasOwnProperty(pB)){var t={name:null,actions:{},defaults:{},path:null,makeRootSelector:function(e){return e.getStateGetter(t.name)},children:[]};Object.defineProperty(e,pB,{value:t})}return SB(e)}(n),r=Object.getPrototypeOf(n),o=function(t){return Object.assign({},t[vB]||{},e)}(r);(function(e){var t=e.meta,n=e.inheritedStateClass,i=e.optionsWithInheritance,r=i.children,o=i.defaults,a=i.name,s="string"==typeof a?a:a&&a.getName()||null;HB.checkCorrectStateName(s),n.hasOwnProperty(pB)&&(t.actions=Object.assign({},t.actions,(n[pB]||{}).actions)),t.children=r,t.defaults=o,t.name=s})({meta:i,inheritedStateClass:r,optionsWithInheritance:o}),n[vB]=o}}JB.\u0275fac=function(e){return new(e||JB)},JB.\u0275mod=Pt({type:JB}),JB.\u0275inj=Qe({}),JB.ROOT_OPTIONS=new Mi("ROOT_OPTIONS");var tV=function(){var e=function(){function e(t,n){m(this,e),this._renderer=t,this._elementRef=n,this.onChange=function(e){},this.onTouched=function(){}}return b(e,[{key:"setProperty",value:function(e,t){this._renderer.setProperty(this._elementRef.nativeElement,e,t)}},{key:"registerOnTouched",value:function(e){this.onTouched=e}},{key:"registerOnChange",value:function(e){this.onChange=e}},{key:"setDisabledState",value:function(e){this.setProperty("disabled",e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Zu),Es(Ku))},e.\u0275dir=It({type:e}),e}(),nV=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(tV);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,features:[ss]}),t}(),iV=new Mi("NgValueAccessor"),rV={provide:iV,useExisting:Ue(function(){return aV}),multi:!0},oV=new Mi("CompositionEventMode"),aV=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e,i))._compositionMode=r,o._composing=!1,null==o._compositionMode&&(o._compositionMode=!function(){var e=hh()?hh().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}()),o}return b(n,[{key:"writeValue",value:function(e){this.setProperty("value",null==e?"":e)}},{key:"_handleInput",value:function(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}},{key:"_compositionStart",value:function(){this._composing=!0}},{key:"_compositionEnd",value:function(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}]),n}(tV);return e.\u0275fac=function(t){return new(t||e)(Es(Zu),Es(Ku),Es(oV,8))},e.\u0275dir=It({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(e,t){1&e&&Fs("input",function(e){return t._handleInput(e.target.value)})("blur",function(){return t.onTouched()})("compositionstart",function(){return t._compositionStart()})("compositionend",function(e){return t._compositionEnd(e.target.value)})},features:[Hu([rV]),ss]}),e}(),sV=new Mi("NgValidators"),uV=new Mi("NgAsyncValidators");function cV(e){return null!=e}function lV(e){var t=Ns(e)?me(e):e;return js(t),t}function hV(e){var t={};return e.forEach(function(e){t=null!=e?Object.assign(Object.assign({},t),e):t}),0===Object.keys(t).length?null:t}function fV(e,t){return t.map(function(t){return t(e)})}function dV(e){return e.map(function(e){return function(e){return!e.validate}(e)?e:function(t){return e.validate(t)}})}function pV(e){return null!=e?function(e){if(!e)return null;var t=e.filter(cV);return 0==t.length?null:function(e){return hV(fV(e,t))}}(dV(e)):null}function vV(e){return null!=e?function(e){if(!e)return null;var t=e.filter(cV);return 0==t.length?null:function(e){return wb(fV(e,t).map(lV)).pipe(ue(hV))}}(dV(e)):null}function gV(e,t){return null===e?[t]:Array.isArray(e)?[].concat(v(e),[t]):[e,t]}function mV(e){return e._rawValidators}function yV(e){return e._rawAsyncValidators}function bV(e){return e?Array.isArray(e)?e:[e]:[]}function _V(e,t){return Array.isArray(e)?e.includes(t):e===t}function wV(e,t){var n=bV(t);return bV(e).forEach(function(e){_V(n,e)||n.push(e)}),n}function kV(e,t){return bV(t).filter(function(t){return!_V(e,t)})}var xV=function(){var e=function(){function e(){m(this,e),this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}return b(e,[{key:"value",get:function(){return this.control?this.control.value:null}},{key:"valid",get:function(){return this.control?this.control.valid:null}},{key:"invalid",get:function(){return this.control?this.control.invalid:null}},{key:"pending",get:function(){return this.control?this.control.pending:null}},{key:"disabled",get:function(){return this.control?this.control.disabled:null}},{key:"enabled",get:function(){return this.control?this.control.enabled:null}},{key:"errors",get:function(){return this.control?this.control.errors:null}},{key:"pristine",get:function(){return this.control?this.control.pristine:null}},{key:"dirty",get:function(){return this.control?this.control.dirty:null}},{key:"touched",get:function(){return this.control?this.control.touched:null}},{key:"status",get:function(){return this.control?this.control.status:null}},{key:"untouched",get:function(){return this.control?this.control.untouched:null}},{key:"statusChanges",get:function(){return this.control?this.control.statusChanges:null}},{key:"valueChanges",get:function(){return this.control?this.control.valueChanges:null}},{key:"path",get:function(){return null}},{key:"_setValidators",value:function(e){this._rawValidators=e||[],this._composedValidatorFn=pV(this._rawValidators)}},{key:"_setAsyncValidators",value:function(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=vV(this._rawAsyncValidators)}},{key:"validator",get:function(){return this._composedValidatorFn||null}},{key:"asyncValidator",get:function(){return this._composedAsyncValidatorFn||null}},{key:"_registerOnDestroy",value:function(e){this._onDestroyCallbacks.push(e)}},{key:"_invokeOnDestroyCallbacks",value:function(){this._onDestroyCallbacks.forEach(function(e){return e()}),this._onDestroyCallbacks=[]}},{key:"reset",value:function(e){this.control&&this.control.reset(e)}},{key:"hasError",value:function(e,t){return!!this.control&&this.control.hasError(e,t)}},{key:"getError",value:function(e,t){return this.control?this.control.getError(e,t):null}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e}),e}(),SV=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"formDirective",get:function(){return null}},{key:"path",get:function(){return null}}]),n}(xV);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,features:[ss]}),t}(),EV=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments))._parent=null,e.name=null,e.valueAccessor=null,e}return n}(xV),CV=function(){function e(t){m(this,e),this._cd=t}return b(e,[{key:"is",value:function(e){var t,n,i;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(i=null===(n=this._cd)||void 0===n?void 0:n.control)||void 0===i?void 0:i[e])}}]),e}(),OV=function(){var e=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,e)}return n}(CV);return e.\u0275fac=function(t){return new(t||e)(Es(EV,2))},e.\u0275dir=It({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,t){2&e&&su("ng-untouched",t.is("untouched"))("ng-touched",t.is("touched"))("ng-pristine",t.is("pristine"))("ng-dirty",t.is("dirty"))("ng-valid",t.is("valid"))("ng-invalid",t.is("invalid"))("ng-pending",t.is("pending"))},features:[ss]}),e}(),TV=function(){var e=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,e)}return n}(CV);return e.\u0275fac=function(t){return new(t||e)(Es(SV,10))},e.\u0275dir=It({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(e,t){2&e&&su("ng-untouched",t.is("untouched"))("ng-touched",t.is("touched"))("ng-pristine",t.is("pristine"))("ng-dirty",t.is("dirty"))("ng-valid",t.is("valid"))("ng-invalid",t.is("invalid"))("ng-pending",t.is("pending"))("ng-submitted",t.is("submitted"))},features:[ss]}),e}();function AV(e,t){IV(e,t),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(function(n){e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&DV(e,t)})}(e,t),function(e,t){var n=function(e,n){t.valueAccessor.writeValue(e),n&&t.viewToModelUpdate(e)};e.registerOnChange(n),t._registerOnDestroy(function(){e._unregisterOnChange(n)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(function(){e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&DV(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),function(e,t){if(t.valueAccessor.setDisabledState){var n=function(e){t.valueAccessor.setDisabledState(e)};e.registerOnDisabledChange(n),t._registerOnDestroy(function(){e._unregisterOnDisabledChange(n)})}}(e,t)}function PV(e,t){var n=function(){};t.valueAccessor&&(t.valueAccessor.registerOnChange(n),t.valueAccessor.registerOnTouched(n)),RV(e,t),e&&(t._invokeOnDestroyCallbacks(),e._registerOnCollectionChange(function(){}))}function MV(e,t){e.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function IV(e,t){var n=mV(e);null!==t.validator?e.setValidators(gV(n,t.validator)):"function"==typeof n&&e.setValidators([n]);var i=yV(e);null!==t.asyncValidator?e.setAsyncValidators(gV(i,t.asyncValidator)):"function"==typeof i&&e.setAsyncValidators([i]);var r=function(){return e.updateValueAndValidity()};MV(t._rawValidators,r),MV(t._rawAsyncValidators,r)}function RV(e,t){var n=!1;if(null!==e){if(null!==t.validator){var i=mV(e);if(Array.isArray(i)&&i.length>0){var r=i.filter(function(e){return e!==t.validator});r.length!==i.length&&(n=!0,e.setValidators(r))}}if(null!==t.asyncValidator){var o=yV(e);if(Array.isArray(o)&&o.length>0){var a=o.filter(function(e){return e!==t.asyncValidator});a.length!==o.length&&(n=!0,e.setAsyncValidators(a))}}}var s=function(){};return MV(t._rawValidators,s),MV(t._rawAsyncValidators,s),n}function DV(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function NV(e,t){IV(e,t)}function LV(e,t){e._syncPendingControls(),t.forEach(function(e){var t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)})}function jV(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var FV="VALID",BV="INVALID",VV="PENDING",zV="DISABLED";function UV(e){return(qV(e)?e.validators:e)||null}function HV(e){return Array.isArray(e)?pV(e):e||null}function GV(e,t){return(qV(t)?t.asyncValidators:e)||null}function WV(e){return Array.isArray(e)?vV(e):e||null}function qV(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}var XV=function(){function e(t,n){m(this,e),this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=function(){},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=n,this._composedValidatorFn=HV(this._rawValidators),this._composedAsyncValidatorFn=WV(this._rawAsyncValidators)}return b(e,[{key:"validator",get:function(){return this._composedValidatorFn},set:function(e){this._rawValidators=this._composedValidatorFn=e}},{key:"asyncValidator",get:function(){return this._composedAsyncValidatorFn},set:function(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}},{key:"parent",get:function(){return this._parent}},{key:"valid",get:function(){return this.status===FV}},{key:"invalid",get:function(){return this.status===BV}},{key:"pending",get:function(){return this.status==VV}},{key:"disabled",get:function(){return this.status===zV}},{key:"enabled",get:function(){return this.status!==zV}},{key:"dirty",get:function(){return!this.pristine}},{key:"untouched",get:function(){return!this.touched}},{key:"updateOn",get:function(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}},{key:"setValidators",value:function(e){this._rawValidators=e,this._composedValidatorFn=HV(e)}},{key:"setAsyncValidators",value:function(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=WV(e)}},{key:"addValidators",value:function(e){this.setValidators(wV(e,this._rawValidators))}},{key:"addAsyncValidators",value:function(e){this.setAsyncValidators(wV(e,this._rawAsyncValidators))}},{key:"removeValidators",value:function(e){this.setValidators(kV(e,this._rawValidators))}},{key:"removeAsyncValidators",value:function(e){this.setAsyncValidators(kV(e,this._rawAsyncValidators))}},{key:"hasValidator",value:function(e){return _V(this._rawValidators,e)}},{key:"hasAsyncValidator",value:function(e){return _V(this._rawAsyncValidators,e)}},{key:"clearValidators",value:function(){this.validator=null}},{key:"clearAsyncValidators",value:function(){this.asyncValidator=null}},{key:"markAsTouched",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}},{key:"markAllAsTouched",value:function(){this.markAsTouched({onlySelf:!0}),this._forEachChild(function(e){return e.markAllAsTouched()})}},{key:"markAsUntouched",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.touched=!1,this._pendingTouched=!1,this._forEachChild(function(e){e.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}},{key:"markAsDirty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}},{key:"markAsPristine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pristine=!0,this._pendingDirty=!1,this._forEachChild(function(e){e.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}},{key:"markAsPending",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.status=VV,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}},{key:"disable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._parentMarkedDirty(e.onlySelf);this.status=zV,this.errors=null,this._forEachChild(function(t){t.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(function(e){return e(!0)})}},{key:"enable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._parentMarkedDirty(e.onlySelf);this.status=FV,this._forEachChild(function(t){t.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(function(e){return e(!1)})}},{key:"_updateAncestors",value:function(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}},{key:"setParent",value:function(e){this._parent=e}},{key:"updateValueAndValidity",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===FV||this.status===VV)&&this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}},{key:"_updateTreeValidity",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{emitEvent:!0};this._forEachChild(function(t){return t._updateTreeValidity(e)}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}},{key:"_setInitialStatus",value:function(){this.status=this._allControlsDisabled()?zV:FV}},{key:"_runValidator",value:function(){return this.validator?this.validator(this):null}},{key:"_runAsyncValidator",value:function(e){var t=this;if(this.asyncValidator){this.status=VV,this._hasOwnPendingAsyncValidator=!0;var n=lV(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(function(n){t._hasOwnPendingAsyncValidator=!1,t.setErrors(n,{emitEvent:e})})}}},{key:"_cancelExistingSubscription",value:function(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}},{key:"setErrors",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}},{key:"get",value:function(e){return function(e,t,n){if(null==t||(Array.isArray(t)||(t=t.split(".")),Array.isArray(t)&&0===t.length))return null;var i=e;return t.forEach(function(e){i=i instanceof KV?i.controls.hasOwnProperty(e)?i.controls[e]:null:i instanceof QV&&i.at(e)||null}),i}(this,e)}},{key:"getError",value:function(e,t){var n=t?this.get(t):this;return n&&n.errors?n.errors[e]:null}},{key:"hasError",value:function(e,t){return!!this.getError(e,t)}},{key:"root",get:function(){for(var e=this;e._parent;)e=e._parent;return e}},{key:"_updateControlsErrors",value:function(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}},{key:"_initObservables",value:function(){this.valueChanges=new Zc,this.statusChanges=new Zc}},{key:"_calculateStatus",value:function(){return this._allControlsDisabled()?zV:this.errors?BV:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(VV)?VV:this._anyControlsHaveStatus(BV)?BV:FV}},{key:"_anyControlsHaveStatus",value:function(e){return this._anyControls(function(t){return t.status===e})}},{key:"_anyControlsDirty",value:function(){return this._anyControls(function(e){return e.dirty})}},{key:"_anyControlsTouched",value:function(){return this._anyControls(function(e){return e.touched})}},{key:"_updatePristine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}},{key:"_updateTouched",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}},{key:"_isBoxedValue",value:function(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}},{key:"_registerOnCollectionChange",value:function(e){this._onCollectionChange=e}},{key:"_setUpdateStrategy",value:function(e){qV(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}},{key:"_parentMarkedDirty",value:function(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}]),e}(),YV=function(e){a(n,e);var t=s(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;return m(this,n),(e=t.call(this,UV(r),GV(o,r)))._onChange=[],e._applyFormState(i),e._setUpdateStrategy(r),e._initObservables(),e.updateValueAndValidity({onlySelf:!0,emitEvent:!!e.asyncValidator}),e}return b(n,[{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.value=this._pendingValue=e,this._onChange.length&&!1!==n.emitModelToViewChange&&this._onChange.forEach(function(e){return e(t.value,!1!==n.emitViewToModelChange)}),this.updateValueAndValidity(n)}},{key:"patchValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.setValue(e,t)}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}},{key:"_updateValue",value:function(){}},{key:"_anyControls",value:function(e){return!1}},{key:"_allControlsDisabled",value:function(){return this.disabled}},{key:"registerOnChange",value:function(e){this._onChange.push(e)}},{key:"_unregisterOnChange",value:function(e){jV(this._onChange,e)}},{key:"registerOnDisabledChange",value:function(e){this._onDisabledChange.push(e)}},{key:"_unregisterOnDisabledChange",value:function(e){jV(this._onDisabledChange,e)}},{key:"_forEachChild",value:function(e){}},{key:"_syncPendingControls",value:function(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}},{key:"_applyFormState",value:function(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}]),n}(XV),KV=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,UV(i),GV(r,i))).controls=e,o._initObservables(),o._setUpdateStrategy(i),o._setUpControls(),o.updateValueAndValidity({onlySelf:!0,emitEvent:!!o.asyncValidator}),o}return b(n,[{key:"registerControl",value:function(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}},{key:"addControl",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.registerControl(e,t),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}},{key:"removeControl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}},{key:"setControl",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}},{key:"contains",value:function(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkAllValuesPresent(e),Object.keys(e).forEach(function(i){t._throwIfControlMissing(i),t.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:n.emitEvent})}),this.updateValueAndValidity(n)}},{key:"patchValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null!=e&&(Object.keys(e).forEach(function(i){t.controls[i]&&t.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:n.emitEvent})}),this.updateValueAndValidity(n))}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._forEachChild(function(n,i){n.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}},{key:"getRawValue",value:function(){return this._reduceChildren({},function(e,t,n){return e[n]=t instanceof YV?t.value:t.getRawValue(),e})}},{key:"_syncPendingControls",value:function(){var e=this._reduceChildren(!1,function(e,t){return!!t._syncPendingControls()||e});return e&&this.updateValueAndValidity({onlySelf:!0}),e}},{key:"_throwIfControlMissing",value:function(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error("Cannot find form control with name: ".concat(e,"."))}},{key:"_forEachChild",value:function(e){var t=this;Object.keys(this.controls).forEach(function(n){var i=t.controls[n];i&&e(i,n)})}},{key:"_setUpControls",value:function(){var e=this;this._forEachChild(function(t){t.setParent(e),t._registerOnCollectionChange(e._onCollectionChange)})}},{key:"_updateValue",value:function(){this.value=this._reduceValue()}},{key:"_anyControls",value:function(e){for(var t=0,n=Object.keys(this.controls);t0||this.disabled}},{key:"_checkAllValuesPresent",value:function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control with name: '".concat(n,"'."))})}}]),n}(XV),QV=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,UV(i),GV(r,i))).controls=e,o._initObservables(),o._setUpdateStrategy(i),o._setUpControls(),o.updateValueAndValidity({onlySelf:!0,emitEvent:!!o.asyncValidator}),o}return b(n,[{key:"at",value:function(e){return this.controls[e]}},{key:"push",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}},{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:n.emitEvent})}},{key:"removeAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}},{key:"setControl",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}},{key:"length",get:function(){return this.controls.length}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkAllValuesPresent(e),e.forEach(function(e,i){t._throwIfControlMissing(i),t.at(i).setValue(e,{onlySelf:!0,emitEvent:n.emitEvent})}),this.updateValueAndValidity(n)}},{key:"patchValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null!=e&&(e.forEach(function(e,i){t.at(i)&&t.at(i).patchValue(e,{onlySelf:!0,emitEvent:n.emitEvent})}),this.updateValueAndValidity(n))}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._forEachChild(function(n,i){n.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}},{key:"getRawValue",value:function(){return this.controls.map(function(e){return e instanceof YV?e.value:e.getRawValue()})}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.controls.length<1||(this._forEachChild(function(e){return e._registerOnCollectionChange(function(){})}),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}},{key:"_syncPendingControls",value:function(){var e=this.controls.reduce(function(e,t){return!!t._syncPendingControls()||e},!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}},{key:"_throwIfControlMissing",value:function(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index ".concat(e))}},{key:"_forEachChild",value:function(e){this.controls.forEach(function(t,n){e(t,n)})}},{key:"_updateValue",value:function(){var e=this;this.value=this.controls.filter(function(t){return t.enabled||e.disabled}).map(function(e){return e.value})}},{key:"_anyControls",value:function(e){return this.controls.some(function(t){return t.enabled&&e(t)})}},{key:"_setUpControls",value:function(){var e=this;this._forEachChild(function(t){return e._registerControl(t)})}},{key:"_checkAllValuesPresent",value:function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control at index: ".concat(n,"."))})}},{key:"_allControlsDisabled",value:function(){var e,t=_(this.controls);try{for(t.s();!(e=t.n()).done;){if(e.value.enabled)return!1}}catch(n){t.e(n)}finally{t.f()}return this.controls.length>0||this.disabled}},{key:"_registerControl",value:function(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}]),n}(XV),$V={provide:SV,useExisting:Ue(function(){return JV})},ZV=Promise.resolve(null),JV=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this)).submitted=!1,r._directives=[],r.ngSubmit=new Zc,r.form=new KV({},pV(e),vV(i)),r}return b(n,[{key:"ngAfterViewInit",value:function(){this._setUpdateStrategy()}},{key:"formDirective",get:function(){return this}},{key:"control",get:function(){return this.form}},{key:"path",get:function(){return[]}},{key:"controls",get:function(){return this.form.controls}},{key:"addControl",value:function(e){var t=this;ZV.then(function(){var n=t._findContainer(e.path);e.control=n.registerControl(e.name,e.control),AV(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),t._directives.push(e)})}},{key:"getControl",value:function(e){return this.form.get(e.path)}},{key:"removeControl",value:function(e){var t=this;ZV.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name),jV(t._directives,e)})}},{key:"addFormGroup",value:function(e){var t=this;ZV.then(function(){var n=t._findContainer(e.path),i=new KV({});NV(i,e),n.registerControl(e.name,i),i.updateValueAndValidity({emitEvent:!1})})}},{key:"removeFormGroup",value:function(e){var t=this;ZV.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name)})}},{key:"getFormGroup",value:function(e){return this.form.get(e.path)}},{key:"updateModel",value:function(e,t){var n=this;ZV.then(function(){n.form.get(e.path).setValue(t)})}},{key:"setValue",value:function(e){this.control.setValue(e)}},{key:"onSubmit",value:function(e){return this.submitted=!0,LV(this.form,this._directives),this.ngSubmit.emit(e),!1}},{key:"onReset",value:function(){this.resetForm()}},{key:"resetForm",value:function(e){this.form.reset(e),this.submitted=!1}},{key:"_setUpdateStrategy",value:function(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}},{key:"_findContainer",value:function(e){return e.pop(),e.length?this.form.get(e):this.form}}]),n}(SV);return e.\u0275fac=function(t){return new(t||e)(Es(sV,10),Es(uV,10))},e.\u0275dir=It({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(e,t){1&e&&Fs("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Hu([$V]),ss]}),e}(),ez=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),e}(),tz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),nz=new Mi("NgModelWithFormControlWarning"),iz={provide:EV,useExisting:Ue(function(){return rz})},rz=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;return m(this,n),(a=t.call(this))._ngModelWarningConfig=o,a.update=new Zc,a._ngModelWarningSent=!1,a._setValidators(e),a._setAsyncValidators(i),a.valueAccessor=function(e,t){return t?(Array.isArray(t),t.forEach(function(e){e.constructor===aV?n=e:function(e){return Object.getPrototypeOf(e.constructor)===nV}(e)?i=e:r=e}),r||i||n||null):null;var n,i,r}(0,r),a}return b(n,[{key:"isDisabled",set:function(e){}},{key:"ngOnChanges",value:function(e){if(this._isControlChanged(e)){var t=e.form.previousValue;t&&PV(t,this,!1),AV(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}(function(e,t){if(!e.hasOwnProperty("model"))return!1;var n=e.model;return!!n.isFirstChange()||!Object.is(t,n.currentValue)})(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}},{key:"ngOnDestroy",value:function(){this.form&&PV(this.form,this,!1)}},{key:"path",get:function(){return[]}},{key:"control",get:function(){return this.form}},{key:"viewToModelUpdate",value:function(e){this.viewModel=e,this.update.emit(e)}},{key:"_isControlChanged",value:function(e){return e.hasOwnProperty("form")}}]),n}(EV);return e.\u0275fac=function(t){return new(t||e)(Es(sV,10),Es(uV,10),Es(iV,10),Es(nz,8))},e.\u0275dir=It({type:e,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[Hu([iz]),ss,Gt]}),e._ngModelWarningSentOnce=!1,e}(),oz={provide:SV,useExisting:Ue(function(){return az})},az=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this)).validators=e,r.asyncValidators=i,r.submitted=!1,r._onCollectionChange=function(){return r._updateDomValue()},r.directives=[],r.form=null,r.ngSubmit=new Zc,r._setValidators(e),r._setAsyncValidators(i),r}return b(n,[{key:"ngOnChanges",value:function(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}},{key:"ngOnDestroy",value:function(){this.form&&(RV(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(function(){}))}},{key:"formDirective",get:function(){return this}},{key:"control",get:function(){return this.form}},{key:"path",get:function(){return[]}},{key:"addControl",value:function(e){var t=this.form.get(e.path);return AV(t,e),t.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),t}},{key:"getControl",value:function(e){return this.form.get(e.path)}},{key:"removeControl",value:function(e){PV(e.control||null,e,!1),jV(this.directives,e)}},{key:"addFormGroup",value:function(e){this._setUpFormContainer(e)}},{key:"removeFormGroup",value:function(e){this._cleanUpFormContainer(e)}},{key:"getFormGroup",value:function(e){return this.form.get(e.path)}},{key:"addFormArray",value:function(e){this._setUpFormContainer(e)}},{key:"removeFormArray",value:function(e){this._cleanUpFormContainer(e)}},{key:"getFormArray",value:function(e){return this.form.get(e.path)}},{key:"updateModel",value:function(e,t){this.form.get(e.path).setValue(t)}},{key:"onSubmit",value:function(e){return this.submitted=!0,LV(this.form,this.directives),this.ngSubmit.emit(e),!1}},{key:"onReset",value:function(){this.resetForm()}},{key:"resetForm",value:function(e){this.form.reset(e),this.submitted=!1}},{key:"_updateDomValue",value:function(){var e=this;this.directives.forEach(function(t){var n=t.control,i=e.form.get(t.path);n!==i&&(PV(n||null,t),i instanceof YV&&(AV(i,t),t.control=i))}),this.form._updateTreeValidity({emitEvent:!1})}},{key:"_setUpFormContainer",value:function(e){var t=this.form.get(e.path);NV(t,e),t.updateValueAndValidity({emitEvent:!1})}},{key:"_cleanUpFormContainer",value:function(e){if(this.form){var t=this.form.get(e.path);t&&function(e,t){return RV(e,t)}(t,e)&&t.updateValueAndValidity({emitEvent:!1})}}},{key:"_updateRegistrations",value:function(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(function(){})}},{key:"_updateValidators",value:function(){IV(this.form,this),this._oldForm&&RV(this._oldForm,this)}},{key:"_checkFormPresent",value:function(){}}]),n}(SV);return e.\u0275fac=function(t){return new(t||e)(Es(sV,10),Es(uV,10))},e.\u0275dir=It({type:e,selectors:[["","formGroup",""]],hostBindings:function(e,t){1&e&&Fs("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Hu([oz]),ss,Gt]}),e}(),sz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[tz]]}),e}(),uz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[sz]}),e}(),cz=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"withConfig",value:function(t){return{ngModule:e,providers:[{provide:nz,useValue:t.warnOnNgModelWithFormControl}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[sz]}),e}();function lz(e){return new ee(function(t){var n;try{n=e()}catch(i){return void t.error(i)}return(n?me(n):yd()).subscribe(t)})}var hz=["underline"],fz=["connectionContainer"],dz=["inputContainer"],pz=["label"];function vz(e,t){1&e&&(Ms(0),Ts(1,"div",14),Ps(2,"div",15),Ps(3,"div",16),Ps(4,"div",17),As(),Ts(5,"div",18),Ps(6,"div",15),Ps(7,"div",16),Ps(8,"div",17),As(),Is())}function gz(e,t){1&e&&(Ts(0,"div",19),qs(1,1),As())}function mz(e,t){if(1&e&&(Ms(0),qs(1,2),Ts(2,"span"),ku(3),As(),Is()),2&e){var n=Hs(2);qo(3),xu(n._control.placeholder)}}function yz(e,t){1&e&&qs(0,3,["*ngSwitchCase","true"])}function bz(e,t){1&e&&(Ts(0,"span",23),ku(1," *"),As())}function _z(e,t){if(1&e){var n=Ds();Ts(0,"label",20,21),Fs("cdkObserveContent",function(){return mn(n),Hs().updateOutlineGap()}),xs(2,mz,4,1,"ng-container",12),xs(3,yz,1,0,"ng-content",12),xs(4,bz,2,0,"span",22),As()}if(2&e){var i=Hs();su("mat-empty",i._control.empty&&!i._shouldAlwaysFloat())("mat-form-field-empty",i._control.empty&&!i._shouldAlwaysFloat())("mat-accent","accent"==i.color)("mat-warn","warn"==i.color),Cs("cdkObserveContentDisabled","outline"!=i.appearance)("id",i._labelId)("ngSwitch",i._hasLabel()),_s("for",i._control.id)("aria-owns",i._control.id),qo(2),Cs("ngSwitchCase",!1),qo(1),Cs("ngSwitchCase",!0),qo(1),Cs("ngIf",!i.hideRequiredMarker&&i._control.required&&!i._control.disabled)}}function wz(e,t){1&e&&(Ts(0,"div",24),qs(1,4),As())}function kz(e,t){if(1&e&&(Ts(0,"div",25,26),Ps(2,"span",27),As()),2&e){var n=Hs();qo(2),su("mat-accent","accent"==n.color)("mat-warn","warn"==n.color)}}function xz(e,t){1&e&&(Ts(0,"div"),qs(1,5),As()),2&e&&Cs("@transitionMessages",Hs()._subscriptAnimationState)}function Sz(e,t){if(1&e&&(Ts(0,"div",31),ku(1),As()),2&e){var n=Hs(2);Cs("id",n._hintLabelId),qo(1),xu(n.hintLabel)}}function Ez(e,t){if(1&e&&(Ts(0,"div",28),xs(1,Sz,2,2,"div",29),qs(2,6),Ps(3,"div",30),qs(4,7),As()),2&e){var n=Hs();Cs("@transitionMessages",n._subscriptAnimationState),qo(1),Cs("ngIf",n.hintLabel)}}var Cz=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Oz=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Tz=new Mi("MatError"),Az={transitionMessages:eg("transitionMessages",[rg("enter",ig({opacity:1,transform:"translateY(0%)"})),og("void => enter",[ig({opacity:0,transform:"translateY(-5px)"}),tg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},Pz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e}),e}(),Mz=new Mi("MatHint"),Iz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["mat-label"]]}),e}(),Rz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["mat-placeholder"]]}),e}(),Dz=new Mi("MatPrefix"),Nz=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["","matPrefix",""]],features:[Hu([{provide:Dz,useExisting:e}])]}),e}(),Lz=new Mi("MatSuffix"),jz=0,Fz=Xy(function(){return function e(t){m(this,e),this._elementRef=t}}(),"primary"),Bz=new Mi("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Vz=new Mi("MatFormField"),zz=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c){var l;return m(this,n),(l=t.call(this,e))._changeDetectorRef=i,l._dir=o,l._defaults=a,l._platform=s,l._ngZone=u,l._outlineGapCalculationNeededImmediately=!1,l._outlineGapCalculationNeededOnStable=!1,l._destroyed=new oe,l._showAlwaysAnimate=!1,l._subscriptAnimationState="",l._hintLabel="",l._hintLabelId="mat-hint-"+jz++,l._labelId="mat-form-field-label-"+jz++,l.floatLabel=l._getDefaultFloatLabelState(),l._animationsEnabled="NoopAnimations"!==c,l.appearance=a&&a.appearance?a.appearance:"legacy",l._hideRequiredMarker=!(!a||null==a.hideRequiredMarker)&&a.hideRequiredMarker,l}return b(n,[{key:"appearance",get:function(){return this._appearance},set:function(e){var t=this._appearance;this._appearance=e||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&t!==e&&(this._outlineGapCalculationNeededOnStable=!0)}},{key:"hideRequiredMarker",get:function(){return this._hideRequiredMarker},set:function(e){this._hideRequiredMarker=If(e)}},{key:"_shouldAlwaysFloat",value:function(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}},{key:"_canLabelFloat",value:function(){return"never"!==this.floatLabel}},{key:"hintLabel",get:function(){return this._hintLabel},set:function(e){this._hintLabel=e,this._processHints()}},{key:"floatLabel",get:function(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel},set:function(e){e!==this._floatLabel&&(this._floatLabel=e||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}},{key:"_control",get:function(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic},set:function(e){this._explicitFormFieldControl=e}},{key:"getLabelId",value:function(){return this._hasFloatingLabel()?this._labelId:null}},{key:"getConnectedOverlayOrigin",value:function(){return this._connectionContainerRef||this._elementRef}},{key:"ngAfterContentInit",value:function(){var e=this;this._validateControlChild();var t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add("mat-form-field-type-".concat(t.controlType)),t.stateChanges.pipe(fd(null)).subscribe(function(){e._validatePlaceholders(),e._syncDescribedByIds(),e._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(ud(this._destroyed)).subscribe(function(){return e._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(function(){e._ngZone.onStable.pipe(ud(e._destroyed)).subscribe(function(){e._outlineGapCalculationNeededOnStable&&e.updateOutlineGap()})}),Ce(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(function(){e._outlineGapCalculationNeededOnStable=!0,e._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(fd(null)).subscribe(function(){e._processHints(),e._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(fd(null)).subscribe(function(){e._syncDescribedByIds(),e._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(ud(this._destroyed)).subscribe(function(){"function"==typeof requestAnimationFrame?e._ngZone.runOutsideAngular(function(){requestAnimationFrame(function(){return e.updateOutlineGap()})}):e.updateOutlineGap()})}},{key:"ngAfterContentChecked",value:function(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}},{key:"ngAfterViewInit",value:function(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}},{key:"ngOnDestroy",value:function(){this._destroyed.next(),this._destroyed.complete()}},{key:"_shouldForward",value:function(e){var t=this._control?this._control.ngControl:null;return t&&t[e]}},{key:"_hasPlaceholder",value:function(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}},{key:"_hasLabel",value:function(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}},{key:"_shouldLabelFloat",value:function(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}},{key:"_hideControlPlaceholder",value:function(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}},{key:"_hasFloatingLabel",value:function(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}},{key:"_getDisplayedMessages",value:function(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}},{key:"_animateAndLockLabel",value:function(){var e=this;this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,Ff(this._label.nativeElement,"transitionend").pipe(ap(1)).subscribe(function(){e._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}},{key:"_validatePlaceholders",value:function(){}},{key:"_processHints",value:function(){this._validateHints(),this._syncDescribedByIds()}},{key:"_validateHints",value:function(){}},{key:"_getDefaultFloatLabelState",value:function(){return this._defaults&&this._defaults.floatLabel||"auto"}},{key:"_syncDescribedByIds",value:function(){if(this._control){var e=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&e.push.apply(e,v(this._control.userAriaDescribedBy.split(" "))),"hint"===this._getDisplayedMessages()){var t=this._hintChildren?this._hintChildren.find(function(e){return"start"===e.align}):null,n=this._hintChildren?this._hintChildren.find(function(e){return"end"===e.align}):null;t?e.push(t.id):this._hintLabel&&e.push(this._hintLabelId),n&&e.push(n.id)}else this._errorChildren&&e.push.apply(e,v(this._errorChildren.map(function(e){return e.id})));this._control.setDescribedByIds(e)}}},{key:"_validateControlChild",value:function(){}},{key:"updateOutlineGap",value:function(){var e=this._label?this._label.nativeElement:null;if("outline"===this.appearance&&e&&e.children.length&&e.textContent.trim()&&this._platform.isBrowser)if(this._isAttachedToDOM()){var t=0,n=0,i=this._connectionContainerRef.nativeElement,r=i.querySelectorAll(".mat-form-field-outline-start"),o=i.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){var a=i.getBoundingClientRect();if(0===a.width&&0===a.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);for(var s=this._getStartEnd(a),u=e.children,c=this._getStartEnd(u[0].getBoundingClientRect()),l=0,h=0;h0?.75*l+10:0}for(var f=0;f1&&void 0!==arguments[1]?arguments[1]:Jf,n=function(e){return e instanceof Date&&!isNaN(+e)}(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new Gz(n,t))}}var Gz=function(){function e(t,n){m(this,e),this.delay=t,this.scheduler=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new Wz(e,this.delay,this.scheduler))}}]),e}(),Wz=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).delay=i,o.scheduler=r,o.queue=[],o.active=!1,o.errored=!1,o}return b(n,[{key:"_schedule",value:function(e){this.active=!0,this.destination.add(e.schedule(n.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}},{key:"scheduleNotification",value:function(e){if(!0!==this.errored){var t=this.scheduler,n=new qz(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}}},{key:"_next",value:function(e){this.scheduleNotification(wd.createNext(e))}},{key:"_error",value:function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleNotification(wd.createComplete()),this.unsubscribe()}}],[{key:"dispatch",value:function(e){for(var t=e.source,n=t.queue,i=e.scheduler,r=e.destination;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){var o=Math.max(0,n[0].time-i.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}}]),n}(Y),qz=function e(t,n){m(this,e),this.time=t,this.notification=n},Xz=["panel"];function Yz(e,t){if(1&e&&(Ts(0,"div",0,1),qs(2),As()),2&e){var n=t.id,i=Hs();Cs("id",i.id)("ngClass",i._classList),_s("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby(n))}}var Kz=["*"],Qz=0,$z=function e(t,n){m(this,e),this.source=t,this.option=n},Zz=Yy(function(){return function e(){m(this,e)}}()),Jz=new Mi("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}}),eU=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;return m(this,n),(a=t.call(this))._changeDetectorRef=e,a._elementRef=i,a._activeOptionChanges=W.EMPTY,a.showPanel=!1,a._isOpen=!1,a.displayWith=null,a.optionSelected=new Zc,a.opened=new Zc,a.closed=new Zc,a.optionActivated=new Zc,a._classList={},a.id="mat-autocomplete-"+Qz++,a.inertGroups=(null==o?void 0:o.SAFARI)||!1,a._autoActiveFirstOption=!!r.autoActiveFirstOption,a}return b(n,[{key:"isOpen",get:function(){return this._isOpen&&this.showPanel}},{key:"autoActiveFirstOption",get:function(){return this._autoActiveFirstOption},set:function(e){this._autoActiveFirstOption=If(e)}},{key:"classList",set:function(e){this._classList=e&&e.length?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\s+/,n=[];if(null!=e){var i,r=Array.isArray(e)?e:"".concat(e).split(t),o=_(r);try{for(o.s();!(i=o.n()).done;){var a=i.value,s="".concat(a).trim();s&&n.push(s)}}catch(u){o.e(u)}finally{o.f()}}return n}(e).reduce(function(e,t){return e[t]=!0,e},{}):{},this._setVisibilityClasses(this._classList),this._elementRef.nativeElement.className=""}},{key:"ngAfterContentInit",value:function(){var e=this;this._keyManager=new Tv(this.options).withWrap(),this._activeOptionChanges=this._keyManager.change.subscribe(function(t){e.isOpen&&e.optionActivated.emit({source:e,option:e.options.toArray()[t]||null})}),this._setVisibility()}},{key:"ngOnDestroy",value:function(){this._activeOptionChanges.unsubscribe()}},{key:"_setScrollTop",value:function(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}},{key:"_getScrollTop",value:function(){return this.panel?this.panel.nativeElement.scrollTop:0}},{key:"_setVisibility",value:function(){this.showPanel=!!this.options.length,this._setVisibilityClasses(this._classList),this._changeDetectorRef.markForCheck()}},{key:"_emitSelectEvent",value:function(e){var t=new $z(this,e);this.optionSelected.emit(t)}},{key:"_getPanelAriaLabelledby",value:function(e){return this.ariaLabel?null:this.ariaLabelledby?(e?e+" ":"")+this.ariaLabelledby:e}},{key:"_setVisibilityClasses",value:function(e){e[this._visibleClass]=this.showPanel,e[this._hiddenClass]=!this.showPanel}}]),n}(Zz);return e.\u0275fac=function(t){return new(t||e)(Es(wc),Es(Ku),Es(Jz),Es(Id))},e.\u0275dir=It({type:e,viewQuery:function(e,t){var n;(1&e&&(hl(Cc,7),hl(Xz,5)),2&e)&&(ll(n=dl())&&(t.template=n.first),ll(n=dl())&&(t.panel=n.first))},inputs:{displayWith:"displayWith",autoActiveFirstOption:"autoActiveFirstOption",classList:["class","classList"],ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],panelWidth:"panelWidth"},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},features:[ss]}),e}(),tU=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments))._visibleClass="mat-autocomplete-visible",e._hiddenClass="mat-autocomplete-hidden",e}return n}(eU);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275cmp=Ct({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(e,t,n){var i;(1&e&&(fl(n,db,5),fl(n,mb,5)),2&e)&&(ll(i=dl())&&(t.optionGroups=i),ll(i=dl())&&(t.options=i))},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[Hu([{provide:cb,useExisting:t}]),ss],ngContentSelectors:Kz,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(e,t){1&e&&(Ws(),xs(0,Yz,3,4,"ng-template"))},directives:[Ih],styles:[".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}\n"],encapsulation:2,changeDetection:0}),t}(),nU=new Mi("mat-autocomplete-scroll-strategy"),iU={provide:nU,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},rU={provide:iV,useExisting:Ue(function(){return aU}),multi:!0},oU=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h){var f=this;m(this,e),this._element=t,this._overlay=n,this._viewContainerRef=i,this._zone=r,this._changeDetectorRef=o,this._dir=s,this._formField=u,this._document=c,this._viewportRuler=l,this._defaults=h,this._componentDestroyed=!1,this._autocompleteDisabled=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=W.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new oe,this._windowBlurHandler=function(){f._canOpenOnNextFocus=f._document.activeElement!==f._element.nativeElement||f.panelOpen},this._onChange=function(){},this._onTouched=function(){},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=lz(function(){return f.autocomplete&&f.autocomplete.options?Ce.apply(void 0,v(f.autocomplete.options.map(function(e){return e.onSelectionChange}))):f._zone.onStable.pipe(ap(1),dd(function(){return f.optionSelections}))}),this._scrollStrategy=a}return b(e,[{key:"autocompleteDisabled",get:function(){return this._autocompleteDisabled},set:function(e){this._autocompleteDisabled=If(e)}},{key:"ngAfterViewInit",value:function(){var e=this,t=this._getWindow();void 0!==t&&this._zone.runOutsideAngular(function(){return t.addEventListener("blur",e._windowBlurHandler)})}},{key:"ngOnChanges",value:function(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}},{key:"ngOnDestroy",value:function(){var e=this._getWindow();void 0!==e&&e.removeEventListener("blur",this._windowBlurHandler),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete()}},{key:"panelOpen",get:function(){return this._overlayAttached&&this.autocomplete.showPanel}},{key:"openPanel",value:function(){this._attachOverlay(),this._floatLabel()}},{key:"closePanel",value:function(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this.autocomplete.closed.emit(),this.autocomplete._isOpen=this._overlayAttached=!1,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._componentDestroyed||this._changeDetectorRef.detectChanges())}},{key:"updatePosition",value:function(){this._overlayAttached&&this._overlayRef.updatePosition()}},{key:"panelClosingActions",get:function(){var e=this;return Ce(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(od(function(){return e._overlayAttached})),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(od(function(){return e._overlayAttached})):jf()).pipe(ue(function(e){return e instanceof vb?e:null}))}},{key:"activeOption",get:function(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}},{key:"_getOutsideClickStream",value:function(){var e=this;return Ce(Ff(this._document,"click"),Ff(this._document,"auxclick"),Ff(this._document,"touchend")).pipe(od(function(t){var n=Bd(t),i=e._formField?e._formField._elementRef.nativeElement:null,r=e.connectedTo?e.connectedTo.elementRef.nativeElement:null;return e._overlayAttached&&n!==e._element.nativeElement&&(!i||!i.contains(n))&&(!r||!r.contains(n))&&!!e._overlayRef&&!e._overlayRef.overlayElement.contains(n)}))}},{key:"writeValue",value:function(e){var t=this;Promise.resolve(null).then(function(){return t._setTriggerValue(e)})}},{key:"registerOnChange",value:function(e){this._onChange=e}},{key:"registerOnTouched",value:function(e){this._onTouched=e}},{key:"setDisabledState",value:function(e){this._element.nativeElement.disabled=e}},{key:"_handleKeydown",value:function(e){var t=e.keyCode;if(27===t&&!fp(e)&&e.preventDefault(),this.activeOption&&13===t&&this.panelOpen)this.activeOption._selectViaInteraction(),this._resetActiveItem(),e.preventDefault();else if(this.autocomplete){var n=this.autocomplete._keyManager.activeItem,i=38===t||40===t;this.panelOpen||9===t?this.autocomplete._keyManager.onKeydown(e):i&&this._canOpen()&&this.openPanel(),(i||this.autocomplete._keyManager.activeItem!==n)&&this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0)}}},{key:"_handleInput",value:function(e){var t=e.target,n=t.value;"number"===t.type&&(n=""==n?null:parseFloat(n)),this._previousValue!==n&&(this._previousValue=n,this._onChange(n),this._canOpen()&&this._document.activeElement===e.target&&this.openPanel())}},{key:"_handleFocus",value:function(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}},{key:"_floatLabel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._formField&&"auto"===this._formField.floatLabel&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}},{key:"_resetLabel",value:function(){this._manuallyFloatingLabel&&(this._formField.floatLabel="auto",this._manuallyFloatingLabel=!1)}},{key:"_subscribeToClosingActions",value:function(){var e=this;return Ce(this._zone.onStable.pipe(ap(1)),this.autocomplete.options.changes.pipe(rv(function(){return e._positionStrategy.reapplyLastPosition()}),Hz(0))).pipe(dd(function(){var t=e.panelOpen;return e._resetActiveItem(),e.autocomplete._setVisibility(),e.panelOpen&&(e._overlayRef.updatePosition(),t!==e.panelOpen&&e.autocomplete.opened.emit()),e.panelClosingActions}),ap(1)).subscribe(function(t){return e._setValueAndClose(t)})}},{key:"_destroyPanel",value:function(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}},{key:"_setTriggerValue",value:function(e){var t=this.autocomplete&&this.autocomplete.displayWith?this.autocomplete.displayWith(e):e,n=null!=t?t:"";this._formField?this._formField._control.value=n:this._element.nativeElement.value=n,this._previousValue=n}},{key:"_setValueAndClose",value:function(e){e&&e.source&&(this._clearPreviousSelectedOption(e.source),this._setTriggerValue(e.source.value),this._onChange(e.source.value),this._element.nativeElement.focus(),this.autocomplete._emitSelectEvent(e.source)),this.closePanel()}},{key:"_clearPreviousSelectedOption",value:function(e){this.autocomplete.options.forEach(function(t){t!==e&&t.selected&&t.deselect()})}},{key:"_attachOverlay",value:function(){var e,t=this,n=this._overlayRef;n?(this._positionStrategy.setOrigin(this._getConnectedElement()),n.updateSize({width:this._getPanelWidth()})):(this._portal=new $d(this.autocomplete.template,this._viewContainerRef,{id:null===(e=this._formField)||void 0===e?void 0:e.getLabelId()}),n=this._overlay.create(this._getOverlayConfig()),this._overlayRef=n,n.keydownEvents().subscribe(function(e){(27===e.keyCode&&!fp(e)||38===e.keyCode&&fp(e,"altKey"))&&(t._closeKeyEventStream.next(),t._resetActiveItem(),e.stopPropagation(),e.preventDefault())}),this._viewportSubscription=this._viewportRuler.change().subscribe(function(){t.panelOpen&&n&&n.updateSize({width:t._getPanelWidth()})})),n&&!n.hasAttached()&&(n.attach(this._portal),this._closingActionsSubscription=this._subscribeToClosingActions());var i=this.panelOpen;this.autocomplete._setVisibility(),this.autocomplete._isOpen=this._overlayAttached=!0,this.panelOpen&&i!==this.panelOpen&&this.autocomplete.opened.emit()}},{key:"_getOverlayConfig",value:function(){var e;return new wp({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir,panelClass:null===(e=this._defaults)||void 0===e?void 0:e.overlayPanelClass})}},{key:"_getOverlayPosition",value:function(){var e=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(e),this._positionStrategy=e,e}},{key:"_setStrategyPositions",value:function(e){var t,n=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],i=this._aboveClass,r=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}];t="above"===this.position?r:"below"===this.position?n:[].concat(n,r),e.withPositions(t)}},{key:"_getConnectedElement",value:function(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}},{key:"_getPanelWidth",value:function(){return this.autocomplete.panelWidth||this._getHostWidth()}},{key:"_getHostWidth",value:function(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}},{key:"_resetActiveItem",value:function(){var e=this.autocomplete;e.autoActiveFirstOption?e._keyManager.setFirstItemActive():e._keyManager.setActiveItem(-1)}},{key:"_canOpen",value:function(){var e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this._autocompleteDisabled}},{key:"_getWindow",value:function(){var e;return(null===(e=this._document)||void 0===e?void 0:e.defaultView)||window}},{key:"_scrollToOption",value:function(e){var t=this.autocomplete,n=yb(e,t.options,t.optionGroups);if(0===e&&1===n)t._setScrollTop(0);else if(t.panel){var i=t.options.toArray()[e];if(i){var r=i._getHostElement(),o=bb(r.offsetTop,r.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(o)}}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Hp),Es(Mc),Es(Vl),Es(wc),Es(nU),Es(zd,8),Es(Vz,9),Es(fh,8),Es(qd),Es(Jz,8))},e.\u0275dir=It({type:e,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[Gt]}),e}(),aU=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments))._aboveClass="mat-autocomplete-panel-above",e}return n}(oU);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(e,t){1&e&&Fs("focusin",function(){return t._handleFocus()})("blur",function(){return t._onTouched()})("input",function(e){return t._handleInput(e)})("keydown",function(e){return t._handleKeydown(e)}),2&e&&_s("autocomplete",t.autocompleteAttribute)("role",t.autocompleteDisabled?null:"combobox")("aria-autocomplete",t.autocompleteDisabled?null:"list")("aria-activedescendant",t.panelOpen&&t.activeOption?t.activeOption.id:null)("aria-expanded",t.autocompleteDisabled?null:t.panelOpen.toString())("aria-owns",t.autocompleteDisabled||!t.panelOpen||null==t.autocomplete?null:t.autocomplete.id)("aria-haspopup",!t.autocompleteDisabled)},exportAs:["matAutocompleteTrigger"],features:[Hu([rU]),ss]}),t}(),sU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[iU],imports:[[Kp,_b,Wy,Kh],Xd,_b,Wy]}),e}(),uU=Ld({passive:!0}),cU=function(){var e=function(){function e(t,n){m(this,e),this._platform=t,this._ngZone=n,this._monitoredElements=new Map}return b(e,[{key:"monitor",value:function(e){var t=this;if(!this._platform.isBrowser)return md;var n=Lf(e),i=this._monitoredElements.get(n);if(i)return i.subject;var r=new oe,o="cdk-text-field-autofilled",a=function(e){"cdk-text-field-autofill-start"!==e.animationName||n.classList.contains(o)?"cdk-text-field-autofill-end"===e.animationName&&n.classList.contains(o)&&(n.classList.remove(o),t._ngZone.run(function(){return r.next({target:e.target,isAutofilled:!1})})):(n.classList.add(o),t._ngZone.run(function(){return r.next({target:e.target,isAutofilled:!0})}))};return this._ngZone.runOutsideAngular(function(){n.addEventListener("animationstart",a,uU),n.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(n,{subject:r,unlisten:function(){n.removeEventListener("animationstart",a,uU)}}),r}},{key:"stopMonitoring",value:function(e){var t=Lf(e),n=this._monitoredElements.get(t);n&&(n.unlisten(),n.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))}},{key:"ngOnDestroy",value:function(){var e=this;this._monitoredElements.forEach(function(t,n){return e.stopMonitoring(n)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Id),Qi(Vl))},e.\u0275prov=Ke({factory:function(){return new e(Qi(Id),Qi(Vl))},token:e,providedIn:"root"}),e}(),lU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Rd]]}),e}(),hU=new Mi("MAT_INPUT_VALUE_ACCESSOR"),fU=["button","checkbox","file","hidden","image","radio","range","reset","submit"],dU=0,pU=Qy(function(){return function e(t,n,i,r){m(this,e),this._defaultErrorStateMatcher=t,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}}()),vU=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c,l,h){var f;m(this,n),(f=t.call(this,s,o,a,r))._elementRef=e,f._platform=i,f._autofillMonitor=c,f._formField=h,f._uid="mat-input-"+dU++,f.focused=!1,f.stateChanges=new oe,f.controlType="mat-input",f.autofilled=!1,f._disabled=!1,f._required=!1,f._type="text",f._readonly=!1,f._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(function(e){return Nd().has(e)});var d=f._elementRef.nativeElement,p=d.nodeName.toLowerCase();return f._inputValueAccessor=u||d,f._previousNativeValue=f.value,f.id=f.id,i.IOS&&l.runOutsideAngular(function(){e.nativeElement.addEventListener("keyup",function(e){var t=e.target;!t.value&&0===t.selectionStart&&0===t.selectionEnd&&(t.setSelectionRange(1,1),t.setSelectionRange(0,0))})}),f._isServer=!f._platform.isBrowser,f._isNativeSelect="select"===p,f._isTextarea="textarea"===p,f._isInFormField=!!h,f._isNativeSelect&&(f.controlType=d.multiple?"mat-native-select-multiple":"mat-native-select"),f}return b(n,[{key:"disabled",get:function(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled},set:function(e){this._disabled=If(e),this.focused&&(this.focused=!1,this.stateChanges.next())}},{key:"id",get:function(){return this._id},set:function(e){this._id=e||this._uid}},{key:"required",get:function(){return this._required},set:function(e){this._required=If(e)}},{key:"type",get:function(){return this._type},set:function(e){this._type=e||"text",this._validateType(),!this._isTextarea&&Nd().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}},{key:"value",get:function(){return this._inputValueAccessor.value},set:function(e){e!==this.value&&(this._inputValueAccessor.value=e,this.stateChanges.next())}},{key:"readonly",get:function(){return this._readonly},set:function(e){this._readonly=If(e)}},{key:"ngAfterViewInit",value:function(){var e=this;this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(function(t){e.autofilled=t.isAutofilled,e.stateChanges.next()})}},{key:"ngOnChanges",value:function(){this.stateChanges.next()}},{key:"ngOnDestroy",value:function(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}},{key:"ngDoCheck",value:function(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}},{key:"focus",value:function(e){this._elementRef.nativeElement.focus(e)}},{key:"_focusChanged",value:function(e){e!==this.focused&&(this.focused=e,this.stateChanges.next())}},{key:"_onInput",value:function(){}},{key:"_dirtyCheckPlaceholder",value:function(){var e,t,n=(null===(t=null===(e=this._formField)||void 0===e?void 0:e._hideControlPlaceholder)||void 0===t?void 0:t.call(e))?null:this.placeholder;if(n!==this._previousPlaceholder){var i=this._elementRef.nativeElement;this._previousPlaceholder=n,n?i.setAttribute("placeholder",n):i.removeAttribute("placeholder")}}},{key:"_dirtyCheckNativeValue",value:function(){var e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}},{key:"_validateType",value:function(){fU.indexOf(this._type)}},{key:"_isNeverEmpty",value:function(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}},{key:"_isBadInput",value:function(){var e=this._elementRef.nativeElement.validity;return e&&e.badInput}},{key:"empty",get:function(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}},{key:"shouldLabelFloat",get:function(){if(this._isNativeSelect){var e=this._elementRef.nativeElement,t=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&t&&t.label)}return this.focused||!this.empty}},{key:"setDescribedByIds",value:function(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}},{key:"onContainerClick",value:function(){this.focused||this.focus()}}]),n}(pU);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Id),Es(EV,10),Es(JV,8),Es(az,8),Es($y),Es(hU,10),Es(cU),Es(Vl),Es(Vz,8))},e.\u0275dir=It({type:e,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(e,t){1&e&&Fs("focus",function(){return t._focusChanged(!0)})("blur",function(){return t._focusChanged(!1)})("input",function(){return t._onInput()}),2&e&&(Ou("disabled",t.disabled)("required",t.required),_s("id",t.id)("data-placeholder",t.placeholder)("readonly",t.readonly&&!t._isNativeSelect||null)("aria-invalid",t.empty&&t.required?null:t.errorState)("aria-required",t.required),su("mat-input-server",t._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[Hu([{provide:Pz,useExisting:e}]),ss,Gt]}),e}(),gU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[$y],imports:[[lU,Uz,Wy],lU,Uz]}),e}();function mU(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:this.value,t=new CU;return t.source=this,t.value=e,t}},{key:"_calculatePercentage",value:function(e){return((e||0)-this.min)/(this.max-this.min)}},{key:"_calculateValue",value:function(e){return this.min+e*(this.max-this.min)}},{key:"_clamp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.max(t,Math.min(e,n))}},{key:"_getSliderDimensions",value:function(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}},{key:"_focusHostElement",value:function(e){this._elementRef.nativeElement.focus(e)}},{key:"_blurHostElement",value:function(){this._elementRef.nativeElement.blur()}},{key:"writeValue",value:function(e){this.value=e}},{key:"registerOnChange",value:function(e){this._controlValueAccessorChangeFn=e}},{key:"registerOnTouched",value:function(e){this.onTouched=e}},{key:"setDisabledState",value:function(e){this.disabled=e}}]),n}(OU);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Wv),Es(wc),Es(zd,8),Ti("tabindex"),Es(Vl),Es(fh),Es(Ny,8))},e.\u0275cmp=Ct({type:e,selectors:[["mat-slider"]],viewQuery:function(e,t){var n;(1&e&&hl(xU,5),2&e)&&(ll(n=dl())&&(t._sliderWrapper=n.first))},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(e,t){1&e&&Fs("focus",function(){return t._onFocus()})("blur",function(){return t._onBlur()})("keydown",function(e){return t._onKeydown(e)})("keyup",function(){return t._onKeyup()})("mouseenter",function(){return t._onMouseenter()})("selectstart",function(e){return e.preventDefault()}),2&e&&(Ou("tabIndex",t.tabIndex),_s("aria-disabled",t.disabled)("aria-valuemax",t.max)("aria-valuemin",t.min)("aria-valuenow",t.value)("aria-valuetext",null==t.valueText?t.displayValue:t.valueText)("aria-orientation",t.vertical?"vertical":"horizontal"),su("mat-slider-disabled",t.disabled)("mat-slider-has-ticks",t.tickInterval)("mat-slider-horizontal",!t.vertical)("mat-slider-axis-inverted",t._shouldInvertAxis())("mat-slider-invert-mouse-coords",t._shouldInvertMouseCoords())("mat-slider-sliding",t._isSliding)("mat-slider-thumb-label-showing",t.thumbLabel)("mat-slider-vertical",t.vertical)("mat-slider-min-value",t._isMinValue())("mat-slider-hide-last-tick",t.disabled||t._isMinValue()&&t._getThumbGap()&&t._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===t._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[Hu([EU]),ss],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(e,t){1&e&&(Ts(0,"div",0,1),Ts(2,"div",2),Ps(3,"div",3),Ps(4,"div",4),As(),Ts(5,"div",5),Ps(6,"div",6),As(),Ts(7,"div",7),Ps(8,"div",8),Ps(9,"div",9),Ts(10,"div",10),Ts(11,"span",11),ku(12),As(),As(),As(),As()),2&e&&(qo(3),Cs("ngStyle",t._getTrackBackgroundStyles()),qo(1),Cs("ngStyle",t._getTrackFillStyles()),qo(1),Cs("ngStyle",t._getTicksContainerStyles()),qo(1),Cs("ngStyle",t._getTicksStyles()),qo(1),Cs("ngStyle",t._getThumbContainerStyles()),qo(5),xu(t.displayValue))},directives:[Hh],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),e}();function AU(e){return"t"===e.type[0]}function PU(e,t){var n;return(n=AU(e)?"number"==typeof t?MU(e.touches,t)||MU(e.changedTouches,t):e.touches[0]||e.changedTouches[0]:e)?{x:n.clientX,y:n.clientY}:void 0}function MU(e,t){for(var n=0;n enter",tg("150ms cubic-bezier(0, 0, 0.2, 1)",ig({transform:"none",opacity:1}))),og("* => void, * => exit",tg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ig({opacity:0})))])},LU=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s){var u;return m(this,n),(u=t.call(this))._elementRef=e,u._focusTrapFactory=i,u._changeDetectorRef=r,u._config=a,u._focusMonitor=s,u._animationStateChanged=new Zc,u._elementFocusedBeforeDialogWasOpened=null,u._closeInteractionType=null,u.attachDomPortal=function(e){return u._portalOutlet.hasAttached(),u._portalOutlet.attachDomPortal(e)},u._ariaLabelledBy=a.ariaLabelledBy||null,u._document=o,u}return b(n,[{key:"_initializeWithAttachedContent",value:function(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}},{key:"attachComponentPortal",value:function(e){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(e)}},{key:"attachTemplatePortal",value:function(e){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(e)}},{key:"_recaptureFocus",value:function(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}},{key:"_trapFocus",value:function(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}},{key:"_restoreFocus",value:function(){var e=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&e&&"function"==typeof e.focus){var t=Fd(),n=this._elementRef.nativeElement;(!t||t===this._document.body||t===n||n.contains(t))&&(this._focusMonitor?(this._focusMonitor.focusVia(e,this._closeInteractionType),this._closeInteractionType=null):e.focus())}this._focusTrap&&this._focusTrap.destroy()}},{key:"_setupFocusTrap",value:function(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}},{key:"_capturePreviouslyFocusedElement",value:function(){this._document&&(this._elementFocusedBeforeDialogWasOpened=Fd())}},{key:"_focusDialogContainer",value:function(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}},{key:"_containsFocus",value:function(){var e=this._elementRef.nativeElement,t=Fd();return e===t||e.contains(t)}}]),n}(Jd);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Rv),Es(wc),Es(fh,8),Es(DU),Es(Wv))},e.\u0275dir=It({type:e,viewQuery:function(e,t){var n;(1&e&&hl(ip,7),2&e)&&(ll(n=dl())&&(t._portalOutlet=n.first))},features:[ss]}),e}(),jU=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments))._state="enter",e}return b(n,[{key:"_onAnimationDone",value:function(e){var t=e.toState,n=e.totalTime;"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:n})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:n}))}},{key:"_onAnimationStart",value:function(e){var t=e.toState,n=e.totalTime;"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:n}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:n})}},{key:"_startExitAnimation",value:function(){this._state="exit",this._changeDetectorRef.markForCheck()}}]),n}(LU);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275cmp=Ct({type:t,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(e,t){1&e&&Bs("@dialogContainer.start",function(e){return t._onAnimationStart(e)})("@dialogContainer.done",function(e){return t._onAnimationDone(e)}),2&e&&(Ou("id",t._id),_s("role",t._config.role)("aria-labelledby",t._config.ariaLabel?null:t._ariaLabelledBy)("aria-label",t._config.ariaLabel)("aria-describedby",t._config.ariaDescribedBy||null),Tu("@dialogContainer",t._state))},features:[ss],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(e,t){1&e&&xs(0,RU,0,0,"ng-template",0)},directives:[ip],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[NU.dialogContainer]}}),t}(),FU=0,BU=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mat-dialog-"+FU++;m(this,e),this._overlayRef=t,this._containerInstance=n,this.id=r,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new oe,this._afterClosed=new oe,this._beforeClosed=new oe,this._state=0,n._id=r,n._animationStateChanged.pipe(od(function(e){return"opened"===e.state}),ap(1)).subscribe(function(){i._afterOpened.next(),i._afterOpened.complete()}),n._animationStateChanged.pipe(od(function(e){return"closed"===e.state}),ap(1)).subscribe(function(){clearTimeout(i._closeFallbackTimeout),i._finishDialogClose()}),t.detachments().subscribe(function(){i._beforeClosed.next(i._result),i._beforeClosed.complete(),i._afterClosed.next(i._result),i._afterClosed.complete(),i.componentInstance=null,i._overlayRef.dispose()}),t.keydownEvents().pipe(od(function(e){return 27===e.keyCode&&!i.disableClose&&!fp(e)})).subscribe(function(e){e.preventDefault(),VU(i,"keyboard")}),t.backdropClick().subscribe(function(){i.disableClose?i._containerInstance._recaptureFocus():VU(i,"mouse")})}return b(e,[{key:"close",value:function(e){var t=this;this._result=e,this._containerInstance._animationStateChanged.pipe(od(function(e){return"closing"===e.state}),ap(1)).subscribe(function(n){t._beforeClosed.next(e),t._beforeClosed.complete(),t._overlayRef.detachBackdrop(),t._closeFallbackTimeout=setTimeout(function(){return t._finishDialogClose()},n.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}},{key:"afterOpened",value:function(){return this._afterOpened}},{key:"afterClosed",value:function(){return this._afterClosed}},{key:"beforeClosed",value:function(){return this._beforeClosed}},{key:"backdropClick",value:function(){return this._overlayRef.backdropClick()}},{key:"keydownEvents",value:function(){return this._overlayRef.keydownEvents()}},{key:"updatePosition",value:function(e){var t=this._getPositionStrategy();return e&&(e.left||e.right)?e.left?t.left(e.left):t.right(e.right):t.centerHorizontally(),e&&(e.top||e.bottom)?e.top?t.top(e.top):t.bottom(e.bottom):t.centerVertically(),this._overlayRef.updatePosition(),this}},{key:"updateSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}},{key:"addPanelClass",value:function(e){return this._overlayRef.addPanelClass(e),this}},{key:"removePanelClass",value:function(e){return this._overlayRef.removePanelClass(e),this}},{key:"getState",value:function(){return this._state}},{key:"_finishDialogClose",value:function(){this._state=2,this._overlayRef.dispose()}},{key:"_getPositionStrategy",value:function(){return this._overlayRef.getConfig().positionStrategy}}]),e}();function VU(e,t,n){return void 0!==e._containerInstance&&(e._containerInstance._closeInteractionType=t),e.close(n)}var zU=new Mi("MatDialogData"),UU=new Mi("mat-dialog-default-options"),HU=new Mi("mat-dialog-scroll-strategy"),GU={provide:HU,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.block()}}},WU=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c){var l=this;m(this,e),this._overlay=t,this._injector=n,this._defaultOptions=i,this._parentDialog=r,this._overlayContainer=o,this._dialogRefConstructor=s,this._dialogContainerType=u,this._dialogDataToken=c,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new oe,this._afterOpenedAtThisLevel=new oe,this._ariaHiddenElements=new Map,this.afterAllClosed=lz(function(){return l.openDialogs.length?l._getAfterAllClosed():l._getAfterAllClosed().pipe(fd(void 0))}),this._scrollStrategy=a}return b(e,[{key:"openDialogs",get:function(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}},{key:"afterOpened",get:function(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}},{key:"_getAfterAllClosed",value:function(){var e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}},{key:"open",value:function(e,t){var n=this;(t=function(e,t){return Object.assign(Object.assign({},t),e)}(t,this._defaultOptions||new DU)).id&&this.getDialogById(t.id);var i=this._createOverlay(t),r=this._attachDialogContainer(i,t),o=this._attachDialogContent(e,r,i,t);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(function(){return n._removeOpenDialog(o)}),this.afterOpened.next(o),r._initializeWithAttachedContent(),o}},{key:"closeAll",value:function(){this._closeDialogs(this.openDialogs)}},{key:"getDialogById",value:function(e){return this.openDialogs.find(function(t){return t.id===e})}},{key:"ngOnDestroy",value:function(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}},{key:"_createOverlay",value:function(e){var t=this._getOverlayConfig(e);return this._overlay.create(t)}},{key:"_getOverlayConfig",value:function(e){var t=new wp({positionStrategy:this._overlay.position().global(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,disposeOnNavigation:e.closeOnNavigation});return e.backdropClass&&(t.backdropClass=e.backdropClass),t}},{key:"_attachDialogContainer",value:function(e,t){var n=os.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:DU,useValue:t}]}),i=new Qd(this._dialogContainerType,t.viewContainerRef,n,t.componentFactoryResolver);return e.attach(i).instance}},{key:"_attachDialogContent",value:function(e,t,n,i){var r=new this._dialogRefConstructor(n,t,i.id);if(e instanceof Cc)t.attachTemplatePortal(new $d(e,null,{$implicit:i.data,dialogRef:r}));else{var o=this._createInjector(i,r,t),a=t.attachComponentPortal(new Qd(e,i.viewContainerRef,o));r.componentInstance=a.instance}return r.updateSize(i.width,i.height).updatePosition(i.position),r}},{key:"_createInjector",value:function(e,t,n){var i=e&&e.viewContainerRef&&e.viewContainerRef.injector,r=[{provide:this._dialogContainerType,useValue:n},{provide:this._dialogDataToken,useValue:e.data},{provide:this._dialogRefConstructor,useValue:t}];return e.direction&&(!i||!i.get(zd,null,ot.Optional))&&r.push({provide:zd,useValue:{value:e.direction,change:jf()}}),os.create({parent:i||this._injector,providers:r})}},{key:"_removeOpenDialog",value:function(e){var t=this.openDialogs.indexOf(e);t>-1&&(this.openDialogs.splice(t,1),this.openDialogs.length||(this._ariaHiddenElements.forEach(function(e,t){e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}},{key:"_hideNonDialogContentFromAssistiveTechnology",value:function(){var e=this._overlayContainer.getContainerElement();if(e.parentElement)for(var t=e.parentElement.children,n=t.length-1;n>-1;n--){var i=t[n];i!==e&&"SCRIPT"!==i.nodeName&&"STYLE"!==i.nodeName&&!i.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(i,i.getAttribute("aria-hidden")),i.setAttribute("aria-hidden","true"))}}},{key:"_closeDialogs",value:function(e){for(var t=e.length;t--;)e[t].close()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(os),Es(void 0),Es(void 0),Es(Ap),Es(void 0),Es(Ii),Es(Ii),Es(Mi))},e.\u0275dir=It({type:e}),e}(),qU=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u){return m(this,n),t.call(this,e,i,o,s,u,a,BU,jU,zU)}return n}(WU);return e.\u0275fac=function(t){return new(t||e)(Qi(Hp),Qi(os),Qi(Eh,8),Qi(UU,8),Qi(HU),Qi(e,12),Qi(Ap))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),XU=0,YU=function(){var e=function(){function e(t,n,i){m(this,e),this._dialogRef=t,this._elementRef=n,this._dialog=i,this.id="mat-dialog-title-"+XU++}return b(e,[{key:"ngOnInit",value:function(){var e=this;this._dialogRef||(this._dialogRef=function(e,t){for(var n=e.nativeElement.parentElement;n&&!n.classList.contains("mat-dialog-container");)n=n.parentElement;return n?t.find(function(e){return e.id===n.id}):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(function(){var t=e._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=e.id)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(BU,8),Es(Ku),Es(qU))},e.\u0275dir=It({type:e,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(e,t){2&e&&Ou("id",t.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),e}(),KU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),e}(),QU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[qU,GU],imports:[[Kp,rp,Wy],Wy]}),e}(),$U=new Mi("CdkAccordion"),ZU=0,JU=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this.accordion=t,this._changeDetectorRef=n,this._expansionDispatcher=i,this._openCloseAllSubscription=W.EMPTY,this.closed=new Zc,this.opened=new Zc,this.destroyed=new Zc,this.expandedChange=new Zc,this.id="cdk-accordion-child-"+ZU++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=function(){},this._removeUniqueSelectionListener=i.listen(function(e,t){r.accordion&&!r.accordion.multi&&r.accordion.id===t&&r.id!==e&&(r.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}return b(e,[{key:"expanded",get:function(){return this._expanded},set:function(e){e=If(e),this._expanded!==e&&(this._expanded=e,this.expandedChange.emit(e),e?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=If(e)}},{key:"ngOnDestroy",value:function(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}},{key:"toggle",value:function(){this.disabled||(this.expanded=!this.expanded)}},{key:"close",value:function(){this.disabled||(this.expanded=!1)}},{key:"open",value:function(){this.disabled||(this.expanded=!0)}},{key:"_subscribeToOpenCloseAllActions",value:function(){var e=this;return this.accordion._openCloseAllActions.subscribe(function(t){e.disabled||(e.expanded=t)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es($U,12),Es(wc),Es(Gd))},e.\u0275dir=It({type:e,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Hu([{provide:$U,useValue:void 0}])]}),e}(),eH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),tH=["body"];function nH(e,t){}var iH=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],rH=["mat-expansion-panel-header","*","mat-action-row"];function oH(e,t){1&e&&Ps(0,"span",2),2&e&&Cs("@indicatorRotate",Hs()._getExpandedState())}var aH=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],sH=["mat-panel-title","mat-panel-description","*"],uH=new Mi("MAT_ACCORDION"),cH="225ms cubic-bezier(0.4,0.0,0.2,1)",lH={indicatorRotate:eg("indicatorRotate",[rg("collapsed, void",ig({transform:"rotate(0deg)"})),rg("expanded",ig({transform:"rotate(180deg)"})),og("expanded <=> collapsed, void => collapsed",tg(cH))]),bodyExpansion:eg("bodyExpansion",[rg("collapsed, void",ig({height:"0px",visibility:"hidden"})),rg("expanded",ig({height:"*",visibility:"visible"})),og("expanded <=> collapsed, void => collapsed",tg(cH))])},hH=function(){var e=function e(t){m(this,e),this._template=t};return e.\u0275fac=function(t){return new(t||e)(Es(Cc))},e.\u0275dir=It({type:e,selectors:[["ng-template","matExpansionPanelContent",""]]}),e}(),fH=0,dH=new Mi("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),pH=function(){var t=function(t){a(i,t);var n=s(i);function i(e,t,r,o,a,s,u){var c;return m(this,i),(c=n.call(this,e,t,r))._viewContainerRef=o,c._animationMode=s,c._hideToggle=!1,c.afterExpand=new Zc,c.afterCollapse=new Zc,c._inputChanges=new oe,c._headerId="mat-expansion-panel-header-"+fH++,c._bodyAnimationDone=new oe,c.accordion=e,c._document=a,c._bodyAnimationDone.pipe(Qf(function(e,t){return e.fromState===t.fromState&&e.toState===t.toState})).subscribe(function(e){"void"!==e.fromState&&("expanded"===e.toState?c.afterExpand.emit():"collapsed"===e.toState&&c.afterCollapse.emit())}),u&&(c.hideToggle=u.hideToggle),c}return b(i,[{key:"hideToggle",get:function(){return this._hideToggle||this.accordion&&this.accordion.hideToggle},set:function(e){this._hideToggle=If(e)}},{key:"togglePosition",get:function(){return this._togglePosition||this.accordion&&this.accordion.togglePosition},set:function(e){this._togglePosition=e}},{key:"_hasSpacing",value:function(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}},{key:"_getExpandedState",value:function(){return this.expanded?"expanded":"collapsed"}},{key:"toggle",value:function(){this.expanded=!this.expanded}},{key:"close",value:function(){this.expanded=!1}},{key:"open",value:function(){this.expanded=!0}},{key:"ngAfterContentInit",value:function(){var e=this;this._lazyContent&&this.opened.pipe(fd(null),od(function(){return e.expanded&&!e._portal}),ap(1)).subscribe(function(){e._portal=new $d(e._lazyContent._template,e._viewContainerRef)})}},{key:"ngOnChanges",value:function(e){this._inputChanges.next(e)}},{key:"ngOnDestroy",value:function(){e(p(i.prototype),"ngOnDestroy",this).call(this),this._bodyAnimationDone.complete(),this._inputChanges.complete()}},{key:"_containsFocus",value:function(){if(this._body){var e=this._document.activeElement,t=this._body.nativeElement;return e===t||t.contains(e)}return!1}}]),i}(JU);return t.\u0275fac=function(e){return new(e||t)(Es(uH,12),Es(wc),Es(Gd),Es(Mc),Es(fh),Es(Ny,8),Es(dH,8))},t.\u0275cmp=Ct({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,hH,5),2&e)&&(ll(i=dl())&&(t._lazyContent=i.first))},viewQuery:function(e,t){var n;(1&e&&hl(tH,5),2&e)&&(ll(n=dl())&&(t._body=n.first))},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(e,t){2&e&&su("mat-expanded",t.expanded)("_mat-animation-noopable","NoopAnimations"===t._animationMode)("mat-expansion-panel-spacing",t._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Hu([{provide:uH,useValue:void 0}]),ss,Gt],ngContentSelectors:rH,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(e,t){1&e&&(Ws(iH),qs(0),Ts(1,"div",0,1),Fs("@bodyExpansion.done",function(e){return t._bodyAnimationDone.next(e)}),Ts(3,"div",2),qs(4,1),xs(5,nH,0,0,"ng-template",3),As(),qs(6,2),As()),2&e&&(qo(1),Cs("@bodyExpansion",t._getExpandedState())("id",t.id),_s("aria-labelledby",t._headerId),qo(4),Cs("cdkPortalOutlet",t._portal))},directives:[ip],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[lH.bodyExpansion]},changeDetection:0}),t}(),vH=Ky(function e(){m(this,e)}),gH=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u){var c;m(this,n),(c=t.call(this)).panel=e,c._element=i,c._focusMonitor=r,c._changeDetectorRef=o,c._animationMode=s,c._parentChangeSubscription=W.EMPTY;var l=e.accordion?e.accordion._stateChanges.pipe(od(function(e){return!(!e.hideToggle&&!e.togglePosition)})):md;return c.tabIndex=parseInt(u||"")||0,c._parentChangeSubscription=Ce(e.opened,e.closed,l,e._inputChanges.pipe(od(function(e){return!!(e.hideToggle||e.disabled||e.togglePosition)}))).subscribe(function(){return c._changeDetectorRef.markForCheck()}),e.closed.pipe(od(function(){return e._containsFocus()})).subscribe(function(){return r.focusVia(i,"program")}),a&&(c.expandedHeight=a.expandedHeight,c.collapsedHeight=a.collapsedHeight),c}return b(n,[{key:"disabled",get:function(){return this.panel.disabled}},{key:"_toggle",value:function(){this.disabled||this.panel.toggle()}},{key:"_isExpanded",value:function(){return this.panel.expanded}},{key:"_getExpandedState",value:function(){return this.panel._getExpandedState()}},{key:"_getPanelId",value:function(){return this.panel.id}},{key:"_getTogglePosition",value:function(){return this.panel.togglePosition}},{key:"_showToggle",value:function(){return!this.panel.hideToggle&&!this.panel.disabled}},{key:"_getHeaderHeight",value:function(){var e=this._isExpanded();return e&&this.expandedHeight?this.expandedHeight:!e&&this.collapsedHeight?this.collapsedHeight:null}},{key:"_keydown",value:function(e){switch(e.keyCode){case 32:case 13:fp(e)||(e.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(e))}}},{key:"focus",value:function(e,t){e?this._focusMonitor.focusVia(this._element,e,t):this._element.nativeElement.focus(t)}},{key:"ngAfterViewInit",value:function(){var e=this;this._focusMonitor.monitor(this._element).subscribe(function(t){t&&e.panel.accordion&&e.panel.accordion._handleHeaderFocus(e)})}},{key:"ngOnDestroy",value:function(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}]),n}(vH);return e.\u0275fac=function(t){return new(t||e)(Es(pH,1),Es(Ku),Es(Wv),Es(wc),Es(dH,8),Es(Ny,8),Ti("tabindex"))},e.\u0275cmp=Ct({type:e,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(e,t){1&e&&Fs("click",function(){return t._toggle()})("keydown",function(e){return t._keydown(e)}),2&e&&(_s("id",t.panel._headerId)("tabindex",t.tabIndex)("aria-controls",t._getPanelId())("aria-expanded",t._isExpanded())("aria-disabled",t.panel.disabled),au("height",t._getHeaderHeight()),su("mat-expanded",t._isExpanded())("mat-expansion-toggle-indicator-after","after"===t._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===t._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===t._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ss],ngContentSelectors:sH,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(e,t){1&e&&(Ws(aH),Ts(0,"span",0),qs(1),qs(2,1),qs(3,2),As(),xs(4,oH,1,1,"span",1)),2&e&&(qo(4),Cs("ngIf",t._showToggle()))},directives:[Lh],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[lH.indicatorRotate]},changeDetection:0}),e}(),mH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,Wy,eH,rp]]}),e}(),yH=r(5478);Object.create(Error.prototype);var bH=["*"],_H=(function(e){e.LineHighlight="line-highlight",e.LineNumbers="line-numbers"}(_H||(_H={})),_H),wH=function e(){m(this,e)},kH=new Mi("SECURITY_CONTEXT"),xH=function(){var e=function(){function e(t,n,i,r,o){m(this,e),this.platform=t,this.securityContext=n,this.http=i,this.sanitizer=o,this.initialMarkedOptions={renderer:new yH.Renderer},this.options=r}return b(e,[{key:"options",get:function(){return this._options},set:function(e){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),e)}},{key:"renderer",get:function(){return this.options.renderer},set:function(e){this.options.renderer=e}},{key:"compile",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.options,r=this.trimIndentation(e),o=t?this.decodeHtml(r):r,a=n?this.renderEmoji(o):o,s=yH.parse(a,i);return this.sanitizer.sanitize(this.securityContext,s)||""}},{key:"getSource",value:function(e){var t=this;if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(e,{responseType:"text"}).pipe(ue(function(n){return t.handleExtension(e,n)}))}},{key:"highlight",value:function(e){if($h(this.platform)&&"undefined"!=typeof Prism){e||(e=document);var t=e.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(t,function(e){return e.classList.add("language-none")}),Prism.highlightAllUnder(e)}}},{key:"renderKatex",value:function(e,t){if(!$h(this.platform))return e;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return e.replace(/\$([^\s][^$]*?[^\s])\$/gm,function(e,n){return katex.renderToString(n,t)})}},{key:"decodeHtml",value:function(e){if(!$h(this.platform))return e;var t=document.createElement("textarea");return t.innerHTML=e,t.value}},{key:"handleExtension",value:function(e,t){var n=e?e.split("?")[0].split(".").splice(-1).join():"";return"md"!==n?"```"+n+"\n"+t+"\n```":t}},{key:"renderEmoji",value:function(e){if(!$h(this.platform))return e;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(e)}},{key:"trimIndentation",value:function(e){return e?e.split("\n").map(function(e){var n=t;return e.length>0&&(n=isNaN(n)?e.search(/\S|$/):Math.min(e.search(/\S|$/),n)),isNaN(t)&&(t=n),n?e.substring(n):e}).join("\n"):"";var t}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Sl),Qi(kH),Qi(Kb,8),Qi(wH,8),Qi(Of))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),SH=function(){var e=function(){function e(t,n){m(this,e),this.element=t,this.markdownService=n,this.error=new Zc,this.load=new Zc,this.ready=new Zc,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}return b(e,[{key:"emoji",get:function(){return this._emoji},set:function(e){this._emoji=this.coerceBooleanProperty(e)}},{key:"katex",get:function(){return this._katex},set:function(e){this._katex=this.coerceBooleanProperty(e)}},{key:"lineHighlight",get:function(){return this._lineHighlight},set:function(e){this._lineHighlight=this.coerceBooleanProperty(e)}},{key:"lineNumbers",get:function(){return this._lineNumbers},set:function(e){this._lineNumbers=this.coerceBooleanProperty(e)}},{key:"ngOnChanges",value:function(){null==this.data?null==this.src||this.handleSrc():this.handleData()}},{key:"ngAfterViewInit",value:function(){!this.data&&!this.src&&this.handleTransclusion()}},{key:"render",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.markdownService.compile(e,t,this.emoji);n=this.katex?this.markdownService.renderKatex(n,this.katexOptions):n,this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}},{key:"coerceBooleanProperty",value:function(e){return null!=e&&"false"!="".concat(String(e))}},{key:"handleData",value:function(){this.render(this.data)}},{key:"handleSrc",value:function(){var e=this;this.markdownService.getSource(this.src).subscribe(function(t){e.render(t),e.load.emit(t)},function(t){return e.error.emit(t)})}},{key:"handleTransclusion",value:function(){this.render(this.element.nativeElement.innerHTML,!0)}},{key:"handlePlugins",value:function(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,_H.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}},{key:"setPluginClass",value:function(e,t){for(var n=e.querySelectorAll("pre"),i=0;i0){var r=i.indexOf(n);-1!==r&&i.splice(r,1)}}},{key:"notifyComplete",value:function(){}},{key:"_next",value:function(e){if(0===this.toRespond.length){var t=[e].concat(v(this.values));this.project?this._tryProject(t):this.destination.next(t)}}},{key:"_tryProject",value:function(e){var t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}]),n}(R_),PH=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];m(this,e),this.accumulator=t,this.seed=n,this.hasSeed=i}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new MH(e,this.accumulator,this.seed,this.hasSeed))}}]),e}(),MH=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;return m(this,n),(a=t.call(this,e)).accumulator=i,a._seed=r,a.hasSeed=o,a.index=0,a}return b(n,[{key:"seed",get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e}},{key:"_next",value:function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}},{key:"_tryNext",value:function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(i){this.destination.error(i)}this.seed=t,this.destination.next(t)}}]),n}(Y),IH=function(){function e(t){m(this,e),this.predicate=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new RH(e,this.predicate))}}]),e}(),RH=function(e){a(n,e);var t=s(n);function n(e,i){var r;return m(this,n),(r=t.call(this,e)).predicate=i,r.skipping=!0,r.index=0,r}return b(n,[{key:"_next",value:function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}},{key:"tryCallPredicate",value:function(e){try{var t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}]),n}(Y),DH=["youtubeContainer"],NH=function(){var e=function(){function e(t,n){m(this,e),this._ngZone=t,this._youtubeContainer=new oe,this._destroyed=new oe,this._playerChanges=new nv(void 0),this._videoId=new nv(void 0),this._height=new nv(390),this._width=new nv(640),this._startSeconds=new nv(void 0),this._endSeconds=new nv(void 0),this._suggestedQuality=new nv(void 0),this._playerVars=new nv(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=$h(n)}return b(e,[{key:"videoId",get:function(){return this._videoId.value},set:function(e){this._videoId.next(e)}},{key:"height",get:function(){return this._height.value},set:function(e){this._height.next(e||390)}},{key:"width",get:function(){return this._width.value},set:function(e){this._width.next(e||640)}},{key:"startSeconds",set:function(e){this._startSeconds.next(e)}},{key:"endSeconds",set:function(e){this._endSeconds.next(e)}},{key:"suggestedQuality",set:function(e){this._suggestedQuality.next(e)}},{key:"playerVars",get:function(){return this._playerVars.value},set:function(e){this._playerVars.next(e)}},{key:"ngOnInit",value:function(){var e=this;if(this._isBrowser){var n=jf(!0);if(!window.YT||!window.YT.Player){var i=new oe;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=function(){e._existingApiReadyCallback&&e._existingApiReadyCallback(),e._ngZone.run(function(){return i.next(!0)})},n=i.pipe(ap(1),fd(!1))}var r=function(e,n,i,r,o,a,s){var u=j_([n,a]).pipe(OH(j_([r,o])),ue(function(e){var n=t(e,2),i=n[0],r=n[1],o=t(i,2),a=o[0],s=o[1],u=t(r,2),c=u[0],l=u[1];return a?{videoId:a,playerVars:s,width:c,height:l}:void 0}));return j_([e,u,jf(s)]).pipe(function(e){return Z(function(){for(var e=arguments.length,t=new Array(e),n=0;n=2&&(n=!0),function(i){return i.lift(new PH(e,t,n))}}(LH,void 0),Qf())}(this._youtubeContainer,this._videoId,n,this._width,this._height,this._playerVars,this._ngZone).pipe(rv(function(t){e._playerChanges.next(t)}),we(function(e){return e?jH(e)?jf(e):new ee(function(t){var n=!1,i=!1;return e.addEventListener("onReady",function e(r){i=!0,n||(r.target.removeEventListener("onReady",e),t.next(r.target))}),function(){n=!0,i||function(e){jH(e)||e.destroy()}(e)}}).pipe(ap(1),fd(void 0)):jf(void 0)}),ud(this._destroyed),Re(new oe));r.subscribe(function(t){e._player=t,t&&e._pendingPlayerState&&e._initializePlayer(t,e._pendingPlayerState),e._pendingPlayerState=void 0}),function(e,n,i){j_([e,n,i]).subscribe(function(e){var n=t(e,3),i=n[0],r=n[1],o=n[2];return i&&i.setSize(r,o)})}(r,this._width,this._height),function(e,n){j_([e,n]).subscribe(function(e){var n=t(e,2),i=n[0],r=n[1];return i&&r&&i.setPlaybackQuality(r)})}(r,this._suggestedQuality),function(e,n,i,r,o,a){var s=j_([i,r]).pipe(ue(function(e){var n=t(e,2);return{startSeconds:n[0],endSeconds:n[1]}})),u=s.pipe(FH(e,function(e){return!!e&&!function(e){var t=e.getPlayerState();return t!==YT.PlayerState.UNSTARTED&&t!==YT.PlayerState.CUED}(e)})),c=n.pipe(FH(e,function(e,t){return!!e&&e.videoId!==t}));Ce(e.pipe(FH(j_([n,s]),function(e,n){var i=t(e,2),r=i[0],o=i[1];return!(!n||r==n.videoId&&!o.startSeconds&&!o.endSeconds)})),c,u).pipe(OH(j_([e,n,s,o])),ue(function(e){var n=t(e,2);n[0];return n[1]}),ud(a)).subscribe(function(e){var n=t(e,4),i=n[0],r=n[1],o=n[2],a=n[3];!r||!i||(i.videoId=r,i.cueVideoById(Object.assign({videoId:r,suggestedQuality:a},o)))})}(r,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),r.connect()}}},{key:"createEventsBoundInZone",value:function(){return{}}},{key:"ngAfterViewInit",value:function(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}},{key:"ngOnDestroy",value:function(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}},{key:"playVideo",value:function(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}},{key:"pauseVideo",value:function(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}},{key:"stopVideo",value:function(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}},{key:"seekTo",value:function(e,t){this._player?this._player.seekTo(e,t):this._getPendingState().seek={seconds:e,allowSeekAhead:t}}},{key:"mute",value:function(){this._player?this._player.mute():this._getPendingState().muted=!0}},{key:"unMute",value:function(){this._player?this._player.unMute():this._getPendingState().muted=!1}},{key:"isMuted",value:function(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}},{key:"setVolume",value:function(e){this._player?this._player.setVolume(e):this._getPendingState().volume=e}},{key:"getVolume",value:function(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}},{key:"setPlaybackRate",value:function(e){if(this._player)return this._player.setPlaybackRate(e);this._getPendingState().playbackRate=e}},{key:"getPlaybackRate",value:function(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}},{key:"getAvailablePlaybackRates",value:function(){return this._player?this._player.getAvailablePlaybackRates():[]}},{key:"getVideoLoadedFraction",value:function(){return this._player?this._player.getVideoLoadedFraction():0}},{key:"getPlayerState",value:function(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}},{key:"getCurrentTime",value:function(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}},{key:"getPlaybackQuality",value:function(){return this._player?this._player.getPlaybackQuality():"default"}},{key:"getAvailableQualityLevels",value:function(){return this._player?this._player.getAvailableQualityLevels():[]}},{key:"getDuration",value:function(){return this._player?this._player.getDuration():0}},{key:"getVideoUrl",value:function(){return this._player?this._player.getVideoUrl():""}},{key:"getVideoEmbedCode",value:function(){return this._player?this._player.getVideoEmbedCode():""}},{key:"_getPendingState",value:function(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}},{key:"_initializePlayer",value:function(e,t){var n=t.playbackState,i=t.playbackRate,r=t.volume,o=t.muted,a=t.seek;switch(n){case YT.PlayerState.PLAYING:e.playVideo();break;case YT.PlayerState.PAUSED:e.pauseVideo();break;case YT.PlayerState.CUED:e.stopVideo()}null!=i&&e.setPlaybackRate(i),null!=r&&e.setVolume(r),null!=o&&(o?e.mute():e.unMute()),null!=a&&e.seekTo(a.seconds,a.allowSeekAhead)}},{key:"_getLazyEmitter",value:function(e){var t=this;return this._playerChanges.pipe(dd(function(t){return t?CH(function(n){t.addEventListener(e,n)},function(n){try{t.removeEventListener&&t.removeEventListener(e,n)}catch(i){}}):jf()}),function(e){return new ee(function(n){return e.subscribe({next:function(e){return t._ngZone.run(function(){return n.next(e)})},error:function(e){return n.error(e)},complete:function(){return n.complete()}})})},ud(this._destroyed))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Vl),Es(Sl))},e.\u0275cmp=Ct({type:e,selectors:[["youtube-player"]],viewQuery:function(e,t){var n;(1&e&&hl(DH,5),2&e)&&(ll(n=dl())&&(t.youtubeContainer=n.first))},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(e,t){1&e&&Ps(0,"div",null,0)},encapsulation:2,changeDetection:0}),e}();function LH(e,n){var i=t(n,3),r=i[0],o=i[1],a=i[2];if(e&&o&&e.playerVars!==o.playerVars)e.destroy();else{if(!o)return void(e&&e.destroy());if(e)return e}var s=a.runOutsideAngular(function(){return new YT.Player(r,o)});return s.videoId=o.videoId,s.playerVars=o.playerVars,s}function jH(e){return"getPlayerStatus"in e}function FH(e,n){return Z(OH(e),od(function(e){var i=t(e,2),r=i[0],o=i[1];return n(o,r)}),ue(function(e){return t(e,1)[0]}))}var BH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}();function VH(e){return!0===e}function zH(e){return null==e}function UH(e){return!zH(e)}function HH(e){return Boolean(e)}function GH(e){return zH(e)?e:JSON.parse(JSON.stringify(e))}var WH=function e(t){var n=t instanceof Date;if("object"!=typeof t||null===t||n)return t;Object.freeze(t);var i="function"==typeof t,r=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(function(n){r.call(t,n)&&(!i||"caller"!==n&&"callee"!==n&&"arguments"!==n)&&null!==t[n]&&("object"==typeof t[n]||"function"==typeof t[n])&&!Object.isFrozen(t[n])&&e(t[n])}),t};function qH(e){return UH(e)&&"object"==typeof e&&function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)}var XH="NGXS_DATA_META",YH="NGXS_META",KH="NGXS_ARGUMENT_REGISTRY_META",QH=function(){var e=function(){function e(t){var n=this;m(this,e),this.sequence$=new nv(0),this.subscription=null,t&&(this.subscription=t.subscribe(function(){return n.updateSequence()}))}return b(e,[{key:"sequenceValue",get:function(){return this.sequence$.getValue()}},{key:"ngOnDestroy",value:function(){var e;this.sequence$.next(0),null===(e=this.subscription)||void 0===e||e.unsubscribe()}},{key:"updateSequence",value:function(){this.sequence$.next(this.sequenceValue+1)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(qB,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}();function $H(e){return e[XH]}var ZH=function(){var e=function e(t,n,i){m(this,e),e.store=t.get(qB),e.ngZone=t.get(Vl),e.factory=n,e.context=i,e.computed=t.get(QH)};return e.store=null,e.computed=null,e.context=null,e.factory=null,e.ngZone=null,e.\u0275prov=Ke({token:e,factory:e.\u0275fac=function(t){return new(t||e)(Qi(os),Qi(WF),Qi(GF))}}),e}(),JH=function(){function e(){m(this,e),e.statesCachedMeta.clear()}return b(e,null,[{key:"createStateContext",value:function(e){return ZH.context.createStateContext(e)}},{key:"ensureMappedState",value:function(t){if(zH(ZH.factory)||zH(t))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(UH(t.name)?e.statesCachedMeta.get(t.name):null)||e.ensureMeta(t)}},{key:"getRepositoryByInstance",value:function(t){var n,i=null!==(n=$H(e.getStateClassByInstance(t)))&&void 0!==n?n:null;if(zH(i))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return i}},{key:"getStateClassByInstance",value:function(e){return(null!=e?e:{}).constructor}},{key:"clearMetaByInstance",value:function(t){var n=e.getRepositoryByInstance(t);n.stateMeta.actions={},n.operations={}}},{key:"createPayload",value:function(e,t){for(var n={},i=Array.from(e),r=0;r0?n:null}},{key:"createAction",value:function(t,n,i){var r=e.createPayload(n,i);return new(function(e){return function(){function t(e){var n=this;m(this,t),e&&Object.keys(e).forEach(function(t){n[t]=e[t]})}return b(t,null,[{key:"type",get:function(){return e}}]),t}()}(t.type))(r)}},{key:"ensureMeta",value:function(t){var n,i=UH(t.name)?null===(n=ZH.factory.states)||void 0===n?void 0:n.find(function(e){return e.name===t.name}):null;return UH(i)&&UH(t.name)&&e.statesCachedMeta.set(t.name,i),i}}]),e}();JH.statesCachedMeta=new Map,JH.\u0275fac=function(e){return new(e||JH)},JH.\u0275prov=Ke({token:JH,factory:JH.\u0275fac}),new Ed(1);var eG=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,"Child states can only be added to an object. Cannot convert ".concat(UH(null==e?void 0:e.constructor)?e.constructor.name:e," to PlainObject"))}return n}(l(Error));function tG(e){var t;return null!==(t=e.NGXS_OPTIONS_META)&&void 0!==t?t:{name:""}}function nG(e){var t,n=tG(e),i=null!==(t=n.children)&&void 0!==t?t:[],r=GH(void 0===n.defaults?{}:n.defaults);if(i.length){if(qH(r))return function(e,t){return t.reduce(function(e,t){var n=tG(t);if(function(e){var t="string"==typeof e?e.trim():e;return[void 0,null,NaN,"",1/0].includes(t)}(n.name))throw new Error("State name not provided in class");return e[n.name.toString()]=nG(t),e},null!=e?e:{})}(r,i);throw new eG(r)}return r}function iG(e){var t;return null!==(t=e.__NGXS_COMPUTED_OPTION__)&&void 0!==t?t:null}function rG(){var e,t;return null!==(t=null===(e=null==ZH?void 0:ZH.computed)||void 0===e?void 0:e.sequenceValue)&&void 0!==t?t:0}function oG(e){var t=!1;return Kf(e)&&(t=!0),t}function aG(e){return e[KH]}var sG=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this,"An argument with the name '".concat(e,"' already exists in the method '").concat(i,"'"))}return n}(l(Error)),uG=function(){function e(){m(this,e),this.payloadMap=new Map,this.argumentMap=new Map}return b(e,[{key:"getPayloadTypeByIndex",value:function(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}},{key:"getArgumentNameByIndex",value:function(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}},{key:"createPayloadType",value:function(e,t,n){this.checkDuplicateName(e,t),this.payloadMap.set(n,e),this.payloadMap.set(e,e)}},{key:"createArgumentName",value:function(e,t,n){this.checkDuplicateName(e,t),this.argumentMap.set(n,e),this.argumentMap.set(e,e)}},{key:"checkDuplicateName",value:function(e,t){if(HH(this.argumentMap.has(e))||HH(this.payloadMap.has(e)))throw new sG(e,t)}}]),e}();function cG(e){return Jl()?WH(e):e}function lG(e){return{enumerable:!0,configurable:!0,get:function(){var t=$H(e),n=JH.ensureMappedState(t.stateMeta);return JH.createStateContext(n)}}}function hG(e){if(!e)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},e),{getState:function(){return Jl()?WH(e.getState()):e.getState()},setState:function(t){e.setState(t)},patchState:function(t){e.patchState(t)}})}function fG(){return function(e,t,n){!function(e,t){if(!function(e,t){var n,i=e,r=!1;if(qH(i))for(;null!==i;){if(VH(null==i?void 0:i.hasOwnProperty(t))){r=!!(null===(n=Object.getOwnPropertyDescriptor(i,t))||void 0===n?void 0:n.get);break}i=Object.getPrototypeOf(i)}return r}(e,null==t?void 0:t.toString()))throw new Error("The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ".concat(t.toString(),"() { \n\t .. \n}"))}(e,t);var i=n.get;return n.get=function(){var e=function(e){return zH(iG(e))&&Object.defineProperties(e,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),iG(e)}(this),t=null==e?void 0:e.get(i);if(VH(null==t?void 0:t.isObservable))return null==t?void 0:t.value;if(zH(t)||t.sequenceId!==rG()){e.delete(i);for(var n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]?arguments[0]:dG;return function(t,n,i){!function(e,t){if(e.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===t)throw new Error("@DataAction() can only decorate a method implementation")}(t,i);var r=i.value,o=n.toString();return i.value=function(){for(var t=arguments.length,n=new Array(t),i=0;i0?Array.from(e).reduce(function(e,n){var i=t(n,2),r=i[0],o=i[1];return Object.defineProperty(e,r,{value:o,enumerable:!0})},{}):void 0}},{key:"gtag",value:function(){try{for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return{ngModule:e,providers:[{provide:_G,useValue:{trackingCode:t,initCommands:n,uri:i,enableTracing:r,nonce:o}},EG]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[]]}),e}(),OG=function(){var e=function(){function e(){m(this,e),this.consent="not-set",this.consentChange=new Ed(1),this.consentChange.next(this.consent)}return b(e,[{key:"ngOnDestroy",value:function(){this.consentChange.complete()}},{key:"setConsent",value:function(e){this.consent!==e&&(this.consent=e,this.consentChange.next(e))}},{key:"unsetConsent",value:function(){this.setConsent("not-set")}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),TG=function(){var e=function(){function e(t,n,i){var r=this,o=i.trackingCode;m(this,e),this.window=n,this.subscriptions=new W,this.token=o,this.subscriptions.add(t.consentChange.subscribe(function(e){return r.toggleGoogleAnalytics("rescinded"===e)}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"toggleGoogleAnalytics",value:function(e){this.window&&(this.window["ga-disable-".concat(this.token)]=e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(OG),Qi(wG),Qi(_G))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),AG=new Mi("Key under which consent is stored",{providedIn:"root",factory:function(){return"ALLOW_TELEMETRY"}}),PG=[OG,TG,function(){var e=function(){function e(t,n){var i=this;m(this,e),this.key=n,this.subscriptions=new W;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(function(e){return i.saveConsent(e)}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"loadConsent",value:function(){var e,t,n=null===(t=null===(e=this.storage)||void 0===e?void 0:e.getItem)||void 0===t?void 0:t.call(e,this.key);if(null==n)return"not-set";var i=n.trim().toLowerCase();switch(i){case"given":case"rescinded":return i;default:return"not-set"}}},{key:"saveConsent",value:function(e){var t,n;null===(n=null===(t=this.storage)||void 0===t?void 0:t.setItem)||void 0===n||n.call(t,this.key,e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(OG),Qi(AG))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}()];function MG(e){return Object.entries(e).reduce(function(e,n){var i=t(n,2),r=i[0],o=i[1];return null!=o&&(e[r]="".concat(o)),e},{})}var IG=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(t){var n=CG.forRoot(t.gaToken,function(e){return[{command:"set",values:[MG({appName:e.appName,projectName:e.projectName,developmentMode:e.developmentMode})]}]}(t)).providers;return{ngModule:e,providers:void 0===n?[]:n}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[].concat(PG,[{provide:yl,multi:!0,useFactory:function(){return function(){}},deps:PG}]),imports:[[CG]]}),e}(),RG=["bodyCanvas"],DG=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-body-ui",this.rotationChange=new Zc,this.nodeDrag=new Zc,this.nodeClick=new Zc,this.nodeHoverStart=new Zc,this.nodeHoverStop=new Zc,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}return b(e,[{key:"scene",get:function(){return this._scene},set:function(e){var t;this._scene=e,null===(t=this.bodyUI)||void 0===t||t.setScene(e)}},{key:"rotation",get:function(){return this._rotation},set:function(e){var t;this._rotation=e,null===(t=this.bodyUI)||void 0===t||t.setRotation(e)}},{key:"rotationX",get:function(){return this._rotationX},set:function(e){var t;this._rotationX=e,null===(t=this.bodyUI)||void 0===t||t.setRotationX(e)}},{key:"zoom",get:function(){return this._zoom},set:function(e){var t;this._zoom=e,null===(t=this.bodyUI)||void 0===t||t.setZoom(e)}},{key:"target",get:function(){return this._target},set:function(e){var t;this._target=e,null===(t=this.bodyUI)||void 0===t||t.setTarget(e)}},{key:"bounds",get:function(){return this._bounds},set:function(e){this._bounds=e,this.zoomToBounds(e)}},{key:"camera",get:function(){return this._camera},set:function(e){this._camera=e}},{key:"interactive",get:function(){return this._interactive},set:function(e){this._interactive=e,this.bodyUI&&this.recreateBodyUI()}},{key:"ngAfterViewInit",value:function(){this.setupBodyUI()}},{key:"zoomToBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:48,y:48};if(this.bodyCanvas){var n=this.bodyCanvas.nativeElement,i=n.width,r=n.height,o=window.devicePixelRatio,a=Math.min(Math.log2((i-t.x)/o/e.x),Math.log2((r-t.y)/o/e.y));this.zoom=a}}},{key:"setupBodyUI",value:function(){var e;return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,i,r=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.bodyCanvas.nativeElement,i=new LF({id:"body-ui",canvas:n,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera}),n.addEventListener("contextmenu",function(e){return e.preventDefault()}),t.next=4,i.initialize();case 4:this.bodyUI=i,window.bodyUI=i,(null===(e=this.scene)||void 0===e?void 0:e.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(function(e){return r.rotationChange.next(e)}),this.bodyUI.nodeDrag$.subscribe(function(e){return r.nodeDrag.emit(e)}),this.bodyUI.nodeClick$.subscribe(function(e){return r.nodeClick.emit(e)}),this.bodyUI.nodeHoverStart$.subscribe(function(e){return r.nodeHoverStart.emit(e)}),this.bodyUI.nodeHoverStop$.subscribe(function(e){return r.nodeHoverStop.emit(e)})];case 9:case"end":return t.stop()}},t,this)}))}},{key:"recreateBodyUI",value:function(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}},{key:"clearSubscriptions",value:function(){this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions=[]}},{key:"ngOnDestroy",value:function(){this.clearSubscriptions()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-body-ui"]],viewQuery:function(e,t){var n;(1&e&&hl(RG,5,Ku),2&e)&&(ll(n=dl())&&(t.bodyCanvas=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(e,t){1&e&&Ps(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),e}(),NG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh]]}),e}();new Mi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:function(){return 10}});var LG=["carouselContainer"],jG=["itemlist"],FG=["itemcontainer"];function BG(e,t){if(1&e&&(Ts(0,"div",14),ku(1),As()),2&e){var n=Hs().$implicit,i=Hs();qo(1),xu(i.occurenceData[n.id]||0)}}function VG(e,t){if(1&e){var n=Ds();Ts(0,"div",9),Fs("click",function(){var e=mn(n).$implicit;return Hs().selectOrgan(e)}),Ps(1,"mat-icon",10),Ts(2,"div",11),Ts(3,"div",12),ku(4),As(),xs(5,BG,2,1,"div",13),As(),As()}if(2&e){var i=t.$implicit,r=Hs();su("disabled",i.disabled)("selected",r.isSelected(i)),qo(1),Xs("svgIcon",i.src),qo(3),xu(i.name),qo(1),Cs("ngIf",void 0!==i.numResults)}}var zG=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}],UG=zG.filter(function(e){return!0!==e.disabled}),HG=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=UG,this.selectedOrgans=[],this.organsChanged=new Zc,this.onLeft=!0,this.onRight=!1,this.step=72}return b(e,[{key:"occurenceData",get:function(){return this._occurenceData},set:function(e){this._occurenceData=e}},{key:"ngAfterViewInit",value:function(){var e=this,t=this.carouselContainer;this.sensor=new kU.ResizeSensor(t.nativeElement,function(){e.set()})}},{key:"ngOnChanges",value:function(e){"organList"in e&&this.set()}},{key:"ngOnDestroy",value:function(){this.sensor.detach()}},{key:"error",get:function(){return!(!this.displayErrors||0===this.selectedOrgans.length)}},{key:"shift",value:function(e){var t=this.itemList,n=parseInt(t.nativeElement.style.left,10)||0;this.onLeft&&"left"===e||this.onRight&&"right"===e||(n="right"===e?n-this.step:n+this.step,t.nativeElement.style.left=n+"px",this.setLeftRight(n))}},{key:"scroll",value:function(e){var t=this;this.timeoutHandler=setInterval(function(){t.shift(e)},200)}},{key:"stopScroll",value:function(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}},{key:"selectOrgan",value:function(e){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(e)?this.selectedOrgans.filter(function(t){return e!==t}):this.selectedOrgans.concat([e]):[e],this.organsChanged.emit(this.selectedOrgans)}},{key:"isSelected",value:function(e){return!!this.selectedOrgans.includes(e)}},{key:"set",value:function(){var e=this.itemList,t=this.itemContainer,n=this.carouselContainer,i=parseInt(e.nativeElement.style.left,10)||0;if(e.nativeElement.offsetWidth>=this.organList.length*this.step)e.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(i);var r=this.step*Math.floor(n.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width="".concat(r,"px")}}},{key:"setWidth",value:function(){var e=this.itemContainer,t=this.carouselContainer,n=this.step*Math.floor(t.nativeElement.offsetWidth/this.step)-64;e.nativeElement.style.width="".concat(n,"px")}},{key:"setLeftRight",value:function(e){var t=this.itemContainer;this.onLeft=0===e,this.onRight=e<=t.nativeElement.offsetWidth-this.organList.length*this.step}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-organ-selector"]],viewQuery:function(e,t){var n;(1&e&&(hl(LG,7),hl(jG,7),hl(FG,7)),2&e)&&(ll(n=dl())&&(t.carouselContainer=n.first),ll(n=dl())&&(t.itemList=n.first),ll(n=dl())&&(t.itemContainer=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[Gt],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(e,t){1&e&&(Ts(0,"div",0,1),Ts(2,"mat-icon",2),Fs("touchstart",function(){return t.scroll("left")})("touchend",function(){return t.stopScroll()})("click",function(){return t.shift("left")})("mousedown",function(){return t.scroll("left")})("mouseup",function(){return t.stopScroll()}),ku(3,"chevron_left"),As(),Ts(4,"div",3,4),Ts(6,"div",5,6),xs(8,VG,6,7,"div",7),As(),As(),Ts(9,"mat-icon",8),Fs("touchstart",function(){return t.scroll("right")})("touchend",function(){return t.stopScroll()})("click",function(){return t.shift("right")})("mousedown",function(){return t.scroll("right")})("mouseup",function(){return t.stopScroll()}),ku(10,"chevron_right"),As(),As()),2&e&&(su("error",t.error),Cs("matTooltipDisabled",t.multiselect),qo(2),su("disabled",t.onLeft),qo(6),Cs("ngForOf",t.organList),qo(1),su("disabled",t.onRight))},directives:[hw,x_,Dh,Lh],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),e}(),GG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,S_,pw]]}),e}(),WG=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Zc,this.visibilityToggle=new Zc,this.opacityReset=new Zc}return b(e,[{key:"ngOnInit",value:function(){this.prevOpacity=this.visible?0:20}},{key:"reset",value:function(){this.prevOpacity=20}},{key:"changeOpacity",value:function(e){this.opacity=parseInt(e,10),this.opacityChange.emit(this.opacity)}},{key:"toggleVisibility",value:function(){var e=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=e,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}},{key:"resetOpacity",value:function(){this.prevOpacity=0,this.opacityReset.emit()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Ts(2,"mat-slider",2),Fs("input",function(e){return t.changeOpacity(e.value)}),As(),Ts(3,"span",3),ku(4),As(),As(),Ts(5,"div",4),Ts(6,"mat-icon",5),Fs("click",function(){return t.toggleVisibility()}),As(),Ts(7,"mat-icon",6),Fs("click",function(){return t.toggleVisibility()}),As(),Ts(8,"mat-icon",7),Fs("click",function(){return t.resetOpacity()}),ku(9,"refresh"),As(),As(),As()),2&e&&(qo(2),su("disabled",!t.visible),Cs("step",1)("min",0)("max",100)("value",t.opacity),qo(2),Su("",t.opacity,"%"),qo(2),su("hidden",t.visible),Cs("matRippleCentered",!0)("matRippleUnbounded",!0),qo(1),su("hidden",!t.visible),Cs("matRippleCentered",!0)("matRippleUnbounded",!0),qo(1),Cs("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[TU,x_,ob],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}(),qG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,S_,IU,ab]]}),e}();function XG(e,t){if(1&e&&(Ts(0,"div",15),Ps(1,"youtube-player",16),As()),2&e){var n=Hs(3);qo(1),Xs("videoId",n.videoID)}}function YG(e,t){if(1&e&&(Ts(0,"mat-expansion-panel",10),Ts(1,"mat-expansion-panel-header"),Ts(2,"h2",11),ku(3),As(),As(),Ts(4,"div",12),Ps(5,"markdown",13),xs(6,XG,2,1,"div",14),As(),As()),2&e){var n=Hs(),i=n.index,r=n.$implicit;Cs("expanded",0===i),qo(3),xu(r.title),qo(2),su("first",0===i),Cs("data",r.content),qo(1),Cs("ngIf",0===i)}}function KG(e,t){if(1&e&&(Ts(0,"div",8),xs(1,YG,7,6,"mat-expansion-panel",9),As()),2&e){var n=t.$implicit;qo(1),Cs("ngIf",n)}}var QG=function(){var e=function(){function e(t,n){m(this,e),this.dialogRef=t,this.data=n,this.documentationContents=n.content||[],this.infoTitle=n.title||"",this.videoID=n.videoID}return b(e,[{key:"ngOnInit",value:function(){var e=document.createElement("script");e.src="https://www.youtube.com/iframe_api",document.body.appendChild(e)}},{key:"close",value:function(){var e,t=this;null===(e=document.getElementsByClassName("modal-animated")[0])||void 0===e||e.classList.add("modal-animate-fade-out"),setTimeout(function(){t.dialogRef.close()},250)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(BU),Es(zU))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Ts(2,"div",2),Ts(3,"mat-icon",3),Fs("click",function(){return t.close()}),ku(4,"clear"),As(),As(),Ts(5,"div",4),Ts(6,"h2",5),ku(7),As(),Ts(8,"mat-dialog-content",6),xs(9,KG,2,1,"div",7),As(),As(),As(),As()),2&e&&(qo(7),xu(t.infoTitle),qo(2),Cs("ngForOf",t.documentationContents))},directives:[x_,YU,KU,Dh,Lh,pH,gH,SH,NH],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),e}(),$G=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,QU,S_,mH,BH,EH.forRoot({})]]}),e}(),ZG=function(){var e=function(){function e(t){m(this,e),this.http=t,this.markdownContent=new nv([])}return b(e,[{key:"readMarkdown",value:function(){var e=this;this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(function(t){var n=e.parseMarkdown(t);e.markdownContent.next(n)})}},{key:"parseMarkdown",value:function(e){var t,n=[],i=_(e.split("# "));try{for(i.s();!(t=i.n()).done;){var r=t.value;if(r.length){var o=r.split("\n\n");n.push({title:o[0],content:o.splice(1).join("\n\n")})}}}catch(a){i.e(a)}finally{i.f()}return n}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(Kb))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),JG=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.dialog=t,this.infoButtonService=n,this.infoTitle="",this.subscriptions=new W,this.subscriptions.add(n.markdownContent.subscribe(function(e){e.length&&i.launchInfoDialog(e)}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"launchInfoDialog",value:function(e){this.dialog.open(QG,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:e,videoID:this.videoID}})}},{key:"onDialogButtonClick",value:function(){this.infoButtonService.readMarkdown()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(qU),Es(ZG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"mat-icon",1),Fs("click",function(){return t.onDialogButtonClick()}),ku(2," info "),As(),As())},directives:[x_],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),e}(),eW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,$G,S_,u_]]}),e}(),tW=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).optionCache=new Map,e}return b(n,[{key:"config$",get:function(){return this.state$.pipe(od(function(e){return null!=e}),Od(1))}},{key:"setConfig",value:function(e){this.setState(e)}},{key:"patchConfig",value:function(e){this.patchState(e)}},{key:"getProperty",value:function(e){return this.config$.pipe(mU.apply(void 0,v(e)),Qf(),Od(1))}},{key:"getOption",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:Jf,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yU;return function(i){return i.lift(new bU(e,t,n.leading,n.trailing))}}(1e3),ue(function(t){var n=e.clientWidth,i=e.clientHeight;return[t.clientX,t.clientY,n,i].join("_")})).subscribe(function(e){return t.event("webpage","mousemove",e)})}(t.body,n)};return e.\u0275fac=function(t){return new(t||e)(Qi(fh),Qi(SG))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}();function iW(e,t){if(1&e){var n=Ds();Ts(0,"button",1),Fs("click",function(){return mn(n),Hs().submit(!0)}),ku(1),As()}if(2&e){var i=Hs();qo(1),Su(" ","not-set"===i.allowTelemetry?"I understand":"Opt in","\n")}}function rW(e,t){if(1&e){var n=Ds();Ts(0,"button",1),Fs("click",function(){return mn(n),Hs().submit(!1)}),ku(1,"Opt out"),As()}}var oW,aW,sW=function(){var e=function(){function e(t,n,i){m(this,e),this.consentService=n,this.data=i,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}return b(e,[{key:"allowTelemetry",get:function(){return this.consentService.consent}},{key:"dismiss",value:function(){this.data.preClose()}},{key:"submit",value:function(e){this.consentService.setConsent(e?"given":"rescinded"),this.dismiss()}},{key:"showButton",value:function(e){var t=this.allowTelemetry;return"not-set"===t||("opt-in"===e?"rescinded"===t:"given"===t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(OG),Es(Y_))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(e,t){1&e&&(Ts(0,"p"),ku(1,"We log usage to improve this service."),As(),xs(2,iW,2,1,"button",0),xs(3,rW,2,0,"button",0)),2&e&&(qo(2),Cs("ngIf",t.showButton("opt-in")),qo(1),Cs("ngIf",t.showButton("opt-out")))},directives:[Lh,P_],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),e}(),uW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_]]}),e}(),cW=new Mi("Default theme class"),lW="light-theme",hW="dark-theme",fW=function(){var e=function(){function e(t){m(this,e),this.defaultTheme=this.theme=null!=t?t:""}return b(e,[{key:"getTheme",value:function(){return this.theme}},{key:"setTheme",value:function(e){e!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(e),this.theme=e)}},{key:"resetTheme",value:function(){this.setTheme(this.defaultTheme)}},{key:"initialize",value:function(e,t){this.element=e,this.injector=t,this.applyThemeClass(this.getTheme())}},{key:"applyThemeClass",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"add",i=this.element,r=this.injector;if(e&&i&&r){var o=r.get(Zu,null);if(o){var a=i.nativeElement,s=null===(t=r.get(Ap,null))||void 0===t?void 0:t.getContainerElement(),u="add"===n?"addClass":"removeClass";o[u](a,e),s&&o[u](s,e)}}}}],[{key:"initialize",value:function(t){var n=t.injector,i=t.location;n.get(e).initialize(i,n)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(cW,8))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),dW={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["assets/kpmp/data/rui_locations.jsonld","assets/sparc/data/rui_locations.jsonld","assets/gtex/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(oW=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==oW?oW:"",useRemoteApi:!0,remoteApiEndpoint:"https://ccf-api.herokuapp.com/v1"},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"},pW=["*",[["mat-toolbar-row"]]],vW=["*","mat-toolbar-row"],gW=Xy(function(){return function e(t){m(this,e),this._elementRef=t}}()),mW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=It({type:e,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]}),e}(),yW=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e))._platform=i,o._document=r,o}return b(n,[{key:"ngAfterViewInit",value:function(){var e=this;this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(function(){return e._checkToolbarMixedModes()}))}},{key:"_checkToolbarMixedModes",value:function(){}}]),n}(gW);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Id),Es(fh))},e.\u0275cmp=Ct({type:e,selectors:[["mat-toolbar"]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,mW,5),2&e)&&(ll(i=dl())&&(t._toolbarRows=i))},hostAttrs:[1,"mat-toolbar"],hostVars:4,hostBindings:function(e,t){2&e&&su("mat-toolbar-multiple-rows",t._toolbarRows.length>0)("mat-toolbar-single-row",0===t._toolbarRows.length)},inputs:{color:"color"},exportAs:["matToolbar"],features:[ss],ngContentSelectors:vW,decls:2,vars:0,template:function(e,t){1&e&&(Ws(pW),qs(0),qs(1,1))},styles:[".cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}\n"],encapsulation:2,changeDetection:0}),e}(),bW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Wy],Wy]}),e}(),_W=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_,S_,bW,pw]]}),e}();function wW(e){return new Promise(function(t,n){e.oncomplete=e.onsuccess=function(){return t(e.result)},e.onabort=e.onerror=function(){return n(e.error)}})}function kW(){return aW||(e="keyval",t=function(){return navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases?Promise.resolve():new Promise(function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()}).finally(function(){return clearInterval(e)});var e}().then(function(){var t=indexedDB.open("keyval-store");return t.onupgradeneeded=function(){return t.result.createObjectStore(e)},wW(t)}),aW=function(n,i){return t.then(function(t){return i(t.transaction(e,n).objectStore(e))})}),aW;var e,t}function xW(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kW();return t("readonly",function(t){return wW(t.get(e))})}var SW=r(71440),EW=r(70698),CW=r(7445),OW=r.n(CW),TW=r(23815),AW=r(31609),PW=SW.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},SW.DataFactory),MW={x:PW("rdf"),type:PW("rdf")("type")},IW={x:PW("rdfs"),label:PW("rdfs")("label"),comment:PW("rdfs")("comment"),isDefinedBy:PW("rdfs")("isDefinedBy"),seeAlso:PW("rdfs")("seeAlso")},RW={x:PW("entity"),id:PW("entity")("id"),label:IW.label,description:IW.comment,link:IW.seeAlso,sex:PW("entity")("sex"),age:PW("entity")("age"),bmi:PW("entity")("bmi"),Male:SW.DataFactory.literal("Male"),Female:SW.DataFactory.literal("Female"),consortiumName:PW("entity")("consortium_name"),providerName:PW("entity")("provider_name"),providerUUID:PW("entity")("provider_uuid"),donor:PW("entity")("has_donor"),sections:PW("entity")("has_tissue_section"),datasets:PW("entity")("has_dataset"),sampleType:PW("entity")("sample_type"),TissueBlock:SW.DataFactory.literal("Tissue Block"),TissueSection:SW.DataFactory.literal("Tissue Section"),NonStandard:SW.DataFactory.literal("Non-standard"),sectionCount:PW("entity")("section_count"),sectionSize:PW("entity")("section_size"),sectionUnits:PW("entity")("section_units"),sectionNumber:PW("entity")("section_number"),spatialEntity:PW("entity")("has_spatial_entity"),ontologyTerms:PW("entity")("has_ontology_term"),technology:PW("entity")("technology"),thumbnail:PW("entity")("has_thumbnail")},DW=PW("ccf"),NW={x:DW,ontologyNode:{label:DW("ccf_preferred_label"),parent:DW("ccf_part_of"),children:DW("ccf_part_of"),rui_rank:DW("ccf_rui_rank"),synonymLabels:SW.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:DW("VHFemale"),Male:DW("VHMale"),BothSexes:DW("VHBothSexes"),FemaleOrgans:DW("VHFemaleOrgans"),MaleOrgans:DW("VHMaleOrgans")},SpatialObjectReference:DW("SpatialObjectReference"),SpatialEntity:DW("SpatialEntity"),SpatialPlacement:DW("SpatialPlacement"),spatialObjectReference:{file:DW("has_object_file"),file_format:DW("has_object_file_format"),file_subpath:DW("has_object_file_subpath")},extractionSet:{label:IW.label,rui_rank:DW("ccf_rui_rank")},spatialEntity:{label:IW.label,comment:IW.comment,creator:PW("dc")("creator"),creator_first_name:DW("creator_first_name"),creator_last_name:DW("creator_last_name"),creator_orcid:DW("creator_orcid"),creation_date:DW("creation_date"),updated_date:DW("updated_date"),ccf_annotations:DW("ccf_annotation"),representation_of:DW("ccf_representation_of"),reference_organ:DW("anatomical_structure_of"),extraction_set_for:DW("extraction_set_for"),extraction_set:DW("extraction_site_for"),sex:DW("has_sex"),side:DW("has_side"),rui_rank:DW("ccf_rui_rank"),slice_thickness:DW("ccf_slice_thickness"),slice_count:DW("ccf_slice_count"),x_dimension:DW("has_x_dimension"),y_dimension:DW("has_y_dimension"),z_dimension:DW("has_z_dimension"),dimension_units:DW("has_dimension_units"),object:DW("has_object_reference")},spatialPlacement:{source:DW("has_placement_source"),target:DW("has_placement_target"),placement_date:DW("has_placement_date"),x_scaling:DW("has_x_scaling"),y_scaling:DW("has_y_scaling"),z_scaling:DW("has_z_scaling"),scaling_units:DW("has_scaling_units"),x_rotation:DW("has_x_rotation"),y_rotation:DW("has_y_rotation"),z_rotation:DW("has_z_rotation"),w_rotation:DW("has_theta_rotation"),rotation_order:DW("has_rotation_order"),rotation_units:DW("has_rotation_units"),x_translation:DW("has_x_translation"),y_translation:DW("has_y_translation"),z_translation:DW("has_z_translation"),translation_units:DW("has_translation_units")}},LW={x:PW("uberon")},jW=(PW("lmha"),{bladder:LW.x("0001255"),body:LW.x("0013702"),brain:LW.x("0000955"),colon:LW.x("0001155"),heart:LW.x("0000948"),kidney:LW.x("0002113"),large_intestine:LW.x("0000059"),left_kidney:LW.x("0004538"),left_lung:LW.x("0002168"),left_ureter:LW.x("0001223"),liver:LW.x("0002107"),lung:LW.x("0002048"),respiratory_system:LW.x("0001004"),lymph_node:LW.x("0000029"),pelvis:LW.x("0001270"),rectum:LW.x("0001052"),right_kidney:LW.x("0004539"),right_lung:LW.x("0002167"),right_ureter:LW.x("0001222"),skin:LW.x("0002097"),small_intestine:LW.x("0002108"),spleen:LW.x("0002106"),thymus:LW.x("0002370"),ureter:LW.x("0000056"),vasculature:LW.x("0002049")});function FW(e){var n={};return Object.entries(e).forEach(function(e){var i=t(e,2),r=i[0],o=i[1];n[o.id]=r}),n}var BW={spatialObjectReference:FW(NW.spatialObjectReference),spatialEntity:FW(NW.spatialEntity),spatialPlacement:FW(NW.spatialPlacement)};function VW(e,t,n,i){var r={"@id":t,"@type":n};return e.some(function(e){var t=i[e.predicate.id];if(t){var n="Literal"===e.object.termType?(0,AW.fromRdf)(e.object):e.object.id;(0,TW.set)(r,t,n)}return!1},SW.DataFactory.namedNode(t),null,null,null),r}var zW=(0,TW.memoize)(function(e,t){return VW(e,t,"SpatialObjectReference",BW.spatialObjectReference)},function(e,t){return t}),UW=(0,TW.memoize)(function(e,t){var n=VW(e,t,"ExtractionSet",BW.spatialEntity);return n.extractionSites=(0,TW.sortBy)(e.getSubjects(NW.spatialEntity.extraction_set,t,null).map(function(t){return qW(e,t.id)}),["rui_rank"]),n},function(e,t){return t}),HW=(0,TW.memoize)(function(e,t){return(0,TW.sortBy)(e.getSubjects(NW.spatialEntity.extraction_set_for,t,null).map(function(t){return UW(e,t.id)}),["rui_rank"])},function(e,t){return t}),GW=(0,TW.memoize)(function(e,t){return(0,TW.sortBy)(e.getSubjects(NW.spatialEntity.reference_organ,t,null).map(function(t){return qW(e,t.id)}).filter(function(e){return e["@id"]!==t}),["rui_rank"])},function(e,t){return t}),WW=(0,TW.memoize)(function(e){var t=[];return e.forEach(function(n){n.subject.id===n.object.id&&t.push(qW(e,n.subject.id))},null,NW.spatialEntity.reference_organ,null,null),(0,TW.sortBy)(t,["rui_rank"])}),qW=(0,TW.memoize)(function(e,t){var n=VW(e,t,"SpatialEntity",BW.spatialEntity);return n.object&&(n.object=zW(e,n.object)),n.ccf_annotations&&(n.ccf_annotations=e.getObjects(t,NW.spatialEntity.ccf_annotations,null).map(function(e){return e.id})),e.forSubjects(function(e){return n.entityId=e.id},RW.spatialEntity,t,null),n},function(e,t){return t}),XW=(0,TW.memoize)(function(e,t){var n=VW(e,t,"SpatialPlacement",BW.spatialPlacement);return n.source&&(n.source=qW(e,n.source)),n.target&&(n.target=qW(e,n.target)),n},function(e,t){return t}),YW=(0,TW.memoize)(function(e,t){var n=e.getObjects(SW.DataFactory.namedNode(t),RW.spatialEntity,null);if(n.length>0)return qW(e,n[0].id)},function(e,t){return t});function KW(e,t){var n,i=t;switch(i.translation_units){case"centimeter":n=.01;break;case"millimeter":n=.001;break;case"meter":default:n=1}var r=[i.x_translation,i.y_translation,i.z_translation].map(function(e){return e*n}),o=[i.x_rotation,i.y_rotation,i.z_rotation].map(Gx),a=[i.x_scaling,i.y_scaling,i.z_scaling];return e.translate(r).rotateXYZ(o).scale(a)}var QW=function(){function e(t){m(this,e),this.db=t,this.createGraph()}return b(e,[{key:"createGraph",value:function(){var e=this;this.graph=new EW.DirectedGraph;var t=this.db.store;t.forSubjects(function(t){e.addNode(t.id,"SpatialObjectReference")},MW.type,NW.SpatialObjectReference,null),t.forSubjects(function(t){e.addNode(t.id,"SpatialEntity")},MW.type,NW.SpatialEntity,null);var n={};t.some(function(e){return n[e.subject.id]=e.object.id,!1},null,NW.spatialPlacement.source,null,null),t.some(function(t){var i=n[t.subject.id];return i&&e.addEdge(t.subject.id,i,t.object.id,"SpatialPlacement"),!1},null,NW.spatialPlacement.target,null,null)}},{key:"addNode",value:function(e,t){this.graph.mergeNode(e,{type:t})}},{key:"addEdge",value:function(e,t,n,i){this.graph.mergeDirectedEdge(t,n,{type:i,id:e})}},{key:"getTransformationMatrix",value:function(e,t){if(e===t)return new EO(EO.IDENTITY);if(this.graph.hasNode(e)&&this.graph.hasNode(t)){var n=this.db.store,i=new EO(EO.IDENTITY),r=OW()(this.graph,e,t);if(r&&r.length>0){r.reverse();var o,a="",s=_(r);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(a){var c=this.graph.getEdgeAttribute(u,a,"id");KW(i,XW(n,c))}a=u}}catch(l){s.e(l)}finally{s.f()}return i}}}}]),e}(),$W=function(){function e(t){m(this,e),this.db=t}return b(e,[{key:"getSpatialEntity",value:function(e){return qW(this.db.store,e)}},{key:"getExtractionSets",value:function(e){return HW(this.db.store,e)}},{key:"getExtractionSet",value:function(e){return UW(this.db.store,e)}},{key:"getAnatomicalStructures",value:function(e){return GW(this.db.store,e)}},{key:"getReferenceOrgans",value:function(){return WW(this.db.store)}},{key:"getReferenceBody",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=NW.spatial.Male.id;break;case"Female":t=NW.spatial.Female.id;break;case"Both":default:t=NW.spatial.BothSexes.id}return this.getSpatialEntity(t)}},{key:"getReferenceOrganSets",value:function(e){var n=this,i=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":i=i.filter(function(e){return"Male"===e.sex});break;case"Female":i=i.filter(function(e){return"Female"===e.sex})}return(null==e?void 0:e.debug)&&(i=i.map(function(e){return[[e],n.getAnatomicalStructures(e["@id"])]}).reduce(function(e,n){var i=t(n,2),r=i[0],o=i[1];return e.concat(o.length>0?o:r)},[])),i}},{key:"getReferenceSceneNodes",value:function(e){var t=this,n=this.getReferenceBody(e),i=v(this.getReferenceOrganSets(e).map(function(e){var i="http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of;return t.getSceneNode(e,n,{color:[255,255,255,255],opacity:i?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!i})}));return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(NW.x("VHRightKidney").id),n,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(NW.x("VHLeftKidney").id),n,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(NW.x("VHSpleenCC1").id),n,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(NW.x("VHSpleenCC2").id),n,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(NW.x("VHSpleenCC3").id),n,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(function(e){return void 0!==e})}},{key:"getReferenceOrganScene",value:function(e,t){var n,i,r=this,o=null!==(n=void 0!==(null==t?void 0:t.sex))&&void 0!==n&&n,a=this.getReferenceOrgans().filter(function(n){return n.representation_of===e&&(!o||n.sex===(null==t?void 0:t.sex))});if(a.length>0){var s=a[0],u=this.getSceneNode(s,s,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),c=(null!==(i=this.db.getSpatialEntities(t))&&void 0!==i?i:[]).map(function(e){return r.getSceneNode(e,s,{color:[255,255,255,229.5]})});return[u].concat(c).filter(function(e){return void 0!==e})}return[]}},{key:"getEntitySceneNodes",value:function(e){var t=this,n=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(function(e){return t.getSceneNode(e,n,{color:[255,255,255,229.5]})}).filter(function(e){return void 0!==e})}},{key:"getSceneNode",value:function(e,t){var n,i,r,o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=null===(i=null===(n=null==e?void 0:e.object)||void 0===n?void 0:n.file_format)||void 0===i?void 0:i.startsWith("model/gltf"),u=this.db.graph.getTransformationMatrix(s&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(s)u=new EO(EO.IDENTITY).rotateX(Gx(90)).multiplyLeft(u);else{var c;switch(e.dimension_units){case"centimeter":c=.01;break;case"millimeter":c=.001;break;case"meter":default:c=1}var l=[e.x_dimension,e.y_dimension,e.z_dimension].map(function(e){return e*c/2});u.scale(l)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:s?null===(r=e.object)||void 0===r?void 0:r.file:void 0,scenegraphNode:s?null===(o=e.object)||void 0===o?void 0:o.file_subpath:void 0,transformMatrix:u,tooltip:e.label},a)}}},{key:"getScene",value:function(e){return[].concat(v(this.getReferenceSceneNodes(e)),v(this.getEntitySceneNodes(e)))}}]),e}(),ZW="https://entity.api.hubmapconsortium.org/entities/",JW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),eq={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},tq={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},nq=function(){var e={};return Object.entries(jW).forEach(function(n){var i=t(n,2),r=i[0],o=i[1];return e[r]=o.id}),e}(),iq={BL:[nq.body,nq.bladder],RK:[nq.body,nq.kidney,nq.right_kidney],LK:[nq.body,nq.kidney,nq.left_kidney],HT:[nq.body,nq.heart],LI:[nq.body,nq.large_intestine,nq.colon],SI:[nq.body,nq.small_instestine],LL:[nq.body,nq.respiratory_system,nq.lung,nq.left_lung],RL:[nq.body,nq.respiratory_system,nq.lung,nq.right_lung],LY:[nq.body,nq.lymph_node],SP:[nq.body,nq.spleen],TH:[nq.body,nq.thymus],UR:[nq.body,nq.ureter],LV:[nq.body,nq.liver],OT:[nq.body]},rq={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}},oq=function(){function e(t){var n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;if(m(this,e),this.data=t,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"===this.data.entity_type){var s=this.data.descendants||[],u=(this.data.ancestors||[]).find(function(e){return"Donor"===e.entity_type});this.donor=this.getDonor(u,o);var c=this.getRuiLocation(t,this.donor);c?this.rui_location=c:this.bad=!0;var l=new Date(t.last_modified_timestamp).toLocaleDateString(),h=tq[t.group_uuid]||t.group_name,f=t.created_by_user_displayname;this["@id"]=ZW+t.uuid,this.label="Registered ".concat(l,", ").concat(f,", ").concat(h),this.link="".concat(o,"browse/sample/").concat(t.uuid);var d={},p=[];this.sections=p;var v=[];this.datasets=v;var g,y=_(s.filter(function(e){return"Sample"===e.entity_type}));try{for(y.s();!(g=y.n()).done;){var b=g.value,w=this.getSection(b,t,o);d[b.submission_id]=w,p.push(w),w.section_number=null!==(n=w.section_number)&&void 0!==n?n:p.length}}catch(M){y.e(M)}finally{y.f()}var k,x=_(s);try{for(x.s();!(k=x.n()).done;){var S=k.value;if("Dataset"===S.entity_type){var E=this.getDataset(S,r,o,a),C=(0,TW.get)(S,["ingest_metadata","metadata","tissue_id"]);d[C]?null===(i=d[C].datasets)||void 0===i||i.push(E):v.push(E)}}}catch(M){x.e(M)}finally{x.f()}var O=null!=c?c:{},T="".concat(O.x_dimension," x ").concat(O.y_dimension," x ").concat(O.z_dimension," ").concat(O.dimension_units);this.section_count=O.slice_count||p.length;var A=parseFloat((O.slice_thickness||(O.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=A;var P=O.dimension_units||"millimeter";this.section_units=P,this.description="".concat(T,", ").concat(A," ").concat(P,", ").concat(t.specimen_type,", ").concat(this.section_count," Sections"),p.forEach(function(e,t){e.description="".concat(O.x_dimension," x ").concat(O.y_dimension," x ").concat(A," ").concat(P,", ").concat(A," ").concat(P,", ").concat(e.description),e.section_number=t+1})}else this.bad=!0}return b(e,[{key:"getSection",value:function(e,t,n){var i=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":ZW+e.uuid,"@type":"Sample",label:"Registered ".concat(i,", ").concat(e.created_by_user_displayname,", ").concat(tq[e.group_uuid]||e.group_name),description:"".concat(t.specimen_type),link:"".concat(n,"browse/sample/").concat(e.uuid),sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}},{key:"getDataset",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0,a=new Date(e.last_modified_timestamp).toLocaleDateString(),s=tq[e.group_uuid]||e.group_name,u=e.created_by_user_displayname,c=[].concat(v(e.data_types),[(0,TW.get)(e,["ingest_metadata","metadata","assay_type"],"")]),l=c.join("|").toLowerCase(),h="assets/icons/ico-unknown.svg";return-1!==l.indexOf("10x")?(n="10x",h="assets/icons/ico-bulk-10x.svg"):-1!==l.indexOf("af")?(n="AF",h="assets/icons/ico-spatial-af.svg"):-1!==l.indexOf("codex")?(n="CODEX",h="assets/icons/ico-spatial-codex.svg"):-1!==l.indexOf("imc")?(n="IMC",h="assets/icons/ico-spatial-imc.svg"):-1!==l.indexOf("lc")&&-1===l.indexOf("af")?(n="LC",h="assets/icons/ico-bulk-lc.svg"):n=-1!==l.indexOf("maldi")?"MALDI":-1!==l.indexOf("pas")?"PAS":"OTHER",h=null!==(t=this.getDatasetThumbnail(e,i,o))&&void 0!==t?t:h,{"@id":ZW+e.uuid,"@type":"Dataset",label:"Registered ".concat(a,", ").concat(u,", ").concat(s),description:"Data/Assay Types: ".concat(c.join(", ")),link:"".concat(r,"browse/dataset/").concat(e.uuid),technology:n,thumbnail:h}}},{key:"getDatasetThumbnail",value:function(e,t,n){if(e.thumbnail_file){var i=e.thumbnail_file;return"".concat(t,"/").concat(i.file_uuid,"/").concat(i.filename)+(n?"?token=".concat(n):"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){var r=(0,TW.get)(e,"metadata.files",[]).filter(function(e){return/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)}).filter(function(e){return!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(e.rel_path)}).filter(function(e){return JW.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))}).map(function(i){return"".concat(t,"/").concat(e.uuid,"/").concat(i.rel_path)+(n?"?token=".concat(n):"")});if(r.length>0){var o=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(JW.has(o))return"assets/thumbnails/TMC-Vanderbilt/DR1/".concat(o)}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){var a=eq[e.hubmap_id];if(a)return"assets/thumbnails/TMC-Florida/".concat(a)}}},{key:"getDonor",value:function(e,t){var n,i=(e.description||"").toLowerCase();i.includes("female")?n="Female":i.includes("male")&&(n="Male");var r,o,a=i.match(/age ([0-9]+)/);a&&(r=(0,TW.toNumber)(a[1]));var s,u=_((0,TW.get)(e,"metadata.organ_donor_data",[]));try{for(u.s();!(s=u.n()).done;){var c=s.value;"Feminine gender"===c.preferred_term||"Female"===c.preferred_term?n="Female":"Masculine gender"===c.preferred_term||"Male"===c.preferred_term?n="Male":"Current chronological age"===c.preferred_term||"Age"===c.preferred_term?r=(0,TW.toNumber)(c.data_value):"Body mass index"===c.preferred_term&&(o=(0,TW.toNumber)(c.data_value))}}catch(d){u.e(d)}finally{u.f()}var l="";n&&r&&(l+="".concat(n,", Age ").concat(r),o&&(l+=", BMI ".concat(o.toFixed(1))));var h=new Date(e.last_modified_timestamp).toLocaleDateString(),f=tq[e.group_uuid]||e.group_name;return{"@id":ZW+e.uuid,"@type":"Donor",label:l,description:"Entered ".concat(h,", ").concat(e.created_by_user_displayname,", ").concat(f),link:"".concat(t,"browse/donor/").concat(e.uuid),age:r,sex:n,bmi:o,consortium_name:"HuBMAP",provider_name:f,provider_uuid:e.group_uuid,samples:[]}}},{key:"getRuiLocation",value:function(e,t){var n,i,r=(e.ancestors||[]).find(function(e){return"Sample"===e.entity_type&&"organ"===e.specimen_type}),o=iq[null==r?void 0:r.organ]||[nq.body],a=e.rui_location;if(a&&("string"==typeof a&&(a=JSON.parse(a)),a.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):a["@id"]&&(i=a)),i){i.ccf_annotations=o.concat(i.ccf_annotations||[]);var s=null!==(n=(0,TW.get)(i,["placement","target"]))&&void 0!==n?n:"";s.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,TW.set)(i,["placement","target"],s.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===s||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===s)&&(0,TW.set)(i,["placement","target"],"Male"===t.sex?s.replace("#VH","#VHM")+"_Patch":s.replace("#VH","#VHF")+"_Patch")}return i}},{key:"getTissueBlock",value:function(){return(0,TW.omit)(Object.assign({},this),["data","bad","donor"])}},{key:"toJsonLd",value:function(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}]),e}();function aq(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return yw(this,void 0,void 0,regeneratorRuntime.mark(function a(){var s,u;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if("static"!==t){a.next=6;break}return a.next=3,fetch(e).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 3:s=a.sent,a.next=12;break;case 6:if("search-api"!==t){a.next=12;break}return u={"Content-type":"application/json"},i&&i.length>0&&(u.Authorization="Bearer ".concat(i)),a.next=11,fetch(e,{method:"POST",headers:u,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:{exists:{field:"rui_location"}}})}).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 11:s=a.sent;case 12:if(!s){a.next=14;break}return a.abrupt("return",function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={},s=(0,TW.get)(e,"hits.hits",[]).map(function(e){return(0,TW.get)(e,"_source",{})}).map(function(e){return new oq(e,n,i,r).toJsonLd()}),u=_(s);try{for(u.s();!(t=u.n()).done;){var c=t.value,l=c["@id"];a[l]?a[l].samples.push(c.samples[0]):a[l]=c}}catch(f){u.e(f)}finally{u.f()}var h=Object.values(a);return o&&(function(e){var t,n=[],i=0,r=_(e.filter(function(e){return e.samples.length>1}));try{for(r.s();!(t=r.n()).done;){for(var o=t.value,a=o.samples,s=function(e){var t=a[e]["@id"];n=n.concat(a[e].datasets);var r,o=_(a[e].sections);try{for(o.s();!(r=o.n()).done;){var s=r.value;n=n.concat(s.datasets)}}catch(f){o.e(f)}finally{o.f()}for(var u=e+1;u0&&console.log("\u26a0 ".concat(i," sections identified as blocks"))}(h),console.log(h.map(function(e){return Object.assign({"@context":rq},e)}))),{"@context":rq,"@graph":h}}(s,r,o,i));case 14:console.warn("Unable to load ".concat(e," as HuBMAP Data"));case 15:case"end":return a.stop()}},a)}))}function sq(e,t,n){var i,r=new Map,o=new Set;e.some(function(e){var n;return t.has(e.subject.id)&&(o.add(e.object.id),r.has(e.object.id)?null===(n=r.get(e.object.id))||void 0===n||n.push(e.subject.id):r.set(e.object.id,[e.subject.id])),!1},null,RW.donor,null,null);var a,s=n(o),u=new Set,c=_(s);try{for(c.s();!(a=c.n()).done;){var l,h=a.value,f=_(null!==(i=r.get(h))&&void 0!==i?i:[]);try{for(f.s();!(l=f.n()).done;){var d=l.value;u.add(d)}}catch(p){f.e(p)}finally{f.f()}}}catch(p){c.e(p)}finally{c.f()}return u}function uq(e,t){return function(n){return e.has(n.id)?t.add(n.id):void 0}}var cq=(o(x={},NW.ontologyNode.label.id,"label"),o(x,NW.ontologyNode.parent.id,"parent"),o(x,NW.ontologyNode.synonymLabels.id,"synonymLabels"),x);function lq(e,t){var n=SW.DataFactory.namedNode(t),i={"@id":t,"@type":"OntologyTreeNode",id:t,parent:"",children:[],synonymLabels:[],label:""};return e.some(function(e){var t=cq[e.predicate.id];if(t){var n="Literal"===e.object.termType?(0,AW.fromRdf)(e.object):e.object.id;"synonymLabels"===t?i.synonymLabels.push(n):(0,TW.set)(i,t,n)}return!1},n,null,null,null),i.children=e.getSubjects(NW.ontologyNode.children,n,null).map(function(e){return e.id}),i}var hq=(o(S={},RW.label.id,"label"),o(S,RW.description.id,"description"),o(S,RW.link.id,"link"),S),fq=Object.assign(Object.assign({},hq),o({},RW.providerName.id,"providerName")),dq=Object.assign(Object.assign({},hq),(o(E={},RW.technology.id,"technology"),o(E,RW.thumbnail.id,"thumbnail"),E)),pq=Object.assign(Object.assign({},hq),(o(C={},RW.sampleType.id,"sampleType"),o(C,RW.sectionNumber.id,"sectionNumber"),o(C,RW.datasets.id,"datasets"),C)),vq=Object.assign(Object.assign({},hq),(o(O={},RW.sampleType.id,"sampleType"),o(O,RW.sectionCount.id,"sectionCount"),o(O,RW.sectionSize.id,"sectionSize"),o(O,RW.sectionUnits.id,"sectionUnits"),o(O,RW.donor.id,"donor"),o(O,RW.spatialEntity.id,"spatialEntityId"),o(O,RW.sections.id,"sections"),o(O,RW.datasets.id,"datasets"),O)),gq=(0,TW.memoize)(function(e,t){var n={"@id":t,"@type":"Donor"};return e.some(function(e){var t=fq[e.predicate.id];if(t){var i="Literal"===e.object.termType?(0,AW.fromRdf)(e.object):e.object.id;(0,TW.set)(n,t,i)}return!1},SW.DataFactory.namedNode(t),null,null,null),n},function(e,t){return t});function mq(e,t){var n={"@id":t,"@type":"Dataset"};return e.some(function(e){var t=dq[e.predicate.id];if(t){var i="Literal"===e.object.termType?(0,AW.fromRdf)(e.object):e.object.id;(0,TW.set)(n,t,i)}return!1},SW.DataFactory.namedNode(t),null,null,null),n}var yq=(0,TW.memoize)(function(e,t){var n={"@id":t,"@type":"Sample",sections:[],datasets:[]};return e.some(function(t){var i=vq[t.predicate.id];if(i){var r="Literal"===t.object.termType?(0,AW.fromRdf)(t.object):t.object.id;if("sections"===i){var o=function(e,t){var n={"@id":t,"@type":"Sample",datasets:[]};return e.some(function(t){var i=pq[t.predicate.id];if(i){var r="Literal"===t.object.termType?(0,AW.fromRdf)(t.object):t.object.id;if("datasets"===i){var o=mq(e,r);n[i].push(o)}else(0,TW.set)(n,i,r)}return!1},SW.DataFactory.namedNode(t),null,null,null),n}(e,r);n[i].push(o)}else if("datasets"===i){var a=mq(e,r);n[i].push(a)}else"donor"===i?n[i]=gq(e,r):(0,TW.set)(n,i,r)}return!1},SW.DataFactory.namedNode(t),null,null,null),n},function(e,t){return t}),bq={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},_q=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bq;m(this,e),this.options=t,this.store=new SW.Store(void 0,{factory:SW.DataFactory}),this.graph=new QW(this),this.scene=new $W(this)}return b(e,[{key:"connect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),n.next=4,this.initializing;case 4:return n.abrupt("return",this.store.size>0);case 5:case"end":return n.stop()}},n,this)}))}},{key:"cachedConnect",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,n,i,r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(new Date).getTime(),n="ccf-database.last_modified",i="ccf-database",e.next=5,xW(n).catch(function(){});case 5:if(!((r=e.sent)&&t-new Date(+r).getTime()>36e5)){e.next=11;break}return e.next=9,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kW();return t("readwrite",function(t){return e.forEach(function(e){return t.delete(e)}),wW(t.transaction)})}([i,n]).catch(function(){});case 9:e.next=14;break;case 11:return e.next=13,xW(i).catch(function(){});case 13:o=e.sent;case 14:if(!o){e.next=19;break}return e.next=17,this.deserialize(o);case 17:e.next=22;break;case 19:return e.next=21,this.doConnect();case 21:(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kW();return t("readwrite",function(t){return e.forEach(function(e){return t.put(e[1],e[0])}),wW(t.transaction)})})([[i,this.serialize()],[n,""+t]]).catch(function(){});case 22:case"end":return e.stop()}},e,this)}))}},{key:"doConnect",value:function(){var e,t;return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,r,o,a,s=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],!(o=this.options.ccfOwlUrl).endsWith(".n3store.json")){n.next=8;break}return n.next=4,fetch(o).then(function(e){return e.text()}).catch(function(){return console.log("Couldn't locate serialized store.")});case 4:(a=n.sent)&&(this.store=(0,SW.deserializeN3Store)(a,SW.DataFactory)),n.next=9;break;case 8:(null==o?void 0:o.length)>0&&r.push(o);case 9:return this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(aq(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(function(e){if(e)return s.addDataSources([e])}))),i.push(this.addDataSources(r)),n.next=13,Promise.all(i);case 13:return n.next=15,this.synchronize();case 15:case"end":return n.stop()}},n,this)}))}},{key:"addDataSources",value:function(e,t){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,r=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=null!=t?t:this.store,n.next=3,Promise.all(e.map(function(e){return yw(r,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!=typeof e){t.next=20;break}if(!e.endsWith("jsonld")){t.next=6;break}return t.next=4,(0,SW.addJsonLdToStore)(e,i);case 4:t.next=18;break;case 6:if(!e.endsWith("n3")){t.next=11;break}return t.next=9,(0,SW.addN3ToStore)(e,i);case 9:t.next=18;break;case 11:if(!(e.endsWith("rdf")||e.endsWith("owl")||e.endsWith("xml"))){t.next=16;break}return t.next=14,(0,SW.addRdfXmlToStore)(e,i);case 14:t.next=18;break;case 16:return t.next=18,(0,SW.addJsonLdToStore)(e,i);case 18:t.next=22;break;case 20:return t.next=22,(0,SW.addJsonLdToStore)(e,i);case 22:case"end":return t.stop()}},t)}))}));case 3:return n.abrupt("return",this);case 4:case"end":return n.stop()}},n,this)}))}},{key:"synchronize",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise(function(e){setTimeout(e,500)});case 2:return this.graph.createGraph(),e.abrupt("return",this);case 4:case"end":return e.stop()}},e,this)}))}},{key:"serialize",value:function(){return(0,SW.serializeN3Store)(this.store)}},{key:"deserialize",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.store=(0,SW.deserializeN3Store)(e,SW.DataFactory),this.graph=new QW(this),this.scene=new $W(this),t.next=5,new Promise(function(e){setTimeout(e,10)});case 5:case"end":return t.stop()}},t,this)}))}},{key:"getIds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){var n,i,r,o,a,s=function(e){var t=new Set;return e.forSubjects(function(e){return t.add(e.id)},RW.spatialEntity,null,null),t}(e);if(s.size>0&&(s=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=new Set;if(e.forSubjects(uq(t,i),RW.spatialEntity,null,null),!n){var r=new Set;return t.forEach(function(e){return i.has(e)?void 0:r.add(e)}),r}return i}(e,s)),s.size>0&&("Male"===t.sex||"Female"===t.sex)){var u=t.sex;s=sq(e,s,function(t){return function(e,t,n){var i=new Set;return e.forSubjects(uq(t,i),RW.sex,RW[n],null),i}(e,t,u)})}if(s.size>0&&(null===(n=t.tmc)||void 0===n?void 0:n.length)>0&&(s=sq(e,s,function(n){return function(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=SW.DataFactory.literal(a);e.forSubjects(uq(t,r),RW.providerName,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,n,t.tmc)})),s.size>0&&(null===(i=t.technologies)||void 0===i?void 0:i.length)>0&&(s=function(e,t,n){var i,r=new Map,o=new Set,a=new Set;e.some(function(e){return t.has(e.subject.id)&&a.add(e.object.id),!1},null,RW.sections,null,null),e.some(function(e){var n;return(t.has(e.subject.id)||a.has(e.subject.id))&&(o.add(e.object.id),r.has(e.object.id)?null===(n=r.get(e.object.id))||void 0===n||n.push(e.subject.id):r.set(e.object.id,[e.subject.id])),!1},null,RW.datasets,null,null);var s,u=n(o),c=new Set,l=_(u);try{for(l.s();!(s=l.n()).done;){var h,f=s.value,d=_(null!==(i=r.get(f))&&void 0!==i?i:[]);try{for(d.s();!(h=d.n()).done;){var p=h.value;c.add(p)}}catch(v){d.e(v)}finally{d.f()}}}catch(v){l.e(v)}finally{l.f()}return c}(e,s,function(n){return function(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=SW.DataFactory.literal(a);e.forSubjects(uq(t,r),RW.technology,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,n,t.technologies)})),s.size>0&&(null===(r=t.ontologyTerms)||void 0===r?void 0:r.length)>0&&(s=function(e,t,n){var i,r=new Map,o=new Set;e.some(function(e){var n;return t.has(e.subject.id)&&(o.add(e.object.id),r.has(e.object.id)?null===(n=r.get(e.object.id))||void 0===n||n.push(e.subject.id):r.set(e.object.id,[e.subject.id])),!1},null,RW.spatialEntity,null,null);var a,s=n(o),u=new Set,c=_(s);try{for(c.s();!(a=c.n()).done;){var l,h=a.value,f=_(null!==(i=r.get(h))&&void 0!==i?i:[]);try{for(f.s();!(l=f.n()).done;){var d=l.value;u.add(d)}}catch(p){f.e(p)}finally{f.f()}}}catch(p){c.e(p)}finally{c.f()}return u}(e,s,function(n){return function(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=SW.DataFactory.namedNode(a);e.forSubjects(uq(t,r),NW.spatialEntity.ccf_annotations,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,n,t.ontologyTerms)})),s.size>0&&2===(null===(o=t.ageRange)||void 0===o?void 0:o.length)&&(0,TW.isFinite)(t.ageRange[0])&&(0,TW.isFinite)(t.ageRange[1])){var c=Math.max.apply(Math,v(t.ageRange)),l=Math.min.apply(Math,v(t.ageRange));1===l&&110===c||(s=sq(e,s,function(t){return function(e,t,n,i){var r=new Set;return e.some(function(e){if(t.has(e.subject.id)){var o=(0,AW.fromRdf)(e.object);o>=n&&o<=i&&r.add(e.subject.id)}return!1},null,RW.age,null,null),r}(e,t,l,c)}))}if(s.size>0&&2===(null===(a=t.bmiRange)||void 0===a?void 0:a.length)&&(0,TW.isFinite)(t.bmiRange[0])&&(0,TW.isFinite)(t.bmiRange[1])){var h=Math.max.apply(Math,v(t.bmiRange)),f=Math.min.apply(Math,v(t.bmiRange));13===f&&83===h||(s=sq(e,s,function(t){return function(e,t,n,i){var r=new Set;return e.some(function(e){if(t.has(e.subject.id)){var o=(0,AW.fromRdf)(e.object);o>=n&&o<=i&&r.add(e.subject.id)}return!1},null,RW.bmi,null,null),r}(e,t,f,h)}))}return s}(this.store,e)}},{key:"get",value:function(e){return this.store.getQuads(SW.DataFactory.namedNode(e),null,null,null)}},{key:"search",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v(this.getIds(t)).map(function(t){return e.get(t)})}},{key:"getSpatialEntities",value:function(e){var t=this;return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),v(this.getIds(e)).map(function(e){return YW(t.store,e)})}},{key:"getDatasetTechnologyNames",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t=new Set;return e.some(function(e){return t.add(e.object.value),!1},null,RW.technology,null,null),Array.from(t).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getProviderNames",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t=new Set;return e.some(function(e){return t.add(e.object.value),!1},null,RW.providerName,null,null),Array.from(t).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getTissueBlockResults",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),v(this.getIds(e)).map(function(e){return yq(n.store,e)})));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getAggregateResults",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",function(e,n){var i=new Set;n.some(function(t){return e.has(t.subject.id)&&i.add(t.object.id),!1},null,RW.donor,null,null);var r=new Set;n.some(function(e){return i.has(e.subject.id)&&r.add(e.object.id),!1},null,RW.providerUUID,null,null);var o=new Set;n.forSubjects(function(t){e.has(t.id)&&o.add(t.id)},RW.spatialEntity,null,null);var a=new Set;n.some(function(e){return o.has(e.subject.id)&&a.add(e.object.id),!1},null,RW.sections,null,null);var s=new Set;return n.some(function(e){var t=e.subject;return(o.has(t.id)||a.has(t.id))&&s.add(e.object.id),!1},null,RW.datasets,null,null),Object.entries({"Tissue Data Providers":r.size,Donors:i.size,"Tissue Blocks":o.size,"Tissue Sections":a.size,"Tissue Datasets":s.size}).map(function(e){var n=t(e,2);return{label:n[0],count:n[1]}})}(this.getIds(e),this.store));case 1:case"end":return n.stop()}},n,this)}))}},{key:"getOntologyTermOccurences",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var n=new Map;t.some(function(t){return e.has(t.subject.id)&&(n.has(t.object.id)?n.get(t.object.id).push(t.subject.id):n.set(t.object.id,[t.subject.id])),!1},null,RW.spatialEntity,null,null);var i={};return t.some(function(e){var t,r;if(n.has(e.subject.id)){var o=null!==(r=null===(t=n.get(e.subject.id))||void 0===t?void 0:t.length)&&void 0!==r?r:0;i[e.object.id]=o+(i[e.object.id]||0)}return!1},null,NW.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getOntologyTreeModel",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){var t={root:jW.body.id,nodes:{}},n=new Set;e.some(function(e){return n.add(e.subject.id),n.add(e.predicate.id),!1},null,NW.ontologyNode.parent,null,null);var i,r=_(n);try{for(r.s();!(i=r.n()).done;){var o=i.value;t.nodes[o]=lq(e,o)}}catch(a){r.e(a)}finally{r.f()}return t}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getReferenceOrgans",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.scene.getReferenceOrgans());case 1:case"end":return e.stop()}},e,this)}))}},{key:"getScene",value:function(e){return yw(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(this.graph.createGraph(),this.scene.getScene(e)));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getReferenceOrganScene",value:function(e,t){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)));case 1:case"end":return n.stop()}},n,this)}))}}]),e}(),wq=Symbol("Comlink.proxy"),kq=Symbol("Comlink.endpoint"),xq=Symbol("Comlink.releaseProxy"),Sq=Symbol("Comlink.thrown"),Eq=function(e){return"object"==typeof e&&null!==e||"function"==typeof e},Cq=new Map([["proxy",{canHandle:function(e){return Eq(e)&&e[wq]},serialize:function(e){var t=new MessageChannel,n=t.port1,i=t.port2;return Oq(e,n),[i,[i]]},deserialize:function(e){return e.start(),Aq(e)}}],["throw",{canHandle:function(e){return Eq(e)&&Sq in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}}]]);function Oq(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;n.addEventListener("message",function i(r){if(r&&r.data){var a,s=Object.assign({path:[]},r.data),u=s.id,c=s.type,l=s.path,f=(r.data.argumentList||[]).map(Lq);try{var d=l.slice(0,-1).reduce(function(e,t){return e[t]},e),p=l.reduce(function(e,t){return e[t]},e);switch(c){case"GET":a=p;break;case"SET":d[l.slice(-1)[0]]=Lq(r.data.value),a=!0;break;case"APPLY":a=p.apply(d,f);break;case"CONSTRUCT":a=function(e){return Object.assign(e,o({},wq,!0))}(h(p,v(f)));break;case"ENDPOINT":var g=new MessageChannel,m=g.port1,y=g.port2;Oq(e,y),a=function(e,t){return Dq.set(e,t),e}(m,[m]);break;case"RELEASE":a=void 0;break;default:return}}catch(d){a=o({value:d},Sq,0)}Promise.resolve(a).catch(function(e){return o({value:e},Sq,0)}).then(function(e){var r=t(Nq(e),2),o=r[0],a=r[1];n.postMessage(Object.assign(Object.assign({},o),{id:u}),a),"RELEASE"===c&&(n.removeEventListener("message",i),Tq(n))})}}),n.start&&n.start()}function Tq(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function Aq(e,t){return Mq(e,[],t)}function Pq(e){if(e)throw new Error("Proxy has been released and is not useable")}function Mq(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=!1,o=new Proxy(i,{get:function(t,i){if(Pq(r),i===xq)return function(){return jq(e,{type:"RELEASE",path:n.map(function(e){return e.toString()})}).then(function(){Tq(e),r=!0})};if("then"===i){if(0===n.length)return{then:function(){return o}};var a=jq(e,{type:"GET",path:n.map(function(e){return e.toString()})}).then(Lq);return a.then.bind(a)}return Mq(e,[].concat(v(n),[i]))},set:function(i,o,a){Pq(r);var s=t(Nq(a),2),u=s[0],c=s[1];return jq(e,{type:"SET",path:[].concat(v(n),[o]).map(function(e){return e.toString()}),value:u},c).then(Lq)},apply:function(i,o,a){Pq(r);var s=n[n.length-1];if(s===kq)return jq(e,{type:"ENDPOINT"}).then(Lq);if("bind"===s)return Mq(e,n.slice(0,-1));var u=t(Rq(a),2),c=u[0],l=u[1];return jq(e,{type:"APPLY",path:n.map(function(e){return e.toString()}),argumentList:c},l).then(Lq)},construct:function(i,o){Pq(r);var a=t(Rq(o),2),s=a[0],u=a[1];return jq(e,{type:"CONSTRUCT",path:n.map(function(e){return e.toString()}),argumentList:s},u).then(Lq)}});return o}function Iq(e){return Array.prototype.concat.apply([],e)}function Rq(e){var t=e.map(Nq);return[t.map(function(e){return e[0]}),Iq(t.map(function(e){return e[1]}))]}var Dq=new WeakMap;function Nq(e){var n,i=_(Cq);try{for(i.s();!(n=i.n()).done;){var r=t(n.value,2),o=r[0],a=r[1];if(a.canHandle(e)){var s=t(a.serialize(e),2);return[{type:"HANDLER",name:o,value:s[0]},s[1]]}}}catch(u){i.e(u)}finally{i.f()}return[{type:"RAW",value:e},Dq.get(e)||[]]}function Lq(e){switch(e.type){case"HANDLER":return Cq.get(e.name).deserialize(e.value);case"RAW":return e.value}}function jq(e,t,n){return new Promise(function(i){var r=new Array(4).fill(0).map(function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}).join("-");e.addEventListener("message",function t(n){!n.data||!n.data.id||n.data.id!==r||(e.removeEventListener("message",t),i(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:r},t),n)})}function Fq(e,t){return e===t}var Bq=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.locator=n,this.subscriptions=new W,this.dataSource=t.config$.pipe(od(function(e){return Object.keys(e).length>0}),ue(function(e){return e}),Qf(Fq),dd(function(e){return t=function(t){return i.connectDataSource(t.source,e)},new ee(function(e){var n,r;try{n=i.createDataSource()}catch(a){return void e.error(a)}try{r=t(n)}catch(a){return void e.error(a)}var o=(r?me(r):md).subscribe(e);return function(){o.unsubscribe(),n&&n.unsubscribe()}});var t}),Od(1))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"getTissueBlockResults",value:function(e){return this.dataSource.pipe(dd(function(t){return t.getTissueBlockResults(e)}),ap(1))}},{key:"getDatasetTechnologyNames",value:function(){return this.dataSource.pipe(dd(function(e){return e.getDatasetTechnologyNames()}),ap(1))}},{key:"getProviderNames",value:function(){return this.dataSource.pipe(dd(function(e){return e.getProviderNames()}),ap(1))}},{key:"getAggregateResults",value:function(e){return this.dataSource.pipe(dd(function(t){return t.getAggregateResults(e)}),ap(1))}},{key:"getOntologyTermOccurences",value:function(e){return this.dataSource.pipe(dd(function(t){return t.getOntologyTermOccurences(e)}),ap(1))}},{key:"getOntologyTreeModel",value:function(){return this.dataSource.pipe(dd(function(e){return e.getOntologyTreeModel()}),ap(1))}},{key:"getReferenceOrgans",value:function(){return this.dataSource.pipe(dd(function(e){return e.getReferenceOrgans()}),ap(1))}},{key:"getScene",value:function(e){return this.dataSource.pipe(dd(function(t){return t.getScene(e)}),ap(1))}},{key:"createDataSource",value:function(){var e,t,n,i=this,r=function(){};"undefined"==typeof Worker||dW.disableDbWorker?e=new _q:(t=this.getWebWorkerDataSource(!0),e=t.source,n=t.worker,r=function(){return yw(i,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e[xq]();case 2:n.terminate();case 3:case"end":return t.stop()}},t)}))});return{source:e,unsubscribe:r}}},{key:"connectDataSource",value:function(e,t){return yw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=dW.disableDbWorker,!n.t0){n.next=4;break}return n.next=4,new Promise(function(e){setTimeout(e,100)});case 4:return i=(new Date).getTime(),n.next=7,e.connect(t,!0);case 7:return dW.production||console.info("Loaded CCF database in ".concat(((new Date).getTime()-i)/1e3,"s")),n.abrupt("return",e);case 9:case"end":return n.stop()}},n)}))}},{key:"getWebWorkerDataSource",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t)e=new Worker(r.tu(new URL(r.p+r.u(10),r.b)),{type:void 0});else{var n=this.locator.prepareExternalUrl("0-es2015.worker.js"),i=new Blob(["importScripts('".concat(n,"')")],{type:"application/javascript"});e=new Worker(URL.createObjectURL(i),{type:"module"})}return{source:Aq(e),worker:e}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(tW),Qi(wh))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac,providedIn:"root"}),e}();function Vq(e,t,n,i){n&&"function"!=typeof n&&(i=n);var r="function"==typeof n?n:void 0,o=new Ed(e,t,i);return function(e){return Re(function(){return o},r)(e)}}var zq=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},Uq=function(e){return e.map(function(e){return void 0!==e?JSON.parse(JSON.stringify(e)):e})},Hq={storageStrategy:function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).cachePairs=[],e}return b(n,[{key:"add",value:function(e,t,n){this.cachePairs.push(e)}},{key:"addMany",value:function(e){this.cachePairs=e}},{key:"updateAtIndex",value:function(e,t){Object.assign(this.cachePairs[e],t)}},{key:"update",value:function(e,t){Object.assign(this.cachePairs[e],t)}},{key:"getAll",value:function(){return this.cachePairs}},{key:"removeAtIndex",value:function(e){this.cachePairs.splice(e,1)}},{key:"remove",value:function(e){this.cachePairs.splice(e,1)}},{key:"removeAll",value:function(){this.cachePairs.length=0}}]),n}(function(){return function e(){m(this,e)}}()),globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},Gq=new oe;function Wq(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,n,i){var r=this,o=e.cacheKey||t.constructor.name+"#"+n,a=i.value;if(i&&i.value){var s=e.storageStrategy?new e.storageStrategy:new Hq.storageStrategy,u=[];e.cacheModifier&&e.cacheModifier.subscribe(function(e){return s.addMany(e(s.getAll(o,r)),o,r)}),Ce(Gq.asObservable(),e.cacheBusterObserver?e.cacheBusterObserver:yd()).subscribe(function(e){s.removeAll(o,r),u.length=0}),e.cacheResolver=e.cacheResolver||Hq.cacheResolver||zq,e.cacheHasher=e.cacheHasher||Hq.cacheHasher||Uq,i.value=function(){for(var t=this,n=s.getAll(o,this),i=arguments.length,r=new Array(i),c=0;c(e.maxAge||Hq.maxAge)?(s.remove?s.remove(n.indexOf(h),h,o,this):s.removeAtIndex(n.indexOf(h),o,this),h=null):(e.slidingExpiration||Hq.slidingExpiration)&&(h.created=new Date,s.update?s.update(n.indexOf(h),h,o,this):s.updateAtIndex(n.indexOf(h),h,o,this))),h){var d=jf(h.response);return e.async?d.pipe(Hz(0)):d}if(f)return f.response;var p=a.call.apply(a,[this].concat(r)).pipe(Cb(function(){var t=u.find(function(t){return e.cacheResolver(t.parameters,l)});u.splice(u.indexOf(t),1)}),rv(function(i){(!e.shouldCacheDecider||e.shouldCacheDecider(i))&&((!(e.maxCacheCount||Hq.maxCacheCount)||1===(e.maxCacheCount||Hq.maxCacheCount)||(e.maxCacheCount||Hq.maxCacheCount)&&(e.maxCacheCount||Hq.maxCacheCount)0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).sort().reduce(function(t,n){var i=e[n];return function(e){return null==e||""===e||Array.isArray(e)&&0===e.length}(i)?t:t.set(n,function(e){return Array.isArray(e)?e.join(","):"".concat(e)}(i))},new jb)}},{key:"withToken",value:function(e){var t=this.globalConfig.snapshot.hubmapToken;return t?e.set("token",t):e}}]),e}();qq.\u0275fac=function(e){return new(e||qq)(Qi(tW),Qi(Kb))},qq.\u0275prov=Ke({token:qq,factory:qq.\u0275fac,providedIn:"root"}),vw([Wq()],qq.prototype,"getProviderNames",null),vw([Wq()],qq.prototype,"getDatasetTechnologyNames",null),vw([Wq()],qq.prototype,"getOntologyTreeModel",null),vw([Wq()],qq.prototype,"getReferenceOrgans",null),vw([Wq()],qq.prototype,"getTissueBlockResults",null),vw([Wq()],qq.prototype,"getAggregateResults",null),vw([Wq()],qq.prototype,"getOntologyTermOccurences",null),vw([Wq()],qq.prototype,"getScene",null);var Xq=function(){var e=function(){function e(t,n,i){m(this,e),this.impl$=t.config$.pipe(ue(function(e){return!!e.useRemoteApi&&!!e.remoteApiEndpoint}),ue(function(e){return e?i:n}),Qf(),Od(1))}return b(e,[{key:"getProviderNames",value:function(){return this.forwardCall("getProviderNames")}},{key:"getDatasetTechnologyNames",value:function(){return this.forwardCall("getDatasetTechnologyNames")}},{key:"getOntologyTreeModel",value:function(){return this.forwardCall("getOntologyTreeModel")}},{key:"getReferenceOrgans",value:function(){return this.forwardCall("getReferenceOrgans")}},{key:"getTissueBlockResults",value:function(e){return this.forwardCall("getTissueBlockResults",e)}},{key:"getAggregateResults",value:function(e){return this.forwardCall("getAggregateResults",e)}},{key:"getOntologyTermOccurences",value:function(e){return this.forwardCall("getOntologyTermOccurences",e)}},{key:"getScene",value:function(e){return this.forwardCall("getScene",e)}},{key:"forwardCall",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:[];return{ngModule:e,providers:[JH,ZH,QH].concat(v(t))}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(JH,2),Qi(ZH,2))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),$q=function(e,t){return function(e,t){return new Array(t+1).join("0")}(0,t-e.toString().length)+e},Zq=function(){function e(t,n,i){m(this,e),this.action=t,this.store=n,this.logWriter=i}return b(e,[{key:"dispatched",value:function(e){var t=bB(this.action),n=function(e){return $q(e.getHours(),2)+":"+$q(e.getMinutes(),2)+":"+$q(e.getSeconds(),2)+"."+$q(e.getMilliseconds(),3)}(new Date);this.logWriter.startGroup("action ".concat(t," @ ").concat(n)),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}},{key:"completed",value:function(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}},{key:"errored",value:function(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}},{key:"_hasPayload",value:function(e){return this._getNonEmptyProperties(e).length>0}},{key:"_getNonEmptyProperties",value:function(e){return Object.keys(e).map(function(t){return e[t]}).filter(function(e){return void 0!==e})}}]),e}(),Jq=function(){function e(t){m(this,e),this.options=t,this.options=this.options||{},this.logger=t.logger||console}return b(e,[{key:"startGroup",value:function(e){var t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(n){console.log(e)}}},{key:"endGroup",value:function(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}},{key:"logGrey",value:function(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}},{key:"logGreen",value:function(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}},{key:"logRedish",value:function(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}},{key:"log",value:function(e,t,n){this.isIE()?this.logger.log(e,n):this.logger.log("%c "+e,t,n)}},{key:"isIE",value:function(){var e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"",t=!1,n=e.indexOf("MSIE "),i=e.indexOf("Trident/");return(n>-1||i>-1)&&(t=!0),t}}]),e}(),eX=new Mi("NGXS_LOGGER_PLUGIN_OPTIONS"),tX=function(){var e=function(){function e(t,n){m(this,e),this._options=t,this._injector=n}return b(e,[{key:"handle",value:function(e,t,n){if(this._options.disabled||!this._options.filter(t,e))return n(e,t);this._logWriter=this._logWriter||new Jq(this._options),this._store=this._store||this._injector.get(qB);var i=new Zq(t,this._store,this._logWriter);return i.dispatched(e),n(e,t).pipe(rv(function(e){i.completed(e)}),xb(function(e){throw i.errored(e),e}))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(eX),Qi(os))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac}),e}(),nX=new Mi("LOGGER_USER_OPTIONS");function iX(e){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:function(){return!0}},e)}var rX=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(t){return{ngModule:e,providers:[{provide:hB,useClass:tX,multi:!0},{provide:nX,useValue:t},{provide:eX,useFactory:iX,deps:[nX]}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),oX=new RegExp("[^#a-f\\d]","gi"),aX=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),sX=["#FF8800","#2979ff","#ffd740","#b92dff","#da326f","#7323e2","#acf32b","#82B1FF","#E040FB","#00E5FF"].map(function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e||oX.test(e)||!aX.test(e))throw new TypeError("Expected a valid hex string");var n=1;8===(e=e.replace(/^#/,"")).length&&(n=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),4===e.length&&(n=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var i=Number.parseInt(e,16),r=i>>16,o=i>>8&255,a=255&i,s="number"==typeof t.alpha?t.alpha:n;return"array"===t.format?[r,o,a,s]:"css"===t.format?"rgb(".concat(r," ").concat(o," ").concat(a).concat(1===s?"":" / ".concat(Number((100*s).toFixed(2)),"%"),")"):{red:r,green:o,blue:a,alpha:s}}(e,{format:"array"});return n[3]=255,{color:e,rgba:n,rank:t}}),uX=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).forcedUnassignment=new oe,e.forcedUnassignment$=e.forcedUnassignment.asObservable(),e.colorAssignments$=e.state$.pipe(mU("colorAssignments"),Qf()),e.colorAssignmentsList$=e.state$.pipe(mU("colorAssignmentsList"),Qf()),e}return b(n,[{key:"getColor",value:function(e){return this.snapshot.colorAssignments[e]}},{key:"assignColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.snapshot,i=n.colorAssignments,r=n.colorAssignmentsList,o=n.colorsAvailable;t&&(o=this.snapshot.colorPalette.concat(),r=[],i={});var a=i[e];return a||(o.length>0?a=o[0]:(a=r[r.length-1].color,r=r.slice(0,-1),this.forcedUnassignment.next()),o=o.filter(function(e){return e.color!==a.color}),i=(r=[{color:a,key:e}].concat(r)).reduce(function(e,t,n){return e[t.key]=Object.assign(Object.assign({},t.color),{rank:n}),e},{}),this.ctx.patchState({colorsAvailable:o,colorAssignments:i,colorAssignmentsList:r})),a}},{key:"unassignColor",value:function(e){var t=this.snapshot,n=t.colorAssignments,i=t.colorAssignmentsList,r=t.colorsAvailable,o=n[e];o&&(r=[o].concat(r),n=(i=i.filter(function(e){return e.color.color!==o.color})).reduce(function(e,t,n){return e[t.key]=Object.assign(Object.assign({},t.color),{rank:n}),e},{}),this.ctx.patchState({colorsAvailable:r,colorAssignments:n,colorAssignmentsList:i}))}}]),n}(bG);function cX(e,t){return function(n){return n.lift(new lX(e,t))}}uX.\u0275fac=function(){var e;return function(t){return(e||(e=Ci(uX)))(t||uX)}}(),uX.\u0275prov=Ke({token:uX,factory:uX.\u0275fac}),vw([pG(),gw(0,vG("key")),gw(1,vG("doReset"))],uX.prototype,"assignColor",null),vw([pG(),gw(0,vG("key"))],uX.prototype,"unassignColor",null),uX=vw([gG(),eV({name:"colors",defaults:{colorPalette:sX.concat(),colorsAvailable:sX.concat(),colorAssignments:{},colorAssignmentsList:[]}})],uX);var lX=function(){function e(t,n){m(this,e),this.keySelector=t,this.flushes=n}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new hX(e,this.keySelector,this.flushes))}}]),e}(),hX=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,e)).keySelector=i,o.values=new Set,r&&o.add(_e(r,new ye(c(o)))),o}return b(n,[{key:"notifyNext",value:function(){this.values.clear()}},{key:"notifyError",value:function(e){this._error(e)}},{key:"_next",value:function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)}},{key:"_useKeySelector",value:function(e){var t,n=this.destination;try{t=this.keySelector(e)}catch(i){return void n.error(i)}this._finalizeNext(t,e)}},{key:"_finalizeNext",value:function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))}}]),n}(be),fX={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"]},dX=(function(e){e.Running="running",e.Completed="completed"}(dX||(dX={})),dX);function pX(e){return function(){return e.next(dX.Completed)}}function vX(e,t){return function(n){return n.pipe(dd(e),rv(t),Vq(1),Oe())}}var gX=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this)).source=e,i._tissueBlockDataQueryStatus$=new Ed(1),i._aggregateDataQueryStatus$=new Ed(1),i._termOccurencesDataQueryStatus$=new Ed(1),i._sceneDataQueryStatus$=new Ed(1),i._technologyFilterQueryStatus$=new Ed(1),i._providerFilterQueryStatus$=new Ed(1),i.ontologyTermsFullData$=new Ed(1),i.filter$=i.state$.pipe(mU("filter")),i.tissueBlockData$=i.filter$.pipe(vX(i.tissueBlockData,pX(i._tissueBlockDataQueryStatus$))),i.aggregateData$=i.filter$.pipe(vX(i.aggregateData,pX(i._aggregateDataQueryStatus$))),i.termOccurencesData$=i.filter$.pipe(vX(i.termOccurencesData,pX(i._termOccurencesDataQueryStatus$))),i.sceneData$=i.filter$.pipe(vX(i.sceneData,pX(i._sceneDataQueryStatus$))),i.technologyFilterData$=i.filter$.pipe(vX(i.technologyFilterData,pX(i._technologyFilterQueryStatus$))),i.providerFilterData$=i.filter$.pipe(vX(i.providerFilterData,pX(i._providerFilterQueryStatus$))),i.tissueBlockDataQueryStatus$=i._tissueBlockDataQueryStatus$.pipe(cX()),i.aggregateDataQueryStatus$=i._aggregateDataQueryStatus$.pipe(cX()),i.termOccurencesDataQueryStatus$=i._termOccurencesDataQueryStatus$.pipe(cX()),i.sceneDataQueryStatus$=i._sceneDataQueryStatus$.pipe(cX()),i.technologyFilterQueryStatus$=i._technologyFilterQueryStatus$.pipe(cX()),i.providerFilterQueryStatus$=i._providerFilterQueryStatus$.pipe(cX()),i.queryStatus$=j_([i.tissueBlockDataQueryStatus$,i.aggregateDataQueryStatus$,i.termOccurencesDataQueryStatus$,i.sceneDataQueryStatus$,i.technologyFilterQueryStatus$,i.providerFilterQueryStatus$]).pipe(ue(function(e){return function(e){return e.every(function(e){return e===dX.Completed})}(e)?dX.Completed:dX.Running}),cX()),i._tissueBlockDataQueryStatus$.next(dX.Completed),i._aggregateDataQueryStatus$.next(dX.Completed),i._termOccurencesDataQueryStatus$.next(dX.Completed),i._sceneDataQueryStatus$.next(dX.Completed),i._technologyFilterQueryStatus$.next(dX.Completed),i._providerFilterQueryStatus$.next(dX.Completed),i}return b(n,[{key:"ngxsOnInit",value:function(){var e=this.ontologyTermsFullData$,t=this.termOccurencesData$,n=this.source;this.snapshot.filter===fX?t.pipe(ap(1)).subscribe(e):n.getOntologyTermOccurences().pipe(ap(1)).subscribe(e)}},{key:"updateFilter",value:function(e){this.patchState({filter:Object.assign(Object.assign({},this.getState().filter),e)})}},{key:"tissueBlockData",value:function(e){return this._tissueBlockDataQueryStatus$.next(dX.Running),this.source.getTissueBlockResults(e)}},{key:"aggregateData",value:function(e){return this._aggregateDataQueryStatus$.next(dX.Running),this.source.getAggregateResults(e)}},{key:"termOccurencesData",value:function(e){return this._termOccurencesDataQueryStatus$.next(dX.Running),this.source.getOntologyTermOccurences(e)}},{key:"sceneData",value:function(e){return this._sceneDataQueryStatus$.next(dX.Running),this.source.getScene(e)}},{key:"technologyFilterData",value:function(){return this._technologyFilterQueryStatus$.next(dX.Running),this.source.getDatasetTechnologyNames()}},{key:"providerFilterData",value:function(){return this._providerFilterQueryStatus$.next(dX.Running),this.source.getProviderNames()}}]),n}(yG);gX.\u0275fac=function(e){return new(e||gX)(Qi(Yq))},gX.\u0275prov=Ke({token:gX,factory:gX.\u0275fac}),vw([pG(),gw(0,vG("filter"))],gX.prototype,"updateFilter",null),vw([OF.ak],gX.prototype,"tissueBlockData",null),vw([OF.ak],gX.prototype,"aggregateData",null),vw([OF.ak],gX.prototype,"termOccurencesData",null),vw([OF.ak],gX.prototype,"sceneData",null),vw([OF.ak],gX.prototype,"technologyFilterData",null),vw([OF.ak],gX.prototype,"providerFilterData",null),gX=vw([gG(),eV({name:"data",defaults:{filter:fX}})],gX);var mX=[{name:"logo",namespace:"app",url:"assets/icons/app/hubmap-logo.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs_bladder.svg"},{name:"bone_marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs_brain.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs_heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs_kidney.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"large_intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs_liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs_lung.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lymph_nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small_intestine",namespace:"app",url:"assets/icons/organs/ico-organs_small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs_spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"vasculature",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"expand_more",namespace:"app",url:"assets/icons/expand_more-24px.svg"},{name:"expand_less",namespace:"app",url:"assets/icons/expand_less-24px.svg"},{name:"filter",url:"assets/icons/filter.svg"}],yX=function(e){a(n,e);var t=s(n);function n(e,i){var r;m(this,n),(r=t.call(this)).registry=e;var o,a=_(mX);try{for(a.s();!(o=a.n()).done;){var s=o.value,u=s.name,c=s.namespace,l=s.url,h=s.html,f={name:u,namespace:c,url:l&&i.bypassSecurityTrustResourceUrl(l),html:h&&i.bypassSecurityTrustHtml(h)};r.registerIconImpl(f)}}catch(d){a.e(d)}finally{a.f()}return r}return b(n,[{key:"registerIcon",value:function(e){return this.registerIconImpl(e)}},{key:"registerIconImpl",value:function(e){if(!this.registry||!e.url&&!e.html)return!1;var t=this.registry,n=t[this.getMethodName(e)],i=this.getArguments(e);if(!n)return!1;try{return n.apply(t,i),!0}catch(r){return!1}}},{key:"getMethodName",value:function(e){var t=e.name,n=e.namespace,i=e.url,r=["addSvgIcon"];return t||r.push("Set"),i||r.push("Literal"),n&&r.push("InNamespace"),r.join("")}},{key:"getArguments",value:function(e){var t=e.name,n=e.namespace,i=e.url,r=e.html;return[n,t,null!=i?i:r].filter(function(e){return!!e})}}]),n}(yG);yX.\u0275fac=function(e){return new(e||yX)(Qi(p_,8),Qi(Of))},yX.\u0275prov=Ke({token:yX,factory:yX.\u0275fac}),vw([pG()],yX.prototype,"registerIcon",null),yX=vw([gG(),eV({name:"iconRegistry"})],yX);var bX=function(n){a(r,n);var i=s(r);function r(e,t){var n;return m(this,r),(n=i.call(this)).dataService=e,n.injector=t,n.listResults$=n.state$.pipe(mU("listResults"),Qf()),n.highlightedNodeId$=n.state$.pipe(mU("highlightedNodeId"),Qf()),n}return b(r,[{key:"setListResults",value:function(e){this.ctx.patchState({listResults:e})}},{key:"selectListResult",value:function(e){this.colorAssignments.assignColor(e.tissueBlock.spatialEntityId)}},{key:"deselectListResult",value:function(e){this.colorAssignments.unassignColor(e.tissueBlock.spatialEntityId)}},{key:"highlightNode",value:function(e){this.ctx.patchState({highlightedNodeId:e})}},{key:"unHighlightNode",value:function(){this.ctx.patchState({highlightedNodeId:void 0})}},{key:"ngxsOnInit",value:function(){var n=this;e(p(r.prototype),"ngxsOnInit",this).call(this),this.dataState=this.injector.get(gX),this.colorAssignments=this.injector.get(uX),j_([this.dataState.tissueBlockData$,this.colorAssignments.colorAssignments$]).pipe(ue(function(e){var n,i=t(e,2),r=i[0],o=i[1],a=[],s=[],u=_(r);try{for(u.s();!(n=u.n()).done;){var c=n.value,l=o[c.spatialEntityId];l?a.push({selected:!0,color:l.color,tissueBlock:c,rank:l.rank}):s.push({selected:!1,tissueBlock:c})}}catch(h){u.e(h)}finally{u.f()}return(0,TW.sortBy)(a,["rank"]).concat(s)}),rv(function(e){return n.setListResults(e)})).subscribe()}}]),r}(bG);function _X(e,t,n){t[n.id]=n,(0,TW.forEach)(n.children,function(n){return _X(e,t,e[n])})}function wX(e,t){var n={"@id":e.root,"@type":"OntologyTreeNode",id:e.root,label:"body",parent:"",children:t,synonymLabels:[]},i=(0,TW.at)(e.nodes,t),r=o({},n.id,n);return(0,TW.forEach)(i,function(e){return e.parent=n.id}),(0,TW.forEach)(i,function(t){return _X(e.nodes,r,t)}),{root:n.id,nodes:r}}bX.\u0275fac=function(e){return new(e||bX)(Qi(Yq),Qi(os))},bX.\u0275prov=Ke({token:bX,factory:bX.\u0275fac}),vw([pG(),gw(0,vG("listResults"))],bX.prototype,"setListResults",null),bX=vw([gG(),eV({name:"listResults",defaults:{listResults:[]}})],bX);var kX=function(n){a(r,n);var i=s(r);function r(e){var t;return m(this,r),(t=i.call(this)).dataService=e,t.nodes$=t.state$.pipe(ue(function(e){return Object.values(e.nodes)})),t.rootNode$=t.state$.pipe(ue(function(e){return e.nodes[e.root]})),t}return b(r,[{key:"setOntology",value:function(e){this.ctx.setState(e)}},{key:"ngxsOnInit",value:function(){e(p(r.prototype),"ngxsOnInit",this).call(this),this.loadOntology()}},{key:"loadOntology",value:function(){var e=this;wb([this.dataService.getOntologyTreeModel().pipe(ap(1)),this.dataService.getReferenceOrgans().pipe(ap(1))]).subscribe(function(n){var i=t(n,2),r=i[0],o=(i[1],dW.organNodes.concat()),a=(0,TW.partial)(wX,TW.partial.placeholder,o)(r);e.setOntology(a)})}}]),r}(bG);kX.\u0275fac=function(e){return new(e||kX)(Qi(Yq))},kX.\u0275prov=Ke({token:kX,factory:kX.\u0275fac}),vw([pG()],kX.prototype,"setOntology",null),kX=vw([gG(),eV({name:"ontology",defaults:{root:"",nodes:{}}})],kX);var xX=new Set(["Skin","Heart","Kidney","Spleen"]),SX=function(n){a(r,n);var i=s(r);function r(e,t){var n;return m(this,r),(n=i.call(this)).dataService=e,n.injector=t,n.referenceOrgans$=n.state$.pipe(mU("referenceOrgans"),Qf()),n.selectedReferenceOrgans$=n.state$.pipe(mU("selectedReferenceOrgans"),Qf()),n.scene$=n.state$.pipe(mU("scene"),Qf()),n.highlightedId$=n.state$.pipe(mU("highlightedId"),Qf()),n}return b(r,[{key:"setSelectedReferenceOrgans",value:function(e){this.ctx.patchState({selectedReferenceOrgans:e})}},{key:"setReferenceOrgans",value:function(e){this.ctx.patchState({referenceOrgans:e})}},{key:"setScene",value:function(e){this.ctx.patchState({scene:e})}},{key:"sceneNodeClicked",value:function(e){var t=e.node,n=e.ctrlClick;t.representation_of&&"http://purl.org/ccf/latest/ccf.owl#VHFSkin"!==t["@id"]&&t.entityId?this.dataState.updateFilter({ontologyTerms:[t.representation_of]}):t.entityId&&this.colorAssignments.assignColor(t["@id"],!n)}},{key:"sceneNodeHovered",value:function(e){this.listResults.highlightNode(e["@id"])}},{key:"sceneNodeUnhover",value:function(){this.listResults.unHighlightNode()}},{key:"ngxsOnInit",value:function(){var n=this;e(p(r.prototype),"ngxsOnInit",this).call(this),this.dataState=this.injector.get(gX),this.colorAssignments=this.injector.get(uX),this.listResults=this.injector.get(bX),this.dataService.getReferenceOrgans().pipe(ue(function(e){var t=new Set(e.map(function(e){return e.representation_of}));return zG.filter(function(e){return t.has(e.id)}).map(function(e){return Object.assign(Object.assign({},e),{disabled:!1,numResults:0})})}),ap(1),rv(function(e){n.setReferenceOrgans(e),n.setSelectedReferenceOrgans(e.filter(function(e){return xX.has(e.organ)}))})).subscribe(),j_([this.dataState.sceneData$,this.selectedReferenceOrgans$,this.colorAssignments.colorAssignments$,this.dataService.getReferenceOrgans(),this.listResults.highlightedNodeId$]).pipe(ue(function(e){var n=t(e,5),i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],u=new Set(r.map(function(e){return e.id})),c=new Set(a.filter(function(e){return u.has(e.representation_of)}).map(function(e){return e["@id"]}));return i.filter(function(e){var t,n;return(null===(n=null===(t=e.ccf_annotations)||void 0===t?void 0:t.some)||void 0===n?void 0:n.call(t,function(e){return u.has(e)}))||e.reference_organ&&c.has(e.reference_organ)}).map(function(e){return e.entityId&&(Object.prototype.hasOwnProperty.call(o,e["@id"])||s===e["@id"])?Object.assign(Object.assign({},e),{color:s===e["@id"]?[30,136,229,255]:o[e["@id"]].rgba}):e})}),rv(function(e){return n.setScene(e)})).subscribe()}}]),r}(bG);SX.\u0275fac=function(e){return new(e||SX)(Qi(Yq),Qi(os))},SX.\u0275prov=Ke({token:SX,factory:SX.\u0275fac}),vw([pG(),gw(0,vG("selectedReferenceOrgans"))],SX.prototype,"setSelectedReferenceOrgans",null),vw([pG(),gw(0,vG("referenceOrgans"))],SX.prototype,"setReferenceOrgans",null),vw([pG(),gw(0,vG("scene"))],SX.prototype,"setScene",null),SX=vw([gG(),eV({name:"scene",defaults:{scene:[],referenceOrgans:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],SX);var EX=[tW,uX,yX,bX,gX,kX,SX],CX=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Qq.forRoot(),JB.forRoot(EX,{developmentMode:!dW.production}),rX.forRoot({disabled:dW.production})]]}),e}(),OX=function(){var e=function e(t){if(m(this,e),t)throw new Error("The core module should only be imported once in the root module")};return e.\u0275fac=function(t){return new(t||e)(Qi(e,12))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[{provide:Yq,useExisting:Xq}],imports:[[u_,IG.forRoot({gaToken:dW.googleAnalyticsToken,appName:"eui"}),nW,_W,CX,Kq],_W]}),e}(),TX=["input"],AX=function(e){return{enterDuration:e}},PX=["*"],MX=new Mi("mat-checkbox-default-options",{providedIn:"root",factory:IX});function IX(){return{color:"accent",clickAction:"check-indeterminate"}}var RX=0,DX={color:"accent",clickAction:"check-indeterminate"},NX={provide:iV,useExisting:Ue(function(){return FX}),multi:!0},LX=function e(){m(this,e)},jX=Ky(Xy(Yy(qy(function(){return function e(t){m(this,e),this._elementRef=t}}())))),FX=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u){var c;return m(this,n),(c=t.call(this,e))._changeDetectorRef=i,c._focusMonitor=r,c._ngZone=o,c._animationMode=s,c._options=u,c.ariaLabel="",c.ariaLabelledby=null,c._uniqueId="mat-checkbox-"+ ++RX,c.id=c._uniqueId,c.labelPosition="after",c.name=null,c.change=new Zc,c.indeterminateChange=new Zc,c._onTouched=function(){},c._currentAnimationClass="",c._currentCheckState=0,c._controlValueAccessorChangeFn=function(){},c._checked=!1,c._disabled=!1,c._indeterminate=!1,c._options=c._options||DX,c.color=c.defaultColor=c._options.color||DX.color,c.tabIndex=parseInt(a)||0,c}return b(n,[{key:"inputId",get:function(){return"".concat(this.id||this._uniqueId,"-input")}},{key:"required",get:function(){return this._required},set:function(e){this._required=If(e)}},{key:"ngAfterViewInit",value:function(){var e=this;this._focusMonitor.monitor(this._elementRef,!0).subscribe(function(t){t||Promise.resolve().then(function(){e._onTouched(),e._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}},{key:"ngAfterViewChecked",value:function(){}},{key:"ngOnDestroy",value:function(){this._focusMonitor.stopMonitoring(this._elementRef)}},{key:"checked",get:function(){return this._checked},set:function(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck())}},{key:"disabled",get:function(){return this._disabled},set:function(e){var t=If(e);t!==this.disabled&&(this._disabled=t,this._changeDetectorRef.markForCheck())}},{key:"indeterminate",get:function(){return this._indeterminate},set:function(e){var t=e!=this._indeterminate;this._indeterminate=If(e),t&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}},{key:"_isRippleDisabled",value:function(){return this.disableRipple||this.disabled}},{key:"_onLabelTextChange",value:function(){this._changeDetectorRef.detectChanges()}},{key:"writeValue",value:function(e){this.checked=!!e}},{key:"registerOnChange",value:function(e){this._controlValueAccessorChangeFn=e}},{key:"registerOnTouched",value:function(e){this._onTouched=e}},{key:"setDisabledState",value:function(e){this.disabled=e}},{key:"_getAriaChecked",value:function(){return this.checked?"true":this.indeterminate?"mixed":"false"}},{key:"_transitionCheckState",value:function(e){var t=this._currentCheckState,n=this._elementRef.nativeElement;if(t!==e&&(this._currentAnimationClass.length>0&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(t,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);var i=this._currentAnimationClass;this._ngZone.runOutsideAngular(function(){setTimeout(function(){n.classList.remove(i)},1e3)})}}},{key:"_emitChangeEvent",value:function(){var e=new LX;e.source=this,e.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(e),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}},{key:"toggle",value:function(){this.checked=!this.checked}},{key:"_onInputClick",value:function(e){var t,n=this,i=null===(t=this._options)||void 0===t?void 0:t.clickAction;e.stopPropagation(),this.disabled||"noop"===i?!this.disabled&&"noop"===i&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==i&&Promise.resolve().then(function(){n._indeterminate=!1,n.indeterminateChange.emit(n._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}},{key:"focus",value:function(e,t){e?this._focusMonitor.focusVia(this._inputElement,e,t):this._inputElement.nativeElement.focus(t)}},{key:"_onInteractionEvent",value:function(e){e.stopPropagation()}},{key:"_getAnimationClassForCheckStateTransition",value:function(e,t){if("NoopAnimations"===this._animationMode)return"";var n="";switch(e){case 0:if(1===t)n="unchecked-checked";else{if(3!=t)return"";n="unchecked-indeterminate"}break;case 2:n=1===t?"unchecked-checked":"unchecked-indeterminate";break;case 1:n=2===t?"checked-unchecked":"checked-indeterminate";break;case 3:n=1===t?"indeterminate-checked":"indeterminate-unchecked"}return"mat-checkbox-anim-".concat(n)}},{key:"_syncIndeterminate",value:function(e){var t=this._inputElement;t&&(t.nativeElement.indeterminate=e)}}]),n}(jX);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(wc),Es(Wv),Es(Vl),Ti("tabindex"),Es(Ny,8),Es(MX,8))},e.\u0275cmp=Ct({type:e,selectors:[["mat-checkbox"]],viewQuery:function(e,t){var n;(1&e&&(hl(TX,5),hl(ob,5)),2&e)&&(ll(n=dl())&&(t._inputElement=n.first),ll(n=dl())&&(t.ripple=n.first))},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(e,t){2&e&&(Ou("id",t.id),_s("tabindex",null),su("mat-checkbox-indeterminate",t.indeterminate)("mat-checkbox-checked",t.checked)("mat-checkbox-disabled",t.disabled)("mat-checkbox-label-before","before"==t.labelPosition)("_mat-animation-noopable","NoopAnimations"===t._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[Hu([NX]),ss],ngContentSelectors:PX,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(e,t){if(1&e&&(Ws(),Ts(0,"label",0,1),Ts(2,"span",2),Ts(3,"input",3,4),Fs("change",function(e){return t._onInteractionEvent(e)})("click",function(e){return t._onInputClick(e)}),As(),Ts(5,"span",5),Ps(6,"span",6),As(),Ps(7,"span",7),Ts(8,"span",8),Wn(),Ts(9,"svg",9),Ps(10,"path",10),As(),dn.lFrame.currentNamespace=null,Ps(11,"span",11),As(),As(),Ts(12,"span",12,13),Fs("cdkObserveContent",function(){return t._onLabelTextChange()}),Ts(14,"span",14),ku(15,"\xa0"),As(),qs(16),As(),As()),2&e){var n=Ss(1),i=Ss(13);_s("for",t.inputId),qo(2),su("mat-checkbox-inner-container-no-side-margin",!i.textContent||!i.textContent.trim()),qo(1),Cs("id",t.inputId)("required",t.required)("checked",t.checked)("disabled",t.disabled)("tabIndex",t.tabIndex),_s("value",t.value)("name",t.name)("aria-label",t.ariaLabel||null)("aria-labelledby",t.ariaLabelledby)("aria-checked",t._getAriaChecked())("aria-describedby",t.ariaDescribedby),qo(2),Cs("matRippleTrigger",n)("matRippleDisabled",t._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",qc(19,AX,"NoopAnimations"===t._animationMode?0:150))}},directives:[ob,gv],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),e}(),BX=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),VX=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[ab,Wy,mv,BX],Wy,BX]}),e}(),zX=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,VX]]}),e}(),UX=["trigger"],HX=["panel"];function GX(e,t){if(1&e&&(Ts(0,"span",8),ku(1),As()),2&e){var n=Hs();qo(1),xu(n.placeholder)}}function WX(e,t){if(1&e&&(Ts(0,"span",12),ku(1),As()),2&e){var n=Hs(2);qo(1),xu(n.triggerValue)}}function qX(e,t){1&e&&qs(0,0,["*ngSwitchCase","true"])}function XX(e,t){1&e&&(Ts(0,"span",9),xs(1,WX,2,1,"span",10),xs(2,qX,1,0,"ng-content",11),As()),2&e&&(Cs("ngSwitch",!!Hs().customTrigger),qo(2),Cs("ngSwitchCase",!0))}function YX(e,t){if(1&e){var n=Ds();Ts(0,"div",13),Ts(1,"div",14,15),Fs("@transformPanel.done",function(e){return mn(n),Hs()._panelDoneAnimatingStream.next(e.toState)})("keydown",function(e){return mn(n),Hs()._handleKeydown(e)}),qs(3,1),As(),As()}if(2&e){var i=Hs();Cs("@transformPanelWrap",void 0),qo(1),Cu("mat-select-panel ",i._getPanelTheme(),""),au("transform-origin",i._transformOrigin)("font-size",i._triggerFontSize,"px"),Cs("ngClass",i.panelClass)("@transformPanel",i.multiple?"showing-multiple":"showing"),_s("id",i.id+"-panel")("aria-multiselectable",i.multiple)("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby())}}var KX=[[["mat-select-trigger"]],"*"],QX=["mat-select-trigger","*"],$X={transformPanelWrap:eg("transformPanelWrap",[og("* => void",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:11,selector:e,animation:t,options:n}}("@transformPanel",[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return{type:9,options:e}}()],{optional:!0}))]),transformPanel:eg("transformPanel",[rg("void",ig({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),rg("showing",ig({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),rg("showing-multiple",ig({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),og("void => *",tg("120ms cubic-bezier(0, 0, 0.2, 1)")),og("* => void",tg("100ms 25ms linear",ig({opacity:0})))])},ZX=0,JX=new Mi("mat-select-scroll-strategy"),eY=new Mi("MAT_SELECT_CONFIG"),tY={provide:JX,deps:[Hp],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},nY=function e(t,n){m(this,e),this.source=t,this.value=n},iY=Yy(Ky(qy(Qy(function(){return function e(t,n,i,r,o){m(this,e),this._elementRef=t,this._defaultErrorStateMatcher=n,this._parentForm=i,this._parentFormGroup=r,this.ngControl=o}}())))),rY=new Mi("MatSelectTrigger"),oY=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,l,h,f,d,p,g,y){var b,_,w,k;return m(this,n),(b=t.call(this,a,o,u,l,f))._viewportRuler=e,b._changeDetectorRef=i,b._ngZone=r,b._dir=s,b._parentFormField=h,b._liveAnnouncer=g,b._defaultOptions=y,b._panelOpen=!1,b._compareWith=function(e,t){return e===t},b._uid="mat-select-"+ZX++,b._triggerAriaLabelledBy=null,b._destroy=new oe,b._onChange=function(){},b._onTouched=function(){},b._valueId="mat-select-value-"+ZX++,b._panelDoneAnimatingStream=new oe,b._overlayPanelClass=(null===(_=b._defaultOptions)||void 0===_?void 0:_.overlayPanelClass)||"",b._focused=!1,b.controlType="mat-select",b._required=!1,b._multiple=!1,b._disableOptionCentering=null!==(k=null===(w=b._defaultOptions)||void 0===w?void 0:w.disableOptionCentering)&&void 0!==k&&k,b.ariaLabel="",b.optionSelectionChanges=lz(function(){var e=b.options;return e?e.changes.pipe(fd(e),dd(function(){return Ce.apply(void 0,v(e.map(function(e){return e.onSelectionChange})))})):b._ngZone.onStable.pipe(ap(1),dd(function(){return b.optionSelectionChanges}))}),b.openedChange=new Zc,b._openedStream=b.openedChange.pipe(od(function(e){return e}),ue(function(){})),b._closedStream=b.openedChange.pipe(od(function(e){return!e}),ue(function(){})),b.selectionChange=new Zc,b.valueChange=new Zc,b.ngControl&&(b.ngControl.valueAccessor=c(b)),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(b._typeaheadDebounceInterval=y.typeaheadDebounceInterval),b._scrollStrategyFactory=p,b._scrollStrategy=b._scrollStrategyFactory(),b.tabIndex=parseInt(d)||0,b.id=b.id,b}return b(n,[{key:"focused",get:function(){return this._focused||this._panelOpen}},{key:"placeholder",get:function(){return this._placeholder},set:function(e){this._placeholder=e,this.stateChanges.next()}},{key:"required",get:function(){return this._required},set:function(e){this._required=If(e),this.stateChanges.next()}},{key:"multiple",get:function(){return this._multiple},set:function(e){this._multiple=If(e)}},{key:"disableOptionCentering",get:function(){return this._disableOptionCentering},set:function(e){this._disableOptionCentering=If(e)}},{key:"compareWith",get:function(){return this._compareWith},set:function(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}},{key:"value",get:function(){return this._value},set:function(e){(e!==this._value||this._multiple&&Array.isArray(e))&&(this.options&&this._setSelectionByValue(e),this._value=e)}},{key:"typeaheadDebounceInterval",get:function(){return this._typeaheadDebounceInterval},set:function(e){this._typeaheadDebounceInterval=Rf(e)}},{key:"id",get:function(){return this._id},set:function(e){this._id=e||this._uid,this.stateChanges.next()}},{key:"ngOnInit",value:function(){var e=this;this._selectionModel=new Hd(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Qf(),ud(this._destroy)).subscribe(function(){return e._panelDoneAnimating(e.panelOpen)})}},{key:"ngAfterContentInit",value:function(){var e=this;this._initKeyManager(),this._selectionModel.changed.pipe(ud(this._destroy)).subscribe(function(e){e.added.forEach(function(e){return e.select()}),e.removed.forEach(function(e){return e.deselect()})}),this.options.changes.pipe(fd(null),ud(this._destroy)).subscribe(function(){e._resetOptions(),e._initializeSelection()})}},{key:"ngDoCheck",value:function(){var e=this._getTriggerAriaLabelledby();if(e!==this._triggerAriaLabelledBy){var t=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?t.setAttribute("aria-labelledby",e):t.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}},{key:"ngOnChanges",value:function(e){e.disabled&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}},{key:"ngOnDestroy",value:function(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}},{key:"toggle",value:function(){this.panelOpen?this.close():this.open()}},{key:"open",value:function(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}},{key:"close",value:function(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}},{key:"writeValue",value:function(e){this.value=e}},{key:"registerOnChange",value:function(e){this._onChange=e}},{key:"registerOnTouched",value:function(e){this._onTouched=e}},{key:"setDisabledState",value:function(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}},{key:"panelOpen",get:function(){return this._panelOpen}},{key:"selected",get:function(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}},{key:"triggerValue",get:function(){if(this.empty)return"";if(this._multiple){var e=this._selectionModel.selected.map(function(e){return e.viewValue});return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}},{key:"_isRtl",value:function(){return!!this._dir&&"rtl"===this._dir.value}},{key:"_handleKeydown",value:function(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}},{key:"_handleClosedKeydown",value:function(e){var t=e.keyCode,n=40===t||38===t||37===t||39===t,i=13===t||32===t,r=this._keyManager;if(!r.isTyping()&&i&&!fp(e)||(this.multiple||e.altKey)&&n)e.preventDefault(),this.open();else if(!this.multiple){var o=this.selected;r.onKeydown(e);var a=this.selected;a&&o!==a&&this._liveAnnouncer.announce(a.viewValue,1e4)}}},{key:"_handleOpenKeydown",value:function(e){var t=this._keyManager,n=e.keyCode,i=40===n||38===n,r=t.isTyping();if(i&&e.altKey)e.preventDefault(),this.close();else if(r||13!==n&&32!==n||!t.activeItem||fp(e))if(!r&&this._multiple&&65===n&&e.ctrlKey){e.preventDefault();var o=this.options.some(function(e){return!e.disabled&&!e.selected});this.options.forEach(function(e){e.disabled||(o?e.select():e.deselect())})}else{var a=t.activeItemIndex;t.onKeydown(e),this._multiple&&i&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==a&&t.activeItem._selectViaInteraction()}else e.preventDefault(),t.activeItem._selectViaInteraction()}},{key:"_onFocus",value:function(){this.disabled||(this._focused=!0,this.stateChanges.next())}},{key:"_onBlur",value:function(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}},{key:"_onAttached",value:function(){var e=this;this._overlayDir.positionChange.pipe(ap(1)).subscribe(function(){e._changeDetectorRef.detectChanges(),e._positioningSettled()})}},{key:"_getPanelTheme",value:function(){return this._parentFormField?"mat-".concat(this._parentFormField.color):""}},{key:"empty",get:function(){return!this._selectionModel||this._selectionModel.isEmpty()}},{key:"_initializeSelection",value:function(){var e=this;Promise.resolve().then(function(){e._setSelectionByValue(e.ngControl?e.ngControl.value:e._value),e.stateChanges.next()})}},{key:"_setSelectionByValue",value:function(e){var t=this;if(this._selectionModel.selected.forEach(function(e){return e.setInactiveStyles()}),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(function(e){return t._selectValue(e)}),this._sortValues();else{var n=this._selectValue(e);n?this._keyManager.updateActiveItem(n):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}},{key:"_selectValue",value:function(e){var t=this,n=this.options.find(function(n){if(t._selectionModel.isSelected(n))return!1;try{return null!=n.value&&t._compareWith(n.value,e)}catch(i){return!1}});return n&&this._selectionModel.select(n),n}},{key:"_initKeyManager",value:function(){var e=this;this._keyManager=new Tv(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(ud(this._destroy)).subscribe(function(){e.panelOpen&&(!e.multiple&&e._keyManager.activeItem&&e._keyManager.activeItem._selectViaInteraction(),e.focus(),e.close())}),this._keyManager.change.pipe(ud(this._destroy)).subscribe(function(){e._panelOpen&&e.panel?e._scrollOptionIntoView(e._keyManager.activeItemIndex||0):!e._panelOpen&&!e.multiple&&e._keyManager.activeItem&&e._keyManager.activeItem._selectViaInteraction()})}},{key:"_resetOptions",value:function(){var e=this,t=Ce(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(ud(t)).subscribe(function(t){e._onSelect(t.source,t.isUserInput),t.isUserInput&&!e.multiple&&e._panelOpen&&(e.close(),e.focus())}),Ce.apply(void 0,v(this.options.map(function(e){return e._stateChanges}))).pipe(ud(t)).subscribe(function(){e._changeDetectorRef.markForCheck(),e.stateChanges.next()})}},{key:"_onSelect",value:function(e,t){var n=this._selectionModel.isSelected(e);null!=e.value||this._multiple?(n!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())):(e.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(e.value)),n!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}},{key:"_sortValues",value:function(){var e=this;if(this.multiple){var t=this.options.toArray();this._selectionModel.sort(function(n,i){return e.sortComparator?e.sortComparator(n,i,t):t.indexOf(n)-t.indexOf(i)}),this.stateChanges.next()}}},{key:"_propagateChanges",value:function(e){var t;t=this.multiple?this.selected.map(function(e){return e.value}):this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck()}},{key:"_highlightCorrectOption",value:function(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}},{key:"_canOpen",value:function(){var e;return!this._panelOpen&&!this.disabled&&(null===(e=this.options)||void 0===e?void 0:e.length)>0}},{key:"focus",value:function(e){this._elementRef.nativeElement.focus(e)}},{key:"_getPanelAriaLabelledby",value:function(){var e;if(this.ariaLabel)return null;var t=null===(e=this._parentFormField)||void 0===e?void 0:e.getLabelId();return this.ariaLabelledby?(t?t+" ":"")+this.ariaLabelledby:t}},{key:"_getAriaActiveDescendant",value:function(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}},{key:"_getTriggerAriaLabelledby",value:function(){var e;if(this.ariaLabel)return null;var t=null===(e=this._parentFormField)||void 0===e?void 0:e.getLabelId(),n=(t?t+" ":"")+this._valueId;return this.ariaLabelledby&&(n+=" "+this.ariaLabelledby),n}},{key:"_panelDoneAnimating",value:function(e){this.openedChange.emit(e)}},{key:"setDescribedByIds",value:function(e){this._ariaDescribedby=e.join(" ")}},{key:"onContainerClick",value:function(){this.focus(),this.open()}},{key:"shouldLabelFloat",get:function(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}]),n}(iY);return e.\u0275fac=function(t){return new(t||e)(Es(qd),Es(wc),Es(Vl),Es($y),Es(Ku),Es(zd,8),Es(JV,8),Es(az,8),Es(Vz,8),Es(EV,10),Ti("tabindex"),Es(JX),Es(Uv),Es(eY,8))},e.\u0275dir=It({type:e,viewQuery:function(e,t){var n;(1&e&&(hl(UX,5),hl(HX,5),hl(Xp,5)),2&e)&&(ll(n=dl())&&(t.trigger=n.first),ll(n=dl())&&(t.panel=n.first),ll(n=dl())&&(t._overlayDir=n.first))},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[ss,Gt]}),e}(),aY=function(){var t,n=function(t){a(i,t);var n=s(i);function i(){var e;return m(this,i),(e=n.apply(this,arguments))._scrollTop=0,e._triggerFontSize=0,e._transformOrigin="top",e._offsetY=0,e._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}],e}return b(i,[{key:"_calculateOverlayScroll",value:function(e,t,n){var i=this._getItemHeight();return Math.min(Math.max(0,i*e-t+i/2),n)}},{key:"ngOnInit",value:function(){var t=this;e(p(i.prototype),"ngOnInit",this).call(this),this._viewportRuler.change().pipe(ud(this._destroy)).subscribe(function(){t.panelOpen&&(t._triggerRect=t.trigger.nativeElement.getBoundingClientRect(),t._changeDetectorRef.markForCheck())})}},{key:"open",value:function(){var t=this;e(p(i.prototype),"_canOpen",this).call(this)&&(e(p(i.prototype),"open",this).call(this),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(ap(1)).subscribe(function(){t._triggerFontSize&&t._overlayDir.overlayRef&&t._overlayDir.overlayRef.overlayElement&&(t._overlayDir.overlayRef.overlayElement.style.fontSize="".concat(t._triggerFontSize,"px"))}))}},{key:"_scrollOptionIntoView",value:function(e){var t=yb(e,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===e&&1===t?0:bb((e+t)*n,n,this.panel.nativeElement.scrollTop,256)}},{key:"_positioningSettled",value:function(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}},{key:"_panelDoneAnimating",value:function(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),e(p(i.prototype),"_panelDoneAnimating",this).call(this,t)}},{key:"_getChangeEvent",value:function(e){return new nY(this,e)}},{key:"_calculateOverlayOffsetX",value:function(){var e,t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),n=this._viewportRuler.getViewportSize(),i=this._isRtl(),r=this.multiple?56:32;if(this.multiple)e=40;else if(this.disableOptionCentering)e=16;else{var o=this._selectionModel.selected[0]||this.options.first;e=o&&o.group?32:16}i||(e*=-1);var a=0-(t.left+e-(i?r:0)),s=t.right+e-n.width+(i?0:r);a>0?e+=a+8:s>0&&(e-=s+8),this._overlayDir.offsetX=Math.round(e),this._overlayDir.overlayRef.updatePosition()}},{key:"_calculateOverlayOffsetY",value:function(e,t,n){var i,r=this._getItemHeight(),o=(r-this._triggerRect.height)/2,a=Math.floor(256/r);return this.disableOptionCentering?0:(i=0===this._scrollTop?e*r:this._scrollTop===n?(e-(this._getItemCount()-a))*r+(r-(this._getItemCount()*r-256)%r):t-r/2,Math.round(-1*i-o))}},{key:"_checkOverlayWithinViewport",value:function(e){var t=this._getItemHeight(),n=this._viewportRuler.getViewportSize(),i=this._triggerRect.top-8,r=n.height-this._triggerRect.bottom-8,o=Math.abs(this._offsetY),a=Math.min(this._getItemCount()*t,256)-o-this._triggerRect.height;a>r?this._adjustPanelUp(a,r):o>i?this._adjustPanelDown(o,i,e):this._transformOrigin=this._getOriginBasedOnOption()}},{key:"_adjustPanelUp",value:function(e,t){var n=Math.round(e-t);this._scrollTop-=n,this._offsetY-=n,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}},{key:"_adjustPanelDown",value:function(e,t,n){var i=Math.round(e-t);if(this._scrollTop+=i,this._offsetY+=i,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=n)return this._scrollTop=n,this._offsetY=0,void(this._transformOrigin="50% top 0px")}},{key:"_calculateOverlayPosition",value:function(){var e,t=this._getItemHeight(),n=this._getItemCount(),i=Math.min(n*t,256),r=n*t-i;e=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),e+=yb(e,this.options,this.optionGroups);var o=i/2;this._scrollTop=this._calculateOverlayScroll(e,o,r),this._offsetY=this._calculateOverlayOffsetY(e,o,r),this._checkOverlayWithinViewport(r)}},{key:"_getOriginBasedOnOption",value:function(){var e=this._getItemHeight(),t=(e-this._triggerRect.height)/2;return"50% ".concat(Math.abs(this._offsetY)-t+e/2,"px 0px")}},{key:"_getItemHeight",value:function(){return 3*this._triggerFontSize}},{key:"_getItemCount",value:function(){return this.options.length+this.optionGroups.length}}]),i}(oY);return n.\u0275fac=function(e){return(t||(t=Ci(n)))(e||n)},n.\u0275cmp=Ct({type:n,selectors:[["mat-select"]],contentQueries:function(e,t,n){var i;(1&e&&(fl(n,rY,5),fl(n,mb,5),fl(n,db,5)),2&e)&&(ll(i=dl())&&(t.customTrigger=i.first),ll(i=dl())&&(t.options=i),ll(i=dl())&&(t.optionGroups=i))},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(e,t){1&e&&Fs("keydown",function(e){return t._handleKeydown(e)})("focus",function(){return t._onFocus()})("blur",function(){return t._onBlur()}),2&e&&(_s("id",t.id)("tabindex",t.tabIndex)("aria-controls",t.panelOpen?t.id+"-panel":null)("aria-expanded",t.panelOpen)("aria-label",t.ariaLabel||null)("aria-required",t.required.toString())("aria-disabled",t.disabled.toString())("aria-invalid",t.errorState)("aria-describedby",t._ariaDescribedby||null)("aria-activedescendant",t._getAriaActiveDescendant()),su("mat-select-disabled",t.disabled)("mat-select-invalid",t.errorState)("mat-select-required",t.required)("mat-select-empty",t.empty)("mat-select-multiple",t.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[Hu([{provide:Pz,useExisting:n},{provide:cb,useExisting:n}]),ss],ngContentSelectors:QX,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(e,t){if(1&e&&(Ws(KX),Ts(0,"div",0,1),Fs("click",function(){return t.toggle()}),Ts(3,"div",2),xs(4,GX,2,1,"span",3),xs(5,XX,3,2,"span",4),As(),Ts(6,"div",5),Ps(7,"div",6),As(),As(),xs(8,YX,4,14,"ng-template",7),Fs("backdropClick",function(){return t.close()})("attach",function(){return t._onAttached()})("detach",function(){return t.close()})),2&e){var n=Ss(1);_s("aria-owns",t.panelOpen?t.id+"-panel":null),qo(3),Cs("ngSwitch",t.empty),_s("id",t._valueId),qo(1),Cs("ngSwitchCase",!0),qo(1),Cs("ngSwitchCase",!1),qo(3),Cs("cdkConnectedOverlayPanelClass",t._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",t._scrollStrategy)("cdkConnectedOverlayOrigin",n)("cdkConnectedOverlayOpen",t.panelOpen)("cdkConnectedOverlayPositions",t._positions)("cdkConnectedOverlayMinWidth",null==t._triggerRect?null:t._triggerRect.width)("cdkConnectedOverlayOffsetY",t._offsetY)}},directives:[qp,Vh,zh,Xp,Uh,Ih],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[$X.transformPanelWrap,$X.transformPanel]},changeDetection:0}),n}(),sY=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[tY],imports:[[Kh,Kp,_b,Wy],Xd,Uz,_b,Wy]}),e}(),uY=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,Uz,sY]]}),e}(),cY=r(25430),lY=r(39053),hY=r(26202),fY=["tooltipTemplate"],dY=["leftOuterSelectionBar"],pY=["rightOuterSelectionBar"],vY=["fullBar"],gY=["selectionBar"],mY=["minHandle"],yY=["maxHandle"],bY=["floorLabel"],_Y=["ceilLabel"],wY=["minHandleLabel"],kY=["maxHandleLabel"],xY=["combinedLabel"],SY=["ticksElement"];function EY(e,t){if(1&e&&Ps(0,"ng5-slider-tooltip-wrapper",31),2&e){var n=Hs().$implicit;Cs("template",Hs().tooltipTemplate)("tooltip",n.valueTooltip)("placement",n.valueTooltipPlacement)("content",n.value)}}function CY(e,t){1&e&&Ps(0,"span",32),2&e&&Cs("innerHTML",Hs().$implicit.legend,Gr)}var OY=function(e){return{"ng5-slider-selected":e}};function TY(e,t){if(1&e&&(Ts(0,"span",27),Ps(1,"ng5-slider-tooltip-wrapper",28),xs(2,EY,1,4,"ng5-slider-tooltip-wrapper",29),xs(3,CY,1,1,"span",30),As()),2&e){var n=t.$implicit,i=Hs();Cs("ngClass",qc(7,OY,n.selected))("ngStyle",n.style),qo(1),Cs("template",i.tooltipTemplate)("tooltip",n.tooltip)("placement",n.tooltipPlacement),qo(1),Cs("ngIf",null!=n.value),qo(1),Cs("ngIf",null!=n.legend)}}function AY(e,t){}function PY(e,t){1&e&&xs(0,AY,0,0,"ng-template")}var MY=function(e,t,n){return{tooltip:e,placement:t,content:n}};function IY(e,t){if(1&e&&(Ms(0),xs(1,PY,1,0,void 0,1),Is()),2&e){var n=Hs();qo(1),Cs("ngTemplateOutlet",n.template)("ngTemplateOutletContext",function(e,t,n,i,r,o){return function(e,t,n,i,r,o,a,s){var u=t+n;return function(e,t,n,i,r){var o=bs(e,t,n,i);return ys(e,t+2,r)||o}(e,u,r,o,a)?ms(e,u+3,s?i.call(s,r,o,a):i(r,o,a)):Xc(e,u+3)}(vn(),En(),e,t,n,i,r,o)}(2,MY,n.tooltip,n.placement,n.content))}}function RY(e,t){if(1&e&&(Ms(0),Ts(1,"div",2),ku(2),As(),Is()),2&e){var n=Hs();qo(1),_s("title",n.tooltip)("data-tooltip-placement",n.placement),qo(1),Su(" ",n.content," ")}}var DY={Min:0,Max:1};DY[DY.Min]="Min",DY[DY.Max]="Max";var NY={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};NY[NY.Low]="Low",NY[NY.High]="High",NY[NY.Floor]="Floor",NY[NY.Ceil]="Ceil",NY[NY.TickValue]="TickValue";var LY=function e(){m(this,e),this.floor=0,this.ceil=null,this.step=1,this.minRange=null,this.maxRange=null,this.pushRange=!1,this.minLimit=null,this.maxLimit=null,this.translate=null,this.combineLabels=null,this.getLegend=null,this.stepsArray=null,this.bindIndexForStepsArray=!1,this.draggableRange=!1,this.draggableRangeOnly=!1,this.showSelectionBar=!1,this.showSelectionBarEnd=!1,this.showSelectionBarFromValue=null,this.showOuterSelectionBars=!1,this.hidePointerLabels=!1,this.hideLimitLabels=!1,this.autoHideLimitLabels=!0,this.readOnly=!1,this.disabled=!1,this.mouseEventsInterval=50,this.touchEventsInterval=50,this.inputEventsInterval=100,this.outputEventsInterval=100,this.showTicks=!1,this.showTicksValues=!1,this.tickStep=null,this.tickValueStep=1,this.ticksArray=null,this.ticksTooltip=null,this.ticksValuesTooltip=null,this.vertical=!1,this.getSelectionBarColor=null,this.getTickColor=null,this.getPointerColor=null,this.keyboardSupport=!0,this.scale=1,this.enforceStep=!0,this.enforceRange=!0,this.noSwitching=!1,this.onlyBindHandles=!1,this.rightToLeft=!1,this.reversedControls=!1,this.boundPointerLabels=!0,this.logScale=!1,this.customValueToPosition=null,this.customPositionToValue=null,this.precisionLimit=12,this.selectionBarGradient=null,this.ariaLabel=null,this.ariaLabelledBy=null,this.ariaLabelHigh=null,this.ariaLabelledByHigh=null,this.handleDimension=null,this.barDimension=null,this.animate=!0},jY=function e(){m(this,e)},FY=function(){function e(){m(this,e)}return b(e,null,[{key:"isNullOrUndefined",value:function(e){return null==e}},{key:"linearValueToPosition",value:function(e,t,n){return(e-t)/(n-t)}},{key:"logValueToPosition",value:function(e,t,n){return((e=Math.log(e))-(t=Math.log(t)))/((n=Math.log(n))-t)}},{key:"linearPositionToValue",value:function(e,t,n){return e*(n-t)+t}},{key:"logPositionToValue",value:function(e,t,n){return t=Math.log(t),n=Math.log(n),Math.exp(e*(n-t)+t)}},{key:"findStepIndex",value:function(e,t){for(var n=t.map(function(t){return Math.abs(e-t.value)}),i=0,r=0;r0&&0===this.dimension)&&(t=!0),this._value=e,this.elemRef.nativeElement.innerHTML=e,t&&this.calculateDimension()}}]),n}(HY);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Zu),Es(wc))},e.\u0275dir=It({type:e,selectors:[["","ng5SliderLabel",""]],features:[ss]}),e}(),qY=function e(){m(this,e),this.selected=!1,this.style={},this.tooltip=null,this.tooltipPlacement=null,this.value=null,this.valueTooltip=null,this.valueTooltipPlacement=null,this.legend=null},XY=function e(){m(this,e),this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0},YY=function(){function e(){m(this,e)}return b(e,null,[{key:"compare",value:function(e,t){return!(FY.isNullOrUndefined(e)&&FY.isNullOrUndefined(t)||FY.isNullOrUndefined(e)!==FY.isNullOrUndefined(t))&&e.value===t.value&&e.highValue===t.highValue}}]),e}(),KY=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,null,[{key:"compare",value:function(e,t){return!(FY.isNullOrUndefined(e)&&FY.isNullOrUndefined(t)||FY.isNullOrUndefined(e)!==FY.isNullOrUndefined(t))&&e.value===t.value&&e.highValue===t.highValue&&e.forceChange===t.forceChange}}]),n}(YY),QY={provide:iV,useExisting:Ue(function(){return $Y}),multi:!0},$Y=function(){var e=function(){function e(t,n,i,r){m(this,e),this.renderer=t,this.elementRef=n,this.changeDetectionRef=i,this.zone=r,this.value=null,this.valueChange=new Zc,this.highValue=null,this.highValueChange=new Zc,this.options=new LY,this.userChangeStart=new Zc,this.userChange=new Zc,this.userChangeEnd=new Zc,this.initHasRun=!1,this.inputModelChangeSubject=new cY.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new cY.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new LY,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new XY,this.sliderElementVerticalClass=!1,this.sliderElementAnimateClass=!1,this.sliderElementDisabledAttr=null,this.barStyle={},this.minPointerStyle={},this.maxPointerStyle={},this.fullBarTransparentClass=!1,this.selectionBarDraggableClass=!1,this.ticksUnderValuesClass=!1,this.intermediateTicks=!1,this.ticks=[],this.eventListenerHelper=null,this.onMoveEventListener=null,this.onEndEventListener=null,this.resizeObserver=null,this.onTouchedCallback=null,this.onChangeCallback=null,this.eventListenerHelper=new UY(this.renderer)}return b(e,[{key:"manualRefresh",set:function(e){var t=this;this.unsubscribeManualRefresh(),this.manualRefreshSubscription=e.subscribe(function(){setTimeout(function(){return t.calculateViewDimensionsAndDetectChanges()})})}},{key:"triggerFocus",set:function(e){var t=this;this.unsubscribeTriggerFocus(),this.triggerFocusSubscription=e.subscribe(function(e){t.focusPointer(e)})}},{key:"range",get:function(){return!FY.isNullOrUndefined(this.value)&&!FY.isNullOrUndefined(this.highValue)}},{key:"showTicks",get:function(){return this.viewOptions.showTicks}},{key:"ngOnInit",value:function(){this.viewOptions=new LY,Object.assign(this.viewOptions,this.options),this.updateDisabledState(),this.updateVerticalState()}},{key:"ngAfterViewInit",value:function(){this.applyOptions(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval),this.subscribeOutputModelChangeSubject(this.viewOptions.outputEventsInterval),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.updateVerticalState(),this.manageElementsStyle(),this.updateDisabledState(),this.calculateViewDimensions(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.initHandles(),this.manageEventsBindings(),this.subscribeResizeObserver(),this.initHasRun=!0,this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}},{key:"ngOnChanges",value:function(e){FY.isNullOrUndefined(e.options)||this.onChangeOptions(),(!FY.isNullOrUndefined(e.value)||!FY.isNullOrUndefined(e.highValue))&&this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}},{key:"ngOnDestroy",value:function(){this.unbindEvents(),this.unsubscribeResizeObserver(),this.unsubscribeInputModelChangeSubject(),this.unsubscribeOutputModelChangeSubject(),this.unsubscribeManualRefresh(),this.unsubscribeTriggerFocus()}},{key:"writeValue",value:function(e){e instanceof Array?(this.value=e[0],this.highValue=e[1]):this.value=e,this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}},{key:"registerOnChange",value:function(e){this.onChangeCallback=e}},{key:"registerOnTouched",value:function(e){this.onTouchedCallback=e}},{key:"setDisabledState",value:function(e){this.viewOptions.disabled=e,this.updateDisabledState()}},{key:"onResize",value:function(e){this.calculateViewDimensionsAndDetectChanges()}},{key:"subscribeInputModelChangeSubject",value:function(e){var t=this;this.inputModelChangeSubscription=this.inputModelChangeSubject.pipe((0,lY.distinctUntilChanged)(KY.compare),(0,lY.filter)(function(e){return!e.forceChange&&!e.internalChange}),FY.isNullOrUndefined(e)?(0,lY.tap)(function(){}):(0,lY.throttleTime)(e,void 0,{leading:!0,trailing:!0})).subscribe(function(e){return t.applyInputModelChange(e)})}},{key:"subscribeOutputModelChangeSubject",value:function(e){var t=this;this.outputModelChangeSubscription=this.outputModelChangeSubject.pipe((0,lY.distinctUntilChanged)(KY.compare),FY.isNullOrUndefined(e)?(0,lY.tap)(function(){}):(0,lY.throttleTime)(e,void 0,{leading:!0,trailing:!0})).subscribe(function(e){return t.publishOutputModelChange(e)})}},{key:"subscribeResizeObserver",value:function(){var e=this;BY.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(function(){return e.calculateViewDimensionsAndDetectChanges()}),this.resizeObserver.observe(this.elementRef.nativeElement))}},{key:"unsubscribeResizeObserver",value:function(){BY.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"unsubscribeOnMove",value:function(){FY.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}},{key:"unsubscribeOnEnd",value:function(){FY.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}},{key:"unsubscribeInputModelChangeSubject",value:function(){FY.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}},{key:"unsubscribeOutputModelChangeSubject",value:function(){FY.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}},{key:"unsubscribeManualRefresh",value:function(){FY.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}},{key:"unsubscribeTriggerFocus",value:function(){FY.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}},{key:"getPointerElement",value:function(e){return e===DY.Min?this.minHandleElement:e===DY.Max?this.maxHandleElement:null}},{key:"getCurrentTrackingValue",value:function(){return this.currentTrackingPointer===DY.Min?this.viewLowValue:this.currentTrackingPointer===DY.Max?this.viewHighValue:null}},{key:"modelValueToViewValue",value:function(e){return FY.isNullOrUndefined(e)?NaN:FY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+e:FY.findStepIndex(+e,this.viewOptions.stepsArray)}},{key:"viewValueToModelValue",value:function(e){return FY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?e:this.getStepValue(e)}},{key:"getStepValue",value:function(e){var t=this.viewOptions.stepsArray[e];return FY.isNullOrUndefined(t)?NaN:t.value}},{key:"applyViewChange",value:function(){this.value=this.viewValueToModelValue(this.viewLowValue),this.range&&(this.highValue=this.viewValueToModelValue(this.viewHighValue)),this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,userEventInitiated:!0,forceChange:!1}),this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!0})}},{key:"applyInputModelChange",value:function(e){var t=this.normaliseModelValues(e),n=!YY.compare(e,t);n&&(this.value=t.value,this.highValue=t.highValue),this.viewLowValue=this.modelValueToViewValue(t.value),this.viewHighValue=this.range?this.modelValueToViewValue(t.highValue):null,this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCombinedLabel(),this.outputModelChangeSubject.next({value:t.value,highValue:t.highValue,forceChange:n,userEventInitiated:!1})}},{key:"publishOutputModelChange",value:function(e){var t=this,n=function(){t.valueChange.emit(e.value),t.range&&t.highValueChange.emit(e.highValue),FY.isNullOrUndefined(t.onChangeCallback)||t.onChangeCallback(t.range?[e.value,e.highValue]:e.value),FY.isNullOrUndefined(t.onTouchedCallback)||t.onTouchedCallback(t.range?[e.value,e.highValue]:e.value)};e.userEventInitiated?(n(),this.userChange.emit(this.getChangeContext())):setTimeout(function(){n()})}},{key:"normaliseModelValues",value:function(e){var t=new YY;if(t.value=e.value,t.highValue=e.highValue,this.viewOptions.enforceStep&&(t.value=this.roundStep(t.value),this.range&&(t.highValue=this.roundStep(t.highValue))),!FY.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return t;if(t.value=VY.clampToRange(t.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(t.highValue=VY.clampToRange(t.highValue,this.viewOptions.floor,this.viewOptions.ceil)),this.range&&e.value>e.highValue)if(this.viewOptions.noSwitching)t.value=t.highValue;else{var n=e.value;t.value=e.highValue,t.highValue=n}return t}},{key:"renormaliseModelValues",value:function(){var e={value:this.value,highValue:this.highValue},t=this.normaliseModelValues(e);YY.compare(t,e)||(this.value=t.value,this.highValue=t.highValue,this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!0,userEventInitiated:!1}))}},{key:"onChangeOptions",value:function(){if(this.initHasRun){var e=this.viewOptions.inputEventsInterval,t=this.viewOptions.outputEventsInterval;this.applyOptions(),e!==this.viewOptions.inputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval)),t!==this.viewOptions.outputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.outputEventsInterval)),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.resetSlider()}}},{key:"applyOptions",value:function(){if(this.viewOptions=new LY,Object.assign(this.viewOptions,this.options),this.viewOptions.draggableRange=this.range&&this.viewOptions.draggableRange,this.viewOptions.draggableRangeOnly=this.range&&this.viewOptions.draggableRangeOnly,this.viewOptions.draggableRangeOnly&&(this.viewOptions.draggableRange=!0),this.viewOptions.showTicks=this.viewOptions.showTicks||this.viewOptions.showTicksValues||!FY.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!FY.isNullOrUndefined(this.viewOptions.tickStep)||!FY.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!FY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),FY.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),FY.isNullOrUndefined(this.viewOptions.combineLabels)&&(this.viewOptions.combineLabels=function(e,t){return e+" - "+t}),this.viewOptions.logScale&&0===this.viewOptions.floor)throw Error("Can't use floor=0 with logarithmic scale")}},{key:"applyStepsArrayOptions",value:function(){var e=this;this.viewOptions.floor=0,this.viewOptions.ceil=this.viewOptions.stepsArray.length-1,this.viewOptions.step=1,FY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=function(t){return String(e.viewOptions.bindIndexForStepsArray?e.getStepValue(t):t)}),this.viewOptions.getLegend=function(t){return e.viewOptions.stepsArray[t].legend}}},{key:"applyFloorCeilOptions",value:function(){if(FY.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),FY.isNullOrUndefined(this.viewOptions.ceil)||FY.isNullOrUndefined(this.viewOptions.floor))throw Error("floor and ceil options must be supplied");this.viewOptions.ceil=+this.viewOptions.ceil,this.viewOptions.floor=+this.viewOptions.floor,FY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=function(e){return String(e)})}},{key:"resetSlider",value:function(){this.manageElementsStyle(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.unbindEvents(),this.manageEventsBindings(),this.updateDisabledState(),this.calculateViewDimensions(),this.refocusPointerIfNeeded()}},{key:"focusPointer",value:function(e){e!==DY.Min&&e!==DY.Max&&(e=DY.Min),e===DY.Min?this.minHandleElement.focus():this.range&&e===DY.Max&&this.maxHandleElement.focus()}},{key:"refocusPointerIfNeeded",value:function(){FY.isNullOrUndefined(this.currentFocusPointer)||(this.onPointerFocus(this.currentFocusPointer),this.getPointerElement(this.currentFocusPointer).focus())}},{key:"manageElementsStyle",value:function(){var e=this;this.updateScale(),this.floorLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels),this.ceilLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels);var t=this.viewOptions.showTicksValues&&!this.intermediateTicks;this.minHandleLabelElement.setAlwaysHide(t||this.viewOptions.hidePointerLabels),this.maxHandleLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.combinedLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.selectionBarElement.setAlwaysHide(!this.range&&!this.viewOptions.showSelectionBar),this.leftOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.rightOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.fullBarTransparentClass=this.range&&this.viewOptions.showOuterSelectionBars,this.selectionBarDraggableClass=this.viewOptions.draggableRange&&!this.viewOptions.onlyBindHandles,this.ticksUnderValuesClass=this.intermediateTicks&&this.options.showTicksValues,this.sliderElementVerticalClass!==this.viewOptions.vertical&&(this.updateVerticalState(),setTimeout(function(){e.resetSlider()})),this.sliderElementAnimateClass!==this.viewOptions.animate&&setTimeout(function(){e.sliderElementAnimateClass=e.viewOptions.animate})}},{key:"manageEventsBindings",value:function(){this.viewOptions.disabled||this.viewOptions.readOnly?this.unbindEvents():this.bindEvents()}},{key:"updateDisabledState",value:function(){this.sliderElementDisabledAttr=this.viewOptions.disabled?"disabled":null}},{key:"updateVerticalState",value:function(){this.sliderElementVerticalClass=this.viewOptions.vertical;var e,t=_(this.getAllSliderElements());try{for(t.s();!(e=t.n()).done;){var n=e.value;FY.isNullOrUndefined(n)||n.setVertical(this.viewOptions.vertical)}}catch(i){t.e(i)}finally{t.f()}}},{key:"updateScale",value:function(){var e,t=_(this.getAllSliderElements());try{for(t.s();!(e=t.n()).done;){e.value.setScale(this.viewOptions.scale)}}catch(n){t.e(n)}finally{t.f()}}},{key:"getAllSliderElements",value:function(){return[this.leftOuterSelectionBarElement,this.rightOuterSelectionBarElement,this.fullBarElement,this.selectionBarElement,this.minHandleElement,this.maxHandleElement,this.floorLabelElement,this.ceilLabelElement,this.minHandleLabelElement,this.maxHandleLabelElement,this.combinedLabelElement,this.ticksElement]}},{key:"initHandles",value:function(){this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.range&&this.updateCombinedLabel(),this.updateTicksScale()}},{key:"addAccessibility",value:function(){this.updateAriaAttributes(),this.minHandleElement.role="slider",this.minHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.viewOptions.vertical&&(this.minHandleElement.ariaOrientation="vertical"),FY.isNullOrUndefined(this.viewOptions.ariaLabel)?FY.isNullOrUndefined(this.viewOptions.ariaLabelledBy)||(this.minHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledBy):this.minHandleElement.ariaLabel=this.viewOptions.ariaLabel,this.range&&(this.maxHandleElement.role="slider",this.maxHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.maxHandleElement.ariaOrientation=this.viewOptions.vertical?"vertical":"horizontal",FY.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?FY.isNullOrUndefined(this.viewOptions.ariaLabelledByHigh)||(this.maxHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledByHigh):this.maxHandleElement.ariaLabel=this.viewOptions.ariaLabelHigh)}},{key:"updateAriaAttributes",value:function(){this.minHandleElement.ariaValueNow=(+this.value).toString(),this.minHandleElement.ariaValueText=this.viewOptions.translate(+this.value,NY.Low),this.minHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.minHandleElement.ariaValueMax=this.viewOptions.ceil.toString(),this.range&&(this.maxHandleElement.ariaValueNow=(+this.highValue).toString(),this.maxHandleElement.ariaValueText=this.viewOptions.translate(+this.highValue,NY.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}},{key:"calculateViewDimensions",value:function(){FY.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);var e=this.minHandleElement.dimension;this.handleHalfDimension=e/2,FY.isNullOrUndefined(this.viewOptions.barDimension)?this.fullBarElement.calculateDimension():this.fullBarElement.setDimension(this.viewOptions.barDimension),this.maxHandlePosition=this.fullBarElement.dimension-e,this.initHasRun&&(this.updateFloorLabel(),this.updateCeilLabel(),this.initHandles())}},{key:"calculateViewDimensionsAndDetectChanges",value:function(){this.calculateViewDimensions(),this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}},{key:"isRefDestroyed",value:function(){return this.changeDetectionRef.destroyed}},{key:"updateTicksScale",value:function(){var e=this;if(this.viewOptions.showTicks){var t=FY.isNullOrUndefined(this.viewOptions.ticksArray)?this.getTicksArray():this.viewOptions.ticksArray,n=this.viewOptions.vertical?"translateY":"translateX";this.viewOptions.rightToLeft&&t.reverse();var i=t.map(function(t){var i=e.valueToPosition(t);e.viewOptions.vertical&&(i=e.maxHandlePosition-i);var r=n+"("+Math.round(i)+"px)",o=new qY;if(o.selected=e.isTickSelected(t),o.style={"-webkit-transform":r,"-moz-transform":r,"-o-transform":r,"-ms-transform":r,transform:r},o.selected&&!FY.isNullOrUndefined(e.viewOptions.getSelectionBarColor)&&(o.style["background-color"]=e.getSelectionBarColor()),!o.selected&&!FY.isNullOrUndefined(e.viewOptions.getTickColor)&&(o.style["background-color"]=e.getTickColor(t)),FY.isNullOrUndefined(e.viewOptions.ticksTooltip)||(o.tooltip=e.viewOptions.ticksTooltip(t),o.tooltipPlacement=e.viewOptions.vertical?"right":"top"),e.viewOptions.showTicksValues&&t%e.viewOptions.tickValueStep==0&&(o.value=e.getDisplayValue(t,NY.TickValue),FY.isNullOrUndefined(e.viewOptions.ticksValuesTooltip)||(o.valueTooltip=e.viewOptions.ticksValuesTooltip(t),o.valueTooltipPlacement=e.viewOptions.vertical?"right":"top")),!FY.isNullOrUndefined(e.viewOptions.getLegend)){var a=e.viewOptions.getLegend(t);FY.isNullOrUndefined(a)||(o.legend=a)}return o});if(FY.isNullOrUndefined(this.ticks)||this.ticks.length!==i.length)this.ticks=i;else for(var r=0;r=this.viewLowValue)return!0}else if(this.viewOptions.showSelectionBar&&e<=this.viewLowValue)return!0}else{var t=this.viewOptions.showSelectionBarFromValue;if(this.viewLowValue>t&&e>=t&&e<=this.viewLowValue)return!0;if(this.viewLowValue=this.viewLowValue)return!0}return!!(this.range&&e>=this.viewLowValue&&e<=this.viewHighValue)}},{key:"updateFloorLabel",value:function(){this.floorLabelElement.alwaysHide||(this.floorLabelElement.setValue(this.getDisplayValue(this.viewOptions.floor,NY.Floor)),this.floorLabelElement.calculateDimension(),this.floorLabelElement.setPosition(this.viewOptions.rightToLeft?this.fullBarElement.dimension-this.floorLabelElement.dimension:0))}},{key:"updateCeilLabel",value:function(){this.ceilLabelElement.alwaysHide||(this.ceilLabelElement.setValue(this.getDisplayValue(this.viewOptions.ceil,NY.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}},{key:"updateHandles",value:function(e,t){e===DY.Min?this.updateLowHandle(t):e===DY.Max&&this.updateHighHandle(t),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}},{key:"getHandleLabelPos",value:function(e,t){var n=e===DY.Min?this.minHandleLabelElement.dimension:this.maxHandleLabelElement.dimension,i=t-n/2+this.handleHalfDimension,r=this.fullBarElement.dimension-n;return this.viewOptions.boundPointerLabels?this.viewOptions.rightToLeft&&e===DY.Min||!this.viewOptions.rightToLeft&&e===DY.Max?Math.min(i,r):Math.min(Math.max(i,0),r):i}},{key:"updateLowHandle",value:function(e){this.minHandleElement.setPosition(e),this.minHandleLabelElement.setValue(this.getDisplayValue(this.viewLowValue,NY.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(DY.Min,e)),FY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(DY.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}},{key:"updateHighHandle",value:function(e){this.maxHandleElement.setPosition(e),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,NY.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(DY.Max,e)),FY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(DY.Max)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}},{key:"updateFloorAndCeilLabelsVisibility",value:function(){if(!this.viewOptions.hidePointerLabels){var e=!1,t=!1,n=this.isLabelBelowFloorLabel(this.minHandleLabelElement),i=this.isLabelAboveCeilLabel(this.minHandleLabelElement),r=this.isLabelAboveCeilLabel(this.maxHandleLabelElement),o=this.isLabelBelowFloorLabel(this.combinedLabelElement),a=this.isLabelAboveCeilLabel(this.combinedLabelElement);if(n?(e=!0,this.floorLabelElement.hide()):(e=!1,this.floorLabelElement.show()),i?(t=!0,this.ceilLabelElement.hide()):(t=!1,this.ceilLabelElement.show()),this.range){var s=this.combinedLabelElement.isVisible()?a:r,u=this.combinedLabelElement.isVisible()?o:n;s?this.ceilLabelElement.hide():t||this.ceilLabelElement.show(),u?this.floorLabelElement.hide():e||this.floorLabelElement.show()}}}},{key:"isLabelBelowFloorLabel",value:function(e){var t=e.position,n=this.floorLabelElement.position;return this.viewOptions.rightToLeft?t+e.dimension>=n-2:t<=n+this.floorLabelElement.dimension+2}},{key:"isLabelAboveCeilLabel",value:function(e){var t=e.position,n=this.ceilLabelElement.position;return this.viewOptions.rightToLeft?t<=n+this.ceilLabelElement.dimension+2:t+e.dimension>=n-2}},{key:"updateSelectionBar",value:function(){var e=0,t=0,n=this.viewOptions.rightToLeft?!this.viewOptions.showSelectionBarEnd:this.viewOptions.showSelectionBarEnd,i=this.viewOptions.rightToLeft?this.maxHandleElement.position+this.handleHalfDimension:this.minHandleElement.position+this.handleHalfDimension;if(this.range)t=Math.abs(this.maxHandleElement.position-this.minHandleElement.position),e=i;else if(FY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue))n?(t=Math.ceil(Math.abs(this.maxHandlePosition-this.minHandleElement.position)+this.handleHalfDimension),e=Math.floor(this.minHandleElement.position+this.handleHalfDimension)):(t=this.minHandleElement.position+this.handleHalfDimension,e=0);else{var r=this.viewOptions.showSelectionBarFromValue,o=this.valueToPosition(r);(this.viewOptions.rightToLeft?this.viewLowValue<=r:this.viewLowValue>r)?(t=this.minHandleElement.position-o,e=o+this.handleHalfDimension):(t=o-this.minHandleElement.position,e=this.minHandleElement.position+this.handleHalfDimension)}if(this.selectionBarElement.setDimension(t),this.selectionBarElement.setPosition(e),this.range&&this.viewOptions.showOuterSelectionBars&&(this.viewOptions.rightToLeft?(this.rightOuterSelectionBarElement.setDimension(e),this.rightOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.leftOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(e+t)),this.leftOuterSelectionBarElement.setPosition(e+t)):(this.leftOuterSelectionBarElement.setDimension(e),this.leftOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.rightOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(e+t)),this.rightOuterSelectionBarElement.setPosition(e+t))),FY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!FY.isNullOrUndefined(this.viewOptions.selectionBarGradient)){var a=FY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue)?0:this.valueToPosition(this.viewOptions.showSelectionBarFromValue),s=a-e>0&&!n||a-e<=0&&n;this.barStyle={backgroundImage:"linear-gradient(to "+(this.viewOptions.vertical?s?"bottom":"top":s?"left":"right")+", "+this.viewOptions.selectionBarGradient.from+" 0%,"+this.viewOptions.selectionBarGradient.to+" 100%)"},this.viewOptions.vertical?(this.barStyle.backgroundPosition="center "+(a+t+e+(s?-this.handleHalfDimension:0))+"px",this.barStyle.backgroundSize="100% "+(this.fullBarElement.dimension-this.handleHalfDimension)+"px"):(this.barStyle.backgroundPosition=a-e+(s?this.handleHalfDimension:0)+"px center",this.barStyle.backgroundSize=this.fullBarElement.dimension-this.handleHalfDimension+"px 100%")}}else{var u=this.getSelectionBarColor();this.barStyle={backgroundColor:u}}}},{key:"getSelectionBarColor",value:function(){return this.range?this.viewOptions.getSelectionBarColor(this.value,this.highValue):this.viewOptions.getSelectionBarColor(this.value)}},{key:"getPointerColor",value:function(e){return this.viewOptions.getPointerColor(e===DY.Max?this.highValue:this.value,e)}},{key:"getTickColor",value:function(e){return this.viewOptions.getTickColor(e)}},{key:"updateCombinedLabel",value:function(){if(this.viewOptions.rightToLeft?this.minHandleLabelElement.position-this.minHandleLabelElement.dimension-10<=this.maxHandleLabelElement.position:this.minHandleLabelElement.position+this.minHandleLabelElement.dimension+10>=this.maxHandleLabelElement.position){var e=this.getDisplayValue(this.viewLowValue,NY.Low),t=this.getDisplayValue(this.viewHighValue,NY.High),n=this.viewOptions.rightToLeft?this.viewOptions.combineLabels(t,e):this.viewOptions.combineLabels(e,t);this.combinedLabelElement.setValue(n);var i=this.viewOptions.boundPointerLabels?Math.min(Math.max(this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2,0),this.fullBarElement.dimension-this.combinedLabelElement.dimension):this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2;this.combinedLabelElement.setPosition(i),this.minHandleLabelElement.hide(),this.maxHandleLabelElement.hide(),this.combinedLabelElement.show()}else this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.maxHandleLabelElement.show(),this.minHandleLabelElement.show(),this.combinedLabelElement.hide();this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}},{key:"getDisplayValue",value:function(e,t){return!FY.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(e=this.getStepValue(e)),this.viewOptions.translate(e,t)}},{key:"roundStep",value:function(e,t){var n=FY.isNullOrUndefined(t)?this.viewOptions.step:t,i=VY.roundToPrecisionLimit((e-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,VY.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}},{key:"valueToPosition",value:function(e){var t=FY.linearValueToPosition;FY.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(t=FY.logValueToPosition):t=this.viewOptions.customValueToPosition;var n=t(e=VY.clampToRange(e,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return FY.isNullOrUndefined(n)&&(n=0),this.viewOptions.rightToLeft&&(n=1-n),n*this.maxHandlePosition}},{key:"positionToValue",value:function(e){var t=e/this.maxHandlePosition;this.viewOptions.rightToLeft&&(t=1-t);var n=FY.linearPositionToValue;FY.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=FY.logPositionToValue):n=this.viewOptions.customPositionToValue;var i=n(t,this.viewOptions.floor,this.viewOptions.ceil);return FY.isNullOrUndefined(i)?0:i}},{key:"getEventXY",value:function(e,t){if(e instanceof MouseEvent)return this.viewOptions.vertical?e.clientY:e.clientX;var n=0,i=e.touches;if(!FY.isNullOrUndefined(t))for(var r=0;ri?DY.Max:this.viewOptions.rightToLeft?t>this.minHandleElement.position?DY.Min:DY.Max:t=this.maxHandlePosition?o=this.viewOptions.rightToLeft?this.viewOptions.floor:this.viewOptions.ceil:(o=this.positionToValue(a),o=t&&!FY.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(o,this.viewOptions.tickStep):this.roundStep(o)),this.positionTrackingHandle(o)}},{key:"onEnd",value:function(e){BY.isTouchEvent(e)&&e.changedTouches[0].identifier!==this.touchId||(this.touchId=null,this.viewOptions.keyboardSupport||(this.minHandleElement.active=!1,this.maxHandleElement.active=!1,this.currentTrackingPointer=null),this.dragging.active=!1,this.unsubscribeOnMove(),this.unsubscribeOnEnd(),this.userChangeEnd.emit(this.getChangeContext()))}},{key:"onPointerFocus",value:function(e){var t=this,n=this.getPointerElement(e);n.on("blur",function(){return t.onPointerBlur(n)}),n.on("keydown",function(e){return t.onKeyboardEvent(e)}),n.on("keyup",function(){return t.onKeyUp()}),n.active=!0,this.currentTrackingPointer=e,this.currentFocusPointer=e,this.firstKeyDown=!0}},{key:"onKeyUp",value:function(){this.firstKeyDown=!0,this.userChangeEnd.emit(this.getChangeContext())}},{key:"onPointerBlur",value:function(e){e.off("blur"),e.off("keydown"),e.off("keyup"),e.active=!1,FY.isNullOrUndefined(this.touchId)&&(this.currentTrackingPointer=null,this.currentFocusPointer=null)}},{key:"getKeyActions",value:function(e){var t=this.viewOptions.ceil-this.viewOptions.floor,n=e+this.viewOptions.step,i=e-this.viewOptions.step,r=e+t/10,o=e-t/10;this.viewOptions.reversedControls&&(n=e-this.viewOptions.step,i=e+this.viewOptions.step,r=e-t/10,o=e+t/10);var a={UP:n,DOWN:i,LEFT:i,RIGHT:n,PAGEUP:r,PAGEDOWN:o,HOME:this.viewOptions.reversedControls?this.viewOptions.ceil:this.viewOptions.floor,END:this.viewOptions.reversedControls?this.viewOptions.floor:this.viewOptions.ceil};return this.viewOptions.rightToLeft&&(a.LEFT=n,a.RIGHT=i,this.viewOptions.vertical&&(a.UP=i,a.DOWN=n)),a}},{key:"onKeyboardEvent",value:function(e){var t=this.getCurrentTrackingValue(),n=FY.isNullOrUndefined(e.keyCode)?e.which:e.keyCode,i=this.getKeyActions(t)[{38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"}[n]];if(!FY.isNullOrUndefined(i)&&!FY.isNullOrUndefined(this.currentTrackingPointer)){e.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));var r=VY.clampToRange(i,this.viewOptions.floor,this.viewOptions.ceil),o=this.roundStep(r);if(this.viewOptions.draggableRangeOnly){var a,s,u=this.viewHighValue-this.viewLowValue;this.currentTrackingPointer===DY.Min?(a=o,(s=o+u)>this.viewOptions.ceil&&(a=(s=this.viewOptions.ceil)-u)):this.currentTrackingPointer===DY.Max&&(s=o,(a=o-u)=this.maxHandlePosition-t;if(o<=n){if(0===i.position)return;a=this.getMinValue(o,!0,!1),s=this.getMaxValue(o,!0,!1)}else if(u){if(r.position===this.maxHandlePosition)return;s=this.getMaxValue(o,!0,!0),a=this.getMinValue(o,!0,!0)}else a=this.getMinValue(o,!1,!1),s=this.getMaxValue(o,!1,!1);this.positionTrackingBar(a,s)}},{key:"positionTrackingBar",value:function(e,t){!FY.isNullOrUndefined(this.viewOptions.minLimit)&&ethis.viewOptions.maxLimit&&(e=VY.roundToPrecisionLimit((t=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=e,this.viewHighValue=t,this.applyViewChange(),this.updateHandles(DY.Min,this.valueToPosition(e)),this.updateHandles(DY.Max,this.valueToPosition(t))}},{key:"positionTrackingHandle",value:function(e){e=this.applyMinMaxLimit(e),this.range&&(this.viewOptions.pushRange?e=this.applyPushRange(e):(this.viewOptions.noSwitching&&(this.currentTrackingPointer===DY.Min&&e>this.viewHighValue?e=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===DY.Max&&ethis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(DY.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=DY.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===DY.Max&&ethis.viewOptions.maxLimit?this.viewOptions.maxLimit:e}},{key:"applyMinMaxRange",value:function(e){var t=Math.abs(e-(this.currentTrackingPointer===DY.Min?this.viewHighValue:this.viewLowValue));if(!FY.isNullOrUndefined(this.viewOptions.minRange)&&tthis.viewOptions.maxRange){if(this.currentTrackingPointer===DY.Min)return VY.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===DY.Max)return VY.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return e}},{key:"applyPushRange",value:function(e){var t=this.currentTrackingPointer===DY.Min?this.viewHighValue-e:e-this.viewLowValue,n=FY.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ti&&(this.currentTrackingPointer===DY.Min?(this.viewHighValue=VY.roundToPrecisionLimit(e+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(DY.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===DY.Max&&(this.viewLowValue=VY.roundToPrecisionLimit(e-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(DY.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),e}},{key:"getChangeContext",value:function(){var e=new jY;return e.pointerType=this.currentTrackingPointer,e.value=+this.value,this.range&&(e.highValue=+this.highValue),e}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Zu),Es(Ku),Es(wc),Es(Vl))},e.\u0275cmp=Ct({type:e,selectors:[["ng5-slider"]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,fY,5),2&e)&&(ll(i=dl())&&(t.tooltipTemplate=i.first))},viewQuery:function(e,t){var n;(1&e&&(hl(dY,5,HY),hl(pY,5,HY),hl(vY,5,HY),hl(gY,5,HY),hl(mY,5,GY),hl(yY,5,GY),hl(bY,5,WY),hl(_Y,5,WY),hl(wY,5,WY),hl(kY,5,WY),hl(xY,5,WY),hl(SY,5,HY)),2&e)&&(ll(n=dl())&&(t.leftOuterSelectionBarElement=n.first),ll(n=dl())&&(t.rightOuterSelectionBarElement=n.first),ll(n=dl())&&(t.fullBarElement=n.first),ll(n=dl())&&(t.selectionBarElement=n.first),ll(n=dl())&&(t.minHandleElement=n.first),ll(n=dl())&&(t.maxHandleElement=n.first),ll(n=dl())&&(t.floorLabelElement=n.first),ll(n=dl())&&(t.ceilLabelElement=n.first),ll(n=dl())&&(t.minHandleLabelElement=n.first),ll(n=dl())&&(t.maxHandleLabelElement=n.first),ll(n=dl())&&(t.combinedLabelElement=n.first),ll(n=dl())&&(t.ticksElement=n.first))},hostAttrs:[1,"ng5-slider"],hostVars:5,hostBindings:function(e,t){1&e&&Fs("resize",function(e){return t.onResize(e)},!1,to),2&e&&(_s("disabled",t.sliderElementDisabledAttr),su("vertical",t.sliderElementVerticalClass)("animate",t.sliderElementAnimateClass))},inputs:{value:"value",highValue:"highValue",options:"options",manualRefresh:"manualRefresh",triggerFocus:"triggerFocus"},outputs:{valueChange:"valueChange",highValueChange:"highValueChange",userChangeStart:"userChangeStart",userChange:"userChange",userChangeEnd:"userChangeEnd"},features:[Hu([QY]),Gt],decls:29,vars:13,consts:[["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-left-out-selection"],["leftOuterSelectionBar",""],[1,"ng5-slider-span","ng5-slider-bar"],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-right-out-selection"],["rightOuterSelectionBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-full-bar"],["fullBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-selection-bar"],["selectionBar",""],[1,"ng5-slider-span","ng5-slider-bar","ng5-slider-selection",3,"ngStyle"],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-min",3,"ngStyle"],["minHandle",""],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-max",3,"ngStyle"],["maxHandle",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-floor"],["floorLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-ceil"],["ceilLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-value"],["minHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-high"],["maxHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-combined"],["combinedLabel",""],["ng5SliderElement","",1,"ng5-slider-ticks",3,"hidden"],["ticksElement",""],["class","ng5-slider-tick",3,"ngClass","ngStyle",4,"ngFor","ngForOf"],[1,"ng5-slider-tick",3,"ngClass","ngStyle"],[3,"template","tooltip","placement"],["class","ng5-slider-span ng5-slider-tick-value",3,"template","tooltip","placement","content",4,"ngIf"],["class","ng5-slider-span ng5-slider-tick-legend",3,"innerHTML",4,"ngIf"],[1,"ng5-slider-span","ng5-slider-tick-value",3,"template","tooltip","placement","content"],[1,"ng5-slider-span","ng5-slider-tick-legend",3,"innerHTML"]],template:function(e,t){1&e&&(Ts(0,"span",0,1),Ps(2,"span",2),As(),Ts(3,"span",3,4),Ps(5,"span",2),As(),Ts(6,"span",5,6),Ps(8,"span",2),As(),Ts(9,"span",7,8),Ps(11,"span",9),As(),Ps(12,"span",10,11),Ps(14,"span",12,13),Ps(16,"span",14,15),Ps(18,"span",16,17),Ps(20,"span",18,19),Ps(22,"span",20,21),Ps(24,"span",22,23),Ts(26,"span",24,25),xs(28,TY,4,9,"span",26),As()),2&e&&(qo(6),su("ng5-slider-transparent",t.fullBarTransparentClass),qo(3),su("ng5-slider-draggable",t.selectionBarDraggableClass),qo(2),Cs("ngStyle",t.barStyle),qo(1),Cs("ngStyle",t.minPointerStyle),qo(2),au("display",t.range?"inherit":"none"),Cs("ngStyle",t.maxPointerStyle),qo(12),su("ng5-slider-ticks-values-under",t.ticksUnderValuesClass),Cs("hidden",!t.showTicks),qo(2),Cs("ngForOf",t.ticks))},directives:function(){return[HY,Hh,GY,WY,Dh,Ih,ZY,Lh]},styles:[".ng5-slider{display:inline-block;position:relative;height:4px;width:100%;margin:35px 0 15px;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y} .ng5-slider.with-legend{margin-bottom:40px} .ng5-slider[disabled]{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-pointer{cursor:not-allowed;background-color:#d8e0f3} .ng5-slider[disabled] .ng5-slider-draggable{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-selection{background:#8b91a2} .ng5-slider[disabled] .ng5-slider-tick{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-tick.ng5-slider-selected{background:#8b91a2} .ng5-slider .ng5-slider-span{white-space:nowrap;position:absolute;display:inline-block} .ng5-slider .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider .ng5-slider-bar-wrapper{left:0;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:-16px;padding-top:16px;width:100%;height:32px;z-index:1} .ng5-slider .ng5-slider-draggable{cursor:move} .ng5-slider .ng5-slider-bar{left:0;width:100%;height:4px;z-index:1;background:#d8e0f3;border-radius:2px} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-transparent .ng5-slider-bar{background:0 0} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-left-out-selection .ng5-slider-bar{background:#df002d} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-right-out-selection .ng5-slider-bar{background:#03a688} .ng5-slider .ng5-slider-selection{z-index:2;background:#0db9f0;border-radius:2px} .ng5-slider .ng5-slider-pointer{cursor:pointer;width:32px;height:32px;top:-14px;background-color:#0db9f0;z-index:3;border-radius:16px} .ng5-slider .ng5-slider-pointer:after{content:'';width:8px;height:8px;position:absolute;top:12px;left:12px;border-radius:4px;background:#fff} .ng5-slider .ng5-slider-pointer:hover:after{background-color:#fff} .ng5-slider .ng5-slider-pointer.ng5-slider-active{z-index:4} .ng5-slider .ng5-slider-pointer.ng5-slider-active:after{background-color:#451aff} .ng5-slider .ng5-slider-bubble{cursor:default;bottom:16px;padding:1px 3px;color:#55637d;font-size:16px} .ng5-slider .ng5-slider-bubble.ng5-slider-limit{color:#55637d} .ng5-slider .ng5-slider-ticks{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:0;position:absolute;left:0;top:-3px;margin:0;z-index:1;list-style:none} .ng5-slider .ng5-slider-ticks-values-under .ng5-slider-tick-value{top:auto;bottom:-36px} .ng5-slider .ng5-slider-tick{text-align:center;cursor:pointer;width:10px;height:10px;background:#d8e0f3;border-radius:50%;position:absolute;top:0;left:0;margin-left:11px} .ng5-slider .ng5-slider-tick.ng5-slider-selected{background:#0db9f0} .ng5-slider .ng5-slider-tick-value{position:absolute;top:-34px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0)} .ng5-slider .ng5-slider-tick-legend{position:absolute;top:24px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0);max-width:50px;white-space:normal} .ng5-slider.vertical{position:relative;width:4px;height:100%;margin:0 20px;padding:0;vertical-align:baseline;-ms-touch-action:pan-x;touch-action:pan-x} .ng5-slider.vertical .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider.vertical .ng5-slider-bar-wrapper{top:auto;left:0;margin:0 0 0 -16px;padding:0 0 0 16px;height:100%;width:32px} .ng5-slider.vertical .ng5-slider-bar{bottom:0;left:auto;width:4px;height:100%} .ng5-slider.vertical .ng5-slider-pointer{left:-14px!important;top:auto;bottom:0} .ng5-slider.vertical .ng5-slider-bubble{left:16px!important;bottom:0} .ng5-slider.vertical .ng5-slider-ticks{height:100%;width:0;left:-3px;top:0;z-index:1} .ng5-slider.vertical .ng5-slider-tick{vertical-align:middle;margin-left:auto;margin-top:11px} .ng5-slider.vertical .ng5-slider-tick-value{left:24px;top:auto;-webkit-transform:translate(0,-28%);transform:translate(0,-28%)} .ng5-slider.vertical .ng5-slider-tick-legend{top:auto;right:24px;-webkit-transform:translate(0,-28%);transform:translate(0,-28%);max-width:none;white-space:nowrap} .ng5-slider.vertical .ng5-slider-ticks-values-under .ng5-slider-tick-value{bottom:auto;left:auto;right:24px} .ng5-slider *{-webkit-transition:none;transition:none} .ng5-slider.animate .ng5-slider-bar-wrapper{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-selection{-webkit-transition:background-color linear .3s;transition:background-color linear .3s} .ng5-slider.animate .ng5-slider-pointer{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-limit{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-combined{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-tick{-webkit-transition:background-color linear .3s;transition:background-color linear .3s}"]}),e}(),ZY=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ng5-slider-tooltip-wrapper"]],inputs:{template:"template",tooltip:"tooltip",placement:"placement",content:"content"},decls:2,vars:2,consts:[[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ng5-slider-inner-tooltip"]],template:function(e,t){1&e&&(xs(0,IY,2,6,"ng-container",0),xs(1,RY,3,3,"ng-container",0)),2&e&&(Cs("ngIf",t.template),qo(1),Cs("ngIf",!t.template))},directives:[Lh,Gh],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),e}(),JY=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh]]}),e}(),eK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,Kp,rp,Uz,sY,JY]]}),e}(),tK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,zX,uY,eK,I_,S_]]}),e}(),nK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,S_,tK]]}),e}(),iK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,uz,cz,sU,Uz,gU,S_]]}),e}(),rK=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this)).getLevel=e,o.isExpandable=i,o.options=r,o.options&&(o.trackBy=o.options.trackBy),o}return b(n,[{key:"getDescendants",value:function(e){for(var t=[],n=this.dataNodes.indexOf(e)+1;n1&&void 0!==arguments[1]?arguments[1]:this._dataDiffer,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._nodeOutlet.viewContainer,r=arguments.length>3?arguments[3]:void 0,o=n.diff(e);!o||(o.forEachOperation(function(n,o,a){if(null==n.previousIndex)t.insertNode(e[a],a,i,r);else if(null==a)i.remove(o),t._levels.delete(n.item);else{var s=i.get(o);i.move(s,a)}}),this._changeDetectorRef.detectChanges())}},{key:"_getNodeDef",value:function(e,t){return 1===this._nodeDefs.length?this._nodeDefs.first:this._nodeDefs.find(function(n){return n.when&&n.when(t,e)})||this._defaultNodeDef}},{key:"insertNode",value:function(e,t,n,i){var r=this._getNodeDef(e,t),o=new sK(e);o.level=this.treeControl.getLevel?this.treeControl.getLevel(e):void 0!==i&&this._levels.has(i)?this._levels.get(i)+1:0,this._levels.set(e,o.level),(n||this._nodeOutlet.viewContainer).createEmbeddedView(r.template,o,t),lK.mostRecentTreeNode&&(lK.mostRecentTreeNode.data=e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(pc),Es(wc))},e.\u0275cmp=Ct({type:e,selectors:[["cdk-tree"]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,uK,5),2&e)&&(ll(i=dl())&&(t._nodeDefs=i))},viewQuery:function(e,t){var n;(1&e&&hl(aK,7),2&e)&&(ll(n=dl())&&(t._nodeOutlet=n.first))},hostAttrs:["role","tree",1,"cdk-tree"],inputs:{dataSource:"dataSource",treeControl:"treeControl",trackBy:"trackBy"},exportAs:["cdkTree"],decls:1,vars:0,consts:[["cdkTreeNodeOutlet",""]],template:function(e,t){1&e&&Rs(0,0)},directives:[aK],encapsulation:2}),e}(),lK=function(){var e=function(){function e(t,n){m(this,e),this._elementRef=t,this._tree=n,this._destroyed=new oe,this._dataChanges=new oe,e.mostRecentTreeNode=this,this._elementRef.nativeElement.classList.add("cdk-tree-node"),this.role="treeitem"}return b(e,[{key:"role",get:function(){return"treeitem"},set:function(e){this._elementRef.nativeElement.setAttribute("role",e)}},{key:"data",get:function(){return this._data},set:function(e){e!==this._data&&(this._data=e,this._setRoleFromData(),this._dataChanges.next())}},{key:"isExpanded",get:function(){return this._tree.treeControl.isExpanded(this._data)}},{key:"_setExpanded",value:function(e){this._isAriaExpanded=e,this._elementRef.nativeElement.setAttribute("aria-expanded","".concat(e))}},{key:"level",get:function(){return this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._data):this._parentNodeAriaLevel}},{key:"ngOnInit",value:function(){this._parentNodeAriaLevel=function(e){for(var t=e.parentElement;t&&!hK(t);)t=t.parentElement;return t?t.classList.contains("cdk-nested-tree-node")?Rf(t.getAttribute("aria-level")):0:-1}(this._elementRef.nativeElement),this._elementRef.nativeElement.setAttribute("aria-level","".concat(this.level+1))}},{key:"ngDoCheck",value:function(){this.isExpanded!=this._isAriaExpanded&&this._setExpanded(this.isExpanded)}},{key:"ngOnDestroy",value:function(){e.mostRecentTreeNode===this&&(e.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}},{key:"focus",value:function(){this._elementRef.nativeElement.focus()}},{key:"_setRoleFromData",value:function(){this.role="treeitem"}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(cK))},e.\u0275dir=It({type:e,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),e.mostRecentTreeNode=null,e}();function hK(e){var t=e.classList;return!(!(null==t?void 0:t.contains("cdk-nested-tree-node"))&&!(null==t?void 0:t.contains("cdk-tree")))}var fK=/([A-Za-z%]+)$/,dK=function(){var e=function(){function e(t,n,i,r){var o=this;m(this,e),this._treeNode=t,this._tree=n,this._element=i,this._dir=r,this._destroyed=new oe,this.indentUnits="px",this._indent=40,this._setPadding(),r&&r.change.pipe(ud(this._destroyed)).subscribe(function(){return o._setPadding(!0)}),t._dataChanges.subscribe(function(){return o._setPadding()})}return b(e,[{key:"level",get:function(){return this._level},set:function(e){this._setLevelInput(e)}},{key:"indent",get:function(){return this._indent},set:function(e){this._setIndentInput(e)}},{key:"ngOnDestroy",value:function(){this._destroyed.next(),this._destroyed.complete()}},{key:"_paddingIndent",value:function(){var e=this._treeNode.data&&this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._treeNode.data):null,t=null==this._level?e:this._level;return"number"==typeof t?"".concat(t*this._indent).concat(this.indentUnits):null}},{key:"_setPadding",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._paddingIndent();if(t!==this._currentPadding||e){var n=this._element.nativeElement,i=this._dir&&"rtl"===this._dir.value?"paddingRight":"paddingLeft",r="paddingLeft"===i?"paddingRight":"paddingLeft";n.style[i]=t||"",n.style[r]="",this._currentPadding=t}}},{key:"_setLevelInput",value:function(e){this._level=Rf(e,null),this._setPadding()}},{key:"_setIndentInput",value:function(e){var t=e,n="px";if("string"==typeof e){var i=e.split(fK);t=i[0],n=i[1]||n}this.indentUnits=n,this._indent=Rf(t),this._setPadding()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(lK),Es(cK),Es(Ku),Es(zd,8))},e.\u0275dir=It({type:e,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),e}(),pK=function(){var e=function(){function e(t,n){m(this,e),this._tree=t,this._treeNode=n,this._recursive=!1}return b(e,[{key:"recursive",get:function(){return this._recursive},set:function(e){this._recursive=If(e)}},{key:"_toggle",value:function(e){this.recursive?this._tree.treeControl.toggleDescendants(this._treeNode.data):this._tree.treeControl.toggle(this._treeNode.data),e.stopPropagation()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(cK),Es(lK))},e.\u0275dir=It({type:e,selectors:[["","cdkTreeNodeToggle",""]],hostBindings:function(e,t){1&e&&Fs("click",function(e){return t._toggle(e)})},inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]}}),e}(),vK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({}),e}(),gK=Ky(qy(lK)),mK=function(){var t=function(t){a(i,t);var n=s(i);function i(e,t,r){var o;return m(this,i),(o=n.call(this,e,t)).tabIndex=Number(r)||0,e.nativeElement.classList.add("mat-tree-node"),o}return b(i,[{key:"ngOnInit",value:function(){e(p(i.prototype),"ngOnInit",this).call(this)}},{key:"ngDoCheck",value:function(){e(p(i.prototype),"ngDoCheck",this).call(this)}},{key:"ngOnDestroy",value:function(){e(p(i.prototype),"ngOnDestroy",this).call(this)}}]),i}(gK);return t.\u0275fac=function(e){return new(e||t)(Es(Ku),Es(cK),Ti("tabindex"))},t.\u0275dir=It({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[Hu([{provide:lK,useExisting:t}]),ss]}),t}(),yK=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(uK);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["","matTreeNodeDef",""]],inputs:{when:["matTreeNodeDefWhen","when"],data:["matTreeNode","data"]},features:[Hu([{provide:uK,useExisting:t}]),ss]}),t}(),bK=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"level",get:function(){return this._level},set:function(e){this._setLevelInput(e)}},{key:"indent",get:function(){return this._indent},set:function(e){this._setIndentInput(e)}}]),n}(dK);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["","matTreeNodePadding",""]],inputs:{level:["matTreeNodePadding","level"],indent:["matTreeNodePaddingIndent","indent"]},features:[Hu([{provide:dK,useExisting:t}]),ss]}),t}(),_K=function(){var e=function e(t,n){m(this,e),this.viewContainer=t,this._node=n};return e.\u0275fac=function(t){return new(t||e)(Es(Mc),Es(oK,8))},e.\u0275dir=It({type:e,selectors:[["","matTreeNodeOutlet",""]],features:[Hu([{provide:aK,useExisting:e}])]}),e}(),wK=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(cK);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275cmp=Ct({type:t,selectors:[["mat-tree"]],viewQuery:function(e,t){var n;(1&e&&hl(_K,7),2&e)&&(ll(n=dl())&&(t._nodeOutlet=n.first))},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[Hu([{provide:cK,useExisting:t}]),ss],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(e,t){1&e&&Rs(0,0)},directives:[_K],styles:[".mat-tree{display:block}.mat-tree-node{display:flex;align-items:center;flex:1;word-wrap:break-word}.mat-nested-tree-node{border-bottom-width:0}\n"],encapsulation:2}),t}(),kK=function(){var e,t=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"recursive",get:function(){return this._recursive},set:function(e){this._recursive=If(e)}}]),n}(pK);return t.\u0275fac=function(n){return(e||(e=Ci(t)))(n||t)},t.\u0275dir=It({type:t,selectors:[["","matTreeNodeToggle",""]],inputs:{recursive:["matTreeNodeToggleRecursive","recursive"]},features:[Hu([{provide:pK,useExisting:t}]),ss]}),t}(),xK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[vK,Wy],Wy]}),e}(),SK=function(){function e(t,n,i,r){m(this,e),this.transformFunction=t,this.getLevel=n,this.isExpandable=i,this.getChildren=r}return b(e,[{key:"_flattenNode",value:function(e,t,n,i){var r=this,o=this.transformFunction(e,t);if(n.push(o),this.isExpandable(o)){var a=this.getChildren(e);a&&(Array.isArray(a)?this._flattenChildren(a,t,n,i):a.pipe(ap(1)).subscribe(function(e){r._flattenChildren(e,t,n,i)}))}return n}},{key:"_flattenChildren",value:function(e,t,n,i){var r=this;e.forEach(function(o,a){var s=i.slice();s.push(a!=e.length-1),r._flattenNode(o,t+1,n,s)})}},{key:"flattenNodes",value:function(e){var t=this,n=[];return e.forEach(function(e){return t._flattenNode(e,0,n,[])}),n}},{key:"expandFlattenedNodes",value:function(e,t){var n=this,i=[],r=[];return r[0]=!0,e.forEach(function(e){for(var o=!0,a=0;a<=n.getLevel(e);a++)o=o&&r[a];o&&i.push(e),n.isExpandable(e)&&(r[n.getLevel(e)+1]=t.isExpanded(e))}),i}}]),e}(),EK=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this))._treeControl=e,o._treeFlattener=i,o._flattenedData=new nv([]),o._expandedData=new nv([]),o._data=new nv([]),r&&(o.data=r),o}return b(n,[{key:"data",get:function(){return this._data.value},set:function(e){this._data.next(e),this._flattenedData.next(this._treeFlattener.flattenNodes(this.data)),this._treeControl.dataNodes=this._flattenedData.value}},{key:"connect",value:function(e){var t=this;return Ce(e.viewChange,this._treeControl.expansionModel.changed,this._flattenedData).pipe(ue(function(){return t._expandedData.next(t._treeFlattener.expandFlattenedNodes(t._flattenedData.value,t._treeControl)),t._expandedData.value}))}},{key:"disconnect",value:function(){}}]),n}(function(){return function e(){m(this,e)}}()),CK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_,S_,pw,xK,qG]]}),e}(),OK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,iK,CK]]}),e}(),TK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,iK,CK,OK],iK,CK,OK]}),e}();function AK(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function PK(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach(function(n){void 0===e[n]?e[n]=t[n]:AK(t[n])&&AK(e[n])&&Object.keys(t[n]).length>0&&PK(e[n],t[n])})}var MK={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function IK(){var e="undefined"!=typeof document?document:{};return PK(e,MK),e}var RK={document:MK,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(e){return"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function DK(){var e="undefined"!=typeof window?window:{};return PK(e,RK),e}function NK(e){return(NK=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function LK(e,t){return(LK=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jK(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(H){return!1}}function FK(e,t,n){return(FK=jK()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&LK(r,n.prototype),r}).apply(null,arguments)}function BK(e){var t="function"==typeof Map?new Map:void 0;return(BK=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return FK(e,arguments,NK(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),LK(n,e)})(e)}var VK=function(e){function t(t){var n;return function(e){var t=e.__proto__;Object.defineProperty(e,"__proto__",{get:function(){return t},set:function(e){t.__proto__=e}})}(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n=e.call.apply(e,[this].concat(t))||this)),n}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t}(BK(Array));function zK(e){void 0===e&&(e=[]);var t=[];return e.forEach(function(e){Array.isArray(e)?t.push.apply(t,zK(e)):t.push(e)}),t}function UK(e,t){return Array.prototype.filter.call(e,t)}function HK(e,t){var n=DK(),i=IK(),r=[];if(!t&&e instanceof VK)return e;if(!e)return new VK(r);if("string"==typeof e){var o=e.trim();if(o.indexOf("<")>=0&&o.indexOf(">")>=0){var a="div";0===o.indexOf("0}).length>0},toggleClass:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0;d-=1){var p=f[d];o&&p.listener===o||o&&p.listener&&p.listener.dom7proxy&&p.listener.dom7proxy===o?(h.removeEventListener(c,p.proxyListener,a),f.splice(d,1)):o||(h.removeEventListener(c,p.proxyListener,a),f.splice(d,1))}}return this},trigger:function(){for(var e=DK(),t=arguments.length,n=new Array(t),i=0;i0}),c.dispatchEvent(l),c.dom7EventData=[],delete c.dom7EventData}}return this},transitionEnd:function(e){var t=this;return e&&t.on("transitionend",function n(i){i.target===this&&(e.call(this,i),t.off("transitionend",n))}),this},outerWidth:function(e){if(this.length>0){if(e){var t=this.styles();return this[0].offsetWidth+parseFloat(t.getPropertyValue("margin-right"))+parseFloat(t.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(e){if(this.length>0){if(e){var t=this.styles();return this[0].offsetHeight+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},styles:function(){var e=DK();return this[0]?e.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var e=DK(),t=IK(),n=this[0],i=n.getBoundingClientRect(),r=t.body;return{top:i.top+(n===e?e.scrollY:n.scrollTop)-(n.clientTop||r.clientTop||0),left:i.left+(n===e?e.scrollX:n.scrollLeft)-(n.clientLeft||r.clientLeft||0)}}return null},css:function(e,t){var n,i=DK();if(1===arguments.length){if("string"!=typeof e){for(n=0;nt-1)return HK([]);if(e<0){var n=t+e;return HK(n<0?[]:[this[n]])}return HK([this[e]])},append:function(){for(var e,t=IK(),n=0;n=0;n-=1)this[t].insertBefore(r.childNodes[n],this[t].childNodes[0])}else if(e instanceof VK)for(n=0;n0?e?this[0].nextElementSibling&&HK(this[0].nextElementSibling).is(e)?HK([this[0].nextElementSibling]):HK([]):HK(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):HK([])},nextAll:function(e){var t=[],n=this[0];if(!n)return HK([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;e?HK(i).is(e)&&t.push(i):t.push(i),n=i}return HK(t)},prev:function(e){if(this.length>0){var t=this[0];return e?t.previousElementSibling&&HK(t.previousElementSibling).is(e)?HK([t.previousElementSibling]):HK([]):HK(t.previousElementSibling?[t.previousElementSibling]:[])}return HK([])},prevAll:function(e){var t=[],n=this[0];if(!n)return HK([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;e?HK(i).is(e)&&t.push(i):t.push(i),n=i}return HK(t)},parent:function(e){for(var t=[],n=0;n=0,observer:"MutationObserver"in e||"WebkitMutationObserver"in e,passiveListener:function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassiveListener",null,n)}catch(i){}return t}(),gestures:"ongesturestart"in e}}()),XK}function rQ(e){return void 0===e&&(e={}),YK||(YK=function(e){var t=(void 0===e?{}:e).userAgent,n=iQ(),i=DK(),r=i.navigator.platform,o=t||i.navigator.userAgent,a={ios:!1,android:!1},s=i.screen.width,u=i.screen.height,c=o.match(/(Android);?[\s\/]+([\d.]+)?/),l=o.match(/(iPad).*OS\s([\d_]+)/),h=o.match(/(iPod)(.*OS\s([\d_]+))?/),f=!l&&o.match(/(iPhone\sOS|iOS)\s([\d_]+)/),d="Win32"===r,p="MacIntel"===r;return!l&&p&&n.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(s+"x"+u)>=0&&((l=o.match(/(Version)\/([\d.]+)/))||(l=[0,1,"13_0_0"]),p=!1),c&&!d&&(a.os="android",a.android=!0),(l||f||h)&&(a.os="ios",a.ios=!0),a}(e)),YK}function oQ(){return KK||(KK=function(){var e,t=DK();return{isEdge:!!t.navigator.userAgent.match(/Edge/g),isSafari:(e=t.navigator.userAgent.toLowerCase(),e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0),isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(t.navigator.userAgent)}}()),KK}var aQ={name:"resize",create:function(){var e=this;tQ(e,{resize:{observer:null,createObserver:function(){!e||e.destroyed||!e.initialized||(e.resize.observer=new ResizeObserver(function(t){var n=e.width,i=e.height,r=n,o=i;t.forEach(function(t){var n=t.contentBoxSize,i=t.contentRect,a=t.target;a&&a!==e.el||(r=i?i.width:(n[0]||n).inlineSize,o=i?i.height:(n[0]||n).blockSize)}),(r!==n||o!==i)&&e.resize.resizeHandler()}),e.resize.observer.observe(e.el))},removeObserver:function(){e.resize.observer&&e.resize.observer.unobserve&&e.el&&(e.resize.observer.unobserve(e.el),e.resize.observer=null)},resizeHandler:function(){!e||e.destroyed||!e.initialized||(e.emit("beforeResize"),e.emit("resize"))},orientationChangeHandler:function(){!e||e.destroyed||!e.initialized||e.emit("orientationchange")}}})},on:{init:function(e){var t=DK();e.params.resizeObserver&&void 0!==DK().ResizeObserver?e.resize.createObserver():(t.addEventListener("resize",e.resize.resizeHandler),t.addEventListener("orientationchange",e.resize.orientationChangeHandler))},destroy:function(e){var t=DK();e.resize.removeObserver(),t.removeEventListener("resize",e.resize.resizeHandler),t.removeEventListener("orientationchange",e.resize.orientationChangeHandler)}}};function sQ(){return(sQ=Object.assign||function(e){for(var t=1;t0)&&(!r.isTouched||!r.isMoved))){o.noSwipingClass&&""!==o.noSwipingClass&&s.target&&s.target.shadowRoot&&e.path&&e.path[0]&&(u=QK(e.path[0]));var c=o.noSwipingSelector?o.noSwipingSelector:"."+o.noSwipingClass;if(o.noSwiping&&(s.target&&s.target.shadowRoot?function(e,t){return void 0===t&&(t=this),function t(n){return n&&n!==IK()&&n!==DK()?(n.assignedSlot&&(n=n.assignedSlot),n.closest(e)||t(n.getRootNode().host)):null}(t)}(c,s.target):u.closest(c)[0]))return void(t.allowClick=!0);if(!o.swipeHandler||u.closest(o.swipeHandler)[0]){a.currentX="touchstart"===s.type?s.targetTouches[0].pageX:s.pageX,a.currentY="touchstart"===s.type?s.targetTouches[0].pageY:s.pageY;var l=a.currentX,h=a.currentY,f=o.edgeSwipeDetection||o.iOSEdgeSwipeDetection,d=o.edgeSwipeThreshold||o.iOSEdgeSwipeThreshold;if(f&&(l<=d||l>=i.innerWidth-d)){if("prevent"!==f)return;e.preventDefault()}if(tQ(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=l,a.startY=h,r.touchStartTime=ZK(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,o.threshold>0&&(r.allowThresholdMove=!1),"touchstart"!==s.type){var p=!0;u.is(r.focusableElements)&&(p=!1),n.activeElement&&QK(n.activeElement).is(r.focusableElements)&&n.activeElement!==u[0]&&n.activeElement.blur(),(o.touchStartForcePreventDefault||p&&t.allowTouchMove&&o.touchStartPreventDefault)&&!u[0].isContentEditable&&s.preventDefault()}t.emit("touchStart",s)}}}}function hQ(e){var t=IK(),n=this,i=n.touchEventsData,r=n.params,o=n.touches,a=n.rtlTranslate;if(n.enabled){var s=e;if(s.originalEvent&&(s=s.originalEvent),!i.isTouched)return void(i.startMoving&&i.isScrolling&&n.emit("touchMoveOpposite",s));if(!i.isTouchEvent||"touchmove"===s.type){var u="touchmove"===s.type&&s.targetTouches&&(s.targetTouches[0]||s.changedTouches[0]),c="touchmove"===s.type?u.pageX:s.pageX,l="touchmove"===s.type?u.pageY:s.pageY;if(s.preventedByNestedSwiper)return o.startX=c,void(o.startY=l);if(!n.allowTouchMove)return n.allowClick=!1,void(i.isTouched&&(tQ(o,{startX:c,startY:l,currentX:c,currentY:l}),i.touchStartTime=ZK()));if(i.isTouchEvent&&r.touchReleaseOnEdges&&!r.loop)if(n.isVertical()){if(lo.startY&&n.translate>=n.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(co.startX&&n.translate>=n.minTranslate())return;if(i.isTouchEvent&&t.activeElement&&s.target===t.activeElement&&QK(s.target).is(i.focusableElements))return i.isMoved=!0,void(n.allowClick=!1);if(i.allowTouchCallbacks&&n.emit("touchMove",s),!(s.targetTouches&&s.targetTouches.length>1)){o.currentX=c,o.currentY=l;var h=o.currentX-o.startX,f=o.currentY-o.startY;if(!(n.params.threshold&&Math.sqrt(Math.pow(h,2)+Math.pow(f,2))=25&&(d=180*Math.atan2(Math.abs(f),Math.abs(h))/Math.PI,i.isScrolling=n.isHorizontal()?d>r.touchAngle:90-d>r.touchAngle)),i.isScrolling&&n.emit("touchMoveOpposite",s),void 0===i.startMoving&&(o.currentX!==o.startX||o.currentY!==o.startY)&&(i.startMoving=!0),i.isScrolling)return void(i.isTouched=!1);if(i.startMoving){n.allowClick=!1,!r.cssMode&&s.cancelable&&s.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&s.stopPropagation(),i.isMoved||(r.loop&&n.loopFix(),i.startTranslate=n.getTranslate(),n.setTransition(0),n.animating&&n.$wrapperEl.trigger("webkitTransitionEnd transitionend"),i.allowMomentumBounce=!1,r.grabCursor&&(!0===n.allowSlideNext||!0===n.allowSlidePrev)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",s)),n.emit("sliderMove",s),i.isMoved=!0;var p=n.isHorizontal()?h:f;o.diff=p,p*=r.touchRatio,a&&(p=-p),n.swipeDirection=p>0?"prev":"next",i.currentTranslate=p+i.startTranslate;var v=!0,g=r.resistanceRatio;if(r.touchReleaseOnEdges&&(g=0),p>0&&i.currentTranslate>n.minTranslate()?(v=!1,r.resistance&&(i.currentTranslate=n.minTranslate()-1+Math.pow(-n.minTranslate()+i.startTranslate+p,g))):p<0&&i.currentTranslatei.startTranslate&&(i.currentTranslate=i.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(p)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,o.startX=o.currentX,o.startY=o.currentY,i.currentTranslate=i.startTranslate,void(o.diff=n.isHorizontal()?o.currentX-o.startX:o.currentY-o.startY)}!r.followFinger||r.cssMode||((r.freeMode||r.watchSlidesProgress||r.watchSlidesVisibility)&&(n.updateActiveIndex(),n.updateSlidesClasses()),r.freeMode&&(0===i.velocities.length&&i.velocities.push({position:o[n.isHorizontal()?"startX":"startY"],time:i.touchStartTime}),i.velocities.push({position:o[n.isHorizontal()?"currentX":"currentY"],time:ZK()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function fQ(e){var t=this,n=t.touchEventsData,i=t.params,r=t.touches,o=t.rtlTranslate,a=t.$wrapperEl,s=t.slidesGrid,u=t.snapGrid;if(t.enabled){var c=e;if(c.originalEvent&&(c=c.originalEvent),n.allowTouchCallbacks&&t.emit("touchEnd",c),n.allowTouchCallbacks=!1,!n.isTouched)return n.isMoved&&i.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,void(n.startMoving=!1);i.grabCursor&&n.isMoved&&n.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);var l,h=ZK(),f=h-n.touchStartTime;if(t.allowClick&&(t.updateClickedSlide(c),t.emit("tap click",c),f<300&&h-n.lastClickTime<300&&t.emit("doubleTap doubleClick",c)),n.lastClickTime=ZK(),$K(function(){t.destroyed||(t.allowClick=!0)}),!n.isTouched||!n.isMoved||!t.swipeDirection||0===r.diff||n.currentTranslate===n.startTranslate)return n.isTouched=!1,n.isMoved=!1,void(n.startMoving=!1);if(n.isTouched=!1,n.isMoved=!1,n.startMoving=!1,l=i.followFinger?o?t.translate:-t.translate:-n.currentTranslate,!i.cssMode){if(i.freeMode){if(l<-t.minTranslate())return void t.slideTo(t.activeIndex);if(l>-t.maxTranslate())return void t.slideTo(t.slides.length1){var d=n.velocities.pop(),p=n.velocities.pop(),v=d.time-p.time;t.velocity=(d.position-p.position)/v,t.velocity/=2,Math.abs(t.velocity)150||ZK()-d.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=i.freeModeMomentumVelocityRatio,n.velocities.length=0;var g=1e3*i.freeModeMomentumRatio,m=t.translate+t.velocity*g;o&&(m=-m);var y,b,_=!1,w=20*Math.abs(t.velocity)*i.freeModeMomentumBounceRatio;if(mt.minTranslate())i.freeModeMomentumBounce?(m-t.minTranslate()>w&&(m=t.minTranslate()+w),y=t.minTranslate(),_=!0,n.allowMomentumBounce=!0):m=t.minTranslate(),i.loop&&i.centeredSlides&&(b=!0);else if(i.freeModeSticky){for(var k,x=0;x-m){k=x;break}m=-(m=Math.abs(u[k]-m)=i.longSwipesMs)&&(t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses()))}for(var C=0,O=t.slidesSizesGrid[0],T=0;T=s[T]&&l=s[T]&&(C=T,O=s[s.length-1]-s[s.length-2])}var P=(l-s[C])/O,M=Ci.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&t.slideTo(P>=i.longSwipesRatio?C+M:C),"prev"===t.swipeDirection&&t.slideTo(P>1-i.longSwipesRatio?C+M:C)}else{if(!i.shortSwipes)return void t.slideTo(t.activeIndex);!t.navigation||c.target!==t.navigation.nextEl&&c.target!==t.navigation.prevEl?("next"===t.swipeDirection&&t.slideTo(C+M),"prev"===t.swipeDirection&&t.slideTo(C)):t.slideTo(c.target===t.navigation.nextEl?C+M:C)}}}}function dQ(){var e=this,t=e.params,n=e.el;if(!n||0!==n.offsetWidth){t.breakpoints&&e.setBreakpoint();var i=e.allowSlideNext,r=e.allowSlidePrev,o=e.snapGrid;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses(),e.slideTo(("auto"===t.slidesPerView||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides?e.slides.length-1:e.activeIndex,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.run(),e.allowSlidePrev=r,e.allowSlideNext=i,e.params.watchOverflow&&o!==e.snapGrid&&e.checkOverflow()}}function pQ(e){var t=this;!t.enabled||t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))}function vQ(){var e=this,t=e.wrapperEl,n=e.rtlTranslate;if(e.enabled){e.previousTranslate=e.translate,e.translate=e.isHorizontal()?n?t.scrollWidth-t.offsetWidth-t.scrollLeft:-t.scrollLeft:-t.scrollTop,-0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();var i=e.maxTranslate()-e.minTranslate();(0===i?0:(e.translate-e.minTranslate())/i)!==e.progress&&e.updateProgress(n?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}}var gQ=!1;function mQ(){}var yQ={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!1,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,slidesPerGroupSkip:0,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,loopPreventsSlide:!0,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0,_emitClasses:!1};var bQ={modular:{useParams:function(e){var t=this;!t.modules||Object.keys(t.modules).forEach(function(n){var i=t.modules[n];i.params&&tQ(e,i.params)})},useModules:function(e){void 0===e&&(e={});var t=this;!t.modules||Object.keys(t.modules).forEach(function(n){var i=t.modules[n],r=e[n]||{};i.on&&t.on&&Object.keys(i.on).forEach(function(e){t.on(e,i.on[e])}),i.create&&i.create.bind(t)(r)})}},eventsEmitter:{on:function(e,t,n){var i=this;if("function"!=typeof t)return i;var r=n?"unshift":"push";return e.split(" ").forEach(function(e){i.eventsListeners[e]||(i.eventsListeners[e]=[]),i.eventsListeners[e][r](t)}),i},once:function(e,t,n){var i=this;if("function"!=typeof t)return i;function r(){i.off(e,r),r.__emitterProxy&&delete r.__emitterProxy;for(var n=arguments.length,o=new Array(n),a=0;a=0&&t.eventsAnyListeners.splice(n,1),t},off:function(e,t){var n=this;return n.eventsListeners&&e.split(" ").forEach(function(e){void 0===t?n.eventsListeners[e]=[]:n.eventsListeners[e]&&n.eventsListeners[e].forEach(function(i,r){(i===t||i.__emitterProxy&&i.__emitterProxy===t)&&n.eventsListeners[e].splice(r,1)})}),n},emit:function(){var e=this;if(!e.eventsListeners)return e;for(var t,n,i,r=arguments.length,o=new Array(r),a=0;a=0&&(b=parseFloat(b.replace("%",""))/100*o),e.virtualSize=-b,l.css(a?{marginLeft:"",marginBottom:"",marginTop:""}:{marginRight:"",marginBottom:"",marginTop:""}),i.slidesPerColumn>1&&(x=Math.floor(h/i.slidesPerColumn)===h/e.params.slidesPerColumn?h:Math.ceil(h/i.slidesPerColumn)*i.slidesPerColumn,"auto"!==i.slidesPerView&&"row"===i.slidesPerColumnFill&&(x=Math.max(x,i.slidesPerView*i.slidesPerColumn)));for(var O,T=i.slidesPerColumn,A=x/T,P=Math.floor(h/i.slidesPerColumn),M=0;M1){var R=void 0,D=void 0,N=void 0;if("row"===i.slidesPerColumnFill&&i.slidesPerGroup>1){var L=Math.floor(M/(i.slidesPerGroup*i.slidesPerColumn)),j=M-i.slidesPerColumn*i.slidesPerGroup*L,F=0===L?i.slidesPerGroup:Math.min(Math.ceil((h-L*T*i.slidesPerGroup)/T),i.slidesPerGroup);N=Math.floor(j/F),I.css({"-webkit-box-ordinal-group":R=(D=j-N*F+L*i.slidesPerGroup)+N*x/T,"-moz-box-ordinal-group":R,"-ms-flex-order":R,"-webkit-order":R,order:R})}else"column"===i.slidesPerColumnFill?(N=M-(D=Math.floor(M/T))*T,(D>P||D===P&&N===T-1)&&(N+=1)>=T&&(N=0,D+=1)):D=M-(N=Math.floor(M/A))*A;I.css(t("margin-top"),0!==N?i.spaceBetween&&i.spaceBetween+"px":"")}if("none"!==I.css("display")){if("auto"===i.slidesPerView){var B=getComputedStyle(I[0]),V=I[0].style.transform,z=I[0].style.webkitTransform;if(V&&(I[0].style.transform="none"),z&&(I[0].style.webkitTransform="none"),i.roundLengths)O=e.isHorizontal()?I.outerWidth(!0):I.outerHeight(!0);else{var U=n(B,"width"),H=n(B,"padding-left"),G=n(B,"padding-right"),W=n(B,"margin-left"),q=n(B,"margin-right"),X=B.getPropertyValue("box-sizing");if(X&&"border-box"===X)O=U+W+q;else{var Y=I[0];O=U+H+G+W+q+(Y.offsetWidth-Y.clientWidth)}}V&&(I[0].style.transform=V),z&&(I[0].style.webkitTransform=z),i.roundLengths&&(O=Math.floor(O))}else O=(o-(i.slidesPerView-1)*b)/i.slidesPerView,i.roundLengths&&(O=Math.floor(O)),l[M]&&(l[M].style[t("width")]=O+"px");l[M]&&(l[M].swiperSlideSize=O),p.push(O),i.centeredSlides?(_=_+O/2+w/2+b,0===w&&0!==M&&(_=_-o/2-b),0===M&&(_=_-o/2-b),Math.abs(_)<.001&&(_=0),i.roundLengths&&(_=Math.floor(_)),k%i.slidesPerGroup==0&&f.push(_),d.push(_)):(i.roundLengths&&(_=Math.floor(_)),(k-Math.min(e.params.slidesPerGroupSkip,k))%e.params.slidesPerGroup==0&&f.push(_),d.push(_),_=_+O+b),e.virtualSize+=O+b,w=O,k+=1}}if(e.virtualSize=Math.max(e.virtualSize,o)+g,a&&s&&("slide"===i.effect||"coverflow"===i.effect)&&r.css({width:e.virtualSize+i.spaceBetween+"px"}),i.setWrapperSize&&r.css(((E={})[t("width")]=e.virtualSize+i.spaceBetween+"px",E)),i.slidesPerColumn>1&&(e.virtualSize=(O+i.spaceBetween)*x,e.virtualSize=Math.ceil(e.virtualSize/i.slidesPerColumn)-i.spaceBetween,r.css(((C={})[t("width")]=e.virtualSize+i.spaceBetween+"px",C)),i.centeredSlides)){S=[];for(var K=0;K1&&f.push(e.virtualSize-o)}if(0===f.length&&(f=[0]),0!==i.spaceBetween){var J,ee=e.isHorizontal()&&a?"marginLeft":t("marginRight");l.filter(function(e,t){return!i.cssMode||t!==l.length-1}).css(((J={})[ee]=b+"px",J))}if(i.centeredSlides&&i.centeredSlidesBounds){var te=0;p.forEach(function(e){te+=e+(i.spaceBetween?i.spaceBetween:0)});var ne=(te-=i.spaceBetween)-o;f=f.map(function(e){return e<0?-v:e>ne?ne+g:e})}if(i.centerInsufficientSlides){var ie=0;if(p.forEach(function(e){ie+=e+(i.spaceBetween?i.spaceBetween:0)}),(ie-=i.spaceBetween)1)if(n.params.centeredSlides)n.visibleSlides.each(function(e){i.push(e)});else for(t=0;tn.slides.length&&!r)break;i.push(a(s))}else i.push(a(n.activeIndex));for(t=0;to?u:o}o&&n.$wrapperEl.css("height",o+"px")},updateSlidesOffset:function(){for(var e=this.slides,t=0;t=0&&c1&&l<=t.size||c<=0&&l>=t.size)&&(t.visibleSlides.push(s),t.visibleSlidesIndexes.push(a),i.eq(a).addClass(n.slideVisibleClass))}s.progress=r?-u:u}t.visibleSlides=QK(t.visibleSlides)}},updateProgress:function(e){var t=this;void 0===e&&(e=t&&t.translate&&t.translate*(t.rtlTranslate?-1:1)||0);var n=t.params,i=t.maxTranslate()-t.minTranslate(),r=t.progress,o=t.isBeginning,a=t.isEnd,s=o,u=a;0===i?(r=0,o=!0,a=!0):(o=(r=(e-t.minTranslate())/i)<=0,a=r>=1),tQ(t,{progress:r,isBeginning:o,isEnd:a}),(n.watchSlidesProgress||n.watchSlidesVisibility||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),o&&!s&&t.emit("reachBeginning toEdge"),a&&!u&&t.emit("reachEnd toEdge"),(s&&!o||u&&!a)&&t.emit("fromEdge"),t.emit("progress",r)},updateSlidesClasses:function(){var e,t=this,n=t.slides,i=t.params,r=t.$wrapperEl,o=t.activeIndex,a=t.realIndex,s=t.virtual&&i.virtual.enabled;n.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(e=s?t.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+o+'"]'):n.eq(o)).addClass(i.slideActiveClass),i.loop&&(e.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+a+'"]').addClass(i.slideDuplicateActiveClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+a+'"]').addClass(i.slideDuplicateActiveClass));var u=e.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===u.length&&(u=n.eq(0)).addClass(i.slideNextClass);var c=e.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===c.length&&(c=n.eq(-1)).addClass(i.slidePrevClass),i.loop&&(u.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+u.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+u.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),c.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass)),t.emitSlidesClasses()},updateActiveIndex:function(e){var t,n=this,i=n.rtlTranslate?n.translate:-n.translate,r=n.slidesGrid,o=n.snapGrid,a=n.params,s=n.activeIndex,u=n.realIndex,c=n.snapIndex,l=e;if(void 0===l){for(var h=0;h=r[h]&&i=r[h]&&i=r[h]&&(l=h);a.normalizeSlideIndex&&(l<0||void 0===l)&&(l=0)}if(o.indexOf(i)>=0)t=o.indexOf(i);else{var f=Math.min(a.slidesPerGroupSkip,l);t=f+Math.floor((l-f)/a.slidesPerGroup)}if(t>=o.length&&(t=o.length-1),l!==s){var d=parseInt(n.slides.eq(l).attr("data-swiper-slide-index")||l,10);tQ(n,{snapIndex:t,realIndex:d,previousIndex:s,activeIndex:l}),n.emit("activeIndexChange"),n.emit("snapIndexChange"),u!==d&&n.emit("realIndexChange"),(n.initialized||n.params.runCallbacksOnInit)&&n.emit("slideChange")}else t!==c&&(n.snapIndex=t,n.emit("snapIndexChange"))},updateClickedSlide:function(e){var t,n=this,i=n.params,r=QK(e.target).closest("."+i.slideClass)[0],o=!1;if(r)for(var a=0;a6&&(i=i.split(", ").map(function(e){return e.replace(",",".")}).join(", ")),r=new o.WebKitCSSMatrix("none"===i?"":i)):n=(r=a.MozTransform||a.OTransform||a.MsTransform||a.msTransform||a.transform||a.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===t&&(i=o.WebKitCSSMatrix?r.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===t&&(i=o.WebKitCSSMatrix?r.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),i||0}(t.$wrapperEl[0],e);return i&&(o=-o),o||0},setTranslate:function(e,t){var n=this,i=n.rtlTranslate,r=n.params,o=n.$wrapperEl,a=n.wrapperEl,s=n.progress,u=0,c=0;n.isHorizontal()?u=i?-e:e:c=e,r.roundLengths&&(u=Math.floor(u),c=Math.floor(c)),r.cssMode?a[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-u:-c:r.virtualTranslate||o.transform("translate3d("+u+"px, "+c+"px, 0px)"),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?u:c;var l=n.maxTranslate()-n.minTranslate();(0===l?0:(e-n.minTranslate())/l)!==s&&n.updateProgress(e),n.emit("setTranslate",n.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e,t,n,i,r){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===n&&(n=!0),void 0===i&&(i=!0);var o=this,a=o.params,s=o.wrapperEl;if(o.animating&&a.preventInteractionOnTransition)return!1;var u,c=o.minTranslate(),l=o.maxTranslate();if(o.updateProgress(u=i&&e>c?c:i&&eo?"next":ir?"next":i=c.length&&(g=c.length-1),(f||u.initialSlide||0)===(h||0)&&n&&a.emit("beforeSlideChangeStart");var m,y=-c[g];if(a.updateProgress(y),u.normalizeSlideIndex)for(var b=0;b=w&&_=w&&_=w&&(s=b)}if(a.initialized&&s!==f&&(!a.allowSlideNext&&ya.translate&&y>a.maxTranslate()&&(f||0)!==s))return!1;if(m=s>f?"next":s=e&&(f=e)}),void 0!==f&&(c=a.indexOf(f))<0&&(c=i.activeIndex-1),i.slideTo(c,e,t,n)},slideReset:function(e,t,n){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,n)},slideToClosest:function(e,t,n,i){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),void 0===i&&(i=.5);var r=this,o=r.activeIndex,a=Math.min(r.params.slidesPerGroupSkip,o),s=a+Math.floor((o-a)/r.params.slidesPerGroup),u=r.rtlTranslate?r.translate:-r.translate;if(u>=r.snapGrid[s]){var c=r.snapGrid[s];u-c>(r.snapGrid[s+1]-c)*i&&(o+=r.params.slidesPerGroup)}else{var l=r.snapGrid[s-1];u-l<=(r.snapGrid[s]-l)*i&&(o-=r.params.slidesPerGroup)}return o=Math.max(o,0),o=Math.min(o,r.slidesGrid.length-1),r.slideTo(o,e,t,n)},slideToClickedSlide:function(){var e,t=this,n=t.params,i=t.$wrapperEl,r="auto"===n.slidesPerView?t.slidesPerViewDynamic():n.slidesPerView,o=t.clickedIndex;if(n.loop){if(t.animating)return;e=parseInt(QK(t.clickedSlide).attr("data-swiper-slide-index"),10),n.centeredSlides?ot.slides.length-t.loopedSlides+r/2?(t.loopFix(),o=i.children("."+n.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),$K(function(){t.slideTo(o)})):t.slideTo(o):o>t.slides.length-r?(t.loopFix(),o=i.children("."+n.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),$K(function(){t.slideTo(o)})):t.slideTo(o)}else t.slideTo(o)}},loop:{loopCreate:function(){var e=this,t=IK(),n=e.params,i=e.$wrapperEl;i.children("."+n.slideClass+"."+n.slideDuplicateClass).remove();var r=i.children("."+n.slideClass);if(n.loopFillGroupWithBlank){var o=n.slidesPerGroup-r.length%n.slidesPerGroup;if(o!==n.slidesPerGroup){for(var a=0;ar.length&&(e.loopedSlides=r.length);var u=[],c=[];r.each(function(t,n){var i=QK(t);n=r.length-e.loopedSlides&&u.push(t),i.attr("data-swiper-slide-index",n)});for(var l=0;l=0;h-=1)i.prepend(QK(u[h].cloneNode(!0)).addClass(n.slideDuplicateClass))},loopFix:function(){var e=this;e.emit("beforeLoopFix");var t,n=e.activeIndex,i=e.slides,r=e.loopedSlides,o=e.allowSlidePrev,a=e.allowSlideNext,s=e.snapGrid,u=e.rtlTranslate;e.allowSlidePrev=!0,e.allowSlideNext=!0;var c=-s[n]-e.getTranslate();n=i.length-r&&(t=-i.length+n+r,e.slideTo(t+=r,0,!1,!0)&&0!==c&&e.setTranslate((u?-e.translate:e.translate)-c)),e.allowSlidePrev=o,e.allowSlideNext=a,e.emit("loopFix")},loopDestroy:function(){var e=this,t=e.params,n=e.slides;e.$wrapperEl.children("."+t.slideClass+"."+t.slideDuplicateClass+",."+t.slideClass+"."+t.slideBlankClass).remove(),n.removeAttr("data-swiper-slide-index")}},grabCursor:{setGrabCursor:function(e){var t=this;if(!(t.support.touch||!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)){var n=t.el;n.style.cursor="move",n.style.cursor=e?"-webkit-grabbing":"-webkit-grab",n.style.cursor=e?"-moz-grabbin":"-moz-grab",n.style.cursor=e?"grabbing":"grab"}},unsetGrabCursor:function(){var e=this;e.support.touch||e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.el.style.cursor="")}},manipulation:{appendSlide:function(e){var t=this,n=t.$wrapperEl,i=t.params;if(i.loop&&t.loopDestroy(),"object"==typeof e&&"length"in e)for(var r=0;r=a)n.appendSlide(t);else{for(var s=o>e?o+1:o,u=[],c=a-1;c>=e;c-=1){var l=n.slides.eq(c);l.remove(),u.unshift(l)}if("object"==typeof t&&"length"in t){for(var h=0;he?o+t.length:o}else i.append(t);for(var f=0;f1,f=l.slidesPerColumn>1,d=o.enabled;h&&!f?(a.removeClass(o.containerModifierClass+"multirow "+o.containerModifierClass+"multirow-column"),e.emitContainerClasses()):!h&&f&&(a.addClass(o.containerModifierClass+"multirow"),(l.slidesPerColumnFill&&"column"===l.slidesPerColumnFill||!l.slidesPerColumnFill&&"column"===o.slidesPerColumnFill)&&a.addClass(o.containerModifierClass+"multirow-column"),e.emitContainerClasses());var p=l.direction&&l.direction!==o.direction,v=o.loop&&(l.slidesPerView!==o.slidesPerView||p);p&&n&&e.changeDirection(),tQ(e.params,l);var g=e.params.enabled;tQ(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),d&&!g?e.disable():!d&&g&&e.enable(),e.currentBreakpoint=u,e.emit("_beforeBreakpoint",l),v&&n&&(e.loopDestroy(),e.loopCreate(),e.updateSlides(),e.slideTo(t-r+e.loopedSlides,0,!1)),e.emit("breakpoint",l)}}},getBreakpoint:function(e,t,n){if(void 0===t&&(t="window"),e&&("container"!==t||n)){var i=!1,r=DK(),o="window"===t?r.innerHeight:n.clientHeight,a=Object.keys(e).map(function(e){if("string"==typeof e&&0===e.indexOf("@")){var t=parseFloat(e.substr(1));return{value:o*t,point:e}}return{value:e,point:e}});a.sort(function(e,t){return parseInt(e.value,10)-parseInt(t.value,10)});for(var s=0;s0&&t.slidesOffsetBefore+t.spaceBetween*(e.slides.length-1)+e.slides[0].offsetWidth*e.slides.length;e.isLocked=t.slidesOffsetBefore&&t.slidesOffsetAfter&&i?i<=e.size:1===e.snapGrid.length,e.allowSlideNext=!e.isLocked,e.allowSlidePrev=!e.isLocked,n!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock"),n&&n!==e.isLocked&&(e.isEnd=!1,e.navigation&&e.navigation.update())}},classes:{addClasses:function(){var e=this,t=e.classNames,n=e.params,i=e.$el,r=e.device,o=e.support,a=function(e,t){var n=[];return e.forEach(function(e){"object"==typeof e?Object.keys(e).forEach(function(i){e[i]&&n.push(t+i)}):"string"==typeof e&&n.push(t+e)}),n}(["initialized",n.direction,{"pointer-events":o.pointerEvents&&!o.touch},{"free-mode":n.freeMode},{autoheight:n.autoHeight},{rtl:e.rtl},{multirow:n.slidesPerColumn>1},{"multirow-column":n.slidesPerColumn>1&&"column"===n.slidesPerColumnFill},{android:r.android},{ios:r.ios},{"css-mode":n.cssMode}],n.containerModifierClass);t.push.apply(t,a),i.addClass([].concat(t).join(" ")),e.emitContainerClasses()},removeClasses:function(){var e=this;e.$el.removeClass(e.classNames.join(" ")),e.emitContainerClasses()}},images:{loadImage:function(e,t,n,i,r,o){var a,s=DK();function u(){o&&o()}QK(e).parent("picture")[0]||e.complete&&r||!t?u():((a=new s.Image).onload=u,a.onerror=u,i&&(a.sizes=i),n&&(a.srcset=n),t&&(a.src=t))},preloadImages:function(){var e=this;function t(){null==e||!e||e.destroyed||(void 0!==e.imagesLoaded&&(e.imagesLoaded+=1),e.imagesLoaded===e.imagesToLoad.length&&(e.params.updateOnImagesReady&&e.update(),e.emit("imagesReady")))}e.imagesToLoad=e.$el.find("img");for(var n=0;n1){var a=[];return QK(n.el).each(function(t){var i=tQ({},n,{el:t});a.push(new e(i))}),a}var s=this;s.__swiper__=!0,s.support=iQ(),s.device=rQ({userAgent:n.userAgent}),s.browser=oQ(),s.eventsListeners={},s.eventsAnyListeners=[],void 0===s.modules&&(s.modules={}),Object.keys(s.modules).forEach(function(e){var t=s.modules[e];if(t.params){var i=Object.keys(t.params)[0],r=t.params[i];if("object"!=typeof r||null===r||(["navigation","pagination","scrollbar"].indexOf(i)>=0&&!0===n[i]&&(n[i]={auto:!0}),!(i in n)||!("enabled"in r)))return;!0===n[i]&&(n[i]={enabled:!0}),"object"==typeof n[i]&&!("enabled"in n[i])&&(n[i].enabled=!0),n[i]||(n[i]={enabled:!1})}});var u,c,l=tQ({},yQ);return s.useParams(l),s.params=tQ({},l,_Q,n),s.originalParams=tQ({},s.params),s.passedParams=tQ({},n),s.params&&s.params.on&&Object.keys(s.params.on).forEach(function(e){s.on(e,s.params.on[e])}),s.params&&s.params.onAny&&s.onAny(s.params.onAny),s.$=QK,tQ(s,{enabled:s.params.enabled,el:t,classNames:[],slides:QK(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===s.params.direction},isVertical:function(){return"vertical"===s.params.direction},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:s.params.allowSlideNext,allowSlidePrev:s.params.allowSlidePrev,touchEvents:(u=["touchstart","touchmove","touchend","touchcancel"],c=["mousedown","mousemove","mouseup"],s.support.pointerEvents&&(c=["pointerdown","pointermove","pointerup"]),s.touchEventsTouch={start:u[0],move:u[1],end:u[2],cancel:u[3]},s.touchEventsDesktop={start:c[0],move:c[1],end:c[2]},s.support.touch||!s.params.simulateTouch?s.touchEventsTouch:s.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:s.params.focusableElements,lastClickTime:ZK(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:s.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),s.useModules(),s.emit("_swiper"),s.params.init&&s.init(),s}var t=e.prototype;return t.enable=function(){var e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))},t.disable=function(){var e=this;!e.enabled||(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))},t.setProgress=function(e,t){var n=this;e=Math.min(Math.max(e,0),1);var i=n.minTranslate(),r=n.maxTranslate();n.translateTo((r-i)*e+i,void 0===t?0:t),n.updateActiveIndex(),n.updateSlidesClasses()},t.emitContainerClasses=function(){var e=this;if(e.params._emitClasses&&e.el){var t=e.el.className.split(" ").filter(function(t){return 0===t.indexOf("swiper-container")||0===t.indexOf(e.params.containerModifierClass)});e.emit("_containerClasses",t.join(" "))}},t.getSlideClasses=function(e){var t=this;return e.className.split(" ").filter(function(e){return 0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass)}).join(" ")},t.emitSlidesClasses=function(){var e=this;if(e.params._emitClasses&&e.el){var t=[];e.slides.each(function(n){var i=e.getSlideClasses(n);t.push({slideEl:n,classNames:i}),e.emit("_slideClass",n,i)}),e.emit("_slideClasses",t)}},t.slidesPerViewDynamic=function(){var e=this,t=e.slides,n=e.slidesGrid,i=e.size,r=e.activeIndex,o=1;if(e.params.centeredSlides){for(var a,s=t[r].swiperSlideSize,u=r+1;ui&&(a=!0));for(var c=r-1;c>=0;c-=1)t[c]&&!a&&(o+=1,(s+=t[c].swiperSlideSize)>i&&(a=!0))}else for(var l=r+1;l1)&&e.isEnd&&!e.params.centeredSlides?e.slides.length-1:e.activeIndex,0,!1,!0)||i(),n.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}function i(){var t=Math.min(Math.max(e.rtlTranslate?-1*e.translate:e.translate,e.maxTranslate()),e.minTranslate());e.setTranslate(t),e.updateActiveIndex(),e.updateSlidesClasses()}},t.changeDirection=function(e,t){void 0===t&&(t=!0);var n=this,i=n.params.direction;return e||(e="horizontal"===i?"vertical":"horizontal"),e===i||"horizontal"!==e&&"vertical"!==e||(n.$el.removeClass(""+n.params.containerModifierClass+i).addClass(""+n.params.containerModifierClass+e),n.emitContainerClasses(),n.params.direction=e,n.slides.each(function(t){"vertical"===e?t.style.width="":t.style.height=""}),n.emit("changeDirection"),t&&n.update()),n},t.mount=function(e){var t=this;if(t.mounted)return!0;var n=QK(e||t.params.el);if(!(e=n[0]))return!1;e.swiper=t;var i=function(){return"."+(t.params.wrapperClass||"").trim().split(" ").join(".")},r=function(){if(e&&e.shadowRoot&&e.shadowRoot.querySelector){var t=QK(e.shadowRoot.querySelector(i()));return t.children=function(e){return n.children(e)},t}return n.children(i())}();if(0===r.length&&t.params.createElements){var o=IK().createElement("div");r=QK(o),o.className=t.params.wrapperClass,n.append(o),n.children("."+t.params.slideClass).each(function(e){r.append(e)})}return tQ(t,{$el:n,el:e,$wrapperEl:r,wrapperEl:r[0],mounted:!0,rtl:"rtl"===e.dir.toLowerCase()||"rtl"===n.css("direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===e.dir.toLowerCase()||"rtl"===n.css("direction")),wrongRTL:"-webkit-box"===r.css("display")}),!0},t.init=function(e){var t=this;return t.initialized||!1===t.mount(e)||(t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.params.loop&&t.loopCreate(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.preloadImages&&t.preloadImages(),t.slideTo(t.params.loop?t.params.initialSlide+t.loopedSlides:t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.attachEvents(),t.initialized=!0,t.emit("init"),t.emit("afterInit")),t},t.destroy=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);var n=this,i=n.params,r=n.$el,o=n.$wrapperEl,a=n.slides;return void 0===n.params||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),i.loop&&n.loopDestroy(),t&&(n.removeClasses(),r.removeAttr("style"),o.removeAttr("style"),a&&a.length&&a.removeClass([i.slideVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(function(e){n.off(e)}),!1!==e&&(n.$el[0].swiper=null,function(t){var n=t;Object.keys(n).forEach(function(t){try{n[t]=null}catch(e){}try{delete n[t]}catch(e){}})}(n)),n.destroyed=!0),null},e.extendDefaults=function(e){tQ(_Q,e)},e.installModule=function(t){e.prototype.modules||(e.prototype.modules={});var n=t.name||Object.keys(e.prototype.modules).length+"_"+ZK();e.prototype.modules[n]=t},e.use=function(t){return Array.isArray(t)?(t.forEach(function(t){return e.installModule(t)}),e):(e.installModule(t),e)},function(e,t,n){n&&function(e,t){for(var n=0;n0?t[n].__swiper__?e[n]=t[n]:QQ(e[n],t[n]):e[n]=t[n]):e[n]=t[n]})}function $Q(e){return null!=e&&"false"!="".concat(e)}var ZQ=["pagination","navigation","scrollbar","virtual"];function JQ(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return YQ(e)?e:!0===$Q(e)&&t}var e$=["init","_direction","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_freeModeMomentum","_freeModeMomentumRatio","_freeModeMomentumBounce","_freeModeMomentumBounceRatio","_freeModeMomentumVelocityRatio","_freeModeSticky","_freeModeMinimumVelocity","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","_slidesPerColumn","_slidesPerColumnFill","_slidesPerGroup","_slidesPerGroupSkip","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_watchSlidesVisibility","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_preloadImages","updateOnImagesReady","_loop","_loopAdditionalSlides","_loopedSlides","_loopFillGroupWithBlank","loopPreventsSlide","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","hashNavigation","history","keyboard","lazy","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom"].map(function(e){return e.replace(/_/,"")});function t$(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={on:{}},n={};QQ(t,kQ.defaults),QQ(t,kQ.extendedDefaults),t._emitClasses=!0;var i={};return Object.keys(e).forEach(function(r){var o=r.replace(/^_/,"");void 0!==e[o]&&(e$.indexOf(o)>=0?YQ(e[o])?(t[o]={},n[o]={},QQ(t[o],e[o]),QQ(n[o],e[o])):(t[o]=e[o],n[o]=e[o]):i[o]=e[o])}),{params:t,passedParams:n,rest:i}}var n$=function(){var e=function(){function e(t){m(this,e),this.template=t,this.class="",this.slideData={isActive:!1,isPrev:!1,isNext:!1,isVisible:!1,isDuplicate:!1}}return b(e,[{key:"zoom",get:function(){return this._zoom},set:function(e){this._zoom=$Q(e)}},{key:"classNames",get:function(){return this._classNames},set:function(e){this._classNames!==e&&(this._classNames=e,this.slideData={isActive:this._hasClass(["swiper-slide-active","swiper-slide-duplicate-active"]),isVisible:this._hasClass(["swiper-slide-visible"]),isDuplicate:this._hasClass(["swiper-slide-duplicate"]),isPrev:this._hasClass(["swiper-slide-prev","swiper-slide-duplicate-prev"]),isNext:this._hasClass(["swiper-slide-next","swiper-slide-duplicate-next"])})}},{key:"_hasClass",value:function(e){var t=this;return e.some(function(e){return t._classNames.indexOf(e)>=0})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Cc))},e.\u0275dir=It({type:e,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),e}(),i$=function(){var e=function(){function e(t,n,i,r){var a=this;m(this,e),this._ngZone=t,this.elementRef=n,this._changeDetectorRef=i,this._platformId=r,this.slideClass="swiper-slide",this.wrapperClass="swiper-wrapper",this.showNavigation=!0,this.showPagination=!0,this.showScrollbar=!0,this.s__beforeBreakpoint=new Zc,this.s__containerClasses=new Zc,this.s__slideClass=new Zc,this.s__swiper=new Zc,this.s_activeIndexChange=new Zc,this.s_afterInit=new Zc,this.s_autoplay=new Zc,this.s_autoplayStart=new Zc,this.s_autoplayStop=new Zc,this.s_beforeDestroy=new Zc,this.s_beforeInit=new Zc,this.s_beforeLoopFix=new Zc,this.s_beforeResize=new Zc,this.s_beforeSlideChangeStart=new Zc,this.s_beforeTransitionStart=new Zc,this.s_breakpoint=new Zc,this.s_changeDirection=new Zc,this.s_click=new Zc,this.s_doubleTap=new Zc,this.s_doubleClick=new Zc,this.s_destroy=new Zc,this.s_fromEdge=new Zc,this.s_hashChange=new Zc,this.s_hashSet=new Zc,this.s_imagesReady=new Zc,this.s_init=new Zc,this.s_keyPress=new Zc,this.s_lazyImageLoad=new Zc,this.s_lazyImageReady=new Zc,this.s_loopFix=new Zc,this.s_momentumBounce=new Zc,this.s_navigationHide=new Zc,this.s_navigationShow=new Zc,this.s_observerUpdate=new Zc,this.s_orientationchange=new Zc,this.s_paginationHide=new Zc,this.s_paginationRender=new Zc,this.s_paginationShow=new Zc,this.s_paginationUpdate=new Zc,this.s_progress=new Zc,this.s_reachBeginning=new Zc,this.s_reachEnd=new Zc,this.s_realIndexChange=new Zc,this.s_resize=new Zc,this.s_scroll=new Zc,this.s_scrollbarDragEnd=new Zc,this.s_scrollbarDragMove=new Zc,this.s_scrollbarDragStart=new Zc,this.s_setTransition=new Zc,this.s_setTranslate=new Zc,this.s_slideChange=new Zc,this.s_slideChangeTransitionEnd=new Zc,this.s_slideChangeTransitionStart=new Zc,this.s_slideNextTransitionEnd=new Zc,this.s_slideNextTransitionStart=new Zc,this.s_slidePrevTransitionEnd=new Zc,this.s_slidePrevTransitionStart=new Zc,this.s_slideResetTransitionStart=new Zc,this.s_slideResetTransitionEnd=new Zc,this.s_sliderMove=new Zc,this.s_sliderFirstMove=new Zc,this.s_slidesLengthChange=new Zc,this.s_slidesGridLengthChange=new Zc,this.s_snapGridLengthChange=new Zc,this.s_snapIndexChange=new Zc,this.s_tap=new Zc,this.s_toEdge=new Zc,this.s_touchEnd=new Zc,this.s_touchMove=new Zc,this.s_touchMoveOpposite=new Zc,this.s_touchStart=new Zc,this.s_transitionEnd=new Zc,this.s_transitionStart=new Zc,this.s_update=new Zc,this.s_zoomChange=new Zc,this.s_swiper=new Zc,this.indexChange=new Zc,this._activeSlides=new oe,this.containerClasses="swiper-container",this.slidesChanges=function(e){a.slides=e.map(function(e,t){return e.slideIndex=t,e.classNames=a.slideClass,e}),a.loop&&!a.loopedSlides&&a.calcLoopedSlides(),a.virtual?a.swiperRef&&a.swiperRef.virtual&&a._ngZone.runOutsideAngular(function(){a.swiperRef.virtual.slides=a.slides,a.swiperRef.virtual.update(!0)}):(a.prependSlides=jf(a.slides.slice(a.slides.length-a.loopedSlides)),a.appendSlides=jf(a.slides.slice(0,a.loopedSlides))),a._changeDetectorRef.detectChanges()},this.style=null,this.updateVirtualSlides=function(e){!a.swiperRef||a.currentVirtualData&&a.currentVirtualData.from===e.from&&a.currentVirtualData.to===e.to&&a.currentVirtualData.offset===e.offset||(a.style=a.swiperRef.isHorizontal()?o({},a.swiperRef.rtlTranslate?"right":"left","".concat(e.offset,"px")):{top:"".concat(e.offset,"px")},a.currentVirtualData=e,a._activeSlides.next(e.slides),a._ngZone.run(function(){a._changeDetectorRef.detectChanges()}),a._ngZone.runOutsideAngular(function(){a.swiperRef.updateSlides(),a.swiperRef.updateProgress(),a.swiperRef.updateSlidesClasses(),a.swiperRef.lazy&&a.swiperRef.params.lazy.enabled&&a.swiperRef.lazy.load(),a.swiperRef.virtual.update(!0)}))}}return b(e,[{key:"navigation",get:function(){return this._navigation},set:function(e){var t,n,i,r="boolean"!=typeof this._navigation?null===(t=this._navigation)||void 0===t?void 0:t.nextEl:null,o="boolean"!=typeof this._navigation?null===(n=this._navigation)||void 0===n?void 0:n.prevEl:null;this._navigation=JQ(e,{nextEl:r||null,prevEl:o||null}),this.showNavigation=!(!0!==$Q(e)||this._navigation&&"boolean"!=typeof this._navigation&&this._navigation.prevEl!==(null===(i=this._prevElRef)||void 0===i?void 0:i.nativeElement)&&(null!==this._navigation.prevEl||null!==this._navigation.nextEl)&&("string"==typeof this._navigation.nextEl||"string"==typeof this._navigation.prevEl||"object"==typeof this._navigation.nextEl||"object"==typeof this._navigation.prevEl))}},{key:"pagination",get:function(){return this._pagination},set:function(e){var t,n="boolean"!=typeof this._pagination?null===(t=this._pagination)||void 0===t?void 0:t.el:null;this._pagination=JQ(e,{el:n||null}),this.showPagination=KQ(e,this._pagination,this._paginationElRef)}},{key:"scrollbar",get:function(){return this._scrollbar},set:function(e){var t,n="boolean"!=typeof this._scrollbar?null===(t=this._scrollbar)||void 0===t?void 0:t.el:null;this._scrollbar=JQ(e,{el:n||null}),this.showScrollbar=KQ(e,this._scrollbar,this._scrollbarElRef)}},{key:"virtual",get:function(){return this._virtual},set:function(e){this._virtual=JQ(e)}},{key:"index",set:function(e){this.setIndex(e)}},{key:"config",set:function(e){this.updateSwiper(e);var t=t$(e).params;Object.assign(this,t)}},{key:"prevElRef",set:function(e){this._prevElRef=e,this._setElement(e,this.navigation,"navigation","prevEl")}},{key:"nextElRef",set:function(e){this._nextElRef=e,this._setElement(e,this.navigation,"navigation","nextEl")}},{key:"scrollbarElRef",set:function(e){this._scrollbarElRef=e,this._setElement(e,this.scrollbar,"scrollbar")}},{key:"paginationElRef",set:function(e){this._paginationElRef=e,this._setElement(e,this.pagination,"pagination")}},{key:"activeSlides",get:function(){return this.virtual?this._activeSlides:jf(this.slides)}},{key:"zoomContainerClass",get:function(){return"boolean"!=typeof this.zoom?this.zoom.containerClass:"swiper-zoom-container"}},{key:"_setElement",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"el";if(e&&t){if(t&&e.nativeElement){if(t[i]===e.nativeElement)return;t[i]=e.nativeElement}var r={};r[n]=!0,this.updateInitSwiper(r)}}},{key:"ngOnInit",value:function(){var e=t$(this).params;Object.assign(this,e)}},{key:"ngAfterViewInit",value:function(){var e=this;this.childrenSlidesInit(),this.initSwiper(),this._changeDetectorRef.detectChanges(),setTimeout(function(){e.s_swiper.emit(e.swiperRef)})}},{key:"childrenSlidesInit",value:function(){this.slidesChanges(this.slidesEl),this.slidesEl.changes.subscribe(this.slidesChanges)}},{key:"isSwiperActive",get:function(){return this.swiperRef&&!this.swiperRef.destroyed}},{key:"initSwiper",value:function(){var e=this,t=t$(this).params;Object.assign(this,t),this._ngZone.runOutsideAngular(function(){t.init=!1,t.virtual||(t.observer=!0),t.onAny=function(t){for(var n=e["s_".concat(t)],i=arguments.length,r=new Array(i>1?i-1:0),o=1;o=0)){var o=null!==(i=null===(n=e[r])||void 0===n?void 0:n.currentValue)&&void 0!==i?i:e[r];t.updateParameter(r,o)}e.allowSlideNext&&(t.swiperRef.allowSlideNext=t.allowSlideNext),e.allowSlidePrev&&(t.swiperRef.allowSlidePrev=t.allowSlidePrev),e.direction&&t.swiperRef.changeDirection(t.direction,!1),e.breakpoints&&(t.loop&&!t.loopedSlides&&t.calcLoopedSlides(),t.swiperRef.currentBreakpoint=null,t.swiperRef.setBreakpoint()),(e.thumbs||e.controller)&&t.updateInitSwiper(e),t.swiperRef.update()}})}},{key:"calcLoopedSlides",value:function(){if(this.loop){var e=this.slidesPerView;if(this.breakpoints){var t=kQ.prototype.getBreakpoint(this.breakpoints),n=t in this.breakpoints?this.breakpoints[t]:void 0;n&&n.slidesPerView&&(e=n.slidesPerView)}if("auto"===e)return this.loopedSlides=this.slides.length,this.slides.length;var i=this.loopedSlides||e;return(i+=this.loopAdditionalSlides)>this.slides.length&&(i=this.slides.length),this.loopedSlides=i,i}}},{key:"updateParameter",value:function(e,t){if(this.swiperRef&&!this.swiperRef.destroyed){var n=e.replace(/^_/,""),i=YQ(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){var r=this.swiperRef.modules[n].params[n];i?QQ(this.swiperRef.params[n],r):this.swiperRef.params[n]=r}i&&YQ(t)?QQ(this.swiperRef.params[n],t):this.swiperRef.params[n]=t}}},{key:"setIndex",value:function(e,t,n){var i=this;this.isSwiperActive?e!==this.swiperRef.activeIndex&&this._ngZone.runOutsideAngular(function(){i.loop?i.swiperRef.slideToLoop(e,t,!n):i.swiperRef.slideTo(e,t,!n)}):this.initialSlide=e}},{key:"ngOnDestroy",value:function(){var e=this;this._ngZone.runOutsideAngular(function(){var t;null===(t=e.swiperRef)||void 0===t||t.destroy(!0,!1)})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Vl),Es(Ku),Es(wc),Es(Sl))},e.\u0275cmp=Ct({type:e,selectors:[["swiper"],["","swiper",""]],contentQueries:function(e,t,n){var i;(1&e&&fl(n,n$,4),2&e)&&(ll(i=dl())&&(t.slidesEl=i))},viewQuery:function(e,t){var n;(1&e&&(hl(xQ,5),hl(SQ,5),hl(EQ,5),hl(CQ,5)),2&e)&&(ll(n=dl())&&(t.prevElRef=n.first),ll(n=dl())&&(t.nextElRef=n.first),ll(n=dl())&&(t.scrollbarElRef=n.first),ll(n=dl())&&(t.paginationElRef=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&cu(t.containerClasses)},inputs:{slideClass:"slideClass",wrapperClass:"wrapperClass",navigation:"navigation",pagination:"pagination",scrollbar:"scrollbar",virtual:"virtual",index:"index",config:"config",loopedSlides:"loopedSlides",initialSlide:"initialSlide",direction:"direction",touchEventsTarget:"touchEventsTarget",speed:"speed",cssMode:"cssMode",updateOnWindowResize:"updateOnWindowResize",resizeObserver:"resizeObserver",nested:"nested",focusableElements:"focusableElements",width:"width",height:"height",preventInteractionOnTransition:"preventInteractionOnTransition",userAgent:"userAgent",url:"url",edgeSwipeDetection:"edgeSwipeDetection",edgeSwipeThreshold:"edgeSwipeThreshold",freeMode:"freeMode",freeModeMomentum:"freeModeMomentum",freeModeMomentumRatio:"freeModeMomentumRatio",freeModeMomentumBounce:"freeModeMomentumBounce",freeModeMomentumBounceRatio:"freeModeMomentumBounceRatio",freeModeMomentumVelocityRatio:"freeModeMomentumVelocityRatio",freeModeSticky:"freeModeSticky",freeModeMinimumVelocity:"freeModeMinimumVelocity",autoHeight:"autoHeight",setWrapperSize:"setWrapperSize",virtualTranslate:"virtualTranslate",effect:"effect",breakpoints:"breakpoints",spaceBetween:"spaceBetween",slidesPerView:"slidesPerView",slidesPerColumn:"slidesPerColumn",slidesPerColumnFill:"slidesPerColumnFill",slidesPerGroup:"slidesPerGroup",slidesPerGroupSkip:"slidesPerGroupSkip",centeredSlides:"centeredSlides",centeredSlidesBounds:"centeredSlidesBounds",slidesOffsetBefore:"slidesOffsetBefore",slidesOffsetAfter:"slidesOffsetAfter",normalizeSlideIndex:"normalizeSlideIndex",centerInsufficientSlides:"centerInsufficientSlides",watchOverflow:"watchOverflow",roundLengths:"roundLengths",touchRatio:"touchRatio",touchAngle:"touchAngle",simulateTouch:"simulateTouch",shortSwipes:"shortSwipes",longSwipes:"longSwipes",longSwipesRatio:"longSwipesRatio",longSwipesMs:"longSwipesMs",followFinger:"followFinger",allowTouchMove:"allowTouchMove",threshold:"threshold",touchMoveStopPropagation:"touchMoveStopPropagation",touchStartPreventDefault:"touchStartPreventDefault",touchStartForcePreventDefault:"touchStartForcePreventDefault",touchReleaseOnEdges:"touchReleaseOnEdges",uniqueNavElements:"uniqueNavElements",resistance:"resistance",resistanceRatio:"resistanceRatio",watchSlidesProgress:"watchSlidesProgress",watchSlidesVisibility:"watchSlidesVisibility",grabCursor:"grabCursor",preventClicks:"preventClicks",preventClicksPropagation:"preventClicksPropagation",slideToClickedSlide:"slideToClickedSlide",preloadImages:"preloadImages",updateOnImagesReady:"updateOnImagesReady",loop:"loop",loopAdditionalSlides:"loopAdditionalSlides",loopFillGroupWithBlank:"loopFillGroupWithBlank",loopPreventsSlide:"loopPreventsSlide",allowSlidePrev:"allowSlidePrev",allowSlideNext:"allowSlideNext",swipeHandler:"swipeHandler",noSwiping:"noSwiping",noSwipingClass:"noSwipingClass",noSwipingSelector:"noSwipingSelector",passiveListeners:"passiveListeners",containerModifierClass:"containerModifierClass",slideBlankClass:"slideBlankClass",slideActiveClass:"slideActiveClass",slideDuplicateActiveClass:"slideDuplicateActiveClass",slideVisibleClass:"slideVisibleClass",slideDuplicateClass:"slideDuplicateClass",slideNextClass:"slideNextClass",slideDuplicateNextClass:"slideDuplicateNextClass",slidePrevClass:"slidePrevClass",slideDuplicatePrevClass:"slideDuplicatePrevClass",runCallbacksOnInit:"runCallbacksOnInit",observeParents:"observeParents",observeSlideChildren:"observeSlideChildren",a11y:"a11y",autoplay:"autoplay",controller:"controller",coverflowEffect:"coverflowEffect",cubeEffect:"cubeEffect",fadeEffect:"fadeEffect",flipEffect:"flipEffect",hashNavigation:"hashNavigation",history:"history",keyboard:"keyboard",lazy:"lazy",mousewheel:"mousewheel",parallax:"parallax",thumbs:"thumbs",zoom:"zoom",class:"class",id:"id"},outputs:{s__beforeBreakpoint:"_beforeBreakpoint",s__containerClasses:"_containerClasses",s__slideClass:"_slideClass",s__swiper:"_swiper",s_activeIndexChange:"activeIndexChange",s_afterInit:"afterInit",s_autoplay:"autoplay",s_autoplayStart:"autoplayStart",s_autoplayStop:"autoplayStop",s_beforeDestroy:"beforeDestroy",s_beforeInit:"beforeInit",s_beforeLoopFix:"beforeLoopFix",s_beforeResize:"beforeResize",s_beforeSlideChangeStart:"beforeSlideChangeStart",s_beforeTransitionStart:"beforeTransitionStart",s_breakpoint:"breakpoint",s_changeDirection:"changeDirection",s_click:"click",s_doubleTap:"doubleTap",s_doubleClick:"doubleClick",s_destroy:"destroy",s_fromEdge:"fromEdge",s_hashChange:"hashChange",s_hashSet:"hashSet",s_imagesReady:"imagesReady",s_init:"init",s_keyPress:"keyPress",s_lazyImageLoad:"lazyImageLoad",s_lazyImageReady:"lazyImageReady",s_loopFix:"loopFix",s_momentumBounce:"momentumBounce",s_navigationHide:"navigationHide",s_navigationShow:"navigationShow",s_observerUpdate:"observerUpdate",s_orientationchange:"orientationchange",s_paginationHide:"paginationHide",s_paginationRender:"paginationRender",s_paginationShow:"paginationShow",s_paginationUpdate:"paginationUpdate",s_progress:"progress",s_reachBeginning:"reachBeginning",s_reachEnd:"reachEnd",s_realIndexChange:"realIndexChange",s_resize:"resize",s_scroll:"scroll",s_scrollbarDragEnd:"scrollbarDragEnd",s_scrollbarDragMove:"scrollbarDragMove",s_scrollbarDragStart:"scrollbarDragStart",s_setTransition:"setTransition",s_setTranslate:"setTranslate",s_slideChange:"slideChange",s_slideChangeTransitionEnd:"slideChangeTransitionEnd",s_slideChangeTransitionStart:"slideChangeTransitionStart",s_slideNextTransitionEnd:"slideNextTransitionEnd",s_slideNextTransitionStart:"slideNextTransitionStart",s_slidePrevTransitionEnd:"slidePrevTransitionEnd",s_slidePrevTransitionStart:"slidePrevTransitionStart",s_slideResetTransitionStart:"slideResetTransitionStart",s_slideResetTransitionEnd:"slideResetTransitionEnd",s_sliderMove:"sliderMove",s_sliderFirstMove:"sliderFirstMove",s_slidesLengthChange:"slidesLengthChange",s_slidesGridLengthChange:"slidesGridLengthChange",s_snapGridLengthChange:"snapGridLengthChange",s_snapIndexChange:"snapIndexChange",s_tap:"tap",s_toEdge:"toEdge",s_touchEnd:"touchEnd",s_touchMove:"touchMove",s_touchMoveOpposite:"touchMoveOpposite",s_touchStart:"touchStart",s_transitionEnd:"transitionEnd",s_transitionStart:"transitionStart",s_update:"update",s_zoomChange:"zoomChange",s_swiper:"swiper",indexChange:"indexChange"},features:[Gt],ngContentSelectors:XQ,decls:13,vars:17,consts:[[4,"ngIf"],["class","swiper-scrollbar",4,"ngIf"],["class","swiper-pagination",4,"ngIf"],[3,"ngClass"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["slidesTemplate",""],[1,"swiper-button-prev"],["prevElRef",""],[1,"swiper-button-next"],["nextElRef",""],[1,"swiper-scrollbar"],["scrollbarElRef",""],[1,"swiper-pagination"],["paginationElRef",""],[3,"ngClass","style","ngSwitch",4,"ngFor","ngForOf"],[3,"ngClass","ngSwitch"],[3,"ngClass",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){if(1&e&&(Ws(HQ),qs(0),xs(1,OQ,5,0,"ng-container",0),xs(2,TQ,2,0,"div",1),xs(3,AQ,2,0,"div",2),Ts(4,"div",3),qs(5,1),xs(6,MQ,1,0,void 0,4),xs(7,RQ,1,0,void 0,4),xs(8,NQ,1,0,void 0,4),qs(9,2),As(),qs(10,3),xs(11,UQ,2,3,"ng-template",null,5,ml)),2&e){var n=Ss(12);qo(1),Cs("ngIf",t.navigation&&t.showNavigation),qo(1),Cs("ngIf",t.scrollbar&&t.showScrollbar),qo(1),Cs("ngIf",t.pagination&&t.showPagination),qo(1),Cs("ngClass",t.wrapperClass),_s("id",t.id),qo(2),Cs("ngTemplateOutlet",n)("ngTemplateOutletContext",qc(11,GQ,t.prependSlides)),qo(1),Cs("ngTemplateOutlet",n)("ngTemplateOutletContext",qc(13,WQ,t.activeSlides)),qo(1),Cs("ngTemplateOutlet",n)("ngTemplateOutletContext",qc(15,qQ,t.appendSlides))}},directives:[Lh,Ih,Gh,Dh,Vh,zh,Uh],pipes:[Yh],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),e}(),r$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh]]}),e}();function o$(){return(o$=Object.assign||function(e){for(var t=1;t0&&(n(o,!!e.isBeginning),e.params.watchOverflow&&e.enabled&&o[e.isLocked?"addClass":"removeClass"](t.lockClass)),r&&r.length>0&&(n(r,!!e.isEnd),e.params.watchOverflow&&e.enabled&&r[e.isLocked?"addClass":"removeClass"](t.lockClass))}},onPrevClick:function(e){var t=this;e.preventDefault(),(!t.isBeginning||t.params.loop)&&t.slidePrev()},onNextClick:function(e){var t=this;e.preventDefault(),(!t.isEnd||t.params.loop)&&t.slideNext()},init:function(){var e,t,n=this,i=n.params.navigation;n.params.navigation=function(e,t,n,i){var r=IK();return n&&Object.keys(i).forEach(function(n){if(!t[n]&&!0===t.auto){var o=r.createElement("div");o.className=i[n],e.append(o),t[n]=o}}),t}(n.$el,n.params.navigation,n.params.createElements,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),(i.nextEl||i.prevEl)&&(i.nextEl&&(e=QK(i.nextEl),n.params.uniqueNavElements&&"string"==typeof i.nextEl&&e.length>1&&1===n.$el.find(i.nextEl).length&&(e=n.$el.find(i.nextEl))),i.prevEl&&(t=QK(i.prevEl),n.params.uniqueNavElements&&"string"==typeof i.prevEl&&t.length>1&&1===n.$el.find(i.prevEl).length&&(t=n.$el.find(i.prevEl))),e&&e.length>0&&e.on("click",n.navigation.onNextClick),t&&t.length>0&&t.on("click",n.navigation.onPrevClick),tQ(n.navigation,{$nextEl:e,nextEl:e&&e[0],$prevEl:t,prevEl:t&&t[0]}),n.enabled||(e&&e.addClass(i.lockClass),t&&t.addClass(i.lockClass)))},destroy:function(){var e=this,t=e.navigation,n=t.$nextEl,i=t.$prevEl;n&&n.length&&(n.off("click",e.navigation.onNextClick),n.removeClass(e.params.navigation.disabledClass)),i&&i.length&&(i.off("click",e.navigation.onPrevClick),i.removeClass(e.params.navigation.disabledClass))}},s$={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){nQ(this,{navigation:o$({},a$)})},on:{init:function(e){e.navigation.init(),e.navigation.update()},toEdge:function(e){e.navigation.update()},fromEdge:function(e){e.navigation.update()},destroy:function(e){e.navigation.destroy()},"enable disable":function(e){var t=e.navigation,n=t.$nextEl,i=t.$prevEl;n&&n[e.enabled?"removeClass":"addClass"](e.params.navigation.lockClass),i&&i[e.enabled?"removeClass":"addClass"](e.params.navigation.lockClass)},click:function(e,t){var n=e.navigation,i=n.$nextEl,r=n.$prevEl,o=t.target;if(e.params.navigation.hideOnClick&&!QK(o).is(r)&&!QK(o).is(i)){if(e.pagination&&e.params.pagination&&e.params.pagination.clickable&&(e.pagination.el===o||e.pagination.el.contains(o)))return;var a;i?a=i.hasClass(e.params.navigation.hiddenClass):r&&(a=r.hasClass(e.params.navigation.hiddenClass)),e.emit(!0===a?"navigationShow":"navigationHide"),i&&i.toggleClass(e.params.navigation.hiddenClass),r&&r.toggleClass(e.params.navigation.hiddenClass)}}}},u$=function(){var e=function e(){m(this,e),kQ.use([s$])};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_,S_,r$]]}),e}(),c$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh]]}),e}(),l$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,VX,S_,u$,c$]]}),e}(),h$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,Yd,l$]]}),e}(),f$={isolated:!0},d$=new Mi("Message service configuration",{providedIn:"root",factory:function(){return f$}}),p$=function(){var e=function(){function e(t,n,i){m(this,e),this.source=t,this.channel=n,this.messages=i}return b(e,[{key:"sendMessage",value:function(e){this.channel.next({id:this.nextMessageId(),source:this.source,payload:e})}},{key:"getMessages",value:function(){var e=this;return this.messages.pipe(od(function(t){return t.source!==e.source}))}},{key:"getMessagesFromSource",value:function(e){return this.getMessages().pipe(od(function(t){return t.source===e}))}},{key:"getMessagesFromSources",value:function(e){return this.getMessages().pipe(od(function(t){return e.includes(t.source)}))}},{key:"nextMessageId",value:function(){return e.counter++}}]),e}();return e.counter=0,e}(),v$=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.config=t,this.parent=n,this.channel=new oe,this.messages=t.isolated||!n?this.channel.asObservable():me([this.channel,n.messages.pipe(cp(function(){return!i.channel.closed}))]).pipe(Se())}return b(e,[{key:"ngOnDestroy",value:function(){this.channel.complete()}},{key:"connect",value:function(e){return new p$(e,this.channel,this.messages)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(d$),Qi(e,12))},e.\u0275prov=Ke({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),g$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[{provide:d$,useValue:f$}],imports:[[Mf,By,S_]]}),e}();function m$(e,t){if(1&e&&(Wn(),Ps(0,"circle",3)),2&e){var n=Hs();au("animation-name","mat-progress-spinner-stroke-rotate-"+n._spinnerAnimationLabel)("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),_s("r",n._getCircleRadius())}}function y$(e,t){if(1&e&&(Wn(),Ps(0,"circle",3)),2&e){var n=Hs();au("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),_s("r",n._getCircleRadius())}}function b$(e,t){if(1&e&&(Wn(),Ps(0,"circle",3)),2&e){var n=Hs();au("animation-name","mat-progress-spinner-stroke-rotate-"+n._spinnerAnimationLabel)("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),_s("r",n._getCircleRadius())}}function _$(e,t){if(1&e&&(Wn(),Ps(0,"circle",3)),2&e){var n=Hs();au("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),_s("r",n._getCircleRadius())}}var w$=".mat-progress-spinner{display:block;position:relative;overflow:hidden}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}._mat-animation-noopable.mat-progress-spinner circle{transition:none;animation:none}.cdk-high-contrast-active .mat-progress-spinner circle{stroke:currentColor;stroke:CanvasText}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{animation:mat-progress-spinner-linear-rotate 2000ms linear infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4000ms;animation-timing-function:cubic-bezier(0.35, 0, 0.25, 1);animation-iteration-count:infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{animation:mat-progress-spinner-stroke-rotate-fallback 10000ms cubic-bezier(0.87, 0.03, 0.33, 1) infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition:none;animation:none}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.606171575px;transform:rotate(0)}12.5%{stroke-dashoffset:56.5486677px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.606171575px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.5486677px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.606171575px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.5486677px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.606171575px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.5486677px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0deg)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}\n",k$=Xy(function(){return function e(t){m(this,e),this._elementRef=t}}(),"primary"),x$=new Mi("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}}),S$=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a){var s;m(this,n),(s=t.call(this,e))._document=r,s._diameter=100,s._value=0,s._fallbackAnimation=!1,s.mode="determinate";var u=n._diameters;return s._spinnerAnimationLabel=s._getSpinnerAnimationLabel(),u.has(r.head)||u.set(r.head,new Set([100])),s._fallbackAnimation=i.EDGE||i.TRIDENT,s._noopAnimations="NoopAnimations"===o&&!!a&&!a._forceAnimations,a&&(a.diameter&&(s.diameter=a.diameter),a.strokeWidth&&(s.strokeWidth=a.strokeWidth)),s}return b(n,[{key:"diameter",get:function(){return this._diameter},set:function(e){this._diameter=Rf(e),this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()}},{key:"strokeWidth",get:function(){return this._strokeWidth||this.diameter/10},set:function(e){this._strokeWidth=Rf(e)}},{key:"value",get:function(){return"determinate"===this.mode?this._value:0},set:function(e){this._value=Math.max(0,Math.min(100,Rf(e)))}},{key:"ngOnInit",value:function(){var e=this._elementRef.nativeElement;this._styleRoot=jd(e)||this._document.head,this._attachStyleNode(),e.classList.add("mat-progress-spinner-indeterminate".concat(this._fallbackAnimation?"-fallback":"","-animation"))}},{key:"_getCircleRadius",value:function(){return(this.diameter-10)/2}},{key:"_getViewBox",value:function(){var e=2*this._getCircleRadius()+this.strokeWidth;return"0 0 ".concat(e," ").concat(e)}},{key:"_getStrokeCircumference",value:function(){return 2*Math.PI*this._getCircleRadius()}},{key:"_getStrokeDashOffset",value:function(){return"determinate"===this.mode?this._getStrokeCircumference()*(100-this._value)/100:this._fallbackAnimation&&"indeterminate"===this.mode?.2*this._getStrokeCircumference():null}},{key:"_getCircleStrokeWidth",value:function(){return this.strokeWidth/this.diameter*100}},{key:"_attachStyleNode",value:function(){var e=this._styleRoot,t=this._diameter,i=n._diameters,r=i.get(e);if(!r||!r.has(t)){var o=this._document.createElement("style");o.setAttribute("mat-spinner-animation",this._spinnerAnimationLabel),o.textContent=this._getAnimationText(),e.appendChild(o),r||(r=new Set,i.set(e,r)),r.add(t)}}},{key:"_getAnimationText",value:function(){var e=this._getStrokeCircumference();return"\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n".replace(/START_VALUE/g,""+.95*e).replace(/END_VALUE/g,""+.2*e).replace(/DIAMETER/g,"".concat(this._spinnerAnimationLabel))}},{key:"_getSpinnerAnimationLabel",value:function(){return this.diameter.toString().replace(".","_")}}]),n}(k$);S$.\u0275fac=function(e){return new(e||S$)(Es(Ku),Es(Id),Es(fh,8),Es(Ny,8),Es(x$))},S$.\u0275cmp=Ct({type:S$,selectors:[["mat-progress-spinner"]],hostAttrs:["role","progressbar","tabindex","-1",1,"mat-progress-spinner"],hostVars:10,hostBindings:function(e,t){2&e&&(_s("aria-valuemin","determinate"===t.mode?0:null)("aria-valuemax","determinate"===t.mode?100:null)("aria-valuenow","determinate"===t.mode?t.value:null)("mode",t.mode),au("width",t.diameter,"px")("height",t.diameter,"px"),su("_mat-animation-noopable",t._noopAnimations))},inputs:{color:"color",mode:"mode",diameter:"diameter",strokeWidth:"strokeWidth",value:"value"},exportAs:["matProgressSpinner"],features:[ss],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(e,t){1&e&&(Wn(),Ts(0,"svg",0),xs(1,m$,1,9,"circle",1),xs(2,y$,1,7,"circle",2),As()),2&e&&(au("width",t.diameter,"px")("height",t.diameter,"px"),Cs("ngSwitch","indeterminate"===t.mode),_s("viewBox",t._getViewBox()),qo(1),Cs("ngSwitchCase",!0),qo(1),Cs("ngSwitchCase",!1))},directives:[Vh,zh],styles:[w$],encapsulation:2,changeDetection:0}),S$._diameters=new WeakMap;var E$=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a){var s;return m(this,n),(s=t.call(this,e,i,r,o,a)).mode="indeterminate",s}return n}(S$);return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(Id),Es(fh,8),Es(Ny,8),Es(x$))},e.\u0275cmp=Ct({type:e,selectors:[["mat-spinner"]],hostAttrs:["role","progressbar","mode","indeterminate",1,"mat-spinner","mat-progress-spinner"],hostVars:6,hostBindings:function(e,t){2&e&&(au("width",t.diameter,"px")("height",t.diameter,"px"),su("_mat-animation-noopable",t._noopAnimations))},inputs:{color:"color"},features:[ss],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(e,t){1&e&&(Wn(),Ts(0,"svg",0),xs(1,b$,1,9,"circle",1),xs(2,_$,1,7,"circle",2),As()),2&e&&(au("width",t.diameter,"px")("height",t.diameter,"px"),Cs("ngSwitch","indeterminate"===t.mode),_s("viewBox",t._getViewBox()),qo(1),Cs("ngSwitchCase",!0),qo(1),Cs("ngSwitchCase",!1))},directives:[Vh,zh],styles:[w$],encapsulation:2,changeDetection:0}),e}(),C$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Wy,Kh],Wy]}),e}(),O$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,C$]]}),e}(),T$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({imports:[[Kh,I_,S_,C$]]}),e}(),A$={initialConfig:{},parse:{},rename:{}},P$=function(){function e(t,n){m(this,e),this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},A$),n)}return b(e,[{key:"addChanges",value:function(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}},{key:"applyChanges",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===e&&(e=this.storedChanges,this.storedChanges={});for(var i=this.configState,r=this.options.initialConfig,o=i.snapshot,a=Object.assign(Object.assign(Object.assign({},r),o),n),s=0,u=Object.entries(e);s true",tg("1s"))])]},changeDetection:0}),e}(),j$=["*"],F$={params:{width:0,margin:0,margin2:0}},B$=function(){function e(){var t=this;m(this,e),this.initialized=!1,this.deferred=new Promise(function(e){t.resolve=e})}return b(e,[{key:"set",value:function(){this.initialized=!0,this.resolve()}},{key:"wait",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.deferred);case 1:case"end":return e.stop()}},e,this)}))}},{key:"valueOf",value:function(){return this.initialized}}]),e}(),V$=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this.element=i,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Zc(!0),this.expandedChange=new Zc(!0),this.stateChange=new Zc(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new B$,this.subscriptions=new W,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(function(e){r.handleMessage(e)&&n.markForCheck()}))}return b(e,[{key:"classEnd",get:function(){return"end"===this.position}},{key:"position",get:function(){return this._position},set:function(e){this._position=e||"start"}},{key:"opened",get:function(){return this._opened},set:function(e){this.toggle(If(e))}},{key:"expanded",get:function(){return this._expanded},set:function(e){this.toggleExpanded(If(e))}},{key:"expandedStateObj",get:function(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}},{key:"measuredWidth",get:function(){if(this._measuredWidth>0)return this._measuredWidth;var e=this.element.nativeElement;if(!e)return 0;var t=e.getBoundingClientRect(),n=t.right-t.left;return 0===n?0:(this._measuredWidth=n,n)}},{key:"measuredMargin",get:function(){if(this._measuredMargin>0)return this._measuredMargin;var e=this.element.nativeElement;if(!e)return 0;var t=globalThis.getComputedStyle(e).getPropertyValue("start"===this.position?"margin-right":"margin-left"),n=Number(t.slice(0,-2));return this._measuredMargin=n,n}},{key:"ngAfterViewInit",value:function(){var e=this;this.initialized.set(),setTimeout(function(){return e.channel.sendMessage({type:"drawer-initialized"})})}},{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"open",value:function(){this.toggle(!0)}},{key:"close",value:function(){this.toggle(!1)}},{key:"toggle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!this.opened;this.opened!==e&&(e?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=e,this.sendToggle())}},{key:"openExpanded",value:function(){this.toggleExpanded(!0)}},{key:"closeExpanded",value:function(){this.toggleExpanded(!1)}},{key:"toggleExpanded",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!this.expanded;this.expanded!==e&&(e?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=e,this.sendToggle())}},{key:"closeOpenDone",value:function(){this.openedChange.emit(this.opened)}},{key:"expandCollapseDone",value:function(){this.expandedChange.emit(this.expanded)}},{key:"sendToggle",value:function(){return yw(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initialized.wait();case 2:this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit();case 4:case"end":return e.stop()}},e,this)}))}},{key:"handleMessage",value:function(e){switch(e.payload.type){case"drawer-toggled":return this.syncExpanded(e.source),!0;default:return!1}}},{key:"syncExpanded",value:function(e){(this.expanded||e.expanded)&&(this.expanded&&e.expanded?this.expandedState2=e.expandedState2="half":this.expanded?e.opened?(this.expandedState2="extended",this.width=e.measuredWidth+e.measuredMargin):(this.expandedState2="full",this.margin2=e.measuredMargin):this.opened?(e.expandedState2="extended",e.width=this.measuredWidth+this.measuredMargin):(e.expandedState2="full",e.margin2=this.measuredMargin))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(D$),Es(wc),Es(Ku))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(e,t){1&e&&Bs("@openClose.done",function(){return t.closeOpenDone()})("@expandCollapse.done",function(){return t.expandCollapseDone()}),2&e&&(Tu("@openClose",t.openedState)("@expandCollapse",t.expandedStateObj),cu(t.className),su("ccf-drawer-end",t.classEnd)("ccf-drawer-opened",t.opened)("ccf-drawer-expanded",t.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:j$,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(e,t){1&e&&(Ws(),Ts(0,"div",0),qs(1),As())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%);background-color:#fff}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[eg("openClose",[rg("open, open-instant",ig({transform:"none"})),rg("closed",ig({})),og("closed => open-instant",tg(0)),og("closed <=> open, open-instant => closed",tg(".5s ease-in-out"))]),eg("expandCollapse",[rg("collapsed",ig({})),rg("half",ig({width:"calc(50% - {{ margin }}px)"}),F$),rg("extended",ig({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),F$),rg("full",ig({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),F$),og("* <=> *",tg(".5s ease-in-out"))])]},changeDetection:0}),e}();function z$(e,t){1&e&&(Ts(0,"ccf-drawer-content"),qs(1,2),As())}var U$=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],H$=["ccf-drawer","ccf-drawer-content","*"];function G$(e){throw new Error("Multiple drawers in position ".concat(e))}var W$=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.cdr=n,this.className="ccf-drawer-container",this.subscriptions=new W,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(function(e){i.handleMessage(e)&&n.markForCheck()}))}return b(e,[{key:"content",get:function(){var e;return null!==(e=this.content1.first)&&void 0!==e?e:this.content2.first}},{key:"hasWrappedContent",get:function(){return 0!==this.content1.length}},{key:"ngAfterViewInit",value:function(){var e=this;this.drawers.changes.pipe(fd(null)).subscribe(function(){var t=e.validateDrawers();e.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),e.cdr.markForCheck()}),this.content1.changes.pipe(fd(null)).subscribe(function(){e.channel.sendMessage({type:"content-container-changed",content:e.content}),e.cdr.markForCheck()})}},{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"handleMessage",value:function(e){return!0}},{key:"validateDrawers",value:function(){var e=this.drawers.toArray(),t=e.filter(function(e){return"start"===e.position}),n=e.filter(function(e){return"end"===e.position});return t.length>1&&G$("start"),n.length>1&&G$("end"),[t[0],n[0]]}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(D$),Es(wc))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-drawer-container"]],contentQueries:function(e,t,n){var i;(1&e&&(fl(n,V$,5),fl(n,L$,5)),2&e)&&(ll(i=dl())&&(t.drawers=i),ll(i=dl())&&(t.content1=i))},viewQuery:function(e,t){var n;(1&e&&hl(L$,5),2&e)&&(ll(n=dl())&&(t.content2=n))},hostVars:2,hostBindings:function(e,t){2&e&&cu(t.className)},exportAs:["ccfDrawerContainer"],features:[Hu([D$])],ngContentSelectors:H$,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(e,t){1&e&&(Ws(U$),qs(0),qs(1,1),xs(2,z$,2,0,"ccf-drawer-content",0)),2&e&&(qo(2),Cs("ngIf",!t.hasWrappedContent))},directives:[Lh,L$],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),e}();function q$(e,t){if(1&e&&(Ts(0,"mat-option",6),Ts(1,"div"),ku(2),As(),As()),2&e){var n=t.$implicit,i=Hs();Cs("value",n),qo(1),cu(i.optionsVisible),qo(1),Su(" ",n," ")}}var X$=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.selectionChange=new Zc,this.optionsVisible="invisible"}return b(e,[{key:"toggleOptions",value:function(){this.optionsVisible="visible"===this.optionsVisible?"invisible":"visible"}},{key:"selectionChanged",value:function(e){this.selection=e,this.ga.event("selection_change","dropdown","".concat(this.label,":").concat(e)),this.selectionChange.emit(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-dropdown"]],inputs:{label:"label",options:"options",selection:"selection"},outputs:{selectionChange:"selectionChange"},decls:7,vars:3,consts:[[1,"ccf-dropdown","wrapper"],[1,"container"],[1,"dropdown-form-field"],[1,"label"],["disableOptionCentering","true","panelClass","option-panel","disableRipple","true",1,"selected-value",3,"value","selectionChange","openedChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Ts(2,"mat-form-field",2),Ts(3,"div",3),ku(4),As(),Ts(5,"mat-select",4),Fs("selectionChange",function(e){return t.selectionChanged(e.value)})("openedChange",function(){return t.toggleOptions()}),xs(6,q$,3,5,"mat-option",5),As(),As(),As(),As()),2&e&&(qo(4),Su(" ",t.label," "),qo(1),Cs("value",t.selection),qo(1),Cs("ngForOf",t.options))},directives:[zz,aY,Dh,mb],styles:["@-webkit-keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.dropdown-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:1em;padding-right:1em;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{font-size:.875rem;border:none}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix mat-select{font-size:1rem;font-weight:bold}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .option-panel{-webkit-animation:slideInHorizontalDropdown .3s;animation:slideInHorizontalDropdown .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;position:absolute!important;top:1.55rem;max-width:9.5rem} .option-panel .mat-option{border-bottom-width:1px;border-bottom-style:solid;padding-left:1em} .option-panel :last-child{border-bottom:none} .cdk-overlay-pane{min-width:0rem!important}.dropdown-form-field[_ngcontent-%COMP%]{height:3rem;width:100%}.dropdown-form-field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{padding-bottom:.063rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem} .ccf-dropdown .mat-select-arrow-wrapper{transform:translatey(-.5em)}"],changeDetection:0}),e}(),Y$=["popover"];function K$(e,t){if(1&e){var n=Ds();Ts(0,"div",7,8),Ts(2,"div"),Ts(3,"div",9),ku(4),As(),Ts(5,"input",10),Fs("keyup",function(e){return mn(n),Hs().onKeyLow(e)}),As(),As(),Ts(6,"ng5-slider",11),Fs("valueChange",function(e){return mn(n),Hs().lowValue=e})("highValueChange",function(e){return mn(n),Hs().highValue=e})("userChangeEnd",function(){return mn(n),Hs().sliderValueChanged()}),As(),Ts(7,"div"),Ts(8,"div",12),ku(9),As(),Ts(10,"input",13),Fs("keyup",function(e){return mn(n),Hs().onKeyHigh(e)}),As(),As(),As()}if(2&e){var i=Hs();qo(2),Cu("label min fade-in ",i.contentsVisible,""),qo(2),Su(" ",i.options.floor,"> "),qo(1),Xs("value",i.lowValue),qo(1),Cu("slider fade-in ",i.contentsVisible,""),Cs("options",i.options)("value",i.lowValue)("highValue",i.highValue),qo(1),Cu("label max fade-in ",i.contentsVisible,""),qo(2),Su(" ",i.options.ceil," "),qo(1),Xs("value",i.highValue)}}var Q$=function(){var e=function(){function e(t,n,i){m(this,e),this.element=n,this.ga=i,this.selectionChange=new Zc,this.isSliderOpen=!1,this.contentsVisible="invisible",this.isSliderInitialized=!1;var r=t.position().flexibleConnectedTo(n).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"}]);this.overlayRef=t.create({panelClass:"slider-pane",positionStrategy:r})}return b(e,[{key:"rangeLabel",get:function(){var e=this.lowValue,t=this.highValue;return e===t?"".concat(e):"".concat(e,"-").concat(t)}},{key:"ngOnChanges",value:function(e){e.valueRange&&this.optionsChanged(),e.selection&&(this.lowValue=Math.min.apply(Math,v(this.selection)),this.highValue=Math.max.apply(Math,v(this.selection)))}},{key:"optionsChanged",value:function(){var e,t;this.options={floor:this.valueRange?this.valueRange[0]:0,ceil:this.valueRange?this.valueRange[1]:0,step:1,hideLimitLabels:!0,hidePointerLabels:!0},this.lowValue=null!==(e=this.options.floor)&&void 0!==e?e:0,this.highValue=null!==(t=this.options.ceil)&&void 0!==t?t:0}},{key:"ngOnDestroy",value:function(){this.overlayRef.dispose()}},{key:"closeSliderPopover",value:function(e){var t,n,i=this.element,r=this.isSliderOpen,o=this.popoverElement;r&&(i.nativeElement.contains(e)||(null===(n=null===(t=null==o?void 0:o.nativeElement)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,e))||(this.overlayRef.detach(),this.isSliderInitialized=!1,this.isSliderOpen=!1,this.contentsVisible="invisible"))}},{key:"toggleSliderPopover",value:function(){var e=this.isSliderOpen,t=this.isSliderInitialized;t?(this.overlayRef.detach(),this.isSliderInitialized=!1):!t&&!e&&this.initializeSliderPopover(),this.contentsVisible="visible"===this.contentsVisible?"invisible":"visible",this.isSliderOpen=!e}},{key:"sliderValueChanged",value:function(){var e=this.lowValue,t=this.highValue;this.selection=[e,t],this.ga.event("slider_range_change","dual_slider","".concat(this.label,":").concat(e,":").concat(t)),this.selectionChange.emit(this.selection)}},{key:"initializeSliderPopover",value:function(){var e=this.overlayRef,t=this.popoverPortal;e.attach(t),e.updatePosition(),this.isSliderInitialized=!0}},{key:"onKeyLow",value:function(e){var t=Number(e.target.value);"Enter"===e.key&&(t>=Number(this.options.floor)&&t<=Number(this.options.ceil)&&(this.lowValue=t),e.target.value=String(this.lowValue),e.target.blur(),this.sliderValueChanged())}},{key:"onKeyHigh",value:function(e){var t=Number(e.target.value);"Enter"===e.key&&(t>=Number(this.options.floor)&&t<=Number(this.options.ceil)&&(this.highValue=t),e.target.value=String(this.highValue),e.target.blur(),this.sliderValueChanged())}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Hp),Es(Ku),Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-dual-slider"]],viewQuery:function(e,t){var n;(1&e&&(hl(tp,7),hl(Y$,5,Ku)),2&e)&&(ll(n=dl())&&(t.popoverPortal=n.first),ll(n=dl())&&(t.popoverElement=n.first))},hostBindings:function(e,t){1&e&&Fs("click",function(e){return t.closeSliderPopover(e.target)},!1,no)("touchstart",function(e){return t.closeSliderPopover(e.target)},!1,no)},inputs:{label:"label",valueRange:"valueRange",selection:"selection"},outputs:{selectionChange:"selectionChange"},features:[Gt],decls:10,vars:4,consts:[[1,"ccf-slider","wrapper"],[1,"container"],["class","ccf-slider detached",4,"cdk-portal"],[1,"slider-form-field",3,"click"],[1,"slider-labels"],[1,"name-label"],[1,"range-label"],[1,"ccf-slider","detached"],["popover",""],[1,"label","floor"],["type","text",1,"input-low",3,"value","keyup"],[3,"options","value","highValue","valueChange","highValueChange","userChangeEnd"],[1,"label","ceil"],["type","text",1,"input-high",3,"value","keyup"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),xs(2,K$,11,16,"div",2),Ts(3,"mat-form-field",3),Fs("click",function(){return t.toggleSliderPopover()}),Ts(4,"div",4),Ts(5,"span",5),ku(6),As(),Ts(7,"span",6),ku(8),As(),As(),Ps(9,"mat-select"),As(),As(),As()),2&e&&(qo(3),su("highlight",t.isSliderOpen),qo(3),xu(t.label),qo(2),xu(t.rangeLabel))},directives:[np,zz,aY,$Y],styles:[".slider-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;font-size:.875rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.slider-labels[_ngcontent-%COMP%]{display:flex;flex-direction:column}.slider-labels[_ngcontent-%COMP%] .name-label[_ngcontent-%COMP%]{padding-bottom:.25rem}.slider-labels[_ngcontent-%COMP%] .range-label[_ngcontent-%COMP%]{font-weight:bold} .ccf-slider.wrapper .mat-select-arrow-wrapper{transform:translatey(-1.5em)}@-webkit-keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .slider-pane{position:absolute!important;top:-1px}.ccf-slider.detached[_ngcontent-%COMP%]{-webkit-animation:slideInHorizontalSlider .3s;animation:slideInHorizontalSlider .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;display:flex;justify-content:center;align-items:center;width:0rem;height:4.375rem;padding:.75rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] {visibility:hidden;margin-top:.9375rem;margin-bottom:.9375rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-bar{opacity:.2;height:.15rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-selection{opacity:1}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer{width:1rem;height:1rem;top:-.405rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer:after{display:none}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:2rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.min[_ngcontent-%COMP%]{margin-right:1rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%]{margin-left:1rem;align-items:flex-end}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-align:right}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .floor[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%]{font-size:.875rem}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border:none;width:1.75rem;font-size:1rem;font-weight:bold;padding:0}"]}),e}();function $$(e,t){if(1&e){var n=Ds();Ts(0,"div",4),Ts(1,"mat-checkbox",5),Fs("change",function(e){var t=mn(n).$implicit;return Hs().filterOnChange(e,t)}),ku(2),As(),As()}if(2&e){var i=t.$implicit,r=Hs();qo(1),Cs("checked",null==r.selection?null:r.selection.includes(i)),qo(1),Su(" ",i," ")}}var Z$=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new Zc}return b(e,[{key:"filterOnChange",value:function(e,t){e.checked?(this.selection=[].concat(v(this.selection),[t]),this.ga.event("filter_added","filter_checkbox",t)):(this.selection=this.selection.filter(function(e){return e!==t}),this.ga.event("filter_removed","filter_checkbox",t)),this.selectionChange.emit(this.selection)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-checkbox"]],inputs:{label:"label",options:"options",selection:"selection",columns:"columns"},outputs:{selectionChange:"selectionChange"},decls:5,vars:6,consts:[[1,"filter-container"],[1,"filter-label"],[1,"options-container"],["class","option",4,"ngFor","ngForOf"],[1,"option"],[3,"checked","change"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),ku(2),As(),Ts(3,"div",2),xs(4,$$,3,2,"div",3),As(),As()),2&e&&(qo(2),xu(t.label),qo(1),su("three",3===t.columns)("four",4===t.columns),qo(1),Cs("ngForOf",t.options))},directives:[Dh,FX],styles:[".mat-checkbox.mat-accent .mat-checkbox-checkmark-path{stroke:#fff!important} .mat-checkbox.mat-accent .mat-checkbox-inner-container{margin-right:1rem}.filter-label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}.options-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap}.options-container.three[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:33%}.options-container.four[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:25%}.option[_ngcontent-%COMP%]{color:#fafafa}"],changeDetection:0}),e}(),J$=function(){return["Both","Male","Female"]},eZ=function(){return[1,110]},tZ=function(){return[13,83]},nZ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.filtersChange=new Zc,this.applyFilters=new Zc}return b(e,[{key:"updateFilter",value:function(e,t){this.filters=Object.assign(Object.assign({},this.filters),o({},t,e)),this.ga.event("filter_update","filter_content","".concat(t,":").concat(e)),this.filtersChange.emit(this.filters)}},{key:"applyButtonClick",value:function(){this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}},{key:"refreshFilters",value:function(){this.filters=Object.assign(Object.assign({},this.filters),{sex:"Both",ageRange:[1,110],bmiRange:[13,83],technologies:[],tmc:[]}),this.ga.event("filters_reset","filter_content"),this.filtersChange.emit(this.filters)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange",applyFilters:"applyFilters"},decls:14,vars:23,consts:[[1,"patient-filters"],["label","Sex",3,"options","selection","selectionChange"],["label","Age",3,"valueRange","selection","selectionChange"],["label","BMI",3,"valueRange","selection","selectionChange"],[1,"filter","assays"],["label","Assay Types",3,"columns","options","selection","selectionChange"],[1,"filter","providers"],["label","Tissue Providers",3,"columns","options","selection","selectionChange"],[1,"button-container"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"ccf-dropdown",1),Fs("selectionChange",function(e){return t.updateFilter(e,"sex")}),As(),Ts(2,"ccf-dual-slider",2),Fs("selectionChange",function(e){return t.updateFilter(e,"ageRange")}),As(),Ts(3,"ccf-dual-slider",3),Fs("selectionChange",function(e){return t.updateFilter(e,"bmiRange")}),As(),As(),Ts(4,"div",4),Ts(5,"ccf-checkbox",5),Fs("selectionChange",function(e){return t.updateFilter(e,"technologies")}),As(),As(),Ts(6,"div",6),Ts(7,"ccf-checkbox",7),Fs("selectionChange",function(e){return t.updateFilter(e,"tmc")}),As(),As(),Ts(8,"div",8),Ts(9,"button",9),Fs("click",function(){return t.applyButtonClick()}),ku(10,"APPLY FILTERS"),As(),Ts(11,"div",10),Ts(12,"mat-icon",11),Fs("click",function(){return t.refreshFilters()}),ku(13,"refresh"),As(),As(),As()),2&e&&(su("hidden",t.hidden),qo(1),Cs("options",Wc(20,J$))("selection",null==t.filters?null:t.filters.sex),qo(1),Cs("valueRange",Wc(21,eZ))("selection",null==t.filters?null:t.filters.ageRange),qo(1),Cs("valueRange",Wc(22,tZ))("selection",null==t.filters?null:t.filters.bmiRange),qo(1),su("hidden",t.hidden),qo(1),Cs("columns",4)("options",t.technologyFilters)("selection",null==t.filters?null:t.filters.technologies),qo(1),su("hidden",t.hidden),qo(1),Cs("columns",3)("options",t.providerFilters)("selection",null==t.filters?null:t.filters.tmc),qo(1),su("hidden",t.hidden))},directives:[X$,Q$,Z$,P_,x_],styles:[".filter[_ngcontent-%COMP%]{margin-top:2rem}.filter.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.filter.assays[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{margin-right:0 rem;width:25%}.button-container[_ngcontent-%COMP%]{margin-top:2rem;display:flex;flex-direction:row-reverse;align-items:center}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.refresh-icon[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{cursor:pointer;transition:.6s;transition-property:background}.patient-filters[_ngcontent-%COMP%]{display:flex;width:90%;padding-top:1rem}.patient-filters.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.patient-filters[_ngcontent-%COMP%] ccf-dual-slider[_ngcontent-%COMP%]{margin-left:.5rem;width:33%}.patient-filters[_ngcontent-%COMP%] ccf-dropdown[_ngcontent-%COMP%]{width:33%}"],changeDetection:0}),e}();function iZ(e,t){1&e&&(Ts(0,"div"),Ts(1,"mat-icon",7),ku(2,"close"),As(),As())}function rZ(e,t){1&e&&Ps(0,"mat-icon",8)}var oZ=function(){var e=function(){function e(){m(this,e),this.filtersChange=new Zc,this.filtersVisible=!1}return b(e,[{key:"toggleFilterVisible",value:function(){this.filtersVisible=!this.filtersVisible}},{key:"removeBox",value:function(){this.filtersVisible=!1}},{key:"applyFilters",value:function(e){this.filters=e,this.filtersChange.emit(e),this.removeBox()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange"},decls:8,vars:12,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","hidden","filters","applyFilters"],[1,"icon"],["svgIcon","filter",1,"icon","funnel"]],template:function(e,t){if(1&e&&(Ts(0,"div",0),Ts(1,"button",1),Fs("click",function(){return t.toggleFilterVisible()}),xs(2,iZ,3,0,"div",2),xs(3,rZ,1,0,"ng-template",null,3,ml),As(),Ts(5,"div",4),Ts(6,"div",5),Ts(7,"ccf-filters-content",6),Fs("applyFilters",function(e){return t.applyFilters(e)}),As(),As(),As(),As()),2&e){var n=Ss(4);su("expanded",t.drawerExpanded),qo(2),Cs("ngIf",t.filtersVisible)("ngIfElse",n),qo(3),su("visible",t.filtersVisible)("hidden",!t.filtersVisible),qo(2),Cs("technologyFilters",t.technologyFilters)("providerFilters",t.providerFilters)("hidden",!t.filtersVisible)("filters",t.filters)}},directives:[Lh,nZ,x_],styles:[".filters-popover[_ngcontent-%COMP%]{position:inherit}.filters-popover.expanded[_ngcontent-%COMP%]{position:relative}.filters-popover.expanded[_ngcontent-%COMP%] .popup-container[_ngcontent-%COMP%]{right:inherit}.filters-popover.expanded[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding-left:4em!important}.popup-container[_ngcontent-%COMP%]{position:absolute;z-index:5;top:1.2rem;left:1.48rem;box-shadow:.2rem .2rem 1rem #00000058}.popup-container[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding:1.5rem;position:relative;height:26.5rem}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;height:26.5rem;transition:width .2s ease-in-out;border-width:1px}.popup-container.visible[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:1;transition-delay:.3s;transition-duration:.2s}.popup-container.hidden[_ngcontent-%COMP%]{width:0;height:0;transition:all .2s ease-out;transition-delay:.3s;pointer-events:none}.popup-container.hidden[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out}.show-hide[_ngcontent-%COMP%]{background:none;border:none;z-index:10;position:relative;cursor:pointer;outline:none;padding:.5rem;border-radius:.25rem;transition:.6s}"],changeDetection:0}),e}(),aZ=function(){function e(t,n){m(this,e),this.original=t,this.level=n,this.visible=!0,this.opacity=20}return b(e,[{key:"label",get:function(){return this.original.label}},{key:"expandable",get:function(){return this.original.children.length>0}}],[{key:"create",value:function(t,n){return new e(t,n)}}]),e}();function sZ(e,t){if(1&e){var n=Ds();Ts(0,"div",5),Fs("click",function(e){var t=mn(n).node,i=Hs();return i.select(e.ctrlKey,t,!0,!i.isSelected(t))}),ku(1),As()}if(2&e){var i=t.node,r=Hs();su("hidden",i.label===(null==r.highlightedNode?null:r.highlightedNode.label))("filtered-out",!r.occurenceData[i.original.id]&&!!r.termData[i.original.id])("unavailable",!r.termData[i.original.id])("selected",r.isSelected(i)),qo(1),xu("colon"===i.label?"large intestine":i.label)}}function uZ(e,t){1&e&&Rs(0)}var cZ=function(e){return{node:e}};function lZ(e,t){if(1&e){var n=Ds();Ts(0,"mat-tree-node",6),Fs("mouseleave",function(){mn(n);var e=Ss(5);return Hs().mouseOut(),e.reset()}),Ts(1,"div"),Ts(2,"mat-icon",7),Fs("mouseenter",function(){var e=mn(n).$implicit;return Hs().mouseOver(e)}),As(),Ts(3,"div",8),Ts(4,"ccf-opacity-slider",9,10),Fs("opacityChange",function(e){var t=mn(n).$implicit;return Hs().updateOpacity(t,e)})("opacityReset",function(){var e=mn(n).$implicit;return Hs().resetNode(e)})("visibilityToggle",function(){var e=mn(n).$implicit;return Hs().toggleVisibility(e)}),As(),As(),As(),Ps(6,"div",11),xs(7,uZ,1,0,"ng-container",12),Ts(8,"div",13),ku(9),As(),As()}if(2&e){var i=t.$implicit,r=Hs(),o=Ss(2);Cs("matTreeNodePaddingIndent",r.indent),qo(1),au("display",-1!==i.opacity?"none":"block"),qo(1),au("left",r.getLeftIndent(i.level)),su("fade",!0!==i.visible),qo(1),au("left",r.getLeftIndent(i.level)),su("hidden",i.label!==(null==r.highlightedNode?null:r.highlightedNode.label)),qo(1),Cs("visible",i.visible)("opacity",i.opacity),qo(3),Cs("ngTemplateOutlet",o)("ngTemplateOutletContext",qc(18,cZ,i)),qo(1),su("suborgan",i.level>1),qo(1),xu(r.occurenceData[i.original.id]||0)}}function hZ(e,t){1&e&&Rs(0)}function fZ(e,t){if(1&e){var n=Ds();Ts(0,"mat-tree-node",14),Fs("mouseleave",function(){mn(n);var e=Ss(5);return Hs().mouseOut(),e.reset()}),Ts(1,"div"),Ts(2,"mat-icon",7),Fs("mouseenter",function(){var e=mn(n).$implicit;return Hs().mouseOver(e)}),As(),Ts(3,"div",8),Ts(4,"ccf-opacity-slider",9,15),Fs("opacityChange",function(e){var t=mn(n).$implicit;return Hs().updateOpacity(t,e)})("opacityReset",function(){var e=mn(n).$implicit;return Hs().resetNode(e)})("visibilityToggle",function(){var e=mn(n).$implicit;return Hs().toggleVisibility(e)}),As(),As(),As(),Ts(6,"button",16),Ts(7,"mat-icon",17),ku(8),As(),As(),xs(9,hZ,1,0,"ng-container",12),Ts(10,"div",13),ku(11),As(),As()}if(2&e){var i=t.$implicit,r=Hs(),o=Ss(2);Cs("matTreeNodePaddingIndent",r.indent),qo(1),au("display",-1!==i.opacity?"none":"block"),qo(1),au("left",r.getLeftIndent(i.level)),su("fade",!0!==i.visible),qo(1),au("left",r.getLeftIndent(i.level)),su("hidden",i.label!==(null==r.highlightedNode?null:r.highlightedNode.label)),qo(1),Cs("visible",i.visible)("opacity",i.opacity),qo(2),su("hidden",i.label===(null==r.highlightedNode?null:r.highlightedNode.label)),ks("aria-label","Toggle ",i.label,""),qo(2),Su(" ",r.control.isExpanded(i)?"expand_less":"expand_more"," "),qo(1),Cs("ngTemplateOutlet",o)("ngTemplateOutletContext",qc(22,cZ,i)),qo(1),su("suborgan",i.level>1),qo(1),xu(r.occurenceData[i.original.id]||0)}}var dZ=(0,TW.property)("level"),pZ=(0,TW.property)("expandable"),vZ=function(){var e=function(){function e(t,n){m(this,e),this.cdr=t,this.ga=n,this.atScrollBottom=!1,this.nodeSelected=new Zc,this.nodeChanged=new Zc,this.indent="1.5rem",this.control=new rK(dZ,pZ),this.flattener=new SK(aZ.create,dZ,pZ,TW.invoke.bind(void 0,this,"getChildren")),this.dataSource=new EK(this.control,this.flattener),this._nodes=void 0,this.bodyNode=new aZ({"@id":"http://purl.obolibrary.org/obo/UBERON_0013702","@type":"OntologyTreeNode",id:"http://purl.obolibrary.org/obo/UBERON_0013702",label:"body",parent:"",children:[],synonymLabels:[]},0),this.anySelectionsMade=!1,this.selectedNodes=[]}return b(e,[{key:"nodes",get:function(){return this._nodes},set:function(e){var t;this._nodes=e,this.control&&(this.dataSource.data=null!==(t=this._nodes)&&void 0!==t?t:[])}},{key:"getChildren",get:function(){return this._getChildren},set:function(e){var t;this._getChildren=e,this.dataSource.data=null!==(t=this.nodes)&&void 0!==t?t:[]}},{key:"occurenceData",get:function(){return this._occurenceData},set:function(e){this._occurenceData=e||{}}},{key:"termData",get:function(){return this._termData},set:function(e){this._termData=e||{}}},{key:"ngOnInit",value:function(){this.control.dataNodes&&this.control.expand(this.control.dataNodes[0])}},{key:"ngOnChanges",value:function(e){if(e.ontologyFilter){var t=e.ontologyFilter.currentValue;this.selectByIDs((null==t?void 0:t.length)>=0?t:[this.bodyNode.original.id])}}},{key:"selectByIDs",value:function(e){var t=this,n=this.control.dataNodes,i=n.filter(function(t){return e.indexOf(t.original.id)>-1});(null==i?void 0:i.length)>0&&(this.selectedNodes=i,this.ga.event("nodes_selected_by_ids","ontology_tree",i.map(function(e){return e.label}).join(",")),this.control.collapseAll(),this.selectedNodes.forEach(function(e){t.expandAndSelect(e.original,function(e){var t;return null===(t=n.find(function(t){return t.original.id===e.parent}))||void 0===t?void 0:t.original},!0)}))}},{key:"expandAndSelect",value:function(e,t){for(var n,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.cdr,o=this.control,a=new Set,s=t(e);s;)a.add(s),s=t(s);var u=(0,TW.filter)(o.dataNodes,function(e){return a.has(e.original)}),c=o.dataNodes.find(function(t){return t.original===e});i||(this.selectedNodes=[],o.collapseAll());var l,h=_(u);try{for(h.s();!(l=h.n()).done;){var f=l.value;o.expand(f)}}catch(d){h.e(d)}finally{h.f()}"body"===e.label&&(null===(n=o.dataNodes)||void 0===n?void 0:n.length)>0&&o.expand(o.dataNodes[0]),this.select(i,c,!1,!0),r.detectChanges()}},{key:"isInnerNode",value:function(e,t){return t.expandable}},{key:"isSelected",value:function(e){return this.selectedNodes.filter(function(t){return(null==e?void 0:e.original.label)===(null==t?void 0:t.original.label)}).length>0}},{key:"select",value:function(e,t,n,i){if(this.anySelectionsMade||(this.selectedNodes=[],this.anySelectionsMade=!0),void 0===t)return this.selectedNodes=[],void this.ga.event("nodes_unselected","ontology_tree");e?i?this.selectedNodes.indexOf(t)<0&&this.selectedNodes.push(t):this.selectedNodes.splice(this.selectedNodes.indexOf(t),1):(this.selectedNodes=[],i&&this.selectedNodes.push(t)),this.ga.event("nodes_selected","ontology_tree",this.selectedNodes.map(function(e){return e.label}).join(",")),n&&this.nodeSelected.emit(this.selectedNodes.map(function(e){return null==e?void 0:e.original}))}},{key:"mouseOver",value:function(e){this.highlightedNode=e}},{key:"mouseOut",value:function(){this.highlightedNode=void 0}},{key:"updateOpacity",value:function(e,t){e.opacity=t,this.ga.event("opacity_update","ontology_tree",e.label,t),this.nodeChanged.emit(e)}},{key:"resetNode",value:function(e){e.opacity=20,e.visible=!0,this.ga.event("node_reset","ontology_tree",e.label),this.nodeChanged.emit(e)}},{key:"toggleVisibility",value:function(e){e.visible=!0!==e.visible,this.ga.event("visibility_update","ontology_tree",e.label,+e.visible),this.nodeChanged.emit(e)}},{key:"getLeftIndent",value:function(e){return-1.5*e+"rem"}},{key:"onScroll",value:function(e){if(e.target){var t=e.target,n=t.clientHeight,i=t.scrollHeight,r=t.scrollTop;this.atScrollBottom=i-r-n<20}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(wc),Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[Gt],decls:6,vars:5,consts:[[1,"ccf-ontology-tree",3,"dataSource","treeControl","scroll"],["selectableRegion",""],["class","node leaf-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef"],["class","node inner-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef","matTreeNodeDefWhen"],[1,"scroll-gradient"],[1,"text",3,"click"],["matTreeNodePadding","",1,"node","leaf-node",3,"matTreeNodePaddingIndent","mouseleave"],["svgIcon","app:opacity",1,"icon","opacity",3,"mouseenter"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider1",""],[1,"non-expandable"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"num-results"],["matTreeNodePadding","",1,"node","inner-node",3,"matTreeNodePaddingIndent","mouseleave"],["slider2",""],["mat-icon-button","","matTreeNodeToggle","",1,"toggle"],[1,"icon","font-icon"]],template:function(e,t){1&e&&(Ts(0,"mat-tree",0),Fs("scroll",function(e){return t.onScroll(e)}),xs(1,sZ,2,9,"ng-template",null,1,ml),xs(3,lZ,10,20,"mat-tree-node",2),xs(4,fZ,12,24,"mat-tree-node",3),As(),Ps(5,"div",4)),2&e&&(Cs("dataSource",t.dataSource)("treeControl",t.control),qo(4),Cs("matTreeNodeDefWhen",t.isInnerNode),qo(1),su("hidden",!!t.atScrollBottom))},directives:[wK,yK,mK,bK,x_,WG,Gh,P_,kK],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;height:100%;width:25.25rem;overflow:auto;overflow-x:hidden}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .toggle[_ngcontent-%COMP%]{z-index:-1;opacity:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .text[_ngcontent-%COMP%]{margin-left:.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]{min-height:0;font-size:1rem;margin-bottom:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:width;position:relative;z-index:1}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{width:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%] ccf-opacity-slider[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider{height:1.5rem;margin-left:1rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box .slider-and-label{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider{height:1.5rem;width:15rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider .mat-slider-wrapper{top:12px}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .opacity-value{width:3rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-right:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node.inner-node[_ngcontent-%COMP%] button.hidden[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{position:relative;min-width:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:normal}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .autocomplete-open[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{border-bottom:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .non-expandable[_ngcontent-%COMP%]{margin-left:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{white-space:nowrap;cursor:pointer;margin-left:1rem;opacity:1;width:50%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:opacity,width}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.hidden[_ngcontent-%COMP%]{opacity:0;width:0%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.unavailable[_ngcontent-%COMP%]{pointer-events:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-left:auto}.scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}(),gZ=function(){function e(t){m(this,e),this.ontologyState=t}return b(e,[{key:"rootNode",get:function(){return this.ontologyState.rootNode$}},{key:"filter",value:function(e){var t=this;return this.ontologyState.nodes$.pipe(ue(function(n){return t.lookup(n,e.toLowerCase())}))}},{key:"lookup",value:function(e,t){var n=this,i=new Map;return e&&e.forEach(function(e){if(e.label.toLowerCase().includes(t)&&!i.get(e.id))i.set(e.id,{index:n.getIndexOfMatch(e.label,t),displayLabel:n.formatLabel(e.label,t),node:e});else{var r=e.synonymLabels.find(function(e){return e.toLowerCase().includes(t)});r&&!i.get(e.id)&&i.set(e.id,{index:n.getIndexOfMatch(e.label+" ("+r+")",t),displayLabel:n.formatLabel(e.label+" ("+r+")",t),node:e})}}),Array.from(i.values())}},{key:"getIndexOfMatch",value:function(e,t){return e.toLowerCase().indexOf(t)}},{key:"formatLabel",value:function(e,t){var n=this.getIndexOfMatch(e,t);return[e.substr(0,n),e.substr(n,t.length),e.substr(n+t.length,e.length)]}},{key:"getChildren",value:function(e){return(0,TW.at)(this.ontologyState.snapshot.nodes,e.children)}}]),e}();function mZ(e,t){if(1&e&&(Ts(0,"mat-option",8),Ts(1,"span",9),ku(2),As(),Ts(3,"span",10),ku(4),As(),Ts(5,"span",11),ku(6),As(),As()),2&e){var n=t.$implicit;Cs("value",n),qo(2),xu(n.displayLabel[0]),qo(2),xu(n.displayLabel[1]),qo(2),xu(n.displayLabel[2])}}gZ.\u0275fac=function(e){return new(e||gZ)(Qi(kX))},gZ.\u0275prov=Ke({token:gZ,factory:gZ.\u0275fac,providedIn:"root"}),vw([OF.ak],gZ.prototype,"getChildren",null);var yZ=function(){var e=function(){function e(t,n){m(this,e),this.ontologyService=t,this.ga=n,this.selected=new Zc,this.formControl=new YV(""),this.autoCompleteOpen=!1}return b(e,[{key:"ngOnInit",value:function(){var e=this;this.filteredResults$=this.formControl.valueChanges.pipe(od(function(e){return"string"==typeof e}),fd(""),dd(function(t){return e.ontologyService.filter(t)}),ue(function(t){return(0,TW.sortBy)(t,[e.sortBySynonymResult,"index",e.sortLexically])}))}},{key:"displayFormatter",value:function(e){var t;return(null!==(t=null==e?void 0:e.displayLabel)&&void 0!==t?t:[]).join("")}},{key:"sortBySynonymResult",value:function(e){return e.displayLabel.join().includes("(")?1:-1}},{key:"sortLexically",value:function(e){return e.node.label.toLowerCase()}},{key:"onSelect",value:function(e){var t=(0,TW.get)(e,["option","value","node"]);t&&(this.ga.event("search","ontology_search",t.id),this.selected.emit(t),this.formControl.reset())}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(gZ),Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-ontology-search"]],outputs:{selected:"selected"},decls:10,vars:8,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","placeholder","Search ontology terms ...","matInput","",1,"input",3,"formControl","matAutocomplete"],[1,"ccf-ontology-search","detached","autocomplete",3,"displayWith","optionSelected","opened","closed"],["autocomplete",""],[1,"results-container"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"prefix"],[1,"search-term"],[1,"suffix"]],template:function(e,t){if(1&e&&(Ts(0,"form",0),Ts(1,"mat-form-field",1),Ts(2,"mat-icon",2),ku(3,"search"),As(),Ps(4,"input",3),Ts(5,"mat-autocomplete",4,5),Fs("optionSelected",function(e){return t.onSelect(e)})("opened",function(){return t.autoCompleteOpen=!0})("closed",function(){return t.autoCompleteOpen=!1}),Ts(7,"div",6),xs(8,mZ,7,4,"mat-option",7),Kc(9,"async"),As(),As(),As(),As()),2&e){var n=Ss(6);su("autocomplete-open",t.autoCompleteOpen),qo(4),Cs("formControl",t.formControl)("matAutocomplete",n),qo(1),Cs("displayWith",t.displayFormatter),qo(3),Cs("ngForOf",Qc(9,6,t.filteredResults$))}},directives:[ez,TV,JV,zz,x_,Nz,vU,aV,aU,OV,rz,tU,Dh,mb],pipes:[Yh],styles:[".ccf-ontology-search[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem .25rem 0;margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;height:3rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix input{margin-left:.4rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-prefix{top:.5rem;border:none}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0 .25rem;min-width:2.5rem} .ccf-ontology-search.detached{border:.125rem solid;border-top:none;border-radius:0 0 .25rem .25rem;max-height:18rem} .ccf-ontology-search.detached .results-container{width:23.75rem;margin-bottom:1rem;overflow:auto;max-height:15rem;scrollbar-width:thin} .ccf-ontology-search.detached .results-container mat-option{height:1.5rem;width:23.75rem} .ccf-ontology-search.detached .results-container mat-option .search-term{text-decoration:underline}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0;border-bottom:none}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem 0 0;border-bottom:none}"],changeDetection:0}),e}(),bZ=function(e){return[e]};function _Z(e,t){if(1&e){var n=Ds();Ts(0,"ccf-ontology-tree",2),Fs("nodeSelected",function(e){return mn(n),Hs().ontologySelection.emit(e)}),As()}if(2&e){var i=t.ngIf,r=Hs();Cs("nodes",qc(5,bZ,i))("getChildren",r.ontologySearchService.getChildren)("occurenceData",r.occurenceData)("termData",r.termData)("ontologyFilter",r.ontologyFilter)}}var wZ=function(){var e=function(){function e(t,n){m(this,e),this.ontologySearchService=t,this.store=n,this.ontologySelection=new Zc}return b(e,[{key:"selected",value:function(e){var t=this.store.selectSnapshot(kX).nodes;this.tree.expandAndSelect(e,function(e){return t[e.parent]})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(gZ),Es(qB))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-ontology-selection"]],viewQuery:function(e,t){var n;(1&e&&hl(vZ,5),2&e)&&(ll(n=dl())&&(t.tree=n.first))},inputs:{occurenceData:"occurenceData",termData:"termData",ontologyFilter:"ontologyFilter"},outputs:{ontologySelection:"ontologySelection"},decls:3,vars:3,consts:[[3,"selected"],["class","tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected"]],template:function(e,t){1&e&&(Ts(0,"ccf-ontology-search",0),Fs("selected",function(e){return t.selected(e)}),As(),xs(1,_Z,1,7,"ccf-ontology-tree",1),Kc(2,"async")),2&e&&(qo(1),Cs("ngIf",Qc(2,1,t.ontologySearchService.rootNode)))},directives:[yZ,Lh,vZ],pipes:[Yh],styles:[""],changeDetection:0}),e}(),kZ=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this.drawer=t,this.cdr=i,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new W;var o=n.connect(this);this.subscriptions.add(o.getMessagesFromSource(t).subscribe(function(e){r.handleMessage(e)&&i.markForCheck()}))}return b(e,[{key:"classEnd",get:function(){return"end"===this.position}},{key:"icon",get:function(){var e,t="arrow_right",n="arrow_left";return"end"===this.position&&(t=(e=[n,t])[0],n=e[1]),this.opened?n:t}},{key:"ngAfterViewInit",value:function(){var e=this;setTimeout(function(){e.position=e.drawer.position,e.cdr.markForCheck()})}},{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"handleMessage",value:function(e){return"drawer-toggled"===e.payload.type&&(this.opened=e.payload.opened,!0)}},{key:"toggle",value:function(){var e=this.drawer,t=e.opened,n=e.expanded;t?n?e.closeExpanded():e.close():e.open()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(V$),Es(D$),Es(wc))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(e,t){2&e&&(cu(t.className),su("ccf-drawer-toggle-button-end",t.classEnd))},decls:2,vars:1,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(e,t){1&e&&(Ts(0,"mat-icon",0),Fs("click",function(){return t.toggle()}),ku(1),As()),2&e&&(qo(1),Su(" ",t.icon,"\n"))},directives:[x_],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;display:flex;align-items:center;transition:.6s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:relative;right:.25rem;transition:all .5s}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}"],changeDetection:0}),e}();function xZ(e,t){1&e&&(Ts(0,"div",7),Ps(1,"mat-spinner",8),Ts(2,"span",3),ku(3,"Loading External Site"),As(),As())}function SZ(e,t){if(1&e){var n=Ds();Ts(0,"iframe",9),Fs("load",function(){return mn(n),Hs().loading=!1}),As()}2&e&&_s("src",Hs().safeUrl,qr)}var EZ=function(){var e=function(){function e(t){m(this,e),this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new Zc,this.loading=!0,this.safeUrl=null}return b(e,[{key:"ngOnChanges",value:function(e){"url"in e&&this.updateUrl()}},{key:"updateUrl",value:function(){var e=this.sanitizer,t=this.url;this.safeUrl=null,t&&(this.safeUrl=e.bypassSecurityTrustResourceUrl(t),this.loading=!0)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Of))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.className)},inputs:{url:"url"},outputs:{closed:"closed"},features:[Gt],decls:11,vars:4,consts:[[1,"toolbar"],["mat-flat-button","","target","_blank","rel","noopener noreferrer",1,"launch",3,"href","disabled"],[1,"icon"],[1,"text"],["mat-flat-button","",1,"close",3,"click"],["class","overlay",4,"ngIf"],["class","frame","title","Portal Data Viewer","referrerpolicy","no-referrer",3,"load",4,"ngIf"],[1,"overlay"],[1,"spinner"],["title","Portal Data Viewer","referrerpolicy","no-referrer",1,"frame",3,"load"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"a",1),Ts(2,"mat-icon",2),ku(3,"launch"),As(),Ts(4,"span",3),ku(5,"Open in Portal"),As(),As(),Ts(6,"button",4),Fs("click",function(){return t.closed.emit()}),Ts(7,"mat-icon",2),ku(8,"clear"),As(),As(),As(),xs(9,xZ,4,0,"div",5),xs(10,SZ,1,1,"iframe",6)),2&e&&(qo(1),Cs("href",t.safeUrl,Wr)("disabled",!t.safeUrl),qo(8),Cs("ngIf",t.loading),qo(1),Cs("ngIf",t.safeUrl))},directives:[M_,x_,P_,Lh,E$],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;width:100%;height:1.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%]{margin-right:3.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch.mat-button-disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.25rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{min-width:0;padding:0;line-height:1.5rem;border-radius:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:1.5rem;bottom:0;left:0;right:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{margin-bottom:.5rem}[_nghost-%COMP%] .frame[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0}),e}();function CZ(e,t){if(1&e&&Ps(0,"div",3),2&e){var n=t.index;su("line-tick-visible",Hs().tissueSectionExists(n+1))}}var OZ=function(){return[]},TZ=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-tissue-section-vis"}return b(e,[{key:"tissueSectionExists",value:function(e){return this.tissueSections.filter(function(t){return t.sectionNumber===e}).length>0}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-tissue-section-vis"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{totalTissueSections:"totalTissueSections",tissueSections:"tissueSections"},decls:7,vars:3,consts:[[1,"container"],["class","line-tick",3,"line-tick-visible",4,"ngFor","ngForOf"],[1,"x-axis"],[1,"line-tick"]],template:function(e,t){1&e&&(Ts(0,"div"),ku(1,"0"),As(),Ts(2,"div",0),xs(3,CZ,1,2,"div",1),Ps(4,"div",2),As(),Ts(5,"div"),ku(6),As()),2&e&&(qo(3),Cs("ngForOf",Wc(2,OZ).constructor(t.totalTissueSections)),qo(3),xu(t.totalTissueSections))},directives:[Dh],styles:["[_nghost-%COMP%]{width:100%;height:2.5rem;padding:.5rem 1rem;display:flex}[_nghost-%COMP%] .container[_ngcontent-%COMP%]{margin-right:.5rem;margin-left:.5rem;flex-grow:1;display:flex;position:relative;justify-content:space-evenly}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .line-tick[_ngcontent-%COMP%]{height:100%;width:1px;z-index:2}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .x-axis[_ngcontent-%COMP%]{width:100%;height:2px;position:absolute;top:calc(50% - 1px);right:0;z-index:1}"],changeDetection:0}),e}();function AZ(e,t){if(1&e){var n=Ds();Ts(0,"div",7),Ts(1,"div",8),ku(2),As(),Ts(3,"a",9),Fs("click",function(){mn(n);var e=Hs().$implicit;return Hs().linkClicked.emit(e)}),ku(4," DATA "),Ts(5,"mat-icon"),ku(6,"open_in_new"),As(),As(),As()}if(2&e){var i=Hs().$implicit;qo(1),au("background-image","url("+i.thumbnail+")"),qo(1),Su(" ",i.technology," ")}}function PZ(e,t){1&e&&(Ms(0),xs(1,AZ,7,3,"ng-template",6),Is())}var MZ=function(){var e=-1;return function(){return e+=1}}(),IZ=function(){var e=function(){function e(){m(this,e),this.className="ccf-thumbnail-carousel",this.linkClicked=new Zc,this.uid=MZ(),this.config={allowTouchMove:!1,slidesOffsetBefore:4,slidesOffsetAfter:4,slidesPerView:"auto",spaceBetween:4,watchOverflow:!0},this.navigation={prevEl:"#"+this.prevButtonId,nextEl:"#"+this.nextButtonId}}return b(e,[{key:"prevButtonId",get:function(){return"ccf-thumbnail-carousel-prev-button-".concat(this.uid)}},{key:"nextButtonId",get:function(){return"ccf-thumbnail-carousel-next-button-".concat(this.uid)}},{key:"itemId",value:function(e,t){return t.thumbnail}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-thumbnail-carousel"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.className)},inputs:{data:"data"},outputs:{linkClicked:"linkClicked"},decls:11,vars:6,consts:[[1,"prev"],["mat-icon-button","","disableRipple",""],[1,"swiper",3,"config","navigation"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"next"],[1,"fade"],["swiperSlide",""],[1,"slide"],[1,"thumbnail"],[1,"link",3,"click"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"button",1),Ts(2,"mat-icon"),ku(3,"navigate_before"),As(),As(),As(),Ts(4,"swiper",2),xs(5,PZ,2,0,"ng-container",3),As(),Ts(6,"div",4),Ts(7,"button",1),Ps(8,"div",5),Ts(9,"mat-icon"),ku(10,"navigate_next"),As(),As(),As()),2&e&&(qo(1),_s("id",t.prevButtonId),qo(3),Cs("config",t.config)("navigation",t.navigation),qo(1),Cs("ngForOf",t.data)("ngForTrackBy",t.itemId),qo(2),_s("id",t.nextButtonId))},directives:[P_,x_,i$,Dh,n$],styles:['[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%]{flex-grow:1;padding-bottom:.3125rem}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%] .swiper-slide{width:3.75rem;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:1.5rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{position:absolute;top:-.625rem;left:-2rem;z-index:10;width:2rem;height:3.125rem;opacity:1;transition:opacity ease-in-out .3s;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%]{cursor:default;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background-size:cover;position:relative;width:calc(100% - 2 * .125rem);height:calc(100% - 2 * .125rem);border-style:solid;border-width:.125rem;border-radius:.25rem;background-origin:padding-box;background-clip:padding-box;font-size:.875rem;font-weight:bold}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-.125rem;left:-.125rem;width:.125rem;height:.125rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;bottom:0;right:0;left:0;opacity:0;transition:opacity ease-in-out .3s;box-shadow:0 2px 4px #0009;font-size:.75rem;line-height:.75rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%], [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:link, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:visited, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:focus, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:active{cursor:pointer;text-decoration:none}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]:hover .link[_ngcontent-%COMP%]{opacity:1}'],changeDetection:0}),e}();function RZ(e,t){if(1&e){var n=Ds();Ts(0,"mat-icon",14),Fs("click",function(){return mn(n),Hs().toggleExpansion()}),ku(1),As()}if(2&e){var i=Hs();qo(1),xu(i.expanded?"expand_less":"expand_more")}}function DZ(e,t){if(1&e&&Ps(0,"ccf-tissue-section-vis",20),2&e){var n=Hs(2);Cs("totalTissueSections",n.tissueBlock.sectionCount)("tissueSections",n.tissueBlock.sections)}}function NZ(e,t){if(1&e){var n=Ds();Ms(0),Ts(1,"ccf-thumbnail-carousel",21),Fs("linkClicked",function(e){return mn(n),Hs(2).linkHandler(e.link)}),As(),Is()}if(2&e){var i=Hs(2);qo(1),Cs("data",i.tissueBlock.datasets)}}function LZ(e,t){if(1&e){var n=Ds();Ms(0),Ts(1,"ccf-thumbnail-carousel",21),Fs("linkClicked",function(e){return mn(n),Hs(3).linkHandler(e.link)}),As(),Is()}if(2&e){var i=Hs().$implicit;qo(1),Cs("data",i.datasets)}}function jZ(e,t){if(1&e){var n=Ds();Ts(0,"div",22),Ts(1,"div",23),Ts(2,"mat-icon",24),ku(3,"bubble_chart"),As(),Ts(4,"div",17),Ts(5,"div",8),ku(6),As(),Ts(7,"div",8),ku(8),As(),As(),Ts(9,"div",9),Fs("click",function(){var e=mn(n).$implicit;return Hs(2).linkHandler(e.link)}),Ts(10,"div",10),ku(11,"TISSUE SECTION"),As(),Ts(12,"mat-icon",11),ku(13,"open_in_new"),As(),As(),As(),xs(14,LZ,2,1,"ng-container",13),As()}if(2&e){var i=t.$implicit;qo(6),xu(i.label),qo(2),xu(i.description),qo(6),Cs("ngIf",i.datasets.length>0)}}function FZ(e,t){if(1&e){var n=Ds();Ms(0),Ts(1,"div",15),Ts(2,"div",16),Ts(3,"mat-icon",5),ku(4,"bubble_chart"),As(),Ts(5,"div",17),Ts(6,"div",8),ku(7),As(),Ts(8,"div",8),ku(9),As(),As(),Ts(10,"div",9),Fs("click",function(){mn(n);var e=Hs();return e.linkHandler(e.tissueBlock.link)}),Ts(11,"div",10),ku(12,"TISSUE BLOCK"),As(),Ts(13,"mat-icon",11),ku(14,"open_in_new"),As(),As(),As(),xs(15,DZ,1,2,"ccf-tissue-section-vis",18),xs(16,NZ,2,1,"ng-container",13),As(),xs(17,jZ,15,3,"div",19),Is()}if(2&e){var i=Hs();qo(7),xu(i.tissueBlock.label),qo(2),xu(i.tissueBlock.description),qo(6),Cs("ngIf",i.tissueBlock.sections.length>1),qo(1),Cs("ngIf",i.tissueBlock.datasets.length>0),qo(1),Cs("ngForOf",i.tissueBlock.sections)}}var BZ=function(e){return{"background-color":e}},VZ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.clsName="ccf-donor-card",this.selected=!1,this.expanded=!1,this.highlighted=!1,this.checked=new Zc,this.linkClick=new Zc,this.hoverState=""}return b(e,[{key:"handleCheckbox",value:function(){this.selected=!this.selected,this.ga.event("selected_toggled","donor_card",this.tissueBlock.label,+this.selected),this.checked.emit(this.selected),this.expanded=!1}},{key:"toggleExpansion",value:function(){this.selected&&(this.expanded=!this.expanded,this.ga.event("expanded_toggled","donor_card",this.tissueBlock.label,+this.expanded))}},{key:"linkHandler",value:function(e){this.ga.event("link_clicked","donor_card",this.tissueBlock.label),this.selected?this.linkClick.emit(e):(this.selected=!0,this.checked.emit(this.selected))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(e,t){2&e&&cu(t.clsName)},inputs:{tissueBlock:"tissueBlock",selected:"selected",color:"color",expanded:"expanded",highlighted:"highlighted"},outputs:{checked:"checked",linkClick:"linkClick"},decls:19,vars:20,consts:[[1,"main-container"],[1,"checkbox-background",3,"ngStyle","click"],[1,"checkbox",3,"checked"],[1,"hoverable","default-padding","donor","mat-elevation-z2"],[1,"d-flex"],[1,"icon-size","icon-dark","mr-5"],[1,"donor-info"],[1,"title","description"],[1,"description"],[1,"hover-state","mat-elevation-z4",3,"click"],[1,"hover-title"],[1,"icon-size","hover-icon"],["class","icon-size ml-5 selectable",3,"click",4,"ngIf"],[4,"ngIf"],[1,"icon-size","ml-5","selectable",3,"click"],[1,"expanded-view","mat-elevation-z2","align-end"],[1,"info-block","hover-enabled","default-padding"],[1,"text-content"],[3,"totalTissueSections","tissueSections",4,"ngIf"],["class","expanded-view w-80 mat-elevation-z2 align-end",4,"ngFor","ngForOf"],[3,"totalTissueSections","tissueSections"],[1,"mt-05",3,"data","linkClicked"],[1,"expanded-view","w-80","mat-elevation-z2","align-end"],[1,"default-padding","info-block","hover-enabled"],[1,"icon-size","mr-5","icon-light"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Fs("click",function(){return t.handleCheckbox()}),Ps(2,"mat-checkbox",2),As(),Ts(3,"div",3),Ts(4,"div",4),Ts(5,"mat-icon",5),ku(6,"person"),As(),Ts(7,"div",6),Ts(8,"div",7),ku(9),As(),Ts(10,"div",8),ku(11),As(),As(),As(),Ts(12,"div",9),Fs("click",function(){return t.linkHandler(t.tissueBlock.donor.link)}),Ts(13,"div",10),ku(14,"DONOR"),As(),Ts(15,"mat-icon",11),ku(16,"open_in_new"),As(),As(),xs(17,RZ,2,1,"mat-icon",12),As(),As(),xs(18,FZ,18,5,"ng-container",13)),2&e&&(qo(1),su("selected",t.selected)("highlighted",t.highlighted),Cs("ngStyle",qc(18,BZ,t.selected?t.color:"transparent")),qo(1),su("checkselected",t.selected),Cs("checked",t.selected),qo(1),su("hover-enabled",t.selected)("expanded",t.expanded)("highlighted",t.highlighted),qo(6),xu(t.tissueBlock.donor.label),qo(2),xu(t.tissueBlock.donor.description),qo(6),Cs("ngIf",t.selected),qo(1),Cs("ngIf",t.expanded))},directives:[Hh,FX,x_,Lh,Dh,TZ,IZ],styles:["[_nghost-%COMP%]{width:100%}[_nghost-%COMP%] .main-container[_ngcontent-%COMP%]{display:flex;min-height:3rem;width:100%;align-items:center;padding-left:.5rem}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%]{height:2rem;width:2rem;border-radius:50%;margin-right:.5rem;display:flex;justify-content:center;align-items:center;cursor:pointer}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-checked.mat-accent .mat-checkbox-background, [_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-indeterminate.mat-accent[_ngcontent-%COMP%] .mat-checkbox-background[_ngcontent-%COMP%]{background-color:transparent}[_nghost-%COMP%] .checkbox-background.highlighted[_ngcontent-%COMP%] .mat-ripple-element{opacity:.04}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkselected[_ngcontent-%COMP%] .mat-checkbox-frame{border-color:#fff!important}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{margin-left:1.12rem;margin-bottom:.12rem}[_nghost-%COMP%] .align-end[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;width:100%;align-items:center}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]:not(:first-child){margin-top:.5rem}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .donor.highlighted[_ngcontent-%COMP%]{box-shadow:0 6px 2px -2px #0003,0 4px 4px #00000024,0 2px 10px #0000001f}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .hover-state[_ngcontent-%COMP%]{width:19.5rem!important}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .hoverable[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]:hover .hover-state[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%]{transition:opacity .15s ease-in-out;opacity:0;cursor:pointer;position:absolute;height:100%;width:100%;top:0;margin-left:-.5rem;align-items:center;display:flex;justify-content:flex-end;padding-right:1rem;font-size:.75rem}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-title[_ngcontent-%COMP%]{font-weight:lighter}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-icon[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .default-padding[_ngcontent-%COMP%]{padding:.25rem .5rem}[_nghost-%COMP%] .expanded-view[_ngcontent-%COMP%]{margin-top:.25rem;width:85%;margin-bottom:.25rem}[_nghost-%COMP%] .d-flex[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .icon-size[_ngcontent-%COMP%]{height:1.5rem;width:1.5rem;font-size:1.5rem}[_nghost-%COMP%] .selectable[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%]{width:80%!important}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:16rem!important}[_nghost-%COMP%] .ml-5[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .mr-5[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .mt-05[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),e}();function zZ(e,t){if(1&e&&(Ts(0,"div",7),Ts(1,"div",8),ku(2),As(),Ts(3,"div",9),ku(4),As(),As()),2&e){var n=t.$implicit;qo(2),xu(n.count),qo(2),xu(n.label)}}function UZ(e,t){if(1&e){var n=Ds();Ts(0,"div",10),Fs("mouseenter",function(){var e=mn(n).$implicit;return Hs().handleHover(e.tissueBlock.spatialEntityId)})("mouseleave",function(){return mn(n),Hs().handleUnhover()}),Ts(1,"ccf-donor-card",11),Fs("checked",function(e){var t=mn(n).$implicit;return Hs().handleSelection(t,e)})("linkClick",function(e){return mn(n),Hs().handleLinkClick(e)}),As(),As()}if(2&e){var i=t.$implicit,r=Hs();qo(1),Cs("tissueBlock",i.tissueBlock)("selected",i.selected)("color",i.color)("highlighted",i.tissueBlock.spatialEntityId===r.highlighted)}}var HZ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.linkClicked=new Zc,this.listResultSelected=new Zc,this.listResultDeselected=new Zc,this.itemHovered=new Zc,this.itemUnhovered=new Zc,this.atScrollBottom=!1}return b(e,[{key:"handleSelection",value:function(e,t){this.ga.event("list_result_selected","results_browser",this.resultLabel,+t),t?this.listResultSelected.next(e):this.listResultDeselected.next(e)}},{key:"handleLinkClick",value:function(e){this.linkClicked.emit(e)}},{key:"onScroll",value:function(e){if(e.target){var t=e.target,n=t.clientHeight,i=t.scrollHeight,r=t.scrollTop;this.atScrollBottom=i-r-n<64}}},{key:"handleHover",value:function(e){this.itemHovered.emit(e)}},{key:"handleUnhover",value:function(){this.itemUnhovered.emit()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(SG))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:5,consts:[[1,"results-browser-container"],[1,"stat-box"],["id","title"],["class","stat-row",4,"ngFor","ngForOf"],[1,"results-browser-list",3,"scroll"],["class","browser-item-container",3,"mouseenter","mouseleave",4,"ngFor","ngForOf"],[1,"scroll-gradient"],[1,"stat-row"],[1,"stat-value"],[1,"stat-label"],[1,"browser-item-container",3,"mouseenter","mouseleave"],[3,"tissueBlock","selected","color","highlighted","checked","linkClick"]],template:function(e,t){1&e&&(Ts(0,"div",0),Ts(1,"div",1),Ts(2,"div",2),ku(3),As(),xs(4,zZ,5,2,"div",3),As(),Ts(5,"div",4),Fs("scroll",function(e){return t.onScroll(e)}),xs(6,UZ,2,4,"div",5),As(),Ps(7,"div",6),As()),2&e&&(qo(3),xu(t.resultLabel),qo(1),Cs("ngForOf",t.aggregateData),qo(2),Cs("ngForOf",t.listResults),qo(1),su("hidden",!!t.atScrollBottom))},directives:[Dh,VZ],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 7rem);padding:0 1.5rem 1.5rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%]{margin-bottom:1.5rem;line-height:1.25;min-height:7.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] #title[_ngcontent-%COMP%]{font-size:1.25rem;margin-bottom:.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-value[_ngcontent-%COMP%]{margin-right:1rem;width:5.5rem;text-align:right;font-weight:600}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-label[_ngcontent-%COMP%]{font-weight:300}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;overflow-y:scroll;scrollbar-width:thin;padding-right:.5rem;margin-bottom:2rem}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%] .browser-item-container[_ngcontent-%COMP%]{width:100%}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}();function GZ(e,t){1&e&&(Ts(0,"a",5),ku(1,"LOGIN"),As()),2&e&&Cs("href",Hs().hubmapPortalUrl+"login",Wr)}function WZ(e,t){1&e&&(Ts(0,"a",5),ku(1,"LOGOUT"),As()),2&e&&Cs("href",Hs().hubmapPortalUrl+"logout",Wr)}var qZ=function(){var e=function e(){m(this,e),this.refreshClicked=new Zc,this.downloadClicked=new Zc};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ct({type:e,selectors:[["ccf-header"]],inputs:{hubmapPortalUrl:"hubmapPortalUrl",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:3,consts:[[1,"ccf-header"],[1,"portal-home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right","svgIcon","app:logo",1,"logo"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"href",4,"ngIf"],["mat-button","","rel","noreferrer noopener","target","_blank",1,"authentication",3,"href"]],template:function(e,t){1&e&&(Ts(0,"mat-toolbar",0),Ts(1,"a",1),Ps(2,"mat-icon",2),As(),Ps(3,"div",3),xs(4,GZ,2,1,"a",4),xs(5,WZ,2,1,"a",4),As()),2&e&&(qo(1),Cs("href",t.hubmapPortalUrl,Wr),qo(3),Cs("ngIf",!t.loggedIn),qo(1),Cs("ngIf",t.loggedIn))},directives:[yW,x_,hw,Lh,M_],styles:[".ccf-header[_ngcontent-%COMP%]{height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid;display:flex}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%}.ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%]{height:1.5rem}.ccf-header[_ngcontent-%COMP%] .authentication[_ngcontent-%COMP%]{width:8.25rem;border-radius:.125rem;font-weight:500}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{display:flex;align-items:center;transition:color 1s;cursor:pointer;text-decoration:none}.ccf-header[_ngcontent-%COMP%] [_ngcontent-%COMP%]:not(:last-child){margin-right:1.5rem}.ccf-header[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}.ccf-header[_ngcontent-%COMP%] .filter-labels[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;font:400 1rem/1.25rem Inter,sans-serif}"],changeDetection:0}),e}(),XZ=["bodyUI"];function YZ(e,t){if(1&e&&(Ps(0,"ccf-header",33),Kc(1,"async")),2&e){var n=Hs();Cs("hubmapPortalUrl",Qc(1,2,n.portalUrl$))("loggedIn",n.loggedIn)}}var KZ=function(){return{}},QZ=function(){return{x:2.2,y:2,z:.4}},$Z=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l){m(this,e),this.data=i,this.theming=r,this.scene=o,this.listResultsState=a,this.consentService=s,this.snackbar=u,this.globalConfig=l,this.ontologySelectionLabel="Body",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=dW.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(ue(function(e){return e===dX.Running})),this.portalUrl$=this.globalConfig.getOption("hubmapPortalUrl"),r.initialize(t,n),c.setRootElement(t),i.tissueBlockData$.subscribe(),i.aggregateData$.subscribe(),i.termOccurencesData$.subscribe(),i.sceneData$.subscribe(),i.filter$.subscribe(),i.technologyFilterData$.subscribe(),i.providerFilterData$.subscribe(),this.ontologyTerms$=i.filter$.pipe(mU("ontologyTerms"))}return b(e,[{key:"ngOnInit",value:function(){var e=this,t=this.snackbar.openFromComponent(sW,{data:{preClose:function(){t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia&&(window.matchMedia("(prefers-color-scheme: dark)").matches&&this.theming.setTheme(hW),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(t){e.theming.setTheme(t.matches?hW:lW)}))}},{key:"reset",value:function(e,t,n){e.open(),e.closeExpanded(),t.open(),t.closeExpanded(),n.removeBox(),this.resetView()}},{key:"resetView",value:function(){this.bodyUI.target=[0,0,0],this.bodyUI.rotation=0,this.bodyUI.rotationX=0,this.bodyUI.bounds={x:2.2,y:2,z:.4}}},{key:"toggleScheme",value:function(){this.theming.setTheme(this.theming.getTheme()===lW?hW:lW)}},{key:"ontologySelected",value:function(e){if(e)return this.data.updateFilter({ontologyTerms:e.map(function(e){return e.id})}),this.ontologySelectionLabel=this.createSelectionLabel(e),void(e[0]&&"body"===e[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[]}),this.ontologySelectionLabel=""}},{key:"createSelectionLabel",value:function(e){if(0===e.length)return"";if(1===e.length)return e[0].label;var t="";return e.forEach(function(n,i){t+=n.label,i0}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Es(Ku),Es(os),Es(gX),Es(fW),Es(SX),Es(bX),Es(OG),Es(iw),Es(Qp),Es(tW))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-root"]],viewQuery:function(e,t){var n;(1&e&&hl(XZ,5),2&e)&&(ll(n=dl())&&(t.bodyUI=n.first))},decls:70,vars:77,consts:[[1,"ccf-app","mat-app-background"],["text","Loading CCF Exploration User Interface (EUI)",3,"active"],[3,"hubmapPortalUrl","loggedIn",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","filtersChange"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],[3,"termData","occurenceData","ontologySelection"],["position","end","opened","",1,"right-drawer",3,"stateChange"],["right",""],[1,"portal-view",3,"url","closed"],[1,"drawer-icons"],[1,"drawer-icons-left"],[1,"button",3,"matTooltip","click"],[1,"icon"],[1,"scheme-toggle","button",3,"matTooltip","click"],[1,"button"],["matTooltip","Reset View",1,"refresh","icon",3,"click"],["videoID","YAHJqvD3Q_8","infoTitle","HuBMAP CCF Exploration User Interface","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],[1,"close-button-wrapper"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"hubmapPortalUrl","loggedIn"]],template:function(e,t){if(1&e){var n=Ds();Ts(0,"div",0),Ps(1,"ccf-spinner-overlay",1),Kc(2,"async"),xs(3,YZ,2,4,"ccf-header",2),Kc(4,"async"),Ts(5,"ccf-drawer-container",3),Ts(6,"ccf-drawer",4,5),Fs("stateChange",function(){return mn(n),Ss(11).removeBox()}),Ts(8,"div"),Ts(9,"div",6),Ts(10,"ccf-filters-popover",7,8),Fs("filtersChange",function(e){return t.data.updateFilter(e)}),Kc(12,"async"),Kc(13,"async"),Kc(14,"async"),As(),Ts(15,"div",9),Ts(16,"div",10),ku(17,"Sex: "),Ts(18,"strong"),ku(19),Kc(20,"async"),As(),As(),Ts(21,"div",11),ku(22,"Age: "),Ts(23,"strong"),ku(24),Kc(25,"async"),Kc(26,"async"),As(),As(),Ts(27,"div",12),ku(28,"BMI: "),Ts(29,"strong"),ku(30),Kc(31,"async"),Kc(32,"async"),As(),As(),As(),As(),Ts(33,"ccf-ontology-selection",13),Fs("ontologySelection",function(e){return t.ontologySelected(e)}),Kc(34,"async"),Kc(35,"async"),As(),Ps(36,"ccf-drawer-toggle-button"),As(),As(),Ts(37,"ccf-drawer",14,15),Fs("stateChange",function(){return mn(n),Ss(11).removeBox()}),Ts(39,"ccf-viewer",16),Fs("closed",function(){return t.viewerOpen=!1}),As(),Ts(40,"div",17),Ts(41,"div",18),Ts(42,"button",19),Fs("click",function(){mn(n);var e=Ss(11),t=Ss(38);return e.removeBox(),t.toggleExpanded()}),Ts(43,"mat-icon",20),ku(44),As(),As(),Ts(45,"button",21),Fs("click",function(){return t.toggleScheme()}),Ts(46,"mat-icon",20),ku(47),As(),As(),Ts(48,"button",22),Ts(49,"mat-icon",23),Fs("click",function(){mn(n);var e=Ss(7),i=Ss(38),r=Ss(11);return t.reset(e,i,r)}),ku(50,"refresh "),As(),As(),As(),Ps(51,"ccf-info-button",24),As(),Ts(52,"ccf-results-browser",25),Fs("listResultSelected",function(e){return t.listResultsState.selectListResult(e)})("listResultDeselected",function(e){return t.listResultsState.deselectListResult(e)})("linkClicked",function(e){return t.openiFrameViewer(e)})("itemHovered",function(e){return t.listResultsState.highlightNode(e)})("itemUnhovered",function(){return t.listResultsState.unHighlightNode()}),Kc(53,"async"),Kc(54,"async"),Kc(55,"async"),As(),Ps(56,"ccf-drawer-toggle-button"),As(),Ts(57,"ccf-drawer-content"),Ts(58,"div",26),Ts(59,"ccf-organ-selector",27),Fs("organsChanged",function(e){return t.scene.setSelectedReferenceOrgans(e)}),Kc(60,"async"),Kc(61,"async"),Kc(62,"async"),As(),As(),Ts(63,"div",28),Ts(64,"div",29),Fs("click",function(){return t.organListVisible=!t.organListVisible}),Ts(65,"mat-icon",30),ku(66),As(),As(),As(),Ts(67,"ccf-body-ui",31,32),Fs("nodeClick",function(e){return t.scene.sceneNodeClicked(e)})("nodeHoverStart",function(e){return t.scene.sceneNodeHovered(e)})("nodeHoverStop",function(){return t.scene.sceneNodeUnhover()}),Kc(69,"async"),As(),As(),As(),As()}if(2&e){var i,r,o,a,s=Ss(38);qo(1),Cs("active",Qc(2,37,t.spinnerActive$)),qo(2),Cs("ngIf",!1===Qc(4,39,t.spinnerActive$)),qo(7),Cs("filters",Qc(12,41,t.data.filter$))("drawerExpanded",s.expanded)("technologyFilters",Qc(13,43,t.data.technologyFilterData$))("providerFilters",Qc(14,45,t.data.providerFilterData$)),qo(9),xu(null==(i=Qc(20,47,t.data.filter$))?null:i.sex),qo(5),Eu("",null==(r=Qc(25,49,t.data.filter$))?null:r.ageRange[0],"-",null==(r=Qc(26,51,t.data.filter$))?null:r.ageRange[1],""),qo(6),Eu("",null==(o=Qc(31,53,t.data.filter$))?null:o.bmiRange[0],"-",null==(o=Qc(32,55,t.data.filter$))?null:o.bmiRange[1],""),qo(3),Cs("termData",Qc(34,57,t.data.ontologyTermsFullData$))("occurenceData",Qc(35,59,t.data.termOccurencesData$)),qo(6),su("opened",t.viewerOpen),Cs("url",t.url),qo(3),Cs("matTooltip",s.expanded?"Exit Fullscreen":"Enter Fullscreen"),qo(2),xu(s.expanded?"fullscreen_exit":"fullscreen"),qo(1),Cs("matTooltip","light-theme"===t.theming.getTheme()?"Enter Dark Mode":"Enter Light Mode"),qo(2),Su("","light-theme"===t.theming.getTheme()?"brightness_2":"brightness_5"," "),qo(5),Cs("listResults",Qc(53,61,t.listResultsState.listResults$))("aggregateData",Qc(54,63,t.data.aggregateData$))("resultLabel",t.ontologySelectionLabel)("highlighted",Qc(55,65,t.listResultsState.highlightedNodeId$)),qo(6),su("closed",!t.organListVisible),qo(1),Cs("multiselect",!0)("occurenceData",null!==(a=Qc(60,67,t.data.termOccurencesData$))&&void 0!==a?a:Wc(75,KZ))("organList",Qc(61,69,t.scene.referenceOrgans$))("selectedOrgans",Qc(62,71,t.scene.selectedReferenceOrgans$)),qo(4),su("closed",!t.organListVisible),qo(3),Su(" ",t.organListVisible?"arrow_drop_up":"arrow_drop_down"," "),qo(1),su("expanded-stage",!t.organListVisible),Cs("scene",Qc(69,73,t.scene.scene$))("bounds",Wc(76,QZ))}},directives:[R$,Lh,W$,V$,oZ,wZ,kZ,EZ,hw,x_,JG,HZ,L$,HG,DG,qZ],pipes:[Yh],styles:[".cdk-overlay-container{position:absolute;font-size:1.2rem}[_nghost-%COMP%]{display:block;position:relative}.ccf-app[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;position:relative;text-align:left}.ccf-app[_ngcontent-%COMP%] ccf-header[_ngcontent-%COMP%]{z-index:99}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{flex-grow:1;height:100%;width:100%;opacity:1;overflow:visible;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{overflow:hidden;margin-bottom:1.5rem;border-radius:.5rem;height:100%;padding-bottom:4rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .organ-selector[_ngcontent-%COMP%]{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:28.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%]{display:flex;padding-left:1.5rem;height:5rem;padding-right:1.5rem;align-items:center;justify-content:space-between}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;padding:.65rem;transition:.6s}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5rem;transition:all .5s ease-in-out}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-4.25rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{transition:all .5s ease-in-out;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem;height:calc(100% - 6rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:100%;padding-bottom:3rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;border-top-right-radius:.5rem;border-top-left-radius:.5rem;height:0}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{display:flex;justify-content:center;height:1.0625rem;width:3rem;align-self:center;border-radius:0 0 .25rem .25rem;cursor:pointer;transition:.6s;position:relative;top:.5rem;z-index:1}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{position:relative;bottom:.2rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%]{padding-left:1.5rem;padding-right:1.5rem;height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%]{height:5rem;display:flex;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:75%;margin-left:1.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%]{font-weight:300}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600!important}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view[_ngcontent-%COMP%]{position:fixed;left:0;top:0;bottom:0;right:425%;height:100%;transform:translate(-425%);width:calc(100% - 28.5rem);transition:transform .5s cubic-bezier(.82,.085,.395,.895)}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view.opened[_ngcontent-%COMP%]{transform:translate(0);transition:width 0s .5s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view[_ngcontent-%COMP%]{width:100vw}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view.opened[_ngcontent-%COMP%]{transition:width 0s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .shaded-toggle[_ngcontent-%COMP%]{box-shadow:-1px 0 4px #212121}[_ngcontent-%COMP%]::-webkit-scrollbar{width:7.5rem}"],changeDetection:0}),e}();function ZZ(e,t){1&e&&Ps(0,"ccf-root")}function JZ(e){var t=function(e){return"string"==typeof e},n=function(e){return Array.isArray(e)&&e.every(t)};if("string"==typeof e){var i=I$.json(e);if(n(i))return i}else if(n(e))return e;throw new Error("Invalid data sources")}var eJ=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i){return m(this,n),t.call(this,e,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},dW.dbOptions),globalThis.dbOptions),parse:{dataSources:JZ,useRemoteApi:I$.boolean}})}return n}(M$);return e.\u0275fac=function(t){return new(t||e)(Es(tW),Es(wc))},e.\u0275cmp=Ct({type:e,selectors:[["ccf-root-wc"]],inputs:{dataSources:"dataSources",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[ss],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(e,t){1&e&&xs(0,ZZ,1,0,"ccf-root",0),2&e&&Cs("ngIf",t.initialized)},directives:[Lh,$Z],encapsulation:2,changeDetection:0}),e}(),tJ=function(){var e=function(){function e(t){m(this,e),this.injector=t}return b(e,[{key:"ngDoBootstrap",value:function(){var e=function(e,t){var n=function(e,t){return t.get(Wu).resolveComponentFactory(e).inputs}(e,t.injector),i=t.strategyFactory||new Jp(e,t.injector),r=function(e){var t={};return e.forEach(function(e){var n=e.propName,i=e.templateName;t[function(e){return e.replace(/[A-Z]/g,function(e){return"-".concat(e.toLowerCase())})}(i)]=n}),t}(n),o=function(e){a(u,e);var o=s(u);function u(e){var t;return m(this,u),(t=o.call(this)).injector=e,t}return b(u,[{key:"ngElementStrategy",get:function(){var e=this;if(!this._ngElementStrategy){var r=this._ngElementStrategy=i.create(this.injector||t.injector);n.forEach(function(t){var n=t.propName;if(e.hasOwnProperty(n)){var i=e[n];delete e[n],r.setInputValue(n,i)}})}return this._ngElementStrategy}},{key:"attributeChangedCallback",value:function(e,t,n,i){this.ngElementStrategy.setInputValue(r[e],n)}},{key:"connectedCallback",value:function(){var e=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),e=!0),this.ngElementStrategy.connect(this),e||this.subscribeToEvents()}},{key:"disconnectedCallback",value:function(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}},{key:"subscribeToEvents",value:function(){var e=this;this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(function(t){var n=function(e,t,n){if("function"!=typeof CustomEvent){var i=e.createEvent("CustomEvent");return i.initCustomEvent(t,!1,!1,n),i}return new CustomEvent(t,{bubbles:!1,cancelable:!1,detail:n})}(e.ownerDocument,t.name,t.value);e.dispatchEvent(n)})}}]),u}(tv);return o.observedAttributes=Object.keys(r),n.forEach(function(e){var t=e.propName;Object.defineProperty(o.prototype,t,{get:function(){return this.ngElementStrategy.getInputValue(t)},set:function(e){this.ngElementStrategy.setInputValue(t,e)},configurable:!0,enumerable:!0})}),o}(eJ,{injector:this.injector});customElements.define("ccf-eui",e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Qi(os))},e.\u0275mod=Pt({type:e}),e.\u0275inj=Qe({providers:[{provide:cW,useValue:"light-theme"},{provide:Ap,useExisting:Qp}],imports:[[By,Mf,OX,g$,nK,TK,S_,eK,h$,O$,NG,GG,eW,pw,T$,uW,tw]]}),e}();dW.production&&function(){if(Zl)throw new Error("Cannot enable prod mode after platform setup.");$l=!1}(),Af().bootstrapModule(tJ).catch(function(e){return console.error(e)})},91052:function(e){function t(e,t,n,i,r,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var n=this,i=arguments;return new Promise(function(r,o){var a=e.apply(n,i);function s(e){t(a,r,o,s,u,"next",e)}function u(e){t(a,r,o,s,u,"throw",e)}s(void 0)})}},e.exports.default=e.exports,e.exports.__esModule=!0},61948:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},34321:function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},91741:function(e){function t(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}t.keys=function(){return[]},t.resolve=t,t.id=91741,e.exports=t},9521:function(){},49125:function(){},75307:function(){}},function(e){e(e.s=35090)}])}(); \ No newline at end of file diff --git a/organ-info/index.html b/organ-info/index.html index 19a122757..238fd9ed8 100644 --- a/organ-info/index.html +++ b/organ-info/index.html @@ -5,7 +5,7 @@ - + diff --git a/organ-info/main.js b/organ-info/main.js index 7f1195b65..13307482d 100644 --- a/organ-info/main.js +++ b/organ-info/main.js @@ -1 +1 @@ -var $Ie=Object.defineProperty,WIe=Object.defineProperties,qIe=Object.getOwnPropertyDescriptors,_x=Object.getOwnPropertySymbols,gW=Object.prototype.hasOwnProperty,mW=Object.prototype.propertyIsEnumerable,gr=Math.pow,_W=(jt,it,tt)=>it in jt?$Ie(jt,it,{enumerable:!0,configurable:!0,writable:!0,value:tt}):jt[it]=tt,ht=(jt,it)=>{for(var tt in it||(it={}))gW.call(it,tt)&&_W(jt,tt,it[tt]);if(_x)for(var tt of _x(it))mW.call(it,tt)&&_W(jt,tt,it[tt]);return jt},Vn=(jt,it)=>WIe(jt,qIe(it)),yW=(jt,it)=>{var tt={};for(var gt in jt)gW.call(jt,gt)&&it.indexOf(gt)<0&&(tt[gt]=jt[gt]);if(null!=jt&&_x)for(var gt of _x(jt))it.indexOf(gt)<0&&mW.call(jt,gt)&&(tt[gt]=jt[gt]);return tt};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(jt,it,tt)=>{var gt=tt(52).default;jt.exports=function Y(Ae,he,W){function V($,b){if(!he[$]){if(!Ae[$]){if(L)return L($,!0);var R=new Error("Cannot find module '"+$+"'");throw R.code="MODULE_NOT_FOUND",R}var A=he[$]={exports:{}};Ae[$][0].call(A.exports,function(v){return V(Ae[$][1][v]||v)},A,A.exports,Y,Ae,he,W)}return he[$].exports}for(var L=void 0,re=0;re0&&z[z.length-1])&&(6===Pe[0]||2===Pe[0])){Ue=0;continue}if(3===Pe[0]&&(!z||Pe[1]>z[0]&&Pe[1]0?K-4:K;for(U=0;U>16&255,F[Q++]=I>>8&255,F[Q++]=255&I;return 2===M&&(I=V[j.charCodeAt(U)]<<2|V[j.charCodeAt(U+1)]>>4,F[Q++]=255&I),1===M&&(I=V[j.charCodeAt(U)]<<10|V[j.charCodeAt(U+1)]<<4|V[j.charCodeAt(U+2)]>>2,F[Q++]=I>>8&255,F[Q++]=255&I),F},he.fromByteArray=function(j){for(var I,H=j.length,K=H%3,M=[],F=16383,Q=0,E=H-K;QE?E:Q+F));return 1===K?M.push(W[(I=j[H-1])>>2]+W[I<<4&63]+"=="):2===K&&M.push(W[(I=(j[H-2]<<8)+j[H-1])>>10]+W[I>>4&63]+W[I<<2&63]+"="),M.join("")};for(var W=[],V=[],L="undefined"!=typeof Uint8Array?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,b=re.length;$0)throw new Error("Invalid string. Length must be a multiple of 4");var H=j.indexOf("=");return-1===H&&(H=I),[H,H===I?0:4-H%4]}function y(j){return W[j>>18&63]+W[j>>12&63]+W[j>>6&63]+W[63&j]}function w(j,I,H){for(var M=[],F=I;F>5==6?2:M>>4==14?3:M>>3==30?4:M>>6==2?-1:-2}function A(M){var F=this.lastTotal-this.lastNeed,Q=function(M,F,Q){if(128!=(192&F[0]))return M.lastNeed=0,"\ufffd";if(M.lastNeed>1&&F.length>1){if(128!=(192&F[1]))return M.lastNeed=1,"\ufffd";if(M.lastNeed>2&&F.length>2&&128!=(192&F[2]))return M.lastNeed=2,"\ufffd"}}(this,M);return void 0!==Q?Q:this.lastNeed<=M.length?(M.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(M.copy(this.lastChar,F,0,M.length),void(this.lastNeed-=M.length))}function w(M,F){if((M.length-F)%2==0){var Q=M.toString("utf16le",F);if(Q){var E=Q.charCodeAt(Q.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],Q.slice(0,-1)}return Q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",F,M.length-1)}function D(M){var F=M&&M.length?this.write(M):"";return this.lastNeed?F+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):F}function j(M,F){var Q=(M.length-F)%3;return 0===Q?M.toString("base64",F):(this.lastNeed=3-Q,this.lastTotal=3,1===Q?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",F,M.length-Q))}function I(M){var F=M&&M.length?this.write(M):"";return this.lastNeed?F+this.lastChar.toString("base64",0,3-this.lastNeed):F}function H(M){return M.toString(this.encoding)}function K(M){return M&&M.length?this.write(M):""}he.StringDecoder=$,$.prototype.write=function(M){if(0===M.length)return"";var F,Q;if(this.lastNeed){if(void 0===(F=this.fillLast(M)))return"";Q=this.lastNeed,this.lastNeed=0}else Q=0;return Q=0?(U>0&&(M.lastNeed=U-1),U):--E=0?(U>0&&(M.lastNeed=U-2),U):--E=0?(U>0&&(2===U?U=0:M.lastNeed=U-3),U):0}(this,M,F);if(!this.lastNeed)return M.toString("utf8",F);this.lastTotal=Q;var E=M.length-(Q-this.lastNeed);return M.copy(this.lastChar,0,E),M.toString("utf8",F,E)},$.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length}},{"safe-buffer":4}],6:[function(Y,Ae,he){(function(W){(function(){"use strict";var V=Y("base64-js"),L=Y("ieee754");he.Buffer=S,he.SlowBuffer=function(B){return+B!=B&&(B=0),S.alloc(+B)},he.INSPECT_MAX_BYTES=50;var re=2147483647;function b(B){if(B>re)throw new RangeError('The value "'+B+'" is invalid for option "size"');var O=new Uint8Array(B);return O.__proto__=S.prototype,O}function S(B,O,k){if("number"==typeof B){if("string"==typeof O)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return R(B,O,k)}function R(B,O,k){if("string"==typeof B)return function(B,O){if(("string"!=typeof O||""===O)&&(O="utf8"),!S.isEncoding(O))throw new TypeError("Unknown encoding: "+O);var k=0|M(B,O),Re=b(k),Xe=Re.write(B,O);return Xe!==k&&(Re=Re.slice(0,Xe)),Re}(B,O);if(ArrayBuffer.isView(B))return D(B);if(null==B)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(pt(B,ArrayBuffer)||B&&pt(B.buffer,ArrayBuffer))return function(B,O,k){if(O<0||B.byteLength=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return 0|B}function M(B,O){if(S.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||pt(B,ArrayBuffer))return B.byteLength;if("string"!=typeof B)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var k=B.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===k)return 0;for(var Xe=!1;;)switch(O){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return X(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Pe(B).length;default:if(Xe)return Re?-1:X(B).length;O=(""+O).toLowerCase(),Xe=!0}}function F(B,O,k){var Re=!1;if((void 0===O||O<0)&&(O=0),O>this.length||((void 0===k||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(O>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return Je(this,O,k);case"utf8":case"utf-8":return ye(this,O,k);case"ascii":return nt(this,O,k);case"latin1":case"binary":return Ze(this,O,k);case"base64":return te(this,O,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,O,k);default:if(Re)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Re=!0}}function Q(B,O,k){var Re=B[O];B[O]=B[k],B[k]=Re}function E(B,O,k,Re,Xe){if(0===B.length)return-1;if("string"==typeof k?(Re=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),pe(k=+k)&&(k=Xe?0:B.length-1),k<0&&(k=B.length+k),k>=B.length){if(Xe)return-1;k=B.length-1}else if(k<0){if(!Xe)return-1;k=0}if("string"==typeof O&&(O=S.from(O,Re)),S.isBuffer(O))return 0===O.length?-1:U(B,O,k,Re,Xe);if("number"==typeof O)return O&=255,"function"==typeof Uint8Array.prototype.indexOf?Xe?Uint8Array.prototype.indexOf.call(B,O,k):Uint8Array.prototype.lastIndexOf.call(B,O,k):U(B,[O],k,Re,Xe);throw new TypeError("val must be string, number or Buffer")}function U(B,O,k,Re,Xe){var Hn,yt=1,It=B.length,An=O.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(B.length<2||O.length<2)return-1;yt=2,It/=2,An/=2,k/=2}function Rn(Is,as){return 1===yt?Is[as]:Is.readUInt16BE(as*yt)}if(Xe){var yi=-1;for(Hn=k;HnIt&&(k=It-An),Hn=k;Hn>=0;Hn--){for(var ci=!0,Ur=0;UrXe&&(Re=Xe):Re=Xe;var yt=O.length;Re>yt/2&&(Re=yt/2);for(var It=0;It>8,yt.push(k%256),yt.push(Re);return yt}(O,B.length-k),B,k,Re)}function te(B,O,k){return V.fromByteArray(0===O&&k===B.length?B:B.slice(O,k))}function ye(B,O,k){k=Math.min(B.length,k);for(var Re=[],Xe=O;Xe239?4:yt>223?3:yt>191?2:1;if(Xe+An<=k)switch(An){case 1:yt<128&&(It=yt);break;case 2:128==(192&(Rn=B[Xe+1]))&&(ci=(31&yt)<<6|63&Rn)>127&&(It=ci);break;case 3:Hn=B[Xe+2],128==(192&(Rn=B[Xe+1]))&&128==(192&Hn)&&(ci=(15&yt)<<12|(63&Rn)<<6|63&Hn)>2047&&(ci<55296||ci>57343)&&(It=ci);break;case 4:Hn=B[Xe+2],yi=B[Xe+3],128==(192&(Rn=B[Xe+1]))&&128==(192&Hn)&&128==(192&yi)&&(ci=(15&yt)<<18|(63&Rn)<<12|(63&Hn)<<6|63&yi)>65535&&ci<1114112&&(It=ci)}null===It?(It=65533,An=1):It>65535&&(Re.push((It-=65536)>>>10&1023|55296),It=56320|1023&It),Re.push(It),Xe+=An}return function(B){var O=B.length;if(O<=4096)return String.fromCharCode.apply(String,B);for(var k="",Re=0;Rek&&(O+=" ... "),""},S.prototype.compare=function(O,k,Re,Xe,yt){if(pt(O,Uint8Array)&&(O=S.from(O,O.offset,O.byteLength)),!S.isBuffer(O))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof O);if(void 0===k&&(k=0),void 0===Re&&(Re=O?O.length:0),void 0===Xe&&(Xe=0),void 0===yt&&(yt=this.length),k<0||Re>O.length||Xe<0||yt>this.length)throw new RangeError("out of range index");if(Xe>=yt&&k>=Re)return 0;if(Xe>=yt)return-1;if(k>=Re)return 1;if(this===O)return 0;for(var It=(yt>>>=0)-(Xe>>>=0),An=(Re>>>=0)-(k>>>=0),Rn=Math.min(It,An),Hn=this.slice(Xe,yt),yi=O.slice(k,Re),ci=0;ci>>=0,isFinite(Re)?(Re>>>=0,void 0===Xe&&(Xe="utf8")):(Xe=Re,Re=void 0)}var yt=this.length-k;if((void 0===Re||Re>yt)&&(Re=yt),O.length>0&&(Re<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");Xe||(Xe="utf8");for(var It=!1;;)switch(Xe){case"hex":return ie(this,O,k,Re);case"utf8":case"utf-8":return ue(this,O,k,Re);case"ascii":return ee(this,O,k,Re);case"latin1":case"binary":return se(this,O,k,Re);case"base64":return Te(this,O,k,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,O,k,Re);default:if(It)throw new TypeError("Unknown encoding: "+Xe);Xe=(""+Xe).toLowerCase(),It=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(B,O,k){var Re="";k=Math.min(B.length,k);for(var Xe=O;XeRe)&&(k=Re);for(var Xe="",yt=O;ytk)throw new RangeError("Trying to access beyond buffer length")}function Le(B,O,k,Re,Xe,yt){if(!S.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>Xe||OB.length)throw new RangeError("Index out of range")}function Ee(B,O,k,Re,Xe,yt){if(k+Re>B.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Oe(B,O,k,Re,Xe){return O=+O,k>>>=0,Xe||Ee(B,0,k,4),L.write(B,O,k,Re,23,4),k+4}function Ue(B,O,k,Re,Xe){return O=+O,k>>>=0,Xe||Ee(B,0,k,8),L.write(B,O,k,Re,52,8),k+8}S.prototype.slice=function(O,k){var Re=this.length;(O=~~O)<0?(O+=Re)<0&&(O=0):O>Re&&(O=Re),(k=void 0===k?Re:~~k)<0?(k+=Re)<0&&(k=0):k>Re&&(k=Re),k>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O],yt=1,It=0;++It>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O+--k],yt=1;k>0&&(yt*=256);)Xe+=this[O+--k]*yt;return Xe},S.prototype.readUInt8=function(O,k){return O>>>=0,k||je(O,1,this.length),this[O]},S.prototype.readUInt16LE=function(O,k){return O>>>=0,k||je(O,2,this.length),this[O]|this[O+1]<<8},S.prototype.readUInt16BE=function(O,k){return O>>>=0,k||je(O,2,this.length),this[O]<<8|this[O+1]},S.prototype.readUInt32LE=function(O,k){return O>>>=0,k||je(O,4,this.length),(this[O]|this[O+1]<<8|this[O+2]<<16)+16777216*this[O+3]},S.prototype.readUInt32BE=function(O,k){return O>>>=0,k||je(O,4,this.length),16777216*this[O]+(this[O+1]<<16|this[O+2]<<8|this[O+3])},S.prototype.readIntLE=function(O,k,Re){O>>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O],yt=1,It=0;++It=(yt*=128)&&(Xe-=Math.pow(2,8*k)),Xe},S.prototype.readIntBE=function(O,k,Re){O>>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=k,yt=1,It=this[O+--Xe];Xe>0&&(yt*=256);)It+=this[O+--Xe]*yt;return It>=(yt*=128)&&(It-=Math.pow(2,8*k)),It},S.prototype.readInt8=function(O,k){return O>>>=0,k||je(O,1,this.length),128&this[O]?-1*(255-this[O]+1):this[O]},S.prototype.readInt16LE=function(O,k){O>>>=0,k||je(O,2,this.length);var Re=this[O]|this[O+1]<<8;return 32768&Re?4294901760|Re:Re},S.prototype.readInt16BE=function(O,k){O>>>=0,k||je(O,2,this.length);var Re=this[O+1]|this[O]<<8;return 32768&Re?4294901760|Re:Re},S.prototype.readInt32LE=function(O,k){return O>>>=0,k||je(O,4,this.length),this[O]|this[O+1]<<8|this[O+2]<<16|this[O+3]<<24},S.prototype.readInt32BE=function(O,k){return O>>>=0,k||je(O,4,this.length),this[O]<<24|this[O+1]<<16|this[O+2]<<8|this[O+3]},S.prototype.readFloatLE=function(O,k){return O>>>=0,k||je(O,4,this.length),L.read(this,O,!0,23,4)},S.prototype.readFloatBE=function(O,k){return O>>>=0,k||je(O,4,this.length),L.read(this,O,!1,23,4)},S.prototype.readDoubleLE=function(O,k){return O>>>=0,k||je(O,8,this.length),L.read(this,O,!0,52,8)},S.prototype.readDoubleBE=function(O,k){return O>>>=0,k||je(O,8,this.length),L.read(this,O,!1,52,8)},S.prototype.writeUIntLE=function(O,k,Re,Xe){O=+O,k>>>=0,Re>>>=0,Xe||Le(this,O,k,Re,Math.pow(2,8*Re)-1,0);var It=1,An=0;for(this[k]=255&O;++An>>=0,Re>>>=0,Xe||Le(this,O,k,Re,Math.pow(2,8*Re)-1,0);var It=Re-1,An=1;for(this[k+It]=255&O;--It>=0&&(An*=256);)this[k+It]=O/An&255;return k+Re},S.prototype.writeUInt8=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,1,255,0),this[k]=255&O,k+1},S.prototype.writeUInt16LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,65535,0),this[k]=255&O,this[k+1]=O>>>8,k+2},S.prototype.writeUInt16BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,65535,0),this[k]=O>>>8,this[k+1]=255&O,k+2},S.prototype.writeUInt32LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,4294967295,0),this[k+3]=O>>>24,this[k+2]=O>>>16,this[k+1]=O>>>8,this[k]=255&O,k+4},S.prototype.writeUInt32BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,4294967295,0),this[k]=O>>>24,this[k+1]=O>>>16,this[k+2]=O>>>8,this[k+3]=255&O,k+4},S.prototype.writeIntLE=function(O,k,Re,Xe){if(O=+O,k>>>=0,!Xe){var yt=Math.pow(2,8*Re-1);Le(this,O,k,Re,yt-1,-yt)}var It=0,An=1,Rn=0;for(this[k]=255&O;++It>0)-Rn&255;return k+Re},S.prototype.writeIntBE=function(O,k,Re,Xe){if(O=+O,k>>>=0,!Xe){var yt=Math.pow(2,8*Re-1);Le(this,O,k,Re,yt-1,-yt)}var It=Re-1,An=1,Rn=0;for(this[k+It]=255&O;--It>=0&&(An*=256);)O<0&&0===Rn&&0!==this[k+It+1]&&(Rn=1),this[k+It]=(O/An>>0)-Rn&255;return k+Re},S.prototype.writeInt8=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,1,127,-128),O<0&&(O=255+O+1),this[k]=255&O,k+1},S.prototype.writeInt16LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,32767,-32768),this[k]=255&O,this[k+1]=O>>>8,k+2},S.prototype.writeInt16BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,32767,-32768),this[k]=O>>>8,this[k+1]=255&O,k+2},S.prototype.writeInt32LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,2147483647,-2147483648),this[k]=255&O,this[k+1]=O>>>8,this[k+2]=O>>>16,this[k+3]=O>>>24,k+4},S.prototype.writeInt32BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,2147483647,-2147483648),O<0&&(O=4294967295+O+1),this[k]=O>>>24,this[k+1]=O>>>16,this[k+2]=O>>>8,this[k+3]=255&O,k+4},S.prototype.writeFloatLE=function(O,k,Re){return Oe(this,O,k,!0,Re)},S.prototype.writeFloatBE=function(O,k,Re){return Oe(this,O,k,!1,Re)},S.prototype.writeDoubleLE=function(O,k,Re){return Ue(this,O,k,!0,Re)},S.prototype.writeDoubleBE=function(O,k,Re){return Ue(this,O,k,!1,Re)},S.prototype.copy=function(O,k,Re,Xe){if(!S.isBuffer(O))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Xe&&0!==Xe&&(Xe=this.length),k>=O.length&&(k=O.length),k||(k=0),Xe>0&&Xe=this.length)throw new RangeError("Index out of range");if(Xe<0)throw new RangeError("sourceEnd out of bounds");Xe>this.length&&(Xe=this.length),O.length-k=0;--It)O[It+k]=this[It+Re];else Uint8Array.prototype.set.call(O,this.subarray(Re,Xe),k);return yt},S.prototype.fill=function(O,k,Re,Xe){if("string"==typeof O){if("string"==typeof k?(Xe=k,k=0,Re=this.length):"string"==typeof Re&&(Xe=Re,Re=this.length),void 0!==Xe&&"string"!=typeof Xe)throw new TypeError("encoding must be a string");if("string"==typeof Xe&&!S.isEncoding(Xe))throw new TypeError("Unknown encoding: "+Xe);if(1===O.length){var yt=O.charCodeAt(0);("utf8"===Xe&&yt<128||"latin1"===Xe)&&(O=yt)}}else"number"==typeof O&&(O&=255);if(k<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,O||(O=0),"number"==typeof O)for(It=k;It55295&&k<57344){if(!Xe){if(k>56319){(O-=3)>-1&&yt.push(239,191,189);continue}if(It+1===Re){(O-=3)>-1&&yt.push(239,191,189);continue}Xe=k;continue}if(k<56320){(O-=3)>-1&&yt.push(239,191,189),Xe=k;continue}k=65536+(Xe-55296<<10|k-56320)}else Xe&&(O-=3)>-1&&yt.push(239,191,189);if(Xe=null,k<128){if((O-=1)<0)break;yt.push(k)}else if(k<2048){if((O-=2)<0)break;yt.push(k>>6|192,63&k|128)}else if(k<65536){if((O-=3)<0)break;yt.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((O-=4)<0)break;yt.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return yt}function Pe(B){return V.toByteArray(function(B){if((B=(B=B.split("=")[0]).trim().replace(qe,"")).length<2)return"";for(;B.length%4!=0;)B+="=";return B}(B))}function Et(B,O,k,Re){for(var Xe=0;Xe=O.length||Xe>=B.length);++Xe)O[Xe+k]=B[Xe];return Xe}function pt(B,O){return B instanceof O||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===O.name}function pe(B){return B!=B}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Ae,he){"use strict";Ae.exports=function W(V){return null===V||"object"!=typeof V||null!=V.toJSON?JSON.stringify(V):Array.isArray(V)?"["+V.reduce((L,re,$)=>L+(0===$?"":",")+W(void 0===re||"symbol"==typeof re?null:re),"")+"]":"{"+Object.keys(V).sort().reduce((L,re,$)=>void 0===V[re]||"symbol"==typeof V[re]?L:L+(0===L.length?"":",")+W(re)+":"+W(V[re]),"")+"}"}},{}],8:[function(Y,Ae,he){"use strict";var L,W="object"==typeof Reflect?Reflect:null,V=W&&"function"==typeof W.apply?W.apply:function(U,ie,ue){return Function.prototype.apply.call(U,ie,ue)};L=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:function(U){return Object.getOwnPropertyNames(U)};var $=Number.isNaN||function(U){return U!=U};function b(){b.init.call(this)}Ae.exports=b,Ae.exports.once=function(E,U){return new Promise(function(ie,ue){function ee(Te){E.removeListener(U,se),ue(Te)}function se(){"function"==typeof E.removeListener&&E.removeListener("error",ee),ie([].slice.call(arguments))}Q(E,U,se,{once:!0}),"error"!==U&&function(E,U,ie){"function"==typeof E.on&&Q(E,"error",U,ie)}(E,ee,{once:!0})})},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var S=10;function R(E){if("function"!=typeof E)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function A(E){return void 0===E._maxListeners?b.defaultMaxListeners:E._maxListeners}function v(E,U,ie,ue){var ee,se,Te;if(R(ie),void 0===(se=E._events)?(se=E._events=Object.create(null),E._eventsCount=0):(void 0!==se.newListener&&(E.emit("newListener",U,ie.listener?ie.listener:ie),se=E._events),Te=se[U]),void 0===Te)Te=se[U]=ie,++E._eventsCount;else if("function"==typeof Te?Te=se[U]=ue?[ie,Te]:[Te,ie]:ue?Te.unshift(ie):Te.push(ie),(ee=A(E))>0&&Te.length>ee&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=U,me.count=Te.length,function(E){console&&console.warn&&console.warn(E)}(me)}return E}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(E,U,ie){var ue={fired:!1,wrapFn:void 0,target:E,type:U,listener:ie},ee=y.bind(ue);return ee.listener=ie,ue.wrapFn=ee,ee}function D(E,U,ie){var ue=E._events;if(void 0===ue)return[];var ee=ue[U];return void 0===ee?[]:"function"==typeof ee?ie?[ee.listener||ee]:[ee]:ie?function(E){for(var U=new Array(E.length),ie=0;ie0&&(Te=ie[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var te=se[U];if(void 0===te)return!1;if("function"==typeof te)V(te,this,ie);else{var ye=te.length,Me=I(te,ye);for(ue=0;ue=0;Te--)if(ue[Te]===ie||ue[Te].listener===ie){me=ue[Te].listener,se=Te;break}if(se<0)return this;0===se?ue.shift():function(E,U){for(;U+1=0;ee--)this.removeListener(U,ie[ee]);return this},b.prototype.listeners=function(U){return D(this,U,!0)},b.prototype.rawListeners=function(U){return D(this,U,!1)},b.listenerCount=function(E,U){return"function"==typeof E.listenerCount?E.listenerCount(U):j.call(E,U)},b.prototype.listenerCount=j,b.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},{}],9:[function(Y,Ae,he){he.read=function(W,V,L,re,$){var b,S,R=8*$-re-1,A=(1<>1,y=-7,w=L?$-1:0,D=L?-1:1,j=W[V+w];for(w+=D,b=j&(1<<-y)-1,j>>=-y,y+=R;y>0;b=256*b+W[V+w],w+=D,y-=8);for(S=b&(1<<-y)-1,b>>=-y,y+=re;y>0;S=256*S+W[V+w],w+=D,y-=8);if(0===b)b=1-v;else{if(b===A)return S?NaN:1/0*(j?-1:1);S+=Math.pow(2,re),b-=v}return(j?-1:1)*S*Math.pow(2,b-re)},he.write=function(W,V,L,re,$,b){var S,R,A,v=8*b-$-1,y=(1<>1,D=23===$?Math.pow(2,-24)-Math.pow(2,-77):0,j=re?0:b-1,I=re?1:-1,H=V<0||0===V&&1/V<0?1:0;for(V=Math.abs(V),isNaN(V)||V===1/0?(R=isNaN(V)?1:0,S=y):(S=Math.floor(Math.log(V)/Math.LN2),V*(A=Math.pow(2,-S))<1&&(S--,A*=2),(V+=S+w>=1?D/A:D*Math.pow(2,1-w))*A>=2&&(S++,A/=2),S+w>=y?(R=0,S=y):S+w>=1?(R=(V*A-1)*Math.pow(2,$),S+=w):(R=V*Math.pow(2,w-1)*Math.pow(2,$),S=0));$>=8;W[L+j]=255&R,j+=I,R/=256,$-=8);for(S=S<<$|R,v+=$;v>0;W[L+j]=255&S,j+=I,S/=256,v-=8);W[L+j-I]|=128*H}},{}],10:[function(Y,Ae,he){Ae.exports="function"==typeof Object.create?function(V,L){L&&(V.super_=L,V.prototype=Object.create(L.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}))}:function(V,L){if(L){V.super_=L;var re=function(){};re.prototype=L.prototype,V.prototype=new re,V.prototype.constructor=V}}},{}],11:[function(Y,Ae,he){"use strict";const{isArray:W,isObject:V,isString:L}=Y("./types"),{asArray:re}=Y("./util"),{prependBase:$}=Y("./url"),b=Y("./JsonLdError"),S=Y("./ResolvedContext");function A(y){throw new b("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function v({context:y,base:w}){if(!y)return;const D=y["@context"];if(L(D))y["@context"]=$(w,D);else if(W(D))for(let j=0;j10)throw new b("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"loading remote context failed":"context overflow",max:10});if(I.has(D))throw new b("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"recursive context inclusion":"context overflow",url:D});let H,K;I.add(D);try{K=yield j(D),H=K.document||null,L(H)&&(H=JSON.parse(H))}catch(M){throw new b("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:D,cause:M})}if(!V(H))throw new b("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:D});return H="@context"in H?{"@context":H["@context"]}:{"@context":{}},K.contextUrl&&(W(H["@context"])||(H["@context"]=[H["@context"]]),H["@context"].push(K.contextUrl)),{context:H,remoteDoc:K}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Ae,he){"use strict";Ae.exports=class extends Error{constructor(V="An unspecified JSON-LD error occurred.",L="jsonld.Error",re={}){super(V),this.name=L,this.message=V,this.details=re}}},{}],13:[function(Y,Ae,he){"use strict";Ae.exports=W=>{class V{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(V,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(V.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:V}),V.compact=function(L,re){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(L,re)},V.expand=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(L)},V.flatten=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(L)},V}},{}],14:[function(Y,Ae,he){"use strict";Ae.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Ae,he){"use strict";Ae.exports=class{constructor(){this._requests={}}wrapLoader(V){const L=this;return L._loader=V,function(){return L.add.apply(L,arguments)}}add(V){var L=this;return gt(function*(){let re=L._requests[V];if(re)return Promise.resolve(re);re=L._requests[V]=L._loader(V);try{return yield re}finally{delete L._requests[V]}})()}}},{}],16:[function(Y,Ae,he){"use strict";const W=Y("lru-cache");Ae.exports=class{constructor({document:re}){this.document=re,this.cache=new W({max:10})}getProcessed(re){return this.cache.get(re)}setProcessed(re,$){this.cache.set(re,$)}}},{"lru-cache":33}],17:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),{isArray:V,isObject:L,isString:re,isUndefined:$}=Y("./types"),{isList:b,isValue:S,isGraph:R,isSimpleGraph:A,isSubjectReference:v}=Y("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:D,process:j,processingMode:I}=Y("./context"),{removeBase:H,prependBase:K}=Y("./url"),{addValue:M,asArray:F,compareShortestLeast:Q}=Y("./util"),E={};function ie(ue,ee,se){if("@nest"!==y(ue,ee,{vocab:!0},se))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ae.exports=E,E.compact=function(){var ue=gt(function*({activeCtx:ee,activeProperty:se=null,element:Te,options:me={},compactionMap:te=(()=>{})}){if(V(Te)){let Me=[];for(let Ve=0;Ve1&&(Je=Array.from(Je).sort());const Ke=ee;for(const Le of Je){const Ee=E.compactIri({activeCtx:Ke,iri:Le,relativeTo:{vocab:!0}}),Oe=w(nt,Ee,"@context");$(Oe)||(ee=yield j({activeCtx:ee,localCtx:Oe,options:me,propagate:!1}))}const je=Object.keys(Te).sort();for(const Le of je){const Ee=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&D(Le)){const Oe=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Oe,Ee)}else{if(!V(Ee))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ee.length){const Oe=E.compactIri({activeCtx:ee,iri:Le,value:Ee,relativeTo:{vocab:!0},reverse:Me}),Ue=ee.mappings.has(Oe)?ee.mappings.get(Oe)["@nest"]:null;let qe=Ve;Ue&&(ie(ee,Ue,me),L(Ve[Ue])||(Ve[Ue]={}),qe=Ve[Ue]),M(qe,Oe,Ee,{propertyIsArray:!0})}for(const Oe of Ee){const Ue=E.compactIri({activeCtx:ee,iri:Le,value:Oe,relativeTo:{vocab:!0},reverse:Me}),qe=ee.mappings.has(Ue)?ee.mappings.get(Ue)["@nest"]:null;let Be=Ve;qe&&(ie(ee,qe,me),L(Ve[qe])||(Ve[qe]={}),Be=Ve[qe]);const z=w(ee,Ue,"@container")||[],X=R(Oe),be=b(Oe);let ce;be?ce=Oe["@list"]:X&&(ce=Oe["@graph"]);let Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:be||X?ce:Oe,options:me,compactionMap:te});if(be){if(V(Pe)||(Pe=[Pe]),z.includes("@list")){M(Be,Ue,Pe,{valueIsArray:!0,allowDuplicate:!0});continue}Pe={[E.compactIri({activeCtx:ee,iri:"@list",relativeTo:{vocab:!0}})]:Pe},"@index"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Oe["@index"])}if(X)if(z.includes("@graph")&&(z.includes("@id")||z.includes("@index")&&A(Oe))){let Et;Be.hasOwnProperty(Ue)?Et=Be[Ue]:Be[Ue]=Et={};const pt=(z.includes("@id")?Oe["@id"]:Oe["@index"])||E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}});M(Et,pt,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})}else z.includes("@graph")&&A(Oe)?(V(Pe)&&Pe.length>1&&(Pe={"@included":Pe}),M(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})):(V(Pe)&&1===Pe.length&&me.compactArrays&&(Pe=Pe[0]),Pe={[E.compactIri({activeCtx:ee,iri:"@graph",relativeTo:{vocab:!0}})]:Pe},"@id"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Oe["@id"]),"@index"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Oe["@index"]),M(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")}));else if(z.includes("@language")||z.includes("@index")||z.includes("@id")||z.includes("@type")){let Et,pt;if(Be.hasOwnProperty(Ue)?Et=Be[Ue]:Be[Ue]=Et={},z.includes("@language"))S(Pe)&&(Pe=Pe["@value"]),pt=Oe["@language"];else if(z.includes("@index")){const pe=w(ee,Ue,"@index")||"@index",B=E.compactIri({activeCtx:ee,iri:pe,relativeTo:{vocab:!0}});if("@index"===pe)pt=Oe["@index"],delete Pe[B];else{let O;if([pt,...O]=F(Pe[pe]||[]),re(pt))switch(O.length){case 0:delete Pe[pe];break;case 1:Pe[pe]=O[0];break;default:Pe[pe]=O}else pt=null}}else if(z.includes("@id")){const pe=E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}});pt=Pe[pe],delete Pe[pe]}else if(z.includes("@type")){const pe=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=F(Pe[pe]||[]),B.length){case 0:delete Pe[pe];break;case 1:Pe[pe]=B[0];break;default:Pe[pe]=B}1===Object.keys(Pe).length&&"@id"in Oe&&(Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:{"@id":Oe["@id"]},options:me,compactionMap:te}))}pt||(pt=E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}})),M(Et,pt,Pe,{propertyIsArray:z.includes("@set")})}else{const Et=!me.compactArrays||z.includes("@set")||z.includes("@list")||V(Pe)&&0===Pe.length||"@list"===Le||"@graph"===Le;M(Be,Ue,Pe,{propertyIsArray:Et})}}}else{if((w(ee,se,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Ue,Ee)}else{const Oe=yield E.compact({activeCtx:ee,activeProperty:se,element:Ee,options:me,compactionMap:te});V(Oe)&&0===Oe.length||M(Ve,Le,Oe)}else{const Oe=yield E.compact({activeCtx:ee,activeProperty:"@reverse",element:Ee,options:me,compactionMap:te});for(const Ue in Oe)if(ee.mappings.has(Ue)&&ee.mappings.get(Ue).reverse){const qe=Oe[Ue],z=(w(ee,Ue,"@container")||[]).includes("@set")||!me.compactArrays;M(Ve,Ue,qe,{propertyIsArray:z}),delete Oe[Ue]}if(Object.keys(Oe).length>0){const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Ue,Oe)}}else{let Oe=F(Ee).map(X=>E.compactIri({activeCtx:nt,iri:X,relativeTo:{vocab:!0}}));1===Oe.length&&(Oe=Oe[0]);const Ue=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}}),z=(w(ee,Ue,"@container")||[]).includes("@set")&&I(ee,1.1)||V(Oe)&&0===Ee.length;M(Ve,Ue,Oe,{propertyIsArray:z})}else{let Oe=F(Ee).map(qe=>E.compactIri({activeCtx:ee,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Oe.length&&(Oe=Oe[0]),Ve[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Oe}}return Ve}return Te});return function(ee){return ue.apply(this,arguments)}}(),E.compactIri=({activeCtx:ue,iri:ee,value:se=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:te=null})=>{if(null===ee)return ee;ue.isPropertyTermScoped&&ue.previousContext&&(ue=ue.previousContext);const ye=ue.getInverse();if(D(ee)&&ee in ye&&"@none"in ye[ee]&&"@type"in ye[ee]["@none"]&&"@none"in ye[ee]["@none"]["@type"])return ye[ee]["@none"]["@type"]["@none"];if(Te.vocab&&ee in ye){const Je=ue["@language"]||"@none",Ke=[];L(se)&&"@index"in se&&!("@graph"in se)&&Ke.push("@index","@index@set"),L(se)&&"@preserve"in se&&(se=se["@preserve"][0]),R(se)?("@index"in se&&Ke.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se&&Ke.push("@graph@id","@graph@id@set"),Ke.push("@graph","@graph@set","@set"),"@index"in se||Ke.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se||Ke.push("@graph@id","@graph@id@set")):L(se)&&!S(se)&&Ke.push("@id","@id@set","@type","@set@type");let je="@language",Le="@null";if(me)je="@type",Le="@reverse",Ke.push("@set");else if(b(se)){"@index"in se||Ke.push("@list");const Oe=se["@list"];if(0===Oe.length)je="@any",Le="@none";else{let Ue=0===Oe.length?Je:null,qe=null;for(let Be=0;Bent.includes("_"));Ve&&ye.push(Ve.replace(/^[^_]+_/,"_"))}ye.push("@none");const Me=ue.inverse[ee];for(const Ve of Te){if(!(Ve in Me))continue;const nt=Me[Ve][me];for(const Ze of ye)if(Ze in nt)return nt[Ze]}return null}(ue,ee,se,Ke,je,Le);if(null!==Ee)return Ee}if(Te.vocab&&"@vocab"in ue){const Je=ue["@vocab"];if(0===ee.indexOf(Je)&&ee!==Je){const Ke=ee.substr(Je.length);if(!ue.mappings.has(Ke))return Ke}}let Me=null;const Ve=[];let nt=ue.fastCurieMap;const Ze=ee.length-1;for(let Je=0;Je=0;--Je){const Ke=Ve[Je],je=Ke.terms;for(const Le of je){const Ee=Le+":"+ee.substr(Ke.iri.length);ue.mappings.get(Le)._prefix&&(!ue.mappings.has(Ee)||null===se&&ue.mappings.get(Ee)["@id"]===ee)&&(null===Me||Q(Ee,Me)<0)&&(Me=Ee)}}if(null!==Me)return Me;for(const[Je,Ke]of ue.mappings)if(Ke&&Ke._prefix&&ee.startsWith(Je+":"))throw new W(`Absolute IRI "${ee}" confused with prefix "${Je}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ue});return Te.vocab?ee:"@base"in ue?ue["@base"]?H(K(te,ue["@base"]),ee):ee:H(te,ee)},E.compactValue=({activeCtx:ue,activeProperty:ee,value:se,options:Te})=>{if(S(se)){const Me=w(ue,ee,"@type"),Ve=w(ue,ee,"@language"),nt=w(ue,ee,"@direction"),Ze=w(ue,ee,"@container")||[],Je="@index"in se&&!Ze.includes("@index");if(!Je&&"@none"!==Me&&(se["@type"]===Me||"@language"in se&&se["@language"]===Ve&&"@direction"in se&&se["@direction"]===nt||"@language"in se&&se["@language"]===Ve||"@direction"in se&&se["@direction"]===nt))return se["@value"];const Ke=Object.keys(se).length,je=1===Ke||2===Ke&&"@index"in se&&!Je,Le="@language"in ue,Ee=re(se["@value"]),Oe=ue.mappings.has(ee)&&null===ue.mappings.get(ee)["@language"];if(je&&"@none"!==Me&&(!Le||!Ee||Oe))return se["@value"];const Ue={};return Je&&(Ue[E.compactIri({activeCtx:ue,iri:"@index",relativeTo:{vocab:!0}})]=se["@index"]),"@type"in se?Ue[E.compactIri({activeCtx:ue,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ue,iri:se["@type"],relativeTo:{vocab:!0}}):"@language"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@language",relativeTo:{vocab:!0}})]=se["@language"]),"@direction"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@direction",relativeTo:{vocab:!0}})]=se["@direction"]),Ue[E.compactIri({activeCtx:ue,iri:"@value",relativeTo:{vocab:!0}})]=se["@value"],Ue}const me=y(ue,ee,{vocab:!0},Te),te=w(ue,ee,"@type"),ye=E.compactIri({activeCtx:ue,iri:se["@id"],relativeTo:{vocab:"@vocab"===te},base:Te.base});return"@id"===te||"@vocab"===te||"@graph"===me?ye:{[E.compactIri({activeCtx:ue,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Ae,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#";Ae.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:W,RDF_LIST:W+"List",RDF_FIRST:W+"first",RDF_REST:W+"rest",RDF_NIL:W+"nil",RDF_TYPE:W+"type",RDF_PLAIN_LITERAL:W+"PlainLiteral",RDF_XML_LITERAL:W+"XMLLiteral",RDF_JSON_LITERAL:W+"JSON",RDF_OBJECT:W+"object",RDF_LANGSTRING:W+"langString",XSD:V,XSD_BOOLEAN:V+"boolean",XSD_DOUBLE:V+"double",XSD_INTEGER:V+"integer",XSD_STRING:V+"string"}},{}],19:[function(Y,Ae,he){"use strict";const W=Y("./util"),V=Y("./JsonLdError"),{isArray:L,isObject:re,isString:$,isUndefined:b}=Y("./types"),{isAbsolute:S,isRelative:R,prependBase:A}=Y("./url"),{asArray:v,compareShortestLeast:y}=Y("./util"),w=new Map,j=/^@[a-zA-Z]+$/,I={};function H(M,F,Q,E,U,ie){if(null===F||!$(F)||I.isKeyword(F))return F;if(F.match(j))return null;if(E&&E.hasOwnProperty(F)&&!0!==U.get(F)&&I.createTermDefinition({activeCtx:M,localCtx:E,term:F,defined:U,options:ie}),(Q=Q||{}).vocab){const ee=M.mappings.get(F);if(null===ee)return null;if(re(ee)&&"@id"in ee)return ee["@id"]}const ue=F.indexOf(":");if(ue>0){const ee=F.substr(0,ue),se=F.substr(ue+1);if("_"===ee||0===se.indexOf("//"))return F;E&&E.hasOwnProperty(ee)&&I.createTermDefinition({activeCtx:M,localCtx:E,term:ee,defined:U,options:ie});const Te=M.mappings.get(ee);if(Te&&Te._prefix)return Te["@id"]+se;if(S(F))return F}if(Q.vocab&&"@vocab"in M)return M["@vocab"]+F;if(Q.base&&"@base"in M){if(M["@base"])return A(A(ie.base,M["@base"]),F)}else if(Q.base)return A(ie.base,F);return F}function K(M,F){if(!M||"object"!=typeof M||!F||"object"!=typeof F)return M===F;const Q=Array.isArray(M);if(Q!==Array.isArray(F))return!1;if(Q){if(M.length!==F.length)return!1;for(let ie=0;ie{if(E.has(Q)){if(E.get(Q))return;throw new V("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:F,term:Q})}let ue;if(E.set(Q,!1),F.hasOwnProperty(Q)&&(ue=F[Q]),"@type"===Q&&re(ue)&&"@set"===(ue["@container"]||"@set")&&I.processingMode(M,1.1)){const Me=["@container","@id","@protected"],Ve=Object.keys(ue);if(0===Ve.length||Ve.some(nt=>!Me.includes(nt)))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q})}else{if(I.isKeyword(Q))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q});if(Q.match(j))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:Q});if(""===Q)throw new V("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:F})}const ee=M.mappings.get(Q);M.mappings.has(Q)&&M.mappings.delete(Q);let se=!1;if(($(ue)||null===ue)&&(se=!0,ue={"@id":ue}),!re(ue))throw new V("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:F});const Te={};M.mappings.set(Q,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];I.processingMode(M,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Me in ue)if(!me.includes(Me))throw new V("Invalid JSON-LD syntax; a term definition must not contain "+Me,"jsonld.SyntaxError",{code:"invalid term definition",context:F});const te=Q.indexOf(":");if(Te._termHasColon=te>0,"@reverse"in ue){if("@id"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});if("@nest"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});const Me=ue["@reverse"];if(!$(Me))throw new V("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(!I.isKeyword(Me)&&Me.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Me}),void(ee?M.mappings.set(Q,ee):M.mappings.delete(Q));const Ve=H(M,Me,{vocab:!0,base:!1},F,E,U);if(!S(Ve))throw new V("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:F});Te["@id"]=Ve,Te.reverse=!0}else if("@id"in ue){let Me=ue["@id"];if(Me&&!$(Me))throw new V("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(null===Me)Te["@id"]=null;else{if(!I.isKeyword(Me)&&Me.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Me}),void(ee?M.mappings.set(Q,ee):M.mappings.delete(Q));if(Me!==Q){if(Me=H(M,Me,{vocab:!0,base:!1},F,E,U),!S(Me)&&!I.isKeyword(Me))throw new V("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:F});if(Q.match(/(?::[^:])|\//)&&H(M,Q,{vocab:!0,base:!1},F,new Map(E).set(Q,!0),U)!==Me)throw new V("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});Te["@id"]=Me,Te._prefix=se&&!Te._termHasColon&&Me.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const Me=Q.substr(0,te);if(F.hasOwnProperty(Me)&&I.createTermDefinition({activeCtx:M,localCtx:F,term:Me,defined:E,options:U}),M.mappings.has(Me)){const Ve=Q.substr(te+1);Te["@id"]=M.mappings.get(Me)["@id"]+Ve}else Te["@id"]=Q}else if("@type"===Q)Te["@id"]=Q;else{if(!("@vocab"in M))throw new V("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F,term:Q});Te["@id"]=M["@vocab"]+Q}if((!0===ue["@protected"]||!0===E.get("@protected")&&!1!==ue["@protected"])&&(M.protected[Q]=!0,Te.protected=!0),E.set(Q,!0),"@type"in ue){let Me=ue["@type"];if(!$(Me))throw new V("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if("@json"===Me||"@none"===Me){if(I.processingMode(M,1))throw new V(`Invalid JSON-LD syntax; an @context @type value must not be "${Me}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else if("@id"!==Me&&"@vocab"!==Me){if(Me=H(M,Me,{vocab:!0,base:!1},F,E,U),!S(Me))throw new V("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if(0===Me.indexOf("_:"))throw new V("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}Te["@type"]=Me}if("@container"in ue){const Me=$(ue["@container"])?[ue["@container"]]:ue["@container"]||[],Ve=["@list","@set","@index","@language"];let nt=!0;const Ze=Me.includes("@set");if(I.processingMode(M,1.1)){if(Ve.push("@graph","@id","@type"),Me.includes("@list")){if(1!==Me.length)throw new V("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:F})}else if(Me.includes("@graph")){if(Me.some(Je=>"@graph"!==Je&&"@id"!==Je&&"@index"!==Je&&"@set"!==Je))throw new V("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:F})}else nt&=Me.length<=(Ze?2:1);if(Me.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new V("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else nt&=!L(ue["@container"]),nt&=Me.length<=1;if(nt&=Me.every(Je=>Ve.includes(Je)),nt&=!(Ze&&Me.includes("@list")),!nt)throw new V("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ve.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:F});if(Te.reverse&&!Me.every(Je=>["@index","@set"].includes(Je)))throw new V("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});Te["@container"]=Me}if("@index"in ue){if(!("@container"in ue)||!Te["@container"].includes("@index"))throw new V(`Invalid JSON-LD syntax; @index without @index in @container: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});if(!$(ue["@index"])||0===ue["@index"].indexOf("@"))throw new V(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});Te["@index"]=ue["@index"]}if("@context"in ue&&(Te["@context"]=ue["@context"]),"@language"in ue&&!("@type"in ue)){let Me=ue["@language"];if(null!==Me&&!$(Me))throw new V("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:F});null!==Me&&(Me=Me.toLowerCase()),Te["@language"]=Me}if("@prefix"in ue){if(Q.match(/:|\//))throw new V("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:F});if(I.isKeyword(Te["@id"]))throw new V("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:F});if("boolean"!=typeof ue["@prefix"])throw new V("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:F});Te._prefix=!0===ue["@prefix"]}if("@direction"in ue){const Me=ue["@direction"];if(null!==Me&&"ltr"!==Me&&"rtl"!==Me)throw new V('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:F});Te["@direction"]=Me}if("@nest"in ue){const Me=ue["@nest"];if(!$(Me)||"@nest"!==Me&&0===Me.indexOf("@"))throw new V("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:F});Te["@nest"]=Me}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new V("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:F});if(ee&&ee.protected&&!ie&&(M.protected[Q]=!0,Te.protected=!0,!K(ee,Te))){const Me=U&&U.protectedMode||"error";if("error"===Me)throw new V(`Invalid JSON-LD syntax; tried to redefine "${Q}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:F,term:Q});if("warn"===Me)return void console.warn("WARNING: protected term redefinition",{term:Q});throw new V("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:F,term:Q,protectedMode:Me})}},I.expandIri=(M,F,Q,E)=>H(M,F,Q,void 0,void 0,E),I.getInitialContext=M=>{const F=JSON.stringify({processingMode:M.processingMode}),Q=w.get(F);if(Q)return Q;const E={processingMode:M.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},te=Te.fastCurieMap={},ye={},Me=(Te["@language"]||"@none").toLowerCase(),Ve=Te["@direction"],nt=Te.mappings,Ze=[...nt.keys()].sort(y);for(const Je of Ze){const Ke=nt.get(Je);if(null===Ke)continue;let je=Ke["@container"]||"@none";if(je=[].concat(je).sort().join(""),null===Ke["@id"])continue;const Le=v(Ke["@id"]);for(const Ee of Le){let Oe=me[Ee];const Ue=I.isKeyword(Ee);if(Oe)!Ue&&!Ke._termHasColon&&ye[Ee].push(Je);else if(me[Ee]=Oe={},!Ue&&!Ke._termHasColon){ye[Ee]=[Je];const qe={iri:Ee,terms:ye[Ee]};Ee[0]in te?te[Ee[0]].push(qe):te[Ee[0]]=[qe]}if(Oe[je]||(Oe[je]={"@language":{},"@type":{},"@any":{}}),Oe=Oe[je],ue(Je,Oe["@any"],"@none"),Ke.reverse)ue(Je,Oe["@type"],"@reverse");else if("@none"===Ke["@type"])ue(Je,Oe["@any"],"@none"),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none");else if("@type"in Ke)ue(Je,Oe["@type"],Ke["@type"]);else if("@language"in Ke&&"@direction"in Ke){const qe=Ke["@language"],Be=Ke["@direction"];ue(Je,Oe["@language"],qe&&Be?`${qe}_${Be}`.toLowerCase():qe?qe.toLowerCase():Be?`_${Be}`:"@null")}else"@language"in Ke?ue(Je,Oe["@language"],(Ke["@language"]||"@null").toLowerCase()):"@direction"in Ke?ue(Je,Oe["@language"],Ke["@direction"]?`_${Ke["@direction"]}`:"@none"):Ve?(ue(Je,Oe["@language"],`_${Ve}`),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none")):(ue(Je,Oe["@language"],Me),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none"))}}for(const Je in te)ie(te,Je,1);return me},clone:function(){const Te={};return Te.mappings=W.clone(this.mappings),Te.clone=this.clone,Te.inverse=null,Te.getInverse=this.getInverse,Te.protected=W.clone(this.protected),this.previousContext&&(Te.previousContext=this.previousContext.clone()),Te.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Te["@base"]=this["@base"]),"@language"in this&&(Te["@language"]=this["@language"]),"@vocab"in this&&(Te["@vocab"]=this["@vocab"]),Te},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===w.size&&w.clear(),w.set(F,E),E;function ie(Te,me,te){const ye=Te[me],Me=Te[me]={};let Ve,nt;for(const Ze of ye)Ve=Ze.iri,nt=te>=Ve.length?"":Ve[te],nt in Me?Me[nt].push(Ze):Me[nt]=[Ze];for(const Ze in Me)""!==Ze&&ie(Me,Ze,te+1)}function ue(Te,me,te){me.hasOwnProperty(te)||(me[te]=Te)}},I.getContextValue=(M,F,Q)=>{if(null===F)return"@context"===Q?void 0:null;if(M.mappings.has(F)){const E=M.mappings.get(F);if(b(Q))return E;if(E.hasOwnProperty(Q))return E[Q]}return"@language"===Q&&Q in M||"@direction"===Q&&Q in M?M[Q]:"@context"!==Q?null:void 0},I.processingMode=(M,F)=>F.toString()>="1.1"?!M.processingMode||M.processingMode>="json-ld-"+F.toString():"json-ld-1.0"===M.processingMode,I.isKeyword=M=>{if(!$(M)||"@"!==M[0])return!1;switch(M){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(Y,Ae,he){"use strict";const{parseLinkHeader:W,buildHeaders:V}=Y("../util"),{LINK_HEADER_CONTEXT:L}=Y("../constants"),re=Y("../JsonLdError"),$=Y("../RequestQueue"),{prependBase:b}=Y("../url"),S=/(^|(\r\n))link:/i;function R(A,v,y){const w=new(A=A||XMLHttpRequest);return new Promise((D,j)=>{w.onload=()=>D(w),w.onerror=I=>j(I),w.open("GET",v,!0);for(const I in y)w.setRequestHeader(I,y[I]);w.send()})}Ae.exports=({secure:A,headers:v={},xhr:y}={headers:{}})=>{return v=V(v),(new $).wrapLoader(D);function D(I){return j.apply(this,arguments)}function j(){return(j=gt(function*(I){if(0!==I.indexOf("http:")&&0!==I.indexOf("https:"))throw new re('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:I});if(A&&0!==I.indexOf("https"))throw new re('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:I});let H;try{H=yield R(y,I,v)}catch(E){throw new re("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:I,cause:E})}if(H.status>=400)throw new re("URL could not be dereferenced: "+H.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:I,httpStatusCode:H.status});let K={contextUrl:null,documentUrl:I,document:H.response},M=null;const F=H.getResponseHeader("Content-Type");let Q;if(S.test(H.getAllResponseHeaders())&&(Q=H.getResponseHeader("Link")),Q&&"application/ld+json"!==F){const E=W(Q),U=E[L];if(Array.isArray(U))throw new re("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:I});U&&(K.contextUrl=U.target),M=E.alternate,M&&"application/ld+json"==M.type&&!(F||"").match(/^application\/(\w*\+)?json$/)&&(K=yield D(b(I,M.target)))}return K})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),{isArray:V,isObject:L,isEmptyObject:re,isString:$,isUndefined:b}=Y("./types"),{isList:S,isValue:R,isGraph:A,isSubject:v}=Y("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:D,process:j,processingMode:I}=Y("./context"),{isAbsolute:H}=Y("./url"),{addValue:K,asArray:M,getValues:F,validateTypeValue:Q}=Y("./util"),E={};Ae.exports=E;const U=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function ie(te){return ue.apply(this,arguments)}function ue(){return(ue=gt(function*({activeCtx:te,activeProperty:ye,expandedActiveProperty:Me,element:Ve,expandedParent:nt,options:Ze={},insideList:Je,typeKey:Ke,typeScopedContext:je,expansionMap:Le}){const Ee=Object.keys(Ve).sort(),Oe=[];let Ue;const qe=Ve[Ke]&&"@json"===y(te,V(Ve[Ke])?Ve[Ke][0]:Ve[Ke],{vocab:!0},Ze);for(const Be of Ee){let X,z=Ve[Be];if("@context"===Be)continue;let be=y(te,Be,{vocab:!0},Ze);if((null===be||!H(be)&&!D(be))&&(be=Le({unmappedProperty:Be,activeCtx:te,activeProperty:ye,parent:Ve,options:Ze,insideList:Je,value:z,expandedParent:nt}),void 0===be))continue;if(D(be)){if("@reverse"===Me)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(be in nt&&"@included"!==be&&"@type"!==be)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:be})}if("@id"===be){if(!$(z)){if(!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(L(z)){if(!re(z))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!V(z))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(pt=>$(pt)))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}K(nt,"@id",M(z).map(pt=>$(pt)?y(te,pt,{base:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@type"===be){L(z)&&(z=Object.fromEntries(Object.entries(z).map(([pt,pe])=>[y(je,pt,{vocab:!0}),M(pe).map(B=>y(je,B,{base:!0,vocab:!0}))]))),Q(z,Ze.isFrame),K(nt,"@type",M(z).map(pt=>$(pt)?y(je,pt,{base:!0,vocab:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@included"===be&&I(te,1.1)){const pt=M(yield E.expand({activeCtx:te,activeProperty:ye,element:z,options:Ze,expansionMap:Le}));if(!pt.every(pe=>v(pe)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});K(nt,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===be&&!L(z)&&!V(z))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if("@value"===be){Ue=z,qe&&I(te,1.1)?nt["@value"]=z:K(nt,"@value",z,{propertyIsArray:Ze.isFrame});continue}if("@language"===be){if(null===z)continue;if(!$(z)&&!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=M(z).map(pt=>$(pt)?pt.toLowerCase():pt);for(const pt of z)$(pt)&&!pt.match(U)&&console.warn(`@language must be valid BCP47: ${pt}`);K(nt,"@language",z,{propertyIsArray:Ze.isFrame});continue}if("@direction"===be){if(!$(z)&&!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=M(z);for(const pt of z)if($(pt)&&"ltr"!==pt&&"rtl"!==pt)throw new W('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});K(nt,"@direction",z,{propertyIsArray:Ze.isFrame});continue}if("@index"===be){if(!$(z))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});K(nt,"@index",z);continue}if("@reverse"===be){if(!L(z))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(X=yield E.expand({activeCtx:te,activeProperty:"@reverse",element:z,options:Ze,expansionMap:Le}),"@reverse"in X)for(const pe in X["@reverse"])K(nt,pe,X["@reverse"][pe],{propertyIsArray:!0});let pt=nt["@reverse"]||null;for(const pe in X){if("@reverse"===pe)continue;null===pt&&(pt=nt["@reverse"]={}),K(pt,pe,[],{propertyIsArray:!0});const B=X[pe];for(let O=0;O"@id"===pt||"@index"===pt)&&(X=M(X).map(pt=>({"@graph":M(pt)}))),ce.mappings.has(Be)&&ce.mappings.get(Be).reverse){const pt=nt["@reverse"]=nt["@reverse"]||{};X=M(X);for(let pe=0;pe"@value"===y(te,be,{vocab:!0},Ze)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:X});yield ie({activeCtx:te,activeProperty:ye,expandedActiveProperty:Me,element:X,expandedParent:nt,options:Ze,insideList:Je,typeScopedContext:je,typeKey:Ke,expansionMap:Le})}}})).apply(this,arguments)}function ee({activeCtx:te,activeProperty:ye,value:Me,options:Ve}){if(null==Me)return null;const nt=y(te,ye,{vocab:!0},Ve);if("@id"===nt)return y(te,Me,{base:!0},Ve);if("@type"===nt)return y(te,Me,{vocab:!0,base:!0},Ve);const Ze=w(te,ye,"@type");if(("@id"===Ze||"@graph"===nt)&&$(Me))return{"@id":y(te,Me,{base:!0},Ve)};if("@vocab"===Ze&&$(Me))return{"@id":y(te,Me,{vocab:!0,base:!0},Ve)};if(D(nt))return Me;const Je={};if(Ze&&!["@id","@vocab","@none"].includes(Ze))Je["@type"]=Ze;else if($(Me)){const Ke=w(te,ye,"@language");null!==Ke&&(Je["@language"]=Ke);const je=w(te,ye,"@direction");null!==je&&(Je["@direction"]=je)}return["boolean","number","string"].includes(typeof Me)||(Me=Me.toString()),Je["@value"]=Me,Je}function se(te,ye,Me,Ve){const nt=[],Ze=Object.keys(ye).sort();for(const Je of Ze){const Ke=y(te,Je,{vocab:!0},Ve);let je=ye[Je];V(je)||(je=[je]);for(const Le of je){if(null===Le)continue;if(!$(Le))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ee={"@value":Le};"@none"!==Ke&&(Ee["@language"]=Je.toLowerCase()),Me&&(Ee["@direction"]=Me),nt.push(Ee)}}return nt}function Te(te){return me.apply(this,arguments)}function me(){return(me=gt(function*({activeCtx:te,options:ye,activeProperty:Me,value:Ve,expansionMap:nt,asGraph:Ze,indexKey:Je,propertyIndex:Ke}){const je=[],Le=Object.keys(Ve).sort(),Ee="@type"===Je;for(let Oe of Le){if(Ee){const Be=w(te,Oe,"@context");b(Be)||(te=yield j({activeCtx:te,localCtx:Be,propagate:!1,options:ye}))}let qe,Ue=Ve[Oe];V(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:te,activeProperty:Me,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:nt}),qe=Ke?"@none"===Oe?"@none":ee({activeCtx:te,activeProperty:Je,value:Oe,options:ye}):y(te,Oe,{vocab:!0},ye),"@id"===Je?Oe=y(te,Oe,{base:!0},ye):Ee&&(Oe=qe);for(let Be of Ue){if(Ze&&!A(Be)&&(Be={"@graph":[Be]}),"@type"===Je)"@none"===qe||(Be["@type"]=Be["@type"]?[Oe].concat(Be["@type"]):[Oe]);else{if(R(Be)&&!["@language","@type","@index"].includes(Je))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${Je}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Be});Ke?"@none"!==qe&&K(Be,Ke,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(Je in Be)&&(Be[Je]=Oe)}je.push(Be)}}return je})).apply(this,arguments)}E.expand=function(){var te=gt(function*({activeCtx:ye,activeProperty:Me=null,element:Ve,options:nt={},insideList:Ze=!1,insideIndex:Je=!1,typeScopedContext:Ke=null,expansionMap:je=(()=>{})}){if(null==Ve)return null;if("@default"===Me&&(nt=Object.assign({},nt,{isFrame:!1})),!V(Ve)&&!L(Ve)){if(!Ze&&(null===Me||"@graph"===y(ye,Me,{vocab:!0},nt))){const X=yield je({unmappedValue:Ve,activeCtx:ye,activeProperty:Me,options:nt,insideList:Ze});return void 0===X?null:X}return ee({activeCtx:ye,activeProperty:Me,value:Ve,options:nt})}if(V(Ve)){let X=[];const be=w(ye,Me,"@container")||[];Ze=Ze||be.includes("@list");for(let ce=0;ce1?ce.slice().sort():ce:[ce];for(const Et of Pe){const pt=w(Ke,Et,"@context");b(pt)||(ye=yield j({activeCtx:ye,localCtx:pt,options:nt,propagate:!1}))}}let Be={};yield ie({activeCtx:ye,activeProperty:Me,expandedActiveProperty:Le,element:Ve,expandedParent:Be,options:nt,insideList:Ze,typeKey:qe,typeScopedContext:Ke,expansionMap:je}),Oe=Object.keys(Be);let z=Oe.length;if("@value"in Be){if("@type"in Be&&("@language"in Be||"@direction"in Be))throw new W('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:Be});let X=z-1;if("@type"in Be&&(X-=1),"@index"in Be&&(X-=1),"@language"in Be&&(X-=1),"@direction"in Be&&(X-=1),0!==X)throw new W('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:Be});const be=null===Be["@value"]?[]:M(Be["@value"]),ce=F(Be,"@type");if(!I(ye,1.1)||!ce.includes("@json")||1!==ce.length)if(0===be.length){const Pe=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==Pe?Pe:null}else{if(!be.every(Pe=>$(Pe)||re(Pe))&&"@language"in Be)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Be});if(!ce.every(Pe=>H(Pe)&&!($(Pe)&&0===Pe.indexOf("_:"))||re(Pe)))throw new W('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:Be})}}else if("@type"in Be&&!V(Be["@type"]))Be["@type"]=[Be["@type"]];else if("@set"in Be||"@list"in Be){if(z>1&&(2!==z||!("@index"in Be)))throw new W('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:Be});"@set"in Be&&(Be=Be["@set"],Oe=Object.keys(Be),z=Oe.length)}else if(1===z&&"@language"in Be){const X=yield je(Be,{unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}if(L(Be)&&!nt.keepFreeFloatingNodes&&!Ze&&(null===Me||"@graph"===Le)&&(0===z||"@value"in Be||"@list"in Be||1===z&&"@id"in Be)){const X=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}return Be});return function(ye){return te.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Ae,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:V}=Y("./nodeMap"),L={};Ae.exports=L,L.flatten=re=>{const $=V(re),b=[],S=Object.keys($).sort();for(let R=0;R=0;--ue){const ee=ie[ue];if(ee.graph===U&&ee.subject["@id"]===E["@id"])return!0}return!1}function w(E,U,ie){const ue="@"+ie;let ee=ue in E?E[ue][0]:U[ie];if("embed"===ie)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return ee}function D(E){if(!L.isArray(E)||1!==E.length||!L.isObject(E[0]))throw new b("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const U of re.asArray(E[0]["@id"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const U of re.asArray(E[0]["@type"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function I(E,U,ie,ue){let ee=!0,se=!1;for(const Te in ie){let me=!1;const te=re.getValues(U,Te),ye=0===re.getValues(ie,Te).length;if("@id"===Te){if(L.isEmptyObject(ie["@id"][0]||{})?me=!0:ie["@id"].length>=0&&(me=ie["@id"].includes(te[0])),!ue.requireAll)return me}else if("@type"===Te){if(ee=!1,ye){if(te.length>0)return!1;me=!0}else if(1===ie["@type"].length&&L.isEmptyObject(ie["@type"][0]))me=te.length>0;else for(const Me of ie["@type"])me=!(!L.isObject(Me)||!("@default"in Me))||me||te.some(Ve=>Ve===Me);if(!ue.requireAll)return me}else{if(W(Te))continue;{const Me=re.getValues(ie,Te)[0];let Ve=!1;if(Me&&(D([Me]),Ve="@default"in Me),ee=!1,0===te.length&&Ve)continue;if(te.length>0&&ye)return!1;if(void 0===Me){if(te.length>0)return!1;me=!0}else if(V.isList(Me)){const nt=Me["@list"][0];if(V.isList(te[0])){const Ze=te[0]["@list"];V.isValue(nt)?me=Ze.some(Je=>Q(nt,Je)):(V.isSubject(nt)||V.isSubjectReference(nt))&&(me=Ze.some(Je=>F(E,nt,Je,ue)))}}else me=V.isValue(Me)?te.some(nt=>Q(Me,nt)):V.isSubjectReference(Me)?te.some(nt=>F(E,Me,nt,ue)):!!L.isObject(Me)&&te.length>0}}if(!me&&ue.requireAll)return!1;se=se||me}return ee||se}function H(E,U){const ie=E.uniqueEmbeds[E.graph],ue=ie[U],ee=ue.parent,se=ue.property,Te={"@id":U};if(L.isArray(ee)){for(let te=0;te{const ye=Object.keys(ie);for(const Me of ye)Me in ie&&L.isObject(ie[Me].parent)&&ie[Me].parent["@id"]===te&&(delete ie[Me],me(Me))};me(U)}function K(E,U){if(L.isArray(E))return E.map(ie=>K(ie,U));if(L.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(V.isValue(E))return E;if(V.isList(E))return E["@list"]=K(E["@list"],U),E;if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)"@id"===ie&&U.bnodesToClear.includes(E[ie])?delete E["@id"]:E[ie]=K(E[ie],U)}return E}function M(E,U,ie){L.isObject(E)?re.addValue(E,U,ie,{propertyIsArray:!0}):E.push(ie)}function F(E,U,ie,ue){if(!("@id"in ie))return!1;const ee=E.subjects[ie["@id"]];return ee&&I(E,ee,U,ue)}function Q(E,U){const ie=U["@value"],ue=U["@type"],ee=U["@language"],se=E["@value"]?L.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?L.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?L.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===se.length&&0===Te.length&&0===me.length||!(!se.includes(ie)&&!L.isEmptyObject(se[0])||!(!ue&&0===Te.length||Te.includes(ue)||ue&&L.isEmptyObject(Te[0]))||!(!ee&&0===me.length||me.includes(ee)||ee&&L.isEmptyObject(me[0])))}Ae.exports=A,A.frameMergedOrDefault=(E,U,ie)=>{const ue={options:ie,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new re.IdentifierIssuer("_:b");S(E,ue.graphMap,"@default",ee),ie.merged&&(ue.graphMap["@merged"]=R(ue.graphMap),ue.graph="@merged"),ue.subjects=ue.graphMap[ue.graph];const se=[];return A.frame(ue,Object.keys(ue.subjects).sort(),U,se),ie.pruneBlankNodeIdentifiers&&(ie.bnodesToClear=Object.keys(ue.bnodeMap).filter(Te=>1===ue.bnodeMap[Te].length)),ie.link={},K(se,ie)},A.frame=(E,U,ie,ue,ee=null)=>{D(ie);const se=E.options,Te={embed:w(ie=ie[0],se,"embed"),explicit:w(ie,se,"explicit"),requireAll:w(ie,se,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],te=function(E,U,ie,ue){const ee={};for(const se of U){const Te=E.graphMap[E.graph][se];I(E,Te,ie,ue)&&(ee[se]=Te)}return ee}(E,U,ie,Te),ye=Object.keys(te).sort();for(const Me of ye){const Ve=te[Me];if(null===ee?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&Me in me){M(ue,ee,me[Me]);continue}const nt={"@id":Me};if(0===Me.indexOf("_:")&&re.addValue(E.bnodeMap,Me,nt,{propertyIsArray:!0}),me[Me]=nt,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:ie});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Me)){if(E.embedded&&("@never"===Te.embed||y(Ve,E.graph,E.subjectStack))){M(ue,ee,nt);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Me)){M(ue,ee,nt);continue}if("@last"===Te.embed&&Me in E.uniqueEmbeds[E.graph]&&H(E,Me),E.uniqueEmbeds[E.graph][Me]={parent:ue,property:ee},E.subjectStack.push({subject:Ve,graph:E.graph}),Me in E.graphMap){let Ze=!1,Je=null;"@graph"in ie?(Je=ie["@graph"][0],Ze=!("@merged"===Me||"@default"===Me),L.isObject(Je)||(Je={})):(Ze="@merged"!==E.graph,Je={}),Ze&&A.frame(Vn(ht({},E),{graph:Me,embedded:!1}),Object.keys(E.graphMap[Me]).sort(),[Je],nt,"@graph")}"@included"in ie&&A.frame(Vn(ht({},E),{embedded:!1}),U,ie["@included"],nt,"@included");for(const Ze of Object.keys(Ve).sort())if(W(Ze)){if(nt[Ze]=re.clone(Ve[Ze]),"@type"===Ze)for(const Je of Ve["@type"])0===Je.indexOf("_:")&&re.addValue(E.bnodeMap,Je,nt,{propertyIsArray:!0})}else if(!Te.explicit||Ze in ie)for(const Je of Ve[Ze]){const Ke=Ze in ie?ie[Ze]:v(Te);if(V.isList(Je)){const je=ie[Ze]&&ie[Ze][0]&&ie[Ze][0]["@list"]?ie[Ze][0]["@list"]:v(Te),Le={"@list":[]};M(nt,Ze,Le);const Ee=Je["@list"];for(const Oe of Ee)V.isSubjectReference(Oe)?A.frame(Vn(ht({},E),{embedded:!0}),[Oe["@id"]],je,Le,"@list"):M(Le,"@list",re.clone(Oe))}else V.isSubjectReference(Je)?A.frame(Vn(ht({},E),{embedded:!0}),[Je["@id"]],Ke,nt,Ze):Q(Ke[0],Je)&&M(nt,Ze,re.clone(Je))}for(const Ze of Object.keys(ie).sort()){if("@type"===Ze){if(!L.isObject(ie[Ze][0])||!("@default"in ie[Ze][0]))continue}else if(W(Ze))continue;const Je=ie[Ze][0]||{};if(!w(Je,se,"omitDefault")&&!(Ze in nt)){let je="@null";"@default"in Je&&(je=re.clone(Je["@default"])),L.isArray(je)||(je=[je]),nt[Ze]=[{"@preserve":je}]}}for(const Ze of Object.keys(ie["@reverse"]||{}).sort()){const Je=ie["@reverse"][Ze];for(const Ke of Object.keys(E.subjects))re.getValues(E.subjects[Ke],Ze).some(Le=>Le["@id"]===Me)&&(nt["@reverse"]=nt["@reverse"]||{},re.addValue(nt["@reverse"],Ze,[],{propertyIsArray:!0}),A.frame(Vn(ht({},E),{embedded:!0}),[Ke],Je,nt["@reverse"][Ze],ee))}M(ue,ee,nt),E.subjectStack.pop()}}},A.cleanupNull=(E,U)=>{if(L.isArray(E))return E.map(ue=>A.cleanupNull(ue,U)).filter(ue=>ue);if("@null"===E)return null;if(L.isObject(E)){if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)E[ie]=A.cleanupNull(E[ie],U)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),V=Y("./graphTypes"),L=Y("./types"),re=Y("./util"),{RDF_LIST:$,RDF_FIRST:b,RDF_REST:S,RDF_NIL:R,RDF_TYPE:A,RDF_JSON_LITERAL:v,XSD_BOOLEAN:y,XSD_DOUBLE:w,XSD_INTEGER:D,XSD_STRING:j}=Y("./constants"),I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,H={};function K(M,F,Q){if(M.termType.endsWith("Node"))return{"@id":M.value};const E={"@value":M.value};if(M.language)E["@language"]=M.language;else{let U=M.datatype.value;if(U||(U=j),U===v){U="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(ie){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:ie})}}if(F){if(U===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(L.isNumeric(E["@value"]))if(U===D){const ie=parseInt(E["@value"],10);ie.toFixed(0)===E["@value"]&&(E["@value"]=ie)}else U===w&&(E["@value"]=parseFloat(E["@value"]));[y,D,w,j].includes(U)||(E["@type"]=U)}else if("i18n-datatype"===Q&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,ue]=U.split(/[#_]/);ie.length>0&&(E["@language"]=ie,ie.match(I)||console.warn(`@language must be valid BCP47: ${ie}`)),E["@direction"]=ue}else U!==j&&(E["@type"]=U)}return E}Ae.exports=H,H.fromRDF=function(){var M=gt(function*(F,{useRdfType:Q=!1,useNativeTypes:E=!1,rdfDirection:U=null}){const ie={},ue={"@default":ie},ee={};for(const me of F){const te="DefaultGraph"===me.graph.termType?"@default":me.graph.value;te in ue||(ue[te]={}),"@default"!==te&&!(te in ie)&&(ie[te]={"@id":te});const ye=ue[te],Me=me.subject.value,Ve=me.predicate.value,nt=me.object;Me in ye||(ye[Me]={"@id":Me});const Ze=ye[Me],Je=nt.termType.endsWith("Node");if(Je&&!(nt.value in ye)&&(ye[nt.value]={"@id":nt.value}),Ve===A&&!Q&&Je){re.addValue(Ze,"@type",nt.value,{propertyIsArray:!0});continue}const Ke=K(nt,E,U);if(re.addValue(Ze,Ve,Ke,{propertyIsArray:!0}),Je)if(nt.value===R){const je=ye[nt.value];"usages"in je||(je.usages=[]),je.usages.push({node:Ze,property:Ve,value:Ke})}else ee[nt.value]=!(nt.value in ee)&&{node:Ze,property:Ve,value:Ke}}for(const me in ue){const te=ue[me];if(!(R in te))continue;const ye=te[R];if(ye.usages){for(let Me of ye.usages){let Ve=Me.node,nt=Me.property,Ze=Me.value;const Je=[],Ke=[];let je=Object.keys(Ve).length;for(;nt===S&&L.isObject(ee[Ve["@id"]])&&L.isArray(Ve[b])&&1===Ve[b].length&&L.isArray(Ve[S])&&1===Ve[S].length&&(3===je||4===je&&L.isArray(Ve["@type"])&&1===Ve["@type"].length&&Ve["@type"][0]===$)&&(Je.push(Ve[b][0]),Ke.push(Ve["@id"]),Me=ee[Ve["@id"]],Ve=Me.node,nt=Me.property,Ze=Me.value,je=Object.keys(Ve).length,V.isBlankNode(Ve)););delete Ze["@id"],Ze["@list"]=Je.reverse();for(const Le of Ke)delete te[Le]}delete ye.usages}}const se=[],Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me];if(me in ue){const ye=te["@graph"]=[],Me=ue[me],Ve=Object.keys(Me).sort();for(const nt of Ve){const Ze=Me[nt];V.isSubjectReference(Ze)||ye.push(Ze)}}V.isSubjectReference(te)||se.push(te)}return se});return function(F,Q){return M.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Ae,he){"use strict";const W=Y("./types"),V={};Ae.exports=V,V.isSubject=L=>!(!W.isObject(L)||"@value"in L||"@set"in L||"@list"in L)&&(Object.keys(L).length>1||!("@id"in L)),V.isSubjectReference=L=>W.isObject(L)&&1===Object.keys(L).length&&"@id"in L,V.isValue=L=>W.isObject(L)&&"@value"in L,V.isList=L=>W.isObject(L)&&"@list"in L,V.isGraph=L=>W.isObject(L)&&"@graph"in L&&1===Object.keys(L).filter(re=>"@id"!==re&&"@index"!==re).length,V.isSimpleGraph=L=>V.isGraph(L)&&!("@id"in L),V.isBlankNode=L=>!!W.isObject(L)&&("@id"in L?0===L["@id"].indexOf("_:"):0===Object.keys(L).length||!("@value"in L||"@set"in L||"@list"in L))},{"./types":30}],26:[function(Y,Ae,he){const W=Y("rdf-canonize"),V=Y("./platform"),L=Y("./util"),re=Y("./ContextResolver"),$=L.IdentifierIssuer,b=Y("./JsonLdError"),S=Y("lru-cache"),R=Y("./NQuads"),{expand:A}=Y("./expand"),{flatten:v}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:w}=Y("./toRdf"),{frameMergedOrDefault:D,cleanupNull:j}=Y("./frame"),{isArray:I,isObject:H,isString:K}=Y("./types"),{isSubjectReference:M}=Y("./graphTypes"),{expandIri:F,getInitialContext:Q,process:E,processingMode:U}=Y("./context"),{compact:ie,compactIri:ue}=Y("./compact"),{createNodeMap:ee,createMergedNodeMap:se,mergeNodeMaps:Te}=Y("./nodeMap"),me=function(ye){const Me={},nt=new S({max:100});function Ze(Je,Le){var Ee=Le,{documentLoader:Ke=ye.documentLoader}=Ee,je=yW(Ee,["documentLoader"]);return Object.assign({},{documentLoader:Ke},je,Je)}return ye.compact=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===je)throw new b("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ke)return null;let Ee;(Le=Ze(Le,{base:K(Ke)?Ke:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new $("_:b"),contextResolver:new re({sharedCache:nt})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ee=Le.skipExpansion?Ke:yield ye.expand(Ke,Le);const Oe=yield ye.processContext(Q(Le),je,Le);let Ue=yield ie({activeCtx:Oe,element:Ee,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&I(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&H(Ue)&&(Ue=[Ue]),H(je)&&"@context"in je&&(je=je["@context"]),je=L.clone(je),I(je)||(je=[je]);const qe=je;je=[];for(let z=0;z0)&&je.push(qe[z]);const Be=je.length>0;if(1===je.length&&(je=je[0]),I(Ue)){const z=ue({activeCtx:Oe,iri:"@graph",relativeTo:{vocab:!0}}),X=Ue;Ue={},Be&&(Ue["@context"]=je),Ue[z]=X}else if(H(Ue)&&Be){const z=Ue;Ue={"@context":je};for(const X in z)Ue[X]=z[X]}return Ue});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.expand=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(je=Ze(je,{keepFreeFloatingNodes:!1,contextResolver:new re({sharedCache:nt})})).expansionMap&&(je.expansionMap=void 0);const Le={},Ee=[];if("expandContext"in je){const Be=L.clone(je.expandContext);Le.expandContext=H(Be)&&"@context"in Be?Be:{"@context":Be},Ee.push(Le.expandContext)}let Oe;if(K(Ke)){const Be=yield ye.get(Ke,je);Oe=Be.documentUrl,Le.input=Be.document,Be.contextUrl&&(Le.remoteContext={"@context":Be.contextUrl},Ee.push(Le.remoteContext))}else Le.input=L.clone(Ke);"base"in je||(je.base=Oe||"");let Ue=Q(je);for(const Be of Ee)Ue=yield E({activeCtx:Ue,localCtx:Be,options:je});let qe=yield A({activeCtx:Ue,element:Le.input,options:je,expansionMap:je.expansionMap});return H(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),I(qe)||(qe=[qe]),qe});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.flatten=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");je="function"==typeof je?null:je||null,Le=Ze(Le,{base:K(Ke)?Ke:"",contextResolver:new re({sharedCache:nt})});const Ee=yield ye.expand(Ke,Le),Oe=v(Ee);return null===je?Oe:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Oe,je,Le))});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.frame=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Ze(Le,{base:K(Ke)?Ke:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new re({sharedCache:nt})}),K(je)){const ce=yield ye.get(je,Le);if(je=ce.document,ce.contextUrl){let Pe=je["@context"];Pe?I(Pe)?Pe.push(ce.contextUrl):Pe=[Pe,ce.contextUrl]:Pe=ce.contextUrl,je["@context"]=Pe}}const Ee=je&&je["@context"]||{},Oe=yield ye.processContext(Q(Le),Ee,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=U(Oe,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=U(Oe,1.1));const Ue=yield ye.expand(Ke,Le),qe=ht({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const Be=yield ye.expand(je,qe),z=Object.keys(je).map(ce=>F(Oe,ce,{vocab:!0}));qe.merged=!z.includes("@graph"),qe.is11=U(Oe,1.1);const X=D(Ue,Be,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let be=yield ye.compact(X,Ee,qe);return qe.link={},be=j(be,qe),be});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.link=function(){var Je=gt(function*(Ke,je,Le){const Ee={};return je&&(Ee["@context"]=je),Ee["@embed"]="@link",ye.frame(Ke,Ee,Le)});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(je=Ze(je,{base:K(Ke)?Ke:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new re({sharedCache:nt})}))){if("application/n-quads"!==je.inputFormat&&"application/nquads"!==je.inputFormat)throw new b("Unknown canonicalization input format.","jsonld.CanonizeError");const Oe=R.parse(Ke);return W.canonize(Oe,je)}const Le=ht({},je);delete Le.format,Le.produceGeneralizedRdf=!1;const Ee=yield ye.toRDF(Ke,Le);return W.canonize(Ee,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.fromRDF=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");je=Ze(je,{format:K(Ke)?"application/n-quads":void 0});const{format:Le}=je;let{rdfParser:Ee}=je;if(Le){if(Ee=Ee||Me[Le],!Ee)throw new b("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ee=()=>Ke;const Oe=yield Ee(Ke);return y(Oe,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.toRDF=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(je=Ze(je,{base:K(Ke)?Ke:"",skipExpansion:!1,contextResolver:new re({sharedCache:nt})})).skipExpansion?Ke:yield ye.expand(Ke,je);const Ee=w(Le,je);if(je.format){if("application/n-quads"===je.format||"application/nquads"===je.format)return R.serialize(Ee);throw new b("Unknown output format.","jsonld.UnknownFormat",{format:je.format})}return Ee});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.createNodeMap=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");je=Ze(je,{base:K(Ke)?Ke:"",contextResolver:new re({sharedCache:nt})});const Le=yield ye.expand(Ke,je);return se(Le,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.merge=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!I(Ke))throw new TypeError('Could not merge, "docs" must be an array.');je="function"==typeof je?null:je||null,Le=Ze(Le,{contextResolver:new re({sharedCache:nt})});const Ee=yield Promise.all(Ke.map(ce=>{const Pe=ht({},Le);return ye.expand(ce,Pe)}));let Oe=!0;"mergeNodes"in Le&&(Oe=Le.mergeNodes);const Ue=Le.issuer||new $("_:b"),qe={"@default":{}};for(let ce=0;ceye._documentLoader,set:Je=>ye._documentLoader=Je}),ye.documentLoader=function(){var Je=gt(function*(Ke){throw new b("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Ke})});return function(Ke){return Je.apply(this,arguments)}}(),ye.get=function(){var Je=gt(function*(Ke,je){let Le;Le="function"==typeof je.documentLoader?je.documentLoader:ye.documentLoader;const Ee=yield Le(Ke);try{if(!Ee.document)throw new b("No remote document found at the given URL.","jsonld.NullRemoteDocument");K(Ee.document)&&(Ee.document=JSON.parse(Ee.document))}catch(Oe){throw new b("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Oe,remoteDoc:Ee})}return Ee});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.processContext=function(){var Je=gt(function*(Ke,je,Le){return Le=Ze(Le,{base:"",contextResolver:new re({sharedCache:nt})}),null===je?Q(Le):(je=L.clone(je),H(je)&&"@context"in je||(je={"@context":je}),E({activeCtx:Ke,localCtx:je,options:Le}))});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.getContextValue=Y("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(Je){if(!(Je in ye.documentLoaders))throw new b('Unknown document loader type: "'+Je+'"',"jsonld.UnknownDocumentLoader",{type:Je});ye.documentLoader=ye.documentLoaders[Je].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(Je,Ke){Me[Je]=Ke},ye.unregisterRDFParser=function(Je){delete Me[Je]},ye.registerRDFParser("application/n-quads",R.parse),ye.registerRDFParser("application/nquads",R.parse),ye.url=Y("./url"),ye.util=L,Object.assign(ye,L),ye.promises=ye,ye.RequestQueue=Y("./RequestQueue"),ye.JsonLdProcessor=Y("./JsonLdProcessor")(ye),V.setupGlobals(ye),V.setupDocumentLoaders(ye),ye},te=function(){return me(function(){return te()})};me(te),Ae.exports=te},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(Y,Ae,he){"use strict";const{isKeyword:W}=Y("./context"),V=Y("./graphTypes"),L=Y("./types"),re=Y("./util"),$=Y("./JsonLdError"),b={};Ae.exports=b,b.createMergedNodeMap=(S,R)=>{const A=(R=R||{}).issuer||new re.IdentifierIssuer("_:b"),v={"@default":{}};return b.createNodeMap(S,v,"@default",A),b.mergeNodeMaps(v)},b.createNodeMap=(S,R,A,v,y,w)=>{if(L.isArray(S)){for(const H of S)b.createNodeMap(H,R,A,v,void 0,w);return}if(!L.isObject(S))return void(w&&w.push(S));if(V.isValue(S)){if("@type"in S){let H=S["@type"];0===H.indexOf("_:")&&(S["@type"]=H=v.getId(H))}return void(w&&w.push(S))}if(w&&V.isList(S)){const H=[];return b.createNodeMap(S["@list"],R,A,v,y,H),void w.push({"@list":H})}if("@type"in S){const H=S["@type"];for(const K of H)0===K.indexOf("_:")&&v.getId(K)}L.isUndefined(y)&&(y=V.isBlankNode(S)?v.getId(S["@id"]):S["@id"]),w&&w.push({"@id":y});const D=R[A],j=D[y]=D[y]||{};j["@id"]=y;const I=Object.keys(S).sort();for(let H of I){if("@id"===H)continue;if("@reverse"===H){const M={"@id":y},F=S["@reverse"];for(const Q in F){const E=F[Q];for(const U of E){let ie=U["@id"];V.isBlankNode(U)&&(ie=v.getId(ie)),b.createNodeMap(U,R,A,v,ie),re.addValue(D[ie],Q,M,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===H){y in R||(R[y]={}),b.createNodeMap(S[H],R,y,v);continue}if("@included"===H){b.createNodeMap(S[H],R,A,v);continue}if("@type"!==H&&W(H)){if("@index"===H&&H in j&&(S[H]!==j[H]||S[H]["@id"]!==j[H]["@id"]))throw new $("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:j});j[H]=S[H];continue}const K=S[H];if(0===H.indexOf("_:")&&(H=v.getId(H)),0!==K.length)for(let M of K)if("@type"===H&&(M=0===M.indexOf("_:")?v.getId(M):M),V.isSubject(M)||V.isSubjectReference(M)){if("@id"in M&&!M["@id"])continue;const F=V.isBlankNode(M)?v.getId(M["@id"]):M["@id"];re.addValue(j,H,{"@id":F},{propertyIsArray:!0,allowDuplicate:!1}),b.createNodeMap(M,R,A,v,F)}else if(V.isValue(M))re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1});else if(V.isList(M)){const F=[];b.createNodeMap(M["@list"],R,A,v,y,F),M={"@list":F},re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1})}else b.createNodeMap(M,R,A,v,y),re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1});else re.addValue(j,H,[],{propertyIsArray:!0})}},b.mergeNodeMapGraphs=S=>{const R={};for(const A of Object.keys(S).sort())for(const v of Object.keys(S[A]).sort()){const y=S[A][v];v in R||(R[v]={"@id":v});const w=R[v];for(const D of Object.keys(y).sort())if(W(D)&&"@type"!==D)w[D]=re.clone(y[D]);else for(const j of y[D])re.addValue(w,D,re.clone(j),{propertyIsArray:!0,allowDuplicate:!1})}return R},b.mergeNodeMaps=S=>{const R=S["@default"],A=Object.keys(S).sort();for(const v of A){if("@default"===v)continue;const y=S[v];let w=R[v];w?"@graph"in w||(w["@graph"]=[]):R[v]=w={"@id":v,"@graph":[]};const D=w["@graph"];for(const j of Object.keys(y).sort()){const I=y[j];V.isSubjectReference(I)||D.push(I)}}return R}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Ae,he){"use strict";const W=Y("./documentLoaders/xhr"),V={};Ae.exports=V,V.setupDocumentLoaders=function(L){"undefined"!=typeof XMLHttpRequest&&(L.documentLoaders.xhr=W,L.useDocumentLoader("xhr"))},V.setupGlobals=function(L){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:L.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Ae,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:V}=Y("./context"),L=Y("./graphTypes"),re=Y("canonicalize"),$=Y("./types"),b=Y("./util"),{RDF_FIRST:S,RDF_REST:R,RDF_NIL:A,RDF_TYPE:v,RDF_JSON_LITERAL:y,RDF_LANGSTRING:w,XSD_BOOLEAN:D,XSD_DOUBLE:j,XSD_INTEGER:I,XSD_STRING:H}=Y("./constants"),{isAbsolute:K}=Y("./url"),M={};function F(U,ie,ue,ee,se){const Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me],ye=Object.keys(te).sort();for(let Me of ye){const Ve=te[Me];if("@type"===Me)Me=v;else if(V(Me))continue;for(const nt of Ve){const Ze={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!K(me))continue;const Je={termType:Me.startsWith("_:")?"BlankNode":"NamedNode",value:Me};if(!K(Me)||"BlankNode"===Je.termType&&!se.produceGeneralizedRdf)continue;const Ke=E(nt,ee,U,ue,se.rdfDirection);Ke&&U.push({subject:Ze,predicate:Je,object:Ke,graph:ue})}}}}function E(U,ie,ue,ee,se){const Te={};if(L.isValue(U)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=U["@value"];const te=U["@type"]||null;"@json"===te?(Te.value=re(me),Te.datatype.value=y):$.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=te||D):$.isDouble(me)||te===j?($.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=te||j):$.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=te||I):"i18n-datatype"===se&&"@direction"in U?(Te.datatype.value="https://www.w3.org/ns/i18n#"+(U["@language"]||"")+`_${U["@direction"]}`,Te.value=me):"@language"in U?(Te.value=me,Te.datatype.value=te||w,Te.language=U["@language"]):(Te.value=me,Te.datatype.value=te||H)}else if(L.isList(U)){const me=function(U,ie,ue,ee,se){const Te={termType:"NamedNode",value:S},me={termType:"NamedNode",value:R},te={termType:"NamedNode",value:A},ye=U.pop(),Me=ye?{termType:"BlankNode",value:ie.getId()}:te;let Ve=Me;for(const nt of U){const Ze=E(nt,ie,ue,ee,se),Je={termType:"BlankNode",value:ie.getId()};ue.push({subject:Ve,predicate:Te,object:Ze,graph:ee}),ue.push({subject:Ve,predicate:me,object:Je,graph:ee}),Ve=Je}if(ye){const nt=E(ye,ie,ue,ee,se);ue.push({subject:Ve,predicate:Te,object:nt,graph:ee}),ue.push({subject:Ve,predicate:me,object:te,graph:ee})}return Me}(U["@list"],ie,ue,ee,se);Te.termType=me.termType,Te.value=me.value}else{const me=$.isObject(U)?U["@id"]:U;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||K(Te.value)?Te:null}Ae.exports=M,M.toRDF=(U,ie)=>{const ue=new b.IdentifierIssuer("_:b"),ee={"@default":{}};W(U,ee,"@default",ue);const se=[],Te=Object.keys(ee).sort();for(const me of Te){let te;if("@default"===me)te={termType:"DefaultGraph",value:""};else{if(!K(me))continue;te=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},te.value=me}F(se,ee[me],te,ue,ie)}return se}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Ae,he){"use strict";const W={};Ae.exports=W,W.isArray=Array.isArray,W.isBoolean=V=>"boolean"==typeof V||"[object Boolean]"===Object.prototype.toString.call(V),W.isDouble=V=>W.isNumber(V)&&(-1!==String(V).indexOf(".")||Math.abs(V)>=1e21),W.isEmptyObject=V=>W.isObject(V)&&0===Object.keys(V).length,W.isNumber=V=>"number"==typeof V||"[object Number]"===Object.prototype.toString.call(V),W.isNumeric=V=>!isNaN(parseFloat(V))&&isFinite(V),W.isObject=V=>"[object Object]"===Object.prototype.toString.call(V),W.isString=V=>"string"==typeof V||"[object String]"===Object.prototype.toString.call(V),W.isUndefined=V=>void 0===V},{}],31:[function(Y,Ae,he){"use strict";const W=Y("./types"),V={};Ae.exports=V,V.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},V.parse=(re,$)=>{const b={},S=V.parsers[$||"full"],R=S.regex.exec(re);let A=S.keys.length;for(;A--;)b[S.keys[A]]=void 0===R[A]?null:R[A];return("https"===b.scheme&&"443"===b.port||"http"===b.scheme&&"80"===b.port)&&(b.href=b.href.replace(":"+b.port,""),b.authority=b.authority.replace(":"+b.port,""),b.port=null),b.normalizedPath=V.removeDotSegments(b.path),b},V.prependBase=(re,$)=>{if(null===re||V.isAbsolute($))return $;(!re||W.isString(re))&&(re=V.parse(re||""));const b=V.parse($),S={protocol:re.protocol||""};if(null!==b.authority)S.authority=b.authority,S.path=b.path,S.query=b.query;else if(S.authority=re.authority,""===b.path)S.path=re.path,S.query=null!==b.query?b.query:re.query;else{if(0===b.path.indexOf("/"))S.path=b.path;else{let A=re.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||re.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=b.path,S.path=A}S.query=b.query}""!==b.path&&(S.path=V.removeDotSegments(S.path));let R=S.protocol;return null!==S.authority&&(R+="//"+S.authority),R+=S.path,null!==S.query&&(R+="?"+S.query),null!==b.fragment&&(R+="#"+b.fragment),""===R&&(R="./"),R},V.removeBase=(re,$)=>{if(null===re)return $;(!re||W.isString(re))&&(re=V.parse(re||""));let b="";if(""!==re.href?b+=(re.protocol||"")+"//"+(re.authority||""):$.indexOf("//")&&(b+="//"),0!==$.indexOf(b))return $;const S=V.parse($.substr(b.length)),R=re.normalizedPath.split("/"),A=S.normalizedPath.split("/"),v=S.fragment||S.query?0:1;for(;R.length>0&&A.length>v&&R[0]===A[0];)R.shift(),A.shift();let y="";if(R.length>0){R.pop();for(let w=0;w{if(0===re.length)return"";const $=re.split("/"),b=[];for(;$.length>0;){const S=$.shift(),R=0===$.length;"."!==S?".."!==S?b.push(S):(b.pop(),R&&b.push("")):R&&b.push("")}return"/"===re[0]&&b.length>0&&""!==b[0]&&b.unshift(""),1===b.length&&""===b[0]?"/":b.join("/")};const L=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;V.isAbsolute=re=>W.isString(re)&&L.test(re),V.isRelative=re=>W.isString(re)},{"./types":30}],32:[function(Y,Ae,he){"use strict";const W=Y("./graphTypes"),V=Y("./types"),L=Y("rdf-canonize").IdentifierIssuer,re=Y("./JsonLdError"),$=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,b=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,S=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,R_headers={accept:"application/ld+json, application/json"},A={};function v(y,w){if(V.isArray(w))for(let D=0;D{if(Object.keys(y).some(D=>"accept"===D.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+R_headers.accept+'" is supported.');return Object.assign({Accept:R_headers.accept},y)},A.parseLinkHeader=y=>{const w={},D=y.match($);for(let j=0;j{if(!(V.isString(y)||V.isArray(y)&&y.every(D=>V.isString(D)))){if(w&&V.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&A.asArray(y["@default"]).every(D=>V.isString(D)))return}throw new re('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:y})}},A.hasProperty=(y,w)=>{if(y.hasOwnProperty(w)){const D=y[w];return!V.isArray(D)||D.length>0}return!1},A.hasValue=(y,w,D)=>{if(A.hasProperty(y,w)){let j=y[w];const I=W.isList(j);if(V.isArray(j)||I){I&&(j=j["@list"]);for(let H=0;H{if("propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1),"valueIsArray"in j||(j.valueIsArray=!1),"allowDuplicate"in j||(j.allowDuplicate=!0),"prependValue"in j||(j.prependValue=!1),j.valueIsArray)y[w]=D;else if(V.isArray(D)){0===D.length&&j.propertyIsArray&&!y.hasOwnProperty(w)&&(y[w]=[]),j.prependValue&&(D=D.concat(y[w]),y[w]=[]);for(let I=0;I[].concat(y[w]||[]),A.removeProperty=(y,w)=>{delete y[w]},A.removeValue=(y,w,D,j)=>{"propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1);const I=A.getValues(y,w).filter(H=>!A.compareValues(H,D));0===I.length?A.removeProperty(y,w):y[w]=1!==I.length||j.propertyIsArray?I:I[0]},A.relabelBlankNodes=(y,w)=>v((w=w||{}).issuer||new L("_:b"),y),A.compareValues=(y,w)=>!!(y===w||W.isValue(y)&&W.isValue(w)&&y["@value"]===w["@value"]&&y["@type"]===w["@type"]&&y["@language"]===w["@language"]&&y["@index"]===w["@index"])||!!(V.isObject(y)&&"@id"in y&&V.isObject(w)&&"@id"in w)&&y["@id"]===w["@id"],A.compareShortestLeast=(y,w)=>y.length1;const j=(Q,E,U)=>{const ie=Q[v].get(E);if(ie){const ue=ie.value;if(I(Q,ue)){if(K(Q,ie),!Q[$])return}else U&&(Q[y]&&(ie.value.now=Date.now()),Q[A].unshiftNode(ie));return ue.value}},I=(Q,E)=>{if(!E||!E.maxAge&&!Q[b])return!1;const U=Date.now()-E.now;return E.maxAge?U>E.maxAge:Q[b]&&U>Q[b]},H=Q=>{if(Q[L]>Q[V])for(let E=Q[A].tail;Q[L]>Q[V]&&null!==E;){const U=E.prev;K(Q,E),E=U}},K=(Q,E)=>{if(E){const U=E.value;Q[S]&&Q[S](U.key,U.value),Q[L]-=U.length,Q[v].delete(U.key),Q[A].removeNode(E)}};class M{constructor(E,U,ie,ue,ee){this.key=E,this.value=U,this.length=ie,this.now=ue,this.maxAge=ee||0}}const F=(Q,E,U,ie)=>{let ue=U.value;I(Q,ue)&&(K(Q,U),Q[$]||(ue=void 0)),ue&&E.call(ie,ue.value,ue.key,Q)};Ae.exports=class{constructor(E){if("number"==typeof E&&(E={max:E}),E||(E={}),E.max&&("number"!=typeof E.max||E.max<0))throw new TypeError("max must be a non-negative number");this[V]=E.max||1/0;const ie=E.length||w;if(this[re]="function"!=typeof ie?w:ie,this[$]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[b]=E.maxAge||0,this[S]=E.dispose,this[R]=E.noDisposeOnSet||!1,this[y]=E.updateAgeOnGet||!1,this.reset()}set max(E){if("number"!=typeof E||E<0)throw new TypeError("max must be a non-negative number");this[V]=E||1/0,H(this)}get max(){return this[V]}set allowStale(E){this[$]=!!E}get allowStale(){return this[$]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[b]=E,H(this)}get maxAge(){return this[b]}set lengthCalculator(E){"function"!=typeof E&&(E=w),E!==this[re]&&(this[re]=E,this[L]=0,this[A].forEach(U=>{U.length=this[re](U.value,U.key),this[L]+=U.length})),H(this)}get lengthCalculator(){return this[re]}get length(){return this[L]}get itemCount(){return this[A].length}rforEach(E,U){U=U||this;for(let ie=this[A].tail;null!==ie;){const ue=ie.prev;F(this,E,ie,U),ie=ue}}forEach(E,U){U=U||this;for(let ie=this[A].head;null!==ie;){const ue=ie.next;F(this,E,ie,U),ie=ue}}keys(){return this[A].toArray().map(E=>E.key)}values(){return this[A].toArray().map(E=>E.value)}reset(){this[S]&&this[A]&&this[A].length&&this[A].forEach(E=>this[S](E.key,E.value)),this[v]=new Map,this[A]=new W,this[L]=0}dump(){return this[A].map(E=>!I(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[A]}set(E,U,ie){if((ie=ie||this[b])&&"number"!=typeof ie)throw new TypeError("maxAge must be a number");const ue=ie?Date.now():0,ee=this[re](U,E);if(this[v].has(E)){if(ee>this[V])return K(this,this[v].get(E)),!1;const me=this[v].get(E).value;return this[S]&&(this[R]||this[S](E,me.value)),me.now=ue,me.maxAge=ie,me.value=U,this[L]+=ee-me.length,me.length=ee,this.get(E),H(this),!0}const se=new M(E,U,ee,ue,ie);return se.length>this[V]?(this[S]&&this[S](E,U),!1):(this[L]+=se.length,this[A].unshift(se),this[v].set(E,this[A].head),H(this),!0)}has(E){if(!this[v].has(E))return!1;const U=this[v].get(E).value;return!I(this,U)}get(E){return j(this,E,!0)}peek(E){return j(this,E,!1)}pop(){const E=this[A].tail;return E?(K(this,E),E.value):null}del(E){K(this,this[v].get(E))}load(E){this.reset();const U=Date.now();for(let ie=E.length-1;ie>=0;ie--){const ue=E[ie],ee=ue.e||0;if(0===ee)this.set(ue.k,ue.v);else{const se=ee-U;se>0&&this.set(ue.k,ue.v,se)}}}prune(){this[v].forEach((E,U)=>j(this,U,!1))}}},{yallist:92}],34:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${V}decimal`,boolean:`${V}boolean`,double:`${V}double`,integer:`${V}integer`,string:`${V}string`},rdf:{type:`${W}type`,nil:`${W}nil`,first:`${W}first`,rest:`${W}rest`,langString:`${W}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${L}reify#forSome`,forAll:`${L}reify#forAll`},log:{implies:`${L}log#implies`}}},{}],35:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.termFromId=function M(te,ye){if(ye=ye||v,!te)return ye.defaultGraph();switch(te[0]){case"?":return ye.variable(te.substr(1));case"_":return ye.blankNode(te.substr(2));case'"':if(ye===v)return new j(te);if('"'===te[te.length-1])return ye.literal(te.substr(1,te.length-2));const Me=te.lastIndexOf('"',te.length-1);return ye.literal(te.substr(1,Me-1),"@"===te[Me+1]?te.substr(Me+2):ye.namedNode(te.substr(Me+3)));case"<":const Ve=A.exec(te);return ye.quad(M(U(Ve[1]),ye),M(U(Ve[2]),ye),M(U(Ve[3]),ye),Ve[4]&&M(U(Ve[4]),ye));default:return ye.namedNode(te)}},he.termToId=function F(te){if("string"==typeof te)return te;if(te instanceof w&&"Quad"!==te.termType)return te.id;if(!te)return b.id;switch(te.termType){case"NamedNode":return te.value;case"BlankNode":return`_:${te.value}`;case"Variable":return`?${te.value}`;case"DefaultGraph":return"";case"Literal":return`"${te.value}"${te.language?`@${te.language}`:te.datatype&&te.datatype.value!==$.string?`^^${te.datatype.value}`:""}`;case"Quad":return`<<${E(F(te.subject))} ${E(F(te.predicate))} ${E(F(te.object))}${(0,V.isDefaultGraph)(te.graph)?"":` ${F(te.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${te.termType}`)}},he.escapeQuotes=E,he.unescapeQuotes=U,he.Triple=he.Quad=he.DefaultGraph=he.Variable=he.BlankNode=he.Literal=he.NamedNode=he.Term=he.default=void 0;var te,W=(te=Y("./IRIs"))&&te.__esModule?te:{default:te},V=Y("./N3Util");const{rdf:re,xsd:$}=W.default;let b,S=0;const R=/^"(.*".*)(?="[^"]*$)/,A=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,v={namedNode:function(te){return new D(te)},blankNode:function(te){return new I(te||"n3-"+S++)},variable:function(te){return new H(te)},literal:function(te,ye){if("string"==typeof ye)return new j(`"${te}"@${ye.toLowerCase()}`);let Me=ye?ye.value:"";return""===Me&&("boolean"==typeof te?Me=$.boolean:"number"==typeof te&&(Number.isFinite(te)?Me=Number.isInteger(te)?$.integer:$.double:(Me=$.double,Number.isNaN(te)||(te=te>0?"INF":"-INF")))),new j(""===Me||Me===$.string?`"${te}"`:`"${te}"^^${Me}`)},defaultGraph:function(){return b},quad:me,triple:me};he.default=v;class w{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof w?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=w;class D extends w{get termType(){return"NamedNode"}}he.NamedNode=D;class j extends w{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let Me=ye.lastIndexOf('"')+1;return Me`"${Me.replace(/"/g,'""')}`)}function U(te){return te.replace(R,(ye,Me)=>`"${Me.replace(/""/g,'"')}`)}function me(te,ye,Me,Ve){return new Q(te,ye,Me,Ve)}he.Triple=he.Quad=Q},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Ae,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var V=re(Y("./IRIs")),L=re(Y("queue-microtask"));function re(w){return w&&w.__esModule?w:{default:w}}const{xsd:$}=V.default,b=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,S={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},R=/[\x00-\x20<>\\"\{\}\|\^\`]/,A={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},v=/$0^/;he.default=class{constructor(D){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]*)?$/,this._lineMode=!!(D=D||{}).lineMode){this._n3Mode=!1;for(const j in this)!(j in A)&&this[j]instanceof RegExp&&(this[j]=v)}else this._n3Mode=!1!==D.n3;this._comments=!!D.comments,this._literalClosingPos=0}_tokenizeToEnd(D,j){let I=this._input;const H=this._comments;for(;;){let M,F;for(;M=this._newline.exec(I);)H&&(F=this._comment.exec(M[0]))&&D(null,{line:this._line,type:"comment",value:F[1],prefix:""}),I=I.substr(M[0].length,I.length),this._line++;if(!M&&(M=this._whitespace.exec(I))&&(I=I.substr(M[0].length,I.length)),this._endOfFile.test(I))return j&&(H&&(F=this._comment.exec(I))&&D(null,{line:this._line,type:"comment",value:F[1],prefix:""}),D(I=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=I;const Q=this._line,E=I[0];let U="",ie="",ue="",ee=null,se=0,Te=!1;switch(E){case"^":if(I.length<3)break;if("^"!==I[1]){this._n3Mode&&(se=1,U="^");break}if(this._previousMarker="^^",I=I.substr(2),"<"!==I[0]){Te=!0;break}case"<":if(ee=this._unescapedIri.exec(I))U="IRI",ie=ee[1];else if(ee=this._iri.exec(I)){if(ie=this._unescape(ee[1]),null===ie||R.test(ie))return K(this);U="IRI"}else I.length>1&&"<"===I[1]?(U="<<",se=2):this._n3Mode&&I.length>1&&"="===I[1]&&(U="inverse",se=2,ie=">");break;case">":I.length>1&&">"===I[1]&&(U=">>",se=2);break;case"_":((ee=this._blank.exec(I))||j&&(ee=this._blank.exec(`${I} `)))&&(U="blank",ue="_",ie=ee[1]);break;case'"':if(ee=this._simpleQuotedString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return K(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(ee=this._simpleApostropheString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return K(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(ee=this._variable.exec(I))&&(U="var",ie=ee[0]);break;case"@":"literal"===this._previousMarker&&(ee=this._langcode.exec(I))?(U="langcode",ie=ee[1]):(ee=this._keyword.exec(I))&&(U=ee[0]);break;case".":if(1===I.length?j:I[1]<"0"||I[1]>"9"){U=".",se=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(ee=this._number.exec(I)||j&&(ee=this._number.exec(`${I} `)))&&(U="literal",ie=ee[0],ue="string"==typeof ee[1]?$.double:"string"==typeof ee[2]?$.decimal:$.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(ee=this._sparqlKeyword.exec(I))?U=ee[0].toUpperCase():Te=!0;break;case"f":case"t":(ee=this._boolean.exec(I))?(U="literal",ie=ee[0],ue=$.boolean):Te=!0;break;case"a":(ee=this._shortPredicates.exec(I))?(U="abbreviation",ie="a"):Te=!0;break;case"=":this._n3Mode&&I.length>1&&(U="abbreviation",">"!==I[1]?(se=1,ie="="):(se=2,ie=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(se=1,U=E);break;default:Te=!0}if(Te&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(ee=this._prefix.exec(I))?((ee=this._prefixed.exec(I))||j&&(ee=this._prefixed.exec(`${I} `)))&&(U="prefixed",ue=ee[1]||"",ie=this._unescape(ee[2])):(U="prefix",ie=ee[1]||"")),"^^"===this._previousMarker)switch(U){case"prefixed":U="type";break;case"IRI":U="typeIRI";break;default:U=""}if(!U)return j||!/^'''|^"""/.test(I)&&/\n|\r/.test(I)?K(this):this._input=I;const me={line:Q,type:U,value:ie,prefix:ue};D(null,me),this.previousToken=me,this._previousMarker=U,I=I.substr(se||ee[0].length,I.length)}function K(M){D(M._syntaxError(/^\S*/.exec(I)[0]))}}_unescape(D){let j=!1;const I=D.replace(b,(H,K,M,F)=>{if("string"==typeof K)return String.fromCharCode(Number.parseInt(K,16));if("string"==typeof M){let Q=Number.parseInt(M,16);return Q<=65535?String.fromCharCode(Number.parseInt(M,16)):String.fromCharCode(55296+((Q-=65536)>>10),56320+(1023&Q))}return F in S?S[F]:(j=!0,"")});return j?null:I}_parseLiteral(D){if(D.length>=3){const j=D.match(/^(?:"""|"|'''|'|)/)[0],I=j.length;let H=Math.max(this._literalClosingPos,I);for(;(H=D.indexOf(j,H))>0;){let K=0;for(;"\\"===D[H-K-1];)K++;if(K%2==0){const M=D.substring(I,H),F=M.split(/\r\n|\r|\n/).length-1,Q=H+I;if(1===I&&0!==F||3===I&&this._lineMode)break;return this._line+=F,{value:this._unescape(M),matchLength:Q}}H++}this._literalClosingPos=D.length-I+1}return{value:"",matchLength:0}}_syntaxError(D){this._input=null;const j=new Error(`Unexpected "${D}" on line ${this._line}.`);return j.context={token:void 0,line:this._line,previousToken:this.previousToken},j}_readStartingBom(D){return D.startsWith("\ufeff")?D.substr(1):D}tokenize(D,j){if(this._line=1,"string"==typeof D){if(this._input=this._readStartingBom(D),"function"!=typeof j){const I=[];let H;if(this._tokenizeToEnd((K,M)=>K?H=K:I.push(M),!0),H)throw H;return I}(0,L.default)(()=>this._tokenizeToEnd(j,!0))}else this._pendingBuffer=null,"function"==typeof D.setEncoding&&D.setEncoding("utf8"),D.on("data",I=>{null!==this._input&&0!==I.length&&(this._pendingBuffer&&(I=W.concat([this._pendingBuffer,I]),this._pendingBuffer=null),128&I[I.length-1]?this._pendingBuffer=I:(void 0===this._input?this._input=this._readStartingBom("string"==typeof I?I:I.toString()):this._input+=I,this._tokenizeToEnd(j,!1)))}),D.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(j,!0)}),D.on("error",j)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=re(Y("./N3Lexer")),V=re(Y("./N3DataFactory")),L=re(Y("./IRIs"));function re(A){return A&&A.__esModule?A:{default:A}}let $=0;class b{constructor(v){this._contextStack=[],this._graph=null,this._setBase((v=v||{}).baseIRI),v.factory&&R(this,v.factory);const y="string"==typeof v.format?v.format.match(/\w*$/)[0].toLowerCase():"",w=/turtle/.test(y),D=/trig/.test(y),j=/triple/.test(y),I=/quad/.test(y),H=this._n3Mode=/n3/.test(y),K=j||I;(this._supportsNamedGraphs=!(w||H))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(w||D||j||H),this._supportsRDFStar=""===y||/star|\*$/.test(y),K&&(this._resolveRelativeIRI=M=>null),this._blankNodePrefix="string"!=typeof v.blankNodePrefix?"":v.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=v.lexer||new W.default({lineMode:K,n3:H}),this._explicitQuantifiers=!!v.explicitQuantifiers}static _resetBlankNodePrefix(){$=0}_setBase(v){if(v){const y=v.indexOf("#");y>=0&&(v=v.substr(0,y)),this._base=v,this._basePath=v.indexOf("/")<0?v:v.replace(/[^\/?]*(?:\?.*)?$/,""),v=v.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=v[0],this._baseScheme=v[1]}else this._base="",this._basePath=""}_saveContext(v,y,w,D,j){const I=this._n3Mode;this._contextStack.push({subject:w,predicate:D,object:j,graph:y,type:v,inverse:!!I&&this._inversePredicate,blankPrefix:I?this._prefixes._:"",quantified:I?this._quantified:null}),I&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const v=this._contextStack.pop(),y=this._n3Mode;this._subject=v.subject,this._predicate=v.predicate,this._object=v.object,this._graph=v.graph,y&&(this._inversePredicate=v.inverse,this._prefixes._=v.blankPrefix,this._quantified=v.quantified)}_readInTopContext(v){switch(v.type){case"eof":return null!==this._graph?this._error("Unclosed graph",v):(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(v)}}_readEntity(v,y){let w;switch(v.type){case"IRI":case"typeIRI":const D=this._resolveIRI(v.value);if(null===D)return this._error("Invalid IRI",v);w=this._namedNode(D);break;case"type":case"prefixed":const j=this._prefixes[v.prefix];if(void 0===j)return this._error(`Undefined prefix "${v.prefix}:"`,v);w=this._namedNode(j+v.value);break;case"blank":w=this._blankNode(this._prefixes[v.prefix]+v.value);break;case"var":w=this._variable(v.value.substr(1));break;default:return this._error(`Expected entity but got ${v.type}`,v)}return!y&&this._n3Mode&&w.id in this._quantified&&(w=this._quantified[w.id]),w}_readSubject(v){switch(this._predicate=null,v.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",v);case"}":return this._readPunctuation(v);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',v);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',v);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",v);if(0===v.prefix.length)return this._literalValue=v.value,this._completeSubjectLiteral;this._subject=this._literal(v.value,this._namedNode(v.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._subject=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(v){const y=v.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[v.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,v):(this._subject=null,"]"===y?this._readBlankNodeTail(v):this._readPunctuation(v));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",v);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",v);default:if(void 0===(this._predicate=this._readEntity(v)))return}return this._readObject}_readObject(v){switch(v.type){case"literal":if(0===v.prefix.length)return this._literalValue=v.value,this._readDataTypeOrLang;this._object=this._literal(v.value,this._namedNode(v.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._object=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(v){return"{"===v.type?this._readGraph(v):this._readPredicate(v)}_readGraph(v){return"{"!==v.type?this._error(`Expected graph but got ${v.type}`,v):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(v){return"]"===v.type?(this._subject=null,this._readBlankNodeTail(v)):(this._predicate=null,this._readPredicate(v))}_readBlankNodeTail(v){if("]"!==v.type)return this._readBlankNodePunctuation(v);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null===this._object?y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(v){switch(v.type){case".":case"}":return this._subject=null,this._readPunctuation(v);default:return this._readPredicate(v)}}_readListItem(v){let y=null,w=null,D=this._readListItem;const j=this._subject,I=this._contextStack,H=I[I.length-1];switch(v.type){case"[":this._saveContext("blank",this._graph,w=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),D=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,w=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==I.length&&"list"===I[I.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(D=this._readPredicate,this._subject===this.RDF_NIL)return D}else if(D=this._getContextEndReader(),this._object===this.RDF_NIL)return D;w=this.RDF_NIL;break;case"literal":0===v.prefix.length?(this._literalValue=v.value,D=this._readListItemDataTypeOrLang):(y=this._literal(v.value,this._namedNode(v.prefix)),D=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);default:if(void 0===(y=this._readEntity(v)))return}if(null===w&&(this._subject=w=this._blankNode()),null===j?null===H.predicate?H.subject=w:H.object=w:this._emit(j,this.RDF_REST,w,this._graph),null!==y){if(this._n3Mode&&("IRI"===v.type||"prefixed"===v.type))return this._saveContext("item",this._graph,w,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(w,this.RDF_FIRST,y,this._graph)}return D}_readDataTypeOrLang(v){return this._completeObjectLiteral(v,!1)}_readListItemDataTypeOrLang(v){return this._completeObjectLiteral(v,!0)}_completeLiteral(v){let y=this._literal(this._literalValue);switch(v.type){case"type":case"typeIRI":const w=this._readEntity(v);if(void 0===w)return;y=this._literal(this._literalValue,w),v=null;break;case"langcode":y=this._literal(this._literalValue,v.value),v=null}return{token:v,literal:y}}_completeSubjectLiteral(v){return this._subject=this._completeLiteral(v).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(v,y){const w=this._completeLiteral(v);if(w)return this._object=w.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===w.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(w.token))}_readFormulaTail(v){return"}"!==v.type?this._readPunctuation(v):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(v){let y,w=this._graph;const D=this._subject,j=this._inversePredicate;switch(v.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",v);if(this._n3Mode)return this._readFormulaTail(v);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,j&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(w=this._readEntity(v))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}if(null!==D){const I=this._predicate,H=this._object;j?this._emit(H,I,D,w):this._emit(D,I,H,w)}return y}_readBlankNodePunctuation(v){let y;switch(v.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(v){return"."!==v.type?this._error("Expected dot to follow quad",v):this._readInTopContext}_readPrefix(v){return"prefix"!==v.type?this._error("Expected prefix to follow @prefix",v):(this._prefix=v.value,this._readPrefixIRI)}_readPrefixIRI(v){if("IRI"!==v.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,v);const y=this._readEntity(v);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(v){const y="IRI"===v.type&&this._resolveIRI(v.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",v)}_readNamedGraphLabel(v){switch(v.type){case"IRI":case"blank":case"prefixed":return this._readSubject(v),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",v)}}_readNamedGraphBlankLabel(v){return"]"!==v.type?this._error("Invalid graph label",v):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(v){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(v)):"."!==v.type?this._error("Expected declaration to end with a dot",v):this._readInTopContext}_readQuantifierList(v){let y;switch(v.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(v,!0)))break;default:return this._error(`Unexpected ${v.type}`,v)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,y,this.QUANTIFIERS_GRAPH)):this._quantified[y.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(v){return","===v.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(v))}_getPathReader(v){return this._afterPath=v,this._readPath}_readPath(v){switch(v.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,w=y.length&&y[y.length-1];if(w&&"item"===w.type){const D=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,D,this._graph)}return this._afterPath(v)}}_readForwardPath(v){let y,w;const D=this._blankNode();if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(y=this._subject,this._subject=D):(y=this._object,this._object=D),this._emit(y,w,D,this._graph),this._readPath}_readBackwardPath(v){const y=this._blankNode();let w,D;if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(D=this._subject,this._subject=y):(D=this._object,this._object=y),this._emit(y,w,D,this._graph),this._readPath}_readRDFStarTailOrGraph(v){return">>"!==v.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(v))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,v):this._readRDFStarTail(v)}_readRDFStarTail(v){if(">>"!==v.type)return this._error(`Expected >> but got ${v.type}`,v);const y=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=y,this._readPredicate):(this._object=y,this._getContextEndReader())}_getContextEndReader(){const v=this._contextStack;if(!v.length)return this._readPunctuation;switch(v[v.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(v,y,w,D){this._callback(null,this._quad(v,y,w,D||this.DEFAULTGRAPH))}_error(v,y){const w=new Error(`${v} on line ${y.line}.`);w.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(w),this._callback=S}_resolveIRI(v){return/^[a-z][a-z0-9+.-]*:/i.test(v)?v:this._resolveRelativeIRI(v)}_resolveRelativeIRI(v){if(!v.length)return this._base;switch(v[0]){case"#":return this._base+v;case"?":return this._base.replace(/(?:\?.*)?$/,v);case"/":return("/"===v[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(v);default:return/^[^/:]*:/.test(v)?null:this._removeDotSegments(this._basePath+v)}}_removeDotSegments(v){if(!/(^|\/)\.\.?($|[/#?])/.test(v))return v;const y=v.length;let w="",D=-1,j=-1,I=0,H="/";for(;D=j&&(w=w.substr(0,I)),"/"!==H)return`${w}/${v.substr(D+1)}`;I=D+1}}}H=v[++D]}return w+v.substring(I)}parse(v,y,w){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${$++}_`,this._prefixCallback=w||S,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const D=[];let j;if(this._callback=(I,H)=>{I?j=I:H&&D.push(H)},this._lexer.tokenize(v).every(I=>this._readCallback=this._readCallback(I)),j)throw j;return D}this._callback=y,this._lexer.tokenize(v,(D,j)=>{null!==D?(this._callback(D),this._callback=S):this._readCallback&&(this._readCallback=this._readCallback(j))})}}function S(){}function R(A,v){const y=v.namedNode;A._namedNode=y,A._blankNode=v.blankNode,A._literal=v.literal,A._variable=v.variable,A._quad=v.quad,A.DEFAULTGRAPH=v.defaultGraph(),A.RDF_FIRST=y(L.default.rdf.first),A.RDF_REST=y(L.default.rdf.rest),A.RDF_NIL=y(L.default.rdf.nil),A.N3_FORALL=y(L.default.r.forAll),A.N3_FORSOME=y(L.default.r.forSome),A.ABBREVIATIONS={a:y(L.default.rdf.type),"=":y(L.default.owl.sameAs),">":y(L.default.log.implies)},A.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=b,R(b.prototype,V.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var v,W=function(v,y){if(!y&&v&&v.__esModule)return v;if(null===v||"object"!=typeof v&&"function"!=typeof v)return{default:v};var w=$(y);if(w&&w.has(v))return w.get(v);var D={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in v)if("default"!==I&&Object.prototype.hasOwnProperty.call(v,I)){var H=j?Object.getOwnPropertyDescriptor(v,I):null;H&&(H.get||H.set)?Object.defineProperty(D,I,H):D[I]=v[I]}return D.default=v,w&&w.set(v,D),D}(Y("./N3DataFactory")),V=Y("readable-stream"),L=(v=Y("./IRIs"))&&v.__esModule?v:{default:v};function $(v){if("function"!=typeof WeakMap)return null;var y=new WeakMap,w=new WeakMap;return($=function(D){return D?w:y})(v)}class S{constructor(y,w){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!w&&y&&!y[0]&&(w=y,y=null),this._factory=(w=w||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const w=this._graphs;let D,j;for(const I in w)for(const H in D=w[I].subjects)for(const K in j=D[H])y+=Object.keys(j[K]).length;return this._size=y}_addToIndex(y,w,D,j){const I=y[w]||(y[w]={}),H=I[D]||(I[D]={}),K=j in H;return K||(H[j]=null),!K}_removeFromIndex(y,w,D,j){const I=y[w],H=I[D];delete H[j];for(const K in H)return;delete I[D];for(const K in I)return;delete y[w]}_findInIndex(y,w,D,j,I,H,K,M,F,Q){let E,U,ie;const ee=!w+!D+!j>1?Object.keys(this._ids):this._entities;w&&((E=y,y={})[w]=E[w]);for(const se in y){const Te=ee[se];if(U=y[se]){D&&((E=U,U={})[D]=E[D]);for(const me in U){const te=ee[me];if(ie=U[me]){const ye=j?j in ie?[j]:[]:Object.keys(ie);for(let Me=0;Me{D in w||(w[D]=!0,y((0,W.termFromId)(this._entities[D],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,w,D,j){w||(j=y.graph,D=y.object,w=y.predicate,y=y.subject),y=(0,W.termToId)(y),w=(0,W.termToId)(w),D=(0,W.termToId)(D),j=(0,W.termToId)(j);let I=this._graphs[j];I||(I=this._graphs[j]={subjects:{},predicates:{},objects:{}},Object.freeze(I));const H=this._ids,K=this._entities;y=H[y]||(H[K[++this._id]=y]=this._id),w=H[w]||(H[K[++this._id]=w]=this._id),D=H[D]||(H[K[++this._id]=D]=this._id);const M=this._addToIndex(I.subjects,y,w,D);return this._addToIndex(I.predicates,w,D,y),this._addToIndex(I.objects,D,y,w),this._size=null,M}addQuads(y){for(let w=0;w{this.addQuad(w)}),y}removeQuad(y,w,D,j){w||(j=y.graph,D=y.object,w=y.predicate,y=y.subject),y=(0,W.termToId)(y),w=(0,W.termToId)(w),D=(0,W.termToId)(D),j=(0,W.termToId)(j);const I=this._ids,H=this._graphs;let K,M,F;if(!((y=I[y])&&(w=I[w])&&(D=I[D])&&(K=H[j])&&(M=K.subjects[y])&&(F=M[w])&&D in F))return!1;for(y in this._removeFromIndex(K.subjects,y,w,D),this._removeFromIndex(K.predicates,w,D,y),this._removeFromIndex(K.objects,D,y,w),null!==this._size&&this._size--,K.subjects)return!0;return delete H[j],!0}removeQuads(y){for(let w=0;w{this.removeQuad(w)}),y}removeMatches(y,w,D,j){const I=new V.Readable({objectMode:!0});return I._read=()=>{for(const H of this.getQuads(y,w,D,j))I.push(H);I.push(null)},this.remove(I)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,w,D,j){y=y&&(0,W.termToId)(y),w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=[],H=this._getGraphs(j),K=this._ids;let M,F,Q,E;if(R(y)&&!(F=K[y])||R(w)&&!(Q=K[w])||R(D)&&!(E=K[D]))return I;for(const U in H)(M=H[U])&&(F?E?this._findInIndex(M.objects,E,F,Q,"object","subject","predicate",U,null,I):this._findInIndex(M.subjects,F,Q,null,"subject","predicate","object",U,null,I):Q?this._findInIndex(M.predicates,Q,E,null,"predicate","object","subject",U,null,I):E?this._findInIndex(M.objects,E,null,null,"object","subject","predicate",U,null,I):this._findInIndex(M.subjects,null,null,null,"subject","predicate","object",U,null,I));return I}match(y,w,D,j){return new A(this,y,w,D,j)}countQuads(y,w,D,j){y=y&&(0,W.termToId)(y),w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._getGraphs(j),H=this._ids;let M,F,Q,E,K=0;if(R(y)&&!(F=H[y])||R(w)&&!(Q=H[w])||R(D)&&!(E=H[D]))return 0;for(const U in I)(M=I[U])&&(K+=y?D?this._countInIndex(M.objects,E,F,Q):this._countInIndex(M.subjects,F,Q,E):w?this._countInIndex(M.predicates,Q,E,F):this._countInIndex(M.objects,E,F,Q));return K}forEach(y,w,D,j,I){this.some(H=>(y(H),!1),w,D,j,I)}every(y,w,D,j,I){let H=!1;const K=!this.some(M=>(H=!0,!y(M)),w,D,j,I);return H&&K}some(y,w,D,j,I){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j),I=I&&(0,W.termToId)(I);const H=this._getGraphs(I),K=this._ids;let M,F,Q,E;if(R(w)&&!(F=K[w])||R(D)&&!(Q=K[D])||R(j)&&!(E=K[j]))return!1;for(const U in H)if(M=H[U])if(F){if(E){if(this._findInIndex(M.objects,E,F,Q,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(M.subjects,F,Q,null,"subject","predicate","object",U,y,null))return!0}else if(Q){if(this._findInIndex(M.predicates,Q,E,null,"predicate","object","subject",U,y,null))return!0}else if(E){if(this._findInIndex(M.objects,E,null,null,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(M.subjects,null,null,null,"subject","predicate","object",U,y,null))return!0;return!1}getSubjects(y,w,D){const j=[];return this.forSubjects(I=>{j.push(I)},y,w,D),j}forSubjects(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.predicates,M,F,y):this._loopByKey1(K.subjects,M,y):F?this._loopByKey0(K.objects,F,y):this._loop(K.subjects,y))}getPredicates(y,w,D){const j=[];return this.forPredicates(I=>{j.push(I)},y,w,D),j}forPredicates(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.objects,F,M,y):this._loopByKey0(K.subjects,M,y):F?this._loopByKey1(K.predicates,F,y):this._loop(K.predicates,y))}getObjects(y,w,D){const j=[];return this.forObjects(I=>{j.push(I)},y,w,D),j}forObjects(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.subjects,M,F,y):this._loopByKey1(K.objects,M,y):F?this._loopByKey0(K.predicates,F,y):this._loop(K.objects,y))}getGraphs(y,w,D){const j=[];return this.forGraphs(I=>{j.push(I)},y,w,D),j}forGraphs(y,w,D,j){for(const I in this._graphs)this.some(H=>(y(H.graph),!0),w,D,j,I)}createBlankNode(y){let w,D;if(y)for(w=y=`_:${y}`,D=1;this._ids[w];)w=y+D++;else do{w="_:b"+this._blankNodeIndex++}while(this._ids[w]);return this._ids[w]=++this._id,this._entities[this._id]=w,this._factory.blankNode(w.substr(2))}extractLists({remove:y=!1,ignoreErrors:w=!1}={}){const D={},j=w?()=>!0:(K,M)=>{throw new Error(`${K.value} ${M}`)},I=this.getQuads(null,L.default.rdf.rest,L.default.rdf.nil,null),H=y?[...I]:[];return I.forEach(K=>{const M=[];let Q,E,F=!1;const U=K.graph;let ie=K.subject;for(;ie&&!F;){const ue=this.getQuads(null,null,ie,null),ee=this.getQuads(ie,null,null,null);let se,Te=null,me=null,te=null;for(let ye=0;ye{switch(v){case"data":R=y;break;case"end":A=y}}},(v,y)=>{v&&this.emit("error",v)||y&&this.push(y)},(v,y)=>{this.emit("prefix",v,y)}),this._transform=(v,y,w)=>{R(v),w()},this._flush=v=>{A(),v()}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var $,W=Y("readable-stream"),V=($=Y("./N3Writer"))&&$.__esModule?$:{default:$};he.default=class extends W.Transform{constructor(b){super({encoding:"utf8",writableObjectMode:!0});const S=this._writer=new V.default({write:(R,A,v)=>{this.push(R),v&&v()},end:R=>{this.push(null),R&&R()}},b);this._transform=(R,A,v)=>{S.addQuad(R,v)},this._flush=R=>{S.end(R)}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),b.on("prefix",(S,R)=>{this._writer.addPrefix(S,R)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.isDefaultGraph=S,he.inDefaultGraph=function(y){return S(y.graph)},he.prefix=function(y,w){return v({"":y},w)("")},he.prefixes=v;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function S(y){return!!y&&"DefaultGraph"===y.termType}function v(y,w){const D=Object.create(null);for(const I in y)j(I,y[I]);function j(I,H){if("string"==typeof H){const K=Object.create(null);D[I]=M=>K[M]||(K[M]=w.namedNode(H+M))}else if(!(I in D))throw new Error(`Unknown prefix: ${I}`);return D[I]}return w=w||W.default,j}},{"./N3DataFactory":35}],42:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,W=(H=Y("./IRIs"))&&H.__esModule?H:{default:H},V=function(H,K){if(!K&&H&&H.__esModule)return H;if(null===H||"object"!=typeof H&&"function"!=typeof H)return{default:H};var M=re(K);if(M&&M.has(H))return M.get(H);var F={},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in H)if("default"!==E&&Object.prototype.hasOwnProperty.call(H,E)){var U=Q?Object.getOwnPropertyDescriptor(H,E):null;U&&(U.get||U.set)?Object.defineProperty(F,E,U):F[E]=H[E]}return F.default=H,M&&M.set(H,F),F}(Y("./N3DataFactory")),L=Y("./N3Util");function re(H){if("function"!=typeof WeakMap)return null;var K=new WeakMap,M=new WeakMap;return(re=function(F){return F?M:K})(H)}const S=V.default.defaultGraph(),{rdf:R,xsd:A}=W.default,v=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,w={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class D extends V.Term{equals(){return!1}}function I(H){let K=w[H];return void 0===K&&(1===H.length?(K=H.charCodeAt(0).toString(16),K="\\u0000".substr(0,6-K.length)+K):(K=(1024*(H.charCodeAt(0)-55296)+H.charCodeAt(1)+9216).toString(16),K="\\U00000000".substr(0,10-K.length)+K)),K}he.default=class{constructor(K,M){if(this._prefixRegex=/$0^/,K&&"function"!=typeof K.write&&(M=K,K=null),this._lists=(M=M||{}).lists,K)this._outputStream=K,this._endStream=void 0===M.end||!!M.end;else{let F="";this._outputStream={write(Q,E,U){F+=Q,U&&U()},end:Q=>{Q&&Q(null,F)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(M.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=S,this._baseIRI=M.baseIRI,this._prefixIRIs=Object.create(null),M.prefixes&&this.addPrefixes(M.prefixes))}get _inDefaultGraph(){return S.equals(this._graph)}_write(K,M){this._outputStream.write(K,"utf8",M)}_writeQuad(K,M,F,Q,E){try{Q.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(S.equals(Q)?"":`${this._encodeIriOrBlank(Q)} {\n`)),this._graph=Q,this._subject=null),K.equals(this._subject)?M.equals(this._predicate)?this._write(`, ${this._encodeObject(F)}`,E):this._write(`;\n ${this._encodePredicate(this._predicate=M)} ${this._encodeObject(F)}`,E):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=K)} ${this._encodePredicate(this._predicate=M)} ${this._encodeObject(F)}`,E)}catch(U){E&&E(U)}}_writeQuadLine(K,M,F,Q,E){delete this._prefixMatch,this._write(this.quadToString(K,M,F,Q),E)}quadToString(K,M,F,Q){return`${this._encodeSubject(K)} ${this._encodeIriOrBlank(M)} ${this._encodeObject(F)}${Q&&Q.value?` ${this._encodeIriOrBlank(Q)} .\n`:" .\n"}`}quadsToString(K){return K.map(M=>this.quadToString(M.subject,M.predicate,M.object,M.graph)).join("")}_encodeSubject(K){return"Quad"===K.termType?this._encodeQuad(K):this._encodeIriOrBlank(K)}_encodeIriOrBlank(K){if("NamedNode"!==K.termType)return this._lists&&K.value in this._lists&&(K=this.list(this._lists[K.value])),"id"in K?K.id:`_:${K.value}`;let M=K.value;this._baseIRI&&M.startsWith(this._baseIRI)&&(M=M.substr(this._baseIRI.length)),v.test(M)&&(M=M.replace(y,I));const F=this._prefixRegex.exec(M);return F?F[1]?this._prefixIRIs[F[1]]+F[2]:M:`<${M}>`}_encodeLiteral(K){let M=K.value;if(v.test(M)&&(M=M.replace(y,I)),K.language)return`"${M}"@${K.language}`;if(this._lineMode){if(K.datatype.value===A.string)return`"${M}"`}else switch(K.datatype.value){case A.string:return`"${M}"`;case A.boolean:if("true"===M||"false"===M)return M;break;case A.integer:if(/^[+-]?\d+$/.test(M))return M;break;case A.decimal:if(/^[+-]?\d*\.\d+$/.test(M))return M;break;case A.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(M))return M}return`"${M}"^^${this._encodeIriOrBlank(K.datatype)}`}_encodePredicate(K){return K.value===R.type?"a":this._encodeIriOrBlank(K)}_encodeObject(K){switch(K.termType){case"Quad":return this._encodeQuad(K);case"Literal":return this._encodeLiteral(K);default:return this._encodeIriOrBlank(K)}}_encodeQuad({subject:K,predicate:M,object:F,graph:Q}){return`<<${this._encodeSubject(K)} ${this._encodePredicate(M)} ${this._encodeObject(F)}${(0,L.isDefaultGraph)(Q)?"":` ${this._encodeIriOrBlank(Q)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(K,M,F,Q,E){void 0===F?this._writeQuad(K.subject,K.predicate,K.object,K.graph,M):"function"==typeof Q?this._writeQuad(K,M,F,S,Q):this._writeQuad(K,M,F,Q||S,E)}addQuads(K){for(let M=0;M.\n`)}if(F){let Q="",E="";for(const U in this._prefixIRIs)Q+=Q?`|${U}`:U,E+=(E?"|":"")+this._prefixIRIs[U];Q=Q.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${E})[^/]*$|^(${Q})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(F?"\n":"",M)}blank(K,M){let Q,E,F=K;switch(void 0===K?F=[]:K.termType?F=[{predicate:K,object:M}]:"length"in K||(F=[K]),E=F.length){case 0:return new D("[]");case 1:if(Q=F[0],!(Q.object instanceof D))return new D(`[ ${this._encodePredicate(Q.predicate)} ${this._encodeObject(Q.object)} ]`);default:let U="[";for(let ie=0;ie{M=null,K(F,Q)});if(this._endStream)try{return this._outputStream.end(M)}catch(F){}M&&M()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return R.Term}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return R.NamedNode}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return R.Literal}}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return R.BlankNode}}),Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return R.Variable}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return R.DefaultGraph}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return R.Quad}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return R.Triple}}),Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return R.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return R.termToId}}),he.Util=void 0;var W=y(Y("./N3Lexer")),V=y(Y("./N3Parser")),L=y(Y("./N3Writer")),re=y(Y("./N3Store")),$=y(Y("./N3StreamParser")),b=y(Y("./N3StreamWriter")),S=v(Y("./N3Util"));he.Util=S;var R=v(Y("./N3DataFactory"));function A(w){if("function"!=typeof WeakMap)return null;var D=new WeakMap,j=new WeakMap;return(A=function(I){return I?j:D})(w)}function v(w,D){if(!D&&w&&w.__esModule)return w;if(null===w||"object"!=typeof w&&"function"!=typeof w)return{default:w};var j=A(D);if(j&&j.has(w))return j.get(w);var I={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var K in w)if("default"!==K&&Object.prototype.hasOwnProperty.call(w,K)){var M=H?Object.getOwnPropertyDescriptor(w,K):null;M&&(M.get||M.set)?Object.defineProperty(I,K,M):I[K]=w[K]}return I.default=w,j&&j.set(w,I),I}function y(w){return w&&w.__esModule?w:{default:w}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Ae,he){var V,L,W=Ae.exports={};function re(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function b(H){if(V===setTimeout)return setTimeout(H,0);if((V===re||!V)&&setTimeout)return V=setTimeout,setTimeout(H,0);try{return V(H,0)}catch(K){try{return V.call(null,H,0)}catch(M){return V.call(this,H,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:re}catch(H){V=re}try{L="function"==typeof clearTimeout?clearTimeout:$}catch(H){L=$}}();var v,R=[],A=!1,y=-1;function w(){!A||!v||(A=!1,v.length?R=v.concat(R):y=-1,R.length&&D())}function D(){if(!A){var H=b(w);A=!0;for(var K=R.length;K;){for(v=R,R=[];++y1)for(var M=1;M(V||(V=Promise.resolve())).then(L).catch(re=>setTimeout(()=>{throw re},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Ae,he){Ae.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Ae,he){"use strict";Ae.exports=class vW{constructor(V,L=new Map,re=0){this.prefix=V,this._existing=L,this.counter=re}clone(){const{prefix:V,_existing:L,counter:re}=this;return new vW(V,new Map(L),re)}getId(V){const L=V&&this._existing.get(V);if(L)return L;const re=this.prefix+this.counter;return this.counter++,V&&this._existing.set(V,re),re}hasId(V){return this._existing.has(V)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Ae,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Ae.exports=class{constructor(L){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===L)this.algorithm={name:"SHA-256"};else{if("sha1"!==L)throw new Error(`Unsupport algorithm "${L}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(L){this._content+=L}digest(){var L=this;return gt(function*(){const re=(new TextEncoder).encode(L._content),$=new Uint8Array(yield W.subtle.digest(L.algorithm,re));let b="";for(let S=0;S<$.length;++S)b+=$[S].toString(16).padStart(2,"0");return b})()}}},{setimmediate:86}],49:[function(Y,Ae,he){"use strict";const L="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",re="http://www.w3.org/2001/XMLSchema#string",$="NamedNode",b="BlankNode",S="Literal",R="DefaultGraph",A={};function v(I,H){return I.subject.termType===H.subject.termType&&I.object.termType===H.object.termType&&I.subject.value===H.subject.value&&I.predicate.value===H.predicate.value&&I.object.value===H.object.value&&(I.object.termType!==S||I.object.datatype.termType===H.object.datatype.termType&&I.object.language===H.object.language&&I.object.datatype.value===H.object.datatype.value)}A.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,A.empty=new RegExp("^[ \\t]*$"),A.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),Ae.exports=class pP{static parse(H){const K=[],M={},F=H.split(A.eoln);let Q=0;for(const E of F){if(Q++,A.empty.test(E))continue;const U=E.match(A.quad);if(null===U)throw new Error("N-Quads parse error on line "+Q+".");const ie={subject:null,predicate:null,object:null,graph:null};if(ie.subject=void 0!==U[1]?{termType:$,value:U[1]}:{termType:b,value:U[2]},ie.predicate={termType:$,value:U[3]},void 0!==U[4]?ie.object={termType:$,value:U[4]}:void 0!==U[5]?ie.object={termType:b,value:U[5]}:(ie.object={termType:S,value:void 0,datatype:{termType:$}},void 0!==U[7]?ie.object.datatype.value=U[7]:void 0!==U[8]?(ie.object.datatype.value=L,ie.object.language=U[8]):ie.object.datatype.value=re,ie.object.value=U[6].replace(D,function(H,K,M,F){if(K)switch(K){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(M)return String.fromCharCode(parseInt(M,16));if(F)throw new Error("Unsupported U escape")})),ie.graph=void 0!==U[9]?{termType:$,value:U[9]}:void 0!==U[10]?{termType:b,value:U[10]}:{termType:R,value:""},ie.graph.value in M){let ue=!0;const ee=M[ie.graph.value];for(const se of ee)if(v(se,ie)){ue=!1;break}ue&&(ee.push(ie),K.push(ie))}else M[ie.graph.value]=[ie],K.push(ie)}return K}static serialize(H){Array.isArray(H)||(H=pP.legacyDatasetToQuads(H));const K=[];for(const M of H)K.push(pP.serializeQuad(M));return K.sort().join("")}static serializeQuad(H){const K=H.subject,F=H.object,Q=H.graph;let E="";return E+=K.termType===$?`<${K.value}>`:`${K.value}`,E+=` <${H.predicate.value}> `,F.termType===$?E+=`<${F.value}>`:F.termType===b?E+=F.value:(E+=`"${I=F.value,I.replace(y,function(H){switch(H){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,F.datatype.value===L?F.language&&(E+=`@${F.language}`):F.datatype.value!==re&&(E+=`^^<${F.datatype.value}>`)),Q.termType===$?E+=` <${Q.value}>`:Q.termType===b&&(E+=` ${Q.value}`),E+=" .\n",E;var I}static legacyDatasetToQuads(H){const K=[],M={"blank node":b,IRI:$,literal:S};for(const F in H)H[F].forEach(E=>{const U={};for(const ie in E){const ue=E[ie],ee={termType:M[ue.type],value:ue.value};ee.termType===S&&(ee.datatype={termType:$},"datatype"in ue&&(ee.datatype.value=ue.datatype),"language"in ue?("datatype"in ue||(ee.datatype.value=L),ee.language=ue.language):"datatype"in ue||(ee.datatype.value=re)),U[ie]=ee}U.graph="@default"===F?{termType:R,value:""}:{termType:F.startsWith("_:")?b:$,value:F},K.push(U)});return K}};const y=/["\\\n\r]/g;const D=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Ae,he){"use strict";Ae.exports=class{constructor(V){this.current=V.sort(),this.done=!1,this.dir=new Map;for(let L=0;L$)&&(v&&R>0&&A>V[R-1]||!v&&RV[R+1])&&($=A,b=R)}if(null===$)this.done=!0;else{const R=L.get($)?b-1:b+1;V[b]=V[R],V[R]=$;for(const A of V)A>$&&L.set(A,!L.get(A))}return re}}},{}],51:[function(Y,Ae,he){(function(W){(function(){"use strict";const V=Y("./IdentifierIssuer"),L=Y("./MessageDigest"),re=Y("./Permuter"),$=Y("./NQuads");function b(S,R){return S.hashR.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new V("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(R){var A=this;return gt(function*(){A.quads=R;for(const H of R)A._addBlankNodeQuadInfo({quad:H,component:H.subject}),A._addBlankNodeQuadInfo({quad:H,component:H.object}),A._addBlankNodeQuadInfo({quad:H,component:H.graph});const v=new Map,y=[...A.blankNodeInfo.keys()];let w=0;for(const H of y)++w%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:H,hashToBlankNodes:v});const D=[...v.keys()].sort(),j=[];for(const H of D){const K=v.get(H);K.length>1?j.push(K):A.canonicalIssuer.getId(K[0])}for(const H of j){const K=[];for(const M of H){if(A.canonicalIssuer.hasId(M))continue;const F=new V("_:b");F.getId(M);const Q=yield A.hashNDegreeQuads(M,F);K.push(Q)}K.sort(b);for(const M of K){const F=M.issuer.getOldIds();for(const Q of F)A.canonicalIssuer.getId(Q)}}const I=[];for(const H of A.quads){const K=ht({},H);K.subject=A._useCanonicalId({component:K.subject}),K.object=A._useCanonicalId({component:K.object}),K.graph=A._useCanonicalId({component:K.graph}),I.push($.serializeQuad(K))}return I.sort(),I.join("")})()}hashFirstDegreeQuads(R){var A=this;return gt(function*(){const v=[],y=A.blankNodeInfo.get(R),w=y.quads;for(const j of w){const I={subject:null,predicate:j.predicate,object:null,graph:null};I.subject=A.modifyFirstDegreeComponent(R,j.subject,"subject"),I.object=A.modifyFirstDegreeComponent(R,j.object,"object"),I.graph=A.modifyFirstDegreeComponent(R,j.graph,"graph"),v.push($.serializeQuad(I))}v.sort();const D=new L(A.hashAlgorithm);for(const j of v)D.update(j);return y.hash=yield D.digest(),y.hash})()}hashRelatedBlankNode(R,A,v,y){var w=this;return gt(function*(){let D;D=w.canonicalIssuer.hasId(R)?w.canonicalIssuer.getId(R):v.hasId(R)?v.getId(R):w.blankNodeInfo.get(R).hash;const j=new L(w.hashAlgorithm);return j.update(y),"g"!==y&&j.update(w.getRelatedPredicate(A)),j.update(D),j.digest()})()}hashNDegreeQuads(R,A){var v=this;return gt(function*(){const y=new L(v.hashAlgorithm),w=yield v.createHashToRelated(R,A),D=[...w.keys()].sort();for(const j of D){y.update(j);let H,I="";const K=new re(w.get(j));let M=0;for(;K.hasNext();){const F=K.next();++M%3==0&&(yield v._yield());let Q=A.clone(),E="";const U=[];let ie=!1;for(const ue of F)if(v.canonicalIssuer.hasId(ue)?E+=v.canonicalIssuer.getId(ue):(Q.hasId(ue)||U.push(ue),E+=Q.getId(ue)),0!==I.length&&E>I){ie=!0;break}if(!ie){for(const ue of U){const ee=yield v.hashNDegreeQuads(ue,Q);if(E+=Q.getId(ue),E+=`<${ee.hash}>`,Q=ee.issuer,0!==I.length&&E>I){ie=!0;break}}ie||(0===I.length||E`}createHashToRelated(R,A){var v=this;return gt(function*(){const y=new Map,w=v.blankNodeInfo.get(R).quads;let D=0;for(const j of w)++D%100==0&&(yield v._yield()),yield Promise.all([v._addRelatedBlankNodeHash({quad:j,component:j.subject,position:"s",id:R,issuer:A,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.object,position:"o",id:R,issuer:A,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.graph,position:"g",id:R,issuer:A,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:R,hashToBlankNodes:A}){var v=this;return gt(function*(){const y=yield v.hashFirstDegreeQuads(R),w=A.get(y);w?w.push(R):A.set(y,[R])})()}_addBlankNodeQuadInfo({quad:R,component:A}){if("BlankNode"!==A.termType)return;const v=A.value,y=this.blankNodeInfo.get(v);y?y.quads.add(R):this.blankNodeInfo.set(v,{quads:new Set([R]),hash:null})}_addRelatedBlankNodeHash({quad:R,component:A,position:v,id:y,issuer:w,hashToRelated:D}){var j=this;return gt(function*(){if("BlankNode"!==A.termType||A.value===y)return;const I=A.value,H=yield j.hashRelatedBlankNode(I,R,w,v),K=D.get(H);K?K.push(I):D.set(H,[I])})()}_useCanonicalId({component:R}){return"BlankNode"!==R.termType||R.value.startsWith(this.canonicalIssuer.prefix)?R:{termType:"BlankNode",value:this.canonicalIssuer.getId(R.value)}}_yield(){return gt(function*(){return new Promise(R=>W(R))})()}}}).call(this)}).call(this,Y("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(Y,Ae,he){"use strict";const W=Y("./IdentifierIssuer"),V=Y("./MessageDigest"),L=Y("./Permuter"),re=Y("./NQuads");function $(b,S){return b.hashS.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(S){this.quads=S;for(const D of S)this._addBlankNodeQuadInfo({quad:D,component:D.subject}),this._addBlankNodeQuadInfo({quad:D,component:D.object}),this._addBlankNodeQuadInfo({quad:D,component:D.graph});const R=new Map,A=[...this.blankNodeInfo.keys()];for(const D of A)this._hashAndTrackBlankNode({id:D,hashToBlankNodes:R});const v=[...R.keys()].sort(),y=[];for(const D of v){const j=R.get(D);j.length>1?y.push(j):this.canonicalIssuer.getId(j[0])}for(const D of y){const j=[];for(const I of D){if(this.canonicalIssuer.hasId(I))continue;const H=new W("_:b");H.getId(I);const K=this.hashNDegreeQuads(I,H);j.push(K)}j.sort($);for(const I of j){const H=I.issuer.getOldIds();for(const K of H)this.canonicalIssuer.getId(K)}}const w=[];for(const D of this.quads){const j=ht({},D);j.subject=this._useCanonicalId({component:j.subject}),j.object=this._useCanonicalId({component:j.object}),j.graph=this._useCanonicalId({component:j.graph}),w.push(re.serializeQuad(j))}return w.sort(),w.join("")}hashFirstDegreeQuads(S){const R=[],A=this.blankNodeInfo.get(S),v=A.quads;for(const w of v){const D={subject:null,predicate:w.predicate,object:null,graph:null};D.subject=this.modifyFirstDegreeComponent(S,w.subject,"subject"),D.object=this.modifyFirstDegreeComponent(S,w.object,"object"),D.graph=this.modifyFirstDegreeComponent(S,w.graph,"graph"),R.push(re.serializeQuad(D))}R.sort();const y=new V(this.hashAlgorithm);for(const w of R)y.update(w);return A.hash=y.digest(),A.hash}hashRelatedBlankNode(S,R,A,v){let y;y=this.canonicalIssuer.hasId(S)?this.canonicalIssuer.getId(S):A.hasId(S)?A.getId(S):this.blankNodeInfo.get(S).hash;const w=new V(this.hashAlgorithm);return w.update(v),"g"!==v&&w.update(this.getRelatedPredicate(R)),w.update(y),w.digest()}hashNDegreeQuads(S,R){const A=new V(this.hashAlgorithm),v=this.createHashToRelated(S,R),y=[...v.keys()].sort();for(const w of y){A.update(w);let j,D="";const I=new L(v.get(w));for(;I.hasNext();){const H=I.next();let K=R.clone(),M="";const F=[];let Q=!1;for(const E of H)if(this.canonicalIssuer.hasId(E)?M+=this.canonicalIssuer.getId(E):(K.hasId(E)||F.push(E),M+=K.getId(E)),0!==D.length&&M>D){Q=!0;break}if(!Q){for(const E of F){const U=this.hashNDegreeQuads(E,K);if(M+=K.getId(E),M+=`<${U.hash}>`,K=U.issuer,0!==D.length&&M>D){Q=!0;break}}Q||(0===D.length||M`}createHashToRelated(S,R){const A=new Map,v=this.blankNodeInfo.get(S).quads;for(const y of v)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:S,issuer:R,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:S,issuer:R,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:S,issuer:R,hashToRelated:A});return A}_hashAndTrackBlankNode({id:S,hashToBlankNodes:R}){const A=this.hashFirstDegreeQuads(S),v=R.get(A);v?v.push(S):R.set(A,[S])}_addBlankNodeQuadInfo({quad:S,component:R}){if("BlankNode"!==R.termType)return;const A=R.value,v=this.blankNodeInfo.get(A);v?v.quads.add(S):this.blankNodeInfo.set(A,{quads:new Set([S]),hash:null})}_addRelatedBlankNodeHash({quad:S,component:R,position:A,id:v,issuer:y,hashToRelated:w}){if("BlankNode"!==R.termType||R.value===v)return;const D=R.value,j=this.hashRelatedBlankNode(D,S,y,A),I=w.get(j);I?I.push(D):w.set(j,[D])}_useCanonicalId({component:S}){return"BlankNode"!==S.termType||S.value.startsWith(this.canonicalIssuer.prefix)?S:{termType:"BlankNode",value:this.canonicalIssuer.getId(S.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015");Ae.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){var $=this;return gt(function*(){const b=new Map,S=$.blankNodeInfo.get(L).quads;let R=0;for(const A of S){let v,y;if("BlankNode"===A.subject.termType&&A.subject.value!==L)y=A.subject.value,v="p";else{if("BlankNode"!==A.object.termType||A.object.value===L)continue;y=A.object.value,v="r"}++R%100==0&&(yield $._yield());const w=yield $.hashRelatedBlankNode(y,A,re,v),D=b.get(w);D?D.push(y):b.set(w,[y])}return b})()}}},{"./URDNA2015":51}],54:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015Sync");Ae.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){const $=new Map,b=this.blankNodeInfo.get(L).quads;for(const S of b){let R,A;if("BlankNode"===S.subject.termType&&S.subject.value!==L)A=S.subject.value,R="p";else{if("BlankNode"!==S.object.termType||S.object.value===L)continue;A=S.object.value,R="r"}const v=this.hashRelatedBlankNode(A,S,re,R),y=$.get(v);y?y.push(A):$.set(v,[A])}return $}}},{"./URDNA2015Sync":52}],55:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015"),V=Y("./URGNA2012"),L=Y("./URDNA2015Sync"),re=Y("./URGNA2012Sync");let $;try{$=Y("rdf-canonize-native")}catch(S){}const b={};Ae.exports=b,b.NQuads=Y("./NQuads"),b.IdentifierIssuer=Y("./IdentifierIssuer"),b._rdfCanonizeNative=function(S){return S&&($=S),$},b.canonize=function(){var S=gt(function*(R,A){if(Array.isArray(R)||(R=b.NQuads.legacyDatasetToQuads(R)),A.useNative){if(!$)throw new Error("rdf-canonize-native not available");return new Promise((v,y)=>$.canonize(R,A,(w,D)=>w?y(w):v(D)))}if("URDNA2015"===A.algorithm)return new W(A).main(R);if("URGNA2012"===A.algorithm)return new V(A).main(R);throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(R,A){return S.apply(this,arguments)}}(),b._canonizeSync=function(S,R){if(Array.isArray(S)||(S=b.NQuads.legacyDatasetToQuads(S)),R.useNative){if($)return $.canonizeSync(S,R);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===R.algorithm)return new L(R).main(S);if("URGNA2012"===R.algorithm)return new re(R).main(S);throw"algorithm"in R?new Error("Invalid RDF Dataset Canonicalization algorithm: "+R.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(Y,Ae,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&W(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(Y("./lib/BlankNode"),he),V(Y("./lib/DataFactory"),he),V(Y("./lib/DefaultGraph"),he),V(Y("./lib/Literal"),he),V(Y("./lib/NamedNode"),he),V(Y("./lib/Quad"),he),V(Y("./lib/Variable"),he)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(L){this.termType="BlankNode",this.value=L}equals(L){return!!L&&"BlankNode"===L.termType&&L.value===this.value}}},{}],58:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),V=Y("./DefaultGraph"),L=Y("./Literal"),re=Y("./NamedNode"),$=Y("./Quad"),b=Y("./Variable");let S=0;he.DataFactory=class{constructor(v){this.blankNodeCounter=0,this.blankNodePrefix=(v=v||{}).blankNodePrefix||`df_${S++}_`}namedNode(v){return new re.NamedNode(v)}blankNode(v){return new W.BlankNode(v||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(v,y){return new L.Literal(v,y)}variable(v){return new b.Variable(v)}defaultGraph(){return V.DefaultGraph.INSTANCE}quad(v,y,w,D){return new $.Quad(v,y,w,D||this.defaultGraph())}fromTerm(v){switch(v.termType){case"NamedNode":return this.namedNode(v.value);case"BlankNode":return this.blankNode(v.value);case"Literal":return v.language?this.literal(v.value,v.language):v.datatype.equals(L.Literal.XSD_STRING)?this.literal(v.value):this.literal(v.value,this.fromTerm(v.datatype));case"Variable":return this.variable(v.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(v.subject),this.fromTerm(v.predicate),this.fromTerm(v.object),this.fromTerm(v.graph))}}fromQuad(v){return this.fromTerm(v)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(L){return!!L&&"DefaultGraph"===L.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class V{constructor(re,$){this.termType="Literal",this.value=re,"string"==typeof $?(this.language=$,this.datatype=V.RDF_LANGUAGE_STRING):$?(this.language="",this.datatype=$):(this.language="",this.datatype=V.XSD_STRING)}equals(re){return!!re&&"Literal"===re.termType&&re.value===this.value&&re.language===this.language&&re.datatype.equals(this.datatype)}}he.Literal=V,V.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),V.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(L){this.termType="NamedNode",this.value=L}equals(L){return!!L&&"NamedNode"===L.termType&&L.value===this.value}}},{}],62:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(L,re,$,b){this.termType="Quad",this.value="",this.subject=L,this.predicate=re,this.object=$,this.graph=b}equals(L){return!!L&&("Quad"===L.termType||!L.termType)&&this.subject.equals(L.subject)&&this.predicate.equals(L.predicate)&&this.object.equals(L.object)&&this.graph.equals(L.graph)}}},{}],63:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(L){this.termType="Variable",this.value=L}equals(L){return!!L&&"Variable"===L.termType&&L.value===this.value}}},{}],64:[function(Y,Ae,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&W(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(L,re){const $=L.saxStream._parser;super(L.trackPosition?`Line ${$.line+1} column ${$.column+1}: ${re}`:re)}}he.ParseError=W},{}],66:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),V=Y("sax"),L=Y("stream"),re=Y("./ParseError"),$=Y("rdf-data-factory");class b extends L.Transform{constructor(A){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},A&&(Object.assign(this,A),this.options=A),this.dataFactory||(this.dataFactory=new $.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=V.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(A,v){const y={};let w=!1;for(const j in A.attributes)j.startsWith("xmlns")&&(5===j.length?(w=!0,y[""]=A.attributes[j]):":"===j.charAt(5)&&(w=!0,y[j.substr(6)]=A.attributes[j]));const D=v&&v.ns?v.ns:[b.DEFAULT_NS];return w?D.concat([y]):D}static expandPrefixedTerm(A,v,y){const w=A.indexOf(":");let D,j;w>=0?(D=A.substr(0,w),j=A.substr(w+1)):(D="",j=A);let I=null,H=null;for(let K=v.length-1;K>=0;K--){const M=v[K][D];if(M){I=M;break}H||(H=v[K][""])}if(!I){if(D&&"xmlns"!==D)throw new re.ParseError(y,`The prefix '${D}' in term '${A}' was not bound.`);I=H||""}return{prefix:D,local:j,uri:I}}static isValidIri(A){return b.IRI_REGEX.test(A)}import(A){const v=new L.PassThrough({readableObjectMode:!0});A.on("error",w=>y.emit("error",w)),A.on("data",w=>v.push(w)),A.on("end",()=>v.push(null));const y=v.pipe(new b(this.options));return y}_transform(A,v,y){try{this.saxStream.write(A,v)}catch(w){return y(w)}y()}newParseError(A){return new re.ParseError(this,A)}valueToUri(A,v){return this.uriToNamedNode(W.resolve(A,v.baseIRI))}uriToNamedNode(A){if(!b.isValidIri(A))throw this.newParseError(`Invalid URI: ${A}`);return this.dataFactory.namedNode(A)}validateNcname(A){if(!b.NCNAME_MATCHER.test(A))throw this.newParseError(`Not a valid NCName: ${A}`)}attachSaxListeners(){this.saxStream.on("error",A=>this.emit("error",A)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(A){const v=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=S.RESOURCE;if(v&&(v.hadChildren=!0,y=v.childrenParseType),v&&v.childrenStringTags){const D=A.name;let j="";for(const M in A.attributes)j+=` ${M}="${A.attributes[M]}"`;v.childrenStringTags.push(`<${D}${j}>`);const K={childrenStringTags:v.childrenStringTags};return K.childrenStringEmitClosingTag=``,void this.activeTagStack.push(K)}const w={};v?(w.language=v.language,w.baseIRI=v.baseIRI):w.baseIRI=this.baseIRI,this.activeTagStack.push(w),w.ns=b.parseNamespace(A,v),y===S.RESOURCE?this.onTagResource(A,w,v,!v):this.onTagProperty(A,w,v)}onTagResource(A,v,y,w){const D=b.expandPrefixedTerm(A.name,v.ns,this);v.childrenParseType=S.PROPERTY;let j=!0;if(D.uri===b.RDF){if(!w&&b.FORBIDDEN_NODE_ELEMENTS.indexOf(D.local)>=0)throw this.newParseError(`Illegal node element name: ${D.local}`);switch(D.local){case"RDF":v.childrenParseType=S.RESOURCE;case"Description":j=!1}}const I=[],H=[];let K=null,M=!1,F=!1,Q=null;for(const E in A.attributes){const U=A.attributes[E],ie=b.expandPrefixedTerm(E,v.ns,this);if(y&&ie.uri===b.RDF)switch(ie.local){case"about":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);K=U;continue;case"ID":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);this.validateNcname(U),K="#"+U,M=!0;continue;case"nodeID":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);this.validateNcname(U),K=U,F=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":Q=U;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(ie.uri===b.XML){if("lang"===ie.local){v.language=""===U?null:U.toLowerCase();continue}if("base"===ie.local){v.baseIRI=W.resolve(U,v.baseIRI);continue}}"xml"!==ie.prefix&&ie.uri&&(I.push(this.uriToNamedNode(ie.uri+ie.local)),H.push(U))}if(null!==K&&(v.subject=F?this.dataFactory.blankNode(K):this.valueToUri(K,v),M&&this.claimNodeId(v.subject)),v.subject||(v.subject=this.dataFactory.blankNode()),j){const E=this.uriToNamedNode(D.uri+D.local);this.emitTriple(v.subject,this.dataFactory.namedNode(b.RDF+"type"),E,y?y.reifiedStatementId:null)}if(y){if(y.predicate)if(y.childrenCollectionSubject){const E=this.dataFactory.blankNode();this.emitTriple(y.childrenCollectionSubject,y.childrenCollectionPredicate,E,y.reifiedStatementId),this.emitTriple(E,this.dataFactory.namedNode(b.RDF+"first"),v.subject,v.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(b.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,v.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${w.local}`);v.predicateSubPredicates=[],v.predicateSubObjects=[];let D=!1,j=!1,I=null,H=!0;const K=[],M=[];for(const F in A.attributes){const Q=A.attributes[F],E=b.expandPrefixedTerm(F,v.ns,this);if(E.uri===b.RDF)switch(E.local){case"resource":if(I)throw this.newParseError(`Found both rdf:resource (${Q}) and rdf:nodeID (${I}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${Q})`);v.hadChildren=!0,I=Q,H=!1;continue;case"datatype":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${Q}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${Q})`);v.datatype=this.valueToUri(Q,v);continue;case"nodeID":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${Q}).`);if(v.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${Q}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${Q})`);this.validateNcname(Q),v.hadChildren=!0,I=Q,H=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(j)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(v.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${v.datatype.value})`);if(I)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${I})`);if("Resource"===Q){D=!0,v.childrenParseType=S.PROPERTY;const U=this.dataFactory.blankNode();this.emitTriple(v.subject,v.predicate,U,v.reifiedStatementId),v.subject=U,v.predicate=null}else"Collection"===Q?(D=!0,v.hadChildren=!0,v.childrenCollectionSubject=v.subject,v.childrenCollectionPredicate=v.predicate,H=!1):"Literal"===Q&&(D=!0,v.childrenTagsToString=!0,v.childrenStringTags=[]);continue;case"ID":this.validateNcname(Q),v.reifiedStatementId=this.valueToUri("#"+Q,v),this.claimNodeId(v.reifiedStatementId);continue}else if(E.uri===b.XML&&"lang"===E.local){v.language=""===Q?null:Q.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(D||v.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${Q}`);v.hadChildren=!0,j=!0,K.push(this.uriToNamedNode(E.uri+E.local)),M.push(this.dataFactory.literal(Q,v.datatype||v.language))}}if(null!==I){const F=v.subject;v.subject=H?this.dataFactory.blankNode(I):this.valueToUri(I,v),this.emitTriple(F,v.predicate,v.subject,v.reifiedStatementId);for(let Q=0;Q/g,(v,y,w)=>(this.saxStream._parser.ENTITIES[y]=w,""))}}var S,R;he.RdfXmlParser=b,b.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,b.MIME_TYPE="application/rdf+xml",b.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",b.XML="http://www.w3.org/XML/1998/namespace",b.XMLNS="http://www.w3.org/2000/xmlns/",b.DEFAULT_NS={xml:b.XML},b.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],b.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],b.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,(R=S=he.ParseType||(he.ParseType={}))[R.RESOURCE=0]="RESOURCE",R[R.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(Y,Ae,he){"use strict";var V={};function L(R,A,v){v||(v=Error);var w=function(D){function j(I,H,K){return D.call(this,function(D,j,I){return"string"==typeof A?A:A(D,j,I)}(I,H,K))||this}return function(R,A){R.prototype=Object.create(A.prototype),R.prototype.constructor=R,R.__proto__=A}(j,D),j}(v);w.prototype.name=v.name,w.prototype.code=R,V[R]=w}function re(R,A){if(Array.isArray(R)){var v=R.length;return R=R.map(function(y){return String(y)}),v>2?"one of ".concat(A," ").concat(R.slice(0,v-1).join(", "),", or ")+R[v-1]:2===v?"one of ".concat(A," ").concat(R[0]," or ").concat(R[1]):"of ".concat(A," ").concat(R[0])}return"of ".concat(A," ").concat(String(R))}L("ERR_INVALID_OPT_VALUE",function(R,A){return'The value "'+A+'" is invalid for option "'+R+'"'},TypeError),L("ERR_INVALID_ARG_TYPE",function(R,A,v){var y,w;if("string"==typeof A&&function(R,A,v){return R.substr(!v||v<0?0:+v,A.length)===A}(A,"not ")?(y="must not be",A=A.replace(/^not /,"")):y="must be",function(R,A,v){return(void 0===v||v>R.length)&&(v=R.length),R.substring(v-A.length,v)===A}(R," argument"))w="The ".concat(R," ").concat(y," ").concat(re(A,"type"));else{var D=function(R,A,v){return"number"!=typeof v&&(v=0),!(v+A.length>R.length)&&-1!==R.indexOf(A,v)}(R,".")?"property":"argument";w='The "'.concat(R,'" ').concat(D," ").concat(y," ").concat(re(A,"type"))}return w+". Received type ".concat(typeof v)},TypeError),L("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),L("ERR_METHOD_NOT_IMPLEMENTED",function(R){return"The "+R+" method is not implemented"}),L("ERR_STREAM_PREMATURE_CLOSE","Premature close"),L("ERR_STREAM_DESTROYED",function(R){return"Cannot call "+R+" after a stream was destroyed"}),L("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),L("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),L("ERR_STREAM_WRITE_AFTER_END","write after end"),L("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),L("ERR_UNKNOWN_ENCODING",function(R){return"Unknown encoding: "+R},TypeError),L("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.exports.codes=V},{}],68:[function(Y,Ae,he){(function(W){(function(){"use strict";var V=Object.keys||function(y){var w=[];for(var D in y)w.push(D);return w};Ae.exports=R;var L=Y("./_stream_readable"),re=Y("./_stream_writable");Y("inherits")(R,L);for(var $=V(re.prototype),b=0;b<$.length;b++){var S=$[b];R.prototype[S]||(R.prototype[S]=re.prototype[S])}function R(y){if(!(this instanceof R))return new R(y);L.call(this,y),re.call(this,y),this.allowHalfOpen=!0,y&&(!1===y.readable&&(this.readable=!1),!1===y.writable&&(this.writable=!1),!1===y.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",A)))}function A(){this._writableState.ended||W.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(w){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=w,this._writableState.destroyed=w)}})}).call(this)}).call(this,Y("_process"))},{"./_stream_readable":70,"./_stream_writable":72,_process:44,inherits:10}],69:[function(Y,Ae,he){"use strict";Ae.exports=V;var W=Y("./_stream_transform");function V(L){if(!(this instanceof V))return new V(L);W.call(this,L)}Y("inherits")(V,W),V.prototype._transform=function(L,re,$){$(null,L)}},{"./_stream_transform":71,inherits:10}],70:[function(Y,Ae,he){(function(W,V){(function(){"use strict";var L;Ae.exports=te,te.ReadableState=me,Y("events");var $=function(B,O){return B.listeners(O).length},b=Y("./internal/streams/stream"),S=Y("buffer").Buffer,R=V.Uint8Array||function(){};var w,y=Y("util");w=y&&y.debuglog?y.debuglog("stream"):function(){};var U,ie,ue,D=Y("./internal/streams/buffer_list"),j=Y("./internal/streams/destroy"),H=Y("./internal/streams/state").getHighWaterMark,K=Y("../errors").codes,M=K.ERR_INVALID_ARG_TYPE,F=K.ERR_STREAM_PUSH_AFTER_EOF,Q=K.ERR_METHOD_NOT_IMPLEMENTED,E=K.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Y("inherits")(te,b);var ee=j.errorOrDestroy,se=["error","close","destroy","pause","resume"];function me(pe,B,O){L=L||Y("./_stream_duplex"),"boolean"!=typeof O&&(O=B instanceof L),this.objectMode=!!(pe=pe||{}).objectMode,O&&(this.objectMode=this.objectMode||!!pe.readableObjectMode),this.highWaterMark=H(this,pe,"readableHighWaterMark",O),this.buffer=new D,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==pe.emitClose,this.autoDestroy=!!pe.autoDestroy,this.destroyed=!1,this.defaultEncoding=pe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,pe.encoding&&(U||(U=Y("string_decoder/").StringDecoder),this.decoder=new U(pe.encoding),this.encoding=pe.encoding)}function te(pe){if(L=L||Y("./_stream_duplex"),!(this instanceof te))return new te(pe);this._readableState=new me(pe,this,this instanceof L),this.readable=!0,pe&&("function"==typeof pe.read&&(this._read=pe.read),"function"==typeof pe.destroy&&(this._destroy=pe.destroy)),b.call(this)}function ye(pe,B,O,k,Re){w("readableAddChunk",B);var yt,Xe=pe._readableState;if(null===B)Xe.reading=!1,function(pe,B){if(w("onEofChunk"),!B.ended){if(B.decoder){var O=B.decoder.end();O&&O.length&&(B.buffer.push(O),B.length+=B.objectMode?1:O.length)}B.ended=!0,B.sync?je(pe):(B.needReadable=!1,B.emittedReadable||(B.emittedReadable=!0,Le(pe)))}}(pe,Xe);else if(Re||(yt=function(pe,B){var O;return!function(pe){return S.isBuffer(pe)||pe instanceof R}(B)&&"string"!=typeof B&&void 0!==B&&!pe.objectMode&&(O=new M("chunk",["string","Buffer","Uint8Array"],B)),O}(Xe,B)),yt)ee(pe,yt);else if(Xe.objectMode||B&&B.length>0)if("string"!=typeof B&&!Xe.objectMode&&Object.getPrototypeOf(B)!==S.prototype&&(B=function(pe){return S.from(pe)}(B)),k)Xe.endEmitted?ee(pe,new E):Me(pe,Xe,B,!0);else if(Xe.ended)ee(pe,new F);else{if(Xe.destroyed)return!1;Xe.reading=!1,Xe.decoder&&!O?(B=Xe.decoder.write(B),Xe.objectMode||0!==B.length?Me(pe,Xe,B,!1):Ee(pe,Xe)):Me(pe,Xe,B,!1)}else k||(Xe.reading=!1,Ee(pe,Xe));return!Xe.ended&&(Xe.lengthB.highWaterMark&&(B.highWaterMark=function(pe){return pe>=nt?pe=nt:(pe--,pe|=pe>>>1,pe|=pe>>>2,pe|=pe>>>4,pe|=pe>>>8,pe|=pe>>>16,pe++),pe}(pe)),pe<=B.length?pe:B.ended?B.length:(B.needReadable=!0,0))}function je(pe){var B=pe._readableState;w("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(w("emitReadable",B.flowing),B.emittedReadable=!0,W.nextTick(Le,pe))}function Le(pe){var B=pe._readableState;w("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(pe.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,be(pe)}function Ee(pe,B){B.readingMore||(B.readingMore=!0,W.nextTick(Oe,pe,B))}function Oe(pe,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:pe.listenerCount("data")>0&&pe.resume()}function Be(pe){w("readable nexttick read 0"),pe.read(0)}function X(pe,B){w("resume",B.reading),B.reading||pe.read(0),B.resumeScheduled=!1,pe.emit("resume"),be(pe),B.flowing&&!B.reading&&pe.read(0)}function be(pe){var B=pe._readableState;for(w("flow",B.flowing);B.flowing&&null!==pe.read(););}function ce(pe,B){return 0===B.length?null:(B.objectMode?O=B.buffer.shift():!pe||pe>=B.length?(O=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):O=B.buffer.consume(pe,B.decoder),O);var O}function Pe(pe){var B=pe._readableState;w("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,W.nextTick(Et,B,pe))}function Et(pe,B){if(w("endReadableNT",pe.endEmitted,pe.length),!pe.endEmitted&&0===pe.length&&(pe.endEmitted=!0,B.readable=!1,B.emit("end"),pe.autoDestroy)){var O=B._writableState;(!O||O.autoDestroy&&O.finished)&&B.destroy()}}function pt(pe,B){for(var O=0,k=pe.length;O=B.highWaterMark:B.length>0)||B.ended))return w("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?Pe(this):je(this),null;if(0===(pe=Je(pe,B))&&B.ended)return 0===B.length&&Pe(this),null;var Re,k=B.needReadable;return w("need readable",k),(0===B.length||B.length-pe0?ce(pe,B):null)?(B.needReadable=B.length<=B.highWaterMark,pe=0):(B.length-=pe,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),O!==pe&&B.ended&&Pe(this)),null!==Re&&this.emit("data",Re),Re},te.prototype._read=function(pe){ee(this,new Q("_read()"))},te.prototype.pipe=function(pe,B){var O=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=pe;break;case 1:k.pipes=[k.pipes,pe];break;default:k.pipes.push(pe)}k.pipesCount+=1,w("pipe count=%d opts=%j",k.pipesCount,B);var Xe=B&&!1===B.end||pe===W.stdout||pe===W.stderr?as:It;function yt(Os,zr){w("onunpipe"),Os===O&&zr&&!1===zr.hasUnpiped&&(zr.hasUnpiped=!0,w("cleanup"),pe.removeListener("close",Ur),pe.removeListener("finish",Is),pe.removeListener("drain",An),pe.removeListener("error",ci),pe.removeListener("unpipe",yt),O.removeListener("end",It),O.removeListener("end",as),O.removeListener("data",yi),Rn=!0,k.awaitDrain&&(!pe._writableState||pe._writableState.needDrain)&&An())}function It(){w("onend"),pe.end()}k.endEmitted?W.nextTick(Xe):O.once("end",Xe),pe.on("unpipe",yt);var An=function(pe){return function(){var O=pe._readableState;w("pipeOnDrain",O.awaitDrain),O.awaitDrain&&O.awaitDrain--,0===O.awaitDrain&&$(pe,"data")&&(O.flowing=!0,be(pe))}}(O);pe.on("drain",An);var Rn=!1;function yi(Os){w("ondata");var zr=pe.write(Os);w("dest.write",zr),!1===zr&&((1===k.pipesCount&&k.pipes===pe||k.pipesCount>1&&-1!==pt(k.pipes,pe))&&!Rn&&(w("false write response, pause",k.awaitDrain),k.awaitDrain++),O.pause())}function ci(Os){w("onerror",Os),as(),pe.removeListener("error",ci),0===$(pe,"error")&&ee(pe,Os)}function Ur(){pe.removeListener("finish",Is),as()}function Is(){w("onfinish"),pe.removeListener("close",Ur),as()}function as(){w("unpipe"),O.unpipe(pe)}return O.on("data",yi),function(pe,B,O){if("function"==typeof pe.prependListener)return pe.prependListener(B,O);pe._events&&pe._events[B]?Array.isArray(pe._events[B])?pe._events[B].unshift(O):pe._events[B]=[O,pe._events[B]]:pe.on(B,O)}(pe,"error",ci),pe.once("close",Ur),pe.once("finish",Is),pe.emit("pipe",O),k.flowing||(w("pipe resume"),O.resume()),pe},te.prototype.unpipe=function(pe){var B=this._readableState,O={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return pe&&pe!==B.pipes||(pe||(pe=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,pe&&pe.emit("unpipe",this,O)),this;if(!pe){var k=B.pipes,Re=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Xe=0;Xe0,!1!==k.flowing&&this.resume()):"readable"===pe&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,w("on readable",k.length,k.reading),k.length?je(this):k.reading||W.nextTick(Be,this)),O},te.prototype.removeListener=function(pe,B){var O=b.prototype.removeListener.call(this,pe,B);return"readable"===pe&&W.nextTick(qe,this),O},te.prototype.removeAllListeners=function(pe){var B=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===pe||void 0===pe)&&W.nextTick(qe,this),B},te.prototype.resume=function(){var pe=this._readableState;return pe.flowing||(w("resume"),pe.flowing=!pe.readableListening,function(pe,B){B.resumeScheduled||(B.resumeScheduled=!0,W.nextTick(X,pe,B))}(this,pe)),pe.paused=!1,this},te.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},te.prototype.wrap=function(pe){var B=this,O=this._readableState,k=!1;for(var Re in pe.on("end",function(){if(w("wrapped end"),O.decoder&&!O.ended){var yt=O.decoder.end();yt&&yt.length&&B.push(yt)}B.push(null)}),pe.on("data",function(yt){w("wrapped data"),O.decoder&&(yt=O.decoder.write(yt)),O.objectMode&&null==yt||!(O.objectMode||yt&&yt.length)||B.push(yt)||(k=!0,pe.pause())}),pe)void 0===this[Re]&&"function"==typeof pe[Re]&&(this[Re]=function(It){return function(){return pe[It].apply(pe,arguments)}}(Re));for(var Xe=0;Xe-1))throw new ie(ce);return this._writableState.defaultEncoding=ce,this},Object.defineProperty(me.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(me.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),me.prototype._write=function(be,ce,Pe){Pe(new K("_write()"))},me.prototype._writev=null,me.prototype.end=function(be,ce,Pe){var Et=this._writableState;return"function"==typeof be?(Pe=be,be=null,ce=null):"function"==typeof ce&&(Pe=ce,ce=null),null!=be&&this.write(be,ce),Et.corked&&(Et.corked=1,this.uncork()),Et.ending||function(be,ce,Pe){ce.ending=!0,Be(be,ce),Pe&&(ce.finished?W.nextTick(Pe):be.once("finish",Pe)),ce.ended=!0,be.writable=!1}(this,Et,Pe),this},Object.defineProperty(me.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(ce){!this._writableState||(this._writableState.destroyed=ce)}}),me.prototype.destroy=w.destroy,me.prototype._undestroy=w.undestroy,me.prototype._destroy=function(be,ce){ce(be)}}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(Y,Ae,he){(function(W){(function(){"use strict";var V;function L(F,Q,E){return Q in F?Object.defineProperty(F,Q,{value:E,enumerable:!0,configurable:!0,writable:!0}):F[Q]=E,F}var re=Y("./end-of-stream"),$=Symbol("lastResolve"),b=Symbol("lastReject"),S=Symbol("error"),R=Symbol("ended"),A=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function w(F,Q){return{value:F,done:Q}}function D(F){var Q=F[$];if(null!==Q){var E=F[y].read();null!==E&&(F[A]=null,F[$]=null,F[b]=null,Q(w(E,!1)))}}function j(F){W.nextTick(D,F)}var H=Object.getPrototypeOf(function(){}),K=Object.setPrototypeOf((L(V={get stream(){return this[y]},next:function(){var Q=this,E=this[S];if(null!==E)return Promise.reject(E);if(this[R])return Promise.resolve(w(void 0,!0));if(this[y].destroyed)return new Promise(function(ee,se){W.nextTick(function(){Q[S]?se(Q[S]):ee(w(void 0,!0))})});var ie,U=this[A];if(U)ie=new Promise(function(F,Q){return function(E,U){F.then(function(){Q[R]?E(w(void 0,!0)):Q[v](E,U)},U)}}(U,this));else{var ue=this[y].read();if(null!==ue)return Promise.resolve(w(ue,!1));ie=new Promise(this[v])}return this[A]=ie,ie}},Symbol.asyncIterator,function(){return this}),L(V,"return",function(){var Q=this;return new Promise(function(E,U){Q[y].destroy(null,function(ie){ie?U(ie):E(w(void 0,!0))})})}),V),H);Ae.exports=function(Q){var E,U=Object.create(K,(L(E={},y,{value:Q,writable:!0}),L(E,$,{value:null,writable:!0}),L(E,b,{value:null,writable:!0}),L(E,S,{value:null,writable:!0}),L(E,R,{value:Q._readableState.endEmitted,writable:!0}),L(E,v,{value:function(ue,ee){var se=U[y].read();se?(U[A]=null,U[$]=null,U[b]=null,ue(w(se,!1))):(U[$]=ue,U[b]=ee)},writable:!0}),E));return U[A]=null,re(Q,function(ie){if(ie&&"ERR_STREAM_PREMATURE_CLOSE"!==ie.code){var ue=U[b];return null!==ue&&(U[A]=null,U[$]=null,U[b]=null,ue(ie)),void(U[S]=ie)}var ee=U[$];null!==ee&&(U[A]=null,U[$]=null,U[b]=null,ee(w(void 0,!0))),U[R]=!0}),Q.on("readable",j.bind(null,U)),U}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Ae,he){"use strict";function W(D,j){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(D);j&&(H=H.filter(function(K){return Object.getOwnPropertyDescriptor(D,K).enumerable})),I.push.apply(I,H)}return I}function L(D,j,I){return j in D?Object.defineProperty(D,j,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[j]=I,D}function $(D,j){for(var I=0;I0?this.tail.next=H:this.head=H,this.tail=H,++this.length}},{key:"unshift",value:function(I){var H={data:I,next:this.head};0===this.length&&(this.tail=H),this.head=H,++this.length}},{key:"shift",value:function(){if(0!==this.length){var I=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,I}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(I){if(0===this.length)return"";for(var H=this.head,K=""+H.data;H=H.next;)K+=I+H.data;return K}},{key:"concat",value:function(I){if(0===this.length)return R.alloc(0);for(var H=R.allocUnsafe(I>>>0),K=this.head,M=0;K;)w(K.data,H,M),M+=K.data.length,K=K.next;return H}},{key:"consume",value:function(I,H){var K;return IF.length?F.length:I;if(M+=Q===F.length?F:F.slice(0,I),0==(I-=Q)){Q===F.length?(++K,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=F.slice(Q));break}++K}return this.length-=K,M}},{key:"_getBuffer",value:function(I){var H=R.allocUnsafe(I),K=this.head,M=1;for(K.data.copy(H),I-=K.data.length;K=K.next;){var F=K.data,Q=I>F.length?F.length:I;if(F.copy(H,H.length-I,0,Q),0==(I-=Q)){Q===F.length?(++M,this.head=K.next?K.next:this.tail=null):(this.head=K,K.data=F.slice(Q));break}++M}return this.length-=M,H}},{key:y,value:function(I,H){return v(this,function(D){for(var j=1;j0,function(ie){K||(K=ie),ie&&M.forEach(A),!E&&(M.forEach(A),H(K))})});return j.reduce(v)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Ae,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Ae.exports={getHighWaterMark:function(re,$,b,S){var R=function(re,$,b){return null!=re.highWaterMark?re.highWaterMark:$?re[b]:null}($,S,b);if(null!=R){if(!isFinite(R)||Math.floor(R)!==R||R<0)throw new W(S?b:"highWaterMark",R);return Math.floor(R)}return re.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Ae,he){Ae.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Ae,he){(he=Ae.exports=Y("./lib/_stream_readable.js")).Stream=he,he.Readable=he,he.Writable=Y("./lib/_stream_writable.js"),he.Duplex=Y("./lib/_stream_duplex.js"),he.Transform=Y("./lib/_stream_transform.js"),he.PassThrough=Y("./lib/_stream_passthrough.js"),he.finished=Y("./lib/internal/streams/end-of-stream.js"),he.pipeline=Y("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(V){for(var L in V)he.hasOwnProperty(L)||(he[L]=V[L])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Ae,he){"use strict";function V($){const b=[];let S=0;for(;S<$.length;)switch($[S]){case"/":if("."===$[S+1])if("."===$[S+2]){if(!re($[S+3])){b.push([]),S++;break}b.pop(),$[S+3]||b.push([]),S+=3}else{if(!re($[S+2])){b.push([]),S++;break}$[S+2]||b.push([]),S+=2}else b.push([]),S++;break;case"#":case"?":b.length||b.push([]),b[b.length-1].push($.substr(S)),S=$.length;break;default:b.length||b.push([]),b[b.length-1].push($[S]),S++}return"/"+b.map(R=>R.join("")).join("/")}function L($,b){let S=b+1;b>=0?"/"===$[b+1]&&"/"===$[b+2]&&(S=b+3):"/"===$[0]&&"/"===$[1]&&(S=2);const R=$.indexOf("/",S);return R<0?$:$.substr(0,R)+V($.substr(R))}function re($){return!$||"#"===$||"?"===$||"/"===$}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function($,b){const S=(b=b||"").indexOf("#");if(S>0&&(b=b.substr(0,S)),!$.length){if(b.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);return b}if($.startsWith("?")){const j=b.indexOf("?");return j>0&&(b=b.substr(0,j)),b+$}if($.startsWith("#"))return b+$;if(!b.length){const j=$.indexOf(":");if(j<0)throw new Error(`Found invalid relative IRI '${$}' for a missing baseIRI`);return L($,j)}const R=$.indexOf(":");if(R>=0)return L($,R);const A=b.indexOf(":");if(A<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);const v=b.substr(0,A+1);if(0===$.indexOf("//"))return v+L($,R);let y;if(b.indexOf("//",A)===A+1){if(y=b.indexOf("/",A+3),y<0)return b.length>A+3?b+"/"+L($,R):v+L($,R)}else if(y=b.indexOf("/",A+1),y<0)return v+L($,R);if(0===$.indexOf("/"))return b.substr(0,y)+V($);let w=b.substr(y);const D=w.lastIndexOf("/");return D>=0&&D"===ce?(te(X,"onsgmldeclaration",X.sgmlDecl),X.sgmlDecl="",X.state=se.TEXT):(U(ce)&&(X.state=se.SGML_DECL_QUOTED),X.sgmlDecl+=ce);continue;case se.SGML_DECL_QUOTED:ce===X.q&&(X.state=se.SGML_DECL,X.q=""),X.sgmlDecl+=ce;continue;case se.DOCTYPE:">"===ce?(X.state=se.TEXT,te(X,"ondoctype",X.doctype),X.doctype=!0):(X.doctype+=ce,"["===ce?X.state=se.DOCTYPE_DTD:U(ce)&&(X.state=se.DOCTYPE_QUOTED,X.q=ce));continue;case se.DOCTYPE_QUOTED:X.doctype+=ce,ce===X.q&&(X.q="",X.state=se.DOCTYPE);continue;case se.DOCTYPE_DTD:X.doctype+=ce,"]"===ce?X.state=se.DOCTYPE:U(ce)&&(X.state=se.DOCTYPE_DTD_QUOTED,X.q=ce);continue;case se.DOCTYPE_DTD_QUOTED:X.doctype+=ce,ce===X.q&&(X.state=se.DOCTYPE_DTD,X.q="");continue;case se.COMMENT:"-"===ce?X.state=se.COMMENT_ENDING:X.comment+=ce;continue;case se.COMMENT_ENDING:"-"===ce?(X.state=se.COMMENT_ENDED,X.comment=Me(X.opt,X.comment),X.comment&&te(X,"oncomment",X.comment),X.comment=""):(X.comment+="-"+ce,X.state=se.COMMENT);continue;case se.COMMENT_ENDED:">"!==ce?(Ze(X,"Malformed comment"),X.comment+="--"+ce,X.state=se.COMMENT):X.state=se.TEXT;continue;case se.CDATA:"]"===ce?X.state=se.CDATA_ENDING:X.cdata+=ce;continue;case se.CDATA_ENDING:"]"===ce?X.state=se.CDATA_ENDING_2:(X.cdata+="]"+ce,X.state=se.CDATA);continue;case se.CDATA_ENDING_2:">"===ce?(X.cdata&&te(X,"oncdata",X.cdata),te(X,"onclosecdata"),X.cdata="",X.state=se.TEXT):"]"===ce?X.cdata+="]":(X.cdata+="]]"+ce,X.state=se.CDATA);continue;case se.PROC_INST:"?"===ce?X.state=se.PROC_INST_ENDING:E(ce)?X.state=se.PROC_INST_BODY:X.procInstName+=ce;continue;case se.PROC_INST_BODY:if(!X.procInstBody&&E(ce))continue;"?"===ce?X.state=se.PROC_INST_ENDING:X.procInstBody+=ce;continue;case se.PROC_INST_ENDING:">"===ce?(te(X,"onprocessinginstruction",{name:X.procInstName,body:X.procInstBody}),X.procInstName=X.procInstBody="",X.state=se.TEXT):(X.procInstBody+="?"+ce,X.state=se.PROC_INST_BODY);continue;case se.OPEN_TAG:ue(M,ce)?X.tagName+=ce:(Je(X),">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:(E(ce)||Ze(X,"Invalid character in tag name"),X.state=se.ATTRIB));continue;case se.OPEN_TAG_SLASH:">"===ce?(Le(X,!0),Ee(X)):(Ze(X,"Forward-slash in opening tag not followed by >"),X.state=se.ATTRIB);continue;case se.ATTRIB:if(E(ce))continue;">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(K,ce)?(X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME:"="===ce?X.state=se.ATTRIB_VALUE:">"===ce?(Ze(X,"Attribute without value"),X.attribValue=X.attribName,je(X),Le(X)):E(ce)?X.state=se.ATTRIB_NAME_SAW_WHITE:ue(M,ce)?X.attribName+=ce:Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME_SAW_WHITE:if("="===ce)X.state=se.ATTRIB_VALUE;else{if(E(ce))continue;Ze(X,"Attribute without value"),X.tag.attributes[X.attribName]="",X.attribValue="",te(X,"onattribute",{name:X.attribName,value:""}),X.attribName="",">"===ce?Le(X):ue(K,ce)?(X.attribName=ce,X.state=se.ATTRIB_NAME):(Ze(X,"Invalid attribute name"),X.state=se.ATTRIB)}continue;case se.ATTRIB_VALUE:if(E(ce))continue;U(ce)?(X.q=ce,X.state=se.ATTRIB_VALUE_QUOTED):(Ze(X,"Unquoted attribute value"),X.state=se.ATTRIB_VALUE_UNQUOTED,X.attribValue=ce);continue;case se.ATTRIB_VALUE_QUOTED:if(ce!==X.q){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_Q:X.attribValue+=ce;continue}je(X),X.q="",X.state=se.ATTRIB_VALUE_CLOSED;continue;case se.ATTRIB_VALUE_CLOSED:E(ce)?X.state=se.ATTRIB:">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(K,ce)?(Ze(X,"No whitespace between attributes"),X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_VALUE_UNQUOTED:if(!ie(ce)){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_U:X.attribValue+=ce;continue}je(X),">"===ce?Le(X):X.state=se.ATTRIB;continue;case se.CLOSE_TAG:if(X.tagName)">"===ce?Ee(X):ue(M,ce)?X.tagName+=ce:X.script?(X.script+=""===ce?Ee(X):Ze(X,"Invalid characters in closing tag");continue;case se.TEXT_ENTITY:case se.ATTRIB_VALUE_ENTITY_Q:case se.ATTRIB_VALUE_ENTITY_U:var pt,pe;switch(X.state){case se.TEXT_ENTITY:pt=se.TEXT,pe="textNode";break;case se.ATTRIB_VALUE_ENTITY_Q:pt=se.ATTRIB_VALUE_QUOTED,pe="attribValue";break;case se.ATTRIB_VALUE_ENTITY_U:pt=se.ATTRIB_VALUE_UNQUOTED,pe="attribValue"}";"===ce?(X[pe]+=Oe(X),X.entity="",X.state=pt):ue(X.entity.length?Q:F,ce)?X.entity+=ce:(Ze(X,"Invalid character in entity name"),X[pe]+="&"+X.entity+ce,X.entity="",X.state=pt);continue;default:throw new Error(X,"Unknown state: "+X.state)}return X.position>=X.bufferCheckPosition&&function(z){for(var X=Math.max(V.MAX_BUFFER_LENGTH,10),be=0,ce=0,Pe=L.length;ceX)switch(L[ce]){case"textNode":ye(z);break;case"cdata":te(z,"oncdata",z.cdata),z.cdata="";break;case"script":te(z,"onscript",z.script),z.script="";break;default:Ve(z,"Max buffer length exceeded: "+L[ce])}be=Math.max(be,Et)}z.bufferCheckPosition=V.MAX_BUFFER_LENGTH-be+z.position}(X),X},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(z){ye(z),""!==z.cdata&&(te(z,"oncdata",z.cdata),z.cdata=""),""!==z.script&&(te(z,"onscript",z.script),z.script="")}(this)}};try{R=Y("stream").Stream}catch(z){R=function(){}}var A=V.EVENTS.filter(function(z){return"error"!==z&&"end"!==z});function y(z,X){if(!(this instanceof y))return new y(z,X);R.apply(this),this._parser=new re(z,X),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ce){be.emit("error",ce),be._parser.error=null},this._decoder=null,A.forEach(function(ce){Object.defineProperty(be,"on"+ce,{get:function(){return be._parser["on"+ce]},set:function(Pe){if(!Pe)return be.removeAllListeners(ce),be._parser["on"+ce]=Pe,Pe;be.on(ce,Pe)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(R.prototype,{constructor:{value:y}})).write=function(z){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(z)){if(!this._decoder){var X=Y("string_decoder").StringDecoder;this._decoder=new X("utf8")}z=this._decoder.write(z)}return this._parser.write(z.toString()),this.emit("data",z),!0},y.prototype.end=function(z){return z&&z.length&&this.write(z),this._parser.end(),!0},y.prototype.on=function(z,X){var be=this;return!be._parser["on"+z]&&-1!==A.indexOf(z)&&(be._parser["on"+z]=function(){var ce=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ce.splice(0,0,z),be.emit.apply(be,ce)}),R.prototype.on.call(be,z,X)};var j="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",H={xml:j,xmlns:I},K=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,M=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(z){return" "===z||"\n"===z||"\r"===z||"\t"===z}function U(z){return'"'===z||"'"===z}function ie(z){return">"===z||E(z)}function ue(z,X){return z.test(X)}function ee(z,X){return!ue(z,X)}var z,X,be,se=0;for(var Te in V.STATE={BEGIN:se++,BEGIN_WHITESPACE:se++,TEXT:se++,TEXT_ENTITY:se++,OPEN_WAKA:se++,SGML_DECL:se++,SGML_DECL_QUOTED:se++,DOCTYPE:se++,DOCTYPE_QUOTED:se++,DOCTYPE_DTD:se++,DOCTYPE_DTD_QUOTED:se++,COMMENT_STARTING:se++,COMMENT:se++,COMMENT_ENDING:se++,COMMENT_ENDED:se++,CDATA:se++,CDATA_ENDING:se++,CDATA_ENDING_2:se++,PROC_INST:se++,PROC_INST_BODY:se++,PROC_INST_ENDING:se++,OPEN_TAG:se++,OPEN_TAG_SLASH:se++,ATTRIB:se++,ATTRIB_NAME:se++,ATTRIB_NAME_SAW_WHITE:se++,ATTRIB_VALUE:se++,ATTRIB_VALUE_QUOTED:se++,ATTRIB_VALUE_CLOSED:se++,ATTRIB_VALUE_UNQUOTED:se++,ATTRIB_VALUE_ENTITY_Q:se++,ATTRIB_VALUE_ENTITY_U:se++,CLOSE_TAG:se++,CLOSE_TAG_SAW_WHITE:se++,SCRIPT:se++,SCRIPT_ENDING:se++},V.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(V.ENTITIES).forEach(function(z){var X=V.ENTITIES[z],be="number"==typeof X?String.fromCharCode(X):X;V.ENTITIES[z]=be}),V.STATE)V.STATE[V.STATE[Te]]=Te;function me(z,X,be){z[X]&&z[X](be)}function te(z,X,be){z.textNode&&ye(z),me(z,X,be)}function ye(z){z.textNode=Me(z.opt,z.textNode),z.textNode&&me(z,"ontext",z.textNode),z.textNode=""}function Me(z,X){return z.trim&&(X=X.trim()),z.normalize&&(X=X.replace(/\s+/g," ")),X}function Ve(z,X){return ye(z),z.trackPosition&&(X+="\nLine: "+z.line+"\nColumn: "+z.column+"\nChar: "+z.c),X=new Error(X),z.error=X,me(z,"onerror",X),z}function nt(z){return z.sawRoot&&!z.closedRoot&&Ze(z,"Unclosed root tag"),z.state!==se.BEGIN&&z.state!==se.BEGIN_WHITESPACE&&z.state!==se.TEXT&&Ve(z,"Unexpected end"),ye(z),z.c="",z.closed=!0,me(z,"onend"),re.call(z,z.strict,z.opt),z}function Ze(z,X){if("object"!=typeof z||!(z instanceof re))throw new Error("bad call to strictFail");z.strict&&Ve(z,X)}function Je(z){z.strict||(z.tagName=z.tagName[z.looseCase]());var X=z.tags[z.tags.length-1]||z,be=z.tag={name:z.tagName,attributes:{}};z.opt.xmlns&&(be.ns=X.ns),z.attribList.length=0,te(z,"onopentagstart",be)}function Ke(z,X){var ce=z.indexOf(":")<0?["",z]:z.split(":"),Pe=ce[0],Et=ce[1];return X&&"xmlns"===z&&(Pe="xmlns",Et=""),{prefix:Pe,local:Et}}function je(z){if(z.strict||(z.attribName=z.attribName[z.looseCase]()),-1!==z.attribList.indexOf(z.attribName)||z.tag.attributes.hasOwnProperty(z.attribName))z.attribName=z.attribValue="";else{if(z.opt.xmlns){var X=Ke(z.attribName,!0),ce=X.local;if("xmlns"===X.prefix)if("xml"===ce&&z.attribValue!==j)Ze(z,"xml: prefix must be bound to "+j+"\nActual: "+z.attribValue);else if("xmlns"===ce&&z.attribValue!==I)Ze(z,"xmlns: prefix must be bound to "+I+"\nActual: "+z.attribValue);else{var Pe=z.tag,Et=z.tags[z.tags.length-1]||z;Pe.ns===Et.ns&&(Pe.ns=Object.create(Et.ns)),Pe.ns[ce]=z.attribValue}z.attribList.push([z.attribName,z.attribValue])}else z.tag.attributes[z.attribName]=z.attribValue,te(z,"onattribute",{name:z.attribName,value:z.attribValue});z.attribName=z.attribValue=""}}function Le(z,X){if(z.opt.xmlns){var be=z.tag,ce=Ke(z.tagName);be.prefix=ce.prefix,be.local=ce.local,be.uri=be.ns[ce.prefix]||"",be.prefix&&!be.uri&&(Ze(z,"Unbound namespace prefix: "+JSON.stringify(z.tagName)),be.uri=ce.prefix),be.ns&&(z.tags[z.tags.length-1]||z).ns!==be.ns&&Object.keys(be.ns).forEach(function(An){te(z,"onopennamespace",{prefix:An,uri:be.ns[An]})});for(var Et=0,pt=z.attribList.length;Et",z.tagName="",void(z.state=se.SCRIPT);te(z,"onscript",z.script),z.script=""}var X=z.tags.length,be=z.tagName;z.strict||(be=be[z.looseCase]());for(var ce=be;X--&&z.tags[X].name!==ce;)Ze(z,"Unexpected close tag");if(X<0)return Ze(z,"Unmatched closing tag: "+z.tagName),z.textNode+="",void(z.state=se.TEXT);z.tagName=be;for(var Et=z.tags.length;Et-- >X;){var pt=z.tag=z.tags.pop();z.tagName=z.tag.name,te(z,"onclosetag",z.tagName);var pe={};for(var B in pt.ns)pe[B]=pt.ns[B];z.opt.xmlns&&pt.ns!==(z.tags[z.tags.length-1]||z).ns&&Object.keys(pt.ns).forEach(function(k){te(z,"onclosenamespace",{prefix:k,uri:pt.ns[k]})})}0===X&&(z.closedRoot=!0),z.tagName=z.attribValue=z.attribName="",z.attribList.length=0,z.state=se.TEXT}function Oe(z){var ce,X=z.entity,be=X.toLowerCase(),Pe="";return z.ENTITIES[X]?z.ENTITIES[X]:z.ENTITIES[be]?z.ENTITIES[be]:("#"===(X=be).charAt(0)&&("x"===X.charAt(1)?(X=X.slice(2),Pe=(ce=parseInt(X,16)).toString(16)):(X=X.slice(1),Pe=(ce=parseInt(X,10)).toString(10))),X=X.replace(/^0+/,""),isNaN(ce)||Pe.toLowerCase()!==X?(Ze(z,"Invalid character entity"),"&"+z.entity+";"):String.fromCodePoint(ce))}function Ue(z,X){"<"===X?(z.state=se.OPEN_WAKA,z.startTagPosition=z.position):E(X)||(Ze(z,"Non-whitespace before first tag."),z.textNode=X,z.state=se.TEXT)}function qe(z,X){var be="";return X1114111||X(k)!==k)throw RangeError("Invalid code point: "+k);k<=65535?Pe.push(k):Pe.push(55296+((k-=65536)>>10),k%1024+56320),(pe+1===B||Pe.length>ce)&&(O+=z.apply(null,Pe),Pe.length=0)}return O},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Ae,he){(function(W,V){(function(){!function(L,re){"use strict";if(!L.setImmediate){var A,$=1,b={},S=!1,R=L.document,Q=Object.getPrototypeOf&&Object.getPrototypeOf(L);Q=Q&&Q.setTimeout?Q:L,"[object process]"==={}.toString.call(L.process)?A=function(E){W.nextTick(function(){D(E)})}:function(){if(L.postMessage&&!L.importScripts){var E=!0,U=L.onmessage;return L.onmessage=function(){E=!1},L.postMessage("","*"),L.onmessage=U,E}}()?(E="setImmediate$"+Math.random()+"$",U=function(ie){ie.source===L&&"string"==typeof ie.data&&0===ie.data.indexOf(E)&&D(+ie.data.slice(E.length))},L.addEventListener?L.addEventListener("message",U,!1):L.attachEvent("onmessage",U),A=function(ie){L.postMessage(E+ie,"*")}):L.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function(U){D(U.data)},A=function(U){E.port2.postMessage(U)}}():R&&"onreadystatechange"in R.createElement("script")?function(){var E=R.documentElement;A=function(U){var ie=R.createElement("script");ie.onreadystatechange=function(){D(U),ie.onreadystatechange=null,E.removeChild(ie),ie=null},E.appendChild(ie)}}():A=function(E){setTimeout(D,0,E)},Q.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var U=new Array(arguments.length-1),ie=0;ie=0&&(A._idleTimeoutId=setTimeout(function(){A._onTimeout&&A._onTimeout()},v))},he.setImmediate="function"==typeof W?W:function(A){var v=S++,y=!(arguments.length<2)&&$.call(arguments,1);return b[v]=!0,L(function(){b[v]&&(y?A.apply(null,y):A.call(null),he.clearImmediate(v))}),v},he.clearImmediate="function"==typeof V?V:function(A){delete b[A]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Ae,he){(function(W){(function(){function L(re){try{if(!W.localStorage)return!1}catch(b){return!1}var $=W.localStorage[re];return null!=$&&"true"===String($).toLowerCase()}Ae.exports=function(re,$){if(L("noDeprecation"))return re;var b=!1;return function(){if(!b){if(L("throwDeprecation"))throw new Error($);L("traceDeprecation")?console.trace($):console.warn($),b=!0}return re.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Ae,he){"use strict";Ae.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let V=this.head;V;V=V.next)yield V.value}}},{}],92:[function(Y,Ae,he){"use strict";function W(b){var S=this;if(S instanceof W||(S=new W),S.tail=null,S.head=null,S.length=0,b&&"function"==typeof b.forEach)b.forEach(function(v){S.push(v)});else if(arguments.length>0)for(var R=0,A=arguments.length;R1)R=S;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,R=this.head.value}for(var v=0;null!==A;v++)R=b(R,A.value,v),A=A.next;return R},W.prototype.reduceReverse=function(b,S){var R,A=this.tail;if(arguments.length>1)R=S;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,R=this.tail.value}for(var v=this.length-1;null!==A;v--)R=b(R,A.value,v),A=A.prev;return R},W.prototype.toArray=function(){for(var b=new Array(this.length),S=0,R=this.head;null!==R;S++)b[S]=R.value,R=R.next;return b},W.prototype.toArrayReverse=function(){for(var b=new Array(this.length),S=0,R=this.tail;null!==R;S++)b[S]=R.value,R=R.prev;return b},W.prototype.slice=function(b,S){(S=S||this.length)<0&&(S+=this.length),(b=b||0)<0&&(b+=this.length);var R=new W;if(Sthis.length&&(S=this.length);for(var A=0,v=this.head;null!==v&&Athis.length&&(S=this.length);for(var A=this.length,v=this.tail;null!==v&&A>S;A--)v=v.prev;for(;null!==v&&A>b;A--,v=v.prev)R.push(v.value);return R},W.prototype.splice=function(b,S,...R){b>this.length&&(b=this.length-1),b<0&&(b=this.length+b);for(var A=0,v=this.head;null!==v&&A{jt.exports=function(tt,gt){var J=gt.length;if(0!==J){var xt=tt.length;tt.length+=J;for(var ut=0;ut{"use strict";var gt=(()=>{return(xt=gt||(gt={})).typeOfFunction="function",xt.boolTrue=!0,gt;var xt})();function J(xt,ut,Y){if(!Y||typeof Y.value!==gt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+ut+"> is not a method!");return{configurable:gt.boolTrue,get:function(){var Ae=Y.value.bind(this);return Object.defineProperty(this,ut,{value:Ae,configurable:gt.boolTrue,writable:gt.boolTrue}),Ae}}}it.ak=J,it.ZP=J},266:(jt,it,tt)=>{jt.exports={ResizeSensor:tt(835),ElementQueries:tt(845)}},845:function(jt,it,tt){"use strict";var gt,J,xt;"undefined"!=typeof window&&window,J=[tt(835)],void 0!==(xt="function"==typeof(gt=function(ut){var Y=function(){var he,W={},V=[];function L(M){M||(M=document.documentElement);var F=window.getComputedStyle(M,null).fontSize;return parseFloat(F)||16}function $(M,F){var Q=F.split(/\d/),E=Q[Q.length-1];switch(F=parseFloat(F),E){case"px":return F;case"em":return F*L(M);case"rem":return F*L();case"vw":return F*document.documentElement.clientWidth/100;case"vh":return F*document.documentElement.clientHeight/100;case"vmin":case"vmax":var U=document.documentElement.clientWidth/100,ie=document.documentElement.clientHeight/100;return F*(0,Math["vmin"===E?"min":"max"])(U,ie);default:return F}}function b(M,F){this.element=M;var Q,E,U,ie,ue,ee,se,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(Q in U=function(M){if(!M.getBoundingClientRect)return{width:M.offsetWidth,height:M.offsetHeight};var F=M.getBoundingClientRect();return{width:Math.round(F.width),height:Math.round(F.height)}}(this.element),ee={},W[F])!W[F].hasOwnProperty(Q)||(ie=$(this.element,(E=W[F][Q]).value),ue="width"===E.property?U.width:U.height,se="","min"===E.mode&&ue>=ie&&(se+=E.value),"max"===E.mode&&ue<=ie&&(se+=E.value),ee[Te=E.mode+"-"+E.property]||(ee[Te]=""),se&&-1===(" "+ee[Te]+" ").indexOf(" "+se+" ")&&(ee[Te]+=" "+se));for(var te in me)!me.hasOwnProperty(te)||(ee[me[te]]?this.element.setAttribute(me[te],ee[me[te]].substr(1)):this.element.removeAttribute(me[te]))}}function S(M,F){M.elementQueriesSetupInformation||(M.elementQueriesSetupInformation=new b(M,F)),M.elementQueriesSensor||(M.elementQueriesSensor=new ut(M,function(){M.elementQueriesSetupInformation.call()}))}function R(M,F,Q,E){if(void 0===W[M]){W[M]=[];var U=V.length;he.innerHTML+="\n"+M+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+M+" > .resize-sensor {min-width: "+U+"px;}",V.push(M)}W[M].push({mode:F,property:Q,value:E})}function A(M){var F;if(document.querySelectorAll&&(F=M?M.querySelectorAll.bind(M):document.querySelectorAll.bind(document)),!F&&"undefined"!=typeof $$&&(F=$$),!F&&"undefined"!=typeof jQuery&&(F=jQuery),!F)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return F}function y(M){var F=[],Q=[],E=[],U=0,ie=-1,ue=[];for(var ee in M.children)if(M.children.hasOwnProperty(ee)&&M.children[ee].tagName&&"img"===M.children[ee].tagName.toLowerCase()){F.push(M.children[ee]);var se=M.children[ee].getAttribute("min-width")||M.children[ee].getAttribute("data-min-width"),Te=M.children[ee].getAttribute("data-src")||M.children[ee].getAttribute("url");E.push(Te),Q.push({minWidth:se}),se?M.children[ee].style.display="none":(U=F.length-1,M.children[ee].style.display="block")}function te(){var Me,ye=!1;for(Me in F)!F.hasOwnProperty(Me)||Q[Me].minWidth&&M.offsetWidth>Q[Me].minWidth&&(ye=Me);if(ye||(ye=U),ie!==ye)if(ue[ye])F[ie].style.display="none",F[ye].style.display="block",ie=ye;else{var Ve=new Image;Ve.onload=function(){F[ye].src=E[ye],F[ie].style.display="none",F[ye].style.display="block",ue[ye]=!0,ie=ye},Ve.src=E[ye]}else F[ye].src=E[ye]}ie=U,M.resizeSensorInstance=new ut(M,te),te()}var D=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,j=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function I(M){var F,Q,E,U;for(M=M.replace(/'/g,'"');null!==(F=D.exec(M));)for(Q=F[1]+F[3],E=F[2];null!==(U=j.exec(E));)R(Q,U[1],U[2],U[3])}function H(M){var F="";if(M)if("string"==typeof M)(-1!==(M=M.toLowerCase()).indexOf("min-width")||-1!==M.indexOf("max-width"))&&I(M);else for(var Q=0,E=M.length;Q img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",he.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(he),K=!0);for(var F=0,Q=document.styleSheets.length;F{var gt=tt(910),J=tt(369),xt=tt(322);function ut(re,$,b){if(!gt(re))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!re.hasNode($))throw new Error('graphology-shortest-path: the "'+$+'" source node does not exist in the given graph.');if(!re.hasNode(b))throw new Error('graphology-shortest-path: the "'+b+'" target node does not exist in the given graph.');if(($=""+$)==(b=""+b))return[$];var S=re.inboundNeighbors.bind(re),R=re.outboundNeighbors.bind(re),A={},v={};A[$]=null,v[b]=null;var D,j,I,H,K,M,F,Q,y=[$],w=[b],E=!1;e:for(;y.length&&w.length;)if(y.length<=w.length){for(D=y,y=[],K=0,F=D.length;K{jt.exports=function(tt){return null!==tt&&"object"==typeof tt&&"function"==typeof tt.addUndirectedEdgeWithKey&&"function"==typeof tt.dropNode&&"boolean"==typeof tt.multi}},698:function(jt){jt.exports=function(){"use strict";function it(ne){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(de){return typeof de}:function(de){return de&&"function"==typeof Symbol&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de})(ne)}function tt(ne,de){ne.prototype=Object.create(de.prototype),ne.prototype.constructor=ne,J(ne,de)}function gt(ne){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)})(ne)}function J(ne,de){return(J=Object.setPrototypeOf||function(oe,C){return oe.__proto__=C,oe})(ne,de)}function xt(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(ne){return!1}}function ut(ne,de,oe){return(ut=xt()?Reflect.construct:function(C,P,Z){var we=[null];we.push.apply(we,P);var Fe=new(Function.bind.apply(C,we));return Z&&J(Fe,Z.prototype),Fe}).apply(null,arguments)}function Y(ne){var de="function"==typeof Map?new Map:void 0;return(Y=function(oe){if(null===oe||-1===Function.toString.call(oe).indexOf("[native code]"))return oe;if("function"!=typeof oe)throw new TypeError("Super expression must either be null or a function");if(void 0!==de){if(de.has(oe))return de.get(oe);de.set(oe,P)}function P(){return ut(oe,arguments,gt(this).constructor)}return P.prototype=Object.create(oe.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),J(P,oe)})(ne)}function Ae(ne){if(void 0===ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ne}var he=function(){for(var ne=arguments[0],de=1,oe=arguments.length;de0&&we.length>P&&!we.warned){we.warned=!0;var et=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(de)+" listeners added. Use emitter.setMaxListeners() to increase limit");et.name="MaxListenersExceededWarning",et.emitter=ne,et.type=de,et.count=we.length,console&&console.warn&&console.warn(et)}return ne}function M(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F(ne,de,oe){var C={fired:!1,wrapFn:void 0,target:ne,type:de,listener:oe},P=M.bind(C);return P.listener=oe,C.wrapFn=P,P}function Q(ne,de,oe){var C=ne._events;if(void 0===C)return[];var P=C[de];return void 0===P?[]:"function"==typeof P?oe?[P.listener||P]:[P]:oe?function(Z){for(var we=new Array(Z.length),Fe=0;Fe0&&(Z=de[0]),Z instanceof Error)throw Z;var we=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw we.context=Z,we}var Fe=P[ne];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,de);else{var et=Fe.length,Dt=U(Fe,et);for(oe=0;oe=0;Z--)if(oe[Z]===de||oe[Z].listener===de){we=oe[Z].listener,P=Z;break}if(P<0)return this;0===P?oe.shift():function(Fe,et){for(;et+1=0;C--)this.removeListener(ne,de[C]);return this},D.prototype.listeners=function(ne){return Q(this,ne,!0)},D.prototype.rawListeners=function(ne){return Q(this,ne,!1)},D.listenerCount=function(ne,de){return"function"==typeof ne.listenerCount?ne.listenerCount(de):E.call(ne,de)},D.prototype.listenerCount=E,D.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]},ue.prototype.next=function(){if(this.done)return{done:!0};var ne=this._next();return ne.done&&(this.done=!0),ne},"undefined"!=typeof Symbol&&(ue.prototype[Symbol.iterator]=function(){return this}),ue.of=function(){var ne=arguments,de=ne.length,oe=0;return new ue(function(){return oe>=de?{done:!0}:{done:!1,value:ne[oe++]}})},ue.empty=function(){var ne=new ue(null);return ne.done=!0,ne},ue.is=function(ne){return ne instanceof ue||"object"==typeof ne&&null!==ne&&"function"==typeof ne.next};var ee=ue,se=function(ne,de){for(var oe,C=arguments.length>1?de:1/0,P=C!==1/0?new Array(C):[],Z=0;;){if(Z===C)return P;if((oe=ne.next()).done)return Z!==de?P.slice(0,Z):P;P[Z++]=oe.value}},Te=function(ne){function de(oe,C){var P;return(P=ne.call(this)||this).name="GraphError",P.message=oe||"",P.data=C||{},P}return tt(de,ne),de}(Y(Error)),me=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),te=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),ye=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te);function Me(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ve(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function nt(ne,de){this.key=ne,this.attributes=de,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Ze(ne,de,oe,C,P,Z){this.key=de,this.attributes=Z,this.undirected=ne,this.source=C,this.target=P,this.generatedKey=oe}function Je(ne,de,oe,C,P,Z,we){var Fe,et,Dt="out",$e="in";if(de&&(Dt=$e="undirected"),ne.multi){if(void 0===(et=(Fe=Z[Dt])[P])&&(et=new Set,Fe[P]=et),et.add(oe),C===P&&de)return;void 0===(Fe=we[$e])[C]&&(Fe[C]=et)}else{if(Z[Dt][P]=oe,C===P&&de)return;we[$e][C]=oe}}function Ke(ne,de,oe){var C=ne.multi,P=oe.source,Z=oe.target,we=P.key,Fe=Z.key,et=P[de?"undirected":"out"],Dt=de?"undirected":"in";if(Fe in et)if(C){var $e=et[Fe];1===$e.size?(delete et[Fe],delete Z[Dt][we]):$e.delete(oe)}else delete et[Fe];C||delete Z[Dt][we]}Ve.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},nt.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var je=[{name:function(ne){return"get".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes[P]}}},{name:function(ne){return"get".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C){var P;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Z=""+C,we=""+arguments[1];if(!(P=W(this,Z,we,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Z,'" - "').concat(we,'").'))}else if(!(P=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&P.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return P.attributes}}},{name:function(ne){return"has".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes.hasOwnProperty(P)}}},{name:function(ne){return"set".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=W(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"update".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=W(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("function"!=typeof Z)throw new me("Graph.".concat(de,": updater should be a function."));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z(we.attributes[P]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"remove".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return delete Z.attributes[P],this.emit("edgeAttributesUpdated",{key:Z.key,type:"remove",attributes:Z.attributes,name:P}),this}}},{name:function(ne){return"replace".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes=P,this.emit("edgeAttributesUpdated",{key:Z.key,type:"replace",attributes:Z.attributes}),this}}},{name:function(ne){return"merge".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return he(Z.attributes,P),this.emit("edgeAttributesUpdated",{key:Z.key,type:"merge",attributes:Z.attributes,data:P}),this}}}],Le=ee,Ee=function(){var ne,de=arguments,oe=-1;return new Le(function C(){if(!ne){if(++oe>=de.length)return{done:!0};ne=de[oe]}var P=ne.next();return P.done?(ne=null,C()):P})},Oe=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Ue(ne,de){for(var oe in de)ne.push(de[oe].key)}function qe(ne,de){for(var oe in de)de[oe].forEach(function(C){return ne.push(C.key)})}function Be(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)}}function z(ne,de,oe){for(var C in ne)C!==oe&&ne[C].forEach(function(P){return de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function X(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];if(de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey))return!0}return!1}function be(ne,de,oe){var C,P,Z,we,Fe;for(var et in ne)if(et!==oe)for(C=ne[et].values();!0!==(P=C.next()).done;)if(we=(Z=P.value).source,de(Z.key,Z.attributes,we.key,(Fe=Z.target).key,we.attributes,Fe.attributes,Z.undirected,Z.generatedKey))return!0;return!1}function ce(ne,de){var oe=Object.keys(ne),C=oe.length,P=null,Z=0;return new ee(function we(){var Fe;if(P){var et=P.next();if(et.done)return P=null,Z++,we();Fe=et.value}else{if(Z>=C)return{done:!0};var Dt=oe[Z];if(Dt===de)return Z++,we();if((Fe=ne[Dt])instanceof Set)return P=Fe.values(),we();Z++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function Pe(ne,de,oe){var C=de[oe];C&&ne.push(C.key)}function Et(ne,de,oe){var C=de[oe];C&&C.forEach(function(P){return ne.push(P.key)})}function pt(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function pe(ne,de,oe){var C=ne[de];C&&C.forEach(function(P){return oe(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function B(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;return oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function O(ne,de,oe){var C=ne[de];if(C){for(var P,Z,we=C.values();!0!==(P=we.next()).done;)if(oe((Z=P.value).key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes,Z.undirected,Z.generatedKey))return!0;return!1}}function k(ne,de){var oe=ne[de];if(oe instanceof Set){var C=oe.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{done:!1,value:[Z.key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes]}})}return ee.of([oe.key,oe.attributes,oe.source.key,oe.target.key,oe.source.attributes,oe.target.attributes])}function Re(ne,de){if(0===ne.size)return[];if("mixed"===de||de===ne.type)return"function"==typeof Array.from?Array.from(ne._edges.keys()):se(ne._edges.keys(),ne._edges.size);for(var oe,C,Z=new Array("undirected"===de?ne.undirectedSize:ne.directedSize),we="undirected"===de,Fe=ne._edges.values(),et=0;!0!==(oe=Fe.next()).done;)(C=oe.value).undirected===we&&(Z[et++]=C.key);return Z}function Xe(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var Gt=P.source,bt=P.target;oe(P.key,P.attributes,Gt.key,bt.key,Gt.attributes,bt.attributes,P.undirected,P.generatedKey)}}function yt(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var Gt=P.source,bt=P.target;if(oe(P.key,P.attributes,Gt.key,bt.key,Gt.attributes,bt.attributes,P.undirected,P.generatedKey))break}}function It(ne,de){if(0===ne.size)return ee.empty();var oe="mixed"!==de&&de!==ne.type,C="undirected"===de,P=ne._edges.values();return new ee(function(){for(var Z,we;;){if((Z=P.next()).done)return Z;if(we=Z.value,!oe||we.undirected===C)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function An(ne,de,oe,C){var P=[],Z=ne?qe:Ue;return"undirected"!==de&&("out"!==oe&&Z(P,C.in),"in"!==oe&&Z(P,C.out),!oe&&C.directedSelfLoops>0&&P.splice(P.lastIndexOf(C.key),1)),"directed"!==de&&Z(P,C.undirected),P}function Rn(ne,de,oe,C,P){var Z=ne?z:Be;"undirected"!==de&&("out"!==oe&&Z(C.in,P),"in"!==oe&&Z(C.out,P,oe?null:C.key)),"directed"!==de&&Z(C.undirected,P)}function Hn(ne,de,oe,C,P){var Z=ne?be:X;"undirected"!==de&&("out"!==oe&&Z(C.in,P)||"in"!==oe&&Z(C.out,P,oe?null:C.key))||"directed"===de||Z(C.undirected,P)}function yi(ne,de,oe){var C=ee.empty();return"undirected"!==ne&&("out"!==de&&void 0!==oe.in&&(C=Ee(C,ce(oe.in))),"in"!==de&&void 0!==oe.out&&(C=Ee(C,ce(oe.out,de?null:oe.key)))),"directed"!==ne&&void 0!==oe.undirected&&(C=Ee(C,ce(oe.undirected))),C}function ci(ne,de,oe,C,P){var Z=de?Et:Pe,we=[];return"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&Z(we,C.in,P),void 0!==C.out&&"in"!==oe&&Z(we,C.out,P),!oe&&C.directedSelfLoops>0&&we.splice(we.lastIndexOf(C.key),1)),"directed"!==ne&&void 0!==C.undirected&&Z(we,C.undirected,P),we}function Ur(ne,de,oe,C,P,Z){var we=de?pe:pt;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z),C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z)),"directed"!==ne&&void 0!==C.undirected&&we(C.undirected,P,Z)}function Is(ne,de,oe,C,P,Z){var we=de?O:B;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z)||C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z,oe?null:C.key))||"directed"===ne||void 0===C.undirected||we(C.undirected,P,Z)}function as(ne,de,oe,C){var P=ee.empty();return"undirected"!==ne&&(void 0!==oe.in&&"out"!==de&&C in oe.in&&(P=Ee(P,k(oe.in,C))),void 0!==oe.out&&"in"!==de&&C in oe.out&&(P=Ee(P,k(oe.out,C)))),"directed"!==ne&&void 0!==oe.undirected&&C in oe.undirected&&(P=Ee(P,k(oe.undirected,C))),P}var Os=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function zr(ne,de){if(void 0!==de)for(var oe in de)ne.add(oe)}function Va(ne,de,oe){if("mixed"!==ne){if("undirected"===ne)return Object.keys(oe.undirected);if("string"==typeof de)return Object.keys(oe[de])}var C=new Set;return"undirected"!==ne&&("out"!==de&&zr(C,oe.in),"in"!==de&&zr(C,oe.out)),"directed"!==ne&&zr(C,oe.undirected),se(C.values(),C.size)}function wl(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;oe(Fe.key,Fe.attributes)}}function la(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;ne.has(et.key)||(ne.add(et.key),C(et.key,et.attributes))}}function ps(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;if(oe(Fe.key,Fe.attributes))return!0}return!1}function Zt(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;if(!ne.has(et.key)&&(ne.add(et.key),C(et.key,et.attributes)))return!0}return!1}function Ua(ne,de){var oe=Object.keys(de),C=oe.length,P=0;return new ee(function(){if(P>=C)return{done:!0};var Z=de[oe[P++]];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===ne?Z.target:we;return{done:!1,value:[et.key,et.attributes]}})}function rt(ne,de,oe){var C=Object.keys(oe),P=C.length,Z=0;return new ee(function we(){if(Z>=P)return{done:!0};var Fe=oe[C[Z++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var et=Fe.source,$e=et===de?Fe.target:et;return ne.has($e.key)?we():(ne.add($e.key),{done:!1,value:[$e.key,$e.attributes]})})}function ot(ne,de,oe,C,P){var Z=ne._nodes.get(C);if("undirected"!==de){if("out"!==oe&&void 0!==Z.in)for(var we in Z.in)if(we===P)return!0;if("in"!==oe&&void 0!==Z.out)for(var Fe in Z.out)if(Fe===P)return!0}if("directed"!==de&&void 0!==Z.undirected)for(var et in Z.undirected)if(et===P)return!0;return!1}function ke(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,$e=de._nodes.values(),Gt=de.type;!0!==(C=$e.next()).done;){if(P=C.value,"undirected"!==Gt)for(Z in we=P.out)if(et=(Fe=we[Z]).target,Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return;if("directed"!==Gt)for(Z in we=P.undirected)if((et=(Fe=we[Z]).target).key!==Z&&(et=Fe.source),Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return}}function lt(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,$e,Gt,bt=de._nodes.values(),gn=de.type;!0!==(C=bt.next()).done;){if(P=C.value,"undirected"!==gn)for(Z in et=P.out)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if($e=(Dt=Fe.value).target,Gt=oe(P.key,$e.key,P.attributes,$e.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&Gt)return;if("directed"!==gn)for(Z in et=P.undirected)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if(($e=(Dt=Fe.value).target).key!==Z&&($e=Dt.source),Gt=oe(P.key,$e.key,P.attributes,$e.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&Gt)return}}function Qe(ne,de){var oe={key:ne};return re(de.attributes)||(oe.attributes=he({},de.attributes)),oe}function vt(ne,de){var oe={source:de.source.key,target:de.target.key};return de.generatedKey||(oe.key=ne),re(de.attributes)||(oe.attributes=he({},de.attributes)),de.undirected&&(oe.undirected=!0),oe}function St(ne){return L(ne)?"key"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?null:"invalid-attributes":"no-key":"not-object"}function At(ne){return L(ne)?"source"in ne?"target"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?"undirected"in ne&&"boolean"!=typeof ne.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var qt=new Set(["directed","undirected","mixed"]),Bn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ti={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Mn(ne,de,oe){var C=new ne.NodeDataClass(de,oe);return ne._nodes.set(de,C),ne.emit("nodeAdded",{key:de,attributes:oe}),C}function pn(ne,de,oe,C,P,Z,we,Fe){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(Z=""+Z,we=""+we,Fe=Fe||{},!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var et=ne._nodes.get(Z),Dt=ne._nodes.get(we);if(!et)throw new te("Graph.".concat(de,': source node "').concat(Z,'" not found.'));if(!Dt)throw new te("Graph.".concat(de,': target node "').concat(we,'" not found.'));var $e={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator($e)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));if(!ne.multi&&(C?void 0!==et.undirected[we]:void 0!==et.out[we]))throw new ye("Graph.".concat(de,': an edge linking "').concat(Z,'" to "').concat(we,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var Gt=new Ze(C,P,oe,et,Dt,Fe);return ne._edges.set(P,Gt),Z===we?C?(et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(et.undirectedDegree++,Dt.undirectedDegree++):(et.outDegree++,Dt.inDegree++),Je(ne,C,Gt,Z,we,et,Dt),C?ne._undirectedSize++:ne._directedSize++,$e.key=P,ne.emit("edgeAdded",$e),P}function Un(ne,de,oe,C,P,Z,we,Fe,et){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(et){if("function"!=typeof Fe)throw new me("Graph.".concat(de,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Dt;if(Z=""+Z,we=""+we,et&&(Dt=Fe,Fe=void 0),!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var $e,Gt,bt=ne._nodes.get(Z),gn=ne._nodes.get(we);if(!oe&&($e=ne._edges.get(P))){if($e.source.key!==Z||$e.target.key!==we||C&&($e.source.key!==we||$e.target.key!==Z))throw new ye("Graph.".concat(de,': inconsistency detected when attempting to merge the "').concat(P,'" edge with "').concat(Z,'" source & "').concat(we,'" target vs. ("').concat($e.source.key,'", "').concat($e.target.key,'").'));Gt=$e}if(Gt||ne.multi||!bt||(Gt=C?bt.undirected[we]:bt.out[we]),Gt)return(et?Dt:Fe)?(et?(Gt.attributes=Dt(Gt.attributes),ne.emit("edgeAttributesUpdated",{type:"replace",key:Gt.key,attributes:Gt.attributes})):(he(Gt.attributes,Fe),ne.emit("edgeAttributesUpdated",{type:"merge",key:Gt.key,attributes:Gt.attributes,data:Fe})),Gt.key):Gt.key;Fe=Fe||{},et&&Dt&&(Fe=Dt(Fe));var Gr={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(Gr)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));return bt||(bt=Mn(ne,Z,{}),Z===we&&(gn=bt)),gn||(gn=Mn(ne,we,{})),$e=new Ze(C,P,oe,bt,gn,Fe),ne._edges.set(P,$e),Z===we?C?(bt.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(bt.directedSelfLoops++,ne._directedSelfLoopCount++):C?(bt.undirectedDegree++,gn.undirectedDegree++):(bt.outDegree++,gn.inDegree++),Je(ne,C,$e,Z,we,bt,gn),C?ne._undirectedSize++:ne._directedSize++,Gr.key=P,ne.emit("edgeAdded",Gr),P}var ne,En=function(ne){function de(C){var P;if(P=ne.call(this)||this,(C=he({},ti,C)).edgeKeyGenerator&&"function"!=typeof C.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(C.edgeKeyGenerator,'".'));if("boolean"!=typeof C.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(C.multi,'".'));if(!qt.has(C.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(C.type,'".'));if("boolean"!=typeof C.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(C.allowSelfLoops,'".'));var Z,we="mixed"===C.type?Me:"directed"===C.type?Ve:nt;return $(Ae(P),"NodeDataClass",we),$(Ae(P),"_attributes",{}),$(Ae(P),"_nodes",new Map),$(Ae(P),"_edges",new Map),$(Ae(P),"_directedSize",0),$(Ae(P),"_undirectedSize",0),$(Ae(P),"_directedSelfLoopCount",0),$(Ae(P),"_undirectedSelfLoopCount",0),$(Ae(P),"_edgeKeyGenerator",C.edgeKeyGenerator||(Z=0,function(){return Z++})),$(Ae(P),"_options",C),Bn.forEach(function(Fe){return $(Ae(P),Fe,P[Fe])}),b(Ae(P),"order",function(){return P._nodes.size}),b(Ae(P),"size",function(){return P._edges.size}),b(Ae(P),"directedSize",function(){return P._directedSize}),b(Ae(P),"undirectedSize",function(){return P._undirectedSize}),b(Ae(P),"selfLoopCount",function(){return P._directedSelfLoopCount+P._undirectedSelfLoopCount}),b(Ae(P),"directedSelfLoopCount",function(){return P._directedSelfLoopCount}),b(Ae(P),"undirectedSelfLoopCount",function(){return P._undirectedSelfLoopCount}),b(Ae(P),"multi",P._options.multi),b(Ae(P),"type",P._options.type),b(Ae(P),"allowSelfLoops",P._options.allowSelfLoops),b(Ae(P),"implementation",function(){return"graphology"}),P}tt(de,ne);var oe=de.prototype;return oe.hasNode=function(C){return this._nodes.has(""+C)},oe.hasDirectedEdge=function(C,P){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&!we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.out[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasUndirectedEdge=function(C,P){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.undirected[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasEdge=function(C,P){if(1===arguments.length)return this._edges.has(""+C);if(2===arguments.length){P=""+P;var we=this._nodes.get(C=""+C);if(!we)return!1;var Fe=void 0!==we.out&&we.out[P];return Fe||(Fe=void 0!==we.undirected&&we.undirected[P]),!(!Fe||this.multi&&!Fe.size)}throw new me("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.directedEdge=function(C,P){if("undirected"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.directedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.directedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||void 0;return we?we.key:void 0}},oe.undirectedEdge=function(C,P){if("directed"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.undirectedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.undirectedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.undirected&&Z.undirected[P]||void 0;return we?we.key:void 0}},oe.edge=function(C,P){if(this.multi)throw new ye("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");P=""+P;var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.edge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.edge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||Z.undirected&&Z.undirected[P]||void 0;if(we)return we.key},oe.inDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.inDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.inDegree+(P?Z.directedSelfLoops:0)},oe.outDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.outDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.outDegree+(P?Z.directedSelfLoops:0)},oe.directedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.directedDegree: could not find the "'.concat(C,'" node in the graph.'));if("undirected"===this.type)return 0;var we=P?Z.directedSelfLoops:0;return Z.inDegree+we+(Z.outDegree+we)},oe.undirectedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.undirectedDegree: could not find the "'.concat(C,'" node in the graph.'));return"directed"===this.type?0:Z.undirectedDegree+2*(P?Z.undirectedSelfLoops:0)},oe.degree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.degree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.degree: could not find the "'.concat(C,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(P&&(Fe=Z.undirectedSelfLoops),we+=Z.undirectedDegree+2*Fe),"undirected"!==this.type&&(P&&(Fe=Z.directedSelfLoops),we+=Z.inDegree+Z.outDegree+2*Fe),we},oe.source=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.source: could not find the "'.concat(C,'" edge in the graph.'));return P.source.key},oe.target=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.target: could not find the "'.concat(C,'" edge in the graph.'));return P.target.key},oe.extremities=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.extremities: could not find the "'.concat(C,'" edge in the graph.'));return[P.source.key,P.target.key]},oe.opposite=function(C,P){C=""+C;var Z=this._edges.get(P=""+P);if(!Z)throw new te('Graph.opposite: could not find the "'.concat(P,'" edge in the graph.'));var we=Z.source.key,Fe=Z.target.key;if(C!==we&&C!==Fe)throw new te('Graph.opposite: the "'.concat(C,'" node is not attached to the "').concat(P,'" edge (').concat(we,", ").concat(Fe,")."));return C===we?Fe:we},oe.hasExtremity=function(C,P){P=""+P;var Z=this._edges.get(C=""+C);if(!Z)throw new te('Graph.hasExtremity: could not find the "'.concat(C,'" edge in the graph.'));return Z.source.key===P||Z.target.key===P},oe.isUndirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isUndirected: could not find the "'.concat(C,'" edge in the graph.'));return P.undirected},oe.isDirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isDirected: could not find the "'.concat(C,'" edge in the graph.'));return!P.undirected},oe.isSelfLoop=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isSelfLoop: could not find the "'.concat(C,'" edge in the graph.'));return P.source===P.target},oe.hasGeneratedKey=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.hasGeneratedKey: could not find the "'.concat(C,'" edge in the graph.'));return P.generatedKey},oe.addNode=function(C,P){return function(Z,we,Fe){if(Fe&&!L(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},Z._nodes.has(we=""+we))throw new ye('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var et=new Z.NodeDataClass(we,Fe);return Z._nodes.set(we,et),Z.emit("nodeAdded",{key:we,attributes:Fe}),et}(this,C,P).key},oe.mergeNode=function(C,P){if(P&&!L(P))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(P,'"'));P=P||{};var Z=this._nodes.get(C=""+C);return Z?(P&&(he(Z.attributes,P),this.emit("nodeAttributesUpdated",{type:"merge",key:C,attributes:Z.attributes,data:P})),C):(Z=new this.NodeDataClass(C,P),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:P}),C)},oe.updateNode=function(C,P){if(P&&"function"!=typeof P)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(P,'"'));var Z=this._nodes.get(C=""+C);if(Z)return P&&(Z.attributes=P(Z.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:C,attributes:Z.attributes})),C;var Fe=P?P({}):{};return Z=new this.NodeDataClass(C,Fe),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:Fe}),C},oe.dropNode=function(C){var P=this,Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.dropNode: could not find the "'.concat(C,'" node in the graph.'));this.forEachEdge(C,function(we){P.dropEdge(we)}),this._nodes.delete(C),this.emit("nodeDropped",{key:C,attributes:Z.attributes})},oe.dropEdge=function(C){var P;if(arguments.length>1){var Z=""+arguments[0],we=""+arguments[1];if(!(P=W(this,Z,we,this.type)))throw new te('Graph.dropEdge: could not find the "'.concat(Z,'" -> "').concat(we,'" edge in the graph.'))}else if(!(P=this._edges.get(C=""+C)))throw new te('Graph.dropEdge: could not find the "'.concat(C,'" edge in the graph.'));this._edges.delete(P.key);var et=P.source,Dt=P.target,$e=P.attributes,Gt=P.undirected;return et===Dt?Gt?(et.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(et.directedSelfLoops--,this._directedSelfLoopCount--):Gt?(et.undirectedDegree--,Dt.undirectedDegree--):(et.outDegree--,Dt.inDegree--),Ke(this,Gt,P),Gt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:C,attributes:$e,source:et.key,target:Dt.key,undirected:Gt}),this},oe.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},oe.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},oe.getAttribute=function(C){return this._attributes[C]},oe.getAttributes=function(){return this._attributes},oe.hasAttribute=function(C){return this._attributes.hasOwnProperty(C)},oe.setAttribute=function(C,P){return this._attributes[C]=P,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.updateAttribute=function(C,P){if("function"!=typeof P)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[C]=P(this._attributes[C]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.removeAttribute=function(C){return delete this._attributes[C],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:C}),this},oe.replaceAttributes=function(C){if(!L(C))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=C,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},oe.mergeAttributes=function(C){if(!L(C))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,C),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:C}),this},oe.getNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.getNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes[P]},oe.getNodeAttributes=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.getNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));return P.attributes},oe.hasNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes.hasOwnProperty(P)},oe.setNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.setNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return we.attributes[P]=Z,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.updateNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.updateNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof Z)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,et=Z(Fe[P]);return Fe[P]=et,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.removeNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return delete Z.attributes[P],this.emit("nodeAttributesUpdated",{key:C,type:"remove",attributes:Z.attributes,name:P}),this},oe.replaceNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.replaceNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return Z.attributes=P,this.emit("nodeAttributesUpdated",{key:C,type:"replace",attributes:Z.attributes}),this},oe.mergeNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.mergeNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(Z.attributes,P),this.emit("nodeAttributesUpdated",{key:C,type:"merge",attributes:Z.attributes,data:P}),this},oe.updateEachNodeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._nodes.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:P||null})},oe.updateEachEdgeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._edges.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:P||null})},oe.forEach=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?lt(!1,this,C):ke(!1,this,C)},oe.forEachUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?lt(!0,this,C):ke(!0,this,C)},oe.adjacency=function(){return this.multi?(et=(C=this)._nodes.values(),Dt=C.type,$e="outer",Gt=null,new ee(function bt(){var gn;if("outer"===$e)return!0===(gn=et.next()).done?gn:(P=gn.value,$e="directed",bt());if("directed"===$e)return"undirected"===Dt?($e="undirected",bt()):(we=P.out,Z=Object.keys(P.out),Fe=0,$e="inner-directed",bt());if("undirected"===$e){if("directed"===Dt)return $e="outer",bt();we=P.undirected,Z=Object.keys(P.undirected),Fe=0,$e="inner-undirected"}if(!Gt&&Fe>=Z.length)return $e="inner-undirected"===$e?"outer":"undirected",bt();if(!Gt){var gs=Z[Fe++];return Gt=we[gs].values(),bt()}if((gn=Gt.next()).done)return Gt=null,bt();var Gr=gn.value,Gs=Gr.target;return"inner-undirected"===$e&&Gs.key===P.key&&(Gs=Gr.source),{done:!1,value:[P.key,Gs.key,P.attributes,Gs.attributes,Gr.key,Gr.attributes]}})):(El=(bt=this)._nodes.values(),io=bt.type,Rr="outer",new ee(function Rs(){var lc;if("outer"===Rr)return!0===(lc=El.next()).done?lc:(gn=lc.value,Rr="directed",Rs());if("directed"===Rr)return"undirected"===io?(Rr="undirected",Rs()):(Gr=gn.out,gs=Object.keys(gn.out),Gs=0,Rr="inner-directed",Rs());if("undirected"===Rr){if("directed"===io)return Rr="outer",Rs();Gr=gn.undirected,gs=Object.keys(gn.undirected),Gs=0,Rr="inner-undirected"}if(Gs>=gs.length)return Rr="inner-undirected"===Rr?"outer":"undirected",Rs();var bn=gs[Gs++],ro=Gr[bn],Sl=ro.target;return"inner-undirected"===Rr&&Sl.key===gn.key&&(Sl=ro.source),{done:!1,value:[gn.key,Sl.key,gn.attributes,Sl.attributes,ro.key,ro.attributes]}}));var bt,gn,gs,Gr,Gs,El,io,Rr,C,P,Z,we,Fe,et,Dt,$e,Gt},oe.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):se(this._nodes.keys(),this._nodes.size)},oe.forEachNode=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(P,Z){C(Z,P.attributes)})},oe.forEachNodeUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");for(var P,Z,we=this._nodes.values();!0!==(P=we.next())&&!C((Z=P.value).key,Z.attributes););},oe.nodeEntries=function(){var C=this._nodes.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{value:[Z.key,Z.attributes],done:!1}})},oe.exportNode=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.exportNode: could not find the "'.concat(C,'" node in the graph.'));return Qe(C,P)},oe.exportEdge=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.exportEdge: could not find the "'.concat(C,'" edge in the graph.'));return vt(C,P)},oe.export=function(){var C=new Array(this._nodes.size),P=0;this._nodes.forEach(function(we,Fe){C[P++]=Qe(Fe,we)});var Z=new Array(this._edges.size);return P=0,this._edges.forEach(function(we,Fe){Z[P++]=vt(Fe,we)}),{attributes:this.getAttributes(),nodes:C,edges:Z,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},oe.importNode=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=St(C);if(Z){if("not-object"===Z)throw new me('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===Z)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===Z)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=C.key,Fe=C.attributes,et=void 0===Fe?{}:Fe;return P?this.mergeNode(we,et):this.addNode(we,et),this},oe.importEdge=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=At(C);if(Z){if("not-object"===Z)throw new me('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===Z)throw new me("Graph.importEdge: missing souce.");if("no-target"===Z)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===Z)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===Z)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=C.source,Fe=C.target,et=C.attributes,Dt=void 0===et?{}:et,$e=C.undirected,Gt=void 0!==$e&&$e;return"key"in C?(P?Gt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:Gt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,C.key,we,Fe,Dt):(P?Gt?this.mergeUndirectedEdge:this.mergeDirectedEdge:Gt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Dt),this},oe.import=function(C){var P,Z,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V(C))return this.import(C.export(),Fe),this;if(!L(C))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(C.attributes){if(!L(C.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(C.attributes):this.replaceAttributes(C.attributes)}if(C.nodes){if(we=C.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(P=0,Z=we.length;PZ)){var Dt=new Set;Dt.add(P.undirected[et]),P.undirected[et]=Dt,C._nodes.get(et).undirected[Z]=Dt}})),this;var C},oe.clearIndex=function(){return this._nodes.forEach(function(C){void 0!==C.in&&(C.in={},C.out={}),void 0!==C.undirected&&(C.undirected={})}),this},oe.toJSON=function(){return this.export()},oe.toString=function(){return"[object Graph]"},oe.inspect=function(){var C=this,P={};this._nodes.forEach(function(Dt,$e){P[$e]=Dt.attributes});var Z={},we={};this._edges.forEach(function(Dt,$e){var Gt=Dt.undirected?"--":"->",bt="",gn="(".concat(Dt.source.key,")").concat(Gt,"(").concat(Dt.target.key,")");Dt.generatedKey?C.multi&&(void 0===we[gn]?we[gn]=0:we[gn]++,bt+="".concat(we[gn],". ")):bt+="[".concat($e,"]: "),Z[bt+=gn]=Dt.attributes});var Fe={};for(var et in this)this.hasOwnProperty(et)&&!Bn.has(et)&&"function"!=typeof this[et]&&(Fe[et]=this[et]);return Fe.attributes=this._attributes,Fe.nodes=P,Fe.edges=Z,$(Fe,"constructor",this.constructor),Fe},de}(A.exports.EventEmitter);"undefined"!=typeof Symbol&&(En.prototype[Symbol.for("nodejs.util.inspect.custom")]=En.prototype.inspect),[{name:function(ne){return"".concat(ne,"Edge")},generateKey:!0},{name:function(ne){return"".concat(ne,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ne){return"".concat(ne,"EdgeWithKey")}},{name:function(ne){return"".concat(ne,"DirectedEdgeWithKey")},type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ne){["add","merge","update"].forEach(function(de){var oe=ne.name(de),C="add"===de?pn:Un;En.prototype[oe]=ne.generateKey?function(P,Z,we){return C(this,oe,!0,"undirected"===(ne.type||this.type),null,P,Z,we,"update"===de)}:function(P,Z,we,Fe){return C(this,oe,!1,"undirected"===(ne.type||this.type),P,Z,we,Fe,"update"===de)}})}),"undefined"!=typeof Symbol&&(En.prototype[Symbol.iterator]=En.prototype.adjacency),ne=En,je.forEach(function(de){var oe=de.name,C=de.attacher;C(ne,oe("Edge"),"mixed"),C(ne,oe("DirectedEdge"),"directed"),C(ne,oe("UndirectedEdge"),"undirected")}),function(ne){Oe.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe,et){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(!arguments.length)return Re(this,Z);if(1===arguments.length){var Dt=this._nodes.get(Fe=""+Fe);if(void 0===Dt)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return An(this.multi,"mixed"===Z?this.type:Z,we,Dt)}if(2===arguments.length){et=""+et;var $e=this._nodes.get(Fe=""+Fe);if(!$e)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" target node in the graph.'));return ci(Z,this.multi,we,$e,et)}throw new me("Graph.".concat(P,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1);oe.prototype[Fe]=function(et,Dt,$e){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return Xe(this,Z,$e=et);if(2===arguments.length){$e=Dt;var Gt=this._nodes.get(et=""+et);if(void 0===Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Rn(this.multi,"mixed"===Z?this.type:Z,we,Gt,$e)}if(3===arguments.length){Dt=""+Dt;var bt=this._nodes.get(et=""+et);if(!bt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Ur(Z,this.multi,we,bt,Dt,$e)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1)+"Until";oe.prototype[Fe]=function(et,Dt,$e){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return yt(this,Z,$e=et);if(2===arguments.length){$e=Dt;var Gt=this._nodes.get(et=""+et);if(void 0===Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Hn(this.multi,"mixed"===Z?this.type:Z,we,Gt,$e)}if(3===arguments.length){Dt=""+Dt;var bt=this._nodes.get(et=""+et);if(!bt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Is(Z,this.multi,we,bt,Dt,$e)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var Z=C.type,we=C.direction,Fe=C.name.slice(0,-1)+"Entries";oe.prototype[Fe]=function(et,Dt){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return ee.empty();if(!arguments.length)return It(this,Z);if(1===arguments.length){var $e=this._nodes.get(et=""+et);if(!$e)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return yi(Z,we,$e)}if(2===arguments.length){Dt=""+Dt;var Gt=this._nodes.get(et=""+et);if(!Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return as(Z,we,Gt,Dt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ne,de)})}(En),function(ne){Os.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(2===arguments.length){var et=""+arguments[0],Dt=""+arguments[1];if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(P,': could not find the "').concat(Dt,'" node in the graph.'));return ot(this,Z,we,et,Dt)}if(1===arguments.length){var $e=this._nodes.get(Fe=""+Fe);if(void 0===$e)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return Va("mixed"===Z?this.type:Z,we,$e)}throw new me("Graph.".concat(P,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1);ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,$e,Gt,bt){if("mixed"!==Dt){if("undirected"===Dt)return wl(Gt,Gt.undirected,bt);if("string"==typeof $e)return wl(Gt,Gt[$e],bt)}var gn=new Set;"undirected"!==Dt&&("out"!==$e&&la(gn,Gt,Gt.in,bt),"in"!==$e&&la(gn,Gt,Gt.out,bt)),"directed"!==Dt&&la(gn,Gt,Gt.undirected,bt)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1)+"Until";ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,$e,Gt,bt){if("mixed"!==Dt){if("undirected"===Dt)return ps(Gt,Gt.undirected,bt);if("string"==typeof $e)return ps(Gt,Gt[$e],bt)}var gn=new Set;"undirected"!==Dt&&("out"!==$e&&Zt(gn,Gt,Gt.in,bt)||"in"!==$e&&Zt(gn,Gt,Gt.out,bt))||"directed"===Dt||Zt(gn,Gt,Gt.undirected,bt)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var C=de.type,P=de.direction,Z=de.name.slice(0,-1)+"Entries";ne.prototype[Z]=function(we){if("mixed"!==C&&"mixed"!==this.type&&C!==this.type)return ee.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));return function(et,Dt,$e){if("mixed"!==et){if("undirected"===et)return Ua($e,$e.undirected);if("string"==typeof Dt)return Ua($e,$e[Dt])}var Gt=ee.empty(),bt=new Set;return"undirected"!==et&&("out"!==Dt&&(Gt=Ee(Gt,rt(bt,$e,$e.in))),"in"!==Dt&&(Gt=Ee(Gt,rt(bt,$e,$e.out)))),"directed"!==et&&(Gt=Ee(Gt,rt(bt,$e,$e.undirected))),Gt}("mixed"===C?this.type:C,P,Fe)}}(ne,de)})}(En);var Qi=function(ne){function de(oe){var C=he({type:"directed"},oe);if("multi"in C&&!1!==C.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==C.type)throw new me('DirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),Zi=function(ne){function de(oe){var C=he({type:"undirected"},oe);if("multi"in C&&!1!==C.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==C.type)throw new me('UndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),Wn=function(ne){function de(oe){var C=he({multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ne.call(this,C)||this}return tt(de,ne),de}(En),Fi=function(ne){function de(oe){var C=he({type:"directed",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==C.type)throw new me('MultiDirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),ca=function(ne){function de(oe){var C=he({type:"undirected",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==C.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En);function Hr(ne){ne.from=function(de,oe){var C=he({},de.options,oe),P=new ne(C);return P.import(de),P}}return Hr(En),Hr(Qi),Hr(Zi),Hr(Wn),Hr(Fi),Hr(ca),En.Graph=En,En.DirectedGraph=Qi,En.UndirectedGraph=Zi,En.MultiGraph=Wn,En.MultiDirectedGraph=Fi,En.MultiUndirectedGraph=ca,En.InvalidArgumentsGraphError=me,En.NotFoundGraphError=te,En.UsageGraphError=ye,En}()},524:(jt,it,tt)=>{var gt;!function(J,xt,ut,Y){"use strict";var A,Ae=["","webkit","Moz","MS","ms","o"],he=xt.createElement("div"),V=Math.round,L=Math.abs,re=Date.now;function $(_e,xe,He){return setTimeout(D(_e,He),xe)}function b(_e,xe,He){return!!Array.isArray(_e)&&(S(_e,He[xe],He),!0)}function S(_e,xe,He){var mt;if(_e)if(_e.forEach)_e.forEach(xe,He);else if(_e.length!==Y)for(mt=0;mt<_e.length;)xe.call(He,_e[mt],mt,_e),mt++;else for(mt in _e)_e.hasOwnProperty(mt)&&xe.call(He,_e[mt],mt,_e)}function R(_e,xe,He){var mt="DEPRECATED METHOD: "+xe+"\n"+He+" AT \n";return function(){var Ut=new Error("get-stack-trace"),$t=Ut&&Ut.stack?Ut.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ni=J.console&&(J.console.warn||J.console.log);return ni&&ni.call(J.console,mt,$t),_e.apply(this,arguments)}}A="function"!=typeof Object.assign?function(xe){if(xe===Y||null===xe)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(xe),mt=1;mt-1}function Q(_e){return _e.trim().split(/\s+/g)}function E(_e,xe,He){if(_e.indexOf&&!He)return _e.indexOf(xe);for(var mt=0;mt<_e.length;){if(He&&_e[mt][He]==xe||!He&&_e[mt]===xe)return mt;mt++}return-1}function U(_e){return Array.prototype.slice.call(_e,0)}function ie(_e,xe,He){for(var mt=[],Ut=[],$t=0;$t<_e.length;){var ni=xe?_e[$t][xe]:_e[$t];E(Ut,ni)<0&&mt.push(_e[$t]),Ut[$t]=ni,$t++}return He&&(mt=xe?mt.sort(function($r,ms){return $r[xe]>ms[xe]}):mt.sort()),mt}function ue(_e,xe){for(var He,mt,Ut=xe[0].toUpperCase()+xe.slice(1),$t=0;$t1&&!He.firstMultiple?He.firstMultiple=yt(xe):1===Ut&&(He.firstMultiple=!1);var $t=He.firstInput,ni=He.firstMultiple,Nr=ni?ni.center:$t.center,$r=xe.center=It(mt);xe.timeStamp=re(),xe.deltaTime=xe.timeStamp-$t.timeStamp,xe.angle=yi(Nr,$r),xe.distance=Hn(Nr,$r),function(_e,xe){var He=xe.center,mt=_e.offsetDelta||{},Ut=_e.prevDelta||{},$t=_e.prevInput||{};(1===xe.eventType||4===$t.eventType)&&(Ut=_e.prevDelta={x:$t.deltaX||0,y:$t.deltaY||0},mt=_e.offsetDelta={x:He.x,y:He.y}),xe.deltaX=Ut.x+(He.x-mt.x),xe.deltaY=Ut.y+(He.y-mt.y)}(He,xe),xe.offsetDirection=Rn(xe.deltaX,xe.deltaY);var ms=An(xe.deltaTime,xe.deltaX,xe.deltaY);xe.overallVelocityX=ms.x,xe.overallVelocityY=ms.y,xe.overallVelocity=L(ms.x)>L(ms.y)?ms.x:ms.y,xe.scale=ni?function(_e,xe){return Hn(xe[0],xe[1],pt)/Hn(_e[0],_e[1],pt)}(ni.pointers,mt):1,xe.rotation=ni?function(_e,xe){return yi(xe[1],xe[0],pt)+yi(_e[1],_e[0],pt)}(ni.pointers,mt):0,xe.maxPointers=He.prevInput?xe.pointers.length>He.prevInput.maxPointers?xe.pointers.length:He.prevInput.maxPointers:xe.pointers.length,function(_e,xe){var Ut,$t,ni,Nr,He=_e.lastInterval||xe,mt=xe.timeStamp-He.timeStamp;if(8!=xe.eventType&&(mt>25||He.velocity===Y)){var $r=xe.deltaX-He.deltaX,ms=xe.deltaY-He.deltaY,Jn=An(mt,$r,ms);$t=Jn.x,ni=Jn.y,Ut=L(Jn.x)>L(Jn.y)?Jn.x:Jn.y,Nr=Rn($r,ms),_e.lastInterval=xe}else Ut=He.velocity,$t=He.velocityX,ni=He.velocityY,Nr=He.direction;xe.velocity=Ut,xe.velocityX=$t,xe.velocityY=ni,xe.direction=Nr}(He,xe);var Jn=_e.element;M(xe.srcEvent.target,Jn)&&(Jn=xe.srcEvent.target),xe.target=Jn}(_e,He),_e.emit("hammer.input",He),_e.recognize(He),_e.session.prevInput=He}function yt(_e){for(var xe=[],He=0;He<_e.pointers.length;)xe[He]={clientX:V(_e.pointers[He].clientX),clientY:V(_e.pointers[He].clientY)},He++;return{timeStamp:re(),pointers:xe,center:It(xe),deltaX:_e.deltaX,deltaY:_e.deltaY}}function It(_e){var xe=_e.length;if(1===xe)return{x:V(_e[0].clientX),y:V(_e[0].clientY)};for(var He=0,mt=0,Ut=0;Ut=L(xe)?_e<0?2:4:xe<0?8:16}function Hn(_e,xe,He){He||(He=Et);var mt=xe[He[0]]-_e[He[0]],Ut=xe[He[1]]-_e[He[1]];return Math.sqrt(mt*mt+Ut*Ut)}function yi(_e,xe,He){return He||(He=Et),180*Math.atan2(xe[He[1]]-_e[He[1]],xe[He[0]]-_e[He[0]])/Math.PI}pe.prototype={handler:function(){},init:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(Te(this.element),this.evWin,this.domHandler)}};var Is={mousedown:1,mousemove:2,mouseup:4},as="mousedown",Os="mousemove mouseup";function zr(){this.evEl=as,this.evWin=Os,this.pressed=!1,pe.apply(this,arguments)}w(zr,pe,{handler:function(xe){var He=Is[xe.type];1&He&&0===xe.button&&(this.pressed=!0),2&He&&1!==xe.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[xe],changedPointers:[xe],pointerType:Ze,srcEvent:xe}))}});var Va={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},wl={2:Ve,3:"pen",4:Ze,5:"kinect"},la="pointerdown",ps="pointermove pointerup pointercancel";function Zt(){this.evEl=la,this.evWin=ps,pe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}J.MSPointerEvent&&!J.PointerEvent&&(la="MSPointerDown",ps="MSPointerMove MSPointerUp MSPointerCancel"),w(Zt,pe,{handler:function(xe){var He=this.store,mt=!1,Ut=xe.type.toLowerCase().replace("ms",""),$t=Va[Ut],ni=wl[xe.pointerType]||xe.pointerType,Nr=ni==Ve,$r=E(He,xe.pointerId,"pointerId");1&$t&&(0===xe.button||Nr)?$r<0&&(He.push(xe),$r=He.length-1):12&$t&&(mt=!0),!($r<0)&&(He[$r]=xe,this.callback(this.manager,$t,{pointers:He,changedPointers:[xe],pointerType:ni,srcEvent:xe}),mt&&He.splice($r,1))}});var Ua={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",ot="touchstart touchmove touchend touchcancel";function ct(){this.evTarget=rt,this.evWin=ot,this.started=!1,pe.apply(this,arguments)}function fe(_e,xe){var He=U(_e.touches),mt=U(_e.changedTouches);return 12&xe&&(He=ie(He.concat(mt),"identifier",!0)),[He,mt]}w(ct,pe,{handler:function(xe){var He=Ua[xe.type];if(1===He&&(this.started=!0),this.started){var mt=fe.call(this,xe,He);12&He&&mt[0].length-mt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:mt[0],changedPointers:mt[1],pointerType:Ve,srcEvent:xe})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ke="touchstart touchmove touchend touchcancel";function lt(){this.evTarget=ke,this.targetIds={},pe.apply(this,arguments)}function Qe(_e,xe){var He=U(_e.touches),mt=this.targetIds;if(3&xe&&1===He.length)return mt[He[0].identifier]=!0,[He,He];var Ut,$t,ni=U(_e.changedTouches),Nr=[],$r=this.target;if($t=He.filter(function(ms){return M(ms.target,$r)}),1===xe)for(Ut=0;Ut<$t.length;)mt[$t[Ut].identifier]=!0,Ut++;for(Ut=0;Ut-1&&mt.splice($t,1)},2500)}}function ti(_e){for(var xe=_e.srcEvent.clientX,He=_e.srcEvent.clientY,mt=0;mt-1&&this.requireFail.splice(xe,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(_e){return!!this.simultaneous[_e.id]},emit:function(_e){var xe=this,He=this.state;function mt(Ut){xe.manager.emit(Ut,_e)}He<8&&mt(xe.options.event+$e(He)),mt(xe.options.event),_e.additionalEvent&&mt(_e.additionalEvent),He>=8&&mt(xe.options.event+$e(He))},tryEmit:function(_e){if(this.canEmit())return this.emit(_e);this.state=32},canEmit:function(){for(var _e=0;_exe.threshold&&Ut&xe.direction},attrTest:function(_e){return gn.prototype.attrTest.call(this,_e)&&(2&this.state||!(2&this.state)&&this.directionTest(_e))},emit:function(_e){this.pX=_e.deltaX,this.pY=_e.deltaY;var xe=Gt(_e.direction);xe&&(_e.additionalEvent=this.options.event+xe),this._super.emit.call(this,_e)}}),w(Gr,gn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.scale-1)>this.options.threshold||2&this.state)},emit:function(_e){1!==_e.scale&&(_e.additionalEvent=this.options.event+(_e.scale<1?"in":"out")),this._super.emit.call(this,_e)}}),w(Gs,Dt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(_e){var xe=this.options,He=_e.pointers.length===xe.pointers,mt=_e.distancexe.time;if(this._input=_e,!mt||!He||12&_e.eventType&&!Ut)this.reset();else if(1&_e.eventType)this.reset(),this._timer=$(function(){this.state=8,this.tryEmit()},xe.time,this);else if(4&_e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(_e){8===this.state&&(_e&&4&_e.eventType?this.manager.emit(this.options.event+"up",_e):(this._input.timeStamp=re(),this.manager.emit(this.options.event,this._input)))}}),w(El,gn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.rotation)>this.options.threshold||2&this.state)}}),w(io,gn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return gs.prototype.getTouchAction.call(this)},attrTest:function(_e){var He,xe=this.options.direction;return 30&xe?He=_e.overallVelocity:6&xe?He=_e.overallVelocityX:24&xe&&(He=_e.overallVelocityY),this._super.attrTest.call(this,_e)&&xe&_e.offsetDirection&&_e.distance>this.options.threshold&&_e.maxPointers==this.options.pointers&&L(He)>this.options.velocity&&4&_e.eventType},emit:function(_e){var xe=Gt(_e.offsetDirection);xe&&this.manager.emit(this.options.event+xe,_e),this.manager.emit(this.options.event,_e)}}),w(Rr,Dt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Qi]},process:function(_e){var xe=this.options,He=_e.pointers.length===xe.pointers,mt=_e.distance"']/g,ps=RegExp(wl.source),Zt=RegExp(la.source),Ua=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fe=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,lt=RegExp(ke.source),Qe=/^\s+/,vt=/\s/,St=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,At=/\{\n\/\* \[wrapped with (.+)\] \*/,qt=/,? & /,Bn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ti=/[()=,{}\[\]\/\s]/,Mn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Un=/\w*$/,En=/^[-+]0x[0-9a-f]+$/i,Qi=/^0b[01]+$/i,Zi=/^\[object .+?Constructor\]$/,Wn=/^0o[0-7]+$/i,Fi=/^(?:0|[1-9]\d*)$/,ca=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hr=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,de="\\ud800-\\udfff",Z="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",bt="A-Z\\xc0-\\xd6\\xd8-\\xde",gn="\\ufe0e\\ufe0f",gs="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gs="["+de+"]",El="["+gs+"]",io="["+Z+"]",Rr="\\d+",Rs="["+we+"]",lc="["+Fe+"]",bn="[^"+de+gs+Rr+we+Fe+bt+"]",ro="\\ud83c[\\udffb-\\udfff]",ua="[^"+de+"]",nd="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="["+bt+"]",mt="(?:"+lc+"|"+bn+")",Ut="(?:"+xe+"|"+bn+")",$t="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ni="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Nr="(?:"+io+"|"+ro+")?",$r="["+gn+"]?",yx=$r+Nr+"(?:\\u200d(?:"+[ua,nd,_e].join("|")+")"+$r+Nr+")*",id="(?:"+[Rs,nd,_e].join("|")+")"+yx,Wi="(?:"+[ua+io+"?",io,nd,_e,Gs].join("|")+")",Gf=RegExp("['\u2019]","g"),wm=RegExp(io,"g"),hh=RegExp(ro+"(?="+ro+")|"+Wi+yx,"g"),ab=RegExp([xe+"?"+lc+"+"+$t+"(?="+[El,xe,"$"].join("|")+")",Ut+"+"+ni+"(?="+[El,xe+mt,"$"].join("|")+")",xe+"?"+mt+"+"+$t,xe+"+"+ni,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rr,id].join("|"),"g"),vx=RegExp("[\\u200d"+de+Z+gn+"]"),Cl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bx=-1,_n={};_n[It]=_n[An]=_n[Rn]=_n[Hn]=_n[yi]=_n[ci]=_n[Ur]=_n[Is]=_n[as]=!0,_n[Ze]=_n[Je]=_n[Xe]=_n[je]=_n[yt]=_n[Le]=_n[Oe]=_n[Ue]=_n[Be]=_n[z]=_n[be]=_n[Et]=_n[pt]=_n[pe]=_n[k]=!1;var Ji={};Ji[Ze]=Ji[Je]=Ji[Xe]=Ji[yt]=Ji[je]=Ji[Le]=Ji[It]=Ji[An]=Ji[Rn]=Ji[Hn]=Ji[yi]=Ji[Be]=Ji[z]=Ji[be]=Ji[Et]=Ji[pt]=Ji[pe]=Ji[B]=Ji[ci]=Ji[Ur]=Ji[Is]=Ji[as]=!0,Ji[Oe]=Ji[Ue]=Ji[k]=!1;var ln={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},wx=parseFloat,db=parseInt,kt="object"==typeof global&&global&&global.Object===Object&&global,Ns="object"==typeof self&&self&&self.Object===Object&&self,Ii=kt||Ns||Function("return this")(),xl=it&&!it.nodeType&&it,da=xl&&jt&&!jt.nodeType&&jt,bo=da&&da.exports===xl,Em=bo&&kt.process,mr=function(){try{return da&&da.require&&da.require("util").types||Em&&Em.binding&&Em.binding("util")}catch(Tt){}}(),tn=mr&&mr.isArrayBuffer,ii=mr&&mr.isDate,nr=mr&&mr.isMap,so=mr&&mr.isRegExp,cc=mr&&mr.isSet,Qr=mr&&mr.isTypedArray;function Zr(st,Tt,_t){switch(_t.length){case 0:return st.call(Tt);case 1:return st.call(Tt,_t[0]);case 2:return st.call(Tt,_t[0],_t[1]);case 3:return st.call(Tt,_t[0],_t[1],_t[2])}return st.apply(Tt,_t)}function Pr(st,Tt,_t,cn){for(var Cn=-1,Di=null==st?0:st.length;++Cn-1}function ph(st,Tt,_t){for(var cn=-1,Cn=null==st?0:st.length;++cn-1;);return _t}function xx(st,Tt){for(var _t=st.length;_t--&&za(Tt,st[_t],0)>-1;);return _t}function mP(st,Tt){for(var _t=st.length,cn=0;_t--;)st[_t]===Tt&&++cn;return cn}var _P=ko({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),yP=ko({"&":"&","<":"<",">":">",'"':""","'":"'"});function vP(st){return"\\"+ln[st]}function _h(st){return vx.test(st)}function fb(st){var Tt=-1,_t=Array(st.size);return st.forEach(function(cn,Cn){_t[++Tt]=[Cn,cn]}),_t}function Ax(st,Tt){return function(_t){return st(Tt(_t))}}function iu(st,Tt){for(var _t=-1,cn=st.length,Cn=0,Di=[];++_t",""":'"',"'":"'"}),vh=function st(Tt){var u,_t=(Tt=null==Tt?Ii:vh.defaults(Ii.Object(),Tt,vh.pick(Ii,fh))).Array,cn=Tt.Date,Cn=Tt.Error,Di=Tt.Function,Wr=Tt.Math,Bi=Tt.Object,Mm=Tt.RegExp,Im=Tt.String,pa=Tt.TypeError,ir=_t.prototype,ru=Bi.prototype,Wf=Tt["__core-js_shared__"],_r=Di.prototype.toString,ji=ru.hasOwnProperty,xP=0,bh=(u=/[^.]+$/.exec(Wf&&Wf.keys&&Wf.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",$s=ru.toString,Mx=_r.call(Bi),Om=Ii._,cd=Mm("^"+_r.call(ji).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fs=bo?Tt.Buffer:J,Tl=Tt.Symbol,ud=Tt.Uint8Array,mb=Fs?Fs.allocUnsafe:J,ga=Ax(Bi.getPrototypeOf,Bi),Rm=Bi.create,qf=ru.propertyIsEnumerable,Pn=ir.splice,Ix=Tl?Tl.isConcatSpreadable:J,wh=Tl?Tl.iterator:J,su=Tl?Tl.toStringTag:J,Yf=function(){try{var u=wc(Bi,"defineProperty");return u({},"",{}),u}catch(h){}}(),_b=Tt.clearTimeout!==Ii.clearTimeout&&Tt.clearTimeout,Ox=cn&&cn.now!==Ii.Date.now&&cn.now,Rx=Tt.setTimeout!==Ii.setTimeout&&Tt.setTimeout,Bt=Wr.ceil,ui=Wr.floor,Vo=Bi.getOwnPropertySymbols,Jr=Fs?Fs.isBuffer:J,Nm=Tt.isFinite,Eh=ir.join,Ga=Ax(Bi.keys,Bi),Lr=Wr.max,ls=Wr.min,AP=cn.now,Nx=Tt.parseInt,Sh=Wr.random,Kf=ir.reverse,ys=wc(Tt,"DataView"),oo=wc(Tt,"Map"),Xf=wc(Tt,"Promise"),ma=wc(Tt,"Set"),Eo=wc(Tt,"WeakMap"),Ch=wc(Bi,"create"),xh=Eo&&new Eo,dd={},Px=_u(ys),Pm=_u(oo),Fm=_u(Xf),yb=_u(ma),Lm=_u(Eo),Qf=Tl?Tl.prototype:J,hd=Qf?Qf.valueOf:J,Ah=Qf?Qf.toString:J;function Se(u){if(br(u)&&!Tn(u)&&!(u instanceof ri)){if(u instanceof So)return u;if(ji.call(u,"__wrapped__"))return wp(u)}return new So(u)}var ou=function(){function u(){}return function(h){if(!vr(h))return{};if(Rm)return Rm(h);u.prototype=h;var m=new u;return u.prototype=J,m}}();function Th(){}function So(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=J}function ri(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function ao(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function Ls(u,h,m,N,ae,Ce){var ze,Ye=1&h,at=2&h,Rt=4&h;if(m&&(ze=ae?m(u,N,ae,Ce):m(u)),ze!==J)return ze;if(!vr(u))return u;var Nt=Tn(u);if(Nt){if(ze=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&ji.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!Ye)return qs(u,ze)}else{var Vt=Bs(u),en=Vt==Ue||Vt==qe;if(tl(u))return up(u,Ye);if(Vt==be||Vt==Ze||en&&!ae){if(ze=at||en?{}:Hb(u),!Ye)return at?function(u,h){return ba(u,Vb(u),h)}(u,function(u,h){return u&&ba(h,Ks(h),u)}(ze,u)):function(u,h){return ba(u,r_(u),h)}(u,Wx(ze,u))}else{if(!Ji[Vt])return ae?u:{};ze=function(u,h,m){var N=u.constructor;switch(h){case Xe:return fu(u);case je:case Le:return new N(+u);case yt:return function(u,h){var m=h?fu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case It:case An:case Rn:case Hn:case yi:case ci:case Ur:case Is:case as:return Jm(u,m);case Be:return new N;case z:case pe:return new N(u);case Et:return function(u){var h=new u.constructor(u.source,Un.exec(u));return h.lastIndex=u.lastIndex,h}(u);case pt:return new N;case B:return function(u){return hd?Bi(hd.call(u)):{}}(u)}}(u,Vt,Ye)}}Ce||(Ce=new ya);var vn=Ce.get(u);if(vn)return vn;Ce.set(u,ze),fA(u)?u.forEach(function(Fn){ze.add(Ls(Fn,h,m,Fn,u,Ce))}):cA(u)&&u.forEach(function(Fn,ai){ze.set(ai,Ls(Fn,h,m,ai,u,Ce))});var oi=Nt?J:(Rt?at?n_:Nl:at?Ks:Ss)(u);return Ps(oi||u,function(Fn,ai){oi&&(Fn=u[ai=Fn]),Wa(ze,ai,Ls(Fn,h,m,ai,u,Ce))}),ze}function ip(u,h,m){var N=m.length;if(null==u)return!N;for(u=Bi(u);N--;){var ae=m[N],ze=u[ae];if(ze===J&&!(ae in u)||!(0,h[ae])(ze))return!1}return!0}function Ih(u,h,m){if("function"!=typeof u)throw new pa(Ae);return kh(function(){u.apply(J,m)},h)}function fc(u,h,m,N){var ae=-1,Ce=Al,ze=!0,Ye=u.length,at=[],Rt=h.length;if(!Ye)return at;m&&(h=Li(h,jo(m))),N?(Ce=ph,ze=!1):h.length>=200&&(Ce=mh,ze=!1,h=new _a(h));e:for(;++ae-1},Dl.prototype.set=function(u,h){var m=this.__data__,N=pd(m,u);return N<0?(++this.size,m.push([u,h])):m[N][1]=h,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new ao,map:new(oo||Dl),string:new ao}},$a.prototype.delete=function(u){var h=ks(this,u).delete(u);return this.size-=h?1:0,h},$a.prototype.get=function(u){return ks(this,u).get(u)},$a.prototype.has=function(u){return ks(this,u).has(u)},$a.prototype.set=function(u,h){var m=ks(this,u),N=m.size;return m.set(u,h),this.size+=m.size==N?0:1,this},_a.prototype.add=_a.prototype.push=function(u){return this.__data__.set(u,W),this},_a.prototype.has=function(u){return this.__data__.has(u)},ya.prototype.clear=function(){this.__data__=new Dl,this.size=0},ya.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},ya.prototype.get=function(u){return this.__data__.get(u)},ya.prototype.has=function(u){return this.__data__.has(u)},ya.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Dl){var N=m.__data__;if(!oo||N.length<199)return N.push([u,h]),this.size=++m.size,this;m=this.__data__=new $a(N)}return m.set(u,h),this.size=m.size,this};var pc=Xa(Ya),Gm=Xa(rp,!0);function Eb(u,h){var m=!0;return pc(u,function(N,ae,Ce){return m=!!h(N,ae,Ce)}),m}function Oh(u,h,m){for(var N=-1,ae=u.length;++N0&&m(Ye)?h>1?vs(Ye,h-1,m,N,ae):Fr(ae,Ye):N||(ae[ae.length]=Ye)}return ae}var gd=Ob(),md=Ob(!0);function Ya(u,h){return u&&gd(u,h,Ss)}function rp(u,h){return u&&md(u,h,Ss)}function Rh(u,h){return ha(h,function(m){return Xo(u[m])})}function Uo(u,h){for(var m=0,N=(h=yc(h,u)).length;null!=u&&mh}function _d(u,h){return null!=u&&ji.call(u,h)}function yd(u,h){return null!=u&&h in Bi(u)}function lu(u,h,m){for(var N=m?ph:Al,ae=u[0].length,Ce=u.length,ze=Ce,Ye=_t(Ce),at=1/0,Rt=[];ze--;){var Nt=u[ze];ze&&h&&(Nt=Li(Nt,jo(h))),at=ls(Nt.length,at),Ye[ze]=!m&&(h||ae>=120&&Nt.length>=120)?new _a(ze&&Nt):J}Nt=u[0];var Vt=-1,en=Ye[0];e:for(;++Vt=Ye?at:at*("desc"==m[N]?-1:1)}return u.index-h.index}(Ce,ze,m)});_t--;)st[_t]=st[_t].value;return st}(Qx(u,function(Ce,ze,Ye){return{criteria:Li(h,function(Rt){return Rt(Ce)}),index:++N,value:Ce}}))}function Tb(u,h,m){for(var N=-1,ae=h.length,Ce={};++N-1;)Ye!==u&&Pn.call(Ye,at,1),Pn.call(u,at,1);return u}function Ph(u,h){for(var m=u?h.length:0,N=m-1;m--;){var ae=h[m];if(m==N||ae!==Ce){var Ce=ae;Ao(ae)?Pn.call(u,ae,1):uu(u,ae)}}return u}function Ml(u,h){return u+ui(Sh()*(h-u+1))}function op(u,h){var m="";if(!u||h<1||h>Te)return m;do{h%2&&(m+=u),(h=ui(h/2))&&(u+=u)}while(h);return m}function si(u,h){return bp(p1(u,h,Xs),u+"")}function Jx(u){return Vm(Ld(u))}function FP(u,h){var m=Ld(u);return Td(m,au(h,0,m.length))}function ap(u,h,m,N){if(!vr(u))return u;for(var ae=-1,Ce=(h=yc(h,u)).length,ze=Ce-1,Ye=u;null!=Ye&&++aeae?0:ae+h),(m=m>ae?ae:m)<0&&(m+=ae),ae=h>m?0:m-h>>>0,h>>>=0;for(var Ce=_t(ae);++N>>1,ze=u[Ce];null!==ze&&!Qo(ze)&&(m?ze<=h:ze=200){var Rt=h?null:t_(u);if(Rt)return Am(Rt);ze=!1,ae=mh,at=new _a}else at=h?[]:Ye;e:for(;++N=N?u:ws(u,h,m)}var n1=_b||function(u){return Ii.clearTimeout(u)};function up(u,h){if(h)return u.slice();var m=u.length,N=mb?mb(m):new u.constructor(m);return u.copy(N),N}function fu(u){var h=new u.constructor(u.byteLength);return new ud(h).set(new ud(u)),h}function Jm(u,h){var m=h?fu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function vc(u,h){if(u!==h){var m=u!==J,N=null===u,ae=u==u,Ce=Qo(u),ze=h!==J,Ye=null===h,at=h==h,Rt=Qo(h);if(!Ye&&!Rt&&!Ce&&u>h||Ce&&ze&&at&&!Ye&&!Rt||N&&ze&&at||!m&&at||!ae)return 1;if(!N&&!Ce&&!Rt&&u1?m[ae-1]:J,ze=ae>2?m[2]:J;for(Ce=u.length>3&&"function"==typeof Ce?(ae--,Ce):J,ze&&js(m[0],m[1],ze)&&(Ce=ae<3?J:Ce,ae=1),h=Bi(h);++N-1?ae[Ce?h[ze]:ze]:J}}function gu(u){return Qa(function(h){var m=h.length,N=m,ae=So.prototype.thru;for(u&&h.reverse();N--;){var Ce=h[N];if("function"!=typeof Ce)throw new pa(Ae);if(ae&&!ze&&"wrapper"==_p(Ce))var ze=new So([],!0)}for(N=ze?N:m;++N1&&vi.reverse(),Nt&&atYe))return!1;var Rt=Ce.get(u),Nt=Ce.get(h);if(Rt&&Nt)return Rt==h&&Nt==u;var Vt=-1,en=!0,vn=2&m?new _a:J;for(Ce.set(u,h),Ce.set(h,u);++Vt-1&&u%1==0&&u1?"& ":"")+h[N],h=h.join(m>2?", ":" "),u.replace(St,"{\n/* [wrapped with "+h+"] */\n")}(N,function(u,h){return Ps(nt,function(m){var N="_."+m[0];h&m[1]&&!Al(u,N)&&u.push(N)}),u.sort()}(function(u){var h=u.match(At);return h?h[1].split(qt):[]}(N),m)))}function u_(u){var h=0,m=0;return function(){var N=AP(),ae=16-(N-m);if(m=N,ae>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(J,arguments)}}function Td(u,h){var m=-1,N=u.length,ae=N-1;for(h=h===J?N:h;++m1?u[h-1]:J;return m="function"==typeof m?(u.pop(),m):J,j1(u,m)});function b_(u){var h=Se(u);return h.__chain__=!0,h}function Md(u,h){return h(u)}var w_=Qa(function(u){var h=u.length,m=h?u[0]:0,N=this.__wrapped__,ae=function(Ce){return zm(Ce,u)};return!(h>1||this.__actions__.length)&&N instanceof ri&&Ao(m)?((N=N.slice(m,+m+(h?1:0))).__actions__.push({func:Md,args:[ae],thisArg:J}),new So(N,this.__chain__).thru(function(Ce){return h&&!Ce.length&&Ce.push(J),Ce})):this.thru(ae)}),z1=qr(function(u,h,m){ji.call(u,m)?++u[m]:qa(u,m,1)}),$1=Nb(h_),W1=Nb(f_);function x_(u,h){return(Tn(u)?Ps:pc)(u,On(h,3))}function Cp(u,h){return(Tn(u)?rd:Gm)(u,On(h,3))}var Y1=qr(function(u,h,m){ji.call(u,m)?u[m].push(h):qa(u,m,[h])}),h0=si(function(u,h,m){var N=-1,ae="function"==typeof h,Ce=lo(u)?_t(u.length):[];return pc(u,function(ze){Ce[++N]=ae?Zr(h,ze,m):va(ze,h,m)}),Ce}),f0=qr(function(u,h,m){qa(u,m,h)});function Ja(u,h){return(Tn(u)?Li:Qx)(u,On(h,3))}var g0=qr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),Ap=si(function(u,h){if(null==u)return[];var m=h.length;return m>1&&js(u,h[0],h[1])?h=[]:m>2&&js(h[0],h[1],h[2])&&(h=[h[0]]),Nh(u,vs(h,1),[])}),yu=Ox||function(){return Ii.Date.now()};function Tp(u,h,m){return h=m?J:h,Rl(u,H,J,J,J,J,h=u&&null==h?u.length:h)}function T_(u,h){var m;if("function"!=typeof h)throw new pa(Ae);return u=Kn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=J),m}}var zh=si(function(u,h,m){var N=1;if(m.length){var ae=iu(m,Ad(zh));N|=j}return Rl(u,N,h,m,ae)}),Od=si(function(u,h,m){var N=3;if(m.length){var ae=iu(m,Ad(Od));N|=j}return Rl(h,N,u,m,ae)});function E0(u,h,m){var N,ae,Ce,ze,Ye,at,Rt=0,Nt=!1,Vt=!1,en=!0;if("function"!=typeof u)throw new pa(Ae);function vn(Ri){var rl=N,xc=ae;return N=ae=J,Rt=Ri,ze=u.apply(xc,rl)}function Nn(Ri){return Rt=Ri,Ye=kh(ai,h),Nt?vn(Ri):ze}function Fn(Ri){var rl=Ri-at;return at===J||rl>=h||rl<0||Vt&&Ri-Rt>=Ce}function ai(){var Ri=yu();if(Fn(Ri))return vi(Ri);Ye=kh(ai,function(Ri){var nT=h-(Ri-at);return Vt?ls(nT,Ce-(Ri-Rt)):nT}(Ri))}function vi(Ri){return Ye=J,en&&N?vn(Ri):(N=ae=J,ze)}function Zo(){var Ri=yu(),rl=Fn(Ri);if(N=arguments,ae=this,at=Ri,rl){if(Ye===J)return Nn(at);if(Vt)return n1(Ye),Ye=kh(ai,h),vn(at)}return Ye===J&&(Ye=kh(ai,h)),ze}return h=co(h)||0,vr(m)&&(Nt=!!m.leading,Ce=(Vt="maxWait"in m)?Lr(co(m.maxWait)||0,h):Ce,en="trailing"in m?!!m.trailing:en),Zo.cancel=function(){Ye!==J&&n1(Ye),Rt=0,N=at=ae=Ye=J},Zo.flush=function(){return Ye===J?ze:vi(yu())},Zo}var Z1=si(function(u,h){return Ih(u,1,h)}),S0=si(function(u,h,m){return Ih(u,co(h)||0,m)});function Hh(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new pa(Ae);var m=function(){var N=arguments,ae=h?h.apply(this,N):N[0],Ce=m.cache;if(Ce.has(ae))return Ce.get(ae);var ze=u.apply(this,N);return m.cache=Ce.set(ae,ze)||Ce,ze};return m.cache=new(Hh.Cache||$a),m}function I_(u){if("function"!=typeof u)throw new pa(Ae);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}Hh.Cache=$a;var J1=t1(function(u,h){var m=(h=1==h.length&&Tn(h[0])?Li(h[0],jo(On())):Li(vs(h,1),jo(On()))).length;return si(function(N){for(var ae=-1,Ce=ls(N.length,m);++ae=h}),el=qx(function(){return arguments}())?qx:function(u){return br(u)&&ji.call(u,"callee")&&!qf.call(u,"callee")},Tn=_t.isArray,M0=tn?jo(tn):function(u){return br(u)&&bs(u)==Xe};function lo(u){return null!=u&&R_(u.length)&&!Xo(u)}function yr(u){return br(u)&&lo(u)}var tl=Jr||ty,I0=ii?jo(ii):function(u){return br(u)&&bs(u)==Le};function Ea(u){if(!br(u))return!1;var h=bs(u);return h==Oe||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!Op(u)}function Xo(u){if(!vr(u))return!1;var h=bs(u);return h==Ue||h==qe||"[object AsyncFunction]"==h||"[object Proxy]"==h}function Ip(u){return"number"==typeof u&&u==Kn(u)}function R_(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Te}function vr(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function br(u){return null!=u&&"object"==typeof u}var cA=nr?jo(nr):function(u){return br(u)&&Bs(u)==Be};function hA(u){return"number"==typeof u||br(u)&&bs(u)==z}function Op(u){if(!br(u)||bs(u)!=be)return!1;var h=ga(u);if(null===h)return!0;var m=ji.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&_r.call(m)==Mx}var P0=so?jo(so):function(u){return br(u)&&bs(u)==Et},fA=cc?jo(cc):function(u){return br(u)&&Bs(u)==pt};function P_(u){return"string"==typeof u||!Tn(u)&&br(u)&&bs(u)==pe}function Qo(u){return"symbol"==typeof u||br(u)&&bs(u)==B}var Gh=Qr?jo(Qr):function(u){return br(u)&&R_(u.length)&&!!_n[bs(u)]},Ec=pp(Ab),F_=pp(function(u,h){return u<=h});function F0(u){if(!u)return[];if(lo(u))return P_(u)?Ha(u):qs(u);if(wh&&u[wh])return function(st){for(var Tt,_t=[];!(Tt=st.next()).done;)_t.push(Tt.value);return _t}(u[wh]());var h=Bs(u);return(h==Be?fb:h==pt?Am:Ld)(u)}function nl(u){return u?(u=co(u))===se||u===-se?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Kn(u){var h=nl(u),m=h%1;return h==h?m?h-m:h:0}function L_(u){return u?au(Kn(u),0,ye):0}function co(u){if("number"==typeof u)return u;if(Qo(u))return NaN;if(vr(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=vr(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=hb(u);var m=Qi.test(u);return m||Wn.test(u)?db(u.slice(2),m?2:8):En.test(u)?NaN:+u}function L0(u){return ba(u,Ks(u))}function Oi(u){return null==u?"":xo(u)}var pA=Il(function(u,h){if(vp(h)||lo(h))ba(h,Ss(h),u);else for(var m in h)ji.call(h,m)&&Wa(u,m,h[m])}),gA=Il(function(u,h){ba(h,Ks(h),u)}),Rd=Il(function(u,h,m,N){ba(h,Ks(h),u,N)}),mA=Il(function(u,h,m,N){ba(h,Ss(h),u,N)}),k0=Qa(zm),yA=si(function(u,h){u=Bi(u);var m=-1,N=h.length,ae=N>2?h[2]:J;for(ae&&js(h[0],h[1],ae)&&(N=1);++m1),Ce}),ba(u,n_(u),m),N&&(m=Ls(m,7,gp));for(var ae=h.length;ae--;)uu(m,h[ae]);return m}),SA=Qa(function(u,h){return null==u?{}:function(u,h){return Tb(u,h,function(m,N){return Rp(u,N)})}(u,h)});function G0(u,h){if(null==u)return{};var m=Li(n_(u),function(N){return[N]});return h=On(h),Tb(u,m,function(N,ae){return h(N,ae[0])})}var CA=mu(Ss),W0=mu(Ks);function Ld(u){return null==u?[]:xm(u,Ss(u))}var MA=Ol(function(u,h,m){return h=h.toLowerCase(),u+(m?V_(h):h)});function V_(u){return Fp(Oi(u).toLowerCase())}function U_(u){return(u=Oi(u))&&u.replace(ca,_P).replace(wm,"")}var OA=Ol(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),RA=Ol(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),nF=dp("toLowerCase"),kA=Ol(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),G_=Ol(function(u,h,m){return u+(m?" ":"")+Fp(h)}),Z0=Ol(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),Fp=dp("toUpperCase");function Y_(u,h,m){return u=Oi(u),(h=m?J:h)===J?function(st){return Cl.test(st)}(u)?function(st){return st.match(ab)||[]}(u):function(st){return st.match(Bn)||[]}(u):u.match(h)||[]}var K_=si(function(u,h){try{return Zr(u,J,h)}catch(m){return Ea(m)?m:new Cn(m)}}),J0=Qa(function(u,h){return Ps(h,function(m){m=Zn(m),qa(u,m,zh(u[m],u))}),u});function X_(u){return function(){return u}}var rF=gu(),kd=gu(!0);function Xs(u){return u}function vu(u){return Xx("function"==typeof u?u:Ls(u,1))}var Q_=si(function(u,h){return function(m){return va(m,u,h)}}),ew=si(function(u,h){return function(m){return va(u,m,h)}});function Z_(u,h,m){var N=Ss(h),ae=Rh(h,N);null==m&&(!vr(h)||!ae.length&&N.length)&&(m=h,h=u,u=this,ae=Rh(h,Ss(h)));var Ce=!(vr(m)&&"chain"in m&&!m.chain),ze=Xo(u);return Ps(ae,function(Ye){var at=h[Ye];u[Ye]=at,ze&&(u.prototype[Ye]=function(){var Rt=this.__chain__;if(Ce||Rt){var Nt=u(this.__wrapped__),Vt=Nt.__actions__=qs(this.__actions__);return Vt.push({func:at,args:arguments,thisArg:u}),Nt.__chain__=Rt,Nt}return at.apply(u,Fr([this.value()],arguments))})}),u}function J_(){}var GA=hp(Li),$A=hp(Qn),nw=hp(wo);function bu(u){return Wo(u)?Sm(Zn(u)):function(u){return function(h){return Uo(h,u)}}(u)}var WA=Fb(),qA=Fb(!0);function Cc(){return[]}function ty(){return!1}var zn=e_(function(u,h){return u+h},0),ny=xd("ceil"),oF=e_(function(u,h){return u/h},1),Ll=xd("floor"),ow=e_(function(u,h){return u*h},1),aw=xd("round"),lw=e_(function(u,h){return u-h},0);return Se.after=function(u,h){if("function"!=typeof h)throw new pa(Ae);return u=Kn(u),function(){if(--u<1)return h.apply(this,arguments)}},Se.ary=Tp,Se.assign=pA,Se.assignIn=gA,Se.assignInWith=Rd,Se.assignWith=mA,Se.at=k0,Se.before=T_,Se.bind=zh,Se.bindAll=J0,Se.bindKey=Od,Se.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Tn(u)?u:[u]},Se.chain=b_,Se.chunk=function(u,h,m){h=(m?js(u,h,m):h===J)?1:Lr(Kn(h),0);var N=null==u?0:u.length;if(!N||h<1)return[];for(var ae=0,Ce=0,ze=_t(Bt(N/h));aeae?0:ae+m),(N=N===J||N>ae?ae:Kn(N))<0&&(N+=ae),N=m>N?0:L_(N);m>>0)?(u=Oi(u))&&("string"==typeof h||null!=h&&!P0(h))&&!(h=xo(h))&&_h(u)?Ka(Ha(u),0,m):u.split(h,m):[]},Se.spread=function(u,h){if("function"!=typeof u)throw new pa(Ae);return h=null==h?0:Lr(Kn(h),0),si(function(m){var N=m[h],ae=Ka(m,0,h);return N&&Fr(ae,N),Zr(u,this,ae)})},Se.tail=function(u){var h=null==u?0:u.length;return h?ws(u,1,h):[]},Se.take=function(u,h,m){return u&&u.length?ws(u,0,(h=m||h===J?1:Kn(h))<0?0:h):[]},Se.takeRight=function(u,h,m){var N=null==u?0:u.length;return N?ws(u,(h=N-(h=m||h===J?1:Kn(h)))<0?0:h,N):[]},Se.takeRightWhile=function(u,h){return u&&u.length?du(u,On(h,3),!1,!0):[]},Se.takeWhile=function(u,h){return u&&u.length?du(u,On(h,3)):[]},Se.tap=function(u,h){return h(u),u},Se.throttle=function(u,h,m){var N=!0,ae=!0;if("function"!=typeof u)throw new pa(Ae);return vr(m)&&(N="leading"in m?!!m.leading:N,ae="trailing"in m?!!m.trailing:ae),E0(u,h,{leading:N,maxWait:h,trailing:ae})},Se.thru=Md,Se.toArray=F0,Se.toPairs=CA,Se.toPairsIn=W0,Se.toPath=function(u){return Tn(u)?Li(u,Zn):Qo(u)?[u]:qs(qb(Oi(u)))},Se.toPlainObject=L0,Se.transform=function(u,h,m){var N=Tn(u),ae=N||tl(u)||Gh(u);if(h=On(h,4),null==m){var Ce=u&&u.constructor;m=ae?N?new Ce:[]:vr(u)&&Xo(Ce)?ou(ga(u)):{}}return(ae?Ps:Ya)(u,function(ze,Ye,at){return h(m,ze,Ye,at)}),m},Se.unary=function(u){return Tp(u,1)},Se.union=r0,Se.unionBy=L1,Se.unionWith=k1,Se.uniq=function(u){return u&&u.length?mc(u):[]},Se.uniqBy=function(u,h){return u&&u.length?mc(u,On(h,2)):[]},Se.uniqWith=function(u,h){return h="function"==typeof h?h:J,u&&u.length?mc(u,J,h):[]},Se.unset=function(u,h){return null==u||uu(u,h)},Se.unzip=s0,Se.unzipWith=j1,Se.update=function(u,h,m){return null==u?u:lp(u,h,Zm(m))},Se.updateWith=function(u,h,m,N){return N="function"==typeof N?N:J,null==u?u:lp(u,h,Zm(m),N)},Se.values=Ld,Se.valuesIn=function(u){return null==u?[]:xm(u,Ks(u))},Se.without=o0,Se.words=Y_,Se.wrap=function(u,h){return Dp(Zm(h),u)},Se.xor=$P,Se.xorBy=To,Se.xorWith=y_,Se.zip=v_,Se.zipObject=function(u,h){return cp(u||[],h||[],Wa)},Se.zipObjectDeep=function(u,h){return cp(u||[],h||[],ap)},Se.zipWith=Uh,Se.entries=CA,Se.entriesIn=W0,Se.extend=gA,Se.extendWith=Rd,Z_(Se,Se),Se.add=zn,Se.attempt=K_,Se.camelCase=MA,Se.capitalize=V_,Se.ceil=ny,Se.clamp=function(u,h,m){return m===J&&(m=h,h=J),m!==J&&(m=(m=co(m))==m?m:0),h!==J&&(h=(h=co(h))==h?h:0),au(co(u),h,m)},Se.clone=function(u){return Ls(u,4)},Se.cloneDeep=function(u){return Ls(u,5)},Se.cloneDeepWith=function(u,h){return Ls(u,5,h="function"==typeof h?h:J)},Se.cloneWith=function(u,h){return Ls(u,4,h="function"==typeof h?h:J)},Se.conformsTo=function(u,h){return null==h||ip(u,h,Ss(h))},Se.deburr=U_,Se.defaultTo=function(u,h){return null==u||u!=u?h:u},Se.divide=oF,Se.endsWith=function(u,h,m){u=Oi(u),h=xo(h);var N=u.length,ae=m=m===J?N:au(Kn(m),0,N);return(m-=h.length)>=0&&u.slice(m,ae)==h},Se.eq=xn,Se.escape=function(u){return(u=Oi(u))&&Zt.test(u)?u.replace(la,yP):u},Se.escapeRegExp=function(u){return(u=Oi(u))&<.test(u)?u.replace(ke,"\\$&"):u},Se.every=function(u,h,m){var N=Tn(u)?Qn:Eb;return m&&js(u,h,m)&&(h=J),N(u,On(h,3))},Se.find=$1,Se.findIndex=h_,Se.findKey=function(u,h){return gh(u,On(h,3),Ya)},Se.findLast=W1,Se.findLastIndex=f_,Se.findLastKey=function(u,h){return gh(u,On(h,3),rp)},Se.floor=Ll,Se.forEach=x_,Se.forEachRight=Cp,Se.forIn=function(u,h){return null==u?u:gd(u,On(h,3),Ks)},Se.forInRight=function(u,h){return null==u?u:md(u,On(h,3),Ks)},Se.forOwn=function(u,h){return u&&Ya(u,On(h,3))},Se.forOwnRight=function(u,h){return u&&rp(u,On(h,3))},Se.get=qh,Se.gt=Yt,Se.gte=D0,Se.has=function(u,h){return null!=u&&zb(u,h,_d)},Se.hasIn=Rp,Se.head=Kb,Se.identity=Xs,Se.includes=function(u,h,m,N){u=lo(u)?u:Ld(u),m=m&&!N?Kn(m):0;var ae=u.length;return m<0&&(m=Lr(ae+m,0)),P_(u)?m<=ae&&u.indexOf(h,m)>-1:!!ae&&za(u,h,m)>-1},Se.indexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=null==m?0:Kn(m);return ae<0&&(ae=Lr(N+ae,0)),za(u,h,ae)},Se.inRange=function(u,h,m){return h=nl(h),m===J?(m=h,h=0):m=nl(m),function(u,h,m){return u>=ls(h,m)&&u=-Te&&u<=Te},Se.isSet=fA,Se.isString=P_,Se.isSymbol=Qo,Se.isTypedArray=Gh,Se.isUndefined=function(u){return u===J},Se.isWeakMap=function(u){return br(u)&&Bs(u)==k},Se.isWeakSet=function(u){return br(u)&&"[object WeakSet]"==bs(u)},Se.join=function(u,h){return null==u?"":Eh.call(u,h)},Se.kebabCase=OA,Se.last=qo,Se.lastIndexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=N;return m!==J&&(ae=(ae=Kn(m))<0?Lr(N+ae,0):ls(ae,N-1)),h==h?function(st,Tt,_t){for(var cn=_t+1;cn--;)if(st[cn]===Tt)return cn;return cn}(u,h,ae):od(u,uc,ae,!0)},Se.lowerCase=RA,Se.lowerFirst=nF,Se.lt=Ec,Se.lte=F_,Se.max=function(u){return u&&u.length?Oh(u,Xs,zo):J},Se.maxBy=function(u,h){return u&&u.length?Oh(u,On(h,2),zo):J},Se.mean=function(u){return _s(u,Xs)},Se.meanBy=function(u,h){return _s(u,On(h,2))},Se.min=function(u){return u&&u.length?Oh(u,Xs,Ab):J},Se.minBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Ab):J},Se.stubArray=Cc,Se.stubFalse=ty,Se.stubObject=function(){return{}},Se.stubString=function(){return""},Se.stubTrue=function(){return!0},Se.multiply=ow,Se.nth=function(u,h){return u&&u.length?cu(u,Kn(h)):J},Se.noConflict=function(){return Ii._===this&&(Ii._=Om),this},Se.noop=J_,Se.now=yu,Se.pad=function(u,h,m){u=Oi(u);var N=(h=Kn(h))?yh(u):0;if(!h||N>=h)return u;var ae=(h-N)/2;return fp(ui(ae),m)+u+fp(Bt(ae),m)},Se.padEnd=function(u,h,m){u=Oi(u);var N=(h=Kn(h))?yh(u):0;return h&&Nh){var N=u;u=h,h=N}if(m||u%1||h%1){var ae=Sh();return ls(u+ae*(h-u+wx("1e-"+((ae+"").length-1))),h)}return Ml(u,h)},Se.reduce=function(u,h,m){var N=Tn(u)?nu:Bo,ae=arguments.length<3;return N(u,On(h,4),m,ae,pc)},Se.reduceRight=function(u,h,m){var N=Tn(u)?sd:Bo,ae=arguments.length<3;return N(u,On(h,4),m,ae,Gm)},Se.repeat=function(u,h,m){return h=(m?js(u,h,m):h===J)?1:Kn(h),op(Oi(u),h)},Se.replace=function(){var u=arguments,h=Oi(u[0]);return u.length<3?h:h.replace(u[1],u[2])},Se.result=function(u,h,m){var N=-1,ae=(h=yc(h,u)).length;for(ae||(ae=1,u=J);++NTe)return[];var m=ye,N=ls(u,ye);h=On(h),u-=ye;for(var ae=ld(N,h);++m=Ce)return u;var Ye=m-yh(N);if(Ye<1)return N;var at=ze?Ka(ze,0,Ye).join(""):u.slice(0,Ye);if(ae===J)return at+N;if(ze&&(Ye+=at.length-Ye),P0(ae)){if(u.slice(Ye).search(ae)){var Rt,Nt=at;for(ae.global||(ae=Mm(ae.source,Oi(Un.exec(ae))+"g")),ae.lastIndex=0;Rt=ae.exec(Nt);)var Vt=Rt.index;at=at.slice(0,Vt===J?Ye:Vt)}}else if(u.indexOf(xo(ae),Ye)!=Ye){var en=at.lastIndexOf(ae);en>-1&&(at=at.slice(0,en))}return at+N},Se.unescape=function(u){return(u=Oi(u))&&ps.test(u)?u.replace(wl,Dm):u},Se.uniqueId=function(u){var h=++xP;return Oi(u)+h},Se.upperCase=Z0,Se.upperFirst=Fp,Se.each=x_,Se.eachRight=Cp,Se.first=Kb,Z_(Se,function(){var u={};return Ya(Se,function(h,m){ji.call(Se.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),Se.VERSION="4.17.21",Ps(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){Se[u].placeholder=Se}),Ps(["drop","take"],function(u,h){ri.prototype[u]=function(m){m=m===J?1:Lr(Kn(m),0);var N=this.__filtered__&&!h?new ri(this):this.clone();return N.__filtered__?N.__takeCount__=ls(m,N.__takeCount__):N.__views__.push({size:ls(m,ye),type:u+(N.__dir__<0?"Right":"")}),N},ri.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),Ps(["filter","map","takeWhile"],function(u,h){var m=h+1,N=1==m||3==m;ri.prototype[u]=function(ae){var Ce=this.clone();return Ce.__iteratees__.push({iteratee:On(ae,3),type:m}),Ce.__filtered__=Ce.__filtered__||N,Ce}}),Ps(["head","last"],function(u,h){var m="take"+(h?"Right":"");ri.prototype[u]=function(){return this[m](1).value()[0]}}),Ps(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");ri.prototype[u]=function(){return this.__filtered__?new ri(this):this[m](1)}}),ri.prototype.compact=function(){return this.filter(Xs)},ri.prototype.find=function(u){return this.filter(u).head()},ri.prototype.findLast=function(u){return this.reverse().find(u)},ri.prototype.invokeMap=si(function(u,h){return"function"==typeof u?new ri(this):this.map(function(m){return va(m,u,h)})}),ri.prototype.reject=function(u){return this.filter(I_(On(u)))},ri.prototype.slice=function(u,h){u=Kn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new ri(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==J&&(m=(h=Kn(h))<0?m.dropRight(-h):m.take(h-u)),m)},ri.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},ri.prototype.toArray=function(){return this.take(ye)},Ya(ri.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),N=/^(?:head|last)$/.test(h),ae=Se[N?"take"+("last"==h?"Right":""):h],Ce=N||/^find/.test(h);!ae||(Se.prototype[h]=function(){var ze=this.__wrapped__,Ye=N?[1]:arguments,at=ze instanceof ri,Rt=Ye[0],Nt=at||Tn(ze),Vt=function(ai){var vi=ae.apply(Se,Fr([ai],Ye));return N&&en?vi[0]:vi};Nt&&m&&"function"==typeof Rt&&1!=Rt.length&&(at=Nt=!1);var en=this.__chain__,vn=!!this.__actions__.length,Nn=Ce&&!en,oi=at&&!vn;if(!Ce&&Nt){ze=oi?ze:new ri(this);var Fn=u.apply(ze,Ye);return Fn.__actions__.push({func:Md,args:[Vt],thisArg:J}),new So(Fn,en)}return Nn&&oi?u.apply(this,Ye):(Fn=this.thru(Vt),Nn?N?Fn.value()[0]:Fn.value():Fn)})}),Ps(["pop","push","shift","sort","splice","unshift"],function(u){var h=ir[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",N=/^(?:pop|shift)$/.test(u);Se.prototype[u]=function(){var ae=arguments;if(N&&!this.__chain__){var Ce=this.value();return h.apply(Tn(Ce)?Ce:[],ae)}return this[m](function(ze){return h.apply(Tn(ze)?ze:[],ae)})}}),Ya(ri.prototype,function(u,h){var m=Se[h];if(m){var N=m.name+"";ji.call(dd,N)||(dd[N]=[]),dd[N].push({name:h,func:m})}}),dd[bc(J,2).name]=[{name:"wrapper",func:J}],ri.prototype.clone=function(){var u=new ri(this.__wrapped__);return u.__actions__=qs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=qs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=qs(this.__views__),u},ri.prototype.reverse=function(){if(this.__filtered__){var u=new ri(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},ri.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Tn(u),N=h<0,ae=m?u.length:0,Ce=function(u,h,m){for(var N=-1,ae=m.length;++N=this.__values__.length;return{done:u,value:u?J:this.__values__[this.__index__++]}},Se.prototype.plant=function(u){for(var h,m=this;m instanceof Th;){var N=wp(m);N.__index__=0,N.__values__=J,h?ae.__wrapped__=N:h=N;var ae=N;m=m.__wrapped__}return ae.__wrapped__=u,h},Se.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof ri){var h=u;return this.__actions__.length&&(h=new ri(this)),(h=h.reverse()).__actions__.push({func:Md,args:[__],thisArg:J}),new So(h,this.__chain__)}return this.thru(__)},Se.prototype.toJSON=Se.prototype.valueOf=Se.prototype.value=function(){return e1(this.__wrapped__,this.__actions__)},Se.prototype.first=Se.prototype.head,wh&&(Se.prototype[wh]=function(){return this}),Se}();Ii._=vh,(gt=function(){return vh}.call(it,tt,it,jt))!==J&&(jt.exports=gt)}.call(this)},478:function(jt){jt.exports=function(){"use strict";function it(rt,ot){for(var ct=0;ctrt.length)&&(ot=rt.length);for(var ct=0,fe=new Array(ot);ct=rt.length?{done:!0}:{done:!1,value:rt[fe++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var ut={exports:{}};function Y(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}ut.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:Y,changeDefaults:function(rt){ut.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,re={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(ot){return re[ot]};var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function R(rt){return rt.replace(S,function(ot,ct){return"colon"===(ct=ct.toLowerCase())?":":"#"===ct.charAt(0)?"x"===ct.charAt(1)?String.fromCharCode(parseInt(ct.substring(2),16)):String.fromCharCode(+ct.substring(1)):""})}var A=/(^|[^\[])\^/g;var y=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var j={},I=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;function M(rt,ot){j[" "+rt]||(j[" "+rt]=I.test(rt)?rt+"/":U(rt,"/",!0));var ct=-1===(rt=j[" "+rt]).indexOf(":");return"//"===ot.substring(0,2)?ct?ot:rt.replace(H,"$1")+ot:"/"===ot.charAt(0)?ct?ot:rt.replace(K,"$1")+ot:rt+ot}function U(rt,ot,ct){var fe=rt.length;if(0===fe)return"";for(var ve=0;ve1;)1&ot&&(ct+=rt),ot>>=1,rt+=rt;return ct+rt},Te=ut.exports.defaults,me=U,te=function(rt,ot){var fe=rt.replace(/\|/g,function(ke,lt,Qe){for(var vt=!1,St=lt;--St>=0&&"\\"===Qe[St];)vt=!vt;return vt?"|":" |"}).split(/ \|/),ve=0;if(fe.length>ot)fe.splice(ot);else for(;fe.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},ot.code=function(fe){var ve=this.rules.block.code.exec(fe);if(ve){var ke=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:me(ke,"\n")}}},ot.fences=function(fe){var ve=this.rules.block.fences.exec(fe);if(ve){var ke=ve[0],lt=function(rt,ot){var ct=rt.match(/^(\s+)(?:```)/);if(null===ct)return ot;var fe=ct[1];return ot.split("\n").map(function(ve){var ke=ve.match(/^\s+/);return null===ke?ve:ke[0].length>=fe.length?ve.slice(fe.length):ve}).join("\n")}(ke,ve[3]||"");return{type:"code",raw:ke,lang:ve[2]?ve[2].trim():ve[2],text:lt}}},ot.heading=function(fe){var ve=this.rules.block.heading.exec(fe);if(ve){var ke=ve[2].trim();if(/#$/.test(ke)){var lt=me(ke,"#");(this.options.pedantic||!lt||/ $/.test(lt))&&(ke=lt.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:ke}}},ot.nptable=function(fe){var ve=this.rules.block.nptable.exec(fe);if(ve){var ke={type:"table",header:te(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(ke.header.length===ke.align.length){var Qe,lt=ke.align.length;for(Qe=0;Qe ?/gm,"");return{type:"blockquote",raw:ve[0],text:ke}}},ot.list=function(fe){var ve=this.rules.block.list.exec(fe);if(ve){var qt,Bn,ti,Mn,pn,Un,En,Qi,Zi,ke=ve[0],lt=ve[2],Qe=lt.length>1,vt={type:"list",raw:ke,ordered:Qe,start:Qe?+lt.slice(0,-1):"",loose:!1,items:[]},St=ve[0].match(this.rules.block.item),At=!1,Wn=St.length;ti=this.rules.block.listItemStart.exec(St[0]);for(var Fi=0;Fiti[1].length:Mn[1].length>=ti[0].length||Mn[1].length>3){St.splice(Fi,2,St[Fi]+(!this.options.pedantic&&Mn[1].length/i.test(lt[0])&&(ve=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(lt[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(lt[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:lt[0],inLink:ve,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(lt[0]):ye(lt[0]):lt[0]}},ot.link=function(fe){var ve=this.rules.inline.link.exec(fe);if(ve){var ke=ve[2].trim();if(!this.options.pedantic&&/^$/.test(ke))return;var lt=me(ke.slice(0,-1),"\\");if((ke.length-lt.length)%2==0)return}else{var Qe=Me(ve[2],"()");if(Qe>-1){var St=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Qe;ve[2]=ve[2].substring(0,Qe),ve[0]=ve[0].substring(0,St).trim(),ve[3]=""}}var At=ve[2],qt="";if(this.options.pedantic){var Bn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(At);Bn&&(At=Bn[1],qt=Bn[3])}else qt=ve[3]?ve[3].slice(1,-1):"";return At=At.trim(),/^$/.test(ke)?At.slice(1):At.slice(1,-1)),Ve(ve,{href:At&&At.replace(this.rules.inline._escapes,"$1"),title:qt&&qt.replace(this.rules.inline._escapes,"$1")},ve[0])}},ot.reflink=function(fe,ve){var ke;if((ke=this.rules.inline.reflink.exec(fe))||(ke=this.rules.inline.nolink.exec(fe))){var lt=(ke[2]||ke[1]).replace(/\s+/g," ");if(!(lt=ve[lt.toLowerCase()])||!lt.href){var Qe=ke[0].charAt(0);return{type:"text",raw:Qe,text:Qe}}return Ve(ke,lt,ke[0])}},ot.emStrong=function(fe,ve,ke){void 0===ke&&(ke="");var lt=this.rules.inline.emStrong.lDelim.exec(fe);if(lt&&(!lt[3]||!ke.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Qe=lt[1]||lt[2]||"";if(!Qe||Qe&&(""===ke||this.rules.inline.punctuation.exec(ke))){var St,At,vt=lt[0].length-1,qt=vt,Bn=0,ti="*"===lt[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ti.lastIndex=0,ve=ve.slice(-1*fe.length+vt);null!=(lt=ti.exec(ve));)if(St=lt[1]||lt[2]||lt[3]||lt[4]||lt[5]||lt[6]){if(At=St.length,lt[3]||lt[4]){qt+=At;continue}if((lt[5]||lt[6])&&vt%3&&!((vt+At)%3)){Bn+=At;continue}if(!((qt-=At)>0))return At=Math.min(At,At+qt+Bn),Math.min(vt,At)%2?{type:"em",raw:fe.slice(0,vt+lt.index+At+1),text:fe.slice(1,vt+lt.index+At)}:{type:"strong",raw:fe.slice(0,vt+lt.index+At+1),text:fe.slice(2,vt+lt.index+At-1)}}}}},ot.codespan=function(fe){var ve=this.rules.inline.code.exec(fe);if(ve){var ke=ve[2].replace(/\n/g," "),lt=/[^ ]/.test(ke),Qe=/^ /.test(ke)&&/ $/.test(ke);return lt&&Qe&&(ke=ke.substring(1,ke.length-1)),ke=ye(ke,!0),{type:"codespan",raw:ve[0],text:ke}}},ot.br=function(fe){var ve=this.rules.inline.br.exec(fe);if(ve)return{type:"br",raw:ve[0]}},ot.del=function(fe){var ve=this.rules.inline.del.exec(fe);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},ot.autolink=function(fe,ve){var lt,Qe,ke=this.rules.inline.autolink.exec(fe);if(ke)return Qe="@"===ke[2]?"mailto:"+(lt=ye(this.options.mangle?ve(ke[1]):ke[1])):lt=ye(ke[1]),{type:"link",raw:ke[0],text:lt,href:Qe,tokens:[{type:"text",raw:lt,text:lt}]}},ot.url=function(fe,ve){var ke;if(ke=this.rules.inline.url.exec(fe)){var lt,Qe;if("@"===ke[2])Qe="mailto:"+(lt=ye(this.options.mangle?ve(ke[0]):ke[0]));else{var vt;do{vt=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0]}while(vt!==ke[0]);lt=ye(ke[0]),Qe="www."===ke[1]?"http://"+lt:lt}return{type:"link",raw:ke[0],text:lt,href:Qe,tokens:[{type:"text",raw:lt,text:lt}]}}},ot.inlineText=function(fe,ve,ke){var Qe,lt=this.rules.inline.text.exec(fe);if(lt)return Qe=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(lt[0]):ye(lt[0]):lt[0]:ye(this.options.smartypants?ke(lt[0]):lt[0]),{type:"text",raw:lt[0],text:Qe}},rt}(),Je=se_noopTest,Ke=se_edit,je=se_merge,Le={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Je,table:Je,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Le.def=Ke(Le.def).replace("label",Le._label).replace("title",Le._title).getRegex(),Le.bullet=/(?:[*+-]|\d{1,9}[.)])/,Le.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Le.item=Ke(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Ke(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Ke(Le.list).replace(/bull/g,Le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Le.def.source+")").getRegex(),Le._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Le._comment=/|$)/,Le.html=Ke(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Ke(Le._paragraph).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.blockquote=Ke(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=je({},Le),Le.gfm=je({},Le.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Le.gfm.nptable=Ke(Le.gfm.nptable).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.gfm.table=Ke(Le.gfm.table).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.pedantic=je({},Le.normal,{html:Ke("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Je,paragraph:Ke(Le.normal._paragraph).replace("hr",Le.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ee.punctuation=Ke(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ee.escapedEmSt=/\\\*|\\_/g,Ee._comment=Ke(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ee.emStrong.lDelim=Ke(Ee.emStrong.lDelim).replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimAst=Ke(Ee.emStrong.rDelimAst,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimUnd=Ke(Ee.emStrong.rDelimUnd,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ee.autolink=Ke(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Ke(Ee.tag).replace("comment",Ee._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Ke(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Ke(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Ke(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=je({},Ee),Ee.pedantic=je({},Ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ke(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee._label).getRegex(),reflink:Ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=je({},Ee.normal,{escape:Ke(Ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(fe="x"+fe.toString(16)),ot+="&#"+fe+";";return ot}var Pe=function(){function rt(ct){this.tokens=[],this.tokens.links=Object.create(null),this.options=ct||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var fe={block:Be.normal,inline:z.normal};this.options.pedantic?(fe.block=Be.pedantic,fe.inline=z.pedantic):this.options.gfm&&(fe.block=Be.gfm,fe.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=fe}rt.lex=function(fe,ve){return new rt(ve).lex(fe)},rt.lexInline=function(fe,ve){return new rt(ve).inlineTokens(fe)};var ot=rt.prototype;return ot.lex=function(fe){return fe=fe.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(fe,this.tokens,!0),this.inline(this.tokens),this.tokens},ot.blockTokens=function(fe,ve,ke){var Qe,vt,St,At,qt,Bn,lt=this;for(void 0===ve&&(ve=[]),void 0===ke&&(ke=!0),this.options.pedantic&&(fe=fe.replace(/^ +$/gm,""));fe;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Mn){return!!(Qe=Mn.call(lt,fe,ve))&&(fe=fe.substring(Qe.raw.length),ve.push(Qe),!0)}))){if(Qe=this.tokenizer.space(fe)){fe=fe.substring(Qe.raw.length),Qe.type&&ve.push(Qe);continue}if(Qe=this.tokenizer.code(fe)){fe=fe.substring(Qe.raw.length),(At=ve[ve.length-1])&&"paragraph"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe);continue}if(Qe=this.tokenizer.fences(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.heading(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.nptable(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.hr(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.blockquote(fe)){fe=fe.substring(Qe.raw.length),Qe.tokens=this.blockTokens(Qe.text,[],ke),ve.push(Qe);continue}if(Qe=this.tokenizer.list(fe)){for(fe=fe.substring(Qe.raw.length),St=Qe.items.length,vt=0;vt=0&&(Mn=Math.min(Mn,Un))}),Mn<1/0&&Mn>=0&&(qt=fe.substring(0,Mn+1))}(),ke&&(Qe=this.tokenizer.paragraph(qt))){At=ve[ve.length-1],Bn&&"paragraph"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe),Bn=qt.length!==fe.length,fe=fe.substring(Qe.raw.length);continue}if(Qe=this.tokenizer.text(fe)){fe=fe.substring(Qe.raw.length),(At=ve[ve.length-1])&&"text"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe);continue}if(fe){var ti="Infinite loop on byte: "+fe.charCodeAt(0);if(this.options.silent){console.error(ti);break}throw new Error(ti)}}return ve},ot.inline=function(fe){var ve,ke,lt,Qe,vt,St,At=fe.length;for(ve=0;ve0)for(;null!=(Bn=this.tokenizer.rules.inline.reflinkSearch.exec(qt));)pn.includes(Bn[0].slice(Bn[0].lastIndexOf("[")+1,-1))&&(qt=qt.slice(0,Bn.index)+"["+X("a",Bn[0].length-2)+"]"+qt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(Bn=this.tokenizer.rules.inline.blockSkip.exec(qt));)qt=qt.slice(0,Bn.index)+"["+X("a",Bn[0].length-2)+"]"+qt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(Bn=this.tokenizer.rules.inline.escapedEmSt.exec(qt));)qt=qt.slice(0,Bn.index)+"++"+qt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;fe;)if(ti||(Mn=""),ti=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(En){return!!(vt=En.call(Qe,fe,ve))&&(fe=fe.substring(vt.raw.length),ve.push(vt),!0)}))){if(vt=this.tokenizer.escape(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.tag(fe,ke,lt)){fe=fe.substring(vt.raw.length),ke=vt.inLink,lt=vt.inRawBlock,(St=ve[ve.length-1])&&"text"===vt.type&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.link(fe)){fe=fe.substring(vt.raw.length),"link"===vt.type&&(vt.tokens=this.inlineTokens(vt.text,[],!0,lt)),ve.push(vt);continue}if(vt=this.tokenizer.reflink(fe,this.tokens.links)){fe=fe.substring(vt.raw.length),St=ve[ve.length-1],"link"===vt.type?(vt.tokens=this.inlineTokens(vt.text,[],!0,lt),ve.push(vt)):St&&"text"===vt.type&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.emStrong(fe,qt,Mn)){fe=fe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,lt),ve.push(vt);continue}if(vt=this.tokenizer.codespan(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.br(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.del(fe)){fe=fe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,lt),ve.push(vt);continue}if(vt=this.tokenizer.autolink(fe,ce)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(!ke&&(vt=this.tokenizer.url(fe,ce))){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(At=fe,this.options.extensions&&this.options.extensions.startInline&&function(){var En=1/0,Qi=fe.slice(1),Zi=void 0;Qe.options.extensions.startInline.forEach(function(Wn){"number"==typeof(Zi=Wn.call(this,Qi))&&Zi>=0&&(En=Math.min(En,Zi))}),En<1/0&&En>=0&&(At=fe.substring(0,En+1))}(),vt=this.tokenizer.inlineText(At,lt,be)){fe=fe.substring(vt.raw.length),"_"!==vt.raw.slice(-1)&&(Mn=vt.raw.slice(-1)),ti=!0,(St=ve[ve.length-1])&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(fe){var Un="Infinite loop on byte: "+fe.charCodeAt(0);if(this.options.silent){console.error(Un);break}throw new Error(Un)}}return ve},function(rt,ot,ct){ot&&it(rt.prototype,ot),ct&&it(rt,ct)}(rt,null,[{key:"rules",get:function(){return{block:Be,inline:z}}}]),rt}(),Et=ut.exports.defaults,pt=se_cleanUrl,pe=se_escape,B=function(){function rt(ct){this.options=ct||Et}var ot=rt.prototype;return ot.code=function(fe,ve,ke){var lt=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Qe=this.options.highlight(fe,lt);null!=Qe&&Qe!==fe&&(ke=!0,fe=Qe)}return fe=fe.replace(/\n$/,"")+"\n",lt?'
    '+(ke?fe:pe(fe,!0))+"
    \n":"
    "+(ke?fe:pe(fe,!0))+"
    \n"},ot.blockquote=function(fe){return"
    \n"+fe+"
    \n"},ot.html=function(fe){return fe},ot.heading=function(fe,ve,ke,lt){return this.options.headerIds?"'+fe+"\n":""+fe+"\n"},ot.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},ot.list=function(fe,ve,ke){var lt=ve?"ol":"ul";return"<"+lt+(ve&&1!==ke?' start="'+ke+'"':"")+">\n"+fe+"\n"},ot.listitem=function(fe){return"
  • "+fe+"
  • \n"},ot.checkbox=function(fe){return" "},ot.paragraph=function(fe){return"

    "+fe+"

    \n"},ot.table=function(fe,ve){return ve&&(ve=""+ve+""),"\n\n"+fe+"\n"+ve+"
    \n"},ot.tablerow=function(fe){return"\n"+fe+"\n"},ot.tablecell=function(fe,ve){var ke=ve.header?"th":"td";return(ve.align?"<"+ke+' align="'+ve.align+'">':"<"+ke+">")+fe+"\n"},ot.strong=function(fe){return""+fe+""},ot.em=function(fe){return""+fe+""},ot.codespan=function(fe){return""+fe+""},ot.br=function(){return this.options.xhtml?"
    ":"
    "},ot.del=function(fe){return""+fe+""},ot.link=function(fe,ve,ke){if(null===(fe=pt(this.options.sanitize,this.options.baseUrl,fe)))return ke;var lt='"+ke+""},ot.image=function(fe,ve,ke){if(null===(fe=pt(this.options.sanitize,this.options.baseUrl,fe)))return ke;var lt=''+ke+'":">")},ot.text=function(fe){return fe},rt}(),O=function(){function rt(){}var ot=rt.prototype;return ot.strong=function(fe){return fe},ot.em=function(fe){return fe},ot.codespan=function(fe){return fe},ot.del=function(fe){return fe},ot.html=function(fe){return fe},ot.text=function(fe){return fe},ot.link=function(fe,ve,ke){return""+ke},ot.image=function(fe,ve,ke){return""+ke},ot.br=function(){return""},rt}(),k=function(){function rt(){this.seen={}}var ot=rt.prototype;return ot.serialize=function(fe){return fe.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ot.getNextSafeSlug=function(fe,ve){var ke=fe,lt=0;if(this.seen.hasOwnProperty(ke)){lt=this.seen[fe];do{ke=fe+"-"+ ++lt}while(this.seen.hasOwnProperty(ke))}return ve||(this.seen[fe]=lt,this.seen[ke]=0),ke},ot.slug=function(fe,ve){void 0===ve&&(ve={});var ke=this.serialize(fe);return this.getNextSafeSlug(ke,ve.dryrun)},rt}(),Re=B,Xe=O,yt=k,It=ut.exports.defaults,An=se_unescape,Hn=Pe,yi=function(){function rt(ct){this.options=ct||It,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new yt}rt.parse=function(fe,ve){return new rt(ve).parse(fe)},rt.parseInline=function(fe,ve){return new rt(ve).parseInline(fe)};var ot=rt.prototype;return ot.parse=function(fe,ve){void 0===ve&&(ve=!0);var lt,Qe,vt,St,At,qt,Bn,ti,Mn,pn,Un,En,Qi,Zi,Wn,Fi,ca,Hr,ne,ke="",de=fe.length;for(lt=0;lt0&&"text"===Wn.tokens[0].type?(Wn.tokens[0].text=Hr+" "+Wn.tokens[0].text,Wn.tokens[0].tokens&&Wn.tokens[0].tokens.length>0&&"text"===Wn.tokens[0].tokens[0].type&&(Wn.tokens[0].tokens[0].text=Hr+" "+Wn.tokens[0].tokens[0].text)):Wn.tokens.unshift({type:"text",text:Hr}):Zi+=Hr),Zi+=this.parse(Wn.tokens,Qi),Mn+=this.renderer.listitem(Zi,ca,Fi);ke+=this.renderer.list(Mn,Un,En);continue;case"html":ke+=this.renderer.html(pn.text);continue;case"paragraph":ke+=this.renderer.paragraph(this.parseInline(pn.tokens));continue;case"text":for(Mn=pn.tokens?this.parseInline(pn.tokens):pn.text;lt+1An error occurred:

    "+Va(vt.message+"",!0)+"
    ";throw vt}}return Zt.options=Zt.setOptions=function(rt){return Os(Zt.defaults,rt),la(Zt.defaults),Zt},Zt.getDefaults=wl,Zt.defaults=ps,Zt.use=function(){for(var rt=this,ot=arguments.length,ct=new Array(ot),fe=0;feAn error occurred:

    "+Va(fe.message+"",!0)+"
    ";throw fe}},Zt.Parser=yi,Zt.parser=yi.parse,Zt.Renderer=Ur,Zt.TextRenderer=Is,Zt.Lexer=Hn,Zt.lexer=Hn.lex,Zt.Tokenizer=ci,Zt.Slugger=as,Zt.parse=Zt,Zt}()},369:(jt,it,tt)=>{var gt=tt(284),J=tt(830);function xt(){this.clear()}xt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},xt.prototype.enqueue=function(ut){return this.items.push(ut),++this.size},xt.prototype.dequeue=function(){if(this.size){var ut=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,ut}},xt.prototype.peek=function(){if(this.size)return this.items[this.offset]},xt.prototype.forEach=function(ut,Y){Y=arguments.length>1?Y:this;for(var Ae=this.offset,he=0,W=this.items.length;Ae=ut.length)return{done:!0};var Ae=ut[Y];return Y++,{value:Ae,done:!1}})},xt.prototype.entries=function(){var ut=this.items,Y=this.offset,Ae=0;return new gt(function(){if(Y>=ut.length)return{done:!0};var he=ut[Y];return Y++,{value:[Ae++,he],done:!1}})},"undefined"!=typeof Symbol&&(xt.prototype[Symbol.iterator]=xt.prototype.values),xt.prototype.toString=function(){return this.toArray().join(",")},xt.prototype.toJSON=function(){return this.toArray()},xt.prototype.inspect=function(){var ut=this.toArray();return Object.defineProperty(ut,"constructor",{value:xt,enumerable:!1}),ut},"undefined"!=typeof Symbol&&(xt.prototype[Symbol.for("nodejs.util.inspect.custom")]=xt.prototype.inspect),xt.from=function(ut){var Y=new xt;return J(ut,function(Ae){Y.enqueue(Ae)}),Y},xt.of=function(){return xt.from(arguments)},jt.exports=xt},830:jt=>{var it="undefined"!=typeof ArrayBuffer,tt="undefined"!=typeof Symbol;function gt(J,xt){var ut,Y,Ae,he,W;if(!J)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof xt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(J)||it&&ArrayBuffer.isView(J)||"string"==typeof J||"[object Arguments]"===J.toString())for(Ae=0,he=J.length;Ae{function it(tt){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:tt}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var tt=this._next();return tt.done&&(this.done=!0),tt},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var tt=arguments,gt=tt.length,J=0;return new it(function(){return J>=gt?{done:!0}:{done:!1,value:tt[J++]}})},it.empty=function(){var tt=new it(null);return tt.done=!0,tt},it.is=function(tt){return tt instanceof it||"object"==typeof tt&&null!==tt&&"function"==typeof tt.next},jt.exports=it},310:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==J.window.orientation},it.default=function(he){if(!he&&!(0,xt.default)())return"Node";if((0,ut.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},V=he||W.userAgent||"";if(V.indexOf("Edge")>-1)return"Edge";var L=-1!==V.indexOf("MSIE "),re=-1!==V.indexOf("Trident/");return L||re?"IE":J.window.chrome?"Chrome":J.window.safari?"Safari":J.window.mozInnerScreenX?"Firefox":"Unknown"};var J=tt(151),xt=gt(tt(602)),ut=gt(tt(344))},151:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var J=gt(tt(321)),xt={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&process};it.self=xt.self||xt.window||xt.global,it.window=xt.window||xt.self||xt.global,it.global=xt.global||xt.self||xt.window,it.document=xt.document||{},it.process=xt.process||{};var V=console;it.console=V},761:(jt,it,tt)=>{"use strict";var J=tt(948),xt=tt(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return ut.global}}),Object.defineProperty(it,"jU",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Ae.default}});var ut=tt(151),Y=V(tt(602)),Ae=V(tt(310));J(tt(344));function W(L){if("function"!=typeof WeakMap)return null;var re=new WeakMap,$=new WeakMap;return(W=function(S){return S?$:re})(L)}function V(L,re){if(!re&&L&&L.__esModule)return L;if(null===L||"object"!==xt(L)&&"function"!=typeof L)return{default:L};var $=W(re);if($&&$.has(L))return $.get(L);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in L)if("default"!==R&&Object.prototype.hasOwnProperty.call(L,R)){var A=S?Object.getOwnPropertyDescriptor(L,R):null;A&&(A.get||A.set)?Object.defineProperty(b,R,A):b[R]=L[R]}return b.default=L,$&&$.set(L,b),b}},602:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=ut,it.isBrowserMainThread=function(){return ut()&&"undefined"!=typeof document};var J=gt(tt(321)),xt=gt(tt(344));function ut(){return!("object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,xt.default)()}},344:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(ut){if("undefined"!=typeof window&&"object"===(0,J.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,J.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,J.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Ae=ut||Y;return!!(Ae&&Ae.indexOf("Electron")>=0)};var J=gt(tt(321))},991:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),Object.defineProperty(xt,Ae,{enumerable:!0,get:function(){return ut[Y]}})}:function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),xt[Ae]=ut[Y]}),J=this&&this.__exportStar||function(xt,ut){for(var Y in xt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(ut,Y)&>(ut,xt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(180),it),J(tt(103),it),J(tt(965),it),J(tt(595),it),J(tt(417),it),J(tt(451),it),J(tt(735),it)},180:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(J){this.termType="BlankNode",this.value=J}equals(J){return!!J&&"BlankNode"===J.termType&&J.value===this.value}}},103:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const gt=tt(180),J=tt(965),xt=tt(595),ut=tt(417),Y=tt(451),Ae=tt(735);let he=0;it.DataFactory=class{constructor(L){this.blankNodeCounter=0,this.blankNodePrefix=(L=L||{}).blankNodePrefix||`df_${he++}_`}namedNode(L){return new ut.NamedNode(L)}blankNode(L){return new gt.BlankNode(L||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(L,re){return new xt.Literal(L,re)}variable(L){return new Ae.Variable(L)}defaultGraph(){return J.DefaultGraph.INSTANCE}quad(L,re,$,b){return new Y.Quad(L,re,$,b||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(xt.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}}},965:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class tt{constructor(){this.termType="DefaultGraph",this.value=""}equals(J){return!!J&&"DefaultGraph"===J.termType}}it.DefaultGraph=tt,tt.INSTANCE=new tt},595:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const gt=tt(417);class J{constructor(ut,Y){this.termType="Literal",this.value=ut,"string"==typeof Y?(this.language=Y,this.datatype=J.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=J.XSD_STRING)}equals(ut){return!!ut&&"Literal"===ut.termType&&ut.value===this.value&&ut.language===this.language&&ut.datatype.equals(this.datatype)}}it.Literal=J,J.RDF_LANGUAGE_STRING=new gt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),J.XSD_STRING=new gt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(J){this.termType="NamedNode",this.value=J}equals(J){return!!J&&"NamedNode"===J.termType&&J.value===this.value}}},451:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(J,xt,ut,Y){this.termType="Quad",this.value="",this.subject=J,this.predicate=xt,this.object=ut,this.graph=Y}equals(J){return!!J&&("Quad"===J.termType||!J.termType)&&this.subject.equals(J.subject)&&this.predicate.equals(J.predicate)&&this.object.equals(J.object)&&this.graph.equals(J.graph)}}},735:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(J){this.termType="Variable",this.value=J}equals(J){return!!J&&"Variable"===J.termType&&J.value===this.value}}},609:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(b,S,R,A){void 0===A&&(A=R),Object.defineProperty(b,A,{enumerable:!0,get:function(){return S[R]}})}:function(b,S,R,A){void 0===A&&(A=R),b[A]=S[R]}),J=this&&this.__exportStar||function(b,S){for(var R in b)"default"!==R&&!Object.prototype.hasOwnProperty.call(S,R)&>(S,b,R)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const xt=tt(991),ut=tt(938),Y=tt(60);J(tt(938),it),J(tt(871),it),J(tt(60),it);const Ae=new xt.DataFactory,he=new Y.Translator;function W(b,S){return he.fromRdf(b,S)}he.registerHandler(new ut.TypeHandlerString,ut.TypeHandlerString.TYPES.map(b=>Ae.namedNode(b)),["string"]),he.registerHandler(new ut.TypeHandlerBoolean,[ut.TypeHandlerBoolean.TYPE].map(b=>Ae.namedNode(b)),["boolean"]),he.registerHandler(new ut.TypeHandlerNumberDouble,ut.TypeHandlerNumberDouble.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new ut.TypeHandlerNumberInteger,ut.TypeHandlerNumberInteger.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new ut.TypeHandlerDate,ut.TypeHandlerDate.TYPES.map(b=>Ae.namedNode(b)),["object"]),it.fromRdf=W,it.toRdf=function(b,S){return S&&"namedNode"in S&&(S={dataFactory:S}),(S=S||{})&&!S.dataFactory&&(S.dataFactory=Ae),he.toRdf(b,S)},it.getTermRaw=function(b,S){return"Literal"===b.termType?W(b,S):b.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Translator=void 0,it.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(J){throw new Error(`Invalid RDF ${J.datatype.value} value: '${J.value}'`)}registerHandler(J,xt,ut){for(const Y of xt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=J;for(const Y of ut){let Ae=this.toRdfHandlers[Y];Ae||(this.toRdfHandlers[Y]=Ae=[]),Ae.push(J)}}fromRdf(J,xt){const ut=this.fromRdfHandlers[J.datatype.value];return ut?ut.fromRdf(J,xt):J.value}toRdf(J,xt){const ut=this.toRdfHandlers[typeof J];if(ut)for(const Y of ut){const Ae=Y.toRdf(J,xt);if(Ae)return Ae}throw new Error(`Invalid JavaScript value: '${J}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const gt=tt(60);class J{fromRdf(ut,Y){switch(ut.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&>.Translator.incorrectRdfDataType(ut),!1}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Ae.literal(ut?"true":"false",Y||Ae.namedNode(J.TYPE))}}it.TypeHandlerBoolean=J,J.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const gt=tt(60);class J{fromRdf(ut,Y){switch(Y&&!ut.value.match(J.VALIDATORS[ut.datatype.value.substr(33,ut.datatype.value.length)])&>.Translator.incorrectRdfDataType(ut),ut.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(ut.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const Ae=ut.value.split("-");return new Date(0,parseInt(Ae[0],10)-1,parseInt(Ae[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(ut.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(ut.value+"-01");default:return new Date(ut.value)}}toRdf(ut,{datatype:Y,dataFactory:Ae}){if(Y=Y||Ae.namedNode(J.TYPES[0]),!(ut instanceof Date))return null;const he=ut;let W;switch(Y.value){case"http://www.w3.org/2001/XMLSchema#gDay":W=String(he.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":W=he.getUTCMonth()+1+"-"+he.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":W=String(he.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":W=he.getUTCFullYear()+"-"+(he.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":W=he.toISOString().replace(/T.*$/,"");break;default:W=he.toISOString()}return Ae.literal(W,Y)}}it.TypeHandlerDate=J,J.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"],J.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]$/}},554:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const gt=tt(60);class J{fromRdf(ut,Y){const Ae=parseFloat(ut.value);return Y&&isNaN(Ae)&>.Translator.incorrectRdfDataType(ut),Ae}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Y=Y||Ae.namedNode(J.TYPES[0]),isNaN(ut)?Ae.literal("NaN",Y):isFinite(ut)?ut%1==0?null:Ae.literal(ut.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Ae.literal(ut>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=J,J.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const gt=tt(60);class J{fromRdf(ut,Y){const Ae=parseInt(ut.value,10);return Y&&(isNaN(Ae)||ut.value.indexOf(".")>=0)&>.Translator.incorrectRdfDataType(ut),Ae}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Ae.literal(String(ut),Y||Ae.namedNode(ut<=J.MAX_INT&&ut>=J.MIN_INT?J.TYPES[0]:J.TYPES[1]))}}it.TypeHandlerNumberInteger=J,J.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"],J.MAX_INT=2147483647,J.MIN_INT=-2147483648},608:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class tt{fromRdf(J){return J.value}toRdf(J,{datatype:xt,dataFactory:ut}){return ut.literal(J,xt)}}it.TypeHandlerString=tt,tt.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/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},938:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),Object.defineProperty(xt,Ae,{enumerable:!0,get:function(){return ut[Y]}})}:function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),xt[Ae]=ut[Y]}),J=this&&this.__exportStar||function(xt,ut){for(var Y in xt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(ut,Y)&>(ut,xt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(727),it),J(tt(525),it),J(tt(554),it),J(tt(750),it),J(tt(608),it)},289:(jt,it,tt)=>{"use strict";var gt={};tt.r(gt),tt.d(gt,{decode:()=>Hge,encode:()=>Gge});var J={};tt.r(J),tt.d(J,{decode:()=>Kge,encode:()=>Xge});var xt={};tt.r(xt),tt.d(xt,{decode:()=>Qge,encode:()=>Zge});var ut={};function Y(n){return"function"==typeof n}tt.r(ut),tt.d(ut,{decode:()=>Jge,encode:()=>eme});let Ae=!1;const he={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else Ae&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ae=n},get useDeprecatedSynchronousErrorHandling(){return Ae}};function W(n){setTimeout(()=>{throw n},0)}const V={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},L=Array.isArray||(n=>n&&"number"==typeof n.length);function re(n){return null!==n&&"object"==typeof n}const b=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class S{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof S)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof b?t.errors:t),[])}S.EMPTY=((n=new S).closed=!0,n);const A="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends S{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=V;break;case 1:if(!e){this.destination=V;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,e,t,i)}}[A](){return this}static create(e,t,i){const r=new y(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class w extends y{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;Y(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==V&&(o=Object.create(t),Y(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;he.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=he;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):W(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;W(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);he.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),he.useDeprecatedSynchronousErrorHandling)throw i;W(i)}}__tryOrSetError(e,t,i){if(!he.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return he.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(W(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const I="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(n){return n}let F=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof y)return n;if(n[A])return n[A]()}return n||e||t?new y(n,e,t):new y(V)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||he.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),he.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){he.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof y?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=Q(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[I](){return this}pipe(...t){return 0===t.length?this:function(n){return 0===n.length?H:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}(t)(this)}toPromise(t){return new(t=Q(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function Q(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const U=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ie extends S{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class ue extends y{constructor(e){super(e),this.destination=e}}let ee=(()=>{class n extends F{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[A](){return new ue(this)}lift(t){const i=new se(this,this);return i.operator=t,i}next(t){if(this.closed)throw new U;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew se(e,t),n})();class se extends ee{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):S.EMPTY}}function Te(n){return n&&"function"==typeof n.schedule}function me(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new te(n,e))}}class te{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new ye(e,this.project,this.thisArg))}}class ye extends y{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const Me=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ee(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Oe=n=>{if(n&&"function"==typeof n[I])return(n=>e=>{const t=n[I]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(Le(n))return Me(n);if(Ee(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,W),e))(n);if(n&&"function"==typeof n[Ze])return(n=>e=>{const t=n[Ze]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${re(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Be(n,e){return new F(t=>{const i=new S;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function Pe(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[I]}(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>{const r=n[I]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(Ee(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(Le(n))return Be(n,e);if(function(n){return n&&"function"==typeof n[Ze]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new F(t=>{const i=new S;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Ze](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof F?n:new F(Oe(n))}class Et extends y{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class pe extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function O(n,e){if(e.closed)return;if(n instanceof F)return n.subscribe(e);let t;try{t=Oe(n)(e)}catch(i){e.error(i)}return t}function k(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(k((r,s)=>Pe(n(r,s)).pipe(me((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Re(n,t)))}class Re{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Xe(e,this.project,this.concurrent))}}class Xe extends pe{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function It(n=Number.POSITIVE_INFINITY){return k(H,n)}function An(n,e){return e?Be(n,e):new F(Me(n))}function Rn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Te(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof F?n[0]:It(e)(An(n,t))}function Hn(){return function(e){return e.lift(new yi(e))}}class yi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new ci(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class ci extends y{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Ur extends F{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new S,e.add(this.source.subscribe(new as(this.getSubject(),this))),e.closed&&(this._connection=null,e=S.EMPTY)),e}refCount(){return Hn()(this)}}const Is=(()=>{const n=Ur.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class as extends ue{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class wl{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function la(){return new ee}function ps(){return n=>Hn()(function(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new wl(r,e));const s=Object.create(i,Is);return s.source=i,s.subjectFactory=r,s}}(la)(n))}function Zt(n){for(let e in n)if(n[e]===Zt)return e;throw Error("Could not find renamed property on target object.")}function Ua(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function rt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(rt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ot(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ct=Zt({__forward_ref__:Zt});function fe(n){return n.__forward_ref__=fe,n.toString=function(){return rt(this())},n}function ve(n){return ke(n)?n():n}function ke(n){return"function"==typeof n&&n.hasOwnProperty(ct)&&n.__forward_ref__===fe}class Qe extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function At(n){return"string"==typeof n?n:null==n?"":String(n)}function qt(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():At(n)}function pn(n,e){const t=e?` in ${e}`:"";throw new Qe("201",`No provider for ${qt(n)} found${t}`)}function Z(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function $e(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function bt(n){return{providers:n.providers||[],imports:n.imports||[]}}function gn(n){return gs(n,io)||gs(n,Rs)}function gs(n,e){return n.hasOwnProperty(e)?n[e]:null}function El(n){return n&&(n.hasOwnProperty(Rr)||n.hasOwnProperty(lc))?n[Rr]:null}const io=Zt({\u0275prov:Zt}),Rr=Zt({\u0275inj:Zt}),Rs=Zt({ngInjectableDef:Zt}),lc=Zt({ngInjectorDef:Zt});var bn=(()=>((bn=bn||{})[bn.Default=0]="Default",bn[bn.Host=1]="Host",bn[bn.Self=2]="Self",bn[bn.SkipSelf=4]="SkipSelf",bn[bn.Optional=8]="Optional",bn))();let ro;function ua(n){const e=ro;return ro=n,e}function nd(n,e,t){const i=gn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&bn.Optional?null:void 0!==e?e:void pn(rt(n),"Injector")}function xe(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),$t=(()=>(($t=$t||{})[$t.Emulated=0]="Emulated",$t[$t.None=2]="None",$t[$t.ShadowDom=3]="ShadowDom",$t))();const ni="undefined"!=typeof globalThis&&globalThis,Nr="undefined"!=typeof window&&window,$r="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,ms="undefined"!=typeof global&&global,Jn=ni||ms||Nr||$r,id={},Wi=[],Gf=Zt({\u0275cmp:Zt}),wm=Zt({\u0275dir:Zt}),hh=Zt({\u0275pipe:Zt}),ab=Zt({\u0275mod:Zt}),vx=Zt({\u0275loc:Zt}),Cl=Zt({\u0275fac:Zt}),fh=Zt({__NG_ELEMENT_ID__:Zt});let bx=0;function _n(n){return xe(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===He.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||Wi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||$t.Emulated,id:"c",styles:n.styles||Wi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=bx++,i.inputs=db(n.inputs,t),i.outputs=db(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(lb):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(cb):null,i})}function lb(n){return Ii(n)||function(n){return n[wm]||null}(n)}function cb(n){return function(n){return n[hh]||null}(n)}const ub={};function ln(n){return xe(()=>{const e={type:n.type,bootstrap:n.bootstrap||Wi,declarations:n.declarations||Wi,imports:n.imports||Wi,exports:n.exports||Wi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(ub[n.id]=n.type),e})}function db(n,e){if(null==n)return id;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const kt=_n;function Ns(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Ii(n){return n[Gf]||null}function bo(n,e){const t=n[ab]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function ko(n){return Array.isArray(n)&&"object"==typeof n[1]}function Bo(n){return Array.isArray(n)&&!0===n[1]}function Cm(n){return 0!=(8&n.flags)}function ad(n){return 2==(2&n.flags)}function ld(n){return 1==(1&n.flags)}function fa(n){return null!==n.template}function hb(n){return 0!=(512&n[2])}function dc(n,e){return n.hasOwnProperty(Cl)?n[Cl]:null}class Dm{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function ki(){return gb}function gb(n){return n.type.prototype.ngOnChanges&&(n.setInput=Dx),Tx}function Tx(){const n=st(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===id)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function Dx(n,e,t,i){const r=st(n)||function(n,e){return n[vh]=e}(n,{previous:id,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new Dm(l&&l.currentValue,e,o===id),n[i]=e}ki.ngInherit=!0;const vh="__ngSimpleChanges__";function st(n){return n[vh]||null}let Bi;function ir(n){return!!n.listen}const ru={createRenderer:(n,e)=>void 0!==Bi?Bi:"undefined"!=typeof document?document:void 0};function _r(n){for(;Array.isArray(n);)n=n[0];return n}function bh(n,e){return _r(e[n])}function $s(n,e){return _r(e[n.index])}function Om(n,e){return n.data[e]}function cd(n,e){return n[e]}function Fs(n,e){const t=e[n];return ko(t)?t:t[0]}function Tl(n){return 4==(4&n[2])}function ud(n){return 128==(128&n[2])}function ga(n,e){return null==e?null:n[e]}function Rm(n){n[18]=0}function qf(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Pn={lFrame:ou(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function _b(){return Pn.bindingsEnabled}function Bt(){return Pn.lFrame.lView}function ui(){return Pn.lFrame.tView}function Vo(n){return Pn.lFrame.contextLView=n,n[8]}function Jr(){let n=Nm();for(;null!==n&&64===n.type;)n=n.parent;return n}function Nm(){return Pn.lFrame.currentTNode}function Ga(n,e){const t=Pn.lFrame;t.currentTNode=n,t.isParent=e}function Lr(){return Pn.lFrame.isParent}function ls(){Pn.lFrame.isParent=!1}function Sh(){return Pn.isInCheckNoChangesMode}function Kf(n){Pn.isInCheckNoChangesMode=n}function ys(){const n=Pn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function ma(){return Pn.lFrame.bindingIndex++}function Eo(n){const e=Pn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function dd(n,e){const t=Pn.lFrame;t.bindingIndex=t.bindingRootIndex=n,Pm(e)}function Pm(n){Pn.lFrame.currentDirectiveIndex=n}function yb(){return Pn.lFrame.currentQueryIndex}function Lm(n){Pn.lFrame.currentQueryIndex=n}function Qf(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function hd(n,e,t){if(t&bn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&bn.Host||(r=Qf(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Pn.lFrame=Se();return i.currentTNode=e,i.lView=n,!0}function Ah(n){const e=Se(),t=n[1];Pn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Se(){const n=Pn.lFrame,e=null===n?null:n.child;return null===e?ou(n):e}function ou(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Th(){const n=Pn.lFrame;return Pn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const So=Th;function ri(){const n=Th();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Ws(){return Pn.lFrame.selectedIndex}function ao(n){Pn.lFrame.selectedIndex=n}function Dr(){const n=Pn.lFrame;return Om(n.tView,n.selectedIndex)}function Zf(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class Dh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function tp(n,e,t){const i=ir(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let pd=!0;function np(n){const e=pd;return pd=n,e}let zm=0;function Ls(n,e){const t=ip(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,Hm(i.data,n),Hm(e,null),Hm(i.blueprint,null));const r=Ih(n,e),s=n.injectorIndex;if(bb(r)){const o=fd(r),a=Wa(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function Hm(n,e){n.push(0,0,0,0,0,0,0,0,e)}function ip(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Ih(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function fc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(fh)&&(i=t[fh]),null==i&&(i=t[fh]=zm++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Cb:e}(t);if("function"==typeof s){if(!hd(e,n,i))return i&bn.Host?Gm(r,t,i):Eb(e,t,i,r);try{const o=s(i);if(null!=o||i&bn.Optional)return o;pn(t)}finally{So()}}else if("number"==typeof s){let o=null,a=ip(n,e),l=-1,c=i&bn.Host?e[16][6]:null;for((-1===a||i&bn.SkipSelf)&&(l=-1===a?Ih(n,e):e[a+8],-1!==l&&Rh(i,!1)?(o=e[1],a=fd(l),e=Wa(l,e)):a=-1);-1!==a;){const d=e[1];if(rp(s,a,d.data)){const f=vs(a,e,t,o,i,c);if(f!==Sb)return f}l=e[a+8],-1!==l&&Rh(i,e[1].data[a+8]===c)&&rp(s,a,e)?(o=d,a=fd(l),e=Wa(l,e)):a=-1}}}return Eb(e,t,i,r)}const Sb={};function Cb(){return new Uo(Jr(),Bt())}function vs(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=gd(a,o,t,null==i?ad(a)&&pd:i!=o&&0!=(3&a.type),r&bn.Host&&s===a);return null!==d?md(e,o,d,a):Sb}function gd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&fa(g)&&g.type===t)return l}return null}function md(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Dh}(r)){const o=r;o.resolving&&function(n,e){throw new Qe("200",`Circular dependency in DI detected for ${n}`)}(qt(s[t]));const a=np(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ua(o.injectImpl):null;hd(n,i,bn.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=gb(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ua(l),np(a),o.resolving=!1,So()}}return r}function rp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Cl]||bs(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Cl]||bs(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function bs(n){return ke(n)?()=>{const e=bs(ve(n));return e&&e()}:dc(n)}const yd="__parameters__";function va(n,e,t){return xe(()=>{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(yd)?l[yd]:Object.defineProperty(l,yd,{value:[]})[yd];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class zt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=$e({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}function Ho(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Go(t,e):e(t))}function Ph(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Ml(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function gc(n,e){const t=[];for(let i=0;i=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function Xm(n,e){const t=ws(n,e);if(t>=0)return n[1|t]}function ws(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):rt(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(yc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[_c]=null,n}const Sd=Ed(va("Inject",n=>({token:n})),-1),qr=Ed(va("Optional"),8),Xa=Ed(va("SkipSelf"),4);function ks(n){return n instanceof class{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}?n.changingThisBreaksApplicationSecurity:n}const f_="__ngContext__";function Es(n,e){n[f_]=e}function p_(n){const e=function(n){return n[f_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Ep(n){return n.ngOriginalError}function D1(n,...e){n.error(...e)}class Yo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||D1}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(Ep(e)):null}_findOriginalError(e){let t=e&&Ep(e);for(;t&&Ep(t);)t=Ep(t);return t||null}}const r0=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Jn))();function Za(n){return n instanceof Function?n():n}var To=(()=>((To=To||{})[To.Important=1]="Important",To[To.DashCase=2]="DashCase",To))();function v_(n,e){return undefined(n,e)}function Uh(n){const e=n[3];return Bo(e)?e[3]:e}function Md(n){return c0(n[13])}function w_(n){return c0(n[4])}function c0(n){for(;null!==n&&!Bo(n);)n=n[4];return n}function Id(n,e,t,i,r){if(null!=i){let s,o=!1;Bo(i)?s=i:ko(i)&&(o=!0,i=i[0]);const a=_r(i);0===n&&null!==t?null==r?p0(e,t,a):Ja(e,t,a,r||null,!0):1===n&&null!==t?Ja(e,t,a,r||null,!0):2===n?function(n,e,t){const i=xp(n,e);i&&function(n,e,t,i){ir(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==_r(t)&&Id(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Ml(n,10+e);!function(n,e){Od(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function x_(n,e){if(!(256&e[2])){const t=e[11];ir(t)&&t.destroyNode&&Od(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Cp(n[1],n);for(;e;){let t=null;if(ko(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)ko(e)&&Cp(e[1],e),e=e[3];null===e&&(e=n),ko(e)&&Cp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Cp(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==Hh(g,c,0)||2&i&&c!==p){if(wa(i))return!1;o=!0}}}}else{if(!o&&!wa(i)&&!wa(l))return!1;if(o&&wa(l))continue;o=!1,i=l|1&i}}return wa(i)||o}function wa(n){return 0==(1&n)}function tA(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!wa(o)&&(e+=T0(s,r),r=""),i=o,s=s||!wa(i);t++}return""!==r&&(e+=T0(s,r)),e}const xn={};function Yt(n){D0(ui(),Bt(),Ws()+n,Sh())}function D0(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Jf(e,s,t)}else{const s=n.preOrderHooks;null!==s&&ep(e,s,0,t)}ao(t)}function el(n,e){return n<<17|e<<2}function Tn(n){return n>>17&32767}function yr(n){return 2|n}function Pl(n){return(131068&n)>>2}function tl(n,e){return-131069&n|e<<2}function O_(n){return 1|n}function k0(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&D0(n,e,20,Sh()),t(i,r)}finally{ao(s)}}function qh(n,e,t){!_b()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Ls(t,e),Es(i,e);const o=t.initialInputs;for(let a=r;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function Y0(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function K0(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function MA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&H_(t)}}function H_(n){for(let i=Md(n);null!==i;i=w_(i))for(let r=10;r0&&H_(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&H_(r)}}function LA(n,e){const t=Fs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Z0(n){return n[7]||(n[7]=[])}function Fp(n){return n.cleanup||(n.cleanup=[])}function K_(n,e){const t=n[9],i=t?t.get(Yo,null):null;i&&i.handleError(e)}function J0(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Go([e],a=>this.processInjectorType(a,[],s)),this.records.set(kd,bu(void 0,this));const o=this.records.get(vu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:rt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=hu,i=bn.Default){this.assertNotDestroyed();const r=wd(this),s=ua(void 0);try{if(!(i&bn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof zt}(e)&&gn(e);a=l&&this.injectableDefInScope(l)?bu(ey(e),Yh):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&bn.Self?ew():this.parent).get(e,t=i&bn.Optional&&t===hu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[_c]=o[_c]||[]).unshift(rt(e)),r)throw o;return qs(o,e,"R3InjectorError",this.source)}throw o}finally{ua(s),wd(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(rt(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=ve(e)))return!1;let r=El(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=El(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Go(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||Wi))}}this.injectorDefTypes.add(o);const l=dc(o)||(()=>new o);this.records.set(o,bu(l,Yh));const c=r.providers;if(null!=c&&!a){const d=e;Go(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Cc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return iw(n)?bu(void 0,n.useValue):bu(nw(n),Yh)}(e);if(Cc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=bu(void 0,Yh,!0),o.factory=()=>pu(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===Yh&&(t.value=HA,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ve(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function ey(n){const e=gn(n),t=null!==e?e.factory:dc(n);if(null!==t)return t;if(n instanceof zt)throw new Error(`Token ${rt(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=gc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[io]||n[Rs]);if(e){const t=function(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Error("unreachable")}function nw(n,e,t){let i;if(Cc(n)){const r=ve(n);return dc(r)||ey(r)}if(iw(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...pu(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Ie(ve(n.useExisting));else{const r=ve(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return dc(r)||ey(r);i=()=>new r(...pu(n.deps))}return i}function bu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function iw(n){return null!==n&&"object"==typeof n&&up in n}function Cc(n){return"function"==typeof n}const rw=function(n,e,t){return function(n,e=null,t=null,i){const r=tw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class zn{static create(e,t){return Array.isArray(e)?rw(e,t,""):rw(e.providers,e.parent,e.name||"")}}function bW(n,e){Zf(p_(n)[1],Jr())}function Dn(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(fa(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=iT(n.inputs),o.declaredInputs=iT(n.declaredInputs),o.outputs=iT(n.outputs);const a=r.hostBindings;a&&CW(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&EW(n,l),c&&SW(n,c),Ua(n.inputs,r.inputs),Ua(n.declaredInputs,r.declaredInputs),Ua(n.outputs,r.outputs),fa(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Mh(r.hostAttrs,t=Mh(t,r.hostAttrs))}}(i)}function iT(n){return n===id?{}:n===Wi?[]:n}function EW(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function SW(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function CW(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}zn.THROW_IF_NOT_FOUND=hu,zn.NULL=new Xs,zn.\u0275prov=$e({token:zn,providedIn:"any",factory:()=>Ie(kd)}),zn.__NG_ELEMENT_ID__=-1;let cw=null;function kp(){if(!cw){const n=Jn.Symbol;if(n&&n.iterator)cw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(_r(Ne[i.index])):i.index;if(ir(t)){let Ne=null;if(!a&&l&&(Ne=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==Ne)(Ne.__ngLastListenerFn__||Ne).__ngNextListenerFn__=s,Ne.__ngLastListenerFn__=s,g=!1;else{s=uT(i,e,f,s,!1);const Ge=t.listen(q,r,s);p.push(s,Ge),d&&d.push(r,ge,G,G+1)}}else s=uT(i,e,f,s,!0),q.addEventListener(r,s,o),p.push(s),d&&d.push(r,ge,G,o)}else s=uT(i,e,f,s,!1);const _=i.outputs;let x;if(g&&null!==_&&(x=_[r])){const T=x.length;if(T)for(let q=0;q0;)e=e[15],n--;return e}(n,Pn.lFrame.contextLView))[8]}(n)}function r7(n,e){let t=null;const i=function(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let r=0;r=0}const Cs={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function WF(n){return n.substring(Cs.key,Cs.keyEnd)}function qF(n,e){const t=Cs.textEnd;return t===e?-1:(e=Cs.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Cs.key=e,t),Qp(n,e,t))}function Qp(n,e,t){for(;e=0;t=qF(e,t))Co(n,WF(e),!0)}function ZF(n,e){return e>=n.expandoStartIndex}function JF(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Ws()],o=ZF(n,t);iL(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=function(n){const e=Pn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=cy(t=hT(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=hT(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Pl(i))return n[Tn(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=hT(null,n,e,l[1],i),l=cy(l,e.attrs,i),function(n,e,t,i){n[Tn(t?e.classBindings:e.styleBindings)]=i}(n,e,i,l))}else s=function(n,e,t){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Tn(n[a+1]);n[i+1]=el(p,a),0!==p&&(n[p+1]=tl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=el(a,0),0!==a&&(n[a+1]=tl(n[a+1],i)),a=i;else n[i+1]=el(l,0),0===a?a=i:n[l+1]=tl(n[l+1],i),l=i;c&&(n[i+1]=yr(n[i+1])),$F(n,d,i,!0),$F(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&ws(s,e)>=0&&(t[i+1]=O_(t[i+1]))}(e,d,n,i,s),o=el(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function hT(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===xn&&(p=f?Wi:void 0);let g=f?Xm(p,i):d===i?p:void 0;if(c&&!gw(g)&&(g=Xm(l,i)),gw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Tn(_):Pl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=Xm(l,i))}return a}function gw(n){return void 0!==n}function iL(n,e){return 0!=(n.flags&(e?16:32))}function Si(n,e=""){const t=Bt(),i=ui(),r=n+20,s=i.firstCreatePass?Nd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return ir(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Ap(i,t,o,s),Ga(s,!1)}function xs(n){return Mc("",n,""),xs}function Mc(n,e,t){const i=Bt(),r=function(n,e,t,i){return ho(n,ma(),t)?e+At(t)+i:xn}(i,n,e,t);return r!==xn&&Fl(i,Ws(),r),Mc}function Eu(n,e,t){const i=Bt();return ho(i,ma(),e)&&Do(ui(),Dr(),i,n,e,i[11],t,!0),Eu}const Xh=void 0;var U7=["en",[["a","p"],["AM","PM"],Xh],[["AM","PM"],Xh,Xh],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Xh,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Xh,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Xh,"{1} 'at' {0}",Xh],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Zp={};function wL(n){return n in Zp||(Zp[n]=Jn.ng&&Jn.ng.common&&Jn.ng.common.locales&&Jn.ng.common.locales[n]),Zp[n]}var an=(()=>((an=an||{})[an.LocaleId=0]="LocaleId",an[an.DayPeriodsFormat=1]="DayPeriodsFormat",an[an.DayPeriodsStandalone=2]="DayPeriodsStandalone",an[an.DaysFormat=3]="DaysFormat",an[an.DaysStandalone=4]="DaysStandalone",an[an.MonthsFormat=5]="MonthsFormat",an[an.MonthsStandalone=6]="MonthsStandalone",an[an.Eras=7]="Eras",an[an.FirstDayOfWeek=8]="FirstDayOfWeek",an[an.WeekendRange=9]="WeekendRange",an[an.DateFormat=10]="DateFormat",an[an.TimeFormat=11]="TimeFormat",an[an.DateTimeFormat=12]="DateTimeFormat",an[an.NumberSymbols=13]="NumberSymbols",an[an.NumberFormats=14]="NumberFormats",an[an.CurrencyCode=15]="CurrencyCode",an[an.CurrencySymbol=16]="CurrencySymbol",an[an.CurrencyName=17]="CurrencyName",an[an.Currencies=18]="Currencies",an[an.Directionality=19]="Directionality",an[an.PluralCase=20]="PluralCase",an[an.ExtraData=21]="ExtraData",an))();const _w="en-US";let EL=_w;function pT(n){Z(n,"Expected localeId to be defined"),"string"==typeof n&&(EL=n.toLowerCase().replace(/_/g,"-"))}function _T(n,e,t,i,r){if(n=ve(n),Array.isArray(n))for(let s=0;s>20;if(Cc(n)||!n.multi){const g=new Dh(l,r,De),_=vT(a,e,r?d:d+p,f);-1===_?(fc(Ls(c,o),s,a),yT(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[_]=g,o[_]=g)}else{const g=vT(a,e,d+p,f),_=vT(a,e,d,d+p),x=g>=0&&t[g],T=_>=0&&t[_];if(r&&!T||!r&&!x){fc(Ls(c,o),s,a);const q=function(n,e,t,i,r){const s=new Dh(n,t,De);return s.multi=[],s.index=e,s.componentProviders=0,WL(s,r,i&&!t),s}(r?B9:k9,t.length,r,i,l);!r&&T&&(t[_].providerFactory=q),yT(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(q),o.push(q)}else yT(s,n,g>-1?g:_,WL(t[r?_:g],l,!r&&i));!r&&i&&T&&t[_].componentProviders++}}}function yT(n,e,t,i){const r=Cc(e);if(r||function(n){return!!n.useClass}(e)){const o=(e.useClass||e).prototype.ngOnDestroy;if(o){const a=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){const l=a.indexOf(t);-1===l?a.push(t,[i,o]):a[l+1].push(i,o)}else a.push(t,o)}}}function WL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function vT(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=ui();if(i.firstCreatePass){const r=fa(n);_T(t,i.data,i.blueprint,r,!0),_T(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class qL{}const KL="ngComponent";class U9{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[KL]=n,e}(e)}}class ol{}function Ew(...n){}function eg(n,e){return new wn($s(n,e))}ol.NULL=new U9;const G9=function(){return eg(Jr(),Bt())};let wn=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=G9,n})();function XL(n){return n instanceof wn?n.nativeElement:n}class Qh{}let ET=(()=>{class n{}return n.\u0275prov=$e({token:n,providedIn:"root",factory:()=>null}),n})();class Cu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const QL=new Cu("12.2.5");class ZL{constructor(){}supports(e){return sy(e)}create(e){return new X9(e)}}const K9=(n,e)=>e;class X9{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||K9}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new Q9(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new JL),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new JL),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class Q9{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Z9{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class JL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new Z9,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function e2(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new eq(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class eq{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function n2(){return new tg([new ZL])}let tg=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||n2()),deps:[[n,new Xa,new qr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=$e({token:n,providedIn:"root",factory:n2}),n})();function r2(){return new ng([new t2])}let ng=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||r2()),deps:[[n,new Xa,new qr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=$e({token:n,providedIn:"root",factory:r2}),n})();function Sw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(_r(s)),Bo(s))for(let a=10;a-1&&(C_(e,i),Ml(t,i))}this._attachedToViewContainer=!1}x_(this._lView[1],this._lView)}onDestroy(e){U0(this._lView[1],this._lView,null,e)}markForCheck(){G_(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){W_(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Kf(!0);try{W_(n,e,t)}finally{Kf(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Od(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class nq extends py{constructor(e){super(e),this._view=e}detectChanges(){Q0(this._view)}checkNoChanges(){!function(n){Kf(!0);try{Q0(n)}finally{Kf(!1)}}(this._view)}get context(){return null}}const rq=function(n){return function(n,e,t){if(ad(n)&&!t){const i=Fs(n.index,e);return new py(i,i)}return 47&n.type?new py(e[16],e):null}(Jr(),Bt(),16==(16&n))};let ts=(()=>{class n{}return n.__NG_ELEMENT_ID__=rq,n})();const aq=[new t2],cq=new tg([new ZL]),uq=new ng(aq),hq=function(){return Cw(Jr(),Bt())};let Io=(()=>{class n{}return n.__NG_ELEMENT_ID__=hq,n})();const fq=Io,pq=class extends fq{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=$h(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),Wh(t,i,e),new py(i)}};function Cw(n,e){return 4&n.type?new pq(e,n,eg(n,e)):null}class Ic{}const _q=function(){return l2(Jr(),Bt())};let As=(()=>{class n{}return n.__NG_ELEMENT_ID__=_q,n})();const vq=As,o2=class extends vq{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return eg(this._hostTNode,this._hostLView)}get injector(){return new Uo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Ih(this._hostTNode,this._hostLView);if(bb(e)){const t=Wa(e,this._hostLView),i=fd(e);return new Uo(t[1].data[i+8],t)}return new Uo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=a2(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Ic,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Bo(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new o2(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),ir0});class I2 extends qL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(oA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return M2(this.componentDef.inputs)}get outputs(){return M2(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,og,r);return s!==og||i===og?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Qh,ru),a=s.get(ET,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(ir(n))return n.selectRootElement(e,t===$t.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):S_(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?"http://www.w3.org/2000/svg":"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||r0,clean:UA,playerHandler:e||null,flags:0}}(),g=Np(0,null,null,1,0,null,null,null,null,null),_=$h(null,g,p,f,null,null,o,l,a,s);let x,T;Ah(_);try{const q=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Nd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(Lp(l,c,!0),null!==n&&(tp(r,n,c),null!==l.classes&&M_(r,n,l.classes),null!==l.styles&&S0(r,n,l.styles)));const d=i.createRenderer(n,e),f=$h(t,Rp(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(fc(Ls(l,t),o,e.type),K0(o,l),V_(l,t.length,1)),Pp(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)tp(l,d,["ng-version",QL.full]);else{const{attrs:G,classes:ge}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&M_(l,d,ge.join(" "))}if(T=Om(g,20),void 0!==t){const G=T.projection=[];for(let ge=0;gel(o,e)),e.contentQueries){const l=Jr();e.contentQueries(1,o,l.directiveStart)}const a=Jr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(ao(a.index),q0(t[1],a,0,a.directiveStart,a.directiveEnd,e),Y0(e,o)),o}(q,this.componentDef,_,p,[bW]),Wh(g,_,null)}finally{ri()}return new yY(this.componentType,x,eg(T,_),_,T)}}class yY extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new nq(r),this.componentType=e}get injector(){return new Uo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const ag=new Map;class wY extends Ic{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new D2(this);const i=bo(e),r=function(n){return n[vx]||null}(e);r&&pT(r),this._bootstrapComponents=Za(i.bootstrap),this._r3Injector=tw(e,t,[{provide:Ic,useValue:this},{provide:ol,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=zn.THROW_IF_NOT_FOUND,i=bn.Default){return e===zn||e===Ic||e===kd?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class LT extends class{}{constructor(e){super(),this.moduleType=e,null!==bo(e)&&function(n){const e=new Set;!function t(i){const r=bo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${rt(e)} vs ${rt(e.name)}`)}(s,ag.get(s),i),ag.set(s,i));const o=Za(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new wY(this.moduleType,e)}}function Mw(n,e,t){const i=ys()+n,r=Bt();return r[i]===xn?Ac(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function P2(n,e,t,i,r,s){const o=e+t;return ho(n,o,r)?Ac(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===xn?void 0:t}(n,o+1)}function cl(n,e){const t=ui();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new Qe("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=dc(i.type)),o=ua(De);try{const a=np(!1),l=s();return np(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Bt(),r,l),l}finally{ua(o)}}function ul(n,e,t){const i=n+20,r=Bt(),s=cd(r,i);return function(n,e){kl.isWrapped(e)&&(e=kl.unwrap(e),n[Pn.lFrame.bindingIndex]=xn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?P2(r,ys(),e,s.transform,t,s):s.transform(t))}function kT(n){return e=>{setTimeout(n,void 0,e)}}const mn=class extends ee{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=kT(l),a&&(a=kT(a)),c&&(c=kT(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof S&&e.add(d),d}};function LY(){return this._results[kp()]()}class ef{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=kp(),i=ef.prototype;i[t]||(i[t]=LY)}get changes(){return this._changes||(this._changes=new mn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=Ho(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=Ew,this.reject=Ew,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Ie(tf,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Ay=new zt("AppId"),yK={provide:Ay,useFactory:function(){return`${KT()}${KT()}${KT()}`},deps:[]};function KT(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const ak=new zt("Platform Initializer"),Oc=new zt("Platform ID"),Rw=new zt("appBootstrapListener");let Nw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const xu=new zt("LocaleId"),lk=new zt("DefaultCurrencyCode");class bK{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const XT=function(n){return new LT(n)},wK=XT,EK=function(n){return Promise.resolve(XT(n))},ck=function(n){const e=XT(n),i=Za(bo(n).declarations).reduce((r,s)=>{const o=Ii(s);return o&&r.push(new I2(o)),r},[]);return new bK(e,i)},SK=ck,CK=function(n){return Promise.resolve(ck(n))};let nf=(()=>{class n{constructor(){this.compileModuleSync=wK,this.compileModuleAsync=EK,this.compileModuleAndAllComponentsSync=SK,this.compileModuleAndAllComponentsAsync=CK}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const uk=new zt("compilerOptions"),AK=(()=>Promise.resolve(0))();function QT(n){"undefined"==typeof Zone?AK.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class yn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new mn(!1),this.onMicrotaskEmpty=new mn(!1),this.onStable=new mn(!1),this.onError=new mn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=Jn.requestAnimationFrame,e=Jn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(Jn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,JT(n),n.isCheckStableRunning=!0,ZT(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),JT(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return dk(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),hk(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return dk(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),hk(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,JT(n),ZT(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!yn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(yn.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,DK,Ew,Ew);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const DK={};function ZT(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function JT(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function dk(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function hk(n){n._nesting--,ZT(n)}class OK{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new mn,this.onMicrotaskEmpty=new mn,this.onStable=new mn,this.onError=new mn}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let eD=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{yn.assertNotInAngularZone(),QT(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())QT(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),fk=(()=>{class n{constructor(){this._applications=new Map,tD.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return tD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class RK{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let tD=new RK,pk=!0,gk=!1;function Sa(){return gk=!0,pk}let Hl;const mk=new zt("AllowMultipleToken");function _k(n,e,t=[]){const i=`Platform: ${e}`,r=new zt(i);return(s=[])=>{let o=iD();if(!o||o.injector.get(mk,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:vu,useValue:"platform"});!function(n){if(Hl&&!Hl.destroyed&&!Hl.injector.get(mk,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Hl=n.get(yk);const e=n.get(ak,null);e&&e.forEach(t=>t())}(zn.create({providers:a,name:i}))}return function(n){const e=iD();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function iD(){return Hl&&!Hl.destroyed?Hl:null}let yk=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new OK:("zone.js"===n?void 0:n)||new yn({enableLongStackTrace:Sa(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:yn,useValue:a}];return a.run(()=>{const c=zn.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Yo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{rD(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return ay(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(cg);return p.runInitializers(),p.donePromise.then(()=>(pT(d.injector.get(xu,_w)||_w),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=vk({},i);return function(n,e,t){const i=new LT(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(jd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${rt(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function vk(n,e){return Array.isArray(e)?e.reduce(vk,n):Object.assign(Object.assign({},n),e)}let jd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new F(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new F(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{yn.assertNotInAngularZone(),QT(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{yn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Rn(a,l.pipe(ps()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof qL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Ic),a=r.create(zn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(eD,null),d=c&&a.injector.get(fk);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),rD(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;rD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Rw,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(zn),Ie(Yo),Ie(ol),Ie(cg))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function rD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const sX=_k(null,"core",[{provide:Oc,useValue:"unknown"},{provide:yk,deps:[zn]},{provide:fk,deps:[]},{provide:Nw,deps:[]}]),uX=[{provide:jd,useClass:jd,deps:[yn,zn,Yo,ol,cg]},{provide:gY,deps:[yn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:cg,useClass:cg,deps:[[new qr,tf]]},{provide:nf,useClass:nf,deps:[]},yK,{provide:tg,useFactory:function(){return cq},deps:[]},{provide:ng,useFactory:function(){return uq},deps:[]},{provide:xu,useFactory:function(n){return pT(n=n||"undefined"!=typeof $localize&&$localize.locale||_w),n},deps:[[new Sd(xu),new qr,new Xa]]},{provide:lk,useValue:"USD"}];let hX=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(jd))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:uX}),n})(),$w=null;function Rc(){return $w}const un=new zt("DocumentToken");let of=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:dQ,token:n,providedIn:"platform"}),n})();function dQ(){return Ie(qk)}let qk=(()=>{class n extends of{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Rc().getBaseHref(this._doc)}onPopState(t){const i=Rc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Rc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){Yk()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){Yk()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({factory:fQ,token:n,providedIn:"platform"}),n})();function Yk(){return!!window.history.pushState}function fQ(){return new qk(Ie(un))}function Tu(n){return n&&"?"!==n[0]?"?"+n:n}let af=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:pQ,token:n,providedIn:"root"}),n})();function pQ(n){const e=Ie(un).location;return new Xk(Ie(of),e&&e.origin||"")}const bD=new zt("appBaseHref");let Xk=(()=>{class n extends af{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return function(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Tu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Tu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Tu(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(of),Ie(bD,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();var cs=(()=>((cs=cs||{})[cs.Zero=0]="Zero",cs[cs.One=1]="One",cs[cs.Two=2]="Two",cs[cs.Few=3]="Few",cs[cs.Many=4]="Many",cs[cs.Other=5]="Other",cs))();const CQ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=wL(e);if(t)return t;const i=e.split("-")[0];if(t=wL(i),t)return t;if("en"===i)return U7;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[an.PluralCase]};class tE{}let JQ=(()=>{class n extends tE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(CQ(i||this.locale)(t)){case cs.Zero:return"zero";case cs.One:return"one";case cs.Two:return"two";case cs.Few:return"few";case cs.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(xu))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class tZ{constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ud=(()=>{class n{constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(i){throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const i=[];t.forEachOperation((r,s,o)=>{if(null==r.previousIndex){const a=this._viewContainer.createEmbeddedView(this._template,new tZ(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new l3(r,a);i.push(l)}else if(null==o)this._viewContainer.remove(null===s?void 0:s);else if(null!==s){const a=this._viewContainer.get(s);this._viewContainer.move(a,o);const l=new l3(r,a);i.push(l)}});for(let r=0;r{this._viewContainer.get(r.currentIndex).context.$implicit=r.item})}_perViewChange(t,i){t.context.$implicit=i.item}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(De(As),De(Io),De(tg))},n.\u0275dir=kt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class l3{constructor(e,t){this.record=e,this.view=t}}let Mu=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new iZ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){c3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){c3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(De(As),De(Io))},n.\u0275dir=kt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class iZ{constructor(){this.$implicit=null,this.ngIf=null}}function c3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class aZ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class lZ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const cZ=new lZ,uZ=new aZ;let iE=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(ay(t))return cZ;if(PF(t))return uZ;throw function(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${rt(n)}'`)}(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(De(ts,16))},n.\u0275pipe=Ns({name:"async",type:n,pure:!1}),n})(),Kr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[{provide:tE,useClass:JQ}]}),n})();const g3="browser";function lf(n){return n===g3}class ND extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){$w||($w=n)}(new ND)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(Ny=Ny||document.querySelector("base"),Ny?Ny.getAttribute("href"):null);return null==t?null:function(n){rE=rE||document.createElement("a"),rE.setAttribute("href",n);const e=rE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Ny=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}(document.cookie,e)}}let rE,Ny=null;const v3=new zt("TRANSITION_ID"),FZ=[{provide:tf,useFactory:function(n,e,t){return()=>{t.get(cg).donePromise.then(()=>{const i=Rc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},Jn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Jn.getAllAngularRootElements=()=>e.getAllRootElements(),Jn.frameworkStabilizers||(Jn.frameworkStabilizers=[]),Jn.frameworkStabilizers.push(i=>{const r=Jn.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Rc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let LZ=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Py=new zt("EventManagerPlugins");let oE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),Fy=(()=>{class n extends w3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(E3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(E3))}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function E3(n){Rc().remove(n)}const LD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},kD=/%COMP%/g;function aE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let lE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new BD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case $t.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new QZ(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case $t.ShadowDom:return new ZZ(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=aE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Ie(oE),Ie(Fy),Ie(Ay))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class BD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(LD[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=LD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=LD[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(To.DashCase|To.Important)?e.style.setProperty(t,i,r&To.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&To.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,x3(i)):this.eventManager.addEventListener(e,t,x3(i))}}class QZ extends BD{constructor(e,t,i,r){super(e),this.component=i;const s=aE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(kD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(kD,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class ZZ extends BD{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=aE(r.id,r.styles,[]);for(let o=0;o{class n extends FD{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const D3=["alt","control","meta","shift"],oJ={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},M3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},aJ={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let lJ=(()=>{class n extends FD{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Rc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(D3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&M3.hasOwnProperty(e)&&(e=M3[e]))}return oJ[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),D3.forEach(s=>{s!=r&&aJ[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const mJ=_k(sX,"browser",[{provide:Oc,useValue:g3},{provide:ak,useValue:function(){ND.makeCurrent(),PD.init()},multi:!0},{provide:un,useFactory:function(){return function(n){Bi=n}(document),document},deps:[]}]),_J=[[],{provide:vu,useValue:"root"},{provide:Yo,useFactory:function(){return new Yo},deps:[]},{provide:Py,useClass:JZ,multi:!0,deps:[un,yn,Oc]},{provide:Py,useClass:lJ,multi:!0,deps:[un]},[],{provide:lE,useClass:lE,deps:[oE,Fy,Ay]},{provide:Qh,useExisting:lE},{provide:w3,useExisting:Fy},{provide:Fy,useClass:Fy,deps:[un]},{provide:eD,useClass:eD,deps:[yn]},{provide:oE,useClass:oE,deps:[Py,yn]},{provide:class{},useClass:LZ,deps:[]},[]];let UD=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Ay,useValue:t.appId},{provide:v3,useExisting:Ay},FZ]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:_J,imports:[Kr,hX]}),n})();"undefined"!=typeof window&&window;class xJ extends S{constructor(e,t){super()}schedule(e,t=0){return this}}class cE extends xJ{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let O3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Yl extends O3{constructor(e,t=O3.now){super(e,()=>Yl.delegate&&Yl.delegate!==this?Yl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Yl.delegate&&Yl.delegate!==this?Yl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const DJ=new class extends Yl{}(class extends cE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Nc=new F(n=>n.complete());function uE(n){return n?function(n){return new F(e=>n.schedule(()=>e.complete()))}(n):Nc}function nn(...n){let e=n[n.length-1];return Te(e)?(n.pop(),Be(n,e)):An(n)}function fg(n,e){return new F(e?t=>e.schedule(IJ,0,{error:n,subscriber:t}):t=>t.error(n))}function IJ({error:n,subscriber:e}){e.error(n)}class ta{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return nn(this.value);case"E":return fg(this.error);case"C":return uE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ta("N",e):ta.undefinedValueNotification}static createError(e){return new ta("E",void 0,e)}static createComplete(){return ta.completeNotification}}ta.completeNotification=new ta("C"),ta.undefinedValueNotification=new ta("N",void 0);class dE extends y{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(dE.dispatch,this.delay,new RJ(e,this.destination)))}_next(e){this.scheduleMessage(ta.createNext(e))}_error(e){this.scheduleMessage(ta.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ta.createComplete()),this.unsubscribe()}}class RJ{constructor(e,t){this.notification=e,this.destination=t}}class pg extends ee{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new NJ(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new U;if(this.isStopped||this.hasError?o=S.EMPTY:(this.observers.push(e),o=new ie(this,e)),r&&e.add(e=new dE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class NJ{constructor(e,t){this.time=e,this.value=t}}function sr(n,e){return"function"==typeof e?t=>t.pipe(sr((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new PJ(n))}class PJ{constructor(e){this.project=e}call(e,t){return t.subscribe(new FJ(e,this.project))}}class FJ extends pe{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new Et(this),r=this.destination;r.add(i),this.innerSubscription=O(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const hE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return hE.schedule(n,0);if(void 0===window.requestAnimationFrame)return hE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let HD;function $J(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!HD){const t=Element.prototype;HD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&HD.call(n,e)}(n,r)||(i=s,0))),i}class qJ{constructor(e,t){this.componentFactory=t.get(ol).resolveComponentFactory(e)}create(e){return new YJ(this.componentFactory,e)}}class YJ{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new pg(1),this.events=this.eventEmitters.pipe(sr(i=>Rn(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(yn),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=hE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=zn.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(me(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=hE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new Dm(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class KJ extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Iu(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?Iu(n,e,t).pipe(me(r=>L(r)?i(...r):i(r))):new F(r=>{R3(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function R3(n,e,t,i,r){let s;if(function(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const o=n;n.addEventListener(e,t,r),s=()=>o.removeEventListener(e,t,r)}else if(function(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const o=n;n.on(e,t),s=()=>o.off(e,t)}else if(function(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const o=n;n.addListener(e,t),s=()=>o.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let o=0,a=n.length;o=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function P3(n,e){return function(t,i){e(t,i,n)}}function Kl(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function or(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}class Ir extends ee{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new U;return this._value}next(e){super.next(this._value=e)}}class k3 extends y{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class nee extends y{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function B3(n,e,t,i,r=new nee(n,t,i)){if(!r.closed)return e instanceof F?e.subscribe(r):Oe(e)(r)}function gE(...n){return It(1)(nn(...n))}Object.create(Error.prototype);const U3=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function Xi(n){return e=>0===n?uE():e.lift(new see(n))}class see{constructor(e){if(this.total=e,this.total<0)throw new U3}call(e,t){return t.subscribe(new oee(e,this.total))}}class oee extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function Ui(n,e){return function(i){return i.lift(new cee(n,e))}}class cee{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new uee(e,this.predicate,this.thisArg))}}class uee extends y{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}function Xl(n){return function(t){const i=new dee(n),r=t.lift(i);return i.caught=r}}class dee{constructor(e){this.selector=e}call(e,t){return t.subscribe(new hee(e,this.selector,this.caught))}}class hee extends pe{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new Et(this);this.add(i);const r=O(t,i);r!==i&&this.add(r)}}}function _E(n=null){return e=>e.lift(new yee(n))}class yee{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new vee(e,this.defaultValue))}}class vee extends y{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function Hd(){}function jr(n,e,t){return function(r){return r.lift(new wee(n,e,t))}}class wee{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Eee(e,this.nextOrObserver,this.error,this.complete))}}class Eee extends y{constructor(e,t,i,r){super(e),this._tapNext=Hd,this._tapError=Hd,this._tapComplete=Hd,this._tapError=i||Hd,this._tapComplete=r||Hd,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||Hd,this._tapError=t.error||Hd,this._tapComplete=t.complete||Hd)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}class Mne{constructor(e){this.total=e}call(e,t){return t.subscribe(new Ine(e,this.total))}}class Ine extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}let GB=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=kt({type:n,selectors:[["","gaEvent","","gaCategory",""],["","gaCategory",""]],inputs:{gaCategory:"gaCategory"},exportAs:["gaCategory"]}),n})();const wg=new zt("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),gM=new zt("ngx-window",{providedIn:"root",factory:()=>function(n){return lf(n)?window:null}(vc(Oc))}),Nne=new zt("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(vc(gM))}),mM=new zt("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(vc(gM),vc(Nne))});let PE=(()=>{class n{constructor(t,i,r){this.settings=t,this._document=i,this._gtag=r}get document(){return this._document}throw(t){(this.settings.enableTracing||Sa())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((i,[r,s])=>Object.defineProperty(i,r,{value:s,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(i=>void 0!==i))}catch(i){this.throw(i)}}event(t,i,r,s,o){try{const a=new Map;i&&a.set("event_category",i),r&&a.set("event_label",r),s&&a.set("value",s),void 0!==o&&a.set("interaction",o);const l=this.toKeyValue(a);l?this.gtag("event",t,l):this.gtag("event",t)}catch(a){this.throw(a)}}pageView(t,i,r,s){try{const o=new Map([["page_path",t]]);i&&o.set("page_title",i),(r||this.document)&&o.set("page_location",r||this.document.location.href),s&&Object.entries(s).map(([a,l])=>o.set(a,l)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(o))}catch(o){this.throw(o)}}appView(t,i,r,s,o){try{const a=new Map([["screen_name",t],["app_name",i]]);r&&a.set("app_id",r),s&&a.set("app_version",s),o&&a.set("app_installer_id",o),this.gtag("event","screen_view",this.toKeyValue(a))}catch(a){this.throw(a)}}set(...t){try{this._gtag("set",...t)}catch(i){this.throw(i)}}exception(t,i){try{const r=new Map;t&&r.set("description",t),i&&r.set("fatal",i),this.toKeyValue(r)?this.gtag("event","exception",this.toKeyValue(r)):this.gtag("event","exception")}catch(r){this.throw(r)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(wg),Ie(un),Ie(mM))},n.\u0275prov=$e({factory:function(){return new n(Ie(wg),Ie(un),Ie(mM))},token:n,providedIn:"root"}),n})(),$B=(()=>{class n{constructor(t,i,r,s){this.gaCategoryDirective=t,this.gaService=i,this.settings=r,this.el=s,this.gaBind="click"}set gaBind(t){this.bindSubscription&&this.bindSubscription.unsubscribe(),this._gaBind=t,this.bindSubscription=Iu(this.el.nativeElement,t).subscribe(()=>this.trigger())}get gaBind(){return this._gaBind}ngOnDestroy(){this.bindSubscription&&this.bindSubscription.unsubscribe()}trigger(){try{if(!this.gaAction&&!this.gaEvent)throw new Error("You must provide a gaAction attribute to identify this event.");this.gaService.event(this.gaAction||this.gaEvent,this.gaCategoryDirective?this.gaCategoryDirective.gaCategory:void 0,this.gaLabel||this.label,this.gaValue,this.gaInteraction)}catch(t){this.throw(t)}}throw(t){(Sa()||this.settings.enableTracing)&&console&&console.warn&&console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)(De(GB,8),De(PE),De(wg),De(wn))},n.\u0275dir=kt({type:n,selectors:[["","gaEvent",""]],inputs:{gaBind:"gaBind",gaAction:"gaAction",gaLabel:"gaLabel",label:"label",gaValue:"gaValue",gaInteraction:"gaInteraction",gaEvent:"gaEvent"},exportAs:["gaEvent"]}),n})();const Fne={provide:tf,multi:!0,useFactory:function(n,e,t){return()=>or(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(Sa()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Sa()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));t||Sa()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),n.uri=n.uri||`https://www.googletagmanager.com/gtag/js?id=${n.trackingCode}`,n.initCommands=null!==(i=null==n?void 0:n.initCommands)&&void 0!==i?i:[],n.initCommands.find(o=>"config"===o.command)||n.initCommands.unshift({command:"config",values:[n.trackingCode]}),n.initCommands.find(o=>"js"===o.command)||n.initCommands.unshift({command:"js",values:[new Date]});for(const o of n.initCommands)e(o.command,...o.values);const r=t.createElement("script");r.async=!0,r.src=n.uri,n.nonce&&r.setAttribute("nonce",n.nonce),t.getElementsByTagName("head")[0].appendChild(r)})},deps:[wg,mM,un]};new zt("ngx-google-analytics-routing-settings",{factory:()=>({})});let FE=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:wg,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},Fne]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[]]}),n})(),LE=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new pg(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),jne=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new S,this.token=r,this.subscriptions.add(t.consentChange.subscribe(s=>this.toggleGoogleAnalytics("rescinded"===s)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(LE),Ie(gM),Ie(wg))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Vne=new zt("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),YB=[LE,jne,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new S;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(r=>this.saveConsent(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,i;const r=null===(i=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===i?void 0:i.call(t,this.key);if(null==r)return"not-set";const s=r.trim().toLowerCase();switch(s){case"given":case"rescinded":return s;default:return"not-set"}}saveConsent(t){var i,r;null===(r=null===(i=this.storage)||void 0===i?void 0:i.setItem)||void 0===r||r.call(i,this.key,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(LE),Ie(Vne))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})()];function zne(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let Gne=(()=>{class n{static forRoot(t){const{providers:i=[]}=FE.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[zne({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[...YB,{provide:tf,multi:!0,useFactory:()=>()=>{},deps:YB}],imports:[[FE]]}),n})();var _M;const $d={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"",hubmapPortalUrl:"",hubmapDataUrl:"",hubmapAssetsUrl:"",hubmapToken:null!==(_M=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==_M?_M:""},googleAnalyticsToken:"G-ERNVZ1Q4KE"},$ne={initialConfig:{},parse:{},rename:{}};class Wne{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},$ne),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let qne=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new Wne(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=kt({type:n,features:[ki]}),n})();const KB_json=n=>"string"==typeof n?JSON.parse(n):n;function XB(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function yM(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||XB()}const QB="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",kE=yM();class Kne{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function vM(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const ZB={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function JB(n){return"string"==typeof n?ZB[n.toUpperCase()]||ZB.WHITE:n}function BE(n,e){if(!n)throw new Error(e||"Assertion failed")}const Ql={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},$y=Ql.window||Ql.self||Ql.global,ej=Ql.process||{};function Eg(){let n;if(kE&&$y.performance)n=$y.performance.now();else if(ej.hrtime){const e=ej.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Sg={debug:kE&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},nie={enabled:!0,level:0};function pl(){}const tj={},nj={once:!0};function iie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let bM=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=QB,this._startTs=Eg(),this._deltaTs=Eg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Kne("__probe-".concat(this.id,"__"),nie),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Eg()-this._startTs).toPrecision(10))}getDelta(){return Number((Eg()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){BE(t,i)}warn(t){return this._getLogFunction(0,t,Sg.warn,arguments,nj)}error(t){return this._getLogFunction(0,t,Sg.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,Sg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Sg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Sg.debug||Sg.info,arguments,nj)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||pl,r&&[r],{tag:iie(i)}):pl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?kE?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=vM(r,e,t);console.log(...s)},r.src=n,pl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...vM(n,e,t)),pl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...vM(r,e,t)),r.src=n.toDataURL(),pl}return pl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=tt(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):pl}({image:r,message:s,scale:o}):pl}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||pl)}group(t,i,r={collapsed:!1}){r=rj({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||pl)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=ij(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=rj({logLevel:t,message:i,args:s,opts:o}),BE(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Eg();const a=o.tag||o.message;if(o.once){if(tj[a])return pl;tj[a]=Eg()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!kE&&"string"==typeof n&&(e&&(e=JB(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=JB(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return pl}}return n.VERSION=QB,n})();function ij(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return BE(Number.isFinite(e)&&e>=0),e}function rj(n){const{logLevel:e,message:t}=n;n.logLevel=ij(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return BE("string"===r||"object"===r),Object.assign(n,n.opts)}const Ni=new bM({id:"deck"}),Mi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mi,"IDENTITY",{get:()=>Ni.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},sj={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},dn=new bM({id:"luma.gl"});function Po(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function jE(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function fi(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function VE(n){return Po(jE(n),"Invalid WebGLRenderingContext"),n}function Fo(n){return Po(fi(n),"Requires WebGL2"),n}var Er=tt(761);const Wy={};const qy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Er.CO.console&&Er.CO.console.log&&Er.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};gf.prototype.VERTEX_ARRAY_BINDING_OES=34229,gf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;ifi(n)?void 0:0,Cie={3074:n=>fi(n)?void 0:36064,35723:n=>fi(n)?void 0:4352,35977:ur,32937:ur,36795:(n,e)=>{const t=fi(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(lj);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(lj);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:ur,35071:ur,37447:ur,36063:(n,e)=>{if(!fi(n)){const t=n.getExtension(aj);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:ur,35374:ur,35377:ur,34852:n=>{if(!fi(n)){const e=n.getExtension(aj);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(oj)?2147483647:65535,33001:n=>n.getExtension(oj)?16777216:65535,33e3:n=>16777216,37157:ur,35373:ur,35657:ur,36183:ur,37137:ur,34045:ur,35978:ur,35979:ur,35968:ur,35376:ur,35375:ur,35659:ur,37154:ur,35371:ur,35658:ur,35076:ur,35077:ur,35380:ur},cj="ANGLE_instanced_arrays",uj={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Po(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[cj]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){Po(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Po(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Po(!1)},deleteQuery:()=>{Po(!1)},beginQuery:()=>{Po(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},wM={readBuffer:(n,e,t)=>{fi(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:fi(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!fi(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!fi(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=Cie[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function kie(n,{extension:e,target:t,target2:i}){const r=uj[e];Po(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new gf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&kie(n,{extension:t,target:n.luma,target2:n})}(n,uj),function(n,{target:e,target2:t}){Object.keys(wM).forEach(i=>{if("function"==typeof wM[i]){const r=n[i]?n[i].bind(n):()=>{},s=wM[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const EM={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},Wd=(n,e,t)=>e?n.enable(t):n.disable(t),dj=(n,e,t)=>n.hint(t,e),xa=(n,e,t)=>n.pixelStorei(t,e);function Yy(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Vie={3042:Wd,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:Wd,2885:(n,e)=>n.cullFace(e),2929:Wd,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:Wd,35723:dj,36006:(n,e)=>{const t=fi(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:dj,2849:(n,e)=>n.lineWidth(e),32823:Wd,32824:"polygonOffset",10752:"polygonOffset",35977:Wd,32938:"sampleCoverage",32939:"sampleCoverage",3089:Wd,3088:(n,e)=>n.scissor(...e),2960:Wd,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:xa,3317:xa,37440:xa,37441:xa,37443:xa,3330:xa,3332:xa,3331:xa,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:xa,32878:xa,3316:xa,3315:xa,32877:xa,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Yy(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Yy(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Yy(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Yy(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=Yy(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Xr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const Uie={blendEquation:(n,e,t)=>n.blendEquationSeparate(Xr(32777,e,t),Xr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Xr(32969,e,t),Xr(32968,e,t),Xr(32971,e,t),Xr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Xr(32824,e,t),Xr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Xr(32938,e,t),Xr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Xr(2962,e,t),Xr(2967,e,t),Xr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Xr(34816,e,t),Xr(36003,e,t),Xr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Xr(2964,e,t),Xr(2965,e,t),Xr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Xr(34817,e,t),Xr(34818,e,t),Xr(34819,e,t))},hj={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Bc=(n,e)=>n.isEnabled(e),fj={3042:Bc,2884:Bc,2929:Bc,3024:Bc,32823:Bc,32926:Bc,32928:Bc,3089:Bc,2960:Bc,35977:Bc};function pj(n){for(const e in n)return!1;return!0}function zie(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||EM)){const r=e,s=fj[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=fj[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},EM),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Po(this.stateStack.length>0),Nu(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){Po(void 0!==s);const o=e[s],a=this.cache[s];zie(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function mj(n,e={}){const{enable:t=!0,copyState:i}=e;if(Po(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new $ie(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in hj)Hie(n,o,hj[o]);gj(n,"getParameter"),gj(n,"isEnabled")}return n.state.enable=t,n}function _j(n){Po(n.state),n.state.pop()}function Nu(n,e){if(Po(jE(n),"setParameters requires a WebGL context"),pj(e))return;const t={};for(const r in e){const s=Number(r),o=Vie[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)Uie[r](n,e,i)}function Zl(n,e,t){if(pj(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||mj(n,{copyState:!1}),n.state.push()}(n),Nu(n,e),i)r=t(n),_j(n);else try{r=t(n)}finally{_j(n)}return r}function Cg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function SM(n,e,t=!0){return function(n,e,t,i,r){const s=yj(n[0],e,t);let o=vj(n[1],e,i,r),a=yj(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=vj(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,Cg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function yj(n,e,t){return Math.min(Math.round(n*e),t-1)}function vj(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const CM=(0,Er.jU)(),Qie=CM&&"undefined"!=typeof document,bj={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function wj(n={}){Po(CM,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},bj,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(Qie&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=xM(r,n),function(n){const e=fi(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);dn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function xM(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},bj,e);const{manageState:t,debug:i}=e;return t&&mj(n,{copyState:!1,log:(...r)=>dn.log(1,...r)()}),CM&&i&&(Er.CO.makeDebugContext?(n=Er.CO.makeDebugContext(n,e),dn.level=Math.max(dn.level,1)):dn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function Ej(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class Sj{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ej(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ej()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class AM{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof Sj?e:new Sj(t,i)),this.stats[t]}}const Ky="8.5.7",mf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new AM({id:e})),this.stats.get(e)}};if(Er.CO.luma&&Er.CO.luma.VERSION!==Ky)throw new Error(`luma.gl - multiple VERSIONs detected: ${Er.CO.luma.VERSION} vs 8.5.7`);function rn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function TM(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return rn(void 0!==i,`Accessing undefined constant GL.${e}`),i}function qd(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Er.CO.luma||((0,Er.jU)()&&dn.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Er.CO.luma=Er.CO.luma||{VERSION:Ky,version:Ky,log:dn,stats:mf,globals:{modules:{},nodeIO:{}}});const DM={};function jc(n="id"){return DM[n]=DM[n]||1,`${n}-${DM[n]++}`}function Cj(n){return rn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function xg(n){let e=!0;for(const t in n){e=!1;break}return e}function xj(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw dn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ag="Resource subclass must define virtual methods";class Pu{constructor(e,t={}){VE(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||jc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){rn(e=TM(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=fi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=fi(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?qd(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=qd(this.gl,o[f]))}}return o}setParameter(e,t){rn(e=TM(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=fi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=TM(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return xj(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ag)}_deleteHandle(){throw new Error(Ag)}_bindHandle(e){throw new Error(Ag)}_getOptsFromHandle(){throw new Error(Ag)}_getParameter(e,t){throw new Error(Ag)}_setParameter(e,t){throw new Error(Ag)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=mf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;mf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=mf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=mf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function MM(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Xy(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function cre({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return ia.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ia.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=IM("Accessor",e,dre)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const Tj={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},hre={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Tj},fre={removedProps:Tj};class tr extends Pu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/ia.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ia.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=IM("Buffer",e,hre),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=IM("Buffer",e,fre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ia(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;rn(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Fo(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return Fo(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){Fo(this.gl);const s=Xy(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return rn((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(rn(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){rn(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=MM(e);return rn(s),this.setAccessor(new ia(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){rn(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/Xy(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ia(this.accessor,{type:MM(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return dn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return dn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return dn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return dn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ia(this.accessor,e),this}}const OM={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},Dj={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},Mj={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},mre=[9729,9728],Ij=Er.CO.WebGLBuffer||function(){};class Tg extends Pu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=OM[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=fi(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=OM[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=jc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(G=>this.initialize(Object.assign({},e,{pixels:G,data:G}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:x=!1,mipmaps:T=!0}=e;const{depth:q=0}=e;return({width:f,height:p,compressed:x,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:x,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=q,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),T&&this._isNPOT()&&(dn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),T=!1,this._updateForNPOT(l)),this.mipmaps=T,this.setImageData({data:t,width:f,height:p,depth:q,format:s,type:_,dataFormat:g,border:o,mipmaps:T,parameters:c,compressed:x}),T&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:x}=this;x.bindTexture(this.target,this.handle);let q,T=null;return({data:c,dataType:T}=this._getDataType({data:c,compressed:_})),Zl(this.gl,l,()=>{switch(T){case"null":x.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":x.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":q=Fo(x),q.bindBuffer(35052,c.handle||c),q.texImage2D(t,r,s,f,p,o,g,d,a),q.bindBuffer(35052,null);break;case"browser-object":fi(x)?x.texImage2D(t,r,s,f,p,o,g,d,c):x.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[G,ge]of c.entries())x.compressedTexImage2D(t,G,ge.format,ge.width,ge.height,o,ge.data);break;default:rn(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(Dj[this.dataFormat]||4)*(Mj[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:x={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),rn(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const T=i;i=T.data,o=T.shape[0],a=T.shape[1]}i instanceof tr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),Zl(this.gl,x,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof Ij){const T=Fo(this.gl);T.bindBuffer(35052,i),T.texSubImage2D(e,l,r,s,o,a,f,d,g),T.bindBuffer(35052,null)}else fi(this.gl)?Fo(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return dn.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof tr?{data:e.handle,dataType:"buffer"}:e instanceof Ij?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=OM[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},rn(r,"Could not deduced texture size"),rn(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),rn(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:rn(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(fi(this.gl)||!this.width||!this.height||Cj(this.width)&&Cj(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===mre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function _re(n,e){return rn("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class Aa extends Tg{static isSupported(e,t){return Tg.isSupported(e,t)}constructor(e,t={}){VE(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:_re(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const _f="EXT_color_buffer_float",Oj={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:_f,bpp:2},33327:{gl2:_f,bpp:4},34842:{gl2:_f,bpp:8},33326:{gl2:_f,bpp:4},33328:{gl2:_f,bpp:8},34836:{gl2:_f,bpp:16},35898:{gl2:_f,bpp:4}};class Dg extends Pu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=fi(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,Oj)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return rn(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&fi(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Oj[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const Lj="clear: bad arguments";function NM(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),rn(0!==o,Lj),Zl(n,s,()=>{n.clear(o)})}function kj(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function ei(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){kj(s,i,r,o,a,"next",l)}function a(l){kj(s,i,r,o,a,"throw",l)}o(void 0)})}}const PM=[34069,34070,34071,34072,34073,34074];let Cre=(()=>{class n extends Tg{constructor(t,i={}){VE(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return ei(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(PM.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),PM.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&dn.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((x,T)=>{t&&i?d.texImage2D(g,T,a,t,i,o,a,l,x):d.texImage2D(g,T,a,a,l,x)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=PM,n})();class xre extends Tg{static isSupported(e){return fi(e)}constructor(e,t={}){Fo(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Zl(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof tr&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(Dj[this.dataFormat]||4)*(Mj[this.type]||1),"Texture"),this.loaded=!0,this}}function Tre(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Ds(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function UE(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof Ds?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Tre(n),deleteFramebuffer:!0}}(n);rn(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),rn(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(Xy(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return rn(!1),0}}(t))}(o,c,r,a,l),c=c||MM(o);const x=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,x||null),f&&d.delete(),o}function FM(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=UE(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=cre({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return rn(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&dn.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){rn(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof Dg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(Ds.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&NM(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Fo(n),Zl(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:rn(!1,Lj)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return dn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return dn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return dn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return dn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return dn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return dn.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=Fo(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=qd(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?qd(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?qd(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(FM(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>dn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=FM(this,{targetMaxHeight:100});return dn.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new Aa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new Dg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new Dg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&rn(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof Dg?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:Fo(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:rn(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return fi(n)?n:null}(this.gl);t?t.readBuffer(e):rn(36064===e||1029===e,Bj),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Fo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):rn(1===e.length&&(36064===e[0]||1029===e[0]),Bj)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in jj)void 0===n.luma.caps[e]&&(n.luma.caps[e]=Uj(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Ds.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const jj={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new Aa(n,{format:6408,type:5126,dataFormat:6408}),t=new Ds(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function LM(n,e){return Vj(n,e)}function Vj(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>Uj(n,t))}function Uj(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=jj[e];let i;rn(t,e);const r=fi(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:rn(!1);return i}(n,e)),n.luma.caps[e]||dn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class kM{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},jre=(Math,1/180*Math.PI),Sr={};function Ure(n,{precision:e=Sr.precision||4}={}){return n=function(n){return Math.round(n/Sr.EPSILON)*Sr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function Yd(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Fu(n,e,t){if(Yd(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*jre,void 0)}(n)}function yf(n,e,t){return Fu(n,i=>Math.max(e,Math.min(t,i)))}function zE(n,e,t){return Yd(n)?n.map((i,r)=>zE(i,e[r],t)):t*e+(1-t)*n}function Jy(n,e,t){const i=Sr.EPSILON;t&&(Sr.EPSILON=t);try{if(n===e)return!0;if(Yd(n)&&Yd(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+Ure(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(Jj.length=n.length,i=Jj):i=Zj,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function tV(n){return n&&n[Symbol.asyncIterator]}function zM(n,e=(()=>!0)){return Array.isArray(n)?nV(n,e,[]):e(n)?[n]:[]}function nV(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function iV(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ht(ht(ht({},Cse[n.type]),e),n)):null}function rV(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function sV(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function oV(n){n.push(n.shift())}function GM(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function aV({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=GM(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const q=s;s=(G,ge)=>t._normalizeConstant(q(G,ge))}const _=p?(q,G)=>s(g,G):(q,G)=>s(g.subarray(q,q+a),G),x=n.getData({length:i}),T=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return HM({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===WE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=WE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wse}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==WE}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const T=f*a+l;for(let q=0;qd?c.set(ge,x):(e._normalizeValue(ge,q.target,0),bse({target:c,source:q.target,start:x,count:Ne}));x+=Ne*d}else e._normalizeValue(ge,c,x),x+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let WM={};function _o(n){Ni.level>0&&WM[n]&&WM[n].call(...arguments)}function Ta(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const lV="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Tse=`#version 300 es\n${lV}`;function cV(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function uV(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Tse:e>300?`#version ${e}\n${lV}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Ta(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class dV extends Pu{static isSupported(e){return fi(e)}constructor(e,t={}){Fo(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,xg(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,dn.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof tr?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Ose{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof tr?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&rn(fi(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new dV(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],rn(i[s]instanceof tr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new tr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function hV(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const nv="vs",Pse={[nv]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},qE="__LUMA_INJECT_DECLARATIONS__",fV=/void\s+main\s*\([^)]*\)\s*\{\n?/,pV=/}\n?[^{}]*$/,YM=[];function gV(n,e,t,i=!1){const r=e===nv;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),YM.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(pV,l=>a+l));break;case"fs:#decl":r||(n=n.replace(qE,a));break;case"fs:#main-start":r||(n=n.replace(fV,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(pV,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(qE,""),i&&(n=n.replace(/\}\s*$/,s=>s+Pse[e])),n}function KM(n){const e={};return Ta(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const Fse={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},YE="transform_uSize_",mV="transform_position";const Hse={10241:9728,10240:9728,10242:33071,10243:33071};class $se{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${YE}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${YE}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=UE(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Ta(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new tr(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new Ds(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters(Hse)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){rn(n instanceof Aa||n instanceof Cre||n instanceof xre);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const x=function(n,e){const t={},i=function(n){return cV(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${YE}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Ta(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(x){const{updatedLine:T,inject:q}=x;f[g]=T,c=KM([c,q]),Object.assign(a,x.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=cV(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){rn(i);const p=`${YE}${t}`;c=KM([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${mV} = transform_getPos(${p});\n gl_Position = vec4(${mV}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=KM([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||uV({version:hV(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Fse].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const XM={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function qse(n){let e=_V(n);return"object"===e?n?"type"in n?Object.assign({},n,XM[n.type]):"value"in n?(e=_V(n.value),Object.assign({type:e},n,XM[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},XM[e])}function _V(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class QM{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Ta("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=qse(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Ta(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Ta(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Qse(n){return function(n){const e={},t={};return ZM({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(vV(n))}function ZM({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof QM||(Ta("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ta(t.name,"shader module has no name"),(t=new QM(t)).dependencies=vV(t.dependencies)),t))}const JM={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},vf={};function soe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(JM).forEach(n=>{vf[n]=n});const eI={};function bV(n,e,t={}){const i=JM[e];if(Ta(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in eI)return eI[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),eI[e]=l,l}function KE(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=JM[e];Ta(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Ta(!1===r||!0===r),r}(n,t))}function Ig(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const wV=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],coe=[...wV,[Ig("attribute"),"in $1"],[Ig("varying"),"out $1"]],uoe=[...wV,[Ig("varying"),"in $1"]],EV=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],doe=[...EV,[Ig("in"),"attribute $1"],[Ig("out"),"varying $1"]],hoe=[...EV,[Ig("in"),"varying $1"]],tI="gl_FragColor",nI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,foe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function XE(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const _oe=`\n\n${qE}\n\n`,SV={[nv]:"vertex",fs:"fragment"};function CV(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Ta("string"==typeof t,"shader source must be a string");const f=i===nv,p=t.split("\n");let g=100,_="",x=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],x=p.slice(1).join("\n")):_=`#version ${g}`;const T={};r.forEach(We=>{Object.assign(T,We.getDefines())}),Object.assign(T,s);let q=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${SV[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${SV[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:soe(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return KE(n,vf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),KE(n,vf.GLSL_DERIVATIVES)&&bV(n,vf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),KE(n,vf.GLSL_FRAG_DATA)&&bV(n,vf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),KE(n,vf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(T)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const G=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),ge={},Ne={},Ge={};for(const We in a){const dt="string"==typeof a[We]?{injection:a[We],order:0}:a[We],Mt=We.match(/^(v|f)s:(#)?([\w-]+)$/);if(Mt){const Lt=Mt[3];Mt[2]?"decl"===Lt?Ne[We]=[dt]:Ge[We]=[dt]:ge[We]=[dt]}else Ge[We]=[dt]}for(const We of r){d&&We.checkDeprecations(x,d),q+=We.getModuleSource(i,g);const Mt=We.injections[i];for(const Ot in Mt){const Lt=Ot.match(/^(v|f)s:#([\w-]+)$/);if(Lt){const Jt="decl"===Lt[2]?Ne:Ge;Jt[Ot]=Jt[Ot]||[],Jt[Ot].push(Mt[Ot])}else ge[Ot]=ge[Ot]||[],ge[Ot].push(Mt[Ot])}}return q+=_oe,q=gV(q,i,Ne),q+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(G[i],ge),q+=x,q=gV(q,i,Ge),q=function(n,e,t){switch(e){case 300:return t?XE(n,coe):function(n){const e=(n=XE(n,uoe)).match(nI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${tI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(foe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${tI}\\b`,"g"),t)}return n}(n);case 100:return t?XE(n,doe):function(n){const e=(n=XE(n,hoe)).match(nI);if(e){const t=e[1];n=n.replace(nI,"").replace(new RegExp(`\\b${t}\\b`,"g"),tI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(q,l?100:g,f),q}function boe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Aoe={5126:Cr.bind(null,"uniform1fv",Da,1,yo),35664:Cr.bind(null,"uniform2fv",Da,2,yo),35665:Cr.bind(null,"uniform3fv",Da,3,yo),35666:Cr.bind(null,"uniform4fv",Da,4,yo),5124:Cr.bind(null,"uniform1iv",Kd,1,yo),35667:Cr.bind(null,"uniform2iv",Kd,2,yo),35668:Cr.bind(null,"uniform3iv",Kd,3,yo),35669:Cr.bind(null,"uniform4iv",Kd,4,yo),35670:Cr.bind(null,"uniform1iv",Kd,1,yo),35671:Cr.bind(null,"uniform2iv",Kd,2,yo),35672:Cr.bind(null,"uniform3iv",Kd,3,yo),35673:Cr.bind(null,"uniform4iv",Kd,4,yo),35674:Cr.bind(null,"uniformMatrix2fv",Da,4,ku),35675:Cr.bind(null,"uniformMatrix3fv",Da,9,ku),35676:Cr.bind(null,"uniformMatrix4fv",Da,16,ku),35678:Js,35680:Js,5125:Cr.bind(null,"uniform1uiv",QE,1,yo),36294:Cr.bind(null,"uniform2uiv",QE,2,yo),36295:Cr.bind(null,"uniform3uiv",QE,3,yo),36296:Cr.bind(null,"uniform4uiv",QE,4,yo),35685:Cr.bind(null,"uniformMatrix2x3fv",Da,6,ku),35686:Cr.bind(null,"uniformMatrix2x4fv",Da,8,ku),35687:Cr.bind(null,"uniformMatrix3x2fv",Da,6,ku),35688:Cr.bind(null,"uniformMatrix3x4fv",Da,12,ku),35689:Cr.bind(null,"uniformMatrix4x2fv",Da,8,ku),35690:Cr.bind(null,"uniformMatrix4x3fv",Da,12,ku),35678:Js,35680:Js,35679:Js,35682:Js,36289:Js,36292:Js,36293:Js,36298:Js,36299:Js,36300:Js,36303:Js,36306:Js,36307:Js,36308:Js,36311:Js},Toe={},Doe={},Moe={},xV=[0];function iI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(xV[0]=n,n=xV);const r=n.length;if(r%e&&dn.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Cr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{rn(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return MV(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:DV(s,c),warnings:DV(o,c)}}(i,this.source,this.shaderType,this.id);throw dn.error(`GLSL compilation errors in ${r}\n${s}`)(),dn.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class rI extends iv{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class sI extends iv{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Ms=5126,rv=5124,sv=5125,oI={[Ms]:[Ms,1,"float"],35664:[Ms,2,"vec2"],35665:[Ms,3,"vec3"],35666:[Ms,4,"vec4"],[rv]:[rv,1,"int"],35667:[rv,2,"ivec2"],35668:[rv,3,"ivec3"],35669:[rv,4,"ivec4"],[sv]:[sv,1,"uint"],36294:[sv,2,"uvec2"],36295:[sv,3,"uvec3"],36296:[sv,4,"uvec4"],35670:[Ms,1,"bool"],35671:[Ms,2,"bvec2"],35672:[Ms,3,"bvec3"],35673:[Ms,4,"bvec4"],35674:[Ms,8,"mat2"],35685:[Ms,8,"mat2x3"],35686:[Ms,8,"mat2x4"],35675:[Ms,12,"mat3"],35687:[Ms,12,"mat3x2"],35688:[Ms,12,"mat3x4"],35676:[Ms,16,"mat4"],35689:[Ms,16,"mat4x2"],35690:[Ms,16,"mat4x3"]};function FV(n){const e=oI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function LV(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Ms}for(const t in oI){const[i,r,s]=oI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class fae{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!fi(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=FV(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ia(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=FV(i),l={location:e,name:t,accessor:new ia({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const pae=35981,gae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class BV extends Pu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",gae),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=pae}=e;return this.hash=t||"",this.vs="string"==typeof i?new rI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new sI(this.gl,{id:`${e.id}-fs`,source:r}):r,rn(this.vs instanceof rI),rn(this.fs instanceof sI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Fo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new fae(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:x,samplers:T}){if((x||T)&&(dn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(x||{})),dn.priority>=e){const q=g?g.id:"default",G=`mode=${qd(this.gl,t)} verts=${i} instances=${c} indexType=${qd(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${q}`;dn.log(e,G)()}return rn(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const q=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return rn(!1),0}}(t);p.begin(q)}this._bindTextures(),Zl(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&fi(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){dn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Roe(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof Ds&&(s=s.texture),s instanceof Tg)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&Noe(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new rI({handle:r});break;case 35632:i.fs=new sI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=jc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),dn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),dn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||dn.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(ge=>this._getHash(ge.name)).sort(),g=o.map(ge=>this._getHash(ge)),_=Object.keys(r).sort(),x=Object.keys(s).sort(),T=[],q=[];for(const ge of _)T.push(this._getHash(ge)),T.push(this._getHash(r[ge]));for(const ge of x)q.push(this._getHash(ge)),q.push(this._getHash(s[ge]));const G=`${d}/${f}D${T.join("/")}M${p.join("/")}I${q.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[G]){const ge=function(n,e){const{vs:t,fs:i}=e,r=Qse(e.modules||[]);return{gl:n,vs:CV(n,Object.assign({},e,{source:t,type:nv,modules:r})),fs:CV(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:boe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[G]=new BV(this.gl,{hash:G,vs:ge.vs,fs:ge.fs,varyings:o,bufferMode:a}),this._getUniforms[G]=ge.getUniforms||(Ne=>{}),this._useCounts[G]=0}return this._useCounts[G]++,this._programCache[G]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":$y.chrome?"Chrome":$y.safari?"Safari":$y.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ma(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ma.MAX_ATTRIBUTES=Ma.MAX_ATTRIBUTES||e.getParameter(34921),Ma.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ma._setConstantFloatArray(e,t,i);break;case Int32Array:Ma._setConstantIntArray(e,t,i);break;case Uint32Array:Ma._setConstantUintArray(e,t,i);break;default:rn(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Ma.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return rn(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(rn(fi(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ma.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new tr(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!eS||eS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Eae=/^(.+)__LOCATION_([0-9]+)$/,Sae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Cae{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Ma(e),xj(this,"VertexArray","v6.0",Sae),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new tr(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,dn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ia.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return rn(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Eae.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof tr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof tr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof tr))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof tr){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return dn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function av(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=av(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function jV(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof tr){const p=e,{data:g,changed:_}=p.getDebugData();let x;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?x=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${qd(r,s)})`:(c=!0,x=`${l} bytes`),{[i]:`${d}${av(f,{size:o,isInteger:c})}`,"Format ":x}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${av(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Tae(n,e){const{type:t,size:i}=e,r=LV(t,i);return r?`${n} (${r.name})`:n}function VV({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){rn(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:av(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function aI({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?av(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function UV(n){const{type:e,size:t}=n.accessor,i=LV(e,t);return i?`${i.name} ${n.name}`:n.name}const Iae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rae(n,e){const{attributeMap:t=Iae}=e||{};return t&&t[n]||n}function Nae(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}rn(Number.isFinite(e.size),`attribute ${n} needs size`)}const zV=()=>{},Lae={};class tS{constructor(e,t={}){const{id:i=jc("model")}=t;rn(jE(e)),this.id=i,this.gl=e,this.id=t.id||jc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||ov.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},rn(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return rn(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return rn(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Rae(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ht({},o);delete c.value,i[a]=[new tr(n,l),c],Nae(s,c)}}if(r){const s=r.value||r;rn(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new tr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(xg(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return NM(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),dn.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&dn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:x,instanceCount:T}=this,{onBeforeRender:q=zV,onAfterRender:G=zV}=this.props;q(),this.program.setUniforms(this.uniforms);const ge=this.program.draw(Object.assign(Lae,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:x,instanceCount:T,offset:f?g:0}));return G(),dn.priority>=2&&this._logDrawCallEnd(c,l,i),ge}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return dn.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}rn(t instanceof BV,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new Cae(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof tr&&t.delete()}}_setAnimationProps(e){this.animated&&rn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(xg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new dV(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:dn.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=jV(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Tae(s.name,a)}`),t[o]=jV(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=VV({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=VV({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&dn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&dn.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${UV(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${UV(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);dn.table(e,s)(),dn.table(e,o)(),dn.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),dn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class lI{static isSupported(e){return fi(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();rn(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new tS(t,Object.assign({},e,{fs:e.fs||uV({version:hV(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(xg(n.feedbackBuffers)&&xg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Ose(e,t)),function(n){return!(xg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new $se(e,t)),rn(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function nS(){}const jae={onStart:nS,onUpdate:nS,onInterrupt:nS,onEnd:nS};class lv{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ht(ht({},jae),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const qae={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new lv(i),this.attribute=t,this.attributeInTransition=new $M(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=sV(e.size);return new lI(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new tr(e,r),new tr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;oV(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)aV(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=GM(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:rV(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new lv(i),this.attribute=t,this.attributeInTransition=new $M(e,Vn(ht({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new Aa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new Ds(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=sV(e.size);return new lI(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new tr(e,r),new tr(e,r),new tr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)aV(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=GM(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:rV(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),oV(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),UE(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class Yae{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=lI.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Ni.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=qae[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ni.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const HV="attributeManager.invalidate";class ele{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new Yae(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;_o("attribute.updateStart",t),t.allocate(i)&&_o("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,_o("attribute.updateEnd",t,i))}}function $V(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function WV(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=iV(r)))return;const o=rle[r.type];if(!o)return void Ni.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Vn(ht({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const iS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:ole}=iS;function cle(n,e){if(!n.transitions)return null;const t={},i=uI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&cI(n[r],e[r],s)&&(t[r]=!0)}return t}function qV({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=cI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=cI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function cI(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function hle(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!yle(i[r],e[r])){t=n(i),e=i;break}return t}}function vle(n,e){if(!e)return n;const t=ht(ht({},n),e);if("defines"in e&&(t.defines=ht(ht({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=ht({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function sS(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],x=e[13],T=e[14],q=e[15],G=t*a-i*o,ge=t*l-r*o,Ne=t*c-s*o,Ge=i*l-r*a,We=i*c-s*a,dt=r*c-s*l,Mt=d*x-f*_,Ot=d*T-p*_,Lt=d*q-g*_,Qt=f*T-p*x,Jt=f*q-g*x,wt=p*q-g*T,Ct=G*wt-ge*Jt+Ne*Qt+Ge*Lt-We*Ot+dt*Mt;return Ct?(n[0]=(a*wt-l*Jt+c*Qt)*(Ct=1/Ct),n[1]=(r*Jt-i*wt-s*Qt)*Ct,n[2]=(x*dt-T*We+q*Ge)*Ct,n[3]=(p*We-f*dt-g*Ge)*Ct,n[4]=(l*Lt-o*wt-c*Ot)*Ct,n[5]=(t*wt-r*Lt+s*Ot)*Ct,n[6]=(T*Ne-_*dt-q*ge)*Ct,n[7]=(d*dt-p*Ne+g*ge)*Ct,n[8]=(o*Jt-a*Lt+c*Mt)*Ct,n[9]=(i*Lt-t*Jt-s*Mt)*Ct,n[10]=(_*We-x*Ne+q*G)*Ct,n[11]=(f*Ne-d*We-g*G)*Ct,n[12]=(a*Ot-o*Qt-l*Mt)*Ct,n[13]=(t*Qt-i*Ot+r*Mt)*Ct,n[14]=(x*ge-_*Ge-T*G)*Ct,n[15]=(d*Ge-f*ge+p*G)*Ct,n):null}function Vc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],x=e[12],T=e[13],q=e[14],G=e[15],ge=t[0],Ne=t[1],Ge=t[2],We=t[3];return n[0]=ge*i+Ne*a+Ge*f+We*x,n[1]=ge*r+Ne*l+Ge*p+We*T,n[2]=ge*s+Ne*c+Ge*g+We*q,n[3]=ge*o+Ne*d+Ge*_+We*G,n[4]=(ge=t[4])*i+(Ne=t[5])*a+(Ge=t[6])*f+(We=t[7])*x,n[5]=ge*r+Ne*l+Ge*p+We*T,n[6]=ge*s+Ne*c+Ge*g+We*q,n[7]=ge*o+Ne*d+Ge*_+We*G,n[8]=(ge=t[8])*i+(Ne=t[9])*a+(Ge=t[10])*f+(We=t[11])*x,n[9]=ge*r+Ne*l+Ge*p+We*T,n[10]=ge*s+Ne*c+Ge*g+We*q,n[11]=ge*o+Ne*d+Ge*_+We*G,n[12]=(ge=t[12])*i+(Ne=t[13])*a+(Ge=t[14])*f+(We=t[15])*x,n[13]=ge*r+Ne*l+Ge*p+We*T,n[14]=ge*s+Ne*c+Ge*g+We*q,n[15]=ge*o+Ne*d+Ge*_+We*G,n}function cv(n,e,t){var o,a,l,c,d,f,p,g,_,x,T,q,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],x=e[9],T=e[10],q=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=x,n[10]=T,n[11]=q,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+x*s+e[13],n[14]=l*i+p*r+T*s+e[14],n[15]=c*i+g*r+q*s+e[15]),n}function uv(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function KV(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function XV(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function QV(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function ZV(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],x=n[13],T=n[14],q=n[15],G=e[0],ge=e[1],Ne=e[2],Ge=e[3],We=e[4],dt=e[5],Mt=e[6],Ot=e[7],Lt=e[8],Qt=e[9],Jt=e[10],wt=e[11],Ct=e[12],Ht=e[13],ft=e[14],Kt=e[15];return Math.abs(t-G)<=hr*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(i-ge)<=hr*Math.max(1,Math.abs(i),Math.abs(ge))&&Math.abs(r-Ne)<=hr*Math.max(1,Math.abs(r),Math.abs(Ne))&&Math.abs(s-Ge)<=hr*Math.max(1,Math.abs(s),Math.abs(Ge))&&Math.abs(o-We)<=hr*Math.max(1,Math.abs(o),Math.abs(We))&&Math.abs(a-dt)<=hr*Math.max(1,Math.abs(a),Math.abs(dt))&&Math.abs(l-Mt)<=hr*Math.max(1,Math.abs(l),Math.abs(Mt))&&Math.abs(c-Ot)<=hr*Math.max(1,Math.abs(c),Math.abs(Ot))&&Math.abs(d-Lt)<=hr*Math.max(1,Math.abs(d),Math.abs(Lt))&&Math.abs(f-Qt)<=hr*Math.max(1,Math.abs(f),Math.abs(Qt))&&Math.abs(p-Jt)<=hr*Math.max(1,Math.abs(p),Math.abs(Jt))&&Math.abs(g-wt)<=hr*Math.max(1,Math.abs(g),Math.abs(wt))&&Math.abs(_-Ct)<=hr*Math.max(1,Math.abs(_),Math.abs(Ct))&&Math.abs(x-Ht)<=hr*Math.max(1,Math.abs(x),Math.abs(Ht))&&Math.abs(T-ft)<=hr*Math.max(1,Math.abs(T),Math.abs(ft))&&Math.abs(q-Kt)<=hr*Math.max(1,Math.abs(q),Math.abs(Kt))}function JV(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function oS(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new ra(4);ra!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const eU=[0,0,0,0],$le=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Wle=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],qle=[0,0,0],Yle=[0,0,0],Kle=rS(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=eU,l=eU,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=tU(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=oS([],l,o),s=i||s,o=Vc([],r,s),o=Vc([],o,$le)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:qle,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Mi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Mi.LNGLAT:case Mi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Mi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function tU(n,e,t=Yle){let r,i=t,s=!0;switch(r=e===Mi.LNGLAT_OFFSETS||e===Mi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case kc.WEB_MERCATOR:(e===Mi.LNGLAT||e===Mi.CARTESIAN)&&(s=!1);break;case kc.WEB_MERCATOR_AUTO_OFFSET:e===Mi.LNGLAT?i=r:e===Mi.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case kc.IDENTITY:i=n.position.map(Math.fround);break;case kc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class Jle extends BM{get ELEMENTS(){return Lu(!1),0}get RANK(){return Lu(!1),0}toString(){let e="[";if(Sr.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new Gn).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return QV(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],x=n[14],T=n[15];return(e*o-t*s)*(f*T-p*x)-(e*a-i*s)*(d*T-p*_)+(e*l-r*s)*(d*x-f*_)+(t*a-i*o)*(c*T-p*g)-(t*l-r*o)*(c*x-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return sS(this,this),this.check()}multiplyLeft(e){return Vc(this,e,this),this.check()}multiplyRight(e){return Vc(this,this,e),this.check()}rotateX(e){return KV(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return XV(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,x,T,q,G,ge,Ne,Ge,We,dt,Mt,Ot,Lt,Qt,Jt,wt,Ct,Ht,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*tc+ec)/(2*ec),512*(ec+Math.log(Math.tan(sU+e*tc*.5)))/(2*ec)]}function Xd([n,e]){const t=n/512*(2*ec)-ec,i=2*(Math.atan(Math.exp(e/512*(2*ec)-ec))-sU);return[t*fI,i*fI]}function lS({latitude:n,longitude:e,highPrecision:t=!1}){Bu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*tc),o=512/360,a=o/s,l=512/pI/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=tc*Math.tan(n*tc)/s,f=512/pI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function aU(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=lS({longitude:t,latitude:i,highPrecision:!0}),d=Bg(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Xd(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function lU({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return cv(o,o,[0,0,-i]),KV(o,o,-e*tc),XV(o,o,t*tc),uv(o,o,[r/=n,r,r]),s&&cv(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function cU({width:n,height:e,fovy:t=cS(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=cS(i));const a=.5*t*tc,l=uU(t),c=r*tc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function cS(n){return 2*Math.atan(.5/n)*fI}function uU(n){return.5/Math.tan(.5*n*tc)}function gI(n,e){const[t,i,r=0]=n;return Bu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),kg(e,[t,i,r,1])}function bf(n,e,t=0){const[i,r,s]=n;if(Bu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return kg(e,[i,r,s,1]);const o=kg(e,[i,r,0,1]),a=kg(e,[i,r,1,1]),l=o[2],c=a[2];return nU([],o,a,l===c?0:((t||0)-l)/(c-l))}function dU({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Bu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new uS({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],x=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Bu(x[0]>0&&x[1]>0);const T=x[0]/_[0],q=x[1]/_[1],Ge=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/T,(g[1]+p[1])/2+(s.bottom-s.top)/2/q]),We=Math.min(r,f.zoom+hI(Math.abs(Math.min(T,q))));return Bu(Number.isFinite(We)),{longitude:Ge[0],latitude:Ge[1],zoom:We}}const hU=Math.PI/180;function fU(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*hU:Math.atan(.5/n.altitude))>(90-n.pitch)*hU-.01?(l=pU(n,0,e),c=pU(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function pU(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=kg(i,[e,0,1,1]),s=kg(i,[e,n.height,1,1]),c=Xd(nU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class uS{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=cS(l=1.5):null===c?c=cS(l):null===l&&(l=uU(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=lS({longitude:r,latitude:i}),x=Bg([r,i]);x[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(x,x,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=cU({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return QV([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=lU({height:t,scale:g,center:x,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=x,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Vc(s,s,i),Vc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];uv(o,o,[e/2,-t/2,1]),cv(o,o,[1,-1,0]),Vc(o,o,s);const a=sS([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof uS&&e.width===this.width&&e.height===this.height&&ZV(e.projectionMatrix,this.projectionMatrix)&&ZV(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=gI(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=bf([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Bg(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=Xd(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Bg(e)}unprojectFlat(e){return Xd(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=bf(t,this.pixelUnprojectionMatrix),s=Fg([],Bg(e),dI([],i));return Xd(Fg([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=dU(Object.assign({width:i,height:r,bounds:e},t));return new uS({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return fU(this,e.z||0)}}const dce=Math.PI/180,hce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],mI=[0,0,0],pce={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let jg=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?kc.WEB_MERCATOR:kc.WEB_MERCATOR_AUTO_OFFSET:kc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Jy(t.projectionMatrix,this.projectionMatrix)&&Jy(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=gI(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=bf([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Bg(t):t}unprojectFlat(t){return this.isGeospatial?Xd(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?lS({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends jg{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:x=1.5}=t;const T=Math.pow(2,s);g=g||1,_=_||1,x=Math.max(.75,x);const{fov:q,aspect:G,focalDistance:ge,near:Ne,far:Ge}=cU({width:g,height:_,pitch:o,altitude:x,nearZMultiplier:l,farZMultiplier:c});let We=lU({height:_,pitch:o,bearing:a,scale:T,altitude:x});p&&(We=(new Gn).translate([512*p,0,0]).multiplyLeft(We)),super(Vn(ht({},t),{width:g,height:_,viewMatrix:We,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:q,aspect:G,focalDistance:ge,near:Ne,far:Ge})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=x,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(Vn(ht({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return aU(t,i)}panByPosition(t,i){const r=bf(i,this.pixelUnprojectionMatrix),o=Fg([],this.projectFlat(t),dI([],r)),a=Fg([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=fU(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=dU(ht({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function _I(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof vU){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function bU(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=oS([],[o,a,l,1],t)),i){case Mi.LNGLAT:return _I([o,a,l],e,s);case Mi.LNGLAT_OFFSETS:return _I([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mi.METER_OFFSETS:return _I(aU(r,[o,a,l]),e,s);case Mi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const _ce={10241:9987,10240:9729,10242:33071,10243:33071},yI={},bce={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||fv(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>vI(n,e)},accessor:{validate(n,e){const t=dS(n);return"function"===t||t===dS(e.value)},equal:(n,e,t)=>"function"==typeof e||vI(n,e)},array:{validate:(n,e)=>e.optional&&!n||fv(n),equal:(n,e,t)=>t.compare?vI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof Aa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new Aa(t,Vn(ht({},e),{parameters:ht(ht(ht({},_ce),i),n.props.textureParameters)}));return yI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof Aa)||yI[n.id]&&(n.delete(),delete yI[n.id])}(n)}}};function vI(n,e){if(n===e)return!0;if(!fv(n)||!fv(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Nce,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Oce]||{},i=e[Ice]||e,r=e[Rce]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(tV(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return ei(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=wI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const T=_,{dataTransform:q}=i.component?i.component.props:{};a=q?q(T,a):a.concat(T),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(T){d=!0,f=T}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const x=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;x&&x(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:CU,ASYNC_RESOLVED:xU,ASYNC_DEFAULTS:Pce}=iS,Fce={};let Lce=0,kce=(()=>{class n{constructor(){this.props=Sce.apply(this,arguments),this.id=this.props.id,this.count=Lce++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[Pce])s in i[xU]?r[s]=i[xU][s]:s in i[CU]&&(r[s]=i[CU][s]);return new this.constructor(ht(ht(ht({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new SU({})}}return n.componentName="Component",n.defaultProps=Fce,n})();class Bce extends SU{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const nc=n=>"function"==typeof n,Qd=n=>null!==n&&"object"==typeof n,TU=n=>Qd(n)&&n.constructor==={}.constructor,jce=n=>n&&"function"==typeof n[Symbol.iterator],Vce=n=>n&&"function"==typeof n[Symbol.asyncIterator],gv=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Vg=n=>"undefined"!=typeof Blob&&n instanceof Blob,DU=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||Qd(n)&&nc(n.tee)&&nc(n.cancel)&&nc(n.getReader))(n)||(n=>Qd(n)&&nc(n.read)&&nc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function wf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function EI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function SI(n){var e,t;let i;return wf(n,"null loader"),wf(EI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Vn(ht({},n=n[0]),{options:ht(ht({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Uc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},CI=Uc.global||Uc.self||Uc.window||{},Wce="object"!=typeof process||"[object process]"!==String(process)||process.browser,MU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);MU&&parseFloat(MU[1]);const AI={};function qce(n){for(const e in AI)n.startsWith(e)&&(n=n.replace(e,AI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const Yce=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Kce=/^([-\w.]+\/[-\w.+]+)/;function Xce(n){const e=Kce.exec(n);return e?e[1]:n}function IU(n){const e=Yce.exec(n);return e?e[1]:""}const Qce=/\?.*/;function gS(n){if(gv(n)){const e=TI(n.url||"");return{url:e,type:Xce(n.headers.get("content-type")||"")||IU(e)}}return Vg(n)?{url:TI(n.name||""),type:n.type||""}:"string"==typeof n?{url:TI(n),type:IU(n)}:{url:"",type:""}}function Zce(n){return gv(n)?n.headers["content-length"]||-1:Vg(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function TI(n){return n.replace(Qce,"")}function OU(n){return DI.apply(this,arguments)}function DI(){return(DI=ei(function*(n){if(gv(n))return n;const e={},t=Zce(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=gS(n);r&&(e["content-type"]=r);const s=yield tue(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function Jce(n){return MI.apply(this,arguments)}function MI(){return(MI=ei(function*(n){if(!n.ok){const e=yield eue(n);throw new Error(e)}})).apply(this,arguments)}function eue(n){return II.apply(this,arguments)}function II(){return(II=ei(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function tue(n){return OI.apply(this,arguments)}function OI(){return(OI=ei(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${nue(n.slice(0,5))}`:null})).apply(this,arguments)}function nue(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const PU={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){$n(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},sue={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function NI(){CI.loaders=CI.loaders||{};const{loaders:n}=CI;return n._state=n._state||{},n._state}const PI=()=>{const n=NI();return n.globalOptions=n.globalOptions||ht({},PU),n.globalOptions};function oue(n,e,t,i){return t=t||[],function(n,e){LU(n,null,PU,sue,e);for(const t of e)LU(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=ht({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new iue),BU(r,PI()),BU(r,e),r}(e,n,i)}function FU(n,e){const t=PI(),i=n||t;return"function"==typeof i.fetch?i.fetch:Qd(i.fetch)?r=>RU(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:RU}function LU(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&Qd(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)NU.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=lue(a,r);NU.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function lue(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function BU(n,e){for(const t in e)t in e&&(n[t]=TU(e[t])&&TU(n[t])?ht(ht({},n[t]),e[t]):e[t])}function zc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function due(n,e="3.0.12"){return zc(n,"no worker provided"),!(!e||!n.version)}const Hc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},hue=Hc.global||Hc.self||Hc.window||{},FI="object"!=typeof process||"[object process]"!==String(process)||process.browser,LI="function"==typeof importScripts,fue="undefined"!=typeof window&&void 0!==window.orientation,jU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),kI=(jU&&parseFloat(jU[1]),new Map);function VU(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function UU(n,e=!0,t){const i=t||new Set;if(n)if(zU(n))i.add(n);else if(zU(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)UU(n[r],e,i);return void 0===t?Array.from(i):[]}function zU(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const BI=()=>{};class HU{static isSupported(){return"undefined"!=typeof Worker}constructor(e){$n(this,"name",void 0),$n(this,"source",void 0),$n(this,"url",void 0),$n(this,"terminated",!1),$n(this,"worker",void 0),$n(this,"onMessage",void 0),$n(this,"onError",void 0),$n(this,"_loadableURL","");const{name:t,source:i,url:r}=e;zc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=BI,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=BI,this.onError=BI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||UU(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){zc(n.source&&!n.url||!n.source&&n.url);let e=kI.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?VU(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),kI.set(n.url,e)),n.source&&(e=VU(n.source),kI.set(n.source,e))),zc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class _ue{constructor(e,t){$n(this,"name",void 0),$n(this,"workerThread",void 0),$n(this,"isRunning",void 0),$n(this,"result",void 0),$n(this,"_resolve",void 0),$n(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zc(this.isRunning),this.isRunning=!1,this._reject(e)}}class yue{constructor(e){$n(this,"name","unnamed"),$n(this,"source",void 0),$n(this,"url",void 0),$n(this,"maxConcurrency",1),$n(this,"maxMobileConcurrency",1),$n(this,"onDebug",()=>{}),$n(this,"reuseWorkers",!0),$n(this,"props",{}),$n(this,"jobQueue",[]),$n(this,"idleQueue",[]),$n(this,"count",0),$n(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=ht(ht({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return ei(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return ei(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new _ue(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class ju{static isSupported(){return HU.isSupported()}static getWorkerFarm(e={}){return ju._workerFarm=ju._workerFarm||new ju({}),ju._workerFarm.setProps(e),ju._workerFarm}constructor(e){$n(this,"props",void 0),$n(this,"workerPools",new Map),this.props=ht({},vue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ht(ht({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new yue({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function wue(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return zc(r),r}function Eue(n,e){return!!ju.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Sue(n,e,t,i,r){return jI.apply(this,arguments)}function jI(){return(jI=ei(function*(n,e,t,i,r){const s=n.id,o=wue(n,t),l=ju.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Cue.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Cue(n,e,t,i){return VI.apply(this,arguments)}function VI(){return(VI=ei(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}$n(ju,"_workerFarm",void 0);var $U=tt(521);function WU(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return $U.toArrayBuffer?$U.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Due(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function qU(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Mue(n){return zI.apply(this,arguments)}function zI(){return(zI=ei(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=wI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Due(...e)})).apply(this,arguments)}const Rue=262144;function YU(n){this.wrapped=n}function mv(n){return new YU(n)}function _v(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof YU;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function GI(n){return function(){return new _v(n.apply(this,arguments))}}function $I(){return($I=GI(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(YI)}function Vue(n,e,t){return KI.apply(this,arguments)}function KI(){return(KI=ei(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return jue(n,e);if(Vg(n)&&(n=yield OU(n)),gv(n)){const r=n;return yield Jce(r),e.binary?yield r.arrayBuffer():yield r.text()}if(DU(n)&&(n=Bue(n,t)),jce(n)||Vce(n))return Mue(n);throw new Error(YI)})).apply(this,arguments)}function zue(n,e,t=null){if(t)return t;const i=ht({fetch:FU(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function Hue(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const XU=()=>{const n=NI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function QU(n){const e=XU();n=Array.isArray(n)?n:[n];for(const t of n){const i=SI(t);e.find(r=>i===r)||e.unshift(i)}}const $ue=/\.([^.]+)$/;function Wue(n){return ZI.apply(this,arguments)}function ZI(){return(ZI=ei(function*(n,e=[],t,i){if(!JU(n))return null;let r=ZU(n,e,Vn(ht({},t),{nothrow:!0}),i);if(r)return r;if(Vg(n)&&(r=ZU(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(ez(n));return r})).apply(this,arguments)}function ZU(n,e=[],t,i){if(!JU(n))return null;if(e&&!Array.isArray(e))return SI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...XU()),function(n){for(const e of n)SI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=gS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=JI(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&$ue.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||JI(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Zue(e,t))return t}else if(ArrayBuffer.isView(e)){if(tz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&tz(e,0,t))return t;return null}(e,n),a=a||JI(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(ez(n));return s}function JU(n){return!(n instanceof Response&&204===n.status)}function ez(n){const{url:e,type:t}=gS(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?eO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?eO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function JI(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Zue(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function tz(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Gc=new Uint8ClampedArray(0);const cde={data:{type:"data",value:ade,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=Vn(ht({},r),{fetch:Vn(ht({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:_S(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):_S(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mi.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let rO=(()=>{class n extends kce{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=bU(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=gI(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=ht({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Mi.DEFAULT&&(t=i.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=tU(t,i,r),f=bU(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mi.DEFAULT||t===Mi.LNGLAT||t===Mi.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){Jl(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=vle(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!lde({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Gc.length/3);if(this.internalState.usesPickingColorCache=!0,rnz&&Ni.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Gc=Zy.allocate(Gc,i,{size:3,copy:!0,maxCount:Math.max(i,nz)});const s=Math.floor(Gc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&_o("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=qV({newProps:n,oldProps:e,propTypes:uI(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&YV(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&YV(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:hle(n,e),transitionsChanged:cle(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=uI(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new ele(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){Jl(!this.internalState&&!this.state),Jl(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Bce({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ni.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new sle(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){_o("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=cde,n})(),dde=(()=>{class n extends rO{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:T,fetch:q,_subLayerProps:G}=this.props,ge={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:T,fetch:q},Ne=G&&G[t.id],Ge=Ne&&Ne.updateTriggers,We=t.id||"sublayer";if(Ne){const dt=this.constructor._propTypes,Mt=t.type?t.type._propTypes:{};for(const Ot in Ne){const Lt=Mt[Ot]||dt[Ot];Lt&&"accessor"===Lt.type&&(Ne[Ot]=this.getSubLayerAccessor(Ne[Ot]))}}Object.assign(ge,t,Ne),ge.id="".concat(this.props.id,"-").concat(We),ge.updateTriggers=ht(ht({all:this.props.updateTriggers.all},t.updateTriggers),Ge);for(const dt of T){const Mt=dt.getSubLayerProps.call(this,dt);Mt&&Object.assign(ge,Mt,{updateTriggers:Object.assign(ge.updateTriggers,Mt.updateTriggers)})}return ge}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=zM(t,Boolean),this.internalState.subLayers=t),_o("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const hde=/([0-9]+\.?[0-9]*)(%|px)/;function yS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(hde);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function vS(n,e){return n.relative?Math.round(n.position*e):n.position}function yv(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&yv(i,r)))return!1}return!0}class sO{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=jg}=e;Jl(!p||p instanceof jg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Vn(ht({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):yv(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=ht({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:vS(this._x,e),y:vS(this._y,t),width:vS(this._width,e),height:vS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ht(ht({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ht(ht(ht({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=yS(e),this._y=yS(t),this._width=yS(i),this._height=yS(r)}}const vv=()=>{},iz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:vv,onTransitionInterrupt:vv,onTransitionEnd:vv};class fde{constructor(e,t={}){this.ControllerState=e,this.props=ht(ht({},iz),t),this.propsInTransition=null,this.transition=new lv(t.timeline),this.onViewStateChange=t.onViewStateChange||vv,this.onStateChange=t.onStateChange||vv,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=ht(ht({},iz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ht(ht({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(ht(ht({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const rz=["longitude","latitude","zoom","bearing","pitch"],gde=["longitude","latitude","zoom"];class sz extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!Jy(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];Jl(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:rz,extract:rz,required:gde}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=zE(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ht(ht({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,zE(e.around,t.around,i)))}return r}}const Zd={transitionDuration:0},mde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},wS=n=>1-(1-n)*(1-n),Ug_WHEEL=["wheel"],Ug_PAN=["panstart","panmove","panend"],Ug_PINCH=["pinchstart","pinchmove","pinchend"],Ug_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Ug_DOUBLE_TAP=["doubletap"],Ug_KEYBOARD=["keydown"];class oO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new fde(e,Vn(ht({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Vn(ht({},mde),{transitionInterpolator:new sz({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Ug_WHEEL,d&&i),this.toggleEvents(Ug_PAN,d&&(r||s)),this.toggleEvents(Ug_PINCH,d&&(a||l)),this.toggleEvents(Ug_TRIPLE_PAN,d&&l),this.toggleEvents(Ug_DOUBLE_TAP,d&&o),this.toggleEvents(Ug_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=ht(ht({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,Zd,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,Vn(ht({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,Zd,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,Zd,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,Zd,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,Vn(ht({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?Vn(ht({},t),{transitionInterpolator:new sz(Vn(ht({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:Zd}}class oz{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const Jd_target=[0,0,0];class ES extends oz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=Jd_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:T,startZoom:q}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:T,startZoom:q},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(Vn(ht({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ht({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),yf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new ES(ht(ht(ht({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=yf(r,i,t),e.rotationX=yf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class yde extends oO{constructor(e){super(ES,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class vde extends oO{constructor(e){e.dragMode=e.dragMode||"pan",super(ES,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const bde=(new Gn).lookAt({eye:[0,0,1]});function wde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new Gn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Ede extends jg{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(Vn(ht({},e),{longitude:null,position:a,viewMatrix:bde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:wde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Fg([],e,dI([],bf(t,this.pixelUnprojectionMatrix)));return{target:Fg([],this.center,r)}}}let Sde=(()=>{class n extends sO{constructor(t){super(Vn(ht({},t),{type:Ede}))}get controller(){return this._getControllerProps({type:vde})}}return n.displayName="OrthographicView",n})();const SS=Math.PI/180;function Cde({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*SS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new Gn).lookAt({eye:l,up:a});c.rotateX(i*SS),"Z"===t?c.rotateZ(r*SS):c.rotateY(r*SS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class xde extends jg{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(Vn(ht({},e),{longitude:null,viewMatrix:Cde({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=bf([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let Ade=(()=>{class n extends sO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Vn(ht({},t),{orbitAxis:i,type:xde}))}get controller(){return this._getControllerProps({type:yde})}}return n.displayName="OrbitView",n})();const Tde=[255,255,255],Dde=1;let Mde=0;class az{constructor(e={}){const{color:t=Tde}=e,{intensity:i=Dde}=e;this.id=e.id||"ambient-".concat(Mde++),this.color=t,this.intensity=i,this.type="ambient"}}const Ide=[255,255,255],Ode=1,Rde=[0,0,-1];let Nde=0;class lz{constructor(e={}){const{color:t=Ide}=e,{intensity:i=Ode}=e,{direction:r=Rde}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Nde++),this.color=t,this.intensity=i,this.type="directional",this.direction=new mo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class cz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ht({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class aO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ht({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Nu(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Nu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=uz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dNM(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Nu(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||uz(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class kde extends aO{constructor(e,t){super(e,t),this.shadowMap=new Aa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new Dg(e,{format:33189,width:1,height:1}),this.fbo=new Ds(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;Zl(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=Cg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Vn(ht({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const jde=Object.keys(Mi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Mi[n],";")).join(""),Vde=Object.keys(kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(kc[n],";")).join(""),Ude="".concat(jde,"\n").concat(Vde,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),zde={},lO={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:Ude,getUniforms:function(n=zde){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Mi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mi.DEFAULT&&(i=n.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN);const o=Kle({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||Wle,o}(n):{}}},Wde=rS(function({viewport:n,center:e}){return new Gn(n.viewProjectionMatrix).invert().transform(e)}),qde=rS(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=bf([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new mo(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new Gn).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),Yde=[0,0,0,1],Kde=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],cO={name:"shadow",dependencies:[lO],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||Yde,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=Wde({viewport:n.viewport,center:e.project_uCenter}),r=[],s=qde({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},ehe={color:[255,255,255],intensity:1},dz=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],the=[0,0,0,200/255];class uO extends cz{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=the,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=ov.getDefaultProgramManager(e),cO&&this.programManager.addDefaultModule(cO)),this.dummyShadowMap||(this.dummyShadowMap=new Aa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(cO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new Gn).lookAt({eye:new mo(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=ihe++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class rhe{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=_S(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class she{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new rhe(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const ohe=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},lO],ahe=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function lhe(n){const e=ov.getDefaultProgramManager(n);for(const t of ohe)e.addDefaultModule(t);for(const t of ahe)e.addShaderHook(t);return e}const dhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class hhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new she({gl:e,protocol:"deck://"}),this.context=Vn(ht({},dhe),{layerManager:this,gl:e,deck:t,programManager:e&&lhe(e),stats:i||new AM({id:"deck.gl"}),viewport:r||new jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new hz,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){_o("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=zM(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return _o("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Ni.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Ni.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class fhe{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=zM(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!yv(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ni.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(ht({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=Vn(ht(ht(ht({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class ghe extends oz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:x,startRotatePos:T,startBearing:q,startPitch:G,startZoom:ge,normalize:Ne}={}){Jl(Number.isFinite(s)),Jl(Number.isFinite(r)),Jl(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:Ne}),this._state={startPanLngLat:_,startZoomLngLat:x,startRotatePos:T,startBearing:q,startPitch:G,startZoom:ge},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(Vn(ht({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(Vn(ht({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ht({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(ht(ht(ht({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=yf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=yf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=rU(t+180,360)-180),(o<-180||o>180)&&(o=rU(o+180,360)-180);const a=hI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Xd([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return yf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=yf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class mhe extends oO{constructor(e){e.dragMode=e.dragMode||"pan",super(ghe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let _he=(()=>{class n extends sO{constructor(t){super(Vn(ht({},t),{type:vU}))}get controller(){return this._getControllerProps({type:mhe})}}return n.displayName="MapView",n})();const yhe=new uO;class vhe{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!yv(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof uO)||this._internalEffects.push(yhe)}}class bhe extends aO{}const pz={blendFunc:[1,0,32771,0],blendEquation:32774};class gz extends aO{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,Zl(_,Vn(ht({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},pz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Vn(ht({},pz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ht(ht({},e.props.parameters),i)}}class Ehe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new bhe(e),this.pickLayersPass=new gz(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Ds.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Vn(ht({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,_o("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new Ds(this.gl),new Ds(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const She={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Che({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let T=0;T=0){const G=T+o-t,ge=G*G+x;ge<=d&&(d=ge,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),x=e[g];if(x){const T=x.decodePickingColor(_),q=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:x,pickedObjectIndex:T,pickedX:o+(f/4-q*l),pickedY:a+q}}Ni.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return She}function mz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Ahe(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(x=>x.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=mz(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=ht({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=_z({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function _z({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Dhe{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new gz(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?ht(ht({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Ds(e),Ds.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Ds(e),this.depthFBO.attach({36064:new Aa(e,{format:fi(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Ni.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:mz({viewports:i,x:r,y:s})};this._resizeBuffer();const f=Cg(this.gl),p=SM(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:x,height:T}=this.pickingFBO,q=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:x,deviceHeight:T});let G;const ge=[],Ne={};for(let Ge=0;Ge=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Ni.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:q,width:x.x+x.width-g,height:_-q},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Ge=new Map,We=Number.isFinite(c);for(let dt=0;dt=c);dt++){const Mt=Ne[dt];let Ot={color:Mt.pickedColor,layer:null,index:Mt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};Ot=_z({layer:Mt.pickedLayer,info:Ot,mode:l}),Ge.has(Ot.object)||Ge.set(Ot.object,Ot)}return Array.from(Ge.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return UE(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Mhe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Ihe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Mhe),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function yz(n,e){if(!n)throw new Error(e)}const $c={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},vz=$c.global||$c.self||$c.window,Rhe="object"!=typeof process||"[object process]"!==String(process)||process.browser,bz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:Nhe}=(bz&&parseFloat(bz[1]),vz),dO="undefined"!=typeof Image,hO="undefined"!=typeof ImageBitmap,Phe=Boolean(Nhe),fO=!!Rhe||Phe;function wz(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function Ez(n){switch(wz(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const khe=/^data:image\/svg\+xml/,Bhe=/\.svg((\?|#).*)?$/;function pO(n){return n&&(khe.test(n)||Bhe.test(n))}function jhe(n,e){if(pO(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return Cz(n,e)}function Cz(n,e){if(pO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function xz(n,e,t){return gO.apply(this,arguments)}function gO(){return(gO=ei(function*(n,e,t){const i=jhe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield Vhe(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function Vhe(n,e){return mO.apply(this,arguments)}function mO(){return(mO=ei(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const Uhe={};let Az=!0;function zhe(n,e,t){return _O.apply(this,arguments)}function _O(){return(_O=ei(function*(n,e,t){let i;i=pO(t)?yield xz(n,e,t):Cz(n,t);const r=e&&e.imagebitmap;return yield Hhe(i,r)})).apply(this,arguments)}function Hhe(n){return yO.apply(this,arguments)}function yO(){return(yO=ei(function*(n,e=null){if((Ghe(e)||!Az)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),Az=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function Ghe(n){for(const e in n||Uhe)return!1;return!0}const Wc=!1,bv=!0;function vO(n){const e=wv(n);return function(n){const e=wv(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Wc)?{mimeType:"image/png",width:e.getUint32(16,Wc),height:e.getUint32(20,Wc)}:null}(e)||function(n){const e=wv(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Wc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Wc)?{mimeType:"image/gif",width:e.getUint16(6,bv),height:e.getUint16(8,bv)}:null}(e)||function(n){const e=wv(n);return e.byteLength>=14&&16973===e.getUint16(0,Wc)&&e.getUint32(2,bv)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,bv),height:e.getUint32(22,bv)}:null}(e)}function wv(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function Xhe(n,e){const{mimeType:t}=vO(n)||{},{_parseImageNode:i}=vz;return yz(i),i(n,t,e)}function bO(){return(bO=ei(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(Zhe(r)){case"imagebitmap":a=yield zhe(n,e,s);break;case"image":a=yield xz(n,e,s);break;case"data":a=yield Xhe(n,e);break;default:yz(!1)}return"data"===r&&(a=Ez(a)),a})).apply(this,arguments)}function Zhe(n){switch(n){case"auto":case"data":return function(){if(hO)return"imagebitmap";if(dO)return"image";if(fO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return hO||dO||fO;case"imagebitmap":return hO;case"image":return dO;case"data":return fO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const Tz={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return bO.apply(this,arguments)},tests:[n=>Boolean(vO(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},efe={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},Ev="8.5.8",CS=Er.CO.deck&&Er.CO.deck.VERSION;if(CS&&CS!==Ev)throw new Error("deck.gl - multiple versions detected: ".concat(CS," vs ").concat(Ev));CS||(Ni.log(1,"deck.gl ".concat(Ev))(),Er.CO.deck=Object.assign(Er.CO.deck||{},{VERSION:Ev,version:Ev,log:Ni,_registerLoggers:function(n){WM=n}}),QU([efe,[Tz,{imagebitmap:{premultiplyAlpha:"none"}}]]));const tfe=Er.CO.deck;class xS extends Pu{static isSupported(e,t=[]){const i=fi(e),r=Vj(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:rn(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return xS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const Dz=(0,Er.jU)()&&"undefined"!=typeof document;let dfe=0;class hfe{constructor(e={}){const{onCreateContext:t=(T=>wj(T)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=mf.get("animation-loop-"+dfe++)}=e;let{useDevicePixels:x=!0}=e;"useDevicePixelRatio"in e&&(dn.deprecated("useDevicePixelRatio","useDevicePixels")(),x=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:x}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return rn("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=xS.isSupported(this.gl,["timers"])?new xS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return ei(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return dn.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=Dz?new Promise((e,t)=>{Dz&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?xM(this.props.gl,e):this.onCreateContext(e),!jE(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Nu(n,EM)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(dn.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(dn.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Ds(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var ffe=tt(524),AS=tt.n(ffe);const pfe={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(AS().MouseInput);const yfe=AS().Manager,qc=AS(),vfe=qc?[[qc.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[qc.Rotate,{enable:!1}],[qc.Pinch,{enable:!1}],[qc.Swipe,{enable:!1}],[qc.Pan,{threshold:0,enable:!1}],[qc.Press,{enable:!1}],[qc.Tap,{event:"doubletap",taps:2,enable:!1}],[qc.Tap,{event:"anytap",enable:!1}],[qc.Tap,{enable:!1}]]:null,Oz={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},bfe={doubletap:["tap"]},wfe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},EO={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Efe={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},Rz={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Sfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",zg="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let Nz=!1;try{const n={get passive(){return Nz=!0,!0}};zg.addEventListener("test",n,n),zg.removeEventListener("test",n,n)}catch(n){}const Cfe=-1!==Sfe.indexOf("firefox"),{WHEEL_EVENTS:xfe}=EO,Fz=4.000244140625;class Dfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=xfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!Nz&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;zg.WheelEvent&&(Cfe&&e.deltaMode===zg.WheelEvent.DOM_DELTA_PIXEL&&(t/=zg.devicePixelRatio),e.deltaMode===zg.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%Fz==0&&(t=Math.floor(t/Fz)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:Mfe}=EO,Lz="pointermove",kz="pointerover",Bz="pointerout",jz="pointerleave";class Ife{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Mfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===Lz&&(this.enableMoveEvent=t),e===kz&&(this.enableOverEvent=t),e===Bz&&(this.enableOutEvent=t),e===jz&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:kz,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:Bz,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:jz,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:Lz,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Ofe}=EO,Vz="keydown";class Rfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Ofe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===Vz&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:Vz,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const zz="contextmenu";class Nfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===zz&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:zz,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Pfe={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},Hz={srcElement:"root",priority:0};class Wfe{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},Hz,i):Hz;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&Oz[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new Dfe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Ife(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Rfe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Nfe(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=bfe[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=Rz[e]||e;let c=a.get(l);c||(c=new Wfe(this),a.set(l,c),c.recognizerName=Efe[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(Rz[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=wfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Sf(){}const Gz={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:Sf,onResize:Sf,onViewStateChange:Sf,onInteractionStateChange:Sf,onBeforeRender:Sf,onAfterRender:Sf,onLoad:Sf,onError:(n,e)=>Ni.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class DS{constructor(e){e=ht(ht({},Gz),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Ni.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Er.qs)()&&Ni.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new AM({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Zy.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Ni.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ni.removed("onLayerClick","onClick")(),e.initialViewState&&!yv(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](ht({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),Jl(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new hfe({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>wj(Vn(ht(ht({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new _he({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,xM(e,{enable:!0,copyState:!0})),this.tooltip=new Ihe(this.canvas),Nu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new hz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new Yfe(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in sj)this.eventManager.on(r,this._onEvent);this.viewManager=new fhe({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new hhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new vhe,this.deckRenderer=new Ehe(e),this.deckPicker=new Dhe(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Nu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ht({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Ni.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=Vn(ht({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=sj[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=mf.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}DS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(cz)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},DS.defaultProps=Gz,DS.VERSION=tfe.VERSION;const $z={name:"project32",dependencies:[lO],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},Wz="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",Qfe={lightSources:{}};function xO({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const AO={name:"lights",vs:Wz,fs:Wz,getUniforms:function qz(n=Qfe){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?xO(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=xO(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=xO(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return qz({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},Jfe={};const tpe={name:"phong-lighting",dependencies:[AO],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=Jfe){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},ipe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},Xz=ht({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=ipe){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),Qz={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class MS{static get DRAW_MODE(){return Qz}constructor(e={}){const{id:t=jc("geometry"),drawMode:i=Qz.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?ht({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,rn(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(rn(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return rn(Number.isFinite(i)),i}}const TO=Math.PI/180,IS=new Float32Array(16),Zz=new Float32Array(12);function Jz(n,e,t){const i=e[0]*TO,r=e[1]*TO,s=e[2]*TO,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function e4(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const t4={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let x;g?(IS.set(a),x=e4(IS)):(x=Zz,Jz(x,r,s),x.set(o,9)),n.value=new Float32Array(x)}else{let x=e*n.size;const{iterable:T,objectInfo:q}=eV(i,e,t);for(const G of T){let ge;q.index++,g?(IS.set(c?a:a(G,q)),ge=e4(IS)):(ge=Zz,Jz(ge,f?r:r(G,q),d?s:s(G,q)),ge.set(p?o:o(G,q),9)),_[x++]=ge[0],_[x++]=ge[1],_[x++]=ge[2],_[x++]=ge[3],_[x++]=ge[4],_[x++]=ge[5],_[x++]=ge[6],_[x++]=ge[7],_[x++]=ge[8],_[x++]=ge[9],_[x++]=ge[10],_[x++]=ge[11]}}}};function n4(n,e){return e===Mi.CARTESIAN||e===Mi.METER_OFFSETS||e===Mi.DEFAULT&&!n.isGeospatial}function i4(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ni.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function ape(n,e){if(n.attributes)return i4(n.attributes,e),n instanceof MS?n:new MS(n);if(n.positions||n.POSITION)return i4(n,e),new MS({attributes:n});throw Error("Invalid mesh")}const lpe={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let cpe=(()=>{class n extends rO{getShaders(){const t=!fi(this.context.gl),i={};return LM(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[$z,tpe,Xz],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:t4}),this.setState({emptyTexture:new Aa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||n4(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new tS(this.context.gl,Vn(ht({},this.getShaders()),{id:this.props.id,geometry:ape(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=lpe,n})();const r4={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[AO]};class Hg{constructor(e={}){const{id:t}=e;this.id=t||jc(this.constructor.name),this.display=!0,this.position=new mo,this.rotation=new mo,this.scale=new mo(1,1,1),this.matrix=new Gn,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return rn(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return rn(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return rn(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){rn(e),t=t||this.matrix;const i=new Gn(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class Sv extends Hg{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;dn.assert(t.every(i=>i instanceof Hg),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new Gn}={}){const i=new Gn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Sv?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function s4(){var n=new ra(4);return ra!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function o4(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function a4(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var c4=JV,Cpe=function(){var n=Gj(),e=$j(1,0,0),t=$j(0,1,0);return function(i,r,s){var o=Wj(r,s);return o<-.999999?(GE(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&GE(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),o4(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(GE(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();s4(),s4(),function(){var n=new ra(9);ra!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const xpe=[0,0,0,1],Tpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dpe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function h4(n){if(!n._animation){const e=Dpe[n.componentType],t=Tpe[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return o4(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Zs(e)}get y(){return this[1]}set y(e){this[1]=Zs(e)}get z(){return this[2]}set z(e){this[2]=Zs(e)}get w(){return this[3]}set w(e){this[3]=Zs(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return Cpe(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Lu(!t),a4(this,this,e),this.check()}multiplyLeft(e,t){return Lu(!t),a4(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return c4(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=xpe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,x,T,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>hr?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-i)*p)/_,T=Math.sin(i*p)/_):(x=1-i,T=i),n[0]=x*r+T*l,n[1]=x*s+T*c,n[2]=x*o+T*d,n[3]=x*a+T*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),HE(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class Fpe{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:dn.warn(`Bad animation path ${s}`)()}rn(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){DO.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:h4(e.accessors[a]),interpolation:l,output:h4(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Fpe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class kpe extends Hg{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof tS?(this.model=e,this._setModelNodeProps(t)):this.model=new tS(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class Bpe{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},LM(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new Aa(this.gl,ht({id:e.name||e.id,parameters:ht(ht({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(dn.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function f4(n,e){return fi(n)?`#version 300 es\n${e}`:e}const zpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Hpe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Gpe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Hpe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Lpe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Sv({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new Sv({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new Gn).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new Sv({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){dn.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new Bpe(n,e);dn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new kpe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[r4],defines:a.defines,parameters:a.parameters,vs:f4(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:f4(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),dn.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new tr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ia({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:zpe[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function p4(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new Gg(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Gg(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Gg){const o=e;t=o.fields,i=y4(y4(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new Gg(s,i)}}function y4(n,e){return new Map([...n||new Map,...e||new Map])}let Or,v4,b4,w4,E4,S4,C4,x4;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(Or||(Or={}));class MO{static isNull(e){return e&&e.typeId===Or.Null}static isInt(e){return e&&e.typeId===Or.Int}static isFloat(e){return e&&e.typeId===Or.Float}static isBinary(e){return e&&e.typeId===Or.Binary}static isUtf8(e){return e&&e.typeId===Or.Utf8}static isBool(e){return e&&e.typeId===Or.Bool}static isDecimal(e){return e&&e.typeId===Or.Decimal}static isDate(e){return e&&e.typeId===Or.Date}static isTime(e){return e&&e.typeId===Or.Time}static isTimestamp(e){return e&&e.typeId===Or.Timestamp}static isInterval(e){return e&&e.typeId===Or.Interval}static isList(e){return e&&e.typeId===Or.List}static isStruct(e){return e&&e.typeId===Or.Struct}static isUnion(e){return e&&e.typeId===Or.Union}static isFixedSizeBinary(e){return e&&e.typeId===Or.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Or.FixedSizeList}static isMap(e){return e&&e.typeId===Or.Map}static isDictionary(e){return e&&e.typeId===Or.Dictionary}get typeId(){return Or.NONE}compareTo(e){return this===e}}Symbol,Symbol,v4=Symbol.toStringTag;class $g extends MO{constructor(e,t){super(),$n(this,"isSigned",void 0),$n(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Or.Int}get[v4](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class ege extends $g{constructor(){super(!0,8)}}class tge extends $g{constructor(){super(!0,16)}}class nge extends $g{constructor(){super(!0,32)}}class ige extends $g{constructor(){super(!1,8)}}class rge extends $g{constructor(){super(!1,16)}}class sge extends $g{constructor(){super(!1,32)}}b4=Symbol.toStringTag;class A4 extends MO{constructor(e){super(),$n(this,"precision",void 0),this.precision=e}get typeId(){return Or.Float}get[b4](){return"Float"}toString(){return`Float${this.precision}`}}class oge extends A4{constructor(){super(32)}}class age extends A4{constructor(){super(64)}}Symbol,Symbol,w4=Symbol.toStringTag,E4=Symbol.toStringTag,S4=Symbol.toStringTag,C4=Symbol.toStringTag,x4=Symbol.toStringTag;class lge extends MO{constructor(e,t){super(),$n(this,"listSize",void 0),$n(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Or.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[x4](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class RS{constructor(e,t,i=!1,r=new Map){$n(this,"name",void 0),$n(this,"type",void 0),$n(this,"nullable",void 0),$n(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new RS(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function T4(n,e,t){const i=t?D4(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new ege;case Uint8Array:return new ige;case Int16Array:return new tge;case Uint16Array:return new rge;case Int32Array:return new nge;case Uint32Array:return new sge;case Float32Array:return new oge;case Float64Array:return new age;default:throw new Error("array type not supported")}}(e.value);return new RS(n,new lge(e.size,new RS("value",r)),!1,i)}function D4(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const M4={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},hge={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class pge{constructor(e){$n(this,"draco",void 0),$n(this,"decoder",void 0),$n(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=D4(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=T4(o,n[o],s[o]);r.push(l)}if(t){const o=T4("indices",t);r.push(o)}return new Gg(r,i)}(l.attributes,a,l.indices);return Vn(ht({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var NS=tt(125);const NO={};function PO(n){return FO.apply(this,arguments)}function FO(){return(FO=ei(function*(n,e=null,t={}){return e&&(n=vge(n,e,t)),NO[n]=NO[n]||bge(n),yield NO[n]})).apply(this,arguments)}function vge(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:FI?t.CDN?(zc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):LI?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function bge(n){return LO.apply(this,arguments)}function LO(){return(LO=ei(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():FI?LI?importScripts(n):wge(yield(yield fetch(n)).text(),n):NS.requireFromFile&&(yield NS.requireFromFile(n))})).apply(this,arguments)}function wge(n,e){if(!FI)return NS.requireFromString&&NS.requireFromString(n,e);if(LI)return eval.call(hue,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Ege="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Sge="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Cge="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Cv;function Age(n){return kO.apply(this,arguments)}function kO(){return(kO=ei(function*(n){const e=n.modules||{};return Cv=e.draco3d?Cv||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Cv||Tge(n),yield Cv})).apply(this,arguments)}function Tge(n){return jO.apply(this,arguments)}function jO(){return(jO=ei(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield PO(Ege,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield PO(Sge,"draco",n),yield PO(Cge,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Dge(e,t)})).apply(this,arguments)}function Dge(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Vn(ht({},t),{onModuleLoaded:r=>i({draco:r})}))})}const UO=Vn(ht({},_4),{parse:function(n,e){return zO.apply(this,arguments)}});function zO(){return(zO=ei(function*(n,e){const{draco:t}=yield Age(e),i=new pge(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Av(n,e){return wf(n>=0),wf(e>0),n+(e-1)&~(e-1)}function Oge(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+Av(i.byteLength,4)}const I4=["SCALAR","VEC2","VEC3","VEC4"],Rge=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Nge=new Map(Rge),Pge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Fge={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function O4(n){return I4[n-1]||I4[0]}function R4(n){const e=Nge.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function N4(n,e){const t=Lge[n.componentType],i=Pge[n.type],s=n.count*i,o=n.count*i*Fge[n.componentType];return Ia(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const kge={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class th{constructor(e){$n(this,"gltf",void 0),$n(this,"sourceBuffers",void 0),$n(this,"byteLength",void 0),this.gltf=e||{json:ht({},kge),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return Ia(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=N4(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return Ia(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ia(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=vO(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Ia(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Av(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:O4(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:R4(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Oge(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Yge(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function Kge(n){return $O.apply(this,arguments)}function $O(){return($O=ei(function*(n){const e=new th(n),{json:t}=e;e.removeExtension(FS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,FS)})).apply(this,arguments)}function Xge(n){const e=new th(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,FS,{}),e.addExtension(FS))}function Qge(n){return WO.apply(this,arguments)}function WO(){return(WO=ei(function*(n){const e=new th(n),{json:t}=e,i=e.getExtension(Wg);i&&(e.json.lights=i.lights,e.removeExtension(Wg));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Wg);s&&(r.light=s.light),e.removeObjectExtension(r,Wg)}})).apply(this,arguments)}function Zge(n){return qO.apply(this,arguments)}function qO(){return(qO=ei(function*(n){const e=new th(n),{json:t}=e;if(t.lights){const i=e.addExtension(Wg);Ia(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Wg,i);delete e.json.lights}})).apply(this,arguments)}function Jge(n){return YO.apply(this,arguments)}function YO(){return(YO=ei(function*(n){const e=new th(n),{json:t}=e,i=e.getExtension(LS);if(i){const r=tme(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,LS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=nme(s.technique,e)),e.removeObjectExtension(s,LS)}e.removeExtension(LS)}})).apply(this,arguments)}function eme(n,e){return KO.apply(this,arguments)}function KO(){return(KO=ei(function*(n,e){})).apply(this,arguments)}function tme(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function nme(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const L4={KHR_draco_mesh_compression:gt,KHR_materials_unlit:J,KHR_lights_punctual:xt,KHR_techniques_webgl:ut};function ime(n){return XO.apply(this,arguments)}function XO(){return(XO=ei(function*(n,e={},t){for(const r in L4){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield L4[r].decode(n,e,t))}})).apply(this,arguments)}const k4={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},sme={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class ome{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new th(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,P4);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(P4)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in k4)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in k4)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=sme[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function ame(n,e={}){return(new ome).normalize(n,e)}const lme={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},gl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},ume={magFilter:gl.TEXTURE_MAG_FILTER,minFilter:gl.TEXTURE_MIN_FILTER,wrapS:gl.TEXTURE_WRAP_S,wrapT:gl.TEXTURE_WRAP_T},dme={[gl.TEXTURE_MAG_FILTER]:gl.LINEAR,[gl.TEXTURE_MIN_FILTER]:gl.NEAREST_MIPMAP_LINEAR,[gl.TEXTURE_WRAP_S]:gl.REPEAT,[gl.TEXTURE_WRAP_]:gl.REPEAT};class pme{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Ia(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=ht({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=ht({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ht({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ht({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=ht({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ht({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ht({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return cme[n]}(e.componentType),e.components=function(n){return lme[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=N4(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):dme,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return ume[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function gme(n,e){return(new pme).postProcess(n,e)}const B4=1735152710,qg=!0;function ZO(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Av(i,4)}function JO(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Av(i,4)}function Tme(n,e){return eR.apply(this,arguments)}function eR(){return(eR=ei(function*(n,e,t=0,i,r){var s,o,a,l;Dme(n,e,t,i),ame(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Mme(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Ime(n,i,r);c.push(f)}const d=ime(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?gme(n,i):n})).apply(this,arguments)}function Dme(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=B4}=t,s=i.getUint32(e,!1);return s===r||s===B4}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?p4(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?p4(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,qg),a=r.getUint32(t+8,qg);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){wf(n.header.byteLength>20);const i=e.getUint32(t+0,qg),r=e.getUint32(t+4,qg);return t+=8,wf(0===r),ZO(n,e,t,i),(t+=i)+JO(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return wf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,qg),s=e.getUint32(t+4,qg);switch(t+=8,s){case 1313821514:ZO(n,e,t,r);break;case 5130562:JO(n,e,t,r);break;case 0:i.strict||ZO(n,e,t,r);break;case 1:i.strict||JO(n,e,t,r)}t+=Av(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),Ia("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Ia(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Mme(n,e,t){return tR.apply(this,arguments)}function tR(){return(tR=ei(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield Pme(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function Pme(n){return oR.apply(this,arguments)}function oR(){return(oR=ei(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const j4=[255,255,255,255],kme={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:j4},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Yg]};let Bme=(()=>{class n extends rO{getShaders(){const t=[$z,Xz];return"pbr"===this.props._lighting&&t.push(r4),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:j4,transition:!0},instanceModelMatrix:t4})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Hg)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Gpe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ht({gltf:l},c),function(n){return sR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ni.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Hg?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ni.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Ni.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Hg&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:ht({isInstanced:!0,transpileToGLSL100:!fi(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:n4(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=kme,n})();const jme=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Vme=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),Ume=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),zme=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Hme={POSITION:{size:3,value:new Float32Array(Vme)},NORMAL:{size:3,value:new Float32Array(Ume)},TEXCOORD_0:{size:2,value:new Float32Array(zme)}};class Gme extends MS{constructor(e={}){const{id:t=jc("cube-geometry")}=e;super(Vn(ht({},e),{id:t,indices:{size:1,value:new Uint16Array(jme)},attributes:ht(ht({},Hme),e.attributes)}))}}class Yc{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new le){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new le){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new le){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new le){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new le){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new le){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new le){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=Wme,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=qme;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(V4),V4.almostEquals(e,t)}clone(){return new le(this.x,this.y,this.z)}}le.ZERO=void 0,le.UNIT_X=void 0,le.UNIT_Y=void 0,le.UNIT_Z=void 0,le.ZERO=new le(0,0,0),le.UNIT_X=new le(1,0,0),le.UNIT_Y=new le(0,1,0),le.UNIT_Z=new le(0,0,1);const Wme=new le,qme=new le,V4=new le;class ar{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new le,this.upperBound=new le,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=z4;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=z4;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const U4=new le,z4=[new le,new le,new le,new le,new le,new le,new le,new le];class is{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new le){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=Kme;e.tangents(i,Xme),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(gr(e.length(),2)*gr(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new is){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new is){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new is){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new le){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new is(this.x,this.y,this.z,this.w)}slerp(e,t,i=new is){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,x,T,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-t)*p)/_,T=Math.sin(t*p)/_):(x=1-t,T=t),i.x=x*r+T*l,i.y=x*s+T*c,i.z=x*o+T*d,i.w=x*a+T*f,i}integrate(e,t,i,r=new is){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const Kme=new le,Xme=new le,Qme={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let hn=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=Qme,n})();class Pi{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new is,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Pi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Pi.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new le){return i.vsub(e,r),t.conjugate(G4),G4.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new le){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new le){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new le){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const G4=new is;class Cf extends hn{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:hn.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new le;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=x,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,d=new le,f=new le,p=new le,g=new le,_=new le;let x=Number.MAX_VALUE;const T=this;if(T.uniqueAxes)for(let q=0;q!==T.uniqueAxes.length;q++){i.vmult(T.uniqueAxes[q],c);const G=T.testSepAxis(c,e,t,i,r,s);if(!1===G)return!1;G0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){Cf.project(this,e,i,r,aR),Cf.project(t,e,s,o,lR);const l=aR[0],c=aR[1],d=lR[0],f=lR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?fn.STATIC:fn.DYNAMIC,typeof e.type==typeof fn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=fn.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new le,this.quaternion=new is,this.initQuaternion=new is,this.previousQuaternion=new is,this.interpolatedQuaternion=new is,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new le,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new le,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new le,this.invInertia=new le,this.invInertiaWorld=new Yc,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new Yc,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new le(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new le(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new ar,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new le,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=fn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===fn.SLEEPING&&this.dispatchEvent(fn.wakeupEvent)}sleep(){this.sleepState=fn.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=gr(this.sleepSpeedLimit,2);t===fn.AWAKE&&ir?this.wakeUp():t===fn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(fn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===fn.SLEEPING||this.type===fn.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new le){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new le){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new le,s=new is;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=e_e,o=t_e,a=this.quaternion,l=this.aabb,c=n_e;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=i_e,r=r_e;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==fn.DYNAMIC)return;this.sleepState===fn.SLEEPING&&this.wakeUp();const i=s_e;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==fn.DYNAMIC)return;const i=o_e,r=a_e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===fn.DYNAMIC&&(this.sleepState===fn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==fn.DYNAMIC)return;this.sleepState===fn.SLEEPING&&this.wakeUp();const i=t,r=l_e;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=c_e;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==fn.DYNAMIC)return;const i=u_e,r=d_e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=h_e;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),BS.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new le;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==fn.DYNAMIC&&this.type!==fn.KINEMATIC||this.sleepState===fn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,x=this.angularFactor,T=l.x*x.x,q=l.y*x.y,G=l.z*x.z;s.x+=e*(_[0]*T+_[1]*q+_[2]*G),s.y+=e*(_[3]*T+_[4]*q+_[5]*G),s.z+=e*(_[6]*T+_[7]*q+_[8]*G),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}fn.idCounter=0,fn.COLLIDE_EVENT_NAME="collide",fn.DYNAMIC=1,fn.STATIC=2,fn.KINEMATIC=4,fn.AWAKE=0,fn.SLEEPY=1,fn.SLEEPING=2,fn.wakeupEvent={type:"wakeup"},fn.sleepyEvent={type:"sleepy"},fn.sleepEvent={type:"sleep"};const e_e=new le,t_e=new is,n_e=new ar,i_e=new Yc,r_e=new Yc,s_e=new le,o_e=new le,a_e=new le,l_e=new le,c_e=new le,u_e=new le,d_e=new le,h_e=new le;new le,new le;class jS{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new le,this.rayToWorld=new le,this.hitNormalWorld=new le,this.hitPointWorld=new le,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let $4,W4,q4,Y4,K4,X4,Q4;$4=hn.types.SPHERE,W4=hn.types.PLANE,q4=hn.types.BOX,Y4=hn.types.CYLINDER,K4=hn.types.CONVEXPOLYHEDRON,X4=hn.types.HEIGHTFIELD,Q4=hn.types.TRIMESH;class ds{get[$4](){return this._intersectSphere}get[W4](){return this._intersectPlane}get[q4](){return this._intersectBox}get[Y4](){return this._intersectConvex}get[K4](){return this._intersectConvex}get[X4](){return this._intersectHeightfield}get[Q4](){return this._intersectTrimesh}constructor(e=new le,t=new le){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new le,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=ds.ANY,this.result=new jS,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||ds.ANY,this.result=t.result||new jS,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Z4),hR.length=0,e.broadphase.aabbQuery(e,Z4,hR),this.intersectBodies(hR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=v_e,s=b_e;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new le(0,0,1);t.vmult(c,c);const d=new le;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;T>=0&&T<=1&&(o.lerp(a,T,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=x_e,l=e8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,T=_.distanceTo(this.to),q=c?c.length:d.length,G=this.result;for(let ge=0;!G.shouldStop&&geT||this.reportIntersection(a,sa,s,r,Ne)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=A_e,l=R_e,c=N_e,d=e8,f=T_e,p=D_e,g=M_e,_=O_e,x=I_e,T=e.indices,q=this.from,G=this.to,ge=this.direction;c.position.copy(i),c.quaternion.copy(t),Pi.vectorToLocalFrame(i,t,ge,f),Pi.pointToLocalFrame(i,t,q,p),Pi.pointToLocalFrame(i,t,G,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const Ne=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Ge=0,We=l.length;!this.result.shouldStop&&Ge!==We;Ge++){const dt=l[Ge];e.getNormal(dt,a),e.getVertex(T[3*dt],ic),ic.vsub(p,d);const Mt=f.dot(a),Ot=a.dot(d)/Mt;if(Ot<0)continue;f.scale(Ot,sa),sa.vadd(p,sa),e.getVertex(T[3*dt+1],Xc),e.getVertex(T[3*dt+2],Qc);const Lt=sa.distanceSquared(p);!ds.pointInTriangle(sa,Xc,ic,Qc)&&!ds.pointInTriangle(sa,ic,Xc,Qc)||Lt>Ne||(Pi.vectorToWorldFrame(t,a,x),Pi.pointToWorldFrame(i,t,sa,_),this.reportIntersection(x,_,s,r,dt))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case ds.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case ds.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var Mf=tt(517);function Zg(n,e,t){e||(e=new Gn(Gn.IDENTITY));const i=new Gn(Gn.IDENTITY);if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new Gn(Gn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new Gn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===Zg(s,r,t))return!1;return!0}function $8(){QU([_4,Yg])}function W8(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||Zg(r,new Gn(Gn.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function mR(n,e){return or(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield mS(i,Yg,{DracoLoader:UO,gltf:{decompressMeshes:!0,postProcess:!0}});return W8(n.scenegraphNode,r)})}function Pbe(n,e){return or(this,void 0,void 0,function*(){return W8(n,yield e)})}function _R(n,e,t){if(e&&0!==e.length)return new cpe(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mi.CARTESIAN,data:e,mesh:new Gme,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let Lbe=(()=>{class n extends dde{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),$8()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){or(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new Gn(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new ar({lowerBound:new le(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new le(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield _S(o.scenegraph,Yg,{DracoLoader:UO,decompress:!0,postProcess:!0});for(const l of a.scenes)Zg(l,new Gn(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new ar({lowerBound:new le(...p.map((_,x)=>Math.min(_,g[x]))),upperBound:new le(...g.map((_,x)=>Math.max(_,p[x])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=mR({scenegraph:l.scenegraph},n.gltfCache));return[_R("cubes",i,{wireframe:!1,pickable:!1}),_R("pickableCubes",r,{wireframe:!1,pickable:!0}),_R("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new Bme({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Mi.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?Pbe(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function q8(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),q8(t,e);return e}let Bbe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new Lbe({}),this.nodeClickSubject=new ee,this.nodeHoverStartSubject=new ee,this.nodeHoverStopSubject=new ee,this.sceneRotationSubject=new Ir([0,0]),this.nodeDragStartSubject=new ee,this.nodeDragSubject=new ee,this.nodeDragEndSubject=new ee,this.nodeClick$=this.nodeClickSubject.pipe(ps()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ps()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ps()),this.sceneRotation$=this.sceneRotationSubject.pipe(ps()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ps()),this.nodeDrag$=this.nodeDragSubject.pipe(ps()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ps());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Sde({flipY:!1,near:-1e3}):new Ade({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new uO({ambientLight:new az({color:[255,255,255],intensity:10})})]),this.deck=new DS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return or(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new Gn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return or(this,void 0,void 0,function*(){$8();const i=yield mR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)Zg(o,e=new Gn(e||Gn.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new Gn(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new Gn(e||Gn.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new ar({lowerBound:new le(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new le(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of q8(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new Gn(Gn.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new Gn(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return Ca([Mf.ZP],n.prototype,"_onHover",null),Ca([Mf.ZP],n.prototype,"_onClick",null),Ca([Mf.ZP],n.prototype,"_onViewStateChange",null),Ca([Mf.ZP],n.prototype,"_onDragStart",null),Ca([Mf.ZP],n.prototype,"_onDrag",null),Ca([Mf.ZP],n.prototype,"_onDragEnd",null),n})();function jbe(n,e){return n===e}function Vbe(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let yR=(()=>{class n{constructor(){this.bootstrap$=new pg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const vR=new zt("INITIAL_STATE_TOKEN");let Hbe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const K8=new zt("Internals.StateContextFactory"),X8=new zt("Internals.StateFactory");function Pv(...n){if(1===n.length){const e=n[0];if(L(e))return YS(e,null);if(re(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return YS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return YS(n=1===n.length&&L(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return YS(n,null)}function YS(n,e){return new F(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function ml(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new pg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}function Q8(n,e){return e?t=>t.pipe(Q8((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new $be(n))}class $be{constructor(e){this.project=e}call(e,t){return t.subscribe(new Wbe(e,this.project))}}class Wbe extends pe{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new Et(this),i=this.destination;i.add(t);const r=O(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function rs(n){return e=>e.lift(new qbe(n))}class qbe{constructor(e){this.notifier=e}call(e,t){const i=new Ybe(e),r=O(this.notifier,new Et(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class Ybe extends pe{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Wu(n,e){return t=>t.lift(new Kbe(n,e))}class Kbe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new Xbe(e,this.compare,this.keySelector))}}class Xbe extends y{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}const Oa={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let Z8=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(n){return"server"===n}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return yn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return yn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof yn||console.warn(Oa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(Oc))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const J8=new zt("ROOT_STATE_TOKEN"),eH=new zt("FEATURE_STATE_TOKEN"),tH=new zt("NGXS_PLUGINS"),nH=new zt("NG_TEST_MODE"),iH=new zt("NG_DEV_MODE"),qu="NGXS_META",rH="NGXS_OPTIONS_META";let If=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=Z8}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class Qbe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const sH=new zt("NGXS_EXECUTION_STRATEGY");function Of(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const oH=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},KS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),wR=n=>n&&"object"==typeof n&&!Array.isArray(n),ER=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(wR(n)&&wR(t))for(const i in t)wR(t[i])?(n[i]||Object.assign(n,{[i]:{}}),ER(n[i],t[i])):Object.assign(n,{[i]:t[i]});return ER(n,...e)};function Fv(n){return n[qu]}function lH(n,e){const t=KS(e.currentAppState,n.path),i=KS(e.newAppState,n.path);return new Qbe(t,i,!n.isInitialised)}function s0e(...n){return function(n,e,t=l0e){const i=function(n){return n.reduce((e,t)=>(e[Of(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Ui(t=>{const i=Of(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function l0e(){return me(n=>n.action)}function XS(n){return e=>new F(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let QS=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(sH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class d0e extends ee{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let ZS=(()=>{class n extends d0e{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),h0e=(()=>{class n extends F{constructor(t,i){super(r=>{const s=t.pipe(XS(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(Ie(ZS),Ie(QS))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const cH=n=>(...e)=>n.shift()(...e,(...i)=>cH(n)(...i));let JS=(()=>{class n extends Ir{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),AR=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(tH,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),TR=(()=>{class n extends ee{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),uH=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Yo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(XS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?nn(this._stateStream.getValue()):Pv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!Of(t))return fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return cH([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(ml())}getActionResultStream(t){return this._actionResults.pipe(Ui(i=>i.action===t&&"DISPATCHED"!==i.status),Xi(1),ml())}createDispatchObservable(t){return t.pipe(Q8(i=>{switch(i.status){case"SUCCESSFUL":return nn(this._stateStream.getValue());case"ERRORED":return fg(i.error);default:return Nc}})).pipe(ml())}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(ZS),Ie(TR),Ie(AR),Ie(JS),Ie(QS))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const dH=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&dH(n[i])}),n};let hH=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(iH),Ie(nH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),fH=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Oa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Oa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(hH),Ie(If))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),em=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=dH(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(Ie(JS),Ie(uH),Ie(If),Ie(fH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),eC=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return KS(l,t.path)}function s(l,c){const d=oH(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=lH(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Oa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Oa.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(em))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class tC{static stateNameErrorMessage(e){return Oa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Oa.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Oa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=Fv(e);if(!t)throw new Error(Oa.STATE_DECORATOR());return t}}tC.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let tm=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=Y8(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(tC.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[qu].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[qu];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[qu].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[qu];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>oH(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ui(t=>"DISPATCHED"===t.status),k(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),_E({action:t,status:"CANCELED"}),Xl(i=>nn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=Of(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=Pe(d)),d instanceof F?(d=d.pipe(_E({})),l.options.cancelUncompleted&&(d=d.pipe(rs(t.pipe(s0e(i)))))):d=nn({}).pipe(ml()),s.push(d)}catch(d){s.push(fg(d))}}}return s.length||s.push(nn({})),Pv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=tC.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==KS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(If),Ie(n,12),Ie(ZS),Ie(TR),Ie(eC),Ie(vR,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),DR=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ui(()=>!!i),jr(()=>this.invokeInit(i.states)),k(()=>this.bootstrapper.appBootstrapped$),Ui(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=lH(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(em),Ie(eC),Ie(yR))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();let ih=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(me(i),Xl(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?nn(void 0):fg(r)}),Wu(),XS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Xi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(XS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=function(n){return n.NGXS_SELECTOR_META}(n)||Fv(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(JS),Ie(em),Ie(If),Ie(QS),Ie(tm),Ie(vR,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),Lv=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(If))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class v0e{static get type(){return"@@INIT"}}class b0e{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const iC=new pg(1);let E0e=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Sa();iC.next(t)}catch(n){iC.next(!1)}finally{iC.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new v0e,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(tm),Ie(em),Ie(ih),Ie(Lv),Ie(J8,8),Ie(DR))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})(),S0e=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new b0e(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(em),Ie(tm),Ie(eH,8),Ie(DR))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();class oa{static forRoot(e=[],t={}){return{ngModule:E0e,providers:[tm,eC,h0e,ZS,yR,fH,hH,DR,uH,TR,em,QS,ih,JS,Lv,AR,...e,...oa.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:S0e,providers:[tm,AR,...e,{provide:eH,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:nH,useValue:zbe},{provide:iH,useValue:Sa},{provide:sH,useClass:t.executionStrategy||Z8},{provide:J8,useValue:e},{provide:oa.ROOT_OPTIONS,useValue:t},{provide:If,useFactory:oa.ngxsConfigFactory,deps:[oa.ROOT_OPTIONS]},{provide:Rw,useFactory:oa.appBootstrapListenerFactory,multi:!0,deps:[yR]},{provide:vR,useFactory:oa.getInitialState},{provide:K8,useExisting:eC},{provide:X8,useExisting:tm}]}static ngxsConfigFactory(e){return ER(new If,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return Hbe.pop()}}function x0e(n){return i=>{!function(n){iC.subscribe(e=>{e&&(n.\u0275prov||console.warn(Oa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(qu)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,qu,{value:e})}return Fv(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[rH]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;tC.checkCorrectStateName(d),s.hasOwnProperty(qu)&&(r.actions=Object.assign({},r.actions,(s[qu]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[rH]=a}}oa.\u0275fac=function(e){return new(e||oa)},oa.\u0275mod=ln({type:oa}),oa.\u0275inj=bt({}),oa.ROOT_OPTIONS=new zt("ROOT_OPTIONS");const Ra=new zt("NgValueAccessor"),gC=new Yl(cE);class Nwe{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Pwe(e,this.dueTime,this.scheduler))}}class Pwe extends y{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Fwe,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function Fwe(n){n.debouncedNext()}function zi(n){return null!=n&&"false"!=`${n}`}function Na(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function Ku(n){return n instanceof wn?n.nativeElement:n}let JR;try{JR="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){JR=!1}let $v,eN,Hi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?lf(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!JR)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(Ie(Oc))},n.\u0275prov=$e({factory:function(){return new n(Ie(Oc))},token:n,providedIn:"root"}),n})(),Gv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();function rm(n){return function(){if(null==$v&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>$v=!0}))}finally{$v=$v||!1}return $v}()?n:!!n.capture}function Pf(n){return n.composedPath?n.composedPath()[0]:n.target}let tN=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:function(){return new n},token:n,providedIn:"root"}),n})(),x6=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Ku(t);return new F(r=>{const o=this._observeElement(i).subscribe(r);return()=>{o.unsubscribe(),this._unobserveElement(i)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const i=new ee,r=this._mutationObserverFactory.create(s=>i.next(s));r&&r.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:r,stream:i,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:i,stream:r}=this._observedElements.get(t);i&&i.disconnect(),r.complete(),this._observedElements.delete(t)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(tN))},n.\u0275prov=$e({factory:function(){return new n(Ie(tN))},token:n,providedIn:"root"}),n})(),A6=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new mn,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=zi(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Na(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe(function(n,e=gC){return t=>t.lift(new Nwe(n,e))}(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(De(x6),De(wn),De(yn))},n.\u0275dir=kt({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),nN=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[tN]}),n})();function k6(n){return 0===n.offsetX&&0===n.offsetY}function B6(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const j6=new zt("cdk-input-modality-detector-options"),aEe={ignoreKeys:[18,17,224,91,16]},sm=rm({passive:!0,capture:!0});let U6=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Ir(null),this._lastTouchMs=0,this._onKeydown=o=>{var a,l;(null===(l=null===(a=this._options)||void 0===a?void 0:a.ignoreKeys)||void 0===l?void 0:l.some(c=>c===o.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Pf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(k6(o)?"keyboard":"mouse"),this._mostRecentTarget=Pf(o))},this._onTouchstart=o=>{B6(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Pf(o))},this._options=Object.assign(Object.assign({},aEe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new Mne(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(Wu()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,sm),r.addEventListener("mousedown",this._onMousedown,sm),r.addEventListener("touchstart",this._onTouchstart,sm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,sm),document.removeEventListener("mousedown",this._onMousedown,sm),document.removeEventListener("touchstart",this._onTouchstart,sm))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hi),Ie(yn),Ie(un),Ie(j6,8))},n.\u0275prov=$e({factory:function(){return new n(Ie(Hi),Ie(yn),Ie(un),Ie(j6,8))},token:n,providedIn:"root"}),n})();const G6=new zt("cdk-focus-monitor-default-options"),wC=rm({passive:!0,capture:!0});let Xu=(()=>{class n{constructor(t,i,r,s,o){this._ngZone=t,this._platform=i,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new ee,this._rootNodeFocusAndBlurListener=a=>{const l=Pf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let d=l;d;d=d.parentElement)c.call(this,a,d)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=Ku(t);if(!this._platform.isBrowser||1!==r.nodeType)return nn(null);const s=function(n){if(function(){if(null==eN){const n="undefined"!=typeof document?document.head:null;eN=!(!n||!n.createShadowRoot&&!n.attachShadow)}return eN}()){const e=n.getRootNode?n.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(r)||this._getDocument(),o=this._elementInfo.get(r);if(o)return i&&(o.checkChildren=!0),o.subject;const a={checkChildren:i,subject:new ee,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Ku(t),r=this._elementInfo.get(i);r&&(r.subject.complete(),this._setClasses(i),this._elementInfo.delete(i),this._removeGlobalListeners(r))}focusVia(t,i,r){const s=Ku(t);s===this._getDocument().activeElement?this._getClosestElementsInfo(s).forEach(([a,l])=>this._originChanged(a,i,l)):(this._setOrigin(i),"function"==typeof s.focus&&s.focus(r))}ngOnDestroy(){this._elementInfo.forEach((t,i)=>this.stopMonitoring(i))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,i,r){r?t.classList.add(i):t.classList.remove(i)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,i){this._toggleClass(t,"cdk-focused",!!i),this._toggleClass(t,"cdk-touch-focused","touch"===i),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===i),this._toggleClass(t,"cdk-mouse-focused","mouse"===i),this._toggleClass(t,"cdk-program-focused","program"===i)}_setOrigin(t,i=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&i,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,i){const r=this._elementInfo.get(i),s=Pf(t);!r||!r.checkChildren&&i!==s||this._originChanged(i,this._getFocusOrigin(s),r)}_onBlur(t,i){const r=this._elementInfo.get(i);!r||r.checkChildren&&t.relatedTarget instanceof Node&&i.contains(t.relatedTarget)||(this._setClasses(i),this._emitOrigin(r.subject,null))}_emitOrigin(t,i){this._ngZone.run(()=>t.next(i))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const i=t.rootNode,r=this._rootNodeFocusListenerCount.get(i)||0;r||this._ngZone.runOutsideAngular(()=>{i.addEventListener("focus",this._rootNodeFocusAndBlurListener,wC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,wC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(rs(this._stopInputModalityDetector)).subscribe(s=>{this._setOrigin(s,!0)}))}_removeGlobalListeners(t){const i=t.rootNode;if(this._rootNodeFocusListenerCount.has(i)){const r=this._rootNodeFocusListenerCount.get(i);r>1?this._rootNodeFocusListenerCount.set(i,r-1):(i.removeEventListener("focus",this._rootNodeFocusAndBlurListener,wC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,wC),this._rootNodeFocusListenerCount.delete(i))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,i,r){this._setClasses(t,i),this._emitOrigin(r.subject,i),this._lastFocusOrigin=i}_getClosestElementsInfo(t){const i=[];return this._elementInfo.forEach((r,s)=>{(s===t||r.checkChildren&&s.contains(t))&&i.push([s,r])}),i}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(Hi),Ie(U6),Ie(un,8),Ie(G6,8))},n.\u0275prov=$e({factory:function(){return new n(Ie(yn),Ie(Hi),Ie(U6),Ie(un,8),Ie(G6,8))},token:n,providedIn:"root"}),n})();const $6="cdk-high-contrast-black-on-white",W6="cdk-high-contrast-white-on-black",rN="cdk-high-contrast-active";let q6=(()=>{class n{constructor(t,i){this._platform=t,this._document=i}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const i=this._document.defaultView||window,r=i&&i.getComputedStyle?i.getComputedStyle(t):null,s=(r&&r.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),s){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(rN),t.remove($6),t.remove(W6),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(rN),t.add($6)):2===i&&(t.add(rN),t.add(W6))}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hi),Ie(un))},n.\u0275prov=$e({factory:function(){return new n(Ie(Hi),Ie(un))},token:n,providedIn:"root"}),n})(),qv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const K6=new Cu("12.2.5");function Z6(n){Promise.resolve(null).then(n)}class am{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Z6(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function e5(){return"undefined"!=typeof window&&void 0!==window.document}function oN(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let uN=(n,e)=>!1,dN=(n,e)=>!1,i5=(n,e,t)=>[];const r5=oN();(r5||"undefined"!=typeof Element)&&(uN=e5()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),dN=(()=>{if(r5||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):dN}})(),i5=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return hN(t)}matchesElement(t,i){return fN(t,i)}containsElement(t,i){return pN(t,i)}query(t,i,r){return gN(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new am(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class EC{}EC.NOOP=new a5;function d5(n,e,t){return t?e+":"+t+";":""}function h5(n){let e="";for(let t=0;t{const r=bN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),oN()&&h5(n))}function kf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=bN(t);n.style[i]=""}),oN()&&h5(n))}const bEe=/-+([a-z0-9])/g;function bN(n){return n.replace(bEe,(...e)=>e[1].toUpperCase())}function wEe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class um{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=um.initialStylesByElement.get(e);r||um.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&eu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(eu(this._element,this._initialStyles),this._endStyles&&(eu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(um.initialStylesByElement.delete(this._element),this._startStyles&&(kf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(kf(this._element,this._endStyles),this._endStyles=null),eu(this._element,this._initialStyles),this._state=3)}}um.initialStylesByElement=new WeakMap;const sc=new zt("AnimationModuleType"),X5=new Cu("12.2.5"),zSe=new zt("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let jf,pr=(()=>{class n{constructor(t,i,r){this._hasDoneGlobalChecks=!1,this._document=r,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=i,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!Sa()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const i=getComputedStyle(t);i&&"none"!==i.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&X5.full!==K6.full&&console.warn("The Angular Material version ("+X5.full+") does not match the Angular CDK version ("+K6.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(Ie(q6),Ie(zSe,8),Ie(un))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[qv],qv]}),n})();function UC(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=zi(e)}}}function Xv(n,e){return class extends n{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const i=t||this.defaultColor;i!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),i&&this._elementRef.nativeElement.classList.add(`mat-${i}`),this._color=i)}}}function FN(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=zi(e)}}}function LN(n,e=0){return class extends n{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?Na(t):this.defaultTabIndex}}}try{jf="undefined"!=typeof Intl}catch(n){jf=!1}class tCe{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const J5={enterDuration:225,exitDuration:150},kN=rm({passive:!0}),eG=["mousedown","touchstart"],tG=["mouseup","mouseleave","touchend","touchcancel"];class iCe{constructor(e,t,i,r){this._target=e,this._ngZone=t,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=Ku(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},J5),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);const o=i.radius||function(n,e,t){const i=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),r=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),a=e-r.left,l=t-r.top,c=s.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=a-o+"px",d.style.top=l-o+"px",d.style.height=2*o+"px",d.style.width=2*o+"px",null!=i.color&&(d.style.backgroundColor=i.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(d),d.style.transform="scale(1)";const f=new tCe(this,d,i);return f.state=0,this._activeRipples.add(f),i.persistent||(this._mostRecentTransientRipple=f),this._runTimeoutOutsideZone(()=>{const p=f===this._mostRecentTransientRipple;f.state=1,!i.persistent&&(!p||!this._isPointerDown)&&f.fadeOut()},c),f}fadeOutRipple(e){const t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!t)return;const i=e.element,r=Object.assign(Object.assign({},J5),e.config.animation);i.style.transitionDuration=`${r.exitDuration}ms`,i.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(()=>{e.state=3,i.parentNode.removeChild(i)},r.exitDuration)}fadeOutAll(){this._activeRipples.forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Ku(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(eG))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(tG),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=k6(e),i=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(1===e.state||e.config.terminateOnPointerUp&&0===e.state)&&e.fadeOut()}))}_runTimeoutOutsideZone(e,t=0){this._ngZone.runOutsideAngular(()=>setTimeout(e,t))}_registerEvents(e){this._ngZone.runOutsideAngular(()=>{e.forEach(t=>{this._triggerElement.addEventListener(t,this,kN)})})}_removeTriggerEvents(){this._triggerElement&&(eG.forEach(e=>{this._triggerElement.removeEventListener(e,this,kN)}),this._pointerUpEventsRegistered&&tG.forEach(e=>{this._triggerElement.removeEventListener(e,this,kN)}))}}const oCe=new zt("mat-ripple-global-options");let dm=(()=>{class n{constructor(t,i,r,s,o){this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=s||{},this._rippleRenderer=new iCe(this,i,t,r)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,i=0,r){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,i,Object.assign(Object.assign({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return n.\u0275fac=function(t){return new(t||n)(De(wn),De(yn),De(Hi),De(oCe,8),De(sc,8))},n.\u0275dir=kt({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&Ei("mat-ripple-unbounded",i.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),n})(),HC=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[pr,Gv],pr]}),n})();new class extends Yl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let yCe=1;const vCe=Promise.resolve(),GC={};function oG(n){return n in GC&&(delete GC[n],!0)}const aG={setImmediate(n){const e=yCe++;return GC[e]=!0,vCe.then(()=>oG(e)&&n()),e},clearImmediate(n){oG(n)}};new class extends Yl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=aG.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(aG.clearImmediate(t),e.scheduled=void 0)}});function Zv(n){return!!n&&(n instanceof F||"function"==typeof n.lift&&"function"==typeof n.subscribe)}function VG(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>me(function(n,e){return i=>{let r=i;for(let s=0;s{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new QAe(n,t))}}"undefined"!=typeof window&&window,tt(266),tt(478),new zt("SECURITY_CONTEXT");class QAe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new ZAe(e,this.observables,this.project))}}class ZAe extends k3{constructor(e,t,i){super(e),this.observables=t,this.project=i,this.toRespond=[];const r=t.length;this.values=new Array(r);for(let s=0;s0){const s=r.indexOf(i);-1!==s&&r.splice(s,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}function rb(n){return!0===n}function La(n){return null==n}function ka(n){return!La(n)}function sP(n){return Boolean(n)}function I$(n){return La(n)?n:JSON.parse(JSON.stringify(n))}const ax=n=>{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&ax(n[o])}),n};function O$(n){return ka(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const P$="NGXS_DATA_META",aP="NGXS_META",F$="NGXS_ARGUMENT_REGISTRY_META";let L$=(()=>{class n{constructor(t){this.sequence$=new Ir(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function sb(n){return n[P$]}let Ba=(()=>{class n{constructor(t,i,r){n.store=t.get(ih),n.ngZone=t.get(yn),n.factory=i,n.context=r,n.computed=t.get(L$)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(X8),Ie(K8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class os{constructor(){os.statesCachedMeta.clear()}static createStateContext(e){return Ba.context.createStateContext(e)}static ensureMappedState(e){if(La(Ba.factory)||La(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(ka(e.name)?os.statesCachedMeta.get(e.name):null)||os.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=sb(os.getStateClassByInstance(e)))&&void 0!==t?t:null;if(La(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=os.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=os.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=ka(e.name)?null===(t=Ba.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return ka(i)&&ka(e.name)&&os.statesCachedMeta.set(e.name,i),i}}os.statesCachedMeta=new Map,os.\u0275fac=function(e){return new(e||os)},os.\u0275prov=$e({token:os,factory:os.\u0275fac}),new pg(1);class NTe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${ka(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function k$(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function B$(n){var e;const t=k$(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=I$(void 0===t.defaults?{}:t.defaults);if(i.length){if(O$(s))return function(n,e){return e.reduce((t,i)=>{const r=k$(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=B$(i),t},null!=n?n:{})}(s,i);throw new NTe(s)}return s}function V$(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function U$(){var n,e;return null!==(e=null===(n=null==Ba?void 0:Ba.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function kTe(n){let e=!1;return Zv(n)&&(e=!0),e}function lP(n){return n[F$]}class BTe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class jTe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(sP(this.argumentMap.has(e))||sP(this.payloadMap.has(e)))throw new BTe(e,t)}}function $Te(n){return{enumerable:!0,configurable:!0,get(){const e=sb(n),t=os.ensureMappedState(e.stateMeta);return os.createStateContext(t)}}}function z$(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(O$(i))for(;null!==i;){if(rb(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return La(V$(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),V$(n)}(this),o=null==s?void 0:s.get(i);if(rb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(La(o)||o.sequenceId!==U$()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:U$(),isObservable:kTe(l)}),l}return o.value},t}}const QTe={cancelUncompleted:!0,insideZone:!1};function cP(n=QTe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=os.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=lP(r);if(La(f)){const G=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),ge=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var G;return rb(n.insideZone)?null===(G=Ba.ngZone)||void 0===G||G.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Zv(l)?nn(null).pipe(me(()=>l)):l};const T=os.createAction(f,o,g),q=Ba.store.dispatch(T);return Zv(l)?function(n,e){return Pv([n,e]).pipe(me(t=>t.pop()))}(q,l):l},i}}function H$(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return La(lP(t))&&Object.defineProperties(t,{[F$]:{enumerable:!0,configurable:!0,value:new jTe}}),lP(t)})(e,t).createPayloadType(r,t,i)}}function JTe(){return n=>{const e=function(n){if(function(n){return!sP(n)}(n.hasOwnProperty(aP))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,aP,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[aP]}(n)}(n);if(La(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=sb(n))&&void 0!==e?e:null;return(La(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,P$,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),sb(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>I$(t)},context:$Te(n)})}(n,e,B$(n)),function(n){var e,t;const i=sb(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(ka(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(ka(this[s]))return this[s];if(La(Ba.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ba.store.select(n).pipe(me(o=>Sa()?ax(o):o),ml({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let tDe=(()=>{class n{constructor(){this.browserStorageEvents$=new ee,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),nDe=(()=>{class n extends tDe{get snapshot(){return function(n){return Sa()?ax(n):n}(this.getState())}get ctx(){return function(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>Sa()?ax(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),Ca([z$(),Kl("design:type",Object),Kl("design:paramtypes",[])],n.prototype,"snapshot",null),Ca([cP(),P3(0,H$("patchValue")),Kl("design:type",Function),Kl("design:paramtypes",[Object]),Kl("design:returntype",void 0)],n.prototype,"patchState",null),Ca([cP(),P3(0,H$("stateValue")),Kl("design:type",Function),Kl("design:paramtypes",[Object]),Kl("design:returntype",void 0)],n.prototype,"setState",null),Ca([cP(),Kl("design:type",Function),Kl("design:paramtypes",[]),Kl("design:returntype",void 0)],n.prototype,"reset",null),n})();const pDe=["bodyCanvas"];let gDe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new mn,this.nodeDrag=new mn,this.nodeClick=new mn,this.nodeHoverStart=new mn,this.nodeHoverStop=new mn,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return or(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new Bbe({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Mr(pDe,5,wn),2&t){let r;di(r=hi())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Tc(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&wi(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),mDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr]]}),n})();new zt("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const Z$=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}];Z$.filter(n=>!0!==n.disabled);let cx=(()=>{let n=class extends nDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ui(n=>null!=n),ml(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(VG(...t),Wu(),ml(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(VG(...t),Wu(),ml(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),Ca([z$()],n.prototype,"config$",null),n=Ca([JTe(),x0e({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();function tu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let dP;function ac(){return dP||(dP=function(n,e){const t=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const i=()=>indexedDB.databases().finally(t);e=setInterval(i,100),i()}).finally(()=>clearInterval(e))}().then(()=>{const i=indexedDB.open("keyval-store");return i.onupgradeneeded=()=>i.result.createObjectStore(e),tu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),dP}function J$(n,e=ac()){return e("readonly",t=>tu(t.get(n)))}var Yi=tt(440),KDe=tt(698),XDe=tt(445),QDe=tt.n(XDe),pi=tt(815),dh=tt(609);const Gi=Yi.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},Yi.DataFactory),eW={x:Gi("rdf"),type:Gi("rdf")("type")},_m={x:Gi("rdfs"),label:Gi("rdfs")("label"),comment:Gi("rdfs")("comment"),isDefinedBy:Gi("rdfs")("isDefinedBy"),seeAlso:Gi("rdfs")("seeAlso")},gi={x:Gi("entity"),id:Gi("entity")("id"),label:_m.label,description:_m.comment,link:_m.seeAlso,sex:Gi("entity")("sex"),age:Gi("entity")("age"),bmi:Gi("entity")("bmi"),Male:Yi.DataFactory.literal("Male"),Female:Yi.DataFactory.literal("Female"),consortiumName:Gi("entity")("consortium_name"),providerName:Gi("entity")("provider_name"),providerUUID:Gi("entity")("provider_uuid"),donor:Gi("entity")("has_donor"),sections:Gi("entity")("has_tissue_section"),datasets:Gi("entity")("has_dataset"),sampleType:Gi("entity")("sample_type"),TissueBlock:Yi.DataFactory.literal("Tissue Block"),TissueSection:Yi.DataFactory.literal("Tissue Section"),NonStandard:Yi.DataFactory.literal("Non-standard"),sectionCount:Gi("entity")("section_count"),sectionSize:Gi("entity")("section_size"),sectionUnits:Gi("entity")("section_units"),sectionNumber:Gi("entity")("section_number"),spatialEntity:Gi("entity")("has_spatial_entity"),ontologyTerms:Gi("entity")("has_ontology_term"),technology:Gi("entity")("technology"),thumbnail:Gi("entity")("has_thumbnail")},In=Gi("ccf"),lr={x:In,ontologyNode:{label:In("ccf_preferred_label"),parent:In("ccf_part_of"),children:In("ccf_part_of"),rui_rank:In("ccf_rui_rank"),synonymLabels:Yi.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:In("VHFemale"),Male:In("VHMale"),BothSexes:In("VHBothSexes"),FemaleOrgans:In("VHFemaleOrgans"),MaleOrgans:In("VHMaleOrgans")},SpatialObjectReference:In("SpatialObjectReference"),SpatialEntity:In("SpatialEntity"),SpatialPlacement:In("SpatialPlacement"),spatialObjectReference:{file:In("has_object_file"),file_format:In("has_object_file_format"),file_subpath:In("has_object_file_subpath")},extractionSet:{label:_m.label,rui_rank:In("ccf_rui_rank")},spatialEntity:{label:_m.label,comment:_m.comment,creator:Gi("dc")("creator"),creator_first_name:In("creator_first_name"),creator_last_name:In("creator_last_name"),creator_orcid:In("creator_orcid"),creation_date:In("creation_date"),updated_date:In("updated_date"),ccf_annotations:In("ccf_annotation"),representation_of:In("ccf_representation_of"),reference_organ:In("anatomical_structure_of"),extraction_set_for:In("extraction_set_for"),extraction_set:In("extraction_site_for"),sex:In("has_sex"),side:In("has_side"),rui_rank:In("ccf_rui_rank"),slice_thickness:In("ccf_slice_thickness"),slice_count:In("ccf_slice_count"),x_dimension:In("has_x_dimension"),y_dimension:In("has_y_dimension"),z_dimension:In("has_z_dimension"),dimension_units:In("has_dimension_units"),object:In("has_object_reference")},spatialPlacement:{source:In("has_placement_source"),target:In("has_placement_target"),placement_date:In("has_placement_date"),x_scaling:In("has_x_scaling"),y_scaling:In("has_y_scaling"),z_scaling:In("has_z_scaling"),scaling_units:In("has_scaling_units"),x_rotation:In("has_x_rotation"),y_rotation:In("has_y_rotation"),z_rotation:In("has_z_rotation"),w_rotation:In("has_theta_rotation"),rotation_order:In("has_rotation_order"),rotation_units:In("has_rotation_units"),x_translation:In("has_x_translation"),y_translation:In("has_y_translation"),z_translation:In("has_z_translation"),translation_units:In("has_translation_units")}},Ar={x:Gi("uberon")},tW=(Gi("lmha"),{bladder:Ar.x("0001255"),body:Ar.x("0013702"),brain:Ar.x("0000955"),colon:Ar.x("0001155"),heart:Ar.x("0000948"),kidney:Ar.x("0002113"),large_intestine:Ar.x("0000059"),left_kidney:Ar.x("0004538"),left_lung:Ar.x("0002168"),left_ureter:Ar.x("0001223"),liver:Ar.x("0002107"),lung:Ar.x("0002048"),respiratory_system:Ar.x("0001004"),lymph_node:Ar.x("0000029"),pelvis:Ar.x("0001270"),rectum:Ar.x("0001052"),right_kidney:Ar.x("0004539"),right_lung:Ar.x("0002167"),right_ureter:Ar.x("0001222"),skin:Ar.x("0002097"),small_intestine:Ar.x("0002108"),spleen:Ar.x("0002106"),thymus:Ar.x("0002370"),ureter:Ar.x("0000056"),vasculature:Ar.x("0002049")});function fP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const ux={spatialObjectReference:fP(lr.spatialObjectReference),spatialEntity:fP(lr.spatialEntity),spatialPlacement:fP(lr.spatialPlacement)};function dx(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,dh.fromRdf)(s.object):s.object.id;(0,pi.set)(r,o,a)}return!1},Yi.DataFactory.namedNode(e),null,null,null),r}const eMe=(0,pi.memoize)(function(n,e){return dx(n,e,"SpatialObjectReference",ux.spatialObjectReference)},(n,e)=>e),nW=(0,pi.memoize)(function(n,e){const t=dx(n,e,"ExtractionSet",ux.spatialEntity);return t.extractionSites=(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set,e,null).map(i=>Hf(n,i.id)),["rui_rank"]),t},(n,e)=>e),iMe=(0,pi.memoize)(function(n,e){return(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set_for,e,null).map(t=>nW(n,t.id)),["rui_rank"])},(n,e)=>e),sMe=(0,pi.memoize)(function(n,e){return(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.reference_organ,e,null).map(t=>Hf(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),aMe=(0,pi.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(Hf(n,t.subject.id))},null,lr.spatialEntity.reference_organ,null,null),(0,pi.sortBy)(e,["rui_rank"])}),Hf=(0,pi.memoize)(function(n,e){const t=dx(n,e,"SpatialEntity",ux.spatialEntity);return t.object&&(t.object=eMe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,lr.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,gi.spatialEntity,e,null),t},(n,e)=>e),uMe=(0,pi.memoize)(function(n,e){const t=dx(n,e,"SpatialPlacement",ux.spatialPlacement);return t.source&&(t.source=Hf(n,t.source)),t.target&&(t.target=Hf(n,t.target)),t},(n,e)=>e),hMe=(0,pi.memoize)(function(n,e){const t=n.getObjects(Yi.DataFactory.namedNode(e),gi.spatialEntity,null);if(t.length>0)return Hf(n,t[0].id)},(n,e)=>e);function fMe(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(zj),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class iW{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new KDe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},eW.type,lr.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},eW.type,lr.SpatialEntity,null);const t={};e.some(i=>(t[i.subject.id]=i.object.id,!1),null,lr.spatialPlacement.source,null,null),e.some(i=>{const r=t[i.subject.id];return r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement"),!1},null,lr.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,i,r){this.graph.mergeDirectedEdge(t,i,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new Gn(Gn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new Gn(Gn.IDENTITY),s=QDe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s){if(o){const l=this.graph.getEdgeAttribute(a,o,"id");fMe(r,uMe(i,l))}o=a}return r}}}class rW{constructor(e){this.db=e}getSpatialEntity(e){return Hf(this.db.store,e)}getExtractionSets(e){return iMe(this.db.store,e)}getExtractionSet(e){return nW(this.db.store,e)}getAnatomicalStructures(e){return sMe(this.db.store,e)}getReferenceOrgans(){return aMe(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=lr.spatial.Male.id;break;case"Female":t=lr.spatial.Female.id;break;case"Both":default:t=lr.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(i=>"Male"===i.sex);break;case"Female":t=t.filter(i=>"Female"===i.sex)}return(null==e?void 0:e.debug)&&(t=t.map(i=>[[i],this.getAnatomicalStructures(i["@id"])]).reduce((i,[r,s])=>i.concat(s.length>0?s:r),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let i=[...this.getReferenceOrganSets(e).map(r=>{const s="http://purl.obolibrary.org/obo/UBERON_0002097"===r.representation_of;return this.getSceneNode(r,t,{color:[255,255,255,255],opacity:s?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!s})})];return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(lr.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(r=>void 0!==r)}getReferenceOrganScene(e,t){var i,r;const s=null!==(i=void 0!==(null==t?void 0:t.sex))&&void 0!==i&&i,o=this.getReferenceOrgans().filter(a=>a.representation_of===e&&(!s||a.sex===(null==t?void 0:t.sex)));if(o.length>0){const a=o[0],c=this.getSceneNode(a,a,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===a.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),d=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(f=>this.getSceneNode(f,a,{color:[255,255,255,229.5]}));return[c].concat(d).filter(f=>void 0!==f)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(i=>this.getSceneNode(i,t,{color:[255,255,255,229.5]})).filter(i=>void 0!==i)}getSceneNode(e,t,i={}){var r,s,o,a;const l=null===(s=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===s?void 0:s.startsWith("model/gltf");let d=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(d){if(l)d=new Gn(Gn.IDENTITY).rotateX(zj(90)).multiplyLeft(d);else{let f;switch(e.dimension_units){case"centimeter":f=.01;break;case"millimeter":f=.001;break;case"meter":default:f=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*f/2);d.scale(p)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:l?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:l?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:d,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const hx="https://entity.api.hubmapconsortium.org/entities/",sW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),pMe={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},fx={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},Ti=function(){const n={};return Object.entries(tW).forEach(([e,t])=>n[e]=t.id),n}(),mMe={BL:[Ti.body,Ti.bladder],RK:[Ti.body,Ti.kidney,Ti.right_kidney],LK:[Ti.body,Ti.kidney,Ti.left_kidney],HT:[Ti.body,Ti.heart],LI:[Ti.body,Ti.large_intestine,Ti.colon],SI:[Ti.body,Ti.small_instestine],LL:[Ti.body,Ti.respiratory_system,Ti.lung,Ti.left_lung],RL:[Ti.body,Ti.respiratory_system,Ti.lung,Ti.right_lung],LY:[Ti.body,Ti.lymph_node],SP:[Ti.body,Ti.spleen],TH:[Ti.body,Ti.thymus],UR:[Ti.body,Ti.ureter],LV:[Ti.body,Ti.liver],OT:[Ti.body]},oW={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class vMe{constructor(e,t="",i="",r){var s,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const c=this.data.descendants||[],d=(this.data.ancestors||[]).find(We=>"Donor"===We.entity_type);this.donor=this.getDonor(d,i);const f=this.getRuiLocation(e,this.donor);f?this.rui_location=f:this.bad=!0;const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=fx[e.group_uuid]||e.group_name,_=e.created_by_user_displayname;this["@id"]=hx+e.uuid,this.label=`Registered ${p}, ${_}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const x={},T=[];this.sections=T;const q=[];this.datasets=q;for(const We of c.filter(dt=>"Sample"===dt.entity_type)){const dt=this.getSection(We,e,i);x[We.submission_id]=dt,T.push(dt),dt.section_number=null!==(s=dt.section_number)&&void 0!==s?s:T.length}for(const We of c)if("Dataset"===We.entity_type){const dt=this.getDataset(We,t,i,r),Mt=(0,pi.get)(We,["ingest_metadata","metadata","tissue_id"]);x[Mt]?null===(o=x[Mt].datasets)||void 0===o||o.push(dt):q.push(dt)}const G=null!=f?f:{},ge=`${G.x_dimension} x ${G.y_dimension} x ${G.z_dimension} ${G.dimension_units}`;this.section_count=G.slice_count||T.length;const Ne=parseFloat((G.slice_thickness||(G.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ne;const Ge=G.dimension_units||"millimeter";this.section_units=Ge,this.description=`${ge}, ${Ne} ${Ge}, ${e.specimen_type}, ${this.section_count} Sections`,T.forEach((We,dt)=>{We.description=`${G.x_dimension} x ${G.y_dimension} x ${Ne} ${Ge}, ${Ne} ${Ge}, ${We.description}`,We.section_number=dt+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":hx+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${fx[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${i}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",i="",r){var s;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=fx[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,pi.get)(e,["ingest_metadata","metadata","assay_type"],"")],d=c.join("|").toLowerCase();let f,p="assets/icons/ico-unknown.svg";return-1!==d.indexOf("10x")?(f="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==d.indexOf("af")?(f="AF",p="assets/icons/ico-spatial-af.svg"):-1!==d.indexOf("codex")?(f="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==d.indexOf("imc")?(f="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==d.indexOf("lc")&&-1===d.indexOf("af")?(f="LC",p="assets/icons/ico-bulk-lc.svg"):f=-1!==d.indexOf("maldi")?"MALDI":-1!==d.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":hx+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:f,thumbnail:p}}getDatasetThumbnail(e,t,i){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(i?`?token=${i}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,pi.get)(e,"metadata.files",[]).filter(s=>/\.(ome\.tif|ome\.tiff)$/.test(s.rel_path)).filter(s=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(s.rel_path)).filter(s=>sW.has(s.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(s=>`${t}/${e.uuid}/${s.rel_path}`+(i?`?token=${i}`:""));if(r.length>0){const s=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(sW.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=pMe[e.hubmap_id];if(r)return`assets/thumbnails/TMC-Florida/${r}`}}getDonor(e,t){const i=(e.description||"").toLowerCase();let r;i.includes("female")?r="Female":i.includes("male")&&(r="Male");const s=i.match(/age ([0-9]+)/);let o,a;s&&(o=(0,pi.toNumber)(s[1]));for(const p of(0,pi.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===p.preferred_term||"Female"===p.preferred_term?r="Female":"Masculine gender"===p.preferred_term||"Male"===p.preferred_term?r="Male":"Current chronological age"===p.preferred_term||"Age"===p.preferred_term?o=(0,pi.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,pi.toNumber)(p.data_value));let l="";r&&o&&(l+=`${r}, Age ${o}`,a&&(l+=`, BMI ${a.toFixed(1)}`));const c=new Date(e.last_modified_timestamp).toLocaleDateString(),d=fx[e.group_uuid]||e.group_name;return{"@id":hx+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${d}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;const s=(e.ancestors||[]).find(c=>"Sample"===c.entity_type&&"organ"===c.specimen_type),o=mMe[null==s?void 0:s.organ]||[Ti.body];let a,l=e.rui_location;if(l&&("string"==typeof l&&(l=JSON.parse(l)),l.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):l["@id"]&&(a=l)),a){a.ccf_annotations=o.concat(a.ccf_annotations||[]);const c=null!==(i=(0,pi.get)(a,["placement","target"]))&&void 0!==i?i:"";c.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,pi.set)(a,["placement","target"],c.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===c||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===c)&&(0,pi.set)(a,["placement","target"],"Male"===t.sex?c.replace("#VH","#VHM")+"_Patch":c.replace("#VH","#VHF")+"_Patch")}return a}getTissueBlock(){return(0,pi.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function aW(n,e,t,i,r="",s=""){return or(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(n).then(a=>a.ok?a.json():void 0).catch(()=>{});else if("search-api"===e){const a={"Content-type":"application/json"};i&&i.length>0&&(a.Authorization=`Bearer ${i}`),o=yield fetch(n,{method:"POST",headers:a,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:{exists:{field:"rui_location"}}})}).then(l=>l.ok?l.json():void 0).catch(()=>{})}if(o)return function(n,e="",t="",i,r=!1){const o={},a=(0,pi.get)(n,"hits.hits",[]).map(c=>(0,pi.get)(c,"_source",{})).map(c=>new vMe(c,e,t,i).toJsonLd());for(const c of a){const d=c["@id"];o[d]?o[d].samples.push(c.samples[0]):o[d]=c}const l=Object.values(o);return r&&(function(n){let e=[],t=0;for(const i of n.filter(r=>r.samples.length>1)){const r=i.samples;for(let s=0;sc["@id"]===o)&&(r[s].deleteMe=!0,t++)}i.samples=r.filter(s=>!0!==s.deleteMe)}t>0&&console.log(`\u26a0 ${t} sections identified as blocks`)}(l),console.log(l.map(c=>Object.assign({"@context":oW},c)))),{"@context":oW,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function px(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.donor,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}function ob(n,e){return t=>n.has(t.id)?e.add(t.id):void 0}const FMe={[lr.ontologyNode.label.id]:"label",[lr.ontologyNode.parent.id]:"parent",[lr.ontologyNode.synonymLabels.id]:"synonymLabels"};function LMe(n,e){const t=Yi.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return n.some(r=>{const s=FMe[r.predicate.id];if(s){const o="Literal"===r.object.termType?(0,dh.fromRdf)(r.object):r.object.id;"synonymLabels"===s?i.synonymLabels.push(o):(0,pi.set)(i,s,o)}return!1},t,null,null,null),i.children=n.getSubjects(lr.ontologyNode.children,t,null).map(r=>r.id),i}const gx={[gi.label.id]:"label",[gi.description.id]:"description",[gi.link.id]:"link"},BMe=Object.assign(Object.assign({},gx),{[gi.providerName.id]:"providerName"}),jMe=Object.assign(Object.assign({},gx),{[gi.technology.id]:"technology",[gi.thumbnail.id]:"thumbnail"}),VMe=Object.assign(Object.assign({},gx),{[gi.sampleType.id]:"sampleType",[gi.sectionNumber.id]:"sectionNumber",[gi.datasets.id]:"datasets"}),UMe=Object.assign(Object.assign({},gx),{[gi.sampleType.id]:"sampleType",[gi.sectionCount.id]:"sectionCount",[gi.sectionSize.id]:"sectionSize",[gi.sectionUnits.id]:"sectionUnits",[gi.donor.id]:"donor",[gi.spatialEntity.id]:"spatialEntityId",[gi.sections.id]:"sections",[gi.datasets.id]:"datasets"}),HMe=(0,pi.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=BMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;(0,pi.set)(t,r,s)}return!1},Yi.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function lW(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=jMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;(0,pi.set)(t,r,s)}return!1},Yi.DataFactory.namedNode(e),null,null,null),t}const WMe=(0,pi.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=UMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=VMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=lW(n,s);t[r].push(o)}else(0,pi.set)(t,r,s)}return!1},Yi.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=lW(n,s);t[r].push(o)}else"donor"===r?t[r]=HMe(n,s):(0,pi.set)(t,r,s)}return!1},Yi.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e),qMe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class YMe{constructor(e=qMe){this.options=e,this.store=new Yi.Store(void 0,{factory:Yi.DataFactory}),this.graph=new iW(this),this.scene=new rW(this)}connect(e,t=!1){return or(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return or(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield J$(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=ac()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),tu(t.transaction)))}([i,t]).catch(()=>{}):s=yield J$(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=ac()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),tu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return or(this,void 0,void 0,function*(){const i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],s=this.options.ccfOwlUrl;if(s.endsWith(".n3store.json")){const o=yield fetch(s).then(a=>a.text()).catch(()=>console.log("Couldn't locate serialized store."));o&&(this.store=(0,Yi.deserializeN3Store)(o,Yi.DataFactory))}else(null==s?void 0:s.length)>0&&r.push(s);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(aW(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(o=>{if(o)return this.addDataSources([o])}))),i.push(this.addDataSources(r)),yield Promise.all(i),yield this.synchronize()})}addDataSources(e,t){return or(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>or(this,void 0,void 0,function*(){"string"==typeof r?r.endsWith("jsonld")?yield(0,Yi.addJsonLdToStore)(r,i):r.endsWith("n3")?yield(0,Yi.addN3ToStore)(r,i):(r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml"))&&(yield(0,Yi.addRdfXmlToStore)(r,i)):yield(0,Yi.addJsonLdToStore)(r,i)}))),this})}synchronize(){return or(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,Yi.serializeN3Store)(this.store)}deserialize(e){return or(this,void 0,void 0,function*(){this.store=(0,Yi.deserializeN3Store)(e,Yi.DataFactory),this.graph=new iW(this),this.scene=new rW(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e){var t,i,r,s,o;let a=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),gi.spatialEntity,null,null),e}(n);if(a.size>0&&(a=function(n,e,t=!0){const i=new Set;if(n.forSubjects(ob(e,i),gi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const l=e.sex;a=px(n,a,c=>function(n,e,t){const i=new Set;return n.forSubjects(ob(e,i),gi.sex,gi[t],null),i}(n,c,l))}if(a.size>0&&(null===(t=e.tmc)||void 0===t?void 0:t.length)>0&&(a=px(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Yi.DataFactory.literal(r);n.forSubjects(ob(e,i),gi.providerName,s,null)}return i}(n,l,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set,o=new Set;n.some(c=>(e.has(c.subject.id)&&o.add(c.object.id),!1),null,gi.sections,null,null),n.some(c=>{var d;return(e.has(c.subject.id)||o.has(c.subject.id))&&(s.add(c.object.id),r.has(c.object.id)?null===(d=r.get(c.object.id))||void 0===d||d.push(c.subject.id):r.set(c.object.id,[c.subject.id])),!1},null,gi.datasets,null,null);const a=t(s),l=new Set;for(const c of a)for(const d of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(d);return l}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Yi.DataFactory.literal(r);n.forSubjects(ob(e,i),gi.technology,s,null)}return i}(n,l,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.spatialEntity,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Yi.DataFactory.namedNode(r);n.forSubjects(ob(e,i),lr.spatialEntity.ccf_annotations,s,null)}return i}(n,l,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,pi.isFinite)(e.ageRange[0])&&(0,pi.isFinite)(e.ageRange[1])){const l=Math.max(...e.ageRange),c=Math.min(...e.ageRange);1===c&&110===l||(a=px(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,dh.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.age,null,null),r}(n,d,c,l)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,pi.isFinite)(e.bmiRange[0])&&(0,pi.isFinite)(e.bmiRange[1])){const l=Math.max(...e.bmiRange),c=Math.min(...e.bmiRange);13===c&&83===l||(a=px(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,dh.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.bmi,null,null),r}(n,d,c,l)))}return a}(this.store,e)}get(e){return this.store.getQuads(Yi.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(t=>this.get(t))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>hMe(this.store,t))}getDatasetTechnologyNames(){return or(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return or(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return or(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>WMe(this.store,t))})}getAggregateResults(e){return or(this,void 0,void 0,function*(){return function(n,e){const t=new Set;e.some(l=>(n.has(l.subject.id)&&t.add(l.object.id),!1),null,gi.donor,null,null);const i=new Set;e.some(l=>(t.has(l.subject.id)&&i.add(l.object.id),!1),null,gi.providerUUID,null,null);const r=new Set;e.forSubjects(l=>{n.has(l.id)&&r.add(l.id)},gi.spatialEntity,null,null);const s=new Set;e.some(l=>(r.has(l.subject.id)&&s.add(l.object.id),!1),null,gi.sections,null,null);const o=new Set;return e.some(l=>{const c=l.subject;return(r.has(c.id)||s.has(c.id))&&o.add(l.object.id),!1},null,gi.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:t.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([l,c])=>({label:l,count:c}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return or(this,void 0,void 0,function*(){return function(n,e){const t=new Map;e.some(r=>(n.has(r.subject.id)&&(t.has(r.object.id)?t.get(r.object.id).push(r.subject.id):t.set(r.object.id,[r.subject.id])),!1),null,gi.spatialEntity,null,null);const i={};return e.some(r=>{var s,o;if(t.has(r.subject.id)){const a=null!==(o=null===(s=t.get(r.subject.id))||void 0===s?void 0:s.length)&&void 0!==o?o:0;i[r.object.id]=a+(i[r.object.id]||0)}return!1},null,lr.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store)})}getOntologyTreeModel(){return or(this,void 0,void 0,function*(){return function(n){const e={root:tW.body.id,nodes:{}},t=new Set;n.some(i=>(t.add(i.subject.id),t.add(i.predicate.id),!1),null,lr.ontologyNode.parent,null,null);for(const i of t)e.nodes[i]=LMe(n,i);return e}(this.store)})}getReferenceOrgans(){return or(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return or(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return or(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}}function XMe(n,e){return n===e}let QMe=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new S,this.dataSource=i.config$.pipe(Ui(r=>Object.keys(r).length>0),me(r=>r),Wu(XMe),sr(r=>function(n,e){return new F(t=>{let i,r;try{i=n()}catch(a){return void t.error(a)}try{r=e(i)}catch(a){return void t.error(a)}const o=(r?Pe(r):Nc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),ml(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(sr(i=>i.getTissueBlockResults(t)),Xi(1))}getAggregateResults(t){return this.dataSource.pipe(sr(i=>i.getAggregateResults(t)),Xi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(sr(i=>i.getOntologyTermOccurences(t)),Xi(1))}getOntologyTreeModel(){return this.dataSource.pipe(sr(t=>t.getOntologyTreeModel()),Xi(1))}getReferenceOrgans(){return this.dataSource.pipe(sr(t=>t.getReferenceOrgans()),Xi(1))}getScene(t){return this.dataSource.pipe(sr(i=>i.getScene(t).then(r=>r.filter(s=>t.ontologyTerms.includes(s.representation_of)))),Xi(1))}getReferenceOrganScene(t,i){return this.dataSource.pipe(sr(r=>r.getReferenceOrganScene(t,i)),Xi(1))}createDataSource(){return{source:new YMe,unsubscribe:()=>{}}}connectDataSource(t,i){return or(this,void 0,void 0,function*(){$d.disableDbWorker&&(yield new Promise(s=>{setTimeout(s,100)}));const r=(new Date).getTime();return yield t.connect(i,!0),$d.production||console.info(`Loaded CCF database in ${((new Date).getTime()-r)/1e3}s`),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(af),Ie(cx))},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),ZMe=(()=>{class n{constructor(t){this.source=t,this.organs=Z$}getOrganInfo(t,i,r="Female"){let s=this.organs.find(a=>a.id===t);if(!s)return nn(void 0);const o=s.organ;return s.disabled&&(s=this.organs.find(a=>!a.disabled&&a.organ===o)),(null==s?void 0:s.side)&&i&&s.side!==i&&(s=this.organs.find(a=>!a.disabled&&a.organ===o&&a.side===i)),nn(s)}getOrgan(t,i="Female"){return this.source.getReferenceOrgans().pipe(me(r=>r.find(s=>s.representation_of===t.id&&("Both"===i||s.sex===i))))}getOrganScene(t,i="Female"){return t.id?this.source.getReferenceOrganScene(t.id,{ontologyTerms:[t.id],sex:i}):nn([])}getOrganStats(t,i="Female"){return t.id?this.source.getAggregateResults({ontologyTerms:[t.id],sex:i}):nn([])}getBlocks(t,i="Female"){return t.id?this.source.getTissueBlockResults({ontologyTerms:[t.id],sex:i}):nn([])}}return n.\u0275fac=function(t){return new(t||n)(Ie(QMe))},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const JMe=["thumbContainer"],eIe=["toggleBar"],tIe=["input"],nIe=function(n){return{enterDuration:n}},iIe=["*"],rIe=new zt("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let sIe=0;const oIe={provide:Ra,useExisting:fe(()=>cW),multi:!0};class aIe{constructor(e,t){this.source=e,this.checked=t}}const lIe=LN(Xv(FN(UC(class{constructor(n){this._elementRef=n}}))));let cW=(()=>{class n extends lIe{constructor(t,i,r,s,o,a){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=o,this._onChange=l=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++sIe,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new mn,this.toggleChange=new mn,this.tabIndex=parseInt(s)||0,this.color=this.defaultColor=o.color||"accent",this._noopAnimations="NoopAnimations"===a}get required(){return this._required}set required(t){this._required=zi(t)}get checked(){return this._checked}set checked(t){this._checked=zi(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new aIe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(De(wn),De(Xu),De(ts),function(n){return function(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const i=t.length;let r=0;for(;r{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})(),dIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[uW,HC,pr,nN],uW,pr]}),n})(),hIe=(()=>{class n{constructor(){this.clsName="ccf-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new mn}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Tc(i.clsName)},inputs:{labels:"labels",value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},decls:6,vars:12,consts:[[1,"slide-label",3,"click"],[1,"slider",3,"disabled","checked","change"],["toggle",""]],template:function(t,i){if(1&t){const r=wu();Pt(0,"span",0),kn("click",function(){Vo(r);const o=qp(3);return i.left||o.toggle(),i.updateToggle(!0)}),Si(1),Ft(),Pt(2,"mat-slide-toggle",1,2),kn("change",function(o){return i.updateToggle(!o.checked)}),Ft(),Pt(4,"span",0),kn("click",function(){Vo(r);const o=qp(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Si(5),Ft()}2&t&&(Ei("disabled",i.disabled)("highlighted",i.left),Yt(1),xs(i.labels[0].charAt(0).toUpperCase()+i.labels[0].slice(1)),Yt(1),on("disabled",i.disabled)("checked",!i.left),Yt(2),Ei("disabled",i.disabled)("highlighted",!i.left),Yt(1),xs(i.labels[1].charAt(0).toUpperCase()+i.labels[1].slice(1)))},directives:[cW],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer;opacity:50%}[_nghost-%COMP%] .slide-label.highlighted[_ngcontent-%COMP%]{opacity:100%}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%!important;cursor:not-allowed}[_nghost-%COMP%] .slider .mat-slide-toggle-bar{background-color:#43476580}[_nghost-%COMP%] .slider .mat-slide-toggle-thumb{background-color:#434765}"],changeDetection:0}),n})();const fIe=["bodyUI"],pIe=function(){return["Male","Female"]},gIe=function(){return["Left","Right"]};let mIe=(()=>{class n{constructor(t){this.ga=t,this.sexChange=new mn,this.sideChange=new mn}ngOnInit(){this.reset()}ngAfterViewChecked(){this.updateHighlighting()}updateHighlighting(){var t,i,r,s;const o=new Set(null!==(i=null===(t=this.filter)||void 0===t?void 0:t.tmc)&&void 0!==i?i:[]);this.filteredBlocks=null!==(s=null===(r=this.blocks)||void 0===r?void 0:r.filter(a=>o.has(a.donor.providerName)).map(a=>a["@id"]))&&void 0!==s?s:[],this.bodyUI.scene=this.bodyUI.scene.map(a=>{var l;return Object.assign(Object.assign({},a),{color:a.entityId&&this.highlightedNodeId===a["@id"]?[30,136,229,255]:this.filteredBlocks.includes(null!==(l=a.entityId)&&void 0!==l?l:"")?[173,255,47,229.5]:[255,255,255,229.5]})})}ngOnChanges(t){this.bodyUI&&"organ"in t&&this.reset()}updateSex(t){this.sex=t,this.sexChange.emit(this.sex)}updateSide(t){this.side=t,this.sideChange.emit(this.side)}reset(){const{bodyUI:t,organ:i}=this;if(i){i.side||(this.side=void 0);const{x_dimension:r,y_dimension:s,z_dimension:o}=i;t.rotation=t.rotationX=0,t.bounds={x:1.25*r/1e3,y:1.25*s/1e3,z:1.25*o/1e3},t.target=[r/1e3/2,s/1e3/2,o/1e3/2]}}nodeClicked(t){this.ga.event("node_click","organ",t.node["@id"]),this.highlightedNodeId=this.highlightedNodeId&&this.highlightedNodeId===t.node["@id"]?"":t.node["@id"]}}return n.\u0275fac=function(t){return new(t||n)(De(PE))},n.\u0275cmp=_n({type:n,selectors:[["ccf-organ"]],viewQuery:function(t,i){if(1&t&&Mr(fIe,7),2&t){let r;di(r=hi())&&(i.bodyUI=r.first)}},inputs:{organ:"organ",scene:"scene",organIri:"organIri",sex:"sex",side:"side",blocks:"blocks",filter:"filter"},outputs:{sexChange:"sexChange",sideChange:"sideChange"},features:[ki],decls:5,vars:9,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick"],["bodyUI",""],[1,"stage-options"],[1,"view-slider",3,"labels","value","valueChange"],[1,"view-slider",3,"labels","value","disabled","valueChange"]],template:function(t,i){1&t&&(Pt(0,"ccf-body-ui",0,1),kn("nodeClick",function(s){return i.nodeClicked(s)}),Ft(),Pt(2,"div",2),Pt(3,"ccf-slide-toggle",3),kn("valueChange",function(s){return i.updateSex(s)}),Ft(),Pt(4,"ccf-slide-toggle",4),kn("valueChange",function(s){return i.updateSide(s)}),Ft(),Ft()),2&t&&(on("scene",i.scene)("interactive",!0),Yt(3),on("labels",Mw(7,pIe))("value",i.sex),Yt(1),on("labels",Mw(8,gIe))("value",i.side)("disabled",!i.side))},directives:[gDe,hIe],styles:["[_nghost-%COMP%]{display:block;background-color:#000;border-radius:.5rem;color:#fff;height:100%}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{height:90%}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{padding:1rem;min-width:352px}"],changeDetection:0}),n})();function _Ie(n,e){if(1&n&&(Pt(0,"div",3),Pt(1,"div",4),Si(2),Ft(),Pt(3,"div",5),Si(4),Ft(),Ft()),2&n){const t=e.$implicit;Yt(2),xs(t.count),Yt(2),xs(t.label)}}let yIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-stats-list"]],inputs:{statsLabel:"statsLabel",stats:"stats"},decls:4,vars:2,consts:[[1,"stats-container"],[1,"header"],["class","stats-row",4,"ngFor","ngForOf"],[1,"stats-row"],[1,"stat"],[1,"label"]],template:function(t,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Si(2),Ft(),Ai(3,_Ie,5,2,"div",2),Ft()),2&t&&(Yt(2),Mc(" ",i.statsLabel," "),Yt(1),on("ngForOf",i.stats))},directives:[Ud],styles:[".stats-container[_ngcontent-%COMP%]{margin-bottom:2rem;min-height:9rem}.stats-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{margin-bottom:1rem}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;height:1.325rem}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%] .stat[_ngcontent-%COMP%]{width:2rem;margin-right:1rem;text-align:right}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{flex-grow:1;text-align:left}"],changeDetection:0}),n})();function vIe(n,e){if(1&n){const t=wu();Pt(0,"div",6),Pt(1,"div",7),Pt(2,"div",8),Si(3),Ft(),Pt(4,"div",9),kn("click",function(){const s=Vo(t).$implicit;return wr().goToURL(s.buttonUrl)}),Si(5),Ft(),Ft(),Ft()}if(2&n){const t=e.$implicit;Yt(3),xs(t.body),Yt(1),on("gaLabel",t.buttonUrl),Yt(1),Mc(" ",t.buttonTitle,"")}}function bIe(n,e){if(1&n){const t=wu();Pt(0,"div",10),kn("click",function(){const s=Vo(t).$implicit;return wr().goToURL(s.buttonUrl)}),Si(1),Ft()}if(2&n){const t=e.$implicit;on("gaLabel",t.buttonUrl),Yt(1),xs(t.buttonTitle)}}let wIe=(()=>{class n{constructor(){this.linkCards=[{body:"Add tissue blocks using the CCF Registration User Interface (RUI).",buttonTitle:"Register Tissue",buttonUrl:"https://hubmapconsortium.github.io/ccf-ui/rui/"},{body:"Explore tissue sections in tissue blocks with the CCF Exploration User Interface (EUI).",buttonTitle:"Explore Tissue",buttonUrl:"https://portal.hubmapconsortium.org/ccf-eui"},{body:"View linkages between anatomical structures, cell types, and common biomarkers (ASCT+B).",buttonTitle:"ASCT+B Reporter",buttonUrl:"https://hubmapconsortium.github.io/ccf-asct-reporter/"}],this.deepDives=[{body:"",buttonTitle:"CCF Portal",buttonUrl:"https://hubmapconsortium.github.io/ccf/"},{body:"",buttonTitle:"Online Course",buttonUrl:"https://expand.iu.edu/browse/sice/cns/courses/hubmap-visible-human-mooc"},{body:"",buttonTitle:"Paper",buttonUrl:"https://www.biorxiv.org/content/10.1101/2021.05.31.446440v2"}]}goToURL(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-link-cards"]],decls:7,vars:2,consts:[["gaCategory","link-cards",1,"link-cards-container"],["class","link-card",4,"ngFor","ngForOf"],["gaCategory","deep-dive",1,"deep-dive-section"],[1,"title"],[1,"button-container"],["class","btn-outline btn","gaEvent","visit-link",3,"gaLabel","click",4,"ngFor","ngForOf"],[1,"link-card"],[1,"link-card-content"],[1,"body"],["gaEvent","visit-link",1,"link-button","btn",3,"gaLabel","click"],["gaEvent","visit-link",1,"btn-outline","btn",3,"gaLabel","click"]],template:function(t,i){1&t&&(Pt(0,"div",0),Ai(1,vIe,6,3,"div",1),Ft(),Pt(2,"div",2),Pt(3,"div",3),Si(4,"Common Coordinate Framework (CCF) Deep Dive"),Ft(),Pt(5,"div",4),Ai(6,bIe,2,2,"div",5),Ft(),Ft()),2&t&&(Yt(1),on("ngForOf",i.linkCards),Yt(5),on("ngForOf",i.deepDives))},directives:[GB,Ud,$B],styles:[".link-cards-container[_ngcontent-%COMP%]{max-width:30rem}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%]{border-top:1px solid #e0e0e0;padding-top:1px;padding-bottom:1px}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%]:last-of-type{border-bottom:1px solid #e0e0e0}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%]{align-items:center;padding:1rem 0 1rem 1rem;display:flex;flex-direction:row;justify-content:space-between;border-left:6px solid #444A65}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%] .link-button[_ngcontent-%COMP%]{margin-left:2rem;background-color:#444a65;color:#fff}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%] .link-button[_ngcontent-%COMP%]:hover{background-color:#2f3346}.deep-dive-section[_ngcontent-%COMP%]{margin-top:2rem}.deep-dive-section[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-bottom:1rem;font-size:1rem}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%]{display:flex;flex-direction:row}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]{color:#444a65;border:1px solid #444A65;background-color:#fff}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]:not(:last-of-type){margin-right:1rem}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]:hover{background-color:#e0e0e0}.btn[_ngcontent-%COMP%]{min-width:9rem!important;max-height:2.28125rem;text-align:center;white-space:nowrap;cursor:pointer;font-size:.875rem;font-weight:500;border-radius:2px;line-height:2.75;transition:background-color .25s cubic-bezier(.4,0,.2,1) 0ms,box-shadow .25s cubic-bezier(.4,0,.2,1) 0ms,border .25s cubic-bezier(.4,0,.2,1) 0ms;font-family:Inter Variable,Helvetica,Arial,sans-serif}"],changeDetection:0}),n})();const EIe=["left"],SIe=["right"],CIe=function(){return[]},xIe=[{color:[0,0,0,0],opacity:.001}];let AIe=(()=>{class n{constructor(t,i,r){this.ga=i,this.configState=r,this.sex$=this.configState.getOption("sex"),this.side$=this.configState.getOption("side"),this.filter$=this.configState.getOption("highlightProviders").pipe(me(s=>({tmc:s}))),this.latestConfig={},this.organInfo$=r.config$.pipe(jr(s=>this.latestConfig=s),sr(s=>{var o,a,l;return t.getOrganInfo(null!==(o=s.organIri)&&void 0!==o?o:"",null===(l=null===(a=s.side)||void 0===a?void 0:a.toLowerCase)||void 0===l?void 0:l.call(a),s.sex)}),jr(s=>this.logOrganLookup(s)),ml(1)),this.organ$=this.organInfo$.pipe(sr(s=>s?t.getOrgan(s,this.latestConfig.sex):nn(void 0)),ml(1)),this.scene$=this.organ$.pipe(nb(this.organInfo$),sr(([s,o])=>s&&o?t.getOrganScene(o,this.latestConfig.sex):nn(xIe))),this.stats$=this.organInfo$.pipe(sr(s=>s?t.getOrganStats(s,this.latestConfig.sex):nn([]))),this.statsLabel$=this.stats$.pipe(nb(this.organInfo$),me(([s,o])=>this.makeStatsLabel(o)),function(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>gE(n,t,e)):t=>gE(n,t)}("Loading...")),this.blocks$=this.organInfo$.pipe(sr(s=>s?t.getBlocks(s,this.latestConfig.sex):nn([])))}ngAfterViewInit(){const{left:t,right:i}=this;t.nativeElement.style.height=`${i.nativeElement.offsetHeight}px`}updateInput(t,i){this.configState.patchConfig({[t]:i})}makeStatsLabel(t){let i=[`Unknown IRI: ${this.latestConfig.organIri}`];return t&&(i=[this.latestConfig.sex,t.organ,t.side]),i.filter(r=>!!r).join(", ")}logOrganLookup(t){this.ga.event(t?"organ_lookup_success":"organ_lookup_failure","organ",`Iri: ${this.latestConfig.organIri} - Sex: ${this.latestConfig.sex} - Side: ${this.latestConfig.side}`)}}return n.\u0275fac=function(t){return new(t||n)(De(ZMe),De(PE),De(cx))},n.\u0275cmp=_n({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&(Mr(EIe,7,wn),Mr(SIe,7,wn)),2&t){let r;di(r=hi())&&(i.left=r.first),di(r=hi())&&(i.right=r.first)}},decls:16,vars:25,consts:[[1,"container"],[1,"left"],["left",""],[3,"blocks","filter","sex","side","organ","scene","sexChange","sideChange"],[1,"right"],["right",""],[3,"statsLabel","stats"]],template:function(t,i){if(1&t&&(Pt(0,"div",0),Pt(1,"div",1,2),Pt(3,"ccf-organ",3),kn("sexChange",function(s){return i.updateInput("sex",s)})("sideChange",function(s){return i.updateInput("side",s)}),cl(4,"async"),cl(5,"async"),cl(6,"async"),cl(7,"async"),cl(8,"async"),cl(9,"async"),Ft(),Ft(),Pt(10,"div",4,5),wi(12,"ccf-stats-list",6),cl(13,"async"),cl(14,"async"),wi(15,"ccf-link-cards"),Ft(),Ft()),2&t){let r;Yt(3),on("blocks",ul(4,8,i.blocks$))("filter",ul(5,10,i.filter$))("sex",ul(6,12,i.sex$))("side",ul(7,14,i.side$))("organ",ul(8,16,i.organ$))("scene",null!==(r=ul(9,18,i.scene$))&&void 0!==r?r:Mw(24,CIe)),Yt(9),on("statsLabel",ul(13,20,i.statsLabel$))("stats",ul(14,22,i.stats$))}},directives:[mIe,yIe,wIe],pipes:[iE],styles:[".container[_ngcontent-%COMP%]{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:flex;flex-direction:row;padding:1rem;font-family:Inter;font-size:.95rem;line-height:1.5;text-align:left;position:relative;background-color:#fff;color:#000}.container[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{width:auto;flex-grow:1}.container[_ngcontent-%COMP%] .right[_ngcontent-%COMP%]{margin-left:2rem;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:29rem}"],changeDetection:0}),n})();function TIe(n,e){1&n&&wi(0,"ccf-root")}function DIe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){const i=KB_json(n);if(t(i))return i}else if(t(n))return n;throw new Error("Invalid data sources")}function MIe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){if(!(null==n?void 0:n.startsWith("[")))return[n];{const i=KB_json(n);if(t(i))return i}}else if(t(n))return n;throw new Error("Invalid data sources")}let IIe=(()=>{class n extends qne{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},$d.dbOptions),globalThis.dbOptions),parse:{dataSources:DIe,highlightProviders:MIe}}),this.sex="Female",this.side="Left"}}return n.\u0275fac=function(t){return new(t||n)(De(cx),De(ts))},n.\u0275cmp=_n({type:n,selectors:[["ccf-root-wc"]],inputs:{organIri:"organIri",sex:"sex",side:"side",dataSources:"dataSources",highlightProviders:"highlightProviders",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl"},features:[Dn],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&Ai(0,TIe,1,0,"ccf-root",0),2&t&&on("ngIf",i.initialized)},directives:[Mu,AIe],encapsulation:2,changeDetection:0}),n})(),OIe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[os,Ba,L$,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(os,2),Ie(Ba,2))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const mx=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class PIe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=Of(this.action),i=function(n){return mx(n.getHours(),2)+":"+mx(n.getMinutes(),2)+":"+mx(n.getSeconds(),2)+"."+mx(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class FIe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const dW=new zt("NGXS_LOGGER_PLUGIN_OPTIONS");let LIe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new FIe(this._options),this._store=this._store||this._injector.get(ih);const s=new PIe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(jr(o=>{s.completed(o)}),Xl(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(dW),Ie(zn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const hW=new zt("LOGGER_USER_OPTIONS");function kIe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let BIe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:tH,useClass:LIe,multi:!0},{provide:hW,useValue:t},{provide:dW,useFactory:kIe,deps:[hW]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const jIe=[cx];let fW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[OIe.forRoot(),oa.forRoot(jIe,{developmentMode:!$d.production}),BIe.forRoot({disabled:$d.production})]]}),n})(),VIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,dIe]]}),n})(),UIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,mDe,VIe]]}),n})(),zIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,FE]]}),n})(),HIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr]]}),n})(),GIe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ol).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new qJ(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends KJ{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(IIe,{injector:this.injector});customElements.define("ccf-organ-info",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[],imports:[[UD,zIe,HIe,UIe,fW,fW,Gne.forRoot({gaToken:$d.googleAnalyticsToken,appName:"organ-info",projectName:"ccf",developmentMode:!$d.production})]]}),n})();$d.production&&function(){if(gk)throw new Error("Cannot enable prod mode after platform setup.");pk=!1}(),mJ().bootstrapModule(GIe).catch(n=>console.error(n))},52:jt=>{function it(gt,J,xt,ut,Y,Ae,he){try{var W=gt[Ae](he),V=W.value}catch(L){return void xt(L)}W.done?J(V):Promise.resolve(V).then(ut,Y)}jt.exports=function(gt){return function(){var J=this,xt=arguments;return new Promise(function(ut,Y){var Ae=gt.apply(J,xt);function he(V){it(Ae,ut,Y,he,W,"next",V)}function W(V){it(Ae,ut,Y,he,W,"throw",V)}he(void 0)})}},jt.exports.default=jt.exports,jt.exports.__esModule=!0},948:jt=>{jt.exports=function(tt){return tt&&tt.__esModule?tt:{default:tt}},jt.exports.default=jt.exports,jt.exports.__esModule=!0},321:jt=>{function it(tt){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(jt.exports=it=function(J){return typeof J},jt.exports.default=jt.exports,jt.exports.__esModule=!0):(jt.exports=it=function(J){return J&&"function"==typeof Symbol&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},jt.exports.default=jt.exports,jt.exports.__esModule=!0),it(tt)}jt.exports=it,jt.exports.default=jt.exports,jt.exports.__esModule=!0},82:jt=>{function it(tt){return Promise.resolve().then(()=>{var gt=new Error("Cannot find module '"+tt+"'");throw gt.code="MODULE_NOT_FOUND",gt})}it.keys=()=>[],it.resolve=it,it.id=82,jt.exports=it},521:()=>{},125:()=>{},307:()=>{}},jt=>{jt(jt.s=289)}]); \ No newline at end of file +var $Ie=Object.defineProperty,WIe=Object.defineProperties,qIe=Object.getOwnPropertyDescriptors,_x=Object.getOwnPropertySymbols,gW=Object.prototype.hasOwnProperty,mW=Object.prototype.propertyIsEnumerable,gr=Math.pow,_W=(jt,it,tt)=>it in jt?$Ie(jt,it,{enumerable:!0,configurable:!0,writable:!0,value:tt}):jt[it]=tt,ht=(jt,it)=>{for(var tt in it||(it={}))gW.call(it,tt)&&_W(jt,tt,it[tt]);if(_x)for(var tt of _x(it))mW.call(it,tt)&&_W(jt,tt,it[tt]);return jt},Vn=(jt,it)=>WIe(jt,qIe(it)),yW=(jt,it)=>{var tt={};for(var gt in jt)gW.call(jt,gt)&&it.indexOf(gt)<0&&(tt[gt]=jt[gt]);if(null!=jt&&_x)for(var gt of _x(jt))it.indexOf(gt)<0&&mW.call(jt,gt)&&(tt[gt]=jt[gt]);return tt};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(jt,it,tt)=>{var gt=tt(52).default;jt.exports=function Y(Ae,he,W){function V($,b){if(!he[$]){if(!Ae[$]){if(L)return L($,!0);var R=new Error("Cannot find module '"+$+"'");throw R.code="MODULE_NOT_FOUND",R}var A=he[$]={exports:{}};Ae[$][0].call(A.exports,function(v){return V(Ae[$][1][v]||v)},A,A.exports,Y,Ae,he,W)}return he[$].exports}for(var L=void 0,re=0;re0&&z[z.length-1])&&(6===Pe[0]||2===Pe[0])){Ue=0;continue}if(3===Pe[0]&&(!z||Pe[1]>z[0]&&Pe[1]0?K-4:K;for(U=0;U>16&255,F[Q++]=I>>8&255,F[Q++]=255&I;return 2===M&&(I=V[j.charCodeAt(U)]<<2|V[j.charCodeAt(U+1)]>>4,F[Q++]=255&I),1===M&&(I=V[j.charCodeAt(U)]<<10|V[j.charCodeAt(U+1)]<<4|V[j.charCodeAt(U+2)]>>2,F[Q++]=I>>8&255,F[Q++]=255&I),F},he.fromByteArray=function(j){for(var I,H=j.length,K=H%3,M=[],F=16383,Q=0,E=H-K;QE?E:Q+F));return 1===K?M.push(W[(I=j[H-1])>>2]+W[I<<4&63]+"=="):2===K&&M.push(W[(I=(j[H-2]<<8)+j[H-1])>>10]+W[I>>4&63]+W[I<<2&63]+"="),M.join("")};for(var W=[],V=[],L="undefined"!=typeof Uint8Array?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,b=re.length;$0)throw new Error("Invalid string. Length must be a multiple of 4");var H=j.indexOf("=");return-1===H&&(H=I),[H,H===I?0:4-H%4]}function y(j){return W[j>>18&63]+W[j>>12&63]+W[j>>6&63]+W[63&j]}function w(j,I,H){for(var M=[],F=I;F>5==6?2:M>>4==14?3:M>>3==30?4:M>>6==2?-1:-2}function A(M){var F=this.lastTotal-this.lastNeed,Q=function(M,F,Q){if(128!=(192&F[0]))return M.lastNeed=0,"\ufffd";if(M.lastNeed>1&&F.length>1){if(128!=(192&F[1]))return M.lastNeed=1,"\ufffd";if(M.lastNeed>2&&F.length>2&&128!=(192&F[2]))return M.lastNeed=2,"\ufffd"}}(this,M);return void 0!==Q?Q:this.lastNeed<=M.length?(M.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(M.copy(this.lastChar,F,0,M.length),void(this.lastNeed-=M.length))}function w(M,F){if((M.length-F)%2==0){var Q=M.toString("utf16le",F);if(Q){var E=Q.charCodeAt(Q.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],Q.slice(0,-1)}return Q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",F,M.length-1)}function D(M){var F=M&&M.length?this.write(M):"";return this.lastNeed?F+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):F}function j(M,F){var Q=(M.length-F)%3;return 0===Q?M.toString("base64",F):(this.lastNeed=3-Q,this.lastTotal=3,1===Q?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",F,M.length-Q))}function I(M){var F=M&&M.length?this.write(M):"";return this.lastNeed?F+this.lastChar.toString("base64",0,3-this.lastNeed):F}function H(M){return M.toString(this.encoding)}function K(M){return M&&M.length?this.write(M):""}he.StringDecoder=$,$.prototype.write=function(M){if(0===M.length)return"";var F,Q;if(this.lastNeed){if(void 0===(F=this.fillLast(M)))return"";Q=this.lastNeed,this.lastNeed=0}else Q=0;return Q=0?(U>0&&(M.lastNeed=U-1),U):--E=0?(U>0&&(M.lastNeed=U-2),U):--E=0?(U>0&&(2===U?U=0:M.lastNeed=U-3),U):0}(this,M,F);if(!this.lastNeed)return M.toString("utf8",F);this.lastTotal=Q;var E=M.length-(Q-this.lastNeed);return M.copy(this.lastChar,0,E),M.toString("utf8",F,E)},$.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length}},{"safe-buffer":4}],6:[function(Y,Ae,he){(function(W){(function(){"use strict";var V=Y("base64-js"),L=Y("ieee754");he.Buffer=S,he.SlowBuffer=function(B){return+B!=B&&(B=0),S.alloc(+B)},he.INSPECT_MAX_BYTES=50;var re=2147483647;function b(B){if(B>re)throw new RangeError('The value "'+B+'" is invalid for option "size"');var O=new Uint8Array(B);return O.__proto__=S.prototype,O}function S(B,O,k){if("number"==typeof B){if("string"==typeof O)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return R(B,O,k)}function R(B,O,k){if("string"==typeof B)return function(B,O){if(("string"!=typeof O||""===O)&&(O="utf8"),!S.isEncoding(O))throw new TypeError("Unknown encoding: "+O);var k=0|M(B,O),Re=b(k),Xe=Re.write(B,O);return Xe!==k&&(Re=Re.slice(0,Xe)),Re}(B,O);if(ArrayBuffer.isView(B))return D(B);if(null==B)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(pt(B,ArrayBuffer)||B&&pt(B.buffer,ArrayBuffer))return function(B,O,k){if(O<0||B.byteLength=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return 0|B}function M(B,O){if(S.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||pt(B,ArrayBuffer))return B.byteLength;if("string"!=typeof B)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var k=B.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===k)return 0;for(var Xe=!1;;)switch(O){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return X(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Pe(B).length;default:if(Xe)return Re?-1:X(B).length;O=(""+O).toLowerCase(),Xe=!0}}function F(B,O,k){var Re=!1;if((void 0===O||O<0)&&(O=0),O>this.length||((void 0===k||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(O>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return Je(this,O,k);case"utf8":case"utf-8":return ye(this,O,k);case"ascii":return nt(this,O,k);case"latin1":case"binary":return Ze(this,O,k);case"base64":return te(this,O,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,O,k);default:if(Re)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Re=!0}}function Q(B,O,k){var Re=B[O];B[O]=B[k],B[k]=Re}function E(B,O,k,Re,Xe){if(0===B.length)return-1;if("string"==typeof k?(Re=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),pe(k=+k)&&(k=Xe?0:B.length-1),k<0&&(k=B.length+k),k>=B.length){if(Xe)return-1;k=B.length-1}else if(k<0){if(!Xe)return-1;k=0}if("string"==typeof O&&(O=S.from(O,Re)),S.isBuffer(O))return 0===O.length?-1:U(B,O,k,Re,Xe);if("number"==typeof O)return O&=255,"function"==typeof Uint8Array.prototype.indexOf?Xe?Uint8Array.prototype.indexOf.call(B,O,k):Uint8Array.prototype.lastIndexOf.call(B,O,k):U(B,[O],k,Re,Xe);throw new TypeError("val must be string, number or Buffer")}function U(B,O,k,Re,Xe){var Hn,yt=1,It=B.length,An=O.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(B.length<2||O.length<2)return-1;yt=2,It/=2,An/=2,k/=2}function Rn(Is,as){return 1===yt?Is[as]:Is.readUInt16BE(as*yt)}if(Xe){var yi=-1;for(Hn=k;HnIt&&(k=It-An),Hn=k;Hn>=0;Hn--){for(var ci=!0,Ur=0;UrXe&&(Re=Xe):Re=Xe;var yt=O.length;Re>yt/2&&(Re=yt/2);for(var It=0;It>8,yt.push(k%256),yt.push(Re);return yt}(O,B.length-k),B,k,Re)}function te(B,O,k){return V.fromByteArray(0===O&&k===B.length?B:B.slice(O,k))}function ye(B,O,k){k=Math.min(B.length,k);for(var Re=[],Xe=O;Xe239?4:yt>223?3:yt>191?2:1;if(Xe+An<=k)switch(An){case 1:yt<128&&(It=yt);break;case 2:128==(192&(Rn=B[Xe+1]))&&(ci=(31&yt)<<6|63&Rn)>127&&(It=ci);break;case 3:Hn=B[Xe+2],128==(192&(Rn=B[Xe+1]))&&128==(192&Hn)&&(ci=(15&yt)<<12|(63&Rn)<<6|63&Hn)>2047&&(ci<55296||ci>57343)&&(It=ci);break;case 4:Hn=B[Xe+2],yi=B[Xe+3],128==(192&(Rn=B[Xe+1]))&&128==(192&Hn)&&128==(192&yi)&&(ci=(15&yt)<<18|(63&Rn)<<12|(63&Hn)<<6|63&yi)>65535&&ci<1114112&&(It=ci)}null===It?(It=65533,An=1):It>65535&&(Re.push((It-=65536)>>>10&1023|55296),It=56320|1023&It),Re.push(It),Xe+=An}return function(B){var O=B.length;if(O<=4096)return String.fromCharCode.apply(String,B);for(var k="",Re=0;Rek&&(O+=" ... "),""},S.prototype.compare=function(O,k,Re,Xe,yt){if(pt(O,Uint8Array)&&(O=S.from(O,O.offset,O.byteLength)),!S.isBuffer(O))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof O);if(void 0===k&&(k=0),void 0===Re&&(Re=O?O.length:0),void 0===Xe&&(Xe=0),void 0===yt&&(yt=this.length),k<0||Re>O.length||Xe<0||yt>this.length)throw new RangeError("out of range index");if(Xe>=yt&&k>=Re)return 0;if(Xe>=yt)return-1;if(k>=Re)return 1;if(this===O)return 0;for(var It=(yt>>>=0)-(Xe>>>=0),An=(Re>>>=0)-(k>>>=0),Rn=Math.min(It,An),Hn=this.slice(Xe,yt),yi=O.slice(k,Re),ci=0;ci>>=0,isFinite(Re)?(Re>>>=0,void 0===Xe&&(Xe="utf8")):(Xe=Re,Re=void 0)}var yt=this.length-k;if((void 0===Re||Re>yt)&&(Re=yt),O.length>0&&(Re<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");Xe||(Xe="utf8");for(var It=!1;;)switch(Xe){case"hex":return ie(this,O,k,Re);case"utf8":case"utf-8":return ue(this,O,k,Re);case"ascii":return ee(this,O,k,Re);case"latin1":case"binary":return se(this,O,k,Re);case"base64":return Te(this,O,k,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,O,k,Re);default:if(It)throw new TypeError("Unknown encoding: "+Xe);Xe=(""+Xe).toLowerCase(),It=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(B,O,k){var Re="";k=Math.min(B.length,k);for(var Xe=O;XeRe)&&(k=Re);for(var Xe="",yt=O;ytk)throw new RangeError("Trying to access beyond buffer length")}function Le(B,O,k,Re,Xe,yt){if(!S.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>Xe||OB.length)throw new RangeError("Index out of range")}function Ee(B,O,k,Re,Xe,yt){if(k+Re>B.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Oe(B,O,k,Re,Xe){return O=+O,k>>>=0,Xe||Ee(B,0,k,4),L.write(B,O,k,Re,23,4),k+4}function Ue(B,O,k,Re,Xe){return O=+O,k>>>=0,Xe||Ee(B,0,k,8),L.write(B,O,k,Re,52,8),k+8}S.prototype.slice=function(O,k){var Re=this.length;(O=~~O)<0?(O+=Re)<0&&(O=0):O>Re&&(O=Re),(k=void 0===k?Re:~~k)<0?(k+=Re)<0&&(k=0):k>Re&&(k=Re),k>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O],yt=1,It=0;++It>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O+--k],yt=1;k>0&&(yt*=256);)Xe+=this[O+--k]*yt;return Xe},S.prototype.readUInt8=function(O,k){return O>>>=0,k||je(O,1,this.length),this[O]},S.prototype.readUInt16LE=function(O,k){return O>>>=0,k||je(O,2,this.length),this[O]|this[O+1]<<8},S.prototype.readUInt16BE=function(O,k){return O>>>=0,k||je(O,2,this.length),this[O]<<8|this[O+1]},S.prototype.readUInt32LE=function(O,k){return O>>>=0,k||je(O,4,this.length),(this[O]|this[O+1]<<8|this[O+2]<<16)+16777216*this[O+3]},S.prototype.readUInt32BE=function(O,k){return O>>>=0,k||je(O,4,this.length),16777216*this[O]+(this[O+1]<<16|this[O+2]<<8|this[O+3])},S.prototype.readIntLE=function(O,k,Re){O>>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O],yt=1,It=0;++It=(yt*=128)&&(Xe-=Math.pow(2,8*k)),Xe},S.prototype.readIntBE=function(O,k,Re){O>>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=k,yt=1,It=this[O+--Xe];Xe>0&&(yt*=256);)It+=this[O+--Xe]*yt;return It>=(yt*=128)&&(It-=Math.pow(2,8*k)),It},S.prototype.readInt8=function(O,k){return O>>>=0,k||je(O,1,this.length),128&this[O]?-1*(255-this[O]+1):this[O]},S.prototype.readInt16LE=function(O,k){O>>>=0,k||je(O,2,this.length);var Re=this[O]|this[O+1]<<8;return 32768&Re?4294901760|Re:Re},S.prototype.readInt16BE=function(O,k){O>>>=0,k||je(O,2,this.length);var Re=this[O+1]|this[O]<<8;return 32768&Re?4294901760|Re:Re},S.prototype.readInt32LE=function(O,k){return O>>>=0,k||je(O,4,this.length),this[O]|this[O+1]<<8|this[O+2]<<16|this[O+3]<<24},S.prototype.readInt32BE=function(O,k){return O>>>=0,k||je(O,4,this.length),this[O]<<24|this[O+1]<<16|this[O+2]<<8|this[O+3]},S.prototype.readFloatLE=function(O,k){return O>>>=0,k||je(O,4,this.length),L.read(this,O,!0,23,4)},S.prototype.readFloatBE=function(O,k){return O>>>=0,k||je(O,4,this.length),L.read(this,O,!1,23,4)},S.prototype.readDoubleLE=function(O,k){return O>>>=0,k||je(O,8,this.length),L.read(this,O,!0,52,8)},S.prototype.readDoubleBE=function(O,k){return O>>>=0,k||je(O,8,this.length),L.read(this,O,!1,52,8)},S.prototype.writeUIntLE=function(O,k,Re,Xe){O=+O,k>>>=0,Re>>>=0,Xe||Le(this,O,k,Re,Math.pow(2,8*Re)-1,0);var It=1,An=0;for(this[k]=255&O;++An>>=0,Re>>>=0,Xe||Le(this,O,k,Re,Math.pow(2,8*Re)-1,0);var It=Re-1,An=1;for(this[k+It]=255&O;--It>=0&&(An*=256);)this[k+It]=O/An&255;return k+Re},S.prototype.writeUInt8=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,1,255,0),this[k]=255&O,k+1},S.prototype.writeUInt16LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,65535,0),this[k]=255&O,this[k+1]=O>>>8,k+2},S.prototype.writeUInt16BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,65535,0),this[k]=O>>>8,this[k+1]=255&O,k+2},S.prototype.writeUInt32LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,4294967295,0),this[k+3]=O>>>24,this[k+2]=O>>>16,this[k+1]=O>>>8,this[k]=255&O,k+4},S.prototype.writeUInt32BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,4294967295,0),this[k]=O>>>24,this[k+1]=O>>>16,this[k+2]=O>>>8,this[k+3]=255&O,k+4},S.prototype.writeIntLE=function(O,k,Re,Xe){if(O=+O,k>>>=0,!Xe){var yt=Math.pow(2,8*Re-1);Le(this,O,k,Re,yt-1,-yt)}var It=0,An=1,Rn=0;for(this[k]=255&O;++It>0)-Rn&255;return k+Re},S.prototype.writeIntBE=function(O,k,Re,Xe){if(O=+O,k>>>=0,!Xe){var yt=Math.pow(2,8*Re-1);Le(this,O,k,Re,yt-1,-yt)}var It=Re-1,An=1,Rn=0;for(this[k+It]=255&O;--It>=0&&(An*=256);)O<0&&0===Rn&&0!==this[k+It+1]&&(Rn=1),this[k+It]=(O/An>>0)-Rn&255;return k+Re},S.prototype.writeInt8=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,1,127,-128),O<0&&(O=255+O+1),this[k]=255&O,k+1},S.prototype.writeInt16LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,32767,-32768),this[k]=255&O,this[k+1]=O>>>8,k+2},S.prototype.writeInt16BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,32767,-32768),this[k]=O>>>8,this[k+1]=255&O,k+2},S.prototype.writeInt32LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,2147483647,-2147483648),this[k]=255&O,this[k+1]=O>>>8,this[k+2]=O>>>16,this[k+3]=O>>>24,k+4},S.prototype.writeInt32BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,2147483647,-2147483648),O<0&&(O=4294967295+O+1),this[k]=O>>>24,this[k+1]=O>>>16,this[k+2]=O>>>8,this[k+3]=255&O,k+4},S.prototype.writeFloatLE=function(O,k,Re){return Oe(this,O,k,!0,Re)},S.prototype.writeFloatBE=function(O,k,Re){return Oe(this,O,k,!1,Re)},S.prototype.writeDoubleLE=function(O,k,Re){return Ue(this,O,k,!0,Re)},S.prototype.writeDoubleBE=function(O,k,Re){return Ue(this,O,k,!1,Re)},S.prototype.copy=function(O,k,Re,Xe){if(!S.isBuffer(O))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Xe&&0!==Xe&&(Xe=this.length),k>=O.length&&(k=O.length),k||(k=0),Xe>0&&Xe=this.length)throw new RangeError("Index out of range");if(Xe<0)throw new RangeError("sourceEnd out of bounds");Xe>this.length&&(Xe=this.length),O.length-k=0;--It)O[It+k]=this[It+Re];else Uint8Array.prototype.set.call(O,this.subarray(Re,Xe),k);return yt},S.prototype.fill=function(O,k,Re,Xe){if("string"==typeof O){if("string"==typeof k?(Xe=k,k=0,Re=this.length):"string"==typeof Re&&(Xe=Re,Re=this.length),void 0!==Xe&&"string"!=typeof Xe)throw new TypeError("encoding must be a string");if("string"==typeof Xe&&!S.isEncoding(Xe))throw new TypeError("Unknown encoding: "+Xe);if(1===O.length){var yt=O.charCodeAt(0);("utf8"===Xe&&yt<128||"latin1"===Xe)&&(O=yt)}}else"number"==typeof O&&(O&=255);if(k<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,O||(O=0),"number"==typeof O)for(It=k;It55295&&k<57344){if(!Xe){if(k>56319){(O-=3)>-1&&yt.push(239,191,189);continue}if(It+1===Re){(O-=3)>-1&&yt.push(239,191,189);continue}Xe=k;continue}if(k<56320){(O-=3)>-1&&yt.push(239,191,189),Xe=k;continue}k=65536+(Xe-55296<<10|k-56320)}else Xe&&(O-=3)>-1&&yt.push(239,191,189);if(Xe=null,k<128){if((O-=1)<0)break;yt.push(k)}else if(k<2048){if((O-=2)<0)break;yt.push(k>>6|192,63&k|128)}else if(k<65536){if((O-=3)<0)break;yt.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((O-=4)<0)break;yt.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return yt}function Pe(B){return V.toByteArray(function(B){if((B=(B=B.split("=")[0]).trim().replace(qe,"")).length<2)return"";for(;B.length%4!=0;)B+="=";return B}(B))}function Et(B,O,k,Re){for(var Xe=0;Xe=O.length||Xe>=B.length);++Xe)O[Xe+k]=B[Xe];return Xe}function pt(B,O){return B instanceof O||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===O.name}function pe(B){return B!=B}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Ae,he){"use strict";Ae.exports=function W(V){return null===V||"object"!=typeof V||null!=V.toJSON?JSON.stringify(V):Array.isArray(V)?"["+V.reduce((L,re,$)=>L+(0===$?"":",")+W(void 0===re||"symbol"==typeof re?null:re),"")+"]":"{"+Object.keys(V).sort().reduce((L,re,$)=>void 0===V[re]||"symbol"==typeof V[re]?L:L+(0===L.length?"":",")+W(re)+":"+W(V[re]),"")+"}"}},{}],8:[function(Y,Ae,he){"use strict";var L,W="object"==typeof Reflect?Reflect:null,V=W&&"function"==typeof W.apply?W.apply:function(U,ie,ue){return Function.prototype.apply.call(U,ie,ue)};L=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:function(U){return Object.getOwnPropertyNames(U)};var $=Number.isNaN||function(U){return U!=U};function b(){b.init.call(this)}Ae.exports=b,Ae.exports.once=function(E,U){return new Promise(function(ie,ue){function ee(Te){E.removeListener(U,se),ue(Te)}function se(){"function"==typeof E.removeListener&&E.removeListener("error",ee),ie([].slice.call(arguments))}Q(E,U,se,{once:!0}),"error"!==U&&function(E,U,ie){"function"==typeof E.on&&Q(E,"error",U,ie)}(E,ee,{once:!0})})},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var S=10;function R(E){if("function"!=typeof E)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function A(E){return void 0===E._maxListeners?b.defaultMaxListeners:E._maxListeners}function v(E,U,ie,ue){var ee,se,Te;if(R(ie),void 0===(se=E._events)?(se=E._events=Object.create(null),E._eventsCount=0):(void 0!==se.newListener&&(E.emit("newListener",U,ie.listener?ie.listener:ie),se=E._events),Te=se[U]),void 0===Te)Te=se[U]=ie,++E._eventsCount;else if("function"==typeof Te?Te=se[U]=ue?[ie,Te]:[Te,ie]:ue?Te.unshift(ie):Te.push(ie),(ee=A(E))>0&&Te.length>ee&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=U,me.count=Te.length,function(E){console&&console.warn&&console.warn(E)}(me)}return E}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(E,U,ie){var ue={fired:!1,wrapFn:void 0,target:E,type:U,listener:ie},ee=y.bind(ue);return ee.listener=ie,ue.wrapFn=ee,ee}function D(E,U,ie){var ue=E._events;if(void 0===ue)return[];var ee=ue[U];return void 0===ee?[]:"function"==typeof ee?ie?[ee.listener||ee]:[ee]:ie?function(E){for(var U=new Array(E.length),ie=0;ie0&&(Te=ie[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var te=se[U];if(void 0===te)return!1;if("function"==typeof te)V(te,this,ie);else{var ye=te.length,Me=I(te,ye);for(ue=0;ue=0;Te--)if(ue[Te]===ie||ue[Te].listener===ie){me=ue[Te].listener,se=Te;break}if(se<0)return this;0===se?ue.shift():function(E,U){for(;U+1=0;ee--)this.removeListener(U,ie[ee]);return this},b.prototype.listeners=function(U){return D(this,U,!0)},b.prototype.rawListeners=function(U){return D(this,U,!1)},b.listenerCount=function(E,U){return"function"==typeof E.listenerCount?E.listenerCount(U):j.call(E,U)},b.prototype.listenerCount=j,b.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},{}],9:[function(Y,Ae,he){he.read=function(W,V,L,re,$){var b,S,R=8*$-re-1,A=(1<>1,y=-7,w=L?$-1:0,D=L?-1:1,j=W[V+w];for(w+=D,b=j&(1<<-y)-1,j>>=-y,y+=R;y>0;b=256*b+W[V+w],w+=D,y-=8);for(S=b&(1<<-y)-1,b>>=-y,y+=re;y>0;S=256*S+W[V+w],w+=D,y-=8);if(0===b)b=1-v;else{if(b===A)return S?NaN:1/0*(j?-1:1);S+=Math.pow(2,re),b-=v}return(j?-1:1)*S*Math.pow(2,b-re)},he.write=function(W,V,L,re,$,b){var S,R,A,v=8*b-$-1,y=(1<>1,D=23===$?Math.pow(2,-24)-Math.pow(2,-77):0,j=re?0:b-1,I=re?1:-1,H=V<0||0===V&&1/V<0?1:0;for(V=Math.abs(V),isNaN(V)||V===1/0?(R=isNaN(V)?1:0,S=y):(S=Math.floor(Math.log(V)/Math.LN2),V*(A=Math.pow(2,-S))<1&&(S--,A*=2),(V+=S+w>=1?D/A:D*Math.pow(2,1-w))*A>=2&&(S++,A/=2),S+w>=y?(R=0,S=y):S+w>=1?(R=(V*A-1)*Math.pow(2,$),S+=w):(R=V*Math.pow(2,w-1)*Math.pow(2,$),S=0));$>=8;W[L+j]=255&R,j+=I,R/=256,$-=8);for(S=S<<$|R,v+=$;v>0;W[L+j]=255&S,j+=I,S/=256,v-=8);W[L+j-I]|=128*H}},{}],10:[function(Y,Ae,he){Ae.exports="function"==typeof Object.create?function(V,L){L&&(V.super_=L,V.prototype=Object.create(L.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}))}:function(V,L){if(L){V.super_=L;var re=function(){};re.prototype=L.prototype,V.prototype=new re,V.prototype.constructor=V}}},{}],11:[function(Y,Ae,he){"use strict";const{isArray:W,isObject:V,isString:L}=Y("./types"),{asArray:re}=Y("./util"),{prependBase:$}=Y("./url"),b=Y("./JsonLdError"),S=Y("./ResolvedContext");function A(y){throw new b("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function v({context:y,base:w}){if(!y)return;const D=y["@context"];if(L(D))y["@context"]=$(w,D);else if(W(D))for(let j=0;j10)throw new b("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"loading remote context failed":"context overflow",max:10});if(I.has(D))throw new b("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"recursive context inclusion":"context overflow",url:D});let H,K;I.add(D);try{K=yield j(D),H=K.document||null,L(H)&&(H=JSON.parse(H))}catch(M){throw new b("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:D,cause:M})}if(!V(H))throw new b("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:D});return H="@context"in H?{"@context":H["@context"]}:{"@context":{}},K.contextUrl&&(W(H["@context"])||(H["@context"]=[H["@context"]]),H["@context"].push(K.contextUrl)),{context:H,remoteDoc:K}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Ae,he){"use strict";Ae.exports=class extends Error{constructor(V="An unspecified JSON-LD error occurred.",L="jsonld.Error",re={}){super(V),this.name=L,this.message=V,this.details=re}}},{}],13:[function(Y,Ae,he){"use strict";Ae.exports=W=>{class V{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(V,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(V.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:V}),V.compact=function(L,re){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(L,re)},V.expand=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(L)},V.flatten=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(L)},V}},{}],14:[function(Y,Ae,he){"use strict";Ae.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Ae,he){"use strict";Ae.exports=class{constructor(){this._requests={}}wrapLoader(V){const L=this;return L._loader=V,function(){return L.add.apply(L,arguments)}}add(V){var L=this;return gt(function*(){let re=L._requests[V];if(re)return Promise.resolve(re);re=L._requests[V]=L._loader(V);try{return yield re}finally{delete L._requests[V]}})()}}},{}],16:[function(Y,Ae,he){"use strict";const W=Y("lru-cache");Ae.exports=class{constructor({document:re}){this.document=re,this.cache=new W({max:10})}getProcessed(re){return this.cache.get(re)}setProcessed(re,$){this.cache.set(re,$)}}},{"lru-cache":33}],17:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),{isArray:V,isObject:L,isString:re,isUndefined:$}=Y("./types"),{isList:b,isValue:S,isGraph:R,isSimpleGraph:A,isSubjectReference:v}=Y("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:D,process:j,processingMode:I}=Y("./context"),{removeBase:H,prependBase:K}=Y("./url"),{addValue:M,asArray:F,compareShortestLeast:Q}=Y("./util"),E={};function ie(ue,ee,se){if("@nest"!==y(ue,ee,{vocab:!0},se))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ae.exports=E,E.compact=function(){var ue=gt(function*({activeCtx:ee,activeProperty:se=null,element:Te,options:me={},compactionMap:te=(()=>{})}){if(V(Te)){let Me=[];for(let Ve=0;Ve1&&(Je=Array.from(Je).sort());const Ke=ee;for(const Le of Je){const Ee=E.compactIri({activeCtx:Ke,iri:Le,relativeTo:{vocab:!0}}),Oe=w(nt,Ee,"@context");$(Oe)||(ee=yield j({activeCtx:ee,localCtx:Oe,options:me,propagate:!1}))}const je=Object.keys(Te).sort();for(const Le of je){const Ee=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&D(Le)){const Oe=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Oe,Ee)}else{if(!V(Ee))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ee.length){const Oe=E.compactIri({activeCtx:ee,iri:Le,value:Ee,relativeTo:{vocab:!0},reverse:Me}),Ue=ee.mappings.has(Oe)?ee.mappings.get(Oe)["@nest"]:null;let qe=Ve;Ue&&(ie(ee,Ue,me),L(Ve[Ue])||(Ve[Ue]={}),qe=Ve[Ue]),M(qe,Oe,Ee,{propertyIsArray:!0})}for(const Oe of Ee){const Ue=E.compactIri({activeCtx:ee,iri:Le,value:Oe,relativeTo:{vocab:!0},reverse:Me}),qe=ee.mappings.has(Ue)?ee.mappings.get(Ue)["@nest"]:null;let Be=Ve;qe&&(ie(ee,qe,me),L(Ve[qe])||(Ve[qe]={}),Be=Ve[qe]);const z=w(ee,Ue,"@container")||[],X=R(Oe),be=b(Oe);let ce;be?ce=Oe["@list"]:X&&(ce=Oe["@graph"]);let Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:be||X?ce:Oe,options:me,compactionMap:te});if(be){if(V(Pe)||(Pe=[Pe]),z.includes("@list")){M(Be,Ue,Pe,{valueIsArray:!0,allowDuplicate:!0});continue}Pe={[E.compactIri({activeCtx:ee,iri:"@list",relativeTo:{vocab:!0}})]:Pe},"@index"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Oe["@index"])}if(X)if(z.includes("@graph")&&(z.includes("@id")||z.includes("@index")&&A(Oe))){let Et;Be.hasOwnProperty(Ue)?Et=Be[Ue]:Be[Ue]=Et={};const pt=(z.includes("@id")?Oe["@id"]:Oe["@index"])||E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}});M(Et,pt,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})}else z.includes("@graph")&&A(Oe)?(V(Pe)&&Pe.length>1&&(Pe={"@included":Pe}),M(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})):(V(Pe)&&1===Pe.length&&me.compactArrays&&(Pe=Pe[0]),Pe={[E.compactIri({activeCtx:ee,iri:"@graph",relativeTo:{vocab:!0}})]:Pe},"@id"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Oe["@id"]),"@index"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Oe["@index"]),M(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")}));else if(z.includes("@language")||z.includes("@index")||z.includes("@id")||z.includes("@type")){let Et,pt;if(Be.hasOwnProperty(Ue)?Et=Be[Ue]:Be[Ue]=Et={},z.includes("@language"))S(Pe)&&(Pe=Pe["@value"]),pt=Oe["@language"];else if(z.includes("@index")){const pe=w(ee,Ue,"@index")||"@index",B=E.compactIri({activeCtx:ee,iri:pe,relativeTo:{vocab:!0}});if("@index"===pe)pt=Oe["@index"],delete Pe[B];else{let O;if([pt,...O]=F(Pe[pe]||[]),re(pt))switch(O.length){case 0:delete Pe[pe];break;case 1:Pe[pe]=O[0];break;default:Pe[pe]=O}else pt=null}}else if(z.includes("@id")){const pe=E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}});pt=Pe[pe],delete Pe[pe]}else if(z.includes("@type")){const pe=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=F(Pe[pe]||[]),B.length){case 0:delete Pe[pe];break;case 1:Pe[pe]=B[0];break;default:Pe[pe]=B}1===Object.keys(Pe).length&&"@id"in Oe&&(Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:{"@id":Oe["@id"]},options:me,compactionMap:te}))}pt||(pt=E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}})),M(Et,pt,Pe,{propertyIsArray:z.includes("@set")})}else{const Et=!me.compactArrays||z.includes("@set")||z.includes("@list")||V(Pe)&&0===Pe.length||"@list"===Le||"@graph"===Le;M(Be,Ue,Pe,{propertyIsArray:Et})}}}else{if((w(ee,se,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Ue,Ee)}else{const Oe=yield E.compact({activeCtx:ee,activeProperty:se,element:Ee,options:me,compactionMap:te});V(Oe)&&0===Oe.length||M(Ve,Le,Oe)}else{const Oe=yield E.compact({activeCtx:ee,activeProperty:"@reverse",element:Ee,options:me,compactionMap:te});for(const Ue in Oe)if(ee.mappings.has(Ue)&&ee.mappings.get(Ue).reverse){const qe=Oe[Ue],z=(w(ee,Ue,"@container")||[]).includes("@set")||!me.compactArrays;M(Ve,Ue,qe,{propertyIsArray:z}),delete Oe[Ue]}if(Object.keys(Oe).length>0){const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Ue,Oe)}}else{let Oe=F(Ee).map(X=>E.compactIri({activeCtx:nt,iri:X,relativeTo:{vocab:!0}}));1===Oe.length&&(Oe=Oe[0]);const Ue=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}}),z=(w(ee,Ue,"@container")||[]).includes("@set")&&I(ee,1.1)||V(Oe)&&0===Ee.length;M(Ve,Ue,Oe,{propertyIsArray:z})}else{let Oe=F(Ee).map(qe=>E.compactIri({activeCtx:ee,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Oe.length&&(Oe=Oe[0]),Ve[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Oe}}return Ve}return Te});return function(ee){return ue.apply(this,arguments)}}(),E.compactIri=({activeCtx:ue,iri:ee,value:se=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:te=null})=>{if(null===ee)return ee;ue.isPropertyTermScoped&&ue.previousContext&&(ue=ue.previousContext);const ye=ue.getInverse();if(D(ee)&&ee in ye&&"@none"in ye[ee]&&"@type"in ye[ee]["@none"]&&"@none"in ye[ee]["@none"]["@type"])return ye[ee]["@none"]["@type"]["@none"];if(Te.vocab&&ee in ye){const Je=ue["@language"]||"@none",Ke=[];L(se)&&"@index"in se&&!("@graph"in se)&&Ke.push("@index","@index@set"),L(se)&&"@preserve"in se&&(se=se["@preserve"][0]),R(se)?("@index"in se&&Ke.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se&&Ke.push("@graph@id","@graph@id@set"),Ke.push("@graph","@graph@set","@set"),"@index"in se||Ke.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se||Ke.push("@graph@id","@graph@id@set")):L(se)&&!S(se)&&Ke.push("@id","@id@set","@type","@set@type");let je="@language",Le="@null";if(me)je="@type",Le="@reverse",Ke.push("@set");else if(b(se)){"@index"in se||Ke.push("@list");const Oe=se["@list"];if(0===Oe.length)je="@any",Le="@none";else{let Ue=0===Oe.length?Je:null,qe=null;for(let Be=0;Bent.includes("_"));Ve&&ye.push(Ve.replace(/^[^_]+_/,"_"))}ye.push("@none");const Me=ue.inverse[ee];for(const Ve of Te){if(!(Ve in Me))continue;const nt=Me[Ve][me];for(const Ze of ye)if(Ze in nt)return nt[Ze]}return null}(ue,ee,se,Ke,je,Le);if(null!==Ee)return Ee}if(Te.vocab&&"@vocab"in ue){const Je=ue["@vocab"];if(0===ee.indexOf(Je)&&ee!==Je){const Ke=ee.substr(Je.length);if(!ue.mappings.has(Ke))return Ke}}let Me=null;const Ve=[];let nt=ue.fastCurieMap;const Ze=ee.length-1;for(let Je=0;Je=0;--Je){const Ke=Ve[Je],je=Ke.terms;for(const Le of je){const Ee=Le+":"+ee.substr(Ke.iri.length);ue.mappings.get(Le)._prefix&&(!ue.mappings.has(Ee)||null===se&&ue.mappings.get(Ee)["@id"]===ee)&&(null===Me||Q(Ee,Me)<0)&&(Me=Ee)}}if(null!==Me)return Me;for(const[Je,Ke]of ue.mappings)if(Ke&&Ke._prefix&&ee.startsWith(Je+":"))throw new W(`Absolute IRI "${ee}" confused with prefix "${Je}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ue});return Te.vocab?ee:"@base"in ue?ue["@base"]?H(K(te,ue["@base"]),ee):ee:H(te,ee)},E.compactValue=({activeCtx:ue,activeProperty:ee,value:se,options:Te})=>{if(S(se)){const Me=w(ue,ee,"@type"),Ve=w(ue,ee,"@language"),nt=w(ue,ee,"@direction"),Ze=w(ue,ee,"@container")||[],Je="@index"in se&&!Ze.includes("@index");if(!Je&&"@none"!==Me&&(se["@type"]===Me||"@language"in se&&se["@language"]===Ve&&"@direction"in se&&se["@direction"]===nt||"@language"in se&&se["@language"]===Ve||"@direction"in se&&se["@direction"]===nt))return se["@value"];const Ke=Object.keys(se).length,je=1===Ke||2===Ke&&"@index"in se&&!Je,Le="@language"in ue,Ee=re(se["@value"]),Oe=ue.mappings.has(ee)&&null===ue.mappings.get(ee)["@language"];if(je&&"@none"!==Me&&(!Le||!Ee||Oe))return se["@value"];const Ue={};return Je&&(Ue[E.compactIri({activeCtx:ue,iri:"@index",relativeTo:{vocab:!0}})]=se["@index"]),"@type"in se?Ue[E.compactIri({activeCtx:ue,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ue,iri:se["@type"],relativeTo:{vocab:!0}}):"@language"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@language",relativeTo:{vocab:!0}})]=se["@language"]),"@direction"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@direction",relativeTo:{vocab:!0}})]=se["@direction"]),Ue[E.compactIri({activeCtx:ue,iri:"@value",relativeTo:{vocab:!0}})]=se["@value"],Ue}const me=y(ue,ee,{vocab:!0},Te),te=w(ue,ee,"@type"),ye=E.compactIri({activeCtx:ue,iri:se["@id"],relativeTo:{vocab:"@vocab"===te},base:Te.base});return"@id"===te||"@vocab"===te||"@graph"===me?ye:{[E.compactIri({activeCtx:ue,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Ae,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#";Ae.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:W,RDF_LIST:W+"List",RDF_FIRST:W+"first",RDF_REST:W+"rest",RDF_NIL:W+"nil",RDF_TYPE:W+"type",RDF_PLAIN_LITERAL:W+"PlainLiteral",RDF_XML_LITERAL:W+"XMLLiteral",RDF_JSON_LITERAL:W+"JSON",RDF_OBJECT:W+"object",RDF_LANGSTRING:W+"langString",XSD:V,XSD_BOOLEAN:V+"boolean",XSD_DOUBLE:V+"double",XSD_INTEGER:V+"integer",XSD_STRING:V+"string"}},{}],19:[function(Y,Ae,he){"use strict";const W=Y("./util"),V=Y("./JsonLdError"),{isArray:L,isObject:re,isString:$,isUndefined:b}=Y("./types"),{isAbsolute:S,isRelative:R,prependBase:A}=Y("./url"),{asArray:v,compareShortestLeast:y}=Y("./util"),w=new Map,j=/^@[a-zA-Z]+$/,I={};function H(M,F,Q,E,U,ie){if(null===F||!$(F)||I.isKeyword(F))return F;if(F.match(j))return null;if(E&&E.hasOwnProperty(F)&&!0!==U.get(F)&&I.createTermDefinition({activeCtx:M,localCtx:E,term:F,defined:U,options:ie}),(Q=Q||{}).vocab){const ee=M.mappings.get(F);if(null===ee)return null;if(re(ee)&&"@id"in ee)return ee["@id"]}const ue=F.indexOf(":");if(ue>0){const ee=F.substr(0,ue),se=F.substr(ue+1);if("_"===ee||0===se.indexOf("//"))return F;E&&E.hasOwnProperty(ee)&&I.createTermDefinition({activeCtx:M,localCtx:E,term:ee,defined:U,options:ie});const Te=M.mappings.get(ee);if(Te&&Te._prefix)return Te["@id"]+se;if(S(F))return F}if(Q.vocab&&"@vocab"in M)return M["@vocab"]+F;if(Q.base&&"@base"in M){if(M["@base"])return A(A(ie.base,M["@base"]),F)}else if(Q.base)return A(ie.base,F);return F}function K(M,F){if(!M||"object"!=typeof M||!F||"object"!=typeof F)return M===F;const Q=Array.isArray(M);if(Q!==Array.isArray(F))return!1;if(Q){if(M.length!==F.length)return!1;for(let ie=0;ie{if(E.has(Q)){if(E.get(Q))return;throw new V("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:F,term:Q})}let ue;if(E.set(Q,!1),F.hasOwnProperty(Q)&&(ue=F[Q]),"@type"===Q&&re(ue)&&"@set"===(ue["@container"]||"@set")&&I.processingMode(M,1.1)){const Me=["@container","@id","@protected"],Ve=Object.keys(ue);if(0===Ve.length||Ve.some(nt=>!Me.includes(nt)))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q})}else{if(I.isKeyword(Q))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q});if(Q.match(j))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:Q});if(""===Q)throw new V("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:F})}const ee=M.mappings.get(Q);M.mappings.has(Q)&&M.mappings.delete(Q);let se=!1;if(($(ue)||null===ue)&&(se=!0,ue={"@id":ue}),!re(ue))throw new V("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:F});const Te={};M.mappings.set(Q,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];I.processingMode(M,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Me in ue)if(!me.includes(Me))throw new V("Invalid JSON-LD syntax; a term definition must not contain "+Me,"jsonld.SyntaxError",{code:"invalid term definition",context:F});const te=Q.indexOf(":");if(Te._termHasColon=te>0,"@reverse"in ue){if("@id"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});if("@nest"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});const Me=ue["@reverse"];if(!$(Me))throw new V("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(!I.isKeyword(Me)&&Me.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Me}),void(ee?M.mappings.set(Q,ee):M.mappings.delete(Q));const Ve=H(M,Me,{vocab:!0,base:!1},F,E,U);if(!S(Ve))throw new V("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:F});Te["@id"]=Ve,Te.reverse=!0}else if("@id"in ue){let Me=ue["@id"];if(Me&&!$(Me))throw new V("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(null===Me)Te["@id"]=null;else{if(!I.isKeyword(Me)&&Me.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Me}),void(ee?M.mappings.set(Q,ee):M.mappings.delete(Q));if(Me!==Q){if(Me=H(M,Me,{vocab:!0,base:!1},F,E,U),!S(Me)&&!I.isKeyword(Me))throw new V("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:F});if(Q.match(/(?::[^:])|\//)&&H(M,Q,{vocab:!0,base:!1},F,new Map(E).set(Q,!0),U)!==Me)throw new V("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});Te["@id"]=Me,Te._prefix=se&&!Te._termHasColon&&Me.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const Me=Q.substr(0,te);if(F.hasOwnProperty(Me)&&I.createTermDefinition({activeCtx:M,localCtx:F,term:Me,defined:E,options:U}),M.mappings.has(Me)){const Ve=Q.substr(te+1);Te["@id"]=M.mappings.get(Me)["@id"]+Ve}else Te["@id"]=Q}else if("@type"===Q)Te["@id"]=Q;else{if(!("@vocab"in M))throw new V("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F,term:Q});Te["@id"]=M["@vocab"]+Q}if((!0===ue["@protected"]||!0===E.get("@protected")&&!1!==ue["@protected"])&&(M.protected[Q]=!0,Te.protected=!0),E.set(Q,!0),"@type"in ue){let Me=ue["@type"];if(!$(Me))throw new V("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if("@json"===Me||"@none"===Me){if(I.processingMode(M,1))throw new V(`Invalid JSON-LD syntax; an @context @type value must not be "${Me}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else if("@id"!==Me&&"@vocab"!==Me){if(Me=H(M,Me,{vocab:!0,base:!1},F,E,U),!S(Me))throw new V("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if(0===Me.indexOf("_:"))throw new V("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}Te["@type"]=Me}if("@container"in ue){const Me=$(ue["@container"])?[ue["@container"]]:ue["@container"]||[],Ve=["@list","@set","@index","@language"];let nt=!0;const Ze=Me.includes("@set");if(I.processingMode(M,1.1)){if(Ve.push("@graph","@id","@type"),Me.includes("@list")){if(1!==Me.length)throw new V("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:F})}else if(Me.includes("@graph")){if(Me.some(Je=>"@graph"!==Je&&"@id"!==Je&&"@index"!==Je&&"@set"!==Je))throw new V("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:F})}else nt&=Me.length<=(Ze?2:1);if(Me.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new V("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else nt&=!L(ue["@container"]),nt&=Me.length<=1;if(nt&=Me.every(Je=>Ve.includes(Je)),nt&=!(Ze&&Me.includes("@list")),!nt)throw new V("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ve.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:F});if(Te.reverse&&!Me.every(Je=>["@index","@set"].includes(Je)))throw new V("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});Te["@container"]=Me}if("@index"in ue){if(!("@container"in ue)||!Te["@container"].includes("@index"))throw new V(`Invalid JSON-LD syntax; @index without @index in @container: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});if(!$(ue["@index"])||0===ue["@index"].indexOf("@"))throw new V(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});Te["@index"]=ue["@index"]}if("@context"in ue&&(Te["@context"]=ue["@context"]),"@language"in ue&&!("@type"in ue)){let Me=ue["@language"];if(null!==Me&&!$(Me))throw new V("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:F});null!==Me&&(Me=Me.toLowerCase()),Te["@language"]=Me}if("@prefix"in ue){if(Q.match(/:|\//))throw new V("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:F});if(I.isKeyword(Te["@id"]))throw new V("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:F});if("boolean"!=typeof ue["@prefix"])throw new V("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:F});Te._prefix=!0===ue["@prefix"]}if("@direction"in ue){const Me=ue["@direction"];if(null!==Me&&"ltr"!==Me&&"rtl"!==Me)throw new V('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:F});Te["@direction"]=Me}if("@nest"in ue){const Me=ue["@nest"];if(!$(Me)||"@nest"!==Me&&0===Me.indexOf("@"))throw new V("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:F});Te["@nest"]=Me}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new V("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:F});if(ee&&ee.protected&&!ie&&(M.protected[Q]=!0,Te.protected=!0,!K(ee,Te))){const Me=U&&U.protectedMode||"error";if("error"===Me)throw new V(`Invalid JSON-LD syntax; tried to redefine "${Q}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:F,term:Q});if("warn"===Me)return void console.warn("WARNING: protected term redefinition",{term:Q});throw new V("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:F,term:Q,protectedMode:Me})}},I.expandIri=(M,F,Q,E)=>H(M,F,Q,void 0,void 0,E),I.getInitialContext=M=>{const F=JSON.stringify({processingMode:M.processingMode}),Q=w.get(F);if(Q)return Q;const E={processingMode:M.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},te=Te.fastCurieMap={},ye={},Me=(Te["@language"]||"@none").toLowerCase(),Ve=Te["@direction"],nt=Te.mappings,Ze=[...nt.keys()].sort(y);for(const Je of Ze){const Ke=nt.get(Je);if(null===Ke)continue;let je=Ke["@container"]||"@none";if(je=[].concat(je).sort().join(""),null===Ke["@id"])continue;const Le=v(Ke["@id"]);for(const Ee of Le){let Oe=me[Ee];const Ue=I.isKeyword(Ee);if(Oe)!Ue&&!Ke._termHasColon&&ye[Ee].push(Je);else if(me[Ee]=Oe={},!Ue&&!Ke._termHasColon){ye[Ee]=[Je];const qe={iri:Ee,terms:ye[Ee]};Ee[0]in te?te[Ee[0]].push(qe):te[Ee[0]]=[qe]}if(Oe[je]||(Oe[je]={"@language":{},"@type":{},"@any":{}}),Oe=Oe[je],ue(Je,Oe["@any"],"@none"),Ke.reverse)ue(Je,Oe["@type"],"@reverse");else if("@none"===Ke["@type"])ue(Je,Oe["@any"],"@none"),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none");else if("@type"in Ke)ue(Je,Oe["@type"],Ke["@type"]);else if("@language"in Ke&&"@direction"in Ke){const qe=Ke["@language"],Be=Ke["@direction"];ue(Je,Oe["@language"],qe&&Be?`${qe}_${Be}`.toLowerCase():qe?qe.toLowerCase():Be?`_${Be}`:"@null")}else"@language"in Ke?ue(Je,Oe["@language"],(Ke["@language"]||"@null").toLowerCase()):"@direction"in Ke?ue(Je,Oe["@language"],Ke["@direction"]?`_${Ke["@direction"]}`:"@none"):Ve?(ue(Je,Oe["@language"],`_${Ve}`),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none")):(ue(Je,Oe["@language"],Me),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none"))}}for(const Je in te)ie(te,Je,1);return me},clone:function(){const Te={};return Te.mappings=W.clone(this.mappings),Te.clone=this.clone,Te.inverse=null,Te.getInverse=this.getInverse,Te.protected=W.clone(this.protected),this.previousContext&&(Te.previousContext=this.previousContext.clone()),Te.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Te["@base"]=this["@base"]),"@language"in this&&(Te["@language"]=this["@language"]),"@vocab"in this&&(Te["@vocab"]=this["@vocab"]),Te},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===w.size&&w.clear(),w.set(F,E),E;function ie(Te,me,te){const ye=Te[me],Me=Te[me]={};let Ve,nt;for(const Ze of ye)Ve=Ze.iri,nt=te>=Ve.length?"":Ve[te],nt in Me?Me[nt].push(Ze):Me[nt]=[Ze];for(const Ze in Me)""!==Ze&&ie(Me,Ze,te+1)}function ue(Te,me,te){me.hasOwnProperty(te)||(me[te]=Te)}},I.getContextValue=(M,F,Q)=>{if(null===F)return"@context"===Q?void 0:null;if(M.mappings.has(F)){const E=M.mappings.get(F);if(b(Q))return E;if(E.hasOwnProperty(Q))return E[Q]}return"@language"===Q&&Q in M||"@direction"===Q&&Q in M?M[Q]:"@context"!==Q?null:void 0},I.processingMode=(M,F)=>F.toString()>="1.1"?!M.processingMode||M.processingMode>="json-ld-"+F.toString():"json-ld-1.0"===M.processingMode,I.isKeyword=M=>{if(!$(M)||"@"!==M[0])return!1;switch(M){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(Y,Ae,he){"use strict";const{parseLinkHeader:W,buildHeaders:V}=Y("../util"),{LINK_HEADER_CONTEXT:L}=Y("../constants"),re=Y("../JsonLdError"),$=Y("../RequestQueue"),{prependBase:b}=Y("../url"),S=/(^|(\r\n))link:/i;function R(A,v,y){const w=new(A=A||XMLHttpRequest);return new Promise((D,j)=>{w.onload=()=>D(w),w.onerror=I=>j(I),w.open("GET",v,!0);for(const I in y)w.setRequestHeader(I,y[I]);w.send()})}Ae.exports=({secure:A,headers:v={},xhr:y}={headers:{}})=>{return v=V(v),(new $).wrapLoader(D);function D(I){return j.apply(this,arguments)}function j(){return(j=gt(function*(I){if(0!==I.indexOf("http:")&&0!==I.indexOf("https:"))throw new re('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:I});if(A&&0!==I.indexOf("https"))throw new re('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:I});let H;try{H=yield R(y,I,v)}catch(E){throw new re("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:I,cause:E})}if(H.status>=400)throw new re("URL could not be dereferenced: "+H.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:I,httpStatusCode:H.status});let K={contextUrl:null,documentUrl:I,document:H.response},M=null;const F=H.getResponseHeader("Content-Type");let Q;if(S.test(H.getAllResponseHeaders())&&(Q=H.getResponseHeader("Link")),Q&&"application/ld+json"!==F){const E=W(Q),U=E[L];if(Array.isArray(U))throw new re("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:I});U&&(K.contextUrl=U.target),M=E.alternate,M&&"application/ld+json"==M.type&&!(F||"").match(/^application\/(\w*\+)?json$/)&&(K=yield D(b(I,M.target)))}return K})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),{isArray:V,isObject:L,isEmptyObject:re,isString:$,isUndefined:b}=Y("./types"),{isList:S,isValue:R,isGraph:A,isSubject:v}=Y("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:D,process:j,processingMode:I}=Y("./context"),{isAbsolute:H}=Y("./url"),{addValue:K,asArray:M,getValues:F,validateTypeValue:Q}=Y("./util"),E={};Ae.exports=E;const U=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function ie(te){return ue.apply(this,arguments)}function ue(){return(ue=gt(function*({activeCtx:te,activeProperty:ye,expandedActiveProperty:Me,element:Ve,expandedParent:nt,options:Ze={},insideList:Je,typeKey:Ke,typeScopedContext:je,expansionMap:Le}){const Ee=Object.keys(Ve).sort(),Oe=[];let Ue;const qe=Ve[Ke]&&"@json"===y(te,V(Ve[Ke])?Ve[Ke][0]:Ve[Ke],{vocab:!0},Ze);for(const Be of Ee){let X,z=Ve[Be];if("@context"===Be)continue;let be=y(te,Be,{vocab:!0},Ze);if((null===be||!H(be)&&!D(be))&&(be=Le({unmappedProperty:Be,activeCtx:te,activeProperty:ye,parent:Ve,options:Ze,insideList:Je,value:z,expandedParent:nt}),void 0===be))continue;if(D(be)){if("@reverse"===Me)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(be in nt&&"@included"!==be&&"@type"!==be)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:be})}if("@id"===be){if(!$(z)){if(!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(L(z)){if(!re(z))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!V(z))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(pt=>$(pt)))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}K(nt,"@id",M(z).map(pt=>$(pt)?y(te,pt,{base:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@type"===be){L(z)&&(z=Object.fromEntries(Object.entries(z).map(([pt,pe])=>[y(je,pt,{vocab:!0}),M(pe).map(B=>y(je,B,{base:!0,vocab:!0}))]))),Q(z,Ze.isFrame),K(nt,"@type",M(z).map(pt=>$(pt)?y(je,pt,{base:!0,vocab:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@included"===be&&I(te,1.1)){const pt=M(yield E.expand({activeCtx:te,activeProperty:ye,element:z,options:Ze,expansionMap:Le}));if(!pt.every(pe=>v(pe)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});K(nt,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===be&&!L(z)&&!V(z))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if("@value"===be){Ue=z,qe&&I(te,1.1)?nt["@value"]=z:K(nt,"@value",z,{propertyIsArray:Ze.isFrame});continue}if("@language"===be){if(null===z)continue;if(!$(z)&&!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=M(z).map(pt=>$(pt)?pt.toLowerCase():pt);for(const pt of z)$(pt)&&!pt.match(U)&&console.warn(`@language must be valid BCP47: ${pt}`);K(nt,"@language",z,{propertyIsArray:Ze.isFrame});continue}if("@direction"===be){if(!$(z)&&!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=M(z);for(const pt of z)if($(pt)&&"ltr"!==pt&&"rtl"!==pt)throw new W('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});K(nt,"@direction",z,{propertyIsArray:Ze.isFrame});continue}if("@index"===be){if(!$(z))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});K(nt,"@index",z);continue}if("@reverse"===be){if(!L(z))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(X=yield E.expand({activeCtx:te,activeProperty:"@reverse",element:z,options:Ze,expansionMap:Le}),"@reverse"in X)for(const pe in X["@reverse"])K(nt,pe,X["@reverse"][pe],{propertyIsArray:!0});let pt=nt["@reverse"]||null;for(const pe in X){if("@reverse"===pe)continue;null===pt&&(pt=nt["@reverse"]={}),K(pt,pe,[],{propertyIsArray:!0});const B=X[pe];for(let O=0;O"@id"===pt||"@index"===pt)&&(X=M(X).map(pt=>({"@graph":M(pt)}))),ce.mappings.has(Be)&&ce.mappings.get(Be).reverse){const pt=nt["@reverse"]=nt["@reverse"]||{};X=M(X);for(let pe=0;pe"@value"===y(te,be,{vocab:!0},Ze)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:X});yield ie({activeCtx:te,activeProperty:ye,expandedActiveProperty:Me,element:X,expandedParent:nt,options:Ze,insideList:Je,typeScopedContext:je,typeKey:Ke,expansionMap:Le})}}})).apply(this,arguments)}function ee({activeCtx:te,activeProperty:ye,value:Me,options:Ve}){if(null==Me)return null;const nt=y(te,ye,{vocab:!0},Ve);if("@id"===nt)return y(te,Me,{base:!0},Ve);if("@type"===nt)return y(te,Me,{vocab:!0,base:!0},Ve);const Ze=w(te,ye,"@type");if(("@id"===Ze||"@graph"===nt)&&$(Me))return{"@id":y(te,Me,{base:!0},Ve)};if("@vocab"===Ze&&$(Me))return{"@id":y(te,Me,{vocab:!0,base:!0},Ve)};if(D(nt))return Me;const Je={};if(Ze&&!["@id","@vocab","@none"].includes(Ze))Je["@type"]=Ze;else if($(Me)){const Ke=w(te,ye,"@language");null!==Ke&&(Je["@language"]=Ke);const je=w(te,ye,"@direction");null!==je&&(Je["@direction"]=je)}return["boolean","number","string"].includes(typeof Me)||(Me=Me.toString()),Je["@value"]=Me,Je}function se(te,ye,Me,Ve){const nt=[],Ze=Object.keys(ye).sort();for(const Je of Ze){const Ke=y(te,Je,{vocab:!0},Ve);let je=ye[Je];V(je)||(je=[je]);for(const Le of je){if(null===Le)continue;if(!$(Le))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ee={"@value":Le};"@none"!==Ke&&(Ee["@language"]=Je.toLowerCase()),Me&&(Ee["@direction"]=Me),nt.push(Ee)}}return nt}function Te(te){return me.apply(this,arguments)}function me(){return(me=gt(function*({activeCtx:te,options:ye,activeProperty:Me,value:Ve,expansionMap:nt,asGraph:Ze,indexKey:Je,propertyIndex:Ke}){const je=[],Le=Object.keys(Ve).sort(),Ee="@type"===Je;for(let Oe of Le){if(Ee){const Be=w(te,Oe,"@context");b(Be)||(te=yield j({activeCtx:te,localCtx:Be,propagate:!1,options:ye}))}let qe,Ue=Ve[Oe];V(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:te,activeProperty:Me,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:nt}),qe=Ke?"@none"===Oe?"@none":ee({activeCtx:te,activeProperty:Je,value:Oe,options:ye}):y(te,Oe,{vocab:!0},ye),"@id"===Je?Oe=y(te,Oe,{base:!0},ye):Ee&&(Oe=qe);for(let Be of Ue){if(Ze&&!A(Be)&&(Be={"@graph":[Be]}),"@type"===Je)"@none"===qe||(Be["@type"]=Be["@type"]?[Oe].concat(Be["@type"]):[Oe]);else{if(R(Be)&&!["@language","@type","@index"].includes(Je))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${Je}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Be});Ke?"@none"!==qe&&K(Be,Ke,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(Je in Be)&&(Be[Je]=Oe)}je.push(Be)}}return je})).apply(this,arguments)}E.expand=function(){var te=gt(function*({activeCtx:ye,activeProperty:Me=null,element:Ve,options:nt={},insideList:Ze=!1,insideIndex:Je=!1,typeScopedContext:Ke=null,expansionMap:je=(()=>{})}){if(null==Ve)return null;if("@default"===Me&&(nt=Object.assign({},nt,{isFrame:!1})),!V(Ve)&&!L(Ve)){if(!Ze&&(null===Me||"@graph"===y(ye,Me,{vocab:!0},nt))){const X=yield je({unmappedValue:Ve,activeCtx:ye,activeProperty:Me,options:nt,insideList:Ze});return void 0===X?null:X}return ee({activeCtx:ye,activeProperty:Me,value:Ve,options:nt})}if(V(Ve)){let X=[];const be=w(ye,Me,"@container")||[];Ze=Ze||be.includes("@list");for(let ce=0;ce1?ce.slice().sort():ce:[ce];for(const Et of Pe){const pt=w(Ke,Et,"@context");b(pt)||(ye=yield j({activeCtx:ye,localCtx:pt,options:nt,propagate:!1}))}}let Be={};yield ie({activeCtx:ye,activeProperty:Me,expandedActiveProperty:Le,element:Ve,expandedParent:Be,options:nt,insideList:Ze,typeKey:qe,typeScopedContext:Ke,expansionMap:je}),Oe=Object.keys(Be);let z=Oe.length;if("@value"in Be){if("@type"in Be&&("@language"in Be||"@direction"in Be))throw new W('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:Be});let X=z-1;if("@type"in Be&&(X-=1),"@index"in Be&&(X-=1),"@language"in Be&&(X-=1),"@direction"in Be&&(X-=1),0!==X)throw new W('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:Be});const be=null===Be["@value"]?[]:M(Be["@value"]),ce=F(Be,"@type");if(!I(ye,1.1)||!ce.includes("@json")||1!==ce.length)if(0===be.length){const Pe=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==Pe?Pe:null}else{if(!be.every(Pe=>$(Pe)||re(Pe))&&"@language"in Be)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Be});if(!ce.every(Pe=>H(Pe)&&!($(Pe)&&0===Pe.indexOf("_:"))||re(Pe)))throw new W('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:Be})}}else if("@type"in Be&&!V(Be["@type"]))Be["@type"]=[Be["@type"]];else if("@set"in Be||"@list"in Be){if(z>1&&(2!==z||!("@index"in Be)))throw new W('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:Be});"@set"in Be&&(Be=Be["@set"],Oe=Object.keys(Be),z=Oe.length)}else if(1===z&&"@language"in Be){const X=yield je(Be,{unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}if(L(Be)&&!nt.keepFreeFloatingNodes&&!Ze&&(null===Me||"@graph"===Le)&&(0===z||"@value"in Be||"@list"in Be||1===z&&"@id"in Be)){const X=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}return Be});return function(ye){return te.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Ae,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:V}=Y("./nodeMap"),L={};Ae.exports=L,L.flatten=re=>{const $=V(re),b=[],S=Object.keys($).sort();for(let R=0;R=0;--ue){const ee=ie[ue];if(ee.graph===U&&ee.subject["@id"]===E["@id"])return!0}return!1}function w(E,U,ie){const ue="@"+ie;let ee=ue in E?E[ue][0]:U[ie];if("embed"===ie)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return ee}function D(E){if(!L.isArray(E)||1!==E.length||!L.isObject(E[0]))throw new b("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const U of re.asArray(E[0]["@id"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const U of re.asArray(E[0]["@type"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function I(E,U,ie,ue){let ee=!0,se=!1;for(const Te in ie){let me=!1;const te=re.getValues(U,Te),ye=0===re.getValues(ie,Te).length;if("@id"===Te){if(L.isEmptyObject(ie["@id"][0]||{})?me=!0:ie["@id"].length>=0&&(me=ie["@id"].includes(te[0])),!ue.requireAll)return me}else if("@type"===Te){if(ee=!1,ye){if(te.length>0)return!1;me=!0}else if(1===ie["@type"].length&&L.isEmptyObject(ie["@type"][0]))me=te.length>0;else for(const Me of ie["@type"])me=!(!L.isObject(Me)||!("@default"in Me))||me||te.some(Ve=>Ve===Me);if(!ue.requireAll)return me}else{if(W(Te))continue;{const Me=re.getValues(ie,Te)[0];let Ve=!1;if(Me&&(D([Me]),Ve="@default"in Me),ee=!1,0===te.length&&Ve)continue;if(te.length>0&&ye)return!1;if(void 0===Me){if(te.length>0)return!1;me=!0}else if(V.isList(Me)){const nt=Me["@list"][0];if(V.isList(te[0])){const Ze=te[0]["@list"];V.isValue(nt)?me=Ze.some(Je=>Q(nt,Je)):(V.isSubject(nt)||V.isSubjectReference(nt))&&(me=Ze.some(Je=>F(E,nt,Je,ue)))}}else me=V.isValue(Me)?te.some(nt=>Q(Me,nt)):V.isSubjectReference(Me)?te.some(nt=>F(E,Me,nt,ue)):!!L.isObject(Me)&&te.length>0}}if(!me&&ue.requireAll)return!1;se=se||me}return ee||se}function H(E,U){const ie=E.uniqueEmbeds[E.graph],ue=ie[U],ee=ue.parent,se=ue.property,Te={"@id":U};if(L.isArray(ee)){for(let te=0;te{const ye=Object.keys(ie);for(const Me of ye)Me in ie&&L.isObject(ie[Me].parent)&&ie[Me].parent["@id"]===te&&(delete ie[Me],me(Me))};me(U)}function K(E,U){if(L.isArray(E))return E.map(ie=>K(ie,U));if(L.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(V.isValue(E))return E;if(V.isList(E))return E["@list"]=K(E["@list"],U),E;if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)"@id"===ie&&U.bnodesToClear.includes(E[ie])?delete E["@id"]:E[ie]=K(E[ie],U)}return E}function M(E,U,ie){L.isObject(E)?re.addValue(E,U,ie,{propertyIsArray:!0}):E.push(ie)}function F(E,U,ie,ue){if(!("@id"in ie))return!1;const ee=E.subjects[ie["@id"]];return ee&&I(E,ee,U,ue)}function Q(E,U){const ie=U["@value"],ue=U["@type"],ee=U["@language"],se=E["@value"]?L.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?L.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?L.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===se.length&&0===Te.length&&0===me.length||!(!se.includes(ie)&&!L.isEmptyObject(se[0])||!(!ue&&0===Te.length||Te.includes(ue)||ue&&L.isEmptyObject(Te[0]))||!(!ee&&0===me.length||me.includes(ee)||ee&&L.isEmptyObject(me[0])))}Ae.exports=A,A.frameMergedOrDefault=(E,U,ie)=>{const ue={options:ie,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new re.IdentifierIssuer("_:b");S(E,ue.graphMap,"@default",ee),ie.merged&&(ue.graphMap["@merged"]=R(ue.graphMap),ue.graph="@merged"),ue.subjects=ue.graphMap[ue.graph];const se=[];return A.frame(ue,Object.keys(ue.subjects).sort(),U,se),ie.pruneBlankNodeIdentifiers&&(ie.bnodesToClear=Object.keys(ue.bnodeMap).filter(Te=>1===ue.bnodeMap[Te].length)),ie.link={},K(se,ie)},A.frame=(E,U,ie,ue,ee=null)=>{D(ie);const se=E.options,Te={embed:w(ie=ie[0],se,"embed"),explicit:w(ie,se,"explicit"),requireAll:w(ie,se,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],te=function(E,U,ie,ue){const ee={};for(const se of U){const Te=E.graphMap[E.graph][se];I(E,Te,ie,ue)&&(ee[se]=Te)}return ee}(E,U,ie,Te),ye=Object.keys(te).sort();for(const Me of ye){const Ve=te[Me];if(null===ee?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&Me in me){M(ue,ee,me[Me]);continue}const nt={"@id":Me};if(0===Me.indexOf("_:")&&re.addValue(E.bnodeMap,Me,nt,{propertyIsArray:!0}),me[Me]=nt,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:ie});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Me)){if(E.embedded&&("@never"===Te.embed||y(Ve,E.graph,E.subjectStack))){M(ue,ee,nt);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Me)){M(ue,ee,nt);continue}if("@last"===Te.embed&&Me in E.uniqueEmbeds[E.graph]&&H(E,Me),E.uniqueEmbeds[E.graph][Me]={parent:ue,property:ee},E.subjectStack.push({subject:Ve,graph:E.graph}),Me in E.graphMap){let Ze=!1,Je=null;"@graph"in ie?(Je=ie["@graph"][0],Ze=!("@merged"===Me||"@default"===Me),L.isObject(Je)||(Je={})):(Ze="@merged"!==E.graph,Je={}),Ze&&A.frame(Vn(ht({},E),{graph:Me,embedded:!1}),Object.keys(E.graphMap[Me]).sort(),[Je],nt,"@graph")}"@included"in ie&&A.frame(Vn(ht({},E),{embedded:!1}),U,ie["@included"],nt,"@included");for(const Ze of Object.keys(Ve).sort())if(W(Ze)){if(nt[Ze]=re.clone(Ve[Ze]),"@type"===Ze)for(const Je of Ve["@type"])0===Je.indexOf("_:")&&re.addValue(E.bnodeMap,Je,nt,{propertyIsArray:!0})}else if(!Te.explicit||Ze in ie)for(const Je of Ve[Ze]){const Ke=Ze in ie?ie[Ze]:v(Te);if(V.isList(Je)){const je=ie[Ze]&&ie[Ze][0]&&ie[Ze][0]["@list"]?ie[Ze][0]["@list"]:v(Te),Le={"@list":[]};M(nt,Ze,Le);const Ee=Je["@list"];for(const Oe of Ee)V.isSubjectReference(Oe)?A.frame(Vn(ht({},E),{embedded:!0}),[Oe["@id"]],je,Le,"@list"):M(Le,"@list",re.clone(Oe))}else V.isSubjectReference(Je)?A.frame(Vn(ht({},E),{embedded:!0}),[Je["@id"]],Ke,nt,Ze):Q(Ke[0],Je)&&M(nt,Ze,re.clone(Je))}for(const Ze of Object.keys(ie).sort()){if("@type"===Ze){if(!L.isObject(ie[Ze][0])||!("@default"in ie[Ze][0]))continue}else if(W(Ze))continue;const Je=ie[Ze][0]||{};if(!w(Je,se,"omitDefault")&&!(Ze in nt)){let je="@null";"@default"in Je&&(je=re.clone(Je["@default"])),L.isArray(je)||(je=[je]),nt[Ze]=[{"@preserve":je}]}}for(const Ze of Object.keys(ie["@reverse"]||{}).sort()){const Je=ie["@reverse"][Ze];for(const Ke of Object.keys(E.subjects))re.getValues(E.subjects[Ke],Ze).some(Le=>Le["@id"]===Me)&&(nt["@reverse"]=nt["@reverse"]||{},re.addValue(nt["@reverse"],Ze,[],{propertyIsArray:!0}),A.frame(Vn(ht({},E),{embedded:!0}),[Ke],Je,nt["@reverse"][Ze],ee))}M(ue,ee,nt),E.subjectStack.pop()}}},A.cleanupNull=(E,U)=>{if(L.isArray(E))return E.map(ue=>A.cleanupNull(ue,U)).filter(ue=>ue);if("@null"===E)return null;if(L.isObject(E)){if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)E[ie]=A.cleanupNull(E[ie],U)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),V=Y("./graphTypes"),L=Y("./types"),re=Y("./util"),{RDF_LIST:$,RDF_FIRST:b,RDF_REST:S,RDF_NIL:R,RDF_TYPE:A,RDF_JSON_LITERAL:v,XSD_BOOLEAN:y,XSD_DOUBLE:w,XSD_INTEGER:D,XSD_STRING:j}=Y("./constants"),I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,H={};function K(M,F,Q){if(M.termType.endsWith("Node"))return{"@id":M.value};const E={"@value":M.value};if(M.language)E["@language"]=M.language;else{let U=M.datatype.value;if(U||(U=j),U===v){U="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(ie){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:ie})}}if(F){if(U===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(L.isNumeric(E["@value"]))if(U===D){const ie=parseInt(E["@value"],10);ie.toFixed(0)===E["@value"]&&(E["@value"]=ie)}else U===w&&(E["@value"]=parseFloat(E["@value"]));[y,D,w,j].includes(U)||(E["@type"]=U)}else if("i18n-datatype"===Q&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,ue]=U.split(/[#_]/);ie.length>0&&(E["@language"]=ie,ie.match(I)||console.warn(`@language must be valid BCP47: ${ie}`)),E["@direction"]=ue}else U!==j&&(E["@type"]=U)}return E}Ae.exports=H,H.fromRDF=function(){var M=gt(function*(F,{useRdfType:Q=!1,useNativeTypes:E=!1,rdfDirection:U=null}){const ie={},ue={"@default":ie},ee={};for(const me of F){const te="DefaultGraph"===me.graph.termType?"@default":me.graph.value;te in ue||(ue[te]={}),"@default"!==te&&!(te in ie)&&(ie[te]={"@id":te});const ye=ue[te],Me=me.subject.value,Ve=me.predicate.value,nt=me.object;Me in ye||(ye[Me]={"@id":Me});const Ze=ye[Me],Je=nt.termType.endsWith("Node");if(Je&&!(nt.value in ye)&&(ye[nt.value]={"@id":nt.value}),Ve===A&&!Q&&Je){re.addValue(Ze,"@type",nt.value,{propertyIsArray:!0});continue}const Ke=K(nt,E,U);if(re.addValue(Ze,Ve,Ke,{propertyIsArray:!0}),Je)if(nt.value===R){const je=ye[nt.value];"usages"in je||(je.usages=[]),je.usages.push({node:Ze,property:Ve,value:Ke})}else ee[nt.value]=!(nt.value in ee)&&{node:Ze,property:Ve,value:Ke}}for(const me in ue){const te=ue[me];if(!(R in te))continue;const ye=te[R];if(ye.usages){for(let Me of ye.usages){let Ve=Me.node,nt=Me.property,Ze=Me.value;const Je=[],Ke=[];let je=Object.keys(Ve).length;for(;nt===S&&L.isObject(ee[Ve["@id"]])&&L.isArray(Ve[b])&&1===Ve[b].length&&L.isArray(Ve[S])&&1===Ve[S].length&&(3===je||4===je&&L.isArray(Ve["@type"])&&1===Ve["@type"].length&&Ve["@type"][0]===$)&&(Je.push(Ve[b][0]),Ke.push(Ve["@id"]),Me=ee[Ve["@id"]],Ve=Me.node,nt=Me.property,Ze=Me.value,je=Object.keys(Ve).length,V.isBlankNode(Ve)););delete Ze["@id"],Ze["@list"]=Je.reverse();for(const Le of Ke)delete te[Le]}delete ye.usages}}const se=[],Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me];if(me in ue){const ye=te["@graph"]=[],Me=ue[me],Ve=Object.keys(Me).sort();for(const nt of Ve){const Ze=Me[nt];V.isSubjectReference(Ze)||ye.push(Ze)}}V.isSubjectReference(te)||se.push(te)}return se});return function(F,Q){return M.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Ae,he){"use strict";const W=Y("./types"),V={};Ae.exports=V,V.isSubject=L=>!(!W.isObject(L)||"@value"in L||"@set"in L||"@list"in L)&&(Object.keys(L).length>1||!("@id"in L)),V.isSubjectReference=L=>W.isObject(L)&&1===Object.keys(L).length&&"@id"in L,V.isValue=L=>W.isObject(L)&&"@value"in L,V.isList=L=>W.isObject(L)&&"@list"in L,V.isGraph=L=>W.isObject(L)&&"@graph"in L&&1===Object.keys(L).filter(re=>"@id"!==re&&"@index"!==re).length,V.isSimpleGraph=L=>V.isGraph(L)&&!("@id"in L),V.isBlankNode=L=>!!W.isObject(L)&&("@id"in L?0===L["@id"].indexOf("_:"):0===Object.keys(L).length||!("@value"in L||"@set"in L||"@list"in L))},{"./types":30}],26:[function(Y,Ae,he){const W=Y("rdf-canonize"),V=Y("./platform"),L=Y("./util"),re=Y("./ContextResolver"),$=L.IdentifierIssuer,b=Y("./JsonLdError"),S=Y("lru-cache"),R=Y("./NQuads"),{expand:A}=Y("./expand"),{flatten:v}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:w}=Y("./toRdf"),{frameMergedOrDefault:D,cleanupNull:j}=Y("./frame"),{isArray:I,isObject:H,isString:K}=Y("./types"),{isSubjectReference:M}=Y("./graphTypes"),{expandIri:F,getInitialContext:Q,process:E,processingMode:U}=Y("./context"),{compact:ie,compactIri:ue}=Y("./compact"),{createNodeMap:ee,createMergedNodeMap:se,mergeNodeMaps:Te}=Y("./nodeMap"),me=function(ye){const Me={},nt=new S({max:100});function Ze(Je,Le){var Ee=Le,{documentLoader:Ke=ye.documentLoader}=Ee,je=yW(Ee,["documentLoader"]);return Object.assign({},{documentLoader:Ke},je,Je)}return ye.compact=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===je)throw new b("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ke)return null;let Ee;(Le=Ze(Le,{base:K(Ke)?Ke:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new $("_:b"),contextResolver:new re({sharedCache:nt})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ee=Le.skipExpansion?Ke:yield ye.expand(Ke,Le);const Oe=yield ye.processContext(Q(Le),je,Le);let Ue=yield ie({activeCtx:Oe,element:Ee,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&I(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&H(Ue)&&(Ue=[Ue]),H(je)&&"@context"in je&&(je=je["@context"]),je=L.clone(je),I(je)||(je=[je]);const qe=je;je=[];for(let z=0;z0)&&je.push(qe[z]);const Be=je.length>0;if(1===je.length&&(je=je[0]),I(Ue)){const z=ue({activeCtx:Oe,iri:"@graph",relativeTo:{vocab:!0}}),X=Ue;Ue={},Be&&(Ue["@context"]=je),Ue[z]=X}else if(H(Ue)&&Be){const z=Ue;Ue={"@context":je};for(const X in z)Ue[X]=z[X]}return Ue});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.expand=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(je=Ze(je,{keepFreeFloatingNodes:!1,contextResolver:new re({sharedCache:nt})})).expansionMap&&(je.expansionMap=void 0);const Le={},Ee=[];if("expandContext"in je){const Be=L.clone(je.expandContext);Le.expandContext=H(Be)&&"@context"in Be?Be:{"@context":Be},Ee.push(Le.expandContext)}let Oe;if(K(Ke)){const Be=yield ye.get(Ke,je);Oe=Be.documentUrl,Le.input=Be.document,Be.contextUrl&&(Le.remoteContext={"@context":Be.contextUrl},Ee.push(Le.remoteContext))}else Le.input=L.clone(Ke);"base"in je||(je.base=Oe||"");let Ue=Q(je);for(const Be of Ee)Ue=yield E({activeCtx:Ue,localCtx:Be,options:je});let qe=yield A({activeCtx:Ue,element:Le.input,options:je,expansionMap:je.expansionMap});return H(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),I(qe)||(qe=[qe]),qe});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.flatten=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");je="function"==typeof je?null:je||null,Le=Ze(Le,{base:K(Ke)?Ke:"",contextResolver:new re({sharedCache:nt})});const Ee=yield ye.expand(Ke,Le),Oe=v(Ee);return null===je?Oe:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Oe,je,Le))});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.frame=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Ze(Le,{base:K(Ke)?Ke:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new re({sharedCache:nt})}),K(je)){const ce=yield ye.get(je,Le);if(je=ce.document,ce.contextUrl){let Pe=je["@context"];Pe?I(Pe)?Pe.push(ce.contextUrl):Pe=[Pe,ce.contextUrl]:Pe=ce.contextUrl,je["@context"]=Pe}}const Ee=je&&je["@context"]||{},Oe=yield ye.processContext(Q(Le),Ee,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=U(Oe,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=U(Oe,1.1));const Ue=yield ye.expand(Ke,Le),qe=ht({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const Be=yield ye.expand(je,qe),z=Object.keys(je).map(ce=>F(Oe,ce,{vocab:!0}));qe.merged=!z.includes("@graph"),qe.is11=U(Oe,1.1);const X=D(Ue,Be,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let be=yield ye.compact(X,Ee,qe);return qe.link={},be=j(be,qe),be});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.link=function(){var Je=gt(function*(Ke,je,Le){const Ee={};return je&&(Ee["@context"]=je),Ee["@embed"]="@link",ye.frame(Ke,Ee,Le)});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(je=Ze(je,{base:K(Ke)?Ke:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new re({sharedCache:nt})}))){if("application/n-quads"!==je.inputFormat&&"application/nquads"!==je.inputFormat)throw new b("Unknown canonicalization input format.","jsonld.CanonizeError");const Oe=R.parse(Ke);return W.canonize(Oe,je)}const Le=ht({},je);delete Le.format,Le.produceGeneralizedRdf=!1;const Ee=yield ye.toRDF(Ke,Le);return W.canonize(Ee,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.fromRDF=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");je=Ze(je,{format:K(Ke)?"application/n-quads":void 0});const{format:Le}=je;let{rdfParser:Ee}=je;if(Le){if(Ee=Ee||Me[Le],!Ee)throw new b("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ee=()=>Ke;const Oe=yield Ee(Ke);return y(Oe,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.toRDF=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(je=Ze(je,{base:K(Ke)?Ke:"",skipExpansion:!1,contextResolver:new re({sharedCache:nt})})).skipExpansion?Ke:yield ye.expand(Ke,je);const Ee=w(Le,je);if(je.format){if("application/n-quads"===je.format||"application/nquads"===je.format)return R.serialize(Ee);throw new b("Unknown output format.","jsonld.UnknownFormat",{format:je.format})}return Ee});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.createNodeMap=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");je=Ze(je,{base:K(Ke)?Ke:"",contextResolver:new re({sharedCache:nt})});const Le=yield ye.expand(Ke,je);return se(Le,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.merge=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!I(Ke))throw new TypeError('Could not merge, "docs" must be an array.');je="function"==typeof je?null:je||null,Le=Ze(Le,{contextResolver:new re({sharedCache:nt})});const Ee=yield Promise.all(Ke.map(ce=>{const Pe=ht({},Le);return ye.expand(ce,Pe)}));let Oe=!0;"mergeNodes"in Le&&(Oe=Le.mergeNodes);const Ue=Le.issuer||new $("_:b"),qe={"@default":{}};for(let ce=0;ceye._documentLoader,set:Je=>ye._documentLoader=Je}),ye.documentLoader=function(){var Je=gt(function*(Ke){throw new b("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Ke})});return function(Ke){return Je.apply(this,arguments)}}(),ye.get=function(){var Je=gt(function*(Ke,je){let Le;Le="function"==typeof je.documentLoader?je.documentLoader:ye.documentLoader;const Ee=yield Le(Ke);try{if(!Ee.document)throw new b("No remote document found at the given URL.","jsonld.NullRemoteDocument");K(Ee.document)&&(Ee.document=JSON.parse(Ee.document))}catch(Oe){throw new b("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Oe,remoteDoc:Ee})}return Ee});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.processContext=function(){var Je=gt(function*(Ke,je,Le){return Le=Ze(Le,{base:"",contextResolver:new re({sharedCache:nt})}),null===je?Q(Le):(je=L.clone(je),H(je)&&"@context"in je||(je={"@context":je}),E({activeCtx:Ke,localCtx:je,options:Le}))});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.getContextValue=Y("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(Je){if(!(Je in ye.documentLoaders))throw new b('Unknown document loader type: "'+Je+'"',"jsonld.UnknownDocumentLoader",{type:Je});ye.documentLoader=ye.documentLoaders[Je].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(Je,Ke){Me[Je]=Ke},ye.unregisterRDFParser=function(Je){delete Me[Je]},ye.registerRDFParser("application/n-quads",R.parse),ye.registerRDFParser("application/nquads",R.parse),ye.url=Y("./url"),ye.util=L,Object.assign(ye,L),ye.promises=ye,ye.RequestQueue=Y("./RequestQueue"),ye.JsonLdProcessor=Y("./JsonLdProcessor")(ye),V.setupGlobals(ye),V.setupDocumentLoaders(ye),ye},te=function(){return me(function(){return te()})};me(te),Ae.exports=te},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(Y,Ae,he){"use strict";const{isKeyword:W}=Y("./context"),V=Y("./graphTypes"),L=Y("./types"),re=Y("./util"),$=Y("./JsonLdError"),b={};Ae.exports=b,b.createMergedNodeMap=(S,R)=>{const A=(R=R||{}).issuer||new re.IdentifierIssuer("_:b"),v={"@default":{}};return b.createNodeMap(S,v,"@default",A),b.mergeNodeMaps(v)},b.createNodeMap=(S,R,A,v,y,w)=>{if(L.isArray(S)){for(const H of S)b.createNodeMap(H,R,A,v,void 0,w);return}if(!L.isObject(S))return void(w&&w.push(S));if(V.isValue(S)){if("@type"in S){let H=S["@type"];0===H.indexOf("_:")&&(S["@type"]=H=v.getId(H))}return void(w&&w.push(S))}if(w&&V.isList(S)){const H=[];return b.createNodeMap(S["@list"],R,A,v,y,H),void w.push({"@list":H})}if("@type"in S){const H=S["@type"];for(const K of H)0===K.indexOf("_:")&&v.getId(K)}L.isUndefined(y)&&(y=V.isBlankNode(S)?v.getId(S["@id"]):S["@id"]),w&&w.push({"@id":y});const D=R[A],j=D[y]=D[y]||{};j["@id"]=y;const I=Object.keys(S).sort();for(let H of I){if("@id"===H)continue;if("@reverse"===H){const M={"@id":y},F=S["@reverse"];for(const Q in F){const E=F[Q];for(const U of E){let ie=U["@id"];V.isBlankNode(U)&&(ie=v.getId(ie)),b.createNodeMap(U,R,A,v,ie),re.addValue(D[ie],Q,M,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===H){y in R||(R[y]={}),b.createNodeMap(S[H],R,y,v);continue}if("@included"===H){b.createNodeMap(S[H],R,A,v);continue}if("@type"!==H&&W(H)){if("@index"===H&&H in j&&(S[H]!==j[H]||S[H]["@id"]!==j[H]["@id"]))throw new $("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:j});j[H]=S[H];continue}const K=S[H];if(0===H.indexOf("_:")&&(H=v.getId(H)),0!==K.length)for(let M of K)if("@type"===H&&(M=0===M.indexOf("_:")?v.getId(M):M),V.isSubject(M)||V.isSubjectReference(M)){if("@id"in M&&!M["@id"])continue;const F=V.isBlankNode(M)?v.getId(M["@id"]):M["@id"];re.addValue(j,H,{"@id":F},{propertyIsArray:!0,allowDuplicate:!1}),b.createNodeMap(M,R,A,v,F)}else if(V.isValue(M))re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1});else if(V.isList(M)){const F=[];b.createNodeMap(M["@list"],R,A,v,y,F),M={"@list":F},re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1})}else b.createNodeMap(M,R,A,v,y),re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1});else re.addValue(j,H,[],{propertyIsArray:!0})}},b.mergeNodeMapGraphs=S=>{const R={};for(const A of Object.keys(S).sort())for(const v of Object.keys(S[A]).sort()){const y=S[A][v];v in R||(R[v]={"@id":v});const w=R[v];for(const D of Object.keys(y).sort())if(W(D)&&"@type"!==D)w[D]=re.clone(y[D]);else for(const j of y[D])re.addValue(w,D,re.clone(j),{propertyIsArray:!0,allowDuplicate:!1})}return R},b.mergeNodeMaps=S=>{const R=S["@default"],A=Object.keys(S).sort();for(const v of A){if("@default"===v)continue;const y=S[v];let w=R[v];w?"@graph"in w||(w["@graph"]=[]):R[v]=w={"@id":v,"@graph":[]};const D=w["@graph"];for(const j of Object.keys(y).sort()){const I=y[j];V.isSubjectReference(I)||D.push(I)}}return R}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Ae,he){"use strict";const W=Y("./documentLoaders/xhr"),V={};Ae.exports=V,V.setupDocumentLoaders=function(L){"undefined"!=typeof XMLHttpRequest&&(L.documentLoaders.xhr=W,L.useDocumentLoader("xhr"))},V.setupGlobals=function(L){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:L.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Ae,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:V}=Y("./context"),L=Y("./graphTypes"),re=Y("canonicalize"),$=Y("./types"),b=Y("./util"),{RDF_FIRST:S,RDF_REST:R,RDF_NIL:A,RDF_TYPE:v,RDF_JSON_LITERAL:y,RDF_LANGSTRING:w,XSD_BOOLEAN:D,XSD_DOUBLE:j,XSD_INTEGER:I,XSD_STRING:H}=Y("./constants"),{isAbsolute:K}=Y("./url"),M={};function F(U,ie,ue,ee,se){const Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me],ye=Object.keys(te).sort();for(let Me of ye){const Ve=te[Me];if("@type"===Me)Me=v;else if(V(Me))continue;for(const nt of Ve){const Ze={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!K(me))continue;const Je={termType:Me.startsWith("_:")?"BlankNode":"NamedNode",value:Me};if(!K(Me)||"BlankNode"===Je.termType&&!se.produceGeneralizedRdf)continue;const Ke=E(nt,ee,U,ue,se.rdfDirection);Ke&&U.push({subject:Ze,predicate:Je,object:Ke,graph:ue})}}}}function E(U,ie,ue,ee,se){const Te={};if(L.isValue(U)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=U["@value"];const te=U["@type"]||null;"@json"===te?(Te.value=re(me),Te.datatype.value=y):$.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=te||D):$.isDouble(me)||te===j?($.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=te||j):$.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=te||I):"i18n-datatype"===se&&"@direction"in U?(Te.datatype.value="https://www.w3.org/ns/i18n#"+(U["@language"]||"")+`_${U["@direction"]}`,Te.value=me):"@language"in U?(Te.value=me,Te.datatype.value=te||w,Te.language=U["@language"]):(Te.value=me,Te.datatype.value=te||H)}else if(L.isList(U)){const me=function(U,ie,ue,ee,se){const Te={termType:"NamedNode",value:S},me={termType:"NamedNode",value:R},te={termType:"NamedNode",value:A},ye=U.pop(),Me=ye?{termType:"BlankNode",value:ie.getId()}:te;let Ve=Me;for(const nt of U){const Ze=E(nt,ie,ue,ee,se),Je={termType:"BlankNode",value:ie.getId()};ue.push({subject:Ve,predicate:Te,object:Ze,graph:ee}),ue.push({subject:Ve,predicate:me,object:Je,graph:ee}),Ve=Je}if(ye){const nt=E(ye,ie,ue,ee,se);ue.push({subject:Ve,predicate:Te,object:nt,graph:ee}),ue.push({subject:Ve,predicate:me,object:te,graph:ee})}return Me}(U["@list"],ie,ue,ee,se);Te.termType=me.termType,Te.value=me.value}else{const me=$.isObject(U)?U["@id"]:U;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||K(Te.value)?Te:null}Ae.exports=M,M.toRDF=(U,ie)=>{const ue=new b.IdentifierIssuer("_:b"),ee={"@default":{}};W(U,ee,"@default",ue);const se=[],Te=Object.keys(ee).sort();for(const me of Te){let te;if("@default"===me)te={termType:"DefaultGraph",value:""};else{if(!K(me))continue;te=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},te.value=me}F(se,ee[me],te,ue,ie)}return se}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Ae,he){"use strict";const W={};Ae.exports=W,W.isArray=Array.isArray,W.isBoolean=V=>"boolean"==typeof V||"[object Boolean]"===Object.prototype.toString.call(V),W.isDouble=V=>W.isNumber(V)&&(-1!==String(V).indexOf(".")||Math.abs(V)>=1e21),W.isEmptyObject=V=>W.isObject(V)&&0===Object.keys(V).length,W.isNumber=V=>"number"==typeof V||"[object Number]"===Object.prototype.toString.call(V),W.isNumeric=V=>!isNaN(parseFloat(V))&&isFinite(V),W.isObject=V=>"[object Object]"===Object.prototype.toString.call(V),W.isString=V=>"string"==typeof V||"[object String]"===Object.prototype.toString.call(V),W.isUndefined=V=>void 0===V},{}],31:[function(Y,Ae,he){"use strict";const W=Y("./types"),V={};Ae.exports=V,V.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},V.parse=(re,$)=>{const b={},S=V.parsers[$||"full"],R=S.regex.exec(re);let A=S.keys.length;for(;A--;)b[S.keys[A]]=void 0===R[A]?null:R[A];return("https"===b.scheme&&"443"===b.port||"http"===b.scheme&&"80"===b.port)&&(b.href=b.href.replace(":"+b.port,""),b.authority=b.authority.replace(":"+b.port,""),b.port=null),b.normalizedPath=V.removeDotSegments(b.path),b},V.prependBase=(re,$)=>{if(null===re||V.isAbsolute($))return $;(!re||W.isString(re))&&(re=V.parse(re||""));const b=V.parse($),S={protocol:re.protocol||""};if(null!==b.authority)S.authority=b.authority,S.path=b.path,S.query=b.query;else if(S.authority=re.authority,""===b.path)S.path=re.path,S.query=null!==b.query?b.query:re.query;else{if(0===b.path.indexOf("/"))S.path=b.path;else{let A=re.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||re.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=b.path,S.path=A}S.query=b.query}""!==b.path&&(S.path=V.removeDotSegments(S.path));let R=S.protocol;return null!==S.authority&&(R+="//"+S.authority),R+=S.path,null!==S.query&&(R+="?"+S.query),null!==b.fragment&&(R+="#"+b.fragment),""===R&&(R="./"),R},V.removeBase=(re,$)=>{if(null===re)return $;(!re||W.isString(re))&&(re=V.parse(re||""));let b="";if(""!==re.href?b+=(re.protocol||"")+"//"+(re.authority||""):$.indexOf("//")&&(b+="//"),0!==$.indexOf(b))return $;const S=V.parse($.substr(b.length)),R=re.normalizedPath.split("/"),A=S.normalizedPath.split("/"),v=S.fragment||S.query?0:1;for(;R.length>0&&A.length>v&&R[0]===A[0];)R.shift(),A.shift();let y="";if(R.length>0){R.pop();for(let w=0;w{if(0===re.length)return"";const $=re.split("/"),b=[];for(;$.length>0;){const S=$.shift(),R=0===$.length;"."!==S?".."!==S?b.push(S):(b.pop(),R&&b.push("")):R&&b.push("")}return"/"===re[0]&&b.length>0&&""!==b[0]&&b.unshift(""),1===b.length&&""===b[0]?"/":b.join("/")};const L=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;V.isAbsolute=re=>W.isString(re)&&L.test(re),V.isRelative=re=>W.isString(re)},{"./types":30}],32:[function(Y,Ae,he){"use strict";const W=Y("./graphTypes"),V=Y("./types"),L=Y("rdf-canonize").IdentifierIssuer,re=Y("./JsonLdError"),$=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,b=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,S=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,R_headers={accept:"application/ld+json, application/json"},A={};function v(y,w){if(V.isArray(w))for(let D=0;D{if(Object.keys(y).some(D=>"accept"===D.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+R_headers.accept+'" is supported.');return Object.assign({Accept:R_headers.accept},y)},A.parseLinkHeader=y=>{const w={},D=y.match($);for(let j=0;j{if(!(V.isString(y)||V.isArray(y)&&y.every(D=>V.isString(D)))){if(w&&V.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&A.asArray(y["@default"]).every(D=>V.isString(D)))return}throw new re('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:y})}},A.hasProperty=(y,w)=>{if(y.hasOwnProperty(w)){const D=y[w];return!V.isArray(D)||D.length>0}return!1},A.hasValue=(y,w,D)=>{if(A.hasProperty(y,w)){let j=y[w];const I=W.isList(j);if(V.isArray(j)||I){I&&(j=j["@list"]);for(let H=0;H{if("propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1),"valueIsArray"in j||(j.valueIsArray=!1),"allowDuplicate"in j||(j.allowDuplicate=!0),"prependValue"in j||(j.prependValue=!1),j.valueIsArray)y[w]=D;else if(V.isArray(D)){0===D.length&&j.propertyIsArray&&!y.hasOwnProperty(w)&&(y[w]=[]),j.prependValue&&(D=D.concat(y[w]),y[w]=[]);for(let I=0;I[].concat(y[w]||[]),A.removeProperty=(y,w)=>{delete y[w]},A.removeValue=(y,w,D,j)=>{"propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1);const I=A.getValues(y,w).filter(H=>!A.compareValues(H,D));0===I.length?A.removeProperty(y,w):y[w]=1!==I.length||j.propertyIsArray?I:I[0]},A.relabelBlankNodes=(y,w)=>v((w=w||{}).issuer||new L("_:b"),y),A.compareValues=(y,w)=>!!(y===w||W.isValue(y)&&W.isValue(w)&&y["@value"]===w["@value"]&&y["@type"]===w["@type"]&&y["@language"]===w["@language"]&&y["@index"]===w["@index"])||!!(V.isObject(y)&&"@id"in y&&V.isObject(w)&&"@id"in w)&&y["@id"]===w["@id"],A.compareShortestLeast=(y,w)=>y.length1;const j=(Q,E,U)=>{const ie=Q[v].get(E);if(ie){const ue=ie.value;if(I(Q,ue)){if(K(Q,ie),!Q[$])return}else U&&(Q[y]&&(ie.value.now=Date.now()),Q[A].unshiftNode(ie));return ue.value}},I=(Q,E)=>{if(!E||!E.maxAge&&!Q[b])return!1;const U=Date.now()-E.now;return E.maxAge?U>E.maxAge:Q[b]&&U>Q[b]},H=Q=>{if(Q[L]>Q[V])for(let E=Q[A].tail;Q[L]>Q[V]&&null!==E;){const U=E.prev;K(Q,E),E=U}},K=(Q,E)=>{if(E){const U=E.value;Q[S]&&Q[S](U.key,U.value),Q[L]-=U.length,Q[v].delete(U.key),Q[A].removeNode(E)}};class M{constructor(E,U,ie,ue,ee){this.key=E,this.value=U,this.length=ie,this.now=ue,this.maxAge=ee||0}}const F=(Q,E,U,ie)=>{let ue=U.value;I(Q,ue)&&(K(Q,U),Q[$]||(ue=void 0)),ue&&E.call(ie,ue.value,ue.key,Q)};Ae.exports=class{constructor(E){if("number"==typeof E&&(E={max:E}),E||(E={}),E.max&&("number"!=typeof E.max||E.max<0))throw new TypeError("max must be a non-negative number");this[V]=E.max||1/0;const ie=E.length||w;if(this[re]="function"!=typeof ie?w:ie,this[$]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[b]=E.maxAge||0,this[S]=E.dispose,this[R]=E.noDisposeOnSet||!1,this[y]=E.updateAgeOnGet||!1,this.reset()}set max(E){if("number"!=typeof E||E<0)throw new TypeError("max must be a non-negative number");this[V]=E||1/0,H(this)}get max(){return this[V]}set allowStale(E){this[$]=!!E}get allowStale(){return this[$]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[b]=E,H(this)}get maxAge(){return this[b]}set lengthCalculator(E){"function"!=typeof E&&(E=w),E!==this[re]&&(this[re]=E,this[L]=0,this[A].forEach(U=>{U.length=this[re](U.value,U.key),this[L]+=U.length})),H(this)}get lengthCalculator(){return this[re]}get length(){return this[L]}get itemCount(){return this[A].length}rforEach(E,U){U=U||this;for(let ie=this[A].tail;null!==ie;){const ue=ie.prev;F(this,E,ie,U),ie=ue}}forEach(E,U){U=U||this;for(let ie=this[A].head;null!==ie;){const ue=ie.next;F(this,E,ie,U),ie=ue}}keys(){return this[A].toArray().map(E=>E.key)}values(){return this[A].toArray().map(E=>E.value)}reset(){this[S]&&this[A]&&this[A].length&&this[A].forEach(E=>this[S](E.key,E.value)),this[v]=new Map,this[A]=new W,this[L]=0}dump(){return this[A].map(E=>!I(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[A]}set(E,U,ie){if((ie=ie||this[b])&&"number"!=typeof ie)throw new TypeError("maxAge must be a number");const ue=ie?Date.now():0,ee=this[re](U,E);if(this[v].has(E)){if(ee>this[V])return K(this,this[v].get(E)),!1;const me=this[v].get(E).value;return this[S]&&(this[R]||this[S](E,me.value)),me.now=ue,me.maxAge=ie,me.value=U,this[L]+=ee-me.length,me.length=ee,this.get(E),H(this),!0}const se=new M(E,U,ee,ue,ie);return se.length>this[V]?(this[S]&&this[S](E,U),!1):(this[L]+=se.length,this[A].unshift(se),this[v].set(E,this[A].head),H(this),!0)}has(E){if(!this[v].has(E))return!1;const U=this[v].get(E).value;return!I(this,U)}get(E){return j(this,E,!0)}peek(E){return j(this,E,!1)}pop(){const E=this[A].tail;return E?(K(this,E),E.value):null}del(E){K(this,this[v].get(E))}load(E){this.reset();const U=Date.now();for(let ie=E.length-1;ie>=0;ie--){const ue=E[ie],ee=ue.e||0;if(0===ee)this.set(ue.k,ue.v);else{const se=ee-U;se>0&&this.set(ue.k,ue.v,se)}}}prune(){this[v].forEach((E,U)=>j(this,U,!1))}}},{yallist:92}],34:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${V}decimal`,boolean:`${V}boolean`,double:`${V}double`,integer:`${V}integer`,string:`${V}string`},rdf:{type:`${W}type`,nil:`${W}nil`,first:`${W}first`,rest:`${W}rest`,langString:`${W}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${L}reify#forSome`,forAll:`${L}reify#forAll`},log:{implies:`${L}log#implies`}}},{}],35:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.termFromId=function M(te,ye){if(ye=ye||v,!te)return ye.defaultGraph();switch(te[0]){case"?":return ye.variable(te.substr(1));case"_":return ye.blankNode(te.substr(2));case'"':if(ye===v)return new j(te);if('"'===te[te.length-1])return ye.literal(te.substr(1,te.length-2));const Me=te.lastIndexOf('"',te.length-1);return ye.literal(te.substr(1,Me-1),"@"===te[Me+1]?te.substr(Me+2):ye.namedNode(te.substr(Me+3)));case"<":const Ve=A.exec(te);return ye.quad(M(U(Ve[1]),ye),M(U(Ve[2]),ye),M(U(Ve[3]),ye),Ve[4]&&M(U(Ve[4]),ye));default:return ye.namedNode(te)}},he.termToId=function F(te){if("string"==typeof te)return te;if(te instanceof w&&"Quad"!==te.termType)return te.id;if(!te)return b.id;switch(te.termType){case"NamedNode":return te.value;case"BlankNode":return`_:${te.value}`;case"Variable":return`?${te.value}`;case"DefaultGraph":return"";case"Literal":return`"${te.value}"${te.language?`@${te.language}`:te.datatype&&te.datatype.value!==$.string?`^^${te.datatype.value}`:""}`;case"Quad":return`<<${E(F(te.subject))} ${E(F(te.predicate))} ${E(F(te.object))}${(0,V.isDefaultGraph)(te.graph)?"":` ${F(te.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${te.termType}`)}},he.escapeQuotes=E,he.unescapeQuotes=U,he.Triple=he.Quad=he.DefaultGraph=he.Variable=he.BlankNode=he.Literal=he.NamedNode=he.Term=he.default=void 0;var te,W=(te=Y("./IRIs"))&&te.__esModule?te:{default:te},V=Y("./N3Util");const{rdf:re,xsd:$}=W.default;let b,S=0;const R=/^"(.*".*)(?="[^"]*$)/,A=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,v={namedNode:function(te){return new D(te)},blankNode:function(te){return new I(te||"n3-"+S++)},variable:function(te){return new H(te)},literal:function(te,ye){if("string"==typeof ye)return new j(`"${te}"@${ye.toLowerCase()}`);let Me=ye?ye.value:"";return""===Me&&("boolean"==typeof te?Me=$.boolean:"number"==typeof te&&(Number.isFinite(te)?Me=Number.isInteger(te)?$.integer:$.double:(Me=$.double,Number.isNaN(te)||(te=te>0?"INF":"-INF")))),new j(""===Me||Me===$.string?`"${te}"`:`"${te}"^^${Me}`)},defaultGraph:function(){return b},quad:me,triple:me};he.default=v;class w{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof w?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=w;class D extends w{get termType(){return"NamedNode"}}he.NamedNode=D;class j extends w{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let Me=ye.lastIndexOf('"')+1;return Me`"${Me.replace(/"/g,'""')}`)}function U(te){return te.replace(R,(ye,Me)=>`"${Me.replace(/""/g,'"')}`)}function me(te,ye,Me,Ve){return new Q(te,ye,Me,Ve)}he.Triple=he.Quad=Q},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Ae,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var V=re(Y("./IRIs")),L=re(Y("queue-microtask"));function re(w){return w&&w.__esModule?w:{default:w}}const{xsd:$}=V.default,b=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,S={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},R=/[\x00-\x20<>\\"\{\}\|\^\`]/,A={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},v=/$0^/;he.default=class{constructor(D){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]*)?$/,this._lineMode=!!(D=D||{}).lineMode){this._n3Mode=!1;for(const j in this)!(j in A)&&this[j]instanceof RegExp&&(this[j]=v)}else this._n3Mode=!1!==D.n3;this._comments=!!D.comments,this._literalClosingPos=0}_tokenizeToEnd(D,j){let I=this._input;const H=this._comments;for(;;){let M,F;for(;M=this._newline.exec(I);)H&&(F=this._comment.exec(M[0]))&&D(null,{line:this._line,type:"comment",value:F[1],prefix:""}),I=I.substr(M[0].length,I.length),this._line++;if(!M&&(M=this._whitespace.exec(I))&&(I=I.substr(M[0].length,I.length)),this._endOfFile.test(I))return j&&(H&&(F=this._comment.exec(I))&&D(null,{line:this._line,type:"comment",value:F[1],prefix:""}),D(I=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=I;const Q=this._line,E=I[0];let U="",ie="",ue="",ee=null,se=0,Te=!1;switch(E){case"^":if(I.length<3)break;if("^"!==I[1]){this._n3Mode&&(se=1,U="^");break}if(this._previousMarker="^^",I=I.substr(2),"<"!==I[0]){Te=!0;break}case"<":if(ee=this._unescapedIri.exec(I))U="IRI",ie=ee[1];else if(ee=this._iri.exec(I)){if(ie=this._unescape(ee[1]),null===ie||R.test(ie))return K(this);U="IRI"}else I.length>1&&"<"===I[1]?(U="<<",se=2):this._n3Mode&&I.length>1&&"="===I[1]&&(U="inverse",se=2,ie=">");break;case">":I.length>1&&">"===I[1]&&(U=">>",se=2);break;case"_":((ee=this._blank.exec(I))||j&&(ee=this._blank.exec(`${I} `)))&&(U="blank",ue="_",ie=ee[1]);break;case'"':if(ee=this._simpleQuotedString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return K(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(ee=this._simpleApostropheString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return K(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(ee=this._variable.exec(I))&&(U="var",ie=ee[0]);break;case"@":"literal"===this._previousMarker&&(ee=this._langcode.exec(I))?(U="langcode",ie=ee[1]):(ee=this._keyword.exec(I))&&(U=ee[0]);break;case".":if(1===I.length?j:I[1]<"0"||I[1]>"9"){U=".",se=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(ee=this._number.exec(I)||j&&(ee=this._number.exec(`${I} `)))&&(U="literal",ie=ee[0],ue="string"==typeof ee[1]?$.double:"string"==typeof ee[2]?$.decimal:$.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(ee=this._sparqlKeyword.exec(I))?U=ee[0].toUpperCase():Te=!0;break;case"f":case"t":(ee=this._boolean.exec(I))?(U="literal",ie=ee[0],ue=$.boolean):Te=!0;break;case"a":(ee=this._shortPredicates.exec(I))?(U="abbreviation",ie="a"):Te=!0;break;case"=":this._n3Mode&&I.length>1&&(U="abbreviation",">"!==I[1]?(se=1,ie="="):(se=2,ie=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(se=1,U=E);break;default:Te=!0}if(Te&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(ee=this._prefix.exec(I))?((ee=this._prefixed.exec(I))||j&&(ee=this._prefixed.exec(`${I} `)))&&(U="prefixed",ue=ee[1]||"",ie=this._unescape(ee[2])):(U="prefix",ie=ee[1]||"")),"^^"===this._previousMarker)switch(U){case"prefixed":U="type";break;case"IRI":U="typeIRI";break;default:U=""}if(!U)return j||!/^'''|^"""/.test(I)&&/\n|\r/.test(I)?K(this):this._input=I;const me={line:Q,type:U,value:ie,prefix:ue};D(null,me),this.previousToken=me,this._previousMarker=U,I=I.substr(se||ee[0].length,I.length)}function K(M){D(M._syntaxError(/^\S*/.exec(I)[0]))}}_unescape(D){let j=!1;const I=D.replace(b,(H,K,M,F)=>{if("string"==typeof K)return String.fromCharCode(Number.parseInt(K,16));if("string"==typeof M){let Q=Number.parseInt(M,16);return Q<=65535?String.fromCharCode(Number.parseInt(M,16)):String.fromCharCode(55296+((Q-=65536)>>10),56320+(1023&Q))}return F in S?S[F]:(j=!0,"")});return j?null:I}_parseLiteral(D){if(D.length>=3){const j=D.match(/^(?:"""|"|'''|'|)/)[0],I=j.length;let H=Math.max(this._literalClosingPos,I);for(;(H=D.indexOf(j,H))>0;){let K=0;for(;"\\"===D[H-K-1];)K++;if(K%2==0){const M=D.substring(I,H),F=M.split(/\r\n|\r|\n/).length-1,Q=H+I;if(1===I&&0!==F||3===I&&this._lineMode)break;return this._line+=F,{value:this._unescape(M),matchLength:Q}}H++}this._literalClosingPos=D.length-I+1}return{value:"",matchLength:0}}_syntaxError(D){this._input=null;const j=new Error(`Unexpected "${D}" on line ${this._line}.`);return j.context={token:void 0,line:this._line,previousToken:this.previousToken},j}_readStartingBom(D){return D.startsWith("\ufeff")?D.substr(1):D}tokenize(D,j){if(this._line=1,"string"==typeof D){if(this._input=this._readStartingBom(D),"function"!=typeof j){const I=[];let H;if(this._tokenizeToEnd((K,M)=>K?H=K:I.push(M),!0),H)throw H;return I}(0,L.default)(()=>this._tokenizeToEnd(j,!0))}else this._pendingBuffer=null,"function"==typeof D.setEncoding&&D.setEncoding("utf8"),D.on("data",I=>{null!==this._input&&0!==I.length&&(this._pendingBuffer&&(I=W.concat([this._pendingBuffer,I]),this._pendingBuffer=null),128&I[I.length-1]?this._pendingBuffer=I:(void 0===this._input?this._input=this._readStartingBom("string"==typeof I?I:I.toString()):this._input+=I,this._tokenizeToEnd(j,!1)))}),D.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(j,!0)}),D.on("error",j)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=re(Y("./N3Lexer")),V=re(Y("./N3DataFactory")),L=re(Y("./IRIs"));function re(A){return A&&A.__esModule?A:{default:A}}let $=0;class b{constructor(v){this._contextStack=[],this._graph=null,this._setBase((v=v||{}).baseIRI),v.factory&&R(this,v.factory);const y="string"==typeof v.format?v.format.match(/\w*$/)[0].toLowerCase():"",w=/turtle/.test(y),D=/trig/.test(y),j=/triple/.test(y),I=/quad/.test(y),H=this._n3Mode=/n3/.test(y),K=j||I;(this._supportsNamedGraphs=!(w||H))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(w||D||j||H),this._supportsRDFStar=""===y||/star|\*$/.test(y),K&&(this._resolveRelativeIRI=M=>null),this._blankNodePrefix="string"!=typeof v.blankNodePrefix?"":v.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=v.lexer||new W.default({lineMode:K,n3:H}),this._explicitQuantifiers=!!v.explicitQuantifiers}static _resetBlankNodePrefix(){$=0}_setBase(v){if(v){const y=v.indexOf("#");y>=0&&(v=v.substr(0,y)),this._base=v,this._basePath=v.indexOf("/")<0?v:v.replace(/[^\/?]*(?:\?.*)?$/,""),v=v.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=v[0],this._baseScheme=v[1]}else this._base="",this._basePath=""}_saveContext(v,y,w,D,j){const I=this._n3Mode;this._contextStack.push({subject:w,predicate:D,object:j,graph:y,type:v,inverse:!!I&&this._inversePredicate,blankPrefix:I?this._prefixes._:"",quantified:I?this._quantified:null}),I&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const v=this._contextStack.pop(),y=this._n3Mode;this._subject=v.subject,this._predicate=v.predicate,this._object=v.object,this._graph=v.graph,y&&(this._inversePredicate=v.inverse,this._prefixes._=v.blankPrefix,this._quantified=v.quantified)}_readInTopContext(v){switch(v.type){case"eof":return null!==this._graph?this._error("Unclosed graph",v):(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(v)}}_readEntity(v,y){let w;switch(v.type){case"IRI":case"typeIRI":const D=this._resolveIRI(v.value);if(null===D)return this._error("Invalid IRI",v);w=this._namedNode(D);break;case"type":case"prefixed":const j=this._prefixes[v.prefix];if(void 0===j)return this._error(`Undefined prefix "${v.prefix}:"`,v);w=this._namedNode(j+v.value);break;case"blank":w=this._blankNode(this._prefixes[v.prefix]+v.value);break;case"var":w=this._variable(v.value.substr(1));break;default:return this._error(`Expected entity but got ${v.type}`,v)}return!y&&this._n3Mode&&w.id in this._quantified&&(w=this._quantified[w.id]),w}_readSubject(v){switch(this._predicate=null,v.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",v);case"}":return this._readPunctuation(v);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',v);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',v);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",v);if(0===v.prefix.length)return this._literalValue=v.value,this._completeSubjectLiteral;this._subject=this._literal(v.value,this._namedNode(v.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._subject=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(v){const y=v.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[v.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,v):(this._subject=null,"]"===y?this._readBlankNodeTail(v):this._readPunctuation(v));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",v);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",v);default:if(void 0===(this._predicate=this._readEntity(v)))return}return this._readObject}_readObject(v){switch(v.type){case"literal":if(0===v.prefix.length)return this._literalValue=v.value,this._readDataTypeOrLang;this._object=this._literal(v.value,this._namedNode(v.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._object=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(v){return"{"===v.type?this._readGraph(v):this._readPredicate(v)}_readGraph(v){return"{"!==v.type?this._error(`Expected graph but got ${v.type}`,v):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(v){return"]"===v.type?(this._subject=null,this._readBlankNodeTail(v)):(this._predicate=null,this._readPredicate(v))}_readBlankNodeTail(v){if("]"!==v.type)return this._readBlankNodePunctuation(v);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null===this._object?y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(v){switch(v.type){case".":case"}":return this._subject=null,this._readPunctuation(v);default:return this._readPredicate(v)}}_readListItem(v){let y=null,w=null,D=this._readListItem;const j=this._subject,I=this._contextStack,H=I[I.length-1];switch(v.type){case"[":this._saveContext("blank",this._graph,w=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),D=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,w=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==I.length&&"list"===I[I.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(D=this._readPredicate,this._subject===this.RDF_NIL)return D}else if(D=this._getContextEndReader(),this._object===this.RDF_NIL)return D;w=this.RDF_NIL;break;case"literal":0===v.prefix.length?(this._literalValue=v.value,D=this._readListItemDataTypeOrLang):(y=this._literal(v.value,this._namedNode(v.prefix)),D=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);default:if(void 0===(y=this._readEntity(v)))return}if(null===w&&(this._subject=w=this._blankNode()),null===j?null===H.predicate?H.subject=w:H.object=w:this._emit(j,this.RDF_REST,w,this._graph),null!==y){if(this._n3Mode&&("IRI"===v.type||"prefixed"===v.type))return this._saveContext("item",this._graph,w,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(w,this.RDF_FIRST,y,this._graph)}return D}_readDataTypeOrLang(v){return this._completeObjectLiteral(v,!1)}_readListItemDataTypeOrLang(v){return this._completeObjectLiteral(v,!0)}_completeLiteral(v){let y=this._literal(this._literalValue);switch(v.type){case"type":case"typeIRI":const w=this._readEntity(v);if(void 0===w)return;y=this._literal(this._literalValue,w),v=null;break;case"langcode":y=this._literal(this._literalValue,v.value),v=null}return{token:v,literal:y}}_completeSubjectLiteral(v){return this._subject=this._completeLiteral(v).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(v,y){const w=this._completeLiteral(v);if(w)return this._object=w.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===w.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(w.token))}_readFormulaTail(v){return"}"!==v.type?this._readPunctuation(v):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(v){let y,w=this._graph;const D=this._subject,j=this._inversePredicate;switch(v.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",v);if(this._n3Mode)return this._readFormulaTail(v);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,j&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(w=this._readEntity(v))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}if(null!==D){const I=this._predicate,H=this._object;j?this._emit(H,I,D,w):this._emit(D,I,H,w)}return y}_readBlankNodePunctuation(v){let y;switch(v.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(v){return"."!==v.type?this._error("Expected dot to follow quad",v):this._readInTopContext}_readPrefix(v){return"prefix"!==v.type?this._error("Expected prefix to follow @prefix",v):(this._prefix=v.value,this._readPrefixIRI)}_readPrefixIRI(v){if("IRI"!==v.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,v);const y=this._readEntity(v);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(v){const y="IRI"===v.type&&this._resolveIRI(v.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",v)}_readNamedGraphLabel(v){switch(v.type){case"IRI":case"blank":case"prefixed":return this._readSubject(v),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",v)}}_readNamedGraphBlankLabel(v){return"]"!==v.type?this._error("Invalid graph label",v):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(v){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(v)):"."!==v.type?this._error("Expected declaration to end with a dot",v):this._readInTopContext}_readQuantifierList(v){let y;switch(v.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(v,!0)))break;default:return this._error(`Unexpected ${v.type}`,v)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,y,this.QUANTIFIERS_GRAPH)):this._quantified[y.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(v){return","===v.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(v))}_getPathReader(v){return this._afterPath=v,this._readPath}_readPath(v){switch(v.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,w=y.length&&y[y.length-1];if(w&&"item"===w.type){const D=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,D,this._graph)}return this._afterPath(v)}}_readForwardPath(v){let y,w;const D=this._blankNode();if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(y=this._subject,this._subject=D):(y=this._object,this._object=D),this._emit(y,w,D,this._graph),this._readPath}_readBackwardPath(v){const y=this._blankNode();let w,D;if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(D=this._subject,this._subject=y):(D=this._object,this._object=y),this._emit(y,w,D,this._graph),this._readPath}_readRDFStarTailOrGraph(v){return">>"!==v.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(v))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,v):this._readRDFStarTail(v)}_readRDFStarTail(v){if(">>"!==v.type)return this._error(`Expected >> but got ${v.type}`,v);const y=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=y,this._readPredicate):(this._object=y,this._getContextEndReader())}_getContextEndReader(){const v=this._contextStack;if(!v.length)return this._readPunctuation;switch(v[v.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(v,y,w,D){this._callback(null,this._quad(v,y,w,D||this.DEFAULTGRAPH))}_error(v,y){const w=new Error(`${v} on line ${y.line}.`);w.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(w),this._callback=S}_resolveIRI(v){return/^[a-z][a-z0-9+.-]*:/i.test(v)?v:this._resolveRelativeIRI(v)}_resolveRelativeIRI(v){if(!v.length)return this._base;switch(v[0]){case"#":return this._base+v;case"?":return this._base.replace(/(?:\?.*)?$/,v);case"/":return("/"===v[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(v);default:return/^[^/:]*:/.test(v)?null:this._removeDotSegments(this._basePath+v)}}_removeDotSegments(v){if(!/(^|\/)\.\.?($|[/#?])/.test(v))return v;const y=v.length;let w="",D=-1,j=-1,I=0,H="/";for(;D=j&&(w=w.substr(0,I)),"/"!==H)return`${w}/${v.substr(D+1)}`;I=D+1}}}H=v[++D]}return w+v.substring(I)}parse(v,y,w){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${$++}_`,this._prefixCallback=w||S,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const D=[];let j;if(this._callback=(I,H)=>{I?j=I:H&&D.push(H)},this._lexer.tokenize(v).every(I=>this._readCallback=this._readCallback(I)),j)throw j;return D}this._callback=y,this._lexer.tokenize(v,(D,j)=>{null!==D?(this._callback(D),this._callback=S):this._readCallback&&(this._readCallback=this._readCallback(j))})}}function S(){}function R(A,v){const y=v.namedNode;A._namedNode=y,A._blankNode=v.blankNode,A._literal=v.literal,A._variable=v.variable,A._quad=v.quad,A.DEFAULTGRAPH=v.defaultGraph(),A.RDF_FIRST=y(L.default.rdf.first),A.RDF_REST=y(L.default.rdf.rest),A.RDF_NIL=y(L.default.rdf.nil),A.N3_FORALL=y(L.default.r.forAll),A.N3_FORSOME=y(L.default.r.forSome),A.ABBREVIATIONS={a:y(L.default.rdf.type),"=":y(L.default.owl.sameAs),">":y(L.default.log.implies)},A.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=b,R(b.prototype,V.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var v,W=function(v,y){if(!y&&v&&v.__esModule)return v;if(null===v||"object"!=typeof v&&"function"!=typeof v)return{default:v};var w=$(y);if(w&&w.has(v))return w.get(v);var D={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in v)if("default"!==I&&Object.prototype.hasOwnProperty.call(v,I)){var H=j?Object.getOwnPropertyDescriptor(v,I):null;H&&(H.get||H.set)?Object.defineProperty(D,I,H):D[I]=v[I]}return D.default=v,w&&w.set(v,D),D}(Y("./N3DataFactory")),V=Y("readable-stream"),L=(v=Y("./IRIs"))&&v.__esModule?v:{default:v};function $(v){if("function"!=typeof WeakMap)return null;var y=new WeakMap,w=new WeakMap;return($=function(D){return D?w:y})(v)}class S{constructor(y,w){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!w&&y&&!y[0]&&(w=y,y=null),this._factory=(w=w||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const w=this._graphs;let D,j;for(const I in w)for(const H in D=w[I].subjects)for(const K in j=D[H])y+=Object.keys(j[K]).length;return this._size=y}_addToIndex(y,w,D,j){const I=y[w]||(y[w]={}),H=I[D]||(I[D]={}),K=j in H;return K||(H[j]=null),!K}_removeFromIndex(y,w,D,j){const I=y[w],H=I[D];delete H[j];for(const K in H)return;delete I[D];for(const K in I)return;delete y[w]}_findInIndex(y,w,D,j,I,H,K,M,F,Q){let E,U,ie;const ee=!w+!D+!j>1?Object.keys(this._ids):this._entities;w&&((E=y,y={})[w]=E[w]);for(const se in y){const Te=ee[se];if(U=y[se]){D&&((E=U,U={})[D]=E[D]);for(const me in U){const te=ee[me];if(ie=U[me]){const ye=j?j in ie?[j]:[]:Object.keys(ie);for(let Me=0;Me{D in w||(w[D]=!0,y((0,W.termFromId)(this._entities[D],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,w,D,j){w||(j=y.graph,D=y.object,w=y.predicate,y=y.subject),y=(0,W.termToId)(y),w=(0,W.termToId)(w),D=(0,W.termToId)(D),j=(0,W.termToId)(j);let I=this._graphs[j];I||(I=this._graphs[j]={subjects:{},predicates:{},objects:{}},Object.freeze(I));const H=this._ids,K=this._entities;y=H[y]||(H[K[++this._id]=y]=this._id),w=H[w]||(H[K[++this._id]=w]=this._id),D=H[D]||(H[K[++this._id]=D]=this._id);const M=this._addToIndex(I.subjects,y,w,D);return this._addToIndex(I.predicates,w,D,y),this._addToIndex(I.objects,D,y,w),this._size=null,M}addQuads(y){for(let w=0;w{this.addQuad(w)}),y}removeQuad(y,w,D,j){w||(j=y.graph,D=y.object,w=y.predicate,y=y.subject),y=(0,W.termToId)(y),w=(0,W.termToId)(w),D=(0,W.termToId)(D),j=(0,W.termToId)(j);const I=this._ids,H=this._graphs;let K,M,F;if(!((y=I[y])&&(w=I[w])&&(D=I[D])&&(K=H[j])&&(M=K.subjects[y])&&(F=M[w])&&D in F))return!1;for(y in this._removeFromIndex(K.subjects,y,w,D),this._removeFromIndex(K.predicates,w,D,y),this._removeFromIndex(K.objects,D,y,w),null!==this._size&&this._size--,K.subjects)return!0;return delete H[j],!0}removeQuads(y){for(let w=0;w{this.removeQuad(w)}),y}removeMatches(y,w,D,j){const I=new V.Readable({objectMode:!0});return I._read=()=>{for(const H of this.getQuads(y,w,D,j))I.push(H);I.push(null)},this.remove(I)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,w,D,j){y=y&&(0,W.termToId)(y),w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=[],H=this._getGraphs(j),K=this._ids;let M,F,Q,E;if(R(y)&&!(F=K[y])||R(w)&&!(Q=K[w])||R(D)&&!(E=K[D]))return I;for(const U in H)(M=H[U])&&(F?E?this._findInIndex(M.objects,E,F,Q,"object","subject","predicate",U,null,I):this._findInIndex(M.subjects,F,Q,null,"subject","predicate","object",U,null,I):Q?this._findInIndex(M.predicates,Q,E,null,"predicate","object","subject",U,null,I):E?this._findInIndex(M.objects,E,null,null,"object","subject","predicate",U,null,I):this._findInIndex(M.subjects,null,null,null,"subject","predicate","object",U,null,I));return I}match(y,w,D,j){return new A(this,y,w,D,j)}countQuads(y,w,D,j){y=y&&(0,W.termToId)(y),w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._getGraphs(j),H=this._ids;let M,F,Q,E,K=0;if(R(y)&&!(F=H[y])||R(w)&&!(Q=H[w])||R(D)&&!(E=H[D]))return 0;for(const U in I)(M=I[U])&&(K+=y?D?this._countInIndex(M.objects,E,F,Q):this._countInIndex(M.subjects,F,Q,E):w?this._countInIndex(M.predicates,Q,E,F):this._countInIndex(M.objects,E,F,Q));return K}forEach(y,w,D,j,I){this.some(H=>(y(H),!1),w,D,j,I)}every(y,w,D,j,I){let H=!1;const K=!this.some(M=>(H=!0,!y(M)),w,D,j,I);return H&&K}some(y,w,D,j,I){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j),I=I&&(0,W.termToId)(I);const H=this._getGraphs(I),K=this._ids;let M,F,Q,E;if(R(w)&&!(F=K[w])||R(D)&&!(Q=K[D])||R(j)&&!(E=K[j]))return!1;for(const U in H)if(M=H[U])if(F){if(E){if(this._findInIndex(M.objects,E,F,Q,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(M.subjects,F,Q,null,"subject","predicate","object",U,y,null))return!0}else if(Q){if(this._findInIndex(M.predicates,Q,E,null,"predicate","object","subject",U,y,null))return!0}else if(E){if(this._findInIndex(M.objects,E,null,null,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(M.subjects,null,null,null,"subject","predicate","object",U,y,null))return!0;return!1}getSubjects(y,w,D){const j=[];return this.forSubjects(I=>{j.push(I)},y,w,D),j}forSubjects(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.predicates,M,F,y):this._loopByKey1(K.subjects,M,y):F?this._loopByKey0(K.objects,F,y):this._loop(K.subjects,y))}getPredicates(y,w,D){const j=[];return this.forPredicates(I=>{j.push(I)},y,w,D),j}forPredicates(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.objects,F,M,y):this._loopByKey0(K.subjects,M,y):F?this._loopByKey1(K.predicates,F,y):this._loop(K.predicates,y))}getObjects(y,w,D){const j=[];return this.forObjects(I=>{j.push(I)},y,w,D),j}forObjects(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.subjects,M,F,y):this._loopByKey1(K.objects,M,y):F?this._loopByKey0(K.predicates,F,y):this._loop(K.objects,y))}getGraphs(y,w,D){const j=[];return this.forGraphs(I=>{j.push(I)},y,w,D),j}forGraphs(y,w,D,j){for(const I in this._graphs)this.some(H=>(y(H.graph),!0),w,D,j,I)}createBlankNode(y){let w,D;if(y)for(w=y=`_:${y}`,D=1;this._ids[w];)w=y+D++;else do{w="_:b"+this._blankNodeIndex++}while(this._ids[w]);return this._ids[w]=++this._id,this._entities[this._id]=w,this._factory.blankNode(w.substr(2))}extractLists({remove:y=!1,ignoreErrors:w=!1}={}){const D={},j=w?()=>!0:(K,M)=>{throw new Error(`${K.value} ${M}`)},I=this.getQuads(null,L.default.rdf.rest,L.default.rdf.nil,null),H=y?[...I]:[];return I.forEach(K=>{const M=[];let Q,E,F=!1;const U=K.graph;let ie=K.subject;for(;ie&&!F;){const ue=this.getQuads(null,null,ie,null),ee=this.getQuads(ie,null,null,null);let se,Te=null,me=null,te=null;for(let ye=0;ye{switch(v){case"data":R=y;break;case"end":A=y}}},(v,y)=>{v&&this.emit("error",v)||y&&this.push(y)},(v,y)=>{this.emit("prefix",v,y)}),this._transform=(v,y,w)=>{R(v),w()},this._flush=v=>{A(),v()}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var $,W=Y("readable-stream"),V=($=Y("./N3Writer"))&&$.__esModule?$:{default:$};he.default=class extends W.Transform{constructor(b){super({encoding:"utf8",writableObjectMode:!0});const S=this._writer=new V.default({write:(R,A,v)=>{this.push(R),v&&v()},end:R=>{this.push(null),R&&R()}},b);this._transform=(R,A,v)=>{S.addQuad(R,v)},this._flush=R=>{S.end(R)}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),b.on("prefix",(S,R)=>{this._writer.addPrefix(S,R)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.isDefaultGraph=S,he.inDefaultGraph=function(y){return S(y.graph)},he.prefix=function(y,w){return v({"":y},w)("")},he.prefixes=v;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function S(y){return!!y&&"DefaultGraph"===y.termType}function v(y,w){const D=Object.create(null);for(const I in y)j(I,y[I]);function j(I,H){if("string"==typeof H){const K=Object.create(null);D[I]=M=>K[M]||(K[M]=w.namedNode(H+M))}else if(!(I in D))throw new Error(`Unknown prefix: ${I}`);return D[I]}return w=w||W.default,j}},{"./N3DataFactory":35}],42:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,W=(H=Y("./IRIs"))&&H.__esModule?H:{default:H},V=function(H,K){if(!K&&H&&H.__esModule)return H;if(null===H||"object"!=typeof H&&"function"!=typeof H)return{default:H};var M=re(K);if(M&&M.has(H))return M.get(H);var F={},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in H)if("default"!==E&&Object.prototype.hasOwnProperty.call(H,E)){var U=Q?Object.getOwnPropertyDescriptor(H,E):null;U&&(U.get||U.set)?Object.defineProperty(F,E,U):F[E]=H[E]}return F.default=H,M&&M.set(H,F),F}(Y("./N3DataFactory")),L=Y("./N3Util");function re(H){if("function"!=typeof WeakMap)return null;var K=new WeakMap,M=new WeakMap;return(re=function(F){return F?M:K})(H)}const S=V.default.defaultGraph(),{rdf:R,xsd:A}=W.default,v=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,w={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class D extends V.Term{equals(){return!1}}function I(H){let K=w[H];return void 0===K&&(1===H.length?(K=H.charCodeAt(0).toString(16),K="\\u0000".substr(0,6-K.length)+K):(K=(1024*(H.charCodeAt(0)-55296)+H.charCodeAt(1)+9216).toString(16),K="\\U00000000".substr(0,10-K.length)+K)),K}he.default=class{constructor(K,M){if(this._prefixRegex=/$0^/,K&&"function"!=typeof K.write&&(M=K,K=null),this._lists=(M=M||{}).lists,K)this._outputStream=K,this._endStream=void 0===M.end||!!M.end;else{let F="";this._outputStream={write(Q,E,U){F+=Q,U&&U()},end:Q=>{Q&&Q(null,F)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(M.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=S,this._baseIRI=M.baseIRI,this._prefixIRIs=Object.create(null),M.prefixes&&this.addPrefixes(M.prefixes))}get _inDefaultGraph(){return S.equals(this._graph)}_write(K,M){this._outputStream.write(K,"utf8",M)}_writeQuad(K,M,F,Q,E){try{Q.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(S.equals(Q)?"":`${this._encodeIriOrBlank(Q)} {\n`)),this._graph=Q,this._subject=null),K.equals(this._subject)?M.equals(this._predicate)?this._write(`, ${this._encodeObject(F)}`,E):this._write(`;\n ${this._encodePredicate(this._predicate=M)} ${this._encodeObject(F)}`,E):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=K)} ${this._encodePredicate(this._predicate=M)} ${this._encodeObject(F)}`,E)}catch(U){E&&E(U)}}_writeQuadLine(K,M,F,Q,E){delete this._prefixMatch,this._write(this.quadToString(K,M,F,Q),E)}quadToString(K,M,F,Q){return`${this._encodeSubject(K)} ${this._encodeIriOrBlank(M)} ${this._encodeObject(F)}${Q&&Q.value?` ${this._encodeIriOrBlank(Q)} .\n`:" .\n"}`}quadsToString(K){return K.map(M=>this.quadToString(M.subject,M.predicate,M.object,M.graph)).join("")}_encodeSubject(K){return"Quad"===K.termType?this._encodeQuad(K):this._encodeIriOrBlank(K)}_encodeIriOrBlank(K){if("NamedNode"!==K.termType)return this._lists&&K.value in this._lists&&(K=this.list(this._lists[K.value])),"id"in K?K.id:`_:${K.value}`;let M=K.value;this._baseIRI&&M.startsWith(this._baseIRI)&&(M=M.substr(this._baseIRI.length)),v.test(M)&&(M=M.replace(y,I));const F=this._prefixRegex.exec(M);return F?F[1]?this._prefixIRIs[F[1]]+F[2]:M:`<${M}>`}_encodeLiteral(K){let M=K.value;if(v.test(M)&&(M=M.replace(y,I)),K.language)return`"${M}"@${K.language}`;if(this._lineMode){if(K.datatype.value===A.string)return`"${M}"`}else switch(K.datatype.value){case A.string:return`"${M}"`;case A.boolean:if("true"===M||"false"===M)return M;break;case A.integer:if(/^[+-]?\d+$/.test(M))return M;break;case A.decimal:if(/^[+-]?\d*\.\d+$/.test(M))return M;break;case A.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(M))return M}return`"${M}"^^${this._encodeIriOrBlank(K.datatype)}`}_encodePredicate(K){return K.value===R.type?"a":this._encodeIriOrBlank(K)}_encodeObject(K){switch(K.termType){case"Quad":return this._encodeQuad(K);case"Literal":return this._encodeLiteral(K);default:return this._encodeIriOrBlank(K)}}_encodeQuad({subject:K,predicate:M,object:F,graph:Q}){return`<<${this._encodeSubject(K)} ${this._encodePredicate(M)} ${this._encodeObject(F)}${(0,L.isDefaultGraph)(Q)?"":` ${this._encodeIriOrBlank(Q)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(K,M,F,Q,E){void 0===F?this._writeQuad(K.subject,K.predicate,K.object,K.graph,M):"function"==typeof Q?this._writeQuad(K,M,F,S,Q):this._writeQuad(K,M,F,Q||S,E)}addQuads(K){for(let M=0;M.\n`)}if(F){let Q="",E="";for(const U in this._prefixIRIs)Q+=Q?`|${U}`:U,E+=(E?"|":"")+this._prefixIRIs[U];Q=Q.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${E})[^/]*$|^(${Q})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(F?"\n":"",M)}blank(K,M){let Q,E,F=K;switch(void 0===K?F=[]:K.termType?F=[{predicate:K,object:M}]:"length"in K||(F=[K]),E=F.length){case 0:return new D("[]");case 1:if(Q=F[0],!(Q.object instanceof D))return new D(`[ ${this._encodePredicate(Q.predicate)} ${this._encodeObject(Q.object)} ]`);default:let U="[";for(let ie=0;ie{M=null,K(F,Q)});if(this._endStream)try{return this._outputStream.end(M)}catch(F){}M&&M()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return R.Term}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return R.NamedNode}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return R.Literal}}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return R.BlankNode}}),Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return R.Variable}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return R.DefaultGraph}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return R.Quad}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return R.Triple}}),Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return R.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return R.termToId}}),he.Util=void 0;var W=y(Y("./N3Lexer")),V=y(Y("./N3Parser")),L=y(Y("./N3Writer")),re=y(Y("./N3Store")),$=y(Y("./N3StreamParser")),b=y(Y("./N3StreamWriter")),S=v(Y("./N3Util"));he.Util=S;var R=v(Y("./N3DataFactory"));function A(w){if("function"!=typeof WeakMap)return null;var D=new WeakMap,j=new WeakMap;return(A=function(I){return I?j:D})(w)}function v(w,D){if(!D&&w&&w.__esModule)return w;if(null===w||"object"!=typeof w&&"function"!=typeof w)return{default:w};var j=A(D);if(j&&j.has(w))return j.get(w);var I={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var K in w)if("default"!==K&&Object.prototype.hasOwnProperty.call(w,K)){var M=H?Object.getOwnPropertyDescriptor(w,K):null;M&&(M.get||M.set)?Object.defineProperty(I,K,M):I[K]=w[K]}return I.default=w,j&&j.set(w,I),I}function y(w){return w&&w.__esModule?w:{default:w}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Ae,he){var V,L,W=Ae.exports={};function re(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function b(H){if(V===setTimeout)return setTimeout(H,0);if((V===re||!V)&&setTimeout)return V=setTimeout,setTimeout(H,0);try{return V(H,0)}catch(K){try{return V.call(null,H,0)}catch(M){return V.call(this,H,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:re}catch(H){V=re}try{L="function"==typeof clearTimeout?clearTimeout:$}catch(H){L=$}}();var v,R=[],A=!1,y=-1;function w(){!A||!v||(A=!1,v.length?R=v.concat(R):y=-1,R.length&&D())}function D(){if(!A){var H=b(w);A=!0;for(var K=R.length;K;){for(v=R,R=[];++y1)for(var M=1;M(V||(V=Promise.resolve())).then(L).catch(re=>setTimeout(()=>{throw re},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Ae,he){Ae.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Ae,he){"use strict";Ae.exports=class vW{constructor(V,L=new Map,re=0){this.prefix=V,this._existing=L,this.counter=re}clone(){const{prefix:V,_existing:L,counter:re}=this;return new vW(V,new Map(L),re)}getId(V){const L=V&&this._existing.get(V);if(L)return L;const re=this.prefix+this.counter;return this.counter++,V&&this._existing.set(V,re),re}hasId(V){return this._existing.has(V)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Ae,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Ae.exports=class{constructor(L){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===L)this.algorithm={name:"SHA-256"};else{if("sha1"!==L)throw new Error(`Unsupport algorithm "${L}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(L){this._content+=L}digest(){var L=this;return gt(function*(){const re=(new TextEncoder).encode(L._content),$=new Uint8Array(yield W.subtle.digest(L.algorithm,re));let b="";for(let S=0;S<$.length;++S)b+=$[S].toString(16).padStart(2,"0");return b})()}}},{setimmediate:86}],49:[function(Y,Ae,he){"use strict";const L="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",re="http://www.w3.org/2001/XMLSchema#string",$="NamedNode",b="BlankNode",S="Literal",R="DefaultGraph",A={};function v(I,H){return I.subject.termType===H.subject.termType&&I.object.termType===H.object.termType&&I.subject.value===H.subject.value&&I.predicate.value===H.predicate.value&&I.object.value===H.object.value&&(I.object.termType!==S||I.object.datatype.termType===H.object.datatype.termType&&I.object.language===H.object.language&&I.object.datatype.value===H.object.datatype.value)}A.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,A.empty=new RegExp("^[ \\t]*$"),A.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),Ae.exports=class pP{static parse(H){const K=[],M={},F=H.split(A.eoln);let Q=0;for(const E of F){if(Q++,A.empty.test(E))continue;const U=E.match(A.quad);if(null===U)throw new Error("N-Quads parse error on line "+Q+".");const ie={subject:null,predicate:null,object:null,graph:null};if(ie.subject=void 0!==U[1]?{termType:$,value:U[1]}:{termType:b,value:U[2]},ie.predicate={termType:$,value:U[3]},void 0!==U[4]?ie.object={termType:$,value:U[4]}:void 0!==U[5]?ie.object={termType:b,value:U[5]}:(ie.object={termType:S,value:void 0,datatype:{termType:$}},void 0!==U[7]?ie.object.datatype.value=U[7]:void 0!==U[8]?(ie.object.datatype.value=L,ie.object.language=U[8]):ie.object.datatype.value=re,ie.object.value=U[6].replace(D,function(H,K,M,F){if(K)switch(K){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(M)return String.fromCharCode(parseInt(M,16));if(F)throw new Error("Unsupported U escape")})),ie.graph=void 0!==U[9]?{termType:$,value:U[9]}:void 0!==U[10]?{termType:b,value:U[10]}:{termType:R,value:""},ie.graph.value in M){let ue=!0;const ee=M[ie.graph.value];for(const se of ee)if(v(se,ie)){ue=!1;break}ue&&(ee.push(ie),K.push(ie))}else M[ie.graph.value]=[ie],K.push(ie)}return K}static serialize(H){Array.isArray(H)||(H=pP.legacyDatasetToQuads(H));const K=[];for(const M of H)K.push(pP.serializeQuad(M));return K.sort().join("")}static serializeQuad(H){const K=H.subject,F=H.object,Q=H.graph;let E="";return E+=K.termType===$?`<${K.value}>`:`${K.value}`,E+=` <${H.predicate.value}> `,F.termType===$?E+=`<${F.value}>`:F.termType===b?E+=F.value:(E+=`"${I=F.value,I.replace(y,function(H){switch(H){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,F.datatype.value===L?F.language&&(E+=`@${F.language}`):F.datatype.value!==re&&(E+=`^^<${F.datatype.value}>`)),Q.termType===$?E+=` <${Q.value}>`:Q.termType===b&&(E+=` ${Q.value}`),E+=" .\n",E;var I}static legacyDatasetToQuads(H){const K=[],M={"blank node":b,IRI:$,literal:S};for(const F in H)H[F].forEach(E=>{const U={};for(const ie in E){const ue=E[ie],ee={termType:M[ue.type],value:ue.value};ee.termType===S&&(ee.datatype={termType:$},"datatype"in ue&&(ee.datatype.value=ue.datatype),"language"in ue?("datatype"in ue||(ee.datatype.value=L),ee.language=ue.language):"datatype"in ue||(ee.datatype.value=re)),U[ie]=ee}U.graph="@default"===F?{termType:R,value:""}:{termType:F.startsWith("_:")?b:$,value:F},K.push(U)});return K}};const y=/["\\\n\r]/g;const D=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Ae,he){"use strict";Ae.exports=class{constructor(V){this.current=V.sort(),this.done=!1,this.dir=new Map;for(let L=0;L$)&&(v&&R>0&&A>V[R-1]||!v&&RV[R+1])&&($=A,b=R)}if(null===$)this.done=!0;else{const R=L.get($)?b-1:b+1;V[b]=V[R],V[R]=$;for(const A of V)A>$&&L.set(A,!L.get(A))}return re}}},{}],51:[function(Y,Ae,he){(function(W){(function(){"use strict";const V=Y("./IdentifierIssuer"),L=Y("./MessageDigest"),re=Y("./Permuter"),$=Y("./NQuads");function b(S,R){return S.hashR.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new V("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(R){var A=this;return gt(function*(){A.quads=R;for(const H of R)A._addBlankNodeQuadInfo({quad:H,component:H.subject}),A._addBlankNodeQuadInfo({quad:H,component:H.object}),A._addBlankNodeQuadInfo({quad:H,component:H.graph});const v=new Map,y=[...A.blankNodeInfo.keys()];let w=0;for(const H of y)++w%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:H,hashToBlankNodes:v});const D=[...v.keys()].sort(),j=[];for(const H of D){const K=v.get(H);K.length>1?j.push(K):A.canonicalIssuer.getId(K[0])}for(const H of j){const K=[];for(const M of H){if(A.canonicalIssuer.hasId(M))continue;const F=new V("_:b");F.getId(M);const Q=yield A.hashNDegreeQuads(M,F);K.push(Q)}K.sort(b);for(const M of K){const F=M.issuer.getOldIds();for(const Q of F)A.canonicalIssuer.getId(Q)}}const I=[];for(const H of A.quads){const K=ht({},H);K.subject=A._useCanonicalId({component:K.subject}),K.object=A._useCanonicalId({component:K.object}),K.graph=A._useCanonicalId({component:K.graph}),I.push($.serializeQuad(K))}return I.sort(),I.join("")})()}hashFirstDegreeQuads(R){var A=this;return gt(function*(){const v=[],y=A.blankNodeInfo.get(R),w=y.quads;for(const j of w){const I={subject:null,predicate:j.predicate,object:null,graph:null};I.subject=A.modifyFirstDegreeComponent(R,j.subject,"subject"),I.object=A.modifyFirstDegreeComponent(R,j.object,"object"),I.graph=A.modifyFirstDegreeComponent(R,j.graph,"graph"),v.push($.serializeQuad(I))}v.sort();const D=new L(A.hashAlgorithm);for(const j of v)D.update(j);return y.hash=yield D.digest(),y.hash})()}hashRelatedBlankNode(R,A,v,y){var w=this;return gt(function*(){let D;D=w.canonicalIssuer.hasId(R)?w.canonicalIssuer.getId(R):v.hasId(R)?v.getId(R):w.blankNodeInfo.get(R).hash;const j=new L(w.hashAlgorithm);return j.update(y),"g"!==y&&j.update(w.getRelatedPredicate(A)),j.update(D),j.digest()})()}hashNDegreeQuads(R,A){var v=this;return gt(function*(){const y=new L(v.hashAlgorithm),w=yield v.createHashToRelated(R,A),D=[...w.keys()].sort();for(const j of D){y.update(j);let H,I="";const K=new re(w.get(j));let M=0;for(;K.hasNext();){const F=K.next();++M%3==0&&(yield v._yield());let Q=A.clone(),E="";const U=[];let ie=!1;for(const ue of F)if(v.canonicalIssuer.hasId(ue)?E+=v.canonicalIssuer.getId(ue):(Q.hasId(ue)||U.push(ue),E+=Q.getId(ue)),0!==I.length&&E>I){ie=!0;break}if(!ie){for(const ue of U){const ee=yield v.hashNDegreeQuads(ue,Q);if(E+=Q.getId(ue),E+=`<${ee.hash}>`,Q=ee.issuer,0!==I.length&&E>I){ie=!0;break}}ie||(0===I.length||E`}createHashToRelated(R,A){var v=this;return gt(function*(){const y=new Map,w=v.blankNodeInfo.get(R).quads;let D=0;for(const j of w)++D%100==0&&(yield v._yield()),yield Promise.all([v._addRelatedBlankNodeHash({quad:j,component:j.subject,position:"s",id:R,issuer:A,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.object,position:"o",id:R,issuer:A,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.graph,position:"g",id:R,issuer:A,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:R,hashToBlankNodes:A}){var v=this;return gt(function*(){const y=yield v.hashFirstDegreeQuads(R),w=A.get(y);w?w.push(R):A.set(y,[R])})()}_addBlankNodeQuadInfo({quad:R,component:A}){if("BlankNode"!==A.termType)return;const v=A.value,y=this.blankNodeInfo.get(v);y?y.quads.add(R):this.blankNodeInfo.set(v,{quads:new Set([R]),hash:null})}_addRelatedBlankNodeHash({quad:R,component:A,position:v,id:y,issuer:w,hashToRelated:D}){var j=this;return gt(function*(){if("BlankNode"!==A.termType||A.value===y)return;const I=A.value,H=yield j.hashRelatedBlankNode(I,R,w,v),K=D.get(H);K?K.push(I):D.set(H,[I])})()}_useCanonicalId({component:R}){return"BlankNode"!==R.termType||R.value.startsWith(this.canonicalIssuer.prefix)?R:{termType:"BlankNode",value:this.canonicalIssuer.getId(R.value)}}_yield(){return gt(function*(){return new Promise(R=>W(R))})()}}}).call(this)}).call(this,Y("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(Y,Ae,he){"use strict";const W=Y("./IdentifierIssuer"),V=Y("./MessageDigest"),L=Y("./Permuter"),re=Y("./NQuads");function $(b,S){return b.hashS.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(S){this.quads=S;for(const D of S)this._addBlankNodeQuadInfo({quad:D,component:D.subject}),this._addBlankNodeQuadInfo({quad:D,component:D.object}),this._addBlankNodeQuadInfo({quad:D,component:D.graph});const R=new Map,A=[...this.blankNodeInfo.keys()];for(const D of A)this._hashAndTrackBlankNode({id:D,hashToBlankNodes:R});const v=[...R.keys()].sort(),y=[];for(const D of v){const j=R.get(D);j.length>1?y.push(j):this.canonicalIssuer.getId(j[0])}for(const D of y){const j=[];for(const I of D){if(this.canonicalIssuer.hasId(I))continue;const H=new W("_:b");H.getId(I);const K=this.hashNDegreeQuads(I,H);j.push(K)}j.sort($);for(const I of j){const H=I.issuer.getOldIds();for(const K of H)this.canonicalIssuer.getId(K)}}const w=[];for(const D of this.quads){const j=ht({},D);j.subject=this._useCanonicalId({component:j.subject}),j.object=this._useCanonicalId({component:j.object}),j.graph=this._useCanonicalId({component:j.graph}),w.push(re.serializeQuad(j))}return w.sort(),w.join("")}hashFirstDegreeQuads(S){const R=[],A=this.blankNodeInfo.get(S),v=A.quads;for(const w of v){const D={subject:null,predicate:w.predicate,object:null,graph:null};D.subject=this.modifyFirstDegreeComponent(S,w.subject,"subject"),D.object=this.modifyFirstDegreeComponent(S,w.object,"object"),D.graph=this.modifyFirstDegreeComponent(S,w.graph,"graph"),R.push(re.serializeQuad(D))}R.sort();const y=new V(this.hashAlgorithm);for(const w of R)y.update(w);return A.hash=y.digest(),A.hash}hashRelatedBlankNode(S,R,A,v){let y;y=this.canonicalIssuer.hasId(S)?this.canonicalIssuer.getId(S):A.hasId(S)?A.getId(S):this.blankNodeInfo.get(S).hash;const w=new V(this.hashAlgorithm);return w.update(v),"g"!==v&&w.update(this.getRelatedPredicate(R)),w.update(y),w.digest()}hashNDegreeQuads(S,R){const A=new V(this.hashAlgorithm),v=this.createHashToRelated(S,R),y=[...v.keys()].sort();for(const w of y){A.update(w);let j,D="";const I=new L(v.get(w));for(;I.hasNext();){const H=I.next();let K=R.clone(),M="";const F=[];let Q=!1;for(const E of H)if(this.canonicalIssuer.hasId(E)?M+=this.canonicalIssuer.getId(E):(K.hasId(E)||F.push(E),M+=K.getId(E)),0!==D.length&&M>D){Q=!0;break}if(!Q){for(const E of F){const U=this.hashNDegreeQuads(E,K);if(M+=K.getId(E),M+=`<${U.hash}>`,K=U.issuer,0!==D.length&&M>D){Q=!0;break}}Q||(0===D.length||M`}createHashToRelated(S,R){const A=new Map,v=this.blankNodeInfo.get(S).quads;for(const y of v)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:S,issuer:R,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:S,issuer:R,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:S,issuer:R,hashToRelated:A});return A}_hashAndTrackBlankNode({id:S,hashToBlankNodes:R}){const A=this.hashFirstDegreeQuads(S),v=R.get(A);v?v.push(S):R.set(A,[S])}_addBlankNodeQuadInfo({quad:S,component:R}){if("BlankNode"!==R.termType)return;const A=R.value,v=this.blankNodeInfo.get(A);v?v.quads.add(S):this.blankNodeInfo.set(A,{quads:new Set([S]),hash:null})}_addRelatedBlankNodeHash({quad:S,component:R,position:A,id:v,issuer:y,hashToRelated:w}){if("BlankNode"!==R.termType||R.value===v)return;const D=R.value,j=this.hashRelatedBlankNode(D,S,y,A),I=w.get(j);I?I.push(D):w.set(j,[D])}_useCanonicalId({component:S}){return"BlankNode"!==S.termType||S.value.startsWith(this.canonicalIssuer.prefix)?S:{termType:"BlankNode",value:this.canonicalIssuer.getId(S.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015");Ae.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){var $=this;return gt(function*(){const b=new Map,S=$.blankNodeInfo.get(L).quads;let R=0;for(const A of S){let v,y;if("BlankNode"===A.subject.termType&&A.subject.value!==L)y=A.subject.value,v="p";else{if("BlankNode"!==A.object.termType||A.object.value===L)continue;y=A.object.value,v="r"}++R%100==0&&(yield $._yield());const w=yield $.hashRelatedBlankNode(y,A,re,v),D=b.get(w);D?D.push(y):b.set(w,[y])}return b})()}}},{"./URDNA2015":51}],54:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015Sync");Ae.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){const $=new Map,b=this.blankNodeInfo.get(L).quads;for(const S of b){let R,A;if("BlankNode"===S.subject.termType&&S.subject.value!==L)A=S.subject.value,R="p";else{if("BlankNode"!==S.object.termType||S.object.value===L)continue;A=S.object.value,R="r"}const v=this.hashRelatedBlankNode(A,S,re,R),y=$.get(v);y?y.push(A):$.set(v,[A])}return $}}},{"./URDNA2015Sync":52}],55:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015"),V=Y("./URGNA2012"),L=Y("./URDNA2015Sync"),re=Y("./URGNA2012Sync");let $;try{$=Y("rdf-canonize-native")}catch(S){}const b={};Ae.exports=b,b.NQuads=Y("./NQuads"),b.IdentifierIssuer=Y("./IdentifierIssuer"),b._rdfCanonizeNative=function(S){return S&&($=S),$},b.canonize=function(){var S=gt(function*(R,A){if(Array.isArray(R)||(R=b.NQuads.legacyDatasetToQuads(R)),A.useNative){if(!$)throw new Error("rdf-canonize-native not available");return new Promise((v,y)=>$.canonize(R,A,(w,D)=>w?y(w):v(D)))}if("URDNA2015"===A.algorithm)return new W(A).main(R);if("URGNA2012"===A.algorithm)return new V(A).main(R);throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(R,A){return S.apply(this,arguments)}}(),b._canonizeSync=function(S,R){if(Array.isArray(S)||(S=b.NQuads.legacyDatasetToQuads(S)),R.useNative){if($)return $.canonizeSync(S,R);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===R.algorithm)return new L(R).main(S);if("URGNA2012"===R.algorithm)return new re(R).main(S);throw"algorithm"in R?new Error("Invalid RDF Dataset Canonicalization algorithm: "+R.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(Y,Ae,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&W(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(Y("./lib/BlankNode"),he),V(Y("./lib/DataFactory"),he),V(Y("./lib/DefaultGraph"),he),V(Y("./lib/Literal"),he),V(Y("./lib/NamedNode"),he),V(Y("./lib/Quad"),he),V(Y("./lib/Variable"),he)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(L){this.termType="BlankNode",this.value=L}equals(L){return!!L&&"BlankNode"===L.termType&&L.value===this.value}}},{}],58:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),V=Y("./DefaultGraph"),L=Y("./Literal"),re=Y("./NamedNode"),$=Y("./Quad"),b=Y("./Variable");let S=0;he.DataFactory=class{constructor(v){this.blankNodeCounter=0,this.blankNodePrefix=(v=v||{}).blankNodePrefix||`df_${S++}_`}namedNode(v){return new re.NamedNode(v)}blankNode(v){return new W.BlankNode(v||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(v,y){return new L.Literal(v,y)}variable(v){return new b.Variable(v)}defaultGraph(){return V.DefaultGraph.INSTANCE}quad(v,y,w,D){return new $.Quad(v,y,w,D||this.defaultGraph())}fromTerm(v){switch(v.termType){case"NamedNode":return this.namedNode(v.value);case"BlankNode":return this.blankNode(v.value);case"Literal":return v.language?this.literal(v.value,v.language):v.datatype.equals(L.Literal.XSD_STRING)?this.literal(v.value):this.literal(v.value,this.fromTerm(v.datatype));case"Variable":return this.variable(v.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(v.subject),this.fromTerm(v.predicate),this.fromTerm(v.object),this.fromTerm(v.graph))}}fromQuad(v){return this.fromTerm(v)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(L){return!!L&&"DefaultGraph"===L.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class V{constructor(re,$){this.termType="Literal",this.value=re,"string"==typeof $?(this.language=$,this.datatype=V.RDF_LANGUAGE_STRING):$?(this.language="",this.datatype=$):(this.language="",this.datatype=V.XSD_STRING)}equals(re){return!!re&&"Literal"===re.termType&&re.value===this.value&&re.language===this.language&&re.datatype.equals(this.datatype)}}he.Literal=V,V.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),V.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(L){this.termType="NamedNode",this.value=L}equals(L){return!!L&&"NamedNode"===L.termType&&L.value===this.value}}},{}],62:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(L,re,$,b){this.termType="Quad",this.value="",this.subject=L,this.predicate=re,this.object=$,this.graph=b}equals(L){return!!L&&("Quad"===L.termType||!L.termType)&&this.subject.equals(L.subject)&&this.predicate.equals(L.predicate)&&this.object.equals(L.object)&&this.graph.equals(L.graph)}}},{}],63:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(L){this.termType="Variable",this.value=L}equals(L){return!!L&&"Variable"===L.termType&&L.value===this.value}}},{}],64:[function(Y,Ae,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&W(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(L,re){const $=L.saxStream._parser;super(L.trackPosition?`Line ${$.line+1} column ${$.column+1}: ${re}`:re)}}he.ParseError=W},{}],66:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),V=Y("sax"),L=Y("stream"),re=Y("./ParseError"),$=Y("rdf-data-factory");class b extends L.Transform{constructor(A){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},A&&(Object.assign(this,A),this.options=A),this.dataFactory||(this.dataFactory=new $.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=V.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(A,v){const y={};let w=!1;for(const j in A.attributes)j.startsWith("xmlns")&&(5===j.length?(w=!0,y[""]=A.attributes[j]):":"===j.charAt(5)&&(w=!0,y[j.substr(6)]=A.attributes[j]));const D=v&&v.ns?v.ns:[b.DEFAULT_NS];return w?D.concat([y]):D}static expandPrefixedTerm(A,v,y){const w=A.indexOf(":");let D,j;w>=0?(D=A.substr(0,w),j=A.substr(w+1)):(D="",j=A);let I=null,H=null;for(let K=v.length-1;K>=0;K--){const M=v[K][D];if(M){I=M;break}H||(H=v[K][""])}if(!I){if(D&&"xmlns"!==D)throw new re.ParseError(y,`The prefix '${D}' in term '${A}' was not bound.`);I=H||""}return{prefix:D,local:j,uri:I}}static isValidIri(A){return b.IRI_REGEX.test(A)}import(A){const v=new L.PassThrough({readableObjectMode:!0});A.on("error",w=>y.emit("error",w)),A.on("data",w=>v.push(w)),A.on("end",()=>v.push(null));const y=v.pipe(new b(this.options));return y}_transform(A,v,y){try{this.saxStream.write(A,v)}catch(w){return y(w)}y()}newParseError(A){return new re.ParseError(this,A)}valueToUri(A,v){return this.uriToNamedNode(W.resolve(A,v.baseIRI))}uriToNamedNode(A){if(!b.isValidIri(A))throw this.newParseError(`Invalid URI: ${A}`);return this.dataFactory.namedNode(A)}validateNcname(A){if(!b.NCNAME_MATCHER.test(A))throw this.newParseError(`Not a valid NCName: ${A}`)}attachSaxListeners(){this.saxStream.on("error",A=>this.emit("error",A)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(A){const v=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=S.RESOURCE;if(v&&(v.hadChildren=!0,y=v.childrenParseType),v&&v.childrenStringTags){const D=A.name;let j="";for(const M in A.attributes)j+=` ${M}="${A.attributes[M]}"`;v.childrenStringTags.push(`<${D}${j}>`);const K={childrenStringTags:v.childrenStringTags};return K.childrenStringEmitClosingTag=``,void this.activeTagStack.push(K)}const w={};v?(w.language=v.language,w.baseIRI=v.baseIRI):w.baseIRI=this.baseIRI,this.activeTagStack.push(w),w.ns=b.parseNamespace(A,v),y===S.RESOURCE?this.onTagResource(A,w,v,!v):this.onTagProperty(A,w,v)}onTagResource(A,v,y,w){const D=b.expandPrefixedTerm(A.name,v.ns,this);v.childrenParseType=S.PROPERTY;let j=!0;if(D.uri===b.RDF){if(!w&&b.FORBIDDEN_NODE_ELEMENTS.indexOf(D.local)>=0)throw this.newParseError(`Illegal node element name: ${D.local}`);switch(D.local){case"RDF":v.childrenParseType=S.RESOURCE;case"Description":j=!1}}const I=[],H=[];let K=null,M=!1,F=!1,Q=null;for(const E in A.attributes){const U=A.attributes[E],ie=b.expandPrefixedTerm(E,v.ns,this);if(y&&ie.uri===b.RDF)switch(ie.local){case"about":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);K=U;continue;case"ID":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);this.validateNcname(U),K="#"+U,M=!0;continue;case"nodeID":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);this.validateNcname(U),K=U,F=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":Q=U;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(ie.uri===b.XML){if("lang"===ie.local){v.language=""===U?null:U.toLowerCase();continue}if("base"===ie.local){v.baseIRI=W.resolve(U,v.baseIRI);continue}}"xml"!==ie.prefix&&ie.uri&&(I.push(this.uriToNamedNode(ie.uri+ie.local)),H.push(U))}if(null!==K&&(v.subject=F?this.dataFactory.blankNode(K):this.valueToUri(K,v),M&&this.claimNodeId(v.subject)),v.subject||(v.subject=this.dataFactory.blankNode()),j){const E=this.uriToNamedNode(D.uri+D.local);this.emitTriple(v.subject,this.dataFactory.namedNode(b.RDF+"type"),E,y?y.reifiedStatementId:null)}if(y){if(y.predicate)if(y.childrenCollectionSubject){const E=this.dataFactory.blankNode();this.emitTriple(y.childrenCollectionSubject,y.childrenCollectionPredicate,E,y.reifiedStatementId),this.emitTriple(E,this.dataFactory.namedNode(b.RDF+"first"),v.subject,v.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(b.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,v.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${w.local}`);v.predicateSubPredicates=[],v.predicateSubObjects=[];let D=!1,j=!1,I=null,H=!0;const K=[],M=[];for(const F in A.attributes){const Q=A.attributes[F],E=b.expandPrefixedTerm(F,v.ns,this);if(E.uri===b.RDF)switch(E.local){case"resource":if(I)throw this.newParseError(`Found both rdf:resource (${Q}) and rdf:nodeID (${I}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${Q})`);v.hadChildren=!0,I=Q,H=!1;continue;case"datatype":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${Q}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${Q})`);v.datatype=this.valueToUri(Q,v);continue;case"nodeID":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${Q}).`);if(v.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${Q}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${Q})`);this.validateNcname(Q),v.hadChildren=!0,I=Q,H=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(j)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(v.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${v.datatype.value})`);if(I)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${I})`);if("Resource"===Q){D=!0,v.childrenParseType=S.PROPERTY;const U=this.dataFactory.blankNode();this.emitTriple(v.subject,v.predicate,U,v.reifiedStatementId),v.subject=U,v.predicate=null}else"Collection"===Q?(D=!0,v.hadChildren=!0,v.childrenCollectionSubject=v.subject,v.childrenCollectionPredicate=v.predicate,H=!1):"Literal"===Q&&(D=!0,v.childrenTagsToString=!0,v.childrenStringTags=[]);continue;case"ID":this.validateNcname(Q),v.reifiedStatementId=this.valueToUri("#"+Q,v),this.claimNodeId(v.reifiedStatementId);continue}else if(E.uri===b.XML&&"lang"===E.local){v.language=""===Q?null:Q.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(D||v.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${Q}`);v.hadChildren=!0,j=!0,K.push(this.uriToNamedNode(E.uri+E.local)),M.push(this.dataFactory.literal(Q,v.datatype||v.language))}}if(null!==I){const F=v.subject;v.subject=H?this.dataFactory.blankNode(I):this.valueToUri(I,v),this.emitTriple(F,v.predicate,v.subject,v.reifiedStatementId);for(let Q=0;Q/g,(v,y,w)=>(this.saxStream._parser.ENTITIES[y]=w,""))}}var S,R;he.RdfXmlParser=b,b.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,b.MIME_TYPE="application/rdf+xml",b.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",b.XML="http://www.w3.org/XML/1998/namespace",b.XMLNS="http://www.w3.org/2000/xmlns/",b.DEFAULT_NS={xml:b.XML},b.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],b.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],b.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,(R=S=he.ParseType||(he.ParseType={}))[R.RESOURCE=0]="RESOURCE",R[R.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(Y,Ae,he){"use strict";var V={};function L(R,A,v){v||(v=Error);var w=function(D){function j(I,H,K){return D.call(this,function(D,j,I){return"string"==typeof A?A:A(D,j,I)}(I,H,K))||this}return function(R,A){R.prototype=Object.create(A.prototype),R.prototype.constructor=R,R.__proto__=A}(j,D),j}(v);w.prototype.name=v.name,w.prototype.code=R,V[R]=w}function re(R,A){if(Array.isArray(R)){var v=R.length;return R=R.map(function(y){return String(y)}),v>2?"one of ".concat(A," ").concat(R.slice(0,v-1).join(", "),", or ")+R[v-1]:2===v?"one of ".concat(A," ").concat(R[0]," or ").concat(R[1]):"of ".concat(A," ").concat(R[0])}return"of ".concat(A," ").concat(String(R))}L("ERR_INVALID_OPT_VALUE",function(R,A){return'The value "'+A+'" is invalid for option "'+R+'"'},TypeError),L("ERR_INVALID_ARG_TYPE",function(R,A,v){var y,w;if("string"==typeof A&&function(R,A,v){return R.substr(!v||v<0?0:+v,A.length)===A}(A,"not ")?(y="must not be",A=A.replace(/^not /,"")):y="must be",function(R,A,v){return(void 0===v||v>R.length)&&(v=R.length),R.substring(v-A.length,v)===A}(R," argument"))w="The ".concat(R," ").concat(y," ").concat(re(A,"type"));else{var D=function(R,A,v){return"number"!=typeof v&&(v=0),!(v+A.length>R.length)&&-1!==R.indexOf(A,v)}(R,".")?"property":"argument";w='The "'.concat(R,'" ').concat(D," ").concat(y," ").concat(re(A,"type"))}return w+". Received type ".concat(typeof v)},TypeError),L("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),L("ERR_METHOD_NOT_IMPLEMENTED",function(R){return"The "+R+" method is not implemented"}),L("ERR_STREAM_PREMATURE_CLOSE","Premature close"),L("ERR_STREAM_DESTROYED",function(R){return"Cannot call "+R+" after a stream was destroyed"}),L("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),L("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),L("ERR_STREAM_WRITE_AFTER_END","write after end"),L("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),L("ERR_UNKNOWN_ENCODING",function(R){return"Unknown encoding: "+R},TypeError),L("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.exports.codes=V},{}],68:[function(Y,Ae,he){(function(W){(function(){"use strict";var V=Object.keys||function(y){var w=[];for(var D in y)w.push(D);return w};Ae.exports=R;var L=Y("./_stream_readable"),re=Y("./_stream_writable");Y("inherits")(R,L);for(var $=V(re.prototype),b=0;b<$.length;b++){var S=$[b];R.prototype[S]||(R.prototype[S]=re.prototype[S])}function R(y){if(!(this instanceof R))return new R(y);L.call(this,y),re.call(this,y),this.allowHalfOpen=!0,y&&(!1===y.readable&&(this.readable=!1),!1===y.writable&&(this.writable=!1),!1===y.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",A)))}function A(){this._writableState.ended||W.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(w){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=w,this._writableState.destroyed=w)}})}).call(this)}).call(this,Y("_process"))},{"./_stream_readable":70,"./_stream_writable":72,_process:44,inherits:10}],69:[function(Y,Ae,he){"use strict";Ae.exports=V;var W=Y("./_stream_transform");function V(L){if(!(this instanceof V))return new V(L);W.call(this,L)}Y("inherits")(V,W),V.prototype._transform=function(L,re,$){$(null,L)}},{"./_stream_transform":71,inherits:10}],70:[function(Y,Ae,he){(function(W,V){(function(){"use strict";var L;Ae.exports=te,te.ReadableState=me,Y("events");var $=function(B,O){return B.listeners(O).length},b=Y("./internal/streams/stream"),S=Y("buffer").Buffer,R=V.Uint8Array||function(){};var w,y=Y("util");w=y&&y.debuglog?y.debuglog("stream"):function(){};var U,ie,ue,D=Y("./internal/streams/buffer_list"),j=Y("./internal/streams/destroy"),H=Y("./internal/streams/state").getHighWaterMark,K=Y("../errors").codes,M=K.ERR_INVALID_ARG_TYPE,F=K.ERR_STREAM_PUSH_AFTER_EOF,Q=K.ERR_METHOD_NOT_IMPLEMENTED,E=K.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Y("inherits")(te,b);var ee=j.errorOrDestroy,se=["error","close","destroy","pause","resume"];function me(pe,B,O){L=L||Y("./_stream_duplex"),"boolean"!=typeof O&&(O=B instanceof L),this.objectMode=!!(pe=pe||{}).objectMode,O&&(this.objectMode=this.objectMode||!!pe.readableObjectMode),this.highWaterMark=H(this,pe,"readableHighWaterMark",O),this.buffer=new D,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==pe.emitClose,this.autoDestroy=!!pe.autoDestroy,this.destroyed=!1,this.defaultEncoding=pe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,pe.encoding&&(U||(U=Y("string_decoder/").StringDecoder),this.decoder=new U(pe.encoding),this.encoding=pe.encoding)}function te(pe){if(L=L||Y("./_stream_duplex"),!(this instanceof te))return new te(pe);this._readableState=new me(pe,this,this instanceof L),this.readable=!0,pe&&("function"==typeof pe.read&&(this._read=pe.read),"function"==typeof pe.destroy&&(this._destroy=pe.destroy)),b.call(this)}function ye(pe,B,O,k,Re){w("readableAddChunk",B);var yt,Xe=pe._readableState;if(null===B)Xe.reading=!1,function(pe,B){if(w("onEofChunk"),!B.ended){if(B.decoder){var O=B.decoder.end();O&&O.length&&(B.buffer.push(O),B.length+=B.objectMode?1:O.length)}B.ended=!0,B.sync?je(pe):(B.needReadable=!1,B.emittedReadable||(B.emittedReadable=!0,Le(pe)))}}(pe,Xe);else if(Re||(yt=function(pe,B){var O;return!function(pe){return S.isBuffer(pe)||pe instanceof R}(B)&&"string"!=typeof B&&void 0!==B&&!pe.objectMode&&(O=new M("chunk",["string","Buffer","Uint8Array"],B)),O}(Xe,B)),yt)ee(pe,yt);else if(Xe.objectMode||B&&B.length>0)if("string"!=typeof B&&!Xe.objectMode&&Object.getPrototypeOf(B)!==S.prototype&&(B=function(pe){return S.from(pe)}(B)),k)Xe.endEmitted?ee(pe,new E):Me(pe,Xe,B,!0);else if(Xe.ended)ee(pe,new F);else{if(Xe.destroyed)return!1;Xe.reading=!1,Xe.decoder&&!O?(B=Xe.decoder.write(B),Xe.objectMode||0!==B.length?Me(pe,Xe,B,!1):Ee(pe,Xe)):Me(pe,Xe,B,!1)}else k||(Xe.reading=!1,Ee(pe,Xe));return!Xe.ended&&(Xe.lengthB.highWaterMark&&(B.highWaterMark=function(pe){return pe>=nt?pe=nt:(pe--,pe|=pe>>>1,pe|=pe>>>2,pe|=pe>>>4,pe|=pe>>>8,pe|=pe>>>16,pe++),pe}(pe)),pe<=B.length?pe:B.ended?B.length:(B.needReadable=!0,0))}function je(pe){var B=pe._readableState;w("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(w("emitReadable",B.flowing),B.emittedReadable=!0,W.nextTick(Le,pe))}function Le(pe){var B=pe._readableState;w("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(pe.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,be(pe)}function Ee(pe,B){B.readingMore||(B.readingMore=!0,W.nextTick(Oe,pe,B))}function Oe(pe,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:pe.listenerCount("data")>0&&pe.resume()}function Be(pe){w("readable nexttick read 0"),pe.read(0)}function X(pe,B){w("resume",B.reading),B.reading||pe.read(0),B.resumeScheduled=!1,pe.emit("resume"),be(pe),B.flowing&&!B.reading&&pe.read(0)}function be(pe){var B=pe._readableState;for(w("flow",B.flowing);B.flowing&&null!==pe.read(););}function ce(pe,B){return 0===B.length?null:(B.objectMode?O=B.buffer.shift():!pe||pe>=B.length?(O=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):O=B.buffer.consume(pe,B.decoder),O);var O}function Pe(pe){var B=pe._readableState;w("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,W.nextTick(Et,B,pe))}function Et(pe,B){if(w("endReadableNT",pe.endEmitted,pe.length),!pe.endEmitted&&0===pe.length&&(pe.endEmitted=!0,B.readable=!1,B.emit("end"),pe.autoDestroy)){var O=B._writableState;(!O||O.autoDestroy&&O.finished)&&B.destroy()}}function pt(pe,B){for(var O=0,k=pe.length;O=B.highWaterMark:B.length>0)||B.ended))return w("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?Pe(this):je(this),null;if(0===(pe=Je(pe,B))&&B.ended)return 0===B.length&&Pe(this),null;var Re,k=B.needReadable;return w("need readable",k),(0===B.length||B.length-pe0?ce(pe,B):null)?(B.needReadable=B.length<=B.highWaterMark,pe=0):(B.length-=pe,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),O!==pe&&B.ended&&Pe(this)),null!==Re&&this.emit("data",Re),Re},te.prototype._read=function(pe){ee(this,new Q("_read()"))},te.prototype.pipe=function(pe,B){var O=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=pe;break;case 1:k.pipes=[k.pipes,pe];break;default:k.pipes.push(pe)}k.pipesCount+=1,w("pipe count=%d opts=%j",k.pipesCount,B);var Xe=B&&!1===B.end||pe===W.stdout||pe===W.stderr?as:It;function yt(Os,zr){w("onunpipe"),Os===O&&zr&&!1===zr.hasUnpiped&&(zr.hasUnpiped=!0,w("cleanup"),pe.removeListener("close",Ur),pe.removeListener("finish",Is),pe.removeListener("drain",An),pe.removeListener("error",ci),pe.removeListener("unpipe",yt),O.removeListener("end",It),O.removeListener("end",as),O.removeListener("data",yi),Rn=!0,k.awaitDrain&&(!pe._writableState||pe._writableState.needDrain)&&An())}function It(){w("onend"),pe.end()}k.endEmitted?W.nextTick(Xe):O.once("end",Xe),pe.on("unpipe",yt);var An=function(pe){return function(){var O=pe._readableState;w("pipeOnDrain",O.awaitDrain),O.awaitDrain&&O.awaitDrain--,0===O.awaitDrain&&$(pe,"data")&&(O.flowing=!0,be(pe))}}(O);pe.on("drain",An);var Rn=!1;function yi(Os){w("ondata");var zr=pe.write(Os);w("dest.write",zr),!1===zr&&((1===k.pipesCount&&k.pipes===pe||k.pipesCount>1&&-1!==pt(k.pipes,pe))&&!Rn&&(w("false write response, pause",k.awaitDrain),k.awaitDrain++),O.pause())}function ci(Os){w("onerror",Os),as(),pe.removeListener("error",ci),0===$(pe,"error")&&ee(pe,Os)}function Ur(){pe.removeListener("finish",Is),as()}function Is(){w("onfinish"),pe.removeListener("close",Ur),as()}function as(){w("unpipe"),O.unpipe(pe)}return O.on("data",yi),function(pe,B,O){if("function"==typeof pe.prependListener)return pe.prependListener(B,O);pe._events&&pe._events[B]?Array.isArray(pe._events[B])?pe._events[B].unshift(O):pe._events[B]=[O,pe._events[B]]:pe.on(B,O)}(pe,"error",ci),pe.once("close",Ur),pe.once("finish",Is),pe.emit("pipe",O),k.flowing||(w("pipe resume"),O.resume()),pe},te.prototype.unpipe=function(pe){var B=this._readableState,O={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return pe&&pe!==B.pipes||(pe||(pe=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,pe&&pe.emit("unpipe",this,O)),this;if(!pe){var k=B.pipes,Re=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Xe=0;Xe0,!1!==k.flowing&&this.resume()):"readable"===pe&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,w("on readable",k.length,k.reading),k.length?je(this):k.reading||W.nextTick(Be,this)),O},te.prototype.removeListener=function(pe,B){var O=b.prototype.removeListener.call(this,pe,B);return"readable"===pe&&W.nextTick(qe,this),O},te.prototype.removeAllListeners=function(pe){var B=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===pe||void 0===pe)&&W.nextTick(qe,this),B},te.prototype.resume=function(){var pe=this._readableState;return pe.flowing||(w("resume"),pe.flowing=!pe.readableListening,function(pe,B){B.resumeScheduled||(B.resumeScheduled=!0,W.nextTick(X,pe,B))}(this,pe)),pe.paused=!1,this},te.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},te.prototype.wrap=function(pe){var B=this,O=this._readableState,k=!1;for(var Re in pe.on("end",function(){if(w("wrapped end"),O.decoder&&!O.ended){var yt=O.decoder.end();yt&&yt.length&&B.push(yt)}B.push(null)}),pe.on("data",function(yt){w("wrapped data"),O.decoder&&(yt=O.decoder.write(yt)),O.objectMode&&null==yt||!(O.objectMode||yt&&yt.length)||B.push(yt)||(k=!0,pe.pause())}),pe)void 0===this[Re]&&"function"==typeof pe[Re]&&(this[Re]=function(It){return function(){return pe[It].apply(pe,arguments)}}(Re));for(var Xe=0;Xe-1))throw new ie(ce);return this._writableState.defaultEncoding=ce,this},Object.defineProperty(me.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(me.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),me.prototype._write=function(be,ce,Pe){Pe(new K("_write()"))},me.prototype._writev=null,me.prototype.end=function(be,ce,Pe){var Et=this._writableState;return"function"==typeof be?(Pe=be,be=null,ce=null):"function"==typeof ce&&(Pe=ce,ce=null),null!=be&&this.write(be,ce),Et.corked&&(Et.corked=1,this.uncork()),Et.ending||function(be,ce,Pe){ce.ending=!0,Be(be,ce),Pe&&(ce.finished?W.nextTick(Pe):be.once("finish",Pe)),ce.ended=!0,be.writable=!1}(this,Et,Pe),this},Object.defineProperty(me.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(ce){!this._writableState||(this._writableState.destroyed=ce)}}),me.prototype.destroy=w.destroy,me.prototype._undestroy=w.undestroy,me.prototype._destroy=function(be,ce){ce(be)}}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(Y,Ae,he){(function(W){(function(){"use strict";var V;function L(F,Q,E){return Q in F?Object.defineProperty(F,Q,{value:E,enumerable:!0,configurable:!0,writable:!0}):F[Q]=E,F}var re=Y("./end-of-stream"),$=Symbol("lastResolve"),b=Symbol("lastReject"),S=Symbol("error"),R=Symbol("ended"),A=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function w(F,Q){return{value:F,done:Q}}function D(F){var Q=F[$];if(null!==Q){var E=F[y].read();null!==E&&(F[A]=null,F[$]=null,F[b]=null,Q(w(E,!1)))}}function j(F){W.nextTick(D,F)}var H=Object.getPrototypeOf(function(){}),K=Object.setPrototypeOf((L(V={get stream(){return this[y]},next:function(){var Q=this,E=this[S];if(null!==E)return Promise.reject(E);if(this[R])return Promise.resolve(w(void 0,!0));if(this[y].destroyed)return new Promise(function(ee,se){W.nextTick(function(){Q[S]?se(Q[S]):ee(w(void 0,!0))})});var ie,U=this[A];if(U)ie=new Promise(function(F,Q){return function(E,U){F.then(function(){Q[R]?E(w(void 0,!0)):Q[v](E,U)},U)}}(U,this));else{var ue=this[y].read();if(null!==ue)return Promise.resolve(w(ue,!1));ie=new Promise(this[v])}return this[A]=ie,ie}},Symbol.asyncIterator,function(){return this}),L(V,"return",function(){var Q=this;return new Promise(function(E,U){Q[y].destroy(null,function(ie){ie?U(ie):E(w(void 0,!0))})})}),V),H);Ae.exports=function(Q){var E,U=Object.create(K,(L(E={},y,{value:Q,writable:!0}),L(E,$,{value:null,writable:!0}),L(E,b,{value:null,writable:!0}),L(E,S,{value:null,writable:!0}),L(E,R,{value:Q._readableState.endEmitted,writable:!0}),L(E,v,{value:function(ue,ee){var se=U[y].read();se?(U[A]=null,U[$]=null,U[b]=null,ue(w(se,!1))):(U[$]=ue,U[b]=ee)},writable:!0}),E));return U[A]=null,re(Q,function(ie){if(ie&&"ERR_STREAM_PREMATURE_CLOSE"!==ie.code){var ue=U[b];return null!==ue&&(U[A]=null,U[$]=null,U[b]=null,ue(ie)),void(U[S]=ie)}var ee=U[$];null!==ee&&(U[A]=null,U[$]=null,U[b]=null,ee(w(void 0,!0))),U[R]=!0}),Q.on("readable",j.bind(null,U)),U}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Ae,he){"use strict";function W(D,j){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(D);j&&(H=H.filter(function(K){return Object.getOwnPropertyDescriptor(D,K).enumerable})),I.push.apply(I,H)}return I}function L(D,j,I){return j in D?Object.defineProperty(D,j,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[j]=I,D}function $(D,j){for(var I=0;I0?this.tail.next=H:this.head=H,this.tail=H,++this.length}},{key:"unshift",value:function(I){var H={data:I,next:this.head};0===this.length&&(this.tail=H),this.head=H,++this.length}},{key:"shift",value:function(){if(0!==this.length){var I=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,I}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(I){if(0===this.length)return"";for(var H=this.head,K=""+H.data;H=H.next;)K+=I+H.data;return K}},{key:"concat",value:function(I){if(0===this.length)return R.alloc(0);for(var H=R.allocUnsafe(I>>>0),K=this.head,M=0;K;)w(K.data,H,M),M+=K.data.length,K=K.next;return H}},{key:"consume",value:function(I,H){var K;return IF.length?F.length:I;if(M+=Q===F.length?F:F.slice(0,I),0==(I-=Q)){Q===F.length?(++K,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=F.slice(Q));break}++K}return this.length-=K,M}},{key:"_getBuffer",value:function(I){var H=R.allocUnsafe(I),K=this.head,M=1;for(K.data.copy(H),I-=K.data.length;K=K.next;){var F=K.data,Q=I>F.length?F.length:I;if(F.copy(H,H.length-I,0,Q),0==(I-=Q)){Q===F.length?(++M,this.head=K.next?K.next:this.tail=null):(this.head=K,K.data=F.slice(Q));break}++M}return this.length-=M,H}},{key:y,value:function(I,H){return v(this,function(D){for(var j=1;j0,function(ie){K||(K=ie),ie&&M.forEach(A),!E&&(M.forEach(A),H(K))})});return j.reduce(v)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Ae,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Ae.exports={getHighWaterMark:function(re,$,b,S){var R=function(re,$,b){return null!=re.highWaterMark?re.highWaterMark:$?re[b]:null}($,S,b);if(null!=R){if(!isFinite(R)||Math.floor(R)!==R||R<0)throw new W(S?b:"highWaterMark",R);return Math.floor(R)}return re.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Ae,he){Ae.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Ae,he){(he=Ae.exports=Y("./lib/_stream_readable.js")).Stream=he,he.Readable=he,he.Writable=Y("./lib/_stream_writable.js"),he.Duplex=Y("./lib/_stream_duplex.js"),he.Transform=Y("./lib/_stream_transform.js"),he.PassThrough=Y("./lib/_stream_passthrough.js"),he.finished=Y("./lib/internal/streams/end-of-stream.js"),he.pipeline=Y("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(V){for(var L in V)he.hasOwnProperty(L)||(he[L]=V[L])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Ae,he){"use strict";function V($){const b=[];let S=0;for(;S<$.length;)switch($[S]){case"/":if("."===$[S+1])if("."===$[S+2]){if(!re($[S+3])){b.push([]),S++;break}b.pop(),$[S+3]||b.push([]),S+=3}else{if(!re($[S+2])){b.push([]),S++;break}$[S+2]||b.push([]),S+=2}else b.push([]),S++;break;case"#":case"?":b.length||b.push([]),b[b.length-1].push($.substr(S)),S=$.length;break;default:b.length||b.push([]),b[b.length-1].push($[S]),S++}return"/"+b.map(R=>R.join("")).join("/")}function L($,b){let S=b+1;b>=0?"/"===$[b+1]&&"/"===$[b+2]&&(S=b+3):"/"===$[0]&&"/"===$[1]&&(S=2);const R=$.indexOf("/",S);return R<0?$:$.substr(0,R)+V($.substr(R))}function re($){return!$||"#"===$||"?"===$||"/"===$}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function($,b){const S=(b=b||"").indexOf("#");if(S>0&&(b=b.substr(0,S)),!$.length){if(b.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);return b}if($.startsWith("?")){const j=b.indexOf("?");return j>0&&(b=b.substr(0,j)),b+$}if($.startsWith("#"))return b+$;if(!b.length){const j=$.indexOf(":");if(j<0)throw new Error(`Found invalid relative IRI '${$}' for a missing baseIRI`);return L($,j)}const R=$.indexOf(":");if(R>=0)return L($,R);const A=b.indexOf(":");if(A<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);const v=b.substr(0,A+1);if(0===$.indexOf("//"))return v+L($,R);let y;if(b.indexOf("//",A)===A+1){if(y=b.indexOf("/",A+3),y<0)return b.length>A+3?b+"/"+L($,R):v+L($,R)}else if(y=b.indexOf("/",A+1),y<0)return v+L($,R);if(0===$.indexOf("/"))return b.substr(0,y)+V($);let w=b.substr(y);const D=w.lastIndexOf("/");return D>=0&&D"===ce?(te(X,"onsgmldeclaration",X.sgmlDecl),X.sgmlDecl="",X.state=se.TEXT):(U(ce)&&(X.state=se.SGML_DECL_QUOTED),X.sgmlDecl+=ce);continue;case se.SGML_DECL_QUOTED:ce===X.q&&(X.state=se.SGML_DECL,X.q=""),X.sgmlDecl+=ce;continue;case se.DOCTYPE:">"===ce?(X.state=se.TEXT,te(X,"ondoctype",X.doctype),X.doctype=!0):(X.doctype+=ce,"["===ce?X.state=se.DOCTYPE_DTD:U(ce)&&(X.state=se.DOCTYPE_QUOTED,X.q=ce));continue;case se.DOCTYPE_QUOTED:X.doctype+=ce,ce===X.q&&(X.q="",X.state=se.DOCTYPE);continue;case se.DOCTYPE_DTD:X.doctype+=ce,"]"===ce?X.state=se.DOCTYPE:U(ce)&&(X.state=se.DOCTYPE_DTD_QUOTED,X.q=ce);continue;case se.DOCTYPE_DTD_QUOTED:X.doctype+=ce,ce===X.q&&(X.state=se.DOCTYPE_DTD,X.q="");continue;case se.COMMENT:"-"===ce?X.state=se.COMMENT_ENDING:X.comment+=ce;continue;case se.COMMENT_ENDING:"-"===ce?(X.state=se.COMMENT_ENDED,X.comment=Me(X.opt,X.comment),X.comment&&te(X,"oncomment",X.comment),X.comment=""):(X.comment+="-"+ce,X.state=se.COMMENT);continue;case se.COMMENT_ENDED:">"!==ce?(Ze(X,"Malformed comment"),X.comment+="--"+ce,X.state=se.COMMENT):X.state=se.TEXT;continue;case se.CDATA:"]"===ce?X.state=se.CDATA_ENDING:X.cdata+=ce;continue;case se.CDATA_ENDING:"]"===ce?X.state=se.CDATA_ENDING_2:(X.cdata+="]"+ce,X.state=se.CDATA);continue;case se.CDATA_ENDING_2:">"===ce?(X.cdata&&te(X,"oncdata",X.cdata),te(X,"onclosecdata"),X.cdata="",X.state=se.TEXT):"]"===ce?X.cdata+="]":(X.cdata+="]]"+ce,X.state=se.CDATA);continue;case se.PROC_INST:"?"===ce?X.state=se.PROC_INST_ENDING:E(ce)?X.state=se.PROC_INST_BODY:X.procInstName+=ce;continue;case se.PROC_INST_BODY:if(!X.procInstBody&&E(ce))continue;"?"===ce?X.state=se.PROC_INST_ENDING:X.procInstBody+=ce;continue;case se.PROC_INST_ENDING:">"===ce?(te(X,"onprocessinginstruction",{name:X.procInstName,body:X.procInstBody}),X.procInstName=X.procInstBody="",X.state=se.TEXT):(X.procInstBody+="?"+ce,X.state=se.PROC_INST_BODY);continue;case se.OPEN_TAG:ue(M,ce)?X.tagName+=ce:(Je(X),">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:(E(ce)||Ze(X,"Invalid character in tag name"),X.state=se.ATTRIB));continue;case se.OPEN_TAG_SLASH:">"===ce?(Le(X,!0),Ee(X)):(Ze(X,"Forward-slash in opening tag not followed by >"),X.state=se.ATTRIB);continue;case se.ATTRIB:if(E(ce))continue;">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(K,ce)?(X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME:"="===ce?X.state=se.ATTRIB_VALUE:">"===ce?(Ze(X,"Attribute without value"),X.attribValue=X.attribName,je(X),Le(X)):E(ce)?X.state=se.ATTRIB_NAME_SAW_WHITE:ue(M,ce)?X.attribName+=ce:Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME_SAW_WHITE:if("="===ce)X.state=se.ATTRIB_VALUE;else{if(E(ce))continue;Ze(X,"Attribute without value"),X.tag.attributes[X.attribName]="",X.attribValue="",te(X,"onattribute",{name:X.attribName,value:""}),X.attribName="",">"===ce?Le(X):ue(K,ce)?(X.attribName=ce,X.state=se.ATTRIB_NAME):(Ze(X,"Invalid attribute name"),X.state=se.ATTRIB)}continue;case se.ATTRIB_VALUE:if(E(ce))continue;U(ce)?(X.q=ce,X.state=se.ATTRIB_VALUE_QUOTED):(Ze(X,"Unquoted attribute value"),X.state=se.ATTRIB_VALUE_UNQUOTED,X.attribValue=ce);continue;case se.ATTRIB_VALUE_QUOTED:if(ce!==X.q){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_Q:X.attribValue+=ce;continue}je(X),X.q="",X.state=se.ATTRIB_VALUE_CLOSED;continue;case se.ATTRIB_VALUE_CLOSED:E(ce)?X.state=se.ATTRIB:">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(K,ce)?(Ze(X,"No whitespace between attributes"),X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_VALUE_UNQUOTED:if(!ie(ce)){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_U:X.attribValue+=ce;continue}je(X),">"===ce?Le(X):X.state=se.ATTRIB;continue;case se.CLOSE_TAG:if(X.tagName)">"===ce?Ee(X):ue(M,ce)?X.tagName+=ce:X.script?(X.script+=""===ce?Ee(X):Ze(X,"Invalid characters in closing tag");continue;case se.TEXT_ENTITY:case se.ATTRIB_VALUE_ENTITY_Q:case se.ATTRIB_VALUE_ENTITY_U:var pt,pe;switch(X.state){case se.TEXT_ENTITY:pt=se.TEXT,pe="textNode";break;case se.ATTRIB_VALUE_ENTITY_Q:pt=se.ATTRIB_VALUE_QUOTED,pe="attribValue";break;case se.ATTRIB_VALUE_ENTITY_U:pt=se.ATTRIB_VALUE_UNQUOTED,pe="attribValue"}";"===ce?(X[pe]+=Oe(X),X.entity="",X.state=pt):ue(X.entity.length?Q:F,ce)?X.entity+=ce:(Ze(X,"Invalid character in entity name"),X[pe]+="&"+X.entity+ce,X.entity="",X.state=pt);continue;default:throw new Error(X,"Unknown state: "+X.state)}return X.position>=X.bufferCheckPosition&&function(z){for(var X=Math.max(V.MAX_BUFFER_LENGTH,10),be=0,ce=0,Pe=L.length;ceX)switch(L[ce]){case"textNode":ye(z);break;case"cdata":te(z,"oncdata",z.cdata),z.cdata="";break;case"script":te(z,"onscript",z.script),z.script="";break;default:Ve(z,"Max buffer length exceeded: "+L[ce])}be=Math.max(be,Et)}z.bufferCheckPosition=V.MAX_BUFFER_LENGTH-be+z.position}(X),X},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(z){ye(z),""!==z.cdata&&(te(z,"oncdata",z.cdata),z.cdata=""),""!==z.script&&(te(z,"onscript",z.script),z.script="")}(this)}};try{R=Y("stream").Stream}catch(z){R=function(){}}var A=V.EVENTS.filter(function(z){return"error"!==z&&"end"!==z});function y(z,X){if(!(this instanceof y))return new y(z,X);R.apply(this),this._parser=new re(z,X),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ce){be.emit("error",ce),be._parser.error=null},this._decoder=null,A.forEach(function(ce){Object.defineProperty(be,"on"+ce,{get:function(){return be._parser["on"+ce]},set:function(Pe){if(!Pe)return be.removeAllListeners(ce),be._parser["on"+ce]=Pe,Pe;be.on(ce,Pe)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(R.prototype,{constructor:{value:y}})).write=function(z){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(z)){if(!this._decoder){var X=Y("string_decoder").StringDecoder;this._decoder=new X("utf8")}z=this._decoder.write(z)}return this._parser.write(z.toString()),this.emit("data",z),!0},y.prototype.end=function(z){return z&&z.length&&this.write(z),this._parser.end(),!0},y.prototype.on=function(z,X){var be=this;return!be._parser["on"+z]&&-1!==A.indexOf(z)&&(be._parser["on"+z]=function(){var ce=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ce.splice(0,0,z),be.emit.apply(be,ce)}),R.prototype.on.call(be,z,X)};var j="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",H={xml:j,xmlns:I},K=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,M=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(z){return" "===z||"\n"===z||"\r"===z||"\t"===z}function U(z){return'"'===z||"'"===z}function ie(z){return">"===z||E(z)}function ue(z,X){return z.test(X)}function ee(z,X){return!ue(z,X)}var z,X,be,se=0;for(var Te in V.STATE={BEGIN:se++,BEGIN_WHITESPACE:se++,TEXT:se++,TEXT_ENTITY:se++,OPEN_WAKA:se++,SGML_DECL:se++,SGML_DECL_QUOTED:se++,DOCTYPE:se++,DOCTYPE_QUOTED:se++,DOCTYPE_DTD:se++,DOCTYPE_DTD_QUOTED:se++,COMMENT_STARTING:se++,COMMENT:se++,COMMENT_ENDING:se++,COMMENT_ENDED:se++,CDATA:se++,CDATA_ENDING:se++,CDATA_ENDING_2:se++,PROC_INST:se++,PROC_INST_BODY:se++,PROC_INST_ENDING:se++,OPEN_TAG:se++,OPEN_TAG_SLASH:se++,ATTRIB:se++,ATTRIB_NAME:se++,ATTRIB_NAME_SAW_WHITE:se++,ATTRIB_VALUE:se++,ATTRIB_VALUE_QUOTED:se++,ATTRIB_VALUE_CLOSED:se++,ATTRIB_VALUE_UNQUOTED:se++,ATTRIB_VALUE_ENTITY_Q:se++,ATTRIB_VALUE_ENTITY_U:se++,CLOSE_TAG:se++,CLOSE_TAG_SAW_WHITE:se++,SCRIPT:se++,SCRIPT_ENDING:se++},V.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(V.ENTITIES).forEach(function(z){var X=V.ENTITIES[z],be="number"==typeof X?String.fromCharCode(X):X;V.ENTITIES[z]=be}),V.STATE)V.STATE[V.STATE[Te]]=Te;function me(z,X,be){z[X]&&z[X](be)}function te(z,X,be){z.textNode&&ye(z),me(z,X,be)}function ye(z){z.textNode=Me(z.opt,z.textNode),z.textNode&&me(z,"ontext",z.textNode),z.textNode=""}function Me(z,X){return z.trim&&(X=X.trim()),z.normalize&&(X=X.replace(/\s+/g," ")),X}function Ve(z,X){return ye(z),z.trackPosition&&(X+="\nLine: "+z.line+"\nColumn: "+z.column+"\nChar: "+z.c),X=new Error(X),z.error=X,me(z,"onerror",X),z}function nt(z){return z.sawRoot&&!z.closedRoot&&Ze(z,"Unclosed root tag"),z.state!==se.BEGIN&&z.state!==se.BEGIN_WHITESPACE&&z.state!==se.TEXT&&Ve(z,"Unexpected end"),ye(z),z.c="",z.closed=!0,me(z,"onend"),re.call(z,z.strict,z.opt),z}function Ze(z,X){if("object"!=typeof z||!(z instanceof re))throw new Error("bad call to strictFail");z.strict&&Ve(z,X)}function Je(z){z.strict||(z.tagName=z.tagName[z.looseCase]());var X=z.tags[z.tags.length-1]||z,be=z.tag={name:z.tagName,attributes:{}};z.opt.xmlns&&(be.ns=X.ns),z.attribList.length=0,te(z,"onopentagstart",be)}function Ke(z,X){var ce=z.indexOf(":")<0?["",z]:z.split(":"),Pe=ce[0],Et=ce[1];return X&&"xmlns"===z&&(Pe="xmlns",Et=""),{prefix:Pe,local:Et}}function je(z){if(z.strict||(z.attribName=z.attribName[z.looseCase]()),-1!==z.attribList.indexOf(z.attribName)||z.tag.attributes.hasOwnProperty(z.attribName))z.attribName=z.attribValue="";else{if(z.opt.xmlns){var X=Ke(z.attribName,!0),ce=X.local;if("xmlns"===X.prefix)if("xml"===ce&&z.attribValue!==j)Ze(z,"xml: prefix must be bound to "+j+"\nActual: "+z.attribValue);else if("xmlns"===ce&&z.attribValue!==I)Ze(z,"xmlns: prefix must be bound to "+I+"\nActual: "+z.attribValue);else{var Pe=z.tag,Et=z.tags[z.tags.length-1]||z;Pe.ns===Et.ns&&(Pe.ns=Object.create(Et.ns)),Pe.ns[ce]=z.attribValue}z.attribList.push([z.attribName,z.attribValue])}else z.tag.attributes[z.attribName]=z.attribValue,te(z,"onattribute",{name:z.attribName,value:z.attribValue});z.attribName=z.attribValue=""}}function Le(z,X){if(z.opt.xmlns){var be=z.tag,ce=Ke(z.tagName);be.prefix=ce.prefix,be.local=ce.local,be.uri=be.ns[ce.prefix]||"",be.prefix&&!be.uri&&(Ze(z,"Unbound namespace prefix: "+JSON.stringify(z.tagName)),be.uri=ce.prefix),be.ns&&(z.tags[z.tags.length-1]||z).ns!==be.ns&&Object.keys(be.ns).forEach(function(An){te(z,"onopennamespace",{prefix:An,uri:be.ns[An]})});for(var Et=0,pt=z.attribList.length;Et",z.tagName="",void(z.state=se.SCRIPT);te(z,"onscript",z.script),z.script=""}var X=z.tags.length,be=z.tagName;z.strict||(be=be[z.looseCase]());for(var ce=be;X--&&z.tags[X].name!==ce;)Ze(z,"Unexpected close tag");if(X<0)return Ze(z,"Unmatched closing tag: "+z.tagName),z.textNode+="",void(z.state=se.TEXT);z.tagName=be;for(var Et=z.tags.length;Et-- >X;){var pt=z.tag=z.tags.pop();z.tagName=z.tag.name,te(z,"onclosetag",z.tagName);var pe={};for(var B in pt.ns)pe[B]=pt.ns[B];z.opt.xmlns&&pt.ns!==(z.tags[z.tags.length-1]||z).ns&&Object.keys(pt.ns).forEach(function(k){te(z,"onclosenamespace",{prefix:k,uri:pt.ns[k]})})}0===X&&(z.closedRoot=!0),z.tagName=z.attribValue=z.attribName="",z.attribList.length=0,z.state=se.TEXT}function Oe(z){var ce,X=z.entity,be=X.toLowerCase(),Pe="";return z.ENTITIES[X]?z.ENTITIES[X]:z.ENTITIES[be]?z.ENTITIES[be]:("#"===(X=be).charAt(0)&&("x"===X.charAt(1)?(X=X.slice(2),Pe=(ce=parseInt(X,16)).toString(16)):(X=X.slice(1),Pe=(ce=parseInt(X,10)).toString(10))),X=X.replace(/^0+/,""),isNaN(ce)||Pe.toLowerCase()!==X?(Ze(z,"Invalid character entity"),"&"+z.entity+";"):String.fromCodePoint(ce))}function Ue(z,X){"<"===X?(z.state=se.OPEN_WAKA,z.startTagPosition=z.position):E(X)||(Ze(z,"Non-whitespace before first tag."),z.textNode=X,z.state=se.TEXT)}function qe(z,X){var be="";return X1114111||X(k)!==k)throw RangeError("Invalid code point: "+k);k<=65535?Pe.push(k):Pe.push(55296+((k-=65536)>>10),k%1024+56320),(pe+1===B||Pe.length>ce)&&(O+=z.apply(null,Pe),Pe.length=0)}return O},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Ae,he){(function(W,V){(function(){!function(L,re){"use strict";if(!L.setImmediate){var A,$=1,b={},S=!1,R=L.document,Q=Object.getPrototypeOf&&Object.getPrototypeOf(L);Q=Q&&Q.setTimeout?Q:L,"[object process]"==={}.toString.call(L.process)?A=function(E){W.nextTick(function(){D(E)})}:function(){if(L.postMessage&&!L.importScripts){var E=!0,U=L.onmessage;return L.onmessage=function(){E=!1},L.postMessage("","*"),L.onmessage=U,E}}()?(E="setImmediate$"+Math.random()+"$",U=function(ie){ie.source===L&&"string"==typeof ie.data&&0===ie.data.indexOf(E)&&D(+ie.data.slice(E.length))},L.addEventListener?L.addEventListener("message",U,!1):L.attachEvent("onmessage",U),A=function(ie){L.postMessage(E+ie,"*")}):L.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function(U){D(U.data)},A=function(U){E.port2.postMessage(U)}}():R&&"onreadystatechange"in R.createElement("script")?function(){var E=R.documentElement;A=function(U){var ie=R.createElement("script");ie.onreadystatechange=function(){D(U),ie.onreadystatechange=null,E.removeChild(ie),ie=null},E.appendChild(ie)}}():A=function(E){setTimeout(D,0,E)},Q.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var U=new Array(arguments.length-1),ie=0;ie=0&&(A._idleTimeoutId=setTimeout(function(){A._onTimeout&&A._onTimeout()},v))},he.setImmediate="function"==typeof W?W:function(A){var v=S++,y=!(arguments.length<2)&&$.call(arguments,1);return b[v]=!0,L(function(){b[v]&&(y?A.apply(null,y):A.call(null),he.clearImmediate(v))}),v},he.clearImmediate="function"==typeof V?V:function(A){delete b[A]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Ae,he){(function(W){(function(){function L(re){try{if(!W.localStorage)return!1}catch(b){return!1}var $=W.localStorage[re];return null!=$&&"true"===String($).toLowerCase()}Ae.exports=function(re,$){if(L("noDeprecation"))return re;var b=!1;return function(){if(!b){if(L("throwDeprecation"))throw new Error($);L("traceDeprecation")?console.trace($):console.warn($),b=!0}return re.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Ae,he){"use strict";Ae.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let V=this.head;V;V=V.next)yield V.value}}},{}],92:[function(Y,Ae,he){"use strict";function W(b){var S=this;if(S instanceof W||(S=new W),S.tail=null,S.head=null,S.length=0,b&&"function"==typeof b.forEach)b.forEach(function(v){S.push(v)});else if(arguments.length>0)for(var R=0,A=arguments.length;R1)R=S;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,R=this.head.value}for(var v=0;null!==A;v++)R=b(R,A.value,v),A=A.next;return R},W.prototype.reduceReverse=function(b,S){var R,A=this.tail;if(arguments.length>1)R=S;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,R=this.tail.value}for(var v=this.length-1;null!==A;v--)R=b(R,A.value,v),A=A.prev;return R},W.prototype.toArray=function(){for(var b=new Array(this.length),S=0,R=this.head;null!==R;S++)b[S]=R.value,R=R.next;return b},W.prototype.toArrayReverse=function(){for(var b=new Array(this.length),S=0,R=this.tail;null!==R;S++)b[S]=R.value,R=R.prev;return b},W.prototype.slice=function(b,S){(S=S||this.length)<0&&(S+=this.length),(b=b||0)<0&&(b+=this.length);var R=new W;if(Sthis.length&&(S=this.length);for(var A=0,v=this.head;null!==v&&Athis.length&&(S=this.length);for(var A=this.length,v=this.tail;null!==v&&A>S;A--)v=v.prev;for(;null!==v&&A>b;A--,v=v.prev)R.push(v.value);return R},W.prototype.splice=function(b,S,...R){b>this.length&&(b=this.length-1),b<0&&(b=this.length+b);for(var A=0,v=this.head;null!==v&&A{jt.exports=function(tt,gt){var J=gt.length;if(0!==J){var xt=tt.length;tt.length+=J;for(var ut=0;ut{"use strict";var gt=(()=>{return(xt=gt||(gt={})).typeOfFunction="function",xt.boolTrue=!0,gt;var xt})();function J(xt,ut,Y){if(!Y||typeof Y.value!==gt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+ut+"> is not a method!");return{configurable:gt.boolTrue,get:function(){var Ae=Y.value.bind(this);return Object.defineProperty(this,ut,{value:Ae,configurable:gt.boolTrue,writable:gt.boolTrue}),Ae}}}it.ak=J,it.ZP=J},266:(jt,it,tt)=>{jt.exports={ResizeSensor:tt(835),ElementQueries:tt(845)}},845:function(jt,it,tt){"use strict";var gt,J,xt;"undefined"!=typeof window&&window,J=[tt(835)],void 0!==(xt="function"==typeof(gt=function(ut){var Y=function(){var he,W={},V=[];function L(M){M||(M=document.documentElement);var F=window.getComputedStyle(M,null).fontSize;return parseFloat(F)||16}function $(M,F){var Q=F.split(/\d/),E=Q[Q.length-1];switch(F=parseFloat(F),E){case"px":return F;case"em":return F*L(M);case"rem":return F*L();case"vw":return F*document.documentElement.clientWidth/100;case"vh":return F*document.documentElement.clientHeight/100;case"vmin":case"vmax":var U=document.documentElement.clientWidth/100,ie=document.documentElement.clientHeight/100;return F*(0,Math["vmin"===E?"min":"max"])(U,ie);default:return F}}function b(M,F){this.element=M;var Q,E,U,ie,ue,ee,se,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(Q in U=function(M){if(!M.getBoundingClientRect)return{width:M.offsetWidth,height:M.offsetHeight};var F=M.getBoundingClientRect();return{width:Math.round(F.width),height:Math.round(F.height)}}(this.element),ee={},W[F])!W[F].hasOwnProperty(Q)||(ie=$(this.element,(E=W[F][Q]).value),ue="width"===E.property?U.width:U.height,se="","min"===E.mode&&ue>=ie&&(se+=E.value),"max"===E.mode&&ue<=ie&&(se+=E.value),ee[Te=E.mode+"-"+E.property]||(ee[Te]=""),se&&-1===(" "+ee[Te]+" ").indexOf(" "+se+" ")&&(ee[Te]+=" "+se));for(var te in me)!me.hasOwnProperty(te)||(ee[me[te]]?this.element.setAttribute(me[te],ee[me[te]].substr(1)):this.element.removeAttribute(me[te]))}}function S(M,F){M.elementQueriesSetupInformation||(M.elementQueriesSetupInformation=new b(M,F)),M.elementQueriesSensor||(M.elementQueriesSensor=new ut(M,function(){M.elementQueriesSetupInformation.call()}))}function R(M,F,Q,E){if(void 0===W[M]){W[M]=[];var U=V.length;he.innerHTML+="\n"+M+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+M+" > .resize-sensor {min-width: "+U+"px;}",V.push(M)}W[M].push({mode:F,property:Q,value:E})}function A(M){var F;if(document.querySelectorAll&&(F=M?M.querySelectorAll.bind(M):document.querySelectorAll.bind(document)),!F&&"undefined"!=typeof $$&&(F=$$),!F&&"undefined"!=typeof jQuery&&(F=jQuery),!F)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return F}function y(M){var F=[],Q=[],E=[],U=0,ie=-1,ue=[];for(var ee in M.children)if(M.children.hasOwnProperty(ee)&&M.children[ee].tagName&&"img"===M.children[ee].tagName.toLowerCase()){F.push(M.children[ee]);var se=M.children[ee].getAttribute("min-width")||M.children[ee].getAttribute("data-min-width"),Te=M.children[ee].getAttribute("data-src")||M.children[ee].getAttribute("url");E.push(Te),Q.push({minWidth:se}),se?M.children[ee].style.display="none":(U=F.length-1,M.children[ee].style.display="block")}function te(){var Me,ye=!1;for(Me in F)!F.hasOwnProperty(Me)||Q[Me].minWidth&&M.offsetWidth>Q[Me].minWidth&&(ye=Me);if(ye||(ye=U),ie!==ye)if(ue[ye])F[ie].style.display="none",F[ye].style.display="block",ie=ye;else{var Ve=new Image;Ve.onload=function(){F[ye].src=E[ye],F[ie].style.display="none",F[ye].style.display="block",ue[ye]=!0,ie=ye},Ve.src=E[ye]}else F[ye].src=E[ye]}ie=U,M.resizeSensorInstance=new ut(M,te),te()}var D=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,j=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function I(M){var F,Q,E,U;for(M=M.replace(/'/g,'"');null!==(F=D.exec(M));)for(Q=F[1]+F[3],E=F[2];null!==(U=j.exec(E));)R(Q,U[1],U[2],U[3])}function H(M){var F="";if(M)if("string"==typeof M)(-1!==(M=M.toLowerCase()).indexOf("min-width")||-1!==M.indexOf("max-width"))&&I(M);else for(var Q=0,E=M.length;Q img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",he.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(he),K=!0);for(var F=0,Q=document.styleSheets.length;F{var gt=tt(910),J=tt(369),xt=tt(322);function ut(re,$,b){if(!gt(re))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!re.hasNode($))throw new Error('graphology-shortest-path: the "'+$+'" source node does not exist in the given graph.');if(!re.hasNode(b))throw new Error('graphology-shortest-path: the "'+b+'" target node does not exist in the given graph.');if(($=""+$)==(b=""+b))return[$];var S=re.inboundNeighbors.bind(re),R=re.outboundNeighbors.bind(re),A={},v={};A[$]=null,v[b]=null;var D,j,I,H,K,M,F,Q,y=[$],w=[b],E=!1;e:for(;y.length&&w.length;)if(y.length<=w.length){for(D=y,y=[],K=0,F=D.length;K{jt.exports=function(tt){return null!==tt&&"object"==typeof tt&&"function"==typeof tt.addUndirectedEdgeWithKey&&"function"==typeof tt.dropNode&&"boolean"==typeof tt.multi}},698:function(jt){jt.exports=function(){"use strict";function it(ne){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(de){return typeof de}:function(de){return de&&"function"==typeof Symbol&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de})(ne)}function tt(ne,de){ne.prototype=Object.create(de.prototype),ne.prototype.constructor=ne,J(ne,de)}function gt(ne){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)})(ne)}function J(ne,de){return(J=Object.setPrototypeOf||function(oe,C){return oe.__proto__=C,oe})(ne,de)}function xt(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(ne){return!1}}function ut(ne,de,oe){return(ut=xt()?Reflect.construct:function(C,P,Z){var we=[null];we.push.apply(we,P);var Fe=new(Function.bind.apply(C,we));return Z&&J(Fe,Z.prototype),Fe}).apply(null,arguments)}function Y(ne){var de="function"==typeof Map?new Map:void 0;return(Y=function(oe){if(null===oe||-1===Function.toString.call(oe).indexOf("[native code]"))return oe;if("function"!=typeof oe)throw new TypeError("Super expression must either be null or a function");if(void 0!==de){if(de.has(oe))return de.get(oe);de.set(oe,P)}function P(){return ut(oe,arguments,gt(this).constructor)}return P.prototype=Object.create(oe.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),J(P,oe)})(ne)}function Ae(ne){if(void 0===ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ne}var he=function(){for(var ne=arguments[0],de=1,oe=arguments.length;de0&&we.length>P&&!we.warned){we.warned=!0;var et=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(de)+" listeners added. Use emitter.setMaxListeners() to increase limit");et.name="MaxListenersExceededWarning",et.emitter=ne,et.type=de,et.count=we.length,console&&console.warn&&console.warn(et)}return ne}function M(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F(ne,de,oe){var C={fired:!1,wrapFn:void 0,target:ne,type:de,listener:oe},P=M.bind(C);return P.listener=oe,C.wrapFn=P,P}function Q(ne,de,oe){var C=ne._events;if(void 0===C)return[];var P=C[de];return void 0===P?[]:"function"==typeof P?oe?[P.listener||P]:[P]:oe?function(Z){for(var we=new Array(Z.length),Fe=0;Fe0&&(Z=de[0]),Z instanceof Error)throw Z;var we=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw we.context=Z,we}var Fe=P[ne];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,de);else{var et=Fe.length,Dt=U(Fe,et);for(oe=0;oe=0;Z--)if(oe[Z]===de||oe[Z].listener===de){we=oe[Z].listener,P=Z;break}if(P<0)return this;0===P?oe.shift():function(Fe,et){for(;et+1=0;C--)this.removeListener(ne,de[C]);return this},D.prototype.listeners=function(ne){return Q(this,ne,!0)},D.prototype.rawListeners=function(ne){return Q(this,ne,!1)},D.listenerCount=function(ne,de){return"function"==typeof ne.listenerCount?ne.listenerCount(de):E.call(ne,de)},D.prototype.listenerCount=E,D.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]},ue.prototype.next=function(){if(this.done)return{done:!0};var ne=this._next();return ne.done&&(this.done=!0),ne},"undefined"!=typeof Symbol&&(ue.prototype[Symbol.iterator]=function(){return this}),ue.of=function(){var ne=arguments,de=ne.length,oe=0;return new ue(function(){return oe>=de?{done:!0}:{done:!1,value:ne[oe++]}})},ue.empty=function(){var ne=new ue(null);return ne.done=!0,ne},ue.is=function(ne){return ne instanceof ue||"object"==typeof ne&&null!==ne&&"function"==typeof ne.next};var ee=ue,se=function(ne,de){for(var oe,C=arguments.length>1?de:1/0,P=C!==1/0?new Array(C):[],Z=0;;){if(Z===C)return P;if((oe=ne.next()).done)return Z!==de?P.slice(0,Z):P;P[Z++]=oe.value}},Te=function(ne){function de(oe,C){var P;return(P=ne.call(this)||this).name="GraphError",P.message=oe||"",P.data=C||{},P}return tt(de,ne),de}(Y(Error)),me=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),te=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),ye=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te);function Me(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ve(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function nt(ne,de){this.key=ne,this.attributes=de,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Ze(ne,de,oe,C,P,Z){this.key=de,this.attributes=Z,this.undirected=ne,this.source=C,this.target=P,this.generatedKey=oe}function Je(ne,de,oe,C,P,Z,we){var Fe,et,Dt="out",$e="in";if(de&&(Dt=$e="undirected"),ne.multi){if(void 0===(et=(Fe=Z[Dt])[P])&&(et=new Set,Fe[P]=et),et.add(oe),C===P&&de)return;void 0===(Fe=we[$e])[C]&&(Fe[C]=et)}else{if(Z[Dt][P]=oe,C===P&&de)return;we[$e][C]=oe}}function Ke(ne,de,oe){var C=ne.multi,P=oe.source,Z=oe.target,we=P.key,Fe=Z.key,et=P[de?"undirected":"out"],Dt=de?"undirected":"in";if(Fe in et)if(C){var $e=et[Fe];1===$e.size?(delete et[Fe],delete Z[Dt][we]):$e.delete(oe)}else delete et[Fe];C||delete Z[Dt][we]}Ve.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},nt.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var je=[{name:function(ne){return"get".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes[P]}}},{name:function(ne){return"get".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C){var P;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Z=""+C,we=""+arguments[1];if(!(P=W(this,Z,we,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Z,'" - "').concat(we,'").'))}else if(!(P=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&P.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return P.attributes}}},{name:function(ne){return"has".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes.hasOwnProperty(P)}}},{name:function(ne){return"set".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=W(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"update".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=W(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("function"!=typeof Z)throw new me("Graph.".concat(de,": updater should be a function."));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z(we.attributes[P]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"remove".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return delete Z.attributes[P],this.emit("edgeAttributesUpdated",{key:Z.key,type:"remove",attributes:Z.attributes,name:P}),this}}},{name:function(ne){return"replace".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes=P,this.emit("edgeAttributesUpdated",{key:Z.key,type:"replace",attributes:Z.attributes}),this}}},{name:function(ne){return"merge".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return he(Z.attributes,P),this.emit("edgeAttributesUpdated",{key:Z.key,type:"merge",attributes:Z.attributes,data:P}),this}}}],Le=ee,Ee=function(){var ne,de=arguments,oe=-1;return new Le(function C(){if(!ne){if(++oe>=de.length)return{done:!0};ne=de[oe]}var P=ne.next();return P.done?(ne=null,C()):P})},Oe=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Ue(ne,de){for(var oe in de)ne.push(de[oe].key)}function qe(ne,de){for(var oe in de)de[oe].forEach(function(C){return ne.push(C.key)})}function Be(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)}}function z(ne,de,oe){for(var C in ne)C!==oe&&ne[C].forEach(function(P){return de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function X(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];if(de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey))return!0}return!1}function be(ne,de,oe){var C,P,Z,we,Fe;for(var et in ne)if(et!==oe)for(C=ne[et].values();!0!==(P=C.next()).done;)if(we=(Z=P.value).source,de(Z.key,Z.attributes,we.key,(Fe=Z.target).key,we.attributes,Fe.attributes,Z.undirected,Z.generatedKey))return!0;return!1}function ce(ne,de){var oe=Object.keys(ne),C=oe.length,P=null,Z=0;return new ee(function we(){var Fe;if(P){var et=P.next();if(et.done)return P=null,Z++,we();Fe=et.value}else{if(Z>=C)return{done:!0};var Dt=oe[Z];if(Dt===de)return Z++,we();if((Fe=ne[Dt])instanceof Set)return P=Fe.values(),we();Z++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function Pe(ne,de,oe){var C=de[oe];C&&ne.push(C.key)}function Et(ne,de,oe){var C=de[oe];C&&C.forEach(function(P){return ne.push(P.key)})}function pt(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function pe(ne,de,oe){var C=ne[de];C&&C.forEach(function(P){return oe(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function B(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;return oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function O(ne,de,oe){var C=ne[de];if(C){for(var P,Z,we=C.values();!0!==(P=we.next()).done;)if(oe((Z=P.value).key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes,Z.undirected,Z.generatedKey))return!0;return!1}}function k(ne,de){var oe=ne[de];if(oe instanceof Set){var C=oe.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{done:!1,value:[Z.key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes]}})}return ee.of([oe.key,oe.attributes,oe.source.key,oe.target.key,oe.source.attributes,oe.target.attributes])}function Re(ne,de){if(0===ne.size)return[];if("mixed"===de||de===ne.type)return"function"==typeof Array.from?Array.from(ne._edges.keys()):se(ne._edges.keys(),ne._edges.size);for(var oe,C,Z=new Array("undirected"===de?ne.undirectedSize:ne.directedSize),we="undirected"===de,Fe=ne._edges.values(),et=0;!0!==(oe=Fe.next()).done;)(C=oe.value).undirected===we&&(Z[et++]=C.key);return Z}function Xe(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var Gt=P.source,bt=P.target;oe(P.key,P.attributes,Gt.key,bt.key,Gt.attributes,bt.attributes,P.undirected,P.generatedKey)}}function yt(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var Gt=P.source,bt=P.target;if(oe(P.key,P.attributes,Gt.key,bt.key,Gt.attributes,bt.attributes,P.undirected,P.generatedKey))break}}function It(ne,de){if(0===ne.size)return ee.empty();var oe="mixed"!==de&&de!==ne.type,C="undirected"===de,P=ne._edges.values();return new ee(function(){for(var Z,we;;){if((Z=P.next()).done)return Z;if(we=Z.value,!oe||we.undirected===C)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function An(ne,de,oe,C){var P=[],Z=ne?qe:Ue;return"undirected"!==de&&("out"!==oe&&Z(P,C.in),"in"!==oe&&Z(P,C.out),!oe&&C.directedSelfLoops>0&&P.splice(P.lastIndexOf(C.key),1)),"directed"!==de&&Z(P,C.undirected),P}function Rn(ne,de,oe,C,P){var Z=ne?z:Be;"undirected"!==de&&("out"!==oe&&Z(C.in,P),"in"!==oe&&Z(C.out,P,oe?null:C.key)),"directed"!==de&&Z(C.undirected,P)}function Hn(ne,de,oe,C,P){var Z=ne?be:X;"undirected"!==de&&("out"!==oe&&Z(C.in,P)||"in"!==oe&&Z(C.out,P,oe?null:C.key))||"directed"===de||Z(C.undirected,P)}function yi(ne,de,oe){var C=ee.empty();return"undirected"!==ne&&("out"!==de&&void 0!==oe.in&&(C=Ee(C,ce(oe.in))),"in"!==de&&void 0!==oe.out&&(C=Ee(C,ce(oe.out,de?null:oe.key)))),"directed"!==ne&&void 0!==oe.undirected&&(C=Ee(C,ce(oe.undirected))),C}function ci(ne,de,oe,C,P){var Z=de?Et:Pe,we=[];return"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&Z(we,C.in,P),void 0!==C.out&&"in"!==oe&&Z(we,C.out,P),!oe&&C.directedSelfLoops>0&&we.splice(we.lastIndexOf(C.key),1)),"directed"!==ne&&void 0!==C.undirected&&Z(we,C.undirected,P),we}function Ur(ne,de,oe,C,P,Z){var we=de?pe:pt;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z),C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z)),"directed"!==ne&&void 0!==C.undirected&&we(C.undirected,P,Z)}function Is(ne,de,oe,C,P,Z){var we=de?O:B;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z)||C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z,oe?null:C.key))||"directed"===ne||void 0===C.undirected||we(C.undirected,P,Z)}function as(ne,de,oe,C){var P=ee.empty();return"undirected"!==ne&&(void 0!==oe.in&&"out"!==de&&C in oe.in&&(P=Ee(P,k(oe.in,C))),void 0!==oe.out&&"in"!==de&&C in oe.out&&(P=Ee(P,k(oe.out,C)))),"directed"!==ne&&void 0!==oe.undirected&&C in oe.undirected&&(P=Ee(P,k(oe.undirected,C))),P}var Os=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function zr(ne,de){if(void 0!==de)for(var oe in de)ne.add(oe)}function Va(ne,de,oe){if("mixed"!==ne){if("undirected"===ne)return Object.keys(oe.undirected);if("string"==typeof de)return Object.keys(oe[de])}var C=new Set;return"undirected"!==ne&&("out"!==de&&zr(C,oe.in),"in"!==de&&zr(C,oe.out)),"directed"!==ne&&zr(C,oe.undirected),se(C.values(),C.size)}function wl(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;oe(Fe.key,Fe.attributes)}}function la(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;ne.has(et.key)||(ne.add(et.key),C(et.key,et.attributes))}}function ps(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;if(oe(Fe.key,Fe.attributes))return!0}return!1}function Zt(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;if(!ne.has(et.key)&&(ne.add(et.key),C(et.key,et.attributes)))return!0}return!1}function Ua(ne,de){var oe=Object.keys(de),C=oe.length,P=0;return new ee(function(){if(P>=C)return{done:!0};var Z=de[oe[P++]];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===ne?Z.target:we;return{done:!1,value:[et.key,et.attributes]}})}function rt(ne,de,oe){var C=Object.keys(oe),P=C.length,Z=0;return new ee(function we(){if(Z>=P)return{done:!0};var Fe=oe[C[Z++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var et=Fe.source,$e=et===de?Fe.target:et;return ne.has($e.key)?we():(ne.add($e.key),{done:!1,value:[$e.key,$e.attributes]})})}function ot(ne,de,oe,C,P){var Z=ne._nodes.get(C);if("undirected"!==de){if("out"!==oe&&void 0!==Z.in)for(var we in Z.in)if(we===P)return!0;if("in"!==oe&&void 0!==Z.out)for(var Fe in Z.out)if(Fe===P)return!0}if("directed"!==de&&void 0!==Z.undirected)for(var et in Z.undirected)if(et===P)return!0;return!1}function ke(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,$e=de._nodes.values(),Gt=de.type;!0!==(C=$e.next()).done;){if(P=C.value,"undirected"!==Gt)for(Z in we=P.out)if(et=(Fe=we[Z]).target,Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return;if("directed"!==Gt)for(Z in we=P.undirected)if((et=(Fe=we[Z]).target).key!==Z&&(et=Fe.source),Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return}}function lt(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,$e,Gt,bt=de._nodes.values(),gn=de.type;!0!==(C=bt.next()).done;){if(P=C.value,"undirected"!==gn)for(Z in et=P.out)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if($e=(Dt=Fe.value).target,Gt=oe(P.key,$e.key,P.attributes,$e.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&Gt)return;if("directed"!==gn)for(Z in et=P.undirected)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if(($e=(Dt=Fe.value).target).key!==Z&&($e=Dt.source),Gt=oe(P.key,$e.key,P.attributes,$e.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&Gt)return}}function Qe(ne,de){var oe={key:ne};return re(de.attributes)||(oe.attributes=he({},de.attributes)),oe}function vt(ne,de){var oe={source:de.source.key,target:de.target.key};return de.generatedKey||(oe.key=ne),re(de.attributes)||(oe.attributes=he({},de.attributes)),de.undirected&&(oe.undirected=!0),oe}function St(ne){return L(ne)?"key"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?null:"invalid-attributes":"no-key":"not-object"}function At(ne){return L(ne)?"source"in ne?"target"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?"undirected"in ne&&"boolean"!=typeof ne.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var qt=new Set(["directed","undirected","mixed"]),Bn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ti={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Mn(ne,de,oe){var C=new ne.NodeDataClass(de,oe);return ne._nodes.set(de,C),ne.emit("nodeAdded",{key:de,attributes:oe}),C}function pn(ne,de,oe,C,P,Z,we,Fe){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(Z=""+Z,we=""+we,Fe=Fe||{},!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var et=ne._nodes.get(Z),Dt=ne._nodes.get(we);if(!et)throw new te("Graph.".concat(de,': source node "').concat(Z,'" not found.'));if(!Dt)throw new te("Graph.".concat(de,': target node "').concat(we,'" not found.'));var $e={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator($e)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));if(!ne.multi&&(C?void 0!==et.undirected[we]:void 0!==et.out[we]))throw new ye("Graph.".concat(de,': an edge linking "').concat(Z,'" to "').concat(we,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var Gt=new Ze(C,P,oe,et,Dt,Fe);return ne._edges.set(P,Gt),Z===we?C?(et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(et.undirectedDegree++,Dt.undirectedDegree++):(et.outDegree++,Dt.inDegree++),Je(ne,C,Gt,Z,we,et,Dt),C?ne._undirectedSize++:ne._directedSize++,$e.key=P,ne.emit("edgeAdded",$e),P}function Un(ne,de,oe,C,P,Z,we,Fe,et){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(et){if("function"!=typeof Fe)throw new me("Graph.".concat(de,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Dt;if(Z=""+Z,we=""+we,et&&(Dt=Fe,Fe=void 0),!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var $e,Gt,bt=ne._nodes.get(Z),gn=ne._nodes.get(we);if(!oe&&($e=ne._edges.get(P))){if($e.source.key!==Z||$e.target.key!==we||C&&($e.source.key!==we||$e.target.key!==Z))throw new ye("Graph.".concat(de,': inconsistency detected when attempting to merge the "').concat(P,'" edge with "').concat(Z,'" source & "').concat(we,'" target vs. ("').concat($e.source.key,'", "').concat($e.target.key,'").'));Gt=$e}if(Gt||ne.multi||!bt||(Gt=C?bt.undirected[we]:bt.out[we]),Gt)return(et?Dt:Fe)?(et?(Gt.attributes=Dt(Gt.attributes),ne.emit("edgeAttributesUpdated",{type:"replace",key:Gt.key,attributes:Gt.attributes})):(he(Gt.attributes,Fe),ne.emit("edgeAttributesUpdated",{type:"merge",key:Gt.key,attributes:Gt.attributes,data:Fe})),Gt.key):Gt.key;Fe=Fe||{},et&&Dt&&(Fe=Dt(Fe));var Gr={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(Gr)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));return bt||(bt=Mn(ne,Z,{}),Z===we&&(gn=bt)),gn||(gn=Mn(ne,we,{})),$e=new Ze(C,P,oe,bt,gn,Fe),ne._edges.set(P,$e),Z===we?C?(bt.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(bt.directedSelfLoops++,ne._directedSelfLoopCount++):C?(bt.undirectedDegree++,gn.undirectedDegree++):(bt.outDegree++,gn.inDegree++),Je(ne,C,$e,Z,we,bt,gn),C?ne._undirectedSize++:ne._directedSize++,Gr.key=P,ne.emit("edgeAdded",Gr),P}var ne,En=function(ne){function de(C){var P;if(P=ne.call(this)||this,(C=he({},ti,C)).edgeKeyGenerator&&"function"!=typeof C.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(C.edgeKeyGenerator,'".'));if("boolean"!=typeof C.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(C.multi,'".'));if(!qt.has(C.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(C.type,'".'));if("boolean"!=typeof C.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(C.allowSelfLoops,'".'));var Z,we="mixed"===C.type?Me:"directed"===C.type?Ve:nt;return $(Ae(P),"NodeDataClass",we),$(Ae(P),"_attributes",{}),$(Ae(P),"_nodes",new Map),$(Ae(P),"_edges",new Map),$(Ae(P),"_directedSize",0),$(Ae(P),"_undirectedSize",0),$(Ae(P),"_directedSelfLoopCount",0),$(Ae(P),"_undirectedSelfLoopCount",0),$(Ae(P),"_edgeKeyGenerator",C.edgeKeyGenerator||(Z=0,function(){return Z++})),$(Ae(P),"_options",C),Bn.forEach(function(Fe){return $(Ae(P),Fe,P[Fe])}),b(Ae(P),"order",function(){return P._nodes.size}),b(Ae(P),"size",function(){return P._edges.size}),b(Ae(P),"directedSize",function(){return P._directedSize}),b(Ae(P),"undirectedSize",function(){return P._undirectedSize}),b(Ae(P),"selfLoopCount",function(){return P._directedSelfLoopCount+P._undirectedSelfLoopCount}),b(Ae(P),"directedSelfLoopCount",function(){return P._directedSelfLoopCount}),b(Ae(P),"undirectedSelfLoopCount",function(){return P._undirectedSelfLoopCount}),b(Ae(P),"multi",P._options.multi),b(Ae(P),"type",P._options.type),b(Ae(P),"allowSelfLoops",P._options.allowSelfLoops),b(Ae(P),"implementation",function(){return"graphology"}),P}tt(de,ne);var oe=de.prototype;return oe.hasNode=function(C){return this._nodes.has(""+C)},oe.hasDirectedEdge=function(C,P){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&!we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.out[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasUndirectedEdge=function(C,P){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.undirected[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasEdge=function(C,P){if(1===arguments.length)return this._edges.has(""+C);if(2===arguments.length){P=""+P;var we=this._nodes.get(C=""+C);if(!we)return!1;var Fe=void 0!==we.out&&we.out[P];return Fe||(Fe=void 0!==we.undirected&&we.undirected[P]),!(!Fe||this.multi&&!Fe.size)}throw new me("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.directedEdge=function(C,P){if("undirected"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.directedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.directedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||void 0;return we?we.key:void 0}},oe.undirectedEdge=function(C,P){if("directed"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.undirectedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.undirectedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.undirected&&Z.undirected[P]||void 0;return we?we.key:void 0}},oe.edge=function(C,P){if(this.multi)throw new ye("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");P=""+P;var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.edge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.edge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||Z.undirected&&Z.undirected[P]||void 0;if(we)return we.key},oe.inDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.inDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.inDegree+(P?Z.directedSelfLoops:0)},oe.outDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.outDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.outDegree+(P?Z.directedSelfLoops:0)},oe.directedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.directedDegree: could not find the "'.concat(C,'" node in the graph.'));if("undirected"===this.type)return 0;var we=P?Z.directedSelfLoops:0;return Z.inDegree+we+(Z.outDegree+we)},oe.undirectedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.undirectedDegree: could not find the "'.concat(C,'" node in the graph.'));return"directed"===this.type?0:Z.undirectedDegree+2*(P?Z.undirectedSelfLoops:0)},oe.degree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.degree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.degree: could not find the "'.concat(C,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(P&&(Fe=Z.undirectedSelfLoops),we+=Z.undirectedDegree+2*Fe),"undirected"!==this.type&&(P&&(Fe=Z.directedSelfLoops),we+=Z.inDegree+Z.outDegree+2*Fe),we},oe.source=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.source: could not find the "'.concat(C,'" edge in the graph.'));return P.source.key},oe.target=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.target: could not find the "'.concat(C,'" edge in the graph.'));return P.target.key},oe.extremities=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.extremities: could not find the "'.concat(C,'" edge in the graph.'));return[P.source.key,P.target.key]},oe.opposite=function(C,P){C=""+C;var Z=this._edges.get(P=""+P);if(!Z)throw new te('Graph.opposite: could not find the "'.concat(P,'" edge in the graph.'));var we=Z.source.key,Fe=Z.target.key;if(C!==we&&C!==Fe)throw new te('Graph.opposite: the "'.concat(C,'" node is not attached to the "').concat(P,'" edge (').concat(we,", ").concat(Fe,")."));return C===we?Fe:we},oe.hasExtremity=function(C,P){P=""+P;var Z=this._edges.get(C=""+C);if(!Z)throw new te('Graph.hasExtremity: could not find the "'.concat(C,'" edge in the graph.'));return Z.source.key===P||Z.target.key===P},oe.isUndirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isUndirected: could not find the "'.concat(C,'" edge in the graph.'));return P.undirected},oe.isDirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isDirected: could not find the "'.concat(C,'" edge in the graph.'));return!P.undirected},oe.isSelfLoop=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isSelfLoop: could not find the "'.concat(C,'" edge in the graph.'));return P.source===P.target},oe.hasGeneratedKey=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.hasGeneratedKey: could not find the "'.concat(C,'" edge in the graph.'));return P.generatedKey},oe.addNode=function(C,P){return function(Z,we,Fe){if(Fe&&!L(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},Z._nodes.has(we=""+we))throw new ye('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var et=new Z.NodeDataClass(we,Fe);return Z._nodes.set(we,et),Z.emit("nodeAdded",{key:we,attributes:Fe}),et}(this,C,P).key},oe.mergeNode=function(C,P){if(P&&!L(P))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(P,'"'));P=P||{};var Z=this._nodes.get(C=""+C);return Z?(P&&(he(Z.attributes,P),this.emit("nodeAttributesUpdated",{type:"merge",key:C,attributes:Z.attributes,data:P})),C):(Z=new this.NodeDataClass(C,P),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:P}),C)},oe.updateNode=function(C,P){if(P&&"function"!=typeof P)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(P,'"'));var Z=this._nodes.get(C=""+C);if(Z)return P&&(Z.attributes=P(Z.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:C,attributes:Z.attributes})),C;var Fe=P?P({}):{};return Z=new this.NodeDataClass(C,Fe),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:Fe}),C},oe.dropNode=function(C){var P=this,Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.dropNode: could not find the "'.concat(C,'" node in the graph.'));this.forEachEdge(C,function(we){P.dropEdge(we)}),this._nodes.delete(C),this.emit("nodeDropped",{key:C,attributes:Z.attributes})},oe.dropEdge=function(C){var P;if(arguments.length>1){var Z=""+arguments[0],we=""+arguments[1];if(!(P=W(this,Z,we,this.type)))throw new te('Graph.dropEdge: could not find the "'.concat(Z,'" -> "').concat(we,'" edge in the graph.'))}else if(!(P=this._edges.get(C=""+C)))throw new te('Graph.dropEdge: could not find the "'.concat(C,'" edge in the graph.'));this._edges.delete(P.key);var et=P.source,Dt=P.target,$e=P.attributes,Gt=P.undirected;return et===Dt?Gt?(et.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(et.directedSelfLoops--,this._directedSelfLoopCount--):Gt?(et.undirectedDegree--,Dt.undirectedDegree--):(et.outDegree--,Dt.inDegree--),Ke(this,Gt,P),Gt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:C,attributes:$e,source:et.key,target:Dt.key,undirected:Gt}),this},oe.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},oe.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},oe.getAttribute=function(C){return this._attributes[C]},oe.getAttributes=function(){return this._attributes},oe.hasAttribute=function(C){return this._attributes.hasOwnProperty(C)},oe.setAttribute=function(C,P){return this._attributes[C]=P,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.updateAttribute=function(C,P){if("function"!=typeof P)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[C]=P(this._attributes[C]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.removeAttribute=function(C){return delete this._attributes[C],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:C}),this},oe.replaceAttributes=function(C){if(!L(C))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=C,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},oe.mergeAttributes=function(C){if(!L(C))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,C),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:C}),this},oe.getNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.getNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes[P]},oe.getNodeAttributes=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.getNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));return P.attributes},oe.hasNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes.hasOwnProperty(P)},oe.setNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.setNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return we.attributes[P]=Z,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.updateNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.updateNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof Z)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,et=Z(Fe[P]);return Fe[P]=et,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.removeNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return delete Z.attributes[P],this.emit("nodeAttributesUpdated",{key:C,type:"remove",attributes:Z.attributes,name:P}),this},oe.replaceNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.replaceNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return Z.attributes=P,this.emit("nodeAttributesUpdated",{key:C,type:"replace",attributes:Z.attributes}),this},oe.mergeNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.mergeNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(Z.attributes,P),this.emit("nodeAttributesUpdated",{key:C,type:"merge",attributes:Z.attributes,data:P}),this},oe.updateEachNodeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._nodes.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:P||null})},oe.updateEachEdgeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._edges.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:P||null})},oe.forEach=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?lt(!1,this,C):ke(!1,this,C)},oe.forEachUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?lt(!0,this,C):ke(!0,this,C)},oe.adjacency=function(){return this.multi?(et=(C=this)._nodes.values(),Dt=C.type,$e="outer",Gt=null,new ee(function bt(){var gn;if("outer"===$e)return!0===(gn=et.next()).done?gn:(P=gn.value,$e="directed",bt());if("directed"===$e)return"undirected"===Dt?($e="undirected",bt()):(we=P.out,Z=Object.keys(P.out),Fe=0,$e="inner-directed",bt());if("undirected"===$e){if("directed"===Dt)return $e="outer",bt();we=P.undirected,Z=Object.keys(P.undirected),Fe=0,$e="inner-undirected"}if(!Gt&&Fe>=Z.length)return $e="inner-undirected"===$e?"outer":"undirected",bt();if(!Gt){var gs=Z[Fe++];return Gt=we[gs].values(),bt()}if((gn=Gt.next()).done)return Gt=null,bt();var Gr=gn.value,Gs=Gr.target;return"inner-undirected"===$e&&Gs.key===P.key&&(Gs=Gr.source),{done:!1,value:[P.key,Gs.key,P.attributes,Gs.attributes,Gr.key,Gr.attributes]}})):(El=(bt=this)._nodes.values(),io=bt.type,Rr="outer",new ee(function Rs(){var lc;if("outer"===Rr)return!0===(lc=El.next()).done?lc:(gn=lc.value,Rr="directed",Rs());if("directed"===Rr)return"undirected"===io?(Rr="undirected",Rs()):(Gr=gn.out,gs=Object.keys(gn.out),Gs=0,Rr="inner-directed",Rs());if("undirected"===Rr){if("directed"===io)return Rr="outer",Rs();Gr=gn.undirected,gs=Object.keys(gn.undirected),Gs=0,Rr="inner-undirected"}if(Gs>=gs.length)return Rr="inner-undirected"===Rr?"outer":"undirected",Rs();var bn=gs[Gs++],ro=Gr[bn],Sl=ro.target;return"inner-undirected"===Rr&&Sl.key===gn.key&&(Sl=ro.source),{done:!1,value:[gn.key,Sl.key,gn.attributes,Sl.attributes,ro.key,ro.attributes]}}));var bt,gn,gs,Gr,Gs,El,io,Rr,C,P,Z,we,Fe,et,Dt,$e,Gt},oe.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):se(this._nodes.keys(),this._nodes.size)},oe.forEachNode=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(P,Z){C(Z,P.attributes)})},oe.forEachNodeUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");for(var P,Z,we=this._nodes.values();!0!==(P=we.next())&&!C((Z=P.value).key,Z.attributes););},oe.nodeEntries=function(){var C=this._nodes.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{value:[Z.key,Z.attributes],done:!1}})},oe.exportNode=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.exportNode: could not find the "'.concat(C,'" node in the graph.'));return Qe(C,P)},oe.exportEdge=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.exportEdge: could not find the "'.concat(C,'" edge in the graph.'));return vt(C,P)},oe.export=function(){var C=new Array(this._nodes.size),P=0;this._nodes.forEach(function(we,Fe){C[P++]=Qe(Fe,we)});var Z=new Array(this._edges.size);return P=0,this._edges.forEach(function(we,Fe){Z[P++]=vt(Fe,we)}),{attributes:this.getAttributes(),nodes:C,edges:Z,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},oe.importNode=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=St(C);if(Z){if("not-object"===Z)throw new me('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===Z)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===Z)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=C.key,Fe=C.attributes,et=void 0===Fe?{}:Fe;return P?this.mergeNode(we,et):this.addNode(we,et),this},oe.importEdge=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=At(C);if(Z){if("not-object"===Z)throw new me('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===Z)throw new me("Graph.importEdge: missing souce.");if("no-target"===Z)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===Z)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===Z)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=C.source,Fe=C.target,et=C.attributes,Dt=void 0===et?{}:et,$e=C.undirected,Gt=void 0!==$e&&$e;return"key"in C?(P?Gt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:Gt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,C.key,we,Fe,Dt):(P?Gt?this.mergeUndirectedEdge:this.mergeDirectedEdge:Gt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Dt),this},oe.import=function(C){var P,Z,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V(C))return this.import(C.export(),Fe),this;if(!L(C))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(C.attributes){if(!L(C.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(C.attributes):this.replaceAttributes(C.attributes)}if(C.nodes){if(we=C.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(P=0,Z=we.length;PZ)){var Dt=new Set;Dt.add(P.undirected[et]),P.undirected[et]=Dt,C._nodes.get(et).undirected[Z]=Dt}})),this;var C},oe.clearIndex=function(){return this._nodes.forEach(function(C){void 0!==C.in&&(C.in={},C.out={}),void 0!==C.undirected&&(C.undirected={})}),this},oe.toJSON=function(){return this.export()},oe.toString=function(){return"[object Graph]"},oe.inspect=function(){var C=this,P={};this._nodes.forEach(function(Dt,$e){P[$e]=Dt.attributes});var Z={},we={};this._edges.forEach(function(Dt,$e){var Gt=Dt.undirected?"--":"->",bt="",gn="(".concat(Dt.source.key,")").concat(Gt,"(").concat(Dt.target.key,")");Dt.generatedKey?C.multi&&(void 0===we[gn]?we[gn]=0:we[gn]++,bt+="".concat(we[gn],". ")):bt+="[".concat($e,"]: "),Z[bt+=gn]=Dt.attributes});var Fe={};for(var et in this)this.hasOwnProperty(et)&&!Bn.has(et)&&"function"!=typeof this[et]&&(Fe[et]=this[et]);return Fe.attributes=this._attributes,Fe.nodes=P,Fe.edges=Z,$(Fe,"constructor",this.constructor),Fe},de}(A.exports.EventEmitter);"undefined"!=typeof Symbol&&(En.prototype[Symbol.for("nodejs.util.inspect.custom")]=En.prototype.inspect),[{name:function(ne){return"".concat(ne,"Edge")},generateKey:!0},{name:function(ne){return"".concat(ne,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ne){return"".concat(ne,"EdgeWithKey")}},{name:function(ne){return"".concat(ne,"DirectedEdgeWithKey")},type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ne){["add","merge","update"].forEach(function(de){var oe=ne.name(de),C="add"===de?pn:Un;En.prototype[oe]=ne.generateKey?function(P,Z,we){return C(this,oe,!0,"undirected"===(ne.type||this.type),null,P,Z,we,"update"===de)}:function(P,Z,we,Fe){return C(this,oe,!1,"undirected"===(ne.type||this.type),P,Z,we,Fe,"update"===de)}})}),"undefined"!=typeof Symbol&&(En.prototype[Symbol.iterator]=En.prototype.adjacency),ne=En,je.forEach(function(de){var oe=de.name,C=de.attacher;C(ne,oe("Edge"),"mixed"),C(ne,oe("DirectedEdge"),"directed"),C(ne,oe("UndirectedEdge"),"undirected")}),function(ne){Oe.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe,et){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(!arguments.length)return Re(this,Z);if(1===arguments.length){var Dt=this._nodes.get(Fe=""+Fe);if(void 0===Dt)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return An(this.multi,"mixed"===Z?this.type:Z,we,Dt)}if(2===arguments.length){et=""+et;var $e=this._nodes.get(Fe=""+Fe);if(!$e)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" target node in the graph.'));return ci(Z,this.multi,we,$e,et)}throw new me("Graph.".concat(P,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1);oe.prototype[Fe]=function(et,Dt,$e){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return Xe(this,Z,$e=et);if(2===arguments.length){$e=Dt;var Gt=this._nodes.get(et=""+et);if(void 0===Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Rn(this.multi,"mixed"===Z?this.type:Z,we,Gt,$e)}if(3===arguments.length){Dt=""+Dt;var bt=this._nodes.get(et=""+et);if(!bt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Ur(Z,this.multi,we,bt,Dt,$e)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1)+"Until";oe.prototype[Fe]=function(et,Dt,$e){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return yt(this,Z,$e=et);if(2===arguments.length){$e=Dt;var Gt=this._nodes.get(et=""+et);if(void 0===Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Hn(this.multi,"mixed"===Z?this.type:Z,we,Gt,$e)}if(3===arguments.length){Dt=""+Dt;var bt=this._nodes.get(et=""+et);if(!bt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Is(Z,this.multi,we,bt,Dt,$e)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var Z=C.type,we=C.direction,Fe=C.name.slice(0,-1)+"Entries";oe.prototype[Fe]=function(et,Dt){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return ee.empty();if(!arguments.length)return It(this,Z);if(1===arguments.length){var $e=this._nodes.get(et=""+et);if(!$e)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return yi(Z,we,$e)}if(2===arguments.length){Dt=""+Dt;var Gt=this._nodes.get(et=""+et);if(!Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return as(Z,we,Gt,Dt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ne,de)})}(En),function(ne){Os.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(2===arguments.length){var et=""+arguments[0],Dt=""+arguments[1];if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(P,': could not find the "').concat(Dt,'" node in the graph.'));return ot(this,Z,we,et,Dt)}if(1===arguments.length){var $e=this._nodes.get(Fe=""+Fe);if(void 0===$e)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return Va("mixed"===Z?this.type:Z,we,$e)}throw new me("Graph.".concat(P,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1);ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,$e,Gt,bt){if("mixed"!==Dt){if("undirected"===Dt)return wl(Gt,Gt.undirected,bt);if("string"==typeof $e)return wl(Gt,Gt[$e],bt)}var gn=new Set;"undirected"!==Dt&&("out"!==$e&&la(gn,Gt,Gt.in,bt),"in"!==$e&&la(gn,Gt,Gt.out,bt)),"directed"!==Dt&&la(gn,Gt,Gt.undirected,bt)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1)+"Until";ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,$e,Gt,bt){if("mixed"!==Dt){if("undirected"===Dt)return ps(Gt,Gt.undirected,bt);if("string"==typeof $e)return ps(Gt,Gt[$e],bt)}var gn=new Set;"undirected"!==Dt&&("out"!==$e&&Zt(gn,Gt,Gt.in,bt)||"in"!==$e&&Zt(gn,Gt,Gt.out,bt))||"directed"===Dt||Zt(gn,Gt,Gt.undirected,bt)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var C=de.type,P=de.direction,Z=de.name.slice(0,-1)+"Entries";ne.prototype[Z]=function(we){if("mixed"!==C&&"mixed"!==this.type&&C!==this.type)return ee.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));return function(et,Dt,$e){if("mixed"!==et){if("undirected"===et)return Ua($e,$e.undirected);if("string"==typeof Dt)return Ua($e,$e[Dt])}var Gt=ee.empty(),bt=new Set;return"undirected"!==et&&("out"!==Dt&&(Gt=Ee(Gt,rt(bt,$e,$e.in))),"in"!==Dt&&(Gt=Ee(Gt,rt(bt,$e,$e.out)))),"directed"!==et&&(Gt=Ee(Gt,rt(bt,$e,$e.undirected))),Gt}("mixed"===C?this.type:C,P,Fe)}}(ne,de)})}(En);var Qi=function(ne){function de(oe){var C=he({type:"directed"},oe);if("multi"in C&&!1!==C.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==C.type)throw new me('DirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),Zi=function(ne){function de(oe){var C=he({type:"undirected"},oe);if("multi"in C&&!1!==C.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==C.type)throw new me('UndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),Wn=function(ne){function de(oe){var C=he({multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ne.call(this,C)||this}return tt(de,ne),de}(En),Fi=function(ne){function de(oe){var C=he({type:"directed",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==C.type)throw new me('MultiDirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),ca=function(ne){function de(oe){var C=he({type:"undirected",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==C.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En);function Hr(ne){ne.from=function(de,oe){var C=he({},de.options,oe),P=new ne(C);return P.import(de),P}}return Hr(En),Hr(Qi),Hr(Zi),Hr(Wn),Hr(Fi),Hr(ca),En.Graph=En,En.DirectedGraph=Qi,En.UndirectedGraph=Zi,En.MultiGraph=Wn,En.MultiDirectedGraph=Fi,En.MultiUndirectedGraph=ca,En.InvalidArgumentsGraphError=me,En.NotFoundGraphError=te,En.UsageGraphError=ye,En}()},524:(jt,it,tt)=>{var gt;!function(J,xt,ut,Y){"use strict";var A,Ae=["","webkit","Moz","MS","ms","o"],he=xt.createElement("div"),V=Math.round,L=Math.abs,re=Date.now;function $(_e,xe,He){return setTimeout(D(_e,He),xe)}function b(_e,xe,He){return!!Array.isArray(_e)&&(S(_e,He[xe],He),!0)}function S(_e,xe,He){var mt;if(_e)if(_e.forEach)_e.forEach(xe,He);else if(_e.length!==Y)for(mt=0;mt<_e.length;)xe.call(He,_e[mt],mt,_e),mt++;else for(mt in _e)_e.hasOwnProperty(mt)&&xe.call(He,_e[mt],mt,_e)}function R(_e,xe,He){var mt="DEPRECATED METHOD: "+xe+"\n"+He+" AT \n";return function(){var Ut=new Error("get-stack-trace"),$t=Ut&&Ut.stack?Ut.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ni=J.console&&(J.console.warn||J.console.log);return ni&&ni.call(J.console,mt,$t),_e.apply(this,arguments)}}A="function"!=typeof Object.assign?function(xe){if(xe===Y||null===xe)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(xe),mt=1;mt-1}function Q(_e){return _e.trim().split(/\s+/g)}function E(_e,xe,He){if(_e.indexOf&&!He)return _e.indexOf(xe);for(var mt=0;mt<_e.length;){if(He&&_e[mt][He]==xe||!He&&_e[mt]===xe)return mt;mt++}return-1}function U(_e){return Array.prototype.slice.call(_e,0)}function ie(_e,xe,He){for(var mt=[],Ut=[],$t=0;$t<_e.length;){var ni=xe?_e[$t][xe]:_e[$t];E(Ut,ni)<0&&mt.push(_e[$t]),Ut[$t]=ni,$t++}return He&&(mt=xe?mt.sort(function($r,ms){return $r[xe]>ms[xe]}):mt.sort()),mt}function ue(_e,xe){for(var He,mt,Ut=xe[0].toUpperCase()+xe.slice(1),$t=0;$t1&&!He.firstMultiple?He.firstMultiple=yt(xe):1===Ut&&(He.firstMultiple=!1);var $t=He.firstInput,ni=He.firstMultiple,Nr=ni?ni.center:$t.center,$r=xe.center=It(mt);xe.timeStamp=re(),xe.deltaTime=xe.timeStamp-$t.timeStamp,xe.angle=yi(Nr,$r),xe.distance=Hn(Nr,$r),function(_e,xe){var He=xe.center,mt=_e.offsetDelta||{},Ut=_e.prevDelta||{},$t=_e.prevInput||{};(1===xe.eventType||4===$t.eventType)&&(Ut=_e.prevDelta={x:$t.deltaX||0,y:$t.deltaY||0},mt=_e.offsetDelta={x:He.x,y:He.y}),xe.deltaX=Ut.x+(He.x-mt.x),xe.deltaY=Ut.y+(He.y-mt.y)}(He,xe),xe.offsetDirection=Rn(xe.deltaX,xe.deltaY);var ms=An(xe.deltaTime,xe.deltaX,xe.deltaY);xe.overallVelocityX=ms.x,xe.overallVelocityY=ms.y,xe.overallVelocity=L(ms.x)>L(ms.y)?ms.x:ms.y,xe.scale=ni?function(_e,xe){return Hn(xe[0],xe[1],pt)/Hn(_e[0],_e[1],pt)}(ni.pointers,mt):1,xe.rotation=ni?function(_e,xe){return yi(xe[1],xe[0],pt)+yi(_e[1],_e[0],pt)}(ni.pointers,mt):0,xe.maxPointers=He.prevInput?xe.pointers.length>He.prevInput.maxPointers?xe.pointers.length:He.prevInput.maxPointers:xe.pointers.length,function(_e,xe){var Ut,$t,ni,Nr,He=_e.lastInterval||xe,mt=xe.timeStamp-He.timeStamp;if(8!=xe.eventType&&(mt>25||He.velocity===Y)){var $r=xe.deltaX-He.deltaX,ms=xe.deltaY-He.deltaY,Jn=An(mt,$r,ms);$t=Jn.x,ni=Jn.y,Ut=L(Jn.x)>L(Jn.y)?Jn.x:Jn.y,Nr=Rn($r,ms),_e.lastInterval=xe}else Ut=He.velocity,$t=He.velocityX,ni=He.velocityY,Nr=He.direction;xe.velocity=Ut,xe.velocityX=$t,xe.velocityY=ni,xe.direction=Nr}(He,xe);var Jn=_e.element;M(xe.srcEvent.target,Jn)&&(Jn=xe.srcEvent.target),xe.target=Jn}(_e,He),_e.emit("hammer.input",He),_e.recognize(He),_e.session.prevInput=He}function yt(_e){for(var xe=[],He=0;He<_e.pointers.length;)xe[He]={clientX:V(_e.pointers[He].clientX),clientY:V(_e.pointers[He].clientY)},He++;return{timeStamp:re(),pointers:xe,center:It(xe),deltaX:_e.deltaX,deltaY:_e.deltaY}}function It(_e){var xe=_e.length;if(1===xe)return{x:V(_e[0].clientX),y:V(_e[0].clientY)};for(var He=0,mt=0,Ut=0;Ut=L(xe)?_e<0?2:4:xe<0?8:16}function Hn(_e,xe,He){He||(He=Et);var mt=xe[He[0]]-_e[He[0]],Ut=xe[He[1]]-_e[He[1]];return Math.sqrt(mt*mt+Ut*Ut)}function yi(_e,xe,He){return He||(He=Et),180*Math.atan2(xe[He[1]]-_e[He[1]],xe[He[0]]-_e[He[0]])/Math.PI}pe.prototype={handler:function(){},init:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(Te(this.element),this.evWin,this.domHandler)}};var Is={mousedown:1,mousemove:2,mouseup:4},as="mousedown",Os="mousemove mouseup";function zr(){this.evEl=as,this.evWin=Os,this.pressed=!1,pe.apply(this,arguments)}w(zr,pe,{handler:function(xe){var He=Is[xe.type];1&He&&0===xe.button&&(this.pressed=!0),2&He&&1!==xe.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[xe],changedPointers:[xe],pointerType:Ze,srcEvent:xe}))}});var Va={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},wl={2:Ve,3:"pen",4:Ze,5:"kinect"},la="pointerdown",ps="pointermove pointerup pointercancel";function Zt(){this.evEl=la,this.evWin=ps,pe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}J.MSPointerEvent&&!J.PointerEvent&&(la="MSPointerDown",ps="MSPointerMove MSPointerUp MSPointerCancel"),w(Zt,pe,{handler:function(xe){var He=this.store,mt=!1,Ut=xe.type.toLowerCase().replace("ms",""),$t=Va[Ut],ni=wl[xe.pointerType]||xe.pointerType,Nr=ni==Ve,$r=E(He,xe.pointerId,"pointerId");1&$t&&(0===xe.button||Nr)?$r<0&&(He.push(xe),$r=He.length-1):12&$t&&(mt=!0),!($r<0)&&(He[$r]=xe,this.callback(this.manager,$t,{pointers:He,changedPointers:[xe],pointerType:ni,srcEvent:xe}),mt&&He.splice($r,1))}});var Ua={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",ot="touchstart touchmove touchend touchcancel";function ct(){this.evTarget=rt,this.evWin=ot,this.started=!1,pe.apply(this,arguments)}function fe(_e,xe){var He=U(_e.touches),mt=U(_e.changedTouches);return 12&xe&&(He=ie(He.concat(mt),"identifier",!0)),[He,mt]}w(ct,pe,{handler:function(xe){var He=Ua[xe.type];if(1===He&&(this.started=!0),this.started){var mt=fe.call(this,xe,He);12&He&&mt[0].length-mt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:mt[0],changedPointers:mt[1],pointerType:Ve,srcEvent:xe})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ke="touchstart touchmove touchend touchcancel";function lt(){this.evTarget=ke,this.targetIds={},pe.apply(this,arguments)}function Qe(_e,xe){var He=U(_e.touches),mt=this.targetIds;if(3&xe&&1===He.length)return mt[He[0].identifier]=!0,[He,He];var Ut,$t,ni=U(_e.changedTouches),Nr=[],$r=this.target;if($t=He.filter(function(ms){return M(ms.target,$r)}),1===xe)for(Ut=0;Ut<$t.length;)mt[$t[Ut].identifier]=!0,Ut++;for(Ut=0;Ut-1&&mt.splice($t,1)},2500)}}function ti(_e){for(var xe=_e.srcEvent.clientX,He=_e.srcEvent.clientY,mt=0;mt-1&&this.requireFail.splice(xe,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(_e){return!!this.simultaneous[_e.id]},emit:function(_e){var xe=this,He=this.state;function mt(Ut){xe.manager.emit(Ut,_e)}He<8&&mt(xe.options.event+$e(He)),mt(xe.options.event),_e.additionalEvent&&mt(_e.additionalEvent),He>=8&&mt(xe.options.event+$e(He))},tryEmit:function(_e){if(this.canEmit())return this.emit(_e);this.state=32},canEmit:function(){for(var _e=0;_exe.threshold&&Ut&xe.direction},attrTest:function(_e){return gn.prototype.attrTest.call(this,_e)&&(2&this.state||!(2&this.state)&&this.directionTest(_e))},emit:function(_e){this.pX=_e.deltaX,this.pY=_e.deltaY;var xe=Gt(_e.direction);xe&&(_e.additionalEvent=this.options.event+xe),this._super.emit.call(this,_e)}}),w(Gr,gn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.scale-1)>this.options.threshold||2&this.state)},emit:function(_e){1!==_e.scale&&(_e.additionalEvent=this.options.event+(_e.scale<1?"in":"out")),this._super.emit.call(this,_e)}}),w(Gs,Dt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(_e){var xe=this.options,He=_e.pointers.length===xe.pointers,mt=_e.distancexe.time;if(this._input=_e,!mt||!He||12&_e.eventType&&!Ut)this.reset();else if(1&_e.eventType)this.reset(),this._timer=$(function(){this.state=8,this.tryEmit()},xe.time,this);else if(4&_e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(_e){8===this.state&&(_e&&4&_e.eventType?this.manager.emit(this.options.event+"up",_e):(this._input.timeStamp=re(),this.manager.emit(this.options.event,this._input)))}}),w(El,gn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.rotation)>this.options.threshold||2&this.state)}}),w(io,gn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return gs.prototype.getTouchAction.call(this)},attrTest:function(_e){var He,xe=this.options.direction;return 30&xe?He=_e.overallVelocity:6&xe?He=_e.overallVelocityX:24&xe&&(He=_e.overallVelocityY),this._super.attrTest.call(this,_e)&&xe&_e.offsetDirection&&_e.distance>this.options.threshold&&_e.maxPointers==this.options.pointers&&L(He)>this.options.velocity&&4&_e.eventType},emit:function(_e){var xe=Gt(_e.offsetDirection);xe&&this.manager.emit(this.options.event+xe,_e),this.manager.emit(this.options.event,_e)}}),w(Rr,Dt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Qi]},process:function(_e){var xe=this.options,He=_e.pointers.length===xe.pointers,mt=_e.distance"']/g,ps=RegExp(wl.source),Zt=RegExp(la.source),Ua=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fe=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,lt=RegExp(ke.source),Qe=/^\s+/,vt=/\s/,St=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,At=/\{\n\/\* \[wrapped with (.+)\] \*/,qt=/,? & /,Bn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ti=/[()=,{}\[\]\/\s]/,Mn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Un=/\w*$/,En=/^[-+]0x[0-9a-f]+$/i,Qi=/^0b[01]+$/i,Zi=/^\[object .+?Constructor\]$/,Wn=/^0o[0-7]+$/i,Fi=/^(?:0|[1-9]\d*)$/,ca=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hr=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,de="\\ud800-\\udfff",Z="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",bt="A-Z\\xc0-\\xd6\\xd8-\\xde",gn="\\ufe0e\\ufe0f",gs="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gs="["+de+"]",El="["+gs+"]",io="["+Z+"]",Rr="\\d+",Rs="["+we+"]",lc="["+Fe+"]",bn="[^"+de+gs+Rr+we+Fe+bt+"]",ro="\\ud83c[\\udffb-\\udfff]",ua="[^"+de+"]",nd="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="["+bt+"]",mt="(?:"+lc+"|"+bn+")",Ut="(?:"+xe+"|"+bn+")",$t="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ni="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Nr="(?:"+io+"|"+ro+")?",$r="["+gn+"]?",yx=$r+Nr+"(?:\\u200d(?:"+[ua,nd,_e].join("|")+")"+$r+Nr+")*",id="(?:"+[Rs,nd,_e].join("|")+")"+yx,qi="(?:"+[ua+io+"?",io,nd,_e,Gs].join("|")+")",Gf=RegExp("['\u2019]","g"),wm=RegExp(io,"g"),hh=RegExp(ro+"(?="+ro+")|"+qi+yx,"g"),ab=RegExp([xe+"?"+lc+"+"+$t+"(?="+[El,xe,"$"].join("|")+")",Ut+"+"+ni+"(?="+[El,xe+mt,"$"].join("|")+")",xe+"?"+mt+"+"+$t,xe+"+"+ni,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rr,id].join("|"),"g"),vx=RegExp("[\\u200d"+de+Z+gn+"]"),Cl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bx=-1,_n={};_n[It]=_n[An]=_n[Rn]=_n[Hn]=_n[yi]=_n[ci]=_n[Ur]=_n[Is]=_n[as]=!0,_n[Ze]=_n[Je]=_n[Xe]=_n[je]=_n[yt]=_n[Le]=_n[Oe]=_n[Ue]=_n[Be]=_n[z]=_n[be]=_n[Et]=_n[pt]=_n[pe]=_n[k]=!1;var Ji={};Ji[Ze]=Ji[Je]=Ji[Xe]=Ji[yt]=Ji[je]=Ji[Le]=Ji[It]=Ji[An]=Ji[Rn]=Ji[Hn]=Ji[yi]=Ji[Be]=Ji[z]=Ji[be]=Ji[Et]=Ji[pt]=Ji[pe]=Ji[B]=Ji[ci]=Ji[Ur]=Ji[Is]=Ji[as]=!0,Ji[Oe]=Ji[Ue]=Ji[k]=!1;var ln={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},wx=parseFloat,db=parseInt,kt="object"==typeof global&&global&&global.Object===Object&&global,Ns="object"==typeof self&&self&&self.Object===Object&&self,Ii=kt||Ns||Function("return this")(),xl=it&&!it.nodeType&&it,da=xl&&jt&&!jt.nodeType&&jt,bo=da&&da.exports===xl,Em=bo&&kt.process,mr=function(){try{return da&&da.require&&da.require("util").types||Em&&Em.binding&&Em.binding("util")}catch(Tt){}}(),tn=mr&&mr.isArrayBuffer,ii=mr&&mr.isDate,nr=mr&&mr.isMap,so=mr&&mr.isRegExp,cc=mr&&mr.isSet,Qr=mr&&mr.isTypedArray;function Zr(st,Tt,_t){switch(_t.length){case 0:return st.call(Tt);case 1:return st.call(Tt,_t[0]);case 2:return st.call(Tt,_t[0],_t[1]);case 3:return st.call(Tt,_t[0],_t[1],_t[2])}return st.apply(Tt,_t)}function Pr(st,Tt,_t,cn){for(var Cn=-1,Di=null==st?0:st.length;++Cn-1}function ph(st,Tt,_t){for(var cn=-1,Cn=null==st?0:st.length;++cn-1;);return _t}function xx(st,Tt){for(var _t=st.length;_t--&&za(Tt,st[_t],0)>-1;);return _t}function mP(st,Tt){for(var _t=st.length,cn=0;_t--;)st[_t]===Tt&&++cn;return cn}var _P=ko({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),yP=ko({"&":"&","<":"<",">":">",'"':""","'":"'"});function vP(st){return"\\"+ln[st]}function _h(st){return vx.test(st)}function fb(st){var Tt=-1,_t=Array(st.size);return st.forEach(function(cn,Cn){_t[++Tt]=[Cn,cn]}),_t}function Ax(st,Tt){return function(_t){return st(Tt(_t))}}function iu(st,Tt){for(var _t=-1,cn=st.length,Cn=0,Di=[];++_t",""":'"',"'":"'"}),vh=function st(Tt){var u,_t=(Tt=null==Tt?Ii:vh.defaults(Ii.Object(),Tt,vh.pick(Ii,fh))).Array,cn=Tt.Date,Cn=Tt.Error,Di=Tt.Function,Wr=Tt.Math,Bi=Tt.Object,Mm=Tt.RegExp,Im=Tt.String,pa=Tt.TypeError,ir=_t.prototype,ru=Bi.prototype,Wf=Tt["__core-js_shared__"],_r=Di.prototype.toString,ji=ru.hasOwnProperty,xP=0,bh=(u=/[^.]+$/.exec(Wf&&Wf.keys&&Wf.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",$s=ru.toString,Mx=_r.call(Bi),Om=Ii._,cd=Mm("^"+_r.call(ji).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fs=bo?Tt.Buffer:J,Tl=Tt.Symbol,ud=Tt.Uint8Array,mb=Fs?Fs.allocUnsafe:J,ga=Ax(Bi.getPrototypeOf,Bi),Rm=Bi.create,qf=ru.propertyIsEnumerable,Pn=ir.splice,Ix=Tl?Tl.isConcatSpreadable:J,wh=Tl?Tl.iterator:J,su=Tl?Tl.toStringTag:J,Yf=function(){try{var u=wc(Bi,"defineProperty");return u({},"",{}),u}catch(h){}}(),_b=Tt.clearTimeout!==Ii.clearTimeout&&Tt.clearTimeout,Ox=cn&&cn.now!==Ii.Date.now&&cn.now,Rx=Tt.setTimeout!==Ii.setTimeout&&Tt.setTimeout,Bt=Wr.ceil,ui=Wr.floor,Vo=Bi.getOwnPropertySymbols,Jr=Fs?Fs.isBuffer:J,Nm=Tt.isFinite,Eh=ir.join,Ga=Ax(Bi.keys,Bi),Lr=Wr.max,ls=Wr.min,AP=cn.now,Nx=Tt.parseInt,Sh=Wr.random,Kf=ir.reverse,ys=wc(Tt,"DataView"),oo=wc(Tt,"Map"),Xf=wc(Tt,"Promise"),ma=wc(Tt,"Set"),Eo=wc(Tt,"WeakMap"),Ch=wc(Bi,"create"),xh=Eo&&new Eo,dd={},Px=_u(ys),Pm=_u(oo),Fm=_u(Xf),yb=_u(ma),Lm=_u(Eo),Qf=Tl?Tl.prototype:J,hd=Qf?Qf.valueOf:J,Ah=Qf?Qf.toString:J;function Se(u){if(br(u)&&!Tn(u)&&!(u instanceof ri)){if(u instanceof So)return u;if(ji.call(u,"__wrapped__"))return wp(u)}return new So(u)}var ou=function(){function u(){}return function(h){if(!vr(h))return{};if(Rm)return Rm(h);u.prototype=h;var m=new u;return u.prototype=J,m}}();function Th(){}function So(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=J}function ri(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function ao(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function Ls(u,h,m,N,ae,Ce){var ze,Ye=1&h,at=2&h,Rt=4&h;if(m&&(ze=ae?m(u,N,ae,Ce):m(u)),ze!==J)return ze;if(!vr(u))return u;var Nt=Tn(u);if(Nt){if(ze=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&ji.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!Ye)return qs(u,ze)}else{var Vt=Bs(u),en=Vt==Ue||Vt==qe;if(tl(u))return up(u,Ye);if(Vt==be||Vt==Ze||en&&!ae){if(ze=at||en?{}:Hb(u),!Ye)return at?function(u,h){return ba(u,Vb(u),h)}(u,function(u,h){return u&&ba(h,Ks(h),u)}(ze,u)):function(u,h){return ba(u,r_(u),h)}(u,Wx(ze,u))}else{if(!Ji[Vt])return ae?u:{};ze=function(u,h,m){var N=u.constructor;switch(h){case Xe:return fu(u);case je:case Le:return new N(+u);case yt:return function(u,h){var m=h?fu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case It:case An:case Rn:case Hn:case yi:case ci:case Ur:case Is:case as:return Jm(u,m);case Be:return new N;case z:case pe:return new N(u);case Et:return function(u){var h=new u.constructor(u.source,Un.exec(u));return h.lastIndex=u.lastIndex,h}(u);case pt:return new N;case B:return function(u){return hd?Bi(hd.call(u)):{}}(u)}}(u,Vt,Ye)}}Ce||(Ce=new ya);var vn=Ce.get(u);if(vn)return vn;Ce.set(u,ze),fA(u)?u.forEach(function(Fn){ze.add(Ls(Fn,h,m,Fn,u,Ce))}):cA(u)&&u.forEach(function(Fn,ai){ze.set(ai,Ls(Fn,h,m,ai,u,Ce))});var oi=Nt?J:(Rt?at?n_:Nl:at?Ks:Ss)(u);return Ps(oi||u,function(Fn,ai){oi&&(Fn=u[ai=Fn]),Wa(ze,ai,Ls(Fn,h,m,ai,u,Ce))}),ze}function ip(u,h,m){var N=m.length;if(null==u)return!N;for(u=Bi(u);N--;){var ae=m[N],ze=u[ae];if(ze===J&&!(ae in u)||!(0,h[ae])(ze))return!1}return!0}function Ih(u,h,m){if("function"!=typeof u)throw new pa(Ae);return kh(function(){u.apply(J,m)},h)}function fc(u,h,m,N){var ae=-1,Ce=Al,ze=!0,Ye=u.length,at=[],Rt=h.length;if(!Ye)return at;m&&(h=Li(h,jo(m))),N?(Ce=ph,ze=!1):h.length>=200&&(Ce=mh,ze=!1,h=new _a(h));e:for(;++ae-1},Dl.prototype.set=function(u,h){var m=this.__data__,N=pd(m,u);return N<0?(++this.size,m.push([u,h])):m[N][1]=h,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new ao,map:new(oo||Dl),string:new ao}},$a.prototype.delete=function(u){var h=ks(this,u).delete(u);return this.size-=h?1:0,h},$a.prototype.get=function(u){return ks(this,u).get(u)},$a.prototype.has=function(u){return ks(this,u).has(u)},$a.prototype.set=function(u,h){var m=ks(this,u),N=m.size;return m.set(u,h),this.size+=m.size==N?0:1,this},_a.prototype.add=_a.prototype.push=function(u){return this.__data__.set(u,W),this},_a.prototype.has=function(u){return this.__data__.has(u)},ya.prototype.clear=function(){this.__data__=new Dl,this.size=0},ya.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},ya.prototype.get=function(u){return this.__data__.get(u)},ya.prototype.has=function(u){return this.__data__.has(u)},ya.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Dl){var N=m.__data__;if(!oo||N.length<199)return N.push([u,h]),this.size=++m.size,this;m=this.__data__=new $a(N)}return m.set(u,h),this.size=m.size,this};var pc=Xa(Ya),Gm=Xa(rp,!0);function Eb(u,h){var m=!0;return pc(u,function(N,ae,Ce){return m=!!h(N,ae,Ce)}),m}function Oh(u,h,m){for(var N=-1,ae=u.length;++N0&&m(Ye)?h>1?vs(Ye,h-1,m,N,ae):Fr(ae,Ye):N||(ae[ae.length]=Ye)}return ae}var gd=Ob(),md=Ob(!0);function Ya(u,h){return u&&gd(u,h,Ss)}function rp(u,h){return u&&md(u,h,Ss)}function Rh(u,h){return ha(h,function(m){return Xo(u[m])})}function Uo(u,h){for(var m=0,N=(h=yc(h,u)).length;null!=u&&mh}function _d(u,h){return null!=u&&ji.call(u,h)}function yd(u,h){return null!=u&&h in Bi(u)}function lu(u,h,m){for(var N=m?ph:Al,ae=u[0].length,Ce=u.length,ze=Ce,Ye=_t(Ce),at=1/0,Rt=[];ze--;){var Nt=u[ze];ze&&h&&(Nt=Li(Nt,jo(h))),at=ls(Nt.length,at),Ye[ze]=!m&&(h||ae>=120&&Nt.length>=120)?new _a(ze&&Nt):J}Nt=u[0];var Vt=-1,en=Ye[0];e:for(;++Vt=Ye?at:at*("desc"==m[N]?-1:1)}return u.index-h.index}(Ce,ze,m)});_t--;)st[_t]=st[_t].value;return st}(Qx(u,function(Ce,ze,Ye){return{criteria:Li(h,function(Rt){return Rt(Ce)}),index:++N,value:Ce}}))}function Tb(u,h,m){for(var N=-1,ae=h.length,Ce={};++N-1;)Ye!==u&&Pn.call(Ye,at,1),Pn.call(u,at,1);return u}function Ph(u,h){for(var m=u?h.length:0,N=m-1;m--;){var ae=h[m];if(m==N||ae!==Ce){var Ce=ae;Ao(ae)?Pn.call(u,ae,1):uu(u,ae)}}return u}function Ml(u,h){return u+ui(Sh()*(h-u+1))}function op(u,h){var m="";if(!u||h<1||h>Te)return m;do{h%2&&(m+=u),(h=ui(h/2))&&(u+=u)}while(h);return m}function si(u,h){return bp(p1(u,h,Xs),u+"")}function Jx(u){return Vm(Ld(u))}function FP(u,h){var m=Ld(u);return Td(m,au(h,0,m.length))}function ap(u,h,m,N){if(!vr(u))return u;for(var ae=-1,Ce=(h=yc(h,u)).length,ze=Ce-1,Ye=u;null!=Ye&&++aeae?0:ae+h),(m=m>ae?ae:m)<0&&(m+=ae),ae=h>m?0:m-h>>>0,h>>>=0;for(var Ce=_t(ae);++N>>1,ze=u[Ce];null!==ze&&!Qo(ze)&&(m?ze<=h:ze=200){var Rt=h?null:t_(u);if(Rt)return Am(Rt);ze=!1,ae=mh,at=new _a}else at=h?[]:Ye;e:for(;++N=N?u:ws(u,h,m)}var n1=_b||function(u){return Ii.clearTimeout(u)};function up(u,h){if(h)return u.slice();var m=u.length,N=mb?mb(m):new u.constructor(m);return u.copy(N),N}function fu(u){var h=new u.constructor(u.byteLength);return new ud(h).set(new ud(u)),h}function Jm(u,h){var m=h?fu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function vc(u,h){if(u!==h){var m=u!==J,N=null===u,ae=u==u,Ce=Qo(u),ze=h!==J,Ye=null===h,at=h==h,Rt=Qo(h);if(!Ye&&!Rt&&!Ce&&u>h||Ce&&ze&&at&&!Ye&&!Rt||N&&ze&&at||!m&&at||!ae)return 1;if(!N&&!Ce&&!Rt&&u1?m[ae-1]:J,ze=ae>2?m[2]:J;for(Ce=u.length>3&&"function"==typeof Ce?(ae--,Ce):J,ze&&js(m[0],m[1],ze)&&(Ce=ae<3?J:Ce,ae=1),h=Bi(h);++N-1?ae[Ce?h[ze]:ze]:J}}function gu(u){return Qa(function(h){var m=h.length,N=m,ae=So.prototype.thru;for(u&&h.reverse();N--;){var Ce=h[N];if("function"!=typeof Ce)throw new pa(Ae);if(ae&&!ze&&"wrapper"==_p(Ce))var ze=new So([],!0)}for(N=ze?N:m;++N1&&vi.reverse(),Nt&&atYe))return!1;var Rt=Ce.get(u),Nt=Ce.get(h);if(Rt&&Nt)return Rt==h&&Nt==u;var Vt=-1,en=!0,vn=2&m?new _a:J;for(Ce.set(u,h),Ce.set(h,u);++Vt-1&&u%1==0&&u1?"& ":"")+h[N],h=h.join(m>2?", ":" "),u.replace(St,"{\n/* [wrapped with "+h+"] */\n")}(N,function(u,h){return Ps(nt,function(m){var N="_."+m[0];h&m[1]&&!Al(u,N)&&u.push(N)}),u.sort()}(function(u){var h=u.match(At);return h?h[1].split(qt):[]}(N),m)))}function u_(u){var h=0,m=0;return function(){var N=AP(),ae=16-(N-m);if(m=N,ae>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(J,arguments)}}function Td(u,h){var m=-1,N=u.length,ae=N-1;for(h=h===J?N:h;++m1?u[h-1]:J;return m="function"==typeof m?(u.pop(),m):J,j1(u,m)});function b_(u){var h=Se(u);return h.__chain__=!0,h}function Md(u,h){return h(u)}var w_=Qa(function(u){var h=u.length,m=h?u[0]:0,N=this.__wrapped__,ae=function(Ce){return zm(Ce,u)};return!(h>1||this.__actions__.length)&&N instanceof ri&&Ao(m)?((N=N.slice(m,+m+(h?1:0))).__actions__.push({func:Md,args:[ae],thisArg:J}),new So(N,this.__chain__).thru(function(Ce){return h&&!Ce.length&&Ce.push(J),Ce})):this.thru(ae)}),z1=qr(function(u,h,m){ji.call(u,m)?++u[m]:qa(u,m,1)}),$1=Nb(h_),W1=Nb(f_);function x_(u,h){return(Tn(u)?Ps:pc)(u,On(h,3))}function Cp(u,h){return(Tn(u)?rd:Gm)(u,On(h,3))}var Y1=qr(function(u,h,m){ji.call(u,m)?u[m].push(h):qa(u,m,[h])}),h0=si(function(u,h,m){var N=-1,ae="function"==typeof h,Ce=lo(u)?_t(u.length):[];return pc(u,function(ze){Ce[++N]=ae?Zr(h,ze,m):va(ze,h,m)}),Ce}),f0=qr(function(u,h,m){qa(u,m,h)});function Ja(u,h){return(Tn(u)?Li:Qx)(u,On(h,3))}var g0=qr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),Ap=si(function(u,h){if(null==u)return[];var m=h.length;return m>1&&js(u,h[0],h[1])?h=[]:m>2&&js(h[0],h[1],h[2])&&(h=[h[0]]),Nh(u,vs(h,1),[])}),yu=Ox||function(){return Ii.Date.now()};function Tp(u,h,m){return h=m?J:h,Rl(u,H,J,J,J,J,h=u&&null==h?u.length:h)}function T_(u,h){var m;if("function"!=typeof h)throw new pa(Ae);return u=Kn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=J),m}}var zh=si(function(u,h,m){var N=1;if(m.length){var ae=iu(m,Ad(zh));N|=j}return Rl(u,N,h,m,ae)}),Od=si(function(u,h,m){var N=3;if(m.length){var ae=iu(m,Ad(Od));N|=j}return Rl(h,N,u,m,ae)});function E0(u,h,m){var N,ae,Ce,ze,Ye,at,Rt=0,Nt=!1,Vt=!1,en=!0;if("function"!=typeof u)throw new pa(Ae);function vn(Ri){var rl=N,xc=ae;return N=ae=J,Rt=Ri,ze=u.apply(xc,rl)}function Nn(Ri){return Rt=Ri,Ye=kh(ai,h),Nt?vn(Ri):ze}function Fn(Ri){var rl=Ri-at;return at===J||rl>=h||rl<0||Vt&&Ri-Rt>=Ce}function ai(){var Ri=yu();if(Fn(Ri))return vi(Ri);Ye=kh(ai,function(Ri){var nT=h-(Ri-at);return Vt?ls(nT,Ce-(Ri-Rt)):nT}(Ri))}function vi(Ri){return Ye=J,en&&N?vn(Ri):(N=ae=J,ze)}function Zo(){var Ri=yu(),rl=Fn(Ri);if(N=arguments,ae=this,at=Ri,rl){if(Ye===J)return Nn(at);if(Vt)return n1(Ye),Ye=kh(ai,h),vn(at)}return Ye===J&&(Ye=kh(ai,h)),ze}return h=co(h)||0,vr(m)&&(Nt=!!m.leading,Ce=(Vt="maxWait"in m)?Lr(co(m.maxWait)||0,h):Ce,en="trailing"in m?!!m.trailing:en),Zo.cancel=function(){Ye!==J&&n1(Ye),Rt=0,N=at=ae=Ye=J},Zo.flush=function(){return Ye===J?ze:vi(yu())},Zo}var Z1=si(function(u,h){return Ih(u,1,h)}),S0=si(function(u,h,m){return Ih(u,co(h)||0,m)});function Hh(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new pa(Ae);var m=function(){var N=arguments,ae=h?h.apply(this,N):N[0],Ce=m.cache;if(Ce.has(ae))return Ce.get(ae);var ze=u.apply(this,N);return m.cache=Ce.set(ae,ze)||Ce,ze};return m.cache=new(Hh.Cache||$a),m}function I_(u){if("function"!=typeof u)throw new pa(Ae);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}Hh.Cache=$a;var J1=t1(function(u,h){var m=(h=1==h.length&&Tn(h[0])?Li(h[0],jo(On())):Li(vs(h,1),jo(On()))).length;return si(function(N){for(var ae=-1,Ce=ls(N.length,m);++ae=h}),el=qx(function(){return arguments}())?qx:function(u){return br(u)&&ji.call(u,"callee")&&!qf.call(u,"callee")},Tn=_t.isArray,M0=tn?jo(tn):function(u){return br(u)&&bs(u)==Xe};function lo(u){return null!=u&&R_(u.length)&&!Xo(u)}function yr(u){return br(u)&&lo(u)}var tl=Jr||ty,I0=ii?jo(ii):function(u){return br(u)&&bs(u)==Le};function Ea(u){if(!br(u))return!1;var h=bs(u);return h==Oe||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!Op(u)}function Xo(u){if(!vr(u))return!1;var h=bs(u);return h==Ue||h==qe||"[object AsyncFunction]"==h||"[object Proxy]"==h}function Ip(u){return"number"==typeof u&&u==Kn(u)}function R_(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Te}function vr(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function br(u){return null!=u&&"object"==typeof u}var cA=nr?jo(nr):function(u){return br(u)&&Bs(u)==Be};function hA(u){return"number"==typeof u||br(u)&&bs(u)==z}function Op(u){if(!br(u)||bs(u)!=be)return!1;var h=ga(u);if(null===h)return!0;var m=ji.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&_r.call(m)==Mx}var P0=so?jo(so):function(u){return br(u)&&bs(u)==Et},fA=cc?jo(cc):function(u){return br(u)&&Bs(u)==pt};function P_(u){return"string"==typeof u||!Tn(u)&&br(u)&&bs(u)==pe}function Qo(u){return"symbol"==typeof u||br(u)&&bs(u)==B}var Gh=Qr?jo(Qr):function(u){return br(u)&&R_(u.length)&&!!_n[bs(u)]},Ec=pp(Ab),F_=pp(function(u,h){return u<=h});function F0(u){if(!u)return[];if(lo(u))return P_(u)?Ha(u):qs(u);if(wh&&u[wh])return function(st){for(var Tt,_t=[];!(Tt=st.next()).done;)_t.push(Tt.value);return _t}(u[wh]());var h=Bs(u);return(h==Be?fb:h==pt?Am:Ld)(u)}function nl(u){return u?(u=co(u))===se||u===-se?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Kn(u){var h=nl(u),m=h%1;return h==h?m?h-m:h:0}function L_(u){return u?au(Kn(u),0,ye):0}function co(u){if("number"==typeof u)return u;if(Qo(u))return NaN;if(vr(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=vr(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=hb(u);var m=Qi.test(u);return m||Wn.test(u)?db(u.slice(2),m?2:8):En.test(u)?NaN:+u}function L0(u){return ba(u,Ks(u))}function Oi(u){return null==u?"":xo(u)}var pA=Il(function(u,h){if(vp(h)||lo(h))ba(h,Ss(h),u);else for(var m in h)ji.call(h,m)&&Wa(u,m,h[m])}),gA=Il(function(u,h){ba(h,Ks(h),u)}),Rd=Il(function(u,h,m,N){ba(h,Ks(h),u,N)}),mA=Il(function(u,h,m,N){ba(h,Ss(h),u,N)}),k0=Qa(zm),yA=si(function(u,h){u=Bi(u);var m=-1,N=h.length,ae=N>2?h[2]:J;for(ae&&js(h[0],h[1],ae)&&(N=1);++m1),Ce}),ba(u,n_(u),m),N&&(m=Ls(m,7,gp));for(var ae=h.length;ae--;)uu(m,h[ae]);return m}),SA=Qa(function(u,h){return null==u?{}:function(u,h){return Tb(u,h,function(m,N){return Rp(u,N)})}(u,h)});function G0(u,h){if(null==u)return{};var m=Li(n_(u),function(N){return[N]});return h=On(h),Tb(u,m,function(N,ae){return h(N,ae[0])})}var CA=mu(Ss),W0=mu(Ks);function Ld(u){return null==u?[]:xm(u,Ss(u))}var MA=Ol(function(u,h,m){return h=h.toLowerCase(),u+(m?V_(h):h)});function V_(u){return Fp(Oi(u).toLowerCase())}function U_(u){return(u=Oi(u))&&u.replace(ca,_P).replace(wm,"")}var OA=Ol(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),RA=Ol(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),nF=dp("toLowerCase"),kA=Ol(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),G_=Ol(function(u,h,m){return u+(m?" ":"")+Fp(h)}),Z0=Ol(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),Fp=dp("toUpperCase");function Y_(u,h,m){return u=Oi(u),(h=m?J:h)===J?function(st){return Cl.test(st)}(u)?function(st){return st.match(ab)||[]}(u):function(st){return st.match(Bn)||[]}(u):u.match(h)||[]}var K_=si(function(u,h){try{return Zr(u,J,h)}catch(m){return Ea(m)?m:new Cn(m)}}),J0=Qa(function(u,h){return Ps(h,function(m){m=Zn(m),qa(u,m,zh(u[m],u))}),u});function X_(u){return function(){return u}}var rF=gu(),kd=gu(!0);function Xs(u){return u}function vu(u){return Xx("function"==typeof u?u:Ls(u,1))}var Q_=si(function(u,h){return function(m){return va(m,u,h)}}),ew=si(function(u,h){return function(m){return va(u,m,h)}});function Z_(u,h,m){var N=Ss(h),ae=Rh(h,N);null==m&&(!vr(h)||!ae.length&&N.length)&&(m=h,h=u,u=this,ae=Rh(h,Ss(h)));var Ce=!(vr(m)&&"chain"in m&&!m.chain),ze=Xo(u);return Ps(ae,function(Ye){var at=h[Ye];u[Ye]=at,ze&&(u.prototype[Ye]=function(){var Rt=this.__chain__;if(Ce||Rt){var Nt=u(this.__wrapped__),Vt=Nt.__actions__=qs(this.__actions__);return Vt.push({func:at,args:arguments,thisArg:u}),Nt.__chain__=Rt,Nt}return at.apply(u,Fr([this.value()],arguments))})}),u}function J_(){}var GA=hp(Li),$A=hp(Qn),nw=hp(wo);function bu(u){return Wo(u)?Sm(Zn(u)):function(u){return function(h){return Uo(h,u)}}(u)}var WA=Fb(),qA=Fb(!0);function Cc(){return[]}function ty(){return!1}var zn=e_(function(u,h){return u+h},0),ny=xd("ceil"),oF=e_(function(u,h){return u/h},1),Ll=xd("floor"),ow=e_(function(u,h){return u*h},1),aw=xd("round"),lw=e_(function(u,h){return u-h},0);return Se.after=function(u,h){if("function"!=typeof h)throw new pa(Ae);return u=Kn(u),function(){if(--u<1)return h.apply(this,arguments)}},Se.ary=Tp,Se.assign=pA,Se.assignIn=gA,Se.assignInWith=Rd,Se.assignWith=mA,Se.at=k0,Se.before=T_,Se.bind=zh,Se.bindAll=J0,Se.bindKey=Od,Se.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Tn(u)?u:[u]},Se.chain=b_,Se.chunk=function(u,h,m){h=(m?js(u,h,m):h===J)?1:Lr(Kn(h),0);var N=null==u?0:u.length;if(!N||h<1)return[];for(var ae=0,Ce=0,ze=_t(Bt(N/h));aeae?0:ae+m),(N=N===J||N>ae?ae:Kn(N))<0&&(N+=ae),N=m>N?0:L_(N);m>>0)?(u=Oi(u))&&("string"==typeof h||null!=h&&!P0(h))&&!(h=xo(h))&&_h(u)?Ka(Ha(u),0,m):u.split(h,m):[]},Se.spread=function(u,h){if("function"!=typeof u)throw new pa(Ae);return h=null==h?0:Lr(Kn(h),0),si(function(m){var N=m[h],ae=Ka(m,0,h);return N&&Fr(ae,N),Zr(u,this,ae)})},Se.tail=function(u){var h=null==u?0:u.length;return h?ws(u,1,h):[]},Se.take=function(u,h,m){return u&&u.length?ws(u,0,(h=m||h===J?1:Kn(h))<0?0:h):[]},Se.takeRight=function(u,h,m){var N=null==u?0:u.length;return N?ws(u,(h=N-(h=m||h===J?1:Kn(h)))<0?0:h,N):[]},Se.takeRightWhile=function(u,h){return u&&u.length?du(u,On(h,3),!1,!0):[]},Se.takeWhile=function(u,h){return u&&u.length?du(u,On(h,3)):[]},Se.tap=function(u,h){return h(u),u},Se.throttle=function(u,h,m){var N=!0,ae=!0;if("function"!=typeof u)throw new pa(Ae);return vr(m)&&(N="leading"in m?!!m.leading:N,ae="trailing"in m?!!m.trailing:ae),E0(u,h,{leading:N,maxWait:h,trailing:ae})},Se.thru=Md,Se.toArray=F0,Se.toPairs=CA,Se.toPairsIn=W0,Se.toPath=function(u){return Tn(u)?Li(u,Zn):Qo(u)?[u]:qs(qb(Oi(u)))},Se.toPlainObject=L0,Se.transform=function(u,h,m){var N=Tn(u),ae=N||tl(u)||Gh(u);if(h=On(h,4),null==m){var Ce=u&&u.constructor;m=ae?N?new Ce:[]:vr(u)&&Xo(Ce)?ou(ga(u)):{}}return(ae?Ps:Ya)(u,function(ze,Ye,at){return h(m,ze,Ye,at)}),m},Se.unary=function(u){return Tp(u,1)},Se.union=r0,Se.unionBy=L1,Se.unionWith=k1,Se.uniq=function(u){return u&&u.length?mc(u):[]},Se.uniqBy=function(u,h){return u&&u.length?mc(u,On(h,2)):[]},Se.uniqWith=function(u,h){return h="function"==typeof h?h:J,u&&u.length?mc(u,J,h):[]},Se.unset=function(u,h){return null==u||uu(u,h)},Se.unzip=s0,Se.unzipWith=j1,Se.update=function(u,h,m){return null==u?u:lp(u,h,Zm(m))},Se.updateWith=function(u,h,m,N){return N="function"==typeof N?N:J,null==u?u:lp(u,h,Zm(m),N)},Se.values=Ld,Se.valuesIn=function(u){return null==u?[]:xm(u,Ks(u))},Se.without=o0,Se.words=Y_,Se.wrap=function(u,h){return Dp(Zm(h),u)},Se.xor=$P,Se.xorBy=To,Se.xorWith=y_,Se.zip=v_,Se.zipObject=function(u,h){return cp(u||[],h||[],Wa)},Se.zipObjectDeep=function(u,h){return cp(u||[],h||[],ap)},Se.zipWith=Uh,Se.entries=CA,Se.entriesIn=W0,Se.extend=gA,Se.extendWith=Rd,Z_(Se,Se),Se.add=zn,Se.attempt=K_,Se.camelCase=MA,Se.capitalize=V_,Se.ceil=ny,Se.clamp=function(u,h,m){return m===J&&(m=h,h=J),m!==J&&(m=(m=co(m))==m?m:0),h!==J&&(h=(h=co(h))==h?h:0),au(co(u),h,m)},Se.clone=function(u){return Ls(u,4)},Se.cloneDeep=function(u){return Ls(u,5)},Se.cloneDeepWith=function(u,h){return Ls(u,5,h="function"==typeof h?h:J)},Se.cloneWith=function(u,h){return Ls(u,4,h="function"==typeof h?h:J)},Se.conformsTo=function(u,h){return null==h||ip(u,h,Ss(h))},Se.deburr=U_,Se.defaultTo=function(u,h){return null==u||u!=u?h:u},Se.divide=oF,Se.endsWith=function(u,h,m){u=Oi(u),h=xo(h);var N=u.length,ae=m=m===J?N:au(Kn(m),0,N);return(m-=h.length)>=0&&u.slice(m,ae)==h},Se.eq=xn,Se.escape=function(u){return(u=Oi(u))&&Zt.test(u)?u.replace(la,yP):u},Se.escapeRegExp=function(u){return(u=Oi(u))&<.test(u)?u.replace(ke,"\\$&"):u},Se.every=function(u,h,m){var N=Tn(u)?Qn:Eb;return m&&js(u,h,m)&&(h=J),N(u,On(h,3))},Se.find=$1,Se.findIndex=h_,Se.findKey=function(u,h){return gh(u,On(h,3),Ya)},Se.findLast=W1,Se.findLastIndex=f_,Se.findLastKey=function(u,h){return gh(u,On(h,3),rp)},Se.floor=Ll,Se.forEach=x_,Se.forEachRight=Cp,Se.forIn=function(u,h){return null==u?u:gd(u,On(h,3),Ks)},Se.forInRight=function(u,h){return null==u?u:md(u,On(h,3),Ks)},Se.forOwn=function(u,h){return u&&Ya(u,On(h,3))},Se.forOwnRight=function(u,h){return u&&rp(u,On(h,3))},Se.get=qh,Se.gt=Yt,Se.gte=D0,Se.has=function(u,h){return null!=u&&zb(u,h,_d)},Se.hasIn=Rp,Se.head=Kb,Se.identity=Xs,Se.includes=function(u,h,m,N){u=lo(u)?u:Ld(u),m=m&&!N?Kn(m):0;var ae=u.length;return m<0&&(m=Lr(ae+m,0)),P_(u)?m<=ae&&u.indexOf(h,m)>-1:!!ae&&za(u,h,m)>-1},Se.indexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=null==m?0:Kn(m);return ae<0&&(ae=Lr(N+ae,0)),za(u,h,ae)},Se.inRange=function(u,h,m){return h=nl(h),m===J?(m=h,h=0):m=nl(m),function(u,h,m){return u>=ls(h,m)&&u=-Te&&u<=Te},Se.isSet=fA,Se.isString=P_,Se.isSymbol=Qo,Se.isTypedArray=Gh,Se.isUndefined=function(u){return u===J},Se.isWeakMap=function(u){return br(u)&&Bs(u)==k},Se.isWeakSet=function(u){return br(u)&&"[object WeakSet]"==bs(u)},Se.join=function(u,h){return null==u?"":Eh.call(u,h)},Se.kebabCase=OA,Se.last=qo,Se.lastIndexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=N;return m!==J&&(ae=(ae=Kn(m))<0?Lr(N+ae,0):ls(ae,N-1)),h==h?function(st,Tt,_t){for(var cn=_t+1;cn--;)if(st[cn]===Tt)return cn;return cn}(u,h,ae):od(u,uc,ae,!0)},Se.lowerCase=RA,Se.lowerFirst=nF,Se.lt=Ec,Se.lte=F_,Se.max=function(u){return u&&u.length?Oh(u,Xs,zo):J},Se.maxBy=function(u,h){return u&&u.length?Oh(u,On(h,2),zo):J},Se.mean=function(u){return _s(u,Xs)},Se.meanBy=function(u,h){return _s(u,On(h,2))},Se.min=function(u){return u&&u.length?Oh(u,Xs,Ab):J},Se.minBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Ab):J},Se.stubArray=Cc,Se.stubFalse=ty,Se.stubObject=function(){return{}},Se.stubString=function(){return""},Se.stubTrue=function(){return!0},Se.multiply=ow,Se.nth=function(u,h){return u&&u.length?cu(u,Kn(h)):J},Se.noConflict=function(){return Ii._===this&&(Ii._=Om),this},Se.noop=J_,Se.now=yu,Se.pad=function(u,h,m){u=Oi(u);var N=(h=Kn(h))?yh(u):0;if(!h||N>=h)return u;var ae=(h-N)/2;return fp(ui(ae),m)+u+fp(Bt(ae),m)},Se.padEnd=function(u,h,m){u=Oi(u);var N=(h=Kn(h))?yh(u):0;return h&&Nh){var N=u;u=h,h=N}if(m||u%1||h%1){var ae=Sh();return ls(u+ae*(h-u+wx("1e-"+((ae+"").length-1))),h)}return Ml(u,h)},Se.reduce=function(u,h,m){var N=Tn(u)?nu:Bo,ae=arguments.length<3;return N(u,On(h,4),m,ae,pc)},Se.reduceRight=function(u,h,m){var N=Tn(u)?sd:Bo,ae=arguments.length<3;return N(u,On(h,4),m,ae,Gm)},Se.repeat=function(u,h,m){return h=(m?js(u,h,m):h===J)?1:Kn(h),op(Oi(u),h)},Se.replace=function(){var u=arguments,h=Oi(u[0]);return u.length<3?h:h.replace(u[1],u[2])},Se.result=function(u,h,m){var N=-1,ae=(h=yc(h,u)).length;for(ae||(ae=1,u=J);++NTe)return[];var m=ye,N=ls(u,ye);h=On(h),u-=ye;for(var ae=ld(N,h);++m=Ce)return u;var Ye=m-yh(N);if(Ye<1)return N;var at=ze?Ka(ze,0,Ye).join(""):u.slice(0,Ye);if(ae===J)return at+N;if(ze&&(Ye+=at.length-Ye),P0(ae)){if(u.slice(Ye).search(ae)){var Rt,Nt=at;for(ae.global||(ae=Mm(ae.source,Oi(Un.exec(ae))+"g")),ae.lastIndex=0;Rt=ae.exec(Nt);)var Vt=Rt.index;at=at.slice(0,Vt===J?Ye:Vt)}}else if(u.indexOf(xo(ae),Ye)!=Ye){var en=at.lastIndexOf(ae);en>-1&&(at=at.slice(0,en))}return at+N},Se.unescape=function(u){return(u=Oi(u))&&ps.test(u)?u.replace(wl,Dm):u},Se.uniqueId=function(u){var h=++xP;return Oi(u)+h},Se.upperCase=Z0,Se.upperFirst=Fp,Se.each=x_,Se.eachRight=Cp,Se.first=Kb,Z_(Se,function(){var u={};return Ya(Se,function(h,m){ji.call(Se.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),Se.VERSION="4.17.21",Ps(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){Se[u].placeholder=Se}),Ps(["drop","take"],function(u,h){ri.prototype[u]=function(m){m=m===J?1:Lr(Kn(m),0);var N=this.__filtered__&&!h?new ri(this):this.clone();return N.__filtered__?N.__takeCount__=ls(m,N.__takeCount__):N.__views__.push({size:ls(m,ye),type:u+(N.__dir__<0?"Right":"")}),N},ri.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),Ps(["filter","map","takeWhile"],function(u,h){var m=h+1,N=1==m||3==m;ri.prototype[u]=function(ae){var Ce=this.clone();return Ce.__iteratees__.push({iteratee:On(ae,3),type:m}),Ce.__filtered__=Ce.__filtered__||N,Ce}}),Ps(["head","last"],function(u,h){var m="take"+(h?"Right":"");ri.prototype[u]=function(){return this[m](1).value()[0]}}),Ps(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");ri.prototype[u]=function(){return this.__filtered__?new ri(this):this[m](1)}}),ri.prototype.compact=function(){return this.filter(Xs)},ri.prototype.find=function(u){return this.filter(u).head()},ri.prototype.findLast=function(u){return this.reverse().find(u)},ri.prototype.invokeMap=si(function(u,h){return"function"==typeof u?new ri(this):this.map(function(m){return va(m,u,h)})}),ri.prototype.reject=function(u){return this.filter(I_(On(u)))},ri.prototype.slice=function(u,h){u=Kn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new ri(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==J&&(m=(h=Kn(h))<0?m.dropRight(-h):m.take(h-u)),m)},ri.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},ri.prototype.toArray=function(){return this.take(ye)},Ya(ri.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),N=/^(?:head|last)$/.test(h),ae=Se[N?"take"+("last"==h?"Right":""):h],Ce=N||/^find/.test(h);!ae||(Se.prototype[h]=function(){var ze=this.__wrapped__,Ye=N?[1]:arguments,at=ze instanceof ri,Rt=Ye[0],Nt=at||Tn(ze),Vt=function(ai){var vi=ae.apply(Se,Fr([ai],Ye));return N&&en?vi[0]:vi};Nt&&m&&"function"==typeof Rt&&1!=Rt.length&&(at=Nt=!1);var en=this.__chain__,vn=!!this.__actions__.length,Nn=Ce&&!en,oi=at&&!vn;if(!Ce&&Nt){ze=oi?ze:new ri(this);var Fn=u.apply(ze,Ye);return Fn.__actions__.push({func:Md,args:[Vt],thisArg:J}),new So(Fn,en)}return Nn&&oi?u.apply(this,Ye):(Fn=this.thru(Vt),Nn?N?Fn.value()[0]:Fn.value():Fn)})}),Ps(["pop","push","shift","sort","splice","unshift"],function(u){var h=ir[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",N=/^(?:pop|shift)$/.test(u);Se.prototype[u]=function(){var ae=arguments;if(N&&!this.__chain__){var Ce=this.value();return h.apply(Tn(Ce)?Ce:[],ae)}return this[m](function(ze){return h.apply(Tn(ze)?ze:[],ae)})}}),Ya(ri.prototype,function(u,h){var m=Se[h];if(m){var N=m.name+"";ji.call(dd,N)||(dd[N]=[]),dd[N].push({name:h,func:m})}}),dd[bc(J,2).name]=[{name:"wrapper",func:J}],ri.prototype.clone=function(){var u=new ri(this.__wrapped__);return u.__actions__=qs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=qs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=qs(this.__views__),u},ri.prototype.reverse=function(){if(this.__filtered__){var u=new ri(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},ri.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Tn(u),N=h<0,ae=m?u.length:0,Ce=function(u,h,m){for(var N=-1,ae=m.length;++N=this.__values__.length;return{done:u,value:u?J:this.__values__[this.__index__++]}},Se.prototype.plant=function(u){for(var h,m=this;m instanceof Th;){var N=wp(m);N.__index__=0,N.__values__=J,h?ae.__wrapped__=N:h=N;var ae=N;m=m.__wrapped__}return ae.__wrapped__=u,h},Se.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof ri){var h=u;return this.__actions__.length&&(h=new ri(this)),(h=h.reverse()).__actions__.push({func:Md,args:[__],thisArg:J}),new So(h,this.__chain__)}return this.thru(__)},Se.prototype.toJSON=Se.prototype.valueOf=Se.prototype.value=function(){return e1(this.__wrapped__,this.__actions__)},Se.prototype.first=Se.prototype.head,wh&&(Se.prototype[wh]=function(){return this}),Se}();Ii._=vh,(gt=function(){return vh}.call(it,tt,it,jt))!==J&&(jt.exports=gt)}.call(this)},478:function(jt){jt.exports=function(){"use strict";function it(rt,ot){for(var ct=0;ctrt.length)&&(ot=rt.length);for(var ct=0,fe=new Array(ot);ct=rt.length?{done:!0}:{done:!1,value:rt[fe++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var ut={exports:{}};function Y(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}ut.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:Y,changeDefaults:function(rt){ut.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,re={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(ot){return re[ot]};var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function R(rt){return rt.replace(S,function(ot,ct){return"colon"===(ct=ct.toLowerCase())?":":"#"===ct.charAt(0)?"x"===ct.charAt(1)?String.fromCharCode(parseInt(ct.substring(2),16)):String.fromCharCode(+ct.substring(1)):""})}var A=/(^|[^\[])\^/g;var y=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var j={},I=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;function M(rt,ot){j[" "+rt]||(j[" "+rt]=I.test(rt)?rt+"/":U(rt,"/",!0));var ct=-1===(rt=j[" "+rt]).indexOf(":");return"//"===ot.substring(0,2)?ct?ot:rt.replace(H,"$1")+ot:"/"===ot.charAt(0)?ct?ot:rt.replace(K,"$1")+ot:rt+ot}function U(rt,ot,ct){var fe=rt.length;if(0===fe)return"";for(var ve=0;ve1;)1&ot&&(ct+=rt),ot>>=1,rt+=rt;return ct+rt},Te=ut.exports.defaults,me=U,te=function(rt,ot){var fe=rt.replace(/\|/g,function(ke,lt,Qe){for(var vt=!1,St=lt;--St>=0&&"\\"===Qe[St];)vt=!vt;return vt?"|":" |"}).split(/ \|/),ve=0;if(fe.length>ot)fe.splice(ot);else for(;fe.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},ot.code=function(fe){var ve=this.rules.block.code.exec(fe);if(ve){var ke=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:me(ke,"\n")}}},ot.fences=function(fe){var ve=this.rules.block.fences.exec(fe);if(ve){var ke=ve[0],lt=function(rt,ot){var ct=rt.match(/^(\s+)(?:```)/);if(null===ct)return ot;var fe=ct[1];return ot.split("\n").map(function(ve){var ke=ve.match(/^\s+/);return null===ke?ve:ke[0].length>=fe.length?ve.slice(fe.length):ve}).join("\n")}(ke,ve[3]||"");return{type:"code",raw:ke,lang:ve[2]?ve[2].trim():ve[2],text:lt}}},ot.heading=function(fe){var ve=this.rules.block.heading.exec(fe);if(ve){var ke=ve[2].trim();if(/#$/.test(ke)){var lt=me(ke,"#");(this.options.pedantic||!lt||/ $/.test(lt))&&(ke=lt.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:ke}}},ot.nptable=function(fe){var ve=this.rules.block.nptable.exec(fe);if(ve){var ke={type:"table",header:te(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(ke.header.length===ke.align.length){var Qe,lt=ke.align.length;for(Qe=0;Qe ?/gm,"");return{type:"blockquote",raw:ve[0],text:ke}}},ot.list=function(fe){var ve=this.rules.block.list.exec(fe);if(ve){var qt,Bn,ti,Mn,pn,Un,En,Qi,Zi,ke=ve[0],lt=ve[2],Qe=lt.length>1,vt={type:"list",raw:ke,ordered:Qe,start:Qe?+lt.slice(0,-1):"",loose:!1,items:[]},St=ve[0].match(this.rules.block.item),At=!1,Wn=St.length;ti=this.rules.block.listItemStart.exec(St[0]);for(var Fi=0;Fiti[1].length:Mn[1].length>=ti[0].length||Mn[1].length>3){St.splice(Fi,2,St[Fi]+(!this.options.pedantic&&Mn[1].length/i.test(lt[0])&&(ve=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(lt[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(lt[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:lt[0],inLink:ve,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(lt[0]):ye(lt[0]):lt[0]}},ot.link=function(fe){var ve=this.rules.inline.link.exec(fe);if(ve){var ke=ve[2].trim();if(!this.options.pedantic&&/^$/.test(ke))return;var lt=me(ke.slice(0,-1),"\\");if((ke.length-lt.length)%2==0)return}else{var Qe=Me(ve[2],"()");if(Qe>-1){var St=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Qe;ve[2]=ve[2].substring(0,Qe),ve[0]=ve[0].substring(0,St).trim(),ve[3]=""}}var At=ve[2],qt="";if(this.options.pedantic){var Bn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(At);Bn&&(At=Bn[1],qt=Bn[3])}else qt=ve[3]?ve[3].slice(1,-1):"";return At=At.trim(),/^$/.test(ke)?At.slice(1):At.slice(1,-1)),Ve(ve,{href:At&&At.replace(this.rules.inline._escapes,"$1"),title:qt&&qt.replace(this.rules.inline._escapes,"$1")},ve[0])}},ot.reflink=function(fe,ve){var ke;if((ke=this.rules.inline.reflink.exec(fe))||(ke=this.rules.inline.nolink.exec(fe))){var lt=(ke[2]||ke[1]).replace(/\s+/g," ");if(!(lt=ve[lt.toLowerCase()])||!lt.href){var Qe=ke[0].charAt(0);return{type:"text",raw:Qe,text:Qe}}return Ve(ke,lt,ke[0])}},ot.emStrong=function(fe,ve,ke){void 0===ke&&(ke="");var lt=this.rules.inline.emStrong.lDelim.exec(fe);if(lt&&(!lt[3]||!ke.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Qe=lt[1]||lt[2]||"";if(!Qe||Qe&&(""===ke||this.rules.inline.punctuation.exec(ke))){var St,At,vt=lt[0].length-1,qt=vt,Bn=0,ti="*"===lt[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ti.lastIndex=0,ve=ve.slice(-1*fe.length+vt);null!=(lt=ti.exec(ve));)if(St=lt[1]||lt[2]||lt[3]||lt[4]||lt[5]||lt[6]){if(At=St.length,lt[3]||lt[4]){qt+=At;continue}if((lt[5]||lt[6])&&vt%3&&!((vt+At)%3)){Bn+=At;continue}if(!((qt-=At)>0))return At=Math.min(At,At+qt+Bn),Math.min(vt,At)%2?{type:"em",raw:fe.slice(0,vt+lt.index+At+1),text:fe.slice(1,vt+lt.index+At)}:{type:"strong",raw:fe.slice(0,vt+lt.index+At+1),text:fe.slice(2,vt+lt.index+At-1)}}}}},ot.codespan=function(fe){var ve=this.rules.inline.code.exec(fe);if(ve){var ke=ve[2].replace(/\n/g," "),lt=/[^ ]/.test(ke),Qe=/^ /.test(ke)&&/ $/.test(ke);return lt&&Qe&&(ke=ke.substring(1,ke.length-1)),ke=ye(ke,!0),{type:"codespan",raw:ve[0],text:ke}}},ot.br=function(fe){var ve=this.rules.inline.br.exec(fe);if(ve)return{type:"br",raw:ve[0]}},ot.del=function(fe){var ve=this.rules.inline.del.exec(fe);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},ot.autolink=function(fe,ve){var lt,Qe,ke=this.rules.inline.autolink.exec(fe);if(ke)return Qe="@"===ke[2]?"mailto:"+(lt=ye(this.options.mangle?ve(ke[1]):ke[1])):lt=ye(ke[1]),{type:"link",raw:ke[0],text:lt,href:Qe,tokens:[{type:"text",raw:lt,text:lt}]}},ot.url=function(fe,ve){var ke;if(ke=this.rules.inline.url.exec(fe)){var lt,Qe;if("@"===ke[2])Qe="mailto:"+(lt=ye(this.options.mangle?ve(ke[0]):ke[0]));else{var vt;do{vt=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0]}while(vt!==ke[0]);lt=ye(ke[0]),Qe="www."===ke[1]?"http://"+lt:lt}return{type:"link",raw:ke[0],text:lt,href:Qe,tokens:[{type:"text",raw:lt,text:lt}]}}},ot.inlineText=function(fe,ve,ke){var Qe,lt=this.rules.inline.text.exec(fe);if(lt)return Qe=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(lt[0]):ye(lt[0]):lt[0]:ye(this.options.smartypants?ke(lt[0]):lt[0]),{type:"text",raw:lt[0],text:Qe}},rt}(),Je=se_noopTest,Ke=se_edit,je=se_merge,Le={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Je,table:Je,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Le.def=Ke(Le.def).replace("label",Le._label).replace("title",Le._title).getRegex(),Le.bullet=/(?:[*+-]|\d{1,9}[.)])/,Le.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Le.item=Ke(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Ke(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Ke(Le.list).replace(/bull/g,Le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Le.def.source+")").getRegex(),Le._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Le._comment=/|$)/,Le.html=Ke(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Ke(Le._paragraph).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.blockquote=Ke(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=je({},Le),Le.gfm=je({},Le.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Le.gfm.nptable=Ke(Le.gfm.nptable).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.gfm.table=Ke(Le.gfm.table).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.pedantic=je({},Le.normal,{html:Ke("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Je,paragraph:Ke(Le.normal._paragraph).replace("hr",Le.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ee.punctuation=Ke(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ee.escapedEmSt=/\\\*|\\_/g,Ee._comment=Ke(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ee.emStrong.lDelim=Ke(Ee.emStrong.lDelim).replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimAst=Ke(Ee.emStrong.rDelimAst,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimUnd=Ke(Ee.emStrong.rDelimUnd,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ee.autolink=Ke(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Ke(Ee.tag).replace("comment",Ee._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Ke(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Ke(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Ke(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=je({},Ee),Ee.pedantic=je({},Ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ke(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee._label).getRegex(),reflink:Ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=je({},Ee.normal,{escape:Ke(Ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(fe="x"+fe.toString(16)),ot+="&#"+fe+";";return ot}var Pe=function(){function rt(ct){this.tokens=[],this.tokens.links=Object.create(null),this.options=ct||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var fe={block:Be.normal,inline:z.normal};this.options.pedantic?(fe.block=Be.pedantic,fe.inline=z.pedantic):this.options.gfm&&(fe.block=Be.gfm,fe.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=fe}rt.lex=function(fe,ve){return new rt(ve).lex(fe)},rt.lexInline=function(fe,ve){return new rt(ve).inlineTokens(fe)};var ot=rt.prototype;return ot.lex=function(fe){return fe=fe.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(fe,this.tokens,!0),this.inline(this.tokens),this.tokens},ot.blockTokens=function(fe,ve,ke){var Qe,vt,St,At,qt,Bn,lt=this;for(void 0===ve&&(ve=[]),void 0===ke&&(ke=!0),this.options.pedantic&&(fe=fe.replace(/^ +$/gm,""));fe;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Mn){return!!(Qe=Mn.call(lt,fe,ve))&&(fe=fe.substring(Qe.raw.length),ve.push(Qe),!0)}))){if(Qe=this.tokenizer.space(fe)){fe=fe.substring(Qe.raw.length),Qe.type&&ve.push(Qe);continue}if(Qe=this.tokenizer.code(fe)){fe=fe.substring(Qe.raw.length),(At=ve[ve.length-1])&&"paragraph"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe);continue}if(Qe=this.tokenizer.fences(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.heading(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.nptable(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.hr(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.blockquote(fe)){fe=fe.substring(Qe.raw.length),Qe.tokens=this.blockTokens(Qe.text,[],ke),ve.push(Qe);continue}if(Qe=this.tokenizer.list(fe)){for(fe=fe.substring(Qe.raw.length),St=Qe.items.length,vt=0;vt=0&&(Mn=Math.min(Mn,Un))}),Mn<1/0&&Mn>=0&&(qt=fe.substring(0,Mn+1))}(),ke&&(Qe=this.tokenizer.paragraph(qt))){At=ve[ve.length-1],Bn&&"paragraph"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe),Bn=qt.length!==fe.length,fe=fe.substring(Qe.raw.length);continue}if(Qe=this.tokenizer.text(fe)){fe=fe.substring(Qe.raw.length),(At=ve[ve.length-1])&&"text"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe);continue}if(fe){var ti="Infinite loop on byte: "+fe.charCodeAt(0);if(this.options.silent){console.error(ti);break}throw new Error(ti)}}return ve},ot.inline=function(fe){var ve,ke,lt,Qe,vt,St,At=fe.length;for(ve=0;ve0)for(;null!=(Bn=this.tokenizer.rules.inline.reflinkSearch.exec(qt));)pn.includes(Bn[0].slice(Bn[0].lastIndexOf("[")+1,-1))&&(qt=qt.slice(0,Bn.index)+"["+X("a",Bn[0].length-2)+"]"+qt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(Bn=this.tokenizer.rules.inline.blockSkip.exec(qt));)qt=qt.slice(0,Bn.index)+"["+X("a",Bn[0].length-2)+"]"+qt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(Bn=this.tokenizer.rules.inline.escapedEmSt.exec(qt));)qt=qt.slice(0,Bn.index)+"++"+qt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;fe;)if(ti||(Mn=""),ti=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(En){return!!(vt=En.call(Qe,fe,ve))&&(fe=fe.substring(vt.raw.length),ve.push(vt),!0)}))){if(vt=this.tokenizer.escape(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.tag(fe,ke,lt)){fe=fe.substring(vt.raw.length),ke=vt.inLink,lt=vt.inRawBlock,(St=ve[ve.length-1])&&"text"===vt.type&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.link(fe)){fe=fe.substring(vt.raw.length),"link"===vt.type&&(vt.tokens=this.inlineTokens(vt.text,[],!0,lt)),ve.push(vt);continue}if(vt=this.tokenizer.reflink(fe,this.tokens.links)){fe=fe.substring(vt.raw.length),St=ve[ve.length-1],"link"===vt.type?(vt.tokens=this.inlineTokens(vt.text,[],!0,lt),ve.push(vt)):St&&"text"===vt.type&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.emStrong(fe,qt,Mn)){fe=fe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,lt),ve.push(vt);continue}if(vt=this.tokenizer.codespan(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.br(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.del(fe)){fe=fe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,lt),ve.push(vt);continue}if(vt=this.tokenizer.autolink(fe,ce)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(!ke&&(vt=this.tokenizer.url(fe,ce))){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(At=fe,this.options.extensions&&this.options.extensions.startInline&&function(){var En=1/0,Qi=fe.slice(1),Zi=void 0;Qe.options.extensions.startInline.forEach(function(Wn){"number"==typeof(Zi=Wn.call(this,Qi))&&Zi>=0&&(En=Math.min(En,Zi))}),En<1/0&&En>=0&&(At=fe.substring(0,En+1))}(),vt=this.tokenizer.inlineText(At,lt,be)){fe=fe.substring(vt.raw.length),"_"!==vt.raw.slice(-1)&&(Mn=vt.raw.slice(-1)),ti=!0,(St=ve[ve.length-1])&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(fe){var Un="Infinite loop on byte: "+fe.charCodeAt(0);if(this.options.silent){console.error(Un);break}throw new Error(Un)}}return ve},function(rt,ot,ct){ot&&it(rt.prototype,ot),ct&&it(rt,ct)}(rt,null,[{key:"rules",get:function(){return{block:Be,inline:z}}}]),rt}(),Et=ut.exports.defaults,pt=se_cleanUrl,pe=se_escape,B=function(){function rt(ct){this.options=ct||Et}var ot=rt.prototype;return ot.code=function(fe,ve,ke){var lt=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Qe=this.options.highlight(fe,lt);null!=Qe&&Qe!==fe&&(ke=!0,fe=Qe)}return fe=fe.replace(/\n$/,"")+"\n",lt?'
    '+(ke?fe:pe(fe,!0))+"
    \n":"
    "+(ke?fe:pe(fe,!0))+"
    \n"},ot.blockquote=function(fe){return"
    \n"+fe+"
    \n"},ot.html=function(fe){return fe},ot.heading=function(fe,ve,ke,lt){return this.options.headerIds?"'+fe+"\n":""+fe+"\n"},ot.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},ot.list=function(fe,ve,ke){var lt=ve?"ol":"ul";return"<"+lt+(ve&&1!==ke?' start="'+ke+'"':"")+">\n"+fe+"\n"},ot.listitem=function(fe){return"
  • "+fe+"
  • \n"},ot.checkbox=function(fe){return" "},ot.paragraph=function(fe){return"

    "+fe+"

    \n"},ot.table=function(fe,ve){return ve&&(ve=""+ve+""),"\n\n"+fe+"\n"+ve+"
    \n"},ot.tablerow=function(fe){return"\n"+fe+"\n"},ot.tablecell=function(fe,ve){var ke=ve.header?"th":"td";return(ve.align?"<"+ke+' align="'+ve.align+'">':"<"+ke+">")+fe+"\n"},ot.strong=function(fe){return""+fe+""},ot.em=function(fe){return""+fe+""},ot.codespan=function(fe){return""+fe+""},ot.br=function(){return this.options.xhtml?"
    ":"
    "},ot.del=function(fe){return""+fe+""},ot.link=function(fe,ve,ke){if(null===(fe=pt(this.options.sanitize,this.options.baseUrl,fe)))return ke;var lt='"+ke+""},ot.image=function(fe,ve,ke){if(null===(fe=pt(this.options.sanitize,this.options.baseUrl,fe)))return ke;var lt=''+ke+'":">")},ot.text=function(fe){return fe},rt}(),O=function(){function rt(){}var ot=rt.prototype;return ot.strong=function(fe){return fe},ot.em=function(fe){return fe},ot.codespan=function(fe){return fe},ot.del=function(fe){return fe},ot.html=function(fe){return fe},ot.text=function(fe){return fe},ot.link=function(fe,ve,ke){return""+ke},ot.image=function(fe,ve,ke){return""+ke},ot.br=function(){return""},rt}(),k=function(){function rt(){this.seen={}}var ot=rt.prototype;return ot.serialize=function(fe){return fe.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ot.getNextSafeSlug=function(fe,ve){var ke=fe,lt=0;if(this.seen.hasOwnProperty(ke)){lt=this.seen[fe];do{ke=fe+"-"+ ++lt}while(this.seen.hasOwnProperty(ke))}return ve||(this.seen[fe]=lt,this.seen[ke]=0),ke},ot.slug=function(fe,ve){void 0===ve&&(ve={});var ke=this.serialize(fe);return this.getNextSafeSlug(ke,ve.dryrun)},rt}(),Re=B,Xe=O,yt=k,It=ut.exports.defaults,An=se_unescape,Hn=Pe,yi=function(){function rt(ct){this.options=ct||It,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new yt}rt.parse=function(fe,ve){return new rt(ve).parse(fe)},rt.parseInline=function(fe,ve){return new rt(ve).parseInline(fe)};var ot=rt.prototype;return ot.parse=function(fe,ve){void 0===ve&&(ve=!0);var lt,Qe,vt,St,At,qt,Bn,ti,Mn,pn,Un,En,Qi,Zi,Wn,Fi,ca,Hr,ne,ke="",de=fe.length;for(lt=0;lt0&&"text"===Wn.tokens[0].type?(Wn.tokens[0].text=Hr+" "+Wn.tokens[0].text,Wn.tokens[0].tokens&&Wn.tokens[0].tokens.length>0&&"text"===Wn.tokens[0].tokens[0].type&&(Wn.tokens[0].tokens[0].text=Hr+" "+Wn.tokens[0].tokens[0].text)):Wn.tokens.unshift({type:"text",text:Hr}):Zi+=Hr),Zi+=this.parse(Wn.tokens,Qi),Mn+=this.renderer.listitem(Zi,ca,Fi);ke+=this.renderer.list(Mn,Un,En);continue;case"html":ke+=this.renderer.html(pn.text);continue;case"paragraph":ke+=this.renderer.paragraph(this.parseInline(pn.tokens));continue;case"text":for(Mn=pn.tokens?this.parseInline(pn.tokens):pn.text;lt+1An error occurred:

    "+Va(vt.message+"",!0)+"
    ";throw vt}}return Zt.options=Zt.setOptions=function(rt){return Os(Zt.defaults,rt),la(Zt.defaults),Zt},Zt.getDefaults=wl,Zt.defaults=ps,Zt.use=function(){for(var rt=this,ot=arguments.length,ct=new Array(ot),fe=0;feAn error occurred:

    "+Va(fe.message+"",!0)+"
    ";throw fe}},Zt.Parser=yi,Zt.parser=yi.parse,Zt.Renderer=Ur,Zt.TextRenderer=Is,Zt.Lexer=Hn,Zt.lexer=Hn.lex,Zt.Tokenizer=ci,Zt.Slugger=as,Zt.parse=Zt,Zt}()},369:(jt,it,tt)=>{var gt=tt(284),J=tt(830);function xt(){this.clear()}xt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},xt.prototype.enqueue=function(ut){return this.items.push(ut),++this.size},xt.prototype.dequeue=function(){if(this.size){var ut=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,ut}},xt.prototype.peek=function(){if(this.size)return this.items[this.offset]},xt.prototype.forEach=function(ut,Y){Y=arguments.length>1?Y:this;for(var Ae=this.offset,he=0,W=this.items.length;Ae=ut.length)return{done:!0};var Ae=ut[Y];return Y++,{value:Ae,done:!1}})},xt.prototype.entries=function(){var ut=this.items,Y=this.offset,Ae=0;return new gt(function(){if(Y>=ut.length)return{done:!0};var he=ut[Y];return Y++,{value:[Ae++,he],done:!1}})},"undefined"!=typeof Symbol&&(xt.prototype[Symbol.iterator]=xt.prototype.values),xt.prototype.toString=function(){return this.toArray().join(",")},xt.prototype.toJSON=function(){return this.toArray()},xt.prototype.inspect=function(){var ut=this.toArray();return Object.defineProperty(ut,"constructor",{value:xt,enumerable:!1}),ut},"undefined"!=typeof Symbol&&(xt.prototype[Symbol.for("nodejs.util.inspect.custom")]=xt.prototype.inspect),xt.from=function(ut){var Y=new xt;return J(ut,function(Ae){Y.enqueue(Ae)}),Y},xt.of=function(){return xt.from(arguments)},jt.exports=xt},830:jt=>{var it="undefined"!=typeof ArrayBuffer,tt="undefined"!=typeof Symbol;function gt(J,xt){var ut,Y,Ae,he,W;if(!J)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof xt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(J)||it&&ArrayBuffer.isView(J)||"string"==typeof J||"[object Arguments]"===J.toString())for(Ae=0,he=J.length;Ae{function it(tt){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:tt}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var tt=this._next();return tt.done&&(this.done=!0),tt},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var tt=arguments,gt=tt.length,J=0;return new it(function(){return J>=gt?{done:!0}:{done:!1,value:tt[J++]}})},it.empty=function(){var tt=new it(null);return tt.done=!0,tt},it.is=function(tt){return tt instanceof it||"object"==typeof tt&&null!==tt&&"function"==typeof tt.next},jt.exports=it},310:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==J.window.orientation},it.default=function(he){if(!he&&!(0,xt.default)())return"Node";if((0,ut.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},V=he||W.userAgent||"";if(V.indexOf("Edge")>-1)return"Edge";var L=-1!==V.indexOf("MSIE "),re=-1!==V.indexOf("Trident/");return L||re?"IE":J.window.chrome?"Chrome":J.window.safari?"Safari":J.window.mozInnerScreenX?"Firefox":"Unknown"};var J=tt(151),xt=gt(tt(602)),ut=gt(tt(344))},151:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var J=gt(tt(321)),xt={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&process};it.self=xt.self||xt.window||xt.global,it.window=xt.window||xt.self||xt.global,it.global=xt.global||xt.self||xt.window,it.document=xt.document||{},it.process=xt.process||{};var V=console;it.console=V},761:(jt,it,tt)=>{"use strict";var J=tt(948),xt=tt(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return ut.global}}),Object.defineProperty(it,"jU",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Ae.default}});var ut=tt(151),Y=V(tt(602)),Ae=V(tt(310));J(tt(344));function W(L){if("function"!=typeof WeakMap)return null;var re=new WeakMap,$=new WeakMap;return(W=function(S){return S?$:re})(L)}function V(L,re){if(!re&&L&&L.__esModule)return L;if(null===L||"object"!==xt(L)&&"function"!=typeof L)return{default:L};var $=W(re);if($&&$.has(L))return $.get(L);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in L)if("default"!==R&&Object.prototype.hasOwnProperty.call(L,R)){var A=S?Object.getOwnPropertyDescriptor(L,R):null;A&&(A.get||A.set)?Object.defineProperty(b,R,A):b[R]=L[R]}return b.default=L,$&&$.set(L,b),b}},602:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=ut,it.isBrowserMainThread=function(){return ut()&&"undefined"!=typeof document};var J=gt(tt(321)),xt=gt(tt(344));function ut(){return!("object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,xt.default)()}},344:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(ut){if("undefined"!=typeof window&&"object"===(0,J.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,J.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,J.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Ae=ut||Y;return!!(Ae&&Ae.indexOf("Electron")>=0)};var J=gt(tt(321))},991:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),Object.defineProperty(xt,Ae,{enumerable:!0,get:function(){return ut[Y]}})}:function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),xt[Ae]=ut[Y]}),J=this&&this.__exportStar||function(xt,ut){for(var Y in xt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(ut,Y)&>(ut,xt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(180),it),J(tt(103),it),J(tt(965),it),J(tt(595),it),J(tt(417),it),J(tt(451),it),J(tt(735),it)},180:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(J){this.termType="BlankNode",this.value=J}equals(J){return!!J&&"BlankNode"===J.termType&&J.value===this.value}}},103:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const gt=tt(180),J=tt(965),xt=tt(595),ut=tt(417),Y=tt(451),Ae=tt(735);let he=0;it.DataFactory=class{constructor(L){this.blankNodeCounter=0,this.blankNodePrefix=(L=L||{}).blankNodePrefix||`df_${he++}_`}namedNode(L){return new ut.NamedNode(L)}blankNode(L){return new gt.BlankNode(L||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(L,re){return new xt.Literal(L,re)}variable(L){return new Ae.Variable(L)}defaultGraph(){return J.DefaultGraph.INSTANCE}quad(L,re,$,b){return new Y.Quad(L,re,$,b||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(xt.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}}},965:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class tt{constructor(){this.termType="DefaultGraph",this.value=""}equals(J){return!!J&&"DefaultGraph"===J.termType}}it.DefaultGraph=tt,tt.INSTANCE=new tt},595:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const gt=tt(417);class J{constructor(ut,Y){this.termType="Literal",this.value=ut,"string"==typeof Y?(this.language=Y,this.datatype=J.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=J.XSD_STRING)}equals(ut){return!!ut&&"Literal"===ut.termType&&ut.value===this.value&&ut.language===this.language&&ut.datatype.equals(this.datatype)}}it.Literal=J,J.RDF_LANGUAGE_STRING=new gt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),J.XSD_STRING=new gt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(J){this.termType="NamedNode",this.value=J}equals(J){return!!J&&"NamedNode"===J.termType&&J.value===this.value}}},451:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(J,xt,ut,Y){this.termType="Quad",this.value="",this.subject=J,this.predicate=xt,this.object=ut,this.graph=Y}equals(J){return!!J&&("Quad"===J.termType||!J.termType)&&this.subject.equals(J.subject)&&this.predicate.equals(J.predicate)&&this.object.equals(J.object)&&this.graph.equals(J.graph)}}},735:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(J){this.termType="Variable",this.value=J}equals(J){return!!J&&"Variable"===J.termType&&J.value===this.value}}},609:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(b,S,R,A){void 0===A&&(A=R),Object.defineProperty(b,A,{enumerable:!0,get:function(){return S[R]}})}:function(b,S,R,A){void 0===A&&(A=R),b[A]=S[R]}),J=this&&this.__exportStar||function(b,S){for(var R in b)"default"!==R&&!Object.prototype.hasOwnProperty.call(S,R)&>(S,b,R)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const xt=tt(991),ut=tt(938),Y=tt(60);J(tt(938),it),J(tt(871),it),J(tt(60),it);const Ae=new xt.DataFactory,he=new Y.Translator;function W(b,S){return he.fromRdf(b,S)}he.registerHandler(new ut.TypeHandlerString,ut.TypeHandlerString.TYPES.map(b=>Ae.namedNode(b)),["string"]),he.registerHandler(new ut.TypeHandlerBoolean,[ut.TypeHandlerBoolean.TYPE].map(b=>Ae.namedNode(b)),["boolean"]),he.registerHandler(new ut.TypeHandlerNumberDouble,ut.TypeHandlerNumberDouble.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new ut.TypeHandlerNumberInteger,ut.TypeHandlerNumberInteger.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new ut.TypeHandlerDate,ut.TypeHandlerDate.TYPES.map(b=>Ae.namedNode(b)),["object"]),it.fromRdf=W,it.toRdf=function(b,S){return S&&"namedNode"in S&&(S={dataFactory:S}),(S=S||{})&&!S.dataFactory&&(S.dataFactory=Ae),he.toRdf(b,S)},it.getTermRaw=function(b,S){return"Literal"===b.termType?W(b,S):b.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Translator=void 0,it.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(J){throw new Error(`Invalid RDF ${J.datatype.value} value: '${J.value}'`)}registerHandler(J,xt,ut){for(const Y of xt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=J;for(const Y of ut){let Ae=this.toRdfHandlers[Y];Ae||(this.toRdfHandlers[Y]=Ae=[]),Ae.push(J)}}fromRdf(J,xt){const ut=this.fromRdfHandlers[J.datatype.value];return ut?ut.fromRdf(J,xt):J.value}toRdf(J,xt){const ut=this.toRdfHandlers[typeof J];if(ut)for(const Y of ut){const Ae=Y.toRdf(J,xt);if(Ae)return Ae}throw new Error(`Invalid JavaScript value: '${J}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const gt=tt(60);class J{fromRdf(ut,Y){switch(ut.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&>.Translator.incorrectRdfDataType(ut),!1}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Ae.literal(ut?"true":"false",Y||Ae.namedNode(J.TYPE))}}it.TypeHandlerBoolean=J,J.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const gt=tt(60);class J{fromRdf(ut,Y){switch(Y&&!ut.value.match(J.VALIDATORS[ut.datatype.value.substr(33,ut.datatype.value.length)])&>.Translator.incorrectRdfDataType(ut),ut.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(ut.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const Ae=ut.value.split("-");return new Date(0,parseInt(Ae[0],10)-1,parseInt(Ae[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(ut.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(ut.value+"-01");default:return new Date(ut.value)}}toRdf(ut,{datatype:Y,dataFactory:Ae}){if(Y=Y||Ae.namedNode(J.TYPES[0]),!(ut instanceof Date))return null;const he=ut;let W;switch(Y.value){case"http://www.w3.org/2001/XMLSchema#gDay":W=String(he.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":W=he.getUTCMonth()+1+"-"+he.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":W=String(he.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":W=he.getUTCFullYear()+"-"+(he.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":W=he.toISOString().replace(/T.*$/,"");break;default:W=he.toISOString()}return Ae.literal(W,Y)}}it.TypeHandlerDate=J,J.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"],J.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]$/}},554:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const gt=tt(60);class J{fromRdf(ut,Y){const Ae=parseFloat(ut.value);return Y&&isNaN(Ae)&>.Translator.incorrectRdfDataType(ut),Ae}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Y=Y||Ae.namedNode(J.TYPES[0]),isNaN(ut)?Ae.literal("NaN",Y):isFinite(ut)?ut%1==0?null:Ae.literal(ut.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Ae.literal(ut>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=J,J.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const gt=tt(60);class J{fromRdf(ut,Y){const Ae=parseInt(ut.value,10);return Y&&(isNaN(Ae)||ut.value.indexOf(".")>=0)&>.Translator.incorrectRdfDataType(ut),Ae}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Ae.literal(String(ut),Y||Ae.namedNode(ut<=J.MAX_INT&&ut>=J.MIN_INT?J.TYPES[0]:J.TYPES[1]))}}it.TypeHandlerNumberInteger=J,J.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"],J.MAX_INT=2147483647,J.MIN_INT=-2147483648},608:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class tt{fromRdf(J){return J.value}toRdf(J,{datatype:xt,dataFactory:ut}){return ut.literal(J,xt)}}it.TypeHandlerString=tt,tt.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/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},938:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),Object.defineProperty(xt,Ae,{enumerable:!0,get:function(){return ut[Y]}})}:function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),xt[Ae]=ut[Y]}),J=this&&this.__exportStar||function(xt,ut){for(var Y in xt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(ut,Y)&>(ut,xt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(727),it),J(tt(525),it),J(tt(554),it),J(tt(750),it),J(tt(608),it)},289:(jt,it,tt)=>{"use strict";var gt={};tt.r(gt),tt.d(gt,{decode:()=>Hge,encode:()=>Gge});var J={};tt.r(J),tt.d(J,{decode:()=>Kge,encode:()=>Xge});var xt={};tt.r(xt),tt.d(xt,{decode:()=>Qge,encode:()=>Zge});var ut={};function Y(n){return"function"==typeof n}tt.r(ut),tt.d(ut,{decode:()=>Jge,encode:()=>eme});let Ae=!1;const he={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else Ae&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ae=n},get useDeprecatedSynchronousErrorHandling(){return Ae}};function W(n){setTimeout(()=>{throw n},0)}const V={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},L=Array.isArray||(n=>n&&"number"==typeof n.length);function re(n){return null!==n&&"object"==typeof n}const b=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class S{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof S)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof b?t.errors:t),[])}S.EMPTY=((n=new S).closed=!0,n);const A="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends S{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=V;break;case 1:if(!e){this.destination=V;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,e,t,i)}}[A](){return this}static create(e,t,i){const r=new y(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class w extends y{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;Y(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==V&&(o=Object.create(t),Y(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;he.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=he;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):W(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;W(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);he.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),he.useDeprecatedSynchronousErrorHandling)throw i;W(i)}}__tryOrSetError(e,t,i){if(!he.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return he.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(W(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const I="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(n){return n}let F=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof y)return n;if(n[A])return n[A]()}return n||e||t?new y(n,e,t):new y(V)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||he.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),he.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){he.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof y?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=Q(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[I](){return this}pipe(...t){return 0===t.length?this:function(n){return 0===n.length?H:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}(t)(this)}toPromise(t){return new(t=Q(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function Q(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const U=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ie extends S{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class ue extends y{constructor(e){super(e),this.destination=e}}let ee=(()=>{class n extends F{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[A](){return new ue(this)}lift(t){const i=new se(this,this);return i.operator=t,i}next(t){if(this.closed)throw new U;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew se(e,t),n})();class se extends ee{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):S.EMPTY}}function Te(n){return n&&"function"==typeof n.schedule}function me(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new te(n,e))}}class te{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new ye(e,this.project,this.thisArg))}}class ye extends y{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const Me=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ee(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Oe=n=>{if(n&&"function"==typeof n[I])return(n=>e=>{const t=n[I]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(Le(n))return Me(n);if(Ee(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,W),e))(n);if(n&&"function"==typeof n[Ze])return(n=>e=>{const t=n[Ze]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${re(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Be(n,e){return new F(t=>{const i=new S;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function Pe(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[I]}(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>{const r=n[I]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(Ee(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(Le(n))return Be(n,e);if(function(n){return n&&"function"==typeof n[Ze]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new F(t=>{const i=new S;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Ze](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof F?n:new F(Oe(n))}class Et extends y{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class pe extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function O(n,e){if(e.closed)return;if(n instanceof F)return n.subscribe(e);let t;try{t=Oe(n)(e)}catch(i){e.error(i)}return t}function k(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(k((r,s)=>Pe(n(r,s)).pipe(me((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Re(n,t)))}class Re{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Xe(e,this.project,this.concurrent))}}class Xe extends pe{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function It(n=Number.POSITIVE_INFINITY){return k(H,n)}function An(n,e){return e?Be(n,e):new F(Me(n))}function Rn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Te(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof F?n[0]:It(e)(An(n,t))}function Hn(){return function(e){return e.lift(new yi(e))}}class yi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new ci(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class ci extends y{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Ur extends F{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new S,e.add(this.source.subscribe(new as(this.getSubject(),this))),e.closed&&(this._connection=null,e=S.EMPTY)),e}refCount(){return Hn()(this)}}const Is=(()=>{const n=Ur.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class as extends ue{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class wl{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function la(){return new ee}function ps(){return n=>Hn()(function(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new wl(r,e));const s=Object.create(i,Is);return s.source=i,s.subjectFactory=r,s}}(la)(n))}function Zt(n){for(let e in n)if(n[e]===Zt)return e;throw Error("Could not find renamed property on target object.")}function Ua(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function rt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(rt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ot(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ct=Zt({__forward_ref__:Zt});function fe(n){return n.__forward_ref__=fe,n.toString=function(){return rt(this())},n}function ve(n){return ke(n)?n():n}function ke(n){return"function"==typeof n&&n.hasOwnProperty(ct)&&n.__forward_ref__===fe}class Qe extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function At(n){return"string"==typeof n?n:null==n?"":String(n)}function qt(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():At(n)}function pn(n,e){const t=e?` in ${e}`:"";throw new Qe("201",`No provider for ${qt(n)} found${t}`)}function Z(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function $e(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function bt(n){return{providers:n.providers||[],imports:n.imports||[]}}function gn(n){return gs(n,io)||gs(n,Rs)}function gs(n,e){return n.hasOwnProperty(e)?n[e]:null}function El(n){return n&&(n.hasOwnProperty(Rr)||n.hasOwnProperty(lc))?n[Rr]:null}const io=Zt({\u0275prov:Zt}),Rr=Zt({\u0275inj:Zt}),Rs=Zt({ngInjectableDef:Zt}),lc=Zt({ngInjectorDef:Zt});var bn=(()=>((bn=bn||{})[bn.Default=0]="Default",bn[bn.Host=1]="Host",bn[bn.Self=2]="Self",bn[bn.SkipSelf=4]="SkipSelf",bn[bn.Optional=8]="Optional",bn))();let ro;function ua(n){const e=ro;return ro=n,e}function nd(n,e,t){const i=gn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&bn.Optional?null:void 0!==e?e:void pn(rt(n),"Injector")}function xe(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),$t=(()=>(($t=$t||{})[$t.Emulated=0]="Emulated",$t[$t.None=2]="None",$t[$t.ShadowDom=3]="ShadowDom",$t))();const ni="undefined"!=typeof globalThis&&globalThis,Nr="undefined"!=typeof window&&window,$r="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,ms="undefined"!=typeof global&&global,Jn=ni||ms||Nr||$r,id={},qi=[],Gf=Zt({\u0275cmp:Zt}),wm=Zt({\u0275dir:Zt}),hh=Zt({\u0275pipe:Zt}),ab=Zt({\u0275mod:Zt}),vx=Zt({\u0275loc:Zt}),Cl=Zt({\u0275fac:Zt}),fh=Zt({__NG_ELEMENT_ID__:Zt});let bx=0;function _n(n){return xe(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===He.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||qi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||$t.Emulated,id:"c",styles:n.styles||qi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=bx++,i.inputs=db(n.inputs,t),i.outputs=db(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(lb):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(cb):null,i})}function lb(n){return Ii(n)||function(n){return n[wm]||null}(n)}function cb(n){return function(n){return n[hh]||null}(n)}const ub={};function ln(n){return xe(()=>{const e={type:n.type,bootstrap:n.bootstrap||qi,declarations:n.declarations||qi,imports:n.imports||qi,exports:n.exports||qi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(ub[n.id]=n.type),e})}function db(n,e){if(null==n)return id;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const kt=_n;function Ns(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Ii(n){return n[Gf]||null}function bo(n,e){const t=n[ab]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function ko(n){return Array.isArray(n)&&"object"==typeof n[1]}function Bo(n){return Array.isArray(n)&&!0===n[1]}function Cm(n){return 0!=(8&n.flags)}function ad(n){return 2==(2&n.flags)}function ld(n){return 1==(1&n.flags)}function fa(n){return null!==n.template}function hb(n){return 0!=(512&n[2])}function dc(n,e){return n.hasOwnProperty(Cl)?n[Cl]:null}class Dm{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function ki(){return gb}function gb(n){return n.type.prototype.ngOnChanges&&(n.setInput=Dx),Tx}function Tx(){const n=st(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===id)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function Dx(n,e,t,i){const r=st(n)||function(n,e){return n[vh]=e}(n,{previous:id,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new Dm(l&&l.currentValue,e,o===id),n[i]=e}ki.ngInherit=!0;const vh="__ngSimpleChanges__";function st(n){return n[vh]||null}let Bi;function ir(n){return!!n.listen}const ru={createRenderer:(n,e)=>void 0!==Bi?Bi:"undefined"!=typeof document?document:void 0};function _r(n){for(;Array.isArray(n);)n=n[0];return n}function bh(n,e){return _r(e[n])}function $s(n,e){return _r(e[n.index])}function Om(n,e){return n.data[e]}function cd(n,e){return n[e]}function Fs(n,e){const t=e[n];return ko(t)?t:t[0]}function Tl(n){return 4==(4&n[2])}function ud(n){return 128==(128&n[2])}function ga(n,e){return null==e?null:n[e]}function Rm(n){n[18]=0}function qf(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Pn={lFrame:ou(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function _b(){return Pn.bindingsEnabled}function Bt(){return Pn.lFrame.lView}function ui(){return Pn.lFrame.tView}function Vo(n){return Pn.lFrame.contextLView=n,n[8]}function Jr(){let n=Nm();for(;null!==n&&64===n.type;)n=n.parent;return n}function Nm(){return Pn.lFrame.currentTNode}function Ga(n,e){const t=Pn.lFrame;t.currentTNode=n,t.isParent=e}function Lr(){return Pn.lFrame.isParent}function ls(){Pn.lFrame.isParent=!1}function Sh(){return Pn.isInCheckNoChangesMode}function Kf(n){Pn.isInCheckNoChangesMode=n}function ys(){const n=Pn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function ma(){return Pn.lFrame.bindingIndex++}function Eo(n){const e=Pn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function dd(n,e){const t=Pn.lFrame;t.bindingIndex=t.bindingRootIndex=n,Pm(e)}function Pm(n){Pn.lFrame.currentDirectiveIndex=n}function yb(){return Pn.lFrame.currentQueryIndex}function Lm(n){Pn.lFrame.currentQueryIndex=n}function Qf(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function hd(n,e,t){if(t&bn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&bn.Host||(r=Qf(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Pn.lFrame=Se();return i.currentTNode=e,i.lView=n,!0}function Ah(n){const e=Se(),t=n[1];Pn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Se(){const n=Pn.lFrame,e=null===n?null:n.child;return null===e?ou(n):e}function ou(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Th(){const n=Pn.lFrame;return Pn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const So=Th;function ri(){const n=Th();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Ws(){return Pn.lFrame.selectedIndex}function ao(n){Pn.lFrame.selectedIndex=n}function Dr(){const n=Pn.lFrame;return Om(n.tView,n.selectedIndex)}function Zf(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class Dh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function tp(n,e,t){const i=ir(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let pd=!0;function np(n){const e=pd;return pd=n,e}let zm=0;function Ls(n,e){const t=ip(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,Hm(i.data,n),Hm(e,null),Hm(i.blueprint,null));const r=Ih(n,e),s=n.injectorIndex;if(bb(r)){const o=fd(r),a=Wa(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function Hm(n,e){n.push(0,0,0,0,0,0,0,0,e)}function ip(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Ih(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function fc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(fh)&&(i=t[fh]),null==i&&(i=t[fh]=zm++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Cb:e}(t);if("function"==typeof s){if(!hd(e,n,i))return i&bn.Host?Gm(r,t,i):Eb(e,t,i,r);try{const o=s(i);if(null!=o||i&bn.Optional)return o;pn(t)}finally{So()}}else if("number"==typeof s){let o=null,a=ip(n,e),l=-1,c=i&bn.Host?e[16][6]:null;for((-1===a||i&bn.SkipSelf)&&(l=-1===a?Ih(n,e):e[a+8],-1!==l&&Rh(i,!1)?(o=e[1],a=fd(l),e=Wa(l,e)):a=-1);-1!==a;){const d=e[1];if(rp(s,a,d.data)){const f=vs(a,e,t,o,i,c);if(f!==Sb)return f}l=e[a+8],-1!==l&&Rh(i,e[1].data[a+8]===c)&&rp(s,a,e)?(o=d,a=fd(l),e=Wa(l,e)):a=-1}}}return Eb(e,t,i,r)}const Sb={};function Cb(){return new Uo(Jr(),Bt())}function vs(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=gd(a,o,t,null==i?ad(a)&&pd:i!=o&&0!=(3&a.type),r&bn.Host&&s===a);return null!==d?md(e,o,d,a):Sb}function gd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&fa(g)&&g.type===t)return l}return null}function md(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Dh}(r)){const o=r;o.resolving&&function(n,e){throw new Qe("200",`Circular dependency in DI detected for ${n}`)}(qt(s[t]));const a=np(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ua(o.injectImpl):null;hd(n,i,bn.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=gb(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ua(l),np(a),o.resolving=!1,So()}}return r}function rp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Cl]||bs(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Cl]||bs(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function bs(n){return ke(n)?()=>{const e=bs(ve(n));return e&&e()}:dc(n)}const yd="__parameters__";function va(n,e,t){return xe(()=>{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(yd)?l[yd]:Object.defineProperty(l,yd,{value:[]})[yd];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class zt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=$e({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}function Ho(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Go(t,e):e(t))}function Ph(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Ml(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function gc(n,e){const t=[];for(let i=0;i=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function Xm(n,e){const t=ws(n,e);if(t>=0)return n[1|t]}function ws(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):rt(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(yc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[_c]=null,n}const Sd=Ed(va("Inject",n=>({token:n})),-1),qr=Ed(va("Optional"),8),Xa=Ed(va("SkipSelf"),4);function ks(n){return n instanceof class{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}?n.changingThisBreaksApplicationSecurity:n}const f_="__ngContext__";function Es(n,e){n[f_]=e}function p_(n){const e=function(n){return n[f_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Ep(n){return n.ngOriginalError}function D1(n,...e){n.error(...e)}class Yo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||D1}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(Ep(e)):null}_findOriginalError(e){let t=e&&Ep(e);for(;t&&Ep(t);)t=Ep(t);return t||null}}const r0=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Jn))();function Za(n){return n instanceof Function?n():n}var To=(()=>((To=To||{})[To.Important=1]="Important",To[To.DashCase=2]="DashCase",To))();function v_(n,e){return undefined(n,e)}function Uh(n){const e=n[3];return Bo(e)?e[3]:e}function Md(n){return c0(n[13])}function w_(n){return c0(n[4])}function c0(n){for(;null!==n&&!Bo(n);)n=n[4];return n}function Id(n,e,t,i,r){if(null!=i){let s,o=!1;Bo(i)?s=i:ko(i)&&(o=!0,i=i[0]);const a=_r(i);0===n&&null!==t?null==r?p0(e,t,a):Ja(e,t,a,r||null,!0):1===n&&null!==t?Ja(e,t,a,r||null,!0):2===n?function(n,e,t){const i=xp(n,e);i&&function(n,e,t,i){ir(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==_r(t)&&Id(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Ml(n,10+e);!function(n,e){Od(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function x_(n,e){if(!(256&e[2])){const t=e[11];ir(t)&&t.destroyNode&&Od(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Cp(n[1],n);for(;e;){let t=null;if(ko(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)ko(e)&&Cp(e[1],e),e=e[3];null===e&&(e=n),ko(e)&&Cp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Cp(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==Hh(g,c,0)||2&i&&c!==p){if(wa(i))return!1;o=!0}}}}else{if(!o&&!wa(i)&&!wa(l))return!1;if(o&&wa(l))continue;o=!1,i=l|1&i}}return wa(i)||o}function wa(n){return 0==(1&n)}function tA(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!wa(o)&&(e+=T0(s,r),r=""),i=o,s=s||!wa(i);t++}return""!==r&&(e+=T0(s,r)),e}const xn={};function Yt(n){D0(ui(),Bt(),Ws()+n,Sh())}function D0(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Jf(e,s,t)}else{const s=n.preOrderHooks;null!==s&&ep(e,s,0,t)}ao(t)}function el(n,e){return n<<17|e<<2}function Tn(n){return n>>17&32767}function yr(n){return 2|n}function Pl(n){return(131068&n)>>2}function tl(n,e){return-131069&n|e<<2}function O_(n){return 1|n}function k0(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&D0(n,e,20,Sh()),t(i,r)}finally{ao(s)}}function qh(n,e,t){!_b()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Ls(t,e),Es(i,e);const o=t.initialInputs;for(let a=r;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function Y0(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function K0(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function MA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&H_(t)}}function H_(n){for(let i=Md(n);null!==i;i=w_(i))for(let r=10;r0&&H_(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&H_(r)}}function LA(n,e){const t=Fs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Z0(n){return n[7]||(n[7]=[])}function Fp(n){return n.cleanup||(n.cleanup=[])}function K_(n,e){const t=n[9],i=t?t.get(Yo,null):null;i&&i.handleError(e)}function J0(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Go([e],a=>this.processInjectorType(a,[],s)),this.records.set(kd,bu(void 0,this));const o=this.records.get(vu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:rt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=hu,i=bn.Default){this.assertNotDestroyed();const r=wd(this),s=ua(void 0);try{if(!(i&bn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof zt}(e)&&gn(e);a=l&&this.injectableDefInScope(l)?bu(ey(e),Yh):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&bn.Self?ew():this.parent).get(e,t=i&bn.Optional&&t===hu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[_c]=o[_c]||[]).unshift(rt(e)),r)throw o;return qs(o,e,"R3InjectorError",this.source)}throw o}finally{ua(s),wd(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(rt(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=ve(e)))return!1;let r=El(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=El(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Go(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||qi))}}this.injectorDefTypes.add(o);const l=dc(o)||(()=>new o);this.records.set(o,bu(l,Yh));const c=r.providers;if(null!=c&&!a){const d=e;Go(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Cc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return iw(n)?bu(void 0,n.useValue):bu(nw(n),Yh)}(e);if(Cc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=bu(void 0,Yh,!0),o.factory=()=>pu(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===Yh&&(t.value=HA,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ve(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function ey(n){const e=gn(n),t=null!==e?e.factory:dc(n);if(null!==t)return t;if(n instanceof zt)throw new Error(`Token ${rt(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=gc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[io]||n[Rs]);if(e){const t=function(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Error("unreachable")}function nw(n,e,t){let i;if(Cc(n)){const r=ve(n);return dc(r)||ey(r)}if(iw(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...pu(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Ie(ve(n.useExisting));else{const r=ve(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return dc(r)||ey(r);i=()=>new r(...pu(n.deps))}return i}function bu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function iw(n){return null!==n&&"object"==typeof n&&up in n}function Cc(n){return"function"==typeof n}const rw=function(n,e,t){return function(n,e=null,t=null,i){const r=tw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class zn{static create(e,t){return Array.isArray(e)?rw(e,t,""):rw(e.providers,e.parent,e.name||"")}}function bW(n,e){Zf(p_(n)[1],Jr())}function Dn(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(fa(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=iT(n.inputs),o.declaredInputs=iT(n.declaredInputs),o.outputs=iT(n.outputs);const a=r.hostBindings;a&&CW(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&EW(n,l),c&&SW(n,c),Ua(n.inputs,r.inputs),Ua(n.declaredInputs,r.declaredInputs),Ua(n.outputs,r.outputs),fa(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Mh(r.hostAttrs,t=Mh(t,r.hostAttrs))}}(i)}function iT(n){return n===id?{}:n===qi?[]:n}function EW(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function SW(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function CW(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}zn.THROW_IF_NOT_FOUND=hu,zn.NULL=new Xs,zn.\u0275prov=$e({token:zn,providedIn:"any",factory:()=>Ie(kd)}),zn.__NG_ELEMENT_ID__=-1;let cw=null;function kp(){if(!cw){const n=Jn.Symbol;if(n&&n.iterator)cw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(_r(Ne[i.index])):i.index;if(ir(t)){let Ne=null;if(!a&&l&&(Ne=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==Ne)(Ne.__ngLastListenerFn__||Ne).__ngNextListenerFn__=s,Ne.__ngLastListenerFn__=s,g=!1;else{s=uT(i,e,f,s,!1);const Ge=t.listen(q,r,s);p.push(s,Ge),d&&d.push(r,ge,G,G+1)}}else s=uT(i,e,f,s,!0),q.addEventListener(r,s,o),p.push(s),d&&d.push(r,ge,G,o)}else s=uT(i,e,f,s,!1);const _=i.outputs;let x;if(g&&null!==_&&(x=_[r])){const T=x.length;if(T)for(let q=0;q0;)e=e[15],n--;return e}(n,Pn.lFrame.contextLView))[8]}(n)}function r7(n,e){let t=null;const i=function(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let r=0;r=0}const Cs={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function WF(n){return n.substring(Cs.key,Cs.keyEnd)}function qF(n,e){const t=Cs.textEnd;return t===e?-1:(e=Cs.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Cs.key=e,t),Qp(n,e,t))}function Qp(n,e,t){for(;e=0;t=qF(e,t))Co(n,WF(e),!0)}function ZF(n,e){return e>=n.expandoStartIndex}function JF(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Ws()],o=ZF(n,t);iL(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=function(n){const e=Pn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=cy(t=hT(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=hT(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Pl(i))return n[Tn(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=hT(null,n,e,l[1],i),l=cy(l,e.attrs,i),function(n,e,t,i){n[Tn(t?e.classBindings:e.styleBindings)]=i}(n,e,i,l))}else s=function(n,e,t){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Tn(n[a+1]);n[i+1]=el(p,a),0!==p&&(n[p+1]=tl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=el(a,0),0!==a&&(n[a+1]=tl(n[a+1],i)),a=i;else n[i+1]=el(l,0),0===a?a=i:n[l+1]=tl(n[l+1],i),l=i;c&&(n[i+1]=yr(n[i+1])),$F(n,d,i,!0),$F(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&ws(s,e)>=0&&(t[i+1]=O_(t[i+1]))}(e,d,n,i,s),o=el(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function hT(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===xn&&(p=f?qi:void 0);let g=f?Xm(p,i):d===i?p:void 0;if(c&&!gw(g)&&(g=Xm(l,i)),gw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Tn(_):Pl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=Xm(l,i))}return a}function gw(n){return void 0!==n}function iL(n,e){return 0!=(n.flags&(e?16:32))}function Si(n,e=""){const t=Bt(),i=ui(),r=n+20,s=i.firstCreatePass?Nd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return ir(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Ap(i,t,o,s),Ga(s,!1)}function xs(n){return Mc("",n,""),xs}function Mc(n,e,t){const i=Bt(),r=function(n,e,t,i){return ho(n,ma(),t)?e+At(t)+i:xn}(i,n,e,t);return r!==xn&&Fl(i,Ws(),r),Mc}function Eu(n,e,t){const i=Bt();return ho(i,ma(),e)&&Do(ui(),Dr(),i,n,e,i[11],t,!0),Eu}const Xh=void 0;var U7=["en",[["a","p"],["AM","PM"],Xh],[["AM","PM"],Xh,Xh],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Xh,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Xh,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Xh,"{1} 'at' {0}",Xh],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Zp={};function wL(n){return n in Zp||(Zp[n]=Jn.ng&&Jn.ng.common&&Jn.ng.common.locales&&Jn.ng.common.locales[n]),Zp[n]}var an=(()=>((an=an||{})[an.LocaleId=0]="LocaleId",an[an.DayPeriodsFormat=1]="DayPeriodsFormat",an[an.DayPeriodsStandalone=2]="DayPeriodsStandalone",an[an.DaysFormat=3]="DaysFormat",an[an.DaysStandalone=4]="DaysStandalone",an[an.MonthsFormat=5]="MonthsFormat",an[an.MonthsStandalone=6]="MonthsStandalone",an[an.Eras=7]="Eras",an[an.FirstDayOfWeek=8]="FirstDayOfWeek",an[an.WeekendRange=9]="WeekendRange",an[an.DateFormat=10]="DateFormat",an[an.TimeFormat=11]="TimeFormat",an[an.DateTimeFormat=12]="DateTimeFormat",an[an.NumberSymbols=13]="NumberSymbols",an[an.NumberFormats=14]="NumberFormats",an[an.CurrencyCode=15]="CurrencyCode",an[an.CurrencySymbol=16]="CurrencySymbol",an[an.CurrencyName=17]="CurrencyName",an[an.Currencies=18]="Currencies",an[an.Directionality=19]="Directionality",an[an.PluralCase=20]="PluralCase",an[an.ExtraData=21]="ExtraData",an))();const _w="en-US";let EL=_w;function pT(n){Z(n,"Expected localeId to be defined"),"string"==typeof n&&(EL=n.toLowerCase().replace(/_/g,"-"))}function _T(n,e,t,i,r){if(n=ve(n),Array.isArray(n))for(let s=0;s>20;if(Cc(n)||!n.multi){const g=new Dh(l,r,De),_=vT(a,e,r?d:d+p,f);-1===_?(fc(Ls(c,o),s,a),yT(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[_]=g,o[_]=g)}else{const g=vT(a,e,d+p,f),_=vT(a,e,d,d+p),x=g>=0&&t[g],T=_>=0&&t[_];if(r&&!T||!r&&!x){fc(Ls(c,o),s,a);const q=function(n,e,t,i,r){const s=new Dh(n,t,De);return s.multi=[],s.index=e,s.componentProviders=0,WL(s,r,i&&!t),s}(r?B9:k9,t.length,r,i,l);!r&&T&&(t[_].providerFactory=q),yT(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(q),o.push(q)}else yT(s,n,g>-1?g:_,WL(t[r?_:g],l,!r&&i));!r&&i&&T&&t[_].componentProviders++}}}function yT(n,e,t,i){const r=Cc(e);if(r||function(n){return!!n.useClass}(e)){const o=(e.useClass||e).prototype.ngOnDestroy;if(o){const a=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){const l=a.indexOf(t);-1===l?a.push(t,[i,o]):a[l+1].push(i,o)}else a.push(t,o)}}}function WL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function vT(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=ui();if(i.firstCreatePass){const r=fa(n);_T(t,i.data,i.blueprint,r,!0),_T(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class qL{}const KL="ngComponent";class U9{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[KL]=n,e}(e)}}class ol{}function Ew(...n){}function eg(n,e){return new wn($s(n,e))}ol.NULL=new U9;const G9=function(){return eg(Jr(),Bt())};let wn=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=G9,n})();function XL(n){return n instanceof wn?n.nativeElement:n}class Qh{}let ET=(()=>{class n{}return n.\u0275prov=$e({token:n,providedIn:"root",factory:()=>null}),n})();class Cu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const QL=new Cu("12.2.5");class ZL{constructor(){}supports(e){return sy(e)}create(e){return new X9(e)}}const K9=(n,e)=>e;class X9{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||K9}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new Q9(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new JL),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new JL),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class Q9{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Z9{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class JL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new Z9,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function e2(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new eq(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class eq{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function n2(){return new tg([new ZL])}let tg=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||n2()),deps:[[n,new Xa,new qr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=$e({token:n,providedIn:"root",factory:n2}),n})();function r2(){return new ng([new t2])}let ng=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||r2()),deps:[[n,new Xa,new qr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=$e({token:n,providedIn:"root",factory:r2}),n})();function Sw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(_r(s)),Bo(s))for(let a=10;a-1&&(C_(e,i),Ml(t,i))}this._attachedToViewContainer=!1}x_(this._lView[1],this._lView)}onDestroy(e){U0(this._lView[1],this._lView,null,e)}markForCheck(){G_(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){W_(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Kf(!0);try{W_(n,e,t)}finally{Kf(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Od(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class nq extends py{constructor(e){super(e),this._view=e}detectChanges(){Q0(this._view)}checkNoChanges(){!function(n){Kf(!0);try{Q0(n)}finally{Kf(!1)}}(this._view)}get context(){return null}}const rq=function(n){return function(n,e,t){if(ad(n)&&!t){const i=Fs(n.index,e);return new py(i,i)}return 47&n.type?new py(e[16],e):null}(Jr(),Bt(),16==(16&n))};let ts=(()=>{class n{}return n.__NG_ELEMENT_ID__=rq,n})();const aq=[new t2],cq=new tg([new ZL]),uq=new ng(aq),hq=function(){return Cw(Jr(),Bt())};let Io=(()=>{class n{}return n.__NG_ELEMENT_ID__=hq,n})();const fq=Io,pq=class extends fq{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=$h(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),Wh(t,i,e),new py(i)}};function Cw(n,e){return 4&n.type?new pq(e,n,eg(n,e)):null}class Ic{}const _q=function(){return l2(Jr(),Bt())};let As=(()=>{class n{}return n.__NG_ELEMENT_ID__=_q,n})();const vq=As,o2=class extends vq{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return eg(this._hostTNode,this._hostLView)}get injector(){return new Uo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Ih(this._hostTNode,this._hostLView);if(bb(e)){const t=Wa(e,this._hostLView),i=fd(e);return new Uo(t[1].data[i+8],t)}return new Uo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=a2(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Ic,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Bo(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new o2(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),ir0});class I2 extends qL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(oA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return M2(this.componentDef.inputs)}get outputs(){return M2(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,og,r);return s!==og||i===og?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Qh,ru),a=s.get(ET,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(ir(n))return n.selectRootElement(e,t===$t.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):S_(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?"http://www.w3.org/2000/svg":"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||r0,clean:UA,playerHandler:e||null,flags:0}}(),g=Np(0,null,null,1,0,null,null,null,null,null),_=$h(null,g,p,f,null,null,o,l,a,s);let x,T;Ah(_);try{const q=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Nd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(Lp(l,c,!0),null!==n&&(tp(r,n,c),null!==l.classes&&M_(r,n,l.classes),null!==l.styles&&S0(r,n,l.styles)));const d=i.createRenderer(n,e),f=$h(t,Rp(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(fc(Ls(l,t),o,e.type),K0(o,l),V_(l,t.length,1)),Pp(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)tp(l,d,["ng-version",QL.full]);else{const{attrs:G,classes:ge}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&M_(l,d,ge.join(" "))}if(T=Om(g,20),void 0!==t){const G=T.projection=[];for(let ge=0;gel(o,e)),e.contentQueries){const l=Jr();e.contentQueries(1,o,l.directiveStart)}const a=Jr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(ao(a.index),q0(t[1],a,0,a.directiveStart,a.directiveEnd,e),Y0(e,o)),o}(q,this.componentDef,_,p,[bW]),Wh(g,_,null)}finally{ri()}return new yY(this.componentType,x,eg(T,_),_,T)}}class yY extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new nq(r),this.componentType=e}get injector(){return new Uo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const ag=new Map;class wY extends Ic{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new D2(this);const i=bo(e),r=function(n){return n[vx]||null}(e);r&&pT(r),this._bootstrapComponents=Za(i.bootstrap),this._r3Injector=tw(e,t,[{provide:Ic,useValue:this},{provide:ol,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=zn.THROW_IF_NOT_FOUND,i=bn.Default){return e===zn||e===Ic||e===kd?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class LT extends class{}{constructor(e){super(),this.moduleType=e,null!==bo(e)&&function(n){const e=new Set;!function t(i){const r=bo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${rt(e)} vs ${rt(e.name)}`)}(s,ag.get(s),i),ag.set(s,i));const o=Za(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new wY(this.moduleType,e)}}function Mw(n,e,t){const i=ys()+n,r=Bt();return r[i]===xn?Ac(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function P2(n,e,t,i,r,s){const o=e+t;return ho(n,o,r)?Ac(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===xn?void 0:t}(n,o+1)}function cl(n,e){const t=ui();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new Qe("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=dc(i.type)),o=ua(De);try{const a=np(!1),l=s();return np(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Bt(),r,l),l}finally{ua(o)}}function ul(n,e,t){const i=n+20,r=Bt(),s=cd(r,i);return function(n,e){kl.isWrapped(e)&&(e=kl.unwrap(e),n[Pn.lFrame.bindingIndex]=xn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?P2(r,ys(),e,s.transform,t,s):s.transform(t))}function kT(n){return e=>{setTimeout(n,void 0,e)}}const mn=class extends ee{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=kT(l),a&&(a=kT(a)),c&&(c=kT(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof S&&e.add(d),d}};function LY(){return this._results[kp()]()}class ef{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=kp(),i=ef.prototype;i[t]||(i[t]=LY)}get changes(){return this._changes||(this._changes=new mn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=Ho(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=Ew,this.reject=Ew,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Ie(tf,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Ay=new zt("AppId"),yK={provide:Ay,useFactory:function(){return`${KT()}${KT()}${KT()}`},deps:[]};function KT(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const ak=new zt("Platform Initializer"),Oc=new zt("Platform ID"),Rw=new zt("appBootstrapListener");let Nw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const xu=new zt("LocaleId"),lk=new zt("DefaultCurrencyCode");class bK{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const XT=function(n){return new LT(n)},wK=XT,EK=function(n){return Promise.resolve(XT(n))},ck=function(n){const e=XT(n),i=Za(bo(n).declarations).reduce((r,s)=>{const o=Ii(s);return o&&r.push(new I2(o)),r},[]);return new bK(e,i)},SK=ck,CK=function(n){return Promise.resolve(ck(n))};let nf=(()=>{class n{constructor(){this.compileModuleSync=wK,this.compileModuleAsync=EK,this.compileModuleAndAllComponentsSync=SK,this.compileModuleAndAllComponentsAsync=CK}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const uk=new zt("compilerOptions"),AK=(()=>Promise.resolve(0))();function QT(n){"undefined"==typeof Zone?AK.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class yn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new mn(!1),this.onMicrotaskEmpty=new mn(!1),this.onStable=new mn(!1),this.onError=new mn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=Jn.requestAnimationFrame,e=Jn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(Jn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,JT(n),n.isCheckStableRunning=!0,ZT(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),JT(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return dk(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),hk(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return dk(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),hk(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,JT(n),ZT(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!yn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(yn.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,DK,Ew,Ew);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const DK={};function ZT(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function JT(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function dk(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function hk(n){n._nesting--,ZT(n)}class OK{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new mn,this.onMicrotaskEmpty=new mn,this.onStable=new mn,this.onError=new mn}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let eD=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{yn.assertNotInAngularZone(),QT(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())QT(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),fk=(()=>{class n{constructor(){this._applications=new Map,tD.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return tD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class RK{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let tD=new RK,pk=!0,gk=!1;function Sa(){return gk=!0,pk}let Hl;const mk=new zt("AllowMultipleToken");function _k(n,e,t=[]){const i=`Platform: ${e}`,r=new zt(i);return(s=[])=>{let o=iD();if(!o||o.injector.get(mk,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:vu,useValue:"platform"});!function(n){if(Hl&&!Hl.destroyed&&!Hl.injector.get(mk,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Hl=n.get(yk);const e=n.get(ak,null);e&&e.forEach(t=>t())}(zn.create({providers:a,name:i}))}return function(n){const e=iD();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function iD(){return Hl&&!Hl.destroyed?Hl:null}let yk=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new OK:("zone.js"===n?void 0:n)||new yn({enableLongStackTrace:Sa(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:yn,useValue:a}];return a.run(()=>{const c=zn.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Yo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{rD(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return ay(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(cg);return p.runInitializers(),p.donePromise.then(()=>(pT(d.injector.get(xu,_w)||_w),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=vk({},i);return function(n,e,t){const i=new LT(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(jd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${rt(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function vk(n,e){return Array.isArray(e)?e.reduce(vk,n):Object.assign(Object.assign({},n),e)}let jd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new F(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new F(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{yn.assertNotInAngularZone(),QT(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{yn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Rn(a,l.pipe(ps()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof qL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Ic),a=r.create(zn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(eD,null),d=c&&a.injector.get(fk);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),rD(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;rD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Rw,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(zn),Ie(Yo),Ie(ol),Ie(cg))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function rD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const sX=_k(null,"core",[{provide:Oc,useValue:"unknown"},{provide:yk,deps:[zn]},{provide:fk,deps:[]},{provide:Nw,deps:[]}]),uX=[{provide:jd,useClass:jd,deps:[yn,zn,Yo,ol,cg]},{provide:gY,deps:[yn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:cg,useClass:cg,deps:[[new qr,tf]]},{provide:nf,useClass:nf,deps:[]},yK,{provide:tg,useFactory:function(){return cq},deps:[]},{provide:ng,useFactory:function(){return uq},deps:[]},{provide:xu,useFactory:function(n){return pT(n=n||"undefined"!=typeof $localize&&$localize.locale||_w),n},deps:[[new Sd(xu),new qr,new Xa]]},{provide:lk,useValue:"USD"}];let hX=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(jd))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:uX}),n})(),$w=null;function Rc(){return $w}const un=new zt("DocumentToken");let of=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:dQ,token:n,providedIn:"platform"}),n})();function dQ(){return Ie(qk)}let qk=(()=>{class n extends of{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Rc().getBaseHref(this._doc)}onPopState(t){const i=Rc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Rc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){Yk()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){Yk()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({factory:fQ,token:n,providedIn:"platform"}),n})();function Yk(){return!!window.history.pushState}function fQ(){return new qk(Ie(un))}function Tu(n){return n&&"?"!==n[0]?"?"+n:n}let af=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:pQ,token:n,providedIn:"root"}),n})();function pQ(n){const e=Ie(un).location;return new Xk(Ie(of),e&&e.origin||"")}const bD=new zt("appBaseHref");let Xk=(()=>{class n extends af{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return function(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Tu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Tu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Tu(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(of),Ie(bD,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();var cs=(()=>((cs=cs||{})[cs.Zero=0]="Zero",cs[cs.One=1]="One",cs[cs.Two=2]="Two",cs[cs.Few=3]="Few",cs[cs.Many=4]="Many",cs[cs.Other=5]="Other",cs))();const CQ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=wL(e);if(t)return t;const i=e.split("-")[0];if(t=wL(i),t)return t;if("en"===i)return U7;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[an.PluralCase]};class tE{}let JQ=(()=>{class n extends tE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(CQ(i||this.locale)(t)){case cs.Zero:return"zero";case cs.One:return"one";case cs.Two:return"two";case cs.Few:return"few";case cs.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(xu))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class tZ{constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ud=(()=>{class n{constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(i){throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const i=[];t.forEachOperation((r,s,o)=>{if(null==r.previousIndex){const a=this._viewContainer.createEmbeddedView(this._template,new tZ(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new l3(r,a);i.push(l)}else if(null==o)this._viewContainer.remove(null===s?void 0:s);else if(null!==s){const a=this._viewContainer.get(s);this._viewContainer.move(a,o);const l=new l3(r,a);i.push(l)}});for(let r=0;r{this._viewContainer.get(r.currentIndex).context.$implicit=r.item})}_perViewChange(t,i){t.context.$implicit=i.item}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(De(As),De(Io),De(tg))},n.\u0275dir=kt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class l3{constructor(e,t){this.record=e,this.view=t}}let Mu=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new iZ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){c3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){c3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(De(As),De(Io))},n.\u0275dir=kt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class iZ{constructor(){this.$implicit=null,this.ngIf=null}}function c3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class aZ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class lZ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const cZ=new lZ,uZ=new aZ;let iE=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(ay(t))return cZ;if(PF(t))return uZ;throw function(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${rt(n)}'`)}(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(De(ts,16))},n.\u0275pipe=Ns({name:"async",type:n,pure:!1}),n})(),Kr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[{provide:tE,useClass:JQ}]}),n})();const g3="browser";function lf(n){return n===g3}class ND extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){$w||($w=n)}(new ND)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(Ny=Ny||document.querySelector("base"),Ny?Ny.getAttribute("href"):null);return null==t?null:function(n){rE=rE||document.createElement("a"),rE.setAttribute("href",n);const e=rE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Ny=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}(document.cookie,e)}}let rE,Ny=null;const v3=new zt("TRANSITION_ID"),FZ=[{provide:tf,useFactory:function(n,e,t){return()=>{t.get(cg).donePromise.then(()=>{const i=Rc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},Jn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Jn.getAllAngularRootElements=()=>e.getAllRootElements(),Jn.frameworkStabilizers||(Jn.frameworkStabilizers=[]),Jn.frameworkStabilizers.push(i=>{const r=Jn.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Rc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let LZ=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Py=new zt("EventManagerPlugins");let oE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),Fy=(()=>{class n extends w3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(E3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(E3))}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function E3(n){Rc().remove(n)}const LD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},kD=/%COMP%/g;function aE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let lE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new BD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case $t.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new QZ(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case $t.ShadowDom:return new ZZ(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=aE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Ie(oE),Ie(Fy),Ie(Ay))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class BD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(LD[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=LD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=LD[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(To.DashCase|To.Important)?e.style.setProperty(t,i,r&To.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&To.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,x3(i)):this.eventManager.addEventListener(e,t,x3(i))}}class QZ extends BD{constructor(e,t,i,r){super(e),this.component=i;const s=aE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(kD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(kD,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class ZZ extends BD{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=aE(r.id,r.styles,[]);for(let o=0;o{class n extends FD{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const D3=["alt","control","meta","shift"],oJ={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},M3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},aJ={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let lJ=(()=>{class n extends FD{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Rc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(D3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&M3.hasOwnProperty(e)&&(e=M3[e]))}return oJ[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),D3.forEach(s=>{s!=r&&aJ[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const mJ=_k(sX,"browser",[{provide:Oc,useValue:g3},{provide:ak,useValue:function(){ND.makeCurrent(),PD.init()},multi:!0},{provide:un,useFactory:function(){return function(n){Bi=n}(document),document},deps:[]}]),_J=[[],{provide:vu,useValue:"root"},{provide:Yo,useFactory:function(){return new Yo},deps:[]},{provide:Py,useClass:JZ,multi:!0,deps:[un,yn,Oc]},{provide:Py,useClass:lJ,multi:!0,deps:[un]},[],{provide:lE,useClass:lE,deps:[oE,Fy,Ay]},{provide:Qh,useExisting:lE},{provide:w3,useExisting:Fy},{provide:Fy,useClass:Fy,deps:[un]},{provide:eD,useClass:eD,deps:[yn]},{provide:oE,useClass:oE,deps:[Py,yn]},{provide:class{},useClass:LZ,deps:[]},[]];let UD=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Ay,useValue:t.appId},{provide:v3,useExisting:Ay},FZ]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:_J,imports:[Kr,hX]}),n})();"undefined"!=typeof window&&window;class xJ extends S{constructor(e,t){super()}schedule(e,t=0){return this}}class cE extends xJ{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let O3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Yl extends O3{constructor(e,t=O3.now){super(e,()=>Yl.delegate&&Yl.delegate!==this?Yl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Yl.delegate&&Yl.delegate!==this?Yl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const DJ=new class extends Yl{}(class extends cE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Nc=new F(n=>n.complete());function uE(n){return n?function(n){return new F(e=>n.schedule(()=>e.complete()))}(n):Nc}function nn(...n){let e=n[n.length-1];return Te(e)?(n.pop(),Be(n,e)):An(n)}function fg(n,e){return new F(e?t=>e.schedule(IJ,0,{error:n,subscriber:t}):t=>t.error(n))}function IJ({error:n,subscriber:e}){e.error(n)}class ta{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return nn(this.value);case"E":return fg(this.error);case"C":return uE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ta("N",e):ta.undefinedValueNotification}static createError(e){return new ta("E",void 0,e)}static createComplete(){return ta.completeNotification}}ta.completeNotification=new ta("C"),ta.undefinedValueNotification=new ta("N",void 0);class dE extends y{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(dE.dispatch,this.delay,new RJ(e,this.destination)))}_next(e){this.scheduleMessage(ta.createNext(e))}_error(e){this.scheduleMessage(ta.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ta.createComplete()),this.unsubscribe()}}class RJ{constructor(e,t){this.notification=e,this.destination=t}}class pg extends ee{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new NJ(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new U;if(this.isStopped||this.hasError?o=S.EMPTY:(this.observers.push(e),o=new ie(this,e)),r&&e.add(e=new dE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class NJ{constructor(e,t){this.time=e,this.value=t}}function sr(n,e){return"function"==typeof e?t=>t.pipe(sr((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new PJ(n))}class PJ{constructor(e){this.project=e}call(e,t){return t.subscribe(new FJ(e,this.project))}}class FJ extends pe{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new Et(this),r=this.destination;r.add(i),this.innerSubscription=O(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const hE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return hE.schedule(n,0);if(void 0===window.requestAnimationFrame)return hE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let HD;function $J(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!HD){const t=Element.prototype;HD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&HD.call(n,e)}(n,r)||(i=s,0))),i}class qJ{constructor(e,t){this.componentFactory=t.get(ol).resolveComponentFactory(e)}create(e){return new YJ(this.componentFactory,e)}}class YJ{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new pg(1),this.events=this.eventEmitters.pipe(sr(i=>Rn(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(yn),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=hE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=zn.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(me(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=hE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new Dm(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class KJ extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Iu(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?Iu(n,e,t).pipe(me(r=>L(r)?i(...r):i(r))):new F(r=>{R3(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function R3(n,e,t,i,r){let s;if(function(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const o=n;n.addEventListener(e,t,r),s=()=>o.removeEventListener(e,t,r)}else if(function(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const o=n;n.on(e,t),s=()=>o.off(e,t)}else if(function(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const o=n;n.addListener(e,t),s=()=>o.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let o=0,a=n.length;o=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function P3(n,e){return function(t,i){e(t,i,n)}}function Kl(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function or(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}class Ir extends ee{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new U;return this._value}next(e){super.next(this._value=e)}}class k3 extends y{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class nee extends y{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function B3(n,e,t,i,r=new nee(n,t,i)){if(!r.closed)return e instanceof F?e.subscribe(r):Oe(e)(r)}function gE(...n){return It(1)(nn(...n))}Object.create(Error.prototype);const U3=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function Xi(n){return e=>0===n?uE():e.lift(new see(n))}class see{constructor(e){if(this.total=e,this.total<0)throw new U3}call(e,t){return t.subscribe(new oee(e,this.total))}}class oee extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function Ui(n,e){return function(i){return i.lift(new cee(n,e))}}class cee{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new uee(e,this.predicate,this.thisArg))}}class uee extends y{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}function Xl(n){return function(t){const i=new dee(n),r=t.lift(i);return i.caught=r}}class dee{constructor(e){this.selector=e}call(e,t){return t.subscribe(new hee(e,this.selector,this.caught))}}class hee extends pe{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new Et(this);this.add(i);const r=O(t,i);r!==i&&this.add(r)}}}function _E(n=null){return e=>e.lift(new yee(n))}class yee{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new vee(e,this.defaultValue))}}class vee extends y{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function Hd(){}function jr(n,e,t){return function(r){return r.lift(new wee(n,e,t))}}class wee{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Eee(e,this.nextOrObserver,this.error,this.complete))}}class Eee extends y{constructor(e,t,i,r){super(e),this._tapNext=Hd,this._tapError=Hd,this._tapComplete=Hd,this._tapError=i||Hd,this._tapComplete=r||Hd,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||Hd,this._tapError=t.error||Hd,this._tapComplete=t.complete||Hd)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}class Mne{constructor(e){this.total=e}call(e,t){return t.subscribe(new Ine(e,this.total))}}class Ine extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}let GB=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=kt({type:n,selectors:[["","gaEvent","","gaCategory",""],["","gaCategory",""]],inputs:{gaCategory:"gaCategory"},exportAs:["gaCategory"]}),n})();const wg=new zt("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),gM=new zt("ngx-window",{providedIn:"root",factory:()=>function(n){return lf(n)?window:null}(vc(Oc))}),Nne=new zt("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(vc(gM))}),mM=new zt("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(vc(gM),vc(Nne))});let PE=(()=>{class n{constructor(t,i,r){this.settings=t,this._document=i,this._gtag=r}get document(){return this._document}throw(t){(this.settings.enableTracing||Sa())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((i,[r,s])=>Object.defineProperty(i,r,{value:s,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(i=>void 0!==i))}catch(i){this.throw(i)}}event(t,i,r,s,o){try{const a=new Map;i&&a.set("event_category",i),r&&a.set("event_label",r),s&&a.set("value",s),void 0!==o&&a.set("interaction",o);const l=this.toKeyValue(a);l?this.gtag("event",t,l):this.gtag("event",t)}catch(a){this.throw(a)}}pageView(t,i,r,s){try{const o=new Map([["page_path",t]]);i&&o.set("page_title",i),(r||this.document)&&o.set("page_location",r||this.document.location.href),s&&Object.entries(s).map(([a,l])=>o.set(a,l)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(o))}catch(o){this.throw(o)}}appView(t,i,r,s,o){try{const a=new Map([["screen_name",t],["app_name",i]]);r&&a.set("app_id",r),s&&a.set("app_version",s),o&&a.set("app_installer_id",o),this.gtag("event","screen_view",this.toKeyValue(a))}catch(a){this.throw(a)}}set(...t){try{this._gtag("set",...t)}catch(i){this.throw(i)}}exception(t,i){try{const r=new Map;t&&r.set("description",t),i&&r.set("fatal",i),this.toKeyValue(r)?this.gtag("event","exception",this.toKeyValue(r)):this.gtag("event","exception")}catch(r){this.throw(r)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(wg),Ie(un),Ie(mM))},n.\u0275prov=$e({factory:function(){return new n(Ie(wg),Ie(un),Ie(mM))},token:n,providedIn:"root"}),n})(),$B=(()=>{class n{constructor(t,i,r,s){this.gaCategoryDirective=t,this.gaService=i,this.settings=r,this.el=s,this.gaBind="click"}set gaBind(t){this.bindSubscription&&this.bindSubscription.unsubscribe(),this._gaBind=t,this.bindSubscription=Iu(this.el.nativeElement,t).subscribe(()=>this.trigger())}get gaBind(){return this._gaBind}ngOnDestroy(){this.bindSubscription&&this.bindSubscription.unsubscribe()}trigger(){try{if(!this.gaAction&&!this.gaEvent)throw new Error("You must provide a gaAction attribute to identify this event.");this.gaService.event(this.gaAction||this.gaEvent,this.gaCategoryDirective?this.gaCategoryDirective.gaCategory:void 0,this.gaLabel||this.label,this.gaValue,this.gaInteraction)}catch(t){this.throw(t)}}throw(t){(Sa()||this.settings.enableTracing)&&console&&console.warn&&console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)(De(GB,8),De(PE),De(wg),De(wn))},n.\u0275dir=kt({type:n,selectors:[["","gaEvent",""]],inputs:{gaBind:"gaBind",gaAction:"gaAction",gaLabel:"gaLabel",label:"label",gaValue:"gaValue",gaInteraction:"gaInteraction",gaEvent:"gaEvent"},exportAs:["gaEvent"]}),n})();const Fne={provide:tf,multi:!0,useFactory:function(n,e,t){return()=>or(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(Sa()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Sa()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));t||Sa()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),n.uri=n.uri||`https://www.googletagmanager.com/gtag/js?id=${n.trackingCode}`,n.initCommands=null!==(i=null==n?void 0:n.initCommands)&&void 0!==i?i:[],n.initCommands.find(o=>"config"===o.command)||n.initCommands.unshift({command:"config",values:[n.trackingCode]}),n.initCommands.find(o=>"js"===o.command)||n.initCommands.unshift({command:"js",values:[new Date]});for(const o of n.initCommands)e(o.command,...o.values);const r=t.createElement("script");r.async=!0,r.src=n.uri,n.nonce&&r.setAttribute("nonce",n.nonce),t.getElementsByTagName("head")[0].appendChild(r)})},deps:[wg,mM,un]};new zt("ngx-google-analytics-routing-settings",{factory:()=>({})});let FE=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:wg,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},Fne]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[]]}),n})(),LE=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new pg(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),jne=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new S,this.token=r,this.subscriptions.add(t.consentChange.subscribe(s=>this.toggleGoogleAnalytics("rescinded"===s)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(LE),Ie(gM),Ie(wg))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Vne=new zt("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),YB=[LE,jne,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new S;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(r=>this.saveConsent(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,i;const r=null===(i=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===i?void 0:i.call(t,this.key);if(null==r)return"not-set";const s=r.trim().toLowerCase();switch(s){case"given":case"rescinded":return s;default:return"not-set"}}saveConsent(t){var i,r;null===(r=null===(i=this.storage)||void 0===i?void 0:i.setItem)||void 0===r||r.call(i,this.key,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(LE),Ie(Vne))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})()];function zne(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let Gne=(()=>{class n{static forRoot(t){const{providers:i=[]}=FE.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[zne({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[...YB,{provide:tf,multi:!0,useFactory:()=>()=>{},deps:YB}],imports:[[FE]]}),n})();var _M;const $d={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"",hubmapPortalUrl:"",hubmapDataUrl:"",hubmapAssetsUrl:"",hubmapToken:null!==(_M=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==_M?_M:""},googleAnalyticsToken:"G-ERNVZ1Q4KE"},$ne={initialConfig:{},parse:{},rename:{}};class Wne{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},$ne),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let qne=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new Wne(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=kt({type:n,features:[ki]}),n})();const KB_json=n=>"string"==typeof n?JSON.parse(n):n;function XB(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function yM(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||XB()}const QB="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",kE=yM();class Kne{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function vM(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const ZB={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function JB(n){return"string"==typeof n?ZB[n.toUpperCase()]||ZB.WHITE:n}function BE(n,e){if(!n)throw new Error(e||"Assertion failed")}const Ql={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},$y=Ql.window||Ql.self||Ql.global,ej=Ql.process||{};function Eg(){let n;if(kE&&$y.performance)n=$y.performance.now();else if(ej.hrtime){const e=ej.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Sg={debug:kE&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},nie={enabled:!0,level:0};function pl(){}const tj={},nj={once:!0};function iie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let bM=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=QB,this._startTs=Eg(),this._deltaTs=Eg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Kne("__probe-".concat(this.id,"__"),nie),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Eg()-this._startTs).toPrecision(10))}getDelta(){return Number((Eg()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){BE(t,i)}warn(t){return this._getLogFunction(0,t,Sg.warn,arguments,nj)}error(t){return this._getLogFunction(0,t,Sg.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,Sg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Sg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Sg.debug||Sg.info,arguments,nj)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||pl,r&&[r],{tag:iie(i)}):pl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?kE?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=vM(r,e,t);console.log(...s)},r.src=n,pl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...vM(n,e,t)),pl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...vM(r,e,t)),r.src=n.toDataURL(),pl}return pl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=tt(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):pl}({image:r,message:s,scale:o}):pl}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||pl)}group(t,i,r={collapsed:!1}){r=rj({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||pl)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=ij(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=rj({logLevel:t,message:i,args:s,opts:o}),BE(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Eg();const a=o.tag||o.message;if(o.once){if(tj[a])return pl;tj[a]=Eg()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!kE&&"string"==typeof n&&(e&&(e=JB(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=JB(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return pl}}return n.VERSION=QB,n})();function ij(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return BE(Number.isFinite(e)&&e>=0),e}function rj(n){const{logLevel:e,message:t}=n;n.logLevel=ij(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return BE("string"===r||"object"===r),Object.assign(n,n.opts)}const Ni=new bM({id:"deck"}),Mi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mi,"IDENTITY",{get:()=>Ni.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},sj={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},dn=new bM({id:"luma.gl"});function Po(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function jE(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function fi(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function VE(n){return Po(jE(n),"Invalid WebGLRenderingContext"),n}function Fo(n){return Po(fi(n),"Requires WebGL2"),n}var Er=tt(761);const Wy={};const qy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Er.CO.console&&Er.CO.console.log&&Er.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};gf.prototype.VERTEX_ARRAY_BINDING_OES=34229,gf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;ifi(n)?void 0:0,Cie={3074:n=>fi(n)?void 0:36064,35723:n=>fi(n)?void 0:4352,35977:ur,32937:ur,36795:(n,e)=>{const t=fi(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(lj);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(lj);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:ur,35071:ur,37447:ur,36063:(n,e)=>{if(!fi(n)){const t=n.getExtension(aj);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:ur,35374:ur,35377:ur,34852:n=>{if(!fi(n)){const e=n.getExtension(aj);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(oj)?2147483647:65535,33001:n=>n.getExtension(oj)?16777216:65535,33e3:n=>16777216,37157:ur,35373:ur,35657:ur,36183:ur,37137:ur,34045:ur,35978:ur,35979:ur,35968:ur,35376:ur,35375:ur,35659:ur,37154:ur,35371:ur,35658:ur,35076:ur,35077:ur,35380:ur},cj="ANGLE_instanced_arrays",uj={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Po(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[cj]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){Po(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Po(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Po(!1)},deleteQuery:()=>{Po(!1)},beginQuery:()=>{Po(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},wM={readBuffer:(n,e,t)=>{fi(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:fi(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!fi(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!fi(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=Cie[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function kie(n,{extension:e,target:t,target2:i}){const r=uj[e];Po(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new gf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&kie(n,{extension:t,target:n.luma,target2:n})}(n,uj),function(n,{target:e,target2:t}){Object.keys(wM).forEach(i=>{if("function"==typeof wM[i]){const r=n[i]?n[i].bind(n):()=>{},s=wM[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const EM={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},Wd=(n,e,t)=>e?n.enable(t):n.disable(t),dj=(n,e,t)=>n.hint(t,e),xa=(n,e,t)=>n.pixelStorei(t,e);function Yy(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Vie={3042:Wd,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:Wd,2885:(n,e)=>n.cullFace(e),2929:Wd,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:Wd,35723:dj,36006:(n,e)=>{const t=fi(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:dj,2849:(n,e)=>n.lineWidth(e),32823:Wd,32824:"polygonOffset",10752:"polygonOffset",35977:Wd,32938:"sampleCoverage",32939:"sampleCoverage",3089:Wd,3088:(n,e)=>n.scissor(...e),2960:Wd,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:xa,3317:xa,37440:xa,37441:xa,37443:xa,3330:xa,3332:xa,3331:xa,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:xa,32878:xa,3316:xa,3315:xa,32877:xa,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Yy(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Yy(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Yy(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Yy(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=Yy(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Xr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const Uie={blendEquation:(n,e,t)=>n.blendEquationSeparate(Xr(32777,e,t),Xr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Xr(32969,e,t),Xr(32968,e,t),Xr(32971,e,t),Xr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Xr(32824,e,t),Xr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Xr(32938,e,t),Xr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Xr(2962,e,t),Xr(2967,e,t),Xr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Xr(34816,e,t),Xr(36003,e,t),Xr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Xr(2964,e,t),Xr(2965,e,t),Xr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Xr(34817,e,t),Xr(34818,e,t),Xr(34819,e,t))},hj={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Bc=(n,e)=>n.isEnabled(e),fj={3042:Bc,2884:Bc,2929:Bc,3024:Bc,32823:Bc,32926:Bc,32928:Bc,3089:Bc,2960:Bc,35977:Bc};function pj(n){for(const e in n)return!1;return!0}function zie(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||EM)){const r=e,s=fj[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=fj[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},EM),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Po(this.stateStack.length>0),Nu(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){Po(void 0!==s);const o=e[s],a=this.cache[s];zie(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function mj(n,e={}){const{enable:t=!0,copyState:i}=e;if(Po(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new $ie(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in hj)Hie(n,o,hj[o]);gj(n,"getParameter"),gj(n,"isEnabled")}return n.state.enable=t,n}function _j(n){Po(n.state),n.state.pop()}function Nu(n,e){if(Po(jE(n),"setParameters requires a WebGL context"),pj(e))return;const t={};for(const r in e){const s=Number(r),o=Vie[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)Uie[r](n,e,i)}function Zl(n,e,t){if(pj(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||mj(n,{copyState:!1}),n.state.push()}(n),Nu(n,e),i)r=t(n),_j(n);else try{r=t(n)}finally{_j(n)}return r}function Cg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function SM(n,e,t=!0){return function(n,e,t,i,r){const s=yj(n[0],e,t);let o=vj(n[1],e,i,r),a=yj(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=vj(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,Cg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function yj(n,e,t){return Math.min(Math.round(n*e),t-1)}function vj(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const CM=(0,Er.jU)(),Qie=CM&&"undefined"!=typeof document,bj={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function wj(n={}){Po(CM,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},bj,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(Qie&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=xM(r,n),function(n){const e=fi(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);dn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function xM(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},bj,e);const{manageState:t,debug:i}=e;return t&&mj(n,{copyState:!1,log:(...r)=>dn.log(1,...r)()}),CM&&i&&(Er.CO.makeDebugContext?(n=Er.CO.makeDebugContext(n,e),dn.level=Math.max(dn.level,1)):dn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function Ej(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class Sj{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ej(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ej()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class AM{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof Sj?e:new Sj(t,i)),this.stats[t]}}const Ky="8.5.7",mf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new AM({id:e})),this.stats.get(e)}};if(Er.CO.luma&&Er.CO.luma.VERSION!==Ky)throw new Error(`luma.gl - multiple VERSIONs detected: ${Er.CO.luma.VERSION} vs 8.5.7`);function rn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function TM(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return rn(void 0!==i,`Accessing undefined constant GL.${e}`),i}function qd(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Er.CO.luma||((0,Er.jU)()&&dn.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Er.CO.luma=Er.CO.luma||{VERSION:Ky,version:Ky,log:dn,stats:mf,globals:{modules:{},nodeIO:{}}});const DM={};function jc(n="id"){return DM[n]=DM[n]||1,`${n}-${DM[n]++}`}function Cj(n){return rn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function xg(n){let e=!0;for(const t in n){e=!1;break}return e}function xj(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw dn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ag="Resource subclass must define virtual methods";class Pu{constructor(e,t={}){VE(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||jc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){rn(e=TM(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=fi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=fi(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?qd(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=qd(this.gl,o[f]))}}return o}setParameter(e,t){rn(e=TM(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=fi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=TM(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return xj(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ag)}_deleteHandle(){throw new Error(Ag)}_bindHandle(e){throw new Error(Ag)}_getOptsFromHandle(){throw new Error(Ag)}_getParameter(e,t){throw new Error(Ag)}_setParameter(e,t){throw new Error(Ag)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=mf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;mf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=mf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=mf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function MM(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Xy(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function cre({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return ia.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ia.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=IM("Accessor",e,dre)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const Tj={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},hre={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Tj},fre={removedProps:Tj};class tr extends Pu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/ia.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ia.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=IM("Buffer",e,hre),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=IM("Buffer",e,fre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ia(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;rn(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Fo(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return Fo(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){Fo(this.gl);const s=Xy(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return rn((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(rn(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){rn(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=MM(e);return rn(s),this.setAccessor(new ia(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){rn(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/Xy(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ia(this.accessor,{type:MM(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return dn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return dn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return dn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return dn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ia(this.accessor,e),this}}const OM={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},Dj={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},Mj={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},mre=[9729,9728],Ij=Er.CO.WebGLBuffer||function(){};class Tg extends Pu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=OM[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=fi(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=OM[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=jc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(G=>this.initialize(Object.assign({},e,{pixels:G,data:G}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:x=!1,mipmaps:T=!0}=e;const{depth:q=0}=e;return({width:f,height:p,compressed:x,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:x,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=q,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),T&&this._isNPOT()&&(dn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),T=!1,this._updateForNPOT(l)),this.mipmaps=T,this.setImageData({data:t,width:f,height:p,depth:q,format:s,type:_,dataFormat:g,border:o,mipmaps:T,parameters:c,compressed:x}),T&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:x}=this;x.bindTexture(this.target,this.handle);let q,T=null;return({data:c,dataType:T}=this._getDataType({data:c,compressed:_})),Zl(this.gl,l,()=>{switch(T){case"null":x.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":x.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":q=Fo(x),q.bindBuffer(35052,c.handle||c),q.texImage2D(t,r,s,f,p,o,g,d,a),q.bindBuffer(35052,null);break;case"browser-object":fi(x)?x.texImage2D(t,r,s,f,p,o,g,d,c):x.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[G,ge]of c.entries())x.compressedTexImage2D(t,G,ge.format,ge.width,ge.height,o,ge.data);break;default:rn(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(Dj[this.dataFormat]||4)*(Mj[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:x={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),rn(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const T=i;i=T.data,o=T.shape[0],a=T.shape[1]}i instanceof tr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),Zl(this.gl,x,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof Ij){const T=Fo(this.gl);T.bindBuffer(35052,i),T.texSubImage2D(e,l,r,s,o,a,f,d,g),T.bindBuffer(35052,null)}else fi(this.gl)?Fo(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return dn.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof tr?{data:e.handle,dataType:"buffer"}:e instanceof Ij?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=OM[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},rn(r,"Could not deduced texture size"),rn(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),rn(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:rn(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(fi(this.gl)||!this.width||!this.height||Cj(this.width)&&Cj(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===mre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function _re(n,e){return rn("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class Aa extends Tg{static isSupported(e,t){return Tg.isSupported(e,t)}constructor(e,t={}){VE(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:_re(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const _f="EXT_color_buffer_float",Oj={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:_f,bpp:2},33327:{gl2:_f,bpp:4},34842:{gl2:_f,bpp:8},33326:{gl2:_f,bpp:4},33328:{gl2:_f,bpp:8},34836:{gl2:_f,bpp:16},35898:{gl2:_f,bpp:4}};class Dg extends Pu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=fi(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,Oj)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return rn(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&fi(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Oj[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const Lj="clear: bad arguments";function NM(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),rn(0!==o,Lj),Zl(n,s,()=>{n.clear(o)})}function kj(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function ei(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){kj(s,i,r,o,a,"next",l)}function a(l){kj(s,i,r,o,a,"throw",l)}o(void 0)})}}const PM=[34069,34070,34071,34072,34073,34074];let Cre=(()=>{class n extends Tg{constructor(t,i={}){VE(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return ei(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(PM.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),PM.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&dn.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((x,T)=>{t&&i?d.texImage2D(g,T,a,t,i,o,a,l,x):d.texImage2D(g,T,a,a,l,x)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=PM,n})();class xre extends Tg{static isSupported(e){return fi(e)}constructor(e,t={}){Fo(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Zl(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof tr&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(Dj[this.dataFormat]||4)*(Mj[this.type]||1),"Texture"),this.loaded=!0,this}}function Tre(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Ds(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function UE(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof Ds?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Tre(n),deleteFramebuffer:!0}}(n);rn(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),rn(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(Xy(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return rn(!1),0}}(t))}(o,c,r,a,l),c=c||MM(o);const x=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,x||null),f&&d.delete(),o}function FM(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=UE(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=cre({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return rn(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&dn.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){rn(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof Dg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(Ds.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&NM(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Fo(n),Zl(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:rn(!1,Lj)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return dn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return dn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return dn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return dn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return dn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return dn.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=Fo(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=qd(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?qd(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?qd(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(FM(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>dn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=FM(this,{targetMaxHeight:100});return dn.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new Aa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new Dg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new Dg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&rn(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof Dg?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:Fo(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:rn(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return fi(n)?n:null}(this.gl);t?t.readBuffer(e):rn(36064===e||1029===e,Bj),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Fo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):rn(1===e.length&&(36064===e[0]||1029===e[0]),Bj)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in jj)void 0===n.luma.caps[e]&&(n.luma.caps[e]=Uj(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Ds.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const jj={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new Aa(n,{format:6408,type:5126,dataFormat:6408}),t=new Ds(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function LM(n,e){return Vj(n,e)}function Vj(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>Uj(n,t))}function Uj(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=jj[e];let i;rn(t,e);const r=fi(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:rn(!1);return i}(n,e)),n.luma.caps[e]||dn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class kM{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},jre=(Math,1/180*Math.PI),Sr={};function Ure(n,{precision:e=Sr.precision||4}={}){return n=function(n){return Math.round(n/Sr.EPSILON)*Sr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function Yd(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Fu(n,e,t){if(Yd(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*jre,void 0)}(n)}function yf(n,e,t){return Fu(n,i=>Math.max(e,Math.min(t,i)))}function zE(n,e,t){return Yd(n)?n.map((i,r)=>zE(i,e[r],t)):t*e+(1-t)*n}function Jy(n,e,t){const i=Sr.EPSILON;t&&(Sr.EPSILON=t);try{if(n===e)return!0;if(Yd(n)&&Yd(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+Ure(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(Jj.length=n.length,i=Jj):i=Zj,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function tV(n){return n&&n[Symbol.asyncIterator]}function zM(n,e=(()=>!0)){return Array.isArray(n)?nV(n,e,[]):e(n)?[n]:[]}function nV(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function iV(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ht(ht(ht({},Cse[n.type]),e),n)):null}function rV(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function sV(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function oV(n){n.push(n.shift())}function GM(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function aV({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=GM(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const q=s;s=(G,ge)=>t._normalizeConstant(q(G,ge))}const _=p?(q,G)=>s(g,G):(q,G)=>s(g.subarray(q,q+a),G),x=n.getData({length:i}),T=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return HM({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===WE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=WE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wse}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==WE}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const T=f*a+l;for(let q=0;qd?c.set(ge,x):(e._normalizeValue(ge,q.target,0),bse({target:c,source:q.target,start:x,count:Ne}));x+=Ne*d}else e._normalizeValue(ge,c,x),x+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let WM={};function _o(n){Ni.level>0&&WM[n]&&WM[n].call(...arguments)}function Ta(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const lV="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Tse=`#version 300 es\n${lV}`;function cV(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function uV(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Tse:e>300?`#version ${e}\n${lV}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Ta(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class dV extends Pu{static isSupported(e){return fi(e)}constructor(e,t={}){Fo(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,xg(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,dn.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof tr?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Ose{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof tr?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&rn(fi(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new dV(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],rn(i[s]instanceof tr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new tr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function hV(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const nv="vs",Pse={[nv]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},qE="__LUMA_INJECT_DECLARATIONS__",fV=/void\s+main\s*\([^)]*\)\s*\{\n?/,pV=/}\n?[^{}]*$/,YM=[];function gV(n,e,t,i=!1){const r=e===nv;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),YM.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(pV,l=>a+l));break;case"fs:#decl":r||(n=n.replace(qE,a));break;case"fs:#main-start":r||(n=n.replace(fV,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(pV,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(qE,""),i&&(n=n.replace(/\}\s*$/,s=>s+Pse[e])),n}function KM(n){const e={};return Ta(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const Fse={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},YE="transform_uSize_",mV="transform_position";const Hse={10241:9728,10240:9728,10242:33071,10243:33071};class $se{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${YE}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${YE}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=UE(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Ta(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new tr(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new Ds(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters(Hse)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){rn(n instanceof Aa||n instanceof Cre||n instanceof xre);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const x=function(n,e){const t={},i=function(n){return cV(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${YE}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Ta(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(x){const{updatedLine:T,inject:q}=x;f[g]=T,c=KM([c,q]),Object.assign(a,x.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=cV(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){rn(i);const p=`${YE}${t}`;c=KM([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${mV} = transform_getPos(${p});\n gl_Position = vec4(${mV}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=KM([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||uV({version:hV(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Fse].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const XM={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function qse(n){let e=_V(n);return"object"===e?n?"type"in n?Object.assign({},n,XM[n.type]):"value"in n?(e=_V(n.value),Object.assign({type:e},n,XM[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},XM[e])}function _V(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class QM{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Ta("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=qse(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Ta(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Ta(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Qse(n){return function(n){const e={},t={};return ZM({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(vV(n))}function ZM({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof QM||(Ta("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ta(t.name,"shader module has no name"),(t=new QM(t)).dependencies=vV(t.dependencies)),t))}const JM={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},vf={};function soe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(JM).forEach(n=>{vf[n]=n});const eI={};function bV(n,e,t={}){const i=JM[e];if(Ta(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in eI)return eI[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),eI[e]=l,l}function KE(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=JM[e];Ta(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Ta(!1===r||!0===r),r}(n,t))}function Ig(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const wV=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],coe=[...wV,[Ig("attribute"),"in $1"],[Ig("varying"),"out $1"]],uoe=[...wV,[Ig("varying"),"in $1"]],EV=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],doe=[...EV,[Ig("in"),"attribute $1"],[Ig("out"),"varying $1"]],hoe=[...EV,[Ig("in"),"varying $1"]],tI="gl_FragColor",nI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,foe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function XE(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const _oe=`\n\n${qE}\n\n`,SV={[nv]:"vertex",fs:"fragment"};function CV(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Ta("string"==typeof t,"shader source must be a string");const f=i===nv,p=t.split("\n");let g=100,_="",x=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],x=p.slice(1).join("\n")):_=`#version ${g}`;const T={};r.forEach(We=>{Object.assign(T,We.getDefines())}),Object.assign(T,s);let q=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${SV[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${SV[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:soe(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return KE(n,vf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),KE(n,vf.GLSL_DERIVATIVES)&&bV(n,vf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),KE(n,vf.GLSL_FRAG_DATA)&&bV(n,vf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),KE(n,vf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(T)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const G=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),ge={},Ne={},Ge={};for(const We in a){const dt="string"==typeof a[We]?{injection:a[We],order:0}:a[We],Mt=We.match(/^(v|f)s:(#)?([\w-]+)$/);if(Mt){const Lt=Mt[3];Mt[2]?"decl"===Lt?Ne[We]=[dt]:Ge[We]=[dt]:ge[We]=[dt]}else Ge[We]=[dt]}for(const We of r){d&&We.checkDeprecations(x,d),q+=We.getModuleSource(i,g);const Mt=We.injections[i];for(const Ot in Mt){const Lt=Ot.match(/^(v|f)s:#([\w-]+)$/);if(Lt){const Jt="decl"===Lt[2]?Ne:Ge;Jt[Ot]=Jt[Ot]||[],Jt[Ot].push(Mt[Ot])}else ge[Ot]=ge[Ot]||[],ge[Ot].push(Mt[Ot])}}return q+=_oe,q=gV(q,i,Ne),q+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(G[i],ge),q+=x,q=gV(q,i,Ge),q=function(n,e,t){switch(e){case 300:return t?XE(n,coe):function(n){const e=(n=XE(n,uoe)).match(nI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${tI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(foe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${tI}\\b`,"g"),t)}return n}(n);case 100:return t?XE(n,doe):function(n){const e=(n=XE(n,hoe)).match(nI);if(e){const t=e[1];n=n.replace(nI,"").replace(new RegExp(`\\b${t}\\b`,"g"),tI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(q,l?100:g,f),q}function boe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Aoe={5126:Cr.bind(null,"uniform1fv",Da,1,yo),35664:Cr.bind(null,"uniform2fv",Da,2,yo),35665:Cr.bind(null,"uniform3fv",Da,3,yo),35666:Cr.bind(null,"uniform4fv",Da,4,yo),5124:Cr.bind(null,"uniform1iv",Kd,1,yo),35667:Cr.bind(null,"uniform2iv",Kd,2,yo),35668:Cr.bind(null,"uniform3iv",Kd,3,yo),35669:Cr.bind(null,"uniform4iv",Kd,4,yo),35670:Cr.bind(null,"uniform1iv",Kd,1,yo),35671:Cr.bind(null,"uniform2iv",Kd,2,yo),35672:Cr.bind(null,"uniform3iv",Kd,3,yo),35673:Cr.bind(null,"uniform4iv",Kd,4,yo),35674:Cr.bind(null,"uniformMatrix2fv",Da,4,ku),35675:Cr.bind(null,"uniformMatrix3fv",Da,9,ku),35676:Cr.bind(null,"uniformMatrix4fv",Da,16,ku),35678:Js,35680:Js,5125:Cr.bind(null,"uniform1uiv",QE,1,yo),36294:Cr.bind(null,"uniform2uiv",QE,2,yo),36295:Cr.bind(null,"uniform3uiv",QE,3,yo),36296:Cr.bind(null,"uniform4uiv",QE,4,yo),35685:Cr.bind(null,"uniformMatrix2x3fv",Da,6,ku),35686:Cr.bind(null,"uniformMatrix2x4fv",Da,8,ku),35687:Cr.bind(null,"uniformMatrix3x2fv",Da,6,ku),35688:Cr.bind(null,"uniformMatrix3x4fv",Da,12,ku),35689:Cr.bind(null,"uniformMatrix4x2fv",Da,8,ku),35690:Cr.bind(null,"uniformMatrix4x3fv",Da,12,ku),35678:Js,35680:Js,35679:Js,35682:Js,36289:Js,36292:Js,36293:Js,36298:Js,36299:Js,36300:Js,36303:Js,36306:Js,36307:Js,36308:Js,36311:Js},Toe={},Doe={},Moe={},xV=[0];function iI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(xV[0]=n,n=xV);const r=n.length;if(r%e&&dn.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Cr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{rn(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return MV(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:DV(s,c),warnings:DV(o,c)}}(i,this.source,this.shaderType,this.id);throw dn.error(`GLSL compilation errors in ${r}\n${s}`)(),dn.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class rI extends iv{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class sI extends iv{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Ms=5126,rv=5124,sv=5125,oI={[Ms]:[Ms,1,"float"],35664:[Ms,2,"vec2"],35665:[Ms,3,"vec3"],35666:[Ms,4,"vec4"],[rv]:[rv,1,"int"],35667:[rv,2,"ivec2"],35668:[rv,3,"ivec3"],35669:[rv,4,"ivec4"],[sv]:[sv,1,"uint"],36294:[sv,2,"uvec2"],36295:[sv,3,"uvec3"],36296:[sv,4,"uvec4"],35670:[Ms,1,"bool"],35671:[Ms,2,"bvec2"],35672:[Ms,3,"bvec3"],35673:[Ms,4,"bvec4"],35674:[Ms,8,"mat2"],35685:[Ms,8,"mat2x3"],35686:[Ms,8,"mat2x4"],35675:[Ms,12,"mat3"],35687:[Ms,12,"mat3x2"],35688:[Ms,12,"mat3x4"],35676:[Ms,16,"mat4"],35689:[Ms,16,"mat4x2"],35690:[Ms,16,"mat4x3"]};function FV(n){const e=oI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function LV(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Ms}for(const t in oI){const[i,r,s]=oI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class fae{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!fi(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=FV(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ia(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=FV(i),l={location:e,name:t,accessor:new ia({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const pae=35981,gae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class BV extends Pu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",gae),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=pae}=e;return this.hash=t||"",this.vs="string"==typeof i?new rI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new sI(this.gl,{id:`${e.id}-fs`,source:r}):r,rn(this.vs instanceof rI),rn(this.fs instanceof sI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Fo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new fae(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:x,samplers:T}){if((x||T)&&(dn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(x||{})),dn.priority>=e){const q=g?g.id:"default",G=`mode=${qd(this.gl,t)} verts=${i} instances=${c} indexType=${qd(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${q}`;dn.log(e,G)()}return rn(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const q=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return rn(!1),0}}(t);p.begin(q)}this._bindTextures(),Zl(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&fi(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){dn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Roe(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof Ds&&(s=s.texture),s instanceof Tg)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&Noe(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new rI({handle:r});break;case 35632:i.fs=new sI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=jc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),dn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),dn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||dn.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(ge=>this._getHash(ge.name)).sort(),g=o.map(ge=>this._getHash(ge)),_=Object.keys(r).sort(),x=Object.keys(s).sort(),T=[],q=[];for(const ge of _)T.push(this._getHash(ge)),T.push(this._getHash(r[ge]));for(const ge of x)q.push(this._getHash(ge)),q.push(this._getHash(s[ge]));const G=`${d}/${f}D${T.join("/")}M${p.join("/")}I${q.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[G]){const ge=function(n,e){const{vs:t,fs:i}=e,r=Qse(e.modules||[]);return{gl:n,vs:CV(n,Object.assign({},e,{source:t,type:nv,modules:r})),fs:CV(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:boe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[G]=new BV(this.gl,{hash:G,vs:ge.vs,fs:ge.fs,varyings:o,bufferMode:a}),this._getUniforms[G]=ge.getUniforms||(Ne=>{}),this._useCounts[G]=0}return this._useCounts[G]++,this._programCache[G]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":$y.chrome?"Chrome":$y.safari?"Safari":$y.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ma(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ma.MAX_ATTRIBUTES=Ma.MAX_ATTRIBUTES||e.getParameter(34921),Ma.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ma._setConstantFloatArray(e,t,i);break;case Int32Array:Ma._setConstantIntArray(e,t,i);break;case Uint32Array:Ma._setConstantUintArray(e,t,i);break;default:rn(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Ma.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return rn(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(rn(fi(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ma.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new tr(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!eS||eS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Eae=/^(.+)__LOCATION_([0-9]+)$/,Sae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Cae{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Ma(e),xj(this,"VertexArray","v6.0",Sae),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new tr(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,dn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ia.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return rn(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Eae.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof tr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof tr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof tr))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof tr){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return dn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function av(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=av(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function jV(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof tr){const p=e,{data:g,changed:_}=p.getDebugData();let x;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?x=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${qd(r,s)})`:(c=!0,x=`${l} bytes`),{[i]:`${d}${av(f,{size:o,isInteger:c})}`,"Format ":x}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${av(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Tae(n,e){const{type:t,size:i}=e,r=LV(t,i);return r?`${n} (${r.name})`:n}function VV({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){rn(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:av(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function aI({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?av(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function UV(n){const{type:e,size:t}=n.accessor,i=LV(e,t);return i?`${i.name} ${n.name}`:n.name}const Iae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rae(n,e){const{attributeMap:t=Iae}=e||{};return t&&t[n]||n}function Nae(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}rn(Number.isFinite(e.size),`attribute ${n} needs size`)}const zV=()=>{},Lae={};class tS{constructor(e,t={}){const{id:i=jc("model")}=t;rn(jE(e)),this.id=i,this.gl=e,this.id=t.id||jc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||ov.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},rn(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return rn(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return rn(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Rae(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ht({},o);delete c.value,i[a]=[new tr(n,l),c],Nae(s,c)}}if(r){const s=r.value||r;rn(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new tr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(xg(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return NM(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),dn.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&dn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:x,instanceCount:T}=this,{onBeforeRender:q=zV,onAfterRender:G=zV}=this.props;q(),this.program.setUniforms(this.uniforms);const ge=this.program.draw(Object.assign(Lae,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:x,instanceCount:T,offset:f?g:0}));return G(),dn.priority>=2&&this._logDrawCallEnd(c,l,i),ge}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return dn.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}rn(t instanceof BV,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new Cae(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof tr&&t.delete()}}_setAnimationProps(e){this.animated&&rn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(xg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new dV(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:dn.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=jV(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Tae(s.name,a)}`),t[o]=jV(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=VV({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=VV({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&dn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&dn.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${UV(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${UV(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);dn.table(e,s)(),dn.table(e,o)(),dn.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),dn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class lI{static isSupported(e){return fi(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();rn(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new tS(t,Object.assign({},e,{fs:e.fs||uV({version:hV(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(xg(n.feedbackBuffers)&&xg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Ose(e,t)),function(n){return!(xg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new $se(e,t)),rn(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function nS(){}const jae={onStart:nS,onUpdate:nS,onInterrupt:nS,onEnd:nS};class lv{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ht(ht({},jae),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const qae={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new lv(i),this.attribute=t,this.attributeInTransition=new $M(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=sV(e.size);return new lI(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new tr(e,r),new tr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;oV(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)aV(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=GM(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:rV(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new lv(i),this.attribute=t,this.attributeInTransition=new $M(e,Vn(ht({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new Aa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new Ds(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=sV(e.size);return new lI(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new tr(e,r),new tr(e,r),new tr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)aV(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=GM(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:rV(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),oV(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),UE(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class Yae{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=lI.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Ni.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=qae[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ni.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const HV="attributeManager.invalidate";class ele{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new Yae(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;_o("attribute.updateStart",t),t.allocate(i)&&_o("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,_o("attribute.updateEnd",t,i))}}function $V(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function WV(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=iV(r)))return;const o=rle[r.type];if(!o)return void Ni.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Vn(ht({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const iS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:ole}=iS;function cle(n,e){if(!n.transitions)return null;const t={},i=uI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&cI(n[r],e[r],s)&&(t[r]=!0)}return t}function qV({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=cI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=cI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function cI(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function hle(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!yle(i[r],e[r])){t=n(i),e=i;break}return t}}function vle(n,e){if(!e)return n;const t=ht(ht({},n),e);if("defines"in e&&(t.defines=ht(ht({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=ht({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function sS(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],x=e[13],T=e[14],q=e[15],G=t*a-i*o,ge=t*l-r*o,Ne=t*c-s*o,Ge=i*l-r*a,We=i*c-s*a,dt=r*c-s*l,Mt=d*x-f*_,Ot=d*T-p*_,Lt=d*q-g*_,Qt=f*T-p*x,Jt=f*q-g*x,wt=p*q-g*T,Ct=G*wt-ge*Jt+Ne*Qt+Ge*Lt-We*Ot+dt*Mt;return Ct?(n[0]=(a*wt-l*Jt+c*Qt)*(Ct=1/Ct),n[1]=(r*Jt-i*wt-s*Qt)*Ct,n[2]=(x*dt-T*We+q*Ge)*Ct,n[3]=(p*We-f*dt-g*Ge)*Ct,n[4]=(l*Lt-o*wt-c*Ot)*Ct,n[5]=(t*wt-r*Lt+s*Ot)*Ct,n[6]=(T*Ne-_*dt-q*ge)*Ct,n[7]=(d*dt-p*Ne+g*ge)*Ct,n[8]=(o*Jt-a*Lt+c*Mt)*Ct,n[9]=(i*Lt-t*Jt-s*Mt)*Ct,n[10]=(_*We-x*Ne+q*G)*Ct,n[11]=(f*Ne-d*We-g*G)*Ct,n[12]=(a*Ot-o*Qt-l*Mt)*Ct,n[13]=(t*Qt-i*Ot+r*Mt)*Ct,n[14]=(x*ge-_*Ge-T*G)*Ct,n[15]=(d*Ge-f*ge+p*G)*Ct,n):null}function Vc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],x=e[12],T=e[13],q=e[14],G=e[15],ge=t[0],Ne=t[1],Ge=t[2],We=t[3];return n[0]=ge*i+Ne*a+Ge*f+We*x,n[1]=ge*r+Ne*l+Ge*p+We*T,n[2]=ge*s+Ne*c+Ge*g+We*q,n[3]=ge*o+Ne*d+Ge*_+We*G,n[4]=(ge=t[4])*i+(Ne=t[5])*a+(Ge=t[6])*f+(We=t[7])*x,n[5]=ge*r+Ne*l+Ge*p+We*T,n[6]=ge*s+Ne*c+Ge*g+We*q,n[7]=ge*o+Ne*d+Ge*_+We*G,n[8]=(ge=t[8])*i+(Ne=t[9])*a+(Ge=t[10])*f+(We=t[11])*x,n[9]=ge*r+Ne*l+Ge*p+We*T,n[10]=ge*s+Ne*c+Ge*g+We*q,n[11]=ge*o+Ne*d+Ge*_+We*G,n[12]=(ge=t[12])*i+(Ne=t[13])*a+(Ge=t[14])*f+(We=t[15])*x,n[13]=ge*r+Ne*l+Ge*p+We*T,n[14]=ge*s+Ne*c+Ge*g+We*q,n[15]=ge*o+Ne*d+Ge*_+We*G,n}function cv(n,e,t){var o,a,l,c,d,f,p,g,_,x,T,q,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],x=e[9],T=e[10],q=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=x,n[10]=T,n[11]=q,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+x*s+e[13],n[14]=l*i+p*r+T*s+e[14],n[15]=c*i+g*r+q*s+e[15]),n}function uv(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function KV(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function XV(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function QV(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function ZV(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],x=n[13],T=n[14],q=n[15],G=e[0],ge=e[1],Ne=e[2],Ge=e[3],We=e[4],dt=e[5],Mt=e[6],Ot=e[7],Lt=e[8],Qt=e[9],Jt=e[10],wt=e[11],Ct=e[12],Ht=e[13],ft=e[14],Kt=e[15];return Math.abs(t-G)<=hr*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(i-ge)<=hr*Math.max(1,Math.abs(i),Math.abs(ge))&&Math.abs(r-Ne)<=hr*Math.max(1,Math.abs(r),Math.abs(Ne))&&Math.abs(s-Ge)<=hr*Math.max(1,Math.abs(s),Math.abs(Ge))&&Math.abs(o-We)<=hr*Math.max(1,Math.abs(o),Math.abs(We))&&Math.abs(a-dt)<=hr*Math.max(1,Math.abs(a),Math.abs(dt))&&Math.abs(l-Mt)<=hr*Math.max(1,Math.abs(l),Math.abs(Mt))&&Math.abs(c-Ot)<=hr*Math.max(1,Math.abs(c),Math.abs(Ot))&&Math.abs(d-Lt)<=hr*Math.max(1,Math.abs(d),Math.abs(Lt))&&Math.abs(f-Qt)<=hr*Math.max(1,Math.abs(f),Math.abs(Qt))&&Math.abs(p-Jt)<=hr*Math.max(1,Math.abs(p),Math.abs(Jt))&&Math.abs(g-wt)<=hr*Math.max(1,Math.abs(g),Math.abs(wt))&&Math.abs(_-Ct)<=hr*Math.max(1,Math.abs(_),Math.abs(Ct))&&Math.abs(x-Ht)<=hr*Math.max(1,Math.abs(x),Math.abs(Ht))&&Math.abs(T-ft)<=hr*Math.max(1,Math.abs(T),Math.abs(ft))&&Math.abs(q-Kt)<=hr*Math.max(1,Math.abs(q),Math.abs(Kt))}function JV(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function oS(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new ra(4);ra!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const eU=[0,0,0,0],$le=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Wle=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],qle=[0,0,0],Yle=[0,0,0],Kle=rS(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=eU,l=eU,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=tU(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=oS([],l,o),s=i||s,o=Vc([],r,s),o=Vc([],o,$le)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:qle,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Mi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Mi.LNGLAT:case Mi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Mi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function tU(n,e,t=Yle){let r,i=t,s=!0;switch(r=e===Mi.LNGLAT_OFFSETS||e===Mi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case kc.WEB_MERCATOR:(e===Mi.LNGLAT||e===Mi.CARTESIAN)&&(s=!1);break;case kc.WEB_MERCATOR_AUTO_OFFSET:e===Mi.LNGLAT?i=r:e===Mi.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case kc.IDENTITY:i=n.position.map(Math.fround);break;case kc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class Jle extends BM{get ELEMENTS(){return Lu(!1),0}get RANK(){return Lu(!1),0}toString(){let e="[";if(Sr.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new Gn).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return QV(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],x=n[14],T=n[15];return(e*o-t*s)*(f*T-p*x)-(e*a-i*s)*(d*T-p*_)+(e*l-r*s)*(d*x-f*_)+(t*a-i*o)*(c*T-p*g)-(t*l-r*o)*(c*x-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return sS(this,this),this.check()}multiplyLeft(e){return Vc(this,e,this),this.check()}multiplyRight(e){return Vc(this,this,e),this.check()}rotateX(e){return KV(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return XV(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,x,T,q,G,ge,Ne,Ge,We,dt,Mt,Ot,Lt,Qt,Jt,wt,Ct,Ht,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*tc+ec)/(2*ec),512*(ec+Math.log(Math.tan(sU+e*tc*.5)))/(2*ec)]}function Xd([n,e]){const t=n/512*(2*ec)-ec,i=2*(Math.atan(Math.exp(e/512*(2*ec)-ec))-sU);return[t*fI,i*fI]}function lS({latitude:n,longitude:e,highPrecision:t=!1}){Bu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*tc),o=512/360,a=o/s,l=512/pI/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=tc*Math.tan(n*tc)/s,f=512/pI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function aU(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=lS({longitude:t,latitude:i,highPrecision:!0}),d=Bg(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Xd(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function lU({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return cv(o,o,[0,0,-i]),KV(o,o,-e*tc),XV(o,o,t*tc),uv(o,o,[r/=n,r,r]),s&&cv(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function cU({width:n,height:e,fovy:t=cS(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=cS(i));const a=.5*t*tc,l=uU(t),c=r*tc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function cS(n){return 2*Math.atan(.5/n)*fI}function uU(n){return.5/Math.tan(.5*n*tc)}function gI(n,e){const[t,i,r=0]=n;return Bu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),kg(e,[t,i,r,1])}function bf(n,e,t=0){const[i,r,s]=n;if(Bu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return kg(e,[i,r,s,1]);const o=kg(e,[i,r,0,1]),a=kg(e,[i,r,1,1]),l=o[2],c=a[2];return nU([],o,a,l===c?0:((t||0)-l)/(c-l))}function dU({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Bu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new uS({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],x=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Bu(x[0]>0&&x[1]>0);const T=x[0]/_[0],q=x[1]/_[1],Ge=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/T,(g[1]+p[1])/2+(s.bottom-s.top)/2/q]),We=Math.min(r,f.zoom+hI(Math.abs(Math.min(T,q))));return Bu(Number.isFinite(We)),{longitude:Ge[0],latitude:Ge[1],zoom:We}}const hU=Math.PI/180;function fU(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*hU:Math.atan(.5/n.altitude))>(90-n.pitch)*hU-.01?(l=pU(n,0,e),c=pU(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function pU(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=kg(i,[e,0,1,1]),s=kg(i,[e,n.height,1,1]),c=Xd(nU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class uS{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=cS(l=1.5):null===c?c=cS(l):null===l&&(l=uU(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=lS({longitude:r,latitude:i}),x=Bg([r,i]);x[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(x,x,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=cU({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return QV([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=lU({height:t,scale:g,center:x,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=x,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Vc(s,s,i),Vc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];uv(o,o,[e/2,-t/2,1]),cv(o,o,[1,-1,0]),Vc(o,o,s);const a=sS([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof uS&&e.width===this.width&&e.height===this.height&&ZV(e.projectionMatrix,this.projectionMatrix)&&ZV(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=gI(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=bf([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Bg(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=Xd(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Bg(e)}unprojectFlat(e){return Xd(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=bf(t,this.pixelUnprojectionMatrix),s=Fg([],Bg(e),dI([],i));return Xd(Fg([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=dU(Object.assign({width:i,height:r,bounds:e},t));return new uS({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return fU(this,e.z||0)}}const dce=Math.PI/180,hce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],mI=[0,0,0],pce={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let jg=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?kc.WEB_MERCATOR:kc.WEB_MERCATOR_AUTO_OFFSET:kc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Jy(t.projectionMatrix,this.projectionMatrix)&&Jy(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=gI(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=bf([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Bg(t):t}unprojectFlat(t){return this.isGeospatial?Xd(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?lS({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends jg{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:x=1.5}=t;const T=Math.pow(2,s);g=g||1,_=_||1,x=Math.max(.75,x);const{fov:q,aspect:G,focalDistance:ge,near:Ne,far:Ge}=cU({width:g,height:_,pitch:o,altitude:x,nearZMultiplier:l,farZMultiplier:c});let We=lU({height:_,pitch:o,bearing:a,scale:T,altitude:x});p&&(We=(new Gn).translate([512*p,0,0]).multiplyLeft(We)),super(Vn(ht({},t),{width:g,height:_,viewMatrix:We,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:q,aspect:G,focalDistance:ge,near:Ne,far:Ge})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=x,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(Vn(ht({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return aU(t,i)}panByPosition(t,i){const r=bf(i,this.pixelUnprojectionMatrix),o=Fg([],this.projectFlat(t),dI([],r)),a=Fg([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=fU(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=dU(ht({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function _I(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof vU){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function bU(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=oS([],[o,a,l,1],t)),i){case Mi.LNGLAT:return _I([o,a,l],e,s);case Mi.LNGLAT_OFFSETS:return _I([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mi.METER_OFFSETS:return _I(aU(r,[o,a,l]),e,s);case Mi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const _ce={10241:9987,10240:9729,10242:33071,10243:33071},yI={},bce={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||fv(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>vI(n,e)},accessor:{validate(n,e){const t=dS(n);return"function"===t||t===dS(e.value)},equal:(n,e,t)=>"function"==typeof e||vI(n,e)},array:{validate:(n,e)=>e.optional&&!n||fv(n),equal:(n,e,t)=>t.compare?vI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof Aa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new Aa(t,Vn(ht({},e),{parameters:ht(ht(ht({},_ce),i),n.props.textureParameters)}));return yI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof Aa)||yI[n.id]&&(n.delete(),delete yI[n.id])}(n)}}};function vI(n,e){if(n===e)return!0;if(!fv(n)||!fv(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Nce,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Oce]||{},i=e[Ice]||e,r=e[Rce]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(tV(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return ei(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=wI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const T=_,{dataTransform:q}=i.component?i.component.props:{};a=q?q(T,a):a.concat(T),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(T){d=!0,f=T}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const x=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;x&&x(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:CU,ASYNC_RESOLVED:xU,ASYNC_DEFAULTS:Pce}=iS,Fce={};let Lce=0,kce=(()=>{class n{constructor(){this.props=Sce.apply(this,arguments),this.id=this.props.id,this.count=Lce++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[Pce])s in i[xU]?r[s]=i[xU][s]:s in i[CU]&&(r[s]=i[CU][s]);return new this.constructor(ht(ht(ht({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new SU({})}}return n.componentName="Component",n.defaultProps=Fce,n})();class Bce extends SU{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const nc=n=>"function"==typeof n,Qd=n=>null!==n&&"object"==typeof n,TU=n=>Qd(n)&&n.constructor==={}.constructor,jce=n=>n&&"function"==typeof n[Symbol.iterator],Vce=n=>n&&"function"==typeof n[Symbol.asyncIterator],gv=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Vg=n=>"undefined"!=typeof Blob&&n instanceof Blob,DU=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||Qd(n)&&nc(n.tee)&&nc(n.cancel)&&nc(n.getReader))(n)||(n=>Qd(n)&&nc(n.read)&&nc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function wf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function EI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function SI(n){var e,t;let i;return wf(n,"null loader"),wf(EI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Vn(ht({},n=n[0]),{options:ht(ht({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Uc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},CI=Uc.global||Uc.self||Uc.window||{},Wce="object"!=typeof process||"[object process]"!==String(process)||process.browser,MU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);MU&&parseFloat(MU[1]);const AI={};function qce(n){for(const e in AI)n.startsWith(e)&&(n=n.replace(e,AI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const Yce=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Kce=/^([-\w.]+\/[-\w.+]+)/;function Xce(n){const e=Kce.exec(n);return e?e[1]:n}function IU(n){const e=Yce.exec(n);return e?e[1]:""}const Qce=/\?.*/;function gS(n){if(gv(n)){const e=TI(n.url||"");return{url:e,type:Xce(n.headers.get("content-type")||"")||IU(e)}}return Vg(n)?{url:TI(n.name||""),type:n.type||""}:"string"==typeof n?{url:TI(n),type:IU(n)}:{url:"",type:""}}function Zce(n){return gv(n)?n.headers["content-length"]||-1:Vg(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function TI(n){return n.replace(Qce,"")}function OU(n){return DI.apply(this,arguments)}function DI(){return(DI=ei(function*(n){if(gv(n))return n;const e={},t=Zce(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=gS(n);r&&(e["content-type"]=r);const s=yield tue(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function Jce(n){return MI.apply(this,arguments)}function MI(){return(MI=ei(function*(n){if(!n.ok){const e=yield eue(n);throw new Error(e)}})).apply(this,arguments)}function eue(n){return II.apply(this,arguments)}function II(){return(II=ei(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function tue(n){return OI.apply(this,arguments)}function OI(){return(OI=ei(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${nue(n.slice(0,5))}`:null})).apply(this,arguments)}function nue(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const PU={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){$n(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},sue={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function NI(){CI.loaders=CI.loaders||{};const{loaders:n}=CI;return n._state=n._state||{},n._state}const PI=()=>{const n=NI();return n.globalOptions=n.globalOptions||ht({},PU),n.globalOptions};function oue(n,e,t,i){return t=t||[],function(n,e){LU(n,null,PU,sue,e);for(const t of e)LU(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=ht({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new iue),BU(r,PI()),BU(r,e),r}(e,n,i)}function FU(n,e){const t=PI(),i=n||t;return"function"==typeof i.fetch?i.fetch:Qd(i.fetch)?r=>RU(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:RU}function LU(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&Qd(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)NU.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=lue(a,r);NU.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function lue(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function BU(n,e){for(const t in e)t in e&&(n[t]=TU(e[t])&&TU(n[t])?ht(ht({},n[t]),e[t]):e[t])}function zc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function due(n,e="3.0.12"){return zc(n,"no worker provided"),!(!e||!n.version)}const Hc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},hue=Hc.global||Hc.self||Hc.window||{},FI="object"!=typeof process||"[object process]"!==String(process)||process.browser,LI="function"==typeof importScripts,fue="undefined"!=typeof window&&void 0!==window.orientation,jU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),kI=(jU&&parseFloat(jU[1]),new Map);function VU(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function UU(n,e=!0,t){const i=t||new Set;if(n)if(zU(n))i.add(n);else if(zU(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)UU(n[r],e,i);return void 0===t?Array.from(i):[]}function zU(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const BI=()=>{};class HU{static isSupported(){return"undefined"!=typeof Worker}constructor(e){$n(this,"name",void 0),$n(this,"source",void 0),$n(this,"url",void 0),$n(this,"terminated",!1),$n(this,"worker",void 0),$n(this,"onMessage",void 0),$n(this,"onError",void 0),$n(this,"_loadableURL","");const{name:t,source:i,url:r}=e;zc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=BI,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=BI,this.onError=BI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||UU(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){zc(n.source&&!n.url||!n.source&&n.url);let e=kI.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?VU(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),kI.set(n.url,e)),n.source&&(e=VU(n.source),kI.set(n.source,e))),zc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class _ue{constructor(e,t){$n(this,"name",void 0),$n(this,"workerThread",void 0),$n(this,"isRunning",void 0),$n(this,"result",void 0),$n(this,"_resolve",void 0),$n(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zc(this.isRunning),this.isRunning=!1,this._reject(e)}}class yue{constructor(e){$n(this,"name","unnamed"),$n(this,"source",void 0),$n(this,"url",void 0),$n(this,"maxConcurrency",1),$n(this,"maxMobileConcurrency",1),$n(this,"onDebug",()=>{}),$n(this,"reuseWorkers",!0),$n(this,"props",{}),$n(this,"jobQueue",[]),$n(this,"idleQueue",[]),$n(this,"count",0),$n(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=ht(ht({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return ei(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return ei(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new _ue(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class ju{static isSupported(){return HU.isSupported()}static getWorkerFarm(e={}){return ju._workerFarm=ju._workerFarm||new ju({}),ju._workerFarm.setProps(e),ju._workerFarm}constructor(e){$n(this,"props",void 0),$n(this,"workerPools",new Map),this.props=ht({},vue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ht(ht({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new yue({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function wue(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return zc(r),r}function Eue(n,e){return!!ju.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Sue(n,e,t,i,r){return jI.apply(this,arguments)}function jI(){return(jI=ei(function*(n,e,t,i,r){const s=n.id,o=wue(n,t),l=ju.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Cue.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Cue(n,e,t,i){return VI.apply(this,arguments)}function VI(){return(VI=ei(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}$n(ju,"_workerFarm",void 0);var $U=tt(521);function WU(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return $U.toArrayBuffer?$U.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Due(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function qU(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Mue(n){return zI.apply(this,arguments)}function zI(){return(zI=ei(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=wI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Due(...e)})).apply(this,arguments)}const Rue=262144;function YU(n){this.wrapped=n}function mv(n){return new YU(n)}function _v(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof YU;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function GI(n){return function(){return new _v(n.apply(this,arguments))}}function $I(){return($I=GI(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(YI)}function Vue(n,e,t){return KI.apply(this,arguments)}function KI(){return(KI=ei(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return jue(n,e);if(Vg(n)&&(n=yield OU(n)),gv(n)){const r=n;return yield Jce(r),e.binary?yield r.arrayBuffer():yield r.text()}if(DU(n)&&(n=Bue(n,t)),jce(n)||Vce(n))return Mue(n);throw new Error(YI)})).apply(this,arguments)}function zue(n,e,t=null){if(t)return t;const i=ht({fetch:FU(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function Hue(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const XU=()=>{const n=NI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function QU(n){const e=XU();n=Array.isArray(n)?n:[n];for(const t of n){const i=SI(t);e.find(r=>i===r)||e.unshift(i)}}const $ue=/\.([^.]+)$/;function Wue(n){return ZI.apply(this,arguments)}function ZI(){return(ZI=ei(function*(n,e=[],t,i){if(!JU(n))return null;let r=ZU(n,e,Vn(ht({},t),{nothrow:!0}),i);if(r)return r;if(Vg(n)&&(r=ZU(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(ez(n));return r})).apply(this,arguments)}function ZU(n,e=[],t,i){if(!JU(n))return null;if(e&&!Array.isArray(e))return SI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...XU()),function(n){for(const e of n)SI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=gS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=JI(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&$ue.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||JI(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Zue(e,t))return t}else if(ArrayBuffer.isView(e)){if(tz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&tz(e,0,t))return t;return null}(e,n),a=a||JI(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(ez(n));return s}function JU(n){return!(n instanceof Response&&204===n.status)}function ez(n){const{url:e,type:t}=gS(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?eO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?eO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function JI(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Zue(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function tz(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Gc=new Uint8ClampedArray(0);const cde={data:{type:"data",value:ade,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=Vn(ht({},r),{fetch:Vn(ht({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:_S(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):_S(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mi.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let rO=(()=>{class n extends kce{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=bU(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=gI(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=ht({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Mi.DEFAULT&&(t=i.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=tU(t,i,r),f=bU(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mi.DEFAULT||t===Mi.LNGLAT||t===Mi.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){Jl(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=vle(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!lde({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Gc.length/3);if(this.internalState.usesPickingColorCache=!0,rnz&&Ni.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Gc=Zy.allocate(Gc,i,{size:3,copy:!0,maxCount:Math.max(i,nz)});const s=Math.floor(Gc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&_o("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=qV({newProps:n,oldProps:e,propTypes:uI(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&YV(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&YV(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:hle(n,e),transitionsChanged:cle(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=uI(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new ele(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){Jl(!this.internalState&&!this.state),Jl(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Bce({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ni.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new sle(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){_o("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=cde,n})(),dde=(()=>{class n extends rO{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:T,fetch:q,_subLayerProps:G}=this.props,ge={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:T,fetch:q},Ne=G&&G[t.id],Ge=Ne&&Ne.updateTriggers,We=t.id||"sublayer";if(Ne){const dt=this.constructor._propTypes,Mt=t.type?t.type._propTypes:{};for(const Ot in Ne){const Lt=Mt[Ot]||dt[Ot];Lt&&"accessor"===Lt.type&&(Ne[Ot]=this.getSubLayerAccessor(Ne[Ot]))}}Object.assign(ge,t,Ne),ge.id="".concat(this.props.id,"-").concat(We),ge.updateTriggers=ht(ht({all:this.props.updateTriggers.all},t.updateTriggers),Ge);for(const dt of T){const Mt=dt.getSubLayerProps.call(this,dt);Mt&&Object.assign(ge,Mt,{updateTriggers:Object.assign(ge.updateTriggers,Mt.updateTriggers)})}return ge}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=zM(t,Boolean),this.internalState.subLayers=t),_o("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const hde=/([0-9]+\.?[0-9]*)(%|px)/;function yS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(hde);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function vS(n,e){return n.relative?Math.round(n.position*e):n.position}function yv(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&yv(i,r)))return!1}return!0}class sO{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=jg}=e;Jl(!p||p instanceof jg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Vn(ht({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):yv(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=ht({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:vS(this._x,e),y:vS(this._y,t),width:vS(this._width,e),height:vS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ht(ht({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ht(ht(ht({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=yS(e),this._y=yS(t),this._width=yS(i),this._height=yS(r)}}const vv=()=>{},iz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:vv,onTransitionInterrupt:vv,onTransitionEnd:vv};class fde{constructor(e,t={}){this.ControllerState=e,this.props=ht(ht({},iz),t),this.propsInTransition=null,this.transition=new lv(t.timeline),this.onViewStateChange=t.onViewStateChange||vv,this.onStateChange=t.onStateChange||vv,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=ht(ht({},iz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ht(ht({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(ht(ht({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const rz=["longitude","latitude","zoom","bearing","pitch"],gde=["longitude","latitude","zoom"];class sz extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!Jy(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];Jl(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:rz,extract:rz,required:gde}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=zE(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ht(ht({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,zE(e.around,t.around,i)))}return r}}const Zd={transitionDuration:0},mde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},wS=n=>1-(1-n)*(1-n),Ug_WHEEL=["wheel"],Ug_PAN=["panstart","panmove","panend"],Ug_PINCH=["pinchstart","pinchmove","pinchend"],Ug_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Ug_DOUBLE_TAP=["doubletap"],Ug_KEYBOARD=["keydown"];class oO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new fde(e,Vn(ht({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Vn(ht({},mde),{transitionInterpolator:new sz({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Ug_WHEEL,d&&i),this.toggleEvents(Ug_PAN,d&&(r||s)),this.toggleEvents(Ug_PINCH,d&&(a||l)),this.toggleEvents(Ug_TRIPLE_PAN,d&&l),this.toggleEvents(Ug_DOUBLE_TAP,d&&o),this.toggleEvents(Ug_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=ht(ht({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,Zd,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,Vn(ht({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,Zd,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,Zd,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,Zd,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,Vn(ht({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?Vn(ht({},t),{transitionInterpolator:new sz(Vn(ht({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:Zd}}class oz{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const Jd_target=[0,0,0];class ES extends oz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=Jd_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:T,startZoom:q}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:T,startZoom:q},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(Vn(ht({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ht({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),yf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new ES(ht(ht(ht({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=yf(r,i,t),e.rotationX=yf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class yde extends oO{constructor(e){super(ES,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class vde extends oO{constructor(e){e.dragMode=e.dragMode||"pan",super(ES,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const bde=(new Gn).lookAt({eye:[0,0,1]});function wde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new Gn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Ede extends jg{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(Vn(ht({},e),{longitude:null,position:a,viewMatrix:bde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:wde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Fg([],e,dI([],bf(t,this.pixelUnprojectionMatrix)));return{target:Fg([],this.center,r)}}}let Sde=(()=>{class n extends sO{constructor(t){super(Vn(ht({},t),{type:Ede}))}get controller(){return this._getControllerProps({type:vde})}}return n.displayName="OrthographicView",n})();const SS=Math.PI/180;function Cde({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*SS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new Gn).lookAt({eye:l,up:a});c.rotateX(i*SS),"Z"===t?c.rotateZ(r*SS):c.rotateY(r*SS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class xde extends jg{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(Vn(ht({},e),{longitude:null,viewMatrix:Cde({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=bf([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let Ade=(()=>{class n extends sO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Vn(ht({},t),{orbitAxis:i,type:xde}))}get controller(){return this._getControllerProps({type:yde})}}return n.displayName="OrbitView",n})();const Tde=[255,255,255],Dde=1;let Mde=0;class az{constructor(e={}){const{color:t=Tde}=e,{intensity:i=Dde}=e;this.id=e.id||"ambient-".concat(Mde++),this.color=t,this.intensity=i,this.type="ambient"}}const Ide=[255,255,255],Ode=1,Rde=[0,0,-1];let Nde=0;class lz{constructor(e={}){const{color:t=Ide}=e,{intensity:i=Ode}=e,{direction:r=Rde}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Nde++),this.color=t,this.intensity=i,this.type="directional",this.direction=new mo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class cz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ht({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class aO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ht({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Nu(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Nu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=uz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dNM(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Nu(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||uz(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class kde extends aO{constructor(e,t){super(e,t),this.shadowMap=new Aa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new Dg(e,{format:33189,width:1,height:1}),this.fbo=new Ds(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;Zl(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=Cg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Vn(ht({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const jde=Object.keys(Mi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Mi[n],";")).join(""),Vde=Object.keys(kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(kc[n],";")).join(""),Ude="".concat(jde,"\n").concat(Vde,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),zde={},lO={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:Ude,getUniforms:function(n=zde){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Mi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mi.DEFAULT&&(i=n.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN);const o=Kle({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||Wle,o}(n):{}}},Wde=rS(function({viewport:n,center:e}){return new Gn(n.viewProjectionMatrix).invert().transform(e)}),qde=rS(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=bf([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new mo(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new Gn).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),Yde=[0,0,0,1],Kde=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],cO={name:"shadow",dependencies:[lO],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||Yde,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=Wde({viewport:n.viewport,center:e.project_uCenter}),r=[],s=qde({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},ehe={color:[255,255,255],intensity:1},dz=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],the=[0,0,0,200/255];class uO extends cz{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=the,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=ov.getDefaultProgramManager(e),cO&&this.programManager.addDefaultModule(cO)),this.dummyShadowMap||(this.dummyShadowMap=new Aa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(cO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new Gn).lookAt({eye:new mo(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=ihe++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class rhe{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=_S(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class she{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new rhe(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const ohe=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},lO],ahe=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function lhe(n){const e=ov.getDefaultProgramManager(n);for(const t of ohe)e.addDefaultModule(t);for(const t of ahe)e.addShaderHook(t);return e}const dhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class hhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new she({gl:e,protocol:"deck://"}),this.context=Vn(ht({},dhe),{layerManager:this,gl:e,deck:t,programManager:e&&lhe(e),stats:i||new AM({id:"deck.gl"}),viewport:r||new jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new hz,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){_o("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=zM(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return _o("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Ni.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Ni.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class fhe{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=zM(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!yv(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ni.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(ht({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=Vn(ht(ht(ht({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class ghe extends oz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:x,startRotatePos:T,startBearing:q,startPitch:G,startZoom:ge,normalize:Ne}={}){Jl(Number.isFinite(s)),Jl(Number.isFinite(r)),Jl(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:Ne}),this._state={startPanLngLat:_,startZoomLngLat:x,startRotatePos:T,startBearing:q,startPitch:G,startZoom:ge},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(Vn(ht({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(Vn(ht({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ht({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(ht(ht(ht({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=yf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=yf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=rU(t+180,360)-180),(o<-180||o>180)&&(o=rU(o+180,360)-180);const a=hI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Xd([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return yf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=yf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class mhe extends oO{constructor(e){e.dragMode=e.dragMode||"pan",super(ghe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let _he=(()=>{class n extends sO{constructor(t){super(Vn(ht({},t),{type:vU}))}get controller(){return this._getControllerProps({type:mhe})}}return n.displayName="MapView",n})();const yhe=new uO;class vhe{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!yv(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof uO)||this._internalEffects.push(yhe)}}class bhe extends aO{}const pz={blendFunc:[1,0,32771,0],blendEquation:32774};class gz extends aO{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,Zl(_,Vn(ht({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},pz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Vn(ht({},pz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ht(ht({},e.props.parameters),i)}}class Ehe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new bhe(e),this.pickLayersPass=new gz(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Ds.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Vn(ht({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,_o("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new Ds(this.gl),new Ds(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const She={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Che({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let T=0;T=0){const G=T+o-t,ge=G*G+x;ge<=d&&(d=ge,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),x=e[g];if(x){const T=x.decodePickingColor(_),q=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:x,pickedObjectIndex:T,pickedX:o+(f/4-q*l),pickedY:a+q}}Ni.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return She}function mz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Ahe(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(x=>x.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=mz(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=ht({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=_z({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function _z({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Dhe{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new gz(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?ht(ht({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Ds(e),Ds.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Ds(e),this.depthFBO.attach({36064:new Aa(e,{format:fi(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Ni.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:mz({viewports:i,x:r,y:s})};this._resizeBuffer();const f=Cg(this.gl),p=SM(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:x,height:T}=this.pickingFBO,q=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:x,deviceHeight:T});let G;const ge=[],Ne={};for(let Ge=0;Ge=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Ni.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:q,width:x.x+x.width-g,height:_-q},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Ge=new Map,We=Number.isFinite(c);for(let dt=0;dt=c);dt++){const Mt=Ne[dt];let Ot={color:Mt.pickedColor,layer:null,index:Mt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};Ot=_z({layer:Mt.pickedLayer,info:Ot,mode:l}),Ge.has(Ot.object)||Ge.set(Ot.object,Ot)}return Array.from(Ge.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return UE(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Mhe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Ihe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Mhe),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function yz(n,e){if(!n)throw new Error(e)}const $c={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},vz=$c.global||$c.self||$c.window,Rhe="object"!=typeof process||"[object process]"!==String(process)||process.browser,bz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:Nhe}=(bz&&parseFloat(bz[1]),vz),dO="undefined"!=typeof Image,hO="undefined"!=typeof ImageBitmap,Phe=Boolean(Nhe),fO=!!Rhe||Phe;function wz(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function Ez(n){switch(wz(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const khe=/^data:image\/svg\+xml/,Bhe=/\.svg((\?|#).*)?$/;function pO(n){return n&&(khe.test(n)||Bhe.test(n))}function jhe(n,e){if(pO(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return Cz(n,e)}function Cz(n,e){if(pO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function xz(n,e,t){return gO.apply(this,arguments)}function gO(){return(gO=ei(function*(n,e,t){const i=jhe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield Vhe(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function Vhe(n,e){return mO.apply(this,arguments)}function mO(){return(mO=ei(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const Uhe={};let Az=!0;function zhe(n,e,t){return _O.apply(this,arguments)}function _O(){return(_O=ei(function*(n,e,t){let i;i=pO(t)?yield xz(n,e,t):Cz(n,t);const r=e&&e.imagebitmap;return yield Hhe(i,r)})).apply(this,arguments)}function Hhe(n){return yO.apply(this,arguments)}function yO(){return(yO=ei(function*(n,e=null){if((Ghe(e)||!Az)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),Az=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function Ghe(n){for(const e in n||Uhe)return!1;return!0}const Wc=!1,bv=!0;function vO(n){const e=wv(n);return function(n){const e=wv(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Wc)?{mimeType:"image/png",width:e.getUint32(16,Wc),height:e.getUint32(20,Wc)}:null}(e)||function(n){const e=wv(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Wc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Wc)?{mimeType:"image/gif",width:e.getUint16(6,bv),height:e.getUint16(8,bv)}:null}(e)||function(n){const e=wv(n);return e.byteLength>=14&&16973===e.getUint16(0,Wc)&&e.getUint32(2,bv)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,bv),height:e.getUint32(22,bv)}:null}(e)}function wv(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function Xhe(n,e){const{mimeType:t}=vO(n)||{},{_parseImageNode:i}=vz;return yz(i),i(n,t,e)}function bO(){return(bO=ei(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(Zhe(r)){case"imagebitmap":a=yield zhe(n,e,s);break;case"image":a=yield xz(n,e,s);break;case"data":a=yield Xhe(n,e);break;default:yz(!1)}return"data"===r&&(a=Ez(a)),a})).apply(this,arguments)}function Zhe(n){switch(n){case"auto":case"data":return function(){if(hO)return"imagebitmap";if(dO)return"image";if(fO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return hO||dO||fO;case"imagebitmap":return hO;case"image":return dO;case"data":return fO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const Tz={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return bO.apply(this,arguments)},tests:[n=>Boolean(vO(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},efe={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},Ev="8.5.8",CS=Er.CO.deck&&Er.CO.deck.VERSION;if(CS&&CS!==Ev)throw new Error("deck.gl - multiple versions detected: ".concat(CS," vs ").concat(Ev));CS||(Ni.log(1,"deck.gl ".concat(Ev))(),Er.CO.deck=Object.assign(Er.CO.deck||{},{VERSION:Ev,version:Ev,log:Ni,_registerLoggers:function(n){WM=n}}),QU([efe,[Tz,{imagebitmap:{premultiplyAlpha:"none"}}]]));const tfe=Er.CO.deck;class xS extends Pu{static isSupported(e,t=[]){const i=fi(e),r=Vj(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:rn(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return xS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const Dz=(0,Er.jU)()&&"undefined"!=typeof document;let dfe=0;class hfe{constructor(e={}){const{onCreateContext:t=(T=>wj(T)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=mf.get("animation-loop-"+dfe++)}=e;let{useDevicePixels:x=!0}=e;"useDevicePixelRatio"in e&&(dn.deprecated("useDevicePixelRatio","useDevicePixels")(),x=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:x}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return rn("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=xS.isSupported(this.gl,["timers"])?new xS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return ei(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return dn.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=Dz?new Promise((e,t)=>{Dz&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?xM(this.props.gl,e):this.onCreateContext(e),!jE(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Nu(n,EM)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(dn.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(dn.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Ds(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var ffe=tt(524),AS=tt.n(ffe);const pfe={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(AS().MouseInput);const yfe=AS().Manager,qc=AS(),vfe=qc?[[qc.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[qc.Rotate,{enable:!1}],[qc.Pinch,{enable:!1}],[qc.Swipe,{enable:!1}],[qc.Pan,{threshold:0,enable:!1}],[qc.Press,{enable:!1}],[qc.Tap,{event:"doubletap",taps:2,enable:!1}],[qc.Tap,{event:"anytap",enable:!1}],[qc.Tap,{enable:!1}]]:null,Oz={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},bfe={doubletap:["tap"]},wfe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},EO={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Efe={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},Rz={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Sfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",zg="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let Nz=!1;try{const n={get passive(){return Nz=!0,!0}};zg.addEventListener("test",n,n),zg.removeEventListener("test",n,n)}catch(n){}const Cfe=-1!==Sfe.indexOf("firefox"),{WHEEL_EVENTS:xfe}=EO,Fz=4.000244140625;class Dfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=xfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!Nz&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;zg.WheelEvent&&(Cfe&&e.deltaMode===zg.WheelEvent.DOM_DELTA_PIXEL&&(t/=zg.devicePixelRatio),e.deltaMode===zg.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%Fz==0&&(t=Math.floor(t/Fz)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:Mfe}=EO,Lz="pointermove",kz="pointerover",Bz="pointerout",jz="pointerleave";class Ife{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Mfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===Lz&&(this.enableMoveEvent=t),e===kz&&(this.enableOverEvent=t),e===Bz&&(this.enableOutEvent=t),e===jz&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:kz,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:Bz,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:jz,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:Lz,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Ofe}=EO,Vz="keydown";class Rfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Ofe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===Vz&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:Vz,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const zz="contextmenu";class Nfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===zz&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:zz,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Pfe={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},Hz={srcElement:"root",priority:0};class Wfe{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},Hz,i):Hz;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&Oz[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new Dfe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Ife(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Rfe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Nfe(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=bfe[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=Rz[e]||e;let c=a.get(l);c||(c=new Wfe(this),a.set(l,c),c.recognizerName=Efe[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(Rz[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=wfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Sf(){}const Gz={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:Sf,onResize:Sf,onViewStateChange:Sf,onInteractionStateChange:Sf,onBeforeRender:Sf,onAfterRender:Sf,onLoad:Sf,onError:(n,e)=>Ni.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class DS{constructor(e){e=ht(ht({},Gz),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Ni.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Er.qs)()&&Ni.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new AM({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Zy.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Ni.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ni.removed("onLayerClick","onClick")(),e.initialViewState&&!yv(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](ht({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),Jl(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new hfe({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>wj(Vn(ht(ht({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new _he({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,xM(e,{enable:!0,copyState:!0})),this.tooltip=new Ihe(this.canvas),Nu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new hz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new Yfe(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in sj)this.eventManager.on(r,this._onEvent);this.viewManager=new fhe({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new hhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new vhe,this.deckRenderer=new Ehe(e),this.deckPicker=new Dhe(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Nu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ht({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Ni.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=Vn(ht({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=sj[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=mf.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}DS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(cz)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},DS.defaultProps=Gz,DS.VERSION=tfe.VERSION;const $z={name:"project32",dependencies:[lO],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},Wz="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",Qfe={lightSources:{}};function xO({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const AO={name:"lights",vs:Wz,fs:Wz,getUniforms:function qz(n=Qfe){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?xO(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=xO(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=xO(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return qz({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},Jfe={};const tpe={name:"phong-lighting",dependencies:[AO],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=Jfe){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},ipe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},Xz=ht({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=ipe){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),Qz={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class MS{static get DRAW_MODE(){return Qz}constructor(e={}){const{id:t=jc("geometry"),drawMode:i=Qz.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?ht({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,rn(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(rn(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return rn(Number.isFinite(i)),i}}const TO=Math.PI/180,IS=new Float32Array(16),Zz=new Float32Array(12);function Jz(n,e,t){const i=e[0]*TO,r=e[1]*TO,s=e[2]*TO,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function e4(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const t4={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let x;g?(IS.set(a),x=e4(IS)):(x=Zz,Jz(x,r,s),x.set(o,9)),n.value=new Float32Array(x)}else{let x=e*n.size;const{iterable:T,objectInfo:q}=eV(i,e,t);for(const G of T){let ge;q.index++,g?(IS.set(c?a:a(G,q)),ge=e4(IS)):(ge=Zz,Jz(ge,f?r:r(G,q),d?s:s(G,q)),ge.set(p?o:o(G,q),9)),_[x++]=ge[0],_[x++]=ge[1],_[x++]=ge[2],_[x++]=ge[3],_[x++]=ge[4],_[x++]=ge[5],_[x++]=ge[6],_[x++]=ge[7],_[x++]=ge[8],_[x++]=ge[9],_[x++]=ge[10],_[x++]=ge[11]}}}};function n4(n,e){return e===Mi.CARTESIAN||e===Mi.METER_OFFSETS||e===Mi.DEFAULT&&!n.isGeospatial}function i4(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ni.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function ape(n,e){if(n.attributes)return i4(n.attributes,e),n instanceof MS?n:new MS(n);if(n.positions||n.POSITION)return i4(n,e),new MS({attributes:n});throw Error("Invalid mesh")}const lpe={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let cpe=(()=>{class n extends rO{getShaders(){const t=!fi(this.context.gl),i={};return LM(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[$z,tpe,Xz],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:t4}),this.setState({emptyTexture:new Aa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||n4(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new tS(this.context.gl,Vn(ht({},this.getShaders()),{id:this.props.id,geometry:ape(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=lpe,n})();const r4={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[AO]};class Hg{constructor(e={}){const{id:t}=e;this.id=t||jc(this.constructor.name),this.display=!0,this.position=new mo,this.rotation=new mo,this.scale=new mo(1,1,1),this.matrix=new Gn,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return rn(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return rn(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return rn(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){rn(e),t=t||this.matrix;const i=new Gn(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class Sv extends Hg{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;dn.assert(t.every(i=>i instanceof Hg),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new Gn}={}){const i=new Gn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Sv?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function s4(){var n=new ra(4);return ra!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function o4(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function a4(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var c4=JV,Cpe=function(){var n=Gj(),e=$j(1,0,0),t=$j(0,1,0);return function(i,r,s){var o=Wj(r,s);return o<-.999999?(GE(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&GE(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),o4(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(GE(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();s4(),s4(),function(){var n=new ra(9);ra!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const xpe=[0,0,0,1],Tpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dpe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function h4(n){if(!n._animation){const e=Dpe[n.componentType],t=Tpe[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return o4(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Zs(e)}get y(){return this[1]}set y(e){this[1]=Zs(e)}get z(){return this[2]}set z(e){this[2]=Zs(e)}get w(){return this[3]}set w(e){this[3]=Zs(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return Cpe(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Lu(!t),a4(this,this,e),this.check()}multiplyLeft(e,t){return Lu(!t),a4(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return c4(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=xpe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,x,T,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>hr?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-i)*p)/_,T=Math.sin(i*p)/_):(x=1-i,T=i),n[0]=x*r+T*l,n[1]=x*s+T*c,n[2]=x*o+T*d,n[3]=x*a+T*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),HE(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class Fpe{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:dn.warn(`Bad animation path ${s}`)()}rn(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){DO.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:h4(e.accessors[a]),interpolation:l,output:h4(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Fpe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class kpe extends Hg{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof tS?(this.model=e,this._setModelNodeProps(t)):this.model=new tS(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class Bpe{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},LM(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new Aa(this.gl,ht({id:e.name||e.id,parameters:ht(ht({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(dn.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function f4(n,e){return fi(n)?`#version 300 es\n${e}`:e}const zpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Hpe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Gpe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Hpe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Lpe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Sv({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new Sv({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new Gn).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new Sv({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){dn.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new Bpe(n,e);dn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new kpe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[r4],defines:a.defines,parameters:a.parameters,vs:f4(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:f4(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),dn.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new tr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ia({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:zpe[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function p4(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new Gg(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Gg(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Gg){const o=e;t=o.fields,i=y4(y4(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new Gg(s,i)}}function y4(n,e){return new Map([...n||new Map,...e||new Map])}let Or,v4,b4,w4,E4,S4,C4,x4;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(Or||(Or={}));class MO{static isNull(e){return e&&e.typeId===Or.Null}static isInt(e){return e&&e.typeId===Or.Int}static isFloat(e){return e&&e.typeId===Or.Float}static isBinary(e){return e&&e.typeId===Or.Binary}static isUtf8(e){return e&&e.typeId===Or.Utf8}static isBool(e){return e&&e.typeId===Or.Bool}static isDecimal(e){return e&&e.typeId===Or.Decimal}static isDate(e){return e&&e.typeId===Or.Date}static isTime(e){return e&&e.typeId===Or.Time}static isTimestamp(e){return e&&e.typeId===Or.Timestamp}static isInterval(e){return e&&e.typeId===Or.Interval}static isList(e){return e&&e.typeId===Or.List}static isStruct(e){return e&&e.typeId===Or.Struct}static isUnion(e){return e&&e.typeId===Or.Union}static isFixedSizeBinary(e){return e&&e.typeId===Or.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Or.FixedSizeList}static isMap(e){return e&&e.typeId===Or.Map}static isDictionary(e){return e&&e.typeId===Or.Dictionary}get typeId(){return Or.NONE}compareTo(e){return this===e}}Symbol,Symbol,v4=Symbol.toStringTag;class $g extends MO{constructor(e,t){super(),$n(this,"isSigned",void 0),$n(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Or.Int}get[v4](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class ege extends $g{constructor(){super(!0,8)}}class tge extends $g{constructor(){super(!0,16)}}class nge extends $g{constructor(){super(!0,32)}}class ige extends $g{constructor(){super(!1,8)}}class rge extends $g{constructor(){super(!1,16)}}class sge extends $g{constructor(){super(!1,32)}}b4=Symbol.toStringTag;class A4 extends MO{constructor(e){super(),$n(this,"precision",void 0),this.precision=e}get typeId(){return Or.Float}get[b4](){return"Float"}toString(){return`Float${this.precision}`}}class oge extends A4{constructor(){super(32)}}class age extends A4{constructor(){super(64)}}Symbol,Symbol,w4=Symbol.toStringTag,E4=Symbol.toStringTag,S4=Symbol.toStringTag,C4=Symbol.toStringTag,x4=Symbol.toStringTag;class lge extends MO{constructor(e,t){super(),$n(this,"listSize",void 0),$n(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Or.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[x4](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class RS{constructor(e,t,i=!1,r=new Map){$n(this,"name",void 0),$n(this,"type",void 0),$n(this,"nullable",void 0),$n(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new RS(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function T4(n,e,t){const i=t?D4(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new ege;case Uint8Array:return new ige;case Int16Array:return new tge;case Uint16Array:return new rge;case Int32Array:return new nge;case Uint32Array:return new sge;case Float32Array:return new oge;case Float64Array:return new age;default:throw new Error("array type not supported")}}(e.value);return new RS(n,new lge(e.size,new RS("value",r)),!1,i)}function D4(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const M4={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},hge={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class pge{constructor(e){$n(this,"draco",void 0),$n(this,"decoder",void 0),$n(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=D4(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=T4(o,n[o],s[o]);r.push(l)}if(t){const o=T4("indices",t);r.push(o)}return new Gg(r,i)}(l.attributes,a,l.indices);return Vn(ht({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var NS=tt(125);const NO={};function PO(n){return FO.apply(this,arguments)}function FO(){return(FO=ei(function*(n,e=null,t={}){return e&&(n=vge(n,e,t)),NO[n]=NO[n]||bge(n),yield NO[n]})).apply(this,arguments)}function vge(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:FI?t.CDN?(zc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):LI?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function bge(n){return LO.apply(this,arguments)}function LO(){return(LO=ei(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():FI?LI?importScripts(n):wge(yield(yield fetch(n)).text(),n):NS.requireFromFile&&(yield NS.requireFromFile(n))})).apply(this,arguments)}function wge(n,e){if(!FI)return NS.requireFromString&&NS.requireFromString(n,e);if(LI)return eval.call(hue,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Ege="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Sge="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Cge="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Cv;function Age(n){return kO.apply(this,arguments)}function kO(){return(kO=ei(function*(n){const e=n.modules||{};return Cv=e.draco3d?Cv||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Cv||Tge(n),yield Cv})).apply(this,arguments)}function Tge(n){return jO.apply(this,arguments)}function jO(){return(jO=ei(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield PO(Ege,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield PO(Sge,"draco",n),yield PO(Cge,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Dge(e,t)})).apply(this,arguments)}function Dge(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Vn(ht({},t),{onModuleLoaded:r=>i({draco:r})}))})}const UO=Vn(ht({},_4),{parse:function(n,e){return zO.apply(this,arguments)}});function zO(){return(zO=ei(function*(n,e){const{draco:t}=yield Age(e),i=new pge(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Av(n,e){return wf(n>=0),wf(e>0),n+(e-1)&~(e-1)}function Oge(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+Av(i.byteLength,4)}const I4=["SCALAR","VEC2","VEC3","VEC4"],Rge=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Nge=new Map(Rge),Pge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Fge={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function O4(n){return I4[n-1]||I4[0]}function R4(n){const e=Nge.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function N4(n,e){const t=Lge[n.componentType],i=Pge[n.type],s=n.count*i,o=n.count*i*Fge[n.componentType];return Ia(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const kge={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class th{constructor(e){$n(this,"gltf",void 0),$n(this,"sourceBuffers",void 0),$n(this,"byteLength",void 0),this.gltf=e||{json:ht({},kge),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return Ia(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=N4(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return Ia(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ia(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=vO(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Ia(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Av(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:O4(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:R4(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Oge(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Yge(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function Kge(n){return $O.apply(this,arguments)}function $O(){return($O=ei(function*(n){const e=new th(n),{json:t}=e;e.removeExtension(FS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,FS)})).apply(this,arguments)}function Xge(n){const e=new th(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,FS,{}),e.addExtension(FS))}function Qge(n){return WO.apply(this,arguments)}function WO(){return(WO=ei(function*(n){const e=new th(n),{json:t}=e,i=e.getExtension(Wg);i&&(e.json.lights=i.lights,e.removeExtension(Wg));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Wg);s&&(r.light=s.light),e.removeObjectExtension(r,Wg)}})).apply(this,arguments)}function Zge(n){return qO.apply(this,arguments)}function qO(){return(qO=ei(function*(n){const e=new th(n),{json:t}=e;if(t.lights){const i=e.addExtension(Wg);Ia(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Wg,i);delete e.json.lights}})).apply(this,arguments)}function Jge(n){return YO.apply(this,arguments)}function YO(){return(YO=ei(function*(n){const e=new th(n),{json:t}=e,i=e.getExtension(LS);if(i){const r=tme(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,LS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=nme(s.technique,e)),e.removeObjectExtension(s,LS)}e.removeExtension(LS)}})).apply(this,arguments)}function eme(n,e){return KO.apply(this,arguments)}function KO(){return(KO=ei(function*(n,e){})).apply(this,arguments)}function tme(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function nme(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const L4={KHR_draco_mesh_compression:gt,KHR_materials_unlit:J,KHR_lights_punctual:xt,KHR_techniques_webgl:ut};function ime(n){return XO.apply(this,arguments)}function XO(){return(XO=ei(function*(n,e={},t){for(const r in L4){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield L4[r].decode(n,e,t))}})).apply(this,arguments)}const k4={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},sme={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class ome{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new th(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,P4);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(P4)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in k4)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in k4)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=sme[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function ame(n,e={}){return(new ome).normalize(n,e)}const lme={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},gl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},ume={magFilter:gl.TEXTURE_MAG_FILTER,minFilter:gl.TEXTURE_MIN_FILTER,wrapS:gl.TEXTURE_WRAP_S,wrapT:gl.TEXTURE_WRAP_T},dme={[gl.TEXTURE_MAG_FILTER]:gl.LINEAR,[gl.TEXTURE_MIN_FILTER]:gl.NEAREST_MIPMAP_LINEAR,[gl.TEXTURE_WRAP_S]:gl.REPEAT,[gl.TEXTURE_WRAP_]:gl.REPEAT};class pme{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Ia(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=ht({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=ht({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ht({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ht({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=ht({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ht({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ht({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return cme[n]}(e.componentType),e.components=function(n){return lme[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=N4(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):dme,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return ume[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function gme(n,e){return(new pme).postProcess(n,e)}const B4=1735152710,qg=!0;function ZO(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Av(i,4)}function JO(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Av(i,4)}function Tme(n,e){return eR.apply(this,arguments)}function eR(){return(eR=ei(function*(n,e,t=0,i,r){var s,o,a,l;Dme(n,e,t,i),ame(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Mme(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Ime(n,i,r);c.push(f)}const d=ime(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?gme(n,i):n})).apply(this,arguments)}function Dme(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=B4}=t,s=i.getUint32(e,!1);return s===r||s===B4}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?p4(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?p4(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,qg),a=r.getUint32(t+8,qg);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){wf(n.header.byteLength>20);const i=e.getUint32(t+0,qg),r=e.getUint32(t+4,qg);return t+=8,wf(0===r),ZO(n,e,t,i),(t+=i)+JO(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return wf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,qg),s=e.getUint32(t+4,qg);switch(t+=8,s){case 1313821514:ZO(n,e,t,r);break;case 5130562:JO(n,e,t,r);break;case 0:i.strict||ZO(n,e,t,r);break;case 1:i.strict||JO(n,e,t,r)}t+=Av(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),Ia("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Ia(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Mme(n,e,t){return tR.apply(this,arguments)}function tR(){return(tR=ei(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield Pme(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function Pme(n){return oR.apply(this,arguments)}function oR(){return(oR=ei(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const j4=[255,255,255,255],kme={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:j4},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Yg]};let Bme=(()=>{class n extends rO{getShaders(){const t=[$z,Xz];return"pbr"===this.props._lighting&&t.push(r4),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:j4,transition:!0},instanceModelMatrix:t4})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Hg)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Gpe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ht({gltf:l},c),function(n){return sR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ni.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Hg?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ni.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Ni.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Hg&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:ht({isInstanced:!0,transpileToGLSL100:!fi(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:n4(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=kme,n})();const jme=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Vme=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),Ume=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),zme=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Hme={POSITION:{size:3,value:new Float32Array(Vme)},NORMAL:{size:3,value:new Float32Array(Ume)},TEXCOORD_0:{size:2,value:new Float32Array(zme)}};class Gme extends MS{constructor(e={}){const{id:t=jc("cube-geometry")}=e;super(Vn(ht({},e),{id:t,indices:{size:1,value:new Uint16Array(jme)},attributes:ht(ht({},Hme),e.attributes)}))}}class Yc{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new le){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new le){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new le){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new le){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new le){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new le){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new le){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=Wme,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=qme;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(V4),V4.almostEquals(e,t)}clone(){return new le(this.x,this.y,this.z)}}le.ZERO=void 0,le.UNIT_X=void 0,le.UNIT_Y=void 0,le.UNIT_Z=void 0,le.ZERO=new le(0,0,0),le.UNIT_X=new le(1,0,0),le.UNIT_Y=new le(0,1,0),le.UNIT_Z=new le(0,0,1);const Wme=new le,qme=new le,V4=new le;class ar{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new le,this.upperBound=new le,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=z4;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=z4;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const U4=new le,z4=[new le,new le,new le,new le,new le,new le,new le,new le];class is{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new le){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=Kme;e.tangents(i,Xme),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(gr(e.length(),2)*gr(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new is){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new is){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new is){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new le){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new is(this.x,this.y,this.z,this.w)}slerp(e,t,i=new is){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,x,T,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-t)*p)/_,T=Math.sin(t*p)/_):(x=1-t,T=t),i.x=x*r+T*l,i.y=x*s+T*c,i.z=x*o+T*d,i.w=x*a+T*f,i}integrate(e,t,i,r=new is){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const Kme=new le,Xme=new le,Qme={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let hn=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=Qme,n})();class Pi{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new is,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Pi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Pi.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new le){return i.vsub(e,r),t.conjugate(G4),G4.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new le){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new le){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new le){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const G4=new is;class Cf extends hn{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:hn.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new le;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=x,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,d=new le,f=new le,p=new le,g=new le,_=new le;let x=Number.MAX_VALUE;const T=this;if(T.uniqueAxes)for(let q=0;q!==T.uniqueAxes.length;q++){i.vmult(T.uniqueAxes[q],c);const G=T.testSepAxis(c,e,t,i,r,s);if(!1===G)return!1;G0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){Cf.project(this,e,i,r,aR),Cf.project(t,e,s,o,lR);const l=aR[0],c=aR[1],d=lR[0],f=lR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?fn.STATIC:fn.DYNAMIC,typeof e.type==typeof fn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=fn.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new le,this.quaternion=new is,this.initQuaternion=new is,this.previousQuaternion=new is,this.interpolatedQuaternion=new is,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new le,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new le,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new le,this.invInertia=new le,this.invInertiaWorld=new Yc,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new Yc,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new le(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new le(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new ar,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new le,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=fn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===fn.SLEEPING&&this.dispatchEvent(fn.wakeupEvent)}sleep(){this.sleepState=fn.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=gr(this.sleepSpeedLimit,2);t===fn.AWAKE&&ir?this.wakeUp():t===fn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(fn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===fn.SLEEPING||this.type===fn.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new le){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new le){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new le,s=new is;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=e_e,o=t_e,a=this.quaternion,l=this.aabb,c=n_e;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=i_e,r=r_e;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==fn.DYNAMIC)return;this.sleepState===fn.SLEEPING&&this.wakeUp();const i=s_e;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==fn.DYNAMIC)return;const i=o_e,r=a_e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===fn.DYNAMIC&&(this.sleepState===fn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==fn.DYNAMIC)return;this.sleepState===fn.SLEEPING&&this.wakeUp();const i=t,r=l_e;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=c_e;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==fn.DYNAMIC)return;const i=u_e,r=d_e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=h_e;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),BS.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new le;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==fn.DYNAMIC&&this.type!==fn.KINEMATIC||this.sleepState===fn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,x=this.angularFactor,T=l.x*x.x,q=l.y*x.y,G=l.z*x.z;s.x+=e*(_[0]*T+_[1]*q+_[2]*G),s.y+=e*(_[3]*T+_[4]*q+_[5]*G),s.z+=e*(_[6]*T+_[7]*q+_[8]*G),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}fn.idCounter=0,fn.COLLIDE_EVENT_NAME="collide",fn.DYNAMIC=1,fn.STATIC=2,fn.KINEMATIC=4,fn.AWAKE=0,fn.SLEEPY=1,fn.SLEEPING=2,fn.wakeupEvent={type:"wakeup"},fn.sleepyEvent={type:"sleepy"},fn.sleepEvent={type:"sleep"};const e_e=new le,t_e=new is,n_e=new ar,i_e=new Yc,r_e=new Yc,s_e=new le,o_e=new le,a_e=new le,l_e=new le,c_e=new le,u_e=new le,d_e=new le,h_e=new le;new le,new le;class jS{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new le,this.rayToWorld=new le,this.hitNormalWorld=new le,this.hitPointWorld=new le,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let $4,W4,q4,Y4,K4,X4,Q4;$4=hn.types.SPHERE,W4=hn.types.PLANE,q4=hn.types.BOX,Y4=hn.types.CYLINDER,K4=hn.types.CONVEXPOLYHEDRON,X4=hn.types.HEIGHTFIELD,Q4=hn.types.TRIMESH;class ds{get[$4](){return this._intersectSphere}get[W4](){return this._intersectPlane}get[q4](){return this._intersectBox}get[Y4](){return this._intersectConvex}get[K4](){return this._intersectConvex}get[X4](){return this._intersectHeightfield}get[Q4](){return this._intersectTrimesh}constructor(e=new le,t=new le){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new le,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=ds.ANY,this.result=new jS,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||ds.ANY,this.result=t.result||new jS,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Z4),hR.length=0,e.broadphase.aabbQuery(e,Z4,hR),this.intersectBodies(hR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=v_e,s=b_e;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new le(0,0,1);t.vmult(c,c);const d=new le;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;T>=0&&T<=1&&(o.lerp(a,T,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=x_e,l=e8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,T=_.distanceTo(this.to),q=c?c.length:d.length,G=this.result;for(let ge=0;!G.shouldStop&&geT||this.reportIntersection(a,sa,s,r,Ne)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=A_e,l=R_e,c=N_e,d=e8,f=T_e,p=D_e,g=M_e,_=O_e,x=I_e,T=e.indices,q=this.from,G=this.to,ge=this.direction;c.position.copy(i),c.quaternion.copy(t),Pi.vectorToLocalFrame(i,t,ge,f),Pi.pointToLocalFrame(i,t,q,p),Pi.pointToLocalFrame(i,t,G,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const Ne=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Ge=0,We=l.length;!this.result.shouldStop&&Ge!==We;Ge++){const dt=l[Ge];e.getNormal(dt,a),e.getVertex(T[3*dt],ic),ic.vsub(p,d);const Mt=f.dot(a),Ot=a.dot(d)/Mt;if(Ot<0)continue;f.scale(Ot,sa),sa.vadd(p,sa),e.getVertex(T[3*dt+1],Xc),e.getVertex(T[3*dt+2],Qc);const Lt=sa.distanceSquared(p);!ds.pointInTriangle(sa,Xc,ic,Qc)&&!ds.pointInTriangle(sa,ic,Xc,Qc)||Lt>Ne||(Pi.vectorToWorldFrame(t,a,x),Pi.pointToWorldFrame(i,t,sa,_),this.reportIntersection(x,_,s,r,dt))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case ds.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case ds.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var Mf=tt(517);function Zg(n,e,t){e||(e=new Gn(Gn.IDENTITY));const i=new Gn(Gn.IDENTITY);if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new Gn(Gn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new Gn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===Zg(s,r,t))return!1;return!0}function $8(){QU([_4,Yg])}function W8(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||Zg(r,new Gn(Gn.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function mR(n,e){return or(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield mS(i,Yg,{DracoLoader:UO,gltf:{decompressMeshes:!0,postProcess:!0}});return W8(n.scenegraphNode,r)})}function Pbe(n,e){return or(this,void 0,void 0,function*(){return W8(n,yield e)})}function _R(n,e,t){if(e&&0!==e.length)return new cpe(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mi.CARTESIAN,data:e,mesh:new Gme,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let Lbe=(()=>{class n extends dde{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),$8()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){or(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new Gn(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new ar({lowerBound:new le(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new le(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield _S(o.scenegraph,Yg,{DracoLoader:UO,decompress:!0,postProcess:!0});for(const l of a.scenes)Zg(l,new Gn(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new ar({lowerBound:new le(...p.map((_,x)=>Math.min(_,g[x]))),upperBound:new le(...g.map((_,x)=>Math.max(_,p[x])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=mR({scenegraph:l.scenegraph},n.gltfCache));return[_R("cubes",i,{wireframe:!1,pickable:!1}),_R("pickableCubes",r,{wireframe:!1,pickable:!0}),_R("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new Bme({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Mi.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?Pbe(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function q8(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),q8(t,e);return e}let Bbe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new Lbe({}),this.nodeClickSubject=new ee,this.nodeHoverStartSubject=new ee,this.nodeHoverStopSubject=new ee,this.sceneRotationSubject=new Ir([0,0]),this.nodeDragStartSubject=new ee,this.nodeDragSubject=new ee,this.nodeDragEndSubject=new ee,this.nodeClick$=this.nodeClickSubject.pipe(ps()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ps()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ps()),this.sceneRotation$=this.sceneRotationSubject.pipe(ps()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ps()),this.nodeDrag$=this.nodeDragSubject.pipe(ps()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ps());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Sde({flipY:!1,near:-1e3}):new Ade({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new uO({ambientLight:new az({color:[255,255,255],intensity:10})})]),this.deck=new DS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return or(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new Gn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return or(this,void 0,void 0,function*(){$8();const i=yield mR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)Zg(o,e=new Gn(e||Gn.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new Gn(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new Gn(e||Gn.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new ar({lowerBound:new le(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new le(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of q8(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new Gn(Gn.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new Gn(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return Ca([Mf.ZP],n.prototype,"_onHover",null),Ca([Mf.ZP],n.prototype,"_onClick",null),Ca([Mf.ZP],n.prototype,"_onViewStateChange",null),Ca([Mf.ZP],n.prototype,"_onDragStart",null),Ca([Mf.ZP],n.prototype,"_onDrag",null),Ca([Mf.ZP],n.prototype,"_onDragEnd",null),n})();function jbe(n,e){return n===e}function Vbe(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let yR=(()=>{class n{constructor(){this.bootstrap$=new pg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const vR=new zt("INITIAL_STATE_TOKEN");let Hbe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const K8=new zt("Internals.StateContextFactory"),X8=new zt("Internals.StateFactory");function Pv(...n){if(1===n.length){const e=n[0];if(L(e))return YS(e,null);if(re(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return YS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return YS(n=1===n.length&&L(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return YS(n,null)}function YS(n,e){return new F(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function ml(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new pg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}function Q8(n,e){return e?t=>t.pipe(Q8((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new $be(n))}class $be{constructor(e){this.project=e}call(e,t){return t.subscribe(new Wbe(e,this.project))}}class Wbe extends pe{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new Et(this),i=this.destination;i.add(t);const r=O(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function rs(n){return e=>e.lift(new qbe(n))}class qbe{constructor(e){this.notifier=e}call(e,t){const i=new Ybe(e),r=O(this.notifier,new Et(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class Ybe extends pe{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Wu(n,e){return t=>t.lift(new Kbe(n,e))}class Kbe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new Xbe(e,this.compare,this.keySelector))}}class Xbe extends y{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}const Oa={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let Z8=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(n){return"server"===n}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return yn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return yn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof yn||console.warn(Oa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(Oc))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const J8=new zt("ROOT_STATE_TOKEN"),eH=new zt("FEATURE_STATE_TOKEN"),tH=new zt("NGXS_PLUGINS"),nH=new zt("NG_TEST_MODE"),iH=new zt("NG_DEV_MODE"),qu="NGXS_META",rH="NGXS_OPTIONS_META";let If=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=Z8}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class Qbe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const sH=new zt("NGXS_EXECUTION_STRATEGY");function Of(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const oH=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},KS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),wR=n=>n&&"object"==typeof n&&!Array.isArray(n),ER=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(wR(n)&&wR(t))for(const i in t)wR(t[i])?(n[i]||Object.assign(n,{[i]:{}}),ER(n[i],t[i])):Object.assign(n,{[i]:t[i]});return ER(n,...e)};function Fv(n){return n[qu]}function lH(n,e){const t=KS(e.currentAppState,n.path),i=KS(e.newAppState,n.path);return new Qbe(t,i,!n.isInitialised)}function s0e(...n){return function(n,e,t=l0e){const i=function(n){return n.reduce((e,t)=>(e[Of(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Ui(t=>{const i=Of(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function l0e(){return me(n=>n.action)}function XS(n){return e=>new F(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let QS=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(sH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class d0e extends ee{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let ZS=(()=>{class n extends d0e{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),h0e=(()=>{class n extends F{constructor(t,i){super(r=>{const s=t.pipe(XS(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(Ie(ZS),Ie(QS))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const cH=n=>(...e)=>n.shift()(...e,(...i)=>cH(n)(...i));let JS=(()=>{class n extends Ir{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),AR=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(tH,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),TR=(()=>{class n extends ee{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),uH=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Yo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(XS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?nn(this._stateStream.getValue()):Pv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!Of(t))return fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return cH([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(ml())}getActionResultStream(t){return this._actionResults.pipe(Ui(i=>i.action===t&&"DISPATCHED"!==i.status),Xi(1),ml())}createDispatchObservable(t){return t.pipe(Q8(i=>{switch(i.status){case"SUCCESSFUL":return nn(this._stateStream.getValue());case"ERRORED":return fg(i.error);default:return Nc}})).pipe(ml())}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(ZS),Ie(TR),Ie(AR),Ie(JS),Ie(QS))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const dH=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&dH(n[i])}),n};let hH=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(iH),Ie(nH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),fH=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Oa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Oa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(hH),Ie(If))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),em=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=dH(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(Ie(JS),Ie(uH),Ie(If),Ie(fH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),eC=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return KS(l,t.path)}function s(l,c){const d=oH(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=lH(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Oa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Oa.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(em))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class tC{static stateNameErrorMessage(e){return Oa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Oa.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Oa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=Fv(e);if(!t)throw new Error(Oa.STATE_DECORATOR());return t}}tC.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let tm=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=Y8(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(tC.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[qu].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[qu];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[qu].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[qu];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>oH(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ui(t=>"DISPATCHED"===t.status),k(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),_E({action:t,status:"CANCELED"}),Xl(i=>nn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=Of(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=Pe(d)),d instanceof F?(d=d.pipe(_E({})),l.options.cancelUncompleted&&(d=d.pipe(rs(t.pipe(s0e(i)))))):d=nn({}).pipe(ml()),s.push(d)}catch(d){s.push(fg(d))}}}return s.length||s.push(nn({})),Pv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=tC.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==KS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(If),Ie(n,12),Ie(ZS),Ie(TR),Ie(eC),Ie(vR,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),DR=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ui(()=>!!i),jr(()=>this.invokeInit(i.states)),k(()=>this.bootstrapper.appBootstrapped$),Ui(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=lH(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(em),Ie(eC),Ie(yR))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();let ih=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(me(i),Xl(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?nn(void 0):fg(r)}),Wu(),XS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Xi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(XS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=function(n){return n.NGXS_SELECTOR_META}(n)||Fv(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(JS),Ie(em),Ie(If),Ie(QS),Ie(tm),Ie(vR,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),Lv=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(If))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class v0e{static get type(){return"@@INIT"}}class b0e{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const iC=new pg(1);let E0e=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Sa();iC.next(t)}catch(n){iC.next(!1)}finally{iC.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new v0e,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(tm),Ie(em),Ie(ih),Ie(Lv),Ie(J8,8),Ie(DR))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})(),S0e=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new b0e(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(em),Ie(tm),Ie(eH,8),Ie(DR))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();class oa{static forRoot(e=[],t={}){return{ngModule:E0e,providers:[tm,eC,h0e,ZS,yR,fH,hH,DR,uH,TR,em,QS,ih,JS,Lv,AR,...e,...oa.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:S0e,providers:[tm,AR,...e,{provide:eH,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:nH,useValue:zbe},{provide:iH,useValue:Sa},{provide:sH,useClass:t.executionStrategy||Z8},{provide:J8,useValue:e},{provide:oa.ROOT_OPTIONS,useValue:t},{provide:If,useFactory:oa.ngxsConfigFactory,deps:[oa.ROOT_OPTIONS]},{provide:Rw,useFactory:oa.appBootstrapListenerFactory,multi:!0,deps:[yR]},{provide:vR,useFactory:oa.getInitialState},{provide:K8,useExisting:eC},{provide:X8,useExisting:tm}]}static ngxsConfigFactory(e){return ER(new If,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return Hbe.pop()}}function x0e(n){return i=>{!function(n){iC.subscribe(e=>{e&&(n.\u0275prov||console.warn(Oa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(qu)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,qu,{value:e})}return Fv(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[rH]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;tC.checkCorrectStateName(d),s.hasOwnProperty(qu)&&(r.actions=Object.assign({},r.actions,(s[qu]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[rH]=a}}oa.\u0275fac=function(e){return new(e||oa)},oa.\u0275mod=ln({type:oa}),oa.\u0275inj=bt({}),oa.ROOT_OPTIONS=new zt("ROOT_OPTIONS");const Ra=new zt("NgValueAccessor"),gC=new Yl(cE);class Nwe{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Pwe(e,this.dueTime,this.scheduler))}}class Pwe extends y{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Fwe,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function Fwe(n){n.debouncedNext()}function zi(n){return null!=n&&"false"!=`${n}`}function Na(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function Ku(n){return n instanceof wn?n.nativeElement:n}let JR;try{JR="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){JR=!1}let $v,eN,Hi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?lf(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!JR)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(Ie(Oc))},n.\u0275prov=$e({factory:function(){return new n(Ie(Oc))},token:n,providedIn:"root"}),n})(),Gv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();function rm(n){return function(){if(null==$v&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>$v=!0}))}finally{$v=$v||!1}return $v}()?n:!!n.capture}function Pf(n){return n.composedPath?n.composedPath()[0]:n.target}let tN=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:function(){return new n},token:n,providedIn:"root"}),n})(),x6=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Ku(t);return new F(r=>{const o=this._observeElement(i).subscribe(r);return()=>{o.unsubscribe(),this._unobserveElement(i)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const i=new ee,r=this._mutationObserverFactory.create(s=>i.next(s));r&&r.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:r,stream:i,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:i,stream:r}=this._observedElements.get(t);i&&i.disconnect(),r.complete(),this._observedElements.delete(t)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(tN))},n.\u0275prov=$e({factory:function(){return new n(Ie(tN))},token:n,providedIn:"root"}),n})(),A6=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new mn,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=zi(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Na(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe(function(n,e=gC){return t=>t.lift(new Nwe(n,e))}(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(De(x6),De(wn),De(yn))},n.\u0275dir=kt({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),nN=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[tN]}),n})();function k6(n){return 0===n.offsetX&&0===n.offsetY}function B6(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const j6=new zt("cdk-input-modality-detector-options"),aEe={ignoreKeys:[18,17,224,91,16]},sm=rm({passive:!0,capture:!0});let U6=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Ir(null),this._lastTouchMs=0,this._onKeydown=o=>{var a,l;(null===(l=null===(a=this._options)||void 0===a?void 0:a.ignoreKeys)||void 0===l?void 0:l.some(c=>c===o.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Pf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(k6(o)?"keyboard":"mouse"),this._mostRecentTarget=Pf(o))},this._onTouchstart=o=>{B6(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Pf(o))},this._options=Object.assign(Object.assign({},aEe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new Mne(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(Wu()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,sm),r.addEventListener("mousedown",this._onMousedown,sm),r.addEventListener("touchstart",this._onTouchstart,sm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,sm),document.removeEventListener("mousedown",this._onMousedown,sm),document.removeEventListener("touchstart",this._onTouchstart,sm))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hi),Ie(yn),Ie(un),Ie(j6,8))},n.\u0275prov=$e({factory:function(){return new n(Ie(Hi),Ie(yn),Ie(un),Ie(j6,8))},token:n,providedIn:"root"}),n})();const G6=new zt("cdk-focus-monitor-default-options"),wC=rm({passive:!0,capture:!0});let Xu=(()=>{class n{constructor(t,i,r,s,o){this._ngZone=t,this._platform=i,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new ee,this._rootNodeFocusAndBlurListener=a=>{const l=Pf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let d=l;d;d=d.parentElement)c.call(this,a,d)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=Ku(t);if(!this._platform.isBrowser||1!==r.nodeType)return nn(null);const s=function(n){if(function(){if(null==eN){const n="undefined"!=typeof document?document.head:null;eN=!(!n||!n.createShadowRoot&&!n.attachShadow)}return eN}()){const e=n.getRootNode?n.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(r)||this._getDocument(),o=this._elementInfo.get(r);if(o)return i&&(o.checkChildren=!0),o.subject;const a={checkChildren:i,subject:new ee,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Ku(t),r=this._elementInfo.get(i);r&&(r.subject.complete(),this._setClasses(i),this._elementInfo.delete(i),this._removeGlobalListeners(r))}focusVia(t,i,r){const s=Ku(t);s===this._getDocument().activeElement?this._getClosestElementsInfo(s).forEach(([a,l])=>this._originChanged(a,i,l)):(this._setOrigin(i),"function"==typeof s.focus&&s.focus(r))}ngOnDestroy(){this._elementInfo.forEach((t,i)=>this.stopMonitoring(i))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,i,r){r?t.classList.add(i):t.classList.remove(i)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,i){this._toggleClass(t,"cdk-focused",!!i),this._toggleClass(t,"cdk-touch-focused","touch"===i),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===i),this._toggleClass(t,"cdk-mouse-focused","mouse"===i),this._toggleClass(t,"cdk-program-focused","program"===i)}_setOrigin(t,i=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&i,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,i){const r=this._elementInfo.get(i),s=Pf(t);!r||!r.checkChildren&&i!==s||this._originChanged(i,this._getFocusOrigin(s),r)}_onBlur(t,i){const r=this._elementInfo.get(i);!r||r.checkChildren&&t.relatedTarget instanceof Node&&i.contains(t.relatedTarget)||(this._setClasses(i),this._emitOrigin(r.subject,null))}_emitOrigin(t,i){this._ngZone.run(()=>t.next(i))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const i=t.rootNode,r=this._rootNodeFocusListenerCount.get(i)||0;r||this._ngZone.runOutsideAngular(()=>{i.addEventListener("focus",this._rootNodeFocusAndBlurListener,wC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,wC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(rs(this._stopInputModalityDetector)).subscribe(s=>{this._setOrigin(s,!0)}))}_removeGlobalListeners(t){const i=t.rootNode;if(this._rootNodeFocusListenerCount.has(i)){const r=this._rootNodeFocusListenerCount.get(i);r>1?this._rootNodeFocusListenerCount.set(i,r-1):(i.removeEventListener("focus",this._rootNodeFocusAndBlurListener,wC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,wC),this._rootNodeFocusListenerCount.delete(i))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,i,r){this._setClasses(t,i),this._emitOrigin(r.subject,i),this._lastFocusOrigin=i}_getClosestElementsInfo(t){const i=[];return this._elementInfo.forEach((r,s)=>{(s===t||r.checkChildren&&s.contains(t))&&i.push([s,r])}),i}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(Hi),Ie(U6),Ie(un,8),Ie(G6,8))},n.\u0275prov=$e({factory:function(){return new n(Ie(yn),Ie(Hi),Ie(U6),Ie(un,8),Ie(G6,8))},token:n,providedIn:"root"}),n})();const $6="cdk-high-contrast-black-on-white",W6="cdk-high-contrast-white-on-black",rN="cdk-high-contrast-active";let q6=(()=>{class n{constructor(t,i){this._platform=t,this._document=i}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const i=this._document.defaultView||window,r=i&&i.getComputedStyle?i.getComputedStyle(t):null,s=(r&&r.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),s){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(rN),t.remove($6),t.remove(W6),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(rN),t.add($6)):2===i&&(t.add(rN),t.add(W6))}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hi),Ie(un))},n.\u0275prov=$e({factory:function(){return new n(Ie(Hi),Ie(un))},token:n,providedIn:"root"}),n})(),qv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const K6=new Cu("12.2.5");function Z6(n){Promise.resolve(null).then(n)}class am{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Z6(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function e5(){return"undefined"!=typeof window&&void 0!==window.document}function oN(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let uN=(n,e)=>!1,dN=(n,e)=>!1,i5=(n,e,t)=>[];const r5=oN();(r5||"undefined"!=typeof Element)&&(uN=e5()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),dN=(()=>{if(r5||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):dN}})(),i5=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return hN(t)}matchesElement(t,i){return fN(t,i)}containsElement(t,i){return pN(t,i)}query(t,i,r){return gN(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new am(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class EC{}EC.NOOP=new a5;function d5(n,e,t){return t?e+":"+t+";":""}function h5(n){let e="";for(let t=0;t{const r=bN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),oN()&&h5(n))}function kf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=bN(t);n.style[i]=""}),oN()&&h5(n))}const bEe=/-+([a-z0-9])/g;function bN(n){return n.replace(bEe,(...e)=>e[1].toUpperCase())}function wEe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class um{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=um.initialStylesByElement.get(e);r||um.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&eu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(eu(this._element,this._initialStyles),this._endStyles&&(eu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(um.initialStylesByElement.delete(this._element),this._startStyles&&(kf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(kf(this._element,this._endStyles),this._endStyles=null),eu(this._element,this._initialStyles),this._state=3)}}um.initialStylesByElement=new WeakMap;const sc=new zt("AnimationModuleType"),X5=new Cu("12.2.5"),zSe=new zt("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let jf,pr=(()=>{class n{constructor(t,i,r){this._hasDoneGlobalChecks=!1,this._document=r,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=i,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!Sa()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const i=getComputedStyle(t);i&&"none"!==i.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&X5.full!==K6.full&&console.warn("The Angular Material version ("+X5.full+") does not match the Angular CDK version ("+K6.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(Ie(q6),Ie(zSe,8),Ie(un))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[qv],qv]}),n})();function UC(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=zi(e)}}}function Xv(n,e){return class extends n{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const i=t||this.defaultColor;i!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),i&&this._elementRef.nativeElement.classList.add(`mat-${i}`),this._color=i)}}}function FN(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=zi(e)}}}function LN(n,e=0){return class extends n{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?Na(t):this.defaultTabIndex}}}try{jf="undefined"!=typeof Intl}catch(n){jf=!1}class tCe{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const J5={enterDuration:225,exitDuration:150},kN=rm({passive:!0}),eG=["mousedown","touchstart"],tG=["mouseup","mouseleave","touchend","touchcancel"];class iCe{constructor(e,t,i,r){this._target=e,this._ngZone=t,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=Ku(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},J5),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);const o=i.radius||function(n,e,t){const i=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),r=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),a=e-r.left,l=t-r.top,c=s.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=a-o+"px",d.style.top=l-o+"px",d.style.height=2*o+"px",d.style.width=2*o+"px",null!=i.color&&(d.style.backgroundColor=i.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(d),d.style.transform="scale(1)";const f=new tCe(this,d,i);return f.state=0,this._activeRipples.add(f),i.persistent||(this._mostRecentTransientRipple=f),this._runTimeoutOutsideZone(()=>{const p=f===this._mostRecentTransientRipple;f.state=1,!i.persistent&&(!p||!this._isPointerDown)&&f.fadeOut()},c),f}fadeOutRipple(e){const t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!t)return;const i=e.element,r=Object.assign(Object.assign({},J5),e.config.animation);i.style.transitionDuration=`${r.exitDuration}ms`,i.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(()=>{e.state=3,i.parentNode.removeChild(i)},r.exitDuration)}fadeOutAll(){this._activeRipples.forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Ku(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(eG))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(tG),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=k6(e),i=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(1===e.state||e.config.terminateOnPointerUp&&0===e.state)&&e.fadeOut()}))}_runTimeoutOutsideZone(e,t=0){this._ngZone.runOutsideAngular(()=>setTimeout(e,t))}_registerEvents(e){this._ngZone.runOutsideAngular(()=>{e.forEach(t=>{this._triggerElement.addEventListener(t,this,kN)})})}_removeTriggerEvents(){this._triggerElement&&(eG.forEach(e=>{this._triggerElement.removeEventListener(e,this,kN)}),this._pointerUpEventsRegistered&&tG.forEach(e=>{this._triggerElement.removeEventListener(e,this,kN)}))}}const oCe=new zt("mat-ripple-global-options");let dm=(()=>{class n{constructor(t,i,r,s,o){this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=s||{},this._rippleRenderer=new iCe(this,i,t,r)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,i=0,r){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,i,Object.assign(Object.assign({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return n.\u0275fac=function(t){return new(t||n)(De(wn),De(yn),De(Hi),De(oCe,8),De(sc,8))},n.\u0275dir=kt({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&Ei("mat-ripple-unbounded",i.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),n})(),HC=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[pr,Gv],pr]}),n})();new class extends Yl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let yCe=1;const vCe=Promise.resolve(),GC={};function oG(n){return n in GC&&(delete GC[n],!0)}const aG={setImmediate(n){const e=yCe++;return GC[e]=!0,vCe.then(()=>oG(e)&&n()),e},clearImmediate(n){oG(n)}};new class extends Yl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=aG.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(aG.clearImmediate(t),e.scheduled=void 0)}});function Zv(n){return!!n&&(n instanceof F||"function"==typeof n.lift&&"function"==typeof n.subscribe)}function VG(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>me(function(n,e){return i=>{let r=i;for(let s=0;s{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new QAe(n,t))}}"undefined"!=typeof window&&window,tt(266),tt(478),new zt("SECURITY_CONTEXT");class QAe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new ZAe(e,this.observables,this.project))}}class ZAe extends k3{constructor(e,t,i){super(e),this.observables=t,this.project=i,this.toRespond=[];const r=t.length;this.values=new Array(r);for(let s=0;s0){const s=r.indexOf(i);-1!==s&&r.splice(s,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}function rb(n){return!0===n}function La(n){return null==n}function ka(n){return!La(n)}function sP(n){return Boolean(n)}function I$(n){return La(n)?n:JSON.parse(JSON.stringify(n))}const ax=n=>{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&ax(n[o])}),n};function O$(n){return ka(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const P$="NGXS_DATA_META",aP="NGXS_META",F$="NGXS_ARGUMENT_REGISTRY_META";let L$=(()=>{class n{constructor(t){this.sequence$=new Ir(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function sb(n){return n[P$]}let Ba=(()=>{class n{constructor(t,i,r){n.store=t.get(ih),n.ngZone=t.get(yn),n.factory=i,n.context=r,n.computed=t.get(L$)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(X8),Ie(K8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class os{constructor(){os.statesCachedMeta.clear()}static createStateContext(e){return Ba.context.createStateContext(e)}static ensureMappedState(e){if(La(Ba.factory)||La(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(ka(e.name)?os.statesCachedMeta.get(e.name):null)||os.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=sb(os.getStateClassByInstance(e)))&&void 0!==t?t:null;if(La(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=os.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=os.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=ka(e.name)?null===(t=Ba.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return ka(i)&&ka(e.name)&&os.statesCachedMeta.set(e.name,i),i}}os.statesCachedMeta=new Map,os.\u0275fac=function(e){return new(e||os)},os.\u0275prov=$e({token:os,factory:os.\u0275fac}),new pg(1);class NTe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${ka(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function k$(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function B$(n){var e;const t=k$(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=I$(void 0===t.defaults?{}:t.defaults);if(i.length){if(O$(s))return function(n,e){return e.reduce((t,i)=>{const r=k$(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=B$(i),t},null!=n?n:{})}(s,i);throw new NTe(s)}return s}function V$(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function U$(){var n,e;return null!==(e=null===(n=null==Ba?void 0:Ba.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function kTe(n){let e=!1;return Zv(n)&&(e=!0),e}function lP(n){return n[F$]}class BTe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class jTe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(sP(this.argumentMap.has(e))||sP(this.payloadMap.has(e)))throw new BTe(e,t)}}function $Te(n){return{enumerable:!0,configurable:!0,get(){const e=sb(n),t=os.ensureMappedState(e.stateMeta);return os.createStateContext(t)}}}function z$(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(O$(i))for(;null!==i;){if(rb(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return La(V$(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),V$(n)}(this),o=null==s?void 0:s.get(i);if(rb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(La(o)||o.sequenceId!==U$()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:U$(),isObservable:kTe(l)}),l}return o.value},t}}const QTe={cancelUncompleted:!0,insideZone:!1};function cP(n=QTe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=os.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=lP(r);if(La(f)){const G=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),ge=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var G;return rb(n.insideZone)?null===(G=Ba.ngZone)||void 0===G||G.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Zv(l)?nn(null).pipe(me(()=>l)):l};const T=os.createAction(f,o,g),q=Ba.store.dispatch(T);return Zv(l)?function(n,e){return Pv([n,e]).pipe(me(t=>t.pop()))}(q,l):l},i}}function H$(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return La(lP(t))&&Object.defineProperties(t,{[F$]:{enumerable:!0,configurable:!0,value:new jTe}}),lP(t)})(e,t).createPayloadType(r,t,i)}}function JTe(){return n=>{const e=function(n){if(function(n){return!sP(n)}(n.hasOwnProperty(aP))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,aP,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[aP]}(n)}(n);if(La(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=sb(n))&&void 0!==e?e:null;return(La(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,P$,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),sb(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>I$(t)},context:$Te(n)})}(n,e,B$(n)),function(n){var e,t;const i=sb(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(ka(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(ka(this[s]))return this[s];if(La(Ba.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ba.store.select(n).pipe(me(o=>Sa()?ax(o):o),ml({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let tDe=(()=>{class n{constructor(){this.browserStorageEvents$=new ee,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),nDe=(()=>{class n extends tDe{get snapshot(){return function(n){return Sa()?ax(n):n}(this.getState())}get ctx(){return function(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>Sa()?ax(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),Ca([z$(),Kl("design:type",Object),Kl("design:paramtypes",[])],n.prototype,"snapshot",null),Ca([cP(),P3(0,H$("patchValue")),Kl("design:type",Function),Kl("design:paramtypes",[Object]),Kl("design:returntype",void 0)],n.prototype,"patchState",null),Ca([cP(),P3(0,H$("stateValue")),Kl("design:type",Function),Kl("design:paramtypes",[Object]),Kl("design:returntype",void 0)],n.prototype,"setState",null),Ca([cP(),Kl("design:type",Function),Kl("design:paramtypes",[]),Kl("design:returntype",void 0)],n.prototype,"reset",null),n})();const pDe=["bodyCanvas"];let gDe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new mn,this.nodeDrag=new mn,this.nodeClick=new mn,this.nodeHoverStart=new mn,this.nodeHoverStop=new mn,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return or(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new Bbe({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Mr(pDe,5,wn),2&t){let r;di(r=hi())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Tc(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&wi(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),mDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr]]}),n})();new zt("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const Z$=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}];Z$.filter(n=>!0!==n.disabled);let cx=(()=>{let n=class extends nDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ui(n=>null!=n),ml(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(VG(...t),Wu(),ml(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(VG(...t),Wu(),ml(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),Ca([z$()],n.prototype,"config$",null),n=Ca([JTe(),x0e({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();function tu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let dP;function ac(){return dP||(dP=function(n,e){const t=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const i=()=>indexedDB.databases().finally(t);e=setInterval(i,100),i()}).finally(()=>clearInterval(e))}().then(()=>{const i=indexedDB.open("keyval-store");return i.onupgradeneeded=()=>i.result.createObjectStore(e),tu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),dP}function J$(n,e=ac()){return e("readonly",t=>tu(t.get(n)))}var Gi=tt(440),KDe=tt(698),XDe=tt(445),QDe=tt.n(XDe),pi=tt(815),dh=tt(609);const $i=Gi.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},Gi.DataFactory),eW={x:$i("rdf"),type:$i("rdf")("type")},_m={x:$i("rdfs"),label:$i("rdfs")("label"),comment:$i("rdfs")("comment"),isDefinedBy:$i("rdfs")("isDefinedBy"),seeAlso:$i("rdfs")("seeAlso")},gi={x:$i("entity"),id:$i("entity")("id"),label:_m.label,description:_m.comment,link:_m.seeAlso,sex:$i("entity")("sex"),age:$i("entity")("age"),bmi:$i("entity")("bmi"),Male:Gi.DataFactory.literal("Male"),Female:Gi.DataFactory.literal("Female"),consortiumName:$i("entity")("consortium_name"),providerName:$i("entity")("provider_name"),providerUUID:$i("entity")("provider_uuid"),donor:$i("entity")("has_donor"),sections:$i("entity")("has_tissue_section"),datasets:$i("entity")("has_dataset"),sampleType:$i("entity")("sample_type"),TissueBlock:Gi.DataFactory.literal("Tissue Block"),TissueSection:Gi.DataFactory.literal("Tissue Section"),NonStandard:Gi.DataFactory.literal("Non-standard"),sectionCount:$i("entity")("section_count"),sectionSize:$i("entity")("section_size"),sectionUnits:$i("entity")("section_units"),sectionNumber:$i("entity")("section_number"),spatialEntity:$i("entity")("has_spatial_entity"),ontologyTerms:$i("entity")("has_ontology_term"),technology:$i("entity")("technology"),thumbnail:$i("entity")("has_thumbnail")},In=$i("ccf"),lr={x:In,ontologyNode:{label:In("ccf_preferred_label"),parent:In("ccf_part_of"),children:In("ccf_part_of"),rui_rank:In("ccf_rui_rank"),synonymLabels:Gi.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:In("VHFemale"),Male:In("VHMale"),BothSexes:In("VHBothSexes"),FemaleOrgans:In("VHFemaleOrgans"),MaleOrgans:In("VHMaleOrgans")},SpatialObjectReference:In("SpatialObjectReference"),SpatialEntity:In("SpatialEntity"),SpatialPlacement:In("SpatialPlacement"),spatialObjectReference:{file:In("has_object_file"),file_format:In("has_object_file_format"),file_subpath:In("has_object_file_subpath")},extractionSet:{label:_m.label,rui_rank:In("ccf_rui_rank")},spatialEntity:{label:_m.label,comment:_m.comment,creator:$i("dc")("creator"),creator_first_name:In("creator_first_name"),creator_last_name:In("creator_last_name"),creator_orcid:In("creator_orcid"),creation_date:In("creation_date"),updated_date:In("updated_date"),ccf_annotations:In("ccf_annotation"),representation_of:In("ccf_representation_of"),reference_organ:In("anatomical_structure_of"),extraction_set_for:In("extraction_set_for"),extraction_set:In("extraction_site_for"),sex:In("has_sex"),side:In("has_side"),rui_rank:In("ccf_rui_rank"),slice_thickness:In("ccf_slice_thickness"),slice_count:In("ccf_slice_count"),x_dimension:In("has_x_dimension"),y_dimension:In("has_y_dimension"),z_dimension:In("has_z_dimension"),dimension_units:In("has_dimension_units"),object:In("has_object_reference")},spatialPlacement:{source:In("has_placement_source"),target:In("has_placement_target"),placement_date:In("has_placement_date"),x_scaling:In("has_x_scaling"),y_scaling:In("has_y_scaling"),z_scaling:In("has_z_scaling"),scaling_units:In("has_scaling_units"),x_rotation:In("has_x_rotation"),y_rotation:In("has_y_rotation"),z_rotation:In("has_z_rotation"),w_rotation:In("has_theta_rotation"),rotation_order:In("has_rotation_order"),rotation_units:In("has_rotation_units"),x_translation:In("has_x_translation"),y_translation:In("has_y_translation"),z_translation:In("has_z_translation"),translation_units:In("has_translation_units")}},Ar={x:$i("uberon")},tW=($i("lmha"),{bladder:Ar.x("0001255"),body:Ar.x("0013702"),brain:Ar.x("0000955"),colon:Ar.x("0001155"),heart:Ar.x("0000948"),kidney:Ar.x("0002113"),large_intestine:Ar.x("0000059"),left_kidney:Ar.x("0004538"),left_lung:Ar.x("0002168"),left_ureter:Ar.x("0001223"),liver:Ar.x("0002107"),lung:Ar.x("0002048"),respiratory_system:Ar.x("0001004"),lymph_node:Ar.x("0000029"),pelvis:Ar.x("0001270"),rectum:Ar.x("0001052"),right_kidney:Ar.x("0004539"),right_lung:Ar.x("0002167"),right_ureter:Ar.x("0001222"),skin:Ar.x("0002097"),small_intestine:Ar.x("0002108"),spleen:Ar.x("0002106"),thymus:Ar.x("0002370"),ureter:Ar.x("0000056"),vasculature:Ar.x("0002049")});function fP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const ux={spatialObjectReference:fP(lr.spatialObjectReference),spatialEntity:fP(lr.spatialEntity),spatialPlacement:fP(lr.spatialPlacement)};function dx(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,dh.fromRdf)(s.object):s.object.id;(0,pi.set)(r,o,a)}return!1},Gi.DataFactory.namedNode(e),null,null,null),r}const eMe=(0,pi.memoize)(function(n,e){return dx(n,e,"SpatialObjectReference",ux.spatialObjectReference)},(n,e)=>e),nW=(0,pi.memoize)(function(n,e){const t=dx(n,e,"ExtractionSet",ux.spatialEntity);return t.extractionSites=(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set,e,null).map(i=>Hf(n,i.id)),["rui_rank"]),t},(n,e)=>e),iMe=(0,pi.memoize)(function(n,e){return(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set_for,e,null).map(t=>nW(n,t.id)),["rui_rank"])},(n,e)=>e),sMe=(0,pi.memoize)(function(n,e){return(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.reference_organ,e,null).map(t=>Hf(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),aMe=(0,pi.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(Hf(n,t.subject.id))},null,lr.spatialEntity.reference_organ,null,null),(0,pi.sortBy)(e,["rui_rank"])}),Hf=(0,pi.memoize)(function(n,e){const t=dx(n,e,"SpatialEntity",ux.spatialEntity);return t.object&&(t.object=eMe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,lr.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,gi.spatialEntity,e,null),t},(n,e)=>e),uMe=(0,pi.memoize)(function(n,e){const t=dx(n,e,"SpatialPlacement",ux.spatialPlacement);return t.source&&(t.source=Hf(n,t.source)),t.target&&(t.target=Hf(n,t.target)),t},(n,e)=>e),hMe=(0,pi.memoize)(function(n,e){const t=n.getObjects(Gi.DataFactory.namedNode(e),gi.spatialEntity,null);if(t.length>0)return Hf(n,t[0].id)},(n,e)=>e);function fMe(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(zj),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class iW{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new KDe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},eW.type,lr.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},eW.type,lr.SpatialEntity,null);const t={};e.some(i=>(t[i.subject.id]=i.object.id,!1),null,lr.spatialPlacement.source,null,null),e.some(i=>{const r=t[i.subject.id];return r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement"),!1},null,lr.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,i,r){this.graph.mergeDirectedEdge(t,i,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new Gn(Gn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new Gn(Gn.IDENTITY),s=QDe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s){if(o){const l=this.graph.getEdgeAttribute(a,o,"id");fMe(r,uMe(i,l))}o=a}return r}}}class rW{constructor(e){this.db=e}getSpatialEntity(e){return Hf(this.db.store,e)}getExtractionSets(e){return iMe(this.db.store,e)}getExtractionSet(e){return nW(this.db.store,e)}getAnatomicalStructures(e){return sMe(this.db.store,e)}getReferenceOrgans(){return aMe(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=lr.spatial.Male.id;break;case"Female":t=lr.spatial.Female.id;break;case"Both":default:t=lr.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(i=>"Male"===i.sex);break;case"Female":t=t.filter(i=>"Female"===i.sex)}return(null==e?void 0:e.debug)&&(t=t.map(i=>[[i],this.getAnatomicalStructures(i["@id"])]).reduce((i,[r,s])=>i.concat(s.length>0?s:r),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let i=[...this.getReferenceOrganSets(e).map(r=>{const s="http://purl.obolibrary.org/obo/UBERON_0002097"===r.representation_of;return this.getSceneNode(r,t,{color:[255,255,255,255],opacity:s?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!s})})];return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(lr.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(r=>void 0!==r)}getReferenceOrganScene(e,t){var i,r;const s=null!==(i=void 0!==(null==t?void 0:t.sex))&&void 0!==i&&i,o=this.getReferenceOrgans().filter(a=>a.representation_of===e&&(!s||a.sex===(null==t?void 0:t.sex)));if(o.length>0){const a=o[0],c=this.getSceneNode(a,a,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===a.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),d=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(f=>this.getSceneNode(f,a,{color:[255,255,255,229.5]}));return[c].concat(d).filter(f=>void 0!==f)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(i=>this.getSceneNode(i,t,{color:[255,255,255,229.5]})).filter(i=>void 0!==i)}getSceneNode(e,t,i={}){var r,s,o,a;const l=null===(s=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===s?void 0:s.startsWith("model/gltf");let d=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(d){if(l)d=new Gn(Gn.IDENTITY).rotateX(zj(90)).multiplyLeft(d);else{let f;switch(e.dimension_units){case"centimeter":f=.01;break;case"millimeter":f=.001;break;case"meter":default:f=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*f/2);d.scale(p)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:l?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:l?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:d,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const hx="https://entity.api.hubmapconsortium.org/entities/",sW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),pMe={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},fx={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},Ti=function(){const n={};return Object.entries(tW).forEach(([e,t])=>n[e]=t.id),n}(),mMe={BL:[Ti.body,Ti.bladder],RK:[Ti.body,Ti.kidney,Ti.right_kidney],LK:[Ti.body,Ti.kidney,Ti.left_kidney],HT:[Ti.body,Ti.heart],LI:[Ti.body,Ti.large_intestine,Ti.colon],SI:[Ti.body,Ti.small_instestine],LL:[Ti.body,Ti.respiratory_system,Ti.lung,Ti.left_lung],RL:[Ti.body,Ti.respiratory_system,Ti.lung,Ti.right_lung],LY:[Ti.body,Ti.lymph_node],SP:[Ti.body,Ti.spleen],TH:[Ti.body,Ti.thymus],UR:[Ti.body,Ti.ureter],LV:[Ti.body,Ti.liver],OT:[Ti.body]},oW={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class vMe{constructor(e,t="",i="",r){var s,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const c=this.data.descendants||[],d=(this.data.ancestors||[]).find(We=>"Donor"===We.entity_type);this.donor=this.getDonor(d,i);const f=this.getRuiLocation(e,this.donor);f?this.rui_location=f:this.bad=!0;const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=fx[e.group_uuid]||e.group_name,_=e.created_by_user_displayname;this["@id"]=hx+e.uuid,this.label=`Registered ${p}, ${_}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const x={},T=[];this.sections=T;const q=[];this.datasets=q;for(const We of c.filter(dt=>"Sample"===dt.entity_type)){const dt=this.getSection(We,e,i);x[We.submission_id]=dt,T.push(dt),dt.section_number=null!==(s=dt.section_number)&&void 0!==s?s:T.length}for(const We of c)if("Dataset"===We.entity_type){const dt=this.getDataset(We,t,i,r),Mt=(0,pi.get)(We,["ingest_metadata","metadata","tissue_id"]);x[Mt]?null===(o=x[Mt].datasets)||void 0===o||o.push(dt):q.push(dt)}const G=null!=f?f:{},ge=`${G.x_dimension} x ${G.y_dimension} x ${G.z_dimension} ${G.dimension_units}`;this.section_count=G.slice_count||T.length;const Ne=parseFloat((G.slice_thickness||(G.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ne;const Ge=G.dimension_units||"millimeter";this.section_units=Ge,this.description=`${ge}, ${Ne} ${Ge}, ${e.specimen_type}, ${this.section_count} Sections`,T.forEach((We,dt)=>{We.description=`${G.x_dimension} x ${G.y_dimension} x ${Ne} ${Ge}, ${Ne} ${Ge}, ${We.description}`,We.section_number=dt+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":hx+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${fx[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${i}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",i="",r){var s;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=fx[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,pi.get)(e,["ingest_metadata","metadata","assay_type"],"")],d=c.join("|").toLowerCase();let f,p="assets/icons/ico-unknown.svg";return-1!==d.indexOf("10x")?(f="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==d.indexOf("af")?(f="AF",p="assets/icons/ico-spatial-af.svg"):-1!==d.indexOf("codex")?(f="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==d.indexOf("imc")?(f="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==d.indexOf("lc")&&-1===d.indexOf("af")?(f="LC",p="assets/icons/ico-bulk-lc.svg"):f=-1!==d.indexOf("maldi")?"MALDI":-1!==d.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":hx+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:f,thumbnail:p}}getDatasetThumbnail(e,t,i){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(i?`?token=${i}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,pi.get)(e,"metadata.files",[]).filter(s=>/\.(ome\.tif|ome\.tiff)$/.test(s.rel_path)).filter(s=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(s.rel_path)).filter(s=>sW.has(s.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(s=>`${t}/${e.uuid}/${s.rel_path}`+(i?`?token=${i}`:""));if(r.length>0){const s=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(sW.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=pMe[e.hubmap_id];if(r)return`assets/thumbnails/TMC-Florida/${r}`}}getDonor(e,t){const i=(e.description||"").toLowerCase();let r;i.includes("female")?r="Female":i.includes("male")&&(r="Male");const s=i.match(/age ([0-9]+)/);let o,a;s&&(o=(0,pi.toNumber)(s[1]));for(const p of(0,pi.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===p.preferred_term||"Female"===p.preferred_term?r="Female":"Masculine gender"===p.preferred_term||"Male"===p.preferred_term?r="Male":"Current chronological age"===p.preferred_term||"Age"===p.preferred_term?o=(0,pi.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,pi.toNumber)(p.data_value));let l="";r&&o&&(l+=`${r}, Age ${o}`,a&&(l+=`, BMI ${a.toFixed(1)}`));const c=new Date(e.last_modified_timestamp).toLocaleDateString(),d=fx[e.group_uuid]||e.group_name;return{"@id":hx+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${d}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;const s=(e.ancestors||[]).find(c=>"Sample"===c.entity_type&&"organ"===c.specimen_type),o=mMe[null==s?void 0:s.organ]||[Ti.body];let a,l=e.rui_location;if(l&&("string"==typeof l&&(l=JSON.parse(l)),l.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):l["@id"]&&(a=l)),a){a.ccf_annotations=o.concat(a.ccf_annotations||[]);const c=null!==(i=(0,pi.get)(a,["placement","target"]))&&void 0!==i?i:"";c.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,pi.set)(a,["placement","target"],c.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===c||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===c)&&(0,pi.set)(a,["placement","target"],"Male"===t.sex?c.replace("#VH","#VHM")+"_Patch":c.replace("#VH","#VHF")+"_Patch")}return a}getTissueBlock(){return(0,pi.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function aW(n,e,t,i,r="",s=""){return or(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(n).then(a=>a.ok?a.json():void 0).catch(()=>{});else if("search-api"===e){const a={"Content-type":"application/json"};i&&i.length>0&&(a.Authorization=`Bearer ${i}`),o=yield fetch(n,{method:"POST",headers:a,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:{exists:{field:"rui_location"}}})}).then(l=>l.ok?l.json():void 0).catch(()=>{})}if(o)return function(n,e="",t="",i,r=!1){const o={},a=(0,pi.get)(n,"hits.hits",[]).map(c=>(0,pi.get)(c,"_source",{})).map(c=>new vMe(c,e,t,i).toJsonLd());for(const c of a){const d=c["@id"];o[d]?o[d].samples.push(c.samples[0]):o[d]=c}const l=Object.values(o);return r&&(function(n){let e=[],t=0;for(const i of n.filter(r=>r.samples.length>1)){const r=i.samples;for(let s=0;sc["@id"]===o)&&(r[s].deleteMe=!0,t++)}i.samples=r.filter(s=>!0!==s.deleteMe)}t>0&&console.log(`\u26a0 ${t} sections identified as blocks`)}(l),console.log(l.map(c=>Object.assign({"@context":oW},c)))),{"@context":oW,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function px(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.donor,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}function ob(n,e){return t=>n.has(t.id)?e.add(t.id):void 0}const FMe={[lr.ontologyNode.label.id]:"label",[lr.ontologyNode.parent.id]:"parent",[lr.ontologyNode.synonymLabels.id]:"synonymLabels"};function LMe(n,e){const t=Gi.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return n.some(r=>{const s=FMe[r.predicate.id];if(s){const o="Literal"===r.object.termType?(0,dh.fromRdf)(r.object):r.object.id;"synonymLabels"===s?i.synonymLabels.push(o):(0,pi.set)(i,s,o)}return!1},t,null,null,null),i.children=n.getSubjects(lr.ontologyNode.children,t,null).map(r=>r.id),i}const gx={[gi.label.id]:"label",[gi.description.id]:"description",[gi.link.id]:"link"},BMe=Object.assign(Object.assign({},gx),{[gi.providerName.id]:"providerName"}),jMe=Object.assign(Object.assign({},gx),{[gi.technology.id]:"technology",[gi.thumbnail.id]:"thumbnail"}),VMe=Object.assign(Object.assign({},gx),{[gi.sampleType.id]:"sampleType",[gi.sectionNumber.id]:"sectionNumber",[gi.datasets.id]:"datasets"}),UMe=Object.assign(Object.assign({},gx),{[gi.sampleType.id]:"sampleType",[gi.sectionCount.id]:"sectionCount",[gi.sectionSize.id]:"sectionSize",[gi.sectionUnits.id]:"sectionUnits",[gi.donor.id]:"donor",[gi.spatialEntity.id]:"spatialEntityId",[gi.sections.id]:"sections",[gi.datasets.id]:"datasets"}),HMe=(0,pi.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=BMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;(0,pi.set)(t,r,s)}return!1},Gi.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function lW(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=jMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;(0,pi.set)(t,r,s)}return!1},Gi.DataFactory.namedNode(e),null,null,null),t}const WMe=(0,pi.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=UMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=VMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=lW(n,s);t[r].push(o)}else(0,pi.set)(t,r,s)}return!1},Gi.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=lW(n,s);t[r].push(o)}else"donor"===r?t[r]=HMe(n,s):(0,pi.set)(t,r,s)}return!1},Gi.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e),qMe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class YMe{constructor(e=qMe){this.options=e,this.store=new Gi.Store(void 0,{factory:Gi.DataFactory}),this.graph=new iW(this),this.scene=new rW(this)}connect(e,t=!1){return or(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return or(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield J$(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=ac()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),tu(t.transaction)))}([i,t]).catch(()=>{}):s=yield J$(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=ac()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),tu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return or(this,void 0,void 0,function*(){const i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],s=this.options.ccfOwlUrl;if(s.endsWith(".n3store.json")){const o=yield fetch(s).then(a=>a.text()).catch(()=>console.log("Couldn't locate serialized store."));o&&(this.store=(0,Gi.deserializeN3Store)(o,Gi.DataFactory))}else(null==s?void 0:s.length)>0&&r.push(s);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(aW(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(o=>{if(o)return this.addDataSources([o])}))),i.push(this.addDataSources(r)),yield Promise.all(i),yield this.synchronize()})}addDataSources(e,t){return or(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>or(this,void 0,void 0,function*(){"string"==typeof r?r.endsWith("jsonld")?yield(0,Gi.addJsonLdToStore)(r,i):r.endsWith("n3")?yield(0,Gi.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,Gi.addRdfXmlToStore)(r,i):yield(0,Gi.addJsonLdToStore)(r,i):yield(0,Gi.addJsonLdToStore)(r,i)}))),this})}synchronize(){return or(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,Gi.serializeN3Store)(this.store)}deserialize(e){return or(this,void 0,void 0,function*(){this.store=(0,Gi.deserializeN3Store)(e,Gi.DataFactory),this.graph=new iW(this),this.scene=new rW(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e){var t,i,r,s,o;let a=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),gi.spatialEntity,null,null),e}(n);if(a.size>0&&(a=function(n,e,t=!0){const i=new Set;if(n.forSubjects(ob(e,i),gi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const l=e.sex;a=px(n,a,c=>function(n,e,t){const i=new Set;return n.forSubjects(ob(e,i),gi.sex,gi[t],null),i}(n,c,l))}if(a.size>0&&(null===(t=e.tmc)||void 0===t?void 0:t.length)>0&&(a=px(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Gi.DataFactory.literal(r);n.forSubjects(ob(e,i),gi.providerName,s,null)}return i}(n,l,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set,o=new Set;n.some(c=>(e.has(c.subject.id)&&o.add(c.object.id),!1),null,gi.sections,null,null),n.some(c=>{var d;return(e.has(c.subject.id)||o.has(c.subject.id))&&(s.add(c.object.id),r.has(c.object.id)?null===(d=r.get(c.object.id))||void 0===d||d.push(c.subject.id):r.set(c.object.id,[c.subject.id])),!1},null,gi.datasets,null,null);const a=t(s),l=new Set;for(const c of a)for(const d of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(d);return l}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Gi.DataFactory.literal(r);n.forSubjects(ob(e,i),gi.technology,s,null)}return i}(n,l,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.spatialEntity,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Gi.DataFactory.namedNode(r);n.forSubjects(ob(e,i),lr.spatialEntity.ccf_annotations,s,null)}return i}(n,l,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,pi.isFinite)(e.ageRange[0])&&(0,pi.isFinite)(e.ageRange[1])){const l=Math.max(...e.ageRange),c=Math.min(...e.ageRange);1===c&&110===l||(a=px(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,dh.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.age,null,null),r}(n,d,c,l)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,pi.isFinite)(e.bmiRange[0])&&(0,pi.isFinite)(e.bmiRange[1])){const l=Math.max(...e.bmiRange),c=Math.min(...e.bmiRange);13===c&&83===l||(a=px(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,dh.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.bmi,null,null),r}(n,d,c,l)))}return a}(this.store,e)}get(e){return this.store.getQuads(Gi.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(t=>this.get(t))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>hMe(this.store,t))}getDatasetTechnologyNames(){return or(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return or(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return or(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>WMe(this.store,t))})}getAggregateResults(e){return or(this,void 0,void 0,function*(){return function(n,e){const t=new Set;e.some(l=>(n.has(l.subject.id)&&t.add(l.object.id),!1),null,gi.donor,null,null);const i=new Set;e.some(l=>(t.has(l.subject.id)&&i.add(l.object.id),!1),null,gi.providerUUID,null,null);const r=new Set;e.forSubjects(l=>{n.has(l.id)&&r.add(l.id)},gi.spatialEntity,null,null);const s=new Set;e.some(l=>(r.has(l.subject.id)&&s.add(l.object.id),!1),null,gi.sections,null,null);const o=new Set;return e.some(l=>{const c=l.subject;return(r.has(c.id)||s.has(c.id))&&o.add(l.object.id),!1},null,gi.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:t.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([l,c])=>({label:l,count:c}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return or(this,void 0,void 0,function*(){return function(n,e){const t=new Map;e.some(r=>(n.has(r.subject.id)&&(t.has(r.object.id)?t.get(r.object.id).push(r.subject.id):t.set(r.object.id,[r.subject.id])),!1),null,gi.spatialEntity,null,null);const i={};return e.some(r=>{var s,o;if(t.has(r.subject.id)){const a=null!==(o=null===(s=t.get(r.subject.id))||void 0===s?void 0:s.length)&&void 0!==o?o:0;i[r.object.id]=a+(i[r.object.id]||0)}return!1},null,lr.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store)})}getOntologyTreeModel(){return or(this,void 0,void 0,function*(){return function(n){const e={root:tW.body.id,nodes:{}},t=new Set;n.some(i=>(t.add(i.subject.id),t.add(i.predicate.id),!1),null,lr.ontologyNode.parent,null,null);for(const i of t)e.nodes[i]=LMe(n,i);return e}(this.store)})}getReferenceOrgans(){return or(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return or(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return or(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}}function XMe(n,e){return n===e}let QMe=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new S,this.dataSource=i.config$.pipe(Ui(r=>Object.keys(r).length>0),me(r=>r),Wu(XMe),sr(r=>function(n,e){return new F(t=>{let i,r;try{i=n()}catch(a){return void t.error(a)}try{r=e(i)}catch(a){return void t.error(a)}const o=(r?Pe(r):Nc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),ml(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(sr(i=>i.getTissueBlockResults(t)),Xi(1))}getAggregateResults(t){return this.dataSource.pipe(sr(i=>i.getAggregateResults(t)),Xi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(sr(i=>i.getOntologyTermOccurences(t)),Xi(1))}getOntologyTreeModel(){return this.dataSource.pipe(sr(t=>t.getOntologyTreeModel()),Xi(1))}getReferenceOrgans(){return this.dataSource.pipe(sr(t=>t.getReferenceOrgans()),Xi(1))}getScene(t){return this.dataSource.pipe(sr(i=>i.getScene(t).then(r=>r.filter(s=>t.ontologyTerms.includes(s.representation_of)))),Xi(1))}getReferenceOrganScene(t,i){return this.dataSource.pipe(sr(r=>r.getReferenceOrganScene(t,i)),Xi(1))}createDataSource(){return{source:new YMe,unsubscribe:()=>{}}}connectDataSource(t,i){return or(this,void 0,void 0,function*(){$d.disableDbWorker&&(yield new Promise(s=>{setTimeout(s,100)}));const r=(new Date).getTime();return yield t.connect(i,!0),$d.production||console.info(`Loaded CCF database in ${((new Date).getTime()-r)/1e3}s`),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(af),Ie(cx))},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),ZMe=(()=>{class n{constructor(t){this.source=t,this.organs=Z$}getOrganInfo(t,i,r="Female"){let s=this.organs.find(a=>a.id===t);if(!s)return nn(void 0);const o=s.organ;return s.disabled&&(s=this.organs.find(a=>!a.disabled&&a.organ===o)),(null==s?void 0:s.side)&&i&&s.side!==i&&(s=this.organs.find(a=>!a.disabled&&a.organ===o&&a.side===i)),nn(s)}getOrgan(t,i="Female"){return this.source.getReferenceOrgans().pipe(me(r=>r.find(s=>s.representation_of===t.id&&("Both"===i||s.sex===i))))}getOrganScene(t,i="Female"){return t.id?this.source.getReferenceOrganScene(t.id,{ontologyTerms:[t.id],sex:i}):nn([])}getOrganStats(t,i="Female"){return t.id?this.source.getAggregateResults({ontologyTerms:[t.id],sex:i}):nn([])}getBlocks(t,i="Female"){return t.id?this.source.getTissueBlockResults({ontologyTerms:[t.id],sex:i}):nn([])}}return n.\u0275fac=function(t){return new(t||n)(Ie(QMe))},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const JMe=["thumbContainer"],eIe=["toggleBar"],tIe=["input"],nIe=function(n){return{enterDuration:n}},iIe=["*"],rIe=new zt("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let sIe=0;const oIe={provide:Ra,useExisting:fe(()=>cW),multi:!0};class aIe{constructor(e,t){this.source=e,this.checked=t}}const lIe=LN(Xv(FN(UC(class{constructor(n){this._elementRef=n}}))));let cW=(()=>{class n extends lIe{constructor(t,i,r,s,o,a){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=o,this._onChange=l=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++sIe,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new mn,this.toggleChange=new mn,this.tabIndex=parseInt(s)||0,this.color=this.defaultColor=o.color||"accent",this._noopAnimations="NoopAnimations"===a}get required(){return this._required}set required(t){this._required=zi(t)}get checked(){return this._checked}set checked(t){this._checked=zi(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new aIe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(De(wn),De(Xu),De(ts),function(n){return function(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const i=t.length;let r=0;for(;r{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})(),dIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[uW,HC,pr,nN],uW,pr]}),n})(),hIe=(()=>{class n{constructor(){this.clsName="ccf-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new mn}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Tc(i.clsName)},inputs:{labels:"labels",value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},decls:6,vars:12,consts:[[1,"slide-label",3,"click"],[1,"slider",3,"disabled","checked","change"],["toggle",""]],template:function(t,i){if(1&t){const r=wu();Pt(0,"span",0),kn("click",function(){Vo(r);const o=qp(3);return i.left||o.toggle(),i.updateToggle(!0)}),Si(1),Ft(),Pt(2,"mat-slide-toggle",1,2),kn("change",function(o){return i.updateToggle(!o.checked)}),Ft(),Pt(4,"span",0),kn("click",function(){Vo(r);const o=qp(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Si(5),Ft()}2&t&&(Ei("disabled",i.disabled)("highlighted",i.left),Yt(1),xs(i.labels[0].charAt(0).toUpperCase()+i.labels[0].slice(1)),Yt(1),on("disabled",i.disabled)("checked",!i.left),Yt(2),Ei("disabled",i.disabled)("highlighted",!i.left),Yt(1),xs(i.labels[1].charAt(0).toUpperCase()+i.labels[1].slice(1)))},directives:[cW],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer;opacity:50%}[_nghost-%COMP%] .slide-label.highlighted[_ngcontent-%COMP%]{opacity:100%}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%!important;cursor:not-allowed}[_nghost-%COMP%] .slider .mat-slide-toggle-bar{background-color:#43476580}[_nghost-%COMP%] .slider .mat-slide-toggle-thumb{background-color:#434765}"],changeDetection:0}),n})();const fIe=["bodyUI"],pIe=function(){return["Male","Female"]},gIe=function(){return["Left","Right"]};let mIe=(()=>{class n{constructor(t){this.ga=t,this.sexChange=new mn,this.sideChange=new mn}ngOnInit(){this.reset()}ngAfterViewChecked(){this.updateHighlighting()}updateHighlighting(){var t,i,r,s;const o=new Set(null!==(i=null===(t=this.filter)||void 0===t?void 0:t.tmc)&&void 0!==i?i:[]);this.filteredBlocks=null!==(s=null===(r=this.blocks)||void 0===r?void 0:r.filter(a=>o.has(a.donor.providerName)).map(a=>a["@id"]))&&void 0!==s?s:[],this.bodyUI.scene=this.bodyUI.scene.map(a=>{var l;return Object.assign(Object.assign({},a),{color:a.entityId&&this.highlightedNodeId===a["@id"]?[30,136,229,255]:this.filteredBlocks.includes(null!==(l=a.entityId)&&void 0!==l?l:"")?[173,255,47,229.5]:[255,255,255,229.5]})})}ngOnChanges(t){this.bodyUI&&"organ"in t&&this.reset()}updateSex(t){this.sex=t,this.sexChange.emit(this.sex)}updateSide(t){this.side=t,this.sideChange.emit(this.side)}reset(){const{bodyUI:t,organ:i}=this;if(i){i.side||(this.side=void 0);const{x_dimension:r,y_dimension:s,z_dimension:o}=i;t.rotation=t.rotationX=0,t.bounds={x:1.25*r/1e3,y:1.25*s/1e3,z:1.25*o/1e3},t.target=[r/1e3/2,s/1e3/2,o/1e3/2]}}nodeClicked(t){this.ga.event("node_click","organ",t.node["@id"]),this.highlightedNodeId=this.highlightedNodeId&&this.highlightedNodeId===t.node["@id"]?"":t.node["@id"]}}return n.\u0275fac=function(t){return new(t||n)(De(PE))},n.\u0275cmp=_n({type:n,selectors:[["ccf-organ"]],viewQuery:function(t,i){if(1&t&&Mr(fIe,7),2&t){let r;di(r=hi())&&(i.bodyUI=r.first)}},inputs:{organ:"organ",scene:"scene",organIri:"organIri",sex:"sex",side:"side",blocks:"blocks",filter:"filter"},outputs:{sexChange:"sexChange",sideChange:"sideChange"},features:[ki],decls:5,vars:9,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick"],["bodyUI",""],[1,"stage-options"],[1,"view-slider",3,"labels","value","valueChange"],[1,"view-slider",3,"labels","value","disabled","valueChange"]],template:function(t,i){1&t&&(Pt(0,"ccf-body-ui",0,1),kn("nodeClick",function(s){return i.nodeClicked(s)}),Ft(),Pt(2,"div",2),Pt(3,"ccf-slide-toggle",3),kn("valueChange",function(s){return i.updateSex(s)}),Ft(),Pt(4,"ccf-slide-toggle",4),kn("valueChange",function(s){return i.updateSide(s)}),Ft(),Ft()),2&t&&(on("scene",i.scene)("interactive",!0),Yt(3),on("labels",Mw(7,pIe))("value",i.sex),Yt(1),on("labels",Mw(8,gIe))("value",i.side)("disabled",!i.side))},directives:[gDe,hIe],styles:["[_nghost-%COMP%]{display:block;background-color:#000;border-radius:.5rem;color:#fff;height:100%}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{height:90%}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{padding:1rem;min-width:352px}"],changeDetection:0}),n})();function _Ie(n,e){if(1&n&&(Pt(0,"div",3),Pt(1,"div",4),Si(2),Ft(),Pt(3,"div",5),Si(4),Ft(),Ft()),2&n){const t=e.$implicit;Yt(2),xs(t.count),Yt(2),xs(t.label)}}let yIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-stats-list"]],inputs:{statsLabel:"statsLabel",stats:"stats"},decls:4,vars:2,consts:[[1,"stats-container"],[1,"header"],["class","stats-row",4,"ngFor","ngForOf"],[1,"stats-row"],[1,"stat"],[1,"label"]],template:function(t,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Si(2),Ft(),Ai(3,_Ie,5,2,"div",2),Ft()),2&t&&(Yt(2),Mc(" ",i.statsLabel," "),Yt(1),on("ngForOf",i.stats))},directives:[Ud],styles:[".stats-container[_ngcontent-%COMP%]{margin-bottom:2rem;min-height:9rem}.stats-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{margin-bottom:1rem}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;height:1.325rem}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%] .stat[_ngcontent-%COMP%]{width:2rem;margin-right:1rem;text-align:right}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{flex-grow:1;text-align:left}"],changeDetection:0}),n})();function vIe(n,e){if(1&n){const t=wu();Pt(0,"div",6),Pt(1,"div",7),Pt(2,"div",8),Si(3),Ft(),Pt(4,"div",9),kn("click",function(){const s=Vo(t).$implicit;return wr().goToURL(s.buttonUrl)}),Si(5),Ft(),Ft(),Ft()}if(2&n){const t=e.$implicit;Yt(3),xs(t.body),Yt(1),on("gaLabel",t.buttonUrl),Yt(1),Mc(" ",t.buttonTitle,"")}}function bIe(n,e){if(1&n){const t=wu();Pt(0,"div",10),kn("click",function(){const s=Vo(t).$implicit;return wr().goToURL(s.buttonUrl)}),Si(1),Ft()}if(2&n){const t=e.$implicit;on("gaLabel",t.buttonUrl),Yt(1),xs(t.buttonTitle)}}let wIe=(()=>{class n{constructor(){this.linkCards=[{body:"Add tissue blocks using the CCF Registration User Interface (RUI).",buttonTitle:"Register Tissue",buttonUrl:"https://hubmapconsortium.github.io/ccf-ui/rui/"},{body:"Explore tissue sections in tissue blocks with the CCF Exploration User Interface (EUI).",buttonTitle:"Explore Tissue",buttonUrl:"https://portal.hubmapconsortium.org/ccf-eui"},{body:"View linkages between anatomical structures, cell types, and common biomarkers (ASCT+B).",buttonTitle:"ASCT+B Reporter",buttonUrl:"https://hubmapconsortium.github.io/ccf-asct-reporter/"}],this.deepDives=[{body:"",buttonTitle:"CCF Portal",buttonUrl:"https://hubmapconsortium.github.io/ccf/"},{body:"",buttonTitle:"Online Course",buttonUrl:"https://expand.iu.edu/browse/sice/cns/courses/hubmap-visible-human-mooc"},{body:"",buttonTitle:"Paper",buttonUrl:"https://www.biorxiv.org/content/10.1101/2021.05.31.446440v2"}]}goToURL(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-link-cards"]],decls:7,vars:2,consts:[["gaCategory","link-cards",1,"link-cards-container"],["class","link-card",4,"ngFor","ngForOf"],["gaCategory","deep-dive",1,"deep-dive-section"],[1,"title"],[1,"button-container"],["class","btn-outline btn","gaEvent","visit-link",3,"gaLabel","click",4,"ngFor","ngForOf"],[1,"link-card"],[1,"link-card-content"],[1,"body"],["gaEvent","visit-link",1,"link-button","btn",3,"gaLabel","click"],["gaEvent","visit-link",1,"btn-outline","btn",3,"gaLabel","click"]],template:function(t,i){1&t&&(Pt(0,"div",0),Ai(1,vIe,6,3,"div",1),Ft(),Pt(2,"div",2),Pt(3,"div",3),Si(4,"Common Coordinate Framework (CCF) Deep Dive"),Ft(),Pt(5,"div",4),Ai(6,bIe,2,2,"div",5),Ft(),Ft()),2&t&&(Yt(1),on("ngForOf",i.linkCards),Yt(5),on("ngForOf",i.deepDives))},directives:[GB,Ud,$B],styles:[".link-cards-container[_ngcontent-%COMP%]{max-width:30rem}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%]{border-top:1px solid #e0e0e0;padding-top:1px;padding-bottom:1px}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%]:last-of-type{border-bottom:1px solid #e0e0e0}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%]{align-items:center;padding:1rem 0 1rem 1rem;display:flex;flex-direction:row;justify-content:space-between;border-left:6px solid #444A65}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%] .link-button[_ngcontent-%COMP%]{margin-left:2rem;background-color:#444a65;color:#fff}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%] .link-button[_ngcontent-%COMP%]:hover{background-color:#2f3346}.deep-dive-section[_ngcontent-%COMP%]{margin-top:2rem}.deep-dive-section[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-bottom:1rem;font-size:1rem}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%]{display:flex;flex-direction:row}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]{color:#444a65;border:1px solid #444A65;background-color:#fff}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]:not(:last-of-type){margin-right:1rem}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]:hover{background-color:#e0e0e0}.btn[_ngcontent-%COMP%]{min-width:9rem!important;max-height:2.28125rem;text-align:center;white-space:nowrap;cursor:pointer;font-size:.875rem;font-weight:500;border-radius:2px;line-height:2.75;transition:background-color .25s cubic-bezier(.4,0,.2,1) 0ms,box-shadow .25s cubic-bezier(.4,0,.2,1) 0ms,border .25s cubic-bezier(.4,0,.2,1) 0ms;font-family:Inter Variable,Helvetica,Arial,sans-serif}"],changeDetection:0}),n})();const EIe=["left"],SIe=["right"],CIe=function(){return[]},xIe=[{color:[0,0,0,0],opacity:.001}];let AIe=(()=>{class n{constructor(t,i,r){this.ga=i,this.configState=r,this.sex$=this.configState.getOption("sex"),this.side$=this.configState.getOption("side"),this.filter$=this.configState.getOption("highlightProviders").pipe(me(s=>({tmc:s}))),this.latestConfig={},this.organInfo$=r.config$.pipe(jr(s=>this.latestConfig=s),sr(s=>{var o,a,l;return t.getOrganInfo(null!==(o=s.organIri)&&void 0!==o?o:"",null===(l=null===(a=s.side)||void 0===a?void 0:a.toLowerCase)||void 0===l?void 0:l.call(a),s.sex)}),jr(s=>this.logOrganLookup(s)),ml(1)),this.organ$=this.organInfo$.pipe(sr(s=>s?t.getOrgan(s,this.latestConfig.sex):nn(void 0)),ml(1)),this.scene$=this.organ$.pipe(nb(this.organInfo$),sr(([s,o])=>s&&o?t.getOrganScene(o,this.latestConfig.sex):nn(xIe))),this.stats$=this.organInfo$.pipe(sr(s=>s?t.getOrganStats(s,this.latestConfig.sex):nn([]))),this.statsLabel$=this.stats$.pipe(nb(this.organInfo$),me(([s,o])=>this.makeStatsLabel(o)),function(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>gE(n,t,e)):t=>gE(n,t)}("Loading...")),this.blocks$=this.organInfo$.pipe(sr(s=>s?t.getBlocks(s,this.latestConfig.sex):nn([])))}ngAfterViewInit(){const{left:t,right:i}=this;t.nativeElement.style.height=`${i.nativeElement.offsetHeight}px`}updateInput(t,i){this.configState.patchConfig({[t]:i})}makeStatsLabel(t){let i=[`Unknown IRI: ${this.latestConfig.organIri}`];return t&&(i=[this.latestConfig.sex,t.organ,t.side]),i.filter(r=>!!r).join(", ")}logOrganLookup(t){this.ga.event(t?"organ_lookup_success":"organ_lookup_failure","organ",`Iri: ${this.latestConfig.organIri} - Sex: ${this.latestConfig.sex} - Side: ${this.latestConfig.side}`)}}return n.\u0275fac=function(t){return new(t||n)(De(ZMe),De(PE),De(cx))},n.\u0275cmp=_n({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&(Mr(EIe,7,wn),Mr(SIe,7,wn)),2&t){let r;di(r=hi())&&(i.left=r.first),di(r=hi())&&(i.right=r.first)}},decls:16,vars:25,consts:[[1,"container"],[1,"left"],["left",""],[3,"blocks","filter","sex","side","organ","scene","sexChange","sideChange"],[1,"right"],["right",""],[3,"statsLabel","stats"]],template:function(t,i){if(1&t&&(Pt(0,"div",0),Pt(1,"div",1,2),Pt(3,"ccf-organ",3),kn("sexChange",function(s){return i.updateInput("sex",s)})("sideChange",function(s){return i.updateInput("side",s)}),cl(4,"async"),cl(5,"async"),cl(6,"async"),cl(7,"async"),cl(8,"async"),cl(9,"async"),Ft(),Ft(),Pt(10,"div",4,5),wi(12,"ccf-stats-list",6),cl(13,"async"),cl(14,"async"),wi(15,"ccf-link-cards"),Ft(),Ft()),2&t){let r;Yt(3),on("blocks",ul(4,8,i.blocks$))("filter",ul(5,10,i.filter$))("sex",ul(6,12,i.sex$))("side",ul(7,14,i.side$))("organ",ul(8,16,i.organ$))("scene",null!==(r=ul(9,18,i.scene$))&&void 0!==r?r:Mw(24,CIe)),Yt(9),on("statsLabel",ul(13,20,i.statsLabel$))("stats",ul(14,22,i.stats$))}},directives:[mIe,yIe,wIe],pipes:[iE],styles:[".container[_ngcontent-%COMP%]{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:flex;flex-direction:row;padding:1rem;font-family:Inter;font-size:.95rem;line-height:1.5;text-align:left;position:relative;background-color:#fff;color:#000}.container[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{width:auto;flex-grow:1}.container[_ngcontent-%COMP%] .right[_ngcontent-%COMP%]{margin-left:2rem;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:29rem}"],changeDetection:0}),n})();function TIe(n,e){1&n&&wi(0,"ccf-root")}function DIe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){const i=KB_json(n);if(t(i))return i}else if(t(n))return n;throw new Error("Invalid data sources")}function MIe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){if(!(null==n?void 0:n.startsWith("[")))return[n];{const i=KB_json(n);if(t(i))return i}}else if(t(n))return n;throw new Error("Invalid data sources")}let IIe=(()=>{class n extends qne{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},$d.dbOptions),globalThis.dbOptions),parse:{dataSources:DIe,highlightProviders:MIe}}),this.sex="Female",this.side="Left"}}return n.\u0275fac=function(t){return new(t||n)(De(cx),De(ts))},n.\u0275cmp=_n({type:n,selectors:[["ccf-root-wc"]],inputs:{organIri:"organIri",sex:"sex",side:"side",dataSources:"dataSources",highlightProviders:"highlightProviders",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl"},features:[Dn],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&Ai(0,TIe,1,0,"ccf-root",0),2&t&&on("ngIf",i.initialized)},directives:[Mu,AIe],encapsulation:2,changeDetection:0}),n})(),OIe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[os,Ba,L$,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(os,2),Ie(Ba,2))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const mx=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class PIe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=Of(this.action),i=function(n){return mx(n.getHours(),2)+":"+mx(n.getMinutes(),2)+":"+mx(n.getSeconds(),2)+"."+mx(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class FIe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const dW=new zt("NGXS_LOGGER_PLUGIN_OPTIONS");let LIe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new FIe(this._options),this._store=this._store||this._injector.get(ih);const s=new PIe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(jr(o=>{s.completed(o)}),Xl(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(dW),Ie(zn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const hW=new zt("LOGGER_USER_OPTIONS");function kIe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let BIe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:tH,useClass:LIe,multi:!0},{provide:hW,useValue:t},{provide:dW,useFactory:kIe,deps:[hW]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const jIe=[cx];let fW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[OIe.forRoot(),oa.forRoot(jIe,{developmentMode:!$d.production}),BIe.forRoot({disabled:$d.production})]]}),n})(),VIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,dIe]]}),n})(),UIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,mDe,VIe]]}),n})(),zIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,FE]]}),n})(),HIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr]]}),n})(),GIe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ol).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new qJ(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends KJ{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(IIe,{injector:this.injector});customElements.define("ccf-organ-info",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[],imports:[[UD,zIe,HIe,UIe,fW,fW,Gne.forRoot({gaToken:$d.googleAnalyticsToken,appName:"organ-info",projectName:"ccf",developmentMode:!$d.production})]]}),n})();$d.production&&function(){if(gk)throw new Error("Cannot enable prod mode after platform setup.");pk=!1}(),mJ().bootstrapModule(GIe).catch(n=>console.error(n))},52:jt=>{function it(gt,J,xt,ut,Y,Ae,he){try{var W=gt[Ae](he),V=W.value}catch(L){return void xt(L)}W.done?J(V):Promise.resolve(V).then(ut,Y)}jt.exports=function(gt){return function(){var J=this,xt=arguments;return new Promise(function(ut,Y){var Ae=gt.apply(J,xt);function he(V){it(Ae,ut,Y,he,W,"next",V)}function W(V){it(Ae,ut,Y,he,W,"throw",V)}he(void 0)})}},jt.exports.default=jt.exports,jt.exports.__esModule=!0},948:jt=>{jt.exports=function(tt){return tt&&tt.__esModule?tt:{default:tt}},jt.exports.default=jt.exports,jt.exports.__esModule=!0},321:jt=>{function it(tt){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(jt.exports=it=function(J){return typeof J},jt.exports.default=jt.exports,jt.exports.__esModule=!0):(jt.exports=it=function(J){return J&&"function"==typeof Symbol&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},jt.exports.default=jt.exports,jt.exports.__esModule=!0),it(tt)}jt.exports=it,jt.exports.default=jt.exports,jt.exports.__esModule=!0},82:jt=>{function it(tt){return Promise.resolve().then(()=>{var gt=new Error("Cannot find module '"+tt+"'");throw gt.code="MODULE_NOT_FOUND",gt})}it.keys=()=>[],it.resolve=it,it.id=82,jt.exports=it},521:()=>{},125:()=>{},307:()=>{}},jt=>{jt(jt.s=289)}]); \ No newline at end of file diff --git a/organ-info/wc.js b/organ-info/wc.js index 2d1ea055c..40ac3a731 100644 --- a/organ-info/wc.js +++ b/organ-info/wc.js @@ -2,4 +2,4 @@ (self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[429],{138:()=>{!function(){"use strict";!function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const G=HTMLElement;window.HTMLElement=function(){return Reflect.construct(G,[],this.constructor)},HTMLElement.prototype=G.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,G)}()}()},142:()=>{!function(G,ne){"use strict";function he(){var e=Ge.splice(0,Ge.length);for(V=0;e.length;)e.shift().call(null,e.shift())}function ye(e,r){for(var i=0,h=e.length;i1)&&tt(this)}}}),x(o,Ee,{value:function(p){-1>0,me="__"+se+dt,be="addEventListener",Le="attached",ce="Callback",pe="detached",te="extends",Ee="attributeChanged"+ce,vt=Le+ce,rt="connected"+ce,mt="disconnected"+ce,qe="created"+ce,kt=pe+ce,ot="ADDITION",pt="REMOVAL",He="DOMAttrModified",bt="DOMContentLoaded",Et="DOMSubtreeModified",Xe="<",st="=",Mt=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,wt=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],Ne=[],Ye=[],le="",De=A.documentElement,Te=Ne.indexOf||function(e){for(var r=this.length;r--&&this[r]!==e;);return r},it=re.prototype,Pe=it.hasOwnProperty,at=it.isPrototypeOf,Re=re.defineProperty,Oe=[],Ke=re.getOwnPropertyDescriptor,Y=re.getOwnPropertyNames,Ct=re.getPrototypeOf,$e=re.setPrototypeOf,Se=!!re.__proto__,Je="__dreCEv1",Me=G.customElements,t=!/^force/.test(ne.type)&&!!(Me&&Me.define&&Me.get&&Me.whenDefined),a=re.create||re,u=G.Map||function(){var e,r=[],i=[];return{get:function(h){return i[Te.call(r,h)]},set:function(h,s){(e=Te.call(r,h))<0?i[r.push(h)-1]=s:i[e]=s}}},c=G.Promise||function(e){function r(o){for(h=!0;i.length;)i.shift()(o)}var i=[],h=!1,s={catch:function(){return s},then:function(o){return i.push(o),h&&setTimeout(r,1),s}};return e(r),s},f=!1,m=a(null),E=a(null),v=new u,C=function(e){return e.toLowerCase()},w=re.create||function e(r){return r?(e.prototype=r,new e):this},b=$e||(Se?function(e,r){return e.__proto__=r,e}:Y&&Ke?function(){function e(r,i){for(var h,s=Y(i),o=0,l=s.length;o
    ",new N(function(e,r){if(e[0]&&"childList"==e[0].type&&!e[0].removedNodes[0].childNodes.length){var i=(Ce=Ke(P,"innerHTML"))&&Ce.set;i&&Re(P,"innerHTML",{set:function(h){for(;this.lastChild;)this.removeChild(this.lastChild);i.call(this,h)}})}r.disconnect(),Ce=null}).observe(Ce,{childList:!0,subtree:!0}),Ce.innerHTML=""),ue||($e||Se?(we=function(e,r){at.call(r,e)||Be(e,r)},ae=Be):ae=we=function(e,r){e[me]||(e[me]=re(!0),Be(e,r))},z?(I=!1,e=Ke(P,be),r=e.value,i=function(o){var l=new CustomEvent(He,{bubbles:!0});l.attrName=o,l.prevValue=R.call(this,o),l.newValue=null,l[pt]=l.attrChange=2,F.call(this,o),K.call(this,l)},h=function(o,l){var d=Q.call(this,o),p=d&&R.call(this,o),y=new CustomEvent(He,{bubbles:!0});$.call(this,o,l),y.attrName=o,y.prevValue=d?p:null,y.newValue=l,d?y.MODIFICATION=y.attrChange=1:y[ot]=y.attrChange=0,K.call(this,y)},s=function(o){var l,d=o.currentTarget,p=d[me],y=o.propertyName;p.hasOwnProperty(y)&&(p=p[y],(l=new CustomEvent(He,{bubbles:!0})).attrName=p.name,l.prevValue=p.value||null,l.newValue=p.value=d[y]||null,null==l.prevValue?l[ot]=l.attrChange=0:l.MODIFICATION=l.attrChange=1,K.call(d,l))},e.value=function(o,l,d){o===He&&this[Ee]&&this.setAttribute!==h&&(this[me]={className:{name:"class",value:this.className}},this.setAttribute=h,this.removeAttribute=i,r.call(this,"propertychange",s)),r.call(this,o,l,d)},Re(P,be,e)):N||(De[be](He,_e),De.setAttribute(me,1),De.removeAttribute(me),I&&(xe=function(e){var r,i,h,s=this;if(s===e.target){for(h in r=s[me],s[me]=i=nt(s),i){if(!(h in r))return ze(0,s,h,r[h],i[h],ot);if(i[h]!==r[h])return ze(1,s,h,r[h],i[h],"MODIFICATION")}for(h in r)if(!(h in i))return ze(2,s,h,r[h],i[h],pt)}},ze=function(e,r,i,h,s,o){var l={attrChange:e,currentTarget:r,attrName:i,prevValue:h,newValue:s};l[o]=e,Ue(l)},nt=function(e){for(var r,i,h={},s=e.attributes,o=0,l=s.length;o$");if(r[te]="a",(e.prototype=w(S.prototype)).constructor=e,G.customElements.define(i,e,r),!h.test(A.createElement("a",{is:i}).outerHTML)||!h.test((new e).outerHTML))throw r}(function e(){return Reflect.construct(S,[],e)},{},"document-register-element-a"+dt)}catch(e){ft()}if(!ne.noBuiltIn)try{if(O.call(A,"a","a").outerHTML.indexOf("is")<0)throw{}}catch(e){C=function(r){return{is:r.toLowerCase()}}}}(window)},277:()=>{"use strict";!function(t){const a=t.performance;function u(I){a&&a.mark&&a.mark(I)}function c(I,k){a&&a.measure&&a.measure(I,k)}u("Zone");const f=t.__Zone_symbol_prefix||"__zone_symbol__";function m(I){return f+I}const E=!0===t[m("forceDuplicateZoneCheck")];if(t.Zone){if(E||"function"!=typeof t.Zone.__symbol__)throw new Error("Zone already loaded.");return t.Zone}let v=(()=>{class I{constructor(n,e){this._parent=n,this._name=e?e.name||"unnamed":"",this._properties=e&&e.properties||{},this._zoneDelegate=new w(this,this._parent&&this._parent._zoneDelegate,e)}static assertZonePatched(){if(t.Promise!==oe.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let n=I.current;for(;n.parent;)n=n.parent;return n}static get current(){return V.zone}static get currentTask(){return ue}static __load_patch(n,e,r=!1){if(oe.hasOwnProperty(n)){if(!r&&E)throw Error("Already loaded patch: "+n)}else if(!t["__Zone_disable_"+n]){const i="Zone:"+n;u(i),oe[n]=e(t,I,_e),c(i,i)}}get parent(){return this._parent}get name(){return this._name}get(n){const e=this.getZoneWith(n);if(e)return e._properties[n]}getZoneWith(n){let e=this;for(;e;){if(e._properties.hasOwnProperty(n))return e;e=e._parent}return null}fork(n){if(!n)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,n)}wrap(n,e){if("function"!=typeof n)throw new Error("Expecting function got: "+n);const r=this._zoneDelegate.intercept(this,n,e),i=this;return function(){return i.runGuarded(r,this,arguments,e)}}run(n,e,r,i){V={parent:V,zone:this};try{return this._zoneDelegate.invoke(this,n,e,r,i)}finally{V=V.parent}}runGuarded(n,e=null,r,i){V={parent:V,zone:this};try{try{return this._zoneDelegate.invoke(this,n,e,r,i)}catch(h){if(this._zoneDelegate.handleError(this,h))throw h}}finally{V=V.parent}}runTask(n,e,r){if(n.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(n.zone||W).name+"; Execution: "+this.name+")");if(n.state===B&&(n.type===H||n.type===j))return;const i=n.state!=Q;i&&n._transitionTo(Q,R),n.runCount++;const h=ue;ue=n,V={parent:V,zone:this};try{n.type==j&&n.data&&!n.data.isPeriodic&&(n.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,n,e,r)}catch(s){if(this._zoneDelegate.handleError(this,s))throw s}}finally{n.state!==B&&n.state!==$&&(n.type==H||n.data&&n.data.isPeriodic?i&&n._transitionTo(R,Q):(n.runCount=0,this._updateTaskCount(n,-1),i&&n._transitionTo(B,Q,B))),V=V.parent,ue=h}}scheduleTask(n){if(n.zone&&n.zone!==this){let r=this;for(;r;){if(r===n.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${n.zone.name}`);r=r.parent}}n._transitionTo(K,B);const e=[];n._zoneDelegates=e,n._zone=this;try{n=this._zoneDelegate.scheduleTask(this,n)}catch(r){throw n._transitionTo($,K,B),this._zoneDelegate.handleError(this,r),r}return n._zoneDelegates===e&&this._updateTaskCount(n,1),n.state==K&&n._transitionTo(R,K),n}scheduleMicroTask(n,e,r,i){return this.scheduleTask(new b(O,n,e,r,i,void 0))}scheduleMacroTask(n,e,r,i,h){return this.scheduleTask(new b(j,n,e,r,i,h))}scheduleEventTask(n,e,r,i,h){return this.scheduleTask(new b(H,n,e,r,i,h))}cancelTask(n){if(n.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(n.zone||W).name+"; Execution: "+this.name+")");n._transitionTo(F,R,Q);try{this._zoneDelegate.cancelTask(this,n)}catch(e){throw n._transitionTo($,F),this._zoneDelegate.handleError(this,e),e}return this._updateTaskCount(n,-1),n._transitionTo(B,F),n.runCount=0,n}_updateTaskCount(n,e){const r=n._zoneDelegates;-1==e&&(n._zoneDelegates=null);for(let i=0;iI.hasTask(n,e),onScheduleTask:(I,k,n,e)=>I.scheduleTask(n,e),onInvokeTask:(I,k,n,e,r,i)=>I.invokeTask(n,e,r,i),onCancelTask:(I,k,n,e)=>I.cancelTask(n,e)};class w{constructor(k,n,e){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=k,this._parentDelegate=n,this._forkZS=e&&(e&&e.onFork?e:n._forkZS),this._forkDlgt=e&&(e.onFork?n:n._forkDlgt),this._forkCurrZone=e&&(e.onFork?this.zone:n._forkCurrZone),this._interceptZS=e&&(e.onIntercept?e:n._interceptZS),this._interceptDlgt=e&&(e.onIntercept?n:n._interceptDlgt),this._interceptCurrZone=e&&(e.onIntercept?this.zone:n._interceptCurrZone),this._invokeZS=e&&(e.onInvoke?e:n._invokeZS),this._invokeDlgt=e&&(e.onInvoke?n:n._invokeDlgt),this._invokeCurrZone=e&&(e.onInvoke?this.zone:n._invokeCurrZone),this._handleErrorZS=e&&(e.onHandleError?e:n._handleErrorZS),this._handleErrorDlgt=e&&(e.onHandleError?n:n._handleErrorDlgt),this._handleErrorCurrZone=e&&(e.onHandleError?this.zone:n._handleErrorCurrZone),this._scheduleTaskZS=e&&(e.onScheduleTask?e:n._scheduleTaskZS),this._scheduleTaskDlgt=e&&(e.onScheduleTask?n:n._scheduleTaskDlgt),this._scheduleTaskCurrZone=e&&(e.onScheduleTask?this.zone:n._scheduleTaskCurrZone),this._invokeTaskZS=e&&(e.onInvokeTask?e:n._invokeTaskZS),this._invokeTaskDlgt=e&&(e.onInvokeTask?n:n._invokeTaskDlgt),this._invokeTaskCurrZone=e&&(e.onInvokeTask?this.zone:n._invokeTaskCurrZone),this._cancelTaskZS=e&&(e.onCancelTask?e:n._cancelTaskZS),this._cancelTaskDlgt=e&&(e.onCancelTask?n:n._cancelTaskDlgt),this._cancelTaskCurrZone=e&&(e.onCancelTask?this.zone:n._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const r=e&&e.onHasTask;(r||n&&n._hasTaskZS)&&(this._hasTaskZS=r?e:C,this._hasTaskDlgt=n,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=k,e.onScheduleTask||(this._scheduleTaskZS=C,this._scheduleTaskDlgt=n,this._scheduleTaskCurrZone=this.zone),e.onInvokeTask||(this._invokeTaskZS=C,this._invokeTaskDlgt=n,this._invokeTaskCurrZone=this.zone),e.onCancelTask||(this._cancelTaskZS=C,this._cancelTaskDlgt=n,this._cancelTaskCurrZone=this.zone))}fork(k,n){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,k,n):new v(k,n)}intercept(k,n,e){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,k,n,e):n}invoke(k,n,e,r,i){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,k,n,e,r,i):n.apply(e,r)}handleError(k,n){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,k,n)}scheduleTask(k,n){let e=n;if(this._scheduleTaskZS)this._hasTaskZS&&e._zoneDelegates.push(this._hasTaskDlgtOwner),e=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,k,n),e||(e=n);else if(n.scheduleFn)n.scheduleFn(n);else{if(n.type!=O)throw new Error("Task is missing scheduleFn.");T(n)}return e}invokeTask(k,n,e,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,k,n,e,r):n.callback.apply(e,r)}cancelTask(k,n){let e;if(this._cancelTaskZS)e=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,k,n);else{if(!n.cancelFn)throw Error("Task is not cancelable");e=n.cancelFn(n)}return e}hasTask(k,n){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,k,n)}catch(e){this.handleError(k,e)}}_updateTaskCount(k,n){const e=this._taskCounts,r=e[k],i=e[k]=r+n;if(i<0)throw new Error("More tasks executed then were scheduled.");0!=r&&0!=i||this.hasTask(this.zone,{microTask:e.microTask>0,macroTask:e.macroTask>0,eventTask:e.eventTask>0,change:k})}}class b{constructor(k,n,e,r,i,h){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=k,this.source=n,this.data=r,this.scheduleFn=i,this.cancelFn=h,!e)throw new Error("callback is not defined");this.callback=e;const s=this;this.invoke=k===H&&r&&r.useG?b.invokeTask:function(){return b.invokeTask.call(t,s,this,arguments)}}static invokeTask(k,n,e){k||(k=this),fe++;try{return k.runCount++,k.zone.runTask(k,n,e)}finally{1==fe&&Z(),fe--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(B,K)}_transitionTo(k,n,e){if(this._state!==n&&this._state!==e)throw new Error(`${this.type} '${this.source}': can not transition to '${k}', expecting state '${n}'${e?" or '"+e+"'":""}, was '${this._state}'.`);this._state=k,k==B&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const N=m("setTimeout"),S=m("Promise"),P=m("then");let L,z=[],x=!1;function T(I){if(0===fe&&0===z.length)if(L||t[S]&&(L=t[S].resolve(0)),L){let k=L[P];k||(k=L.then),k.call(L,Z)}else t[N](Z,0);I&&z.push(I)}function Z(){if(!x){for(x=!0;z.length;){const I=z;z=[];for(let k=0;kV,onUnhandledError:X,microtaskDrainDone:X,scheduleMicroTask:T,showUncaughtError:()=>!v[m("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:X,patchMethod:()=>X,bindArguments:()=>[],patchThen:()=>X,patchMacroTask:()=>X,patchEventPrototype:()=>X,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>X,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>X,wrapWithCurrentZone:()=>X,filterProperties:()=>[],attachOriginToPatched:()=>X,_redefineProperty:()=>X,patchCallbacks:()=>X};let V={parent:null,zone:new v(null,null)},ue=null,fe=0;function X(){}c("Zone","Zone"),t.Zone=v}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global);const ne=Object.getOwnPropertyDescriptor,he=Object.defineProperty,ye=Object.getPrototypeOf,_t=Object.create,Ve=Array.prototype.slice,Ie="addEventListener",Ze="removeEventListener",Ue=Zone.__symbol__(Ie),et=Zone.__symbol__(Ze),de="true",ve="false",Ae=Zone.__symbol__("");function Be(t,a){return Zone.current.wrap(t,a)}function lt(t,a,u,c,f){return Zone.current.scheduleMacroTask(t,a,u,c,f)}const U=Zone.__symbol__,je="undefined"!=typeof window,ke=je?window:void 0,J=je&&ke||"object"==typeof self&&self||global,yt=[null];function tt(t,a){for(let u=t.length-1;u>=0;u--)"function"==typeof t[u]&&(t[u]=Be(t[u],a+"_"+u));return t}function ft(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&void 0===t.set)}const A="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,re=!("nw"in J)&&void 0!==J.process&&"[object process]"==={}.toString.call(J.process),ht=!re&&!A&&!(!je||!ke.HTMLElement),Ge=void 0!==J.process&&"[object process]"==={}.toString.call(J.process)&&!A&&!(!je||!ke.HTMLElement),xe={},ze=function(t){if(!(t=t||J.event))return;let a=xe[t.type];a||(a=xe[t.type]=U("ON_PROPERTY"+t.type));const u=this||t.target||J,c=u[a];let f;if(ht&&u===ke&&"error"===t.type){const m=t;f=c&&c.call(this,m.message,m.filename,m.lineno,m.colno,m.error),!0===f&&t.preventDefault()}else f=c&&c.apply(this,arguments),null!=f&&!f&&t.preventDefault();return f};function nt(t,a,u){let c=ne(t,a);if(!c&&u&&ne(u,a)&&(c={enumerable:!0,configurable:!0}),!c||!c.configurable)return;const f=U("on"+a+"patched");if(t.hasOwnProperty(f)&&t[f])return;delete c.writable,delete c.value;const m=c.get,E=c.set,v=a.substr(2);let C=xe[v];C||(C=xe[v]=U("ON_PROPERTY"+v)),c.set=function(w){let b=this;!b&&t===J&&(b=J),b&&(b[C]&&b.removeEventListener(v,ze),E&&E.apply(b,yt),"function"==typeof w?(b[C]=w,b.addEventListener(v,ze,!1)):b[C]=null)},c.get=function(){let w=this;if(!w&&t===J&&(w=J),!w)return null;const b=w[C];if(b)return b;if(m){let N=m&&m.call(this);if(N)return c.set.call(this,N),"function"==typeof w.removeAttribute&&w.removeAttribute(a),N}return null},he(t,a,c),t[f]=!0}function We(t,a,u){if(a)for(let c=0;cfunction(E,v){const C=u(E,v);return C.cbIdx>=0&&"function"==typeof v[C.cbIdx]?lt(C.name,v[C.cbIdx],C,f):m.apply(E,v)})}function se(t,a){t[U("OriginalDelegate")]=a}let dt=!1,me=!1;function Le(){if(dt)return me;dt=!0;try{const t=ke.navigator.userAgent;(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/")||-1!==t.indexOf("Edge/"))&&(me=!0)}catch(t){}return me}Zone.__load_patch("ZoneAwarePromise",(t,a,u)=>{const c=Object.getOwnPropertyDescriptor,f=Object.defineProperty,E=u.symbol,v=[],C=!0===t[E("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],w=E("Promise"),b=E("then");u.onUnhandledError=s=>{if(u.showUncaughtError()){const o=s&&s.rejection;o?console.error("Unhandled Promise rejection:",o instanceof Error?o.message:o,"; Zone:",s.zone.name,"; Task:",s.task&&s.task.source,"; Value:",o,o instanceof Error?o.stack:void 0):console.error(s)}},u.microtaskDrainDone=()=>{for(;v.length;){const s=v.shift();try{s.zone.runGuarded(()=>{throw s.throwOriginal?s.rejection:s})}catch(o){P(o)}}};const S=E("unhandledPromiseRejectionHandler");function P(s){u.onUnhandledError(s);try{const o=a[S];"function"==typeof o&&o.call(this,s)}catch(o){}}function z(s){return s&&s.then}function x(s){return s}function L(s){return n.reject(s)}const T=E("state"),Z=E("value"),W=E("finally"),B=E("parentPromiseValue"),K=E("parentPromiseState"),Q=null,F=!0,$=!1;function j(s,o){return l=>{try{V(s,o,l)}catch(d){V(s,!1,d)}}}const _e=E("currentTaskTrace");function V(s,o,l){const d=function(){let s=!1;return function(l){return function(){s||(s=!0,l.apply(null,arguments))}}}();if(s===l)throw new TypeError("Promise resolved with itself");if(s[T]===Q){let p=null;try{("object"==typeof l||"function"==typeof l)&&(p=l&&l.then)}catch(y){return d(()=>{V(s,!1,y)})(),s}if(o!==$&&l instanceof n&&l.hasOwnProperty(T)&&l.hasOwnProperty(Z)&&l[T]!==Q)fe(l),V(s,l[T],l[Z]);else if(o!==$&&"function"==typeof p)try{p.call(l,d(j(s,o)),d(j(s,!1)))}catch(y){d(()=>{V(s,!1,y)})()}else{s[T]=o;const y=s[Z];if(s[Z]=l,s[W]===W&&o===F&&(s[T]=s[K],s[Z]=s[B]),o===$&&l instanceof Error){const _=a.currentTask&&a.currentTask.data&&a.currentTask.data.__creationTrace__;_&&f(l,_e,{configurable:!0,enumerable:!1,writable:!0,value:_})}for(let _=0;_{try{const g=s[Z],M=!!l&&W===l[W];M&&(l[B]=g,l[K]=y);const D=o.run(_,void 0,M&&_!==L&&_!==x?[]:[g]);V(l,!0,D)}catch(g){V(l,!1,g)}},l)}const k=function(){};class n{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(o){return V(new this(null),F,o)}static reject(o){return V(new this(null),$,o)}static race(o){let l,d,p=new this((g,M)=>{l=g,d=M});function y(g){l(g)}function _(g){d(g)}for(let g of o)z(g)||(g=this.resolve(g)),g.then(y,_);return p}static all(o){return n.allWithCallback(o)}static allSettled(o){return(this&&this.prototype instanceof n?this:n).allWithCallback(o,{thenCallback:d=>({status:"fulfilled",value:d}),errorCallback:d=>({status:"rejected",reason:d})})}static allWithCallback(o,l){let d,p,y=new this((D,q)=>{d=D,p=q}),_=2,g=0;const M=[];for(let D of o){z(D)||(D=this.resolve(D));const q=g;try{D.then(ee=>{M[q]=l?l.thenCallback(ee):ee,_--,0===_&&d(M)},ee=>{l?(M[q]=l.errorCallback(ee),_--,0===_&&d(M)):p(ee)})}catch(ee){p(ee)}_++,g++}return _-=2,0===_&&d(M),y}constructor(o){const l=this;if(!(l instanceof n))throw new Error("Must be an instanceof Promise.");l[T]=Q,l[Z]=[];try{o&&o(j(l,F),j(l,$))}catch(d){V(l,!1,d)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return n}then(o,l){let d=this.constructor[Symbol.species];(!d||"function"!=typeof d)&&(d=this.constructor||n);const p=new d(k),y=a.current;return this[T]==Q?this[Z].push(y,p,o,l):X(this,y,p,o,l),p}catch(o){return this.then(null,o)}finally(o){let l=this.constructor[Symbol.species];(!l||"function"!=typeof l)&&(l=n);const d=new l(k);d[W]=W;const p=a.current;return this[T]==Q?this[Z].push(p,d,o,o):X(this,p,d,o,o),d}}n.resolve=n.resolve,n.reject=n.reject,n.race=n.race,n.all=n.all;const e=t[w]=t.Promise;t.Promise=n;const r=E("thenPatched");function i(s){const o=s.prototype,l=c(o,"then");if(l&&(!1===l.writable||!l.configurable))return;const d=o.then;o[b]=d,s.prototype.then=function(p,y){return new n((g,M)=>{d.call(this,g,M)}).then(p,y)},s[r]=!0}return u.patchThen=i,e&&(i(e),ae(t,"fetch",s=>function(s){return function(o,l){let d=s.apply(o,l);if(d instanceof n)return d;let p=d.constructor;return p[r]||i(p),d}}(s))),Promise[a.__symbol__("uncaughtPromiseErrors")]=v,n}),Zone.__load_patch("toString",t=>{const a=Function.prototype.toString,u=U("OriginalDelegate"),c=U("Promise"),f=U("Error"),m=function(){if("function"==typeof this){const w=this[u];if(w)return"function"==typeof w?a.call(w):Object.prototype.toString.call(w);if(this===Promise){const b=t[c];if(b)return a.call(b)}if(this===Error){const b=t[f];if(b)return a.call(b)}}return a.call(this)};m[u]=a,Function.prototype.toString=m;const E=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":E.call(this)}});let ce=!1;if("undefined"!=typeof window)try{const t=Object.defineProperty({},"passive",{get:function(){ce=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){ce=!1}const pe={useG:!0},te={},Ee={},vt=new RegExp("^"+Ae+"(\\w+)(true|false)$"),rt=U("propagationStopped");function mt(t,a){const u=(a?a(t):t)+ve,c=(a?a(t):t)+de,f=Ae+u,m=Ae+c;te[t]={},te[t][ve]=f,te[t][de]=m}function qe(t,a,u){const c=u&&u.add||Ie,f=u&&u.rm||Ze,m=u&&u.listeners||"eventListeners",E=u&&u.rmAll||"removeAllListeners",v=U(c),C="."+c+":",N=function(L,T,Z){if(L.isRemoved)return;const W=L.callback;"object"==typeof W&&W.handleEvent&&(L.callback=K=>W.handleEvent(K),L.originalDelegate=W),L.invoke(L,T,[Z]);const B=L.options;B&&"object"==typeof B&&B.once&&T[f].call(T,Z.type,L.originalDelegate?L.originalDelegate:L.callback,B)},S=function(L){if(!(L=L||t.event))return;const T=this||L.target||t,Z=T[te[L.type][ve]];if(Z)if(1===Z.length)N(Z[0],T,L);else{const W=Z.slice();for(let B=0;Bfunction(f,m){f[rt]=!0,c&&c.apply(f,m)})}function pt(t,a,u,c,f){const m=Zone.__symbol__(c);if(a[m])return;const E=a[m]=a[c];a[c]=function(v,C,w){return C&&C.prototype&&f.forEach(function(b){const N=`${u}.${c}::`+b,S=C.prototype;if(S.hasOwnProperty(b)){const P=t.ObjectGetOwnPropertyDescriptor(S,b);P&&P.value?(P.value=t.wrapWithCurrentZone(P.value,N),t._redefineProperty(C.prototype,b,P)):S[b]&&(S[b]=t.wrapWithCurrentZone(S[b],N))}else S[b]&&(S[b]=t.wrapWithCurrentZone(S[b],N))}),E.call(a,v,C,w)},t.attachOriginToPatched(a[c],E)}const Et=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplayconnected","vrdisplaydisconnected","vrdisplaypresentchange"],st=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],le=["load"],De=["blur","error","focus","load","resize","scroll","messageerror"],Te=["bounce","finish","start"],it=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],Pe=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],at=["close","error","open","message"],Re=["error","message"],Oe=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"].concat(["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],["autocomplete","autocompleteerror"],["toggle"],["afterscriptexecute","beforescriptexecute","DOMContentLoaded","freeze","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange","resume"],Et,["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"]);function Ke(t,a,u){if(!u||0===u.length)return a;const c=u.filter(m=>m.target===t);if(!c||0===c.length)return a;const f=c[0].ignoreProperties;return a.filter(m=>-1===f.indexOf(m))}function Y(t,a,u,c){t&&We(t,Ke(t,a,u),c)}Zone.__load_patch("util",(t,a,u)=>{u.patchOnProperties=We,u.patchMethod=ae,u.bindArguments=tt,u.patchMacroTask=Ce;const c=a.__symbol__("BLACK_LISTED_EVENTS"),f=a.__symbol__("UNPATCHED_EVENTS");t[f]&&(t[c]=t[f]),t[c]&&(a[c]=a[f]=t[c]),u.patchEventPrototype=ot,u.patchEventTarget=qe,u.isIEOrEdge=Le,u.ObjectDefineProperty=he,u.ObjectGetOwnPropertyDescriptor=ne,u.ObjectCreate=_t,u.ArraySlice=Ve,u.patchClass=we,u.wrapWithCurrentZone=Be,u.filterProperties=Ke,u.attachOriginToPatched=se,u._redefineProperty=Object.defineProperty,u.patchCallbacks=pt,u.getGlobalObjects=()=>({globalSources:Ee,zoneSymbolEventNames:te,eventNames:Oe,isBrowser:ht,isMix:Ge,isNode:re,TRUE_STR:de,FALSE_STR:ve,ZONE_SYMBOL_PREFIX:Ae,ADD_EVENT_LISTENER_STR:Ie,REMOVE_EVENT_LISTENER_STR:Ze})});const $e=U("zoneTask");function Se(t,a,u,c){let f=null,m=null;u+=c;const E={};function v(w){const b=w.data;return b.args[0]=function(){return w.invoke.apply(this,arguments)},b.handleId=f.apply(t,b.args),w}function C(w){return m.call(t,w.data.handleId)}f=ae(t,a+=c,w=>function(b,N){if("function"==typeof N[0]){const S={isPeriodic:"Interval"===c,delay:"Timeout"===c||"Interval"===c?N[1]||0:void 0,args:N},P=N[0];N[0]=function(){try{return P.apply(this,arguments)}finally{S.isPeriodic||("number"==typeof S.handleId?delete E[S.handleId]:S.handleId&&(S.handleId[$e]=null))}};const z=lt(a,N[0],S,v,C);if(!z)return z;const x=z.data.handleId;return"number"==typeof x?E[x]=z:x&&(x[$e]=z),x&&x.ref&&x.unref&&"function"==typeof x.ref&&"function"==typeof x.unref&&(z.ref=x.ref.bind(x),z.unref=x.unref.bind(x)),"number"==typeof x||x?x:z}return w.apply(t,N)}),m=ae(t,u,w=>function(b,N){const S=N[0];let P;"number"==typeof S?P=E[S]:(P=S&&S[$e],P||(P=S)),P&&"string"==typeof P.type?"notScheduled"!==P.state&&(P.cancelFn&&P.data.isPeriodic||0===P.runCount)&&("number"==typeof S?delete E[S]:S&&(S[$e]=null),P.zone.cancelTask(P)):w.apply(t,N)})}Zone.__load_patch("legacy",t=>{const a=t[Zone.__symbol__("legacyPatch")];a&&a()}),Zone.__load_patch("queueMicrotask",(t,a,u)=>{u.patchMethod(t,"queueMicrotask",c=>function(f,m){a.current.scheduleMicroTask("queueMicrotask",m[0])})}),Zone.__load_patch("timers",t=>{const a="set",u="clear";Se(t,a,u,"Timeout"),Se(t,a,u,"Interval"),Se(t,a,u,"Immediate")}),Zone.__load_patch("requestAnimationFrame",t=>{Se(t,"request","cancel","AnimationFrame"),Se(t,"mozRequest","mozCancel","AnimationFrame"),Se(t,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(t,a)=>{const u=["alert","prompt","confirm"];for(let c=0;cfunction(C,w){return a.current.run(m,t,w,v)})}),Zone.__load_patch("EventTarget",(t,a,u)=>{(function(t,a){a.patchEventPrototype(t,a)})(t,u),function(t,a){if(Zone[a.symbol("patchEventTarget")])return;const{eventNames:u,zoneSymbolEventNames:c,TRUE_STR:f,FALSE_STR:m,ZONE_SYMBOL_PREFIX:E}=a.getGlobalObjects();for(let C=0;C{we("MutationObserver"),we("WebKitMutationObserver")}),Zone.__load_patch("IntersectionObserver",(t,a,u)=>{we("IntersectionObserver")}),Zone.__load_patch("FileReader",(t,a,u)=>{we("FileReader")}),Zone.__load_patch("on_property",(t,a,u)=>{!function(t,a){if(re&&!Ge||Zone[t.symbol("patchEvents")])return;const u="undefined"!=typeof WebSocket,c=a.__Zone_ignore_on_properties;if(ht){const E=window,v=function(){try{const t=ke.navigator.userAgent;if(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/"))return!0}catch(t){}return!1}()?[{target:E,ignoreProperties:["error"]}]:[];Y(E,Oe.concat(["messageerror"]),c&&c.concat(v),ye(E)),Y(Document.prototype,Oe,c),void 0!==E.SVGElement&&Y(E.SVGElement.prototype,Oe,c),Y(Element.prototype,Oe,c),Y(HTMLElement.prototype,Oe,c),Y(HTMLMediaElement.prototype,st,c),Y(HTMLFrameSetElement.prototype,Et.concat(De),c),Y(HTMLBodyElement.prototype,Et.concat(De),c),Y(HTMLFrameElement.prototype,le,c),Y(HTMLIFrameElement.prototype,le,c);const C=E.HTMLMarqueeElement;C&&Y(C.prototype,Te,c);const w=E.Worker;w&&Y(w.prototype,Re,c)}const f=a.XMLHttpRequest;f&&Y(f.prototype,it,c);const m=a.XMLHttpRequestEventTarget;m&&Y(m&&m.prototype,it,c),"undefined"!=typeof IDBIndex&&(Y(IDBIndex.prototype,Pe,c),Y(IDBRequest.prototype,Pe,c),Y(IDBOpenDBRequest.prototype,Pe,c),Y(IDBDatabase.prototype,Pe,c),Y(IDBTransaction.prototype,Pe,c),Y(IDBCursor.prototype,Pe,c)),u&&Y(WebSocket.prototype,at,c)}(u,t)}),Zone.__load_patch("customElements",(t,a,u)=>{!function(t,a){const{isBrowser:u,isMix:c}=a.getGlobalObjects();(u||c)&&t.customElements&&"customElements"in t&&a.patchCallbacks(a,t.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback"])}(t,u)}),Zone.__load_patch("XHR",(t,a)=>{!function(w){const b=w.XMLHttpRequest;if(!b)return;const N=b.prototype;let P=N[Ue],z=N[et];if(!P){const O=w.XMLHttpRequestEventTarget;if(O){const j=O.prototype;P=j[Ue],z=j[et]}}const x="readystatechange",L="scheduled";function T(O){const j=O.data,H=j.target;H[m]=!1,H[v]=!1;const oe=H[f];P||(P=H[Ue],z=H[et]),oe&&z.call(H,x,oe);const _e=H[f]=()=>{if(H.readyState===H.DONE)if(!j.aborted&&H[m]&&O.state===L){const ue=H[a.__symbol__("loadfalse")];if(0!==H.status&&ue&&ue.length>0){const fe=O.invoke;O.invoke=function(){const X=H[a.__symbol__("loadfalse")];for(let I=0;Ifunction(O,j){return O[c]=0==j[2],O[E]=j[1],B.apply(O,j)}),R=U("fetchTaskAborting"),Q=U("fetchTaskScheduling"),F=ae(N,"send",()=>function(O,j){if(!0===a.current[Q]||O[c])return F.apply(O,j);{const H={target:O,url:O[E],isPeriodic:!1,args:j,aborted:!1},oe=lt("XMLHttpRequest.send",Z,H,T,W);O&&!0===O[v]&&!H.aborted&&oe.state===L&&oe.invoke()}}),$=ae(N,"abort",()=>function(O,j){const H=function(O){return O[u]}(O);if(H&&"string"==typeof H.type){if(null==H.cancelFn||H.data&&H.data.aborted)return;H.zone.cancelTask(H)}else if(!0===a.current[R])return $.apply(O,j)})}(t);const u=U("xhrTask"),c=U("xhrSync"),f=U("xhrListener"),m=U("xhrScheduled"),E=U("xhrURL"),v=U("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",t=>{t.navigator&&t.navigator.geolocation&&function(t,a){const u=t.constructor.name;for(let c=0;c{const C=function(){return v.apply(this,tt(arguments,u+"."+f))};return se(C,v),C})(m)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(t,a)=>{function u(c){return function(f){kt(t,c).forEach(E=>{const v=t.PromiseRejectionEvent;if(v){const C=new v(c,{promise:f.promise,reason:f.rejection});E.invoke(C)}})}}t.PromiseRejectionEvent&&(a[U("unhandledPromiseRejectionHandler")]=u("unhandledrejection"),a[U("rejectionHandledHandler")]=u("rejectionhandled"))})},454:(G,ne,he)=>{"use strict";he(277),he(142),he(138)}},G=>{G(G.s=454)}]); /*! (C) Andrea Giammarchi - @WebReflection - ISC Style License */ !function(e,t){"use strict";function n(){var e=C.splice(0,C.length);for(We=0;e.length;)e.shift().call(null,e.shift())}function r(e,t){for(var n=0,r=e.length;n1)&&E(this)}}}),Pe(l,B,{value:function(e){-1>0,R="__"+V+P,U="addEventListener",_="attached",k="Callback",x="detached",q="extends",B="attributeChanged"+k,Z=_+k,j="connected"+k,G="disconnected"+k,z="created"+k,K=x+k,X="ADDITION",$="REMOVAL",Q="DOMAttrModified",W="DOMContentLoaded",Y="DOMSubtreeModified",J="<",ee="=",te=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ne=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],re=[],oe=[],le="",ae=g.documentElement,ie=re.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},ue=b.prototype,ce=ue.hasOwnProperty,se=ue.isPrototypeOf,me=b.defineProperty,fe=[],de=b.getOwnPropertyDescriptor,pe=b.getOwnPropertyNames,he=b.getPrototypeOf,Te=b.setPrototypeOf,Le=!!b.__proto__,Me="__dreCEv1",Ee=e.customElements,ve=!/^force/.test(t.type)&&!!(Ee&&Ee.define&&Ee.get&&Ee.whenDefined),He=b.create||b,ge=e.Map||function(){var e,t=[],n=[];return{get:function(e){return n[ie.call(t,e)]},set:function(r,o){(e=ie.call(t,r))<0?n[t.push(r)-1]=o:n[e]=o}}},be=e.Promise||function(e){function t(e){for(r=!0;n.length;)n.shift()(e)}var n=[],r=!1,o={catch:function(){return o},then:function(e){return n.push(e),r&&setTimeout(t,1),o}};return e(t),o},ye=!1,Ce=He(null),we=He(null),Ae=new ge,Oe=function(e){return e.toLowerCase()},Ne=b.create||function e(t){return t?(e.prototype=t,new e):this},De=Te||(Le?function(e,t){return e.__proto__=t,e}:pe&&de?function(){function e(e,t){for(var n,r=pe(t),o=0,l=r.length;o
    ",new Ie(function(e,t){if(e[0]&&"childList"==e[0].type&&!e[0].removedNodes[0].childNodes.length){var n=(S=de(Se,"innerHTML"))&&S.set;n&&me(Se,"innerHTML",{set:function(e){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,e)}})}t.disconnect(),S=null}).observe(S,{childList:!0,subtree:!0}),S.innerHTML=""),Ye||(Te||Le?(I=function(e,t){se.call(t,e)||f(e,t)},F=f):F=I=function(e,t){e[R]||(e[R]=b(!0),f(e,t))},Ve?(tt=!1,function(){var e=de(Se,U),t=e.value,n=function(e){var t=new CustomEvent(Q,{bubbles:!0});t.attrName=e,t.prevValue=Be.call(this,e),t.newValue=null,t[$]=t.attrChange=2,je.call(this,e),qe.call(this,t)},r=function(e,t){var n=Ze.call(this,e),r=n&&Be.call(this,e),o=new CustomEvent(Q,{bubbles:!0});Ge.call(this,e,t),o.attrName=e,o.prevValue=n?r:null,o.newValue=t,n?o.MODIFICATION=o.attrChange=1:o[X]=o.attrChange=0,qe.call(this,o)},o=function(e){var t,n=e.currentTarget,r=n[R],o=e.propertyName;r.hasOwnProperty(o)&&(r=r[o],(t=new CustomEvent(Q,{bubbles:!0})).attrName=r.name,t.prevValue=r.value||null,t.newValue=r.value=n[o]||null,null==t.prevValue?t[X]=t.attrChange=0:t.MODIFICATION=t.attrChange=1,qe.call(n,t))};e.value=function(e,l,a){e===Q&&this[B]&&this.setAttribute!==r&&(this[R]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,e,l,a)},me(Se,U,e)}()):Ie||(ae[U](Q,Qe),ae.setAttribute(R,1),ae.removeAttribute(R),tt&&(w=function(e){var t,n,r,o=this;if(o===e.target){for(r in t=o[R],o[R]=n=O(o),n){if(!(r in t))return A(0,o,r,t[r],n[r],X);if(n[r]!==t[r])return A(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return A(2,o,r,t[r],n[r],$)}},A=function(e,t,n,r,o,l){var a={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};a[l]=e,i(a)},O=function(e){for(var t,n,r={},o=e.attributes,l=0,a=o.length;l$");if(n[q]="a",(t.prototype=Ne(Fe.prototype)).constructor=t,e.customElements.define(r,t,n),!o.test(g.createElement("a",{is:r}).outerHTML)||!o.test((new t).outerHTML))throw n}(function e(){return Reflect.construct(Fe,[],e)},{},"document-register-element-a"+P)}catch(e){H()}if(!t.noBuiltIn)try{if(ze.call(g,"a","a").outerHTML.indexOf("is")<0)throw{}}catch(e){Oe=function(e){return{is:e.toLowerCase()}}}}(window); -var $Ie=Object.defineProperty,WIe=Object.defineProperties,qIe=Object.getOwnPropertyDescriptors,_x=Object.getOwnPropertySymbols,gW=Object.prototype.hasOwnProperty,mW=Object.prototype.propertyIsEnumerable,gr=Math.pow,_W=(jt,it,tt)=>it in jt?$Ie(jt,it,{enumerable:!0,configurable:!0,writable:!0,value:tt}):jt[it]=tt,ht=(jt,it)=>{for(var tt in it||(it={}))gW.call(it,tt)&&_W(jt,tt,it[tt]);if(_x)for(var tt of _x(it))mW.call(it,tt)&&_W(jt,tt,it[tt]);return jt},Vn=(jt,it)=>WIe(jt,qIe(it)),yW=(jt,it)=>{var tt={};for(var gt in jt)gW.call(jt,gt)&&it.indexOf(gt)<0&&(tt[gt]=jt[gt]);if(null!=jt&&_x)for(var gt of _x(jt))it.indexOf(gt)<0&&mW.call(jt,gt)&&(tt[gt]=jt[gt]);return tt};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(jt,it,tt)=>{var gt=tt(52).default;jt.exports=function Y(Ae,he,W){function V($,b){if(!he[$]){if(!Ae[$]){if(L)return L($,!0);var R=new Error("Cannot find module '"+$+"'");throw R.code="MODULE_NOT_FOUND",R}var A=he[$]={exports:{}};Ae[$][0].call(A.exports,function(v){return V(Ae[$][1][v]||v)},A,A.exports,Y,Ae,he,W)}return he[$].exports}for(var L=void 0,re=0;re0&&z[z.length-1])&&(6===Pe[0]||2===Pe[0])){Ue=0;continue}if(3===Pe[0]&&(!z||Pe[1]>z[0]&&Pe[1]0?K-4:K;for(U=0;U>16&255,F[Q++]=I>>8&255,F[Q++]=255&I;return 2===M&&(I=V[j.charCodeAt(U)]<<2|V[j.charCodeAt(U+1)]>>4,F[Q++]=255&I),1===M&&(I=V[j.charCodeAt(U)]<<10|V[j.charCodeAt(U+1)]<<4|V[j.charCodeAt(U+2)]>>2,F[Q++]=I>>8&255,F[Q++]=255&I),F},he.fromByteArray=function(j){for(var I,H=j.length,K=H%3,M=[],F=16383,Q=0,E=H-K;QE?E:Q+F));return 1===K?M.push(W[(I=j[H-1])>>2]+W[I<<4&63]+"=="):2===K&&M.push(W[(I=(j[H-2]<<8)+j[H-1])>>10]+W[I>>4&63]+W[I<<2&63]+"="),M.join("")};for(var W=[],V=[],L="undefined"!=typeof Uint8Array?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,b=re.length;$0)throw new Error("Invalid string. Length must be a multiple of 4");var H=j.indexOf("=");return-1===H&&(H=I),[H,H===I?0:4-H%4]}function y(j){return W[j>>18&63]+W[j>>12&63]+W[j>>6&63]+W[63&j]}function w(j,I,H){for(var M=[],F=I;F>5==6?2:M>>4==14?3:M>>3==30?4:M>>6==2?-1:-2}function A(M){var F=this.lastTotal-this.lastNeed,Q=function(M,F,Q){if(128!=(192&F[0]))return M.lastNeed=0,"\ufffd";if(M.lastNeed>1&&F.length>1){if(128!=(192&F[1]))return M.lastNeed=1,"\ufffd";if(M.lastNeed>2&&F.length>2&&128!=(192&F[2]))return M.lastNeed=2,"\ufffd"}}(this,M);return void 0!==Q?Q:this.lastNeed<=M.length?(M.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(M.copy(this.lastChar,F,0,M.length),void(this.lastNeed-=M.length))}function w(M,F){if((M.length-F)%2==0){var Q=M.toString("utf16le",F);if(Q){var E=Q.charCodeAt(Q.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],Q.slice(0,-1)}return Q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",F,M.length-1)}function D(M){var F=M&&M.length?this.write(M):"";return this.lastNeed?F+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):F}function j(M,F){var Q=(M.length-F)%3;return 0===Q?M.toString("base64",F):(this.lastNeed=3-Q,this.lastTotal=3,1===Q?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",F,M.length-Q))}function I(M){var F=M&&M.length?this.write(M):"";return this.lastNeed?F+this.lastChar.toString("base64",0,3-this.lastNeed):F}function H(M){return M.toString(this.encoding)}function K(M){return M&&M.length?this.write(M):""}he.StringDecoder=$,$.prototype.write=function(M){if(0===M.length)return"";var F,Q;if(this.lastNeed){if(void 0===(F=this.fillLast(M)))return"";Q=this.lastNeed,this.lastNeed=0}else Q=0;return Q=0?(U>0&&(M.lastNeed=U-1),U):--E=0?(U>0&&(M.lastNeed=U-2),U):--E=0?(U>0&&(2===U?U=0:M.lastNeed=U-3),U):0}(this,M,F);if(!this.lastNeed)return M.toString("utf8",F);this.lastTotal=Q;var E=M.length-(Q-this.lastNeed);return M.copy(this.lastChar,0,E),M.toString("utf8",F,E)},$.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length}},{"safe-buffer":4}],6:[function(Y,Ae,he){(function(W){(function(){"use strict";var V=Y("base64-js"),L=Y("ieee754");he.Buffer=S,he.SlowBuffer=function(B){return+B!=B&&(B=0),S.alloc(+B)},he.INSPECT_MAX_BYTES=50;var re=2147483647;function b(B){if(B>re)throw new RangeError('The value "'+B+'" is invalid for option "size"');var O=new Uint8Array(B);return O.__proto__=S.prototype,O}function S(B,O,k){if("number"==typeof B){if("string"==typeof O)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return R(B,O,k)}function R(B,O,k){if("string"==typeof B)return function(B,O){if(("string"!=typeof O||""===O)&&(O="utf8"),!S.isEncoding(O))throw new TypeError("Unknown encoding: "+O);var k=0|M(B,O),Re=b(k),Xe=Re.write(B,O);return Xe!==k&&(Re=Re.slice(0,Xe)),Re}(B,O);if(ArrayBuffer.isView(B))return D(B);if(null==B)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(pt(B,ArrayBuffer)||B&&pt(B.buffer,ArrayBuffer))return function(B,O,k){if(O<0||B.byteLength=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return 0|B}function M(B,O){if(S.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||pt(B,ArrayBuffer))return B.byteLength;if("string"!=typeof B)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var k=B.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===k)return 0;for(var Xe=!1;;)switch(O){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return X(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Pe(B).length;default:if(Xe)return Re?-1:X(B).length;O=(""+O).toLowerCase(),Xe=!0}}function F(B,O,k){var Re=!1;if((void 0===O||O<0)&&(O=0),O>this.length||((void 0===k||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(O>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return Je(this,O,k);case"utf8":case"utf-8":return ye(this,O,k);case"ascii":return nt(this,O,k);case"latin1":case"binary":return Ze(this,O,k);case"base64":return te(this,O,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,O,k);default:if(Re)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Re=!0}}function Q(B,O,k){var Re=B[O];B[O]=B[k],B[k]=Re}function E(B,O,k,Re,Xe){if(0===B.length)return-1;if("string"==typeof k?(Re=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),pe(k=+k)&&(k=Xe?0:B.length-1),k<0&&(k=B.length+k),k>=B.length){if(Xe)return-1;k=B.length-1}else if(k<0){if(!Xe)return-1;k=0}if("string"==typeof O&&(O=S.from(O,Re)),S.isBuffer(O))return 0===O.length?-1:U(B,O,k,Re,Xe);if("number"==typeof O)return O&=255,"function"==typeof Uint8Array.prototype.indexOf?Xe?Uint8Array.prototype.indexOf.call(B,O,k):Uint8Array.prototype.lastIndexOf.call(B,O,k):U(B,[O],k,Re,Xe);throw new TypeError("val must be string, number or Buffer")}function U(B,O,k,Re,Xe){var Hn,yt=1,It=B.length,An=O.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(B.length<2||O.length<2)return-1;yt=2,It/=2,An/=2,k/=2}function Rn(Is,as){return 1===yt?Is[as]:Is.readUInt16BE(as*yt)}if(Xe){var yi=-1;for(Hn=k;HnIt&&(k=It-An),Hn=k;Hn>=0;Hn--){for(var ci=!0,Ur=0;UrXe&&(Re=Xe):Re=Xe;var yt=O.length;Re>yt/2&&(Re=yt/2);for(var It=0;It>8,yt.push(k%256),yt.push(Re);return yt}(O,B.length-k),B,k,Re)}function te(B,O,k){return V.fromByteArray(0===O&&k===B.length?B:B.slice(O,k))}function ye(B,O,k){k=Math.min(B.length,k);for(var Re=[],Xe=O;Xe239?4:yt>223?3:yt>191?2:1;if(Xe+An<=k)switch(An){case 1:yt<128&&(It=yt);break;case 2:128==(192&(Rn=B[Xe+1]))&&(ci=(31&yt)<<6|63&Rn)>127&&(It=ci);break;case 3:Hn=B[Xe+2],128==(192&(Rn=B[Xe+1]))&&128==(192&Hn)&&(ci=(15&yt)<<12|(63&Rn)<<6|63&Hn)>2047&&(ci<55296||ci>57343)&&(It=ci);break;case 4:Hn=B[Xe+2],yi=B[Xe+3],128==(192&(Rn=B[Xe+1]))&&128==(192&Hn)&&128==(192&yi)&&(ci=(15&yt)<<18|(63&Rn)<<12|(63&Hn)<<6|63&yi)>65535&&ci<1114112&&(It=ci)}null===It?(It=65533,An=1):It>65535&&(Re.push((It-=65536)>>>10&1023|55296),It=56320|1023&It),Re.push(It),Xe+=An}return function(B){var O=B.length;if(O<=4096)return String.fromCharCode.apply(String,B);for(var k="",Re=0;Rek&&(O+=" ... "),""},S.prototype.compare=function(O,k,Re,Xe,yt){if(pt(O,Uint8Array)&&(O=S.from(O,O.offset,O.byteLength)),!S.isBuffer(O))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof O);if(void 0===k&&(k=0),void 0===Re&&(Re=O?O.length:0),void 0===Xe&&(Xe=0),void 0===yt&&(yt=this.length),k<0||Re>O.length||Xe<0||yt>this.length)throw new RangeError("out of range index");if(Xe>=yt&&k>=Re)return 0;if(Xe>=yt)return-1;if(k>=Re)return 1;if(this===O)return 0;for(var It=(yt>>>=0)-(Xe>>>=0),An=(Re>>>=0)-(k>>>=0),Rn=Math.min(It,An),Hn=this.slice(Xe,yt),yi=O.slice(k,Re),ci=0;ci>>=0,isFinite(Re)?(Re>>>=0,void 0===Xe&&(Xe="utf8")):(Xe=Re,Re=void 0)}var yt=this.length-k;if((void 0===Re||Re>yt)&&(Re=yt),O.length>0&&(Re<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");Xe||(Xe="utf8");for(var It=!1;;)switch(Xe){case"hex":return ie(this,O,k,Re);case"utf8":case"utf-8":return ue(this,O,k,Re);case"ascii":return ee(this,O,k,Re);case"latin1":case"binary":return se(this,O,k,Re);case"base64":return Te(this,O,k,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,O,k,Re);default:if(It)throw new TypeError("Unknown encoding: "+Xe);Xe=(""+Xe).toLowerCase(),It=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(B,O,k){var Re="";k=Math.min(B.length,k);for(var Xe=O;XeRe)&&(k=Re);for(var Xe="",yt=O;ytk)throw new RangeError("Trying to access beyond buffer length")}function Le(B,O,k,Re,Xe,yt){if(!S.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>Xe||OB.length)throw new RangeError("Index out of range")}function Ee(B,O,k,Re,Xe,yt){if(k+Re>B.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Oe(B,O,k,Re,Xe){return O=+O,k>>>=0,Xe||Ee(B,0,k,4),L.write(B,O,k,Re,23,4),k+4}function Ue(B,O,k,Re,Xe){return O=+O,k>>>=0,Xe||Ee(B,0,k,8),L.write(B,O,k,Re,52,8),k+8}S.prototype.slice=function(O,k){var Re=this.length;(O=~~O)<0?(O+=Re)<0&&(O=0):O>Re&&(O=Re),(k=void 0===k?Re:~~k)<0?(k+=Re)<0&&(k=0):k>Re&&(k=Re),k>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O],yt=1,It=0;++It>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O+--k],yt=1;k>0&&(yt*=256);)Xe+=this[O+--k]*yt;return Xe},S.prototype.readUInt8=function(O,k){return O>>>=0,k||je(O,1,this.length),this[O]},S.prototype.readUInt16LE=function(O,k){return O>>>=0,k||je(O,2,this.length),this[O]|this[O+1]<<8},S.prototype.readUInt16BE=function(O,k){return O>>>=0,k||je(O,2,this.length),this[O]<<8|this[O+1]},S.prototype.readUInt32LE=function(O,k){return O>>>=0,k||je(O,4,this.length),(this[O]|this[O+1]<<8|this[O+2]<<16)+16777216*this[O+3]},S.prototype.readUInt32BE=function(O,k){return O>>>=0,k||je(O,4,this.length),16777216*this[O]+(this[O+1]<<16|this[O+2]<<8|this[O+3])},S.prototype.readIntLE=function(O,k,Re){O>>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O],yt=1,It=0;++It=(yt*=128)&&(Xe-=Math.pow(2,8*k)),Xe},S.prototype.readIntBE=function(O,k,Re){O>>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=k,yt=1,It=this[O+--Xe];Xe>0&&(yt*=256);)It+=this[O+--Xe]*yt;return It>=(yt*=128)&&(It-=Math.pow(2,8*k)),It},S.prototype.readInt8=function(O,k){return O>>>=0,k||je(O,1,this.length),128&this[O]?-1*(255-this[O]+1):this[O]},S.prototype.readInt16LE=function(O,k){O>>>=0,k||je(O,2,this.length);var Re=this[O]|this[O+1]<<8;return 32768&Re?4294901760|Re:Re},S.prototype.readInt16BE=function(O,k){O>>>=0,k||je(O,2,this.length);var Re=this[O+1]|this[O]<<8;return 32768&Re?4294901760|Re:Re},S.prototype.readInt32LE=function(O,k){return O>>>=0,k||je(O,4,this.length),this[O]|this[O+1]<<8|this[O+2]<<16|this[O+3]<<24},S.prototype.readInt32BE=function(O,k){return O>>>=0,k||je(O,4,this.length),this[O]<<24|this[O+1]<<16|this[O+2]<<8|this[O+3]},S.prototype.readFloatLE=function(O,k){return O>>>=0,k||je(O,4,this.length),L.read(this,O,!0,23,4)},S.prototype.readFloatBE=function(O,k){return O>>>=0,k||je(O,4,this.length),L.read(this,O,!1,23,4)},S.prototype.readDoubleLE=function(O,k){return O>>>=0,k||je(O,8,this.length),L.read(this,O,!0,52,8)},S.prototype.readDoubleBE=function(O,k){return O>>>=0,k||je(O,8,this.length),L.read(this,O,!1,52,8)},S.prototype.writeUIntLE=function(O,k,Re,Xe){O=+O,k>>>=0,Re>>>=0,Xe||Le(this,O,k,Re,Math.pow(2,8*Re)-1,0);var It=1,An=0;for(this[k]=255&O;++An>>=0,Re>>>=0,Xe||Le(this,O,k,Re,Math.pow(2,8*Re)-1,0);var It=Re-1,An=1;for(this[k+It]=255&O;--It>=0&&(An*=256);)this[k+It]=O/An&255;return k+Re},S.prototype.writeUInt8=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,1,255,0),this[k]=255&O,k+1},S.prototype.writeUInt16LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,65535,0),this[k]=255&O,this[k+1]=O>>>8,k+2},S.prototype.writeUInt16BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,65535,0),this[k]=O>>>8,this[k+1]=255&O,k+2},S.prototype.writeUInt32LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,4294967295,0),this[k+3]=O>>>24,this[k+2]=O>>>16,this[k+1]=O>>>8,this[k]=255&O,k+4},S.prototype.writeUInt32BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,4294967295,0),this[k]=O>>>24,this[k+1]=O>>>16,this[k+2]=O>>>8,this[k+3]=255&O,k+4},S.prototype.writeIntLE=function(O,k,Re,Xe){if(O=+O,k>>>=0,!Xe){var yt=Math.pow(2,8*Re-1);Le(this,O,k,Re,yt-1,-yt)}var It=0,An=1,Rn=0;for(this[k]=255&O;++It>0)-Rn&255;return k+Re},S.prototype.writeIntBE=function(O,k,Re,Xe){if(O=+O,k>>>=0,!Xe){var yt=Math.pow(2,8*Re-1);Le(this,O,k,Re,yt-1,-yt)}var It=Re-1,An=1,Rn=0;for(this[k+It]=255&O;--It>=0&&(An*=256);)O<0&&0===Rn&&0!==this[k+It+1]&&(Rn=1),this[k+It]=(O/An>>0)-Rn&255;return k+Re},S.prototype.writeInt8=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,1,127,-128),O<0&&(O=255+O+1),this[k]=255&O,k+1},S.prototype.writeInt16LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,32767,-32768),this[k]=255&O,this[k+1]=O>>>8,k+2},S.prototype.writeInt16BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,32767,-32768),this[k]=O>>>8,this[k+1]=255&O,k+2},S.prototype.writeInt32LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,2147483647,-2147483648),this[k]=255&O,this[k+1]=O>>>8,this[k+2]=O>>>16,this[k+3]=O>>>24,k+4},S.prototype.writeInt32BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,2147483647,-2147483648),O<0&&(O=4294967295+O+1),this[k]=O>>>24,this[k+1]=O>>>16,this[k+2]=O>>>8,this[k+3]=255&O,k+4},S.prototype.writeFloatLE=function(O,k,Re){return Oe(this,O,k,!0,Re)},S.prototype.writeFloatBE=function(O,k,Re){return Oe(this,O,k,!1,Re)},S.prototype.writeDoubleLE=function(O,k,Re){return Ue(this,O,k,!0,Re)},S.prototype.writeDoubleBE=function(O,k,Re){return Ue(this,O,k,!1,Re)},S.prototype.copy=function(O,k,Re,Xe){if(!S.isBuffer(O))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Xe&&0!==Xe&&(Xe=this.length),k>=O.length&&(k=O.length),k||(k=0),Xe>0&&Xe=this.length)throw new RangeError("Index out of range");if(Xe<0)throw new RangeError("sourceEnd out of bounds");Xe>this.length&&(Xe=this.length),O.length-k=0;--It)O[It+k]=this[It+Re];else Uint8Array.prototype.set.call(O,this.subarray(Re,Xe),k);return yt},S.prototype.fill=function(O,k,Re,Xe){if("string"==typeof O){if("string"==typeof k?(Xe=k,k=0,Re=this.length):"string"==typeof Re&&(Xe=Re,Re=this.length),void 0!==Xe&&"string"!=typeof Xe)throw new TypeError("encoding must be a string");if("string"==typeof Xe&&!S.isEncoding(Xe))throw new TypeError("Unknown encoding: "+Xe);if(1===O.length){var yt=O.charCodeAt(0);("utf8"===Xe&&yt<128||"latin1"===Xe)&&(O=yt)}}else"number"==typeof O&&(O&=255);if(k<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,O||(O=0),"number"==typeof O)for(It=k;It55295&&k<57344){if(!Xe){if(k>56319){(O-=3)>-1&&yt.push(239,191,189);continue}if(It+1===Re){(O-=3)>-1&&yt.push(239,191,189);continue}Xe=k;continue}if(k<56320){(O-=3)>-1&&yt.push(239,191,189),Xe=k;continue}k=65536+(Xe-55296<<10|k-56320)}else Xe&&(O-=3)>-1&&yt.push(239,191,189);if(Xe=null,k<128){if((O-=1)<0)break;yt.push(k)}else if(k<2048){if((O-=2)<0)break;yt.push(k>>6|192,63&k|128)}else if(k<65536){if((O-=3)<0)break;yt.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((O-=4)<0)break;yt.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return yt}function Pe(B){return V.toByteArray(function(B){if((B=(B=B.split("=")[0]).trim().replace(qe,"")).length<2)return"";for(;B.length%4!=0;)B+="=";return B}(B))}function Et(B,O,k,Re){for(var Xe=0;Xe=O.length||Xe>=B.length);++Xe)O[Xe+k]=B[Xe];return Xe}function pt(B,O){return B instanceof O||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===O.name}function pe(B){return B!=B}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Ae,he){"use strict";Ae.exports=function W(V){return null===V||"object"!=typeof V||null!=V.toJSON?JSON.stringify(V):Array.isArray(V)?"["+V.reduce((L,re,$)=>L+(0===$?"":",")+W(void 0===re||"symbol"==typeof re?null:re),"")+"]":"{"+Object.keys(V).sort().reduce((L,re,$)=>void 0===V[re]||"symbol"==typeof V[re]?L:L+(0===L.length?"":",")+W(re)+":"+W(V[re]),"")+"}"}},{}],8:[function(Y,Ae,he){"use strict";var L,W="object"==typeof Reflect?Reflect:null,V=W&&"function"==typeof W.apply?W.apply:function(U,ie,ue){return Function.prototype.apply.call(U,ie,ue)};L=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:function(U){return Object.getOwnPropertyNames(U)};var $=Number.isNaN||function(U){return U!=U};function b(){b.init.call(this)}Ae.exports=b,Ae.exports.once=function(E,U){return new Promise(function(ie,ue){function ee(Te){E.removeListener(U,se),ue(Te)}function se(){"function"==typeof E.removeListener&&E.removeListener("error",ee),ie([].slice.call(arguments))}Q(E,U,se,{once:!0}),"error"!==U&&function(E,U,ie){"function"==typeof E.on&&Q(E,"error",U,ie)}(E,ee,{once:!0})})},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var S=10;function R(E){if("function"!=typeof E)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function A(E){return void 0===E._maxListeners?b.defaultMaxListeners:E._maxListeners}function v(E,U,ie,ue){var ee,se,Te;if(R(ie),void 0===(se=E._events)?(se=E._events=Object.create(null),E._eventsCount=0):(void 0!==se.newListener&&(E.emit("newListener",U,ie.listener?ie.listener:ie),se=E._events),Te=se[U]),void 0===Te)Te=se[U]=ie,++E._eventsCount;else if("function"==typeof Te?Te=se[U]=ue?[ie,Te]:[Te,ie]:ue?Te.unshift(ie):Te.push(ie),(ee=A(E))>0&&Te.length>ee&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=U,me.count=Te.length,function(E){console&&console.warn&&console.warn(E)}(me)}return E}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(E,U,ie){var ue={fired:!1,wrapFn:void 0,target:E,type:U,listener:ie},ee=y.bind(ue);return ee.listener=ie,ue.wrapFn=ee,ee}function D(E,U,ie){var ue=E._events;if(void 0===ue)return[];var ee=ue[U];return void 0===ee?[]:"function"==typeof ee?ie?[ee.listener||ee]:[ee]:ie?function(E){for(var U=new Array(E.length),ie=0;ie0&&(Te=ie[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var te=se[U];if(void 0===te)return!1;if("function"==typeof te)V(te,this,ie);else{var ye=te.length,Me=I(te,ye);for(ue=0;ue=0;Te--)if(ue[Te]===ie||ue[Te].listener===ie){me=ue[Te].listener,se=Te;break}if(se<0)return this;0===se?ue.shift():function(E,U){for(;U+1=0;ee--)this.removeListener(U,ie[ee]);return this},b.prototype.listeners=function(U){return D(this,U,!0)},b.prototype.rawListeners=function(U){return D(this,U,!1)},b.listenerCount=function(E,U){return"function"==typeof E.listenerCount?E.listenerCount(U):j.call(E,U)},b.prototype.listenerCount=j,b.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},{}],9:[function(Y,Ae,he){he.read=function(W,V,L,re,$){var b,S,R=8*$-re-1,A=(1<>1,y=-7,w=L?$-1:0,D=L?-1:1,j=W[V+w];for(w+=D,b=j&(1<<-y)-1,j>>=-y,y+=R;y>0;b=256*b+W[V+w],w+=D,y-=8);for(S=b&(1<<-y)-1,b>>=-y,y+=re;y>0;S=256*S+W[V+w],w+=D,y-=8);if(0===b)b=1-v;else{if(b===A)return S?NaN:1/0*(j?-1:1);S+=Math.pow(2,re),b-=v}return(j?-1:1)*S*Math.pow(2,b-re)},he.write=function(W,V,L,re,$,b){var S,R,A,v=8*b-$-1,y=(1<>1,D=23===$?Math.pow(2,-24)-Math.pow(2,-77):0,j=re?0:b-1,I=re?1:-1,H=V<0||0===V&&1/V<0?1:0;for(V=Math.abs(V),isNaN(V)||V===1/0?(R=isNaN(V)?1:0,S=y):(S=Math.floor(Math.log(V)/Math.LN2),V*(A=Math.pow(2,-S))<1&&(S--,A*=2),(V+=S+w>=1?D/A:D*Math.pow(2,1-w))*A>=2&&(S++,A/=2),S+w>=y?(R=0,S=y):S+w>=1?(R=(V*A-1)*Math.pow(2,$),S+=w):(R=V*Math.pow(2,w-1)*Math.pow(2,$),S=0));$>=8;W[L+j]=255&R,j+=I,R/=256,$-=8);for(S=S<<$|R,v+=$;v>0;W[L+j]=255&S,j+=I,S/=256,v-=8);W[L+j-I]|=128*H}},{}],10:[function(Y,Ae,he){Ae.exports="function"==typeof Object.create?function(V,L){L&&(V.super_=L,V.prototype=Object.create(L.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}))}:function(V,L){if(L){V.super_=L;var re=function(){};re.prototype=L.prototype,V.prototype=new re,V.prototype.constructor=V}}},{}],11:[function(Y,Ae,he){"use strict";const{isArray:W,isObject:V,isString:L}=Y("./types"),{asArray:re}=Y("./util"),{prependBase:$}=Y("./url"),b=Y("./JsonLdError"),S=Y("./ResolvedContext");function A(y){throw new b("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function v({context:y,base:w}){if(!y)return;const D=y["@context"];if(L(D))y["@context"]=$(w,D);else if(W(D))for(let j=0;j10)throw new b("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"loading remote context failed":"context overflow",max:10});if(I.has(D))throw new b("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"recursive context inclusion":"context overflow",url:D});let H,K;I.add(D);try{K=yield j(D),H=K.document||null,L(H)&&(H=JSON.parse(H))}catch(M){throw new b("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:D,cause:M})}if(!V(H))throw new b("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:D});return H="@context"in H?{"@context":H["@context"]}:{"@context":{}},K.contextUrl&&(W(H["@context"])||(H["@context"]=[H["@context"]]),H["@context"].push(K.contextUrl)),{context:H,remoteDoc:K}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Ae,he){"use strict";Ae.exports=class extends Error{constructor(V="An unspecified JSON-LD error occurred.",L="jsonld.Error",re={}){super(V),this.name=L,this.message=V,this.details=re}}},{}],13:[function(Y,Ae,he){"use strict";Ae.exports=W=>{class V{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(V,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(V.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:V}),V.compact=function(L,re){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(L,re)},V.expand=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(L)},V.flatten=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(L)},V}},{}],14:[function(Y,Ae,he){"use strict";Ae.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Ae,he){"use strict";Ae.exports=class{constructor(){this._requests={}}wrapLoader(V){const L=this;return L._loader=V,function(){return L.add.apply(L,arguments)}}add(V){var L=this;return gt(function*(){let re=L._requests[V];if(re)return Promise.resolve(re);re=L._requests[V]=L._loader(V);try{return yield re}finally{delete L._requests[V]}})()}}},{}],16:[function(Y,Ae,he){"use strict";const W=Y("lru-cache");Ae.exports=class{constructor({document:re}){this.document=re,this.cache=new W({max:10})}getProcessed(re){return this.cache.get(re)}setProcessed(re,$){this.cache.set(re,$)}}},{"lru-cache":33}],17:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),{isArray:V,isObject:L,isString:re,isUndefined:$}=Y("./types"),{isList:b,isValue:S,isGraph:R,isSimpleGraph:A,isSubjectReference:v}=Y("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:D,process:j,processingMode:I}=Y("./context"),{removeBase:H,prependBase:K}=Y("./url"),{addValue:M,asArray:F,compareShortestLeast:Q}=Y("./util"),E={};function ie(ue,ee,se){if("@nest"!==y(ue,ee,{vocab:!0},se))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ae.exports=E,E.compact=function(){var ue=gt(function*({activeCtx:ee,activeProperty:se=null,element:Te,options:me={},compactionMap:te=(()=>{})}){if(V(Te)){let Me=[];for(let Ve=0;Ve1&&(Je=Array.from(Je).sort());const Ke=ee;for(const Le of Je){const Ee=E.compactIri({activeCtx:Ke,iri:Le,relativeTo:{vocab:!0}}),Oe=w(nt,Ee,"@context");$(Oe)||(ee=yield j({activeCtx:ee,localCtx:Oe,options:me,propagate:!1}))}const je=Object.keys(Te).sort();for(const Le of je){const Ee=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&D(Le)){const Oe=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Oe,Ee)}else{if(!V(Ee))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ee.length){const Oe=E.compactIri({activeCtx:ee,iri:Le,value:Ee,relativeTo:{vocab:!0},reverse:Me}),Ue=ee.mappings.has(Oe)?ee.mappings.get(Oe)["@nest"]:null;let qe=Ve;Ue&&(ie(ee,Ue,me),L(Ve[Ue])||(Ve[Ue]={}),qe=Ve[Ue]),M(qe,Oe,Ee,{propertyIsArray:!0})}for(const Oe of Ee){const Ue=E.compactIri({activeCtx:ee,iri:Le,value:Oe,relativeTo:{vocab:!0},reverse:Me}),qe=ee.mappings.has(Ue)?ee.mappings.get(Ue)["@nest"]:null;let Be=Ve;qe&&(ie(ee,qe,me),L(Ve[qe])||(Ve[qe]={}),Be=Ve[qe]);const z=w(ee,Ue,"@container")||[],X=R(Oe),be=b(Oe);let ce;be?ce=Oe["@list"]:X&&(ce=Oe["@graph"]);let Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:be||X?ce:Oe,options:me,compactionMap:te});if(be){if(V(Pe)||(Pe=[Pe]),z.includes("@list")){M(Be,Ue,Pe,{valueIsArray:!0,allowDuplicate:!0});continue}Pe={[E.compactIri({activeCtx:ee,iri:"@list",relativeTo:{vocab:!0}})]:Pe},"@index"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Oe["@index"])}if(X)if(z.includes("@graph")&&(z.includes("@id")||z.includes("@index")&&A(Oe))){let Et;Be.hasOwnProperty(Ue)?Et=Be[Ue]:Be[Ue]=Et={};const pt=(z.includes("@id")?Oe["@id"]:Oe["@index"])||E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}});M(Et,pt,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})}else z.includes("@graph")&&A(Oe)?(V(Pe)&&Pe.length>1&&(Pe={"@included":Pe}),M(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})):(V(Pe)&&1===Pe.length&&me.compactArrays&&(Pe=Pe[0]),Pe={[E.compactIri({activeCtx:ee,iri:"@graph",relativeTo:{vocab:!0}})]:Pe},"@id"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Oe["@id"]),"@index"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Oe["@index"]),M(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")}));else if(z.includes("@language")||z.includes("@index")||z.includes("@id")||z.includes("@type")){let Et,pt;if(Be.hasOwnProperty(Ue)?Et=Be[Ue]:Be[Ue]=Et={},z.includes("@language"))S(Pe)&&(Pe=Pe["@value"]),pt=Oe["@language"];else if(z.includes("@index")){const pe=w(ee,Ue,"@index")||"@index",B=E.compactIri({activeCtx:ee,iri:pe,relativeTo:{vocab:!0}});if("@index"===pe)pt=Oe["@index"],delete Pe[B];else{let O;if([pt,...O]=F(Pe[pe]||[]),re(pt))switch(O.length){case 0:delete Pe[pe];break;case 1:Pe[pe]=O[0];break;default:Pe[pe]=O}else pt=null}}else if(z.includes("@id")){const pe=E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}});pt=Pe[pe],delete Pe[pe]}else if(z.includes("@type")){const pe=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=F(Pe[pe]||[]),B.length){case 0:delete Pe[pe];break;case 1:Pe[pe]=B[0];break;default:Pe[pe]=B}1===Object.keys(Pe).length&&"@id"in Oe&&(Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:{"@id":Oe["@id"]},options:me,compactionMap:te}))}pt||(pt=E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}})),M(Et,pt,Pe,{propertyIsArray:z.includes("@set")})}else{const Et=!me.compactArrays||z.includes("@set")||z.includes("@list")||V(Pe)&&0===Pe.length||"@list"===Le||"@graph"===Le;M(Be,Ue,Pe,{propertyIsArray:Et})}}}else{if((w(ee,se,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Ue,Ee)}else{const Oe=yield E.compact({activeCtx:ee,activeProperty:se,element:Ee,options:me,compactionMap:te});V(Oe)&&0===Oe.length||M(Ve,Le,Oe)}else{const Oe=yield E.compact({activeCtx:ee,activeProperty:"@reverse",element:Ee,options:me,compactionMap:te});for(const Ue in Oe)if(ee.mappings.has(Ue)&&ee.mappings.get(Ue).reverse){const qe=Oe[Ue],z=(w(ee,Ue,"@container")||[]).includes("@set")||!me.compactArrays;M(Ve,Ue,qe,{propertyIsArray:z}),delete Oe[Ue]}if(Object.keys(Oe).length>0){const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Ue,Oe)}}else{let Oe=F(Ee).map(X=>E.compactIri({activeCtx:nt,iri:X,relativeTo:{vocab:!0}}));1===Oe.length&&(Oe=Oe[0]);const Ue=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}}),z=(w(ee,Ue,"@container")||[]).includes("@set")&&I(ee,1.1)||V(Oe)&&0===Ee.length;M(Ve,Ue,Oe,{propertyIsArray:z})}else{let Oe=F(Ee).map(qe=>E.compactIri({activeCtx:ee,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Oe.length&&(Oe=Oe[0]),Ve[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Oe}}return Ve}return Te});return function(ee){return ue.apply(this,arguments)}}(),E.compactIri=({activeCtx:ue,iri:ee,value:se=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:te=null})=>{if(null===ee)return ee;ue.isPropertyTermScoped&&ue.previousContext&&(ue=ue.previousContext);const ye=ue.getInverse();if(D(ee)&&ee in ye&&"@none"in ye[ee]&&"@type"in ye[ee]["@none"]&&"@none"in ye[ee]["@none"]["@type"])return ye[ee]["@none"]["@type"]["@none"];if(Te.vocab&&ee in ye){const Je=ue["@language"]||"@none",Ke=[];L(se)&&"@index"in se&&!("@graph"in se)&&Ke.push("@index","@index@set"),L(se)&&"@preserve"in se&&(se=se["@preserve"][0]),R(se)?("@index"in se&&Ke.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se&&Ke.push("@graph@id","@graph@id@set"),Ke.push("@graph","@graph@set","@set"),"@index"in se||Ke.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se||Ke.push("@graph@id","@graph@id@set")):L(se)&&!S(se)&&Ke.push("@id","@id@set","@type","@set@type");let je="@language",Le="@null";if(me)je="@type",Le="@reverse",Ke.push("@set");else if(b(se)){"@index"in se||Ke.push("@list");const Oe=se["@list"];if(0===Oe.length)je="@any",Le="@none";else{let Ue=0===Oe.length?Je:null,qe=null;for(let Be=0;Bent.includes("_"));Ve&&ye.push(Ve.replace(/^[^_]+_/,"_"))}ye.push("@none");const Me=ue.inverse[ee];for(const Ve of Te){if(!(Ve in Me))continue;const nt=Me[Ve][me];for(const Ze of ye)if(Ze in nt)return nt[Ze]}return null}(ue,ee,se,Ke,je,Le);if(null!==Ee)return Ee}if(Te.vocab&&"@vocab"in ue){const Je=ue["@vocab"];if(0===ee.indexOf(Je)&&ee!==Je){const Ke=ee.substr(Je.length);if(!ue.mappings.has(Ke))return Ke}}let Me=null;const Ve=[];let nt=ue.fastCurieMap;const Ze=ee.length-1;for(let Je=0;Je=0;--Je){const Ke=Ve[Je],je=Ke.terms;for(const Le of je){const Ee=Le+":"+ee.substr(Ke.iri.length);ue.mappings.get(Le)._prefix&&(!ue.mappings.has(Ee)||null===se&&ue.mappings.get(Ee)["@id"]===ee)&&(null===Me||Q(Ee,Me)<0)&&(Me=Ee)}}if(null!==Me)return Me;for(const[Je,Ke]of ue.mappings)if(Ke&&Ke._prefix&&ee.startsWith(Je+":"))throw new W(`Absolute IRI "${ee}" confused with prefix "${Je}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ue});return Te.vocab?ee:"@base"in ue?ue["@base"]?H(K(te,ue["@base"]),ee):ee:H(te,ee)},E.compactValue=({activeCtx:ue,activeProperty:ee,value:se,options:Te})=>{if(S(se)){const Me=w(ue,ee,"@type"),Ve=w(ue,ee,"@language"),nt=w(ue,ee,"@direction"),Ze=w(ue,ee,"@container")||[],Je="@index"in se&&!Ze.includes("@index");if(!Je&&"@none"!==Me&&(se["@type"]===Me||"@language"in se&&se["@language"]===Ve&&"@direction"in se&&se["@direction"]===nt||"@language"in se&&se["@language"]===Ve||"@direction"in se&&se["@direction"]===nt))return se["@value"];const Ke=Object.keys(se).length,je=1===Ke||2===Ke&&"@index"in se&&!Je,Le="@language"in ue,Ee=re(se["@value"]),Oe=ue.mappings.has(ee)&&null===ue.mappings.get(ee)["@language"];if(je&&"@none"!==Me&&(!Le||!Ee||Oe))return se["@value"];const Ue={};return Je&&(Ue[E.compactIri({activeCtx:ue,iri:"@index",relativeTo:{vocab:!0}})]=se["@index"]),"@type"in se?Ue[E.compactIri({activeCtx:ue,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ue,iri:se["@type"],relativeTo:{vocab:!0}}):"@language"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@language",relativeTo:{vocab:!0}})]=se["@language"]),"@direction"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@direction",relativeTo:{vocab:!0}})]=se["@direction"]),Ue[E.compactIri({activeCtx:ue,iri:"@value",relativeTo:{vocab:!0}})]=se["@value"],Ue}const me=y(ue,ee,{vocab:!0},Te),te=w(ue,ee,"@type"),ye=E.compactIri({activeCtx:ue,iri:se["@id"],relativeTo:{vocab:"@vocab"===te},base:Te.base});return"@id"===te||"@vocab"===te||"@graph"===me?ye:{[E.compactIri({activeCtx:ue,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Ae,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#";Ae.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:W,RDF_LIST:W+"List",RDF_FIRST:W+"first",RDF_REST:W+"rest",RDF_NIL:W+"nil",RDF_TYPE:W+"type",RDF_PLAIN_LITERAL:W+"PlainLiteral",RDF_XML_LITERAL:W+"XMLLiteral",RDF_JSON_LITERAL:W+"JSON",RDF_OBJECT:W+"object",RDF_LANGSTRING:W+"langString",XSD:V,XSD_BOOLEAN:V+"boolean",XSD_DOUBLE:V+"double",XSD_INTEGER:V+"integer",XSD_STRING:V+"string"}},{}],19:[function(Y,Ae,he){"use strict";const W=Y("./util"),V=Y("./JsonLdError"),{isArray:L,isObject:re,isString:$,isUndefined:b}=Y("./types"),{isAbsolute:S,isRelative:R,prependBase:A}=Y("./url"),{asArray:v,compareShortestLeast:y}=Y("./util"),w=new Map,j=/^@[a-zA-Z]+$/,I={};function H(M,F,Q,E,U,ie){if(null===F||!$(F)||I.isKeyword(F))return F;if(F.match(j))return null;if(E&&E.hasOwnProperty(F)&&!0!==U.get(F)&&I.createTermDefinition({activeCtx:M,localCtx:E,term:F,defined:U,options:ie}),(Q=Q||{}).vocab){const ee=M.mappings.get(F);if(null===ee)return null;if(re(ee)&&"@id"in ee)return ee["@id"]}const ue=F.indexOf(":");if(ue>0){const ee=F.substr(0,ue),se=F.substr(ue+1);if("_"===ee||0===se.indexOf("//"))return F;E&&E.hasOwnProperty(ee)&&I.createTermDefinition({activeCtx:M,localCtx:E,term:ee,defined:U,options:ie});const Te=M.mappings.get(ee);if(Te&&Te._prefix)return Te["@id"]+se;if(S(F))return F}if(Q.vocab&&"@vocab"in M)return M["@vocab"]+F;if(Q.base&&"@base"in M){if(M["@base"])return A(A(ie.base,M["@base"]),F)}else if(Q.base)return A(ie.base,F);return F}function K(M,F){if(!M||"object"!=typeof M||!F||"object"!=typeof F)return M===F;const Q=Array.isArray(M);if(Q!==Array.isArray(F))return!1;if(Q){if(M.length!==F.length)return!1;for(let ie=0;ie{if(E.has(Q)){if(E.get(Q))return;throw new V("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:F,term:Q})}let ue;if(E.set(Q,!1),F.hasOwnProperty(Q)&&(ue=F[Q]),"@type"===Q&&re(ue)&&"@set"===(ue["@container"]||"@set")&&I.processingMode(M,1.1)){const Me=["@container","@id","@protected"],Ve=Object.keys(ue);if(0===Ve.length||Ve.some(nt=>!Me.includes(nt)))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q})}else{if(I.isKeyword(Q))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q});if(Q.match(j))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:Q});if(""===Q)throw new V("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:F})}const ee=M.mappings.get(Q);M.mappings.has(Q)&&M.mappings.delete(Q);let se=!1;if(($(ue)||null===ue)&&(se=!0,ue={"@id":ue}),!re(ue))throw new V("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:F});const Te={};M.mappings.set(Q,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];I.processingMode(M,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Me in ue)if(!me.includes(Me))throw new V("Invalid JSON-LD syntax; a term definition must not contain "+Me,"jsonld.SyntaxError",{code:"invalid term definition",context:F});const te=Q.indexOf(":");if(Te._termHasColon=te>0,"@reverse"in ue){if("@id"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});if("@nest"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});const Me=ue["@reverse"];if(!$(Me))throw new V("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(!I.isKeyword(Me)&&Me.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Me}),void(ee?M.mappings.set(Q,ee):M.mappings.delete(Q));const Ve=H(M,Me,{vocab:!0,base:!1},F,E,U);if(!S(Ve))throw new V("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:F});Te["@id"]=Ve,Te.reverse=!0}else if("@id"in ue){let Me=ue["@id"];if(Me&&!$(Me))throw new V("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(null===Me)Te["@id"]=null;else{if(!I.isKeyword(Me)&&Me.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Me}),void(ee?M.mappings.set(Q,ee):M.mappings.delete(Q));if(Me!==Q){if(Me=H(M,Me,{vocab:!0,base:!1},F,E,U),!S(Me)&&!I.isKeyword(Me))throw new V("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:F});if(Q.match(/(?::[^:])|\//)&&H(M,Q,{vocab:!0,base:!1},F,new Map(E).set(Q,!0),U)!==Me)throw new V("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});Te["@id"]=Me,Te._prefix=se&&!Te._termHasColon&&Me.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const Me=Q.substr(0,te);if(F.hasOwnProperty(Me)&&I.createTermDefinition({activeCtx:M,localCtx:F,term:Me,defined:E,options:U}),M.mappings.has(Me)){const Ve=Q.substr(te+1);Te["@id"]=M.mappings.get(Me)["@id"]+Ve}else Te["@id"]=Q}else if("@type"===Q)Te["@id"]=Q;else{if(!("@vocab"in M))throw new V("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F,term:Q});Te["@id"]=M["@vocab"]+Q}if((!0===ue["@protected"]||!0===E.get("@protected")&&!1!==ue["@protected"])&&(M.protected[Q]=!0,Te.protected=!0),E.set(Q,!0),"@type"in ue){let Me=ue["@type"];if(!$(Me))throw new V("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if("@json"===Me||"@none"===Me){if(I.processingMode(M,1))throw new V(`Invalid JSON-LD syntax; an @context @type value must not be "${Me}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else if("@id"!==Me&&"@vocab"!==Me){if(Me=H(M,Me,{vocab:!0,base:!1},F,E,U),!S(Me))throw new V("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if(0===Me.indexOf("_:"))throw new V("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}Te["@type"]=Me}if("@container"in ue){const Me=$(ue["@container"])?[ue["@container"]]:ue["@container"]||[],Ve=["@list","@set","@index","@language"];let nt=!0;const Ze=Me.includes("@set");if(I.processingMode(M,1.1)){if(Ve.push("@graph","@id","@type"),Me.includes("@list")){if(1!==Me.length)throw new V("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:F})}else if(Me.includes("@graph")){if(Me.some(Je=>"@graph"!==Je&&"@id"!==Je&&"@index"!==Je&&"@set"!==Je))throw new V("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:F})}else nt&=Me.length<=(Ze?2:1);if(Me.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new V("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else nt&=!L(ue["@container"]),nt&=Me.length<=1;if(nt&=Me.every(Je=>Ve.includes(Je)),nt&=!(Ze&&Me.includes("@list")),!nt)throw new V("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ve.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:F});if(Te.reverse&&!Me.every(Je=>["@index","@set"].includes(Je)))throw new V("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});Te["@container"]=Me}if("@index"in ue){if(!("@container"in ue)||!Te["@container"].includes("@index"))throw new V(`Invalid JSON-LD syntax; @index without @index in @container: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});if(!$(ue["@index"])||0===ue["@index"].indexOf("@"))throw new V(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});Te["@index"]=ue["@index"]}if("@context"in ue&&(Te["@context"]=ue["@context"]),"@language"in ue&&!("@type"in ue)){let Me=ue["@language"];if(null!==Me&&!$(Me))throw new V("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:F});null!==Me&&(Me=Me.toLowerCase()),Te["@language"]=Me}if("@prefix"in ue){if(Q.match(/:|\//))throw new V("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:F});if(I.isKeyword(Te["@id"]))throw new V("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:F});if("boolean"!=typeof ue["@prefix"])throw new V("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:F});Te._prefix=!0===ue["@prefix"]}if("@direction"in ue){const Me=ue["@direction"];if(null!==Me&&"ltr"!==Me&&"rtl"!==Me)throw new V('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:F});Te["@direction"]=Me}if("@nest"in ue){const Me=ue["@nest"];if(!$(Me)||"@nest"!==Me&&0===Me.indexOf("@"))throw new V("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:F});Te["@nest"]=Me}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new V("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:F});if(ee&&ee.protected&&!ie&&(M.protected[Q]=!0,Te.protected=!0,!K(ee,Te))){const Me=U&&U.protectedMode||"error";if("error"===Me)throw new V(`Invalid JSON-LD syntax; tried to redefine "${Q}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:F,term:Q});if("warn"===Me)return void console.warn("WARNING: protected term redefinition",{term:Q});throw new V("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:F,term:Q,protectedMode:Me})}},I.expandIri=(M,F,Q,E)=>H(M,F,Q,void 0,void 0,E),I.getInitialContext=M=>{const F=JSON.stringify({processingMode:M.processingMode}),Q=w.get(F);if(Q)return Q;const E={processingMode:M.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},te=Te.fastCurieMap={},ye={},Me=(Te["@language"]||"@none").toLowerCase(),Ve=Te["@direction"],nt=Te.mappings,Ze=[...nt.keys()].sort(y);for(const Je of Ze){const Ke=nt.get(Je);if(null===Ke)continue;let je=Ke["@container"]||"@none";if(je=[].concat(je).sort().join(""),null===Ke["@id"])continue;const Le=v(Ke["@id"]);for(const Ee of Le){let Oe=me[Ee];const Ue=I.isKeyword(Ee);if(Oe)!Ue&&!Ke._termHasColon&&ye[Ee].push(Je);else if(me[Ee]=Oe={},!Ue&&!Ke._termHasColon){ye[Ee]=[Je];const qe={iri:Ee,terms:ye[Ee]};Ee[0]in te?te[Ee[0]].push(qe):te[Ee[0]]=[qe]}if(Oe[je]||(Oe[je]={"@language":{},"@type":{},"@any":{}}),Oe=Oe[je],ue(Je,Oe["@any"],"@none"),Ke.reverse)ue(Je,Oe["@type"],"@reverse");else if("@none"===Ke["@type"])ue(Je,Oe["@any"],"@none"),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none");else if("@type"in Ke)ue(Je,Oe["@type"],Ke["@type"]);else if("@language"in Ke&&"@direction"in Ke){const qe=Ke["@language"],Be=Ke["@direction"];ue(Je,Oe["@language"],qe&&Be?`${qe}_${Be}`.toLowerCase():qe?qe.toLowerCase():Be?`_${Be}`:"@null")}else"@language"in Ke?ue(Je,Oe["@language"],(Ke["@language"]||"@null").toLowerCase()):"@direction"in Ke?ue(Je,Oe["@language"],Ke["@direction"]?`_${Ke["@direction"]}`:"@none"):Ve?(ue(Je,Oe["@language"],`_${Ve}`),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none")):(ue(Je,Oe["@language"],Me),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none"))}}for(const Je in te)ie(te,Je,1);return me},clone:function(){const Te={};return Te.mappings=W.clone(this.mappings),Te.clone=this.clone,Te.inverse=null,Te.getInverse=this.getInverse,Te.protected=W.clone(this.protected),this.previousContext&&(Te.previousContext=this.previousContext.clone()),Te.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Te["@base"]=this["@base"]),"@language"in this&&(Te["@language"]=this["@language"]),"@vocab"in this&&(Te["@vocab"]=this["@vocab"]),Te},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===w.size&&w.clear(),w.set(F,E),E;function ie(Te,me,te){const ye=Te[me],Me=Te[me]={};let Ve,nt;for(const Ze of ye)Ve=Ze.iri,nt=te>=Ve.length?"":Ve[te],nt in Me?Me[nt].push(Ze):Me[nt]=[Ze];for(const Ze in Me)""!==Ze&&ie(Me,Ze,te+1)}function ue(Te,me,te){me.hasOwnProperty(te)||(me[te]=Te)}},I.getContextValue=(M,F,Q)=>{if(null===F)return"@context"===Q?void 0:null;if(M.mappings.has(F)){const E=M.mappings.get(F);if(b(Q))return E;if(E.hasOwnProperty(Q))return E[Q]}return"@language"===Q&&Q in M||"@direction"===Q&&Q in M?M[Q]:"@context"!==Q?null:void 0},I.processingMode=(M,F)=>F.toString()>="1.1"?!M.processingMode||M.processingMode>="json-ld-"+F.toString():"json-ld-1.0"===M.processingMode,I.isKeyword=M=>{if(!$(M)||"@"!==M[0])return!1;switch(M){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(Y,Ae,he){"use strict";const{parseLinkHeader:W,buildHeaders:V}=Y("../util"),{LINK_HEADER_CONTEXT:L}=Y("../constants"),re=Y("../JsonLdError"),$=Y("../RequestQueue"),{prependBase:b}=Y("../url"),S=/(^|(\r\n))link:/i;function R(A,v,y){const w=new(A=A||XMLHttpRequest);return new Promise((D,j)=>{w.onload=()=>D(w),w.onerror=I=>j(I),w.open("GET",v,!0);for(const I in y)w.setRequestHeader(I,y[I]);w.send()})}Ae.exports=({secure:A,headers:v={},xhr:y}={headers:{}})=>{return v=V(v),(new $).wrapLoader(D);function D(I){return j.apply(this,arguments)}function j(){return(j=gt(function*(I){if(0!==I.indexOf("http:")&&0!==I.indexOf("https:"))throw new re('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:I});if(A&&0!==I.indexOf("https"))throw new re('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:I});let H;try{H=yield R(y,I,v)}catch(E){throw new re("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:I,cause:E})}if(H.status>=400)throw new re("URL could not be dereferenced: "+H.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:I,httpStatusCode:H.status});let K={contextUrl:null,documentUrl:I,document:H.response},M=null;const F=H.getResponseHeader("Content-Type");let Q;if(S.test(H.getAllResponseHeaders())&&(Q=H.getResponseHeader("Link")),Q&&"application/ld+json"!==F){const E=W(Q),U=E[L];if(Array.isArray(U))throw new re("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:I});U&&(K.contextUrl=U.target),M=E.alternate,M&&"application/ld+json"==M.type&&!(F||"").match(/^application\/(\w*\+)?json$/)&&(K=yield D(b(I,M.target)))}return K})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),{isArray:V,isObject:L,isEmptyObject:re,isString:$,isUndefined:b}=Y("./types"),{isList:S,isValue:R,isGraph:A,isSubject:v}=Y("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:D,process:j,processingMode:I}=Y("./context"),{isAbsolute:H}=Y("./url"),{addValue:K,asArray:M,getValues:F,validateTypeValue:Q}=Y("./util"),E={};Ae.exports=E;const U=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function ie(te){return ue.apply(this,arguments)}function ue(){return(ue=gt(function*({activeCtx:te,activeProperty:ye,expandedActiveProperty:Me,element:Ve,expandedParent:nt,options:Ze={},insideList:Je,typeKey:Ke,typeScopedContext:je,expansionMap:Le}){const Ee=Object.keys(Ve).sort(),Oe=[];let Ue;const qe=Ve[Ke]&&"@json"===y(te,V(Ve[Ke])?Ve[Ke][0]:Ve[Ke],{vocab:!0},Ze);for(const Be of Ee){let X,z=Ve[Be];if("@context"===Be)continue;let be=y(te,Be,{vocab:!0},Ze);if((null===be||!H(be)&&!D(be))&&(be=Le({unmappedProperty:Be,activeCtx:te,activeProperty:ye,parent:Ve,options:Ze,insideList:Je,value:z,expandedParent:nt}),void 0===be))continue;if(D(be)){if("@reverse"===Me)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(be in nt&&"@included"!==be&&"@type"!==be)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:be})}if("@id"===be){if(!$(z)){if(!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(L(z)){if(!re(z))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!V(z))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(pt=>$(pt)))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}K(nt,"@id",M(z).map(pt=>$(pt)?y(te,pt,{base:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@type"===be){L(z)&&(z=Object.fromEntries(Object.entries(z).map(([pt,pe])=>[y(je,pt,{vocab:!0}),M(pe).map(B=>y(je,B,{base:!0,vocab:!0}))]))),Q(z,Ze.isFrame),K(nt,"@type",M(z).map(pt=>$(pt)?y(je,pt,{base:!0,vocab:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@included"===be&&I(te,1.1)){const pt=M(yield E.expand({activeCtx:te,activeProperty:ye,element:z,options:Ze,expansionMap:Le}));if(!pt.every(pe=>v(pe)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});K(nt,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===be&&!L(z)&&!V(z))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if("@value"===be){Ue=z,qe&&I(te,1.1)?nt["@value"]=z:K(nt,"@value",z,{propertyIsArray:Ze.isFrame});continue}if("@language"===be){if(null===z)continue;if(!$(z)&&!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=M(z).map(pt=>$(pt)?pt.toLowerCase():pt);for(const pt of z)$(pt)&&!pt.match(U)&&console.warn(`@language must be valid BCP47: ${pt}`);K(nt,"@language",z,{propertyIsArray:Ze.isFrame});continue}if("@direction"===be){if(!$(z)&&!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=M(z);for(const pt of z)if($(pt)&&"ltr"!==pt&&"rtl"!==pt)throw new W('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});K(nt,"@direction",z,{propertyIsArray:Ze.isFrame});continue}if("@index"===be){if(!$(z))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});K(nt,"@index",z);continue}if("@reverse"===be){if(!L(z))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(X=yield E.expand({activeCtx:te,activeProperty:"@reverse",element:z,options:Ze,expansionMap:Le}),"@reverse"in X)for(const pe in X["@reverse"])K(nt,pe,X["@reverse"][pe],{propertyIsArray:!0});let pt=nt["@reverse"]||null;for(const pe in X){if("@reverse"===pe)continue;null===pt&&(pt=nt["@reverse"]={}),K(pt,pe,[],{propertyIsArray:!0});const B=X[pe];for(let O=0;O"@id"===pt||"@index"===pt)&&(X=M(X).map(pt=>({"@graph":M(pt)}))),ce.mappings.has(Be)&&ce.mappings.get(Be).reverse){const pt=nt["@reverse"]=nt["@reverse"]||{};X=M(X);for(let pe=0;pe"@value"===y(te,be,{vocab:!0},Ze)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:X});yield ie({activeCtx:te,activeProperty:ye,expandedActiveProperty:Me,element:X,expandedParent:nt,options:Ze,insideList:Je,typeScopedContext:je,typeKey:Ke,expansionMap:Le})}}})).apply(this,arguments)}function ee({activeCtx:te,activeProperty:ye,value:Me,options:Ve}){if(null==Me)return null;const nt=y(te,ye,{vocab:!0},Ve);if("@id"===nt)return y(te,Me,{base:!0},Ve);if("@type"===nt)return y(te,Me,{vocab:!0,base:!0},Ve);const Ze=w(te,ye,"@type");if(("@id"===Ze||"@graph"===nt)&&$(Me))return{"@id":y(te,Me,{base:!0},Ve)};if("@vocab"===Ze&&$(Me))return{"@id":y(te,Me,{vocab:!0,base:!0},Ve)};if(D(nt))return Me;const Je={};if(Ze&&!["@id","@vocab","@none"].includes(Ze))Je["@type"]=Ze;else if($(Me)){const Ke=w(te,ye,"@language");null!==Ke&&(Je["@language"]=Ke);const je=w(te,ye,"@direction");null!==je&&(Je["@direction"]=je)}return["boolean","number","string"].includes(typeof Me)||(Me=Me.toString()),Je["@value"]=Me,Je}function se(te,ye,Me,Ve){const nt=[],Ze=Object.keys(ye).sort();for(const Je of Ze){const Ke=y(te,Je,{vocab:!0},Ve);let je=ye[Je];V(je)||(je=[je]);for(const Le of je){if(null===Le)continue;if(!$(Le))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ee={"@value":Le};"@none"!==Ke&&(Ee["@language"]=Je.toLowerCase()),Me&&(Ee["@direction"]=Me),nt.push(Ee)}}return nt}function Te(te){return me.apply(this,arguments)}function me(){return(me=gt(function*({activeCtx:te,options:ye,activeProperty:Me,value:Ve,expansionMap:nt,asGraph:Ze,indexKey:Je,propertyIndex:Ke}){const je=[],Le=Object.keys(Ve).sort(),Ee="@type"===Je;for(let Oe of Le){if(Ee){const Be=w(te,Oe,"@context");b(Be)||(te=yield j({activeCtx:te,localCtx:Be,propagate:!1,options:ye}))}let qe,Ue=Ve[Oe];V(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:te,activeProperty:Me,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:nt}),qe=Ke?"@none"===Oe?"@none":ee({activeCtx:te,activeProperty:Je,value:Oe,options:ye}):y(te,Oe,{vocab:!0},ye),"@id"===Je?Oe=y(te,Oe,{base:!0},ye):Ee&&(Oe=qe);for(let Be of Ue){if(Ze&&!A(Be)&&(Be={"@graph":[Be]}),"@type"===Je)"@none"===qe||(Be["@type"]=Be["@type"]?[Oe].concat(Be["@type"]):[Oe]);else{if(R(Be)&&!["@language","@type","@index"].includes(Je))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${Je}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Be});Ke?"@none"!==qe&&K(Be,Ke,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(Je in Be)&&(Be[Je]=Oe)}je.push(Be)}}return je})).apply(this,arguments)}E.expand=function(){var te=gt(function*({activeCtx:ye,activeProperty:Me=null,element:Ve,options:nt={},insideList:Ze=!1,insideIndex:Je=!1,typeScopedContext:Ke=null,expansionMap:je=(()=>{})}){if(null==Ve)return null;if("@default"===Me&&(nt=Object.assign({},nt,{isFrame:!1})),!V(Ve)&&!L(Ve)){if(!Ze&&(null===Me||"@graph"===y(ye,Me,{vocab:!0},nt))){const X=yield je({unmappedValue:Ve,activeCtx:ye,activeProperty:Me,options:nt,insideList:Ze});return void 0===X?null:X}return ee({activeCtx:ye,activeProperty:Me,value:Ve,options:nt})}if(V(Ve)){let X=[];const be=w(ye,Me,"@container")||[];Ze=Ze||be.includes("@list");for(let ce=0;ce1?ce.slice().sort():ce:[ce];for(const Et of Pe){const pt=w(Ke,Et,"@context");b(pt)||(ye=yield j({activeCtx:ye,localCtx:pt,options:nt,propagate:!1}))}}let Be={};yield ie({activeCtx:ye,activeProperty:Me,expandedActiveProperty:Le,element:Ve,expandedParent:Be,options:nt,insideList:Ze,typeKey:qe,typeScopedContext:Ke,expansionMap:je}),Oe=Object.keys(Be);let z=Oe.length;if("@value"in Be){if("@type"in Be&&("@language"in Be||"@direction"in Be))throw new W('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:Be});let X=z-1;if("@type"in Be&&(X-=1),"@index"in Be&&(X-=1),"@language"in Be&&(X-=1),"@direction"in Be&&(X-=1),0!==X)throw new W('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:Be});const be=null===Be["@value"]?[]:M(Be["@value"]),ce=F(Be,"@type");if(!I(ye,1.1)||!ce.includes("@json")||1!==ce.length)if(0===be.length){const Pe=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==Pe?Pe:null}else{if(!be.every(Pe=>$(Pe)||re(Pe))&&"@language"in Be)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Be});if(!ce.every(Pe=>H(Pe)&&!($(Pe)&&0===Pe.indexOf("_:"))||re(Pe)))throw new W('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:Be})}}else if("@type"in Be&&!V(Be["@type"]))Be["@type"]=[Be["@type"]];else if("@set"in Be||"@list"in Be){if(z>1&&(2!==z||!("@index"in Be)))throw new W('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:Be});"@set"in Be&&(Be=Be["@set"],Oe=Object.keys(Be),z=Oe.length)}else if(1===z&&"@language"in Be){const X=yield je(Be,{unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}if(L(Be)&&!nt.keepFreeFloatingNodes&&!Ze&&(null===Me||"@graph"===Le)&&(0===z||"@value"in Be||"@list"in Be||1===z&&"@id"in Be)){const X=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}return Be});return function(ye){return te.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Ae,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:V}=Y("./nodeMap"),L={};Ae.exports=L,L.flatten=re=>{const $=V(re),b=[],S=Object.keys($).sort();for(let R=0;R=0;--ue){const ee=ie[ue];if(ee.graph===U&&ee.subject["@id"]===E["@id"])return!0}return!1}function w(E,U,ie){const ue="@"+ie;let ee=ue in E?E[ue][0]:U[ie];if("embed"===ie)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return ee}function D(E){if(!L.isArray(E)||1!==E.length||!L.isObject(E[0]))throw new b("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const U of re.asArray(E[0]["@id"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const U of re.asArray(E[0]["@type"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function I(E,U,ie,ue){let ee=!0,se=!1;for(const Te in ie){let me=!1;const te=re.getValues(U,Te),ye=0===re.getValues(ie,Te).length;if("@id"===Te){if(L.isEmptyObject(ie["@id"][0]||{})?me=!0:ie["@id"].length>=0&&(me=ie["@id"].includes(te[0])),!ue.requireAll)return me}else if("@type"===Te){if(ee=!1,ye){if(te.length>0)return!1;me=!0}else if(1===ie["@type"].length&&L.isEmptyObject(ie["@type"][0]))me=te.length>0;else for(const Me of ie["@type"])me=!(!L.isObject(Me)||!("@default"in Me))||me||te.some(Ve=>Ve===Me);if(!ue.requireAll)return me}else{if(W(Te))continue;{const Me=re.getValues(ie,Te)[0];let Ve=!1;if(Me&&(D([Me]),Ve="@default"in Me),ee=!1,0===te.length&&Ve)continue;if(te.length>0&&ye)return!1;if(void 0===Me){if(te.length>0)return!1;me=!0}else if(V.isList(Me)){const nt=Me["@list"][0];if(V.isList(te[0])){const Ze=te[0]["@list"];V.isValue(nt)?me=Ze.some(Je=>Q(nt,Je)):(V.isSubject(nt)||V.isSubjectReference(nt))&&(me=Ze.some(Je=>F(E,nt,Je,ue)))}}else me=V.isValue(Me)?te.some(nt=>Q(Me,nt)):V.isSubjectReference(Me)?te.some(nt=>F(E,Me,nt,ue)):!!L.isObject(Me)&&te.length>0}}if(!me&&ue.requireAll)return!1;se=se||me}return ee||se}function H(E,U){const ie=E.uniqueEmbeds[E.graph],ue=ie[U],ee=ue.parent,se=ue.property,Te={"@id":U};if(L.isArray(ee)){for(let te=0;te{const ye=Object.keys(ie);for(const Me of ye)Me in ie&&L.isObject(ie[Me].parent)&&ie[Me].parent["@id"]===te&&(delete ie[Me],me(Me))};me(U)}function K(E,U){if(L.isArray(E))return E.map(ie=>K(ie,U));if(L.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(V.isValue(E))return E;if(V.isList(E))return E["@list"]=K(E["@list"],U),E;if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)"@id"===ie&&U.bnodesToClear.includes(E[ie])?delete E["@id"]:E[ie]=K(E[ie],U)}return E}function M(E,U,ie){L.isObject(E)?re.addValue(E,U,ie,{propertyIsArray:!0}):E.push(ie)}function F(E,U,ie,ue){if(!("@id"in ie))return!1;const ee=E.subjects[ie["@id"]];return ee&&I(E,ee,U,ue)}function Q(E,U){const ie=U["@value"],ue=U["@type"],ee=U["@language"],se=E["@value"]?L.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?L.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?L.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===se.length&&0===Te.length&&0===me.length||!(!se.includes(ie)&&!L.isEmptyObject(se[0])||!(!ue&&0===Te.length||Te.includes(ue)||ue&&L.isEmptyObject(Te[0]))||!(!ee&&0===me.length||me.includes(ee)||ee&&L.isEmptyObject(me[0])))}Ae.exports=A,A.frameMergedOrDefault=(E,U,ie)=>{const ue={options:ie,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new re.IdentifierIssuer("_:b");S(E,ue.graphMap,"@default",ee),ie.merged&&(ue.graphMap["@merged"]=R(ue.graphMap),ue.graph="@merged"),ue.subjects=ue.graphMap[ue.graph];const se=[];return A.frame(ue,Object.keys(ue.subjects).sort(),U,se),ie.pruneBlankNodeIdentifiers&&(ie.bnodesToClear=Object.keys(ue.bnodeMap).filter(Te=>1===ue.bnodeMap[Te].length)),ie.link={},K(se,ie)},A.frame=(E,U,ie,ue,ee=null)=>{D(ie);const se=E.options,Te={embed:w(ie=ie[0],se,"embed"),explicit:w(ie,se,"explicit"),requireAll:w(ie,se,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],te=function(E,U,ie,ue){const ee={};for(const se of U){const Te=E.graphMap[E.graph][se];I(E,Te,ie,ue)&&(ee[se]=Te)}return ee}(E,U,ie,Te),ye=Object.keys(te).sort();for(const Me of ye){const Ve=te[Me];if(null===ee?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&Me in me){M(ue,ee,me[Me]);continue}const nt={"@id":Me};if(0===Me.indexOf("_:")&&re.addValue(E.bnodeMap,Me,nt,{propertyIsArray:!0}),me[Me]=nt,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:ie});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Me)){if(E.embedded&&("@never"===Te.embed||y(Ve,E.graph,E.subjectStack))){M(ue,ee,nt);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Me)){M(ue,ee,nt);continue}if("@last"===Te.embed&&Me in E.uniqueEmbeds[E.graph]&&H(E,Me),E.uniqueEmbeds[E.graph][Me]={parent:ue,property:ee},E.subjectStack.push({subject:Ve,graph:E.graph}),Me in E.graphMap){let Ze=!1,Je=null;"@graph"in ie?(Je=ie["@graph"][0],Ze=!("@merged"===Me||"@default"===Me),L.isObject(Je)||(Je={})):(Ze="@merged"!==E.graph,Je={}),Ze&&A.frame(Vn(ht({},E),{graph:Me,embedded:!1}),Object.keys(E.graphMap[Me]).sort(),[Je],nt,"@graph")}"@included"in ie&&A.frame(Vn(ht({},E),{embedded:!1}),U,ie["@included"],nt,"@included");for(const Ze of Object.keys(Ve).sort())if(W(Ze)){if(nt[Ze]=re.clone(Ve[Ze]),"@type"===Ze)for(const Je of Ve["@type"])0===Je.indexOf("_:")&&re.addValue(E.bnodeMap,Je,nt,{propertyIsArray:!0})}else if(!Te.explicit||Ze in ie)for(const Je of Ve[Ze]){const Ke=Ze in ie?ie[Ze]:v(Te);if(V.isList(Je)){const je=ie[Ze]&&ie[Ze][0]&&ie[Ze][0]["@list"]?ie[Ze][0]["@list"]:v(Te),Le={"@list":[]};M(nt,Ze,Le);const Ee=Je["@list"];for(const Oe of Ee)V.isSubjectReference(Oe)?A.frame(Vn(ht({},E),{embedded:!0}),[Oe["@id"]],je,Le,"@list"):M(Le,"@list",re.clone(Oe))}else V.isSubjectReference(Je)?A.frame(Vn(ht({},E),{embedded:!0}),[Je["@id"]],Ke,nt,Ze):Q(Ke[0],Je)&&M(nt,Ze,re.clone(Je))}for(const Ze of Object.keys(ie).sort()){if("@type"===Ze){if(!L.isObject(ie[Ze][0])||!("@default"in ie[Ze][0]))continue}else if(W(Ze))continue;const Je=ie[Ze][0]||{};if(!w(Je,se,"omitDefault")&&!(Ze in nt)){let je="@null";"@default"in Je&&(je=re.clone(Je["@default"])),L.isArray(je)||(je=[je]),nt[Ze]=[{"@preserve":je}]}}for(const Ze of Object.keys(ie["@reverse"]||{}).sort()){const Je=ie["@reverse"][Ze];for(const Ke of Object.keys(E.subjects))re.getValues(E.subjects[Ke],Ze).some(Le=>Le["@id"]===Me)&&(nt["@reverse"]=nt["@reverse"]||{},re.addValue(nt["@reverse"],Ze,[],{propertyIsArray:!0}),A.frame(Vn(ht({},E),{embedded:!0}),[Ke],Je,nt["@reverse"][Ze],ee))}M(ue,ee,nt),E.subjectStack.pop()}}},A.cleanupNull=(E,U)=>{if(L.isArray(E))return E.map(ue=>A.cleanupNull(ue,U)).filter(ue=>ue);if("@null"===E)return null;if(L.isObject(E)){if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)E[ie]=A.cleanupNull(E[ie],U)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),V=Y("./graphTypes"),L=Y("./types"),re=Y("./util"),{RDF_LIST:$,RDF_FIRST:b,RDF_REST:S,RDF_NIL:R,RDF_TYPE:A,RDF_JSON_LITERAL:v,XSD_BOOLEAN:y,XSD_DOUBLE:w,XSD_INTEGER:D,XSD_STRING:j}=Y("./constants"),I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,H={};function K(M,F,Q){if(M.termType.endsWith("Node"))return{"@id":M.value};const E={"@value":M.value};if(M.language)E["@language"]=M.language;else{let U=M.datatype.value;if(U||(U=j),U===v){U="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(ie){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:ie})}}if(F){if(U===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(L.isNumeric(E["@value"]))if(U===D){const ie=parseInt(E["@value"],10);ie.toFixed(0)===E["@value"]&&(E["@value"]=ie)}else U===w&&(E["@value"]=parseFloat(E["@value"]));[y,D,w,j].includes(U)||(E["@type"]=U)}else if("i18n-datatype"===Q&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,ue]=U.split(/[#_]/);ie.length>0&&(E["@language"]=ie,ie.match(I)||console.warn(`@language must be valid BCP47: ${ie}`)),E["@direction"]=ue}else U!==j&&(E["@type"]=U)}return E}Ae.exports=H,H.fromRDF=function(){var M=gt(function*(F,{useRdfType:Q=!1,useNativeTypes:E=!1,rdfDirection:U=null}){const ie={},ue={"@default":ie},ee={};for(const me of F){const te="DefaultGraph"===me.graph.termType?"@default":me.graph.value;te in ue||(ue[te]={}),"@default"!==te&&!(te in ie)&&(ie[te]={"@id":te});const ye=ue[te],Me=me.subject.value,Ve=me.predicate.value,nt=me.object;Me in ye||(ye[Me]={"@id":Me});const Ze=ye[Me],Je=nt.termType.endsWith("Node");if(Je&&!(nt.value in ye)&&(ye[nt.value]={"@id":nt.value}),Ve===A&&!Q&&Je){re.addValue(Ze,"@type",nt.value,{propertyIsArray:!0});continue}const Ke=K(nt,E,U);if(re.addValue(Ze,Ve,Ke,{propertyIsArray:!0}),Je)if(nt.value===R){const je=ye[nt.value];"usages"in je||(je.usages=[]),je.usages.push({node:Ze,property:Ve,value:Ke})}else ee[nt.value]=!(nt.value in ee)&&{node:Ze,property:Ve,value:Ke}}for(const me in ue){const te=ue[me];if(!(R in te))continue;const ye=te[R];if(ye.usages){for(let Me of ye.usages){let Ve=Me.node,nt=Me.property,Ze=Me.value;const Je=[],Ke=[];let je=Object.keys(Ve).length;for(;nt===S&&L.isObject(ee[Ve["@id"]])&&L.isArray(Ve[b])&&1===Ve[b].length&&L.isArray(Ve[S])&&1===Ve[S].length&&(3===je||4===je&&L.isArray(Ve["@type"])&&1===Ve["@type"].length&&Ve["@type"][0]===$)&&(Je.push(Ve[b][0]),Ke.push(Ve["@id"]),Me=ee[Ve["@id"]],Ve=Me.node,nt=Me.property,Ze=Me.value,je=Object.keys(Ve).length,V.isBlankNode(Ve)););delete Ze["@id"],Ze["@list"]=Je.reverse();for(const Le of Ke)delete te[Le]}delete ye.usages}}const se=[],Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me];if(me in ue){const ye=te["@graph"]=[],Me=ue[me],Ve=Object.keys(Me).sort();for(const nt of Ve){const Ze=Me[nt];V.isSubjectReference(Ze)||ye.push(Ze)}}V.isSubjectReference(te)||se.push(te)}return se});return function(F,Q){return M.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Ae,he){"use strict";const W=Y("./types"),V={};Ae.exports=V,V.isSubject=L=>!(!W.isObject(L)||"@value"in L||"@set"in L||"@list"in L)&&(Object.keys(L).length>1||!("@id"in L)),V.isSubjectReference=L=>W.isObject(L)&&1===Object.keys(L).length&&"@id"in L,V.isValue=L=>W.isObject(L)&&"@value"in L,V.isList=L=>W.isObject(L)&&"@list"in L,V.isGraph=L=>W.isObject(L)&&"@graph"in L&&1===Object.keys(L).filter(re=>"@id"!==re&&"@index"!==re).length,V.isSimpleGraph=L=>V.isGraph(L)&&!("@id"in L),V.isBlankNode=L=>!!W.isObject(L)&&("@id"in L?0===L["@id"].indexOf("_:"):0===Object.keys(L).length||!("@value"in L||"@set"in L||"@list"in L))},{"./types":30}],26:[function(Y,Ae,he){const W=Y("rdf-canonize"),V=Y("./platform"),L=Y("./util"),re=Y("./ContextResolver"),$=L.IdentifierIssuer,b=Y("./JsonLdError"),S=Y("lru-cache"),R=Y("./NQuads"),{expand:A}=Y("./expand"),{flatten:v}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:w}=Y("./toRdf"),{frameMergedOrDefault:D,cleanupNull:j}=Y("./frame"),{isArray:I,isObject:H,isString:K}=Y("./types"),{isSubjectReference:M}=Y("./graphTypes"),{expandIri:F,getInitialContext:Q,process:E,processingMode:U}=Y("./context"),{compact:ie,compactIri:ue}=Y("./compact"),{createNodeMap:ee,createMergedNodeMap:se,mergeNodeMaps:Te}=Y("./nodeMap"),me=function(ye){const Me={},nt=new S({max:100});function Ze(Je,Le){var Ee=Le,{documentLoader:Ke=ye.documentLoader}=Ee,je=yW(Ee,["documentLoader"]);return Object.assign({},{documentLoader:Ke},je,Je)}return ye.compact=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===je)throw new b("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ke)return null;let Ee;(Le=Ze(Le,{base:K(Ke)?Ke:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new $("_:b"),contextResolver:new re({sharedCache:nt})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ee=Le.skipExpansion?Ke:yield ye.expand(Ke,Le);const Oe=yield ye.processContext(Q(Le),je,Le);let Ue=yield ie({activeCtx:Oe,element:Ee,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&I(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&H(Ue)&&(Ue=[Ue]),H(je)&&"@context"in je&&(je=je["@context"]),je=L.clone(je),I(je)||(je=[je]);const qe=je;je=[];for(let z=0;z0)&&je.push(qe[z]);const Be=je.length>0;if(1===je.length&&(je=je[0]),I(Ue)){const z=ue({activeCtx:Oe,iri:"@graph",relativeTo:{vocab:!0}}),X=Ue;Ue={},Be&&(Ue["@context"]=je),Ue[z]=X}else if(H(Ue)&&Be){const z=Ue;Ue={"@context":je};for(const X in z)Ue[X]=z[X]}return Ue});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.expand=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(je=Ze(je,{keepFreeFloatingNodes:!1,contextResolver:new re({sharedCache:nt})})).expansionMap&&(je.expansionMap=void 0);const Le={},Ee=[];if("expandContext"in je){const Be=L.clone(je.expandContext);Le.expandContext=H(Be)&&"@context"in Be?Be:{"@context":Be},Ee.push(Le.expandContext)}let Oe;if(K(Ke)){const Be=yield ye.get(Ke,je);Oe=Be.documentUrl,Le.input=Be.document,Be.contextUrl&&(Le.remoteContext={"@context":Be.contextUrl},Ee.push(Le.remoteContext))}else Le.input=L.clone(Ke);"base"in je||(je.base=Oe||"");let Ue=Q(je);for(const Be of Ee)Ue=yield E({activeCtx:Ue,localCtx:Be,options:je});let qe=yield A({activeCtx:Ue,element:Le.input,options:je,expansionMap:je.expansionMap});return H(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),I(qe)||(qe=[qe]),qe});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.flatten=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");je="function"==typeof je?null:je||null,Le=Ze(Le,{base:K(Ke)?Ke:"",contextResolver:new re({sharedCache:nt})});const Ee=yield ye.expand(Ke,Le),Oe=v(Ee);return null===je?Oe:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Oe,je,Le))});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.frame=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Ze(Le,{base:K(Ke)?Ke:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new re({sharedCache:nt})}),K(je)){const ce=yield ye.get(je,Le);if(je=ce.document,ce.contextUrl){let Pe=je["@context"];Pe?I(Pe)?Pe.push(ce.contextUrl):Pe=[Pe,ce.contextUrl]:Pe=ce.contextUrl,je["@context"]=Pe}}const Ee=je&&je["@context"]||{},Oe=yield ye.processContext(Q(Le),Ee,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=U(Oe,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=U(Oe,1.1));const Ue=yield ye.expand(Ke,Le),qe=ht({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const Be=yield ye.expand(je,qe),z=Object.keys(je).map(ce=>F(Oe,ce,{vocab:!0}));qe.merged=!z.includes("@graph"),qe.is11=U(Oe,1.1);const X=D(Ue,Be,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let be=yield ye.compact(X,Ee,qe);return qe.link={},be=j(be,qe),be});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.link=function(){var Je=gt(function*(Ke,je,Le){const Ee={};return je&&(Ee["@context"]=je),Ee["@embed"]="@link",ye.frame(Ke,Ee,Le)});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(je=Ze(je,{base:K(Ke)?Ke:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new re({sharedCache:nt})}))){if("application/n-quads"!==je.inputFormat&&"application/nquads"!==je.inputFormat)throw new b("Unknown canonicalization input format.","jsonld.CanonizeError");const Oe=R.parse(Ke);return W.canonize(Oe,je)}const Le=ht({},je);delete Le.format,Le.produceGeneralizedRdf=!1;const Ee=yield ye.toRDF(Ke,Le);return W.canonize(Ee,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.fromRDF=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");je=Ze(je,{format:K(Ke)?"application/n-quads":void 0});const{format:Le}=je;let{rdfParser:Ee}=je;if(Le){if(Ee=Ee||Me[Le],!Ee)throw new b("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ee=()=>Ke;const Oe=yield Ee(Ke);return y(Oe,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.toRDF=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(je=Ze(je,{base:K(Ke)?Ke:"",skipExpansion:!1,contextResolver:new re({sharedCache:nt})})).skipExpansion?Ke:yield ye.expand(Ke,je);const Ee=w(Le,je);if(je.format){if("application/n-quads"===je.format||"application/nquads"===je.format)return R.serialize(Ee);throw new b("Unknown output format.","jsonld.UnknownFormat",{format:je.format})}return Ee});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.createNodeMap=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");je=Ze(je,{base:K(Ke)?Ke:"",contextResolver:new re({sharedCache:nt})});const Le=yield ye.expand(Ke,je);return se(Le,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.merge=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!I(Ke))throw new TypeError('Could not merge, "docs" must be an array.');je="function"==typeof je?null:je||null,Le=Ze(Le,{contextResolver:new re({sharedCache:nt})});const Ee=yield Promise.all(Ke.map(ce=>{const Pe=ht({},Le);return ye.expand(ce,Pe)}));let Oe=!0;"mergeNodes"in Le&&(Oe=Le.mergeNodes);const Ue=Le.issuer||new $("_:b"),qe={"@default":{}};for(let ce=0;ceye._documentLoader,set:Je=>ye._documentLoader=Je}),ye.documentLoader=function(){var Je=gt(function*(Ke){throw new b("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Ke})});return function(Ke){return Je.apply(this,arguments)}}(),ye.get=function(){var Je=gt(function*(Ke,je){let Le;Le="function"==typeof je.documentLoader?je.documentLoader:ye.documentLoader;const Ee=yield Le(Ke);try{if(!Ee.document)throw new b("No remote document found at the given URL.","jsonld.NullRemoteDocument");K(Ee.document)&&(Ee.document=JSON.parse(Ee.document))}catch(Oe){throw new b("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Oe,remoteDoc:Ee})}return Ee});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.processContext=function(){var Je=gt(function*(Ke,je,Le){return Le=Ze(Le,{base:"",contextResolver:new re({sharedCache:nt})}),null===je?Q(Le):(je=L.clone(je),H(je)&&"@context"in je||(je={"@context":je}),E({activeCtx:Ke,localCtx:je,options:Le}))});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.getContextValue=Y("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(Je){if(!(Je in ye.documentLoaders))throw new b('Unknown document loader type: "'+Je+'"',"jsonld.UnknownDocumentLoader",{type:Je});ye.documentLoader=ye.documentLoaders[Je].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(Je,Ke){Me[Je]=Ke},ye.unregisterRDFParser=function(Je){delete Me[Je]},ye.registerRDFParser("application/n-quads",R.parse),ye.registerRDFParser("application/nquads",R.parse),ye.url=Y("./url"),ye.util=L,Object.assign(ye,L),ye.promises=ye,ye.RequestQueue=Y("./RequestQueue"),ye.JsonLdProcessor=Y("./JsonLdProcessor")(ye),V.setupGlobals(ye),V.setupDocumentLoaders(ye),ye},te=function(){return me(function(){return te()})};me(te),Ae.exports=te},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(Y,Ae,he){"use strict";const{isKeyword:W}=Y("./context"),V=Y("./graphTypes"),L=Y("./types"),re=Y("./util"),$=Y("./JsonLdError"),b={};Ae.exports=b,b.createMergedNodeMap=(S,R)=>{const A=(R=R||{}).issuer||new re.IdentifierIssuer("_:b"),v={"@default":{}};return b.createNodeMap(S,v,"@default",A),b.mergeNodeMaps(v)},b.createNodeMap=(S,R,A,v,y,w)=>{if(L.isArray(S)){for(const H of S)b.createNodeMap(H,R,A,v,void 0,w);return}if(!L.isObject(S))return void(w&&w.push(S));if(V.isValue(S)){if("@type"in S){let H=S["@type"];0===H.indexOf("_:")&&(S["@type"]=H=v.getId(H))}return void(w&&w.push(S))}if(w&&V.isList(S)){const H=[];return b.createNodeMap(S["@list"],R,A,v,y,H),void w.push({"@list":H})}if("@type"in S){const H=S["@type"];for(const K of H)0===K.indexOf("_:")&&v.getId(K)}L.isUndefined(y)&&(y=V.isBlankNode(S)?v.getId(S["@id"]):S["@id"]),w&&w.push({"@id":y});const D=R[A],j=D[y]=D[y]||{};j["@id"]=y;const I=Object.keys(S).sort();for(let H of I){if("@id"===H)continue;if("@reverse"===H){const M={"@id":y},F=S["@reverse"];for(const Q in F){const E=F[Q];for(const U of E){let ie=U["@id"];V.isBlankNode(U)&&(ie=v.getId(ie)),b.createNodeMap(U,R,A,v,ie),re.addValue(D[ie],Q,M,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===H){y in R||(R[y]={}),b.createNodeMap(S[H],R,y,v);continue}if("@included"===H){b.createNodeMap(S[H],R,A,v);continue}if("@type"!==H&&W(H)){if("@index"===H&&H in j&&(S[H]!==j[H]||S[H]["@id"]!==j[H]["@id"]))throw new $("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:j});j[H]=S[H];continue}const K=S[H];if(0===H.indexOf("_:")&&(H=v.getId(H)),0!==K.length)for(let M of K)if("@type"===H&&(M=0===M.indexOf("_:")?v.getId(M):M),V.isSubject(M)||V.isSubjectReference(M)){if("@id"in M&&!M["@id"])continue;const F=V.isBlankNode(M)?v.getId(M["@id"]):M["@id"];re.addValue(j,H,{"@id":F},{propertyIsArray:!0,allowDuplicate:!1}),b.createNodeMap(M,R,A,v,F)}else if(V.isValue(M))re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1});else if(V.isList(M)){const F=[];b.createNodeMap(M["@list"],R,A,v,y,F),M={"@list":F},re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1})}else b.createNodeMap(M,R,A,v,y),re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1});else re.addValue(j,H,[],{propertyIsArray:!0})}},b.mergeNodeMapGraphs=S=>{const R={};for(const A of Object.keys(S).sort())for(const v of Object.keys(S[A]).sort()){const y=S[A][v];v in R||(R[v]={"@id":v});const w=R[v];for(const D of Object.keys(y).sort())if(W(D)&&"@type"!==D)w[D]=re.clone(y[D]);else for(const j of y[D])re.addValue(w,D,re.clone(j),{propertyIsArray:!0,allowDuplicate:!1})}return R},b.mergeNodeMaps=S=>{const R=S["@default"],A=Object.keys(S).sort();for(const v of A){if("@default"===v)continue;const y=S[v];let w=R[v];w?"@graph"in w||(w["@graph"]=[]):R[v]=w={"@id":v,"@graph":[]};const D=w["@graph"];for(const j of Object.keys(y).sort()){const I=y[j];V.isSubjectReference(I)||D.push(I)}}return R}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Ae,he){"use strict";const W=Y("./documentLoaders/xhr"),V={};Ae.exports=V,V.setupDocumentLoaders=function(L){"undefined"!=typeof XMLHttpRequest&&(L.documentLoaders.xhr=W,L.useDocumentLoader("xhr"))},V.setupGlobals=function(L){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:L.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Ae,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:V}=Y("./context"),L=Y("./graphTypes"),re=Y("canonicalize"),$=Y("./types"),b=Y("./util"),{RDF_FIRST:S,RDF_REST:R,RDF_NIL:A,RDF_TYPE:v,RDF_JSON_LITERAL:y,RDF_LANGSTRING:w,XSD_BOOLEAN:D,XSD_DOUBLE:j,XSD_INTEGER:I,XSD_STRING:H}=Y("./constants"),{isAbsolute:K}=Y("./url"),M={};function F(U,ie,ue,ee,se){const Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me],ye=Object.keys(te).sort();for(let Me of ye){const Ve=te[Me];if("@type"===Me)Me=v;else if(V(Me))continue;for(const nt of Ve){const Ze={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!K(me))continue;const Je={termType:Me.startsWith("_:")?"BlankNode":"NamedNode",value:Me};if(!K(Me)||"BlankNode"===Je.termType&&!se.produceGeneralizedRdf)continue;const Ke=E(nt,ee,U,ue,se.rdfDirection);Ke&&U.push({subject:Ze,predicate:Je,object:Ke,graph:ue})}}}}function E(U,ie,ue,ee,se){const Te={};if(L.isValue(U)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=U["@value"];const te=U["@type"]||null;"@json"===te?(Te.value=re(me),Te.datatype.value=y):$.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=te||D):$.isDouble(me)||te===j?($.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=te||j):$.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=te||I):"i18n-datatype"===se&&"@direction"in U?(Te.datatype.value="https://www.w3.org/ns/i18n#"+(U["@language"]||"")+`_${U["@direction"]}`,Te.value=me):"@language"in U?(Te.value=me,Te.datatype.value=te||w,Te.language=U["@language"]):(Te.value=me,Te.datatype.value=te||H)}else if(L.isList(U)){const me=function(U,ie,ue,ee,se){const Te={termType:"NamedNode",value:S},me={termType:"NamedNode",value:R},te={termType:"NamedNode",value:A},ye=U.pop(),Me=ye?{termType:"BlankNode",value:ie.getId()}:te;let Ve=Me;for(const nt of U){const Ze=E(nt,ie,ue,ee,se),Je={termType:"BlankNode",value:ie.getId()};ue.push({subject:Ve,predicate:Te,object:Ze,graph:ee}),ue.push({subject:Ve,predicate:me,object:Je,graph:ee}),Ve=Je}if(ye){const nt=E(ye,ie,ue,ee,se);ue.push({subject:Ve,predicate:Te,object:nt,graph:ee}),ue.push({subject:Ve,predicate:me,object:te,graph:ee})}return Me}(U["@list"],ie,ue,ee,se);Te.termType=me.termType,Te.value=me.value}else{const me=$.isObject(U)?U["@id"]:U;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||K(Te.value)?Te:null}Ae.exports=M,M.toRDF=(U,ie)=>{const ue=new b.IdentifierIssuer("_:b"),ee={"@default":{}};W(U,ee,"@default",ue);const se=[],Te=Object.keys(ee).sort();for(const me of Te){let te;if("@default"===me)te={termType:"DefaultGraph",value:""};else{if(!K(me))continue;te=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},te.value=me}F(se,ee[me],te,ue,ie)}return se}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Ae,he){"use strict";const W={};Ae.exports=W,W.isArray=Array.isArray,W.isBoolean=V=>"boolean"==typeof V||"[object Boolean]"===Object.prototype.toString.call(V),W.isDouble=V=>W.isNumber(V)&&(-1!==String(V).indexOf(".")||Math.abs(V)>=1e21),W.isEmptyObject=V=>W.isObject(V)&&0===Object.keys(V).length,W.isNumber=V=>"number"==typeof V||"[object Number]"===Object.prototype.toString.call(V),W.isNumeric=V=>!isNaN(parseFloat(V))&&isFinite(V),W.isObject=V=>"[object Object]"===Object.prototype.toString.call(V),W.isString=V=>"string"==typeof V||"[object String]"===Object.prototype.toString.call(V),W.isUndefined=V=>void 0===V},{}],31:[function(Y,Ae,he){"use strict";const W=Y("./types"),V={};Ae.exports=V,V.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},V.parse=(re,$)=>{const b={},S=V.parsers[$||"full"],R=S.regex.exec(re);let A=S.keys.length;for(;A--;)b[S.keys[A]]=void 0===R[A]?null:R[A];return("https"===b.scheme&&"443"===b.port||"http"===b.scheme&&"80"===b.port)&&(b.href=b.href.replace(":"+b.port,""),b.authority=b.authority.replace(":"+b.port,""),b.port=null),b.normalizedPath=V.removeDotSegments(b.path),b},V.prependBase=(re,$)=>{if(null===re||V.isAbsolute($))return $;(!re||W.isString(re))&&(re=V.parse(re||""));const b=V.parse($),S={protocol:re.protocol||""};if(null!==b.authority)S.authority=b.authority,S.path=b.path,S.query=b.query;else if(S.authority=re.authority,""===b.path)S.path=re.path,S.query=null!==b.query?b.query:re.query;else{if(0===b.path.indexOf("/"))S.path=b.path;else{let A=re.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||re.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=b.path,S.path=A}S.query=b.query}""!==b.path&&(S.path=V.removeDotSegments(S.path));let R=S.protocol;return null!==S.authority&&(R+="//"+S.authority),R+=S.path,null!==S.query&&(R+="?"+S.query),null!==b.fragment&&(R+="#"+b.fragment),""===R&&(R="./"),R},V.removeBase=(re,$)=>{if(null===re)return $;(!re||W.isString(re))&&(re=V.parse(re||""));let b="";if(""!==re.href?b+=(re.protocol||"")+"//"+(re.authority||""):$.indexOf("//")&&(b+="//"),0!==$.indexOf(b))return $;const S=V.parse($.substr(b.length)),R=re.normalizedPath.split("/"),A=S.normalizedPath.split("/"),v=S.fragment||S.query?0:1;for(;R.length>0&&A.length>v&&R[0]===A[0];)R.shift(),A.shift();let y="";if(R.length>0){R.pop();for(let w=0;w{if(0===re.length)return"";const $=re.split("/"),b=[];for(;$.length>0;){const S=$.shift(),R=0===$.length;"."!==S?".."!==S?b.push(S):(b.pop(),R&&b.push("")):R&&b.push("")}return"/"===re[0]&&b.length>0&&""!==b[0]&&b.unshift(""),1===b.length&&""===b[0]?"/":b.join("/")};const L=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;V.isAbsolute=re=>W.isString(re)&&L.test(re),V.isRelative=re=>W.isString(re)},{"./types":30}],32:[function(Y,Ae,he){"use strict";const W=Y("./graphTypes"),V=Y("./types"),L=Y("rdf-canonize").IdentifierIssuer,re=Y("./JsonLdError"),$=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,b=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,S=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,R_headers={accept:"application/ld+json, application/json"},A={};function v(y,w){if(V.isArray(w))for(let D=0;D{if(Object.keys(y).some(D=>"accept"===D.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+R_headers.accept+'" is supported.');return Object.assign({Accept:R_headers.accept},y)},A.parseLinkHeader=y=>{const w={},D=y.match($);for(let j=0;j{if(!(V.isString(y)||V.isArray(y)&&y.every(D=>V.isString(D)))){if(w&&V.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&A.asArray(y["@default"]).every(D=>V.isString(D)))return}throw new re('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:y})}},A.hasProperty=(y,w)=>{if(y.hasOwnProperty(w)){const D=y[w];return!V.isArray(D)||D.length>0}return!1},A.hasValue=(y,w,D)=>{if(A.hasProperty(y,w)){let j=y[w];const I=W.isList(j);if(V.isArray(j)||I){I&&(j=j["@list"]);for(let H=0;H{if("propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1),"valueIsArray"in j||(j.valueIsArray=!1),"allowDuplicate"in j||(j.allowDuplicate=!0),"prependValue"in j||(j.prependValue=!1),j.valueIsArray)y[w]=D;else if(V.isArray(D)){0===D.length&&j.propertyIsArray&&!y.hasOwnProperty(w)&&(y[w]=[]),j.prependValue&&(D=D.concat(y[w]),y[w]=[]);for(let I=0;I[].concat(y[w]||[]),A.removeProperty=(y,w)=>{delete y[w]},A.removeValue=(y,w,D,j)=>{"propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1);const I=A.getValues(y,w).filter(H=>!A.compareValues(H,D));0===I.length?A.removeProperty(y,w):y[w]=1!==I.length||j.propertyIsArray?I:I[0]},A.relabelBlankNodes=(y,w)=>v((w=w||{}).issuer||new L("_:b"),y),A.compareValues=(y,w)=>!!(y===w||W.isValue(y)&&W.isValue(w)&&y["@value"]===w["@value"]&&y["@type"]===w["@type"]&&y["@language"]===w["@language"]&&y["@index"]===w["@index"])||!!(V.isObject(y)&&"@id"in y&&V.isObject(w)&&"@id"in w)&&y["@id"]===w["@id"],A.compareShortestLeast=(y,w)=>y.length1;const j=(Q,E,U)=>{const ie=Q[v].get(E);if(ie){const ue=ie.value;if(I(Q,ue)){if(K(Q,ie),!Q[$])return}else U&&(Q[y]&&(ie.value.now=Date.now()),Q[A].unshiftNode(ie));return ue.value}},I=(Q,E)=>{if(!E||!E.maxAge&&!Q[b])return!1;const U=Date.now()-E.now;return E.maxAge?U>E.maxAge:Q[b]&&U>Q[b]},H=Q=>{if(Q[L]>Q[V])for(let E=Q[A].tail;Q[L]>Q[V]&&null!==E;){const U=E.prev;K(Q,E),E=U}},K=(Q,E)=>{if(E){const U=E.value;Q[S]&&Q[S](U.key,U.value),Q[L]-=U.length,Q[v].delete(U.key),Q[A].removeNode(E)}};class M{constructor(E,U,ie,ue,ee){this.key=E,this.value=U,this.length=ie,this.now=ue,this.maxAge=ee||0}}const F=(Q,E,U,ie)=>{let ue=U.value;I(Q,ue)&&(K(Q,U),Q[$]||(ue=void 0)),ue&&E.call(ie,ue.value,ue.key,Q)};Ae.exports=class{constructor(E){if("number"==typeof E&&(E={max:E}),E||(E={}),E.max&&("number"!=typeof E.max||E.max<0))throw new TypeError("max must be a non-negative number");this[V]=E.max||1/0;const ie=E.length||w;if(this[re]="function"!=typeof ie?w:ie,this[$]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[b]=E.maxAge||0,this[S]=E.dispose,this[R]=E.noDisposeOnSet||!1,this[y]=E.updateAgeOnGet||!1,this.reset()}set max(E){if("number"!=typeof E||E<0)throw new TypeError("max must be a non-negative number");this[V]=E||1/0,H(this)}get max(){return this[V]}set allowStale(E){this[$]=!!E}get allowStale(){return this[$]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[b]=E,H(this)}get maxAge(){return this[b]}set lengthCalculator(E){"function"!=typeof E&&(E=w),E!==this[re]&&(this[re]=E,this[L]=0,this[A].forEach(U=>{U.length=this[re](U.value,U.key),this[L]+=U.length})),H(this)}get lengthCalculator(){return this[re]}get length(){return this[L]}get itemCount(){return this[A].length}rforEach(E,U){U=U||this;for(let ie=this[A].tail;null!==ie;){const ue=ie.prev;F(this,E,ie,U),ie=ue}}forEach(E,U){U=U||this;for(let ie=this[A].head;null!==ie;){const ue=ie.next;F(this,E,ie,U),ie=ue}}keys(){return this[A].toArray().map(E=>E.key)}values(){return this[A].toArray().map(E=>E.value)}reset(){this[S]&&this[A]&&this[A].length&&this[A].forEach(E=>this[S](E.key,E.value)),this[v]=new Map,this[A]=new W,this[L]=0}dump(){return this[A].map(E=>!I(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[A]}set(E,U,ie){if((ie=ie||this[b])&&"number"!=typeof ie)throw new TypeError("maxAge must be a number");const ue=ie?Date.now():0,ee=this[re](U,E);if(this[v].has(E)){if(ee>this[V])return K(this,this[v].get(E)),!1;const me=this[v].get(E).value;return this[S]&&(this[R]||this[S](E,me.value)),me.now=ue,me.maxAge=ie,me.value=U,this[L]+=ee-me.length,me.length=ee,this.get(E),H(this),!0}const se=new M(E,U,ee,ue,ie);return se.length>this[V]?(this[S]&&this[S](E,U),!1):(this[L]+=se.length,this[A].unshift(se),this[v].set(E,this[A].head),H(this),!0)}has(E){if(!this[v].has(E))return!1;const U=this[v].get(E).value;return!I(this,U)}get(E){return j(this,E,!0)}peek(E){return j(this,E,!1)}pop(){const E=this[A].tail;return E?(K(this,E),E.value):null}del(E){K(this,this[v].get(E))}load(E){this.reset();const U=Date.now();for(let ie=E.length-1;ie>=0;ie--){const ue=E[ie],ee=ue.e||0;if(0===ee)this.set(ue.k,ue.v);else{const se=ee-U;se>0&&this.set(ue.k,ue.v,se)}}}prune(){this[v].forEach((E,U)=>j(this,U,!1))}}},{yallist:92}],34:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${V}decimal`,boolean:`${V}boolean`,double:`${V}double`,integer:`${V}integer`,string:`${V}string`},rdf:{type:`${W}type`,nil:`${W}nil`,first:`${W}first`,rest:`${W}rest`,langString:`${W}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${L}reify#forSome`,forAll:`${L}reify#forAll`},log:{implies:`${L}log#implies`}}},{}],35:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.termFromId=function M(te,ye){if(ye=ye||v,!te)return ye.defaultGraph();switch(te[0]){case"?":return ye.variable(te.substr(1));case"_":return ye.blankNode(te.substr(2));case'"':if(ye===v)return new j(te);if('"'===te[te.length-1])return ye.literal(te.substr(1,te.length-2));const Me=te.lastIndexOf('"',te.length-1);return ye.literal(te.substr(1,Me-1),"@"===te[Me+1]?te.substr(Me+2):ye.namedNode(te.substr(Me+3)));case"<":const Ve=A.exec(te);return ye.quad(M(U(Ve[1]),ye),M(U(Ve[2]),ye),M(U(Ve[3]),ye),Ve[4]&&M(U(Ve[4]),ye));default:return ye.namedNode(te)}},he.termToId=function F(te){if("string"==typeof te)return te;if(te instanceof w&&"Quad"!==te.termType)return te.id;if(!te)return b.id;switch(te.termType){case"NamedNode":return te.value;case"BlankNode":return`_:${te.value}`;case"Variable":return`?${te.value}`;case"DefaultGraph":return"";case"Literal":return`"${te.value}"${te.language?`@${te.language}`:te.datatype&&te.datatype.value!==$.string?`^^${te.datatype.value}`:""}`;case"Quad":return`<<${E(F(te.subject))} ${E(F(te.predicate))} ${E(F(te.object))}${(0,V.isDefaultGraph)(te.graph)?"":` ${F(te.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${te.termType}`)}},he.escapeQuotes=E,he.unescapeQuotes=U,he.Triple=he.Quad=he.DefaultGraph=he.Variable=he.BlankNode=he.Literal=he.NamedNode=he.Term=he.default=void 0;var te,W=(te=Y("./IRIs"))&&te.__esModule?te:{default:te},V=Y("./N3Util");const{rdf:re,xsd:$}=W.default;let b,S=0;const R=/^"(.*".*)(?="[^"]*$)/,A=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,v={namedNode:function(te){return new D(te)},blankNode:function(te){return new I(te||"n3-"+S++)},variable:function(te){return new H(te)},literal:function(te,ye){if("string"==typeof ye)return new j(`"${te}"@${ye.toLowerCase()}`);let Me=ye?ye.value:"";return""===Me&&("boolean"==typeof te?Me=$.boolean:"number"==typeof te&&(Number.isFinite(te)?Me=Number.isInteger(te)?$.integer:$.double:(Me=$.double,Number.isNaN(te)||(te=te>0?"INF":"-INF")))),new j(""===Me||Me===$.string?`"${te}"`:`"${te}"^^${Me}`)},defaultGraph:function(){return b},quad:me,triple:me};he.default=v;class w{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof w?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=w;class D extends w{get termType(){return"NamedNode"}}he.NamedNode=D;class j extends w{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let Me=ye.lastIndexOf('"')+1;return Me`"${Me.replace(/"/g,'""')}`)}function U(te){return te.replace(R,(ye,Me)=>`"${Me.replace(/""/g,'"')}`)}function me(te,ye,Me,Ve){return new Q(te,ye,Me,Ve)}he.Triple=he.Quad=Q},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Ae,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var V=re(Y("./IRIs")),L=re(Y("queue-microtask"));function re(w){return w&&w.__esModule?w:{default:w}}const{xsd:$}=V.default,b=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,S={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},R=/[\x00-\x20<>\\"\{\}\|\^\`]/,A={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},v=/$0^/;he.default=class{constructor(D){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]*)?$/,this._lineMode=!!(D=D||{}).lineMode){this._n3Mode=!1;for(const j in this)!(j in A)&&this[j]instanceof RegExp&&(this[j]=v)}else this._n3Mode=!1!==D.n3;this._comments=!!D.comments,this._literalClosingPos=0}_tokenizeToEnd(D,j){let I=this._input;const H=this._comments;for(;;){let M,F;for(;M=this._newline.exec(I);)H&&(F=this._comment.exec(M[0]))&&D(null,{line:this._line,type:"comment",value:F[1],prefix:""}),I=I.substr(M[0].length,I.length),this._line++;if(!M&&(M=this._whitespace.exec(I))&&(I=I.substr(M[0].length,I.length)),this._endOfFile.test(I))return j&&(H&&(F=this._comment.exec(I))&&D(null,{line:this._line,type:"comment",value:F[1],prefix:""}),D(I=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=I;const Q=this._line,E=I[0];let U="",ie="",ue="",ee=null,se=0,Te=!1;switch(E){case"^":if(I.length<3)break;if("^"!==I[1]){this._n3Mode&&(se=1,U="^");break}if(this._previousMarker="^^",I=I.substr(2),"<"!==I[0]){Te=!0;break}case"<":if(ee=this._unescapedIri.exec(I))U="IRI",ie=ee[1];else if(ee=this._iri.exec(I)){if(ie=this._unescape(ee[1]),null===ie||R.test(ie))return K(this);U="IRI"}else I.length>1&&"<"===I[1]?(U="<<",se=2):this._n3Mode&&I.length>1&&"="===I[1]&&(U="inverse",se=2,ie=">");break;case">":I.length>1&&">"===I[1]&&(U=">>",se=2);break;case"_":((ee=this._blank.exec(I))||j&&(ee=this._blank.exec(`${I} `)))&&(U="blank",ue="_",ie=ee[1]);break;case'"':if(ee=this._simpleQuotedString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return K(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(ee=this._simpleApostropheString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return K(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(ee=this._variable.exec(I))&&(U="var",ie=ee[0]);break;case"@":"literal"===this._previousMarker&&(ee=this._langcode.exec(I))?(U="langcode",ie=ee[1]):(ee=this._keyword.exec(I))&&(U=ee[0]);break;case".":if(1===I.length?j:I[1]<"0"||I[1]>"9"){U=".",se=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(ee=this._number.exec(I)||j&&(ee=this._number.exec(`${I} `)))&&(U="literal",ie=ee[0],ue="string"==typeof ee[1]?$.double:"string"==typeof ee[2]?$.decimal:$.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(ee=this._sparqlKeyword.exec(I))?U=ee[0].toUpperCase():Te=!0;break;case"f":case"t":(ee=this._boolean.exec(I))?(U="literal",ie=ee[0],ue=$.boolean):Te=!0;break;case"a":(ee=this._shortPredicates.exec(I))?(U="abbreviation",ie="a"):Te=!0;break;case"=":this._n3Mode&&I.length>1&&(U="abbreviation",">"!==I[1]?(se=1,ie="="):(se=2,ie=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(se=1,U=E);break;default:Te=!0}if(Te&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(ee=this._prefix.exec(I))?((ee=this._prefixed.exec(I))||j&&(ee=this._prefixed.exec(`${I} `)))&&(U="prefixed",ue=ee[1]||"",ie=this._unescape(ee[2])):(U="prefix",ie=ee[1]||"")),"^^"===this._previousMarker)switch(U){case"prefixed":U="type";break;case"IRI":U="typeIRI";break;default:U=""}if(!U)return j||!/^'''|^"""/.test(I)&&/\n|\r/.test(I)?K(this):this._input=I;const me={line:Q,type:U,value:ie,prefix:ue};D(null,me),this.previousToken=me,this._previousMarker=U,I=I.substr(se||ee[0].length,I.length)}function K(M){D(M._syntaxError(/^\S*/.exec(I)[0]))}}_unescape(D){let j=!1;const I=D.replace(b,(H,K,M,F)=>{if("string"==typeof K)return String.fromCharCode(Number.parseInt(K,16));if("string"==typeof M){let Q=Number.parseInt(M,16);return Q<=65535?String.fromCharCode(Number.parseInt(M,16)):String.fromCharCode(55296+((Q-=65536)>>10),56320+(1023&Q))}return F in S?S[F]:(j=!0,"")});return j?null:I}_parseLiteral(D){if(D.length>=3){const j=D.match(/^(?:"""|"|'''|'|)/)[0],I=j.length;let H=Math.max(this._literalClosingPos,I);for(;(H=D.indexOf(j,H))>0;){let K=0;for(;"\\"===D[H-K-1];)K++;if(K%2==0){const M=D.substring(I,H),F=M.split(/\r\n|\r|\n/).length-1,Q=H+I;if(1===I&&0!==F||3===I&&this._lineMode)break;return this._line+=F,{value:this._unescape(M),matchLength:Q}}H++}this._literalClosingPos=D.length-I+1}return{value:"",matchLength:0}}_syntaxError(D){this._input=null;const j=new Error(`Unexpected "${D}" on line ${this._line}.`);return j.context={token:void 0,line:this._line,previousToken:this.previousToken},j}_readStartingBom(D){return D.startsWith("\ufeff")?D.substr(1):D}tokenize(D,j){if(this._line=1,"string"==typeof D){if(this._input=this._readStartingBom(D),"function"!=typeof j){const I=[];let H;if(this._tokenizeToEnd((K,M)=>K?H=K:I.push(M),!0),H)throw H;return I}(0,L.default)(()=>this._tokenizeToEnd(j,!0))}else this._pendingBuffer=null,"function"==typeof D.setEncoding&&D.setEncoding("utf8"),D.on("data",I=>{null!==this._input&&0!==I.length&&(this._pendingBuffer&&(I=W.concat([this._pendingBuffer,I]),this._pendingBuffer=null),128&I[I.length-1]?this._pendingBuffer=I:(void 0===this._input?this._input=this._readStartingBom("string"==typeof I?I:I.toString()):this._input+=I,this._tokenizeToEnd(j,!1)))}),D.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(j,!0)}),D.on("error",j)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=re(Y("./N3Lexer")),V=re(Y("./N3DataFactory")),L=re(Y("./IRIs"));function re(A){return A&&A.__esModule?A:{default:A}}let $=0;class b{constructor(v){this._contextStack=[],this._graph=null,this._setBase((v=v||{}).baseIRI),v.factory&&R(this,v.factory);const y="string"==typeof v.format?v.format.match(/\w*$/)[0].toLowerCase():"",w=/turtle/.test(y),D=/trig/.test(y),j=/triple/.test(y),I=/quad/.test(y),H=this._n3Mode=/n3/.test(y),K=j||I;(this._supportsNamedGraphs=!(w||H))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(w||D||j||H),this._supportsRDFStar=""===y||/star|\*$/.test(y),K&&(this._resolveRelativeIRI=M=>null),this._blankNodePrefix="string"!=typeof v.blankNodePrefix?"":v.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=v.lexer||new W.default({lineMode:K,n3:H}),this._explicitQuantifiers=!!v.explicitQuantifiers}static _resetBlankNodePrefix(){$=0}_setBase(v){if(v){const y=v.indexOf("#");y>=0&&(v=v.substr(0,y)),this._base=v,this._basePath=v.indexOf("/")<0?v:v.replace(/[^\/?]*(?:\?.*)?$/,""),v=v.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=v[0],this._baseScheme=v[1]}else this._base="",this._basePath=""}_saveContext(v,y,w,D,j){const I=this._n3Mode;this._contextStack.push({subject:w,predicate:D,object:j,graph:y,type:v,inverse:!!I&&this._inversePredicate,blankPrefix:I?this._prefixes._:"",quantified:I?this._quantified:null}),I&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const v=this._contextStack.pop(),y=this._n3Mode;this._subject=v.subject,this._predicate=v.predicate,this._object=v.object,this._graph=v.graph,y&&(this._inversePredicate=v.inverse,this._prefixes._=v.blankPrefix,this._quantified=v.quantified)}_readInTopContext(v){switch(v.type){case"eof":return null!==this._graph?this._error("Unclosed graph",v):(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(v)}}_readEntity(v,y){let w;switch(v.type){case"IRI":case"typeIRI":const D=this._resolveIRI(v.value);if(null===D)return this._error("Invalid IRI",v);w=this._namedNode(D);break;case"type":case"prefixed":const j=this._prefixes[v.prefix];if(void 0===j)return this._error(`Undefined prefix "${v.prefix}:"`,v);w=this._namedNode(j+v.value);break;case"blank":w=this._blankNode(this._prefixes[v.prefix]+v.value);break;case"var":w=this._variable(v.value.substr(1));break;default:return this._error(`Expected entity but got ${v.type}`,v)}return!y&&this._n3Mode&&w.id in this._quantified&&(w=this._quantified[w.id]),w}_readSubject(v){switch(this._predicate=null,v.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",v);case"}":return this._readPunctuation(v);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',v);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',v);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",v);if(0===v.prefix.length)return this._literalValue=v.value,this._completeSubjectLiteral;this._subject=this._literal(v.value,this._namedNode(v.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._subject=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(v){const y=v.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[v.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,v):(this._subject=null,"]"===y?this._readBlankNodeTail(v):this._readPunctuation(v));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",v);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",v);default:if(void 0===(this._predicate=this._readEntity(v)))return}return this._readObject}_readObject(v){switch(v.type){case"literal":if(0===v.prefix.length)return this._literalValue=v.value,this._readDataTypeOrLang;this._object=this._literal(v.value,this._namedNode(v.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._object=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(v){return"{"===v.type?this._readGraph(v):this._readPredicate(v)}_readGraph(v){return"{"!==v.type?this._error(`Expected graph but got ${v.type}`,v):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(v){return"]"===v.type?(this._subject=null,this._readBlankNodeTail(v)):(this._predicate=null,this._readPredicate(v))}_readBlankNodeTail(v){if("]"!==v.type)return this._readBlankNodePunctuation(v);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null===this._object?y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(v){switch(v.type){case".":case"}":return this._subject=null,this._readPunctuation(v);default:return this._readPredicate(v)}}_readListItem(v){let y=null,w=null,D=this._readListItem;const j=this._subject,I=this._contextStack,H=I[I.length-1];switch(v.type){case"[":this._saveContext("blank",this._graph,w=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),D=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,w=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==I.length&&"list"===I[I.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(D=this._readPredicate,this._subject===this.RDF_NIL)return D}else if(D=this._getContextEndReader(),this._object===this.RDF_NIL)return D;w=this.RDF_NIL;break;case"literal":0===v.prefix.length?(this._literalValue=v.value,D=this._readListItemDataTypeOrLang):(y=this._literal(v.value,this._namedNode(v.prefix)),D=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);default:if(void 0===(y=this._readEntity(v)))return}if(null===w&&(this._subject=w=this._blankNode()),null===j?null===H.predicate?H.subject=w:H.object=w:this._emit(j,this.RDF_REST,w,this._graph),null!==y){if(this._n3Mode&&("IRI"===v.type||"prefixed"===v.type))return this._saveContext("item",this._graph,w,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(w,this.RDF_FIRST,y,this._graph)}return D}_readDataTypeOrLang(v){return this._completeObjectLiteral(v,!1)}_readListItemDataTypeOrLang(v){return this._completeObjectLiteral(v,!0)}_completeLiteral(v){let y=this._literal(this._literalValue);switch(v.type){case"type":case"typeIRI":const w=this._readEntity(v);if(void 0===w)return;y=this._literal(this._literalValue,w),v=null;break;case"langcode":y=this._literal(this._literalValue,v.value),v=null}return{token:v,literal:y}}_completeSubjectLiteral(v){return this._subject=this._completeLiteral(v).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(v,y){const w=this._completeLiteral(v);if(w)return this._object=w.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===w.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(w.token))}_readFormulaTail(v){return"}"!==v.type?this._readPunctuation(v):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(v){let y,w=this._graph;const D=this._subject,j=this._inversePredicate;switch(v.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",v);if(this._n3Mode)return this._readFormulaTail(v);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,j&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(w=this._readEntity(v))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}if(null!==D){const I=this._predicate,H=this._object;j?this._emit(H,I,D,w):this._emit(D,I,H,w)}return y}_readBlankNodePunctuation(v){let y;switch(v.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(v){return"."!==v.type?this._error("Expected dot to follow quad",v):this._readInTopContext}_readPrefix(v){return"prefix"!==v.type?this._error("Expected prefix to follow @prefix",v):(this._prefix=v.value,this._readPrefixIRI)}_readPrefixIRI(v){if("IRI"!==v.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,v);const y=this._readEntity(v);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(v){const y="IRI"===v.type&&this._resolveIRI(v.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",v)}_readNamedGraphLabel(v){switch(v.type){case"IRI":case"blank":case"prefixed":return this._readSubject(v),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",v)}}_readNamedGraphBlankLabel(v){return"]"!==v.type?this._error("Invalid graph label",v):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(v){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(v)):"."!==v.type?this._error("Expected declaration to end with a dot",v):this._readInTopContext}_readQuantifierList(v){let y;switch(v.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(v,!0)))break;default:return this._error(`Unexpected ${v.type}`,v)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,y,this.QUANTIFIERS_GRAPH)):this._quantified[y.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(v){return","===v.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(v))}_getPathReader(v){return this._afterPath=v,this._readPath}_readPath(v){switch(v.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,w=y.length&&y[y.length-1];if(w&&"item"===w.type){const D=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,D,this._graph)}return this._afterPath(v)}}_readForwardPath(v){let y,w;const D=this._blankNode();if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(y=this._subject,this._subject=D):(y=this._object,this._object=D),this._emit(y,w,D,this._graph),this._readPath}_readBackwardPath(v){const y=this._blankNode();let w,D;if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(D=this._subject,this._subject=y):(D=this._object,this._object=y),this._emit(y,w,D,this._graph),this._readPath}_readRDFStarTailOrGraph(v){return">>"!==v.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(v))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,v):this._readRDFStarTail(v)}_readRDFStarTail(v){if(">>"!==v.type)return this._error(`Expected >> but got ${v.type}`,v);const y=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=y,this._readPredicate):(this._object=y,this._getContextEndReader())}_getContextEndReader(){const v=this._contextStack;if(!v.length)return this._readPunctuation;switch(v[v.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(v,y,w,D){this._callback(null,this._quad(v,y,w,D||this.DEFAULTGRAPH))}_error(v,y){const w=new Error(`${v} on line ${y.line}.`);w.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(w),this._callback=S}_resolveIRI(v){return/^[a-z][a-z0-9+.-]*:/i.test(v)?v:this._resolveRelativeIRI(v)}_resolveRelativeIRI(v){if(!v.length)return this._base;switch(v[0]){case"#":return this._base+v;case"?":return this._base.replace(/(?:\?.*)?$/,v);case"/":return("/"===v[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(v);default:return/^[^/:]*:/.test(v)?null:this._removeDotSegments(this._basePath+v)}}_removeDotSegments(v){if(!/(^|\/)\.\.?($|[/#?])/.test(v))return v;const y=v.length;let w="",D=-1,j=-1,I=0,H="/";for(;D=j&&(w=w.substr(0,I)),"/"!==H)return`${w}/${v.substr(D+1)}`;I=D+1}}}H=v[++D]}return w+v.substring(I)}parse(v,y,w){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${$++}_`,this._prefixCallback=w||S,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const D=[];let j;if(this._callback=(I,H)=>{I?j=I:H&&D.push(H)},this._lexer.tokenize(v).every(I=>this._readCallback=this._readCallback(I)),j)throw j;return D}this._callback=y,this._lexer.tokenize(v,(D,j)=>{null!==D?(this._callback(D),this._callback=S):this._readCallback&&(this._readCallback=this._readCallback(j))})}}function S(){}function R(A,v){const y=v.namedNode;A._namedNode=y,A._blankNode=v.blankNode,A._literal=v.literal,A._variable=v.variable,A._quad=v.quad,A.DEFAULTGRAPH=v.defaultGraph(),A.RDF_FIRST=y(L.default.rdf.first),A.RDF_REST=y(L.default.rdf.rest),A.RDF_NIL=y(L.default.rdf.nil),A.N3_FORALL=y(L.default.r.forAll),A.N3_FORSOME=y(L.default.r.forSome),A.ABBREVIATIONS={a:y(L.default.rdf.type),"=":y(L.default.owl.sameAs),">":y(L.default.log.implies)},A.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=b,R(b.prototype,V.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var v,W=function(v,y){if(!y&&v&&v.__esModule)return v;if(null===v||"object"!=typeof v&&"function"!=typeof v)return{default:v};var w=$(y);if(w&&w.has(v))return w.get(v);var D={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in v)if("default"!==I&&Object.prototype.hasOwnProperty.call(v,I)){var H=j?Object.getOwnPropertyDescriptor(v,I):null;H&&(H.get||H.set)?Object.defineProperty(D,I,H):D[I]=v[I]}return D.default=v,w&&w.set(v,D),D}(Y("./N3DataFactory")),V=Y("readable-stream"),L=(v=Y("./IRIs"))&&v.__esModule?v:{default:v};function $(v){if("function"!=typeof WeakMap)return null;var y=new WeakMap,w=new WeakMap;return($=function(D){return D?w:y})(v)}class S{constructor(y,w){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!w&&y&&!y[0]&&(w=y,y=null),this._factory=(w=w||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const w=this._graphs;let D,j;for(const I in w)for(const H in D=w[I].subjects)for(const K in j=D[H])y+=Object.keys(j[K]).length;return this._size=y}_addToIndex(y,w,D,j){const I=y[w]||(y[w]={}),H=I[D]||(I[D]={}),K=j in H;return K||(H[j]=null),!K}_removeFromIndex(y,w,D,j){const I=y[w],H=I[D];delete H[j];for(const K in H)return;delete I[D];for(const K in I)return;delete y[w]}_findInIndex(y,w,D,j,I,H,K,M,F,Q){let E,U,ie;const ee=!w+!D+!j>1?Object.keys(this._ids):this._entities;w&&((E=y,y={})[w]=E[w]);for(const se in y){const Te=ee[se];if(U=y[se]){D&&((E=U,U={})[D]=E[D]);for(const me in U){const te=ee[me];if(ie=U[me]){const ye=j?j in ie?[j]:[]:Object.keys(ie);for(let Me=0;Me{D in w||(w[D]=!0,y((0,W.termFromId)(this._entities[D],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,w,D,j){w||(j=y.graph,D=y.object,w=y.predicate,y=y.subject),y=(0,W.termToId)(y),w=(0,W.termToId)(w),D=(0,W.termToId)(D),j=(0,W.termToId)(j);let I=this._graphs[j];I||(I=this._graphs[j]={subjects:{},predicates:{},objects:{}},Object.freeze(I));const H=this._ids,K=this._entities;y=H[y]||(H[K[++this._id]=y]=this._id),w=H[w]||(H[K[++this._id]=w]=this._id),D=H[D]||(H[K[++this._id]=D]=this._id);const M=this._addToIndex(I.subjects,y,w,D);return this._addToIndex(I.predicates,w,D,y),this._addToIndex(I.objects,D,y,w),this._size=null,M}addQuads(y){for(let w=0;w{this.addQuad(w)}),y}removeQuad(y,w,D,j){w||(j=y.graph,D=y.object,w=y.predicate,y=y.subject),y=(0,W.termToId)(y),w=(0,W.termToId)(w),D=(0,W.termToId)(D),j=(0,W.termToId)(j);const I=this._ids,H=this._graphs;let K,M,F;if(!((y=I[y])&&(w=I[w])&&(D=I[D])&&(K=H[j])&&(M=K.subjects[y])&&(F=M[w])&&D in F))return!1;for(y in this._removeFromIndex(K.subjects,y,w,D),this._removeFromIndex(K.predicates,w,D,y),this._removeFromIndex(K.objects,D,y,w),null!==this._size&&this._size--,K.subjects)return!0;return delete H[j],!0}removeQuads(y){for(let w=0;w{this.removeQuad(w)}),y}removeMatches(y,w,D,j){const I=new V.Readable({objectMode:!0});return I._read=()=>{for(const H of this.getQuads(y,w,D,j))I.push(H);I.push(null)},this.remove(I)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,w,D,j){y=y&&(0,W.termToId)(y),w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=[],H=this._getGraphs(j),K=this._ids;let M,F,Q,E;if(R(y)&&!(F=K[y])||R(w)&&!(Q=K[w])||R(D)&&!(E=K[D]))return I;for(const U in H)(M=H[U])&&(F?E?this._findInIndex(M.objects,E,F,Q,"object","subject","predicate",U,null,I):this._findInIndex(M.subjects,F,Q,null,"subject","predicate","object",U,null,I):Q?this._findInIndex(M.predicates,Q,E,null,"predicate","object","subject",U,null,I):E?this._findInIndex(M.objects,E,null,null,"object","subject","predicate",U,null,I):this._findInIndex(M.subjects,null,null,null,"subject","predicate","object",U,null,I));return I}match(y,w,D,j){return new A(this,y,w,D,j)}countQuads(y,w,D,j){y=y&&(0,W.termToId)(y),w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._getGraphs(j),H=this._ids;let M,F,Q,E,K=0;if(R(y)&&!(F=H[y])||R(w)&&!(Q=H[w])||R(D)&&!(E=H[D]))return 0;for(const U in I)(M=I[U])&&(K+=y?D?this._countInIndex(M.objects,E,F,Q):this._countInIndex(M.subjects,F,Q,E):w?this._countInIndex(M.predicates,Q,E,F):this._countInIndex(M.objects,E,F,Q));return K}forEach(y,w,D,j,I){this.some(H=>(y(H),!1),w,D,j,I)}every(y,w,D,j,I){let H=!1;const K=!this.some(M=>(H=!0,!y(M)),w,D,j,I);return H&&K}some(y,w,D,j,I){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j),I=I&&(0,W.termToId)(I);const H=this._getGraphs(I),K=this._ids;let M,F,Q,E;if(R(w)&&!(F=K[w])||R(D)&&!(Q=K[D])||R(j)&&!(E=K[j]))return!1;for(const U in H)if(M=H[U])if(F){if(E){if(this._findInIndex(M.objects,E,F,Q,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(M.subjects,F,Q,null,"subject","predicate","object",U,y,null))return!0}else if(Q){if(this._findInIndex(M.predicates,Q,E,null,"predicate","object","subject",U,y,null))return!0}else if(E){if(this._findInIndex(M.objects,E,null,null,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(M.subjects,null,null,null,"subject","predicate","object",U,y,null))return!0;return!1}getSubjects(y,w,D){const j=[];return this.forSubjects(I=>{j.push(I)},y,w,D),j}forSubjects(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.predicates,M,F,y):this._loopByKey1(K.subjects,M,y):F?this._loopByKey0(K.objects,F,y):this._loop(K.subjects,y))}getPredicates(y,w,D){const j=[];return this.forPredicates(I=>{j.push(I)},y,w,D),j}forPredicates(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.objects,F,M,y):this._loopByKey0(K.subjects,M,y):F?this._loopByKey1(K.predicates,F,y):this._loop(K.predicates,y))}getObjects(y,w,D){const j=[];return this.forObjects(I=>{j.push(I)},y,w,D),j}forObjects(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.subjects,M,F,y):this._loopByKey1(K.objects,M,y):F?this._loopByKey0(K.predicates,F,y):this._loop(K.objects,y))}getGraphs(y,w,D){const j=[];return this.forGraphs(I=>{j.push(I)},y,w,D),j}forGraphs(y,w,D,j){for(const I in this._graphs)this.some(H=>(y(H.graph),!0),w,D,j,I)}createBlankNode(y){let w,D;if(y)for(w=y=`_:${y}`,D=1;this._ids[w];)w=y+D++;else do{w="_:b"+this._blankNodeIndex++}while(this._ids[w]);return this._ids[w]=++this._id,this._entities[this._id]=w,this._factory.blankNode(w.substr(2))}extractLists({remove:y=!1,ignoreErrors:w=!1}={}){const D={},j=w?()=>!0:(K,M)=>{throw new Error(`${K.value} ${M}`)},I=this.getQuads(null,L.default.rdf.rest,L.default.rdf.nil,null),H=y?[...I]:[];return I.forEach(K=>{const M=[];let Q,E,F=!1;const U=K.graph;let ie=K.subject;for(;ie&&!F;){const ue=this.getQuads(null,null,ie,null),ee=this.getQuads(ie,null,null,null);let se,Te=null,me=null,te=null;for(let ye=0;ye{switch(v){case"data":R=y;break;case"end":A=y}}},(v,y)=>{v&&this.emit("error",v)||y&&this.push(y)},(v,y)=>{this.emit("prefix",v,y)}),this._transform=(v,y,w)=>{R(v),w()},this._flush=v=>{A(),v()}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var $,W=Y("readable-stream"),V=($=Y("./N3Writer"))&&$.__esModule?$:{default:$};he.default=class extends W.Transform{constructor(b){super({encoding:"utf8",writableObjectMode:!0});const S=this._writer=new V.default({write:(R,A,v)=>{this.push(R),v&&v()},end:R=>{this.push(null),R&&R()}},b);this._transform=(R,A,v)=>{S.addQuad(R,v)},this._flush=R=>{S.end(R)}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),b.on("prefix",(S,R)=>{this._writer.addPrefix(S,R)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.isDefaultGraph=S,he.inDefaultGraph=function(y){return S(y.graph)},he.prefix=function(y,w){return v({"":y},w)("")},he.prefixes=v;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function S(y){return!!y&&"DefaultGraph"===y.termType}function v(y,w){const D=Object.create(null);for(const I in y)j(I,y[I]);function j(I,H){if("string"==typeof H){const K=Object.create(null);D[I]=M=>K[M]||(K[M]=w.namedNode(H+M))}else if(!(I in D))throw new Error(`Unknown prefix: ${I}`);return D[I]}return w=w||W.default,j}},{"./N3DataFactory":35}],42:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,W=(H=Y("./IRIs"))&&H.__esModule?H:{default:H},V=function(H,K){if(!K&&H&&H.__esModule)return H;if(null===H||"object"!=typeof H&&"function"!=typeof H)return{default:H};var M=re(K);if(M&&M.has(H))return M.get(H);var F={},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in H)if("default"!==E&&Object.prototype.hasOwnProperty.call(H,E)){var U=Q?Object.getOwnPropertyDescriptor(H,E):null;U&&(U.get||U.set)?Object.defineProperty(F,E,U):F[E]=H[E]}return F.default=H,M&&M.set(H,F),F}(Y("./N3DataFactory")),L=Y("./N3Util");function re(H){if("function"!=typeof WeakMap)return null;var K=new WeakMap,M=new WeakMap;return(re=function(F){return F?M:K})(H)}const S=V.default.defaultGraph(),{rdf:R,xsd:A}=W.default,v=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,w={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class D extends V.Term{equals(){return!1}}function I(H){let K=w[H];return void 0===K&&(1===H.length?(K=H.charCodeAt(0).toString(16),K="\\u0000".substr(0,6-K.length)+K):(K=(1024*(H.charCodeAt(0)-55296)+H.charCodeAt(1)+9216).toString(16),K="\\U00000000".substr(0,10-K.length)+K)),K}he.default=class{constructor(K,M){if(this._prefixRegex=/$0^/,K&&"function"!=typeof K.write&&(M=K,K=null),this._lists=(M=M||{}).lists,K)this._outputStream=K,this._endStream=void 0===M.end||!!M.end;else{let F="";this._outputStream={write(Q,E,U){F+=Q,U&&U()},end:Q=>{Q&&Q(null,F)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(M.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=S,this._baseIRI=M.baseIRI,this._prefixIRIs=Object.create(null),M.prefixes&&this.addPrefixes(M.prefixes))}get _inDefaultGraph(){return S.equals(this._graph)}_write(K,M){this._outputStream.write(K,"utf8",M)}_writeQuad(K,M,F,Q,E){try{Q.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(S.equals(Q)?"":`${this._encodeIriOrBlank(Q)} {\n`)),this._graph=Q,this._subject=null),K.equals(this._subject)?M.equals(this._predicate)?this._write(`, ${this._encodeObject(F)}`,E):this._write(`;\n ${this._encodePredicate(this._predicate=M)} ${this._encodeObject(F)}`,E):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=K)} ${this._encodePredicate(this._predicate=M)} ${this._encodeObject(F)}`,E)}catch(U){E&&E(U)}}_writeQuadLine(K,M,F,Q,E){delete this._prefixMatch,this._write(this.quadToString(K,M,F,Q),E)}quadToString(K,M,F,Q){return`${this._encodeSubject(K)} ${this._encodeIriOrBlank(M)} ${this._encodeObject(F)}${Q&&Q.value?` ${this._encodeIriOrBlank(Q)} .\n`:" .\n"}`}quadsToString(K){return K.map(M=>this.quadToString(M.subject,M.predicate,M.object,M.graph)).join("")}_encodeSubject(K){return"Quad"===K.termType?this._encodeQuad(K):this._encodeIriOrBlank(K)}_encodeIriOrBlank(K){if("NamedNode"!==K.termType)return this._lists&&K.value in this._lists&&(K=this.list(this._lists[K.value])),"id"in K?K.id:`_:${K.value}`;let M=K.value;this._baseIRI&&M.startsWith(this._baseIRI)&&(M=M.substr(this._baseIRI.length)),v.test(M)&&(M=M.replace(y,I));const F=this._prefixRegex.exec(M);return F?F[1]?this._prefixIRIs[F[1]]+F[2]:M:`<${M}>`}_encodeLiteral(K){let M=K.value;if(v.test(M)&&(M=M.replace(y,I)),K.language)return`"${M}"@${K.language}`;if(this._lineMode){if(K.datatype.value===A.string)return`"${M}"`}else switch(K.datatype.value){case A.string:return`"${M}"`;case A.boolean:if("true"===M||"false"===M)return M;break;case A.integer:if(/^[+-]?\d+$/.test(M))return M;break;case A.decimal:if(/^[+-]?\d*\.\d+$/.test(M))return M;break;case A.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(M))return M}return`"${M}"^^${this._encodeIriOrBlank(K.datatype)}`}_encodePredicate(K){return K.value===R.type?"a":this._encodeIriOrBlank(K)}_encodeObject(K){switch(K.termType){case"Quad":return this._encodeQuad(K);case"Literal":return this._encodeLiteral(K);default:return this._encodeIriOrBlank(K)}}_encodeQuad({subject:K,predicate:M,object:F,graph:Q}){return`<<${this._encodeSubject(K)} ${this._encodePredicate(M)} ${this._encodeObject(F)}${(0,L.isDefaultGraph)(Q)?"":` ${this._encodeIriOrBlank(Q)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(K,M,F,Q,E){void 0===F?this._writeQuad(K.subject,K.predicate,K.object,K.graph,M):"function"==typeof Q?this._writeQuad(K,M,F,S,Q):this._writeQuad(K,M,F,Q||S,E)}addQuads(K){for(let M=0;M.\n`)}if(F){let Q="",E="";for(const U in this._prefixIRIs)Q+=Q?`|${U}`:U,E+=(E?"|":"")+this._prefixIRIs[U];Q=Q.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${E})[^/]*$|^(${Q})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(F?"\n":"",M)}blank(K,M){let Q,E,F=K;switch(void 0===K?F=[]:K.termType?F=[{predicate:K,object:M}]:"length"in K||(F=[K]),E=F.length){case 0:return new D("[]");case 1:if(Q=F[0],!(Q.object instanceof D))return new D(`[ ${this._encodePredicate(Q.predicate)} ${this._encodeObject(Q.object)} ]`);default:let U="[";for(let ie=0;ie{M=null,K(F,Q)});if(this._endStream)try{return this._outputStream.end(M)}catch(F){}M&&M()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return R.Term}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return R.NamedNode}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return R.Literal}}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return R.BlankNode}}),Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return R.Variable}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return R.DefaultGraph}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return R.Quad}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return R.Triple}}),Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return R.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return R.termToId}}),he.Util=void 0;var W=y(Y("./N3Lexer")),V=y(Y("./N3Parser")),L=y(Y("./N3Writer")),re=y(Y("./N3Store")),$=y(Y("./N3StreamParser")),b=y(Y("./N3StreamWriter")),S=v(Y("./N3Util"));he.Util=S;var R=v(Y("./N3DataFactory"));function A(w){if("function"!=typeof WeakMap)return null;var D=new WeakMap,j=new WeakMap;return(A=function(I){return I?j:D})(w)}function v(w,D){if(!D&&w&&w.__esModule)return w;if(null===w||"object"!=typeof w&&"function"!=typeof w)return{default:w};var j=A(D);if(j&&j.has(w))return j.get(w);var I={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var K in w)if("default"!==K&&Object.prototype.hasOwnProperty.call(w,K)){var M=H?Object.getOwnPropertyDescriptor(w,K):null;M&&(M.get||M.set)?Object.defineProperty(I,K,M):I[K]=w[K]}return I.default=w,j&&j.set(w,I),I}function y(w){return w&&w.__esModule?w:{default:w}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Ae,he){var V,L,W=Ae.exports={};function re(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function b(H){if(V===setTimeout)return setTimeout(H,0);if((V===re||!V)&&setTimeout)return V=setTimeout,setTimeout(H,0);try{return V(H,0)}catch(K){try{return V.call(null,H,0)}catch(M){return V.call(this,H,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:re}catch(H){V=re}try{L="function"==typeof clearTimeout?clearTimeout:$}catch(H){L=$}}();var v,R=[],A=!1,y=-1;function w(){!A||!v||(A=!1,v.length?R=v.concat(R):y=-1,R.length&&D())}function D(){if(!A){var H=b(w);A=!0;for(var K=R.length;K;){for(v=R,R=[];++y1)for(var M=1;M(V||(V=Promise.resolve())).then(L).catch(re=>setTimeout(()=>{throw re},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Ae,he){Ae.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Ae,he){"use strict";Ae.exports=class vW{constructor(V,L=new Map,re=0){this.prefix=V,this._existing=L,this.counter=re}clone(){const{prefix:V,_existing:L,counter:re}=this;return new vW(V,new Map(L),re)}getId(V){const L=V&&this._existing.get(V);if(L)return L;const re=this.prefix+this.counter;return this.counter++,V&&this._existing.set(V,re),re}hasId(V){return this._existing.has(V)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Ae,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Ae.exports=class{constructor(L){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===L)this.algorithm={name:"SHA-256"};else{if("sha1"!==L)throw new Error(`Unsupport algorithm "${L}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(L){this._content+=L}digest(){var L=this;return gt(function*(){const re=(new TextEncoder).encode(L._content),$=new Uint8Array(yield W.subtle.digest(L.algorithm,re));let b="";for(let S=0;S<$.length;++S)b+=$[S].toString(16).padStart(2,"0");return b})()}}},{setimmediate:86}],49:[function(Y,Ae,he){"use strict";const L="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",re="http://www.w3.org/2001/XMLSchema#string",$="NamedNode",b="BlankNode",S="Literal",R="DefaultGraph",A={};function v(I,H){return I.subject.termType===H.subject.termType&&I.object.termType===H.object.termType&&I.subject.value===H.subject.value&&I.predicate.value===H.predicate.value&&I.object.value===H.object.value&&(I.object.termType!==S||I.object.datatype.termType===H.object.datatype.termType&&I.object.language===H.object.language&&I.object.datatype.value===H.object.datatype.value)}A.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,A.empty=new RegExp("^[ \\t]*$"),A.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),Ae.exports=class pP{static parse(H){const K=[],M={},F=H.split(A.eoln);let Q=0;for(const E of F){if(Q++,A.empty.test(E))continue;const U=E.match(A.quad);if(null===U)throw new Error("N-Quads parse error on line "+Q+".");const ie={subject:null,predicate:null,object:null,graph:null};if(ie.subject=void 0!==U[1]?{termType:$,value:U[1]}:{termType:b,value:U[2]},ie.predicate={termType:$,value:U[3]},void 0!==U[4]?ie.object={termType:$,value:U[4]}:void 0!==U[5]?ie.object={termType:b,value:U[5]}:(ie.object={termType:S,value:void 0,datatype:{termType:$}},void 0!==U[7]?ie.object.datatype.value=U[7]:void 0!==U[8]?(ie.object.datatype.value=L,ie.object.language=U[8]):ie.object.datatype.value=re,ie.object.value=U[6].replace(D,function(H,K,M,F){if(K)switch(K){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(M)return String.fromCharCode(parseInt(M,16));if(F)throw new Error("Unsupported U escape")})),ie.graph=void 0!==U[9]?{termType:$,value:U[9]}:void 0!==U[10]?{termType:b,value:U[10]}:{termType:R,value:""},ie.graph.value in M){let ue=!0;const ee=M[ie.graph.value];for(const se of ee)if(v(se,ie)){ue=!1;break}ue&&(ee.push(ie),K.push(ie))}else M[ie.graph.value]=[ie],K.push(ie)}return K}static serialize(H){Array.isArray(H)||(H=pP.legacyDatasetToQuads(H));const K=[];for(const M of H)K.push(pP.serializeQuad(M));return K.sort().join("")}static serializeQuad(H){const K=H.subject,F=H.object,Q=H.graph;let E="";return E+=K.termType===$?`<${K.value}>`:`${K.value}`,E+=` <${H.predicate.value}> `,F.termType===$?E+=`<${F.value}>`:F.termType===b?E+=F.value:(E+=`"${I=F.value,I.replace(y,function(H){switch(H){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,F.datatype.value===L?F.language&&(E+=`@${F.language}`):F.datatype.value!==re&&(E+=`^^<${F.datatype.value}>`)),Q.termType===$?E+=` <${Q.value}>`:Q.termType===b&&(E+=` ${Q.value}`),E+=" .\n",E;var I}static legacyDatasetToQuads(H){const K=[],M={"blank node":b,IRI:$,literal:S};for(const F in H)H[F].forEach(E=>{const U={};for(const ie in E){const ue=E[ie],ee={termType:M[ue.type],value:ue.value};ee.termType===S&&(ee.datatype={termType:$},"datatype"in ue&&(ee.datatype.value=ue.datatype),"language"in ue?("datatype"in ue||(ee.datatype.value=L),ee.language=ue.language):"datatype"in ue||(ee.datatype.value=re)),U[ie]=ee}U.graph="@default"===F?{termType:R,value:""}:{termType:F.startsWith("_:")?b:$,value:F},K.push(U)});return K}};const y=/["\\\n\r]/g;const D=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Ae,he){"use strict";Ae.exports=class{constructor(V){this.current=V.sort(),this.done=!1,this.dir=new Map;for(let L=0;L$)&&(v&&R>0&&A>V[R-1]||!v&&RV[R+1])&&($=A,b=R)}if(null===$)this.done=!0;else{const R=L.get($)?b-1:b+1;V[b]=V[R],V[R]=$;for(const A of V)A>$&&L.set(A,!L.get(A))}return re}}},{}],51:[function(Y,Ae,he){(function(W){(function(){"use strict";const V=Y("./IdentifierIssuer"),L=Y("./MessageDigest"),re=Y("./Permuter"),$=Y("./NQuads");function b(S,R){return S.hashR.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new V("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(R){var A=this;return gt(function*(){A.quads=R;for(const H of R)A._addBlankNodeQuadInfo({quad:H,component:H.subject}),A._addBlankNodeQuadInfo({quad:H,component:H.object}),A._addBlankNodeQuadInfo({quad:H,component:H.graph});const v=new Map,y=[...A.blankNodeInfo.keys()];let w=0;for(const H of y)++w%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:H,hashToBlankNodes:v});const D=[...v.keys()].sort(),j=[];for(const H of D){const K=v.get(H);K.length>1?j.push(K):A.canonicalIssuer.getId(K[0])}for(const H of j){const K=[];for(const M of H){if(A.canonicalIssuer.hasId(M))continue;const F=new V("_:b");F.getId(M);const Q=yield A.hashNDegreeQuads(M,F);K.push(Q)}K.sort(b);for(const M of K){const F=M.issuer.getOldIds();for(const Q of F)A.canonicalIssuer.getId(Q)}}const I=[];for(const H of A.quads){const K=ht({},H);K.subject=A._useCanonicalId({component:K.subject}),K.object=A._useCanonicalId({component:K.object}),K.graph=A._useCanonicalId({component:K.graph}),I.push($.serializeQuad(K))}return I.sort(),I.join("")})()}hashFirstDegreeQuads(R){var A=this;return gt(function*(){const v=[],y=A.blankNodeInfo.get(R),w=y.quads;for(const j of w){const I={subject:null,predicate:j.predicate,object:null,graph:null};I.subject=A.modifyFirstDegreeComponent(R,j.subject,"subject"),I.object=A.modifyFirstDegreeComponent(R,j.object,"object"),I.graph=A.modifyFirstDegreeComponent(R,j.graph,"graph"),v.push($.serializeQuad(I))}v.sort();const D=new L(A.hashAlgorithm);for(const j of v)D.update(j);return y.hash=yield D.digest(),y.hash})()}hashRelatedBlankNode(R,A,v,y){var w=this;return gt(function*(){let D;D=w.canonicalIssuer.hasId(R)?w.canonicalIssuer.getId(R):v.hasId(R)?v.getId(R):w.blankNodeInfo.get(R).hash;const j=new L(w.hashAlgorithm);return j.update(y),"g"!==y&&j.update(w.getRelatedPredicate(A)),j.update(D),j.digest()})()}hashNDegreeQuads(R,A){var v=this;return gt(function*(){const y=new L(v.hashAlgorithm),w=yield v.createHashToRelated(R,A),D=[...w.keys()].sort();for(const j of D){y.update(j);let H,I="";const K=new re(w.get(j));let M=0;for(;K.hasNext();){const F=K.next();++M%3==0&&(yield v._yield());let Q=A.clone(),E="";const U=[];let ie=!1;for(const ue of F)if(v.canonicalIssuer.hasId(ue)?E+=v.canonicalIssuer.getId(ue):(Q.hasId(ue)||U.push(ue),E+=Q.getId(ue)),0!==I.length&&E>I){ie=!0;break}if(!ie){for(const ue of U){const ee=yield v.hashNDegreeQuads(ue,Q);if(E+=Q.getId(ue),E+=`<${ee.hash}>`,Q=ee.issuer,0!==I.length&&E>I){ie=!0;break}}ie||(0===I.length||E`}createHashToRelated(R,A){var v=this;return gt(function*(){const y=new Map,w=v.blankNodeInfo.get(R).quads;let D=0;for(const j of w)++D%100==0&&(yield v._yield()),yield Promise.all([v._addRelatedBlankNodeHash({quad:j,component:j.subject,position:"s",id:R,issuer:A,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.object,position:"o",id:R,issuer:A,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.graph,position:"g",id:R,issuer:A,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:R,hashToBlankNodes:A}){var v=this;return gt(function*(){const y=yield v.hashFirstDegreeQuads(R),w=A.get(y);w?w.push(R):A.set(y,[R])})()}_addBlankNodeQuadInfo({quad:R,component:A}){if("BlankNode"!==A.termType)return;const v=A.value,y=this.blankNodeInfo.get(v);y?y.quads.add(R):this.blankNodeInfo.set(v,{quads:new Set([R]),hash:null})}_addRelatedBlankNodeHash({quad:R,component:A,position:v,id:y,issuer:w,hashToRelated:D}){var j=this;return gt(function*(){if("BlankNode"!==A.termType||A.value===y)return;const I=A.value,H=yield j.hashRelatedBlankNode(I,R,w,v),K=D.get(H);K?K.push(I):D.set(H,[I])})()}_useCanonicalId({component:R}){return"BlankNode"!==R.termType||R.value.startsWith(this.canonicalIssuer.prefix)?R:{termType:"BlankNode",value:this.canonicalIssuer.getId(R.value)}}_yield(){return gt(function*(){return new Promise(R=>W(R))})()}}}).call(this)}).call(this,Y("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(Y,Ae,he){"use strict";const W=Y("./IdentifierIssuer"),V=Y("./MessageDigest"),L=Y("./Permuter"),re=Y("./NQuads");function $(b,S){return b.hashS.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(S){this.quads=S;for(const D of S)this._addBlankNodeQuadInfo({quad:D,component:D.subject}),this._addBlankNodeQuadInfo({quad:D,component:D.object}),this._addBlankNodeQuadInfo({quad:D,component:D.graph});const R=new Map,A=[...this.blankNodeInfo.keys()];for(const D of A)this._hashAndTrackBlankNode({id:D,hashToBlankNodes:R});const v=[...R.keys()].sort(),y=[];for(const D of v){const j=R.get(D);j.length>1?y.push(j):this.canonicalIssuer.getId(j[0])}for(const D of y){const j=[];for(const I of D){if(this.canonicalIssuer.hasId(I))continue;const H=new W("_:b");H.getId(I);const K=this.hashNDegreeQuads(I,H);j.push(K)}j.sort($);for(const I of j){const H=I.issuer.getOldIds();for(const K of H)this.canonicalIssuer.getId(K)}}const w=[];for(const D of this.quads){const j=ht({},D);j.subject=this._useCanonicalId({component:j.subject}),j.object=this._useCanonicalId({component:j.object}),j.graph=this._useCanonicalId({component:j.graph}),w.push(re.serializeQuad(j))}return w.sort(),w.join("")}hashFirstDegreeQuads(S){const R=[],A=this.blankNodeInfo.get(S),v=A.quads;for(const w of v){const D={subject:null,predicate:w.predicate,object:null,graph:null};D.subject=this.modifyFirstDegreeComponent(S,w.subject,"subject"),D.object=this.modifyFirstDegreeComponent(S,w.object,"object"),D.graph=this.modifyFirstDegreeComponent(S,w.graph,"graph"),R.push(re.serializeQuad(D))}R.sort();const y=new V(this.hashAlgorithm);for(const w of R)y.update(w);return A.hash=y.digest(),A.hash}hashRelatedBlankNode(S,R,A,v){let y;y=this.canonicalIssuer.hasId(S)?this.canonicalIssuer.getId(S):A.hasId(S)?A.getId(S):this.blankNodeInfo.get(S).hash;const w=new V(this.hashAlgorithm);return w.update(v),"g"!==v&&w.update(this.getRelatedPredicate(R)),w.update(y),w.digest()}hashNDegreeQuads(S,R){const A=new V(this.hashAlgorithm),v=this.createHashToRelated(S,R),y=[...v.keys()].sort();for(const w of y){A.update(w);let j,D="";const I=new L(v.get(w));for(;I.hasNext();){const H=I.next();let K=R.clone(),M="";const F=[];let Q=!1;for(const E of H)if(this.canonicalIssuer.hasId(E)?M+=this.canonicalIssuer.getId(E):(K.hasId(E)||F.push(E),M+=K.getId(E)),0!==D.length&&M>D){Q=!0;break}if(!Q){for(const E of F){const U=this.hashNDegreeQuads(E,K);if(M+=K.getId(E),M+=`<${U.hash}>`,K=U.issuer,0!==D.length&&M>D){Q=!0;break}}Q||(0===D.length||M`}createHashToRelated(S,R){const A=new Map,v=this.blankNodeInfo.get(S).quads;for(const y of v)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:S,issuer:R,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:S,issuer:R,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:S,issuer:R,hashToRelated:A});return A}_hashAndTrackBlankNode({id:S,hashToBlankNodes:R}){const A=this.hashFirstDegreeQuads(S),v=R.get(A);v?v.push(S):R.set(A,[S])}_addBlankNodeQuadInfo({quad:S,component:R}){if("BlankNode"!==R.termType)return;const A=R.value,v=this.blankNodeInfo.get(A);v?v.quads.add(S):this.blankNodeInfo.set(A,{quads:new Set([S]),hash:null})}_addRelatedBlankNodeHash({quad:S,component:R,position:A,id:v,issuer:y,hashToRelated:w}){if("BlankNode"!==R.termType||R.value===v)return;const D=R.value,j=this.hashRelatedBlankNode(D,S,y,A),I=w.get(j);I?I.push(D):w.set(j,[D])}_useCanonicalId({component:S}){return"BlankNode"!==S.termType||S.value.startsWith(this.canonicalIssuer.prefix)?S:{termType:"BlankNode",value:this.canonicalIssuer.getId(S.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015");Ae.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){var $=this;return gt(function*(){const b=new Map,S=$.blankNodeInfo.get(L).quads;let R=0;for(const A of S){let v,y;if("BlankNode"===A.subject.termType&&A.subject.value!==L)y=A.subject.value,v="p";else{if("BlankNode"!==A.object.termType||A.object.value===L)continue;y=A.object.value,v="r"}++R%100==0&&(yield $._yield());const w=yield $.hashRelatedBlankNode(y,A,re,v),D=b.get(w);D?D.push(y):b.set(w,[y])}return b})()}}},{"./URDNA2015":51}],54:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015Sync");Ae.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){const $=new Map,b=this.blankNodeInfo.get(L).quads;for(const S of b){let R,A;if("BlankNode"===S.subject.termType&&S.subject.value!==L)A=S.subject.value,R="p";else{if("BlankNode"!==S.object.termType||S.object.value===L)continue;A=S.object.value,R="r"}const v=this.hashRelatedBlankNode(A,S,re,R),y=$.get(v);y?y.push(A):$.set(v,[A])}return $}}},{"./URDNA2015Sync":52}],55:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015"),V=Y("./URGNA2012"),L=Y("./URDNA2015Sync"),re=Y("./URGNA2012Sync");let $;try{$=Y("rdf-canonize-native")}catch(S){}const b={};Ae.exports=b,b.NQuads=Y("./NQuads"),b.IdentifierIssuer=Y("./IdentifierIssuer"),b._rdfCanonizeNative=function(S){return S&&($=S),$},b.canonize=function(){var S=gt(function*(R,A){if(Array.isArray(R)||(R=b.NQuads.legacyDatasetToQuads(R)),A.useNative){if(!$)throw new Error("rdf-canonize-native not available");return new Promise((v,y)=>$.canonize(R,A,(w,D)=>w?y(w):v(D)))}if("URDNA2015"===A.algorithm)return new W(A).main(R);if("URGNA2012"===A.algorithm)return new V(A).main(R);throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(R,A){return S.apply(this,arguments)}}(),b._canonizeSync=function(S,R){if(Array.isArray(S)||(S=b.NQuads.legacyDatasetToQuads(S)),R.useNative){if($)return $.canonizeSync(S,R);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===R.algorithm)return new L(R).main(S);if("URGNA2012"===R.algorithm)return new re(R).main(S);throw"algorithm"in R?new Error("Invalid RDF Dataset Canonicalization algorithm: "+R.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(Y,Ae,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&W(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(Y("./lib/BlankNode"),he),V(Y("./lib/DataFactory"),he),V(Y("./lib/DefaultGraph"),he),V(Y("./lib/Literal"),he),V(Y("./lib/NamedNode"),he),V(Y("./lib/Quad"),he),V(Y("./lib/Variable"),he)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(L){this.termType="BlankNode",this.value=L}equals(L){return!!L&&"BlankNode"===L.termType&&L.value===this.value}}},{}],58:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),V=Y("./DefaultGraph"),L=Y("./Literal"),re=Y("./NamedNode"),$=Y("./Quad"),b=Y("./Variable");let S=0;he.DataFactory=class{constructor(v){this.blankNodeCounter=0,this.blankNodePrefix=(v=v||{}).blankNodePrefix||`df_${S++}_`}namedNode(v){return new re.NamedNode(v)}blankNode(v){return new W.BlankNode(v||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(v,y){return new L.Literal(v,y)}variable(v){return new b.Variable(v)}defaultGraph(){return V.DefaultGraph.INSTANCE}quad(v,y,w,D){return new $.Quad(v,y,w,D||this.defaultGraph())}fromTerm(v){switch(v.termType){case"NamedNode":return this.namedNode(v.value);case"BlankNode":return this.blankNode(v.value);case"Literal":return v.language?this.literal(v.value,v.language):v.datatype.equals(L.Literal.XSD_STRING)?this.literal(v.value):this.literal(v.value,this.fromTerm(v.datatype));case"Variable":return this.variable(v.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(v.subject),this.fromTerm(v.predicate),this.fromTerm(v.object),this.fromTerm(v.graph))}}fromQuad(v){return this.fromTerm(v)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(L){return!!L&&"DefaultGraph"===L.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class V{constructor(re,$){this.termType="Literal",this.value=re,"string"==typeof $?(this.language=$,this.datatype=V.RDF_LANGUAGE_STRING):$?(this.language="",this.datatype=$):(this.language="",this.datatype=V.XSD_STRING)}equals(re){return!!re&&"Literal"===re.termType&&re.value===this.value&&re.language===this.language&&re.datatype.equals(this.datatype)}}he.Literal=V,V.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),V.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(L){this.termType="NamedNode",this.value=L}equals(L){return!!L&&"NamedNode"===L.termType&&L.value===this.value}}},{}],62:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(L,re,$,b){this.termType="Quad",this.value="",this.subject=L,this.predicate=re,this.object=$,this.graph=b}equals(L){return!!L&&("Quad"===L.termType||!L.termType)&&this.subject.equals(L.subject)&&this.predicate.equals(L.predicate)&&this.object.equals(L.object)&&this.graph.equals(L.graph)}}},{}],63:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(L){this.termType="Variable",this.value=L}equals(L){return!!L&&"Variable"===L.termType&&L.value===this.value}}},{}],64:[function(Y,Ae,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&W(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(L,re){const $=L.saxStream._parser;super(L.trackPosition?`Line ${$.line+1} column ${$.column+1}: ${re}`:re)}}he.ParseError=W},{}],66:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),V=Y("sax"),L=Y("stream"),re=Y("./ParseError"),$=Y("rdf-data-factory");class b extends L.Transform{constructor(A){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},A&&(Object.assign(this,A),this.options=A),this.dataFactory||(this.dataFactory=new $.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=V.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(A,v){const y={};let w=!1;for(const j in A.attributes)j.startsWith("xmlns")&&(5===j.length?(w=!0,y[""]=A.attributes[j]):":"===j.charAt(5)&&(w=!0,y[j.substr(6)]=A.attributes[j]));const D=v&&v.ns?v.ns:[b.DEFAULT_NS];return w?D.concat([y]):D}static expandPrefixedTerm(A,v,y){const w=A.indexOf(":");let D,j;w>=0?(D=A.substr(0,w),j=A.substr(w+1)):(D="",j=A);let I=null,H=null;for(let K=v.length-1;K>=0;K--){const M=v[K][D];if(M){I=M;break}H||(H=v[K][""])}if(!I){if(D&&"xmlns"!==D)throw new re.ParseError(y,`The prefix '${D}' in term '${A}' was not bound.`);I=H||""}return{prefix:D,local:j,uri:I}}static isValidIri(A){return b.IRI_REGEX.test(A)}import(A){const v=new L.PassThrough({readableObjectMode:!0});A.on("error",w=>y.emit("error",w)),A.on("data",w=>v.push(w)),A.on("end",()=>v.push(null));const y=v.pipe(new b(this.options));return y}_transform(A,v,y){try{this.saxStream.write(A,v)}catch(w){return y(w)}y()}newParseError(A){return new re.ParseError(this,A)}valueToUri(A,v){return this.uriToNamedNode(W.resolve(A,v.baseIRI))}uriToNamedNode(A){if(!b.isValidIri(A))throw this.newParseError(`Invalid URI: ${A}`);return this.dataFactory.namedNode(A)}validateNcname(A){if(!b.NCNAME_MATCHER.test(A))throw this.newParseError(`Not a valid NCName: ${A}`)}attachSaxListeners(){this.saxStream.on("error",A=>this.emit("error",A)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(A){const v=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=S.RESOURCE;if(v&&(v.hadChildren=!0,y=v.childrenParseType),v&&v.childrenStringTags){const D=A.name;let j="";for(const M in A.attributes)j+=` ${M}="${A.attributes[M]}"`;v.childrenStringTags.push(`<${D}${j}>`);const K={childrenStringTags:v.childrenStringTags};return K.childrenStringEmitClosingTag=``,void this.activeTagStack.push(K)}const w={};v?(w.language=v.language,w.baseIRI=v.baseIRI):w.baseIRI=this.baseIRI,this.activeTagStack.push(w),w.ns=b.parseNamespace(A,v),y===S.RESOURCE?this.onTagResource(A,w,v,!v):this.onTagProperty(A,w,v)}onTagResource(A,v,y,w){const D=b.expandPrefixedTerm(A.name,v.ns,this);v.childrenParseType=S.PROPERTY;let j=!0;if(D.uri===b.RDF){if(!w&&b.FORBIDDEN_NODE_ELEMENTS.indexOf(D.local)>=0)throw this.newParseError(`Illegal node element name: ${D.local}`);switch(D.local){case"RDF":v.childrenParseType=S.RESOURCE;case"Description":j=!1}}const I=[],H=[];let K=null,M=!1,F=!1,Q=null;for(const E in A.attributes){const U=A.attributes[E],ie=b.expandPrefixedTerm(E,v.ns,this);if(y&&ie.uri===b.RDF)switch(ie.local){case"about":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);K=U;continue;case"ID":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);this.validateNcname(U),K="#"+U,M=!0;continue;case"nodeID":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);this.validateNcname(U),K=U,F=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":Q=U;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(ie.uri===b.XML){if("lang"===ie.local){v.language=""===U?null:U.toLowerCase();continue}if("base"===ie.local){v.baseIRI=W.resolve(U,v.baseIRI);continue}}"xml"!==ie.prefix&&ie.uri&&(I.push(this.uriToNamedNode(ie.uri+ie.local)),H.push(U))}if(null!==K&&(v.subject=F?this.dataFactory.blankNode(K):this.valueToUri(K,v),M&&this.claimNodeId(v.subject)),v.subject||(v.subject=this.dataFactory.blankNode()),j){const E=this.uriToNamedNode(D.uri+D.local);this.emitTriple(v.subject,this.dataFactory.namedNode(b.RDF+"type"),E,y?y.reifiedStatementId:null)}if(y){if(y.predicate)if(y.childrenCollectionSubject){const E=this.dataFactory.blankNode();this.emitTriple(y.childrenCollectionSubject,y.childrenCollectionPredicate,E,y.reifiedStatementId),this.emitTriple(E,this.dataFactory.namedNode(b.RDF+"first"),v.subject,v.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(b.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,v.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${w.local}`);v.predicateSubPredicates=[],v.predicateSubObjects=[];let D=!1,j=!1,I=null,H=!0;const K=[],M=[];for(const F in A.attributes){const Q=A.attributes[F],E=b.expandPrefixedTerm(F,v.ns,this);if(E.uri===b.RDF)switch(E.local){case"resource":if(I)throw this.newParseError(`Found both rdf:resource (${Q}) and rdf:nodeID (${I}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${Q})`);v.hadChildren=!0,I=Q,H=!1;continue;case"datatype":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${Q}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${Q})`);v.datatype=this.valueToUri(Q,v);continue;case"nodeID":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${Q}).`);if(v.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${Q}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${Q})`);this.validateNcname(Q),v.hadChildren=!0,I=Q,H=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(j)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(v.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${v.datatype.value})`);if(I)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${I})`);if("Resource"===Q){D=!0,v.childrenParseType=S.PROPERTY;const U=this.dataFactory.blankNode();this.emitTriple(v.subject,v.predicate,U,v.reifiedStatementId),v.subject=U,v.predicate=null}else"Collection"===Q?(D=!0,v.hadChildren=!0,v.childrenCollectionSubject=v.subject,v.childrenCollectionPredicate=v.predicate,H=!1):"Literal"===Q&&(D=!0,v.childrenTagsToString=!0,v.childrenStringTags=[]);continue;case"ID":this.validateNcname(Q),v.reifiedStatementId=this.valueToUri("#"+Q,v),this.claimNodeId(v.reifiedStatementId);continue}else if(E.uri===b.XML&&"lang"===E.local){v.language=""===Q?null:Q.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(D||v.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${Q}`);v.hadChildren=!0,j=!0,K.push(this.uriToNamedNode(E.uri+E.local)),M.push(this.dataFactory.literal(Q,v.datatype||v.language))}}if(null!==I){const F=v.subject;v.subject=H?this.dataFactory.blankNode(I):this.valueToUri(I,v),this.emitTriple(F,v.predicate,v.subject,v.reifiedStatementId);for(let Q=0;Q/g,(v,y,w)=>(this.saxStream._parser.ENTITIES[y]=w,""))}}var S,R;he.RdfXmlParser=b,b.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,b.MIME_TYPE="application/rdf+xml",b.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",b.XML="http://www.w3.org/XML/1998/namespace",b.XMLNS="http://www.w3.org/2000/xmlns/",b.DEFAULT_NS={xml:b.XML},b.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],b.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],b.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,(R=S=he.ParseType||(he.ParseType={}))[R.RESOURCE=0]="RESOURCE",R[R.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(Y,Ae,he){"use strict";var V={};function L(R,A,v){v||(v=Error);var w=function(D){function j(I,H,K){return D.call(this,function(D,j,I){return"string"==typeof A?A:A(D,j,I)}(I,H,K))||this}return function(R,A){R.prototype=Object.create(A.prototype),R.prototype.constructor=R,R.__proto__=A}(j,D),j}(v);w.prototype.name=v.name,w.prototype.code=R,V[R]=w}function re(R,A){if(Array.isArray(R)){var v=R.length;return R=R.map(function(y){return String(y)}),v>2?"one of ".concat(A," ").concat(R.slice(0,v-1).join(", "),", or ")+R[v-1]:2===v?"one of ".concat(A," ").concat(R[0]," or ").concat(R[1]):"of ".concat(A," ").concat(R[0])}return"of ".concat(A," ").concat(String(R))}L("ERR_INVALID_OPT_VALUE",function(R,A){return'The value "'+A+'" is invalid for option "'+R+'"'},TypeError),L("ERR_INVALID_ARG_TYPE",function(R,A,v){var y,w;if("string"==typeof A&&function(R,A,v){return R.substr(!v||v<0?0:+v,A.length)===A}(A,"not ")?(y="must not be",A=A.replace(/^not /,"")):y="must be",function(R,A,v){return(void 0===v||v>R.length)&&(v=R.length),R.substring(v-A.length,v)===A}(R," argument"))w="The ".concat(R," ").concat(y," ").concat(re(A,"type"));else{var D=function(R,A,v){return"number"!=typeof v&&(v=0),!(v+A.length>R.length)&&-1!==R.indexOf(A,v)}(R,".")?"property":"argument";w='The "'.concat(R,'" ').concat(D," ").concat(y," ").concat(re(A,"type"))}return w+". Received type ".concat(typeof v)},TypeError),L("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),L("ERR_METHOD_NOT_IMPLEMENTED",function(R){return"The "+R+" method is not implemented"}),L("ERR_STREAM_PREMATURE_CLOSE","Premature close"),L("ERR_STREAM_DESTROYED",function(R){return"Cannot call "+R+" after a stream was destroyed"}),L("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),L("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),L("ERR_STREAM_WRITE_AFTER_END","write after end"),L("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),L("ERR_UNKNOWN_ENCODING",function(R){return"Unknown encoding: "+R},TypeError),L("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.exports.codes=V},{}],68:[function(Y,Ae,he){(function(W){(function(){"use strict";var V=Object.keys||function(y){var w=[];for(var D in y)w.push(D);return w};Ae.exports=R;var L=Y("./_stream_readable"),re=Y("./_stream_writable");Y("inherits")(R,L);for(var $=V(re.prototype),b=0;b<$.length;b++){var S=$[b];R.prototype[S]||(R.prototype[S]=re.prototype[S])}function R(y){if(!(this instanceof R))return new R(y);L.call(this,y),re.call(this,y),this.allowHalfOpen=!0,y&&(!1===y.readable&&(this.readable=!1),!1===y.writable&&(this.writable=!1),!1===y.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",A)))}function A(){this._writableState.ended||W.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(w){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=w,this._writableState.destroyed=w)}})}).call(this)}).call(this,Y("_process"))},{"./_stream_readable":70,"./_stream_writable":72,_process:44,inherits:10}],69:[function(Y,Ae,he){"use strict";Ae.exports=V;var W=Y("./_stream_transform");function V(L){if(!(this instanceof V))return new V(L);W.call(this,L)}Y("inherits")(V,W),V.prototype._transform=function(L,re,$){$(null,L)}},{"./_stream_transform":71,inherits:10}],70:[function(Y,Ae,he){(function(W,V){(function(){"use strict";var L;Ae.exports=te,te.ReadableState=me,Y("events");var $=function(B,O){return B.listeners(O).length},b=Y("./internal/streams/stream"),S=Y("buffer").Buffer,R=V.Uint8Array||function(){};var w,y=Y("util");w=y&&y.debuglog?y.debuglog("stream"):function(){};var U,ie,ue,D=Y("./internal/streams/buffer_list"),j=Y("./internal/streams/destroy"),H=Y("./internal/streams/state").getHighWaterMark,K=Y("../errors").codes,M=K.ERR_INVALID_ARG_TYPE,F=K.ERR_STREAM_PUSH_AFTER_EOF,Q=K.ERR_METHOD_NOT_IMPLEMENTED,E=K.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Y("inherits")(te,b);var ee=j.errorOrDestroy,se=["error","close","destroy","pause","resume"];function me(pe,B,O){L=L||Y("./_stream_duplex"),"boolean"!=typeof O&&(O=B instanceof L),this.objectMode=!!(pe=pe||{}).objectMode,O&&(this.objectMode=this.objectMode||!!pe.readableObjectMode),this.highWaterMark=H(this,pe,"readableHighWaterMark",O),this.buffer=new D,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==pe.emitClose,this.autoDestroy=!!pe.autoDestroy,this.destroyed=!1,this.defaultEncoding=pe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,pe.encoding&&(U||(U=Y("string_decoder/").StringDecoder),this.decoder=new U(pe.encoding),this.encoding=pe.encoding)}function te(pe){if(L=L||Y("./_stream_duplex"),!(this instanceof te))return new te(pe);this._readableState=new me(pe,this,this instanceof L),this.readable=!0,pe&&("function"==typeof pe.read&&(this._read=pe.read),"function"==typeof pe.destroy&&(this._destroy=pe.destroy)),b.call(this)}function ye(pe,B,O,k,Re){w("readableAddChunk",B);var yt,Xe=pe._readableState;if(null===B)Xe.reading=!1,function(pe,B){if(w("onEofChunk"),!B.ended){if(B.decoder){var O=B.decoder.end();O&&O.length&&(B.buffer.push(O),B.length+=B.objectMode?1:O.length)}B.ended=!0,B.sync?je(pe):(B.needReadable=!1,B.emittedReadable||(B.emittedReadable=!0,Le(pe)))}}(pe,Xe);else if(Re||(yt=function(pe,B){var O;return!function(pe){return S.isBuffer(pe)||pe instanceof R}(B)&&"string"!=typeof B&&void 0!==B&&!pe.objectMode&&(O=new M("chunk",["string","Buffer","Uint8Array"],B)),O}(Xe,B)),yt)ee(pe,yt);else if(Xe.objectMode||B&&B.length>0)if("string"!=typeof B&&!Xe.objectMode&&Object.getPrototypeOf(B)!==S.prototype&&(B=function(pe){return S.from(pe)}(B)),k)Xe.endEmitted?ee(pe,new E):Me(pe,Xe,B,!0);else if(Xe.ended)ee(pe,new F);else{if(Xe.destroyed)return!1;Xe.reading=!1,Xe.decoder&&!O?(B=Xe.decoder.write(B),Xe.objectMode||0!==B.length?Me(pe,Xe,B,!1):Ee(pe,Xe)):Me(pe,Xe,B,!1)}else k||(Xe.reading=!1,Ee(pe,Xe));return!Xe.ended&&(Xe.lengthB.highWaterMark&&(B.highWaterMark=function(pe){return pe>=nt?pe=nt:(pe--,pe|=pe>>>1,pe|=pe>>>2,pe|=pe>>>4,pe|=pe>>>8,pe|=pe>>>16,pe++),pe}(pe)),pe<=B.length?pe:B.ended?B.length:(B.needReadable=!0,0))}function je(pe){var B=pe._readableState;w("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(w("emitReadable",B.flowing),B.emittedReadable=!0,W.nextTick(Le,pe))}function Le(pe){var B=pe._readableState;w("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(pe.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,be(pe)}function Ee(pe,B){B.readingMore||(B.readingMore=!0,W.nextTick(Oe,pe,B))}function Oe(pe,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:pe.listenerCount("data")>0&&pe.resume()}function Be(pe){w("readable nexttick read 0"),pe.read(0)}function X(pe,B){w("resume",B.reading),B.reading||pe.read(0),B.resumeScheduled=!1,pe.emit("resume"),be(pe),B.flowing&&!B.reading&&pe.read(0)}function be(pe){var B=pe._readableState;for(w("flow",B.flowing);B.flowing&&null!==pe.read(););}function ce(pe,B){return 0===B.length?null:(B.objectMode?O=B.buffer.shift():!pe||pe>=B.length?(O=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):O=B.buffer.consume(pe,B.decoder),O);var O}function Pe(pe){var B=pe._readableState;w("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,W.nextTick(Et,B,pe))}function Et(pe,B){if(w("endReadableNT",pe.endEmitted,pe.length),!pe.endEmitted&&0===pe.length&&(pe.endEmitted=!0,B.readable=!1,B.emit("end"),pe.autoDestroy)){var O=B._writableState;(!O||O.autoDestroy&&O.finished)&&B.destroy()}}function pt(pe,B){for(var O=0,k=pe.length;O=B.highWaterMark:B.length>0)||B.ended))return w("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?Pe(this):je(this),null;if(0===(pe=Je(pe,B))&&B.ended)return 0===B.length&&Pe(this),null;var Re,k=B.needReadable;return w("need readable",k),(0===B.length||B.length-pe0?ce(pe,B):null)?(B.needReadable=B.length<=B.highWaterMark,pe=0):(B.length-=pe,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),O!==pe&&B.ended&&Pe(this)),null!==Re&&this.emit("data",Re),Re},te.prototype._read=function(pe){ee(this,new Q("_read()"))},te.prototype.pipe=function(pe,B){var O=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=pe;break;case 1:k.pipes=[k.pipes,pe];break;default:k.pipes.push(pe)}k.pipesCount+=1,w("pipe count=%d opts=%j",k.pipesCount,B);var Xe=B&&!1===B.end||pe===W.stdout||pe===W.stderr?as:It;function yt(Os,zr){w("onunpipe"),Os===O&&zr&&!1===zr.hasUnpiped&&(zr.hasUnpiped=!0,w("cleanup"),pe.removeListener("close",Ur),pe.removeListener("finish",Is),pe.removeListener("drain",An),pe.removeListener("error",ci),pe.removeListener("unpipe",yt),O.removeListener("end",It),O.removeListener("end",as),O.removeListener("data",yi),Rn=!0,k.awaitDrain&&(!pe._writableState||pe._writableState.needDrain)&&An())}function It(){w("onend"),pe.end()}k.endEmitted?W.nextTick(Xe):O.once("end",Xe),pe.on("unpipe",yt);var An=function(pe){return function(){var O=pe._readableState;w("pipeOnDrain",O.awaitDrain),O.awaitDrain&&O.awaitDrain--,0===O.awaitDrain&&$(pe,"data")&&(O.flowing=!0,be(pe))}}(O);pe.on("drain",An);var Rn=!1;function yi(Os){w("ondata");var zr=pe.write(Os);w("dest.write",zr),!1===zr&&((1===k.pipesCount&&k.pipes===pe||k.pipesCount>1&&-1!==pt(k.pipes,pe))&&!Rn&&(w("false write response, pause",k.awaitDrain),k.awaitDrain++),O.pause())}function ci(Os){w("onerror",Os),as(),pe.removeListener("error",ci),0===$(pe,"error")&&ee(pe,Os)}function Ur(){pe.removeListener("finish",Is),as()}function Is(){w("onfinish"),pe.removeListener("close",Ur),as()}function as(){w("unpipe"),O.unpipe(pe)}return O.on("data",yi),function(pe,B,O){if("function"==typeof pe.prependListener)return pe.prependListener(B,O);pe._events&&pe._events[B]?Array.isArray(pe._events[B])?pe._events[B].unshift(O):pe._events[B]=[O,pe._events[B]]:pe.on(B,O)}(pe,"error",ci),pe.once("close",Ur),pe.once("finish",Is),pe.emit("pipe",O),k.flowing||(w("pipe resume"),O.resume()),pe},te.prototype.unpipe=function(pe){var B=this._readableState,O={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return pe&&pe!==B.pipes||(pe||(pe=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,pe&&pe.emit("unpipe",this,O)),this;if(!pe){var k=B.pipes,Re=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Xe=0;Xe0,!1!==k.flowing&&this.resume()):"readable"===pe&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,w("on readable",k.length,k.reading),k.length?je(this):k.reading||W.nextTick(Be,this)),O},te.prototype.removeListener=function(pe,B){var O=b.prototype.removeListener.call(this,pe,B);return"readable"===pe&&W.nextTick(qe,this),O},te.prototype.removeAllListeners=function(pe){var B=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===pe||void 0===pe)&&W.nextTick(qe,this),B},te.prototype.resume=function(){var pe=this._readableState;return pe.flowing||(w("resume"),pe.flowing=!pe.readableListening,function(pe,B){B.resumeScheduled||(B.resumeScheduled=!0,W.nextTick(X,pe,B))}(this,pe)),pe.paused=!1,this},te.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},te.prototype.wrap=function(pe){var B=this,O=this._readableState,k=!1;for(var Re in pe.on("end",function(){if(w("wrapped end"),O.decoder&&!O.ended){var yt=O.decoder.end();yt&&yt.length&&B.push(yt)}B.push(null)}),pe.on("data",function(yt){w("wrapped data"),O.decoder&&(yt=O.decoder.write(yt)),O.objectMode&&null==yt||!(O.objectMode||yt&&yt.length)||B.push(yt)||(k=!0,pe.pause())}),pe)void 0===this[Re]&&"function"==typeof pe[Re]&&(this[Re]=function(It){return function(){return pe[It].apply(pe,arguments)}}(Re));for(var Xe=0;Xe-1))throw new ie(ce);return this._writableState.defaultEncoding=ce,this},Object.defineProperty(me.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(me.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),me.prototype._write=function(be,ce,Pe){Pe(new K("_write()"))},me.prototype._writev=null,me.prototype.end=function(be,ce,Pe){var Et=this._writableState;return"function"==typeof be?(Pe=be,be=null,ce=null):"function"==typeof ce&&(Pe=ce,ce=null),null!=be&&this.write(be,ce),Et.corked&&(Et.corked=1,this.uncork()),Et.ending||function(be,ce,Pe){ce.ending=!0,Be(be,ce),Pe&&(ce.finished?W.nextTick(Pe):be.once("finish",Pe)),ce.ended=!0,be.writable=!1}(this,Et,Pe),this},Object.defineProperty(me.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(ce){!this._writableState||(this._writableState.destroyed=ce)}}),me.prototype.destroy=w.destroy,me.prototype._undestroy=w.undestroy,me.prototype._destroy=function(be,ce){ce(be)}}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(Y,Ae,he){(function(W){(function(){"use strict";var V;function L(F,Q,E){return Q in F?Object.defineProperty(F,Q,{value:E,enumerable:!0,configurable:!0,writable:!0}):F[Q]=E,F}var re=Y("./end-of-stream"),$=Symbol("lastResolve"),b=Symbol("lastReject"),S=Symbol("error"),R=Symbol("ended"),A=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function w(F,Q){return{value:F,done:Q}}function D(F){var Q=F[$];if(null!==Q){var E=F[y].read();null!==E&&(F[A]=null,F[$]=null,F[b]=null,Q(w(E,!1)))}}function j(F){W.nextTick(D,F)}var H=Object.getPrototypeOf(function(){}),K=Object.setPrototypeOf((L(V={get stream(){return this[y]},next:function(){var Q=this,E=this[S];if(null!==E)return Promise.reject(E);if(this[R])return Promise.resolve(w(void 0,!0));if(this[y].destroyed)return new Promise(function(ee,se){W.nextTick(function(){Q[S]?se(Q[S]):ee(w(void 0,!0))})});var ie,U=this[A];if(U)ie=new Promise(function(F,Q){return function(E,U){F.then(function(){Q[R]?E(w(void 0,!0)):Q[v](E,U)},U)}}(U,this));else{var ue=this[y].read();if(null!==ue)return Promise.resolve(w(ue,!1));ie=new Promise(this[v])}return this[A]=ie,ie}},Symbol.asyncIterator,function(){return this}),L(V,"return",function(){var Q=this;return new Promise(function(E,U){Q[y].destroy(null,function(ie){ie?U(ie):E(w(void 0,!0))})})}),V),H);Ae.exports=function(Q){var E,U=Object.create(K,(L(E={},y,{value:Q,writable:!0}),L(E,$,{value:null,writable:!0}),L(E,b,{value:null,writable:!0}),L(E,S,{value:null,writable:!0}),L(E,R,{value:Q._readableState.endEmitted,writable:!0}),L(E,v,{value:function(ue,ee){var se=U[y].read();se?(U[A]=null,U[$]=null,U[b]=null,ue(w(se,!1))):(U[$]=ue,U[b]=ee)},writable:!0}),E));return U[A]=null,re(Q,function(ie){if(ie&&"ERR_STREAM_PREMATURE_CLOSE"!==ie.code){var ue=U[b];return null!==ue&&(U[A]=null,U[$]=null,U[b]=null,ue(ie)),void(U[S]=ie)}var ee=U[$];null!==ee&&(U[A]=null,U[$]=null,U[b]=null,ee(w(void 0,!0))),U[R]=!0}),Q.on("readable",j.bind(null,U)),U}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Ae,he){"use strict";function W(D,j){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(D);j&&(H=H.filter(function(K){return Object.getOwnPropertyDescriptor(D,K).enumerable})),I.push.apply(I,H)}return I}function L(D,j,I){return j in D?Object.defineProperty(D,j,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[j]=I,D}function $(D,j){for(var I=0;I0?this.tail.next=H:this.head=H,this.tail=H,++this.length}},{key:"unshift",value:function(I){var H={data:I,next:this.head};0===this.length&&(this.tail=H),this.head=H,++this.length}},{key:"shift",value:function(){if(0!==this.length){var I=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,I}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(I){if(0===this.length)return"";for(var H=this.head,K=""+H.data;H=H.next;)K+=I+H.data;return K}},{key:"concat",value:function(I){if(0===this.length)return R.alloc(0);for(var H=R.allocUnsafe(I>>>0),K=this.head,M=0;K;)w(K.data,H,M),M+=K.data.length,K=K.next;return H}},{key:"consume",value:function(I,H){var K;return IF.length?F.length:I;if(M+=Q===F.length?F:F.slice(0,I),0==(I-=Q)){Q===F.length?(++K,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=F.slice(Q));break}++K}return this.length-=K,M}},{key:"_getBuffer",value:function(I){var H=R.allocUnsafe(I),K=this.head,M=1;for(K.data.copy(H),I-=K.data.length;K=K.next;){var F=K.data,Q=I>F.length?F.length:I;if(F.copy(H,H.length-I,0,Q),0==(I-=Q)){Q===F.length?(++M,this.head=K.next?K.next:this.tail=null):(this.head=K,K.data=F.slice(Q));break}++M}return this.length-=M,H}},{key:y,value:function(I,H){return v(this,function(D){for(var j=1;j0,function(ie){K||(K=ie),ie&&M.forEach(A),!E&&(M.forEach(A),H(K))})});return j.reduce(v)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Ae,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Ae.exports={getHighWaterMark:function(re,$,b,S){var R=function(re,$,b){return null!=re.highWaterMark?re.highWaterMark:$?re[b]:null}($,S,b);if(null!=R){if(!isFinite(R)||Math.floor(R)!==R||R<0)throw new W(S?b:"highWaterMark",R);return Math.floor(R)}return re.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Ae,he){Ae.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Ae,he){(he=Ae.exports=Y("./lib/_stream_readable.js")).Stream=he,he.Readable=he,he.Writable=Y("./lib/_stream_writable.js"),he.Duplex=Y("./lib/_stream_duplex.js"),he.Transform=Y("./lib/_stream_transform.js"),he.PassThrough=Y("./lib/_stream_passthrough.js"),he.finished=Y("./lib/internal/streams/end-of-stream.js"),he.pipeline=Y("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(V){for(var L in V)he.hasOwnProperty(L)||(he[L]=V[L])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Ae,he){"use strict";function V($){const b=[];let S=0;for(;S<$.length;)switch($[S]){case"/":if("."===$[S+1])if("."===$[S+2]){if(!re($[S+3])){b.push([]),S++;break}b.pop(),$[S+3]||b.push([]),S+=3}else{if(!re($[S+2])){b.push([]),S++;break}$[S+2]||b.push([]),S+=2}else b.push([]),S++;break;case"#":case"?":b.length||b.push([]),b[b.length-1].push($.substr(S)),S=$.length;break;default:b.length||b.push([]),b[b.length-1].push($[S]),S++}return"/"+b.map(R=>R.join("")).join("/")}function L($,b){let S=b+1;b>=0?"/"===$[b+1]&&"/"===$[b+2]&&(S=b+3):"/"===$[0]&&"/"===$[1]&&(S=2);const R=$.indexOf("/",S);return R<0?$:$.substr(0,R)+V($.substr(R))}function re($){return!$||"#"===$||"?"===$||"/"===$}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function($,b){const S=(b=b||"").indexOf("#");if(S>0&&(b=b.substr(0,S)),!$.length){if(b.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);return b}if($.startsWith("?")){const j=b.indexOf("?");return j>0&&(b=b.substr(0,j)),b+$}if($.startsWith("#"))return b+$;if(!b.length){const j=$.indexOf(":");if(j<0)throw new Error(`Found invalid relative IRI '${$}' for a missing baseIRI`);return L($,j)}const R=$.indexOf(":");if(R>=0)return L($,R);const A=b.indexOf(":");if(A<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);const v=b.substr(0,A+1);if(0===$.indexOf("//"))return v+L($,R);let y;if(b.indexOf("//",A)===A+1){if(y=b.indexOf("/",A+3),y<0)return b.length>A+3?b+"/"+L($,R):v+L($,R)}else if(y=b.indexOf("/",A+1),y<0)return v+L($,R);if(0===$.indexOf("/"))return b.substr(0,y)+V($);let w=b.substr(y);const D=w.lastIndexOf("/");return D>=0&&D"===ce?(te(X,"onsgmldeclaration",X.sgmlDecl),X.sgmlDecl="",X.state=se.TEXT):(U(ce)&&(X.state=se.SGML_DECL_QUOTED),X.sgmlDecl+=ce);continue;case se.SGML_DECL_QUOTED:ce===X.q&&(X.state=se.SGML_DECL,X.q=""),X.sgmlDecl+=ce;continue;case se.DOCTYPE:">"===ce?(X.state=se.TEXT,te(X,"ondoctype",X.doctype),X.doctype=!0):(X.doctype+=ce,"["===ce?X.state=se.DOCTYPE_DTD:U(ce)&&(X.state=se.DOCTYPE_QUOTED,X.q=ce));continue;case se.DOCTYPE_QUOTED:X.doctype+=ce,ce===X.q&&(X.q="",X.state=se.DOCTYPE);continue;case se.DOCTYPE_DTD:X.doctype+=ce,"]"===ce?X.state=se.DOCTYPE:U(ce)&&(X.state=se.DOCTYPE_DTD_QUOTED,X.q=ce);continue;case se.DOCTYPE_DTD_QUOTED:X.doctype+=ce,ce===X.q&&(X.state=se.DOCTYPE_DTD,X.q="");continue;case se.COMMENT:"-"===ce?X.state=se.COMMENT_ENDING:X.comment+=ce;continue;case se.COMMENT_ENDING:"-"===ce?(X.state=se.COMMENT_ENDED,X.comment=Me(X.opt,X.comment),X.comment&&te(X,"oncomment",X.comment),X.comment=""):(X.comment+="-"+ce,X.state=se.COMMENT);continue;case se.COMMENT_ENDED:">"!==ce?(Ze(X,"Malformed comment"),X.comment+="--"+ce,X.state=se.COMMENT):X.state=se.TEXT;continue;case se.CDATA:"]"===ce?X.state=se.CDATA_ENDING:X.cdata+=ce;continue;case se.CDATA_ENDING:"]"===ce?X.state=se.CDATA_ENDING_2:(X.cdata+="]"+ce,X.state=se.CDATA);continue;case se.CDATA_ENDING_2:">"===ce?(X.cdata&&te(X,"oncdata",X.cdata),te(X,"onclosecdata"),X.cdata="",X.state=se.TEXT):"]"===ce?X.cdata+="]":(X.cdata+="]]"+ce,X.state=se.CDATA);continue;case se.PROC_INST:"?"===ce?X.state=se.PROC_INST_ENDING:E(ce)?X.state=se.PROC_INST_BODY:X.procInstName+=ce;continue;case se.PROC_INST_BODY:if(!X.procInstBody&&E(ce))continue;"?"===ce?X.state=se.PROC_INST_ENDING:X.procInstBody+=ce;continue;case se.PROC_INST_ENDING:">"===ce?(te(X,"onprocessinginstruction",{name:X.procInstName,body:X.procInstBody}),X.procInstName=X.procInstBody="",X.state=se.TEXT):(X.procInstBody+="?"+ce,X.state=se.PROC_INST_BODY);continue;case se.OPEN_TAG:ue(M,ce)?X.tagName+=ce:(Je(X),">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:(E(ce)||Ze(X,"Invalid character in tag name"),X.state=se.ATTRIB));continue;case se.OPEN_TAG_SLASH:">"===ce?(Le(X,!0),Ee(X)):(Ze(X,"Forward-slash in opening tag not followed by >"),X.state=se.ATTRIB);continue;case se.ATTRIB:if(E(ce))continue;">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(K,ce)?(X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME:"="===ce?X.state=se.ATTRIB_VALUE:">"===ce?(Ze(X,"Attribute without value"),X.attribValue=X.attribName,je(X),Le(X)):E(ce)?X.state=se.ATTRIB_NAME_SAW_WHITE:ue(M,ce)?X.attribName+=ce:Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME_SAW_WHITE:if("="===ce)X.state=se.ATTRIB_VALUE;else{if(E(ce))continue;Ze(X,"Attribute without value"),X.tag.attributes[X.attribName]="",X.attribValue="",te(X,"onattribute",{name:X.attribName,value:""}),X.attribName="",">"===ce?Le(X):ue(K,ce)?(X.attribName=ce,X.state=se.ATTRIB_NAME):(Ze(X,"Invalid attribute name"),X.state=se.ATTRIB)}continue;case se.ATTRIB_VALUE:if(E(ce))continue;U(ce)?(X.q=ce,X.state=se.ATTRIB_VALUE_QUOTED):(Ze(X,"Unquoted attribute value"),X.state=se.ATTRIB_VALUE_UNQUOTED,X.attribValue=ce);continue;case se.ATTRIB_VALUE_QUOTED:if(ce!==X.q){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_Q:X.attribValue+=ce;continue}je(X),X.q="",X.state=se.ATTRIB_VALUE_CLOSED;continue;case se.ATTRIB_VALUE_CLOSED:E(ce)?X.state=se.ATTRIB:">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(K,ce)?(Ze(X,"No whitespace between attributes"),X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_VALUE_UNQUOTED:if(!ie(ce)){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_U:X.attribValue+=ce;continue}je(X),">"===ce?Le(X):X.state=se.ATTRIB;continue;case se.CLOSE_TAG:if(X.tagName)">"===ce?Ee(X):ue(M,ce)?X.tagName+=ce:X.script?(X.script+=""===ce?Ee(X):Ze(X,"Invalid characters in closing tag");continue;case se.TEXT_ENTITY:case se.ATTRIB_VALUE_ENTITY_Q:case se.ATTRIB_VALUE_ENTITY_U:var pt,pe;switch(X.state){case se.TEXT_ENTITY:pt=se.TEXT,pe="textNode";break;case se.ATTRIB_VALUE_ENTITY_Q:pt=se.ATTRIB_VALUE_QUOTED,pe="attribValue";break;case se.ATTRIB_VALUE_ENTITY_U:pt=se.ATTRIB_VALUE_UNQUOTED,pe="attribValue"}";"===ce?(X[pe]+=Oe(X),X.entity="",X.state=pt):ue(X.entity.length?Q:F,ce)?X.entity+=ce:(Ze(X,"Invalid character in entity name"),X[pe]+="&"+X.entity+ce,X.entity="",X.state=pt);continue;default:throw new Error(X,"Unknown state: "+X.state)}return X.position>=X.bufferCheckPosition&&function(z){for(var X=Math.max(V.MAX_BUFFER_LENGTH,10),be=0,ce=0,Pe=L.length;ceX)switch(L[ce]){case"textNode":ye(z);break;case"cdata":te(z,"oncdata",z.cdata),z.cdata="";break;case"script":te(z,"onscript",z.script),z.script="";break;default:Ve(z,"Max buffer length exceeded: "+L[ce])}be=Math.max(be,Et)}z.bufferCheckPosition=V.MAX_BUFFER_LENGTH-be+z.position}(X),X},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(z){ye(z),""!==z.cdata&&(te(z,"oncdata",z.cdata),z.cdata=""),""!==z.script&&(te(z,"onscript",z.script),z.script="")}(this)}};try{R=Y("stream").Stream}catch(z){R=function(){}}var A=V.EVENTS.filter(function(z){return"error"!==z&&"end"!==z});function y(z,X){if(!(this instanceof y))return new y(z,X);R.apply(this),this._parser=new re(z,X),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ce){be.emit("error",ce),be._parser.error=null},this._decoder=null,A.forEach(function(ce){Object.defineProperty(be,"on"+ce,{get:function(){return be._parser["on"+ce]},set:function(Pe){if(!Pe)return be.removeAllListeners(ce),be._parser["on"+ce]=Pe,Pe;be.on(ce,Pe)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(R.prototype,{constructor:{value:y}})).write=function(z){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(z)){if(!this._decoder){var X=Y("string_decoder").StringDecoder;this._decoder=new X("utf8")}z=this._decoder.write(z)}return this._parser.write(z.toString()),this.emit("data",z),!0},y.prototype.end=function(z){return z&&z.length&&this.write(z),this._parser.end(),!0},y.prototype.on=function(z,X){var be=this;return!be._parser["on"+z]&&-1!==A.indexOf(z)&&(be._parser["on"+z]=function(){var ce=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ce.splice(0,0,z),be.emit.apply(be,ce)}),R.prototype.on.call(be,z,X)};var j="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",H={xml:j,xmlns:I},K=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,M=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(z){return" "===z||"\n"===z||"\r"===z||"\t"===z}function U(z){return'"'===z||"'"===z}function ie(z){return">"===z||E(z)}function ue(z,X){return z.test(X)}function ee(z,X){return!ue(z,X)}var z,X,be,se=0;for(var Te in V.STATE={BEGIN:se++,BEGIN_WHITESPACE:se++,TEXT:se++,TEXT_ENTITY:se++,OPEN_WAKA:se++,SGML_DECL:se++,SGML_DECL_QUOTED:se++,DOCTYPE:se++,DOCTYPE_QUOTED:se++,DOCTYPE_DTD:se++,DOCTYPE_DTD_QUOTED:se++,COMMENT_STARTING:se++,COMMENT:se++,COMMENT_ENDING:se++,COMMENT_ENDED:se++,CDATA:se++,CDATA_ENDING:se++,CDATA_ENDING_2:se++,PROC_INST:se++,PROC_INST_BODY:se++,PROC_INST_ENDING:se++,OPEN_TAG:se++,OPEN_TAG_SLASH:se++,ATTRIB:se++,ATTRIB_NAME:se++,ATTRIB_NAME_SAW_WHITE:se++,ATTRIB_VALUE:se++,ATTRIB_VALUE_QUOTED:se++,ATTRIB_VALUE_CLOSED:se++,ATTRIB_VALUE_UNQUOTED:se++,ATTRIB_VALUE_ENTITY_Q:se++,ATTRIB_VALUE_ENTITY_U:se++,CLOSE_TAG:se++,CLOSE_TAG_SAW_WHITE:se++,SCRIPT:se++,SCRIPT_ENDING:se++},V.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(V.ENTITIES).forEach(function(z){var X=V.ENTITIES[z],be="number"==typeof X?String.fromCharCode(X):X;V.ENTITIES[z]=be}),V.STATE)V.STATE[V.STATE[Te]]=Te;function me(z,X,be){z[X]&&z[X](be)}function te(z,X,be){z.textNode&&ye(z),me(z,X,be)}function ye(z){z.textNode=Me(z.opt,z.textNode),z.textNode&&me(z,"ontext",z.textNode),z.textNode=""}function Me(z,X){return z.trim&&(X=X.trim()),z.normalize&&(X=X.replace(/\s+/g," ")),X}function Ve(z,X){return ye(z),z.trackPosition&&(X+="\nLine: "+z.line+"\nColumn: "+z.column+"\nChar: "+z.c),X=new Error(X),z.error=X,me(z,"onerror",X),z}function nt(z){return z.sawRoot&&!z.closedRoot&&Ze(z,"Unclosed root tag"),z.state!==se.BEGIN&&z.state!==se.BEGIN_WHITESPACE&&z.state!==se.TEXT&&Ve(z,"Unexpected end"),ye(z),z.c="",z.closed=!0,me(z,"onend"),re.call(z,z.strict,z.opt),z}function Ze(z,X){if("object"!=typeof z||!(z instanceof re))throw new Error("bad call to strictFail");z.strict&&Ve(z,X)}function Je(z){z.strict||(z.tagName=z.tagName[z.looseCase]());var X=z.tags[z.tags.length-1]||z,be=z.tag={name:z.tagName,attributes:{}};z.opt.xmlns&&(be.ns=X.ns),z.attribList.length=0,te(z,"onopentagstart",be)}function Ke(z,X){var ce=z.indexOf(":")<0?["",z]:z.split(":"),Pe=ce[0],Et=ce[1];return X&&"xmlns"===z&&(Pe="xmlns",Et=""),{prefix:Pe,local:Et}}function je(z){if(z.strict||(z.attribName=z.attribName[z.looseCase]()),-1!==z.attribList.indexOf(z.attribName)||z.tag.attributes.hasOwnProperty(z.attribName))z.attribName=z.attribValue="";else{if(z.opt.xmlns){var X=Ke(z.attribName,!0),ce=X.local;if("xmlns"===X.prefix)if("xml"===ce&&z.attribValue!==j)Ze(z,"xml: prefix must be bound to "+j+"\nActual: "+z.attribValue);else if("xmlns"===ce&&z.attribValue!==I)Ze(z,"xmlns: prefix must be bound to "+I+"\nActual: "+z.attribValue);else{var Pe=z.tag,Et=z.tags[z.tags.length-1]||z;Pe.ns===Et.ns&&(Pe.ns=Object.create(Et.ns)),Pe.ns[ce]=z.attribValue}z.attribList.push([z.attribName,z.attribValue])}else z.tag.attributes[z.attribName]=z.attribValue,te(z,"onattribute",{name:z.attribName,value:z.attribValue});z.attribName=z.attribValue=""}}function Le(z,X){if(z.opt.xmlns){var be=z.tag,ce=Ke(z.tagName);be.prefix=ce.prefix,be.local=ce.local,be.uri=be.ns[ce.prefix]||"",be.prefix&&!be.uri&&(Ze(z,"Unbound namespace prefix: "+JSON.stringify(z.tagName)),be.uri=ce.prefix),be.ns&&(z.tags[z.tags.length-1]||z).ns!==be.ns&&Object.keys(be.ns).forEach(function(An){te(z,"onopennamespace",{prefix:An,uri:be.ns[An]})});for(var Et=0,pt=z.attribList.length;Et",z.tagName="",void(z.state=se.SCRIPT);te(z,"onscript",z.script),z.script=""}var X=z.tags.length,be=z.tagName;z.strict||(be=be[z.looseCase]());for(var ce=be;X--&&z.tags[X].name!==ce;)Ze(z,"Unexpected close tag");if(X<0)return Ze(z,"Unmatched closing tag: "+z.tagName),z.textNode+="",void(z.state=se.TEXT);z.tagName=be;for(var Et=z.tags.length;Et-- >X;){var pt=z.tag=z.tags.pop();z.tagName=z.tag.name,te(z,"onclosetag",z.tagName);var pe={};for(var B in pt.ns)pe[B]=pt.ns[B];z.opt.xmlns&&pt.ns!==(z.tags[z.tags.length-1]||z).ns&&Object.keys(pt.ns).forEach(function(k){te(z,"onclosenamespace",{prefix:k,uri:pt.ns[k]})})}0===X&&(z.closedRoot=!0),z.tagName=z.attribValue=z.attribName="",z.attribList.length=0,z.state=se.TEXT}function Oe(z){var ce,X=z.entity,be=X.toLowerCase(),Pe="";return z.ENTITIES[X]?z.ENTITIES[X]:z.ENTITIES[be]?z.ENTITIES[be]:("#"===(X=be).charAt(0)&&("x"===X.charAt(1)?(X=X.slice(2),Pe=(ce=parseInt(X,16)).toString(16)):(X=X.slice(1),Pe=(ce=parseInt(X,10)).toString(10))),X=X.replace(/^0+/,""),isNaN(ce)||Pe.toLowerCase()!==X?(Ze(z,"Invalid character entity"),"&"+z.entity+";"):String.fromCodePoint(ce))}function Ue(z,X){"<"===X?(z.state=se.OPEN_WAKA,z.startTagPosition=z.position):E(X)||(Ze(z,"Non-whitespace before first tag."),z.textNode=X,z.state=se.TEXT)}function qe(z,X){var be="";return X1114111||X(k)!==k)throw RangeError("Invalid code point: "+k);k<=65535?Pe.push(k):Pe.push(55296+((k-=65536)>>10),k%1024+56320),(pe+1===B||Pe.length>ce)&&(O+=z.apply(null,Pe),Pe.length=0)}return O},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Ae,he){(function(W,V){(function(){!function(L,re){"use strict";if(!L.setImmediate){var A,$=1,b={},S=!1,R=L.document,Q=Object.getPrototypeOf&&Object.getPrototypeOf(L);Q=Q&&Q.setTimeout?Q:L,"[object process]"==={}.toString.call(L.process)?A=function(E){W.nextTick(function(){D(E)})}:function(){if(L.postMessage&&!L.importScripts){var E=!0,U=L.onmessage;return L.onmessage=function(){E=!1},L.postMessage("","*"),L.onmessage=U,E}}()?(E="setImmediate$"+Math.random()+"$",U=function(ie){ie.source===L&&"string"==typeof ie.data&&0===ie.data.indexOf(E)&&D(+ie.data.slice(E.length))},L.addEventListener?L.addEventListener("message",U,!1):L.attachEvent("onmessage",U),A=function(ie){L.postMessage(E+ie,"*")}):L.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function(U){D(U.data)},A=function(U){E.port2.postMessage(U)}}():R&&"onreadystatechange"in R.createElement("script")?function(){var E=R.documentElement;A=function(U){var ie=R.createElement("script");ie.onreadystatechange=function(){D(U),ie.onreadystatechange=null,E.removeChild(ie),ie=null},E.appendChild(ie)}}():A=function(E){setTimeout(D,0,E)},Q.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var U=new Array(arguments.length-1),ie=0;ie=0&&(A._idleTimeoutId=setTimeout(function(){A._onTimeout&&A._onTimeout()},v))},he.setImmediate="function"==typeof W?W:function(A){var v=S++,y=!(arguments.length<2)&&$.call(arguments,1);return b[v]=!0,L(function(){b[v]&&(y?A.apply(null,y):A.call(null),he.clearImmediate(v))}),v},he.clearImmediate="function"==typeof V?V:function(A){delete b[A]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Ae,he){(function(W){(function(){function L(re){try{if(!W.localStorage)return!1}catch(b){return!1}var $=W.localStorage[re];return null!=$&&"true"===String($).toLowerCase()}Ae.exports=function(re,$){if(L("noDeprecation"))return re;var b=!1;return function(){if(!b){if(L("throwDeprecation"))throw new Error($);L("traceDeprecation")?console.trace($):console.warn($),b=!0}return re.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Ae,he){"use strict";Ae.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let V=this.head;V;V=V.next)yield V.value}}},{}],92:[function(Y,Ae,he){"use strict";function W(b){var S=this;if(S instanceof W||(S=new W),S.tail=null,S.head=null,S.length=0,b&&"function"==typeof b.forEach)b.forEach(function(v){S.push(v)});else if(arguments.length>0)for(var R=0,A=arguments.length;R1)R=S;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,R=this.head.value}for(var v=0;null!==A;v++)R=b(R,A.value,v),A=A.next;return R},W.prototype.reduceReverse=function(b,S){var R,A=this.tail;if(arguments.length>1)R=S;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,R=this.tail.value}for(var v=this.length-1;null!==A;v--)R=b(R,A.value,v),A=A.prev;return R},W.prototype.toArray=function(){for(var b=new Array(this.length),S=0,R=this.head;null!==R;S++)b[S]=R.value,R=R.next;return b},W.prototype.toArrayReverse=function(){for(var b=new Array(this.length),S=0,R=this.tail;null!==R;S++)b[S]=R.value,R=R.prev;return b},W.prototype.slice=function(b,S){(S=S||this.length)<0&&(S+=this.length),(b=b||0)<0&&(b+=this.length);var R=new W;if(Sthis.length&&(S=this.length);for(var A=0,v=this.head;null!==v&&Athis.length&&(S=this.length);for(var A=this.length,v=this.tail;null!==v&&A>S;A--)v=v.prev;for(;null!==v&&A>b;A--,v=v.prev)R.push(v.value);return R},W.prototype.splice=function(b,S,...R){b>this.length&&(b=this.length-1),b<0&&(b=this.length+b);for(var A=0,v=this.head;null!==v&&A{jt.exports=function(tt,gt){var J=gt.length;if(0!==J){var xt=tt.length;tt.length+=J;for(var ut=0;ut{"use strict";var gt=(()=>{return(xt=gt||(gt={})).typeOfFunction="function",xt.boolTrue=!0,gt;var xt})();function J(xt,ut,Y){if(!Y||typeof Y.value!==gt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+ut+"> is not a method!");return{configurable:gt.boolTrue,get:function(){var Ae=Y.value.bind(this);return Object.defineProperty(this,ut,{value:Ae,configurable:gt.boolTrue,writable:gt.boolTrue}),Ae}}}it.ak=J,it.ZP=J},266:(jt,it,tt)=>{jt.exports={ResizeSensor:tt(835),ElementQueries:tt(845)}},845:function(jt,it,tt){"use strict";var gt,J,xt;"undefined"!=typeof window&&window,J=[tt(835)],void 0!==(xt="function"==typeof(gt=function(ut){var Y=function(){var he,W={},V=[];function L(M){M||(M=document.documentElement);var F=window.getComputedStyle(M,null).fontSize;return parseFloat(F)||16}function $(M,F){var Q=F.split(/\d/),E=Q[Q.length-1];switch(F=parseFloat(F),E){case"px":return F;case"em":return F*L(M);case"rem":return F*L();case"vw":return F*document.documentElement.clientWidth/100;case"vh":return F*document.documentElement.clientHeight/100;case"vmin":case"vmax":var U=document.documentElement.clientWidth/100,ie=document.documentElement.clientHeight/100;return F*(0,Math["vmin"===E?"min":"max"])(U,ie);default:return F}}function b(M,F){this.element=M;var Q,E,U,ie,ue,ee,se,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(Q in U=function(M){if(!M.getBoundingClientRect)return{width:M.offsetWidth,height:M.offsetHeight};var F=M.getBoundingClientRect();return{width:Math.round(F.width),height:Math.round(F.height)}}(this.element),ee={},W[F])!W[F].hasOwnProperty(Q)||(ie=$(this.element,(E=W[F][Q]).value),ue="width"===E.property?U.width:U.height,se="","min"===E.mode&&ue>=ie&&(se+=E.value),"max"===E.mode&&ue<=ie&&(se+=E.value),ee[Te=E.mode+"-"+E.property]||(ee[Te]=""),se&&-1===(" "+ee[Te]+" ").indexOf(" "+se+" ")&&(ee[Te]+=" "+se));for(var te in me)!me.hasOwnProperty(te)||(ee[me[te]]?this.element.setAttribute(me[te],ee[me[te]].substr(1)):this.element.removeAttribute(me[te]))}}function S(M,F){M.elementQueriesSetupInformation||(M.elementQueriesSetupInformation=new b(M,F)),M.elementQueriesSensor||(M.elementQueriesSensor=new ut(M,function(){M.elementQueriesSetupInformation.call()}))}function R(M,F,Q,E){if(void 0===W[M]){W[M]=[];var U=V.length;he.innerHTML+="\n"+M+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+M+" > .resize-sensor {min-width: "+U+"px;}",V.push(M)}W[M].push({mode:F,property:Q,value:E})}function A(M){var F;if(document.querySelectorAll&&(F=M?M.querySelectorAll.bind(M):document.querySelectorAll.bind(document)),!F&&"undefined"!=typeof $$&&(F=$$),!F&&"undefined"!=typeof jQuery&&(F=jQuery),!F)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return F}function y(M){var F=[],Q=[],E=[],U=0,ie=-1,ue=[];for(var ee in M.children)if(M.children.hasOwnProperty(ee)&&M.children[ee].tagName&&"img"===M.children[ee].tagName.toLowerCase()){F.push(M.children[ee]);var se=M.children[ee].getAttribute("min-width")||M.children[ee].getAttribute("data-min-width"),Te=M.children[ee].getAttribute("data-src")||M.children[ee].getAttribute("url");E.push(Te),Q.push({minWidth:se}),se?M.children[ee].style.display="none":(U=F.length-1,M.children[ee].style.display="block")}function te(){var Me,ye=!1;for(Me in F)!F.hasOwnProperty(Me)||Q[Me].minWidth&&M.offsetWidth>Q[Me].minWidth&&(ye=Me);if(ye||(ye=U),ie!==ye)if(ue[ye])F[ie].style.display="none",F[ye].style.display="block",ie=ye;else{var Ve=new Image;Ve.onload=function(){F[ye].src=E[ye],F[ie].style.display="none",F[ye].style.display="block",ue[ye]=!0,ie=ye},Ve.src=E[ye]}else F[ye].src=E[ye]}ie=U,M.resizeSensorInstance=new ut(M,te),te()}var D=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,j=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function I(M){var F,Q,E,U;for(M=M.replace(/'/g,'"');null!==(F=D.exec(M));)for(Q=F[1]+F[3],E=F[2];null!==(U=j.exec(E));)R(Q,U[1],U[2],U[3])}function H(M){var F="";if(M)if("string"==typeof M)(-1!==(M=M.toLowerCase()).indexOf("min-width")||-1!==M.indexOf("max-width"))&&I(M);else for(var Q=0,E=M.length;Q img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",he.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(he),K=!0);for(var F=0,Q=document.styleSheets.length;F{var gt=tt(910),J=tt(369),xt=tt(322);function ut(re,$,b){if(!gt(re))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!re.hasNode($))throw new Error('graphology-shortest-path: the "'+$+'" source node does not exist in the given graph.');if(!re.hasNode(b))throw new Error('graphology-shortest-path: the "'+b+'" target node does not exist in the given graph.');if(($=""+$)==(b=""+b))return[$];var S=re.inboundNeighbors.bind(re),R=re.outboundNeighbors.bind(re),A={},v={};A[$]=null,v[b]=null;var D,j,I,H,K,M,F,Q,y=[$],w=[b],E=!1;e:for(;y.length&&w.length;)if(y.length<=w.length){for(D=y,y=[],K=0,F=D.length;K{jt.exports=function(tt){return null!==tt&&"object"==typeof tt&&"function"==typeof tt.addUndirectedEdgeWithKey&&"function"==typeof tt.dropNode&&"boolean"==typeof tt.multi}},698:function(jt){jt.exports=function(){"use strict";function it(ne){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(de){return typeof de}:function(de){return de&&"function"==typeof Symbol&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de})(ne)}function tt(ne,de){ne.prototype=Object.create(de.prototype),ne.prototype.constructor=ne,J(ne,de)}function gt(ne){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)})(ne)}function J(ne,de){return(J=Object.setPrototypeOf||function(oe,C){return oe.__proto__=C,oe})(ne,de)}function xt(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(ne){return!1}}function ut(ne,de,oe){return(ut=xt()?Reflect.construct:function(C,P,Z){var we=[null];we.push.apply(we,P);var Fe=new(Function.bind.apply(C,we));return Z&&J(Fe,Z.prototype),Fe}).apply(null,arguments)}function Y(ne){var de="function"==typeof Map?new Map:void 0;return(Y=function(oe){if(null===oe||-1===Function.toString.call(oe).indexOf("[native code]"))return oe;if("function"!=typeof oe)throw new TypeError("Super expression must either be null or a function");if(void 0!==de){if(de.has(oe))return de.get(oe);de.set(oe,P)}function P(){return ut(oe,arguments,gt(this).constructor)}return P.prototype=Object.create(oe.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),J(P,oe)})(ne)}function Ae(ne){if(void 0===ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ne}var he=function(){for(var ne=arguments[0],de=1,oe=arguments.length;de0&&we.length>P&&!we.warned){we.warned=!0;var et=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(de)+" listeners added. Use emitter.setMaxListeners() to increase limit");et.name="MaxListenersExceededWarning",et.emitter=ne,et.type=de,et.count=we.length,console&&console.warn&&console.warn(et)}return ne}function M(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F(ne,de,oe){var C={fired:!1,wrapFn:void 0,target:ne,type:de,listener:oe},P=M.bind(C);return P.listener=oe,C.wrapFn=P,P}function Q(ne,de,oe){var C=ne._events;if(void 0===C)return[];var P=C[de];return void 0===P?[]:"function"==typeof P?oe?[P.listener||P]:[P]:oe?function(Z){for(var we=new Array(Z.length),Fe=0;Fe0&&(Z=de[0]),Z instanceof Error)throw Z;var we=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw we.context=Z,we}var Fe=P[ne];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,de);else{var et=Fe.length,Dt=U(Fe,et);for(oe=0;oe=0;Z--)if(oe[Z]===de||oe[Z].listener===de){we=oe[Z].listener,P=Z;break}if(P<0)return this;0===P?oe.shift():function(Fe,et){for(;et+1=0;C--)this.removeListener(ne,de[C]);return this},D.prototype.listeners=function(ne){return Q(this,ne,!0)},D.prototype.rawListeners=function(ne){return Q(this,ne,!1)},D.listenerCount=function(ne,de){return"function"==typeof ne.listenerCount?ne.listenerCount(de):E.call(ne,de)},D.prototype.listenerCount=E,D.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]},ue.prototype.next=function(){if(this.done)return{done:!0};var ne=this._next();return ne.done&&(this.done=!0),ne},"undefined"!=typeof Symbol&&(ue.prototype[Symbol.iterator]=function(){return this}),ue.of=function(){var ne=arguments,de=ne.length,oe=0;return new ue(function(){return oe>=de?{done:!0}:{done:!1,value:ne[oe++]}})},ue.empty=function(){var ne=new ue(null);return ne.done=!0,ne},ue.is=function(ne){return ne instanceof ue||"object"==typeof ne&&null!==ne&&"function"==typeof ne.next};var ee=ue,se=function(ne,de){for(var oe,C=arguments.length>1?de:1/0,P=C!==1/0?new Array(C):[],Z=0;;){if(Z===C)return P;if((oe=ne.next()).done)return Z!==de?P.slice(0,Z):P;P[Z++]=oe.value}},Te=function(ne){function de(oe,C){var P;return(P=ne.call(this)||this).name="GraphError",P.message=oe||"",P.data=C||{},P}return tt(de,ne),de}(Y(Error)),me=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),te=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),ye=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te);function Me(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ve(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function nt(ne,de){this.key=ne,this.attributes=de,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Ze(ne,de,oe,C,P,Z){this.key=de,this.attributes=Z,this.undirected=ne,this.source=C,this.target=P,this.generatedKey=oe}function Je(ne,de,oe,C,P,Z,we){var Fe,et,Dt="out",$e="in";if(de&&(Dt=$e="undirected"),ne.multi){if(void 0===(et=(Fe=Z[Dt])[P])&&(et=new Set,Fe[P]=et),et.add(oe),C===P&&de)return;void 0===(Fe=we[$e])[C]&&(Fe[C]=et)}else{if(Z[Dt][P]=oe,C===P&&de)return;we[$e][C]=oe}}function Ke(ne,de,oe){var C=ne.multi,P=oe.source,Z=oe.target,we=P.key,Fe=Z.key,et=P[de?"undirected":"out"],Dt=de?"undirected":"in";if(Fe in et)if(C){var $e=et[Fe];1===$e.size?(delete et[Fe],delete Z[Dt][we]):$e.delete(oe)}else delete et[Fe];C||delete Z[Dt][we]}Ve.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},nt.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var je=[{name:function(ne){return"get".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes[P]}}},{name:function(ne){return"get".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C){var P;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Z=""+C,we=""+arguments[1];if(!(P=W(this,Z,we,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Z,'" - "').concat(we,'").'))}else if(!(P=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&P.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return P.attributes}}},{name:function(ne){return"has".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes.hasOwnProperty(P)}}},{name:function(ne){return"set".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=W(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"update".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=W(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("function"!=typeof Z)throw new me("Graph.".concat(de,": updater should be a function."));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z(we.attributes[P]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"remove".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return delete Z.attributes[P],this.emit("edgeAttributesUpdated",{key:Z.key,type:"remove",attributes:Z.attributes,name:P}),this}}},{name:function(ne){return"replace".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes=P,this.emit("edgeAttributesUpdated",{key:Z.key,type:"replace",attributes:Z.attributes}),this}}},{name:function(ne){return"merge".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return he(Z.attributes,P),this.emit("edgeAttributesUpdated",{key:Z.key,type:"merge",attributes:Z.attributes,data:P}),this}}}],Le=ee,Ee=function(){var ne,de=arguments,oe=-1;return new Le(function C(){if(!ne){if(++oe>=de.length)return{done:!0};ne=de[oe]}var P=ne.next();return P.done?(ne=null,C()):P})},Oe=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Ue(ne,de){for(var oe in de)ne.push(de[oe].key)}function qe(ne,de){for(var oe in de)de[oe].forEach(function(C){return ne.push(C.key)})}function Be(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)}}function z(ne,de,oe){for(var C in ne)C!==oe&&ne[C].forEach(function(P){return de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function X(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];if(de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey))return!0}return!1}function be(ne,de,oe){var C,P,Z,we,Fe;for(var et in ne)if(et!==oe)for(C=ne[et].values();!0!==(P=C.next()).done;)if(we=(Z=P.value).source,de(Z.key,Z.attributes,we.key,(Fe=Z.target).key,we.attributes,Fe.attributes,Z.undirected,Z.generatedKey))return!0;return!1}function ce(ne,de){var oe=Object.keys(ne),C=oe.length,P=null,Z=0;return new ee(function we(){var Fe;if(P){var et=P.next();if(et.done)return P=null,Z++,we();Fe=et.value}else{if(Z>=C)return{done:!0};var Dt=oe[Z];if(Dt===de)return Z++,we();if((Fe=ne[Dt])instanceof Set)return P=Fe.values(),we();Z++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function Pe(ne,de,oe){var C=de[oe];C&&ne.push(C.key)}function Et(ne,de,oe){var C=de[oe];C&&C.forEach(function(P){return ne.push(P.key)})}function pt(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function pe(ne,de,oe){var C=ne[de];C&&C.forEach(function(P){return oe(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function B(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;return oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function O(ne,de,oe){var C=ne[de];if(C){for(var P,Z,we=C.values();!0!==(P=we.next()).done;)if(oe((Z=P.value).key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes,Z.undirected,Z.generatedKey))return!0;return!1}}function k(ne,de){var oe=ne[de];if(oe instanceof Set){var C=oe.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{done:!1,value:[Z.key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes]}})}return ee.of([oe.key,oe.attributes,oe.source.key,oe.target.key,oe.source.attributes,oe.target.attributes])}function Re(ne,de){if(0===ne.size)return[];if("mixed"===de||de===ne.type)return"function"==typeof Array.from?Array.from(ne._edges.keys()):se(ne._edges.keys(),ne._edges.size);for(var oe,C,Z=new Array("undirected"===de?ne.undirectedSize:ne.directedSize),we="undirected"===de,Fe=ne._edges.values(),et=0;!0!==(oe=Fe.next()).done;)(C=oe.value).undirected===we&&(Z[et++]=C.key);return Z}function Xe(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var Gt=P.source,bt=P.target;oe(P.key,P.attributes,Gt.key,bt.key,Gt.attributes,bt.attributes,P.undirected,P.generatedKey)}}function yt(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var Gt=P.source,bt=P.target;if(oe(P.key,P.attributes,Gt.key,bt.key,Gt.attributes,bt.attributes,P.undirected,P.generatedKey))break}}function It(ne,de){if(0===ne.size)return ee.empty();var oe="mixed"!==de&&de!==ne.type,C="undirected"===de,P=ne._edges.values();return new ee(function(){for(var Z,we;;){if((Z=P.next()).done)return Z;if(we=Z.value,!oe||we.undirected===C)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function An(ne,de,oe,C){var P=[],Z=ne?qe:Ue;return"undirected"!==de&&("out"!==oe&&Z(P,C.in),"in"!==oe&&Z(P,C.out),!oe&&C.directedSelfLoops>0&&P.splice(P.lastIndexOf(C.key),1)),"directed"!==de&&Z(P,C.undirected),P}function Rn(ne,de,oe,C,P){var Z=ne?z:Be;"undirected"!==de&&("out"!==oe&&Z(C.in,P),"in"!==oe&&Z(C.out,P,oe?null:C.key)),"directed"!==de&&Z(C.undirected,P)}function Hn(ne,de,oe,C,P){var Z=ne?be:X;"undirected"!==de&&("out"!==oe&&Z(C.in,P)||"in"!==oe&&Z(C.out,P,oe?null:C.key))||"directed"===de||Z(C.undirected,P)}function yi(ne,de,oe){var C=ee.empty();return"undirected"!==ne&&("out"!==de&&void 0!==oe.in&&(C=Ee(C,ce(oe.in))),"in"!==de&&void 0!==oe.out&&(C=Ee(C,ce(oe.out,de?null:oe.key)))),"directed"!==ne&&void 0!==oe.undirected&&(C=Ee(C,ce(oe.undirected))),C}function ci(ne,de,oe,C,P){var Z=de?Et:Pe,we=[];return"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&Z(we,C.in,P),void 0!==C.out&&"in"!==oe&&Z(we,C.out,P),!oe&&C.directedSelfLoops>0&&we.splice(we.lastIndexOf(C.key),1)),"directed"!==ne&&void 0!==C.undirected&&Z(we,C.undirected,P),we}function Ur(ne,de,oe,C,P,Z){var we=de?pe:pt;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z),C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z)),"directed"!==ne&&void 0!==C.undirected&&we(C.undirected,P,Z)}function Is(ne,de,oe,C,P,Z){var we=de?O:B;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z)||C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z,oe?null:C.key))||"directed"===ne||void 0===C.undirected||we(C.undirected,P,Z)}function as(ne,de,oe,C){var P=ee.empty();return"undirected"!==ne&&(void 0!==oe.in&&"out"!==de&&C in oe.in&&(P=Ee(P,k(oe.in,C))),void 0!==oe.out&&"in"!==de&&C in oe.out&&(P=Ee(P,k(oe.out,C)))),"directed"!==ne&&void 0!==oe.undirected&&C in oe.undirected&&(P=Ee(P,k(oe.undirected,C))),P}var Os=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function zr(ne,de){if(void 0!==de)for(var oe in de)ne.add(oe)}function Va(ne,de,oe){if("mixed"!==ne){if("undirected"===ne)return Object.keys(oe.undirected);if("string"==typeof de)return Object.keys(oe[de])}var C=new Set;return"undirected"!==ne&&("out"!==de&&zr(C,oe.in),"in"!==de&&zr(C,oe.out)),"directed"!==ne&&zr(C,oe.undirected),se(C.values(),C.size)}function wl(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;oe(Fe.key,Fe.attributes)}}function la(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;ne.has(et.key)||(ne.add(et.key),C(et.key,et.attributes))}}function ps(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;if(oe(Fe.key,Fe.attributes))return!0}return!1}function Zt(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;if(!ne.has(et.key)&&(ne.add(et.key),C(et.key,et.attributes)))return!0}return!1}function Ua(ne,de){var oe=Object.keys(de),C=oe.length,P=0;return new ee(function(){if(P>=C)return{done:!0};var Z=de[oe[P++]];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===ne?Z.target:we;return{done:!1,value:[et.key,et.attributes]}})}function rt(ne,de,oe){var C=Object.keys(oe),P=C.length,Z=0;return new ee(function we(){if(Z>=P)return{done:!0};var Fe=oe[C[Z++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var et=Fe.source,$e=et===de?Fe.target:et;return ne.has($e.key)?we():(ne.add($e.key),{done:!1,value:[$e.key,$e.attributes]})})}function ot(ne,de,oe,C,P){var Z=ne._nodes.get(C);if("undirected"!==de){if("out"!==oe&&void 0!==Z.in)for(var we in Z.in)if(we===P)return!0;if("in"!==oe&&void 0!==Z.out)for(var Fe in Z.out)if(Fe===P)return!0}if("directed"!==de&&void 0!==Z.undirected)for(var et in Z.undirected)if(et===P)return!0;return!1}function ke(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,$e=de._nodes.values(),Gt=de.type;!0!==(C=$e.next()).done;){if(P=C.value,"undirected"!==Gt)for(Z in we=P.out)if(et=(Fe=we[Z]).target,Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return;if("directed"!==Gt)for(Z in we=P.undirected)if((et=(Fe=we[Z]).target).key!==Z&&(et=Fe.source),Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return}}function lt(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,$e,Gt,bt=de._nodes.values(),gn=de.type;!0!==(C=bt.next()).done;){if(P=C.value,"undirected"!==gn)for(Z in et=P.out)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if($e=(Dt=Fe.value).target,Gt=oe(P.key,$e.key,P.attributes,$e.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&Gt)return;if("directed"!==gn)for(Z in et=P.undirected)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if(($e=(Dt=Fe.value).target).key!==Z&&($e=Dt.source),Gt=oe(P.key,$e.key,P.attributes,$e.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&Gt)return}}function Qe(ne,de){var oe={key:ne};return re(de.attributes)||(oe.attributes=he({},de.attributes)),oe}function vt(ne,de){var oe={source:de.source.key,target:de.target.key};return de.generatedKey||(oe.key=ne),re(de.attributes)||(oe.attributes=he({},de.attributes)),de.undirected&&(oe.undirected=!0),oe}function St(ne){return L(ne)?"key"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?null:"invalid-attributes":"no-key":"not-object"}function At(ne){return L(ne)?"source"in ne?"target"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?"undirected"in ne&&"boolean"!=typeof ne.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var qt=new Set(["directed","undirected","mixed"]),Bn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ti={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Mn(ne,de,oe){var C=new ne.NodeDataClass(de,oe);return ne._nodes.set(de,C),ne.emit("nodeAdded",{key:de,attributes:oe}),C}function pn(ne,de,oe,C,P,Z,we,Fe){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(Z=""+Z,we=""+we,Fe=Fe||{},!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var et=ne._nodes.get(Z),Dt=ne._nodes.get(we);if(!et)throw new te("Graph.".concat(de,': source node "').concat(Z,'" not found.'));if(!Dt)throw new te("Graph.".concat(de,': target node "').concat(we,'" not found.'));var $e={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator($e)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));if(!ne.multi&&(C?void 0!==et.undirected[we]:void 0!==et.out[we]))throw new ye("Graph.".concat(de,': an edge linking "').concat(Z,'" to "').concat(we,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var Gt=new Ze(C,P,oe,et,Dt,Fe);return ne._edges.set(P,Gt),Z===we?C?(et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(et.undirectedDegree++,Dt.undirectedDegree++):(et.outDegree++,Dt.inDegree++),Je(ne,C,Gt,Z,we,et,Dt),C?ne._undirectedSize++:ne._directedSize++,$e.key=P,ne.emit("edgeAdded",$e),P}function Un(ne,de,oe,C,P,Z,we,Fe,et){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(et){if("function"!=typeof Fe)throw new me("Graph.".concat(de,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Dt;if(Z=""+Z,we=""+we,et&&(Dt=Fe,Fe=void 0),!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var $e,Gt,bt=ne._nodes.get(Z),gn=ne._nodes.get(we);if(!oe&&($e=ne._edges.get(P))){if($e.source.key!==Z||$e.target.key!==we||C&&($e.source.key!==we||$e.target.key!==Z))throw new ye("Graph.".concat(de,': inconsistency detected when attempting to merge the "').concat(P,'" edge with "').concat(Z,'" source & "').concat(we,'" target vs. ("').concat($e.source.key,'", "').concat($e.target.key,'").'));Gt=$e}if(Gt||ne.multi||!bt||(Gt=C?bt.undirected[we]:bt.out[we]),Gt)return(et?Dt:Fe)?(et?(Gt.attributes=Dt(Gt.attributes),ne.emit("edgeAttributesUpdated",{type:"replace",key:Gt.key,attributes:Gt.attributes})):(he(Gt.attributes,Fe),ne.emit("edgeAttributesUpdated",{type:"merge",key:Gt.key,attributes:Gt.attributes,data:Fe})),Gt.key):Gt.key;Fe=Fe||{},et&&Dt&&(Fe=Dt(Fe));var Gr={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(Gr)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));return bt||(bt=Mn(ne,Z,{}),Z===we&&(gn=bt)),gn||(gn=Mn(ne,we,{})),$e=new Ze(C,P,oe,bt,gn,Fe),ne._edges.set(P,$e),Z===we?C?(bt.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(bt.directedSelfLoops++,ne._directedSelfLoopCount++):C?(bt.undirectedDegree++,gn.undirectedDegree++):(bt.outDegree++,gn.inDegree++),Je(ne,C,$e,Z,we,bt,gn),C?ne._undirectedSize++:ne._directedSize++,Gr.key=P,ne.emit("edgeAdded",Gr),P}var ne,En=function(ne){function de(C){var P;if(P=ne.call(this)||this,(C=he({},ti,C)).edgeKeyGenerator&&"function"!=typeof C.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(C.edgeKeyGenerator,'".'));if("boolean"!=typeof C.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(C.multi,'".'));if(!qt.has(C.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(C.type,'".'));if("boolean"!=typeof C.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(C.allowSelfLoops,'".'));var Z,we="mixed"===C.type?Me:"directed"===C.type?Ve:nt;return $(Ae(P),"NodeDataClass",we),$(Ae(P),"_attributes",{}),$(Ae(P),"_nodes",new Map),$(Ae(P),"_edges",new Map),$(Ae(P),"_directedSize",0),$(Ae(P),"_undirectedSize",0),$(Ae(P),"_directedSelfLoopCount",0),$(Ae(P),"_undirectedSelfLoopCount",0),$(Ae(P),"_edgeKeyGenerator",C.edgeKeyGenerator||(Z=0,function(){return Z++})),$(Ae(P),"_options",C),Bn.forEach(function(Fe){return $(Ae(P),Fe,P[Fe])}),b(Ae(P),"order",function(){return P._nodes.size}),b(Ae(P),"size",function(){return P._edges.size}),b(Ae(P),"directedSize",function(){return P._directedSize}),b(Ae(P),"undirectedSize",function(){return P._undirectedSize}),b(Ae(P),"selfLoopCount",function(){return P._directedSelfLoopCount+P._undirectedSelfLoopCount}),b(Ae(P),"directedSelfLoopCount",function(){return P._directedSelfLoopCount}),b(Ae(P),"undirectedSelfLoopCount",function(){return P._undirectedSelfLoopCount}),b(Ae(P),"multi",P._options.multi),b(Ae(P),"type",P._options.type),b(Ae(P),"allowSelfLoops",P._options.allowSelfLoops),b(Ae(P),"implementation",function(){return"graphology"}),P}tt(de,ne);var oe=de.prototype;return oe.hasNode=function(C){return this._nodes.has(""+C)},oe.hasDirectedEdge=function(C,P){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&!we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.out[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasUndirectedEdge=function(C,P){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.undirected[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasEdge=function(C,P){if(1===arguments.length)return this._edges.has(""+C);if(2===arguments.length){P=""+P;var we=this._nodes.get(C=""+C);if(!we)return!1;var Fe=void 0!==we.out&&we.out[P];return Fe||(Fe=void 0!==we.undirected&&we.undirected[P]),!(!Fe||this.multi&&!Fe.size)}throw new me("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.directedEdge=function(C,P){if("undirected"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.directedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.directedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||void 0;return we?we.key:void 0}},oe.undirectedEdge=function(C,P){if("directed"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.undirectedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.undirectedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.undirected&&Z.undirected[P]||void 0;return we?we.key:void 0}},oe.edge=function(C,P){if(this.multi)throw new ye("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");P=""+P;var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.edge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.edge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||Z.undirected&&Z.undirected[P]||void 0;if(we)return we.key},oe.inDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.inDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.inDegree+(P?Z.directedSelfLoops:0)},oe.outDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.outDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.outDegree+(P?Z.directedSelfLoops:0)},oe.directedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.directedDegree: could not find the "'.concat(C,'" node in the graph.'));if("undirected"===this.type)return 0;var we=P?Z.directedSelfLoops:0;return Z.inDegree+we+(Z.outDegree+we)},oe.undirectedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.undirectedDegree: could not find the "'.concat(C,'" node in the graph.'));return"directed"===this.type?0:Z.undirectedDegree+2*(P?Z.undirectedSelfLoops:0)},oe.degree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.degree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.degree: could not find the "'.concat(C,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(P&&(Fe=Z.undirectedSelfLoops),we+=Z.undirectedDegree+2*Fe),"undirected"!==this.type&&(P&&(Fe=Z.directedSelfLoops),we+=Z.inDegree+Z.outDegree+2*Fe),we},oe.source=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.source: could not find the "'.concat(C,'" edge in the graph.'));return P.source.key},oe.target=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.target: could not find the "'.concat(C,'" edge in the graph.'));return P.target.key},oe.extremities=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.extremities: could not find the "'.concat(C,'" edge in the graph.'));return[P.source.key,P.target.key]},oe.opposite=function(C,P){C=""+C;var Z=this._edges.get(P=""+P);if(!Z)throw new te('Graph.opposite: could not find the "'.concat(P,'" edge in the graph.'));var we=Z.source.key,Fe=Z.target.key;if(C!==we&&C!==Fe)throw new te('Graph.opposite: the "'.concat(C,'" node is not attached to the "').concat(P,'" edge (').concat(we,", ").concat(Fe,")."));return C===we?Fe:we},oe.hasExtremity=function(C,P){P=""+P;var Z=this._edges.get(C=""+C);if(!Z)throw new te('Graph.hasExtremity: could not find the "'.concat(C,'" edge in the graph.'));return Z.source.key===P||Z.target.key===P},oe.isUndirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isUndirected: could not find the "'.concat(C,'" edge in the graph.'));return P.undirected},oe.isDirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isDirected: could not find the "'.concat(C,'" edge in the graph.'));return!P.undirected},oe.isSelfLoop=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isSelfLoop: could not find the "'.concat(C,'" edge in the graph.'));return P.source===P.target},oe.hasGeneratedKey=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.hasGeneratedKey: could not find the "'.concat(C,'" edge in the graph.'));return P.generatedKey},oe.addNode=function(C,P){return function(Z,we,Fe){if(Fe&&!L(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},Z._nodes.has(we=""+we))throw new ye('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var et=new Z.NodeDataClass(we,Fe);return Z._nodes.set(we,et),Z.emit("nodeAdded",{key:we,attributes:Fe}),et}(this,C,P).key},oe.mergeNode=function(C,P){if(P&&!L(P))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(P,'"'));P=P||{};var Z=this._nodes.get(C=""+C);return Z?(P&&(he(Z.attributes,P),this.emit("nodeAttributesUpdated",{type:"merge",key:C,attributes:Z.attributes,data:P})),C):(Z=new this.NodeDataClass(C,P),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:P}),C)},oe.updateNode=function(C,P){if(P&&"function"!=typeof P)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(P,'"'));var Z=this._nodes.get(C=""+C);if(Z)return P&&(Z.attributes=P(Z.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:C,attributes:Z.attributes})),C;var Fe=P?P({}):{};return Z=new this.NodeDataClass(C,Fe),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:Fe}),C},oe.dropNode=function(C){var P=this,Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.dropNode: could not find the "'.concat(C,'" node in the graph.'));this.forEachEdge(C,function(we){P.dropEdge(we)}),this._nodes.delete(C),this.emit("nodeDropped",{key:C,attributes:Z.attributes})},oe.dropEdge=function(C){var P;if(arguments.length>1){var Z=""+arguments[0],we=""+arguments[1];if(!(P=W(this,Z,we,this.type)))throw new te('Graph.dropEdge: could not find the "'.concat(Z,'" -> "').concat(we,'" edge in the graph.'))}else if(!(P=this._edges.get(C=""+C)))throw new te('Graph.dropEdge: could not find the "'.concat(C,'" edge in the graph.'));this._edges.delete(P.key);var et=P.source,Dt=P.target,$e=P.attributes,Gt=P.undirected;return et===Dt?Gt?(et.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(et.directedSelfLoops--,this._directedSelfLoopCount--):Gt?(et.undirectedDegree--,Dt.undirectedDegree--):(et.outDegree--,Dt.inDegree--),Ke(this,Gt,P),Gt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:C,attributes:$e,source:et.key,target:Dt.key,undirected:Gt}),this},oe.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},oe.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},oe.getAttribute=function(C){return this._attributes[C]},oe.getAttributes=function(){return this._attributes},oe.hasAttribute=function(C){return this._attributes.hasOwnProperty(C)},oe.setAttribute=function(C,P){return this._attributes[C]=P,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.updateAttribute=function(C,P){if("function"!=typeof P)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[C]=P(this._attributes[C]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.removeAttribute=function(C){return delete this._attributes[C],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:C}),this},oe.replaceAttributes=function(C){if(!L(C))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=C,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},oe.mergeAttributes=function(C){if(!L(C))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,C),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:C}),this},oe.getNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.getNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes[P]},oe.getNodeAttributes=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.getNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));return P.attributes},oe.hasNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes.hasOwnProperty(P)},oe.setNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.setNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return we.attributes[P]=Z,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.updateNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.updateNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof Z)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,et=Z(Fe[P]);return Fe[P]=et,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.removeNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return delete Z.attributes[P],this.emit("nodeAttributesUpdated",{key:C,type:"remove",attributes:Z.attributes,name:P}),this},oe.replaceNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.replaceNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return Z.attributes=P,this.emit("nodeAttributesUpdated",{key:C,type:"replace",attributes:Z.attributes}),this},oe.mergeNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.mergeNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(Z.attributes,P),this.emit("nodeAttributesUpdated",{key:C,type:"merge",attributes:Z.attributes,data:P}),this},oe.updateEachNodeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._nodes.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:P||null})},oe.updateEachEdgeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._edges.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:P||null})},oe.forEach=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?lt(!1,this,C):ke(!1,this,C)},oe.forEachUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?lt(!0,this,C):ke(!0,this,C)},oe.adjacency=function(){return this.multi?(et=(C=this)._nodes.values(),Dt=C.type,$e="outer",Gt=null,new ee(function bt(){var gn;if("outer"===$e)return!0===(gn=et.next()).done?gn:(P=gn.value,$e="directed",bt());if("directed"===$e)return"undirected"===Dt?($e="undirected",bt()):(we=P.out,Z=Object.keys(P.out),Fe=0,$e="inner-directed",bt());if("undirected"===$e){if("directed"===Dt)return $e="outer",bt();we=P.undirected,Z=Object.keys(P.undirected),Fe=0,$e="inner-undirected"}if(!Gt&&Fe>=Z.length)return $e="inner-undirected"===$e?"outer":"undirected",bt();if(!Gt){var gs=Z[Fe++];return Gt=we[gs].values(),bt()}if((gn=Gt.next()).done)return Gt=null,bt();var Gr=gn.value,Gs=Gr.target;return"inner-undirected"===$e&&Gs.key===P.key&&(Gs=Gr.source),{done:!1,value:[P.key,Gs.key,P.attributes,Gs.attributes,Gr.key,Gr.attributes]}})):(El=(bt=this)._nodes.values(),io=bt.type,Rr="outer",new ee(function Rs(){var lc;if("outer"===Rr)return!0===(lc=El.next()).done?lc:(gn=lc.value,Rr="directed",Rs());if("directed"===Rr)return"undirected"===io?(Rr="undirected",Rs()):(Gr=gn.out,gs=Object.keys(gn.out),Gs=0,Rr="inner-directed",Rs());if("undirected"===Rr){if("directed"===io)return Rr="outer",Rs();Gr=gn.undirected,gs=Object.keys(gn.undirected),Gs=0,Rr="inner-undirected"}if(Gs>=gs.length)return Rr="inner-undirected"===Rr?"outer":"undirected",Rs();var bn=gs[Gs++],ro=Gr[bn],Sl=ro.target;return"inner-undirected"===Rr&&Sl.key===gn.key&&(Sl=ro.source),{done:!1,value:[gn.key,Sl.key,gn.attributes,Sl.attributes,ro.key,ro.attributes]}}));var bt,gn,gs,Gr,Gs,El,io,Rr,C,P,Z,we,Fe,et,Dt,$e,Gt},oe.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):se(this._nodes.keys(),this._nodes.size)},oe.forEachNode=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(P,Z){C(Z,P.attributes)})},oe.forEachNodeUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");for(var P,Z,we=this._nodes.values();!0!==(P=we.next())&&!C((Z=P.value).key,Z.attributes););},oe.nodeEntries=function(){var C=this._nodes.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{value:[Z.key,Z.attributes],done:!1}})},oe.exportNode=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.exportNode: could not find the "'.concat(C,'" node in the graph.'));return Qe(C,P)},oe.exportEdge=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.exportEdge: could not find the "'.concat(C,'" edge in the graph.'));return vt(C,P)},oe.export=function(){var C=new Array(this._nodes.size),P=0;this._nodes.forEach(function(we,Fe){C[P++]=Qe(Fe,we)});var Z=new Array(this._edges.size);return P=0,this._edges.forEach(function(we,Fe){Z[P++]=vt(Fe,we)}),{attributes:this.getAttributes(),nodes:C,edges:Z,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},oe.importNode=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=St(C);if(Z){if("not-object"===Z)throw new me('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===Z)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===Z)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=C.key,Fe=C.attributes,et=void 0===Fe?{}:Fe;return P?this.mergeNode(we,et):this.addNode(we,et),this},oe.importEdge=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=At(C);if(Z){if("not-object"===Z)throw new me('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===Z)throw new me("Graph.importEdge: missing souce.");if("no-target"===Z)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===Z)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===Z)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=C.source,Fe=C.target,et=C.attributes,Dt=void 0===et?{}:et,$e=C.undirected,Gt=void 0!==$e&&$e;return"key"in C?(P?Gt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:Gt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,C.key,we,Fe,Dt):(P?Gt?this.mergeUndirectedEdge:this.mergeDirectedEdge:Gt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Dt),this},oe.import=function(C){var P,Z,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V(C))return this.import(C.export(),Fe),this;if(!L(C))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(C.attributes){if(!L(C.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(C.attributes):this.replaceAttributes(C.attributes)}if(C.nodes){if(we=C.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(P=0,Z=we.length;PZ)){var Dt=new Set;Dt.add(P.undirected[et]),P.undirected[et]=Dt,C._nodes.get(et).undirected[Z]=Dt}})),this;var C},oe.clearIndex=function(){return this._nodes.forEach(function(C){void 0!==C.in&&(C.in={},C.out={}),void 0!==C.undirected&&(C.undirected={})}),this},oe.toJSON=function(){return this.export()},oe.toString=function(){return"[object Graph]"},oe.inspect=function(){var C=this,P={};this._nodes.forEach(function(Dt,$e){P[$e]=Dt.attributes});var Z={},we={};this._edges.forEach(function(Dt,$e){var Gt=Dt.undirected?"--":"->",bt="",gn="(".concat(Dt.source.key,")").concat(Gt,"(").concat(Dt.target.key,")");Dt.generatedKey?C.multi&&(void 0===we[gn]?we[gn]=0:we[gn]++,bt+="".concat(we[gn],". ")):bt+="[".concat($e,"]: "),Z[bt+=gn]=Dt.attributes});var Fe={};for(var et in this)this.hasOwnProperty(et)&&!Bn.has(et)&&"function"!=typeof this[et]&&(Fe[et]=this[et]);return Fe.attributes=this._attributes,Fe.nodes=P,Fe.edges=Z,$(Fe,"constructor",this.constructor),Fe},de}(A.exports.EventEmitter);"undefined"!=typeof Symbol&&(En.prototype[Symbol.for("nodejs.util.inspect.custom")]=En.prototype.inspect),[{name:function(ne){return"".concat(ne,"Edge")},generateKey:!0},{name:function(ne){return"".concat(ne,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ne){return"".concat(ne,"EdgeWithKey")}},{name:function(ne){return"".concat(ne,"DirectedEdgeWithKey")},type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ne){["add","merge","update"].forEach(function(de){var oe=ne.name(de),C="add"===de?pn:Un;En.prototype[oe]=ne.generateKey?function(P,Z,we){return C(this,oe,!0,"undirected"===(ne.type||this.type),null,P,Z,we,"update"===de)}:function(P,Z,we,Fe){return C(this,oe,!1,"undirected"===(ne.type||this.type),P,Z,we,Fe,"update"===de)}})}),"undefined"!=typeof Symbol&&(En.prototype[Symbol.iterator]=En.prototype.adjacency),ne=En,je.forEach(function(de){var oe=de.name,C=de.attacher;C(ne,oe("Edge"),"mixed"),C(ne,oe("DirectedEdge"),"directed"),C(ne,oe("UndirectedEdge"),"undirected")}),function(ne){Oe.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe,et){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(!arguments.length)return Re(this,Z);if(1===arguments.length){var Dt=this._nodes.get(Fe=""+Fe);if(void 0===Dt)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return An(this.multi,"mixed"===Z?this.type:Z,we,Dt)}if(2===arguments.length){et=""+et;var $e=this._nodes.get(Fe=""+Fe);if(!$e)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" target node in the graph.'));return ci(Z,this.multi,we,$e,et)}throw new me("Graph.".concat(P,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1);oe.prototype[Fe]=function(et,Dt,$e){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return Xe(this,Z,$e=et);if(2===arguments.length){$e=Dt;var Gt=this._nodes.get(et=""+et);if(void 0===Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Rn(this.multi,"mixed"===Z?this.type:Z,we,Gt,$e)}if(3===arguments.length){Dt=""+Dt;var bt=this._nodes.get(et=""+et);if(!bt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Ur(Z,this.multi,we,bt,Dt,$e)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1)+"Until";oe.prototype[Fe]=function(et,Dt,$e){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return yt(this,Z,$e=et);if(2===arguments.length){$e=Dt;var Gt=this._nodes.get(et=""+et);if(void 0===Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Hn(this.multi,"mixed"===Z?this.type:Z,we,Gt,$e)}if(3===arguments.length){Dt=""+Dt;var bt=this._nodes.get(et=""+et);if(!bt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Is(Z,this.multi,we,bt,Dt,$e)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var Z=C.type,we=C.direction,Fe=C.name.slice(0,-1)+"Entries";oe.prototype[Fe]=function(et,Dt){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return ee.empty();if(!arguments.length)return It(this,Z);if(1===arguments.length){var $e=this._nodes.get(et=""+et);if(!$e)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return yi(Z,we,$e)}if(2===arguments.length){Dt=""+Dt;var Gt=this._nodes.get(et=""+et);if(!Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return as(Z,we,Gt,Dt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ne,de)})}(En),function(ne){Os.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(2===arguments.length){var et=""+arguments[0],Dt=""+arguments[1];if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(P,': could not find the "').concat(Dt,'" node in the graph.'));return ot(this,Z,we,et,Dt)}if(1===arguments.length){var $e=this._nodes.get(Fe=""+Fe);if(void 0===$e)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return Va("mixed"===Z?this.type:Z,we,$e)}throw new me("Graph.".concat(P,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1);ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,$e,Gt,bt){if("mixed"!==Dt){if("undirected"===Dt)return wl(Gt,Gt.undirected,bt);if("string"==typeof $e)return wl(Gt,Gt[$e],bt)}var gn=new Set;"undirected"!==Dt&&("out"!==$e&&la(gn,Gt,Gt.in,bt),"in"!==$e&&la(gn,Gt,Gt.out,bt)),"directed"!==Dt&&la(gn,Gt,Gt.undirected,bt)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1)+"Until";ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,$e,Gt,bt){if("mixed"!==Dt){if("undirected"===Dt)return ps(Gt,Gt.undirected,bt);if("string"==typeof $e)return ps(Gt,Gt[$e],bt)}var gn=new Set;"undirected"!==Dt&&("out"!==$e&&Zt(gn,Gt,Gt.in,bt)||"in"!==$e&&Zt(gn,Gt,Gt.out,bt))||"directed"===Dt||Zt(gn,Gt,Gt.undirected,bt)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var C=de.type,P=de.direction,Z=de.name.slice(0,-1)+"Entries";ne.prototype[Z]=function(we){if("mixed"!==C&&"mixed"!==this.type&&C!==this.type)return ee.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));return function(et,Dt,$e){if("mixed"!==et){if("undirected"===et)return Ua($e,$e.undirected);if("string"==typeof Dt)return Ua($e,$e[Dt])}var Gt=ee.empty(),bt=new Set;return"undirected"!==et&&("out"!==Dt&&(Gt=Ee(Gt,rt(bt,$e,$e.in))),"in"!==Dt&&(Gt=Ee(Gt,rt(bt,$e,$e.out)))),"directed"!==et&&(Gt=Ee(Gt,rt(bt,$e,$e.undirected))),Gt}("mixed"===C?this.type:C,P,Fe)}}(ne,de)})}(En);var Qi=function(ne){function de(oe){var C=he({type:"directed"},oe);if("multi"in C&&!1!==C.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==C.type)throw new me('DirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),Zi=function(ne){function de(oe){var C=he({type:"undirected"},oe);if("multi"in C&&!1!==C.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==C.type)throw new me('UndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),Wn=function(ne){function de(oe){var C=he({multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ne.call(this,C)||this}return tt(de,ne),de}(En),Fi=function(ne){function de(oe){var C=he({type:"directed",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==C.type)throw new me('MultiDirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),ca=function(ne){function de(oe){var C=he({type:"undirected",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==C.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En);function Hr(ne){ne.from=function(de,oe){var C=he({},de.options,oe),P=new ne(C);return P.import(de),P}}return Hr(En),Hr(Qi),Hr(Zi),Hr(Wn),Hr(Fi),Hr(ca),En.Graph=En,En.DirectedGraph=Qi,En.UndirectedGraph=Zi,En.MultiGraph=Wn,En.MultiDirectedGraph=Fi,En.MultiUndirectedGraph=ca,En.InvalidArgumentsGraphError=me,En.NotFoundGraphError=te,En.UsageGraphError=ye,En}()},524:(jt,it,tt)=>{var gt;!function(J,xt,ut,Y){"use strict";var A,Ae=["","webkit","Moz","MS","ms","o"],he=xt.createElement("div"),V=Math.round,L=Math.abs,re=Date.now;function $(_e,xe,He){return setTimeout(D(_e,He),xe)}function b(_e,xe,He){return!!Array.isArray(_e)&&(S(_e,He[xe],He),!0)}function S(_e,xe,He){var mt;if(_e)if(_e.forEach)_e.forEach(xe,He);else if(_e.length!==Y)for(mt=0;mt<_e.length;)xe.call(He,_e[mt],mt,_e),mt++;else for(mt in _e)_e.hasOwnProperty(mt)&&xe.call(He,_e[mt],mt,_e)}function R(_e,xe,He){var mt="DEPRECATED METHOD: "+xe+"\n"+He+" AT \n";return function(){var Ut=new Error("get-stack-trace"),$t=Ut&&Ut.stack?Ut.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ni=J.console&&(J.console.warn||J.console.log);return ni&&ni.call(J.console,mt,$t),_e.apply(this,arguments)}}A="function"!=typeof Object.assign?function(xe){if(xe===Y||null===xe)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(xe),mt=1;mt-1}function Q(_e){return _e.trim().split(/\s+/g)}function E(_e,xe,He){if(_e.indexOf&&!He)return _e.indexOf(xe);for(var mt=0;mt<_e.length;){if(He&&_e[mt][He]==xe||!He&&_e[mt]===xe)return mt;mt++}return-1}function U(_e){return Array.prototype.slice.call(_e,0)}function ie(_e,xe,He){for(var mt=[],Ut=[],$t=0;$t<_e.length;){var ni=xe?_e[$t][xe]:_e[$t];E(Ut,ni)<0&&mt.push(_e[$t]),Ut[$t]=ni,$t++}return He&&(mt=xe?mt.sort(function($r,ms){return $r[xe]>ms[xe]}):mt.sort()),mt}function ue(_e,xe){for(var He,mt,Ut=xe[0].toUpperCase()+xe.slice(1),$t=0;$t1&&!He.firstMultiple?He.firstMultiple=yt(xe):1===Ut&&(He.firstMultiple=!1);var $t=He.firstInput,ni=He.firstMultiple,Nr=ni?ni.center:$t.center,$r=xe.center=It(mt);xe.timeStamp=re(),xe.deltaTime=xe.timeStamp-$t.timeStamp,xe.angle=yi(Nr,$r),xe.distance=Hn(Nr,$r),function(_e,xe){var He=xe.center,mt=_e.offsetDelta||{},Ut=_e.prevDelta||{},$t=_e.prevInput||{};(1===xe.eventType||4===$t.eventType)&&(Ut=_e.prevDelta={x:$t.deltaX||0,y:$t.deltaY||0},mt=_e.offsetDelta={x:He.x,y:He.y}),xe.deltaX=Ut.x+(He.x-mt.x),xe.deltaY=Ut.y+(He.y-mt.y)}(He,xe),xe.offsetDirection=Rn(xe.deltaX,xe.deltaY);var ms=An(xe.deltaTime,xe.deltaX,xe.deltaY);xe.overallVelocityX=ms.x,xe.overallVelocityY=ms.y,xe.overallVelocity=L(ms.x)>L(ms.y)?ms.x:ms.y,xe.scale=ni?function(_e,xe){return Hn(xe[0],xe[1],pt)/Hn(_e[0],_e[1],pt)}(ni.pointers,mt):1,xe.rotation=ni?function(_e,xe){return yi(xe[1],xe[0],pt)+yi(_e[1],_e[0],pt)}(ni.pointers,mt):0,xe.maxPointers=He.prevInput?xe.pointers.length>He.prevInput.maxPointers?xe.pointers.length:He.prevInput.maxPointers:xe.pointers.length,function(_e,xe){var Ut,$t,ni,Nr,He=_e.lastInterval||xe,mt=xe.timeStamp-He.timeStamp;if(8!=xe.eventType&&(mt>25||He.velocity===Y)){var $r=xe.deltaX-He.deltaX,ms=xe.deltaY-He.deltaY,Jn=An(mt,$r,ms);$t=Jn.x,ni=Jn.y,Ut=L(Jn.x)>L(Jn.y)?Jn.x:Jn.y,Nr=Rn($r,ms),_e.lastInterval=xe}else Ut=He.velocity,$t=He.velocityX,ni=He.velocityY,Nr=He.direction;xe.velocity=Ut,xe.velocityX=$t,xe.velocityY=ni,xe.direction=Nr}(He,xe);var Jn=_e.element;M(xe.srcEvent.target,Jn)&&(Jn=xe.srcEvent.target),xe.target=Jn}(_e,He),_e.emit("hammer.input",He),_e.recognize(He),_e.session.prevInput=He}function yt(_e){for(var xe=[],He=0;He<_e.pointers.length;)xe[He]={clientX:V(_e.pointers[He].clientX),clientY:V(_e.pointers[He].clientY)},He++;return{timeStamp:re(),pointers:xe,center:It(xe),deltaX:_e.deltaX,deltaY:_e.deltaY}}function It(_e){var xe=_e.length;if(1===xe)return{x:V(_e[0].clientX),y:V(_e[0].clientY)};for(var He=0,mt=0,Ut=0;Ut=L(xe)?_e<0?2:4:xe<0?8:16}function Hn(_e,xe,He){He||(He=Et);var mt=xe[He[0]]-_e[He[0]],Ut=xe[He[1]]-_e[He[1]];return Math.sqrt(mt*mt+Ut*Ut)}function yi(_e,xe,He){return He||(He=Et),180*Math.atan2(xe[He[1]]-_e[He[1]],xe[He[0]]-_e[He[0]])/Math.PI}pe.prototype={handler:function(){},init:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(Te(this.element),this.evWin,this.domHandler)}};var Is={mousedown:1,mousemove:2,mouseup:4},as="mousedown",Os="mousemove mouseup";function zr(){this.evEl=as,this.evWin=Os,this.pressed=!1,pe.apply(this,arguments)}w(zr,pe,{handler:function(xe){var He=Is[xe.type];1&He&&0===xe.button&&(this.pressed=!0),2&He&&1!==xe.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[xe],changedPointers:[xe],pointerType:Ze,srcEvent:xe}))}});var Va={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},wl={2:Ve,3:"pen",4:Ze,5:"kinect"},la="pointerdown",ps="pointermove pointerup pointercancel";function Zt(){this.evEl=la,this.evWin=ps,pe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}J.MSPointerEvent&&!J.PointerEvent&&(la="MSPointerDown",ps="MSPointerMove MSPointerUp MSPointerCancel"),w(Zt,pe,{handler:function(xe){var He=this.store,mt=!1,Ut=xe.type.toLowerCase().replace("ms",""),$t=Va[Ut],ni=wl[xe.pointerType]||xe.pointerType,Nr=ni==Ve,$r=E(He,xe.pointerId,"pointerId");1&$t&&(0===xe.button||Nr)?$r<0&&(He.push(xe),$r=He.length-1):12&$t&&(mt=!0),!($r<0)&&(He[$r]=xe,this.callback(this.manager,$t,{pointers:He,changedPointers:[xe],pointerType:ni,srcEvent:xe}),mt&&He.splice($r,1))}});var Ua={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",ot="touchstart touchmove touchend touchcancel";function ct(){this.evTarget=rt,this.evWin=ot,this.started=!1,pe.apply(this,arguments)}function fe(_e,xe){var He=U(_e.touches),mt=U(_e.changedTouches);return 12&xe&&(He=ie(He.concat(mt),"identifier",!0)),[He,mt]}w(ct,pe,{handler:function(xe){var He=Ua[xe.type];if(1===He&&(this.started=!0),this.started){var mt=fe.call(this,xe,He);12&He&&mt[0].length-mt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:mt[0],changedPointers:mt[1],pointerType:Ve,srcEvent:xe})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ke="touchstart touchmove touchend touchcancel";function lt(){this.evTarget=ke,this.targetIds={},pe.apply(this,arguments)}function Qe(_e,xe){var He=U(_e.touches),mt=this.targetIds;if(3&xe&&1===He.length)return mt[He[0].identifier]=!0,[He,He];var Ut,$t,ni=U(_e.changedTouches),Nr=[],$r=this.target;if($t=He.filter(function(ms){return M(ms.target,$r)}),1===xe)for(Ut=0;Ut<$t.length;)mt[$t[Ut].identifier]=!0,Ut++;for(Ut=0;Ut-1&&mt.splice($t,1)},2500)}}function ti(_e){for(var xe=_e.srcEvent.clientX,He=_e.srcEvent.clientY,mt=0;mt-1&&this.requireFail.splice(xe,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(_e){return!!this.simultaneous[_e.id]},emit:function(_e){var xe=this,He=this.state;function mt(Ut){xe.manager.emit(Ut,_e)}He<8&&mt(xe.options.event+$e(He)),mt(xe.options.event),_e.additionalEvent&&mt(_e.additionalEvent),He>=8&&mt(xe.options.event+$e(He))},tryEmit:function(_e){if(this.canEmit())return this.emit(_e);this.state=32},canEmit:function(){for(var _e=0;_exe.threshold&&Ut&xe.direction},attrTest:function(_e){return gn.prototype.attrTest.call(this,_e)&&(2&this.state||!(2&this.state)&&this.directionTest(_e))},emit:function(_e){this.pX=_e.deltaX,this.pY=_e.deltaY;var xe=Gt(_e.direction);xe&&(_e.additionalEvent=this.options.event+xe),this._super.emit.call(this,_e)}}),w(Gr,gn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.scale-1)>this.options.threshold||2&this.state)},emit:function(_e){1!==_e.scale&&(_e.additionalEvent=this.options.event+(_e.scale<1?"in":"out")),this._super.emit.call(this,_e)}}),w(Gs,Dt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(_e){var xe=this.options,He=_e.pointers.length===xe.pointers,mt=_e.distancexe.time;if(this._input=_e,!mt||!He||12&_e.eventType&&!Ut)this.reset();else if(1&_e.eventType)this.reset(),this._timer=$(function(){this.state=8,this.tryEmit()},xe.time,this);else if(4&_e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(_e){8===this.state&&(_e&&4&_e.eventType?this.manager.emit(this.options.event+"up",_e):(this._input.timeStamp=re(),this.manager.emit(this.options.event,this._input)))}}),w(El,gn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.rotation)>this.options.threshold||2&this.state)}}),w(io,gn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return gs.prototype.getTouchAction.call(this)},attrTest:function(_e){var He,xe=this.options.direction;return 30&xe?He=_e.overallVelocity:6&xe?He=_e.overallVelocityX:24&xe&&(He=_e.overallVelocityY),this._super.attrTest.call(this,_e)&&xe&_e.offsetDirection&&_e.distance>this.options.threshold&&_e.maxPointers==this.options.pointers&&L(He)>this.options.velocity&&4&_e.eventType},emit:function(_e){var xe=Gt(_e.offsetDirection);xe&&this.manager.emit(this.options.event+xe,_e),this.manager.emit(this.options.event,_e)}}),w(Rr,Dt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Qi]},process:function(_e){var xe=this.options,He=_e.pointers.length===xe.pointers,mt=_e.distance"']/g,ps=RegExp(wl.source),Zt=RegExp(la.source),Ua=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fe=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,lt=RegExp(ke.source),Qe=/^\s+/,vt=/\s/,St=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,At=/\{\n\/\* \[wrapped with (.+)\] \*/,qt=/,? & /,Bn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ti=/[()=,{}\[\]\/\s]/,Mn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Un=/\w*$/,En=/^[-+]0x[0-9a-f]+$/i,Qi=/^0b[01]+$/i,Zi=/^\[object .+?Constructor\]$/,Wn=/^0o[0-7]+$/i,Fi=/^(?:0|[1-9]\d*)$/,ca=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hr=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,de="\\ud800-\\udfff",Z="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",bt="A-Z\\xc0-\\xd6\\xd8-\\xde",gn="\\ufe0e\\ufe0f",gs="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gs="["+de+"]",El="["+gs+"]",io="["+Z+"]",Rr="\\d+",Rs="["+we+"]",lc="["+Fe+"]",bn="[^"+de+gs+Rr+we+Fe+bt+"]",ro="\\ud83c[\\udffb-\\udfff]",ua="[^"+de+"]",nd="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="["+bt+"]",mt="(?:"+lc+"|"+bn+")",Ut="(?:"+xe+"|"+bn+")",$t="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ni="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Nr="(?:"+io+"|"+ro+")?",$r="["+gn+"]?",yx=$r+Nr+"(?:\\u200d(?:"+[ua,nd,_e].join("|")+")"+$r+Nr+")*",id="(?:"+[Rs,nd,_e].join("|")+")"+yx,Wi="(?:"+[ua+io+"?",io,nd,_e,Gs].join("|")+")",Gf=RegExp("['\u2019]","g"),wm=RegExp(io,"g"),hh=RegExp(ro+"(?="+ro+")|"+Wi+yx,"g"),ab=RegExp([xe+"?"+lc+"+"+$t+"(?="+[El,xe,"$"].join("|")+")",Ut+"+"+ni+"(?="+[El,xe+mt,"$"].join("|")+")",xe+"?"+mt+"+"+$t,xe+"+"+ni,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rr,id].join("|"),"g"),vx=RegExp("[\\u200d"+de+Z+gn+"]"),Cl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bx=-1,_n={};_n[It]=_n[An]=_n[Rn]=_n[Hn]=_n[yi]=_n[ci]=_n[Ur]=_n[Is]=_n[as]=!0,_n[Ze]=_n[Je]=_n[Xe]=_n[je]=_n[yt]=_n[Le]=_n[Oe]=_n[Ue]=_n[Be]=_n[z]=_n[be]=_n[Et]=_n[pt]=_n[pe]=_n[k]=!1;var Ji={};Ji[Ze]=Ji[Je]=Ji[Xe]=Ji[yt]=Ji[je]=Ji[Le]=Ji[It]=Ji[An]=Ji[Rn]=Ji[Hn]=Ji[yi]=Ji[Be]=Ji[z]=Ji[be]=Ji[Et]=Ji[pt]=Ji[pe]=Ji[B]=Ji[ci]=Ji[Ur]=Ji[Is]=Ji[as]=!0,Ji[Oe]=Ji[Ue]=Ji[k]=!1;var ln={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},wx=parseFloat,db=parseInt,kt="object"==typeof global&&global&&global.Object===Object&&global,Ns="object"==typeof self&&self&&self.Object===Object&&self,Ii=kt||Ns||Function("return this")(),xl=it&&!it.nodeType&&it,da=xl&&jt&&!jt.nodeType&&jt,bo=da&&da.exports===xl,Em=bo&&kt.process,mr=function(){try{return da&&da.require&&da.require("util").types||Em&&Em.binding&&Em.binding("util")}catch(Tt){}}(),tn=mr&&mr.isArrayBuffer,ii=mr&&mr.isDate,nr=mr&&mr.isMap,so=mr&&mr.isRegExp,cc=mr&&mr.isSet,Qr=mr&&mr.isTypedArray;function Zr(st,Tt,_t){switch(_t.length){case 0:return st.call(Tt);case 1:return st.call(Tt,_t[0]);case 2:return st.call(Tt,_t[0],_t[1]);case 3:return st.call(Tt,_t[0],_t[1],_t[2])}return st.apply(Tt,_t)}function Pr(st,Tt,_t,cn){for(var Cn=-1,Di=null==st?0:st.length;++Cn-1}function ph(st,Tt,_t){for(var cn=-1,Cn=null==st?0:st.length;++cn-1;);return _t}function xx(st,Tt){for(var _t=st.length;_t--&&za(Tt,st[_t],0)>-1;);return _t}function mP(st,Tt){for(var _t=st.length,cn=0;_t--;)st[_t]===Tt&&++cn;return cn}var _P=ko({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),yP=ko({"&":"&","<":"<",">":">",'"':""","'":"'"});function vP(st){return"\\"+ln[st]}function _h(st){return vx.test(st)}function fb(st){var Tt=-1,_t=Array(st.size);return st.forEach(function(cn,Cn){_t[++Tt]=[Cn,cn]}),_t}function Ax(st,Tt){return function(_t){return st(Tt(_t))}}function iu(st,Tt){for(var _t=-1,cn=st.length,Cn=0,Di=[];++_t",""":'"',"'":"'"}),vh=function st(Tt){var u,_t=(Tt=null==Tt?Ii:vh.defaults(Ii.Object(),Tt,vh.pick(Ii,fh))).Array,cn=Tt.Date,Cn=Tt.Error,Di=Tt.Function,Wr=Tt.Math,Bi=Tt.Object,Mm=Tt.RegExp,Im=Tt.String,pa=Tt.TypeError,ir=_t.prototype,ru=Bi.prototype,Wf=Tt["__core-js_shared__"],_r=Di.prototype.toString,ji=ru.hasOwnProperty,xP=0,bh=(u=/[^.]+$/.exec(Wf&&Wf.keys&&Wf.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",$s=ru.toString,Mx=_r.call(Bi),Om=Ii._,cd=Mm("^"+_r.call(ji).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fs=bo?Tt.Buffer:J,Tl=Tt.Symbol,ud=Tt.Uint8Array,mb=Fs?Fs.allocUnsafe:J,ga=Ax(Bi.getPrototypeOf,Bi),Rm=Bi.create,qf=ru.propertyIsEnumerable,Pn=ir.splice,Ix=Tl?Tl.isConcatSpreadable:J,wh=Tl?Tl.iterator:J,su=Tl?Tl.toStringTag:J,Yf=function(){try{var u=wc(Bi,"defineProperty");return u({},"",{}),u}catch(h){}}(),_b=Tt.clearTimeout!==Ii.clearTimeout&&Tt.clearTimeout,Ox=cn&&cn.now!==Ii.Date.now&&cn.now,Rx=Tt.setTimeout!==Ii.setTimeout&&Tt.setTimeout,Bt=Wr.ceil,ui=Wr.floor,Vo=Bi.getOwnPropertySymbols,Jr=Fs?Fs.isBuffer:J,Nm=Tt.isFinite,Eh=ir.join,Ga=Ax(Bi.keys,Bi),Lr=Wr.max,ls=Wr.min,AP=cn.now,Nx=Tt.parseInt,Sh=Wr.random,Kf=ir.reverse,ys=wc(Tt,"DataView"),oo=wc(Tt,"Map"),Xf=wc(Tt,"Promise"),ma=wc(Tt,"Set"),Eo=wc(Tt,"WeakMap"),Ch=wc(Bi,"create"),xh=Eo&&new Eo,dd={},Px=_u(ys),Pm=_u(oo),Fm=_u(Xf),yb=_u(ma),Lm=_u(Eo),Qf=Tl?Tl.prototype:J,hd=Qf?Qf.valueOf:J,Ah=Qf?Qf.toString:J;function Se(u){if(br(u)&&!Tn(u)&&!(u instanceof ri)){if(u instanceof So)return u;if(ji.call(u,"__wrapped__"))return wp(u)}return new So(u)}var ou=function(){function u(){}return function(h){if(!vr(h))return{};if(Rm)return Rm(h);u.prototype=h;var m=new u;return u.prototype=J,m}}();function Th(){}function So(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=J}function ri(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function ao(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function Ls(u,h,m,N,ae,Ce){var ze,Ye=1&h,at=2&h,Rt=4&h;if(m&&(ze=ae?m(u,N,ae,Ce):m(u)),ze!==J)return ze;if(!vr(u))return u;var Nt=Tn(u);if(Nt){if(ze=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&ji.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!Ye)return qs(u,ze)}else{var Vt=Bs(u),en=Vt==Ue||Vt==qe;if(tl(u))return up(u,Ye);if(Vt==be||Vt==Ze||en&&!ae){if(ze=at||en?{}:Hb(u),!Ye)return at?function(u,h){return ba(u,Vb(u),h)}(u,function(u,h){return u&&ba(h,Ks(h),u)}(ze,u)):function(u,h){return ba(u,r_(u),h)}(u,Wx(ze,u))}else{if(!Ji[Vt])return ae?u:{};ze=function(u,h,m){var N=u.constructor;switch(h){case Xe:return fu(u);case je:case Le:return new N(+u);case yt:return function(u,h){var m=h?fu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case It:case An:case Rn:case Hn:case yi:case ci:case Ur:case Is:case as:return Jm(u,m);case Be:return new N;case z:case pe:return new N(u);case Et:return function(u){var h=new u.constructor(u.source,Un.exec(u));return h.lastIndex=u.lastIndex,h}(u);case pt:return new N;case B:return function(u){return hd?Bi(hd.call(u)):{}}(u)}}(u,Vt,Ye)}}Ce||(Ce=new ya);var vn=Ce.get(u);if(vn)return vn;Ce.set(u,ze),fA(u)?u.forEach(function(Fn){ze.add(Ls(Fn,h,m,Fn,u,Ce))}):cA(u)&&u.forEach(function(Fn,ai){ze.set(ai,Ls(Fn,h,m,ai,u,Ce))});var oi=Nt?J:(Rt?at?n_:Nl:at?Ks:Ss)(u);return Ps(oi||u,function(Fn,ai){oi&&(Fn=u[ai=Fn]),Wa(ze,ai,Ls(Fn,h,m,ai,u,Ce))}),ze}function ip(u,h,m){var N=m.length;if(null==u)return!N;for(u=Bi(u);N--;){var ae=m[N],ze=u[ae];if(ze===J&&!(ae in u)||!(0,h[ae])(ze))return!1}return!0}function Ih(u,h,m){if("function"!=typeof u)throw new pa(Ae);return kh(function(){u.apply(J,m)},h)}function fc(u,h,m,N){var ae=-1,Ce=Al,ze=!0,Ye=u.length,at=[],Rt=h.length;if(!Ye)return at;m&&(h=Li(h,jo(m))),N?(Ce=ph,ze=!1):h.length>=200&&(Ce=mh,ze=!1,h=new _a(h));e:for(;++ae-1},Dl.prototype.set=function(u,h){var m=this.__data__,N=pd(m,u);return N<0?(++this.size,m.push([u,h])):m[N][1]=h,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new ao,map:new(oo||Dl),string:new ao}},$a.prototype.delete=function(u){var h=ks(this,u).delete(u);return this.size-=h?1:0,h},$a.prototype.get=function(u){return ks(this,u).get(u)},$a.prototype.has=function(u){return ks(this,u).has(u)},$a.prototype.set=function(u,h){var m=ks(this,u),N=m.size;return m.set(u,h),this.size+=m.size==N?0:1,this},_a.prototype.add=_a.prototype.push=function(u){return this.__data__.set(u,W),this},_a.prototype.has=function(u){return this.__data__.has(u)},ya.prototype.clear=function(){this.__data__=new Dl,this.size=0},ya.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},ya.prototype.get=function(u){return this.__data__.get(u)},ya.prototype.has=function(u){return this.__data__.has(u)},ya.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Dl){var N=m.__data__;if(!oo||N.length<199)return N.push([u,h]),this.size=++m.size,this;m=this.__data__=new $a(N)}return m.set(u,h),this.size=m.size,this};var pc=Xa(Ya),Gm=Xa(rp,!0);function Eb(u,h){var m=!0;return pc(u,function(N,ae,Ce){return m=!!h(N,ae,Ce)}),m}function Oh(u,h,m){for(var N=-1,ae=u.length;++N0&&m(Ye)?h>1?vs(Ye,h-1,m,N,ae):Fr(ae,Ye):N||(ae[ae.length]=Ye)}return ae}var gd=Ob(),md=Ob(!0);function Ya(u,h){return u&&gd(u,h,Ss)}function rp(u,h){return u&&md(u,h,Ss)}function Rh(u,h){return ha(h,function(m){return Xo(u[m])})}function Uo(u,h){for(var m=0,N=(h=yc(h,u)).length;null!=u&&mh}function _d(u,h){return null!=u&&ji.call(u,h)}function yd(u,h){return null!=u&&h in Bi(u)}function lu(u,h,m){for(var N=m?ph:Al,ae=u[0].length,Ce=u.length,ze=Ce,Ye=_t(Ce),at=1/0,Rt=[];ze--;){var Nt=u[ze];ze&&h&&(Nt=Li(Nt,jo(h))),at=ls(Nt.length,at),Ye[ze]=!m&&(h||ae>=120&&Nt.length>=120)?new _a(ze&&Nt):J}Nt=u[0];var Vt=-1,en=Ye[0];e:for(;++Vt=Ye?at:at*("desc"==m[N]?-1:1)}return u.index-h.index}(Ce,ze,m)});_t--;)st[_t]=st[_t].value;return st}(Qx(u,function(Ce,ze,Ye){return{criteria:Li(h,function(Rt){return Rt(Ce)}),index:++N,value:Ce}}))}function Tb(u,h,m){for(var N=-1,ae=h.length,Ce={};++N-1;)Ye!==u&&Pn.call(Ye,at,1),Pn.call(u,at,1);return u}function Ph(u,h){for(var m=u?h.length:0,N=m-1;m--;){var ae=h[m];if(m==N||ae!==Ce){var Ce=ae;Ao(ae)?Pn.call(u,ae,1):uu(u,ae)}}return u}function Ml(u,h){return u+ui(Sh()*(h-u+1))}function op(u,h){var m="";if(!u||h<1||h>Te)return m;do{h%2&&(m+=u),(h=ui(h/2))&&(u+=u)}while(h);return m}function si(u,h){return bp(p1(u,h,Xs),u+"")}function Jx(u){return Vm(Ld(u))}function FP(u,h){var m=Ld(u);return Td(m,au(h,0,m.length))}function ap(u,h,m,N){if(!vr(u))return u;for(var ae=-1,Ce=(h=yc(h,u)).length,ze=Ce-1,Ye=u;null!=Ye&&++aeae?0:ae+h),(m=m>ae?ae:m)<0&&(m+=ae),ae=h>m?0:m-h>>>0,h>>>=0;for(var Ce=_t(ae);++N>>1,ze=u[Ce];null!==ze&&!Qo(ze)&&(m?ze<=h:ze=200){var Rt=h?null:t_(u);if(Rt)return Am(Rt);ze=!1,ae=mh,at=new _a}else at=h?[]:Ye;e:for(;++N=N?u:ws(u,h,m)}var n1=_b||function(u){return Ii.clearTimeout(u)};function up(u,h){if(h)return u.slice();var m=u.length,N=mb?mb(m):new u.constructor(m);return u.copy(N),N}function fu(u){var h=new u.constructor(u.byteLength);return new ud(h).set(new ud(u)),h}function Jm(u,h){var m=h?fu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function vc(u,h){if(u!==h){var m=u!==J,N=null===u,ae=u==u,Ce=Qo(u),ze=h!==J,Ye=null===h,at=h==h,Rt=Qo(h);if(!Ye&&!Rt&&!Ce&&u>h||Ce&&ze&&at&&!Ye&&!Rt||N&&ze&&at||!m&&at||!ae)return 1;if(!N&&!Ce&&!Rt&&u1?m[ae-1]:J,ze=ae>2?m[2]:J;for(Ce=u.length>3&&"function"==typeof Ce?(ae--,Ce):J,ze&&js(m[0],m[1],ze)&&(Ce=ae<3?J:Ce,ae=1),h=Bi(h);++N-1?ae[Ce?h[ze]:ze]:J}}function gu(u){return Qa(function(h){var m=h.length,N=m,ae=So.prototype.thru;for(u&&h.reverse();N--;){var Ce=h[N];if("function"!=typeof Ce)throw new pa(Ae);if(ae&&!ze&&"wrapper"==_p(Ce))var ze=new So([],!0)}for(N=ze?N:m;++N1&&vi.reverse(),Nt&&atYe))return!1;var Rt=Ce.get(u),Nt=Ce.get(h);if(Rt&&Nt)return Rt==h&&Nt==u;var Vt=-1,en=!0,vn=2&m?new _a:J;for(Ce.set(u,h),Ce.set(h,u);++Vt-1&&u%1==0&&u1?"& ":"")+h[N],h=h.join(m>2?", ":" "),u.replace(St,"{\n/* [wrapped with "+h+"] */\n")}(N,function(u,h){return Ps(nt,function(m){var N="_."+m[0];h&m[1]&&!Al(u,N)&&u.push(N)}),u.sort()}(function(u){var h=u.match(At);return h?h[1].split(qt):[]}(N),m)))}function u_(u){var h=0,m=0;return function(){var N=AP(),ae=16-(N-m);if(m=N,ae>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(J,arguments)}}function Td(u,h){var m=-1,N=u.length,ae=N-1;for(h=h===J?N:h;++m1?u[h-1]:J;return m="function"==typeof m?(u.pop(),m):J,j1(u,m)});function b_(u){var h=Se(u);return h.__chain__=!0,h}function Md(u,h){return h(u)}var w_=Qa(function(u){var h=u.length,m=h?u[0]:0,N=this.__wrapped__,ae=function(Ce){return zm(Ce,u)};return!(h>1||this.__actions__.length)&&N instanceof ri&&Ao(m)?((N=N.slice(m,+m+(h?1:0))).__actions__.push({func:Md,args:[ae],thisArg:J}),new So(N,this.__chain__).thru(function(Ce){return h&&!Ce.length&&Ce.push(J),Ce})):this.thru(ae)}),z1=qr(function(u,h,m){ji.call(u,m)?++u[m]:qa(u,m,1)}),$1=Nb(h_),W1=Nb(f_);function x_(u,h){return(Tn(u)?Ps:pc)(u,On(h,3))}function Cp(u,h){return(Tn(u)?rd:Gm)(u,On(h,3))}var Y1=qr(function(u,h,m){ji.call(u,m)?u[m].push(h):qa(u,m,[h])}),h0=si(function(u,h,m){var N=-1,ae="function"==typeof h,Ce=lo(u)?_t(u.length):[];return pc(u,function(ze){Ce[++N]=ae?Zr(h,ze,m):va(ze,h,m)}),Ce}),f0=qr(function(u,h,m){qa(u,m,h)});function Ja(u,h){return(Tn(u)?Li:Qx)(u,On(h,3))}var g0=qr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),Ap=si(function(u,h){if(null==u)return[];var m=h.length;return m>1&&js(u,h[0],h[1])?h=[]:m>2&&js(h[0],h[1],h[2])&&(h=[h[0]]),Nh(u,vs(h,1),[])}),yu=Ox||function(){return Ii.Date.now()};function Tp(u,h,m){return h=m?J:h,Rl(u,H,J,J,J,J,h=u&&null==h?u.length:h)}function T_(u,h){var m;if("function"!=typeof h)throw new pa(Ae);return u=Kn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=J),m}}var zh=si(function(u,h,m){var N=1;if(m.length){var ae=iu(m,Ad(zh));N|=j}return Rl(u,N,h,m,ae)}),Od=si(function(u,h,m){var N=3;if(m.length){var ae=iu(m,Ad(Od));N|=j}return Rl(h,N,u,m,ae)});function E0(u,h,m){var N,ae,Ce,ze,Ye,at,Rt=0,Nt=!1,Vt=!1,en=!0;if("function"!=typeof u)throw new pa(Ae);function vn(Ri){var rl=N,xc=ae;return N=ae=J,Rt=Ri,ze=u.apply(xc,rl)}function Nn(Ri){return Rt=Ri,Ye=kh(ai,h),Nt?vn(Ri):ze}function Fn(Ri){var rl=Ri-at;return at===J||rl>=h||rl<0||Vt&&Ri-Rt>=Ce}function ai(){var Ri=yu();if(Fn(Ri))return vi(Ri);Ye=kh(ai,function(Ri){var nT=h-(Ri-at);return Vt?ls(nT,Ce-(Ri-Rt)):nT}(Ri))}function vi(Ri){return Ye=J,en&&N?vn(Ri):(N=ae=J,ze)}function Zo(){var Ri=yu(),rl=Fn(Ri);if(N=arguments,ae=this,at=Ri,rl){if(Ye===J)return Nn(at);if(Vt)return n1(Ye),Ye=kh(ai,h),vn(at)}return Ye===J&&(Ye=kh(ai,h)),ze}return h=co(h)||0,vr(m)&&(Nt=!!m.leading,Ce=(Vt="maxWait"in m)?Lr(co(m.maxWait)||0,h):Ce,en="trailing"in m?!!m.trailing:en),Zo.cancel=function(){Ye!==J&&n1(Ye),Rt=0,N=at=ae=Ye=J},Zo.flush=function(){return Ye===J?ze:vi(yu())},Zo}var Z1=si(function(u,h){return Ih(u,1,h)}),S0=si(function(u,h,m){return Ih(u,co(h)||0,m)});function Hh(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new pa(Ae);var m=function(){var N=arguments,ae=h?h.apply(this,N):N[0],Ce=m.cache;if(Ce.has(ae))return Ce.get(ae);var ze=u.apply(this,N);return m.cache=Ce.set(ae,ze)||Ce,ze};return m.cache=new(Hh.Cache||$a),m}function I_(u){if("function"!=typeof u)throw new pa(Ae);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}Hh.Cache=$a;var J1=t1(function(u,h){var m=(h=1==h.length&&Tn(h[0])?Li(h[0],jo(On())):Li(vs(h,1),jo(On()))).length;return si(function(N){for(var ae=-1,Ce=ls(N.length,m);++ae=h}),el=qx(function(){return arguments}())?qx:function(u){return br(u)&&ji.call(u,"callee")&&!qf.call(u,"callee")},Tn=_t.isArray,M0=tn?jo(tn):function(u){return br(u)&&bs(u)==Xe};function lo(u){return null!=u&&R_(u.length)&&!Xo(u)}function yr(u){return br(u)&&lo(u)}var tl=Jr||ty,I0=ii?jo(ii):function(u){return br(u)&&bs(u)==Le};function Ea(u){if(!br(u))return!1;var h=bs(u);return h==Oe||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!Op(u)}function Xo(u){if(!vr(u))return!1;var h=bs(u);return h==Ue||h==qe||"[object AsyncFunction]"==h||"[object Proxy]"==h}function Ip(u){return"number"==typeof u&&u==Kn(u)}function R_(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Te}function vr(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function br(u){return null!=u&&"object"==typeof u}var cA=nr?jo(nr):function(u){return br(u)&&Bs(u)==Be};function hA(u){return"number"==typeof u||br(u)&&bs(u)==z}function Op(u){if(!br(u)||bs(u)!=be)return!1;var h=ga(u);if(null===h)return!0;var m=ji.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&_r.call(m)==Mx}var P0=so?jo(so):function(u){return br(u)&&bs(u)==Et},fA=cc?jo(cc):function(u){return br(u)&&Bs(u)==pt};function P_(u){return"string"==typeof u||!Tn(u)&&br(u)&&bs(u)==pe}function Qo(u){return"symbol"==typeof u||br(u)&&bs(u)==B}var Gh=Qr?jo(Qr):function(u){return br(u)&&R_(u.length)&&!!_n[bs(u)]},Ec=pp(Ab),F_=pp(function(u,h){return u<=h});function F0(u){if(!u)return[];if(lo(u))return P_(u)?Ha(u):qs(u);if(wh&&u[wh])return function(st){for(var Tt,_t=[];!(Tt=st.next()).done;)_t.push(Tt.value);return _t}(u[wh]());var h=Bs(u);return(h==Be?fb:h==pt?Am:Ld)(u)}function nl(u){return u?(u=co(u))===se||u===-se?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Kn(u){var h=nl(u),m=h%1;return h==h?m?h-m:h:0}function L_(u){return u?au(Kn(u),0,ye):0}function co(u){if("number"==typeof u)return u;if(Qo(u))return NaN;if(vr(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=vr(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=hb(u);var m=Qi.test(u);return m||Wn.test(u)?db(u.slice(2),m?2:8):En.test(u)?NaN:+u}function L0(u){return ba(u,Ks(u))}function Oi(u){return null==u?"":xo(u)}var pA=Il(function(u,h){if(vp(h)||lo(h))ba(h,Ss(h),u);else for(var m in h)ji.call(h,m)&&Wa(u,m,h[m])}),gA=Il(function(u,h){ba(h,Ks(h),u)}),Rd=Il(function(u,h,m,N){ba(h,Ks(h),u,N)}),mA=Il(function(u,h,m,N){ba(h,Ss(h),u,N)}),k0=Qa(zm),yA=si(function(u,h){u=Bi(u);var m=-1,N=h.length,ae=N>2?h[2]:J;for(ae&&js(h[0],h[1],ae)&&(N=1);++m1),Ce}),ba(u,n_(u),m),N&&(m=Ls(m,7,gp));for(var ae=h.length;ae--;)uu(m,h[ae]);return m}),SA=Qa(function(u,h){return null==u?{}:function(u,h){return Tb(u,h,function(m,N){return Rp(u,N)})}(u,h)});function G0(u,h){if(null==u)return{};var m=Li(n_(u),function(N){return[N]});return h=On(h),Tb(u,m,function(N,ae){return h(N,ae[0])})}var CA=mu(Ss),W0=mu(Ks);function Ld(u){return null==u?[]:xm(u,Ss(u))}var MA=Ol(function(u,h,m){return h=h.toLowerCase(),u+(m?V_(h):h)});function V_(u){return Fp(Oi(u).toLowerCase())}function U_(u){return(u=Oi(u))&&u.replace(ca,_P).replace(wm,"")}var OA=Ol(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),RA=Ol(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),nF=dp("toLowerCase"),kA=Ol(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),G_=Ol(function(u,h,m){return u+(m?" ":"")+Fp(h)}),Z0=Ol(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),Fp=dp("toUpperCase");function Y_(u,h,m){return u=Oi(u),(h=m?J:h)===J?function(st){return Cl.test(st)}(u)?function(st){return st.match(ab)||[]}(u):function(st){return st.match(Bn)||[]}(u):u.match(h)||[]}var K_=si(function(u,h){try{return Zr(u,J,h)}catch(m){return Ea(m)?m:new Cn(m)}}),J0=Qa(function(u,h){return Ps(h,function(m){m=Zn(m),qa(u,m,zh(u[m],u))}),u});function X_(u){return function(){return u}}var rF=gu(),kd=gu(!0);function Xs(u){return u}function vu(u){return Xx("function"==typeof u?u:Ls(u,1))}var Q_=si(function(u,h){return function(m){return va(m,u,h)}}),ew=si(function(u,h){return function(m){return va(u,m,h)}});function Z_(u,h,m){var N=Ss(h),ae=Rh(h,N);null==m&&(!vr(h)||!ae.length&&N.length)&&(m=h,h=u,u=this,ae=Rh(h,Ss(h)));var Ce=!(vr(m)&&"chain"in m&&!m.chain),ze=Xo(u);return Ps(ae,function(Ye){var at=h[Ye];u[Ye]=at,ze&&(u.prototype[Ye]=function(){var Rt=this.__chain__;if(Ce||Rt){var Nt=u(this.__wrapped__),Vt=Nt.__actions__=qs(this.__actions__);return Vt.push({func:at,args:arguments,thisArg:u}),Nt.__chain__=Rt,Nt}return at.apply(u,Fr([this.value()],arguments))})}),u}function J_(){}var GA=hp(Li),$A=hp(Qn),nw=hp(wo);function bu(u){return Wo(u)?Sm(Zn(u)):function(u){return function(h){return Uo(h,u)}}(u)}var WA=Fb(),qA=Fb(!0);function Cc(){return[]}function ty(){return!1}var zn=e_(function(u,h){return u+h},0),ny=xd("ceil"),oF=e_(function(u,h){return u/h},1),Ll=xd("floor"),ow=e_(function(u,h){return u*h},1),aw=xd("round"),lw=e_(function(u,h){return u-h},0);return Se.after=function(u,h){if("function"!=typeof h)throw new pa(Ae);return u=Kn(u),function(){if(--u<1)return h.apply(this,arguments)}},Se.ary=Tp,Se.assign=pA,Se.assignIn=gA,Se.assignInWith=Rd,Se.assignWith=mA,Se.at=k0,Se.before=T_,Se.bind=zh,Se.bindAll=J0,Se.bindKey=Od,Se.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Tn(u)?u:[u]},Se.chain=b_,Se.chunk=function(u,h,m){h=(m?js(u,h,m):h===J)?1:Lr(Kn(h),0);var N=null==u?0:u.length;if(!N||h<1)return[];for(var ae=0,Ce=0,ze=_t(Bt(N/h));aeae?0:ae+m),(N=N===J||N>ae?ae:Kn(N))<0&&(N+=ae),N=m>N?0:L_(N);m>>0)?(u=Oi(u))&&("string"==typeof h||null!=h&&!P0(h))&&!(h=xo(h))&&_h(u)?Ka(Ha(u),0,m):u.split(h,m):[]},Se.spread=function(u,h){if("function"!=typeof u)throw new pa(Ae);return h=null==h?0:Lr(Kn(h),0),si(function(m){var N=m[h],ae=Ka(m,0,h);return N&&Fr(ae,N),Zr(u,this,ae)})},Se.tail=function(u){var h=null==u?0:u.length;return h?ws(u,1,h):[]},Se.take=function(u,h,m){return u&&u.length?ws(u,0,(h=m||h===J?1:Kn(h))<0?0:h):[]},Se.takeRight=function(u,h,m){var N=null==u?0:u.length;return N?ws(u,(h=N-(h=m||h===J?1:Kn(h)))<0?0:h,N):[]},Se.takeRightWhile=function(u,h){return u&&u.length?du(u,On(h,3),!1,!0):[]},Se.takeWhile=function(u,h){return u&&u.length?du(u,On(h,3)):[]},Se.tap=function(u,h){return h(u),u},Se.throttle=function(u,h,m){var N=!0,ae=!0;if("function"!=typeof u)throw new pa(Ae);return vr(m)&&(N="leading"in m?!!m.leading:N,ae="trailing"in m?!!m.trailing:ae),E0(u,h,{leading:N,maxWait:h,trailing:ae})},Se.thru=Md,Se.toArray=F0,Se.toPairs=CA,Se.toPairsIn=W0,Se.toPath=function(u){return Tn(u)?Li(u,Zn):Qo(u)?[u]:qs(qb(Oi(u)))},Se.toPlainObject=L0,Se.transform=function(u,h,m){var N=Tn(u),ae=N||tl(u)||Gh(u);if(h=On(h,4),null==m){var Ce=u&&u.constructor;m=ae?N?new Ce:[]:vr(u)&&Xo(Ce)?ou(ga(u)):{}}return(ae?Ps:Ya)(u,function(ze,Ye,at){return h(m,ze,Ye,at)}),m},Se.unary=function(u){return Tp(u,1)},Se.union=r0,Se.unionBy=L1,Se.unionWith=k1,Se.uniq=function(u){return u&&u.length?mc(u):[]},Se.uniqBy=function(u,h){return u&&u.length?mc(u,On(h,2)):[]},Se.uniqWith=function(u,h){return h="function"==typeof h?h:J,u&&u.length?mc(u,J,h):[]},Se.unset=function(u,h){return null==u||uu(u,h)},Se.unzip=s0,Se.unzipWith=j1,Se.update=function(u,h,m){return null==u?u:lp(u,h,Zm(m))},Se.updateWith=function(u,h,m,N){return N="function"==typeof N?N:J,null==u?u:lp(u,h,Zm(m),N)},Se.values=Ld,Se.valuesIn=function(u){return null==u?[]:xm(u,Ks(u))},Se.without=o0,Se.words=Y_,Se.wrap=function(u,h){return Dp(Zm(h),u)},Se.xor=$P,Se.xorBy=To,Se.xorWith=y_,Se.zip=v_,Se.zipObject=function(u,h){return cp(u||[],h||[],Wa)},Se.zipObjectDeep=function(u,h){return cp(u||[],h||[],ap)},Se.zipWith=Uh,Se.entries=CA,Se.entriesIn=W0,Se.extend=gA,Se.extendWith=Rd,Z_(Se,Se),Se.add=zn,Se.attempt=K_,Se.camelCase=MA,Se.capitalize=V_,Se.ceil=ny,Se.clamp=function(u,h,m){return m===J&&(m=h,h=J),m!==J&&(m=(m=co(m))==m?m:0),h!==J&&(h=(h=co(h))==h?h:0),au(co(u),h,m)},Se.clone=function(u){return Ls(u,4)},Se.cloneDeep=function(u){return Ls(u,5)},Se.cloneDeepWith=function(u,h){return Ls(u,5,h="function"==typeof h?h:J)},Se.cloneWith=function(u,h){return Ls(u,4,h="function"==typeof h?h:J)},Se.conformsTo=function(u,h){return null==h||ip(u,h,Ss(h))},Se.deburr=U_,Se.defaultTo=function(u,h){return null==u||u!=u?h:u},Se.divide=oF,Se.endsWith=function(u,h,m){u=Oi(u),h=xo(h);var N=u.length,ae=m=m===J?N:au(Kn(m),0,N);return(m-=h.length)>=0&&u.slice(m,ae)==h},Se.eq=xn,Se.escape=function(u){return(u=Oi(u))&&Zt.test(u)?u.replace(la,yP):u},Se.escapeRegExp=function(u){return(u=Oi(u))&<.test(u)?u.replace(ke,"\\$&"):u},Se.every=function(u,h,m){var N=Tn(u)?Qn:Eb;return m&&js(u,h,m)&&(h=J),N(u,On(h,3))},Se.find=$1,Se.findIndex=h_,Se.findKey=function(u,h){return gh(u,On(h,3),Ya)},Se.findLast=W1,Se.findLastIndex=f_,Se.findLastKey=function(u,h){return gh(u,On(h,3),rp)},Se.floor=Ll,Se.forEach=x_,Se.forEachRight=Cp,Se.forIn=function(u,h){return null==u?u:gd(u,On(h,3),Ks)},Se.forInRight=function(u,h){return null==u?u:md(u,On(h,3),Ks)},Se.forOwn=function(u,h){return u&&Ya(u,On(h,3))},Se.forOwnRight=function(u,h){return u&&rp(u,On(h,3))},Se.get=qh,Se.gt=Yt,Se.gte=D0,Se.has=function(u,h){return null!=u&&zb(u,h,_d)},Se.hasIn=Rp,Se.head=Kb,Se.identity=Xs,Se.includes=function(u,h,m,N){u=lo(u)?u:Ld(u),m=m&&!N?Kn(m):0;var ae=u.length;return m<0&&(m=Lr(ae+m,0)),P_(u)?m<=ae&&u.indexOf(h,m)>-1:!!ae&&za(u,h,m)>-1},Se.indexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=null==m?0:Kn(m);return ae<0&&(ae=Lr(N+ae,0)),za(u,h,ae)},Se.inRange=function(u,h,m){return h=nl(h),m===J?(m=h,h=0):m=nl(m),function(u,h,m){return u>=ls(h,m)&&u=-Te&&u<=Te},Se.isSet=fA,Se.isString=P_,Se.isSymbol=Qo,Se.isTypedArray=Gh,Se.isUndefined=function(u){return u===J},Se.isWeakMap=function(u){return br(u)&&Bs(u)==k},Se.isWeakSet=function(u){return br(u)&&"[object WeakSet]"==bs(u)},Se.join=function(u,h){return null==u?"":Eh.call(u,h)},Se.kebabCase=OA,Se.last=qo,Se.lastIndexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=N;return m!==J&&(ae=(ae=Kn(m))<0?Lr(N+ae,0):ls(ae,N-1)),h==h?function(st,Tt,_t){for(var cn=_t+1;cn--;)if(st[cn]===Tt)return cn;return cn}(u,h,ae):od(u,uc,ae,!0)},Se.lowerCase=RA,Se.lowerFirst=nF,Se.lt=Ec,Se.lte=F_,Se.max=function(u){return u&&u.length?Oh(u,Xs,zo):J},Se.maxBy=function(u,h){return u&&u.length?Oh(u,On(h,2),zo):J},Se.mean=function(u){return _s(u,Xs)},Se.meanBy=function(u,h){return _s(u,On(h,2))},Se.min=function(u){return u&&u.length?Oh(u,Xs,Ab):J},Se.minBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Ab):J},Se.stubArray=Cc,Se.stubFalse=ty,Se.stubObject=function(){return{}},Se.stubString=function(){return""},Se.stubTrue=function(){return!0},Se.multiply=ow,Se.nth=function(u,h){return u&&u.length?cu(u,Kn(h)):J},Se.noConflict=function(){return Ii._===this&&(Ii._=Om),this},Se.noop=J_,Se.now=yu,Se.pad=function(u,h,m){u=Oi(u);var N=(h=Kn(h))?yh(u):0;if(!h||N>=h)return u;var ae=(h-N)/2;return fp(ui(ae),m)+u+fp(Bt(ae),m)},Se.padEnd=function(u,h,m){u=Oi(u);var N=(h=Kn(h))?yh(u):0;return h&&Nh){var N=u;u=h,h=N}if(m||u%1||h%1){var ae=Sh();return ls(u+ae*(h-u+wx("1e-"+((ae+"").length-1))),h)}return Ml(u,h)},Se.reduce=function(u,h,m){var N=Tn(u)?nu:Bo,ae=arguments.length<3;return N(u,On(h,4),m,ae,pc)},Se.reduceRight=function(u,h,m){var N=Tn(u)?sd:Bo,ae=arguments.length<3;return N(u,On(h,4),m,ae,Gm)},Se.repeat=function(u,h,m){return h=(m?js(u,h,m):h===J)?1:Kn(h),op(Oi(u),h)},Se.replace=function(){var u=arguments,h=Oi(u[0]);return u.length<3?h:h.replace(u[1],u[2])},Se.result=function(u,h,m){var N=-1,ae=(h=yc(h,u)).length;for(ae||(ae=1,u=J);++NTe)return[];var m=ye,N=ls(u,ye);h=On(h),u-=ye;for(var ae=ld(N,h);++m=Ce)return u;var Ye=m-yh(N);if(Ye<1)return N;var at=ze?Ka(ze,0,Ye).join(""):u.slice(0,Ye);if(ae===J)return at+N;if(ze&&(Ye+=at.length-Ye),P0(ae)){if(u.slice(Ye).search(ae)){var Rt,Nt=at;for(ae.global||(ae=Mm(ae.source,Oi(Un.exec(ae))+"g")),ae.lastIndex=0;Rt=ae.exec(Nt);)var Vt=Rt.index;at=at.slice(0,Vt===J?Ye:Vt)}}else if(u.indexOf(xo(ae),Ye)!=Ye){var en=at.lastIndexOf(ae);en>-1&&(at=at.slice(0,en))}return at+N},Se.unescape=function(u){return(u=Oi(u))&&ps.test(u)?u.replace(wl,Dm):u},Se.uniqueId=function(u){var h=++xP;return Oi(u)+h},Se.upperCase=Z0,Se.upperFirst=Fp,Se.each=x_,Se.eachRight=Cp,Se.first=Kb,Z_(Se,function(){var u={};return Ya(Se,function(h,m){ji.call(Se.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),Se.VERSION="4.17.21",Ps(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){Se[u].placeholder=Se}),Ps(["drop","take"],function(u,h){ri.prototype[u]=function(m){m=m===J?1:Lr(Kn(m),0);var N=this.__filtered__&&!h?new ri(this):this.clone();return N.__filtered__?N.__takeCount__=ls(m,N.__takeCount__):N.__views__.push({size:ls(m,ye),type:u+(N.__dir__<0?"Right":"")}),N},ri.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),Ps(["filter","map","takeWhile"],function(u,h){var m=h+1,N=1==m||3==m;ri.prototype[u]=function(ae){var Ce=this.clone();return Ce.__iteratees__.push({iteratee:On(ae,3),type:m}),Ce.__filtered__=Ce.__filtered__||N,Ce}}),Ps(["head","last"],function(u,h){var m="take"+(h?"Right":"");ri.prototype[u]=function(){return this[m](1).value()[0]}}),Ps(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");ri.prototype[u]=function(){return this.__filtered__?new ri(this):this[m](1)}}),ri.prototype.compact=function(){return this.filter(Xs)},ri.prototype.find=function(u){return this.filter(u).head()},ri.prototype.findLast=function(u){return this.reverse().find(u)},ri.prototype.invokeMap=si(function(u,h){return"function"==typeof u?new ri(this):this.map(function(m){return va(m,u,h)})}),ri.prototype.reject=function(u){return this.filter(I_(On(u)))},ri.prototype.slice=function(u,h){u=Kn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new ri(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==J&&(m=(h=Kn(h))<0?m.dropRight(-h):m.take(h-u)),m)},ri.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},ri.prototype.toArray=function(){return this.take(ye)},Ya(ri.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),N=/^(?:head|last)$/.test(h),ae=Se[N?"take"+("last"==h?"Right":""):h],Ce=N||/^find/.test(h);!ae||(Se.prototype[h]=function(){var ze=this.__wrapped__,Ye=N?[1]:arguments,at=ze instanceof ri,Rt=Ye[0],Nt=at||Tn(ze),Vt=function(ai){var vi=ae.apply(Se,Fr([ai],Ye));return N&&en?vi[0]:vi};Nt&&m&&"function"==typeof Rt&&1!=Rt.length&&(at=Nt=!1);var en=this.__chain__,vn=!!this.__actions__.length,Nn=Ce&&!en,oi=at&&!vn;if(!Ce&&Nt){ze=oi?ze:new ri(this);var Fn=u.apply(ze,Ye);return Fn.__actions__.push({func:Md,args:[Vt],thisArg:J}),new So(Fn,en)}return Nn&&oi?u.apply(this,Ye):(Fn=this.thru(Vt),Nn?N?Fn.value()[0]:Fn.value():Fn)})}),Ps(["pop","push","shift","sort","splice","unshift"],function(u){var h=ir[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",N=/^(?:pop|shift)$/.test(u);Se.prototype[u]=function(){var ae=arguments;if(N&&!this.__chain__){var Ce=this.value();return h.apply(Tn(Ce)?Ce:[],ae)}return this[m](function(ze){return h.apply(Tn(ze)?ze:[],ae)})}}),Ya(ri.prototype,function(u,h){var m=Se[h];if(m){var N=m.name+"";ji.call(dd,N)||(dd[N]=[]),dd[N].push({name:h,func:m})}}),dd[bc(J,2).name]=[{name:"wrapper",func:J}],ri.prototype.clone=function(){var u=new ri(this.__wrapped__);return u.__actions__=qs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=qs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=qs(this.__views__),u},ri.prototype.reverse=function(){if(this.__filtered__){var u=new ri(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},ri.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Tn(u),N=h<0,ae=m?u.length:0,Ce=function(u,h,m){for(var N=-1,ae=m.length;++N=this.__values__.length;return{done:u,value:u?J:this.__values__[this.__index__++]}},Se.prototype.plant=function(u){for(var h,m=this;m instanceof Th;){var N=wp(m);N.__index__=0,N.__values__=J,h?ae.__wrapped__=N:h=N;var ae=N;m=m.__wrapped__}return ae.__wrapped__=u,h},Se.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof ri){var h=u;return this.__actions__.length&&(h=new ri(this)),(h=h.reverse()).__actions__.push({func:Md,args:[__],thisArg:J}),new So(h,this.__chain__)}return this.thru(__)},Se.prototype.toJSON=Se.prototype.valueOf=Se.prototype.value=function(){return e1(this.__wrapped__,this.__actions__)},Se.prototype.first=Se.prototype.head,wh&&(Se.prototype[wh]=function(){return this}),Se}();Ii._=vh,(gt=function(){return vh}.call(it,tt,it,jt))!==J&&(jt.exports=gt)}.call(this)},478:function(jt){jt.exports=function(){"use strict";function it(rt,ot){for(var ct=0;ctrt.length)&&(ot=rt.length);for(var ct=0,fe=new Array(ot);ct=rt.length?{done:!0}:{done:!1,value:rt[fe++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var ut={exports:{}};function Y(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}ut.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:Y,changeDefaults:function(rt){ut.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,re={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(ot){return re[ot]};var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function R(rt){return rt.replace(S,function(ot,ct){return"colon"===(ct=ct.toLowerCase())?":":"#"===ct.charAt(0)?"x"===ct.charAt(1)?String.fromCharCode(parseInt(ct.substring(2),16)):String.fromCharCode(+ct.substring(1)):""})}var A=/(^|[^\[])\^/g;var y=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var j={},I=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;function M(rt,ot){j[" "+rt]||(j[" "+rt]=I.test(rt)?rt+"/":U(rt,"/",!0));var ct=-1===(rt=j[" "+rt]).indexOf(":");return"//"===ot.substring(0,2)?ct?ot:rt.replace(H,"$1")+ot:"/"===ot.charAt(0)?ct?ot:rt.replace(K,"$1")+ot:rt+ot}function U(rt,ot,ct){var fe=rt.length;if(0===fe)return"";for(var ve=0;ve1;)1&ot&&(ct+=rt),ot>>=1,rt+=rt;return ct+rt},Te=ut.exports.defaults,me=U,te=function(rt,ot){var fe=rt.replace(/\|/g,function(ke,lt,Qe){for(var vt=!1,St=lt;--St>=0&&"\\"===Qe[St];)vt=!vt;return vt?"|":" |"}).split(/ \|/),ve=0;if(fe.length>ot)fe.splice(ot);else for(;fe.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},ot.code=function(fe){var ve=this.rules.block.code.exec(fe);if(ve){var ke=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:me(ke,"\n")}}},ot.fences=function(fe){var ve=this.rules.block.fences.exec(fe);if(ve){var ke=ve[0],lt=function(rt,ot){var ct=rt.match(/^(\s+)(?:```)/);if(null===ct)return ot;var fe=ct[1];return ot.split("\n").map(function(ve){var ke=ve.match(/^\s+/);return null===ke?ve:ke[0].length>=fe.length?ve.slice(fe.length):ve}).join("\n")}(ke,ve[3]||"");return{type:"code",raw:ke,lang:ve[2]?ve[2].trim():ve[2],text:lt}}},ot.heading=function(fe){var ve=this.rules.block.heading.exec(fe);if(ve){var ke=ve[2].trim();if(/#$/.test(ke)){var lt=me(ke,"#");(this.options.pedantic||!lt||/ $/.test(lt))&&(ke=lt.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:ke}}},ot.nptable=function(fe){var ve=this.rules.block.nptable.exec(fe);if(ve){var ke={type:"table",header:te(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(ke.header.length===ke.align.length){var Qe,lt=ke.align.length;for(Qe=0;Qe ?/gm,"");return{type:"blockquote",raw:ve[0],text:ke}}},ot.list=function(fe){var ve=this.rules.block.list.exec(fe);if(ve){var qt,Bn,ti,Mn,pn,Un,En,Qi,Zi,ke=ve[0],lt=ve[2],Qe=lt.length>1,vt={type:"list",raw:ke,ordered:Qe,start:Qe?+lt.slice(0,-1):"",loose:!1,items:[]},St=ve[0].match(this.rules.block.item),At=!1,Wn=St.length;ti=this.rules.block.listItemStart.exec(St[0]);for(var Fi=0;Fiti[1].length:Mn[1].length>=ti[0].length||Mn[1].length>3){St.splice(Fi,2,St[Fi]+(!this.options.pedantic&&Mn[1].length/i.test(lt[0])&&(ve=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(lt[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(lt[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:lt[0],inLink:ve,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(lt[0]):ye(lt[0]):lt[0]}},ot.link=function(fe){var ve=this.rules.inline.link.exec(fe);if(ve){var ke=ve[2].trim();if(!this.options.pedantic&&/^$/.test(ke))return;var lt=me(ke.slice(0,-1),"\\");if((ke.length-lt.length)%2==0)return}else{var Qe=Me(ve[2],"()");if(Qe>-1){var St=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Qe;ve[2]=ve[2].substring(0,Qe),ve[0]=ve[0].substring(0,St).trim(),ve[3]=""}}var At=ve[2],qt="";if(this.options.pedantic){var Bn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(At);Bn&&(At=Bn[1],qt=Bn[3])}else qt=ve[3]?ve[3].slice(1,-1):"";return At=At.trim(),/^$/.test(ke)?At.slice(1):At.slice(1,-1)),Ve(ve,{href:At&&At.replace(this.rules.inline._escapes,"$1"),title:qt&&qt.replace(this.rules.inline._escapes,"$1")},ve[0])}},ot.reflink=function(fe,ve){var ke;if((ke=this.rules.inline.reflink.exec(fe))||(ke=this.rules.inline.nolink.exec(fe))){var lt=(ke[2]||ke[1]).replace(/\s+/g," ");if(!(lt=ve[lt.toLowerCase()])||!lt.href){var Qe=ke[0].charAt(0);return{type:"text",raw:Qe,text:Qe}}return Ve(ke,lt,ke[0])}},ot.emStrong=function(fe,ve,ke){void 0===ke&&(ke="");var lt=this.rules.inline.emStrong.lDelim.exec(fe);if(lt&&(!lt[3]||!ke.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Qe=lt[1]||lt[2]||"";if(!Qe||Qe&&(""===ke||this.rules.inline.punctuation.exec(ke))){var St,At,vt=lt[0].length-1,qt=vt,Bn=0,ti="*"===lt[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ti.lastIndex=0,ve=ve.slice(-1*fe.length+vt);null!=(lt=ti.exec(ve));)if(St=lt[1]||lt[2]||lt[3]||lt[4]||lt[5]||lt[6]){if(At=St.length,lt[3]||lt[4]){qt+=At;continue}if((lt[5]||lt[6])&&vt%3&&!((vt+At)%3)){Bn+=At;continue}if(!((qt-=At)>0))return At=Math.min(At,At+qt+Bn),Math.min(vt,At)%2?{type:"em",raw:fe.slice(0,vt+lt.index+At+1),text:fe.slice(1,vt+lt.index+At)}:{type:"strong",raw:fe.slice(0,vt+lt.index+At+1),text:fe.slice(2,vt+lt.index+At-1)}}}}},ot.codespan=function(fe){var ve=this.rules.inline.code.exec(fe);if(ve){var ke=ve[2].replace(/\n/g," "),lt=/[^ ]/.test(ke),Qe=/^ /.test(ke)&&/ $/.test(ke);return lt&&Qe&&(ke=ke.substring(1,ke.length-1)),ke=ye(ke,!0),{type:"codespan",raw:ve[0],text:ke}}},ot.br=function(fe){var ve=this.rules.inline.br.exec(fe);if(ve)return{type:"br",raw:ve[0]}},ot.del=function(fe){var ve=this.rules.inline.del.exec(fe);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},ot.autolink=function(fe,ve){var lt,Qe,ke=this.rules.inline.autolink.exec(fe);if(ke)return Qe="@"===ke[2]?"mailto:"+(lt=ye(this.options.mangle?ve(ke[1]):ke[1])):lt=ye(ke[1]),{type:"link",raw:ke[0],text:lt,href:Qe,tokens:[{type:"text",raw:lt,text:lt}]}},ot.url=function(fe,ve){var ke;if(ke=this.rules.inline.url.exec(fe)){var lt,Qe;if("@"===ke[2])Qe="mailto:"+(lt=ye(this.options.mangle?ve(ke[0]):ke[0]));else{var vt;do{vt=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0]}while(vt!==ke[0]);lt=ye(ke[0]),Qe="www."===ke[1]?"http://"+lt:lt}return{type:"link",raw:ke[0],text:lt,href:Qe,tokens:[{type:"text",raw:lt,text:lt}]}}},ot.inlineText=function(fe,ve,ke){var Qe,lt=this.rules.inline.text.exec(fe);if(lt)return Qe=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(lt[0]):ye(lt[0]):lt[0]:ye(this.options.smartypants?ke(lt[0]):lt[0]),{type:"text",raw:lt[0],text:Qe}},rt}(),Je=se_noopTest,Ke=se_edit,je=se_merge,Le={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Je,table:Je,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Le.def=Ke(Le.def).replace("label",Le._label).replace("title",Le._title).getRegex(),Le.bullet=/(?:[*+-]|\d{1,9}[.)])/,Le.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Le.item=Ke(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Ke(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Ke(Le.list).replace(/bull/g,Le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Le.def.source+")").getRegex(),Le._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Le._comment=/|$)/,Le.html=Ke(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Ke(Le._paragraph).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.blockquote=Ke(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=je({},Le),Le.gfm=je({},Le.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Le.gfm.nptable=Ke(Le.gfm.nptable).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.gfm.table=Ke(Le.gfm.table).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.pedantic=je({},Le.normal,{html:Ke("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Je,paragraph:Ke(Le.normal._paragraph).replace("hr",Le.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ee.punctuation=Ke(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ee.escapedEmSt=/\\\*|\\_/g,Ee._comment=Ke(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ee.emStrong.lDelim=Ke(Ee.emStrong.lDelim).replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimAst=Ke(Ee.emStrong.rDelimAst,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimUnd=Ke(Ee.emStrong.rDelimUnd,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ee.autolink=Ke(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Ke(Ee.tag).replace("comment",Ee._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Ke(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Ke(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Ke(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=je({},Ee),Ee.pedantic=je({},Ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ke(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee._label).getRegex(),reflink:Ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=je({},Ee.normal,{escape:Ke(Ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(fe="x"+fe.toString(16)),ot+="&#"+fe+";";return ot}var Pe=function(){function rt(ct){this.tokens=[],this.tokens.links=Object.create(null),this.options=ct||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var fe={block:Be.normal,inline:z.normal};this.options.pedantic?(fe.block=Be.pedantic,fe.inline=z.pedantic):this.options.gfm&&(fe.block=Be.gfm,fe.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=fe}rt.lex=function(fe,ve){return new rt(ve).lex(fe)},rt.lexInline=function(fe,ve){return new rt(ve).inlineTokens(fe)};var ot=rt.prototype;return ot.lex=function(fe){return fe=fe.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(fe,this.tokens,!0),this.inline(this.tokens),this.tokens},ot.blockTokens=function(fe,ve,ke){var Qe,vt,St,At,qt,Bn,lt=this;for(void 0===ve&&(ve=[]),void 0===ke&&(ke=!0),this.options.pedantic&&(fe=fe.replace(/^ +$/gm,""));fe;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Mn){return!!(Qe=Mn.call(lt,fe,ve))&&(fe=fe.substring(Qe.raw.length),ve.push(Qe),!0)}))){if(Qe=this.tokenizer.space(fe)){fe=fe.substring(Qe.raw.length),Qe.type&&ve.push(Qe);continue}if(Qe=this.tokenizer.code(fe)){fe=fe.substring(Qe.raw.length),(At=ve[ve.length-1])&&"paragraph"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe);continue}if(Qe=this.tokenizer.fences(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.heading(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.nptable(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.hr(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.blockquote(fe)){fe=fe.substring(Qe.raw.length),Qe.tokens=this.blockTokens(Qe.text,[],ke),ve.push(Qe);continue}if(Qe=this.tokenizer.list(fe)){for(fe=fe.substring(Qe.raw.length),St=Qe.items.length,vt=0;vt=0&&(Mn=Math.min(Mn,Un))}),Mn<1/0&&Mn>=0&&(qt=fe.substring(0,Mn+1))}(),ke&&(Qe=this.tokenizer.paragraph(qt))){At=ve[ve.length-1],Bn&&"paragraph"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe),Bn=qt.length!==fe.length,fe=fe.substring(Qe.raw.length);continue}if(Qe=this.tokenizer.text(fe)){fe=fe.substring(Qe.raw.length),(At=ve[ve.length-1])&&"text"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe);continue}if(fe){var ti="Infinite loop on byte: "+fe.charCodeAt(0);if(this.options.silent){console.error(ti);break}throw new Error(ti)}}return ve},ot.inline=function(fe){var ve,ke,lt,Qe,vt,St,At=fe.length;for(ve=0;ve0)for(;null!=(Bn=this.tokenizer.rules.inline.reflinkSearch.exec(qt));)pn.includes(Bn[0].slice(Bn[0].lastIndexOf("[")+1,-1))&&(qt=qt.slice(0,Bn.index)+"["+X("a",Bn[0].length-2)+"]"+qt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(Bn=this.tokenizer.rules.inline.blockSkip.exec(qt));)qt=qt.slice(0,Bn.index)+"["+X("a",Bn[0].length-2)+"]"+qt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(Bn=this.tokenizer.rules.inline.escapedEmSt.exec(qt));)qt=qt.slice(0,Bn.index)+"++"+qt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;fe;)if(ti||(Mn=""),ti=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(En){return!!(vt=En.call(Qe,fe,ve))&&(fe=fe.substring(vt.raw.length),ve.push(vt),!0)}))){if(vt=this.tokenizer.escape(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.tag(fe,ke,lt)){fe=fe.substring(vt.raw.length),ke=vt.inLink,lt=vt.inRawBlock,(St=ve[ve.length-1])&&"text"===vt.type&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.link(fe)){fe=fe.substring(vt.raw.length),"link"===vt.type&&(vt.tokens=this.inlineTokens(vt.text,[],!0,lt)),ve.push(vt);continue}if(vt=this.tokenizer.reflink(fe,this.tokens.links)){fe=fe.substring(vt.raw.length),St=ve[ve.length-1],"link"===vt.type?(vt.tokens=this.inlineTokens(vt.text,[],!0,lt),ve.push(vt)):St&&"text"===vt.type&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.emStrong(fe,qt,Mn)){fe=fe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,lt),ve.push(vt);continue}if(vt=this.tokenizer.codespan(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.br(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.del(fe)){fe=fe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,lt),ve.push(vt);continue}if(vt=this.tokenizer.autolink(fe,ce)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(!ke&&(vt=this.tokenizer.url(fe,ce))){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(At=fe,this.options.extensions&&this.options.extensions.startInline&&function(){var En=1/0,Qi=fe.slice(1),Zi=void 0;Qe.options.extensions.startInline.forEach(function(Wn){"number"==typeof(Zi=Wn.call(this,Qi))&&Zi>=0&&(En=Math.min(En,Zi))}),En<1/0&&En>=0&&(At=fe.substring(0,En+1))}(),vt=this.tokenizer.inlineText(At,lt,be)){fe=fe.substring(vt.raw.length),"_"!==vt.raw.slice(-1)&&(Mn=vt.raw.slice(-1)),ti=!0,(St=ve[ve.length-1])&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(fe){var Un="Infinite loop on byte: "+fe.charCodeAt(0);if(this.options.silent){console.error(Un);break}throw new Error(Un)}}return ve},function(rt,ot,ct){ot&&it(rt.prototype,ot),ct&&it(rt,ct)}(rt,null,[{key:"rules",get:function(){return{block:Be,inline:z}}}]),rt}(),Et=ut.exports.defaults,pt=se_cleanUrl,pe=se_escape,B=function(){function rt(ct){this.options=ct||Et}var ot=rt.prototype;return ot.code=function(fe,ve,ke){var lt=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Qe=this.options.highlight(fe,lt);null!=Qe&&Qe!==fe&&(ke=!0,fe=Qe)}return fe=fe.replace(/\n$/,"")+"\n",lt?'
    '+(ke?fe:pe(fe,!0))+"
    \n":"
    "+(ke?fe:pe(fe,!0))+"
    \n"},ot.blockquote=function(fe){return"
    \n"+fe+"
    \n"},ot.html=function(fe){return fe},ot.heading=function(fe,ve,ke,lt){return this.options.headerIds?"'+fe+"\n":""+fe+"\n"},ot.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},ot.list=function(fe,ve,ke){var lt=ve?"ol":"ul";return"<"+lt+(ve&&1!==ke?' start="'+ke+'"':"")+">\n"+fe+"\n"},ot.listitem=function(fe){return"
  • "+fe+"
  • \n"},ot.checkbox=function(fe){return" "},ot.paragraph=function(fe){return"

    "+fe+"

    \n"},ot.table=function(fe,ve){return ve&&(ve=""+ve+""),"\n\n"+fe+"\n"+ve+"
    \n"},ot.tablerow=function(fe){return"\n"+fe+"\n"},ot.tablecell=function(fe,ve){var ke=ve.header?"th":"td";return(ve.align?"<"+ke+' align="'+ve.align+'">':"<"+ke+">")+fe+"\n"},ot.strong=function(fe){return""+fe+""},ot.em=function(fe){return""+fe+""},ot.codespan=function(fe){return""+fe+""},ot.br=function(){return this.options.xhtml?"
    ":"
    "},ot.del=function(fe){return""+fe+""},ot.link=function(fe,ve,ke){if(null===(fe=pt(this.options.sanitize,this.options.baseUrl,fe)))return ke;var lt='"+ke+""},ot.image=function(fe,ve,ke){if(null===(fe=pt(this.options.sanitize,this.options.baseUrl,fe)))return ke;var lt=''+ke+'":">")},ot.text=function(fe){return fe},rt}(),O=function(){function rt(){}var ot=rt.prototype;return ot.strong=function(fe){return fe},ot.em=function(fe){return fe},ot.codespan=function(fe){return fe},ot.del=function(fe){return fe},ot.html=function(fe){return fe},ot.text=function(fe){return fe},ot.link=function(fe,ve,ke){return""+ke},ot.image=function(fe,ve,ke){return""+ke},ot.br=function(){return""},rt}(),k=function(){function rt(){this.seen={}}var ot=rt.prototype;return ot.serialize=function(fe){return fe.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ot.getNextSafeSlug=function(fe,ve){var ke=fe,lt=0;if(this.seen.hasOwnProperty(ke)){lt=this.seen[fe];do{ke=fe+"-"+ ++lt}while(this.seen.hasOwnProperty(ke))}return ve||(this.seen[fe]=lt,this.seen[ke]=0),ke},ot.slug=function(fe,ve){void 0===ve&&(ve={});var ke=this.serialize(fe);return this.getNextSafeSlug(ke,ve.dryrun)},rt}(),Re=B,Xe=O,yt=k,It=ut.exports.defaults,An=se_unescape,Hn=Pe,yi=function(){function rt(ct){this.options=ct||It,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new yt}rt.parse=function(fe,ve){return new rt(ve).parse(fe)},rt.parseInline=function(fe,ve){return new rt(ve).parseInline(fe)};var ot=rt.prototype;return ot.parse=function(fe,ve){void 0===ve&&(ve=!0);var lt,Qe,vt,St,At,qt,Bn,ti,Mn,pn,Un,En,Qi,Zi,Wn,Fi,ca,Hr,ne,ke="",de=fe.length;for(lt=0;lt0&&"text"===Wn.tokens[0].type?(Wn.tokens[0].text=Hr+" "+Wn.tokens[0].text,Wn.tokens[0].tokens&&Wn.tokens[0].tokens.length>0&&"text"===Wn.tokens[0].tokens[0].type&&(Wn.tokens[0].tokens[0].text=Hr+" "+Wn.tokens[0].tokens[0].text)):Wn.tokens.unshift({type:"text",text:Hr}):Zi+=Hr),Zi+=this.parse(Wn.tokens,Qi),Mn+=this.renderer.listitem(Zi,ca,Fi);ke+=this.renderer.list(Mn,Un,En);continue;case"html":ke+=this.renderer.html(pn.text);continue;case"paragraph":ke+=this.renderer.paragraph(this.parseInline(pn.tokens));continue;case"text":for(Mn=pn.tokens?this.parseInline(pn.tokens):pn.text;lt+1An error occurred:

    "+Va(vt.message+"",!0)+"
    ";throw vt}}return Zt.options=Zt.setOptions=function(rt){return Os(Zt.defaults,rt),la(Zt.defaults),Zt},Zt.getDefaults=wl,Zt.defaults=ps,Zt.use=function(){for(var rt=this,ot=arguments.length,ct=new Array(ot),fe=0;feAn error occurred:

    "+Va(fe.message+"",!0)+"
    ";throw fe}},Zt.Parser=yi,Zt.parser=yi.parse,Zt.Renderer=Ur,Zt.TextRenderer=Is,Zt.Lexer=Hn,Zt.lexer=Hn.lex,Zt.Tokenizer=ci,Zt.Slugger=as,Zt.parse=Zt,Zt}()},369:(jt,it,tt)=>{var gt=tt(284),J=tt(830);function xt(){this.clear()}xt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},xt.prototype.enqueue=function(ut){return this.items.push(ut),++this.size},xt.prototype.dequeue=function(){if(this.size){var ut=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,ut}},xt.prototype.peek=function(){if(this.size)return this.items[this.offset]},xt.prototype.forEach=function(ut,Y){Y=arguments.length>1?Y:this;for(var Ae=this.offset,he=0,W=this.items.length;Ae=ut.length)return{done:!0};var Ae=ut[Y];return Y++,{value:Ae,done:!1}})},xt.prototype.entries=function(){var ut=this.items,Y=this.offset,Ae=0;return new gt(function(){if(Y>=ut.length)return{done:!0};var he=ut[Y];return Y++,{value:[Ae++,he],done:!1}})},"undefined"!=typeof Symbol&&(xt.prototype[Symbol.iterator]=xt.prototype.values),xt.prototype.toString=function(){return this.toArray().join(",")},xt.prototype.toJSON=function(){return this.toArray()},xt.prototype.inspect=function(){var ut=this.toArray();return Object.defineProperty(ut,"constructor",{value:xt,enumerable:!1}),ut},"undefined"!=typeof Symbol&&(xt.prototype[Symbol.for("nodejs.util.inspect.custom")]=xt.prototype.inspect),xt.from=function(ut){var Y=new xt;return J(ut,function(Ae){Y.enqueue(Ae)}),Y},xt.of=function(){return xt.from(arguments)},jt.exports=xt},830:jt=>{var it="undefined"!=typeof ArrayBuffer,tt="undefined"!=typeof Symbol;function gt(J,xt){var ut,Y,Ae,he,W;if(!J)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof xt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(J)||it&&ArrayBuffer.isView(J)||"string"==typeof J||"[object Arguments]"===J.toString())for(Ae=0,he=J.length;Ae{function it(tt){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:tt}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var tt=this._next();return tt.done&&(this.done=!0),tt},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var tt=arguments,gt=tt.length,J=0;return new it(function(){return J>=gt?{done:!0}:{done:!1,value:tt[J++]}})},it.empty=function(){var tt=new it(null);return tt.done=!0,tt},it.is=function(tt){return tt instanceof it||"object"==typeof tt&&null!==tt&&"function"==typeof tt.next},jt.exports=it},310:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==J.window.orientation},it.default=function(he){if(!he&&!(0,xt.default)())return"Node";if((0,ut.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},V=he||W.userAgent||"";if(V.indexOf("Edge")>-1)return"Edge";var L=-1!==V.indexOf("MSIE "),re=-1!==V.indexOf("Trident/");return L||re?"IE":J.window.chrome?"Chrome":J.window.safari?"Safari":J.window.mozInnerScreenX?"Firefox":"Unknown"};var J=tt(151),xt=gt(tt(602)),ut=gt(tt(344))},151:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var J=gt(tt(321)),xt={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&process};it.self=xt.self||xt.window||xt.global,it.window=xt.window||xt.self||xt.global,it.global=xt.global||xt.self||xt.window,it.document=xt.document||{},it.process=xt.process||{};var V=console;it.console=V},761:(jt,it,tt)=>{"use strict";var J=tt(948),xt=tt(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return ut.global}}),Object.defineProperty(it,"jU",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Ae.default}});var ut=tt(151),Y=V(tt(602)),Ae=V(tt(310));J(tt(344));function W(L){if("function"!=typeof WeakMap)return null;var re=new WeakMap,$=new WeakMap;return(W=function(S){return S?$:re})(L)}function V(L,re){if(!re&&L&&L.__esModule)return L;if(null===L||"object"!==xt(L)&&"function"!=typeof L)return{default:L};var $=W(re);if($&&$.has(L))return $.get(L);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in L)if("default"!==R&&Object.prototype.hasOwnProperty.call(L,R)){var A=S?Object.getOwnPropertyDescriptor(L,R):null;A&&(A.get||A.set)?Object.defineProperty(b,R,A):b[R]=L[R]}return b.default=L,$&&$.set(L,b),b}},602:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=ut,it.isBrowserMainThread=function(){return ut()&&"undefined"!=typeof document};var J=gt(tt(321)),xt=gt(tt(344));function ut(){return!("object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,xt.default)()}},344:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(ut){if("undefined"!=typeof window&&"object"===(0,J.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,J.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,J.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Ae=ut||Y;return!!(Ae&&Ae.indexOf("Electron")>=0)};var J=gt(tt(321))},991:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),Object.defineProperty(xt,Ae,{enumerable:!0,get:function(){return ut[Y]}})}:function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),xt[Ae]=ut[Y]}),J=this&&this.__exportStar||function(xt,ut){for(var Y in xt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(ut,Y)&>(ut,xt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(180),it),J(tt(103),it),J(tt(965),it),J(tt(595),it),J(tt(417),it),J(tt(451),it),J(tt(735),it)},180:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(J){this.termType="BlankNode",this.value=J}equals(J){return!!J&&"BlankNode"===J.termType&&J.value===this.value}}},103:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const gt=tt(180),J=tt(965),xt=tt(595),ut=tt(417),Y=tt(451),Ae=tt(735);let he=0;it.DataFactory=class{constructor(L){this.blankNodeCounter=0,this.blankNodePrefix=(L=L||{}).blankNodePrefix||`df_${he++}_`}namedNode(L){return new ut.NamedNode(L)}blankNode(L){return new gt.BlankNode(L||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(L,re){return new xt.Literal(L,re)}variable(L){return new Ae.Variable(L)}defaultGraph(){return J.DefaultGraph.INSTANCE}quad(L,re,$,b){return new Y.Quad(L,re,$,b||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(xt.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}}},965:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class tt{constructor(){this.termType="DefaultGraph",this.value=""}equals(J){return!!J&&"DefaultGraph"===J.termType}}it.DefaultGraph=tt,tt.INSTANCE=new tt},595:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const gt=tt(417);class J{constructor(ut,Y){this.termType="Literal",this.value=ut,"string"==typeof Y?(this.language=Y,this.datatype=J.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=J.XSD_STRING)}equals(ut){return!!ut&&"Literal"===ut.termType&&ut.value===this.value&&ut.language===this.language&&ut.datatype.equals(this.datatype)}}it.Literal=J,J.RDF_LANGUAGE_STRING=new gt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),J.XSD_STRING=new gt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(J){this.termType="NamedNode",this.value=J}equals(J){return!!J&&"NamedNode"===J.termType&&J.value===this.value}}},451:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(J,xt,ut,Y){this.termType="Quad",this.value="",this.subject=J,this.predicate=xt,this.object=ut,this.graph=Y}equals(J){return!!J&&("Quad"===J.termType||!J.termType)&&this.subject.equals(J.subject)&&this.predicate.equals(J.predicate)&&this.object.equals(J.object)&&this.graph.equals(J.graph)}}},735:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(J){this.termType="Variable",this.value=J}equals(J){return!!J&&"Variable"===J.termType&&J.value===this.value}}},609:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(b,S,R,A){void 0===A&&(A=R),Object.defineProperty(b,A,{enumerable:!0,get:function(){return S[R]}})}:function(b,S,R,A){void 0===A&&(A=R),b[A]=S[R]}),J=this&&this.__exportStar||function(b,S){for(var R in b)"default"!==R&&!Object.prototype.hasOwnProperty.call(S,R)&>(S,b,R)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const xt=tt(991),ut=tt(938),Y=tt(60);J(tt(938),it),J(tt(871),it),J(tt(60),it);const Ae=new xt.DataFactory,he=new Y.Translator;function W(b,S){return he.fromRdf(b,S)}he.registerHandler(new ut.TypeHandlerString,ut.TypeHandlerString.TYPES.map(b=>Ae.namedNode(b)),["string"]),he.registerHandler(new ut.TypeHandlerBoolean,[ut.TypeHandlerBoolean.TYPE].map(b=>Ae.namedNode(b)),["boolean"]),he.registerHandler(new ut.TypeHandlerNumberDouble,ut.TypeHandlerNumberDouble.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new ut.TypeHandlerNumberInteger,ut.TypeHandlerNumberInteger.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new ut.TypeHandlerDate,ut.TypeHandlerDate.TYPES.map(b=>Ae.namedNode(b)),["object"]),it.fromRdf=W,it.toRdf=function(b,S){return S&&"namedNode"in S&&(S={dataFactory:S}),(S=S||{})&&!S.dataFactory&&(S.dataFactory=Ae),he.toRdf(b,S)},it.getTermRaw=function(b,S){return"Literal"===b.termType?W(b,S):b.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Translator=void 0,it.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(J){throw new Error(`Invalid RDF ${J.datatype.value} value: '${J.value}'`)}registerHandler(J,xt,ut){for(const Y of xt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=J;for(const Y of ut){let Ae=this.toRdfHandlers[Y];Ae||(this.toRdfHandlers[Y]=Ae=[]),Ae.push(J)}}fromRdf(J,xt){const ut=this.fromRdfHandlers[J.datatype.value];return ut?ut.fromRdf(J,xt):J.value}toRdf(J,xt){const ut=this.toRdfHandlers[typeof J];if(ut)for(const Y of ut){const Ae=Y.toRdf(J,xt);if(Ae)return Ae}throw new Error(`Invalid JavaScript value: '${J}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const gt=tt(60);class J{fromRdf(ut,Y){switch(ut.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&>.Translator.incorrectRdfDataType(ut),!1}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Ae.literal(ut?"true":"false",Y||Ae.namedNode(J.TYPE))}}it.TypeHandlerBoolean=J,J.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const gt=tt(60);class J{fromRdf(ut,Y){switch(Y&&!ut.value.match(J.VALIDATORS[ut.datatype.value.substr(33,ut.datatype.value.length)])&>.Translator.incorrectRdfDataType(ut),ut.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(ut.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const Ae=ut.value.split("-");return new Date(0,parseInt(Ae[0],10)-1,parseInt(Ae[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(ut.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(ut.value+"-01");default:return new Date(ut.value)}}toRdf(ut,{datatype:Y,dataFactory:Ae}){if(Y=Y||Ae.namedNode(J.TYPES[0]),!(ut instanceof Date))return null;const he=ut;let W;switch(Y.value){case"http://www.w3.org/2001/XMLSchema#gDay":W=String(he.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":W=he.getUTCMonth()+1+"-"+he.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":W=String(he.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":W=he.getUTCFullYear()+"-"+(he.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":W=he.toISOString().replace(/T.*$/,"");break;default:W=he.toISOString()}return Ae.literal(W,Y)}}it.TypeHandlerDate=J,J.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"],J.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]$/}},554:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const gt=tt(60);class J{fromRdf(ut,Y){const Ae=parseFloat(ut.value);return Y&&isNaN(Ae)&>.Translator.incorrectRdfDataType(ut),Ae}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Y=Y||Ae.namedNode(J.TYPES[0]),isNaN(ut)?Ae.literal("NaN",Y):isFinite(ut)?ut%1==0?null:Ae.literal(ut.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Ae.literal(ut>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=J,J.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const gt=tt(60);class J{fromRdf(ut,Y){const Ae=parseInt(ut.value,10);return Y&&(isNaN(Ae)||ut.value.indexOf(".")>=0)&>.Translator.incorrectRdfDataType(ut),Ae}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Ae.literal(String(ut),Y||Ae.namedNode(ut<=J.MAX_INT&&ut>=J.MIN_INT?J.TYPES[0]:J.TYPES[1]))}}it.TypeHandlerNumberInteger=J,J.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"],J.MAX_INT=2147483647,J.MIN_INT=-2147483648},608:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class tt{fromRdf(J){return J.value}toRdf(J,{datatype:xt,dataFactory:ut}){return ut.literal(J,xt)}}it.TypeHandlerString=tt,tt.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/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},938:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),Object.defineProperty(xt,Ae,{enumerable:!0,get:function(){return ut[Y]}})}:function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),xt[Ae]=ut[Y]}),J=this&&this.__exportStar||function(xt,ut){for(var Y in xt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(ut,Y)&>(ut,xt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(727),it),J(tt(525),it),J(tt(554),it),J(tt(750),it),J(tt(608),it)},289:(jt,it,tt)=>{"use strict";var gt={};tt.r(gt),tt.d(gt,{decode:()=>Hge,encode:()=>Gge});var J={};tt.r(J),tt.d(J,{decode:()=>Kge,encode:()=>Xge});var xt={};tt.r(xt),tt.d(xt,{decode:()=>Qge,encode:()=>Zge});var ut={};function Y(n){return"function"==typeof n}tt.r(ut),tt.d(ut,{decode:()=>Jge,encode:()=>eme});let Ae=!1;const he={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else Ae&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ae=n},get useDeprecatedSynchronousErrorHandling(){return Ae}};function W(n){setTimeout(()=>{throw n},0)}const V={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},L=Array.isArray||(n=>n&&"number"==typeof n.length);function re(n){return null!==n&&"object"==typeof n}const b=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class S{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof S)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof b?t.errors:t),[])}S.EMPTY=((n=new S).closed=!0,n);const A="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends S{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=V;break;case 1:if(!e){this.destination=V;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,e,t,i)}}[A](){return this}static create(e,t,i){const r=new y(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class w extends y{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;Y(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==V&&(o=Object.create(t),Y(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;he.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=he;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):W(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;W(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);he.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),he.useDeprecatedSynchronousErrorHandling)throw i;W(i)}}__tryOrSetError(e,t,i){if(!he.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return he.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(W(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const I="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(n){return n}let F=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof y)return n;if(n[A])return n[A]()}return n||e||t?new y(n,e,t):new y(V)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||he.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),he.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){he.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof y?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=Q(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[I](){return this}pipe(...t){return 0===t.length?this:function(n){return 0===n.length?H:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}(t)(this)}toPromise(t){return new(t=Q(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function Q(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const U=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ie extends S{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class ue extends y{constructor(e){super(e),this.destination=e}}let ee=(()=>{class n extends F{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[A](){return new ue(this)}lift(t){const i=new se(this,this);return i.operator=t,i}next(t){if(this.closed)throw new U;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew se(e,t),n})();class se extends ee{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):S.EMPTY}}function Te(n){return n&&"function"==typeof n.schedule}function me(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new te(n,e))}}class te{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new ye(e,this.project,this.thisArg))}}class ye extends y{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const Me=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ee(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Oe=n=>{if(n&&"function"==typeof n[I])return(n=>e=>{const t=n[I]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(Le(n))return Me(n);if(Ee(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,W),e))(n);if(n&&"function"==typeof n[Ze])return(n=>e=>{const t=n[Ze]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${re(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Be(n,e){return new F(t=>{const i=new S;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function Pe(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[I]}(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>{const r=n[I]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(Ee(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(Le(n))return Be(n,e);if(function(n){return n&&"function"==typeof n[Ze]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new F(t=>{const i=new S;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Ze](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof F?n:new F(Oe(n))}class Et extends y{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class pe extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function O(n,e){if(e.closed)return;if(n instanceof F)return n.subscribe(e);let t;try{t=Oe(n)(e)}catch(i){e.error(i)}return t}function k(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(k((r,s)=>Pe(n(r,s)).pipe(me((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Re(n,t)))}class Re{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Xe(e,this.project,this.concurrent))}}class Xe extends pe{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function It(n=Number.POSITIVE_INFINITY){return k(H,n)}function An(n,e){return e?Be(n,e):new F(Me(n))}function Rn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Te(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof F?n[0]:It(e)(An(n,t))}function Hn(){return function(e){return e.lift(new yi(e))}}class yi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new ci(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class ci extends y{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Ur extends F{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new S,e.add(this.source.subscribe(new as(this.getSubject(),this))),e.closed&&(this._connection=null,e=S.EMPTY)),e}refCount(){return Hn()(this)}}const Is=(()=>{const n=Ur.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class as extends ue{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class wl{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function la(){return new ee}function ps(){return n=>Hn()(function(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new wl(r,e));const s=Object.create(i,Is);return s.source=i,s.subjectFactory=r,s}}(la)(n))}function Zt(n){for(let e in n)if(n[e]===Zt)return e;throw Error("Could not find renamed property on target object.")}function Ua(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function rt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(rt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ot(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ct=Zt({__forward_ref__:Zt});function fe(n){return n.__forward_ref__=fe,n.toString=function(){return rt(this())},n}function ve(n){return ke(n)?n():n}function ke(n){return"function"==typeof n&&n.hasOwnProperty(ct)&&n.__forward_ref__===fe}class Qe extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function At(n){return"string"==typeof n?n:null==n?"":String(n)}function qt(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():At(n)}function pn(n,e){const t=e?` in ${e}`:"";throw new Qe("201",`No provider for ${qt(n)} found${t}`)}function Z(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function $e(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function bt(n){return{providers:n.providers||[],imports:n.imports||[]}}function gn(n){return gs(n,io)||gs(n,Rs)}function gs(n,e){return n.hasOwnProperty(e)?n[e]:null}function El(n){return n&&(n.hasOwnProperty(Rr)||n.hasOwnProperty(lc))?n[Rr]:null}const io=Zt({\u0275prov:Zt}),Rr=Zt({\u0275inj:Zt}),Rs=Zt({ngInjectableDef:Zt}),lc=Zt({ngInjectorDef:Zt});var bn=(()=>((bn=bn||{})[bn.Default=0]="Default",bn[bn.Host=1]="Host",bn[bn.Self=2]="Self",bn[bn.SkipSelf=4]="SkipSelf",bn[bn.Optional=8]="Optional",bn))();let ro;function ua(n){const e=ro;return ro=n,e}function nd(n,e,t){const i=gn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&bn.Optional?null:void 0!==e?e:void pn(rt(n),"Injector")}function xe(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),$t=(()=>(($t=$t||{})[$t.Emulated=0]="Emulated",$t[$t.None=2]="None",$t[$t.ShadowDom=3]="ShadowDom",$t))();const ni="undefined"!=typeof globalThis&&globalThis,Nr="undefined"!=typeof window&&window,$r="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,ms="undefined"!=typeof global&&global,Jn=ni||ms||Nr||$r,id={},Wi=[],Gf=Zt({\u0275cmp:Zt}),wm=Zt({\u0275dir:Zt}),hh=Zt({\u0275pipe:Zt}),ab=Zt({\u0275mod:Zt}),vx=Zt({\u0275loc:Zt}),Cl=Zt({\u0275fac:Zt}),fh=Zt({__NG_ELEMENT_ID__:Zt});let bx=0;function _n(n){return xe(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===He.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||Wi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||$t.Emulated,id:"c",styles:n.styles||Wi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=bx++,i.inputs=db(n.inputs,t),i.outputs=db(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(lb):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(cb):null,i})}function lb(n){return Ii(n)||function(n){return n[wm]||null}(n)}function cb(n){return function(n){return n[hh]||null}(n)}const ub={};function ln(n){return xe(()=>{const e={type:n.type,bootstrap:n.bootstrap||Wi,declarations:n.declarations||Wi,imports:n.imports||Wi,exports:n.exports||Wi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(ub[n.id]=n.type),e})}function db(n,e){if(null==n)return id;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const kt=_n;function Ns(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Ii(n){return n[Gf]||null}function bo(n,e){const t=n[ab]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function ko(n){return Array.isArray(n)&&"object"==typeof n[1]}function Bo(n){return Array.isArray(n)&&!0===n[1]}function Cm(n){return 0!=(8&n.flags)}function ad(n){return 2==(2&n.flags)}function ld(n){return 1==(1&n.flags)}function fa(n){return null!==n.template}function hb(n){return 0!=(512&n[2])}function dc(n,e){return n.hasOwnProperty(Cl)?n[Cl]:null}class Dm{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function ki(){return gb}function gb(n){return n.type.prototype.ngOnChanges&&(n.setInput=Dx),Tx}function Tx(){const n=st(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===id)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function Dx(n,e,t,i){const r=st(n)||function(n,e){return n[vh]=e}(n,{previous:id,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new Dm(l&&l.currentValue,e,o===id),n[i]=e}ki.ngInherit=!0;const vh="__ngSimpleChanges__";function st(n){return n[vh]||null}let Bi;function ir(n){return!!n.listen}const ru={createRenderer:(n,e)=>void 0!==Bi?Bi:"undefined"!=typeof document?document:void 0};function _r(n){for(;Array.isArray(n);)n=n[0];return n}function bh(n,e){return _r(e[n])}function $s(n,e){return _r(e[n.index])}function Om(n,e){return n.data[e]}function cd(n,e){return n[e]}function Fs(n,e){const t=e[n];return ko(t)?t:t[0]}function Tl(n){return 4==(4&n[2])}function ud(n){return 128==(128&n[2])}function ga(n,e){return null==e?null:n[e]}function Rm(n){n[18]=0}function qf(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Pn={lFrame:ou(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function _b(){return Pn.bindingsEnabled}function Bt(){return Pn.lFrame.lView}function ui(){return Pn.lFrame.tView}function Vo(n){return Pn.lFrame.contextLView=n,n[8]}function Jr(){let n=Nm();for(;null!==n&&64===n.type;)n=n.parent;return n}function Nm(){return Pn.lFrame.currentTNode}function Ga(n,e){const t=Pn.lFrame;t.currentTNode=n,t.isParent=e}function Lr(){return Pn.lFrame.isParent}function ls(){Pn.lFrame.isParent=!1}function Sh(){return Pn.isInCheckNoChangesMode}function Kf(n){Pn.isInCheckNoChangesMode=n}function ys(){const n=Pn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function ma(){return Pn.lFrame.bindingIndex++}function Eo(n){const e=Pn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function dd(n,e){const t=Pn.lFrame;t.bindingIndex=t.bindingRootIndex=n,Pm(e)}function Pm(n){Pn.lFrame.currentDirectiveIndex=n}function yb(){return Pn.lFrame.currentQueryIndex}function Lm(n){Pn.lFrame.currentQueryIndex=n}function Qf(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function hd(n,e,t){if(t&bn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&bn.Host||(r=Qf(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Pn.lFrame=Se();return i.currentTNode=e,i.lView=n,!0}function Ah(n){const e=Se(),t=n[1];Pn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Se(){const n=Pn.lFrame,e=null===n?null:n.child;return null===e?ou(n):e}function ou(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Th(){const n=Pn.lFrame;return Pn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const So=Th;function ri(){const n=Th();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Ws(){return Pn.lFrame.selectedIndex}function ao(n){Pn.lFrame.selectedIndex=n}function Dr(){const n=Pn.lFrame;return Om(n.tView,n.selectedIndex)}function Zf(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class Dh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function tp(n,e,t){const i=ir(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let pd=!0;function np(n){const e=pd;return pd=n,e}let zm=0;function Ls(n,e){const t=ip(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,Hm(i.data,n),Hm(e,null),Hm(i.blueprint,null));const r=Ih(n,e),s=n.injectorIndex;if(bb(r)){const o=fd(r),a=Wa(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function Hm(n,e){n.push(0,0,0,0,0,0,0,0,e)}function ip(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Ih(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function fc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(fh)&&(i=t[fh]),null==i&&(i=t[fh]=zm++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Cb:e}(t);if("function"==typeof s){if(!hd(e,n,i))return i&bn.Host?Gm(r,t,i):Eb(e,t,i,r);try{const o=s(i);if(null!=o||i&bn.Optional)return o;pn(t)}finally{So()}}else if("number"==typeof s){let o=null,a=ip(n,e),l=-1,c=i&bn.Host?e[16][6]:null;for((-1===a||i&bn.SkipSelf)&&(l=-1===a?Ih(n,e):e[a+8],-1!==l&&Rh(i,!1)?(o=e[1],a=fd(l),e=Wa(l,e)):a=-1);-1!==a;){const d=e[1];if(rp(s,a,d.data)){const f=vs(a,e,t,o,i,c);if(f!==Sb)return f}l=e[a+8],-1!==l&&Rh(i,e[1].data[a+8]===c)&&rp(s,a,e)?(o=d,a=fd(l),e=Wa(l,e)):a=-1}}}return Eb(e,t,i,r)}const Sb={};function Cb(){return new Uo(Jr(),Bt())}function vs(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=gd(a,o,t,null==i?ad(a)&&pd:i!=o&&0!=(3&a.type),r&bn.Host&&s===a);return null!==d?md(e,o,d,a):Sb}function gd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&fa(g)&&g.type===t)return l}return null}function md(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Dh}(r)){const o=r;o.resolving&&function(n,e){throw new Qe("200",`Circular dependency in DI detected for ${n}`)}(qt(s[t]));const a=np(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ua(o.injectImpl):null;hd(n,i,bn.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=gb(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ua(l),np(a),o.resolving=!1,So()}}return r}function rp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Cl]||bs(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Cl]||bs(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function bs(n){return ke(n)?()=>{const e=bs(ve(n));return e&&e()}:dc(n)}const yd="__parameters__";function va(n,e,t){return xe(()=>{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(yd)?l[yd]:Object.defineProperty(l,yd,{value:[]})[yd];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class zt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=$e({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}function Ho(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Go(t,e):e(t))}function Ph(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Ml(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function gc(n,e){const t=[];for(let i=0;i=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function Xm(n,e){const t=ws(n,e);if(t>=0)return n[1|t]}function ws(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):rt(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(yc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[_c]=null,n}const Sd=Ed(va("Inject",n=>({token:n})),-1),qr=Ed(va("Optional"),8),Xa=Ed(va("SkipSelf"),4);function ks(n){return n instanceof class{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}?n.changingThisBreaksApplicationSecurity:n}const f_="__ngContext__";function Es(n,e){n[f_]=e}function p_(n){const e=function(n){return n[f_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Ep(n){return n.ngOriginalError}function D1(n,...e){n.error(...e)}class Yo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||D1}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(Ep(e)):null}_findOriginalError(e){let t=e&&Ep(e);for(;t&&Ep(t);)t=Ep(t);return t||null}}const r0=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Jn))();function Za(n){return n instanceof Function?n():n}var To=(()=>((To=To||{})[To.Important=1]="Important",To[To.DashCase=2]="DashCase",To))();function v_(n,e){return undefined(n,e)}function Uh(n){const e=n[3];return Bo(e)?e[3]:e}function Md(n){return c0(n[13])}function w_(n){return c0(n[4])}function c0(n){for(;null!==n&&!Bo(n);)n=n[4];return n}function Id(n,e,t,i,r){if(null!=i){let s,o=!1;Bo(i)?s=i:ko(i)&&(o=!0,i=i[0]);const a=_r(i);0===n&&null!==t?null==r?p0(e,t,a):Ja(e,t,a,r||null,!0):1===n&&null!==t?Ja(e,t,a,r||null,!0):2===n?function(n,e,t){const i=xp(n,e);i&&function(n,e,t,i){ir(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==_r(t)&&Id(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Ml(n,10+e);!function(n,e){Od(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function x_(n,e){if(!(256&e[2])){const t=e[11];ir(t)&&t.destroyNode&&Od(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Cp(n[1],n);for(;e;){let t=null;if(ko(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)ko(e)&&Cp(e[1],e),e=e[3];null===e&&(e=n),ko(e)&&Cp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Cp(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==Hh(g,c,0)||2&i&&c!==p){if(wa(i))return!1;o=!0}}}}else{if(!o&&!wa(i)&&!wa(l))return!1;if(o&&wa(l))continue;o=!1,i=l|1&i}}return wa(i)||o}function wa(n){return 0==(1&n)}function tA(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!wa(o)&&(e+=T0(s,r),r=""),i=o,s=s||!wa(i);t++}return""!==r&&(e+=T0(s,r)),e}const xn={};function Yt(n){D0(ui(),Bt(),Ws()+n,Sh())}function D0(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Jf(e,s,t)}else{const s=n.preOrderHooks;null!==s&&ep(e,s,0,t)}ao(t)}function el(n,e){return n<<17|e<<2}function Tn(n){return n>>17&32767}function yr(n){return 2|n}function Pl(n){return(131068&n)>>2}function tl(n,e){return-131069&n|e<<2}function O_(n){return 1|n}function k0(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&D0(n,e,20,Sh()),t(i,r)}finally{ao(s)}}function qh(n,e,t){!_b()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Ls(t,e),Es(i,e);const o=t.initialInputs;for(let a=r;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function Y0(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function K0(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function MA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&H_(t)}}function H_(n){for(let i=Md(n);null!==i;i=w_(i))for(let r=10;r0&&H_(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&H_(r)}}function LA(n,e){const t=Fs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Z0(n){return n[7]||(n[7]=[])}function Fp(n){return n.cleanup||(n.cleanup=[])}function K_(n,e){const t=n[9],i=t?t.get(Yo,null):null;i&&i.handleError(e)}function J0(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Go([e],a=>this.processInjectorType(a,[],s)),this.records.set(kd,bu(void 0,this));const o=this.records.get(vu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:rt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=hu,i=bn.Default){this.assertNotDestroyed();const r=wd(this),s=ua(void 0);try{if(!(i&bn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof zt}(e)&&gn(e);a=l&&this.injectableDefInScope(l)?bu(ey(e),Yh):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&bn.Self?ew():this.parent).get(e,t=i&bn.Optional&&t===hu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[_c]=o[_c]||[]).unshift(rt(e)),r)throw o;return qs(o,e,"R3InjectorError",this.source)}throw o}finally{ua(s),wd(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(rt(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=ve(e)))return!1;let r=El(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=El(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Go(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||Wi))}}this.injectorDefTypes.add(o);const l=dc(o)||(()=>new o);this.records.set(o,bu(l,Yh));const c=r.providers;if(null!=c&&!a){const d=e;Go(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Cc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return iw(n)?bu(void 0,n.useValue):bu(nw(n),Yh)}(e);if(Cc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=bu(void 0,Yh,!0),o.factory=()=>pu(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===Yh&&(t.value=HA,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ve(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function ey(n){const e=gn(n),t=null!==e?e.factory:dc(n);if(null!==t)return t;if(n instanceof zt)throw new Error(`Token ${rt(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=gc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[io]||n[Rs]);if(e){const t=function(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Error("unreachable")}function nw(n,e,t){let i;if(Cc(n)){const r=ve(n);return dc(r)||ey(r)}if(iw(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...pu(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Ie(ve(n.useExisting));else{const r=ve(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return dc(r)||ey(r);i=()=>new r(...pu(n.deps))}return i}function bu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function iw(n){return null!==n&&"object"==typeof n&&up in n}function Cc(n){return"function"==typeof n}const rw=function(n,e,t){return function(n,e=null,t=null,i){const r=tw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class zn{static create(e,t){return Array.isArray(e)?rw(e,t,""):rw(e.providers,e.parent,e.name||"")}}function bW(n,e){Zf(p_(n)[1],Jr())}function Dn(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(fa(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=iT(n.inputs),o.declaredInputs=iT(n.declaredInputs),o.outputs=iT(n.outputs);const a=r.hostBindings;a&&CW(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&EW(n,l),c&&SW(n,c),Ua(n.inputs,r.inputs),Ua(n.declaredInputs,r.declaredInputs),Ua(n.outputs,r.outputs),fa(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Mh(r.hostAttrs,t=Mh(t,r.hostAttrs))}}(i)}function iT(n){return n===id?{}:n===Wi?[]:n}function EW(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function SW(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function CW(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}zn.THROW_IF_NOT_FOUND=hu,zn.NULL=new Xs,zn.\u0275prov=$e({token:zn,providedIn:"any",factory:()=>Ie(kd)}),zn.__NG_ELEMENT_ID__=-1;let cw=null;function kp(){if(!cw){const n=Jn.Symbol;if(n&&n.iterator)cw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(_r(Ne[i.index])):i.index;if(ir(t)){let Ne=null;if(!a&&l&&(Ne=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==Ne)(Ne.__ngLastListenerFn__||Ne).__ngNextListenerFn__=s,Ne.__ngLastListenerFn__=s,g=!1;else{s=uT(i,e,f,s,!1);const Ge=t.listen(q,r,s);p.push(s,Ge),d&&d.push(r,ge,G,G+1)}}else s=uT(i,e,f,s,!0),q.addEventListener(r,s,o),p.push(s),d&&d.push(r,ge,G,o)}else s=uT(i,e,f,s,!1);const _=i.outputs;let x;if(g&&null!==_&&(x=_[r])){const T=x.length;if(T)for(let q=0;q0;)e=e[15],n--;return e}(n,Pn.lFrame.contextLView))[8]}(n)}function r7(n,e){let t=null;const i=function(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let r=0;r=0}const Cs={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function WF(n){return n.substring(Cs.key,Cs.keyEnd)}function qF(n,e){const t=Cs.textEnd;return t===e?-1:(e=Cs.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Cs.key=e,t),Qp(n,e,t))}function Qp(n,e,t){for(;e=0;t=qF(e,t))Co(n,WF(e),!0)}function ZF(n,e){return e>=n.expandoStartIndex}function JF(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Ws()],o=ZF(n,t);iL(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=function(n){const e=Pn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=cy(t=hT(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=hT(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Pl(i))return n[Tn(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=hT(null,n,e,l[1],i),l=cy(l,e.attrs,i),function(n,e,t,i){n[Tn(t?e.classBindings:e.styleBindings)]=i}(n,e,i,l))}else s=function(n,e,t){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Tn(n[a+1]);n[i+1]=el(p,a),0!==p&&(n[p+1]=tl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=el(a,0),0!==a&&(n[a+1]=tl(n[a+1],i)),a=i;else n[i+1]=el(l,0),0===a?a=i:n[l+1]=tl(n[l+1],i),l=i;c&&(n[i+1]=yr(n[i+1])),$F(n,d,i,!0),$F(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&ws(s,e)>=0&&(t[i+1]=O_(t[i+1]))}(e,d,n,i,s),o=el(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function hT(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===xn&&(p=f?Wi:void 0);let g=f?Xm(p,i):d===i?p:void 0;if(c&&!gw(g)&&(g=Xm(l,i)),gw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Tn(_):Pl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=Xm(l,i))}return a}function gw(n){return void 0!==n}function iL(n,e){return 0!=(n.flags&(e?16:32))}function Si(n,e=""){const t=Bt(),i=ui(),r=n+20,s=i.firstCreatePass?Nd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return ir(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Ap(i,t,o,s),Ga(s,!1)}function xs(n){return Mc("",n,""),xs}function Mc(n,e,t){const i=Bt(),r=function(n,e,t,i){return ho(n,ma(),t)?e+At(t)+i:xn}(i,n,e,t);return r!==xn&&Fl(i,Ws(),r),Mc}function Eu(n,e,t){const i=Bt();return ho(i,ma(),e)&&Do(ui(),Dr(),i,n,e,i[11],t,!0),Eu}const Xh=void 0;var U7=["en",[["a","p"],["AM","PM"],Xh],[["AM","PM"],Xh,Xh],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Xh,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Xh,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Xh,"{1} 'at' {0}",Xh],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Zp={};function wL(n){return n in Zp||(Zp[n]=Jn.ng&&Jn.ng.common&&Jn.ng.common.locales&&Jn.ng.common.locales[n]),Zp[n]}var an=(()=>((an=an||{})[an.LocaleId=0]="LocaleId",an[an.DayPeriodsFormat=1]="DayPeriodsFormat",an[an.DayPeriodsStandalone=2]="DayPeriodsStandalone",an[an.DaysFormat=3]="DaysFormat",an[an.DaysStandalone=4]="DaysStandalone",an[an.MonthsFormat=5]="MonthsFormat",an[an.MonthsStandalone=6]="MonthsStandalone",an[an.Eras=7]="Eras",an[an.FirstDayOfWeek=8]="FirstDayOfWeek",an[an.WeekendRange=9]="WeekendRange",an[an.DateFormat=10]="DateFormat",an[an.TimeFormat=11]="TimeFormat",an[an.DateTimeFormat=12]="DateTimeFormat",an[an.NumberSymbols=13]="NumberSymbols",an[an.NumberFormats=14]="NumberFormats",an[an.CurrencyCode=15]="CurrencyCode",an[an.CurrencySymbol=16]="CurrencySymbol",an[an.CurrencyName=17]="CurrencyName",an[an.Currencies=18]="Currencies",an[an.Directionality=19]="Directionality",an[an.PluralCase=20]="PluralCase",an[an.ExtraData=21]="ExtraData",an))();const _w="en-US";let EL=_w;function pT(n){Z(n,"Expected localeId to be defined"),"string"==typeof n&&(EL=n.toLowerCase().replace(/_/g,"-"))}function _T(n,e,t,i,r){if(n=ve(n),Array.isArray(n))for(let s=0;s>20;if(Cc(n)||!n.multi){const g=new Dh(l,r,De),_=vT(a,e,r?d:d+p,f);-1===_?(fc(Ls(c,o),s,a),yT(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[_]=g,o[_]=g)}else{const g=vT(a,e,d+p,f),_=vT(a,e,d,d+p),x=g>=0&&t[g],T=_>=0&&t[_];if(r&&!T||!r&&!x){fc(Ls(c,o),s,a);const q=function(n,e,t,i,r){const s=new Dh(n,t,De);return s.multi=[],s.index=e,s.componentProviders=0,WL(s,r,i&&!t),s}(r?B9:k9,t.length,r,i,l);!r&&T&&(t[_].providerFactory=q),yT(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(q),o.push(q)}else yT(s,n,g>-1?g:_,WL(t[r?_:g],l,!r&&i));!r&&i&&T&&t[_].componentProviders++}}}function yT(n,e,t,i){const r=Cc(e);if(r||function(n){return!!n.useClass}(e)){const o=(e.useClass||e).prototype.ngOnDestroy;if(o){const a=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){const l=a.indexOf(t);-1===l?a.push(t,[i,o]):a[l+1].push(i,o)}else a.push(t,o)}}}function WL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function vT(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=ui();if(i.firstCreatePass){const r=fa(n);_T(t,i.data,i.blueprint,r,!0),_T(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class qL{}const KL="ngComponent";class U9{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[KL]=n,e}(e)}}class ol{}function Ew(...n){}function eg(n,e){return new wn($s(n,e))}ol.NULL=new U9;const G9=function(){return eg(Jr(),Bt())};let wn=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=G9,n})();function XL(n){return n instanceof wn?n.nativeElement:n}class Qh{}let ET=(()=>{class n{}return n.\u0275prov=$e({token:n,providedIn:"root",factory:()=>null}),n})();class Cu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const QL=new Cu("12.2.5");class ZL{constructor(){}supports(e){return sy(e)}create(e){return new X9(e)}}const K9=(n,e)=>e;class X9{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||K9}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new Q9(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new JL),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new JL),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class Q9{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Z9{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class JL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new Z9,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function e2(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new eq(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class eq{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function n2(){return new tg([new ZL])}let tg=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||n2()),deps:[[n,new Xa,new qr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=$e({token:n,providedIn:"root",factory:n2}),n})();function r2(){return new ng([new t2])}let ng=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||r2()),deps:[[n,new Xa,new qr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=$e({token:n,providedIn:"root",factory:r2}),n})();function Sw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(_r(s)),Bo(s))for(let a=10;a-1&&(C_(e,i),Ml(t,i))}this._attachedToViewContainer=!1}x_(this._lView[1],this._lView)}onDestroy(e){U0(this._lView[1],this._lView,null,e)}markForCheck(){G_(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){W_(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Kf(!0);try{W_(n,e,t)}finally{Kf(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Od(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class nq extends py{constructor(e){super(e),this._view=e}detectChanges(){Q0(this._view)}checkNoChanges(){!function(n){Kf(!0);try{Q0(n)}finally{Kf(!1)}}(this._view)}get context(){return null}}const rq=function(n){return function(n,e,t){if(ad(n)&&!t){const i=Fs(n.index,e);return new py(i,i)}return 47&n.type?new py(e[16],e):null}(Jr(),Bt(),16==(16&n))};let ts=(()=>{class n{}return n.__NG_ELEMENT_ID__=rq,n})();const aq=[new t2],cq=new tg([new ZL]),uq=new ng(aq),hq=function(){return Cw(Jr(),Bt())};let Io=(()=>{class n{}return n.__NG_ELEMENT_ID__=hq,n})();const fq=Io,pq=class extends fq{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=$h(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),Wh(t,i,e),new py(i)}};function Cw(n,e){return 4&n.type?new pq(e,n,eg(n,e)):null}class Ic{}const _q=function(){return l2(Jr(),Bt())};let As=(()=>{class n{}return n.__NG_ELEMENT_ID__=_q,n})();const vq=As,o2=class extends vq{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return eg(this._hostTNode,this._hostLView)}get injector(){return new Uo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Ih(this._hostTNode,this._hostLView);if(bb(e)){const t=Wa(e,this._hostLView),i=fd(e);return new Uo(t[1].data[i+8],t)}return new Uo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=a2(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Ic,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Bo(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new o2(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),ir0});class I2 extends qL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(oA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return M2(this.componentDef.inputs)}get outputs(){return M2(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,og,r);return s!==og||i===og?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Qh,ru),a=s.get(ET,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(ir(n))return n.selectRootElement(e,t===$t.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):S_(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?"http://www.w3.org/2000/svg":"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||r0,clean:UA,playerHandler:e||null,flags:0}}(),g=Np(0,null,null,1,0,null,null,null,null,null),_=$h(null,g,p,f,null,null,o,l,a,s);let x,T;Ah(_);try{const q=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Nd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(Lp(l,c,!0),null!==n&&(tp(r,n,c),null!==l.classes&&M_(r,n,l.classes),null!==l.styles&&S0(r,n,l.styles)));const d=i.createRenderer(n,e),f=$h(t,Rp(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(fc(Ls(l,t),o,e.type),K0(o,l),V_(l,t.length,1)),Pp(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)tp(l,d,["ng-version",QL.full]);else{const{attrs:G,classes:ge}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&M_(l,d,ge.join(" "))}if(T=Om(g,20),void 0!==t){const G=T.projection=[];for(let ge=0;gel(o,e)),e.contentQueries){const l=Jr();e.contentQueries(1,o,l.directiveStart)}const a=Jr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(ao(a.index),q0(t[1],a,0,a.directiveStart,a.directiveEnd,e),Y0(e,o)),o}(q,this.componentDef,_,p,[bW]),Wh(g,_,null)}finally{ri()}return new yY(this.componentType,x,eg(T,_),_,T)}}class yY extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new nq(r),this.componentType=e}get injector(){return new Uo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const ag=new Map;class wY extends Ic{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new D2(this);const i=bo(e),r=function(n){return n[vx]||null}(e);r&&pT(r),this._bootstrapComponents=Za(i.bootstrap),this._r3Injector=tw(e,t,[{provide:Ic,useValue:this},{provide:ol,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=zn.THROW_IF_NOT_FOUND,i=bn.Default){return e===zn||e===Ic||e===kd?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class LT extends class{}{constructor(e){super(),this.moduleType=e,null!==bo(e)&&function(n){const e=new Set;!function t(i){const r=bo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${rt(e)} vs ${rt(e.name)}`)}(s,ag.get(s),i),ag.set(s,i));const o=Za(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new wY(this.moduleType,e)}}function Mw(n,e,t){const i=ys()+n,r=Bt();return r[i]===xn?Ac(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function P2(n,e,t,i,r,s){const o=e+t;return ho(n,o,r)?Ac(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===xn?void 0:t}(n,o+1)}function cl(n,e){const t=ui();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new Qe("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=dc(i.type)),o=ua(De);try{const a=np(!1),l=s();return np(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Bt(),r,l),l}finally{ua(o)}}function ul(n,e,t){const i=n+20,r=Bt(),s=cd(r,i);return function(n,e){kl.isWrapped(e)&&(e=kl.unwrap(e),n[Pn.lFrame.bindingIndex]=xn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?P2(r,ys(),e,s.transform,t,s):s.transform(t))}function kT(n){return e=>{setTimeout(n,void 0,e)}}const mn=class extends ee{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=kT(l),a&&(a=kT(a)),c&&(c=kT(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof S&&e.add(d),d}};function LY(){return this._results[kp()]()}class ef{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=kp(),i=ef.prototype;i[t]||(i[t]=LY)}get changes(){return this._changes||(this._changes=new mn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=Ho(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=Ew,this.reject=Ew,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Ie(tf,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Ay=new zt("AppId"),yK={provide:Ay,useFactory:function(){return`${KT()}${KT()}${KT()}`},deps:[]};function KT(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const ak=new zt("Platform Initializer"),Oc=new zt("Platform ID"),Rw=new zt("appBootstrapListener");let Nw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const xu=new zt("LocaleId"),lk=new zt("DefaultCurrencyCode");class bK{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const XT=function(n){return new LT(n)},wK=XT,EK=function(n){return Promise.resolve(XT(n))},ck=function(n){const e=XT(n),i=Za(bo(n).declarations).reduce((r,s)=>{const o=Ii(s);return o&&r.push(new I2(o)),r},[]);return new bK(e,i)},SK=ck,CK=function(n){return Promise.resolve(ck(n))};let nf=(()=>{class n{constructor(){this.compileModuleSync=wK,this.compileModuleAsync=EK,this.compileModuleAndAllComponentsSync=SK,this.compileModuleAndAllComponentsAsync=CK}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const uk=new zt("compilerOptions"),AK=(()=>Promise.resolve(0))();function QT(n){"undefined"==typeof Zone?AK.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class yn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new mn(!1),this.onMicrotaskEmpty=new mn(!1),this.onStable=new mn(!1),this.onError=new mn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=Jn.requestAnimationFrame,e=Jn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(Jn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,JT(n),n.isCheckStableRunning=!0,ZT(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),JT(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return dk(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),hk(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return dk(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),hk(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,JT(n),ZT(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!yn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(yn.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,DK,Ew,Ew);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const DK={};function ZT(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function JT(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function dk(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function hk(n){n._nesting--,ZT(n)}class OK{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new mn,this.onMicrotaskEmpty=new mn,this.onStable=new mn,this.onError=new mn}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let eD=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{yn.assertNotInAngularZone(),QT(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())QT(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),fk=(()=>{class n{constructor(){this._applications=new Map,tD.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return tD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class RK{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let tD=new RK,pk=!0,gk=!1;function Sa(){return gk=!0,pk}let Hl;const mk=new zt("AllowMultipleToken");function _k(n,e,t=[]){const i=`Platform: ${e}`,r=new zt(i);return(s=[])=>{let o=iD();if(!o||o.injector.get(mk,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:vu,useValue:"platform"});!function(n){if(Hl&&!Hl.destroyed&&!Hl.injector.get(mk,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Hl=n.get(yk);const e=n.get(ak,null);e&&e.forEach(t=>t())}(zn.create({providers:a,name:i}))}return function(n){const e=iD();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function iD(){return Hl&&!Hl.destroyed?Hl:null}let yk=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new OK:("zone.js"===n?void 0:n)||new yn({enableLongStackTrace:Sa(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:yn,useValue:a}];return a.run(()=>{const c=zn.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Yo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{rD(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return ay(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(cg);return p.runInitializers(),p.donePromise.then(()=>(pT(d.injector.get(xu,_w)||_w),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=vk({},i);return function(n,e,t){const i=new LT(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(jd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${rt(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function vk(n,e){return Array.isArray(e)?e.reduce(vk,n):Object.assign(Object.assign({},n),e)}let jd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new F(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new F(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{yn.assertNotInAngularZone(),QT(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{yn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Rn(a,l.pipe(ps()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof qL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Ic),a=r.create(zn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(eD,null),d=c&&a.injector.get(fk);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),rD(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;rD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Rw,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(zn),Ie(Yo),Ie(ol),Ie(cg))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function rD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const sX=_k(null,"core",[{provide:Oc,useValue:"unknown"},{provide:yk,deps:[zn]},{provide:fk,deps:[]},{provide:Nw,deps:[]}]),uX=[{provide:jd,useClass:jd,deps:[yn,zn,Yo,ol,cg]},{provide:gY,deps:[yn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:cg,useClass:cg,deps:[[new qr,tf]]},{provide:nf,useClass:nf,deps:[]},yK,{provide:tg,useFactory:function(){return cq},deps:[]},{provide:ng,useFactory:function(){return uq},deps:[]},{provide:xu,useFactory:function(n){return pT(n=n||"undefined"!=typeof $localize&&$localize.locale||_w),n},deps:[[new Sd(xu),new qr,new Xa]]},{provide:lk,useValue:"USD"}];let hX=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(jd))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:uX}),n})(),$w=null;function Rc(){return $w}const un=new zt("DocumentToken");let of=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:dQ,token:n,providedIn:"platform"}),n})();function dQ(){return Ie(qk)}let qk=(()=>{class n extends of{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Rc().getBaseHref(this._doc)}onPopState(t){const i=Rc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Rc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){Yk()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){Yk()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({factory:fQ,token:n,providedIn:"platform"}),n})();function Yk(){return!!window.history.pushState}function fQ(){return new qk(Ie(un))}function Tu(n){return n&&"?"!==n[0]?"?"+n:n}let af=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:pQ,token:n,providedIn:"root"}),n})();function pQ(n){const e=Ie(un).location;return new Xk(Ie(of),e&&e.origin||"")}const bD=new zt("appBaseHref");let Xk=(()=>{class n extends af{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return function(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Tu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Tu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Tu(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(of),Ie(bD,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();var cs=(()=>((cs=cs||{})[cs.Zero=0]="Zero",cs[cs.One=1]="One",cs[cs.Two=2]="Two",cs[cs.Few=3]="Few",cs[cs.Many=4]="Many",cs[cs.Other=5]="Other",cs))();const CQ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=wL(e);if(t)return t;const i=e.split("-")[0];if(t=wL(i),t)return t;if("en"===i)return U7;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[an.PluralCase]};class tE{}let JQ=(()=>{class n extends tE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(CQ(i||this.locale)(t)){case cs.Zero:return"zero";case cs.One:return"one";case cs.Two:return"two";case cs.Few:return"few";case cs.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(xu))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class tZ{constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ud=(()=>{class n{constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(i){throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const i=[];t.forEachOperation((r,s,o)=>{if(null==r.previousIndex){const a=this._viewContainer.createEmbeddedView(this._template,new tZ(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new l3(r,a);i.push(l)}else if(null==o)this._viewContainer.remove(null===s?void 0:s);else if(null!==s){const a=this._viewContainer.get(s);this._viewContainer.move(a,o);const l=new l3(r,a);i.push(l)}});for(let r=0;r{this._viewContainer.get(r.currentIndex).context.$implicit=r.item})}_perViewChange(t,i){t.context.$implicit=i.item}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(De(As),De(Io),De(tg))},n.\u0275dir=kt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class l3{constructor(e,t){this.record=e,this.view=t}}let Mu=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new iZ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){c3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){c3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(De(As),De(Io))},n.\u0275dir=kt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class iZ{constructor(){this.$implicit=null,this.ngIf=null}}function c3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class aZ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class lZ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const cZ=new lZ,uZ=new aZ;let iE=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(ay(t))return cZ;if(PF(t))return uZ;throw function(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${rt(n)}'`)}(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(De(ts,16))},n.\u0275pipe=Ns({name:"async",type:n,pure:!1}),n})(),Kr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[{provide:tE,useClass:JQ}]}),n})();const g3="browser";function lf(n){return n===g3}class ND extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){$w||($w=n)}(new ND)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(Ny=Ny||document.querySelector("base"),Ny?Ny.getAttribute("href"):null);return null==t?null:function(n){rE=rE||document.createElement("a"),rE.setAttribute("href",n);const e=rE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Ny=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}(document.cookie,e)}}let rE,Ny=null;const v3=new zt("TRANSITION_ID"),FZ=[{provide:tf,useFactory:function(n,e,t){return()=>{t.get(cg).donePromise.then(()=>{const i=Rc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},Jn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Jn.getAllAngularRootElements=()=>e.getAllRootElements(),Jn.frameworkStabilizers||(Jn.frameworkStabilizers=[]),Jn.frameworkStabilizers.push(i=>{const r=Jn.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Rc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let LZ=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Py=new zt("EventManagerPlugins");let oE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),Fy=(()=>{class n extends w3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(E3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(E3))}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function E3(n){Rc().remove(n)}const LD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},kD=/%COMP%/g;function aE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let lE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new BD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case $t.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new QZ(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case $t.ShadowDom:return new ZZ(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=aE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Ie(oE),Ie(Fy),Ie(Ay))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class BD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(LD[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=LD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=LD[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(To.DashCase|To.Important)?e.style.setProperty(t,i,r&To.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&To.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,x3(i)):this.eventManager.addEventListener(e,t,x3(i))}}class QZ extends BD{constructor(e,t,i,r){super(e),this.component=i;const s=aE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(kD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(kD,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class ZZ extends BD{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=aE(r.id,r.styles,[]);for(let o=0;o{class n extends FD{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const D3=["alt","control","meta","shift"],oJ={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},M3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},aJ={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let lJ=(()=>{class n extends FD{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Rc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(D3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&M3.hasOwnProperty(e)&&(e=M3[e]))}return oJ[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),D3.forEach(s=>{s!=r&&aJ[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const mJ=_k(sX,"browser",[{provide:Oc,useValue:g3},{provide:ak,useValue:function(){ND.makeCurrent(),PD.init()},multi:!0},{provide:un,useFactory:function(){return function(n){Bi=n}(document),document},deps:[]}]),_J=[[],{provide:vu,useValue:"root"},{provide:Yo,useFactory:function(){return new Yo},deps:[]},{provide:Py,useClass:JZ,multi:!0,deps:[un,yn,Oc]},{provide:Py,useClass:lJ,multi:!0,deps:[un]},[],{provide:lE,useClass:lE,deps:[oE,Fy,Ay]},{provide:Qh,useExisting:lE},{provide:w3,useExisting:Fy},{provide:Fy,useClass:Fy,deps:[un]},{provide:eD,useClass:eD,deps:[yn]},{provide:oE,useClass:oE,deps:[Py,yn]},{provide:class{},useClass:LZ,deps:[]},[]];let UD=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Ay,useValue:t.appId},{provide:v3,useExisting:Ay},FZ]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:_J,imports:[Kr,hX]}),n})();"undefined"!=typeof window&&window;class xJ extends S{constructor(e,t){super()}schedule(e,t=0){return this}}class cE extends xJ{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let O3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Yl extends O3{constructor(e,t=O3.now){super(e,()=>Yl.delegate&&Yl.delegate!==this?Yl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Yl.delegate&&Yl.delegate!==this?Yl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const DJ=new class extends Yl{}(class extends cE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Nc=new F(n=>n.complete());function uE(n){return n?function(n){return new F(e=>n.schedule(()=>e.complete()))}(n):Nc}function nn(...n){let e=n[n.length-1];return Te(e)?(n.pop(),Be(n,e)):An(n)}function fg(n,e){return new F(e?t=>e.schedule(IJ,0,{error:n,subscriber:t}):t=>t.error(n))}function IJ({error:n,subscriber:e}){e.error(n)}class ta{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return nn(this.value);case"E":return fg(this.error);case"C":return uE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ta("N",e):ta.undefinedValueNotification}static createError(e){return new ta("E",void 0,e)}static createComplete(){return ta.completeNotification}}ta.completeNotification=new ta("C"),ta.undefinedValueNotification=new ta("N",void 0);class dE extends y{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(dE.dispatch,this.delay,new RJ(e,this.destination)))}_next(e){this.scheduleMessage(ta.createNext(e))}_error(e){this.scheduleMessage(ta.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ta.createComplete()),this.unsubscribe()}}class RJ{constructor(e,t){this.notification=e,this.destination=t}}class pg extends ee{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new NJ(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new U;if(this.isStopped||this.hasError?o=S.EMPTY:(this.observers.push(e),o=new ie(this,e)),r&&e.add(e=new dE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class NJ{constructor(e,t){this.time=e,this.value=t}}function sr(n,e){return"function"==typeof e?t=>t.pipe(sr((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new PJ(n))}class PJ{constructor(e){this.project=e}call(e,t){return t.subscribe(new FJ(e,this.project))}}class FJ extends pe{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new Et(this),r=this.destination;r.add(i),this.innerSubscription=O(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const hE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return hE.schedule(n,0);if(void 0===window.requestAnimationFrame)return hE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let HD;function $J(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!HD){const t=Element.prototype;HD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&HD.call(n,e)}(n,r)||(i=s,0))),i}class qJ{constructor(e,t){this.componentFactory=t.get(ol).resolveComponentFactory(e)}create(e){return new YJ(this.componentFactory,e)}}class YJ{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new pg(1),this.events=this.eventEmitters.pipe(sr(i=>Rn(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(yn),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=hE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=zn.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(me(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=hE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new Dm(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class KJ extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Iu(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?Iu(n,e,t).pipe(me(r=>L(r)?i(...r):i(r))):new F(r=>{R3(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function R3(n,e,t,i,r){let s;if(function(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const o=n;n.addEventListener(e,t,r),s=()=>o.removeEventListener(e,t,r)}else if(function(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const o=n;n.on(e,t),s=()=>o.off(e,t)}else if(function(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const o=n;n.addListener(e,t),s=()=>o.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let o=0,a=n.length;o=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function P3(n,e){return function(t,i){e(t,i,n)}}function Kl(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function or(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}class Ir extends ee{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new U;return this._value}next(e){super.next(this._value=e)}}class k3 extends y{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class nee extends y{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function B3(n,e,t,i,r=new nee(n,t,i)){if(!r.closed)return e instanceof F?e.subscribe(r):Oe(e)(r)}function gE(...n){return It(1)(nn(...n))}Object.create(Error.prototype);const U3=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function Xi(n){return e=>0===n?uE():e.lift(new see(n))}class see{constructor(e){if(this.total=e,this.total<0)throw new U3}call(e,t){return t.subscribe(new oee(e,this.total))}}class oee extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function Ui(n,e){return function(i){return i.lift(new cee(n,e))}}class cee{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new uee(e,this.predicate,this.thisArg))}}class uee extends y{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}function Xl(n){return function(t){const i=new dee(n),r=t.lift(i);return i.caught=r}}class dee{constructor(e){this.selector=e}call(e,t){return t.subscribe(new hee(e,this.selector,this.caught))}}class hee extends pe{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new Et(this);this.add(i);const r=O(t,i);r!==i&&this.add(r)}}}function _E(n=null){return e=>e.lift(new yee(n))}class yee{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new vee(e,this.defaultValue))}}class vee extends y{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function Hd(){}function jr(n,e,t){return function(r){return r.lift(new wee(n,e,t))}}class wee{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Eee(e,this.nextOrObserver,this.error,this.complete))}}class Eee extends y{constructor(e,t,i,r){super(e),this._tapNext=Hd,this._tapError=Hd,this._tapComplete=Hd,this._tapError=i||Hd,this._tapComplete=r||Hd,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||Hd,this._tapError=t.error||Hd,this._tapComplete=t.complete||Hd)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}class Mne{constructor(e){this.total=e}call(e,t){return t.subscribe(new Ine(e,this.total))}}class Ine extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}let GB=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=kt({type:n,selectors:[["","gaEvent","","gaCategory",""],["","gaCategory",""]],inputs:{gaCategory:"gaCategory"},exportAs:["gaCategory"]}),n})();const wg=new zt("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),gM=new zt("ngx-window",{providedIn:"root",factory:()=>function(n){return lf(n)?window:null}(vc(Oc))}),Nne=new zt("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(vc(gM))}),mM=new zt("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(vc(gM),vc(Nne))});let PE=(()=>{class n{constructor(t,i,r){this.settings=t,this._document=i,this._gtag=r}get document(){return this._document}throw(t){(this.settings.enableTracing||Sa())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((i,[r,s])=>Object.defineProperty(i,r,{value:s,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(i=>void 0!==i))}catch(i){this.throw(i)}}event(t,i,r,s,o){try{const a=new Map;i&&a.set("event_category",i),r&&a.set("event_label",r),s&&a.set("value",s),void 0!==o&&a.set("interaction",o);const l=this.toKeyValue(a);l?this.gtag("event",t,l):this.gtag("event",t)}catch(a){this.throw(a)}}pageView(t,i,r,s){try{const o=new Map([["page_path",t]]);i&&o.set("page_title",i),(r||this.document)&&o.set("page_location",r||this.document.location.href),s&&Object.entries(s).map(([a,l])=>o.set(a,l)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(o))}catch(o){this.throw(o)}}appView(t,i,r,s,o){try{const a=new Map([["screen_name",t],["app_name",i]]);r&&a.set("app_id",r),s&&a.set("app_version",s),o&&a.set("app_installer_id",o),this.gtag("event","screen_view",this.toKeyValue(a))}catch(a){this.throw(a)}}set(...t){try{this._gtag("set",...t)}catch(i){this.throw(i)}}exception(t,i){try{const r=new Map;t&&r.set("description",t),i&&r.set("fatal",i),this.toKeyValue(r)?this.gtag("event","exception",this.toKeyValue(r)):this.gtag("event","exception")}catch(r){this.throw(r)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(wg),Ie(un),Ie(mM))},n.\u0275prov=$e({factory:function(){return new n(Ie(wg),Ie(un),Ie(mM))},token:n,providedIn:"root"}),n})(),$B=(()=>{class n{constructor(t,i,r,s){this.gaCategoryDirective=t,this.gaService=i,this.settings=r,this.el=s,this.gaBind="click"}set gaBind(t){this.bindSubscription&&this.bindSubscription.unsubscribe(),this._gaBind=t,this.bindSubscription=Iu(this.el.nativeElement,t).subscribe(()=>this.trigger())}get gaBind(){return this._gaBind}ngOnDestroy(){this.bindSubscription&&this.bindSubscription.unsubscribe()}trigger(){try{if(!this.gaAction&&!this.gaEvent)throw new Error("You must provide a gaAction attribute to identify this event.");this.gaService.event(this.gaAction||this.gaEvent,this.gaCategoryDirective?this.gaCategoryDirective.gaCategory:void 0,this.gaLabel||this.label,this.gaValue,this.gaInteraction)}catch(t){this.throw(t)}}throw(t){(Sa()||this.settings.enableTracing)&&console&&console.warn&&console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)(De(GB,8),De(PE),De(wg),De(wn))},n.\u0275dir=kt({type:n,selectors:[["","gaEvent",""]],inputs:{gaBind:"gaBind",gaAction:"gaAction",gaLabel:"gaLabel",label:"label",gaValue:"gaValue",gaInteraction:"gaInteraction",gaEvent:"gaEvent"},exportAs:["gaEvent"]}),n})();const Fne={provide:tf,multi:!0,useFactory:function(n,e,t){return()=>or(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(Sa()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Sa()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));t||Sa()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),n.uri=n.uri||`https://www.googletagmanager.com/gtag/js?id=${n.trackingCode}`,n.initCommands=null!==(i=null==n?void 0:n.initCommands)&&void 0!==i?i:[],n.initCommands.find(o=>"config"===o.command)||n.initCommands.unshift({command:"config",values:[n.trackingCode]}),n.initCommands.find(o=>"js"===o.command)||n.initCommands.unshift({command:"js",values:[new Date]});for(const o of n.initCommands)e(o.command,...o.values);const r=t.createElement("script");r.async=!0,r.src=n.uri,n.nonce&&r.setAttribute("nonce",n.nonce),t.getElementsByTagName("head")[0].appendChild(r)})},deps:[wg,mM,un]};new zt("ngx-google-analytics-routing-settings",{factory:()=>({})});let FE=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:wg,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},Fne]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[]]}),n})(),LE=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new pg(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),jne=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new S,this.token=r,this.subscriptions.add(t.consentChange.subscribe(s=>this.toggleGoogleAnalytics("rescinded"===s)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(LE),Ie(gM),Ie(wg))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Vne=new zt("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),YB=[LE,jne,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new S;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(r=>this.saveConsent(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,i;const r=null===(i=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===i?void 0:i.call(t,this.key);if(null==r)return"not-set";const s=r.trim().toLowerCase();switch(s){case"given":case"rescinded":return s;default:return"not-set"}}saveConsent(t){var i,r;null===(r=null===(i=this.storage)||void 0===i?void 0:i.setItem)||void 0===r||r.call(i,this.key,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(LE),Ie(Vne))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})()];function zne(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let Gne=(()=>{class n{static forRoot(t){const{providers:i=[]}=FE.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[zne({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[...YB,{provide:tf,multi:!0,useFactory:()=>()=>{},deps:YB}],imports:[[FE]]}),n})();var _M;const $d={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"",hubmapPortalUrl:"",hubmapDataUrl:"",hubmapAssetsUrl:"",hubmapToken:null!==(_M=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==_M?_M:""},googleAnalyticsToken:"G-ERNVZ1Q4KE"},$ne={initialConfig:{},parse:{},rename:{}};class Wne{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},$ne),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let qne=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new Wne(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=kt({type:n,features:[ki]}),n})();const KB_json=n=>"string"==typeof n?JSON.parse(n):n;function XB(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function yM(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||XB()}const QB="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",kE=yM();class Kne{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function vM(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const ZB={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function JB(n){return"string"==typeof n?ZB[n.toUpperCase()]||ZB.WHITE:n}function BE(n,e){if(!n)throw new Error(e||"Assertion failed")}const Ql={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},$y=Ql.window||Ql.self||Ql.global,ej=Ql.process||{};function Eg(){let n;if(kE&&$y.performance)n=$y.performance.now();else if(ej.hrtime){const e=ej.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Sg={debug:kE&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},nie={enabled:!0,level:0};function pl(){}const tj={},nj={once:!0};function iie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let bM=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=QB,this._startTs=Eg(),this._deltaTs=Eg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Kne("__probe-".concat(this.id,"__"),nie),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Eg()-this._startTs).toPrecision(10))}getDelta(){return Number((Eg()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){BE(t,i)}warn(t){return this._getLogFunction(0,t,Sg.warn,arguments,nj)}error(t){return this._getLogFunction(0,t,Sg.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,Sg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Sg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Sg.debug||Sg.info,arguments,nj)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||pl,r&&[r],{tag:iie(i)}):pl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?kE?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=vM(r,e,t);console.log(...s)},r.src=n,pl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...vM(n,e,t)),pl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...vM(r,e,t)),r.src=n.toDataURL(),pl}return pl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=tt(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):pl}({image:r,message:s,scale:o}):pl}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||pl)}group(t,i,r={collapsed:!1}){r=rj({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||pl)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=ij(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=rj({logLevel:t,message:i,args:s,opts:o}),BE(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Eg();const a=o.tag||o.message;if(o.once){if(tj[a])return pl;tj[a]=Eg()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!kE&&"string"==typeof n&&(e&&(e=JB(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=JB(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return pl}}return n.VERSION=QB,n})();function ij(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return BE(Number.isFinite(e)&&e>=0),e}function rj(n){const{logLevel:e,message:t}=n;n.logLevel=ij(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return BE("string"===r||"object"===r),Object.assign(n,n.opts)}const Ni=new bM({id:"deck"}),Mi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mi,"IDENTITY",{get:()=>Ni.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},sj={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},dn=new bM({id:"luma.gl"});function Po(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function jE(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function fi(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function VE(n){return Po(jE(n),"Invalid WebGLRenderingContext"),n}function Fo(n){return Po(fi(n),"Requires WebGL2"),n}var Er=tt(761);const Wy={};const qy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Er.CO.console&&Er.CO.console.log&&Er.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};gf.prototype.VERTEX_ARRAY_BINDING_OES=34229,gf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;ifi(n)?void 0:0,Cie={3074:n=>fi(n)?void 0:36064,35723:n=>fi(n)?void 0:4352,35977:ur,32937:ur,36795:(n,e)=>{const t=fi(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(lj);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(lj);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:ur,35071:ur,37447:ur,36063:(n,e)=>{if(!fi(n)){const t=n.getExtension(aj);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:ur,35374:ur,35377:ur,34852:n=>{if(!fi(n)){const e=n.getExtension(aj);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(oj)?2147483647:65535,33001:n=>n.getExtension(oj)?16777216:65535,33e3:n=>16777216,37157:ur,35373:ur,35657:ur,36183:ur,37137:ur,34045:ur,35978:ur,35979:ur,35968:ur,35376:ur,35375:ur,35659:ur,37154:ur,35371:ur,35658:ur,35076:ur,35077:ur,35380:ur},cj="ANGLE_instanced_arrays",uj={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Po(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[cj]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){Po(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Po(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Po(!1)},deleteQuery:()=>{Po(!1)},beginQuery:()=>{Po(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},wM={readBuffer:(n,e,t)=>{fi(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:fi(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!fi(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!fi(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=Cie[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function kie(n,{extension:e,target:t,target2:i}){const r=uj[e];Po(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new gf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&kie(n,{extension:t,target:n.luma,target2:n})}(n,uj),function(n,{target:e,target2:t}){Object.keys(wM).forEach(i=>{if("function"==typeof wM[i]){const r=n[i]?n[i].bind(n):()=>{},s=wM[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const EM={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},Wd=(n,e,t)=>e?n.enable(t):n.disable(t),dj=(n,e,t)=>n.hint(t,e),xa=(n,e,t)=>n.pixelStorei(t,e);function Yy(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Vie={3042:Wd,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:Wd,2885:(n,e)=>n.cullFace(e),2929:Wd,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:Wd,35723:dj,36006:(n,e)=>{const t=fi(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:dj,2849:(n,e)=>n.lineWidth(e),32823:Wd,32824:"polygonOffset",10752:"polygonOffset",35977:Wd,32938:"sampleCoverage",32939:"sampleCoverage",3089:Wd,3088:(n,e)=>n.scissor(...e),2960:Wd,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:xa,3317:xa,37440:xa,37441:xa,37443:xa,3330:xa,3332:xa,3331:xa,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:xa,32878:xa,3316:xa,3315:xa,32877:xa,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Yy(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Yy(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Yy(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Yy(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=Yy(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Xr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const Uie={blendEquation:(n,e,t)=>n.blendEquationSeparate(Xr(32777,e,t),Xr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Xr(32969,e,t),Xr(32968,e,t),Xr(32971,e,t),Xr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Xr(32824,e,t),Xr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Xr(32938,e,t),Xr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Xr(2962,e,t),Xr(2967,e,t),Xr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Xr(34816,e,t),Xr(36003,e,t),Xr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Xr(2964,e,t),Xr(2965,e,t),Xr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Xr(34817,e,t),Xr(34818,e,t),Xr(34819,e,t))},hj={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Bc=(n,e)=>n.isEnabled(e),fj={3042:Bc,2884:Bc,2929:Bc,3024:Bc,32823:Bc,32926:Bc,32928:Bc,3089:Bc,2960:Bc,35977:Bc};function pj(n){for(const e in n)return!1;return!0}function zie(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||EM)){const r=e,s=fj[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=fj[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},EM),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Po(this.stateStack.length>0),Nu(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){Po(void 0!==s);const o=e[s],a=this.cache[s];zie(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function mj(n,e={}){const{enable:t=!0,copyState:i}=e;if(Po(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new $ie(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in hj)Hie(n,o,hj[o]);gj(n,"getParameter"),gj(n,"isEnabled")}return n.state.enable=t,n}function _j(n){Po(n.state),n.state.pop()}function Nu(n,e){if(Po(jE(n),"setParameters requires a WebGL context"),pj(e))return;const t={};for(const r in e){const s=Number(r),o=Vie[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)Uie[r](n,e,i)}function Zl(n,e,t){if(pj(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||mj(n,{copyState:!1}),n.state.push()}(n),Nu(n,e),i)r=t(n),_j(n);else try{r=t(n)}finally{_j(n)}return r}function Cg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function SM(n,e,t=!0){return function(n,e,t,i,r){const s=yj(n[0],e,t);let o=vj(n[1],e,i,r),a=yj(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=vj(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,Cg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function yj(n,e,t){return Math.min(Math.round(n*e),t-1)}function vj(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const CM=(0,Er.jU)(),Qie=CM&&"undefined"!=typeof document,bj={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function wj(n={}){Po(CM,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},bj,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(Qie&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=xM(r,n),function(n){const e=fi(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);dn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function xM(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},bj,e);const{manageState:t,debug:i}=e;return t&&mj(n,{copyState:!1,log:(...r)=>dn.log(1,...r)()}),CM&&i&&(Er.CO.makeDebugContext?(n=Er.CO.makeDebugContext(n,e),dn.level=Math.max(dn.level,1)):dn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function Ej(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class Sj{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ej(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ej()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class AM{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof Sj?e:new Sj(t,i)),this.stats[t]}}const Ky="8.5.7",mf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new AM({id:e})),this.stats.get(e)}};if(Er.CO.luma&&Er.CO.luma.VERSION!==Ky)throw new Error(`luma.gl - multiple VERSIONs detected: ${Er.CO.luma.VERSION} vs 8.5.7`);function rn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function TM(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return rn(void 0!==i,`Accessing undefined constant GL.${e}`),i}function qd(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Er.CO.luma||((0,Er.jU)()&&dn.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Er.CO.luma=Er.CO.luma||{VERSION:Ky,version:Ky,log:dn,stats:mf,globals:{modules:{},nodeIO:{}}});const DM={};function jc(n="id"){return DM[n]=DM[n]||1,`${n}-${DM[n]++}`}function Cj(n){return rn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function xg(n){let e=!0;for(const t in n){e=!1;break}return e}function xj(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw dn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ag="Resource subclass must define virtual methods";class Pu{constructor(e,t={}){VE(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||jc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){rn(e=TM(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=fi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=fi(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?qd(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=qd(this.gl,o[f]))}}return o}setParameter(e,t){rn(e=TM(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=fi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=TM(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return xj(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ag)}_deleteHandle(){throw new Error(Ag)}_bindHandle(e){throw new Error(Ag)}_getOptsFromHandle(){throw new Error(Ag)}_getParameter(e,t){throw new Error(Ag)}_setParameter(e,t){throw new Error(Ag)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=mf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;mf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=mf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=mf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function MM(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Xy(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function cre({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return ia.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ia.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=IM("Accessor",e,dre)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const Tj={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},hre={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Tj},fre={removedProps:Tj};class tr extends Pu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/ia.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ia.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=IM("Buffer",e,hre),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=IM("Buffer",e,fre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ia(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;rn(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Fo(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return Fo(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){Fo(this.gl);const s=Xy(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return rn((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(rn(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){rn(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=MM(e);return rn(s),this.setAccessor(new ia(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){rn(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/Xy(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ia(this.accessor,{type:MM(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return dn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return dn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return dn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return dn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ia(this.accessor,e),this}}const OM={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},Dj={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},Mj={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},mre=[9729,9728],Ij=Er.CO.WebGLBuffer||function(){};class Tg extends Pu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=OM[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=fi(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=OM[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=jc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(G=>this.initialize(Object.assign({},e,{pixels:G,data:G}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:x=!1,mipmaps:T=!0}=e;const{depth:q=0}=e;return({width:f,height:p,compressed:x,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:x,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=q,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),T&&this._isNPOT()&&(dn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),T=!1,this._updateForNPOT(l)),this.mipmaps=T,this.setImageData({data:t,width:f,height:p,depth:q,format:s,type:_,dataFormat:g,border:o,mipmaps:T,parameters:c,compressed:x}),T&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:x}=this;x.bindTexture(this.target,this.handle);let q,T=null;return({data:c,dataType:T}=this._getDataType({data:c,compressed:_})),Zl(this.gl,l,()=>{switch(T){case"null":x.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":x.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":q=Fo(x),q.bindBuffer(35052,c.handle||c),q.texImage2D(t,r,s,f,p,o,g,d,a),q.bindBuffer(35052,null);break;case"browser-object":fi(x)?x.texImage2D(t,r,s,f,p,o,g,d,c):x.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[G,ge]of c.entries())x.compressedTexImage2D(t,G,ge.format,ge.width,ge.height,o,ge.data);break;default:rn(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(Dj[this.dataFormat]||4)*(Mj[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:x={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),rn(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const T=i;i=T.data,o=T.shape[0],a=T.shape[1]}i instanceof tr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),Zl(this.gl,x,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof Ij){const T=Fo(this.gl);T.bindBuffer(35052,i),T.texSubImage2D(e,l,r,s,o,a,f,d,g),T.bindBuffer(35052,null)}else fi(this.gl)?Fo(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return dn.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof tr?{data:e.handle,dataType:"buffer"}:e instanceof Ij?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=OM[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},rn(r,"Could not deduced texture size"),rn(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),rn(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:rn(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(fi(this.gl)||!this.width||!this.height||Cj(this.width)&&Cj(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===mre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function _re(n,e){return rn("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class Aa extends Tg{static isSupported(e,t){return Tg.isSupported(e,t)}constructor(e,t={}){VE(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:_re(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const _f="EXT_color_buffer_float",Oj={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:_f,bpp:2},33327:{gl2:_f,bpp:4},34842:{gl2:_f,bpp:8},33326:{gl2:_f,bpp:4},33328:{gl2:_f,bpp:8},34836:{gl2:_f,bpp:16},35898:{gl2:_f,bpp:4}};class Dg extends Pu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=fi(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,Oj)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return rn(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&fi(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Oj[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const Lj="clear: bad arguments";function NM(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),rn(0!==o,Lj),Zl(n,s,()=>{n.clear(o)})}function kj(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function ei(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){kj(s,i,r,o,a,"next",l)}function a(l){kj(s,i,r,o,a,"throw",l)}o(void 0)})}}const PM=[34069,34070,34071,34072,34073,34074];let Cre=(()=>{class n extends Tg{constructor(t,i={}){VE(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return ei(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(PM.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),PM.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&dn.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((x,T)=>{t&&i?d.texImage2D(g,T,a,t,i,o,a,l,x):d.texImage2D(g,T,a,a,l,x)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=PM,n})();class xre extends Tg{static isSupported(e){return fi(e)}constructor(e,t={}){Fo(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Zl(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof tr&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(Dj[this.dataFormat]||4)*(Mj[this.type]||1),"Texture"),this.loaded=!0,this}}function Tre(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Ds(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function UE(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof Ds?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Tre(n),deleteFramebuffer:!0}}(n);rn(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),rn(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(Xy(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return rn(!1),0}}(t))}(o,c,r,a,l),c=c||MM(o);const x=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,x||null),f&&d.delete(),o}function FM(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=UE(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=cre({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return rn(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&dn.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){rn(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof Dg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(Ds.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&NM(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Fo(n),Zl(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:rn(!1,Lj)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return dn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return dn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return dn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return dn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return dn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return dn.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=Fo(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=qd(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?qd(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?qd(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(FM(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>dn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=FM(this,{targetMaxHeight:100});return dn.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new Aa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new Dg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new Dg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&rn(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof Dg?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:Fo(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:rn(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return fi(n)?n:null}(this.gl);t?t.readBuffer(e):rn(36064===e||1029===e,Bj),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Fo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):rn(1===e.length&&(36064===e[0]||1029===e[0]),Bj)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in jj)void 0===n.luma.caps[e]&&(n.luma.caps[e]=Uj(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Ds.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const jj={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new Aa(n,{format:6408,type:5126,dataFormat:6408}),t=new Ds(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function LM(n,e){return Vj(n,e)}function Vj(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>Uj(n,t))}function Uj(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=jj[e];let i;rn(t,e);const r=fi(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:rn(!1);return i}(n,e)),n.luma.caps[e]||dn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class kM{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},jre=(Math,1/180*Math.PI),Sr={};function Ure(n,{precision:e=Sr.precision||4}={}){return n=function(n){return Math.round(n/Sr.EPSILON)*Sr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function Yd(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Fu(n,e,t){if(Yd(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*jre,void 0)}(n)}function yf(n,e,t){return Fu(n,i=>Math.max(e,Math.min(t,i)))}function zE(n,e,t){return Yd(n)?n.map((i,r)=>zE(i,e[r],t)):t*e+(1-t)*n}function Jy(n,e,t){const i=Sr.EPSILON;t&&(Sr.EPSILON=t);try{if(n===e)return!0;if(Yd(n)&&Yd(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+Ure(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(Jj.length=n.length,i=Jj):i=Zj,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function tV(n){return n&&n[Symbol.asyncIterator]}function zM(n,e=(()=>!0)){return Array.isArray(n)?nV(n,e,[]):e(n)?[n]:[]}function nV(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function iV(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ht(ht(ht({},Cse[n.type]),e),n)):null}function rV(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function sV(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function oV(n){n.push(n.shift())}function GM(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function aV({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=GM(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const q=s;s=(G,ge)=>t._normalizeConstant(q(G,ge))}const _=p?(q,G)=>s(g,G):(q,G)=>s(g.subarray(q,q+a),G),x=n.getData({length:i}),T=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return HM({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===WE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=WE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wse}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==WE}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const T=f*a+l;for(let q=0;qd?c.set(ge,x):(e._normalizeValue(ge,q.target,0),bse({target:c,source:q.target,start:x,count:Ne}));x+=Ne*d}else e._normalizeValue(ge,c,x),x+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let WM={};function _o(n){Ni.level>0&&WM[n]&&WM[n].call(...arguments)}function Ta(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const lV="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Tse=`#version 300 es\n${lV}`;function cV(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function uV(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Tse:e>300?`#version ${e}\n${lV}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Ta(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class dV extends Pu{static isSupported(e){return fi(e)}constructor(e,t={}){Fo(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,xg(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,dn.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof tr?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Ose{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof tr?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&rn(fi(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new dV(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],rn(i[s]instanceof tr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new tr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function hV(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const nv="vs",Pse={[nv]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},qE="__LUMA_INJECT_DECLARATIONS__",fV=/void\s+main\s*\([^)]*\)\s*\{\n?/,pV=/}\n?[^{}]*$/,YM=[];function gV(n,e,t,i=!1){const r=e===nv;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),YM.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(pV,l=>a+l));break;case"fs:#decl":r||(n=n.replace(qE,a));break;case"fs:#main-start":r||(n=n.replace(fV,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(pV,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(qE,""),i&&(n=n.replace(/\}\s*$/,s=>s+Pse[e])),n}function KM(n){const e={};return Ta(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const Fse={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},YE="transform_uSize_",mV="transform_position";const Hse={10241:9728,10240:9728,10242:33071,10243:33071};class $se{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${YE}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${YE}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=UE(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Ta(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new tr(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new Ds(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters(Hse)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){rn(n instanceof Aa||n instanceof Cre||n instanceof xre);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const x=function(n,e){const t={},i=function(n){return cV(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${YE}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Ta(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(x){const{updatedLine:T,inject:q}=x;f[g]=T,c=KM([c,q]),Object.assign(a,x.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=cV(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){rn(i);const p=`${YE}${t}`;c=KM([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${mV} = transform_getPos(${p});\n gl_Position = vec4(${mV}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=KM([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||uV({version:hV(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Fse].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const XM={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function qse(n){let e=_V(n);return"object"===e?n?"type"in n?Object.assign({},n,XM[n.type]):"value"in n?(e=_V(n.value),Object.assign({type:e},n,XM[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},XM[e])}function _V(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class QM{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Ta("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=qse(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Ta(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Ta(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Qse(n){return function(n){const e={},t={};return ZM({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(vV(n))}function ZM({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof QM||(Ta("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ta(t.name,"shader module has no name"),(t=new QM(t)).dependencies=vV(t.dependencies)),t))}const JM={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},vf={};function soe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(JM).forEach(n=>{vf[n]=n});const eI={};function bV(n,e,t={}){const i=JM[e];if(Ta(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in eI)return eI[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),eI[e]=l,l}function KE(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=JM[e];Ta(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Ta(!1===r||!0===r),r}(n,t))}function Ig(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const wV=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],coe=[...wV,[Ig("attribute"),"in $1"],[Ig("varying"),"out $1"]],uoe=[...wV,[Ig("varying"),"in $1"]],EV=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],doe=[...EV,[Ig("in"),"attribute $1"],[Ig("out"),"varying $1"]],hoe=[...EV,[Ig("in"),"varying $1"]],tI="gl_FragColor",nI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,foe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function XE(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const _oe=`\n\n${qE}\n\n`,SV={[nv]:"vertex",fs:"fragment"};function CV(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Ta("string"==typeof t,"shader source must be a string");const f=i===nv,p=t.split("\n");let g=100,_="",x=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],x=p.slice(1).join("\n")):_=`#version ${g}`;const T={};r.forEach(We=>{Object.assign(T,We.getDefines())}),Object.assign(T,s);let q=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${SV[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${SV[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:soe(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return KE(n,vf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),KE(n,vf.GLSL_DERIVATIVES)&&bV(n,vf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),KE(n,vf.GLSL_FRAG_DATA)&&bV(n,vf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),KE(n,vf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(T)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const G=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),ge={},Ne={},Ge={};for(const We in a){const dt="string"==typeof a[We]?{injection:a[We],order:0}:a[We],Mt=We.match(/^(v|f)s:(#)?([\w-]+)$/);if(Mt){const Lt=Mt[3];Mt[2]?"decl"===Lt?Ne[We]=[dt]:Ge[We]=[dt]:ge[We]=[dt]}else Ge[We]=[dt]}for(const We of r){d&&We.checkDeprecations(x,d),q+=We.getModuleSource(i,g);const Mt=We.injections[i];for(const Ot in Mt){const Lt=Ot.match(/^(v|f)s:#([\w-]+)$/);if(Lt){const Jt="decl"===Lt[2]?Ne:Ge;Jt[Ot]=Jt[Ot]||[],Jt[Ot].push(Mt[Ot])}else ge[Ot]=ge[Ot]||[],ge[Ot].push(Mt[Ot])}}return q+=_oe,q=gV(q,i,Ne),q+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(G[i],ge),q+=x,q=gV(q,i,Ge),q=function(n,e,t){switch(e){case 300:return t?XE(n,coe):function(n){const e=(n=XE(n,uoe)).match(nI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${tI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(foe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${tI}\\b`,"g"),t)}return n}(n);case 100:return t?XE(n,doe):function(n){const e=(n=XE(n,hoe)).match(nI);if(e){const t=e[1];n=n.replace(nI,"").replace(new RegExp(`\\b${t}\\b`,"g"),tI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(q,l?100:g,f),q}function boe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Aoe={5126:Cr.bind(null,"uniform1fv",Da,1,yo),35664:Cr.bind(null,"uniform2fv",Da,2,yo),35665:Cr.bind(null,"uniform3fv",Da,3,yo),35666:Cr.bind(null,"uniform4fv",Da,4,yo),5124:Cr.bind(null,"uniform1iv",Kd,1,yo),35667:Cr.bind(null,"uniform2iv",Kd,2,yo),35668:Cr.bind(null,"uniform3iv",Kd,3,yo),35669:Cr.bind(null,"uniform4iv",Kd,4,yo),35670:Cr.bind(null,"uniform1iv",Kd,1,yo),35671:Cr.bind(null,"uniform2iv",Kd,2,yo),35672:Cr.bind(null,"uniform3iv",Kd,3,yo),35673:Cr.bind(null,"uniform4iv",Kd,4,yo),35674:Cr.bind(null,"uniformMatrix2fv",Da,4,ku),35675:Cr.bind(null,"uniformMatrix3fv",Da,9,ku),35676:Cr.bind(null,"uniformMatrix4fv",Da,16,ku),35678:Js,35680:Js,5125:Cr.bind(null,"uniform1uiv",QE,1,yo),36294:Cr.bind(null,"uniform2uiv",QE,2,yo),36295:Cr.bind(null,"uniform3uiv",QE,3,yo),36296:Cr.bind(null,"uniform4uiv",QE,4,yo),35685:Cr.bind(null,"uniformMatrix2x3fv",Da,6,ku),35686:Cr.bind(null,"uniformMatrix2x4fv",Da,8,ku),35687:Cr.bind(null,"uniformMatrix3x2fv",Da,6,ku),35688:Cr.bind(null,"uniformMatrix3x4fv",Da,12,ku),35689:Cr.bind(null,"uniformMatrix4x2fv",Da,8,ku),35690:Cr.bind(null,"uniformMatrix4x3fv",Da,12,ku),35678:Js,35680:Js,35679:Js,35682:Js,36289:Js,36292:Js,36293:Js,36298:Js,36299:Js,36300:Js,36303:Js,36306:Js,36307:Js,36308:Js,36311:Js},Toe={},Doe={},Moe={},xV=[0];function iI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(xV[0]=n,n=xV);const r=n.length;if(r%e&&dn.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Cr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{rn(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return MV(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:DV(s,c),warnings:DV(o,c)}}(i,this.source,this.shaderType,this.id);throw dn.error(`GLSL compilation errors in ${r}\n${s}`)(),dn.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class rI extends iv{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class sI extends iv{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Ms=5126,rv=5124,sv=5125,oI={[Ms]:[Ms,1,"float"],35664:[Ms,2,"vec2"],35665:[Ms,3,"vec3"],35666:[Ms,4,"vec4"],[rv]:[rv,1,"int"],35667:[rv,2,"ivec2"],35668:[rv,3,"ivec3"],35669:[rv,4,"ivec4"],[sv]:[sv,1,"uint"],36294:[sv,2,"uvec2"],36295:[sv,3,"uvec3"],36296:[sv,4,"uvec4"],35670:[Ms,1,"bool"],35671:[Ms,2,"bvec2"],35672:[Ms,3,"bvec3"],35673:[Ms,4,"bvec4"],35674:[Ms,8,"mat2"],35685:[Ms,8,"mat2x3"],35686:[Ms,8,"mat2x4"],35675:[Ms,12,"mat3"],35687:[Ms,12,"mat3x2"],35688:[Ms,12,"mat3x4"],35676:[Ms,16,"mat4"],35689:[Ms,16,"mat4x2"],35690:[Ms,16,"mat4x3"]};function FV(n){const e=oI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function LV(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Ms}for(const t in oI){const[i,r,s]=oI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class fae{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!fi(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=FV(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ia(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=FV(i),l={location:e,name:t,accessor:new ia({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const pae=35981,gae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class BV extends Pu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",gae),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=pae}=e;return this.hash=t||"",this.vs="string"==typeof i?new rI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new sI(this.gl,{id:`${e.id}-fs`,source:r}):r,rn(this.vs instanceof rI),rn(this.fs instanceof sI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Fo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new fae(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:x,samplers:T}){if((x||T)&&(dn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(x||{})),dn.priority>=e){const q=g?g.id:"default",G=`mode=${qd(this.gl,t)} verts=${i} instances=${c} indexType=${qd(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${q}`;dn.log(e,G)()}return rn(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const q=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return rn(!1),0}}(t);p.begin(q)}this._bindTextures(),Zl(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&fi(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){dn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Roe(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof Ds&&(s=s.texture),s instanceof Tg)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&Noe(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new rI({handle:r});break;case 35632:i.fs=new sI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=jc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),dn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),dn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||dn.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(ge=>this._getHash(ge.name)).sort(),g=o.map(ge=>this._getHash(ge)),_=Object.keys(r).sort(),x=Object.keys(s).sort(),T=[],q=[];for(const ge of _)T.push(this._getHash(ge)),T.push(this._getHash(r[ge]));for(const ge of x)q.push(this._getHash(ge)),q.push(this._getHash(s[ge]));const G=`${d}/${f}D${T.join("/")}M${p.join("/")}I${q.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[G]){const ge=function(n,e){const{vs:t,fs:i}=e,r=Qse(e.modules||[]);return{gl:n,vs:CV(n,Object.assign({},e,{source:t,type:nv,modules:r})),fs:CV(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:boe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[G]=new BV(this.gl,{hash:G,vs:ge.vs,fs:ge.fs,varyings:o,bufferMode:a}),this._getUniforms[G]=ge.getUniforms||(Ne=>{}),this._useCounts[G]=0}return this._useCounts[G]++,this._programCache[G]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":$y.chrome?"Chrome":$y.safari?"Safari":$y.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ma(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ma.MAX_ATTRIBUTES=Ma.MAX_ATTRIBUTES||e.getParameter(34921),Ma.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ma._setConstantFloatArray(e,t,i);break;case Int32Array:Ma._setConstantIntArray(e,t,i);break;case Uint32Array:Ma._setConstantUintArray(e,t,i);break;default:rn(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Ma.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return rn(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(rn(fi(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ma.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new tr(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!eS||eS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Eae=/^(.+)__LOCATION_([0-9]+)$/,Sae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Cae{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Ma(e),xj(this,"VertexArray","v6.0",Sae),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new tr(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,dn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ia.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return rn(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Eae.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof tr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof tr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof tr))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof tr){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return dn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function av(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=av(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function jV(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof tr){const p=e,{data:g,changed:_}=p.getDebugData();let x;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?x=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${qd(r,s)})`:(c=!0,x=`${l} bytes`),{[i]:`${d}${av(f,{size:o,isInteger:c})}`,"Format ":x}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${av(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Tae(n,e){const{type:t,size:i}=e,r=LV(t,i);return r?`${n} (${r.name})`:n}function VV({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){rn(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:av(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function aI({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?av(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function UV(n){const{type:e,size:t}=n.accessor,i=LV(e,t);return i?`${i.name} ${n.name}`:n.name}const Iae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rae(n,e){const{attributeMap:t=Iae}=e||{};return t&&t[n]||n}function Nae(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}rn(Number.isFinite(e.size),`attribute ${n} needs size`)}const zV=()=>{},Lae={};class tS{constructor(e,t={}){const{id:i=jc("model")}=t;rn(jE(e)),this.id=i,this.gl=e,this.id=t.id||jc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||ov.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},rn(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return rn(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return rn(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Rae(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ht({},o);delete c.value,i[a]=[new tr(n,l),c],Nae(s,c)}}if(r){const s=r.value||r;rn(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new tr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(xg(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return NM(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),dn.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&dn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:x,instanceCount:T}=this,{onBeforeRender:q=zV,onAfterRender:G=zV}=this.props;q(),this.program.setUniforms(this.uniforms);const ge=this.program.draw(Object.assign(Lae,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:x,instanceCount:T,offset:f?g:0}));return G(),dn.priority>=2&&this._logDrawCallEnd(c,l,i),ge}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return dn.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}rn(t instanceof BV,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new Cae(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof tr&&t.delete()}}_setAnimationProps(e){this.animated&&rn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(xg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new dV(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:dn.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=jV(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Tae(s.name,a)}`),t[o]=jV(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=VV({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=VV({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&dn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&dn.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${UV(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${UV(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);dn.table(e,s)(),dn.table(e,o)(),dn.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),dn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class lI{static isSupported(e){return fi(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();rn(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new tS(t,Object.assign({},e,{fs:e.fs||uV({version:hV(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(xg(n.feedbackBuffers)&&xg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Ose(e,t)),function(n){return!(xg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new $se(e,t)),rn(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function nS(){}const jae={onStart:nS,onUpdate:nS,onInterrupt:nS,onEnd:nS};class lv{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ht(ht({},jae),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const qae={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new lv(i),this.attribute=t,this.attributeInTransition=new $M(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=sV(e.size);return new lI(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new tr(e,r),new tr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;oV(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)aV(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=GM(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:rV(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new lv(i),this.attribute=t,this.attributeInTransition=new $M(e,Vn(ht({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new Aa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new Ds(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=sV(e.size);return new lI(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new tr(e,r),new tr(e,r),new tr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)aV(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=GM(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:rV(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),oV(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),UE(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class Yae{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=lI.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Ni.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=qae[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ni.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const HV="attributeManager.invalidate";class ele{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new Yae(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;_o("attribute.updateStart",t),t.allocate(i)&&_o("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,_o("attribute.updateEnd",t,i))}}function $V(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function WV(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=iV(r)))return;const o=rle[r.type];if(!o)return void Ni.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Vn(ht({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const iS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:ole}=iS;function cle(n,e){if(!n.transitions)return null;const t={},i=uI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&cI(n[r],e[r],s)&&(t[r]=!0)}return t}function qV({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=cI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=cI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function cI(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function hle(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!yle(i[r],e[r])){t=n(i),e=i;break}return t}}function vle(n,e){if(!e)return n;const t=ht(ht({},n),e);if("defines"in e&&(t.defines=ht(ht({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=ht({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function sS(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],x=e[13],T=e[14],q=e[15],G=t*a-i*o,ge=t*l-r*o,Ne=t*c-s*o,Ge=i*l-r*a,We=i*c-s*a,dt=r*c-s*l,Mt=d*x-f*_,Ot=d*T-p*_,Lt=d*q-g*_,Qt=f*T-p*x,Jt=f*q-g*x,wt=p*q-g*T,Ct=G*wt-ge*Jt+Ne*Qt+Ge*Lt-We*Ot+dt*Mt;return Ct?(n[0]=(a*wt-l*Jt+c*Qt)*(Ct=1/Ct),n[1]=(r*Jt-i*wt-s*Qt)*Ct,n[2]=(x*dt-T*We+q*Ge)*Ct,n[3]=(p*We-f*dt-g*Ge)*Ct,n[4]=(l*Lt-o*wt-c*Ot)*Ct,n[5]=(t*wt-r*Lt+s*Ot)*Ct,n[6]=(T*Ne-_*dt-q*ge)*Ct,n[7]=(d*dt-p*Ne+g*ge)*Ct,n[8]=(o*Jt-a*Lt+c*Mt)*Ct,n[9]=(i*Lt-t*Jt-s*Mt)*Ct,n[10]=(_*We-x*Ne+q*G)*Ct,n[11]=(f*Ne-d*We-g*G)*Ct,n[12]=(a*Ot-o*Qt-l*Mt)*Ct,n[13]=(t*Qt-i*Ot+r*Mt)*Ct,n[14]=(x*ge-_*Ge-T*G)*Ct,n[15]=(d*Ge-f*ge+p*G)*Ct,n):null}function Vc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],x=e[12],T=e[13],q=e[14],G=e[15],ge=t[0],Ne=t[1],Ge=t[2],We=t[3];return n[0]=ge*i+Ne*a+Ge*f+We*x,n[1]=ge*r+Ne*l+Ge*p+We*T,n[2]=ge*s+Ne*c+Ge*g+We*q,n[3]=ge*o+Ne*d+Ge*_+We*G,n[4]=(ge=t[4])*i+(Ne=t[5])*a+(Ge=t[6])*f+(We=t[7])*x,n[5]=ge*r+Ne*l+Ge*p+We*T,n[6]=ge*s+Ne*c+Ge*g+We*q,n[7]=ge*o+Ne*d+Ge*_+We*G,n[8]=(ge=t[8])*i+(Ne=t[9])*a+(Ge=t[10])*f+(We=t[11])*x,n[9]=ge*r+Ne*l+Ge*p+We*T,n[10]=ge*s+Ne*c+Ge*g+We*q,n[11]=ge*o+Ne*d+Ge*_+We*G,n[12]=(ge=t[12])*i+(Ne=t[13])*a+(Ge=t[14])*f+(We=t[15])*x,n[13]=ge*r+Ne*l+Ge*p+We*T,n[14]=ge*s+Ne*c+Ge*g+We*q,n[15]=ge*o+Ne*d+Ge*_+We*G,n}function cv(n,e,t){var o,a,l,c,d,f,p,g,_,x,T,q,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],x=e[9],T=e[10],q=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=x,n[10]=T,n[11]=q,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+x*s+e[13],n[14]=l*i+p*r+T*s+e[14],n[15]=c*i+g*r+q*s+e[15]),n}function uv(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function KV(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function XV(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function QV(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function ZV(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],x=n[13],T=n[14],q=n[15],G=e[0],ge=e[1],Ne=e[2],Ge=e[3],We=e[4],dt=e[5],Mt=e[6],Ot=e[7],Lt=e[8],Qt=e[9],Jt=e[10],wt=e[11],Ct=e[12],Ht=e[13],ft=e[14],Kt=e[15];return Math.abs(t-G)<=hr*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(i-ge)<=hr*Math.max(1,Math.abs(i),Math.abs(ge))&&Math.abs(r-Ne)<=hr*Math.max(1,Math.abs(r),Math.abs(Ne))&&Math.abs(s-Ge)<=hr*Math.max(1,Math.abs(s),Math.abs(Ge))&&Math.abs(o-We)<=hr*Math.max(1,Math.abs(o),Math.abs(We))&&Math.abs(a-dt)<=hr*Math.max(1,Math.abs(a),Math.abs(dt))&&Math.abs(l-Mt)<=hr*Math.max(1,Math.abs(l),Math.abs(Mt))&&Math.abs(c-Ot)<=hr*Math.max(1,Math.abs(c),Math.abs(Ot))&&Math.abs(d-Lt)<=hr*Math.max(1,Math.abs(d),Math.abs(Lt))&&Math.abs(f-Qt)<=hr*Math.max(1,Math.abs(f),Math.abs(Qt))&&Math.abs(p-Jt)<=hr*Math.max(1,Math.abs(p),Math.abs(Jt))&&Math.abs(g-wt)<=hr*Math.max(1,Math.abs(g),Math.abs(wt))&&Math.abs(_-Ct)<=hr*Math.max(1,Math.abs(_),Math.abs(Ct))&&Math.abs(x-Ht)<=hr*Math.max(1,Math.abs(x),Math.abs(Ht))&&Math.abs(T-ft)<=hr*Math.max(1,Math.abs(T),Math.abs(ft))&&Math.abs(q-Kt)<=hr*Math.max(1,Math.abs(q),Math.abs(Kt))}function JV(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function oS(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new ra(4);ra!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const eU=[0,0,0,0],$le=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Wle=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],qle=[0,0,0],Yle=[0,0,0],Kle=rS(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=eU,l=eU,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=tU(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=oS([],l,o),s=i||s,o=Vc([],r,s),o=Vc([],o,$le)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:qle,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Mi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Mi.LNGLAT:case Mi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Mi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function tU(n,e,t=Yle){let r,i=t,s=!0;switch(r=e===Mi.LNGLAT_OFFSETS||e===Mi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case kc.WEB_MERCATOR:(e===Mi.LNGLAT||e===Mi.CARTESIAN)&&(s=!1);break;case kc.WEB_MERCATOR_AUTO_OFFSET:e===Mi.LNGLAT?i=r:e===Mi.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case kc.IDENTITY:i=n.position.map(Math.fround);break;case kc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class Jle extends BM{get ELEMENTS(){return Lu(!1),0}get RANK(){return Lu(!1),0}toString(){let e="[";if(Sr.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new Gn).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return QV(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],x=n[14],T=n[15];return(e*o-t*s)*(f*T-p*x)-(e*a-i*s)*(d*T-p*_)+(e*l-r*s)*(d*x-f*_)+(t*a-i*o)*(c*T-p*g)-(t*l-r*o)*(c*x-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return sS(this,this),this.check()}multiplyLeft(e){return Vc(this,e,this),this.check()}multiplyRight(e){return Vc(this,this,e),this.check()}rotateX(e){return KV(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return XV(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,x,T,q,G,ge,Ne,Ge,We,dt,Mt,Ot,Lt,Qt,Jt,wt,Ct,Ht,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*tc+ec)/(2*ec),512*(ec+Math.log(Math.tan(sU+e*tc*.5)))/(2*ec)]}function Xd([n,e]){const t=n/512*(2*ec)-ec,i=2*(Math.atan(Math.exp(e/512*(2*ec)-ec))-sU);return[t*fI,i*fI]}function lS({latitude:n,longitude:e,highPrecision:t=!1}){Bu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*tc),o=512/360,a=o/s,l=512/pI/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=tc*Math.tan(n*tc)/s,f=512/pI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function aU(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=lS({longitude:t,latitude:i,highPrecision:!0}),d=Bg(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Xd(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function lU({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return cv(o,o,[0,0,-i]),KV(o,o,-e*tc),XV(o,o,t*tc),uv(o,o,[r/=n,r,r]),s&&cv(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function cU({width:n,height:e,fovy:t=cS(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=cS(i));const a=.5*t*tc,l=uU(t),c=r*tc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function cS(n){return 2*Math.atan(.5/n)*fI}function uU(n){return.5/Math.tan(.5*n*tc)}function gI(n,e){const[t,i,r=0]=n;return Bu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),kg(e,[t,i,r,1])}function bf(n,e,t=0){const[i,r,s]=n;if(Bu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return kg(e,[i,r,s,1]);const o=kg(e,[i,r,0,1]),a=kg(e,[i,r,1,1]),l=o[2],c=a[2];return nU([],o,a,l===c?0:((t||0)-l)/(c-l))}function dU({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Bu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new uS({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],x=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Bu(x[0]>0&&x[1]>0);const T=x[0]/_[0],q=x[1]/_[1],Ge=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/T,(g[1]+p[1])/2+(s.bottom-s.top)/2/q]),We=Math.min(r,f.zoom+hI(Math.abs(Math.min(T,q))));return Bu(Number.isFinite(We)),{longitude:Ge[0],latitude:Ge[1],zoom:We}}const hU=Math.PI/180;function fU(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*hU:Math.atan(.5/n.altitude))>(90-n.pitch)*hU-.01?(l=pU(n,0,e),c=pU(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function pU(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=kg(i,[e,0,1,1]),s=kg(i,[e,n.height,1,1]),c=Xd(nU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class uS{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=cS(l=1.5):null===c?c=cS(l):null===l&&(l=uU(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=lS({longitude:r,latitude:i}),x=Bg([r,i]);x[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(x,x,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=cU({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return QV([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=lU({height:t,scale:g,center:x,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=x,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Vc(s,s,i),Vc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];uv(o,o,[e/2,-t/2,1]),cv(o,o,[1,-1,0]),Vc(o,o,s);const a=sS([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof uS&&e.width===this.width&&e.height===this.height&&ZV(e.projectionMatrix,this.projectionMatrix)&&ZV(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=gI(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=bf([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Bg(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=Xd(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Bg(e)}unprojectFlat(e){return Xd(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=bf(t,this.pixelUnprojectionMatrix),s=Fg([],Bg(e),dI([],i));return Xd(Fg([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=dU(Object.assign({width:i,height:r,bounds:e},t));return new uS({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return fU(this,e.z||0)}}const dce=Math.PI/180,hce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],mI=[0,0,0],pce={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let jg=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?kc.WEB_MERCATOR:kc.WEB_MERCATOR_AUTO_OFFSET:kc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Jy(t.projectionMatrix,this.projectionMatrix)&&Jy(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=gI(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=bf([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Bg(t):t}unprojectFlat(t){return this.isGeospatial?Xd(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?lS({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends jg{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:x=1.5}=t;const T=Math.pow(2,s);g=g||1,_=_||1,x=Math.max(.75,x);const{fov:q,aspect:G,focalDistance:ge,near:Ne,far:Ge}=cU({width:g,height:_,pitch:o,altitude:x,nearZMultiplier:l,farZMultiplier:c});let We=lU({height:_,pitch:o,bearing:a,scale:T,altitude:x});p&&(We=(new Gn).translate([512*p,0,0]).multiplyLeft(We)),super(Vn(ht({},t),{width:g,height:_,viewMatrix:We,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:q,aspect:G,focalDistance:ge,near:Ne,far:Ge})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=x,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(Vn(ht({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return aU(t,i)}panByPosition(t,i){const r=bf(i,this.pixelUnprojectionMatrix),o=Fg([],this.projectFlat(t),dI([],r)),a=Fg([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=fU(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=dU(ht({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function _I(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof vU){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function bU(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=oS([],[o,a,l,1],t)),i){case Mi.LNGLAT:return _I([o,a,l],e,s);case Mi.LNGLAT_OFFSETS:return _I([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mi.METER_OFFSETS:return _I(aU(r,[o,a,l]),e,s);case Mi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const _ce={10241:9987,10240:9729,10242:33071,10243:33071},yI={},bce={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||fv(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>vI(n,e)},accessor:{validate(n,e){const t=dS(n);return"function"===t||t===dS(e.value)},equal:(n,e,t)=>"function"==typeof e||vI(n,e)},array:{validate:(n,e)=>e.optional&&!n||fv(n),equal:(n,e,t)=>t.compare?vI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof Aa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new Aa(t,Vn(ht({},e),{parameters:ht(ht(ht({},_ce),i),n.props.textureParameters)}));return yI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof Aa)||yI[n.id]&&(n.delete(),delete yI[n.id])}(n)}}};function vI(n,e){if(n===e)return!0;if(!fv(n)||!fv(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Nce,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Oce]||{},i=e[Ice]||e,r=e[Rce]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(tV(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return ei(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=wI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const T=_,{dataTransform:q}=i.component?i.component.props:{};a=q?q(T,a):a.concat(T),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(T){d=!0,f=T}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const x=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;x&&x(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:CU,ASYNC_RESOLVED:xU,ASYNC_DEFAULTS:Pce}=iS,Fce={};let Lce=0,kce=(()=>{class n{constructor(){this.props=Sce.apply(this,arguments),this.id=this.props.id,this.count=Lce++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[Pce])s in i[xU]?r[s]=i[xU][s]:s in i[CU]&&(r[s]=i[CU][s]);return new this.constructor(ht(ht(ht({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new SU({})}}return n.componentName="Component",n.defaultProps=Fce,n})();class Bce extends SU{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const nc=n=>"function"==typeof n,Qd=n=>null!==n&&"object"==typeof n,TU=n=>Qd(n)&&n.constructor==={}.constructor,jce=n=>n&&"function"==typeof n[Symbol.iterator],Vce=n=>n&&"function"==typeof n[Symbol.asyncIterator],gv=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Vg=n=>"undefined"!=typeof Blob&&n instanceof Blob,DU=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||Qd(n)&&nc(n.tee)&&nc(n.cancel)&&nc(n.getReader))(n)||(n=>Qd(n)&&nc(n.read)&&nc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function wf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function EI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function SI(n){var e,t;let i;return wf(n,"null loader"),wf(EI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Vn(ht({},n=n[0]),{options:ht(ht({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Uc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},CI=Uc.global||Uc.self||Uc.window||{},Wce="object"!=typeof process||"[object process]"!==String(process)||process.browser,MU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);MU&&parseFloat(MU[1]);const AI={};function qce(n){for(const e in AI)n.startsWith(e)&&(n=n.replace(e,AI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const Yce=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Kce=/^([-\w.]+\/[-\w.+]+)/;function Xce(n){const e=Kce.exec(n);return e?e[1]:n}function IU(n){const e=Yce.exec(n);return e?e[1]:""}const Qce=/\?.*/;function gS(n){if(gv(n)){const e=TI(n.url||"");return{url:e,type:Xce(n.headers.get("content-type")||"")||IU(e)}}return Vg(n)?{url:TI(n.name||""),type:n.type||""}:"string"==typeof n?{url:TI(n),type:IU(n)}:{url:"",type:""}}function Zce(n){return gv(n)?n.headers["content-length"]||-1:Vg(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function TI(n){return n.replace(Qce,"")}function OU(n){return DI.apply(this,arguments)}function DI(){return(DI=ei(function*(n){if(gv(n))return n;const e={},t=Zce(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=gS(n);r&&(e["content-type"]=r);const s=yield tue(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function Jce(n){return MI.apply(this,arguments)}function MI(){return(MI=ei(function*(n){if(!n.ok){const e=yield eue(n);throw new Error(e)}})).apply(this,arguments)}function eue(n){return II.apply(this,arguments)}function II(){return(II=ei(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function tue(n){return OI.apply(this,arguments)}function OI(){return(OI=ei(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${nue(n.slice(0,5))}`:null})).apply(this,arguments)}function nue(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const PU={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){$n(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},sue={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function NI(){CI.loaders=CI.loaders||{};const{loaders:n}=CI;return n._state=n._state||{},n._state}const PI=()=>{const n=NI();return n.globalOptions=n.globalOptions||ht({},PU),n.globalOptions};function oue(n,e,t,i){return t=t||[],function(n,e){LU(n,null,PU,sue,e);for(const t of e)LU(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=ht({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new iue),BU(r,PI()),BU(r,e),r}(e,n,i)}function FU(n,e){const t=PI(),i=n||t;return"function"==typeof i.fetch?i.fetch:Qd(i.fetch)?r=>RU(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:RU}function LU(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&Qd(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)NU.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=lue(a,r);NU.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function lue(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function BU(n,e){for(const t in e)t in e&&(n[t]=TU(e[t])&&TU(n[t])?ht(ht({},n[t]),e[t]):e[t])}function zc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function due(n,e="3.0.12"){return zc(n,"no worker provided"),!(!e||!n.version)}const Hc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},hue=Hc.global||Hc.self||Hc.window||{},FI="object"!=typeof process||"[object process]"!==String(process)||process.browser,LI="function"==typeof importScripts,fue="undefined"!=typeof window&&void 0!==window.orientation,jU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),kI=(jU&&parseFloat(jU[1]),new Map);function VU(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function UU(n,e=!0,t){const i=t||new Set;if(n)if(zU(n))i.add(n);else if(zU(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)UU(n[r],e,i);return void 0===t?Array.from(i):[]}function zU(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const BI=()=>{};class HU{static isSupported(){return"undefined"!=typeof Worker}constructor(e){$n(this,"name",void 0),$n(this,"source",void 0),$n(this,"url",void 0),$n(this,"terminated",!1),$n(this,"worker",void 0),$n(this,"onMessage",void 0),$n(this,"onError",void 0),$n(this,"_loadableURL","");const{name:t,source:i,url:r}=e;zc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=BI,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=BI,this.onError=BI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||UU(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){zc(n.source&&!n.url||!n.source&&n.url);let e=kI.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?VU(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),kI.set(n.url,e)),n.source&&(e=VU(n.source),kI.set(n.source,e))),zc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class _ue{constructor(e,t){$n(this,"name",void 0),$n(this,"workerThread",void 0),$n(this,"isRunning",void 0),$n(this,"result",void 0),$n(this,"_resolve",void 0),$n(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zc(this.isRunning),this.isRunning=!1,this._reject(e)}}class yue{constructor(e){$n(this,"name","unnamed"),$n(this,"source",void 0),$n(this,"url",void 0),$n(this,"maxConcurrency",1),$n(this,"maxMobileConcurrency",1),$n(this,"onDebug",()=>{}),$n(this,"reuseWorkers",!0),$n(this,"props",{}),$n(this,"jobQueue",[]),$n(this,"idleQueue",[]),$n(this,"count",0),$n(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=ht(ht({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return ei(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return ei(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new _ue(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class ju{static isSupported(){return HU.isSupported()}static getWorkerFarm(e={}){return ju._workerFarm=ju._workerFarm||new ju({}),ju._workerFarm.setProps(e),ju._workerFarm}constructor(e){$n(this,"props",void 0),$n(this,"workerPools",new Map),this.props=ht({},vue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ht(ht({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new yue({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function wue(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return zc(r),r}function Eue(n,e){return!!ju.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Sue(n,e,t,i,r){return jI.apply(this,arguments)}function jI(){return(jI=ei(function*(n,e,t,i,r){const s=n.id,o=wue(n,t),l=ju.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Cue.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Cue(n,e,t,i){return VI.apply(this,arguments)}function VI(){return(VI=ei(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}$n(ju,"_workerFarm",void 0);var $U=tt(521);function WU(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return $U.toArrayBuffer?$U.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Due(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function qU(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Mue(n){return zI.apply(this,arguments)}function zI(){return(zI=ei(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=wI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Due(...e)})).apply(this,arguments)}const Rue=262144;function YU(n){this.wrapped=n}function mv(n){return new YU(n)}function _v(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof YU;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function GI(n){return function(){return new _v(n.apply(this,arguments))}}function $I(){return($I=GI(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(YI)}function Vue(n,e,t){return KI.apply(this,arguments)}function KI(){return(KI=ei(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return jue(n,e);if(Vg(n)&&(n=yield OU(n)),gv(n)){const r=n;return yield Jce(r),e.binary?yield r.arrayBuffer():yield r.text()}if(DU(n)&&(n=Bue(n,t)),jce(n)||Vce(n))return Mue(n);throw new Error(YI)})).apply(this,arguments)}function zue(n,e,t=null){if(t)return t;const i=ht({fetch:FU(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function Hue(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const XU=()=>{const n=NI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function QU(n){const e=XU();n=Array.isArray(n)?n:[n];for(const t of n){const i=SI(t);e.find(r=>i===r)||e.unshift(i)}}const $ue=/\.([^.]+)$/;function Wue(n){return ZI.apply(this,arguments)}function ZI(){return(ZI=ei(function*(n,e=[],t,i){if(!JU(n))return null;let r=ZU(n,e,Vn(ht({},t),{nothrow:!0}),i);if(r)return r;if(Vg(n)&&(r=ZU(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(ez(n));return r})).apply(this,arguments)}function ZU(n,e=[],t,i){if(!JU(n))return null;if(e&&!Array.isArray(e))return SI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...XU()),function(n){for(const e of n)SI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=gS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=JI(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&$ue.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||JI(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Zue(e,t))return t}else if(ArrayBuffer.isView(e)){if(tz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&tz(e,0,t))return t;return null}(e,n),a=a||JI(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(ez(n));return s}function JU(n){return!(n instanceof Response&&204===n.status)}function ez(n){const{url:e,type:t}=gS(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?eO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?eO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function JI(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Zue(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function tz(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Gc=new Uint8ClampedArray(0);const cde={data:{type:"data",value:ade,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=Vn(ht({},r),{fetch:Vn(ht({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:_S(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):_S(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mi.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let rO=(()=>{class n extends kce{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=bU(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=gI(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=ht({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Mi.DEFAULT&&(t=i.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=tU(t,i,r),f=bU(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mi.DEFAULT||t===Mi.LNGLAT||t===Mi.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){Jl(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=vle(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!lde({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Gc.length/3);if(this.internalState.usesPickingColorCache=!0,rnz&&Ni.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Gc=Zy.allocate(Gc,i,{size:3,copy:!0,maxCount:Math.max(i,nz)});const s=Math.floor(Gc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&_o("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=qV({newProps:n,oldProps:e,propTypes:uI(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&YV(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&YV(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:hle(n,e),transitionsChanged:cle(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=uI(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new ele(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){Jl(!this.internalState&&!this.state),Jl(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Bce({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ni.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new sle(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){_o("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=cde,n})(),dde=(()=>{class n extends rO{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:T,fetch:q,_subLayerProps:G}=this.props,ge={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:T,fetch:q},Ne=G&&G[t.id],Ge=Ne&&Ne.updateTriggers,We=t.id||"sublayer";if(Ne){const dt=this.constructor._propTypes,Mt=t.type?t.type._propTypes:{};for(const Ot in Ne){const Lt=Mt[Ot]||dt[Ot];Lt&&"accessor"===Lt.type&&(Ne[Ot]=this.getSubLayerAccessor(Ne[Ot]))}}Object.assign(ge,t,Ne),ge.id="".concat(this.props.id,"-").concat(We),ge.updateTriggers=ht(ht({all:this.props.updateTriggers.all},t.updateTriggers),Ge);for(const dt of T){const Mt=dt.getSubLayerProps.call(this,dt);Mt&&Object.assign(ge,Mt,{updateTriggers:Object.assign(ge.updateTriggers,Mt.updateTriggers)})}return ge}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=zM(t,Boolean),this.internalState.subLayers=t),_o("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const hde=/([0-9]+\.?[0-9]*)(%|px)/;function yS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(hde);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function vS(n,e){return n.relative?Math.round(n.position*e):n.position}function yv(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&yv(i,r)))return!1}return!0}class sO{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=jg}=e;Jl(!p||p instanceof jg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Vn(ht({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):yv(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=ht({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:vS(this._x,e),y:vS(this._y,t),width:vS(this._width,e),height:vS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ht(ht({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ht(ht(ht({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=yS(e),this._y=yS(t),this._width=yS(i),this._height=yS(r)}}const vv=()=>{},iz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:vv,onTransitionInterrupt:vv,onTransitionEnd:vv};class fde{constructor(e,t={}){this.ControllerState=e,this.props=ht(ht({},iz),t),this.propsInTransition=null,this.transition=new lv(t.timeline),this.onViewStateChange=t.onViewStateChange||vv,this.onStateChange=t.onStateChange||vv,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=ht(ht({},iz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ht(ht({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(ht(ht({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const rz=["longitude","latitude","zoom","bearing","pitch"],gde=["longitude","latitude","zoom"];class sz extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!Jy(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];Jl(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:rz,extract:rz,required:gde}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=zE(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ht(ht({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,zE(e.around,t.around,i)))}return r}}const Zd={transitionDuration:0},mde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},wS=n=>1-(1-n)*(1-n),Ug_WHEEL=["wheel"],Ug_PAN=["panstart","panmove","panend"],Ug_PINCH=["pinchstart","pinchmove","pinchend"],Ug_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Ug_DOUBLE_TAP=["doubletap"],Ug_KEYBOARD=["keydown"];class oO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new fde(e,Vn(ht({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Vn(ht({},mde),{transitionInterpolator:new sz({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Ug_WHEEL,d&&i),this.toggleEvents(Ug_PAN,d&&(r||s)),this.toggleEvents(Ug_PINCH,d&&(a||l)),this.toggleEvents(Ug_TRIPLE_PAN,d&&l),this.toggleEvents(Ug_DOUBLE_TAP,d&&o),this.toggleEvents(Ug_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=ht(ht({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,Zd,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,Vn(ht({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,Zd,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,Zd,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,Zd,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,Vn(ht({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?Vn(ht({},t),{transitionInterpolator:new sz(Vn(ht({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:Zd}}class oz{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const Jd_target=[0,0,0];class ES extends oz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=Jd_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:T,startZoom:q}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:T,startZoom:q},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(Vn(ht({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ht({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),yf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new ES(ht(ht(ht({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=yf(r,i,t),e.rotationX=yf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class yde extends oO{constructor(e){super(ES,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class vde extends oO{constructor(e){e.dragMode=e.dragMode||"pan",super(ES,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const bde=(new Gn).lookAt({eye:[0,0,1]});function wde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new Gn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Ede extends jg{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(Vn(ht({},e),{longitude:null,position:a,viewMatrix:bde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:wde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Fg([],e,dI([],bf(t,this.pixelUnprojectionMatrix)));return{target:Fg([],this.center,r)}}}let Sde=(()=>{class n extends sO{constructor(t){super(Vn(ht({},t),{type:Ede}))}get controller(){return this._getControllerProps({type:vde})}}return n.displayName="OrthographicView",n})();const SS=Math.PI/180;function Cde({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*SS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new Gn).lookAt({eye:l,up:a});c.rotateX(i*SS),"Z"===t?c.rotateZ(r*SS):c.rotateY(r*SS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class xde extends jg{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(Vn(ht({},e),{longitude:null,viewMatrix:Cde({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=bf([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let Ade=(()=>{class n extends sO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Vn(ht({},t),{orbitAxis:i,type:xde}))}get controller(){return this._getControllerProps({type:yde})}}return n.displayName="OrbitView",n})();const Tde=[255,255,255],Dde=1;let Mde=0;class az{constructor(e={}){const{color:t=Tde}=e,{intensity:i=Dde}=e;this.id=e.id||"ambient-".concat(Mde++),this.color=t,this.intensity=i,this.type="ambient"}}const Ide=[255,255,255],Ode=1,Rde=[0,0,-1];let Nde=0;class lz{constructor(e={}){const{color:t=Ide}=e,{intensity:i=Ode}=e,{direction:r=Rde}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Nde++),this.color=t,this.intensity=i,this.type="directional",this.direction=new mo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class cz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ht({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class aO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ht({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Nu(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Nu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=uz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dNM(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Nu(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||uz(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class kde extends aO{constructor(e,t){super(e,t),this.shadowMap=new Aa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new Dg(e,{format:33189,width:1,height:1}),this.fbo=new Ds(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;Zl(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=Cg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Vn(ht({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const jde=Object.keys(Mi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Mi[n],";")).join(""),Vde=Object.keys(kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(kc[n],";")).join(""),Ude="".concat(jde,"\n").concat(Vde,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),zde={},lO={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:Ude,getUniforms:function(n=zde){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Mi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mi.DEFAULT&&(i=n.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN);const o=Kle({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||Wle,o}(n):{}}},Wde=rS(function({viewport:n,center:e}){return new Gn(n.viewProjectionMatrix).invert().transform(e)}),qde=rS(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=bf([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new mo(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new Gn).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),Yde=[0,0,0,1],Kde=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],cO={name:"shadow",dependencies:[lO],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||Yde,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=Wde({viewport:n.viewport,center:e.project_uCenter}),r=[],s=qde({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},ehe={color:[255,255,255],intensity:1},dz=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],the=[0,0,0,200/255];class uO extends cz{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=the,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=ov.getDefaultProgramManager(e),cO&&this.programManager.addDefaultModule(cO)),this.dummyShadowMap||(this.dummyShadowMap=new Aa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(cO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new Gn).lookAt({eye:new mo(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=ihe++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class rhe{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=_S(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class she{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new rhe(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const ohe=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},lO],ahe=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function lhe(n){const e=ov.getDefaultProgramManager(n);for(const t of ohe)e.addDefaultModule(t);for(const t of ahe)e.addShaderHook(t);return e}const dhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class hhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new she({gl:e,protocol:"deck://"}),this.context=Vn(ht({},dhe),{layerManager:this,gl:e,deck:t,programManager:e&&lhe(e),stats:i||new AM({id:"deck.gl"}),viewport:r||new jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new hz,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){_o("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=zM(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return _o("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Ni.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Ni.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class fhe{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=zM(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!yv(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ni.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(ht({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=Vn(ht(ht(ht({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class ghe extends oz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:x,startRotatePos:T,startBearing:q,startPitch:G,startZoom:ge,normalize:Ne}={}){Jl(Number.isFinite(s)),Jl(Number.isFinite(r)),Jl(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:Ne}),this._state={startPanLngLat:_,startZoomLngLat:x,startRotatePos:T,startBearing:q,startPitch:G,startZoom:ge},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(Vn(ht({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(Vn(ht({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ht({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(ht(ht(ht({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=yf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=yf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=rU(t+180,360)-180),(o<-180||o>180)&&(o=rU(o+180,360)-180);const a=hI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Xd([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return yf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=yf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class mhe extends oO{constructor(e){e.dragMode=e.dragMode||"pan",super(ghe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let _he=(()=>{class n extends sO{constructor(t){super(Vn(ht({},t),{type:vU}))}get controller(){return this._getControllerProps({type:mhe})}}return n.displayName="MapView",n})();const yhe=new uO;class vhe{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!yv(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof uO)||this._internalEffects.push(yhe)}}class bhe extends aO{}const pz={blendFunc:[1,0,32771,0],blendEquation:32774};class gz extends aO{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,Zl(_,Vn(ht({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},pz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Vn(ht({},pz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ht(ht({},e.props.parameters),i)}}class Ehe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new bhe(e),this.pickLayersPass=new gz(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Ds.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Vn(ht({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,_o("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new Ds(this.gl),new Ds(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const She={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Che({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let T=0;T=0){const G=T+o-t,ge=G*G+x;ge<=d&&(d=ge,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),x=e[g];if(x){const T=x.decodePickingColor(_),q=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:x,pickedObjectIndex:T,pickedX:o+(f/4-q*l),pickedY:a+q}}Ni.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return She}function mz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Ahe(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(x=>x.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=mz(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=ht({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=_z({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function _z({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Dhe{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new gz(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?ht(ht({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Ds(e),Ds.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Ds(e),this.depthFBO.attach({36064:new Aa(e,{format:fi(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Ni.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:mz({viewports:i,x:r,y:s})};this._resizeBuffer();const f=Cg(this.gl),p=SM(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:x,height:T}=this.pickingFBO,q=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:x,deviceHeight:T});let G;const ge=[],Ne={};for(let Ge=0;Ge=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Ni.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:q,width:x.x+x.width-g,height:_-q},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Ge=new Map,We=Number.isFinite(c);for(let dt=0;dt=c);dt++){const Mt=Ne[dt];let Ot={color:Mt.pickedColor,layer:null,index:Mt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};Ot=_z({layer:Mt.pickedLayer,info:Ot,mode:l}),Ge.has(Ot.object)||Ge.set(Ot.object,Ot)}return Array.from(Ge.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return UE(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Mhe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Ihe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Mhe),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function yz(n,e){if(!n)throw new Error(e)}const $c={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},vz=$c.global||$c.self||$c.window,Rhe="object"!=typeof process||"[object process]"!==String(process)||process.browser,bz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:Nhe}=(bz&&parseFloat(bz[1]),vz),dO="undefined"!=typeof Image,hO="undefined"!=typeof ImageBitmap,Phe=Boolean(Nhe),fO=!!Rhe||Phe;function wz(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function Ez(n){switch(wz(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const khe=/^data:image\/svg\+xml/,Bhe=/\.svg((\?|#).*)?$/;function pO(n){return n&&(khe.test(n)||Bhe.test(n))}function jhe(n,e){if(pO(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return Cz(n,e)}function Cz(n,e){if(pO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function xz(n,e,t){return gO.apply(this,arguments)}function gO(){return(gO=ei(function*(n,e,t){const i=jhe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield Vhe(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function Vhe(n,e){return mO.apply(this,arguments)}function mO(){return(mO=ei(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const Uhe={};let Az=!0;function zhe(n,e,t){return _O.apply(this,arguments)}function _O(){return(_O=ei(function*(n,e,t){let i;i=pO(t)?yield xz(n,e,t):Cz(n,t);const r=e&&e.imagebitmap;return yield Hhe(i,r)})).apply(this,arguments)}function Hhe(n){return yO.apply(this,arguments)}function yO(){return(yO=ei(function*(n,e=null){if((Ghe(e)||!Az)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),Az=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function Ghe(n){for(const e in n||Uhe)return!1;return!0}const Wc=!1,bv=!0;function vO(n){const e=wv(n);return function(n){const e=wv(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Wc)?{mimeType:"image/png",width:e.getUint32(16,Wc),height:e.getUint32(20,Wc)}:null}(e)||function(n){const e=wv(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Wc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Wc)?{mimeType:"image/gif",width:e.getUint16(6,bv),height:e.getUint16(8,bv)}:null}(e)||function(n){const e=wv(n);return e.byteLength>=14&&16973===e.getUint16(0,Wc)&&e.getUint32(2,bv)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,bv),height:e.getUint32(22,bv)}:null}(e)}function wv(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function Xhe(n,e){const{mimeType:t}=vO(n)||{},{_parseImageNode:i}=vz;return yz(i),i(n,t,e)}function bO(){return(bO=ei(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(Zhe(r)){case"imagebitmap":a=yield zhe(n,e,s);break;case"image":a=yield xz(n,e,s);break;case"data":a=yield Xhe(n,e);break;default:yz(!1)}return"data"===r&&(a=Ez(a)),a})).apply(this,arguments)}function Zhe(n){switch(n){case"auto":case"data":return function(){if(hO)return"imagebitmap";if(dO)return"image";if(fO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return hO||dO||fO;case"imagebitmap":return hO;case"image":return dO;case"data":return fO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const Tz={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return bO.apply(this,arguments)},tests:[n=>Boolean(vO(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},efe={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},Ev="8.5.8",CS=Er.CO.deck&&Er.CO.deck.VERSION;if(CS&&CS!==Ev)throw new Error("deck.gl - multiple versions detected: ".concat(CS," vs ").concat(Ev));CS||(Ni.log(1,"deck.gl ".concat(Ev))(),Er.CO.deck=Object.assign(Er.CO.deck||{},{VERSION:Ev,version:Ev,log:Ni,_registerLoggers:function(n){WM=n}}),QU([efe,[Tz,{imagebitmap:{premultiplyAlpha:"none"}}]]));const tfe=Er.CO.deck;class xS extends Pu{static isSupported(e,t=[]){const i=fi(e),r=Vj(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:rn(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return xS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const Dz=(0,Er.jU)()&&"undefined"!=typeof document;let dfe=0;class hfe{constructor(e={}){const{onCreateContext:t=(T=>wj(T)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=mf.get("animation-loop-"+dfe++)}=e;let{useDevicePixels:x=!0}=e;"useDevicePixelRatio"in e&&(dn.deprecated("useDevicePixelRatio","useDevicePixels")(),x=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:x}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return rn("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=xS.isSupported(this.gl,["timers"])?new xS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return ei(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return dn.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=Dz?new Promise((e,t)=>{Dz&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?xM(this.props.gl,e):this.onCreateContext(e),!jE(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Nu(n,EM)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(dn.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(dn.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Ds(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var ffe=tt(524),AS=tt.n(ffe);const pfe={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(AS().MouseInput);const yfe=AS().Manager,qc=AS(),vfe=qc?[[qc.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[qc.Rotate,{enable:!1}],[qc.Pinch,{enable:!1}],[qc.Swipe,{enable:!1}],[qc.Pan,{threshold:0,enable:!1}],[qc.Press,{enable:!1}],[qc.Tap,{event:"doubletap",taps:2,enable:!1}],[qc.Tap,{event:"anytap",enable:!1}],[qc.Tap,{enable:!1}]]:null,Oz={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},bfe={doubletap:["tap"]},wfe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},EO={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Efe={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},Rz={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Sfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",zg="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let Nz=!1;try{const n={get passive(){return Nz=!0,!0}};zg.addEventListener("test",n,n),zg.removeEventListener("test",n,n)}catch(n){}const Cfe=-1!==Sfe.indexOf("firefox"),{WHEEL_EVENTS:xfe}=EO,Fz=4.000244140625;class Dfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=xfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!Nz&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;zg.WheelEvent&&(Cfe&&e.deltaMode===zg.WheelEvent.DOM_DELTA_PIXEL&&(t/=zg.devicePixelRatio),e.deltaMode===zg.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%Fz==0&&(t=Math.floor(t/Fz)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:Mfe}=EO,Lz="pointermove",kz="pointerover",Bz="pointerout",jz="pointerleave";class Ife{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Mfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===Lz&&(this.enableMoveEvent=t),e===kz&&(this.enableOverEvent=t),e===Bz&&(this.enableOutEvent=t),e===jz&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:kz,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:Bz,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:jz,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:Lz,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Ofe}=EO,Vz="keydown";class Rfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Ofe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===Vz&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:Vz,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const zz="contextmenu";class Nfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===zz&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:zz,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Pfe={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},Hz={srcElement:"root",priority:0};class Wfe{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},Hz,i):Hz;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&Oz[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new Dfe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Ife(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Rfe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Nfe(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=bfe[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=Rz[e]||e;let c=a.get(l);c||(c=new Wfe(this),a.set(l,c),c.recognizerName=Efe[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(Rz[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=wfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Sf(){}const Gz={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:Sf,onResize:Sf,onViewStateChange:Sf,onInteractionStateChange:Sf,onBeforeRender:Sf,onAfterRender:Sf,onLoad:Sf,onError:(n,e)=>Ni.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class DS{constructor(e){e=ht(ht({},Gz),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Ni.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Er.qs)()&&Ni.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new AM({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Zy.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Ni.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ni.removed("onLayerClick","onClick")(),e.initialViewState&&!yv(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](ht({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),Jl(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new hfe({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>wj(Vn(ht(ht({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new _he({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,xM(e,{enable:!0,copyState:!0})),this.tooltip=new Ihe(this.canvas),Nu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new hz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new Yfe(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in sj)this.eventManager.on(r,this._onEvent);this.viewManager=new fhe({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new hhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new vhe,this.deckRenderer=new Ehe(e),this.deckPicker=new Dhe(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Nu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ht({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Ni.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=Vn(ht({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=sj[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=mf.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}DS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(cz)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},DS.defaultProps=Gz,DS.VERSION=tfe.VERSION;const $z={name:"project32",dependencies:[lO],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},Wz="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",Qfe={lightSources:{}};function xO({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const AO={name:"lights",vs:Wz,fs:Wz,getUniforms:function qz(n=Qfe){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?xO(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=xO(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=xO(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return qz({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},Jfe={};const tpe={name:"phong-lighting",dependencies:[AO],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=Jfe){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},ipe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},Xz=ht({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=ipe){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),Qz={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class MS{static get DRAW_MODE(){return Qz}constructor(e={}){const{id:t=jc("geometry"),drawMode:i=Qz.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?ht({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,rn(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(rn(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return rn(Number.isFinite(i)),i}}const TO=Math.PI/180,IS=new Float32Array(16),Zz=new Float32Array(12);function Jz(n,e,t){const i=e[0]*TO,r=e[1]*TO,s=e[2]*TO,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function e4(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const t4={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let x;g?(IS.set(a),x=e4(IS)):(x=Zz,Jz(x,r,s),x.set(o,9)),n.value=new Float32Array(x)}else{let x=e*n.size;const{iterable:T,objectInfo:q}=eV(i,e,t);for(const G of T){let ge;q.index++,g?(IS.set(c?a:a(G,q)),ge=e4(IS)):(ge=Zz,Jz(ge,f?r:r(G,q),d?s:s(G,q)),ge.set(p?o:o(G,q),9)),_[x++]=ge[0],_[x++]=ge[1],_[x++]=ge[2],_[x++]=ge[3],_[x++]=ge[4],_[x++]=ge[5],_[x++]=ge[6],_[x++]=ge[7],_[x++]=ge[8],_[x++]=ge[9],_[x++]=ge[10],_[x++]=ge[11]}}}};function n4(n,e){return e===Mi.CARTESIAN||e===Mi.METER_OFFSETS||e===Mi.DEFAULT&&!n.isGeospatial}function i4(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ni.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function ape(n,e){if(n.attributes)return i4(n.attributes,e),n instanceof MS?n:new MS(n);if(n.positions||n.POSITION)return i4(n,e),new MS({attributes:n});throw Error("Invalid mesh")}const lpe={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let cpe=(()=>{class n extends rO{getShaders(){const t=!fi(this.context.gl),i={};return LM(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[$z,tpe,Xz],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:t4}),this.setState({emptyTexture:new Aa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||n4(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new tS(this.context.gl,Vn(ht({},this.getShaders()),{id:this.props.id,geometry:ape(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=lpe,n})();const r4={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[AO]};class Hg{constructor(e={}){const{id:t}=e;this.id=t||jc(this.constructor.name),this.display=!0,this.position=new mo,this.rotation=new mo,this.scale=new mo(1,1,1),this.matrix=new Gn,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return rn(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return rn(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return rn(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){rn(e),t=t||this.matrix;const i=new Gn(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class Sv extends Hg{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;dn.assert(t.every(i=>i instanceof Hg),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new Gn}={}){const i=new Gn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Sv?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function s4(){var n=new ra(4);return ra!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function o4(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function a4(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var c4=JV,Cpe=function(){var n=Gj(),e=$j(1,0,0),t=$j(0,1,0);return function(i,r,s){var o=Wj(r,s);return o<-.999999?(GE(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&GE(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),o4(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(GE(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();s4(),s4(),function(){var n=new ra(9);ra!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const xpe=[0,0,0,1],Tpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dpe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function h4(n){if(!n._animation){const e=Dpe[n.componentType],t=Tpe[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return o4(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Zs(e)}get y(){return this[1]}set y(e){this[1]=Zs(e)}get z(){return this[2]}set z(e){this[2]=Zs(e)}get w(){return this[3]}set w(e){this[3]=Zs(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return Cpe(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Lu(!t),a4(this,this,e),this.check()}multiplyLeft(e,t){return Lu(!t),a4(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return c4(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=xpe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,x,T,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>hr?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-i)*p)/_,T=Math.sin(i*p)/_):(x=1-i,T=i),n[0]=x*r+T*l,n[1]=x*s+T*c,n[2]=x*o+T*d,n[3]=x*a+T*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),HE(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class Fpe{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:dn.warn(`Bad animation path ${s}`)()}rn(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){DO.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:h4(e.accessors[a]),interpolation:l,output:h4(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Fpe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class kpe extends Hg{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof tS?(this.model=e,this._setModelNodeProps(t)):this.model=new tS(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class Bpe{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},LM(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new Aa(this.gl,ht({id:e.name||e.id,parameters:ht(ht({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(dn.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function f4(n,e){return fi(n)?`#version 300 es\n${e}`:e}const zpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Hpe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Gpe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Hpe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Lpe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Sv({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new Sv({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new Gn).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new Sv({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){dn.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new Bpe(n,e);dn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new kpe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[r4],defines:a.defines,parameters:a.parameters,vs:f4(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:f4(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),dn.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new tr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ia({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:zpe[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function p4(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new Gg(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Gg(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Gg){const o=e;t=o.fields,i=y4(y4(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new Gg(s,i)}}function y4(n,e){return new Map([...n||new Map,...e||new Map])}let Or,v4,b4,w4,E4,S4,C4,x4;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(Or||(Or={}));class MO{static isNull(e){return e&&e.typeId===Or.Null}static isInt(e){return e&&e.typeId===Or.Int}static isFloat(e){return e&&e.typeId===Or.Float}static isBinary(e){return e&&e.typeId===Or.Binary}static isUtf8(e){return e&&e.typeId===Or.Utf8}static isBool(e){return e&&e.typeId===Or.Bool}static isDecimal(e){return e&&e.typeId===Or.Decimal}static isDate(e){return e&&e.typeId===Or.Date}static isTime(e){return e&&e.typeId===Or.Time}static isTimestamp(e){return e&&e.typeId===Or.Timestamp}static isInterval(e){return e&&e.typeId===Or.Interval}static isList(e){return e&&e.typeId===Or.List}static isStruct(e){return e&&e.typeId===Or.Struct}static isUnion(e){return e&&e.typeId===Or.Union}static isFixedSizeBinary(e){return e&&e.typeId===Or.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Or.FixedSizeList}static isMap(e){return e&&e.typeId===Or.Map}static isDictionary(e){return e&&e.typeId===Or.Dictionary}get typeId(){return Or.NONE}compareTo(e){return this===e}}Symbol,Symbol,v4=Symbol.toStringTag;class $g extends MO{constructor(e,t){super(),$n(this,"isSigned",void 0),$n(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Or.Int}get[v4](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class ege extends $g{constructor(){super(!0,8)}}class tge extends $g{constructor(){super(!0,16)}}class nge extends $g{constructor(){super(!0,32)}}class ige extends $g{constructor(){super(!1,8)}}class rge extends $g{constructor(){super(!1,16)}}class sge extends $g{constructor(){super(!1,32)}}b4=Symbol.toStringTag;class A4 extends MO{constructor(e){super(),$n(this,"precision",void 0),this.precision=e}get typeId(){return Or.Float}get[b4](){return"Float"}toString(){return`Float${this.precision}`}}class oge extends A4{constructor(){super(32)}}class age extends A4{constructor(){super(64)}}Symbol,Symbol,w4=Symbol.toStringTag,E4=Symbol.toStringTag,S4=Symbol.toStringTag,C4=Symbol.toStringTag,x4=Symbol.toStringTag;class lge extends MO{constructor(e,t){super(),$n(this,"listSize",void 0),$n(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Or.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[x4](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class RS{constructor(e,t,i=!1,r=new Map){$n(this,"name",void 0),$n(this,"type",void 0),$n(this,"nullable",void 0),$n(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new RS(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function T4(n,e,t){const i=t?D4(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new ege;case Uint8Array:return new ige;case Int16Array:return new tge;case Uint16Array:return new rge;case Int32Array:return new nge;case Uint32Array:return new sge;case Float32Array:return new oge;case Float64Array:return new age;default:throw new Error("array type not supported")}}(e.value);return new RS(n,new lge(e.size,new RS("value",r)),!1,i)}function D4(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const M4={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},hge={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class pge{constructor(e){$n(this,"draco",void 0),$n(this,"decoder",void 0),$n(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=D4(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=T4(o,n[o],s[o]);r.push(l)}if(t){const o=T4("indices",t);r.push(o)}return new Gg(r,i)}(l.attributes,a,l.indices);return Vn(ht({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var NS=tt(125);const NO={};function PO(n){return FO.apply(this,arguments)}function FO(){return(FO=ei(function*(n,e=null,t={}){return e&&(n=vge(n,e,t)),NO[n]=NO[n]||bge(n),yield NO[n]})).apply(this,arguments)}function vge(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:FI?t.CDN?(zc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):LI?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function bge(n){return LO.apply(this,arguments)}function LO(){return(LO=ei(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():FI?LI?importScripts(n):wge(yield(yield fetch(n)).text(),n):NS.requireFromFile&&(yield NS.requireFromFile(n))})).apply(this,arguments)}function wge(n,e){if(!FI)return NS.requireFromString&&NS.requireFromString(n,e);if(LI)return eval.call(hue,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Ege="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Sge="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Cge="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Cv;function Age(n){return kO.apply(this,arguments)}function kO(){return(kO=ei(function*(n){const e=n.modules||{};return Cv=e.draco3d?Cv||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Cv||Tge(n),yield Cv})).apply(this,arguments)}function Tge(n){return jO.apply(this,arguments)}function jO(){return(jO=ei(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield PO(Ege,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield PO(Sge,"draco",n),yield PO(Cge,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Dge(e,t)})).apply(this,arguments)}function Dge(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Vn(ht({},t),{onModuleLoaded:r=>i({draco:r})}))})}const UO=Vn(ht({},_4),{parse:function(n,e){return zO.apply(this,arguments)}});function zO(){return(zO=ei(function*(n,e){const{draco:t}=yield Age(e),i=new pge(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Av(n,e){return wf(n>=0),wf(e>0),n+(e-1)&~(e-1)}function Oge(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+Av(i.byteLength,4)}const I4=["SCALAR","VEC2","VEC3","VEC4"],Rge=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Nge=new Map(Rge),Pge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Fge={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function O4(n){return I4[n-1]||I4[0]}function R4(n){const e=Nge.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function N4(n,e){const t=Lge[n.componentType],i=Pge[n.type],s=n.count*i,o=n.count*i*Fge[n.componentType];return Ia(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const kge={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class th{constructor(e){$n(this,"gltf",void 0),$n(this,"sourceBuffers",void 0),$n(this,"byteLength",void 0),this.gltf=e||{json:ht({},kge),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return Ia(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=N4(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return Ia(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ia(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=vO(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Ia(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Av(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:O4(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:R4(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Oge(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Yge(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function Kge(n){return $O.apply(this,arguments)}function $O(){return($O=ei(function*(n){const e=new th(n),{json:t}=e;e.removeExtension(FS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,FS)})).apply(this,arguments)}function Xge(n){const e=new th(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,FS,{}),e.addExtension(FS))}function Qge(n){return WO.apply(this,arguments)}function WO(){return(WO=ei(function*(n){const e=new th(n),{json:t}=e,i=e.getExtension(Wg);i&&(e.json.lights=i.lights,e.removeExtension(Wg));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Wg);s&&(r.light=s.light),e.removeObjectExtension(r,Wg)}})).apply(this,arguments)}function Zge(n){return qO.apply(this,arguments)}function qO(){return(qO=ei(function*(n){const e=new th(n),{json:t}=e;if(t.lights){const i=e.addExtension(Wg);Ia(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Wg,i);delete e.json.lights}})).apply(this,arguments)}function Jge(n){return YO.apply(this,arguments)}function YO(){return(YO=ei(function*(n){const e=new th(n),{json:t}=e,i=e.getExtension(LS);if(i){const r=tme(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,LS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=nme(s.technique,e)),e.removeObjectExtension(s,LS)}e.removeExtension(LS)}})).apply(this,arguments)}function eme(n,e){return KO.apply(this,arguments)}function KO(){return(KO=ei(function*(n,e){})).apply(this,arguments)}function tme(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function nme(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const L4={KHR_draco_mesh_compression:gt,KHR_materials_unlit:J,KHR_lights_punctual:xt,KHR_techniques_webgl:ut};function ime(n){return XO.apply(this,arguments)}function XO(){return(XO=ei(function*(n,e={},t){for(const r in L4){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield L4[r].decode(n,e,t))}})).apply(this,arguments)}const k4={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},sme={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class ome{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new th(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,P4);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(P4)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in k4)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in k4)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=sme[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function ame(n,e={}){return(new ome).normalize(n,e)}const lme={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},gl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},ume={magFilter:gl.TEXTURE_MAG_FILTER,minFilter:gl.TEXTURE_MIN_FILTER,wrapS:gl.TEXTURE_WRAP_S,wrapT:gl.TEXTURE_WRAP_T},dme={[gl.TEXTURE_MAG_FILTER]:gl.LINEAR,[gl.TEXTURE_MIN_FILTER]:gl.NEAREST_MIPMAP_LINEAR,[gl.TEXTURE_WRAP_S]:gl.REPEAT,[gl.TEXTURE_WRAP_]:gl.REPEAT};class pme{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Ia(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=ht({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=ht({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ht({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ht({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=ht({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ht({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ht({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return cme[n]}(e.componentType),e.components=function(n){return lme[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=N4(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):dme,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return ume[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function gme(n,e){return(new pme).postProcess(n,e)}const B4=1735152710,qg=!0;function ZO(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Av(i,4)}function JO(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Av(i,4)}function Tme(n,e){return eR.apply(this,arguments)}function eR(){return(eR=ei(function*(n,e,t=0,i,r){var s,o,a,l;Dme(n,e,t,i),ame(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Mme(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Ime(n,i,r);c.push(f)}const d=ime(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?gme(n,i):n})).apply(this,arguments)}function Dme(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=B4}=t,s=i.getUint32(e,!1);return s===r||s===B4}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?p4(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?p4(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,qg),a=r.getUint32(t+8,qg);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){wf(n.header.byteLength>20);const i=e.getUint32(t+0,qg),r=e.getUint32(t+4,qg);return t+=8,wf(0===r),ZO(n,e,t,i),(t+=i)+JO(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return wf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,qg),s=e.getUint32(t+4,qg);switch(t+=8,s){case 1313821514:ZO(n,e,t,r);break;case 5130562:JO(n,e,t,r);break;case 0:i.strict||ZO(n,e,t,r);break;case 1:i.strict||JO(n,e,t,r)}t+=Av(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),Ia("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Ia(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Mme(n,e,t){return tR.apply(this,arguments)}function tR(){return(tR=ei(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield Pme(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function Pme(n){return oR.apply(this,arguments)}function oR(){return(oR=ei(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const j4=[255,255,255,255],kme={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:j4},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Yg]};let Bme=(()=>{class n extends rO{getShaders(){const t=[$z,Xz];return"pbr"===this.props._lighting&&t.push(r4),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:j4,transition:!0},instanceModelMatrix:t4})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Hg)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Gpe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ht({gltf:l},c),function(n){return sR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ni.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Hg?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ni.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Ni.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Hg&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:ht({isInstanced:!0,transpileToGLSL100:!fi(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:n4(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=kme,n})();const jme=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Vme=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),Ume=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),zme=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Hme={POSITION:{size:3,value:new Float32Array(Vme)},NORMAL:{size:3,value:new Float32Array(Ume)},TEXCOORD_0:{size:2,value:new Float32Array(zme)}};class Gme extends MS{constructor(e={}){const{id:t=jc("cube-geometry")}=e;super(Vn(ht({},e),{id:t,indices:{size:1,value:new Uint16Array(jme)},attributes:ht(ht({},Hme),e.attributes)}))}}class Yc{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new le){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new le){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new le){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new le){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new le){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new le){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new le){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=Wme,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=qme;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(V4),V4.almostEquals(e,t)}clone(){return new le(this.x,this.y,this.z)}}le.ZERO=void 0,le.UNIT_X=void 0,le.UNIT_Y=void 0,le.UNIT_Z=void 0,le.ZERO=new le(0,0,0),le.UNIT_X=new le(1,0,0),le.UNIT_Y=new le(0,1,0),le.UNIT_Z=new le(0,0,1);const Wme=new le,qme=new le,V4=new le;class ar{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new le,this.upperBound=new le,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=z4;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=z4;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const U4=new le,z4=[new le,new le,new le,new le,new le,new le,new le,new le];class is{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new le){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=Kme;e.tangents(i,Xme),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(gr(e.length(),2)*gr(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new is){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new is){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new is){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new le){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new is(this.x,this.y,this.z,this.w)}slerp(e,t,i=new is){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,x,T,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-t)*p)/_,T=Math.sin(t*p)/_):(x=1-t,T=t),i.x=x*r+T*l,i.y=x*s+T*c,i.z=x*o+T*d,i.w=x*a+T*f,i}integrate(e,t,i,r=new is){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const Kme=new le,Xme=new le,Qme={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let hn=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=Qme,n})();class Pi{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new is,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Pi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Pi.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new le){return i.vsub(e,r),t.conjugate(G4),G4.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new le){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new le){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new le){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const G4=new is;class Cf extends hn{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:hn.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new le;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=x,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,d=new le,f=new le,p=new le,g=new le,_=new le;let x=Number.MAX_VALUE;const T=this;if(T.uniqueAxes)for(let q=0;q!==T.uniqueAxes.length;q++){i.vmult(T.uniqueAxes[q],c);const G=T.testSepAxis(c,e,t,i,r,s);if(!1===G)return!1;G0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){Cf.project(this,e,i,r,aR),Cf.project(t,e,s,o,lR);const l=aR[0],c=aR[1],d=lR[0],f=lR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?fn.STATIC:fn.DYNAMIC,typeof e.type==typeof fn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=fn.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new le,this.quaternion=new is,this.initQuaternion=new is,this.previousQuaternion=new is,this.interpolatedQuaternion=new is,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new le,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new le,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new le,this.invInertia=new le,this.invInertiaWorld=new Yc,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new Yc,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new le(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new le(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new ar,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new le,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=fn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===fn.SLEEPING&&this.dispatchEvent(fn.wakeupEvent)}sleep(){this.sleepState=fn.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=gr(this.sleepSpeedLimit,2);t===fn.AWAKE&&ir?this.wakeUp():t===fn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(fn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===fn.SLEEPING||this.type===fn.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new le){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new le){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new le,s=new is;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=e_e,o=t_e,a=this.quaternion,l=this.aabb,c=n_e;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=i_e,r=r_e;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==fn.DYNAMIC)return;this.sleepState===fn.SLEEPING&&this.wakeUp();const i=s_e;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==fn.DYNAMIC)return;const i=o_e,r=a_e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===fn.DYNAMIC&&(this.sleepState===fn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==fn.DYNAMIC)return;this.sleepState===fn.SLEEPING&&this.wakeUp();const i=t,r=l_e;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=c_e;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==fn.DYNAMIC)return;const i=u_e,r=d_e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=h_e;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),BS.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new le;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==fn.DYNAMIC&&this.type!==fn.KINEMATIC||this.sleepState===fn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,x=this.angularFactor,T=l.x*x.x,q=l.y*x.y,G=l.z*x.z;s.x+=e*(_[0]*T+_[1]*q+_[2]*G),s.y+=e*(_[3]*T+_[4]*q+_[5]*G),s.z+=e*(_[6]*T+_[7]*q+_[8]*G),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}fn.idCounter=0,fn.COLLIDE_EVENT_NAME="collide",fn.DYNAMIC=1,fn.STATIC=2,fn.KINEMATIC=4,fn.AWAKE=0,fn.SLEEPY=1,fn.SLEEPING=2,fn.wakeupEvent={type:"wakeup"},fn.sleepyEvent={type:"sleepy"},fn.sleepEvent={type:"sleep"};const e_e=new le,t_e=new is,n_e=new ar,i_e=new Yc,r_e=new Yc,s_e=new le,o_e=new le,a_e=new le,l_e=new le,c_e=new le,u_e=new le,d_e=new le,h_e=new le;new le,new le;class jS{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new le,this.rayToWorld=new le,this.hitNormalWorld=new le,this.hitPointWorld=new le,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let $4,W4,q4,Y4,K4,X4,Q4;$4=hn.types.SPHERE,W4=hn.types.PLANE,q4=hn.types.BOX,Y4=hn.types.CYLINDER,K4=hn.types.CONVEXPOLYHEDRON,X4=hn.types.HEIGHTFIELD,Q4=hn.types.TRIMESH;class ds{get[$4](){return this._intersectSphere}get[W4](){return this._intersectPlane}get[q4](){return this._intersectBox}get[Y4](){return this._intersectConvex}get[K4](){return this._intersectConvex}get[X4](){return this._intersectHeightfield}get[Q4](){return this._intersectTrimesh}constructor(e=new le,t=new le){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new le,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=ds.ANY,this.result=new jS,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||ds.ANY,this.result=t.result||new jS,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Z4),hR.length=0,e.broadphase.aabbQuery(e,Z4,hR),this.intersectBodies(hR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=v_e,s=b_e;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new le(0,0,1);t.vmult(c,c);const d=new le;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;T>=0&&T<=1&&(o.lerp(a,T,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=x_e,l=e8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,T=_.distanceTo(this.to),q=c?c.length:d.length,G=this.result;for(let ge=0;!G.shouldStop&&geT||this.reportIntersection(a,sa,s,r,Ne)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=A_e,l=R_e,c=N_e,d=e8,f=T_e,p=D_e,g=M_e,_=O_e,x=I_e,T=e.indices,q=this.from,G=this.to,ge=this.direction;c.position.copy(i),c.quaternion.copy(t),Pi.vectorToLocalFrame(i,t,ge,f),Pi.pointToLocalFrame(i,t,q,p),Pi.pointToLocalFrame(i,t,G,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const Ne=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Ge=0,We=l.length;!this.result.shouldStop&&Ge!==We;Ge++){const dt=l[Ge];e.getNormal(dt,a),e.getVertex(T[3*dt],ic),ic.vsub(p,d);const Mt=f.dot(a),Ot=a.dot(d)/Mt;if(Ot<0)continue;f.scale(Ot,sa),sa.vadd(p,sa),e.getVertex(T[3*dt+1],Xc),e.getVertex(T[3*dt+2],Qc);const Lt=sa.distanceSquared(p);!ds.pointInTriangle(sa,Xc,ic,Qc)&&!ds.pointInTriangle(sa,ic,Xc,Qc)||Lt>Ne||(Pi.vectorToWorldFrame(t,a,x),Pi.pointToWorldFrame(i,t,sa,_),this.reportIntersection(x,_,s,r,dt))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case ds.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case ds.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var Mf=tt(517);function Zg(n,e,t){e||(e=new Gn(Gn.IDENTITY));const i=new Gn(Gn.IDENTITY);if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new Gn(Gn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new Gn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===Zg(s,r,t))return!1;return!0}function $8(){QU([_4,Yg])}function W8(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||Zg(r,new Gn(Gn.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function mR(n,e){return or(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield mS(i,Yg,{DracoLoader:UO,gltf:{decompressMeshes:!0,postProcess:!0}});return W8(n.scenegraphNode,r)})}function Pbe(n,e){return or(this,void 0,void 0,function*(){return W8(n,yield e)})}function _R(n,e,t){if(e&&0!==e.length)return new cpe(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mi.CARTESIAN,data:e,mesh:new Gme,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let Lbe=(()=>{class n extends dde{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),$8()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){or(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new Gn(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new ar({lowerBound:new le(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new le(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield _S(o.scenegraph,Yg,{DracoLoader:UO,decompress:!0,postProcess:!0});for(const l of a.scenes)Zg(l,new Gn(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new ar({lowerBound:new le(...p.map((_,x)=>Math.min(_,g[x]))),upperBound:new le(...g.map((_,x)=>Math.max(_,p[x])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=mR({scenegraph:l.scenegraph},n.gltfCache));return[_R("cubes",i,{wireframe:!1,pickable:!1}),_R("pickableCubes",r,{wireframe:!1,pickable:!0}),_R("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new Bme({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Mi.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?Pbe(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function q8(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),q8(t,e);return e}let Bbe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new Lbe({}),this.nodeClickSubject=new ee,this.nodeHoverStartSubject=new ee,this.nodeHoverStopSubject=new ee,this.sceneRotationSubject=new Ir([0,0]),this.nodeDragStartSubject=new ee,this.nodeDragSubject=new ee,this.nodeDragEndSubject=new ee,this.nodeClick$=this.nodeClickSubject.pipe(ps()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ps()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ps()),this.sceneRotation$=this.sceneRotationSubject.pipe(ps()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ps()),this.nodeDrag$=this.nodeDragSubject.pipe(ps()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ps());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Sde({flipY:!1,near:-1e3}):new Ade({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new uO({ambientLight:new az({color:[255,255,255],intensity:10})})]),this.deck=new DS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return or(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new Gn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return or(this,void 0,void 0,function*(){$8();const i=yield mR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)Zg(o,e=new Gn(e||Gn.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new Gn(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new Gn(e||Gn.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new ar({lowerBound:new le(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new le(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of q8(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new Gn(Gn.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new Gn(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return Ca([Mf.ZP],n.prototype,"_onHover",null),Ca([Mf.ZP],n.prototype,"_onClick",null),Ca([Mf.ZP],n.prototype,"_onViewStateChange",null),Ca([Mf.ZP],n.prototype,"_onDragStart",null),Ca([Mf.ZP],n.prototype,"_onDrag",null),Ca([Mf.ZP],n.prototype,"_onDragEnd",null),n})();function jbe(n,e){return n===e}function Vbe(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let yR=(()=>{class n{constructor(){this.bootstrap$=new pg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const vR=new zt("INITIAL_STATE_TOKEN");let Hbe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const K8=new zt("Internals.StateContextFactory"),X8=new zt("Internals.StateFactory");function Pv(...n){if(1===n.length){const e=n[0];if(L(e))return YS(e,null);if(re(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return YS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return YS(n=1===n.length&&L(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return YS(n,null)}function YS(n,e){return new F(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function ml(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new pg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}function Q8(n,e){return e?t=>t.pipe(Q8((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new $be(n))}class $be{constructor(e){this.project=e}call(e,t){return t.subscribe(new Wbe(e,this.project))}}class Wbe extends pe{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new Et(this),i=this.destination;i.add(t);const r=O(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function rs(n){return e=>e.lift(new qbe(n))}class qbe{constructor(e){this.notifier=e}call(e,t){const i=new Ybe(e),r=O(this.notifier,new Et(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class Ybe extends pe{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Wu(n,e){return t=>t.lift(new Kbe(n,e))}class Kbe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new Xbe(e,this.compare,this.keySelector))}}class Xbe extends y{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}const Oa={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let Z8=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(n){return"server"===n}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return yn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return yn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof yn||console.warn(Oa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(Oc))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const J8=new zt("ROOT_STATE_TOKEN"),eH=new zt("FEATURE_STATE_TOKEN"),tH=new zt("NGXS_PLUGINS"),nH=new zt("NG_TEST_MODE"),iH=new zt("NG_DEV_MODE"),qu="NGXS_META",rH="NGXS_OPTIONS_META";let If=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=Z8}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class Qbe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const sH=new zt("NGXS_EXECUTION_STRATEGY");function Of(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const oH=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},KS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),wR=n=>n&&"object"==typeof n&&!Array.isArray(n),ER=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(wR(n)&&wR(t))for(const i in t)wR(t[i])?(n[i]||Object.assign(n,{[i]:{}}),ER(n[i],t[i])):Object.assign(n,{[i]:t[i]});return ER(n,...e)};function Fv(n){return n[qu]}function lH(n,e){const t=KS(e.currentAppState,n.path),i=KS(e.newAppState,n.path);return new Qbe(t,i,!n.isInitialised)}function s0e(...n){return function(n,e,t=l0e){const i=function(n){return n.reduce((e,t)=>(e[Of(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Ui(t=>{const i=Of(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function l0e(){return me(n=>n.action)}function XS(n){return e=>new F(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let QS=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(sH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class d0e extends ee{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let ZS=(()=>{class n extends d0e{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),h0e=(()=>{class n extends F{constructor(t,i){super(r=>{const s=t.pipe(XS(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(Ie(ZS),Ie(QS))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const cH=n=>(...e)=>n.shift()(...e,(...i)=>cH(n)(...i));let JS=(()=>{class n extends Ir{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),AR=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(tH,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),TR=(()=>{class n extends ee{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),uH=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Yo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(XS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?nn(this._stateStream.getValue()):Pv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!Of(t))return fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return cH([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(ml())}getActionResultStream(t){return this._actionResults.pipe(Ui(i=>i.action===t&&"DISPATCHED"!==i.status),Xi(1),ml())}createDispatchObservable(t){return t.pipe(Q8(i=>{switch(i.status){case"SUCCESSFUL":return nn(this._stateStream.getValue());case"ERRORED":return fg(i.error);default:return Nc}})).pipe(ml())}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(ZS),Ie(TR),Ie(AR),Ie(JS),Ie(QS))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const dH=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&dH(n[i])}),n};let hH=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(iH),Ie(nH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),fH=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Oa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Oa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(hH),Ie(If))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),em=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=dH(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(Ie(JS),Ie(uH),Ie(If),Ie(fH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),eC=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return KS(l,t.path)}function s(l,c){const d=oH(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=lH(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Oa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Oa.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(em))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class tC{static stateNameErrorMessage(e){return Oa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Oa.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Oa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=Fv(e);if(!t)throw new Error(Oa.STATE_DECORATOR());return t}}tC.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let tm=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=Y8(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(tC.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[qu].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[qu];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[qu].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[qu];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>oH(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ui(t=>"DISPATCHED"===t.status),k(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),_E({action:t,status:"CANCELED"}),Xl(i=>nn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=Of(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=Pe(d)),d instanceof F?(d=d.pipe(_E({})),l.options.cancelUncompleted&&(d=d.pipe(rs(t.pipe(s0e(i)))))):d=nn({}).pipe(ml()),s.push(d)}catch(d){s.push(fg(d))}}}return s.length||s.push(nn({})),Pv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=tC.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==KS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(If),Ie(n,12),Ie(ZS),Ie(TR),Ie(eC),Ie(vR,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),DR=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ui(()=>!!i),jr(()=>this.invokeInit(i.states)),k(()=>this.bootstrapper.appBootstrapped$),Ui(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=lH(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(em),Ie(eC),Ie(yR))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();let ih=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(me(i),Xl(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?nn(void 0):fg(r)}),Wu(),XS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Xi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(XS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=function(n){return n.NGXS_SELECTOR_META}(n)||Fv(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(JS),Ie(em),Ie(If),Ie(QS),Ie(tm),Ie(vR,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),Lv=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(If))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class v0e{static get type(){return"@@INIT"}}class b0e{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const iC=new pg(1);let E0e=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Sa();iC.next(t)}catch(n){iC.next(!1)}finally{iC.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new v0e,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(tm),Ie(em),Ie(ih),Ie(Lv),Ie(J8,8),Ie(DR))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})(),S0e=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new b0e(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(em),Ie(tm),Ie(eH,8),Ie(DR))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();class oa{static forRoot(e=[],t={}){return{ngModule:E0e,providers:[tm,eC,h0e,ZS,yR,fH,hH,DR,uH,TR,em,QS,ih,JS,Lv,AR,...e,...oa.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:S0e,providers:[tm,AR,...e,{provide:eH,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:nH,useValue:zbe},{provide:iH,useValue:Sa},{provide:sH,useClass:t.executionStrategy||Z8},{provide:J8,useValue:e},{provide:oa.ROOT_OPTIONS,useValue:t},{provide:If,useFactory:oa.ngxsConfigFactory,deps:[oa.ROOT_OPTIONS]},{provide:Rw,useFactory:oa.appBootstrapListenerFactory,multi:!0,deps:[yR]},{provide:vR,useFactory:oa.getInitialState},{provide:K8,useExisting:eC},{provide:X8,useExisting:tm}]}static ngxsConfigFactory(e){return ER(new If,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return Hbe.pop()}}function x0e(n){return i=>{!function(n){iC.subscribe(e=>{e&&(n.\u0275prov||console.warn(Oa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(qu)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,qu,{value:e})}return Fv(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[rH]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;tC.checkCorrectStateName(d),s.hasOwnProperty(qu)&&(r.actions=Object.assign({},r.actions,(s[qu]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[rH]=a}}oa.\u0275fac=function(e){return new(e||oa)},oa.\u0275mod=ln({type:oa}),oa.\u0275inj=bt({}),oa.ROOT_OPTIONS=new zt("ROOT_OPTIONS");const Ra=new zt("NgValueAccessor"),gC=new Yl(cE);class Nwe{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Pwe(e,this.dueTime,this.scheduler))}}class Pwe extends y{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Fwe,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function Fwe(n){n.debouncedNext()}function zi(n){return null!=n&&"false"!=`${n}`}function Na(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function Ku(n){return n instanceof wn?n.nativeElement:n}let JR;try{JR="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){JR=!1}let $v,eN,Hi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?lf(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!JR)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(Ie(Oc))},n.\u0275prov=$e({factory:function(){return new n(Ie(Oc))},token:n,providedIn:"root"}),n})(),Gv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();function rm(n){return function(){if(null==$v&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>$v=!0}))}finally{$v=$v||!1}return $v}()?n:!!n.capture}function Pf(n){return n.composedPath?n.composedPath()[0]:n.target}let tN=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:function(){return new n},token:n,providedIn:"root"}),n})(),x6=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Ku(t);return new F(r=>{const o=this._observeElement(i).subscribe(r);return()=>{o.unsubscribe(),this._unobserveElement(i)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const i=new ee,r=this._mutationObserverFactory.create(s=>i.next(s));r&&r.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:r,stream:i,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:i,stream:r}=this._observedElements.get(t);i&&i.disconnect(),r.complete(),this._observedElements.delete(t)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(tN))},n.\u0275prov=$e({factory:function(){return new n(Ie(tN))},token:n,providedIn:"root"}),n})(),A6=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new mn,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=zi(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Na(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe(function(n,e=gC){return t=>t.lift(new Nwe(n,e))}(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(De(x6),De(wn),De(yn))},n.\u0275dir=kt({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),nN=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[tN]}),n})();function k6(n){return 0===n.offsetX&&0===n.offsetY}function B6(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const j6=new zt("cdk-input-modality-detector-options"),aEe={ignoreKeys:[18,17,224,91,16]},sm=rm({passive:!0,capture:!0});let U6=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Ir(null),this._lastTouchMs=0,this._onKeydown=o=>{var a,l;(null===(l=null===(a=this._options)||void 0===a?void 0:a.ignoreKeys)||void 0===l?void 0:l.some(c=>c===o.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Pf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(k6(o)?"keyboard":"mouse"),this._mostRecentTarget=Pf(o))},this._onTouchstart=o=>{B6(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Pf(o))},this._options=Object.assign(Object.assign({},aEe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new Mne(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(Wu()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,sm),r.addEventListener("mousedown",this._onMousedown,sm),r.addEventListener("touchstart",this._onTouchstart,sm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,sm),document.removeEventListener("mousedown",this._onMousedown,sm),document.removeEventListener("touchstart",this._onTouchstart,sm))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hi),Ie(yn),Ie(un),Ie(j6,8))},n.\u0275prov=$e({factory:function(){return new n(Ie(Hi),Ie(yn),Ie(un),Ie(j6,8))},token:n,providedIn:"root"}),n})();const G6=new zt("cdk-focus-monitor-default-options"),wC=rm({passive:!0,capture:!0});let Xu=(()=>{class n{constructor(t,i,r,s,o){this._ngZone=t,this._platform=i,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new ee,this._rootNodeFocusAndBlurListener=a=>{const l=Pf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let d=l;d;d=d.parentElement)c.call(this,a,d)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=Ku(t);if(!this._platform.isBrowser||1!==r.nodeType)return nn(null);const s=function(n){if(function(){if(null==eN){const n="undefined"!=typeof document?document.head:null;eN=!(!n||!n.createShadowRoot&&!n.attachShadow)}return eN}()){const e=n.getRootNode?n.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(r)||this._getDocument(),o=this._elementInfo.get(r);if(o)return i&&(o.checkChildren=!0),o.subject;const a={checkChildren:i,subject:new ee,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Ku(t),r=this._elementInfo.get(i);r&&(r.subject.complete(),this._setClasses(i),this._elementInfo.delete(i),this._removeGlobalListeners(r))}focusVia(t,i,r){const s=Ku(t);s===this._getDocument().activeElement?this._getClosestElementsInfo(s).forEach(([a,l])=>this._originChanged(a,i,l)):(this._setOrigin(i),"function"==typeof s.focus&&s.focus(r))}ngOnDestroy(){this._elementInfo.forEach((t,i)=>this.stopMonitoring(i))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,i,r){r?t.classList.add(i):t.classList.remove(i)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,i){this._toggleClass(t,"cdk-focused",!!i),this._toggleClass(t,"cdk-touch-focused","touch"===i),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===i),this._toggleClass(t,"cdk-mouse-focused","mouse"===i),this._toggleClass(t,"cdk-program-focused","program"===i)}_setOrigin(t,i=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&i,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,i){const r=this._elementInfo.get(i),s=Pf(t);!r||!r.checkChildren&&i!==s||this._originChanged(i,this._getFocusOrigin(s),r)}_onBlur(t,i){const r=this._elementInfo.get(i);!r||r.checkChildren&&t.relatedTarget instanceof Node&&i.contains(t.relatedTarget)||(this._setClasses(i),this._emitOrigin(r.subject,null))}_emitOrigin(t,i){this._ngZone.run(()=>t.next(i))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const i=t.rootNode,r=this._rootNodeFocusListenerCount.get(i)||0;r||this._ngZone.runOutsideAngular(()=>{i.addEventListener("focus",this._rootNodeFocusAndBlurListener,wC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,wC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(rs(this._stopInputModalityDetector)).subscribe(s=>{this._setOrigin(s,!0)}))}_removeGlobalListeners(t){const i=t.rootNode;if(this._rootNodeFocusListenerCount.has(i)){const r=this._rootNodeFocusListenerCount.get(i);r>1?this._rootNodeFocusListenerCount.set(i,r-1):(i.removeEventListener("focus",this._rootNodeFocusAndBlurListener,wC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,wC),this._rootNodeFocusListenerCount.delete(i))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,i,r){this._setClasses(t,i),this._emitOrigin(r.subject,i),this._lastFocusOrigin=i}_getClosestElementsInfo(t){const i=[];return this._elementInfo.forEach((r,s)=>{(s===t||r.checkChildren&&s.contains(t))&&i.push([s,r])}),i}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(Hi),Ie(U6),Ie(un,8),Ie(G6,8))},n.\u0275prov=$e({factory:function(){return new n(Ie(yn),Ie(Hi),Ie(U6),Ie(un,8),Ie(G6,8))},token:n,providedIn:"root"}),n})();const $6="cdk-high-contrast-black-on-white",W6="cdk-high-contrast-white-on-black",rN="cdk-high-contrast-active";let q6=(()=>{class n{constructor(t,i){this._platform=t,this._document=i}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const i=this._document.defaultView||window,r=i&&i.getComputedStyle?i.getComputedStyle(t):null,s=(r&&r.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),s){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(rN),t.remove($6),t.remove(W6),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(rN),t.add($6)):2===i&&(t.add(rN),t.add(W6))}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hi),Ie(un))},n.\u0275prov=$e({factory:function(){return new n(Ie(Hi),Ie(un))},token:n,providedIn:"root"}),n})(),qv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const K6=new Cu("12.2.5");function Z6(n){Promise.resolve(null).then(n)}class am{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Z6(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function e5(){return"undefined"!=typeof window&&void 0!==window.document}function oN(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let uN=(n,e)=>!1,dN=(n,e)=>!1,i5=(n,e,t)=>[];const r5=oN();(r5||"undefined"!=typeof Element)&&(uN=e5()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),dN=(()=>{if(r5||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):dN}})(),i5=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return hN(t)}matchesElement(t,i){return fN(t,i)}containsElement(t,i){return pN(t,i)}query(t,i,r){return gN(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new am(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class EC{}EC.NOOP=new a5;function d5(n,e,t){return t?e+":"+t+";":""}function h5(n){let e="";for(let t=0;t{const r=bN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),oN()&&h5(n))}function kf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=bN(t);n.style[i]=""}),oN()&&h5(n))}const bEe=/-+([a-z0-9])/g;function bN(n){return n.replace(bEe,(...e)=>e[1].toUpperCase())}function wEe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class um{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=um.initialStylesByElement.get(e);r||um.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&eu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(eu(this._element,this._initialStyles),this._endStyles&&(eu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(um.initialStylesByElement.delete(this._element),this._startStyles&&(kf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(kf(this._element,this._endStyles),this._endStyles=null),eu(this._element,this._initialStyles),this._state=3)}}um.initialStylesByElement=new WeakMap;const sc=new zt("AnimationModuleType"),X5=new Cu("12.2.5"),zSe=new zt("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let jf,pr=(()=>{class n{constructor(t,i,r){this._hasDoneGlobalChecks=!1,this._document=r,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=i,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!Sa()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const i=getComputedStyle(t);i&&"none"!==i.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&X5.full!==K6.full&&console.warn("The Angular Material version ("+X5.full+") does not match the Angular CDK version ("+K6.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(Ie(q6),Ie(zSe,8),Ie(un))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[qv],qv]}),n})();function UC(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=zi(e)}}}function Xv(n,e){return class extends n{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const i=t||this.defaultColor;i!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),i&&this._elementRef.nativeElement.classList.add(`mat-${i}`),this._color=i)}}}function FN(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=zi(e)}}}function LN(n,e=0){return class extends n{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?Na(t):this.defaultTabIndex}}}try{jf="undefined"!=typeof Intl}catch(n){jf=!1}class tCe{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const J5={enterDuration:225,exitDuration:150},kN=rm({passive:!0}),eG=["mousedown","touchstart"],tG=["mouseup","mouseleave","touchend","touchcancel"];class iCe{constructor(e,t,i,r){this._target=e,this._ngZone=t,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=Ku(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},J5),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);const o=i.radius||function(n,e,t){const i=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),r=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),a=e-r.left,l=t-r.top,c=s.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=a-o+"px",d.style.top=l-o+"px",d.style.height=2*o+"px",d.style.width=2*o+"px",null!=i.color&&(d.style.backgroundColor=i.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(d),d.style.transform="scale(1)";const f=new tCe(this,d,i);return f.state=0,this._activeRipples.add(f),i.persistent||(this._mostRecentTransientRipple=f),this._runTimeoutOutsideZone(()=>{const p=f===this._mostRecentTransientRipple;f.state=1,!i.persistent&&(!p||!this._isPointerDown)&&f.fadeOut()},c),f}fadeOutRipple(e){const t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!t)return;const i=e.element,r=Object.assign(Object.assign({},J5),e.config.animation);i.style.transitionDuration=`${r.exitDuration}ms`,i.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(()=>{e.state=3,i.parentNode.removeChild(i)},r.exitDuration)}fadeOutAll(){this._activeRipples.forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Ku(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(eG))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(tG),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=k6(e),i=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(1===e.state||e.config.terminateOnPointerUp&&0===e.state)&&e.fadeOut()}))}_runTimeoutOutsideZone(e,t=0){this._ngZone.runOutsideAngular(()=>setTimeout(e,t))}_registerEvents(e){this._ngZone.runOutsideAngular(()=>{e.forEach(t=>{this._triggerElement.addEventListener(t,this,kN)})})}_removeTriggerEvents(){this._triggerElement&&(eG.forEach(e=>{this._triggerElement.removeEventListener(e,this,kN)}),this._pointerUpEventsRegistered&&tG.forEach(e=>{this._triggerElement.removeEventListener(e,this,kN)}))}}const oCe=new zt("mat-ripple-global-options");let dm=(()=>{class n{constructor(t,i,r,s,o){this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=s||{},this._rippleRenderer=new iCe(this,i,t,r)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,i=0,r){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,i,Object.assign(Object.assign({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return n.\u0275fac=function(t){return new(t||n)(De(wn),De(yn),De(Hi),De(oCe,8),De(sc,8))},n.\u0275dir=kt({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&Ei("mat-ripple-unbounded",i.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),n})(),HC=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[pr,Gv],pr]}),n})();new class extends Yl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let yCe=1;const vCe=Promise.resolve(),GC={};function oG(n){return n in GC&&(delete GC[n],!0)}const aG={setImmediate(n){const e=yCe++;return GC[e]=!0,vCe.then(()=>oG(e)&&n()),e},clearImmediate(n){oG(n)}};new class extends Yl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=aG.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(aG.clearImmediate(t),e.scheduled=void 0)}});function Zv(n){return!!n&&(n instanceof F||"function"==typeof n.lift&&"function"==typeof n.subscribe)}function VG(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>me(function(n,e){return i=>{let r=i;for(let s=0;s{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new QAe(n,t))}}"undefined"!=typeof window&&window,tt(266),tt(478),new zt("SECURITY_CONTEXT");class QAe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new ZAe(e,this.observables,this.project))}}class ZAe extends k3{constructor(e,t,i){super(e),this.observables=t,this.project=i,this.toRespond=[];const r=t.length;this.values=new Array(r);for(let s=0;s0){const s=r.indexOf(i);-1!==s&&r.splice(s,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}function rb(n){return!0===n}function La(n){return null==n}function ka(n){return!La(n)}function sP(n){return Boolean(n)}function I$(n){return La(n)?n:JSON.parse(JSON.stringify(n))}const ax=n=>{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&ax(n[o])}),n};function O$(n){return ka(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const P$="NGXS_DATA_META",aP="NGXS_META",F$="NGXS_ARGUMENT_REGISTRY_META";let L$=(()=>{class n{constructor(t){this.sequence$=new Ir(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function sb(n){return n[P$]}let Ba=(()=>{class n{constructor(t,i,r){n.store=t.get(ih),n.ngZone=t.get(yn),n.factory=i,n.context=r,n.computed=t.get(L$)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(X8),Ie(K8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class os{constructor(){os.statesCachedMeta.clear()}static createStateContext(e){return Ba.context.createStateContext(e)}static ensureMappedState(e){if(La(Ba.factory)||La(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(ka(e.name)?os.statesCachedMeta.get(e.name):null)||os.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=sb(os.getStateClassByInstance(e)))&&void 0!==t?t:null;if(La(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=os.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=os.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=ka(e.name)?null===(t=Ba.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return ka(i)&&ka(e.name)&&os.statesCachedMeta.set(e.name,i),i}}os.statesCachedMeta=new Map,os.\u0275fac=function(e){return new(e||os)},os.\u0275prov=$e({token:os,factory:os.\u0275fac}),new pg(1);class NTe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${ka(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function k$(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function B$(n){var e;const t=k$(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=I$(void 0===t.defaults?{}:t.defaults);if(i.length){if(O$(s))return function(n,e){return e.reduce((t,i)=>{const r=k$(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=B$(i),t},null!=n?n:{})}(s,i);throw new NTe(s)}return s}function V$(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function U$(){var n,e;return null!==(e=null===(n=null==Ba?void 0:Ba.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function kTe(n){let e=!1;return Zv(n)&&(e=!0),e}function lP(n){return n[F$]}class BTe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class jTe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(sP(this.argumentMap.has(e))||sP(this.payloadMap.has(e)))throw new BTe(e,t)}}function $Te(n){return{enumerable:!0,configurable:!0,get(){const e=sb(n),t=os.ensureMappedState(e.stateMeta);return os.createStateContext(t)}}}function z$(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(O$(i))for(;null!==i;){if(rb(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return La(V$(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),V$(n)}(this),o=null==s?void 0:s.get(i);if(rb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(La(o)||o.sequenceId!==U$()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:U$(),isObservable:kTe(l)}),l}return o.value},t}}const QTe={cancelUncompleted:!0,insideZone:!1};function cP(n=QTe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=os.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=lP(r);if(La(f)){const G=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),ge=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var G;return rb(n.insideZone)?null===(G=Ba.ngZone)||void 0===G||G.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Zv(l)?nn(null).pipe(me(()=>l)):l};const T=os.createAction(f,o,g),q=Ba.store.dispatch(T);return Zv(l)?function(n,e){return Pv([n,e]).pipe(me(t=>t.pop()))}(q,l):l},i}}function H$(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return La(lP(t))&&Object.defineProperties(t,{[F$]:{enumerable:!0,configurable:!0,value:new jTe}}),lP(t)})(e,t).createPayloadType(r,t,i)}}function JTe(){return n=>{const e=function(n){if(function(n){return!sP(n)}(n.hasOwnProperty(aP))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,aP,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[aP]}(n)}(n);if(La(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=sb(n))&&void 0!==e?e:null;return(La(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,P$,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),sb(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>I$(t)},context:$Te(n)})}(n,e,B$(n)),function(n){var e,t;const i=sb(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(ka(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(ka(this[s]))return this[s];if(La(Ba.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ba.store.select(n).pipe(me(o=>Sa()?ax(o):o),ml({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let tDe=(()=>{class n{constructor(){this.browserStorageEvents$=new ee,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),nDe=(()=>{class n extends tDe{get snapshot(){return function(n){return Sa()?ax(n):n}(this.getState())}get ctx(){return function(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>Sa()?ax(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),Ca([z$(),Kl("design:type",Object),Kl("design:paramtypes",[])],n.prototype,"snapshot",null),Ca([cP(),P3(0,H$("patchValue")),Kl("design:type",Function),Kl("design:paramtypes",[Object]),Kl("design:returntype",void 0)],n.prototype,"patchState",null),Ca([cP(),P3(0,H$("stateValue")),Kl("design:type",Function),Kl("design:paramtypes",[Object]),Kl("design:returntype",void 0)],n.prototype,"setState",null),Ca([cP(),Kl("design:type",Function),Kl("design:paramtypes",[]),Kl("design:returntype",void 0)],n.prototype,"reset",null),n})();const pDe=["bodyCanvas"];let gDe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new mn,this.nodeDrag=new mn,this.nodeClick=new mn,this.nodeHoverStart=new mn,this.nodeHoverStop=new mn,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return or(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new Bbe({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Mr(pDe,5,wn),2&t){let r;di(r=hi())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Tc(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&wi(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),mDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr]]}),n})();new zt("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const Z$=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}];Z$.filter(n=>!0!==n.disabled);let cx=(()=>{let n=class extends nDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ui(n=>null!=n),ml(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(VG(...t),Wu(),ml(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(VG(...t),Wu(),ml(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),Ca([z$()],n.prototype,"config$",null),n=Ca([JTe(),x0e({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();function tu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let dP;function ac(){return dP||(dP=function(n,e){const t=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const i=()=>indexedDB.databases().finally(t);e=setInterval(i,100),i()}).finally(()=>clearInterval(e))}().then(()=>{const i=indexedDB.open("keyval-store");return i.onupgradeneeded=()=>i.result.createObjectStore(e),tu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),dP}function J$(n,e=ac()){return e("readonly",t=>tu(t.get(n)))}var Yi=tt(440),KDe=tt(698),XDe=tt(445),QDe=tt.n(XDe),pi=tt(815),dh=tt(609);const Gi=Yi.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},Yi.DataFactory),eW={x:Gi("rdf"),type:Gi("rdf")("type")},_m={x:Gi("rdfs"),label:Gi("rdfs")("label"),comment:Gi("rdfs")("comment"),isDefinedBy:Gi("rdfs")("isDefinedBy"),seeAlso:Gi("rdfs")("seeAlso")},gi={x:Gi("entity"),id:Gi("entity")("id"),label:_m.label,description:_m.comment,link:_m.seeAlso,sex:Gi("entity")("sex"),age:Gi("entity")("age"),bmi:Gi("entity")("bmi"),Male:Yi.DataFactory.literal("Male"),Female:Yi.DataFactory.literal("Female"),consortiumName:Gi("entity")("consortium_name"),providerName:Gi("entity")("provider_name"),providerUUID:Gi("entity")("provider_uuid"),donor:Gi("entity")("has_donor"),sections:Gi("entity")("has_tissue_section"),datasets:Gi("entity")("has_dataset"),sampleType:Gi("entity")("sample_type"),TissueBlock:Yi.DataFactory.literal("Tissue Block"),TissueSection:Yi.DataFactory.literal("Tissue Section"),NonStandard:Yi.DataFactory.literal("Non-standard"),sectionCount:Gi("entity")("section_count"),sectionSize:Gi("entity")("section_size"),sectionUnits:Gi("entity")("section_units"),sectionNumber:Gi("entity")("section_number"),spatialEntity:Gi("entity")("has_spatial_entity"),ontologyTerms:Gi("entity")("has_ontology_term"),technology:Gi("entity")("technology"),thumbnail:Gi("entity")("has_thumbnail")},In=Gi("ccf"),lr={x:In,ontologyNode:{label:In("ccf_preferred_label"),parent:In("ccf_part_of"),children:In("ccf_part_of"),rui_rank:In("ccf_rui_rank"),synonymLabels:Yi.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:In("VHFemale"),Male:In("VHMale"),BothSexes:In("VHBothSexes"),FemaleOrgans:In("VHFemaleOrgans"),MaleOrgans:In("VHMaleOrgans")},SpatialObjectReference:In("SpatialObjectReference"),SpatialEntity:In("SpatialEntity"),SpatialPlacement:In("SpatialPlacement"),spatialObjectReference:{file:In("has_object_file"),file_format:In("has_object_file_format"),file_subpath:In("has_object_file_subpath")},extractionSet:{label:_m.label,rui_rank:In("ccf_rui_rank")},spatialEntity:{label:_m.label,comment:_m.comment,creator:Gi("dc")("creator"),creator_first_name:In("creator_first_name"),creator_last_name:In("creator_last_name"),creator_orcid:In("creator_orcid"),creation_date:In("creation_date"),updated_date:In("updated_date"),ccf_annotations:In("ccf_annotation"),representation_of:In("ccf_representation_of"),reference_organ:In("anatomical_structure_of"),extraction_set_for:In("extraction_set_for"),extraction_set:In("extraction_site_for"),sex:In("has_sex"),side:In("has_side"),rui_rank:In("ccf_rui_rank"),slice_thickness:In("ccf_slice_thickness"),slice_count:In("ccf_slice_count"),x_dimension:In("has_x_dimension"),y_dimension:In("has_y_dimension"),z_dimension:In("has_z_dimension"),dimension_units:In("has_dimension_units"),object:In("has_object_reference")},spatialPlacement:{source:In("has_placement_source"),target:In("has_placement_target"),placement_date:In("has_placement_date"),x_scaling:In("has_x_scaling"),y_scaling:In("has_y_scaling"),z_scaling:In("has_z_scaling"),scaling_units:In("has_scaling_units"),x_rotation:In("has_x_rotation"),y_rotation:In("has_y_rotation"),z_rotation:In("has_z_rotation"),w_rotation:In("has_theta_rotation"),rotation_order:In("has_rotation_order"),rotation_units:In("has_rotation_units"),x_translation:In("has_x_translation"),y_translation:In("has_y_translation"),z_translation:In("has_z_translation"),translation_units:In("has_translation_units")}},Ar={x:Gi("uberon")},tW=(Gi("lmha"),{bladder:Ar.x("0001255"),body:Ar.x("0013702"),brain:Ar.x("0000955"),colon:Ar.x("0001155"),heart:Ar.x("0000948"),kidney:Ar.x("0002113"),large_intestine:Ar.x("0000059"),left_kidney:Ar.x("0004538"),left_lung:Ar.x("0002168"),left_ureter:Ar.x("0001223"),liver:Ar.x("0002107"),lung:Ar.x("0002048"),respiratory_system:Ar.x("0001004"),lymph_node:Ar.x("0000029"),pelvis:Ar.x("0001270"),rectum:Ar.x("0001052"),right_kidney:Ar.x("0004539"),right_lung:Ar.x("0002167"),right_ureter:Ar.x("0001222"),skin:Ar.x("0002097"),small_intestine:Ar.x("0002108"),spleen:Ar.x("0002106"),thymus:Ar.x("0002370"),ureter:Ar.x("0000056"),vasculature:Ar.x("0002049")});function fP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const ux={spatialObjectReference:fP(lr.spatialObjectReference),spatialEntity:fP(lr.spatialEntity),spatialPlacement:fP(lr.spatialPlacement)};function dx(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,dh.fromRdf)(s.object):s.object.id;(0,pi.set)(r,o,a)}return!1},Yi.DataFactory.namedNode(e),null,null,null),r}const eMe=(0,pi.memoize)(function(n,e){return dx(n,e,"SpatialObjectReference",ux.spatialObjectReference)},(n,e)=>e),nW=(0,pi.memoize)(function(n,e){const t=dx(n,e,"ExtractionSet",ux.spatialEntity);return t.extractionSites=(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set,e,null).map(i=>Hf(n,i.id)),["rui_rank"]),t},(n,e)=>e),iMe=(0,pi.memoize)(function(n,e){return(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set_for,e,null).map(t=>nW(n,t.id)),["rui_rank"])},(n,e)=>e),sMe=(0,pi.memoize)(function(n,e){return(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.reference_organ,e,null).map(t=>Hf(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),aMe=(0,pi.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(Hf(n,t.subject.id))},null,lr.spatialEntity.reference_organ,null,null),(0,pi.sortBy)(e,["rui_rank"])}),Hf=(0,pi.memoize)(function(n,e){const t=dx(n,e,"SpatialEntity",ux.spatialEntity);return t.object&&(t.object=eMe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,lr.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,gi.spatialEntity,e,null),t},(n,e)=>e),uMe=(0,pi.memoize)(function(n,e){const t=dx(n,e,"SpatialPlacement",ux.spatialPlacement);return t.source&&(t.source=Hf(n,t.source)),t.target&&(t.target=Hf(n,t.target)),t},(n,e)=>e),hMe=(0,pi.memoize)(function(n,e){const t=n.getObjects(Yi.DataFactory.namedNode(e),gi.spatialEntity,null);if(t.length>0)return Hf(n,t[0].id)},(n,e)=>e);function fMe(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(zj),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class iW{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new KDe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},eW.type,lr.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},eW.type,lr.SpatialEntity,null);const t={};e.some(i=>(t[i.subject.id]=i.object.id,!1),null,lr.spatialPlacement.source,null,null),e.some(i=>{const r=t[i.subject.id];return r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement"),!1},null,lr.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,i,r){this.graph.mergeDirectedEdge(t,i,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new Gn(Gn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new Gn(Gn.IDENTITY),s=QDe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s){if(o){const l=this.graph.getEdgeAttribute(a,o,"id");fMe(r,uMe(i,l))}o=a}return r}}}class rW{constructor(e){this.db=e}getSpatialEntity(e){return Hf(this.db.store,e)}getExtractionSets(e){return iMe(this.db.store,e)}getExtractionSet(e){return nW(this.db.store,e)}getAnatomicalStructures(e){return sMe(this.db.store,e)}getReferenceOrgans(){return aMe(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=lr.spatial.Male.id;break;case"Female":t=lr.spatial.Female.id;break;case"Both":default:t=lr.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(i=>"Male"===i.sex);break;case"Female":t=t.filter(i=>"Female"===i.sex)}return(null==e?void 0:e.debug)&&(t=t.map(i=>[[i],this.getAnatomicalStructures(i["@id"])]).reduce((i,[r,s])=>i.concat(s.length>0?s:r),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let i=[...this.getReferenceOrganSets(e).map(r=>{const s="http://purl.obolibrary.org/obo/UBERON_0002097"===r.representation_of;return this.getSceneNode(r,t,{color:[255,255,255,255],opacity:s?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!s})})];return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(lr.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(r=>void 0!==r)}getReferenceOrganScene(e,t){var i,r;const s=null!==(i=void 0!==(null==t?void 0:t.sex))&&void 0!==i&&i,o=this.getReferenceOrgans().filter(a=>a.representation_of===e&&(!s||a.sex===(null==t?void 0:t.sex)));if(o.length>0){const a=o[0],c=this.getSceneNode(a,a,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===a.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),d=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(f=>this.getSceneNode(f,a,{color:[255,255,255,229.5]}));return[c].concat(d).filter(f=>void 0!==f)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(i=>this.getSceneNode(i,t,{color:[255,255,255,229.5]})).filter(i=>void 0!==i)}getSceneNode(e,t,i={}){var r,s,o,a;const l=null===(s=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===s?void 0:s.startsWith("model/gltf");let d=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(d){if(l)d=new Gn(Gn.IDENTITY).rotateX(zj(90)).multiplyLeft(d);else{let f;switch(e.dimension_units){case"centimeter":f=.01;break;case"millimeter":f=.001;break;case"meter":default:f=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*f/2);d.scale(p)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:l?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:l?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:d,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const hx="https://entity.api.hubmapconsortium.org/entities/",sW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),pMe={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},fx={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},Ti=function(){const n={};return Object.entries(tW).forEach(([e,t])=>n[e]=t.id),n}(),mMe={BL:[Ti.body,Ti.bladder],RK:[Ti.body,Ti.kidney,Ti.right_kidney],LK:[Ti.body,Ti.kidney,Ti.left_kidney],HT:[Ti.body,Ti.heart],LI:[Ti.body,Ti.large_intestine,Ti.colon],SI:[Ti.body,Ti.small_instestine],LL:[Ti.body,Ti.respiratory_system,Ti.lung,Ti.left_lung],RL:[Ti.body,Ti.respiratory_system,Ti.lung,Ti.right_lung],LY:[Ti.body,Ti.lymph_node],SP:[Ti.body,Ti.spleen],TH:[Ti.body,Ti.thymus],UR:[Ti.body,Ti.ureter],LV:[Ti.body,Ti.liver],OT:[Ti.body]},oW={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class vMe{constructor(e,t="",i="",r){var s,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const c=this.data.descendants||[],d=(this.data.ancestors||[]).find(We=>"Donor"===We.entity_type);this.donor=this.getDonor(d,i);const f=this.getRuiLocation(e,this.donor);f?this.rui_location=f:this.bad=!0;const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=fx[e.group_uuid]||e.group_name,_=e.created_by_user_displayname;this["@id"]=hx+e.uuid,this.label=`Registered ${p}, ${_}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const x={},T=[];this.sections=T;const q=[];this.datasets=q;for(const We of c.filter(dt=>"Sample"===dt.entity_type)){const dt=this.getSection(We,e,i);x[We.submission_id]=dt,T.push(dt),dt.section_number=null!==(s=dt.section_number)&&void 0!==s?s:T.length}for(const We of c)if("Dataset"===We.entity_type){const dt=this.getDataset(We,t,i,r),Mt=(0,pi.get)(We,["ingest_metadata","metadata","tissue_id"]);x[Mt]?null===(o=x[Mt].datasets)||void 0===o||o.push(dt):q.push(dt)}const G=null!=f?f:{},ge=`${G.x_dimension} x ${G.y_dimension} x ${G.z_dimension} ${G.dimension_units}`;this.section_count=G.slice_count||T.length;const Ne=parseFloat((G.slice_thickness||(G.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ne;const Ge=G.dimension_units||"millimeter";this.section_units=Ge,this.description=`${ge}, ${Ne} ${Ge}, ${e.specimen_type}, ${this.section_count} Sections`,T.forEach((We,dt)=>{We.description=`${G.x_dimension} x ${G.y_dimension} x ${Ne} ${Ge}, ${Ne} ${Ge}, ${We.description}`,We.section_number=dt+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":hx+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${fx[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${i}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",i="",r){var s;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=fx[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,pi.get)(e,["ingest_metadata","metadata","assay_type"],"")],d=c.join("|").toLowerCase();let f,p="assets/icons/ico-unknown.svg";return-1!==d.indexOf("10x")?(f="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==d.indexOf("af")?(f="AF",p="assets/icons/ico-spatial-af.svg"):-1!==d.indexOf("codex")?(f="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==d.indexOf("imc")?(f="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==d.indexOf("lc")&&-1===d.indexOf("af")?(f="LC",p="assets/icons/ico-bulk-lc.svg"):f=-1!==d.indexOf("maldi")?"MALDI":-1!==d.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":hx+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:f,thumbnail:p}}getDatasetThumbnail(e,t,i){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(i?`?token=${i}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,pi.get)(e,"metadata.files",[]).filter(s=>/\.(ome\.tif|ome\.tiff)$/.test(s.rel_path)).filter(s=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(s.rel_path)).filter(s=>sW.has(s.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(s=>`${t}/${e.uuid}/${s.rel_path}`+(i?`?token=${i}`:""));if(r.length>0){const s=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(sW.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=pMe[e.hubmap_id];if(r)return`assets/thumbnails/TMC-Florida/${r}`}}getDonor(e,t){const i=(e.description||"").toLowerCase();let r;i.includes("female")?r="Female":i.includes("male")&&(r="Male");const s=i.match(/age ([0-9]+)/);let o,a;s&&(o=(0,pi.toNumber)(s[1]));for(const p of(0,pi.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===p.preferred_term||"Female"===p.preferred_term?r="Female":"Masculine gender"===p.preferred_term||"Male"===p.preferred_term?r="Male":"Current chronological age"===p.preferred_term||"Age"===p.preferred_term?o=(0,pi.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,pi.toNumber)(p.data_value));let l="";r&&o&&(l+=`${r}, Age ${o}`,a&&(l+=`, BMI ${a.toFixed(1)}`));const c=new Date(e.last_modified_timestamp).toLocaleDateString(),d=fx[e.group_uuid]||e.group_name;return{"@id":hx+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${d}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;const s=(e.ancestors||[]).find(c=>"Sample"===c.entity_type&&"organ"===c.specimen_type),o=mMe[null==s?void 0:s.organ]||[Ti.body];let a,l=e.rui_location;if(l&&("string"==typeof l&&(l=JSON.parse(l)),l.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):l["@id"]&&(a=l)),a){a.ccf_annotations=o.concat(a.ccf_annotations||[]);const c=null!==(i=(0,pi.get)(a,["placement","target"]))&&void 0!==i?i:"";c.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,pi.set)(a,["placement","target"],c.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===c||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===c)&&(0,pi.set)(a,["placement","target"],"Male"===t.sex?c.replace("#VH","#VHM")+"_Patch":c.replace("#VH","#VHF")+"_Patch")}return a}getTissueBlock(){return(0,pi.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function aW(n,e,t,i,r="",s=""){return or(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(n).then(a=>a.ok?a.json():void 0).catch(()=>{});else if("search-api"===e){const a={"Content-type":"application/json"};i&&i.length>0&&(a.Authorization=`Bearer ${i}`),o=yield fetch(n,{method:"POST",headers:a,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:{exists:{field:"rui_location"}}})}).then(l=>l.ok?l.json():void 0).catch(()=>{})}if(o)return function(n,e="",t="",i,r=!1){const o={},a=(0,pi.get)(n,"hits.hits",[]).map(c=>(0,pi.get)(c,"_source",{})).map(c=>new vMe(c,e,t,i).toJsonLd());for(const c of a){const d=c["@id"];o[d]?o[d].samples.push(c.samples[0]):o[d]=c}const l=Object.values(o);return r&&(function(n){let e=[],t=0;for(const i of n.filter(r=>r.samples.length>1)){const r=i.samples;for(let s=0;sc["@id"]===o)&&(r[s].deleteMe=!0,t++)}i.samples=r.filter(s=>!0!==s.deleteMe)}t>0&&console.log(`\u26a0 ${t} sections identified as blocks`)}(l),console.log(l.map(c=>Object.assign({"@context":oW},c)))),{"@context":oW,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function px(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.donor,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}function ob(n,e){return t=>n.has(t.id)?e.add(t.id):void 0}const FMe={[lr.ontologyNode.label.id]:"label",[lr.ontologyNode.parent.id]:"parent",[lr.ontologyNode.synonymLabels.id]:"synonymLabels"};function LMe(n,e){const t=Yi.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return n.some(r=>{const s=FMe[r.predicate.id];if(s){const o="Literal"===r.object.termType?(0,dh.fromRdf)(r.object):r.object.id;"synonymLabels"===s?i.synonymLabels.push(o):(0,pi.set)(i,s,o)}return!1},t,null,null,null),i.children=n.getSubjects(lr.ontologyNode.children,t,null).map(r=>r.id),i}const gx={[gi.label.id]:"label",[gi.description.id]:"description",[gi.link.id]:"link"},BMe=Object.assign(Object.assign({},gx),{[gi.providerName.id]:"providerName"}),jMe=Object.assign(Object.assign({},gx),{[gi.technology.id]:"technology",[gi.thumbnail.id]:"thumbnail"}),VMe=Object.assign(Object.assign({},gx),{[gi.sampleType.id]:"sampleType",[gi.sectionNumber.id]:"sectionNumber",[gi.datasets.id]:"datasets"}),UMe=Object.assign(Object.assign({},gx),{[gi.sampleType.id]:"sampleType",[gi.sectionCount.id]:"sectionCount",[gi.sectionSize.id]:"sectionSize",[gi.sectionUnits.id]:"sectionUnits",[gi.donor.id]:"donor",[gi.spatialEntity.id]:"spatialEntityId",[gi.sections.id]:"sections",[gi.datasets.id]:"datasets"}),HMe=(0,pi.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=BMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;(0,pi.set)(t,r,s)}return!1},Yi.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function lW(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=jMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;(0,pi.set)(t,r,s)}return!1},Yi.DataFactory.namedNode(e),null,null,null),t}const WMe=(0,pi.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=UMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=VMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=lW(n,s);t[r].push(o)}else(0,pi.set)(t,r,s)}return!1},Yi.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=lW(n,s);t[r].push(o)}else"donor"===r?t[r]=HMe(n,s):(0,pi.set)(t,r,s)}return!1},Yi.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e),qMe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class YMe{constructor(e=qMe){this.options=e,this.store=new Yi.Store(void 0,{factory:Yi.DataFactory}),this.graph=new iW(this),this.scene=new rW(this)}connect(e,t=!1){return or(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return or(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield J$(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=ac()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),tu(t.transaction)))}([i,t]).catch(()=>{}):s=yield J$(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=ac()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),tu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return or(this,void 0,void 0,function*(){const i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],s=this.options.ccfOwlUrl;if(s.endsWith(".n3store.json")){const o=yield fetch(s).then(a=>a.text()).catch(()=>console.log("Couldn't locate serialized store."));o&&(this.store=(0,Yi.deserializeN3Store)(o,Yi.DataFactory))}else(null==s?void 0:s.length)>0&&r.push(s);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(aW(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(o=>{if(o)return this.addDataSources([o])}))),i.push(this.addDataSources(r)),yield Promise.all(i),yield this.synchronize()})}addDataSources(e,t){return or(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>or(this,void 0,void 0,function*(){"string"==typeof r?r.endsWith("jsonld")?yield(0,Yi.addJsonLdToStore)(r,i):r.endsWith("n3")?yield(0,Yi.addN3ToStore)(r,i):(r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml"))&&(yield(0,Yi.addRdfXmlToStore)(r,i)):yield(0,Yi.addJsonLdToStore)(r,i)}))),this})}synchronize(){return or(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,Yi.serializeN3Store)(this.store)}deserialize(e){return or(this,void 0,void 0,function*(){this.store=(0,Yi.deserializeN3Store)(e,Yi.DataFactory),this.graph=new iW(this),this.scene=new rW(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e){var t,i,r,s,o;let a=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),gi.spatialEntity,null,null),e}(n);if(a.size>0&&(a=function(n,e,t=!0){const i=new Set;if(n.forSubjects(ob(e,i),gi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const l=e.sex;a=px(n,a,c=>function(n,e,t){const i=new Set;return n.forSubjects(ob(e,i),gi.sex,gi[t],null),i}(n,c,l))}if(a.size>0&&(null===(t=e.tmc)||void 0===t?void 0:t.length)>0&&(a=px(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Yi.DataFactory.literal(r);n.forSubjects(ob(e,i),gi.providerName,s,null)}return i}(n,l,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set,o=new Set;n.some(c=>(e.has(c.subject.id)&&o.add(c.object.id),!1),null,gi.sections,null,null),n.some(c=>{var d;return(e.has(c.subject.id)||o.has(c.subject.id))&&(s.add(c.object.id),r.has(c.object.id)?null===(d=r.get(c.object.id))||void 0===d||d.push(c.subject.id):r.set(c.object.id,[c.subject.id])),!1},null,gi.datasets,null,null);const a=t(s),l=new Set;for(const c of a)for(const d of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(d);return l}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Yi.DataFactory.literal(r);n.forSubjects(ob(e,i),gi.technology,s,null)}return i}(n,l,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.spatialEntity,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Yi.DataFactory.namedNode(r);n.forSubjects(ob(e,i),lr.spatialEntity.ccf_annotations,s,null)}return i}(n,l,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,pi.isFinite)(e.ageRange[0])&&(0,pi.isFinite)(e.ageRange[1])){const l=Math.max(...e.ageRange),c=Math.min(...e.ageRange);1===c&&110===l||(a=px(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,dh.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.age,null,null),r}(n,d,c,l)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,pi.isFinite)(e.bmiRange[0])&&(0,pi.isFinite)(e.bmiRange[1])){const l=Math.max(...e.bmiRange),c=Math.min(...e.bmiRange);13===c&&83===l||(a=px(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,dh.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.bmi,null,null),r}(n,d,c,l)))}return a}(this.store,e)}get(e){return this.store.getQuads(Yi.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(t=>this.get(t))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>hMe(this.store,t))}getDatasetTechnologyNames(){return or(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return or(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return or(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>WMe(this.store,t))})}getAggregateResults(e){return or(this,void 0,void 0,function*(){return function(n,e){const t=new Set;e.some(l=>(n.has(l.subject.id)&&t.add(l.object.id),!1),null,gi.donor,null,null);const i=new Set;e.some(l=>(t.has(l.subject.id)&&i.add(l.object.id),!1),null,gi.providerUUID,null,null);const r=new Set;e.forSubjects(l=>{n.has(l.id)&&r.add(l.id)},gi.spatialEntity,null,null);const s=new Set;e.some(l=>(r.has(l.subject.id)&&s.add(l.object.id),!1),null,gi.sections,null,null);const o=new Set;return e.some(l=>{const c=l.subject;return(r.has(c.id)||s.has(c.id))&&o.add(l.object.id),!1},null,gi.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:t.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([l,c])=>({label:l,count:c}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return or(this,void 0,void 0,function*(){return function(n,e){const t=new Map;e.some(r=>(n.has(r.subject.id)&&(t.has(r.object.id)?t.get(r.object.id).push(r.subject.id):t.set(r.object.id,[r.subject.id])),!1),null,gi.spatialEntity,null,null);const i={};return e.some(r=>{var s,o;if(t.has(r.subject.id)){const a=null!==(o=null===(s=t.get(r.subject.id))||void 0===s?void 0:s.length)&&void 0!==o?o:0;i[r.object.id]=a+(i[r.object.id]||0)}return!1},null,lr.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store)})}getOntologyTreeModel(){return or(this,void 0,void 0,function*(){return function(n){const e={root:tW.body.id,nodes:{}},t=new Set;n.some(i=>(t.add(i.subject.id),t.add(i.predicate.id),!1),null,lr.ontologyNode.parent,null,null);for(const i of t)e.nodes[i]=LMe(n,i);return e}(this.store)})}getReferenceOrgans(){return or(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return or(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return or(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}}function XMe(n,e){return n===e}let QMe=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new S,this.dataSource=i.config$.pipe(Ui(r=>Object.keys(r).length>0),me(r=>r),Wu(XMe),sr(r=>function(n,e){return new F(t=>{let i,r;try{i=n()}catch(a){return void t.error(a)}try{r=e(i)}catch(a){return void t.error(a)}const o=(r?Pe(r):Nc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),ml(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(sr(i=>i.getTissueBlockResults(t)),Xi(1))}getAggregateResults(t){return this.dataSource.pipe(sr(i=>i.getAggregateResults(t)),Xi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(sr(i=>i.getOntologyTermOccurences(t)),Xi(1))}getOntologyTreeModel(){return this.dataSource.pipe(sr(t=>t.getOntologyTreeModel()),Xi(1))}getReferenceOrgans(){return this.dataSource.pipe(sr(t=>t.getReferenceOrgans()),Xi(1))}getScene(t){return this.dataSource.pipe(sr(i=>i.getScene(t).then(r=>r.filter(s=>t.ontologyTerms.includes(s.representation_of)))),Xi(1))}getReferenceOrganScene(t,i){return this.dataSource.pipe(sr(r=>r.getReferenceOrganScene(t,i)),Xi(1))}createDataSource(){return{source:new YMe,unsubscribe:()=>{}}}connectDataSource(t,i){return or(this,void 0,void 0,function*(){$d.disableDbWorker&&(yield new Promise(s=>{setTimeout(s,100)}));const r=(new Date).getTime();return yield t.connect(i,!0),$d.production||console.info(`Loaded CCF database in ${((new Date).getTime()-r)/1e3}s`),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(af),Ie(cx))},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),ZMe=(()=>{class n{constructor(t){this.source=t,this.organs=Z$}getOrganInfo(t,i,r="Female"){let s=this.organs.find(a=>a.id===t);if(!s)return nn(void 0);const o=s.organ;return s.disabled&&(s=this.organs.find(a=>!a.disabled&&a.organ===o)),(null==s?void 0:s.side)&&i&&s.side!==i&&(s=this.organs.find(a=>!a.disabled&&a.organ===o&&a.side===i)),nn(s)}getOrgan(t,i="Female"){return this.source.getReferenceOrgans().pipe(me(r=>r.find(s=>s.representation_of===t.id&&("Both"===i||s.sex===i))))}getOrganScene(t,i="Female"){return t.id?this.source.getReferenceOrganScene(t.id,{ontologyTerms:[t.id],sex:i}):nn([])}getOrganStats(t,i="Female"){return t.id?this.source.getAggregateResults({ontologyTerms:[t.id],sex:i}):nn([])}getBlocks(t,i="Female"){return t.id?this.source.getTissueBlockResults({ontologyTerms:[t.id],sex:i}):nn([])}}return n.\u0275fac=function(t){return new(t||n)(Ie(QMe))},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const JMe=["thumbContainer"],eIe=["toggleBar"],tIe=["input"],nIe=function(n){return{enterDuration:n}},iIe=["*"],rIe=new zt("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let sIe=0;const oIe={provide:Ra,useExisting:fe(()=>cW),multi:!0};class aIe{constructor(e,t){this.source=e,this.checked=t}}const lIe=LN(Xv(FN(UC(class{constructor(n){this._elementRef=n}}))));let cW=(()=>{class n extends lIe{constructor(t,i,r,s,o,a){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=o,this._onChange=l=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++sIe,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new mn,this.toggleChange=new mn,this.tabIndex=parseInt(s)||0,this.color=this.defaultColor=o.color||"accent",this._noopAnimations="NoopAnimations"===a}get required(){return this._required}set required(t){this._required=zi(t)}get checked(){return this._checked}set checked(t){this._checked=zi(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new aIe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(De(wn),De(Xu),De(ts),function(n){return function(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const i=t.length;let r=0;for(;r{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})(),dIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[uW,HC,pr,nN],uW,pr]}),n})(),hIe=(()=>{class n{constructor(){this.clsName="ccf-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new mn}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Tc(i.clsName)},inputs:{labels:"labels",value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},decls:6,vars:12,consts:[[1,"slide-label",3,"click"],[1,"slider",3,"disabled","checked","change"],["toggle",""]],template:function(t,i){if(1&t){const r=wu();Pt(0,"span",0),kn("click",function(){Vo(r);const o=qp(3);return i.left||o.toggle(),i.updateToggle(!0)}),Si(1),Ft(),Pt(2,"mat-slide-toggle",1,2),kn("change",function(o){return i.updateToggle(!o.checked)}),Ft(),Pt(4,"span",0),kn("click",function(){Vo(r);const o=qp(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Si(5),Ft()}2&t&&(Ei("disabled",i.disabled)("highlighted",i.left),Yt(1),xs(i.labels[0].charAt(0).toUpperCase()+i.labels[0].slice(1)),Yt(1),on("disabled",i.disabled)("checked",!i.left),Yt(2),Ei("disabled",i.disabled)("highlighted",!i.left),Yt(1),xs(i.labels[1].charAt(0).toUpperCase()+i.labels[1].slice(1)))},directives:[cW],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer;opacity:50%}[_nghost-%COMP%] .slide-label.highlighted[_ngcontent-%COMP%]{opacity:100%}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%!important;cursor:not-allowed}[_nghost-%COMP%] .slider .mat-slide-toggle-bar{background-color:#43476580}[_nghost-%COMP%] .slider .mat-slide-toggle-thumb{background-color:#434765}"],changeDetection:0}),n})();const fIe=["bodyUI"],pIe=function(){return["Male","Female"]},gIe=function(){return["Left","Right"]};let mIe=(()=>{class n{constructor(t){this.ga=t,this.sexChange=new mn,this.sideChange=new mn}ngOnInit(){this.reset()}ngAfterViewChecked(){this.updateHighlighting()}updateHighlighting(){var t,i,r,s;const o=new Set(null!==(i=null===(t=this.filter)||void 0===t?void 0:t.tmc)&&void 0!==i?i:[]);this.filteredBlocks=null!==(s=null===(r=this.blocks)||void 0===r?void 0:r.filter(a=>o.has(a.donor.providerName)).map(a=>a["@id"]))&&void 0!==s?s:[],this.bodyUI.scene=this.bodyUI.scene.map(a=>{var l;return Object.assign(Object.assign({},a),{color:a.entityId&&this.highlightedNodeId===a["@id"]?[30,136,229,255]:this.filteredBlocks.includes(null!==(l=a.entityId)&&void 0!==l?l:"")?[173,255,47,229.5]:[255,255,255,229.5]})})}ngOnChanges(t){this.bodyUI&&"organ"in t&&this.reset()}updateSex(t){this.sex=t,this.sexChange.emit(this.sex)}updateSide(t){this.side=t,this.sideChange.emit(this.side)}reset(){const{bodyUI:t,organ:i}=this;if(i){i.side||(this.side=void 0);const{x_dimension:r,y_dimension:s,z_dimension:o}=i;t.rotation=t.rotationX=0,t.bounds={x:1.25*r/1e3,y:1.25*s/1e3,z:1.25*o/1e3},t.target=[r/1e3/2,s/1e3/2,o/1e3/2]}}nodeClicked(t){this.ga.event("node_click","organ",t.node["@id"]),this.highlightedNodeId=this.highlightedNodeId&&this.highlightedNodeId===t.node["@id"]?"":t.node["@id"]}}return n.\u0275fac=function(t){return new(t||n)(De(PE))},n.\u0275cmp=_n({type:n,selectors:[["ccf-organ"]],viewQuery:function(t,i){if(1&t&&Mr(fIe,7),2&t){let r;di(r=hi())&&(i.bodyUI=r.first)}},inputs:{organ:"organ",scene:"scene",organIri:"organIri",sex:"sex",side:"side",blocks:"blocks",filter:"filter"},outputs:{sexChange:"sexChange",sideChange:"sideChange"},features:[ki],decls:5,vars:9,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick"],["bodyUI",""],[1,"stage-options"],[1,"view-slider",3,"labels","value","valueChange"],[1,"view-slider",3,"labels","value","disabled","valueChange"]],template:function(t,i){1&t&&(Pt(0,"ccf-body-ui",0,1),kn("nodeClick",function(s){return i.nodeClicked(s)}),Ft(),Pt(2,"div",2),Pt(3,"ccf-slide-toggle",3),kn("valueChange",function(s){return i.updateSex(s)}),Ft(),Pt(4,"ccf-slide-toggle",4),kn("valueChange",function(s){return i.updateSide(s)}),Ft(),Ft()),2&t&&(on("scene",i.scene)("interactive",!0),Yt(3),on("labels",Mw(7,pIe))("value",i.sex),Yt(1),on("labels",Mw(8,gIe))("value",i.side)("disabled",!i.side))},directives:[gDe,hIe],styles:["[_nghost-%COMP%]{display:block;background-color:#000;border-radius:.5rem;color:#fff;height:100%}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{height:90%}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{padding:1rem;min-width:352px}"],changeDetection:0}),n})();function _Ie(n,e){if(1&n&&(Pt(0,"div",3),Pt(1,"div",4),Si(2),Ft(),Pt(3,"div",5),Si(4),Ft(),Ft()),2&n){const t=e.$implicit;Yt(2),xs(t.count),Yt(2),xs(t.label)}}let yIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-stats-list"]],inputs:{statsLabel:"statsLabel",stats:"stats"},decls:4,vars:2,consts:[[1,"stats-container"],[1,"header"],["class","stats-row",4,"ngFor","ngForOf"],[1,"stats-row"],[1,"stat"],[1,"label"]],template:function(t,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Si(2),Ft(),Ai(3,_Ie,5,2,"div",2),Ft()),2&t&&(Yt(2),Mc(" ",i.statsLabel," "),Yt(1),on("ngForOf",i.stats))},directives:[Ud],styles:[".stats-container[_ngcontent-%COMP%]{margin-bottom:2rem;min-height:9rem}.stats-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{margin-bottom:1rem}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;height:1.325rem}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%] .stat[_ngcontent-%COMP%]{width:2rem;margin-right:1rem;text-align:right}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{flex-grow:1;text-align:left}"],changeDetection:0}),n})();function vIe(n,e){if(1&n){const t=wu();Pt(0,"div",6),Pt(1,"div",7),Pt(2,"div",8),Si(3),Ft(),Pt(4,"div",9),kn("click",function(){const s=Vo(t).$implicit;return wr().goToURL(s.buttonUrl)}),Si(5),Ft(),Ft(),Ft()}if(2&n){const t=e.$implicit;Yt(3),xs(t.body),Yt(1),on("gaLabel",t.buttonUrl),Yt(1),Mc(" ",t.buttonTitle,"")}}function bIe(n,e){if(1&n){const t=wu();Pt(0,"div",10),kn("click",function(){const s=Vo(t).$implicit;return wr().goToURL(s.buttonUrl)}),Si(1),Ft()}if(2&n){const t=e.$implicit;on("gaLabel",t.buttonUrl),Yt(1),xs(t.buttonTitle)}}let wIe=(()=>{class n{constructor(){this.linkCards=[{body:"Add tissue blocks using the CCF Registration User Interface (RUI).",buttonTitle:"Register Tissue",buttonUrl:"https://hubmapconsortium.github.io/ccf-ui/rui/"},{body:"Explore tissue sections in tissue blocks with the CCF Exploration User Interface (EUI).",buttonTitle:"Explore Tissue",buttonUrl:"https://portal.hubmapconsortium.org/ccf-eui"},{body:"View linkages between anatomical structures, cell types, and common biomarkers (ASCT+B).",buttonTitle:"ASCT+B Reporter",buttonUrl:"https://hubmapconsortium.github.io/ccf-asct-reporter/"}],this.deepDives=[{body:"",buttonTitle:"CCF Portal",buttonUrl:"https://hubmapconsortium.github.io/ccf/"},{body:"",buttonTitle:"Online Course",buttonUrl:"https://expand.iu.edu/browse/sice/cns/courses/hubmap-visible-human-mooc"},{body:"",buttonTitle:"Paper",buttonUrl:"https://www.biorxiv.org/content/10.1101/2021.05.31.446440v2"}]}goToURL(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-link-cards"]],decls:7,vars:2,consts:[["gaCategory","link-cards",1,"link-cards-container"],["class","link-card",4,"ngFor","ngForOf"],["gaCategory","deep-dive",1,"deep-dive-section"],[1,"title"],[1,"button-container"],["class","btn-outline btn","gaEvent","visit-link",3,"gaLabel","click",4,"ngFor","ngForOf"],[1,"link-card"],[1,"link-card-content"],[1,"body"],["gaEvent","visit-link",1,"link-button","btn",3,"gaLabel","click"],["gaEvent","visit-link",1,"btn-outline","btn",3,"gaLabel","click"]],template:function(t,i){1&t&&(Pt(0,"div",0),Ai(1,vIe,6,3,"div",1),Ft(),Pt(2,"div",2),Pt(3,"div",3),Si(4,"Common Coordinate Framework (CCF) Deep Dive"),Ft(),Pt(5,"div",4),Ai(6,bIe,2,2,"div",5),Ft(),Ft()),2&t&&(Yt(1),on("ngForOf",i.linkCards),Yt(5),on("ngForOf",i.deepDives))},directives:[GB,Ud,$B],styles:[".link-cards-container[_ngcontent-%COMP%]{max-width:30rem}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%]{border-top:1px solid #e0e0e0;padding-top:1px;padding-bottom:1px}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%]:last-of-type{border-bottom:1px solid #e0e0e0}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%]{align-items:center;padding:1rem 0 1rem 1rem;display:flex;flex-direction:row;justify-content:space-between;border-left:6px solid #444A65}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%] .link-button[_ngcontent-%COMP%]{margin-left:2rem;background-color:#444a65;color:#fff}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%] .link-button[_ngcontent-%COMP%]:hover{background-color:#2f3346}.deep-dive-section[_ngcontent-%COMP%]{margin-top:2rem}.deep-dive-section[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-bottom:1rem;font-size:1rem}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%]{display:flex;flex-direction:row}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]{color:#444a65;border:1px solid #444A65;background-color:#fff}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]:not(:last-of-type){margin-right:1rem}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]:hover{background-color:#e0e0e0}.btn[_ngcontent-%COMP%]{min-width:9rem!important;max-height:2.28125rem;text-align:center;white-space:nowrap;cursor:pointer;font-size:.875rem;font-weight:500;border-radius:2px;line-height:2.75;transition:background-color .25s cubic-bezier(.4,0,.2,1) 0ms,box-shadow .25s cubic-bezier(.4,0,.2,1) 0ms,border .25s cubic-bezier(.4,0,.2,1) 0ms;font-family:Inter Variable,Helvetica,Arial,sans-serif}"],changeDetection:0}),n})();const EIe=["left"],SIe=["right"],CIe=function(){return[]},xIe=[{color:[0,0,0,0],opacity:.001}];let AIe=(()=>{class n{constructor(t,i,r){this.ga=i,this.configState=r,this.sex$=this.configState.getOption("sex"),this.side$=this.configState.getOption("side"),this.filter$=this.configState.getOption("highlightProviders").pipe(me(s=>({tmc:s}))),this.latestConfig={},this.organInfo$=r.config$.pipe(jr(s=>this.latestConfig=s),sr(s=>{var o,a,l;return t.getOrganInfo(null!==(o=s.organIri)&&void 0!==o?o:"",null===(l=null===(a=s.side)||void 0===a?void 0:a.toLowerCase)||void 0===l?void 0:l.call(a),s.sex)}),jr(s=>this.logOrganLookup(s)),ml(1)),this.organ$=this.organInfo$.pipe(sr(s=>s?t.getOrgan(s,this.latestConfig.sex):nn(void 0)),ml(1)),this.scene$=this.organ$.pipe(nb(this.organInfo$),sr(([s,o])=>s&&o?t.getOrganScene(o,this.latestConfig.sex):nn(xIe))),this.stats$=this.organInfo$.pipe(sr(s=>s?t.getOrganStats(s,this.latestConfig.sex):nn([]))),this.statsLabel$=this.stats$.pipe(nb(this.organInfo$),me(([s,o])=>this.makeStatsLabel(o)),function(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>gE(n,t,e)):t=>gE(n,t)}("Loading...")),this.blocks$=this.organInfo$.pipe(sr(s=>s?t.getBlocks(s,this.latestConfig.sex):nn([])))}ngAfterViewInit(){const{left:t,right:i}=this;t.nativeElement.style.height=`${i.nativeElement.offsetHeight}px`}updateInput(t,i){this.configState.patchConfig({[t]:i})}makeStatsLabel(t){let i=[`Unknown IRI: ${this.latestConfig.organIri}`];return t&&(i=[this.latestConfig.sex,t.organ,t.side]),i.filter(r=>!!r).join(", ")}logOrganLookup(t){this.ga.event(t?"organ_lookup_success":"organ_lookup_failure","organ",`Iri: ${this.latestConfig.organIri} - Sex: ${this.latestConfig.sex} - Side: ${this.latestConfig.side}`)}}return n.\u0275fac=function(t){return new(t||n)(De(ZMe),De(PE),De(cx))},n.\u0275cmp=_n({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&(Mr(EIe,7,wn),Mr(SIe,7,wn)),2&t){let r;di(r=hi())&&(i.left=r.first),di(r=hi())&&(i.right=r.first)}},decls:16,vars:25,consts:[[1,"container"],[1,"left"],["left",""],[3,"blocks","filter","sex","side","organ","scene","sexChange","sideChange"],[1,"right"],["right",""],[3,"statsLabel","stats"]],template:function(t,i){if(1&t&&(Pt(0,"div",0),Pt(1,"div",1,2),Pt(3,"ccf-organ",3),kn("sexChange",function(s){return i.updateInput("sex",s)})("sideChange",function(s){return i.updateInput("side",s)}),cl(4,"async"),cl(5,"async"),cl(6,"async"),cl(7,"async"),cl(8,"async"),cl(9,"async"),Ft(),Ft(),Pt(10,"div",4,5),wi(12,"ccf-stats-list",6),cl(13,"async"),cl(14,"async"),wi(15,"ccf-link-cards"),Ft(),Ft()),2&t){let r;Yt(3),on("blocks",ul(4,8,i.blocks$))("filter",ul(5,10,i.filter$))("sex",ul(6,12,i.sex$))("side",ul(7,14,i.side$))("organ",ul(8,16,i.organ$))("scene",null!==(r=ul(9,18,i.scene$))&&void 0!==r?r:Mw(24,CIe)),Yt(9),on("statsLabel",ul(13,20,i.statsLabel$))("stats",ul(14,22,i.stats$))}},directives:[mIe,yIe,wIe],pipes:[iE],styles:[".container[_ngcontent-%COMP%]{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:flex;flex-direction:row;padding:1rem;font-family:Inter;font-size:.95rem;line-height:1.5;text-align:left;position:relative;background-color:#fff;color:#000}.container[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{width:auto;flex-grow:1}.container[_ngcontent-%COMP%] .right[_ngcontent-%COMP%]{margin-left:2rem;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:29rem}"],changeDetection:0}),n})();function TIe(n,e){1&n&&wi(0,"ccf-root")}function DIe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){const i=KB_json(n);if(t(i))return i}else if(t(n))return n;throw new Error("Invalid data sources")}function MIe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){if(!(null==n?void 0:n.startsWith("[")))return[n];{const i=KB_json(n);if(t(i))return i}}else if(t(n))return n;throw new Error("Invalid data sources")}let IIe=(()=>{class n extends qne{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},$d.dbOptions),globalThis.dbOptions),parse:{dataSources:DIe,highlightProviders:MIe}}),this.sex="Female",this.side="Left"}}return n.\u0275fac=function(t){return new(t||n)(De(cx),De(ts))},n.\u0275cmp=_n({type:n,selectors:[["ccf-root-wc"]],inputs:{organIri:"organIri",sex:"sex",side:"side",dataSources:"dataSources",highlightProviders:"highlightProviders",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl"},features:[Dn],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&Ai(0,TIe,1,0,"ccf-root",0),2&t&&on("ngIf",i.initialized)},directives:[Mu,AIe],encapsulation:2,changeDetection:0}),n})(),OIe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[os,Ba,L$,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(os,2),Ie(Ba,2))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const mx=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class PIe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=Of(this.action),i=function(n){return mx(n.getHours(),2)+":"+mx(n.getMinutes(),2)+":"+mx(n.getSeconds(),2)+"."+mx(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class FIe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const dW=new zt("NGXS_LOGGER_PLUGIN_OPTIONS");let LIe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new FIe(this._options),this._store=this._store||this._injector.get(ih);const s=new PIe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(jr(o=>{s.completed(o)}),Xl(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(dW),Ie(zn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const hW=new zt("LOGGER_USER_OPTIONS");function kIe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let BIe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:tH,useClass:LIe,multi:!0},{provide:hW,useValue:t},{provide:dW,useFactory:kIe,deps:[hW]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const jIe=[cx];let fW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[OIe.forRoot(),oa.forRoot(jIe,{developmentMode:!$d.production}),BIe.forRoot({disabled:$d.production})]]}),n})(),VIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,dIe]]}),n})(),UIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,mDe,VIe]]}),n})(),zIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,FE]]}),n})(),HIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr]]}),n})(),GIe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ol).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new qJ(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends KJ{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(IIe,{injector:this.injector});customElements.define("ccf-organ-info",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[],imports:[[UD,zIe,HIe,UIe,fW,fW,Gne.forRoot({gaToken:$d.googleAnalyticsToken,appName:"organ-info",projectName:"ccf",developmentMode:!$d.production})]]}),n})();$d.production&&function(){if(gk)throw new Error("Cannot enable prod mode after platform setup.");pk=!1}(),mJ().bootstrapModule(GIe).catch(n=>console.error(n))},52:jt=>{function it(gt,J,xt,ut,Y,Ae,he){try{var W=gt[Ae](he),V=W.value}catch(L){return void xt(L)}W.done?J(V):Promise.resolve(V).then(ut,Y)}jt.exports=function(gt){return function(){var J=this,xt=arguments;return new Promise(function(ut,Y){var Ae=gt.apply(J,xt);function he(V){it(Ae,ut,Y,he,W,"next",V)}function W(V){it(Ae,ut,Y,he,W,"throw",V)}he(void 0)})}},jt.exports.default=jt.exports,jt.exports.__esModule=!0},948:jt=>{jt.exports=function(tt){return tt&&tt.__esModule?tt:{default:tt}},jt.exports.default=jt.exports,jt.exports.__esModule=!0},321:jt=>{function it(tt){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(jt.exports=it=function(J){return typeof J},jt.exports.default=jt.exports,jt.exports.__esModule=!0):(jt.exports=it=function(J){return J&&"function"==typeof Symbol&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},jt.exports.default=jt.exports,jt.exports.__esModule=!0),it(tt)}jt.exports=it,jt.exports.default=jt.exports,jt.exports.__esModule=!0},82:jt=>{function it(tt){return Promise.resolve().then(()=>{var gt=new Error("Cannot find module '"+tt+"'");throw gt.code="MODULE_NOT_FOUND",gt})}it.keys=()=>[],it.resolve=it,it.id=82,jt.exports=it},521:()=>{},125:()=>{},307:()=>{}},jt=>{jt(jt.s=289)}]); \ No newline at end of file +var $Ie=Object.defineProperty,WIe=Object.defineProperties,qIe=Object.getOwnPropertyDescriptors,_x=Object.getOwnPropertySymbols,gW=Object.prototype.hasOwnProperty,mW=Object.prototype.propertyIsEnumerable,gr=Math.pow,_W=(jt,it,tt)=>it in jt?$Ie(jt,it,{enumerable:!0,configurable:!0,writable:!0,value:tt}):jt[it]=tt,ht=(jt,it)=>{for(var tt in it||(it={}))gW.call(it,tt)&&_W(jt,tt,it[tt]);if(_x)for(var tt of _x(it))mW.call(it,tt)&&_W(jt,tt,it[tt]);return jt},Vn=(jt,it)=>WIe(jt,qIe(it)),yW=(jt,it)=>{var tt={};for(var gt in jt)gW.call(jt,gt)&&it.indexOf(gt)<0&&(tt[gt]=jt[gt]);if(null!=jt&&_x)for(var gt of _x(jt))it.indexOf(gt)<0&&mW.call(jt,gt)&&(tt[gt]=jt[gt]);return tt};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(jt,it,tt)=>{var gt=tt(52).default;jt.exports=function Y(Ae,he,W){function V($,b){if(!he[$]){if(!Ae[$]){if(L)return L($,!0);var R=new Error("Cannot find module '"+$+"'");throw R.code="MODULE_NOT_FOUND",R}var A=he[$]={exports:{}};Ae[$][0].call(A.exports,function(v){return V(Ae[$][1][v]||v)},A,A.exports,Y,Ae,he,W)}return he[$].exports}for(var L=void 0,re=0;re0&&z[z.length-1])&&(6===Pe[0]||2===Pe[0])){Ue=0;continue}if(3===Pe[0]&&(!z||Pe[1]>z[0]&&Pe[1]0?K-4:K;for(U=0;U>16&255,F[Q++]=I>>8&255,F[Q++]=255&I;return 2===M&&(I=V[j.charCodeAt(U)]<<2|V[j.charCodeAt(U+1)]>>4,F[Q++]=255&I),1===M&&(I=V[j.charCodeAt(U)]<<10|V[j.charCodeAt(U+1)]<<4|V[j.charCodeAt(U+2)]>>2,F[Q++]=I>>8&255,F[Q++]=255&I),F},he.fromByteArray=function(j){for(var I,H=j.length,K=H%3,M=[],F=16383,Q=0,E=H-K;QE?E:Q+F));return 1===K?M.push(W[(I=j[H-1])>>2]+W[I<<4&63]+"=="):2===K&&M.push(W[(I=(j[H-2]<<8)+j[H-1])>>10]+W[I>>4&63]+W[I<<2&63]+"="),M.join("")};for(var W=[],V=[],L="undefined"!=typeof Uint8Array?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,b=re.length;$0)throw new Error("Invalid string. Length must be a multiple of 4");var H=j.indexOf("=");return-1===H&&(H=I),[H,H===I?0:4-H%4]}function y(j){return W[j>>18&63]+W[j>>12&63]+W[j>>6&63]+W[63&j]}function w(j,I,H){for(var M=[],F=I;F>5==6?2:M>>4==14?3:M>>3==30?4:M>>6==2?-1:-2}function A(M){var F=this.lastTotal-this.lastNeed,Q=function(M,F,Q){if(128!=(192&F[0]))return M.lastNeed=0,"\ufffd";if(M.lastNeed>1&&F.length>1){if(128!=(192&F[1]))return M.lastNeed=1,"\ufffd";if(M.lastNeed>2&&F.length>2&&128!=(192&F[2]))return M.lastNeed=2,"\ufffd"}}(this,M);return void 0!==Q?Q:this.lastNeed<=M.length?(M.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(M.copy(this.lastChar,F,0,M.length),void(this.lastNeed-=M.length))}function w(M,F){if((M.length-F)%2==0){var Q=M.toString("utf16le",F);if(Q){var E=Q.charCodeAt(Q.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],Q.slice(0,-1)}return Q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",F,M.length-1)}function D(M){var F=M&&M.length?this.write(M):"";return this.lastNeed?F+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):F}function j(M,F){var Q=(M.length-F)%3;return 0===Q?M.toString("base64",F):(this.lastNeed=3-Q,this.lastTotal=3,1===Q?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",F,M.length-Q))}function I(M){var F=M&&M.length?this.write(M):"";return this.lastNeed?F+this.lastChar.toString("base64",0,3-this.lastNeed):F}function H(M){return M.toString(this.encoding)}function K(M){return M&&M.length?this.write(M):""}he.StringDecoder=$,$.prototype.write=function(M){if(0===M.length)return"";var F,Q;if(this.lastNeed){if(void 0===(F=this.fillLast(M)))return"";Q=this.lastNeed,this.lastNeed=0}else Q=0;return Q=0?(U>0&&(M.lastNeed=U-1),U):--E=0?(U>0&&(M.lastNeed=U-2),U):--E=0?(U>0&&(2===U?U=0:M.lastNeed=U-3),U):0}(this,M,F);if(!this.lastNeed)return M.toString("utf8",F);this.lastTotal=Q;var E=M.length-(Q-this.lastNeed);return M.copy(this.lastChar,0,E),M.toString("utf8",F,E)},$.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length}},{"safe-buffer":4}],6:[function(Y,Ae,he){(function(W){(function(){"use strict";var V=Y("base64-js"),L=Y("ieee754");he.Buffer=S,he.SlowBuffer=function(B){return+B!=B&&(B=0),S.alloc(+B)},he.INSPECT_MAX_BYTES=50;var re=2147483647;function b(B){if(B>re)throw new RangeError('The value "'+B+'" is invalid for option "size"');var O=new Uint8Array(B);return O.__proto__=S.prototype,O}function S(B,O,k){if("number"==typeof B){if("string"==typeof O)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return R(B,O,k)}function R(B,O,k){if("string"==typeof B)return function(B,O){if(("string"!=typeof O||""===O)&&(O="utf8"),!S.isEncoding(O))throw new TypeError("Unknown encoding: "+O);var k=0|M(B,O),Re=b(k),Xe=Re.write(B,O);return Xe!==k&&(Re=Re.slice(0,Xe)),Re}(B,O);if(ArrayBuffer.isView(B))return D(B);if(null==B)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(pt(B,ArrayBuffer)||B&&pt(B.buffer,ArrayBuffer))return function(B,O,k){if(O<0||B.byteLength=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return 0|B}function M(B,O){if(S.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||pt(B,ArrayBuffer))return B.byteLength;if("string"!=typeof B)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var k=B.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===k)return 0;for(var Xe=!1;;)switch(O){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return X(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Pe(B).length;default:if(Xe)return Re?-1:X(B).length;O=(""+O).toLowerCase(),Xe=!0}}function F(B,O,k){var Re=!1;if((void 0===O||O<0)&&(O=0),O>this.length||((void 0===k||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(O>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return Je(this,O,k);case"utf8":case"utf-8":return ye(this,O,k);case"ascii":return nt(this,O,k);case"latin1":case"binary":return Ze(this,O,k);case"base64":return te(this,O,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,O,k);default:if(Re)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Re=!0}}function Q(B,O,k){var Re=B[O];B[O]=B[k],B[k]=Re}function E(B,O,k,Re,Xe){if(0===B.length)return-1;if("string"==typeof k?(Re=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),pe(k=+k)&&(k=Xe?0:B.length-1),k<0&&(k=B.length+k),k>=B.length){if(Xe)return-1;k=B.length-1}else if(k<0){if(!Xe)return-1;k=0}if("string"==typeof O&&(O=S.from(O,Re)),S.isBuffer(O))return 0===O.length?-1:U(B,O,k,Re,Xe);if("number"==typeof O)return O&=255,"function"==typeof Uint8Array.prototype.indexOf?Xe?Uint8Array.prototype.indexOf.call(B,O,k):Uint8Array.prototype.lastIndexOf.call(B,O,k):U(B,[O],k,Re,Xe);throw new TypeError("val must be string, number or Buffer")}function U(B,O,k,Re,Xe){var Hn,yt=1,It=B.length,An=O.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(B.length<2||O.length<2)return-1;yt=2,It/=2,An/=2,k/=2}function Rn(Is,as){return 1===yt?Is[as]:Is.readUInt16BE(as*yt)}if(Xe){var yi=-1;for(Hn=k;HnIt&&(k=It-An),Hn=k;Hn>=0;Hn--){for(var ci=!0,Ur=0;UrXe&&(Re=Xe):Re=Xe;var yt=O.length;Re>yt/2&&(Re=yt/2);for(var It=0;It>8,yt.push(k%256),yt.push(Re);return yt}(O,B.length-k),B,k,Re)}function te(B,O,k){return V.fromByteArray(0===O&&k===B.length?B:B.slice(O,k))}function ye(B,O,k){k=Math.min(B.length,k);for(var Re=[],Xe=O;Xe239?4:yt>223?3:yt>191?2:1;if(Xe+An<=k)switch(An){case 1:yt<128&&(It=yt);break;case 2:128==(192&(Rn=B[Xe+1]))&&(ci=(31&yt)<<6|63&Rn)>127&&(It=ci);break;case 3:Hn=B[Xe+2],128==(192&(Rn=B[Xe+1]))&&128==(192&Hn)&&(ci=(15&yt)<<12|(63&Rn)<<6|63&Hn)>2047&&(ci<55296||ci>57343)&&(It=ci);break;case 4:Hn=B[Xe+2],yi=B[Xe+3],128==(192&(Rn=B[Xe+1]))&&128==(192&Hn)&&128==(192&yi)&&(ci=(15&yt)<<18|(63&Rn)<<12|(63&Hn)<<6|63&yi)>65535&&ci<1114112&&(It=ci)}null===It?(It=65533,An=1):It>65535&&(Re.push((It-=65536)>>>10&1023|55296),It=56320|1023&It),Re.push(It),Xe+=An}return function(B){var O=B.length;if(O<=4096)return String.fromCharCode.apply(String,B);for(var k="",Re=0;Rek&&(O+=" ... "),""},S.prototype.compare=function(O,k,Re,Xe,yt){if(pt(O,Uint8Array)&&(O=S.from(O,O.offset,O.byteLength)),!S.isBuffer(O))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof O);if(void 0===k&&(k=0),void 0===Re&&(Re=O?O.length:0),void 0===Xe&&(Xe=0),void 0===yt&&(yt=this.length),k<0||Re>O.length||Xe<0||yt>this.length)throw new RangeError("out of range index");if(Xe>=yt&&k>=Re)return 0;if(Xe>=yt)return-1;if(k>=Re)return 1;if(this===O)return 0;for(var It=(yt>>>=0)-(Xe>>>=0),An=(Re>>>=0)-(k>>>=0),Rn=Math.min(It,An),Hn=this.slice(Xe,yt),yi=O.slice(k,Re),ci=0;ci>>=0,isFinite(Re)?(Re>>>=0,void 0===Xe&&(Xe="utf8")):(Xe=Re,Re=void 0)}var yt=this.length-k;if((void 0===Re||Re>yt)&&(Re=yt),O.length>0&&(Re<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");Xe||(Xe="utf8");for(var It=!1;;)switch(Xe){case"hex":return ie(this,O,k,Re);case"utf8":case"utf-8":return ue(this,O,k,Re);case"ascii":return ee(this,O,k,Re);case"latin1":case"binary":return se(this,O,k,Re);case"base64":return Te(this,O,k,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,O,k,Re);default:if(It)throw new TypeError("Unknown encoding: "+Xe);Xe=(""+Xe).toLowerCase(),It=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(B,O,k){var Re="";k=Math.min(B.length,k);for(var Xe=O;XeRe)&&(k=Re);for(var Xe="",yt=O;ytk)throw new RangeError("Trying to access beyond buffer length")}function Le(B,O,k,Re,Xe,yt){if(!S.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>Xe||OB.length)throw new RangeError("Index out of range")}function Ee(B,O,k,Re,Xe,yt){if(k+Re>B.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Oe(B,O,k,Re,Xe){return O=+O,k>>>=0,Xe||Ee(B,0,k,4),L.write(B,O,k,Re,23,4),k+4}function Ue(B,O,k,Re,Xe){return O=+O,k>>>=0,Xe||Ee(B,0,k,8),L.write(B,O,k,Re,52,8),k+8}S.prototype.slice=function(O,k){var Re=this.length;(O=~~O)<0?(O+=Re)<0&&(O=0):O>Re&&(O=Re),(k=void 0===k?Re:~~k)<0?(k+=Re)<0&&(k=0):k>Re&&(k=Re),k>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O],yt=1,It=0;++It>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O+--k],yt=1;k>0&&(yt*=256);)Xe+=this[O+--k]*yt;return Xe},S.prototype.readUInt8=function(O,k){return O>>>=0,k||je(O,1,this.length),this[O]},S.prototype.readUInt16LE=function(O,k){return O>>>=0,k||je(O,2,this.length),this[O]|this[O+1]<<8},S.prototype.readUInt16BE=function(O,k){return O>>>=0,k||je(O,2,this.length),this[O]<<8|this[O+1]},S.prototype.readUInt32LE=function(O,k){return O>>>=0,k||je(O,4,this.length),(this[O]|this[O+1]<<8|this[O+2]<<16)+16777216*this[O+3]},S.prototype.readUInt32BE=function(O,k){return O>>>=0,k||je(O,4,this.length),16777216*this[O]+(this[O+1]<<16|this[O+2]<<8|this[O+3])},S.prototype.readIntLE=function(O,k,Re){O>>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=this[O],yt=1,It=0;++It=(yt*=128)&&(Xe-=Math.pow(2,8*k)),Xe},S.prototype.readIntBE=function(O,k,Re){O>>>=0,k>>>=0,Re||je(O,k,this.length);for(var Xe=k,yt=1,It=this[O+--Xe];Xe>0&&(yt*=256);)It+=this[O+--Xe]*yt;return It>=(yt*=128)&&(It-=Math.pow(2,8*k)),It},S.prototype.readInt8=function(O,k){return O>>>=0,k||je(O,1,this.length),128&this[O]?-1*(255-this[O]+1):this[O]},S.prototype.readInt16LE=function(O,k){O>>>=0,k||je(O,2,this.length);var Re=this[O]|this[O+1]<<8;return 32768&Re?4294901760|Re:Re},S.prototype.readInt16BE=function(O,k){O>>>=0,k||je(O,2,this.length);var Re=this[O+1]|this[O]<<8;return 32768&Re?4294901760|Re:Re},S.prototype.readInt32LE=function(O,k){return O>>>=0,k||je(O,4,this.length),this[O]|this[O+1]<<8|this[O+2]<<16|this[O+3]<<24},S.prototype.readInt32BE=function(O,k){return O>>>=0,k||je(O,4,this.length),this[O]<<24|this[O+1]<<16|this[O+2]<<8|this[O+3]},S.prototype.readFloatLE=function(O,k){return O>>>=0,k||je(O,4,this.length),L.read(this,O,!0,23,4)},S.prototype.readFloatBE=function(O,k){return O>>>=0,k||je(O,4,this.length),L.read(this,O,!1,23,4)},S.prototype.readDoubleLE=function(O,k){return O>>>=0,k||je(O,8,this.length),L.read(this,O,!0,52,8)},S.prototype.readDoubleBE=function(O,k){return O>>>=0,k||je(O,8,this.length),L.read(this,O,!1,52,8)},S.prototype.writeUIntLE=function(O,k,Re,Xe){O=+O,k>>>=0,Re>>>=0,Xe||Le(this,O,k,Re,Math.pow(2,8*Re)-1,0);var It=1,An=0;for(this[k]=255&O;++An>>=0,Re>>>=0,Xe||Le(this,O,k,Re,Math.pow(2,8*Re)-1,0);var It=Re-1,An=1;for(this[k+It]=255&O;--It>=0&&(An*=256);)this[k+It]=O/An&255;return k+Re},S.prototype.writeUInt8=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,1,255,0),this[k]=255&O,k+1},S.prototype.writeUInt16LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,65535,0),this[k]=255&O,this[k+1]=O>>>8,k+2},S.prototype.writeUInt16BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,65535,0),this[k]=O>>>8,this[k+1]=255&O,k+2},S.prototype.writeUInt32LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,4294967295,0),this[k+3]=O>>>24,this[k+2]=O>>>16,this[k+1]=O>>>8,this[k]=255&O,k+4},S.prototype.writeUInt32BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,4294967295,0),this[k]=O>>>24,this[k+1]=O>>>16,this[k+2]=O>>>8,this[k+3]=255&O,k+4},S.prototype.writeIntLE=function(O,k,Re,Xe){if(O=+O,k>>>=0,!Xe){var yt=Math.pow(2,8*Re-1);Le(this,O,k,Re,yt-1,-yt)}var It=0,An=1,Rn=0;for(this[k]=255&O;++It>0)-Rn&255;return k+Re},S.prototype.writeIntBE=function(O,k,Re,Xe){if(O=+O,k>>>=0,!Xe){var yt=Math.pow(2,8*Re-1);Le(this,O,k,Re,yt-1,-yt)}var It=Re-1,An=1,Rn=0;for(this[k+It]=255&O;--It>=0&&(An*=256);)O<0&&0===Rn&&0!==this[k+It+1]&&(Rn=1),this[k+It]=(O/An>>0)-Rn&255;return k+Re},S.prototype.writeInt8=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,1,127,-128),O<0&&(O=255+O+1),this[k]=255&O,k+1},S.prototype.writeInt16LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,32767,-32768),this[k]=255&O,this[k+1]=O>>>8,k+2},S.prototype.writeInt16BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,2,32767,-32768),this[k]=O>>>8,this[k+1]=255&O,k+2},S.prototype.writeInt32LE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,2147483647,-2147483648),this[k]=255&O,this[k+1]=O>>>8,this[k+2]=O>>>16,this[k+3]=O>>>24,k+4},S.prototype.writeInt32BE=function(O,k,Re){return O=+O,k>>>=0,Re||Le(this,O,k,4,2147483647,-2147483648),O<0&&(O=4294967295+O+1),this[k]=O>>>24,this[k+1]=O>>>16,this[k+2]=O>>>8,this[k+3]=255&O,k+4},S.prototype.writeFloatLE=function(O,k,Re){return Oe(this,O,k,!0,Re)},S.prototype.writeFloatBE=function(O,k,Re){return Oe(this,O,k,!1,Re)},S.prototype.writeDoubleLE=function(O,k,Re){return Ue(this,O,k,!0,Re)},S.prototype.writeDoubleBE=function(O,k,Re){return Ue(this,O,k,!1,Re)},S.prototype.copy=function(O,k,Re,Xe){if(!S.isBuffer(O))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Xe&&0!==Xe&&(Xe=this.length),k>=O.length&&(k=O.length),k||(k=0),Xe>0&&Xe=this.length)throw new RangeError("Index out of range");if(Xe<0)throw new RangeError("sourceEnd out of bounds");Xe>this.length&&(Xe=this.length),O.length-k=0;--It)O[It+k]=this[It+Re];else Uint8Array.prototype.set.call(O,this.subarray(Re,Xe),k);return yt},S.prototype.fill=function(O,k,Re,Xe){if("string"==typeof O){if("string"==typeof k?(Xe=k,k=0,Re=this.length):"string"==typeof Re&&(Xe=Re,Re=this.length),void 0!==Xe&&"string"!=typeof Xe)throw new TypeError("encoding must be a string");if("string"==typeof Xe&&!S.isEncoding(Xe))throw new TypeError("Unknown encoding: "+Xe);if(1===O.length){var yt=O.charCodeAt(0);("utf8"===Xe&&yt<128||"latin1"===Xe)&&(O=yt)}}else"number"==typeof O&&(O&=255);if(k<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,O||(O=0),"number"==typeof O)for(It=k;It55295&&k<57344){if(!Xe){if(k>56319){(O-=3)>-1&&yt.push(239,191,189);continue}if(It+1===Re){(O-=3)>-1&&yt.push(239,191,189);continue}Xe=k;continue}if(k<56320){(O-=3)>-1&&yt.push(239,191,189),Xe=k;continue}k=65536+(Xe-55296<<10|k-56320)}else Xe&&(O-=3)>-1&&yt.push(239,191,189);if(Xe=null,k<128){if((O-=1)<0)break;yt.push(k)}else if(k<2048){if((O-=2)<0)break;yt.push(k>>6|192,63&k|128)}else if(k<65536){if((O-=3)<0)break;yt.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((O-=4)<0)break;yt.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return yt}function Pe(B){return V.toByteArray(function(B){if((B=(B=B.split("=")[0]).trim().replace(qe,"")).length<2)return"";for(;B.length%4!=0;)B+="=";return B}(B))}function Et(B,O,k,Re){for(var Xe=0;Xe=O.length||Xe>=B.length);++Xe)O[Xe+k]=B[Xe];return Xe}function pt(B,O){return B instanceof O||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===O.name}function pe(B){return B!=B}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Ae,he){"use strict";Ae.exports=function W(V){return null===V||"object"!=typeof V||null!=V.toJSON?JSON.stringify(V):Array.isArray(V)?"["+V.reduce((L,re,$)=>L+(0===$?"":",")+W(void 0===re||"symbol"==typeof re?null:re),"")+"]":"{"+Object.keys(V).sort().reduce((L,re,$)=>void 0===V[re]||"symbol"==typeof V[re]?L:L+(0===L.length?"":",")+W(re)+":"+W(V[re]),"")+"}"}},{}],8:[function(Y,Ae,he){"use strict";var L,W="object"==typeof Reflect?Reflect:null,V=W&&"function"==typeof W.apply?W.apply:function(U,ie,ue){return Function.prototype.apply.call(U,ie,ue)};L=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:function(U){return Object.getOwnPropertyNames(U)};var $=Number.isNaN||function(U){return U!=U};function b(){b.init.call(this)}Ae.exports=b,Ae.exports.once=function(E,U){return new Promise(function(ie,ue){function ee(Te){E.removeListener(U,se),ue(Te)}function se(){"function"==typeof E.removeListener&&E.removeListener("error",ee),ie([].slice.call(arguments))}Q(E,U,se,{once:!0}),"error"!==U&&function(E,U,ie){"function"==typeof E.on&&Q(E,"error",U,ie)}(E,ee,{once:!0})})},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var S=10;function R(E){if("function"!=typeof E)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function A(E){return void 0===E._maxListeners?b.defaultMaxListeners:E._maxListeners}function v(E,U,ie,ue){var ee,se,Te;if(R(ie),void 0===(se=E._events)?(se=E._events=Object.create(null),E._eventsCount=0):(void 0!==se.newListener&&(E.emit("newListener",U,ie.listener?ie.listener:ie),se=E._events),Te=se[U]),void 0===Te)Te=se[U]=ie,++E._eventsCount;else if("function"==typeof Te?Te=se[U]=ue?[ie,Te]:[Te,ie]:ue?Te.unshift(ie):Te.push(ie),(ee=A(E))>0&&Te.length>ee&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=U,me.count=Te.length,function(E){console&&console.warn&&console.warn(E)}(me)}return E}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(E,U,ie){var ue={fired:!1,wrapFn:void 0,target:E,type:U,listener:ie},ee=y.bind(ue);return ee.listener=ie,ue.wrapFn=ee,ee}function D(E,U,ie){var ue=E._events;if(void 0===ue)return[];var ee=ue[U];return void 0===ee?[]:"function"==typeof ee?ie?[ee.listener||ee]:[ee]:ie?function(E){for(var U=new Array(E.length),ie=0;ie0&&(Te=ie[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var te=se[U];if(void 0===te)return!1;if("function"==typeof te)V(te,this,ie);else{var ye=te.length,Me=I(te,ye);for(ue=0;ue=0;Te--)if(ue[Te]===ie||ue[Te].listener===ie){me=ue[Te].listener,se=Te;break}if(se<0)return this;0===se?ue.shift():function(E,U){for(;U+1=0;ee--)this.removeListener(U,ie[ee]);return this},b.prototype.listeners=function(U){return D(this,U,!0)},b.prototype.rawListeners=function(U){return D(this,U,!1)},b.listenerCount=function(E,U){return"function"==typeof E.listenerCount?E.listenerCount(U):j.call(E,U)},b.prototype.listenerCount=j,b.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},{}],9:[function(Y,Ae,he){he.read=function(W,V,L,re,$){var b,S,R=8*$-re-1,A=(1<>1,y=-7,w=L?$-1:0,D=L?-1:1,j=W[V+w];for(w+=D,b=j&(1<<-y)-1,j>>=-y,y+=R;y>0;b=256*b+W[V+w],w+=D,y-=8);for(S=b&(1<<-y)-1,b>>=-y,y+=re;y>0;S=256*S+W[V+w],w+=D,y-=8);if(0===b)b=1-v;else{if(b===A)return S?NaN:1/0*(j?-1:1);S+=Math.pow(2,re),b-=v}return(j?-1:1)*S*Math.pow(2,b-re)},he.write=function(W,V,L,re,$,b){var S,R,A,v=8*b-$-1,y=(1<>1,D=23===$?Math.pow(2,-24)-Math.pow(2,-77):0,j=re?0:b-1,I=re?1:-1,H=V<0||0===V&&1/V<0?1:0;for(V=Math.abs(V),isNaN(V)||V===1/0?(R=isNaN(V)?1:0,S=y):(S=Math.floor(Math.log(V)/Math.LN2),V*(A=Math.pow(2,-S))<1&&(S--,A*=2),(V+=S+w>=1?D/A:D*Math.pow(2,1-w))*A>=2&&(S++,A/=2),S+w>=y?(R=0,S=y):S+w>=1?(R=(V*A-1)*Math.pow(2,$),S+=w):(R=V*Math.pow(2,w-1)*Math.pow(2,$),S=0));$>=8;W[L+j]=255&R,j+=I,R/=256,$-=8);for(S=S<<$|R,v+=$;v>0;W[L+j]=255&S,j+=I,S/=256,v-=8);W[L+j-I]|=128*H}},{}],10:[function(Y,Ae,he){Ae.exports="function"==typeof Object.create?function(V,L){L&&(V.super_=L,V.prototype=Object.create(L.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}))}:function(V,L){if(L){V.super_=L;var re=function(){};re.prototype=L.prototype,V.prototype=new re,V.prototype.constructor=V}}},{}],11:[function(Y,Ae,he){"use strict";const{isArray:W,isObject:V,isString:L}=Y("./types"),{asArray:re}=Y("./util"),{prependBase:$}=Y("./url"),b=Y("./JsonLdError"),S=Y("./ResolvedContext");function A(y){throw new b("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function v({context:y,base:w}){if(!y)return;const D=y["@context"];if(L(D))y["@context"]=$(w,D);else if(W(D))for(let j=0;j10)throw new b("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"loading remote context failed":"context overflow",max:10});if(I.has(D))throw new b("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===w.processingMode?"recursive context inclusion":"context overflow",url:D});let H,K;I.add(D);try{K=yield j(D),H=K.document||null,L(H)&&(H=JSON.parse(H))}catch(M){throw new b("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:D,cause:M})}if(!V(H))throw new b("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:D});return H="@context"in H?{"@context":H["@context"]}:{"@context":{}},K.contextUrl&&(W(H["@context"])||(H["@context"]=[H["@context"]]),H["@context"].push(K.contextUrl)),{context:H,remoteDoc:K}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Ae,he){"use strict";Ae.exports=class extends Error{constructor(V="An unspecified JSON-LD error occurred.",L="jsonld.Error",re={}){super(V),this.name=L,this.message=V,this.details=re}}},{}],13:[function(Y,Ae,he){"use strict";Ae.exports=W=>{class V{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(V,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(V.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:V}),V.compact=function(L,re){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(L,re)},V.expand=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(L)},V.flatten=function(L){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(L)},V}},{}],14:[function(Y,Ae,he){"use strict";Ae.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Ae,he){"use strict";Ae.exports=class{constructor(){this._requests={}}wrapLoader(V){const L=this;return L._loader=V,function(){return L.add.apply(L,arguments)}}add(V){var L=this;return gt(function*(){let re=L._requests[V];if(re)return Promise.resolve(re);re=L._requests[V]=L._loader(V);try{return yield re}finally{delete L._requests[V]}})()}}},{}],16:[function(Y,Ae,he){"use strict";const W=Y("lru-cache");Ae.exports=class{constructor({document:re}){this.document=re,this.cache=new W({max:10})}getProcessed(re){return this.cache.get(re)}setProcessed(re,$){this.cache.set(re,$)}}},{"lru-cache":33}],17:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),{isArray:V,isObject:L,isString:re,isUndefined:$}=Y("./types"),{isList:b,isValue:S,isGraph:R,isSimpleGraph:A,isSubjectReference:v}=Y("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:D,process:j,processingMode:I}=Y("./context"),{removeBase:H,prependBase:K}=Y("./url"),{addValue:M,asArray:F,compareShortestLeast:Q}=Y("./util"),E={};function ie(ue,ee,se){if("@nest"!==y(ue,ee,{vocab:!0},se))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ae.exports=E,E.compact=function(){var ue=gt(function*({activeCtx:ee,activeProperty:se=null,element:Te,options:me={},compactionMap:te=(()=>{})}){if(V(Te)){let Me=[];for(let Ve=0;Ve1&&(Je=Array.from(Je).sort());const Ke=ee;for(const Le of Je){const Ee=E.compactIri({activeCtx:Ke,iri:Le,relativeTo:{vocab:!0}}),Oe=w(nt,Ee,"@context");$(Oe)||(ee=yield j({activeCtx:ee,localCtx:Oe,options:me,propagate:!1}))}const je=Object.keys(Te).sort();for(const Le of je){const Ee=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&D(Le)){const Oe=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Oe,Ee)}else{if(!V(Ee))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ee.length){const Oe=E.compactIri({activeCtx:ee,iri:Le,value:Ee,relativeTo:{vocab:!0},reverse:Me}),Ue=ee.mappings.has(Oe)?ee.mappings.get(Oe)["@nest"]:null;let qe=Ve;Ue&&(ie(ee,Ue,me),L(Ve[Ue])||(Ve[Ue]={}),qe=Ve[Ue]),M(qe,Oe,Ee,{propertyIsArray:!0})}for(const Oe of Ee){const Ue=E.compactIri({activeCtx:ee,iri:Le,value:Oe,relativeTo:{vocab:!0},reverse:Me}),qe=ee.mappings.has(Ue)?ee.mappings.get(Ue)["@nest"]:null;let Be=Ve;qe&&(ie(ee,qe,me),L(Ve[qe])||(Ve[qe]={}),Be=Ve[qe]);const z=w(ee,Ue,"@container")||[],X=R(Oe),be=b(Oe);let ce;be?ce=Oe["@list"]:X&&(ce=Oe["@graph"]);let Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:be||X?ce:Oe,options:me,compactionMap:te});if(be){if(V(Pe)||(Pe=[Pe]),z.includes("@list")){M(Be,Ue,Pe,{valueIsArray:!0,allowDuplicate:!0});continue}Pe={[E.compactIri({activeCtx:ee,iri:"@list",relativeTo:{vocab:!0}})]:Pe},"@index"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Oe["@index"])}if(X)if(z.includes("@graph")&&(z.includes("@id")||z.includes("@index")&&A(Oe))){let Et;Be.hasOwnProperty(Ue)?Et=Be[Ue]:Be[Ue]=Et={};const pt=(z.includes("@id")?Oe["@id"]:Oe["@index"])||E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}});M(Et,pt,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})}else z.includes("@graph")&&A(Oe)?(V(Pe)&&Pe.length>1&&(Pe={"@included":Pe}),M(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")})):(V(Pe)&&1===Pe.length&&me.compactArrays&&(Pe=Pe[0]),Pe={[E.compactIri({activeCtx:ee,iri:"@graph",relativeTo:{vocab:!0}})]:Pe},"@id"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Oe["@id"]),"@index"in Oe&&(Pe[E.compactIri({activeCtx:ee,iri:"@index",relativeTo:{vocab:!0}})]=Oe["@index"]),M(Be,Ue,Pe,{propertyIsArray:!me.compactArrays||z.includes("@set")}));else if(z.includes("@language")||z.includes("@index")||z.includes("@id")||z.includes("@type")){let Et,pt;if(Be.hasOwnProperty(Ue)?Et=Be[Ue]:Be[Ue]=Et={},z.includes("@language"))S(Pe)&&(Pe=Pe["@value"]),pt=Oe["@language"];else if(z.includes("@index")){const pe=w(ee,Ue,"@index")||"@index",B=E.compactIri({activeCtx:ee,iri:pe,relativeTo:{vocab:!0}});if("@index"===pe)pt=Oe["@index"],delete Pe[B];else{let O;if([pt,...O]=F(Pe[pe]||[]),re(pt))switch(O.length){case 0:delete Pe[pe];break;case 1:Pe[pe]=O[0];break;default:Pe[pe]=O}else pt=null}}else if(z.includes("@id")){const pe=E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}});pt=Pe[pe],delete Pe[pe]}else if(z.includes("@type")){const pe=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=F(Pe[pe]||[]),B.length){case 0:delete Pe[pe];break;case 1:Pe[pe]=B[0];break;default:Pe[pe]=B}1===Object.keys(Pe).length&&"@id"in Oe&&(Pe=yield E.compact({activeCtx:ee,activeProperty:Ue,element:{"@id":Oe["@id"]},options:me,compactionMap:te}))}pt||(pt=E.compactIri({activeCtx:ee,iri:"@none",relativeTo:{vocab:!0}})),M(Et,pt,Pe,{propertyIsArray:z.includes("@set")})}else{const Et=!me.compactArrays||z.includes("@set")||z.includes("@list")||V(Pe)&&0===Pe.length||"@list"===Le||"@graph"===Le;M(Be,Ue,Pe,{propertyIsArray:Et})}}}else{if((w(ee,se,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Ue,Ee)}else{const Oe=yield E.compact({activeCtx:ee,activeProperty:se,element:Ee,options:me,compactionMap:te});V(Oe)&&0===Oe.length||M(Ve,Le,Oe)}else{const Oe=yield E.compact({activeCtx:ee,activeProperty:"@reverse",element:Ee,options:me,compactionMap:te});for(const Ue in Oe)if(ee.mappings.has(Ue)&&ee.mappings.get(Ue).reverse){const qe=Oe[Ue],z=(w(ee,Ue,"@container")||[]).includes("@set")||!me.compactArrays;M(Ve,Ue,qe,{propertyIsArray:z}),delete Oe[Ue]}if(Object.keys(Oe).length>0){const Ue=E.compactIri({activeCtx:ee,iri:Le,relativeTo:{vocab:!0}});M(Ve,Ue,Oe)}}else{let Oe=F(Ee).map(X=>E.compactIri({activeCtx:nt,iri:X,relativeTo:{vocab:!0}}));1===Oe.length&&(Oe=Oe[0]);const Ue=E.compactIri({activeCtx:ee,iri:"@type",relativeTo:{vocab:!0}}),z=(w(ee,Ue,"@container")||[]).includes("@set")&&I(ee,1.1)||V(Oe)&&0===Ee.length;M(Ve,Ue,Oe,{propertyIsArray:z})}else{let Oe=F(Ee).map(qe=>E.compactIri({activeCtx:ee,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Oe.length&&(Oe=Oe[0]),Ve[E.compactIri({activeCtx:ee,iri:"@id",relativeTo:{vocab:!0}})]=Oe}}return Ve}return Te});return function(ee){return ue.apply(this,arguments)}}(),E.compactIri=({activeCtx:ue,iri:ee,value:se=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:te=null})=>{if(null===ee)return ee;ue.isPropertyTermScoped&&ue.previousContext&&(ue=ue.previousContext);const ye=ue.getInverse();if(D(ee)&&ee in ye&&"@none"in ye[ee]&&"@type"in ye[ee]["@none"]&&"@none"in ye[ee]["@none"]["@type"])return ye[ee]["@none"]["@type"]["@none"];if(Te.vocab&&ee in ye){const Je=ue["@language"]||"@none",Ke=[];L(se)&&"@index"in se&&!("@graph"in se)&&Ke.push("@index","@index@set"),L(se)&&"@preserve"in se&&(se=se["@preserve"][0]),R(se)?("@index"in se&&Ke.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se&&Ke.push("@graph@id","@graph@id@set"),Ke.push("@graph","@graph@set","@set"),"@index"in se||Ke.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in se||Ke.push("@graph@id","@graph@id@set")):L(se)&&!S(se)&&Ke.push("@id","@id@set","@type","@set@type");let je="@language",Le="@null";if(me)je="@type",Le="@reverse",Ke.push("@set");else if(b(se)){"@index"in se||Ke.push("@list");const Oe=se["@list"];if(0===Oe.length)je="@any",Le="@none";else{let Ue=0===Oe.length?Je:null,qe=null;for(let Be=0;Bent.includes("_"));Ve&&ye.push(Ve.replace(/^[^_]+_/,"_"))}ye.push("@none");const Me=ue.inverse[ee];for(const Ve of Te){if(!(Ve in Me))continue;const nt=Me[Ve][me];for(const Ze of ye)if(Ze in nt)return nt[Ze]}return null}(ue,ee,se,Ke,je,Le);if(null!==Ee)return Ee}if(Te.vocab&&"@vocab"in ue){const Je=ue["@vocab"];if(0===ee.indexOf(Je)&&ee!==Je){const Ke=ee.substr(Je.length);if(!ue.mappings.has(Ke))return Ke}}let Me=null;const Ve=[];let nt=ue.fastCurieMap;const Ze=ee.length-1;for(let Je=0;Je=0;--Je){const Ke=Ve[Je],je=Ke.terms;for(const Le of je){const Ee=Le+":"+ee.substr(Ke.iri.length);ue.mappings.get(Le)._prefix&&(!ue.mappings.has(Ee)||null===se&&ue.mappings.get(Ee)["@id"]===ee)&&(null===Me||Q(Ee,Me)<0)&&(Me=Ee)}}if(null!==Me)return Me;for(const[Je,Ke]of ue.mappings)if(Ke&&Ke._prefix&&ee.startsWith(Je+":"))throw new W(`Absolute IRI "${ee}" confused with prefix "${Je}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ue});return Te.vocab?ee:"@base"in ue?ue["@base"]?H(K(te,ue["@base"]),ee):ee:H(te,ee)},E.compactValue=({activeCtx:ue,activeProperty:ee,value:se,options:Te})=>{if(S(se)){const Me=w(ue,ee,"@type"),Ve=w(ue,ee,"@language"),nt=w(ue,ee,"@direction"),Ze=w(ue,ee,"@container")||[],Je="@index"in se&&!Ze.includes("@index");if(!Je&&"@none"!==Me&&(se["@type"]===Me||"@language"in se&&se["@language"]===Ve&&"@direction"in se&&se["@direction"]===nt||"@language"in se&&se["@language"]===Ve||"@direction"in se&&se["@direction"]===nt))return se["@value"];const Ke=Object.keys(se).length,je=1===Ke||2===Ke&&"@index"in se&&!Je,Le="@language"in ue,Ee=re(se["@value"]),Oe=ue.mappings.has(ee)&&null===ue.mappings.get(ee)["@language"];if(je&&"@none"!==Me&&(!Le||!Ee||Oe))return se["@value"];const Ue={};return Je&&(Ue[E.compactIri({activeCtx:ue,iri:"@index",relativeTo:{vocab:!0}})]=se["@index"]),"@type"in se?Ue[E.compactIri({activeCtx:ue,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ue,iri:se["@type"],relativeTo:{vocab:!0}}):"@language"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@language",relativeTo:{vocab:!0}})]=se["@language"]),"@direction"in se&&(Ue[E.compactIri({activeCtx:ue,iri:"@direction",relativeTo:{vocab:!0}})]=se["@direction"]),Ue[E.compactIri({activeCtx:ue,iri:"@value",relativeTo:{vocab:!0}})]=se["@value"],Ue}const me=y(ue,ee,{vocab:!0},Te),te=w(ue,ee,"@type"),ye=E.compactIri({activeCtx:ue,iri:se["@id"],relativeTo:{vocab:"@vocab"===te},base:Te.base});return"@id"===te||"@vocab"===te||"@graph"===me?ye:{[E.compactIri({activeCtx:ue,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Ae,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#";Ae.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:W,RDF_LIST:W+"List",RDF_FIRST:W+"first",RDF_REST:W+"rest",RDF_NIL:W+"nil",RDF_TYPE:W+"type",RDF_PLAIN_LITERAL:W+"PlainLiteral",RDF_XML_LITERAL:W+"XMLLiteral",RDF_JSON_LITERAL:W+"JSON",RDF_OBJECT:W+"object",RDF_LANGSTRING:W+"langString",XSD:V,XSD_BOOLEAN:V+"boolean",XSD_DOUBLE:V+"double",XSD_INTEGER:V+"integer",XSD_STRING:V+"string"}},{}],19:[function(Y,Ae,he){"use strict";const W=Y("./util"),V=Y("./JsonLdError"),{isArray:L,isObject:re,isString:$,isUndefined:b}=Y("./types"),{isAbsolute:S,isRelative:R,prependBase:A}=Y("./url"),{asArray:v,compareShortestLeast:y}=Y("./util"),w=new Map,j=/^@[a-zA-Z]+$/,I={};function H(M,F,Q,E,U,ie){if(null===F||!$(F)||I.isKeyword(F))return F;if(F.match(j))return null;if(E&&E.hasOwnProperty(F)&&!0!==U.get(F)&&I.createTermDefinition({activeCtx:M,localCtx:E,term:F,defined:U,options:ie}),(Q=Q||{}).vocab){const ee=M.mappings.get(F);if(null===ee)return null;if(re(ee)&&"@id"in ee)return ee["@id"]}const ue=F.indexOf(":");if(ue>0){const ee=F.substr(0,ue),se=F.substr(ue+1);if("_"===ee||0===se.indexOf("//"))return F;E&&E.hasOwnProperty(ee)&&I.createTermDefinition({activeCtx:M,localCtx:E,term:ee,defined:U,options:ie});const Te=M.mappings.get(ee);if(Te&&Te._prefix)return Te["@id"]+se;if(S(F))return F}if(Q.vocab&&"@vocab"in M)return M["@vocab"]+F;if(Q.base&&"@base"in M){if(M["@base"])return A(A(ie.base,M["@base"]),F)}else if(Q.base)return A(ie.base,F);return F}function K(M,F){if(!M||"object"!=typeof M||!F||"object"!=typeof F)return M===F;const Q=Array.isArray(M);if(Q!==Array.isArray(F))return!1;if(Q){if(M.length!==F.length)return!1;for(let ie=0;ie{if(E.has(Q)){if(E.get(Q))return;throw new V("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:F,term:Q})}let ue;if(E.set(Q,!1),F.hasOwnProperty(Q)&&(ue=F[Q]),"@type"===Q&&re(ue)&&"@set"===(ue["@container"]||"@set")&&I.processingMode(M,1.1)){const Me=["@container","@id","@protected"],Ve=Object.keys(ue);if(0===Ve.length||Ve.some(nt=>!Me.includes(nt)))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q})}else{if(I.isKeyword(Q))throw new V("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:F,term:Q});if(Q.match(j))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:Q});if(""===Q)throw new V("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:F})}const ee=M.mappings.get(Q);M.mappings.has(Q)&&M.mappings.delete(Q);let se=!1;if(($(ue)||null===ue)&&(se=!0,ue={"@id":ue}),!re(ue))throw new V("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:F});const Te={};M.mappings.set(Q,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];I.processingMode(M,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Me in ue)if(!me.includes(Me))throw new V("Invalid JSON-LD syntax; a term definition must not contain "+Me,"jsonld.SyntaxError",{code:"invalid term definition",context:F});const te=Q.indexOf(":");if(Te._termHasColon=te>0,"@reverse"in ue){if("@id"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});if("@nest"in ue)throw new V("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});const Me=ue["@reverse"];if(!$(Me))throw new V("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(!I.isKeyword(Me)&&Me.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Me}),void(ee?M.mappings.set(Q,ee):M.mappings.delete(Q));const Ve=H(M,Me,{vocab:!0,base:!1},F,E,U);if(!S(Ve))throw new V("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:F});Te["@id"]=Ve,Te.reverse=!0}else if("@id"in ue){let Me=ue["@id"];if(Me&&!$(Me))throw new V("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});if(null===Me)Te["@id"]=null;else{if(!I.isKeyword(Me)&&Me.match(j))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Me}),void(ee?M.mappings.set(Q,ee):M.mappings.delete(Q));if(Me!==Q){if(Me=H(M,Me,{vocab:!0,base:!1},F,E,U),!S(Me)&&!I.isKeyword(Me))throw new V("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:F});if(Q.match(/(?::[^:])|\//)&&H(M,Q,{vocab:!0,base:!1},F,new Map(E).set(Q,!0),U)!==Me)throw new V("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F});Te["@id"]=Me,Te._prefix=se&&!Te._termHasColon&&Me.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const Me=Q.substr(0,te);if(F.hasOwnProperty(Me)&&I.createTermDefinition({activeCtx:M,localCtx:F,term:Me,defined:E,options:U}),M.mappings.has(Me)){const Ve=Q.substr(te+1);Te["@id"]=M.mappings.get(Me)["@id"]+Ve}else Te["@id"]=Q}else if("@type"===Q)Te["@id"]=Q;else{if(!("@vocab"in M))throw new V("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:F,term:Q});Te["@id"]=M["@vocab"]+Q}if((!0===ue["@protected"]||!0===E.get("@protected")&&!1!==ue["@protected"])&&(M.protected[Q]=!0,Te.protected=!0),E.set(Q,!0),"@type"in ue){let Me=ue["@type"];if(!$(Me))throw new V("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if("@json"===Me||"@none"===Me){if(I.processingMode(M,1))throw new V(`Invalid JSON-LD syntax; an @context @type value must not be "${Me}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else if("@id"!==Me&&"@vocab"!==Me){if(Me=H(M,Me,{vocab:!0,base:!1},F,E,U),!S(Me))throw new V("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:F});if(0===Me.indexOf("_:"))throw new V("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}Te["@type"]=Me}if("@container"in ue){const Me=$(ue["@container"])?[ue["@container"]]:ue["@container"]||[],Ve=["@list","@set","@index","@language"];let nt=!0;const Ze=Me.includes("@set");if(I.processingMode(M,1.1)){if(Ve.push("@graph","@id","@type"),Me.includes("@list")){if(1!==Me.length)throw new V("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:F})}else if(Me.includes("@graph")){if(Me.some(Je=>"@graph"!==Je&&"@id"!==Je&&"@index"!==Je&&"@set"!==Je))throw new V("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:F})}else nt&=Me.length<=(Ze?2:1);if(Me.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new V("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:F})}else nt&=!L(ue["@container"]),nt&=Me.length<=1;if(nt&=Me.every(Je=>Ve.includes(Je)),nt&=!(Ze&&Me.includes("@list")),!nt)throw new V("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ve.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:F});if(Te.reverse&&!Me.every(Je=>["@index","@set"].includes(Je)))throw new V("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:F});Te["@container"]=Me}if("@index"in ue){if(!("@container"in ue)||!Te["@container"].includes("@index"))throw new V(`Invalid JSON-LD syntax; @index without @index in @container: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});if(!$(ue["@index"])||0===ue["@index"].indexOf("@"))throw new V(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ue["@index"]}" on term "${Q}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:F});Te["@index"]=ue["@index"]}if("@context"in ue&&(Te["@context"]=ue["@context"]),"@language"in ue&&!("@type"in ue)){let Me=ue["@language"];if(null!==Me&&!$(Me))throw new V("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:F});null!==Me&&(Me=Me.toLowerCase()),Te["@language"]=Me}if("@prefix"in ue){if(Q.match(/:|\//))throw new V("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:F});if(I.isKeyword(Te["@id"]))throw new V("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:F});if("boolean"!=typeof ue["@prefix"])throw new V("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:F});Te._prefix=!0===ue["@prefix"]}if("@direction"in ue){const Me=ue["@direction"];if(null!==Me&&"ltr"!==Me&&"rtl"!==Me)throw new V('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:F});Te["@direction"]=Me}if("@nest"in ue){const Me=ue["@nest"];if(!$(Me)||"@nest"!==Me&&0===Me.indexOf("@"))throw new V("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:F});Te["@nest"]=Me}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new V("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:F});if(ee&&ee.protected&&!ie&&(M.protected[Q]=!0,Te.protected=!0,!K(ee,Te))){const Me=U&&U.protectedMode||"error";if("error"===Me)throw new V(`Invalid JSON-LD syntax; tried to redefine "${Q}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:F,term:Q});if("warn"===Me)return void console.warn("WARNING: protected term redefinition",{term:Q});throw new V("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:F,term:Q,protectedMode:Me})}},I.expandIri=(M,F,Q,E)=>H(M,F,Q,void 0,void 0,E),I.getInitialContext=M=>{const F=JSON.stringify({processingMode:M.processingMode}),Q=w.get(F);if(Q)return Q;const E={processingMode:M.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},te=Te.fastCurieMap={},ye={},Me=(Te["@language"]||"@none").toLowerCase(),Ve=Te["@direction"],nt=Te.mappings,Ze=[...nt.keys()].sort(y);for(const Je of Ze){const Ke=nt.get(Je);if(null===Ke)continue;let je=Ke["@container"]||"@none";if(je=[].concat(je).sort().join(""),null===Ke["@id"])continue;const Le=v(Ke["@id"]);for(const Ee of Le){let Oe=me[Ee];const Ue=I.isKeyword(Ee);if(Oe)!Ue&&!Ke._termHasColon&&ye[Ee].push(Je);else if(me[Ee]=Oe={},!Ue&&!Ke._termHasColon){ye[Ee]=[Je];const qe={iri:Ee,terms:ye[Ee]};Ee[0]in te?te[Ee[0]].push(qe):te[Ee[0]]=[qe]}if(Oe[je]||(Oe[je]={"@language":{},"@type":{},"@any":{}}),Oe=Oe[je],ue(Je,Oe["@any"],"@none"),Ke.reverse)ue(Je,Oe["@type"],"@reverse");else if("@none"===Ke["@type"])ue(Je,Oe["@any"],"@none"),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none");else if("@type"in Ke)ue(Je,Oe["@type"],Ke["@type"]);else if("@language"in Ke&&"@direction"in Ke){const qe=Ke["@language"],Be=Ke["@direction"];ue(Je,Oe["@language"],qe&&Be?`${qe}_${Be}`.toLowerCase():qe?qe.toLowerCase():Be?`_${Be}`:"@null")}else"@language"in Ke?ue(Je,Oe["@language"],(Ke["@language"]||"@null").toLowerCase()):"@direction"in Ke?ue(Je,Oe["@language"],Ke["@direction"]?`_${Ke["@direction"]}`:"@none"):Ve?(ue(Je,Oe["@language"],`_${Ve}`),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none")):(ue(Je,Oe["@language"],Me),ue(Je,Oe["@language"],"@none"),ue(Je,Oe["@type"],"@none"))}}for(const Je in te)ie(te,Je,1);return me},clone:function(){const Te={};return Te.mappings=W.clone(this.mappings),Te.clone=this.clone,Te.inverse=null,Te.getInverse=this.getInverse,Te.protected=W.clone(this.protected),this.previousContext&&(Te.previousContext=this.previousContext.clone()),Te.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Te["@base"]=this["@base"]),"@language"in this&&(Te["@language"]=this["@language"]),"@vocab"in this&&(Te["@vocab"]=this["@vocab"]),Te},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===w.size&&w.clear(),w.set(F,E),E;function ie(Te,me,te){const ye=Te[me],Me=Te[me]={};let Ve,nt;for(const Ze of ye)Ve=Ze.iri,nt=te>=Ve.length?"":Ve[te],nt in Me?Me[nt].push(Ze):Me[nt]=[Ze];for(const Ze in Me)""!==Ze&&ie(Me,Ze,te+1)}function ue(Te,me,te){me.hasOwnProperty(te)||(me[te]=Te)}},I.getContextValue=(M,F,Q)=>{if(null===F)return"@context"===Q?void 0:null;if(M.mappings.has(F)){const E=M.mappings.get(F);if(b(Q))return E;if(E.hasOwnProperty(Q))return E[Q]}return"@language"===Q&&Q in M||"@direction"===Q&&Q in M?M[Q]:"@context"!==Q?null:void 0},I.processingMode=(M,F)=>F.toString()>="1.1"?!M.processingMode||M.processingMode>="json-ld-"+F.toString():"json-ld-1.0"===M.processingMode,I.isKeyword=M=>{if(!$(M)||"@"!==M[0])return!1;switch(M){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(Y,Ae,he){"use strict";const{parseLinkHeader:W,buildHeaders:V}=Y("../util"),{LINK_HEADER_CONTEXT:L}=Y("../constants"),re=Y("../JsonLdError"),$=Y("../RequestQueue"),{prependBase:b}=Y("../url"),S=/(^|(\r\n))link:/i;function R(A,v,y){const w=new(A=A||XMLHttpRequest);return new Promise((D,j)=>{w.onload=()=>D(w),w.onerror=I=>j(I),w.open("GET",v,!0);for(const I in y)w.setRequestHeader(I,y[I]);w.send()})}Ae.exports=({secure:A,headers:v={},xhr:y}={headers:{}})=>{return v=V(v),(new $).wrapLoader(D);function D(I){return j.apply(this,arguments)}function j(){return(j=gt(function*(I){if(0!==I.indexOf("http:")&&0!==I.indexOf("https:"))throw new re('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:I});if(A&&0!==I.indexOf("https"))throw new re('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:I});let H;try{H=yield R(y,I,v)}catch(E){throw new re("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:I,cause:E})}if(H.status>=400)throw new re("URL could not be dereferenced: "+H.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:I,httpStatusCode:H.status});let K={contextUrl:null,documentUrl:I,document:H.response},M=null;const F=H.getResponseHeader("Content-Type");let Q;if(S.test(H.getAllResponseHeaders())&&(Q=H.getResponseHeader("Link")),Q&&"application/ld+json"!==F){const E=W(Q),U=E[L];if(Array.isArray(U))throw new re("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:I});U&&(K.contextUrl=U.target),M=E.alternate,M&&"application/ld+json"==M.type&&!(F||"").match(/^application\/(\w*\+)?json$/)&&(K=yield D(b(I,M.target)))}return K})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),{isArray:V,isObject:L,isEmptyObject:re,isString:$,isUndefined:b}=Y("./types"),{isList:S,isValue:R,isGraph:A,isSubject:v}=Y("./graphTypes"),{expandIri:y,getContextValue:w,isKeyword:D,process:j,processingMode:I}=Y("./context"),{isAbsolute:H}=Y("./url"),{addValue:K,asArray:M,getValues:F,validateTypeValue:Q}=Y("./util"),E={};Ae.exports=E;const U=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function ie(te){return ue.apply(this,arguments)}function ue(){return(ue=gt(function*({activeCtx:te,activeProperty:ye,expandedActiveProperty:Me,element:Ve,expandedParent:nt,options:Ze={},insideList:Je,typeKey:Ke,typeScopedContext:je,expansionMap:Le}){const Ee=Object.keys(Ve).sort(),Oe=[];let Ue;const qe=Ve[Ke]&&"@json"===y(te,V(Ve[Ke])?Ve[Ke][0]:Ve[Ke],{vocab:!0},Ze);for(const Be of Ee){let X,z=Ve[Be];if("@context"===Be)continue;let be=y(te,Be,{vocab:!0},Ze);if((null===be||!H(be)&&!D(be))&&(be=Le({unmappedProperty:Be,activeCtx:te,activeProperty:ye,parent:Ve,options:Ze,insideList:Je,value:z,expandedParent:nt}),void 0===be))continue;if(D(be)){if("@reverse"===Me)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(be in nt&&"@included"!==be&&"@type"!==be)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:be})}if("@id"===be){if(!$(z)){if(!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(L(z)){if(!re(z))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!V(z))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(pt=>$(pt)))throw new W('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}K(nt,"@id",M(z).map(pt=>$(pt)?y(te,pt,{base:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@type"===be){L(z)&&(z=Object.fromEntries(Object.entries(z).map(([pt,pe])=>[y(je,pt,{vocab:!0}),M(pe).map(B=>y(je,B,{base:!0,vocab:!0}))]))),Q(z,Ze.isFrame),K(nt,"@type",M(z).map(pt=>$(pt)?y(je,pt,{base:!0,vocab:!0},Ze):pt),{propertyIsArray:Ze.isFrame});continue}if("@included"===be&&I(te,1.1)){const pt=M(yield E.expand({activeCtx:te,activeProperty:ye,element:z,options:Ze,expansionMap:Le}));if(!pt.every(pe=>v(pe)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});K(nt,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===be&&!L(z)&&!V(z))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if("@value"===be){Ue=z,qe&&I(te,1.1)?nt["@value"]=z:K(nt,"@value",z,{propertyIsArray:Ze.isFrame});continue}if("@language"===be){if(null===z)continue;if(!$(z)&&!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=M(z).map(pt=>$(pt)?pt.toLowerCase():pt);for(const pt of z)$(pt)&&!pt.match(U)&&console.warn(`@language must be valid BCP47: ${pt}`);K(nt,"@language",z,{propertyIsArray:Ze.isFrame});continue}if("@direction"===be){if(!$(z)&&!Ze.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=M(z);for(const pt of z)if($(pt)&&"ltr"!==pt&&"rtl"!==pt)throw new W('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});K(nt,"@direction",z,{propertyIsArray:Ze.isFrame});continue}if("@index"===be){if(!$(z))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});K(nt,"@index",z);continue}if("@reverse"===be){if(!L(z))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(X=yield E.expand({activeCtx:te,activeProperty:"@reverse",element:z,options:Ze,expansionMap:Le}),"@reverse"in X)for(const pe in X["@reverse"])K(nt,pe,X["@reverse"][pe],{propertyIsArray:!0});let pt=nt["@reverse"]||null;for(const pe in X){if("@reverse"===pe)continue;null===pt&&(pt=nt["@reverse"]={}),K(pt,pe,[],{propertyIsArray:!0});const B=X[pe];for(let O=0;O"@id"===pt||"@index"===pt)&&(X=M(X).map(pt=>({"@graph":M(pt)}))),ce.mappings.has(Be)&&ce.mappings.get(Be).reverse){const pt=nt["@reverse"]=nt["@reverse"]||{};X=M(X);for(let pe=0;pe"@value"===y(te,be,{vocab:!0},Ze)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:X});yield ie({activeCtx:te,activeProperty:ye,expandedActiveProperty:Me,element:X,expandedParent:nt,options:Ze,insideList:Je,typeScopedContext:je,typeKey:Ke,expansionMap:Le})}}})).apply(this,arguments)}function ee({activeCtx:te,activeProperty:ye,value:Me,options:Ve}){if(null==Me)return null;const nt=y(te,ye,{vocab:!0},Ve);if("@id"===nt)return y(te,Me,{base:!0},Ve);if("@type"===nt)return y(te,Me,{vocab:!0,base:!0},Ve);const Ze=w(te,ye,"@type");if(("@id"===Ze||"@graph"===nt)&&$(Me))return{"@id":y(te,Me,{base:!0},Ve)};if("@vocab"===Ze&&$(Me))return{"@id":y(te,Me,{vocab:!0,base:!0},Ve)};if(D(nt))return Me;const Je={};if(Ze&&!["@id","@vocab","@none"].includes(Ze))Je["@type"]=Ze;else if($(Me)){const Ke=w(te,ye,"@language");null!==Ke&&(Je["@language"]=Ke);const je=w(te,ye,"@direction");null!==je&&(Je["@direction"]=je)}return["boolean","number","string"].includes(typeof Me)||(Me=Me.toString()),Je["@value"]=Me,Je}function se(te,ye,Me,Ve){const nt=[],Ze=Object.keys(ye).sort();for(const Je of Ze){const Ke=y(te,Je,{vocab:!0},Ve);let je=ye[Je];V(je)||(je=[je]);for(const Le of je){if(null===Le)continue;if(!$(Le))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ee={"@value":Le};"@none"!==Ke&&(Ee["@language"]=Je.toLowerCase()),Me&&(Ee["@direction"]=Me),nt.push(Ee)}}return nt}function Te(te){return me.apply(this,arguments)}function me(){return(me=gt(function*({activeCtx:te,options:ye,activeProperty:Me,value:Ve,expansionMap:nt,asGraph:Ze,indexKey:Je,propertyIndex:Ke}){const je=[],Le=Object.keys(Ve).sort(),Ee="@type"===Je;for(let Oe of Le){if(Ee){const Be=w(te,Oe,"@context");b(Be)||(te=yield j({activeCtx:te,localCtx:Be,propagate:!1,options:ye}))}let qe,Ue=Ve[Oe];V(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:te,activeProperty:Me,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:nt}),qe=Ke?"@none"===Oe?"@none":ee({activeCtx:te,activeProperty:Je,value:Oe,options:ye}):y(te,Oe,{vocab:!0},ye),"@id"===Je?Oe=y(te,Oe,{base:!0},ye):Ee&&(Oe=qe);for(let Be of Ue){if(Ze&&!A(Be)&&(Be={"@graph":[Be]}),"@type"===Je)"@none"===qe||(Be["@type"]=Be["@type"]?[Oe].concat(Be["@type"]):[Oe]);else{if(R(Be)&&!["@language","@type","@index"].includes(Je))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${Je}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Be});Ke?"@none"!==qe&&K(Be,Ke,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(Je in Be)&&(Be[Je]=Oe)}je.push(Be)}}return je})).apply(this,arguments)}E.expand=function(){var te=gt(function*({activeCtx:ye,activeProperty:Me=null,element:Ve,options:nt={},insideList:Ze=!1,insideIndex:Je=!1,typeScopedContext:Ke=null,expansionMap:je=(()=>{})}){if(null==Ve)return null;if("@default"===Me&&(nt=Object.assign({},nt,{isFrame:!1})),!V(Ve)&&!L(Ve)){if(!Ze&&(null===Me||"@graph"===y(ye,Me,{vocab:!0},nt))){const X=yield je({unmappedValue:Ve,activeCtx:ye,activeProperty:Me,options:nt,insideList:Ze});return void 0===X?null:X}return ee({activeCtx:ye,activeProperty:Me,value:Ve,options:nt})}if(V(Ve)){let X=[];const be=w(ye,Me,"@container")||[];Ze=Ze||be.includes("@list");for(let ce=0;ce1?ce.slice().sort():ce:[ce];for(const Et of Pe){const pt=w(Ke,Et,"@context");b(pt)||(ye=yield j({activeCtx:ye,localCtx:pt,options:nt,propagate:!1}))}}let Be={};yield ie({activeCtx:ye,activeProperty:Me,expandedActiveProperty:Le,element:Ve,expandedParent:Be,options:nt,insideList:Ze,typeKey:qe,typeScopedContext:Ke,expansionMap:je}),Oe=Object.keys(Be);let z=Oe.length;if("@value"in Be){if("@type"in Be&&("@language"in Be||"@direction"in Be))throw new W('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:Be});let X=z-1;if("@type"in Be&&(X-=1),"@index"in Be&&(X-=1),"@language"in Be&&(X-=1),"@direction"in Be&&(X-=1),0!==X)throw new W('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:Be});const be=null===Be["@value"]?[]:M(Be["@value"]),ce=F(Be,"@type");if(!I(ye,1.1)||!ce.includes("@json")||1!==ce.length)if(0===be.length){const Pe=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==Pe?Pe:null}else{if(!be.every(Pe=>$(Pe)||re(Pe))&&"@language"in Be)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Be});if(!ce.every(Pe=>H(Pe)&&!($(Pe)&&0===Pe.indexOf("_:"))||re(Pe)))throw new W('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:Be})}}else if("@type"in Be&&!V(Be["@type"]))Be["@type"]=[Be["@type"]];else if("@set"in Be||"@list"in Be){if(z>1&&(2!==z||!("@index"in Be)))throw new W('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:Be});"@set"in Be&&(Be=Be["@set"],Oe=Object.keys(Be),z=Oe.length)}else if(1===z&&"@language"in Be){const X=yield je(Be,{unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}if(L(Be)&&!nt.keepFreeFloatingNodes&&!Ze&&(null===Me||"@graph"===Le)&&(0===z||"@value"in Be||"@list"in Be||1===z&&"@id"in Be)){const X=yield je({unmappedValue:Be,activeCtx:ye,activeProperty:Me,element:Ve,options:nt,insideList:Ze});Be=void 0!==X?X:null}return Be});return function(ye){return te.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Ae,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:V}=Y("./nodeMap"),L={};Ae.exports=L,L.flatten=re=>{const $=V(re),b=[],S=Object.keys($).sort();for(let R=0;R=0;--ue){const ee=ie[ue];if(ee.graph===U&&ee.subject["@id"]===E["@id"])return!0}return!1}function w(E,U,ie){const ue="@"+ie;let ee=ue in E?E[ue][0]:U[ie];if("embed"===ie)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return ee}function D(E){if(!L.isArray(E)||1!==E.length||!L.isObject(E[0]))throw new b("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const U of re.asArray(E[0]["@id"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const U of re.asArray(E[0]["@type"]))if(!L.isObject(U)&&!$.isAbsolute(U)||L.isString(U)&&0===U.indexOf("_:"))throw new b("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function I(E,U,ie,ue){let ee=!0,se=!1;for(const Te in ie){let me=!1;const te=re.getValues(U,Te),ye=0===re.getValues(ie,Te).length;if("@id"===Te){if(L.isEmptyObject(ie["@id"][0]||{})?me=!0:ie["@id"].length>=0&&(me=ie["@id"].includes(te[0])),!ue.requireAll)return me}else if("@type"===Te){if(ee=!1,ye){if(te.length>0)return!1;me=!0}else if(1===ie["@type"].length&&L.isEmptyObject(ie["@type"][0]))me=te.length>0;else for(const Me of ie["@type"])me=!(!L.isObject(Me)||!("@default"in Me))||me||te.some(Ve=>Ve===Me);if(!ue.requireAll)return me}else{if(W(Te))continue;{const Me=re.getValues(ie,Te)[0];let Ve=!1;if(Me&&(D([Me]),Ve="@default"in Me),ee=!1,0===te.length&&Ve)continue;if(te.length>0&&ye)return!1;if(void 0===Me){if(te.length>0)return!1;me=!0}else if(V.isList(Me)){const nt=Me["@list"][0];if(V.isList(te[0])){const Ze=te[0]["@list"];V.isValue(nt)?me=Ze.some(Je=>Q(nt,Je)):(V.isSubject(nt)||V.isSubjectReference(nt))&&(me=Ze.some(Je=>F(E,nt,Je,ue)))}}else me=V.isValue(Me)?te.some(nt=>Q(Me,nt)):V.isSubjectReference(Me)?te.some(nt=>F(E,Me,nt,ue)):!!L.isObject(Me)&&te.length>0}}if(!me&&ue.requireAll)return!1;se=se||me}return ee||se}function H(E,U){const ie=E.uniqueEmbeds[E.graph],ue=ie[U],ee=ue.parent,se=ue.property,Te={"@id":U};if(L.isArray(ee)){for(let te=0;te{const ye=Object.keys(ie);for(const Me of ye)Me in ie&&L.isObject(ie[Me].parent)&&ie[Me].parent["@id"]===te&&(delete ie[Me],me(Me))};me(U)}function K(E,U){if(L.isArray(E))return E.map(ie=>K(ie,U));if(L.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(V.isValue(E))return E;if(V.isList(E))return E["@list"]=K(E["@list"],U),E;if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)"@id"===ie&&U.bnodesToClear.includes(E[ie])?delete E["@id"]:E[ie]=K(E[ie],U)}return E}function M(E,U,ie){L.isObject(E)?re.addValue(E,U,ie,{propertyIsArray:!0}):E.push(ie)}function F(E,U,ie,ue){if(!("@id"in ie))return!1;const ee=E.subjects[ie["@id"]];return ee&&I(E,ee,U,ue)}function Q(E,U){const ie=U["@value"],ue=U["@type"],ee=U["@language"],se=E["@value"]?L.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?L.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?L.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===se.length&&0===Te.length&&0===me.length||!(!se.includes(ie)&&!L.isEmptyObject(se[0])||!(!ue&&0===Te.length||Te.includes(ue)||ue&&L.isEmptyObject(Te[0]))||!(!ee&&0===me.length||me.includes(ee)||ee&&L.isEmptyObject(me[0])))}Ae.exports=A,A.frameMergedOrDefault=(E,U,ie)=>{const ue={options:ie,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new re.IdentifierIssuer("_:b");S(E,ue.graphMap,"@default",ee),ie.merged&&(ue.graphMap["@merged"]=R(ue.graphMap),ue.graph="@merged"),ue.subjects=ue.graphMap[ue.graph];const se=[];return A.frame(ue,Object.keys(ue.subjects).sort(),U,se),ie.pruneBlankNodeIdentifiers&&(ie.bnodesToClear=Object.keys(ue.bnodeMap).filter(Te=>1===ue.bnodeMap[Te].length)),ie.link={},K(se,ie)},A.frame=(E,U,ie,ue,ee=null)=>{D(ie);const se=E.options,Te={embed:w(ie=ie[0],se,"embed"),explicit:w(ie,se,"explicit"),requireAll:w(ie,se,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],te=function(E,U,ie,ue){const ee={};for(const se of U){const Te=E.graphMap[E.graph][se];I(E,Te,ie,ue)&&(ee[se]=Te)}return ee}(E,U,ie,Te),ye=Object.keys(te).sort();for(const Me of ye){const Ve=te[Me];if(null===ee?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&Me in me){M(ue,ee,me[Me]);continue}const nt={"@id":Me};if(0===Me.indexOf("_:")&&re.addValue(E.bnodeMap,Me,nt,{propertyIsArray:!0}),me[Me]=nt,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new b("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:ie});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Me)){if(E.embedded&&("@never"===Te.embed||y(Ve,E.graph,E.subjectStack))){M(ue,ee,nt);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Me)){M(ue,ee,nt);continue}if("@last"===Te.embed&&Me in E.uniqueEmbeds[E.graph]&&H(E,Me),E.uniqueEmbeds[E.graph][Me]={parent:ue,property:ee},E.subjectStack.push({subject:Ve,graph:E.graph}),Me in E.graphMap){let Ze=!1,Je=null;"@graph"in ie?(Je=ie["@graph"][0],Ze=!("@merged"===Me||"@default"===Me),L.isObject(Je)||(Je={})):(Ze="@merged"!==E.graph,Je={}),Ze&&A.frame(Vn(ht({},E),{graph:Me,embedded:!1}),Object.keys(E.graphMap[Me]).sort(),[Je],nt,"@graph")}"@included"in ie&&A.frame(Vn(ht({},E),{embedded:!1}),U,ie["@included"],nt,"@included");for(const Ze of Object.keys(Ve).sort())if(W(Ze)){if(nt[Ze]=re.clone(Ve[Ze]),"@type"===Ze)for(const Je of Ve["@type"])0===Je.indexOf("_:")&&re.addValue(E.bnodeMap,Je,nt,{propertyIsArray:!0})}else if(!Te.explicit||Ze in ie)for(const Je of Ve[Ze]){const Ke=Ze in ie?ie[Ze]:v(Te);if(V.isList(Je)){const je=ie[Ze]&&ie[Ze][0]&&ie[Ze][0]["@list"]?ie[Ze][0]["@list"]:v(Te),Le={"@list":[]};M(nt,Ze,Le);const Ee=Je["@list"];for(const Oe of Ee)V.isSubjectReference(Oe)?A.frame(Vn(ht({},E),{embedded:!0}),[Oe["@id"]],je,Le,"@list"):M(Le,"@list",re.clone(Oe))}else V.isSubjectReference(Je)?A.frame(Vn(ht({},E),{embedded:!0}),[Je["@id"]],Ke,nt,Ze):Q(Ke[0],Je)&&M(nt,Ze,re.clone(Je))}for(const Ze of Object.keys(ie).sort()){if("@type"===Ze){if(!L.isObject(ie[Ze][0])||!("@default"in ie[Ze][0]))continue}else if(W(Ze))continue;const Je=ie[Ze][0]||{};if(!w(Je,se,"omitDefault")&&!(Ze in nt)){let je="@null";"@default"in Je&&(je=re.clone(Je["@default"])),L.isArray(je)||(je=[je]),nt[Ze]=[{"@preserve":je}]}}for(const Ze of Object.keys(ie["@reverse"]||{}).sort()){const Je=ie["@reverse"][Ze];for(const Ke of Object.keys(E.subjects))re.getValues(E.subjects[Ke],Ze).some(Le=>Le["@id"]===Me)&&(nt["@reverse"]=nt["@reverse"]||{},re.addValue(nt["@reverse"],Ze,[],{propertyIsArray:!0}),A.frame(Vn(ht({},E),{embedded:!0}),[Ke],Je,nt["@reverse"][Ze],ee))}M(ue,ee,nt),E.subjectStack.pop()}}},A.cleanupNull=(E,U)=>{if(L.isArray(E))return E.map(ue=>A.cleanupNull(ue,U)).filter(ue=>ue);if("@null"===E)return null;if(L.isObject(E)){if("@id"in E){const ie=E["@id"];if(U.link.hasOwnProperty(ie)){const ue=U.link[ie].indexOf(E);if(-1!==ue)return U.link[ie][ue];U.link[ie].push(E)}else U.link[ie]=[E]}for(const ie in E)E[ie]=A.cleanupNull(E[ie],U)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Ae,he){"use strict";const W=Y("./JsonLdError"),V=Y("./graphTypes"),L=Y("./types"),re=Y("./util"),{RDF_LIST:$,RDF_FIRST:b,RDF_REST:S,RDF_NIL:R,RDF_TYPE:A,RDF_JSON_LITERAL:v,XSD_BOOLEAN:y,XSD_DOUBLE:w,XSD_INTEGER:D,XSD_STRING:j}=Y("./constants"),I=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,H={};function K(M,F,Q){if(M.termType.endsWith("Node"))return{"@id":M.value};const E={"@value":M.value};if(M.language)E["@language"]=M.language;else{let U=M.datatype.value;if(U||(U=j),U===v){U="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(ie){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:ie})}}if(F){if(U===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(L.isNumeric(E["@value"]))if(U===D){const ie=parseInt(E["@value"],10);ie.toFixed(0)===E["@value"]&&(E["@value"]=ie)}else U===w&&(E["@value"]=parseFloat(E["@value"]));[y,D,w,j].includes(U)||(E["@type"]=U)}else if("i18n-datatype"===Q&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,ue]=U.split(/[#_]/);ie.length>0&&(E["@language"]=ie,ie.match(I)||console.warn(`@language must be valid BCP47: ${ie}`)),E["@direction"]=ue}else U!==j&&(E["@type"]=U)}return E}Ae.exports=H,H.fromRDF=function(){var M=gt(function*(F,{useRdfType:Q=!1,useNativeTypes:E=!1,rdfDirection:U=null}){const ie={},ue={"@default":ie},ee={};for(const me of F){const te="DefaultGraph"===me.graph.termType?"@default":me.graph.value;te in ue||(ue[te]={}),"@default"!==te&&!(te in ie)&&(ie[te]={"@id":te});const ye=ue[te],Me=me.subject.value,Ve=me.predicate.value,nt=me.object;Me in ye||(ye[Me]={"@id":Me});const Ze=ye[Me],Je=nt.termType.endsWith("Node");if(Je&&!(nt.value in ye)&&(ye[nt.value]={"@id":nt.value}),Ve===A&&!Q&&Je){re.addValue(Ze,"@type",nt.value,{propertyIsArray:!0});continue}const Ke=K(nt,E,U);if(re.addValue(Ze,Ve,Ke,{propertyIsArray:!0}),Je)if(nt.value===R){const je=ye[nt.value];"usages"in je||(je.usages=[]),je.usages.push({node:Ze,property:Ve,value:Ke})}else ee[nt.value]=!(nt.value in ee)&&{node:Ze,property:Ve,value:Ke}}for(const me in ue){const te=ue[me];if(!(R in te))continue;const ye=te[R];if(ye.usages){for(let Me of ye.usages){let Ve=Me.node,nt=Me.property,Ze=Me.value;const Je=[],Ke=[];let je=Object.keys(Ve).length;for(;nt===S&&L.isObject(ee[Ve["@id"]])&&L.isArray(Ve[b])&&1===Ve[b].length&&L.isArray(Ve[S])&&1===Ve[S].length&&(3===je||4===je&&L.isArray(Ve["@type"])&&1===Ve["@type"].length&&Ve["@type"][0]===$)&&(Je.push(Ve[b][0]),Ke.push(Ve["@id"]),Me=ee[Ve["@id"]],Ve=Me.node,nt=Me.property,Ze=Me.value,je=Object.keys(Ve).length,V.isBlankNode(Ve)););delete Ze["@id"],Ze["@list"]=Je.reverse();for(const Le of Ke)delete te[Le]}delete ye.usages}}const se=[],Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me];if(me in ue){const ye=te["@graph"]=[],Me=ue[me],Ve=Object.keys(Me).sort();for(const nt of Ve){const Ze=Me[nt];V.isSubjectReference(Ze)||ye.push(Ze)}}V.isSubjectReference(te)||se.push(te)}return se});return function(F,Q){return M.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Ae,he){"use strict";const W=Y("./types"),V={};Ae.exports=V,V.isSubject=L=>!(!W.isObject(L)||"@value"in L||"@set"in L||"@list"in L)&&(Object.keys(L).length>1||!("@id"in L)),V.isSubjectReference=L=>W.isObject(L)&&1===Object.keys(L).length&&"@id"in L,V.isValue=L=>W.isObject(L)&&"@value"in L,V.isList=L=>W.isObject(L)&&"@list"in L,V.isGraph=L=>W.isObject(L)&&"@graph"in L&&1===Object.keys(L).filter(re=>"@id"!==re&&"@index"!==re).length,V.isSimpleGraph=L=>V.isGraph(L)&&!("@id"in L),V.isBlankNode=L=>!!W.isObject(L)&&("@id"in L?0===L["@id"].indexOf("_:"):0===Object.keys(L).length||!("@value"in L||"@set"in L||"@list"in L))},{"./types":30}],26:[function(Y,Ae,he){const W=Y("rdf-canonize"),V=Y("./platform"),L=Y("./util"),re=Y("./ContextResolver"),$=L.IdentifierIssuer,b=Y("./JsonLdError"),S=Y("lru-cache"),R=Y("./NQuads"),{expand:A}=Y("./expand"),{flatten:v}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:w}=Y("./toRdf"),{frameMergedOrDefault:D,cleanupNull:j}=Y("./frame"),{isArray:I,isObject:H,isString:K}=Y("./types"),{isSubjectReference:M}=Y("./graphTypes"),{expandIri:F,getInitialContext:Q,process:E,processingMode:U}=Y("./context"),{compact:ie,compactIri:ue}=Y("./compact"),{createNodeMap:ee,createMergedNodeMap:se,mergeNodeMaps:Te}=Y("./nodeMap"),me=function(ye){const Me={},nt=new S({max:100});function Ze(Je,Le){var Ee=Le,{documentLoader:Ke=ye.documentLoader}=Ee,je=yW(Ee,["documentLoader"]);return Object.assign({},{documentLoader:Ke},je,Je)}return ye.compact=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===je)throw new b("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ke)return null;let Ee;(Le=Ze(Le,{base:K(Ke)?Ke:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new $("_:b"),contextResolver:new re({sharedCache:nt})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ee=Le.skipExpansion?Ke:yield ye.expand(Ke,Le);const Oe=yield ye.processContext(Q(Le),je,Le);let Ue=yield ie({activeCtx:Oe,element:Ee,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&I(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&H(Ue)&&(Ue=[Ue]),H(je)&&"@context"in je&&(je=je["@context"]),je=L.clone(je),I(je)||(je=[je]);const qe=je;je=[];for(let z=0;z0)&&je.push(qe[z]);const Be=je.length>0;if(1===je.length&&(je=je[0]),I(Ue)){const z=ue({activeCtx:Oe,iri:"@graph",relativeTo:{vocab:!0}}),X=Ue;Ue={},Be&&(Ue["@context"]=je),Ue[z]=X}else if(H(Ue)&&Be){const z=Ue;Ue={"@context":je};for(const X in z)Ue[X]=z[X]}return Ue});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.expand=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(je=Ze(je,{keepFreeFloatingNodes:!1,contextResolver:new re({sharedCache:nt})})).expansionMap&&(je.expansionMap=void 0);const Le={},Ee=[];if("expandContext"in je){const Be=L.clone(je.expandContext);Le.expandContext=H(Be)&&"@context"in Be?Be:{"@context":Be},Ee.push(Le.expandContext)}let Oe;if(K(Ke)){const Be=yield ye.get(Ke,je);Oe=Be.documentUrl,Le.input=Be.document,Be.contextUrl&&(Le.remoteContext={"@context":Be.contextUrl},Ee.push(Le.remoteContext))}else Le.input=L.clone(Ke);"base"in je||(je.base=Oe||"");let Ue=Q(je);for(const Be of Ee)Ue=yield E({activeCtx:Ue,localCtx:Be,options:je});let qe=yield A({activeCtx:Ue,element:Le.input,options:je,expansionMap:je.expansionMap});return H(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),I(qe)||(qe=[qe]),qe});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.flatten=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");je="function"==typeof je?null:je||null,Le=Ze(Le,{base:K(Ke)?Ke:"",contextResolver:new re({sharedCache:nt})});const Ee=yield ye.expand(Ke,Le),Oe=v(Ee);return null===je?Oe:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Oe,je,Le))});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.frame=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Ze(Le,{base:K(Ke)?Ke:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new re({sharedCache:nt})}),K(je)){const ce=yield ye.get(je,Le);if(je=ce.document,ce.contextUrl){let Pe=je["@context"];Pe?I(Pe)?Pe.push(ce.contextUrl):Pe=[Pe,ce.contextUrl]:Pe=ce.contextUrl,je["@context"]=Pe}}const Ee=je&&je["@context"]||{},Oe=yield ye.processContext(Q(Le),Ee,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=U(Oe,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=U(Oe,1.1));const Ue=yield ye.expand(Ke,Le),qe=ht({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const Be=yield ye.expand(je,qe),z=Object.keys(je).map(ce=>F(Oe,ce,{vocab:!0}));qe.merged=!z.includes("@graph"),qe.is11=U(Oe,1.1);const X=D(Ue,Be,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let be=yield ye.compact(X,Ee,qe);return qe.link={},be=j(be,qe),be});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.link=function(){var Je=gt(function*(Ke,je,Le){const Ee={};return je&&(Ee["@context"]=je),Ee["@embed"]="@link",ye.frame(Ke,Ee,Le)});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(je=Ze(je,{base:K(Ke)?Ke:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new re({sharedCache:nt})}))){if("application/n-quads"!==je.inputFormat&&"application/nquads"!==je.inputFormat)throw new b("Unknown canonicalization input format.","jsonld.CanonizeError");const Oe=R.parse(Ke);return W.canonize(Oe,je)}const Le=ht({},je);delete Le.format,Le.produceGeneralizedRdf=!1;const Ee=yield ye.toRDF(Ke,Le);return W.canonize(Ee,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.fromRDF=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");je=Ze(je,{format:K(Ke)?"application/n-quads":void 0});const{format:Le}=je;let{rdfParser:Ee}=je;if(Le){if(Ee=Ee||Me[Le],!Ee)throw new b("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ee=()=>Ke;const Oe=yield Ee(Ke);return y(Oe,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.toRDF=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(je=Ze(je,{base:K(Ke)?Ke:"",skipExpansion:!1,contextResolver:new re({sharedCache:nt})})).skipExpansion?Ke:yield ye.expand(Ke,je);const Ee=w(Le,je);if(je.format){if("application/n-quads"===je.format||"application/nquads"===je.format)return R.serialize(Ee);throw new b("Unknown output format.","jsonld.UnknownFormat",{format:je.format})}return Ee});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.createNodeMap=function(){var Je=gt(function*(Ke,je){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");je=Ze(je,{base:K(Ke)?Ke:"",contextResolver:new re({sharedCache:nt})});const Le=yield ye.expand(Ke,je);return se(Le,je)});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.merge=function(){var Je=gt(function*(Ke,je,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!I(Ke))throw new TypeError('Could not merge, "docs" must be an array.');je="function"==typeof je?null:je||null,Le=Ze(Le,{contextResolver:new re({sharedCache:nt})});const Ee=yield Promise.all(Ke.map(ce=>{const Pe=ht({},Le);return ye.expand(ce,Pe)}));let Oe=!0;"mergeNodes"in Le&&(Oe=Le.mergeNodes);const Ue=Le.issuer||new $("_:b"),qe={"@default":{}};for(let ce=0;ceye._documentLoader,set:Je=>ye._documentLoader=Je}),ye.documentLoader=function(){var Je=gt(function*(Ke){throw new b("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Ke})});return function(Ke){return Je.apply(this,arguments)}}(),ye.get=function(){var Je=gt(function*(Ke,je){let Le;Le="function"==typeof je.documentLoader?je.documentLoader:ye.documentLoader;const Ee=yield Le(Ke);try{if(!Ee.document)throw new b("No remote document found at the given URL.","jsonld.NullRemoteDocument");K(Ee.document)&&(Ee.document=JSON.parse(Ee.document))}catch(Oe){throw new b("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Oe,remoteDoc:Ee})}return Ee});return function(Ke,je){return Je.apply(this,arguments)}}(),ye.processContext=function(){var Je=gt(function*(Ke,je,Le){return Le=Ze(Le,{base:"",contextResolver:new re({sharedCache:nt})}),null===je?Q(Le):(je=L.clone(je),H(je)&&"@context"in je||(je={"@context":je}),E({activeCtx:Ke,localCtx:je,options:Le}))});return function(Ke,je,Le){return Je.apply(this,arguments)}}(),ye.getContextValue=Y("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(Je){if(!(Je in ye.documentLoaders))throw new b('Unknown document loader type: "'+Je+'"',"jsonld.UnknownDocumentLoader",{type:Je});ye.documentLoader=ye.documentLoaders[Je].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(Je,Ke){Me[Je]=Ke},ye.unregisterRDFParser=function(Je){delete Me[Je]},ye.registerRDFParser("application/n-quads",R.parse),ye.registerRDFParser("application/nquads",R.parse),ye.url=Y("./url"),ye.util=L,Object.assign(ye,L),ye.promises=ye,ye.RequestQueue=Y("./RequestQueue"),ye.JsonLdProcessor=Y("./JsonLdProcessor")(ye),V.setupGlobals(ye),V.setupDocumentLoaders(ye),ye},te=function(){return me(function(){return te()})};me(te),Ae.exports=te},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(Y,Ae,he){"use strict";const{isKeyword:W}=Y("./context"),V=Y("./graphTypes"),L=Y("./types"),re=Y("./util"),$=Y("./JsonLdError"),b={};Ae.exports=b,b.createMergedNodeMap=(S,R)=>{const A=(R=R||{}).issuer||new re.IdentifierIssuer("_:b"),v={"@default":{}};return b.createNodeMap(S,v,"@default",A),b.mergeNodeMaps(v)},b.createNodeMap=(S,R,A,v,y,w)=>{if(L.isArray(S)){for(const H of S)b.createNodeMap(H,R,A,v,void 0,w);return}if(!L.isObject(S))return void(w&&w.push(S));if(V.isValue(S)){if("@type"in S){let H=S["@type"];0===H.indexOf("_:")&&(S["@type"]=H=v.getId(H))}return void(w&&w.push(S))}if(w&&V.isList(S)){const H=[];return b.createNodeMap(S["@list"],R,A,v,y,H),void w.push({"@list":H})}if("@type"in S){const H=S["@type"];for(const K of H)0===K.indexOf("_:")&&v.getId(K)}L.isUndefined(y)&&(y=V.isBlankNode(S)?v.getId(S["@id"]):S["@id"]),w&&w.push({"@id":y});const D=R[A],j=D[y]=D[y]||{};j["@id"]=y;const I=Object.keys(S).sort();for(let H of I){if("@id"===H)continue;if("@reverse"===H){const M={"@id":y},F=S["@reverse"];for(const Q in F){const E=F[Q];for(const U of E){let ie=U["@id"];V.isBlankNode(U)&&(ie=v.getId(ie)),b.createNodeMap(U,R,A,v,ie),re.addValue(D[ie],Q,M,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===H){y in R||(R[y]={}),b.createNodeMap(S[H],R,y,v);continue}if("@included"===H){b.createNodeMap(S[H],R,A,v);continue}if("@type"!==H&&W(H)){if("@index"===H&&H in j&&(S[H]!==j[H]||S[H]["@id"]!==j[H]["@id"]))throw new $("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:j});j[H]=S[H];continue}const K=S[H];if(0===H.indexOf("_:")&&(H=v.getId(H)),0!==K.length)for(let M of K)if("@type"===H&&(M=0===M.indexOf("_:")?v.getId(M):M),V.isSubject(M)||V.isSubjectReference(M)){if("@id"in M&&!M["@id"])continue;const F=V.isBlankNode(M)?v.getId(M["@id"]):M["@id"];re.addValue(j,H,{"@id":F},{propertyIsArray:!0,allowDuplicate:!1}),b.createNodeMap(M,R,A,v,F)}else if(V.isValue(M))re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1});else if(V.isList(M)){const F=[];b.createNodeMap(M["@list"],R,A,v,y,F),M={"@list":F},re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1})}else b.createNodeMap(M,R,A,v,y),re.addValue(j,H,M,{propertyIsArray:!0,allowDuplicate:!1});else re.addValue(j,H,[],{propertyIsArray:!0})}},b.mergeNodeMapGraphs=S=>{const R={};for(const A of Object.keys(S).sort())for(const v of Object.keys(S[A]).sort()){const y=S[A][v];v in R||(R[v]={"@id":v});const w=R[v];for(const D of Object.keys(y).sort())if(W(D)&&"@type"!==D)w[D]=re.clone(y[D]);else for(const j of y[D])re.addValue(w,D,re.clone(j),{propertyIsArray:!0,allowDuplicate:!1})}return R},b.mergeNodeMaps=S=>{const R=S["@default"],A=Object.keys(S).sort();for(const v of A){if("@default"===v)continue;const y=S[v];let w=R[v];w?"@graph"in w||(w["@graph"]=[]):R[v]=w={"@id":v,"@graph":[]};const D=w["@graph"];for(const j of Object.keys(y).sort()){const I=y[j];V.isSubjectReference(I)||D.push(I)}}return R}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Ae,he){"use strict";const W=Y("./documentLoaders/xhr"),V={};Ae.exports=V,V.setupDocumentLoaders=function(L){"undefined"!=typeof XMLHttpRequest&&(L.documentLoaders.xhr=W,L.useDocumentLoader("xhr"))},V.setupGlobals=function(L){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:L.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Ae,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:V}=Y("./context"),L=Y("./graphTypes"),re=Y("canonicalize"),$=Y("./types"),b=Y("./util"),{RDF_FIRST:S,RDF_REST:R,RDF_NIL:A,RDF_TYPE:v,RDF_JSON_LITERAL:y,RDF_LANGSTRING:w,XSD_BOOLEAN:D,XSD_DOUBLE:j,XSD_INTEGER:I,XSD_STRING:H}=Y("./constants"),{isAbsolute:K}=Y("./url"),M={};function F(U,ie,ue,ee,se){const Te=Object.keys(ie).sort();for(const me of Te){const te=ie[me],ye=Object.keys(te).sort();for(let Me of ye){const Ve=te[Me];if("@type"===Me)Me=v;else if(V(Me))continue;for(const nt of Ve){const Ze={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!K(me))continue;const Je={termType:Me.startsWith("_:")?"BlankNode":"NamedNode",value:Me};if(!K(Me)||"BlankNode"===Je.termType&&!se.produceGeneralizedRdf)continue;const Ke=E(nt,ee,U,ue,se.rdfDirection);Ke&&U.push({subject:Ze,predicate:Je,object:Ke,graph:ue})}}}}function E(U,ie,ue,ee,se){const Te={};if(L.isValue(U)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=U["@value"];const te=U["@type"]||null;"@json"===te?(Te.value=re(me),Te.datatype.value=y):$.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=te||D):$.isDouble(me)||te===j?($.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=te||j):$.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=te||I):"i18n-datatype"===se&&"@direction"in U?(Te.datatype.value="https://www.w3.org/ns/i18n#"+(U["@language"]||"")+`_${U["@direction"]}`,Te.value=me):"@language"in U?(Te.value=me,Te.datatype.value=te||w,Te.language=U["@language"]):(Te.value=me,Te.datatype.value=te||H)}else if(L.isList(U)){const me=function(U,ie,ue,ee,se){const Te={termType:"NamedNode",value:S},me={termType:"NamedNode",value:R},te={termType:"NamedNode",value:A},ye=U.pop(),Me=ye?{termType:"BlankNode",value:ie.getId()}:te;let Ve=Me;for(const nt of U){const Ze=E(nt,ie,ue,ee,se),Je={termType:"BlankNode",value:ie.getId()};ue.push({subject:Ve,predicate:Te,object:Ze,graph:ee}),ue.push({subject:Ve,predicate:me,object:Je,graph:ee}),Ve=Je}if(ye){const nt=E(ye,ie,ue,ee,se);ue.push({subject:Ve,predicate:Te,object:nt,graph:ee}),ue.push({subject:Ve,predicate:me,object:te,graph:ee})}return Me}(U["@list"],ie,ue,ee,se);Te.termType=me.termType,Te.value=me.value}else{const me=$.isObject(U)?U["@id"]:U;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||K(Te.value)?Te:null}Ae.exports=M,M.toRDF=(U,ie)=>{const ue=new b.IdentifierIssuer("_:b"),ee={"@default":{}};W(U,ee,"@default",ue);const se=[],Te=Object.keys(ee).sort();for(const me of Te){let te;if("@default"===me)te={termType:"DefaultGraph",value:""};else{if(!K(me))continue;te=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},te.value=me}F(se,ee[me],te,ue,ie)}return se}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Ae,he){"use strict";const W={};Ae.exports=W,W.isArray=Array.isArray,W.isBoolean=V=>"boolean"==typeof V||"[object Boolean]"===Object.prototype.toString.call(V),W.isDouble=V=>W.isNumber(V)&&(-1!==String(V).indexOf(".")||Math.abs(V)>=1e21),W.isEmptyObject=V=>W.isObject(V)&&0===Object.keys(V).length,W.isNumber=V=>"number"==typeof V||"[object Number]"===Object.prototype.toString.call(V),W.isNumeric=V=>!isNaN(parseFloat(V))&&isFinite(V),W.isObject=V=>"[object Object]"===Object.prototype.toString.call(V),W.isString=V=>"string"==typeof V||"[object String]"===Object.prototype.toString.call(V),W.isUndefined=V=>void 0===V},{}],31:[function(Y,Ae,he){"use strict";const W=Y("./types"),V={};Ae.exports=V,V.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},V.parse=(re,$)=>{const b={},S=V.parsers[$||"full"],R=S.regex.exec(re);let A=S.keys.length;for(;A--;)b[S.keys[A]]=void 0===R[A]?null:R[A];return("https"===b.scheme&&"443"===b.port||"http"===b.scheme&&"80"===b.port)&&(b.href=b.href.replace(":"+b.port,""),b.authority=b.authority.replace(":"+b.port,""),b.port=null),b.normalizedPath=V.removeDotSegments(b.path),b},V.prependBase=(re,$)=>{if(null===re||V.isAbsolute($))return $;(!re||W.isString(re))&&(re=V.parse(re||""));const b=V.parse($),S={protocol:re.protocol||""};if(null!==b.authority)S.authority=b.authority,S.path=b.path,S.query=b.query;else if(S.authority=re.authority,""===b.path)S.path=re.path,S.query=null!==b.query?b.query:re.query;else{if(0===b.path.indexOf("/"))S.path=b.path;else{let A=re.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||re.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=b.path,S.path=A}S.query=b.query}""!==b.path&&(S.path=V.removeDotSegments(S.path));let R=S.protocol;return null!==S.authority&&(R+="//"+S.authority),R+=S.path,null!==S.query&&(R+="?"+S.query),null!==b.fragment&&(R+="#"+b.fragment),""===R&&(R="./"),R},V.removeBase=(re,$)=>{if(null===re)return $;(!re||W.isString(re))&&(re=V.parse(re||""));let b="";if(""!==re.href?b+=(re.protocol||"")+"//"+(re.authority||""):$.indexOf("//")&&(b+="//"),0!==$.indexOf(b))return $;const S=V.parse($.substr(b.length)),R=re.normalizedPath.split("/"),A=S.normalizedPath.split("/"),v=S.fragment||S.query?0:1;for(;R.length>0&&A.length>v&&R[0]===A[0];)R.shift(),A.shift();let y="";if(R.length>0){R.pop();for(let w=0;w{if(0===re.length)return"";const $=re.split("/"),b=[];for(;$.length>0;){const S=$.shift(),R=0===$.length;"."!==S?".."!==S?b.push(S):(b.pop(),R&&b.push("")):R&&b.push("")}return"/"===re[0]&&b.length>0&&""!==b[0]&&b.unshift(""),1===b.length&&""===b[0]?"/":b.join("/")};const L=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;V.isAbsolute=re=>W.isString(re)&&L.test(re),V.isRelative=re=>W.isString(re)},{"./types":30}],32:[function(Y,Ae,he){"use strict";const W=Y("./graphTypes"),V=Y("./types"),L=Y("rdf-canonize").IdentifierIssuer,re=Y("./JsonLdError"),$=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,b=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,S=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,R_headers={accept:"application/ld+json, application/json"},A={};function v(y,w){if(V.isArray(w))for(let D=0;D{if(Object.keys(y).some(D=>"accept"===D.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+R_headers.accept+'" is supported.');return Object.assign({Accept:R_headers.accept},y)},A.parseLinkHeader=y=>{const w={},D=y.match($);for(let j=0;j{if(!(V.isString(y)||V.isArray(y)&&y.every(D=>V.isString(D)))){if(w&&V.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&A.asArray(y["@default"]).every(D=>V.isString(D)))return}throw new re('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:y})}},A.hasProperty=(y,w)=>{if(y.hasOwnProperty(w)){const D=y[w];return!V.isArray(D)||D.length>0}return!1},A.hasValue=(y,w,D)=>{if(A.hasProperty(y,w)){let j=y[w];const I=W.isList(j);if(V.isArray(j)||I){I&&(j=j["@list"]);for(let H=0;H{if("propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1),"valueIsArray"in j||(j.valueIsArray=!1),"allowDuplicate"in j||(j.allowDuplicate=!0),"prependValue"in j||(j.prependValue=!1),j.valueIsArray)y[w]=D;else if(V.isArray(D)){0===D.length&&j.propertyIsArray&&!y.hasOwnProperty(w)&&(y[w]=[]),j.prependValue&&(D=D.concat(y[w]),y[w]=[]);for(let I=0;I[].concat(y[w]||[]),A.removeProperty=(y,w)=>{delete y[w]},A.removeValue=(y,w,D,j)=>{"propertyIsArray"in(j=j||{})||(j.propertyIsArray=!1);const I=A.getValues(y,w).filter(H=>!A.compareValues(H,D));0===I.length?A.removeProperty(y,w):y[w]=1!==I.length||j.propertyIsArray?I:I[0]},A.relabelBlankNodes=(y,w)=>v((w=w||{}).issuer||new L("_:b"),y),A.compareValues=(y,w)=>!!(y===w||W.isValue(y)&&W.isValue(w)&&y["@value"]===w["@value"]&&y["@type"]===w["@type"]&&y["@language"]===w["@language"]&&y["@index"]===w["@index"])||!!(V.isObject(y)&&"@id"in y&&V.isObject(w)&&"@id"in w)&&y["@id"]===w["@id"],A.compareShortestLeast=(y,w)=>y.length1;const j=(Q,E,U)=>{const ie=Q[v].get(E);if(ie){const ue=ie.value;if(I(Q,ue)){if(K(Q,ie),!Q[$])return}else U&&(Q[y]&&(ie.value.now=Date.now()),Q[A].unshiftNode(ie));return ue.value}},I=(Q,E)=>{if(!E||!E.maxAge&&!Q[b])return!1;const U=Date.now()-E.now;return E.maxAge?U>E.maxAge:Q[b]&&U>Q[b]},H=Q=>{if(Q[L]>Q[V])for(let E=Q[A].tail;Q[L]>Q[V]&&null!==E;){const U=E.prev;K(Q,E),E=U}},K=(Q,E)=>{if(E){const U=E.value;Q[S]&&Q[S](U.key,U.value),Q[L]-=U.length,Q[v].delete(U.key),Q[A].removeNode(E)}};class M{constructor(E,U,ie,ue,ee){this.key=E,this.value=U,this.length=ie,this.now=ue,this.maxAge=ee||0}}const F=(Q,E,U,ie)=>{let ue=U.value;I(Q,ue)&&(K(Q,U),Q[$]||(ue=void 0)),ue&&E.call(ie,ue.value,ue.key,Q)};Ae.exports=class{constructor(E){if("number"==typeof E&&(E={max:E}),E||(E={}),E.max&&("number"!=typeof E.max||E.max<0))throw new TypeError("max must be a non-negative number");this[V]=E.max||1/0;const ie=E.length||w;if(this[re]="function"!=typeof ie?w:ie,this[$]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[b]=E.maxAge||0,this[S]=E.dispose,this[R]=E.noDisposeOnSet||!1,this[y]=E.updateAgeOnGet||!1,this.reset()}set max(E){if("number"!=typeof E||E<0)throw new TypeError("max must be a non-negative number");this[V]=E||1/0,H(this)}get max(){return this[V]}set allowStale(E){this[$]=!!E}get allowStale(){return this[$]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[b]=E,H(this)}get maxAge(){return this[b]}set lengthCalculator(E){"function"!=typeof E&&(E=w),E!==this[re]&&(this[re]=E,this[L]=0,this[A].forEach(U=>{U.length=this[re](U.value,U.key),this[L]+=U.length})),H(this)}get lengthCalculator(){return this[re]}get length(){return this[L]}get itemCount(){return this[A].length}rforEach(E,U){U=U||this;for(let ie=this[A].tail;null!==ie;){const ue=ie.prev;F(this,E,ie,U),ie=ue}}forEach(E,U){U=U||this;for(let ie=this[A].head;null!==ie;){const ue=ie.next;F(this,E,ie,U),ie=ue}}keys(){return this[A].toArray().map(E=>E.key)}values(){return this[A].toArray().map(E=>E.value)}reset(){this[S]&&this[A]&&this[A].length&&this[A].forEach(E=>this[S](E.key,E.value)),this[v]=new Map,this[A]=new W,this[L]=0}dump(){return this[A].map(E=>!I(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[A]}set(E,U,ie){if((ie=ie||this[b])&&"number"!=typeof ie)throw new TypeError("maxAge must be a number");const ue=ie?Date.now():0,ee=this[re](U,E);if(this[v].has(E)){if(ee>this[V])return K(this,this[v].get(E)),!1;const me=this[v].get(E).value;return this[S]&&(this[R]||this[S](E,me.value)),me.now=ue,me.maxAge=ie,me.value=U,this[L]+=ee-me.length,me.length=ee,this.get(E),H(this),!0}const se=new M(E,U,ee,ue,ie);return se.length>this[V]?(this[S]&&this[S](E,U),!1):(this[L]+=se.length,this[A].unshift(se),this[v].set(E,this[A].head),H(this),!0)}has(E){if(!this[v].has(E))return!1;const U=this[v].get(E).value;return!I(this,U)}get(E){return j(this,E,!0)}peek(E){return j(this,E,!1)}pop(){const E=this[A].tail;return E?(K(this,E),E.value):null}del(E){K(this,this[v].get(E))}load(E){this.reset();const U=Date.now();for(let ie=E.length-1;ie>=0;ie--){const ue=E[ie],ee=ue.e||0;if(0===ee)this.set(ue.k,ue.v);else{const se=ee-U;se>0&&this.set(ue.k,ue.v,se)}}}prune(){this[v].forEach((E,U)=>j(this,U,!1))}}},{yallist:92}],34:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",V="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${V}decimal`,boolean:`${V}boolean`,double:`${V}double`,integer:`${V}integer`,string:`${V}string`},rdf:{type:`${W}type`,nil:`${W}nil`,first:`${W}first`,rest:`${W}rest`,langString:`${W}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${L}reify#forSome`,forAll:`${L}reify#forAll`},log:{implies:`${L}log#implies`}}},{}],35:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.termFromId=function M(te,ye){if(ye=ye||v,!te)return ye.defaultGraph();switch(te[0]){case"?":return ye.variable(te.substr(1));case"_":return ye.blankNode(te.substr(2));case'"':if(ye===v)return new j(te);if('"'===te[te.length-1])return ye.literal(te.substr(1,te.length-2));const Me=te.lastIndexOf('"',te.length-1);return ye.literal(te.substr(1,Me-1),"@"===te[Me+1]?te.substr(Me+2):ye.namedNode(te.substr(Me+3)));case"<":const Ve=A.exec(te);return ye.quad(M(U(Ve[1]),ye),M(U(Ve[2]),ye),M(U(Ve[3]),ye),Ve[4]&&M(U(Ve[4]),ye));default:return ye.namedNode(te)}},he.termToId=function F(te){if("string"==typeof te)return te;if(te instanceof w&&"Quad"!==te.termType)return te.id;if(!te)return b.id;switch(te.termType){case"NamedNode":return te.value;case"BlankNode":return`_:${te.value}`;case"Variable":return`?${te.value}`;case"DefaultGraph":return"";case"Literal":return`"${te.value}"${te.language?`@${te.language}`:te.datatype&&te.datatype.value!==$.string?`^^${te.datatype.value}`:""}`;case"Quad":return`<<${E(F(te.subject))} ${E(F(te.predicate))} ${E(F(te.object))}${(0,V.isDefaultGraph)(te.graph)?"":` ${F(te.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${te.termType}`)}},he.escapeQuotes=E,he.unescapeQuotes=U,he.Triple=he.Quad=he.DefaultGraph=he.Variable=he.BlankNode=he.Literal=he.NamedNode=he.Term=he.default=void 0;var te,W=(te=Y("./IRIs"))&&te.__esModule?te:{default:te},V=Y("./N3Util");const{rdf:re,xsd:$}=W.default;let b,S=0;const R=/^"(.*".*)(?="[^"]*$)/,A=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,v={namedNode:function(te){return new D(te)},blankNode:function(te){return new I(te||"n3-"+S++)},variable:function(te){return new H(te)},literal:function(te,ye){if("string"==typeof ye)return new j(`"${te}"@${ye.toLowerCase()}`);let Me=ye?ye.value:"";return""===Me&&("boolean"==typeof te?Me=$.boolean:"number"==typeof te&&(Number.isFinite(te)?Me=Number.isInteger(te)?$.integer:$.double:(Me=$.double,Number.isNaN(te)||(te=te>0?"INF":"-INF")))),new j(""===Me||Me===$.string?`"${te}"`:`"${te}"^^${Me}`)},defaultGraph:function(){return b},quad:me,triple:me};he.default=v;class w{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof w?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=w;class D extends w{get termType(){return"NamedNode"}}he.NamedNode=D;class j extends w{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let Me=ye.lastIndexOf('"')+1;return Me`"${Me.replace(/"/g,'""')}`)}function U(te){return te.replace(R,(ye,Me)=>`"${Me.replace(/""/g,'"')}`)}function me(te,ye,Me,Ve){return new Q(te,ye,Me,Ve)}he.Triple=he.Quad=Q},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Ae,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var V=re(Y("./IRIs")),L=re(Y("queue-microtask"));function re(w){return w&&w.__esModule?w:{default:w}}const{xsd:$}=V.default,b=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,S={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},R=/[\x00-\x20<>\\"\{\}\|\^\`]/,A={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},v=/$0^/;he.default=class{constructor(D){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]*)?$/,this._lineMode=!!(D=D||{}).lineMode){this._n3Mode=!1;for(const j in this)!(j in A)&&this[j]instanceof RegExp&&(this[j]=v)}else this._n3Mode=!1!==D.n3;this._comments=!!D.comments,this._literalClosingPos=0}_tokenizeToEnd(D,j){let I=this._input;const H=this._comments;for(;;){let M,F;for(;M=this._newline.exec(I);)H&&(F=this._comment.exec(M[0]))&&D(null,{line:this._line,type:"comment",value:F[1],prefix:""}),I=I.substr(M[0].length,I.length),this._line++;if(!M&&(M=this._whitespace.exec(I))&&(I=I.substr(M[0].length,I.length)),this._endOfFile.test(I))return j&&(H&&(F=this._comment.exec(I))&&D(null,{line:this._line,type:"comment",value:F[1],prefix:""}),D(I=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=I;const Q=this._line,E=I[0];let U="",ie="",ue="",ee=null,se=0,Te=!1;switch(E){case"^":if(I.length<3)break;if("^"!==I[1]){this._n3Mode&&(se=1,U="^");break}if(this._previousMarker="^^",I=I.substr(2),"<"!==I[0]){Te=!0;break}case"<":if(ee=this._unescapedIri.exec(I))U="IRI",ie=ee[1];else if(ee=this._iri.exec(I)){if(ie=this._unescape(ee[1]),null===ie||R.test(ie))return K(this);U="IRI"}else I.length>1&&"<"===I[1]?(U="<<",se=2):this._n3Mode&&I.length>1&&"="===I[1]&&(U="inverse",se=2,ie=">");break;case">":I.length>1&&">"===I[1]&&(U=">>",se=2);break;case"_":((ee=this._blank.exec(I))||j&&(ee=this._blank.exec(`${I} `)))&&(U="blank",ue="_",ie=ee[1]);break;case'"':if(ee=this._simpleQuotedString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return K(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(ee=this._simpleApostropheString.exec(I))ie=ee[1];else if(({value:ie,matchLength:se}=this._parseLiteral(I)),null===ie)return K(this);(null!==ee||0!==se)&&(U="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(ee=this._variable.exec(I))&&(U="var",ie=ee[0]);break;case"@":"literal"===this._previousMarker&&(ee=this._langcode.exec(I))?(U="langcode",ie=ee[1]):(ee=this._keyword.exec(I))&&(U=ee[0]);break;case".":if(1===I.length?j:I[1]<"0"||I[1]>"9"){U=".",se=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(ee=this._number.exec(I)||j&&(ee=this._number.exec(`${I} `)))&&(U="literal",ie=ee[0],ue="string"==typeof ee[1]?$.double:"string"==typeof ee[2]?$.decimal:$.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(ee=this._sparqlKeyword.exec(I))?U=ee[0].toUpperCase():Te=!0;break;case"f":case"t":(ee=this._boolean.exec(I))?(U="literal",ie=ee[0],ue=$.boolean):Te=!0;break;case"a":(ee=this._shortPredicates.exec(I))?(U="abbreviation",ie="a"):Te=!0;break;case"=":this._n3Mode&&I.length>1&&(U="abbreviation",">"!==I[1]?(se=1,ie="="):(se=2,ie=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(se=1,U=E);break;default:Te=!0}if(Te&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(ee=this._prefix.exec(I))?((ee=this._prefixed.exec(I))||j&&(ee=this._prefixed.exec(`${I} `)))&&(U="prefixed",ue=ee[1]||"",ie=this._unescape(ee[2])):(U="prefix",ie=ee[1]||"")),"^^"===this._previousMarker)switch(U){case"prefixed":U="type";break;case"IRI":U="typeIRI";break;default:U=""}if(!U)return j||!/^'''|^"""/.test(I)&&/\n|\r/.test(I)?K(this):this._input=I;const me={line:Q,type:U,value:ie,prefix:ue};D(null,me),this.previousToken=me,this._previousMarker=U,I=I.substr(se||ee[0].length,I.length)}function K(M){D(M._syntaxError(/^\S*/.exec(I)[0]))}}_unescape(D){let j=!1;const I=D.replace(b,(H,K,M,F)=>{if("string"==typeof K)return String.fromCharCode(Number.parseInt(K,16));if("string"==typeof M){let Q=Number.parseInt(M,16);return Q<=65535?String.fromCharCode(Number.parseInt(M,16)):String.fromCharCode(55296+((Q-=65536)>>10),56320+(1023&Q))}return F in S?S[F]:(j=!0,"")});return j?null:I}_parseLiteral(D){if(D.length>=3){const j=D.match(/^(?:"""|"|'''|'|)/)[0],I=j.length;let H=Math.max(this._literalClosingPos,I);for(;(H=D.indexOf(j,H))>0;){let K=0;for(;"\\"===D[H-K-1];)K++;if(K%2==0){const M=D.substring(I,H),F=M.split(/\r\n|\r|\n/).length-1,Q=H+I;if(1===I&&0!==F||3===I&&this._lineMode)break;return this._line+=F,{value:this._unescape(M),matchLength:Q}}H++}this._literalClosingPos=D.length-I+1}return{value:"",matchLength:0}}_syntaxError(D){this._input=null;const j=new Error(`Unexpected "${D}" on line ${this._line}.`);return j.context={token:void 0,line:this._line,previousToken:this.previousToken},j}_readStartingBom(D){return D.startsWith("\ufeff")?D.substr(1):D}tokenize(D,j){if(this._line=1,"string"==typeof D){if(this._input=this._readStartingBom(D),"function"!=typeof j){const I=[];let H;if(this._tokenizeToEnd((K,M)=>K?H=K:I.push(M),!0),H)throw H;return I}(0,L.default)(()=>this._tokenizeToEnd(j,!0))}else this._pendingBuffer=null,"function"==typeof D.setEncoding&&D.setEncoding("utf8"),D.on("data",I=>{null!==this._input&&0!==I.length&&(this._pendingBuffer&&(I=W.concat([this._pendingBuffer,I]),this._pendingBuffer=null),128&I[I.length-1]?this._pendingBuffer=I:(void 0===this._input?this._input=this._readStartingBom("string"==typeof I?I:I.toString()):this._input+=I,this._tokenizeToEnd(j,!1)))}),D.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(j,!0)}),D.on("error",j)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=re(Y("./N3Lexer")),V=re(Y("./N3DataFactory")),L=re(Y("./IRIs"));function re(A){return A&&A.__esModule?A:{default:A}}let $=0;class b{constructor(v){this._contextStack=[],this._graph=null,this._setBase((v=v||{}).baseIRI),v.factory&&R(this,v.factory);const y="string"==typeof v.format?v.format.match(/\w*$/)[0].toLowerCase():"",w=/turtle/.test(y),D=/trig/.test(y),j=/triple/.test(y),I=/quad/.test(y),H=this._n3Mode=/n3/.test(y),K=j||I;(this._supportsNamedGraphs=!(w||H))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(w||D||j||H),this._supportsRDFStar=""===y||/star|\*$/.test(y),K&&(this._resolveRelativeIRI=M=>null),this._blankNodePrefix="string"!=typeof v.blankNodePrefix?"":v.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=v.lexer||new W.default({lineMode:K,n3:H}),this._explicitQuantifiers=!!v.explicitQuantifiers}static _resetBlankNodePrefix(){$=0}_setBase(v){if(v){const y=v.indexOf("#");y>=0&&(v=v.substr(0,y)),this._base=v,this._basePath=v.indexOf("/")<0?v:v.replace(/[^\/?]*(?:\?.*)?$/,""),v=v.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=v[0],this._baseScheme=v[1]}else this._base="",this._basePath=""}_saveContext(v,y,w,D,j){const I=this._n3Mode;this._contextStack.push({subject:w,predicate:D,object:j,graph:y,type:v,inverse:!!I&&this._inversePredicate,blankPrefix:I?this._prefixes._:"",quantified:I?this._quantified:null}),I&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const v=this._contextStack.pop(),y=this._n3Mode;this._subject=v.subject,this._predicate=v.predicate,this._object=v.object,this._graph=v.graph,y&&(this._inversePredicate=v.inverse,this._prefixes._=v.blankPrefix,this._quantified=v.quantified)}_readInTopContext(v){switch(v.type){case"eof":return null!==this._graph?this._error("Unclosed graph",v):(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(v)}}_readEntity(v,y){let w;switch(v.type){case"IRI":case"typeIRI":const D=this._resolveIRI(v.value);if(null===D)return this._error("Invalid IRI",v);w=this._namedNode(D);break;case"type":case"prefixed":const j=this._prefixes[v.prefix];if(void 0===j)return this._error(`Undefined prefix "${v.prefix}:"`,v);w=this._namedNode(j+v.value);break;case"blank":w=this._blankNode(this._prefixes[v.prefix]+v.value);break;case"var":w=this._variable(v.value.substr(1));break;default:return this._error(`Expected entity but got ${v.type}`,v)}return!y&&this._n3Mode&&w.id in this._quantified&&(w=this._quantified[w.id]),w}_readSubject(v){switch(this._predicate=null,v.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",v);case"}":return this._readPunctuation(v);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',v);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',v);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",v);if(0===v.prefix.length)return this._literalValue=v.value,this._completeSubjectLiteral;this._subject=this._literal(v.value,this._namedNode(v.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._subject=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(v){const y=v.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[v.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,v):(this._subject=null,"]"===y?this._readBlankNodeTail(v):this._readPunctuation(v));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",v);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",v);default:if(void 0===(this._predicate=this._readEntity(v)))return}return this._readObject}_readObject(v){switch(v.type){case"literal":if(0===v.prefix.length)return this._literalValue=v.value,this._readDataTypeOrLang;this._object=this._literal(v.value,this._namedNode(v.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",v);default:if(void 0===(this._object=this._readEntity(v)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(v){return"{"===v.type?this._readGraph(v):this._readPredicate(v)}_readGraph(v){return"{"!==v.type?this._error(`Expected graph but got ${v.type}`,v):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(v){return"]"===v.type?(this._subject=null,this._readBlankNodeTail(v)):(this._predicate=null,this._readPredicate(v))}_readBlankNodeTail(v){if("]"!==v.type)return this._readBlankNodePunctuation(v);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null===this._object?y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(v){switch(v.type){case".":case"}":return this._subject=null,this._readPunctuation(v);default:return this._readPredicate(v)}}_readListItem(v){let y=null,w=null,D=this._readListItem;const j=this._subject,I=this._contextStack,H=I[I.length-1];switch(v.type){case"[":this._saveContext("blank",this._graph,w=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),D=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,w=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==I.length&&"list"===I[I.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(D=this._readPredicate,this._subject===this.RDF_NIL)return D}else if(D=this._getContextEndReader(),this._object===this.RDF_NIL)return D;w=this.RDF_NIL;break;case"literal":0===v.prefix.length?(this._literalValue=v.value,D=this._readListItemDataTypeOrLang):(y=this._literal(v.value,this._namedNode(v.prefix)),D=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",v);default:if(void 0===(y=this._readEntity(v)))return}if(null===w&&(this._subject=w=this._blankNode()),null===j?null===H.predicate?H.subject=w:H.object=w:this._emit(j,this.RDF_REST,w,this._graph),null!==y){if(this._n3Mode&&("IRI"===v.type||"prefixed"===v.type))return this._saveContext("item",this._graph,w,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(w,this.RDF_FIRST,y,this._graph)}return D}_readDataTypeOrLang(v){return this._completeObjectLiteral(v,!1)}_readListItemDataTypeOrLang(v){return this._completeObjectLiteral(v,!0)}_completeLiteral(v){let y=this._literal(this._literalValue);switch(v.type){case"type":case"typeIRI":const w=this._readEntity(v);if(void 0===w)return;y=this._literal(this._literalValue,w),v=null;break;case"langcode":y=this._literal(this._literalValue,v.value),v=null}return{token:v,literal:y}}_completeSubjectLiteral(v){return this._subject=this._completeLiteral(v).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(v,y){const w=this._completeLiteral(v);if(w)return this._object=w.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===w.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(w.token))}_readFormulaTail(v){return"}"!==v.type?this._readPunctuation(v):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(v){let y,w=this._graph;const D=this._subject,j=this._inversePredicate;switch(v.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",v);if(this._n3Mode)return this._readFormulaTail(v);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,j&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(w=this._readEntity(v))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}if(null!==D){const I=this._predicate,H=this._object;j?this._emit(H,I,D,w):this._emit(D,I,H,w)}return y}_readBlankNodePunctuation(v){let y;switch(v.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,v)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(v){return"."!==v.type?this._error("Expected dot to follow quad",v):this._readInTopContext}_readPrefix(v){return"prefix"!==v.type?this._error("Expected prefix to follow @prefix",v):(this._prefix=v.value,this._readPrefixIRI)}_readPrefixIRI(v){if("IRI"!==v.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,v);const y=this._readEntity(v);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(v){const y="IRI"===v.type&&this._resolveIRI(v.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",v)}_readNamedGraphLabel(v){switch(v.type){case"IRI":case"blank":case"prefixed":return this._readSubject(v),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",v)}}_readNamedGraphBlankLabel(v){return"]"!==v.type?this._error("Invalid graph label",v):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(v){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(v)):"."!==v.type?this._error("Expected declaration to end with a dot",v):this._readInTopContext}_readQuantifierList(v){let y;switch(v.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(v,!0)))break;default:return this._error(`Unexpected ${v.type}`,v)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,y,this.QUANTIFIERS_GRAPH)):this._quantified[y.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(v){return","===v.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(v))}_getPathReader(v){return this._afterPath=v,this._readPath}_readPath(v){switch(v.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,w=y.length&&y[y.length-1];if(w&&"item"===w.type){const D=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,D,this._graph)}return this._afterPath(v)}}_readForwardPath(v){let y,w;const D=this._blankNode();if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(y=this._subject,this._subject=D):(y=this._object,this._object=D),this._emit(y,w,D,this._graph),this._readPath}_readBackwardPath(v){const y=this._blankNode();let w,D;if(void 0!==(w=this._readEntity(v)))return null===this._predicate?(D=this._subject,this._subject=y):(D=this._object,this._object=y),this._emit(y,w,D,this._graph),this._readPath}_readRDFStarTailOrGraph(v){return">>"!==v.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(v))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,v):this._readRDFStarTail(v)}_readRDFStarTail(v){if(">>"!==v.type)return this._error(`Expected >> but got ${v.type}`,v);const y=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=y,this._readPredicate):(this._object=y,this._getContextEndReader())}_getContextEndReader(){const v=this._contextStack;if(!v.length)return this._readPunctuation;switch(v[v.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(v,y,w,D){this._callback(null,this._quad(v,y,w,D||this.DEFAULTGRAPH))}_error(v,y){const w=new Error(`${v} on line ${y.line}.`);w.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(w),this._callback=S}_resolveIRI(v){return/^[a-z][a-z0-9+.-]*:/i.test(v)?v:this._resolveRelativeIRI(v)}_resolveRelativeIRI(v){if(!v.length)return this._base;switch(v[0]){case"#":return this._base+v;case"?":return this._base.replace(/(?:\?.*)?$/,v);case"/":return("/"===v[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(v);default:return/^[^/:]*:/.test(v)?null:this._removeDotSegments(this._basePath+v)}}_removeDotSegments(v){if(!/(^|\/)\.\.?($|[/#?])/.test(v))return v;const y=v.length;let w="",D=-1,j=-1,I=0,H="/";for(;D=j&&(w=w.substr(0,I)),"/"!==H)return`${w}/${v.substr(D+1)}`;I=D+1}}}H=v[++D]}return w+v.substring(I)}parse(v,y,w){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${$++}_`,this._prefixCallback=w||S,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const D=[];let j;if(this._callback=(I,H)=>{I?j=I:H&&D.push(H)},this._lexer.tokenize(v).every(I=>this._readCallback=this._readCallback(I)),j)throw j;return D}this._callback=y,this._lexer.tokenize(v,(D,j)=>{null!==D?(this._callback(D),this._callback=S):this._readCallback&&(this._readCallback=this._readCallback(j))})}}function S(){}function R(A,v){const y=v.namedNode;A._namedNode=y,A._blankNode=v.blankNode,A._literal=v.literal,A._variable=v.variable,A._quad=v.quad,A.DEFAULTGRAPH=v.defaultGraph(),A.RDF_FIRST=y(L.default.rdf.first),A.RDF_REST=y(L.default.rdf.rest),A.RDF_NIL=y(L.default.rdf.nil),A.N3_FORALL=y(L.default.r.forAll),A.N3_FORSOME=y(L.default.r.forSome),A.ABBREVIATIONS={a:y(L.default.rdf.type),"=":y(L.default.owl.sameAs),">":y(L.default.log.implies)},A.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=b,R(b.prototype,V.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var v,W=function(v,y){if(!y&&v&&v.__esModule)return v;if(null===v||"object"!=typeof v&&"function"!=typeof v)return{default:v};var w=$(y);if(w&&w.has(v))return w.get(v);var D={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in v)if("default"!==I&&Object.prototype.hasOwnProperty.call(v,I)){var H=j?Object.getOwnPropertyDescriptor(v,I):null;H&&(H.get||H.set)?Object.defineProperty(D,I,H):D[I]=v[I]}return D.default=v,w&&w.set(v,D),D}(Y("./N3DataFactory")),V=Y("readable-stream"),L=(v=Y("./IRIs"))&&v.__esModule?v:{default:v};function $(v){if("function"!=typeof WeakMap)return null;var y=new WeakMap,w=new WeakMap;return($=function(D){return D?w:y})(v)}class S{constructor(y,w){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!w&&y&&!y[0]&&(w=y,y=null),this._factory=(w=w||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const w=this._graphs;let D,j;for(const I in w)for(const H in D=w[I].subjects)for(const K in j=D[H])y+=Object.keys(j[K]).length;return this._size=y}_addToIndex(y,w,D,j){const I=y[w]||(y[w]={}),H=I[D]||(I[D]={}),K=j in H;return K||(H[j]=null),!K}_removeFromIndex(y,w,D,j){const I=y[w],H=I[D];delete H[j];for(const K in H)return;delete I[D];for(const K in I)return;delete y[w]}_findInIndex(y,w,D,j,I,H,K,M,F,Q){let E,U,ie;const ee=!w+!D+!j>1?Object.keys(this._ids):this._entities;w&&((E=y,y={})[w]=E[w]);for(const se in y){const Te=ee[se];if(U=y[se]){D&&((E=U,U={})[D]=E[D]);for(const me in U){const te=ee[me];if(ie=U[me]){const ye=j?j in ie?[j]:[]:Object.keys(ie);for(let Me=0;Me{D in w||(w[D]=!0,y((0,W.termFromId)(this._entities[D],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,w,D,j){w||(j=y.graph,D=y.object,w=y.predicate,y=y.subject),y=(0,W.termToId)(y),w=(0,W.termToId)(w),D=(0,W.termToId)(D),j=(0,W.termToId)(j);let I=this._graphs[j];I||(I=this._graphs[j]={subjects:{},predicates:{},objects:{}},Object.freeze(I));const H=this._ids,K=this._entities;y=H[y]||(H[K[++this._id]=y]=this._id),w=H[w]||(H[K[++this._id]=w]=this._id),D=H[D]||(H[K[++this._id]=D]=this._id);const M=this._addToIndex(I.subjects,y,w,D);return this._addToIndex(I.predicates,w,D,y),this._addToIndex(I.objects,D,y,w),this._size=null,M}addQuads(y){for(let w=0;w{this.addQuad(w)}),y}removeQuad(y,w,D,j){w||(j=y.graph,D=y.object,w=y.predicate,y=y.subject),y=(0,W.termToId)(y),w=(0,W.termToId)(w),D=(0,W.termToId)(D),j=(0,W.termToId)(j);const I=this._ids,H=this._graphs;let K,M,F;if(!((y=I[y])&&(w=I[w])&&(D=I[D])&&(K=H[j])&&(M=K.subjects[y])&&(F=M[w])&&D in F))return!1;for(y in this._removeFromIndex(K.subjects,y,w,D),this._removeFromIndex(K.predicates,w,D,y),this._removeFromIndex(K.objects,D,y,w),null!==this._size&&this._size--,K.subjects)return!0;return delete H[j],!0}removeQuads(y){for(let w=0;w{this.removeQuad(w)}),y}removeMatches(y,w,D,j){const I=new V.Readable({objectMode:!0});return I._read=()=>{for(const H of this.getQuads(y,w,D,j))I.push(H);I.push(null)},this.remove(I)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,w,D,j){y=y&&(0,W.termToId)(y),w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=[],H=this._getGraphs(j),K=this._ids;let M,F,Q,E;if(R(y)&&!(F=K[y])||R(w)&&!(Q=K[w])||R(D)&&!(E=K[D]))return I;for(const U in H)(M=H[U])&&(F?E?this._findInIndex(M.objects,E,F,Q,"object","subject","predicate",U,null,I):this._findInIndex(M.subjects,F,Q,null,"subject","predicate","object",U,null,I):Q?this._findInIndex(M.predicates,Q,E,null,"predicate","object","subject",U,null,I):E?this._findInIndex(M.objects,E,null,null,"object","subject","predicate",U,null,I):this._findInIndex(M.subjects,null,null,null,"subject","predicate","object",U,null,I));return I}match(y,w,D,j){return new A(this,y,w,D,j)}countQuads(y,w,D,j){y=y&&(0,W.termToId)(y),w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._getGraphs(j),H=this._ids;let M,F,Q,E,K=0;if(R(y)&&!(F=H[y])||R(w)&&!(Q=H[w])||R(D)&&!(E=H[D]))return 0;for(const U in I)(M=I[U])&&(K+=y?D?this._countInIndex(M.objects,E,F,Q):this._countInIndex(M.subjects,F,Q,E):w?this._countInIndex(M.predicates,Q,E,F):this._countInIndex(M.objects,E,F,Q));return K}forEach(y,w,D,j,I){this.some(H=>(y(H),!1),w,D,j,I)}every(y,w,D,j,I){let H=!1;const K=!this.some(M=>(H=!0,!y(M)),w,D,j,I);return H&&K}some(y,w,D,j,I){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j),I=I&&(0,W.termToId)(I);const H=this._getGraphs(I),K=this._ids;let M,F,Q,E;if(R(w)&&!(F=K[w])||R(D)&&!(Q=K[D])||R(j)&&!(E=K[j]))return!1;for(const U in H)if(M=H[U])if(F){if(E){if(this._findInIndex(M.objects,E,F,Q,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(M.subjects,F,Q,null,"subject","predicate","object",U,y,null))return!0}else if(Q){if(this._findInIndex(M.predicates,Q,E,null,"predicate","object","subject",U,y,null))return!0}else if(E){if(this._findInIndex(M.objects,E,null,null,"object","subject","predicate",U,y,null))return!0}else if(this._findInIndex(M.subjects,null,null,null,"subject","predicate","object",U,y,null))return!0;return!1}getSubjects(y,w,D){const j=[];return this.forSubjects(I=>{j.push(I)},y,w,D),j}forSubjects(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.predicates,M,F,y):this._loopByKey1(K.subjects,M,y):F?this._loopByKey0(K.objects,F,y):this._loop(K.subjects,y))}getPredicates(y,w,D){const j=[];return this.forPredicates(I=>{j.push(I)},y,w,D),j}forPredicates(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.objects,F,M,y):this._loopByKey0(K.subjects,M,y):F?this._loopByKey1(K.predicates,F,y):this._loop(K.predicates,y))}getObjects(y,w,D){const j=[];return this.forObjects(I=>{j.push(I)},y,w,D),j}forObjects(y,w,D,j){w=w&&(0,W.termToId)(w),D=D&&(0,W.termToId)(D),j=j&&(0,W.termToId)(j);const I=this._ids,H=this._getGraphs(j);let K,M,F;if(y=this._uniqueEntities(y),!(R(w)&&!(M=I[w])||R(D)&&!(F=I[D])))for(j in H)(K=H[j])&&(M?F?this._loopBy2Keys(K.subjects,M,F,y):this._loopByKey1(K.objects,M,y):F?this._loopByKey0(K.predicates,F,y):this._loop(K.objects,y))}getGraphs(y,w,D){const j=[];return this.forGraphs(I=>{j.push(I)},y,w,D),j}forGraphs(y,w,D,j){for(const I in this._graphs)this.some(H=>(y(H.graph),!0),w,D,j,I)}createBlankNode(y){let w,D;if(y)for(w=y=`_:${y}`,D=1;this._ids[w];)w=y+D++;else do{w="_:b"+this._blankNodeIndex++}while(this._ids[w]);return this._ids[w]=++this._id,this._entities[this._id]=w,this._factory.blankNode(w.substr(2))}extractLists({remove:y=!1,ignoreErrors:w=!1}={}){const D={},j=w?()=>!0:(K,M)=>{throw new Error(`${K.value} ${M}`)},I=this.getQuads(null,L.default.rdf.rest,L.default.rdf.nil,null),H=y?[...I]:[];return I.forEach(K=>{const M=[];let Q,E,F=!1;const U=K.graph;let ie=K.subject;for(;ie&&!F;){const ue=this.getQuads(null,null,ie,null),ee=this.getQuads(ie,null,null,null);let se,Te=null,me=null,te=null;for(let ye=0;ye{switch(v){case"data":R=y;break;case"end":A=y}}},(v,y)=>{v&&this.emit("error",v)||y&&this.push(y)},(v,y)=>{this.emit("prefix",v,y)}),this._transform=(v,y,w)=>{R(v),w()},this._flush=v=>{A(),v()}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var $,W=Y("readable-stream"),V=($=Y("./N3Writer"))&&$.__esModule?$:{default:$};he.default=class extends W.Transform{constructor(b){super({encoding:"utf8",writableObjectMode:!0});const S=this._writer=new V.default({write:(R,A,v)=>{this.push(R),v&&v()},end:R=>{this.push(null),R&&R()}},b);this._transform=(R,A,v)=>{S.addQuad(R,v)},this._flush=R=>{S.end(R)}}import(b){return b.on("data",S=>{this.write(S)}),b.on("end",()=>{this.end()}),b.on("error",S=>{this.emit("error",S)}),b.on("prefix",(S,R)=>{this._writer.addPrefix(S,R)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.isDefaultGraph=S,he.inDefaultGraph=function(y){return S(y.graph)},he.prefix=function(y,w){return v({"":y},w)("")},he.prefixes=v;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function S(y){return!!y&&"DefaultGraph"===y.termType}function v(y,w){const D=Object.create(null);for(const I in y)j(I,y[I]);function j(I,H){if("string"==typeof H){const K=Object.create(null);D[I]=M=>K[M]||(K[M]=w.namedNode(H+M))}else if(!(I in D))throw new Error(`Unknown prefix: ${I}`);return D[I]}return w=w||W.default,j}},{"./N3DataFactory":35}],42:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,W=(H=Y("./IRIs"))&&H.__esModule?H:{default:H},V=function(H,K){if(!K&&H&&H.__esModule)return H;if(null===H||"object"!=typeof H&&"function"!=typeof H)return{default:H};var M=re(K);if(M&&M.has(H))return M.get(H);var F={},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in H)if("default"!==E&&Object.prototype.hasOwnProperty.call(H,E)){var U=Q?Object.getOwnPropertyDescriptor(H,E):null;U&&(U.get||U.set)?Object.defineProperty(F,E,U):F[E]=H[E]}return F.default=H,M&&M.set(H,F),F}(Y("./N3DataFactory")),L=Y("./N3Util");function re(H){if("function"!=typeof WeakMap)return null;var K=new WeakMap,M=new WeakMap;return(re=function(F){return F?M:K})(H)}const S=V.default.defaultGraph(),{rdf:R,xsd:A}=W.default,v=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,w={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class D extends V.Term{equals(){return!1}}function I(H){let K=w[H];return void 0===K&&(1===H.length?(K=H.charCodeAt(0).toString(16),K="\\u0000".substr(0,6-K.length)+K):(K=(1024*(H.charCodeAt(0)-55296)+H.charCodeAt(1)+9216).toString(16),K="\\U00000000".substr(0,10-K.length)+K)),K}he.default=class{constructor(K,M){if(this._prefixRegex=/$0^/,K&&"function"!=typeof K.write&&(M=K,K=null),this._lists=(M=M||{}).lists,K)this._outputStream=K,this._endStream=void 0===M.end||!!M.end;else{let F="";this._outputStream={write(Q,E,U){F+=Q,U&&U()},end:Q=>{Q&&Q(null,F)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(M.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=S,this._baseIRI=M.baseIRI,this._prefixIRIs=Object.create(null),M.prefixes&&this.addPrefixes(M.prefixes))}get _inDefaultGraph(){return S.equals(this._graph)}_write(K,M){this._outputStream.write(K,"utf8",M)}_writeQuad(K,M,F,Q,E){try{Q.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(S.equals(Q)?"":`${this._encodeIriOrBlank(Q)} {\n`)),this._graph=Q,this._subject=null),K.equals(this._subject)?M.equals(this._predicate)?this._write(`, ${this._encodeObject(F)}`,E):this._write(`;\n ${this._encodePredicate(this._predicate=M)} ${this._encodeObject(F)}`,E):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=K)} ${this._encodePredicate(this._predicate=M)} ${this._encodeObject(F)}`,E)}catch(U){E&&E(U)}}_writeQuadLine(K,M,F,Q,E){delete this._prefixMatch,this._write(this.quadToString(K,M,F,Q),E)}quadToString(K,M,F,Q){return`${this._encodeSubject(K)} ${this._encodeIriOrBlank(M)} ${this._encodeObject(F)}${Q&&Q.value?` ${this._encodeIriOrBlank(Q)} .\n`:" .\n"}`}quadsToString(K){return K.map(M=>this.quadToString(M.subject,M.predicate,M.object,M.graph)).join("")}_encodeSubject(K){return"Quad"===K.termType?this._encodeQuad(K):this._encodeIriOrBlank(K)}_encodeIriOrBlank(K){if("NamedNode"!==K.termType)return this._lists&&K.value in this._lists&&(K=this.list(this._lists[K.value])),"id"in K?K.id:`_:${K.value}`;let M=K.value;this._baseIRI&&M.startsWith(this._baseIRI)&&(M=M.substr(this._baseIRI.length)),v.test(M)&&(M=M.replace(y,I));const F=this._prefixRegex.exec(M);return F?F[1]?this._prefixIRIs[F[1]]+F[2]:M:`<${M}>`}_encodeLiteral(K){let M=K.value;if(v.test(M)&&(M=M.replace(y,I)),K.language)return`"${M}"@${K.language}`;if(this._lineMode){if(K.datatype.value===A.string)return`"${M}"`}else switch(K.datatype.value){case A.string:return`"${M}"`;case A.boolean:if("true"===M||"false"===M)return M;break;case A.integer:if(/^[+-]?\d+$/.test(M))return M;break;case A.decimal:if(/^[+-]?\d*\.\d+$/.test(M))return M;break;case A.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(M))return M}return`"${M}"^^${this._encodeIriOrBlank(K.datatype)}`}_encodePredicate(K){return K.value===R.type?"a":this._encodeIriOrBlank(K)}_encodeObject(K){switch(K.termType){case"Quad":return this._encodeQuad(K);case"Literal":return this._encodeLiteral(K);default:return this._encodeIriOrBlank(K)}}_encodeQuad({subject:K,predicate:M,object:F,graph:Q}){return`<<${this._encodeSubject(K)} ${this._encodePredicate(M)} ${this._encodeObject(F)}${(0,L.isDefaultGraph)(Q)?"":` ${this._encodeIriOrBlank(Q)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(K,M,F,Q,E){void 0===F?this._writeQuad(K.subject,K.predicate,K.object,K.graph,M):"function"==typeof Q?this._writeQuad(K,M,F,S,Q):this._writeQuad(K,M,F,Q||S,E)}addQuads(K){for(let M=0;M.\n`)}if(F){let Q="",E="";for(const U in this._prefixIRIs)Q+=Q?`|${U}`:U,E+=(E?"|":"")+this._prefixIRIs[U];Q=Q.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${E})[^/]*$|^(${Q})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(F?"\n":"",M)}blank(K,M){let Q,E,F=K;switch(void 0===K?F=[]:K.termType?F=[{predicate:K,object:M}]:"length"in K||(F=[K]),E=F.length){case 0:return new D("[]");case 1:if(Q=F[0],!(Q.object instanceof D))return new D(`[ ${this._encodePredicate(Q.predicate)} ${this._encodeObject(Q.object)} ]`);default:let U="[";for(let ie=0;ie{M=null,K(F,Q)});if(this._endStream)try{return this._outputStream.end(M)}catch(F){}M&&M()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return R.Term}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return R.NamedNode}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return R.Literal}}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return R.BlankNode}}),Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return R.Variable}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return R.DefaultGraph}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return R.Quad}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return R.Triple}}),Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return R.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return R.termToId}}),he.Util=void 0;var W=y(Y("./N3Lexer")),V=y(Y("./N3Parser")),L=y(Y("./N3Writer")),re=y(Y("./N3Store")),$=y(Y("./N3StreamParser")),b=y(Y("./N3StreamWriter")),S=v(Y("./N3Util"));he.Util=S;var R=v(Y("./N3DataFactory"));function A(w){if("function"!=typeof WeakMap)return null;var D=new WeakMap,j=new WeakMap;return(A=function(I){return I?j:D})(w)}function v(w,D){if(!D&&w&&w.__esModule)return w;if(null===w||"object"!=typeof w&&"function"!=typeof w)return{default:w};var j=A(D);if(j&&j.has(w))return j.get(w);var I={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var K in w)if("default"!==K&&Object.prototype.hasOwnProperty.call(w,K)){var M=H?Object.getOwnPropertyDescriptor(w,K):null;M&&(M.get||M.set)?Object.defineProperty(I,K,M):I[K]=w[K]}return I.default=w,j&&j.set(w,I),I}function y(w){return w&&w.__esModule?w:{default:w}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Ae,he){var V,L,W=Ae.exports={};function re(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function b(H){if(V===setTimeout)return setTimeout(H,0);if((V===re||!V)&&setTimeout)return V=setTimeout,setTimeout(H,0);try{return V(H,0)}catch(K){try{return V.call(null,H,0)}catch(M){return V.call(this,H,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:re}catch(H){V=re}try{L="function"==typeof clearTimeout?clearTimeout:$}catch(H){L=$}}();var v,R=[],A=!1,y=-1;function w(){!A||!v||(A=!1,v.length?R=v.concat(R):y=-1,R.length&&D())}function D(){if(!A){var H=b(w);A=!0;for(var K=R.length;K;){for(v=R,R=[];++y1)for(var M=1;M(V||(V=Promise.resolve())).then(L).catch(re=>setTimeout(()=>{throw re},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Ae,he){Ae.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Ae,he){"use strict";Ae.exports=class vW{constructor(V,L=new Map,re=0){this.prefix=V,this._existing=L,this.counter=re}clone(){const{prefix:V,_existing:L,counter:re}=this;return new vW(V,new Map(L),re)}getId(V){const L=V&&this._existing.get(V);if(L)return L;const re=this.prefix+this.counter;return this.counter++,V&&this._existing.set(V,re),re}hasId(V){return this._existing.has(V)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Ae,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Ae.exports=class{constructor(L){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===L)this.algorithm={name:"SHA-256"};else{if("sha1"!==L)throw new Error(`Unsupport algorithm "${L}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(L){this._content+=L}digest(){var L=this;return gt(function*(){const re=(new TextEncoder).encode(L._content),$=new Uint8Array(yield W.subtle.digest(L.algorithm,re));let b="";for(let S=0;S<$.length;++S)b+=$[S].toString(16).padStart(2,"0");return b})()}}},{setimmediate:86}],49:[function(Y,Ae,he){"use strict";const L="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",re="http://www.w3.org/2001/XMLSchema#string",$="NamedNode",b="BlankNode",S="Literal",R="DefaultGraph",A={};function v(I,H){return I.subject.termType===H.subject.termType&&I.object.termType===H.object.termType&&I.subject.value===H.subject.value&&I.predicate.value===H.predicate.value&&I.object.value===H.object.value&&(I.object.termType!==S||I.object.datatype.termType===H.object.datatype.termType&&I.object.language===H.object.language&&I.object.datatype.value===H.object.datatype.value)}A.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,A.empty=new RegExp("^[ \\t]*$"),A.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),Ae.exports=class pP{static parse(H){const K=[],M={},F=H.split(A.eoln);let Q=0;for(const E of F){if(Q++,A.empty.test(E))continue;const U=E.match(A.quad);if(null===U)throw new Error("N-Quads parse error on line "+Q+".");const ie={subject:null,predicate:null,object:null,graph:null};if(ie.subject=void 0!==U[1]?{termType:$,value:U[1]}:{termType:b,value:U[2]},ie.predicate={termType:$,value:U[3]},void 0!==U[4]?ie.object={termType:$,value:U[4]}:void 0!==U[5]?ie.object={termType:b,value:U[5]}:(ie.object={termType:S,value:void 0,datatype:{termType:$}},void 0!==U[7]?ie.object.datatype.value=U[7]:void 0!==U[8]?(ie.object.datatype.value=L,ie.object.language=U[8]):ie.object.datatype.value=re,ie.object.value=U[6].replace(D,function(H,K,M,F){if(K)switch(K){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(M)return String.fromCharCode(parseInt(M,16));if(F)throw new Error("Unsupported U escape")})),ie.graph=void 0!==U[9]?{termType:$,value:U[9]}:void 0!==U[10]?{termType:b,value:U[10]}:{termType:R,value:""},ie.graph.value in M){let ue=!0;const ee=M[ie.graph.value];for(const se of ee)if(v(se,ie)){ue=!1;break}ue&&(ee.push(ie),K.push(ie))}else M[ie.graph.value]=[ie],K.push(ie)}return K}static serialize(H){Array.isArray(H)||(H=pP.legacyDatasetToQuads(H));const K=[];for(const M of H)K.push(pP.serializeQuad(M));return K.sort().join("")}static serializeQuad(H){const K=H.subject,F=H.object,Q=H.graph;let E="";return E+=K.termType===$?`<${K.value}>`:`${K.value}`,E+=` <${H.predicate.value}> `,F.termType===$?E+=`<${F.value}>`:F.termType===b?E+=F.value:(E+=`"${I=F.value,I.replace(y,function(H){switch(H){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,F.datatype.value===L?F.language&&(E+=`@${F.language}`):F.datatype.value!==re&&(E+=`^^<${F.datatype.value}>`)),Q.termType===$?E+=` <${Q.value}>`:Q.termType===b&&(E+=` ${Q.value}`),E+=" .\n",E;var I}static legacyDatasetToQuads(H){const K=[],M={"blank node":b,IRI:$,literal:S};for(const F in H)H[F].forEach(E=>{const U={};for(const ie in E){const ue=E[ie],ee={termType:M[ue.type],value:ue.value};ee.termType===S&&(ee.datatype={termType:$},"datatype"in ue&&(ee.datatype.value=ue.datatype),"language"in ue?("datatype"in ue||(ee.datatype.value=L),ee.language=ue.language):"datatype"in ue||(ee.datatype.value=re)),U[ie]=ee}U.graph="@default"===F?{termType:R,value:""}:{termType:F.startsWith("_:")?b:$,value:F},K.push(U)});return K}};const y=/["\\\n\r]/g;const D=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Ae,he){"use strict";Ae.exports=class{constructor(V){this.current=V.sort(),this.done=!1,this.dir=new Map;for(let L=0;L$)&&(v&&R>0&&A>V[R-1]||!v&&RV[R+1])&&($=A,b=R)}if(null===$)this.done=!0;else{const R=L.get($)?b-1:b+1;V[b]=V[R],V[R]=$;for(const A of V)A>$&&L.set(A,!L.get(A))}return re}}},{}],51:[function(Y,Ae,he){(function(W){(function(){"use strict";const V=Y("./IdentifierIssuer"),L=Y("./MessageDigest"),re=Y("./Permuter"),$=Y("./NQuads");function b(S,R){return S.hashR.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new V("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(R){var A=this;return gt(function*(){A.quads=R;for(const H of R)A._addBlankNodeQuadInfo({quad:H,component:H.subject}),A._addBlankNodeQuadInfo({quad:H,component:H.object}),A._addBlankNodeQuadInfo({quad:H,component:H.graph});const v=new Map,y=[...A.blankNodeInfo.keys()];let w=0;for(const H of y)++w%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:H,hashToBlankNodes:v});const D=[...v.keys()].sort(),j=[];for(const H of D){const K=v.get(H);K.length>1?j.push(K):A.canonicalIssuer.getId(K[0])}for(const H of j){const K=[];for(const M of H){if(A.canonicalIssuer.hasId(M))continue;const F=new V("_:b");F.getId(M);const Q=yield A.hashNDegreeQuads(M,F);K.push(Q)}K.sort(b);for(const M of K){const F=M.issuer.getOldIds();for(const Q of F)A.canonicalIssuer.getId(Q)}}const I=[];for(const H of A.quads){const K=ht({},H);K.subject=A._useCanonicalId({component:K.subject}),K.object=A._useCanonicalId({component:K.object}),K.graph=A._useCanonicalId({component:K.graph}),I.push($.serializeQuad(K))}return I.sort(),I.join("")})()}hashFirstDegreeQuads(R){var A=this;return gt(function*(){const v=[],y=A.blankNodeInfo.get(R),w=y.quads;for(const j of w){const I={subject:null,predicate:j.predicate,object:null,graph:null};I.subject=A.modifyFirstDegreeComponent(R,j.subject,"subject"),I.object=A.modifyFirstDegreeComponent(R,j.object,"object"),I.graph=A.modifyFirstDegreeComponent(R,j.graph,"graph"),v.push($.serializeQuad(I))}v.sort();const D=new L(A.hashAlgorithm);for(const j of v)D.update(j);return y.hash=yield D.digest(),y.hash})()}hashRelatedBlankNode(R,A,v,y){var w=this;return gt(function*(){let D;D=w.canonicalIssuer.hasId(R)?w.canonicalIssuer.getId(R):v.hasId(R)?v.getId(R):w.blankNodeInfo.get(R).hash;const j=new L(w.hashAlgorithm);return j.update(y),"g"!==y&&j.update(w.getRelatedPredicate(A)),j.update(D),j.digest()})()}hashNDegreeQuads(R,A){var v=this;return gt(function*(){const y=new L(v.hashAlgorithm),w=yield v.createHashToRelated(R,A),D=[...w.keys()].sort();for(const j of D){y.update(j);let H,I="";const K=new re(w.get(j));let M=0;for(;K.hasNext();){const F=K.next();++M%3==0&&(yield v._yield());let Q=A.clone(),E="";const U=[];let ie=!1;for(const ue of F)if(v.canonicalIssuer.hasId(ue)?E+=v.canonicalIssuer.getId(ue):(Q.hasId(ue)||U.push(ue),E+=Q.getId(ue)),0!==I.length&&E>I){ie=!0;break}if(!ie){for(const ue of U){const ee=yield v.hashNDegreeQuads(ue,Q);if(E+=Q.getId(ue),E+=`<${ee.hash}>`,Q=ee.issuer,0!==I.length&&E>I){ie=!0;break}}ie||(0===I.length||E`}createHashToRelated(R,A){var v=this;return gt(function*(){const y=new Map,w=v.blankNodeInfo.get(R).quads;let D=0;for(const j of w)++D%100==0&&(yield v._yield()),yield Promise.all([v._addRelatedBlankNodeHash({quad:j,component:j.subject,position:"s",id:R,issuer:A,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.object,position:"o",id:R,issuer:A,hashToRelated:y}),v._addRelatedBlankNodeHash({quad:j,component:j.graph,position:"g",id:R,issuer:A,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:R,hashToBlankNodes:A}){var v=this;return gt(function*(){const y=yield v.hashFirstDegreeQuads(R),w=A.get(y);w?w.push(R):A.set(y,[R])})()}_addBlankNodeQuadInfo({quad:R,component:A}){if("BlankNode"!==A.termType)return;const v=A.value,y=this.blankNodeInfo.get(v);y?y.quads.add(R):this.blankNodeInfo.set(v,{quads:new Set([R]),hash:null})}_addRelatedBlankNodeHash({quad:R,component:A,position:v,id:y,issuer:w,hashToRelated:D}){var j=this;return gt(function*(){if("BlankNode"!==A.termType||A.value===y)return;const I=A.value,H=yield j.hashRelatedBlankNode(I,R,w,v),K=D.get(H);K?K.push(I):D.set(H,[I])})()}_useCanonicalId({component:R}){return"BlankNode"!==R.termType||R.value.startsWith(this.canonicalIssuer.prefix)?R:{termType:"BlankNode",value:this.canonicalIssuer.getId(R.value)}}_yield(){return gt(function*(){return new Promise(R=>W(R))})()}}}).call(this)}).call(this,Y("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(Y,Ae,he){"use strict";const W=Y("./IdentifierIssuer"),V=Y("./MessageDigest"),L=Y("./Permuter"),re=Y("./NQuads");function $(b,S){return b.hashS.hash?1:0}Ae.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(S){this.quads=S;for(const D of S)this._addBlankNodeQuadInfo({quad:D,component:D.subject}),this._addBlankNodeQuadInfo({quad:D,component:D.object}),this._addBlankNodeQuadInfo({quad:D,component:D.graph});const R=new Map,A=[...this.blankNodeInfo.keys()];for(const D of A)this._hashAndTrackBlankNode({id:D,hashToBlankNodes:R});const v=[...R.keys()].sort(),y=[];for(const D of v){const j=R.get(D);j.length>1?y.push(j):this.canonicalIssuer.getId(j[0])}for(const D of y){const j=[];for(const I of D){if(this.canonicalIssuer.hasId(I))continue;const H=new W("_:b");H.getId(I);const K=this.hashNDegreeQuads(I,H);j.push(K)}j.sort($);for(const I of j){const H=I.issuer.getOldIds();for(const K of H)this.canonicalIssuer.getId(K)}}const w=[];for(const D of this.quads){const j=ht({},D);j.subject=this._useCanonicalId({component:j.subject}),j.object=this._useCanonicalId({component:j.object}),j.graph=this._useCanonicalId({component:j.graph}),w.push(re.serializeQuad(j))}return w.sort(),w.join("")}hashFirstDegreeQuads(S){const R=[],A=this.blankNodeInfo.get(S),v=A.quads;for(const w of v){const D={subject:null,predicate:w.predicate,object:null,graph:null};D.subject=this.modifyFirstDegreeComponent(S,w.subject,"subject"),D.object=this.modifyFirstDegreeComponent(S,w.object,"object"),D.graph=this.modifyFirstDegreeComponent(S,w.graph,"graph"),R.push(re.serializeQuad(D))}R.sort();const y=new V(this.hashAlgorithm);for(const w of R)y.update(w);return A.hash=y.digest(),A.hash}hashRelatedBlankNode(S,R,A,v){let y;y=this.canonicalIssuer.hasId(S)?this.canonicalIssuer.getId(S):A.hasId(S)?A.getId(S):this.blankNodeInfo.get(S).hash;const w=new V(this.hashAlgorithm);return w.update(v),"g"!==v&&w.update(this.getRelatedPredicate(R)),w.update(y),w.digest()}hashNDegreeQuads(S,R){const A=new V(this.hashAlgorithm),v=this.createHashToRelated(S,R),y=[...v.keys()].sort();for(const w of y){A.update(w);let j,D="";const I=new L(v.get(w));for(;I.hasNext();){const H=I.next();let K=R.clone(),M="";const F=[];let Q=!1;for(const E of H)if(this.canonicalIssuer.hasId(E)?M+=this.canonicalIssuer.getId(E):(K.hasId(E)||F.push(E),M+=K.getId(E)),0!==D.length&&M>D){Q=!0;break}if(!Q){for(const E of F){const U=this.hashNDegreeQuads(E,K);if(M+=K.getId(E),M+=`<${U.hash}>`,K=U.issuer,0!==D.length&&M>D){Q=!0;break}}Q||(0===D.length||M`}createHashToRelated(S,R){const A=new Map,v=this.blankNodeInfo.get(S).quads;for(const y of v)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:S,issuer:R,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:S,issuer:R,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:S,issuer:R,hashToRelated:A});return A}_hashAndTrackBlankNode({id:S,hashToBlankNodes:R}){const A=this.hashFirstDegreeQuads(S),v=R.get(A);v?v.push(S):R.set(A,[S])}_addBlankNodeQuadInfo({quad:S,component:R}){if("BlankNode"!==R.termType)return;const A=R.value,v=this.blankNodeInfo.get(A);v?v.quads.add(S):this.blankNodeInfo.set(A,{quads:new Set([S]),hash:null})}_addRelatedBlankNodeHash({quad:S,component:R,position:A,id:v,issuer:y,hashToRelated:w}){if("BlankNode"!==R.termType||R.value===v)return;const D=R.value,j=this.hashRelatedBlankNode(D,S,y,A),I=w.get(j);I?I.push(D):w.set(j,[D])}_useCanonicalId({component:S}){return"BlankNode"!==S.termType||S.value.startsWith(this.canonicalIssuer.prefix)?S:{termType:"BlankNode",value:this.canonicalIssuer.getId(S.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015");Ae.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){var $=this;return gt(function*(){const b=new Map,S=$.blankNodeInfo.get(L).quads;let R=0;for(const A of S){let v,y;if("BlankNode"===A.subject.termType&&A.subject.value!==L)y=A.subject.value,v="p";else{if("BlankNode"!==A.object.termType||A.object.value===L)continue;y=A.object.value,v="r"}++R%100==0&&(yield $._yield());const w=yield $.hashRelatedBlankNode(y,A,re,v),D=b.get(w);D?D.push(y):b.set(w,[y])}return b})()}}},{"./URDNA2015":51}],54:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015Sync");Ae.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(L,re,$){return"BlankNode"!==re.termType?re:"graph"===$?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:re.value===L?"_:a":"_:z"}}getRelatedPredicate(L){return L.predicate.value}createHashToRelated(L,re){const $=new Map,b=this.blankNodeInfo.get(L).quads;for(const S of b){let R,A;if("BlankNode"===S.subject.termType&&S.subject.value!==L)A=S.subject.value,R="p";else{if("BlankNode"!==S.object.termType||S.object.value===L)continue;A=S.object.value,R="r"}const v=this.hashRelatedBlankNode(A,S,re,R),y=$.get(v);y?y.push(A):$.set(v,[A])}return $}}},{"./URDNA2015Sync":52}],55:[function(Y,Ae,he){"use strict";const W=Y("./URDNA2015"),V=Y("./URGNA2012"),L=Y("./URDNA2015Sync"),re=Y("./URGNA2012Sync");let $;try{$=Y("rdf-canonize-native")}catch(S){}const b={};Ae.exports=b,b.NQuads=Y("./NQuads"),b.IdentifierIssuer=Y("./IdentifierIssuer"),b._rdfCanonizeNative=function(S){return S&&($=S),$},b.canonize=function(){var S=gt(function*(R,A){if(Array.isArray(R)||(R=b.NQuads.legacyDatasetToQuads(R)),A.useNative){if(!$)throw new Error("rdf-canonize-native not available");return new Promise((v,y)=>$.canonize(R,A,(w,D)=>w?y(w):v(D)))}if("URDNA2015"===A.algorithm)return new W(A).main(R);if("URGNA2012"===A.algorithm)return new V(A).main(R);throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(R,A){return S.apply(this,arguments)}}(),b._canonizeSync=function(S,R){if(Array.isArray(S)||(S=b.NQuads.legacyDatasetToQuads(S)),R.useNative){if($)return $.canonizeSync(S,R);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===R.algorithm)return new L(R).main(S);if("URGNA2012"===R.algorithm)return new re(R).main(S);throw"algorithm"in R?new Error("Invalid RDF Dataset Canonicalization algorithm: "+R.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(Y,Ae,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&W(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(Y("./lib/BlankNode"),he),V(Y("./lib/DataFactory"),he),V(Y("./lib/DefaultGraph"),he),V(Y("./lib/Literal"),he),V(Y("./lib/NamedNode"),he),V(Y("./lib/Quad"),he),V(Y("./lib/Variable"),he)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(L){this.termType="BlankNode",this.value=L}equals(L){return!!L&&"BlankNode"===L.termType&&L.value===this.value}}},{}],58:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),V=Y("./DefaultGraph"),L=Y("./Literal"),re=Y("./NamedNode"),$=Y("./Quad"),b=Y("./Variable");let S=0;he.DataFactory=class{constructor(v){this.blankNodeCounter=0,this.blankNodePrefix=(v=v||{}).blankNodePrefix||`df_${S++}_`}namedNode(v){return new re.NamedNode(v)}blankNode(v){return new W.BlankNode(v||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(v,y){return new L.Literal(v,y)}variable(v){return new b.Variable(v)}defaultGraph(){return V.DefaultGraph.INSTANCE}quad(v,y,w,D){return new $.Quad(v,y,w,D||this.defaultGraph())}fromTerm(v){switch(v.termType){case"NamedNode":return this.namedNode(v.value);case"BlankNode":return this.blankNode(v.value);case"Literal":return v.language?this.literal(v.value,v.language):v.datatype.equals(L.Literal.XSD_STRING)?this.literal(v.value):this.literal(v.value,this.fromTerm(v.datatype));case"Variable":return this.variable(v.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(v.subject),this.fromTerm(v.predicate),this.fromTerm(v.object),this.fromTerm(v.graph))}}fromQuad(v){return this.fromTerm(v)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(L){return!!L&&"DefaultGraph"===L.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class V{constructor(re,$){this.termType="Literal",this.value=re,"string"==typeof $?(this.language=$,this.datatype=V.RDF_LANGUAGE_STRING):$?(this.language="",this.datatype=$):(this.language="",this.datatype=V.XSD_STRING)}equals(re){return!!re&&"Literal"===re.termType&&re.value===this.value&&re.language===this.language&&re.datatype.equals(this.datatype)}}he.Literal=V,V.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),V.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(L){this.termType="NamedNode",this.value=L}equals(L){return!!L&&"NamedNode"===L.termType&&L.value===this.value}}},{}],62:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(L,re,$,b){this.termType="Quad",this.value="",this.subject=L,this.predicate=re,this.object=$,this.graph=b}equals(L){return!!L&&("Quad"===L.termType||!L.termType)&&this.subject.equals(L.subject)&&this.predicate.equals(L.predicate)&&this.object.equals(L.object)&&this.graph.equals(L.graph)}}},{}],63:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(L){this.termType="Variable",this.value=L}equals(L){return!!L&&"Variable"===L.termType&&L.value===this.value}}},{}],64:[function(Y,Ae,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(L,re,$,b){void 0===b&&(b=$),Object.defineProperty(L,b,{enumerable:!0,get:function(){return re[$]}})}:function(L,re,$,b){void 0===b&&(b=$),L[b]=re[$]}),V=this&&this.__exportStar||function(L,re){for(var $ in L)"default"!==$&&!Object.prototype.hasOwnProperty.call(re,$)&&W(re,L,$)};Object.defineProperty(he,"__esModule",{value:!0}),V(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(L,re){const $=L.saxStream._parser;super(L.trackPosition?`Line ${$.line+1} column ${$.column+1}: ${re}`:re)}}he.ParseError=W},{}],66:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),V=Y("sax"),L=Y("stream"),re=Y("./ParseError"),$=Y("rdf-data-factory");class b extends L.Transform{constructor(A){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},A&&(Object.assign(this,A),this.options=A),this.dataFactory||(this.dataFactory=new $.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=V.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(A,v){const y={};let w=!1;for(const j in A.attributes)j.startsWith("xmlns")&&(5===j.length?(w=!0,y[""]=A.attributes[j]):":"===j.charAt(5)&&(w=!0,y[j.substr(6)]=A.attributes[j]));const D=v&&v.ns?v.ns:[b.DEFAULT_NS];return w?D.concat([y]):D}static expandPrefixedTerm(A,v,y){const w=A.indexOf(":");let D,j;w>=0?(D=A.substr(0,w),j=A.substr(w+1)):(D="",j=A);let I=null,H=null;for(let K=v.length-1;K>=0;K--){const M=v[K][D];if(M){I=M;break}H||(H=v[K][""])}if(!I){if(D&&"xmlns"!==D)throw new re.ParseError(y,`The prefix '${D}' in term '${A}' was not bound.`);I=H||""}return{prefix:D,local:j,uri:I}}static isValidIri(A){return b.IRI_REGEX.test(A)}import(A){const v=new L.PassThrough({readableObjectMode:!0});A.on("error",w=>y.emit("error",w)),A.on("data",w=>v.push(w)),A.on("end",()=>v.push(null));const y=v.pipe(new b(this.options));return y}_transform(A,v,y){try{this.saxStream.write(A,v)}catch(w){return y(w)}y()}newParseError(A){return new re.ParseError(this,A)}valueToUri(A,v){return this.uriToNamedNode(W.resolve(A,v.baseIRI))}uriToNamedNode(A){if(!b.isValidIri(A))throw this.newParseError(`Invalid URI: ${A}`);return this.dataFactory.namedNode(A)}validateNcname(A){if(!b.NCNAME_MATCHER.test(A))throw this.newParseError(`Not a valid NCName: ${A}`)}attachSaxListeners(){this.saxStream.on("error",A=>this.emit("error",A)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(A){const v=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=S.RESOURCE;if(v&&(v.hadChildren=!0,y=v.childrenParseType),v&&v.childrenStringTags){const D=A.name;let j="";for(const M in A.attributes)j+=` ${M}="${A.attributes[M]}"`;v.childrenStringTags.push(`<${D}${j}>`);const K={childrenStringTags:v.childrenStringTags};return K.childrenStringEmitClosingTag=``,void this.activeTagStack.push(K)}const w={};v?(w.language=v.language,w.baseIRI=v.baseIRI):w.baseIRI=this.baseIRI,this.activeTagStack.push(w),w.ns=b.parseNamespace(A,v),y===S.RESOURCE?this.onTagResource(A,w,v,!v):this.onTagProperty(A,w,v)}onTagResource(A,v,y,w){const D=b.expandPrefixedTerm(A.name,v.ns,this);v.childrenParseType=S.PROPERTY;let j=!0;if(D.uri===b.RDF){if(!w&&b.FORBIDDEN_NODE_ELEMENTS.indexOf(D.local)>=0)throw this.newParseError(`Illegal node element name: ${D.local}`);switch(D.local){case"RDF":v.childrenParseType=S.RESOURCE;case"Description":j=!1}}const I=[],H=[];let K=null,M=!1,F=!1,Q=null;for(const E in A.attributes){const U=A.attributes[E],ie=b.expandPrefixedTerm(E,v.ns,this);if(y&&ie.uri===b.RDF)switch(ie.local){case"about":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);K=U;continue;case"ID":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);this.validateNcname(U),K="#"+U,M=!0;continue;case"nodeID":if(K)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${U} and ${K} where found.`);this.validateNcname(U),K=U,F=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":Q=U;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(ie.uri===b.XML){if("lang"===ie.local){v.language=""===U?null:U.toLowerCase();continue}if("base"===ie.local){v.baseIRI=W.resolve(U,v.baseIRI);continue}}"xml"!==ie.prefix&&ie.uri&&(I.push(this.uriToNamedNode(ie.uri+ie.local)),H.push(U))}if(null!==K&&(v.subject=F?this.dataFactory.blankNode(K):this.valueToUri(K,v),M&&this.claimNodeId(v.subject)),v.subject||(v.subject=this.dataFactory.blankNode()),j){const E=this.uriToNamedNode(D.uri+D.local);this.emitTriple(v.subject,this.dataFactory.namedNode(b.RDF+"type"),E,y?y.reifiedStatementId:null)}if(y){if(y.predicate)if(y.childrenCollectionSubject){const E=this.dataFactory.blankNode();this.emitTriple(y.childrenCollectionSubject,y.childrenCollectionPredicate,E,y.reifiedStatementId),this.emitTriple(E,this.dataFactory.namedNode(b.RDF+"first"),v.subject,v.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(b.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,v.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${w.local}`);v.predicateSubPredicates=[],v.predicateSubObjects=[];let D=!1,j=!1,I=null,H=!0;const K=[],M=[];for(const F in A.attributes){const Q=A.attributes[F],E=b.expandPrefixedTerm(F,v.ns,this);if(E.uri===b.RDF)switch(E.local){case"resource":if(I)throw this.newParseError(`Found both rdf:resource (${Q}) and rdf:nodeID (${I}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${Q})`);v.hadChildren=!0,I=Q,H=!1;continue;case"datatype":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${Q}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${Q})`);v.datatype=this.valueToUri(Q,v);continue;case"nodeID":if(j)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${Q}).`);if(v.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${Q}).`);if(D)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${Q})`);this.validateNcname(Q),v.hadChildren=!0,I=Q,H=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(j)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(v.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${v.datatype.value})`);if(I)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${I})`);if("Resource"===Q){D=!0,v.childrenParseType=S.PROPERTY;const U=this.dataFactory.blankNode();this.emitTriple(v.subject,v.predicate,U,v.reifiedStatementId),v.subject=U,v.predicate=null}else"Collection"===Q?(D=!0,v.hadChildren=!0,v.childrenCollectionSubject=v.subject,v.childrenCollectionPredicate=v.predicate,H=!1):"Literal"===Q&&(D=!0,v.childrenTagsToString=!0,v.childrenStringTags=[]);continue;case"ID":this.validateNcname(Q),v.reifiedStatementId=this.valueToUri("#"+Q,v),this.claimNodeId(v.reifiedStatementId);continue}else if(E.uri===b.XML&&"lang"===E.local){v.language=""===Q?null:Q.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(D||v.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${Q}`);v.hadChildren=!0,j=!0,K.push(this.uriToNamedNode(E.uri+E.local)),M.push(this.dataFactory.literal(Q,v.datatype||v.language))}}if(null!==I){const F=v.subject;v.subject=H?this.dataFactory.blankNode(I):this.valueToUri(I,v),this.emitTriple(F,v.predicate,v.subject,v.reifiedStatementId);for(let Q=0;Q/g,(v,y,w)=>(this.saxStream._parser.ENTITIES[y]=w,""))}}var S,R;he.RdfXmlParser=b,b.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,b.MIME_TYPE="application/rdf+xml",b.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",b.XML="http://www.w3.org/XML/1998/namespace",b.XMLNS="http://www.w3.org/2000/xmlns/",b.DEFAULT_NS={xml:b.XML},b.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],b.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],b.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,(R=S=he.ParseType||(he.ParseType={}))[R.RESOURCE=0]="RESOURCE",R[R.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(Y,Ae,he){"use strict";var V={};function L(R,A,v){v||(v=Error);var w=function(D){function j(I,H,K){return D.call(this,function(D,j,I){return"string"==typeof A?A:A(D,j,I)}(I,H,K))||this}return function(R,A){R.prototype=Object.create(A.prototype),R.prototype.constructor=R,R.__proto__=A}(j,D),j}(v);w.prototype.name=v.name,w.prototype.code=R,V[R]=w}function re(R,A){if(Array.isArray(R)){var v=R.length;return R=R.map(function(y){return String(y)}),v>2?"one of ".concat(A," ").concat(R.slice(0,v-1).join(", "),", or ")+R[v-1]:2===v?"one of ".concat(A," ").concat(R[0]," or ").concat(R[1]):"of ".concat(A," ").concat(R[0])}return"of ".concat(A," ").concat(String(R))}L("ERR_INVALID_OPT_VALUE",function(R,A){return'The value "'+A+'" is invalid for option "'+R+'"'},TypeError),L("ERR_INVALID_ARG_TYPE",function(R,A,v){var y,w;if("string"==typeof A&&function(R,A,v){return R.substr(!v||v<0?0:+v,A.length)===A}(A,"not ")?(y="must not be",A=A.replace(/^not /,"")):y="must be",function(R,A,v){return(void 0===v||v>R.length)&&(v=R.length),R.substring(v-A.length,v)===A}(R," argument"))w="The ".concat(R," ").concat(y," ").concat(re(A,"type"));else{var D=function(R,A,v){return"number"!=typeof v&&(v=0),!(v+A.length>R.length)&&-1!==R.indexOf(A,v)}(R,".")?"property":"argument";w='The "'.concat(R,'" ').concat(D," ").concat(y," ").concat(re(A,"type"))}return w+". Received type ".concat(typeof v)},TypeError),L("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),L("ERR_METHOD_NOT_IMPLEMENTED",function(R){return"The "+R+" method is not implemented"}),L("ERR_STREAM_PREMATURE_CLOSE","Premature close"),L("ERR_STREAM_DESTROYED",function(R){return"Cannot call "+R+" after a stream was destroyed"}),L("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),L("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),L("ERR_STREAM_WRITE_AFTER_END","write after end"),L("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),L("ERR_UNKNOWN_ENCODING",function(R){return"Unknown encoding: "+R},TypeError),L("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.exports.codes=V},{}],68:[function(Y,Ae,he){(function(W){(function(){"use strict";var V=Object.keys||function(y){var w=[];for(var D in y)w.push(D);return w};Ae.exports=R;var L=Y("./_stream_readable"),re=Y("./_stream_writable");Y("inherits")(R,L);for(var $=V(re.prototype),b=0;b<$.length;b++){var S=$[b];R.prototype[S]||(R.prototype[S]=re.prototype[S])}function R(y){if(!(this instanceof R))return new R(y);L.call(this,y),re.call(this,y),this.allowHalfOpen=!0,y&&(!1===y.readable&&(this.readable=!1),!1===y.writable&&(this.writable=!1),!1===y.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",A)))}function A(){this._writableState.ended||W.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(w){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=w,this._writableState.destroyed=w)}})}).call(this)}).call(this,Y("_process"))},{"./_stream_readable":70,"./_stream_writable":72,_process:44,inherits:10}],69:[function(Y,Ae,he){"use strict";Ae.exports=V;var W=Y("./_stream_transform");function V(L){if(!(this instanceof V))return new V(L);W.call(this,L)}Y("inherits")(V,W),V.prototype._transform=function(L,re,$){$(null,L)}},{"./_stream_transform":71,inherits:10}],70:[function(Y,Ae,he){(function(W,V){(function(){"use strict";var L;Ae.exports=te,te.ReadableState=me,Y("events");var $=function(B,O){return B.listeners(O).length},b=Y("./internal/streams/stream"),S=Y("buffer").Buffer,R=V.Uint8Array||function(){};var w,y=Y("util");w=y&&y.debuglog?y.debuglog("stream"):function(){};var U,ie,ue,D=Y("./internal/streams/buffer_list"),j=Y("./internal/streams/destroy"),H=Y("./internal/streams/state").getHighWaterMark,K=Y("../errors").codes,M=K.ERR_INVALID_ARG_TYPE,F=K.ERR_STREAM_PUSH_AFTER_EOF,Q=K.ERR_METHOD_NOT_IMPLEMENTED,E=K.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Y("inherits")(te,b);var ee=j.errorOrDestroy,se=["error","close","destroy","pause","resume"];function me(pe,B,O){L=L||Y("./_stream_duplex"),"boolean"!=typeof O&&(O=B instanceof L),this.objectMode=!!(pe=pe||{}).objectMode,O&&(this.objectMode=this.objectMode||!!pe.readableObjectMode),this.highWaterMark=H(this,pe,"readableHighWaterMark",O),this.buffer=new D,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==pe.emitClose,this.autoDestroy=!!pe.autoDestroy,this.destroyed=!1,this.defaultEncoding=pe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,pe.encoding&&(U||(U=Y("string_decoder/").StringDecoder),this.decoder=new U(pe.encoding),this.encoding=pe.encoding)}function te(pe){if(L=L||Y("./_stream_duplex"),!(this instanceof te))return new te(pe);this._readableState=new me(pe,this,this instanceof L),this.readable=!0,pe&&("function"==typeof pe.read&&(this._read=pe.read),"function"==typeof pe.destroy&&(this._destroy=pe.destroy)),b.call(this)}function ye(pe,B,O,k,Re){w("readableAddChunk",B);var yt,Xe=pe._readableState;if(null===B)Xe.reading=!1,function(pe,B){if(w("onEofChunk"),!B.ended){if(B.decoder){var O=B.decoder.end();O&&O.length&&(B.buffer.push(O),B.length+=B.objectMode?1:O.length)}B.ended=!0,B.sync?je(pe):(B.needReadable=!1,B.emittedReadable||(B.emittedReadable=!0,Le(pe)))}}(pe,Xe);else if(Re||(yt=function(pe,B){var O;return!function(pe){return S.isBuffer(pe)||pe instanceof R}(B)&&"string"!=typeof B&&void 0!==B&&!pe.objectMode&&(O=new M("chunk",["string","Buffer","Uint8Array"],B)),O}(Xe,B)),yt)ee(pe,yt);else if(Xe.objectMode||B&&B.length>0)if("string"!=typeof B&&!Xe.objectMode&&Object.getPrototypeOf(B)!==S.prototype&&(B=function(pe){return S.from(pe)}(B)),k)Xe.endEmitted?ee(pe,new E):Me(pe,Xe,B,!0);else if(Xe.ended)ee(pe,new F);else{if(Xe.destroyed)return!1;Xe.reading=!1,Xe.decoder&&!O?(B=Xe.decoder.write(B),Xe.objectMode||0!==B.length?Me(pe,Xe,B,!1):Ee(pe,Xe)):Me(pe,Xe,B,!1)}else k||(Xe.reading=!1,Ee(pe,Xe));return!Xe.ended&&(Xe.lengthB.highWaterMark&&(B.highWaterMark=function(pe){return pe>=nt?pe=nt:(pe--,pe|=pe>>>1,pe|=pe>>>2,pe|=pe>>>4,pe|=pe>>>8,pe|=pe>>>16,pe++),pe}(pe)),pe<=B.length?pe:B.ended?B.length:(B.needReadable=!0,0))}function je(pe){var B=pe._readableState;w("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(w("emitReadable",B.flowing),B.emittedReadable=!0,W.nextTick(Le,pe))}function Le(pe){var B=pe._readableState;w("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(pe.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,be(pe)}function Ee(pe,B){B.readingMore||(B.readingMore=!0,W.nextTick(Oe,pe,B))}function Oe(pe,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:pe.listenerCount("data")>0&&pe.resume()}function Be(pe){w("readable nexttick read 0"),pe.read(0)}function X(pe,B){w("resume",B.reading),B.reading||pe.read(0),B.resumeScheduled=!1,pe.emit("resume"),be(pe),B.flowing&&!B.reading&&pe.read(0)}function be(pe){var B=pe._readableState;for(w("flow",B.flowing);B.flowing&&null!==pe.read(););}function ce(pe,B){return 0===B.length?null:(B.objectMode?O=B.buffer.shift():!pe||pe>=B.length?(O=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):O=B.buffer.consume(pe,B.decoder),O);var O}function Pe(pe){var B=pe._readableState;w("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,W.nextTick(Et,B,pe))}function Et(pe,B){if(w("endReadableNT",pe.endEmitted,pe.length),!pe.endEmitted&&0===pe.length&&(pe.endEmitted=!0,B.readable=!1,B.emit("end"),pe.autoDestroy)){var O=B._writableState;(!O||O.autoDestroy&&O.finished)&&B.destroy()}}function pt(pe,B){for(var O=0,k=pe.length;O=B.highWaterMark:B.length>0)||B.ended))return w("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?Pe(this):je(this),null;if(0===(pe=Je(pe,B))&&B.ended)return 0===B.length&&Pe(this),null;var Re,k=B.needReadable;return w("need readable",k),(0===B.length||B.length-pe0?ce(pe,B):null)?(B.needReadable=B.length<=B.highWaterMark,pe=0):(B.length-=pe,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),O!==pe&&B.ended&&Pe(this)),null!==Re&&this.emit("data",Re),Re},te.prototype._read=function(pe){ee(this,new Q("_read()"))},te.prototype.pipe=function(pe,B){var O=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=pe;break;case 1:k.pipes=[k.pipes,pe];break;default:k.pipes.push(pe)}k.pipesCount+=1,w("pipe count=%d opts=%j",k.pipesCount,B);var Xe=B&&!1===B.end||pe===W.stdout||pe===W.stderr?as:It;function yt(Os,zr){w("onunpipe"),Os===O&&zr&&!1===zr.hasUnpiped&&(zr.hasUnpiped=!0,w("cleanup"),pe.removeListener("close",Ur),pe.removeListener("finish",Is),pe.removeListener("drain",An),pe.removeListener("error",ci),pe.removeListener("unpipe",yt),O.removeListener("end",It),O.removeListener("end",as),O.removeListener("data",yi),Rn=!0,k.awaitDrain&&(!pe._writableState||pe._writableState.needDrain)&&An())}function It(){w("onend"),pe.end()}k.endEmitted?W.nextTick(Xe):O.once("end",Xe),pe.on("unpipe",yt);var An=function(pe){return function(){var O=pe._readableState;w("pipeOnDrain",O.awaitDrain),O.awaitDrain&&O.awaitDrain--,0===O.awaitDrain&&$(pe,"data")&&(O.flowing=!0,be(pe))}}(O);pe.on("drain",An);var Rn=!1;function yi(Os){w("ondata");var zr=pe.write(Os);w("dest.write",zr),!1===zr&&((1===k.pipesCount&&k.pipes===pe||k.pipesCount>1&&-1!==pt(k.pipes,pe))&&!Rn&&(w("false write response, pause",k.awaitDrain),k.awaitDrain++),O.pause())}function ci(Os){w("onerror",Os),as(),pe.removeListener("error",ci),0===$(pe,"error")&&ee(pe,Os)}function Ur(){pe.removeListener("finish",Is),as()}function Is(){w("onfinish"),pe.removeListener("close",Ur),as()}function as(){w("unpipe"),O.unpipe(pe)}return O.on("data",yi),function(pe,B,O){if("function"==typeof pe.prependListener)return pe.prependListener(B,O);pe._events&&pe._events[B]?Array.isArray(pe._events[B])?pe._events[B].unshift(O):pe._events[B]=[O,pe._events[B]]:pe.on(B,O)}(pe,"error",ci),pe.once("close",Ur),pe.once("finish",Is),pe.emit("pipe",O),k.flowing||(w("pipe resume"),O.resume()),pe},te.prototype.unpipe=function(pe){var B=this._readableState,O={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return pe&&pe!==B.pipes||(pe||(pe=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,pe&&pe.emit("unpipe",this,O)),this;if(!pe){var k=B.pipes,Re=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Xe=0;Xe0,!1!==k.flowing&&this.resume()):"readable"===pe&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,w("on readable",k.length,k.reading),k.length?je(this):k.reading||W.nextTick(Be,this)),O},te.prototype.removeListener=function(pe,B){var O=b.prototype.removeListener.call(this,pe,B);return"readable"===pe&&W.nextTick(qe,this),O},te.prototype.removeAllListeners=function(pe){var B=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===pe||void 0===pe)&&W.nextTick(qe,this),B},te.prototype.resume=function(){var pe=this._readableState;return pe.flowing||(w("resume"),pe.flowing=!pe.readableListening,function(pe,B){B.resumeScheduled||(B.resumeScheduled=!0,W.nextTick(X,pe,B))}(this,pe)),pe.paused=!1,this},te.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},te.prototype.wrap=function(pe){var B=this,O=this._readableState,k=!1;for(var Re in pe.on("end",function(){if(w("wrapped end"),O.decoder&&!O.ended){var yt=O.decoder.end();yt&&yt.length&&B.push(yt)}B.push(null)}),pe.on("data",function(yt){w("wrapped data"),O.decoder&&(yt=O.decoder.write(yt)),O.objectMode&&null==yt||!(O.objectMode||yt&&yt.length)||B.push(yt)||(k=!0,pe.pause())}),pe)void 0===this[Re]&&"function"==typeof pe[Re]&&(this[Re]=function(It){return function(){return pe[It].apply(pe,arguments)}}(Re));for(var Xe=0;Xe-1))throw new ie(ce);return this._writableState.defaultEncoding=ce,this},Object.defineProperty(me.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(me.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),me.prototype._write=function(be,ce,Pe){Pe(new K("_write()"))},me.prototype._writev=null,me.prototype.end=function(be,ce,Pe){var Et=this._writableState;return"function"==typeof be?(Pe=be,be=null,ce=null):"function"==typeof ce&&(Pe=ce,ce=null),null!=be&&this.write(be,ce),Et.corked&&(Et.corked=1,this.uncork()),Et.ending||function(be,ce,Pe){ce.ending=!0,Be(be,ce),Pe&&(ce.finished?W.nextTick(Pe):be.once("finish",Pe)),ce.ended=!0,be.writable=!1}(this,Et,Pe),this},Object.defineProperty(me.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(ce){!this._writableState||(this._writableState.destroyed=ce)}}),me.prototype.destroy=w.destroy,me.prototype._undestroy=w.undestroy,me.prototype._destroy=function(be,ce){ce(be)}}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(Y,Ae,he){(function(W){(function(){"use strict";var V;function L(F,Q,E){return Q in F?Object.defineProperty(F,Q,{value:E,enumerable:!0,configurable:!0,writable:!0}):F[Q]=E,F}var re=Y("./end-of-stream"),$=Symbol("lastResolve"),b=Symbol("lastReject"),S=Symbol("error"),R=Symbol("ended"),A=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function w(F,Q){return{value:F,done:Q}}function D(F){var Q=F[$];if(null!==Q){var E=F[y].read();null!==E&&(F[A]=null,F[$]=null,F[b]=null,Q(w(E,!1)))}}function j(F){W.nextTick(D,F)}var H=Object.getPrototypeOf(function(){}),K=Object.setPrototypeOf((L(V={get stream(){return this[y]},next:function(){var Q=this,E=this[S];if(null!==E)return Promise.reject(E);if(this[R])return Promise.resolve(w(void 0,!0));if(this[y].destroyed)return new Promise(function(ee,se){W.nextTick(function(){Q[S]?se(Q[S]):ee(w(void 0,!0))})});var ie,U=this[A];if(U)ie=new Promise(function(F,Q){return function(E,U){F.then(function(){Q[R]?E(w(void 0,!0)):Q[v](E,U)},U)}}(U,this));else{var ue=this[y].read();if(null!==ue)return Promise.resolve(w(ue,!1));ie=new Promise(this[v])}return this[A]=ie,ie}},Symbol.asyncIterator,function(){return this}),L(V,"return",function(){var Q=this;return new Promise(function(E,U){Q[y].destroy(null,function(ie){ie?U(ie):E(w(void 0,!0))})})}),V),H);Ae.exports=function(Q){var E,U=Object.create(K,(L(E={},y,{value:Q,writable:!0}),L(E,$,{value:null,writable:!0}),L(E,b,{value:null,writable:!0}),L(E,S,{value:null,writable:!0}),L(E,R,{value:Q._readableState.endEmitted,writable:!0}),L(E,v,{value:function(ue,ee){var se=U[y].read();se?(U[A]=null,U[$]=null,U[b]=null,ue(w(se,!1))):(U[$]=ue,U[b]=ee)},writable:!0}),E));return U[A]=null,re(Q,function(ie){if(ie&&"ERR_STREAM_PREMATURE_CLOSE"!==ie.code){var ue=U[b];return null!==ue&&(U[A]=null,U[$]=null,U[b]=null,ue(ie)),void(U[S]=ie)}var ee=U[$];null!==ee&&(U[A]=null,U[$]=null,U[b]=null,ee(w(void 0,!0))),U[R]=!0}),Q.on("readable",j.bind(null,U)),U}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Ae,he){"use strict";function W(D,j){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(D);j&&(H=H.filter(function(K){return Object.getOwnPropertyDescriptor(D,K).enumerable})),I.push.apply(I,H)}return I}function L(D,j,I){return j in D?Object.defineProperty(D,j,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[j]=I,D}function $(D,j){for(var I=0;I0?this.tail.next=H:this.head=H,this.tail=H,++this.length}},{key:"unshift",value:function(I){var H={data:I,next:this.head};0===this.length&&(this.tail=H),this.head=H,++this.length}},{key:"shift",value:function(){if(0!==this.length){var I=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,I}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(I){if(0===this.length)return"";for(var H=this.head,K=""+H.data;H=H.next;)K+=I+H.data;return K}},{key:"concat",value:function(I){if(0===this.length)return R.alloc(0);for(var H=R.allocUnsafe(I>>>0),K=this.head,M=0;K;)w(K.data,H,M),M+=K.data.length,K=K.next;return H}},{key:"consume",value:function(I,H){var K;return IF.length?F.length:I;if(M+=Q===F.length?F:F.slice(0,I),0==(I-=Q)){Q===F.length?(++K,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=F.slice(Q));break}++K}return this.length-=K,M}},{key:"_getBuffer",value:function(I){var H=R.allocUnsafe(I),K=this.head,M=1;for(K.data.copy(H),I-=K.data.length;K=K.next;){var F=K.data,Q=I>F.length?F.length:I;if(F.copy(H,H.length-I,0,Q),0==(I-=Q)){Q===F.length?(++M,this.head=K.next?K.next:this.tail=null):(this.head=K,K.data=F.slice(Q));break}++M}return this.length-=M,H}},{key:y,value:function(I,H){return v(this,function(D){for(var j=1;j0,function(ie){K||(K=ie),ie&&M.forEach(A),!E&&(M.forEach(A),H(K))})});return j.reduce(v)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Ae,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Ae.exports={getHighWaterMark:function(re,$,b,S){var R=function(re,$,b){return null!=re.highWaterMark?re.highWaterMark:$?re[b]:null}($,S,b);if(null!=R){if(!isFinite(R)||Math.floor(R)!==R||R<0)throw new W(S?b:"highWaterMark",R);return Math.floor(R)}return re.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Ae,he){Ae.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Ae,he){(he=Ae.exports=Y("./lib/_stream_readable.js")).Stream=he,he.Readable=he,he.Writable=Y("./lib/_stream_writable.js"),he.Duplex=Y("./lib/_stream_duplex.js"),he.Transform=Y("./lib/_stream_transform.js"),he.PassThrough=Y("./lib/_stream_passthrough.js"),he.finished=Y("./lib/internal/streams/end-of-stream.js"),he.pipeline=Y("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(Y,Ae,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(V){for(var L in V)he.hasOwnProperty(L)||(he[L]=V[L])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Ae,he){"use strict";function V($){const b=[];let S=0;for(;S<$.length;)switch($[S]){case"/":if("."===$[S+1])if("."===$[S+2]){if(!re($[S+3])){b.push([]),S++;break}b.pop(),$[S+3]||b.push([]),S+=3}else{if(!re($[S+2])){b.push([]),S++;break}$[S+2]||b.push([]),S+=2}else b.push([]),S++;break;case"#":case"?":b.length||b.push([]),b[b.length-1].push($.substr(S)),S=$.length;break;default:b.length||b.push([]),b[b.length-1].push($[S]),S++}return"/"+b.map(R=>R.join("")).join("/")}function L($,b){let S=b+1;b>=0?"/"===$[b+1]&&"/"===$[b+2]&&(S=b+3):"/"===$[0]&&"/"===$[1]&&(S=2);const R=$.indexOf("/",S);return R<0?$:$.substr(0,R)+V($.substr(R))}function re($){return!$||"#"===$||"?"===$||"/"===$}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function($,b){const S=(b=b||"").indexOf("#");if(S>0&&(b=b.substr(0,S)),!$.length){if(b.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);return b}if($.startsWith("?")){const j=b.indexOf("?");return j>0&&(b=b.substr(0,j)),b+$}if($.startsWith("#"))return b+$;if(!b.length){const j=$.indexOf(":");if(j<0)throw new Error(`Found invalid relative IRI '${$}' for a missing baseIRI`);return L($,j)}const R=$.indexOf(":");if(R>=0)return L($,R);const A=b.indexOf(":");if(A<0)throw new Error(`Found invalid baseIRI '${b}' for value '${$}'`);const v=b.substr(0,A+1);if(0===$.indexOf("//"))return v+L($,R);let y;if(b.indexOf("//",A)===A+1){if(y=b.indexOf("/",A+3),y<0)return b.length>A+3?b+"/"+L($,R):v+L($,R)}else if(y=b.indexOf("/",A+1),y<0)return v+L($,R);if(0===$.indexOf("/"))return b.substr(0,y)+V($);let w=b.substr(y);const D=w.lastIndexOf("/");return D>=0&&D"===ce?(te(X,"onsgmldeclaration",X.sgmlDecl),X.sgmlDecl="",X.state=se.TEXT):(U(ce)&&(X.state=se.SGML_DECL_QUOTED),X.sgmlDecl+=ce);continue;case se.SGML_DECL_QUOTED:ce===X.q&&(X.state=se.SGML_DECL,X.q=""),X.sgmlDecl+=ce;continue;case se.DOCTYPE:">"===ce?(X.state=se.TEXT,te(X,"ondoctype",X.doctype),X.doctype=!0):(X.doctype+=ce,"["===ce?X.state=se.DOCTYPE_DTD:U(ce)&&(X.state=se.DOCTYPE_QUOTED,X.q=ce));continue;case se.DOCTYPE_QUOTED:X.doctype+=ce,ce===X.q&&(X.q="",X.state=se.DOCTYPE);continue;case se.DOCTYPE_DTD:X.doctype+=ce,"]"===ce?X.state=se.DOCTYPE:U(ce)&&(X.state=se.DOCTYPE_DTD_QUOTED,X.q=ce);continue;case se.DOCTYPE_DTD_QUOTED:X.doctype+=ce,ce===X.q&&(X.state=se.DOCTYPE_DTD,X.q="");continue;case se.COMMENT:"-"===ce?X.state=se.COMMENT_ENDING:X.comment+=ce;continue;case se.COMMENT_ENDING:"-"===ce?(X.state=se.COMMENT_ENDED,X.comment=Me(X.opt,X.comment),X.comment&&te(X,"oncomment",X.comment),X.comment=""):(X.comment+="-"+ce,X.state=se.COMMENT);continue;case se.COMMENT_ENDED:">"!==ce?(Ze(X,"Malformed comment"),X.comment+="--"+ce,X.state=se.COMMENT):X.state=se.TEXT;continue;case se.CDATA:"]"===ce?X.state=se.CDATA_ENDING:X.cdata+=ce;continue;case se.CDATA_ENDING:"]"===ce?X.state=se.CDATA_ENDING_2:(X.cdata+="]"+ce,X.state=se.CDATA);continue;case se.CDATA_ENDING_2:">"===ce?(X.cdata&&te(X,"oncdata",X.cdata),te(X,"onclosecdata"),X.cdata="",X.state=se.TEXT):"]"===ce?X.cdata+="]":(X.cdata+="]]"+ce,X.state=se.CDATA);continue;case se.PROC_INST:"?"===ce?X.state=se.PROC_INST_ENDING:E(ce)?X.state=se.PROC_INST_BODY:X.procInstName+=ce;continue;case se.PROC_INST_BODY:if(!X.procInstBody&&E(ce))continue;"?"===ce?X.state=se.PROC_INST_ENDING:X.procInstBody+=ce;continue;case se.PROC_INST_ENDING:">"===ce?(te(X,"onprocessinginstruction",{name:X.procInstName,body:X.procInstBody}),X.procInstName=X.procInstBody="",X.state=se.TEXT):(X.procInstBody+="?"+ce,X.state=se.PROC_INST_BODY);continue;case se.OPEN_TAG:ue(M,ce)?X.tagName+=ce:(Je(X),">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:(E(ce)||Ze(X,"Invalid character in tag name"),X.state=se.ATTRIB));continue;case se.OPEN_TAG_SLASH:">"===ce?(Le(X,!0),Ee(X)):(Ze(X,"Forward-slash in opening tag not followed by >"),X.state=se.ATTRIB);continue;case se.ATTRIB:if(E(ce))continue;">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(K,ce)?(X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME:"="===ce?X.state=se.ATTRIB_VALUE:">"===ce?(Ze(X,"Attribute without value"),X.attribValue=X.attribName,je(X),Le(X)):E(ce)?X.state=se.ATTRIB_NAME_SAW_WHITE:ue(M,ce)?X.attribName+=ce:Ze(X,"Invalid attribute name");continue;case se.ATTRIB_NAME_SAW_WHITE:if("="===ce)X.state=se.ATTRIB_VALUE;else{if(E(ce))continue;Ze(X,"Attribute without value"),X.tag.attributes[X.attribName]="",X.attribValue="",te(X,"onattribute",{name:X.attribName,value:""}),X.attribName="",">"===ce?Le(X):ue(K,ce)?(X.attribName=ce,X.state=se.ATTRIB_NAME):(Ze(X,"Invalid attribute name"),X.state=se.ATTRIB)}continue;case se.ATTRIB_VALUE:if(E(ce))continue;U(ce)?(X.q=ce,X.state=se.ATTRIB_VALUE_QUOTED):(Ze(X,"Unquoted attribute value"),X.state=se.ATTRIB_VALUE_UNQUOTED,X.attribValue=ce);continue;case se.ATTRIB_VALUE_QUOTED:if(ce!==X.q){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_Q:X.attribValue+=ce;continue}je(X),X.q="",X.state=se.ATTRIB_VALUE_CLOSED;continue;case se.ATTRIB_VALUE_CLOSED:E(ce)?X.state=se.ATTRIB:">"===ce?Le(X):"/"===ce?X.state=se.OPEN_TAG_SLASH:ue(K,ce)?(Ze(X,"No whitespace between attributes"),X.attribName=ce,X.attribValue="",X.state=se.ATTRIB_NAME):Ze(X,"Invalid attribute name");continue;case se.ATTRIB_VALUE_UNQUOTED:if(!ie(ce)){"&"===ce?X.state=se.ATTRIB_VALUE_ENTITY_U:X.attribValue+=ce;continue}je(X),">"===ce?Le(X):X.state=se.ATTRIB;continue;case se.CLOSE_TAG:if(X.tagName)">"===ce?Ee(X):ue(M,ce)?X.tagName+=ce:X.script?(X.script+=""===ce?Ee(X):Ze(X,"Invalid characters in closing tag");continue;case se.TEXT_ENTITY:case se.ATTRIB_VALUE_ENTITY_Q:case se.ATTRIB_VALUE_ENTITY_U:var pt,pe;switch(X.state){case se.TEXT_ENTITY:pt=se.TEXT,pe="textNode";break;case se.ATTRIB_VALUE_ENTITY_Q:pt=se.ATTRIB_VALUE_QUOTED,pe="attribValue";break;case se.ATTRIB_VALUE_ENTITY_U:pt=se.ATTRIB_VALUE_UNQUOTED,pe="attribValue"}";"===ce?(X[pe]+=Oe(X),X.entity="",X.state=pt):ue(X.entity.length?Q:F,ce)?X.entity+=ce:(Ze(X,"Invalid character in entity name"),X[pe]+="&"+X.entity+ce,X.entity="",X.state=pt);continue;default:throw new Error(X,"Unknown state: "+X.state)}return X.position>=X.bufferCheckPosition&&function(z){for(var X=Math.max(V.MAX_BUFFER_LENGTH,10),be=0,ce=0,Pe=L.length;ceX)switch(L[ce]){case"textNode":ye(z);break;case"cdata":te(z,"oncdata",z.cdata),z.cdata="";break;case"script":te(z,"onscript",z.script),z.script="";break;default:Ve(z,"Max buffer length exceeded: "+L[ce])}be=Math.max(be,Et)}z.bufferCheckPosition=V.MAX_BUFFER_LENGTH-be+z.position}(X),X},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(z){ye(z),""!==z.cdata&&(te(z,"oncdata",z.cdata),z.cdata=""),""!==z.script&&(te(z,"onscript",z.script),z.script="")}(this)}};try{R=Y("stream").Stream}catch(z){R=function(){}}var A=V.EVENTS.filter(function(z){return"error"!==z&&"end"!==z});function y(z,X){if(!(this instanceof y))return new y(z,X);R.apply(this),this._parser=new re(z,X),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ce){be.emit("error",ce),be._parser.error=null},this._decoder=null,A.forEach(function(ce){Object.defineProperty(be,"on"+ce,{get:function(){return be._parser["on"+ce]},set:function(Pe){if(!Pe)return be.removeAllListeners(ce),be._parser["on"+ce]=Pe,Pe;be.on(ce,Pe)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(R.prototype,{constructor:{value:y}})).write=function(z){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(z)){if(!this._decoder){var X=Y("string_decoder").StringDecoder;this._decoder=new X("utf8")}z=this._decoder.write(z)}return this._parser.write(z.toString()),this.emit("data",z),!0},y.prototype.end=function(z){return z&&z.length&&this.write(z),this._parser.end(),!0},y.prototype.on=function(z,X){var be=this;return!be._parser["on"+z]&&-1!==A.indexOf(z)&&(be._parser["on"+z]=function(){var ce=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ce.splice(0,0,z),be.emit.apply(be,ce)}),R.prototype.on.call(be,z,X)};var j="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",H={xml:j,xmlns:I},K=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,M=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(z){return" "===z||"\n"===z||"\r"===z||"\t"===z}function U(z){return'"'===z||"'"===z}function ie(z){return">"===z||E(z)}function ue(z,X){return z.test(X)}function ee(z,X){return!ue(z,X)}var z,X,be,se=0;for(var Te in V.STATE={BEGIN:se++,BEGIN_WHITESPACE:se++,TEXT:se++,TEXT_ENTITY:se++,OPEN_WAKA:se++,SGML_DECL:se++,SGML_DECL_QUOTED:se++,DOCTYPE:se++,DOCTYPE_QUOTED:se++,DOCTYPE_DTD:se++,DOCTYPE_DTD_QUOTED:se++,COMMENT_STARTING:se++,COMMENT:se++,COMMENT_ENDING:se++,COMMENT_ENDED:se++,CDATA:se++,CDATA_ENDING:se++,CDATA_ENDING_2:se++,PROC_INST:se++,PROC_INST_BODY:se++,PROC_INST_ENDING:se++,OPEN_TAG:se++,OPEN_TAG_SLASH:se++,ATTRIB:se++,ATTRIB_NAME:se++,ATTRIB_NAME_SAW_WHITE:se++,ATTRIB_VALUE:se++,ATTRIB_VALUE_QUOTED:se++,ATTRIB_VALUE_CLOSED:se++,ATTRIB_VALUE_UNQUOTED:se++,ATTRIB_VALUE_ENTITY_Q:se++,ATTRIB_VALUE_ENTITY_U:se++,CLOSE_TAG:se++,CLOSE_TAG_SAW_WHITE:se++,SCRIPT:se++,SCRIPT_ENDING:se++},V.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(V.ENTITIES).forEach(function(z){var X=V.ENTITIES[z],be="number"==typeof X?String.fromCharCode(X):X;V.ENTITIES[z]=be}),V.STATE)V.STATE[V.STATE[Te]]=Te;function me(z,X,be){z[X]&&z[X](be)}function te(z,X,be){z.textNode&&ye(z),me(z,X,be)}function ye(z){z.textNode=Me(z.opt,z.textNode),z.textNode&&me(z,"ontext",z.textNode),z.textNode=""}function Me(z,X){return z.trim&&(X=X.trim()),z.normalize&&(X=X.replace(/\s+/g," ")),X}function Ve(z,X){return ye(z),z.trackPosition&&(X+="\nLine: "+z.line+"\nColumn: "+z.column+"\nChar: "+z.c),X=new Error(X),z.error=X,me(z,"onerror",X),z}function nt(z){return z.sawRoot&&!z.closedRoot&&Ze(z,"Unclosed root tag"),z.state!==se.BEGIN&&z.state!==se.BEGIN_WHITESPACE&&z.state!==se.TEXT&&Ve(z,"Unexpected end"),ye(z),z.c="",z.closed=!0,me(z,"onend"),re.call(z,z.strict,z.opt),z}function Ze(z,X){if("object"!=typeof z||!(z instanceof re))throw new Error("bad call to strictFail");z.strict&&Ve(z,X)}function Je(z){z.strict||(z.tagName=z.tagName[z.looseCase]());var X=z.tags[z.tags.length-1]||z,be=z.tag={name:z.tagName,attributes:{}};z.opt.xmlns&&(be.ns=X.ns),z.attribList.length=0,te(z,"onopentagstart",be)}function Ke(z,X){var ce=z.indexOf(":")<0?["",z]:z.split(":"),Pe=ce[0],Et=ce[1];return X&&"xmlns"===z&&(Pe="xmlns",Et=""),{prefix:Pe,local:Et}}function je(z){if(z.strict||(z.attribName=z.attribName[z.looseCase]()),-1!==z.attribList.indexOf(z.attribName)||z.tag.attributes.hasOwnProperty(z.attribName))z.attribName=z.attribValue="";else{if(z.opt.xmlns){var X=Ke(z.attribName,!0),ce=X.local;if("xmlns"===X.prefix)if("xml"===ce&&z.attribValue!==j)Ze(z,"xml: prefix must be bound to "+j+"\nActual: "+z.attribValue);else if("xmlns"===ce&&z.attribValue!==I)Ze(z,"xmlns: prefix must be bound to "+I+"\nActual: "+z.attribValue);else{var Pe=z.tag,Et=z.tags[z.tags.length-1]||z;Pe.ns===Et.ns&&(Pe.ns=Object.create(Et.ns)),Pe.ns[ce]=z.attribValue}z.attribList.push([z.attribName,z.attribValue])}else z.tag.attributes[z.attribName]=z.attribValue,te(z,"onattribute",{name:z.attribName,value:z.attribValue});z.attribName=z.attribValue=""}}function Le(z,X){if(z.opt.xmlns){var be=z.tag,ce=Ke(z.tagName);be.prefix=ce.prefix,be.local=ce.local,be.uri=be.ns[ce.prefix]||"",be.prefix&&!be.uri&&(Ze(z,"Unbound namespace prefix: "+JSON.stringify(z.tagName)),be.uri=ce.prefix),be.ns&&(z.tags[z.tags.length-1]||z).ns!==be.ns&&Object.keys(be.ns).forEach(function(An){te(z,"onopennamespace",{prefix:An,uri:be.ns[An]})});for(var Et=0,pt=z.attribList.length;Et",z.tagName="",void(z.state=se.SCRIPT);te(z,"onscript",z.script),z.script=""}var X=z.tags.length,be=z.tagName;z.strict||(be=be[z.looseCase]());for(var ce=be;X--&&z.tags[X].name!==ce;)Ze(z,"Unexpected close tag");if(X<0)return Ze(z,"Unmatched closing tag: "+z.tagName),z.textNode+="",void(z.state=se.TEXT);z.tagName=be;for(var Et=z.tags.length;Et-- >X;){var pt=z.tag=z.tags.pop();z.tagName=z.tag.name,te(z,"onclosetag",z.tagName);var pe={};for(var B in pt.ns)pe[B]=pt.ns[B];z.opt.xmlns&&pt.ns!==(z.tags[z.tags.length-1]||z).ns&&Object.keys(pt.ns).forEach(function(k){te(z,"onclosenamespace",{prefix:k,uri:pt.ns[k]})})}0===X&&(z.closedRoot=!0),z.tagName=z.attribValue=z.attribName="",z.attribList.length=0,z.state=se.TEXT}function Oe(z){var ce,X=z.entity,be=X.toLowerCase(),Pe="";return z.ENTITIES[X]?z.ENTITIES[X]:z.ENTITIES[be]?z.ENTITIES[be]:("#"===(X=be).charAt(0)&&("x"===X.charAt(1)?(X=X.slice(2),Pe=(ce=parseInt(X,16)).toString(16)):(X=X.slice(1),Pe=(ce=parseInt(X,10)).toString(10))),X=X.replace(/^0+/,""),isNaN(ce)||Pe.toLowerCase()!==X?(Ze(z,"Invalid character entity"),"&"+z.entity+";"):String.fromCodePoint(ce))}function Ue(z,X){"<"===X?(z.state=se.OPEN_WAKA,z.startTagPosition=z.position):E(X)||(Ze(z,"Non-whitespace before first tag."),z.textNode=X,z.state=se.TEXT)}function qe(z,X){var be="";return X1114111||X(k)!==k)throw RangeError("Invalid code point: "+k);k<=65535?Pe.push(k):Pe.push(55296+((k-=65536)>>10),k%1024+56320),(pe+1===B||Pe.length>ce)&&(O+=z.apply(null,Pe),Pe.length=0)}return O},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Ae,he){(function(W,V){(function(){!function(L,re){"use strict";if(!L.setImmediate){var A,$=1,b={},S=!1,R=L.document,Q=Object.getPrototypeOf&&Object.getPrototypeOf(L);Q=Q&&Q.setTimeout?Q:L,"[object process]"==={}.toString.call(L.process)?A=function(E){W.nextTick(function(){D(E)})}:function(){if(L.postMessage&&!L.importScripts){var E=!0,U=L.onmessage;return L.onmessage=function(){E=!1},L.postMessage("","*"),L.onmessage=U,E}}()?(E="setImmediate$"+Math.random()+"$",U=function(ie){ie.source===L&&"string"==typeof ie.data&&0===ie.data.indexOf(E)&&D(+ie.data.slice(E.length))},L.addEventListener?L.addEventListener("message",U,!1):L.attachEvent("onmessage",U),A=function(ie){L.postMessage(E+ie,"*")}):L.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function(U){D(U.data)},A=function(U){E.port2.postMessage(U)}}():R&&"onreadystatechange"in R.createElement("script")?function(){var E=R.documentElement;A=function(U){var ie=R.createElement("script");ie.onreadystatechange=function(){D(U),ie.onreadystatechange=null,E.removeChild(ie),ie=null},E.appendChild(ie)}}():A=function(E){setTimeout(D,0,E)},Q.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var U=new Array(arguments.length-1),ie=0;ie=0&&(A._idleTimeoutId=setTimeout(function(){A._onTimeout&&A._onTimeout()},v))},he.setImmediate="function"==typeof W?W:function(A){var v=S++,y=!(arguments.length<2)&&$.call(arguments,1);return b[v]=!0,L(function(){b[v]&&(y?A.apply(null,y):A.call(null),he.clearImmediate(v))}),v},he.clearImmediate="function"==typeof V?V:function(A){delete b[A]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Ae,he){(function(W){(function(){function L(re){try{if(!W.localStorage)return!1}catch(b){return!1}var $=W.localStorage[re];return null!=$&&"true"===String($).toLowerCase()}Ae.exports=function(re,$){if(L("noDeprecation"))return re;var b=!1;return function(){if(!b){if(L("throwDeprecation"))throw new Error($);L("traceDeprecation")?console.trace($):console.warn($),b=!0}return re.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Ae,he){"use strict";Ae.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let V=this.head;V;V=V.next)yield V.value}}},{}],92:[function(Y,Ae,he){"use strict";function W(b){var S=this;if(S instanceof W||(S=new W),S.tail=null,S.head=null,S.length=0,b&&"function"==typeof b.forEach)b.forEach(function(v){S.push(v)});else if(arguments.length>0)for(var R=0,A=arguments.length;R1)R=S;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,R=this.head.value}for(var v=0;null!==A;v++)R=b(R,A.value,v),A=A.next;return R},W.prototype.reduceReverse=function(b,S){var R,A=this.tail;if(arguments.length>1)R=S;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,R=this.tail.value}for(var v=this.length-1;null!==A;v--)R=b(R,A.value,v),A=A.prev;return R},W.prototype.toArray=function(){for(var b=new Array(this.length),S=0,R=this.head;null!==R;S++)b[S]=R.value,R=R.next;return b},W.prototype.toArrayReverse=function(){for(var b=new Array(this.length),S=0,R=this.tail;null!==R;S++)b[S]=R.value,R=R.prev;return b},W.prototype.slice=function(b,S){(S=S||this.length)<0&&(S+=this.length),(b=b||0)<0&&(b+=this.length);var R=new W;if(Sthis.length&&(S=this.length);for(var A=0,v=this.head;null!==v&&Athis.length&&(S=this.length);for(var A=this.length,v=this.tail;null!==v&&A>S;A--)v=v.prev;for(;null!==v&&A>b;A--,v=v.prev)R.push(v.value);return R},W.prototype.splice=function(b,S,...R){b>this.length&&(b=this.length-1),b<0&&(b=this.length+b);for(var A=0,v=this.head;null!==v&&A{jt.exports=function(tt,gt){var J=gt.length;if(0!==J){var xt=tt.length;tt.length+=J;for(var ut=0;ut{"use strict";var gt=(()=>{return(xt=gt||(gt={})).typeOfFunction="function",xt.boolTrue=!0,gt;var xt})();function J(xt,ut,Y){if(!Y||typeof Y.value!==gt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+ut+"> is not a method!");return{configurable:gt.boolTrue,get:function(){var Ae=Y.value.bind(this);return Object.defineProperty(this,ut,{value:Ae,configurable:gt.boolTrue,writable:gt.boolTrue}),Ae}}}it.ak=J,it.ZP=J},266:(jt,it,tt)=>{jt.exports={ResizeSensor:tt(835),ElementQueries:tt(845)}},845:function(jt,it,tt){"use strict";var gt,J,xt;"undefined"!=typeof window&&window,J=[tt(835)],void 0!==(xt="function"==typeof(gt=function(ut){var Y=function(){var he,W={},V=[];function L(M){M||(M=document.documentElement);var F=window.getComputedStyle(M,null).fontSize;return parseFloat(F)||16}function $(M,F){var Q=F.split(/\d/),E=Q[Q.length-1];switch(F=parseFloat(F),E){case"px":return F;case"em":return F*L(M);case"rem":return F*L();case"vw":return F*document.documentElement.clientWidth/100;case"vh":return F*document.documentElement.clientHeight/100;case"vmin":case"vmax":var U=document.documentElement.clientWidth/100,ie=document.documentElement.clientHeight/100;return F*(0,Math["vmin"===E?"min":"max"])(U,ie);default:return F}}function b(M,F){this.element=M;var Q,E,U,ie,ue,ee,se,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(Q in U=function(M){if(!M.getBoundingClientRect)return{width:M.offsetWidth,height:M.offsetHeight};var F=M.getBoundingClientRect();return{width:Math.round(F.width),height:Math.round(F.height)}}(this.element),ee={},W[F])!W[F].hasOwnProperty(Q)||(ie=$(this.element,(E=W[F][Q]).value),ue="width"===E.property?U.width:U.height,se="","min"===E.mode&&ue>=ie&&(se+=E.value),"max"===E.mode&&ue<=ie&&(se+=E.value),ee[Te=E.mode+"-"+E.property]||(ee[Te]=""),se&&-1===(" "+ee[Te]+" ").indexOf(" "+se+" ")&&(ee[Te]+=" "+se));for(var te in me)!me.hasOwnProperty(te)||(ee[me[te]]?this.element.setAttribute(me[te],ee[me[te]].substr(1)):this.element.removeAttribute(me[te]))}}function S(M,F){M.elementQueriesSetupInformation||(M.elementQueriesSetupInformation=new b(M,F)),M.elementQueriesSensor||(M.elementQueriesSensor=new ut(M,function(){M.elementQueriesSetupInformation.call()}))}function R(M,F,Q,E){if(void 0===W[M]){W[M]=[];var U=V.length;he.innerHTML+="\n"+M+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+M+" > .resize-sensor {min-width: "+U+"px;}",V.push(M)}W[M].push({mode:F,property:Q,value:E})}function A(M){var F;if(document.querySelectorAll&&(F=M?M.querySelectorAll.bind(M):document.querySelectorAll.bind(document)),!F&&"undefined"!=typeof $$&&(F=$$),!F&&"undefined"!=typeof jQuery&&(F=jQuery),!F)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return F}function y(M){var F=[],Q=[],E=[],U=0,ie=-1,ue=[];for(var ee in M.children)if(M.children.hasOwnProperty(ee)&&M.children[ee].tagName&&"img"===M.children[ee].tagName.toLowerCase()){F.push(M.children[ee]);var se=M.children[ee].getAttribute("min-width")||M.children[ee].getAttribute("data-min-width"),Te=M.children[ee].getAttribute("data-src")||M.children[ee].getAttribute("url");E.push(Te),Q.push({minWidth:se}),se?M.children[ee].style.display="none":(U=F.length-1,M.children[ee].style.display="block")}function te(){var Me,ye=!1;for(Me in F)!F.hasOwnProperty(Me)||Q[Me].minWidth&&M.offsetWidth>Q[Me].minWidth&&(ye=Me);if(ye||(ye=U),ie!==ye)if(ue[ye])F[ie].style.display="none",F[ye].style.display="block",ie=ye;else{var Ve=new Image;Ve.onload=function(){F[ye].src=E[ye],F[ie].style.display="none",F[ye].style.display="block",ue[ye]=!0,ie=ye},Ve.src=E[ye]}else F[ye].src=E[ye]}ie=U,M.resizeSensorInstance=new ut(M,te),te()}var D=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,j=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function I(M){var F,Q,E,U;for(M=M.replace(/'/g,'"');null!==(F=D.exec(M));)for(Q=F[1]+F[3],E=F[2];null!==(U=j.exec(E));)R(Q,U[1],U[2],U[3])}function H(M){var F="";if(M)if("string"==typeof M)(-1!==(M=M.toLowerCase()).indexOf("min-width")||-1!==M.indexOf("max-width"))&&I(M);else for(var Q=0,E=M.length;Q img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",he.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(he),K=!0);for(var F=0,Q=document.styleSheets.length;F{var gt=tt(910),J=tt(369),xt=tt(322);function ut(re,$,b){if(!gt(re))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!re.hasNode($))throw new Error('graphology-shortest-path: the "'+$+'" source node does not exist in the given graph.');if(!re.hasNode(b))throw new Error('graphology-shortest-path: the "'+b+'" target node does not exist in the given graph.');if(($=""+$)==(b=""+b))return[$];var S=re.inboundNeighbors.bind(re),R=re.outboundNeighbors.bind(re),A={},v={};A[$]=null,v[b]=null;var D,j,I,H,K,M,F,Q,y=[$],w=[b],E=!1;e:for(;y.length&&w.length;)if(y.length<=w.length){for(D=y,y=[],K=0,F=D.length;K{jt.exports=function(tt){return null!==tt&&"object"==typeof tt&&"function"==typeof tt.addUndirectedEdgeWithKey&&"function"==typeof tt.dropNode&&"boolean"==typeof tt.multi}},698:function(jt){jt.exports=function(){"use strict";function it(ne){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(de){return typeof de}:function(de){return de&&"function"==typeof Symbol&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de})(ne)}function tt(ne,de){ne.prototype=Object.create(de.prototype),ne.prototype.constructor=ne,J(ne,de)}function gt(ne){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)})(ne)}function J(ne,de){return(J=Object.setPrototypeOf||function(oe,C){return oe.__proto__=C,oe})(ne,de)}function xt(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(ne){return!1}}function ut(ne,de,oe){return(ut=xt()?Reflect.construct:function(C,P,Z){var we=[null];we.push.apply(we,P);var Fe=new(Function.bind.apply(C,we));return Z&&J(Fe,Z.prototype),Fe}).apply(null,arguments)}function Y(ne){var de="function"==typeof Map?new Map:void 0;return(Y=function(oe){if(null===oe||-1===Function.toString.call(oe).indexOf("[native code]"))return oe;if("function"!=typeof oe)throw new TypeError("Super expression must either be null or a function");if(void 0!==de){if(de.has(oe))return de.get(oe);de.set(oe,P)}function P(){return ut(oe,arguments,gt(this).constructor)}return P.prototype=Object.create(oe.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),J(P,oe)})(ne)}function Ae(ne){if(void 0===ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ne}var he=function(){for(var ne=arguments[0],de=1,oe=arguments.length;de0&&we.length>P&&!we.warned){we.warned=!0;var et=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(de)+" listeners added. Use emitter.setMaxListeners() to increase limit");et.name="MaxListenersExceededWarning",et.emitter=ne,et.type=de,et.count=we.length,console&&console.warn&&console.warn(et)}return ne}function M(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F(ne,de,oe){var C={fired:!1,wrapFn:void 0,target:ne,type:de,listener:oe},P=M.bind(C);return P.listener=oe,C.wrapFn=P,P}function Q(ne,de,oe){var C=ne._events;if(void 0===C)return[];var P=C[de];return void 0===P?[]:"function"==typeof P?oe?[P.listener||P]:[P]:oe?function(Z){for(var we=new Array(Z.length),Fe=0;Fe0&&(Z=de[0]),Z instanceof Error)throw Z;var we=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw we.context=Z,we}var Fe=P[ne];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,de);else{var et=Fe.length,Dt=U(Fe,et);for(oe=0;oe=0;Z--)if(oe[Z]===de||oe[Z].listener===de){we=oe[Z].listener,P=Z;break}if(P<0)return this;0===P?oe.shift():function(Fe,et){for(;et+1=0;C--)this.removeListener(ne,de[C]);return this},D.prototype.listeners=function(ne){return Q(this,ne,!0)},D.prototype.rawListeners=function(ne){return Q(this,ne,!1)},D.listenerCount=function(ne,de){return"function"==typeof ne.listenerCount?ne.listenerCount(de):E.call(ne,de)},D.prototype.listenerCount=E,D.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]},ue.prototype.next=function(){if(this.done)return{done:!0};var ne=this._next();return ne.done&&(this.done=!0),ne},"undefined"!=typeof Symbol&&(ue.prototype[Symbol.iterator]=function(){return this}),ue.of=function(){var ne=arguments,de=ne.length,oe=0;return new ue(function(){return oe>=de?{done:!0}:{done:!1,value:ne[oe++]}})},ue.empty=function(){var ne=new ue(null);return ne.done=!0,ne},ue.is=function(ne){return ne instanceof ue||"object"==typeof ne&&null!==ne&&"function"==typeof ne.next};var ee=ue,se=function(ne,de){for(var oe,C=arguments.length>1?de:1/0,P=C!==1/0?new Array(C):[],Z=0;;){if(Z===C)return P;if((oe=ne.next()).done)return Z!==de?P.slice(0,Z):P;P[Z++]=oe.value}},Te=function(ne){function de(oe,C){var P;return(P=ne.call(this)||this).name="GraphError",P.message=oe||"",P.data=C||{},P}return tt(de,ne),de}(Y(Error)),me=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),te=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te),ye=function(ne){function de(oe,C){var P;return(P=ne.call(this,oe,C)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Ae(P),de.prototype.constructor),P}return tt(de,ne),de}(Te);function Me(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ve(ne,de){this.key=ne,this.attributes=de,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function nt(ne,de){this.key=ne,this.attributes=de,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Ze(ne,de,oe,C,P,Z){this.key=de,this.attributes=Z,this.undirected=ne,this.source=C,this.target=P,this.generatedKey=oe}function Je(ne,de,oe,C,P,Z,we){var Fe,et,Dt="out",$e="in";if(de&&(Dt=$e="undirected"),ne.multi){if(void 0===(et=(Fe=Z[Dt])[P])&&(et=new Set,Fe[P]=et),et.add(oe),C===P&&de)return;void 0===(Fe=we[$e])[C]&&(Fe[C]=et)}else{if(Z[Dt][P]=oe,C===P&&de)return;we[$e][C]=oe}}function Ke(ne,de,oe){var C=ne.multi,P=oe.source,Z=oe.target,we=P.key,Fe=Z.key,et=P[de?"undirected":"out"],Dt=de?"undirected":"in";if(Fe in et)if(C){var $e=et[Fe];1===$e.size?(delete et[Fe],delete Z[Dt][we]):$e.delete(oe)}else delete et[Fe];C||delete Z[Dt][we]}Ve.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},nt.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var je=[{name:function(ne){return"get".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes[P]}}},{name:function(ne){return"get".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C){var P;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Z=""+C,we=""+arguments[1];if(!(P=W(this,Z,we,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Z,'" - "').concat(we,'").'))}else if(!(P=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&P.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return P.attributes}}},{name:function(ne){return"has".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes.hasOwnProperty(P)}}},{name:function(ne){return"set".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=W(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"update".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P,Z){var we;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var Fe=""+C,et=""+P;if(P=arguments[2],Z=arguments[3],!(we=W(this,Fe,et,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(et,'").'))}else if(!(we=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("function"!=typeof Z)throw new me("Graph.".concat(de,": updater should be a function."));if("mixed"!==oe&&we.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return we.attributes[P]=Z(we.attributes[P]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:P}),this}}},{name:function(ne){return"remove".concat(ne,"Attribute")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return delete Z.attributes[P],this.emit("edgeAttributesUpdated",{key:Z.key,type:"remove",attributes:Z.attributes,name:P}),this}}},{name:function(ne){return"replace".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return Z.attributes=P,this.emit("edgeAttributesUpdated",{key:Z.key,type:"replace",attributes:Z.attributes}),this}}},{name:function(ne){return"merge".concat(ne,"Attributes")},attacher:function(ne,de,oe){ne.prototype[de]=function(C,P){var Z;if("mixed"!==this.type&&"mixed"!==oe&&oe!==this.type)throw new ye("Graph.".concat(de,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(de,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var we=""+C,Fe=""+P;if(P=arguments[2],!(Z=W(this,we,Fe,oe)))throw new te("Graph.".concat(de,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(Z=this._edges.get(C=""+C)))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" edge in the graph.'));if(!L(P))throw new me("Graph.".concat(de,": provided attributes are not a plain object."));if("mixed"!==oe&&Z.undirected!==("undirected"===oe))throw new te("Graph.".concat(de,': could not find the "').concat(C,'" ').concat(oe," edge in the graph."));return he(Z.attributes,P),this.emit("edgeAttributesUpdated",{key:Z.key,type:"merge",attributes:Z.attributes,data:P}),this}}}],Le=ee,Ee=function(){var ne,de=arguments,oe=-1;return new Le(function C(){if(!ne){if(++oe>=de.length)return{done:!0};ne=de[oe]}var P=ne.next();return P.done?(ne=null,C()):P})},Oe=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Ue(ne,de){for(var oe in de)ne.push(de[oe].key)}function qe(ne,de){for(var oe in de)de[oe].forEach(function(C){return ne.push(C.key)})}function Be(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)}}function z(ne,de,oe){for(var C in ne)C!==oe&&ne[C].forEach(function(P){return de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function X(ne,de,oe){for(var C in ne)if(C!==oe){var P=ne[C];if(de(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey))return!0}return!1}function be(ne,de,oe){var C,P,Z,we,Fe;for(var et in ne)if(et!==oe)for(C=ne[et].values();!0!==(P=C.next()).done;)if(we=(Z=P.value).source,de(Z.key,Z.attributes,we.key,(Fe=Z.target).key,we.attributes,Fe.attributes,Z.undirected,Z.generatedKey))return!0;return!1}function ce(ne,de){var oe=Object.keys(ne),C=oe.length,P=null,Z=0;return new ee(function we(){var Fe;if(P){var et=P.next();if(et.done)return P=null,Z++,we();Fe=et.value}else{if(Z>=C)return{done:!0};var Dt=oe[Z];if(Dt===de)return Z++,we();if((Fe=ne[Dt])instanceof Set)return P=Fe.values(),we();Z++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function Pe(ne,de,oe){var C=de[oe];C&&ne.push(C.key)}function Et(ne,de,oe){var C=de[oe];C&&C.forEach(function(P){return ne.push(P.key)})}function pt(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function pe(ne,de,oe){var C=ne[de];C&&C.forEach(function(P){return oe(P.key,P.attributes,P.source.key,P.target.key,P.source.attributes,P.target.attributes,P.undirected,P.generatedKey)})}function B(ne,de,oe){var C=ne[de];if(C){var P=C.source,Z=C.target;return oe(C.key,C.attributes,P.key,Z.key,P.attributes,Z.attributes,C.undirected,C.generatedKey)}}function O(ne,de,oe){var C=ne[de];if(C){for(var P,Z,we=C.values();!0!==(P=we.next()).done;)if(oe((Z=P.value).key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes,Z.undirected,Z.generatedKey))return!0;return!1}}function k(ne,de){var oe=ne[de];if(oe instanceof Set){var C=oe.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{done:!1,value:[Z.key,Z.attributes,Z.source.key,Z.target.key,Z.source.attributes,Z.target.attributes]}})}return ee.of([oe.key,oe.attributes,oe.source.key,oe.target.key,oe.source.attributes,oe.target.attributes])}function Re(ne,de){if(0===ne.size)return[];if("mixed"===de||de===ne.type)return"function"==typeof Array.from?Array.from(ne._edges.keys()):se(ne._edges.keys(),ne._edges.size);for(var oe,C,Z=new Array("undirected"===de?ne.undirectedSize:ne.directedSize),we="undirected"===de,Fe=ne._edges.values(),et=0;!0!==(oe=Fe.next()).done;)(C=oe.value).undirected===we&&(Z[et++]=C.key);return Z}function Xe(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var Gt=P.source,bt=P.target;oe(P.key,P.attributes,Gt.key,bt.key,Gt.attributes,bt.attributes,P.undirected,P.generatedKey)}}function yt(ne,de,oe){if(0!==ne.size)for(var C,P,Z="mixed"!==de&&de!==ne.type,we="undirected"===de,Fe=ne._edges.values();!0!==(C=Fe.next()).done;)if(P=C.value,!Z||P.undirected===we){var Gt=P.source,bt=P.target;if(oe(P.key,P.attributes,Gt.key,bt.key,Gt.attributes,bt.attributes,P.undirected,P.generatedKey))break}}function It(ne,de){if(0===ne.size)return ee.empty();var oe="mixed"!==de&&de!==ne.type,C="undirected"===de,P=ne._edges.values();return new ee(function(){for(var Z,we;;){if((Z=P.next()).done)return Z;if(we=Z.value,!oe||we.undirected===C)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function An(ne,de,oe,C){var P=[],Z=ne?qe:Ue;return"undirected"!==de&&("out"!==oe&&Z(P,C.in),"in"!==oe&&Z(P,C.out),!oe&&C.directedSelfLoops>0&&P.splice(P.lastIndexOf(C.key),1)),"directed"!==de&&Z(P,C.undirected),P}function Rn(ne,de,oe,C,P){var Z=ne?z:Be;"undirected"!==de&&("out"!==oe&&Z(C.in,P),"in"!==oe&&Z(C.out,P,oe?null:C.key)),"directed"!==de&&Z(C.undirected,P)}function Hn(ne,de,oe,C,P){var Z=ne?be:X;"undirected"!==de&&("out"!==oe&&Z(C.in,P)||"in"!==oe&&Z(C.out,P,oe?null:C.key))||"directed"===de||Z(C.undirected,P)}function yi(ne,de,oe){var C=ee.empty();return"undirected"!==ne&&("out"!==de&&void 0!==oe.in&&(C=Ee(C,ce(oe.in))),"in"!==de&&void 0!==oe.out&&(C=Ee(C,ce(oe.out,de?null:oe.key)))),"directed"!==ne&&void 0!==oe.undirected&&(C=Ee(C,ce(oe.undirected))),C}function ci(ne,de,oe,C,P){var Z=de?Et:Pe,we=[];return"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&Z(we,C.in,P),void 0!==C.out&&"in"!==oe&&Z(we,C.out,P),!oe&&C.directedSelfLoops>0&&we.splice(we.lastIndexOf(C.key),1)),"directed"!==ne&&void 0!==C.undirected&&Z(we,C.undirected,P),we}function Ur(ne,de,oe,C,P,Z){var we=de?pe:pt;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z),C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z)),"directed"!==ne&&void 0!==C.undirected&&we(C.undirected,P,Z)}function Is(ne,de,oe,C,P,Z){var we=de?O:B;"undirected"!==ne&&(void 0!==C.in&&"out"!==oe&&we(C.in,P,Z)||C.key!==P&&void 0!==C.out&&"in"!==oe&&we(C.out,P,Z,oe?null:C.key))||"directed"===ne||void 0===C.undirected||we(C.undirected,P,Z)}function as(ne,de,oe,C){var P=ee.empty();return"undirected"!==ne&&(void 0!==oe.in&&"out"!==de&&C in oe.in&&(P=Ee(P,k(oe.in,C))),void 0!==oe.out&&"in"!==de&&C in oe.out&&(P=Ee(P,k(oe.out,C)))),"directed"!==ne&&void 0!==oe.undirected&&C in oe.undirected&&(P=Ee(P,k(oe.undirected,C))),P}var Os=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function zr(ne,de){if(void 0!==de)for(var oe in de)ne.add(oe)}function Va(ne,de,oe){if("mixed"!==ne){if("undirected"===ne)return Object.keys(oe.undirected);if("string"==typeof de)return Object.keys(oe[de])}var C=new Set;return"undirected"!==ne&&("out"!==de&&zr(C,oe.in),"in"!==de&&zr(C,oe.out)),"directed"!==ne&&zr(C,oe.undirected),se(C.values(),C.size)}function wl(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;oe(Fe.key,Fe.attributes)}}function la(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;ne.has(et.key)||(ne.add(et.key),C(et.key,et.attributes))}}function ps(ne,de,oe){for(var C in de){var P=de[C];P instanceof Set&&(P=P.values().next().value);var Z=P.source,Fe=Z===ne?P.target:Z;if(oe(Fe.key,Fe.attributes))return!0}return!1}function Zt(ne,de,oe,C){for(var P in oe){var Z=oe[P];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===de?Z.target:we;if(!ne.has(et.key)&&(ne.add(et.key),C(et.key,et.attributes)))return!0}return!1}function Ua(ne,de){var oe=Object.keys(de),C=oe.length,P=0;return new ee(function(){if(P>=C)return{done:!0};var Z=de[oe[P++]];Z instanceof Set&&(Z=Z.values().next().value);var we=Z.source,et=we===ne?Z.target:we;return{done:!1,value:[et.key,et.attributes]}})}function rt(ne,de,oe){var C=Object.keys(oe),P=C.length,Z=0;return new ee(function we(){if(Z>=P)return{done:!0};var Fe=oe[C[Z++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var et=Fe.source,$e=et===de?Fe.target:et;return ne.has($e.key)?we():(ne.add($e.key),{done:!1,value:[$e.key,$e.attributes]})})}function ot(ne,de,oe,C,P){var Z=ne._nodes.get(C);if("undirected"!==de){if("out"!==oe&&void 0!==Z.in)for(var we in Z.in)if(we===P)return!0;if("in"!==oe&&void 0!==Z.out)for(var Fe in Z.out)if(Fe===P)return!0}if("directed"!==de&&void 0!==Z.undirected)for(var et in Z.undirected)if(et===P)return!0;return!1}function ke(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,$e=de._nodes.values(),Gt=de.type;!0!==(C=$e.next()).done;){if(P=C.value,"undirected"!==Gt)for(Z in we=P.out)if(et=(Fe=we[Z]).target,Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return;if("directed"!==Gt)for(Z in we=P.undirected)if((et=(Fe=we[Z]).target).key!==Z&&(et=Fe.source),Dt=oe(P.key,et.key,P.attributes,et.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ne&&Dt)return}}function lt(ne,de,oe){for(var C,P,Z,we,Fe,et,Dt,$e,Gt,bt=de._nodes.values(),gn=de.type;!0!==(C=bt.next()).done;){if(P=C.value,"undirected"!==gn)for(Z in et=P.out)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if($e=(Dt=Fe.value).target,Gt=oe(P.key,$e.key,P.attributes,$e.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&Gt)return;if("directed"!==gn)for(Z in et=P.undirected)for(we=et[Z].values();!0!==(Fe=we.next()).done;)if(($e=(Dt=Fe.value).target).key!==Z&&($e=Dt.source),Gt=oe(P.key,$e.key,P.attributes,$e.attributes,Dt.key,Dt.attributes,Dt.undirected,Dt.generatedKey),ne&&Gt)return}}function Qe(ne,de){var oe={key:ne};return re(de.attributes)||(oe.attributes=he({},de.attributes)),oe}function vt(ne,de){var oe={source:de.source.key,target:de.target.key};return de.generatedKey||(oe.key=ne),re(de.attributes)||(oe.attributes=he({},de.attributes)),de.undirected&&(oe.undirected=!0),oe}function St(ne){return L(ne)?"key"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?null:"invalid-attributes":"no-key":"not-object"}function At(ne){return L(ne)?"source"in ne?"target"in ne?!("attributes"in ne)||L(ne.attributes)&&null!==ne.attributes?"undirected"in ne&&"boolean"!=typeof ne.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var qt=new Set(["directed","undirected","mixed"]),Bn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ti={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Mn(ne,de,oe){var C=new ne.NodeDataClass(de,oe);return ne._nodes.set(de,C),ne.emit("nodeAdded",{key:de,attributes:oe}),C}function pn(ne,de,oe,C,P,Z,we,Fe){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(Z=""+Z,we=""+we,Fe=Fe||{},!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var et=ne._nodes.get(Z),Dt=ne._nodes.get(we);if(!et)throw new te("Graph.".concat(de,': source node "').concat(Z,'" not found.'));if(!Dt)throw new te("Graph.".concat(de,': target node "').concat(we,'" not found.'));var $e={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator($e)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));if(!ne.multi&&(C?void 0!==et.undirected[we]:void 0!==et.out[we]))throw new ye("Graph.".concat(de,': an edge linking "').concat(Z,'" to "').concat(we,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var Gt=new Ze(C,P,oe,et,Dt,Fe);return ne._edges.set(P,Gt),Z===we?C?(et.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(et.directedSelfLoops++,ne._directedSelfLoopCount++):C?(et.undirectedDegree++,Dt.undirectedDegree++):(et.outDegree++,Dt.inDegree++),Je(ne,C,Gt,Z,we,et,Dt),C?ne._undirectedSize++:ne._directedSize++,$e.key=P,ne.emit("edgeAdded",$e),P}function Un(ne,de,oe,C,P,Z,we,Fe,et){if(!C&&"undirected"===ne.type)throw new ye("Graph.".concat(de,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(C&&"directed"===ne.type)throw new ye("Graph.".concat(de,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(et){if("function"!=typeof Fe)throw new me("Graph.".concat(de,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!L(Fe))throw new me("Graph.".concat(de,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Dt;if(Z=""+Z,we=""+we,et&&(Dt=Fe,Fe=void 0),!ne.allowSelfLoops&&Z===we)throw new ye("Graph.".concat(de,': source & target are the same ("').concat(Z,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var $e,Gt,bt=ne._nodes.get(Z),gn=ne._nodes.get(we);if(!oe&&($e=ne._edges.get(P))){if($e.source.key!==Z||$e.target.key!==we||C&&($e.source.key!==we||$e.target.key!==Z))throw new ye("Graph.".concat(de,': inconsistency detected when attempting to merge the "').concat(P,'" edge with "').concat(Z,'" source & "').concat(we,'" target vs. ("').concat($e.source.key,'", "').concat($e.target.key,'").'));Gt=$e}if(Gt||ne.multi||!bt||(Gt=C?bt.undirected[we]:bt.out[we]),Gt)return(et?Dt:Fe)?(et?(Gt.attributes=Dt(Gt.attributes),ne.emit("edgeAttributesUpdated",{type:"replace",key:Gt.key,attributes:Gt.attributes})):(he(Gt.attributes,Fe),ne.emit("edgeAttributesUpdated",{type:"merge",key:Gt.key,attributes:Gt.attributes,data:Fe})),Gt.key):Gt.key;Fe=Fe||{},et&&Dt&&(Fe=Dt(Fe));var Gr={key:null,undirected:C,source:Z,target:we,attributes:Fe};if(oe&&(P=ne._edgeKeyGenerator(Gr)),ne._edges.has(P=""+P))throw new ye("Graph.".concat(de,': the "').concat(P,'" edge already exists in the graph.'));return bt||(bt=Mn(ne,Z,{}),Z===we&&(gn=bt)),gn||(gn=Mn(ne,we,{})),$e=new Ze(C,P,oe,bt,gn,Fe),ne._edges.set(P,$e),Z===we?C?(bt.undirectedSelfLoops++,ne._undirectedSelfLoopCount++):(bt.directedSelfLoops++,ne._directedSelfLoopCount++):C?(bt.undirectedDegree++,gn.undirectedDegree++):(bt.outDegree++,gn.inDegree++),Je(ne,C,$e,Z,we,bt,gn),C?ne._undirectedSize++:ne._directedSize++,Gr.key=P,ne.emit("edgeAdded",Gr),P}var ne,En=function(ne){function de(C){var P;if(P=ne.call(this)||this,(C=he({},ti,C)).edgeKeyGenerator&&"function"!=typeof C.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(C.edgeKeyGenerator,'".'));if("boolean"!=typeof C.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(C.multi,'".'));if(!qt.has(C.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(C.type,'".'));if("boolean"!=typeof C.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(C.allowSelfLoops,'".'));var Z,we="mixed"===C.type?Me:"directed"===C.type?Ve:nt;return $(Ae(P),"NodeDataClass",we),$(Ae(P),"_attributes",{}),$(Ae(P),"_nodes",new Map),$(Ae(P),"_edges",new Map),$(Ae(P),"_directedSize",0),$(Ae(P),"_undirectedSize",0),$(Ae(P),"_directedSelfLoopCount",0),$(Ae(P),"_undirectedSelfLoopCount",0),$(Ae(P),"_edgeKeyGenerator",C.edgeKeyGenerator||(Z=0,function(){return Z++})),$(Ae(P),"_options",C),Bn.forEach(function(Fe){return $(Ae(P),Fe,P[Fe])}),b(Ae(P),"order",function(){return P._nodes.size}),b(Ae(P),"size",function(){return P._edges.size}),b(Ae(P),"directedSize",function(){return P._directedSize}),b(Ae(P),"undirectedSize",function(){return P._undirectedSize}),b(Ae(P),"selfLoopCount",function(){return P._directedSelfLoopCount+P._undirectedSelfLoopCount}),b(Ae(P),"directedSelfLoopCount",function(){return P._directedSelfLoopCount}),b(Ae(P),"undirectedSelfLoopCount",function(){return P._undirectedSelfLoopCount}),b(Ae(P),"multi",P._options.multi),b(Ae(P),"type",P._options.type),b(Ae(P),"allowSelfLoops",P._options.allowSelfLoops),b(Ae(P),"implementation",function(){return"graphology"}),P}tt(de,ne);var oe=de.prototype;return oe.hasNode=function(C){return this._nodes.has(""+C)},oe.hasDirectedEdge=function(C,P){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&!we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.out[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasUndirectedEdge=function(C,P){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+C);return!!we&&we.undirected}if(2===arguments.length){P=""+P;var Fe=this._nodes.get(C=""+C);if(!Fe)return!1;var et=Fe.undirected[P];return!(!et||this.multi&&!et.size)}throw new me("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.hasEdge=function(C,P){if(1===arguments.length)return this._edges.has(""+C);if(2===arguments.length){P=""+P;var we=this._nodes.get(C=""+C);if(!we)return!1;var Fe=void 0!==we.out&&we.out[P];return Fe||(Fe=void 0!==we.undirected&&we.undirected[P]),!(!Fe||this.multi&&!Fe.size)}throw new me("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},oe.directedEdge=function(C,P){if("undirected"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.directedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.directedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||void 0;return we?we.key:void 0}},oe.undirectedEdge=function(C,P){if("directed"!==this.type){if(C=""+C,P=""+P,this.multi)throw new ye("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var Z=this._nodes.get(C);if(!Z)throw new te('Graph.undirectedEdge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.undirectedEdge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.undirected&&Z.undirected[P]||void 0;return we?we.key:void 0}},oe.edge=function(C,P){if(this.multi)throw new ye("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");P=""+P;var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.edge: could not find the "'.concat(C,'" source node in the graph.'));if(!this._nodes.has(P))throw new te('Graph.edge: could not find the "'.concat(P,'" target node in the graph.'));var we=Z.out&&Z.out[P]||Z.undirected&&Z.undirected[P]||void 0;if(we)return we.key},oe.inDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.inDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.inDegree+(P?Z.directedSelfLoops:0)},oe.outDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.outDegree: could not find the "'.concat(C,'" node in the graph.'));return"undirected"===this.type?0:Z.outDegree+(P?Z.directedSelfLoops:0)},oe.directedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.directedDegree: could not find the "'.concat(C,'" node in the graph.'));if("undirected"===this.type)return 0;var we=P?Z.directedSelfLoops:0;return Z.inDegree+we+(Z.outDegree+we)},oe.undirectedDegree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.undirectedDegree: could not find the "'.concat(C,'" node in the graph.'));return"directed"===this.type?0:Z.undirectedDegree+2*(P?Z.undirectedSelfLoops:0)},oe.degree=function(C){var P=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof P)throw new me('Graph.degree: Expecting a boolean but got "'.concat(P,'" for the second parameter (allowing self-loops to be counted).'));var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.degree: could not find the "'.concat(C,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(P&&(Fe=Z.undirectedSelfLoops),we+=Z.undirectedDegree+2*Fe),"undirected"!==this.type&&(P&&(Fe=Z.directedSelfLoops),we+=Z.inDegree+Z.outDegree+2*Fe),we},oe.source=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.source: could not find the "'.concat(C,'" edge in the graph.'));return P.source.key},oe.target=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.target: could not find the "'.concat(C,'" edge in the graph.'));return P.target.key},oe.extremities=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.extremities: could not find the "'.concat(C,'" edge in the graph.'));return[P.source.key,P.target.key]},oe.opposite=function(C,P){C=""+C;var Z=this._edges.get(P=""+P);if(!Z)throw new te('Graph.opposite: could not find the "'.concat(P,'" edge in the graph.'));var we=Z.source.key,Fe=Z.target.key;if(C!==we&&C!==Fe)throw new te('Graph.opposite: the "'.concat(C,'" node is not attached to the "').concat(P,'" edge (').concat(we,", ").concat(Fe,")."));return C===we?Fe:we},oe.hasExtremity=function(C,P){P=""+P;var Z=this._edges.get(C=""+C);if(!Z)throw new te('Graph.hasExtremity: could not find the "'.concat(C,'" edge in the graph.'));return Z.source.key===P||Z.target.key===P},oe.isUndirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isUndirected: could not find the "'.concat(C,'" edge in the graph.'));return P.undirected},oe.isDirected=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isDirected: could not find the "'.concat(C,'" edge in the graph.'));return!P.undirected},oe.isSelfLoop=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.isSelfLoop: could not find the "'.concat(C,'" edge in the graph.'));return P.source===P.target},oe.hasGeneratedKey=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.hasGeneratedKey: could not find the "'.concat(C,'" edge in the graph.'));return P.generatedKey},oe.addNode=function(C,P){return function(Z,we,Fe){if(Fe&&!L(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},Z._nodes.has(we=""+we))throw new ye('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var et=new Z.NodeDataClass(we,Fe);return Z._nodes.set(we,et),Z.emit("nodeAdded",{key:we,attributes:Fe}),et}(this,C,P).key},oe.mergeNode=function(C,P){if(P&&!L(P))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(P,'"'));P=P||{};var Z=this._nodes.get(C=""+C);return Z?(P&&(he(Z.attributes,P),this.emit("nodeAttributesUpdated",{type:"merge",key:C,attributes:Z.attributes,data:P})),C):(Z=new this.NodeDataClass(C,P),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:P}),C)},oe.updateNode=function(C,P){if(P&&"function"!=typeof P)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(P,'"'));var Z=this._nodes.get(C=""+C);if(Z)return P&&(Z.attributes=P(Z.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:C,attributes:Z.attributes})),C;var Fe=P?P({}):{};return Z=new this.NodeDataClass(C,Fe),this._nodes.set(C,Z),this.emit("nodeAdded",{key:C,attributes:Fe}),C},oe.dropNode=function(C){var P=this,Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.dropNode: could not find the "'.concat(C,'" node in the graph.'));this.forEachEdge(C,function(we){P.dropEdge(we)}),this._nodes.delete(C),this.emit("nodeDropped",{key:C,attributes:Z.attributes})},oe.dropEdge=function(C){var P;if(arguments.length>1){var Z=""+arguments[0],we=""+arguments[1];if(!(P=W(this,Z,we,this.type)))throw new te('Graph.dropEdge: could not find the "'.concat(Z,'" -> "').concat(we,'" edge in the graph.'))}else if(!(P=this._edges.get(C=""+C)))throw new te('Graph.dropEdge: could not find the "'.concat(C,'" edge in the graph.'));this._edges.delete(P.key);var et=P.source,Dt=P.target,$e=P.attributes,Gt=P.undirected;return et===Dt?Gt?(et.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(et.directedSelfLoops--,this._directedSelfLoopCount--):Gt?(et.undirectedDegree--,Dt.undirectedDegree--):(et.outDegree--,Dt.inDegree--),Ke(this,Gt,P),Gt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:C,attributes:$e,source:et.key,target:Dt.key,undirected:Gt}),this},oe.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},oe.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},oe.getAttribute=function(C){return this._attributes[C]},oe.getAttributes=function(){return this._attributes},oe.hasAttribute=function(C){return this._attributes.hasOwnProperty(C)},oe.setAttribute=function(C,P){return this._attributes[C]=P,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.updateAttribute=function(C,P){if("function"!=typeof P)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[C]=P(this._attributes[C]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:C}),this},oe.removeAttribute=function(C){return delete this._attributes[C],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:C}),this},oe.replaceAttributes=function(C){if(!L(C))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=C,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},oe.mergeAttributes=function(C){if(!L(C))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,C),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:C}),this},oe.getNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.getNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes[P]},oe.getNodeAttributes=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.getNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));return P.attributes},oe.hasNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return Z.attributes.hasOwnProperty(P)},oe.setNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.setNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return we.attributes[P]=Z,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.updateNodeAttribute=function(C,P,Z){var we=this._nodes.get(C=""+C);if(!we)throw new te('Graph.updateNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));if(arguments.length<3)throw new me("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof Z)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,et=Z(Fe[P]);return Fe[P]=et,this.emit("nodeAttributesUpdated",{key:C,type:"set",attributes:we.attributes,name:P}),this},oe.removeNodeAttribute=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.hasNodeAttribute: could not find the "'.concat(C,'" node in the graph.'));return delete Z.attributes[P],this.emit("nodeAttributesUpdated",{key:C,type:"remove",attributes:Z.attributes,name:P}),this},oe.replaceNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.replaceNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return Z.attributes=P,this.emit("nodeAttributesUpdated",{key:C,type:"replace",attributes:Z.attributes}),this},oe.mergeNodeAttributes=function(C,P){var Z=this._nodes.get(C=""+C);if(!Z)throw new te('Graph.mergeNodeAttributes: could not find the "'.concat(C,'" node in the graph.'));if(!L(P))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(Z.attributes,P),this.emit("nodeAttributesUpdated",{key:C,type:"merge",attributes:Z.attributes,data:P}),this},oe.updateEachNodeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._nodes.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:P||null})},oe.updateEachEdgeAttributes=function(C,P){if("function"!=typeof C)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(P&&!S(P))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var Z,we,Fe=this._edges.values();!0!==(Z=Fe.next()).done;)(we=Z.value).attributes=C(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:P||null})},oe.forEach=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?lt(!1,this,C):ke(!1,this,C)},oe.forEachUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEach: expecting a callback.");this.multi?lt(!0,this,C):ke(!0,this,C)},oe.adjacency=function(){return this.multi?(et=(C=this)._nodes.values(),Dt=C.type,$e="outer",Gt=null,new ee(function bt(){var gn;if("outer"===$e)return!0===(gn=et.next()).done?gn:(P=gn.value,$e="directed",bt());if("directed"===$e)return"undirected"===Dt?($e="undirected",bt()):(we=P.out,Z=Object.keys(P.out),Fe=0,$e="inner-directed",bt());if("undirected"===$e){if("directed"===Dt)return $e="outer",bt();we=P.undirected,Z=Object.keys(P.undirected),Fe=0,$e="inner-undirected"}if(!Gt&&Fe>=Z.length)return $e="inner-undirected"===$e?"outer":"undirected",bt();if(!Gt){var gs=Z[Fe++];return Gt=we[gs].values(),bt()}if((gn=Gt.next()).done)return Gt=null,bt();var Gr=gn.value,Gs=Gr.target;return"inner-undirected"===$e&&Gs.key===P.key&&(Gs=Gr.source),{done:!1,value:[P.key,Gs.key,P.attributes,Gs.attributes,Gr.key,Gr.attributes]}})):(El=(bt=this)._nodes.values(),io=bt.type,Rr="outer",new ee(function Rs(){var lc;if("outer"===Rr)return!0===(lc=El.next()).done?lc:(gn=lc.value,Rr="directed",Rs());if("directed"===Rr)return"undirected"===io?(Rr="undirected",Rs()):(Gr=gn.out,gs=Object.keys(gn.out),Gs=0,Rr="inner-directed",Rs());if("undirected"===Rr){if("directed"===io)return Rr="outer",Rs();Gr=gn.undirected,gs=Object.keys(gn.undirected),Gs=0,Rr="inner-undirected"}if(Gs>=gs.length)return Rr="inner-undirected"===Rr?"outer":"undirected",Rs();var bn=gs[Gs++],ro=Gr[bn],Sl=ro.target;return"inner-undirected"===Rr&&Sl.key===gn.key&&(Sl=ro.source),{done:!1,value:[gn.key,Sl.key,gn.attributes,Sl.attributes,ro.key,ro.attributes]}}));var bt,gn,gs,Gr,Gs,El,io,Rr,C,P,Z,we,Fe,et,Dt,$e,Gt},oe.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):se(this._nodes.keys(),this._nodes.size)},oe.forEachNode=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(P,Z){C(Z,P.attributes)})},oe.forEachNodeUntil=function(C){if("function"!=typeof C)throw new me("Graph.forEachNode: expecting a callback.");for(var P,Z,we=this._nodes.values();!0!==(P=we.next())&&!C((Z=P.value).key,Z.attributes););},oe.nodeEntries=function(){var C=this._nodes.values();return new ee(function(){var P=C.next();if(P.done)return P;var Z=P.value;return{value:[Z.key,Z.attributes],done:!1}})},oe.exportNode=function(C){var P=this._nodes.get(C=""+C);if(!P)throw new te('Graph.exportNode: could not find the "'.concat(C,'" node in the graph.'));return Qe(C,P)},oe.exportEdge=function(C){var P=this._edges.get(C=""+C);if(!P)throw new te('Graph.exportEdge: could not find the "'.concat(C,'" edge in the graph.'));return vt(C,P)},oe.export=function(){var C=new Array(this._nodes.size),P=0;this._nodes.forEach(function(we,Fe){C[P++]=Qe(Fe,we)});var Z=new Array(this._edges.size);return P=0,this._edges.forEach(function(we,Fe){Z[P++]=vt(Fe,we)}),{attributes:this.getAttributes(),nodes:C,edges:Z,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},oe.importNode=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=St(C);if(Z){if("not-object"===Z)throw new me('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===Z)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===Z)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=C.key,Fe=C.attributes,et=void 0===Fe?{}:Fe;return P?this.mergeNode(we,et):this.addNode(we,et),this},oe.importEdge=function(C){var P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Z=At(C);if(Z){if("not-object"===Z)throw new me('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===Z)throw new me("Graph.importEdge: missing souce.");if("no-target"===Z)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===Z)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===Z)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=C.source,Fe=C.target,et=C.attributes,Dt=void 0===et?{}:et,$e=C.undirected,Gt=void 0!==$e&&$e;return"key"in C?(P?Gt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:Gt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,C.key,we,Fe,Dt):(P?Gt?this.mergeUndirectedEdge:this.mergeDirectedEdge:Gt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Dt),this},oe.import=function(C){var P,Z,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V(C))return this.import(C.export(),Fe),this;if(!L(C))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(C.attributes){if(!L(C.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(C.attributes):this.replaceAttributes(C.attributes)}if(C.nodes){if(we=C.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(P=0,Z=we.length;PZ)){var Dt=new Set;Dt.add(P.undirected[et]),P.undirected[et]=Dt,C._nodes.get(et).undirected[Z]=Dt}})),this;var C},oe.clearIndex=function(){return this._nodes.forEach(function(C){void 0!==C.in&&(C.in={},C.out={}),void 0!==C.undirected&&(C.undirected={})}),this},oe.toJSON=function(){return this.export()},oe.toString=function(){return"[object Graph]"},oe.inspect=function(){var C=this,P={};this._nodes.forEach(function(Dt,$e){P[$e]=Dt.attributes});var Z={},we={};this._edges.forEach(function(Dt,$e){var Gt=Dt.undirected?"--":"->",bt="",gn="(".concat(Dt.source.key,")").concat(Gt,"(").concat(Dt.target.key,")");Dt.generatedKey?C.multi&&(void 0===we[gn]?we[gn]=0:we[gn]++,bt+="".concat(we[gn],". ")):bt+="[".concat($e,"]: "),Z[bt+=gn]=Dt.attributes});var Fe={};for(var et in this)this.hasOwnProperty(et)&&!Bn.has(et)&&"function"!=typeof this[et]&&(Fe[et]=this[et]);return Fe.attributes=this._attributes,Fe.nodes=P,Fe.edges=Z,$(Fe,"constructor",this.constructor),Fe},de}(A.exports.EventEmitter);"undefined"!=typeof Symbol&&(En.prototype[Symbol.for("nodejs.util.inspect.custom")]=En.prototype.inspect),[{name:function(ne){return"".concat(ne,"Edge")},generateKey:!0},{name:function(ne){return"".concat(ne,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ne){return"".concat(ne,"EdgeWithKey")}},{name:function(ne){return"".concat(ne,"DirectedEdgeWithKey")},type:"directed"},{name:function(ne){return"".concat(ne,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ne){["add","merge","update"].forEach(function(de){var oe=ne.name(de),C="add"===de?pn:Un;En.prototype[oe]=ne.generateKey?function(P,Z,we){return C(this,oe,!0,"undirected"===(ne.type||this.type),null,P,Z,we,"update"===de)}:function(P,Z,we,Fe){return C(this,oe,!1,"undirected"===(ne.type||this.type),P,Z,we,Fe,"update"===de)}})}),"undefined"!=typeof Symbol&&(En.prototype[Symbol.iterator]=En.prototype.adjacency),ne=En,je.forEach(function(de){var oe=de.name,C=de.attacher;C(ne,oe("Edge"),"mixed"),C(ne,oe("DirectedEdge"),"directed"),C(ne,oe("UndirectedEdge"),"undirected")}),function(ne){Oe.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe,et){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(!arguments.length)return Re(this,Z);if(1===arguments.length){var Dt=this._nodes.get(Fe=""+Fe);if(void 0===Dt)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return An(this.multi,"mixed"===Z?this.type:Z,we,Dt)}if(2===arguments.length){et=""+et;var $e=this._nodes.get(Fe=""+Fe);if(!$e)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" target node in the graph.'));return ci(Z,this.multi,we,$e,et)}throw new me("Graph.".concat(P,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1);oe.prototype[Fe]=function(et,Dt,$e){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return Xe(this,Z,$e=et);if(2===arguments.length){$e=Dt;var Gt=this._nodes.get(et=""+et);if(void 0===Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Rn(this.multi,"mixed"===Z?this.type:Z,we,Gt,$e)}if(3===arguments.length){Dt=""+Dt;var bt=this._nodes.get(et=""+et);if(!bt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Ur(Z,this.multi,we,bt,Dt,$e)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var P=C.name,Z=C.type,we=C.direction,Fe="forEach"+P[0].toUpperCase()+P.slice(1,-1)+"Until";oe.prototype[Fe]=function(et,Dt,$e){if("mixed"===Z||"mixed"===this.type||Z===this.type){if(1===arguments.length)return yt(this,Z,$e=et);if(2===arguments.length){$e=Dt;var Gt=this._nodes.get(et=""+et);if(void 0===Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return Hn(this.multi,"mixed"===Z?this.type:Z,we,Gt,$e)}if(3===arguments.length){Dt=""+Dt;var bt=this._nodes.get(et=""+et);if(!bt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return Is(Z,this.multi,we,bt,Dt,$e)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ne,de),function(oe,C){var Z=C.type,we=C.direction,Fe=C.name.slice(0,-1)+"Entries";oe.prototype[Fe]=function(et,Dt){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return ee.empty();if(!arguments.length)return It(this,Z);if(1===arguments.length){var $e=this._nodes.get(et=""+et);if(!$e)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" node in the graph.'));return yi(Z,we,$e)}if(2===arguments.length){Dt=""+Dt;var Gt=this._nodes.get(et=""+et);if(!Gt)throw new te("Graph.".concat(Fe,': could not find the "').concat(et,'" source node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(Fe,': could not find the "').concat(Dt,'" target node in the graph.'));return as(Z,we,Gt,Dt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ne,de)})}(En),function(ne){Os.forEach(function(de){var C,P,Z,we;Z=(C=de).type,we=C.direction,ne.prototype[P=C.name]=function(Fe){if("mixed"!==Z&&"mixed"!==this.type&&Z!==this.type)return[];if(2===arguments.length){var et=""+arguments[0],Dt=""+arguments[1];if(!this._nodes.has(et))throw new te("Graph.".concat(P,': could not find the "').concat(et,'" node in the graph.'));if(!this._nodes.has(Dt))throw new te("Graph.".concat(P,': could not find the "').concat(Dt,'" node in the graph.'));return ot(this,Z,we,et,Dt)}if(1===arguments.length){var $e=this._nodes.get(Fe=""+Fe);if(void 0===$e)throw new te("Graph.".concat(P,': could not find the "').concat(Fe,'" node in the graph.'));return Va("mixed"===Z?this.type:Z,we,$e)}throw new me("Graph.".concat(P,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1);ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,$e,Gt,bt){if("mixed"!==Dt){if("undirected"===Dt)return wl(Gt,Gt.undirected,bt);if("string"==typeof $e)return wl(Gt,Gt[$e],bt)}var gn=new Set;"undirected"!==Dt&&("out"!==$e&&la(gn,Gt,Gt.in,bt),"in"!==$e&&la(gn,Gt,Gt.out,bt)),"directed"!==Dt&&la(gn,Gt,Gt.undirected,bt)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var oe=de.name,C=de.type,P=de.direction,Z="forEach"+oe[0].toUpperCase()+oe.slice(1,-1)+"Until";ne.prototype[Z]=function(we,Fe){if("mixed"===C||"mixed"===this.type||C===this.type){var et=this._nodes.get(we=""+we);if(void 0===et)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));!function(Dt,$e,Gt,bt){if("mixed"!==Dt){if("undirected"===Dt)return ps(Gt,Gt.undirected,bt);if("string"==typeof $e)return ps(Gt,Gt[$e],bt)}var gn=new Set;"undirected"!==Dt&&("out"!==$e&&Zt(gn,Gt,Gt.in,bt)||"in"!==$e&&Zt(gn,Gt,Gt.out,bt))||"directed"===Dt||Zt(gn,Gt,Gt.undirected,bt)}("mixed"===C?this.type:C,P,et,Fe)}}}(ne,de),function(ne,de){var C=de.type,P=de.direction,Z=de.name.slice(0,-1)+"Entries";ne.prototype[Z]=function(we){if("mixed"!==C&&"mixed"!==this.type&&C!==this.type)return ee.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new te("Graph.".concat(Z,': could not find the "').concat(we,'" node in the graph.'));return function(et,Dt,$e){if("mixed"!==et){if("undirected"===et)return Ua($e,$e.undirected);if("string"==typeof Dt)return Ua($e,$e[Dt])}var Gt=ee.empty(),bt=new Set;return"undirected"!==et&&("out"!==Dt&&(Gt=Ee(Gt,rt(bt,$e,$e.in))),"in"!==Dt&&(Gt=Ee(Gt,rt(bt,$e,$e.out)))),"directed"!==et&&(Gt=Ee(Gt,rt(bt,$e,$e.undirected))),Gt}("mixed"===C?this.type:C,P,Fe)}}(ne,de)})}(En);var Qi=function(ne){function de(oe){var C=he({type:"directed"},oe);if("multi"in C&&!1!==C.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==C.type)throw new me('DirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),Zi=function(ne){function de(oe){var C=he({type:"undirected"},oe);if("multi"in C&&!1!==C.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==C.type)throw new me('UndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),Wn=function(ne){function de(oe){var C=he({multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ne.call(this,C)||this}return tt(de,ne),de}(En),Fi=function(ne){function de(oe){var C=he({type:"directed",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==C.type)throw new me('MultiDirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En),ca=function(ne){function de(oe){var C=he({type:"undirected",multi:!0},oe);if("multi"in C&&!0!==C.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==C.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+C.type+'" type in given options!');return ne.call(this,C)||this}return tt(de,ne),de}(En);function Hr(ne){ne.from=function(de,oe){var C=he({},de.options,oe),P=new ne(C);return P.import(de),P}}return Hr(En),Hr(Qi),Hr(Zi),Hr(Wn),Hr(Fi),Hr(ca),En.Graph=En,En.DirectedGraph=Qi,En.UndirectedGraph=Zi,En.MultiGraph=Wn,En.MultiDirectedGraph=Fi,En.MultiUndirectedGraph=ca,En.InvalidArgumentsGraphError=me,En.NotFoundGraphError=te,En.UsageGraphError=ye,En}()},524:(jt,it,tt)=>{var gt;!function(J,xt,ut,Y){"use strict";var A,Ae=["","webkit","Moz","MS","ms","o"],he=xt.createElement("div"),V=Math.round,L=Math.abs,re=Date.now;function $(_e,xe,He){return setTimeout(D(_e,He),xe)}function b(_e,xe,He){return!!Array.isArray(_e)&&(S(_e,He[xe],He),!0)}function S(_e,xe,He){var mt;if(_e)if(_e.forEach)_e.forEach(xe,He);else if(_e.length!==Y)for(mt=0;mt<_e.length;)xe.call(He,_e[mt],mt,_e),mt++;else for(mt in _e)_e.hasOwnProperty(mt)&&xe.call(He,_e[mt],mt,_e)}function R(_e,xe,He){var mt="DEPRECATED METHOD: "+xe+"\n"+He+" AT \n";return function(){var Ut=new Error("get-stack-trace"),$t=Ut&&Ut.stack?Ut.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ni=J.console&&(J.console.warn||J.console.log);return ni&&ni.call(J.console,mt,$t),_e.apply(this,arguments)}}A="function"!=typeof Object.assign?function(xe){if(xe===Y||null===xe)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(xe),mt=1;mt-1}function Q(_e){return _e.trim().split(/\s+/g)}function E(_e,xe,He){if(_e.indexOf&&!He)return _e.indexOf(xe);for(var mt=0;mt<_e.length;){if(He&&_e[mt][He]==xe||!He&&_e[mt]===xe)return mt;mt++}return-1}function U(_e){return Array.prototype.slice.call(_e,0)}function ie(_e,xe,He){for(var mt=[],Ut=[],$t=0;$t<_e.length;){var ni=xe?_e[$t][xe]:_e[$t];E(Ut,ni)<0&&mt.push(_e[$t]),Ut[$t]=ni,$t++}return He&&(mt=xe?mt.sort(function($r,ms){return $r[xe]>ms[xe]}):mt.sort()),mt}function ue(_e,xe){for(var He,mt,Ut=xe[0].toUpperCase()+xe.slice(1),$t=0;$t1&&!He.firstMultiple?He.firstMultiple=yt(xe):1===Ut&&(He.firstMultiple=!1);var $t=He.firstInput,ni=He.firstMultiple,Nr=ni?ni.center:$t.center,$r=xe.center=It(mt);xe.timeStamp=re(),xe.deltaTime=xe.timeStamp-$t.timeStamp,xe.angle=yi(Nr,$r),xe.distance=Hn(Nr,$r),function(_e,xe){var He=xe.center,mt=_e.offsetDelta||{},Ut=_e.prevDelta||{},$t=_e.prevInput||{};(1===xe.eventType||4===$t.eventType)&&(Ut=_e.prevDelta={x:$t.deltaX||0,y:$t.deltaY||0},mt=_e.offsetDelta={x:He.x,y:He.y}),xe.deltaX=Ut.x+(He.x-mt.x),xe.deltaY=Ut.y+(He.y-mt.y)}(He,xe),xe.offsetDirection=Rn(xe.deltaX,xe.deltaY);var ms=An(xe.deltaTime,xe.deltaX,xe.deltaY);xe.overallVelocityX=ms.x,xe.overallVelocityY=ms.y,xe.overallVelocity=L(ms.x)>L(ms.y)?ms.x:ms.y,xe.scale=ni?function(_e,xe){return Hn(xe[0],xe[1],pt)/Hn(_e[0],_e[1],pt)}(ni.pointers,mt):1,xe.rotation=ni?function(_e,xe){return yi(xe[1],xe[0],pt)+yi(_e[1],_e[0],pt)}(ni.pointers,mt):0,xe.maxPointers=He.prevInput?xe.pointers.length>He.prevInput.maxPointers?xe.pointers.length:He.prevInput.maxPointers:xe.pointers.length,function(_e,xe){var Ut,$t,ni,Nr,He=_e.lastInterval||xe,mt=xe.timeStamp-He.timeStamp;if(8!=xe.eventType&&(mt>25||He.velocity===Y)){var $r=xe.deltaX-He.deltaX,ms=xe.deltaY-He.deltaY,Jn=An(mt,$r,ms);$t=Jn.x,ni=Jn.y,Ut=L(Jn.x)>L(Jn.y)?Jn.x:Jn.y,Nr=Rn($r,ms),_e.lastInterval=xe}else Ut=He.velocity,$t=He.velocityX,ni=He.velocityY,Nr=He.direction;xe.velocity=Ut,xe.velocityX=$t,xe.velocityY=ni,xe.direction=Nr}(He,xe);var Jn=_e.element;M(xe.srcEvent.target,Jn)&&(Jn=xe.srcEvent.target),xe.target=Jn}(_e,He),_e.emit("hammer.input",He),_e.recognize(He),_e.session.prevInput=He}function yt(_e){for(var xe=[],He=0;He<_e.pointers.length;)xe[He]={clientX:V(_e.pointers[He].clientX),clientY:V(_e.pointers[He].clientY)},He++;return{timeStamp:re(),pointers:xe,center:It(xe),deltaX:_e.deltaX,deltaY:_e.deltaY}}function It(_e){var xe=_e.length;if(1===xe)return{x:V(_e[0].clientX),y:V(_e[0].clientY)};for(var He=0,mt=0,Ut=0;Ut=L(xe)?_e<0?2:4:xe<0?8:16}function Hn(_e,xe,He){He||(He=Et);var mt=xe[He[0]]-_e[He[0]],Ut=xe[He[1]]-_e[He[1]];return Math.sqrt(mt*mt+Ut*Ut)}function yi(_e,xe,He){return He||(He=Et),180*Math.atan2(xe[He[1]]-_e[He[1]],xe[He[0]]-_e[He[0]])/Math.PI}pe.prototype={handler:function(){},init:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(Te(this.element),this.evWin,this.domHandler)}};var Is={mousedown:1,mousemove:2,mouseup:4},as="mousedown",Os="mousemove mouseup";function zr(){this.evEl=as,this.evWin=Os,this.pressed=!1,pe.apply(this,arguments)}w(zr,pe,{handler:function(xe){var He=Is[xe.type];1&He&&0===xe.button&&(this.pressed=!0),2&He&&1!==xe.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[xe],changedPointers:[xe],pointerType:Ze,srcEvent:xe}))}});var Va={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},wl={2:Ve,3:"pen",4:Ze,5:"kinect"},la="pointerdown",ps="pointermove pointerup pointercancel";function Zt(){this.evEl=la,this.evWin=ps,pe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}J.MSPointerEvent&&!J.PointerEvent&&(la="MSPointerDown",ps="MSPointerMove MSPointerUp MSPointerCancel"),w(Zt,pe,{handler:function(xe){var He=this.store,mt=!1,Ut=xe.type.toLowerCase().replace("ms",""),$t=Va[Ut],ni=wl[xe.pointerType]||xe.pointerType,Nr=ni==Ve,$r=E(He,xe.pointerId,"pointerId");1&$t&&(0===xe.button||Nr)?$r<0&&(He.push(xe),$r=He.length-1):12&$t&&(mt=!0),!($r<0)&&(He[$r]=xe,this.callback(this.manager,$t,{pointers:He,changedPointers:[xe],pointerType:ni,srcEvent:xe}),mt&&He.splice($r,1))}});var Ua={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",ot="touchstart touchmove touchend touchcancel";function ct(){this.evTarget=rt,this.evWin=ot,this.started=!1,pe.apply(this,arguments)}function fe(_e,xe){var He=U(_e.touches),mt=U(_e.changedTouches);return 12&xe&&(He=ie(He.concat(mt),"identifier",!0)),[He,mt]}w(ct,pe,{handler:function(xe){var He=Ua[xe.type];if(1===He&&(this.started=!0),this.started){var mt=fe.call(this,xe,He);12&He&&mt[0].length-mt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:mt[0],changedPointers:mt[1],pointerType:Ve,srcEvent:xe})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ke="touchstart touchmove touchend touchcancel";function lt(){this.evTarget=ke,this.targetIds={},pe.apply(this,arguments)}function Qe(_e,xe){var He=U(_e.touches),mt=this.targetIds;if(3&xe&&1===He.length)return mt[He[0].identifier]=!0,[He,He];var Ut,$t,ni=U(_e.changedTouches),Nr=[],$r=this.target;if($t=He.filter(function(ms){return M(ms.target,$r)}),1===xe)for(Ut=0;Ut<$t.length;)mt[$t[Ut].identifier]=!0,Ut++;for(Ut=0;Ut-1&&mt.splice($t,1)},2500)}}function ti(_e){for(var xe=_e.srcEvent.clientX,He=_e.srcEvent.clientY,mt=0;mt-1&&this.requireFail.splice(xe,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(_e){return!!this.simultaneous[_e.id]},emit:function(_e){var xe=this,He=this.state;function mt(Ut){xe.manager.emit(Ut,_e)}He<8&&mt(xe.options.event+$e(He)),mt(xe.options.event),_e.additionalEvent&&mt(_e.additionalEvent),He>=8&&mt(xe.options.event+$e(He))},tryEmit:function(_e){if(this.canEmit())return this.emit(_e);this.state=32},canEmit:function(){for(var _e=0;_exe.threshold&&Ut&xe.direction},attrTest:function(_e){return gn.prototype.attrTest.call(this,_e)&&(2&this.state||!(2&this.state)&&this.directionTest(_e))},emit:function(_e){this.pX=_e.deltaX,this.pY=_e.deltaY;var xe=Gt(_e.direction);xe&&(_e.additionalEvent=this.options.event+xe),this._super.emit.call(this,_e)}}),w(Gr,gn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.scale-1)>this.options.threshold||2&this.state)},emit:function(_e){1!==_e.scale&&(_e.additionalEvent=this.options.event+(_e.scale<1?"in":"out")),this._super.emit.call(this,_e)}}),w(Gs,Dt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(_e){var xe=this.options,He=_e.pointers.length===xe.pointers,mt=_e.distancexe.time;if(this._input=_e,!mt||!He||12&_e.eventType&&!Ut)this.reset();else if(1&_e.eventType)this.reset(),this._timer=$(function(){this.state=8,this.tryEmit()},xe.time,this);else if(4&_e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(_e){8===this.state&&(_e&&4&_e.eventType?this.manager.emit(this.options.event+"up",_e):(this._input.timeStamp=re(),this.manager.emit(this.options.event,this._input)))}}),w(El,gn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zi]},attrTest:function(_e){return this._super.attrTest.call(this,_e)&&(Math.abs(_e.rotation)>this.options.threshold||2&this.state)}}),w(io,gn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return gs.prototype.getTouchAction.call(this)},attrTest:function(_e){var He,xe=this.options.direction;return 30&xe?He=_e.overallVelocity:6&xe?He=_e.overallVelocityX:24&xe&&(He=_e.overallVelocityY),this._super.attrTest.call(this,_e)&&xe&_e.offsetDirection&&_e.distance>this.options.threshold&&_e.maxPointers==this.options.pointers&&L(He)>this.options.velocity&&4&_e.eventType},emit:function(_e){var xe=Gt(_e.offsetDirection);xe&&this.manager.emit(this.options.event+xe,_e),this.manager.emit(this.options.event,_e)}}),w(Rr,Dt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Qi]},process:function(_e){var xe=this.options,He=_e.pointers.length===xe.pointers,mt=_e.distance"']/g,ps=RegExp(wl.source),Zt=RegExp(la.source),Ua=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fe=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,lt=RegExp(ke.source),Qe=/^\s+/,vt=/\s/,St=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,At=/\{\n\/\* \[wrapped with (.+)\] \*/,qt=/,? & /,Bn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ti=/[()=,{}\[\]\/\s]/,Mn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Un=/\w*$/,En=/^[-+]0x[0-9a-f]+$/i,Qi=/^0b[01]+$/i,Zi=/^\[object .+?Constructor\]$/,Wn=/^0o[0-7]+$/i,Fi=/^(?:0|[1-9]\d*)$/,ca=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hr=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,de="\\ud800-\\udfff",Z="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",bt="A-Z\\xc0-\\xd6\\xd8-\\xde",gn="\\ufe0e\\ufe0f",gs="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gs="["+de+"]",El="["+gs+"]",io="["+Z+"]",Rr="\\d+",Rs="["+we+"]",lc="["+Fe+"]",bn="[^"+de+gs+Rr+we+Fe+bt+"]",ro="\\ud83c[\\udffb-\\udfff]",ua="[^"+de+"]",nd="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="["+bt+"]",mt="(?:"+lc+"|"+bn+")",Ut="(?:"+xe+"|"+bn+")",$t="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ni="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Nr="(?:"+io+"|"+ro+")?",$r="["+gn+"]?",yx=$r+Nr+"(?:\\u200d(?:"+[ua,nd,_e].join("|")+")"+$r+Nr+")*",id="(?:"+[Rs,nd,_e].join("|")+")"+yx,qi="(?:"+[ua+io+"?",io,nd,_e,Gs].join("|")+")",Gf=RegExp("['\u2019]","g"),wm=RegExp(io,"g"),hh=RegExp(ro+"(?="+ro+")|"+qi+yx,"g"),ab=RegExp([xe+"?"+lc+"+"+$t+"(?="+[El,xe,"$"].join("|")+")",Ut+"+"+ni+"(?="+[El,xe+mt,"$"].join("|")+")",xe+"?"+mt+"+"+$t,xe+"+"+ni,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rr,id].join("|"),"g"),vx=RegExp("[\\u200d"+de+Z+gn+"]"),Cl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bx=-1,_n={};_n[It]=_n[An]=_n[Rn]=_n[Hn]=_n[yi]=_n[ci]=_n[Ur]=_n[Is]=_n[as]=!0,_n[Ze]=_n[Je]=_n[Xe]=_n[je]=_n[yt]=_n[Le]=_n[Oe]=_n[Ue]=_n[Be]=_n[z]=_n[be]=_n[Et]=_n[pt]=_n[pe]=_n[k]=!1;var Ji={};Ji[Ze]=Ji[Je]=Ji[Xe]=Ji[yt]=Ji[je]=Ji[Le]=Ji[It]=Ji[An]=Ji[Rn]=Ji[Hn]=Ji[yi]=Ji[Be]=Ji[z]=Ji[be]=Ji[Et]=Ji[pt]=Ji[pe]=Ji[B]=Ji[ci]=Ji[Ur]=Ji[Is]=Ji[as]=!0,Ji[Oe]=Ji[Ue]=Ji[k]=!1;var ln={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},wx=parseFloat,db=parseInt,kt="object"==typeof global&&global&&global.Object===Object&&global,Ns="object"==typeof self&&self&&self.Object===Object&&self,Ii=kt||Ns||Function("return this")(),xl=it&&!it.nodeType&&it,da=xl&&jt&&!jt.nodeType&&jt,bo=da&&da.exports===xl,Em=bo&&kt.process,mr=function(){try{return da&&da.require&&da.require("util").types||Em&&Em.binding&&Em.binding("util")}catch(Tt){}}(),tn=mr&&mr.isArrayBuffer,ii=mr&&mr.isDate,nr=mr&&mr.isMap,so=mr&&mr.isRegExp,cc=mr&&mr.isSet,Qr=mr&&mr.isTypedArray;function Zr(st,Tt,_t){switch(_t.length){case 0:return st.call(Tt);case 1:return st.call(Tt,_t[0]);case 2:return st.call(Tt,_t[0],_t[1]);case 3:return st.call(Tt,_t[0],_t[1],_t[2])}return st.apply(Tt,_t)}function Pr(st,Tt,_t,cn){for(var Cn=-1,Di=null==st?0:st.length;++Cn-1}function ph(st,Tt,_t){for(var cn=-1,Cn=null==st?0:st.length;++cn-1;);return _t}function xx(st,Tt){for(var _t=st.length;_t--&&za(Tt,st[_t],0)>-1;);return _t}function mP(st,Tt){for(var _t=st.length,cn=0;_t--;)st[_t]===Tt&&++cn;return cn}var _P=ko({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),yP=ko({"&":"&","<":"<",">":">",'"':""","'":"'"});function vP(st){return"\\"+ln[st]}function _h(st){return vx.test(st)}function fb(st){var Tt=-1,_t=Array(st.size);return st.forEach(function(cn,Cn){_t[++Tt]=[Cn,cn]}),_t}function Ax(st,Tt){return function(_t){return st(Tt(_t))}}function iu(st,Tt){for(var _t=-1,cn=st.length,Cn=0,Di=[];++_t",""":'"',"'":"'"}),vh=function st(Tt){var u,_t=(Tt=null==Tt?Ii:vh.defaults(Ii.Object(),Tt,vh.pick(Ii,fh))).Array,cn=Tt.Date,Cn=Tt.Error,Di=Tt.Function,Wr=Tt.Math,Bi=Tt.Object,Mm=Tt.RegExp,Im=Tt.String,pa=Tt.TypeError,ir=_t.prototype,ru=Bi.prototype,Wf=Tt["__core-js_shared__"],_r=Di.prototype.toString,ji=ru.hasOwnProperty,xP=0,bh=(u=/[^.]+$/.exec(Wf&&Wf.keys&&Wf.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",$s=ru.toString,Mx=_r.call(Bi),Om=Ii._,cd=Mm("^"+_r.call(ji).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fs=bo?Tt.Buffer:J,Tl=Tt.Symbol,ud=Tt.Uint8Array,mb=Fs?Fs.allocUnsafe:J,ga=Ax(Bi.getPrototypeOf,Bi),Rm=Bi.create,qf=ru.propertyIsEnumerable,Pn=ir.splice,Ix=Tl?Tl.isConcatSpreadable:J,wh=Tl?Tl.iterator:J,su=Tl?Tl.toStringTag:J,Yf=function(){try{var u=wc(Bi,"defineProperty");return u({},"",{}),u}catch(h){}}(),_b=Tt.clearTimeout!==Ii.clearTimeout&&Tt.clearTimeout,Ox=cn&&cn.now!==Ii.Date.now&&cn.now,Rx=Tt.setTimeout!==Ii.setTimeout&&Tt.setTimeout,Bt=Wr.ceil,ui=Wr.floor,Vo=Bi.getOwnPropertySymbols,Jr=Fs?Fs.isBuffer:J,Nm=Tt.isFinite,Eh=ir.join,Ga=Ax(Bi.keys,Bi),Lr=Wr.max,ls=Wr.min,AP=cn.now,Nx=Tt.parseInt,Sh=Wr.random,Kf=ir.reverse,ys=wc(Tt,"DataView"),oo=wc(Tt,"Map"),Xf=wc(Tt,"Promise"),ma=wc(Tt,"Set"),Eo=wc(Tt,"WeakMap"),Ch=wc(Bi,"create"),xh=Eo&&new Eo,dd={},Px=_u(ys),Pm=_u(oo),Fm=_u(Xf),yb=_u(ma),Lm=_u(Eo),Qf=Tl?Tl.prototype:J,hd=Qf?Qf.valueOf:J,Ah=Qf?Qf.toString:J;function Se(u){if(br(u)&&!Tn(u)&&!(u instanceof ri)){if(u instanceof So)return u;if(ji.call(u,"__wrapped__"))return wp(u)}return new So(u)}var ou=function(){function u(){}return function(h){if(!vr(h))return{};if(Rm)return Rm(h);u.prototype=h;var m=new u;return u.prototype=J,m}}();function Th(){}function So(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=J}function ri(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function ao(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function Ls(u,h,m,N,ae,Ce){var ze,Ye=1&h,at=2&h,Rt=4&h;if(m&&(ze=ae?m(u,N,ae,Ce):m(u)),ze!==J)return ze;if(!vr(u))return u;var Nt=Tn(u);if(Nt){if(ze=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&ji.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!Ye)return qs(u,ze)}else{var Vt=Bs(u),en=Vt==Ue||Vt==qe;if(tl(u))return up(u,Ye);if(Vt==be||Vt==Ze||en&&!ae){if(ze=at||en?{}:Hb(u),!Ye)return at?function(u,h){return ba(u,Vb(u),h)}(u,function(u,h){return u&&ba(h,Ks(h),u)}(ze,u)):function(u,h){return ba(u,r_(u),h)}(u,Wx(ze,u))}else{if(!Ji[Vt])return ae?u:{};ze=function(u,h,m){var N=u.constructor;switch(h){case Xe:return fu(u);case je:case Le:return new N(+u);case yt:return function(u,h){var m=h?fu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case It:case An:case Rn:case Hn:case yi:case ci:case Ur:case Is:case as:return Jm(u,m);case Be:return new N;case z:case pe:return new N(u);case Et:return function(u){var h=new u.constructor(u.source,Un.exec(u));return h.lastIndex=u.lastIndex,h}(u);case pt:return new N;case B:return function(u){return hd?Bi(hd.call(u)):{}}(u)}}(u,Vt,Ye)}}Ce||(Ce=new ya);var vn=Ce.get(u);if(vn)return vn;Ce.set(u,ze),fA(u)?u.forEach(function(Fn){ze.add(Ls(Fn,h,m,Fn,u,Ce))}):cA(u)&&u.forEach(function(Fn,ai){ze.set(ai,Ls(Fn,h,m,ai,u,Ce))});var oi=Nt?J:(Rt?at?n_:Nl:at?Ks:Ss)(u);return Ps(oi||u,function(Fn,ai){oi&&(Fn=u[ai=Fn]),Wa(ze,ai,Ls(Fn,h,m,ai,u,Ce))}),ze}function ip(u,h,m){var N=m.length;if(null==u)return!N;for(u=Bi(u);N--;){var ae=m[N],ze=u[ae];if(ze===J&&!(ae in u)||!(0,h[ae])(ze))return!1}return!0}function Ih(u,h,m){if("function"!=typeof u)throw new pa(Ae);return kh(function(){u.apply(J,m)},h)}function fc(u,h,m,N){var ae=-1,Ce=Al,ze=!0,Ye=u.length,at=[],Rt=h.length;if(!Ye)return at;m&&(h=Li(h,jo(m))),N?(Ce=ph,ze=!1):h.length>=200&&(Ce=mh,ze=!1,h=new _a(h));e:for(;++ae-1},Dl.prototype.set=function(u,h){var m=this.__data__,N=pd(m,u);return N<0?(++this.size,m.push([u,h])):m[N][1]=h,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new ao,map:new(oo||Dl),string:new ao}},$a.prototype.delete=function(u){var h=ks(this,u).delete(u);return this.size-=h?1:0,h},$a.prototype.get=function(u){return ks(this,u).get(u)},$a.prototype.has=function(u){return ks(this,u).has(u)},$a.prototype.set=function(u,h){var m=ks(this,u),N=m.size;return m.set(u,h),this.size+=m.size==N?0:1,this},_a.prototype.add=_a.prototype.push=function(u){return this.__data__.set(u,W),this},_a.prototype.has=function(u){return this.__data__.has(u)},ya.prototype.clear=function(){this.__data__=new Dl,this.size=0},ya.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},ya.prototype.get=function(u){return this.__data__.get(u)},ya.prototype.has=function(u){return this.__data__.has(u)},ya.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Dl){var N=m.__data__;if(!oo||N.length<199)return N.push([u,h]),this.size=++m.size,this;m=this.__data__=new $a(N)}return m.set(u,h),this.size=m.size,this};var pc=Xa(Ya),Gm=Xa(rp,!0);function Eb(u,h){var m=!0;return pc(u,function(N,ae,Ce){return m=!!h(N,ae,Ce)}),m}function Oh(u,h,m){for(var N=-1,ae=u.length;++N0&&m(Ye)?h>1?vs(Ye,h-1,m,N,ae):Fr(ae,Ye):N||(ae[ae.length]=Ye)}return ae}var gd=Ob(),md=Ob(!0);function Ya(u,h){return u&&gd(u,h,Ss)}function rp(u,h){return u&&md(u,h,Ss)}function Rh(u,h){return ha(h,function(m){return Xo(u[m])})}function Uo(u,h){for(var m=0,N=(h=yc(h,u)).length;null!=u&&mh}function _d(u,h){return null!=u&&ji.call(u,h)}function yd(u,h){return null!=u&&h in Bi(u)}function lu(u,h,m){for(var N=m?ph:Al,ae=u[0].length,Ce=u.length,ze=Ce,Ye=_t(Ce),at=1/0,Rt=[];ze--;){var Nt=u[ze];ze&&h&&(Nt=Li(Nt,jo(h))),at=ls(Nt.length,at),Ye[ze]=!m&&(h||ae>=120&&Nt.length>=120)?new _a(ze&&Nt):J}Nt=u[0];var Vt=-1,en=Ye[0];e:for(;++Vt=Ye?at:at*("desc"==m[N]?-1:1)}return u.index-h.index}(Ce,ze,m)});_t--;)st[_t]=st[_t].value;return st}(Qx(u,function(Ce,ze,Ye){return{criteria:Li(h,function(Rt){return Rt(Ce)}),index:++N,value:Ce}}))}function Tb(u,h,m){for(var N=-1,ae=h.length,Ce={};++N-1;)Ye!==u&&Pn.call(Ye,at,1),Pn.call(u,at,1);return u}function Ph(u,h){for(var m=u?h.length:0,N=m-1;m--;){var ae=h[m];if(m==N||ae!==Ce){var Ce=ae;Ao(ae)?Pn.call(u,ae,1):uu(u,ae)}}return u}function Ml(u,h){return u+ui(Sh()*(h-u+1))}function op(u,h){var m="";if(!u||h<1||h>Te)return m;do{h%2&&(m+=u),(h=ui(h/2))&&(u+=u)}while(h);return m}function si(u,h){return bp(p1(u,h,Xs),u+"")}function Jx(u){return Vm(Ld(u))}function FP(u,h){var m=Ld(u);return Td(m,au(h,0,m.length))}function ap(u,h,m,N){if(!vr(u))return u;for(var ae=-1,Ce=(h=yc(h,u)).length,ze=Ce-1,Ye=u;null!=Ye&&++aeae?0:ae+h),(m=m>ae?ae:m)<0&&(m+=ae),ae=h>m?0:m-h>>>0,h>>>=0;for(var Ce=_t(ae);++N>>1,ze=u[Ce];null!==ze&&!Qo(ze)&&(m?ze<=h:ze=200){var Rt=h?null:t_(u);if(Rt)return Am(Rt);ze=!1,ae=mh,at=new _a}else at=h?[]:Ye;e:for(;++N=N?u:ws(u,h,m)}var n1=_b||function(u){return Ii.clearTimeout(u)};function up(u,h){if(h)return u.slice();var m=u.length,N=mb?mb(m):new u.constructor(m);return u.copy(N),N}function fu(u){var h=new u.constructor(u.byteLength);return new ud(h).set(new ud(u)),h}function Jm(u,h){var m=h?fu(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function vc(u,h){if(u!==h){var m=u!==J,N=null===u,ae=u==u,Ce=Qo(u),ze=h!==J,Ye=null===h,at=h==h,Rt=Qo(h);if(!Ye&&!Rt&&!Ce&&u>h||Ce&&ze&&at&&!Ye&&!Rt||N&&ze&&at||!m&&at||!ae)return 1;if(!N&&!Ce&&!Rt&&u1?m[ae-1]:J,ze=ae>2?m[2]:J;for(Ce=u.length>3&&"function"==typeof Ce?(ae--,Ce):J,ze&&js(m[0],m[1],ze)&&(Ce=ae<3?J:Ce,ae=1),h=Bi(h);++N-1?ae[Ce?h[ze]:ze]:J}}function gu(u){return Qa(function(h){var m=h.length,N=m,ae=So.prototype.thru;for(u&&h.reverse();N--;){var Ce=h[N];if("function"!=typeof Ce)throw new pa(Ae);if(ae&&!ze&&"wrapper"==_p(Ce))var ze=new So([],!0)}for(N=ze?N:m;++N1&&vi.reverse(),Nt&&atYe))return!1;var Rt=Ce.get(u),Nt=Ce.get(h);if(Rt&&Nt)return Rt==h&&Nt==u;var Vt=-1,en=!0,vn=2&m?new _a:J;for(Ce.set(u,h),Ce.set(h,u);++Vt-1&&u%1==0&&u1?"& ":"")+h[N],h=h.join(m>2?", ":" "),u.replace(St,"{\n/* [wrapped with "+h+"] */\n")}(N,function(u,h){return Ps(nt,function(m){var N="_."+m[0];h&m[1]&&!Al(u,N)&&u.push(N)}),u.sort()}(function(u){var h=u.match(At);return h?h[1].split(qt):[]}(N),m)))}function u_(u){var h=0,m=0;return function(){var N=AP(),ae=16-(N-m);if(m=N,ae>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(J,arguments)}}function Td(u,h){var m=-1,N=u.length,ae=N-1;for(h=h===J?N:h;++m1?u[h-1]:J;return m="function"==typeof m?(u.pop(),m):J,j1(u,m)});function b_(u){var h=Se(u);return h.__chain__=!0,h}function Md(u,h){return h(u)}var w_=Qa(function(u){var h=u.length,m=h?u[0]:0,N=this.__wrapped__,ae=function(Ce){return zm(Ce,u)};return!(h>1||this.__actions__.length)&&N instanceof ri&&Ao(m)?((N=N.slice(m,+m+(h?1:0))).__actions__.push({func:Md,args:[ae],thisArg:J}),new So(N,this.__chain__).thru(function(Ce){return h&&!Ce.length&&Ce.push(J),Ce})):this.thru(ae)}),z1=qr(function(u,h,m){ji.call(u,m)?++u[m]:qa(u,m,1)}),$1=Nb(h_),W1=Nb(f_);function x_(u,h){return(Tn(u)?Ps:pc)(u,On(h,3))}function Cp(u,h){return(Tn(u)?rd:Gm)(u,On(h,3))}var Y1=qr(function(u,h,m){ji.call(u,m)?u[m].push(h):qa(u,m,[h])}),h0=si(function(u,h,m){var N=-1,ae="function"==typeof h,Ce=lo(u)?_t(u.length):[];return pc(u,function(ze){Ce[++N]=ae?Zr(h,ze,m):va(ze,h,m)}),Ce}),f0=qr(function(u,h,m){qa(u,m,h)});function Ja(u,h){return(Tn(u)?Li:Qx)(u,On(h,3))}var g0=qr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),Ap=si(function(u,h){if(null==u)return[];var m=h.length;return m>1&&js(u,h[0],h[1])?h=[]:m>2&&js(h[0],h[1],h[2])&&(h=[h[0]]),Nh(u,vs(h,1),[])}),yu=Ox||function(){return Ii.Date.now()};function Tp(u,h,m){return h=m?J:h,Rl(u,H,J,J,J,J,h=u&&null==h?u.length:h)}function T_(u,h){var m;if("function"!=typeof h)throw new pa(Ae);return u=Kn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=J),m}}var zh=si(function(u,h,m){var N=1;if(m.length){var ae=iu(m,Ad(zh));N|=j}return Rl(u,N,h,m,ae)}),Od=si(function(u,h,m){var N=3;if(m.length){var ae=iu(m,Ad(Od));N|=j}return Rl(h,N,u,m,ae)});function E0(u,h,m){var N,ae,Ce,ze,Ye,at,Rt=0,Nt=!1,Vt=!1,en=!0;if("function"!=typeof u)throw new pa(Ae);function vn(Ri){var rl=N,xc=ae;return N=ae=J,Rt=Ri,ze=u.apply(xc,rl)}function Nn(Ri){return Rt=Ri,Ye=kh(ai,h),Nt?vn(Ri):ze}function Fn(Ri){var rl=Ri-at;return at===J||rl>=h||rl<0||Vt&&Ri-Rt>=Ce}function ai(){var Ri=yu();if(Fn(Ri))return vi(Ri);Ye=kh(ai,function(Ri){var nT=h-(Ri-at);return Vt?ls(nT,Ce-(Ri-Rt)):nT}(Ri))}function vi(Ri){return Ye=J,en&&N?vn(Ri):(N=ae=J,ze)}function Zo(){var Ri=yu(),rl=Fn(Ri);if(N=arguments,ae=this,at=Ri,rl){if(Ye===J)return Nn(at);if(Vt)return n1(Ye),Ye=kh(ai,h),vn(at)}return Ye===J&&(Ye=kh(ai,h)),ze}return h=co(h)||0,vr(m)&&(Nt=!!m.leading,Ce=(Vt="maxWait"in m)?Lr(co(m.maxWait)||0,h):Ce,en="trailing"in m?!!m.trailing:en),Zo.cancel=function(){Ye!==J&&n1(Ye),Rt=0,N=at=ae=Ye=J},Zo.flush=function(){return Ye===J?ze:vi(yu())},Zo}var Z1=si(function(u,h){return Ih(u,1,h)}),S0=si(function(u,h,m){return Ih(u,co(h)||0,m)});function Hh(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new pa(Ae);var m=function(){var N=arguments,ae=h?h.apply(this,N):N[0],Ce=m.cache;if(Ce.has(ae))return Ce.get(ae);var ze=u.apply(this,N);return m.cache=Ce.set(ae,ze)||Ce,ze};return m.cache=new(Hh.Cache||$a),m}function I_(u){if("function"!=typeof u)throw new pa(Ae);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}Hh.Cache=$a;var J1=t1(function(u,h){var m=(h=1==h.length&&Tn(h[0])?Li(h[0],jo(On())):Li(vs(h,1),jo(On()))).length;return si(function(N){for(var ae=-1,Ce=ls(N.length,m);++ae=h}),el=qx(function(){return arguments}())?qx:function(u){return br(u)&&ji.call(u,"callee")&&!qf.call(u,"callee")},Tn=_t.isArray,M0=tn?jo(tn):function(u){return br(u)&&bs(u)==Xe};function lo(u){return null!=u&&R_(u.length)&&!Xo(u)}function yr(u){return br(u)&&lo(u)}var tl=Jr||ty,I0=ii?jo(ii):function(u){return br(u)&&bs(u)==Le};function Ea(u){if(!br(u))return!1;var h=bs(u);return h==Oe||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!Op(u)}function Xo(u){if(!vr(u))return!1;var h=bs(u);return h==Ue||h==qe||"[object AsyncFunction]"==h||"[object Proxy]"==h}function Ip(u){return"number"==typeof u&&u==Kn(u)}function R_(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Te}function vr(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function br(u){return null!=u&&"object"==typeof u}var cA=nr?jo(nr):function(u){return br(u)&&Bs(u)==Be};function hA(u){return"number"==typeof u||br(u)&&bs(u)==z}function Op(u){if(!br(u)||bs(u)!=be)return!1;var h=ga(u);if(null===h)return!0;var m=ji.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&_r.call(m)==Mx}var P0=so?jo(so):function(u){return br(u)&&bs(u)==Et},fA=cc?jo(cc):function(u){return br(u)&&Bs(u)==pt};function P_(u){return"string"==typeof u||!Tn(u)&&br(u)&&bs(u)==pe}function Qo(u){return"symbol"==typeof u||br(u)&&bs(u)==B}var Gh=Qr?jo(Qr):function(u){return br(u)&&R_(u.length)&&!!_n[bs(u)]},Ec=pp(Ab),F_=pp(function(u,h){return u<=h});function F0(u){if(!u)return[];if(lo(u))return P_(u)?Ha(u):qs(u);if(wh&&u[wh])return function(st){for(var Tt,_t=[];!(Tt=st.next()).done;)_t.push(Tt.value);return _t}(u[wh]());var h=Bs(u);return(h==Be?fb:h==pt?Am:Ld)(u)}function nl(u){return u?(u=co(u))===se||u===-se?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Kn(u){var h=nl(u),m=h%1;return h==h?m?h-m:h:0}function L_(u){return u?au(Kn(u),0,ye):0}function co(u){if("number"==typeof u)return u;if(Qo(u))return NaN;if(vr(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=vr(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=hb(u);var m=Qi.test(u);return m||Wn.test(u)?db(u.slice(2),m?2:8):En.test(u)?NaN:+u}function L0(u){return ba(u,Ks(u))}function Oi(u){return null==u?"":xo(u)}var pA=Il(function(u,h){if(vp(h)||lo(h))ba(h,Ss(h),u);else for(var m in h)ji.call(h,m)&&Wa(u,m,h[m])}),gA=Il(function(u,h){ba(h,Ks(h),u)}),Rd=Il(function(u,h,m,N){ba(h,Ks(h),u,N)}),mA=Il(function(u,h,m,N){ba(h,Ss(h),u,N)}),k0=Qa(zm),yA=si(function(u,h){u=Bi(u);var m=-1,N=h.length,ae=N>2?h[2]:J;for(ae&&js(h[0],h[1],ae)&&(N=1);++m1),Ce}),ba(u,n_(u),m),N&&(m=Ls(m,7,gp));for(var ae=h.length;ae--;)uu(m,h[ae]);return m}),SA=Qa(function(u,h){return null==u?{}:function(u,h){return Tb(u,h,function(m,N){return Rp(u,N)})}(u,h)});function G0(u,h){if(null==u)return{};var m=Li(n_(u),function(N){return[N]});return h=On(h),Tb(u,m,function(N,ae){return h(N,ae[0])})}var CA=mu(Ss),W0=mu(Ks);function Ld(u){return null==u?[]:xm(u,Ss(u))}var MA=Ol(function(u,h,m){return h=h.toLowerCase(),u+(m?V_(h):h)});function V_(u){return Fp(Oi(u).toLowerCase())}function U_(u){return(u=Oi(u))&&u.replace(ca,_P).replace(wm,"")}var OA=Ol(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),RA=Ol(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),nF=dp("toLowerCase"),kA=Ol(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),G_=Ol(function(u,h,m){return u+(m?" ":"")+Fp(h)}),Z0=Ol(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),Fp=dp("toUpperCase");function Y_(u,h,m){return u=Oi(u),(h=m?J:h)===J?function(st){return Cl.test(st)}(u)?function(st){return st.match(ab)||[]}(u):function(st){return st.match(Bn)||[]}(u):u.match(h)||[]}var K_=si(function(u,h){try{return Zr(u,J,h)}catch(m){return Ea(m)?m:new Cn(m)}}),J0=Qa(function(u,h){return Ps(h,function(m){m=Zn(m),qa(u,m,zh(u[m],u))}),u});function X_(u){return function(){return u}}var rF=gu(),kd=gu(!0);function Xs(u){return u}function vu(u){return Xx("function"==typeof u?u:Ls(u,1))}var Q_=si(function(u,h){return function(m){return va(m,u,h)}}),ew=si(function(u,h){return function(m){return va(u,m,h)}});function Z_(u,h,m){var N=Ss(h),ae=Rh(h,N);null==m&&(!vr(h)||!ae.length&&N.length)&&(m=h,h=u,u=this,ae=Rh(h,Ss(h)));var Ce=!(vr(m)&&"chain"in m&&!m.chain),ze=Xo(u);return Ps(ae,function(Ye){var at=h[Ye];u[Ye]=at,ze&&(u.prototype[Ye]=function(){var Rt=this.__chain__;if(Ce||Rt){var Nt=u(this.__wrapped__),Vt=Nt.__actions__=qs(this.__actions__);return Vt.push({func:at,args:arguments,thisArg:u}),Nt.__chain__=Rt,Nt}return at.apply(u,Fr([this.value()],arguments))})}),u}function J_(){}var GA=hp(Li),$A=hp(Qn),nw=hp(wo);function bu(u){return Wo(u)?Sm(Zn(u)):function(u){return function(h){return Uo(h,u)}}(u)}var WA=Fb(),qA=Fb(!0);function Cc(){return[]}function ty(){return!1}var zn=e_(function(u,h){return u+h},0),ny=xd("ceil"),oF=e_(function(u,h){return u/h},1),Ll=xd("floor"),ow=e_(function(u,h){return u*h},1),aw=xd("round"),lw=e_(function(u,h){return u-h},0);return Se.after=function(u,h){if("function"!=typeof h)throw new pa(Ae);return u=Kn(u),function(){if(--u<1)return h.apply(this,arguments)}},Se.ary=Tp,Se.assign=pA,Se.assignIn=gA,Se.assignInWith=Rd,Se.assignWith=mA,Se.at=k0,Se.before=T_,Se.bind=zh,Se.bindAll=J0,Se.bindKey=Od,Se.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Tn(u)?u:[u]},Se.chain=b_,Se.chunk=function(u,h,m){h=(m?js(u,h,m):h===J)?1:Lr(Kn(h),0);var N=null==u?0:u.length;if(!N||h<1)return[];for(var ae=0,Ce=0,ze=_t(Bt(N/h));aeae?0:ae+m),(N=N===J||N>ae?ae:Kn(N))<0&&(N+=ae),N=m>N?0:L_(N);m>>0)?(u=Oi(u))&&("string"==typeof h||null!=h&&!P0(h))&&!(h=xo(h))&&_h(u)?Ka(Ha(u),0,m):u.split(h,m):[]},Se.spread=function(u,h){if("function"!=typeof u)throw new pa(Ae);return h=null==h?0:Lr(Kn(h),0),si(function(m){var N=m[h],ae=Ka(m,0,h);return N&&Fr(ae,N),Zr(u,this,ae)})},Se.tail=function(u){var h=null==u?0:u.length;return h?ws(u,1,h):[]},Se.take=function(u,h,m){return u&&u.length?ws(u,0,(h=m||h===J?1:Kn(h))<0?0:h):[]},Se.takeRight=function(u,h,m){var N=null==u?0:u.length;return N?ws(u,(h=N-(h=m||h===J?1:Kn(h)))<0?0:h,N):[]},Se.takeRightWhile=function(u,h){return u&&u.length?du(u,On(h,3),!1,!0):[]},Se.takeWhile=function(u,h){return u&&u.length?du(u,On(h,3)):[]},Se.tap=function(u,h){return h(u),u},Se.throttle=function(u,h,m){var N=!0,ae=!0;if("function"!=typeof u)throw new pa(Ae);return vr(m)&&(N="leading"in m?!!m.leading:N,ae="trailing"in m?!!m.trailing:ae),E0(u,h,{leading:N,maxWait:h,trailing:ae})},Se.thru=Md,Se.toArray=F0,Se.toPairs=CA,Se.toPairsIn=W0,Se.toPath=function(u){return Tn(u)?Li(u,Zn):Qo(u)?[u]:qs(qb(Oi(u)))},Se.toPlainObject=L0,Se.transform=function(u,h,m){var N=Tn(u),ae=N||tl(u)||Gh(u);if(h=On(h,4),null==m){var Ce=u&&u.constructor;m=ae?N?new Ce:[]:vr(u)&&Xo(Ce)?ou(ga(u)):{}}return(ae?Ps:Ya)(u,function(ze,Ye,at){return h(m,ze,Ye,at)}),m},Se.unary=function(u){return Tp(u,1)},Se.union=r0,Se.unionBy=L1,Se.unionWith=k1,Se.uniq=function(u){return u&&u.length?mc(u):[]},Se.uniqBy=function(u,h){return u&&u.length?mc(u,On(h,2)):[]},Se.uniqWith=function(u,h){return h="function"==typeof h?h:J,u&&u.length?mc(u,J,h):[]},Se.unset=function(u,h){return null==u||uu(u,h)},Se.unzip=s0,Se.unzipWith=j1,Se.update=function(u,h,m){return null==u?u:lp(u,h,Zm(m))},Se.updateWith=function(u,h,m,N){return N="function"==typeof N?N:J,null==u?u:lp(u,h,Zm(m),N)},Se.values=Ld,Se.valuesIn=function(u){return null==u?[]:xm(u,Ks(u))},Se.without=o0,Se.words=Y_,Se.wrap=function(u,h){return Dp(Zm(h),u)},Se.xor=$P,Se.xorBy=To,Se.xorWith=y_,Se.zip=v_,Se.zipObject=function(u,h){return cp(u||[],h||[],Wa)},Se.zipObjectDeep=function(u,h){return cp(u||[],h||[],ap)},Se.zipWith=Uh,Se.entries=CA,Se.entriesIn=W0,Se.extend=gA,Se.extendWith=Rd,Z_(Se,Se),Se.add=zn,Se.attempt=K_,Se.camelCase=MA,Se.capitalize=V_,Se.ceil=ny,Se.clamp=function(u,h,m){return m===J&&(m=h,h=J),m!==J&&(m=(m=co(m))==m?m:0),h!==J&&(h=(h=co(h))==h?h:0),au(co(u),h,m)},Se.clone=function(u){return Ls(u,4)},Se.cloneDeep=function(u){return Ls(u,5)},Se.cloneDeepWith=function(u,h){return Ls(u,5,h="function"==typeof h?h:J)},Se.cloneWith=function(u,h){return Ls(u,4,h="function"==typeof h?h:J)},Se.conformsTo=function(u,h){return null==h||ip(u,h,Ss(h))},Se.deburr=U_,Se.defaultTo=function(u,h){return null==u||u!=u?h:u},Se.divide=oF,Se.endsWith=function(u,h,m){u=Oi(u),h=xo(h);var N=u.length,ae=m=m===J?N:au(Kn(m),0,N);return(m-=h.length)>=0&&u.slice(m,ae)==h},Se.eq=xn,Se.escape=function(u){return(u=Oi(u))&&Zt.test(u)?u.replace(la,yP):u},Se.escapeRegExp=function(u){return(u=Oi(u))&<.test(u)?u.replace(ke,"\\$&"):u},Se.every=function(u,h,m){var N=Tn(u)?Qn:Eb;return m&&js(u,h,m)&&(h=J),N(u,On(h,3))},Se.find=$1,Se.findIndex=h_,Se.findKey=function(u,h){return gh(u,On(h,3),Ya)},Se.findLast=W1,Se.findLastIndex=f_,Se.findLastKey=function(u,h){return gh(u,On(h,3),rp)},Se.floor=Ll,Se.forEach=x_,Se.forEachRight=Cp,Se.forIn=function(u,h){return null==u?u:gd(u,On(h,3),Ks)},Se.forInRight=function(u,h){return null==u?u:md(u,On(h,3),Ks)},Se.forOwn=function(u,h){return u&&Ya(u,On(h,3))},Se.forOwnRight=function(u,h){return u&&rp(u,On(h,3))},Se.get=qh,Se.gt=Yt,Se.gte=D0,Se.has=function(u,h){return null!=u&&zb(u,h,_d)},Se.hasIn=Rp,Se.head=Kb,Se.identity=Xs,Se.includes=function(u,h,m,N){u=lo(u)?u:Ld(u),m=m&&!N?Kn(m):0;var ae=u.length;return m<0&&(m=Lr(ae+m,0)),P_(u)?m<=ae&&u.indexOf(h,m)>-1:!!ae&&za(u,h,m)>-1},Se.indexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=null==m?0:Kn(m);return ae<0&&(ae=Lr(N+ae,0)),za(u,h,ae)},Se.inRange=function(u,h,m){return h=nl(h),m===J?(m=h,h=0):m=nl(m),function(u,h,m){return u>=ls(h,m)&&u=-Te&&u<=Te},Se.isSet=fA,Se.isString=P_,Se.isSymbol=Qo,Se.isTypedArray=Gh,Se.isUndefined=function(u){return u===J},Se.isWeakMap=function(u){return br(u)&&Bs(u)==k},Se.isWeakSet=function(u){return br(u)&&"[object WeakSet]"==bs(u)},Se.join=function(u,h){return null==u?"":Eh.call(u,h)},Se.kebabCase=OA,Se.last=qo,Se.lastIndexOf=function(u,h,m){var N=null==u?0:u.length;if(!N)return-1;var ae=N;return m!==J&&(ae=(ae=Kn(m))<0?Lr(N+ae,0):ls(ae,N-1)),h==h?function(st,Tt,_t){for(var cn=_t+1;cn--;)if(st[cn]===Tt)return cn;return cn}(u,h,ae):od(u,uc,ae,!0)},Se.lowerCase=RA,Se.lowerFirst=nF,Se.lt=Ec,Se.lte=F_,Se.max=function(u){return u&&u.length?Oh(u,Xs,zo):J},Se.maxBy=function(u,h){return u&&u.length?Oh(u,On(h,2),zo):J},Se.mean=function(u){return _s(u,Xs)},Se.meanBy=function(u,h){return _s(u,On(h,2))},Se.min=function(u){return u&&u.length?Oh(u,Xs,Ab):J},Se.minBy=function(u,h){return u&&u.length?Oh(u,On(h,2),Ab):J},Se.stubArray=Cc,Se.stubFalse=ty,Se.stubObject=function(){return{}},Se.stubString=function(){return""},Se.stubTrue=function(){return!0},Se.multiply=ow,Se.nth=function(u,h){return u&&u.length?cu(u,Kn(h)):J},Se.noConflict=function(){return Ii._===this&&(Ii._=Om),this},Se.noop=J_,Se.now=yu,Se.pad=function(u,h,m){u=Oi(u);var N=(h=Kn(h))?yh(u):0;if(!h||N>=h)return u;var ae=(h-N)/2;return fp(ui(ae),m)+u+fp(Bt(ae),m)},Se.padEnd=function(u,h,m){u=Oi(u);var N=(h=Kn(h))?yh(u):0;return h&&Nh){var N=u;u=h,h=N}if(m||u%1||h%1){var ae=Sh();return ls(u+ae*(h-u+wx("1e-"+((ae+"").length-1))),h)}return Ml(u,h)},Se.reduce=function(u,h,m){var N=Tn(u)?nu:Bo,ae=arguments.length<3;return N(u,On(h,4),m,ae,pc)},Se.reduceRight=function(u,h,m){var N=Tn(u)?sd:Bo,ae=arguments.length<3;return N(u,On(h,4),m,ae,Gm)},Se.repeat=function(u,h,m){return h=(m?js(u,h,m):h===J)?1:Kn(h),op(Oi(u),h)},Se.replace=function(){var u=arguments,h=Oi(u[0]);return u.length<3?h:h.replace(u[1],u[2])},Se.result=function(u,h,m){var N=-1,ae=(h=yc(h,u)).length;for(ae||(ae=1,u=J);++NTe)return[];var m=ye,N=ls(u,ye);h=On(h),u-=ye;for(var ae=ld(N,h);++m=Ce)return u;var Ye=m-yh(N);if(Ye<1)return N;var at=ze?Ka(ze,0,Ye).join(""):u.slice(0,Ye);if(ae===J)return at+N;if(ze&&(Ye+=at.length-Ye),P0(ae)){if(u.slice(Ye).search(ae)){var Rt,Nt=at;for(ae.global||(ae=Mm(ae.source,Oi(Un.exec(ae))+"g")),ae.lastIndex=0;Rt=ae.exec(Nt);)var Vt=Rt.index;at=at.slice(0,Vt===J?Ye:Vt)}}else if(u.indexOf(xo(ae),Ye)!=Ye){var en=at.lastIndexOf(ae);en>-1&&(at=at.slice(0,en))}return at+N},Se.unescape=function(u){return(u=Oi(u))&&ps.test(u)?u.replace(wl,Dm):u},Se.uniqueId=function(u){var h=++xP;return Oi(u)+h},Se.upperCase=Z0,Se.upperFirst=Fp,Se.each=x_,Se.eachRight=Cp,Se.first=Kb,Z_(Se,function(){var u={};return Ya(Se,function(h,m){ji.call(Se.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),Se.VERSION="4.17.21",Ps(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){Se[u].placeholder=Se}),Ps(["drop","take"],function(u,h){ri.prototype[u]=function(m){m=m===J?1:Lr(Kn(m),0);var N=this.__filtered__&&!h?new ri(this):this.clone();return N.__filtered__?N.__takeCount__=ls(m,N.__takeCount__):N.__views__.push({size:ls(m,ye),type:u+(N.__dir__<0?"Right":"")}),N},ri.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),Ps(["filter","map","takeWhile"],function(u,h){var m=h+1,N=1==m||3==m;ri.prototype[u]=function(ae){var Ce=this.clone();return Ce.__iteratees__.push({iteratee:On(ae,3),type:m}),Ce.__filtered__=Ce.__filtered__||N,Ce}}),Ps(["head","last"],function(u,h){var m="take"+(h?"Right":"");ri.prototype[u]=function(){return this[m](1).value()[0]}}),Ps(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");ri.prototype[u]=function(){return this.__filtered__?new ri(this):this[m](1)}}),ri.prototype.compact=function(){return this.filter(Xs)},ri.prototype.find=function(u){return this.filter(u).head()},ri.prototype.findLast=function(u){return this.reverse().find(u)},ri.prototype.invokeMap=si(function(u,h){return"function"==typeof u?new ri(this):this.map(function(m){return va(m,u,h)})}),ri.prototype.reject=function(u){return this.filter(I_(On(u)))},ri.prototype.slice=function(u,h){u=Kn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new ri(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==J&&(m=(h=Kn(h))<0?m.dropRight(-h):m.take(h-u)),m)},ri.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},ri.prototype.toArray=function(){return this.take(ye)},Ya(ri.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),N=/^(?:head|last)$/.test(h),ae=Se[N?"take"+("last"==h?"Right":""):h],Ce=N||/^find/.test(h);!ae||(Se.prototype[h]=function(){var ze=this.__wrapped__,Ye=N?[1]:arguments,at=ze instanceof ri,Rt=Ye[0],Nt=at||Tn(ze),Vt=function(ai){var vi=ae.apply(Se,Fr([ai],Ye));return N&&en?vi[0]:vi};Nt&&m&&"function"==typeof Rt&&1!=Rt.length&&(at=Nt=!1);var en=this.__chain__,vn=!!this.__actions__.length,Nn=Ce&&!en,oi=at&&!vn;if(!Ce&&Nt){ze=oi?ze:new ri(this);var Fn=u.apply(ze,Ye);return Fn.__actions__.push({func:Md,args:[Vt],thisArg:J}),new So(Fn,en)}return Nn&&oi?u.apply(this,Ye):(Fn=this.thru(Vt),Nn?N?Fn.value()[0]:Fn.value():Fn)})}),Ps(["pop","push","shift","sort","splice","unshift"],function(u){var h=ir[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",N=/^(?:pop|shift)$/.test(u);Se.prototype[u]=function(){var ae=arguments;if(N&&!this.__chain__){var Ce=this.value();return h.apply(Tn(Ce)?Ce:[],ae)}return this[m](function(ze){return h.apply(Tn(ze)?ze:[],ae)})}}),Ya(ri.prototype,function(u,h){var m=Se[h];if(m){var N=m.name+"";ji.call(dd,N)||(dd[N]=[]),dd[N].push({name:h,func:m})}}),dd[bc(J,2).name]=[{name:"wrapper",func:J}],ri.prototype.clone=function(){var u=new ri(this.__wrapped__);return u.__actions__=qs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=qs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=qs(this.__views__),u},ri.prototype.reverse=function(){if(this.__filtered__){var u=new ri(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},ri.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Tn(u),N=h<0,ae=m?u.length:0,Ce=function(u,h,m){for(var N=-1,ae=m.length;++N=this.__values__.length;return{done:u,value:u?J:this.__values__[this.__index__++]}},Se.prototype.plant=function(u){for(var h,m=this;m instanceof Th;){var N=wp(m);N.__index__=0,N.__values__=J,h?ae.__wrapped__=N:h=N;var ae=N;m=m.__wrapped__}return ae.__wrapped__=u,h},Se.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof ri){var h=u;return this.__actions__.length&&(h=new ri(this)),(h=h.reverse()).__actions__.push({func:Md,args:[__],thisArg:J}),new So(h,this.__chain__)}return this.thru(__)},Se.prototype.toJSON=Se.prototype.valueOf=Se.prototype.value=function(){return e1(this.__wrapped__,this.__actions__)},Se.prototype.first=Se.prototype.head,wh&&(Se.prototype[wh]=function(){return this}),Se}();Ii._=vh,(gt=function(){return vh}.call(it,tt,it,jt))!==J&&(jt.exports=gt)}.call(this)},478:function(jt){jt.exports=function(){"use strict";function it(rt,ot){for(var ct=0;ctrt.length)&&(ot=rt.length);for(var ct=0,fe=new Array(ot);ct=rt.length?{done:!0}:{done:!1,value:rt[fe++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var ut={exports:{}};function Y(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}ut.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:Y,changeDefaults:function(rt){ut.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,re={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(ot){return re[ot]};var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function R(rt){return rt.replace(S,function(ot,ct){return"colon"===(ct=ct.toLowerCase())?":":"#"===ct.charAt(0)?"x"===ct.charAt(1)?String.fromCharCode(parseInt(ct.substring(2),16)):String.fromCharCode(+ct.substring(1)):""})}var A=/(^|[^\[])\^/g;var y=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var j={},I=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;function M(rt,ot){j[" "+rt]||(j[" "+rt]=I.test(rt)?rt+"/":U(rt,"/",!0));var ct=-1===(rt=j[" "+rt]).indexOf(":");return"//"===ot.substring(0,2)?ct?ot:rt.replace(H,"$1")+ot:"/"===ot.charAt(0)?ct?ot:rt.replace(K,"$1")+ot:rt+ot}function U(rt,ot,ct){var fe=rt.length;if(0===fe)return"";for(var ve=0;ve1;)1&ot&&(ct+=rt),ot>>=1,rt+=rt;return ct+rt},Te=ut.exports.defaults,me=U,te=function(rt,ot){var fe=rt.replace(/\|/g,function(ke,lt,Qe){for(var vt=!1,St=lt;--St>=0&&"\\"===Qe[St];)vt=!vt;return vt?"|":" |"}).split(/ \|/),ve=0;if(fe.length>ot)fe.splice(ot);else for(;fe.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},ot.code=function(fe){var ve=this.rules.block.code.exec(fe);if(ve){var ke=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:me(ke,"\n")}}},ot.fences=function(fe){var ve=this.rules.block.fences.exec(fe);if(ve){var ke=ve[0],lt=function(rt,ot){var ct=rt.match(/^(\s+)(?:```)/);if(null===ct)return ot;var fe=ct[1];return ot.split("\n").map(function(ve){var ke=ve.match(/^\s+/);return null===ke?ve:ke[0].length>=fe.length?ve.slice(fe.length):ve}).join("\n")}(ke,ve[3]||"");return{type:"code",raw:ke,lang:ve[2]?ve[2].trim():ve[2],text:lt}}},ot.heading=function(fe){var ve=this.rules.block.heading.exec(fe);if(ve){var ke=ve[2].trim();if(/#$/.test(ke)){var lt=me(ke,"#");(this.options.pedantic||!lt||/ $/.test(lt))&&(ke=lt.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:ke}}},ot.nptable=function(fe){var ve=this.rules.block.nptable.exec(fe);if(ve){var ke={type:"table",header:te(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(ke.header.length===ke.align.length){var Qe,lt=ke.align.length;for(Qe=0;Qe ?/gm,"");return{type:"blockquote",raw:ve[0],text:ke}}},ot.list=function(fe){var ve=this.rules.block.list.exec(fe);if(ve){var qt,Bn,ti,Mn,pn,Un,En,Qi,Zi,ke=ve[0],lt=ve[2],Qe=lt.length>1,vt={type:"list",raw:ke,ordered:Qe,start:Qe?+lt.slice(0,-1):"",loose:!1,items:[]},St=ve[0].match(this.rules.block.item),At=!1,Wn=St.length;ti=this.rules.block.listItemStart.exec(St[0]);for(var Fi=0;Fiti[1].length:Mn[1].length>=ti[0].length||Mn[1].length>3){St.splice(Fi,2,St[Fi]+(!this.options.pedantic&&Mn[1].length/i.test(lt[0])&&(ve=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(lt[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(lt[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:lt[0],inLink:ve,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(lt[0]):ye(lt[0]):lt[0]}},ot.link=function(fe){var ve=this.rules.inline.link.exec(fe);if(ve){var ke=ve[2].trim();if(!this.options.pedantic&&/^$/.test(ke))return;var lt=me(ke.slice(0,-1),"\\");if((ke.length-lt.length)%2==0)return}else{var Qe=Me(ve[2],"()");if(Qe>-1){var St=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Qe;ve[2]=ve[2].substring(0,Qe),ve[0]=ve[0].substring(0,St).trim(),ve[3]=""}}var At=ve[2],qt="";if(this.options.pedantic){var Bn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(At);Bn&&(At=Bn[1],qt=Bn[3])}else qt=ve[3]?ve[3].slice(1,-1):"";return At=At.trim(),/^$/.test(ke)?At.slice(1):At.slice(1,-1)),Ve(ve,{href:At&&At.replace(this.rules.inline._escapes,"$1"),title:qt&&qt.replace(this.rules.inline._escapes,"$1")},ve[0])}},ot.reflink=function(fe,ve){var ke;if((ke=this.rules.inline.reflink.exec(fe))||(ke=this.rules.inline.nolink.exec(fe))){var lt=(ke[2]||ke[1]).replace(/\s+/g," ");if(!(lt=ve[lt.toLowerCase()])||!lt.href){var Qe=ke[0].charAt(0);return{type:"text",raw:Qe,text:Qe}}return Ve(ke,lt,ke[0])}},ot.emStrong=function(fe,ve,ke){void 0===ke&&(ke="");var lt=this.rules.inline.emStrong.lDelim.exec(fe);if(lt&&(!lt[3]||!ke.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Qe=lt[1]||lt[2]||"";if(!Qe||Qe&&(""===ke||this.rules.inline.punctuation.exec(ke))){var St,At,vt=lt[0].length-1,qt=vt,Bn=0,ti="*"===lt[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ti.lastIndex=0,ve=ve.slice(-1*fe.length+vt);null!=(lt=ti.exec(ve));)if(St=lt[1]||lt[2]||lt[3]||lt[4]||lt[5]||lt[6]){if(At=St.length,lt[3]||lt[4]){qt+=At;continue}if((lt[5]||lt[6])&&vt%3&&!((vt+At)%3)){Bn+=At;continue}if(!((qt-=At)>0))return At=Math.min(At,At+qt+Bn),Math.min(vt,At)%2?{type:"em",raw:fe.slice(0,vt+lt.index+At+1),text:fe.slice(1,vt+lt.index+At)}:{type:"strong",raw:fe.slice(0,vt+lt.index+At+1),text:fe.slice(2,vt+lt.index+At-1)}}}}},ot.codespan=function(fe){var ve=this.rules.inline.code.exec(fe);if(ve){var ke=ve[2].replace(/\n/g," "),lt=/[^ ]/.test(ke),Qe=/^ /.test(ke)&&/ $/.test(ke);return lt&&Qe&&(ke=ke.substring(1,ke.length-1)),ke=ye(ke,!0),{type:"codespan",raw:ve[0],text:ke}}},ot.br=function(fe){var ve=this.rules.inline.br.exec(fe);if(ve)return{type:"br",raw:ve[0]}},ot.del=function(fe){var ve=this.rules.inline.del.exec(fe);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},ot.autolink=function(fe,ve){var lt,Qe,ke=this.rules.inline.autolink.exec(fe);if(ke)return Qe="@"===ke[2]?"mailto:"+(lt=ye(this.options.mangle?ve(ke[1]):ke[1])):lt=ye(ke[1]),{type:"link",raw:ke[0],text:lt,href:Qe,tokens:[{type:"text",raw:lt,text:lt}]}},ot.url=function(fe,ve){var ke;if(ke=this.rules.inline.url.exec(fe)){var lt,Qe;if("@"===ke[2])Qe="mailto:"+(lt=ye(this.options.mangle?ve(ke[0]):ke[0]));else{var vt;do{vt=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0]}while(vt!==ke[0]);lt=ye(ke[0]),Qe="www."===ke[1]?"http://"+lt:lt}return{type:"link",raw:ke[0],text:lt,href:Qe,tokens:[{type:"text",raw:lt,text:lt}]}}},ot.inlineText=function(fe,ve,ke){var Qe,lt=this.rules.inline.text.exec(fe);if(lt)return Qe=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(lt[0]):ye(lt[0]):lt[0]:ye(this.options.smartypants?ke(lt[0]):lt[0]),{type:"text",raw:lt[0],text:Qe}},rt}(),Je=se_noopTest,Ke=se_edit,je=se_merge,Le={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Je,table:Je,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Le.def=Ke(Le.def).replace("label",Le._label).replace("title",Le._title).getRegex(),Le.bullet=/(?:[*+-]|\d{1,9}[.)])/,Le.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Le.item=Ke(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Ke(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Ke(Le.list).replace(/bull/g,Le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Le.def.source+")").getRegex(),Le._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Le._comment=/|$)/,Le.html=Ke(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Ke(Le._paragraph).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.blockquote=Ke(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=je({},Le),Le.gfm=je({},Le.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Le.gfm.nptable=Ke(Le.gfm.nptable).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.gfm.table=Ke(Le.gfm.table).replace("hr",Le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Le._tag).getRegex(),Le.pedantic=je({},Le.normal,{html:Ke("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Je,paragraph:Ke(Le.normal._paragraph).replace("hr",Le.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ee.punctuation=Ke(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ee.escapedEmSt=/\\\*|\\_/g,Ee._comment=Ke(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ee.emStrong.lDelim=Ke(Ee.emStrong.lDelim).replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimAst=Ke(Ee.emStrong.rDelimAst,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee.emStrong.rDelimUnd=Ke(Ee.emStrong.rDelimUnd,"g").replace(/punct/g,Ee._punctuation).getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ee.autolink=Ke(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Ke(Ee.tag).replace("comment",Ee._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Ke(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Ke(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Ke(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=je({},Ee),Ee.pedantic=je({},Ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ke(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee._label).getRegex(),reflink:Ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=je({},Ee.normal,{escape:Ke(Ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(fe="x"+fe.toString(16)),ot+="&#"+fe+";";return ot}var Pe=function(){function rt(ct){this.tokens=[],this.tokens.links=Object.create(null),this.options=ct||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var fe={block:Be.normal,inline:z.normal};this.options.pedantic?(fe.block=Be.pedantic,fe.inline=z.pedantic):this.options.gfm&&(fe.block=Be.gfm,fe.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=fe}rt.lex=function(fe,ve){return new rt(ve).lex(fe)},rt.lexInline=function(fe,ve){return new rt(ve).inlineTokens(fe)};var ot=rt.prototype;return ot.lex=function(fe){return fe=fe.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(fe,this.tokens,!0),this.inline(this.tokens),this.tokens},ot.blockTokens=function(fe,ve,ke){var Qe,vt,St,At,qt,Bn,lt=this;for(void 0===ve&&(ve=[]),void 0===ke&&(ke=!0),this.options.pedantic&&(fe=fe.replace(/^ +$/gm,""));fe;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Mn){return!!(Qe=Mn.call(lt,fe,ve))&&(fe=fe.substring(Qe.raw.length),ve.push(Qe),!0)}))){if(Qe=this.tokenizer.space(fe)){fe=fe.substring(Qe.raw.length),Qe.type&&ve.push(Qe);continue}if(Qe=this.tokenizer.code(fe)){fe=fe.substring(Qe.raw.length),(At=ve[ve.length-1])&&"paragraph"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe);continue}if(Qe=this.tokenizer.fences(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.heading(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.nptable(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.hr(fe)){fe=fe.substring(Qe.raw.length),ve.push(Qe);continue}if(Qe=this.tokenizer.blockquote(fe)){fe=fe.substring(Qe.raw.length),Qe.tokens=this.blockTokens(Qe.text,[],ke),ve.push(Qe);continue}if(Qe=this.tokenizer.list(fe)){for(fe=fe.substring(Qe.raw.length),St=Qe.items.length,vt=0;vt=0&&(Mn=Math.min(Mn,Un))}),Mn<1/0&&Mn>=0&&(qt=fe.substring(0,Mn+1))}(),ke&&(Qe=this.tokenizer.paragraph(qt))){At=ve[ve.length-1],Bn&&"paragraph"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe),Bn=qt.length!==fe.length,fe=fe.substring(Qe.raw.length);continue}if(Qe=this.tokenizer.text(fe)){fe=fe.substring(Qe.raw.length),(At=ve[ve.length-1])&&"text"===At.type?(At.raw+="\n"+Qe.raw,At.text+="\n"+Qe.text):ve.push(Qe);continue}if(fe){var ti="Infinite loop on byte: "+fe.charCodeAt(0);if(this.options.silent){console.error(ti);break}throw new Error(ti)}}return ve},ot.inline=function(fe){var ve,ke,lt,Qe,vt,St,At=fe.length;for(ve=0;ve0)for(;null!=(Bn=this.tokenizer.rules.inline.reflinkSearch.exec(qt));)pn.includes(Bn[0].slice(Bn[0].lastIndexOf("[")+1,-1))&&(qt=qt.slice(0,Bn.index)+"["+X("a",Bn[0].length-2)+"]"+qt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(Bn=this.tokenizer.rules.inline.blockSkip.exec(qt));)qt=qt.slice(0,Bn.index)+"["+X("a",Bn[0].length-2)+"]"+qt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(Bn=this.tokenizer.rules.inline.escapedEmSt.exec(qt));)qt=qt.slice(0,Bn.index)+"++"+qt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;fe;)if(ti||(Mn=""),ti=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(En){return!!(vt=En.call(Qe,fe,ve))&&(fe=fe.substring(vt.raw.length),ve.push(vt),!0)}))){if(vt=this.tokenizer.escape(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.tag(fe,ke,lt)){fe=fe.substring(vt.raw.length),ke=vt.inLink,lt=vt.inRawBlock,(St=ve[ve.length-1])&&"text"===vt.type&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.link(fe)){fe=fe.substring(vt.raw.length),"link"===vt.type&&(vt.tokens=this.inlineTokens(vt.text,[],!0,lt)),ve.push(vt);continue}if(vt=this.tokenizer.reflink(fe,this.tokens.links)){fe=fe.substring(vt.raw.length),St=ve[ve.length-1],"link"===vt.type?(vt.tokens=this.inlineTokens(vt.text,[],!0,lt),ve.push(vt)):St&&"text"===vt.type&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(vt=this.tokenizer.emStrong(fe,qt,Mn)){fe=fe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,lt),ve.push(vt);continue}if(vt=this.tokenizer.codespan(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.br(fe)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(vt=this.tokenizer.del(fe)){fe=fe.substring(vt.raw.length),vt.tokens=this.inlineTokens(vt.text,[],ke,lt),ve.push(vt);continue}if(vt=this.tokenizer.autolink(fe,ce)){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(!ke&&(vt=this.tokenizer.url(fe,ce))){fe=fe.substring(vt.raw.length),ve.push(vt);continue}if(At=fe,this.options.extensions&&this.options.extensions.startInline&&function(){var En=1/0,Qi=fe.slice(1),Zi=void 0;Qe.options.extensions.startInline.forEach(function(Wn){"number"==typeof(Zi=Wn.call(this,Qi))&&Zi>=0&&(En=Math.min(En,Zi))}),En<1/0&&En>=0&&(At=fe.substring(0,En+1))}(),vt=this.tokenizer.inlineText(At,lt,be)){fe=fe.substring(vt.raw.length),"_"!==vt.raw.slice(-1)&&(Mn=vt.raw.slice(-1)),ti=!0,(St=ve[ve.length-1])&&"text"===St.type?(St.raw+=vt.raw,St.text+=vt.text):ve.push(vt);continue}if(fe){var Un="Infinite loop on byte: "+fe.charCodeAt(0);if(this.options.silent){console.error(Un);break}throw new Error(Un)}}return ve},function(rt,ot,ct){ot&&it(rt.prototype,ot),ct&&it(rt,ct)}(rt,null,[{key:"rules",get:function(){return{block:Be,inline:z}}}]),rt}(),Et=ut.exports.defaults,pt=se_cleanUrl,pe=se_escape,B=function(){function rt(ct){this.options=ct||Et}var ot=rt.prototype;return ot.code=function(fe,ve,ke){var lt=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Qe=this.options.highlight(fe,lt);null!=Qe&&Qe!==fe&&(ke=!0,fe=Qe)}return fe=fe.replace(/\n$/,"")+"\n",lt?'
    '+(ke?fe:pe(fe,!0))+"
    \n":"
    "+(ke?fe:pe(fe,!0))+"
    \n"},ot.blockquote=function(fe){return"
    \n"+fe+"
    \n"},ot.html=function(fe){return fe},ot.heading=function(fe,ve,ke,lt){return this.options.headerIds?"'+fe+"\n":""+fe+"\n"},ot.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},ot.list=function(fe,ve,ke){var lt=ve?"ol":"ul";return"<"+lt+(ve&&1!==ke?' start="'+ke+'"':"")+">\n"+fe+"\n"},ot.listitem=function(fe){return"
  • "+fe+"
  • \n"},ot.checkbox=function(fe){return" "},ot.paragraph=function(fe){return"

    "+fe+"

    \n"},ot.table=function(fe,ve){return ve&&(ve=""+ve+""),"\n\n"+fe+"\n"+ve+"
    \n"},ot.tablerow=function(fe){return"\n"+fe+"\n"},ot.tablecell=function(fe,ve){var ke=ve.header?"th":"td";return(ve.align?"<"+ke+' align="'+ve.align+'">':"<"+ke+">")+fe+"\n"},ot.strong=function(fe){return""+fe+""},ot.em=function(fe){return""+fe+""},ot.codespan=function(fe){return""+fe+""},ot.br=function(){return this.options.xhtml?"
    ":"
    "},ot.del=function(fe){return""+fe+""},ot.link=function(fe,ve,ke){if(null===(fe=pt(this.options.sanitize,this.options.baseUrl,fe)))return ke;var lt='"+ke+""},ot.image=function(fe,ve,ke){if(null===(fe=pt(this.options.sanitize,this.options.baseUrl,fe)))return ke;var lt=''+ke+'":">")},ot.text=function(fe){return fe},rt}(),O=function(){function rt(){}var ot=rt.prototype;return ot.strong=function(fe){return fe},ot.em=function(fe){return fe},ot.codespan=function(fe){return fe},ot.del=function(fe){return fe},ot.html=function(fe){return fe},ot.text=function(fe){return fe},ot.link=function(fe,ve,ke){return""+ke},ot.image=function(fe,ve,ke){return""+ke},ot.br=function(){return""},rt}(),k=function(){function rt(){this.seen={}}var ot=rt.prototype;return ot.serialize=function(fe){return fe.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ot.getNextSafeSlug=function(fe,ve){var ke=fe,lt=0;if(this.seen.hasOwnProperty(ke)){lt=this.seen[fe];do{ke=fe+"-"+ ++lt}while(this.seen.hasOwnProperty(ke))}return ve||(this.seen[fe]=lt,this.seen[ke]=0),ke},ot.slug=function(fe,ve){void 0===ve&&(ve={});var ke=this.serialize(fe);return this.getNextSafeSlug(ke,ve.dryrun)},rt}(),Re=B,Xe=O,yt=k,It=ut.exports.defaults,An=se_unescape,Hn=Pe,yi=function(){function rt(ct){this.options=ct||It,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new yt}rt.parse=function(fe,ve){return new rt(ve).parse(fe)},rt.parseInline=function(fe,ve){return new rt(ve).parseInline(fe)};var ot=rt.prototype;return ot.parse=function(fe,ve){void 0===ve&&(ve=!0);var lt,Qe,vt,St,At,qt,Bn,ti,Mn,pn,Un,En,Qi,Zi,Wn,Fi,ca,Hr,ne,ke="",de=fe.length;for(lt=0;lt0&&"text"===Wn.tokens[0].type?(Wn.tokens[0].text=Hr+" "+Wn.tokens[0].text,Wn.tokens[0].tokens&&Wn.tokens[0].tokens.length>0&&"text"===Wn.tokens[0].tokens[0].type&&(Wn.tokens[0].tokens[0].text=Hr+" "+Wn.tokens[0].tokens[0].text)):Wn.tokens.unshift({type:"text",text:Hr}):Zi+=Hr),Zi+=this.parse(Wn.tokens,Qi),Mn+=this.renderer.listitem(Zi,ca,Fi);ke+=this.renderer.list(Mn,Un,En);continue;case"html":ke+=this.renderer.html(pn.text);continue;case"paragraph":ke+=this.renderer.paragraph(this.parseInline(pn.tokens));continue;case"text":for(Mn=pn.tokens?this.parseInline(pn.tokens):pn.text;lt+1An error occurred:

    "+Va(vt.message+"",!0)+"
    ";throw vt}}return Zt.options=Zt.setOptions=function(rt){return Os(Zt.defaults,rt),la(Zt.defaults),Zt},Zt.getDefaults=wl,Zt.defaults=ps,Zt.use=function(){for(var rt=this,ot=arguments.length,ct=new Array(ot),fe=0;feAn error occurred:

    "+Va(fe.message+"",!0)+"
    ";throw fe}},Zt.Parser=yi,Zt.parser=yi.parse,Zt.Renderer=Ur,Zt.TextRenderer=Is,Zt.Lexer=Hn,Zt.lexer=Hn.lex,Zt.Tokenizer=ci,Zt.Slugger=as,Zt.parse=Zt,Zt}()},369:(jt,it,tt)=>{var gt=tt(284),J=tt(830);function xt(){this.clear()}xt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},xt.prototype.enqueue=function(ut){return this.items.push(ut),++this.size},xt.prototype.dequeue=function(){if(this.size){var ut=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,ut}},xt.prototype.peek=function(){if(this.size)return this.items[this.offset]},xt.prototype.forEach=function(ut,Y){Y=arguments.length>1?Y:this;for(var Ae=this.offset,he=0,W=this.items.length;Ae=ut.length)return{done:!0};var Ae=ut[Y];return Y++,{value:Ae,done:!1}})},xt.prototype.entries=function(){var ut=this.items,Y=this.offset,Ae=0;return new gt(function(){if(Y>=ut.length)return{done:!0};var he=ut[Y];return Y++,{value:[Ae++,he],done:!1}})},"undefined"!=typeof Symbol&&(xt.prototype[Symbol.iterator]=xt.prototype.values),xt.prototype.toString=function(){return this.toArray().join(",")},xt.prototype.toJSON=function(){return this.toArray()},xt.prototype.inspect=function(){var ut=this.toArray();return Object.defineProperty(ut,"constructor",{value:xt,enumerable:!1}),ut},"undefined"!=typeof Symbol&&(xt.prototype[Symbol.for("nodejs.util.inspect.custom")]=xt.prototype.inspect),xt.from=function(ut){var Y=new xt;return J(ut,function(Ae){Y.enqueue(Ae)}),Y},xt.of=function(){return xt.from(arguments)},jt.exports=xt},830:jt=>{var it="undefined"!=typeof ArrayBuffer,tt="undefined"!=typeof Symbol;function gt(J,xt){var ut,Y,Ae,he,W;if(!J)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof xt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(J)||it&&ArrayBuffer.isView(J)||"string"==typeof J||"[object Arguments]"===J.toString())for(Ae=0,he=J.length;Ae{function it(tt){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:tt}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var tt=this._next();return tt.done&&(this.done=!0),tt},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var tt=arguments,gt=tt.length,J=0;return new it(function(){return J>=gt?{done:!0}:{done:!1,value:tt[J++]}})},it.empty=function(){var tt=new it(null);return tt.done=!0,tt},it.is=function(tt){return tt instanceof it||"object"==typeof tt&&null!==tt&&"function"==typeof tt.next},jt.exports=it},310:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==J.window.orientation},it.default=function(he){if(!he&&!(0,xt.default)())return"Node";if((0,ut.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},V=he||W.userAgent||"";if(V.indexOf("Edge")>-1)return"Edge";var L=-1!==V.indexOf("MSIE "),re=-1!==V.indexOf("Trident/");return L||re?"IE":J.window.chrome?"Chrome":J.window.safari?"Safari":J.window.mozInnerScreenX?"Firefox":"Unknown"};var J=tt(151),xt=gt(tt(602)),ut=gt(tt(344))},151:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var J=gt(tt(321)),xt={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&process};it.self=xt.self||xt.window||xt.global,it.window=xt.window||xt.self||xt.global,it.global=xt.global||xt.self||xt.window,it.document=xt.document||{},it.process=xt.process||{};var V=console;it.console=V},761:(jt,it,tt)=>{"use strict";var J=tt(948),xt=tt(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return ut.global}}),Object.defineProperty(it,"jU",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Ae.default}});var ut=tt(151),Y=V(tt(602)),Ae=V(tt(310));J(tt(344));function W(L){if("function"!=typeof WeakMap)return null;var re=new WeakMap,$=new WeakMap;return(W=function(S){return S?$:re})(L)}function V(L,re){if(!re&&L&&L.__esModule)return L;if(null===L||"object"!==xt(L)&&"function"!=typeof L)return{default:L};var $=W(re);if($&&$.has(L))return $.get(L);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in L)if("default"!==R&&Object.prototype.hasOwnProperty.call(L,R)){var A=S?Object.getOwnPropertyDescriptor(L,R):null;A&&(A.get||A.set)?Object.defineProperty(b,R,A):b[R]=L[R]}return b.default=L,$&&$.set(L,b),b}},602:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=ut,it.isBrowserMainThread=function(){return ut()&&"undefined"!=typeof document};var J=gt(tt(321)),xt=gt(tt(344));function ut(){return!("object"===("undefined"==typeof process?"undefined":(0,J.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,xt.default)()}},344:(jt,it,tt)=>{"use strict";var gt=tt(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(ut){if("undefined"!=typeof window&&"object"===(0,J.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,J.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,J.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Ae=ut||Y;return!!(Ae&&Ae.indexOf("Electron")>=0)};var J=gt(tt(321))},991:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),Object.defineProperty(xt,Ae,{enumerable:!0,get:function(){return ut[Y]}})}:function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),xt[Ae]=ut[Y]}),J=this&&this.__exportStar||function(xt,ut){for(var Y in xt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(ut,Y)&>(ut,xt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(180),it),J(tt(103),it),J(tt(965),it),J(tt(595),it),J(tt(417),it),J(tt(451),it),J(tt(735),it)},180:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(J){this.termType="BlankNode",this.value=J}equals(J){return!!J&&"BlankNode"===J.termType&&J.value===this.value}}},103:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const gt=tt(180),J=tt(965),xt=tt(595),ut=tt(417),Y=tt(451),Ae=tt(735);let he=0;it.DataFactory=class{constructor(L){this.blankNodeCounter=0,this.blankNodePrefix=(L=L||{}).blankNodePrefix||`df_${he++}_`}namedNode(L){return new ut.NamedNode(L)}blankNode(L){return new gt.BlankNode(L||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(L,re){return new xt.Literal(L,re)}variable(L){return new Ae.Variable(L)}defaultGraph(){return J.DefaultGraph.INSTANCE}quad(L,re,$,b){return new Y.Quad(L,re,$,b||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(xt.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}}},965:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class tt{constructor(){this.termType="DefaultGraph",this.value=""}equals(J){return!!J&&"DefaultGraph"===J.termType}}it.DefaultGraph=tt,tt.INSTANCE=new tt},595:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const gt=tt(417);class J{constructor(ut,Y){this.termType="Literal",this.value=ut,"string"==typeof Y?(this.language=Y,this.datatype=J.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=J.XSD_STRING)}equals(ut){return!!ut&&"Literal"===ut.termType&&ut.value===this.value&&ut.language===this.language&&ut.datatype.equals(this.datatype)}}it.Literal=J,J.RDF_LANGUAGE_STRING=new gt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),J.XSD_STRING=new gt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(J){this.termType="NamedNode",this.value=J}equals(J){return!!J&&"NamedNode"===J.termType&&J.value===this.value}}},451:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(J,xt,ut,Y){this.termType="Quad",this.value="",this.subject=J,this.predicate=xt,this.object=ut,this.graph=Y}equals(J){return!!J&&("Quad"===J.termType||!J.termType)&&this.subject.equals(J.subject)&&this.predicate.equals(J.predicate)&&this.object.equals(J.object)&&this.graph.equals(J.graph)}}},735:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(J){this.termType="Variable",this.value=J}equals(J){return!!J&&"Variable"===J.termType&&J.value===this.value}}},609:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(b,S,R,A){void 0===A&&(A=R),Object.defineProperty(b,A,{enumerable:!0,get:function(){return S[R]}})}:function(b,S,R,A){void 0===A&&(A=R),b[A]=S[R]}),J=this&&this.__exportStar||function(b,S){for(var R in b)"default"!==R&&!Object.prototype.hasOwnProperty.call(S,R)&>(S,b,R)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const xt=tt(991),ut=tt(938),Y=tt(60);J(tt(938),it),J(tt(871),it),J(tt(60),it);const Ae=new xt.DataFactory,he=new Y.Translator;function W(b,S){return he.fromRdf(b,S)}he.registerHandler(new ut.TypeHandlerString,ut.TypeHandlerString.TYPES.map(b=>Ae.namedNode(b)),["string"]),he.registerHandler(new ut.TypeHandlerBoolean,[ut.TypeHandlerBoolean.TYPE].map(b=>Ae.namedNode(b)),["boolean"]),he.registerHandler(new ut.TypeHandlerNumberDouble,ut.TypeHandlerNumberDouble.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new ut.TypeHandlerNumberInteger,ut.TypeHandlerNumberInteger.TYPES.map(b=>Ae.namedNode(b)),["number"]),he.registerHandler(new ut.TypeHandlerDate,ut.TypeHandlerDate.TYPES.map(b=>Ae.namedNode(b)),["object"]),it.fromRdf=W,it.toRdf=function(b,S){return S&&"namedNode"in S&&(S={dataFactory:S}),(S=S||{})&&!S.dataFactory&&(S.dataFactory=Ae),he.toRdf(b,S)},it.getTermRaw=function(b,S){return"Literal"===b.termType?W(b,S):b.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Translator=void 0,it.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(J){throw new Error(`Invalid RDF ${J.datatype.value} value: '${J.value}'`)}registerHandler(J,xt,ut){for(const Y of xt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=J;for(const Y of ut){let Ae=this.toRdfHandlers[Y];Ae||(this.toRdfHandlers[Y]=Ae=[]),Ae.push(J)}}fromRdf(J,xt){const ut=this.fromRdfHandlers[J.datatype.value];return ut?ut.fromRdf(J,xt):J.value}toRdf(J,xt){const ut=this.toRdfHandlers[typeof J];if(ut)for(const Y of ut){const Ae=Y.toRdf(J,xt);if(Ae)return Ae}throw new Error(`Invalid JavaScript value: '${J}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const gt=tt(60);class J{fromRdf(ut,Y){switch(ut.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&>.Translator.incorrectRdfDataType(ut),!1}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Ae.literal(ut?"true":"false",Y||Ae.namedNode(J.TYPE))}}it.TypeHandlerBoolean=J,J.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const gt=tt(60);class J{fromRdf(ut,Y){switch(Y&&!ut.value.match(J.VALIDATORS[ut.datatype.value.substr(33,ut.datatype.value.length)])&>.Translator.incorrectRdfDataType(ut),ut.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(ut.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const Ae=ut.value.split("-");return new Date(0,parseInt(Ae[0],10)-1,parseInt(Ae[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(ut.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(ut.value+"-01");default:return new Date(ut.value)}}toRdf(ut,{datatype:Y,dataFactory:Ae}){if(Y=Y||Ae.namedNode(J.TYPES[0]),!(ut instanceof Date))return null;const he=ut;let W;switch(Y.value){case"http://www.w3.org/2001/XMLSchema#gDay":W=String(he.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":W=he.getUTCMonth()+1+"-"+he.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":W=String(he.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":W=he.getUTCFullYear()+"-"+(he.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":W=he.toISOString().replace(/T.*$/,"");break;default:W=he.toISOString()}return Ae.literal(W,Y)}}it.TypeHandlerDate=J,J.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"],J.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]$/}},554:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const gt=tt(60);class J{fromRdf(ut,Y){const Ae=parseFloat(ut.value);return Y&&isNaN(Ae)&>.Translator.incorrectRdfDataType(ut),Ae}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Y=Y||Ae.namedNode(J.TYPES[0]),isNaN(ut)?Ae.literal("NaN",Y):isFinite(ut)?ut%1==0?null:Ae.literal(ut.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Ae.literal(ut>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=J,J.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(jt,it,tt)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const gt=tt(60);class J{fromRdf(ut,Y){const Ae=parseInt(ut.value,10);return Y&&(isNaN(Ae)||ut.value.indexOf(".")>=0)&>.Translator.incorrectRdfDataType(ut),Ae}toRdf(ut,{datatype:Y,dataFactory:Ae}){return Ae.literal(String(ut),Y||Ae.namedNode(ut<=J.MAX_INT&&ut>=J.MIN_INT?J.TYPES[0]:J.TYPES[1]))}}it.TypeHandlerNumberInteger=J,J.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"],J.MAX_INT=2147483647,J.MIN_INT=-2147483648},608:(jt,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class tt{fromRdf(J){return J.value}toRdf(J,{datatype:xt,dataFactory:ut}){return ut.literal(J,xt)}}it.TypeHandlerString=tt,tt.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/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},938:function(jt,it,tt){"use strict";var gt=this&&this.__createBinding||(Object.create?function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),Object.defineProperty(xt,Ae,{enumerable:!0,get:function(){return ut[Y]}})}:function(xt,ut,Y,Ae){void 0===Ae&&(Ae=Y),xt[Ae]=ut[Y]}),J=this&&this.__exportStar||function(xt,ut){for(var Y in xt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(ut,Y)&>(ut,xt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),J(tt(727),it),J(tt(525),it),J(tt(554),it),J(tt(750),it),J(tt(608),it)},289:(jt,it,tt)=>{"use strict";var gt={};tt.r(gt),tt.d(gt,{decode:()=>Hge,encode:()=>Gge});var J={};tt.r(J),tt.d(J,{decode:()=>Kge,encode:()=>Xge});var xt={};tt.r(xt),tt.d(xt,{decode:()=>Qge,encode:()=>Zge});var ut={};function Y(n){return"function"==typeof n}tt.r(ut),tt.d(ut,{decode:()=>Jge,encode:()=>eme});let Ae=!1;const he={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else Ae&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ae=n},get useDeprecatedSynchronousErrorHandling(){return Ae}};function W(n){setTimeout(()=>{throw n},0)}const V={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},L=Array.isArray||(n=>n&&"number"==typeof n.length);function re(n){return null!==n&&"object"==typeof n}const b=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class S{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof S)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof b?t.errors:t),[])}S.EMPTY=((n=new S).closed=!0,n);const A="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends S{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=V;break;case 1:if(!e){this.destination=V;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,e,t,i)}}[A](){return this}static create(e,t,i){const r=new y(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class w extends y{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;Y(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==V&&(o=Object.create(t),Y(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;he.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=he;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):W(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;W(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);he.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),he.useDeprecatedSynchronousErrorHandling)throw i;W(i)}}__tryOrSetError(e,t,i){if(!he.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return he.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(W(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const I="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(n){return n}let F=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof y)return n;if(n[A])return n[A]()}return n||e||t?new y(n,e,t):new y(V)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||he.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),he.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){he.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof y?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=Q(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[I](){return this}pipe(...t){return 0===t.length?this:function(n){return 0===n.length?H:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}(t)(this)}toPromise(t){return new(t=Q(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function Q(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const U=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ie extends S{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class ue extends y{constructor(e){super(e),this.destination=e}}let ee=(()=>{class n extends F{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[A](){return new ue(this)}lift(t){const i=new se(this,this);return i.operator=t,i}next(t){if(this.closed)throw new U;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew se(e,t),n})();class se extends ee{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):S.EMPTY}}function Te(n){return n&&"function"==typeof n.schedule}function me(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new te(n,e))}}class te{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new ye(e,this.project,this.thisArg))}}class ye extends y{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const Me=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ee(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Oe=n=>{if(n&&"function"==typeof n[I])return(n=>e=>{const t=n[I]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(Le(n))return Me(n);if(Ee(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,W),e))(n);if(n&&"function"==typeof n[Ze])return(n=>e=>{const t=n[Ze]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${re(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Be(n,e){return new F(t=>{const i=new S;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function Pe(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[I]}(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>{const r=n[I]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(Ee(n))return function(n,e){return new F(t=>{const i=new S;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(Le(n))return Be(n,e);if(function(n){return n&&"function"==typeof n[Ze]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new F(t=>{const i=new S;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Ze](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof F?n:new F(Oe(n))}class Et extends y{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class pe extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function O(n,e){if(e.closed)return;if(n instanceof F)return n.subscribe(e);let t;try{t=Oe(n)(e)}catch(i){e.error(i)}return t}function k(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(k((r,s)=>Pe(n(r,s)).pipe(me((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Re(n,t)))}class Re{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Xe(e,this.project,this.concurrent))}}class Xe extends pe{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function It(n=Number.POSITIVE_INFINITY){return k(H,n)}function An(n,e){return e?Be(n,e):new F(Me(n))}function Rn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Te(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof F?n[0]:It(e)(An(n,t))}function Hn(){return function(e){return e.lift(new yi(e))}}class yi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new ci(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class ci extends y{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Ur extends F{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new S,e.add(this.source.subscribe(new as(this.getSubject(),this))),e.closed&&(this._connection=null,e=S.EMPTY)),e}refCount(){return Hn()(this)}}const Is=(()=>{const n=Ur.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class as extends ue{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class wl{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function la(){return new ee}function ps(){return n=>Hn()(function(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new wl(r,e));const s=Object.create(i,Is);return s.source=i,s.subjectFactory=r,s}}(la)(n))}function Zt(n){for(let e in n)if(n[e]===Zt)return e;throw Error("Could not find renamed property on target object.")}function Ua(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function rt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(rt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ot(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ct=Zt({__forward_ref__:Zt});function fe(n){return n.__forward_ref__=fe,n.toString=function(){return rt(this())},n}function ve(n){return ke(n)?n():n}function ke(n){return"function"==typeof n&&n.hasOwnProperty(ct)&&n.__forward_ref__===fe}class Qe extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function At(n){return"string"==typeof n?n:null==n?"":String(n)}function qt(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():At(n)}function pn(n,e){const t=e?` in ${e}`:"";throw new Qe("201",`No provider for ${qt(n)} found${t}`)}function Z(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function $e(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function bt(n){return{providers:n.providers||[],imports:n.imports||[]}}function gn(n){return gs(n,io)||gs(n,Rs)}function gs(n,e){return n.hasOwnProperty(e)?n[e]:null}function El(n){return n&&(n.hasOwnProperty(Rr)||n.hasOwnProperty(lc))?n[Rr]:null}const io=Zt({\u0275prov:Zt}),Rr=Zt({\u0275inj:Zt}),Rs=Zt({ngInjectableDef:Zt}),lc=Zt({ngInjectorDef:Zt});var bn=(()=>((bn=bn||{})[bn.Default=0]="Default",bn[bn.Host=1]="Host",bn[bn.Self=2]="Self",bn[bn.SkipSelf=4]="SkipSelf",bn[bn.Optional=8]="Optional",bn))();let ro;function ua(n){const e=ro;return ro=n,e}function nd(n,e,t){const i=gn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&bn.Optional?null:void 0!==e?e:void pn(rt(n),"Injector")}function xe(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),$t=(()=>(($t=$t||{})[$t.Emulated=0]="Emulated",$t[$t.None=2]="None",$t[$t.ShadowDom=3]="ShadowDom",$t))();const ni="undefined"!=typeof globalThis&&globalThis,Nr="undefined"!=typeof window&&window,$r="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,ms="undefined"!=typeof global&&global,Jn=ni||ms||Nr||$r,id={},qi=[],Gf=Zt({\u0275cmp:Zt}),wm=Zt({\u0275dir:Zt}),hh=Zt({\u0275pipe:Zt}),ab=Zt({\u0275mod:Zt}),vx=Zt({\u0275loc:Zt}),Cl=Zt({\u0275fac:Zt}),fh=Zt({__NG_ELEMENT_ID__:Zt});let bx=0;function _n(n){return xe(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===He.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||qi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||$t.Emulated,id:"c",styles:n.styles||qi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=bx++,i.inputs=db(n.inputs,t),i.outputs=db(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(lb):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(cb):null,i})}function lb(n){return Ii(n)||function(n){return n[wm]||null}(n)}function cb(n){return function(n){return n[hh]||null}(n)}const ub={};function ln(n){return xe(()=>{const e={type:n.type,bootstrap:n.bootstrap||qi,declarations:n.declarations||qi,imports:n.imports||qi,exports:n.exports||qi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(ub[n.id]=n.type),e})}function db(n,e){if(null==n)return id;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const kt=_n;function Ns(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Ii(n){return n[Gf]||null}function bo(n,e){const t=n[ab]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function ko(n){return Array.isArray(n)&&"object"==typeof n[1]}function Bo(n){return Array.isArray(n)&&!0===n[1]}function Cm(n){return 0!=(8&n.flags)}function ad(n){return 2==(2&n.flags)}function ld(n){return 1==(1&n.flags)}function fa(n){return null!==n.template}function hb(n){return 0!=(512&n[2])}function dc(n,e){return n.hasOwnProperty(Cl)?n[Cl]:null}class Dm{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function ki(){return gb}function gb(n){return n.type.prototype.ngOnChanges&&(n.setInput=Dx),Tx}function Tx(){const n=st(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===id)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function Dx(n,e,t,i){const r=st(n)||function(n,e){return n[vh]=e}(n,{previous:id,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new Dm(l&&l.currentValue,e,o===id),n[i]=e}ki.ngInherit=!0;const vh="__ngSimpleChanges__";function st(n){return n[vh]||null}let Bi;function ir(n){return!!n.listen}const ru={createRenderer:(n,e)=>void 0!==Bi?Bi:"undefined"!=typeof document?document:void 0};function _r(n){for(;Array.isArray(n);)n=n[0];return n}function bh(n,e){return _r(e[n])}function $s(n,e){return _r(e[n.index])}function Om(n,e){return n.data[e]}function cd(n,e){return n[e]}function Fs(n,e){const t=e[n];return ko(t)?t:t[0]}function Tl(n){return 4==(4&n[2])}function ud(n){return 128==(128&n[2])}function ga(n,e){return null==e?null:n[e]}function Rm(n){n[18]=0}function qf(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Pn={lFrame:ou(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function _b(){return Pn.bindingsEnabled}function Bt(){return Pn.lFrame.lView}function ui(){return Pn.lFrame.tView}function Vo(n){return Pn.lFrame.contextLView=n,n[8]}function Jr(){let n=Nm();for(;null!==n&&64===n.type;)n=n.parent;return n}function Nm(){return Pn.lFrame.currentTNode}function Ga(n,e){const t=Pn.lFrame;t.currentTNode=n,t.isParent=e}function Lr(){return Pn.lFrame.isParent}function ls(){Pn.lFrame.isParent=!1}function Sh(){return Pn.isInCheckNoChangesMode}function Kf(n){Pn.isInCheckNoChangesMode=n}function ys(){const n=Pn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function ma(){return Pn.lFrame.bindingIndex++}function Eo(n){const e=Pn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function dd(n,e){const t=Pn.lFrame;t.bindingIndex=t.bindingRootIndex=n,Pm(e)}function Pm(n){Pn.lFrame.currentDirectiveIndex=n}function yb(){return Pn.lFrame.currentQueryIndex}function Lm(n){Pn.lFrame.currentQueryIndex=n}function Qf(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function hd(n,e,t){if(t&bn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&bn.Host||(r=Qf(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Pn.lFrame=Se();return i.currentTNode=e,i.lView=n,!0}function Ah(n){const e=Se(),t=n[1];Pn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Se(){const n=Pn.lFrame,e=null===n?null:n.child;return null===e?ou(n):e}function ou(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Th(){const n=Pn.lFrame;return Pn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const So=Th;function ri(){const n=Th();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Ws(){return Pn.lFrame.selectedIndex}function ao(n){Pn.lFrame.selectedIndex=n}function Dr(){const n=Pn.lFrame;return Om(n.tView,n.selectedIndex)}function Zf(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class Dh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function tp(n,e,t){const i=ir(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let pd=!0;function np(n){const e=pd;return pd=n,e}let zm=0;function Ls(n,e){const t=ip(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,Hm(i.data,n),Hm(e,null),Hm(i.blueprint,null));const r=Ih(n,e),s=n.injectorIndex;if(bb(r)){const o=fd(r),a=Wa(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function Hm(n,e){n.push(0,0,0,0,0,0,0,0,e)}function ip(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Ih(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function fc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(fh)&&(i=t[fh]),null==i&&(i=t[fh]=zm++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Cb:e}(t);if("function"==typeof s){if(!hd(e,n,i))return i&bn.Host?Gm(r,t,i):Eb(e,t,i,r);try{const o=s(i);if(null!=o||i&bn.Optional)return o;pn(t)}finally{So()}}else if("number"==typeof s){let o=null,a=ip(n,e),l=-1,c=i&bn.Host?e[16][6]:null;for((-1===a||i&bn.SkipSelf)&&(l=-1===a?Ih(n,e):e[a+8],-1!==l&&Rh(i,!1)?(o=e[1],a=fd(l),e=Wa(l,e)):a=-1);-1!==a;){const d=e[1];if(rp(s,a,d.data)){const f=vs(a,e,t,o,i,c);if(f!==Sb)return f}l=e[a+8],-1!==l&&Rh(i,e[1].data[a+8]===c)&&rp(s,a,e)?(o=d,a=fd(l),e=Wa(l,e)):a=-1}}}return Eb(e,t,i,r)}const Sb={};function Cb(){return new Uo(Jr(),Bt())}function vs(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=gd(a,o,t,null==i?ad(a)&&pd:i!=o&&0!=(3&a.type),r&bn.Host&&s===a);return null!==d?md(e,o,d,a):Sb}function gd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&fa(g)&&g.type===t)return l}return null}function md(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Dh}(r)){const o=r;o.resolving&&function(n,e){throw new Qe("200",`Circular dependency in DI detected for ${n}`)}(qt(s[t]));const a=np(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ua(o.injectImpl):null;hd(n,i,bn.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=gb(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ua(l),np(a),o.resolving=!1,So()}}return r}function rp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Cl]||bs(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Cl]||bs(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function bs(n){return ke(n)?()=>{const e=bs(ve(n));return e&&e()}:dc(n)}const yd="__parameters__";function va(n,e,t){return xe(()=>{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(yd)?l[yd]:Object.defineProperty(l,yd,{value:[]})[yd];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class zt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=$e({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}function Ho(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Go(t,e):e(t))}function Ph(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Ml(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function gc(n,e){const t=[];for(let i=0;i=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function Xm(n,e){const t=ws(n,e);if(t>=0)return n[1|t]}function ws(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):rt(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(yc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[_c]=null,n}const Sd=Ed(va("Inject",n=>({token:n})),-1),qr=Ed(va("Optional"),8),Xa=Ed(va("SkipSelf"),4);function ks(n){return n instanceof class{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}?n.changingThisBreaksApplicationSecurity:n}const f_="__ngContext__";function Es(n,e){n[f_]=e}function p_(n){const e=function(n){return n[f_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Ep(n){return n.ngOriginalError}function D1(n,...e){n.error(...e)}class Yo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||D1}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(Ep(e)):null}_findOriginalError(e){let t=e&&Ep(e);for(;t&&Ep(t);)t=Ep(t);return t||null}}const r0=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Jn))();function Za(n){return n instanceof Function?n():n}var To=(()=>((To=To||{})[To.Important=1]="Important",To[To.DashCase=2]="DashCase",To))();function v_(n,e){return undefined(n,e)}function Uh(n){const e=n[3];return Bo(e)?e[3]:e}function Md(n){return c0(n[13])}function w_(n){return c0(n[4])}function c0(n){for(;null!==n&&!Bo(n);)n=n[4];return n}function Id(n,e,t,i,r){if(null!=i){let s,o=!1;Bo(i)?s=i:ko(i)&&(o=!0,i=i[0]);const a=_r(i);0===n&&null!==t?null==r?p0(e,t,a):Ja(e,t,a,r||null,!0):1===n&&null!==t?Ja(e,t,a,r||null,!0):2===n?function(n,e,t){const i=xp(n,e);i&&function(n,e,t,i){ir(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==_r(t)&&Id(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Ml(n,10+e);!function(n,e){Od(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function x_(n,e){if(!(256&e[2])){const t=e[11];ir(t)&&t.destroyNode&&Od(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Cp(n[1],n);for(;e;){let t=null;if(ko(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)ko(e)&&Cp(e[1],e),e=e[3];null===e&&(e=n),ko(e)&&Cp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Cp(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==Hh(g,c,0)||2&i&&c!==p){if(wa(i))return!1;o=!0}}}}else{if(!o&&!wa(i)&&!wa(l))return!1;if(o&&wa(l))continue;o=!1,i=l|1&i}}return wa(i)||o}function wa(n){return 0==(1&n)}function tA(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!wa(o)&&(e+=T0(s,r),r=""),i=o,s=s||!wa(i);t++}return""!==r&&(e+=T0(s,r)),e}const xn={};function Yt(n){D0(ui(),Bt(),Ws()+n,Sh())}function D0(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Jf(e,s,t)}else{const s=n.preOrderHooks;null!==s&&ep(e,s,0,t)}ao(t)}function el(n,e){return n<<17|e<<2}function Tn(n){return n>>17&32767}function yr(n){return 2|n}function Pl(n){return(131068&n)>>2}function tl(n,e){return-131069&n|e<<2}function O_(n){return 1|n}function k0(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&D0(n,e,20,Sh()),t(i,r)}finally{ao(s)}}function qh(n,e,t){!_b()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Ls(t,e),Es(i,e);const o=t.initialInputs;for(let a=r;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function Y0(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function K0(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function MA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&H_(t)}}function H_(n){for(let i=Md(n);null!==i;i=w_(i))for(let r=10;r0&&H_(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&H_(r)}}function LA(n,e){const t=Fs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Z0(n){return n[7]||(n[7]=[])}function Fp(n){return n.cleanup||(n.cleanup=[])}function K_(n,e){const t=n[9],i=t?t.get(Yo,null):null;i&&i.handleError(e)}function J0(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Go([e],a=>this.processInjectorType(a,[],s)),this.records.set(kd,bu(void 0,this));const o=this.records.get(vu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:rt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=hu,i=bn.Default){this.assertNotDestroyed();const r=wd(this),s=ua(void 0);try{if(!(i&bn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof zt}(e)&&gn(e);a=l&&this.injectableDefInScope(l)?bu(ey(e),Yh):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&bn.Self?ew():this.parent).get(e,t=i&bn.Optional&&t===hu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[_c]=o[_c]||[]).unshift(rt(e)),r)throw o;return qs(o,e,"R3InjectorError",this.source)}throw o}finally{ua(s),wd(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(rt(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=ve(e)))return!1;let r=El(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=El(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Go(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||qi))}}this.injectorDefTypes.add(o);const l=dc(o)||(()=>new o);this.records.set(o,bu(l,Yh));const c=r.providers;if(null!=c&&!a){const d=e;Go(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Cc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return iw(n)?bu(void 0,n.useValue):bu(nw(n),Yh)}(e);if(Cc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=bu(void 0,Yh,!0),o.factory=()=>pu(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===Yh&&(t.value=HA,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ve(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function ey(n){const e=gn(n),t=null!==e?e.factory:dc(n);if(null!==t)return t;if(n instanceof zt)throw new Error(`Token ${rt(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=gc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[io]||n[Rs]);if(e){const t=function(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Error("unreachable")}function nw(n,e,t){let i;if(Cc(n)){const r=ve(n);return dc(r)||ey(r)}if(iw(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...pu(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Ie(ve(n.useExisting));else{const r=ve(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return dc(r)||ey(r);i=()=>new r(...pu(n.deps))}return i}function bu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function iw(n){return null!==n&&"object"==typeof n&&up in n}function Cc(n){return"function"==typeof n}const rw=function(n,e,t){return function(n,e=null,t=null,i){const r=tw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class zn{static create(e,t){return Array.isArray(e)?rw(e,t,""):rw(e.providers,e.parent,e.name||"")}}function bW(n,e){Zf(p_(n)[1],Jr())}function Dn(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(fa(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=iT(n.inputs),o.declaredInputs=iT(n.declaredInputs),o.outputs=iT(n.outputs);const a=r.hostBindings;a&&CW(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&EW(n,l),c&&SW(n,c),Ua(n.inputs,r.inputs),Ua(n.declaredInputs,r.declaredInputs),Ua(n.outputs,r.outputs),fa(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Mh(r.hostAttrs,t=Mh(t,r.hostAttrs))}}(i)}function iT(n){return n===id?{}:n===qi?[]:n}function EW(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function SW(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function CW(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}zn.THROW_IF_NOT_FOUND=hu,zn.NULL=new Xs,zn.\u0275prov=$e({token:zn,providedIn:"any",factory:()=>Ie(kd)}),zn.__NG_ELEMENT_ID__=-1;let cw=null;function kp(){if(!cw){const n=Jn.Symbol;if(n&&n.iterator)cw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(_r(Ne[i.index])):i.index;if(ir(t)){let Ne=null;if(!a&&l&&(Ne=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==Ne)(Ne.__ngLastListenerFn__||Ne).__ngNextListenerFn__=s,Ne.__ngLastListenerFn__=s,g=!1;else{s=uT(i,e,f,s,!1);const Ge=t.listen(q,r,s);p.push(s,Ge),d&&d.push(r,ge,G,G+1)}}else s=uT(i,e,f,s,!0),q.addEventListener(r,s,o),p.push(s),d&&d.push(r,ge,G,o)}else s=uT(i,e,f,s,!1);const _=i.outputs;let x;if(g&&null!==_&&(x=_[r])){const T=x.length;if(T)for(let q=0;q0;)e=e[15],n--;return e}(n,Pn.lFrame.contextLView))[8]}(n)}function r7(n,e){let t=null;const i=function(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let r=0;r=0}const Cs={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function WF(n){return n.substring(Cs.key,Cs.keyEnd)}function qF(n,e){const t=Cs.textEnd;return t===e?-1:(e=Cs.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Cs.key=e,t),Qp(n,e,t))}function Qp(n,e,t){for(;e=0;t=qF(e,t))Co(n,WF(e),!0)}function ZF(n,e){return e>=n.expandoStartIndex}function JF(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Ws()],o=ZF(n,t);iL(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=function(n){const e=Pn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=cy(t=hT(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=hT(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Pl(i))return n[Tn(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=hT(null,n,e,l[1],i),l=cy(l,e.attrs,i),function(n,e,t,i){n[Tn(t?e.classBindings:e.styleBindings)]=i}(n,e,i,l))}else s=function(n,e,t){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Tn(n[a+1]);n[i+1]=el(p,a),0!==p&&(n[p+1]=tl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=el(a,0),0!==a&&(n[a+1]=tl(n[a+1],i)),a=i;else n[i+1]=el(l,0),0===a?a=i:n[l+1]=tl(n[l+1],i),l=i;c&&(n[i+1]=yr(n[i+1])),$F(n,d,i,!0),$F(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&ws(s,e)>=0&&(t[i+1]=O_(t[i+1]))}(e,d,n,i,s),o=el(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function hT(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===xn&&(p=f?qi:void 0);let g=f?Xm(p,i):d===i?p:void 0;if(c&&!gw(g)&&(g=Xm(l,i)),gw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Tn(_):Pl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=Xm(l,i))}return a}function gw(n){return void 0!==n}function iL(n,e){return 0!=(n.flags&(e?16:32))}function Si(n,e=""){const t=Bt(),i=ui(),r=n+20,s=i.firstCreatePass?Nd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return ir(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Ap(i,t,o,s),Ga(s,!1)}function xs(n){return Mc("",n,""),xs}function Mc(n,e,t){const i=Bt(),r=function(n,e,t,i){return ho(n,ma(),t)?e+At(t)+i:xn}(i,n,e,t);return r!==xn&&Fl(i,Ws(),r),Mc}function Eu(n,e,t){const i=Bt();return ho(i,ma(),e)&&Do(ui(),Dr(),i,n,e,i[11],t,!0),Eu}const Xh=void 0;var U7=["en",[["a","p"],["AM","PM"],Xh],[["AM","PM"],Xh,Xh],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Xh,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Xh,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Xh,"{1} 'at' {0}",Xh],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Zp={};function wL(n){return n in Zp||(Zp[n]=Jn.ng&&Jn.ng.common&&Jn.ng.common.locales&&Jn.ng.common.locales[n]),Zp[n]}var an=(()=>((an=an||{})[an.LocaleId=0]="LocaleId",an[an.DayPeriodsFormat=1]="DayPeriodsFormat",an[an.DayPeriodsStandalone=2]="DayPeriodsStandalone",an[an.DaysFormat=3]="DaysFormat",an[an.DaysStandalone=4]="DaysStandalone",an[an.MonthsFormat=5]="MonthsFormat",an[an.MonthsStandalone=6]="MonthsStandalone",an[an.Eras=7]="Eras",an[an.FirstDayOfWeek=8]="FirstDayOfWeek",an[an.WeekendRange=9]="WeekendRange",an[an.DateFormat=10]="DateFormat",an[an.TimeFormat=11]="TimeFormat",an[an.DateTimeFormat=12]="DateTimeFormat",an[an.NumberSymbols=13]="NumberSymbols",an[an.NumberFormats=14]="NumberFormats",an[an.CurrencyCode=15]="CurrencyCode",an[an.CurrencySymbol=16]="CurrencySymbol",an[an.CurrencyName=17]="CurrencyName",an[an.Currencies=18]="Currencies",an[an.Directionality=19]="Directionality",an[an.PluralCase=20]="PluralCase",an[an.ExtraData=21]="ExtraData",an))();const _w="en-US";let EL=_w;function pT(n){Z(n,"Expected localeId to be defined"),"string"==typeof n&&(EL=n.toLowerCase().replace(/_/g,"-"))}function _T(n,e,t,i,r){if(n=ve(n),Array.isArray(n))for(let s=0;s>20;if(Cc(n)||!n.multi){const g=new Dh(l,r,De),_=vT(a,e,r?d:d+p,f);-1===_?(fc(Ls(c,o),s,a),yT(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[_]=g,o[_]=g)}else{const g=vT(a,e,d+p,f),_=vT(a,e,d,d+p),x=g>=0&&t[g],T=_>=0&&t[_];if(r&&!T||!r&&!x){fc(Ls(c,o),s,a);const q=function(n,e,t,i,r){const s=new Dh(n,t,De);return s.multi=[],s.index=e,s.componentProviders=0,WL(s,r,i&&!t),s}(r?B9:k9,t.length,r,i,l);!r&&T&&(t[_].providerFactory=q),yT(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(q),o.push(q)}else yT(s,n,g>-1?g:_,WL(t[r?_:g],l,!r&&i));!r&&i&&T&&t[_].componentProviders++}}}function yT(n,e,t,i){const r=Cc(e);if(r||function(n){return!!n.useClass}(e)){const o=(e.useClass||e).prototype.ngOnDestroy;if(o){const a=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){const l=a.indexOf(t);-1===l?a.push(t,[i,o]):a[l+1].push(i,o)}else a.push(t,o)}}}function WL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function vT(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=ui();if(i.firstCreatePass){const r=fa(n);_T(t,i.data,i.blueprint,r,!0),_T(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class qL{}const KL="ngComponent";class U9{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[KL]=n,e}(e)}}class ol{}function Ew(...n){}function eg(n,e){return new wn($s(n,e))}ol.NULL=new U9;const G9=function(){return eg(Jr(),Bt())};let wn=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=G9,n})();function XL(n){return n instanceof wn?n.nativeElement:n}class Qh{}let ET=(()=>{class n{}return n.\u0275prov=$e({token:n,providedIn:"root",factory:()=>null}),n})();class Cu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const QL=new Cu("12.2.5");class ZL{constructor(){}supports(e){return sy(e)}create(e){return new X9(e)}}const K9=(n,e)=>e;class X9{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||K9}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new Q9(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new JL),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new JL),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class Q9{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Z9{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class JL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new Z9,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function e2(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new eq(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class eq{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function n2(){return new tg([new ZL])}let tg=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||n2()),deps:[[n,new Xa,new qr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=$e({token:n,providedIn:"root",factory:n2}),n})();function r2(){return new ng([new t2])}let ng=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||r2()),deps:[[n,new Xa,new qr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=$e({token:n,providedIn:"root",factory:r2}),n})();function Sw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(_r(s)),Bo(s))for(let a=10;a-1&&(C_(e,i),Ml(t,i))}this._attachedToViewContainer=!1}x_(this._lView[1],this._lView)}onDestroy(e){U0(this._lView[1],this._lView,null,e)}markForCheck(){G_(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){W_(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Kf(!0);try{W_(n,e,t)}finally{Kf(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Od(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class nq extends py{constructor(e){super(e),this._view=e}detectChanges(){Q0(this._view)}checkNoChanges(){!function(n){Kf(!0);try{Q0(n)}finally{Kf(!1)}}(this._view)}get context(){return null}}const rq=function(n){return function(n,e,t){if(ad(n)&&!t){const i=Fs(n.index,e);return new py(i,i)}return 47&n.type?new py(e[16],e):null}(Jr(),Bt(),16==(16&n))};let ts=(()=>{class n{}return n.__NG_ELEMENT_ID__=rq,n})();const aq=[new t2],cq=new tg([new ZL]),uq=new ng(aq),hq=function(){return Cw(Jr(),Bt())};let Io=(()=>{class n{}return n.__NG_ELEMENT_ID__=hq,n})();const fq=Io,pq=class extends fq{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=$h(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),Wh(t,i,e),new py(i)}};function Cw(n,e){return 4&n.type?new pq(e,n,eg(n,e)):null}class Ic{}const _q=function(){return l2(Jr(),Bt())};let As=(()=>{class n{}return n.__NG_ELEMENT_ID__=_q,n})();const vq=As,o2=class extends vq{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return eg(this._hostTNode,this._hostLView)}get injector(){return new Uo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Ih(this._hostTNode,this._hostLView);if(bb(e)){const t=Wa(e,this._hostLView),i=fd(e);return new Uo(t[1].data[i+8],t)}return new Uo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=a2(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Ic,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Bo(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new o2(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),ir0});class I2 extends qL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(oA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return M2(this.componentDef.inputs)}get outputs(){return M2(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,og,r);return s!==og||i===og?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Qh,ru),a=s.get(ET,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(ir(n))return n.selectRootElement(e,t===$t.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):S_(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?"http://www.w3.org/2000/svg":"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||r0,clean:UA,playerHandler:e||null,flags:0}}(),g=Np(0,null,null,1,0,null,null,null,null,null),_=$h(null,g,p,f,null,null,o,l,a,s);let x,T;Ah(_);try{const q=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Nd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(Lp(l,c,!0),null!==n&&(tp(r,n,c),null!==l.classes&&M_(r,n,l.classes),null!==l.styles&&S0(r,n,l.styles)));const d=i.createRenderer(n,e),f=$h(t,Rp(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(fc(Ls(l,t),o,e.type),K0(o,l),V_(l,t.length,1)),Pp(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)tp(l,d,["ng-version",QL.full]);else{const{attrs:G,classes:ge}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&M_(l,d,ge.join(" "))}if(T=Om(g,20),void 0!==t){const G=T.projection=[];for(let ge=0;gel(o,e)),e.contentQueries){const l=Jr();e.contentQueries(1,o,l.directiveStart)}const a=Jr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(ao(a.index),q0(t[1],a,0,a.directiveStart,a.directiveEnd,e),Y0(e,o)),o}(q,this.componentDef,_,p,[bW]),Wh(g,_,null)}finally{ri()}return new yY(this.componentType,x,eg(T,_),_,T)}}class yY extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new nq(r),this.componentType=e}get injector(){return new Uo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const ag=new Map;class wY extends Ic{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new D2(this);const i=bo(e),r=function(n){return n[vx]||null}(e);r&&pT(r),this._bootstrapComponents=Za(i.bootstrap),this._r3Injector=tw(e,t,[{provide:Ic,useValue:this},{provide:ol,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=zn.THROW_IF_NOT_FOUND,i=bn.Default){return e===zn||e===Ic||e===kd?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class LT extends class{}{constructor(e){super(),this.moduleType=e,null!==bo(e)&&function(n){const e=new Set;!function t(i){const r=bo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${rt(e)} vs ${rt(e.name)}`)}(s,ag.get(s),i),ag.set(s,i));const o=Za(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new wY(this.moduleType,e)}}function Mw(n,e,t){const i=ys()+n,r=Bt();return r[i]===xn?Ac(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function P2(n,e,t,i,r,s){const o=e+t;return ho(n,o,r)?Ac(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===xn?void 0:t}(n,o+1)}function cl(n,e){const t=ui();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new Qe("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=dc(i.type)),o=ua(De);try{const a=np(!1),l=s();return np(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Bt(),r,l),l}finally{ua(o)}}function ul(n,e,t){const i=n+20,r=Bt(),s=cd(r,i);return function(n,e){kl.isWrapped(e)&&(e=kl.unwrap(e),n[Pn.lFrame.bindingIndex]=xn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?P2(r,ys(),e,s.transform,t,s):s.transform(t))}function kT(n){return e=>{setTimeout(n,void 0,e)}}const mn=class extends ee{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=kT(l),a&&(a=kT(a)),c&&(c=kT(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof S&&e.add(d),d}};function LY(){return this._results[kp()]()}class ef{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=kp(),i=ef.prototype;i[t]||(i[t]=LY)}get changes(){return this._changes||(this._changes=new mn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=Ho(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=Ew,this.reject=Ew,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Ie(tf,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Ay=new zt("AppId"),yK={provide:Ay,useFactory:function(){return`${KT()}${KT()}${KT()}`},deps:[]};function KT(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const ak=new zt("Platform Initializer"),Oc=new zt("Platform ID"),Rw=new zt("appBootstrapListener");let Nw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const xu=new zt("LocaleId"),lk=new zt("DefaultCurrencyCode");class bK{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const XT=function(n){return new LT(n)},wK=XT,EK=function(n){return Promise.resolve(XT(n))},ck=function(n){const e=XT(n),i=Za(bo(n).declarations).reduce((r,s)=>{const o=Ii(s);return o&&r.push(new I2(o)),r},[]);return new bK(e,i)},SK=ck,CK=function(n){return Promise.resolve(ck(n))};let nf=(()=>{class n{constructor(){this.compileModuleSync=wK,this.compileModuleAsync=EK,this.compileModuleAndAllComponentsSync=SK,this.compileModuleAndAllComponentsAsync=CK}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const uk=new zt("compilerOptions"),AK=(()=>Promise.resolve(0))();function QT(n){"undefined"==typeof Zone?AK.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class yn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new mn(!1),this.onMicrotaskEmpty=new mn(!1),this.onStable=new mn(!1),this.onError=new mn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=Jn.requestAnimationFrame,e=Jn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(Jn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,JT(n),n.isCheckStableRunning=!0,ZT(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),JT(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return dk(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),hk(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return dk(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),hk(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,JT(n),ZT(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!yn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(yn.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,DK,Ew,Ew);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const DK={};function ZT(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function JT(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function dk(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function hk(n){n._nesting--,ZT(n)}class OK{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new mn,this.onMicrotaskEmpty=new mn,this.onStable=new mn,this.onError=new mn}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let eD=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{yn.assertNotInAngularZone(),QT(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())QT(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),fk=(()=>{class n{constructor(){this._applications=new Map,tD.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return tD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class RK{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let tD=new RK,pk=!0,gk=!1;function Sa(){return gk=!0,pk}let Hl;const mk=new zt("AllowMultipleToken");function _k(n,e,t=[]){const i=`Platform: ${e}`,r=new zt(i);return(s=[])=>{let o=iD();if(!o||o.injector.get(mk,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:vu,useValue:"platform"});!function(n){if(Hl&&!Hl.destroyed&&!Hl.injector.get(mk,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Hl=n.get(yk);const e=n.get(ak,null);e&&e.forEach(t=>t())}(zn.create({providers:a,name:i}))}return function(n){const e=iD();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function iD(){return Hl&&!Hl.destroyed?Hl:null}let yk=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new OK:("zone.js"===n?void 0:n)||new yn({enableLongStackTrace:Sa(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:yn,useValue:a}];return a.run(()=>{const c=zn.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Yo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{rD(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return ay(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(cg);return p.runInitializers(),p.donePromise.then(()=>(pT(d.injector.get(xu,_w)||_w),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=vk({},i);return function(n,e,t){const i=new LT(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(jd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${rt(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function vk(n,e){return Array.isArray(e)?e.reduce(vk,n):Object.assign(Object.assign({},n),e)}let jd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new F(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new F(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{yn.assertNotInAngularZone(),QT(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{yn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Rn(a,l.pipe(ps()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof qL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Ic),a=r.create(zn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(eD,null),d=c&&a.injector.get(fk);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),rD(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;rD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Rw,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(zn),Ie(Yo),Ie(ol),Ie(cg))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function rD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const sX=_k(null,"core",[{provide:Oc,useValue:"unknown"},{provide:yk,deps:[zn]},{provide:fk,deps:[]},{provide:Nw,deps:[]}]),uX=[{provide:jd,useClass:jd,deps:[yn,zn,Yo,ol,cg]},{provide:gY,deps:[yn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:cg,useClass:cg,deps:[[new qr,tf]]},{provide:nf,useClass:nf,deps:[]},yK,{provide:tg,useFactory:function(){return cq},deps:[]},{provide:ng,useFactory:function(){return uq},deps:[]},{provide:xu,useFactory:function(n){return pT(n=n||"undefined"!=typeof $localize&&$localize.locale||_w),n},deps:[[new Sd(xu),new qr,new Xa]]},{provide:lk,useValue:"USD"}];let hX=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(jd))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:uX}),n})(),$w=null;function Rc(){return $w}const un=new zt("DocumentToken");let of=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:dQ,token:n,providedIn:"platform"}),n})();function dQ(){return Ie(qk)}let qk=(()=>{class n extends of{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Rc().getBaseHref(this._doc)}onPopState(t){const i=Rc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Rc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){Yk()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){Yk()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({factory:fQ,token:n,providedIn:"platform"}),n})();function Yk(){return!!window.history.pushState}function fQ(){return new qk(Ie(un))}function Tu(n){return n&&"?"!==n[0]?"?"+n:n}let af=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:pQ,token:n,providedIn:"root"}),n})();function pQ(n){const e=Ie(un).location;return new Xk(Ie(of),e&&e.origin||"")}const bD=new zt("appBaseHref");let Xk=(()=>{class n extends af{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return function(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Tu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Tu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Tu(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(of),Ie(bD,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();var cs=(()=>((cs=cs||{})[cs.Zero=0]="Zero",cs[cs.One=1]="One",cs[cs.Two=2]="Two",cs[cs.Few=3]="Few",cs[cs.Many=4]="Many",cs[cs.Other=5]="Other",cs))();const CQ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=wL(e);if(t)return t;const i=e.split("-")[0];if(t=wL(i),t)return t;if("en"===i)return U7;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[an.PluralCase]};class tE{}let JQ=(()=>{class n extends tE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(CQ(i||this.locale)(t)){case cs.Zero:return"zero";case cs.One:return"one";case cs.Two:return"two";case cs.Few:return"few";case cs.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(xu))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class tZ{constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ud=(()=>{class n{constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(i){throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const i=[];t.forEachOperation((r,s,o)=>{if(null==r.previousIndex){const a=this._viewContainer.createEmbeddedView(this._template,new tZ(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new l3(r,a);i.push(l)}else if(null==o)this._viewContainer.remove(null===s?void 0:s);else if(null!==s){const a=this._viewContainer.get(s);this._viewContainer.move(a,o);const l=new l3(r,a);i.push(l)}});for(let r=0;r{this._viewContainer.get(r.currentIndex).context.$implicit=r.item})}_perViewChange(t,i){t.context.$implicit=i.item}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(De(As),De(Io),De(tg))},n.\u0275dir=kt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class l3{constructor(e,t){this.record=e,this.view=t}}let Mu=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new iZ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){c3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){c3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(De(As),De(Io))},n.\u0275dir=kt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class iZ{constructor(){this.$implicit=null,this.ngIf=null}}function c3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class aZ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class lZ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const cZ=new lZ,uZ=new aZ;let iE=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(ay(t))return cZ;if(PF(t))return uZ;throw function(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${rt(n)}'`)}(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(De(ts,16))},n.\u0275pipe=Ns({name:"async",type:n,pure:!1}),n})(),Kr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[{provide:tE,useClass:JQ}]}),n})();const g3="browser";function lf(n){return n===g3}class ND extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){$w||($w=n)}(new ND)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(Ny=Ny||document.querySelector("base"),Ny?Ny.getAttribute("href"):null);return null==t?null:function(n){rE=rE||document.createElement("a"),rE.setAttribute("href",n);const e=rE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Ny=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}(document.cookie,e)}}let rE,Ny=null;const v3=new zt("TRANSITION_ID"),FZ=[{provide:tf,useFactory:function(n,e,t){return()=>{t.get(cg).donePromise.then(()=>{const i=Rc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},Jn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Jn.getAllAngularRootElements=()=>e.getAllRootElements(),Jn.frameworkStabilizers||(Jn.frameworkStabilizers=[]),Jn.frameworkStabilizers.push(i=>{const r=Jn.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Rc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let LZ=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Py=new zt("EventManagerPlugins");let oE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),Fy=(()=>{class n extends w3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(E3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(E3))}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function E3(n){Rc().remove(n)}const LD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},kD=/%COMP%/g;function aE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let lE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new BD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case $t.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new QZ(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case $t.ShadowDom:return new ZZ(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=aE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Ie(oE),Ie(Fy),Ie(Ay))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class BD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(LD[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=LD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=LD[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(To.DashCase|To.Important)?e.style.setProperty(t,i,r&To.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&To.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,x3(i)):this.eventManager.addEventListener(e,t,x3(i))}}class QZ extends BD{constructor(e,t,i,r){super(e),this.component=i;const s=aE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(kD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(kD,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class ZZ extends BD{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=aE(r.id,r.styles,[]);for(let o=0;o{class n extends FD{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const D3=["alt","control","meta","shift"],oJ={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},M3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},aJ={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let lJ=(()=>{class n extends FD{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Rc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(D3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&M3.hasOwnProperty(e)&&(e=M3[e]))}return oJ[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),D3.forEach(s=>{s!=r&&aJ[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(Ie(un))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const mJ=_k(sX,"browser",[{provide:Oc,useValue:g3},{provide:ak,useValue:function(){ND.makeCurrent(),PD.init()},multi:!0},{provide:un,useFactory:function(){return function(n){Bi=n}(document),document},deps:[]}]),_J=[[],{provide:vu,useValue:"root"},{provide:Yo,useFactory:function(){return new Yo},deps:[]},{provide:Py,useClass:JZ,multi:!0,deps:[un,yn,Oc]},{provide:Py,useClass:lJ,multi:!0,deps:[un]},[],{provide:lE,useClass:lE,deps:[oE,Fy,Ay]},{provide:Qh,useExisting:lE},{provide:w3,useExisting:Fy},{provide:Fy,useClass:Fy,deps:[un]},{provide:eD,useClass:eD,deps:[yn]},{provide:oE,useClass:oE,deps:[Py,yn]},{provide:class{},useClass:LZ,deps:[]},[]];let UD=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Ay,useValue:t.appId},{provide:v3,useExisting:Ay},FZ]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:_J,imports:[Kr,hX]}),n})();"undefined"!=typeof window&&window;class xJ extends S{constructor(e,t){super()}schedule(e,t=0){return this}}class cE extends xJ{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let O3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Yl extends O3{constructor(e,t=O3.now){super(e,()=>Yl.delegate&&Yl.delegate!==this?Yl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Yl.delegate&&Yl.delegate!==this?Yl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const DJ=new class extends Yl{}(class extends cE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Nc=new F(n=>n.complete());function uE(n){return n?function(n){return new F(e=>n.schedule(()=>e.complete()))}(n):Nc}function nn(...n){let e=n[n.length-1];return Te(e)?(n.pop(),Be(n,e)):An(n)}function fg(n,e){return new F(e?t=>e.schedule(IJ,0,{error:n,subscriber:t}):t=>t.error(n))}function IJ({error:n,subscriber:e}){e.error(n)}class ta{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return nn(this.value);case"E":return fg(this.error);case"C":return uE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ta("N",e):ta.undefinedValueNotification}static createError(e){return new ta("E",void 0,e)}static createComplete(){return ta.completeNotification}}ta.completeNotification=new ta("C"),ta.undefinedValueNotification=new ta("N",void 0);class dE extends y{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(dE.dispatch,this.delay,new RJ(e,this.destination)))}_next(e){this.scheduleMessage(ta.createNext(e))}_error(e){this.scheduleMessage(ta.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ta.createComplete()),this.unsubscribe()}}class RJ{constructor(e,t){this.notification=e,this.destination=t}}class pg extends ee{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new NJ(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new U;if(this.isStopped||this.hasError?o=S.EMPTY:(this.observers.push(e),o=new ie(this,e)),r&&e.add(e=new dE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class NJ{constructor(e,t){this.time=e,this.value=t}}function sr(n,e){return"function"==typeof e?t=>t.pipe(sr((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new PJ(n))}class PJ{constructor(e){this.project=e}call(e,t){return t.subscribe(new FJ(e,this.project))}}class FJ extends pe{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new Et(this),r=this.destination;r.add(i),this.innerSubscription=O(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const hE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return hE.schedule(n,0);if(void 0===window.requestAnimationFrame)return hE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let HD;function $J(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!HD){const t=Element.prototype;HD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&HD.call(n,e)}(n,r)||(i=s,0))),i}class qJ{constructor(e,t){this.componentFactory=t.get(ol).resolveComponentFactory(e)}create(e){return new YJ(this.componentFactory,e)}}class YJ{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new pg(1),this.events=this.eventEmitters.pipe(sr(i=>Rn(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(yn),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=hE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=zn.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(me(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=hE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new Dm(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class KJ extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Iu(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?Iu(n,e,t).pipe(me(r=>L(r)?i(...r):i(r))):new F(r=>{R3(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function R3(n,e,t,i,r){let s;if(function(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const o=n;n.addEventListener(e,t,r),s=()=>o.removeEventListener(e,t,r)}else if(function(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const o=n;n.on(e,t),s=()=>o.off(e,t)}else if(function(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const o=n;n.addListener(e,t),s=()=>o.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let o=0,a=n.length;o=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function P3(n,e){return function(t,i){e(t,i,n)}}function Kl(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function or(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}class Ir extends ee{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new U;return this._value}next(e){super.next(this._value=e)}}class k3 extends y{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class nee extends y{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function B3(n,e,t,i,r=new nee(n,t,i)){if(!r.closed)return e instanceof F?e.subscribe(r):Oe(e)(r)}function gE(...n){return It(1)(nn(...n))}Object.create(Error.prototype);const U3=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function Xi(n){return e=>0===n?uE():e.lift(new see(n))}class see{constructor(e){if(this.total=e,this.total<0)throw new U3}call(e,t){return t.subscribe(new oee(e,this.total))}}class oee extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function Ui(n,e){return function(i){return i.lift(new cee(n,e))}}class cee{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new uee(e,this.predicate,this.thisArg))}}class uee extends y{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}function Xl(n){return function(t){const i=new dee(n),r=t.lift(i);return i.caught=r}}class dee{constructor(e){this.selector=e}call(e,t){return t.subscribe(new hee(e,this.selector,this.caught))}}class hee extends pe{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new Et(this);this.add(i);const r=O(t,i);r!==i&&this.add(r)}}}function _E(n=null){return e=>e.lift(new yee(n))}class yee{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new vee(e,this.defaultValue))}}class vee extends y{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function Hd(){}function jr(n,e,t){return function(r){return r.lift(new wee(n,e,t))}}class wee{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Eee(e,this.nextOrObserver,this.error,this.complete))}}class Eee extends y{constructor(e,t,i,r){super(e),this._tapNext=Hd,this._tapError=Hd,this._tapComplete=Hd,this._tapError=i||Hd,this._tapComplete=r||Hd,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||Hd,this._tapError=t.error||Hd,this._tapComplete=t.complete||Hd)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}class Mne{constructor(e){this.total=e}call(e,t){return t.subscribe(new Ine(e,this.total))}}class Ine extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}let GB=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=kt({type:n,selectors:[["","gaEvent","","gaCategory",""],["","gaCategory",""]],inputs:{gaCategory:"gaCategory"},exportAs:["gaCategory"]}),n})();const wg=new zt("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),gM=new zt("ngx-window",{providedIn:"root",factory:()=>function(n){return lf(n)?window:null}(vc(Oc))}),Nne=new zt("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(vc(gM))}),mM=new zt("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(vc(gM),vc(Nne))});let PE=(()=>{class n{constructor(t,i,r){this.settings=t,this._document=i,this._gtag=r}get document(){return this._document}throw(t){(this.settings.enableTracing||Sa())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((i,[r,s])=>Object.defineProperty(i,r,{value:s,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(i=>void 0!==i))}catch(i){this.throw(i)}}event(t,i,r,s,o){try{const a=new Map;i&&a.set("event_category",i),r&&a.set("event_label",r),s&&a.set("value",s),void 0!==o&&a.set("interaction",o);const l=this.toKeyValue(a);l?this.gtag("event",t,l):this.gtag("event",t)}catch(a){this.throw(a)}}pageView(t,i,r,s){try{const o=new Map([["page_path",t]]);i&&o.set("page_title",i),(r||this.document)&&o.set("page_location",r||this.document.location.href),s&&Object.entries(s).map(([a,l])=>o.set(a,l)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(o))}catch(o){this.throw(o)}}appView(t,i,r,s,o){try{const a=new Map([["screen_name",t],["app_name",i]]);r&&a.set("app_id",r),s&&a.set("app_version",s),o&&a.set("app_installer_id",o),this.gtag("event","screen_view",this.toKeyValue(a))}catch(a){this.throw(a)}}set(...t){try{this._gtag("set",...t)}catch(i){this.throw(i)}}exception(t,i){try{const r=new Map;t&&r.set("description",t),i&&r.set("fatal",i),this.toKeyValue(r)?this.gtag("event","exception",this.toKeyValue(r)):this.gtag("event","exception")}catch(r){this.throw(r)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(wg),Ie(un),Ie(mM))},n.\u0275prov=$e({factory:function(){return new n(Ie(wg),Ie(un),Ie(mM))},token:n,providedIn:"root"}),n})(),$B=(()=>{class n{constructor(t,i,r,s){this.gaCategoryDirective=t,this.gaService=i,this.settings=r,this.el=s,this.gaBind="click"}set gaBind(t){this.bindSubscription&&this.bindSubscription.unsubscribe(),this._gaBind=t,this.bindSubscription=Iu(this.el.nativeElement,t).subscribe(()=>this.trigger())}get gaBind(){return this._gaBind}ngOnDestroy(){this.bindSubscription&&this.bindSubscription.unsubscribe()}trigger(){try{if(!this.gaAction&&!this.gaEvent)throw new Error("You must provide a gaAction attribute to identify this event.");this.gaService.event(this.gaAction||this.gaEvent,this.gaCategoryDirective?this.gaCategoryDirective.gaCategory:void 0,this.gaLabel||this.label,this.gaValue,this.gaInteraction)}catch(t){this.throw(t)}}throw(t){(Sa()||this.settings.enableTracing)&&console&&console.warn&&console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)(De(GB,8),De(PE),De(wg),De(wn))},n.\u0275dir=kt({type:n,selectors:[["","gaEvent",""]],inputs:{gaBind:"gaBind",gaAction:"gaAction",gaLabel:"gaLabel",label:"label",gaValue:"gaValue",gaInteraction:"gaInteraction",gaEvent:"gaEvent"},exportAs:["gaEvent"]}),n})();const Fne={provide:tf,multi:!0,useFactory:function(n,e,t){return()=>or(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(Sa()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Sa()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));t||Sa()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),n.uri=n.uri||`https://www.googletagmanager.com/gtag/js?id=${n.trackingCode}`,n.initCommands=null!==(i=null==n?void 0:n.initCommands)&&void 0!==i?i:[],n.initCommands.find(o=>"config"===o.command)||n.initCommands.unshift({command:"config",values:[n.trackingCode]}),n.initCommands.find(o=>"js"===o.command)||n.initCommands.unshift({command:"js",values:[new Date]});for(const o of n.initCommands)e(o.command,...o.values);const r=t.createElement("script");r.async=!0,r.src=n.uri,n.nonce&&r.setAttribute("nonce",n.nonce),t.getElementsByTagName("head")[0].appendChild(r)})},deps:[wg,mM,un]};new zt("ngx-google-analytics-routing-settings",{factory:()=>({})});let FE=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:wg,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},Fne]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[]]}),n})(),LE=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new pg(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),jne=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new S,this.token=r,this.subscriptions.add(t.consentChange.subscribe(s=>this.toggleGoogleAnalytics("rescinded"===s)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(LE),Ie(gM),Ie(wg))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const Vne=new zt("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),YB=[LE,jne,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new S;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(r=>this.saveConsent(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,i;const r=null===(i=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===i?void 0:i.call(t,this.key);if(null==r)return"not-set";const s=r.trim().toLowerCase();switch(s){case"given":case"rescinded":return s;default:return"not-set"}}saveConsent(t){var i,r;null===(r=null===(i=this.storage)||void 0===i?void 0:i.setItem)||void 0===r||r.call(i,this.key,t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(LE),Ie(Vne))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})()];function zne(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let Gne=(()=>{class n{static forRoot(t){const{providers:i=[]}=FE.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[zne({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[...YB,{provide:tf,multi:!0,useFactory:()=>()=>{},deps:YB}],imports:[[FE]]}),n})();var _M;const $d={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@1/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"",hubmapPortalUrl:"",hubmapDataUrl:"",hubmapAssetsUrl:"",hubmapToken:null!==(_M=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==_M?_M:""},googleAnalyticsToken:"G-ERNVZ1Q4KE"},$ne={initialConfig:{},parse:{},rename:{}};class Wne{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},$ne),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let qne=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new Wne(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=kt({type:n,features:[ki]}),n})();const KB_json=n=>"string"==typeof n?JSON.parse(n):n;function XB(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function yM(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||XB()}const QB="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",kE=yM();class Kne{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function vM(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const ZB={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function JB(n){return"string"==typeof n?ZB[n.toUpperCase()]||ZB.WHITE:n}function BE(n,e){if(!n)throw new Error(e||"Assertion failed")}const Ql={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},$y=Ql.window||Ql.self||Ql.global,ej=Ql.process||{};function Eg(){let n;if(kE&&$y.performance)n=$y.performance.now();else if(ej.hrtime){const e=ej.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Sg={debug:kE&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},nie={enabled:!0,level:0};function pl(){}const tj={},nj={once:!0};function iie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let bM=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=QB,this._startTs=Eg(),this._deltaTs=Eg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Kne("__probe-".concat(this.id,"__"),nie),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Eg()-this._startTs).toPrecision(10))}getDelta(){return Number((Eg()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){BE(t,i)}warn(t){return this._getLogFunction(0,t,Sg.warn,arguments,nj)}error(t){return this._getLogFunction(0,t,Sg.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,Sg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Sg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Sg.debug||Sg.info,arguments,nj)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||pl,r&&[r],{tag:iie(i)}):pl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?kE?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=vM(r,e,t);console.log(...s)},r.src=n,pl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...vM(n,e,t)),pl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...vM(r,e,t)),r.src=n.toDataURL(),pl}return pl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=tt(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):pl}({image:r,message:s,scale:o}):pl}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||pl)}group(t,i,r={collapsed:!1}){r=rj({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||pl)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=ij(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=rj({logLevel:t,message:i,args:s,opts:o}),BE(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Eg();const a=o.tag||o.message;if(o.once){if(tj[a])return pl;tj[a]=Eg()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!kE&&"string"==typeof n&&(e&&(e=JB(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=JB(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return pl}}return n.VERSION=QB,n})();function ij(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return BE(Number.isFinite(e)&&e>=0),e}function rj(n){const{logLevel:e,message:t}=n;n.logLevel=ij(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return BE("string"===r||"object"===r),Object.assign(n,n.opts)}const Ni=new bM({id:"deck"}),Mi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mi,"IDENTITY",{get:()=>Ni.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},sj={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},dn=new bM({id:"luma.gl"});function Po(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function jE(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function fi(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function VE(n){return Po(jE(n),"Invalid WebGLRenderingContext"),n}function Fo(n){return Po(fi(n),"Requires WebGL2"),n}var Er=tt(761);const Wy={};const qy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Er.CO.console&&Er.CO.console.log&&Er.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};gf.prototype.VERTEX_ARRAY_BINDING_OES=34229,gf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;ifi(n)?void 0:0,Cie={3074:n=>fi(n)?void 0:36064,35723:n=>fi(n)?void 0:4352,35977:ur,32937:ur,36795:(n,e)=>{const t=fi(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(lj);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(lj);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:ur,35071:ur,37447:ur,36063:(n,e)=>{if(!fi(n)){const t=n.getExtension(aj);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:ur,35374:ur,35377:ur,34852:n=>{if(!fi(n)){const e=n.getExtension(aj);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(oj)?2147483647:65535,33001:n=>n.getExtension(oj)?16777216:65535,33e3:n=>16777216,37157:ur,35373:ur,35657:ur,36183:ur,37137:ur,34045:ur,35978:ur,35979:ur,35968:ur,35376:ur,35375:ur,35659:ur,37154:ur,35371:ur,35658:ur,35076:ur,35077:ur,35380:ur},cj="ANGLE_instanced_arrays",uj={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Po(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[cj]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){Po(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Po(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Po(!1)},deleteQuery:()=>{Po(!1)},beginQuery:()=>{Po(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},wM={readBuffer:(n,e,t)=>{fi(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:fi(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!fi(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!fi(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=Cie[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function kie(n,{extension:e,target:t,target2:i}){const r=uj[e];Po(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new gf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&kie(n,{extension:t,target:n.luma,target2:n})}(n,uj),function(n,{target:e,target2:t}){Object.keys(wM).forEach(i=>{if("function"==typeof wM[i]){const r=n[i]?n[i].bind(n):()=>{},s=wM[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const EM={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},Wd=(n,e,t)=>e?n.enable(t):n.disable(t),dj=(n,e,t)=>n.hint(t,e),xa=(n,e,t)=>n.pixelStorei(t,e);function Yy(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Vie={3042:Wd,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:Wd,2885:(n,e)=>n.cullFace(e),2929:Wd,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:Wd,35723:dj,36006:(n,e)=>{const t=fi(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:dj,2849:(n,e)=>n.lineWidth(e),32823:Wd,32824:"polygonOffset",10752:"polygonOffset",35977:Wd,32938:"sampleCoverage",32939:"sampleCoverage",3089:Wd,3088:(n,e)=>n.scissor(...e),2960:Wd,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:xa,3317:xa,37440:xa,37441:xa,37443:xa,3330:xa,3332:xa,3331:xa,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:xa,32878:xa,3316:xa,3315:xa,32877:xa,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Yy(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Yy(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Yy(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Yy(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=Yy(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Xr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const Uie={blendEquation:(n,e,t)=>n.blendEquationSeparate(Xr(32777,e,t),Xr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Xr(32969,e,t),Xr(32968,e,t),Xr(32971,e,t),Xr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Xr(32824,e,t),Xr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Xr(32938,e,t),Xr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Xr(2962,e,t),Xr(2967,e,t),Xr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Xr(34816,e,t),Xr(36003,e,t),Xr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Xr(2964,e,t),Xr(2965,e,t),Xr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Xr(34817,e,t),Xr(34818,e,t),Xr(34819,e,t))},hj={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Bc=(n,e)=>n.isEnabled(e),fj={3042:Bc,2884:Bc,2929:Bc,3024:Bc,32823:Bc,32926:Bc,32928:Bc,3089:Bc,2960:Bc,35977:Bc};function pj(n){for(const e in n)return!1;return!0}function zie(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||EM)){const r=e,s=fj[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=fj[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},EM),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Po(this.stateStack.length>0),Nu(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){Po(void 0!==s);const o=e[s],a=this.cache[s];zie(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function mj(n,e={}){const{enable:t=!0,copyState:i}=e;if(Po(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new $ie(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in hj)Hie(n,o,hj[o]);gj(n,"getParameter"),gj(n,"isEnabled")}return n.state.enable=t,n}function _j(n){Po(n.state),n.state.pop()}function Nu(n,e){if(Po(jE(n),"setParameters requires a WebGL context"),pj(e))return;const t={};for(const r in e){const s=Number(r),o=Vie[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)Uie[r](n,e,i)}function Zl(n,e,t){if(pj(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||mj(n,{copyState:!1}),n.state.push()}(n),Nu(n,e),i)r=t(n),_j(n);else try{r=t(n)}finally{_j(n)}return r}function Cg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function SM(n,e,t=!0){return function(n,e,t,i,r){const s=yj(n[0],e,t);let o=vj(n[1],e,i,r),a=yj(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=vj(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,Cg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function yj(n,e,t){return Math.min(Math.round(n*e),t-1)}function vj(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const CM=(0,Er.jU)(),Qie=CM&&"undefined"!=typeof document,bj={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function wj(n={}){Po(CM,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},bj,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(Qie&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=xM(r,n),function(n){const e=fi(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);dn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function xM(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},bj,e);const{manageState:t,debug:i}=e;return t&&mj(n,{copyState:!1,log:(...r)=>dn.log(1,...r)()}),CM&&i&&(Er.CO.makeDebugContext?(n=Er.CO.makeDebugContext(n,e),dn.level=Math.max(dn.level,1)):dn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function Ej(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class Sj{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ej(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ej()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class AM{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof Sj?e:new Sj(t,i)),this.stats[t]}}const Ky="8.5.7",mf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new AM({id:e})),this.stats.get(e)}};if(Er.CO.luma&&Er.CO.luma.VERSION!==Ky)throw new Error(`luma.gl - multiple VERSIONs detected: ${Er.CO.luma.VERSION} vs 8.5.7`);function rn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function TM(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return rn(void 0!==i,`Accessing undefined constant GL.${e}`),i}function qd(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Er.CO.luma||((0,Er.jU)()&&dn.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Er.CO.luma=Er.CO.luma||{VERSION:Ky,version:Ky,log:dn,stats:mf,globals:{modules:{},nodeIO:{}}});const DM={};function jc(n="id"){return DM[n]=DM[n]||1,`${n}-${DM[n]++}`}function Cj(n){return rn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function xg(n){let e=!0;for(const t in n){e=!1;break}return e}function xj(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw dn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ag="Resource subclass must define virtual methods";class Pu{constructor(e,t={}){VE(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||jc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){rn(e=TM(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=fi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=fi(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?qd(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=qd(this.gl,o[f]))}}return o}setParameter(e,t){rn(e=TM(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=fi(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=TM(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return xj(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ag)}_deleteHandle(){throw new Error(Ag)}_bindHandle(e){throw new Error(Ag)}_getOptsFromHandle(){throw new Error(Ag)}_getParameter(e,t){throw new Error(Ag)}_setParameter(e,t){throw new Error(Ag)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=mf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;mf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=mf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=mf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function MM(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Xy(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function cre({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return ia.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ia.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=IM("Accessor",e,dre)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const Tj={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},hre={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Tj},fre={removedProps:Tj};class tr extends Pu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/ia.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ia.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=IM("Buffer",e,hre),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=IM("Buffer",e,fre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ia(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;rn(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Fo(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return Fo(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){Fo(this.gl);const s=Xy(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return rn((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(rn(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){rn(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=MM(e);return rn(s),this.setAccessor(new ia(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){rn(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/Xy(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ia(this.accessor,{type:MM(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return dn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return dn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return dn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return dn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ia(this.accessor,e),this}}const OM={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},Dj={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},Mj={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},mre=[9729,9728],Ij=Er.CO.WebGLBuffer||function(){};class Tg extends Pu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=OM[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=fi(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=OM[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=jc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(G=>this.initialize(Object.assign({},e,{pixels:G,data:G}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:x=!1,mipmaps:T=!0}=e;const{depth:q=0}=e;return({width:f,height:p,compressed:x,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:x,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=q,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),T&&this._isNPOT()&&(dn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),T=!1,this._updateForNPOT(l)),this.mipmaps=T,this.setImageData({data:t,width:f,height:p,depth:q,format:s,type:_,dataFormat:g,border:o,mipmaps:T,parameters:c,compressed:x}),T&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:x}=this;x.bindTexture(this.target,this.handle);let q,T=null;return({data:c,dataType:T}=this._getDataType({data:c,compressed:_})),Zl(this.gl,l,()=>{switch(T){case"null":x.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":x.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":q=Fo(x),q.bindBuffer(35052,c.handle||c),q.texImage2D(t,r,s,f,p,o,g,d,a),q.bindBuffer(35052,null);break;case"browser-object":fi(x)?x.texImage2D(t,r,s,f,p,o,g,d,c):x.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[G,ge]of c.entries())x.compressedTexImage2D(t,G,ge.format,ge.width,ge.height,o,ge.data);break;default:rn(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(Dj[this.dataFormat]||4)*(Mj[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:x={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),rn(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const T=i;i=T.data,o=T.shape[0],a=T.shape[1]}i instanceof tr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),Zl(this.gl,x,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof Ij){const T=Fo(this.gl);T.bindBuffer(35052,i),T.texSubImage2D(e,l,r,s,o,a,f,d,g),T.bindBuffer(35052,null)}else fi(this.gl)?Fo(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return dn.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof tr?{data:e.handle,dataType:"buffer"}:e instanceof Ij?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=OM[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},rn(r,"Could not deduced texture size"),rn(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),rn(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:rn(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(fi(this.gl)||!this.width||!this.height||Cj(this.width)&&Cj(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===mre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function _re(n,e){return rn("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class Aa extends Tg{static isSupported(e,t){return Tg.isSupported(e,t)}constructor(e,t={}){VE(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:_re(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const _f="EXT_color_buffer_float",Oj={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:_f,bpp:2},33327:{gl2:_f,bpp:4},34842:{gl2:_f,bpp:8},33326:{gl2:_f,bpp:4},33328:{gl2:_f,bpp:8},34836:{gl2:_f,bpp:16},35898:{gl2:_f,bpp:4}};class Dg extends Pu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=fi(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,Oj)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return rn(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&fi(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Oj[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const Lj="clear: bad arguments";function NM(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),rn(0!==o,Lj),Zl(n,s,()=>{n.clear(o)})}function kj(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function ei(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){kj(s,i,r,o,a,"next",l)}function a(l){kj(s,i,r,o,a,"throw",l)}o(void 0)})}}const PM=[34069,34070,34071,34072,34073,34074];let Cre=(()=>{class n extends Tg{constructor(t,i={}){VE(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return ei(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(PM.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),PM.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&dn.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((x,T)=>{t&&i?d.texImage2D(g,T,a,t,i,o,a,l,x):d.texImage2D(g,T,a,a,l,x)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=PM,n})();class xre extends Tg{static isSupported(e){return fi(e)}constructor(e,t={}){Fo(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Zl(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof tr&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(Dj[this.dataFormat]||4)*(Mj[this.type]||1),"Texture"),this.loaded=!0,this}}function Tre(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Ds(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function UE(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof Ds?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Tre(n),deleteFramebuffer:!0}}(n);rn(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),rn(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(Xy(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return rn(!1),0}}(t))}(o,c,r,a,l),c=c||MM(o);const x=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,x||null),f&&d.delete(),o}function FM(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=UE(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=cre({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return rn(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&dn.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){rn(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof Dg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(Ds.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&NM(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Fo(n),Zl(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:rn(!1,Lj)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return dn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return dn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return dn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return dn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return dn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return dn.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=Fo(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=qd(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?qd(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?qd(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(FM(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>dn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=FM(this,{targetMaxHeight:100});return dn.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new Aa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new Dg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new Dg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&rn(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof Dg?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:Fo(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:rn(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return fi(n)?n:null}(this.gl);t?t.readBuffer(e):rn(36064===e||1029===e,Bj),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Fo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):rn(1===e.length&&(36064===e[0]||1029===e[0]),Bj)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in jj)void 0===n.luma.caps[e]&&(n.luma.caps[e]=Uj(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Ds.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const jj={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new Aa(n,{format:6408,type:5126,dataFormat:6408}),t=new Ds(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function LM(n,e){return Vj(n,e)}function Vj(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>Uj(n,t))}function Uj(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=jj[e];let i;rn(t,e);const r=fi(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:rn(!1);return i}(n,e)),n.luma.caps[e]||dn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class kM{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},jre=(Math,1/180*Math.PI),Sr={};function Ure(n,{precision:e=Sr.precision||4}={}){return n=function(n){return Math.round(n/Sr.EPSILON)*Sr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function Yd(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Fu(n,e,t){if(Yd(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*jre,void 0)}(n)}function yf(n,e,t){return Fu(n,i=>Math.max(e,Math.min(t,i)))}function zE(n,e,t){return Yd(n)?n.map((i,r)=>zE(i,e[r],t)):t*e+(1-t)*n}function Jy(n,e,t){const i=Sr.EPSILON;t&&(Sr.EPSILON=t);try{if(n===e)return!0;if(Yd(n)&&Yd(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+Ure(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(Jj.length=n.length,i=Jj):i=Zj,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function tV(n){return n&&n[Symbol.asyncIterator]}function zM(n,e=(()=>!0)){return Array.isArray(n)?nV(n,e,[]):e(n)?[n]:[]}function nV(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function iV(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ht(ht(ht({},Cse[n.type]),e),n)):null}function rV(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function sV(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function oV(n){n.push(n.shift())}function GM(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function aV({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=GM(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const q=s;s=(G,ge)=>t._normalizeConstant(q(G,ge))}const _=p?(q,G)=>s(g,G):(q,G)=>s(g.subarray(q,q+a),G),x=n.getData({length:i}),T=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return HM({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===WE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=WE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wse}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==WE}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const T=f*a+l;for(let q=0;qd?c.set(ge,x):(e._normalizeValue(ge,q.target,0),bse({target:c,source:q.target,start:x,count:Ne}));x+=Ne*d}else e._normalizeValue(ge,c,x),x+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let WM={};function _o(n){Ni.level>0&&WM[n]&&WM[n].call(...arguments)}function Ta(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const lV="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Tse=`#version 300 es\n${lV}`;function cV(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function uV(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Tse:e>300?`#version ${e}\n${lV}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Ta(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class dV extends Pu{static isSupported(e){return fi(e)}constructor(e,t={}){Fo(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,xg(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,dn.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof tr?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Ose{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof tr?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&rn(fi(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new dV(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],rn(i[s]instanceof tr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new tr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function hV(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const nv="vs",Pse={[nv]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},qE="__LUMA_INJECT_DECLARATIONS__",fV=/void\s+main\s*\([^)]*\)\s*\{\n?/,pV=/}\n?[^{}]*$/,YM=[];function gV(n,e,t,i=!1){const r=e===nv;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),YM.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(pV,l=>a+l));break;case"fs:#decl":r||(n=n.replace(qE,a));break;case"fs:#main-start":r||(n=n.replace(fV,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(pV,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(qE,""),i&&(n=n.replace(/\}\s*$/,s=>s+Pse[e])),n}function KM(n){const e={};return Ta(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const Fse={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},YE="transform_uSize_",mV="transform_position";const Hse={10241:9728,10240:9728,10242:33071,10243:33071};class $se{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${YE}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${YE}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=UE(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Ta(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new tr(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new Ds(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters(Hse)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){rn(n instanceof Aa||n instanceof Cre||n instanceof xre);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const x=function(n,e){const t={},i=function(n){return cV(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${YE}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Ta(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(x){const{updatedLine:T,inject:q}=x;f[g]=T,c=KM([c,q]),Object.assign(a,x.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=cV(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){rn(i);const p=`${YE}${t}`;c=KM([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${mV} = transform_getPos(${p});\n gl_Position = vec4(${mV}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=KM([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||uV({version:hV(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Fse].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const XM={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function qse(n){let e=_V(n);return"object"===e?n?"type"in n?Object.assign({},n,XM[n.type]):"value"in n?(e=_V(n.value),Object.assign({type:e},n,XM[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},XM[e])}function _V(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class QM{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Ta("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=qse(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Ta(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Ta(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Qse(n){return function(n){const e={},t={};return ZM({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(vV(n))}function ZM({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof QM||(Ta("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ta(t.name,"shader module has no name"),(t=new QM(t)).dependencies=vV(t.dependencies)),t))}const JM={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},vf={};function soe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(JM).forEach(n=>{vf[n]=n});const eI={};function bV(n,e,t={}){const i=JM[e];if(Ta(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in eI)return eI[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),eI[e]=l,l}function KE(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=JM[e];Ta(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Ta(!1===r||!0===r),r}(n,t))}function Ig(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const wV=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],coe=[...wV,[Ig("attribute"),"in $1"],[Ig("varying"),"out $1"]],uoe=[...wV,[Ig("varying"),"in $1"]],EV=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],doe=[...EV,[Ig("in"),"attribute $1"],[Ig("out"),"varying $1"]],hoe=[...EV,[Ig("in"),"varying $1"]],tI="gl_FragColor",nI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,foe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function XE(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const _oe=`\n\n${qE}\n\n`,SV={[nv]:"vertex",fs:"fragment"};function CV(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Ta("string"==typeof t,"shader source must be a string");const f=i===nv,p=t.split("\n");let g=100,_="",x=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],x=p.slice(1).join("\n")):_=`#version ${g}`;const T={};r.forEach(We=>{Object.assign(T,We.getDefines())}),Object.assign(T,s);let q=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${SV[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${SV[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:soe(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return KE(n,vf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),KE(n,vf.GLSL_DERIVATIVES)&&bV(n,vf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),KE(n,vf.GLSL_FRAG_DATA)&&bV(n,vf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),KE(n,vf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(T)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const G=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),ge={},Ne={},Ge={};for(const We in a){const dt="string"==typeof a[We]?{injection:a[We],order:0}:a[We],Mt=We.match(/^(v|f)s:(#)?([\w-]+)$/);if(Mt){const Lt=Mt[3];Mt[2]?"decl"===Lt?Ne[We]=[dt]:Ge[We]=[dt]:ge[We]=[dt]}else Ge[We]=[dt]}for(const We of r){d&&We.checkDeprecations(x,d),q+=We.getModuleSource(i,g);const Mt=We.injections[i];for(const Ot in Mt){const Lt=Ot.match(/^(v|f)s:#([\w-]+)$/);if(Lt){const Jt="decl"===Lt[2]?Ne:Ge;Jt[Ot]=Jt[Ot]||[],Jt[Ot].push(Mt[Ot])}else ge[Ot]=ge[Ot]||[],ge[Ot].push(Mt[Ot])}}return q+=_oe,q=gV(q,i,Ne),q+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(G[i],ge),q+=x,q=gV(q,i,Ge),q=function(n,e,t){switch(e){case 300:return t?XE(n,coe):function(n){const e=(n=XE(n,uoe)).match(nI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${tI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(foe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${tI}\\b`,"g"),t)}return n}(n);case 100:return t?XE(n,doe):function(n){const e=(n=XE(n,hoe)).match(nI);if(e){const t=e[1];n=n.replace(nI,"").replace(new RegExp(`\\b${t}\\b`,"g"),tI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(q,l?100:g,f),q}function boe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Aoe={5126:Cr.bind(null,"uniform1fv",Da,1,yo),35664:Cr.bind(null,"uniform2fv",Da,2,yo),35665:Cr.bind(null,"uniform3fv",Da,3,yo),35666:Cr.bind(null,"uniform4fv",Da,4,yo),5124:Cr.bind(null,"uniform1iv",Kd,1,yo),35667:Cr.bind(null,"uniform2iv",Kd,2,yo),35668:Cr.bind(null,"uniform3iv",Kd,3,yo),35669:Cr.bind(null,"uniform4iv",Kd,4,yo),35670:Cr.bind(null,"uniform1iv",Kd,1,yo),35671:Cr.bind(null,"uniform2iv",Kd,2,yo),35672:Cr.bind(null,"uniform3iv",Kd,3,yo),35673:Cr.bind(null,"uniform4iv",Kd,4,yo),35674:Cr.bind(null,"uniformMatrix2fv",Da,4,ku),35675:Cr.bind(null,"uniformMatrix3fv",Da,9,ku),35676:Cr.bind(null,"uniformMatrix4fv",Da,16,ku),35678:Js,35680:Js,5125:Cr.bind(null,"uniform1uiv",QE,1,yo),36294:Cr.bind(null,"uniform2uiv",QE,2,yo),36295:Cr.bind(null,"uniform3uiv",QE,3,yo),36296:Cr.bind(null,"uniform4uiv",QE,4,yo),35685:Cr.bind(null,"uniformMatrix2x3fv",Da,6,ku),35686:Cr.bind(null,"uniformMatrix2x4fv",Da,8,ku),35687:Cr.bind(null,"uniformMatrix3x2fv",Da,6,ku),35688:Cr.bind(null,"uniformMatrix3x4fv",Da,12,ku),35689:Cr.bind(null,"uniformMatrix4x2fv",Da,8,ku),35690:Cr.bind(null,"uniformMatrix4x3fv",Da,12,ku),35678:Js,35680:Js,35679:Js,35682:Js,36289:Js,36292:Js,36293:Js,36298:Js,36299:Js,36300:Js,36303:Js,36306:Js,36307:Js,36308:Js,36311:Js},Toe={},Doe={},Moe={},xV=[0];function iI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(xV[0]=n,n=xV);const r=n.length;if(r%e&&dn.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Cr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{rn(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return MV(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:DV(s,c),warnings:DV(o,c)}}(i,this.source,this.shaderType,this.id);throw dn.error(`GLSL compilation errors in ${r}\n${s}`)(),dn.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class rI extends iv{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class sI extends iv{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Ms=5126,rv=5124,sv=5125,oI={[Ms]:[Ms,1,"float"],35664:[Ms,2,"vec2"],35665:[Ms,3,"vec3"],35666:[Ms,4,"vec4"],[rv]:[rv,1,"int"],35667:[rv,2,"ivec2"],35668:[rv,3,"ivec3"],35669:[rv,4,"ivec4"],[sv]:[sv,1,"uint"],36294:[sv,2,"uvec2"],36295:[sv,3,"uvec3"],36296:[sv,4,"uvec4"],35670:[Ms,1,"bool"],35671:[Ms,2,"bvec2"],35672:[Ms,3,"bvec3"],35673:[Ms,4,"bvec4"],35674:[Ms,8,"mat2"],35685:[Ms,8,"mat2x3"],35686:[Ms,8,"mat2x4"],35675:[Ms,12,"mat3"],35687:[Ms,12,"mat3x2"],35688:[Ms,12,"mat3x4"],35676:[Ms,16,"mat4"],35689:[Ms,16,"mat4x2"],35690:[Ms,16,"mat4x3"]};function FV(n){const e=oI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function LV(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Ms}for(const t in oI){const[i,r,s]=oI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class fae{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!fi(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=FV(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ia(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=FV(i),l={location:e,name:t,accessor:new ia({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const pae=35981,gae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class BV extends Pu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",gae),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=pae}=e;return this.hash=t||"",this.vs="string"==typeof i?new rI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new sI(this.gl,{id:`${e.id}-fs`,source:r}):r,rn(this.vs instanceof rI),rn(this.fs instanceof sI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Fo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new fae(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:x,samplers:T}){if((x||T)&&(dn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(x||{})),dn.priority>=e){const q=g?g.id:"default",G=`mode=${qd(this.gl,t)} verts=${i} instances=${c} indexType=${qd(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${q}`;dn.log(e,G)()}return rn(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const q=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return rn(!1),0}}(t);p.begin(q)}this._bindTextures(),Zl(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&fi(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){dn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Roe(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof Ds&&(s=s.texture),s instanceof Tg)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&Noe(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new rI({handle:r});break;case 35632:i.fs=new sI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=jc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),dn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),dn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||dn.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(ge=>this._getHash(ge.name)).sort(),g=o.map(ge=>this._getHash(ge)),_=Object.keys(r).sort(),x=Object.keys(s).sort(),T=[],q=[];for(const ge of _)T.push(this._getHash(ge)),T.push(this._getHash(r[ge]));for(const ge of x)q.push(this._getHash(ge)),q.push(this._getHash(s[ge]));const G=`${d}/${f}D${T.join("/")}M${p.join("/")}I${q.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[G]){const ge=function(n,e){const{vs:t,fs:i}=e,r=Qse(e.modules||[]);return{gl:n,vs:CV(n,Object.assign({},e,{source:t,type:nv,modules:r})),fs:CV(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:boe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[G]=new BV(this.gl,{hash:G,vs:ge.vs,fs:ge.fs,varyings:o,bufferMode:a}),this._getUniforms[G]=ge.getUniforms||(Ne=>{}),this._useCounts[G]=0}return this._useCounts[G]++,this._programCache[G]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":$y.chrome?"Chrome":$y.safari?"Safari":$y.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ma(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ma.MAX_ATTRIBUTES=Ma.MAX_ATTRIBUTES||e.getParameter(34921),Ma.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ma._setConstantFloatArray(e,t,i);break;case Int32Array:Ma._setConstantIntArray(e,t,i);break;case Uint32Array:Ma._setConstantUintArray(e,t,i);break;default:rn(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Ma.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return rn(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(rn(fi(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ma.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new tr(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!eS||eS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Eae=/^(.+)__LOCATION_([0-9]+)$/,Sae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Cae{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Ma(e),xj(this,"VertexArray","v6.0",Sae),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new tr(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,dn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ia.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return rn(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Eae.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof tr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof tr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof tr))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof tr){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return dn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function av(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=av(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function jV(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof tr){const p=e,{data:g,changed:_}=p.getDebugData();let x;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?x=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${qd(r,s)})`:(c=!0,x=`${l} bytes`),{[i]:`${d}${av(f,{size:o,isInteger:c})}`,"Format ":x}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${av(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Tae(n,e){const{type:t,size:i}=e,r=LV(t,i);return r?`${n} (${r.name})`:n}function VV({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){rn(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||aI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:av(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function aI({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?av(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function UV(n){const{type:e,size:t}=n.accessor,i=LV(e,t);return i?`${i.name} ${n.name}`:n.name}const Iae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rae(n,e){const{attributeMap:t=Iae}=e||{};return t&&t[n]||n}function Nae(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}rn(Number.isFinite(e.size),`attribute ${n} needs size`)}const zV=()=>{},Lae={};class tS{constructor(e,t={}){const{id:i=jc("model")}=t;rn(jE(e)),this.id=i,this.gl=e,this.id=t.id||jc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||ov.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},rn(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return rn(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return rn(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Rae(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ht({},o);delete c.value,i[a]=[new tr(n,l),c],Nae(s,c)}}if(r){const s=r.value||r;rn(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new tr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(xg(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return NM(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),dn.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&dn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:x,instanceCount:T}=this,{onBeforeRender:q=zV,onAfterRender:G=zV}=this.props;q(),this.program.setUniforms(this.uniforms);const ge=this.program.draw(Object.assign(Lae,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:x,instanceCount:T,offset:f?g:0}));return G(),dn.priority>=2&&this._logDrawCallEnd(c,l,i),ge}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return dn.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}rn(t instanceof BV,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new Cae(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof tr&&t.delete()}}_setAnimationProps(e){this.animated&&rn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(xg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new dV(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:dn.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=jV(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Tae(s.name,a)}`),t[o]=jV(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=VV({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=VV({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&dn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&dn.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${UV(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${UV(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);dn.table(e,s)(),dn.table(e,o)(),dn.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),dn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class lI{static isSupported(e){return fi(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();rn(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new tS(t,Object.assign({},e,{fs:e.fs||uV({version:hV(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(xg(n.feedbackBuffers)&&xg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Ose(e,t)),function(n){return!(xg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new $se(e,t)),rn(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function nS(){}const jae={onStart:nS,onUpdate:nS,onInterrupt:nS,onEnd:nS};class lv{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ht(ht({},jae),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const qae={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new lv(i),this.attribute=t,this.attributeInTransition=new $M(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=sV(e.size);return new lI(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new tr(e,r),new tr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;oV(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)aV(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=GM(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:rV(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new lv(i),this.attribute=t,this.attributeInTransition=new $M(e,Vn(ht({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new Aa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new Ds(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=sV(e.size);return new lI(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new tr(e,r),new tr(e,r),new tr(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)aV(ht({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=GM(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:rV(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),oV(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),UE(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class Yae{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=lI.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Ni.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=qae[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ni.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const HV="attributeManager.invalidate";class ele{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new Yae(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;_o("attribute.updateStart",t),t.allocate(i)&&_o("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,_o("attribute.updateEnd",t,i))}}function $V(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function WV(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=iV(r)))return;const o=rle[r.type];if(!o)return void Ni.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Vn(ht({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const iS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:ole}=iS;function cle(n,e){if(!n.transitions)return null;const t={},i=uI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&cI(n[r],e[r],s)&&(t[r]=!0)}return t}function qV({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=cI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=cI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function cI(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function hle(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!yle(i[r],e[r])){t=n(i),e=i;break}return t}}function vle(n,e){if(!e)return n;const t=ht(ht({},n),e);if("defines"in e&&(t.defines=ht(ht({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=ht({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function sS(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],x=e[13],T=e[14],q=e[15],G=t*a-i*o,ge=t*l-r*o,Ne=t*c-s*o,Ge=i*l-r*a,We=i*c-s*a,dt=r*c-s*l,Mt=d*x-f*_,Ot=d*T-p*_,Lt=d*q-g*_,Qt=f*T-p*x,Jt=f*q-g*x,wt=p*q-g*T,Ct=G*wt-ge*Jt+Ne*Qt+Ge*Lt-We*Ot+dt*Mt;return Ct?(n[0]=(a*wt-l*Jt+c*Qt)*(Ct=1/Ct),n[1]=(r*Jt-i*wt-s*Qt)*Ct,n[2]=(x*dt-T*We+q*Ge)*Ct,n[3]=(p*We-f*dt-g*Ge)*Ct,n[4]=(l*Lt-o*wt-c*Ot)*Ct,n[5]=(t*wt-r*Lt+s*Ot)*Ct,n[6]=(T*Ne-_*dt-q*ge)*Ct,n[7]=(d*dt-p*Ne+g*ge)*Ct,n[8]=(o*Jt-a*Lt+c*Mt)*Ct,n[9]=(i*Lt-t*Jt-s*Mt)*Ct,n[10]=(_*We-x*Ne+q*G)*Ct,n[11]=(f*Ne-d*We-g*G)*Ct,n[12]=(a*Ot-o*Qt-l*Mt)*Ct,n[13]=(t*Qt-i*Ot+r*Mt)*Ct,n[14]=(x*ge-_*Ge-T*G)*Ct,n[15]=(d*Ge-f*ge+p*G)*Ct,n):null}function Vc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],x=e[12],T=e[13],q=e[14],G=e[15],ge=t[0],Ne=t[1],Ge=t[2],We=t[3];return n[0]=ge*i+Ne*a+Ge*f+We*x,n[1]=ge*r+Ne*l+Ge*p+We*T,n[2]=ge*s+Ne*c+Ge*g+We*q,n[3]=ge*o+Ne*d+Ge*_+We*G,n[4]=(ge=t[4])*i+(Ne=t[5])*a+(Ge=t[6])*f+(We=t[7])*x,n[5]=ge*r+Ne*l+Ge*p+We*T,n[6]=ge*s+Ne*c+Ge*g+We*q,n[7]=ge*o+Ne*d+Ge*_+We*G,n[8]=(ge=t[8])*i+(Ne=t[9])*a+(Ge=t[10])*f+(We=t[11])*x,n[9]=ge*r+Ne*l+Ge*p+We*T,n[10]=ge*s+Ne*c+Ge*g+We*q,n[11]=ge*o+Ne*d+Ge*_+We*G,n[12]=(ge=t[12])*i+(Ne=t[13])*a+(Ge=t[14])*f+(We=t[15])*x,n[13]=ge*r+Ne*l+Ge*p+We*T,n[14]=ge*s+Ne*c+Ge*g+We*q,n[15]=ge*o+Ne*d+Ge*_+We*G,n}function cv(n,e,t){var o,a,l,c,d,f,p,g,_,x,T,q,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],x=e[9],T=e[10],q=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=x,n[10]=T,n[11]=q,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+x*s+e[13],n[14]=l*i+p*r+T*s+e[14],n[15]=c*i+g*r+q*s+e[15]),n}function uv(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function KV(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function XV(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function QV(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function ZV(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],x=n[13],T=n[14],q=n[15],G=e[0],ge=e[1],Ne=e[2],Ge=e[3],We=e[4],dt=e[5],Mt=e[6],Ot=e[7],Lt=e[8],Qt=e[9],Jt=e[10],wt=e[11],Ct=e[12],Ht=e[13],ft=e[14],Kt=e[15];return Math.abs(t-G)<=hr*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(i-ge)<=hr*Math.max(1,Math.abs(i),Math.abs(ge))&&Math.abs(r-Ne)<=hr*Math.max(1,Math.abs(r),Math.abs(Ne))&&Math.abs(s-Ge)<=hr*Math.max(1,Math.abs(s),Math.abs(Ge))&&Math.abs(o-We)<=hr*Math.max(1,Math.abs(o),Math.abs(We))&&Math.abs(a-dt)<=hr*Math.max(1,Math.abs(a),Math.abs(dt))&&Math.abs(l-Mt)<=hr*Math.max(1,Math.abs(l),Math.abs(Mt))&&Math.abs(c-Ot)<=hr*Math.max(1,Math.abs(c),Math.abs(Ot))&&Math.abs(d-Lt)<=hr*Math.max(1,Math.abs(d),Math.abs(Lt))&&Math.abs(f-Qt)<=hr*Math.max(1,Math.abs(f),Math.abs(Qt))&&Math.abs(p-Jt)<=hr*Math.max(1,Math.abs(p),Math.abs(Jt))&&Math.abs(g-wt)<=hr*Math.max(1,Math.abs(g),Math.abs(wt))&&Math.abs(_-Ct)<=hr*Math.max(1,Math.abs(_),Math.abs(Ct))&&Math.abs(x-Ht)<=hr*Math.max(1,Math.abs(x),Math.abs(Ht))&&Math.abs(T-ft)<=hr*Math.max(1,Math.abs(T),Math.abs(ft))&&Math.abs(q-Kt)<=hr*Math.max(1,Math.abs(q),Math.abs(Kt))}function JV(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function oS(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new ra(4);ra!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const eU=[0,0,0,0],$le=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Wle=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],qle=[0,0,0],Yle=[0,0,0],Kle=rS(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=eU,l=eU,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=tU(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=oS([],l,o),s=i||s,o=Vc([],r,s),o=Vc([],o,$le)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:qle,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Mi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Mi.LNGLAT:case Mi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Mi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function tU(n,e,t=Yle){let r,i=t,s=!0;switch(r=e===Mi.LNGLAT_OFFSETS||e===Mi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case kc.WEB_MERCATOR:(e===Mi.LNGLAT||e===Mi.CARTESIAN)&&(s=!1);break;case kc.WEB_MERCATOR_AUTO_OFFSET:e===Mi.LNGLAT?i=r:e===Mi.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case kc.IDENTITY:i=n.position.map(Math.fround);break;case kc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class Jle extends BM{get ELEMENTS(){return Lu(!1),0}get RANK(){return Lu(!1),0}toString(){let e="[";if(Sr.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new Gn).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return QV(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],x=n[14],T=n[15];return(e*o-t*s)*(f*T-p*x)-(e*a-i*s)*(d*T-p*_)+(e*l-r*s)*(d*x-f*_)+(t*a-i*o)*(c*T-p*g)-(t*l-r*o)*(c*x-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return sS(this,this),this.check()}multiplyLeft(e){return Vc(this,e,this),this.check()}multiplyRight(e){return Vc(this,this,e),this.check()}rotateX(e){return KV(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return XV(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,x,T,q,G,ge,Ne,Ge,We,dt,Mt,Ot,Lt,Qt,Jt,wt,Ct,Ht,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*tc+ec)/(2*ec),512*(ec+Math.log(Math.tan(sU+e*tc*.5)))/(2*ec)]}function Xd([n,e]){const t=n/512*(2*ec)-ec,i=2*(Math.atan(Math.exp(e/512*(2*ec)-ec))-sU);return[t*fI,i*fI]}function lS({latitude:n,longitude:e,highPrecision:t=!1}){Bu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*tc),o=512/360,a=o/s,l=512/pI/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=tc*Math.tan(n*tc)/s,f=512/pI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function aU(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=lS({longitude:t,latitude:i,highPrecision:!0}),d=Bg(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Xd(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function lU({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return cv(o,o,[0,0,-i]),KV(o,o,-e*tc),XV(o,o,t*tc),uv(o,o,[r/=n,r,r]),s&&cv(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function cU({width:n,height:e,fovy:t=cS(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=cS(i));const a=.5*t*tc,l=uU(t),c=r*tc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function cS(n){return 2*Math.atan(.5/n)*fI}function uU(n){return.5/Math.tan(.5*n*tc)}function gI(n,e){const[t,i,r=0]=n;return Bu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),kg(e,[t,i,r,1])}function bf(n,e,t=0){const[i,r,s]=n;if(Bu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return kg(e,[i,r,s,1]);const o=kg(e,[i,r,0,1]),a=kg(e,[i,r,1,1]),l=o[2],c=a[2];return nU([],o,a,l===c?0:((t||0)-l)/(c-l))}function dU({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Bu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new uS({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],x=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Bu(x[0]>0&&x[1]>0);const T=x[0]/_[0],q=x[1]/_[1],Ge=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/T,(g[1]+p[1])/2+(s.bottom-s.top)/2/q]),We=Math.min(r,f.zoom+hI(Math.abs(Math.min(T,q))));return Bu(Number.isFinite(We)),{longitude:Ge[0],latitude:Ge[1],zoom:We}}const hU=Math.PI/180;function fU(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*hU:Math.atan(.5/n.altitude))>(90-n.pitch)*hU-.01?(l=pU(n,0,e),c=pU(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function pU(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=kg(i,[e,0,1,1]),s=kg(i,[e,n.height,1,1]),c=Xd(nU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class uS{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=cS(l=1.5):null===c?c=cS(l):null===l&&(l=uU(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=lS({longitude:r,latitude:i}),x=Bg([r,i]);x[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(x,x,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=cU({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return QV([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=lU({height:t,scale:g,center:x,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=x,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Vc(s,s,i),Vc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];uv(o,o,[e/2,-t/2,1]),cv(o,o,[1,-1,0]),Vc(o,o,s);const a=sS([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof uS&&e.width===this.width&&e.height===this.height&&ZV(e.projectionMatrix,this.projectionMatrix)&&ZV(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=gI(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=bf([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Bg(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=Xd(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Bg(e)}unprojectFlat(e){return Xd(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=bf(t,this.pixelUnprojectionMatrix),s=Fg([],Bg(e),dI([],i));return Xd(Fg([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=dU(Object.assign({width:i,height:r,bounds:e},t));return new uS({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return fU(this,e.z||0)}}const dce=Math.PI/180,hce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],mI=[0,0,0],pce={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let jg=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?kc.WEB_MERCATOR:kc.WEB_MERCATOR_AUTO_OFFSET:kc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Jy(t.projectionMatrix,this.projectionMatrix)&&Jy(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=gI(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=bf([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Bg(t):t}unprojectFlat(t){return this.isGeospatial?Xd(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?lS({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends jg{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:x=1.5}=t;const T=Math.pow(2,s);g=g||1,_=_||1,x=Math.max(.75,x);const{fov:q,aspect:G,focalDistance:ge,near:Ne,far:Ge}=cU({width:g,height:_,pitch:o,altitude:x,nearZMultiplier:l,farZMultiplier:c});let We=lU({height:_,pitch:o,bearing:a,scale:T,altitude:x});p&&(We=(new Gn).translate([512*p,0,0]).multiplyLeft(We)),super(Vn(ht({},t),{width:g,height:_,viewMatrix:We,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:q,aspect:G,focalDistance:ge,near:Ne,far:Ge})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=x,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(Vn(ht({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return aU(t,i)}panByPosition(t,i){const r=bf(i,this.pixelUnprojectionMatrix),o=Fg([],this.projectFlat(t),dI([],r)),a=Fg([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=fU(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=dU(ht({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function _I(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof vU){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function bU(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=oS([],[o,a,l,1],t)),i){case Mi.LNGLAT:return _I([o,a,l],e,s);case Mi.LNGLAT_OFFSETS:return _I([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mi.METER_OFFSETS:return _I(aU(r,[o,a,l]),e,s);case Mi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const _ce={10241:9987,10240:9729,10242:33071,10243:33071},yI={},bce={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||fv(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>vI(n,e)},accessor:{validate(n,e){const t=dS(n);return"function"===t||t===dS(e.value)},equal:(n,e,t)=>"function"==typeof e||vI(n,e)},array:{validate:(n,e)=>e.optional&&!n||fv(n),equal:(n,e,t)=>t.compare?vI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof Aa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new Aa(t,Vn(ht({},e),{parameters:ht(ht(ht({},_ce),i),n.props.textureParameters)}));return yI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof Aa)||yI[n.id]&&(n.delete(),delete yI[n.id])}(n)}}};function vI(n,e){if(n===e)return!0;if(!fv(n)||!fv(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Nce,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Oce]||{},i=e[Ice]||e,r=e[Rce]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(tV(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return ei(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=wI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const T=_,{dataTransform:q}=i.component?i.component.props:{};a=q?q(T,a):a.concat(T),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(T){d=!0,f=T}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const x=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;x&&x(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:CU,ASYNC_RESOLVED:xU,ASYNC_DEFAULTS:Pce}=iS,Fce={};let Lce=0,kce=(()=>{class n{constructor(){this.props=Sce.apply(this,arguments),this.id=this.props.id,this.count=Lce++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[Pce])s in i[xU]?r[s]=i[xU][s]:s in i[CU]&&(r[s]=i[CU][s]);return new this.constructor(ht(ht(ht({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new SU({})}}return n.componentName="Component",n.defaultProps=Fce,n})();class Bce extends SU{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const nc=n=>"function"==typeof n,Qd=n=>null!==n&&"object"==typeof n,TU=n=>Qd(n)&&n.constructor==={}.constructor,jce=n=>n&&"function"==typeof n[Symbol.iterator],Vce=n=>n&&"function"==typeof n[Symbol.asyncIterator],gv=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Vg=n=>"undefined"!=typeof Blob&&n instanceof Blob,DU=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||Qd(n)&&nc(n.tee)&&nc(n.cancel)&&nc(n.getReader))(n)||(n=>Qd(n)&&nc(n.read)&&nc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function wf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function EI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function SI(n){var e,t;let i;return wf(n,"null loader"),wf(EI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Vn(ht({},n=n[0]),{options:ht(ht({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Uc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},CI=Uc.global||Uc.self||Uc.window||{},Wce="object"!=typeof process||"[object process]"!==String(process)||process.browser,MU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);MU&&parseFloat(MU[1]);const AI={};function qce(n){for(const e in AI)n.startsWith(e)&&(n=n.replace(e,AI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const Yce=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Kce=/^([-\w.]+\/[-\w.+]+)/;function Xce(n){const e=Kce.exec(n);return e?e[1]:n}function IU(n){const e=Yce.exec(n);return e?e[1]:""}const Qce=/\?.*/;function gS(n){if(gv(n)){const e=TI(n.url||"");return{url:e,type:Xce(n.headers.get("content-type")||"")||IU(e)}}return Vg(n)?{url:TI(n.name||""),type:n.type||""}:"string"==typeof n?{url:TI(n),type:IU(n)}:{url:"",type:""}}function Zce(n){return gv(n)?n.headers["content-length"]||-1:Vg(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function TI(n){return n.replace(Qce,"")}function OU(n){return DI.apply(this,arguments)}function DI(){return(DI=ei(function*(n){if(gv(n))return n;const e={},t=Zce(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=gS(n);r&&(e["content-type"]=r);const s=yield tue(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function Jce(n){return MI.apply(this,arguments)}function MI(){return(MI=ei(function*(n){if(!n.ok){const e=yield eue(n);throw new Error(e)}})).apply(this,arguments)}function eue(n){return II.apply(this,arguments)}function II(){return(II=ei(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function tue(n){return OI.apply(this,arguments)}function OI(){return(OI=ei(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${nue(n.slice(0,5))}`:null})).apply(this,arguments)}function nue(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const PU={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){$n(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},sue={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function NI(){CI.loaders=CI.loaders||{};const{loaders:n}=CI;return n._state=n._state||{},n._state}const PI=()=>{const n=NI();return n.globalOptions=n.globalOptions||ht({},PU),n.globalOptions};function oue(n,e,t,i){return t=t||[],function(n,e){LU(n,null,PU,sue,e);for(const t of e)LU(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=ht({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new iue),BU(r,PI()),BU(r,e),r}(e,n,i)}function FU(n,e){const t=PI(),i=n||t;return"function"==typeof i.fetch?i.fetch:Qd(i.fetch)?r=>RU(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:RU}function LU(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&Qd(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)NU.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=lue(a,r);NU.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function lue(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function BU(n,e){for(const t in e)t in e&&(n[t]=TU(e[t])&&TU(n[t])?ht(ht({},n[t]),e[t]):e[t])}function zc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function due(n,e="3.0.12"){return zc(n,"no worker provided"),!(!e||!n.version)}const Hc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},hue=Hc.global||Hc.self||Hc.window||{},FI="object"!=typeof process||"[object process]"!==String(process)||process.browser,LI="function"==typeof importScripts,fue="undefined"!=typeof window&&void 0!==window.orientation,jU="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),kI=(jU&&parseFloat(jU[1]),new Map);function VU(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function UU(n,e=!0,t){const i=t||new Set;if(n)if(zU(n))i.add(n);else if(zU(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)UU(n[r],e,i);return void 0===t?Array.from(i):[]}function zU(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const BI=()=>{};class HU{static isSupported(){return"undefined"!=typeof Worker}constructor(e){$n(this,"name",void 0),$n(this,"source",void 0),$n(this,"url",void 0),$n(this,"terminated",!1),$n(this,"worker",void 0),$n(this,"onMessage",void 0),$n(this,"onError",void 0),$n(this,"_loadableURL","");const{name:t,source:i,url:r}=e;zc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=BI,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=BI,this.onError=BI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||UU(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){zc(n.source&&!n.url||!n.source&&n.url);let e=kI.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?VU(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),kI.set(n.url,e)),n.source&&(e=VU(n.source),kI.set(n.source,e))),zc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class _ue{constructor(e,t){$n(this,"name",void 0),$n(this,"workerThread",void 0),$n(this,"isRunning",void 0),$n(this,"result",void 0),$n(this,"_resolve",void 0),$n(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zc(this.isRunning),this.isRunning=!1,this._reject(e)}}class yue{constructor(e){$n(this,"name","unnamed"),$n(this,"source",void 0),$n(this,"url",void 0),$n(this,"maxConcurrency",1),$n(this,"maxMobileConcurrency",1),$n(this,"onDebug",()=>{}),$n(this,"reuseWorkers",!0),$n(this,"props",{}),$n(this,"jobQueue",[]),$n(this,"idleQueue",[]),$n(this,"count",0),$n(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=ht(ht({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return ei(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return ei(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new _ue(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class ju{static isSupported(){return HU.isSupported()}static getWorkerFarm(e={}){return ju._workerFarm=ju._workerFarm||new ju({}),ju._workerFarm.setProps(e),ju._workerFarm}constructor(e){$n(this,"props",void 0),$n(this,"workerPools",new Map),this.props=ht({},vue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ht(ht({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new yue({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function wue(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return zc(r),r}function Eue(n,e){return!!ju.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Sue(n,e,t,i,r){return jI.apply(this,arguments)}function jI(){return(jI=ei(function*(n,e,t,i,r){const s=n.id,o=wue(n,t),l=ju.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Cue.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Cue(n,e,t,i){return VI.apply(this,arguments)}function VI(){return(VI=ei(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}$n(ju,"_workerFarm",void 0);var $U=tt(521);function WU(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return $U.toArrayBuffer?$U.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Due(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function qU(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Mue(n){return zI.apply(this,arguments)}function zI(){return(zI=ei(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=wI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Due(...e)})).apply(this,arguments)}const Rue=262144;function YU(n){this.wrapped=n}function mv(n){return new YU(n)}function _v(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof YU;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function GI(n){return function(){return new _v(n.apply(this,arguments))}}function $I(){return($I=GI(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(YI)}function Vue(n,e,t){return KI.apply(this,arguments)}function KI(){return(KI=ei(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return jue(n,e);if(Vg(n)&&(n=yield OU(n)),gv(n)){const r=n;return yield Jce(r),e.binary?yield r.arrayBuffer():yield r.text()}if(DU(n)&&(n=Bue(n,t)),jce(n)||Vce(n))return Mue(n);throw new Error(YI)})).apply(this,arguments)}function zue(n,e,t=null){if(t)return t;const i=ht({fetch:FU(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function Hue(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const XU=()=>{const n=NI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function QU(n){const e=XU();n=Array.isArray(n)?n:[n];for(const t of n){const i=SI(t);e.find(r=>i===r)||e.unshift(i)}}const $ue=/\.([^.]+)$/;function Wue(n){return ZI.apply(this,arguments)}function ZI(){return(ZI=ei(function*(n,e=[],t,i){if(!JU(n))return null;let r=ZU(n,e,Vn(ht({},t),{nothrow:!0}),i);if(r)return r;if(Vg(n)&&(r=ZU(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(ez(n));return r})).apply(this,arguments)}function ZU(n,e=[],t,i){if(!JU(n))return null;if(e&&!Array.isArray(e))return SI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...XU()),function(n){for(const e of n)SI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=gS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=JI(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&$ue.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||JI(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Zue(e,t))return t}else if(ArrayBuffer.isView(e)){if(tz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&tz(e,0,t))return t;return null}(e,n),a=a||JI(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(ez(n));return s}function JU(n){return!(n instanceof Response&&204===n.status)}function ez(n){const{url:e,type:t}=gS(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?eO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?eO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function JI(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Zue(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function tz(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Gc=new Uint8ClampedArray(0);const cde={data:{type:"data",value:ade,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=Vn(ht({},r),{fetch:Vn(ht({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:_S(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):_S(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mi.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let rO=(()=>{class n extends kce{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=bU(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=gI(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=ht({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Mi.DEFAULT&&(t=i.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=tU(t,i,r),f=bU(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mi.DEFAULT||t===Mi.LNGLAT||t===Mi.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){Jl(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=vle(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!lde({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Gc.length/3);if(this.internalState.usesPickingColorCache=!0,rnz&&Ni.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Gc=Zy.allocate(Gc,i,{size:3,copy:!0,maxCount:Math.max(i,nz)});const s=Math.floor(Gc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&_o("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=qV({newProps:n,oldProps:e,propTypes:uI(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&YV(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&YV(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:hle(n,e),transitionsChanged:cle(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=uI(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new ele(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){Jl(!this.internalState&&!this.state),Jl(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Bce({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ni.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new sle(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){_o("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=cde,n})(),dde=(()=>{class n extends rO{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:T,fetch:q,_subLayerProps:G}=this.props,ge={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:x,extensions:T,fetch:q},Ne=G&&G[t.id],Ge=Ne&&Ne.updateTriggers,We=t.id||"sublayer";if(Ne){const dt=this.constructor._propTypes,Mt=t.type?t.type._propTypes:{};for(const Ot in Ne){const Lt=Mt[Ot]||dt[Ot];Lt&&"accessor"===Lt.type&&(Ne[Ot]=this.getSubLayerAccessor(Ne[Ot]))}}Object.assign(ge,t,Ne),ge.id="".concat(this.props.id,"-").concat(We),ge.updateTriggers=ht(ht({all:this.props.updateTriggers.all},t.updateTriggers),Ge);for(const dt of T){const Mt=dt.getSubLayerProps.call(this,dt);Mt&&Object.assign(ge,Mt,{updateTriggers:Object.assign(ge.updateTriggers,Mt.updateTriggers)})}return ge}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=zM(t,Boolean),this.internalState.subLayers=t),_o("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const hde=/([0-9]+\.?[0-9]*)(%|px)/;function yS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(hde);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function vS(n,e){return n.relative?Math.round(n.position*e):n.position}function yv(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&yv(i,r)))return!1}return!0}class sO{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=jg}=e;Jl(!p||p instanceof jg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Vn(ht({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):yv(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=ht({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:vS(this._x,e),y:vS(this._y,t),width:vS(this._width,e),height:vS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ht(ht({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ht(ht(ht({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=yS(e),this._y=yS(t),this._width=yS(i),this._height=yS(r)}}const vv=()=>{},iz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:vv,onTransitionInterrupt:vv,onTransitionEnd:vv};class fde{constructor(e,t={}){this.ControllerState=e,this.props=ht(ht({},iz),t),this.propsInTransition=null,this.transition=new lv(t.timeline),this.onViewStateChange=t.onViewStateChange||vv,this.onStateChange=t.onStateChange||vv,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=ht(ht({},iz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ht(ht({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(ht(ht({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const rz=["longitude","latitude","zoom","bearing","pitch"],gde=["longitude","latitude","zoom"];class sz extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!Jy(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];Jl(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:rz,extract:rz,required:gde}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=zE(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ht(ht({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,zE(e.around,t.around,i)))}return r}}const Zd={transitionDuration:0},mde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},wS=n=>1-(1-n)*(1-n),Ug_WHEEL=["wheel"],Ug_PAN=["panstart","panmove","panend"],Ug_PINCH=["pinchstart","pinchmove","pinchend"],Ug_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Ug_DOUBLE_TAP=["doubletap"],Ug_KEYBOARD=["keydown"];class oO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new fde(e,Vn(ht({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Vn(ht({},mde),{transitionInterpolator:new sz({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Ug_WHEEL,d&&i),this.toggleEvents(Ug_PAN,d&&(r||s)),this.toggleEvents(Ug_PINCH,d&&(a||l)),this.toggleEvents(Ug_TRIPLE_PAN,d&&l),this.toggleEvents(Ug_DOUBLE_TAP,d&&o),this.toggleEvents(Ug_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=ht(ht({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,Zd,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,Vn(ht({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,Zd,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,Zd,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,Vn(ht({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,Zd,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,Zd,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,Vn(ht({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:wS}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?Vn(ht({},t),{transitionInterpolator:new sz(Vn(ht({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:Zd}}class oz{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const Jd_target=[0,0,0];class ES extends oz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=Jd_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:T,startZoom:q}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:x,startZoomPosition:T,startZoom:q},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(Vn(ht({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ht({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),yf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new ES(ht(ht(ht({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=yf(r,i,t),e.rotationX=yf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class yde extends oO{constructor(e){super(ES,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class vde extends oO{constructor(e){e.dragMode=e.dragMode||"pan",super(ES,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const bde=(new Gn).lookAt({eye:[0,0,1]});function wde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new Gn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Ede extends jg{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(Vn(ht({},e),{longitude:null,position:a,viewMatrix:bde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:wde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Fg([],e,dI([],bf(t,this.pixelUnprojectionMatrix)));return{target:Fg([],this.center,r)}}}let Sde=(()=>{class n extends sO{constructor(t){super(Vn(ht({},t),{type:Ede}))}get controller(){return this._getControllerProps({type:vde})}}return n.displayName="OrthographicView",n})();const SS=Math.PI/180;function Cde({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*SS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new Gn).lookAt({eye:l,up:a});c.rotateX(i*SS),"Z"===t?c.rotateZ(r*SS):c.rotateY(r*SS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class xde extends jg{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(Vn(ht({},e),{longitude:null,viewMatrix:Cde({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=bf([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let Ade=(()=>{class n extends sO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Vn(ht({},t),{orbitAxis:i,type:xde}))}get controller(){return this._getControllerProps({type:yde})}}return n.displayName="OrbitView",n})();const Tde=[255,255,255],Dde=1;let Mde=0;class az{constructor(e={}){const{color:t=Tde}=e,{intensity:i=Dde}=e;this.id=e.id||"ambient-".concat(Mde++),this.color=t,this.intensity=i,this.type="ambient"}}const Ide=[255,255,255],Ode=1,Rde=[0,0,-1];let Nde=0;class lz{constructor(e={}){const{color:t=Ide}=e,{intensity:i=Ode}=e,{direction:r=Rde}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Nde++),this.color=t,this.intensity=i,this.type="directional",this.direction=new mo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class cz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ht({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class aO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ht({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Nu(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Nu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=uz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dNM(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Nu(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||uz(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class kde extends aO{constructor(e,t){super(e,t),this.shadowMap=new Aa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new Dg(e,{format:33189,width:1,height:1}),this.fbo=new Ds(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;Zl(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=Cg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Vn(ht({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const jde=Object.keys(Mi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Mi[n],";")).join(""),Vde=Object.keys(kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(kc[n],";")).join(""),Ude="".concat(jde,"\n").concat(Vde,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),zde={},lO={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:Ude,getUniforms:function(n=zde){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Mi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mi.DEFAULT&&(i=n.isGeospatial?Mi.LNGLAT:Mi.CARTESIAN);const o=Kle({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||Wle,o}(n):{}}},Wde=rS(function({viewport:n,center:e}){return new Gn(n.viewProjectionMatrix).invert().transform(e)}),qde=rS(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=bf([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new mo(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new Gn).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),Yde=[0,0,0,1],Kde=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],cO={name:"shadow",dependencies:[lO],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||Yde,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=Wde({viewport:n.viewport,center:e.project_uCenter}),r=[],s=qde({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},ehe={color:[255,255,255],intensity:1},dz=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],the=[0,0,0,200/255];class uO extends cz{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=the,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=ov.getDefaultProgramManager(e),cO&&this.programManager.addDefaultModule(cO)),this.dummyShadowMap||(this.dummyShadowMap=new Aa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(cO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new Gn).lookAt({eye:new mo(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=ihe++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class rhe{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=_S(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class she{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new rhe(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const ohe=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},lO],ahe=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function lhe(n){const e=ov.getDefaultProgramManager(n);for(const t of ohe)e.addDefaultModule(t);for(const t of ahe)e.addShaderHook(t);return e}const dhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class hhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new she({gl:e,protocol:"deck://"}),this.context=Vn(ht({},dhe),{layerManager:this,gl:e,deck:t,programManager:e&&lhe(e),stats:i||new AM({id:"deck.gl"}),viewport:r||new jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new hz,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){_o("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=zM(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return _o("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Ni.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Ni.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class fhe{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=zM(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!yv(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ni.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(ht({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=Vn(ht(ht(ht({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class ghe extends oz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:x,startRotatePos:T,startBearing:q,startPitch:G,startZoom:ge,normalize:Ne}={}){Jl(Number.isFinite(s)),Jl(Number.isFinite(r)),Jl(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:Ne}),this._state={startPanLngLat:_,startZoomLngLat:x,startRotatePos:T,startBearing:q,startPitch:G,startZoom:ge},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(Vn(ht({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(Vn(ht({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ht({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=ht({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(ht(ht(ht({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=yf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=yf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=rU(t+180,360)-180),(o<-180||o>180)&&(o=rU(o+180,360)-180);const a=hI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Xd([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return yf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=yf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class mhe extends oO{constructor(e){e.dragMode=e.dragMode||"pan",super(ghe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ht(ht({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let _he=(()=>{class n extends sO{constructor(t){super(Vn(ht({},t),{type:vU}))}get controller(){return this._getControllerProps({type:mhe})}}return n.displayName="MapView",n})();const yhe=new uO;class vhe{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!yv(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof uO)||this._internalEffects.push(yhe)}}class bhe extends aO{}const pz={blendFunc:[1,0,32771,0],blendEquation:32774};class gz extends aO{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,Zl(_,Vn(ht({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},pz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Vn(ht({},pz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ht(ht({},e.props.parameters),i)}}class Ehe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new bhe(e),this.pickLayersPass=new gz(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||Ds.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Vn(ht({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,_o("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new Ds(this.gl),new Ds(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const She={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Che({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let T=0;T=0){const G=T+o-t,ge=G*G+x;ge<=d&&(d=ge,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),x=e[g];if(x){const T=x.decodePickingColor(_),q=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:x,pickedObjectIndex:T,pickedX:o+(f/4-q*l),pickedY:a+q}}Ni.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return She}function mz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Ahe(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(x=>x.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=mz(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=ht({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=_z({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function _z({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Dhe{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new gz(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?ht(ht({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Ds(e),Ds.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Ds(e),this.depthFBO.attach({36064:new Aa(e,{format:fi(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Ni.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:mz({viewports:i,x:r,y:s})};this._resizeBuffer();const f=Cg(this.gl),p=SM(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:x,height:T}=this.pickingFBO,q=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:x,deviceHeight:T});let G;const ge=[],Ne={};for(let Ge=0;Ge=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Ni.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:q,width:x.x+x.width-g,height:_-q},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Ge=new Map,We=Number.isFinite(c);for(let dt=0;dt=c);dt++){const Mt=Ne[dt];let Ot={color:Mt.pickedColor,layer:null,index:Mt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};Ot=_z({layer:Mt.pickedLayer,info:Ot,mode:l}),Ge.has(Ot.object)||Ge.set(Ot.object,Ot)}return Array.from(Ge.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return UE(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Mhe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Ihe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Mhe),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function yz(n,e){if(!n)throw new Error(e)}const $c={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},vz=$c.global||$c.self||$c.window,Rhe="object"!=typeof process||"[object process]"!==String(process)||process.browser,bz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:Nhe}=(bz&&parseFloat(bz[1]),vz),dO="undefined"!=typeof Image,hO="undefined"!=typeof ImageBitmap,Phe=Boolean(Nhe),fO=!!Rhe||Phe;function wz(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function Ez(n){switch(wz(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const khe=/^data:image\/svg\+xml/,Bhe=/\.svg((\?|#).*)?$/;function pO(n){return n&&(khe.test(n)||Bhe.test(n))}function jhe(n,e){if(pO(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return Cz(n,e)}function Cz(n,e){if(pO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function xz(n,e,t){return gO.apply(this,arguments)}function gO(){return(gO=ei(function*(n,e,t){const i=jhe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield Vhe(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function Vhe(n,e){return mO.apply(this,arguments)}function mO(){return(mO=ei(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const Uhe={};let Az=!0;function zhe(n,e,t){return _O.apply(this,arguments)}function _O(){return(_O=ei(function*(n,e,t){let i;i=pO(t)?yield xz(n,e,t):Cz(n,t);const r=e&&e.imagebitmap;return yield Hhe(i,r)})).apply(this,arguments)}function Hhe(n){return yO.apply(this,arguments)}function yO(){return(yO=ei(function*(n,e=null){if((Ghe(e)||!Az)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),Az=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function Ghe(n){for(const e in n||Uhe)return!1;return!0}const Wc=!1,bv=!0;function vO(n){const e=wv(n);return function(n){const e=wv(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Wc)?{mimeType:"image/png",width:e.getUint32(16,Wc),height:e.getUint32(20,Wc)}:null}(e)||function(n){const e=wv(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Wc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Wc)?{mimeType:"image/gif",width:e.getUint16(6,bv),height:e.getUint16(8,bv)}:null}(e)||function(n){const e=wv(n);return e.byteLength>=14&&16973===e.getUint16(0,Wc)&&e.getUint32(2,bv)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,bv),height:e.getUint32(22,bv)}:null}(e)}function wv(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function Xhe(n,e){const{mimeType:t}=vO(n)||{},{_parseImageNode:i}=vz;return yz(i),i(n,t,e)}function bO(){return(bO=ei(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(Zhe(r)){case"imagebitmap":a=yield zhe(n,e,s);break;case"image":a=yield xz(n,e,s);break;case"data":a=yield Xhe(n,e);break;default:yz(!1)}return"data"===r&&(a=Ez(a)),a})).apply(this,arguments)}function Zhe(n){switch(n){case"auto":case"data":return function(){if(hO)return"imagebitmap";if(dO)return"image";if(fO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return hO||dO||fO;case"imagebitmap":return hO;case"image":return dO;case"data":return fO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const Tz={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return bO.apply(this,arguments)},tests:[n=>Boolean(vO(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},efe={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},Ev="8.5.8",CS=Er.CO.deck&&Er.CO.deck.VERSION;if(CS&&CS!==Ev)throw new Error("deck.gl - multiple versions detected: ".concat(CS," vs ").concat(Ev));CS||(Ni.log(1,"deck.gl ".concat(Ev))(),Er.CO.deck=Object.assign(Er.CO.deck||{},{VERSION:Ev,version:Ev,log:Ni,_registerLoggers:function(n){WM=n}}),QU([efe,[Tz,{imagebitmap:{premultiplyAlpha:"none"}}]]));const tfe=Er.CO.deck;class xS extends Pu{static isSupported(e,t=[]){const i=fi(e),r=Vj(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:rn(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return xS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const Dz=(0,Er.jU)()&&"undefined"!=typeof document;let dfe=0;class hfe{constructor(e={}){const{onCreateContext:t=(T=>wj(T)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=mf.get("animation-loop-"+dfe++)}=e;let{useDevicePixels:x=!0}=e;"useDevicePixelRatio"in e&&(dn.deprecated("useDevicePixelRatio","useDevicePixels")(),x=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:x}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return rn("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=xS.isSupported(this.gl,["timers"])?new xS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return ei(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return dn.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=Dz?new Promise((e,t)=>{Dz&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?xM(this.props.gl,e):this.onCreateContext(e),!jE(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Nu(n,EM)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(dn.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(dn.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Ds(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var ffe=tt(524),AS=tt.n(ffe);const pfe={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(AS().MouseInput);const yfe=AS().Manager,qc=AS(),vfe=qc?[[qc.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[qc.Rotate,{enable:!1}],[qc.Pinch,{enable:!1}],[qc.Swipe,{enable:!1}],[qc.Pan,{threshold:0,enable:!1}],[qc.Press,{enable:!1}],[qc.Tap,{event:"doubletap",taps:2,enable:!1}],[qc.Tap,{event:"anytap",enable:!1}],[qc.Tap,{enable:!1}]]:null,Oz={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},bfe={doubletap:["tap"]},wfe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},EO={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Efe={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},Rz={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Sfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",zg="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let Nz=!1;try{const n={get passive(){return Nz=!0,!0}};zg.addEventListener("test",n,n),zg.removeEventListener("test",n,n)}catch(n){}const Cfe=-1!==Sfe.indexOf("firefox"),{WHEEL_EVENTS:xfe}=EO,Fz=4.000244140625;class Dfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=xfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!Nz&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;zg.WheelEvent&&(Cfe&&e.deltaMode===zg.WheelEvent.DOM_DELTA_PIXEL&&(t/=zg.devicePixelRatio),e.deltaMode===zg.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%Fz==0&&(t=Math.floor(t/Fz)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:Mfe}=EO,Lz="pointermove",kz="pointerover",Bz="pointerout",jz="pointerleave";class Ife{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Mfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===Lz&&(this.enableMoveEvent=t),e===kz&&(this.enableOverEvent=t),e===Bz&&(this.enableOutEvent=t),e===jz&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:kz,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:Bz,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:jz,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:Lz,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Ofe}=EO,Vz="keydown";class Rfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Ofe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===Vz&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:Vz,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const zz="contextmenu";class Nfe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===zz&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:zz,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Pfe={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},Hz={srcElement:"root",priority:0};class Wfe{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},Hz,i):Hz;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&Oz[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new Dfe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Ife(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Rfe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Nfe(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=bfe[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=Rz[e]||e;let c=a.get(l);c||(c=new Wfe(this),a.set(l,c),c.recognizerName=Efe[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(Rz[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=wfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Sf(){}const Gz={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:Sf,onResize:Sf,onViewStateChange:Sf,onInteractionStateChange:Sf,onBeforeRender:Sf,onAfterRender:Sf,onLoad:Sf,onError:(n,e)=>Ni.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class DS{constructor(e){e=ht(ht({},Gz),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Ni.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Er.qs)()&&Ni.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new AM({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Zy.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Ni.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ni.removed("onLayerClick","onClick")(),e.initialViewState&&!yv(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](ht({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),Jl(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new hfe({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>wj(Vn(ht(ht({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new _he({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,xM(e,{enable:!0,copyState:!0})),this.tooltip=new Ihe(this.canvas),Nu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new hz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new Yfe(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in sj)this.eventManager.on(r,this._onEvent);this.viewManager=new fhe({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new hhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new vhe,this.deckRenderer=new Ehe(e),this.deckPicker=new Dhe(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Nu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ht({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Ni.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=Vn(ht({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=sj[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=mf.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}DS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(cz)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},DS.defaultProps=Gz,DS.VERSION=tfe.VERSION;const $z={name:"project32",dependencies:[lO],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},Wz="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",Qfe={lightSources:{}};function xO({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const AO={name:"lights",vs:Wz,fs:Wz,getUniforms:function qz(n=Qfe){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?xO(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=xO(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=xO(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return qz({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},Jfe={};const tpe={name:"phong-lighting",dependencies:[AO],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=Jfe){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},ipe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},Xz=ht({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=ipe){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),Qz={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class MS{static get DRAW_MODE(){return Qz}constructor(e={}){const{id:t=jc("geometry"),drawMode:i=Qz.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?ht({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,rn(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(rn(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return rn(Number.isFinite(i)),i}}const TO=Math.PI/180,IS=new Float32Array(16),Zz=new Float32Array(12);function Jz(n,e,t){const i=e[0]*TO,r=e[1]*TO,s=e[2]*TO,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function e4(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const t4={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let x;g?(IS.set(a),x=e4(IS)):(x=Zz,Jz(x,r,s),x.set(o,9)),n.value=new Float32Array(x)}else{let x=e*n.size;const{iterable:T,objectInfo:q}=eV(i,e,t);for(const G of T){let ge;q.index++,g?(IS.set(c?a:a(G,q)),ge=e4(IS)):(ge=Zz,Jz(ge,f?r:r(G,q),d?s:s(G,q)),ge.set(p?o:o(G,q),9)),_[x++]=ge[0],_[x++]=ge[1],_[x++]=ge[2],_[x++]=ge[3],_[x++]=ge[4],_[x++]=ge[5],_[x++]=ge[6],_[x++]=ge[7],_[x++]=ge[8],_[x++]=ge[9],_[x++]=ge[10],_[x++]=ge[11]}}}};function n4(n,e){return e===Mi.CARTESIAN||e===Mi.METER_OFFSETS||e===Mi.DEFAULT&&!n.isGeospatial}function i4(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ni.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function ape(n,e){if(n.attributes)return i4(n.attributes,e),n instanceof MS?n:new MS(n);if(n.positions||n.POSITION)return i4(n,e),new MS({attributes:n});throw Error("Invalid mesh")}const lpe={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let cpe=(()=>{class n extends rO{getShaders(){const t=!fi(this.context.gl),i={};return LM(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[$z,tpe,Xz],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:t4}),this.setState({emptyTexture:new Aa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||n4(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new tS(this.context.gl,Vn(ht({},this.getShaders()),{id:this.props.id,geometry:ape(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=lpe,n})();const r4={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[AO]};class Hg{constructor(e={}){const{id:t}=e;this.id=t||jc(this.constructor.name),this.display=!0,this.position=new mo,this.rotation=new mo,this.scale=new mo(1,1,1),this.matrix=new Gn,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return rn(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return rn(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return rn(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){rn(e),t=t||this.matrix;const i=new Gn(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class Sv extends Hg{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;dn.assert(t.every(i=>i instanceof Hg),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new Gn}={}){const i=new Gn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Sv?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function s4(){var n=new ra(4);return ra!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function o4(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function a4(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var c4=JV,Cpe=function(){var n=Gj(),e=$j(1,0,0),t=$j(0,1,0);return function(i,r,s){var o=Wj(r,s);return o<-.999999?(GE(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&GE(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),o4(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(GE(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();s4(),s4(),function(){var n=new ra(9);ra!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const xpe=[0,0,0,1],Tpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dpe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function h4(n){if(!n._animation){const e=Dpe[n.componentType],t=Tpe[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return o4(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Zs(e)}get y(){return this[1]}set y(e){this[1]=Zs(e)}get z(){return this[2]}set z(e){this[2]=Zs(e)}get w(){return this[3]}set w(e){this[3]=Zs(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return Cpe(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Lu(!t),a4(this,this,e),this.check()}multiplyLeft(e,t){return Lu(!t),a4(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return c4(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=xpe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,x,T,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>hr?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-i)*p)/_,T=Math.sin(i*p)/_):(x=1-i,T=i),n[0]=x*r+T*l,n[1]=x*s+T*c,n[2]=x*o+T*d,n[3]=x*a+T*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),HE(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class Fpe{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:dn.warn(`Bad animation path ${s}`)()}rn(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){DO.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:h4(e.accessors[a]),interpolation:l,output:h4(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Fpe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class kpe extends Hg{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof tS?(this.model=e,this._setModelNodeProps(t)):this.model=new tS(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class Bpe{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},LM(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new Aa(this.gl,ht({id:e.name||e.id,parameters:ht(ht({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(dn.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function f4(n,e){return fi(n)?`#version 300 es\n${e}`:e}const zpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Hpe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Gpe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Hpe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Lpe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Sv({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new Sv({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new Gn).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new Sv({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){dn.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new Bpe(n,e);dn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new kpe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[r4],defines:a.defines,parameters:a.parameters,vs:f4(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:f4(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),dn.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new tr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ia({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:zpe[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function p4(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new Gg(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Gg(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Gg){const o=e;t=o.fields,i=y4(y4(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new Gg(s,i)}}function y4(n,e){return new Map([...n||new Map,...e||new Map])}let Or,v4,b4,w4,E4,S4,C4,x4;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(Or||(Or={}));class MO{static isNull(e){return e&&e.typeId===Or.Null}static isInt(e){return e&&e.typeId===Or.Int}static isFloat(e){return e&&e.typeId===Or.Float}static isBinary(e){return e&&e.typeId===Or.Binary}static isUtf8(e){return e&&e.typeId===Or.Utf8}static isBool(e){return e&&e.typeId===Or.Bool}static isDecimal(e){return e&&e.typeId===Or.Decimal}static isDate(e){return e&&e.typeId===Or.Date}static isTime(e){return e&&e.typeId===Or.Time}static isTimestamp(e){return e&&e.typeId===Or.Timestamp}static isInterval(e){return e&&e.typeId===Or.Interval}static isList(e){return e&&e.typeId===Or.List}static isStruct(e){return e&&e.typeId===Or.Struct}static isUnion(e){return e&&e.typeId===Or.Union}static isFixedSizeBinary(e){return e&&e.typeId===Or.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Or.FixedSizeList}static isMap(e){return e&&e.typeId===Or.Map}static isDictionary(e){return e&&e.typeId===Or.Dictionary}get typeId(){return Or.NONE}compareTo(e){return this===e}}Symbol,Symbol,v4=Symbol.toStringTag;class $g extends MO{constructor(e,t){super(),$n(this,"isSigned",void 0),$n(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Or.Int}get[v4](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class ege extends $g{constructor(){super(!0,8)}}class tge extends $g{constructor(){super(!0,16)}}class nge extends $g{constructor(){super(!0,32)}}class ige extends $g{constructor(){super(!1,8)}}class rge extends $g{constructor(){super(!1,16)}}class sge extends $g{constructor(){super(!1,32)}}b4=Symbol.toStringTag;class A4 extends MO{constructor(e){super(),$n(this,"precision",void 0),this.precision=e}get typeId(){return Or.Float}get[b4](){return"Float"}toString(){return`Float${this.precision}`}}class oge extends A4{constructor(){super(32)}}class age extends A4{constructor(){super(64)}}Symbol,Symbol,w4=Symbol.toStringTag,E4=Symbol.toStringTag,S4=Symbol.toStringTag,C4=Symbol.toStringTag,x4=Symbol.toStringTag;class lge extends MO{constructor(e,t){super(),$n(this,"listSize",void 0),$n(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Or.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[x4](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class RS{constructor(e,t,i=!1,r=new Map){$n(this,"name",void 0),$n(this,"type",void 0),$n(this,"nullable",void 0),$n(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new RS(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function T4(n,e,t){const i=t?D4(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new ege;case Uint8Array:return new ige;case Int16Array:return new tge;case Uint16Array:return new rge;case Int32Array:return new nge;case Uint32Array:return new sge;case Float32Array:return new oge;case Float64Array:return new age;default:throw new Error("array type not supported")}}(e.value);return new RS(n,new lge(e.size,new RS("value",r)),!1,i)}function D4(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const M4={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},hge={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class pge{constructor(e){$n(this,"draco",void 0),$n(this,"decoder",void 0),$n(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=D4(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=T4(o,n[o],s[o]);r.push(l)}if(t){const o=T4("indices",t);r.push(o)}return new Gg(r,i)}(l.attributes,a,l.indices);return Vn(ht({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var NS=tt(125);const NO={};function PO(n){return FO.apply(this,arguments)}function FO(){return(FO=ei(function*(n,e=null,t={}){return e&&(n=vge(n,e,t)),NO[n]=NO[n]||bge(n),yield NO[n]})).apply(this,arguments)}function vge(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:FI?t.CDN?(zc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):LI?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function bge(n){return LO.apply(this,arguments)}function LO(){return(LO=ei(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():FI?LI?importScripts(n):wge(yield(yield fetch(n)).text(),n):NS.requireFromFile&&(yield NS.requireFromFile(n))})).apply(this,arguments)}function wge(n,e){if(!FI)return NS.requireFromString&&NS.requireFromString(n,e);if(LI)return eval.call(hue,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Ege="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Sge="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Cge="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Cv;function Age(n){return kO.apply(this,arguments)}function kO(){return(kO=ei(function*(n){const e=n.modules||{};return Cv=e.draco3d?Cv||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Cv||Tge(n),yield Cv})).apply(this,arguments)}function Tge(n){return jO.apply(this,arguments)}function jO(){return(jO=ei(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield PO(Ege,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield PO(Sge,"draco",n),yield PO(Cge,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Dge(e,t)})).apply(this,arguments)}function Dge(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Vn(ht({},t),{onModuleLoaded:r=>i({draco:r})}))})}const UO=Vn(ht({},_4),{parse:function(n,e){return zO.apply(this,arguments)}});function zO(){return(zO=ei(function*(n,e){const{draco:t}=yield Age(e),i=new pge(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Av(n,e){return wf(n>=0),wf(e>0),n+(e-1)&~(e-1)}function Oge(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+Av(i.byteLength,4)}const I4=["SCALAR","VEC2","VEC3","VEC4"],Rge=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Nge=new Map(Rge),Pge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Fge={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function O4(n){return I4[n-1]||I4[0]}function R4(n){const e=Nge.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function N4(n,e){const t=Lge[n.componentType],i=Pge[n.type],s=n.count*i,o=n.count*i*Fge[n.componentType];return Ia(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const kge={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class th{constructor(e){$n(this,"gltf",void 0),$n(this,"sourceBuffers",void 0),$n(this,"byteLength",void 0),this.gltf=e||{json:ht({},kge),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return Ia(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=N4(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return Ia(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ia(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=vO(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Ia(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Av(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:O4(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:R4(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Oge(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Yge(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function Kge(n){return $O.apply(this,arguments)}function $O(){return($O=ei(function*(n){const e=new th(n),{json:t}=e;e.removeExtension(FS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,FS)})).apply(this,arguments)}function Xge(n){const e=new th(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,FS,{}),e.addExtension(FS))}function Qge(n){return WO.apply(this,arguments)}function WO(){return(WO=ei(function*(n){const e=new th(n),{json:t}=e,i=e.getExtension(Wg);i&&(e.json.lights=i.lights,e.removeExtension(Wg));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Wg);s&&(r.light=s.light),e.removeObjectExtension(r,Wg)}})).apply(this,arguments)}function Zge(n){return qO.apply(this,arguments)}function qO(){return(qO=ei(function*(n){const e=new th(n),{json:t}=e;if(t.lights){const i=e.addExtension(Wg);Ia(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Wg,i);delete e.json.lights}})).apply(this,arguments)}function Jge(n){return YO.apply(this,arguments)}function YO(){return(YO=ei(function*(n){const e=new th(n),{json:t}=e,i=e.getExtension(LS);if(i){const r=tme(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,LS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=nme(s.technique,e)),e.removeObjectExtension(s,LS)}e.removeExtension(LS)}})).apply(this,arguments)}function eme(n,e){return KO.apply(this,arguments)}function KO(){return(KO=ei(function*(n,e){})).apply(this,arguments)}function tme(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function nme(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const L4={KHR_draco_mesh_compression:gt,KHR_materials_unlit:J,KHR_lights_punctual:xt,KHR_techniques_webgl:ut};function ime(n){return XO.apply(this,arguments)}function XO(){return(XO=ei(function*(n,e={},t){for(const r in L4){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield L4[r].decode(n,e,t))}})).apply(this,arguments)}const k4={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},sme={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class ome{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new th(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,P4);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(P4)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in k4)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in k4)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=sme[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function ame(n,e={}){return(new ome).normalize(n,e)}const lme={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},gl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},ume={magFilter:gl.TEXTURE_MAG_FILTER,minFilter:gl.TEXTURE_MIN_FILTER,wrapS:gl.TEXTURE_WRAP_S,wrapT:gl.TEXTURE_WRAP_T},dme={[gl.TEXTURE_MAG_FILTER]:gl.LINEAR,[gl.TEXTURE_MIN_FILTER]:gl.NEAREST_MIPMAP_LINEAR,[gl.TEXTURE_WRAP_S]:gl.REPEAT,[gl.TEXTURE_WRAP_]:gl.REPEAT};class pme{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Ia(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=ht({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=ht({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ht({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ht({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=ht({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ht({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ht({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return cme[n]}(e.componentType),e.components=function(n){return lme[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=N4(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):dme,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return ume[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function gme(n,e){return(new pme).postProcess(n,e)}const B4=1735152710,qg=!0;function ZO(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Av(i,4)}function JO(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Av(i,4)}function Tme(n,e){return eR.apply(this,arguments)}function eR(){return(eR=ei(function*(n,e,t=0,i,r){var s,o,a,l;Dme(n,e,t,i),ame(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Mme(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Ime(n,i,r);c.push(f)}const d=ime(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?gme(n,i):n})).apply(this,arguments)}function Dme(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=B4}=t,s=i.getUint32(e,!1);return s===r||s===B4}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?p4(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?p4(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,qg),a=r.getUint32(t+8,qg);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){wf(n.header.byteLength>20);const i=e.getUint32(t+0,qg),r=e.getUint32(t+4,qg);return t+=8,wf(0===r),ZO(n,e,t,i),(t+=i)+JO(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return wf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,qg),s=e.getUint32(t+4,qg);switch(t+=8,s){case 1313821514:ZO(n,e,t,r);break;case 5130562:JO(n,e,t,r);break;case 0:i.strict||ZO(n,e,t,r);break;case 1:i.strict||JO(n,e,t,r)}t+=Av(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),Ia("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Ia(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Mme(n,e,t){return tR.apply(this,arguments)}function tR(){return(tR=ei(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield Pme(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function Pme(n){return oR.apply(this,arguments)}function oR(){return(oR=ei(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const j4=[255,255,255,255],kme={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:j4},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Yg]};let Bme=(()=>{class n extends rO{getShaders(){const t=[$z,Xz];return"pbr"===this.props._lighting&&t.push(r4),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:j4,transition:!0},instanceModelMatrix:t4})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Hg)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Gpe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ht({gltf:l},c),function(n){return sR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ni.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Hg?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ni.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Ni.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Hg&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:ht({isInstanced:!0,transpileToGLSL100:!fi(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:n4(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=kme,n})();const jme=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Vme=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),Ume=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),zme=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Hme={POSITION:{size:3,value:new Float32Array(Vme)},NORMAL:{size:3,value:new Float32Array(Ume)},TEXCOORD_0:{size:2,value:new Float32Array(zme)}};class Gme extends MS{constructor(e={}){const{id:t=jc("cube-geometry")}=e;super(Vn(ht({},e),{id:t,indices:{size:1,value:new Uint16Array(jme)},attributes:ht(ht({},Hme),e.attributes)}))}}class Yc{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new le){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new le){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new le){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new le){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new le){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new le){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new le){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=Wme,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=qme;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(V4),V4.almostEquals(e,t)}clone(){return new le(this.x,this.y,this.z)}}le.ZERO=void 0,le.UNIT_X=void 0,le.UNIT_Y=void 0,le.UNIT_Z=void 0,le.ZERO=new le(0,0,0),le.UNIT_X=new le(1,0,0),le.UNIT_Y=new le(0,1,0),le.UNIT_Z=new le(0,0,1);const Wme=new le,qme=new le,V4=new le;class ar{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new le,this.upperBound=new le,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=z4;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=z4;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const U4=new le,z4=[new le,new le,new le,new le,new le,new le,new le,new le];class is{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new le){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=Kme;e.tangents(i,Xme),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(gr(e.length(),2)*gr(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new is){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new is){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new is){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new le){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new is(this.x,this.y,this.z,this.w)}slerp(e,t,i=new is){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,x,T,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),x=Math.sin((1-t)*p)/_,T=Math.sin(t*p)/_):(x=1-t,T=t),i.x=x*r+T*l,i.y=x*s+T*c,i.z=x*o+T*d,i.w=x*a+T*f,i}integrate(e,t,i,r=new is){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const Kme=new le,Xme=new le,Qme={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let hn=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=Qme,n})();class Pi{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new is,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Pi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Pi.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new le){return i.vsub(e,r),t.conjugate(G4),G4.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new le){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new le){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new le){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const G4=new is;class Cf extends hn{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:hn.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new le;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=x,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,d=new le,f=new le,p=new le,g=new le,_=new le;let x=Number.MAX_VALUE;const T=this;if(T.uniqueAxes)for(let q=0;q!==T.uniqueAxes.length;q++){i.vmult(T.uniqueAxes[q],c);const G=T.testSepAxis(c,e,t,i,r,s);if(!1===G)return!1;G0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){Cf.project(this,e,i,r,aR),Cf.project(t,e,s,o,lR);const l=aR[0],c=aR[1],d=lR[0],f=lR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?fn.STATIC:fn.DYNAMIC,typeof e.type==typeof fn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=fn.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new le,this.quaternion=new is,this.initQuaternion=new is,this.previousQuaternion=new is,this.interpolatedQuaternion=new is,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new le,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new le,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new le,this.invInertia=new le,this.invInertiaWorld=new Yc,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new Yc,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new le(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new le(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new ar,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new le,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=fn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===fn.SLEEPING&&this.dispatchEvent(fn.wakeupEvent)}sleep(){this.sleepState=fn.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=gr(this.sleepSpeedLimit,2);t===fn.AWAKE&&ir?this.wakeUp():t===fn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(fn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===fn.SLEEPING||this.type===fn.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new le){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new le){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new le){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new le,s=new is;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=e_e,o=t_e,a=this.quaternion,l=this.aabb,c=n_e;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=i_e,r=r_e;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==fn.DYNAMIC)return;this.sleepState===fn.SLEEPING&&this.wakeUp();const i=s_e;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==fn.DYNAMIC)return;const i=o_e,r=a_e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===fn.DYNAMIC&&(this.sleepState===fn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==fn.DYNAMIC)return;this.sleepState===fn.SLEEPING&&this.wakeUp();const i=t,r=l_e;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=c_e;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==fn.DYNAMIC)return;const i=u_e,r=d_e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=h_e;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),BS.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new le;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==fn.DYNAMIC&&this.type!==fn.KINEMATIC||this.sleepState===fn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,x=this.angularFactor,T=l.x*x.x,q=l.y*x.y,G=l.z*x.z;s.x+=e*(_[0]*T+_[1]*q+_[2]*G),s.y+=e*(_[3]*T+_[4]*q+_[5]*G),s.z+=e*(_[6]*T+_[7]*q+_[8]*G),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}fn.idCounter=0,fn.COLLIDE_EVENT_NAME="collide",fn.DYNAMIC=1,fn.STATIC=2,fn.KINEMATIC=4,fn.AWAKE=0,fn.SLEEPY=1,fn.SLEEPING=2,fn.wakeupEvent={type:"wakeup"},fn.sleepyEvent={type:"sleepy"},fn.sleepEvent={type:"sleep"};const e_e=new le,t_e=new is,n_e=new ar,i_e=new Yc,r_e=new Yc,s_e=new le,o_e=new le,a_e=new le,l_e=new le,c_e=new le,u_e=new le,d_e=new le,h_e=new le;new le,new le;class jS{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new le,this.rayToWorld=new le,this.hitNormalWorld=new le,this.hitPointWorld=new le,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let $4,W4,q4,Y4,K4,X4,Q4;$4=hn.types.SPHERE,W4=hn.types.PLANE,q4=hn.types.BOX,Y4=hn.types.CYLINDER,K4=hn.types.CONVEXPOLYHEDRON,X4=hn.types.HEIGHTFIELD,Q4=hn.types.TRIMESH;class ds{get[$4](){return this._intersectSphere}get[W4](){return this._intersectPlane}get[q4](){return this._intersectBox}get[Y4](){return this._intersectConvex}get[K4](){return this._intersectConvex}get[X4](){return this._intersectHeightfield}get[Q4](){return this._intersectTrimesh}constructor(e=new le,t=new le){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new le,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=ds.ANY,this.result=new jS,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||ds.ANY,this.result=t.result||new jS,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Z4),hR.length=0,e.broadphase.aabbQuery(e,Z4,hR),this.intersectBodies(hR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=v_e,s=b_e;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new le(0,0,1);t.vmult(c,c);const d=new le;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;T>=0&&T<=1&&(o.lerp(a,T,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=x_e,l=e8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,T=_.distanceTo(this.to),q=c?c.length:d.length,G=this.result;for(let ge=0;!G.shouldStop&&geT||this.reportIntersection(a,sa,s,r,Ne)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=A_e,l=R_e,c=N_e,d=e8,f=T_e,p=D_e,g=M_e,_=O_e,x=I_e,T=e.indices,q=this.from,G=this.to,ge=this.direction;c.position.copy(i),c.quaternion.copy(t),Pi.vectorToLocalFrame(i,t,ge,f),Pi.pointToLocalFrame(i,t,q,p),Pi.pointToLocalFrame(i,t,G,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const Ne=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Ge=0,We=l.length;!this.result.shouldStop&&Ge!==We;Ge++){const dt=l[Ge];e.getNormal(dt,a),e.getVertex(T[3*dt],ic),ic.vsub(p,d);const Mt=f.dot(a),Ot=a.dot(d)/Mt;if(Ot<0)continue;f.scale(Ot,sa),sa.vadd(p,sa),e.getVertex(T[3*dt+1],Xc),e.getVertex(T[3*dt+2],Qc);const Lt=sa.distanceSquared(p);!ds.pointInTriangle(sa,Xc,ic,Qc)&&!ds.pointInTriangle(sa,ic,Xc,Qc)||Lt>Ne||(Pi.vectorToWorldFrame(t,a,x),Pi.pointToWorldFrame(i,t,sa,_),this.reportIntersection(x,_,s,r,dt))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case ds.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case ds.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var Mf=tt(517);function Zg(n,e,t){e||(e=new Gn(Gn.IDENTITY));const i=new Gn(Gn.IDENTITY);if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new Gn(Gn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new Gn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===Zg(s,r,t))return!1;return!0}function $8(){QU([_4,Yg])}function W8(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||Zg(r,new Gn(Gn.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function mR(n,e){return or(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield mS(i,Yg,{DracoLoader:UO,gltf:{decompressMeshes:!0,postProcess:!0}});return W8(n.scenegraphNode,r)})}function Pbe(n,e){return or(this,void 0,void 0,function*(){return W8(n,yield e)})}function _R(n,e,t){if(e&&0!==e.length)return new cpe(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mi.CARTESIAN,data:e,mesh:new Gme,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let Lbe=(()=>{class n extends dde{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),$8()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){or(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new Gn(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new ar({lowerBound:new le(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new le(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield _S(o.scenegraph,Yg,{DracoLoader:UO,decompress:!0,postProcess:!0});for(const l of a.scenes)Zg(l,new Gn(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new ar({lowerBound:new le(...p.map((_,x)=>Math.min(_,g[x]))),upperBound:new le(...g.map((_,x)=>Math.max(_,p[x])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=mR({scenegraph:l.scenegraph},n.gltfCache));return[_R("cubes",i,{wireframe:!1,pickable:!1}),_R("pickableCubes",r,{wireframe:!1,pickable:!0}),_R("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new Bme({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Mi.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?Pbe(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function q8(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),q8(t,e);return e}let Bbe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new Lbe({}),this.nodeClickSubject=new ee,this.nodeHoverStartSubject=new ee,this.nodeHoverStopSubject=new ee,this.sceneRotationSubject=new Ir([0,0]),this.nodeDragStartSubject=new ee,this.nodeDragSubject=new ee,this.nodeDragEndSubject=new ee,this.nodeClick$=this.nodeClickSubject.pipe(ps()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ps()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ps()),this.sceneRotation$=this.sceneRotationSubject.pipe(ps()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ps()),this.nodeDrag$=this.nodeDragSubject.pipe(ps()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ps());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Sde({flipY:!1,near:-1e3}):new Ade({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new uO({ambientLight:new az({color:[255,255,255],intensity:10})})]),this.deck=new DS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return or(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new Gn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return or(this,void 0,void 0,function*(){$8();const i=yield mR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)Zg(o,e=new Gn(e||Gn.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new Gn(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new Gn(e||Gn.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new ar({lowerBound:new le(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new le(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of q8(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new Gn(Gn.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new Gn(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return Ca([Mf.ZP],n.prototype,"_onHover",null),Ca([Mf.ZP],n.prototype,"_onClick",null),Ca([Mf.ZP],n.prototype,"_onViewStateChange",null),Ca([Mf.ZP],n.prototype,"_onDragStart",null),Ca([Mf.ZP],n.prototype,"_onDrag",null),Ca([Mf.ZP],n.prototype,"_onDragEnd",null),n})();function jbe(n,e){return n===e}function Vbe(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let yR=(()=>{class n{constructor(){this.bootstrap$=new pg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const vR=new zt("INITIAL_STATE_TOKEN");let Hbe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const K8=new zt("Internals.StateContextFactory"),X8=new zt("Internals.StateFactory");function Pv(...n){if(1===n.length){const e=n[0];if(L(e))return YS(e,null);if(re(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return YS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return YS(n=1===n.length&&L(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return YS(n,null)}function YS(n,e){return new F(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function ml(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new pg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}function Q8(n,e){return e?t=>t.pipe(Q8((i,r)=>Pe(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new $be(n))}class $be{constructor(e){this.project=e}call(e,t){return t.subscribe(new Wbe(e,this.project))}}class Wbe extends pe{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new Et(this),i=this.destination;i.add(t);const r=O(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function rs(n){return e=>e.lift(new qbe(n))}class qbe{constructor(e){this.notifier=e}call(e,t){const i=new Ybe(e),r=O(this.notifier,new Et(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class Ybe extends pe{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Wu(n,e){return t=>t.lift(new Kbe(n,e))}class Kbe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new Xbe(e,this.compare,this.keySelector))}}class Xbe extends y{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}const Oa={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let Z8=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(n){return"server"===n}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return yn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return yn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof yn||console.warn(Oa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(Oc))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const J8=new zt("ROOT_STATE_TOKEN"),eH=new zt("FEATURE_STATE_TOKEN"),tH=new zt("NGXS_PLUGINS"),nH=new zt("NG_TEST_MODE"),iH=new zt("NG_DEV_MODE"),qu="NGXS_META",rH="NGXS_OPTIONS_META";let If=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=Z8}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class Qbe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const sH=new zt("NGXS_EXECUTION_STRATEGY");function Of(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const oH=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},KS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),wR=n=>n&&"object"==typeof n&&!Array.isArray(n),ER=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(wR(n)&&wR(t))for(const i in t)wR(t[i])?(n[i]||Object.assign(n,{[i]:{}}),ER(n[i],t[i])):Object.assign(n,{[i]:t[i]});return ER(n,...e)};function Fv(n){return n[qu]}function lH(n,e){const t=KS(e.currentAppState,n.path),i=KS(e.newAppState,n.path);return new Qbe(t,i,!n.isInitialised)}function s0e(...n){return function(n,e,t=l0e){const i=function(n){return n.reduce((e,t)=>(e[Of(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Ui(t=>{const i=Of(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function l0e(){return me(n=>n.action)}function XS(n){return e=>new F(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let QS=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(sH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class d0e extends ee{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let ZS=(()=>{class n extends d0e{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),h0e=(()=>{class n extends F{constructor(t,i){super(r=>{const s=t.pipe(XS(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(Ie(ZS),Ie(QS))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const cH=n=>(...e)=>n.shift()(...e,(...i)=>cH(n)(...i));let JS=(()=>{class n extends Ir{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),AR=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(tH,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),TR=(()=>{class n extends ee{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),uH=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Yo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(XS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?nn(this._stateStream.getValue()):Pv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!Of(t))return fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return cH([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(ml())}getActionResultStream(t){return this._actionResults.pipe(Ui(i=>i.action===t&&"DISPATCHED"!==i.status),Xi(1),ml())}createDispatchObservable(t){return t.pipe(Q8(i=>{switch(i.status){case"SUCCESSFUL":return nn(this._stateStream.getValue());case"ERRORED":return fg(i.error);default:return Nc}})).pipe(ml())}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(ZS),Ie(TR),Ie(AR),Ie(JS),Ie(QS))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const dH=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&dH(n[i])}),n};let hH=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(iH),Ie(nH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),fH=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Oa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Oa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(hH),Ie(If))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),em=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=dH(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(Ie(JS),Ie(uH),Ie(If),Ie(fH))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),eC=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return KS(l,t.path)}function s(l,c){const d=oH(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=lH(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Oa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Oa.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(em))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class tC{static stateNameErrorMessage(e){return Oa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Oa.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Oa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=Fv(e);if(!t)throw new Error(Oa.STATE_DECORATOR());return t}}tC.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let tm=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=Y8(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(tC.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[qu].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[qu];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[qu].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[qu];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>oH(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ui(t=>"DISPATCHED"===t.status),k(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),_E({action:t,status:"CANCELED"}),Xl(i=>nn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=Of(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=Pe(d)),d instanceof F?(d=d.pipe(_E({})),l.options.cancelUncompleted&&(d=d.pipe(rs(t.pipe(s0e(i)))))):d=nn({}).pipe(ml()),s.push(d)}catch(d){s.push(fg(d))}}}return s.length||s.push(nn({})),Pv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=tC.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==KS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(If),Ie(n,12),Ie(ZS),Ie(TR),Ie(eC),Ie(vR,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),DR=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ui(()=>!!i),jr(()=>this.invokeInit(i.states)),k(()=>this.bootstrapper.appBootstrapped$),Ui(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=lH(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(em),Ie(eC),Ie(yR))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();let ih=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(me(i),Xl(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?nn(void 0):fg(r)}),Wu(),XS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Xi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(XS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=function(n){return n.NGXS_SELECTOR_META}(n)||Fv(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(JS),Ie(em),Ie(If),Ie(QS),Ie(tm),Ie(vR,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),Lv=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(If))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class v0e{static get type(){return"@@INIT"}}class b0e{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const iC=new pg(1);let E0e=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Sa();iC.next(t)}catch(n){iC.next(!1)}finally{iC.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new v0e,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(tm),Ie(em),Ie(ih),Ie(Lv),Ie(J8,8),Ie(DR))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})(),S0e=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new b0e(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih),Ie(em),Ie(tm),Ie(eH,8),Ie(DR))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();class oa{static forRoot(e=[],t={}){return{ngModule:E0e,providers:[tm,eC,h0e,ZS,yR,fH,hH,DR,uH,TR,em,QS,ih,JS,Lv,AR,...e,...oa.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:S0e,providers:[tm,AR,...e,{provide:eH,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:nH,useValue:zbe},{provide:iH,useValue:Sa},{provide:sH,useClass:t.executionStrategy||Z8},{provide:J8,useValue:e},{provide:oa.ROOT_OPTIONS,useValue:t},{provide:If,useFactory:oa.ngxsConfigFactory,deps:[oa.ROOT_OPTIONS]},{provide:Rw,useFactory:oa.appBootstrapListenerFactory,multi:!0,deps:[yR]},{provide:vR,useFactory:oa.getInitialState},{provide:K8,useExisting:eC},{provide:X8,useExisting:tm}]}static ngxsConfigFactory(e){return ER(new If,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return Hbe.pop()}}function x0e(n){return i=>{!function(n){iC.subscribe(e=>{e&&(n.\u0275prov||console.warn(Oa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(qu)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,qu,{value:e})}return Fv(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[rH]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;tC.checkCorrectStateName(d),s.hasOwnProperty(qu)&&(r.actions=Object.assign({},r.actions,(s[qu]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[rH]=a}}oa.\u0275fac=function(e){return new(e||oa)},oa.\u0275mod=ln({type:oa}),oa.\u0275inj=bt({}),oa.ROOT_OPTIONS=new zt("ROOT_OPTIONS");const Ra=new zt("NgValueAccessor"),gC=new Yl(cE);class Nwe{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Pwe(e,this.dueTime,this.scheduler))}}class Pwe extends y{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Fwe,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function Fwe(n){n.debouncedNext()}function zi(n){return null!=n&&"false"!=`${n}`}function Na(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function Ku(n){return n instanceof wn?n.nativeElement:n}let JR;try{JR="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){JR=!1}let $v,eN,Hi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?lf(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!JR)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(Ie(Oc))},n.\u0275prov=$e({factory:function(){return new n(Ie(Oc))},token:n,providedIn:"root"}),n})(),Gv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();function rm(n){return function(){if(null==$v&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>$v=!0}))}finally{$v=$v||!1}return $v}()?n:!!n.capture}function Pf(n){return n.composedPath?n.composedPath()[0]:n.target}let tN=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({factory:function(){return new n},token:n,providedIn:"root"}),n})(),x6=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Ku(t);return new F(r=>{const o=this._observeElement(i).subscribe(r);return()=>{o.unsubscribe(),this._unobserveElement(i)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const i=new ee,r=this._mutationObserverFactory.create(s=>i.next(s));r&&r.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:r,stream:i,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:i,stream:r}=this._observedElements.get(t);i&&i.disconnect(),r.complete(),this._observedElements.delete(t)}}}return n.\u0275fac=function(t){return new(t||n)(Ie(tN))},n.\u0275prov=$e({factory:function(){return new n(Ie(tN))},token:n,providedIn:"root"}),n})(),A6=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new mn,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=zi(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Na(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe(function(n,e=gC){return t=>t.lift(new Nwe(n,e))}(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(De(x6),De(wn),De(yn))},n.\u0275dir=kt({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),nN=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[tN]}),n})();function k6(n){return 0===n.offsetX&&0===n.offsetY}function B6(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const j6=new zt("cdk-input-modality-detector-options"),aEe={ignoreKeys:[18,17,224,91,16]},sm=rm({passive:!0,capture:!0});let U6=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Ir(null),this._lastTouchMs=0,this._onKeydown=o=>{var a,l;(null===(l=null===(a=this._options)||void 0===a?void 0:a.ignoreKeys)||void 0===l?void 0:l.some(c=>c===o.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Pf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(k6(o)?"keyboard":"mouse"),this._mostRecentTarget=Pf(o))},this._onTouchstart=o=>{B6(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Pf(o))},this._options=Object.assign(Object.assign({},aEe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new Mne(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(Wu()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,sm),r.addEventListener("mousedown",this._onMousedown,sm),r.addEventListener("touchstart",this._onTouchstart,sm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,sm),document.removeEventListener("mousedown",this._onMousedown,sm),document.removeEventListener("touchstart",this._onTouchstart,sm))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hi),Ie(yn),Ie(un),Ie(j6,8))},n.\u0275prov=$e({factory:function(){return new n(Ie(Hi),Ie(yn),Ie(un),Ie(j6,8))},token:n,providedIn:"root"}),n})();const G6=new zt("cdk-focus-monitor-default-options"),wC=rm({passive:!0,capture:!0});let Xu=(()=>{class n{constructor(t,i,r,s,o){this._ngZone=t,this._platform=i,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new ee,this._rootNodeFocusAndBlurListener=a=>{const l=Pf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let d=l;d;d=d.parentElement)c.call(this,a,d)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=Ku(t);if(!this._platform.isBrowser||1!==r.nodeType)return nn(null);const s=function(n){if(function(){if(null==eN){const n="undefined"!=typeof document?document.head:null;eN=!(!n||!n.createShadowRoot&&!n.attachShadow)}return eN}()){const e=n.getRootNode?n.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(r)||this._getDocument(),o=this._elementInfo.get(r);if(o)return i&&(o.checkChildren=!0),o.subject;const a={checkChildren:i,subject:new ee,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Ku(t),r=this._elementInfo.get(i);r&&(r.subject.complete(),this._setClasses(i),this._elementInfo.delete(i),this._removeGlobalListeners(r))}focusVia(t,i,r){const s=Ku(t);s===this._getDocument().activeElement?this._getClosestElementsInfo(s).forEach(([a,l])=>this._originChanged(a,i,l)):(this._setOrigin(i),"function"==typeof s.focus&&s.focus(r))}ngOnDestroy(){this._elementInfo.forEach((t,i)=>this.stopMonitoring(i))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,i,r){r?t.classList.add(i):t.classList.remove(i)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,i){this._toggleClass(t,"cdk-focused",!!i),this._toggleClass(t,"cdk-touch-focused","touch"===i),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===i),this._toggleClass(t,"cdk-mouse-focused","mouse"===i),this._toggleClass(t,"cdk-program-focused","program"===i)}_setOrigin(t,i=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&i,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,i){const r=this._elementInfo.get(i),s=Pf(t);!r||!r.checkChildren&&i!==s||this._originChanged(i,this._getFocusOrigin(s),r)}_onBlur(t,i){const r=this._elementInfo.get(i);!r||r.checkChildren&&t.relatedTarget instanceof Node&&i.contains(t.relatedTarget)||(this._setClasses(i),this._emitOrigin(r.subject,null))}_emitOrigin(t,i){this._ngZone.run(()=>t.next(i))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const i=t.rootNode,r=this._rootNodeFocusListenerCount.get(i)||0;r||this._ngZone.runOutsideAngular(()=>{i.addEventListener("focus",this._rootNodeFocusAndBlurListener,wC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,wC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(rs(this._stopInputModalityDetector)).subscribe(s=>{this._setOrigin(s,!0)}))}_removeGlobalListeners(t){const i=t.rootNode;if(this._rootNodeFocusListenerCount.has(i)){const r=this._rootNodeFocusListenerCount.get(i);r>1?this._rootNodeFocusListenerCount.set(i,r-1):(i.removeEventListener("focus",this._rootNodeFocusAndBlurListener,wC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,wC),this._rootNodeFocusListenerCount.delete(i))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,i,r){this._setClasses(t,i),this._emitOrigin(r.subject,i),this._lastFocusOrigin=i}_getClosestElementsInfo(t){const i=[];return this._elementInfo.forEach((r,s)=>{(s===t||r.checkChildren&&s.contains(t))&&i.push([s,r])}),i}}return n.\u0275fac=function(t){return new(t||n)(Ie(yn),Ie(Hi),Ie(U6),Ie(un,8),Ie(G6,8))},n.\u0275prov=$e({factory:function(){return new n(Ie(yn),Ie(Hi),Ie(U6),Ie(un,8),Ie(G6,8))},token:n,providedIn:"root"}),n})();const $6="cdk-high-contrast-black-on-white",W6="cdk-high-contrast-white-on-black",rN="cdk-high-contrast-active";let q6=(()=>{class n{constructor(t,i){this._platform=t,this._document=i}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const i=this._document.defaultView||window,r=i&&i.getComputedStyle?i.getComputedStyle(t):null,s=(r&&r.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),s){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(rN),t.remove($6),t.remove(W6),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(rN),t.add($6)):2===i&&(t.add(rN),t.add(W6))}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hi),Ie(un))},n.\u0275prov=$e({factory:function(){return new n(Ie(Hi),Ie(un))},token:n,providedIn:"root"}),n})(),qv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const K6=new Cu("12.2.5");function Z6(n){Promise.resolve(null).then(n)}class am{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Z6(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function e5(){return"undefined"!=typeof window&&void 0!==window.document}function oN(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let uN=(n,e)=>!1,dN=(n,e)=>!1,i5=(n,e,t)=>[];const r5=oN();(r5||"undefined"!=typeof Element)&&(uN=e5()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),dN=(()=>{if(r5||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):dN}})(),i5=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return hN(t)}matchesElement(t,i){return fN(t,i)}containsElement(t,i){return pN(t,i)}query(t,i,r){return gN(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new am(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class EC{}EC.NOOP=new a5;function d5(n,e,t){return t?e+":"+t+";":""}function h5(n){let e="";for(let t=0;t{const r=bN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),oN()&&h5(n))}function kf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=bN(t);n.style[i]=""}),oN()&&h5(n))}const bEe=/-+([a-z0-9])/g;function bN(n){return n.replace(bEe,(...e)=>e[1].toUpperCase())}function wEe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class um{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=um.initialStylesByElement.get(e);r||um.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&eu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(eu(this._element,this._initialStyles),this._endStyles&&(eu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(um.initialStylesByElement.delete(this._element),this._startStyles&&(kf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(kf(this._element,this._endStyles),this._endStyles=null),eu(this._element,this._initialStyles),this._state=3)}}um.initialStylesByElement=new WeakMap;const sc=new zt("AnimationModuleType"),X5=new Cu("12.2.5"),zSe=new zt("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let jf,pr=(()=>{class n{constructor(t,i,r){this._hasDoneGlobalChecks=!1,this._document=r,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=i,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!Sa()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const i=getComputedStyle(t);i&&"none"!==i.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&X5.full!==K6.full&&console.warn("The Angular Material version ("+X5.full+") does not match the Angular CDK version ("+K6.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(Ie(q6),Ie(zSe,8),Ie(un))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[qv],qv]}),n})();function UC(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=zi(e)}}}function Xv(n,e){return class extends n{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const i=t||this.defaultColor;i!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),i&&this._elementRef.nativeElement.classList.add(`mat-${i}`),this._color=i)}}}function FN(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=zi(e)}}}function LN(n,e=0){return class extends n{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?Na(t):this.defaultTabIndex}}}try{jf="undefined"!=typeof Intl}catch(n){jf=!1}class tCe{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const J5={enterDuration:225,exitDuration:150},kN=rm({passive:!0}),eG=["mousedown","touchstart"],tG=["mouseup","mouseleave","touchend","touchcancel"];class iCe{constructor(e,t,i,r){this._target=e,this._ngZone=t,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=Ku(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},J5),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);const o=i.radius||function(n,e,t){const i=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),r=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),a=e-r.left,l=t-r.top,c=s.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=a-o+"px",d.style.top=l-o+"px",d.style.height=2*o+"px",d.style.width=2*o+"px",null!=i.color&&(d.style.backgroundColor=i.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(d),d.style.transform="scale(1)";const f=new tCe(this,d,i);return f.state=0,this._activeRipples.add(f),i.persistent||(this._mostRecentTransientRipple=f),this._runTimeoutOutsideZone(()=>{const p=f===this._mostRecentTransientRipple;f.state=1,!i.persistent&&(!p||!this._isPointerDown)&&f.fadeOut()},c),f}fadeOutRipple(e){const t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!t)return;const i=e.element,r=Object.assign(Object.assign({},J5),e.config.animation);i.style.transitionDuration=`${r.exitDuration}ms`,i.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(()=>{e.state=3,i.parentNode.removeChild(i)},r.exitDuration)}fadeOutAll(){this._activeRipples.forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Ku(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(eG))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(tG),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=k6(e),i=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(1===e.state||e.config.terminateOnPointerUp&&0===e.state)&&e.fadeOut()}))}_runTimeoutOutsideZone(e,t=0){this._ngZone.runOutsideAngular(()=>setTimeout(e,t))}_registerEvents(e){this._ngZone.runOutsideAngular(()=>{e.forEach(t=>{this._triggerElement.addEventListener(t,this,kN)})})}_removeTriggerEvents(){this._triggerElement&&(eG.forEach(e=>{this._triggerElement.removeEventListener(e,this,kN)}),this._pointerUpEventsRegistered&&tG.forEach(e=>{this._triggerElement.removeEventListener(e,this,kN)}))}}const oCe=new zt("mat-ripple-global-options");let dm=(()=>{class n{constructor(t,i,r,s,o){this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=s||{},this._rippleRenderer=new iCe(this,i,t,r)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,i=0,r){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,i,Object.assign(Object.assign({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return n.\u0275fac=function(t){return new(t||n)(De(wn),De(yn),De(Hi),De(oCe,8),De(sc,8))},n.\u0275dir=kt({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&Ei("mat-ripple-unbounded",i.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),n})(),HC=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[pr,Gv],pr]}),n})();new class extends Yl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let yCe=1;const vCe=Promise.resolve(),GC={};function oG(n){return n in GC&&(delete GC[n],!0)}const aG={setImmediate(n){const e=yCe++;return GC[e]=!0,vCe.then(()=>oG(e)&&n()),e},clearImmediate(n){oG(n)}};new class extends Yl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=aG.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(aG.clearImmediate(t),e.scheduled=void 0)}});function Zv(n){return!!n&&(n instanceof F||"function"==typeof n.lift&&"function"==typeof n.subscribe)}function VG(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>me(function(n,e){return i=>{let r=i;for(let s=0;s{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new QAe(n,t))}}"undefined"!=typeof window&&window,tt(266),tt(478),new zt("SECURITY_CONTEXT");class QAe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new ZAe(e,this.observables,this.project))}}class ZAe extends k3{constructor(e,t,i){super(e),this.observables=t,this.project=i,this.toRespond=[];const r=t.length;this.values=new Array(r);for(let s=0;s0){const s=r.indexOf(i);-1!==s&&r.splice(s,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}function rb(n){return!0===n}function La(n){return null==n}function ka(n){return!La(n)}function sP(n){return Boolean(n)}function I$(n){return La(n)?n:JSON.parse(JSON.stringify(n))}const ax=n=>{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&ax(n[o])}),n};function O$(n){return ka(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const P$="NGXS_DATA_META",aP="NGXS_META",F$="NGXS_ARGUMENT_REGISTRY_META";let L$=(()=>{class n{constructor(t){this.sequence$=new Ir(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(Ie(ih,8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();function sb(n){return n[P$]}let Ba=(()=>{class n{constructor(t,i,r){n.store=t.get(ih),n.ngZone=t.get(yn),n.factory=i,n.context=r,n.computed=t.get(L$)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Ie(zn),Ie(X8),Ie(K8))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();class os{constructor(){os.statesCachedMeta.clear()}static createStateContext(e){return Ba.context.createStateContext(e)}static ensureMappedState(e){if(La(Ba.factory)||La(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(ka(e.name)?os.statesCachedMeta.get(e.name):null)||os.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=sb(os.getStateClassByInstance(e)))&&void 0!==t?t:null;if(La(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=os.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=os.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=ka(e.name)?null===(t=Ba.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return ka(i)&&ka(e.name)&&os.statesCachedMeta.set(e.name,i),i}}os.statesCachedMeta=new Map,os.\u0275fac=function(e){return new(e||os)},os.\u0275prov=$e({token:os,factory:os.\u0275fac}),new pg(1);class NTe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${ka(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function k$(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function B$(n){var e;const t=k$(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=I$(void 0===t.defaults?{}:t.defaults);if(i.length){if(O$(s))return function(n,e){return e.reduce((t,i)=>{const r=k$(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=B$(i),t},null!=n?n:{})}(s,i);throw new NTe(s)}return s}function V$(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function U$(){var n,e;return null!==(e=null===(n=null==Ba?void 0:Ba.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function kTe(n){let e=!1;return Zv(n)&&(e=!0),e}function lP(n){return n[F$]}class BTe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class jTe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(sP(this.argumentMap.has(e))||sP(this.payloadMap.has(e)))throw new BTe(e,t)}}function $Te(n){return{enumerable:!0,configurable:!0,get(){const e=sb(n),t=os.ensureMappedState(e.stateMeta);return os.createStateContext(t)}}}function z$(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(O$(i))for(;null!==i;){if(rb(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return La(V$(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),V$(n)}(this),o=null==s?void 0:s.get(i);if(rb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(La(o)||o.sequenceId!==U$()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:U$(),isObservable:kTe(l)}),l}return o.value},t}}const QTe={cancelUncompleted:!0,insideZone:!1};function cP(n=QTe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=os.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=lP(r);if(La(f)){const G=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),ge=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var G;return rb(n.insideZone)?null===(G=Ba.ngZone)||void 0===G||G.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Zv(l)?nn(null).pipe(me(()=>l)):l};const T=os.createAction(f,o,g),q=Ba.store.dispatch(T);return Zv(l)?function(n,e){return Pv([n,e]).pipe(me(t=>t.pop()))}(q,l):l},i}}function H$(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return La(lP(t))&&Object.defineProperties(t,{[F$]:{enumerable:!0,configurable:!0,value:new jTe}}),lP(t)})(e,t).createPayloadType(r,t,i)}}function JTe(){return n=>{const e=function(n){if(function(n){return!sP(n)}(n.hasOwnProperty(aP))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,aP,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[aP]}(n)}(n);if(La(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=sb(n))&&void 0!==e?e:null;return(La(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,P$,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),sb(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>I$(t)},context:$Te(n)})}(n,e,B$(n)),function(n){var e,t;const i=sb(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(ka(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(ka(this[s]))return this[s];if(La(Ba.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ba.store.select(n).pipe(me(o=>Sa()?ax(o):o),ml({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let tDe=(()=>{class n{constructor(){this.browserStorageEvents$=new ee,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})(),nDe=(()=>{class n extends tDe{get snapshot(){return function(n){return Sa()?ax(n):n}(this.getState())}get ctx(){return function(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>Sa()?ax(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),Ca([z$(),Kl("design:type",Object),Kl("design:paramtypes",[])],n.prototype,"snapshot",null),Ca([cP(),P3(0,H$("patchValue")),Kl("design:type",Function),Kl("design:paramtypes",[Object]),Kl("design:returntype",void 0)],n.prototype,"patchState",null),Ca([cP(),P3(0,H$("stateValue")),Kl("design:type",Function),Kl("design:paramtypes",[Object]),Kl("design:returntype",void 0)],n.prototype,"setState",null),Ca([cP(),Kl("design:type",Function),Kl("design:paramtypes",[]),Kl("design:returntype",void 0)],n.prototype,"reset",null),n})();const pDe=["bodyCanvas"];let gDe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new mn,this.nodeDrag=new mn,this.nodeClick=new mn,this.nodeHoverStart=new mn,this.nodeHoverStop=new mn,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return or(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new Bbe({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Mr(pDe,5,wn),2&t){let r;di(r=hi())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Tc(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&wi(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),mDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr]]}),n})();new zt("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const Z$=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}];Z$.filter(n=>!0!==n.disabled);let cx=(()=>{let n=class extends nDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ui(n=>null!=n),ml(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(VG(...t),Wu(),ml(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(VG(...t),Wu(),ml(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=Ki(n)))(i||n)}}(),n.\u0275prov=$e({token:n,factory:n.\u0275fac}),Ca([z$()],n.prototype,"config$",null),n=Ca([JTe(),x0e({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();function tu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let dP;function ac(){return dP||(dP=function(n,e){const t=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const i=()=>indexedDB.databases().finally(t);e=setInterval(i,100),i()}).finally(()=>clearInterval(e))}().then(()=>{const i=indexedDB.open("keyval-store");return i.onupgradeneeded=()=>i.result.createObjectStore(e),tu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),dP}function J$(n,e=ac()){return e("readonly",t=>tu(t.get(n)))}var Gi=tt(440),KDe=tt(698),XDe=tt(445),QDe=tt.n(XDe),pi=tt(815),dh=tt(609);const $i=Gi.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},Gi.DataFactory),eW={x:$i("rdf"),type:$i("rdf")("type")},_m={x:$i("rdfs"),label:$i("rdfs")("label"),comment:$i("rdfs")("comment"),isDefinedBy:$i("rdfs")("isDefinedBy"),seeAlso:$i("rdfs")("seeAlso")},gi={x:$i("entity"),id:$i("entity")("id"),label:_m.label,description:_m.comment,link:_m.seeAlso,sex:$i("entity")("sex"),age:$i("entity")("age"),bmi:$i("entity")("bmi"),Male:Gi.DataFactory.literal("Male"),Female:Gi.DataFactory.literal("Female"),consortiumName:$i("entity")("consortium_name"),providerName:$i("entity")("provider_name"),providerUUID:$i("entity")("provider_uuid"),donor:$i("entity")("has_donor"),sections:$i("entity")("has_tissue_section"),datasets:$i("entity")("has_dataset"),sampleType:$i("entity")("sample_type"),TissueBlock:Gi.DataFactory.literal("Tissue Block"),TissueSection:Gi.DataFactory.literal("Tissue Section"),NonStandard:Gi.DataFactory.literal("Non-standard"),sectionCount:$i("entity")("section_count"),sectionSize:$i("entity")("section_size"),sectionUnits:$i("entity")("section_units"),sectionNumber:$i("entity")("section_number"),spatialEntity:$i("entity")("has_spatial_entity"),ontologyTerms:$i("entity")("has_ontology_term"),technology:$i("entity")("technology"),thumbnail:$i("entity")("has_thumbnail")},In=$i("ccf"),lr={x:In,ontologyNode:{label:In("ccf_preferred_label"),parent:In("ccf_part_of"),children:In("ccf_part_of"),rui_rank:In("ccf_rui_rank"),synonymLabels:Gi.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:In("VHFemale"),Male:In("VHMale"),BothSexes:In("VHBothSexes"),FemaleOrgans:In("VHFemaleOrgans"),MaleOrgans:In("VHMaleOrgans")},SpatialObjectReference:In("SpatialObjectReference"),SpatialEntity:In("SpatialEntity"),SpatialPlacement:In("SpatialPlacement"),spatialObjectReference:{file:In("has_object_file"),file_format:In("has_object_file_format"),file_subpath:In("has_object_file_subpath")},extractionSet:{label:_m.label,rui_rank:In("ccf_rui_rank")},spatialEntity:{label:_m.label,comment:_m.comment,creator:$i("dc")("creator"),creator_first_name:In("creator_first_name"),creator_last_name:In("creator_last_name"),creator_orcid:In("creator_orcid"),creation_date:In("creation_date"),updated_date:In("updated_date"),ccf_annotations:In("ccf_annotation"),representation_of:In("ccf_representation_of"),reference_organ:In("anatomical_structure_of"),extraction_set_for:In("extraction_set_for"),extraction_set:In("extraction_site_for"),sex:In("has_sex"),side:In("has_side"),rui_rank:In("ccf_rui_rank"),slice_thickness:In("ccf_slice_thickness"),slice_count:In("ccf_slice_count"),x_dimension:In("has_x_dimension"),y_dimension:In("has_y_dimension"),z_dimension:In("has_z_dimension"),dimension_units:In("has_dimension_units"),object:In("has_object_reference")},spatialPlacement:{source:In("has_placement_source"),target:In("has_placement_target"),placement_date:In("has_placement_date"),x_scaling:In("has_x_scaling"),y_scaling:In("has_y_scaling"),z_scaling:In("has_z_scaling"),scaling_units:In("has_scaling_units"),x_rotation:In("has_x_rotation"),y_rotation:In("has_y_rotation"),z_rotation:In("has_z_rotation"),w_rotation:In("has_theta_rotation"),rotation_order:In("has_rotation_order"),rotation_units:In("has_rotation_units"),x_translation:In("has_x_translation"),y_translation:In("has_y_translation"),z_translation:In("has_z_translation"),translation_units:In("has_translation_units")}},Ar={x:$i("uberon")},tW=($i("lmha"),{bladder:Ar.x("0001255"),body:Ar.x("0013702"),brain:Ar.x("0000955"),colon:Ar.x("0001155"),heart:Ar.x("0000948"),kidney:Ar.x("0002113"),large_intestine:Ar.x("0000059"),left_kidney:Ar.x("0004538"),left_lung:Ar.x("0002168"),left_ureter:Ar.x("0001223"),liver:Ar.x("0002107"),lung:Ar.x("0002048"),respiratory_system:Ar.x("0001004"),lymph_node:Ar.x("0000029"),pelvis:Ar.x("0001270"),rectum:Ar.x("0001052"),right_kidney:Ar.x("0004539"),right_lung:Ar.x("0002167"),right_ureter:Ar.x("0001222"),skin:Ar.x("0002097"),small_intestine:Ar.x("0002108"),spleen:Ar.x("0002106"),thymus:Ar.x("0002370"),ureter:Ar.x("0000056"),vasculature:Ar.x("0002049")});function fP(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const ux={spatialObjectReference:fP(lr.spatialObjectReference),spatialEntity:fP(lr.spatialEntity),spatialPlacement:fP(lr.spatialPlacement)};function dx(n,e,t,i){const r={"@id":e,"@type":t};return n.some(s=>{const o=i[s.predicate.id];if(o){const a="Literal"===s.object.termType?(0,dh.fromRdf)(s.object):s.object.id;(0,pi.set)(r,o,a)}return!1},Gi.DataFactory.namedNode(e),null,null,null),r}const eMe=(0,pi.memoize)(function(n,e){return dx(n,e,"SpatialObjectReference",ux.spatialObjectReference)},(n,e)=>e),nW=(0,pi.memoize)(function(n,e){const t=dx(n,e,"ExtractionSet",ux.spatialEntity);return t.extractionSites=(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set,e,null).map(i=>Hf(n,i.id)),["rui_rank"]),t},(n,e)=>e),iMe=(0,pi.memoize)(function(n,e){return(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.extraction_set_for,e,null).map(t=>nW(n,t.id)),["rui_rank"])},(n,e)=>e),sMe=(0,pi.memoize)(function(n,e){return(0,pi.sortBy)(n.getSubjects(lr.spatialEntity.reference_organ,e,null).map(t=>Hf(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(n,e)=>e),aMe=(0,pi.memoize)(function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(Hf(n,t.subject.id))},null,lr.spatialEntity.reference_organ,null,null),(0,pi.sortBy)(e,["rui_rank"])}),Hf=(0,pi.memoize)(function(n,e){const t=dx(n,e,"SpatialEntity",ux.spatialEntity);return t.object&&(t.object=eMe(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,lr.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,gi.spatialEntity,e,null),t},(n,e)=>e),uMe=(0,pi.memoize)(function(n,e){const t=dx(n,e,"SpatialPlacement",ux.spatialPlacement);return t.source&&(t.source=Hf(n,t.source)),t.target&&(t.target=Hf(n,t.target)),t},(n,e)=>e),hMe=(0,pi.memoize)(function(n,e){const t=n.getObjects(Gi.DataFactory.namedNode(e),gi.spatialEntity,null);if(t.length>0)return Hf(n,t[0].id)},(n,e)=>e);function fMe(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(zj),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class iW{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new KDe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},eW.type,lr.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},eW.type,lr.SpatialEntity,null);const t={};e.some(i=>(t[i.subject.id]=i.object.id,!1),null,lr.spatialPlacement.source,null,null),e.some(i=>{const r=t[i.subject.id];return r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement"),!1},null,lr.spatialPlacement.target,null,null)}addNode(e,t){this.graph.mergeNode(e,{type:t})}addEdge(e,t,i,r){this.graph.mergeDirectedEdge(t,i,{type:r,id:e})}getTransformationMatrix(e,t){if(e===t)return new Gn(Gn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new Gn(Gn.IDENTITY),s=QDe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s){if(o){const l=this.graph.getEdgeAttribute(a,o,"id");fMe(r,uMe(i,l))}o=a}return r}}}class rW{constructor(e){this.db=e}getSpatialEntity(e){return Hf(this.db.store,e)}getExtractionSets(e){return iMe(this.db.store,e)}getExtractionSet(e){return nW(this.db.store,e)}getAnatomicalStructures(e){return sMe(this.db.store,e)}getReferenceOrgans(){return aMe(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=lr.spatial.Male.id;break;case"Female":t=lr.spatial.Female.id;break;case"Both":default:t=lr.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t=this.getReferenceOrgans();switch(null==e?void 0:e.sex){case"Male":t=t.filter(i=>"Male"===i.sex);break;case"Female":t=t.filter(i=>"Female"===i.sex)}return(null==e?void 0:e.debug)&&(t=t.map(i=>[[i],this.getAnatomicalStructures(i["@id"])]).reduce((i,[r,s])=>i.concat(s.length>0?s:r),[])),t}getReferenceSceneNodes(e){const t=this.getReferenceBody(e);let i=[...this.getReferenceOrganSets(e).map(r=>{const s="http://purl.obolibrary.org/obo/UBERON_0002097"===r.representation_of;return this.getSceneNode(r,t,{color:[255,255,255,255],opacity:s?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!s})})];return(null==e?void 0:e.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(lr.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(lr.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),i.filter(r=>void 0!==r)}getReferenceOrganScene(e,t){var i,r;const s=null!==(i=void 0!==(null==t?void 0:t.sex))&&void 0!==i&&i,o=this.getReferenceOrgans().filter(a=>a.representation_of===e&&(!s||a.sex===(null==t?void 0:t.sex)));if(o.length>0){const a=o[0],c=this.getSceneNode(a,a,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===a.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),d=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(f=>this.getSceneNode(f,a,{color:[255,255,255,229.5]}));return[c].concat(d).filter(f=>void 0!==f)}return[]}getEntitySceneNodes(e){const t=this.getReferenceBody(e);return this.db.getSpatialEntities(e).map(i=>this.getSceneNode(i,t,{color:[255,255,255,229.5]})).filter(i=>void 0!==i)}getSceneNode(e,t,i={}){var r,s,o,a;const l=null===(s=null===(r=null==e?void 0:e.object)||void 0===r?void 0:r.file_format)||void 0===s?void 0:s.startsWith("model/gltf");let d=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(d){if(l)d=new Gn(Gn.IDENTITY).rotateX(zj(90)).multiplyLeft(d);else{let f;switch(e.dimension_units){case"centimeter":f=.01;break;case"millimeter":f=.001;break;case"meter":default:f=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*f/2);d.scale(p)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId,ccf_annotations:e.ccf_annotations,representation_of:e.representation_of,reference_organ:e.reference_organ,scenegraph:l?null===(o=e.object)||void 0===o?void 0:o.file:void 0,scenegraphNode:l?null===(a=e.object)||void 0===a?void 0:a.file_subpath:void 0,transformMatrix:d,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const hx="https://entity.api.hubmapconsortium.org/entities/",sW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),pMe={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},fx={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},Ti=function(){const n={};return Object.entries(tW).forEach(([e,t])=>n[e]=t.id),n}(),mMe={BL:[Ti.body,Ti.bladder],RK:[Ti.body,Ti.kidney,Ti.right_kidney],LK:[Ti.body,Ti.kidney,Ti.left_kidney],HT:[Ti.body,Ti.heart],LI:[Ti.body,Ti.large_intestine,Ti.colon],SI:[Ti.body,Ti.small_instestine],LL:[Ti.body,Ti.respiratory_system,Ti.lung,Ti.left_lung],RL:[Ti.body,Ti.respiratory_system,Ti.lung,Ti.right_lung],LY:[Ti.body,Ti.lymph_node],SP:[Ti.body,Ti.spleen],TH:[Ti.body,Ti.thymus],UR:[Ti.body,Ti.ureter],LV:[Ti.body,Ti.liver],OT:[Ti.body]},oW={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class vMe{constructor(e,t="",i="",r){var s,o;if(this.data=e,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const c=this.data.descendants||[],d=(this.data.ancestors||[]).find(We=>"Donor"===We.entity_type);this.donor=this.getDonor(d,i);const f=this.getRuiLocation(e,this.donor);f?this.rui_location=f:this.bad=!0;const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=fx[e.group_uuid]||e.group_name,_=e.created_by_user_displayname;this["@id"]=hx+e.uuid,this.label=`Registered ${p}, ${_}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const x={},T=[];this.sections=T;const q=[];this.datasets=q;for(const We of c.filter(dt=>"Sample"===dt.entity_type)){const dt=this.getSection(We,e,i);x[We.submission_id]=dt,T.push(dt),dt.section_number=null!==(s=dt.section_number)&&void 0!==s?s:T.length}for(const We of c)if("Dataset"===We.entity_type){const dt=this.getDataset(We,t,i,r),Mt=(0,pi.get)(We,["ingest_metadata","metadata","tissue_id"]);x[Mt]?null===(o=x[Mt].datasets)||void 0===o||o.push(dt):q.push(dt)}const G=null!=f?f:{},ge=`${G.x_dimension} x ${G.y_dimension} x ${G.z_dimension} ${G.dimension_units}`;this.section_count=G.slice_count||T.length;const Ne=parseFloat((G.slice_thickness||(G.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ne;const Ge=G.dimension_units||"millimeter";this.section_units=Ge,this.description=`${ge}, ${Ne} ${Ge}, ${e.specimen_type}, ${this.section_count} Sections`,T.forEach((We,dt)=>{We.description=`${G.x_dimension} x ${G.y_dimension} x ${Ne} ${Ge}, ${Ne} ${Ge}, ${We.description}`,We.section_number=dt+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":hx+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${fx[e.group_uuid]||e.group_name}`,description:`${t.specimen_type}`,link:`${i}browse/sample/${e.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(e,t="",i="",r){var s;const o=new Date(e.last_modified_timestamp).toLocaleDateString(),a=fx[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,pi.get)(e,["ingest_metadata","metadata","assay_type"],"")],d=c.join("|").toLowerCase();let f,p="assets/icons/ico-unknown.svg";return-1!==d.indexOf("10x")?(f="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==d.indexOf("af")?(f="AF",p="assets/icons/ico-spatial-af.svg"):-1!==d.indexOf("codex")?(f="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==d.indexOf("imc")?(f="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==d.indexOf("lc")&&-1===d.indexOf("af")?(f="LC",p="assets/icons/ico-bulk-lc.svg"):f=-1!==d.indexOf("maldi")?"MALDI":-1!==d.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":hx+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:f,thumbnail:p}}getDatasetThumbnail(e,t,i){if(e.thumbnail_file){const r=e.thumbnail_file;return`${t}/${r.file_uuid}/${r.filename}`+(i?`?token=${i}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===e.group_uuid){const r=(0,pi.get)(e,"metadata.files",[]).filter(s=>/\.(ome\.tif|ome\.tiff)$/.test(s.rel_path)).filter(s=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(s.rel_path)).filter(s=>sW.has(s.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(s=>`${t}/${e.uuid}/${s.rel_path}`+(i?`?token=${i}`:""));if(r.length>0){const s=r[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(sW.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=pMe[e.hubmap_id];if(r)return`assets/thumbnails/TMC-Florida/${r}`}}getDonor(e,t){const i=(e.description||"").toLowerCase();let r;i.includes("female")?r="Female":i.includes("male")&&(r="Male");const s=i.match(/age ([0-9]+)/);let o,a;s&&(o=(0,pi.toNumber)(s[1]));for(const p of(0,pi.get)(e,"metadata.organ_donor_data",[]))"Feminine gender"===p.preferred_term||"Female"===p.preferred_term?r="Female":"Masculine gender"===p.preferred_term||"Male"===p.preferred_term?r="Male":"Current chronological age"===p.preferred_term||"Age"===p.preferred_term?o=(0,pi.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,pi.toNumber)(p.data_value));let l="";r&&o&&(l+=`${r}, Age ${o}`,a&&(l+=`, BMI ${a.toFixed(1)}`));const c=new Date(e.last_modified_timestamp).toLocaleDateString(),d=fx[e.group_uuid]||e.group_name;return{"@id":hx+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${d}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;const s=(e.ancestors||[]).find(c=>"Sample"===c.entity_type&&"organ"===c.specimen_type),o=mMe[null==s?void 0:s.organ]||[Ti.body];let a,l=e.rui_location;if(l&&("string"==typeof l&&(l=JSON.parse(l)),l.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):l["@id"]&&(a=l)),a){a.ccf_annotations=o.concat(a.ccf_annotations||[]);const c=null!==(i=(0,pi.get)(a,["placement","target"]))&&void 0!==i?i:"";c.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,pi.set)(a,["placement","target"],c.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===c||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===c)&&(0,pi.set)(a,["placement","target"],"Male"===t.sex?c.replace("#VH","#VHM")+"_Patch":c.replace("#VH","#VHF")+"_Patch")}return a}getTissueBlock(){return(0,pi.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function aW(n,e,t,i,r="",s=""){return or(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(n).then(a=>a.ok?a.json():void 0).catch(()=>{});else if("search-api"===e){const a={"Content-type":"application/json"};i&&i.length>0&&(a.Authorization=`Bearer ${i}`),o=yield fetch(n,{method:"POST",headers:a,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:{exists:{field:"rui_location"}}})}).then(l=>l.ok?l.json():void 0).catch(()=>{})}if(o)return function(n,e="",t="",i,r=!1){const o={},a=(0,pi.get)(n,"hits.hits",[]).map(c=>(0,pi.get)(c,"_source",{})).map(c=>new vMe(c,e,t,i).toJsonLd());for(const c of a){const d=c["@id"];o[d]?o[d].samples.push(c.samples[0]):o[d]=c}const l=Object.values(o);return r&&(function(n){let e=[],t=0;for(const i of n.filter(r=>r.samples.length>1)){const r=i.samples;for(let s=0;sc["@id"]===o)&&(r[s].deleteMe=!0,t++)}i.samples=r.filter(s=>!0!==s.deleteMe)}t>0&&console.log(`\u26a0 ${t} sections identified as blocks`)}(l),console.log(l.map(c=>Object.assign({"@context":oW},c)))),{"@context":oW,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function px(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.donor,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}function ob(n,e){return t=>n.has(t.id)?e.add(t.id):void 0}const FMe={[lr.ontologyNode.label.id]:"label",[lr.ontologyNode.parent.id]:"parent",[lr.ontologyNode.synonymLabels.id]:"synonymLabels"};function LMe(n,e){const t=Gi.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return n.some(r=>{const s=FMe[r.predicate.id];if(s){const o="Literal"===r.object.termType?(0,dh.fromRdf)(r.object):r.object.id;"synonymLabels"===s?i.synonymLabels.push(o):(0,pi.set)(i,s,o)}return!1},t,null,null,null),i.children=n.getSubjects(lr.ontologyNode.children,t,null).map(r=>r.id),i}const gx={[gi.label.id]:"label",[gi.description.id]:"description",[gi.link.id]:"link"},BMe=Object.assign(Object.assign({},gx),{[gi.providerName.id]:"providerName"}),jMe=Object.assign(Object.assign({},gx),{[gi.technology.id]:"technology",[gi.thumbnail.id]:"thumbnail"}),VMe=Object.assign(Object.assign({},gx),{[gi.sampleType.id]:"sampleType",[gi.sectionNumber.id]:"sectionNumber",[gi.datasets.id]:"datasets"}),UMe=Object.assign(Object.assign({},gx),{[gi.sampleType.id]:"sampleType",[gi.sectionCount.id]:"sectionCount",[gi.sectionSize.id]:"sectionSize",[gi.sectionUnits.id]:"sectionUnits",[gi.donor.id]:"donor",[gi.spatialEntity.id]:"spatialEntityId",[gi.sections.id]:"sections",[gi.datasets.id]:"datasets"}),HMe=(0,pi.memoize)(function(n,e){const t={"@id":e,"@type":"Donor"};return n.some(i=>{const r=BMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;(0,pi.set)(t,r,s)}return!1},Gi.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e);function lW(n,e){const t={"@id":e,"@type":"Dataset"};return n.some(i=>{const r=jMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;(0,pi.set)(t,r,s)}return!1},Gi.DataFactory.namedNode(e),null,null,null),t}const WMe=(0,pi.memoize)(function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};return n.some(i=>{const r=UMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;if("sections"===r){const o=function(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};return n.some(i=>{const r=VMe[i.predicate.id];if(r){const s="Literal"===i.object.termType?(0,dh.fromRdf)(i.object):i.object.id;if("datasets"===r){const o=lW(n,s);t[r].push(o)}else(0,pi.set)(t,r,s)}return!1},Gi.DataFactory.namedNode(e),null,null,null),t}(n,s);t[r].push(o)}else if("datasets"===r){const o=lW(n,s);t[r].push(o)}else"donor"===r?t[r]=HMe(n,s):(0,pi.set)(t,r,s)}return!1},Gi.DataFactory.namedNode(e),null,null,null),t},(n,e)=>e),qMe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class YMe{constructor(e=qMe){this.options=e,this.store=new Gi.Store(void 0,{factory:Gi.DataFactory}),this.graph=new iW(this),this.scene=new rW(this)}connect(e,t=!1){return or(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=t?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return or(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield J$(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=ac()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),tu(t.transaction)))}([i,t]).catch(()=>{}):s=yield J$(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=ac()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),tu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return or(this,void 0,void 0,function*(){const i=[],r=null!==(t=null===(e=this.options.dataSources)||void 0===e?void 0:e.concat())&&void 0!==t?t:[],s=this.options.ccfOwlUrl;if(s.endsWith(".n3store.json")){const o=yield fetch(s).then(a=>a.text()).catch(()=>console.log("Couldn't locate serialized store."));o&&(this.store=(0,Gi.deserializeN3Store)(o,Gi.DataFactory))}else(null==s?void 0:s.length)>0&&r.push(s);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(aW(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(o=>{if(o)return this.addDataSources([o])}))),i.push(this.addDataSources(r)),yield Promise.all(i),yield this.synchronize()})}addDataSources(e,t){return or(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>or(this,void 0,void 0,function*(){"string"==typeof r?r.endsWith("jsonld")?yield(0,Gi.addJsonLdToStore)(r,i):r.endsWith("n3")?yield(0,Gi.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,Gi.addRdfXmlToStore)(r,i):yield(0,Gi.addJsonLdToStore)(r,i):yield(0,Gi.addJsonLdToStore)(r,i)}))),this})}synchronize(){return or(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),this})}serialize(){return(0,Gi.serializeN3Store)(this.store)}deserialize(e){return or(this,void 0,void 0,function*(){this.store=(0,Gi.deserializeN3Store)(e,Gi.DataFactory),this.graph=new iW(this),this.scene=new rW(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e){var t,i,r,s,o;let a=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),gi.spatialEntity,null,null),e}(n);if(a.size>0&&(a=function(n,e,t=!0){const i=new Set;if(n.forSubjects(ob(e,i),gi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const l=e.sex;a=px(n,a,c=>function(n,e,t){const i=new Set;return n.forSubjects(ob(e,i),gi.sex,gi[t],null),i}(n,c,l))}if(a.size>0&&(null===(t=e.tmc)||void 0===t?void 0:t.length)>0&&(a=px(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Gi.DataFactory.literal(r);n.forSubjects(ob(e,i),gi.providerName,s,null)}return i}(n,l,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set,o=new Set;n.some(c=>(e.has(c.subject.id)&&o.add(c.object.id),!1),null,gi.sections,null,null),n.some(c=>{var d;return(e.has(c.subject.id)||o.has(c.subject.id))&&(s.add(c.object.id),r.has(c.object.id)?null===(d=r.get(c.object.id))||void 0===d||d.push(c.subject.id):r.set(c.object.id,[c.subject.id])),!1},null,gi.datasets,null,null);const a=t(s),l=new Set;for(const c of a)for(const d of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(d);return l}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Gi.DataFactory.literal(r);n.forSubjects(ob(e,i),gi.technology,s,null)}return i}(n,l,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(n,e,t){var i;const r=new Map,s=new Set;n.some(l=>{var c;return e.has(l.subject.id)&&(s.add(l.object.id),r.has(l.object.id)?null===(c=r.get(l.object.id))||void 0===c||c.push(l.subject.id):r.set(l.object.id,[l.subject.id])),!1},null,gi.spatialEntity,null,null);const o=t(s),a=new Set;for(const l of o)for(const c of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(c);return a}(n,a,l=>function(n,e,t){const i=new Set;for(const r of t){const s=Gi.DataFactory.namedNode(r);n.forSubjects(ob(e,i),lr.spatialEntity.ccf_annotations,s,null)}return i}(n,l,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,pi.isFinite)(e.ageRange[0])&&(0,pi.isFinite)(e.ageRange[1])){const l=Math.max(...e.ageRange),c=Math.min(...e.ageRange);1===c&&110===l||(a=px(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,dh.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.age,null,null),r}(n,d,c,l)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,pi.isFinite)(e.bmiRange[0])&&(0,pi.isFinite)(e.bmiRange[1])){const l=Math.max(...e.bmiRange),c=Math.min(...e.bmiRange);13===c&&83===l||(a=px(n,a,d=>function(n,e,t,i){const r=new Set;return n.some(s=>{if(e.has(s.subject.id)){const o=(0,dh.fromRdf)(s.object);o>=t&&o<=i&&r.add(s.subject.id)}return!1},null,gi.bmi,null,null),r}(n,d,c,l)))}return a}(this.store,e)}get(e){return this.store.getQuads(Gi.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(t=>this.get(t))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>hMe(this.store,t))}getDatasetTechnologyNames(){return or(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return or(this,void 0,void 0,function*(){return function(n){const e=new Set;return n.some(t=>(e.add(t.object.value),!1),null,gi.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return or(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>WMe(this.store,t))})}getAggregateResults(e){return or(this,void 0,void 0,function*(){return function(n,e){const t=new Set;e.some(l=>(n.has(l.subject.id)&&t.add(l.object.id),!1),null,gi.donor,null,null);const i=new Set;e.some(l=>(t.has(l.subject.id)&&i.add(l.object.id),!1),null,gi.providerUUID,null,null);const r=new Set;e.forSubjects(l=>{n.has(l.id)&&r.add(l.id)},gi.spatialEntity,null,null);const s=new Set;e.some(l=>(r.has(l.subject.id)&&s.add(l.object.id),!1),null,gi.sections,null,null);const o=new Set;return e.some(l=>{const c=l.subject;return(r.has(c.id)||s.has(c.id))&&o.add(l.object.id),!1},null,gi.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:t.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([l,c])=>({label:l,count:c}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return or(this,void 0,void 0,function*(){return function(n,e){const t=new Map;e.some(r=>(n.has(r.subject.id)&&(t.has(r.object.id)?t.get(r.object.id).push(r.subject.id):t.set(r.object.id,[r.subject.id])),!1),null,gi.spatialEntity,null,null);const i={};return e.some(r=>{var s,o;if(t.has(r.subject.id)){const a=null!==(o=null===(s=t.get(r.subject.id))||void 0===s?void 0:s.length)&&void 0!==o?o:0;i[r.object.id]=a+(i[r.object.id]||0)}return!1},null,lr.spatialEntity.ccf_annotations,null,null),i}(this.getIds(e),this.store)})}getOntologyTreeModel(){return or(this,void 0,void 0,function*(){return function(n){const e={root:tW.body.id,nodes:{}},t=new Set;n.some(i=>(t.add(i.subject.id),t.add(i.predicate.id),!1),null,lr.ontologyNode.parent,null,null);for(const i of t)e.nodes[i]=LMe(n,i);return e}(this.store)})}getReferenceOrgans(){return or(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return or(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return or(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}}function XMe(n,e){return n===e}let QMe=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new S,this.dataSource=i.config$.pipe(Ui(r=>Object.keys(r).length>0),me(r=>r),Wu(XMe),sr(r=>function(n,e){return new F(t=>{let i,r;try{i=n()}catch(a){return void t.error(a)}try{r=e(i)}catch(a){return void t.error(a)}const o=(r?Pe(r):Nc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),ml(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(sr(i=>i.getTissueBlockResults(t)),Xi(1))}getAggregateResults(t){return this.dataSource.pipe(sr(i=>i.getAggregateResults(t)),Xi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(sr(i=>i.getOntologyTermOccurences(t)),Xi(1))}getOntologyTreeModel(){return this.dataSource.pipe(sr(t=>t.getOntologyTreeModel()),Xi(1))}getReferenceOrgans(){return this.dataSource.pipe(sr(t=>t.getReferenceOrgans()),Xi(1))}getScene(t){return this.dataSource.pipe(sr(i=>i.getScene(t).then(r=>r.filter(s=>t.ontologyTerms.includes(s.representation_of)))),Xi(1))}getReferenceOrganScene(t,i){return this.dataSource.pipe(sr(r=>r.getReferenceOrganScene(t,i)),Xi(1))}createDataSource(){return{source:new YMe,unsubscribe:()=>{}}}connectDataSource(t,i){return or(this,void 0,void 0,function*(){$d.disableDbWorker&&(yield new Promise(s=>{setTimeout(s,100)}));const r=(new Date).getTime();return yield t.connect(i,!0),$d.production||console.info(`Loaded CCF database in ${((new Date).getTime()-r)/1e3}s`),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(af),Ie(cx))},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),ZMe=(()=>{class n{constructor(t){this.source=t,this.organs=Z$}getOrganInfo(t,i,r="Female"){let s=this.organs.find(a=>a.id===t);if(!s)return nn(void 0);const o=s.organ;return s.disabled&&(s=this.organs.find(a=>!a.disabled&&a.organ===o)),(null==s?void 0:s.side)&&i&&s.side!==i&&(s=this.organs.find(a=>!a.disabled&&a.organ===o&&a.side===i)),nn(s)}getOrgan(t,i="Female"){return this.source.getReferenceOrgans().pipe(me(r=>r.find(s=>s.representation_of===t.id&&("Both"===i||s.sex===i))))}getOrganScene(t,i="Female"){return t.id?this.source.getReferenceOrganScene(t.id,{ontologyTerms:[t.id],sex:i}):nn([])}getOrganStats(t,i="Female"){return t.id?this.source.getAggregateResults({ontologyTerms:[t.id],sex:i}):nn([])}getBlocks(t,i="Female"){return t.id?this.source.getTissueBlockResults({ontologyTerms:[t.id],sex:i}):nn([])}}return n.\u0275fac=function(t){return new(t||n)(Ie(QMe))},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const JMe=["thumbContainer"],eIe=["toggleBar"],tIe=["input"],nIe=function(n){return{enterDuration:n}},iIe=["*"],rIe=new zt("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let sIe=0;const oIe={provide:Ra,useExisting:fe(()=>cW),multi:!0};class aIe{constructor(e,t){this.source=e,this.checked=t}}const lIe=LN(Xv(FN(UC(class{constructor(n){this._elementRef=n}}))));let cW=(()=>{class n extends lIe{constructor(t,i,r,s,o,a){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=o,this._onChange=l=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++sIe,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new mn,this.toggleChange=new mn,this.tabIndex=parseInt(s)||0,this.color=this.defaultColor=o.color||"accent",this._noopAnimations="NoopAnimations"===a}get required(){return this._required}set required(t){this._required=zi(t)}get checked(){return this._checked}set checked(t){this._checked=zi(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new aIe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(De(wn),De(Xu),De(ts),function(n){return function(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const i=t.length;let r=0;for(;r{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})(),dIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[uW,HC,pr,nN],uW,pr]}),n})(),hIe=(()=>{class n{constructor(){this.clsName="ccf-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new mn}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Tc(i.clsName)},inputs:{labels:"labels",value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},decls:6,vars:12,consts:[[1,"slide-label",3,"click"],[1,"slider",3,"disabled","checked","change"],["toggle",""]],template:function(t,i){if(1&t){const r=wu();Pt(0,"span",0),kn("click",function(){Vo(r);const o=qp(3);return i.left||o.toggle(),i.updateToggle(!0)}),Si(1),Ft(),Pt(2,"mat-slide-toggle",1,2),kn("change",function(o){return i.updateToggle(!o.checked)}),Ft(),Pt(4,"span",0),kn("click",function(){Vo(r);const o=qp(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Si(5),Ft()}2&t&&(Ei("disabled",i.disabled)("highlighted",i.left),Yt(1),xs(i.labels[0].charAt(0).toUpperCase()+i.labels[0].slice(1)),Yt(1),on("disabled",i.disabled)("checked",!i.left),Yt(2),Ei("disabled",i.disabled)("highlighted",!i.left),Yt(1),xs(i.labels[1].charAt(0).toUpperCase()+i.labels[1].slice(1)))},directives:[cW],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer;opacity:50%}[_nghost-%COMP%] .slide-label.highlighted[_ngcontent-%COMP%]{opacity:100%}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%!important;cursor:not-allowed}[_nghost-%COMP%] .slider .mat-slide-toggle-bar{background-color:#43476580}[_nghost-%COMP%] .slider .mat-slide-toggle-thumb{background-color:#434765}"],changeDetection:0}),n})();const fIe=["bodyUI"],pIe=function(){return["Male","Female"]},gIe=function(){return["Left","Right"]};let mIe=(()=>{class n{constructor(t){this.ga=t,this.sexChange=new mn,this.sideChange=new mn}ngOnInit(){this.reset()}ngAfterViewChecked(){this.updateHighlighting()}updateHighlighting(){var t,i,r,s;const o=new Set(null!==(i=null===(t=this.filter)||void 0===t?void 0:t.tmc)&&void 0!==i?i:[]);this.filteredBlocks=null!==(s=null===(r=this.blocks)||void 0===r?void 0:r.filter(a=>o.has(a.donor.providerName)).map(a=>a["@id"]))&&void 0!==s?s:[],this.bodyUI.scene=this.bodyUI.scene.map(a=>{var l;return Object.assign(Object.assign({},a),{color:a.entityId&&this.highlightedNodeId===a["@id"]?[30,136,229,255]:this.filteredBlocks.includes(null!==(l=a.entityId)&&void 0!==l?l:"")?[173,255,47,229.5]:[255,255,255,229.5]})})}ngOnChanges(t){this.bodyUI&&"organ"in t&&this.reset()}updateSex(t){this.sex=t,this.sexChange.emit(this.sex)}updateSide(t){this.side=t,this.sideChange.emit(this.side)}reset(){const{bodyUI:t,organ:i}=this;if(i){i.side||(this.side=void 0);const{x_dimension:r,y_dimension:s,z_dimension:o}=i;t.rotation=t.rotationX=0,t.bounds={x:1.25*r/1e3,y:1.25*s/1e3,z:1.25*o/1e3},t.target=[r/1e3/2,s/1e3/2,o/1e3/2]}}nodeClicked(t){this.ga.event("node_click","organ",t.node["@id"]),this.highlightedNodeId=this.highlightedNodeId&&this.highlightedNodeId===t.node["@id"]?"":t.node["@id"]}}return n.\u0275fac=function(t){return new(t||n)(De(PE))},n.\u0275cmp=_n({type:n,selectors:[["ccf-organ"]],viewQuery:function(t,i){if(1&t&&Mr(fIe,7),2&t){let r;di(r=hi())&&(i.bodyUI=r.first)}},inputs:{organ:"organ",scene:"scene",organIri:"organIri",sex:"sex",side:"side",blocks:"blocks",filter:"filter"},outputs:{sexChange:"sexChange",sideChange:"sideChange"},features:[ki],decls:5,vars:9,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick"],["bodyUI",""],[1,"stage-options"],[1,"view-slider",3,"labels","value","valueChange"],[1,"view-slider",3,"labels","value","disabled","valueChange"]],template:function(t,i){1&t&&(Pt(0,"ccf-body-ui",0,1),kn("nodeClick",function(s){return i.nodeClicked(s)}),Ft(),Pt(2,"div",2),Pt(3,"ccf-slide-toggle",3),kn("valueChange",function(s){return i.updateSex(s)}),Ft(),Pt(4,"ccf-slide-toggle",4),kn("valueChange",function(s){return i.updateSide(s)}),Ft(),Ft()),2&t&&(on("scene",i.scene)("interactive",!0),Yt(3),on("labels",Mw(7,pIe))("value",i.sex),Yt(1),on("labels",Mw(8,gIe))("value",i.side)("disabled",!i.side))},directives:[gDe,hIe],styles:["[_nghost-%COMP%]{display:block;background-color:#000;border-radius:.5rem;color:#fff;height:100%}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{height:90%}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{padding:1rem;min-width:352px}"],changeDetection:0}),n})();function _Ie(n,e){if(1&n&&(Pt(0,"div",3),Pt(1,"div",4),Si(2),Ft(),Pt(3,"div",5),Si(4),Ft(),Ft()),2&n){const t=e.$implicit;Yt(2),xs(t.count),Yt(2),xs(t.label)}}let yIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-stats-list"]],inputs:{statsLabel:"statsLabel",stats:"stats"},decls:4,vars:2,consts:[[1,"stats-container"],[1,"header"],["class","stats-row",4,"ngFor","ngForOf"],[1,"stats-row"],[1,"stat"],[1,"label"]],template:function(t,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Si(2),Ft(),Ai(3,_Ie,5,2,"div",2),Ft()),2&t&&(Yt(2),Mc(" ",i.statsLabel," "),Yt(1),on("ngForOf",i.stats))},directives:[Ud],styles:[".stats-container[_ngcontent-%COMP%]{margin-bottom:2rem;min-height:9rem}.stats-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{margin-bottom:1rem}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;height:1.325rem}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%] .stat[_ngcontent-%COMP%]{width:2rem;margin-right:1rem;text-align:right}.stats-container[_ngcontent-%COMP%] .stats-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{flex-grow:1;text-align:left}"],changeDetection:0}),n})();function vIe(n,e){if(1&n){const t=wu();Pt(0,"div",6),Pt(1,"div",7),Pt(2,"div",8),Si(3),Ft(),Pt(4,"div",9),kn("click",function(){const s=Vo(t).$implicit;return wr().goToURL(s.buttonUrl)}),Si(5),Ft(),Ft(),Ft()}if(2&n){const t=e.$implicit;Yt(3),xs(t.body),Yt(1),on("gaLabel",t.buttonUrl),Yt(1),Mc(" ",t.buttonTitle,"")}}function bIe(n,e){if(1&n){const t=wu();Pt(0,"div",10),kn("click",function(){const s=Vo(t).$implicit;return wr().goToURL(s.buttonUrl)}),Si(1),Ft()}if(2&n){const t=e.$implicit;on("gaLabel",t.buttonUrl),Yt(1),xs(t.buttonTitle)}}let wIe=(()=>{class n{constructor(){this.linkCards=[{body:"Add tissue blocks using the CCF Registration User Interface (RUI).",buttonTitle:"Register Tissue",buttonUrl:"https://hubmapconsortium.github.io/ccf-ui/rui/"},{body:"Explore tissue sections in tissue blocks with the CCF Exploration User Interface (EUI).",buttonTitle:"Explore Tissue",buttonUrl:"https://portal.hubmapconsortium.org/ccf-eui"},{body:"View linkages between anatomical structures, cell types, and common biomarkers (ASCT+B).",buttonTitle:"ASCT+B Reporter",buttonUrl:"https://hubmapconsortium.github.io/ccf-asct-reporter/"}],this.deepDives=[{body:"",buttonTitle:"CCF Portal",buttonUrl:"https://hubmapconsortium.github.io/ccf/"},{body:"",buttonTitle:"Online Course",buttonUrl:"https://expand.iu.edu/browse/sice/cns/courses/hubmap-visible-human-mooc"},{body:"",buttonTitle:"Paper",buttonUrl:"https://www.biorxiv.org/content/10.1101/2021.05.31.446440v2"}]}goToURL(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_n({type:n,selectors:[["ccf-link-cards"]],decls:7,vars:2,consts:[["gaCategory","link-cards",1,"link-cards-container"],["class","link-card",4,"ngFor","ngForOf"],["gaCategory","deep-dive",1,"deep-dive-section"],[1,"title"],[1,"button-container"],["class","btn-outline btn","gaEvent","visit-link",3,"gaLabel","click",4,"ngFor","ngForOf"],[1,"link-card"],[1,"link-card-content"],[1,"body"],["gaEvent","visit-link",1,"link-button","btn",3,"gaLabel","click"],["gaEvent","visit-link",1,"btn-outline","btn",3,"gaLabel","click"]],template:function(t,i){1&t&&(Pt(0,"div",0),Ai(1,vIe,6,3,"div",1),Ft(),Pt(2,"div",2),Pt(3,"div",3),Si(4,"Common Coordinate Framework (CCF) Deep Dive"),Ft(),Pt(5,"div",4),Ai(6,bIe,2,2,"div",5),Ft(),Ft()),2&t&&(Yt(1),on("ngForOf",i.linkCards),Yt(5),on("ngForOf",i.deepDives))},directives:[GB,Ud,$B],styles:[".link-cards-container[_ngcontent-%COMP%]{max-width:30rem}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%]{border-top:1px solid #e0e0e0;padding-top:1px;padding-bottom:1px}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%]:last-of-type{border-bottom:1px solid #e0e0e0}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%]{align-items:center;padding:1rem 0 1rem 1rem;display:flex;flex-direction:row;justify-content:space-between;border-left:6px solid #444A65}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%] .link-button[_ngcontent-%COMP%]{margin-left:2rem;background-color:#444a65;color:#fff}.link-cards-container[_ngcontent-%COMP%] .link-card[_ngcontent-%COMP%] .link-card-content[_ngcontent-%COMP%] .link-button[_ngcontent-%COMP%]:hover{background-color:#2f3346}.deep-dive-section[_ngcontent-%COMP%]{margin-top:2rem}.deep-dive-section[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-bottom:1rem;font-size:1rem}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%]{display:flex;flex-direction:row}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]{color:#444a65;border:1px solid #444A65;background-color:#fff}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]:not(:last-of-type){margin-right:1rem}.deep-dive-section[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%] .btn-outline[_ngcontent-%COMP%]:hover{background-color:#e0e0e0}.btn[_ngcontent-%COMP%]{min-width:9rem!important;max-height:2.28125rem;text-align:center;white-space:nowrap;cursor:pointer;font-size:.875rem;font-weight:500;border-radius:2px;line-height:2.75;transition:background-color .25s cubic-bezier(.4,0,.2,1) 0ms,box-shadow .25s cubic-bezier(.4,0,.2,1) 0ms,border .25s cubic-bezier(.4,0,.2,1) 0ms;font-family:Inter Variable,Helvetica,Arial,sans-serif}"],changeDetection:0}),n})();const EIe=["left"],SIe=["right"],CIe=function(){return[]},xIe=[{color:[0,0,0,0],opacity:.001}];let AIe=(()=>{class n{constructor(t,i,r){this.ga=i,this.configState=r,this.sex$=this.configState.getOption("sex"),this.side$=this.configState.getOption("side"),this.filter$=this.configState.getOption("highlightProviders").pipe(me(s=>({tmc:s}))),this.latestConfig={},this.organInfo$=r.config$.pipe(jr(s=>this.latestConfig=s),sr(s=>{var o,a,l;return t.getOrganInfo(null!==(o=s.organIri)&&void 0!==o?o:"",null===(l=null===(a=s.side)||void 0===a?void 0:a.toLowerCase)||void 0===l?void 0:l.call(a),s.sex)}),jr(s=>this.logOrganLookup(s)),ml(1)),this.organ$=this.organInfo$.pipe(sr(s=>s?t.getOrgan(s,this.latestConfig.sex):nn(void 0)),ml(1)),this.scene$=this.organ$.pipe(nb(this.organInfo$),sr(([s,o])=>s&&o?t.getOrganScene(o,this.latestConfig.sex):nn(xIe))),this.stats$=this.organInfo$.pipe(sr(s=>s?t.getOrganStats(s,this.latestConfig.sex):nn([]))),this.statsLabel$=this.stats$.pipe(nb(this.organInfo$),me(([s,o])=>this.makeStatsLabel(o)),function(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>gE(n,t,e)):t=>gE(n,t)}("Loading...")),this.blocks$=this.organInfo$.pipe(sr(s=>s?t.getBlocks(s,this.latestConfig.sex):nn([])))}ngAfterViewInit(){const{left:t,right:i}=this;t.nativeElement.style.height=`${i.nativeElement.offsetHeight}px`}updateInput(t,i){this.configState.patchConfig({[t]:i})}makeStatsLabel(t){let i=[`Unknown IRI: ${this.latestConfig.organIri}`];return t&&(i=[this.latestConfig.sex,t.organ,t.side]),i.filter(r=>!!r).join(", ")}logOrganLookup(t){this.ga.event(t?"organ_lookup_success":"organ_lookup_failure","organ",`Iri: ${this.latestConfig.organIri} - Sex: ${this.latestConfig.sex} - Side: ${this.latestConfig.side}`)}}return n.\u0275fac=function(t){return new(t||n)(De(ZMe),De(PE),De(cx))},n.\u0275cmp=_n({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&(Mr(EIe,7,wn),Mr(SIe,7,wn)),2&t){let r;di(r=hi())&&(i.left=r.first),di(r=hi())&&(i.right=r.first)}},decls:16,vars:25,consts:[[1,"container"],[1,"left"],["left",""],[3,"blocks","filter","sex","side","organ","scene","sexChange","sideChange"],[1,"right"],["right",""],[3,"statsLabel","stats"]],template:function(t,i){if(1&t&&(Pt(0,"div",0),Pt(1,"div",1,2),Pt(3,"ccf-organ",3),kn("sexChange",function(s){return i.updateInput("sex",s)})("sideChange",function(s){return i.updateInput("side",s)}),cl(4,"async"),cl(5,"async"),cl(6,"async"),cl(7,"async"),cl(8,"async"),cl(9,"async"),Ft(),Ft(),Pt(10,"div",4,5),wi(12,"ccf-stats-list",6),cl(13,"async"),cl(14,"async"),wi(15,"ccf-link-cards"),Ft(),Ft()),2&t){let r;Yt(3),on("blocks",ul(4,8,i.blocks$))("filter",ul(5,10,i.filter$))("sex",ul(6,12,i.sex$))("side",ul(7,14,i.side$))("organ",ul(8,16,i.organ$))("scene",null!==(r=ul(9,18,i.scene$))&&void 0!==r?r:Mw(24,CIe)),Yt(9),on("statsLabel",ul(13,20,i.statsLabel$))("stats",ul(14,22,i.stats$))}},directives:[mIe,yIe,wIe],pipes:[iE],styles:[".container[_ngcontent-%COMP%]{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:flex;flex-direction:row;padding:1rem;font-family:Inter;font-size:.95rem;line-height:1.5;text-align:left;position:relative;background-color:#fff;color:#000}.container[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{width:auto;flex-grow:1}.container[_ngcontent-%COMP%] .right[_ngcontent-%COMP%]{margin-left:2rem;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:29rem}"],changeDetection:0}),n})();function TIe(n,e){1&n&&wi(0,"ccf-root")}function DIe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){const i=KB_json(n);if(t(i))return i}else if(t(n))return n;throw new Error("Invalid data sources")}function MIe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){if(!(null==n?void 0:n.startsWith("[")))return[n];{const i=KB_json(n);if(t(i))return i}}else if(t(n))return n;throw new Error("Invalid data sources")}let IIe=(()=>{class n extends qne{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},$d.dbOptions),globalThis.dbOptions),parse:{dataSources:DIe,highlightProviders:MIe}}),this.sex="Female",this.side="Left"}}return n.\u0275fac=function(t){return new(t||n)(De(cx),De(ts))},n.\u0275cmp=_n({type:n,selectors:[["ccf-root-wc"]],inputs:{organIri:"organIri",sex:"sex",side:"side",dataSources:"dataSources",highlightProviders:"highlightProviders",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl"},features:[Dn],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&Ai(0,TIe,1,0,"ccf-root",0),2&t&&on("ngIf",i.initialized)},directives:[Mu,AIe],encapsulation:2,changeDetection:0}),n})(),OIe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[os,Ba,L$,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(os,2),Ie(Ba,2))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const mx=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class PIe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=Of(this.action),i=function(n){return mx(n.getHours(),2)+":"+mx(n.getMinutes(),2)+":"+mx(n.getSeconds(),2)+"."+mx(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class FIe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const dW=new zt("NGXS_LOGGER_PLUGIN_OPTIONS");let LIe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new FIe(this._options),this._store=this._store||this._injector.get(ih);const s=new PIe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(jr(o=>{s.completed(o)}),Xl(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(dW),Ie(zn))},n.\u0275prov=$e({token:n,factory:n.\u0275fac}),n})();const hW=new zt("LOGGER_USER_OPTIONS");function kIe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let BIe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:tH,useClass:LIe,multi:!0},{provide:hW,useValue:t},{provide:dW,useFactory:kIe,deps:[hW]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({}),n})();const jIe=[cx];let fW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[OIe.forRoot(),oa.forRoot(jIe,{developmentMode:!$d.production}),BIe.forRoot({disabled:$d.production})]]}),n})(),VIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,dIe]]}),n})(),UIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,mDe,VIe]]}),n})(),zIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr,FE]]}),n})(),HIe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({imports:[[Kr]]}),n})(),GIe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ol).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new qJ(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends KJ{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(IIe,{injector:this.injector});customElements.define("ccf-organ-info",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(zn))},n.\u0275mod=ln({type:n}),n.\u0275inj=bt({providers:[],imports:[[UD,zIe,HIe,UIe,fW,fW,Gne.forRoot({gaToken:$d.googleAnalyticsToken,appName:"organ-info",projectName:"ccf",developmentMode:!$d.production})]]}),n})();$d.production&&function(){if(gk)throw new Error("Cannot enable prod mode after platform setup.");pk=!1}(),mJ().bootstrapModule(GIe).catch(n=>console.error(n))},52:jt=>{function it(gt,J,xt,ut,Y,Ae,he){try{var W=gt[Ae](he),V=W.value}catch(L){return void xt(L)}W.done?J(V):Promise.resolve(V).then(ut,Y)}jt.exports=function(gt){return function(){var J=this,xt=arguments;return new Promise(function(ut,Y){var Ae=gt.apply(J,xt);function he(V){it(Ae,ut,Y,he,W,"next",V)}function W(V){it(Ae,ut,Y,he,W,"throw",V)}he(void 0)})}},jt.exports.default=jt.exports,jt.exports.__esModule=!0},948:jt=>{jt.exports=function(tt){return tt&&tt.__esModule?tt:{default:tt}},jt.exports.default=jt.exports,jt.exports.__esModule=!0},321:jt=>{function it(tt){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(jt.exports=it=function(J){return typeof J},jt.exports.default=jt.exports,jt.exports.__esModule=!0):(jt.exports=it=function(J){return J&&"function"==typeof Symbol&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},jt.exports.default=jt.exports,jt.exports.__esModule=!0),it(tt)}jt.exports=it,jt.exports.default=jt.exports,jt.exports.__esModule=!0},82:jt=>{function it(tt){return Promise.resolve().then(()=>{var gt=new Error("Cannot find module '"+tt+"'");throw gt.code="MODULE_NOT_FOUND",gt})}it.keys=()=>[],it.resolve=it,it.id=82,jt.exports=it},521:()=>{},125:()=>{},307:()=>{}},jt=>{jt(jt.s=289)}]); \ No newline at end of file diff --git a/rui/index.html b/rui/index.html index 663dfe99b..7e1253e0b 100644 --- a/rui/index.html +++ b/rui/index.html @@ -67,7 +67,7 @@ - + diff --git a/wc.js b/wc.js index 15eb557da..200abdb7a 100644 --- a/wc.js +++ b/wc.js @@ -2,4 +2,4 @@ (self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[429],{24138:function(){!function(){"use strict";!function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}()}()},24192:function(){!function(e,t){"use strict";function n(){var e=M.splice(0,M.length);for(nt=0;e.length;)e.shift().call(null,e.shift())}function o(e,t){for(var n=0,o=e.length;n1)&&_(this)}}}),Fe(a,W,{value:function(e){-1>0,x="__"+R+F,V="addEventListener",U="attached",q="Callback",B="detached",G="extends",W="attributeChanged"+q,$=U+q,X="connected"+q,Y="disconnected"+q,K="created"+q,J=B+q,Q="ADDITION",ee="REMOVAL",te="DOMAttrModified",ne="DOMContentLoaded",oe="DOMSubtreeModified",re="<",ae="=",ie=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,se=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],ce=[],le=[],ue="",he=E.documentElement,pe=ce.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},fe=b.prototype,de=fe.hasOwnProperty,me=fe.isPrototypeOf,ge=b.defineProperty,Te=[],ye=b.getOwnPropertyDescriptor,_e=b.getOwnPropertyNames,ke=b.getPrototypeOf,ve=b.setPrototypeOf,Ee=!!b.__proto__,be="__dreCEv1",we=e.customElements,Me=!/^force/.test(t.type)&&!!(we&&we.define&&we.get&&we.whenDefined),Le=b.create||b,Ce=e.Map||function(){var e,t=[],n=[];return{get:function(e){return n[pe.call(t,e)]},set:function(o,r){(e=pe.call(t,o))<0?n[t.push(o)-1]=r:n[e]=r}}},He=e.Promise||function(e){function t(e){for(o=!0;n.length;)n.shift()(e)}var n=[],o=!1,r={catch:function(){return r},then:function(e){return n.push(e),o&&setTimeout(t,1),r}};return e(t),r},Oe=!1,Se=Le(null),De=Le(null),Ze=new Ce,Pe=function(e){return e.toLowerCase()},Ne=b.create||function e(t){return t?(e.prototype=t,new e):this},ze=ve||(Ee?function(e,t){return e.__proto__=t,e}:_e&&ye?function(){function e(e,t){for(var n,o=_e(t),r=0,a=o.length;r
    ",new Ie(function(e,t){if(e[0]&&"childList"==e[0].type&&!e[0].removedNodes[0].childNodes.length){var n=(P=ye(je,"innerHTML"))&&P.set;n&&ge(je,"innerHTML",{set:function(e){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,e)}})}t.disconnect(),P=null}).observe(P,{childList:!0,subtree:!0}),P.innerHTML=""),ot||(ve||Ee?(D=function(e,t){me.call(t,e)||p(e,t)},Z=p):Z=D=function(e,t){e[x]||(e[x]=b(!0),p(e,t))},Re?(it=!1,N=ye(je,V),z=N.value,I=function(e){var t=new CustomEvent(te,{bubbles:!0});t.attrName=e,t.prevValue=We.call(this,e),t.newValue=null,t[ee]=t.attrChange=2,Xe.call(this,e),Ge.call(this,t)},A=function(e,t){var n=$e.call(this,e),o=n&&We.call(this,e),r=new CustomEvent(te,{bubbles:!0});Ye.call(this,e,t),r.attrName=e,r.prevValue=n?o:null,r.newValue=t,n?r.MODIFICATION=r.attrChange=1:r[Q]=r.attrChange=0,Ge.call(this,r)},j=function(e){var t,n=e.currentTarget,o=n[x],r=e.propertyName;o.hasOwnProperty(r)&&(o=o[r],(t=new CustomEvent(te,{bubbles:!0})).attrName=o.name,t.prevValue=o.value||null,t.newValue=o.value=n[r]||null,null==t.prevValue?t[Q]=t.attrChange=0:t.MODIFICATION=t.attrChange=1,Ge.call(n,t))},N.value=function(e,t,n){e===te&&this[W]&&this.setAttribute!==A&&(this[x]={className:{name:"class",value:this.className}},this.setAttribute=A,this.removeAttribute=I,z.call(this,"propertychange",j)),z.call(this,e,t,n)},ge(je,V,N)):Ie||(he[V](te,tt),he.setAttribute(x,1),he.removeAttribute(x),it&&(L=function(e){var t,n,o,r=this;if(r===e.target){for(o in t=r[x],r[x]=n=H(r),n){if(!(o in t))return C(0,r,o,t[o],n[o],Q);if(n[o]!==t[o])return C(1,r,o,t[o],n[o],"MODIFICATION")}for(o in t)if(!(o in n))return C(2,r,o,t[o],n[o],ee)}},C=function(e,t,n,o,r,a){var i={attrChange:e,currentTarget:t,attrName:n,prevValue:o,newValue:r};i[a]=e,s(i)},H=function(e){for(var t,n,o={},r=e.attributes,a=0,i=r.length;a$");if(n[G]="a",(t.prototype=Ne(Ae.prototype)).constructor=t,e.customElements.define(o,t,n),!r.test(E.createElement("a",{is:o}).outerHTML)||!r.test((new t).outerHTML))throw n}(function e(){return Reflect.construct(Ae,[],e)},{},"document-register-element-a"+F)}catch(N){v()}if(!t.noBuiltIn)try{if(Ke.call(E,"a","a").outerHTML.indexOf("is")<0)throw{}}catch(N){Pe=function(e){return{is:e.toLowerCase()}}}}(window)},7277:function(){"use strict";!function(e){const t=e.performance;function n(e){t&&t.mark&&t.mark(e)}function o(e,n){t&&t.measure&&t.measure(e,n)}n("Zone");const r=e.__Zone_symbol_prefix||"__zone_symbol__";function a(e){return r+e}const i=!0===e[a("forceDuplicateZoneCheck")];if(e.Zone){if(i||"function"!=typeof e.Zone.__symbol__)throw new Error("Zone already loaded.");return e.Zone}let s=(()=>{class t{constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"",this._properties=t&&t.properties||{},this._zoneDelegate=new l(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(e.Promise!==O.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=t.current;for(;e.parent;)e=e.parent;return e}static get current(){return D.zone}static get currentTask(){return Z}static __load_patch(r,a,s=!1){if(O.hasOwnProperty(r)){if(!s&&i)throw Error("Already loaded patch: "+r)}else if(!e["__Zone_disable_"+r]){const i="Zone:"+r;n(i),O[r]=a(e,t,S),o(i,i)}}get parent(){return this._parent}get name(){return this._name}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const n=this._zoneDelegate.intercept(this,e,t),o=this;return function(){return o.runGuarded(n,this,arguments,t)}}run(e,t,n,o){D={parent:D,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,o)}finally{D=D.parent}}runGuarded(e,t=null,n,o){D={parent:D,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,o)}catch(r){if(this._zoneDelegate.handleError(this,r))throw r}}finally{D=D.parent}}runTask(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||_).name+"; Execution: "+this.name+")");if(e.state===k&&(e.type===H||e.type===C))return;const o=e.state!=b;o&&e._transitionTo(b,E),e.runCount++;const r=Z;Z=e,D={parent:D,zone:this};try{e.type==C&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(a){if(this._zoneDelegate.handleError(this,a))throw a}}finally{e.state!==k&&e.state!==M&&(e.type==H||e.data&&e.data.isPeriodic?o&&e._transitionTo(E,b):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(k,b,k))),D=D.parent,Z=r}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(v,k);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(n){throw e._transitionTo(M,v,k),this._zoneDelegate.handleError(this,n),n}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==v&&e._transitionTo(E,v),e}scheduleMicroTask(e,t,n,o){return this.scheduleTask(new u(L,e,t,n,o,void 0))}scheduleMacroTask(e,t,n,o,r){return this.scheduleTask(new u(C,e,t,n,o,r))}scheduleEventTask(e,t,n,o,r){return this.scheduleTask(new u(H,e,t,n,o,r))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||_).name+"; Execution: "+this.name+")");e._transitionTo(w,E,b);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(M,w),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(k,w),e.runCount=0,e}_updateTaskCount(e,t){const n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let o=0;oe.hasTask(n,o),onScheduleTask:(e,t,n,o)=>e.scheduleTask(n,o),onInvokeTask:(e,t,n,o,r,a)=>e.invokeTask(n,o,r,a),onCancelTask:(e,t,n,o)=>e.cancelTask(n,o)};class l{constructor(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const o=n&&n.onHasTask;(o||t&&t._hasTaskZS)&&(this._hasTaskZS=o?n:c,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=e,n.onScheduleTask||(this._scheduleTaskZS=c,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=c,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=c,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new s(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,o,r){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,o,r):t.apply(n,o)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=L)throw new Error("Task is missing scheduleFn.");T(t)}return n}invokeTask(e,t,n,o){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,o):t.callback.apply(n,o)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}}_updateTaskCount(e,t){const n=this._taskCounts,o=n[e],r=n[e]=o+t;if(r<0)throw new Error("More tasks executed then were scheduled.");0!=o&&0!=r||this.hasTask(this.zone,{microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e})}}class u{constructor(t,n,o,r,a,i){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=t,this.source=n,this.data=r,this.scheduleFn=a,this.cancelFn=i,!o)throw new Error("callback is not defined");this.callback=o;const s=this;this.invoke=t===H&&r&&r.useG?u.invokeTask:function(){return u.invokeTask.call(e,s,this,arguments)}}static invokeTask(e,t,n){e||(e=this),P++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==P&&y(),P--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(k,v)}_transitionTo(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=e,e==k&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const h=a("setTimeout"),p=a("Promise"),f=a("then");let d,m=[],g=!1;function T(t){if(0===P&&0===m.length)if(d||e[p]&&(d=e[p].resolve(0)),d){let e=d[f];e||(e=d.then),e.call(d,y)}else e[h](y,0);t&&m.push(t)}function y(){if(!g){for(g=!0;m.length;){const t=m;m=[];for(let n=0;nD,onUnhandledError:N,microtaskDrainDone:N,scheduleMicroTask:T,showUncaughtError:()=>!s[a("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:N,patchMethod:()=>N,bindArguments:()=>[],patchThen:()=>N,patchMacroTask:()=>N,patchEventPrototype:()=>N,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>N,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>N,wrapWithCurrentZone:()=>N,filterProperties:()=>[],attachOriginToPatched:()=>N,_redefineProperty:()=>N,patchCallbacks:()=>N};let D={parent:null,zone:new s(null,null)},Z=null,P=0;function N(){}o("Zone","Zone"),e.Zone=s}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global);const e=Object.getOwnPropertyDescriptor,t=Object.defineProperty,n=Object.getPrototypeOf,o=Object.create,r=Array.prototype.slice,a="addEventListener",i="removeEventListener",s=Zone.__symbol__(a),c=Zone.__symbol__(i),l="true",u="false",h=Zone.__symbol__("");function p(e,t){return Zone.current.wrap(e,t)}function f(e,t,n,o,r){return Zone.current.scheduleMacroTask(e,t,n,o,r)}const d=Zone.__symbol__,m="undefined"!=typeof window,g=m?window:void 0,T=m&&g||"object"==typeof self&&self||global,y=[null];function _(e,t){for(let n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=p(e[n],t+"_"+n));return e}function k(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const v="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,E=!("nw"in T)&&void 0!==T.process&&"[object process]"==={}.toString.call(T.process),b=!E&&!v&&!(!m||!g.HTMLElement),w=void 0!==T.process&&"[object process]"==={}.toString.call(T.process)&&!v&&!(!m||!g.HTMLElement),M={},L=function(e){if(!(e=e||T.event))return;let t=M[e.type];t||(t=M[e.type]=d("ON_PROPERTY"+e.type));const n=this||e.target||T,o=n[t];let r;if(b&&n===g&&"error"===e.type){const t=e;r=o&&o.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===r&&e.preventDefault()}else r=o&&o.apply(this,arguments),null!=r&&!r&&e.preventDefault();return r};function C(n,o,r){let a=e(n,o);if(!a&&r&&e(r,o)&&(a={enumerable:!0,configurable:!0}),!a||!a.configurable)return;const i=d("on"+o+"patched");if(n.hasOwnProperty(i)&&n[i])return;delete a.writable,delete a.value;const s=a.get,c=a.set,l=o.substr(2);let u=M[l];u||(u=M[l]=d("ON_PROPERTY"+l)),a.set=function(e){let t=this;!t&&n===T&&(t=T),t&&(t[u]&&t.removeEventListener(l,L),c&&c.apply(t,y),"function"==typeof e?(t[u]=e,t.addEventListener(l,L,!1)):t[u]=null)},a.get=function(){let e=this;if(!e&&n===T&&(e=T),!e)return null;const t=e[u];if(t)return t;if(s){let t=s&&s.call(this);if(t)return a.set.call(this,t),"function"==typeof e.removeAttribute&&e.removeAttribute(o),t}return null},t(n,o,a),n[i]=!0}function H(e,t,n){if(t)for(let o=0;ofunction(t,o){const a=n(t,o);return a.cbIdx>=0&&"function"==typeof o[a.cbIdx]?f(a.name,o[a.cbIdx],a,r):e.apply(t,o)})}function P(e,t){e[d("OriginalDelegate")]=t}let N=!1,z=!1;function I(){if(N)return z;N=!0;try{const e=g.navigator.userAgent;(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/"))&&(z=!0)}catch(e){}return z}Zone.__load_patch("ZoneAwarePromise",(e,t,n)=>{const o=Object.getOwnPropertyDescriptor,r=Object.defineProperty,a=n.symbol,i=[],s=!0===e[a("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],c=a("Promise"),l=a("then");n.onUnhandledError=e=>{if(n.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;i.length;){const t=i.shift();try{t.zone.runGuarded(()=>{throw t.throwOriginal?t.rejection:t})}catch(e){h(e)}}};const u=a("unhandledPromiseRejectionHandler");function h(e){n.onUnhandledError(e);try{const n=t[u];"function"==typeof n&&n.call(this,e)}catch(o){}}function p(e){return e&&e.then}function f(e){return e}function d(e){return S.reject(e)}const m=a("state"),g=a("value"),T=a("finally"),y=a("parentPromiseValue"),_=a("parentPromiseState"),k=null,v=!0,E=!1;function b(e,t){return n=>{try{M(e,t,n)}catch(o){M(e,!1,o)}}}const w=a("currentTaskTrace");function M(e,o,a){const c=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}}();if(e===a)throw new TypeError("Promise resolved with itself");if(e[m]===k){let h=null;try{("object"==typeof a||"function"==typeof a)&&(h=a&&a.then)}catch(l){return c(()=>{M(e,!1,l)})(),e}if(o!==E&&a instanceof S&&a.hasOwnProperty(m)&&a.hasOwnProperty(g)&&a[m]!==k)C(a),M(e,a[m],a[g]);else if(o!==E&&"function"==typeof h)try{h.call(a,c(b(e,o)),c(b(e,!1)))}catch(l){c(()=>{M(e,!1,l)})()}else{e[m]=o;const c=e[g];if(e[g]=a,e[T]===T&&o===v&&(e[m]=e[_],e[g]=e[y]),o===E&&a instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&r(a,w,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t{try{const o=e[g],r=!!n&&T===n[T];r&&(n[y]=o,n[_]=a);const s=t.run(i,void 0,r&&i!==d&&i!==f?[]:[o]);M(n,!0,s)}catch(o){M(n,!1,o)}},n)}const O=function(){};class S{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return M(new this(null),v,e)}static reject(e){return M(new this(null),E,e)}static race(e){let t,n,o=new this((e,o)=>{t=e,n=o});function r(e){t(e)}function a(e){n(e)}for(let i of e)p(i)||(i=this.resolve(i)),i.then(r,a);return o}static all(e){return S.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof S?this:S).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let n,o,r=new this((e,t)=>{n=e,o=t}),a=2,i=0;const s=[];for(let l of e){p(l)||(l=this.resolve(l));const e=i;try{l.then(o=>{s[e]=t?t.thenCallback(o):o,a--,0===a&&n(s)},r=>{t?(s[e]=t.errorCallback(r),a--,0===a&&n(s)):o(r)})}catch(c){o(c)}a++,i++}return a-=2,0===a&&n(s),r}constructor(e){const t=this;if(!(t instanceof S))throw new Error("Must be an instanceof Promise.");t[m]=k,t[g]=[];try{e&&e(b(t,v),b(t,E))}catch(n){M(t,!1,n)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return S}then(e,n){let o=this.constructor[Symbol.species];(!o||"function"!=typeof o)&&(o=this.constructor||S);const r=new o(O),a=t.current;return this[m]==k?this[g].push(a,r,e,n):H(this,a,r,e,n),r}catch(e){return this.then(null,e)}finally(e){let n=this.constructor[Symbol.species];(!n||"function"!=typeof n)&&(n=S);const o=new n(O);o[T]=T;const r=t.current;return this[m]==k?this[g].push(r,o,e,e):H(this,r,o,e,e),o}}S.resolve=S.resolve,S.reject=S.reject,S.race=S.race,S.all=S.all;const Z=e[c]=e.Promise;e.Promise=S;const P=a("thenPatched");function N(e){const t=e.prototype,n=o(t,"then");if(n&&(!1===n.writable||!n.configurable))return;const r=t.then;t[l]=r,e.prototype.then=function(e,t){return new S((e,t)=>{r.call(this,e,t)}).then(e,t)},e[P]=!0}return n.patchThen=N,Z&&(N(Z),D(e,"fetch",e=>function(e){return function(t,n){let o=e.apply(t,n);if(o instanceof S)return o;let r=o.constructor;return r[P]||N(r),o}}(e))),Promise[t.__symbol__("uncaughtPromiseErrors")]=i,S}),Zone.__load_patch("toString",e=>{const t=Function.prototype.toString,n=d("OriginalDelegate"),o=d("Promise"),r=d("Error"),a=function(){if("function"==typeof this){const a=this[n];if(a)return"function"==typeof a?t.call(a):Object.prototype.toString.call(a);if(this===Promise){const n=e[o];if(n)return t.call(n)}if(this===Error){const n=e[r];if(n)return t.call(n)}}return t.call(this)};a[n]=t,Function.prototype.toString=a;const i=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":i.call(this)}});let A=!1;if("undefined"!=typeof window)try{const e=Object.defineProperty({},"passive",{get:function(){A=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(ce){A=!1}const j={useG:!0},R={},F={},x=new RegExp("^"+h+"(\\w+)(true|false)$"),V=d("propagationStopped");function U(e,t){const n=(t?t(e):e)+u,o=(t?t(e):e)+l,r=h+n,a=h+o;R[e]={},R[e][u]=r,R[e][l]=a}function q(e,t,o){const r=o&&o.add||a,s=o&&o.rm||i,c=o&&o.listeners||"eventListeners",p=o&&o.rmAll||"removeAllListeners",f=d(r),m="."+r+":",g=function(e,t,n){if(e.isRemoved)return;const o=e.callback;"object"==typeof o&&o.handleEvent&&(e.callback=e=>o.handleEvent(e),e.originalDelegate=o),e.invoke(e,t,[n]);const r=e.options;r&&"object"==typeof r&&r.once&&t[s].call(t,n.type,e.originalDelegate?e.originalDelegate:e.callback,r)},T=function(t){if(!(t=t||e.event))return;const n=this||t.target||e,o=n[R[t.type][u]];if(o)if(1===o.length)g(o[0],n,t);else{const e=o.slice();for(let o=0;ofunction(t,n){t[V]=!0,e&&e.apply(t,n)})}function W(e,t,n,o,r){const a=Zone.__symbol__(o);if(t[a])return;const i=t[a]=t[o];t[o]=function(a,s,c){return s&&s.prototype&&r.forEach(function(t){const r=`${n}.${o}::`+t,a=s.prototype;if(a.hasOwnProperty(t)){const n=e.ObjectGetOwnPropertyDescriptor(a,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,r),e._redefineProperty(s.prototype,t,n)):a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],r))}else a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],r))}),i.call(t,a,s,c)},e.attachOriginToPatched(t[o],i)}const $=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplayconnected","vrdisplaydisconnected","vrdisplaypresentchange"],X=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],Y=["load"],K=["blur","error","focus","load","resize","scroll","messageerror"],J=["bounce","finish","start"],Q=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],ee=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],te=["close","error","open","message"],ne=["error","message"],oe=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"].concat(["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],["autocomplete","autocompleteerror"],["toggle"],["afterscriptexecute","beforescriptexecute","DOMContentLoaded","freeze","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange","resume"],$,["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"]);function re(e,t,n){if(!n||0===n.length)return t;const o=n.filter(t=>t.target===e);if(!o||0===o.length)return t;const r=o[0].ignoreProperties;return t.filter(e=>-1===r.indexOf(e))}function ae(e,t,n,o){e&&H(e,re(e,t,n),o)}Zone.__load_patch("util",(n,s,c)=>{c.patchOnProperties=H,c.patchMethod=D,c.bindArguments=_,c.patchMacroTask=Z;const f=s.__symbol__("BLACK_LISTED_EVENTS"),d=s.__symbol__("UNPATCHED_EVENTS");n[d]&&(n[f]=n[d]),n[f]&&(s[f]=s[d]=n[f]),c.patchEventPrototype=G,c.patchEventTarget=q,c.isIEOrEdge=I,c.ObjectDefineProperty=t,c.ObjectGetOwnPropertyDescriptor=e,c.ObjectCreate=o,c.ArraySlice=r,c.patchClass=S,c.wrapWithCurrentZone=p,c.filterProperties=re,c.attachOriginToPatched=P,c._redefineProperty=Object.defineProperty,c.patchCallbacks=W,c.getGlobalObjects=()=>({globalSources:F,zoneSymbolEventNames:R,eventNames:oe,isBrowser:b,isMix:w,isNode:E,TRUE_STR:l,FALSE_STR:u,ZONE_SYMBOL_PREFIX:h,ADD_EVENT_LISTENER_STR:a,REMOVE_EVENT_LISTENER_STR:i})});const ie=d("zoneTask");function se(e,t,n,o){let r=null,a=null;n+=o;const i={};function s(t){const n=t.data;return n.args[0]=function(){return t.invoke.apply(this,arguments)},n.handleId=r.apply(e,n.args),t}function c(t){return a.call(e,t.data.handleId)}r=D(e,t+=o,n=>function(r,a){if("function"==typeof a[0]){const e={isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?a[1]||0:void 0,args:a},n=a[0];a[0]=function(){try{return n.apply(this,arguments)}finally{e.isPeriodic||("number"==typeof e.handleId?delete i[e.handleId]:e.handleId&&(e.handleId[ie]=null))}};const r=f(t,a[0],e,s,c);if(!r)return r;const l=r.data.handleId;return"number"==typeof l?i[l]=r:l&&(l[ie]=r),l&&l.ref&&l.unref&&"function"==typeof l.ref&&"function"==typeof l.unref&&(r.ref=l.ref.bind(l),r.unref=l.unref.bind(l)),"number"==typeof l||l?l:r}return n.apply(e,a)}),a=D(e,n,t=>function(n,o){const r=o[0];let a;"number"==typeof r?a=i[r]:(a=r&&r[ie],a||(a=r)),a&&"string"==typeof a.type?"notScheduled"!==a.state&&(a.cancelFn&&a.data.isPeriodic||0===a.runCount)&&("number"==typeof r?delete i[r]:r&&(r[ie]=null),a.zone.cancelTask(a)):t.apply(e,o)})}Zone.__load_patch("legacy",e=>{const t=e[Zone.__symbol__("legacyPatch")];t&&t()}),Zone.__load_patch("queueMicrotask",(e,t,n)=>{n.patchMethod(e,"queueMicrotask",e=>function(e,n){t.current.scheduleMicroTask("queueMicrotask",n[0])})}),Zone.__load_patch("timers",e=>{const t="set",n="clear";se(e,t,n,"Timeout"),se(e,t,n,"Interval"),se(e,t,n,"Immediate")}),Zone.__load_patch("requestAnimationFrame",e=>{se(e,"request","cancel","AnimationFrame"),se(e,"mozRequest","mozCancel","AnimationFrame"),se(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(e,t)=>{const n=["alert","prompt","confirm"];for(let o=0;ofunction(o,a){return t.current.run(n,e,a,r)})}),Zone.__load_patch("EventTarget",(e,t,n)=>{(function(e,t){t.patchEventPrototype(e,t)})(e,n),function(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:o,TRUE_STR:r,FALSE_STR:a,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let c=0;c{S("MutationObserver"),S("WebKitMutationObserver")}),Zone.__load_patch("IntersectionObserver",(e,t,n)=>{S("IntersectionObserver")}),Zone.__load_patch("FileReader",(e,t,n)=>{S("FileReader")}),Zone.__load_patch("on_property",(e,t,o)=>{!function(e,t){if(E&&!w||Zone[e.symbol("patchEvents")])return;const o="undefined"!=typeof WebSocket,r=t.__Zone_ignore_on_properties;if(b){const t=window,o=function(){try{const e=g.navigator.userAgent;if(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/"))return!0}catch(e){}return!1}()?[{target:t,ignoreProperties:["error"]}]:[];ae(t,oe.concat(["messageerror"]),r&&r.concat(o),n(t)),ae(Document.prototype,oe,r),void 0!==t.SVGElement&&ae(t.SVGElement.prototype,oe,r),ae(Element.prototype,oe,r),ae(HTMLElement.prototype,oe,r),ae(HTMLMediaElement.prototype,X,r),ae(HTMLFrameSetElement.prototype,$.concat(K),r),ae(HTMLBodyElement.prototype,$.concat(K),r),ae(HTMLFrameElement.prototype,Y,r),ae(HTMLIFrameElement.prototype,Y,r);const a=t.HTMLMarqueeElement;a&&ae(a.prototype,J,r);const i=t.Worker;i&&ae(i.prototype,ne,r)}const a=t.XMLHttpRequest;a&&ae(a.prototype,Q,r);const i=t.XMLHttpRequestEventTarget;i&&ae(i&&i.prototype,Q,r),"undefined"!=typeof IDBIndex&&(ae(IDBIndex.prototype,ee,r),ae(IDBRequest.prototype,ee,r),ae(IDBOpenDBRequest.prototype,ee,r),ae(IDBDatabase.prototype,ee,r),ae(IDBTransaction.prototype,ee,r),ae(IDBCursor.prototype,ee,r)),o&&ae(WebSocket.prototype,te,r)}(o,e)}),Zone.__load_patch("customElements",(e,t,n)=>{!function(e,t){const{isBrowser:n,isMix:o}=t.getGlobalObjects();(n||o)&&e.customElements&&"customElements"in e&&t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback"])}(e,n)}),Zone.__load_patch("XHR",(e,t)=>{!function(e){const u=e.XMLHttpRequest;if(!u)return;const h=u.prototype;let p=h[s],m=h[c];if(!p){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;p=e[s],m=e[c]}}const g="readystatechange",T="scheduled";function y(e){const o=e.data,i=o.target;i[a]=!1,i[l]=!1;const u=i[r];p||(p=i[s],m=i[c]),u&&m.call(i,g,u);const h=i[r]=()=>{if(i.readyState===i.DONE)if(!o.aborted&&i[a]&&e.state===T){const n=i[t.__symbol__("loadfalse")];if(0!==i.status&&n&&n.length>0){const r=e.invoke;e.invoke=function(){const n=i[t.__symbol__("loadfalse")];for(let t=0;tfunction(e,t){return e[o]=0==t[2],e[i]=t[1],v.apply(e,t)}),E=d("fetchTaskAborting"),b=d("fetchTaskScheduling"),w=D(h,"send",()=>function(e,n){if(!0===t.current[b]||e[o])return w.apply(e,n);{const t={target:e,url:e[i],isPeriodic:!1,args:n,aborted:!1},o=f("XMLHttpRequest.send",_,t,y,k);e&&!0===e[l]&&!t.aborted&&o.state===T&&o.invoke()}}),M=D(h,"abort",()=>function(e,o){const r=function(e){return e[n]}(e);if(r&&"string"==typeof r.type){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}else if(!0===t.current[E])return M.apply(e,o)})}(e);const n=d("xhrTask"),o=d("xhrSync"),r=d("xhrListener"),a=d("xhrScheduled"),i=d("xhrURL"),l=d("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",t=>{t.navigator&&t.navigator.geolocation&&function(t,n){const o=t.constructor.name;for(let r=0;r{const t=function(){return e.apply(this,_(arguments,o+"."+a))};return P(t,e),t})(i)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(e,t)=>{function n(t){return function(n){B(e,t).forEach(o=>{const r=e.PromiseRejectionEvent;if(r){const e=new r(t,{promise:n.promise,reason:n.rejection});o.invoke(e)}})}}e.PromiseRejectionEvent&&(t[d("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[d("rejectionHandledHandler")]=n("rejectionhandled"))})},91817:function(e,t,n){"use strict";n(7277),n(24192),n(24138)}},function(e){e(e.s=91817)}]); /*! (C) Andrea Giammarchi - @WebReflection - ISC Style License */ !function(e,t){"use strict";function n(){var e=C.splice(0,C.length);for(We=0;e.length;)e.shift().call(null,e.shift())}function r(e,t){for(var n=0,r=e.length;n1)&&E(this)}}}),Pe(l,B,{value:function(e){-1>0,R="__"+V+P,U="addEventListener",_="attached",k="Callback",x="detached",q="extends",B="attributeChanged"+k,Z=_+k,j="connected"+k,G="disconnected"+k,z="created"+k,K=x+k,X="ADDITION",$="REMOVAL",Q="DOMAttrModified",W="DOMContentLoaded",Y="DOMSubtreeModified",J="<",ee="=",te=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ne=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],re=[],oe=[],le="",ae=g.documentElement,ie=re.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},ue=b.prototype,ce=ue.hasOwnProperty,se=ue.isPrototypeOf,me=b.defineProperty,fe=[],de=b.getOwnPropertyDescriptor,pe=b.getOwnPropertyNames,he=b.getPrototypeOf,Te=b.setPrototypeOf,Le=!!b.__proto__,Me="__dreCEv1",Ee=e.customElements,ve=!/^force/.test(t.type)&&!!(Ee&&Ee.define&&Ee.get&&Ee.whenDefined),He=b.create||b,ge=e.Map||function(){var e,t=[],n=[];return{get:function(e){return n[ie.call(t,e)]},set:function(r,o){(e=ie.call(t,r))<0?n[t.push(r)-1]=o:n[e]=o}}},be=e.Promise||function(e){function t(e){for(r=!0;n.length;)n.shift()(e)}var n=[],r=!1,o={catch:function(){return o},then:function(e){return n.push(e),r&&setTimeout(t,1),o}};return e(t),o},ye=!1,Ce=He(null),we=He(null),Ae=new ge,Oe=function(e){return e.toLowerCase()},Ne=b.create||function e(t){return t?(e.prototype=t,new e):this},De=Te||(Le?function(e,t){return e.__proto__=t,e}:pe&&de?function(){function e(e,t){for(var n,r=pe(t),o=0,l=r.length;o
    ",new Ie(function(e,t){if(e[0]&&"childList"==e[0].type&&!e[0].removedNodes[0].childNodes.length){var n=(S=de(Se,"innerHTML"))&&S.set;n&&me(Se,"innerHTML",{set:function(e){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,e)}})}t.disconnect(),S=null}).observe(S,{childList:!0,subtree:!0}),S.innerHTML=""),Ye||(Te||Le?(I=function(e,t){se.call(t,e)||f(e,t)},F=f):F=I=function(e,t){e[R]||(e[R]=b(!0),f(e,t))},Ve?(tt=!1,function(){var e=de(Se,U),t=e.value,n=function(e){var t=new CustomEvent(Q,{bubbles:!0});t.attrName=e,t.prevValue=Be.call(this,e),t.newValue=null,t[$]=t.attrChange=2,je.call(this,e),qe.call(this,t)},r=function(e,t){var n=Ze.call(this,e),r=n&&Be.call(this,e),o=new CustomEvent(Q,{bubbles:!0});Ge.call(this,e,t),o.attrName=e,o.prevValue=n?r:null,o.newValue=t,n?o.MODIFICATION=o.attrChange=1:o[X]=o.attrChange=0,qe.call(this,o)},o=function(e){var t,n=e.currentTarget,r=n[R],o=e.propertyName;r.hasOwnProperty(o)&&(r=r[o],(t=new CustomEvent(Q,{bubbles:!0})).attrName=r.name,t.prevValue=r.value||null,t.newValue=r.value=n[o]||null,null==t.prevValue?t[X]=t.attrChange=0:t.MODIFICATION=t.attrChange=1,qe.call(n,t))};e.value=function(e,l,a){e===Q&&this[B]&&this.setAttribute!==r&&(this[R]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,e,l,a)},me(Se,U,e)}()):Ie||(ae[U](Q,Qe),ae.setAttribute(R,1),ae.removeAttribute(R),tt&&(w=function(e){var t,n,r,o=this;if(o===e.target){for(r in t=o[R],o[R]=n=O(o),n){if(!(r in t))return A(0,o,r,t[r],n[r],X);if(n[r]!==t[r])return A(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return A(2,o,r,t[r],n[r],$)}},A=function(e,t,n,r,o,l){var a={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};a[l]=e,i(a)},O=function(e){for(var t,n,r={},o=e.attributes,l=0,a=o.length;l$");if(n[q]="a",(t.prototype=Ne(Fe.prototype)).constructor=t,e.customElements.define(r,t,n),!o.test(g.createElement("a",{is:r}).outerHTML)||!o.test((new t).outerHTML))throw n}(function e(){return Reflect.construct(Fe,[],e)},{},"document-register-element-a"+P)}catch(e){H()}if(!t.noBuiltIn)try{if(ze.call(g,"a","a").outerHTML.indexOf("is")<0)throw{}}catch(e){Oe=function(e){return{is:e.toLowerCase()}}}}(window); -var oBe=Object.defineProperty,aBe=Object.defineProperties,lBe=Object.getOwnPropertyDescriptors,dT=Object.getOwnPropertySymbols,eX=Object.prototype.hasOwnProperty,tX=Object.prototype.propertyIsEnumerable,Nr=Math.pow,nX=(t,e,n)=>e in t?oBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,bt=(t,e)=>{for(var n in e||(e={}))eX.call(e,n)&&nX(t,n,e[n]);if(dT)for(var n of dT(e))tX.call(e,n)&&nX(t,n,e[n]);return t},ti=(t,e)=>aBe(t,lBe(e)),iX=(t,e)=>{var n={};for(var i in t)eX.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&dT)for(var i of dT(t))e.indexOf(i)<0&&tX.call(t,i)&&(n[i]=t[i]);return n};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{71440:function(t,e,n){var i=n(91052).default;t.exports=function t(e,n,i){function r(o,a){if(!n[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){return r(e[o][1][t]||t)},c,c.exports,t,e,n,i)}return n[o].exports}for(var s=void 0,o=0;o0&&r[r.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0?o-4:o;for(n=0;n>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[u++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l},n.fromByteArray=function(t){for(var e,n=t.length,r=n%3,s=[],o=16383,a=0,l=n-r;al?l:a+o));return 1===r?s.push(i[(e=t[n-1])>>2]+i[e<<4&63]+"=="):2===r&&s.push(i[(e=(t[n-2]<<8)+t[n-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t){return i[t>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}function h(t,e,n){for(var i=[],r=e;r>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}n.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(r>0&&(t.lastNeed=r-1),r):--i=0?(r>0&&(t.lastNeed=r-2),r):--i=0?(r>0&&(2===r?r=0:t.lastNeed=r-3),r):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":4}],6:[function(t,e,n){(function(e){(function(){"use strict";var e=t("base64-js"),i=t("ieee754");n.Buffer=o,n.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function s(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=o.prototype,e}function o(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return a(t,e,n)}function a(t,e,n){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|d(t,e),i=s(n),r=i.write(t,e);return r!==n&&(i=i.slice(0,r)),i}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function d(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(t).length;default:if(r)return i?-1:L(t).length;e=(""+e).toLowerCase(),r=!0}}function p(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return C(this,e,n);case"latin1":case"binary":return O(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function f(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function g(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=o.from(e,i)),o.isBuffer(e))return 0===e.length?-1:m(t,e,n,i,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function m(t,e,n,i,r){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var u=-1;for(s=n;sa&&(n=a-l),s=n;s>=0;s--){for(var h=!0,d=0;dr&&(i=r):i=r;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o>8,r.push(n%256),r.push(i);return r}(e,t.length-n),t,n,i)}function S(t,n,i){return e.fromByteArray(0===n&&i===t.length?t:t.slice(n,i))}function E(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(s=t[r+1]))&&(l=(31&c)<<6|63&s)>127&&(u=l);break;case 3:o=t[r+2],128==(192&(s=t[r+1]))&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=t[r+2],a=t[r+3],128==(192&(s=t[r+1]))&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(i.push((u-=65536)>>>10&1023|55296),u=56320|1023&u),i.push(u),r+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var n="",i=0;ie&&(t+=" ... "),""},o.prototype.compare=function(t,e,n,i,r){if(B(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(e>>>=0),l=Math.min(s,a),c=this.slice(i,r),u=t.slice(e,n),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return y(this,t,e,n);case"ascii":return v(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;ri)&&(n=i);for(var r="",s=e;sn)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,i,r,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function I(t,e,n,i,r,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(t,e,n,r,s){return e=+e,n>>>=0,s||I(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function D(t,e,n,r,s){return e=+e,n>>>=0,s||I(t,0,n,8),i.write(t,e,n,r,52,8),n+8}o.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t],r=1,s=0;++s>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t+--e],r=1;e>0&&(r*=256);)i+=this[t+--e]*r;return i},o.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t],r=1,s=0;++s=(r*=128)&&(i-=Math.pow(2,8*e)),i},o.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var i=e,r=1,s=this[t+--i];i>0&&(r*=256);)s+=this[t+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*e)),s},o.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,i){t=+t,e>>>=0,n>>>=0,i||P(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[e]=255&t;++s>>=0,n>>>=0,i||P(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,s=1;for(this[e+r]=255&t;--r>=0&&(s*=256);)this[e+r]=t/s&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,t,e,n,r-1,-r)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,t,e,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,n){return M(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return M(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,i){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&0!==i&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--s)t[s+e]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,i),e);return r},o.prototype.fill=function(t,e,n,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var r=t.charCodeAt(0);("utf8"===i&&r<128||"latin1"===i)&&(t=r)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function j(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(t,e,n){"use strict";e.exports=function t(e){return null===e||"object"!=typeof e||null!=e.toJSON?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((e,n,i)=>e+(0===i?"":",")+t(void 0===n||"symbol"==typeof n?null:n),"")+"]":"{"+Object.keys(e).sort().reduce((n,i,r)=>void 0===e[i]||"symbol"==typeof e[i]?n:n+(0===n.length?"":",")+t(i)+":"+t(e[i]),"")+"}"}},{}],8:[function(t,e,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(t,e){return new Promise(function(n,i){function r(n){t.removeListener(e,s),i(n)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}b(t,e,s,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&b(t,"error",e,n)}(t,r,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,n,i){var r,s,o;if(c(n),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]),void 0===o)o=s[e]=n,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(r=u(t))>0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,function(t){console&&console.warn&&console.warn(t)}(a)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=d.bind(i);return r.listener=n,i.wrapFn=r,r}function f(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=r[t];if(void 0===l)return!1;if("function"==typeof l)s(l,this,e);else{var c=l.length,u=m(l,c);for(n=0;n=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},{}],9:[function(t,e,n){n.read=function(t,e,n,i,r){var s,o,a=8*r-i-1,l=(1<>1,u=-7,h=n?r-1:0,d=n?-1:1,p=t[e+h];for(h+=d,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=256*s+t[e+h],h+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+h],h+=d,u-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},n.write=function(t,e,n,i,r,s){var o,a,l,c=8*s-r-1,u=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(a=0,o=u):o+h>=1?(a=(e*l-1)*Math.pow(2,r),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<0;t[n+p]=255&o,p+=f,o/=256,c-=8);t[n+p-f]|=128*g}},{}],10:[function(t,e,n){e.exports="function"==typeof Object.create?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},{}],11:[function(t,e,n){"use strict";const{isArray:r,isObject:s,isString:o}=t("./types"),{asArray:a}=t("./util"),{prependBase:l}=t("./url"),c=t("./JsonLdError"),u=t("./ResolvedContext");function h(t){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:t})}function d({context:t,base:e}){if(!t)return;const n=t["@context"];if(o(n))t["@context"]=l(e,n);else if(r(n))for(let i=0;i10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(e))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:e});let i,l;a.add(e);try{l=yield n(e),i=l.document||null,o(i)&&(i=JSON.parse(i))}catch(u){throw new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:e,cause:u})}if(!s(i))throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:e});return i="@context"in i?{"@context":i["@context"]}:{"@context":{}},l.contextUrl&&(r(i["@context"])||(i["@context"]=[i["@context"]]),i["@context"].push(l.contextUrl)),{context:i,remoteDoc:l}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(t,e,n){"use strict";e.exports=class extends Error{constructor(t="An unspecified JSON-LD error occurred.",e="jsonld.Error",n={}){super(t),this.name=e,this.message=t,this.details=n}}},{}],13:[function(t,e,n){"use strict";e.exports=t=>{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(e,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):t.compact(e,n)},e.expand=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):t.expand(e)},e.flatten=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):t.flatten(e)},e}},{}],14:[function(t,e,n){"use strict";e.exports=t("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(t,e,n){"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(t){const e=this;return e._loader=t,function(){return e.add.apply(e,arguments)}}add(t){var e=this;return i(function*(){let n=e._requests[t];if(n)return Promise.resolve(n);n=e._requests[t]=e._loader(t);try{return yield n}finally{delete e._requests[t]}})()}}},{}],16:[function(t,e,n){"use strict";const i=t("lru-cache");e.exports=class{constructor({document:t}){this.document=t,this.cache=new i({max:10})}getProcessed(t){return this.cache.get(t)}setProcessed(t,e){this.cache.set(t,e)}}},{"lru-cache":33}],17:[function(t,e,n){"use strict";const r=t("./JsonLdError"),{isArray:s,isObject:o,isString:a,isUndefined:l}=t("./types"),{isList:c,isValue:u,isGraph:h,isSimpleGraph:d,isSubjectReference:p}=t("./graphTypes"),{expandIri:f,getContextValue:g,isKeyword:m,process:b,processingMode:y}=t("./context"),{removeBase:v,prependBase:_}=t("./url"),{addValue:w,asArray:x,compareShortestLeast:S}=t("./util"),E={};function C(t,e,n){if("@nest"!==f(t,e,{vocab:!0},n))throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=E,E.compact=function(){var t=i(function*({activeCtx:t,activeProperty:e=null,element:n,options:i={},compactionMap:f=(()=>{})}){if(s(n)){let r=[];for(let s=0;s1&&(T=Array.from(T).sort());const k=t;for(const e of T){const n=E.compactIri({activeCtx:k,iri:e,relativeTo:{vocab:!0}}),r=g(S,n,"@context");l(r)||(t=yield b({activeCtx:t,localCtx:r,options:i,propagate:!1}))}const A=Object.keys(n).sort();for(const l of A){const p=n[l];if("@id"!==l)if("@type"!==l)if("@reverse"!==l)if("@preserve"!==l)if("@index"!==l)if("@graph"!==l&&"@list"!==l&&"@included"!==l&&m(l)){const e=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,e,p)}else{if(!s(p))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const e=E.compactIri({activeCtx:t,iri:l,value:p,relativeTo:{vocab:!0},reverse:v}),n=t.mappings.has(e)?t.mappings.get(e)["@nest"]:null;let r=_;n&&(C(t,n,i),o(_[n])||(_[n]={}),r=_[n]),w(r,e,p,{propertyIsArray:!0})}for(const e of p){const n=E.compactIri({activeCtx:t,iri:l,value:e,relativeTo:{vocab:!0},reverse:v}),r=t.mappings.has(n)?t.mappings.get(n)["@nest"]:null;let p=_;r&&(C(t,r,i),o(_[r])||(_[r]={}),p=_[r]);const m=g(t,n,"@container")||[],b=h(e),y=c(e);let S;y?S=e["@list"]:b&&(S=e["@graph"]);let O=yield E.compact({activeCtx:t,activeProperty:n,element:y||b?S:e,options:i,compactionMap:f});if(y){if(s(O)||(O=[O]),m.includes("@list")){w(p,n,O,{valueIsArray:!0,allowDuplicate:!0});continue}O={[E.compactIri({activeCtx:t,iri:"@list",relativeTo:{vocab:!0}})]:O},"@index"in e&&(O[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"])}if(b)if(m.includes("@graph")&&(m.includes("@id")||m.includes("@index")&&d(e))){let r;p.hasOwnProperty(n)?r=p[n]:p[n]=r={};const s=(m.includes("@id")?e["@id"]:e["@index"])||E.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}});w(r,s,O,{propertyIsArray:!i.compactArrays||m.includes("@set")})}else m.includes("@graph")&&d(e)?(s(O)&&O.length>1&&(O={"@included":O}),w(p,n,O,{propertyIsArray:!i.compactArrays||m.includes("@set")})):(s(O)&&1===O.length&&i.compactArrays&&(O=O[0]),O={[E.compactIri({activeCtx:t,iri:"@graph",relativeTo:{vocab:!0}})]:O},"@id"in e&&(O[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e["@id"]),"@index"in e&&(O[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"]),w(p,n,O,{propertyIsArray:!i.compactArrays||m.includes("@set")}));else if(m.includes("@language")||m.includes("@index")||m.includes("@id")||m.includes("@type")){let r,s;if(p.hasOwnProperty(n)?r=p[n]:p[n]=r={},m.includes("@language"))u(O)&&(O=O["@value"]),s=e["@language"];else if(m.includes("@index")){const i=g(t,n,"@index")||"@index",r=E.compactIri({activeCtx:t,iri:i,relativeTo:{vocab:!0}});if("@index"===i)s=e["@index"],delete O[r];else{let t;if([s,...t]=x(O[i]||[]),a(s))switch(t.length){case 0:delete O[i];break;case 1:O[i]=t[0];break;default:O[i]=t}else s=null}}else if(m.includes("@id")){const e=E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}});s=O[e],delete O[e]}else if(m.includes("@type")){const r=E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}});let o;switch([s,...o]=x(O[r]||[]),o.length){case 0:delete O[r];break;case 1:O[r]=o[0];break;default:O[r]=o}1===Object.keys(O).length&&"@id"in e&&(O=yield E.compact({activeCtx:t,activeProperty:n,element:{"@id":e["@id"]},options:i,compactionMap:f}))}s||(s=E.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}})),w(r,s,O,{propertyIsArray:m.includes("@set")})}else{const t=!i.compactArrays||m.includes("@set")||m.includes("@list")||s(O)&&0===O.length||"@list"===l||"@graph"===l;w(p,n,O,{propertyIsArray:t})}}}else{if((g(t,e,"@container")||[]).includes("@index"))continue;const n=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,p)}else{const n=yield E.compact({activeCtx:t,activeProperty:e,element:p,options:i,compactionMap:f});s(n)&&0===n.length||w(_,l,n)}else{const e=yield E.compact({activeCtx:t,activeProperty:"@reverse",element:p,options:i,compactionMap:f});for(const n in e)if(t.mappings.has(n)&&t.mappings.get(n).reverse){const r=e[n],s=(g(t,n,"@container")||[]).includes("@set")||!i.compactArrays;w(_,n,r,{propertyIsArray:s}),delete e[n]}if(Object.keys(e).length>0){const n=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,e)}}else{let e=x(p).map(t=>E.compactIri({activeCtx:S,iri:t,relativeTo:{vocab:!0}}));1===e.length&&(e=e[0]);const n=E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}}),i=(g(t,n,"@container")||[]).includes("@set")&&y(t,1.1)||s(e)&&0===p.length;w(_,n,e,{propertyIsArray:i})}else{let e=x(p).map(e=>E.compactIri({activeCtx:t,iri:e,relativeTo:{vocab:!1},base:i.base}));1===e.length&&(e=e[0]),_[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e}}return _}return n});return function(e){return t.apply(this,arguments)}}(),E.compactIri=({activeCtx:t,iri:e,value:n=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=null})=>{if(null===e)return e;t.isPropertyTermScoped&&t.previousContext&&(t=t.previousContext);const l=t.getInverse();if(m(e)&&e in l&&"@none"in l[e]&&"@type"in l[e]["@none"]&&"@none"in l[e]["@none"]["@type"])return l[e]["@none"]["@type"]["@none"];if(i.vocab&&e in l){const i=t["@language"]||"@none",r=[];o(n)&&"@index"in n&&!("@graph"in n)&&r.push("@index","@index@set"),o(n)&&"@preserve"in n&&(n=n["@preserve"][0]),h(n)?("@index"in n&&r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&r.push("@graph@id","@graph@id@set"),r.push("@graph","@graph@set","@set"),"@index"in n||r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||r.push("@graph@id","@graph@id@set")):o(n)&&!u(n)&&r.push("@id","@id@set","@type","@set@type");let a="@language",l="@null";if(s)a="@type",l="@reverse",r.push("@set");else if(c(n)){"@index"in n||r.push("@list");const t=n["@list"];if(0===t.length)a="@any",l="@none";else{let e=0===t.length?i:null,n=null;for(let i=0;it.includes("_"));t&&a.push(t.replace(/^[^_]+_/,"_"))}a.push("@none");const l=t.inverse[e];for(const o of i){if(!(o in l))continue;const t=l[o][r];for(const e of a)if(e in t)return t[e]}return null}(t,e,n,r,a,l);if(null!==d)return d}if(i.vocab&&"@vocab"in t){const n=t["@vocab"];if(0===e.indexOf(n)&&e!==n){const i=e.substr(n.length);if(!t.mappings.has(i))return i}}let d=null;const p=[];let f=t.fastCurieMap;const g=e.length-1;for(let r=0;r=0;--r){const i=p[r],s=i.terms;for(const r of s){const s=r+":"+e.substr(i.iri.length);t.mappings.get(r)._prefix&&(!t.mappings.has(s)||null===n&&t.mappings.get(s)["@id"]===e)&&(null===d||S(s,d)<0)&&(d=s)}}if(null!==d)return d;for(const[o,c]of t.mappings)if(c&&c._prefix&&e.startsWith(o+":"))throw new r(`Absolute IRI "${e}" confused with prefix "${o}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:t});return i.vocab?e:"@base"in t?t["@base"]?v(_(a,t["@base"]),e):e:v(a,e)},E.compactValue=({activeCtx:t,activeProperty:e,value:n,options:i})=>{if(u(n)){const i=g(t,e,"@type"),r=g(t,e,"@language"),s=g(t,e,"@direction"),o=g(t,e,"@container")||[],l="@index"in n&&!o.includes("@index");if(!l&&"@none"!==i&&(n["@type"]===i||"@language"in n&&n["@language"]===r&&"@direction"in n&&n["@direction"]===s||"@language"in n&&n["@language"]===r||"@direction"in n&&n["@direction"]===s))return n["@value"];const c=Object.keys(n).length,u=1===c||2===c&&"@index"in n&&!l,h="@language"in t,d=a(n["@value"]),p=t.mappings.has(e)&&null===t.mappings.get(e)["@language"];if(u&&"@none"!==i&&(!h||!d||p))return n["@value"];const f={};return l&&(f[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?f[E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:t,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(f[E.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(f[E.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),f[E.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],f}const r=f(t,e,{vocab:!0},i),s=g(t,e,"@type"),o=E.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:"@vocab"===s},base:i.base});return"@id"===s||"@vocab"===s||"@graph"===r?o:{[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]:o}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(t,e,n){"use strict";const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF: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:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},{}],19:[function(t,e,n){"use strict";const r=t("./util"),s=t("./JsonLdError"),{isArray:o,isObject:a,isString:l,isUndefined:c}=t("./types"),{isAbsolute:u,isRelative:h,prependBase:d}=t("./url"),{asArray:p,compareShortestLeast:f}=t("./util"),g=new Map,m=/^@[a-zA-Z]+$/,b={};function y(t,e,n,i,r,s){if(null===e||!l(e)||b.isKeyword(e))return e;if(e.match(m))return null;if(i&&i.hasOwnProperty(e)&&!0!==r.get(e)&&b.createTermDefinition({activeCtx:t,localCtx:i,term:e,defined:r,options:s}),(n=n||{}).vocab){const n=t.mappings.get(e);if(null===n)return null;if(a(n)&&"@id"in n)return n["@id"]}const o=e.indexOf(":");if(o>0){const n=e.substr(0,o),a=e.substr(o+1);if("_"===n||0===a.indexOf("//"))return e;i&&i.hasOwnProperty(n)&&b.createTermDefinition({activeCtx:t,localCtx:i,term:n,defined:r,options:s});const l=t.mappings.get(n);if(l&&l._prefix)return l["@id"]+a;if(u(e))return e}if(n.vocab&&"@vocab"in t)return t["@vocab"]+e;if(n.base&&"@base"in t){if(t["@base"])return d(d(s.base,t["@base"]),e)}else if(n.base)return d(s.base,e);return e}function v(t,e){if(!t||"object"!=typeof t||!e||"object"!=typeof e)return t===e;const n=Array.isArray(t);if(n!==Array.isArray(e))return!1;if(n){if(t.length!==e.length)return!1;for(let n=0;n{if(i.has(n)){if(i.get(n))return;throw new s("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:e,term:n})}let h;if(i.set(n,!1),e.hasOwnProperty(n)&&(h=e[n]),"@type"===n&&a(h)&&"@set"===(h["@container"]||"@set")&&b.processingMode(t,1.1)){const t=["@container","@id","@protected"],i=Object.keys(h);if(0===i.length||i.some(e=>!t.includes(e)))throw new s("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n})}else{if(b.isKeyword(n))throw new s("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n});if(n.match(m))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new s("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:e})}const d=t.mappings.get(n);t.mappings.has(n)&&t.mappings.delete(n);let p=!1;if((l(h)||null===h)&&(p=!0,h={"@id":h}),!a(h))throw new s("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:e});const f={};t.mappings.set(n,f),f.reverse=!1;const g=["@container","@id","@language","@reverse","@type"];b.processingMode(t,1.1)&&g.push("@context","@direction","@index","@nest","@prefix","@protected");for(const o in h)if(!g.includes(o))throw new s("Invalid JSON-LD syntax; a term definition must not contain "+o,"jsonld.SyntaxError",{code:"invalid term definition",context:e});const _=n.indexOf(":");if(f._termHasColon=_>0,"@reverse"in h){if("@id"in h)throw new s("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});if("@nest"in h)throw new s("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});const o=h["@reverse"];if(!l(o))throw new s("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(!b.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:o}),void(d?t.mappings.set(n,d):t.mappings.delete(n));const a=y(t,o,{vocab:!0,base:!1},e,i,r);if(!u(a))throw new s("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:e});f["@id"]=a,f.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!l(o))throw new s("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(null===o)f["@id"]=null;else{if(!b.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:o}),void(d?t.mappings.set(n,d):t.mappings.delete(n));if(o!==n){if(o=y(t,o,{vocab:!0,base:!1},e,i,r),!u(o)&&!b.isKeyword(o))throw new s("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:e});if(n.match(/(?::[^:])|\//)&&y(t,n,{vocab:!0,base:!1},e,new Map(i).set(n,!0),r)!==o)throw new s("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});f["@id"]=o,f._prefix=p&&!f._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in f))if(f._termHasColon){const s=n.substr(0,_);if(e.hasOwnProperty(s)&&b.createTermDefinition({activeCtx:t,localCtx:e,term:s,defined:i,options:r}),t.mappings.has(s)){const e=n.substr(_+1);f["@id"]=t.mappings.get(s)["@id"]+e}else f["@id"]=n}else if("@type"===n)f["@id"]=n;else{if(!("@vocab"in t))throw new s("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e,term:n});f["@id"]=t["@vocab"]+n}if((!0===h["@protected"]||!0===i.get("@protected")&&!1!==h["@protected"])&&(t.protected[n]=!0,f.protected=!0),i.set(n,!0),"@type"in h){let n=h["@type"];if(!l(n))throw new s("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if("@json"===n||"@none"===n){if(b.processingMode(t,1))throw new s(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else if("@id"!==n&&"@vocab"!==n){if(n=y(t,n,{vocab:!0,base:!1},e,i,r),!u(n))throw new s("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if(0===n.indexOf("_:"))throw new s("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}f["@type"]=n}if("@container"in h){const n=l(h["@container"])?[h["@container"]]:h["@container"]||[],i=["@list","@set","@index","@language"];let r=!0;const a=n.includes("@set");if(b.processingMode(t,1.1)){if(i.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new s("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:e})}else if(n.includes("@graph")){if(n.some(t=>"@graph"!==t&&"@id"!==t&&"@index"!==t&&"@set"!==t))throw new s("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:e})}else r&=n.length<=(a?2:1);if(n.includes("@type")&&(f["@type"]=f["@type"]||"@id",!["@id","@vocab"].includes(f["@type"])))throw new s("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else r&=!o(h["@container"]),r&=n.length<=1;if(r&=n.every(t=>i.includes(t)),r&=!(a&&n.includes("@list")),!r)throw new s("Invalid JSON-LD syntax; @context @container value must be one of the following: "+i.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:e});if(f.reverse&&!n.every(t=>["@index","@set"].includes(t)))throw new s("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});f["@container"]=n}if("@index"in h){if(!("@container"in h)||!f["@container"].includes("@index"))throw new s(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});if(!l(h["@index"])||0===h["@index"].indexOf("@"))throw new s(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});f["@index"]=h["@index"]}if("@context"in h&&(f["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let t=h["@language"];if(null!==t&&!l(t))throw new s("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:e});null!==t&&(t=t.toLowerCase()),f["@language"]=t}if("@prefix"in h){if(n.match(/:|\//))throw new s("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:e});if(b.isKeyword(f["@id"]))throw new s("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:e});if("boolean"!=typeof h["@prefix"])throw new s("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:e});f._prefix=!0===h["@prefix"]}if("@direction"in h){const t=h["@direction"];if(null!==t&&"ltr"!==t&&"rtl"!==t)throw new s('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:e});f["@direction"]=t}if("@nest"in h){const t=h["@nest"];if(!l(t)||"@nest"!==t&&0===t.indexOf("@"))throw new s("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:e});f["@nest"]=t}const w=f["@id"];if("@context"===w||"@preserve"===w)throw new s("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:e});if(d&&d.protected&&!c&&(t.protected[n]=!0,f.protected=!0,!v(d,f))){const t=r&&r.protectedMode||"error";if("error"===t)throw new s(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:e,term:n});if("warn"===t)return void console.warn("WARNING: protected term redefinition",{term:n});throw new s("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:e,term:n,protectedMode:t})}},b.expandIri=(t,e,n,i)=>y(t,e,n,void 0,void 0,i),b.getInitialContext=t=>{const e=JSON.stringify({processingMode:t.processingMode}),n=g.get(e);if(n)return n;const i={processingMode:t.processingMode,mappings:new Map,inverse:null,getInverse:function(){const t=this;if(t.inverse)return t.inverse;const e=t.inverse={},n=t.fastCurieMap={},i={},r=(t["@language"]||"@none").toLowerCase(),a=t["@direction"],l=t.mappings,c=[...l.keys()].sort(f);for(const s of c){const t=l.get(s);if(null===t)continue;let c=t["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===t["@id"])continue;const u=p(t["@id"]);for(const l of u){let u=e[l];const h=b.isKeyword(l);if(u)!h&&!t._termHasColon&&i[l].push(s);else if(e[l]=u={},!h&&!t._termHasColon){i[l]=[s];const t={iri:l,terms:i[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],o(s,u["@any"],"@none"),t.reverse)o(s,u["@type"],"@reverse");else if("@none"===t["@type"])o(s,u["@any"],"@none"),o(s,u["@language"],"@none"),o(s,u["@type"],"@none");else if("@type"in t)o(s,u["@type"],t["@type"]);else if("@language"in t&&"@direction"in t){const e=t["@language"],n=t["@direction"];o(s,u["@language"],e&&n?`${e}_${n}`.toLowerCase():e?e.toLowerCase():n?`_${n}`:"@null")}else"@language"in t?o(s,u["@language"],(t["@language"]||"@null").toLowerCase()):"@direction"in t?o(s,u["@language"],t["@direction"]?`_${t["@direction"]}`:"@none"):a?(o(s,u["@language"],`_${a}`),o(s,u["@language"],"@none"),o(s,u["@type"],"@none")):(o(s,u["@language"],r),o(s,u["@language"],"@none"),o(s,u["@type"],"@none"))}}for(const o in n)s(n,o,1);return e},clone:function(){const t={};return t.mappings=r.clone(this.mappings),t.clone=this.clone,t.inverse=null,t.getInverse=this.getInverse,t.protected=r.clone(this.protected),this.previousContext&&(t.previousContext=this.previousContext.clone()),t.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(t["@base"]=this["@base"]),"@language"in this&&(t["@language"]=this["@language"]),"@vocab"in this&&(t["@vocab"]=this["@vocab"]),t},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===g.size&&g.clear(),g.set(e,i),i;function s(t,e,n){const i=t[e],r=t[e]={};let o,a;for(const s of i)o=s.iri,a=n>=o.length?"":o[n],a in r?r[a].push(s):r[a]=[s];for(const l in r)""!==l&&s(r,l,n+1)}function o(t,e,n){e.hasOwnProperty(n)||(e[n]=t)}},b.getContextValue=(t,e,n)=>{if(null===e)return"@context"===n?void 0:null;if(t.mappings.has(e)){const i=t.mappings.get(e);if(c(n))return i;if(i.hasOwnProperty(n))return i[n]}return"@language"===n&&n in t||"@direction"===n&&n in t?t[n]:"@context"!==n?null:void 0},b.processingMode=(t,e)=>e.toString()>="1.1"?!t.processingMode||t.processingMode>="json-ld-"+e.toString():"json-ld-1.0"===t.processingMode,b.isKeyword=t=>{if(!l(t)||"@"!==t[0])return!1;switch(t){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(t,e,n){"use strict";const{parseLinkHeader:r,buildHeaders:s}=t("../util"),{LINK_HEADER_CONTEXT:o}=t("../constants"),a=t("../JsonLdError"),l=t("../RequestQueue"),{prependBase:c}=t("../url"),u=/(^|(\r\n))link:/i;function h(t,e,n){const i=new(t=t||XMLHttpRequest);return new Promise((t,r)=>{i.onload=()=>t(i),i.onerror=t=>r(t),i.open("GET",e,!0);for(const e in n)i.setRequestHeader(e,n[e]);i.send()})}e.exports=({secure:t,headers:e={},xhr:n}={headers:{}})=>{return e=s(e),(new l).wrapLoader(d);function d(t){return p.apply(this,arguments)}function p(){return(p=i(function*(i){if(0!==i.indexOf("http:")&&0!==i.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:i});if(t&&0!==i.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:i});let s;try{s=yield h(n,i,e)}catch(m){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:i,cause:m})}if(s.status>=400)throw new a("URL could not be dereferenced: "+s.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:i,httpStatusCode:s.status});let l={contextUrl:null,documentUrl:i,document:s.response},p=null;const f=s.getResponseHeader("Content-Type");let g;if(u.test(s.getAllResponseHeaders())&&(g=s.getResponseHeader("Link")),g&&"application/ld+json"!==f){const t=r(g),e=t[o];if(Array.isArray(e))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:i});e&&(l.contextUrl=e.target),p=t.alternate,p&&"application/ld+json"==p.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(l=yield d(c(i,p.target)))}return l})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(t,e,n){"use strict";const r=t("./JsonLdError"),{isArray:s,isObject:o,isEmptyObject:a,isString:l,isUndefined:c}=t("./types"),{isList:u,isValue:h,isGraph:d,isSubject:p}=t("./graphTypes"),{expandIri:f,getContextValue:g,isKeyword:m,process:b,processingMode:y}=t("./context"),{isAbsolute:v}=t("./url"),{addValue:_,asArray:w,getValues:x,validateTypeValue:S}=t("./util"),E={};e.exports=E;const C=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function O(t){return T.apply(this,arguments)}function T(){return(T=i(function*({activeCtx:t,activeProperty:e,expandedActiveProperty:n,element:i,expandedParent:d,options:x={},insideList:T,typeKey:k,typeScopedContext:I,expansionMap:M}){const D=Object.keys(i).sort(),R=[];let N;const L=i[k]&&"@json"===f(t,s(i[k])?i[k][0]:i[k],{vocab:!0},x);for(const O of D){let k,D=i[O];if("@context"===O)continue;let j=f(t,O,{vocab:!0},x);if((null===j||!v(j)&&!m(j))&&(j=M({unmappedProperty:O,activeCtx:t,activeProperty:e,parent:i,options:x,insideList:T,value:D,expandedParent:d}),void 0===j))continue;if(m(j)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:D});if(j in d&&"@included"!==j&&"@type"!==j)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:j})}if("@id"===j){if(!l(D)){if(!x.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(o(D)){if(!a(D))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}else{if(!s(D))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(!D.every(t=>l(t)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}}_(d,"@id",w(D).map(e=>l(e)?f(t,e,{base:!0},x):e),{propertyIsArray:x.isFrame});continue}if("@type"===j){o(D)&&(D=Object.fromEntries(Object.entries(D).map(([t,e])=>[f(I,t,{vocab:!0}),w(e).map(t=>f(I,t,{base:!0,vocab:!0}))]))),S(D,x.isFrame),_(d,"@type",w(D).map(t=>l(t)?f(I,t,{base:!0,vocab:!0},x):t),{propertyIsArray:x.isFrame});continue}if("@included"===j&&y(t,1.1)){const n=w(yield E.expand({activeCtx:t,activeProperty:e,element:D,options:x,expansionMap:M}));if(!n.every(t=>p(t)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:D});_(d,"@included",n,{propertyIsArray:!0});continue}if("@graph"===j&&!o(D)&&!s(D))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:D});if("@value"===j){N=D,L&&y(t,1.1)?d["@value"]=D:_(d,"@value",D,{propertyIsArray:x.isFrame});continue}if("@language"===j){if(null===D)continue;if(!l(D)&&!x.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:D});D=w(D).map(t=>l(t)?t.toLowerCase():t);for(const t of D)l(t)&&!t.match(C)&&console.warn(`@language must be valid BCP47: ${t}`);_(d,"@language",D,{propertyIsArray:x.isFrame});continue}if("@direction"===j){if(!l(D)&&!x.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:D});D=w(D);for(const t of D)if(l(t)&&"ltr"!==t&&"rtl"!==t)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:D});_(d,"@direction",D,{propertyIsArray:x.isFrame});continue}if("@index"===j){if(!l(D))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:D});_(d,"@index",D);continue}if("@reverse"===j){if(!o(D))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:D});if(k=yield E.expand({activeCtx:t,activeProperty:"@reverse",element:D,options:x,expansionMap:M}),"@reverse"in k)for(const t in k["@reverse"])_(d,t,k["@reverse"][t],{propertyIsArray:!0});let e=d["@reverse"]||null;for(const t in k){if("@reverse"===t)continue;null===e&&(e=d["@reverse"]={}),_(e,t,[],{propertyIsArray:!0});const n=k[t];for(let i=0;i"@id"===t||"@index"===t)&&(k=w(k).map(t=>({"@graph":w(t)}))),F.mappings.has(O)&&F.mappings.get(O).reverse){const t=d["@reverse"]=d["@reverse"]||{};k=w(k);for(let e=0;e"@value"===f(t,e,{vocab:!0},x)))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:n,element:i,expandedParent:d,options:x,insideList:T,typeScopedContext:I,typeKey:k,expansionMap:M})}}})).apply(this,arguments)}function k({activeCtx:t,activeProperty:e,value:n,options:i}){if(null==n)return null;const r=f(t,e,{vocab:!0},i);if("@id"===r)return f(t,n,{base:!0},i);if("@type"===r)return f(t,n,{vocab:!0,base:!0},i);const s=g(t,e,"@type");if(("@id"===s||"@graph"===r)&&l(n))return{"@id":f(t,n,{base:!0},i)};if("@vocab"===s&&l(n))return{"@id":f(t,n,{vocab:!0,base:!0},i)};if(m(r))return n;const o={};if(s&&!["@id","@vocab","@none"].includes(s))o["@type"]=s;else if(l(n)){const n=g(t,e,"@language");null!==n&&(o["@language"]=n);const i=g(t,e,"@direction");null!==i&&(o["@direction"]=i)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),o["@value"]=n,o}function A(t,e,n,i){const o=[],a=Object.keys(e).sort();for(const c of a){const a=f(t,c,{vocab:!0},i);let u=e[c];s(u)||(u=[u]);for(const t of u){if(null===t)continue;if(!l(t))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:e});const i={"@value":t};"@none"!==a&&(i["@language"]=c.toLowerCase()),n&&(i["@direction"]=n),o.push(i)}}return o}function P(t){return I.apply(this,arguments)}function I(){return(I=i(function*({activeCtx:t,options:e,activeProperty:n,value:i,expansionMap:o,asGraph:a,indexKey:l,propertyIndex:u}){const p=[],m=Object.keys(i).sort(),y="@type"===l;for(let v of m){if(y){const n=g(t,v,"@context");c(n)||(t=yield b({activeCtx:t,localCtx:n,propagate:!1,options:e}))}let m,w=i[v];s(w)||(w=[w]),w=yield E.expand({activeCtx:t,activeProperty:n,element:w,options:e,insideList:!1,insideIndex:!0,expansionMap:o}),m=u?"@none"===v?"@none":k({activeCtx:t,activeProperty:l,value:v,options:e}):f(t,v,{vocab:!0},e),"@id"===l?v=f(t,v,{base:!0},e):y&&(v=m);for(let t of w){if(a&&!d(t)&&(t={"@graph":[t]}),"@type"===l)"@none"===m||(t["@type"]=t["@type"]?[v].concat(t["@type"]):[v]);else{if(h(t)&&!["@language","@type","@index"].includes(l))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${l}".`,"jsonld.SyntaxError",{code:"invalid value object",value:t});u?"@none"!==m&&_(t,u,m,{propertyIsArray:!0,prependValue:!0}):"@none"!==m&&!(l in t)&&(t[l]=v)}p.push(t)}}return p})).apply(this,arguments)}E.expand=function(){var t=i(function*({activeCtx:t,activeProperty:e=null,element:n,options:i={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:d=null,expansionMap:p=(()=>{})}){if(null==n)return null;if("@default"===e&&(i=Object.assign({},i,{isFrame:!1})),!s(n)&&!o(n)){if(!u&&(null===e||"@graph"===f(t,e,{vocab:!0},i))){const r=yield p({unmappedValue:n,activeCtx:t,activeProperty:e,options:i,insideList:u});return void 0===r?null:r}return k({activeCtx:t,activeProperty:e,value:n,options:i})}if(s(n)){let r=[];const o=g(t,e,"@container")||[];u=u||o.includes("@list");for(let a=0;a1?e.slice().sort():e:[e];for(const n of s){const e=g(d,n,"@context");c(e)||(t=yield b({activeCtx:t,localCtx:e,options:i,propagate:!1}))}}let A={};yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:m,element:n,expandedParent:A,options:i,insideList:u,typeKey:T,typeScopedContext:d,expansionMap:p}),S=Object.keys(A);let P=S.length;if("@value"in A){if("@type"in A&&("@language"in A||"@direction"in A))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});let s=P-1;if("@type"in A&&(s-=1),"@index"in A&&(s-=1),"@language"in A&&(s-=1),"@direction"in A&&(s-=1),0!==s)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});const o=null===A["@value"]?[]:w(A["@value"]),c=x(A,"@type");if(!y(t,1.1)||!c.includes("@json")||1!==c.length)if(0===o.length){const r=yield p({unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}else{if(!o.every(t=>l(t)||a(t))&&"@language"in A)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:A});if(!c.every(t=>v(t)&&!(l(t)&&0===t.indexOf("_:"))||a(t)))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:A})}}else if("@type"in A&&!s(A["@type"]))A["@type"]=[A["@type"]];else if("@set"in A||"@list"in A){if(P>1&&(2!==P||!("@index"in A)))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:A});"@set"in A&&(A=A["@set"],S=Object.keys(A),P=S.length)}else if(1===P&&"@language"in A){const r=yield p(A,{unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}if(o(A)&&!i.keepFreeFloatingNodes&&!u&&(null===e||"@graph"===m)&&(0===P||"@value"in A||"@list"in A||1===P&&"@id"in A)){const r=yield p({unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}return A});return function(e){return t.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(t,e,n){"use strict";const{isSubjectReference:i}=t("./graphTypes"),{createMergedNodeMap:r}=t("./nodeMap"),s={};e.exports=s,s.flatten=t=>{const e=r(t),n=[],s=Object.keys(e).sort();for(let r=0;r=0;--i){const r=n[i];if(r.graph===e&&r.subject["@id"]===t["@id"])return!0}return!1}function f(t,e,n){const i="@"+n;let r=i in t?t[i][0]:e[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:t});return r}function g(t){if(!s.isArray(t)||1!==t.length||!s.isObject(t[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:t});if("@id"in t[0])for(const e of o.asArray(t[0]["@id"]))if(!s.isObject(e)&&!a.isAbsolute(e)||s.isString(e)&&0===e.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t});if("@type"in t[0])for(const e of o.asArray(t[0]["@type"]))if(!s.isObject(e)&&!a.isAbsolute(e)||s.isString(e)&&0===e.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t})}function m(t,e,n,a){let l=!0,c=!1;for(const u in n){let h=!1;const d=o.getValues(e,u),p=0===o.getValues(n,u).length;if("@id"===u){if(s.isEmptyObject(n["@id"][0]||{})?h=!0:n["@id"].length>=0&&(h=n["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(l=!1,p){if(d.length>0)return!1;h=!0}else if(1===n["@type"].length&&s.isEmptyObject(n["@type"][0]))h=d.length>0;else for(const t of n["@type"])h=!(!s.isObject(t)||!("@default"in t))||h||d.some(e=>e===t);if(!a.requireAll)return h}else{if(i(u))continue;{const e=o.getValues(n,u)[0];let i=!1;if(e&&(g([e]),i="@default"in e),l=!1,0===d.length&&i)continue;if(d.length>0&&p)return!1;if(void 0===e){if(d.length>0)return!1;h=!0}else if(r.isList(e)){const n=e["@list"][0];if(r.isList(d[0])){const e=d[0]["@list"];r.isValue(n)?h=e.some(t=>w(n,t)):(r.isSubject(n)||r.isSubjectReference(n))&&(h=e.some(e=>_(t,n,e,a)))}}else h=r.isValue(e)?d.some(t=>w(e,t)):r.isSubjectReference(e)?d.some(n=>_(t,e,n,a)):!!s.isObject(e)&&d.length>0}}if(!h&&a.requireAll)return!1;c=c||h}return l||c}function b(t,e){const n=t.uniqueEmbeds[t.graph],i=n[e],r=i.parent,a=i.property,l={"@id":e};if(s.isArray(r)){for(let t=0;t{const e=Object.keys(n);for(const i of e)i in n&&s.isObject(n[i].parent)&&n[i].parent["@id"]===t&&(delete n[i],c(i))};c(e)}function y(t,e){if(s.isArray(t))return t.map(t=>y(t,e));if(s.isObject(t)){if("@preserve"in t)return t["@preserve"][0];if(r.isValue(t))return t;if(r.isList(t))return t["@list"]=y(t["@list"],e),t;if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)"@id"===n&&e.bnodesToClear.includes(t[n])?delete t["@id"]:t[n]=y(t[n],e)}return t}function v(t,e,n){s.isObject(t)?o.addValue(t,e,n,{propertyIsArray:!0}):t.push(n)}function _(t,e,n,i){if(!("@id"in n))return!1;const r=t.subjects[n["@id"]];return r&&m(t,r,e,i)}function w(t,e){const n=e["@value"],i=e["@type"],r=e["@language"],o=t["@value"]?s.isArray(t["@value"])?t["@value"]:[t["@value"]]:[],a=t["@type"]?s.isArray(t["@type"])?t["@type"]:[t["@type"]]:[],l=t["@language"]?s.isArray(t["@language"])?t["@language"]:[t["@language"]]:[];return 0===o.length&&0===a.length&&0===l.length||!(!o.includes(n)&&!s.isEmptyObject(o[0])||!(!i&&0===a.length||a.includes(i)||i&&s.isEmptyObject(a[0]))||!(!r&&0===l.length||l.includes(r)||r&&s.isEmptyObject(l[0])))}e.exports=h,h.frameMergedOrDefault=(t,e,n)=>{const i={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},r=new o.IdentifierIssuer("_:b");c(t,i.graphMap,"@default",r),n.merged&&(i.graphMap["@merged"]=u(i.graphMap),i.graph="@merged"),i.subjects=i.graphMap[i.graph];const s=[];return h.frame(i,Object.keys(i.subjects).sort(),e,s),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(i.bnodeMap).filter(t=>1===i.bnodeMap[t].length)),n.link={},y(s,n)},h.frame=(t,e,n,a,c=null)=>{g(n);const u=t.options,y={embed:f(n=n[0],u,"embed"),explicit:f(n,u,"explicit"),requireAll:f(n,u,"requireAll")};t.link.hasOwnProperty(t.graph)||(t.link[t.graph]={});const _=t.link[t.graph],x=function(t,e,n,i){const r={};for(const s of e){const e=t.graphMap[t.graph][s];m(t,e,n,i)&&(r[s]=e)}return r}(t,e,n,y),S=Object.keys(x).sort();for(const g of S){const m=x[g];if(null===c?t.uniqueEmbeds={[t.graph]:{}}:t.uniqueEmbeds[t.graph]=t.uniqueEmbeds[t.graph]||{},"@link"===y.embed&&g in _){v(a,c,_[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&o.addValue(t.bnodeMap,g,S,{propertyIsArray:!0}),_[g]=S,("@first"===y.embed||"@last"===y.embed)&&t.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(t.embedded||!t.uniqueEmbeds[t.graph].hasOwnProperty(g)){if(t.embedded&&("@never"===y.embed||p(m,t.graph,t.subjectStack))){v(a,c,S);continue}if(t.embedded&&("@first"==y.embed||"@once"==y.embed)&&t.uniqueEmbeds[t.graph].hasOwnProperty(g)){v(a,c,S);continue}if("@last"===y.embed&&g in t.uniqueEmbeds[t.graph]&&b(t,g),t.uniqueEmbeds[t.graph][g]={parent:a,property:c},t.subjectStack.push({subject:m,graph:t.graph}),g in t.graphMap){let e=!1,i=null;"@graph"in n?(i=n["@graph"][0],e=!("@merged"===g||"@default"===g),s.isObject(i)||(i={})):(e="@merged"!==t.graph,i={}),e&&h.frame(ti(bt({},t),{graph:g,embedded:!1}),Object.keys(t.graphMap[g]).sort(),[i],S,"@graph")}"@included"in n&&h.frame(ti(bt({},t),{embedded:!1}),e,n["@included"],S,"@included");for(const e of Object.keys(m).sort())if(i(e)){if(S[e]=o.clone(m[e]),"@type"===e)for(const e of m["@type"])0===e.indexOf("_:")&&o.addValue(t.bnodeMap,e,S,{propertyIsArray:!0})}else if(!y.explicit||e in n)for(const i of m[e]){const s=e in n?n[e]:d(y);if(r.isList(i)){const s=n[e]&&n[e][0]&&n[e][0]["@list"]?n[e][0]["@list"]:d(y),a={"@list":[]};v(S,e,a);const l=i["@list"];for(const e of l)r.isSubjectReference(e)?h.frame(ti(bt({},t),{embedded:!0}),[e["@id"]],s,a,"@list"):v(a,"@list",o.clone(e))}else r.isSubjectReference(i)?h.frame(ti(bt({},t),{embedded:!0}),[i["@id"]],s,S,e):w(s[0],i)&&v(S,e,o.clone(i))}for(const t of Object.keys(n).sort()){if("@type"===t){if(!s.isObject(n[t][0])||!("@default"in n[t][0]))continue}else if(i(t))continue;const e=n[t][0]||{};if(!f(e,u,"omitDefault")&&!(t in S)){let n="@null";"@default"in e&&(n=o.clone(e["@default"])),s.isArray(n)||(n=[n]),S[t]=[{"@preserve":n}]}}for(const e of Object.keys(n["@reverse"]||{}).sort()){const i=n["@reverse"][e];for(const n of Object.keys(t.subjects))o.getValues(t.subjects[n],e).some(t=>t["@id"]===g)&&(S["@reverse"]=S["@reverse"]||{},o.addValue(S["@reverse"],e,[],{propertyIsArray:!0}),h.frame(ti(bt({},t),{embedded:!0}),[n],i,S["@reverse"][e],c))}v(a,c,S),t.subjectStack.pop()}}},h.cleanupNull=(t,e)=>{if(s.isArray(t))return t.map(t=>h.cleanupNull(t,e)).filter(t=>t);if("@null"===t)return null;if(s.isObject(t)){if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)t[n]=h.cleanupNull(t[n],e)}return t}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(t,e,n){"use strict";const r=t("./JsonLdError"),s=t("./graphTypes"),o=t("./types"),a=t("./util"),{RDF_LIST:l,RDF_FIRST:c,RDF_REST:u,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:p,XSD_BOOLEAN:f,XSD_DOUBLE:g,XSD_INTEGER:m,XSD_STRING:b}=t("./constants"),y=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,v={};function _(t,e,n){if(t.termType.endsWith("Node"))return{"@id":t.value};const i={"@value":t.value};if(t.language)i["@language"]=t.language;else{let a=t.datatype.value;if(a||(a=b),a===p){a="@json";try{i["@value"]=JSON.parse(i["@value"])}catch(s){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:i["@value"],cause:s})}}if(e){if(a===f)"true"===i["@value"]?i["@value"]=!0:"false"===i["@value"]&&(i["@value"]=!1);else if(o.isNumeric(i["@value"]))if(a===m){const t=parseInt(i["@value"],10);t.toFixed(0)===i["@value"]&&(i["@value"]=t)}else a===g&&(i["@value"]=parseFloat(i["@value"]));[f,m,g,b].includes(a)||(i["@type"]=a)}else if("i18n-datatype"===n&&a.startsWith("https://www.w3.org/ns/i18n#")){const[,t,e]=a.split(/[#_]/);t.length>0&&(i["@language"]=t,t.match(y)||console.warn(`@language must be valid BCP47: ${t}`)),i["@direction"]=e}else a!==b&&(i["@type"]=a)}return i}e.exports=v,v.fromRDF=function(){var t=i(function*(t,{useRdfType:e=!1,useNativeTypes:n=!1,rdfDirection:i=null}){const r={},p={"@default":r},f={};for(const s of t){const t="DefaultGraph"===s.graph.termType?"@default":s.graph.value;t in p||(p[t]={}),"@default"!==t&&!(t in r)&&(r[t]={"@id":t});const o=p[t],l=s.subject.value,c=s.predicate.value,u=s.object;l in o||(o[l]={"@id":l});const g=o[l],m=u.termType.endsWith("Node");if(m&&!(u.value in o)&&(o[u.value]={"@id":u.value}),c===d&&!e&&m){a.addValue(g,"@type",u.value,{propertyIsArray:!0});continue}const b=_(u,n,i);if(a.addValue(g,c,b,{propertyIsArray:!0}),m)if(u.value===h){const t=o[u.value];"usages"in t||(t.usages=[]),t.usages.push({node:g,property:c,value:b})}else f[u.value]=!(u.value in f)&&{node:g,property:c,value:b}}for(const a in p){const t=p[a];if(!(h in t))continue;const e=t[h];if(e.usages){for(let n of e.usages){let e=n.node,i=n.property,r=n.value;const a=[],h=[];let d=Object.keys(e).length;for(;i===u&&o.isObject(f[e["@id"]])&&o.isArray(e[c])&&1===e[c].length&&o.isArray(e[u])&&1===e[u].length&&(3===d||4===d&&o.isArray(e["@type"])&&1===e["@type"].length&&e["@type"][0]===l)&&(a.push(e[c][0]),h.push(e["@id"]),n=f[e["@id"]],e=n.node,i=n.property,r=n.value,d=Object.keys(e).length,s.isBlankNode(e)););delete r["@id"],r["@list"]=a.reverse();for(const n of h)delete t[n]}delete e.usages}}const g=[],m=Object.keys(r).sort();for(const o of m){const t=r[o];if(o in p){const e=t["@graph"]=[],n=p[o],i=Object.keys(n).sort();for(const t of i){const i=n[t];s.isSubjectReference(i)||e.push(i)}}s.isSubjectReference(t)||g.push(t)}return g});return function(e,n){return t.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(t,e,n){"use strict";const i=t("./types"),r={};e.exports=r,r.isSubject=t=>!(!i.isObject(t)||"@value"in t||"@set"in t||"@list"in t)&&(Object.keys(t).length>1||!("@id"in t)),r.isSubjectReference=t=>i.isObject(t)&&1===Object.keys(t).length&&"@id"in t,r.isValue=t=>i.isObject(t)&&"@value"in t,r.isList=t=>i.isObject(t)&&"@list"in t,r.isGraph=t=>i.isObject(t)&&"@graph"in t&&1===Object.keys(t).filter(t=>"@id"!==t&&"@index"!==t).length,r.isSimpleGraph=t=>r.isGraph(t)&&!("@id"in t),r.isBlankNode=t=>!!i.isObject(t)&&("@id"in t?0===t["@id"].indexOf("_:"):0===Object.keys(t).length||!("@value"in t||"@set"in t||"@list"in t))},{"./types":30}],26:[function(t,e,n){const r=t("rdf-canonize"),s=t("./platform"),o=t("./util"),a=t("./ContextResolver"),l=o.IdentifierIssuer,c=t("./JsonLdError"),u=t("lru-cache"),h=t("./NQuads"),{expand:d}=t("./expand"),{flatten:p}=t("./flatten"),{fromRDF:f}=t("./fromRdf"),{toRDF:g}=t("./toRdf"),{frameMergedOrDefault:m,cleanupNull:b}=t("./frame"),{isArray:y,isObject:v,isString:_}=t("./types"),{isSubjectReference:w}=t("./graphTypes"),{expandIri:x,getInitialContext:S,process:E,processingMode:C}=t("./context"),{compact:O,compactIri:T}=t("./compact"),{createNodeMap:k,createMergedNodeMap:A,mergeNodeMaps:P}=t("./nodeMap"),I=function(e){const n={},I=new u({max:100});function M(t,n){var i=n,{documentLoader:r=e.documentLoader}=i,s=iX(i,["documentLoader"]);return Object.assign({},{documentLoader:r},s,t)}return e.compact=function(){var t=i(function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let r;(i=M(i,{base:_(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new l("_:b"),contextResolver:new a({sharedCache:I})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,r=i.skipExpansion?t:yield e.expand(t,i);const s=yield e.processContext(S(i),n,i);let u=yield O({activeCtx:s,element:r,options:i,compactionMap:i.compactionMap});i.compactArrays&&!i.graph&&y(u)?1===u.length?u=u[0]:0===u.length&&(u={}):i.graph&&v(u)&&(u=[u]),v(n)&&"@context"in n&&(n=n["@context"]),n=o.clone(n),y(n)||(n=[n]);const h=n;n=[];for(let e=0;e0)&&n.push(h[e]);const d=n.length>0;if(1===n.length&&(n=n[0]),y(u)){const t=T({activeCtx:s,iri:"@graph",relativeTo:{vocab:!0}}),e=u;u={},d&&(u["@context"]=n),u[t]=e}else if(v(u)&&d){const t=u;u={"@context":n};for(const e in t)u[e]=t[e]}return u});return function(e,n,i){return t.apply(this,arguments)}}(),e.expand=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=M(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:I})})).expansionMap&&(n.expansionMap=void 0);const i={},r=[];if("expandContext"in n){const t=o.clone(n.expandContext);i.expandContext=v(t)&&"@context"in t?t:{"@context":t},r.push(i.expandContext)}let s;if(_(t)){const o=yield e.get(t,n);s=o.documentUrl,i.input=o.document,o.contextUrl&&(i.remoteContext={"@context":o.contextUrl},r.push(i.remoteContext))}else i.input=o.clone(t);"base"in n||(n.base=s||"");let l=S(n);for(const e of r)l=yield E({activeCtx:l,localCtx:e,options:n});let c=yield d({activeCtx:l,element:i.input,options:n,expansionMap:n.expansionMap});return v(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),y(c)||(c=[c]),c});return function(e,n){return t.apply(this,arguments)}}(),e.flatten=function(){var t=i(function*(t,n,i){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,i=M(i,{base:_(t)?t:"",contextResolver:new a({sharedCache:I})});const r=yield e.expand(t,i),s=p(r);return null===n?s:(i.graph=!0,i.skipExpansion=!0,yield e.compact(s,n,i))});return function(e,n,i){return t.apply(this,arguments)}}(),e.frame=function(){var t=i(function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(i=M(i,{base:_(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:I})}),_(n)){const t=yield e.get(n,i);if(n=t.document,t.contextUrl){let e=n["@context"];e?y(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const r=n&&n["@context"]||{},s=yield e.processContext(S(i),r,i);i.hasOwnProperty("omitGraph")||(i.omitGraph=C(s,1.1)),i.hasOwnProperty("pruneBlankNodeIdentifiers")||(i.pruneBlankNodeIdentifiers=C(s,1.1));const o=yield e.expand(t,i),l=bt({},i);l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=yield e.expand(n,l),u=Object.keys(n).map(t=>x(s,t,{vocab:!0}));l.merged=!u.includes("@graph"),l.is11=C(s,1.1);const h=m(o,c,l);l.graph=!i.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let d=yield e.compact(h,r,l);return l.link={},d=b(d,l),d});return function(e,n,i){return t.apply(this,arguments)}}(),e.link=function(){var t=i(function*(t,n,i){const r={};return n&&(r["@context"]=n),r["@embed"]="@link",e.frame(t,r,i)});return function(e,n,i){return t.apply(this,arguments)}}(),e.normalize=e.canonize=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=M(n,{base:_(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:I})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const e=h.parse(t);return r.canonize(e,n)}const i=bt({},n);delete i.format,i.produceGeneralizedRdf=!1;const s=yield e.toRDF(t,i);return r.canonize(s,n)});return function(e,n){return t.apply(this,arguments)}}(),e.fromRDF=function(){var t=i(function*(t,e){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");e=M(e,{format:_(t)?"application/n-quads":void 0});const{format:i}=e;let{rdfParser:r}=e;if(i){if(r=r||n[i],!r)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:i})}else r=()=>t;const s=yield r(t);return f(s,e)});return function(e,n){return t.apply(this,arguments)}}(),e.toRDF=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let i;i=(n=M(n,{base:_(t)?t:"",skipExpansion:!1,contextResolver:new a({sharedCache:I})})).skipExpansion?t:yield e.expand(t,n);const r=g(i,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return h.serialize(r);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return r});return function(e,n){return t.apply(this,arguments)}}(),e.createNodeMap=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=M(n,{base:_(t)?t:"",contextResolver:new a({sharedCache:I})});const i=yield e.expand(t,n);return A(i,n)});return function(e,n){return t.apply(this,arguments)}}(),e.merge=function(){var t=i(function*(t,n,i){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,i=M(i,{contextResolver:new a({sharedCache:I})});const r=yield Promise.all(t.map(t=>{const n=bt({},i);return e.expand(t,n)}));let s=!0;"mergeNodes"in i&&(s=i.mergeNodes);const c=i.issuer||new l("_:b"),u={"@default":{}};for(let e=0;ee._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=function(){var t=i(function*(t){throw new c("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:t})});return function(e){return t.apply(this,arguments)}}(),e.get=function(){var t=i(function*(t,n){let i;i="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const r=yield i(t);try{if(!r.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");_(r.document)&&(r.document=JSON.parse(r.document))}catch(s){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:s,remoteDoc:r})}return r});return function(e,n){return t.apply(this,arguments)}}(),e.processContext=function(){var t=i(function*(t,e,n){return n=M(n,{base:"",contextResolver:new a({sharedCache:I})}),null===e?S(n):(e=o.clone(e),v(e)&&"@context"in e||(e={"@context":e}),E({activeCtx:t,localCtx:e,options:n}))});return function(e,n,i){return t.apply(this,arguments)}}(),e.getContextValue=t("./context").getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new c('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(t,e){n[t]=e},e.unregisterRDFParser=function(t){delete n[t]},e.registerRDFParser("application/n-quads",h.parse),e.registerRDFParser("application/nquads",h.parse),e.url=t("./url"),e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=t("./RequestQueue"),e.JsonLdProcessor=t("./JsonLdProcessor")(e),s.setupGlobals(e),s.setupDocumentLoaders(e),e},M=function(){return I(function(){return M()})};I(M),e.exports=M},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(t,e,n){"use strict";const{isKeyword:i}=t("./context"),r=t("./graphTypes"),s=t("./types"),o=t("./util"),a=t("./JsonLdError"),l={};e.exports=l,l.createMergedNodeMap=(t,e)=>{const n=(e=e||{}).issuer||new o.IdentifierIssuer("_:b"),i={"@default":{}};return l.createNodeMap(t,i,"@default",n),l.mergeNodeMaps(i)},l.createNodeMap=(t,e,n,c,u,h)=>{if(s.isArray(t)){for(const i of t)l.createNodeMap(i,e,n,c,void 0,h);return}if(!s.isObject(t))return void(h&&h.push(t));if(r.isValue(t)){if("@type"in t){let e=t["@type"];0===e.indexOf("_:")&&(t["@type"]=e=c.getId(e))}return void(h&&h.push(t))}if(h&&r.isList(t)){const i=[];return l.createNodeMap(t["@list"],e,n,c,u,i),void h.push({"@list":i})}if("@type"in t){const e=t["@type"];for(const t of e)0===t.indexOf("_:")&&c.getId(t)}s.isUndefined(u)&&(u=r.isBlankNode(t)?c.getId(t["@id"]):t["@id"]),h&&h.push({"@id":u});const d=e[n],p=d[u]=d[u]||{};p["@id"]=u;const f=Object.keys(t).sort();for(let s of f){if("@id"===s)continue;if("@reverse"===s){const i={"@id":u},s=t["@reverse"];for(const t in s){const a=s[t];for(const s of a){let a=s["@id"];r.isBlankNode(s)&&(a=c.getId(a)),l.createNodeMap(s,e,n,c,a),o.addValue(d[a],t,i,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===s){u in e||(e[u]={}),l.createNodeMap(t[s],e,u,c);continue}if("@included"===s){l.createNodeMap(t[s],e,n,c);continue}if("@type"!==s&&i(s)){if("@index"===s&&s in p&&(t[s]!==p[s]||t[s]["@id"]!==p[s]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:p});p[s]=t[s];continue}const h=t[s];if(0===s.indexOf("_:")&&(s=c.getId(s)),0!==h.length)for(let t of h)if("@type"===s&&(t=0===t.indexOf("_:")?c.getId(t):t),r.isSubject(t)||r.isSubjectReference(t)){if("@id"in t&&!t["@id"])continue;const i=r.isBlankNode(t)?c.getId(t["@id"]):t["@id"];o.addValue(p,s,{"@id":i},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(t,e,n,c,i)}else if(r.isValue(t))o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1});else if(r.isList(t)){const i=[];l.createNodeMap(t["@list"],e,n,c,u,i),t={"@list":i},o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(t,e,n,c,u),o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(p,s,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=t=>{const e={};for(const n of Object.keys(t).sort())for(const r of Object.keys(t[n]).sort()){const s=t[n][r];r in e||(e[r]={"@id":r});const a=e[r];for(const t of Object.keys(s).sort())if(i(t)&&"@type"!==t)a[t]=o.clone(s[t]);else for(const e of s[t])o.addValue(a,t,o.clone(e),{propertyIsArray:!0,allowDuplicate:!1})}return e},l.mergeNodeMaps=t=>{const e=t["@default"],n=Object.keys(t).sort();for(const i of n){if("@default"===i)continue;const n=t[i];let s=e[i];s?"@graph"in s||(s["@graph"]=[]):e[i]=s={"@id":i,"@graph":[]};const o=s["@graph"];for(const t of Object.keys(n).sort()){const e=n[t];r.isSubjectReference(e)||o.push(e)}}return e}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(t,e,n){"use strict";const i=t("./documentLoaders/xhr"),r={};e.exports=r,r.setupDocumentLoaders=function(t){"undefined"!=typeof XMLHttpRequest&&(t.documentLoaders.xhr=i,t.useDocumentLoader("xhr"))},r.setupGlobals=function(t){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(t,e,n){"use strict";const{createNodeMap:i}=t("./nodeMap"),{isKeyword:r}=t("./context"),s=t("./graphTypes"),o=t("canonicalize"),a=t("./types"),l=t("./util"),{RDF_FIRST:c,RDF_REST:u,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:p,RDF_LANGSTRING:f,XSD_BOOLEAN:g,XSD_DOUBLE:m,XSD_INTEGER:b,XSD_STRING:y}=t("./constants"),{isAbsolute:v}=t("./url"),_={};function w(t,e,n,i,s){const o=Object.keys(e).sort();for(const a of o){const o=e[a],l=Object.keys(o).sort();for(let e of l){const l=o[e];if("@type"===e)e=d;else if(r(e))continue;for(const r of l){const o={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!v(a))continue;const l={termType:e.startsWith("_:")?"BlankNode":"NamedNode",value:e};if(!v(e)||"BlankNode"===l.termType&&!s.produceGeneralizedRdf)continue;const c=x(r,i,t,n,s.rdfDirection);c&&t.push({subject:o,predicate:l,object:c,graph:n})}}}}function x(t,e,n,i,r){const l={};if(s.isValue(t)){l.termType="Literal",l.value=void 0,l.datatype={termType:"NamedNode"};let e=t["@value"];const n=t["@type"]||null;"@json"===n?(l.value=o(e),l.datatype.value=p):a.isBoolean(e)?(l.value=e.toString(),l.datatype.value=n||g):a.isDouble(e)||n===m?(a.isDouble(e)||(e=parseFloat(e)),l.value=e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),l.datatype.value=n||m):a.isNumber(e)?(l.value=e.toFixed(0),l.datatype.value=n||b):"i18n-datatype"===r&&"@direction"in t?(l.datatype.value="https://www.w3.org/ns/i18n#"+(t["@language"]||"")+`_${t["@direction"]}`,l.value=e):"@language"in t?(l.value=e,l.datatype.value=n||f,l.language=t["@language"]):(l.value=e,l.datatype.value=n||y)}else if(s.isList(t)){const s=function(t,e,n,i,r){const s={termType:"NamedNode",value:c},o={termType:"NamedNode",value:u},a={termType:"NamedNode",value:h},l=t.pop(),d=l?{termType:"BlankNode",value:e.getId()}:a;let p=d;for(const c of t){const t=x(c,e,n,i,r),a={termType:"BlankNode",value:e.getId()};n.push({subject:p,predicate:s,object:t,graph:i}),n.push({subject:p,predicate:o,object:a,graph:i}),p=a}if(l){const t=x(l,e,n,i,r);n.push({subject:p,predicate:s,object:t,graph:i}),n.push({subject:p,predicate:o,object:a,graph:i})}return d}(t["@list"],e,n,i,r);l.termType=s.termType,l.value=s.value}else{const e=a.isObject(t)?t["@id"]:t;l.termType=e.startsWith("_:")?"BlankNode":"NamedNode",l.value=e}return"NamedNode"!==l.termType||v(l.value)?l:null}e.exports=_,_.toRDF=(t,e)=>{const n=new l.IdentifierIssuer("_:b"),r={"@default":{}};i(t,r,"@default",n);const s=[],o=Object.keys(r).sort();for(const i of o){let t;if("@default"===i)t={termType:"DefaultGraph",value:""};else{if(!v(i))continue;t=i.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},t.value=i}w(s,r[i],t,n,e)}return s}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(t,e,n){"use strict";const i={};e.exports=i,i.isArray=Array.isArray,i.isBoolean=t=>"boolean"==typeof t||"[object Boolean]"===Object.prototype.toString.call(t),i.isDouble=t=>i.isNumber(t)&&(-1!==String(t).indexOf(".")||Math.abs(t)>=1e21),i.isEmptyObject=t=>i.isObject(t)&&0===Object.keys(t).length,i.isNumber=t=>"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t),i.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t),i.isObject=t=>"[object Object]"===Object.prototype.toString.call(t),i.isString=t=>"string"==typeof t||"[object String]"===Object.prototype.toString.call(t),i.isUndefined=t=>void 0===t},{}],31:[function(t,e,n){"use strict";const i=t("./types"),r={};e.exports=r,r.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=(t,e)=>{const n={},i=r.parsers[e||"full"],s=i.regex.exec(t);let o=i.keys.length;for(;o--;)n[i.keys[o]]=void 0===s[o]?null:s[o];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=(t,e)=>{if(null===t||r.isAbsolute(e))return e;(!t||i.isString(t))&&(t=r.parse(t||""));const n=r.parse(e),s={protocol:t.protocol||""};if(null!==n.authority)s.authority=n.authority,s.path=n.path,s.query=n.query;else if(s.authority=t.authority,""===n.path)s.path=t.path,s.query=null!==n.query?n.query:t.query;else{if(0===n.path.indexOf("/"))s.path=n.path;else{let e=t.path;e=e.substr(0,e.lastIndexOf("/")+1),(e.length>0||t.authority)&&"/"!==e.substr(-1)&&(e+="/"),e+=n.path,s.path=e}s.query=n.query}""!==n.path&&(s.path=r.removeDotSegments(s.path));let o=s.protocol;return null!==s.authority&&(o+="//"+s.authority),o+=s.path,null!==s.query&&(o+="?"+s.query),null!==n.fragment&&(o+="#"+n.fragment),""===o&&(o="./"),o},r.removeBase=(t,e)=>{if(null===t)return e;(!t||i.isString(t))&&(t=r.parse(t||""));let n="";if(""!==t.href?n+=(t.protocol||"")+"//"+(t.authority||""):e.indexOf("//")&&(n+="//"),0!==e.indexOf(n))return e;const s=r.parse(e.substr(n.length)),o=t.normalizedPath.split("/"),a=s.normalizedPath.split("/"),l=s.fragment||s.query?0:1;for(;o.length>0&&a.length>l&&o[0]===a[0];)o.shift(),a.shift();let c="";if(o.length>0){o.pop();for(let t=0;t{if(0===t.length)return"";const e=t.split("/"),n=[];for(;e.length>0;){const t=e.shift(),i=0===e.length;"."!==t?".."!==t?n.push(t):(n.pop(),i&&n.push("")):i&&n.push("")}return"/"===t[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const s=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=t=>i.isString(t)&&s.test(t),r.isRelative=t=>i.isString(t)},{"./types":30}],32:[function(t,e,n){"use strict";const i=t("./graphTypes"),r=t("./types"),s=t("rdf-canonize").IdentifierIssuer,o=t("./JsonLdError"),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u={accept:"application/ld+json, application/json"},h={};function d(t,e){if(r.isArray(e))for(let n=0;n{if(Object.keys(t).some(t=>"accept"===t.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+u.accept+'" is supported.');return Object.assign({Accept:u.accept},t)},h.parseLinkHeader=t=>{const e={},n=t.match(a);for(let i=0;i{if(!(r.isString(t)||r.isArray(t)&&t.every(t=>r.isString(t)))){if(e&&r.isObject(t))switch(Object.keys(t).length){case 0:return;case 1:if("@default"in t&&h.asArray(t["@default"]).every(t=>r.isString(t)))return}throw new o('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:t})}},h.hasProperty=(t,e)=>{if(t.hasOwnProperty(e)){const n=t[e];return!r.isArray(n)||n.length>0}return!1},h.hasValue=(t,e,n)=>{if(h.hasProperty(t,e)){let s=t[e];const o=i.isList(s);if(r.isArray(s)||o){o&&(s=s["@list"]);for(let t=0;t{if("propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1),"valueIsArray"in i||(i.valueIsArray=!1),"allowDuplicate"in i||(i.allowDuplicate=!0),"prependValue"in i||(i.prependValue=!1),i.valueIsArray)t[e]=n;else if(r.isArray(n)){0===n.length&&i.propertyIsArray&&!t.hasOwnProperty(e)&&(t[e]=[]),i.prependValue&&(n=n.concat(t[e]),t[e]=[]);for(let r=0;r[].concat(t[e]||[]),h.removeProperty=(t,e)=>{delete t[e]},h.removeValue=(t,e,n,i)=>{"propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1);const r=h.getValues(t,e).filter(t=>!h.compareValues(t,n));0===r.length?h.removeProperty(t,e):t[e]=1!==r.length||i.propertyIsArray?r:r[0]},h.relabelBlankNodes=(t,e)=>d((e=e||{}).issuer||new s("_:b"),t),h.compareValues=(t,e)=>!!(t===e||i.isValue(t)&&i.isValue(e)&&t["@value"]===e["@value"]&&t["@type"]===e["@type"]&&t["@language"]===e["@language"]&&t["@index"]===e["@index"])||!!(r.isObject(t)&&"@id"in t&&r.isObject(e)&&"@id"in e)&&t["@id"]===e["@id"],h.compareShortestLeast=(t,e)=>t.length1;const g=(t,e,n)=>{const i=t[d].get(e);if(i){const e=i.value;if(m(t,e)){if(y(t,i),!t[a])return}else n&&(t[p]&&(i.value.now=Date.now()),t[h].unshiftNode(i));return e.value}},m=(t,e)=>{if(!e||!e.maxAge&&!t[l])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[l]&&n>t[l]},b=t=>{if(t[s]>t[r])for(let e=t[h].tail;t[s]>t[r]&&null!==e;){const n=e.prev;y(t,e),e=n}},y=(t,e)=>{if(e){const n=e.value;t[c]&&t[c](n.key,n.value),t[s]-=n.length,t[d].delete(n.key),t[h].removeNode(e)}};class v{constructor(t,e,n,i,r){this.key=t,this.value=e,this.length=n,this.now=i,this.maxAge=r||0}}const _=(t,e,n,i)=>{let r=n.value;m(t,r)&&(y(t,n),t[a]||(r=void 0)),r&&e.call(i,r.value,r.key,t)};e.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[r]=t.max||1/0;const e=t.length||f;if(this[o]="function"!=typeof e?f:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[l]=t.maxAge||0,this[c]=t.dispose,this[u]=t.noDisposeOnSet||!1,this[p]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[r]=t||1/0,b(this)}get max(){return this[r]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[l]=t,b(this)}get maxAge(){return this[l]}set lengthCalculator(t){"function"!=typeof t&&(t=f),t!==this[o]&&(this[o]=t,this[s]=0,this[h].forEach(t=>{t.length=this[o](t.value,t.key),this[s]+=t.length})),b(this)}get lengthCalculator(){return this[o]}get length(){return this[s]}get itemCount(){return this[h].length}rforEach(t,e){e=e||this;for(let n=this[h].tail;null!==n;){const i=n.prev;_(this,t,n,e),n=i}}forEach(t,e){e=e||this;for(let n=this[h].head;null!==n;){const i=n.next;_(this,t,n,e),n=i}}keys(){return this[h].toArray().map(t=>t.key)}values(){return this[h].toArray().map(t=>t.value)}reset(){this[c]&&this[h]&&this[h].length&&this[h].forEach(t=>this[c](t.key,t.value)),this[d]=new Map,this[h]=new i,this[s]=0}dump(){return this[h].map(t=>!m(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[h]}set(t,e,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const i=n?Date.now():0,a=this[o](e,t);if(this[d].has(t)){if(a>this[r])return y(this,this[d].get(t)),!1;const o=this[d].get(t).value;return this[c]&&(this[u]||this[c](t,o.value)),o.now=i,o.maxAge=n,o.value=e,this[s]+=a-o.length,o.length=a,this.get(t),b(this),!0}const p=new v(t,e,a,i,n);return p.length>this[r]?(this[c]&&this[c](t,e),!1):(this[s]+=p.length,this[h].unshift(p),this[d].set(t,this[h].head),b(this),!0)}has(t){if(!this[d].has(t))return!1;const e=this[d].get(t).value;return!m(this,e)}get(t){return g(this,t,!0)}peek(t){return g(this,t,!1)}pop(){const t=this[h].tail;return t?(y(this,t),t.value):null}del(t){y(this,this[d].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const t=r-e;t>0&&this.set(i.k,i.v,t)}}}prune(){this[d].forEach((t,e)=>g(this,e,!1))}}},{yallist:92}],34:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#",s="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:`${r}decimal`,boolean:`${r}boolean`,double:`${r}double`,integer:`${r}integer`,string:`${r}string`},rdf:{type:`${i}type`,nil:`${i}nil`,first:`${i}first`,rest:`${i}rest`,langString:`${i}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`}}},{}],35:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function t(e,n){if(n=n||d,!e)return n.defaultGraph();switch(e[0]){case"?":return n.variable(e.substr(1));case"_":return n.blankNode(e.substr(2));case'"':if(n===d)return new g(e);if('"'===e[e.length-1])return n.literal(e.substr(1,e.length-2));const i=e.lastIndexOf('"',e.length-1);return n.literal(e.substr(1,i-1),"@"===e[i+1]?e.substr(i+2):n.namedNode(e.substr(i+3)));case"<":const r=h.exec(e);return n.quad(t(w(r[1]),n),t(w(r[2]),n),t(w(r[3]),n),r[4]&&t(w(r[4]),n));default:return n.namedNode(e)}},n.termToId=function t(e){if("string"==typeof e)return e;if(e instanceof p&&"Quad"!==e.termType)return e.id;if(!e)return l.id;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==a.string?`^^${e.datatype.value}`:""}`;case"Quad":return`<<${_(t(e.subject))} ${_(t(e.predicate))} ${_(t(e.object))}${(0,s.isDefaultGraph)(e.graph)?"":` ${t(e.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${e.termType}`)}},n.escapeQuotes=_,n.unescapeQuotes=w,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var i,r=(i=t("./IRIs"))&&i.__esModule?i:{default:i},s=t("./N3Util");const{rdf:o,xsd:a}=r.default;let l,c=0;const u=/^"(.*".*)(?="[^"]*$)/,h=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,d={namedNode:function(t){return new f(t)},blankNode:function(t){return new m(t||"n3-"+c++)},variable:function(t){return new b(t)},literal:function(t,e){if("string"==typeof e)return new g(`"${t}"@${e.toLowerCase()}`);let n=e?e.value:"";return""===n&&("boolean"==typeof t?n=a.boolean:"number"==typeof t&&(Number.isFinite(t)?n=Number.isInteger(t)?a.integer:a.double:(n=a.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),new g(""===n||n===a.string?`"${t}"`:`"${t}"^^${n}`)},defaultGraph:function(){return l},quad:x,triple:x};n.default=d;class p{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof p?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}toJSON(){return{termType:this.termType,value:this.value}}}n.Term=p;class f extends p{get termType(){return"NamedNode"}}n.NamedNode=f;class g extends p{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e`"${e.replace(/"/g,'""')}`)}function w(t){return t.replace(u,(t,e)=>`"${e.replace(/""/g,'"')}`)}function x(t,e,n,i){return new v(t,e,n,i)}n.Triple=n.Quad=v},{"./IRIs":34,"./N3Util":41}],36:[function(t,e,n){(function(e){(function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=s(t("./IRIs")),r=s(t("queue-microtask"));function s(t){return t&&t.__esModule?t:{default:t}}const{xsd:o}=i.default,a=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,l={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},c=/[\x00-\x20<>\\"\{\}\|\^\`]/,u={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},h=/$0^/;n.default=class{constructor(t){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]*)?$/,this._lineMode=!!(t=t||{}).lineMode){this._n3Mode=!1;for(const t in this)!(t in u)&&this[t]instanceof RegExp&&(this[t]=h)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let n=this._input;const i=this._comments;for(;;){let s,a;for(;s=this._newline.exec(n);)i&&(a=this._comment.exec(s[0]))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),n=n.substr(s[0].length,n.length),this._line++;if(!s&&(s=this._whitespace.exec(n))&&(n=n.substr(s[0].length,n.length)),this._endOfFile.test(n))return e&&(i&&(a=this._comment.exec(n))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),t(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;const l=this._line,u=n[0];let h="",d="",p="",f=null,g=0,m=!1;switch(u){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(g=1,h="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){m=!0;break}case"<":if(f=this._unescapedIri.exec(n))h="IRI",d=f[1];else if(f=this._iri.exec(n)){if(d=this._unescape(f[1]),null===d||c.test(d))return r(this);h="IRI"}else n.length>1&&"<"===n[1]?(h="<<",g=2):this._n3Mode&&n.length>1&&"="===n[1]&&(h="inverse",g=2,d=">");break;case">":n.length>1&&">"===n[1]&&(h=">>",g=2);break;case"_":((f=this._blank.exec(n))||e&&(f=this._blank.exec(`${n} `)))&&(h="blank",p="_",d=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(n))d=f[1];else if(({value:d,matchLength:g}=this._parseLiteral(n)),null===d)return r(this);(null!==f||0!==g)&&(h="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(n))d=f[1];else if(({value:d,matchLength:g}=this._parseLiteral(n)),null===d)return r(this);(null!==f||0!==g)&&(h="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(n))&&(h="var",d=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(n))?(h="langcode",d=f[1]):(f=this._keyword.exec(n))&&(h=f[0]);break;case".":if(1===n.length?e:n[1]<"0"||n[1]>"9"){h=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(n)||e&&(f=this._number.exec(`${n} `)))&&(h="literal",d=f[0],p="string"==typeof f[1]?o.double:"string"==typeof f[2]?o.decimal:o.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(n))?h=f[0].toUpperCase():m=!0;break;case"f":case"t":(f=this._boolean.exec(n))?(h="literal",d=f[0],p=o.boolean):m=!0;break;case"a":(f=this._shortPredicates.exec(n))?(h="abbreviation",d="a"):m=!0;break;case"=":this._n3Mode&&n.length>1&&(h="abbreviation",">"!==n[1]?(g=1,d="="):(g=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(g=1,h=u);break;default:m=!0}if(m&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(n))?((f=this._prefixed.exec(n))||e&&(f=this._prefixed.exec(`${n} `)))&&(h="prefixed",p=f[1]||"",d=this._unescape(f[2])):(h="prefix",d=f[1]||"")),"^^"===this._previousMarker)switch(h){case"prefixed":h="type";break;case"IRI":h="typeIRI";break;default:h=""}if(!h)return e||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?r(this):this._input=n;const b={line:l,type:h,value:d,prefix:p};t(null,b),this.previousToken=b,this._previousMarker=h,n=n.substr(g||f[0].length,n.length)}function r(e){t(e._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(t){let e=!1;const n=t.replace(a,(t,n,i,r)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof i){let t=Number.parseInt(i,16);return t<=65535?String.fromCharCode(Number.parseInt(i,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return r in l?l[r]:(e=!0,"")});return e?null:n}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],n=e.length;let i=Math.max(this._literalClosingPos,n);for(;(i=t.indexOf(e,i))>0;){let e=0;for(;"\\"===t[i-e-1];)e++;if(e%2==0){const e=t.substring(n,i),r=e.split(/\r\n|\r|\n/).length-1,s=i+n;if(1===n&&0!==r||3===n&&this._lineMode)break;return this._line+=r,{value:this._unescape(e),matchLength:s}}i++}this._literalClosingPos=t.length-n+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,n){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof n){const t=[];let e;if(this._tokenizeToEnd((n,i)=>n?e=n:t.push(i),!0),e)throw e;return t}(0,r.default)(()=>this._tokenizeToEnd(n,!0))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=e.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(n,!1)))}),t.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(n,!0)}),t.on("error",n)}}}).call(this)}).call(this,t("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(t("./N3Lexer")),r=o(t("./N3DataFactory")),s=o(t("./IRIs"));function o(t){return t&&t.__esModule?t:{default:t}}let a=0;class l{constructor(t){this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&u(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(e),r=/trig/.test(e),s=/triple/.test(e),o=/quad/.test(e),a=this._n3Mode=/n3/.test(e),l=s||o;(this._supportsNamedGraphs=!(n||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||s||a),this._supportsRDFStar=""===e||/star|\*$/.test(e),l&&(this._resolveRelativeIRI=t=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new i.default({lineMode:l,n3:a}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){a=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,n,i,r){const s=this._n3Mode;this._contextStack.push({subject:n,predicate:i,object:r,graph:e,type:t,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const t=this._contextStack.pop(),e=this._n3Mode;this._subject=t.subject,this._predicate=t.predicate,this._object=t.object,this._graph=t.graph,e&&(this._inversePredicate=t.inverse,this._prefixes._=t.blankPrefix,this._quantified=t.quantified)}_readInTopContext(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let n;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);n=this._namedNode(e);break;case"type":case"prefixed":const i=this._prefixes[t.prefix];if(void 0===i)return this._error(`Undefined prefix "${t.prefix}:"`,t);n=this._namedNode(i+t.value);break;case"blank":n=this._blankNode(this._prefixes[t.prefix]+t.value);break;case"var":n=this._variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(t){switch(this._predicate=null,t.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._literal(t.value,this._namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._literal(t.value,this._namedNode(t.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext(),null===this._object?e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,n=null,i=this._readListItem;const r=this._subject,s=this._contextStack,o=s[s.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=e=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==s.length&&"list"===s[s.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":0===t.prefix.length?(this._literalValue=t.value,i=this._readListItemDataTypeOrLang):(e=this._literal(t.value,this._namedNode(t.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===n&&(this._subject=n=this._blankNode()),null===r?null===o.predicate?o.subject=n:o.object=n:this._emit(r,this.RDF_REST,n,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,e,this._graph)}return i}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const n=this._readEntity(t);if(void 0===n)return;e=this._literal(this._literalValue,n),t=null;break;case"langcode":e=this._literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const n=this._completeLiteral(t);if(n)return this._object=n.literal,e&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,n=this._graph;const i=this._subject,r=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,r&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==i){const t=this._predicate,e=this._object;r?this._emit(e,t,i,n):this._emit(i,t,e,n)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,n=e.length&&e[e.length-1];if(n&&"item"===n.type){const t=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,n;const i=this._blankNode();if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=i):(e=this._object,this._object=i),this._emit(e,n,i,this._graph),this._readPath}_readBackwardPath(t){const e=this._blankNode();let n,i;if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(i=this._subject,this._subject=e):(i=this._object,this._object=e),this._emit(e,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,n,i){this._callback(null,this._quad(t,e,n,i||this.DEFAULTGRAPH))}_error(t,e){const n=new Error(`${t} on line ${e.line}.`);n.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let n="",i=-1,r=-1,s=0,o="/";for(;i=r&&(n=n.substr(0,s)),"/"!==o)return`${n}/${t.substr(i+1)}`;s=i+1}}}o=t[++i]}return n+t.substring(s)}parse(t,e,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${a++}_`,this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!e){const e=[];let n;if(this._callback=(t,i)=>{t?n=t:i&&e.push(i)},this._lexer.tokenize(t).every(t=>this._readCallback=this._readCallback(t)),n)throw n;return e}this._callback=e,this._lexer.tokenize(t,(t,e)=>{null!==t?(this._callback(t),this._callback=c):this._readCallback&&(this._readCallback=this._readCallback(e))})}}function c(){}function u(t,e){const n=e.namedNode;t._namedNode=n,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=n(s.default.rdf.first),t.RDF_REST=n(s.default.rdf.rest),t.RDF_NIL=n(s.default.rdf.nil),t.N3_FORALL=n(s.default.r.forAll),t.N3_FORSOME=n(s.default.r.forSome),t.ABBREVIATIONS={a:n(s.default.rdf.type),"=":n(s.default.owl.sameAs),">":n(s.default.log.implies)},t.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=l,u(l.prototype,r.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}(t("./N3DataFactory")),s=t("readable-stream"),o=(i=t("./IRIs"))&&i.__esModule?i:{default:i};function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}class l{constructor(t,e){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!e&&t&&!t[0]&&(e=t,t=null),this._factory=(e=e||{}).factory||r.default,t&&this.addQuads(t)}get size(){let t=this._size;if(null!==t)return t;t=0;const e=this._graphs;let n,i;for(const r in e)for(const s in n=e[r].subjects)for(const e in i=n[s])t+=Object.keys(i[e]).length;return this._size=t}_addToIndex(t,e,n,i){const r=t[e]||(t[e]={}),s=r[n]||(r[n]={}),o=i in s;return o||(s[i]=null),!o}_removeFromIndex(t,e,n,i){const r=t[e],s=r[n];delete s[i];for(const o in s)return;delete r[n];for(const o in r)return;delete t[e]}_findInIndex(t,e,n,i,s,o,a,l,c,u){let h,d,p;const f=!e+!n+!i>1?Object.keys(this._ids):this._entities;e&&((h=t,t={})[e]=h[e]);for(const g in t){const e=f[g];if(d=t[g]){n&&((h=d,d={})[n]=h[n]);for(const t in d){const n=f[t];if(p=d[t]){const t=i?i in p?[i]:[]:Object.keys(p);for(let i=0;i{n in e||(e[n]=!0,t((0,r.termFromId)(this._entities[n],this._factory)))}}add(t){return this.addQuad(t),this}addQuad(t,e,n,i){e||(i=t.graph,n=t.object,e=t.predicate,t=t.subject),t=(0,r.termToId)(t),e=(0,r.termToId)(e),n=(0,r.termToId)(n),i=(0,r.termToId)(i);let s=this._graphs[i];s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s));const o=this._ids,a=this._entities;t=o[t]||(o[a[++this._id]=t]=this._id),e=o[e]||(o[a[++this._id]=e]=this._id),n=o[n]||(o[a[++this._id]=n]=this._id);const l=this._addToIndex(s.subjects,t,e,n);return this._addToIndex(s.predicates,e,n,t),this._addToIndex(s.objects,n,t,e),this._size=null,l}addQuads(t){for(let e=0;e{this.addQuad(t)}),t}removeQuad(t,e,n,i){e||(i=t.graph,n=t.object,e=t.predicate,t=t.subject),t=(0,r.termToId)(t),e=(0,r.termToId)(e),n=(0,r.termToId)(n),i=(0,r.termToId)(i);const s=this._ids,o=this._graphs;let a,l,c;if(!((t=s[t])&&(e=s[e])&&(n=s[n])&&(a=o[i])&&(l=a.subjects[t])&&(c=l[e])&&n in c))return!1;for(t in this._removeFromIndex(a.subjects,t,e,n),this._removeFromIndex(a.predicates,e,n,t),this._removeFromIndex(a.objects,n,t,e),null!==this._size&&this._size--,a.subjects)return!0;return delete o[i],!0}removeQuads(t){for(let e=0;e{this.removeQuad(t)}),t}removeMatches(t,e,n,i){const r=new s.Readable({objectMode:!0});return r._read=()=>{for(const s of this.getQuads(t,e,n,i))r.push(s);r.push(null)},this.remove(r)}deleteGraph(t){return this.removeMatches(null,null,null,t)}getQuads(t,e,n,i){t=t&&(0,r.termToId)(t),e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=[],o=this._getGraphs(i),a=this._ids;let l,u,h,d;if(c(t)&&!(u=a[t])||c(e)&&!(h=a[e])||c(n)&&!(d=a[n]))return s;for(const r in o)(l=o[r])&&(u?d?this._findInIndex(l.objects,d,u,h,"object","subject","predicate",r,null,s):this._findInIndex(l.subjects,u,h,null,"subject","predicate","object",r,null,s):h?this._findInIndex(l.predicates,h,d,null,"predicate","object","subject",r,null,s):d?this._findInIndex(l.objects,d,null,null,"object","subject","predicate",r,null,s):this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",r,null,s));return s}match(t,e,n,i){return new u(this,t,e,n,i)}countQuads(t,e,n,i){t=t&&(0,r.termToId)(t),e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._getGraphs(i),o=this._ids;let a,l,u,h,d=0;if(c(t)&&!(l=o[t])||c(e)&&!(u=o[e])||c(n)&&!(h=o[n]))return 0;for(const r in s)(a=s[r])&&(d+=t?n?this._countInIndex(a.objects,h,l,u):this._countInIndex(a.subjects,l,u,h):e?this._countInIndex(a.predicates,u,h,l):this._countInIndex(a.objects,h,l,u));return d}forEach(t,e,n,i,r){this.some(e=>(t(e),!1),e,n,i,r)}every(t,e,n,i,r){let s=!1;const o=!this.some(e=>(s=!0,!t(e)),e,n,i,r);return s&&o}some(t,e,n,i,s){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i),s=s&&(0,r.termToId)(s);const o=this._getGraphs(s),a=this._ids;let l,u,h,d;if(c(e)&&!(u=a[e])||c(n)&&!(h=a[n])||c(i)&&!(d=a[i]))return!1;for(const r in o)if(l=o[r])if(u){if(d){if(this._findInIndex(l.objects,d,u,h,"object","subject","predicate",r,t,null))return!0}else if(this._findInIndex(l.subjects,u,h,null,"subject","predicate","object",r,t,null))return!0}else if(h){if(this._findInIndex(l.predicates,h,d,null,"predicate","object","subject",r,t,null))return!0}else if(d){if(this._findInIndex(l.objects,d,null,null,"object","subject","predicate",r,t,null))return!0}else if(this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",r,t,null))return!0;return!1}getSubjects(t,e,n){const i=[];return this.forSubjects(t=>{i.push(t)},t,e,n),i}forSubjects(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.predicates,l,u,t):this._loopByKey1(a.subjects,l,t):u?this._loopByKey0(a.objects,u,t):this._loop(a.subjects,t))}getPredicates(t,e,n){const i=[];return this.forPredicates(t=>{i.push(t)},t,e,n),i}forPredicates(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.objects,u,l,t):this._loopByKey0(a.subjects,l,t):u?this._loopByKey1(a.predicates,u,t):this._loop(a.predicates,t))}getObjects(t,e,n){const i=[];return this.forObjects(t=>{i.push(t)},t,e,n),i}forObjects(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.subjects,l,u,t):this._loopByKey1(a.objects,l,t):u?this._loopByKey0(a.predicates,u,t):this._loop(a.objects,t))}getGraphs(t,e,n){const i=[];return this.forGraphs(t=>{i.push(t)},t,e,n),i}forGraphs(t,e,n,i){for(const r in this._graphs)this.some(e=>(t(e.graph),!0),e,n,i,r)}createBlankNode(t){let e,n;if(t)for(e=t=`_:${t}`,n=1;this._ids[e];)e=t+n++;else do{e="_:b"+this._blankNodeIndex++}while(this._ids[e]);return this._ids[e]=++this._id,this._entities[this._id]=e,this._factory.blankNode(e.substr(2))}extractLists({remove:t=!1,ignoreErrors:e=!1}={}){const n={},i=e?()=>!0:(t,e)=>{throw new Error(`${t.value} ${e}`)},r=this.getQuads(null,o.default.rdf.rest,o.default.rdf.nil,null),s=t?[...r]:[];return r.forEach(e=>{const r=[];let a,l,c=!1;const u=e.graph;let h=e.subject;for(;h&&!c;){const t=this.getQuads(null,null,h,null),e=this.getQuads(h,null,null,null);let n,d=null,p=null,f=null;for(let r=0;r{switch(t){case"data":e=i;break;case"end":n=i}}},(t,e)=>{t&&this.emit("error",t)||e&&this.push(e)},(t,e)=>{this.emit("prefix",t,e)}),this._transform=(t,n,i)=>{e(t),i()},this._flush=t=>{n(),t()}}import(t){return t.on("data",t=>{this.write(t)}),t.on("end",()=>{this.end()}),t.on("error",t=>{this.emit("error",t)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=t("readable-stream"),s=(i=t("./N3Writer"))&&i.__esModule?i:{default:i};n.default=class extends r.Transform{constructor(t){super({encoding:"utf8",writableObjectMode:!0});const e=this._writer=new s.default({write:(t,e,n)=>{this.push(t),n&&n()},end:t=>{this.push(null),t&&t()}},t);this._transform=(t,n,i)=>{e.addQuad(t,i)},this._flush=t=>{e.end(t)}}import(t){return t.on("data",t=>{this.write(t)}),t.on("end",()=>{this.end()}),t.on("error",t=>{this.emit("error",t)}),t.on("prefix",(t,e)=>{this._writer.addPrefix(t,e)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isNamedNode=function(t){return!!t&&"NamedNode"===t.termType},n.isBlankNode=function(t){return!!t&&"BlankNode"===t.termType},n.isLiteral=function(t){return!!t&&"Literal"===t.termType},n.isVariable=function(t){return!!t&&"Variable"===t.termType},n.isDefaultGraph=s,n.inDefaultGraph=function(t){return s(t.graph)},n.prefix=function(t,e){return o({"":t},e)("")},n.prefixes=o;var i,r=(i=t("./N3DataFactory"))&&i.__esModule?i:{default:i};function s(t){return!!t&&"DefaultGraph"===t.termType}function o(t,e){const n=Object.create(null);for(const r in t)i(r,t[r]);function i(t,i){if("string"==typeof i){const r=Object.create(null);n[t]=t=>r[t]||(r[t]=e.namedNode(i+t))}else if(!(t in n))throw new Error(`Unknown prefix: ${t}`);return n[t]}return e=e||r.default,i}},{"./N3DataFactory":35}],42:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=(i=t("./IRIs"))&&i.__esModule?i:{default:i},s=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}(t("./N3DataFactory")),o=t("./N3Util");function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}const l=s.default.defaultGraph(),{rdf:c,xsd:u}=r.default,h=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,d=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,p={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class f extends s.Term{equals(){return!1}}function g(t){let e=p[t];return void 0===e&&(1===t.length?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}n.default=class{constructor(t,e){if(this._prefixRegex=/$0^/,t&&"function"!=typeof t.write&&(e=t,t=null),this._lists=(e=e||{}).lists,t)this._outputStream=t,this._endStream=void 0===e.end||!!e.end;else{let t="";this._outputStream={write(e,n,i){t+=e,i&&i()},end:e=>{e&&e(null,t)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(e.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=l,this._baseIRI=e.baseIRI,this._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes))}get _inDefaultGraph(){return l.equals(this._graph)}_write(t,e){this._outputStream.write(t,"utf8",e)}_writeQuad(t,e,n,i,r){try{i.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(l.equals(i)?"":`${this._encodeIriOrBlank(i)} {\n`)),this._graph=i,this._subject=null),t.equals(this._subject)?e.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,r):this._write(`;\n ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=t)} ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r)}catch(s){r&&r(s)}}_writeQuadLine(t,e,n,i,r){delete this._prefixMatch,this._write(this.quadToString(t,e,n,i),r)}quadToString(t,e,n,i){return`${this._encodeSubject(t)} ${this._encodeIriOrBlank(e)} ${this._encodeObject(n)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .\n`:" .\n"}`}quadsToString(t){return t.map(t=>this.quadToString(t.subject,t.predicate,t.object,t.graph)).join("")}_encodeSubject(t){return"Quad"===t.termType?this._encodeQuad(t):this._encodeIriOrBlank(t)}_encodeIriOrBlank(t){if("NamedNode"!==t.termType)return this._lists&&t.value in this._lists&&(t=this.list(this._lists[t.value])),"id"in t?t.id:`_:${t.value}`;let e=t.value;this._baseIRI&&e.startsWith(this._baseIRI)&&(e=e.substr(this._baseIRI.length)),h.test(e)&&(e=e.replace(d,g));const n=this._prefixRegex.exec(e);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:e:`<${e}>`}_encodeLiteral(t){let e=t.value;if(h.test(e)&&(e=e.replace(d,g)),t.language)return`"${e}"@${t.language}`;if(this._lineMode){if(t.datatype.value===u.string)return`"${e}"`}else switch(t.datatype.value){case u.string:return`"${e}"`;case u.boolean:if("true"===e||"false"===e)return e;break;case u.integer:if(/^[+-]?\d+$/.test(e))return e;break;case u.decimal:if(/^[+-]?\d*\.\d+$/.test(e))return e;break;case u.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(e))return e}return`"${e}"^^${this._encodeIriOrBlank(t.datatype)}`}_encodePredicate(t){return t.value===c.type?"a":this._encodeIriOrBlank(t)}_encodeObject(t){switch(t.termType){case"Quad":return this._encodeQuad(t);case"Literal":return this._encodeLiteral(t);default:return this._encodeIriOrBlank(t)}}_encodeQuad({subject:t,predicate:e,object:n,graph:i}){return`<<${this._encodeSubject(t)} ${this._encodePredicate(e)} ${this._encodeObject(n)}${(0,o.isDefaultGraph)(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(t,e,n,i,r){void 0===n?this._writeQuad(t.subject,t.predicate,t.object,t.graph,e):"function"==typeof i?this._writeQuad(t,e,n,l,i):this._writeQuad(t,e,n,i||l,r)}addQuads(t){for(let e=0;e.\n`)}if(n){let t="",e="";for(const n in this._prefixIRIs)t+=t?`|${n}`:n,e+=(e?"|":"")+this._prefixIRIs[n];t=t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${e})[^/]*$|^(${t})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",e)}blank(t,e){let n,i,r=t;switch(void 0===t?r=[]:t.termType?r=[{predicate:t,object:e}]:"length"in t||(r=[t]),i=r.length){case 0:return new f("[]");case 1:if(n=r[0],!(n.object instanceof f))return new f(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let e="[";for(let s=0;s{e=null,t(n,i)});if(this._endStream)try{return this._outputStream.end(e)}catch(n){}e&&e()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"Writer",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"Store",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"StreamParser",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"StreamWriter",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"DataFactory",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"Term",{enumerable:!0,get:function(){return u.Term}}),Object.defineProperty(n,"NamedNode",{enumerable:!0,get:function(){return u.NamedNode}}),Object.defineProperty(n,"Literal",{enumerable:!0,get:function(){return u.Literal}}),Object.defineProperty(n,"BlankNode",{enumerable:!0,get:function(){return u.BlankNode}}),Object.defineProperty(n,"Variable",{enumerable:!0,get:function(){return u.Variable}}),Object.defineProperty(n,"DefaultGraph",{enumerable:!0,get:function(){return u.DefaultGraph}}),Object.defineProperty(n,"Quad",{enumerable:!0,get:function(){return u.Quad}}),Object.defineProperty(n,"Triple",{enumerable:!0,get:function(){return u.Triple}}),Object.defineProperty(n,"termFromId",{enumerable:!0,get:function(){return u.termFromId}}),Object.defineProperty(n,"termToId",{enumerable:!0,get:function(){return u.termToId}}),n.Util=void 0;var i=p(t("./N3Lexer")),r=p(t("./N3Parser")),s=p(t("./N3Writer")),o=p(t("./N3Store")),a=p(t("./N3StreamParser")),l=p(t("./N3StreamWriter")),c=d(t("./N3Util"));n.Util=c;var u=d(t("./N3DataFactory"));function h(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(h=function(t){return t?n:e})(t)}function d(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=h(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}function p(t){return t&&t.__esModule?t:{default:t}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(t,e,n){var i,r,s=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(n){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(t){i=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],h=!1,d=-1;function p(){!h||!c||(h=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!h){var t=l(p);h=!0;for(var e=u.length;e;){for(c=u,u=[];++d1)for(var n=1;n(n||(n=Promise.resolve())).then(t).catch(t=>setTimeout(()=>{throw t},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(t,e,n){e.exports=t("./lib")},{"./lib":55}],47:[function(t,e,n){"use strict";e.exports=class t{constructor(t,e=new Map,n=0){this.prefix=t,this._existing=e,this.counter=n}clone(){const{prefix:e,_existing:n,counter:i}=this;return new t(e,new Map(n),i)}getId(t){const e=t&&this._existing.get(t);if(e)return e;const n=this.prefix+this.counter;return this.counter++,t&&this._existing.set(t,n),n}hasId(t){return this._existing.has(t)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(t,e,n){"use strict";t("setimmediate");const r=self.crypto||self.msCrypto;e.exports=class{constructor(t){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error(`Unsupport algorithm "${t}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(t){this._content+=t}digest(){var t=this;return i(function*(){const e=(new TextEncoder).encode(t._content),n=new Uint8Array(yield r.subtle.digest(t.algorithm,e));let i="";for(let t=0;t]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class t{static parse(t){const e=[],n={},h=t.split(c.eoln);let p=0;for(const f of h){if(p++,c.empty.test(f))continue;const t=f.match(c.quad);if(null===t)throw new Error("N-Quads parse error on line "+p+".");const h={subject:null,predicate:null,object:null,graph:null};if(h.subject=void 0!==t[1]?{termType:s,value:t[1]}:{termType:o,value:t[2]},h.predicate={termType:s,value:t[3]},void 0!==t[4]?h.object={termType:s,value:t[4]}:void 0!==t[5]?h.object={termType:o,value:t[5]}:(h.object={termType:a,value:void 0,datatype:{termType:s}},void 0!==t[7]?h.object.datatype.value=t[7]:void 0!==t[8]?(h.object.datatype.value=i,h.object.language=t[8]):h.object.datatype.value=r,h.object.value=t[6].replace(d,function(t,e,n,i){if(e)switch(e){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(i)throw new Error("Unsupported U escape")})),h.graph=void 0!==t[9]?{termType:s,value:t[9]}:void 0!==t[10]?{termType:o,value:t[10]}:{termType:l,value:""},h.graph.value in n){let t=!0;const i=n[h.graph.value];for(const e of i)if(u(e,h)){t=!1;break}t&&(i.push(h),e.push(h))}else n[h.graph.value]=[h],e.push(h)}return e}static serialize(e){Array.isArray(e)||(e=t.legacyDatasetToQuads(e));const n=[];for(const i of e)n.push(t.serializeQuad(i));return n.sort().join("")}static serializeQuad(t){const e=t.subject,n=t.object,a=t.graph;let l="";return l+=e.termType===s?`<${e.value}>`:`${e.value}`,l+=` <${t.predicate.value}> `,n.termType===s?l+=`<${n.value}>`:n.termType===o?l+=n.value:(l+=`"${c=n.value,c.replace(h,function(t){switch(t){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,n.datatype.value===i?n.language&&(l+=`@${n.language}`):n.datatype.value!==r&&(l+=`^^<${n.datatype.value}>`)),a.termType===s?l+=` <${a.value}>`:a.termType===o&&(l+=` ${a.value}`),l+=" .\n",l;var c}static legacyDatasetToQuads(t){const e=[],n={"blank node":o,IRI:s,literal:a};for(const c in t)t[c].forEach(t=>{const u={};for(const e in t){const o=t[e],l={termType:n[o.type],value:o.value};l.termType===a&&(l.datatype={termType:s},"datatype"in o&&(l.datatype.value=o.datatype),"language"in o?("datatype"in o||(l.datatype.value=i),l.language=o.language):"datatype"in o||(l.datatype.value=r)),u[e]=l}u.graph="@default"===c?{termType:l,value:""}:{termType:c.startsWith("_:")?o:s,value:c},e.push(u)});return e}};const h=/["\\\n\r]/g;const d=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(t,e,n){"use strict";e.exports=class{constructor(t){this.current=t.sort(),this.done=!1,this.dir=new Map;for(let e=0;ei)&&(a&&o>0&&n>t[o-1]||!a&&ot[o+1])&&(i=n,r=o)}if(null===i)this.done=!0;else{const n=e.get(i)?r-1:r+1;t[r]=t[n],t[n]=i;for(const r of t)r>i&&e.set(r,!e.get(r))}return n}}},{}],51:[function(t,e,n){(function(n){(function(){"use strict";const r=t("./IdentifierIssuer"),s=t("./MessageDigest"),o=t("./Permuter"),a=t("./NQuads");function l(t,e){return t.hashe.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){var e=this;return i(function*(){e.quads=t;for(const r of t)e._addBlankNodeQuadInfo({quad:r,component:r.subject}),e._addBlankNodeQuadInfo({quad:r,component:r.object}),e._addBlankNodeQuadInfo({quad:r,component:r.graph});const n=new Map,i=[...e.blankNodeInfo.keys()];let s=0;for(const t of i)++s%100==0&&(yield e._yield()),yield e._hashAndTrackBlankNode({id:t,hashToBlankNodes:n});const o=[...n.keys()].sort(),c=[];for(const t of o){const i=n.get(t);i.length>1?c.push(i):e.canonicalIssuer.getId(i[0])}for(const t of c){const n=[];for(const i of t){if(e.canonicalIssuer.hasId(i))continue;const t=new r("_:b");t.getId(i);const s=yield e.hashNDegreeQuads(i,t);n.push(s)}n.sort(l);for(const t of n){const n=t.issuer.getOldIds();for(const t of n)e.canonicalIssuer.getId(t)}}const u=[];for(const t of e.quads){const n=bt({},t);n.subject=e._useCanonicalId({component:n.subject}),n.object=e._useCanonicalId({component:n.object}),n.graph=e._useCanonicalId({component:n.graph}),u.push(a.serializeQuad(n))}return u.sort(),u.join("")})()}hashFirstDegreeQuads(t){var e=this;return i(function*(){const n=[],i=e.blankNodeInfo.get(t),r=i.quads;for(const s of r){const i={subject:null,predicate:s.predicate,object:null,graph:null};i.subject=e.modifyFirstDegreeComponent(t,s.subject,"subject"),i.object=e.modifyFirstDegreeComponent(t,s.object,"object"),i.graph=e.modifyFirstDegreeComponent(t,s.graph,"graph"),n.push(a.serializeQuad(i))}n.sort();const o=new s(e.hashAlgorithm);for(const t of n)o.update(t);return i.hash=yield o.digest(),i.hash})()}hashRelatedBlankNode(t,e,n,r){var o=this;return i(function*(){let i;i=o.canonicalIssuer.hasId(t)?o.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):o.blankNodeInfo.get(t).hash;const a=new s(o.hashAlgorithm);return a.update(r),"g"!==r&&a.update(o.getRelatedPredicate(e)),a.update(i),a.digest()})()}hashNDegreeQuads(t,e){var n=this;return i(function*(){const i=new s(n.hashAlgorithm),r=yield n.createHashToRelated(t,e),a=[...r.keys()].sort();for(const t of a){i.update(t);let s,a="";const l=new o(r.get(t));let c=0;for(;l.hasNext();){const t=l.next();++c%3==0&&(yield n._yield());let i=e.clone(),r="";const o=[];let u=!1;for(const e of t)if(n.canonicalIssuer.hasId(e)?r+=n.canonicalIssuer.getId(e):(i.hasId(e)||o.push(e),r+=i.getId(e)),0!==a.length&&r>a){u=!0;break}if(!u){for(const t of o){const e=yield n.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==a.length&&r>a){u=!0;break}}u||(0===a.length||r`}createHashToRelated(t,e){var n=this;return i(function*(){const i=new Map,r=n.blankNodeInfo.get(t).quads;let s=0;for(const o of r)++s%100==0&&(yield n._yield()),yield Promise.all([n._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:t,issuer:e,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:t,issuer:e,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:t,issuer:e,hashToRelated:i})]);return i})()}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){var n=this;return i(function*(){const i=yield n.hashFirstDegreeQuads(t),r=e.get(i);r?r.push(t):e.set(i,[t])})()}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:n,id:r,issuer:s,hashToRelated:o}){var a=this;return i(function*(){if("BlankNode"!==e.termType||e.value===r)return;const i=e.value,l=yield a.hashRelatedBlankNode(i,t,s,n),c=o.get(l);c?c.push(i):o.set(l,[i])})()}_useCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}_yield(){return i(function*(){return new Promise(t=>n(t))})()}}}).call(this)}).call(this,t("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(t,e,n){"use strict";const i=t("./IdentifierIssuer"),r=t("./MessageDigest"),s=t("./Permuter"),o=t("./NQuads");function a(t,e){return t.hashe.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){this.quads=t;for(const i of t)this._addBlankNodeQuadInfo({quad:i,component:i.subject}),this._addBlankNodeQuadInfo({quad:i,component:i.object}),this._addBlankNodeQuadInfo({quad:i,component:i.graph});const e=new Map,n=[...this.blankNodeInfo.keys()];for(const i of n)this._hashAndTrackBlankNode({id:i,hashToBlankNodes:e});const r=[...e.keys()].sort(),s=[];for(const i of r){const t=e.get(i);t.length>1?s.push(t):this.canonicalIssuer.getId(t[0])}for(const o of s){const t=[];for(const e of o){if(this.canonicalIssuer.hasId(e))continue;const n=new i("_:b");n.getId(e);const r=this.hashNDegreeQuads(e,n);t.push(r)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const i of this.quads){const t=bt({},i);t.subject=this._useCanonicalId({component:t.subject}),t.object=this._useCanonicalId({component:t.object}),t.graph=this._useCanonicalId({component:t.graph}),l.push(o.serializeQuad(t))}return l.sort(),l.join("")}hashFirstDegreeQuads(t){const e=[],n=this.blankNodeInfo.get(t),i=n.quads;for(const r of i){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(t,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(t,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(t,r.graph,"graph"),e.push(o.serializeQuad(n))}e.sort();const s=new r(this.hashAlgorithm);for(const r of e)s.update(r);return n.hash=s.digest(),n.hash}hashRelatedBlankNode(t,e,n,i){let s;s=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):this.blankNodeInfo.get(t).hash;const o=new r(this.hashAlgorithm);return o.update(i),"g"!==i&&o.update(this.getRelatedPredicate(e)),o.update(s),o.digest()}hashNDegreeQuads(t,e){const n=new r(this.hashAlgorithm),i=this.createHashToRelated(t,e),o=[...i.keys()].sort();for(const r of o){n.update(r);let t,o="";const a=new s(i.get(r));for(;a.hasNext();){const n=a.next();let i=e.clone(),r="";const s=[];let l=!1;for(const t of n)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(i.hasId(t)||s.push(t),r+=i.getId(t)),0!==o.length&&r>o){l=!0;break}if(!l){for(const t of s){const e=this.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==o.length&&r>o){l=!0;break}}l||(0===o.length||r`}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i)this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:t,issuer:e,hashToRelated:n});return n}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){const n=this.hashFirstDegreeQuads(t),i=e.get(n);i?i.push(t):e.set(n,[t])}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:n,id:i,issuer:r,hashToRelated:s}){if("BlankNode"!==e.termType||e.value===i)return;const o=e.value,a=this.hashRelatedBlankNode(o,t,r,n),l=s.get(a);l?l.push(o):s.set(a,[o])}_useCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(t,e,n){"use strict";const r=t("./URDNA2015");e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){var n=this;return i(function*(){const i=new Map,r=n.blankNodeInfo.get(t).quads;let s=0;for(const o of r){let r,a;if("BlankNode"===o.subject.termType&&o.subject.value!==t)a=o.subject.value,r="p";else{if("BlankNode"!==o.object.termType||o.object.value===t)continue;a=o.object.value,r="r"}++s%100==0&&(yield n._yield());const l=yield n.hashRelatedBlankNode(a,o,e,r),c=i.get(l);c?c.push(a):i.set(l,[a])}return i})()}}},{"./URDNA2015":51}],54:[function(t,e,n){"use strict";const i=t("./URDNA2015Sync");e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i){let i,s;if("BlankNode"===r.subject.termType&&r.subject.value!==t)s=r.subject.value,i="p";else{if("BlankNode"!==r.object.termType||r.object.value===t)continue;s=r.object.value,i="r"}const o=this.hashRelatedBlankNode(s,r,e,i),a=n.get(o);a?a.push(s):n.set(o,[s])}return n}}},{"./URDNA2015Sync":52}],55:[function(t,e,n){"use strict";const r=t("./URDNA2015"),s=t("./URGNA2012"),o=t("./URDNA2015Sync"),a=t("./URGNA2012Sync");let l;try{l=t("rdf-canonize-native")}catch(u){}const c={};e.exports=c,c.NQuads=t("./NQuads"),c.IdentifierIssuer=t("./IdentifierIssuer"),c._rdfCanonizeNative=function(t){return t&&(l=t),l},c.canonize=function(){var t=i(function*(t,e){if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),e.useNative){if(!l)throw new Error("rdf-canonize-native not available");return new Promise((n,i)=>l.canonize(t,e,(t,e)=>t?i(t):n(e)))}if("URDNA2015"===e.algorithm)return new r(e).main(t);if("URGNA2012"===e.algorithm)return new s(e).main(t);throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(e,n){return t.apply(this,arguments)}}(),c._canonizeSync=function(t,e){if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),e.useNative){if(l)return l.canonizeSync(t,e);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===e.algorithm)return new o(e).main(t);if("URGNA2012"===e.algorithm)return new a(e).main(t);throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(t("./lib/BlankNode"),n),r(t("./lib/DataFactory"),n),r(t("./lib/DefaultGraph"),n),r(t("./lib/Literal"),n),r(t("./lib/NamedNode"),n),r(t("./lib/Quad"),n),r(t("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0;n.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&"BlankNode"===t.termType&&t.value===this.value}}},{}],58:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;const i=t("./BlankNode"),r=t("./DefaultGraph"),s=t("./Literal"),o=t("./NamedNode"),a=t("./Quad"),l=t("./Variable");let c=0;n.DataFactory=class{constructor(t){this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||`df_${c++}_`}namedNode(t){return new o.NamedNode(t)}blankNode(t){return new i.BlankNode(t||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(t,e){return new s.Literal(t,e)}variable(t){return new l.Variable(t)}defaultGraph(){return r.DefaultGraph.INSTANCE}quad(t,e,n,i){return new a.Quad(t,e,n,i||this.defaultGraph())}fromTerm(t){switch(t.termType){case"NamedNode":return this.namedNode(t.value);case"BlankNode":return this.blankNode(t.value);case"Literal":return t.language?this.literal(t.value,t.language):t.datatype.equals(s.Literal.XSD_STRING)?this.literal(t.value):this.literal(t.value,this.fromTerm(t.datatype));case"Variable":return this.variable(t.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(t.subject),this.fromTerm(t.predicate),this.fromTerm(t.object),this.fromTerm(t.graph))}}fromQuad(t){return this.fromTerm(t)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;class i{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&"DefaultGraph"===t.termType}}n.DefaultGraph=i,i.INSTANCE=new i},{}],60:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;const i=t("./NamedNode");class r{constructor(t,e){this.termType="Literal",this.value=t,"string"==typeof e?(this.language=e,this.datatype=r.RDF_LANGUAGE_STRING):e?(this.language="",this.datatype=e):(this.language="",this.datatype=r.XSD_STRING)}equals(t){return!!t&&"Literal"===t.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}n.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0;n.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&"NamedNode"===t.termType&&t.value===this.value}}},{}],62:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0;n.Quad=class{constructor(t,e,n,i){this.termType="Quad",this.value="",this.subject=t,this.predicate=e,this.object=n,this.graph=i}equals(t){return!!t&&("Quad"===t.termType||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},{}],63:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0;n.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&"Variable"===t.termType&&t.value===this.value}}},{}],64:[function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(t("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;class i extends Error{constructor(t,e){const n=t.saxStream._parser;super(t.trackPosition?`Line ${n.line+1} column ${n.column+1}: ${e}`:e)}}n.ParseError=i},{}],66:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;const i=t("relative-to-absolute-iri"),r=t("sax"),s=t("stream"),o=t("./ParseError"),a=t("rdf-data-factory");class l extends s.Transform{constructor(t){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},t&&(Object.assign(this,t),this.options=t),this.dataFactory||(this.dataFactory=new a.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=r.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(t,e){const n={};let i=!1;for(const s in t.attributes)s.startsWith("xmlns")&&(5===s.length?(i=!0,n[""]=t.attributes[s]):":"===s.charAt(5)&&(i=!0,n[s.substr(6)]=t.attributes[s]));const r=e&&e.ns?e.ns:[l.DEFAULT_NS];return i?r.concat([n]):r}static expandPrefixedTerm(t,e,n){const i=t.indexOf(":");let r,s;i>=0?(r=t.substr(0,i),s=t.substr(i+1)):(r="",s=t);let a=null,l=null;for(let o=e.length-1;o>=0;o--){const t=e[o][r];if(t){a=t;break}l||(l=e[o][""])}if(!a){if(r&&"xmlns"!==r)throw new o.ParseError(n,`The prefix '${r}' in term '${t}' was not bound.`);a=l||""}return{prefix:r,local:s,uri:a}}static isValidIri(t){return l.IRI_REGEX.test(t)}import(t){const e=new s.PassThrough({readableObjectMode:!0});t.on("error",t=>n.emit("error",t)),t.on("data",t=>e.push(t)),t.on("end",()=>e.push(null));const n=e.pipe(new l(this.options));return n}_transform(t,e,n){try{this.saxStream.write(t,e)}catch(i){return n(i)}n()}newParseError(t){return new o.ParseError(this,t)}valueToUri(t,e){return this.uriToNamedNode(i.resolve(t,e.baseIRI))}uriToNamedNode(t){if(!l.isValidIri(t))throw this.newParseError(`Invalid URI: ${t}`);return this.dataFactory.namedNode(t)}validateNcname(t){if(!l.NCNAME_MATCHER.test(t))throw this.newParseError(`Not a valid NCName: ${t}`)}attachSaxListeners(){this.saxStream.on("error",t=>this.emit("error",t)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(t){const e=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let n=c.RESOURCE;if(e&&(e.hadChildren=!0,n=e.childrenParseType),e&&e.childrenStringTags){const n=t.name;let i="";for(const e in t.attributes)i+=` ${e}="${t.attributes[e]}"`;e.childrenStringTags.push(`<${n}${i}>`);const r={childrenStringTags:e.childrenStringTags};return r.childrenStringEmitClosingTag=``,void this.activeTagStack.push(r)}const i={};e?(i.language=e.language,i.baseIRI=e.baseIRI):i.baseIRI=this.baseIRI,this.activeTagStack.push(i),i.ns=l.parseNamespace(t,e),n===c.RESOURCE?this.onTagResource(t,i,e,!e):this.onTagProperty(t,i,e)}onTagResource(t,e,n,r){const s=l.expandPrefixedTerm(t.name,e.ns,this);e.childrenParseType=c.PROPERTY;let o=!0;if(s.uri===l.RDF){if(!r&&l.FORBIDDEN_NODE_ELEMENTS.indexOf(s.local)>=0)throw this.newParseError(`Illegal node element name: ${s.local}`);switch(s.local){case"RDF":e.childrenParseType=c.RESOURCE;case"Description":o=!1}}const a=[],u=[];let h=null,d=!1,p=!1,f=null;for(const c in t.attributes){const r=t.attributes[c],s=l.expandPrefixedTerm(c,e.ns,this);if(n&&s.uri===l.RDF)switch(s.local){case"about":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);h=r;continue;case"ID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);this.validateNcname(r),h="#"+r,d=!0;continue;case"nodeID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);this.validateNcname(r),h=r,p=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":f=r;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(s.uri===l.XML){if("lang"===s.local){e.language=""===r?null:r.toLowerCase();continue}if("base"===s.local){e.baseIRI=i.resolve(r,e.baseIRI);continue}}"xml"!==s.prefix&&s.uri&&(a.push(this.uriToNamedNode(s.uri+s.local)),u.push(r))}if(null!==h&&(e.subject=p?this.dataFactory.blankNode(h):this.valueToUri(h,e),d&&this.claimNodeId(e.subject)),e.subject||(e.subject=this.dataFactory.blankNode()),o){const t=this.uriToNamedNode(s.uri+s.local);this.emitTriple(e.subject,this.dataFactory.namedNode(l.RDF+"type"),t,n?n.reifiedStatementId:null)}if(n){if(n.predicate)if(n.childrenCollectionSubject){const t=this.dataFactory.blankNode();this.emitTriple(n.childrenCollectionSubject,n.childrenCollectionPredicate,t,n.reifiedStatementId),this.emitTriple(t,this.dataFactory.namedNode(l.RDF+"first"),e.subject,e.reifiedStatementId),n.childrenCollectionSubject=t,n.childrenCollectionPredicate=this.dataFactory.namedNode(l.RDF+"rest")}else{this.emitTriple(n.subject,n.predicate,e.subject,n.reifiedStatementId);for(let t=0;t=0)throw this.newParseError(`Illegal property element name: ${i.local}`);e.predicateSubPredicates=[],e.predicateSubObjects=[];let r=!1,s=!1,o=null,a=!0;const u=[],h=[];for(const d in t.attributes){const n=t.attributes[d],i=l.expandPrefixedTerm(d,e.ns,this);if(i.uri===l.RDF)switch(i.local){case"resource":if(o)throw this.newParseError(`Found both rdf:resource (${n}) and rdf:nodeID (${o}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${n})`);e.hadChildren=!0,o=n,a=!1;continue;case"datatype":if(s)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${n}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${n})`);e.datatype=this.valueToUri(n,e);continue;case"nodeID":if(s)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${n}).`);if(e.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${n}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${n})`);this.validateNcname(n),e.hadChildren=!0,o=n,a=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(s)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(e.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${e.datatype.value})`);if(o)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${o})`);if("Resource"===n){r=!0,e.childrenParseType=c.PROPERTY;const t=this.dataFactory.blankNode();this.emitTriple(e.subject,e.predicate,t,e.reifiedStatementId),e.subject=t,e.predicate=null}else"Collection"===n?(r=!0,e.hadChildren=!0,e.childrenCollectionSubject=e.subject,e.childrenCollectionPredicate=e.predicate,a=!1):"Literal"===n&&(r=!0,e.childrenTagsToString=!0,e.childrenStringTags=[]);continue;case"ID":this.validateNcname(n),e.reifiedStatementId=this.valueToUri("#"+n,e),this.claimNodeId(e.reifiedStatementId);continue}else if(i.uri===l.XML&&"lang"===i.local){e.language=""===n?null:n.toLowerCase();continue}if("xml"!==i.prefix&&"xmlns"!==i.prefix&&i.uri){if(r||e.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${n}`);e.hadChildren=!0,s=!0,u.push(this.uriToNamedNode(i.uri+i.local)),h.push(this.dataFactory.literal(n,e.datatype||e.language))}}if(null!==o){const t=e.subject;e.subject=a?this.dataFactory.blankNode(o):this.valueToUri(o,e),this.emitTriple(t,e.predicate,e.subject,e.reifiedStatementId);for(let n=0;n/g,(t,e,n)=>(this.saxStream._parser.ENTITIES[e]=n,""))}}var c,u;n.RdfXmlParser=l,l.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,l.MIME_TYPE="application/rdf+xml",l.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",l.XML="http://www.w3.org/XML/1998/namespace",l.XMLNS="http://www.w3.org/2000/xmlns/",l.DEFAULT_NS={xml:l.XML},l.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],l.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],l.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,(u=c=n.ParseType||(n.ParseType={}))[u.RESOURCE=0]="RESOURCE",u[u.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(t,e,n){"use strict";var i={};function r(t,e,n){n||(n=Error);var r=function(t){function n(n,i,r){return t.call(this,function(t,n,i){return"string"==typeof e?e:e(t,n,i)}(n,i,r))||this}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(n,t),n}(n);r.prototype.name=n.name,r.prototype.code=t,i[t]=r}function s(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map(function(t){return String(t)}),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,n){var i,r;if("string"==typeof e&&function(t,e,n){return t.substr(!n||n<0?0:+n,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))r="The ".concat(t," ").concat(i," ").concat(s(e,"type"));else{var o=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";r='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(s(e,"type"))}return r+". Received type ".concat(typeof n)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},{}],68:[function(t,e,n){(function(n){(function(){"use strict";var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};e.exports=c;var r=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(c,r);for(var o=i(s.prototype),a=0;a0)if("string"!=typeof e&&!o.objectMode&&Object.getPrototypeOf(e)!==a.prototype&&(e=function(t){return a.from(t)}(e)),i)o.endEmitted?x(t,new w):T(t,o,e,!0);else if(o.ended)x(t,new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(e=o.decoder.write(e),o.objectMode||0!==e.length?T(t,o,e,!1):M(t,o)):T(t,o,e,!1)}else i||(o.reading=!1,M(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(I,t))}function I(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,j(t)}function M(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(D,t,e))}function D(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){c("readable nexttick read 0"),t.read(0)}function L(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(V,e,t))}function V(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function z(t,e){for(var n=0,i=t.length;n=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):P(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&B(this),null;var i,r=e.needReadable;return c("need readable",r),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&B(this)),null!==i&&this.emit("data",i),i},C.prototype._read=function(t){x(this,new _("_read()"))},C.prototype.pipe=function(t,e){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,c("pipe count=%d opts=%j",r.pipesCount,e);var o=e&&!1===e.end||t===n.stdout||t===n.stderr?m:l;function a(e,n){c("onunpipe"),e===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),t.removeListener("close",f),t.removeListener("finish",g),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",m),i.removeListener("data",d),h=!0,r.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u())}function l(){c("onend"),t.end()}r.endEmitted?n.nextTick(o):i.once("end",o),t.on("unpipe",a);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,j(t))}}(i);t.on("drain",u);var h=!1;function d(e){c("ondata");var n=t.write(e);c("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==z(r.pipes,t))&&!h&&(c("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function p(e){c("onerror",e),m(),t.removeListener("error",p),0===s(t,"error")&&x(t,e)}function f(){t.removeListener("finish",g),m()}function g(){c("onfinish"),t.removeListener("close",f),m()}function m(){c("unpipe"),i.unpipe(t)}return i.on("data",d),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",p),t.once("close",f),t.once("finish",g),t.emit("pipe",i),r.flowing||(c("pipe resume"),i.resume()),t},C.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var i=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s0,!1!==r.flowing&&this.resume()):"readable"===t&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,c("on readable",r.length,r.reading),r.length?P(this):r.reading||n.nextTick(N,this)),i},C.prototype.removeListener=function(t,e){var i=o.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(R,this),i},C.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.nextTick(R,this),e},C.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(L,t,e))}(this,t)),t.paused=!1,this},C.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(t){var e=this,n=this._readableState,i=!1;for(var r in t.on("end",function(){if(c("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(r){c("wrapped data"),n.decoder&&(r=n.decoder.write(r)),n.objectMode&&null==r||!(n.objectMode||r&&r.length)||e.push(r)||(i=!0,t.pause())}),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));for(var s=0;s-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(t,e,n){n(new g("_write()"))},C.prototype._writev=null,C.prototype.end=function(t,e,i){var r=this._writableState;return"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,i){e.ending=!0,M(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i)),e.ended=!0,t.writable=!1}(this,r,i),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){!this._writableState||(this._writableState.destroyed=t)}}),C.prototype.destroy=h.destroy,C.prototype._undestroy=h.undestroy,C.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(t,e,n){(function(n){(function(){"use strict";var i;function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=t("./end-of-stream"),o=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function f(t){var e=t[o];if(null!==e){var n=t[d].read();null!==n&&(t[u]=null,t[o]=null,t[a]=null,e(p(n,!1)))}}function g(t){n.nextTick(f,t)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((r(i={get stream(){return this[d]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(e,i){n.nextTick(function(){t[l]?i(t[l]):e(p(void 0,!0))})});var i,r=this[u];if(r)i=new Promise(function(t,e){return function(n,i){t.then(function(){e[c]?n(p(void 0,!0)):e[h](n,i)},i)}}(r,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(p(s,!1));i=new Promise(this[h])}return this[u]=i,i}},Symbol.asyncIterator,function(){return this}),r(i,"return",function(){var t=this;return new Promise(function(e,n){t[d].destroy(null,function(t){t?n(t):e(p(void 0,!0))})})}),i),m);e.exports=function(t){var e,n=Object.create(b,(r(e={},d,{value:t,writable:!0}),r(e,o,{value:null,writable:!0}),r(e,a,{value:null,writable:!0}),r(e,l,{value:null,writable:!0}),r(e,c,{value:t._readableState.endEmitted,writable:!0}),r(e,h,{value:function(t,e){var i=n[d].read();i?(n[u]=null,n[o]=null,n[a]=null,t(p(i,!1))):(n[o]=t,n[a]=e)},writable:!0}),e));return n[u]=null,s(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[a];return null!==e&&(n[u]=null,n[o]=null,n[a]=null,e(t)),void(n[l]=t)}var i=n[o];null!==i&&(n[u]=null,n[o]=null,n[a]=null,i(p(void 0,!0))),n[c]=!0}),t.on("readable",g.bind(null,n)),n}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":76,_process:44}],74:[function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){for(var n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e=o.allocUnsafe(t>>>0),n=this.head,i=0;n;)c(n.data,e,i),i+=n.data.length,n=n.next;return e}},{key:"consume",value:function(t,e){var n;return tr.length?r.length:t;if(i+=s===r.length?r:r.slice(0,t),0==(t-=s)){s===r.length?(++n,this.head=e.next?e.next:this.tail=null):(this.head=e,e.data=r.slice(s));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),n=this.head,i=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var r=n.data,s=t>r.length?r.length:t;if(r.copy(e,e.length-t,0,s),0==(t-=s)){s===r.length?(++i,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=r.slice(s));break}++i}return this.length-=i,e}},{key:l,value:function(t,e){return a(this,function(t){for(var e=1;e0,function(t){r||(r=t),t&&o.forEach(c),!s&&(o.forEach(c),i(r))})});return e.reduce(u)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(t,e,n){"use strict";var i=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,r){var s=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,r,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(r?n:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},{"../../../errors":67}],80:[function(t,e,n){e.exports=t("events").EventEmitter},{events:8}],81:[function(t,e,n){(n=e.exports=t("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=t("./lib/_stream_writable.js"),n.Duplex=t("./lib/_stream_duplex.js"),n.Transform=t("./lib/_stream_transform.js"),n.PassThrough=t("./lib/_stream_passthrough.js"),n.finished=t("./lib/internal/streams/end-of-stream.js"),n.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}(t("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(t,e,n){"use strict";function i(t){const e=[];let n=0;for(;nt.join("")).join("/")}function r(t,e){let n=e+1;e>=0?"/"===t[e+1]&&"/"===t[e+2]&&(n=e+3):"/"===t[0]&&"/"===t[1]&&(n=2);const r=t.indexOf("/",n);return r<0?t:t.substr(0,r)+i(t.substr(r))}function s(t){return!t||"#"===t||"?"===t||"/"===t}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(t,e){const n=(e=e||"").indexOf("#");if(n>0&&(e=e.substr(0,n)),!t.length){if(e.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);return e}if(t.startsWith("?")){const n=e.indexOf("?");return n>0&&(e=e.substr(0,n)),e+t}if(t.startsWith("#"))return e+t;if(!e.length){const e=t.indexOf(":");if(e<0)throw new Error(`Found invalid relative IRI '${t}' for a missing baseIRI`);return r(t,e)}const s=t.indexOf(":");if(s>=0)return r(t,s);const o=e.indexOf(":");if(o<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);const a=e.substr(0,o+1);if(0===t.indexOf("//"))return a+r(t,s);let l;if(e.indexOf("//",o)===o+1){if(l=e.indexOf("/",o+3),l<0)return e.length>o+3?e+"/"+r(t,s):a+r(t,s)}else if(l=e.indexOf("/",o+1),l<0)return a+r(t,s);if(0===t.indexOf("/"))return e.substr(0,l)+i(t);let c=e.substr(l);const u=c.lastIndexOf("/");return u>=0&&u"===s?(O(e,"onsgmldeclaration",e.sgmlDecl),e.sgmlDecl="",e.state=S.TEXT):(m(s)&&(e.state=S.SGML_DECL_QUOTED),e.sgmlDecl+=s);continue;case S.SGML_DECL_QUOTED:s===e.q&&(e.state=S.SGML_DECL,e.q=""),e.sgmlDecl+=s;continue;case S.DOCTYPE:">"===s?(e.state=S.TEXT,O(e,"ondoctype",e.doctype),e.doctype=!0):(e.doctype+=s,"["===s?e.state=S.DOCTYPE_DTD:m(s)&&(e.state=S.DOCTYPE_QUOTED,e.q=s));continue;case S.DOCTYPE_QUOTED:e.doctype+=s,s===e.q&&(e.q="",e.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:e.doctype+=s,"]"===s?e.state=S.DOCTYPE:m(s)&&(e.state=S.DOCTYPE_DTD_QUOTED,e.q=s);continue;case S.DOCTYPE_DTD_QUOTED:e.doctype+=s,s===e.q&&(e.state=S.DOCTYPE_DTD,e.q="");continue;case S.COMMENT:"-"===s?e.state=S.COMMENT_ENDING:e.comment+=s;continue;case S.COMMENT_ENDING:"-"===s?(e.state=S.COMMENT_ENDED,e.comment=k(e.opt,e.comment),e.comment&&O(e,"oncomment",e.comment),e.comment=""):(e.comment+="-"+s,e.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==s?(I(e,"Malformed comment"),e.comment+="--"+s,e.state=S.COMMENT):e.state=S.TEXT;continue;case S.CDATA:"]"===s?e.state=S.CDATA_ENDING:e.cdata+=s;continue;case S.CDATA_ENDING:"]"===s?e.state=S.CDATA_ENDING_2:(e.cdata+="]"+s,e.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===s?(e.cdata&&O(e,"oncdata",e.cdata),O(e,"onclosecdata"),e.cdata="",e.state=S.TEXT):"]"===s?e.cdata+="]":(e.cdata+="]]"+s,e.state=S.CDATA);continue;case S.PROC_INST:"?"===s?e.state=S.PROC_INST_ENDING:g(s)?e.state=S.PROC_INST_BODY:e.procInstName+=s;continue;case S.PROC_INST_BODY:if(!e.procInstBody&&g(s))continue;"?"===s?e.state=S.PROC_INST_ENDING:e.procInstBody+=s;continue;case S.PROC_INST_ENDING:">"===s?(O(e,"onprocessinginstruction",{name:e.procInstName,body:e.procInstBody}),e.procInstName=e.procInstBody="",e.state=S.TEXT):(e.procInstBody+="?"+s,e.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:y(d,s)?e.tagName+=s:(M(e),">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:(g(s)||I(e,"Invalid character in tag name"),e.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===s?(N(e,!0),L(e)):(I(e,"Forward-slash in opening tag not followed by >"),e.state=S.ATTRIB);continue;case S.ATTRIB:if(g(s))continue;">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:y(h,s)?(e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):I(e,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===s?e.state=S.ATTRIB_VALUE:">"===s?(I(e,"Attribute without value"),e.attribValue=e.attribName,R(e),N(e)):g(s)?e.state=S.ATTRIB_NAME_SAW_WHITE:y(d,s)?e.attribName+=s:I(e,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===s)e.state=S.ATTRIB_VALUE;else{if(g(s))continue;I(e,"Attribute without value"),e.tag.attributes[e.attribName]="",e.attribValue="",O(e,"onattribute",{name:e.attribName,value:""}),e.attribName="",">"===s?N(e):y(h,s)?(e.attribName=s,e.state=S.ATTRIB_NAME):(I(e,"Invalid attribute name"),e.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(g(s))continue;m(s)?(e.q=s,e.state=S.ATTRIB_VALUE_QUOTED):(I(e,"Unquoted attribute value"),e.state=S.ATTRIB_VALUE_UNQUOTED,e.attribValue=s);continue;case S.ATTRIB_VALUE_QUOTED:if(s!==e.q){"&"===s?e.state=S.ATTRIB_VALUE_ENTITY_Q:e.attribValue+=s;continue}R(e),e.q="",e.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:g(s)?e.state=S.ATTRIB:">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:y(h,s)?(I(e,"No whitespace between attributes"),e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):I(e,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!b(s)){"&"===s?e.state=S.ATTRIB_VALUE_ENTITY_U:e.attribValue+=s;continue}R(e),">"===s?N(e):e.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(e.tagName)">"===s?L(e):y(d,s)?e.tagName+=s:e.script?(e.script+=""===s?L(e):I(e,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var a,l;switch(e.state){case S.TEXT_ENTITY:a=S.TEXT,l="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:a=S.ATTRIB_VALUE_QUOTED,l="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:a=S.ATTRIB_VALUE_UNQUOTED,l="attribValue"}";"===s?(e[l]+=j(e),e.entity="",e.state=a):y(e.entity.length?f:p,s)?e.entity+=s:(I(e,"Invalid character in entity name"),e[l]+="&"+e.entity+s,e.entity="",e.state=a);continue;default:throw new Error(e,"Unknown state: "+e.state)}return e.position>=e.bufferCheckPosition&&function(t){for(var e=Math.max(n.MAX_BUFFER_LENGTH,10),i=0,s=0,o=r.length;se)switch(r[s]){case"textNode":T(t);break;case"cdata":O(t,"oncdata",t.cdata),t.cdata="";break;case"script":O(t,"onscript",t.script),t.script="";break;default:A(t,"Max buffer length exceeded: "+r[s])}i=Math.max(i,a)}t.bufferCheckPosition=n.MAX_BUFFER_LENGTH-i+t.position}(e),e},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(t){T(t),""!==t.cdata&&(O(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(O(t,"onscript",t.script),t.script="")}(this)}};try{i=t("stream").Stream}catch(_){i=function(){}}var o=n.EVENTS.filter(function(t){return"error"!==t&&"end"!==t});function a(t,e){if(!(this instanceof a))return new a(t,e);i.apply(this),this._parser=new s(t,e),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(t){n.emit("error",t),n._parser.error=null},this._decoder=null,o.forEach(function(t){Object.defineProperty(n,"on"+t,{get:function(){return n._parser["on"+t]},set:function(e){if(!e)return n.removeAllListeners(t),n._parser["on"+t]=e,e;n.on(t,e)},enumerable:!0,configurable:!1})})}(a.prototype=Object.create(i.prototype,{constructor:{value:a}})).write=function(n){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(n)){if(!this._decoder){var i=t("string_decoder").StringDecoder;this._decoder=new i("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},a.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},a.prototype.on=function(t,e){var n=this;return!n._parser["on"+t]&&-1!==o.indexOf(t)&&(n._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),n.emit.apply(n,e)}),i.prototype.on.call(n,t,e)};var l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",u={xml:l,xmlns:c},h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function m(t){return'"'===t||"'"===t}function b(t){return">"===t||g(t)}function y(t,e){return t.test(e)}function v(t,e){return!y(t,e)}var _,w,x,S=0;for(var E in n.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(t){var e=n.ENTITIES[t],i="number"==typeof e?String.fromCharCode(e):e;n.ENTITIES[t]=i}),n.STATE)n.STATE[n.STATE[E]]=E;function C(t,e,n){t[e]&&t[e](n)}function O(t,e,n){t.textNode&&T(t),C(t,e,n)}function T(t){t.textNode=k(t.opt,t.textNode),t.textNode&&C(t,"ontext",t.textNode),t.textNode=""}function k(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function A(t,e){return T(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,C(t,"onerror",e),t}function P(t){return t.sawRoot&&!t.closedRoot&&I(t,"Unclosed root tag"),t.state!==S.BEGIN&&t.state!==S.BEGIN_WHITESPACE&&t.state!==S.TEXT&&A(t,"Unexpected end"),T(t),t.c="",t.closed=!0,C(t,"onend"),s.call(t,t.strict,t.opt),t}function I(t,e){if("object"!=typeof t||!(t instanceof s))throw new Error("bad call to strictFail");t.strict&&A(t,e)}function M(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,O(t,"onopentagstart",n)}function D(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),i=n[0],r=n[1];return e&&"xmlns"===t&&(i="xmlns",r=""),{prefix:i,local:r}}function R(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=D(t.attribName,!0),n=e.local;if("xmlns"===e.prefix)if("xml"===n&&t.attribValue!==l)I(t,"xml: prefix must be bound to "+l+"\nActual: "+t.attribValue);else if("xmlns"===n&&t.attribValue!==c)I(t,"xmlns: prefix must be bound to "+c+"\nActual: "+t.attribValue);else{var i=t.tag,r=t.tags[t.tags.length-1]||t;i.ns===r.ns&&(i.ns=Object.create(r.ns)),i.ns[n]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,O(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function N(t,e){if(t.opt.xmlns){var n=t.tag,i=D(t.tagName);n.prefix=i.prefix,n.local=i.local,n.uri=n.ns[i.prefix]||"",n.prefix&&!n.uri&&(I(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=i.prefix),n.ns&&(t.tags[t.tags.length-1]||t).ns!==n.ns&&Object.keys(n.ns).forEach(function(e){O(t,"onopennamespace",{prefix:e,uri:n.ns[e]})});for(var r=0,s=t.attribList.length;r",t.tagName="",void(t.state=S.SCRIPT);O(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var i=n;e--&&t.tags[e].name!==i;)I(t,"Unexpected close tag");if(e<0)return I(t,"Unmatched closing tag: "+t.tagName),t.textNode+="",void(t.state=S.TEXT);t.tagName=n;for(var r=t.tags.length;r-- >e;){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,O(t,"onclosetag",t.tagName);var o={};for(var a in s.ns)o[a]=s.ns[a];t.opt.xmlns&&s.ns!==(t.tags[t.tags.length-1]||t).ns&&Object.keys(s.ns).forEach(function(e){O(t,"onclosenamespace",{prefix:e,uri:s.ns[e]})})}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=S.TEXT}function j(t){var e,n=t.entity,i=n.toLowerCase(),r="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[i]?t.ENTITIES[i]:("#"===(n=i).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),r=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),r=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(e)||r.toLowerCase()!==n?(I(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function F(t,e){"<"===e?(t.state=S.OPEN_WAKA,t.startTagPosition=t.position):g(e)||(I(t,"Non-whitespace before first tag."),t.textNode=e,t.state=S.TEXT)}function B(t,e){var n="";return e1114111||w(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?e.push(s):e.push(55296+((s-=65536)>>10),s%1024+56320),(n+1===i||e.length>t)&&(r+=_.apply(null,e),e.length=0)}return r},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:x,configurable:!0,writable:!0}):String.fromCodePoint=x)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,t("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(t,e,n){(function(t,e){(function(){!function(e,n){"use strict";if(!e.setImmediate){var i,r=1,s={},o=!1,a=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick(function(){d(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(c="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(c)&&d(+t.data.slice(c.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),i=function(t){e.postMessage(c+t,"*")}):e.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){d(t.data)},i=function(e){t.port2.postMessage(e)}}():a&&"onreadystatechange"in a.createElement("script")?function(){var t=a.documentElement;i=function(e){var n=a.createElement("script");n.onreadystatechange=function(){d(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():i=function(t){setTimeout(d,0,t)},l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n.setImmediate="function"==typeof e?e:function(t){var e=l++,i=!(arguments.length<2)&&o.call(arguments,1);return a[e]=!0,r(function(){a[e]&&(i?t.apply(null,i):t.call(null),n.clearImmediate(e))}),e},n.clearImmediate="function"==typeof i?i:function(t){delete a[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(t,e,n){(function(t){(function(){function n(e){try{if(!t.localStorage)return!1}catch(i){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(t,e,n){"use strict";e.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},{}],92:[function(t,e,n){"use strict";function i(t){var e=this;if(e instanceof i||(e=new i),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach(function(t){e.push(t)});else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=t(n,i.value,r),i=i.next;return n},i.prototype.reduceReverse=function(t,e){var n,i=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=t(n,i.value,r),i=i.prev;return n},i.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},i.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},i.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new i;if(ethis.length&&(e=this.length);for(var r=0,s=this.head;null!==s&&rthis.length&&(e=this.length);for(var r=this.length,s=this.tail;null!==s&&r>e;r--)s=s.prev;for(;null!==s&&r>t;r--,s=s.prev)n.push(s.value);return n},i.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,s=this.head;null!==s&&i{return(t=n||(n={})).typeOfFunction="function",t.boolTrue=!0,n;var t})();function i(t,e,i){if(!i||typeof i.value!==n.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:n.boolTrue,get:function(){var t=i.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:n.boolTrue,writable:n.boolTrue}),t}}}e.ak=i,e.ZP=i},97266:function(t,e,n){t.exports={ResizeSensor:n(69835),ElementQueries:n(54845)}},54845:function(t,e,n){"use strict";var i,r,s;"undefined"!=typeof window&&window,r=[n(69835)],void 0!==(s="function"==typeof(i=function(t){var e=function(){var e,n={},i=[];function r(t){t||(t=document.documentElement);var e=window.getComputedStyle(t,null).fontSize;return parseFloat(e)||16}function s(t,e){var n=e.split(/\d/),i=n[n.length-1];switch(e=parseFloat(e),i){case"px":return e;case"em":return e*r(t);case"rem":return e*r();case"vw":return e*document.documentElement.clientWidth/100;case"vh":return e*document.documentElement.clientHeight/100;case"vmin":case"vmax":var s=document.documentElement.clientWidth/100,o=document.documentElement.clientHeight/100;return e*(0,Math["vmin"===i?"min":"max"])(s,o);default:return e}}function o(t,e){this.element=t;var i,r,o,a,l,c,u,h,d=["min-width","min-height","max-width","max-height"];this.call=function(){for(i in o=function(t){if(!t.getBoundingClientRect)return{width:t.offsetWidth,height:t.offsetHeight};var e=t.getBoundingClientRect();return{width:Math.round(e.width),height:Math.round(e.height)}}(this.element),c={},n[e])!n[e].hasOwnProperty(i)||(a=s(this.element,(r=n[e][i]).value),l="width"===r.property?o.width:o.height,u="","min"===r.mode&&l>=a&&(u+=r.value),"max"===r.mode&&l<=a&&(u+=r.value),c[h=r.mode+"-"+r.property]||(c[h]=""),u&&-1===(" "+c[h]+" ").indexOf(" "+u+" ")&&(c[h]+=" "+u));for(var t in d)!d.hasOwnProperty(t)||(c[d[t]]?this.element.setAttribute(d[t],c[d[t]].substr(1)):this.element.removeAttribute(d[t]))}}function a(e,n){e.elementQueriesSetupInformation||(e.elementQueriesSetupInformation=new o(e,n)),e.elementQueriesSensor||(e.elementQueriesSensor=new t(e,function(){e.elementQueriesSetupInformation.call()}))}function l(t,r,s,o){if(void 0===n[t]){n[t]=[];var a=i.length;e.innerHTML+="\n"+t+" {animation: 0.1s element-queries;}",e.innerHTML+="\n"+t+" > .resize-sensor {min-width: "+a+"px;}",i.push(t)}n[t].push({mode:r,property:s,value:o})}function c(t){var e;if(document.querySelectorAll&&(e=t?t.querySelectorAll.bind(t):document.querySelectorAll.bind(document)),!e&&"undefined"!=typeof $$&&(e=$$),!e&&"undefined"!=typeof jQuery&&(e=jQuery),!e)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return e}function u(e){var n=[],i=[],r=[],s=0,o=-1,a=[];for(var l in e.children)if(e.children.hasOwnProperty(l)&&e.children[l].tagName&&"img"===e.children[l].tagName.toLowerCase()){n.push(e.children[l]);var c=e.children[l].getAttribute("min-width")||e.children[l].getAttribute("data-min-width"),u=e.children[l].getAttribute("data-src")||e.children[l].getAttribute("url");r.push(u),i.push({minWidth:c}),c?e.children[l].style.display="none":(s=n.length-1,e.children[l].style.display="block")}function h(){var t,l=!1;for(t in n)!n.hasOwnProperty(t)||i[t].minWidth&&e.offsetWidth>i[t].minWidth&&(l=t);if(l||(l=s),o!==l)if(a[l])n[o].style.display="none",n[l].style.display="block",o=l;else{var c=new Image;c.onload=function(){n[l].src=r[l],n[o].style.display="none",n[l].style.display="block",a[l]=!0,o=l},c.src=r[l]}else n[l].src=r[l]}o=s,e.resizeSensorInstance=new t(e,h),h()}var h=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,d=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function p(t){var e,n,i,r;for(t=t.replace(/'/g,'"');null!==(e=h.exec(t));)for(n=e[1]+e[3],i=e[2];null!==(r=d.exec(i));)l(n,r[1],r[2],r[3])}function f(t){var e="";if(t)if("string"==typeof t)(-1!==(t=t.toLowerCase()).indexOf("min-width")||-1!==t.indexOf("max-width"))&&p(t);else for(var n=0,i=t.length;n img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",e.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(e),g=!0);for(var r=0,s=document.styleSheets.length;r0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,console&&console.warn&&console.warn(a)}return t}function O(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function T(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=O.bind(i);return r.listener=n,i.wrapFn=r,r}function k(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=r[t];if(void 0===a)return!1;if("function"==typeof a)v(a,this,e);else{var l=a.length,c=P(a,l);for(n=0;n=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},w.prototype.listeners=function(t){return k(this,t,!0)},w.prototype.rawListeners=function(t){return k(this,t,!1)},w.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):A.call(t,e)},w.prototype.listenerCount=A,w.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]},M.prototype.next=function(){if(this.done)return{done:!0};var t=this._next();return t.done&&(this.done=!0),t},"undefined"!=typeof Symbol&&(M.prototype[Symbol.iterator]=function(){return this}),M.of=function(){var t=arguments,e=t.length,n=0;return new M(function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}})},M.empty=function(){var t=new M(null);return t.done=!0,t},M.is=function(t){return t instanceof M||"object"==typeof t&&null!==t&&"function"==typeof t.next};var D=M,R=function(t,e){for(var n,i=arguments.length>1?e:1/0,r=i!==1/0?new Array(i):[],s=0;;){if(s===i)return r;if((n=t.next()).done)return s!==e?r.slice(0,s):r;r[s++]=n.value}},N=function(t){function n(e,n){var i;return(i=t.call(this)||this).name="GraphError",i.message=e||"",i.data=n||{},i}return e(n,t),n}(o(Error)),L=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N),j=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N),F=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N);function B(t,e){this.key=t,this.attributes=e,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function V(t,e){this.key=t,this.attributes=e,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function z(t,e){this.key=t,this.attributes=e,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function U(t,e,n,i,r,s){this.key=e,this.attributes=s,this.undirected=t,this.source=i,this.target=r,this.generatedKey=n}function H(t,e,n,i,r,s,o){var a,l,c="out",u="in";if(e&&(c=u="undirected"),t.multi){if(void 0===(l=(a=s[c])[r])&&(l=new Set,a[r]=l),l.add(n),i===r&&e)return;void 0===(a=o[u])[i]&&(a[i]=l)}else{if(s[c][r]=n,i===r&&e)return;o[u][i]=n}}function $(t,e,n){var i=t.multi,r=n.source,s=n.target,o=r.key,a=s.key,l=r[e?"undirected":"out"],c=e?"undirected":"in";if(a in l)if(i){var u=l[a];1===u.size?(delete l[a],delete s[c][o]):u.delete(n)}else delete l[a];i||delete s[c][o]}V.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},z.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var G=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes[i]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var r=""+t,s=""+arguments[1];if(!(i=c(this,r,s,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(r,'" - "').concat(s,'").'))}else if(!(i=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes.hasOwnProperty(i)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+i;if(i=arguments[2],r=arguments[3],!(s=c(this,o,a,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(s=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&s.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return s.attributes[i]=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+i;if(i=arguments[2],r=arguments[3],!(s=c(this,o,a,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(s=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("function"!=typeof r)throw new L("Graph.".concat(e,": updater should be a function."));if("mixed"!==n&&s.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return s.attributes[i]=r(s.attributes[i]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return delete r.attributes[i],this.emit("edgeAttributesUpdated",{key:r.key,type:"remove",attributes:r.attributes,name:i}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(e,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes=i,this.emit("edgeAttributesUpdated",{key:r.key,type:"replace",attributes:r.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(e,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return l(r.attributes,i),this.emit("edgeAttributesUpdated",{key:r.key,type:"merge",attributes:r.attributes,data:i}),this}}}],W=D,q=function(){var t,e=arguments,n=-1;return new W(function i(){if(!t){if(++n>=e.length)return{done:!0};t=e[n]}var r=t.next();return r.done?(t=null,i()):r})},X=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Y(t,e){for(var n in e)t.push(e[n].key)}function K(t,e){for(var n in e)e[n].forEach(function(e){return t.push(e.key)})}function Q(t,e,n){for(var i in t)if(i!==n){var r=t[i];e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey)}}function Z(t,e,n){for(var i in t)i!==n&&t[i].forEach(function(t){return e(t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes,t.undirected,t.generatedKey)})}function J(t,e,n){for(var i in t)if(i!==n){var r=t[i];if(e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey))return!0}return!1}function tt(t,e,n){var i,r,s,o,a;for(var l in t)if(l!==n)for(i=t[l].values();!0!==(r=i.next()).done;)if(o=(s=r.value).source,e(s.key,s.attributes,o.key,(a=s.target).key,o.attributes,a.attributes,s.undirected,s.generatedKey))return!0;return!1}function et(t,e){var n=Object.keys(t),i=n.length,r=null,s=0;return new D(function o(){var a;if(r){var l=r.next();if(l.done)return r=null,s++,o();a=l.value}else{if(s>=i)return{done:!0};var c=n[s];if(c===e)return s++,o();if((a=t[c])instanceof Set)return r=a.values(),o();s++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}})}function nt(t,e,n){var i=e[n];i&&t.push(i.key)}function it(t,e,n){var i=e[n];i&&i.forEach(function(e){return t.push(e.key)})}function rt(t,e,n){var i=t[e];if(i){var r=i.source,s=i.target;n(i.key,i.attributes,r.key,s.key,r.attributes,s.attributes,i.undirected,i.generatedKey)}}function st(t,e,n){var i=t[e];i&&i.forEach(function(t){return n(t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes,t.undirected,t.generatedKey)})}function ot(t,e,n){var i=t[e];if(i){var r=i.source,s=i.target;return n(i.key,i.attributes,r.key,s.key,r.attributes,s.attributes,i.undirected,i.generatedKey)}}function at(t,e,n){var i=t[e];if(i){for(var r,s,o=i.values();!0!==(r=o.next()).done;)if(n((s=r.value).key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected,s.generatedKey))return!0;return!1}}function lt(t,e){var n=t[e];if(n instanceof Set){var i=n.values();return new D(function(){var t=i.next();if(t.done)return t;var e=t.value;return{done:!1,value:[e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes]}})}return D.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ct(t,e){if(0===t.size)return[];if("mixed"===e||e===t.type)return"function"==typeof Array.from?Array.from(t._edges.keys()):R(t._edges.keys(),t._edges.size);for(var n,i,r=new Array("undirected"===e?t.undirectedSize:t.directedSize),s="undirected"===e,o=t._edges.values(),a=0;!0!==(n=o.next()).done;)(i=n.value).undirected===s&&(r[a++]=i.key);return r}function ut(t,e,n){if(0!==t.size)for(var i,r,s="mixed"!==e&&e!==t.type,o="undirected"===e,a=t._edges.values();!0!==(i=a.next()).done;)if(r=i.value,!s||r.undirected===o){var l=r.source,c=r.target;n(r.key,r.attributes,l.key,c.key,l.attributes,c.attributes,r.undirected,r.generatedKey)}}function ht(t,e,n){if(0!==t.size)for(var i,r,s="mixed"!==e&&e!==t.type,o="undirected"===e,a=t._edges.values();!0!==(i=a.next()).done;)if(r=i.value,!s||r.undirected===o){var l=r.source,c=r.target;if(n(r.key,r.attributes,l.key,c.key,l.attributes,c.attributes,r.undirected,r.generatedKey))break}}function dt(t,e){if(0===t.size)return D.empty();var n="mixed"!==e&&e!==t.type,i="undirected"===e,r=t._edges.values();return new D(function(){for(var t,e;;){if((t=r.next()).done)return t;if(e=t.value,!n||e.undirected===i)break}return{value:[e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes],done:!1}})}function pt(t,e,n,i){var r=[],s=t?K:Y;return"undirected"!==e&&("out"!==n&&s(r,i.in),"in"!==n&&s(r,i.out),!n&&i.directedSelfLoops>0&&r.splice(r.lastIndexOf(i.key),1)),"directed"!==e&&s(r,i.undirected),r}function ft(t,e,n,i,r){var s=t?Z:Q;"undirected"!==e&&("out"!==n&&s(i.in,r),"in"!==n&&s(i.out,r,n?null:i.key)),"directed"!==e&&s(i.undirected,r)}function gt(t,e,n,i,r){var s=t?tt:J;"undirected"!==e&&("out"!==n&&s(i.in,r)||"in"!==n&&s(i.out,r,n?null:i.key))||"directed"===e||s(i.undirected,r)}function mt(t,e,n){var i=D.empty();return"undirected"!==t&&("out"!==e&&void 0!==n.in&&(i=q(i,et(n.in))),"in"!==e&&void 0!==n.out&&(i=q(i,et(n.out,e?null:n.key)))),"directed"!==t&&void 0!==n.undirected&&(i=q(i,et(n.undirected))),i}function bt(t,e,n,i,r){var s=e?it:nt,o=[];return"undirected"!==t&&(void 0!==i.in&&"out"!==n&&s(o,i.in,r),void 0!==i.out&&"in"!==n&&s(o,i.out,r),!n&&i.directedSelfLoops>0&&o.splice(o.lastIndexOf(i.key),1)),"directed"!==t&&void 0!==i.undirected&&s(o,i.undirected,r),o}function yt(t,e,n,i,r,s){var o=e?st:rt;"undirected"!==t&&(void 0!==i.in&&"out"!==n&&o(i.in,r,s),i.key!==r&&void 0!==i.out&&"in"!==n&&o(i.out,r,s)),"directed"!==t&&void 0!==i.undirected&&o(i.undirected,r,s)}function vt(t,e,n,i,r,s){var o=e?at:ot;"undirected"!==t&&(void 0!==i.in&&"out"!==n&&o(i.in,r,s)||i.key!==r&&void 0!==i.out&&"in"!==n&&o(i.out,r,s,n?null:i.key))||"directed"===t||void 0===i.undirected||o(i.undirected,r,s)}function _t(t,e,n,i){var r=D.empty();return"undirected"!==t&&(void 0!==n.in&&"out"!==e&&i in n.in&&(r=q(r,lt(n.in,i))),void 0!==n.out&&"in"!==e&&i in n.out&&(r=q(r,lt(n.out,i)))),"directed"!==t&&void 0!==n.undirected&&i in n.undirected&&(r=q(r,lt(n.undirected,i))),r}var wt=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xt(t,e){if(void 0!==e)for(var n in e)t.add(n)}function St(t,e,n){if("mixed"!==t){if("undirected"===t)return Object.keys(n.undirected);if("string"==typeof e)return Object.keys(n[e])}var i=new Set;return"undirected"!==t&&("out"!==e&&xt(i,n.in),"in"!==e&&xt(i,n.out)),"directed"!==t&&xt(i,n.undirected),R(i.values(),i.size)}function Et(t,e,n){for(var i in e){var r=e[i];r instanceof Set&&(r=r.values().next().value);var s=r.source,o=s===t?r.target:s;n(o.key,o.attributes)}}function Ct(t,e,n,i){for(var r in n){var s=n[r];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===e?s.target:o;t.has(a.key)||(t.add(a.key),i(a.key,a.attributes))}}function Ot(t,e,n){for(var i in e){var r=e[i];r instanceof Set&&(r=r.values().next().value);var s=r.source,o=s===t?r.target:s;if(n(o.key,o.attributes))return!0}return!1}function Tt(t,e,n,i){for(var r in n){var s=n[r];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===e?s.target:o;if(!t.has(a.key)&&(t.add(a.key),i(a.key,a.attributes)))return!0}return!1}function kt(t,e){var n=Object.keys(e),i=n.length,r=0;return new D(function(){if(r>=i)return{done:!0};var s=e[n[r++]];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===t?s.target:o;return{done:!1,value:[a.key,a.attributes]}})}function At(t,e,n){var i=Object.keys(n),r=i.length,s=0;return new D(function o(){if(s>=r)return{done:!0};var a=n[i[s++]];a instanceof Set&&(a=a.values().next().value);var l=a.source,c=l===e?a.target:l;return t.has(c.key)?o():(t.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function Pt(t,e,n,i,r){var s=t._nodes.get(i);if("undirected"!==e){if("out"!==n&&void 0!==s.in)for(var o in s.in)if(o===r)return!0;if("in"!==n&&void 0!==s.out)for(var a in s.out)if(a===r)return!0}if("directed"!==e&&void 0!==s.undirected)for(var l in s.undirected)if(l===r)return!0;return!1}function It(t,e,n){for(var i,r,s,o,a,l,c,u=e._nodes.values(),h=e.type;!0!==(i=u.next()).done;){if(r=i.value,"undirected"!==h)for(s in o=r.out)if(l=(a=o[s]).target,c=n(r.key,l.key,r.attributes,l.attributes,a.key,a.attributes,a.undirected,a.generatedKey),t&&c)return;if("directed"!==h)for(s in o=r.undirected)if((l=(a=o[s]).target).key!==s&&(l=a.source),c=n(r.key,l.key,r.attributes,l.attributes,a.key,a.attributes,a.undirected,a.generatedKey),t&&c)return}}function Mt(t,e,n){for(var i,r,s,o,a,l,c,u,h,d=e._nodes.values(),p=e.type;!0!==(i=d.next()).done;){if(r=i.value,"undirected"!==p)for(s in l=r.out)for(o=l[s].values();!0!==(a=o.next()).done;)if(u=(c=a.value).target,h=n(r.key,u.key,r.attributes,u.attributes,c.key,c.attributes,c.undirected,c.generatedKey),t&&h)return;if("directed"!==p)for(s in l=r.undirected)for(o=l[s].values();!0!==(a=o.next()).done;)if((u=(c=a.value).target).key!==s&&(u=c.source),h=n(r.key,u.key,r.attributes,u.attributes,c.key,c.attributes,c.undirected,c.generatedKey),t&&h)return}}function Dt(t,e){var n={key:t};return d(e.attributes)||(n.attributes=l({},e.attributes)),n}function Rt(t,e){var n={source:e.source.key,target:e.target.key};return e.generatedKey||(n.key=t),d(e.attributes)||(n.attributes=l({},e.attributes)),e.undirected&&(n.undirected=!0),n}function Nt(t){return h(t)?"key"in t?!("attributes"in t)||h(t.attributes)&&null!==t.attributes?null:"invalid-attributes":"no-key":"not-object"}function Lt(t){return h(t)?"source"in t?"target"in t?!("attributes"in t)||h(t.attributes)&&null!==t.attributes?"undirected"in t&&"boolean"!=typeof t.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var jt=new Set(["directed","undirected","mixed"]),Ft=new Set(["domain","_events","_eventsCount","_maxListeners"]),Bt={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Vt(t,e,n){var i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}function zt(t,e,n,i,r,s,o,a){if(!i&&"undirected"===t.type)throw new F("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===t.type)throw new F("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a&&!h(a))throw new L("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(a,'"'));if(s=""+s,o=""+o,a=a||{},!t.allowSelfLoops&&s===o)throw new F("Graph.".concat(e,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l=t._nodes.get(s),c=t._nodes.get(o);if(!l)throw new j("Graph.".concat(e,': source node "').concat(s,'" not found.'));if(!c)throw new j("Graph.".concat(e,': target node "').concat(o,'" not found.'));var u={key:null,undirected:i,source:s,target:o,attributes:a};if(n&&(r=t._edgeKeyGenerator(u)),t._edges.has(r=""+r))throw new F("Graph.".concat(e,': the "').concat(r,'" edge already exists in the graph.'));if(!t.multi&&(i?void 0!==l.undirected[o]:void 0!==l.out[o]))throw new F("Graph.".concat(e,': an edge linking "').concat(s,'" to "').concat(o,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var d=new U(i,r,n,l,c,a);return t._edges.set(r,d),s===o?i?(l.undirectedSelfLoops++,t._undirectedSelfLoopCount++):(l.directedSelfLoops++,t._directedSelfLoopCount++):i?(l.undirectedDegree++,c.undirectedDegree++):(l.outDegree++,c.inDegree++),H(t,i,d,s,o,l,c),i?t._undirectedSize++:t._directedSize++,u.key=r,t.emit("edgeAdded",u),r}function Ut(t,e,n,i,r,s,o,a,c){if(!i&&"undirected"===t.type)throw new F("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===t.type)throw new F("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a)if(c){if("function"!=typeof a)throw new L("Graph.".concat(e,': invalid updater function. Expecting a function but got "').concat(a,'"'))}else if(!h(a))throw new L("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(a,'"'));var u;if(s=""+s,o=""+o,c&&(u=a,a=void 0),!t.allowSelfLoops&&s===o)throw new F("Graph.".concat(e,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,p,f=t._nodes.get(s),g=t._nodes.get(o);if(!n&&(d=t._edges.get(r))){if(d.source.key!==s||d.target.key!==o||i&&(d.source.key!==o||d.target.key!==s))throw new F("Graph.".concat(e,': inconsistency detected when attempting to merge the "').concat(r,'" edge with "').concat(s,'" source & "').concat(o,'" target vs. ("').concat(d.source.key,'", "').concat(d.target.key,'").'));p=d}if(p||t.multi||!f||(p=i?f.undirected[o]:f.out[o]),p)return(c?u:a)?(c?(p.attributes=u(p.attributes),t.emit("edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})):(l(p.attributes,a),t.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:a})),p.key):p.key;a=a||{},c&&u&&(a=u(a));var m={key:null,undirected:i,source:s,target:o,attributes:a};if(n&&(r=t._edgeKeyGenerator(m)),t._edges.has(r=""+r))throw new F("Graph.".concat(e,': the "').concat(r,'" edge already exists in the graph.'));return f||(f=Vt(t,s,{}),s===o&&(g=f)),g||(g=Vt(t,o,{})),d=new U(i,r,n,f,g,a),t._edges.set(r,d),s===o?i?(f.undirectedSelfLoops++,t._undirectedSelfLoopCount++):(f.directedSelfLoops++,t._directedSelfLoopCount++):i?(f.undirectedDegree++,g.undirectedDegree++):(f.outDegree++,g.inDegree++),H(t,i,d,s,o,f,g),i?t._undirectedSize++:t._directedSize++,m.key=r,t.emit("edgeAdded",m),r}var Ht,$t=function(t){function n(e){var n;if(n=t.call(this)||this,(e=l({},Bt,e)).edgeKeyGenerator&&"function"!=typeof e.edgeKeyGenerator)throw new L("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(e.edgeKeyGenerator,'".'));if("boolean"!=typeof e.multi)throw new L("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(e.multi,'".'));if(!jt.has(e.type))throw new L('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(e.type,'".'));if("boolean"!=typeof e.allowSelfLoops)throw new L("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(e.allowSelfLoops,'".'));var i,r="mixed"===e.type?B:"directed"===e.type?V:z;return p(a(n),"NodeDataClass",r),p(a(n),"_attributes",{}),p(a(n),"_nodes",new Map),p(a(n),"_edges",new Map),p(a(n),"_directedSize",0),p(a(n),"_undirectedSize",0),p(a(n),"_directedSelfLoopCount",0),p(a(n),"_undirectedSelfLoopCount",0),p(a(n),"_edgeKeyGenerator",e.edgeKeyGenerator||(i=0,function(){return i++})),p(a(n),"_options",e),Ft.forEach(function(t){return p(a(n),t,n[t])}),f(a(n),"order",function(){return n._nodes.size}),f(a(n),"size",function(){return n._edges.size}),f(a(n),"directedSize",function(){return n._directedSize}),f(a(n),"undirectedSize",function(){return n._undirectedSize}),f(a(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),f(a(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),f(a(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),f(a(n),"multi",n._options.multi),f(a(n),"type",n._options.type),f(a(n),"allowSelfLoops",n._options.allowSelfLoops),f(a(n),"implementation",function(){return"graphology"}),n}e(n,t);var i=n.prototype;return i.hasNode=function(t){return this._nodes.has(""+t)},i.hasDirectedEdge=function(t,e){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+t);return!!n&&!n.undirected}if(2===arguments.length){e=""+e;var i=this._nodes.get(t=""+t);if(!i)return!1;var r=i.out[e];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(t,e){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+t);return!!n&&n.undirected}if(2===arguments.length){e=""+e;var i=this._nodes.get(t=""+t);if(!i)return!1;var r=i.undirected[e];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(t,e){if(1===arguments.length)return this._edges.has(""+t);if(2===arguments.length){e=""+e;var n=this._nodes.get(t=""+t);if(!n)return!1;var i=void 0!==n.out&&n.out[e];return i||(i=void 0!==n.undirected&&n.undirected[e]),!(!i||this.multi&&!i.size)}throw new L("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(t,e){if("undirected"!==this.type){if(t=""+t,e=""+e,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(t);if(!n)throw new j('Graph.directedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.directedEdge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.out&&n.out[e]||void 0;return i?i.key:void 0}},i.undirectedEdge=function(t,e){if("directed"!==this.type){if(t=""+t,e=""+e,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(t);if(!n)throw new j('Graph.undirectedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.undirectedEdge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.undirected&&n.undirected[e]||void 0;return i?i.key:void 0}},i.edge=function(t,e){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e;var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.edge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.edge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.out&&n.out[e]||n.undirected&&n.undirected[e]||void 0;if(i)return i.key},i.inDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.inDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.inDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(e?n.directedSelfLoops:0)},i.outDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.outDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.outDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(e?n.directedSelfLoops:0)},i.directedDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.directedDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.directedDegree: could not find the "'.concat(t,'" node in the graph.'));if("undirected"===this.type)return 0;var i=e?n.directedSelfLoops:0;return n.inDegree+i+(n.outDegree+i)},i.undirectedDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.undirectedDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.undirectedDegree: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(e?n.undirectedSelfLoops:0)},i.degree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.degree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.degree: could not find the "'.concat(t,'" node in the graph.'));var i=0,r=0;return"directed"!==this.type&&(e&&(r=n.undirectedSelfLoops),i+=n.undirectedDegree+2*r),"undirected"!==this.type&&(e&&(r=n.directedSelfLoops),i+=n.inDegree+n.outDegree+2*r),i},i.source=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.source: could not find the "'.concat(t,'" edge in the graph.'));return e.source.key},i.target=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.target: could not find the "'.concat(t,'" edge in the graph.'));return e.target.key},i.extremities=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.extremities: could not find the "'.concat(t,'" edge in the graph.'));return[e.source.key,e.target.key]},i.opposite=function(t,e){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new j('Graph.opposite: could not find the "'.concat(e,'" edge in the graph.'));var i=n.source.key,r=n.target.key;if(t!==i&&t!==r)throw new j('Graph.opposite: the "'.concat(t,'" node is not attached to the "').concat(e,'" edge (').concat(i,", ").concat(r,")."));return t===i?r:i},i.hasExtremity=function(t,e){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new j('Graph.hasExtremity: could not find the "'.concat(t,'" edge in the graph.'));return n.source.key===e||n.target.key===e},i.isUndirected=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isUndirected: could not find the "'.concat(t,'" edge in the graph.'));return e.undirected},i.isDirected=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isDirected: could not find the "'.concat(t,'" edge in the graph.'));return!e.undirected},i.isSelfLoop=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isSelfLoop: could not find the "'.concat(t,'" edge in the graph.'));return e.source===e.target},i.hasGeneratedKey=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.hasGeneratedKey: could not find the "'.concat(t,'" edge in the graph.'));return e.generatedKey},i.addNode=function(t,e){return function(t,e,n){if(n&&!h(n))throw new L('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},t._nodes.has(e=""+e))throw new F('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}(this,t,e).key},i.mergeNode=function(t,e){if(e&&!h(e))throw new L('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(e,'"'));e=e||{};var n=this._nodes.get(t=""+t);return n?(e&&(l(n.attributes,e),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:n.attributes,data:e})),t):(n=new this.NodeDataClass(t,e),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:e}),t)},i.updateNode=function(t,e){if(e&&"function"!=typeof e)throw new L('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(e,'"'));var n=this._nodes.get(t=""+t);if(n)return e&&(n.attributes=e(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:n.attributes})),t;var i=e?e({}):{};return n=new this.NodeDataClass(t,i),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:i}),t},i.dropNode=function(t){var e=this,n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.dropNode: could not find the "'.concat(t,'" node in the graph.'));this.forEachEdge(t,function(t){e.dropEdge(t)}),this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})},i.dropEdge=function(t){var e;if(arguments.length>1){var n=""+arguments[0],i=""+arguments[1];if(!(e=c(this,n,i,this.type)))throw new j('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(i,'" edge in the graph.'))}else if(!(e=this._edges.get(t=""+t)))throw new j('Graph.dropEdge: could not find the "'.concat(t,'" edge in the graph.'));this._edges.delete(e.key);var r=e.source,s=e.target,o=e.attributes,a=e.undirected;return r===s?a?(r.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(r.directedSelfLoops--,this._directedSelfLoopCount--):a?(r.undirectedDegree--,s.undirectedDegree--):(r.outDegree--,s.inDegree--),$(this,a,e),a?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:t,attributes:o,source:r.key,target:s.key,undirected:a}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(t){return this._attributes[t]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(t){return this._attributes.hasOwnProperty(t)},i.setAttribute=function(t,e){return this._attributes[t]=e,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.updateAttribute=function(t,e){if("function"!=typeof e)throw new L("Graph.updateAttribute: updater should be a function.");return this._attributes[t]=e(this._attributes[t]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.removeAttribute=function(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this},i.replaceAttributes=function(t){if(!h(t))throw new L("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(t){if(!h(t))throw new L("Graph.mergeAttributes: provided attributes are not a plain object.");return l(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this},i.getNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.getNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return n.attributes[e]},i.getNodeAttributes=function(t){var e=this._nodes.get(t=""+t);if(!e)throw new j('Graph.getNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));return e.attributes},i.hasNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return n.attributes.hasOwnProperty(e)},i.setNodeAttribute=function(t,e,n){var i=this._nodes.get(t=""+t);if(!i)throw new j('Graph.setNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return i.attributes[e]=n,this.emit("nodeAttributesUpdated",{key:t,type:"set",attributes:i.attributes,name:e}),this},i.updateNodeAttribute=function(t,e,n){var i=this._nodes.get(t=""+t);if(!i)throw new j('Graph.updateNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new L("Graph.updateAttribute: updater should be a function.");var r=i.attributes,s=n(r[e]);return r[e]=s,this.emit("nodeAttributesUpdated",{key:t,type:"set",attributes:i.attributes,name:e}),this},i.removeNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return delete n.attributes[e],this.emit("nodeAttributesUpdated",{key:t,type:"remove",attributes:n.attributes,name:e}),this},i.replaceNodeAttributes=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.replaceNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));if(!h(e))throw new L("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=e,this.emit("nodeAttributesUpdated",{key:t,type:"replace",attributes:n.attributes}),this},i.mergeNodeAttributes=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.mergeNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));if(!h(e))throw new L("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return l(n.attributes,e),this.emit("nodeAttributesUpdated",{key:t,type:"merge",attributes:n.attributes,data:e}),this},i.updateEachNodeAttributes=function(t,e){if("function"!=typeof t)throw new L("Graph.updateEachNodeAttributes: expecting an updater function.");if(e&&!g(e))throw new L("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._nodes.values();!0!==(n=r.next()).done;)(i=n.value).attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:e||null})},i.updateEachEdgeAttributes=function(t,e){if("function"!=typeof t)throw new L("Graph.updateEachEdgeAttributes: expecting an updater function.");if(e&&!g(e))throw new L("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._edges.values();!0!==(n=r.next()).done;)(i=n.value).attributes=t(i.key,i.attributes);this.emit("eachEdgeAttributesUpdated",{hints:e||null})},i.forEach=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?Mt(!1,this,t):It(!1,this,t)},i.forEachUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?Mt(!0,this,t):It(!0,this,t)},i.adjacency=function(){return this.multi?(p=(l=this)._nodes.values(),f=l.type,g="outer",m=null,new D(function t(){var e;if("outer"===g)return!0===(e=p.next()).done?e:(c=e.value,g="directed",t());if("directed"===g)return"undirected"===f?(g="undirected",t()):(h=c.out,u=Object.keys(c.out),d=0,g="inner-directed",t());if("undirected"===g){if("directed"===f)return g="outer",t();h=c.undirected,u=Object.keys(c.undirected),d=0,g="inner-undirected"}if(!m&&d>=u.length)return g="inner-undirected"===g?"outer":"undirected",t();if(!m){var n=u[d++];return m=h[n].values(),t()}if((e=m.next()).done)return m=null,t();var i=e.value,r=i.target;return"inner-undirected"===g&&r.key===c.key&&(r=i.source),{done:!1,value:[c.key,r.key,c.attributes,r.attributes,i.key,i.attributes]}})):(s=(t=this)._nodes.values(),o=t.type,a="outer",new D(function t(){var l;if("outer"===a)return!0===(l=s.next()).done?l:(e=l.value,a="directed",t());if("directed"===a)return"undirected"===o?(a="undirected",t()):(i=e.out,n=Object.keys(e.out),r=0,a="inner-directed",t());if("undirected"===a){if("directed"===o)return a="outer",t();i=e.undirected,n=Object.keys(e.undirected),r=0,a="inner-undirected"}if(r>=n.length)return a="inner-undirected"===a?"outer":"undirected",t();var c=n[r++],u=i[c],h=u.target;return"inner-undirected"===a&&h.key===e.key&&(h=u.source),{done:!1,value:[e.key,h.key,e.attributes,h.attributes,u.key,u.attributes]}}));var t,e,n,i,r,s,o,a,l,c,u,h,d,p,f,g,m},i.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):R(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(t){if("function"!=typeof t)throw new L("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(e,n){t(n,e.attributes)})},i.forEachNodeUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEachNode: expecting a callback.");for(var e,n,i=this._nodes.values();!0!==(e=i.next())&&!t((n=e.value).key,n.attributes););},i.nodeEntries=function(){var t=this._nodes.values();return new D(function(){var e=t.next();if(e.done)return e;var n=e.value;return{value:[n.key,n.attributes],done:!1}})},i.exportNode=function(t){var e=this._nodes.get(t=""+t);if(!e)throw new j('Graph.exportNode: could not find the "'.concat(t,'" node in the graph.'));return Dt(t,e)},i.exportEdge=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.exportEdge: could not find the "'.concat(t,'" edge in the graph.'));return Rt(t,e)},i.export=function(){var t=new Array(this._nodes.size),e=0;this._nodes.forEach(function(n,i){t[e++]=Dt(i,n)});var n=new Array(this._edges.size);return e=0,this._edges.forEach(function(t,i){n[e++]=Rt(i,t)}),{attributes:this.getAttributes(),nodes:t,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},i.importNode=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Nt(t);if(n){if("not-object"===n)throw new L('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new L("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new L("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var i=t.key,r=t.attributes,s=void 0===r?{}:r;return e?this.mergeNode(i,s):this.addNode(i,s),this},i.importEdge=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Lt(t);if(n){if("not-object"===n)throw new L('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new L("Graph.importEdge: missing souce.");if("no-target"===n)throw new L("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new L("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new L("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var i=t.source,r=t.target,s=t.attributes,o=void 0===s?{}:s,a=t.undirected,l=void 0!==a&&a;return"key"in t?(e?l?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:l?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,t.key,i,r,o):(e?l?this.mergeUndirectedEdge:this.mergeDirectedEdge:l?this.addUndirectedEdge:this.addDirectedEdge).call(this,i,r,o),this},i.import=function(t){var e,n,i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u(t))return this.import(t.export(),r),this;if(!h(t))throw new L("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!h(t.attributes))throw new L("Graph.import: invalid attributes. Expecting a plain object.");r?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new L("Graph.import: invalid nodes. Expecting an array.");for(e=0,n=i.length;en)){var o=new Set;o.add(e.undirected[s]),e.undirected[s]=o,t._nodes.get(s).undirected[n]=o}})),this;var t},i.clearIndex=function(){return this._nodes.forEach(function(t){void 0!==t.in&&(t.in={},t.out={}),void 0!==t.undirected&&(t.undirected={})}),this},i.toJSON=function(){return this.export()},i.toString=function(){return"[object Graph]"},i.inspect=function(){var t=this,e={};this._nodes.forEach(function(t,n){e[n]=t.attributes});var n={},i={};this._edges.forEach(function(e,r){var s=e.undirected?"--":"->",o="",a="(".concat(e.source.key,")").concat(s,"(").concat(e.target.key,")");e.generatedKey?t.multi&&(void 0===i[a]?i[a]=0:i[a]++,o+="".concat(i[a],". ")):o+="[".concat(r,"]: "),n[o+=a]=e.attributes});var r={};for(var s in this)this.hasOwnProperty(s)&&!Ft.has(s)&&"function"!=typeof this[s]&&(r[s]=this[s]);return r.attributes=this._attributes,r.nodes=e,r.edges=n,p(r,"constructor",this.constructor),r},n}(b.exports.EventEmitter);"undefined"!=typeof Symbol&&($t.prototype[Symbol.for("nodejs.util.inspect.custom")]=$t.prototype.inspect),[{name:function(t){return"".concat(t,"Edge")},generateKey:!0},{name:function(t){return"".concat(t,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(t){return"".concat(t,"EdgeWithKey")}},{name:function(t){return"".concat(t,"DirectedEdgeWithKey")},type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(t){["add","merge","update"].forEach(function(e){var n=t.name(e),i="add"===e?zt:Ut;$t.prototype[n]=t.generateKey?function(r,s,o){return i(this,n,!0,"undirected"===(t.type||this.type),null,r,s,o,"update"===e)}:function(r,s,o,a){return i(this,n,!1,"undirected"===(t.type||this.type),r,s,o,a,"update"===e)}})}),"undefined"!=typeof Symbol&&($t.prototype[Symbol.iterator]=$t.prototype.adjacency),Ht=$t,G.forEach(function(t){var e=t.name,n=t.attacher;n(Ht,e("Edge"),"mixed"),n(Ht,e("DirectedEdge"),"directed"),n(Ht,e("UndirectedEdge"),"undirected")}),function(t){X.forEach(function(e){var n,i,r,s;r=(n=e).type,s=n.direction,t.prototype[i=n.name]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return ct(this,r);if(1===arguments.length){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));return pt(this.multi,"mixed"===r?this.type:r,s,n)}if(2===arguments.length){e=""+e;var o=this._nodes.get(t=""+t);if(!o)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(i,': could not find the "').concat(e,'" target node in the graph.'));return bt(r,this.multi,s,o,e)}throw new L("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(t,e,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return ut(this,i,n=t);if(2===arguments.length){n=e;var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));return ft(this.multi,"mixed"===i?this.type:i,r,o,n)}if(3===arguments.length){e=""+e;var a=this._nodes.get(t=""+t);if(!a)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(s,': could not find the "').concat(e,'" target node in the graph.'));return yt(i,this.multi,r,a,e,n)}throw new L("Graph.".concat(s,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(t,e),function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";t.prototype[s]=function(t,e,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return ht(this,i,n=t);if(2===arguments.length){n=e;var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));return gt(this.multi,"mixed"===i?this.type:i,r,o,n)}if(3===arguments.length){e=""+e;var a=this._nodes.get(t=""+t);if(!a)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(s,': could not find the "').concat(e,'" target node in the graph.'));return vt(i,this.multi,r,a,e,n)}throw new L("Graph.".concat(s,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(t,e),function(t,e){var n=e.type,i=e.direction,r=e.name.slice(0,-1)+"Entries";t.prototype[r]=function(t,e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return D.empty();if(!arguments.length)return dt(this,n);if(1===arguments.length){var s=this._nodes.get(t=""+t);if(!s)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));return mt(n,i,s)}if(2===arguments.length){e=""+e;var o=this._nodes.get(t=""+t);if(!o)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(r,': could not find the "').concat(e,'" target node in the graph.'));return _t(n,i,o,e)}throw new L("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e)})}($t),function(t){wt.forEach(function(e){var n,i,r,s;r=(n=e).type,s=n.direction,t.prototype[i=n.name]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var e=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(e))throw new j("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));if(!this._nodes.has(n))throw new j("Graph.".concat(i,': could not find the "').concat(n,'" node in the graph.'));return Pt(this,r,s,e,n)}if(1===arguments.length){var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));return St("mixed"===r?this.type:r,s,o)}throw new L("Graph.".concat(i,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(t,e){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));!function(t,e,n,i){if("mixed"!==t){if("undirected"===t)return Et(n,n.undirected,i);if("string"==typeof e)return Et(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Ct(r,n,n.in,i),"in"!==e&&Ct(r,n,n.out,i)),"directed"!==t&&Ct(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,e)}}}(t,e),function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";t.prototype[s]=function(t,e){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));!function(t,e,n,i){if("mixed"!==t){if("undirected"===t)return Ot(n,n.undirected,i);if("string"==typeof e)return Ot(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Tt(r,n,n.in,i)||"in"!==e&&Tt(r,n,n.out,i))||"directed"===t||Tt(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,e)}}}(t,e),function(t,e){var n=e.type,i=e.direction,r=e.name.slice(0,-1)+"Entries";t.prototype[r]=function(t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return D.empty();var e=this._nodes.get(t=""+t);if(void 0===e)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return kt(n,n.undirected);if("string"==typeof e)return kt(n,n[e])}var i=D.empty(),r=new Set;return"undirected"!==t&&("out"!==e&&(i=q(i,At(r,n,n.in))),"in"!==e&&(i=q(i,At(r,n,n.out)))),"directed"!==t&&(i=q(i,At(r,n,n.undirected))),i}("mixed"===n?this.type:n,i,e)}}(t,e)})}($t);var Gt=function(t){function n(e){var n=l({type:"directed"},e);if("multi"in n&&!1!==n.multi)throw new L("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new L('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),Wt=function(t){function n(e){var n=l({type:"undirected"},e);if("multi"in n&&!1!==n.multi)throw new L("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new L('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),qt=function(t){function n(e){var n=l({multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return t.call(this,n)||this}return e(n,t),n}($t),Xt=function(t){function n(e){var n=l({type:"directed",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new L('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),Yt=function(t){function n(e){var n=l({type:"undirected",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new L('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t);function Kt(t){t.from=function(e,n){var i=l({},e.options,n),r=new t(i);return r.import(e),r}}return Kt($t),Kt(Gt),Kt(Wt),Kt(qt),Kt(Xt),Kt(Yt),$t.Graph=$t,$t.DirectedGraph=Gt,$t.UndirectedGraph=Wt,$t.MultiGraph=qt,$t.MultiDirectedGraph=Xt,$t.MultiUndirectedGraph=Yt,$t.InvalidArgumentsGraphError=L,$t.NotFoundGraphError=j,$t.UsageGraphError=F,$t}()},11524:function(t,e,n){var i;!function(r,s,o,a){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=s.createElement("div"),h=Math.round,d=Math.abs,p=Date.now;function f(t,e,n){return setTimeout(w(t,n),e)}function g(t,e,n){return!!Array.isArray(t)&&(m(t,n[e],n),!0)}function m(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==a)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=r.console&&(r.console.warn||r.console.log);return s&&s.call(r.console,i,n),t.apply(this,arguments)}}l="function"!=typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n-1}function k(t){return t.trim().split(/\s+/g)}function A(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function M(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),s=0;s1&&!n.firstMultiple?n.firstMultiple=$(e):1===r&&(n.firstMultiple=!1);var s=n.firstInput,o=n.firstMultiple,l=o?o.center:s.center,c=e.center=G(i);e.timeStamp=p(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Y(l,c),e.distance=X(l,c),function(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},s=t.prevInput||{};(1===e.eventType||4===s.eventType)&&(r=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}(n,e),e.offsetDirection=q(e.deltaX,e.deltaY);var u=W(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=d(u.x)>d(u.y)?u.x:u.y,e.scale=o?function(t,e){return X(e[0],e[1],z)/X(t[0],t[1],z)}(o.pointers,i):1,e.rotation=o?function(t,e){return Y(e[1],e[0],z)+Y(t[1],t[0],z)}(o.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,r,s,o=t.lastInterval||e,l=e.timeStamp-o.timeStamp;if(8!=e.eventType&&(l>25||o.velocity===a)){var c=e.deltaX-o.deltaX,u=e.deltaY-o.deltaY,h=W(l,c,u);i=h.x,r=h.y,n=d(h.x)>d(h.y)?h.x:h.y,s=q(c,u),t.lastInterval=e}else n=o.velocity,i=o.velocityX,r=o.velocityY,s=o.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=s}(n,e);var h=t.element;O(e.srcEvent.target,h)&&(h=e.srcEvent.target),e.target=h}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function $(t){for(var e=[],n=0;n=d(e)?t<0?2:4:e<0?8:16}function X(t,e,n){n||(n=V);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function Y(t,e,n){return n||(n=V),180*Math.atan2(e[n[1]]-t[n[1]],e[n[0]]-t[n[0]])/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(R(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},Q="mousedown",Z="mousemove mouseup";function J(){this.evEl=Q,this.evWin=Z,this.pressed=!1,U.apply(this,arguments)}_(J,U,{handler:function(t){var e=K[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:B,srcEvent:t}))}});var tt={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},et={2:F,3:"pen",4:B,5:"kinect"},nt="pointerdown",it="pointermove pointerup pointercancel";function rt(){this.evEl=nt,this.evWin=it,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(nt="MSPointerDown",it="MSPointerMove MSPointerUp MSPointerCancel"),_(rt,U,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=tt[i],s=et[t.pointerType]||t.pointerType,o=s==F,a=A(e,t.pointerId,"pointerId");1&r&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):12&r&&(n=!0),!(a<0)&&(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),n&&e.splice(a,1))}});var st={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ot="touchstart",at="touchstart touchmove touchend touchcancel";function lt(){this.evTarget=ot,this.evWin=at,this.started=!1,U.apply(this,arguments)}function ct(t,e){var n=P(t.touches),i=P(t.changedTouches);return 12&e&&(n=I(n.concat(i),"identifier",!0)),[n,i]}_(lt,U,{handler:function(t){var e=st[t.type];if(1===e&&(this.started=!0),this.started){var n=ct.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:F,srcEvent:t})}}});var ut={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ht="touchstart touchmove touchend touchcancel";function dt(){this.evTarget=ht,this.targetIds={},U.apply(this,arguments)}function pt(t,e){var n=P(t.touches),i=this.targetIds;if(3&e&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,s,o=P(t.changedTouches),a=[],l=this.target;if(s=n.filter(function(t){return O(t.target,l)}),1===e)for(r=0;r-1&&i.splice(t,1)},2500)}}function bt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function i(n){e.manager.emit(n,t)}n<8&&i(e.options.event+kt(n)),i(e.options.event),t.additionalEvent&&i(t.additionalEvent),n>=8&&i(e.options.event+kt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return It.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=At(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(Dt,It,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[xt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){1!==t.scale&&(t.additionalEvent=this.options.event+(t.scale<1?"in":"out")),this._super.emit.call(this,t)}}),_(Rt,Tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!n||12&t.eventType&&!r)this.reset();else if(1&t.eventType)this.reset(),this._timer=f(function(){this.state=8,this.tryEmit()},e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),_(Nt,It,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[xt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Lt,It,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Mt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&d(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=At(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(jt,Tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[wt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance"']/g,W=RegExp($.source),q=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,it=/\s/,rt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,ot=/,? & /,at=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,ft=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,vt=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Ct="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tt="["+_t+"]",kt="["+Ot+"]",At="["+wt+"]",Pt="\\d+",It="["+xt+"]",Mt="["+St+"]",Dt="[^"+_t+Ot+Pt+xt+St+Et+"]",Rt="\\ud83c[\\udffb-\\udfff]",Nt="[^"+_t+"]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Et+"]",Bt="(?:"+Mt+"|"+Dt+")",Vt="(?:"+Ft+"|"+Dt+")",zt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ut="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+At+"|"+Rt+")?",$t="["+Ct+"]?",Gt=$t+Ht+"(?:\\u200d(?:"+[Nt,Lt,jt].join("|")+")"+$t+Ht+")*",Wt="(?:"+[It,Lt,jt].join("|")+")"+Gt,qt="(?:"+[Nt+At+"?",At,Lt,jt,Tt].join("|")+")",Xt=RegExp("['\u2019]","g"),Yt=RegExp(At,"g"),Kt=RegExp(Rt+"(?="+Rt+")|"+qt+Gt,"g"),Qt=RegExp([Ft+"?"+Mt+"+"+zt+"(?="+[kt,Ft,"$"].join("|")+")",Vt+"+"+Ut+"(?="+[kt,Ft+Bt,"$"].join("|")+")",Ft+"?"+Bt+"+"+zt,Ft+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pt,Wt].join("|"),"g"),Zt=RegExp("[\\u200d"+_t+wt+Ct+"]"),Jt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,te=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ee=-1,ne={};ne[M]=ne[D]=ne[R]=ne[N]=ne[L]=ne[j]=ne[F]=ne[B]=ne[V]=!0,ne[f]=ne[g]=ne[P]=ne[m]=ne[I]=ne[b]=ne[y]=ne[v]=ne[w]=ne[x]=ne[S]=ne[C]=ne[O]=ne[T]=ne[A]=!1;var ie={};ie[f]=ie[g]=ie[P]=ie[I]=ie[m]=ie[b]=ie[M]=ie[D]=ie[R]=ie[N]=ie[L]=ie[w]=ie[x]=ie[S]=ie[C]=ie[O]=ie[T]=ie[k]=ie[j]=ie[F]=ie[B]=ie[V]=!0,ie[y]=ie[v]=ie[A]=!1;var re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,oe=parseInt,ae="object"==typeof global&&global&&global.Object===Object&&global,le="object"==typeof self&&self&&self.Object===Object&&self,ce=ae||le||Function("return this")(),ue=e&&!e.nodeType&&e,he=ue&&t&&!t.nodeType&&t,de=he&&he.exports===ue,pe=de&&ae.process,fe=function(){try{return he&&he.require&&he.require("util").types||pe&&pe.binding&&pe.binding("util")}catch(t){}}(),ge=fe&&fe.isArrayBuffer,me=fe&&fe.isDate,be=fe&&fe.isMap,ye=fe&&fe.isRegExp,ve=fe&&fe.isSet,_e=fe&&fe.isTypedArray;function we(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,i){for(var r=-1,s=null==t?0:t.length;++r-1}function ke(t,e,n){for(var i=-1,r=null==t?0:t.length;++i-1;);return n}function Qe(t,e){for(var n=t.length;n--&&je(e,t[n],0)>-1;);return n}function Ze(t,e){for(var n=t.length,i=0;n--;)t[n]===e&&++i;return i}var Je=Ue({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),tn=Ue({"&":"&","<":"<",">":">",'"':""","'":"'"});function en(t){return"\\"+re[t]}function nn(t){return Zt.test(t)}function rn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,i){n[++e]=[i,t]}),n}function sn(t,e){return function(n){return t(e(n))}}function on(t,e){for(var n=-1,i=t.length,r=0,s=[];++n",""":'"',"'":"'"}),dn=function t(e){var n,i=(e=null==e?ce:dn.defaults(ce.Object(),e,dn.pick(ce,te))).Array,it=e.Date,_t=e.Error,wt=e.Function,xt=e.Math,St=e.Object,Et=e.RegExp,Ct=e.String,Ot=e.TypeError,Tt=i.prototype,kt=St.prototype,At=e["__core-js_shared__"],Pt=wt.prototype.toString,It=kt.hasOwnProperty,Mt=0,Dt=(n=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Rt=kt.toString,Nt=Pt.call(St),Lt=ce._,jt=Et("^"+Pt.call(It).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ft=de?e.Buffer:r,Bt=e.Symbol,Vt=e.Uint8Array,zt=Ft?Ft.allocUnsafe:r,Ut=sn(St.getPrototypeOf,St),Ht=St.create,$t=kt.propertyIsEnumerable,Gt=Tt.splice,Wt=Bt?Bt.isConcatSpreadable:r,qt=Bt?Bt.iterator:r,Kt=Bt?Bt.toStringTag:r,Zt=function(){try{var t=os(St,"defineProperty");return t({},"",{}),t}catch(Is){}}(),re=e.clearTimeout!==ce.clearTimeout&&e.clearTimeout,ae=it&&it.now!==ce.Date.now&&it.now,le=e.setTimeout!==ce.setTimeout&&e.setTimeout,ue=xt.ceil,he=xt.floor,pe=St.getOwnPropertySymbols,fe=Ft?Ft.isBuffer:r,Re=e.isFinite,Ue=Tt.join,pn=sn(St.keys,St),fn=xt.max,gn=xt.min,mn=it.now,bn=e.parseInt,yn=xt.random,vn=Tt.reverse,_n=os(e,"DataView"),wn=os(e,"Map"),xn=os(e,"Promise"),Sn=os(e,"Set"),En=os(e,"WeakMap"),Cn=os(St,"create"),On=En&&new En,Tn={},kn=Ns(_n),An=Ns(wn),Pn=Ns(xn),In=Ns(Sn),Mn=Ns(En),Dn=Bt?Bt.prototype:r,Rn=Dn?Dn.valueOf:r,Nn=Dn?Dn.toString:r;function Ln(t){if(Jo(t)&&!Uo(t)&&!(t instanceof Vn)){if(t instanceof Bn)return t;if(It.call(t,"__wrapped__"))return Ls(t)}return new Bn(t)}var jn=function(){function t(){}return function(e){if(!Zo(e))return{};if(Ht)return Ht(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function Fn(){}function Bn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function ri(t,e,n,i,s,o){var a,l=1&e,c=2&e,u=4&e;if(n&&(a=s?n(t,i,s,o):n(t)),a!==r)return a;if(!Zo(t))return t;var h=Uo(t);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&It.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Er(t,a)}else{var d=cs(t),p=d==v||d==_;if(Wo(t))return yr(t,l);if(d==S||d==f||p&&!s){if(a=c||p?{}:hs(t),!l)return c?function(t,e){return Cr(t,ls(t),e)}(t,function(t,e){return t&&Cr(e,Pa(e),t)}(a,t)):function(t,e){return Cr(t,as(t),e)}(t,ti(a,t))}else{if(!ie[d])return s?t:{};a=function(t,e,n){var i=t.constructor;switch(e){case P:return vr(t);case m:case b:return new i(+t);case I:return function(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case M:case D:case R:case N:case L:case j:case F:case B:case V:return _r(t,n);case w:return new i;case x:case T:return new i(t);case C:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new i;case k:return function(t){return Rn?St(Rn.call(t)):{}}(t)}}(t,d,l)}}o||(o=new Gn);var g=o.get(t);if(g)return g;o.set(t,a),ra(t)?t.forEach(function(i){a.add(ri(i,e,n,i,t,o))}):ta(t)&&t.forEach(function(i,r){a.set(r,ri(i,e,n,r,t,o))});var y=h?r:(u?c?Jr:Zr:c?Pa:Aa)(t);return Se(y||t,function(i,r){y&&(i=t[r=i]),Qn(a,r,ri(i,e,n,r,t,o))}),a}function si(t,e,n){var i=n.length;if(null==t)return!i;for(t=St(t);i--;){var s=n[i],o=t[s];if(o===r&&!(s in t)||!(0,e[s])(o))return!1}return!0}function oi(t,e,n){if("function"!=typeof t)throw new Ot(s);return Os(function(){t.apply(r,n)},e)}function ai(t,e,n,i){var r=-1,s=Te,o=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=Ae(e,qe(n))),i?(s=ke,o=!1):e.length>=200&&(s=Ye,o=!1,e=new $n(e));t:for(;++r-1},Un.prototype.set=function(t,e){var n=this.__data__,i=Zn(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new zn,map:new(wn||Un),string:new zn}},Hn.prototype.delete=function(t){var e=rs(this,t).delete(t);return this.size-=e?1:0,e},Hn.prototype.get=function(t){return rs(this,t).get(t)},Hn.prototype.has=function(t){return rs(this,t).has(t)},Hn.prototype.set=function(t,e){var n=rs(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},$n.prototype.add=$n.prototype.push=function(t){return this.__data__.set(t,o),this},$n.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new Un,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Un){var i=n.__data__;if(!wn||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Hn(i)}return n.set(t,e),this.size=n.size,this};var li=kr(mi),ci=kr(bi,!0);function ui(t,e){var n=!0;return li(t,function(t,i,r){return n=!!e(t,i,r)}),n}function hi(t,e,n){for(var i=-1,s=t.length;++i0&&n(a)?e>1?pi(a,e-1,n,i,r):Pe(r,a):i||(r[r.length]=a)}return r}var fi=Ar(),gi=Ar(!0);function mi(t,e){return t&&fi(t,e,Aa)}function bi(t,e){return t&&gi(t,e,Aa)}function yi(t,e){return Oe(e,function(e){return Yo(t[e])})}function vi(t,e){for(var n=0,i=(e=fr(e,t)).length;null!=t&&ne}function Si(t,e){return null!=t&&It.call(t,e)}function Ei(t,e){return null!=t&&e in St(t)}function Ci(t,e,n){for(var s=n?ke:Te,o=t[0].length,a=t.length,l=a,c=i(a),u=1/0,h=[];l--;){var d=t[l];l&&e&&(d=Ae(d,qe(e))),u=gn(d.length,u),c[l]=!n&&(e||o>=120&&d.length>=120)?new $n(l&&d):r}d=t[0];var p=-1,f=c[0];t:for(;++p=a?l:l*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)});i--;)t[i]=t[i].value;return t}(Ri(t,function(t,n,r){return{criteria:Ae(e,function(e){return e(t)}),index:++i,value:t}}))}function Vi(t,e,n){for(var i=-1,r=e.length,s={};++i-1;)a!==t&&Gt.call(a,l,1),Gt.call(t,l,1);return t}function Ui(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==s){var s=r;ps(r)?Gt.call(t,r,1):or(t,r)}}return t}function Hi(t,e){return t+he(yn()*(e-t+1))}function $i(t,e){var n="";if(!t||e<1||e>h)return n;do{e%2&&(n+=t),(e=he(e/2))&&(t+=t)}while(e);return n}function Gi(t,e){return Ts(ws(t,e,el),t+"")}function Wi(t){return qn(Fa(t))}function qi(t,e){var n=Fa(t);return Ps(n,ii(e,0,n.length))}function Xi(t,e,n,i){if(!Zo(t))return t;for(var s=-1,o=(e=fr(e,t)).length,a=o-1,l=t;null!=l&&++ss?0:s+e),(n=n>s?s:n)<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;for(var o=i(s);++r>>1,o=t[s];null!==o&&!oa(o)&&(n?o<=e:o=200){var c=e?null:$r(t);if(c)return an(c);o=!1,r=Ye,l=new $n}else l=e?[]:a;t:for(;++i=i?t:Zi(t,e,n)}var br=re||function(t){return ce.clearTimeout(t)};function yr(t,e){if(e)return t.slice();var n=t.length,i=zt?zt(n):new t.constructor(n);return t.copy(i),i}function vr(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function _r(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function wr(t,e){if(t!==e){var n=t!==r,i=null===t,s=t==t,o=oa(t),a=e!==r,l=null===e,c=e==e,u=oa(e);if(!l&&!u&&!o&&t>e||o&&a&&c&&!l&&!u||i&&a&&c||!n&&c||!s)return 1;if(!i&&!o&&!u&&t1?n[s-1]:r,a=s>2?n[2]:r;for(o=t.length>3&&"function"==typeof o?(s--,o):r,a&&fs(n[0],n[1],a)&&(o=s<3?r:o,s=1),e=St(e);++i-1?s[o?e[a]:a]:r}}function Rr(t){return Qr(function(e){var n=e.length,i=n,o=Bn.prototype.thru;for(t&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new Ot(s);if(o&&!l&&"wrapper"==es(a))var l=new Bn([],!0)}for(i=l?i:n;++i1&&v.reverse(),p&&hl))return!1;var u=o.get(t),h=o.get(e);if(u&&h)return u==e&&h==t;var d=-1,p=!0,f=2&n?new $n:r;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(rt,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Se(p,function(n){var i="_."+n[0];e&n[1]&&!Te(t,i)&&t.push(i)}),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(ot):[]}(i),n)))}function As(t){var e=0,n=0;return function(){var i=mn(),s=16-(i-n);if(n=i,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Ps(t,e){var n=-1,i=t.length,s=i-1;for(e=e===r?i:e;++n1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,no(t,n)});function co(t){var e=Ln(t);return e.__chain__=!0,e}function uo(t,e){return e(t)}var ho=Qr(function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,s=function(e){return ni(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Vn&&ps(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:uo,args:[s],thisArg:r}),new Bn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(r),t})):this.thru(s)}),po=Or(function(t,e,n){It.call(t,n)?++t[n]:ei(t,n,1)}),fo=Dr(Vs),go=Dr(zs);function mo(t,e){return(Uo(t)?Se:li)(t,is(e,3))}function bo(t,e){return(Uo(t)?Ee:ci)(t,is(e,3))}var yo=Or(function(t,e,n){It.call(t,n)?t[n].push(e):ei(t,n,[e])}),vo=Gi(function(t,e,n){var r=-1,s="function"==typeof e,o=$o(t)?i(t.length):[];return li(t,function(t){o[++r]=s?we(e,t,n):Oi(t,e,n)}),o}),_o=Or(function(t,e,n){ei(t,n,e)});function wo(t,e){return(Uo(t)?Ae:Ri)(t,is(e,3))}var xo=Or(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),So=Gi(function(t,e){if(null==t)return[];var n=e.length;return n>1&&fs(t,e[0],e[1])?e=[]:n>2&&fs(e[0],e[1],e[2])&&(e=[e[0]]),Bi(t,pi(e,1),[])}),Eo=ae||function(){return ce.Date.now()};function Co(t,e,n){return e=n?r:e,Wr(t,c,r,r,r,r,e=t&&null==e?t.length:e)}function Oo(t,e){var n;if("function"!=typeof e)throw new Ot(s);return t=da(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var To=Gi(function(t,e,n){var i=1;if(n.length){var r=on(n,ns(To));i|=l}return Wr(t,i,e,n,r)}),ko=Gi(function(t,e,n){var i=3;if(n.length){var r=on(n,ns(ko));i|=l}return Wr(e,i,t,n,r)});function Ao(t,e,n){var i,o,a,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new Ot(s);function g(e){var n=i,s=o;return i=o=r,h=e,l=t.apply(s,n)}function m(t){return h=t,c=Os(y,e),d?g(t):l}function b(t){var n=t-u;return u===r||n>=e||n<0||p&&t-h>=a}function y(){var t=Eo();if(b(t))return v(t);c=Os(y,function(t){var n=e-(t-u);return p?gn(n,a-(t-h)):n}(t))}function v(t){return c=r,f&&i?g(t):(i=o=r,l)}function _(){var t=Eo(),n=b(t);if(i=arguments,o=this,u=t,n){if(c===r)return m(u);if(p)return br(c),c=Os(y,e),g(u)}return c===r&&(c=Os(y,e)),l}return e=fa(e)||0,Zo(n)&&(d=!!n.leading,a=(p="maxWait"in n)?fn(fa(n.maxWait)||0,e):a,f="trailing"in n?!!n.trailing:f),_.cancel=function(){c!==r&&br(c),h=0,i=u=o=c=r},_.flush=function(){return c===r?l:v(Eo())},_}var Po=Gi(function(t,e){return oi(t,1,e)}),Io=Gi(function(t,e,n){return oi(t,fa(e)||0,n)});function Mo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(s);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(Mo.Cache||Hn),n}function Do(t){if("function"!=typeof t)throw new Ot(s);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Mo.Cache=Hn;var Ro=gr(function(t,e){var n=(e=1==e.length&&Uo(e[0])?Ae(e[0],qe(is())):Ae(pi(e,1),qe(is()))).length;return Gi(function(i){for(var r=-1,s=gn(i.length,n);++r=e}),zo=Ti(function(){return arguments}())?Ti:function(t){return Jo(t)&&It.call(t,"callee")&&!$t.call(t,"callee")},Uo=i.isArray,Ho=ge?qe(ge):function(t){return Jo(t)&&wi(t)==P};function $o(t){return null!=t&&Qo(t.length)&&!Yo(t)}function Go(t){return Jo(t)&&$o(t)}var Wo=fe||fl,qo=me?qe(me):function(t){return Jo(t)&&wi(t)==b};function Xo(t){if(!Jo(t))return!1;var e=wi(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!na(t)}function Yo(t){if(!Zo(t))return!1;var e=wi(t);return e==v||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ko(t){return"number"==typeof t&&t==da(t)}function Qo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function Zo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Jo(t){return null!=t&&"object"==typeof t}var ta=be?qe(be):function(t){return Jo(t)&&cs(t)==w};function ea(t){return"number"==typeof t||Jo(t)&&wi(t)==x}function na(t){if(!Jo(t)||wi(t)!=S)return!1;var e=Ut(t);if(null===e)return!0;var n=It.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Nt}var ia=ye?qe(ye):function(t){return Jo(t)&&wi(t)==C},ra=ve?qe(ve):function(t){return Jo(t)&&cs(t)==O};function sa(t){return"string"==typeof t||!Uo(t)&&Jo(t)&&wi(t)==T}function oa(t){return"symbol"==typeof t||Jo(t)&&wi(t)==k}var aa=_e?qe(_e):function(t){return Jo(t)&&Qo(t.length)&&!!ne[wi(t)]},la=zr(Di),ca=zr(function(t,e){return t<=e});function ua(t){if(!t)return[];if($o(t))return sa(t)?cn(t):Er(t);if(qt&&t[qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qt]());var e=cs(t);return(e==w?rn:e==O?an:Fa)(t)}function ha(t){return t?(t=fa(t))===u||t===-u?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function da(t){var e=ha(t),n=e%1;return e==e?n?e-n:e:0}function pa(t){return t?ii(da(t),0,d):0}function fa(t){if("number"==typeof t)return t;if(oa(t))return NaN;if(Zo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Zo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=We(t);var n=pt.test(t);return n||gt.test(t)?oe(t.slice(2),n?2:8):dt.test(t)?NaN:+t}function ga(t){return Cr(t,Pa(t))}function ma(t){return null==t?"":rr(t)}var ba=Tr(function(t,e){if(ys(e)||$o(e))Cr(e,Aa(e),t);else for(var n in e)It.call(e,n)&&Qn(t,n,e[n])}),ya=Tr(function(t,e){Cr(e,Pa(e),t)}),va=Tr(function(t,e,n,i){Cr(e,Pa(e),t,i)}),_a=Tr(function(t,e,n,i){Cr(e,Aa(e),t,i)}),wa=Qr(ni),xa=Gi(function(t,e){t=St(t);var n=-1,i=e.length,s=i>2?e[2]:r;for(s&&fs(e[0],e[1],s)&&(i=1);++n1),e}),Cr(t,Jr(t),n),i&&(n=ri(n,7,Yr));for(var r=e.length;r--;)or(n,e[r]);return n}),Ra=Qr(function(t,e){return null==t?{}:function(t,e){return Vi(t,e,function(e,n){return Ca(t,n)})}(t,e)});function Na(t,e){if(null==t)return{};var n=Ae(Jr(t),function(t){return[t]});return e=is(e),Vi(t,n,function(t,n){return e(t,n[0])})}var La=Gr(Aa),ja=Gr(Pa);function Fa(t){return null==t?[]:Xe(t,Aa(t))}var Ba=Ir(function(t,e,n){return e=e.toLowerCase(),t+(n?Va(e):e)});function Va(t){return Xa(ma(t).toLowerCase())}function za(t){return(t=ma(t))&&t.replace(bt,Je).replace(Yt,"")}var Ua=Ir(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ha=Ir(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),$a=Pr("toLowerCase"),Ga=Ir(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Wa=Ir(function(t,e,n){return t+(n?" ":"")+Xa(e)}),qa=Ir(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Xa=Pr("toUpperCase");function Ya(t,e,n){return t=ma(t),(e=n?r:e)===r?function(t){return Jt.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(at)||[]}(t):t.match(e)||[]}var Ka=Gi(function(t,e){try{return we(t,r,e)}catch(Ms){return Xo(Ms)?Ms:new _t(Ms)}}),Qa=Qr(function(t,e){return Se(e,function(e){e=Rs(e),ei(t,e,To(t[e],t))}),t});function Za(t){return function(){return t}}var Ja=Rr(),tl=Rr(!0);function el(t){return t}function nl(t){return Ii("function"==typeof t?t:ri(t,1))}var il=Gi(function(t,e){return function(n){return Oi(n,t,e)}}),rl=Gi(function(t,e){return function(n){return Oi(t,n,e)}});function sl(t,e,n){var i=Aa(e),r=yi(e,i);null==n&&(!Zo(e)||!r.length&&i.length)&&(n=e,e=t,t=this,r=yi(e,Aa(e)));var s=!(Zo(n)&&"chain"in n&&!n.chain),o=Yo(t);return Se(r,function(n){var i=e[n];t[n]=i,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__),r=n.__actions__=Er(this.__actions__);return r.push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,Pe([this.value()],arguments))})}),t}function ol(){}var al=Fr(Ae),ll=Fr(Ce),cl=Fr(De);function ul(t){return gs(t)?ze(Rs(t)):function(t){return function(e){return vi(e,t)}}(t)}var hl=Vr(),dl=Vr(!0);function pl(){return[]}function fl(){return!1}var gl=jr(function(t,e){return t+e},0),ml=Hr("ceil"),bl=jr(function(t,e){return t/e},1),yl=Hr("floor"),vl=jr(function(t,e){return t*e},1),_l=Hr("round"),wl=jr(function(t,e){return t-e},0);return Ln.after=function(t,e){if("function"!=typeof e)throw new Ot(s);return t=da(t),function(){if(--t<1)return e.apply(this,arguments)}},Ln.ary=Co,Ln.assign=ba,Ln.assignIn=ya,Ln.assignInWith=va,Ln.assignWith=_a,Ln.at=wa,Ln.before=Oo,Ln.bind=To,Ln.bindAll=Qa,Ln.bindKey=ko,Ln.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Uo(t)?t:[t]},Ln.chain=co,Ln.chunk=function(t,e,n){e=(n?fs(t,e,n):e===r)?1:fn(da(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=i(ue(s/e));os?0:s+n),(i=i===r||i>s?s:da(i))<0&&(i+=s),i=n>i?0:pa(i);n>>0)?(t=ma(t))&&("string"==typeof e||null!=e&&!ia(e))&&!(e=rr(e))&&nn(t)?mr(cn(t),0,n):t.split(e,n):[]},Ln.spread=function(t,e){if("function"!=typeof t)throw new Ot(s);return e=null==e?0:fn(da(e),0),Gi(function(n){var i=n[e],r=mr(n,0,e);return i&&Pe(r,i),we(t,this,r)})},Ln.tail=function(t){var e=null==t?0:t.length;return e?Zi(t,1,e):[]},Ln.take=function(t,e,n){return t&&t.length?Zi(t,0,(e=n||e===r?1:da(e))<0?0:e):[]},Ln.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?Zi(t,(e=i-(e=n||e===r?1:da(e)))<0?0:e,i):[]},Ln.takeRightWhile=function(t,e){return t&&t.length?lr(t,is(e,3),!1,!0):[]},Ln.takeWhile=function(t,e){return t&&t.length?lr(t,is(e,3)):[]},Ln.tap=function(t,e){return e(t),t},Ln.throttle=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new Ot(s);return Zo(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Ao(t,e,{leading:i,maxWait:e,trailing:r})},Ln.thru=uo,Ln.toArray=ua,Ln.toPairs=La,Ln.toPairsIn=ja,Ln.toPath=function(t){return Uo(t)?Ae(t,Rs):oa(t)?[t]:Er(Ds(ma(t)))},Ln.toPlainObject=ga,Ln.transform=function(t,e,n){var i=Uo(t),r=i||Wo(t)||aa(t);if(e=is(e,4),null==n){var s=t&&t.constructor;n=r?i?new s:[]:Zo(t)&&Yo(s)?jn(Ut(t)):{}}return(r?Se:mi)(t,function(t,i,r){return e(n,t,i,r)}),n},Ln.unary=function(t){return Co(t,1)},Ln.union=Zs,Ln.unionBy=Js,Ln.unionWith=to,Ln.uniq=function(t){return t&&t.length?sr(t):[]},Ln.uniqBy=function(t,e){return t&&t.length?sr(t,is(e,2)):[]},Ln.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?sr(t,r,e):[]},Ln.unset=function(t,e){return null==t||or(t,e)},Ln.unzip=eo,Ln.unzipWith=no,Ln.update=function(t,e,n){return null==t?t:ar(t,e,pr(n))},Ln.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:ar(t,e,pr(n),i)},Ln.values=Fa,Ln.valuesIn=function(t){return null==t?[]:Xe(t,Pa(t))},Ln.without=io,Ln.words=Ya,Ln.wrap=function(t,e){return No(pr(e),t)},Ln.xor=ro,Ln.xorBy=so,Ln.xorWith=oo,Ln.zip=ao,Ln.zipObject=function(t,e){return hr(t||[],e||[],Qn)},Ln.zipObjectDeep=function(t,e){return hr(t||[],e||[],Xi)},Ln.zipWith=lo,Ln.entries=La,Ln.entriesIn=ja,Ln.extend=ya,Ln.extendWith=va,sl(Ln,Ln),Ln.add=gl,Ln.attempt=Ka,Ln.camelCase=Ba,Ln.capitalize=Va,Ln.ceil=ml,Ln.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=fa(n))==n?n:0),e!==r&&(e=(e=fa(e))==e?e:0),ii(fa(t),e,n)},Ln.clone=function(t){return ri(t,4)},Ln.cloneDeep=function(t){return ri(t,5)},Ln.cloneDeepWith=function(t,e){return ri(t,5,e="function"==typeof e?e:r)},Ln.cloneWith=function(t,e){return ri(t,4,e="function"==typeof e?e:r)},Ln.conformsTo=function(t,e){return null==e||si(t,e,Aa(e))},Ln.deburr=za,Ln.defaultTo=function(t,e){return null==t||t!=t?e:t},Ln.divide=bl,Ln.endsWith=function(t,e,n){t=ma(t),e=rr(e);var i=t.length,s=n=n===r?i:ii(da(n),0,i);return(n-=e.length)>=0&&t.slice(n,s)==e},Ln.eq=Fo,Ln.escape=function(t){return(t=ma(t))&&q.test(t)?t.replace(G,tn):t},Ln.escapeRegExp=function(t){return(t=ma(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Ln.every=function(t,e,n){var i=Uo(t)?Ce:ui;return n&&fs(t,e,n)&&(e=r),i(t,is(e,3))},Ln.find=fo,Ln.findIndex=Vs,Ln.findKey=function(t,e){return Ne(t,is(e,3),mi)},Ln.findLast=go,Ln.findLastIndex=zs,Ln.findLastKey=function(t,e){return Ne(t,is(e,3),bi)},Ln.floor=yl,Ln.forEach=mo,Ln.forEachRight=bo,Ln.forIn=function(t,e){return null==t?t:fi(t,is(e,3),Pa)},Ln.forInRight=function(t,e){return null==t?t:gi(t,is(e,3),Pa)},Ln.forOwn=function(t,e){return t&&mi(t,is(e,3))},Ln.forOwnRight=function(t,e){return t&&bi(t,is(e,3))},Ln.get=Ea,Ln.gt=Bo,Ln.gte=Vo,Ln.has=function(t,e){return null!=t&&us(t,e,Si)},Ln.hasIn=Ca,Ln.head=Hs,Ln.identity=el,Ln.includes=function(t,e,n,i){t=$o(t)?t:Fa(t),n=n&&!i?da(n):0;var r=t.length;return n<0&&(n=fn(r+n,0)),sa(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&je(t,e,n)>-1},Ln.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:da(n);return r<0&&(r=fn(i+r,0)),je(t,e,r)},Ln.inRange=function(t,e,n){return e=ha(e),n===r?(n=e,e=0):n=ha(n),function(t,e,n){return t>=gn(e,n)&&t=-h&&t<=h},Ln.isSet=ra,Ln.isString=sa,Ln.isSymbol=oa,Ln.isTypedArray=aa,Ln.isUndefined=function(t){return t===r},Ln.isWeakMap=function(t){return Jo(t)&&cs(t)==A},Ln.isWeakSet=function(t){return Jo(t)&&"[object WeakSet]"==wi(t)},Ln.join=function(t,e){return null==t?"":Ue.call(t,e)},Ln.kebabCase=Ua,Ln.last=qs,Ln.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var s=i;return n!==r&&(s=(s=da(n))<0?fn(i+s,0):gn(s,i-1)),e==e?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(t,e,s):Le(t,Be,s,!0)},Ln.lowerCase=Ha,Ln.lowerFirst=$a,Ln.lt=la,Ln.lte=ca,Ln.max=function(t){return t&&t.length?hi(t,el,xi):r},Ln.maxBy=function(t,e){return t&&t.length?hi(t,is(e,2),xi):r},Ln.mean=function(t){return Ve(t,el)},Ln.meanBy=function(t,e){return Ve(t,is(e,2))},Ln.min=function(t){return t&&t.length?hi(t,el,Di):r},Ln.minBy=function(t,e){return t&&t.length?hi(t,is(e,2),Di):r},Ln.stubArray=pl,Ln.stubFalse=fl,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=vl,Ln.nth=function(t,e){return t&&t.length?Fi(t,da(e)):r},Ln.noConflict=function(){return ce._===this&&(ce._=Lt),this},Ln.noop=ol,Ln.now=Eo,Ln.pad=function(t,e,n){t=ma(t);var i=(e=da(e))?ln(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return Br(he(r),n)+t+Br(ue(r),n)},Ln.padEnd=function(t,e,n){t=ma(t);var i=(e=da(e))?ln(t):0;return e&&ie){var i=t;t=e,e=i}if(n||t%1||e%1){var s=yn();return gn(t+s*(e-t+se("1e-"+((s+"").length-1))),e)}return Hi(t,e)},Ln.reduce=function(t,e,n){var i=Uo(t)?Ie:He,r=arguments.length<3;return i(t,is(e,4),n,r,li)},Ln.reduceRight=function(t,e,n){var i=Uo(t)?Me:He,r=arguments.length<3;return i(t,is(e,4),n,r,ci)},Ln.repeat=function(t,e,n){return e=(n?fs(t,e,n):e===r)?1:da(e),$i(ma(t),e)},Ln.replace=function(){var t=arguments,e=ma(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Ln.result=function(t,e,n){var i=-1,s=(e=fr(e,t)).length;for(s||(s=1,t=r);++ih)return[];var n=d,i=gn(t,d);e=is(e),t-=d;for(var r=Ge(i,e);++n=o)return t;var l=n-ln(i);if(l<1)return i;var c=a?mr(a,0,l).join(""):t.slice(0,l);if(s===r)return c+i;if(a&&(l+=c.length-l),ia(s)){if(t.slice(l).search(s)){var u,h=c;for(s.global||(s=Et(s.source,ma(ht.exec(s))+"g")),s.lastIndex=0;u=s.exec(h);)var d=u.index;c=c.slice(0,d===r?l:d)}}else if(t.indexOf(rr(s),l)!=l){var p=c.lastIndexOf(s);p>-1&&(c=c.slice(0,p))}return c+i},Ln.unescape=function(t){return(t=ma(t))&&W.test(t)?t.replace($,hn):t},Ln.uniqueId=function(t){var e=++Mt;return ma(t)+e},Ln.upperCase=qa,Ln.upperFirst=Xa,Ln.each=mo,Ln.eachRight=bo,Ln.first=Hs,sl(Ln,function(){var t={};return mi(Ln,function(e,n){It.call(Ln.prototype,n)||(t[n]=e)}),t}(),{chain:!1}),Ln.VERSION="4.17.21",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Ln[t].placeholder=Ln}),Se(["drop","take"],function(t,e){Vn.prototype[t]=function(n){n=n===r?1:fn(da(n),0);var i=this.__filtered__&&!e?new Vn(this):this.clone();return i.__filtered__?i.__takeCount__=gn(n,i.__takeCount__):i.__views__.push({size:gn(n,d),type:t+(i.__dir__<0?"Right":"")}),i},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Se(["filter","map","takeWhile"],function(t,e){var n=e+1,i=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:is(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}}),Se(["head","last"],function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}}),Se(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}}),Vn.prototype.compact=function(){return this.filter(el)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Gi(function(t,e){return"function"==typeof t?new Vn(this):this.map(function(n){return Oi(n,t,e)})}),Vn.prototype.reject=function(t){return this.filter(Do(is(t)))},Vn.prototype.slice=function(t,e){t=da(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=da(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(d)},mi(Vn.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),s=Ln[i?"take"+("last"==e?"Right":""):e],o=i||/^find/.test(e);!s||(Ln.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,l=e instanceof Vn,c=a[0],u=l||Uo(e),h=function(t){var e=s.apply(Ln,Pe([t],a));return i&&d?e[0]:e};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=o&&!d,g=l&&!p;if(!o&&u){e=g?e:new Vn(this);var m=t.apply(e,a);return m.__actions__.push({func:uo,args:[h],thisArg:r}),new Bn(m,d)}return f&&g?t.apply(this,a):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})}),Se(["pop","push","shift","sort","splice","unshift"],function(t){var e=Tt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Ln.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(Uo(r)?r:[],t)}return this[n](function(n){return e.apply(Uo(n)?n:[],t)})}}),mi(Vn.prototype,function(t,e){var n=Ln[e];if(n){var i=n.name+"";It.call(Tn,i)||(Tn[i]=[]),Tn[i].push({name:e,func:n})}}),Tn[Nr(r,2).name]=[{name:"wrapper",func:r}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Er(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Er(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Er(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Uo(t),i=e<0,r=n?t.length:0,s=function(t,e,n){for(var i=-1,r=n.length;++i=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Ln.prototype.plant=function(t){for(var e,n=this;n instanceof Fn;){var i=Ls(n);i.__index__=0,i.__values__=r,e?s.__wrapped__=i:e=i;var s=i;n=n.__wrapped__}return s.__wrapped__=t,e},Ln.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:uo,args:[Qs],thisArg:r}),new Bn(e,this.__chain__)}return this.thru(Qs)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return cr(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,qt&&(Ln.prototype[qt]=function(){return this}),Ln}();ce._=dn,(i=(function(){return dn}).call(e,n,e,t))!==r&&(t.exports=i)}).call(this)},5478:function(t){t.exports=function(){"use strict";function t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i={exports:{}};function r(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}i.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:r,changeDefaults:function(t){i.exports.defaults=t}};var s=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,c={"&":"&","<":"<",">":">",'"':""","'":"'"},u=function(t){return c[t]};var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(t){return t.replace(h,function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""})}var p=/(^|[^\[])\^/g;var f=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var m={},b=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(t,e){m[" "+t]||(m[" "+t]=b.test(t)?t+"/":w(t,"/",!0));var n=-1===(t=m[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(y,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(v,"$1")+e:t+e}function w(t,e,n){var i=t.length;if(0===i)return"";for(var r=0;r1;)1&e&&(n+=t),e>>=1,t+=t;return n+t},P=i.exports.defaults,I=w,M=function(t,e){var n=t.replace(/\|/g,function(t,e,n){for(var i=!1,r=e;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/),i=0;if(n.length>e)n.splice(e);else for(;n.length1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t){var e=this.rules.block.code.exec(t);if(e){var n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:I(n,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map(function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=i.length?t.slice(i.length):t}).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e){var n=e[2].trim();if(/#$/.test(n)){var i=I(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n}}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:M(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){var n,i,r,s,o,a,l,c,u,h=e[0],d=e[2],p=d.length>1,f={type:"list",raw:h,ordered:p,start:p?+d.slice(0,-1):"",loose:!1,items:[]},g=e[0].match(this.rules.block.item),m=!1,b=g.length;r=this.rules.block.listItemStart.exec(g[0]);for(var y=0;yr[1].length:s[1].length>=r[0].length||s[1].length>3){g.splice(y,2,g[y]+(!this.options.pedantic&&s[1].length/i.test(i[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):D(i[0]):i[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=e[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;var i=I(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=R(e[2],"()");if(r>-1){var s=(0===e[0].indexOf("!")?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,s).trim(),e[3]=""}}var o=e[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);l&&(o=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o.slice(1):o.slice(1,-1)),N(e,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:a&&a.replace(this.rules.inline._escapes,"$1")},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=e[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return N(n,i,n[0])}},e.emStrong=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(t);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var s,o,a=i[0].length-1,l=a,c=0,u="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+a);null!=(i=u.exec(e));)if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6]){if(o=s.length,i[3]||i[4]){l+=o;continue}if((i[5]||i[6])&&a%3&&!((a+o)%3)){c+=o;continue}if(!((l-=o)>0))return o=Math.min(o,o+l+c),Math.min(a,o)%2?{type:"em",raw:t.slice(0,a+i.index+o+1),text:t.slice(1,a+i.index+o)}:{type:"strong",raw:t.slice(0,a+i.index+o+1),text:t.slice(2,a+i.index+o-1)}}}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=D(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2]}},e.autolink=function(t,e){var n,i,r=this.rules.inline.autolink.exec(t);if(r)return i="@"===r[2]?"mailto:"+(n=D(this.options.mangle?e(r[1]):r[1])):n=D(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var i,r;if("@"===n[2])r="mailto:"+(i=D(this.options.mangle?e(n[0]):n[0]));else{var s;do{s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(s!==n[0]);i=D(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},e.inlineText=function(t,e,n){var i,r=this.rules.inline.text.exec(t);if(r)return i=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):D(r[0]):r[0]:D(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},t}(),j=O,F=E,B=T,V={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:j,table:j,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};V.def=F(V.def).replace("label",V._label).replace("title",V._title).getRegex(),V.bullet=/(?:[*+-]|\d{1,9}[.)])/,V.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,V.item=F(V.item,"gm").replace(/bull/g,V.bullet).getRegex(),V.listItemStart=F(/^( *)(bull) */).replace("bull",V.bullet).getRegex(),V.list=F(V.list).replace(/bull/g,V.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+V.def.source+")").getRegex(),V._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V._comment=/|$)/,V.html=F(V.html,"i").replace("comment",V._comment).replace("tag",V._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),V.paragraph=F(V._paragraph).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.blockquote=F(V.blockquote).replace("paragraph",V.paragraph).getRegex(),V.normal=B({},V),V.gfm=B({},V.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),V.gfm.nptable=F(V.gfm.nptable).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.gfm.table=F(V.gfm.table).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.pedantic=B({},V.normal,{html:F("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",V._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:j,paragraph:F(V.normal._paragraph).replace("hr",V.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",V.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:j,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};z.punctuation=F(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,z.escapedEmSt=/\\\*|\\_/g,z._comment=F(V._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),z.emStrong.lDelim=F(z.emStrong.lDelim).replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimAst=F(z.emStrong.rDelimAst,"g").replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimUnd=F(z.emStrong.rDelimUnd,"g").replace(/punct/g,z._punctuation).getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,z.autolink=F(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=F(z.tag).replace("comment",z._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=F(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=F(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=F(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=B({},z),z.pedantic=B({},z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:F(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=B({},z.normal,{escape:F(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var K=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||$,this.options.tokenizer=this.options.tokenizer||new H,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:G.normal,inline:W.normal};this.options.pedantic?(e.block=G.pedantic,e.inline=W.pedantic):this.options.gfm&&(e.block=G.gfm,e.inline=this.options.breaks?W.breaks:W.gfm),this.tokenizer.rules=e}e.lex=function(t,n){return new e(n).lex(t)},e.lexInline=function(t,n){return new e(n).inlineTokens(t)};var n=e.prototype;return n.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(t,e,n){var i,r,s,o,a,l,c=this;for(void 0===e&&(e=[]),void 0===n&&(n=!0),this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(n){return!!(i=n.call(c,t,e))&&(t=t.substring(i.raw.length),e.push(i),!0)}))){if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length),i.type&&e.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length),(o=e[e.length-1])&&"paragraph"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.nptable(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),e.push(i);continue}if(i=this.tokenizer.list(t)){for(t=t.substring(i.raw.length),s=i.items.length,r=0;r=0&&(e=Math.min(e,i))}),e<1/0&&e>=0&&(a=t.substring(0,e+1))}(),n&&(i=this.tokenizer.paragraph(a))){o=e[e.length-1],l&&"paragraph"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i),l=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length),(o=e[e.length-1])&&"text"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i);continue}if(t){var u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}throw new Error(u)}}return e},n.inline=function(t){var e,n,i,r,s,o,a=t.length;for(e=0;e0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,l.index)+"["+q("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,l.index)+"["+q("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,l.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(c||(u=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(n){return!!(s=n.call(r,t,e))&&(t=t.substring(s.raw.length),e.push(s),!0)}))){if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.tag(t,n,i)){t=t.substring(s.raw.length),n=s.inLink,i=s.inRawBlock,(o=e[e.length-1])&&"text"===s.type&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,i)),e.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length),o=e[e.length-1],"link"===s.type?(s.tokens=this.inlineTokens(s.text,[],!0,i),e.push(s)):o&&"text"===s.type&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(s=this.tokenizer.emStrong(t,h,u)){t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,i),e.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,i),e.push(s);continue}if(s=this.tokenizer.autolink(t,Y)){t=t.substring(s.raw.length),e.push(s);continue}if(!n&&(s=this.tokenizer.url(t,Y))){t=t.substring(s.raw.length),e.push(s);continue}if(a=t,this.options.extensions&&this.options.extensions.startInline&&function(){var e=1/0,n=t.slice(1),i=void 0;r.options.extensions.startInline.forEach(function(t){"number"==typeof(i=t.call(this,n))&&i>=0&&(e=Math.min(e,i))}),e<1/0&&e>=0&&(a=t.substring(0,e+1))}(),s=this.tokenizer.inlineText(a,i,X)){t=t.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(u=s.raw.slice(-1)),c=!0,(o=e[e.length-1])&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(t){var p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}throw new Error(p)}}return e},function(e,n,i){n&&t(e.prototype,n),i&&t(e,i)}(e,null,[{key:"rules",get:function(){return{block:G,inline:W}}}]),e}(),Q=i.exports.defaults,Z=C,J=x,tt=function(){function t(t){this.options=t||Q}var e=t.prototype;return e.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,i);null!=r&&r!==t&&(n=!0,t=r)}return t=t.replace(/\n$/,"")+"\n",i?'
    '+(n?t:J(t,!0))+"
    \n":"
    "+(n?t:J(t,!0))+"
    \n"},e.blockquote=function(t){return"
    \n"+t+"
    \n"},e.html=function(t){return t},e.heading=function(t,e,n,i){return this.options.headerIds?"'+t+"\n":""+t+"\n"},e.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},e.list=function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"\n"},e.listitem=function(t){return"
  • "+t+"
  • \n"},e.checkbox=function(t){return" "},e.paragraph=function(t){return"

    "+t+"

    \n"},e.table=function(t,e){return e&&(e=""+e+""),"\n\n"+t+"\n"+e+"
    \n"},e.tablerow=function(t){return"\n"+t+"\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"\n"},e.strong=function(t){return""+t+""},e.em=function(t){return""+t+""},e.codespan=function(t){return""+t+""},e.br=function(){return this.options.xhtml?"
    ":"
    "},e.del=function(t){return""+t+""},e.link=function(t,e,n){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return n;var i='"+n+""},e.image=function(t,e,n){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return n;var i=''+n+'":">")},e.text=function(t){return t},t}(),et=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),nt=function(){function t(){this.seen={}}var e=t.prototype;return e.serialize=function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},e.getNextSafeSlug=function(t,e){var n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do{n=t+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=i,this.seen[n]=0),n},e.slug=function(t,e){void 0===e&&(e={});var n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)},t}(),it=tt,rt=et,st=nt,ot=i.exports.defaults,at=S,lt=K,ct=function(){function t(t){this.options=t||ot,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rt,this.slugger=new st}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,i,r,s,o,a,l,c,u,h,d,p,f,g,m,b,y,v,_,w="",x=t.length;for(n=0;n0&&"text"===m.tokens[0].type?(m.tokens[0].text=v+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=v+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:v}):g+=v),g+=this.parse(m.tokens,f),u+=this.renderer.listitem(g,y,b);w+=this.renderer.list(u,d,p);continue;case"html":w+=this.renderer.html(h.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+mt(l.message+"",!0)+"
    ";throw l}}return _t.options=_t.setOptions=function(t){return ft(_t.defaults,t),yt(_t.defaults),_t},_t.getDefaults=bt,_t.defaults=vt,_t.use=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;iAn error occurred:

    "+mt(i.message+"",!0)+"
    ";throw i}},_t.Parser=ct,_t.parser=ct.parse,_t.Renderer=ht,_t.TextRenderer=dt,_t.Lexer=lt,_t.lexer=lt.lex,_t.Tokenizer=ut,_t.Slugger=pt,_t.parse=_t,_t}()},29369:function(t,e,n){var i=n(56284),r=n(67830);function s(){this.clear()}s.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},s.prototype.enqueue=function(t){return this.items.push(t),++this.size},s.prototype.dequeue=function(){if(this.size){var t=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,t}},s.prototype.peek=function(){if(this.size)return this.items[this.offset]},s.prototype.forEach=function(t,e){e=arguments.length>1?e:this;for(var n=this.offset,i=0,r=this.items.length;n=t.length)return{done:!0};var n=t[e];return e++,{value:n,done:!1}})},s.prototype.entries=function(){var t=this.items,e=this.offset,n=0;return new i(function(){if(e>=t.length)return{done:!0};var i=t[e];return e++,{value:[n++,i],done:!1}})},"undefined"!=typeof Symbol&&(s.prototype[Symbol.iterator]=s.prototype.values),s.prototype.toString=function(){return this.toArray().join(",")},s.prototype.toJSON=function(){return this.toArray()},s.prototype.inspect=function(){var t=this.toArray();return Object.defineProperty(t,"constructor",{value:s,enumerable:!1}),t},"undefined"!=typeof Symbol&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(t){var e=new s;return r(t,function(t){e.enqueue(t)}),e},s.of=function(){return s.from(arguments)},t.exports=s},65593:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(72293),o=function(t){function e(){t.apply(this,arguments),this.value=null,this.hasNext=!1,this.hasCompleted=!1}return i(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),s.Subscription.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(r.Subject);e.AsyncSubject=o},73907:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(6594),o=function(t){function e(e){t.call(this),this._value=e}return i(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new s.ObjectUnsubscribedError;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(r.Subject);e.BehaviorSubject=o},36888:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n,i){t.call(this),this.parent=e,this.outerValue=n,this.outerIndex=i,this.index=0}return i(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n(42109).Subscriber);e.InnerSubscriber=r},94429:function(t,e,n){"use strict";var i=n(18705),r=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return i.Observable.of(this.value);case"E":return i.Observable.throw(this.error);case"C":return i.Observable.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();e.Notification=r},18705:function(t,e,n){"use strict";var i=n(80019),r=n(18154),s=n(45783),o=n(10142),a=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var i=this.operator,s=r.toSubscriber(t,e,n);if(i?i.call(s,this.source):s.add(this.source||!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var n=this;if(e||(i.root.Rx&&i.root.Rx.config&&i.root.Rx.config.Promise?e=i.root.Rx.config.Promise:i.root.Promise&&(e=i.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,i){var r;r=n.subscribe(function(e){if(r)try{t(e)}catch(n){i(n),r.unsubscribe()}else t(e)},i,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[s.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;ee&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i},e}(r.Subject);e.ReplaySubject=u;var h=function(t,e){this.time=t,this.value=e}},25430:function(t,e,n){"use strict";var i=n(2369);e.xQ=i.Subject,n(18705),n(24769),n(95914),n(88007),n(3194),n(61898),n(16301),n(23276),n(66593),n(13745),n(57362),n(24518),n(68789),n(30520),n(67370),n(86866),n(11505),n(5031),n(36780),n(17038),n(15718),n(27915),n(90763),n(6846),n(65662),n(6799),n(81854),n(612),n(10838),n(6725),n(8827),n(43511),n(38922),n(25178),n(56937),n(22947),n(82894),n(11206),n(94183),n(16653),n(17930),n(81118),n(50317),n(90674),n(66460),n(79232),n(3945),n(44674),n(73505),n(38749),n(16479),n(22744),n(44475),n(97384),n(8237),n(24937),n(99013),n(84042),n(44436),n(7099),n(6217),n(57476),n(72646),n(91573),n(27387),n(27366),n(88859),n(65425),n(16733),n(23381),n(80404),n(63770),n(53626),n(98851),n(84878),n(26544),n(53582),n(61749),n(34838),n(49681),n(46227),n(56455),n(40881),n(94315),n(92910),n(52442),n(84664),n(61250),n(28310),n(43027),n(18252),n(49571),n(31782),n(9800),n(41854),n(74839),n(1305),n(99144),n(89952),n(85863),n(2865),n(92667),n(22185),n(72919),n(88630),n(75458),n(40780),n(35099),n(57502),n(81676),n(20579),n(71323),n(84950),n(57113),n(95073),n(75654),n(59889),n(96611),n(81845),n(7828),n(4881),n(74568),n(32352),n(50169),n(93543),n(61690),n(15914),n(68583),n(44808),n(49088),n(72293),n(42109),n(65593),n(81959),n(73907),n(51493),n(94429),n(44640),n(11758),n(6594),n(13815),n(84536),n(73390),n(62688),n(24482),n(18353);n(55298);n(10142);n(85522),n(90680),n(97088),n(12948),n(28592),n(72121),n(45783);n(39053)},11965:function(t,e){"use strict";var n=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=Date.now?Date.now:function(){return+new Date},t}();e.Scheduler=n},2369:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(42109),o=n(72293),a=n(6594),l=n(9060),c=n(28592),u=function(t){function e(e){t.call(this,e),this.destination=e}return i(e,t),e}(s.Subscriber);e.SubjectSubscriber=u;var h=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return i(e,t),e.prototype[c.rxSubscriber]=function(){return new u(this)},e.prototype.lift=function(t){var e=new d(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,n=e.length,i=e.slice(),r=0;r=t.length)return void i.complete();i.next(e[n]),t.index=n+1,this.schedule(t)}},e.prototype._subscribe=function(t){var n=this.arrayLike,i=this.scheduler,r=n.length;if(i)return i.schedule(e.dispatch,0,{arrayLike:n,index:0,length:r,subscriber:t});for(var s=0;s1?new e(t,i):1===r?new s.ScalarObservable(t[0],i):new o.EmptyObservable(i)},e.dispatch=function(t){var e=t.array,n=t.index,i=t.subscriber;n>=t.count?i.complete():(i.next(e[n]),!i.closed&&(t.index=n+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.array,i=n.length,r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{array:n,index:0,count:i,subscriber:t});for(var s=0;s1)this.connection=null;else{var n=this.connection,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null}}(o.Subscriber)},34078:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(93658),o=n(84308),a=function(t){function e(e){t.call(this),this.observableFactory=e}return i(e,t),e.create=function(t){return new e(t)},e.prototype._subscribe=function(t){return new l(t,this.observableFactory)},e}(r.Observable);e.DeferObservable=a;var l=function(t){function e(e,n){t.call(this,e),this.factory=n,this.tryDefer()}return i(e,t),e.prototype.tryDefer=function(){try{this._callFactory()}catch(t){this._error(t)}},e.prototype._callFactory=function(){var t=this.factory();t&&this.add(s.subscribeToResult(this,t))},e}(o.OuterSubscriber)},70481:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e){t.call(this),this.scheduler=e}return i(e,t),e.create=function(t){return new e(t)},e.dispatch=function(t){t.subscriber.complete()},e.prototype._subscribe=function(t){var n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{subscriber:t});t.complete()},e}(n(18705).Observable);e.EmptyObservable=r},72210:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this),this.error=e,this.scheduler=n}return i(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){t.subscriber.error(t.error)},e.prototype._subscribe=function(t){var n=this.error,i=this.scheduler;if(t.syncErrorThrowable=!0,i)return i.schedule(e.dispatch,0,{error:n,subscriber:t});t.error(n)},e}(n(18705).Observable);e.ErrorObservable=r},56064:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(70481),o=n(48242),a=n(93658),l=n(84308),c=function(t){function e(e,n){t.call(this),this.sources=e,this.resultSelector=n}return i(e,t),e.create=function(){for(var t=[],n=0;nu?u:e:e}(t)),this.arr=t,this.idx=e,this.len=n}return t.prototype[o.iterator]=function(){return this},t.prototype.next=function(){return this.idx=t.count?i.complete():(i.next(e),!i.closed&&(t.index=n+1,t.start=e+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=0,i=this.start,r=this._count,s=this.scheduler;if(s)return s.schedule(e.dispatch,0,{index:n,count:r,start:i,subscriber:t});for(;;){if(n++>=r){t.complete();break}if(t.next(i++),t.closed)break}},e}(n(18705).Observable);e.RangeObservable=r},80478:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this),this.value=e,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return i(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){var e=t.value,n=t.subscriber;t.done?n.complete():(n.next(e),!n.closed&&(t.done=!0,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.value,i=this.scheduler;if(i)return i.schedule(e.dispatch,0,{done:!1,value:n,subscriber:t});t.next(n),t.closed||t.complete()},e}(n(18705).Observable);e.ScalarObservable=r},82966:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(85522),o=n(39479),a=function(t){function e(e,n,i){void 0===n&&(n=0),void 0===i&&(i=s.asap),t.call(this),this.source=e,this.delayTime=n,this.scheduler=i,(!o.isNumeric(n)||n<0)&&(this.delayTime=0),(!i||"function"!=typeof i.schedule)&&(this.scheduler=s.asap)}return i(e,t),e.create=function(t,n,i){return void 0===n&&(n=0),void 0===i&&(i=s.asap),new e(t,n,i)},e.dispatch=function(t){return this.add(t.source.subscribe(t.subscriber))},e.prototype._subscribe=function(t){return this.scheduler.schedule(e.dispatch,this.delayTime,{source:this.source,subscriber:t})},e}(r.Observable);e.SubscribeOnObservable=a},92870:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(39479),s=n(18705),o=n(90680),a=n(41503),l=n(783),c=function(t){function e(e,n,i){void 0===e&&(e=0),t.call(this),this.period=-1,this.dueTime=0,r.isNumeric(n)?this.period=Number(n)<1?1:Number(n):a.isScheduler(n)&&(i=n),a.isScheduler(i)||(i=o.async),this.scheduler=i,this.dueTime=l.isDate(e)?+e-this.scheduler.now():e}return i(e,t),e.create=function(t,n,i){return void 0===t&&(t=0),new e(t,n,i)},e.dispatch=function(t){var e=t.index,n=t.period,i=t.subscriber;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}},e.prototype._subscribe=function(t){var n=this;return n.scheduler.schedule(e.dispatch,n.dueTime,{index:0,period:n.period,subscriber:t})},e}(s.Observable);e.TimerObservable=c},16196:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(93658),o=n(84308),a=function(t){function e(e,n){t.call(this),this.resourceFactory=e,this.observableFactory=n}return i(e,t),e.create=function(t,n){return new e(t,n)},e.prototype._subscribe=function(t){var e,n=this.resourceFactory,i=this.observableFactory;try{return e=n(),new l(t,e,i)}catch(r){t.error(r)}},e}(r.Observable);e.UsingObservable=a;var l=function(t){function e(e,n,i){t.call(this,e),this.resource=n,this.observableFactory=i,e.add(n),this.tryUse()}return i(e,t),e.prototype.tryUse=function(){try{var t=this.observableFactory.call(this,this.resource);t&&this.add(s.subscribeToResult(this,t))}catch(e){this._error(e)}},e}(o.OuterSubscriber)},59246:function(t,e,n){"use strict";var i=n(19183);e.bindCallback=i.BoundCallbackObservable.create},65571:function(t,e,n){"use strict";var i=n(78655);e.bindNodeCallback=i.BoundNodeCallbackObservable.create},24669:function(t,e,n){"use strict";var i=n(41503),r=n(48242),s=n(96177),o=n(49134);e.combineLatest=function(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof l&&(n=t.pop()),null===a&&1===t.length&&t[0]instanceof i.Observable?t[0]:o.mergeAll(n)(new r.ArrayObservable(t,a))}},94503:function(t,e,n){"use strict";var i=n(20143);e.never=i.NeverObservable.create},69657:function(t,e,n){"use strict";var i=n(96177);e.of=i.ArrayObservable.of},61395:function(t,e,n){"use strict";var i=n(46243);e.onErrorResumeNext=i.onErrorResumeNextStatic},95425:function(t,e,n){"use strict";var i=n(19770);e.pairs=i.PairsObservable.create},24330:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(48242),s=n(96177),o=n(84308),a=n(93658);e.race=function(){for(var t=[],e=0;e=2&&(o=arguments[1]);var a=Number.POSITIVE_INFINITY;return e>=3&&(a=arguments[2]),s.bufferTime(t,o,a,n)(this)}},92523:function(t,e,n){"use strict";var i=n(15440);e.bufferToggle=function(t,e){return i.bufferToggle(t,e)(this)}},49436:function(t,e,n){"use strict";var i=n(51786);e.bufferWhen=function(t){return i.bufferWhen(t)(this)}},64731:function(t,e,n){"use strict";var i=n(93017);e._catch=function(t){return i.catchError(t)(this)}},92273:function(t,e,n){"use strict";var i=n(17054);e.combineAll=function(t){return i.combineAll(t)(this)}},8709:function(t,e,n){"use strict";var i=n(49134);e.combineLatest=function(){for(var t=[],e=0;e=2?i.reduce(t,e)(this):i.reduce(t)(this)}},12931:function(t,e,n){"use strict";var i=n(15329);e.repeat=function(t){return void 0===t&&(t=-1),i.repeat(t)(this)}},68816:function(t,e,n){"use strict";var i=n(63964);e.repeatWhen=function(t){return i.repeatWhen(t)(this)}},17144:function(t,e,n){"use strict";var i=n(40241);e.retry=function(t){return void 0===t&&(t=-1),i.retry(t)(this)}},82766:function(t,e,n){"use strict";var i=n(23896);e.retryWhen=function(t){return i.retryWhen(t)(this)}},62068:function(t,e,n){"use strict";var i=n(92043);e.sample=function(t){return i.sample(t)(this)}},97013:function(t,e,n){"use strict";var i=n(90680),r=n(71239);e.sampleTime=function(t,e){return void 0===e&&(e=i.async),r.sampleTime(t,e)(this)}},98996:function(t,e,n){"use strict";var i=n(64949);e.scan=function(t,e){return arguments.length>=2?i.scan(t,e)(this):i.scan(t)(this)}},77033:function(t,e,n){"use strict";var i=n(88948);e.sequenceEqual=function(t,e){return i.sequenceEqual(t,e)(this)}},10377:function(t,e,n){"use strict";var i=n(35473);e.share=function(){return i.share()(this)}},71623:function(t,e,n){"use strict";var i=n(62704);e.shareReplay=function(t,e,n){return i.shareReplay(t,e,n)(this)}},91956:function(t,e,n){"use strict";var i=n(92223);e.single=function(t){return i.single(t)(this)}},72355:function(t,e,n){"use strict";var i=n(11189);e.skip=function(t){return i.skip(t)(this)}},69329:function(t,e,n){"use strict";var i=n(73346);e.skipLast=function(t){return i.skipLast(t)(this)}},68481:function(t,e,n){"use strict";var i=n(12928);e.skipUntil=function(t){return i.skipUntil(t)(this)}},587:function(t,e,n){"use strict";var i=n(69415);e.skipWhile=function(t){return i.skipWhile(t)(this)}},49292:function(t,e,n){"use strict";var i=n(30673);e.startWith=function(){for(var t=[],e=0;e0&&this.destination.next(e),t.prototype._complete.call(this)},e}(r.Subscriber),a=function(t){function e(e,n,i){t.call(this,e),this.bufferSize=n,this.startBufferEvery=i,this.buffers=[],this.count=0}return i(e,t),e.prototype._next=function(t){var e=this,n=e.bufferSize,i=e.startBufferEvery,r=e.buffers,s=e.count;this.count++,s%i==0&&r.push([]);for(var o=r.length;o--;){var a=r[o];a.push(t),a.length===n&&(r.splice(o,1),this.destination.next(a))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var i=e.shift();i.length>0&&n.next(i)}t.prototype._complete.call(this)},e}(r.Subscriber)},6489:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(90680),s=n(42109),o=n(41503);e.bufferTime=function(t){var e=arguments.length,n=r.async;o.isScheduler(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var i=null;e>=2&&(i=arguments[1]);var s=Number.POSITIVE_INFINITY;return e>=3&&(s=arguments[2]),function(e){return e.lift(new a(t,i,s,n))}};var a=function(){function t(t,e,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),l=function(){this.buffer=[]},c=function(t){function e(e,n,i,r,s){t.call(this,e),this.bufferTimeSpan=n,this.bufferCreationInterval=i,this.maxBufferSize=r,this.scheduler=s,this.contexts=[];var o=this.openContext();if(this.timespanOnly=null==i||i<0,this.timespanOnly)this.add(o.closeAction=s.schedule(u,n,{subscriber:this,context:o,bufferTimeSpan:n}));else{var a={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:this,scheduler:s};this.add(o.closeAction=s.schedule(d,n,{subscriber:this,context:o})),this.add(s.schedule(h,i,a))}}return i(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,i=n.length,r=0;r0;){var i=e.shift();n.next(i.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan;this.add(t.closeAction=this.scheduler.schedule(u,n,{subscriber:this,context:t,bufferTimeSpan:n}))}},e.prototype.openContext=function(){var t=new l;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(s.Subscriber);function u(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function h(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,i=t.subscriber,r=t.scheduler,s=i.openContext();i.closed||(i.add(s.closeAction=r.schedule(d,n,{subscriber:i,context:s})),this.schedule(t,e))}function d(t){t.subscriber.closeContext(t.context)}},15440:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(72293),s=n(93658),o=n(84308);e.bufferToggle=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.openings,this.closingSelector))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(s.subscribeToResult(this,n))}return i(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,i=0;i0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(n){this._error(n)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.subscription;this.destination.next(t.buffer),e.splice(e.indexOf(t),1),this.remove(n),n.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new r.Subscription,i={buffer:[],subscription:n};e.push(i);var o=s.subscribeToResult(this,t,i);!o||o.closed?this.closeBuffer(i):(o.context=i,this.add(o),n.add(o))},e}(o.OuterSubscriber)},51786:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(72293),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.bufferWhen=function(t){return function(e){return e.lift(new c(t))}};var c=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.closingSelector))},t}(),u=function(t){function e(e,n){t.call(this,e),this.closingSelector=n,this.subscribing=!1,this.openBuffer()}return i(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,i,r){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe()),this.buffer&&this.destination.next(this.buffer),this.buffer=[];var e=s.tryCatch(this.closingSelector)();e===o.errorObject?this.error(o.errorObject.e):(t=new r.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(l.subscribeToResult(this,e)),this.subscribing=!1)},e}(a.OuterSubscriber)},93017:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.catchError=function(t){return function(e){var n=new o(t),i=e.lift(n);return n.caught=i}};var o=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.selector,this.caught))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.selector=n,this.caught=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(i){return void t.prototype.error.call(this,i)}this._unsubscribeAndRecycle(),this.add(s.subscribeToResult(this,n))}},e}(r.OuterSubscriber)},17054:function(t,e,n){"use strict";var i=n(49134);e.combineAll=function(t){return function(e){return e.lift(new i.CombineLatestOperator(t))}}},49134:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(96177),s=n(48242),o=n(84308),a=n(93658),l={};e.combineLatest=function(){for(var t=[],e=0;e0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){var s=Math.max(0,n[0].time-i.now());this.schedule(t,s)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new u(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(a.Notification.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t)},e.prototype._complete=function(){this.scheduleNotification(a.Notification.createComplete())},e}(o.Subscriber),u=function(t,e){this.time=t,this.notification=e}},22944:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(18705),o=n(84308),a=n(93658);e.delayWhen=function(t,e){return e?function(n){return new u(n,e).lift(new l(t))}:function(e){return e.lift(new l(t))}};var l=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.delayDurationSelector))},t}(),c=function(t){function e(e,n){t.call(this,e),this.delayDurationSelector=n,this.completed=!1,this.delayNotifierSubscriptions=[],this.values=[]}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.destination.next(t),this.removeSubscription(r),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){try{var e=this.delayDurationSelector(t);e&&this.tryDelay(e,t)}catch(n){this.destination.error(n)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t),n=null;return-1!==e&&(n=this.values[e],this.delayNotifierSubscriptions.splice(e,1),this.values.splice(e,1)),n},e.prototype.tryDelay=function(t,e){var n=a.subscribeToResult(this,t,e);n&&!n.closed&&(this.add(n),this.delayNotifierSubscriptions.push(n)),this.values.push(e)},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(o.OuterSubscriber),u=function(t){function e(e,n){t.call(this),this.source=e,this.subscriptionDelay=n}return i(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new h(t,this.source))},e}(s.Observable),h=function(t){function e(e,n){t.call(this),this.parent=e,this.source=n,this.sourceSubscribed=!1}return i(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(r.Subscriber)},95591:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.dematerialize=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new o(t))},t}(),o=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(r.Subscriber)},25753:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658),o=n(40317);e.distinct=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.keySelector,this.flushes))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.keySelector=n,this.values=new o.Set,i&&this.add(s.subscribeToResult(this,i))}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(i){return void n.error(i)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(r.OuterSubscriber);e.DistinctSubscriber=l},65608:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(33463),o=n(85814);e.distinctUntilChanged=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.compare,this.keySelector))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.keySelector=i,this.hasKey=!1,"function"==typeof n&&(this.compare=n)}return i(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e=t;if(this.keySelector&&(e=s.tryCatch(this.keySelector)(t))===o.errorObject)return this.destination.error(o.errorObject.e);var n=!1;if(this.hasKey){if((n=s.tryCatch(this.compare)(this.key,e))===o.errorObject)return this.destination.error(o.errorObject.e)}else this.hasKey=!0;!1===Boolean(n)&&(this.key=e,this.destination.next(t))},e}(r.Subscriber)},8330:function(t,e,n){"use strict";var i=n(65608);e.distinctUntilKeyChanged=function(t,e){return i.distinctUntilChanged(function(n,i){return e?e(n[t],i[t]):n[t]===i[t]})}},29264:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758);e.elementAt=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){if(this.index=t,this.defaultValue=e,t<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.index,this.defaultValue))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.index=n,this.defaultValue=i}return i(e,t),e.prototype._next=function(t){0==this.index--&&(this.destination.next(t),this.destination.complete())},e.prototype._complete=function(){var t=this.destination;this.index>=0&&(void 0!==this.defaultValue?t.next(this.defaultValue):t.error(new s.ArgumentOutOfRangeError)),t.complete()},e}(r.Subscriber)},26285:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.every=function(t,e){return function(n){return n.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.thisArg,this.source))},t}(),o=function(t){function e(e,n,i,r){t.call(this,e),this.predicate=n,this.thisArg=i,this.source=r,this.index=0,this.thisArg=i||this}return i(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(n){return void this.destination.error(n)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(r.Subscriber)},93229:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.exhaust=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){t.call(this,e),this.hasCompleted=!1,this.hasSubscription=!1}return i(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(s.subscribeToResult(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber)},15758:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.exhaustMap=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.resultSelector=i,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}return i(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e=this.index++,n=this.destination;try{var i=this.project(t,e);this.hasSubscription=!0,this.add(s.subscribeToResult(this,i,t,e))}catch(r){n.error(r)}},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyNext=function(t,e,n,i,r){var s=this.destination;this.resultSelector?this.trySelectResult(t,e,n,i):s.next(e)},e.prototype.trySelectResult=function(t,e,n,i){var r=this.resultSelector,s=this.destination;try{var o=r(t,e,n,i);s.next(o)}catch(a){s.error(a)}},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber)},55364:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(33463),s=n(85814),o=n(84308),a=n(93658);e.expand=function(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(i){return i.lift(new l(t,e,n))}};var l=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.concurrent,this.scheduler))},t}();e.ExpandOperator=l;var c=function(t){function e(e,n,i,r){t.call(this,e),this.project=n,this.concurrent=i,this.scheduler=r,this.index=0,this.active=0,this.hasCompleted=!1,i0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(o.OuterSubscriber);e.ExpandSubscriber=c},27015:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.filter=function(t,e){return function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.thisArg))},t}(),o=function(t){function e(e,n,i){t.call(this,e),this.predicate=n,this.thisArg=i,this.count=0}return i(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)},e}(r.Subscriber)},94367:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(72293);e.finalize=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.callback))},t}(),a=function(t){function e(e,n){t.call(this,e),this.add(new s.Subscription(n))}return i(e,t),e}(r.Subscriber)},16700:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.find=function(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new s(t,n,!1,e))}};var s=function(){function t(t,e,n,i){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}();e.FindValueOperator=s;var o=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.source=i,this.yieldIndex=r,this.thisArg=s,this.index=0}return i(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,i=this.index++;try{e.call(n||this,t,i,this.source)&&this.notifyComplete(this.yieldIndex?i:t)}catch(r){this.destination.error(r)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(r.Subscriber);e.FindValueSubscriber=o},86452:function(t,e,n){"use strict";var i=n(16700);e.findIndex=function(t,e){return function(n){return n.lift(new i.FindValueOperator(t,n,!0,e))}}},12309:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.first=function(t,e,n){return function(i){return i.lift(new o(t,e,n,i))}};var o=function(){function t(t,e,n,i){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=i}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),a=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=s,this.index=0,this.hasCompleted=!1,this._emitted=!1}return i(e,t),e.prototype._next=function(t){var e=this.index++;this.predicate?this._tryPredicate(t,e):this._emit(t,e)},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(i){return void this.destination.error(i)}n&&this._emit(t,e)},e.prototype._emit=function(t,e){this.resultSelector?this._tryResultSelector(t,e):this._emitFinal(t)},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(i){return void this.destination.error(i)}this._emitFinal(n)},e.prototype._emitFinal=function(t){var e=this.destination;this._emitted||(this._emitted=!0,e.next(t),e.complete(),this.hasCompleted=!0)},e.prototype._complete=function(){var t=this.destination;this.hasCompleted||void 0===this.defaultValue?this.hasCompleted||t.error(new s.EmptyError):(t.next(this.defaultValue),t.complete())},e}(r.Subscriber)},92577:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(72293),o=n(18705),a=n(2369),l=n(49754),c=n(30764);e.groupBy=function(t,e,n,i){return function(r){return r.lift(new u(t,e,n,i))}};var u=function(){function t(t,e,n,i){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),h=function(t){function e(e,n,i,r,s){t.call(this,e),this.keySelector=n,this.elementSelector=i,this.durationSelector=r,this.subjectSelector=s,this.groups=null,this.attemptedToUnsubscribe=!1,this.count=0}return i(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(n){return void this.error(n)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups="string"==typeof e?new c.FastMap:new l.Map);var i,r=n.get(e);if(this.elementSelector)try{i=this.elementSelector(t)}catch(u){this.error(u)}else i=t;if(!r){r=this.subjectSelector?this.subjectSelector():new a.Subject,n.set(e,r);var s=new p(e,r,this);if(this.destination.next(s),this.durationSelector){var o=void 0;try{o=this.durationSelector(new p(e,r))}catch(u){return void this.error(u)}this.add(o.subscribe(new d(e,r,this)))}}r.closed||r.next(i)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach(function(e,n){e.error(t)}),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach(function(t,e){t.complete()}),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(r.Subscriber),d=function(t){function e(e,n,i){t.call(this,n),this.key=e,this.group=n,this.parent=i}return i(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(r.Subscriber),p=function(t){function e(e,n,i){t.call(this),this.key=e,this.groupSubject=n,this.refCountSubscription=i}return i(e,t),e.prototype._subscribe=function(t){var e=new s.Subscription,n=this.refCountSubscription,i=this.groupSubject;return n&&!n.closed&&e.add(new f(n)),e.add(i.subscribe(t)),e},e}(o.Observable);e.GroupedObservable=p;var f=function(t){function e(e){t.call(this),this.parent=e,e.count++}return i(e,t),e.prototype.unsubscribe=function(){var e=this.parent;!e.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(s.Subscription)},86898:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(68668);e.ignoreElements=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._next=function(t){s.noop()},e}(r.Subscriber)},89121:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.isEmpty=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new o(t))},t}(),o=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(r.Subscriber)},4636:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.last=function(t,e,n){return function(i){return i.lift(new o(t,e,n,i))}};var o=function(){function t(t,e,n,i){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=i}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),a=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=s,this.hasValue=!1,this.index=0,void 0!==r&&(this.lastValue=r,this.hasValue=!0)}return i(e,t),e.prototype._next=function(t){var e=this.index++;if(this.predicate)this._tryPredicate(t,e);else{if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(i){return void this.destination.error(i)}if(n){if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(i){return void this.destination.error(i)}this.lastValue=n,this.hasValue=!0},e.prototype._complete=function(){var t=this.destination;this.hasValue?(t.next(this.lastValue),t.complete()):t.error(new s.EmptyError)},e}(r.Subscriber)},40119:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.map=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.project,this.thisArg))},t}();e.MapOperator=s;var o=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.count=0,this.thisArg=i||this}return i(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(r.Subscriber)},23491:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.mapTo=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.value))},t}(),o=function(t){function e(e,n){t.call(this,e),this.value=n}return i(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(r.Subscriber)},71177:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(94429);e.materialize=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype._next=function(t){this.destination.next(s.Notification.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(s.Notification.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(s.Notification.createComplete()),t.complete()},e}(r.Subscriber)},33499:function(t,e,n){"use strict";var i=n(97369);e.max=function(t){return i.reduce("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}},56098:function(t,e,n){"use strict";var i=n(38781),r=n(38781);e.mergeStatic=r.merge,e.merge=function(){for(var t=[],e=0;e0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(s.OuterSubscriber);e.MergeMapSubscriber=a},6693:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.mergeMapTo=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"number"==typeof e&&(n=e,e=null),function(i){return i.lift(new o(t,e,n))}};var o=function(){function t(t,e,n){void 0===n&&(n=Number.POSITIVE_INFINITY),this.ish=t,this.resultSelector=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.ish,this.resultSelector,this.concurrent))},t}();e.MergeMapToOperator=o;var a=function(t){function e(e,n,i,r){void 0===r&&(r=Number.POSITIVE_INFINITY),t.call(this,e),this.ish=n,this.resultSelector=i,this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber);e.MergeMapToSubscriber=a},7550:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(33463),s=n(85814),o=n(93658),a=n(84308);e.mergeScan=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(i){return i.lift(new l(t,e,n))}};var l=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.accumulator,this.seed,this.concurrent))},t}();e.MergeScanOperator=l;var c=function(t){function e(e,n,i,r){t.call(this,e),this.accumulator=n,this.acc=i,this.concurrent=r,this.hasValue=!1,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(a.OuterSubscriber);e.MergeScanSubscriber=c},51213:function(t,e,n){"use strict";var i=n(97369);e.min=function(t){return i.reduce("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t=2?function(n){return o.pipe(i.scan(t,e),r.takeLast(1),s.defaultIfEmpty(e))(n)}:function(e){return o.pipe(i.scan(function(e,n,i){return t(e,n,i+1)}),r.takeLast(1))(e)}}},1694:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.refCount=function(){return function(t){return t.lift(new s(t))}};var s=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var i=new o(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r},t}(),o=function(t){function e(e,n){t.call(this,e),this.connectable=n}return i(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null},e}(r.Subscriber)},15329:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(70481);e.repeat=function(t){return void 0===t&&(t=-1),function(e){return 0===t?new s.EmptyObservable:e.lift(new o(t<0?-1:t-1,e))}};var o=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.count,this.source))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.count=n,this.source=i}return i(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(r.Subscriber)},63964:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.repeatWhen=function(t){return function(e){return e.lift(new c(t))}};var c=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,e))},t}(),u=function(t){function e(e,n,i){t.call(this,e),this.notifier=n,this.source=i,this.sourceIsBeingSubscribedTo=!0}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this,n=e.notifications,i=e.retries,r=e.retriesSubscription;return this.notifications=null,this.retries=null,this.retriesSubscription=null,t.prototype._unsubscribeAndRecycle.call(this),this.notifications=n,this.retries=i,this.retriesSubscription=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new r.Subject;var e=s.tryCatch(this.notifier)(this.notifications);if(e===o.errorObject)return t.prototype.complete.call(this);this.retries=e,this.retriesSubscription=l.subscribeToResult(this,e)},e}(a.OuterSubscriber)},40241:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.retry=function(t){return void 0===t&&(t=-1),function(e){return e.lift(new s(t,e))}};var s=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.count,this.source))},t}(),o=function(t){function e(e,n,i){t.call(this,e),this.count=n,this.source=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,i=this.count;if(0===i)return t.prototype.error.call(this,e);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(r.Subscriber)},23896:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.retryWhen=function(t){return function(e){return e.lift(new c(t,e))}};var c=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,this.source))},t}(),u=function(t){function e(e,n,i){t.call(this,e),this.notifier=n,this.source=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,i=this.retries,a=this.retriesSubscription;if(i)this.errors=null,this.retriesSubscription=null;else{if(n=new r.Subject,(i=s.tryCatch(this.notifier)(n))===o.errorObject)return t.prototype.error.call(this,o.errorObject.e);a=l.subscribeToResult(this,i)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=a,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,i,r){var s=this,o=s.errors,a=s.retries,l=s.retriesSubscription;this.errors=null,this.retries=null,this.retriesSubscription=null,this._unsubscribeAndRecycle(),this.errors=o,this.retries=a,this.retriesSubscription=l,this.source.subscribe(this)},e}(a.OuterSubscriber)},92043:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.sample=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new a(t),i=e.subscribe(n);return i.add(s.subscribeToResult(n,this.notifier)),i},t}(),a=function(t){function e(){t.apply(this,arguments),this.hasValue=!1}return i(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,i,r){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(r.OuterSubscriber)},71239:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(90680);e.sampleTime=function(t,e){return void 0===e&&(e=s.async),function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.period,this.scheduler))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.period=n,this.scheduler=i,this.hasValue=!1,this.add(i.schedule(l,n,{subscriber:this,period:n}))}return i(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(r.Subscriber);function l(t){var e=t.period;t.subscriber.notifyNext(),this.schedule(t,e)}},64949:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.scan=function(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.accumulator,this.seed,this.hasSeed))},t}(),o=function(t){function e(e,n,i,r){t.call(this,e),this.accumulator=n,this._seed=i,this.hasSeed=r,this.index=0}return i(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(i){this.destination.error(i)}this.seed=e,this.destination.next(e)},e}(r.Subscriber)},88948:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(33463),o=n(85814);e.sequenceEqual=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.compareTo=t,this.comparor=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.compareTo,this.comparor))},t}();e.SequenceEqualOperator=a;var l=function(t){function e(e,n,i){t.call(this,e),this.compareTo=n,this.comparor=i,this._a=[],this._b=[],this._oneComplete=!1,this.add(n.subscribe(new c(e,this)))}return i(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e.prototype.checkValues=function(){for(var t=this,e=t._a,n=t._b,i=t.comparor;e.length>0&&n.length>0;){var r=e.shift(),a=n.shift(),l=!1;i?(l=s.tryCatch(i)(r,a))===o.errorObject&&this.destination.error(o.errorObject.e):l=r===a,l||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e}(r.Subscriber);e.SequenceEqualSubscriber=l;var c=function(t){function e(e,n){t.call(this,e),this.parent=n}return i(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t)},e.prototype._complete=function(){this.parent._complete()},e}(r.Subscriber)},35473:function(t,e,n){"use strict";var i=n(27372),r=n(1694),s=n(2369);function o(){return new s.Subject}e.share=function(){return function(t){return r.refCount()(i.multicast(o)(t))}}},62704:function(t,e,n){"use strict";var i=n(81959);e.shareReplay=function(t,e,n){return function(r){return r.lift(function(t,e,n){var r,s,o=0,a=!1,l=!1;return function(c){o++,(!r||a)&&(a=!1,r=new i.ReplaySubject(t,e,n),s=c.subscribe({next:function(t){r.next(t)},error:function(t){a=!0,r.error(t)},complete:function(){l=!0,r.complete()}}));var u=r.subscribe(this);return function(){o--,u.unsubscribe(),s&&0===o&&l&&s.unsubscribe()}}}(t,e,n))}}},92223:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.single=function(t){return function(e){return e.lift(new o(t,e))}};var o=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.source))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.predicate=n,this.source=i,this.seenValue=!1,this.index=0}return i(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(n){this.destination.error(n)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new s.EmptyError)},e}(r.Subscriber)},11189:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.skip=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.total))},t}(),o=function(t){function e(e,n){t.call(this,e),this.total=n,this.count=0}return i(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(r.Subscriber)},73346:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758);e.skipLast=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(0===this._skipCount?new r.Subscriber(t):new a(t,this._skipCount))},t}(),a=function(t){function e(e,n){t.call(this,e),this._skipCount=n,this._count=0,this._ring=new Array(n)}return i(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n1?new i.ArrayObservable(t,n):new s.EmptyObservable(n),e)}}},10118:function(t,e,n){"use strict";var i=n(82966);e.subscribeOn=function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new r(t,e))}};var r=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new i.SubscribeOnObservable(e,this.delay,this.scheduler).subscribe(t)},t}()},77243:function(t,e,n){"use strict";var i=n(18483),r=n(5027);e.switchAll=function(){return i.switchMap(r.identity)}},18483:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.switchMap=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.resultSelector=i,this.index=0}return i(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var i=this.innerSubscription;i&&i.unsubscribe(),this.add(this.innerSubscription=s.subscribeToResult(this,t,e,n))},e.prototype._complete=function(){var e=this.innerSubscription;(!e||e.closed)&&t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){this.resultSelector?this._tryNotifyNext(t,e,n,i):this.destination.next(e)},e.prototype._tryNotifyNext=function(t,e,n,i){var r;try{r=this.resultSelector(t,e,n,i)}catch(s){return void this.destination.error(s)}this.destination.next(r)},e}(r.OuterSubscriber)},10684:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.switchMapTo=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.observable=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.observable,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.inner=n,this.resultSelector=i,this.index=0}return i(e,t),e.prototype._next=function(t){var e=this.innerSubscription;e&&e.unsubscribe(),this.add(this.innerSubscription=s.subscribeToResult(this,this.inner,t,this.index++))},e.prototype._complete=function(){var e=this.innerSubscription;(!e||e.closed)&&t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){var s=this.destination;this.resultSelector?this.tryResultSelector(t,e,n,i):s.next(e)},e.prototype.tryResultSelector=function(t,e,n,i){var r,s=this.resultSelector,o=this.destination;try{r=s(t,e,n,i)}catch(a){return void o.error(a)}o.next(r)},e}(r.OuterSubscriber)},44396:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758),o=n(70481);e.take=function(t){return function(e){return 0===t?new o.EmptyObservable:e.lift(new a(t))}};var a=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.total))},t}(),l=function(t){function e(e,n){t.call(this,e),this.total=n,this.count=0}return i(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(r.Subscriber)},73935:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758),o=n(70481);e.takeLast=function(t){return function(e){return 0===t?new o.EmptyObservable:e.lift(new a(t))}};var a=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.total))},t}(),l=function(t){function e(e,n){t.call(this,e),this.total=n,this.ring=new Array,this.count=0}return i(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,i=this.count++;e.length0)for(var n=this.count>=this.total?this.total:this.count,i=this.ring,r=0;r0?this.startWindowEvery:this.windowSize,n=this.destination,i=this.windowSize,r=this.windows,o=r.length,a=0;a=0&&l%e==0&&!this.closed&&r.shift().complete(),++this.count%e==0&&!this.closed){var c=new s.Subject;r.push(c),n.next(c)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(r.Subscriber)},42603:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(90680),o=n(42109),a=n(39479),l=n(41503);e.windowTime=function(t){var e=s.async,n=null,i=Number.POSITIVE_INFINITY;return l.isScheduler(arguments[3])&&(e=arguments[3]),l.isScheduler(arguments[2])?e=arguments[2]:a.isNumeric(arguments[2])&&(i=arguments[2]),l.isScheduler(arguments[1])?e=arguments[1]:a.isNumeric(arguments[1])&&(n=arguments[1]),function(r){return r.lift(new c(t,n,i,e))}};var c=function(){function t(t,e,n,i){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),u=function(t){function e(){t.apply(this,arguments),this._numberOfNextedValues=0}return i(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(r.Subject),h=function(t){function e(e,n,i,r,s){t.call(this,e),this.destination=e,this.windowTimeSpan=n,this.windowCreationInterval=i,this.maxWindowSize=r,this.scheduler=s,this.windows=[];var o=this.openWindow();if(null!==i&&i>=0){var a={windowTimeSpan:n,windowCreationInterval:i,subscriber:this,scheduler:s};this.add(s.schedule(f,n,{subscriber:this,window:o,context:null})),this.add(s.schedule(p,i,a))}else this.add(s.schedule(d,n,{subscriber:this,window:o,windowTimeSpan:n}))}return i(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,i=0;i=this.maxWindowSize&&this.closeWindow(r))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new u;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(o.Subscriber);function d(t){var e=t.subscriber,n=t.windowTimeSpan,i=t.window;i&&e.closeWindow(i),t.window=e.openWindow(),this.schedule(t,n)}function p(t){var e=t.windowTimeSpan,n=t.subscriber,i=t.scheduler,r=t.windowCreationInterval,s=n.openWindow(),o=this,a={action:o,subscription:null};a.subscription=i.schedule(f,e,{subscriber:n,window:s,context:a}),o.add(a.subscription),o.schedule(t,r)}function f(t){var e=t.subscriber,n=t.window,i=t.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),e.closeWindow(n)}},59048:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(72293),o=n(33463),a=n(85814),l=n(84308),c=n(93658);e.windowToggle=function(t,e){return function(n){return n.lift(new u(t,e))}};var u=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.openings,this.closingSelector))},t}(),h=function(t){function e(e,n,i){t.call(this,e),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(this.openSubscription=c.subscribeToResult(this,n,n))}return i(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,i=0;i0){var o=s.indexOf(n);-1!==o&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(r.OuterSubscriber)},9477:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(96177),s=n(48242),o=n(42109),a=n(84308),l=n(93658),c=n(72121);function u(){for(var t=[],e=0;ethis.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),g=function(t){function e(e,n,i){t.call(this,e),this.parent=n,this.observable=i,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return i(e,t),e.prototype[c.iterator]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,n,i,r){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return l.subscribeToResult(this,this.observable,this,e)},e}(a.OuterSubscriber)},33310:function(t,e,n){"use strict";var i=n(9477);e.zipAll=function(t){return function(e){return e.lift(new i.ZipOperator(t))}}},28101:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this)}return i(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(72293).Subscription);e.Action=r},67529:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(12624),s=n(95018),o=function(t){function e(e,n){t.call(this,e,n),this.scheduler=e,this.work=n}return i(e,t),e.prototype.requestAsyncId=function(e,n,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,n,i):(e.actions.push(this),e.scheduled||(e.scheduled=s.AnimationFrame.requestAnimationFrame(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,i);0===e.actions.length&&(s.AnimationFrame.cancelAnimationFrame(n),e.scheduled=void 0)},e}(r.AsyncAction);e.AnimationFrameAction=o},68909:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,i=-1,r=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i0?t.prototype.requestAsyncId.call(this,e,n,i):(e.actions.push(this),e.scheduled||(e.scheduled=r.Immediate.setImmediate(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,i);0===e.actions.length&&(r.Immediate.clearImmediate(n),e.scheduled=void 0)},e}(n(12624).AsyncAction);e.AsapAction=s},25766:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,i=-1,r=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,i):e.flush(this)},e}(n(12624).AsyncAction);e.QueueAction=r},77373:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e}(n(42704).AsyncScheduler);e.QueueScheduler=r},18353:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(12624),s=function(t){function e(e,n){var i=this;void 0===e&&(e=o),void 0===n&&(n=Number.POSITIVE_INFINITY),t.call(this,e,function(){return i.frame}),this.maxFrames=n,this.frame=0,this.index=-1}return i(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,i=this.maxFrames;(e=n.shift())&&(this.frame=e.delay)<=i&&!(t=e.execute(e.state,e.delay)););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(n(42704).AsyncScheduler);e.VirtualTimeScheduler=s;var o=function(t){function e(e,n,i){void 0===i&&(i=e.index+=1),t.call(this,e,n),this.scheduler=e,this.work=n,this.index=i,this.active=!0,this.index=e.index=i}return i(e,t),e.prototype.schedule=function(n,i){if(void 0===i&&(i=0),!this.id)return t.prototype.schedule.call(this,n,i);this.active=!1;var r=new e(this.scheduler,this.work);return this.add(r),r.schedule(n,i)},e.prototype.requestAsyncId=function(t,n,i){void 0===i&&(i=0),this.delay=t.frame+i;var r=t.actions;return r.push(this),r.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){void 0===n&&(n=0)},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(r.AsyncAction);e.VirtualAction=o},12948:function(t,e,n){"use strict";var i=n(67529),r=n(68909);e.animationFrame=new r.AnimationFrameScheduler(i.AnimationFrameAction)},85522:function(t,e,n){"use strict";var i=n(3496),r=n(25766);e.asap=new r.AsapScheduler(i.AsapAction)},90680:function(t,e,n){"use strict";var i=n(12624),r=n(42704);e.async=new r.AsyncScheduler(i.AsyncAction)},97088:function(t,e,n){"use strict";var i=n(7100),r=n(77373);e.queue=new r.QueueScheduler(i.QueueAction)},72121:function(t,e,n){"use strict";var i=n(80019);function r(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var n=t.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var i=t.Map;if(i)for(var r=Object.getOwnPropertyNames(i.prototype),s=0;s0;)e.shift().setup();t.prototype.flush.call(this);for(var n=this.flushTests.filter(function(t){return t.ready});n.length>0;){var i=n.shift();this.assertDeepEqual(i.actual,i.expected)}},e.parseMarblesAsSubscriptions=function(t){if("string"!=typeof t)return new l.SubscriptionLog(Number.POSITIVE_INFINITY);for(var e=t.length,n=-1,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,s=0;s-1?n:o;break;case"!":if(r!==Number.POSITIVE_INFINITY)throw new Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");r=n>-1?n:o;break;default:throw new Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+a+"'.")}}return r<0?new l.SubscriptionLog(i):new l.SubscriptionLog(i,r)},e.parseMarbles=function(t,e,n,i){if(void 0===i&&(i=!1),-1!==t.indexOf("!"))throw new Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var r=t.length,a=[],l=t.indexOf("^"),c=-1===l?0:l*-this.frameTimeFactor,u="object"!=typeof e?function(t){return t}:function(t){return i&&e[t]instanceof o.ColdObservable?e[t].messages:e[t]},h=-1,d=0;d-1?h:p,notification:f})}return a},e}(c.VirtualTimeScheduler);e.TestScheduler=u},95018:function(t,e,n){"use strict";var i=n(80019),r=function(t){t.requestAnimationFrame?(this.cancelAnimationFrame=t.cancelAnimationFrame.bind(t),this.requestAnimationFrame=t.requestAnimationFrame.bind(t)):t.mozRequestAnimationFrame?(this.cancelAnimationFrame=t.mozCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.mozRequestAnimationFrame.bind(t)):t.webkitRequestAnimationFrame?(this.cancelAnimationFrame=t.webkitCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.webkitRequestAnimationFrame.bind(t)):t.msRequestAnimationFrame?(this.cancelAnimationFrame=t.msCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.msRequestAnimationFrame.bind(t)):t.oRequestAnimationFrame?(this.cancelAnimationFrame=t.oCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.oRequestAnimationFrame.bind(t)):(this.cancelAnimationFrame=t.clearTimeout.bind(t),this.requestAnimationFrame=function(e){return t.setTimeout(e,1e3/60)})};e.RequestAnimationFrameDefinition=r,e.AnimationFrame=new r(i.root)},11758:function(t,e){"use strict";var n=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t){function e(){var e=t.call(this,"argument out of range");this.name=e.name="ArgumentOutOfRangeError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.ArgumentOutOfRangeError=i},44640:function(t,e){"use strict";var n=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t){function e(){var e=t.call(this,"no elements in sequence");this.name=e.name="EmptyError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.EmptyError=i},30764:function(t,e){"use strict";var n=function(){function t(){this.values={}}return t.prototype.delete=function(t){return this.values[t]=null,!0},t.prototype.set=function(t,e){return this.values[t]=e,this},t.prototype.get=function(t){return this.values[t]},t.prototype.forEach=function(t,e){var n=this.values;for(var i in n)n.hasOwnProperty(i)&&null!==n[i]&&t.call(e,n[i],i)},t.prototype.clear=function(){this.values={}},t}();e.FastMap=n},42982:function(t,e,n){"use strict";var i=n(80019),r=function(){function t(t){if(this.root=t,t.setImmediate&&"function"==typeof t.setImmediate)this.setImmediate=t.setImmediate.bind(t),this.clearImmediate=t.clearImmediate.bind(t);else{this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.setImmediate=this.canUseProcessNextTick()?this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.createReadyStateChangeSetImmediate():this.createSetTimeoutSetImmediate();var e=function t(e){delete t.instance.tasksByHandle[e]};e.instance=this,this.clearImmediate=e}}return t.prototype.identify=function(t){return this.root.Object.prototype.toString.call(t)},t.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)},t.prototype.canUseMessageChannel=function(){return Boolean(this.root.MessageChannel)},t.prototype.canUseReadyStateChange=function(){var t=this.root.document;return Boolean(t&&"onreadystatechange"in t.createElement("script"))},t.prototype.canUsePostMessage=function(){var t=this.root;if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}return!1},t.prototype.partiallyApplied=function(t){for(var e=[],n=1;n=0}},1856:function(t,e){"use strict";e.isObject=function(t){return null!=t&&"object"==typeof t}},35130:function(t,e){"use strict";e.isPromise=function(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}},41503:function(t,e){"use strict";e.isScheduler=function(t){return t&&"function"==typeof t.schedule}},68668:function(t,e){"use strict";e.noop=function(){}},67239:function(t,e){"use strict";e.not=function(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}},10142:function(t,e,n){"use strict";var i=n(68668);function r(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:i.noop}e.pipe=function(){for(var t=[],e=0;e=n?{done:!0}:{done:!1,value:t[i++]}})},e.empty=function(){var t=new e(null);return t.done=!0,t},e.is=function(t){return t instanceof e||"object"==typeof t&&null!==t&&"function"==typeof t.next},t.exports=e},97310:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.isMobile=function(){return void 0!==r.window.orientation},e.default=function(t){if(!t&&!(0,s.default)())return"Node";if((0,o.default)(t))return"Electron";var e="undefined"!=typeof navigator?navigator:{},n=t||e.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),a=-1!==n.indexOf("Trident/");return i||a?"IE":r.window.chrome?"Chrome":r.window.safari?"Safari":r.window.mozInnerScreenX?"Firefox":"Unknown"};var r=n(41151),s=i(n(61602)),o=i(n(22344))},41151:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.console=e.process=e.document=e.global=e.window=e.self=void 0;var r=i(n(34321)),s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&process};e.self=s.self||s.window||s.global,e.window=s.window||s.self||s.global,e.global=s.global||s.self||s.window,e.document=s.document||{},e.process=s.process||{};var o=console;e.console=o},84761:function(t,e,n){"use strict";var i=n(61948),r=n(34321);Object.defineProperty(e,"CO",{enumerable:!0,get:function(){return s.global}}),Object.defineProperty(e,"jU",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"qs",{enumerable:!0,get:function(){return a.default}});var s=n(41151),o=c(n(61602)),a=c(n(97310));i(n(22344));function l(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(l=function(t){return t?n:e})(t)}function c(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=l(e);if(n&&n.has(t))return n.get(t);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&Object.prototype.hasOwnProperty.call(t,o)){var a=s?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=t[o]}return i.default=t,n&&n.set(t,i),i}},61602:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,e.isBrowserMainThread=function(){return o()&&"undefined"!=typeof document};var r=i(n(34321)),s=i(n(22344));function o(){return!("object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,s.default)()}},22344:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("undefined"!=typeof window&&"object"===(0,r.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,r.default)(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":(0,r.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)};var r=i(n(34321))},86991:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(14180),e),r(n(75103),e),r(n(48965),e),r(n(32595),e),r(n(82417),e),r(n(92451),e),r(n(17735),e)},14180:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BlankNode=void 0,e.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&"BlankNode"===t.termType&&t.value===this.value}}},75103:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataFactory=void 0;const i=n(14180),r=n(48965),s=n(32595),o=n(82417),a=n(92451),l=n(17735);let c=0;e.DataFactory=class{constructor(t){this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||`df_${c++}_`}namedNode(t){return new o.NamedNode(t)}blankNode(t){return new i.BlankNode(t||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(t,e){return new s.Literal(t,e)}variable(t){return new l.Variable(t)}defaultGraph(){return r.DefaultGraph.INSTANCE}quad(t,e,n,i){return new a.Quad(t,e,n,i||this.defaultGraph())}fromTerm(t){switch(t.termType){case"NamedNode":return this.namedNode(t.value);case"BlankNode":return this.blankNode(t.value);case"Literal":return t.language?this.literal(t.value,t.language):t.datatype.equals(s.Literal.XSD_STRING)?this.literal(t.value):this.literal(t.value,this.fromTerm(t.datatype));case"Variable":return this.variable(t.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(t.subject),this.fromTerm(t.predicate),this.fromTerm(t.object),this.fromTerm(t.graph))}}fromQuad(t){return this.fromTerm(t)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},48965:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&"DefaultGraph"===t.termType}}e.DefaultGraph=n,n.INSTANCE=new n},32595:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Literal=void 0;const i=n(82417);class r{constructor(t,e){this.termType="Literal",this.value=t,"string"==typeof e?(this.language=e,this.datatype=r.RDF_LANGUAGE_STRING):e?(this.language="",this.datatype=e):(this.language="",this.datatype=r.XSD_STRING)}equals(t){return!!t&&"Literal"===t.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}e.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NamedNode=void 0,e.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&"NamedNode"===t.termType&&t.value===this.value}}},92451:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Quad=void 0,e.Quad=class{constructor(t,e,n,i){this.termType="Quad",this.value="",this.subject=t,this.predicate=e,this.object=n,this.graph=i}equals(t){return!!t&&("Quad"===t.termType||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},17735:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Variable=void 0,e.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&"Variable"===t.termType&&t.value===this.value}}},31609:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.getSupportedJavaScriptPrimitives=e.getSupportedRdfDatatypes=e.getTermRaw=e.toRdf=e.fromRdf=void 0;const s=n(86991),o=n(9938),a=n(66060);r(n(9938),e),r(n(88871),e),r(n(66060),e);const l=new s.DataFactory,c=new a.Translator;function u(t,e){return c.fromRdf(t,e)}c.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map(t=>l.namedNode(t)),["string"]),c.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map(t=>l.namedNode(t)),["boolean"]),c.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map(t=>l.namedNode(t)),["number"]),c.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map(t=>l.namedNode(t)),["number"]),c.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map(t=>l.namedNode(t)),["object"]),e.fromRdf=u,e.toRdf=function(t,e){return e&&"namedNode"in e&&(e={dataFactory:e}),(e=e||{})&&!e.dataFactory&&(e.dataFactory=l),c.toRdf(t,e)},e.getTermRaw=function(t,e){return"Literal"===t.termType?u(t,e):t.value},e.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},e.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},66060:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Translator=void 0,e.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,e,n){for(const i of e)this.supportedRdfDatatypes.push(i),this.fromRdfHandlers[i.value]=t;for(const i of n){let e=this.toRdfHandlers[i];e||(this.toRdfHandlers[i]=e=[]),e.push(t)}}fromRdf(t,e){const n=this.fromRdfHandlers[t.datatype.value];return n?n.fromRdf(t,e):t.value}toRdf(t,e){const n=this.toRdfHandlers[typeof t];if(n)for(const i of n){const n=i.toRdf(t,e);if(n)return n}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},80727:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerBoolean=void 0;const i=n(66060);class r{fromRdf(t,e){switch(t.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return e&&i.Translator.incorrectRdfDataType(t),!1}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(t?"true":"false",e||n.namedNode(r.TYPE))}}e.TypeHandlerBoolean=r,r.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerDate=void 0;const i=n(66060);class r{fromRdf(t,e){switch(e&&!t.value.match(r.VALIDATORS[t.datatype.value.substr(33,t.datatype.value.length)])&&i.Translator.incorrectRdfDataType(t),t.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(t.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const e=t.value.split("-");return new Date(0,parseInt(e[0],10)-1,parseInt(e[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(t.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(t.value+"-01");default:return new Date(t.value)}}toRdf(t,{datatype:e,dataFactory:n}){if(e=e||n.namedNode(r.TYPES[0]),!(t instanceof Date))return null;const i=t;let s;switch(e.value){case"http://www.w3.org/2001/XMLSchema#gDay":s=String(i.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":s=i.getUTCMonth()+1+"-"+i.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":s=String(i.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":s=i.getUTCFullYear()+"-"+(i.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":s=i.toISOString().replace(/T.*$/,"");break;default:s=i.toISOString()}return n.literal(s,e)}}e.TypeHandlerDate=r,r.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"],r.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]$/}},38554:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberDouble=void 0;const i=n(66060);class r{fromRdf(t,e){const n=parseFloat(t.value);return e&&isNaN(n)&&i.Translator.incorrectRdfDataType(t),n}toRdf(t,{datatype:e,dataFactory:n}){return e=e||n.namedNode(r.TYPES[0]),isNaN(t)?n.literal("NaN",e):isFinite(t)?t%1==0?null:n.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),e):n.literal(t>0?"INF":"-INF",e)}}e.TypeHandlerNumberDouble=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberInteger=void 0;const i=n(66060);class r{fromRdf(t,e){const n=parseInt(t.value,10);return e&&(isNaN(n)||t.value.indexOf(".")>=0)&&i.Translator.incorrectRdfDataType(t),n}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(String(t),e||n.namedNode(t<=r.MAX_INT&&t>=r.MIN_INT?r.TYPES[0]:r.TYPES[1]))}}e.TypeHandlerNumberInteger=r,r.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"],r.MAX_INT=2147483647,r.MIN_INT=-2147483648},14608:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerString=void 0;class n{fromRdf(t){return t.value}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(t,e)}}e.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(80727),e),r(n(52525),e),r(n(38554),e),r(n(37750),e),r(n(14608),e)},35090:function(t,e,n){"use strict";var i={};n.r(i),n.d(i,{decode:function(){return eL},encode:function(){return iL}});var r={};n.r(r),n.d(r,{decode:function(){return cL},encode:function(){return hL}});var s={};n.r(s),n.d(s,{decode:function(){return dL},encode:function(){return fL}});var o={};function a(t){return"function"==typeof t}n.r(o),n.d(o,{decode:function(){return mL},encode:function(){return yL}});let l=!1;const c={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else l&&console.log("RxJS: Back to a better error behavior. Thank you. <3");l=t},get useDeprecatedSynchronousErrorHandling(){return l}};function u(t){setTimeout(()=>{throw t},0)}const h={closed:!0,next(t){},error(t){if(c.useDeprecatedSynchronousErrorHandling)throw t;u(t)},complete(){}},d=Array.isArray||(t=>t&&"number"==typeof t.length);function p(t){return null!==t&&"object"==typeof t}const f=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();class g{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:e,_ctorUnsubscribe:n,_unsubscribe:i,_subscriptions:r}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,e instanceof g)e.remove(this);else if(null!==e)for(let a=0;at.concat(e instanceof f?e.errors:e),[])}g.EMPTY=((m=new g).closed=!0,m);const y="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class v extends g{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=h;break;case 1:if(!t){this.destination=h;break}if("object"==typeof t){t instanceof v?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new _(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new _(this,t,e,n)}}[y](){return this}static create(t,e,n){const i=new v(t,e,n);return i.syncErrorThrowable=!1,i}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class _ extends v{constructor(t,e,n,i){super(),this._parentSubscriber=t;let r,s=this;a(e)?r=e:e&&(r=e.next,n=e.error,i=e.complete,e!==h&&(s=Object.create(e),a(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=r,this._error=n,this._complete=i}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;c.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=c;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):u(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;u(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);c.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),c.useDeprecatedSynchronousErrorHandling)throw n;u(n)}}__tryOrSetError(t,e,n){if(!c.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(i){return c.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=i,t.syncErrorThrown=!0,!0):(u(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const w="function"==typeof Symbol&&Symbol.observable||"@@observable";function x(t){return t}function S(...t){return E(t)}function E(t){return 0===t.length?x:1===t.length?t[0]:function(e){return t.reduce((t,e)=>e(t),e)}}let C=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:i}=this,r=function(t,e,n){if(t){if(t instanceof v)return t;if(t[y])return t[y]()}return t||e||n?new v(t,e,n):new v(h)}(t,e,n);if(r.add(i?i.call(r,this.source):this.source||c.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),c.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(t){try{return this._subscribe(t)}catch(e){c.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:i}=t;if(e||i)return!1;t=n&&n instanceof v?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=O(e))((e,n)=>{let i;i=this.subscribe(e=>{try{t(e)}catch(r){n(r),i&&i.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[w](){return this}pipe(...t){return 0===t.length?this:E(t)(this)}toPromise(t){return new(t=O(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function O(t){if(t||(t=c.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const T=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class k extends g{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class A extends v{constructor(t){super(t),this.destination=t}}let P=(()=>{class t extends C{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[y](){return new A(this)}lift(t){const e=new I(this,this);return e.operator=t,e}next(t){if(this.closed)throw new T;if(!this.isStopped){const{observers:e}=this,n=e.length,i=e.slice();for(let r=0;rnew I(t,e),t})();class I extends P{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):g.EMPTY}}function M(t){return t&&"function"==typeof t.schedule}function D(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new R(t,e))}}class R{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new N(t,this.project,this.thisArg))}}class N extends v{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}const L=t=>e=>{for(let n=0,i=t.length;nt&&"number"==typeof t.length&&"function"!=typeof t;function B(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const V=t=>{if(t&&"function"==typeof t[w])return(t=>e=>{const n=t[w]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)})(t);if(F(t))return L(t);if(B(t))return(t=>e=>(t.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,u),e))(t);if(t&&"function"==typeof t[j])return(t=>e=>{const n=t[j]();for(;;){let t;try{t=n.next()}catch(i){return e.error(i),e}if(t.done){e.complete();break}if(e.next(t.value),e.closed)break}return"function"==typeof n.return&&e.add(()=>{n.return&&n.return()}),e})(t);{const e=`You provided ${p(t)?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(e)}};function z(t,e){return new C(n=>{const i=new g;let r=0;return i.add(e.schedule(function(){r!==t.length?(n.next(t[r++]),n.closed||i.add(this.schedule())):n.complete()})),i})}function U(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[w]}(t))return function(t,e){return new C(n=>{const i=new g;return i.add(e.schedule(()=>{const r=t[w]();i.add(r.subscribe({next(t){i.add(e.schedule(()=>n.next(t)))},error(t){i.add(e.schedule(()=>n.error(t)))},complete(){i.add(e.schedule(()=>n.complete()))}}))})),i})}(t,e);if(B(t))return function(t,e){return new C(n=>{const i=new g;return i.add(e.schedule(()=>t.then(t=>{i.add(e.schedule(()=>{n.next(t),i.add(e.schedule(()=>n.complete()))}))},t=>{i.add(e.schedule(()=>n.error(t)))}))),i})}(t,e);if(F(t))return z(t,e);if(function(t){return t&&"function"==typeof t[j]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new C(n=>{const i=new g;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=t[j](),i.add(e.schedule(function(){if(n.closed)return;let t,e;try{const n=r.next();t=n.value,e=n.done}catch(i){return void n.error(i)}e?n.complete():(n.next(t),this.schedule())}))})),i})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof C?t:new C(V(t))}class H extends v{constructor(t){super(),this.parent=t}_next(t){this.parent.notifyNext(t)}_error(t){this.parent.notifyError(t),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class $ extends v{notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.destination.complete()}}function G(t,e){if(e.closed)return;if(t instanceof C)return t.subscribe(e);let n;try{n=V(t)(e)}catch(i){e.error(i)}return n}function W(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(W((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))),n)):("number"==typeof e&&(n=e),e=>e.lift(new q(t,n)))}class q{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new X(t,this.project,this.concurrent))}}class X extends ${constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function Y(t=Number.POSITIVE_INFINITY){return W(x,t)}function K(t,e){return e?z(t,e):new C(L(t))}function Q(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return M(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof i&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof C?t[0]:Y(e)(K(t,n))}function Z(){return function(t){return t.lift(new J(t))}}class J{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const i=new tt(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class tt extends v{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}class et extends C{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new g,t.add(this.source.subscribe(new it(this.getSubject(),this))),t.closed&&(this._connection=null,t=g.EMPTY)),t}refCount(){return Z()(this)}}const nt=(()=>{const t=et.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class it extends A{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function rt(t,e){return function(n){let i;if(i="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new st(i,e));const r=Object.create(n,nt);return r.source=n,r.subjectFactory=i,r}}class st{constructor(t,e){this.subjectFactory=t,this.selector=e}call(t,e){const{selector:n}=this,i=this.subjectFactory(),r=n(i).subscribe(t);return r.add(e.subscribe(i)),r}}function ot(){return new P}function at(){return t=>Z()(rt(ot)(t))}function lt(t){for(let e in t)if(t[e]===lt)return e;throw Error("Could not find renamed property on target object.")}function ct(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function ut(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(ut).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function ht(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const dt=lt({__forward_ref__:lt});function pt(t){return t.__forward_ref__=pt,t.toString=function(){return ut(this())},t}function ft(t){return gt(t)?t():t}function gt(t){return"function"==typeof t&&t.hasOwnProperty(dt)&&t.__forward_ref__===pt}class mt extends Error{constructor(t,e){super(function(t,e){return`${t?`NG0${t}: `:""}${e}`}(t,e)),this.code=t}}function yt(t){return"string"==typeof t?t:null==t?"":String(t)}function vt(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():yt(t)}function _t(t,e){const n=e?` in ${e}`:"";throw new mt("201",`No provider for ${vt(t)} found${n}`)}function wt(t,e){null==t&&function(t,e,n,i){throw new Error(`ASSERTION ERROR: ${t}`+(null==i?"":` [Expected=> ${n} ${i} ${e} <=Actual]`))}(e,t,null,"!=")}function xt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function St(t){return{providers:t.providers||[],imports:t.imports||[]}}function Et(t){return Ct(t,Tt)||Ct(t,At)}function Ct(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ot(t){return t&&(t.hasOwnProperty(kt)||t.hasOwnProperty(Pt))?t[kt]:null}const Tt=lt({"\u0275prov":lt}),kt=lt({"\u0275inj":lt}),At=lt({ngInjectableDef:lt}),Pt=lt({ngInjectorDef:lt});var It=(()=>((It=It||{})[It.Default=0]="Default",It[It.Host=1]="Host",It[It.Self=2]="Self",It[It.SkipSelf=4]="SkipSelf",It[It.Optional=8]="Optional",It))();let Mt;function Dt(t){const e=Mt;return Mt=t,e}function Rt(t,e,n){const i=Et(t);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&It.Optional?null:void 0!==e?e:void _t(ut(t),"Injector")}function Nt(t){return{toString:t}.toString()}var Lt=(()=>((Lt=Lt||{})[Lt.OnPush=0]="OnPush",Lt[Lt.Default=1]="Default",Lt))(),jt=(()=>((jt=jt||{})[jt.Emulated=0]="Emulated",jt[jt.None=2]="None",jt[jt.ShadowDom=3]="ShadowDom",jt))();const Ft="undefined"!=typeof globalThis&&globalThis,Bt="undefined"!=typeof window&&window,Vt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,zt="undefined"!=typeof global&&global,Ut=Ft||zt||Bt||Vt,Ht={},$t=[],Gt=lt({"\u0275cmp":lt}),Wt=lt({"\u0275dir":lt}),qt=lt({"\u0275pipe":lt}),Xt=lt({"\u0275mod":lt}),Yt=lt({"\u0275loc":lt}),Kt=lt({"\u0275fac":lt}),Qt=lt({__NG_ELEMENT_ID__:lt});let Zt=0;function Jt(t){return Nt(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===Lt.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||$t,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||jt.Emulated,id:"c",styles:t.styles||$t,_:null,setInput:null,schemas:t.schemas||null,tView:null},i=t.directives,r=t.features,s=t.pipes;return n.id+=Zt++,n.inputs=re(t.inputs,e),n.outputs=re(t.outputs),r&&r.forEach(t=>t(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(te):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(ee):null,n})}function te(t){return ae(t)||function(t){return t[Wt]||null}(t)}function ee(t){return function(t){return t[qt]||null}(t)}const ne={};function ie(t){return Nt(()=>{const e={type:t.type,bootstrap:t.bootstrap||$t,declarations:t.declarations||$t,imports:t.imports||$t,exports:t.exports||$t,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&(ne[t.id]=t.type),e})}function re(t,e){if(null==t)return Ht;const n={};for(const i in t)if(t.hasOwnProperty(i)){let r=t[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,e&&(e[r]=s)}return n}const se=Jt;function oe(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,onDestroy:t.type.prototype.ngOnDestroy||null}}function ae(t){return t[Gt]||null}function le(t,e){const n=t[Xt]||null;if(!n&&!0===e)throw new Error(`Type ${ut(t)} does not have '\u0275mod' property.`);return n}function ce(t){return Array.isArray(t)&&"object"==typeof t[1]}function ue(t){return Array.isArray(t)&&!0===t[1]}function he(t){return 0!=(8&t.flags)}function de(t){return 2==(2&t.flags)}function pe(t){return 1==(1&t.flags)}function fe(t){return null!==t.template}function ge(t){return 0!=(512&t[2])}function me(t,e){return t.hasOwnProperty(Kt)?t[Kt]:null}class be{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function ye(){return ve}function ve(t){return t.type.prototype.ngOnChanges&&(t.setInput=we),_e}function _e(){const t=Se(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===Ht)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function we(t,e,n,i){const r=Se(t)||function(t,e){return t[xe]=e}(t,{previous:Ht,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],l=o[a];s[a]=new be(l&&l.currentValue,e,o===Ht),t[i]=e}ye.ngInherit=!0;const xe="__ngSimpleChanges__";function Se(t){return t[xe]||null}const Ee="http://www.w3.org/2000/svg";let Ce;function Oe(){return void 0!==Ce?Ce:"undefined"!=typeof document?document:void 0}function Te(t){return!!t.listen}const ke={createRenderer:(t,e)=>Oe()};function Ae(t){for(;Array.isArray(t);)t=t[0];return t}function Pe(t,e){return Ae(e[t])}function Ie(t,e){return Ae(e[t.index])}function Me(t,e){return t.data[e]}function De(t,e){return t[e]}function Re(t,e){const n=e[t];return ce(n)?n:n[0]}function Ne(t){return 4==(4&t[2])}function Le(t){return 128==(128&t[2])}function je(t,e){return null==e?null:t[e]}function Fe(t){t[18]=0}function Be(t,e){t[5]+=e;let n=t,i=t[3];for(;null!==i&&(1===e&&1===n[5]||-1===e&&0===n[5]);)i[5]+=e,n=i,i=i[3]}const Ve={lFrame:dn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function ze(){return Ve.bindingsEnabled}function Ue(){return Ve.lFrame.lView}function He(){return Ve.lFrame.tView}function $e(t){return Ve.lFrame.contextLView=t,t[8]}function Ge(){let t=We();for(;null!==t&&64===t.type;)t=t.parent;return t}function We(){return Ve.lFrame.currentTNode}function qe(t,e){const n=Ve.lFrame;n.currentTNode=t,n.isParent=e}function Xe(){return Ve.lFrame.isParent}function Ye(){Ve.lFrame.isParent=!1}function Ke(){return Ve.isInCheckNoChangesMode}function Qe(t){Ve.isInCheckNoChangesMode=t}function Ze(){const t=Ve.lFrame;let e=t.bindingRootIndex;return-1===e&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function Je(){return Ve.lFrame.bindingIndex}function tn(){return Ve.lFrame.bindingIndex++}function en(t){const e=Ve.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function nn(t,e){const n=Ve.lFrame;n.bindingIndex=n.bindingRootIndex=t,rn(e)}function rn(t){Ve.lFrame.currentDirectiveIndex=t}function sn(t){const e=Ve.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}function on(){return Ve.lFrame.currentQueryIndex}function an(t){Ve.lFrame.currentQueryIndex=t}function ln(t){const e=t[1];return 2===e.type?e.declTNode:1===e.type?t[6]:null}function cn(t,e,n){if(n&It.SkipSelf){let i=e,r=t;for(;!(i=i.parent,null!==i||n&It.Host||(i=ln(r),null===i||(r=r[15],10&i.type))););if(null===i)return!1;e=i,t=r}const i=Ve.lFrame=hn();return i.currentTNode=e,i.lView=t,!0}function un(t){const e=hn(),n=t[1];Ve.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function hn(){const t=Ve.lFrame,e=null===t?null:t.child;return null===e?dn(t):e}function dn(t){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=e),e}function pn(){const t=Ve.lFrame;return Ve.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const fn=pn;function gn(){const t=pn();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function mn(){return Ve.lFrame.selectedIndex}function bn(t){Ve.lFrame.selectedIndex=t}function yn(){const t=Ve.lFrame;return Me(t.tView,t.selectedIndex)}function vn(){Ve.lFrame.currentNamespace=Ee}function _n(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n=i)break}else e[a]<0&&(t[18]+=65536),(o>11>16&&(3&t[2])===e){t[2]+=2048;try{s.call(o)}finally{}}}else try{s.call(o)}finally{}}class On{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function Tn(t,e,n){const i=Te(t);let r=0;for(;re){o=s-1;break}}}for(;s>16}(t),i=e;for(;n>0;)i=i[15],n--;return i}let Nn=!0;function Ln(t){const e=Nn;return Nn=t,e}let jn=0;function Fn(t,e){const n=Vn(t,e);if(-1!==n)return n;const i=e[1];i.firstCreatePass&&(t.injectorIndex=e.length,Bn(i.data,t),Bn(e,null),Bn(i.blueprint,null));const r=zn(t,e),s=t.injectorIndex;if(Mn(r)){const t=Dn(r),n=Rn(r,e),i=n[1].data;for(let r=0;r<8;r++)e[s+r]=n[t+r]|i[t+r]}return e[s+8]=r,s}function Bn(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Vn(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===e[t.injectorIndex+8]?-1:t.injectorIndex}function zn(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=0,i=null,r=e;for(;null!==r;){const t=r[1],e=t.type;if(i=2===e?t.declTNode:1===e?r[6]:null,null===i)return-1;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return-1}function Un(t,e,n){!function(t,e,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Qt)&&(i=n[Qt]),null==i&&(i=n[Qt]=jn++);const r=255&i;e.data[t+(r>>5)]|=1<=0?255&e:qn:e}(n);if("function"==typeof s){if(!cn(e,t,i))return i&It.Host?Hn(r,n,i):$n(e,n,i,r);try{const t=s(i);if(null!=t||i&It.Optional)return t;_t(n)}finally{fn()}}else if("number"==typeof s){let r=null,o=Vn(t,e),a=-1,l=i&It.Host?e[16][6]:null;for((-1===o||i&It.SkipSelf)&&(a=-1===o?zn(t,e):e[o+8],-1!==a&&Zn(i,!1)?(r=e[1],o=Dn(a),e=Rn(a,e)):o=-1);-1!==o;){const t=e[1];if(Qn(s,o,t.data)){const t=Xn(o,e,n,r,i,l);if(t!==Wn)return t}a=e[o+8],-1!==a&&Zn(i,e[1].data[o+8]===l)&&Qn(s,o,e)?(r=t,o=Dn(a),e=Rn(a,e)):o=-1}}}return $n(e,n,i,r)}const Wn={};function qn(){return new Jn(Ge(),Ue())}function Xn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Yn(a,o,n,null==i?de(a)&&Nn:i!=o&&0!=(3&a.type),r&It.Host&&s===a);return null!==l?Kn(e,o,l,a):Wn}function Yn(t,e,n,i,r){const s=t.providerIndexes,o=e.data,a=1048575&s,l=t.directiveStart,c=s>>20,u=r?a+c:t.directiveEnd;for(let h=i?a:a+c;h=l&&t.type===n)return h}if(r){const t=o[l];if(t&&fe(t)&&t.type===n)return l}return null}function Kn(t,e,n,i){let r=t[n];const s=e.data;if(function(t){return t instanceof On}(r)){const o=r;o.resolving&&function(t,e){throw new mt("200",`Circular dependency in DI detected for ${t}`)}(vt(s[n]));const a=Ln(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Dt(o.injectImpl):null;cn(t,i,It.Default);try{r=t[n]=o.factory(void 0,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&function(t,e,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const i=ve(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,s))}(n,s[n],e)}finally{null!==l&&Dt(l),Ln(a),o.resolving=!1,fn()}}return r}function Qn(t,e,n){return!!(n[e+(t>>5)]&1<{const e=t.prototype.constructor,n=e[Kt]||ni(e),i=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==i;){const t=r[Kt]||ni(r);if(t&&t!==n)return t;r=Object.getPrototypeOf(r)}return t=>new t})}function ni(t){return gt(t)?()=>{const e=ni(ft(t));return e&&e()}:me(t)}function ii(t){return function(t,e){if("class"===e)return t.classes;if("style"===e)return t.styles;const n=t.attrs;if(n){const t=n.length;let i=0;for(;i{const i=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function r(...t){if(this instanceof r)return i.apply(this,t),this;const e=new r(...t);return n.annotation=e,n;function n(t,n,i){const r=t.hasOwnProperty(ri)?t[ri]:Object.defineProperty(t,ri,{value:[]})[ri];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(e),t}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}class oi{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=xt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return`InjectionToken ${this._desc}`}}const ai=Function;function li(t,e){void 0===e&&(e=t);for(let n=0;nArray.isArray(t)?ci(t,e):e(t))}function ui(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function hi(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function di(t,e){const n=[];for(let i=0;i=0?t[1|i]=n:(i=~i,function(t,e,n,i){let r=t.length;if(r==e)t.push(n,i);else if(1===r)t.push(i,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;)t[r]=t[r-2],r--;t[e]=n,t[e+1]=i}}(t,i,e,n)),i}function fi(t,e){const n=gi(t,e);if(n>=0)return t[1|n]}function gi(t,e){return function(t,e,n){let i=0,r=t.length>>n;for(;r!==i;){const s=i+(r-i>>1),o=t[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t.push(n+":"+("string"==typeof i?JSON.stringify(i):ut(i)))}r=`{${t.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${t.replace(vi,"\n ")}`}("\n"+t.message,r,n,i),t.ngTokenPath=r,t[yi]=null,t}const Ii=ki(si("Inject",t=>({token:t})),-1),Mi=ki(si("Optional"),8),Di=ki(si("SkipSelf"),4);let Ri,Ni;function Li(t){var e;return(null===(e=function(){if(void 0===Ri&&(Ri=null,Ut.trustedTypes))try{Ri=Ut.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(t){}return Ri}())||void 0===e?void 0:e.createHTML(t))||t}function ji(){if(void 0===Ni&&(Ni=null,Ut.trustedTypes))try{Ni=Ut.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(m){}return Ni}function Fi(t){var e;return(null===(e=ji())||void 0===e?void 0:e.createHTML(t))||t}function Bi(t){var e;return(null===(e=ji())||void 0===e?void 0:e.createScriptURL(t))||t}class Vi{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class zi extends Vi{getTypeName(){return"HTML"}}class Ui extends Vi{getTypeName(){return"Style"}}class Hi extends Vi{getTypeName(){return"Script"}}class $i extends Vi{getTypeName(){return"URL"}}class Gi extends Vi{getTypeName(){return"ResourceURL"}}function Wi(t){return t instanceof Vi?t.changingThisBreaksApplicationSecurity:t}function qi(t,e){const n=Xi(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===e}function Xi(t){return t instanceof Vi&&t.getTypeName()||null}class Yi{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t=""+t;try{const e=(new window.DOMParser).parseFromString(Li(t),"text/html").body;return null===e?this.inertDocumentHelper.getInertBodyElement(t):(e.removeChild(e.firstChild),e)}catch(e){return null}}}class Ki{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const e=this.inertDocument.createElement("body");t.appendChild(e)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=Li(t),e;const n=this.inertDocument.createElement("body");return n.innerHTML=Li(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(t){const e=t.attributes;for(let i=e.length-1;0Ji(t.trim())).join(", ")}function er(t){const e={};for(const n of t.split(","))e[n]=!0;return e}function nr(...t){const e={};for(const n of t)for(const t in n)n.hasOwnProperty(t)&&(e[t]=!0);return e}const ir=er("area,br,col,hr,img,wbr"),rr=er("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),sr=er("rp,rt"),or=nr(ir,nr(rr,er("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),nr(sr,er("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),nr(sr,rr)),ar=er("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),lr=er("srcset"),cr=nr(ar,lr,er("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),er("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),ur=er("script,style,template");class hr{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let e=t.firstChild,n=!0;for(;e;)if(e.nodeType===Node.ELEMENT_NODE?n=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,n&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);let t=this.checkClobberedElement(e,e.nextSibling);if(t){e=t;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")}startElement(t){const e=t.nodeName.toLowerCase();if(!or.hasOwnProperty(e))return this.sanitizedSomething=!0,!ur.hasOwnProperty(e);this.buf.push("<"),this.buf.push(e);const n=t.attributes;for(let i=0;i"),!0}endElement(t){const e=t.nodeName.toLowerCase();or.hasOwnProperty(e)&&!ir.hasOwnProperty(e)&&(this.buf.push(""))}chars(t){this.buf.push(fr(t))}checkClobberedElement(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`);return e}}const dr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,pr=/([^\#-~ |!])/g;function fr(t){return t.replace(/&/g,"&").replace(dr,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(pr,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let gr;function mr(t,e){let n=null;try{gr=gr||function(t){const e=new Ki(t);return function(){try{return!!(new window.DOMParser).parseFromString(Li(""),"text/html")}catch(t){return!1}}()?new Yi(e):e}(t);let i=e?String(e):"";n=gr.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=gr.getInertBodyElement(i)}while(i!==s);return Li((new hr).sanitizeChildren(br(n)||n))}finally{if(n){const t=br(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function br(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var yr=(()=>((yr=yr||{})[yr.NONE=0]="NONE",yr[yr.HTML=1]="HTML",yr[yr.STYLE=2]="STYLE",yr[yr.SCRIPT=3]="SCRIPT",yr[yr.URL=4]="URL",yr[yr.RESOURCE_URL=5]="RESOURCE_URL",yr))();function vr(t){const e=xr();return e?Fi(e.sanitize(yr.HTML,t)||""):qi(t,"HTML")?Fi(Wi(t)):mr(Oe(),yt(t))}function _r(t){const e=xr();return e?e.sanitize(yr.URL,t)||"":qi(t,"URL")?Wi(t):Ji(yt(t))}function wr(t){const e=xr();if(e)return Bi(e.sanitize(yr.RESOURCE_URL,t)||"");if(qi(t,"ResourceURL"))return Bi(Wi(t));throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)")}function xr(){const t=Ue();return t&&t[12]}const Sr="__ngContext__";function Er(t,e){t[Sr]=e}function Cr(t){const e=function(t){return t[Sr]||null}(t);return e?Array.isArray(e)?e:e.lView:null}function Or(t){return t.ngOriginalError}function Tr(t,...e){t.error(...e)}class kr{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),i=function(t){return t&&t.ngErrorLogger||Tr}(t);i(this._console,"ERROR",t),e&&i(this._console,"ORIGINAL ERROR",e),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?function(t){return t.ngDebugContext}(t)||this._findContext(Or(t)):null}_findOriginalError(t){let e=t&&Or(t);for(;e&&Or(e);)e=Or(e);return e||null}}const Ar=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Ut))();function Pr(t){return t.ownerDocument.defaultView}function Ir(t){return t.ownerDocument}function Mr(t){return t instanceof Function?t():t}var Dr=(()=>((Dr=Dr||{})[Dr.Important=1]="Important",Dr[Dr.DashCase=2]="DashCase",Dr))();function Rr(t,e){return undefined(t,e)}function Lr(t){const e=t[3];return ue(e)?e[3]:e}function jr(t){return Br(t[13])}function Fr(t){return Br(t[4])}function Br(t){for(;null!==t&&!ue(t);)t=t[4];return t}function Vr(t,e,n,i,r){if(null!=i){let s,o=!1;ue(i)?s=i:ce(i)&&(o=!0,i=i[0]);const a=Ae(i);0===t&&null!==n?null==r?Xr(e,n,a):qr(e,n,a,r||null,!0):1===t&&null!==n?qr(e,n,a,r||null,!0):2===t?function(t,e,n){const i=Kr(t,e);i&&function(t,e,n,i){Te(t)?t.removeChild(e,n,i):e.removeChild(n)}(t,i,e,n)}(e,a,o):3===t&&e.destroyNode(a),null!=s&&function(t,e,n,i,r){const s=n[7];s!==Ae(n)&&Vr(e,t,i,s,r);for(let o=10;o0&&(t[n-1][4]=i[4]);const s=hi(t,10+e);!function(t,e){rs(t,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function $r(t,e){if(!(256&e[2])){const n=e[11];Te(n)&&n.destroyNode&&rs(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Gr(t[1],t);for(;e;){let n=null;if(ce(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)ce(e)&&Gr(e[1],e),e=e[3];null===e&&(e=t),ce(e)&&Gr(e[1],e),n=e&&e[4]}e=n}}(e)}}function Gr(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let i=0;i=0?i[r=l]():i[r=-l].unsubscribe(),s+=2}else{const t=i[r=n[s+1]];n[s].call(t)}if(null!==i){for(let t=r+1;ts?"":r[u+1].toLowerCase();const e=8&i?t:null;if(e&&-1!==ls(e,c,0)||2&i&&c!==t){if(fs(i))return!1;o=!0}}}}else{if(!o&&!fs(i)&&!fs(l))return!1;if(o&&fs(l))continue;o=!1,i=l|1&i}}return fs(i)||o}function fs(t){return 0==(1&t)}function gs(t,e,n,i){if(null===e)return-1;let r=0;if(i||!n){let n=!1;for(;r-1)for(n++;n0?'="'+e+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!fs(o)&&(e+=ys(s,r),r=""),i=o,s=s||!fs(i);n++}return""!==r&&(e+=ys(s,r)),e}const _s={};function ws(t){xs(He(),Ue(),mn()+t,Ke())}function xs(t,e,n,i){if(!i)if(3==(3&e[2])){const i=t.preOrderCheckHooks;null!==i&&wn(e,i,n)}else{const i=t.preOrderHooks;null!==i&&xn(e,i,0,n)}bn(n)}function Ss(t,e){return t<<17|e<<2}function Es(t){return t>>17&32767}function Cs(t){return 2|t}function Os(t){return(131068&t)>>2}function Ts(t,e){return-131069&t|e<<2}function ks(t){return 1|t}function As(t,e){const n=t.contentQueries;if(null!==n)for(let i=0;i20&&xs(t,e,20,Ke()),n(i,r)}finally{bn(s)}}function js(t,e,n){if(he(e)){const i=e.directiveEnd;for(let r=e.directiveStart;r0;){const n=t[--e];if("number"==typeof n&&n<0)return n}return 0})(n)!=s&&n.push(s),n.push(i,r,o)}}function qs(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function Xs(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function Ys(t,e,n){if(n){if(e.exportAs)for(let i=0;i0&&ro(n)}}function ro(t){for(let n=jr(t);null!==n;n=Fr(n))for(let t=10;t0&&ro(e)}const e=t[1].components;if(null!==e)for(let n=0;n0&&ro(i)}}function so(t,e){const n=Re(e,t),i=n[1];(function(t,e){for(let n=e.length;nPromise.resolve(null))();function po(t){return t[7]||(t[7]=[])}function fo(t){return t.cleanup||(t.cleanup=[])}function go(t,e,n){return(null===t||fe(t))&&(n=function(t){for(;Array.isArray(t);){if("object"==typeof t[1])return t;t=t[0]}return null}(n[e.index])),n[11]}function mo(t,e){const n=t[9],i=n?n.get(kr,null):null;i&&i.handleError(e)}function bo(t,e,n,i,r){for(let s=0;sthis.processProvider(n,t,e)),ci([t],t=>this.processInjectorType(t,[],r)),this.records.set(_o,Io(void 0,this));const s=this.records.get(xo);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof t?null:ut(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=mi,n=It.Default){this.assertNotDestroyed();const i=Si(this),r=Dt(void 0);try{if(!(n&It.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=function(t){return"function"==typeof t||"object"==typeof t&&t instanceof oi}(t)&&Et(t);e=n&&this.injectableDefInScope(n)?Io(Ao(t),So):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&It.Self?Oo():this.parent).get(t,e=n&It.Optional&&e===mi?null:e)}catch(s){if("NullInjectorError"===s.name){if((s[yi]=s[yi]||[]).unshift(ut(t)),i)throw s;return Pi(s,t,"R3InjectorError",this.source)}throw s}finally{Dt(r),Si(i)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(ut(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=ft(t)))return!1;let i=Ot(t);const r=null==i&&t.ngModule||void 0,s=void 0===r?t:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=Ot(r)),null==i)return!1;if(null!=i.imports&&!o){let t;n.push(s);try{ci(i.imports,i=>{this.processInjectorType(i,e,n)&&(void 0===t&&(t=[]),t.push(i))})}finally{}if(void 0!==t)for(let e=0;ethis.processProvider(t,n,i||$t))}}this.injectorDefTypes.add(s);const a=me(s)||(()=>new s);this.records.set(s,Io(a,So));const l=i.providers;if(null!=l&&!o){const e=t;ci(l,t=>this.processProvider(t,e,l))}return void 0!==r&&void 0!==t.providers}processProvider(t,e,n){let i=Do(t=ft(t))?t:ft(t&&t.provide);const r=function(t,e,n){return Mo(t)?Io(void 0,t.useValue):Io(Po(t),So)}(t);if(Do(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=Io(void 0,So,!0),e.factory=()=>Ti(e.multi),this.records.set(i,e)),i=t,e.multi.push(t)}this.records.set(i,r)}hydrate(t,e){return e.value===So&&(e.value=Eo,e.value=e.factory()),"object"==typeof e.value&&e.value&&function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.ngOnDestroy}(e.value)&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){if(!t.providedIn)return!1;const e=ft(t.providedIn);return"string"==typeof e?"any"===e||e===this.scope:this.injectorDefTypes.has(e)}}function Ao(t){const e=Et(t),n=null!==e?e.factory:me(t);if(null!==n)return n;if(t instanceof oi)throw new Error(`Token ${ut(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=di(e,"?");throw new Error(`Can't resolve all parameters for ${ut(t)}: (${n.join(", ")}).`)}const n=function(t){const e=t&&(t[Tt]||t[At]);if(e){const n=function(t){if(t.hasOwnProperty("name"))return t.name;const e=(""+t).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),e}return null}(t);return null!==n?()=>n.factory(t):()=>new t}(t);throw new Error("unreachable")}function Po(t,e,n){let i;if(Do(t)){const e=ft(t);return me(e)||Ao(e)}if(Mo(t))i=()=>ft(t.useValue);else if(function(t){return!(!t||!t.useFactory)}(t))i=()=>t.useFactory(...Ti(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))i=()=>Ci(ft(t.useExisting));else{const e=ft(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return me(e)||Ao(e);i=()=>new e(...Ti(t.deps))}return i}function Io(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function Mo(t){return null!==t&&"object"==typeof t&&wi in t}function Do(t){return"function"==typeof t}const Ro=function(t,e,n){return function(t,e=null,n=null,i){const r=To(t,e,n,i);return r._resolveInjectorDefTypes(),r}({name:n},e,t,n)};class No{static create(t,e){return Array.isArray(t)?Ro(t,e,""):Ro(t.providers,t.parent,t.name||"")}}function Lo(t,e){_n(Cr(t)[1],Ge())}function jo(t){let e=function(t){return Object.getPrototypeOf(t.prototype).constructor}(t.type),n=!0;const i=[t];for(;e;){let r;if(fe(t))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(n){i.push(r);const e=t;e.inputs=Fo(t.inputs),e.declaredInputs=Fo(t.declaredInputs),e.outputs=Fo(t.outputs);const n=r.hostBindings;n&&zo(t,n);const s=r.viewQuery,o=r.contentQueries;if(s&&Bo(t,s),o&&Vo(t,o),ct(t.inputs,r.inputs),ct(t.declaredInputs,r.declaredInputs),ct(t.outputs,r.outputs),fe(r)&&r.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(r.data.animation)}}const e=r.features;if(e)for(let i=0;i=0;i--){const r=t[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Pn(r.hostAttrs,n=Pn(n,r.hostAttrs))}}(i)}function Fo(t){return t===Ht?{}:t===$t?[]:t}function Bo(t,e){const n=t.viewQuery;t.viewQuery=n?(t,i)=>{e(t,i),n(t,i)}:e}function Vo(t,e){const n=t.contentQueries;t.contentQueries=n?(t,i,r)=>{e(t,i,r),n(t,i,r)}:e}function zo(t,e){const n=t.hostBindings;t.hostBindings=n?(t,i)=>{e(t,i),n(t,i)}:e}No.THROW_IF_NOT_FOUND=mi,No.NULL=new wo,No.\u0275prov=xt({token:No,providedIn:"any",factory:()=>Ci(_o)}),No.__NG_ELEMENT_ID__=-1;let Uo=null;function Ho(){if(!Uo){const t=Ut.Symbol;if(t&&t.iterator)Uo=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;ea(Ae(t[i.index])):i.index;if(Te(n)){let o=null;if(!a&&l&&(o=function(t,e,n,i){const r=t.cleanup;if(null!=r)for(let s=0;sn?t[n]:null}"string"==typeof t&&(s+=2)}return null}(t,e,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,d=!1;else{s=ya(i,e,u,s,!1);const t=n.listen(f,r,s);h.push(s,t),c&&c.push(r,m,g,g+1)}}else s=ya(i,e,u,s,!0),f.addEventListener(r,s,o),h.push(s),c&&c.push(r,m,g,o)}else s=ya(i,e,u,s,!1);const p=i.outputs;let f;if(d&&null!==p&&(f=p[r])){const t=f.length;if(t)for(let n=0;n0;)e=e[15],t--;return e}(t,Ve.lFrame.contextLView))[8]}(t)}function _a(t,e){let n=null;const i=function(t){const e=t.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(t);for(let r=0;r=0}const Ta={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function ka(t){return t.substring(Ta.key,Ta.keyEnd)}function Aa(t){return t.substring(Ta.value,Ta.valueEnd)}function Pa(t,e){const n=Ta.textEnd;return n===e?-1:(e=Ta.keyEnd=function(t,e,n){for(;e32;)e++;return e}(t,Ta.key=e,n),Da(t,e,n))}function Ia(t,e){const n=Ta.textEnd;let i=Ta.key=Da(t,e,n);return n===i?-1:(i=Ta.keyEnd=function(t,e,n){let i;for(;e=65&&(-33&i)<=90||i>=48&&i<=57);)e++;return e}(t,i,n),i=Ra(t,i,n),i=Ta.value=Da(t,i,n),i=Ta.valueEnd=function(t,e,n){let i=-1,r=-1,s=-1,o=e,a=o;for(;o32&&(a=o),s=r,r=i,i=-33&l}return a}(t,i,n),Ra(t,i,n))}function Ma(t){Ta.key=0,Ta.keyEnd=0,Ta.value=0,Ta.valueEnd=0,Ta.textEnd=t.length}function Da(t,e,n){for(;e=0;n=Ia(e,n))qa(t,ka(e),Aa(e))}function Ba(t){Ua(pi,Va,t,!0)}function Va(t,e){for(let n=function(t){return Ma(t),Pa(t,Da(t,0,Ta.textEnd))}(e);n>=0;n=Pa(e,n))pi(t,ka(e),!0)}function za(t,e,n,i){const r=Ue(),s=He(),o=en(2);s.firstUpdatePass&&$a(s,t,o,i),e!==_s&&Xo(r,o,e)&&Xa(s,s.data[mn()],r,r[11],t,r[o+1]=function(t,e){return null==t||("string"==typeof e?t+=e:"object"==typeof t&&(t=ut(Wi(t)))),t}(e,n),i,o)}function Ua(t,e,n,i){const r=He(),s=en(2);r.firstUpdatePass&&$a(r,null,s,i);const o=Ue();if(n!==_s&&Xo(o,s,n)){const a=r.data[mn()];if(Qa(a,i)&&!Ha(r,s)){let t=i?a.classesWithoutHost:a.stylesWithoutHost;null!==t&&(n=ht(t,n||"")),ia(r,a,o,n,i)}else!function(t,e,n,i,r,s,o,a){r===_s&&(r=$t);let l=0,c=0,u=0=t.expandoStartIndex}function $a(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[mn()],o=Ha(t,n);Qa(s,i)&&null===e&&!o&&(e=!1),e=function(t,e,n,i){const r=sn(t);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(n=Wa(n=Ga(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=Ga(r,t,e,n,i),null===s){let n=function(t,e,n){const i=n?e.classBindings:e.styleBindings;if(0!==Os(i))return t[Es(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=Ga(null,t,e,n[1],i),n=Wa(n,e.attrs,i),function(t,e,n,i){t[Es(n?e.classBindings:e.styleBindings)]=i}(t,e,i,n))}else s=function(t,e,n){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(u=!0)}else c=n;if(r)if(0!==l){const e=Es(t[a+1]);t[i+1]=Ss(e,a),0!==e&&(t[e+1]=Ts(t[e+1],i)),t[a+1]=function(t,e){return 131071&t|e<<17}(t[a+1],i)}else t[i+1]=Ss(a,0),0!==a&&(t[a+1]=Ts(t[a+1],i)),a=i;else t[i+1]=Ss(l,0),0===a?a=i:t[l+1]=Ts(t[l+1],i),l=i;u&&(t[i+1]=Cs(t[i+1])),Ca(t,c,i,!0),Ca(t,c,i,!1),function(t,e,n,i,r){const s=r?t.residualClasses:t.residualStyles;null!=s&&"string"==typeof e&&gi(s,e)>=0&&(n[i+1]=ks(n[i+1]))}(e,c,t,i,s),o=Ss(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,n,o,i)}}function Ga(t,e,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a0;){const e=t[r],s=Array.isArray(e),l=s?e[1]:e,c=null===l;let u=n[r+1];u===_s&&(u=c?$t:void 0);let h=c?fi(u,i):l===i?u:void 0;if(s&&!Ka(h)&&(h=fi(e,i)),Ka(h)&&(a=h,o))return a;const d=t[r+1];r=o?Es(d):Os(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=fi(t,i))}return a}function Ka(t){return void 0!==t}function Qa(t,e){return 0!=(t.flags&(e?16:32))}function Za(t,e=""){const n=Ue(),i=He(),r=t+20,s=i.firstCreatePass?Is(i,r,1,e,null):i.data[r],o=n[r]=function(t,e){return Te(t)?t.createText(e):t.createTextNode(e)}(n[11],e);Jr(i,n,o,s),qe(s,!1)}function Ja(t){return tl("",t,""),Ja}function tl(t,e,n){const i=Ue(),r=Qo(i,t,e,n);return r!==_s&&yo(i,mn(),r),tl}function el(t,e,n,i,r){const s=Ue(),o=function(t,e,n,i,r,s){const o=Yo(t,Je(),n,r);return en(2),o?e+yt(n)+i+yt(r)+s:_s}(s,t,e,n,i,r);return o!==_s&&yo(s,mn(),o),el}function nl(t,e,n){Ua(pi,Va,Qo(Ue(),t,e,n),!0)}function il(t,e,n){const i=Ue();return Xo(i,tn(),e)&&$s(He(),yn(),i,t,e,i[11],n,!0),il}function rl(t,e,n){const i=Ue();if(Xo(i,tn(),e)){const r=He(),s=yn();$s(r,s,i,t,e,go(sn(r.data),s,i),n,!0)}return rl}const sl=void 0;var ol=["en",[["a","p"],["AM","PM"],sl],[["AM","PM"],sl,sl],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],sl,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],sl,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",sl,"{1} 'at' {0}",sl],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){const e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];let al={};function ll(t){return t in al||(al[t]=Ut.ng&&Ut.ng.common&&Ut.ng.common.locales&&Ut.ng.common.locales[t]),al[t]}var cl=(()=>((cl=cl||{})[cl.LocaleId=0]="LocaleId",cl[cl.DayPeriodsFormat=1]="DayPeriodsFormat",cl[cl.DayPeriodsStandalone=2]="DayPeriodsStandalone",cl[cl.DaysFormat=3]="DaysFormat",cl[cl.DaysStandalone=4]="DaysStandalone",cl[cl.MonthsFormat=5]="MonthsFormat",cl[cl.MonthsStandalone=6]="MonthsStandalone",cl[cl.Eras=7]="Eras",cl[cl.FirstDayOfWeek=8]="FirstDayOfWeek",cl[cl.WeekendRange=9]="WeekendRange",cl[cl.DateFormat=10]="DateFormat",cl[cl.TimeFormat=11]="TimeFormat",cl[cl.DateTimeFormat=12]="DateTimeFormat",cl[cl.NumberSymbols=13]="NumberSymbols",cl[cl.NumberFormats=14]="NumberFormats",cl[cl.CurrencyCode=15]="CurrencyCode",cl[cl.CurrencySymbol=16]="CurrencySymbol",cl[cl.CurrencyName=17]="CurrencyName",cl[cl.Currencies=18]="Currencies",cl[cl.Directionality=19]="Directionality",cl[cl.PluralCase=20]="PluralCase",cl[cl.ExtraData=21]="ExtraData",cl))();const ul="en-US";let hl=ul;function dl(t){wt(t,"Expected localeId to be defined"),"string"==typeof t&&(hl=t.toLowerCase().replace(/_/g,"-"))}function pl(t,e,n,i,r){if(t=ft(t),Array.isArray(t))for(let s=0;s>20;if(Do(t)||!t.multi){const i=new On(l,r,ea),p=ml(a,e,r?u:u+d,h);-1===p?(Un(Fn(c,o),s,a),fl(s,t,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(i),o.push(i)):(n[p]=i,o[p]=i)}else{const p=ml(a,e,u+d,h),f=ml(a,e,u,u+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Un(Fn(c,o),s,a);const u=function(t,e,n,i,r){const s=new On(t,n,ea);return s.multi=[],s.index=e,s.componentProviders=0,gl(s,r,i&&!n),s}(r?yl:bl,n.length,r,i,l);!r&&m&&(n[f].providerFactory=u),fl(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(u),o.push(u)}else fl(s,t,p>-1?p:f,gl(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function fl(t,e,n,i){const r=Do(e);if(r||function(t){return!!t.useClass}(e)){const s=(e.useClass||e).prototype.ngOnDestroy;if(s){const o=t.destroyHooks||(t.destroyHooks=[]);if(!r&&e.multi){const t=o.indexOf(n);-1===t?o.push(n,[i,s]):o[t+1].push(i,s)}else o.push(n,s)}}}function gl(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function ml(t,e,n,i){for(let r=n;r{n.providersResolver=(n,i)=>function(t,e,n){const i=He();if(i.firstCreatePass){const r=fe(t);pl(n,i.data,i.blueprint,r,!0),pl(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class wl{}const xl="ngComponent";class Sl{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${ut(t)}. Did you add it to @NgModule.entryComponents?`);return e[xl]=t,e}(t)}}class El{}function Cl(...t){}function Ol(t,e){return new kl(Ie(t,e))}El.NULL=new Sl;const Tl=function(){return Ol(Ge(),Ue())};let kl=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=Tl,t})();function Al(t){return t instanceof kl?t.nativeElement:t}class Pl{}let Il=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Ml(),t})();const Ml=function(){const t=Ue(),e=Re(Ge().index,t);return function(t){return t[11]}(ce(e)?e:t)};let Dl=(()=>{class t{}return t.\u0275prov=xt({token:t,providedIn:"root",factory:()=>null}),t})();class Rl{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Nl=new Rl("12.2.5");class Ll{constructor(){}supports(t){return Go(t)}create(t){return new Fl(t)}}const jl=(t,e)=>e;class Fl{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||jl}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,i=0,r=null;for(;e||n;){const s=!n||e&&e.currentIndex{i=this._trackByFn(e,t),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,t,i,e)),Object.is(r.item,t)||this._addIdentityChange(r,t)):(r=this._mismatch(r,t,i,e),s=!0),r=r._next,e++}),this.length=e;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,i){let r;return null===t?r=this._itTail:(r=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,r,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,r,i)):t=this._addAfter(new Bl(e,n),r,i),t}_verifyReinsertion(t,e,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?t=this._reinsertAfter(r,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,r=t._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const i=null===e?this._itHead:e._next;return t._next=i,t._prev=e,null===i?this._itTail=t:i._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new zl),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new zl),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class Bl{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Vl{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class zl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new Vl,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Ul(t,e,n){const i=t.previousIndex;if(null===i)return i;let r=0;return n&&i{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const i=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,i)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new Gl(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class Gl{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function Wl(){return new ql([new Ll])}let ql=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Wl()),deps:[[t,new Di,new Mi]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(t){return t.name||typeof t}(t)}'`)}}return t.\u0275prov=xt({token:t,providedIn:"root",factory:Wl}),t})();function Xl(){return new Yl([new Hl])}let Yl=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Xl()),deps:[[t,new Di,new Mi]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=xt({token:t,providedIn:"root",factory:Xl}),t})();function Kl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(Ae(s)),ue(s))for(let t=10;t-1&&(Hr(t,n),hi(e,n))}this._attachedToViewContainer=!1}$r(this._lView[1],this._lView)}onDestroy(t){Us(this._lView[1],this._lView,null,t)}markForCheck(){ao(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){lo(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){Qe(!0);try{lo(t,e,n)}finally{Qe(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(t,e){rs(t,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class Zl extends Ql{constructor(t){super(t),this._view=t}detectChanges(){co(this._view)}checkNoChanges(){!function(t){Qe(!0);try{co(t)}finally{Qe(!1)}}(this._view)}get context(){return null}}const Jl=function(t){return function(t,e,n){if(de(t)&&!n){const n=Re(t.index,e);return new Ql(n,n)}return 47&t.type?new Ql(e[16],e):null}(Ge(),Ue(),16==(16&t))};let tc=(()=>{class t{}return t.__NG_ELEMENT_ID__=Jl,t})();const ec=[new Hl],nc=new ql([new Ll]),ic=new Yl(ec),rc=function(){return lc(Ge(),Ue())};let sc=(()=>{class t{}return t.__NG_ELEMENT_ID__=rc,t})();const oc=sc,ac=class extends oc{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=Ps(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(e)),Ds(e,n,t),new Ql(n)}};function lc(t,e){return 4&t.type?new ac(e,t,Ol(t,e)):null}class cc{}const uc=function(){return mc(Ge(),Ue())};let hc=(()=>{class t{}return t.__NG_ELEMENT_ID__=uc,t})();const dc=hc,pc=class extends dc{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return Ol(this._hostTNode,this._hostLView)}get injector(){return new Jn(this._hostTNode,this._hostLView)}get parentInjector(){const t=zn(this._hostTNode,this._hostLView);if(Mn(t)){const e=Rn(t,this._hostLView),n=Dn(t);return new Jn(e[1].data[n+8],e)}return new Jn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=fc(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,e,n){const i=t.createEmbeddedView(e||{});return this.insert(i,n),i}createComponent(t,e,n,i,r){const s=n||this.parentInjector;if(!r&&null==t.ngModule&&s){const t=s.get(cc,null);t&&(r=t)}const o=t.create(s,i,void 0,r);return this.insert(o.hostView,e),o}insert(t,e){const n=t._lView,i=n[1];if(function(t){return ue(t[3])}(n)){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],i=new pc(e,e[6],e[3]);i.detach(i.indexOf(t))}}const r=this._adjustIndex(e),s=this._lContainer;!function(t,e,n,i){const r=10+i,s=n.length;i>0&&(n[r-1][4]=e),iAr});class wc extends wl{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=function(t){return t.map(vs).join(",")}(t.selectors),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return vc(this.componentDef.inputs)}get outputs(){return vc(this.componentDef.outputs)}create(t,e,n,i){const r=(i=i||this.ngModule)?function(t,e){return{get:(n,i,r)=>{const s=t.get(n,bc,r);return s!==bc||i===bc?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Pl,ke),o=r.get(Dl,null),a=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(Te(t))return t.selectRootElement(e,n===jt.ShadowDom);let i="string"==typeof e?t.querySelector(e):e;return i.textContent="",i}(a,n,this.componentDef.encapsulation):zr(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?Ee:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),u=this.componentDef.onPush?576:528,h=function(t,e){return{components:[],scheduler:t||Ar,clean:ho,playerHandler:e||null,flags:0}}(),d=zs(0,null,null,1,0,null,null,null,null,null),p=Ps(null,d,h,u,null,null,s,a,o,r);let f,g;un(p);try{const t=function(t,e,n,i,r,s){const o=n[1];n[20]=t;const a=Is(o,20,2,"#host",null),l=a.mergedAttrs=e.hostAttrs;null!==l&&(vo(a,l,!0),null!==t&&(Tn(r,t,l),null!==a.classes&&as(r,t,a.classes),null!==a.styles&&os(r,t,a.styles)));const c=i.createRenderer(t,e),u=Ps(n,Vs(e),null,e.onPush?64:16,n[20],a,i,c,s||null,null);return o.firstCreatePass&&(Un(Fn(a,n),o,e.type),Xs(o,a),Ks(a,n.length,1)),oo(n,u),n[20]=u}(c,this.componentDef,p,s,a);if(c)if(n)Tn(a,c,["ng-version",Nl.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let i=1,r=2;for(;i0&&as(a,c,e.join(" "))}if(g=Me(d,20),void 0!==e){const t=g.projection=[];for(let n=0;nt(o,e)),e.contentQueries){const t=Ge();e.contentQueries(1,o,t.directiveStart)}const a=Ge();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(bn(a.index),Ws(n[1],a,0,a.directiveStart,a.directiveEnd,e),qs(e,o)),o}(t,this.componentDef,p,h,[Lo]),Ds(d,p,null)}finally{gn()}return new xc(this.componentType,f,Ol(g,p),p,g)}}class xc extends class{}{constructor(t,e,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.instance=e,this.hostView=this.changeDetectorRef=new Zl(i),this.componentType=t}get injector(){return new Jn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Sc=new Map;class Ec extends cc{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new yc(this);const n=le(t),i=function(t){return t[Yt]||null}(t);i&&dl(i),this._bootstrapComponents=Mr(n.bootstrap),this._r3Injector=To(t,e,[{provide:cc,useValue:this},{provide:El,useValue:this.componentFactoryResolver}],ut(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=No.THROW_IF_NOT_FOUND,n=It.Default){return t===No||t===cc||t===_o?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Cc extends class{}{constructor(t){super(),this.moduleType=t,null!==le(t)&&function(t){const e=new Set;!function t(n){const i=le(n,!0),r=i.id;null!==r&&(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${ut(e)} vs ${ut(e.name)}`)}(r,Sc.get(r),n),Sc.set(r,n));const s=Mr(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Ec(this.moduleType,t)}}function Oc(t,e,n){const i=Ze()+t,r=Ue();return r[i]===_s?qo(r,i,n?e.call(n):e()):function(t,e){return t[e]}(r,i)}function Tc(t,e,n,i){return Pc(Ue(),Ze(),t,e,n,i)}function kc(t,e,n,i,r,s){return function(t,e,n,i,r,s,o,a){const l=e+n;return function(t,e,n,i,r){const s=Yo(t,e,n,i);return Xo(t,e+2,r)||s}(t,l,r,s,o)?qo(t,l+3,a?i.call(a,r,s,o):i(r,s,o)):Ac(t,l+3)}(Ue(),Ze(),t,e,n,i,r,s)}function Ac(t,e){const n=t[e];return n===_s?void 0:n}function Pc(t,e,n,i,r,s){const o=e+n;return Xo(t,o,r)?qo(t,o+1,s?i.call(s,r):i(r)):Ac(t,o+1)}function Ic(t,e){const n=He();let i;const r=t+20;n.firstCreatePass?(i=function(t,e){if(e)for(let n=e.length-1;n>=0;n--){const i=e[n];if(t===i.name)return i}throw new mt("302",`The pipe '${t}' could not be found!`)}(e,n.pipeRegistry),n.data[r]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(r,i.onDestroy)):i=n.data[r];const s=i.factory||(i.factory=me(i.type)),o=Dt(ea);try{const t=Ln(!1),e=s();return Ln(t),function(t,e,n,i){n>=t.data.length&&(t.data[n]=null,t.blueprint[n]=null),e[n]=i}(n,Ue(),r,e),e}finally{Dt(o)}}function Mc(t,e,n){const i=t+20,r=Ue(),s=De(r,i);return function(t,e){$o.isWrapped(e)&&(e=$o.unwrap(e),t[Je()]=_s);return e}(r,function(t,e){return t[1].data[e].pure}(r,i)?Pc(r,Ze(),e,s.transform,n,s):s.transform(n))}function Dc(t){return e=>{setTimeout(t,void 0,e)}}const Rc=class extends P{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){var i,r,s;let o=t,a=e||(()=>null),l=n;if(t&&"object"==typeof t){const e=t;o=null===(i=e.next)||void 0===i?void 0:i.bind(e),a=null===(r=e.error)||void 0===r?void 0:r.bind(e),l=null===(s=e.complete)||void 0===s?void 0:s.bind(e)}this.__isAsync&&(a=Dc(a),o&&(o=Dc(o)),l&&(l=Dc(l)));const c=super.subscribe({next:o,error:a,complete:l});return t instanceof g&&t.add(c),c}};function Nc(){return this._results[Ho()]()}class Lc{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const e=Ho(),n=Lc.prototype;n[e]||(n[e]=Nc)}get changes(){return this._changes||(this._changes=new Rc)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,e){const n=this;n.dirty=!1;const i=li(t);(this._changesDetected=!function(t,e,n){if(t.length!==e.length)return!1;for(let i=0;i0)i.push(o[t/2]);else{const r=s[t+1],o=e[-n];for(let t=10;t{class t{constructor(t){this.appInits=t,this.resolve=Cl,this.reject=Cl,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n{e.subscribe({complete:t,error:n})});t.push(n)}}Promise.all(t).then(()=>{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(Ci(tu,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const nu=new oi("AppId"),iu={provide:nu,useFactory:function(){return`${ru()}${ru()}${ru()}`},deps:[]};function ru(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const su=new oi("Platform Initializer"),ou=new oi("Platform ID"),au=new oi("appBootstrapListener");let lu=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const cu=new oi("LocaleId"),uu=new oi("DefaultCurrencyCode");class hu{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const du=function(t){return new Cc(t)},pu=du,fu=function(t){return Promise.resolve(du(t))},gu=function(t){const e=du(t),n=Mr(le(t).declarations).reduce((t,e)=>{const n=ae(e);return n&&t.push(new wc(n)),t},[]);return new hu(e,n)},mu=gu,bu=function(t){return Promise.resolve(gu(t))};let yu=(()=>{class t{constructor(){this.compileModuleSync=pu,this.compileModuleAsync=fu,this.compileModuleAndAllComponentsSync=mu,this.compileModuleAndAllComponentsAsync=bu}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const vu=new oi("compilerOptions"),_u=(()=>Promise.resolve(0))();function wu(t){"undefined"==typeof Zone?_u.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class xu{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Rc(!1),this.onMicrotaskEmpty=new Rc(!1),this.onStable=new Rc(!1),this.onError=new Rc(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const i=this;i._nesting=0,i._outer=i._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!n&&e,i.shouldCoalesceRunChangeDetection=n,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function(){let t=Ut.requestAnimationFrame,e=Ut.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=()=>{!function(t){t.isCheckStableRunning||-1!==t.lastRequestAnimationFrameId||(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(Ut,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,Cu(t),t.isCheckStableRunning=!0,Eu(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Cu(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,i,r,s,o,a)=>{try{return Ou(t),n.invokeTask(r,s,o,a)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||t.shouldCoalesceRunChangeDetection)&&e(),Tu(t)}},onInvoke:(n,i,r,s,o,a,l)=>{try{return Ou(t),n.invoke(r,s,o,a,l)}finally{t.shouldCoalesceRunChangeDetection&&e(),Tu(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Cu(t),Eu(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,i,r)=>(e.handleError(i,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}(i)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!xu.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(xu.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,t,Su,Cl,Cl);try{return r.runTask(s,e,n)}finally{r.cancelTask(s)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}const Su={};function Eu(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Cu(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function Ou(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Tu(t){t._nesting--,Eu(t)}class ku{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Rc,this.onMicrotaskEmpty=new Rc,this.onStable=new Rc,this.onError=new Rc}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,i){return t.apply(e,n)}}let Au=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{xu.assertNotInAngularZone(),wu(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())wu(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let i=-1;e&&e>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==i),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})}whenStable(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Pu=(()=>{class t{constructor(){this._applications=new Map,Mu.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return Mu.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Iu{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let Mu=new Iu,Du=!0,Ru=!1;function Nu(){return Ru=!0,Du}let Lu;const ju=new oi("AllowMultipleToken");function Fu(t,e,n=[]){const i=`Platform: ${e}`,r=new oi(i);return(e=[])=>{let s=Bu();if(!s||s.injector.get(ju,!1))if(t)t(n.concat(e).concat({provide:r,useValue:!0}));else{const t=n.concat(e).concat({provide:r,useValue:!0},{provide:xo,useValue:"platform"});!function(t){if(Lu&&!Lu.destroyed&&!Lu.injector.get(ju,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Lu=t.get(Vu);const e=t.get(su,null);e&&e.forEach(t=>t())}(No.create({providers:t,name:i}))}return function(t){const e=Bu();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function Bu(){return Lu&&!Lu.destroyed?Lu:null}let Vu=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new ku:("zone.js"===t?void 0:t)||new xu({enableLongStackTrace:Nu(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),n}(e?e.ngZone:void 0,{ngZoneEventCoalescing:e&&e.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:e&&e.ngZoneRunCoalescing||!1}),i=[{provide:xu,useValue:n}];return n.run(()=>{const r=No.create({providers:i,parent:this.injector,name:t.moduleType.name}),s=t.create(r),o=s.injector.get(kr,null);if(!o)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const t=n.onError.subscribe({next:t=>{o.handleError(t)}});s.onDestroy(()=>{Hu(this._modules,s),t.unsubscribe()})}),function(t,n,i){try{const e=i();return ha(e)?e.catch(e=>{throw n.runOutsideAngular(()=>t.handleError(e)),e}):e}catch(e){throw n.runOutsideAngular(()=>t.handleError(e)),e}}(o,n,()=>{const t=s.injector.get(eu);return t.runInitializers(),t.donePromise.then(()=>(dl(s.injector.get(cu,ul)||ul),this._moduleDoBootstrap(s),s))})})}bootstrapModule(t,e=[]){const n=zu({},e);return function(t,e,n){const i=new Cc(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(Uu);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${ut(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(e)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function zu(t,e){return Array.isArray(e)?e.reduce(zu,t):Object.assign(Object.assign({},t),e)}let Uu=(()=>{class t{constructor(t,e,n,i,r){this._zone=t,this._injector=e,this._exceptionHandler=n,this._componentFactoryResolver=i,this._initStatus=r,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const s=new C(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),o=new C(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{xu.assertNotInAngularZone(),wu(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{xu.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=Q(s,o.pipe(at()))}bootstrap(t,e){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=t instanceof wl?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=function(t){return t.isBoundToModule}(n)?void 0:this._injector.get(cc),r=n.create(No.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Au,null),a=o&&r.injector.get(Pu);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),Hu(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;Hu(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(au,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(No),Ci(kr),Ci(El),Ci(eu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Hu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const $u=Fu(null,"core",[{provide:ou,useValue:"unknown"},{provide:Vu,deps:[No]},{provide:Pu,deps:[]},{provide:lu,deps:[]}]),Gu=[{provide:Uu,useClass:Uu,deps:[xu,No,kr,El,eu]},{provide:_c,deps:[xu],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:eu,useClass:eu,deps:[[new Mi,tu]]},{provide:yu,useClass:yu,deps:[]},iu,{provide:ql,useFactory:function(){return nc},deps:[]},{provide:Yl,useFactory:function(){return ic},deps:[]},{provide:cu,useFactory:function(t){return dl(t=t||"undefined"!=typeof $localize&&$localize.locale||ul),t},deps:[[new Ii(cu),new Mi,new Di]]},{provide:uu,useValue:"USD"}];let Wu=(()=>{class t{constructor(t){}}return t.\u0275fac=function(e){return new(e||t)(Ci(Uu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Gu}),t})(),qu=null;function Xu(){return qu}const Yu=new oi("DocumentToken");let Ku=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:Qu,token:t,providedIn:"platform"}),t})();function Qu(){return Ci(Zu)}let Zu=(()=>{class t extends Ku{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Xu().getBaseHref(this._doc)}onPopState(t){const e=Xu().getGlobalEventTarget(this._doc,"window");return e.addEventListener("popstate",t,!1),()=>e.removeEventListener("popstate",t)}onHashChange(t){const e=Xu().getGlobalEventTarget(this._doc,"window");return e.addEventListener("hashchange",t,!1),()=>e.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){Ju()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){Ju()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:th,token:t,providedIn:"platform"}),t})();function Ju(){return!!window.history.pushState}function th(){return new Zu(Ci(Yu))}function eh(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}function nh(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}function ih(t){return t&&"?"!==t[0]?"?"+t:t}let rh=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:sh,token:t,providedIn:"root"}),t})();function sh(t){const e=Ci(Yu).location;return new ah(Ci(Ku),e&&e.origin||"")}const oh=new oi("appBaseHref");let ah=(()=>{class t extends rh{constructor(t,e){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=e}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return eh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+ih(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+ih(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+ih(i));this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var e,n;null===(n=(e=this._platformLocation).historyGo)||void 0===n||n.call(e,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ku),Ci(oh,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),lh=(()=>{class t{constructor(t,e){this._subject=new Rc,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=nh(uh(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+ih(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,uh(e)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ih(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ih(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var e,n;null===(n=(e=this._platformStrategy).historyGo)||void 0===n||n.call(e,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}))}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}}return t.\u0275fac=function(e){return new(e||t)(Ci(rh),Ci(Ku))},t.normalizeQueryParams=ih,t.joinWithSlash=eh,t.stripTrailingSlash=nh,t.\u0275prov=xt({factory:ch,token:t,providedIn:"root"}),t})();function ch(){return new lh(Ci(rh),Ci(Ku))}function uh(t){return t.replace(/\/index.html$/,"")}var hh=(()=>((hh=hh||{})[hh.Zero=0]="Zero",hh[hh.One=1]="One",hh[hh.Two=2]="Two",hh[hh.Few=3]="Few",hh[hh.Many=4]="Many",hh[hh.Other=5]="Other",hh))();const dh=function(t){return function(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=ll(e);if(n)return n;const i=e.split("-")[0];if(n=ll(i),n)return n;if("en"===i)return ol;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[cl.PluralCase]};class ph{}let fh=(()=>{class t extends ph{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(dh(e||this.locale)(t)){case hh.Zero:return"zero";case hh.One:return"one";case hh.Two:return"two";case hh.Few:return"few";case hh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(Ci(cu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function gh(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[i,r]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(i.trim()===e)return decodeURIComponent(r)}return null}let mh=(()=>{class t{constructor(t,e,n,i){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&(Go(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachChangedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachRemovedItem(t=>{t.previousValue&&this._toggleClass(t.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(t=>{if("string"!=typeof t.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${ut(t.item)}`);this._toggleClass(t.item,!0)}),t.forEachRemovedItem(t=>this._toggleClass(t.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!0)):Object.keys(t).forEach(e=>this._toggleClass(e,!!t[e])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!1)):Object.keys(t).forEach(t=>this._toggleClass(t,!1)))}_toggleClass(t,e){(t=t.trim())&&t.split(/\s+/g).forEach(t=>{e?this._renderer.addClass(this._ngEl.nativeElement,t):this._renderer.removeClass(this._ngEl.nativeElement,t)})}}return t.\u0275fac=function(e){return new(e||t)(ea(ql),ea(Yl),ea(kl),ea(Il))},t.\u0275dir=se({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class bh{constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let yh=(()=>{class t{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const e=this._ngForOf;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${e}' of type '${function(t){return t.name||typeof t}(e)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,i)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new bh(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new vh(t,n);e.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new vh(t,r);e.push(s)}});for(let n=0;n{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(ql))},t.\u0275dir=se({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class vh{constructor(t,e){this.record=t,this.view=e}}let _h=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new wh,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){xh("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){xh("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc))},t.\u0275dir=se({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class wh{constructor(){this.$implicit=null,this.ngIf=null}}function xh(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${ut(e)}'.`)}class Sh{constructor(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()}}let Eh=(()=>{class t{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let e=0;e{class t{constructor(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new Sh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(Eh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Oh=(()=>{class t{constructor(t,e,n){n._addDefault(new Sh(t,e))}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(Eh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchDefault",""]]}),t})(),Th=(()=>{class t{constructor(t,e,n){this._ngEl=t,this._differs=e,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,e){const[n,i]=t.split(".");null!=(e=null!=e&&i?`${e}${i}`:e)?this._renderer.setStyle(this._ngEl.nativeElement,n,e):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(t){t.forEachRemovedItem(t=>this._setStyle(t.key,null)),t.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),t.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Yl),ea(Il))},t.\u0275dir=se({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),kh=(()=>{class t{constructor(t){this._viewContainerRef=t,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(t){if(t.ngTemplateOutlet){const t=this._viewContainerRef;this._viewRef&&t.remove(t.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?t.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&t.ngTemplateOutletContext&&this.ngTemplateOutletContext&&(this._viewRef.context=this.ngTemplateOutletContext)}}return t.\u0275fac=function(e){return new(e||t)(ea(hc))},t.\u0275dir=se({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[ye]}),t})();class Ah{createSubscription(t,e){return t.subscribe({next:e,error:t=>{throw t}})}dispose(t){t.unsubscribe()}onDestroy(t){t.unsubscribe()}}class Ph{createSubscription(t,e){return t.then(e,t=>{throw t})}dispose(t){}onDestroy(t){}}const Ih=new Ph,Mh=new Ah;let Dh=(()=>{class t{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,e=>this._updateLatestValue(t,e))}_selectStrategy(e){if(ha(e))return Ih;if(da(e))return Mh;throw function(t,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${ut(t)}'`)}(t,e)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,e){t===this._obj&&(this._latestValue=e,this._ref.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(ea(tc,16))},t.\u0275pipe=oe({name:"async",type:t,pure:!1}),t})(),Rh=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:ph,useClass:fh}]}),t})();const Nh="browser";function Lh(t){return t===Nh}class jh{}class Fh extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(t){qu||(qu=t)}(new Fh)}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getBaseHref(t){const e=(Vh=Vh||document.querySelector("base"),Vh?Vh.getAttribute("href"):null);return null==e?null:function(t){Bh=Bh||document.createElement("a"),Bh.setAttribute("href",t);const e=Bh.pathname;return"/"===e.charAt(0)?e:`/${e}`}(e)}resetBaseElement(){Vh=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return gh(document.cookie,t)}}let Bh,Vh=null;const zh=new oi("TRANSITION_ID"),Uh=[{provide:tu,useFactory:function(t,e,n){return()=>{n.get(eu).donePromise.then(()=>{const n=Xu(),i=e.querySelectorAll(`style[ng-transition="${t}"]`);for(let t=0;t{const i=t.findTestabilityInTree(e,n);if(null==i)throw new Error("Could not find testability for element.");return i},Ut.getAllAngularTestabilities=()=>t.getAllTestabilities(),Ut.getAllAngularRootElements=()=>t.getAllRootElements(),Ut.frameworkStabilizers||(Ut.frameworkStabilizers=[]),Ut.frameworkStabilizers.push(t=>{const e=Ut.getAllAngularTestabilities();let n=e.length,i=!1;const r=function(e){i=i||e,n--,0==n&&t(i)};e.forEach(function(t){t.whenStable(r)})})}findTestabilityInTree(t,e,n){if(null==e)return null;const i=t.getTestability(e);return null!=i?i:n?Xu().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}let $h=(()=>{class t{build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Gh=new oi("EventManagerPlugins");let Wh=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let i=0;i{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Yh=(()=>{class t extends Xh{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,e,n){t.forEach(t=>{const i=this._doc.createElement("style");i.textContent=t,n.push(e.appendChild(i))})}addHost(t){const e=[];this._addStylesToHost(this._stylesSet,t,e),this._hostNodes.set(t,e)}removeHost(t){const e=this._hostNodes.get(t);e&&e.forEach(Kh),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((e,n)=>{this._addStylesToHost(t,n,e)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(Kh))}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Kh(t){Xu().remove(t)}const Qh={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Zh=/%COMP%/g;function Jh(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let ed=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new nd(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case jt.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new id(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case jt.ShadowDom:return new rd(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=Jh(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(Ci(Wh),Ci(Yh),Ci(nu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class nd{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(Qh[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,i){if(i){e=i+":"+e;const r=Qh[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=Qh[n];i?t.removeAttributeNS(i,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&(Dr.DashCase|Dr.Important)?t.style.setProperty(e,n,i&Dr.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&Dr.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,td(n)):this.eventManager.addEventListener(t,e,td(n))}}class id extends nd{constructor(t,e,n,i){super(t),this.component=n;const r=Jh(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr=function(t){return"_ngcontent-%COMP%".replace(Zh,t)}(i+"-"+n.id),this.hostAttr=function(t){return"_nghost-%COMP%".replace(Zh,t)}(i+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class rd extends nd{constructor(t,e,n,i){super(t),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=Jh(i.id,i.styles,[]);for(let s=0;s{class t extends qh{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const od=["alt","control","meta","shift"],ad={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},ld={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},cd={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let ud=(()=>{class t extends qh{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,i){const r=t.parseEventName(n),s=t.eventCallback(r.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Xu().onAndCancel(e,r.domEventName,s))}static parseEventName(e){const n=e.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=t._normalizeKey(n.pop());let s="";if(od.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),s+=t+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&ld.hasOwnProperty(e)&&(e=ld[e]))}return ad[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),od.forEach(i=>{i!=n&&cd[i](t)&&(e+=i+".")}),e+=n,e}static eventCallback(e,n,i){return r=>{t.getEventFullKey(r)===e&&i.runGuarded(()=>n(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),hd=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return Ci(dd)},token:t,providedIn:"root"}),t})(),dd=(()=>{class t extends hd{constructor(t){super(),this._doc=t}sanitize(t,e){if(null==e)return null;switch(t){case yr.NONE:return e;case yr.HTML:return qi(e,"HTML")?Wi(e):mr(this._doc,String(e)).toString();case yr.STYLE:return qi(e,"Style")?Wi(e):e;case yr.SCRIPT:if(qi(e,"Script"))return Wi(e);throw new Error("unsafe value used in a script context");case yr.URL:return Xi(e),qi(e,"URL")?Wi(e):Ji(String(e));case yr.RESOURCE_URL:if(qi(e,"ResourceURL"))return Wi(e);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function(t){return new zi(t)}(t)}bypassSecurityTrustStyle(t){return function(t){return new Ui(t)}(t)}bypassSecurityTrustScript(t){return function(t){return new Hi(t)}(t)}bypassSecurityTrustUrl(t){return function(t){return new $i(t)}(t)}bypassSecurityTrustResourceUrl(t){return function(t){return new Gi(t)}(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return function(t){return new dd(t.get(Yu))}(Ci(_o))},token:t,providedIn:"root"}),t})();const pd=Fu($u,"browser",[{provide:ou,useValue:Nh},{provide:su,useValue:function(){Fh.makeCurrent(),Hh.init()},multi:!0},{provide:Yu,useFactory:function(){return function(t){Ce=t}(document),document},deps:[]}]),fd=[[],{provide:xo,useValue:"root"},{provide:kr,useFactory:function(){return new kr},deps:[]},{provide:Gh,useClass:sd,multi:!0,deps:[Yu,xu,ou]},{provide:Gh,useClass:ud,multi:!0,deps:[Yu]},[],{provide:ed,useClass:ed,deps:[Wh,Yh,nu]},{provide:Pl,useExisting:ed},{provide:Xh,useExisting:Yh},{provide:Yh,useClass:Yh,deps:[Yu]},{provide:Au,useClass:Au,deps:[xu]},{provide:Wh,useClass:Wh,deps:[Gh,xu]},{provide:jh,useClass:$h,deps:[]},[]];let gd=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:nu,useValue:e.appId},{provide:zh,useExisting:nu},Uh]}}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:fd,imports:[Rh,Wu]}),t})();function md(t){return null!=t&&"false"!=`${t}`}function bd(t,e=0){return function(t){return!isNaN(parseFloat(t))&&!isNaN(Number(t))}(t)?Number(t):e}function yd(t){return Array.isArray(t)?t:[t]}function vd(t){return null==t?"":"string"==typeof t?t:`${t}px`}function _d(t){return t instanceof kl?t.nativeElement:t}function wd(...t){let e=t[t.length-1];return M(e)?(t.pop(),z(t,e)):K(t)}function xd(t,e,n,i){return a(n)&&(i=n,n=void 0),i?xd(t,e,n).pipe(D(t=>d(t)?i(...t):i(t))):new C(i=>{Sd(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Sd(t,e,n,i,r){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const i=t;t.addEventListener(e,n,r),s=()=>i.removeEventListener(e,n,r)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const i=t;t.on(e,n),s=()=>i.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const i=t;t.addListener(e,n),s=()=>i.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let s=0,o=t.length;s{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class Td extends Od{constructor(t,e=Od.now){super(t,()=>Td.delegate&&Td.delegate!==this?Td.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return Td.delegate&&Td.delegate!==this?Td.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}new class extends Td{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,i=-1,r=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++i0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame(()=>t.flush(null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(cancelAnimationFrame(e),t.scheduled=void 0)}});let kd=1;const Ad=Promise.resolve(),Pd={};function Id(t){return t in Pd&&(delete Pd[t],!0)}const Md={setImmediate(t){const e=kd++;return Pd[e]=!0,Ad.then(()=>Id(e)&&t()),e},clearImmediate(t){Id(t)}};new class extends Td{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,i=-1,r=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++i0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=Md.setImmediate(t.flush.bind(t,null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(Md.clearImmediate(e),t.scheduled=void 0)}});function Dd(t){return!!t&&(t instanceof C||"function"==typeof t.lift&&"function"==typeof t.subscribe)}function Rd(t,e){return n=>n.lift(new Nd(t,e))}class Nd{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new Ld(t,this.compare,this.keySelector))}}class Ld extends v{constructor(t,e,n){super(t),this.keySelector=n,this.hasKey=!1,"function"==typeof e&&(this.compare=e)}compare(t,e){return t===e}_next(t){let e;try{const{keySelector:n}=this;e=n?n(t):t}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:t}=this;n=t(this.key,e)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))}}const jd=new Td(Cd);class Fd{constructor(t){this.durationSelector=t}call(t,e){return e.subscribe(new Bd(t,this.durationSelector))}}class Bd extends ${constructor(t,e){super(t),this.durationSelector=e,this.hasValue=!1}_next(t){if(this.value=t,this.hasValue=!0,!this.throttled){let n;try{const{durationSelector:e}=this;n=e(t)}catch(e){return this.destination.error(e)}const i=G(n,new H(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:t,hasValue:e,throttled:n}=this;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),e&&(this.value=void 0,this.hasValue=!1,this.destination.next(t))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function Vd(t){return!d(t)&&t-parseFloat(t)+1>=0}function zd(t){const{index:e,period:n,subscriber:i}=t;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}}function Ud(t,e=jd){return function(t){return function(e){return e.lift(new Fd(t))}}(()=>function(t=0,e,n){let i=-1;return Vd(e)?i=Number(e)<1?1:Number(e):M(e)&&(n=e),M(n)||(n=jd),new C(e=>{const r=Vd(t)?t:+t-n.now();return n.schedule(zd,r,{index:0,period:i,subscriber:e})})}(t,e))}function Hd(t,e){return function(n){return n.lift(new $d(t,e))}}class $d{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new Gd(t,this.predicate,this.thisArg))}}class Gd extends v{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}function Wd(t){return e=>e.lift(new qd(t))}class qd{constructor(t){this.notifier=t}call(t,e){const n=new Xd(t),i=G(this.notifier,new H(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class Xd extends ${constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Yd(...t){return Y(1)(wd(...t))}function Kd(...t){const e=t[t.length-1];return M(e)?(t.pop(),n=>Yd(t,n,e)):e=>Yd(t,e)}function Qd(t,e){return"function"==typeof e?n=>n.pipe(Qd((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new Zd(t))}class Zd{constructor(t){this.project=t}call(t,e){return e.subscribe(new Jd(t,this.project))}}class Jd extends ${constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e)}_innerSub(t){const e=this.innerSubscription;e&&e.unsubscribe();const n=new H(this),i=this.destination;i.add(n),this.innerSubscription=G(t,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:t}=this;(!t||t.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(t){this.destination.next(t)}}const tp=new class extends Td{}(class extends Cd{constructor(t,e){super(t,e),this.scheduler=t,this.work=e}schedule(t,e=0){return e>0?super.schedule(t,e):(this.delay=e,this.state=t,this.scheduler.flush(this),this)}execute(t,e){return e>0||this.closed?super.execute(t,e):this._execute(t,e)}requestAsyncId(t,e,n=0){return null!==n&&n>0||null===n&&this.delay>0?super.requestAsyncId(t,e,n):t.flush(this)}}),ep=new C(t=>t.complete());function np(t){return t?function(t){return new C(e=>t.schedule(()=>e.complete()))}(t):ep}function ip(t,e){return new C(e?n=>e.schedule(rp,0,{error:t,subscriber:n}):e=>e.error(t))}function rp({error:t,subscriber:e}){e.error(t)}class sp{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return wd(this.value);case"E":return ip(this.error);case"C":return np()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new sp("N",t):sp.undefinedValueNotification}static createError(t){return new sp("E",void 0,t)}static createComplete(){return sp.completeNotification}}sp.completeNotification=new sp("C"),sp.undefinedValueNotification=new sp("N",void 0);class op extends v{constructor(t,e,n=0){super(t),this.scheduler=e,this.delay=n}static dispatch(t){const{notification:e,destination:n}=t;e.observe(n),this.unsubscribe()}scheduleMessage(t){this.destination.add(this.scheduler.schedule(op.dispatch,this.delay,new ap(t,this.destination)))}_next(t){this.scheduleMessage(sp.createNext(t))}_error(t){this.scheduleMessage(sp.createError(t)),this.unsubscribe()}_complete(){this.scheduleMessage(sp.createComplete()),this.unsubscribe()}}class ap{constructor(t,e){this.notification=t,this.destination=e}}class lp extends P{constructor(t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n){super(),this.scheduler=n,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=t<1?1:t,this._windowTime=e<1?1:e,e===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(t){if(!this.isStopped){const e=this._events;e.push(t),e.length>this._bufferSize&&e.shift()}super.next(t)}nextTimeWindow(t){this.isStopped||(this._events.push(new cp(this._getNow(),t)),this._trimBufferThenGetEvents()),super.next(t)}_subscribe(t){const e=this._infiniteTimeWindow,n=e?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,r=n.length;let s;if(this.closed)throw new T;if(this.isStopped||this.hasError?s=g.EMPTY:(this.observers.push(t),s=new k(this,t)),i&&t.add(t=new op(t,i)),e)for(let o=0;oe&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i}}class cp{constructor(t,e){this.time=t,this.value=e}}function up(t,e,n){let i;return i=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},t=>t.lift(function({bufferSize:t=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:n,scheduler:i}){let r,s,o=0,a=!1,l=!1;return function(c){let u;o++,!r||a?(a=!1,r=new lp(t,e,i),u=r.subscribe(this),s=c.subscribe({next(t){r.next(t)},error(t){a=!0,r.error(t)},complete(){l=!0,s=void 0,r.complete()}}),l&&(s=void 0)):u=r.subscribe(this),this.add(()=>{o--,u.unsubscribe(),u=void 0,s&&!l&&n&&0===o&&(s.unsubscribe(),s=void 0,r=void 0)})}}(i))}let hp;try{hp="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(m){hp=!1}let dp,pp=(()=>{class t{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Lh(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!hp)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return t.\u0275fac=function(e){return new(e||t)(Ci(ou))},t.\u0275prov=xt({factory:function(){return new t(Ci(ou))},token:t,providedIn:"root"}),t})(),fp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const gp=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function mp(){if(dp)return dp;if("object"!=typeof document||!document)return dp=new Set(gp),dp;let t=document.createElement("input");return dp=new Set(gp.filter(e=>(t.setAttribute("type",e),t.type===e))),dp}let bp,yp,vp;function _p(t){return function(){if(null==bp&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>bp=!0}))}finally{bp=bp||!1}return bp}()?t:!!t.capture}function wp(){if(null==yp){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return yp=!1,yp;if("scrollBehavior"in document.documentElement.style)yp=!0;else{const t=Element.prototype.scrollTo;yp=!!t&&!/\{\s*\[native code\]\s*\}/.test(t.toString())}}return yp}function xp(t){if(function(){if(null==vp){const t="undefined"!=typeof document?document.head:null;vp=!(!t||!t.createShadowRoot&&!t.attachShadow)}return vp}()){const e=t.getRootNode?t.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}function Sp(){let t="undefined"!=typeof document&&document?document.activeElement:null;for(;t&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}function Ep(t){return t.composedPath?t.composedPath()[0]:t.target}const Cp=new oi("cdk-dir-doc",{providedIn:"root",factory:function(){return Oi(Yu)}});let Op=(()=>{class t{constructor(t){if(this.value="ltr",this.change=new Rc,t){const e=t.documentElement?t.documentElement.dir:null,n=(t.body?t.body.dir:null)||e;this.value="ltr"===n||"rtl"===n?n:"ltr"}}ngOnDestroy(){this.change.complete()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Cp,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(Cp,8))},token:t,providedIn:"root"}),t})(),Tp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class kp{constructor(t=!1,e,n=!0){this._multiple=t,this._emitChanges=n,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new P,e&&e.length&&(t?e.forEach(t=>this._markSelected(t)):this._markSelected(e[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...t){this._verifyValueAssignment(t),t.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...t){this._verifyValueAssignment(t),t.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(t){this.isSelected(t)?this.deselect(t):this.select(t)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(t){return this._selection.has(t)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){this.isSelected(t)||(this._multiple||this._unmarkAll(),this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){}}let Ap=(()=>{class t{constructor(){this._listeners=[]}notify(t,e){for(let n of this._listeners)n(t,e)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(e=>t!==e)}}ngOnDestroy(){this._listeners=[]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),Pp=(()=>{class t{constructor(t,e,n){this._ngZone=t,this._platform=e,this._scrolled=new P,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=n}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const e=this.scrollContainers.get(t);e&&(e.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new C(e=>{this._globalSubscription||this._addGlobalListener();const n=t>0?this._scrolled.pipe(Ud(t)).subscribe(e):this._scrolled.subscribe(e);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):wd()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,e)=>this.deregister(e)),this._scrolled.complete()}ancestorScrolled(t,e){const n=this.getAncestorScrollContainers(t);return this.scrolled(e).pipe(Hd(t=>!t||n.indexOf(t)>-1))}getAncestorScrollContainers(t){const e=[];return this.scrollContainers.forEach((n,i)=>{this._scrollableContainsElement(i,t)&&e.push(i)}),e}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,e){let n=_d(e),i=t.getElementRef().nativeElement;do{if(n==i)return!0}while(n=n.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>xd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(pp),Ci(Yu,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(xu),Ci(pp),Ci(Yu,8))},token:t,providedIn:"root"}),t})(),Ip=(()=>{class t{constructor(t,e,n){this._platform=t,this._change=new P,this._changeListener=t=>{this._change.next(t)},this._document=n,e.runOutsideAngular(()=>{if(t.isBrowser){const t=this._getWindow();t.addEventListener("resize",this._changeListener),t.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){const t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:e,height:n}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+n,right:t.left+e,height:n,width:e}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,e=this._getWindow(),n=t.documentElement,i=n.getBoundingClientRect();return{top:-i.top||t.body.scrollTop||e.scrollY||n.scrollTop||0,left:-i.left||t.body.scrollLeft||e.scrollX||n.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(Ud(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu),Ci(Yu,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu),Ci(Yu,8))},token:t,providedIn:"root"}),t})(),Mp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),Dp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Tp,fp,Mp],Tp,Mp]}),t})();class Rp{attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;null!=t&&(this._attachedHost=null,t.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class Np extends Rp{constructor(t,e,n,i){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.componentFactoryResolver=i}}class Lp extends Rp{constructor(t,e,n){super(),this.templateRef=t,this.viewContainerRef=e,this.context=n}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}}class jp extends Rp{constructor(t){super(),this.element=t instanceof kl?t.nativeElement:t}}class Fp{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){return t instanceof Np?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof Lp?(this._attachedPortal=t,this.attachTemplatePortal(t)):this.attachDomPortal&&t instanceof jp?(this._attachedPortal=t,this.attachDomPortal(t)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class Bp extends Fp{constructor(t,e,n,i,r){super(),this.outletElement=t,this._componentFactoryResolver=e,this._appRef=n,this._defaultInjector=i,this.attachDomPortal=t=>{const e=t.element,n=this._document.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=r}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let n;return t.viewContainerRef?(n=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector),this.setDisposeFn(()=>n.destroy())):(n=e.create(t.injector||this._defaultInjector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(n)),this._attachedPortal=t,n}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context);return n.rootNodes.forEach(t=>this.outletElement.appendChild(t)),n.detectChanges(),this.setDisposeFn(()=>{let t=e.indexOf(n);-1!==t&&e.remove(t)}),this._attachedPortal=t,n}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let Vp=(()=>{class t extends Lp{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(ea(sc),ea(hc))},t.\u0275dir=se({type:t,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[jo]}),t})(),zp=(()=>{class t extends Vp{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","cdk-portal",""],["","portal",""]],exportAs:["cdkPortal"],features:[_l([{provide:Vp,useExisting:t}]),jo]}),t})(),Up=(()=>{class t extends Fp{constructor(t,e,n){super(),this._componentFactoryResolver=t,this._viewContainerRef=e,this._isInitialized=!1,this.attached=new Rc,this.attachDomPortal=t=>{const e=t.element,n=this._document.createComment("dom-portal");t.setAttachedHost(this),e.parentNode.insertBefore(n,e),this._getRootNode().appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=n}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedPortal=null,this._attachedRef=null}attachComponentPortal(t){t.setAttachedHost(this);const e=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,n=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),i=e.createComponent(n,e.length,t.injector||e.injector);return e!==this._viewContainerRef&&this._getRootNode().appendChild(i.hostView.rootNodes[0]),super.setDisposeFn(()=>i.destroy()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}attachTemplatePortal(t){t.setAttachedHost(this);const e=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=e,this.attached.emit(e),e}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return t.\u0275fac=function(e){return new(e||t)(ea(El),ea(hc),ea(Yu))},t.\u0275dir=se({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[jo]}),t})(),Hp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const $p=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})();function Gp(t){return e=>0===t?np():e.lift(new Wp(t))}class Wp{constructor(t){if(this.total=t,this.total<0)throw new $p}call(t,e){return e.subscribe(new qp(t,this.total))}}class qp extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}function Xp(t,e=!1){return n=>n.lift(new Yp(t,e))}class Yp{constructor(t,e){this.predicate=t,this.inclusive=e}call(t,e){return e.subscribe(new Kp(t,this.predicate,this.inclusive))}}class Kp extends v{constructor(t,e,n){super(t),this.predicate=e,this.inclusive=n,this.index=0}_next(t){const e=this.destination;let n;try{n=this.predicate(t,this.index++)}catch(i){return void e.error(i)}this.nextOrComplete(t,n)}nextOrComplete(t,e){const n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())}}function Qp(t,...e){return e.length?e.some(e=>t[e]):t.altKey||t.shiftKey||t.ctrlKey||t.metaKey}const Zp=wp();class Jp{constructor(t,e){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=e}attach(){}enable(){if(this._canBeEnabled()){const t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=vd(-this._previousScrollPosition.left),t.style.top=vd(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const t=this._document.documentElement,e=t.style,n=this._document.body.style,i=e.scrollBehavior||"",r=n.scrollBehavior||"";this._isEnabled=!1,e.left=this._previousHTMLStyles.left,e.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Zp&&(e.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Zp&&(e.scrollBehavior=i,n.scrollBehavior=r)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,e=this._viewportRuler.getViewportSize();return t.scrollHeight>e.height||t.scrollWidth>e.width}}class tf{constructor(t,e,n,i){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=n,this._config=i,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(t){this._overlayRef=t}enable(){if(this._scrollSubscription)return;const t=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class ef{enable(){}disable(){}attach(){}}function nf(t,e){return e.some(e=>t.bottome.bottom||t.righte.right)}function rf(t,e){return e.some(e=>t.tope.bottom||t.lefte.right)}class sf{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this._config=i,this._scrollSubscription=null}attach(t){this._overlayRef=t}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:e,height:n}=this._viewportRuler.getViewportSize();nf(t,[{width:e,height:n,bottom:n,right:e,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let of=(()=>{class t{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this.noop=()=>new ef,this.close=t=>new tf(this._scrollDispatcher,this._ngZone,this._viewportRuler,t),this.block=()=>new Jp(this._viewportRuler,this._document),this.reposition=t=>new sf(this._scrollDispatcher,this._viewportRuler,this._ngZone,t),this._document=i}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pp),Ci(Ip),Ci(xu),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Pp),Ci(Ip),Ci(xu),Ci(Yu))},token:t,providedIn:"root"}),t})();class af{constructor(t){if(this.scrollStrategy=new ef,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){const e=Object.keys(t);for(const n of e)void 0!==t[n]&&(this[n]=t[n])}}}class lf{constructor(t,e,n,i,r){this.offsetX=n,this.offsetY=i,this.panelClass=r,this.originX=t.originX,this.originY=t.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY}}class cf{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}}let uf=(()=>{class t{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),0===this._attachedOverlays.length&&this.detach()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})(),hf=(()=>{class t extends uf{constructor(t){super(t),this._keydownListener=t=>{const e=this._attachedOverlays;for(let n=e.length-1;n>-1;n--)if(e[n]._keydownEvents.observers.length>0){e[n]._keydownEvents.next(t);break}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})(),df=(()=>{class t extends uf{constructor(t,e){super(t),this._platform=e,this._cursorStyleIsSet=!1,this._clickListener=t=>{const e=Ep(t),n=this._attachedOverlays.slice();for(let i=n.length-1;i>-1;i--){const r=n[i];if(!(r._outsidePointerEvents.observers.length<1)&&r.hasAttached()){if(r.overlayElement.contains(e))break;r._outsidePointerEvents.next(t)}}}}add(t){if(super.add(t),!this._isAttached){const t=this._document.body;t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=t.style.cursor,t.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu),Ci(pp))},token:t,providedIn:"root"}),t})();const pf="undefined"!=typeof window?window:{},ff=void 0!==pf.__karma__&&!!pf.__karma__||void 0!==pf.jasmine&&!!pf.jasmine||void 0!==pf.jest&&!!pf.jest||void 0!==pf.Mocha&&!!pf.Mocha;let gf=(()=>{class t{constructor(t,e){this._platform=e,this._document=t}ngOnDestroy(){const t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||ff){const e=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let t=0;tthis._backdropClick.next(t),this._keydownEvents=new P,this._outsidePointerEvents=new P,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(t){let e=this._portalOutlet.attach(t);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(Gp(1)).subscribe(()=>{this.hasAttached()&&this.updatePosition()}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){const t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,t&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=Object.assign(Object.assign({},this._config),t),this._updateElementSize()}setDirection(t){this._config=Object.assign(Object.assign({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){const t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const t=this._pane.style;t.width=vd(this._config.width),t.height=vd(this._config.height),t.minWidth=vd(this._config.minWidth),t.minHeight=vd(this._config.minHeight),t.maxWidth=vd(this._config.maxWidth),t.maxHeight=vd(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){const t="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(t)})}):this._backdropElement.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let t=this._backdropElement;if(!t)return;let e,n=()=>{t&&(t.removeEventListener("click",this._backdropClickHandler),t.removeEventListener("transitionend",n),t.parentNode&&t.parentNode.removeChild(t)),this._backdropElement==t&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(t,this._config.backdropClass,!1),clearTimeout(e)};t.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{t.addEventListener("transitionend",n)}),t.style.pointerEvents="none",e=this._ngZone.runOutsideAngular(()=>setTimeout(n,500))}_toggleClasses(t,e,n){const i=t.classList;yd(e).forEach(t=>{t&&(n?i.add(t):i.remove(t))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const t=this._ngZone.onStable.pipe(Wd(Q(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._previousHostParent.removeChild(this._host)),t.unsubscribe())})})}_disposeScrollStrategy(){const t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())}}const bf="cdk-overlay-connected-position-bounding-box",yf=/([A-Za-z%]+)$/;class vf{constructor(t,e,n,i,r){this._viewportRuler=e,this._document=n,this._platform=i,this._overlayContainer=r,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new P,this._resizeSubscription=g.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}get positions(){return this._preferredPositions}attach(t){this._validatePositions(),t.hostElement.classList.add(bf),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();const t=this._originRect,e=this._overlayRect,n=this._viewportRect,i=[];let r;for(let s of this._preferredPositions){let o=this._getOriginPoint(t,s),a=this._getOverlayPoint(o,e,s),l=this._getOverlayFit(a,e,n,s);if(l.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(s,o);this._canFitWithFlexibleDimensions(l,a,n)?i.push({position:s,origin:o,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(o,s)}):(!r||r.overlayFit.visibleAreae&&(e=i,t=n)}return this._isPushed=!1,void this._applyPosition(t.position,t.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(r.position,r.originPoint);this._applyPosition(r.position,r.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&_f(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(bf),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();const t=this._lastPosition||this._preferredPositions[0],e=this._getOriginPoint(this._originRect,t);this._applyPosition(t,e)}}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e){let n,i;if("center"==e.originX)n=t.left+t.width/2;else{const i=this._isRtl()?t.right:t.left,r=this._isRtl()?t.left:t.right;n="start"==e.originX?i:r}return i="center"==e.originY?t.top+t.height/2:"top"==e.originY?t.top:t.bottom,{x:n,y:i}}_getOverlayPoint(t,e,n){let i,r;return i="center"==n.overlayX?-e.width/2:"start"===n.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,r="center"==n.overlayY?-e.height/2:"top"==n.overlayY?0:-e.height,{x:t.x+i,y:t.y+r}}_getOverlayFit(t,e,n,i){const r=xf(e);let{x:s,y:o}=t,a=this._getOffset(i,"x"),l=this._getOffset(i,"y");a&&(s+=a),l&&(o+=l);let c=0-o,u=o+r.height-n.height,h=this._subtractOverflows(r.width,0-s,s+r.width-n.width),d=this._subtractOverflows(r.height,c,u),p=h*d;return{visibleArea:p,isCompletelyWithinViewport:r.width*r.height===p,fitsInViewportVertically:d===r.height,fitsInViewportHorizontally:h==r.width}}_canFitWithFlexibleDimensions(t,e,n){if(this._hasFlexibleDimensions){const i=n.bottom-e.y,r=n.right-e.x,s=wf(this._overlayRef.getConfig().minHeight),o=wf(this._overlayRef.getConfig().minWidth),a=t.fitsInViewportHorizontally||null!=o&&o<=r;return(t.fitsInViewportVertically||null!=s&&s<=i)&&a}return!1}_pushOverlayOnScreen(t,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};const i=xf(e),r=this._viewportRect,s=Math.max(t.x+i.width-r.width,0),o=Math.max(t.y+i.height-r.height,0),a=Math.max(r.top-n.top-t.y,0),l=Math.max(r.left-n.left-t.x,0);let c=0,u=0;return c=i.width<=r.width?l||-s:t.xi&&!this._isInitialRender&&!this._growAfterOpen&&(s=t.y-i/2)}if("end"===e.overlayX&&!i||"start"===e.overlayX&&i)c=n.width-t.x+this._viewportMargin,a=t.x-this._viewportMargin;else if("start"===e.overlayX&&!i||"end"===e.overlayX&&i)l=t.x,a=n.right-t.x;else{const e=Math.min(n.right-t.x+n.left,t.x),i=this._lastBoundingBoxSize.width;a=2*e,l=t.x-e,a>i&&!this._isInitialRender&&!this._growAfterOpen&&(l=t.x-i/2)}return{top:s,left:l,bottom:o,right:c,width:a,height:r}}_setBoundingBoxStyles(t,e){const n=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));const i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{const t=this._overlayRef.getConfig().maxHeight,r=this._overlayRef.getConfig().maxWidth;i.height=vd(n.height),i.top=vd(n.top),i.bottom=vd(n.bottom),i.width=vd(n.width),i.left=vd(n.left),i.right=vd(n.right),i.alignItems="center"===e.overlayX?"center":"end"===e.overlayX?"flex-end":"flex-start",i.justifyContent="center"===e.overlayY?"center":"bottom"===e.overlayY?"flex-end":"flex-start",t&&(i.maxHeight=vd(t)),r&&(i.maxWidth=vd(r))}this._lastBoundingBoxSize=n,_f(this._boundingBox.style,i)}_resetBoundingBoxStyles(){_f(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){_f(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){const n={},i=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(i){const i=this._viewportRuler.getViewportScrollPosition();_f(n,this._getExactOverlayY(e,t,i)),_f(n,this._getExactOverlayX(e,t,i))}else n.position="static";let o="",a=this._getOffset(e,"x"),l=this._getOffset(e,"y");a&&(o+=`translateX(${a}px) `),l&&(o+=`translateY(${l}px)`),n.transform=o.trim(),s.maxHeight&&(i?n.maxHeight=vd(s.maxHeight):r&&(n.maxHeight="")),s.maxWidth&&(i?n.maxWidth=vd(s.maxWidth):r&&(n.maxWidth="")),_f(this._pane.style,n)}_getExactOverlayY(t,e,n){let i={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n));let s=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return r.y-=s,"bottom"===t.overlayY?i.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":i.top=vd(r.y),i}_getExactOverlayX(t,e,n){let i,r={left:"",right:""},s=this._getOverlayPoint(e,this._overlayRect,t);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,n)),i=this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left","right"===i?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=vd(s.x),r}_getScrollVisibility(){const t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(t=>t.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:rf(t,n),isOriginOutsideView:nf(t,n),isOverlayClipped:rf(e,n),isOverlayOutsideView:nf(e,n)}}_subtractOverflows(t,...e){return e.reduce((t,e)=>t-Math.max(e,0),t)}_getNarrowedViewportRect(){const t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+t-this._viewportMargin,bottom:n.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return"x"===e?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&yd(t).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){const t=this._origin;if(t instanceof kl)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();const e=t.width||0,n=t.height||0;return{top:t.y,bottom:t.y+n,left:t.x,right:t.x+e,height:n,width:e}}}function _f(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function wf(t){if("number"!=typeof t&&null!=t){const[e,n]=t.split(yf);return n&&"px"!==n?null:parseFloat(e)}return t||null}function xf(t){return{top:Math.floor(t.top),right:Math.floor(t.right),bottom:Math.floor(t.bottom),left:Math.floor(t.left),width:Math.floor(t.width),height:Math.floor(t.height)}}class Sf{constructor(t,e,n,i,r,s,o){this._preferredPositions=[],this._positionStrategy=new vf(n,i,r,s,o).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(t,e),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(t){this._overlayRef=t,this._positionStrategy.attach(t),this._direction&&(t.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(t){this._positionStrategy.withScrollableContainers(t)}withFallbackPosition(t,e,n,i){const r=new lf(t,e,n,i);return this._preferredPositions.push(r),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(t){return this._overlayRef?this._overlayRef.setDirection(t):this._direction=t,this}withOffsetX(t){return this._positionStrategy.withDefaultOffsetX(t),this}withOffsetY(t){return this._positionStrategy.withDefaultOffsetY(t),this}withLockedPosition(t){return this._positionStrategy.withLockedPosition(t),this}withPositions(t){return this._preferredPositions=t.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(t){return this._positionStrategy.setOrigin(t),this}}const Ef="cdk-global-overlay-wrapper";class Cf{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(t){const e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(Ef),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._rightOffset="",this._leftOffset=t,this._justifyContent="flex-start",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._leftOffset="",this._rightOffset=t,this._justifyContent="flex-end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._justifyContent="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:i,height:r,maxWidth:s,maxHeight:o}=n,a=!("100%"!==i&&"100vw"!==i||s&&"100%"!==s&&"100vw"!==s),l=!("100%"!==r&&"100vh"!==r||o&&"100%"!==o&&"100vh"!==o);t.position=this._cssPosition,t.marginLeft=a?"0":this._leftOffset,t.marginTop=l?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=this._rightOffset,a?e.justifyContent="flex-start":"center"===this._justifyContent?e.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?e.justifyContent="flex-end":"flex-end"===this._justifyContent&&(e.justifyContent="flex-start"):e.justifyContent=this._justifyContent,e.alignItems=l?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(Ef),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}}let Of=(()=>{class t{constructor(t,e,n,i){this._viewportRuler=t,this._document=e,this._platform=n,this._overlayContainer=i}global(){return new Cf}connectedTo(t,e,n){return new Sf(e,n,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new vf(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ip),Ci(Yu),Ci(pp),Ci(gf))},t.\u0275prov=xt({factory:function(){return new t(Ci(Ip),Ci(Yu),Ci(pp),Ci(gf))},token:t,providedIn:"root"}),t})(),Tf=0,kf=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u){this.scrollStrategies=t,this._overlayContainer=e,this._componentFactoryResolver=n,this._positionBuilder=i,this._keyboardDispatcher=r,this._injector=s,this._ngZone=o,this._document=a,this._directionality=l,this._location=c,this._outsideClickDispatcher=u}create(t){const e=this._createHostElement(),n=this._createPaneElement(e),i=this._createPortalOutlet(n),r=new af(t);return r.direction=r.direction||this._directionality.value,new mf(i,e,n,r,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const e=this._document.createElement("div");return e.id="cdk-overlay-"+Tf++,e.classList.add("cdk-overlay-pane"),t.appendChild(e),e}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Uu)),new Bp(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return t.\u0275fac=function(e){return new(e||t)(Ci(of),Ci(gf),Ci(El),Ci(Of),Ci(hf),Ci(No),Ci(xu),Ci(Yu),Ci(Op),Ci(lh),Ci(df))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Af=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],Pf=new oi("cdk-connected-overlay-scroll-strategy");let If=(()=>{class t{constructor(t){this.elementRef=t}}return t.\u0275fac=function(e){return new(e||t)(ea(kl))},t.\u0275dir=se({type:t,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),t})(),Mf=(()=>{class t{constructor(t,e,n,i,r){this._overlay=t,this._dir=r,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=g.EMPTY,this._attachSubscription=g.EMPTY,this._detachSubscription=g.EMPTY,this._positionSubscription=g.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Rc,this.positionChange=new Rc,this.attach=new Rc,this.detach=new Rc,this.overlayKeydown=new Rc,this.overlayOutsideClick=new Rc,this._templatePortal=new Lp(e,n),this._scrollStrategyFactory=i,this.scrollStrategy=this._scrollStrategyFactory()}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}get hasBackdrop(){return this._hasBackdrop}set hasBackdrop(t){this._hasBackdrop=md(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=md(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=md(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=md(t)}get push(){return this._push}set push(t){this._push=md(t)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Af);const t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(t=>{this.overlayKeydown.next(t),27===t.keyCode&&!this.disableClose&&!Qp(t)&&(t.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(t=>{this.overlayOutsideClick.next(t)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),e=new af({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(e.width=this.width),(this.height||0===this.height)&&(e.height=this.height),(this.minWidth||0===this.minWidth)&&(e.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(e.minHeight=this.minHeight),this.backdropClass&&(e.backdropClass=this.backdropClass),this.panelClass&&(e.panelClass=this.panelClass),e}_updatePositionStrategy(t){const e=this.positions.map(t=>({originX:t.originX,originY:t.originY,overlayX:t.overlayX,overlayY:t.overlayY,offsetX:t.offsetX||this.offsetX,offsetY:t.offsetY||this.offsetY,panelClass:t.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(e).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const t=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(t),t}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(Xp(()=>this.positionChange.observers.length>0)).subscribe(t=>{this.positionChange.emit(t),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()}))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(sc),ea(hc),ea(Pf),ea(Op,8))},t.\u0275dir=se({type:t,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[ye]}),t})();const Df={provide:Pf,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};let Rf=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[kf,Df],imports:[[Tp,Hp,Dp],Dp]}),t})(),Nf=(()=>{class t extends gf{constructor(){super(...arguments),this.attached=!1}setRootElement(t){this.attached&&(this.rootElement.nativeElement.removeChild(this._containerElement),this.attached=!1),this.rootElement=t,this.rootElement.nativeElement.style.display="block",this.rootElement.nativeElement.style.position="contents",this.rootElement.nativeElement.style.height="100%",this.appendToRoot()}_createContainer(){super._createContainer(),this.appendToRoot()}appendToRoot(){!this._containerElement||!this.rootElement||(this.rootElement.nativeElement.appendChild(this._containerElement),this.attached=!0)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const Lf={schedule(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)},scheduleBeforeRender(t){if("undefined"==typeof window)return Lf.schedule(t,0);if(void 0===window.requestAnimationFrame)return Lf.schedule(t,16);const e=window.requestAnimationFrame(t);return()=>window.cancelAnimationFrame(e)}};let jf;function Ff(t,e,n){let i=n;return function(t){return!!t&&t.nodeType===Node.ELEMENT_NODE}(t)&&e.some((e,n)=>!("*"===e||!function(t,e){if(!jf){const t=Element.prototype;jf=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE&&jf.call(t,e)}(t,e)||(i=n,0))),i}class Bf{constructor(t,e){this.componentFactory=e.get(El).resolveComponentFactory(t)}create(t){return new Vf(this.componentFactory,t)}}class Vf{constructor(t,e){this.componentFactory=t,this.injector=e,this.eventEmitters=new lp(1),this.events=this.eventEmitters.pipe(Qd(t=>Q(...t))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:t})=>t)),this.ngZone=this.injector.get(xu),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(t){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(t)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=Lf.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(t){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(t):this.componentRef.instance[t])}setInputValue(t,e){this.runInZone(()=>{null!==this.componentRef?function(t,e){return t===e||t!=t&&e!=e}(e,this.getInputValue(t))&&(void 0!==e||!this.unchangedInputs.has(t))||(this.recordInputChange(t,e),this.unchangedInputs.delete(t),this.hasInputChanges=!0,this.componentRef.instance[t]=e,this.scheduleDetectChanges()):this.initialInputValues.set(t,e)})}initializeComponent(t){const e=No.create({providers:[],parent:this.injector}),n=function(t,e){const n=t.childNodes,i=e.map(()=>[]);let r=-1;e.some((t,e)=>"*"===t&&(r=e,!0));for(let s=0,o=n.length;s{this.initialInputValues.has(t)&&this.setInputValue(t,this.initialInputValues.get(t))}),this.initialInputValues.clear()}initializeOutputs(t){const e=this.componentFactory.outputs.map(({propName:e,templateName:n})=>t.instance[e].pipe(D(t=>({name:n,value:t}))));this.eventEmitters.next(e)}callNgOnChanges(t){if(!this.implementsOnChanges||null===this.inputChanges)return;const e=this.inputChanges;this.inputChanges=null,t.instance.ngOnChanges(e)}markViewForCheck(t){this.hasInputChanges&&(this.hasInputChanges=!1,t.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=Lf.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(t,e){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const n=this.inputChanges[t];if(n)return void(n.currentValue=e);const i=this.unchangedInputs.has(t),r=i?void 0:this.getInputValue(t);this.inputChanges[t]=new be(r,e,i)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(t){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(t):t()}}class zf extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}class Uf extends P{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new T;return this._value}next(t){super.next(this._value=t)}}function Hf(){}function $f(t,e,n){return function(i){return i.lift(new Gf(t,e,n))}}class Gf{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new Wf(t,this.nextOrObserver,this.error,this.complete))}}class Wf extends v{constructor(t,e,n,i){super(t),this._tapNext=Hf,this._tapError=Hf,this._tapComplete=Hf,this._tapError=n||Hf,this._tapComplete=i||Hf,a(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||Hf,this._tapError=e.error||Hf,this._tapComplete=e.complete||Hf)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}function qf(t,e=jd){return n=>n.lift(new Xf(t,e))}class Xf{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new Yf(t,this.dueTime,this.scheduler))}}class Yf extends v{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Kf,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Kf(t){t.debouncedNext()}function Qf(t){return e=>e.lift(new Zf(t))}class Zf{constructor(t){this.total=t}call(t,e){return e.subscribe(new Jf(t,this.total))}}class Jf extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){++this.count>this.total&&this.destination.next(t)}}let tg=(()=>{class t{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),eg=(()=>{class t{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,e)=>this._cleanupObserver(e))}observe(t){const e=_d(t);return new C(t=>{const n=this._observeElement(e).subscribe(t);return()=>{n.unsubscribe(),this._unobserveElement(e)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const e=new P,n=this._mutationObserverFactory.create(t=>e.next(t));n&&n.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:n,stream:e,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:e,stream:n}=this._observedElements.get(t);e&&e.disconnect(),n.complete(),this._observedElements.delete(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(tg))},t.\u0275prov=xt({factory:function(){return new t(Ci(tg))},token:t,providedIn:"root"}),t})(),ng=(()=>{class t{constructor(t,e,n){this._contentObserver=t,this._elementRef=e,this._ngZone=n,this.event=new Rc,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=bd(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe(qf(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(eg),ea(kl),ea(xu))},t.\u0275dir=se({type:t,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),t})(),ig=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[tg]}),t})();function rg(t,e){return(t.getAttribute(e)||"").match(/\S+/g)||[]}const sg="cdk-describedby-message-container",og="cdk-describedby-message",ag="cdk-describedby-host";let lg=0;const cg=new Map;let ug=null,hg=(()=>{class t{constructor(t){this._document=t}describe(t,e,n){if(!this._canBeDescribed(t,e))return;const i=dg(e,n);"string"!=typeof e?(pg(e),cg.set(i,{messageElement:e,referenceCount:0})):cg.has(i)||this._createMessageElement(e,n),this._isElementDescribedByMessage(t,i)||this._addMessageReference(t,i)}removeDescription(t,e,n){if(!e||!this._isElementNode(t))return;const i=dg(e,n);if(this._isElementDescribedByMessage(t,i)&&this._removeMessageReference(t,i),"string"==typeof e){const t=cg.get(i);t&&0===t.referenceCount&&this._deleteMessageElement(i)}ug&&0===ug.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${ag}]`);for(let e=0;e0!=t.indexOf(og));t.setAttribute("aria-describedby",e.join(" "))}_addMessageReference(t,e){const n=cg.get(e);(function(t,e,n){const i=rg(t,e);i.some(t=>t.trim()==n.trim())||(i.push(n.trim()),t.setAttribute(e,i.join(" ")))})(t,"aria-describedby",n.messageElement.id),t.setAttribute(ag,""),n.referenceCount++}_removeMessageReference(t,e){const n=cg.get(e);n.referenceCount--,function(t,e,n){const i=rg(t,e).filter(t=>t!=n.trim());i.length?t.setAttribute(e,i.join(" ")):t.removeAttribute(e)}(t,"aria-describedby",n.messageElement.id),t.removeAttribute(ag)}_isElementDescribedByMessage(t,e){const n=rg(t,"aria-describedby"),i=cg.get(e),r=i&&i.messageElement.id;return!!r&&-1!=n.indexOf(r)}_canBeDescribed(t,e){if(!this._isElementNode(t))return!1;if(e&&"object"==typeof e)return!0;const n=null==e?"":`${e}`.trim(),i=t.getAttribute("aria-label");return!(!n||i&&i.trim()===n)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})();function dg(t,e){return"string"==typeof t?`${e||""}/${t}`:t}function pg(t){t.id||(t.id=`${og}-${lg++}`)}class fg extends class{constructor(t){this._items=t,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new P,this._typeaheadSubscription=g.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new P,this.change=new P,t instanceof Lc&&t.changes.subscribe(t=>{if(this._activeItem){const e=t.toArray().indexOf(this._activeItem);e>-1&&e!==this._activeItemIndex&&(this._activeItemIndex=e)}})}skipPredicate(t){return this._skipPredicateFn=t,this}withWrap(t=!0){return this._wrap=t,this}withVerticalOrientation(t=!0){return this._vertical=t,this}withHorizontalOrientation(t){return this._horizontal=t,this}withAllowedModifierKeys(t){return this._allowedModifierKeys=t,this}withTypeAhead(t=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe($f(t=>this._pressedLetters.push(t)),qf(t),Hd(()=>this._pressedLetters.length>0),D(()=>this._pressedLetters.join(""))).subscribe(t=>{const e=this._getItemsArray();for(let n=1;n!t[e]||this._allowedModifierKeys.indexOf(e)>-1);switch(e){case 9:return void this.tabOut.next();case 40:if(this._vertical&&n){this.setNextItemActive();break}return;case 38:if(this._vertical&&n){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&n){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&n){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&n){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&n){this.setLastItemActive();break}return;default:return void((n||Qp(t,"shiftKey"))&&(t.key&&1===t.key.length?this._letterKeyStream.next(t.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))))}this._pressedLetters=[],t.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem}isTyping(){return this._pressedLetters.length>0}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._items.length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(t){const e=this._getItemsArray(),n="number"==typeof t?t:e.indexOf(t),i=e[n];this._activeItem=null==i?null:i,this._activeItemIndex=n}_setActiveItemByDelta(t){this._wrap?this._setActiveInWrapMode(t):this._setActiveInDefaultMode(t)}_setActiveInWrapMode(t){const e=this._getItemsArray();for(let n=1;n<=e.length;n++){const i=(this._activeItemIndex+t*n+e.length)%e.length;if(!this._skipPredicateFn(e[i]))return void this.setActiveItem(i)}}_setActiveInDefaultMode(t){this._setActiveItemByIndex(this._activeItemIndex+t,t)}_setActiveItemByIndex(t,e){const n=this._getItemsArray();if(n[t]){for(;this._skipPredicateFn(n[t]);)if(!n[t+=e])return;this.setActiveItem(t)}}_getItemsArray(){return this._items instanceof Lc?this._items.toArray():this._items}}{setActiveItem(t){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(t),this.activeItem&&this.activeItem.setActiveStyles()}}let gg=(()=>{class t{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(t){return!!(t.offsetWidth||t.offsetHeight||"function"==typeof t.getClientRects&&t.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const e=function(t){try{return t.frameElement}catch(e){return null}}(function(t){return t.ownerDocument&&t.ownerDocument.defaultView||window}(t));if(e&&(-1===bg(e)||!this.isVisible(e)))return!1;let n=t.nodeName.toLowerCase(),i=bg(t);return t.hasAttribute("contenteditable")?-1!==i:!("iframe"===n||"object"===n||this._platform.WEBKIT&&this._platform.IOS&&!function(t){let e=t.nodeName.toLowerCase(),n="input"===e&&t.type;return"text"===n||"password"===n||"select"===e||"textarea"===e}(t))&&("audio"===n?!!t.hasAttribute("controls")&&-1!==i:"video"===n?-1!==i&&(null!==i||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,e){return function(t){return!function(t){return function(t){return"input"==t.nodeName.toLowerCase()}(t)&&"hidden"==t.type}(t)&&(function(t){let e=t.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(t)||function(t){return function(t){return"a"==t.nodeName.toLowerCase()}(t)&&t.hasAttribute("href")}(t)||t.hasAttribute("contenteditable")||mg(t))}(t)&&!this.isDisabled(t)&&((null==e?void 0:e.ignoreVisibility)||this.isVisible(t))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp))},token:t,providedIn:"root"}),t})();function mg(t){if(!t.hasAttribute("tabindex")||void 0===t.tabIndex)return!1;let e=t.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function bg(t){if(!mg(t))return null;const e=parseInt(t.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class yg{constructor(t,e,n,i,r=!1){this._element=t,this._checker=e,this._ngZone=n,this._document=i,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,r||this.attachAnchors()}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}destroy(){const t=this._startAnchor,e=this._endAnchor;t&&(t.removeEventListener("focus",this.startAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),e&&(e.removeEventListener("focus",this.endAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusInitialElement(t)))})}focusFirstTabbableElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusFirstTabbableElement(t)))})}focusLastTabbableElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusLastTabbableElement(t)))})}_getRegionBoundary(t){let e=this._element.querySelectorAll(`[cdk-focus-region-${t}], [cdkFocusRegion${t}], [cdk-focus-${t}]`);for(let n=0;n=0;n--){let t=e[n].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(e[n]):null;if(t)return t}return null}_createAnchor(){const t=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,t),t.classList.add("cdk-visually-hidden"),t.classList.add("cdk-focus-trap-anchor"),t.setAttribute("aria-hidden","true"),t}_toggleAnchorTabIndex(t,e){t?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}toggleAnchors(t){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}_executeOnStable(t){this._ngZone.isStable?t():this._ngZone.onStable.pipe(Gp(1)).subscribe(t)}}let vg=(()=>{class t{constructor(t,e,n){this._checker=t,this._ngZone=e,this._document=n}create(t,e=!1){return new yg(t,this._checker,this._ngZone,this._document,e)}}return t.\u0275fac=function(e){return new(e||t)(Ci(gg),Ci(xu),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(gg),Ci(xu),Ci(Yu))},token:t,providedIn:"root"}),t})();function _g(t){return 0===t.offsetX&&0===t.offsetY}function wg(t){const e=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const xg=new oi("cdk-input-modality-detector-options"),Sg={ignoreKeys:[18,17,224,91,16]},Eg=_p({passive:!0,capture:!0});let Cg=(()=>{class t{constructor(t,e,n,i){this._platform=t,this._mostRecentTarget=null,this._modality=new Uf(null),this._lastTouchMs=0,this._onKeydown=t=>{var e,n;(null===(n=null===(e=this._options)||void 0===e?void 0:e.ignoreKeys)||void 0===n?void 0:n.some(e=>e===t.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Ep(t))},this._onMousedown=t=>{Date.now()-this._lastTouchMs<650||(this._modality.next(_g(t)?"keyboard":"mouse"),this._mostRecentTarget=Ep(t))},this._onTouchstart=t=>{wg(t)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Ep(t))},this._options=Object.assign(Object.assign({},Sg),i),this.modalityDetected=this._modality.pipe(Qf(1)),this.modalityChanged=this.modalityDetected.pipe(Rd()),t.isBrowser&&e.runOutsideAngular(()=>{n.addEventListener("keydown",this._onKeydown,Eg),n.addEventListener("mousedown",this._onMousedown,Eg),n.addEventListener("touchstart",this._onTouchstart,Eg)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Eg),document.removeEventListener("mousedown",this._onMousedown,Eg),document.removeEventListener("touchstart",this._onTouchstart,Eg))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu),Ci(Yu),Ci(xg,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu),Ci(Yu),Ci(xg,8))},token:t,providedIn:"root"}),t})();const Og=new oi("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),Tg=new oi("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let kg=(()=>{class t{constructor(t,e,n,i){this._ngZone=e,this._defaultOptions=i,this._document=n,this._liveElement=t||this._createLiveElement()}announce(t,...e){const n=this._defaultOptions;let i,r;return 1===e.length&&"number"==typeof e[0]?r=e[0]:[i,r]=e,this.clear(),clearTimeout(this._previousTimeout),i||(i=n&&n.politeness?n.politeness:"polite"),null==r&&n&&(r=n.duration),this._liveElement.setAttribute("aria-live",i),this._ngZone.runOutsideAngular(()=>new Promise(e=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,e(),"number"==typeof r&&(this._previousTimeout=setTimeout(()=>this.clear(),r))},100)}))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement&&this._liveElement.parentNode&&(this._liveElement.parentNode.removeChild(this._liveElement),this._liveElement=null)}_createLiveElement(){const t="cdk-live-announcer-element",e=this._document.getElementsByClassName(t),n=this._document.createElement("div");for(let i=0;i{class t{constructor(t,e,n,i,r){this._ngZone=t,this._platform=e,this._inputModalityDetector=n,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new P,this._rootNodeFocusAndBlurListener=t=>{const e=Ep(t),n="focus"===t.type?this._onFocus:this._onBlur;for(let i=e;i;i=i.parentElement)n.call(this,t,i)},this._document=i,this._detectionMode=(null==r?void 0:r.detectionMode)||0}monitor(t,e=!1){const n=_d(t);if(!this._platform.isBrowser||1!==n.nodeType)return wd(null);const i=xp(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return e&&(r.checkChildren=!0),r.subject;const s={checkChildren:e,subject:new P,rootNode:i};return this._elementInfo.set(n,s),this._registerGlobalListeners(s),s.subject}stopMonitoring(t){const e=_d(t),n=this._elementInfo.get(e);n&&(n.subject.complete(),this._setClasses(e),this._elementInfo.delete(e),this._removeGlobalListeners(n))}focusVia(t,e,n){const i=_d(t);i===this._getDocument().activeElement?this._getClosestElementsInfo(i).forEach(([t,n])=>this._originChanged(t,e,n)):(this._setOrigin(e),"function"==typeof i.focus&&i.focus(n))}ngOnDestroy(){this._elementInfo.forEach((t,e)=>this.stopMonitoring(e))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,e,n){n?t.classList.add(e):t.classList.remove(e)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,e){this._toggleClass(t,"cdk-focused",!!e),this._toggleClass(t,"cdk-touch-focused","touch"===e),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===e),this._toggleClass(t,"cdk-mouse-focused","mouse"===e),this._toggleClass(t,"cdk-program-focused","program"===e)}_setOrigin(t,e=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&e,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,e){const n=this._elementInfo.get(e),i=Ep(t);!n||!n.checkChildren&&e!==i||this._originChanged(e,this._getFocusOrigin(i),n)}_onBlur(t,e){const n=this._elementInfo.get(e);!n||n.checkChildren&&t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||(this._setClasses(e),this._emitOrigin(n.subject,null))}_emitOrigin(t,e){this._ngZone.run(()=>t.next(e))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const e=t.rootNode,n=this._rootNodeFocusListenerCount.get(e)||0;n||this._ngZone.runOutsideAngular(()=>{e.addEventListener("focus",this._rootNodeFocusAndBlurListener,Pg),e.addEventListener("blur",this._rootNodeFocusAndBlurListener,Pg)}),this._rootNodeFocusListenerCount.set(e,n+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(Wd(this._stopInputModalityDetector)).subscribe(t=>{this._setOrigin(t,!0)}))}_removeGlobalListeners(t){const e=t.rootNode;if(this._rootNodeFocusListenerCount.has(e)){const t=this._rootNodeFocusListenerCount.get(e);t>1?this._rootNodeFocusListenerCount.set(e,t-1):(e.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Pg),e.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Pg),this._rootNodeFocusListenerCount.delete(e))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,e,n){this._setClasses(t,e),this._emitOrigin(n.subject,e),this._lastFocusOrigin=e}_getClosestElementsInfo(t){const e=[];return this._elementInfo.forEach((n,i)=>{(i===t||n.checkChildren&&i.contains(t))&&e.push([i,n])}),e}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(pp),Ci(Cg),Ci(Yu,8),Ci(Ag,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(xu),Ci(pp),Ci(Cg),Ci(Yu,8),Ci(Ag,8))},token:t,providedIn:"root"}),t})();const Mg="cdk-high-contrast-black-on-white",Dg="cdk-high-contrast-white-on-black",Rg="cdk-high-contrast-active";let Ng=(()=>{class t{constructor(t,e){this._platform=t,this._document=e}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const e=this._document.defaultView||window,n=e&&e.getComputedStyle?e.getComputedStyle(t):null,i=(n&&n.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),i){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(Rg),t.remove(Mg),t.remove(Dg),this._hasCheckedHighContrastMode=!0;const e=this.getHighContrastMode();1===e?(t.add(Rg),t.add(Mg)):2===e&&(t.add(Rg),t.add(Dg))}}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(Yu))},token:t,providedIn:"root"}),t})(),Lg=(()=>{class t{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ng))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[fp,ig]]}),t})();const jg=new Rl("12.2.5");class Fg{}const Bg="*";function Vg(t,e){return{type:7,name:t,definitions:e,options:{}}}function zg(t,e=null){return{type:4,styles:e,timings:t}}function Ug(t,e=null){return{type:2,steps:t,options:e}}function Hg(t){return{type:6,styles:t,offset:null}}function $g(t,e,n){return{type:0,name:t,styles:e,options:n}}function Gg(t){return{type:5,steps:t}}function Wg(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function qg(t=null){return{type:9,options:t}}function Xg(t,e,n=null){return{type:11,selector:t,animation:e,options:n}}function Yg(t){Promise.resolve(null).then(t)}class Kg{constructor(t=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Yg(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Qg{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let e=0,n=0,i=0;const r=this.players.length;0==r?Yg(()=>this._onFinish()):this.players.forEach(t=>{t.onDone(()=>{++e==r&&this._onFinish()}),t.onDestroy(()=>{++n==r&&this._onDestroy()}),t.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((t,e)=>Math.max(t,e.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const e=t*this.totalTime;this.players.forEach(t=>{const n=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(n)})}getPosition(){const t=this.players.reduce((t,e)=>null===t||e.totalTime>t.totalTime?e:t,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}function Zg(){return"undefined"!=typeof window&&void 0!==window.document}function Jg(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function tm(t){switch(t.length){case 0:return new Kg;case 1:return t[0];default:return new Qg(t)}}function em(t,e,n,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(t=>{const n=t.offset,i=n==l,u=i&&c||{};Object.keys(t).forEach(n=>{let i=n,a=t[n];if("offset"!==n)switch(i=e.normalizePropertyName(i,o),a){case"!":a=r[n];break;case Bg:a=s[n];break;default:a=e.normalizeStyleValue(n,i,a,o)}u[i]=a}),i||a.push(u),c=u,l=n}),o.length){const t="\n - ";throw new Error(`Unable to animate due to the following errors:${t}${o.join(t)}`)}return a}function nm(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&im(n,"start",t)));break;case"done":t.onDone(()=>i(n&&im(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&im(n,"destroy",t)))}}function im(t,e,n){const i=n.totalTime,r=rm(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,null==i?t.totalTime:i,!!n.disabled),s=t._data;return null!=s&&(r._data=s),r}function rm(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function sm(t,e,n){let i;return t instanceof Map?(i=t.get(e),i||t.set(e,i=n)):(i=t[e],i||(i=t[e]=n)),i}function om(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let am=(t,e)=>!1,lm=(t,e)=>!1,cm=(t,e,n)=>[];const um=Jg();(um||"undefined"!=typeof Element)&&(am=Zg()?(t,e)=>{for(;e&&e!==document.documentElement;){if(e===t)return!0;e=e.parentNode||e.host}return!1}:(t,e)=>t.contains(e),lm=(()=>{if(um||Element.prototype.matches)return(t,e)=>t.matches(e);{const t=Element.prototype,e=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return e?(t,n)=>e.apply(t,[n]):lm}})(),cm=(t,e,n)=>{let i=[];if(n){const n=t.querySelectorAll(e);for(let t=0;t{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=t[n]}),e}let ym=(()=>{class t{validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new Kg(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class vm{}vm.NOOP=new ym;const _m="ng-enter",wm="ng-leave",xm="ng-trigger",Sm=".ng-trigger",Em="ng-animating",Cm=".ng-animating";function Om(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Tm(parseFloat(e[1]),e[2])}function Tm(t,e){switch(e){case"s":return 1e3*t;default:return t}}function km(t,e,n){return t.hasOwnProperty("duration")?t:function(t,e,n){let i,r=0,s="";if("string"==typeof t){const n=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return e.push(`The provided timing value "${t}" is invalid.`),{duration:0,delay:0,easing:""};i=Tm(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=Tm(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=t;if(!n){let n=!1,s=e.length;i<0&&(e.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(e.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&e.splice(s,0,`The provided timing value "${t}" is invalid.`)}return{duration:i,delay:r,easing:s}}(t,e,n)}function Am(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function Pm(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else Am(t,n);return n}function Im(t,e,n){return n?e+":"+n+";":""}function Mm(t){let e="";for(let n=0;n{const r=zm(i);n&&!n.hasOwnProperty(i)&&(n[i]=t.style[r]),t.style[r]=e[i]}),Jg()&&Mm(t))}function Rm(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=zm(e);t.style[n]=""}),Jg()&&Mm(t))}function Nm(t){return Array.isArray(t)?1==t.length?t[0]:Ug(t):t}const Lm=new RegExp("{{\\s*(.+?)\\s*}}","g");function jm(t){let e=[];if("string"==typeof t){let n;for(;n=Lm.exec(t);)e.push(n[1]);Lm.lastIndex=0}return e}function Fm(t,e,n){const i=t.toString(),r=i.replace(Lm,(t,i)=>{let r=e[i];return e.hasOwnProperty(i)||(n.push(`Please provide a value for the animation param ${i}`),r=""),r.toString()});return r==i?t:r}function Bm(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Vm=/-+([a-z0-9])/g;function zm(t){return t.replace(Vm,(...t)=>t[1].toUpperCase())}function Um(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Hm(t,e){return 0===t||0===e}function $m(t,e,n){const i=Object.keys(n);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(t=>{s.hasOwnProperty(t)||o.push(t),s[t]=n[t]}),o.length)for(var r=1;rfunction(t,e,n){if(":"==t[0]){const i=function(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,e)=>parseFloat(e)>parseFloat(t);case":decrement":return(t,e)=>parseFloat(e) *"}}(t,n);if("function"==typeof i)return void e.push(i);t=i}const i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${t}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(Km(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(Km(o,r))}(t,n,e)):n.push(t),n}const Xm=new Set(["true","1"]),Ym=new Set(["false","0"]);function Km(t,e){const n=Xm.has(t)||Ym.has(t),i=Xm.has(e)||Ym.has(e);return(r,s)=>{let o="*"==t||t==r,a="*"==e||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?Xm.has(t):Ym.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?Xm.has(e):Ym.has(e)),o&&a}}const Qm=new RegExp("s*:selfs*,?","g");function Zm(t,e,n){return new Jm(t).build(e,n)}class Jm{constructor(t){this._driver=t}build(t,e){const n=new tb(e);return this._resetContextStyleTimingState(n),Gm(this,Nm(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,i=e.depCount=0;const r=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(t=>{if(this._resetContextStyleTimingState(e),0==t.type){const n=t,i=n.name;i.toString().split(/\s*,\s*/).forEach(t=>{n.name=t,r.push(this.visitState(n,e))}),n.name=i}else if(1==t.type){const r=this.visitTransition(t,e);n+=r.queryCount,i+=r.depCount,s.push(r)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(t,e){const n=this.visitStyle(t.styles,e),i=t.options&&t.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(t=>{if(eb(t)){const e=t;Object.keys(e).forEach(t=>{jm(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Bm(r.values());e.errors.push(`state("${t.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:t.name,style:n,options:i?{params:i}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;const n=Gm(this,Nm(t.animation),e);return{type:1,matchers:qm(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:nb(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>Gm(this,t,e)),options:nb(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=Gm(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:nb(t.options)}}visitAnimate(t,e){const n=function(t,e){let n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return ib(km(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=ib(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||km(i,e),ib(n.duration,n.delay,n.easing)}(t.timings,e.errors);e.currentAnimateTimings=n;let i,r=t.styles?t.styles:Hg({});if(5==r.type)i=this.visitKeyframes(r,e);else{let r=t.styles,s=!1;if(!r){s=!0;const t={};n.easing&&(t.easing=n.easing),r=Hg(t)}e.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,e);o.isEmptyStep=s,i=o}return e.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(t,e){const n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){const n=[];Array.isArray(t.styles)?t.styles.forEach(t=>{"string"==typeof t?t==Bg?n.push(t):e.errors.push(`The provided style string value ${t} is not allowed.`):n.push(t)}):n.push(t.styles);let i=!1,r=null;return n.forEach(t=>{if(eb(t)){const e=t,n=e.easing;if(n&&(r=n,delete e.easing),!i)for(let t in e)if(e[t].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:t.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(t,e){const n=e.currentAnimateTimings;let i=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),t.styles.forEach(t=>{"string"!=typeof t&&Object.keys(t).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void e.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=e.collectedStyles[e.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(e.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),e.options&&function(t,e,n){const i=e.params||{},r=jm(t);r.length&&r.forEach(t=>{i.hasOwnProperty(t)||n.push(`Unable to resolve the local animation param ${t} in the given list of values`)})}(t[n],e.options,e.errors)})})}visitKeyframes(t,e){const n={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const l=t.steps.map(t=>{const n=this._makeStyleAst(t,e);let l=null!=n.offset?n.offset:function(t){if("string"==typeof t)return null;let e=null;if(Array.isArray(t))t.forEach(t=>{if(eb(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(eb(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}return e}(n.styles),c=0;return null!=l&&(i++,c=n.offset=l),o=o||c<0||c>1,s=s||c0&&i{const s=u>0?i==h?1:u*i:r[i],o=s*f;e.currentTime=d+p.delay+o,p.duration=o,this._validateStyleAst(t,e),t.offset=s,n.styles.push(t)}),n}visitReference(t,e){return{type:8,animation:Gm(this,Nm(t.animation),e),options:nb(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:nb(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:nb(t.options)}}visitQuery(t,e){const n=e.currentQuerySelector,i=t.options||{};e.queryCount++,e.currentQuery=t;const[r,s]=function(t){const e=!!t.split(/\s*,\s*/).find(t=>":self"==t);return e&&(t=t.replace(Qm,"")),[t=t.replace(/@\*/g,Sm).replace(/@\w+/g,t=>Sm+"-"+t.substr(1)).replace(/:animating/g,Cm),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,sm(e.collectedStyles,e.currentQuerySelector,{});const o=Gm(this,Nm(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:t.selector,options:nb(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const n="full"===t.timings?{duration:0,delay:0,easing:"full"}:km(t.timings,e.errors,!0);return{type:12,animation:Gm(this,Nm(t.animation),e),timings:n,options:null}}}class tb{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function eb(t){return!Array.isArray(t)&&"object"==typeof t}function nb(t){return t?(t=Am(t)).params&&(t.params=function(t){return t?Am(t):null}(t.params)):t={},t}function ib(t,e,n){return{duration:t,delay:e,easing:n}}function rb(t,e,n,i,r,s,o=null,a=!1){return{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class sb{constructor(){this._map=new Map}consume(t){let e=this._map.get(t);return e?this._map.delete(t):e=[],e}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const ob=new RegExp(":enter","g"),ab=new RegExp(":leave","g");function lb(t,e,n,i,r,s={},o={},a,l,c=[]){return(new cb).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class cb{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new sb;const u=new hb(t,e,l,i,r,c,[]);u.options=a,u.currentTimeline.setStyles([s],null,u.errors,a),Gm(this,n,u);const h=u.timelines.filter(t=>t.containsAnimation());if(h.length&&Object.keys(o).length){const t=h[h.length-1];t.allowOnlyTimelineStyles()||t.setStyles([o],null,u.errors,a)}return h.length?h.map(t=>t.buildKeyframes()):[rb(e,[],[],[],0,0,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){const n=e.subInstructions.consume(e.element);if(n){const i=e.createSubContext(t.options),r=e.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&e.transformIntoNewTimeline(s)}e.previousNode=t}visitAnimateRef(t,e){const n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_visitSubInstructions(t,e,n){let i=e.currentTimeline.currentTime;const r=null!=n.duration?Om(n.duration):null,s=null!=n.delay?Om(n.delay):null;return 0!==r&&t.forEach(t=>{const n=e.appendInstructionToTimeline(t,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(t,e){e.updateOptions(t.options,!0),Gm(this,t.animation,e),e.previousNode=t}visitSequence(t,e){const n=e.subContextCount;let i=e;const r=t.options;if(r&&(r.params||r.delay)&&(i=e.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=ub);const t=Om(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>Gm(this,t,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){const n=[];let i=e.currentTimeline.currentTime;const r=t.options&&t.options.delay?Om(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),Gm(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(t=>e.currentTimeline.mergeTimelineCollectedStyles(t)),e.transformIntoNewTimeline(i),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){const n=t.strValue;return km(e.params?Fm(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){const n=e.currentAnimateTimings=this._visitTiming(t.timings,e),i=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),i.snapshotCurrentStyles());const r=t.style;5==r.type?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){const n=e.currentTimeline,i=e.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(r):n.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){const n=e.currentAnimateTimings,i=e.currentTimeline.duration,r=n.duration,s=e.createSubContext().currentTimeline;s.easing=n.easing,t.styles.forEach(t=>{s.forwardTime((t.offset||0)*r),s.setStyles(t.styles,t.easing,e.errors,e.options),s.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(s),e.transformIntoNewTimeline(i+r),e.previousNode=t}visitQuery(t,e){const n=e.currentTimeline.currentTime,i=t.options||{},r=i.delay?Om(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=ub);let s=n;const o=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{e.currentQueryIndex=i;const o=e.createSubContext(t.options,n);r&&o.delayNextStep(r),n===e.element&&(a=o.currentTimeline),Gm(this,t.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),a&&(e.currentTimeline.mergeTimelineCollectedStyles(a),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){const n=e.parentContext,i=e.currentTimeline,r=t.timings,s=Math.abs(r.duration),o=s*(e.currentQueryTotal-1);let a=s*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const l=e.currentTimeline;a&&l.delayNextStep(a);const c=l.currentTime;Gm(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const ub={};class hb{constructor(t,e,n,i,r,s,o,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=ub,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new db(this._driver,e,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;const n=t;let i=this.options;null!=n.duration&&(i.duration=Om(n.duration)),null!=n.delay&&(i.delay=Om(n.delay));const r=n.params;if(r){let t=i.params;t||(t=this.options.params={}),Object.keys(r).forEach(n=>{(!e||!t.hasOwnProperty(n))&&(t[n]=Fm(r[n],t,this.errors))})}}_copyOptions(){const t={};if(this.options){const e=this.options.params;if(e){const n=t.params={};Object.keys(e).forEach(t=>{n[t]=e[t]})}}return t}createSubContext(t=null,e,n){const i=e||this.element,r=new hb(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=ub,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){const i={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},r=new pb(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,i,t.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,i,r,s){let o=[];if(i&&o.push(this.element),t.length>0){t=(t=t.replace(ob,"."+this._enterClassName)).replace(ab,"."+this._leaveClassName);let e=this._driver.query(this.element,t,1!=n);0!==n&&(e=n<0?e.slice(e.length+n,e.length):e.slice(0,n)),o.push(...e)}return!r&&0==o.length&&s.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),o}}class db{constructor(t,e,n,i){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new db(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||Bg,this._currentKeyframe[t]=Bg}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,i){e&&(this._previousKeyframe.easing=e);const r=i&&i.params||{},s=function(t,e){const n={};let i;return t.forEach(t=>{"*"===t?(i=i||Object.keys(e),i.forEach(t=>{n[t]=Bg})):Pm(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=Fm(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Bg),this._updateStyle(t,e)})}applyStylesToKeyframe(){const t=this._pendingStyles,e=Object.keys(t);0!=e.length&&(this._pendingStyles={},e.forEach(e=>{this._currentKeyframe[e]=t[e]}),Object.keys(this._localTimelineStyles).forEach(t=>{this._currentKeyframe.hasOwnProperty(t)||(this._currentKeyframe[t]=this._localTimelineStyles[t])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(t=>{const e=this._localTimelineStyles[t];this._pendingStyles[t]=e,this._updateStyle(t,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){Object.keys(t._styleSummary).forEach(e=>{const n=this._styleSummary[e],i=t._styleSummary[e];(!n||i.time>n.time)&&this._updateStyle(e,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,e=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=Pm(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Bg&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Bm(t.values()):[],s=e.size?Bm(e.values()):[];if(n){const t=i[0],e=Am(t);t.offset=0,e.offset=1,i=[t,e]}return rb(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class pb extends db{constructor(t,e,n,i,r,s,o=!1){super(t,e,s.delay),this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){const r=[],s=n+e,o=e/s,a=Pm(t[0],!1);a.offset=0,r.push(a);const l=Pm(t[0],!1);l.offset=fb(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=Pm(t[i],!1);o.offset=fb((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return rb(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function fb(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class gb{}class mb extends gb{normalizePropertyName(t,e){return zm(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(bb[e]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const e=n.match(/^[+-]?[\d\.]+([a-z]*)$/);e&&0==e[1].length&&i.push(`Please provide a CSS unit value for ${t}:${n}`)}return s+r}}const bb=(()=>function(t){const e={};return t.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function yb(t,e,n,i,r,s,o,a,l,c,u,h,d){return{type:0,element:t,triggerName:e,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:u,totalTime:h,errors:d}}const vb={};class _b{constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,i){return function(t,e,n,i,r){return t.some(t=>t(e,n,i,r))}(this.ast.matchers,t,e,n,i)}buildStyles(t,e,n){const i=this._stateStyles["*"],r=this._stateStyles[t],s=i?i.buildStyles(e,n):{};return r?r.buildStyles(e,n):s}build(t,e,n,i,r,s,o,a,l,c){const u=[],h=this.ast.options&&this.ast.options.params||vb,d=this.buildStyles(n,o&&o.params||vb,u),p=a&&a.params||vb,f=this.buildStyles(i,p,u),g=new Set,m=new Map,b=new Map,y="void"===i,v={params:Object.assign(Object.assign({},h),p)},_=c?[]:lb(t,e,this.ast.animation,r,s,d,f,v,l,u);let w=0;if(_.forEach(t=>{w=Math.max(t.duration+t.delay,w)}),u.length)return yb(e,this._triggerName,n,i,y,d,f,[],[],m,b,w,u);_.forEach(t=>{const n=t.element,i=sm(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=sm(b,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const x=Bm(g.values());return yb(e,this._triggerName,n,i,y,d,f,_,x,m,b,w)}}class wb{constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){const n={},i=Am(this.defaultParams);return Object.keys(t).forEach(e=>{const n=t[e];null!=n&&(i[e]=n)}),this.styles.styles.forEach(t=>{if("string"!=typeof t){const r=t;Object.keys(r).forEach(t=>{let s=r[t];s.length>1&&(s=Fm(s,i,e));const o=this.normalizer.normalizePropertyName(t,e);s=this.normalizer.normalizeStyleValue(t,o,s,e),n[o]=s})}}),n}}class xb{constructor(t,e,n){this.name=t,this.ast=e,this._normalizer=n,this.transitionFactories=[],this.states={},e.states.forEach(t=>{this.states[t.name]=new wb(t.style,t.options&&t.options.params||{},n)}),Sb(this.states,"true","1"),Sb(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new _b(t,e,this.states))}),this.fallbackTransition=function(t,e,n){return new _b(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[(t,e)=>!0],options:null,queryCount:0,depCount:0},e)}(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,i){return this.transitionFactories.find(r=>r.match(t,e,n,i))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}}function Sb(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const Eb=new sb;class Cb{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(t,e){const n=[],i=Zm(this._driver,e,n);if(n.length)throw new Error(`Unable to build the animation due to the following errors: ${n.join("\n")}`);this._animations[t]=i}_buildPlayer(t,e,n){const i=t.element,r=em(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(i,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){const i=[],r=this._animations[t];let s;const o=new Map;if(r?(s=lb(this._driver,e,r,_m,wm,{},{},n,Eb,i),s.forEach(t=>{const e=sm(o,t.element,{});t.postStyleProps.forEach(t=>e[t]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error(`Unable to create the animation due to the following errors: ${i.join("\n")}`);o.forEach((t,e)=>{Object.keys(t).forEach(n=>{t[n]=this._driver.computeStyle(e,n,Bg)})});const a=tm(s.map(t=>{const e=o.get(t.element);return this._buildPlayer(t,{},e)}));return this._playersById[t]=a,a.onDestroy(()=>this.destroy(t)),this.players.push(a),a}destroy(t){const e=this._getPlayer(t);e.destroy(),delete this._playersById[t];const n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){const e=this._playersById[t];if(!e)throw new Error(`Unable to find the timeline player referenced by ${t}`);return e}listen(t,e,n,i){const r=rm(e,"","","");return nm(this._getPlayer(t),n,r,i),()=>{}}command(t,e,n,i){if("register"==n)return void this.register(t,i[0]);if("create"==n)return void this.create(t,e,i[0]||{});const r=this._getPlayer(t);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(t)}}}const Ob="ng-animate-queued",Tb="ng-animate-disabled",kb=".ng-animate-disabled",Ab=[],Pb={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ib={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Mb="__ng_removed";class Db{constructor(t,e=""){this.namespaceId=e;const n=t&&t.hasOwnProperty("value");if(this.value=function(t){return null!=t?t:null}(n?t.value:t),n){const e=Am(t);delete e.value,this.options=e}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(t){const e=t.params;if(e){const t=this.options.params;Object.keys(e).forEach(n=>{null==t[n]&&(t[n]=e[n])})}}}const Rb="void",Nb=new Db(Rb);class Lb{constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,$b(e,this._hostClassName)}listen(t,e,n,i){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${e}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if(!function(t){return"start"==t||"done"==t}(n))throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${e}" is not supported!`);const r=sm(this._elementListeners,t,[]),s={name:e,phase:n,callback:i};r.push(s);const o=sm(this._engine.statesByElement,t,{});return o.hasOwnProperty(e)||($b(t,xm),$b(t,xm+"-"+e),o[e]=Nb),()=>{this._engine.afterFlush(()=>{const t=r.indexOf(s);t>=0&&r.splice(t,1),this._triggers[e]||delete o[e]})}}register(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)}_getTrigger(t){const e=this._triggers[t];if(!e)throw new Error(`The provided animation trigger "${t}" has not been registered!`);return e}trigger(t,e,n,i=!0){const r=this._getTrigger(e),s=new Fb(this.id,e,t);let o=this._engine.statesByElement.get(t);o||($b(t,xm),$b(t,xm+"-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new Db(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=Nb),l.value!==Rb&&a.value===l.value){if(!function(t,e){const n=Object.keys(t),i=Object.keys(e);if(n.length!=i.length)return!1;for(let r=0;r{Rm(t,n),Dm(t,i)})}return}const c=sm(this._engine.playersByElement,t,[]);c.forEach(t=>{t.namespaceId==this.id&&t.triggerName==e&&t.queued&&t.destroy()});let u=r.matchTransition(a.value,l.value,t,l.params),h=!1;if(!u){if(!i)return;u=r.fallbackTransition,h=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:u,fromState:a,toState:l,player:s,isFallbackTransition:h}),h||($b(t,Ob),s.onStart(()=>{Gb(t,Ob)})),s.onDone(()=>{let e=this.players.indexOf(s);e>=0&&this.players.splice(e,1);const n=this._engine.playersByElement.get(t);if(n){let t=n.indexOf(s);t>=0&&n.splice(t,1)}}),this.players.push(s),c.push(s),s}deregister(t){delete this._triggers[t],this._engine.statesByElement.forEach((e,n)=>{delete e[t]}),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(e=>e.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const e=this._engine.playersByElement.get(t);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){const n=this._engine.driver.query(t,Sm,!0);n.forEach(t=>{if(t[Mb])return;const n=this._engine.fetchNamespacesByElement(t);n.size?n.forEach(n=>n.triggerLeaveAnimation(t,e,!1,!0)):this.clearElementCache(t)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(t=>this.clearElementCache(t)))}triggerLeaveAnimation(t,e,n,i){const r=this._engine.statesByElement.get(t);if(r){const s=[];if(Object.keys(r).forEach(e=>{if(this._triggers[e]){const n=this.trigger(t,e,Rb,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&tm(s).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const e=this._elementListeners.get(t),n=this._engine.statesByElement.get(t);if(e&&n){const i=new Set;e.forEach(e=>{const r=e.name;if(i.has(r))return;i.add(r);const s=this._triggers[r].fallbackTransition,o=n[r]||Nb,a=new Db(Rb),l=new Fb(this.id,r,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:r,transition:s,fromState:o,toState:a,player:l,isFallbackTransition:!0})})}}removeNode(t,e){const n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let i=!1;if(n.totalAnimations){const e=n.players.length?n.playersByQueriedElement.get(t):[];if(e&&e.length)i=!0;else{let e=t;for(;e=e.parentNode;)if(n.statesByElement.get(e)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(t),i)n.markElementAsRemoved(this.id,t,!1,e);else{const i=t[Mb];(!i||i===Pb)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){$b(t,this._hostClassName)}drainQueuedTransitions(t){const e=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(e=>{if(e.name==n.triggerName){const i=rm(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,nm(n.player,e.phase,i,e.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(n)}),this._queue=[],e.sort((t,e)=>{const n=t.transition.ast.depCount,i=e.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(t.element,e.element)?1:-1})}destroy(t){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}elementContainsData(t){let e=!1;return this._elementListeners.has(t)&&(e=!0),e=!!this._queue.find(e=>e.element===t)||e,e}}class jb{constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(t,e)=>{}}_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}get queuedPlayers(){const t=[];return this._namespaceList.forEach(e=>{e.players.forEach(e=>{e.queued&&t.push(e)})}),t}createNamespace(t,e){const n=new Lb(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,e)){this._namespaceList.splice(r+1,0,t),i=!0;break}i||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let i=this._namespaceLookup[t];i&&i.register(e,n)&&this.totalAnimations++}destroy(t,e){if(!t)return;const n=this._fetchNamespace(t);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[t];const e=this._namespaceList.indexOf(n);e>=0&&this._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(()=>n.destroy(e))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const e=new Set,n=this.statesByElement.get(t);if(n){const t=Object.keys(n);for(let i=0;i=0&&this.collectedLeaveElements.splice(t,1)}if(t){const i=this._fetchNamespace(t);i&&i.insertNode(e,n)}i&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),$b(t,Tb)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Gb(t,Tb))}removeNode(t,e,n,i){if(Bb(e)){const r=t?this._fetchNamespace(t):null;if(r?r.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i),n){const n=this.namespacesByHostElement.get(e);n&&n.id!==t&&n.removeNode(e,i)}}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,n,i){this.collectedLeaveElements.push(e),e[Mb]={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return Bb(e)?this._fetchNamespace(t).listen(e,n,i,r):()=>{}}_buildInstruction(t,e,n,i,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,i,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,Sm,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,Cm,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(t){const e=this.playersByElement.get(t);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(t){const e=this.playersByQueriedElement.get(t);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return tm(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t[Mb];if(e&&e.setForRemoval){if(t[Mb]=Pb,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,kb)&&this.markElementAsDisabled(t,!1),this.driver.query(t,kb,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,e)=>this._balanceNamespaceList(t,e)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nt()),this._flushFns=[],this._whenQuietFns.length){const t=this._whenQuietFns;this._whenQuietFns=[],e.length?tm(e).onDone(()=>{t.forEach(t=>t())}):t.forEach(t=>t())}}reportError(t){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${t.join("\n")}`)}_flushAnimations(t,e){const n=new sb,i=[],r=new Map,s=[],o=new Map,a=new Map,l=new Map,c=new Set;this.disabledNodes.forEach(t=>{c.add(t);const e=this.driver.query(t,".ng-animate-queued",!0);for(let n=0;n{const n=_m+f++;p.set(e,n),t.forEach(t=>$b(t,n))});const g=[],m=new Set,b=new Set;for(let P=0;Pm.add(t)):b.add(t))}const y=new Map,v=Ub(h,Array.from(m));v.forEach((t,e)=>{const n=wm+f++;y.set(e,n),t.forEach(t=>$b(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>Gb(t,n))}),v.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>Gb(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const _=[],w=[];for(let P=this._namespaceList.length-1;P>=0;P--)this._namespaceList[P].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(_.push(e),this.collectedEnterElements.length){const t=r[Mb];if(t&&t.setForMove)return void e.destroy()}const c=!u||!this.driver.containsElement(u,r),h=y.get(r),d=p.get(r),f=this._buildInstruction(t,n,d,h,c);if(f.errors&&f.errors.length)w.push(f);else{if(c)return e.onStart(()=>Rm(r,f.fromStyles)),e.onDestroy(()=>Dm(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>Rm(r,f.fromStyles)),e.onDestroy(()=>Dm(r,f.toStyles)),void i.push(e);f.timelines.forEach(t=>t.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:e,element:r}),f.queriedElements.forEach(t=>sm(o,t,[]).push(e)),f.preStyleProps.forEach((t,e)=>{const n=Object.keys(t);if(n.length){let t=a.get(e);t||a.set(e,t=new Set),n.forEach(e=>t.add(e))}}),f.postStyleProps.forEach((t,e)=>{const n=Object.keys(t);let i=l.get(e);i||l.set(e,i=new Set),n.forEach(t=>i.add(t))})}});if(w.length){const t=[];w.forEach(e=>{t.push(`@${e.triggerName} has failed due to:\n`),e.errors.forEach(e=>t.push(`- ${e}\n`))}),_.forEach(t=>t.destroy()),this.reportError(t)}const x=new Map,S=new Map;s.forEach(t=>{const e=t.element;n.has(e)&&(S.set(e,e),this._beforeAnimationBuild(t.player.namespaceId,t.instruction,x))}),i.forEach(t=>{const e=t.element;this._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(t=>{sm(x,e,[]).push(t),t.destroy()})});const E=g.filter(t=>Xb(t,a,l)),C=new Map;zb(C,this.driver,b,l,Bg).forEach(t=>{Xb(t,a,l)&&E.push(t)});const O=new Map;d.forEach((t,e)=>{zb(O,this.driver,new Set(t),a,"!")}),E.forEach(t=>{const e=C.get(t),n=O.get(t);C.set(t,Object.assign(Object.assign({},e),n))});const T=[],k=[],A={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>Dm(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=A;if(S.size>1){let n=e;const i=[];for(;n=n.parentNode;){const e=S.get(n);if(e){t=e;break}i.push(n)}i.forEach(e=>S.set(e,t))}const n=this._buildAnimation(s.namespaceId,o,x,r,O,C);if(s.setRealPlayer(n),t===A)T.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=tm(e)),i.push(s)}}else Rm(e,o.fromStyles),s.onDestroy(()=>Dm(e,o.toStyles)),k.push(s),c.has(e)&&i.push(s)}),k.forEach(t=>{const e=r.get(t.element);if(e&&e.length){const n=tm(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let P=0;P!t.destroyed);i.length?Wb(this,t,i):this.processLeaveNode(t)}return g.length=0,T.forEach(t=>{this.players.push(t),t.onDone(()=>{t.destroy();const e=this.players.indexOf(t);this.players.splice(e,1)}),t.play()}),T}elementContainsData(t,e){let n=!1;const i=e[Mb];return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,i,r){let s=[];if(e){const e=this.playersByQueriedElement.get(t);e&&(s=e)}else{const e=this.playersByElement.get(t);if(e){const t=!r||r==Rb;e.forEach(e=>{e.queued||!t&&e.triggerName!=i||s.push(e)})}}return(n||i)&&(s=s.filter(t=>!(n&&n!=t.namespaceId||i&&i!=t.triggerName))),s}_beforeAnimationBuild(t,e,n){const i=e.element,r=e.isRemovalTransition?void 0:t,s=e.isRemovalTransition?void 0:e.triggerName;for(const o of e.timelines){const t=o.element,a=t!==i,l=sm(n,t,[]);this._getPreviousPlayers(t,a,r,s,e.toState).forEach(t=>{const e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),l.push(t)})}Rm(i,e.fromStyles)}_buildAnimation(t,e,n,i,r,s){const o=e.triggerName,a=e.element,l=[],c=new Set,u=new Set,h=e.timelines.map(e=>{const h=e.element;c.add(h);const d=h[Mb];if(d&&d.removedBeforeQueried)return new Kg(e.duration,e.delay);const p=h!==a,f=function(t){const e=[];return qb(t,e),e}((n.get(h)||Ab).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===h),g=r.get(h),m=s.get(h),b=em(0,this._normalizer,0,e.keyframes,g,m),y=this._buildPlayer(e,b,f);if(e.subTimeline&&i&&u.add(h),p){const e=new Fb(t,o,h);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{sm(this.playersByQueriedElement,t.element,[]).push(t),t.onDone(()=>function(t,e,n){let i;if(t instanceof Map){if(i=t.get(e),i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&t.delete(e)}}else if(i=t[e],i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&delete t[e]}return i}(this.playersByQueriedElement,t.element,t))}),c.forEach(t=>$b(t,Em));const d=tm(h);return d.onDestroy(()=>{c.forEach(t=>Gb(t,Em)),Dm(a,e.toStyles)}),u.forEach(t=>{sm(i,t,[]).push(d)}),d}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new Kg(t.duration,t.delay)}}class Fb{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new Kg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(n=>nm(t,e,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){sm(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const e=this._player;e.triggerCallback&&e.triggerCallback(t)}}function Bb(t){return t&&1===t.nodeType}function Vb(t,e){const n=t.style.display;return t.style.display=null!=e?e:"none",n}function zb(t,e,n,i,r){const s=[];n.forEach(t=>s.push(Vb(t)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(t=>{const n=s[t]=e.computeStyle(i,t,r);(!n||0==n.length)&&(i[Mb]=Ib,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Vb(t,s[a++])),o}function Ub(t,e){const n=new Map;if(t.forEach(t=>n.set(t,[])),0==e.length)return n;const i=new Set(e),r=new Map;function s(t){if(!t)return 1;let e=r.get(t);if(e)return e;const o=t.parentNode;return e=n.has(o)?o:i.has(o)?1:s(o),r.set(t,e),e}return e.forEach(t=>{const e=s(t);1!==e&&n.get(e).push(t)}),n}const Hb="$$classes";function $b(t,e){if(t.classList)t.classList.add(e);else{let n=t[Hb];n||(n=t[Hb]={}),n[e]=!0}}function Gb(t,e){if(t.classList)t.classList.remove(e);else{let n=t[Hb];n&&delete n[e]}}function Wb(t,e,n){tm(n).onDone(()=>t.processLeaveNode(e))}function qb(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class Yb{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new jb(t,e,n),this._timelineEngine=new Cb(t,e,n),this._transitionEngine.onRemovalComplete=(t,e)=>this.onRemovalComplete(t,e)}registerTrigger(t,e,n,i,r){const s=t+"-"+i;let o=this._triggerCache[s];if(!o){const t=[],e=Zm(this._driver,r,t);if(t.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${t.join("\n - ")}`);o=function(t,e,n){return new xb(t,e,n)}(i,e,this._normalizer),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(e,i,o)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,i){this._transitionEngine.insertNode(t,e,n,i)}onRemove(t,e,n,i){this._transitionEngine.removeNode(t,e,i||!1,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,i){if("@"==n.charAt(0)){const[t,r]=om(n);this._timelineEngine.command(t,e,r,i)}else this._transitionEngine.trigger(t,e,n,i)}listen(t,e,n,i,r){if("@"==n.charAt(0)){const[t,i]=om(n);return this._timelineEngine.listen(t,e,i,r)}return this._transitionEngine.listen(t,e,n,i,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function Kb(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=Zb(e[0]),e.length>1&&(i=Zb(e[e.length-1]))):e&&(n=Zb(e)),n||i?new Qb(t,n,i):null}class Qb{constructor(t,e,n){this._element=t,this._startStyles=e,this._endStyles=n,this._state=0;let i=Qb.initialStylesByElement.get(t);i||Qb.initialStylesByElement.set(t,i={}),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&Dm(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Dm(this._element,this._initialStyles),this._endStyles&&(Dm(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Qb.initialStylesByElement.delete(this._element),this._startStyles&&(Rm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Rm(this._element,this._endStyles),this._endStyles=null),Dm(this._element,this._initialStyles),this._state=3)}}function Zb(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){(function(t,e){const n=ly(t,"").trim();let i=0;n.length&&(function(t,e){let n=0;for(let i=0;i=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),oy(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=ly(t,"").split(","),i=sy(n,e);i>=0&&(n.splice(i,1),ay(t,"",n.join(",")))}(this._element,this._name))}}function iy(t,e,n){ay(t,"PlayState",n,ry(t,e))}function ry(t,e){const n=ly(t,"");return n.indexOf(",")>0?sy(n.split(","),e):sy([n],e)}function sy(t,e){for(let n=0;n=0)return n;return-1}function oy(t,e,n){n?t.removeEventListener(ey,e):t.addEventListener(ey,e)}function ay(t,e,n,i){const r=ty+e;if(null!=i){const e=t.style[r];if(e.length){const t=e.split(",");t[i]=n,n=t.join(",")}}t.style[r]=n}function ly(t,e){return t.style[ty+e]||""}class cy{constructor(t,e,n,i,r,s,o,a){this.element=t,this.keyframes=e,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(t=>t()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(t){this._styler.setPosition(t)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new ny(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}beforeDestroy(){this.init();const t={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(t[n]=e?this._finalStyles[n]:Wm(this.element,n))})}this.currentSnapshot=t}}class uy extends Kg{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=bm(e)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(t=>{this._startingStyles[t]=this.element.style[t]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(t=>this.element.style.setProperty(t,this._styles[t])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(t=>{const e=this._startingStyles[t];e?this.element.style.setProperty(t,e):this.element.style.removeProperty(t)}),this._startingStyles=null,super.destroy())}}class hy{constructor(){this._count=0}validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>bm(t));let i=`@keyframes ${e} {\n`,r="";n.forEach(t=>{r=" ";const e=parseFloat(t.offset);i+=`${r}${100*e}% {\n`,r+=" ",Object.keys(t).forEach(e=>{const n=t[e];switch(e){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${e}: ${n};\n`)}}),i+=`${r}}\n`}),i+="}\n";const s=document.createElement("style");return s.textContent=i,s}animate(t,e,n,i,r,s=[],o){const a=s.filter(t=>t instanceof cy),l={};Hm(n,i)&&a.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const c=function(t){let e={};return t&&(Array.isArray(t)?t:[t]).forEach(t=>{Object.keys(t).forEach(n=>{"offset"==n||"easing"==n||(e[n]=t[n])})}),e}(e=$m(t,e,l));if(0==n)return new uy(t,c);const u="gen_css_kf_"+this._count++,h=this.buildKeyframeElement(t,u,e);(function(t){var e;const n=null===(e=t.getRootNode)||void 0===e?void 0:e.call(t);return"undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot?n:document.head})(t).appendChild(h);const d=Kb(t,e),p=new cy(t,e,u,n,i,r,c,d);return p.onDestroy(()=>function(t){t.parentNode.removeChild(t)}(h)),p}}class dy{constructor(t,e,n,i){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(t,e,n){return t.animate(e,n)}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(e=>{"offset"!=e&&(t[e]=this._finished?this._finalKeyframe[e]:Wm(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class py{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(fy().toString()),this._cssKeyframesDriver=new hy}validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}overrideWebAnimationsSupport(t){this._isNativeImpl=t}animate(t,e,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const l={},c=s.filter(t=>t instanceof dy);Hm(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const u=Kb(t,e=$m(t,e=e.map(t=>Pm(t,!1)),l));return new dy(t,e,a,u)}}function fy(){return Zg()&&Element.prototype.animate||{}}let gy=(()=>{class t extends Fg{constructor(t,e){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(e.body,{id:"0",encapsulation:jt.None,styles:[],data:{animation:[]}})}build(t){const e=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(t)?Ug(t):t;return yy(this._renderer,null,e,"register",[n]),new my(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pl),Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class my extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new by(this._id,t,e||{},this._renderer)}}class by{constructor(t,e,n,i){this.id=t,this.element=e,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(t,e){return this._renderer.listen(this.element,`@@${this.id}:${t}`,e)}_command(t,...e){return yy(this._renderer,this.element,this.id,t,e)}onDone(t){this._listen("done",t)}onStart(t){this._listen("start",t)}onDestroy(t){this._listen("destroy",t)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(t){this._command("setPosition",t)}getPosition(){var t,e;return null!==(e=null===(t=this._renderer.engine.players[+this.id])||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}}function yy(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const vy="@.disabled";let _y=(()=>{class t{constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),e.onRemovalComplete=(t,e)=>{e&&e.parentNode(t)&&e.removeChild(t.parentNode,t)}}createRenderer(t,e){const n=this.delegate.createRenderer(t,e);if(!(t&&e&&e.data&&e.data.animation)){let t=this._rendererCache.get(n);return t||(t=new wy("",n,this.engine),this._rendererCache.set(n,t)),t}const i=e.id,r=e.id+"-"+this._currentId;this._currentId++,this.engine.register(r,t);const s=e=>{Array.isArray(e)?e.forEach(s):this.engine.registerTrigger(i,r,t,e.name,e)};return e.data.animation.forEach(s),new xy(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){t>=0&&te(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(t=>{const[e,n]=t;e(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([e,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pl),Ci(Yb),Ci(xu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class wy{constructor(t,e,n){this.namespaceId=t,this.delegate=e,this.engine=n,this.destroyNode=this.delegate.destroyNode?t=>e.destroyNode(t):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,i=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,i)}removeChild(t,e,n){this.engine.onRemove(this.namespaceId,e,this.delegate,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,i){this.delegate.setAttribute(t,e,n,i)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,i){this.delegate.setStyle(t,e,n,i)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){"@"==e.charAt(0)&&e==vy?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.delegate.listen(t,e,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}}class xy extends wy{constructor(t,e,n,i){super(e,n,i),this.factory=t,this.namespaceId=e}setProperty(t,e,n){"@"==e.charAt(0)?"."==e.charAt(1)&&e==vy?this.disableAnimations(t,n=void 0===n||!!n):this.engine.process(this.namespaceId,t,e.substr(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n){if("@"==e.charAt(0)){const i=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(t);let r=e.substr(1),s="";return"@"!=r.charAt(0)&&([r,s]=function(t){const e=t.indexOf(".");return[t.substring(0,e),t.substr(e+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,t=>{this.factory.scheduleListenerCallback(t._data||-1,n,t)})}return this.delegate.listen(t,e,n)}}let Sy=(()=>{class t extends Yb{constructor(t,e,n){super(t.body,e,n)}ngOnDestroy(){this.flush()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(vm),Ci(gb))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Ey=new oi("AnimationModuleType"),Cy=[{provide:Fg,useClass:gy},{provide:gb,useFactory:function(){return new mb}},{provide:Yb,useClass:Sy},{provide:Pl,useFactory:function(t,e,n){return new _y(t,e,n)},deps:[ed,Yb,xu]}],Oy=[{provide:vm,useFactory:function(){return"function"==typeof fy()?new py:new hy}},{provide:Ey,useValue:"BrowserAnimations"},...Cy],Ty=[{provide:vm,useClass:ym},{provide:Ey,useValue:"NoopAnimations"},...Cy];let ky=(()=>{class t{static withConfig(e){return{ngModule:t,providers:e.disableAnimations?Ty:Oy}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Oy,imports:[gd]}),t})();function Ay(t,e){if(1&t&&oa(0,"mat-pseudo-checkbox",4),2&t){const t=va();na("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function Py(t,e){if(1&t&&(ra(0,"span",5),Za(1),sa()),2&t){const t=va();ws(1),tl("(",t.group.label,")")}}const Iy=["*"],My=new Rl("12.2.5"),Dy=new oi("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Ry,Ny=(()=>{class t{constructor(t,e,n){this._hasDoneGlobalChecks=!1,this._document=n,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=e,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!Nu()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const e=getComputedStyle(t);e&&"none"!==e.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&My.full!==jg.full&&console.warn("The Angular Material version ("+My.full+") does not match the Angular CDK version ("+jg.full+").\nPlease ensure the versions of these two packages exactly match.")}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ng),Ci(Dy,8),Ci(Yu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Tp],Tp]}),t})();function Ly(t){return class extends t{constructor(...t){super(...t),this._disabled=!1}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t)}}}function jy(t,e){return class extends t{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const e=t||this.defaultColor;e!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),e&&this._elementRef.nativeElement.classList.add(`mat-${e}`),this._color=e)}}}function Fy(t){return class extends t{constructor(...t){super(...t),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=md(t)}}}function By(t,e=0){return class extends t{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?bd(t):this.defaultTabIndex}}}function Vy(t){return class extends t{constructor(...t){super(...t),this.stateChanges=new P,this.errorState=!1}updateErrorState(){const t=this.errorState,e=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);e!==t&&(this.errorState=e,this.stateChanges.next())}}}try{Ry="undefined"!=typeof Intl}catch(m){Ry=!1}let zy=(()=>{class t{isErrorState(t,e){return!!(t&&t.invalid&&(t.touched||e&&e.submitted))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})();class Uy{constructor(t,e,n){this._renderer=t,this.element=e,this.config=n,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const Hy={enterDuration:225,exitDuration:150},$y=_p({passive:!0}),Gy=["mousedown","touchstart"],Wy=["mouseup","mouseleave","touchend","touchcancel"];class qy{constructor(t,e,n,i){this._target=t,this._ngZone=e,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,i.isBrowser&&(this._containerElement=_d(n))}fadeInRipple(t,e,n={}){const i=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),r=Object.assign(Object.assign({},Hy),n.animation);n.centered&&(t=i.left+i.width/2,e=i.top+i.height/2);const s=n.radius||function(t,e,n){const i=Math.max(Math.abs(t-n.left),Math.abs(t-n.right)),r=Math.max(Math.abs(e-n.top),Math.abs(e-n.bottom));return Math.sqrt(i*i+r*r)}(t,e,i),o=t-i.left,a=e-i.top,l=r.enterDuration,c=document.createElement("div");c.classList.add("mat-ripple-element"),c.style.left=o-s+"px",c.style.top=a-s+"px",c.style.height=2*s+"px",c.style.width=2*s+"px",null!=n.color&&(c.style.backgroundColor=n.color),c.style.transitionDuration=`${l}ms`,this._containerElement.appendChild(c),function(t){window.getComputedStyle(t).getPropertyValue("opacity")}(c),c.style.transform="scale(1)";const u=new Uy(this,c,n);return u.state=0,this._activeRipples.add(u),n.persistent||(this._mostRecentTransientRipple=u),this._runTimeoutOutsideZone(()=>{const t=u===this._mostRecentTransientRipple;u.state=1,!n.persistent&&(!t||!this._isPointerDown)&&u.fadeOut()},l),u}fadeOutRipple(t){const e=this._activeRipples.delete(t);if(t===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!e)return;const n=t.element,i=Object.assign(Object.assign({},Hy),t.config.animation);n.style.transitionDuration=`${i.exitDuration}ms`,n.style.opacity="0",t.state=2,this._runTimeoutOutsideZone(()=>{t.state=3,n.parentNode.removeChild(n)},i.exitDuration)}fadeOutAll(){this._activeRipples.forEach(t=>t.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(t=>{t.config.persistent||t.fadeOut()})}setupTriggerEvents(t){const e=_d(t);!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,this._registerEvents(Gy))}handleEvent(t){"mousedown"===t.type?this._onMousedown(t):"touchstart"===t.type?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(Wy),this._pointerUpEventsRegistered=!0)}_onMousedown(t){const e=_g(t),n=this._lastTouchStartEvent&&Date.now(){!t.config.persistent&&(1===t.state||t.config.terminateOnPointerUp&&0===t.state)&&t.fadeOut()}))}_runTimeoutOutsideZone(t,e=0){this._ngZone.runOutsideAngular(()=>setTimeout(t,e))}_registerEvents(t){this._ngZone.runOutsideAngular(()=>{t.forEach(t=>{this._triggerElement.addEventListener(t,this,$y)})})}_removeTriggerEvents(){this._triggerElement&&(Gy.forEach(t=>{this._triggerElement.removeEventListener(t,this,$y)}),this._pointerUpEventsRegistered&&Wy.forEach(t=>{this._triggerElement.removeEventListener(t,this,$y)}))}}const Xy=new oi("mat-ripple-global-options");let Yy=(()=>{class t{constructor(t,e,n,i,r){this._elementRef=t,this._animationMode=r,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=i||{},this._rippleRenderer=new qy(this,e,t,n)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,e=0,n){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,e,Object.assign(Object.assign({},this.rippleConfig),n)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(xu),ea(pp),ea(Xy,8),ea(Ey,8))},t.\u0275dir=se({type:t,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,e){2&t&&ja("mat-ripple-unbounded",e.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),t})(),Ky=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny,fp],Ny]}),t})(),Qy=(()=>{class t{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return t.\u0275fac=function(e){return new(e||t)(ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,e){2&t&&ja("mat-pseudo-checkbox-indeterminate","indeterminate"===e.state)("mat-pseudo-checkbox-checked","checked"===e.state)("mat-pseudo-checkbox-disabled",e.disabled)("_mat-animation-noopable","NoopAnimations"===e._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,e){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),t})(),Zy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny]]}),t})();const Jy=new oi("MAT_OPTION_PARENT_COMPONENT"),tv=Ly(class{});let ev=0,nv=(()=>{class t extends tv{constructor(t){var e;super(),this._labelId="mat-optgroup-label-"+ev++,this._inert=null!==(e=null==t?void 0:t.inertGroups)&&void 0!==e&&e}}return t.\u0275fac=function(e){return new(e||t)(ea(Jy,8))},t.\u0275dir=se({type:t,inputs:{label:"label"},features:[jo]}),t})();const iv=new oi("MatOptgroup");let rv=0;class sv{constructor(t,e=!1){this.source=t,this.isUserInput=e}}let ov=(()=>{class t{constructor(t,e,n,i){this._element=t,this._changeDetectorRef=e,this._parent=n,this.group=i,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+rv++,this.onSelectionChange=new Rc,this._stateChanges=new P}get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(t){this._disabled=md(t)}get disableRipple(){return this._parent&&this._parent.disableRipple}get active(){return this._active}get viewValue(){return(this._getHostElement().textContent||"").trim()}select(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}deselect(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}focus(t,e){const n=this._getHostElement();"function"==typeof n.focus&&n.focus(e)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!Qp(t)&&(this._selectViaInteraction(),t.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getAriaSelected(){return this.selected||!this.multiple&&null}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){const t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue=t,this._stateChanges.next())}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(t=!1){this.onSelectionChange.emit(new sv(this,t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(void 0),ea(nv))},t.\u0275dir=se({type:t,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),t})(),av=(()=>{class t extends ov{constructor(t,e,n,i){super(t,e,n,i)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(Jy,8),ea(iv,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,e){1&t&&fa("click",function(){return e._selectViaInteraction()})("keydown",function(t){return e._handleKeydown(t)}),2&t&&(il("id",e.id),Ko("tabindex",e._getTabIndex())("aria-selected",e._getAriaSelected())("aria-disabled",e.disabled.toString()),ja("mat-selected",e.selected)("mat-option-multiple",e.multiple)("mat-active",e.active)("mat-option-disabled",e.disabled))},exportAs:["matOption"],features:[jo],ngContentSelectors:Iy,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(t,e){1&t&&(wa(),Jo(0,Ay,1,2,"mat-pseudo-checkbox",0),ra(1,"span",1),xa(2),sa(),Jo(3,Py,2,1,"span",2),oa(4,"div",3)),2&t&&(na("ngIf",e.multiple),ws(3),na("ngIf",e.group&&e.group._inert),ws(1),na("matRippleTrigger",e._getHostElement())("matRippleDisabled",e.disabled||e.disableRipple))},directives:[_h,Yy,Qy],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),t})();function lv(t,e,n){if(n.length){let i=e.toArray(),r=n.toArray(),s=0;for(let e=0;en+i?Math.max(0,t-i+e):n}let uv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Rh,Ny,Zy]]}),t})();function hv(...t){if(1===t.length){const e=t[0];if(d(e))return dv(e,null);if(p(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return dv(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return dv(t=1===t.length&&d(t[0])?t[0]:t,null).pipe(D(t=>e(...t)))}return dv(t,null)}function dv(t,e){return new C(n=>{const i=t.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=t},error:t=>n.error(t),complete:()=>{s++,(s===i||!c)&&(o===i&&n.next(e?e.reduce((t,e,n)=>(t[e]=r[n],t),{}):r),n.complete())}}))}})}function pv(t){return function(e){const n=new fv(t),i=e.lift(n);return n.caught=i}}class fv{constructor(t){this.selector=t}call(t,e){return e.subscribe(new gv(t,this.selector,this.caught))}}class gv extends ${constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const i=new H(this);this.add(i);const r=G(n,i);r!==i&&this.add(r)}}}function mv(t){return e=>e.lift(new bv(t))}class bv{constructor(t){this.callback=t}call(t,e){return e.subscribe(new yv(t,this.callback))}}class yv extends v{constructor(t,e){super(t),this.add(new g(e))}}class vv{}class _v{}class wv{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),i=n.toLowerCase(),r=t.slice(e+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const i=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(e,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof wv?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new wv;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof wv?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const i=("a"===t.op?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":const r=t.value;if(r){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===r.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}}class xv{encodeKey(t){return Cv(t)}encodeValue(t){return Cv(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const Sv=/%(\d[a-f0-9])/gi,Ev={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Cv(t){return encodeURIComponent(t).replace(Sv,(t,e)=>{var n;return null!==(n=Ev[e])&&void 0!==n?n:t})}function Ov(t){return`${t}`}class Tv{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new xv,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(t=>{const i=t.indexOf("="),[r,s]=-1==i?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,i)),e.decodeValue(t.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){const e=[];return Object.keys(t).forEach(n=>{const i=t[n];Array.isArray(i)?i.forEach(t=>{e.push({param:n,value:t,op:"a"})}):e.push({param:n,value:i,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Tv({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(Ov(t.value)),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(Ov(t.value));-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}class kv{constructor(){this.map=new Map}set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}keys(){return this.map.keys()}}function Av(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function Pv(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Iv(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Mv{constructor(t,e,n,i){let r;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.context&&(this.context=r.context),r.params&&(this.params=r.params)),this.headers||(this.headers=new wv),this.context||(this.context=new kv),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),l)),t.setParams&&(c=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),c)),new Mv(n,i,s,{params:c,headers:l,context:u,reportProgress:a,responseType:r,withCredentials:o})}}var Dv=(()=>((Dv=Dv||{})[Dv.Sent=0]="Sent",Dv[Dv.UploadProgress=1]="UploadProgress",Dv[Dv.ResponseHeader=2]="ResponseHeader",Dv[Dv.DownloadProgress=3]="DownloadProgress",Dv[Dv.Response=4]="Response",Dv[Dv.User=5]="User",Dv))();class Rv{constructor(t,e=200,n="OK"){this.headers=t.headers||new wv,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class Nv extends Rv{constructor(t={}){super(t),this.type=Dv.ResponseHeader}clone(t={}){return new Nv({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class Lv extends Rv{constructor(t={}){super(t),this.type=Dv.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new Lv({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class jv extends Rv{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function Fv(t,e){return{body:e,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let Bv=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Mv)i=t;else{let r,s;r=n.headers instanceof wv?n.headers:new wv(n.headers),n.params&&(s=n.params instanceof Tv?n.params:new Tv({fromObject:n.params})),i=new Mv(t,e,void 0!==n.body?n.body:null,{headers:r,context:n.context,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const r=wd(i).pipe(function(t,e){return W(t,e,1)}(t=>this.handler.handle(t)));if(t instanceof Mv||"events"===n.observe)return r;const s=r.pipe(Hd(t=>t instanceof Lv));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return s.pipe(D(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return s.pipe(D(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return s.pipe(D(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return s.pipe(D(t=>t.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new Tv).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,Fv(n,e))}post(t,e,n={}){return this.request("POST",t,Fv(n,e))}put(t,e,n={}){return this.request("PUT",t,Fv(n,e))}}return t.\u0275fac=function(e){return new(e||t)(Ci(vv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Vv{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const zv=new oi("HTTP_INTERCEPTORS");let Uv=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Hv=/^\)\]\}',?\n/;let $v=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new C(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const i=t.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const e=1223===n.status?204:n.status,i=n.statusText||"OK",s=new wv(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return r=new Nv({headers:s,status:e,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),l=null;204!==r&&(l=void 0===n.response?n.responseText:n.response),0===r&&(r=l?200:0);let c=r>=200&&r<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(Hv,"");try{l=""!==l?JSON.parse(l):null}catch(u){l=t,c&&(c=!1,l={error:u,text:l})}}c?(e.next(new Lv({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new jv({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new jv({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});e.error(r)};let l=!1;const c=i=>{l||(e.next(s()),l=!0);let r={type:Dv.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===t.responseType&&!!n.responseText&&(r.partialText=n.responseText),e.next(r)},u=t=>{let n={type:Dv.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),n.addEventListener("timeout",a),n.addEventListener("abort",a),t.reportProgress&&(n.addEventListener("progress",c),null!==i&&n.upload&&n.upload.addEventListener("progress",u)),n.send(i),e.next({type:Dv.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("abort",a),n.removeEventListener("load",o),n.removeEventListener("timeout",a),t.reportProgress&&(n.removeEventListener("progress",c),null!==i&&n.upload&&n.upload.removeEventListener("progress",u)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(Ci(jh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Gv=new oi("XSRF_COOKIE_NAME"),Wv=new oi("XSRF_HEADER_NAME");class qv{}let Xv=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=gh(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(ou),Ci(Gv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Yv=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const i=this.tokenService.getToken();return null!==i&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,i)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(qv),Ci(Wv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Kv=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(zv,[]);this.chain=t.reduceRight((t,e)=>new Vv(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(_v),Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Qv=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:Yv,useClass:Uv}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:Gv,useValue:e.cookieName}:[],e.headerName?{provide:Wv,useValue:e.headerName}:[]]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Yv,{provide:zv,useExisting:Yv,multi:!0},{provide:qv,useClass:Xv},{provide:Gv,useValue:"XSRF-TOKEN"},{provide:Wv,useValue:"X-XSRF-TOKEN"}]}),t})(),Zv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Bv,{provide:vv,useClass:Kv},$v,{provide:_v,useExisting:$v}],imports:[[Qv.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();const Jv=["*"];function t_(t){return Error(`Unable to find icon with the name "${t}"`)}function e_(t){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${t}".`)}function n_(t){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${t}".`)}class i_{constructor(t,e,n){this.url=t,this.svgText=e,this.options=n}}let r_=(()=>{class t{constructor(t,e,n,i){this._httpClient=t,this._sanitizer=e,this._errorHandler=i,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=n}addSvgIcon(t,e,n){return this.addSvgIconInNamespace("",t,e,n)}addSvgIconLiteral(t,e,n){return this.addSvgIconLiteralInNamespace("",t,e,n)}addSvgIconInNamespace(t,e,n,i){return this._addSvgIconConfig(t,e,new i_(n,null,i))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,e,n,i){const r=this._sanitizer.sanitize(yr.HTML,n);if(!r)throw n_(n);return this._addSvgIconConfig(t,e,new i_("",r,i))}addSvgIconSet(t,e){return this.addSvgIconSetInNamespace("",t,e)}addSvgIconSetLiteral(t,e){return this.addSvgIconSetLiteralInNamespace("",t,e)}addSvgIconSetInNamespace(t,e,n){return this._addSvgIconSetConfig(t,new i_(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){const i=this._sanitizer.sanitize(yr.HTML,e);if(!i)throw n_(e);return this._addSvgIconSetConfig(t,new i_("",i,n))}registerFontClassAlias(t,e=t){return this._fontCssClassesByAlias.set(t,e),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const e=this._sanitizer.sanitize(yr.RESOURCE_URL,t);if(!e)throw e_(t);const n=this._cachedIconsByUrl.get(e);return n?wd(s_(n)):this._loadSvgIconFromConfig(new i_(t,null)).pipe($f(t=>this._cachedIconsByUrl.set(e,t)),D(t=>s_(t)))}getNamedSvgIcon(t,e=""){const n=o_(e,t);let i=this._svgIconConfigs.get(n);if(i)return this._getSvgFromConfig(i);if(i=this._getIconConfigFromResolvers(e,t),i)return this._svgIconConfigs.set(n,i),this._getSvgFromConfig(i);const r=this._iconSetConfigs.get(e);return r?this._getSvgFromIconSetConfigs(t,r):ip(t_(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?wd(s_(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(D(t=>s_(t)))}_getSvgFromIconSetConfigs(t,e){const n=this._extractIconWithNameFromAnySet(t,e);return n?wd(n):hv(e.filter(t=>!t.svgText).map(t=>this._loadSvgIconSetFromConfig(t).pipe(pv(e=>{const n=`Loading icon set URL: ${this._sanitizer.sanitize(yr.RESOURCE_URL,t.url)} failed: ${e.message}`;return this._errorHandler.handleError(new Error(n)),wd(null)})))).pipe(D(()=>{const n=this._extractIconWithNameFromAnySet(t,e);if(!n)throw t_(t);return n}))}_extractIconWithNameFromAnySet(t,e){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.svgText&&i.svgText.indexOf(t)>-1){const e=this._svgElementFromConfig(i),n=this._extractSvgIconFromSet(e,t,i.options);if(n)return n}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe($f(e=>t.svgText=e),D(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?wd(null):this._fetchIcon(t).pipe($f(e=>t.svgText=e))}_extractSvgIconFromSet(t,e,n){const i=t.querySelector(`[id="${e}"]`);if(!i)return null;const r=i.cloneNode(!0);if(r.removeAttribute("id"),"svg"===r.nodeName.toLowerCase())return this._setSvgAttributes(r,n);if("symbol"===r.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(r),n);const s=this._svgElementFromString("");return s.appendChild(r),this._setSvgAttributes(s,n)}_svgElementFromString(t){const e=this._document.createElement("DIV");e.innerHTML=t;const n=e.querySelector("svg");if(!n)throw Error(" tag not found");return n}_toSvgElement(t){const e=this._svgElementFromString(""),n=t.attributes;for(let i=0;ithis._inProgressUrlFetches.delete(s)),at());return this._inProgressUrlFetches.set(s,a),a}_addSvgIconConfig(t,e,n){return this._svgIconConfigs.set(o_(t,e),n),this}_addSvgIconSetConfig(t,e){const n=this._iconSetConfigs.get(t);return n?n.push(e):this._iconSetConfigs.set(t,[e]),this}_svgElementFromConfig(t){if(!t.svgElement){const e=this._svgElementFromString(t.svgText);this._setSvgAttributes(e,t.options),t.svgElement=e}return t.svgElement}_getIconConfigFromResolvers(t,e){for(let n=0;ne?e.pathname+e.search:""}}}),u_=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],h_=u_.map(t=>`[${t}]`).join(", "),d_=/^url\(['"]?#(.*?)['"]?\)$/;let p_=(()=>{class t extends l_{constructor(t,e,n,i,r){super(t),this._iconRegistry=e,this._location=i,this._errorHandler=r,this._inline=!1,this._currentIconFetch=g.EMPTY,n||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=md(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){const e=this._cleanupFontValue(t);e!==this._fontSet&&(this._fontSet=e,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const e=this._cleanupFontValue(t);e!==this._fontIcon&&(this._fontIcon=e,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const e=t.split(":");switch(e.length){case 1:return["",e[0]];case 2:return e;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const t=this._location.getPathname();t!==this._previousPath&&(this._previousPath=t,this._prependPathToReferences(t))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const e=t.querySelectorAll("style");for(let i=0;i{e.forEach(e=>{n.setAttribute(e.name,`url('${t}#${e.value}')`)})})}_cacheChildrenWithExternalReferences(t){const e=t.querySelectorAll(h_),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let i=0;i{const r=e[i],s=r.getAttribute(t),o=s?s.match(d_):null;if(o){let e=n.get(r);e||(e=[],n.set(r,e)),e.push({name:t,value:o[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[e,n]=this._splitIconName(t);e&&(this._svgNamespace=e),n&&(this._svgName=n),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(n,e).pipe(Gp(1)).subscribe(t=>this._setSvgElement(t),t=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${e}:${n}! ${t.message}`))})}}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(r_),ii("aria-hidden"),ea(c_),ea(kr))},t.\u0275cmp=Jt({type:t,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,e){2&t&&(Ko("data-mat-icon-type",e._usingFontIcon()?"font":"svg")("data-mat-icon-name",e._svgName||e.fontIcon)("data-mat-icon-namespace",e._svgNamespace||e.fontSet),ja("mat-icon-inline",e.inline)("mat-icon-no-color","primary"!==e.color&&"accent"!==e.color&&"warn"!==e.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[jo],ngContentSelectors:Jv,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:[".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0}),t})(),f_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny],Ny]}),t})();const g_=["mat-button",""],m_=["*"],b_=".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n",y_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],v_=jy(Ly(Fy(class{constructor(t){this._elementRef=t}})));let __=(()=>{class t extends v_{constructor(t,e,n){super(t),this._focusMonitor=e,this._animationMode=n,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const i of y_)this._hasHostAttributes(i)&&this._getHostElement().classList.add(i);t.nativeElement.classList.add("mat-button-base"),this.isRoundButton&&(this.color="accent")}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}focus(t,e){t?this._focusMonitor.focusVia(this._getHostElement(),t,e):this._getHostElement().focus(e)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(t=>this._getHostElement().hasAttribute(t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Ig),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-icon-button",""],["button","mat-fab",""],["button","mat-mini-fab",""],["button","mat-stroked-button",""],["button","mat-flat-button",""]],viewQuery:function(t,e){if(1&t&&qc(Yy,5),2&t){let t;Wc(t=Yc())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,e){2&t&&(Ko("disabled",e.disabled||null),ja("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-button-disabled",e.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[jo],attrs:g_,ngContentSelectors:m_,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,e){1&t&&(wa(),ra(0,"span",0),xa(1),sa(),oa(2,"span",1),oa(3,"span",2)),2&t&&(ws(2),ja("mat-button-ripple-round",e.isRoundButton||e.isIconButton),na("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",e.isIconButton)("matRippleTrigger",e._getHostElement()))},directives:[Yy],styles:[b_],encapsulation:2,changeDetection:0}),t})(),w_=(()=>{class t extends __{constructor(t,e,n){super(e,t,n)}_haltDisabledEvents(t){this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}}return t.\u0275fac=function(e){return new(e||t)(ea(Ig),ea(kl),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["a","mat-button",""],["a","mat-raised-button",""],["a","mat-icon-button",""],["a","mat-fab",""],["a","mat-mini-fab",""],["a","mat-stroked-button",""],["a","mat-flat-button",""]],hostAttrs:[1,"mat-focus-indicator"],hostVars:7,hostBindings:function(t,e){1&t&&fa("click",function(t){return e._haltDisabledEvents(t)}),2&t&&(Ko("tabindex",e.disabled?-1:e.tabIndex||0)("disabled",e.disabled||null)("aria-disabled",e.disabled.toString()),ja("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-button-disabled",e.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex"},exportAs:["matButton","matAnchor"],features:[jo],attrs:g_,ngContentSelectors:m_,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,e){1&t&&(wa(),ra(0,"span",0),xa(1),sa(),oa(2,"span",1),oa(3,"span",2)),2&t&&(ws(2),ja("mat-button-ripple-round",e.isRoundButton||e.isIconButton),na("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",e.isIconButton)("matRippleTrigger",e._getHostElement()))},directives:[Yy],styles:[b_],encapsulation:2,changeDetection:0}),t})(),x_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Ny],Ny]}),t})();class S_ extends v{notifyNext(t,e,n,i,r){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}class E_ extends v{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function C_(t,e,n,i,r=new E_(t,n,i)){if(!r.closed)return e instanceof C?e.subscribe(r):V(e)(r)}const O_={};function T_(...t){let e,n;return M(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&d(t[0])&&(t=t[0]),K(t,n).lift(new k_(e))}class k_{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new A_(t,this.resultSelector))}}class A_ extends S_{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(O_),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n{class t{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):D_}matchMedia(t){return this._platform.WEBKIT&&function(t){if(!P_.has(t))try{I_||(I_=document.createElement("style"),I_.setAttribute("type","text/css"),document.head.appendChild(I_)),I_.sheet&&(I_.sheet.insertRule(`@media ${t} {.fx-query-test{ }}`,0),P_.add(t))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp))},token:t,providedIn:"root"}),t})();function D_(t){return{matches:"all"===t||""===t,media:t,addListener:()=>{},removeListener:()=>{}}}let R_=(()=>{class t{constructor(t,e){this._mediaMatcher=t,this._zone=e,this._queries=new Map,this._destroySubject=new P}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return N_(yd(t)).some(t=>this._registerQuery(t).mql.matches)}observe(t){let e=T_(N_(yd(t)).map(t=>this._registerQuery(t).observable));return e=Yd(e.pipe(Gp(1)),e.pipe(Qf(1),qf(0))),e.pipe(D(t=>{const e={matches:!1,breakpoints:{}};return t.forEach(({matches:t,query:n})=>{e.matches=e.matches||t,e.breakpoints[n]=t}),e}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const e=this._mediaMatcher.matchMedia(t),n={observable:new C(t=>{const n=e=>this._zone.run(()=>t.next(e));return e.addListener(n),()=>{e.removeListener(n)}}).pipe(Kd(e),D(({matches:e})=>({query:t,matches:e})),Wd(this._destroySubject)),mql:e};return this._queries.set(t,n),n}}return t.\u0275fac=function(e){return new(e||t)(Ci(M_),Ci(xu))},t.\u0275prov=xt({factory:function(){return new t(Ci(M_),Ci(xu))},token:t,providedIn:"root"}),t})();function N_(t){return t.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}function L_(t,e){if(1&t){const t=ua();ra(0,"div",1),ra(1,"button",2),fa("click",function(){return $e(t),va().action()}),Za(2),sa(),sa()}if(2&t){const t=va();ws(2),Ja(t.data.action)}}function j_(t,e){}const F_=new oi("MatSnackBarData");class B_{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const V_=Math.pow(2,31)-1;class z_{constructor(t,e){this._overlayRef=e,this._afterDismissed=new P,this._afterOpened=new P,this._onAction=new P,this._dismissedByAction=!1,this.containerInstance=t,this.onAction().subscribe(()=>this.dismiss()),t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,V_))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}let U_=(()=>{class t{constructor(t,e){this.snackBarRef=t,this.data=e}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return t.\u0275fac=function(e){return new(e||t)(ea(z_),ea(F_))},t.\u0275cmp=Jt({type:t,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,e){1&t&&(ra(0,"span"),Za(1),sa(),Jo(2,L_,3,1,"div",0)),2&t&&(ws(1),Ja(e.data.message),ws(1),na("ngIf",e.hasAction))},directives:[_h,__],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),t})();const H_={snackBarState:Vg("state",[$g("void, hidden",Hg({transform:"scale(0.8)",opacity:0})),$g("visible",Hg({transform:"scale(1)",opacity:1})),Wg("* => visible",zg("150ms cubic-bezier(0, 0, 0.2, 1)")),Wg("* => void, * => hidden",zg("75ms cubic-bezier(0.4, 0.0, 1, 1)",Hg({opacity:0})))])};let $_=(()=>{class t extends Fp{constructor(t,e,n,i,r){super(),this._ngZone=t,this._elementRef=e,this._changeDetectorRef=n,this._platform=i,this.snackBarConfig=r,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new P,this._onExit=new P,this._onEnter=new P,this._animationState="void",this.attachDomPortal=t=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(t)),this._live="assertive"!==r.politeness||r.announcementMessage?"off"===r.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(t)}onAnimationEnd(t){const{fromState:e,toState:n}=t;if(("void"===n&&"void"!==e||"hidden"===n)&&this._completeExit(),"visible"===n){const t=this._onEnter;this._ngZone.run(()=>{t.next(),t.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}ngOnDestroy(){this._destroyed=!0,this._completeExit()}_completeExit(){this._ngZone.onMicrotaskEmpty.pipe(Gp(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,e=this.snackBarConfig.panelClass;e&&(Array.isArray(e)?e.forEach(e=>t.classList.add(e)):t.classList.add(e)),"center"===this.snackBarConfig.horizontalPosition&&t.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&t.classList.add("mat-snack-bar-top")}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),e=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&e){let n=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(n=document.activeElement),t.removeAttribute("aria-hidden"),e.appendChild(t),null==n||n.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(kl),ea(tc),ea(pp),ea(B_))},t.\u0275cmp=Jt({type:t,selectors:[["snack-bar-container"]],viewQuery:function(t,e){if(1&t&&qc(Up,7),2&t){let t;Wc(t=Yc())&&(e._portalOutlet=t.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,e){1&t&&ga("@state.done",function(t){return e.onAnimationEnd(t)}),2&t&&rl("@state",e._animationState)},features:[jo],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,e){1&t&&(ra(0,"div",0),Jo(1,j_,0,0,"ng-template",1),sa(),oa(2,"div")),2&t&&(ws(2),Ko("aria-live",e._live)("role",e._role))},directives:[Up],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[H_.snackBarState]}}),t})(),G_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rf,Hp,Rh,x_,Ny],Ny]}),t})();const W_=new oi("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new B_}});let q_=(()=>{class t{constructor(t,e,n,i,r,s){this._overlay=t,this._live=e,this._injector=n,this._breakpointObserver=i,this._parentSnackBar=r,this._defaultConfig=s,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=U_,this.snackBarContainerComponent=$_,this.handsetCssClass="mat-snack-bar-handset"}get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}openFromComponent(t,e){return this._attach(t,e)}openFromTemplate(t,e){return this._attach(t,e)}open(t,e="",n){const i=Object.assign(Object.assign({},this._defaultConfig),n);return i.data={message:t,action:e},i.announcementMessage===t&&(i.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,i)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,e){const n=No.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:B_,useValue:e}]}),i=new Np(this.snackBarContainerComponent,e.viewContainerRef,n),r=t.attach(i);return r.instance.snackBarConfig=e,r.instance}_attach(t,e){const n=Object.assign(Object.assign(Object.assign({},new B_),this._defaultConfig),e),i=this._createOverlay(n),r=this._attachSnackBarContainer(i,n),s=new z_(r,i);if(t instanceof sc){const e=new Lp(t,null,{$implicit:n.data,snackBarRef:s});s.instance=r.attachTemplatePortal(e)}else{const e=this._createInjector(n,s),i=new Np(t,void 0,e),o=r.attachComponentPortal(i);s.instance=o.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(Wd(i.detachments())).subscribe(t=>{const e=i.overlayElement.classList;t.matches?e.add(this.handsetCssClass):e.remove(this.handsetCssClass)}),n.announcementMessage&&r._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(s,n),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(t,e){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),e.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),e.duration&&e.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(e.duration))}_createOverlay(t){const e=new af;e.direction=t.direction;let n=this._overlay.position().global();const i="rtl"===t.direction,r="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!i||"end"===t.horizontalPosition&&i,s=!r&&"center"!==t.horizontalPosition;return r?n.left("0"):s?n.right("0"):n.centerHorizontally(),"top"===t.verticalPosition?n.top("0"):n.bottom("0"),e.positionStrategy=n,this._overlay.create(e)}_createInjector(t,e){return No.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:z_,useValue:e},{provide:F_,useValue:t.data}]})}}return t.\u0275fac=function(e){return new(e||t)(Ci(kf),Ci(kg),Ci(No),Ci(R_),Ci(t,12),Ci(W_))},t.\u0275prov=xt({factory:function(){return new t(Ci(kf),Ci(kg),Ci(_o),Ci(R_),Ci(t,12),Ci(W_))},token:t,providedIn:G_}),t})();const X_={tooltipState:Vg("state",[$g("initial, void, hidden",Hg({opacity:0,transform:"scale(0)"})),$g("visible",Hg({transform:"scale(1)"})),Wg("* => visible",zg("200ms cubic-bezier(0, 0, 0.2, 1)",Gg([Hg({opacity:0,transform:"scale(0)",offset:0}),Hg({opacity:.5,transform:"scale(0.99)",offset:.5}),Hg({opacity:1,transform:"scale(1)",offset:1})]))),Wg("* => hidden",zg("100ms cubic-bezier(0, 0, 0.2, 1)",Hg({opacity:0})))])},Y_="tooltip-panel",K_=_p({passive:!0}),Q_=new oi("mat-tooltip-scroll-strategy"),Z_={provide:Q_,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition({scrollThrottle:20})}},J_=new oi("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let tw=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u,h){this._overlay=t,this._elementRef=e,this._scrollDispatcher=n,this._viewContainerRef=i,this._ngZone=r,this._platform=s,this._ariaDescriber=o,this._focusMonitor=a,this._dir=c,this._defaultOptions=u,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new P,this._handleKeydown=t=>{this._isTooltipVisible()&&27===t.keyCode&&!Qp(t)&&(t.preventDefault(),t.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=l,this._document=h,u&&(u.position&&(this.position=u.position),u.touchGestures&&(this.touchGestures=u.touchGestures)),c.change.pipe(Wd(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),r.runOutsideAngular(()=>{e.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var e;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(e=this._tooltipInstance)||void 0===e||e.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}get message(){return this._message}set message(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")})}))}get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(Wd(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),t.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(([e,n])=>{t.removeEventListener(e,n,K_)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay){if(this.disabled||!this.message||this._isTooltipVisible()&&!this._tooltipInstance._showTimeoutId&&!this._tooltipInstance._hideTimeoutId)return;const e=this._createOverlay();this._detach(),this._portal=this._portal||new Np(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=e.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(Wd(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}hide(t=this.hideDelay){this._tooltipInstance&&this._tooltipInstance.hide(t)}toggle(){this._isTooltipVisible()?this.hide():this.show()}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(){if(this._overlayRef)return this._overlayRef;const t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),e=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return e.positionChanges.pipe(Wd(this._destroyed)).subscribe(t=>{this._updateCurrentPositionClass(t.connectionPair),this._tooltipInstance&&t.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:e,panelClass:`${this._cssClassPrefix}-${Y_}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Wd(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Wd(this._destroyed)).subscribe(()=>{var t;return null===(t=this._tooltipInstance)||void 0===t?void 0:t._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const e=t.getConfig().positionStrategy,n=this._getOrigin(),i=this._getOverlayPosition();e.withPositions([this._addOffset(Object.assign(Object.assign({},n.main),i.main)),this._addOffset(Object.assign(Object.assign({},n.fallback),i.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,e=this.position;let n;"above"==e||"below"==e?n={originX:"center",originY:"above"==e?"top":"bottom"}:"before"==e||"left"==e&&t||"right"==e&&!t?n={originX:"start",originY:"center"}:("after"==e||"right"==e&&t||"left"==e&&!t)&&(n={originX:"end",originY:"center"});const{x:i,y:r}=this._invertPosition(n.originX,n.originY);return{main:n,fallback:{originX:i,originY:r}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,e=this.position;let n;"above"==e?n={overlayX:"center",overlayY:"bottom"}:"below"==e?n={overlayX:"center",overlayY:"top"}:"before"==e||"left"==e&&t||"right"==e&&!t?n={overlayX:"end",overlayY:"center"}:("after"==e||"right"==e&&t||"left"==e&&!t)&&(n={overlayX:"start",overlayY:"center"});const{x:i,y:r}=this._invertPosition(n.overlayX,n.overlayY);return{main:n,fallback:{overlayX:i,overlayY:r}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(Gp(1),Wd(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,e){return"above"===this.position||"below"===this.position?"top"===e?e="bottom":"bottom"===e&&(e="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){const{overlayY:e,originX:n,originY:i}=t;let r;if(r="center"===e?this._dir&&"rtl"===this._dir.value?"end"===n?"left":"right":"start"===n?"left":"right":"bottom"===e&&"top"===i?"above":"below",r!==this._currentPosition){const t=this._overlayRef;if(t){const e=`${this._cssClassPrefix}-${Y_}-`;t.removePanelClass(e+this._currentPosition),t.addPanelClass(e+r)}this._currentPosition=r}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",()=>{this._setupPointerExitEventsIfNeeded(),this.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",()=>{this._setupPointerExitEventsIfNeeded(),clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>this.show(),500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",()=>this.hide()],["wheel",t=>this._wheelListener(t)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const e=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",e],["touchcancel",e])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([t,e])=>{this._elementRef.nativeElement.addEventListener(t,e,K_)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const e=this._document.elementFromPoint(t.clientX,t.clientY),n=this._elementRef.nativeElement;e!==n&&!n.contains(e)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const e=this._elementRef.nativeElement,n=e.style;("on"===t||"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName)&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),("on"===t||!e.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(Pp),ea(hc),ea(xu),ea(pp),ea(hg),ea(Ig),ea(void 0),ea(Op),ea(void 0),ea(Yu))},t.\u0275dir=se({type:t,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),t})(),ew=(()=>{class t extends tw{constructor(t,e,n,i,r,s,o,a,l,c,u,h){super(t,e,n,i,r,s,o,a,l,c,u,h),this._tooltipComponent=iw}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(Pp),ea(hc),ea(xu),ea(pp),ea(hg),ea(Ig),ea(Q_),ea(Op,8),ea(J_,8),ea(Yu))},t.\u0275dir=se({type:t,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[jo]}),t})(),nw=(()=>{class t{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new P}show(t){clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(()=>{this._visibility="visible",this._showTimeoutId=void 0,this._onShow(),this._markForCheck()},t)}hide(t){clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._visibility="hidden",this._hideTimeoutId=void 0,this._markForCheck()},t)}afterHidden(){return this._onHide}isVisible(){return"visible"===this._visibility}ngOnDestroy(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}_animationStart(){this._closeOnInteraction=!1}_animationDone(t){const e=t.toState;"hidden"===e&&!this.isVisible()&&this._onHide.next(),("visible"===e||"hidden"===e)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return t.\u0275fac=function(e){return new(e||t)(ea(tc))},t.\u0275dir=se({type:t}),t})(),iw=(()=>{class t extends nw{constructor(t,e){super(t),this._breakpointObserver=e,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(R_))},t.\u0275cmp=Jt({type:t,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,e){2&t&&La("zoom","visible"===e._visibility?1:null)},features:[jo],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,e){if(1&t&&(ra(0,"div",0),fa("@state.start",function(){return e._animationStart()})("@state.done",function(t){return e._animationDone(t)}),Ic(1,"async"),Za(2),sa()),2&t){let t;ja("mat-tooltip-handset",null==(t=Mc(1,5,e._isHandset))?null:t.matches),na("ngClass",e.tooltipClass)("@state",e._visibility),ws(2),Ja(e.message)}},directives:[mh],pipes:[Dh],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[X_.tooltipState]},changeDetection:0}),t})(),rw=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Z_],imports:[[Lg,Rh,Rf,Ny],Ny,Mp]}),t})();function sw(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}function ow(t,e){return function(n,i){e(n,i,t)}}function aw(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function lw(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(e){s(e)}}function a(t){try{l(i.throw(t))}catch(e){s(e)}}function l(t){t.done?r(t.value):function(t){return t instanceof n?t:new n(function(e){e(t)})}(t.value).then(o,a)}l((i=i.apply(t,e||[])).next())})}function cw(t){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)}function uw(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||cw()}const hw="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",dw=uw();class pw{constructor(t,e,n="sessionStorage"){this.storage=function(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(t){return null}}(n),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){return this.config={},this.updateConfiguration(t)}updateConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function fw(t,e,n,i=600){const r=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>i&&(n=Math.min(n,i/t.width));const s=t.width*n,o=t.height*n,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const gw={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function mw(t){return"string"==typeof t?gw[t.toUpperCase()]||gw.WHITE:t}function bw(t,e){if(!t)throw new Error(e||"Assertion failed")}const yw={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},vw=yw.window||yw.self||yw.global,_w=yw.process||{};function ww(){let t;if(dw&&vw.performance)t=vw.performance.now();else if(_w.hrtime){const e=_w.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}console;const xw={debug:dw&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Sw={enabled:!0,level:0};function Ew(){}const Cw={},Ow={once:!0};function Tw(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}let kw=(()=>{class t{constructor({id:t}={id:""}){this.id=t,this.VERSION=hw,this._startTs=ww(),this._deltaTs=ww(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new pw("__probe-".concat(this.id,"__"),Sw),this.userData={},this.timeStamp("".concat(this.id," started")),function(t,e=["constructor"]){const n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n);for(const r of i)"function"==typeof t[r]&&(e.find(t=>r===t)||(t[r]=t[r].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((ww()-this._startTs).toPrecision(10))}getDelta(){return Number((ww()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,e){bw(t,e)}warn(t){return this._getLogFunction(0,t,xw.warn,arguments,Ow)}error(t){return this._getLogFunction(0,t,xw.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,xw.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,xw.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,xw.debug||xw.info,arguments,Ow)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||Ew,n&&[n],{tag:Tw(e)}):Ew}image({logLevel:t,priority:e,image:i,message:r="",scale:s=1}){return this._shouldLog(t||e)?dw?function({image:t,message:e="",scale:n=1}){if("string"==typeof t){const i=new Image;return i.onload=()=>{const t=fw(i,e,n);console.log(...t)},i.src=t,Ew}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...fw(t,e,n)),Ew;if("canvas"===i.toLowerCase()){const i=new Image;return i.onload=()=>console.log(...fw(i,e,n)),i.src=t.toDataURL(),Ew}return Ew}({image:i,message:r,scale:s}):function({image:t,message:e="",scale:r=1}){let s=null;try{s=n(75307)}catch(i){}return s?()=>s(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(t=>console.log(t)):Ew}({image:i,message:r,scale:s}):Ew}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,e){this._storage.updateConfiguration({[t]:e})}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||Ew)}group(t,e,n={collapsed:!1}){n=Pw({logLevel:t,message:e,opts:n});const{collapsed:i}=n;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,e,n={}){return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Ew)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Aw(t)}_getLogFunction(t,e,n,i=[],r){if(this._shouldLog(t)){r=Pw({logLevel:t,message:e,args:i,opts:r}),bw(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=ww();const s=r.tag||r.message;if(r.once){if(Cw[s])return Ew;Cw[s]=ww()}return e=function(t,e,n){if("string"==typeof e){const i=n.time?function(t,e=8){const n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(n.total)):"";e=function(t,e,n){return!dw&&"string"==typeof t&&(e&&(e=mw(e),t="\x1b[".concat(e,"m").concat(t,"\x1b[39m")),n&&(e=mw(n),t="\x1b[".concat(n+10,"m").concat(t,"\x1b[49m"))),t}(e=n.time?"".concat(t,": ").concat(i," ").concat(e):"".concat(t,": ").concat(e),n.color,n.background)}return e}(this.id,r.message,r),n.bind(console,e,...r.args)}return Ew}}return t.VERSION=hw,t})();function Aw(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return bw(Number.isFinite(e)&&e>=0),e}function Pw(t){const{logLevel:e,message:n}=t;t.logLevel=Aw(e);const i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==n;);switch(t.args=i,typeof e){case"string":case"function":void 0!==n&&i.unshift(n),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());const r=typeof t.message;return bw("string"===r||"object"===r),Object.assign(t,t.opts)}var Iw=new kw({id:"deck"});const Mw={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mw,"IDENTITY",{get:()=>Iw.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Dw={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Rw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Nw=new kw({id:"luma.gl"});function Lw(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function jw(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version))}function Fw(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function Bw(t){return Lw(jw(t),"Invalid WebGLRenderingContext"),t}function Vw(t){return Lw(Fw(t),"Requires WebGL2"),t}var zw=n(84761);const Uw={};const Hw=function t(e){const n=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{zw.CO.console&&zw.CO.console.log&&zw.CO.console.log("OESVertexArrayObject emulation library context restored"),e.reset_()},!0),this.reset_()};$w.prototype.VERTEX_ARRAY_BINDING_OES=34229,$w.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;tFw(t)?void 0:0,Yw={3074:t=>Fw(t)?void 0:36064,35723:t=>Fw(t)?void 0:4352,35977:Xw,32937:Xw,36795:(t,e)=>{const n=Fw(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?e(n.GPU_DISJOINT_EXT):0},37445:(t,e)=>{const n=t.getExtension(qw);return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const n=t.getExtension(qw);return e(n&&n.UNMASKED_RENDERER_WEBGL||7937)},34047:(t,e)=>{const n=t.luma.extensions.EXT_texture_filter_anisotropic;return n?e(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:Xw,35071:Xw,37447:Xw,36063:(t,e)=>{if(!Fw(t)){const n=t.getExtension(Ww);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Xw,35374:Xw,35377:Xw,34852:t=>{if(!Fw(t)){const e=t.getExtension(Ww);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(Gw)?2147483647:65535,33001:t=>t.getExtension(Gw)?16777216:65535,33e3:t=>16777216,37157:Xw,35373:Xw,35657:Xw,36183:Xw,37137:Xw,34045:Xw,35978:Xw,35979:Xw,35968:Xw,35376:Xw,35375:Xw,35659:Xw,37154:Xw,35371:Xw,35658:Xw,35076:Xw,35077:Xw,35380:Xw},Kw="ANGLE_instanced_arrays",Qw={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Lw(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[Kw]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){Lw(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Lw(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Lw(!1)},deleteQuery:()=>{Lw(!1)},beginQuery:()=>{Lw(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},Zw={readBuffer:(t,e,n)=>{Fw(t)&&e(n)},getVertexAttrib:(t,e,n,i)=>{const{webgl2:r,ext:s}=function(t,e){return{webgl2:Fw(t),ext:t.getExtension("ANGLE_instanced_arrays")}}(t);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(n,i)},getProgramParameter:(t,e,n,i)=>{if(!Fw(t))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,i)},getInternalformatParameter:(t,e,n,i,r)=>{if(!Fw(t))switch(r){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(n,i,r)},getTexParameter(t,e,n,i){switch(i){case 34046:const{extensions:e}=t.luma,n=e.EXT_texture_filter_anisotropic;i=n&&n.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(n,i)},getParameter:function(t,e,n){const i=Yw[n],r="function"==typeof i?i(t,e,n):i;return void 0!==r?r:e(n)},hint:(t,e,n,i)=>e(n,i)};function Jw(t,{extension:e,target:n,target2:i}){const r=Qw[e];Lw(r);const{meta:s={}}=r,{suffix:o=""}=s,a=t.getExtension(e);for(const l of Object.keys(r)){const e=`${l}${o}`;let s=null;"meta"===l||"function"==typeof t[l]||(a&&"function"==typeof a[e]?s=(...t)=>a[e](...t):"function"==typeof r[l]&&(s=r[l].bind(n))),s&&(n[l]=s,i[l]=s)}}("undefined"!=typeof global?global:window).polyfillContext=function(t){t.luma=t.luma||{};const{luma:e}=t;return e.polyfilled||(function(t){if("function"==typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const n=t.getExtension;t.getExtension=function(e){return n.call(this,e)||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new $w(this)),this.__OESVertexArrayObject))}}(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const n of e)t.luma[n]=t.getExtension(n)}(t),function(t,e){for(const n of Object.getOwnPropertyNames(e))"overrides"!==n&&Jw(t,{extension:n,target:t.luma,target2:t})}(t,Qw),function(t,{target:e,target2:n}){Object.keys(Zw).forEach(i=>{if("function"==typeof Zw[i]){const r=t[i]?t[i].bind(t):()=>{},s=Zw[i].bind(null,t,r);e[i]=s,n[i]=s}})}(t,{target:e,target2:t}),e.polyfilled=!0),t};const tx={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ex=(t,e,n)=>e?t.enable(n):t.disable(n),nx=(t,e,n)=>t.hint(n,e),ix=(t,e,n)=>t.pixelStorei(n,e);function rx(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const sx={3042:ex,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:ex,2885:(t,e)=>t.cullFace(e),2929:ex,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:ex,35723:nx,36006:(t,e)=>{const n=Fw(t)?36009:36160;return t.bindFramebuffer(n,e)},2886:(t,e)=>t.frontFace(e),33170:nx,2849:(t,e)=>t.lineWidth(e),32823:ex,32824:"polygonOffset",10752:"polygonOffset",35977:ex,32938:"sampleCoverage",32939:"sampleCoverage",3089:ex,3088:(t,e)=>t.scissor(...e),2960:ex,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:ix,3317:ix,37440:ix,37441:ix,37443:ix,3330:ix,3332:ix,3331:ix,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:ix,32878:ix,3316:ix,3315:ix,32877:ix,framebuffer:(t,e)=>t.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=rx(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=rx(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=rx(e)?e:[e,e];const[n,i]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=rx(e)&&3===e.length?[...e,...e]:e;const[n,i,r,s,o,a]=e;t.stencilFuncSeparate(1028,n,i,r),t.stencilFuncSeparate(1029,s,o,a)},stencilOp:(t,e)=>{e=rx(e)&&3===e.length?[...e,...e]:e;const[n,i,r,s,o,a]=e;t.stencilOpSeparate(1028,n,i,r),t.stencilOpSeparate(1029,s,o,a)},viewport:(t,e)=>t.viewport(...e)};function ox(t,e,n){return void 0!==e[t]?e[t]:n[t]}const ax={blendEquation:(t,e,n)=>t.blendEquationSeparate(ox(32777,e,n),ox(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(ox(32969,e,n),ox(32968,e,n),ox(32971,e,n),ox(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(ox(32824,e,n),ox(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(ox(32938,e,n),ox(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,ox(2962,e,n),ox(2967,e,n),ox(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,ox(34816,e,n),ox(36003,e,n),ox(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,ox(2964,e,n),ox(2965,e,n),ox(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,ox(34817,e,n),ox(34818,e,n),ox(34819,e,n))},lx={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},blendColor:(t,e,n,i,r)=>t({32773:new Float32Array([e,n,i,r])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,i,r)=>t({32969:e,32968:n,32971:i,32970:r}),clearColor:(t,e,n,i,r)=>t({3106:new Float32Array([e,n,i,r])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,i,r)=>t({3107:[e,n,i,r]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,i,r)=>t({3088:new Int32Array([e,n,i,r])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[1028===e?2968:36005]:n}),stencilFunc:(t,e,n,i)=>t({2962:e,2967:n,2963:i,34816:e,36003:n,36004:i}),stencilFuncSeparate:(t,e,n,i,r)=>t({[1028===e?2962:34816]:n,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(t,e,n,i)=>t({2964:e,2965:n,2966:i,34817:e,34818:n,34819:i}),stencilOpSeparate:(t,e,n,i,r)=>t({[1028===e?2964:34817]:n,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(t,e,n,i,r)=>t({2978:[e,n,i,r]})},cx=(t,e)=>t.isEnabled(e),ux={3042:cx,2884:cx,2929:cx,3024:cx,32823:cx,32926:cx,32928:cx,3089:cx,2960:cx,35977:cx};function hx(t){for(const e in t)return!1;return!0}function dx(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&i&&t.length===e.length){for(let n=0;n{})}={}){this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?function(t,e){if("number"==typeof(e=e||tx)){const n=e,i=ux[n];return i?i(t,n):t.getParameter(n)}const n=Array.isArray(e)?e:Object.keys(e),i={};for(const r of n){const e=ux[r];i[r]=e?e(t,Number(r)):t.getParameter(Number(r))}return i}(t):Object.assign({},tx),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(t={}){this.stateStack.push({})}pop(){Lw(this.stateStack.length>0),yx(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(t){let e,n=!1;const i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const r in t){Lw(void 0!==r);const s=t[r],o=this.cache[r];dx(s,o)||(n=!0,e=o,i&&!(r in i)&&(i[r]=o),this.cache[r]=s)}return{valueChanged:n,oldValue:e}}}function mx(t,e={}){const{enable:n=!0,copyState:i}=e;if(Lw(void 0!==i),!t.state){const e="undefined"!=typeof global?global:window,{polyfillContext:n}=e;n&&n(t),t.state=new gx(t,{copyState:i}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(e(n),t.state.program=n)}}(t);for(const i in lx)fx(t,i,lx[i]);px(t,"getParameter"),px(t,"isEnabled")}return t.state.enable=n,t}function bx(t){Lw(t.state),t.state.pop()}function yx(t,e){if(Lw(jw(t),"setParameters requires a WebGL context"),hx(e))return;const n={};for(const r in e){const i=Number(r),s=sx[r];s&&("string"==typeof s?n[s]=!0:s(t,e[r],i))}const i=t.state&&t.state.cache;if(i)for(const r in n)ax[r](t,e,i)}function vx(t,e,n){if(hx(e))return n(t);const{nocatch:i=!0}=e;let r;if(function(t){t.state||mx(t,{copyState:!1}),t.state.push()}(t),yx(t,e),i)r=n(t),bx(t);else try{r=n(t)}finally{bx(t)}return r}function _x(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:n}=e.canvasSizeInfo;return n?t.drawingBufferWidth/n:1}return 1}function wx(t,e,n=!0){return function(t,e,n,i,r){const s=xx(t[0],e,n);let o=Sx(t[1],e,i,r),a=xx(t[0]+1,e,n);const l=a===n-1?a:a-1;let c;return a=Sx(t[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,_x(t),t.drawingBufferWidth,t.drawingBufferHeight,n)}function xx(t,e,n){return Math.min(Math.round(t*e),n-1)}function Sx(t,e,n,i){return i?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const Ex=(0,zw.jU)(),Cx=Ex&&"undefined"!=typeof document,Ox={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Tx(t={}){Lw(Ex,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},Ox,t);const{width:e,height:n}=t;function i(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let r;t.onError=i;const{canvas:s}=t,o=function({canvas:t,width:e=800,height:n=600,onError:i}){let r;return"string"==typeof t?(Cx&&"complete"===document.readyState||i(`createGLContext called on canvas '${t}' before page was loaded`),r=document.getElementById(t)):t?r=t:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(n)?`${n}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:n,onError:i});return r=function(t,e){const{onError:n}=e;let i=null;const r=t=>i=t.statusMessage||i;t.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||t.getContext("webgl2",e),a=a||t.getContext("experimental-webgl2",e)),s&&(a=a||t.getContext("webgl",e),a=a||t.getContext("experimental-webgl",e)),t.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):n(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,t),r?(r=kx(r,t),function(t){const e=Fw(t)?"WebGL2":"WebGL1",n=function(t){const e=t.getParameter(7936),n=t.getParameter(7937),i=t.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&t.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&t.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:e,rendererMasked:n,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t);Nw.info(1,`${e}${t.debug?" debug":""} context ${n?`(${n.vendor},${n.renderer})`:""}`)()}(r),r):null}function kx(t,e={}){if(!t||t._instrumented)return t;t._version=t._version||function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext?2:1}(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},Ox,e);const{manageState:n,debug:i}=e;return n&&mx(t,{copyState:!1,log:(...t)=>Nw.log(1,...t)()}),Ex&&i&&(zw.CO.makeDebugContext?(t=zw.CO.makeDebugContext(t,e),Nw.level=Math.max(Nw.level,1)):Nw.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function Ax(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}class Px{constructor(t,e){this.name=t,this.type=e,this.sampleSize=1,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ax(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ax()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class Ix{constructor({id:t,stats:e}){this.id=t,this.stats={},this._initializeStats(e),Object.seal(this)}get(t,e="count"){return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach(e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(t=>this._getOrCreate(t))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:n}=t;return this.stats[e]||(this.stats[e]=t instanceof Px?t:new Px(e,n)),this.stats[e]}}const Mx="8.5.7",Dx=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new Ix({id:t})),this.stats.get(t)}};if(zw.CO.luma&&zw.CO.luma.VERSION!==Mx)throw new Error(`luma.gl - multiple VERSIONs detected: ${zw.CO.luma.VERSION} vs 8.5.7`);function Rx(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Nx(t,e){if("string"!=typeof e)return e;const n=Number(e);if(!isNaN(n))return n;const i=t[e=e.replace(/^.*\./,"")];return Rx(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Lx(t,e){e=Number(e);for(const n in t)if(t[n]===e)return`GL.${n}`;return String(e)}zw.CO.luma||((0,zw.jU)()&&Nw.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),zw.CO.luma=zw.CO.luma||{VERSION:Mx,version:Mx,log:Nw,stats:Dx,globals:{modules:{},nodeIO:{}}});const jx={};function Fx(t="id"){return jx[t]=jx[t]||1,`${t}-${jx[t]++}`}function Bx(t){return Rx("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function Vx(t){let e=!0;for(const n in t){e=!1;break}return e}function zx(t,e,n,i){const r=`See luma.gl ${n} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(t);i.forEach(t=>{s.methodName||(s[t]=()=>{throw Nw.removed(`Calling removed method ${e}.${t}: `,r)(),new Error(t)})})}const Ux="Resource subclass must define virtual methods";class Hx{constructor(t,e={}){Bw(t);const{id:n,userData:i={}}=e;this.gl=t,this.gl2=t,this.id=n||Fx(this.constructor.name),this.userData=i,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:t=!1}={}){const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEach(t=>t.delete()),this}bind(t=this.handle){if("function"!=typeof t)return this._bindHandle(t),this;let e;return this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e}unbind(){this.bind(null)}getParameter(t,e={}){Rx(t=Nx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Fw(this.gl);if("webgl2"in n&&!t||"extension"in n&&!this.gl.getExtension(n.extension)){const e=n.webgl1,i="webgl2"in n?n.webgl2:n.webgl1;return t?i:e}}return this._getParameter(t,e)}getParameters(t={}){const{parameters:e,keys:n}=t,i=this.constructor.PARAMETERS||{},r=Fw(this.gl),s={},o=e||Object.keys(i);for(const a of o){const e=i[a];if(e&&(!("webgl2"in e)||r)&&(!("extension"in e)||this.gl.getExtension(e.extension))){const i=n?Lx(this.gl,a):a;s[i]=this.getParameter(a,t),n&&"GLenum"===e.type&&(s[i]=Lx(this.gl,s[i]))}}return s}setParameter(t,e){Rx(t=Nx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Fw(this.gl);if("webgl2"in n&&!t||"extension"in n&&!this.gl.getExtension(n.extension))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(e=Nx(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,n){return zx(this,t,e,n)}initialize(t){}_createHandle(){throw new Error(Ux)}_deleteHandle(){throw new Error(Ux)}_bindHandle(t){throw new Error(Ux)}_getOptsFromHandle(){throw new Error(Ux)}_getParameter(t,e){throw new Error(Ux)}_setParameter(t,e){throw new Error(Ux)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this.constructor.name,e=Dx.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}_removeStats(){const t=this.constructor.name;Dx.get("Resource Counts").get(`${t}s Active`).decrementCount()}_trackAllocatedMemory(t,e=this.constructor.name){const n=Dx.get("Memory Usage");n.get("GPU Memory").addCount(t),n.get(`${e} Memory`).addCount(t),this.byteLength=t}_trackDeallocatedMemory(t=this.constructor.name){const e=Dx.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get(`${t} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function $x(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Gx(t,{clamped:e=!0}={}){switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function Wx({data:t,width:e,height:n}){const i=Math.round(e/2),r=Math.round(n/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Kx.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Kx.getBytesPerVertex(this)}_assign(t={}){return void 0!==(t=qx("Accessor",t,Yx)).type&&(this.type=t.type,(5124===t.type||5125===t.type)&&(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&(this.index="boolean"==typeof t.index?t.index?1:0:t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}const Qx={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},Zx={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Qx},Jx={removedProps:Qx};class tS extends Hx{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(t=this.accessor){return Math.round(this.byteLength/Kx.getBytesPerElement(t))}getVertexCount(t=this.accessor){return Math.round(this.byteLength/Kx.getBytesPerVertex(t))}initialize(t={}){return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=qx("Buffer",t,Zx),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=qx("Buffer",t,Jx))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new Kx(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:n=0,srcOffset:i=0}=t,r=t.byteLength||t.length;Rx(e);const s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==i||void 0!==r?(Vw(this.gl),this.gl.bufferSubData(this.target,n,e,i,r)):this.gl.bufferSubData(s,n,e),this.gl.bindBuffer(s,null),this.debugData=null,this._inferType(e),this}copyData({sourceBuffer:t,readOffset:e=0,writeOffset:n=0,size:i}){const{gl:r}=this;return Vw(r),r.bindBuffer(36662,t.handle),r.bindBuffer(36663,this.handle),r.copyBufferSubData(36662,36663,e,n,i),r.bindBuffer(36662,null),r.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:t=null,srcByteOffset:e=0,dstOffset:n=0,length:i=0}={}){Vw(this.gl);const r=Gx(this.accessor.type||5126,{clamped:!1}),s=this._getAvailableElementCount(e),o=n;let a,l;t?(l=t.length,a=l-o):(a=Math.min(s,i||s),l=o+a);const c=Math.min(s,a);return Rx((i=i||c)<=c),t=t||new r(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,n,i),this.gl.bindBuffer(36662,null),t}bind({target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:n=0,size:i}={}){return 35345===t||35982===t?void 0!==i?this.gl.bindBufferRange(t,e,this.handle,n,i):(Rx(0===n),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind({target:t=this.target,index:e=this.accessor&&this.accessor.index}={}){return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t,e=0,n=t.byteLength+e){Rx(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const i=this._getTarget();this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,this.usage),this.gl.bufferSubData(i,e,t),this.gl.bindBuffer(i,null),this.debugData=t.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n);const r=$x(t);return Rx(r),this.setAccessor(new Kx(this.accessor,{type:r})),this}_setByteLength(t,e=this.usage){Rx(t>=0),this._trackDeallocatedMemory();let n=t;0===t&&(n=new Float32Array(0));const i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,e),this.gl.bindBuffer(i,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/Gx(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new Kx(this.accessor,{type:$x(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return Nw.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return Nw.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return Nw.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return Nw.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Kx(this.accessor,t),this}}const eS={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},nS={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},iS={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},rS=[9729,9728],sS=zw.CO.WebGLBuffer||function(){};class oS extends Hx{static isSupported(t,e={}){const{format:n,linearFiltering:i}=e;let r=!0;return n&&(r=r&&function(t,e){const n=eS[e];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;const i=Fw(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}(t,n),r=r&&(!i||function(t,e){const n=eS[e];switch(n&&n.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}(t,n))),r}constructor(t,e){const{id:n=Fx("texture"),handle:i,target:r}=e;super(t,{id:n,handle:i}),this.target=r,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(t={}){let e=t.data;if(e instanceof Promise)return e.then(e=>this.initialize(Object.assign({},t,{pixels:e,data:e}))),this;const n="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(n&&e.readyStatethis.initialize(t)),this;const{pixels:i=null,format:r=6408,border:s=0,recreate:o=!1,parameters:a={},pixelStore:l={},textureUnit:c}=t;e||(e=i);let{width:u,height:h,dataFormat:d,type:p,compressed:f=!1,mipmaps:g=!0}=t;const{depth:m=0}=t;return({width:u,height:h,compressed:f,dataFormat:d,type:p}=this._deduceParameters({format:r,type:p,dataFormat:d,compressed:f,data:e,width:u,height:h})),this.width=u,this.height=h,this.depth=m,this.format=r,this.type=p,this.dataFormat=d,this.border=s,this.textureUnit=c,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),g&&this._isNPOT()&&(Nw.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),g=!1,this._updateForNPOT(a)),this.mipmaps=g,this.setImageData({data:e,width:u,height:h,depth:m,format:r,type:p,dataFormat:d,border:s,mipmaps:g,parameters:l,compressed:f}),g&&this.generateMipmap(),this.setParameters(a),o&&(this.data=e),n&&(this._video={video:e,parameters:a,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:n}=this._video;if(n===t.currentTime||t.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:n=null,level:i=0,format:r=this.format,border:s=this.border,offset:o=0,parameters:a={}}=t;let{data:l=null,type:c=this.type,width:u=this.width,height:h=this.height,dataFormat:d=this.dataFormat,compressed:p=!1}=t;l||(l=n),({type:c,dataFormat:d,compressed:p,width:u,height:h}=this._deduceParameters({format:r,type:c,dataFormat:d,compressed:p,data:l,width:u,height:h}));const{gl:f}=this;f.bindTexture(this.target,this.handle);let g,m=null;return({data:l,dataType:m}=this._getDataType({data:l,compressed:p})),vx(this.gl,a,()=>{switch(m){case"null":f.texImage2D(e,i,r,u,h,s,d,c,l);break;case"typed-array":f.texImage2D(e,i,r,u,h,s,d,c,l,o);break;case"buffer":g=Vw(f),g.bindBuffer(35052,l.handle||l),g.texImage2D(e,i,r,u,h,s,d,c,o),g.bindBuffer(35052,null);break;case"browser-object":Fw(f)?f.texImage2D(e,i,r,u,h,s,d,c,l):f.texImage2D(e,i,r,d,c,l);break;case"compressed":for(const[t,n]of l.entries())f.compressedTexImage2D(e,t,n.format,n.width,n.height,s,n.data);break;default:Rx(!1,"Unknown image data type")}}),this._trackAllocatedMemory(l&&l.byteLength?l.byteLength:this.width*this.height*(nS[this.dataFormat]||4)*(iS[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:t=this.target,pixels:e=null,data:n=null,x:i=0,y:r=0,width:s=this.width,height:o=this.height,level:a=0,format:l=this.format,type:c=this.type,dataFormat:u=this.dataFormat,compressed:h=!1,offset:d=0,border:p=this.border,parameters:f={}}){if(({type:c,dataFormat:u,compressed:h,width:s,height:o}=this._deduceParameters({format:l,type:c,dataFormat:u,compressed:h,data:n,width:s,height:o})),Rx(0===this.depth,"texSubImage not supported for 3D textures"),n||(n=e),n&&n.data){const t=n;n=t.data,s=t.shape[0],o=t.shape[1]}n instanceof tS&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),vx(this.gl,f,()=>{if(h)this.gl.compressedTexSubImage2D(t,a,i,r,s,o,l,n);else if(null===n)this.gl.texSubImage2D(t,a,i,r,s,o,u,c,null);else if(ArrayBuffer.isView(n))this.gl.texSubImage2D(t,a,i,r,s,o,u,c,n,d);else if(n instanceof sS){const e=Vw(this.gl);e.bindBuffer(35052,n),e.texSubImage2D(t,a,i,r,s,o,u,c,d),e.bindBuffer(35052,null)}else Fw(this.gl)?Vw(this.gl).texSubImage2D(t,a,i,r,s,o,u,c,n):this.gl.texSubImage2D(t,a,i,r,u,c,n)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(t={}){return Nw.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType({data:t,compressed:e=!1}){return e?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof tS?{data:t.handle,dataType:"buffer"}:t instanceof sS?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:n}=t;let{width:i,height:r,dataFormat:s,type:o,compressed:a}=t;const l=eS[e];return s=s||l&&l.dataFormat,o=o||l&&l.types[0],a=a||l&&l.compressed,({width:i,height:r}=this._deduceImageSize(n,i,r)),{dataFormat:s,type:o,compressed:a,width:i,height:r,format:e,data:n}}_deduceImageSize(t,e,n){let i;return i="undefined"!=typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:n}:{width:e>=0?e:1,height:n>=0?n:1},Rx(i,"Could not deduced texture size"),Rx(void 0===e||i.width===e,"Deduced texture width does not match supplied width"),Rx(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Rx(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Fw(this.gl)||!this.width||!this.height||Bx(this.width)&&Bx(this.height))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===rS.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}function aS(t,e){return Rx("string"==typeof t),t=""+t,new Promise((n,i)=>{try{const r=new Image;r.onload=()=>n(r),r.onerror=()=>i(new Error(`Could not load image ${t}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=t}catch(r){i(r)}})}class lS extends oS{static isSupported(t,e){return oS.isSupported(t,e)}constructor(t,e={}){Bw(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:aS(e.data)})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}const cS="EXT_color_buffer_float";var uS={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:cS,bpp:2},33327:{gl2:cS,bpp:4},34842:{gl2:cS,bpp:8},33326:{gl2:cS,bpp:4},33328:{gl2:cS,bpp:8},34836:{gl2:cS,bpp:16},35898:{gl2:cS,bpp:4}};class hS extends Hx{static isSupported(t,{format:e}={format:null}){return!e||function(t,e,n){const i=n[e];if(!i)return!1;const r=Fw(t)&&i.gl2||i.gl1;return"string"==typeof r?t.getExtension(r):r}(t,e,uS)}static getSamplesForFormat(t,{format:e}){return t.getInternalformatParameter(36161,e,32937)}constructor(t,e={}){super(t,e),this.initialize(e),Object.seal(this)}initialize({format:t,width:e=1,height:n=1,samples:i=0}){return Rx(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==i&&Fw(this.gl)?this.gl.renderbufferStorageMultisample(36161,i,t,e,n):this.gl.renderbufferStorage(36161,t,e,n),this.format=t,this.width=e,this.height=n,this.samples=i,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*uS[this.format].bpp),this}resize({width:t,height:e}){return t!==this.width||e!==this.height?this.initialize({width:t,height:e,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}const dS="clear: bad arguments";function pS(t,{framebuffer:e=null,color:n=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;n&&(o|=16384,!0!==n&&(s.clearColor=n)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),Rx(0!==o,dS),vx(t,s,()=>{t.clear(o)})}function fS(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function gS(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var s=t.apply(e,n);function o(t){fS(s,i,r,o,a,"next",t)}function a(t){fS(s,i,r,o,a,"throw",t)}o(void 0)})}}const mS=[34069,34070,34071,34072,34073,34074];let bS=(()=>{class t extends oS{constructor(t,e={}){Bw(t),super(t,Object.assign({},e,{target:34067})),this.initialize(e),Object.seal(this)}initialize(t={}){const{mipmaps:e=!0,parameters:n={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(n)}),this}subImage({face:t,data:e,x:n=0,y:i=0,mipmapLevel:r=0}){return this._subImage({target:t,data:e,x:n,y:i,mipmapLevel:r})}setCubeMapImageData({width:t,height:e,pixels:n,data:i,border:r=0,format:s=6408,type:o=5121}){var a=this;return gS(function*(){const{gl:l}=a,c=n||i,u=yield Promise.all(mS.map(t=>{const e=c[t];return Promise.all(Array.isArray(e)?e:[e])}));a.bind(),mS.forEach((n,i)=>{u[i].length>1&&!1!==a.opts.mipmaps&&Nw.warn(`${a.id} has mipmap and multiple LODs.`)(),u[i].forEach((i,a)=>{t&&e?l.texImage2D(n,a,s,t,e,r,s,o,i):l.texImage2D(n,a,s,s,o,i)})}),a.unbind()})()}setImageDataForFace(t){const{face:e,width:n,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}=t,{gl:c}=this,u=r||s;return this.bind(),u instanceof Promise?u.then(n=>this.setImageDataForFace(Object.assign({},t,{face:e,data:n,pixels:n}))):this.width||this.height?c.texImage2D(e,0,a,n,i,o,a,l,u):c.texImage2D(e,0,a,a,l,u),this}}return t.FACES=mS,t})();class yS extends oS{static isSupported(t){return Fw(t)}constructor(t,e={}){Vw(t),super(t,e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1})),this.initialize(e),Object.seal(this)}setImageData({level:t=0,dataFormat:e=6408,width:n,height:i,depth:r=1,border:s=0,format:o,type:a=5121,offset:l=0,data:c,parameters:u={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),vx(this.gl,u,()=>{ArrayBuffer.isView(c)&&this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,c),c instanceof tS&&(this.gl.bindBuffer(35052,c.handle),this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,l))}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*this.depth*(nS[this.dataFormat]||4)*(iS[this.type]||1),"Texture"),this.loaded=!0,this}}function vS(t,e){const{gl:n,width:i,height:r,id:s}=t;return new SS(n,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:t}}))}function _S(t,e={}){const{sourceX:n=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:u,deleteFramebuffer:h}=function(t){return t instanceof SS?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:vS(t),deleteFramebuffer:!0}}(t);Rx(u);const{gl:d,handle:p,attachments:f}=u;a=a||u.width,l=l||u.height,36064===s&&null===p&&(s=1028),Rx(f[s]),c=c||f[s].type,o=function(t,e,n,i,r){if(t)return t;return new(Gx(e=e||5121,{clamped:!1}))(i*r*function(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Rx(!1),0}}(n))}(o,c,r,a,l),c=c||$x(o);const g=d.bindFramebuffer(36160,p);return d.readPixels(n,i,a,l,r,c,o),d.bindFramebuffer(36160,g||null),h&&u.delete(),o}function wS(t,{sourceAttachment:e=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}={}){let i=_S(t,{sourceAttachment:e}),{width:r,height:s}=t;for(;s>n;)({data:i,width:r,height:s}=Wx({data:i,width:r,height:s}));!function({data:t,width:e,height:n,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&e>=0,"Width and height need to be integers"),this.width=t,this.height=e,n)for(const c in n){const i=n[c];(Array.isArray(i)?i[0]:i).resize({width:t,height:e})}else n=this._createDefaultAttachments(i,r,s,t,e);this.update({clearAttachments:!0,attachments:n,readBuffer:a,drawBuffers:l}),n&&o&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update({attachments:t={},readBuffer:e,drawBuffers:n,clearAttachments:i=!1,resizeAttachments:r=!0}){this.attach(t,{clearAttachments:i,resizeAttachments:r});const{gl:s}=this,o=s.bindFramebuffer(36160,this.handle);return e&&this._setReadBuffer(e),n&&this._setDrawBuffers(n),s.bindFramebuffer(36160,o||null),this}resize(t={}){let{width:e,height:n}=t;if(null===this.handle)return Rx(void 0===e&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),e!==this.width&&n!==this.height&&Nw.log(2,`Resizing framebuffer ${this.id} to ${e}x${n}`)();for(const i in this.attachments)this.attachments[i].resize({width:e,height:n});return this.width=e,this.height=n,this}attach(t,{clearAttachments:e=!1,resizeAttachments:n=!0}={}){const i={};e&&Object.keys(this.attachments).forEach(t=>{i[t]=null}),Object.assign(i,t);const r=this.gl.bindFramebuffer(36160,this.handle);for(const s in i){Rx(void 0!==s,"Misspelled framebuffer binding point?");const t=Number(s),e=i[t];let r=e;if(r)if(r instanceof hS)this._attachRenderbuffer({attachment:t,renderbuffer:r});else if(Array.isArray(e)){const[n,i=0,s=0]=e;r=n,this._attachTexture({attachment:t,texture:n,layer:i,level:s})}else this._attachTexture({attachment:t,texture:r,layer:0,level:0});else this._unattach(t);n&&r&&r.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,r||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter(t=>!this.attachments[t]).forEach(t=>{delete this.attachments[t]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(t){return(SS.STATUS||{})[t]||`Framebuffer error ${t}`}(t));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),n=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),n}clear(t={}){const{color:e,depth:n,stencil:i,drawBuffers:r=[]}=t,s=this.gl.bindFramebuffer(36160,this.handle);return(e||n||i)&&pS(this.gl,{color:e,depth:n,stencil:i}),r.forEach((t,e)=>{!function(t,{framebuffer:e=null,buffer:n=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Vw(t),vx(t,{framebuffer:e},()=>{switch(n){case 6144:switch(r.constructor){case Int32Array:t.clearBufferiv(n,i,r);break;case Uint32Array:t.clearBufferuiv(n,i,r);break;case Float32Array:default:t.clearBufferfv(n,i,r)}break;case 6145:t.clearBufferfv(6145,0,[r]);break;case 6146:t.clearBufferiv(6146,0,[r]);break;case 34041:const[e,s]=r;t.clearBufferfi(34041,0,e,s);break;default:Rx(!1,dS)}})}(this.gl,{drawBuffer:e,value:t})}),this.gl.bindFramebuffer(36160,s||null),this}readPixels(t={}){return Nw.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(t={}){return Nw.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(t={}){return Nw.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(t={}){return Nw.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(t={}){return Nw.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(t={}){return Nw.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:t=[],x:e=0,y:n=0,width:i,height:r}){const s=Vw(this.gl),o=s.bindFramebuffer(36008,this.handle);return 0===e&&0===n&&void 0===i&&void 0===r?s.invalidateFramebuffer(36008,t):s.invalidateFramebuffer(36008,t,e,n,i,r),s.bindFramebuffer(36008,o),this}getAttachmentParameter(t,e,n){let i=this._getAttachmentParameterFallback(e);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Lx(this.gl,i)),i}getAttachmentParameters(t=36064,e,n=this.constructor.ATTACHMENT_PARAMETERS||[]){const i={};for(const r of n)i[e?Lx(this.gl,r):r]=this.getAttachmentParameter(t,r,e);return i}getParameters(t=!0){const e=Object.keys(this.attachments),n={};for(const i of e){const e=Number(i);n[t?Lx(this.gl,e):e]=this.getAttachmentParameters(e,t)}return n}show(){return"undefined"!=typeof window&&window.open(wS(this),"luma-debug-texture"),this}log(t=0,e=""){if(t>Nw.level||"undefined"==typeof window)return this;e=e||`Framebuffer ${this.id}`;const n=wS(this,{targetMaxHeight:100});return Nw.image({logLevel:t,message:e,image:n},e)(),this}bind({target:t=36160}={}){return this.gl.bindFramebuffer(t,this.handle),this}unbind({target:t=36160}={}){return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,n,i,r){let s=null;return t&&(s=s||{},s[36064]=new lS(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(s[36064])),e&&n?(s=s||{},s[33306]=new hS(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:i,height:111}),this.ownResources.push(s[33306])):e?(s=s||{},s[36096]=new hS(this.gl,{id:`${this.id}-depth`,format:33189,width:i,height:r}),this.ownResources.push(s[36096])):n&&Rx(!1),s}_unattach(t){const e=this.attachments[t];!e||(e instanceof hS?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer({attachment:t=36064,renderbuffer:e}){const{gl:n}=this;n.framebufferRenderbuffer(36160,t,36161,e.handle),this.attachments[t]=e}_attachTexture({attachment:t=36064,texture:e,layer:n,level:i}){const{gl:r}=this;switch(r.bindTexture(e.target,e.handle),e.target){case 35866:case 32879:Vw(r).framebufferTextureLayer(36160,t,e.target,i,n);break;case 34067:const s=function(t){return t<34069?t+34069:t}(n);r.framebufferTexture2D(36160,t,s,e.handle,i);break;case 3553:r.framebufferTexture2D(36160,t,3553,e.handle,i);break;default:Rx(!1,"Illegal texture type")}r.bindTexture(e.target,null),this.attachments[t]=e}_setReadBuffer(t){const e=function(t){return Fw(t)?t:null}(this.gl);e?e.readBuffer(t):Rx(36064===t||1029===t,xS),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,n=Vw(e);if(n)n.drawBuffers(t);else{const n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Rx(1===t.length&&(36064===t[0]||1029===t[0]),xS)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=function(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in ES)void 0===t.luma.caps[e]&&(t.luma.caps[e]=TS(t,e));return t.luma.caps}(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}SS.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var ES={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(t){const e=new lS(t,{format:6408,type:5126,dataFormat:6408}),n=new SS(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=n.getStatus();return e.delete(),n.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function CS(t,e){return OS(t,e)}function OS(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>TS(t,e))}function TS(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const n=ES[e];let i;Rx(n,e);const r=Fw(t)&&n[1]||n[0];if("function"==typeof r)i=r(t);else if(Array.isArray(r)){i=!0;for(const e of r)i=i&&Boolean(t.getExtension(e))}else"string"==typeof r?i=Boolean(t.getExtension(r)):"boolean"==typeof r?i=r:Rx(!1);return i}(t,e)),t.luma.caps[e]||Nw.log(2,`Feature: ${e} not supported`)(),t.luma.caps[e]}class kS{constructor(t,e){this.opts=e,this.source=t}get value(){return this.source.value}getValue(){const t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];const{value:n}=this.source,{size:i}=e;let r=n;if(n&&n.length!==i){r=new Float32Array(i);const t=e.elementOffset||0;for(let e=0;ei&&(r=i);const s=this._pool,o=t.BYTES_PER_ELEMENT*r,a=s.findIndex(t=>t.byteLength>=o);if(a>=0){const e=new t(s.splice(a,1)[0],0,r);return n&&e.fill(0),e}return new t(r)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:n}=t,{byteLength:i}=n,r=e.findIndex(t=>t.byteLength>=i);r<0?e.push(n):(r>0||e.lengththis.props.poolSize&&e.shift()}};Math;const PS=1/180*Math.PI,IS={};function MS(t,{precision:e=IS.precision||4}={}){return t=function(t){return Math.round(t/IS.EPSILON)*IS.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function DS(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function RS(t,e,n){if(DS(t)){n=n||function(t){return t.clone?t.clone():new Array(t.length)}(t);for(let i=0;it*PS,void 0)}(t)}function LS(t,e,n){return RS(t,t=>Math.max(e,Math.min(n,t)))}function jS(t,e,n){return DS(t)?t.map((t,i)=>jS(t,e[i],n)):n*e+(1-n)*t}function FS(t,e,n){const i=IS.EPSILON;n&&(IS.EPSILON=n);try{if(t===e)return!0;if(DS(t)&&DS(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+MS(this[n],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e=0&&t=0&&t0&&(dE.length=t.length,i=dE):i=hE,(e>0||Number.isFinite(n))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,n),r.index=e-1),{iterable:i,objectInfo:r}}function fE(t){return t&&t[Symbol.asyncIterator]}function gE(t,e=(()=>!0)){return Array.isArray(t)?mE(t,e,[]):e(t)?[t]:[]}function mE(t,e,n){let i=-1;for(;++ia)return void e.set(t.subarray(0,a),n);if(e.set(t,n),!s)return;let l=o;for(;lt},spring:{stiffness:.05,damping:.5}};function xE(t,e){return t?(Number.isFinite(t)&&(t={duration:t}),t.type=t.type||"interpolation",bt(bt(bt({},wE[t.type]),e),t)):null}function SE(t,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function EE(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function CE(t){t.push(t.shift())}function OE(t,e){const{doublePrecision:n,settings:i,value:r,size:s}=t,o=n&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function TE({buffer:t,numInstances:e,attribute:n,fromLength:i,fromStartIndices:r,getData:s=(t=>t)}){const o=n.doublePrecision&&n.value instanceof Float64Array?2:1,a=n.size*o,l=n.byteOffset,c=n.startIndices,u=r&&c,h=OE(n,e),d=n.state.constant;if(!u&&i>=h)return;const p=d?n.value:n.getBuffer().getData({srcByteOffset:l});if(n.settings.normalized&&!d){const t=s;s=(e,i)=>n._normalizeConstant(t(e,i))}const f=d?(t,e)=>s(p,e):(t,e)=>s(p.subarray(t,t+a),e),g=t.getData({length:i}),m=new Float32Array(h);(function({source:t,target:e,size:n,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return _E({source:t,target:e,size:n,getData:i}),e;let o=0,a=0;const l=i&&((t,e)=>i(t+a,e)),c=Math.min(r.length,s.length);for(let u=1;u(t+128)/255*2-1);case 5122:return new Float32Array(t).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(t).map(t=>t/255);case 5123:return new Float32Array(t).map(t=>t/65535);default:return t}}_normalizeValue(t,e,n){const{defaultValue:i,size:r}=this.settings;if(Number.isFinite(t))return e[n]=t,e;if(!t)return e[n]=i[0],e;switch(r){case 4:e[n+3]=Number.isFinite(t[3])?t[3]:i[3];case 3:e[n+2]=Number.isFinite(t[2])?t[2]:i[2];case 2:e[n+1]=Number.isFinite(t[1])?t[1]:i[1];case 1:e[n+0]=Number.isFinite(t[0])?t[0]:i[0];break;default:let s=r;for(;--s>=0;)e[n+s]=Number.isFinite(t[s])?t[s]:i[s]}return e}_areValuesEqual(t,e){if(!t||!e)return!1;const{size:n}=this;for(let i=0;it[e])]:t[e],n)}setNeedsUpdate(t=this.id,e){if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){const{startRow:t=0,endRow:n=1/0}=e;this.state.updateRanges=function(t,e){if(t===vE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return t;const n=[],i=t.length;let r=0;for(let s=0;se[1]?n.push(i):e=[Math.min(i[0],e[0]),Math.max(i[1],e[1])]}return n.splice(r,0,e),n}(this.state.updateRanges,[t,n])}else this.state.updateRanges=vE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=yE}setNeedsRedraw(t=this.id){this.state.needsRedraw=this.state.needsRedraw||t}update(t){this.setData(t)}allocate(t){const{state:e,settings:n}=this;return!n.noAlloc&&!!n.update&&(super.allocate({numInstances:t,copy:e.updateRanges!==vE}),!0)}updateBuffer({numInstances:t,data:e,props:n,context:i}){if(!this.needsUpdate())return!1;const{state:{updateRanges:r},settings:{update:s,noAlloc:o}}=this;let a=!0;if(s){for(const[o,a]of r)s.call(i,this,{data:e,startRow:o,endRow:a,props:n,numInstances:t});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const n=i*a+l;for(let i=0;ic?l.set(e,f):(t._normalizeValue(e,m.target,0),bE({target:l,source:m.target,start:f,count:n}));f+=n*c}else t._normalizeValue(e,l,f),f+=c}}_validateAttributeUpdaters(){const{settings:t}=this;if(!t.noAlloc&&"function"!=typeof t.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:t}=this,e=Math.min(4,this.size);if(t&&t.length>=e){let n=!0;switch(e){case 4:n=n&&Number.isFinite(t[3]);case 3:n=n&&Number.isFinite(t[2]);case 2:n=n&&Number.isFinite(t[1]);case 1:n=n&&Number.isFinite(t[0]);break;default:n=!1}if(!n)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let AE={};function PE(t){Iw.level>0&&AE[t]&&AE[t].call(...arguments)}function IE(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const ME="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",DE=`#version 300 es\n${ME}`;function RE(t,e){e=Array.isArray(e)?e:[e];const n=t.replace(/^\s+/,"").split(/\s+/),[i,r,s]=n;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function NE(t={}){const{version:e=100,input:n,inputType:i,output:r}=t;if(!n)return 300===e?DE:e>300?`#version ${e}\n${ME}`:"void main() {gl_FragColor = vec4(0);}";const s=function(t,e){switch(e){case"float":return`vec4(${t}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${t}, 0.0, 1.0)`;case"vec3":return`vec4(${t}, 1.0)`;case"vec4":return t;default:return IE(!1),null}}(n,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${n};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${n};\nvoid main() {\n gl_FragColor = ${s};\n}`}class LE extends Hx{static isSupported(t){return Fw(t)}constructor(t,e={}){Vw(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(t={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Vx(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(t={}){return this.bind(()=>{for(const e in t)this.setBuffer(e,t[e])}),this}setBuffer(t,e){const n=this._getVaryingIndex(t),{buffer:i,byteSize:r,byteOffset:s}=this._getBufferParams(e);return n<0?(this.unused[t]=i,Nw.warn(()=>`${this.id} unused varying buffer ${t}`)(),this):(this.buffers[n]=e,this.bindOnUse||this._bindBuffer(n,i,s,r),this)}begin(t=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,n,i;return t instanceof tS?i=t:(i=t.buffer,n=t.byteSize,e=t.byteOffset),(void 0!==e||void 0!==n)&&(e=e||0,n=n||i.byteLength-e),{buffer:i,byteOffset:e,byteSize:n}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:n,byteOffset:i}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,i,n)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e,n=0,i){const r=e&&e.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,t,r,n,i):this.gl.bindBufferBase(35982,t,r),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}class jE{constructor(t,e={}){this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(t={}){const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(t={}){const e=this.bindings[this.currentIndex],{sourceBuffers:n,transformFeedback:i}=e;return{attributes:Object.assign({},n,t.attributes),transformFeedback:i}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],n=t?e[t]:null;return n?n instanceof tS?n:n.buffer:null}getData(t={}){const{varyingName:e}=t,n=this.getBuffer(e);return n?n.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(t={}){this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Rx(Fw(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,n={};if(this.bindings[this.currentIndex]&&Object.assign(n,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const i in this.feedbackMap){const t=this.feedbackMap[i];i in e&&(n[t]=i)}Object.assign(n,t.feedbackBuffers);for(const i in n){const t=n[i];if("string"==typeof t){const r=e[t],{byteLength:s,usage:o,accessor:a}=r;n[i]=this._createNewBuffer(i,{byteLength:s,usage:o,accessor:a})}}return n}_setupBuffers(t={}){const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const n=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:n})}_setupTransformFeedback(t,{model:e}){const{program:n}=e;t.transformFeedback=new LE(this.gl,{program:n,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),n=Object.assign({},t.feedbackBuffers);for(const i in this.feedbackMap){const r=this.feedbackMap[i];e[i]=t.feedbackBuffers[r],n[r]=t.sourceBuffers[i],Rx(n[r]instanceof tS)}return{sourceBuffers:e,feedbackBuffers:n}}_createNewBuffer(t,e){const n=new tS(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}_getNextIndex(){return(this.currentIndex+1)%2}}function FE(t){let e=100;const n=t.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){const t=parseInt(n[1],10);Number.isFinite(t)&&(e=t)}return e}const BE="vs",VE={[BE]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},zE="__LUMA_INJECT_DECLARATIONS__",UE=/void\s+main\s*\([^)]*\)\s*\{\n?/,HE=/}\n?[^{}]*$/,$E=[];function GE(t,e,n,i=!1){const r=e===BE;for(const s in n){const e=n[s];e.sort((t,e)=>t.order-e.order),$E.length=e.length;for(let t=0,n=e.length;tt+i));break;case"vs:#main-end":r&&(t=t.replace(HE,t=>i+t));break;case"fs:#decl":r||(t=t.replace(zE,i));break;case"fs:#main-start":r||(t=t.replace(UE,t=>t+i));break;case"fs:#main-end":r||(t=t.replace(HE,t=>i+t));break;default:t=t.replace(s,t=>t+i)}}return t=t.replace(zE,""),i&&(t=t.replace(/\}\s*$/,t=>t+VE[e])),t}function WE(t){const e={};return IE(Array.isArray(t)&&t.length>1),t.forEach(t=>{for(const n in t)e[n]=e[n]?`${e[n]}\n${t[n]}`:t[n]}),e}const qE={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},XE="transform_uSize_",YE="transform_position";const KE={10241:9728,10240:9728,10242:33071,10243:33071};class QE{constructor(t,e={}){this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(t={}){const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(t={}){const{sourceBuffers:e,sourceTextures:n,framebuffer:i,targetTexture:r}=this.bindings[this.currentIndex],s=Object.assign({},e,t.attributes),o=Object.assign({},t.uniforms),a=Object.assign({},t.parameters);let l=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){s.transform_elementID=this.elementIDBuffer;for(const e in this.samplerTextureMap)o[e]=n[this.samplerTextureMap[e]];this._setSourceTextureParameters();const t=function({sourceTextureMap:t,targetTextureVarying:e,targetTexture:n}){const i={};let r,s;e&&(({width:r,height:s}=n),i[`${XE}${e}`]=[r,s]);for(const o in t)({width:r,height:s}=t[o]),i[`${XE}${o}`]=[r,s];return i}({sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:r});Object.assign(o,t)}return this.hasTargetTexture&&(l=!1,a.viewport=[0,0,i.width,i.height]),{attributes:s,framebuffer:i,uniforms:o,discard:l,parameters:a}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData({packed:t=!1}={}){const{framebuffer:e}=this.bindings[this.currentIndex],n=_S(e);if(!t)return n;const i=n.constructor,r=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return IE(!1),null}}(this.targetTextureType),s=new i(n.length*r/4);let o=0;for(let a=0;a0,this._updateBindings({sourceBuffers:e,sourceTextures:n,targetTexture:r}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}_updateElementIDBuffer(t){if("number"!=typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach((t,e,n)=>{n[e]=e}),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new tS(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:n,sourceTextures:i,targetTexture:r}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,i),Object.assign(t.sourceBuffers,n),r){t.targetTexture=r;const{width:e,height:n}=r,{framebuffer:i}=t;i?(i.update({attachments:{36064:r},resizeAttachments:!1}),i.resize({width:e,height:n})):t.framebuffer=new SS(this.gl,{id:"transform-framebuffer",width:e,height:n,attachments:{36064:r}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const n in e)e[n].setParameters(KE)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);return e[this._swapTexture]=t.targetTexture,{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=function(t,e){Rx(t instanceof lS||t instanceof bS||t instanceof yS);const n=t.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=t;return new n(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(t);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(t={}){const{sourceTextures:e,targetTexture:n}=this.bindings[this.currentIndex],{vs:i,uniforms:r,targetTextureType:s,inject:o,samplerTextureMap:a}=function({vs:t,sourceTextureMap:e,targetTextureVarying:n,targetTexture:i}){let r=Object.keys(e).length,s=null;const o={};let a=t,l={};if(r>0||n){const t=a.split("\n"),c=t.slice();if(t.forEach((t,i,a)=>{if(r>0){const n=function(t,e){const n={},i=function(t){return RE(t,["attribute","in"])}(t);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const e=`// ${t} => Replaced by Transform with a sampler`,{samplerName:i,sizeName:o,uniformDeclerations:a}=function(t){const e=`transform_uSampler_${t}`,n=`${XE}${t}`;return{samplerName:e,sizeName:n,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${n};`}}(s),l=` ${r} ${s} = transform_getInput(${i}, ${o}).${function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return IE(!1),null}}(r)};\n`;return n[i]=s,{updatedLine:e,inject:{"vs:#decl":a,"vs:#main-start":l},samplerTextureMap:n}}return null}(t,e);if(n){const{updatedLine:t,inject:e}=n;c[i]=t,l=WE([l,e]),Object.assign(o,n.samplerTextureMap),r--}}n&&!s&&(s=function(t,e){const n=RE(t,["varying","out"]);return n&&n.name===e?n.type:null}(t,n))}),n){Rx(i);const t=`${XE}${n}`;l=WE([l,{"vs:#decl":`uniform vec2 ${t};\n`,"vs:#main-start":` vec2 ${YE} = transform_getPos(${t});\n gl_Position = vec4(${YE}, 0, 1.);\n`}])}a=c.join("\n")}return{vs:a,targetTextureType:s,inject:l,samplerTextureMap:o}}({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:n}),l=WE([t.inject||{},o]);return this.targetTextureType=s,this.samplerTextureMap=a,{vs:i,fs:t._fs||NE({version:FE(i),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[qE].concat(t.modules||[]):t.modules,uniforms:r,inject:l}}}const ZE={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function JE(t){let e=tC(t);return"object"===e?t?"type"in t?Object.assign({},t,ZE[t.type]):"value"in t?(e=tC(t.value),Object.assign({type:e},t,ZE[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},ZE[e])}function tC(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class eC{constructor({name:t,vs:e,fs:n,dependencies:i=[],uniforms:r,getUniforms:s,deprecations:o=[],defines:a={},inject:l={},vertexShader:c,fragmentShader:u}){IE("string"==typeof t),this.name=t,this.vs=e||c,this.fs=n||u,this.getModuleUniforms=s,this.dependencies=i,this.deprecations=this._parseDeprecationDefinitions(o),this.defines=a,this.injections=function(t){const e={vs:{},fs:{}};for(const n in t){let i=t[n];const r=n.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][n]=i}return e}(l),r&&(this.uniforms=function(t){const e={};for(const n in t){const i=JE(t[n]);e[n]=i}return e}(r))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:IE(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${e}// END MODULE_${this.name}\n\n`}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach(n=>{n.regex.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())})}_parseDeprecationDefinitions(t){return t.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),t}_defaultGetUniforms(t={}){const e={},n=this.uniforms;for(const i in n){const r=n[i];i in t&&!r.private?(r.validate&&IE(r.validate(t[i],r),`${this.name}: invalid ${i}`),e[i]=t[i]):e[i]=r.value}return e}}function nC(t){return function(t){const e={},n={};return iC({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort((t,e)=>n[e]-n[t]).map(t=>e[t])}(rC(t))}function iC({modules:t,level:e,moduleMap:n,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of t)n[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof eC||(IE("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),IE(t.name,"shader module has no name"),(t=new eC(t)).dependencies=rC(t.dependencies)),t))}const sC={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},oC={};function aC(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/Apple/i)||e.match(/Apple/i)?"APPLE":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(sC).forEach(t=>{oC[t]=t});const lC={};function cC(t,e,n={}){const i=sC[e];if(IE(i,e),!function(t={}){const e="undefined"!=typeof window&&window.navigator||{},n=t.userAgent||e.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(e in lC)return lC[e];const r=`#extension GL_${i[0]} : ${n.behavior||"enable"}\nvoid main(void) {}`,s=t.createShader(35633);t.shaderSource(s,r),t.compileShader(s);const o=t.getShaderParameter(s,35713);return t.deleteShader(s),lC[e]=o,o}function uC(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>function(t,e){const n=sC[e];IE(n,e);const i=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&n[1]||n[0],r="string"==typeof i?Boolean(t.getExtension(i)):i;return IE(!1===r||!0===r),r}(t,e))}function hC(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const dC=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],pC=[...dC,[hC("attribute"),"in $1"],[hC("varying"),"out $1"]],fC=[...dC,[hC("varying"),"in $1"]],gC=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],mC=[...gC,[hC("in"),"attribute $1"],[hC("out"),"varying $1"]],bC=[...gC,[hC("in"),"varying $1"]],yC="gl_FragColor",vC=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,_C=/void\s+main\s*\([^)]*\)\s*\{\n?/;function wC(t,e){for(const[n,i]of e)t=t.replace(n,i);return t}const xC=`\n\n${zE}\n\n`,SC={[BE]:"vertex",fs:"fragment"};function EC(t,{id:e,source:n,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){IE("string"==typeof n,"shader source must be a string");const h=i===BE,d=n.split("\n");let p=100,f="",g=n;0===d[0].indexOf("#version ")?(p=300,f=d[0],g=d.slice(1).join("\n")):f=`#version ${p}`;const m={};r.forEach(t=>{Object.assign(m,t.getDefines())}),Object.assign(m,s);let b=c?`${f}\n${function({id:t,source:e,type:n}){return t&&"string"==typeof t&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${t}_${SC[n]}\n\n`:""}({id:e,source:n,type:i})}\n${function({type:t}){return`\n#define SHADER_TYPE_${SC[t].toUpperCase()}\n`}({type:i})}\n${function(t){switch(function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),n=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:aC(n,i),vendor:n,renderer:i,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(t)}\n${function(t,e,n){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return uC(t,oC.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),uC(t,oC.GLSL_DERIVATIVES)&&cC(t,oC.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),uC(t,oC.GLSL_FRAG_DATA)&&cC(t,oC.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),uC(t,oC.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(t)}\n${function(t={}){let e=0,n="";for(const i in t){0===e&&(n+="\n// APPLICATION DEFINES\n"),e++;const r=t[i];(r||Number.isFinite(r))&&(n+=`#define ${i.toUpperCase()} ${t[i]}\n`)}return 0===e&&(n+="\n"),n}(m)}\n${h?"":"precision highp float;\n\n"}\n`:`${f}\n`;const y=function(t){const e={vs:{},fs:{}};return t.forEach(t=>{let n;"string"!=typeof t?(n=t,t=n.hook):n={},t=t.trim();const[i,r]=t.split(":"),s=t.replace(/\(.+/,"");e[i][s]=Object.assign(n,{signature:r})}),e}(o),v={},_={},w={};for(const x in a){const t="string"==typeof a[x]?{injection:a[x],order:0}:a[x],e=x.match(/^(v|f)s:(#)?([\w-]+)$/);if(e){const n=e[3];e[2]?"decl"===n?_[x]=[t]:w[x]=[t]:v[x]=[t]}else w[x]=[t]}for(const x of r){u&&x.checkDeprecations(g,u),b+=x.getModuleSource(i,p);const t=x.injections[i];for(const e in t){const n=e.match(/^(v|f)s:#([\w-]+)$/);if(n){const i="decl"===n[2]?_:w;i[e]=i[e]||[],i[e].push(t[e])}else v[e]=v[e]||[],v[e].push(t[e])}}return b+=xC,b=GE(b,i,_),b+=function(t,e){let n="";for(const i in t){const r=t[i];if(n+=`void ${r.signature} {\n`,r.header&&(n+=` ${r.header}`),e[i]){const t=e[i];t.sort((t,e)=>t.order-e.order);for(const e of t)n+=` ${e.injection}\n`}r.footer&&(n+=` ${r.footer}`),n+="}\n"}return n}(y[i],v),b+=g,b=GE(b,i,w),b=function(t,e,n){switch(e){case 300:return n?wC(t,pC):function(t){const e=(t=wC(t,fC)).match(vC);if(e){const n=e[1];t=t.replace(new RegExp(`\\b${yC}\\b`,"g"),n)}else{const e="fragmentColor";t=t.replace(_C,t=>`out vec4 ${e};\n${t}`).replace(new RegExp(`\\b${yC}\\b`,"g"),e)}return t}(t);case 100:return n?wC(t,mC):function(t){const e=(t=wC(t,bC)).match(vC);if(e){const n=e[1];t=t.replace(vC,"").replace(new RegExp(`\\b${n}\\b`,"g"),yC)}return t}(t);default:throw new Error(`unknown GLSL version ${e}`)}}(b,l?100:p,h),b}function CC(t){return function(e){const n={};for(const i of t){const t=i.getUniforms(e,n);Object.assign(n,t)}return n}}const OC={5126:VC.bind(null,"uniform1fv",MC,1,zC),35664:VC.bind(null,"uniform2fv",MC,2,zC),35665:VC.bind(null,"uniform3fv",MC,3,zC),35666:VC.bind(null,"uniform4fv",MC,4,zC),5124:VC.bind(null,"uniform1iv",DC,1,zC),35667:VC.bind(null,"uniform2iv",DC,2,zC),35668:VC.bind(null,"uniform3iv",DC,3,zC),35669:VC.bind(null,"uniform4iv",DC,4,zC),35670:VC.bind(null,"uniform1iv",DC,1,zC),35671:VC.bind(null,"uniform2iv",DC,2,zC),35672:VC.bind(null,"uniform3iv",DC,3,zC),35673:VC.bind(null,"uniform4iv",DC,4,zC),35674:VC.bind(null,"uniformMatrix2fv",MC,4,UC),35675:VC.bind(null,"uniformMatrix3fv",MC,9,UC),35676:VC.bind(null,"uniformMatrix4fv",MC,16,UC),35678:BC,35680:BC,5125:VC.bind(null,"uniform1uiv",RC,1,zC),36294:VC.bind(null,"uniform2uiv",RC,2,zC),36295:VC.bind(null,"uniform3uiv",RC,3,zC),36296:VC.bind(null,"uniform4uiv",RC,4,zC),35685:VC.bind(null,"uniformMatrix2x3fv",MC,6,UC),35686:VC.bind(null,"uniformMatrix2x4fv",MC,8,UC),35687:VC.bind(null,"uniformMatrix3x2fv",MC,6,UC),35688:VC.bind(null,"uniformMatrix3x4fv",MC,12,UC),35689:VC.bind(null,"uniformMatrix4x2fv",MC,8,UC),35690:VC.bind(null,"uniformMatrix4x3fv",MC,12,UC),35678:BC,35680:BC,35679:BC,35682:BC,36289:BC,36292:BC,36293:BC,36298:BC,36299:BC,36300:BC,36303:BC,36306:BC,36307:BC,36308:BC,36311:BC},TC={},kC={},AC={},PC=[0];function IC(t,e,n,i){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(PC[0]=t,t=PC);const r=t.length;if(r%e&&Nw.warn(`Uniform size should be multiples of ${e}`,t)(),t instanceof n)return t;let s=i[r];s||(s=new n(r),i[r]=s);for(let o=0;o{const r=t!==i;return r&&(e.uniform1i(n,i),t=i),r}}function VC(t,e,n,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,n),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{Rx(s===u,"Uniform length cannot change.");for(let t=0;t{const s=String(i+e);return GC(s,r-s.length)+n+t})}(e);return{shaderName:l,errors:$C(s,c),warnings:$C(o,c)}}(t,this.source,this.shaderType,this.id);throw Nw.error(`GLSL compilation errors in ${e}\n${n}`)(),Nw.warn(`GLSL compilation warnings in ${e}\n${i}`)(),new Error(`GLSL compilation errors in ${e}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class qC extends WC{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class XC extends WC{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const YC=5126,KC=5124,QC=5125,ZC={[YC]:[YC,1,"float"],35664:[YC,2,"vec2"],35665:[YC,3,"vec3"],35666:[YC,4,"vec4"],[KC]:[KC,1,"int"],35667:[KC,2,"ivec2"],35668:[KC,3,"ivec3"],35669:[KC,4,"ivec4"],[QC]:[QC,1,"uint"],36294:[QC,2,"uvec2"],36295:[QC,3,"uvec3"],36296:[QC,4,"uvec4"],35670:[YC,1,"bool"],35671:[YC,2,"bvec2"],35672:[YC,3,"bvec3"],35673:[YC,4,"bvec4"],35674:[YC,8,"mat2"],35685:[YC,8,"mat2x3"],35686:[YC,8,"mat2x4"],35675:[YC,12,"mat3"],35687:[YC,12,"mat3x2"],35688:[YC,12,"mat3x4"],35676:[YC,16,"mat4"],35689:[YC,16,"mat4x2"],35690:[YC,16,"mat4x3"]};function JC(t){const e=ZC[t];if(!e)return null;const[n,i]=e;return{type:n,components:i}}function tO(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=YC}for(const n in ZC){const[i,r,s]=ZC[n];if(i===t&&r===e)return{glType:n,name:s}}return null}class eO{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,n=e.getProgramParameter(t.handle,35721);for(let i=0;i=0&&this._addAttribute(o,n,r,s)}this.attributeInfos.sort((t,e)=>t.location-e.location)}_readVaryingsFromProgram(t){const{gl:e}=t;if(!Fw(e))return;const n=e.getProgramParameter(t.handle,35971);for(let i=0;it.location-e.location)}_addAttribute(t,e,n,i){const{type:r,components:s}=JC(n),o={type:r,size:i*s};this._inferProperties(t,e,o);const a={location:t,name:e,accessor:new Kx(o)};this.attributeInfos.push(a),this.attributeInfosByLocation[t]=a,this.attributeInfosByName[a.name]=a}_inferProperties(t,e,n){/instance/i.test(e)&&(n.divisor=1)}_addVarying(t,e,n,i){const{type:r,components:s}=JC(n),o={location:t,name:e,accessor:new Kx({type:r,size:i*s})};this.varyingInfos.push(o),this.varyingInfosByName[o.name]=o}}const nO=35981,iO=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class rO extends Hx{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Program","v6.0",iO),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(t={}){const{hash:e,vs:n,fs:i,varyings:r,bufferMode:s=nO}=t;return this.hash=e||"",this.vs="string"==typeof n?new qC(this.gl,{id:`${t.id}-vs`,source:n}):n,this.fs="string"==typeof i?new XC(this.gl,{id:`${t.id}-fs`,source:i}):i,Rx(this.vs instanceof qC),Rx(this.fs instanceof XC),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(Vw(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,s)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new eO(this),this.setProps(t)}delete(t={}){return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw({logPriority:t,drawMode:e=4,vertexCount:n,offset:i=0,start:r,end:s,isIndexed:o=!1,indexType:a=5123,instanceCount:l=0,isInstanced:c=l>0,vertexArray:u=null,transformFeedback:h,framebuffer:d,parameters:p={},uniforms:f,samplers:g}){if((f||g)&&(Nw.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(f||{})),Nw.priority>=t){const i=d?d.id:"default",r=`mode=${Lx(this.gl,e)} verts=${n} instances=${l} indexType=${Lx(this.gl,a)} isInstanced=${c} isIndexed=${o} Framebuffer=${i}`;Nw.log(t,r)()}return Rx(u),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===n||c&&0===l||(u.bindForDraw(n,l,()=>{if(void 0!==d&&(p=Object.assign({},p,{framebuffer:d})),h){const t=function(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Rx(!1),0}}(e);h.begin(t)}this._bindTextures(),vx(this.gl,p,()=>{o&&c?this.gl2.drawElementsInstanced(e,n,a,i,l):o&&Fw(this.gl)&&!isNaN(r)&&!isNaN(s)?this.gl2.drawRangeElements(e,r,s,n,a,i):o?this.gl.drawElements(e,n,a,i):c?this.gl2.drawArraysInstanced(e,i,n,l):this.gl.drawArrays(e,i,n)}),h&&h.end()}),0))}setUniforms(t={}){Nw.priority>=2&&function(t,e,n){for(const i in t){const r=t[i];if((!n||Boolean(n[i]))&&!jC(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const e in t){const n=t[e],i=this._uniformSetters[e];if(i){let t=n,r=!1;if(t instanceof SS&&(t=t.texture),t instanceof oS)if(r=this.uniforms[e]!==n,r){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);const n=t,{textureIndex:r}=i;n.bind(r),t=r,this._textureUniforms[e]=n}else t=i.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(i(t)||r)&&FC(this.uniforms,e,n)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const n=this._textureUniforms[e];n.update(),t=t&&n.loaded}return t}_bindTextures(){for(const t in this._textureUniforms)this._textureUniforms[t].bind(this._uniformSetters[t].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),n={};for(const i of e)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new qC({handle:i});break;case 35632:n.fs=new XC({handle:i})}return n}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=Fx(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?`${t}-program`:"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),Nw.time(4,`linkProgram for ${this._getName()}`)(),t.linkProgram(this.handle),Nw.timeEnd(4,`linkProgram for ${this._getName()}`)(),t.debug||Nw.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${t.getProgramInfoLog(this.handle)}`);if(t.validateProgram(this.handle),!t.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${t.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e1)for(let e=0;ee.name===t.name)||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"==typeof t?t:t.name;this._defaultModules=this._defaultModules.filter(t=>t.name!==e),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(t={}){const{vs:e="",fs:n="",defines:i={},inject:r={},varyings:s=[],bufferMode:o=35981,transpileToGLSL100:a=!1}=t,l=this._getModuleList(t.modules),c=this._getHash(e),u=this._getHash(n),h=l.map(t=>this._getHash(t.name)).sort(),d=s.map(t=>this._getHash(t)),p=Object.keys(i).sort(),f=Object.keys(r).sort(),g=[],m=[];for(const y of p)g.push(this._getHash(y)),g.push(this._getHash(i[y]));for(const y of f)m.push(this._getHash(y)),m.push(this._getHash(r[y]));const b=`${c}/${u}D${g.join("/")}M${h.join("/")}I${m.join("/")}V${d.join("/")}H${this.stateHash}B${o}${a?"T":""}`;if(!this._programCache[b]){const t=function(t,e){const{vs:n,fs:i}=e,r=nC(e.modules||[]);return{gl:t,vs:EC(t,Object.assign({},e,{source:n,type:BE,modules:r})),fs:EC(t,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:CC(r)}}(this.gl,{vs:e,fs:n,modules:l,inject:r,defines:i,hookFunctions:this._hookFunctions,transpileToGLSL100:a});this._programCache[b]=new rO(this.gl,{hash:b,vs:t.vs,fs:t.fs,varyings:s,bufferMode:o}),this._getUniforms[b]=t.getUniforms||(t=>{}),this._useCounts[b]=0}return this._useCounts[b]++,this._programCache[b]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(t=[]){const e=new Array(this._defaultModules.length+t.length),n={};let i=0;for(let r=0,s=this._defaultModules.length;r-1)return"Edge";const n=-1!==e.indexOf("MSIE "),i=-1!==e.indexOf("Trident/");return n||i?"IE":vw.chrome?"Chrome":vw.safari?"Safari":vw.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new aO(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return aO.MAX_ATTRIBUTES=aO.MAX_ATTRIBUTES||t.getParameter(34921),aO.MAX_ATTRIBUTES}static setConstant(t,e,n){switch(n.constructor){case Float32Array:aO._setConstantFloatArray(t,e,n);break;case Int32Array:aO._setConstantIntArray(t,e,n);break;case Uint32Array:aO._setConstantUintArray(t,e,n);break;default:Rx(!1)}}constructor(t,e={}){super(t,Object.assign({},e,{id:e.id||e.program&&e.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return aO.getMaxAttributes(this.gl)}initialize(t={}){return this.setProps(t)}setProps(t){return this}setElementBuffer(t=null,e={}){return Rx(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,t?t.handle:null)}),this}setBuffer(t,e,n){if(34963===e.target)return this.setElementBuffer(e,n);const{size:i,type:r,stride:s,offset:o,normalized:a,integer:l,divisor:c}=n,{gl:u,gl2:h}=this;return t=Number(t),this.bind(()=>{u.bindBuffer(34962,e.handle),l?(Rx(Fw(u)),h.vertexAttribIPointer(t,i,r,s,o)):u.vertexAttribPointer(t,i,r,a,s,o),u.enableVertexAttribArray(t),h.vertexAttribDivisor(t,c||0)}),this}enable(t,e=!0){return!e&&0===t&&!aO.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind(()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t))),this}getConstantBuffer(t,e){const n=this._normalizeConstantArrayValue(e),i=n.byteLength*t,r=n.length*t;let s=!this.buffer;if(this.buffer=this.buffer||new tS(this.gl,i),s=s||this.buffer.reallocate(i),s=s||!this._compareConstantArrayValues(n,this.bufferValue),s){const t=function(t,e){return new t(function(t){return(!oO||oO.byteLength{switch(t){case 34373:return this.gl.getVertexAttribOffset(e,t);default:return this.gl.getVertexAttrib(e,t)}})}}const lO=/^(.+)__LOCATION_([0-9]+)$/,cO=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class uO{constructor(t,e={}){this.id=e.id||e.program&&e.program.id,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new aO(t),zx(this,"VertexArray","v6.0",cO),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(t={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind(()=>{for(const e in t)this._setAttribute(e,t[e]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(t=null,e={}){return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e,n={}){if(34963===e.target)return this.setElementBuffer(e,n);const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,e.accessor,n);return i>=0&&(this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,r)),this}setConstant(t,e,n={}){const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},n));return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new tS(this.gl,{accessor:{size:4}});for(let t=0;t{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t{this._setConstantAttributes(t,e),i=n()}),i}_resolveLocationAndAccessor(t,e,n,i){const r={location:-1,accessor:null},{location:s,name:o}=this._getAttributeIndex(t);if(!Number.isFinite(s)||s<0)return this.unused[t]=e,Nw.once(3,()=>`unused value ${t} in ${this.id}`)(),r;const a=this._getAttributeInfo(o||s);if(!a)return r;const l=Kx.resolve(a.accessor,this.accessors[s]||{},n,i),{size:c,type:u}=l;return Rx(Number.isFinite(c)&&Number.isFinite(u)),{location:s,accessor:l}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const n=lO.exec(t),i=n?n[1]:t,r=n?Number(n[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(i)+r,name:i}:{location:-1}}_setAttribute(t,e){if(e instanceof tS)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof tS)this.setBuffer(t,e[0],e[1]);else if(ArrayBuffer.isView(e)||Array.isArray(e))this.setConstant(t,e);else{if(!(e.buffer instanceof tS))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(t,e.buffer,e)}}_setConstantAttributes(t,e){const n=Math.max(0|t,0|e);let i=this.values[0];ArrayBuffer.isView(i)&&this._setConstantAttributeZero(i,n);for(let r=1;r0;if(t.isInstanced=t.isInstanced||s,n instanceof tS){const e=n;if(s){const n=e.getVertexCount(i);t.instanceCount=Math.min(t.instanceCount,n)}else{const n=e.getVertexCount(i);t.vertexCount=Math.min(t.vertexCount,n)}}}setElements(t=null,e={}){return Nw.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}function hO(t,e={}){const{isInteger:n=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){const{maxElts:n=16,size:i=1}=e;let r="[";for(let s=0;s0&&(r+=","+(s%i==0?" ":"")),r+=hO(t[s],e);return`${r}${t.length>n?"...":"]"}`}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return n?"0":"0.";if(n||Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const i=t.toPrecision(2);return i.indexOf(".0")===i.length-2?i.slice(0,-1):i}function dO(t,e,n,i){const{gl:r}=t;if(!e)return{[i]:"null","Format ":"N/A"};let s,o,a,l="NOT PROVIDED",c=1,u=0,h=0;if(n&&(l=n.type,c=n.size,l=String(l).replace("Array",""),s=-1!==l.indexOf("nt")),e instanceof tS){const t=e,{data:d,changed:p}=t.getDebugData();let f;return o=p?"*":"",a=d,h=t.byteLength,u=h/d.BYTES_PER_ELEMENT/c,n?f=`${n.divisor>0?"I ":"P "} ${u} (x${c}=${h} bytes ${Lx(r,l)})`:(s=!0,f=`${h} bytes`),{[i]:`${o}${hO(a,{size:c,isInteger:s})}`,"Format ":f}}return a=e,c=e.length,l=String(e.constructor.name).replace("Array",""),s=-1!==l.indexOf("nt"),{[i]:`${hO(a,{size:c,isInteger:s})} (constant)`,"Format ":`${c}x${l} (constant)`}}function pO(t,e){const{type:n,size:i}=e,r=tO(n,i);return r?`${t} (${r.name})`:t}function fO({header:t="Uniforms",program:e,uniforms:n,undefinedOnly:i=!1}){Rx(e);const r=".*Matrix",s={},o=Object.keys(e._uniformSetters).sort();let a=0;for(const u of o)!u.match(".*_.*")&&!u.match(r)&&gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)u.match(r)&&gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)s[u]||gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;let l=0;const c={};if(!i)for(const u in n){const e=n[u];s[u]||(l++,c[u]={Type:`NOT USED: ${e}`,[t]:hO(e)})}return{table:s,count:a,unusedTable:c,unusedCount:l}}function gO({table:t,header:e,uniforms:n,uniformName:i,undefinedOnly:r}){const s=n[i],o=function(t){return null!=t}(s);return!(r&&o||(t[i]={[e]:o?hO(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function mO(t){const{type:e,size:n}=t.accessor,i=tO(e,n);return i?`${i.name} ${t.name}`:t.name}const bO={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function yO(t,e){const{attributeMap:n=bO}=e||{};return n&&n[t]||t}function vO(t,e){let n;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Rx(Number.isFinite(e.size),`attribute ${t} needs size`)}const _O=()=>{},wO={};class xO{constructor(t,e={}){const{id:n=Fx("model")}=e;Rx(jw(t)),this.id=n,this.gl=t,this.id=e.id||Fx("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||sO.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},Rx(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return Rx(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return Rx(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,n){const i={};let r=e.indices;for(const s in e.attributes){const n=e.attributes[s],o=yO(s,undefined);if("indices"===s)r=n;else if(n.constant)i[o]=n.value;else{const e=n.value,r=bt({},n);delete r.value,i[o]=[new tS(t,e),r],vO(s,r)}}if(r){const e=r.value||r;Rx(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const n={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new tS(t,{data:e,target:34963}),n]}return i}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(t={}){if(Vx(t))return this;const e={};for(const n in t){const i=t[n];e[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(e),this}setUniforms(t={}){return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return pS(this.program.gl,t),this}draw(t={}){this._checkProgram();const{moduleSettings:e=null,framebuffer:n,uniforms:i={},attributes:r={},transformFeedback:s=this.transformFeedback,parameters:o={},vertexArray:a=this.vertexArray}=t;let l;this.setAttributes(r),this.updateModuleSettings(e),this.setUniforms(i),Nw.priority>=2&&(l=this._logDrawCallStart(2));const c=this.vertexArray.getDrawParams(),{isIndexed:u=c.isIndexed,indexType:h=c.indexType,indexOffset:d=c.indexOffset,vertexArrayInstanced:p=c.isInstanced}=this.props;p&&!this.isInstanced&&Nw.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:f,instanceCount:g}=this,{onBeforeRender:m=_O,onAfterRender:b=_O}=this.props;m(),this.program.setUniforms(this.uniforms);const y=this.program.draw(Object.assign(wO,t,{logPriority:l,uniforms:null,framebuffer:n,parameters:o,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:a,transformFeedback:s,isIndexed:u,indexType:h,isInstanced:f,instanceCount:g,offset:u?d:0}));return b(),Nw.priority>=2&&this._logDrawCallEnd(l,a,n),y}transform(t={}){const{discard:e=!0,feedbackBuffers:n,unbindModels:i=[]}=t;let{parameters:r}=t;n&&this._setFeedbackBuffers(n),e&&(r=Object.assign({},r,{35977:e})),i.forEach(t=>t.vertexArray.unbindBuffers());try{this.draw(Object.assign({},t,{parameters:r}))}finally{i.forEach(t=>t.vertexArray.bindBuffers())}return this}render(t={}){return Nw.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:n,modules:i,inject:r,defines:s,varyings:o,bufferMode:a,transpileToGLSL100:l}=this.programProps;t=this.programManager.get({vs:e,fs:n,modules:i,inject:r,defines:s,varyings:o,bufferMode:a,transpileToGLSL100:l}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Rx(t instanceof rO,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new uO(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof tS&&e.delete()}}_setAnimationProps(t){this.animated&&Rx(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(t={}){if(Vx(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new LE(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:Nw.level<=2})(),t}_logDrawCallEnd(t,e,n,i){if(void 0===t)return;const r=function({vertexArray:t,header:e="Attributes"}){if(!t.configuration)return{};const n={};t.elements&&(n.ELEMENT_ARRAY_BUFFER=dO(t,t.elements,null,e));const i=t.values;for(const r in i){const s=t._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=t.accessors[s.location];a&&(o=`${r}: ${pO(s.name,a)}`),n[o]=dO(t,i[r],a,e)}}return n}({vertexArray:e,header:`${this.id} attributes`,attributes:this._attributes}),{table:s,unusedTable:o,unusedCount:a}=fO({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),{table:l,count:c}=fO({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0});c>0&&Nw.log("MISSING UNIFORMS",Object.keys(l))(),a>0&&Nw.log("UNUSED UNIFORMS",Object.keys(o))();const u=function(t){const e={},n=`Accessors for ${t.id}`;for(const i of t.attributeInfos)i&&(e[`in ${mO(i)}`]={[n]:JSON.stringify(i.accessor)});for(const i of t.varyingInfos)i&&(e[`out ${mO(i)}`]={[n]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);Nw.table(t,r)(),Nw.table(t,s)(),Nw.table(t+1,u)(),i&&i.log({logLevel:2,message:`Rendered to ${i.id}`}),Nw.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class SO{static isSupported(t){return Fw(t)}constructor(t,e={}){this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:n}=this;t&&t.delete(),e&&e.delete(),n&&n.delete()}run(t={}){const{clearRenderTarget:e=!0}=t,n=this._updateDrawOptions(t);e&&n.framebuffer&&n.framebuffer.clear({color:!0}),this.model.transform(n)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)t=t||n.swap();Rx(t,"Nothing to swap")}getBuffer(t=null){return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(t={}){const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e){const e=n.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(t={}){"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)n.update(t)}_initialize(t={}){const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new xO(e,Object.assign({},t,{fs:t.fs||NE({version:FE(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=i.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){return!(Vx(t.feedbackBuffers)&&Vx(t.feedbackMap)&&!(t.varyings&&t.varyings.length>0))})(e)&&(this.bufferTransform=new jE(t,e)),function(t){return!(Vx(t._sourceTextures)&&!t._targetTexture&&!t._targetTextureVarying)}(e)&&(this.textureTransform=new QE(t,e)),Rx(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=Object.assign(e,i.getDrawOptions(e));return e}}function EO(){}const CO={onStart:EO,onUpdate:EO,onInterrupt:EO,onEnd:EO};class OO{constructor(t){this._inProgress=!1,this._handle=null,this.timeline=t,this.settings={}}get inProgress(){return this._inProgress}start(t){this.cancel(),this.settings=bt(bt({},CO),t),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const TO={interpolation:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="interpolation",this.transition=new OO(n),this.attribute=e,this.attributeInTransition=new kE(t,e.settings),this.currentStartIndices=e.startIndices,this.currentLength=0,this.transform=function(t,e){const n=EE(e.size);return new SO(t,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(t,e);const i={byteLength:0,usage:35050};this.buffers=[new tS(t,i),new tS(t,i)]}get inProgress(){return this.transition.inProgress}start(t,e){if(t.duration<=0)return void this.transition.cancel();const{buffers:n,attribute:i}=this;CE(n);const r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)TE(bt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=OE(i,e),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:n[0],aTo:SE(0,i)},feedbackBuffers:{vCurrent:n[1]}})}update(){const t=this.transition.update();if(t){const{time:t,settings:{duration:e,easing:n}}=this.transition,i=n(t/e);this.transform.run({uniforms:{time:i}})}return t}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="spring",this.transition=new OO(n),this.attribute=e,this.attributeInTransition=new kE(t,ti(bt({},e.settings),{normalized:!1})),this.currentStartIndices=e.startIndices,this.currentLength=0,this.texture=function(t){return new lS(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(t),this.framebuffer=function(t,e){return new SS(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(t,this.texture),this.transform=function(t,e,n){const i=EE(e.size);return new SO(t,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(t,e,this.framebuffer);const i={byteLength:0,usage:35050};this.buffers=[new tS(t,i),new tS(t,i),new tS(t,i)]}get inProgress(){return this.transition.inProgress}start(t,e){const{buffers:n,attribute:i}=this,r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)TE(bt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=OE(i,e),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aTo:SE(0,i)}})}update(){const{buffers:t,transform:e,framebuffer:n,transition:i}=this;return!!i.update()&&(e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:i.settings.stiffness,damping:i.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),CE(t),this.attributeInTransition.update({buffer:t[1],value:this.attribute.value}),_S(n)[0]>0||i.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class kO{constructor(t,{id:e,timeline:n}){this.id=e,this.gl=t,this.timeline=n,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=SO.isSupported(t)}finalize(){for(const t in this.transitions)this._removeTransition(t)}update({attributes:t,transitions:e,numInstances:n}){this.numInstances=n||1;for(const i in t){const n=t[i],r=n.getTransitionSetting(e);!r||this._updateAttribute(i,n,r)}for(const i in this.transitions){const n=t[i];(!n||!n.getTransitionSetting(e))&&this._removeTransition(i)}}hasAttribute(t){const e=this.transitions[t];return e&&e.inProgress}getAttributes(){const t={};for(const e in this.transitions){const n=this.transitions[e];n.inProgress&&(t[e]=n.attributeInTransition)}return t}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const e in this.transitions)this.transitions[e].update()&&(this.needsRedraw=!0);const t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].cancel(),delete this.transitions[t]}_updateAttribute(t,e,n){const i=this.transitions[t];let r=!i||i.type!==n.type;if(r){if(!this.isSupported)return void Iw.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();i&&this._removeTransition(t);const s=TO[n.type];s?this.transitions[t]=new s({attribute:e,timeline:this.timeline,gl:this.gl}):(Iw.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}const AO="attributeManager.invalidate";class PO{constructor(t,{id:e="attribute-manager",stats:n,timeline:i}={}){this.id=e,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=n,this.attributeTransitionManager=new kO(t,{id:"".concat(e,"-transitions"),timeline:i}),Object.seal(this)}finalize(){for(const t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(t={clearRedrawFlags:!1}){const e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}setNeedsRedraw(t=!0){return this.needsRedraw=!0,this}add(t,e){this._add(t,e)}addInstanced(t,e){this._add(t,e,{instanced:1})}remove(t){for(let e=0;e{t[n]||(t[n]=[]),t[n].push(e)});this.updateTriggers=t}_invalidateTrigger(t,e){const{attributes:n,updateTriggers:i}=this,r=i[t];return r&&r.forEach(t=>{const i=n[t];i&&i.setNeedsUpdate(i.id,e)}),r}_updateAttribute(t){const{attribute:e,numInstances:n}=t;PE("attribute.updateStart",e),e.allocate(n)&&PE("attribute.allocate",e,n),e.updateBuffer(t)&&(this.needsRedraw=!0,PE("attribute.updateEnd",e,n))}}function IO(t,e,n,i,r){const s=e-t;return(n-e)*r+-s*i+s+e}function MO(t,e){if(Array.isArray(t)){let n=0;for(let i=0;i0}add(t,e,n,i){const{transitions:r}=this;if(r.has(t)){const n=r.get(t),{value:i=n.settings.fromValue}=n;e=i,this.remove(t)}if(!(i=xE(i)))return;const s=DO[i.type];if(!s)return void Iw.error("unsupported transition type '".concat(i.type,"'"))();const o=new s(this.timeline);o.start(ti(bt({},i),{fromValue:e,toValue:n})),r.set(t,o)}remove(t){const{transitions:e}=this;e.has(t)&&(e.get(t).cancel(),e.delete(t))}update(){const t={};for(const[e,n]of this.transitions)n.update(),t[e]=n.value,n.inProgress||this.remove(e);return t}clear(){for(const t of this.transitions.keys())this.remove(t)}}const NO={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:LO}=NO;function jO(t,e){if(!t.transitions)return null;const n={},i=UO(t);for(const r in t.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&BO(t[r],e[r],s)&&(n[r]=!0)}return n}function FO({newProps:t,oldProps:e,ignoreProps:n={},propTypes:i={},triggerName:r="props"}={}){if(e===t)return null;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(t))if(!(s in n)){if(!(s in e))return"".concat(r,".").concat(s," added");const n=BO(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}for(const s of Object.keys(e))if(!(s in n)){if(!(s in t))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(t,s)){const n=BO(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}}return null}function BO(t,e,n){let i=n&&n.equal;return i&&!i(t,e,n)||!i&&(i=t&&e&&t.equals,i&&!i.call(t,e))?"changed deeply":i||e===t?null:"changed shallowly"}function VO(t,e){if(null===e)return"oldProps is null, initial diff";const n=e.extensions,{extensions:i}=t;if(i===n)return!1;if(i.length!==n.length)return!0;for(let r=0;r{for(const r in i)if(!HO(i[r],n[r])){e=t(i),n=i;break}return e}}function GO(t,e){if(!e)return t;const n=bt(bt({},t),e);if("defines"in e&&(n.defines=bt(bt({},t.defines),e.defines)),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some(t=>"project64"===t.name))){const t=n.modules.findIndex(t=>"project32"===t.name);t>=0&&n.modules.splice(t,1)}if("inject"in e)if(t.inject){const i=bt({},t.inject);for(const t in e.inject)i[t]=(i[t]||"")+e.inject[t];n.inject=i}else n.inject=e.inject;return n}function WO(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],g=e[13],m=e[14],b=e[15],y=n*a-i*o,v=n*l-r*o,_=n*c-s*o,w=i*l-r*a,x=i*c-s*a,S=r*c-s*l,E=u*g-h*f,C=u*m-d*f,O=u*b-p*f,T=h*m-d*g,k=h*b-p*g,A=d*b-p*m,P=y*A-v*k+_*T+w*O-x*C+S*E;return P?(t[0]=(a*A-l*k+c*T)*(P=1/P),t[1]=(r*k-i*A-s*T)*P,t[2]=(g*S-m*x+b*w)*P,t[3]=(d*x-h*S-p*w)*P,t[4]=(l*O-o*A-c*C)*P,t[5]=(n*A-r*O+s*C)*P,t[6]=(m*_-f*S-b*v)*P,t[7]=(u*S-d*_+p*v)*P,t[8]=(o*k-a*O+c*E)*P,t[9]=(i*O-n*k-s*E)*P,t[10]=(f*x-g*_+b*y)*P,t[11]=(h*_-u*x-p*y)*P,t[12]=(a*C-o*T-l*E)*P,t[13]=(n*T-i*C+r*E)*P,t[14]=(g*v-f*w-m*y)*P,t[15]=(u*w-h*v+d*y)*P,t):null}function qO(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],b=e[14],y=e[15],v=n[0],_=n[1],w=n[2],x=n[3];return t[0]=v*i+_*a+w*h+x*g,t[1]=v*r+_*l+w*d+x*m,t[2]=v*s+_*c+w*p+x*b,t[3]=v*o+_*u+w*f+x*y,t[4]=(v=n[4])*i+(_=n[5])*a+(w=n[6])*h+(x=n[7])*g,t[5]=v*r+_*l+w*d+x*m,t[6]=v*s+_*c+w*p+x*b,t[7]=v*o+_*u+w*f+x*y,t[8]=(v=n[8])*i+(_=n[9])*a+(w=n[10])*h+(x=n[11])*g,t[9]=v*r+_*l+w*d+x*m,t[10]=v*s+_*c+w*p+x*b,t[11]=v*o+_*u+w*f+x*y,t[12]=(v=n[12])*i+(_=n[13])*a+(w=n[14])*h+(x=n[15])*g,t[13]=v*r+_*l+w*d+x*m,t[14]=v*s+_*c+w*p+x*b,t[15]=v*o+_*u+w*f+x*y,t}function XO(t,e,n){var i,r,s,o,a,l,c,u,h,d,p,f,g=n[0],m=n[1],b=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*b+e[12],t[13]=e[1]*g+e[5]*m+e[9]*b+e[13],t[14]=e[2]*g+e[6]*m+e[10]*b+e[14],t[15]=e[3]*g+e[7]*m+e[11]*b+e[15]):(r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=i=e[0],t[1]=r,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=i*g+a*m+h*b+e[12],t[13]=r*g+l*m+d*b+e[13],t[14]=s*g+c*m+p*b+e[14],t[15]=o*g+u*m+f*b+e[15]),t}function YO(t,e,n){var i=n[0],r=n[1],s=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function KO(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*i,t[5]=o*r+u*i,t[6]=a*r+h*i,t[7]=l*r+d*i,t[8]=c*r-s*i,t[9]=u*r-o*i,t[10]=h*r-a*i,t[11]=d*r-l*i,t}function QO(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*i,t[1]=o*r+u*i,t[2]=a*r+h*i,t[3]=l*r+d*i,t[4]=c*r-s*i,t[5]=u*r-o*i,t[6]=h*r-a*i,t[7]=d*r-l*i,t}function ZO(t,e,n,i,r){var s,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+i)*(s=1/(i-r)),t[14]=2*r*i*s):(t[10]=-1,t[14]=-2*i),t}function JO(t,e){var n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],b=t[15],y=e[0],v=e[1],_=e[2],w=e[3],x=e[4],S=e[5],E=e[6],C=e[7],O=e[8],T=e[9],k=e[10],A=e[11],P=e[12],I=e[13],M=e[14],D=e[15];return Math.abs(n-y)<=WS*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-v)<=WS*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(r-_)<=WS*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(s-w)<=WS*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(o-x)<=WS*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-S)<=WS*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(l-E)<=WS*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-C)<=WS*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(u-O)<=WS*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(h-T)<=WS*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-k)<=WS*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-A)<=WS*Math.max(1,Math.abs(p),Math.abs(A))&&Math.abs(f-P)<=WS*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(g-I)<=WS*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(m-M)<=WS*Math.max(1,Math.abs(m),Math.abs(M))&&Math.abs(b-D)<=WS*Math.max(1,Math.abs(b),Math.abs(D))}function tT(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function eT(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*s+n[12]*o,t[1]=n[1]*i+n[5]*r+n[9]*s+n[13]*o,t[2]=n[2]*i+n[6]*r+n[10]*s+n[14]*o,t[3]=n[3]*i+n[7]*r+n[11]*s+n[15]*o,t}!function(){var t=new qS(4);qS!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();const nT=[0,0,0,0],iT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],rT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],sT=[0,0,0],oT=[0,0,0],aT=$O(function({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(t,e,n){const{viewMatrixUncentered:i,projectionMatrix:r}=t;let{viewMatrix:s,viewProjectionMatrix:o}=t,a=nT,l=nT,c=t.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:d}=lT(t,e,n);return d&&(l=t.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=eT([],l,o),s=i||s,o=qO([],r,s),o=qO([],o,iT)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(t,n,i),u=t.getDistanceScales(),h=[t.width*e,t.height*e],d=t.projectionMatrix.transform([0,0,-t.focalDistance,1])[3]||1,p={project_uCoordinateSystem:n,project_uProjectionMode:t.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:h,project_uDevicePixelRatio:e,project_uFocalDistance:d,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:sT,project_uScale:t.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const e=t.getDistanceScales(c);switch(n){case Mw.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerMeter2;break;case Mw.LNGLAT:case Mw.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerDegree2;break;case Mw.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,e.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,e.unitsPerMeter2[2]]}}return p});function lT(t,e,n=oT){let i,r=n,s=!0;switch(i=e===Mw.LNGLAT_OFFSETS||e===Mw.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case Dw.WEB_MERCATOR:(e===Mw.LNGLAT||e===Mw.CARTESIAN)&&(s=!1);break;case Dw.WEB_MERCATOR_AUTO_OFFSET:e===Mw.LNGLAT?r=i:e===Mw.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case Dw.IDENTITY:r=t.position.map(Math.fround);break;case Dw.GLOBE:s=!1,i=null;break;default:s=!1}return r[2]=r[2]||0,{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}class cT extends VS{get ELEMENTS(){return BS(!1),0}get RANK(){return BS(!1),0}toString(){let t="[";if(IS.printRowMajor){t+="row-major:";for(let e=0;e2*Math.PI)throw Error("radians");const s=n*Math.tan(t/2),o=s*e;return(new bT).ortho({left:-o,right:o,bottom:-s,top:s,near:i,far:r})}perspective({fovy:t,fov:e=45*Math.PI/180,aspect:n=1,near:i=.1,far:r=500}={}){if((t=t||e)>2*Math.PI)throw Error("radians");return ZO(this,t,n,i,r),this.check()}determinant(){return function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],p=t[12],f=t[13],g=t[14],m=t[15];return(e*o-n*s)*(h*m-d*g)-(e*a-i*s)*(u*m-d*f)+(e*l-r*s)*(u*g-h*f)+(n*a-i*o)*(c*m-d*p)-(n*l-r*o)*(c*g-h*p)+(i*l-r*a)*(c*f-u*p)}(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const n=this.getScale(e||[-0,-0,-0]),i=1/n[0],r=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*r,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*r,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const n=this.getScale(e||[-0,-0,-0]),i=1/n[0],r=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*s,t[3]=this[4]*i,t[4]=this[5]*r,t[5]=this[6]*s,t[6]=this[8]*i,t[7]=this[9]*r,t[8]=this[10]*s,t}transpose(){return function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=r,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]}(this,this),this.check()}invert(){return WO(this,this),this.check()}multiplyLeft(t){return qO(this,t,this),this.check()}multiplyRight(t){return qO(this,this,t),this.check()}rotateX(t){return KO(this,this,t),this.check()}rotateY(t){return function(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*i,t[1]=o*r-u*i,t[2]=a*r-h*i,t[3]=l*r-d*i,t[8]=s*i+c*r,t[9]=o*i+u*r,t[10]=a*i+h*r,t[11]=l*i+d*r}(this,this,t),this.check()}rotateZ(t){return QO(this,this,t),this.check()}rotateXYZ([t,e,n]){return this.rotateX(t).rotateY(e).rotateZ(n)}rotateAxis(t,e){return function(t,e,n,i){var r,s,o,a,l,c,u,h,d,p,f,g,m,b,y,v,_,w,x,S,E,C,O,T,k=i[0],A=i[1],P=i[2],I=Math.hypot(k,A,P);I=-90&&e<=90,"invalid latitude"),[512*(t*ET+xT)/(2*xT),512*(xT+Math.log(Math.tan(ST+e*ET*.5)))/(2*xT)]}function kT([t,e]){const n=t/512*(2*xT)-xT,i=2*(Math.atan(Math.exp(e/512*(2*xT)-xT))-ST);return[n*CT,i*CT]}function AT({latitude:t,longitude:e,highPrecision:n=!1}){wT(Number.isFinite(t)&&Number.isFinite(e));const i={},r=Math.cos(t*ET),s=512/360,o=s/r,a=512/OT/r;if(i.unitsPerMeter=[a,a,a],i.metersPerUnit=[1/a,1/a,1/a],i.unitsPerDegree=[s,o,a],i.degreesPerUnit=[1/s,1/o,1/a],n){const e=ET*Math.tan(t*ET)/r,n=512/OT*e,l=n/o*a;i.unitsPerDegree2=[0,s*e/2,n],i.unitsPerMeter2=[l,0,l]}return i}function PT(t,e){const[n,i,r]=t,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=AT({longitude:n,latitude:i,highPrecision:!0}),u=TT(t);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=kT(u),d=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],d]:h}function IT({height:t,pitch:e,bearing:n,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return XO(o,o,[0,0,-i]),KO(o,o,-e*ET),QO(o,o,n*ET),YO(o,o,[r/=t,r,r]),s&&XO(o,o,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],s)),o}function MT({width:t,height:e,fovy:n=DT(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(n=DT(i));const a=.5*n*ET,l=RT(n),c=r*ET,u=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:t/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}function DT(t){return 2*Math.atan(.5/t)*CT}function RT(t){return.5/Math.tan(.5*t*ET)}function NT(t,e){const[n,i,r=0]=t;return wT(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),yT(e,[n,i,r,1])}function LT(t,e,n=0){const[i,r,s]=t;if(wT(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return yT(e,[i,r,s,1]);const o=yT(e,[i,r,0,1]),a=yT(e,[i,r,1,1]),l=o[2],c=a[2];return dT([],o,a,l===c?0:((n||0)-l)/(c-l))}function jT({width:t,height:e,bounds:n,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=n;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:wT(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=new zT({width:t,height:e,longitude:0,latitude:0,zoom:0}),d=h.project([a,u]),p=h.project([c,l]),f=[Math.max(Math.abs(p[0]-d[0]),i),Math.max(Math.abs(p[1]-d[1]),i)],g=[t-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];wT(g[0]>0&&g[1]>0);const m=g[0]/f[0],b=g[1]/f[1],y=h.unproject([(p[0]+d[0])/2+(s.right-s.left)/2/m,(p[1]+d[1])/2+(s.bottom-s.top)/2/b]),v=Math.min(r,h.zoom+_T(Math.abs(Math.min(m,b))));return wT(Number.isFinite(v)),{longitude:y[0],latitude:y[1],zoom:v}}const FT=Math.PI/180;function BT(t,e=0){const{width:n,height:i,unproject:r}=t,s={targetZ:e},o=r([0,i],s),a=r([n,i],s);let l,c;return(t.fovy?.5*t.fovy*FT:Math.atan(.5/t.altitude))>(90-t.pitch)*FT-.01?(l=VT(t,0,e),c=VT(t,n,e)):(l=r([0,0],s),c=r([n,0],s)),[o,a,c,l]}function VT(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=yT(i,[e,0,1,1]),s=yT(i,[e,t.height,1,1]),o=kT(dT([],r,s,(n*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return o[2]=n,o}class zT{constructor({width:t,height:e,latitude:n=0,longitude:i=0,zoom:r=0,pitch:s=0,bearing:o=0,altitude:a=null,fovy:l=null,position:c=null,nearZMultiplier:u=.02,farZMultiplier:h=1.01}={width:1,height:1}){t=t||1,e=e||1,null===l&&null===a?l=DT(a=1.5):null===l?l=DT(a):null===a&&(a=RT(l));const d=function(t){return Math.pow(2,t)}(r);a=Math.max(.75,a);const p=AT({longitude:i,latitude:n}),f=TT([i,n]);f[2]=0,c&&function(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}(f,f,function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}([],c,p.unitsPerMeter)),this.projectionMatrix=function({width:t,height:e,pitch:n,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:u}=MT({width:t,height:e,altitude:i,fovy:r,pitch:n,nearZMultiplier:s,farZMultiplier:o});return ZO([],a,l,c,u)}({width:t,height:e,pitch:s,fovy:l,nearZMultiplier:u,farZMultiplier:h}),this.viewMatrix=IT({height:e,scale:d,center:f,pitch:s,bearing:o,altitude:a}),this.width=t,this.height=e,this.scale=d,this.latitude=n,this.longitude=i,this.zoom=r,this.pitch=s,this.bearing=o,this.altitude=a,this.fovy=l,this.center=f,this.meterOffset=c||[0,0,0],this.distanceScales=p,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:t,height:e,projectionMatrix:n,viewMatrix:i}=this,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];qO(r,r,n),qO(r,r,i),this.viewProjectionMatrix=r;const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];YO(s,s,[t/2,-e/2,1]),XO(s,s,[1,-1,0]),qO(s,s,r);const o=WO([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],s);if(!o)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=s,this.pixelUnprojectionMatrix=o}equals(t){return t instanceof zT&&t.width===this.width&&t.height===this.height&&JO(t.projectionMatrix,this.projectionMatrix)&&JO(t.viewMatrix,this.viewMatrix)}project(t,{topLeft:e=!0}={}){const n=NT(this.projectPosition(t),this.pixelProjectionMatrix),[i,r]=n,s=e?r:this.height-r;return 2===t.length?[i,s]:[i,s,n[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,r,s]=t,o=LT([i,e?r:this.height-r,s],this.pixelUnprojectionMatrix,n&&n*this.distanceScales.unitsPerMeter[2]),[a,l,c]=this.unprojectPosition(o);return Number.isFinite(s)?[a,l,c]:Number.isFinite(n)?[a,l,n]:[a,l]}projectPosition(t){const[e,n]=TT(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=kT(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return TT(t)}unprojectFlat(t){return kT(t)}getMapCenterByLngLatPosition({lngLat:t,pos:e}){const n=LT(e,this.pixelUnprojectionMatrix),i=uT([],TT(t),hT([],n));return kT(uT([],this.center,i))}getLocationAtPoint({lngLat:t,pos:e}){return this.getMapCenterByLngLatPosition({lngLat:t,pos:e})}fitBounds(t,e={}){const{width:n,height:i}=this,{longitude:r,latitude:s,zoom:o}=jT(Object.assign({width:n,height:i,bounds:t},e));return new zT({width:n,height:i,longitude:r,latitude:s,zoom:o})}getBounds(t){const e=this.getBoundingRegion(t),n=Math.min(...e.map(t=>t[0])),i=Math.max(...e.map(t=>t[0]));return[[n,Math.min(...e.map(t=>t[1]))],[i,Math.max(...e.map(t=>t[1]))]]}getBoundingRegion(t={}){return BT(this,t.z||0)}}const UT=Math.PI/180,HT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],$T=[0,0,0],GT={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let WT=(()=>{class t{constructor(t={}){const{id:e=null,x:n=0,y:i=0,width:r=1,height:s=1}=t;this.id=e||this.constructor.displayName||"viewport",this.x=n,this.y=i,this.width=r||1,this.height=s||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?Dw.WEB_MERCATOR:Dw.WEB_MERCATOR_AUTO_OFFSET:Dw.IDENTITY}equals(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&FS(e.projectionMatrix,this.projectionMatrix)&&FS(e.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const n=NT(this.projectPosition(t),this.pixelProjectionMatrix),[i,r]=n,s=e?r:this.height-r;return 2===t.length?[i,s]:[i,s,n[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,r,s]=t,o=LT([i,e?r:this.height-r,s],this.pixelUnprojectionMatrix,n&&n*this.distanceScales.unitsPerMeter[2]),[a,l,c]=this.unprojectPosition(o);return Number.isFinite(s)?[a,l,c]:Number.isFinite(n)?[a,l,n]:[a,l]}projectPosition(t){const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?TT(t):t}unprojectFlat(t){return this.isGeospatial?kT(t):t}getBounds(t={}){const e={targetZ:t.z||0},n=this.unproject([0,0],e),i=this.unproject([this.width,0],e),r=this.unproject([0,this.height],e),s=this.unproject([this.width,this.height],e);return[Math.min(n[0],i[0],r[0],s[0]),Math.min(n[1],i[1],r[1],s[1]),Math.max(n[0],i[0],r[0],s[0]),Math.max(n[1],i[1],r[1],s[1])]}getDistanceScales(t=null){return t?AT({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:e,width:n=1,height:i=1}){return t{class t extends WT{constructor(t={}){const{latitude:e=0,longitude:n=0,zoom:i=11,pitch:r=0,bearing:s=0,nearZMultiplier:o=.1,farZMultiplier:a=1.01,orthographic:l=!1,repeat:c=!1,worldOffset:u=0}=t;let{width:h,height:d,altitude:p=1.5}=t;const f=Math.pow(2,i);h=h||1,d=d||1,p=Math.max(.75,p);const{fov:g,aspect:m,focalDistance:b,near:y,far:v}=MT({width:h,height:d,pitch:r,altitude:p,nearZMultiplier:o,farZMultiplier:a});let _=IT({height:d,pitch:r,bearing:s,scale:f,altitude:p});u&&(_=(new bT).translate([512*u,0,0]).multiplyLeft(_)),super(ti(bt({},t),{width:h,height:d,viewMatrix:_,longitude:n,latitude:e,zoom:i,orthographic:l,fovyRadians:g,aspect:m,focalDistance:b,near:y,far:v})),this.latitude=e,this.longitude=n,this.zoom=i,this.pitch=r,this.bearing=s,this.altitude=p,this.orthographic=l,this._subViewports=c?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const e=this.getBounds(),n=Math.floor((e[0]+180)/360),i=Math.ceil((e[2]-180)/360);for(let r=n;r<=i;r++){const e=r?new t(ti(bt({},this),{worldOffset:r})):this;this._subViewports.push(e)}}return this._subViewports}addMetersToLngLat(t,e){return PT(t,e)}panByPosition(t,e){const n=LT(e,this.pixelUnprojectionMatrix),i=uT([],this.projectFlat(t),hT([],n)),r=uT([],this.center,i),[s,o]=this.unprojectFlat(r);return{longitude:s,latitude:o}}getBounds(t={}){const e=BT(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(e,n={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=jT(bt({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:s,latitude:o,zoom:a})}}return t.displayName="WebMercatorViewport",t})();function XT(t,e,n=!1){const i=e.projectPosition(t);if(n&&e instanceof qT){const[n,r,s=0]=t,o=e.getDistanceScales([n,r]);i[2]=s*o.unitsPerMeter[2]}return i}function KT(t,{viewport:e,modelMatrix:n,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=t;switch(n&&([o,a,l]=eT([],[o,a,l,1],n)),i){case Mw.LNGLAT:return XT([o,a,l],e,s);case Mw.LNGLAT_OFFSETS:return XT([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mw.METER_OFFSETS:return XT(PT(r,[o,a,l]),e,s);case Mw.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const QT={10241:9987,10240:9729,10242:33071,10243:33071},ZT={},JT={boolean:{validate:(t,e)=>!0,equal:(t,e,n)=>Boolean(t)===Boolean(e)},number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},color:{validate:(t,e)=>e.optional&&!t||ik(t)&&(3===t.length||4===t.length),equal:(t,e,n)=>tk(t,e)},accessor:{validate(t,e){const n=rk(t);return"function"===n||n===rk(e.value)},equal:(t,e,n)=>"function"==typeof e||tk(t,e)},array:{validate:(t,e)=>e.optional&&!t||ik(t),equal:(t,e,n)=>n.compare?tk(t,e):t===e},function:{validate:(t,e)=>e.optional&&!t||"function"==typeof t,equal:(t,e,n)=>!n.compare||t===e},data:{transform:(t,e,n)=>{const{dataTransform:i}=n?n.props:{};return i&&t?i(t):t}},image:{transform:(t,e,n)=>function(t,e){const n=t.context&&t.context.gl;if(!n||!e)return null;if(e instanceof lS)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new lS(n,ti(bt({},e),{parameters:bt(bt(bt({},QT),i),t.props.textureParameters)}));return ZT[r.id]=!0,r}(n,t),release:t=>{!function(t){!t||!(t instanceof lS)||ZT[t.id]&&(t.delete(),delete ZT[t.id])}(t)}}};function tk(t,e){if(t===e)return!0;if(!ik(t)||!ik(e))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i{},this.oldProps=yk,this.oldAsyncProps=null}finalize(){for(const t in this.asyncProps){const e=this.asyncProps[t];e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){const e=this.asyncProps[t];return e&&e.resolvedValue}isAsyncPropLoading(t){if(t){const e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(const e in this.asyncProps)if(this.isAsyncPropLoading(e))return!0;return!1}reloadAsyncProp(t,e){this._watchPromise(t,Promise.resolve(e))}setAsyncProps(t){const e=t[mk]||{},n=t[gk]||t,i=t[bk]||{};for(const r in e){const t=e[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t),e[r]=this.getAsyncProp(r)}for(const r in n){const t=n[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t)}}_updateAsyncProp(t,e){if(this._didAsyncInputValueChange(t,e)){if("string"==typeof e){var n;const i=null===(n=this.layer)||void 0===n?void 0:n.props.fetch;i&&(e=i(e,{propName:t,layer:this.layer}))}if(e instanceof Promise)return void this._watchPromise(t,e);if(fE(e))return void this._resolveAsyncIterable(t,e);this._setPropValue(t,e)}}_didAsyncInputValueChange(t,e){const n=this.asyncProps[t];return e!==n.resolvedValue&&e!==n.lastValue&&(n.lastValue=e,!0)}_setPropValue(t,e){const n=this.asyncProps[t];e=this._postProcessValue(n,e),n.resolvedValue=e,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}_setAsyncPropValue(t,e,n){const i=this.asyncProps[t];i&&n>=i.resolvedLoadCount&&void 0!==e&&(this.freezeAsyncOldProps(),i.resolvedValue=e,i.resolvedLoadCount=n,this.onAsyncPropUpdated(t,e))}_watchPromise(t,e){const n=this.asyncProps[t];n.pendingLoadCount++;const i=n.pendingLoadCount;e.then(e=>{var r;e=this._postProcessValue(n,e),this._setAsyncPropValue(t,e,i);const s=null===(r=this.layer)||void 0===r?void 0:r.props.onDataLoad;"data"===t&&s&&s(e,{propName:t,layer:this.layer})}).catch(e=>{var n;null===(n=this.layer)||void 0===n||n.raiseError(e,"loading ".concat(t," of ").concat(this.layer))})}_resolveAsyncIterable(t,e){var n=this;return gS(function*(){var i;"data"!==t&&n._setPropValue(t,e);const r=n.asyncProps[t];r.pendingLoadCount++;const s=r.pendingLoadCount;let o=[],a=0;var l,c=!0,u=!1;try{for(var h,d,p=fk(e);c=(h=yield p.next()).done,d=yield h.value,!c;c=!0){const e=d,{dataTransform:i}=n.component?n.component.props:{};o=i?i(e,o):o.concat(e),Object.defineProperty(o,"__diff",{enumerable:!1,value:[{startRow:a,endRow:o.length}]}),a=o.length,n._setAsyncPropValue(t,o,s)}}catch(g){u=!0,l=g}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(u)throw l}}const f=null===(i=n.layer)||void 0===i?void 0:i.props.onDataLoad;f&&f(o,{propName:t,layer:n.layer})})()}_postProcessValue(t,e){const n=t.type;return n&&(n.release&&n.release(t.resolvedValue,n,this.component),n.transform)?n.transform(e,n,this.component):e}_createAsyncPropData(t,e){if(!this.asyncProps[t]){const n=this.component&&this.component.constructor._propTypes;this.asyncProps[t]={type:n&&n[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:_k,ASYNC_RESOLVED:wk,ASYNC_DEFAULTS:xk}=NO,Sk={};let Ek=0,Ck=(()=>{class t{constructor(){this.props=ck.apply(this,arguments),this.id=this.props.id,this.count=Ek++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:e}=this,n={};for(const i in e[xk])i in e[wk]?n[i]=e[wk][i]:i in e[_k]&&(n[i]=e[_k][i]);return new this.constructor(bt(bt(bt({},e),n),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new vk({})}}return t.componentName="Component",t.defaultProps=Sk,t})();class Ok extends vk{constructor({attributeManager:t,layer:e}){super(e),this.attributeManager=t,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(t){this.component=t}}const Tk=t=>"function"==typeof t,kk=t=>null!==t&&"object"==typeof t,Ak=t=>kk(t)&&t.constructor==={}.constructor,Pk=t=>t&&"function"==typeof t[Symbol.iterator],Ik=t=>t&&"function"==typeof t[Symbol.asyncIterator],Mk=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Dk=t=>"undefined"!=typeof Blob&&t instanceof Blob,Rk=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||kk(t)&&Tk(t.tee)&&Tk(t.cancel)&&Tk(t.getReader))(t)||(t=>kk(t)&&Tk(t.read)&&Tk(t.pipe)&&(t=>"boolean"==typeof t)(t.readable))(t);function Nk(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function Lk(t){var e;return!!t&&(Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions))}function jk(t){var e,n;let i;return Nk(t,"null loader"),Nk(Lk(t),"invalid loader"),Array.isArray(t)&&(i=t[1],t=ti(bt({},t=t[0]),{options:bt(bt({},t.options),i)})),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(n=t)&&void 0!==n&&n.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const Fk={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Bk=Fk.global||Fk.self||Fk.window||{},Vk="object"!=typeof process||"[object process]"!==String(process)||process.browser,zk="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);zk&&parseFloat(zk[1]);const Uk={};function Hk(t){for(const e in Uk)t.startsWith(e)&&(t=t.replace(e,Uk[e]));return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${t}`),t}const $k=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Gk=/^([-\w.]+\/[-\w.+]+)/;function Wk(t){const e=Gk.exec(t);return e?e[1]:t}function qk(t){const e=$k.exec(t);return e?e[1]:""}const Xk=/\?.*/;function Yk(t){if(Mk(t)){const e=Qk(t.url||"");return{url:e,type:Wk(t.headers.get("content-type")||"")||qk(e)}}return Dk(t)?{url:Qk(t.name||""),type:t.type||""}:"string"==typeof t?{url:Qk(t),type:qk(t)}:{url:"",type:""}}function Kk(t){return Mk(t)?t.headers["content-length"]||-1:Dk(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function Qk(t){return t.replace(Xk,"")}function Zk(t){return Jk.apply(this,arguments)}function Jk(){return(Jk=gS(function*(t){if(Mk(t))return t;const e={},n=Kk(t);n>=0&&(e["content-length"]=String(n));const{url:i,type:r}=Yk(t);r&&(e["content-type"]=r);const s=yield rA(t);s&&(e["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t));const o=new Response(t,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function tA(t){return eA.apply(this,arguments)}function eA(){return(eA=gS(function*(t){if(!t.ok){const e=yield nA(t);throw new Error(e)}})).apply(this,arguments)}function nA(t){return iA.apply(this,arguments)}function iA(){return(iA=gS(function*(t){let e=`Failed to fetch resource ${t.url} (${t.status}): `;try{const n=t.headers.get("Content-Type");let i=t.statusText;n.includes("application/json")&&(i+=` ${yield t.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(n){}return e})).apply(this,arguments)}function rA(t){return sA.apply(this,arguments)}function sA(){return(sA=gS(function*(t){if("string"==typeof t)return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const e=t.slice(0,5);return yield new Promise(t=>{const n=new FileReader;n.onload=e=>{var n;return t(null==e||null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsDataURL(e)})}return t instanceof ArrayBuffer?`data:base64,${oA(t.slice(0,5))}`:null})).apply(this,arguments)}function oA(t){let e="";const n=new Uint8Array(t);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const dA={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){cA(this,"console",void 0),this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},pA={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function fA(){Bk.loaders=Bk.loaders||{};const{loaders:t}=Bk;return t._state=t._state||{},t._state}const gA=()=>{const t=fA();return t.globalOptions=t.globalOptions||bt({},dA),t.globalOptions};function mA(t,e,n,i){return n=n||[],function(t,e){yA(t,null,dA,pA,e);for(const n of e)yA(t&&t[n.id]||{},n.id,n.options&&n.options[n.id]||{},n.deprecatedOptions&&n.deprecatedOptions[n.id]||{},e)}(t,n=Array.isArray(n)?n:[n]),function(t,e,n){const i=bt({},t.options||{});return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,n),null===i.log&&(i.log=new hA),_A(i,gA()),_A(i,e),i}(e,t,i)}function bA(t,e){const n=gA(),i=t||n;return"function"==typeof i.fetch?i.fetch:kk(i.fetch)?t=>aA(t,i):null!=e&&e.fetch?null==e?void 0:e.fetch:aA}function yA(t,e,n,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in t){const l=!e&&kk(t[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in n)&&!c&&!u)if(a in i)uA.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const t=vA(a,r);uA.warn(`${s} loader option '${o}${a}' not recognized. ${t}`)()}}}function vA(t,e){const n=t.toLowerCase();let i="";for(const r of e)for(const e in r.options){if(t===e)return`Did you mean '${r.id}.${e}'?`;const s=e.toLowerCase();(n.startsWith(s)||s.startsWith(n))&&(i=i||`Did you mean '${r.id}.${e}'?`)}return i}function _A(t,e){for(const n in e)n in e&&(t[n]=Ak(e[n])&&Ak(t[n])?bt(bt({},t[n]),e[n]):e[n])}function wA(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}function xA(t,e="3.0.12"){return wA(t,"no worker provided"),!(!e||!t.version)}const SA={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},EA=SA.global||SA.self||SA.window||{},CA="object"!=typeof process||"[object process]"!==String(process)||process.browser,OA="function"==typeof importScripts,TA="undefined"!=typeof window&&void 0!==window.orientation,kA="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),AA=(kA&&parseFloat(kA[1]),new Map);function PA(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function IA(t,e=!0,n){const i=n||new Set;if(t)if(MA(t))i.add(t);else if(MA(t.buffer))i.add(t.buffer);else if(!ArrayBuffer.isView(t)&&e&&"object"==typeof t)for(const r in t)IA(t[r],e,i);return void 0===n?Array.from(i):[]}function MA(t){return!!t&&(t instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&t instanceof MessagePort||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)}const DA=()=>{};class RA{static isSupported(){return"undefined"!=typeof Worker}constructor(t){cA(this,"name",void 0),cA(this,"source",void 0),cA(this,"url",void 0),cA(this,"terminated",!1),cA(this,"worker",void 0),cA(this,"onMessage",void 0),cA(this,"onError",void 0),cA(this,"_loadableURL","");const{name:e,source:n,url:i}=t;wA(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=DA,this.onError=t=>console.log(t),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=DA,this.onError=DA,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||IA(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+=`worker ${this.name}. `,t.message&&(e+=`${t.message} in `),t.lineno&&(e+=`:${t.lineno}:${t.colno}`),new Error(e)}_createBrowserWorker(){this._loadableURL=function(t){wA(t.source&&!t.url||!t.source&&t.url);let e=AA.get(t.source||t.url);return e||(t.url&&(e=function(t){return t.startsWith("http")?PA(function(t){return`try {\n importScripts('${t}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(t)):t}(t.url),AA.set(t.url,e)),t.source&&(e=PA(t.source),AA.set(t.source,e))),wA(e),e}({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}}class NA{constructor(t,e){cA(this,"name",void 0),cA(this,"workerThread",void 0),cA(this,"isRunning",void 0),cA(this,"result",void 0),cA(this,"_resolve",void 0),cA(this,"_reject",void 0),this.name=t,this.workerThread=e,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e})}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){wA(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){wA(this.isRunning),this.isRunning=!1,this._reject(t)}}class LA{constructor(t){cA(this,"name","unnamed"),cA(this,"source",void 0),cA(this,"url",void 0),cA(this,"maxConcurrency",1),cA(this,"maxMobileConcurrency",1),cA(this,"onDebug",()=>{}),cA(this,"reuseWorkers",!0),cA(this,"props",{}),cA(this,"jobQueue",[]),cA(this,"idleQueue",[]),cA(this,"count",0),cA(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props=bt(bt({},this.props),t),void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}startJob(t,e=((t,e,n)=>t.done(n)),n=((t,e)=>t.error(e))){var i=this;return gS(function*(){const r=new Promise(r=>(i.jobQueue.push({name:t,onMessage:e,onError:n,onStart:r}),i));return i._startQueuedJob(),yield r})()}_startQueuedJob(){var t=this;return gS(function*(){if(!t.jobQueue.length)return;const e=t._getAvailableWorker();if(!e)return;const n=t.jobQueue.shift();if(n){t.onDebug({message:"Starting job",name:n.name,workerThread:e,backlog:t.jobQueue.length});const i=new NA(n.name,e);e.onMessage=t=>n.onMessage(i,t.type,t.payload),e.onError=t=>n.onError(i,t),n.onStart(i);try{yield i.result}finally{t.returnWorkerToQueue(e)}}})()}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class FA{static isSupported(){return RA.isSupported()}static getWorkerFarm(t={}){return FA._workerFarm=FA._workerFarm||new FA({}),FA._workerFarm.setProps(t),FA._workerFarm}constructor(t){cA(this,"props",void 0),cA(this,"workerPools",new Map),this.props=bt({},jA),this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy()}setProps(t){this.props=bt(bt({},this.props),t);for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:n,url:i}=t;let r=this.workerPools.get(e);return r||(r=new LA({name:e,source:n,url:i}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function BA(t,e={}){const n=`${t.id}-worker.js`;let i=(e[t.id]||{}).workerUrl;if("test"===e._workerType&&(i=`modules/${t.module}/dist/${n}`),!i){let e=t.version;"latest"===e&&(e="latest"),i=`https://unpkg.com/@loaders.gl/${t.module}${e?`@${e}`:""}/dist/${n}`}return wA(i),i}function VA(t,e){return!!FA.isSupported()&&t.worker&&(null==e?void 0:e.worker)}function zA(t,e,n,i,r){return UA.apply(this,arguments)}function UA(){return(UA=gS(function*(t,e,n,i,r){const s=t.id,o=BA(t,n),a=FA.getWorkerFarm(n).getWorkerPool({name:s,url:o});n=JSON.parse(JSON.stringify(n));const l=yield a.startJob("process-on-worker",HA.bind(null,r));return l.postMessage("process",{input:e,options:n}),yield(yield l.result).result})).apply(this,arguments)}function HA(t,e,n,i){return $A.apply(this,arguments)}function $A(){return($A=gS(function*(t,e,n,i){switch(n){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:s,input:o,options:a}=i;try{const n=yield t(o,a);e.postMessage("done",{id:s,result:n})}catch(r){const t=r instanceof Error?r.message:"unknown error";e.postMessage("error",{id:s,error:t})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}})).apply(this,arguments)}cA(FA,"_workerFarm",void 0);var GA=n(9521);function WA(t){if(function(t){return t&&"object"==typeof t&&t.isBuffer}(t)&&(t=function(t){return GA.toArrayBuffer?GA.toArrayBuffer(t):t}(t)),t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"==typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"==typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function qA(...t){const e=t.map(t=>t instanceof ArrayBuffer?new Uint8Array(t):t),n=e.reduce((t,e)=>t+e.byteLength,0),i=new Uint8Array(n);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function XA(t,e,n){const i=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(i).buffer}function YA(t){return KA.apply(this,arguments)}function KA(){return(KA=gS(function*(t){const e=[];var n,i=!0,r=!1;try{for(var s,o,a=fk(t);i=(s=yield a.next()).done,o=yield s.value,!i;i=!0)e.push(o)}catch(l){r=!0,n=l}finally{try{!i&&null!=a.return&&(yield a.return())}finally{if(r)throw n}}return qA(...e)})).apply(this,arguments)}const QA=262144;function ZA(t){this.wrapped=t}function JA(t){return new ZA(t)}function tP(t){var e,n;function i(e,n){try{var s=t[e](n),o=s.value,a=o instanceof ZA;Promise.resolve(a?o.wrapped:o).then(function(t){a?i("return"===e?"return":"next",t):r(s.done?"return":"normal",t)},function(t){i("throw",t)})}catch(l){r("throw",l)}}function r(t,r){switch(t){case"return":e.resolve({value:r,done:!0});break;case"throw":e.reject(r);break;default:e.resolve({value:r,done:!1})}(e=e.next)?i(e.key,e.arg):n=null}this._invoke=function(t,r){return new Promise(function(s,o){var a={key:t,arg:r,resolve:s,reject:o,next:null};n?n=n.next=a:(e=n=a,i(t,r))})},"function"!=typeof t.return&&(this.return=void 0)}function eP(t){return function(){return new tP(t.apply(this,arguments))}}function nP(){return(nP=eP(function*(t,e){const n=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;it&&"object"==typeof t&&t.isBuffer)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const n=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let n=t.buffer;const i=t.byteLength||t.length;return(0!==t.byteOffset||i!==n.byteLength)&&(n=n.slice(t.byteOffset,t.byteOffset+i)),n}throw new Error(aP)}function cP(t,e,n){return uP.apply(this,arguments)}function uP(){return(uP=gS(function*(t,e,n){const i=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||i)return lP(t,e);if(Dk(t)&&(t=yield Zk(t)),Mk(t)){const n=t;return yield tA(n),e.binary?yield n.arrayBuffer():yield n.text()}if(Rk(t)&&(t=oP(t,n)),Pk(t)||Ik(t))return YA(t);throw new Error(aP)})).apply(this,arguments)}function hP(t,e,n=null){if(n)return n;const i=bt({fetch:bA(e,t)},t);return Array.isArray(i.loaders)||(i.loaders=null),i}function dP(t,e){if(!e&&t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...t]:t}return n&&n.length?n:null}const pP=()=>{const t=fA();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function fP(t){const e=pP();t=Array.isArray(t)?t:[t];for(const n of t){const t=jk(n);e.find(e=>t===e)||e.unshift(t)}}const gP=/\.([^.]+)$/;function mP(t){return bP.apply(this,arguments)}function bP(){return(bP=gS(function*(t,e=[],n,i){if(!vP(t))return null;let r=yP(t,e,ti(bt({},n),{nothrow:!0}),i);if(r)return r;if(Dk(t)&&(r=yP(t=yield t.slice(0,10).arrayBuffer(),e,n,i)),!(r||null!=n&&n.nothrow))throw new Error(_P(t));return r})).apply(this,arguments)}function yP(t,e=[],n,i){if(!vP(t))return null;if(e&&!Array.isArray(e))return jk(e);let r=[];e&&(r=r.concat(e)),null!=n&&n.ignoreRegisteredLoaders||r.push(...pP()),function(t){for(const e of t)jk(e)}(r);const s=function(t,e,n,i){const{url:r,type:s}=Yk(t),o=r||(null==i?void 0:i.url);let a=null;return null!=n&&n.mimeType&&(a=wP(e,null==n?void 0:n.mimeType)),a=a||function(t,e){const n=e&&gP.exec(e),i=n&&n[1];return i?function(t,e){e=e.toLowerCase();for(const n of t)for(const t of n.extensions)if(t.toLowerCase()===e)return n;return null}(t,i):null}(e,o),a=a||wP(e,s),a=a||function(t,e){if(!e)return null;for(const n of t)if("string"==typeof e){if(xP(e,n))return n}else if(ArrayBuffer.isView(e)){if(SP(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&SP(e,0,n))return n;return null}(e,t),a=a||wP(e,null==n?void 0:n.fallbackMimeType),a}(t,r,n,i);if(!(s||null!=n&&n.nothrow))throw new Error(_P(t));return s}function vP(t){return!(t instanceof Response&&204===t.status)}function _P(t){const{url:e,type:n}=Yk(t);let i="No valid loader found";return t&&(i+=` data: "${function(t,e=5){return"string"==typeof t?t.slice(0,e):ArrayBuffer.isView(t)?EP(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?EP(t,0,e):""}(t)}", contentType: "${n}"`),e&&(i+=` url: ${e}`),i}function wP(t,e){for(const n of t)if(n.mimeTypes&&n.mimeTypes.includes(e)||e===`application/x.${n.id}`)return n;return null}function xP(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(e=>t.startsWith(e))}function SP(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(i=>function(t,e,n,i){if(i instanceof ArrayBuffer)return function(t,e,n){if(t.byteLength<(n=n||t.byteLength)||e.byteLengtht.equals(e));let RP=new Uint8ClampedArray(0);const NP={data:{type:"data",value:MP,async:!0},dataComparator:null,_dataDiff:{type:"function",value:t=>t&&t.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:n,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=n.context;var a;r=r||n.getLoadOptions(),i=i||n.props.loaders,s&&(r=ti(bt({},r),{fetch:ti(bt({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(t);return!l&&!r&&(o.add({resourceId:t,data:AP(t,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:t,onChange:t=>n.internalState.reloadAsyncProp(e,t),consumerId:n.id,requestId:e}):AP(t,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mw.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,100*-t],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let LP=(()=>{class t extends Ck{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,e){var n,i,r,s;e&&(t.message="".concat(e,": ").concat(t.message)),(null===(n=(i=this.props).onError)||void 0===n?void 0:n.call(i,t))||null===(r=this.context)||void 0===r||null===(s=r.onError)||void 0===s||s.call(r,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:e}=this.context,n=KT(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,r,s]=NT(n,e.pixelProjectionMatrix);return 2===t.length?[i,r]:[i,r,s]}unproject(t){const{viewport:e}=this.context;return e.unproject(t)}projectPosition(t){return function(t,e){const{viewport:n,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(t){const e=bt({},t);let{coordinateSystem:n}=t;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=t;return n===Mw.DEFAULT&&(n=i.isGeospatial?Mw.LNGLAT:Mw.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=n),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=n,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=lT(n,i,r),h=KT(t,{viewport:n,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}(h,h,n.projectPosition(l||c));return h}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mw.DEFAULT||t===Mw.LNGLAT||t===Mw.CARTESIAN}onHover(t,e){return!!this.props.onHover&&this.props.onHover(t,e)}onClick(t,e){return!!this.props.onClick&&this.props.onClick(t,e)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,e=[]){return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}decodePickingColor(t){uE(t instanceof Uint8Array);const[e,n,i]=t;return e+256*n+65536*i-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const e of this.props.extensions)t=GO(t,e.getShaders.call(this,e));return t}shouldUpdateState({changeFlags:t}){return t.propsOrDataChanged}updateState({oldProps:t,props:e,changeFlags:n}){const i=this.getAttributeManager();if(n.dataChanged&&i){const{dataChanged:t}=n;if(Array.isArray(t))for(const e of t)i.invalidateAll(e);else i.invalidateAll()}const r=e.highlightedObjectIndex>=0||e.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==r&&i){const{pickingColors:t,instancePickingColors:e}=i.attributes,n=t||e;n&&(r&&n.constant&&(n.constant=!1,i.invalidate(n.id)),!n.value&&!r&&(n.constant=!0,n.value=[0,0,0]))}}finalizeState(){for(const e of this.getModels())e.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const e of this.getModels())e.draw(t)}getPickingInfo({info:t}){const{index:e}=t;return e>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[e]),t}activateViewport(t){const e=this.internalState.viewport;this.internalState.viewport=t,(!e||!DP({oldViewport:e,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",e=""){const n=this.getAttributeManager();!n||("all"===t?n.invalidateAll():n.invalidate(t))}updateAttributes(t){for(const e of this.getModels())this._setModelAttributes(e,t)}_updateAttributes(t){const e=this.getAttributeManager();if(!e)return;const n=this.getNumInstances(t),i=this.getStartIndices(t);e.update({data:t.data,numInstances:n,startIndices:i,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const r=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const e=t.update(),n=Object.create(this.props);for(const t in e)Object.defineProperty(n,t,{value:e[t]});return n}return this.props}calculateInstancePickingColors(t,{numInstances:e}){if(t.constant)return;const n=Math.floor(RP.length/3);if(this.internalState.usesPickingColorCache=!0,nIP&&Iw.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),RP=AS.allocate(RP,e,{size:3,copy:!0,maxCount:Math.max(e,IP)});const t=Math.floor(RP.length/3),i=[];for(let e=n;e{const i={moduleParameters:t,uniforms:e,parameters:n,context:this.context};for(const t of this.props.extensions)t.draw.call(this,i,t);this.draw(i)})}finally{this.props=i}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:e}=this.internalState;for(const i in t)if(t[i]){let n=!1;switch(i){case"dataChanged":Array.isArray(e[i])&&(e[i]=Array.isArray(t[i])?e[i].concat(t[i]):t[i],n=!0);default:e[i]||(e[i]=t[i],n=!0)}n&&PE("layer.changeFlag",this,i,t)}const n=e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged;e.propsOrDataChanged=n,e.somethingChanged=n||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,e){const n=function(t,e){const n=FO({newProps:t,oldProps:e,propTypes:UO(t),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(t,e){if(null===e)return"oldProps is null, initial diff";let n=null;const{dataComparator:i,_dataDiff:r}=t;return i?i(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied"),n&&r&&(n=r(t.data,e.data)||n),n}(t,e);let r=!1;return i||(r=function(t,e){if(null===e)return"oldProps is null, initial diff";if("all"in t.updateTriggers&&zO(t,e,"all"))return{all:!0};const n={};let i=!1;for(const r in t.updateTriggers)"all"!==r&&zO(t,e,r)&&(n[r]=!0,i=n);return i}(t,e)),{dataChanged:i,propsChanged:n,updateTriggersChanged:r,extensionsChanged:VO(t,e),transitionsChanged:jO(t,e)}}(t,e);if(n.updateTriggersChanged)for(const i in n.updateTriggersChanged)n.updateTriggersChanged[i]&&this.invalidateAttribute(i);if(n.transitionsChanged)for(const i in n.transitionsChanged)this.internalState.uniformTransitions.add(i,e[i],t[i],t.transitions[i]);return this.setChangeFlags(n)}validateProps(){!function(t){const e=UO(t);for(const n in e){const i=e[n],{validate:r}=i;if(r&&!r(t[n],i))throw new Error("Invalid prop ".concat(n,": ").concat(t[n]))}}(this.props)}setModuleParameters(t){for(const e of this.getModels())e.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const e={pickingSelectedColor:t.picked?t.color:null},{highlightColor:n}=this.props;t.picked&&"function"==typeof n&&(e.pickingHighlightColor=n(t)),this.setModuleParameters(e),this.setNeedsRedraw()}_updateModules({props:t,oldProps:e},n){const{autoHighlight:i,highlightedObjectIndex:r,highlightColor:s}=t;if(n||e.autoHighlight!==i||e.highlightedObjectIndex!==r||e.highlightColor!==s){const t={};i||(t.pickingSelectedColor=null),Array.isArray(s)&&(t.pickingHighlightColor=s),Number.isInteger(r)&&(t.pickingSelectedColor=r>=0?this.encodePickingColor(r):null),this.setModuleParameters(t)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let e=!1;e=e||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const n=this.getAttributeManager(),i=n&&n.getNeedsRedraw(t);return e=e||i,e}_getAttributeManager(){return new PO(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){uE(!this.internalState&&!this.state),uE(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Ok({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Iw.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new RO(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){PE("layer.matched",this,this===t);const{state:e,internalState:n}=t;this!==t&&(this.internalState=n,this.internalState.layer=this,this.state=e,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return t.layerName="Layer",t.defaultProps=NP,t})(),jP=(()=>{class t extends LP{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:e}=t;return e&&e.__source&&e.__source.parent&&e.__source.parent.id===this.id&&(t.object=e.__source.object,t.index=e.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}getSubLayerClass(t,e){const{_subLayerProps:n}=this.props;return n&&n[t]&&n[t].type||e}getSubLayerRow(t,e,n){return t.__source={parent:this,object:e,index:n},t}getSubLayerAccessor(t){if("function"==typeof t){const e={data:this.props.data,target:[]};return(n,i)=>n&&n.__source?(e.index=n.__source.index,t(n.__source.object,e)):t(n,i)}return t}getSubLayerProps(t={}){const{opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:s,highlightedObjectIndex:o,autoHighlight:a,highlightColor:l,coordinateSystem:c,coordinateOrigin:u,wrapLongitude:h,positionFormat:d,modelMatrix:p,extensions:f,fetch:g,_subLayerProps:m}=this.props,b={opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:s,highlightedObjectIndex:o,autoHighlight:a,highlightColor:l,coordinateSystem:c,coordinateOrigin:u,wrapLongitude:h,positionFormat:d,modelMatrix:p,extensions:f,fetch:g},y=m&&m[t.id],v=y&&y.updateTriggers,_=t.id||"sublayer";if(y){const e=this.constructor._propTypes,n=t.type?t.type._propTypes:{};for(const t in y){const i=n[t]||e[t];i&&"accessor"===i.type&&(y[t]=this.getSubLayerAccessor(y[t]))}}Object.assign(b,t,y),b.id="".concat(this.props.id,"-").concat(_),b.updateTriggers=bt(bt({all:this.props.updateTriggers.all},t.updateTriggers),v);for(const w of f){const t=w.getSubLayerProps.call(this,w);t&&Object.assign(b,t,{updateTriggers:Object.assign(b.updateTriggers,t.updateTriggers)})}return b}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const e=!t||this.needsUpdate();e&&(t=this.renderLayers(),t=gE(t,Boolean),this.internalState.subLayers=t),PE("compositeLayer.renderLayers",this,e,t);for(const n of t)n.parent=this}}return t.layerName="CompositeLayer",t})();const FP=/([0-9]+\.?[0-9]*)(%|px)/;function BP(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=t.match(FP);if(e&&e.length>=3){const t="%"===e[2],n=parseFloat(e[1]);return{position:t?n/100:n,relative:t}}default:throw new Error("Could not parse position string ".concat(t))}}function VP(t,e){return t.relative?Math.round(t.position*e):t.position}function zP(t,e){if(t===e)return!0;if(!t||!e)return!1;for(const n in t){const i=t[n],r=e[n];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&zP(i,r)))return!1}return!0}class UP{constructor(t={}){const{id:e=null,x:n=0,y:i=0,width:r="100%",height:s="100%",projectionMatrix:o=null,fovy:a=50,near:l=.1,far:c=1e3,modelMatrix:u=null,viewportInstance:h=null,type:d=WT}=t;uE(!h||h instanceof WT),this.viewportInstance=h,this.id=e||this.constructor.displayName||"view",this.type=d,this.props=ti(bt({},t),{id:this.id,projectionMatrix:o,fovy:a,near:l,far:c,modelMatrix:u}),this._parseDimensions({x:n,y:i,width:r,height:s}),this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||(this.viewportInstance?t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):zP(this.props,t.props))}makeViewport({width:t,height:e,viewState:n}){if(this.viewportInstance)return this.viewportInstance;n=this.filterViewState(n);const i=this.getDimensions({width:t,height:e});return this._getViewport(n,i)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(t){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e=bt({},t);for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions({width:t,height:e}){return{x:VP(this._x,t),y:VP(this._y,e),width:VP(this._width,t),height:VP(this._height,e)}}_getControllerProps(t){let e=this.props.controller;return e?!0===e?t:("function"==typeof e&&(e={type:e}),bt(bt({},t),e)):null}_getViewport(t,e){const{type:n}=this;return new n(bt(bt(bt({},t),this.props),e))}_parseDimensions({x:t,y:e,width:n,height:i}){this._x=BP(t),this._y=BP(e),this._width=BP(n),this._height=BP(i)}}const HP=()=>{},$P={transitionEasing:t=>t,transitionInterruption:1,onTransitionStart:HP,onTransitionInterrupt:HP,onTransitionEnd:HP};class GP{constructor(t,e={}){this.ControllerState=t,this.props=bt(bt({},$P),e),this.propsInTransition=null,this.transition=new OO(e.timeline),this.onViewStateChange=e.onViewStateChange||HP,this.onStateChange=e.onStateChange||HP,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const n=this.props;if(t=bt(bt({},$P),t),this.props=t,this._shouldIgnoreViewportChange(n,t))return e;if(this._isTransitionEnabled(t)){const{interruption:i,endProps:r}=this.transition.settings,s=bt(bt({},n),2===i?r:this.propsInTransition||n);this._triggerTransition(s,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:n}=t;return(e>0||"auto"===e)&&Boolean(n)}_isUpdateDueToCurrentTransition(t){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const n=new this.ControllerState(t),i=new this.ControllerState(e).shortestPathFrom(n),{transitionInterpolator:r}=e,s=r.getDuration?r.getDuration(t,e):e.transitionDuration;if(0===s)return;const o=e.transitionInterpolator.initializeProps(t,i);this.propsInTransition={},this.duration=s,this.transition.start({duration:s,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startProps:o.start,endProps:o.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),t(e)}}_onTransitionUpdate(t){const{time:e,settings:{interpolator:n,startProps:i,endProps:r,duration:s,easing:o}}=t,a=o(e/s),l=n.interpolateProps(i,r,a);this.propsInTransition=new this.ControllerState(bt(bt({},this.props),l)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const WP=["longitude","latitude","zoom","bearing","pitch"],qP=["longitude","latitude","zoom"];class XP extends class{constructor(t={}){Array.isArray(t)&&(t={compare:t,extract:t,required:t});const{compare:e,extract:n,required:i}=t;this._propsToCompare=e,this._propsToExtract=n,this._requiredProps=i}arePropsEqual(t,e){for(const n of this._propsToCompare||Object.keys(e))if(!(n in t)||!(n in e)||!FS(t[n],e[n]))return!1;return!0}initializeProps(t,e){let n;if(this._propsToExtract){const i={},r={};for(const n of this._propsToExtract)i[n]=t[n],r[n]=e[n];n={start:i,end:r}}else n={start:t,end:e};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}interpolateProps(t,e,n){return e}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){!this._requiredProps||this._requiredProps.forEach(e=>{const n=t[e];uE(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))})}}{constructor(t={}){super((Array.isArray(t)?t:t.transitionProps)||{compare:WP,extract:WP,required:qP}),this.opts=t}initializeProps(t,e){const n=super.initializeProps(t,e),{makeViewport:i,around:r}=this.opts;if(i&&r){const s=i(t),o=i(e),a=s.unproject(r);n.start.around=r,Object.assign(n.end,{around:o.project(a),aroundPosition:a,width:e.width,height:e.height})}return n}interpolateProps(t,e,n){const i={};for(const r of this._propsToExtract)i[r]=jS(t[r]||0,e[r]||0,n);if(e.aroundPosition){const r=this.opts.makeViewport(bt(bt({},e),i));Object.assign(i,r.panByPosition(e.aroundPosition,jS(t.around,e.around,n)))}return i}}const YP={transitionDuration:0},KP={transitionDuration:300,transitionEasing:t=>t,transitionInterruption:1},QP=t=>1-(1-t)*(1-t),ZP=["wheel"],JP=["panstart","panmove","panend"],tI=["pinchstart","pinchmove","pinchend"],eI=["tripanstart","tripanmove","tripanend"],nI=["doubletap"],iI=["keydown"];class rI{constructor(t,e={}){this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new GP(t,ti(bt({},e),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const n=this.linearTransitionProps;this._transition=n&&ti(bt({},KP),{transitionInterpolator:new XP({transitionProps:n})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(e)}get linearTransitionProps(){return null}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.setProps(this.controllerStateProps)}finalize(){for(const t in this._events)this._events[t]&&this.eventManager.off(t,this.handleEvent);this.transitionManager.finalize()}handleEvent(t){const{ControllerState:e}=this;this.controllerState=new e(bt(bt({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const n=this._eventStartBlocked;switch(t.type){case"panstart":return!n&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!n&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!n&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}getCenter(t){const{x:e,y:n}=this.controllerStateProps,{offsetCenter:i}=t;return[i.x-e,i.y-n]}isPointInBounds(t,e){const{width:n,height:i}=this.controllerStateProps;if(e&&e.handled)return!1;const r=t[0]>=0&&t[0]<=n&&t[1]>=0&&t[1]<=i;return r&&e&&e.stopPropagation(),r}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(t){const e=setTimeout(()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)},t);this._eventStartBlocked=e}setProps(t){"onViewStateChange"in t&&(this.onViewStateChange=t.onViewStateChange),"onStateChange"in t&&(this.onStateChange=t.onStateChange),"makeViewport"in t&&(this.makeViewport=t.makeViewport),"dragMode"in t&&(this.dragMode=t.dragMode),this.controllerStateProps=t,"eventManager"in t&&this.eventManager!==t.eventManager&&(this.eventManager=t.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);let{inertia:e}=t;!0===e&&(e=300),this.inertia=e;const{scrollZoom:n=!0,dragPan:i=!0,dragRotate:r=!0,doubleClickZoom:s=!0,touchZoom:o=!0,touchRotate:a=!1,keyboard:l=!0}=t,c=Boolean(this.onViewStateChange);this.toggleEvents(ZP,c&&n),this.toggleEvents(JP,c&&(i||r)),this.toggleEvents(tI,c&&(o||a)),this.toggleEvents(eI,c&&a),this.toggleEvents(nI,c&&s),this.toggleEvents(iI,c&&l),this.scrollZoom=n,this.dragPan=i,this.dragRotate=r,this.doubleClickZoom=s,this.touchZoom=o,this.touchRotate=a,this.keyboard=l}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach(t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))})}updateViewport(t,e={},n={}){const i=bt(bt({},t.getViewportProps()),e),r=this.controllerState!==t;if(this._state=t.getState(),this._setInteractionState(n),r){const t=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:t})}}_onTransition(t){this.onViewStateChange&&(t.interactionState=this._interactionState,this.onViewStateChange(t))}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let n=this.isFunctionKeyPressed(t)||t.rightButton;(this.invertPan||"pan"===this.dragMode)&&(n=!n);const i=this.controllerState[n?"panStart":"rotateStart"]({pos:e});return this._panMove=n,this.updateViewport(i,YP,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),n=this.controllerState.pan({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const n=this.getCenter(t),i=this.controllerState.pan({pos:[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2]}).panEnd();this.updateViewport(i,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),n=this.controllerState.rotate({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const n=this.getCenter(t),i=this.controllerState.rotate({pos:[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2]}).rotateEnd();this.updateViewport(i,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;t.preventDefault();const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const{speed:n=.01,smooth:i=!1}=this.scrollZoom,{delta:r}=t;let s=2/(1+Math.exp(-Math.abs(r*n)));r<0&&0!==s&&(s=1/s);const o=this.controllerState.zoom({pos:e,scale:s});return this.updateViewport(o,ti(bt({},this._getTransitionProps({around:e})),{transitionDuration:i?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.rotateStart({pos:e});return this.updateViewport(n,YP,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate||!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const n=this.controllerState.rotate({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const n=this.getCenter(t),i=[n[0],n[1]+=t.velocityY*e/2],r=this.controllerState.rotate({pos:i});this.updateViewport(r,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(n,YP,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:n}=t,i=this.getCenter(t);e=e.zoom({pos:i,scale:n})}if(this.touchRotate){const{rotation:n}=t;e=e.rotate({deltaAngleX:this._startPinchRotation-n})}return this.updateViewport(e,YP,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e,_lastPinchEvent:n}=this;if(this.touchZoom&&e&&n&&t.scale!==n.scale){const i=this.getCenter(t);let r=this.controllerState.rotateEnd();const s=Math.log2(t.scale),o=(s-Math.log2(n.scale))/(t.deltaTime-n.deltaTime),a=Math.pow(2,s+o*e/2);r=r.zoom({pos:i,scale:a}).zoomEnd(),this.updateViewport(r,ti(bt({},this._getTransitionProps({around:i})),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.isFunctionKeyPressed(t),i=this.controllerState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:n,moveSpeed:i,rotateSpeedX:r,rotateSpeedY:s}=this.keyboard,{controllerState:o}=this;let a;const l={};switch(t.srcEvent.code){case"Minus":a=e?o.zoomOut(n).zoomOut(n):o.zoomOut(n),l.isZooming=!0;break;case"Equal":a=e?o.zoomIn(n).zoomIn(n):o.zoomIn(n),l.isZooming=!0;break;case"ArrowLeft":e?(a=o.rotateLeft(r),l.isRotating=!0):(a=o.moveLeft(i),l.isPanning=!0);break;case"ArrowRight":e?(a=o.rotateRight(r),l.isRotating=!0):(a=o.moveRight(i),l.isPanning=!0);break;case"ArrowUp":e?(a=o.rotateUp(s),l.isRotating=!0):(a=o.moveUp(i),l.isPanning=!0);break;case"ArrowDown":e?(a=o.rotateDown(s),l.isRotating=!0):(a=o.moveDown(i),l.isPanning=!0);break;default:return!1}return this.updateViewport(a,this._getTransitionProps(),l),!0}_getTransitionProps(t){const{_transition:e}=this;return e?t?ti(bt({},e),{transitionInterpolator:new XP(ti(bt({},t),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):e:YP}}class sI{constructor(t){this._viewportProps=this._applyConstraints(t)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(t){return this._viewportProps}_applyConstraints(t){return t}}const oI=[0,0,0];class aI extends sI{constructor({makeViewport:t,width:e,height:n,rotationX:i=0,rotationOrbit:r=0,target:s=oI,zoom:o=0,minRotationX:a=-90,maxRotationX:l=90,minZoom:c=-(1/0),maxZoom:u=Infinity,startPanPosition:h,startRotatePos:d,startRotationX:p,startRotationOrbit:f,startZoomPosition:g,startZoom:m}){super({width:e,height:n,rotationX:i,rotationOrbit:r,target:s,zoom:o,minRotationX:a,maxRotationX:l,minZoom:c,maxZoom:u}),this._state={startPanPosition:h,startRotatePos:d,startRotationX:p,startRotationOrbit:f,startZoomPosition:g,startZoom:m},this.makeViewport=t}panStart({pos:t}){return this._getUpdatedState({startPanPosition:this._unproject(t)})}pan({pos:t,startPosition:e}){const n=this._state.startPanPosition||e;if(!n)return this;const i=this.makeViewport(this._viewportProps).panByPosition(n,t);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){const{startRotatePos:i,startRotationX:r,startRotationOrbit:s}=this._state,{width:o,height:a}=this._viewportProps;if(!i||!Number.isFinite(r)||!Number.isFinite(s))return this;let l;if(t){let e=(t[0]-i[0])/o;(r<-90||r>90)&&(e*=-1),l={rotationX:r+(t[1]-i[1])/a*180,rotationOrbit:s+180*e}}else l={rotationX:r+n,rotationOrbit:s+e};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(t){const e=t.getViewportProps(),n=bt({},this._viewportProps),{rotationOrbit:i}=n;return Math.abs(i-e.rotationOrbit)>180&&(n.rotationOrbit=i<0?i+360:i-360),n}zoomStart({pos:t}){return this._getUpdatedState({startZoomPosition:this._unproject(t),startZoom:this._viewportProps.zoom})}zoom({pos:t,startPos:e,scale:n}){const{zoom:i}=this._viewportProps;let{startZoom:r,startZoomPosition:s}=this._state;Number.isFinite(r)||(r=i,s=this._unproject(e)||this._unproject(t));const o=this._calculateNewZoom({scale:n,startZoom:r}),a=this.makeViewport(ti(bt({},this._viewportProps),{zoom:o}));return this._getUpdatedState(bt({zoom:o},a.panByPosition(s,t)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}zoomOut(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}moveLeft(t=50){return this._panFromCenter([-t,0])}moveRight(t=50){return this._panFromCenter([t,0])}moveUp(t=50){return this._panFromCenter([0,-t])}moveDown(t=50){return this._panFromCenter([0,t])}rotateLeft(t=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-t})}rotateRight(t=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+t})}rotateUp(t=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-t})}rotateDown(t=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+t})}_unproject(t){const e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}_calculateNewZoom({scale:t,startZoom:e}){const{maxZoom:n,minZoom:i}=this._viewportProps;return Number.isFinite(e)||(e=this._viewportProps.zoom),LS(e+Math.log2(t),i,n)}_panFromCenter(t){const{width:e,height:n,target:i}=this._viewportProps;return this.pan({startPosition:i,pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new aI(bt(bt(bt({},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i,maxRotationX:r,minRotationX:s,rotationOrbit:o}=t;return t.zoom=LS(i,n,e),t.rotationX=LS(t.rotationX,s,r),(o<-180||o>180)&&(t.rotationOrbit=function(t,e){const n=t%360;return n<0?360+n:n}(o+180)-180),t}}class lI extends rI{constructor(t){super(aI,t)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class cI extends rI{constructor(t){t.dragMode=t.dragMode||"pan",super(aI,t)}_onPanRotate(t){return!1}get linearTransitionProps(){return["target","zoom"]}}const uI=(new bT).lookAt({eye:[0,0,1]});function hI({width:t,height:e,near:n,far:i}){return t=t||1,e=e||1,(new bT).ortho({left:-t/2,right:t/2,bottom:-e/2,top:e/2,near:n,far:i})}class dI extends WT{constructor(t){const{width:e,height:n,near:i=.1,far:r=1e3,zoom:s=0,target:o=[0,0,0],flipY:a=!0}=t,l=Math.pow(2,s);super(ti(bt({},t),{longitude:null,position:o,viewMatrix:uI.clone().scale([l,l*(a?-1:1),l]),projectionMatrix:hI({width:e,height:n,near:i,far:r}),zoom:s}))}panByPosition(t,e){const n=uT([],t,hT([],LT(e,this.pixelUnprojectionMatrix)));return{target:uT([],this.center,n)}}}let pI=(()=>{class t extends UP{constructor(t){super(ti(bt({},t),{type:dI}))}get controller(){return this._getControllerProps({type:cI})}}return t.displayName="OrthographicView",t})();const fI=Math.PI/180;function gI({height:t,fovy:e,orbitAxis:n,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*fI/2),a="Z"===n?[0,0,1]:[0,1,0],l="Z"===n?[0,-o,0]:[0,0,o],c=(new bT).lookAt({eye:l,up:a});c.rotateX(i*fI),"Z"===n?c.rotateZ(r*fI):c.rotateY(r*fI);const u=Math.pow(2,s)/(t||1);return c.scale(u),c}class mI extends WT{constructor(t){const{height:e,fovy:n,orbitAxis:i,target:r=[0,0,0],rotationX:s=0,rotationOrbit:o=0,zoom:a=0}=t;super(ti(bt({},t),{longitude:null,viewMatrix:gI({height:e,fovy:n,orbitAxis:i,rotationX:s,rotationOrbit:o,zoom:a}),fovy:n,position:r,zoom:a})),this.projectedCenter=this.project(this.center)}unproject(t,{topLeft:e=!0}={}){const[n,i,r=this.projectedCenter[2]]=t,s=e?i:this.height-i,[o,a,l]=LT([n,s,r],this.pixelUnprojectionMatrix);return[o,a,l]}panByPosition(t,e){const n=this.project(t);return{target:this.unproject([this.width/2+n[0]-e[0],this.height/2+n[1]-e[1],this.projectedCenter[2]])}}}let bI=(()=>{class t extends UP{constructor(t={}){const{orbitAxis:e="Z"}=t;super(ti(bt({},t),{orbitAxis:e,type:mI}))}get controller(){return this._getControllerProps({type:lI})}}return t.displayName="OrbitView",t})();const yI=[255,255,255],vI=1;let _I=0;class wI{constructor(t={}){const{color:e=yI}=t,{intensity:n=vI}=t;this.id=t.id||"ambient-".concat(_I++),this.color=e,this.intensity=n,this.type="ambient"}}const xI=[255,255,255],SI=1,EI=[0,0,-1];let CI=0;class OI{constructor(t={}){const{color:e=xI}=t,{intensity:n=SI}=t,{direction:i=EI}=t,{_shadow:r=!1}=t;this.id=t.id||"directional-".concat(CI++),this.color=e,this.intensity=n,this.type="directional",this.direction=new nE(i).normalize().toArray(),this.shadow=r}getProjectedLight(){return this}}class TI{constructor(t={}){const{id:e="effect"}=t;this.id=e,this.props=bt({},t)}preRender(){}getModuleParameters(){}cleanup(){}}class kI extends class{constructor(t,e={}){const{id:n="pass"}=e;this.id=n,this.gl=t,this.props=bt({},e)}setProps(t){Object.assign(this.props,t)}render(){}cleanup(){}}{render(t){return yx(this.gl,{framebuffer:t.target}),this._drawLayers(t)}_drawLayers(t){const{viewports:e,views:n,onViewportActive:i,clearCanvas:r=!0}=t;t.pass=t.pass||"unknown";const s=this.gl;r&&function(t){yx(t,{viewport:[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}),t.clear(16640)}(s);const o=[];for(const a of e){const e=a.viewport||a,r=n&&n[e.id];i(e);const l=this._getDrawLayerParams(e,t);t.view=r;const c=e.subViewports||[e];for(const n of c){t.viewport=n;const e=this._drawLayersInViewport(s,t,l);o.push(e)}}return o}_getDrawLayerParams(t,{layers:e,pass:n,layerFilter:i,effects:r,moduleParameters:s}){const o=[],a=AI(),l={viewport:t,isPicking:n.startsWith("picking"),renderPass:n};for(let c=0;cpS(t,e))}const a={totalCount:e.length,visibleCount:0,compositeCount:0,pickableCount:0};yx(t,{viewport:o});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in n){const t=n[l]=n[l]||AI(e[l],e);c=t(r,s),n[a]=t}else Number.isFinite(o)?(c=o+(e[l]||0),n[a]=null):c=t;return s&&c>=t&&(t=c+1),e[a]=c,c};return i}class PI extends kI{constructor(t,e){super(t,e),this.shadowMap=new lS(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new hS(t,{format:33189,width:1,height:1}),this.fbo=new SS(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;vx(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const n=t.viewports[0],i=_x(this.gl),r=n.width*i,s=n.height*i;(r!==e.width||s!==e.height)&&e.resize({width:r,height:s}),super.render(ti(bt({},t),{target:e,pass:"shadow"}))})}shouldDrawLayer(t){return!1!==t.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const II=Object.keys(Mw).map(t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(Mw[t],";")).join(""),MI=Object.keys(Dw).map(t=>"const int PROJECTION_MODE_".concat(t," = ").concat(Dw[t],";")).join("");var DI="".concat(II,"\n").concat(MI,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n");const RI={};var NI={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:DI,getUniforms:function(t=RI){return t.viewport?function({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:i=Mw.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mw.DEFAULT&&(i=t.isGeospatial?Mw.LNGLAT:Mw.CARTESIAN);const o=aT({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=n||rT,o}(t):{}}};const LI=$O(function({viewport:t,center:e}){return new bT(t.viewProjectionMatrix).invert().transform(e)}),jI=$O(function({viewport:t,shadowMatrices:e}){const n=[],i=t.pixelUnprojectionMatrix,r=t.isGeospatial?void 0:1,s=[[0,0,r],[t.width,0,r],[0,t.height,r],[t.width,t.height,r],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(t=>function(t,e){const[n,i,r]=t,s=LT([n,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(t,i));for(const o of e){const e=o.clone().translate(new nE(t.center).negate()),i=s.map(t=>e.transform(t)),r=(new bT).ortho({left:Math.min(...i.map(t=>t[0])),right:Math.max(...i.map(t=>t[0])),bottom:Math.min(...i.map(t=>t[1])),top:Math.max(...i.map(t=>t[1])),near:Math.min(...i.map(t=>-t[2])),far:Math.max(...i.map(t=>-t[2]))});n.push(r.multiplyRight(o))}return n}),FI=[0,0,0,1],BI=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];var VI={name:"shadow",dependencies:[NI],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(t={},e={})=>{if(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0){const{shadowEnabled:n=!0}=t;return n&&t.shadowMatrices&&t.shadowMatrices.length>0?function(t={},e={}){const n={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||FI,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},i=LI({viewport:t.viewport,center:e.project_uCenter}),r=[],s=jI({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let o=0;o0?t.shadowMaps[o]:t.dummyShadowMap;return n}(t,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}};const zI={color:[255,255,255],intensity:1},UI=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],HI=[0,0,0,200/255];class $I extends TI{constructor(t){super(t),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=HI,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const e in t){const n=t[e];switch(n.type){case"ambient":this.ambientLight=n;break;case"directional":this.directionalLights.push(n);break;case"point":this.pointLights.push(n)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(t,{layers:e,layerFilter:n,viewports:i,onViewportActive:r,views:s}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=sO.getDefaultProgramManager(t),VI&&this.programManager.addDefaultModule(VI)),this.dummyShadowMap||(this.dummyShadowMap=new lS(t,{width:1,height:1}));for(let t=0;te.getProjectedLight({layer:t})),pointLights:this.pointLights.map(e=>e.getProjectedLight({layer:t}))},e}cleanup(){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(VI),this.programManager=null)}_createLightMatrix(){const t=[];for(const e of this.directionalLights){const n=(new bT).lookAt({eye:new nE(e.direction).negate()});t.push(n)}return t}_createShadowPasses(t){for(let e=0;e=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const i of e)this._setChannelTime(i,this.time);const n=this.animations.values();for(const i of n){const{animation:t,channel:e}=i;t.setTime(this.getTime(e))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const n=WI++;return this.animations.set(n,{animation:t,channel:e}),t.setTime(this.getTime(e)),n}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const n=e-t.delay;n>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,n)%t.duration,t.time*=t.rate)}}class XI{constructor(t,e,n){this.id=t,this.context=n,this._loadCount=0,this._subscribers=new Set,this.setData(e)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(t,e){if(t===this._data&&!e)return;this._data=t;const n=++this._loadCount;let i=t;"string"==typeof t&&(i=AP(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then(t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=null,this._content=t)}).catch(t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=t||!0)})):(this.isLoaded=!0,this._error=null,this._content=t);for(const r of this._subscribers)r.onChange(this.getData())}}class YI{constructor({gl:t,protocol:e}){this.protocol=e||"resource://",this._context={gl:t,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return!!t.startsWith(this.protocol)||t in this._resources}add({resourceId:t,data:e,forceUpdate:n=!1,persistent:i=!0}){let r=this._resources[t];r?r.setData(e,n):(r=new XI(t,e,this._context),this._resources[t]=r),r.persistent=i}remove(t){const e=this._resources[t];e&&(e.delete(),delete this._resources[t])}unsubscribe({consumerId:t}){const e=this._consumers[t];if(e){for(const t in e){const n=e[t];n.resource&&n.resource.unsubscribe(n)}delete this._consumers[t],this.prune()}}subscribe({resourceId:t,onChange:e,consumerId:n,requestId:i="default"}){const{_resources:r,protocol:s}=this;t.startsWith(s)&&(r[t=t.replace(s,"")]||this.add({resourceId:t,data:null,persistent:!1}));const o=r[t];if(this._track(n,i,o,e),o)return o.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const t in this._resources)this._resources[t].delete()}_track(t,e,n,i){const r=this._consumers,s=r[t]=r[t]||{},o=s[e]||{};o.resource&&(o.resource.unsubscribe(o),o.resource=null,this.prune()),n&&(s[e]=o,o.onChange=i,o.resource=n,n.subscribe(o))}_prune(){this._pruneRequest=null;for(const t of Object.keys(this._resources)){const e=this._resources[t];!e.persistent&&!e.inUse()&&(e.delete(),delete this._resources[t])}}}const KI=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},NI],QI=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function ZI(t){const e=sO.getDefaultProgramManager(t);for(const n of KI)e.addDefaultModule(n);for(const n of QI)e.addShaderHook(n);return e}const JI=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class tM{constructor(t,{deck:e,stats:n,viewport:i,timeline:r}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new YI({gl:t,protocol:"deck://"}),this.context=ti(bt({},JI),{layerManager:this,gl:t,deck:e,programManager:t&&ZI(t),stats:n||new Ix({id:"deck.gl"}),viewport:i||new WT({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:r||new qI,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const t of this.layers)this._finalizeLayer(t)}needsRedraw(t={clearRedrawFlags:!1}){let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(const n of this.layers){const i=n.getNeedsRedraw(t);e=e||i}return e}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers({layerIds:t=null}={}){return t?this.layers.filter(e=>t.find(t=>0===e.id.indexOf(t))):this.layers}setProps(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}setLayers(t,e){PE("layerManager.setLayers",this,e,t),this.lastRenderedLayers=t,t=gE(t,Boolean);for(const n of t)n.context=this.context;return this._updateLayers(this.layers,t),this}updateLayers(){const t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this.lastRenderedLayers,t)),this._nextLayers=null}activateViewport(t){return PE("layerManager.activateViewport",this,t),t&&(this.context.viewport=t),this}_handleError(t,e,n){n.raiseError(e,"".concat(t," of ").concat(n))}_updateLayers(t,e){const n={};for(const s of t)n[s.id]?Iw.warn("Multiple old layers with same id ".concat(s.id))():n[s.id]=s;const i=[];this._updateSublayersRecursively(e,n,i),this._finalizeOldLayers(n);let r=!1;for(const s of i)if(s.hasUniformTransition()){r=!0;break}this._needsUpdate=r,this.layers=i}_updateSublayersRecursively(t,e,n){for(const r of t){r.context=this.context;const t=e[r.id];null===t&&Iw.warn("Multiple new layers with same id ".concat(r.id))(),e[r.id]=null;let s=null;try{this._debug&&t!==r&&r.validateProps(),t?(this._transferLayerState(t,r),this._updateLayer(r)):this._initializeLayer(r),n.push(r),s=r.isComposite&&r.getSubLayers()}catch(i){this._handleError("matching",i,r)}s&&this._updateSublayersRecursively(s,e,n)}}_finalizeOldLayers(t){for(const e in t){const n=t[e];n&&this._finalizeLayer(n)}}_initializeLayer(t){try{t._initialize(),t.lifecycle="Initialized"}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(t,e){e._transferState(t),e.lifecycle="Matched. State transferred from previous layer",e!==t&&(t.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle="No longer matched. Awaiting garbage collection";try{t._finalize(),t.lifecycle="Finalized! Awaiting garbage collection"}catch(e){this._handleError("finalization",e,t)}}}class eM{constructor(t={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(const t in this.controllers)this.controllers[t]&&this.controllers[t].finalize();this.controllers={}}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(const t in this.controllers){const e=this.controllers[t];e&&e.updateTransition()}}getViewports(t){return t?this._viewports.filter(e=>e.containsPixel(t)):this._viewports}getViews(){const t={};return this.views.forEach(e=>{t[e.id]=e}),t}getView(t){return"string"==typeof t?this.views.find(e=>e.id===t):t}getViewState(t){const e=this.getView(t),n=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(n):n}getViewport(t){return this._viewportMap[t]}unproject(t,e){const n=this.getViewports(),i={x:t[0],y:t[1]};for(let r=n.length-1;r>=0;--r){const s=n[r];if(s.containsPixel(i)){const n=t.slice();return n[0]-=s.x,n[1]-=s.y,s.unproject(n,e)}}return null}setProps(t){"views"in t&&this._setViews(t.views),"viewState"in t&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,e){(t!==this.width||e!==this.height)&&(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}_setViews(t){t=gE(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){t?(!zP(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):Iw.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(t,e){e.viewId=t,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(e)}_createController(t,e){return new(0,e.type)(bt({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>t._getViewport(e,{width:e.width,height:e.height})},e))}_updateController(t,e,n,i){let r=t.controller;return r?(r=ti(bt(bt(bt({},e),t.props),r),{id:t.id,x:n.x,y:n.y,width:n.width,height:n.height}),i?i.setProps(r):i=this._createController(t,r),i):null}_rebuildViewports(){const{width:t,height:e,views:n}=this,i=this.controllers;this._viewports=[],this.controllers={};let r=!1;for(let s=n.length;s--;){const o=n[s],a=this.getViewState(o),l=o.makeViewport({width:t,height:e,viewState:a});let c=i[o.id];o.controller&&!c&&(r=!0),(r||!o.controller)&&c&&(c.finalize(),c=null),this.controllers[o.id]=this._updateController(o,a,l,c),this._viewports.unshift(l)}for(const s in i)i[s]&&!this.controllers[s]&&i[s].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)})}_diffViews(t,e){return t.length!==e.length||t.some((n,i)=>!t[i].equals(e[i]))}}class nM extends sI{constructor({makeViewport:t,width:e,height:n,latitude:i,longitude:r,zoom:s,bearing:o=0,pitch:a=0,altitude:l=1.5,maxZoom:c=20,minZoom:u=0,maxPitch:h=60,minPitch:d=0,startPanLngLat:p,startZoomLngLat:f,startRotatePos:g,startBearing:m,startPitch:b,startZoom:y,normalize:v}={}){uE(Number.isFinite(r)),uE(Number.isFinite(i)),uE(Number.isFinite(s)),super({width:e,height:n,latitude:i,longitude:r,zoom:s,bearing:o,pitch:a,altitude:l,maxZoom:c,minZoom:u,maxPitch:h,minPitch:d,normalize:v}),this._state={startPanLngLat:p,startZoomLngLat:f,startRotatePos:g,startBearing:m,startPitch:b,startZoom:y},this.makeViewport=t}panStart({pos:t}){return this._getUpdatedState({startPanLngLat:this._unproject(t)})}pan({pos:t,startPos:e}){const n=this._state.startPanLngLat||this._unproject(e);if(!n)return this;const i=this.makeViewport(this._viewportProps).panByPosition(n,t);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){const{startRotatePos:i,startBearing:r,startPitch:s}=this._state;if(!i||!Number.isFinite(r)||!Number.isFinite(s))return this;let o;return o=t?this._calculateNewPitchAndBearing(ti(bt({},this._getRotationParams(t,i)),{startBearing:r,startPitch:s})):{bearing:r+e,pitch:s+n},this._getUpdatedState(o)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:t}){return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}zoom({pos:t,startPos:e,scale:n}){let{startZoom:i,startZoomLngLat:r}=this._state;Number.isFinite(i)||(i=this._viewportProps.zoom,r=this._unproject(e)||this._unproject(t));const s=this._calculateNewZoom({scale:n,startZoom:i}),o=this.makeViewport(ti(bt({},this._viewportProps),{zoom:s}));return this._getUpdatedState(bt({zoom:s},o.panByPosition(r,t)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(t=2){return this._zoomFromCenter(t)}zoomOut(t=2){return this._zoomFromCenter(1/t)}moveLeft(t=100){return this._panFromCenter([t,0])}moveRight(t=100){return this._panFromCenter([-t,0])}moveUp(t=100){return this._panFromCenter([0,t])}moveDown(t=100){return this._panFromCenter([0,-t])}rotateLeft(t=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-t})}rotateRight(t=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+t})}rotateUp(t=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+t})}rotateDown(t=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),n=bt({},this._viewportProps),{bearing:i,longitude:r}=n;return Math.abs(i-e.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-e.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}_zoomFromCenter(t){const{width:e,height:n}=this._viewportProps;return this.zoom({pos:[e/2,n/2],scale:t})}_panFromCenter(t){const{width:e,height:n}=this._viewportProps;return this.pan({startPos:[e/2,n/2],pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new this.constructor(bt(bt(bt({makeViewport:this.makeViewport},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i}=t;t.zoom=LS(i,n,e);const{maxPitch:r,minPitch:s,pitch:o}=t;t.pitch=LS(o,s,r);const{normalize:a=!0}=t;return a&&Object.assign(t,function({width:t,height:e,longitude:n,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(n<-180||n>180)&&(n=vT(n+180,360)-180),(o<-180||o>180)&&(o=vT(o+180,360)-180);const a=_T(e/512);if(r<=a)r=a,i=0;else{const t=e/2/Math.pow(2,r),n=kT([0,t])[1];if(ie&&(i=e)}}return{width:t,height:e,longitude:n,latitude:i,zoom:r,pitch:s,bearing:o}}(t)),t}_unproject(t){const e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}_calculateNewZoom({scale:t,startZoom:e}){const{maxZoom:n,minZoom:i}=this._viewportProps;return LS(e+Math.log2(t),i,n)}_calculateNewPitchAndBearing({deltaScaleX:t,deltaScaleY:e,startBearing:n,startPitch:i}){e=LS(e,-1,1);const{minPitch:r,maxPitch:s}=this._viewportProps;let o=i;return e>0?o=i+e*(s-i):e<0&&(o=i-e*(r-i)),{pitch:o,bearing:n+180*t}}_getRotationParams(t,e){const n=t[0]-e[0],i=t[1]-e[1],r=t[1],s=e[1],{width:o,height:a}=this._viewportProps,l=n/o;let c=0;return i>0?Math.abs(a-s)>5&&(c=i/(s-a)*1.2):i<0&&s>5&&(c=1-r/s),c=Math.min(1,Math.max(-1,c)),{deltaScaleX:l,deltaScaleY:c}}}class iM extends rI{constructor(t){t.dragMode=t.dragMode||"pan",super(nM,t)}setProps(t){const e=this.controllerStateProps;super.setProps(t),(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState(bt(bt({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let rM=(()=>{class t extends UP{constructor(t){super(ti(bt({},t),{type:qT}))}get controller(){return this._getControllerProps({type:iM})}}return t.displayName="MapView",t})();const sM=new $I;class oM{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(t){"effects"in t&&(t.effects.length!==this.effects.length||!zP(t.effects,this.effects))&&(this.setEffects(t.effects),this._needsRedraw="effects changed")}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(t=[]){this.cleanup(),this.effects=t,this._createInternalEffects()}cleanup(){for(const t of this.effects)t.cleanup();for(const t of this._internalEffects)t.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(t=>t instanceof $I)||this._internalEffects.push(sM)}}class aM extends kI{}const lM={blendFunc:[1,0,32771,0],blendEquation:32774};class cM extends kI{render(t){t.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(t)):(this.useAlpha=!1,super.render(t))}_drawPickingBuffer({layers:t,layerFilter:e,views:n,viewports:i,onViewportActive:r,pickingFBO:s,deviceRect:{x:o,y:a,width:l,height:c},pass:u="picking",redrawReason:h,pickZ:d}){const p=this.gl;return this.pickZ=d,vx(p,ti(bt({scissorTest:!0,scissor:[o,a,l,c],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},lM),{blend:!d}),()=>{super.render({target:s,layers:t,layerFilter:e,views:n,viewports:i,onViewportActive:r,pass:u,redrawReason:h})})}shouldDrawLayer(t){return t.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(t,e){const n=this.pickZ?{blend:!1}:ti(bt({},lM),{blend:!0,blendColor:[0,0,0,this.useAlpha?(e+1)/255:1]});return bt(bt({},t.props.parameters),n)}}class uM{constructor(t){this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new aM(t),this.pickLayersPass=new cM(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){"layerFilter"in t&&this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in t&&this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(t){const e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;t.layerFilter=this.layerFilter,t.effects=t.effects||[],t.target=t.target||SS.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);const n=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,i=e.render(ti(bt({},t),{target:n}));this._postRender(t.effects,t),this.renderCount++,PE("deckRenderer.renderLayers",this,i,t)}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}finalize(){const{renderBuffers:t}=this;for(const e of t)e.delete();t.length=0}_preRender(t,e){let n=null;for(const i of t)i.preRender(this.gl,e),i.postRender&&(n=i);n&&this._resizeRenderBuffers(),this.lastPostProcessEffect=n}_resizeRenderBuffers(){const{renderBuffers:t}=this;0===t.length&&t.push(new SS(this.gl),new SS(this.gl));for(const e of t)e.resize()}_postRender(t,e){const{renderBuffers:n}=this,i={inputBuffer:n[0],swapBuffer:n[1],target:null};for(const r of t)if(r.postRender){if(r===this.lastPostProcessEffect){i.target=e.target,r.postRender(this.gl,i);break}const t=r.postRender(this.gl,i);i.inputBuffer=t,i.swapBuffer=t===n[0]?n[1]:n[0]}}}const hM={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function dM({pickedColors:t,layers:e,deviceX:n,deviceY:i,deviceRadius:r,deviceRect:s}){if(t){const{x:o,y:a,width:l,height:c}=s;let u=r*r,h=-1,d=0;for(let e=0;eu)d+=4*l;else for(let e=0;e=0){const t=e+o-n,i=t*t+s;i<=u&&(u=i,h=d)}d+=4}}if(h>=0){const n=t[h+3]-1,i=t.slice(h,h+4),r=e[n];if(r){const t=r.decodePickingColor(i),e=Math.floor(h/4/l);return{pickedColor:i,pickedLayer:r,pickedObjectIndex:t,pickedX:o+(h/4-e*l),pickedY:a+e}}Iw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return hM}function pM({pickInfo:t,mode:e,viewports:n,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=t&&t.pickedLayer,c=function(t,e,n){for(let i=t.length-1;i>=0;i--){const r=t[i];if(r.containsPixel(e)&&(!n||n(r)))return r}return t[0]}(n,{x:s,y:o},i&&l&&(t=>i({layer:l,viewport:t,isPicking:!0,renderPass:"picking:".concat(e)}))),u=c&&c.unproject([s-c.x,o-c.y],{targetZ:a});return{color:null,layer:null,viewport:c,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:u,devicePixel:t&&[t.pickedX,t.pickedY],pixelRatio:r}}function fM(t){const{pickInfo:e,lastPickedInfo:n,mode:i,layers:r}=t,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const t=n.index,e=n.layerId,i=o&&o.props.id;if(i!==e||a!==t){if(i!==e){const t=r.find(t=>t.props.id===e);t&&l.unshift(t)}n.layerId=i,n.index=a,n.info=null}}const c=pM(t),u=new Map;return u.set(null,c),l.forEach(t=>{let e=bt({},c);t===o&&(e.color=s,e.index=a,e.picked=!0),e=gM({layer:t,info:e,mode:i}),t===o&&"hover"===i&&(n.info=e),u.set(e.layer.id,e),"hover"===i&&e.layer.updateAutoHighlight(e)}),u}function gM({layer:t,info:e,mode:n}){for(;t&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=t,e=t.getPickingInfo({info:e,mode:n,sourceLayer:i}),t=t.parent}return e}class mM{constructor(t){this.gl=t,this.pickingFBO=null,this.pickLayersPass=new cM(t),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject({x:t,y:e,layers:n,viewports:i},r=this.lastPickedInfo.info){const s=r&&r.layer&&r.layer.id,o=r&&r.viewport&&r.viewport.id,a=s?n.find(t=>t.id===s):null,l=o&&i.find(t=>t.id===o)||i[0],c=l&&l.unproject([t-l.x,e-l.y]),u={x:t,y:e,viewport:l,coordinate:c,layer:a};return a?bt(bt({},r),u):Object.assign(u,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:t}=this;return this.pickingFBO||(this.pickingFBO=new SS(t),SS.isSupported(t,{colorBufferFloat:!0})&&(this.depthFBO=new SS(t),this.depthFBO.attach({36064:new lS(t,{format:Fw(t)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.pickingFBO}_getPickable(t){if(!1===this._pickable)return null;const e=t.filter(t=>t.isPickable()&&!t.isComposite);return e.length>255?(Iw.warn("Too many pickable layers, only picking the first 255")(),e.slice(0,255)):e.length?e:null}_pickClosestObject({layers:t,views:e,viewports:n,x:i,y:r,radius:s=0,depth:o=1,mode:a="query",unproject3D:l,onViewportActive:c}){if(!(t=this._getPickable(t)))return{result:[],emptyInfo:pM({viewports:n,x:i,y:r})};this._resizeBuffer();const u=_x(this.gl),h=wx(this.gl,[i,r],!0),d=[h.x+Math.floor(h.width/2),h.y+Math.floor(h.height/2)],p=Math.round(s*u),{width:f,height:g}=this.pickingFBO,m=this._getPickingRect({deviceX:d[0],deviceY:d[1],deviceRadius:p,deviceWidth:f,deviceHeight:g});let b;const y=[],v={};for(let _=0;_=0){const s=t.slice(i,i+4),o=s.join(",");if(!n.has(o)){const t=e[r];t?n.set(o,{pickedColor:s,pickedLayer:t,pickedObjectIndex:t.decodePickingColor(s)}):Iw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}({pickedColors:this._drawAndSample({layers:t,views:e,viewports:n,onViewportActive:c,deviceRect:{x:d,y:g,width:f.x+f.width-d,height:p-g},pass:"picking:".concat(a),redrawReason:a}),layers:t}),b=new Map,y=Number.isFinite(l);for(let v=0;v=l);v++){const t=m[v];let e={color:t.pickedColor,layer:null,index:t.pickedObjectIndex,picked:!0,x:i,y:r,width:s,height:o,pixelRatio:u};e=gM({layer:t.pickedLayer,info:e,mode:a}),b.has(e.object)||b.set(e.object,e)}return Array.from(b.values())}_drawAndSample({layers:t,views:e,viewports:n,onViewportActive:i,deviceRect:r,pass:s,redrawReason:o,pickZ:a}){if(t.length<1)return null;const l=a?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:t,layerFilter:this.layerFilter,views:e,viewports:n,onViewportActive:i,pickingFBO:l,deviceRect:r,pass:s,redrawReason:o,pickZ:a});const{x:c,y:u,width:h,height:d}=r,p=new(a?Float32Array:Uint8Array)(h*d*4);return _S(l,{sourceX:c,sourceY:u,sourceWidth:h,sourceHeight:d,target:p}),p}_getPickingRect({deviceX:t,deviceY:e,deviceRadius:n,deviceWidth:i,deviceHeight:r}){const s=Math.max(0,t-n),o=Math.max(0,e-n),a=Math.min(i,t+n+1)-s,l=Math.min(r,e+n+1)-o;return a<=0||l<=0?null:{x:s,y:o,width:a,height:l}}}const bM={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class yM{constructor(t){const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,bM),e.appendChild(this.el)),this.isVisible=!1}setTooltip(t,e,n){const i=this.el;if("string"==typeof t)i.innerText=t;else{if(!t)return this.isVisible=!1,void(i.style.display="none");"text"in t&&(i.innerText=t.text),"html"in t&&(i.innerHTML=t.html),"className"in t&&(i.className=t.className),Object.assign(i.style,t.style)}this.isVisible=!0,i.style.display="block",i.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}remove(){this.el&&this.el.remove()}}function vM(t,e){if(!t)throw new Error(e)}const _M={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},wM=_M.global||_M.self||_M.window,xM="object"!=typeof process||"[object process]"!==String(process)||process.browser,SM="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:EM}=(SM&&parseFloat(SM[1]),wM),CM="undefined"!=typeof Image,OM="undefined"!=typeof ImageBitmap,TM=Boolean(EM),kM=!!xM||TM;function AM(t){const e=function(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}(t);if(!e)throw new Error("Not an image");return e}function PM(t){switch(AM(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}const IM=/^data:image\/svg\+xml/,MM=/\.svg((\?|#).*)?$/;function DM(t){return t&&(IM.test(t)||MM.test(t))}function RM(t,e){if(DM(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(e)}`}return NM(t,e)}function NM(t,e){if(DM(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function LM(t,e,n){return jM.apply(this,arguments)}function jM(){return(jM=gS(function*(t,e,n){const i=RM(t,n),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield FM(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function FM(t,e){return BM.apply(this,arguments)}function BM(){return(BM=gS(function*(t,e){const n=new Image;return n.src=t,e.image&&e.image.decode&&n.decode?(yield n.decode(),n):yield new Promise((e,i)=>{try{n.onload=()=>e(n),n.onerror=e=>i(new Error(`Could not load image ${t}: ${e}`))}catch(r){i(r)}})})).apply(this,arguments)}const VM={};let zM=!0;function UM(t,e,n){return HM.apply(this,arguments)}function HM(){return(HM=gS(function*(t,e,n){let i;i=DM(n)?yield LM(t,e,n):NM(t,n);const r=e&&e.imagebitmap;return yield $M(i,r)})).apply(this,arguments)}function $M(t){return GM.apply(this,arguments)}function GM(){return(GM=gS(function*(t,e=null){if((WM(e)||!zM)&&(e=null),e)try{return yield createImageBitmap(t,e)}catch(n){console.warn(n),zM=!1}return yield createImageBitmap(t)})).apply(this,arguments)}function WM(t){for(const e in t||VM)return!1;return!0}const qM=!1,XM=!0;function YM(t){const e=KM(t);return function(t){const e=KM(t);return e.byteLength>=24&&2303741511===e.getUint32(0,qM)?{mimeType:"image/png",width:e.getUint32(16,qM),height:e.getUint32(20,qM)}:null}(e)||function(t){const e=KM(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,qM)&&255===e.getUint8(2)))return null;const{tableMarkers:n,sofMarkers:i}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let r=2;for(;r+9=10&&1195984440===e.getUint32(0,qM)?{mimeType:"image/gif",width:e.getUint16(6,XM),height:e.getUint16(8,XM)}:null}(e)||function(t){const e=KM(t);return e.byteLength>=14&&16973===e.getUint16(0,qM)&&e.getUint32(2,XM)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,XM),height:e.getUint32(22,XM)}:null}(e)}function KM(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}function QM(t,e){const{mimeType:n}=YM(t)||{},{_parseImageNode:i}=wM;return vM(i),i(t,n,e)}function ZM(){return(ZM=gS(function*(t,e,n){const i=((e=e||{}).image||{}).type||"auto",{url:r}=n||{};let s;switch(JM(i)){case"imagebitmap":s=yield UM(t,e,r);break;case"image":s=yield LM(t,e,r);break;case"data":s=yield QM(t,e);break;default:vM(!1)}return"data"===i&&(s=PM(s)),s})).apply(this,arguments)}function JM(t){switch(t){case"auto":case"data":return function(){if(OM)return"imagebitmap";if(CM)return"image";if(kM)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return OM||CM||kM;case"imagebitmap":return OM;case"image":return CM;case"data":return kM;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}const tD={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(t,e,n){return ZM.apply(this,arguments)},tests:[t=>Boolean(YM(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};var eD={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){const e=t[0],n=t[t.length-1];return"{"===e&&"}"===n||"["===e&&"]"===n},parseTextSync:JSON.parse};const nD="8.5.8",iD=zw.CO.deck&&zw.CO.deck.VERSION;if(iD&&iD!==nD)throw new Error("deck.gl - multiple versions detected: ".concat(iD," vs ").concat(nD));iD||(Iw.log(1,"deck.gl ".concat(nD))(),zw.CO.deck=Object.assign(zw.CO.deck||{},{VERSION:nD,version:nD,log:Iw,_registerLoggers:function(t){AE=t}}),fP([eD,[tD,{imagebitmap:{premultiplyAlpha:"none"}}]]));var rD=zw.CO.deck;class sD extends Hx{static isSupported(t,e=[]){const n=Fw(t),i=OS(t,"TIMER_QUERY");let r=n||i;for(const s of e)switch(s){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Rx(!1)}return r}constructor(t,e={}){super(t,e),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:t=!1}={}){return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(t=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise((n,i)=>{const r=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):e++>t?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(r)};requestAnimationFrame(r)}),this._pollingPromise}_createHandle(){return sD.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const oD=(0,zw.jU)()&&"undefined"!=typeof document;let aD=0;class lD{constructor(t={}){const{onCreateContext:e=(t=>Tx(t)),onAddHTML:n=null,onInitialize:i=(()=>{}),onRender:r=(()=>{}),onFinalize:s=(()=>{}),onError:o,gl:a=null,glOptions:l={},debug:c=!1,createFramebuffer:u=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:d=!0,stats:p=Dx.get("animation-loop-"+aD++)}=t;let{useDevicePixels:f=!0}=t;"useDevicePixelRatio"in t&&(Nw.deprecated("useDevicePixelRatio","useDevicePixels")(),f=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:n,onInitialize:i,onRender:r,onFinalize:s,onError:o,gl:a,glOptions:l,debug:c,createFramebuffer:u},this.gl=a,this.needsRedraw=null,this.timeline=null,this.stats=p,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:d,useDevicePixels:f}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return Rx("string"==typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(t={}){if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=sD.isSupported(this.gl,["timers"])?new sD(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())});return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(t=>{this._resolveNextFrame=t})),this._nextFramePromise}toDataURL(){var t=this;return gS(function*(){return t.setNeedsRedraw("toDataURL"),yield t.waitForRender(),t.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...t){return this.props.onCreateContext(...t)}onInitialize(...t){return this.props.onInitialize(...t)}onRender(...t){return this.props.onRender(...t)}onFinalize(...t){return this.props.onFinalize(...t)}getHTMLControlValue(t,e=1){const n=document.getElementById(t);return n?Number(n.value):e}setViewParameters(){return Nw.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=oD?new Promise((t,e)=>{oD&&"complete"===document.readyState?t(document):window.addEventListener("load",()=>{t(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}(t)}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}(t)}_renderFrame(...t){this.display?this.display._renderFrame(...t):this.onRender(...t)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:n}=this._getSizeAndAspect();(t!==this.animationProps.width||e!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),n!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=n,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"==typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!=typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?kx(this.props.gl,t):this.onCreateContext(t),!jw(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(t){yx(t,tx)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const n=this.props.onAddHTML(e);n&&(e.innerHTML=n)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let n=1;const{canvas:i}=this.gl;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:t>0&&e>0&&(n=t/e),{width:t,height:e,aspect:n}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(t,e={}){if(t.canvas)return void function(t,e,n){let i="width"in n?n.width:t.canvas.clientWidth,r="height"in n?n.height:t.canvas.clientHeight;(!i||!r)&&(Nw.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=t.canvas.width||1,r=t.canvas.height||1),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};const s=t.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let n=e;const s=Math.floor(i*n),o=Math.floor(r*n);t.canvas.width=s,t.canvas.height=o,(t.drawingBufferWidth!==s||t.drawingBufferHeight!==o)&&(Nw.warn("Device pixel ratio clamped")(),n=Math.min(t.drawingBufferWidth/i,t.drawingBufferHeight/r),t.canvas.width=Math.floor(i*n),t.canvas.height=Math.floor(r*n)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(t,function(t){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e);const n=t.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in e&&"height"in e&&n.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new SS(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}var cD=n(11524),uD=n.n(cD);const hD={mousedown:1,mousemove:2,mouseup:4};(function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const n=this.store;t.button>0&&"pointerdown"===t.type&&(function(e,n){for(let i=0;i=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(uD().MouseInput);const dD=uD().Manager;var pD=uD();const fD=pD?[[pD.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[pD.Rotate,{enable:!1}],[pD.Pinch,{enable:!1}],[pD.Swipe,{enable:!1}],[pD.Pan,{threshold:0,enable:!1}],[pD.Press,{enable:!1}],[pD.Tap,{event:"doubletap",taps:2,enable:!1}],[pD.Tap,{event:"anytap",enable:!1}],[pD.Tap,{enable:!1}]]:null,gD={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},mD={doubletap:["tap"]},bD={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},yD={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},vD={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},_D={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},wD="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",xD="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let SD=!1;try{const t={get passive(){return SD=!0,!0}};xD.addEventListener("test",t,t),xD.removeEventListener("test",t,t)}catch(m){}const ED=-1!==wD.indexOf("firefox"),{WHEEL_EVENTS:CD}=yD,OD=4.000244140625;class TD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.events=CD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!SD&&{passive:!1}))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){"wheel"===t&&(this.options.enable=e)}handleEvent(t){if(!this.options.enable)return;let e=t.deltaY;xD.WheelEvent&&(ED&&t.deltaMode===xD.WheelEvent.DOM_DELTA_PIXEL&&(e/=xD.devicePixelRatio),t.deltaMode===xD.WheelEvent.DOM_DELTA_LINE&&(e*=40));const n={x:t.clientX,y:t.clientY};0!==e&&e%OD==0&&(e=Math.floor(e/OD)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}_onWheel(t,e,n){this.callback({type:"wheel",center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}const{MOUSE_EVENTS:kD}=yD,AD="pointermove",PD="pointerover",ID="pointerout",MD="pointerleave";class DD{constructor(t,e,n={}){this.element=t,this.callback=e,this.pressed=!1,this.options=Object.assign({enable:!0},n),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=kD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){t===AD&&(this.enableMoveEvent=e),t===PD&&(this.enableOverEvent=e),t===ID&&(this.enableOutEvent=e),t===MD&&(this.enableLeaveEvent=e)}handleEvent(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:PD,srcEvent:t,pointerType:"mouse",target:t.target})}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:ID,srcEvent:t,pointerType:"mouse",target:t.target})}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:MD,srcEvent:t,pointerType:"mouse",target:t.target})}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:AD,srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:RD}=yD,ND="keydown";class LD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=RD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=n.tabIndex||0,t.style.outline="none",this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){t===ND&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}handleEvent(t){const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:ND,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}const jD="contextmenu";class FD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===jD&&(this.options.enable=e)}handleEvent(t){!this.options.enable||this.callback({type:jD,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}const BD={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},VD={srcElement:"root",priority:0};class zD{constructor(t){this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(t,e,n,i=!1,r=!1){const{handlers:s,handlersByElement:o}=this;n&&("object"!=typeof n||n.addEventListener)&&(n={srcElement:n}),n=n?Object.assign({},VD,n):VD;let a=o.get(n.srcElement);a||(a=[],o.set(n.srcElement,a));const l={type:t,handler:e,srcElement:n.srcElement,priority:n.priority};i&&(l.once=!0),r&&(l.passive=!0),s.push(l),this._active=this._active||!l.passive;let c=a.length-1;for(;c>=0&&!(a[c].priority>=l.priority);)c--;a.splice(c+1,0,l)}remove(t,e){const{handlers:n,handlersByElement:i}=this;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.type===t&&s.handler===e){n.splice(r,1);const t=i.get(s.srcElement);t.splice(t.indexOf(s),1),0===t.length&&i.delete(s.srcElement)}}this._active=n.some(t=>!t.passive)}handleEvent(t){if(this.isEmpty())return;const e=this._normalizeEvent(t);let n=t.srcEvent.target;for(;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")}_emit(t,e){const n=this.handlersByElement.get(e);if(n){let e=!1;const i=()=>{t.handled=!0},r=()=>{t.handled=!0,e=!0},s=[];for(let o=0;o{const e=this.manager.get(t);e&&gD[t].forEach(t=>{e.recognizeWith(t)})});for(const n in e.recognizerOptions){const t=this.manager.get(n);if(t){const i=e.recognizerOptions[n];delete i.enable,t.set(i)}}this.wheelInput=new TD(t,this._onOtherEvent,{enable:!1}),this.moveInput=new DD(t,this._onOtherEvent,{enable:!1}),this.keyInput=new LD(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new FD(t,this._onOtherEvent,{enable:!1});for(const[n,i]of this.events)i.isEmpty()||(this._toggleRecognizer(i.recognizerName,!0),this.manager.on(n,i.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,n){this._addEventHandler(t,e,n,!1)}once(t,e,n){this._addEventHandler(t,e,n,!0)}watch(t,e,n){this._addEventHandler(t,e,n,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:n}=this;if(!n)return;const i=n.get(t);if(i&&i.options.enable!==e){i.set({enable:e});const r=mD[t];r&&!this.options.recognizers&&r.forEach(r=>{const s=n.get(r);e?(s.requireFailure(t),i.dropRequireFailure(r)):s.dropRequireFailure(t)})}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,n,i,r){if("string"!=typeof t){n=e;for(const e in t)this._addEventHandler(e,t[e],n,i,r);return}const{manager:s,events:o}=this,a=_D[t]||t;let l=o.get(a);l||(l=new zD(this),o.set(a,l),l.recognizerName=vD[a]||a,s&&s.on(a,l.handleEvent)),l.add(t,e,n,i,r),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:n}=this,i=n.get(_D[t]||t);if(i&&(i.remove(t,e),i.isEmpty())){const{recognizerName:t}=i;let e=!1;for(const i of n.values())if(i.recognizerName===t&&!i.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}_onBasicInput(t){const{srcEvent:e}=t,n=bD[e.type];n&&this.manager.emit(n,t)}_onOtherEvent(t){this.manager.emit(t.type,t)}}function $D(){}const GD={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:$D,onResize:$D,onViewStateChange:$D,onInteractionStateChange:$D,onBeforeRender:$D,onAfterRender:$D,onLoad:$D,onError:(t,e)=>Iw.error(t)(),_onMetrics:null,getCursor:({isDragging:t})=>t?"grabbing":"grab",debug:!1,drawPickingColors:!1};class WD{constructor(t){t=bt(bt({},GD),t),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),t.viewState&&t.initialViewState&&Iw.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,zw.qs)()&&Iw.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new Ix({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&AS.setProps(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&Iw.removed("onLayerHover","onHover")(),"onLayerClick"in t&&Iw.removed("onLayerClick","onClick")(),t.initialViewState&&!zP(this.props.initialViewState,t.initialViewState)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);const e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(t={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);const n=this.viewManager.needsRedraw(t),i=this.layerManager.needsRedraw(t),r=this.effectManager.needsRedraw(t),s=this.deckRenderer.needsRedraw(t);return e=e||n||i||r||s,e}redraw(t){if(!this.layerManager)return;const e=t||this.needsRedraw({clearRedrawFlags:!0});!e||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}getViews(){return this.viewManager.views}getViewports(t){return this.viewManager.getViewports(t)}pickObject(t){const e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}pickObjects(t){return this._pick("pickObjects","pickObjects Time",t)}_addResources(t,e=!1){for(const n in t)this.layerManager.resourceManager.add({resourceId:n,data:t[n],forceUpdate:e})}_removeResources(t){for(const e of t)this.layerManager.resourceManager.remove(e)}_pick(t,e,n){const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(e).timeStart();const r=this.deckPicker[t](bt({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport},n));return i.get(e).timeEnd(),r}_createCanvas(t){let e=t.canvas;return"string"==typeof e&&(e=document.getElementById(e),uE(e)),e||(e=document.createElement("canvas"),e.id=t.id||"deckgl-overlay",(t.parent||document.body).appendChild(e)),Object.assign(e.style,t.style),e}_setCanvasSize(t){if(!this.canvas)return;let{width:e,height:n}=t;(e||0===e)&&(e=Number.isFinite(e)?"".concat(e,"px"):e,this.canvas.style.width=e),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:t,height:e}=this;this.viewManager.setProps({width:t,height:e}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:t}=this;if(!t)return!1;const e=t.clientWidth||t.width,n=t.clientHeight||t.height;return(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,!0)}_createAnimationLoop(t){const{width:e,height:n,gl:i,glOptions:r,debug:s,onError:o,onBeforeRender:a,onAfterRender:l,useDevicePixels:c,autoResizeDrawingBuffer:u}=t;return new lD({width:e,height:n,useDevicePixels:c,autoResizeDrawingBuffer:u,autoResizeViewport:!1,gl:i,onCreateContext:t=>Tx(ti(bt(bt({},r),t),{canvas:this.canvas,debug:s,onContextLost:()=>this._onContextLost()})),onInitialize:t=>this._setGLContext(t.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:a,onAfterRender:l,onError:o})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let t=this.props.views||[new rM({id:"default-view"})];return t=Array.isArray(t)?t:[t],t.length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}_onContextLost(){const{onError:t}=this.props;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}_onPointerMove(t){const{_pickRequest:e}=this;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;{const n=t.offsetCenter;if(!n)return;e.x=n.x,e.y=n.y,e.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t,e.mode="hover"}_pickAndCallback(){const{_pickRequest:t}=this;if(t.event){const{result:e,emptyInfo:n}=this._pick("pickObject","pickObject Time",t);this.interactiveState.isHovering=e.length>0;let i=n,r=!1;for(const s of e)i=s,r=s.layer.onHover(s,t.event);if(!r&&this.props.onHover&&this.props.onHover(i,t.event),this.props.getTooltip){const t=this.props.getTooltip(i);this.tooltip.setTooltip(t,i.x,i.y)}t.event=null}}_updateCursor(){const t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(t){if(this.layerManager)return;this.canvas||(this.canvas=t.canvas,kx(t,{enable:!0,copyState:!0})),this.tooltip=new yM(this.canvas),yx(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new qI;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new HD(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const i in Rw)this.eventManager.on(i,this._onEvent);this.viewManager=new eM({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const n=this.viewManager.getViewports()[0];this.layerManager=new tM(t,{deck:this,stats:this.stats,viewport:n,timeline:e}),this.effectManager=new oM,this.deckRenderer=new uM(t),this.deckPicker=new mM(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:n}=this.layerManager.context;yx(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(bt({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:t,effects:this.effectManager.getEffects()},e)),this.props.onAfterRender({gl:n})}_onRenderFrame(t){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Iw.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){const e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState=ti(bt({},this.viewState),{[t.viewId]:e}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.interactiveState.isDragging=t.isDragging,this.props.onInteractionStateChange(t)}_onEvent(t){const e=Rw[t.type],n=t.offsetCenter;if(!e||!n)return;const i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),{layer:s}=r,o=s&&(s[e.handler]||s.props[e.handler]),a=this.props[e.handler];let l=!1;o&&(l=o.call(s,r,t)),!l&&a&&a(r,t)}_onPointerDown(t){const e=t.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:e.x,y:e.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:t}=this;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();const e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:t,stats:e}=this;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();const n=Dx.get("Memory Usage");t.bufferMemory=n.get("Buffer Memory").count,t.textureMemory=n.get("Texture Memory").count,t.renderbufferMemory=n.get("Renderbuffer Memory").count,t.gpuMemory=n.get("GPU Memory").count}}WD.getPropTypes=function(t){return{id:t.string,width:t.oneOfType([t.number,t.string]),height:t.oneOfType([t.number,t.string]),layers:t.oneOfType([t.object,t.array]),layerFilter:t.func,views:t.oneOfType([t.object,t.array]),viewState:t.object,effects:t.arrayOf(t.instanceOf(TI)),controller:t.oneOfType([t.func,t.bool,t.object]),gl:t.object,glOptions:t.object,parameters:t.object,pickingRadius:t.number,useDevicePixels:t.oneOfType([t.bool,t.number]),touchAction:t.string,eventRecognizerOptions:t.object,onWebGLInitialized:t.func,onResize:t.func,onViewStateChange:t.func,onInteractionStateChange:t.func,onBeforeRender:t.func,onAfterRender:t.func,onLoad:t.func,onError:t.func,debug:t.bool,drawPickingColors:t.bool,_framebuffer:t.object,_animate:t.bool,_pickable:t.bool,_typedArrayManagerProps:t.object}},WD.defaultProps=GD,WD.VERSION=rD.VERSION;var qD={name:"project32",dependencies:[NI],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},XD="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n";const YD={lightSources:{}};function KD({color:t=[0,0,0],intensity:e=1}={}){return t.map(t=>t*e/255)}const QD={name:"lights",vs:XD,fs:XD,getUniforms:function t(e=YD){if("lightSources"in e){const{ambientLight:t,pointLights:n,directionalLights:i}=e.lightSources||{};return t||n&&n.length>0||i&&i.length>0?Object.assign({},function({ambientLight:t,pointLights:e=[],directionalLights:n=[]}){const i={};return i["lighting_uAmbientLight.color"]=t?KD(t):[0,0,0],e.forEach((t,e)=>{i[`lighting_uPointLight[${e}].color`]=KD(t),i[`lighting_uPointLight[${e}].position`]=t.position,i[`lighting_uPointLight[${e}].attenuation`]=t.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,n.forEach((t,e)=>{i[`lighting_uDirectionalLight[${e}].color`]=KD(t),i[`lighting_uDirectionalLight[${e}].direction`]=t.direction}),i.lighting_uDirectionalLightCount=n.length,i}({ambientLight:t,pointLights:n,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const n={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":n.ambientLight=t;break;case"directional":n.directionalLights.push(t);break;case"point":n.pointLights.push(t)}return t({lightSources:n})}return{}},defines:{MAX_LIGHTS:3}};const ZD={};const JD={name:"phong-lighting",dependencies:[QD],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(t=ZD){if(!("material"in t))return{};const{material:e}=t;return e?function(t){const{ambient:e=.35,diffuse:n=.6,shininess:i=32,specularColor:r=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:n,lighting_uShininess:i,lighting_uSpecularColor:r.map(t=>t/255)}}(e):{lighting_uEnabled:!1}}},tR={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};var eR=bt({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(t=tR){const e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){const n=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=n}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){const n=Array.from(t.pickingHighlightColor,t=>t/255);Number.isFinite(n[3])||(n[3]=1),e.picking_uHighlightColor=n}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}});const nR={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class iR{static get DRAW_MODE(){return nR}constructor(t={}){const{id:e=Fx("geometry"),drawMode:n=nR.TRIANGLES,attributes:i={},indices:r=null,vertexCount:s=null}=t;this.id=e,this.drawMode=0|n,this.attributes={},this.userData={},this._setAttributes(i,r),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?bt({indices:this.indices},this.attributes):this.attributes}_print(t){return`Geometry ${this.id} attribute ${t}`}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const n in t){let e=t[n];e=ArrayBuffer.isView(e)?{value:e}:e,Rx(ArrayBuffer.isView(e.value),`${this._print(n)}: must be typed array or object with value as typed array`),("POSITION"===n||"positions"===n)&&!e.size&&(e.size=3),"indices"===n?(Rx(!this.indices),this.indices=e):this.attributes[n]=e}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(t,e){if(e)return e.value.length;let n=1/0;for(const i in t){const e=t[i],{value:r,size:s,constant:o}=e;!o&&r&&s>=1&&(n=Math.min(n,r.length/s))}return Rx(Number.isFinite(n)),n}}const rR=Math.PI/180,sR=new Float32Array(16),oR=new Float32Array(12);function aR(t,e,n){const i=e[0]*rR,r=e[1]*rR,s=e[2]*rR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),d=n[0],p=n[1],f=n[2];t[0]=d*h*u,t[1]=d*l*u,t[2]=d*-a,t[3]=p*(-l*c+h*a*o),t[4]=p*(h*c+l*a*o),t[5]=p*u*o,t[6]=f*(l*o+h*a*c),t[7]=f*(-h*o+l*a*c),t[8]=f*u*c}function lR(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}const cR={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(t,{startRow:e,endRow:n}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,u=Array.isArray(s),h=Array.isArray(r),d=Array.isArray(o),p=c||!l&&Boolean(a(i[0]));t.constant=p?c:h&&u&&d;const f=t.value;if(t.constant){let e;p?(sR.set(a),e=lR(sR)):(e=oR,aR(e,r,s),e.set(o,9)),t.value=new Float32Array(e)}else{let l=e*t.size;const{iterable:g,objectInfo:m}=pE(i,e,n);for(const t of g){let e;m.index++,p?(sR.set(c?a:a(t,m)),e=lR(sR)):(e=oR,aR(e,h?r:r(t,m),u?s:s(t,m)),e.set(d?o:o(t,m),9)),f[l++]=e[0],f[l++]=e[1],f[l++]=e[2],f[l++]=e[3],f[l++]=e[4],f[l++]=e[5],f[l++]=e[6],f[l++]=e[7],f[l++]=e[8],f[l++]=e[9],f[l++]=e[10],f[l++]=e[11]}}}};function uR(t,e){return e===Mw.CARTESIAN||e===Mw.METER_OFFSETS||e===Mw.DEFAULT&&!t.isGeospatial}function hR(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),Iw.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function dR(t,e){if(t.attributes)return hR(t.attributes,e),t instanceof iR?t:new iR(t);if(t.positions||t.POSITION)return hR(t,e),new iR({attributes:t});throw Error("Invalid mesh")}const pR={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let fR=(()=>{class t extends LP{getShaders(){const t=!Fw(this.context.gl),e={};return CS(this.context.gl,"GLSL_DERIVATIVES")&&(e.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[qD,JD,eR],transpileToGLSL100:t,defines:e})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:cR}),this.setState({emptyTexture:new lS(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:e,changeFlags:n}){if(super.updateState({props:t,oldProps:e,changeFlags:n}),t.mesh!==e.mesh||n.extensionsChanged){var i;if(null===(i=this.state.model)||void 0===i||i.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const e=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(e.NORMAL||e.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==e.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:e}=this.context,{sizeScale:n,coordinateSystem:i,_instanced:r}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:n,composeModelMatrix:!r||uR(e,i),flatShading:!this.state.hasNormals}).draw()}getModel(t){const e=new xO(this.context.gl,ti(bt({},this.getShaders()),{id:this.props.id,geometry:dR(t,this.props._useMeshColors),isInstanced:!0})),{texture:n}=this.props,{emptyTexture:i}=this.state;return e.setUniforms({sampler:n||i,hasTexture:Boolean(n)}),e}setTexture(t){const{emptyTexture:e,model:n}=this.state;null==n||n.setUniforms({sampler:t||e,hasTexture:Boolean(t)})}}return t.layerName="SimpleMeshLayer",t.defaultProps=pR,t})();const gR={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[QD]};class mR{constructor(t={}){const{id:e}=t;this.id=e||Fx(this.constructor.name),this.display=!0,this.position=new nE,this.rotation=new nE,this.scale=new nE(1,1,1),this.matrix=new bT,this.userData={},this.props={},this._setScenegraphNodeProps(t)}delete(){}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(t){return Rx(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return Rx(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return Rx(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t,e=!0){e?this.matrix.copy(t):this.matrix=t}setMatrixComponents({position:t,rotation:e,scale:n,update:i=!0}){return t&&this.setPosition(t),e&&this.setRotation(e),n&&this.setScale(n),i&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(n),this}update(t={}){const{position:e,rotation:n,scale:i}=t;return e&&this.setPosition(e),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}getCoordinateUniforms(t,e){Rx(t),e=e||this.matrix;const n=new bT(t).multiplyRight(e),i=n.invert(),r=i.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}class bR extends mR{constructor(t={}){t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;Nw.assert(e.every(t=>t instanceof mR),"every child must an instance of ScenegraphNode"),super(t),this.children=e}add(...t){for(const e of t)Array.isArray(e)?this.add(...e):this.children.push(e);return this}remove(t){const e=this.children,n=e.indexOf(t);return n>-1&&e.splice(n,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(t=>t.delete()),this.removeAll(),super.delete()}traverse(t,{worldMatrix:e=new bT}={}){const n=new bT(e).multiplyRight(this.matrix);for(const i of this.children)i instanceof bR?i.traverse(t,{worldMatrix:n}):t(i,{worldMatrix:n})}}function yR(){var t=new qS(4);return qS!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function vR(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function _R(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3],a=n[0],l=n[1],c=n[2],u=n[3];return t[0]=i*u+o*a+r*c-s*l,t[1]=r*u+o*l+s*a-i*c,t[2]=s*u+o*c+i*l-r*a,t[3]=o*u-i*a-r*l-s*c,t}var wR=tT,xR=function(){var t=XS(),e=YS(1,0,0),n=YS(0,1,0);return function(i,r,s){var o=KS(r,s);return o<-.999999?(QS(t,e,r),function(t){return Math.hypot(t[0],t[1],t[2])}(t)<1e-6&&QS(t,n,r),function(t,e){var n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s}(t,t),vR(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(QS(t,r,s),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=n*n+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=i*o,t[2]=r*o,t[3]=s*o,t}(i,i))}}();yR(),yR(),function(){var t=new qS(9);qS!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1}();const SR=[0,0,0,1],ER={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},CR={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function OR(t){if(!t._animation){const e=CR[t.componentType],n=ER[t.type],i=n*t.count,{buffer:r,byteOffset:s}=t.bufferView.data,o=new e(r,s+(t.byteOffset||0),i);if(1===n)t._animation=Array.from(o);else{const e=[];for(let t=0;t0)n=Math.sqrt(i+1),t[3]=.5*n,t[0]=(e[5]-e[7])*(n=.5/n),t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),t[r]=.5*n,t[3]=(e[3*s+o]-e[3*o+s])*(n=.5/n),t[s]=(e[3*s+r]+e[3*r+s])*n,t[o]=(e[3*o+r]+e[3*r+o])*n}}(this,t),this.check()}identity(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this),this.check()}fromAxisRotation(t,e){return vR(this,t,e),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=zS(t)}get y(){return this[1]}set y(t){this[1]=zS(t)}get z(){return this[2]}set z(t){this[2]=zS(t)}get w(){return this[3]}set w(t){this[3]=zS(t)}len(){return function(t){return Math.hypot(t[0],t[1],t[2],t[3])}(this)}lengthSquared(){return function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}(this)}dot(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}(this,t)}rotationTo(t,e){return xR(this,t,e),this.check()}add(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return function(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3]}(this,this,t),this.check()}calculateW(){return function(t,e){var n=e[0],i=e[1],r=e[2];t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r))}(this,this),this.check()}conjugate(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this,this),this.check()}invert(){return function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=n*n+i*i+r*r+s*s,a=o?1/o:0;t[0]=-n*a,t[1]=-i*a,t[2]=-r*a,t[3]=s*a}(this,this),this.check()}lerp(t,e,n){return function(t,e,n,i){var r=e[0],s=e[1],o=e[2],a=e[3];t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=o+i*(n[2]-o),t[3]=a+i*(n[3]-a)}(this,t,e,n),this.check()}multiplyRight(t,e){return BS(!e),_R(this,this,t),this.check()}multiplyLeft(t,e){return BS(!e),_R(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+o*a,t[1]=r*l+s*a,t[2]=s*l-r*a,t[3]=o*l-i*a}(this,this,t),this.check()}rotateY(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l-s*a,t[1]=r*l+o*a,t[2]=s*l+i*a,t[3]=o*l-r*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+r*a,t[1]=r*l-i*a,t[2]=s*l+o*a,t[3]=o*l-s*a}(this,this,t),this.check()}scale(t){return wR(this,this,t),this.check()}slerp(t,e,n){switch(arguments.length){case 1:({start:t=SR,target:e,ratio:n}=arguments[0]);break;case 2:[e,n]=arguments,t=this}return function(t,e,n,i){var r,s,o,a,l,c=e[0],u=e[1],h=e[2],d=e[3],p=n[0],f=n[1],g=n[2],m=n[3];(s=c*p+u*f+h*g+d*m)<0&&(s=-s,p=-p,f=-f,g=-g,m=-m),1-s>WS?(r=Math.acos(s),o=Math.sin(r),a=Math.sin((1-i)*r)/o,l=Math.sin(i*r)/o):(a=1-i,l=i),t[0]=a*c+l*p,t[1]=a*u+l*f,t[2]=a*h+l*g,t[3]=a*d+l*m}(this,t,e,n),this.check()}transformVector4(t,e=t){return function(t,e,n){var i=e[0],r=e[1],s=e[2],o=n[0],a=n[1],l=n[2],c=n[3],u=c*i+a*s-l*r,h=c*r+l*i-o*s,d=c*s+o*r-a*i,p=-o*i-a*r-l*s;t[0]=u*c+p*-o+h*-l-d*-a,t[1]=h*c+p*-a+d*-o-u*-l,t[2]=d*c+p*-l+u*-a-h*-o,t[3]=e[3]}(e,t,this),US(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t,e){return this.multiplyLeft(t,e)}multiply(t,e){return this.multiplyRight(t,e)}};class AR{constructor(t){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:t,target:n,path:i})=>{(function(t,{input:e,interpolation:n,output:i},r,s){const o=t%e[e.length-1],a=e.findIndex(t=>t>=o),l=Math.max(0,a-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:Nw.warn(`Bad animation path ${s}`)()}Rx(r[s].length===i[l].length);const c=e[l],u=e[a];switch(n){case"STEP":!function(t,e,n){for(let i=0;ic&&function(t,e,n,i,r){if("rotation"===e){kR.slerp({start:n,target:i,ratio:r});for(let n=0;nc&&function(t,e,{p0:n,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const i=e.name||`Animation-${n}`,r=e.samplers.map(({input:e,interpolation:n="LINEAR",output:i})=>({input:OR(t.accessors[e]),interpolation:n,output:OR(t.accessors[i])})),s=e.channels.map(({sampler:e,target:n})=>({sampler:r[e],target:t.nodes[n.node],path:n.path}));return new AR({name:i,channels:s})})}animate(t){this.setTime(t)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}class IR extends mR{constructor(t,e={}){super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof xO?(this.model=t,this._setModelNodeProps(e)):this.model=new xO(t,e),this.managedResources=e.managedResources||[]}setProps(t){return super.setProps(t),this._setModelNodeProps(t),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(t=>t.delete()),this.managedResources=[]}draw(...t){return this.model.draw(...t)}setUniforms(...t){return this.model.setUniforms(...t),this}setAttributes(...t){return this.model.setAttributes(...t),this}updateModuleSettings(...t){return this.model.updateModuleSettings(...t),this}_setModelNodeProps(t){this.model.setProps(t)}}class MR{constructor(t,{attributes:e,material:n,pbrDebug:i,imageBasedLightingEnvironment:r,lights:s,useTangents:o}){this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},CS(t,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],r&&(this.uniforms.u_DiffuseEnvSampler=r.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=r.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=r.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),i&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(e.NORMAL,"HAS_NORMALS"),this.defineIfPresent(e.TANGENT&&o,"HAS_TANGENTS"),this.defineIfPresent(e.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(r,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(i,"PBR_DEBUG"),n&&this.parseMaterial(n)}defineIfPresent(t,e){t&&(this.defines[e]=1)}parseTexture(t,e,n=null){const i=t.texture.source.image;let r,s={};i.compressed?(r=i,s={[this.gl.TEXTURE_MIN_FILTER]:i.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):r={data:i};const o=new lS(this.gl,bt({id:t.name||t.id,parameters:bt(bt({},t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{}),s),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},r));this.uniforms[e]=o,this.defineIfPresent(n,n),this.generatedTextures.push(o)}parsePbrMetallicRoughness(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:e=1,roughnessFactor:n=1}=t;this.uniforms.u_MetallicRoughnessValues=[e,n]}parseMaterial(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:e=1}=t.normalTexture;this.uniforms.u_NormalScale=e}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:e=1}=t.occlusionTexture;this.uniforms.u_OcclusionStrength=e}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){const{alphaCutoff:e=.5}=t;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=e}else"BLEND"===t.alphaMode&&(Nw.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function DR(t,e){return Fw(t)?`#version 300 es\n${e}`:e}const RR={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},NR={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class LR{constructor(t,e={}){this.gl=t,this.options=Object.assign({},NR,e)}instantiate(t){return this.gltf=t,(t.scenes||[]).map(t=>this.createScene(t))}createAnimator(){return Array.isArray(this.gltf.animations)?new PR(this.gltf):null}createScene(t){const e=(t.nodes||[]).map(t=>this.createNode(t));return new bR({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map(t=>this.createNode(t));t.mesh&&e.push(this.createMesh(t.mesh));const n=new bR({id:t.name||t.id,children:e});if(t.matrix)n.setMatrix(t.matrix);else{if(n.matrix.identity(),t.translation&&n.matrix.translate(t.translation),t.rotation){const e=(new bT).fromQuaternion(t.rotation);n.matrix.multiplyRight(e)}t.scale&&n.matrix.scale(t.scale)}t._node=n}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map((e,n)=>this.createPrimitive(e,n,t)),n=new bR({id:t.name||t.id,children:e});t._mesh=n}return t._mesh}getVertexCount(t){Nw.warn("getVertexCount() not found")()}createPrimitive(t,e,n){return function(t,e){const{id:n,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new MR(t,e);Nw.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(t=>t.buffer));const c=new IR(t,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[gR],defines:a.defines,parameters:a.parameters,vs:DR(t,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:DR(t,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:t.name||`${n.name||n.id}-primitive-${e}`,drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options))}createAttributes(t,e){const n={};return Object.keys(t).forEach(e=>{n[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))}),e&&(n.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),Nw.info(4,"glTF Attributes",{attributes:t,indices:e,generated:n})(),n}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:n}=t;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[e]||(n.lumaBuffers[e]=new tS(this.gl,{id:`from-${n.id}`,data:n.data||t.value,target:e})),n.lumaBuffers[e]}createAccessor(t,e){return new Kx({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:RR[t.type]})}createSampler(t){return t}needsPOT(){return!1}}function jR(t,e,n){if(t.byteLength<=e+n)return"";const i=new DataView(t);let r="";for(let s=0;se[t.name]);return new UR(n,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new UR(e,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof UR){const i=t;e=i.fields,n=HR(HR(new Map,this.metadata),i.metadata)}else e=t;const i=Object.create(null);for(const s of this.fields)i[s.name]=s;for(const s of e)i[s.name]=s;const r=Object.values(i);return new UR(r,n)}}function HR(t,e){return new Map([...t||new Map,...e||new Map])}let $R,GR,WR,qR,XR,YR,KR,QR;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}($R||($R={}));class ZR{static isNull(t){return t&&t.typeId===$R.Null}static isInt(t){return t&&t.typeId===$R.Int}static isFloat(t){return t&&t.typeId===$R.Float}static isBinary(t){return t&&t.typeId===$R.Binary}static isUtf8(t){return t&&t.typeId===$R.Utf8}static isBool(t){return t&&t.typeId===$R.Bool}static isDecimal(t){return t&&t.typeId===$R.Decimal}static isDate(t){return t&&t.typeId===$R.Date}static isTime(t){return t&&t.typeId===$R.Time}static isTimestamp(t){return t&&t.typeId===$R.Timestamp}static isInterval(t){return t&&t.typeId===$R.Interval}static isList(t){return t&&t.typeId===$R.List}static isStruct(t){return t&&t.typeId===$R.Struct}static isUnion(t){return t&&t.typeId===$R.Union}static isFixedSizeBinary(t){return t&&t.typeId===$R.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===$R.FixedSizeList}static isMap(t){return t&&t.typeId===$R.Map}static isDictionary(t){return t&&t.typeId===$R.Dictionary}get typeId(){return $R.NONE}compareTo(t){return this===t}}Symbol,Symbol,GR=Symbol.toStringTag;class JR extends ZR{constructor(t,e){super(),cA(this,"isSigned",void 0),cA(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return $R.Int}get[GR](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class tN extends JR{constructor(){super(!0,8)}}class eN extends JR{constructor(){super(!0,16)}}class nN extends JR{constructor(){super(!0,32)}}class iN extends JR{constructor(){super(!1,8)}}class rN extends JR{constructor(){super(!1,16)}}class sN extends JR{constructor(){super(!1,32)}}WR=Symbol.toStringTag;class oN extends ZR{constructor(t){super(),cA(this,"precision",void 0),this.precision=t}get typeId(){return $R.Float}get[WR](){return"Float"}toString(){return`Float${this.precision}`}}class aN extends oN{constructor(){super(32)}}class lN extends oN{constructor(){super(64)}}Symbol,Symbol,qR=Symbol.toStringTag,XR=Symbol.toStringTag,YR=Symbol.toStringTag,KR=Symbol.toStringTag,QR=Symbol.toStringTag;class cN extends ZR{constructor(t,e){super(),cA(this,"listSize",void 0),cA(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return $R.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[QR](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class uN{constructor(t,e,n=!1,i=new Map){cA(this,"name",void 0),cA(this,"type",void 0),cA(this,"nullable",void 0),cA(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=n,this.metadata=i}get typeId(){return this.type&&this.type.typeId}clone(){return new uN(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function hN(t,e,n){const i=n?dN(n.metadata):void 0,r=function(t){switch(t.constructor){case Int8Array:return new tN;case Uint8Array:return new iN;case Int16Array:return new eN;case Uint16Array:return new rN;case Int32Array:return new nN;case Uint32Array:return new sN;case Float32Array:return new aN;case Float64Array:return new lN;default:throw new Error("array type not supported")}}(e.value);return new uN(t,new cN(e.size,new uN("value",r)),!1,i)}function dN(t){const e=new Map;for(const n in t)e.set(`${n}.string`,JSON.stringify(t[n]));return e}const pN={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},fN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class gN{constructor(t){cA(this,"draco",void 0),cA(this,"decoder",void 0),cA(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){const n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const i=this.decoder.GetEncodedGeometryType(n),r=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(i){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(n,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(n,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e=`DRACO decompression failed: ${t.error_msg()}`;throw new Error(e)}const s=this._getDracoLoaderData(r,i,e),o=this._getMeshData(r,s,e),a=function(t){let e=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;cr?t:r,s=l>s?l:s,o=u>o?u:o}return[[e,n,i],[r,s,o]]}(o.attributes),l=function(t,e,n){const i=dN(e.metadata),r=[],s=function(t){const e={};for(const n in t){const i=t[n];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in t){const e=hN(o,t[o],s[o]);r.push(e)}if(n){const t=hN("indices",n);r.push(t)}return new UR(r,i)}(o.attributes,s,o.indices);return ti(bt({loader:"draco",loaderData:s,header:{vertexCount:r.num_points(),boundingBox:a}},o),{schema:l})}finally{this.draco.destroy(n),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,n){const i=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,n);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:r}}_getDracoAttributes(t,e){const n={};for(let i=0;ithis.decoder[t]).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map(t=>e.min_value(t))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:n=[]}=e,i=t.attribute_type();if(n.map(t=>this.decoder[t]).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}var mN=n(49125);const bN={};function yN(t){return vN.apply(this,arguments)}function vN(){return(vN=gS(function*(t,e=null,n={}){return e&&(t=_N(t,e,n)),bN[t]=bN[t]||wN(t),yield bN[t]})).apply(this,arguments)}function _N(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};return i[t]?i[t]:CA?n.CDN?(wA(n.CDN.startsWith("http")),`${n.CDN}/${e}@3.0.12/dist/libs/${t}`):OA?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}function wN(t){return xN.apply(this,arguments)}function xN(){return(xN=gS(function*(t){return t.endsWith("wasm")?yield(yield fetch(t)).arrayBuffer():CA?OA?importScripts(t):SN(yield(yield fetch(t)).text(),t):mN.requireFromFile&&(yield mN.requireFromFile(t))})).apply(this,arguments)}function SN(t,e){if(!CA)return mN.requireFromString&&mN.requireFromString(t,e);if(OA)return eval.call(EA,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(i){n.text=t}return document.body.appendChild(n),null}const EN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",CN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",ON="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let TN;function kN(t){return AN.apply(this,arguments)}function AN(){return(AN=gS(function*(t){const e=t.modules||{};return TN=e.draco3d?TN||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):TN||PN(t),yield TN})).apply(this,arguments)}function PN(t){return IN.apply(this,arguments)}function IN(){return(IN=gS(function*(t){let e,n;switch(t.draco&&t.draco.decoderType){case"js":e=yield yN(EN,"draco",t);break;case"wasm":default:[e,n]=yield Promise.all([yield yN(CN,"draco",t),yield yN(ON,"draco",t)])}return e=e||globalThis.DracoDecoderModule,yield MN(e,n)})).apply(this,arguments)}function MN(t,e){const n={};return e&&(n.wasmBinary=e),new Promise(e=>{t(ti(bt({},n),{onModuleLoaded:t=>e({draco:t})}))})}const DN=ti(bt({},zR),{parse:function(t,e){return RN.apply(this,arguments)}});function RN(){return(RN=gS(function*(t,e){const{draco:n}=yield kN(e),i=new gN(n);try{return i.parseSync(t,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function NN(t,e){return Nk(t>=0),Nk(e>0),t+(e-1)&~(e-1)}function LN(t,e,n){let i;return i=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer||t.arrayBuffer,t.byteOffset,t.byteLength),e.set(i,n),n+NN(i.byteLength,4)}const jN=["SCALAR","VEC2","VEC3","VEC4"],FN=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],BN=new Map(FN),VN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zN={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},UN={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function HN(t){return jN[t-1]||jN[0]}function $N(t){const e=BN.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function GN(t,e){const n=UN[t.componentType],i=VN[t.type],r=t.count*i,s=t.count*i*zN[t.componentType];return FR(s>=0&&s<=e.byteLength),{ArrayType:n,length:r,byteLength:s}}const WN={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class qN{constructor(t){cA(this,"gltf",void 0),cA(this,"sourceBuffers",void 0),cA(this,"byteLength",void 0),this.gltf=t||{json:bt({},WN),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){return this.getUsedExtensions().find(e=>e===t)?(this.json.extensions||{})[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(e=>e===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];if(!n)throw new Error(`glTF file error: Could not find ${t}[${e}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);const e=this.gltf.buffers[t.buffer];return FR(e),new Uint8Array(e.arrayBuffer,(t.byteOffset||0)+e.byteOffset,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,{ArrayType:i,length:r}=GN(t,e);return new i(n,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data;return new Uint8Array(n,e.byteOffset||0,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}setObjectExtension(t,e,n){(t.extensions||{})[e]=n}removeObjectExtension(t,e){const n=t.extensions||{},i=n[e];return delete n[e],i}addExtension(t,e={}){return FR(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return FR(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(e=>e===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(e=>e===t)||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:n}=t;this.json.nodes=this.json.nodes||[];const i={mesh:e};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:n,material:i,mode:r=4}=t,s={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(n){const t=this._addIndices(n);s.primitives[0].indices=t}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const n=YM(t),i=e||(null==n?void 0:n.mimeType),r={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;FR(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=NN(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(t,e){const n={bufferView:t,type:HN(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,e={size:3}){const n=this.addBufferView(t);let i={min:e.min,max:e.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:$N(t),count:Math.round(t.length/e.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,n={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const n=this.byteLength,i=new ArrayBuffer(n),r=new Uint8Array(i);let s=0;for(const o of this.sourceBuffers||[])s=LN(o,r,s);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}_removeStringFromArray(t,e){let n=!0;for(;n;){const i=t.indexOf(e);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){const e={};for(const n in t){const i=t[n],r=this._getGltfAttributeName(n),s=this.addBinaryBuffer(i.value,i);e[r]=s}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const n={min:null,max:null};if(t.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*lL(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}function cL(t){return uL.apply(this,arguments)}function uL(){return(uL=gS(function*(t){const e=new qN(t),{json:n}=e;e.removeExtension(QN);for(const i of n.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,QN)})).apply(this,arguments)}function hL(t){const e=new qN(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,QN,{}),e.addExtension(QN))}function dL(t){return pL.apply(this,arguments)}function pL(){return(pL=gS(function*(t){const e=new qN(t),{json:n}=e,i=e.getExtension(KN);i&&(e.json.lights=i.lights,e.removeExtension(KN));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,KN);t&&(r.light=t.light),e.removeObjectExtension(r,KN)}})).apply(this,arguments)}function fL(t){return gL.apply(this,arguments)}function gL(){return(gL=gS(function*(t){const e=new qN(t),{json:n}=e;if(n.lights){const t=e.addExtension(KN);FR(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights)e.addObjectExtension(t.node,KN,t);delete e.json.lights}})).apply(this,arguments)}function mL(t){return bL.apply(this,arguments)}function bL(){return(bL=gS(function*(t){const e=new qN(t),{json:n}=e,i=e.getExtension(ZN);if(i){const t=_L(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,ZN);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=wL(i.technique,e)),e.removeObjectExtension(i,ZN)}e.removeExtension(ZN)}})).apply(this,arguments)}function yL(t,e){return vL.apply(this,arguments)}function vL(){return(vL=gS(function*(t,e){})).apply(this,arguments)}function _L(t,e){const{programs:n=[],shaders:i=[],techniques:r=[]}=t,s=new TextDecoder;return i.forEach(t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=s.decode(e.getTypedArrayForBufferView(t.bufferView))}),n.forEach(t=>{t.fragmentShader=i[t.fragmentShader],t.vertexShader=i[t.vertexShader]}),r.forEach(t=>{t.program=n[t.program]}),r}function wL(t,e){const n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(e=>{t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)}),Object.keys(n).forEach(t=>{"object"==typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))}),n}const xL={KHR_draco_mesh_compression:i,KHR_materials_unlit:r,KHR_lights_punctual:s,KHR_techniques_webgl:o};function SL(t){return EL.apply(this,arguments)}function EL(){return(EL=gS(function*(t,e={},n){for(const r in xL){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield xL[r].decode(t,e,n))}})).apply(this,arguments)}const CL={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},OL={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class TL{constructor(t){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(t,e){this.json=t.json;const n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${n.asset.version}`)}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t){const e=new qN(t),{json:n}=e;for(const i of n.images||[]){const t=e.removeObjectExtension(i,XN);t&&Object.assign(i,t)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(XN)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in CL)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const n=t[e];if(n&&!Array.isArray(n)){t[e]=[];for(const i in n){const r=n[i];r.id=r.id||i;const s=t[e].length;t[e].push(r),this.idToIndexMap[e][i]=s}}}_convertObjectIdsToArrayIndices(t){for(const e in CL)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:n,material:i}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");n&&(e.indices=this._convertIdToIndex(n,"accessor")),i&&(e.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(t=>this._convertIdToIndex(t,"node"))),t.meshes&&(t.meshes=t.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(t,e){t[e]||(console.warn(`gltf v1: json doesn't contain attribute ${e}`),t[e]=[]);for(const n of t[e])for(const t in n){const e=this._convertIdToIndex(n[t],t);n[t]=e}}_convertIdToIndex(t,e){const n=OL[e];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${e} with id ${t}`);return i}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const e of t.materials){e.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const n=e.values&&e.values.tex,i=t.textures.findIndex(t=>t.id===n);-1!==i&&(e.pbrMetallicRoughness.baseColorTexture={index:i})}}}function kL(t,e={}){return(new TL).normalize(t,e)}const AL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},PL={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},IL={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},ML={magFilter:IL.TEXTURE_MAG_FILTER,minFilter:IL.TEXTURE_MIN_FILTER,wrapS:IL.TEXTURE_WRAP_S,wrapT:IL.TEXTURE_WRAP_T},DL={[IL.TEXTURE_MAG_FILTER]:IL.LINEAR,[IL.TEXTURE_MIN_FILTER]:IL.NEAREST_MIPMAP_LINEAR,[IL.TEXTURE_WRAP_S]:IL.REPEAT,[IL.TEXTURE_WRAP_]:IL.REPEAT};class RL{postProcess(t,e={}){const{json:n,buffers:i=[],images:r=[],baseUri:s=""}=t;return FR(n),this.baseUri=s,this.json=n,this.buffers=i,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t,e={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((t,e)=>this._resolveBufferView(t,e))),t.images&&(t.images=t.images.map((t,e)=>this._resolveImage(t,e))),t.samplers&&(t.samplers=t.samplers.map((t,e)=>this._resolveSampler(t,e))),t.textures&&(t.textures=t.textures.map((t,e)=>this._resolveTexture(t,e))),t.accessors&&(t.accessors=t.accessors.map((t,e)=>this._resolveAccessor(t,e))),t.materials&&(t.materials=t.materials.map((t,e)=>this._resolveMaterial(t,e))),t.meshes&&(t.meshes=t.meshes.map((t,e)=>this._resolveMesh(t,e))),t.nodes&&(t.nodes=t.nodes.map((t,e)=>this._resolveNode(t,e))),t.skins&&(t.skins=t.skins.map((t,e)=>this._resolveSkin(t,e))),t.scenes&&(t.scenes=t.scenes.map((t,e)=>this._resolveScene(t,e))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];return n||console.warn(`glTF file error: Could not find ${t}[${e}]`),n}_resolveScene(t,e){return t.id=t.id||`scene-${e}`,t.nodes=(t.nodes||[]).map(t=>this.getNode(t)),t}_resolveNode(t,e){return t.id=t.id||`node-${e}`,t.children&&(t.children=t.children.map(t=>this.getNode(t))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((t,e)=>{const n=this.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t},{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||`skin-${e}`,t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||`mesh-${e}`,t.primitives&&(t.primitives=t.primitives.map(t=>{const e=(t=bt({},t)).attributes;t.attributes={};for(const n in e)t.attributes[n]=this.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t})),t}_resolveMaterial(t,e){if(t.id=t.id||`material-${e}`,t.normalTexture&&(t.normalTexture=bt({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=bt({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=bt({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness=bt({},t.pbrMetallicRoughness);const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture=bt({},e.baseColorTexture),e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture=bt({},e.metallicRoughnessTexture),e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){if(t.id=t.id||`accessor-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=function(t){return PL[t]}(t.componentType),t.components=function(t){return AL[t]}(t.type),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:i}=GN(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset,s=e.arrayBuffer.slice(r,r+i);t.value=new n(s)}return t}_resolveTexture(t,e){return t.id=t.id||`texture-${e}`,t.sampler="sampler"in t?this.getSampler(t.sampler):DL,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||`sampler-${e}`,t.parameters={};for(const n in t){const e=this._enumSamplerParameter(n);void 0!==e&&(t.parameters[e]=t[n])}return t}_enumSamplerParameter(t){return ML[t]}_resolveImage(t,e){t.id=t.id||`image-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const n=this.images[e];return n&&(t.image=n),t}_resolveBufferView(t,e){t.id=t.id||`bufferView-${e}`;const n=t.buffer;t.buffer=this.buffers[n];let i=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(i+=t.byteOffset),t.data=new Uint8Array(this.buffers[n].arrayBuffer,i,t.byteLength),t}_resolveCamera(t,e){return t.id=t.id||`camera-${e}`,t}}function NL(t,e){return(new RL).postProcess(t,e)}const LL=1735152710,jL=!0;function FL(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),s=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(s),NN(i,4)}function BL(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),NN(i,4)}function VL(t,e){return zL.apply(this,arguments)}function zL(){return(zL=gS(function*(t,e,n=0,i,r){var s,o,a,l;UL(t,e,n,i),kL(t,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&t.json.buffers&&(yield HL(t,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const e=GL(t,i,r);c.push(e)}const u=SL(t,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?NL(t,i):t})).apply(this,arguments)}function UL(t,e,n,i){if(i.uri&&(t.baseUri=i.uri),e instanceof ArrayBuffer&&!function(t,e=0,n={}){const i=new DataView(t),{magic:r=LL}=n,s=i.getUint32(e,!1);return s===r||s===LL}(e,n,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)t.json=function(t){try{return JSON.parse(t)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(t,e=5){return"string"==typeof t?t.slice(0,e):ArrayBuffer.isView(t)?jR(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?jR(t,0,e):""}(t)}"`)}}(e);else if(e instanceof ArrayBuffer){const r={};n=function(t,e,n=0,i={}){const r=new DataView(e),s=function(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}(r,n+0),o=r.getUint32(n+4,jL),a=r.getUint32(n+8,jL);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),n+=12,t.version){case 1:return function(t,e,n){Nk(t.header.byteLength>20);const i=e.getUint32(n+0,jL),r=e.getUint32(n+4,jL);return n+=8,Nk(0===r),FL(t,e,n,i),(n+=i)+BL(t,e,n,t.header.byteLength)}(t,r,n);case 2:return function(t,e,n,i){return Nk(t.header.byteLength>20),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,jL),s=e.getUint32(n+4,jL);switch(n+=8,s){case 1313821514:FL(t,e,n,r);break;case 5130562:BL(t,e,n,r);break;case 0:i.strict||FL(t,e,n,r);break;case 1:i.strict||BL(t,e,n,r)}n+=NN(r,4)}}(t,e,n,{}),n+t.header.byteLength}(t,r,n);default:throw new Error(`Invalid GLB version ${t.version}. Only supports v1 and v2.`)}}(r,e,n,i.glb),FR("glTF"===r.type,`Invalid GLB magic string ${r.type}`),t._glb=r,t.json=r.json}else FR(!1,"GLTF: must be ArrayBuffer or string");if(t.buffers=new Array((t.json.buffers||[]).length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}t.images=new Array((t.json.images||[]).length).fill({})}function HL(t,e,n){return $L.apply(this,arguments)}function $L(){return($L=gS(function*(t,e,n){for(let s=0;s{t.traverse(t=>{Object.values(t.model.getUniforms()).forEach(t=>{!1===t.loaded&&e.push(t)})})}),yield ZL(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function ZL(t){return JL.apply(this,arguments)}function JL(){return(JL=gS(function*(t){for(;t();)yield new Promise(t=>requestAnimationFrame(t))})).apply(this,arguments)}const tj=[255,255,255,255],ej={scenegraph:{type:"object",value:null,async:!0},getScene:t=>t&&t.scenes?"object"==typeof t.scene?t.scene:t.scenes[t.scene||0]:t,getAnimator:t=>t&&t.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:tj},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[YL]};let nj=(()=>{class t extends LP{getShaders(){const t=[qD,eR];return"pbr"===this.props._lighting&&t.push(gR),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:tj,transition:!0},instanceModelMatrix:cR})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;e.scenegraph!==n.scenegraph?this._updateScenegraph(e):e._animations!==n._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:e}=this.context;let n=null;if(t.scenegraph instanceof mR)n={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const i=t.scenegraph,r=function(t,e,n){const i=new LR(t,n);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(e,i,this._getModelOptions());n=bt({gltf:i},r),function(t){return QL.apply(this,arguments)}(r).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Iw.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),n=t.scenegraph);const i={layer:this,gl:e},r=t.getScene(n,i),s=t.getAnimator(n,i);r instanceof mR?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,s,t._animations),this.setState({scenegraph:r,animator:s})):null!==r&&Iw.warn("invalid scenegraph:",r)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const e=this.getAttributeManager().getAttributes();t.traverse(t=>{this._setModelAttributes(t.model,e)})}}_applyAnimationsProp(t,e,n){if(!t||!e||!n)return;const i=e.getAnimations();Object.keys(n).sort().forEach(t=>{const e=n[t];if("*"===t)i.forEach(t=>{Object.assign(t,e)});else if(Number.isFinite(Number(t))){const n=Number(t);n>=0&&ne===t);n?Object.assign(n,e):Iw.warn("animation ".concat(t," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof mR&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let e=null;return t&&(e="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:e,modelOptions:bt({isInstanced:!0,transpileToGLSL100:!Fw(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(e=>{this._setModelAttributes(e.model,t)})}draw({moduleParameters:t=null,parameters:e={},context:n}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(n.timeline.getTime()),this.setNeedsRedraw());const{viewport:i}=this.context,{sizeScale:r,sizeMinPixels:s,sizeMaxPixels:o,opacity:a,coordinateSystem:l}=this.props,c=this.getNumInstances();this.state.scenegraph.traverse((n,{worldMatrix:u})=>{n.model.setInstanceCount(c),n.updateModuleSettings(t),n.draw({parameters:e,uniforms:{sizeScale:r,opacity:a,sizeMinPixels:s,sizeMaxPixels:o,composeModelMatrix:uR(i,l),sceneModelMatrix:u,u_Camera:n.model.getUniforms().project_uCameraPosition}})})}}return t.layerName="ScenegraphLayer",t.defaultProps=ej,t})();const ij=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),rj=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),sj=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),oj=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),aj={POSITION:{size:3,value:new Float32Array(rj)},NORMAL:{size:3,value:new Float32Array(sj)},TEXCOORD_0:{size:2,value:new Float32Array(oj)}};class lj extends iR{constructor(t={}){const{id:e=Fx("cube-geometry")}=t;super(ti(bt({},t),{id:e,indices:{size:1,value:new Uint16Array(ij)},attributes:bt(bt({},aj),t.attributes)}))}}class cj{constructor(t=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=t}identity(){const t=this.elements;t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1}setZero(){const t=this.elements;t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0}setTrace(t){const e=this.elements;e[0]=t.x,e[4]=t.y,e[8]=t.z}getTrace(t=new hj){const e=this.elements;return t.x=e[0],t.y=e[4],t.z=e[8],t}vmult(t,e=new hj){const n=this.elements,i=t.x,r=t.y,s=t.z;return e.x=n[0]*i+n[1]*r+n[2]*s,e.y=n[3]*i+n[4]*r+n[5]*s,e.z=n[6]*i+n[7]*r+n[8]*s,e}smult(t){for(let e=0;e0){const t=1/i;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return i}unit(t=new hj){const e=this.x,n=this.y,i=this.z;let r=Math.sqrt(e*e+n*n+i*i);return r>0?(r=1/r,t.x=e*r,t.y=n*r,t.z=i*r):(t.x=1,t.y=0,t.z=0),t}length(){const t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)}lengthSquared(){return this.dot(this)}distanceTo(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return Math.sqrt((r-e)*(r-e)+(s-n)*(s-n)+(o-i)*(o-i))}distanceSquared(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return(r-e)*(r-e)+(s-n)*(s-n)+(o-i)*(o-i)}scale(t,e=new hj){const n=this.y,i=this.z;return e.x=t*this.x,e.y=t*n,e.z=t*i,e}vmul(t,e=new hj){return e.x=t.x*this.x,e.y=t.y*this.y,e.z=t.z*this.z,e}addScaledVector(t,e,n=new hj){return n.x=this.x+t*e.x,n.y=this.y+t*e.y,n.z=this.z+t*e.z,n}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(t=new hj){return t.x=-this.x,t.y=-this.y,t.z=-this.z,t}tangents(t,e){const n=this.length();if(n>0){const i=dj,r=1/n;i.set(this.x*r,this.y*r,this.z*r);const s=pj;Math.abs(i.x)<.9?(s.set(1,0,0),i.cross(s,t)):(s.set(0,1,0),i.cross(s,t)),i.cross(t,e)}else t.set(1,0,0),e.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}lerp(t,e,n){const i=this.x,r=this.y,s=this.z;n.x=i+(t.x-i)*e,n.y=r+(t.y-r)*e,n.z=s+(t.z-s)*e}almostEquals(t,e=1e-6){return!(Math.abs(this.x-t.x)>e||Math.abs(this.y-t.y)>e||Math.abs(this.z-t.z)>e)}almostZero(t=1e-6){return!(Math.abs(this.x)>t||Math.abs(this.y)>t||Math.abs(this.z)>t)}isAntiparallelTo(t,e){return this.negate(fj),fj.almostEquals(t,e)}clone(){return new hj(this.x,this.y,this.z)}}hj.ZERO=void 0,hj.UNIT_X=void 0,hj.UNIT_Y=void 0,hj.UNIT_Z=void 0,hj.ZERO=new hj(0,0,0),hj.UNIT_X=new hj(1,0,0),hj.UNIT_Y=new hj(0,1,0),hj.UNIT_Z=new hj(0,0,1);const dj=new hj,pj=new hj,fj=new hj;class gj{constructor(t={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new hj,this.upperBound=new hj,t.lowerBound&&this.lowerBound.copy(t.lowerBound),t.upperBound&&this.upperBound.copy(t.upperBound)}setFromPoints(t,e,n,i){const r=this.lowerBound,s=this.upperBound,o=n;r.copy(t[0]),o&&o.vmult(r,r),s.copy(r);for(let a=1;as.x&&(s.x=e.x),e.xs.y&&(s.y=e.y),e.ys.z&&(s.z=e.z),e.z=r.x&&e.y<=i.y&&n.y>=r.y&&e.z<=i.z&&n.z>=r.z}getCorners(t,e,n,i,r,s,o,a){const l=this.lowerBound,c=this.upperBound;t.copy(l),e.set(c.x,l.y,l.z),n.set(c.x,c.y,l.z),i.set(l.x,c.y,c.z),r.set(c.x,l.y,c.z),s.set(l.x,c.y,l.z),o.set(l.x,l.y,c.z),a.copy(c)}toLocalFrame(t,e){const n=bj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(let i=0;8!==i;i++){const e=n[i];t.pointToLocal(e,e)}return e.setFromPoints(n)}toWorldFrame(t,e){const n=bj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(let i=0;8!==i;i++){const e=n[i];t.pointToWorld(e,e)}return e.setFromPoints(n)}overlapsRay(t){const{direction:e,from:n}=t,i=1/e.x,r=1/e.y,s=1/e.z,o=(this.lowerBound.x-n.x)*i,a=(this.upperBound.x-n.x)*i,l=(this.lowerBound.y-n.y)*r,c=(this.upperBound.y-n.y)*r,u=(this.lowerBound.z-n.z)*s,h=(this.upperBound.z-n.z)*s,d=Math.max(Math.max(Math.min(o,a),Math.min(l,c)),Math.min(u,h)),p=Math.min(Math.min(Math.max(o,a),Math.max(l,c)),Math.max(u,h));return!(p<0||d>p)}}const mj=new hj,bj=[new hj,new hj,new hj,new hj,new hj,new hj,new hj,new hj];class yj{constructor(t=0,e=0,n=0,i=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=t,this.y=e,this.z=n,this.w=i}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(t,e){const n=Math.sin(.5*e);return this.x=t.x*n,this.y=t.y*n,this.z=t.z*n,this.w=Math.cos(.5*e),this}toAxisAngle(t=new hj){this.normalize();const e=2*Math.acos(this.w),n=Math.sqrt(1-this.w*this.w);return n<.001?(t.x=this.x,t.y=this.y,t.z=this.z):(t.x=this.x/n,t.y=this.y/n,t.z=this.z/n),[t,e]}setFromVectors(t,e){if(t.isAntiparallelTo(e)){const e=vj;t.tangents(e,_j),this.setFromAxisAngle(e,Math.PI)}else{const n=t.cross(e);this.x=n.x,this.y=n.y,this.z=n.z,this.w=Math.sqrt(Nr(t.length(),2)*Nr(e.length(),2))+t.dot(e),this.normalize()}return this}mult(t,e=new yj){const n=this.x,i=this.y,r=this.z,s=this.w,o=t.x,a=t.y,l=t.z,c=t.w;return e.x=n*c+s*o+i*l-r*a,e.y=i*c+s*a+r*o-n*l,e.z=r*c+s*l+n*a-i*o,e.w=s*c-n*o-i*a-r*l,e}inverse(t=new yj){const e=this.x,n=this.y,i=this.z,r=this.w;this.conjugate(t);const s=1/(e*e+n*n+i*i+r*r);return t.x*=s,t.y*=s,t.z*=s,t.w*=s,t}conjugate(t=new yj){return t.x=-this.x,t.y=-this.y,t.z=-this.z,t.w=this.w,t}normalize(){let t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}normalizeFast(){const t=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}vmult(t,e=new hj){const n=t.x,i=t.y,r=t.z,s=this.x,o=this.y,a=this.z,l=this.w,c=l*n+o*r-a*i,u=l*i+a*n-s*r,h=l*r+s*i-o*n,d=-s*n-o*i-a*r;return e.x=c*l+d*-s+u*-a-h*-o,e.y=u*l+d*-o+h*-s-c*-a,e.z=h*l+d*-a+c*-o-u*-s,e}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}toEuler(t,e="YZX"){let n,i,r;const s=this.x,o=this.y,a=this.z,l=this.w;switch(e){case"YZX":const t=s*o+a*l;if(t>.499&&(n=2*Math.atan2(s,l),i=Math.PI/2,r=0),t<-.499&&(n=-2*Math.atan2(s,l),i=-Math.PI/2,r=0),void 0===n){const e=s*s,c=a*a;n=Math.atan2(2*o*l-2*s*a,1-o*o*2-2*c),i=Math.asin(2*t),r=Math.atan2(2*s*l-2*o*a,1-2*e-2*c)}break;default:throw new Error("Euler order "+e+" not supported yet.")}t.y=n,t.z=i,t.x=r}setFromEuler(t,e,n,i="XYZ"){const r=Math.cos(t/2),s=Math.cos(e/2),o=Math.cos(n/2),a=Math.sin(t/2),l=Math.sin(e/2),c=Math.sin(n/2);return"XYZ"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o-a*l*c):"YXZ"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o+a*l*c):"ZXY"===i?(this.x=a*s*o-r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o-a*l*c):"ZYX"===i?(this.x=a*s*o-r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o+a*l*c):"YZX"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o-a*l*c):"XZY"===i&&(this.x=a*s*o-r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o+a*l*c),this}clone(){return new yj(this.x,this.y,this.z,this.w)}slerp(t,e,n=new yj){const i=this.x,r=this.y,s=this.z,o=this.w;let a,l,c,u,h,d=t.x,p=t.y,f=t.z,g=t.w;return l=i*d+r*p+s*f+o*g,l<0&&(l=-l,d=-d,p=-p,f=-f,g=-g),1-l>1e-6?(a=Math.acos(l),c=Math.sin(a),u=Math.sin((1-e)*a)/c,h=Math.sin(e*a)/c):(u=1-e,h=e),n.x=u*i+h*d,n.y=u*r+h*p,n.z=u*s+h*f,n.w=u*o+h*g,n}integrate(t,e,n,i=new yj){const r=t.x*n.x,s=t.y*n.y,o=t.z*n.z,a=this.x,l=this.y,c=this.z,u=this.w,h=.5*e;return i.x+=h*(r*u+s*c-o*l),i.y+=h*(s*u+o*a-r*c),i.z+=h*(o*u+r*l-s*a),i.w+=h*(-r*a-s*l-o*c),i}}const vj=new hj,_j=new hj,wj={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let xj=(()=>{class t{constructor(e={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=t.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=!e.collisionResponse||e.collisionResponse,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:1,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,e){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,e,n,i){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return t.idCounter=0,t.types=wj,t})();class Sj{constructor(t={}){this.position=void 0,this.quaternion=void 0,this.position=new hj,this.quaternion=new yj,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}pointToLocal(t,e){return Sj.pointToLocalFrame(this.position,this.quaternion,t,e)}pointToWorld(t,e){return Sj.pointToWorldFrame(this.position,this.quaternion,t,e)}vectorToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e}static pointToLocalFrame(t,e,n,i=new hj){return n.vsub(t,i),e.conjugate(Ej),Ej.vmult(i,i),i}static pointToWorldFrame(t,e,n,i=new hj){return e.vmult(n,i),i.vadd(t,i),i}static vectorToWorldFrame(t,e,n=new hj){return t.vmult(e,n),n}static vectorToLocalFrame(t,e,n,i=new hj){return e.w*=-1,e.vmult(n,i),e.w*=-1,i}}const Ej=new yj;class Cj extends xj{constructor(t={}){const{vertices:e=[],faces:n=[],normals:i=[],axes:r,boundingSphereRadius:s}=t;super({type:xj.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=e,this.faces=n,this.faceNormals=i,0===this.faceNormals.length&&this.computeNormals(),s?this.boundingSphereRadius=s:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=r?r.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const t=this.faces,e=this.vertices,n=this.uniqueEdges;n.length=0;const i=new hj;for(let r=0;r!==t.length;r++){const s=t[r],o=s.length;for(let t=0;t!==o;t++){e[s[t]].vsub(e[s[(t+1)%o]],i),i.normalize();let r=!1;for(let t=0;t!==n.length;t++)if(n[t].almostEquals(i)||n[t].almostEquals(i)){r=!0;break}r||n.push(i.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let t=0;th&&(h=t,u=p)}const d=[];for(let p=0;p=0&&this.clipFaceAgainstHull(s,t,e,d,o,a,l)}findSeparatingAxis(t,e,n,i,r,s,o,a){const l=new hj,c=new hj,u=new hj,h=new hj,d=new hj,p=new hj;let f=Number.MAX_VALUE;const g=this;if(g.uniqueAxes)for(let m=0;m!==g.uniqueAxes.length;m++){n.vmult(g.uniqueAxes[m],l);const o=g.testSepAxis(l,t,e,n,i,r);if(!1===o)return!1;o0&&s.negate(s),!0}testSepAxis(t,e,n,i,r,s){Cj.project(this,t,n,i,Oj),Cj.project(e,t,r,s,Tj);const o=Oj[0],a=Oj[1],l=Tj[0],c=Tj[1];if(o0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?Dj.STATIC:Dj.DYNAMIC,typeof t.type==typeof Dj.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=Dj.AWAKE,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new hj,this.quaternion=new yj,this.initQuaternion=new yj,this.previousQuaternion=new yj,this.interpolatedQuaternion=new yj,t.quaternion&&(this.quaternion.copy(t.quaternion),this.initQuaternion.copy(t.quaternion),this.previousQuaternion.copy(t.quaternion),this.interpolatedQuaternion.copy(t.quaternion)),this.angularVelocity=new hj,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new hj,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new hj,this.invInertia=new hj,this.invInertiaWorld=new cj,this.invMassSolve=0,this.invInertiaSolve=new hj,this.invInertiaWorldSolve=new cj,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new hj(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new hj(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new gj,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new hj,this.isTrigger=Boolean(t.isTrigger),t.shape&&this.addShape(t.shape),this.updateMassProperties()}wakeUp(){const t=this.sleepState;this.sleepState=Dj.AWAKE,this.wakeUpAfterNarrowphase=!1,t===Dj.SLEEPING&&this.dispatchEvent(Dj.wakeupEvent)}sleep(){this.sleepState=Dj.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(t){if(this.allowSleep){const e=this.sleepState,n=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),i=Nr(this.sleepSpeedLimit,2);e===Dj.AWAKE&&ni?this.wakeUp():e===Dj.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(Dj.sleepEvent))}}updateSolveMassProperties(){this.sleepState===Dj.SLEEPING||this.type===Dj.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(t,e=new hj){return t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e}vectorToLocalFrame(t,e=new hj){return this.quaternion.conjugate().vmult(t,e),e}pointToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e.vadd(this.position,e),e}vectorToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e}addShape(t,e,n){const i=new hj,r=new yj;return e&&i.copy(e),n&&r.copy(n),this.shapes.push(t),this.shapeOffsets.push(i),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=this,this}removeShape(t){const e=this.shapes.indexOf(t);return-1===e?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(e,1),this.shapeOffsets.splice(e,1),this.shapeOrientations.splice(e,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=null,this)}updateBoundingRadius(){const t=this.shapes,e=this.shapeOffsets,n=t.length;let i=0;for(let r=0;r!==n;r++){const n=t[r];n.updateBoundingSphereRadius();const s=e[r].length(),o=n.boundingSphereRadius;s+o>i&&(i=s+o)}this.boundingRadius=i}updateAABB(){const t=this.shapes,e=this.shapeOffsets,n=this.shapeOrientations,i=t.length,r=Rj,s=Nj,o=this.quaternion,a=this.aabb,l=Lj;for(let c=0;c!==i;c++){const i=t[c];o.vmult(e[c],r),r.vadd(this.position,r),o.mult(n[c],s),i.calculateWorldAABB(r,s,l.lowerBound,l.upperBound),0===c?a.copy(l):a.extend(l)}this.aabbNeedsUpdate=!1}updateInertiaWorld(t){const e=this.invInertia;if(e.x!==e.y||e.y!==e.z||t){const t=jj,n=Fj;t.setRotationFromQuaternion(this.quaternion),t.transpose(n),t.scale(e,t),t.mmult(n,this.invInertiaWorld)}}applyForce(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;this.sleepState===Dj.SLEEPING&&this.wakeUp();const n=Bj;e.cross(t,n),this.force.vadd(t,this.force),this.torque.vadd(n,this.torque)}applyLocalForce(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;const n=Vj,i=zj;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyForce(n,i)}applyTorque(t){this.type===Dj.DYNAMIC&&(this.sleepState===Dj.SLEEPING&&this.wakeUp(),this.torque.vadd(t,this.torque))}applyImpulse(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;this.sleepState===Dj.SLEEPING&&this.wakeUp();const n=e,i=Uj;i.copy(t),i.scale(this.invMass,i),this.velocity.vadd(i,this.velocity);const r=Hj;n.cross(t,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;const n=$j,i=Gj;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyImpulse(n,i)}updateMassProperties(){const t=Wj;this.invMass=this.mass>0?1/this.mass:0;const e=this.inertia,n=this.fixedRotation;this.updateAABB(),t.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),Pj.calculateInertia(t,this.mass,e),this.invInertia.set(e.x>0&&!n?1/e.x:0,e.y>0&&!n?1/e.y:0,e.z>0&&!n?1/e.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(t,e){const n=new hj;return t.vsub(this.position,n),this.angularVelocity.cross(n,e),this.velocity.vadd(e,e),e}integrate(t,e,n){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==Dj.DYNAMIC&&this.type!==Dj.KINEMATIC||this.sleepState===Dj.SLEEPING)return;const i=this.velocity,r=this.angularVelocity,s=this.position,o=this.force,a=this.torque,l=this.quaternion,c=this.invInertiaWorld,u=this.linearFactor,h=this.invMass*t;i.x+=o.x*h*u.x,i.y+=o.y*h*u.y,i.z+=o.z*h*u.z;const d=c.elements,p=this.angularFactor,f=a.x*p.x,g=a.y*p.y,m=a.z*p.z;r.x+=t*(d[0]*f+d[1]*g+d[2]*m),r.y+=t*(d[3]*f+d[4]*g+d[5]*m),r.z+=t*(d[6]*f+d[7]*g+d[8]*m),s.x+=i.x*t,s.y+=i.y*t,s.z+=i.z*t,l.integrate(this.angularVelocity,t,this.angularFactor,l),e&&(n?l.normalizeFast():l.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}Dj.idCounter=0,Dj.COLLIDE_EVENT_NAME="collide",Dj.DYNAMIC=1,Dj.STATIC=2,Dj.KINEMATIC=4,Dj.AWAKE=0,Dj.SLEEPY=1,Dj.SLEEPING=2,Dj.wakeupEvent={type:"wakeup"},Dj.sleepyEvent={type:"sleepy"},Dj.sleepEvent={type:"sleep"};const Rj=new hj,Nj=new yj,Lj=new gj,jj=new cj,Fj=new cj,Bj=new hj,Vj=new hj,zj=new hj,Uj=new hj,Hj=new hj,$j=new hj,Gj=new hj,Wj=new hj;new hj,new hj;class qj{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new hj,this.rayToWorld=new hj,this.hitNormalWorld=new hj,this.hitPointWorld=new hj,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(t,e,n,i,r,s,o){this.rayFromWorld.copy(t),this.rayToWorld.copy(e),this.hitNormalWorld.copy(n),this.hitPointWorld.copy(i),this.shape=r,this.body=s,this.distance=o}}let Xj,Yj,Kj,Qj,Zj,Jj,tF;Xj=xj.types.SPHERE,Yj=xj.types.PLANE,Kj=xj.types.BOX,Qj=xj.types.CYLINDER,Zj=xj.types.CONVEXPOLYHEDRON,Jj=xj.types.HEIGHTFIELD,tF=xj.types.TRIMESH;class eF{get[Xj](){return this._intersectSphere}get[Yj](){return this._intersectPlane}get[Kj](){return this._intersectBox}get[Qj](){return this._intersectConvex}get[Zj](){return this._intersectConvex}get[Jj](){return this._intersectHeightfield}get[tF](){return this._intersectTrimesh}constructor(t=new hj,e=new hj){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=t.clone(),this.to=e.clone(),this.direction=new hj,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=eF.ANY,this.result=new qj,this.hasHit=!1,this.callback=t=>{}}intersectWorld(t,e){return this.mode=e.mode||eF.ANY,this.result=e.result||new qj,this.skipBackfaces=!!e.skipBackfaces,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===e.checkCollisionResponse||e.checkCollisionResponse,e.from&&this.from.copy(e.from),e.to&&this.to.copy(e.to),this.callback=e.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(nF),iF.length=0,t.broadphase.aabbQuery(t,nF,iF),this.intersectBodies(iF),this.hasHit}intersectBody(t,e){e&&(this.result=e,this.updateDirection());const n=this.checkCollisionResponse;if(n&&!t.collisionResponse||0==(this.collisionFilterGroup&t.collisionFilterMask)||0==(t.collisionFilterGroup&this.collisionFilterMask))return;const i=oF,r=aF;for(let s=0,o=t.shapes.length;st.boundingSphereRadius)return;const r=this[t.type];r&&r.call(this,t,e,n,i,t)}_intersectBox(t,e,n,i,r){return this._intersectConvex(t.convexPolyhedronRepresentation,e,n,i,r)}_intersectPlane(t,e,n,i,r){const s=this.from,o=this.to,a=this.direction,l=new hj(0,0,1);e.vmult(l,l);const c=new hj;s.vsub(n,c);const u=c.dot(l);if(o.vsub(n,c),u*c.dot(l)>0||s.distanceTo(o)=0&&t<=1&&(s.lerp(o,t,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1)),this.result.shouldStop)return;e>=0&&e<=1&&(s.lerp(o,e,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1))}}_intersectConvex(t,e,n,i,r,s){const o=yF,a=vF,l=s&&s.faceList||null,c=t.faces,u=t.vertices,h=t.faceNormals,d=this.direction,p=this.from,f=p.distanceTo(this.to),g=l?l.length:c.length,m=this.result;for(let b=0;!m.shouldStop&&bf||this.reportIntersection(o,lF,r,i,t)}}}}_intersectTrimesh(t,e,n,i,r,s){const o=_F,a=OF,l=TF,c=vF,u=wF,h=xF,d=SF,p=CF,f=EF,g=t.indices,m=this.from,b=this.to,y=this.direction;l.position.copy(n),l.quaternion.copy(e),Sj.vectorToLocalFrame(n,e,y,u),Sj.pointToLocalFrame(n,e,m,h),Sj.pointToLocalFrame(n,e,b,d),d.x*=t.scale.x,d.y*=t.scale.y,d.z*=t.scale.z,h.x*=t.scale.x,h.y*=t.scale.y,h.z*=t.scale.z,d.vsub(h,u),u.normalize();const v=h.distanceSquared(d);t.tree.rayQuery(this,l,a);for(let _=0,w=a.length;!this.result.shouldStop&&_!==w;_++){const s=a[_];t.getNormal(s,o),t.getVertex(g[3*s],cF),cF.vsub(h,c);const l=u.dot(o),d=o.dot(c)/l;if(d<0)continue;u.scale(d,lF),lF.vadd(h,lF),t.getVertex(g[3*s+1],uF),t.getVertex(g[3*s+2],hF);const m=lF.distanceSquared(h);!eF.pointInTriangle(lF,uF,cF,hF)&&!eF.pointInTriangle(lF,cF,uF,hF)||m>v||(Sj.vectorToWorldFrame(e,o,f),Sj.pointToWorldFrame(n,e,lF,p),this.reportIntersection(f,p,r,i,s))}a.length=0}reportIntersection(t,e,n,i,r){const s=this.from,o=this.to,a=s.distanceTo(e),l=this.result;if(!(this.skipBackfaces&&t.dot(this.direction)>0))switch(l.hitFaceIndex=void 0!==r?r:-1,this.mode){case eF.ALL:this.hasHit=!0,l.set(s,o,t,e,n,i,a),l.hasHit=!0,this.callback(l);break;case eF.CLOSEST:(a=0&&(u=r*l-s*o)>=0&&c+uDate.now()-t}var iB=n(24517);function rB(t,e,n){e||(e=new bT(bT.IDENTITY));const i=new bT(bT.IDENTITY);if(t.matrix)i.copy(t.matrix);else{if(i.identity(),t.translation&&i.translate(t.translation),t.rotation){const e=new bT(bT.IDENTITY).fromQuaternion(t.rotation);i.multiplyRight(e)}t.scale&&i.scale(t.scale)}const r=new bT(e).multiplyRight(i);if(!1===n(t,r,e))return!1;for(const s of t.nodes||t.children||[])if(!1===rB(s,r,n))return!1;return!0}function sB(){fP([zR,YL])}function oB(t,e){const n=e.nodes.find(e=>e.name===t);if(n){let i=!1;for(const t of e.scenes)i||rB(t,new bT(bT.IDENTITY),(t,e)=>t!==n||(t.matrix=e,t.translation=void 0,t.rotation=void 0,t.scale=void 0,i=!0,!1));return e.scene={id:t,name:t,nodes:[n]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function aB(t,e){return lw(this,void 0,void 0,function*(){const n=t.scenegraph;let i;i=e?e[n]||(e[n]=fetch(n).then(t=>t.blob())):fetch(n);const r=yield CP(i,YL,{DracoLoader:DN,gltf:{decompressMeshes:!0,postProcess:!0}});return oB(t.scenegraphNode,r)})}function lB(t,e){return lw(this,void 0,void 0,function*(){return oB(t,yield e)})}function cB(t,e,n){if(e&&0!==e.length)return new fR(Object.assign({id:t,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mw.CARTESIAN,data:e,mesh:new lj,wireframe:!1,getTransformMatrix:t=>t.transformMatrix,getColor:t=>t.color||[255,255,255,229.5]},n))}let uB=(()=>{class t extends jP{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),sB()}renderLayers(){const e=this.state,n=e.data.filter(t=>!t.scenegraph&&!t.wireframe&&t.unpickable),i=e.data.filter(t=>!t.scenegraph&&!t.wireframe&&!t.unpickable),r=e.data.filter(t=>!t.scenegraph&&t.wireframe),s=e.data.filter(t=>!!t.scenegraph);e.doCollisions&&function(t){lw(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=t.filter(t=>!t.scenegraph&&!t.wireframe).map(t=>{const e=new bT(t.transformMatrix),n=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return{"@id":t["@id"],name:t.tooltip,entityId:t.entityId,bbox:new gj({lowerBound:new hj(...n.map((t,e)=>Math.min(t,i[e]))),upperBound:new hj(...i.map((t,e)=>Math.max(t,n[e])))})}}),n=[];for(const o of t.filter(t=>!!t.scenegraph)){const t=yield AP(o.scenegraph,YL,{DracoLoader:DN,decompress:!0,postProcess:!0});for(const e of t.scenes)rB(e,new bT(o.transformMatrix),(e,i)=>{if(e.mesh&&e.mesh.primitives&&e.mesh.primitives.length>0)for(const r of e.mesh.primitives)if(r.attributes.POSITION&&r.attributes.POSITION.min){const s=i.transformAsPoint(r.attributes.POSITION.min,[]),a=i.transformAsPoint(r.attributes.POSITION.max,[]);n.push({"@id":o["@id"],name:e.name,entityId:o.entityId,bbox:new gj({lowerBound:new hj(...s.map((t,e)=>Math.min(t,a[e]))),upperBound:new hj(...a.map((t,e)=>Math.max(t,s[e])))}),gltf:t})}return!0})}const i=[],r=[];for(const t of e){const e=[];for(const i of n)t.bbox.overlaps(i.bbox)&&e.push({"@id":i["@id"],name:i.name});e.length>0?i.push({"@id":t.entityId,name:t.name,hits:e}):r.push(t)}console.log({sourceBoxes:e,targetBoxes:n,report:i,sad:r,maxHits:Math.max(...i.map(t=>t.hits.length))});const s=[];for(const t of i){s.push({"Tissue ID":t["@id"],"Tissue Name":t.name,"Hit ID":"","Hit Name":""});for(const e of t.hits)s.push({"Tissue ID":t["@id"],"Tissue Name":t.name,"Hit ID":e["@id"],"Hit Name":e.name})}return console.log(s),i})}(e.data);const o={};for(const a of s)a.scenegraph&&a.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,a.scenegraph)&&(o[a.scenegraph]=aB({scenegraph:a.scenegraph},t.gltfCache));return[cB("cubes",n,{wireframe:!1,pickable:!1}),cB("pickableCubes",i,{wireframe:!1,pickable:!0}),cB("wireframes",r,{wireframe:!0,pickable:!1}),...s.map(t=>{var n;return new nj({id:"models-"+t["@id"],opacity:t.zoomBasedOpacity?e.zoomOpacity:void 0!==t.opacity?t.opacity:1,pickable:!t.unpickable,coordinateSystem:Mw.CARTESIAN,data:[t],scenegraph:t.scenegraphNode?lB(t.scenegraphNode,o[t.scenegraph]):t.scenegraph,_lighting:t._lighting,getTransformMatrix:t.transformMatrix,getColor:null!==(n=t.color)&&void 0!==n?n:[0,255,0,127.5],parameters:{depthMask:!t.zoomBasedOpacity&&(void 0===t.opacity||1===t.opacity)}})})].filter(t=>!!t)}getPickingInfo(t){return t.info}}return t.layerName="BodyUILayer",t.gltfCache={},t})();function hB(t,e=[]){for(const n of t.nodes||t.children||[])e.push(n.name),hB(n,e);return e}let dB=(()=>{class t{constructor(t){var e,n,i,r,s;this.deckProps=t,this.bodyUILayer=new uB({}),this.nodeClickSubject=new P,this.nodeHoverStartSubject=new P,this.nodeHoverStopSubject=new P,this.sceneRotationSubject=new Uf([0,0]),this.nodeDragStartSubject=new P,this.nodeDragSubject=new P,this.nodeDragEndSubject=new P,this.nodeClick$=this.nodeClickSubject.pipe(at()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(at()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(at()),this.sceneRotation$=this.sceneRotationSubject.pipe(at()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(at()),this.nodeDrag$=this.nodeDragSubject.pipe(at()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(at());const o=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new pI({flipY:!1,near:-1e3}):new bI({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:t=>{var e;return null!==(e=this.cursor)&&void 0!==e?e:t.isDragging?"grabbing":"grab"}});t.legacyLighting&&(o.effects=[new $I({ambientLight:new wI({color:[255,255,255],intensity:10})})]),this.deck=new WD(o),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(e=t.minRotationX)&&void 0!==e?e:-15,maxRotationX:null!==(n=t.maxRotationX)&&void 0!==n?n:15,target:null!==(i=t.target)&&void 0!==i?i:[.5,.5,0],rotationX:0,rotationOrbit:null!==(r=t.rotation)&&void 0!==r?r:0,zoom:null!==(s=t.zoom)&&void 0!==s?s:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return lw(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let e=this.bodyUILayer.state.zoomOpacity,n=!1;for(const i of t)i.zoomToOnLoad&&(this.zoomTo(i),n=!0);e=n?.05:e,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,e):this.bodyUILayer.setState({data:t,zoomOpacity:e})}}debugSceneNodeProcessing(t,e){const n="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",i=new bT([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(t,e,n){return lw(this,void 0,void 0,function*(){sB();const n=yield aB({scenegraph:t,scenegraphNode:"VHF_Kidney_L_Low1"}),i={},r=[];for(const s of n.scenes)rB(s,e=new bT(e||bT.IDENTITY),(n,s)=>{const o={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new bT(s),wireframe:!0,node:n};if(r.push({"@id":`GLTF:${o["@id"]}`,"@type":"GLTFNode",scenegraph:t,scenegraphNode:o["@id"],transformMatrix:new bT(e||bT.IDENTITY),tooltip:n.name||n.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:n}),n.mesh&&n.mesh.primitives&&n.mesh.primitives.length>0)for(const t of n.mesh.primitives)if(t.attributes.POSITION&&t.attributes.POSITION.min){const e=s.transformAsPoint(t.attributes.POSITION.min,[]),n=s.transformAsPoint(t.attributes.POSITION.max,[]);o.bbox=new gj({lowerBound:new hj(...e.map((t,e)=>Math.min(t,n[e]))),upperBound:new hj(...n.map((t,n)=>Math.max(t,e[n])))})}return i[o["@id"]]=o,!0});for(const t of Object.values(i).filter(t=>!t.bbox)){for(const e of hB(t.node).map(t=>i[t]).filter(t=>t.bbox))t.bbox?t.bbox.extend(e.bbox):t.bbox=e.bbox.clone();t.bbox||delete i[t["@id"]]}for(const t of Object.values(i)){const e=t.bbox.lowerBound,n=(t.size=t.bbox.upperBound.clone().vsub(e)).clone().vmul(new hj(.5,.5,.5)),i=t.center=e.clone().vadd(n);t.transformMatrix=new bT(bT.IDENTITY).translate(i.toArray()).scale(n.toArray())}for(const t of r)i[t["@id"]]=t;return i})})(n,i).then(r=>{console.log("results",r),console.log("data",t),(t=t.concat(Object.values(r))).push({"@id":"TEST","@type":"TEST",scenegraph:n,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:i,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:e})})}zoomTo(t){const e=new bT(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:e.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:e}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?e!==t.object&&(e&&this.nodeHoverStopSubject.next(e),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):e&&(this.nodeHoverStopSubject.next(e),this.lastHovered=void 0)}_onClick(t,e){var n,i;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(i=null===(n=null==e?void 0:e.srcEvent)||void 0===n?void 0:n.ctrlKey)&&void 0!==i?i:void 0})}_onViewStateChange(t){var e;if(null===(e=t.interactionState)||void 0===e?void 0:e.isZooming){const e=this.bodyUILayer.state,n=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);e.zoomOpacity!==n&&this.bodyUILayer.setState({data:e.data,zoomOpacity:n})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,e){this._dragEvent(t,e,this.nodeDragStartSubject)}_onDrag(t,e){this._dragEvent(t,e,this.nodeDragSubject)}_onDragEnd(t,e){this._dragEvent(t,e,this.nodeDragEndSubject)}_dragEvent(t,e,n){var i;(null===(i=null==t?void 0:t.object)||void 0===i?void 0:i["@id"])&&n.next({node:t.object,info:t,e})}}return sw([iB.ZP],t.prototype,"_onHover",null),sw([iB.ZP],t.prototype,"_onClick",null),sw([iB.ZP],t.prototype,"_onViewStateChange",null),sw([iB.ZP],t.prototype,"_onDragStart",null),sw([iB.ZP],t.prototype,"_onDrag",null),sw([iB.ZP],t.prototype,"_onDragEnd",null),t})();function pB(t,e){return t===e}function fB(t,e,n){if(null===e||null===n||e.length!==n.length)return!1;const i=e.length;for(let r=0;r(t&&t.providers||[]).some(t=>t&&t.provide&&"MockNgModuleResolver"===t.provide.name||!1))});let bB=(()=>{class t{constructor(){this.bootstrap$=new lp(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const yB=new oi("INITIAL_STATE_TOKEN");let vB=(()=>{class t{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return t.value={},t})();const _B=new oi("Internals.StateContextFactory"),wB=new oi("Internals.StateFactory");function xB(t,e){return e?n=>n.pipe(xB((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new SB(t))}class SB{constructor(t){this.project=t}call(t,e){return e.subscribe(new EB(t,this.project))}}class EB extends ${constructor(t,e){super(t),this.project=e,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(t){this.hasSubscription||this.tryNext(t)}tryNext(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this.hasSubscription=!0,this._innerSub(e)}_innerSub(t){const e=new H(this),n=this.destination;n.add(e);const i=G(t,e);i!==e&&n.add(i)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function CB(t=null){return e=>e.lift(new OB(t))}class OB{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new TB(t,this.defaultValue))}}class TB extends v{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}const kB={STATE_NAME:t=>`${t} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(t,e,n)=>`State name '${t}' from ${e} already exists in ${n}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:t=>`'${t}' class should be decorated with @Injectable() right after the @State() decorator`};let AB=(()=>{class t{constructor(t,e){this._ngZone=t,this._platformId=e,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(t){return"server"===t}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return xu.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return xu.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof xu||console.warn(kB.ZONE_WARNING())}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(ou))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const PB=new oi("ROOT_STATE_TOKEN"),IB=new oi("FEATURE_STATE_TOKEN"),MB=new oi("NGXS_PLUGINS"),DB=new oi("NG_TEST_MODE"),RB=new oi("NG_DEV_MODE"),NB="NGXS_META",LB="NGXS_OPTIONS_META";let jB=(()=>{class t{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=AB}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class FB{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}}const BB=new oi("NGXS_EXECUTION_STRATEGY");function VB(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}const zB=(t,e,n)=>{t=Object.assign({},t);const i=e.split("."),r=i.length-1;return i.reduce((t,e,i)=>(t[e]=i===r?n:Array.isArray(t[e])?t[e].slice():Object.assign({},t[e]),t&&t[e]),t),t},UB=(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t),HB=t=>t&&"object"==typeof t&&!Array.isArray(t),$B=(t,...e)=>{if(!e.length)return t;const n=e.shift();if(HB(t)&&HB(n))for(const i in n)HB(n[i])?(t[i]||Object.assign(t,{[i]:{}}),$B(t[i],n[i])):Object.assign(t,{[i]:n[i]});return $B(t,...e)};function GB(t){return t[NB]}function WB(t,e){const n=UB(e.currentAppState,t.path),i=UB(e.newAppState,t.path);return new FB(n,i,!t.isInitialised)}function qB(...t){return function(t,e,n=XB){const i=function(t){return t.reduce((t,e)=>(t[VB(e)]=!0,t),{})}(t),r=e&&function(t){return t.reduce((t,e)=>(t[e]=!0,t),{})}(e);return function(t){return t.pipe(function(t,e){return Hd(n=>{const i=VB(n.action);return t[i]&&(!e||e[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function XB(){return D(t=>t.action)}function YB(t){return e=>new C(n=>e.subscribe({next(e){t.leave(()=>n.next(e))},error(e){t.leave(()=>n.error(e))},complete(){t.leave(()=>n.complete())}}))}let KB=(()=>{class t{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(BB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class QB extends P{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(t){if(this._busyPushingNext)this._itemQueue.unshift(t);else{for(this._busyPushingNext=!0,super.next(t);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let ZB=(()=>{class t extends QB{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),JB=(()=>{class t extends C{constructor(t,e){super(n=>{const i=t.pipe(YB(e)).subscribe({next:t=>n.next(t),error:t=>n.error(t),complete:()=>n.complete()});n.add(i)})}}return t.\u0275fac=function(e){return new(e||t)(Ci(ZB),Ci(KB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const tV=t=>(...e)=>t.shift()(...e,(...e)=>tV(t)(...e));let eV=(()=>{class t extends Uf{constructor(){super({})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),nV=(()=>{class t{constructor(t,e){this._parentManager=t,this._pluginHandlers=e,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(t=>t.handle?t.handle.bind(t):t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12),Ci(MB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),iV=(()=>{class t extends P{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),rV=(()=>{class t{constructor(t,e,n,i,r,s){this._injector=t,this._actions=e,this._actionResults=n,this._pluginManager=i,this._stateStream=r,this._ngxsExecutionStrategy=s}dispatch(t){const e=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return e.subscribe({error:t=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(kr),this._errorHandler.handleError(t)}catch(e){}})}),e.pipe(YB(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?wd(this._stateStream.getValue()):hv(t.map(t=>this.dispatchSingle(t))):this.dispatchSingle(t)}dispatchSingle(t){if(!VB(t))return ip(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const e=this._stateStream.getValue();return tV([...this._pluginManager.plugins,(t,n)=>{t!==e&&this._stateStream.next(t);const i=this.getActionResultStream(n);return i.subscribe(t=>this._actions.next(t)),this._actions.next({action:n,status:"DISPATCHED"}),this.createDispatchObservable(i)}])(e,t).pipe(up())}getActionResultStream(t){return this._actionResults.pipe(Hd(e=>e.action===t&&"DISPATCHED"!==e.status),Gp(1),up())}createDispatchObservable(t){return t.pipe(xB(t=>{switch(t.status){case"SUCCESSFUL":return wd(this._stateStream.getValue());case"ERRORED":return ip(t.error);default:return ep}})).pipe(up())}}return t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(ZB),Ci(iV),Ci(nV),Ci(eV),Ci(KB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const sV=t=>{Object.freeze(t);const e="function"==typeof t,n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(function(i){n.call(t,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==t[i]&&("object"==typeof t[i]||"function"==typeof t[i])&&!Object.isFrozen(t[i])&&sV(t[i])}),t};let oV=(()=>{class t{constructor(t,e){this.isDevMode=t,this.isTestMode=e}}return t.\u0275fac=function(e){return new(e||t)(Ci(RB),Ci(DB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),aV=(()=>{class t{constructor(t,e){this._host=t,this._config=e}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(kB.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(kB.INCORRECT_DEVELOPMENT()))}}return t.\u0275fac=function(e){return new(e||t)(Ci(oV),Ci(jB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),lV=(()=>{class t{constructor(t,e,n,i){this._stateStream=t,this._dispatcher=e,this._config=n,i.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:t=>this._stateStream.next(t),dispatch:t=>this._dispatcher.dispatch(t)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:e=>{const n=sV(e);return t.setState(n)},dispatch:e=>t.dispatch(e)}}setStateToTheCurrentWithNew(t){const e=this.getRootStateOperations(),n=e.getState();e.setState(Object.assign({},n,t.defaults))}}return t.\u0275fac=function(e){return new(e||t)(Ci(eV),Ci(rV),Ci(jB),Ci(aV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),cV=(()=>{class t{constructor(t){this._internalStateOperations=t}createStateContext(t){const e=this._internalStateOperations.getRootStateOperations();function n(e){return UB(e,t.path)}function i(n,i){const r=zB(n,t.path,i),s=t.instance;if(s.ngxsOnChanges){const e=WB(t,{currentAppState:n,newAppState:r});s.ngxsOnChanges(e)}return e.setState(r),r}function r(t,e){return i(t,e(n(t)))}return{getState:()=>n(e.getState()),patchState:t=>r(e.getState(),function(t){return e=>{if(Array.isArray(t))throw new Error(kB.PATCHING_ARRAY());if("object"!=typeof t)throw new Error(kB.PATCHING_PRIMITIVE());const n=Object.assign({},e);for(const i in t)n[i]=t[i];return n}}(t)),setState(t){const n=e.getState();return function(t){return"function"==typeof t}(t)?r(n,t):i(n,t)},dispatch:t=>e.dispatch(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(lV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class uV{static stateNameErrorMessage(t){return kB.STATE_NAME(t)}static checkCorrectStateName(t){if(!t)throw new Error(kB.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(t))throw new Error(this.stateNameErrorMessage(t))}static checkStateNameIsUnique(t,e){const n=this.getValidStateMeta(t).name,i=e[n];if(i&&i!==t)throw new Error(kB.STATE_UNIQUE(n,t.name,i.name));return n}static getValidStateMeta(t){const e=GB(t);if(!e)throw new Error(kB.STATE_DECORATOR());return e}}uV.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let hV=(()=>{class t{constructor(t,e,n,i,r,s,o){this._injector=t,this._config=e,this._parentFactory=n,this._actions=i,this._actionResults=r,this._stateContextFactory=s,this._initialState=o,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=gB(()=>{const t=this;function e(e){const n=t.statePaths[e];return n?function(t,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(t){const e=t.slice();return t=>e.reduce((t,e)=>t&&t[e],t)}(t):function(t){const e=t;let n="store."+e[0],i=0;const r=e.length;let s=n;for(;++i(n||(n=e(t)),n?n(...i):void 0))},getSelectorOptions:e=>Object.assign({},t._config.selectorOptions,e||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let e={};return e=Array.isArray(t)?t.slice():function(t){return"object"==typeof t&&null!==t||"function"==typeof t}(t)?Object.assign({},t):void 0===t?{}:t,e}static checkStatesAreValid(t){t.forEach(uV.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(e){t.checkStatesAreValid(e);const{newStates:n}=this.addToStatesMap(e);if(!n.length)return[];const i=function(t){const e=e=>{const n=t.find(t=>t===e);if(!n)throw new Error(`Child state not found: ${e}. \r\nYou may have forgotten to add states to module`);return n[NB].name};return t.reduce((t,n)=>{const{name:i,children:r}=n[NB];return t[i]=(r||[]).map(e),t},{})}(n),r=function(t){const e=[],n={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),n[r]=!0,t[r].forEach(t=>{if(s.indexOf(t)>=0)throw new Error(`Circular dependency '${t}' is required by '${r}': ${s.join(" -> ")}`);n[t]||i(t,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(t).forEach(t=>i(t)),e.reverse()}(i),s=function(t,e={}){const n=(t,e)=>{for(const i in t)if(t.hasOwnProperty(i)&&t[i].indexOf(e)>=0){const e=n(t,i);return null!==e?`${e}.${i}`:i}return null};for(const i in t)if(t.hasOwnProperty(i)){const r=n(t,i);e[i]=r?`${r}.${i}`:i}return e}(i),o=function(t){return t.reduce((t,e)=>(t[e[NB].name]=e,t),{})}(n),a=[];for(const l of r){const e=o[l],n=s[l],i=e[NB];this.addRuntimeInfoToMeta(i,n);const r={name:l,path:n,isInitialised:!1,actions:i.actions,instance:this._injector.get(e),defaults:t.cloneDefaults(i.defaults)};this.hasBeenMountedAndBootstrapped(l,n)||a.push(r),this.states.push(r)}return a}addAndReturnDefaults(t){const e=this.add(t||[]);return{defaults:e.reduce((t,e)=>zB(t,e.path,e.defaults),{}),states:e}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Hd(t=>"DISPATCHED"===t.status),W(({action:t})=>this.invokeActions(this._actions,t).pipe(D(()=>({action:t,status:"SUCCESSFUL"})),CB({action:t,status:"CANCELED"}),pv(e=>wd({action:t,status:"ERRORED",error:e}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,e){const n=VB(e),i=[];for(const s of this.states){const o=s.actions[n];if(o)for(const n of o){const o=this._stateContextFactory.createStateContext(s);try{let r=s.instance[n.fn](o,e);r instanceof Promise&&(r=U(r)),r instanceof C?(r=r.pipe(CB({})),n.options.cancelUncompleted&&(r=r.pipe(Wd(t.pipe(qB(e)))))):r=wd({}).pipe(up()),i.push(r)}catch(r){i.push(ip(r))}}}return i.length||i.push(wd({})),hv(i)}addToStatesMap(t){const e=[],n=this.statesByName;for(const i of t){const t=uV.checkStateNameIsUnique(i,n);!n[t]&&(e.push(i),n[t]=i)}return{newStates:e}}addRuntimeInfoToMeta(t,e){this.statePaths[t.name]=e,t.path=e}hasBeenMountedAndBootstrapped(t,e){const n=void 0!==UB(this._initialState,e);return this.statesByName[t]&&n}}return t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(jB),Ci(t,12),Ci(ZB),Ci(iV),Ci(cV),Ci(yB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),dV=(()=>{class t{constructor(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}ngxsBootstrap(t,e){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Hd(()=>!!e),$f(()=>this.invokeInit(e.states)),W(()=>this.bootstrapper.appBootstrapped$),Hd(t=>!!t)).subscribe(()=>this.invokeBootstrap(e.states))}invokeInit(t){for(const e of t){const t=e.instance;if(t.ngxsOnChanges){const n=WB(e,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});t.ngxsOnChanges(n)}t.ngxsOnInit&&t.ngxsOnInit(this.getStateContext(e)),e.isInitialised=!0}}invokeBootstrap(t){for(const e of t){const t=e.instance;t.ngxsAfterBootstrap&&t.ngxsAfterBootstrap(this.getStateContext(e))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(lV),Ci(cV),Ci(bB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();let pV=(()=>{class t{constructor(t,e,n,i,r,s){this._stateStream=t,this._internalStateOperations=e,this._config=n,this._internalExecutionStrategy=i,this._stateFactory=r,this.initStateStream(s)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const e=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(D(e),pv(t=>{const{suppressErrors:e}=this._config.selectorOptions;return t instanceof TypeError&&e?wd(void 0):ip(t)}),Rd(),YB(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Gp(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(YB(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(t){const e=function(t){return t.NGXS_SELECTOR_META}(t)||GB(t);return e&&e.makeRootSelector||(()=>t)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const e=this._stateStream.value;if(!e||0===Object.keys(e).length){const e=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(e)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(eV),Ci(lV),Ci(jB),Ci(KB),Ci(hV),Ci(yB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),fV=(()=>{class t{constructor(e,n){t.store=e,t.config=n}ngOnDestroy(){t.store=null,t.config=null}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV),Ci(jB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t.store=null,t.config=null,t})();class gV{static get type(){return"@@INIT"}}class mV{constructor(t){this.addedStates=t}static get type(){return"@@UPDATE_STATE"}}const bV=new lp(1);let yV=(()=>{class t{constructor(e,n,i,r,s=[],o){!function(){try{const t=window.ng,e=!(t.probe&&t.coreTokens)&&Nu();bV.next(e)}catch(t){bV.next(!1)}finally{bV.complete()}}();const a=e.addAndReturnDefaults(s);n.setStateToTheCurrentWithNew(a),e.connectActionHandlers(),o.ngxsBootstrap(new gV,a)}}return t.\u0275fac=function(e){return new(e||t)(Ci(hV),Ci(lV),Ci(pV),Ci(fV),Ci(PB,8),Ci(dV))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),vV=(()=>{class t{constructor(e,n,i,r=[],s){const o=t.flattenStates(r),a=i.addAndReturnDefaults(o);a.states.length&&(n.setStateToTheCurrentWithNew(a),s.ngxsBootstrap(new mV(a.defaults),a))}static flattenStates(t=[]){return t.reduce((t,e)=>t.concat(e),[])}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV),Ci(lV),Ci(hV),Ci(IB,8),Ci(dV))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class _V{static forRoot(t=[],e={}){return{ngModule:yV,providers:[hV,cV,JB,ZB,bB,aV,oV,dV,rV,iV,lV,KB,pV,eV,fV,nV,...t,..._V.ngxsTokenProviders(t,e)]}}static forFeature(t=[]){return{ngModule:vV,providers:[hV,nV,...t,{provide:IB,multi:!0,useValue:t}]}}static ngxsTokenProviders(t,e){return[{provide:DB,useValue:mB},{provide:RB,useValue:Nu},{provide:BB,useClass:e.executionStrategy||AB},{provide:PB,useValue:t},{provide:_V.ROOT_OPTIONS,useValue:e},{provide:jB,useFactory:_V.ngxsConfigFactory,deps:[_V.ROOT_OPTIONS]},{provide:au,useFactory:_V.appBootstrapListenerFactory,multi:!0,deps:[bB]},{provide:yB,useFactory:_V.getInitialState},{provide:_B,useExisting:cV},{provide:wB,useExisting:hV}]}static ngxsConfigFactory(t){return $B(new jB,t)}static appBootstrapListenerFactory(t){return()=>t.bootstrap()}static getInitialState(){return vB.pop()}}function wV(t){return e=>{!function(t){bV.subscribe(e=>{e&&(t.\u0275prov||console.warn(kB.UNDECORATED_STATE_IN_IVY(t.name)))})}(e);const n=e,i=function(t){if(!t.hasOwnProperty(NB)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,NB,{value:e})}return GB(t)}(n),r=Object.getPrototypeOf(n),s=function(e){return Object.assign({},e[LB]||{},t)}(r);(function(t){const{meta:e,inheritedStateClass:n,optionsWithInheritance:i}=t,{children:r,defaults:s,name:o}=i,a="string"==typeof o?o:o&&o.getName()||null;uV.checkCorrectStateName(a),n.hasOwnProperty(NB)&&(e.actions=Object.assign({},e.actions,(n[NB]||{}).actions)),e.children=r,e.defaults=s,e.name=a})({meta:i,inheritedStateClass:r,optionsWithInheritance:s}),n[LB]=s}}_V.\u0275fac=function(t){return new(t||_V)},_V.\u0275mod=ie({type:_V}),_V.\u0275inj=St({}),_V.ROOT_OPTIONS=new oi("ROOT_OPTIONS");let xV=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}setProperty(t,e){this._renderer.setProperty(this._elementRef.nativeElement,t,e)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl))},t.\u0275dir=se({type:t}),t})(),SV=(()=>{class t extends xV{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,features:[jo]}),t})();const EV=new oi("NgValueAccessor"),CV={provide:EV,useExisting:pt(()=>TV),multi:!0},OV=new oi("CompositionEventMode");let TV=(()=>{class t extends xV{constructor(t,e,n){super(t,e),this._compositionMode=n,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=Xu()?Xu().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl),ea(OV,8))},t.\u0275dir=se({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,e){1&t&&fa("input",function(t){return e._handleInput(t.target.value)})("blur",function(){return e.onTouched()})("compositionstart",function(){return e._compositionStart()})("compositionend",function(t){return e._compositionEnd(t.target.value)})},features:[_l([CV]),jo]}),t})();const kV=new oi("NgValidators"),AV=new oi("NgAsyncValidators");function PV(t){return null!=t}function IV(t){const e=ha(t)?U(t):t;return pa(e),e}function MV(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function DV(t,e){return e.map(e=>e(t))}function RV(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function NV(t){return null!=t?function(t){if(!t)return null;const e=t.filter(PV);return 0==e.length?null:function(t){return MV(DV(t,e))}}(RV(t)):null}function LV(t){return null!=t?function(t){if(!t)return null;const e=t.filter(PV);return 0==e.length?null:function(t){return hv(DV(t,e).map(IV)).pipe(D(MV))}}(RV(t)):null}function jV(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function FV(t){return t._rawValidators}function BV(t){return t._rawAsyncValidators}function VV(t){return t?Array.isArray(t)?t:[t]:[]}function zV(t,e){return Array.isArray(t)?t.includes(e):t===e}function UV(t,e){const n=VV(e);return VV(t).forEach(t=>{zV(n,t)||n.push(t)}),n}function HV(t,e){return VV(e).filter(e=>!zV(t,e))}let $V=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=NV(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=LV(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})(),GV=(()=>{class t extends $V{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,features:[jo]}),t})();class WV extends $V{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class qV{constructor(t){this._cd=t}is(t){var e,n,i;return"submitted"===t?!!(null===(e=this._cd)||void 0===e?void 0:e.submitted):!!(null===(i=null===(n=this._cd)||void 0===n?void 0:n.control)||void 0===i?void 0:i[t])}}let XV=(()=>{class t extends qV{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(WV,2))},t.\u0275dir=se({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,e){2&t&&ja("ng-untouched",e.is("untouched"))("ng-touched",e.is("touched"))("ng-pristine",e.is("pristine"))("ng-dirty",e.is("dirty"))("ng-valid",e.is("valid"))("ng-invalid",e.is("invalid"))("ng-pending",e.is("pending"))},features:[jo]}),t})(),YV=(()=>{class t extends qV{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(GV,10))},t.\u0275dir=se({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(t,e){2&t&&ja("ng-untouched",e.is("untouched"))("ng-touched",e.is("touched"))("ng-pristine",e.is("pristine"))("ng-dirty",e.is("dirty"))("ng-valid",e.is("valid"))("ng-invalid",e.is("invalid"))("ng-pending",e.is("pending"))("ng-submitted",e.is("submitted"))},features:[jo]}),t})();function KV(t,e){JV(t,e),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&ez(t,e)})}(t,e),function(t,e){const n=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&ez(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),function(t,e){if(e.valueAccessor.setDisabledState){const n=t=>{e.valueAccessor.setDisabledState(t)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}(t,e)}function QV(t,e,n=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),tz(t,e),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function ZV(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function JV(t,e){const n=FV(t);null!==e.validator?t.setValidators(jV(n,e.validator)):"function"==typeof n&&t.setValidators([n]);const i=BV(t);null!==e.asyncValidator?t.setAsyncValidators(jV(i,e.asyncValidator)):"function"==typeof i&&t.setAsyncValidators([i]);const r=()=>t.updateValueAndValidity();ZV(e._rawValidators,r),ZV(e._rawAsyncValidators,r)}function tz(t,e){let n=!1;if(null!==t){if(null!==e.validator){const i=FV(t);if(Array.isArray(i)&&i.length>0){const r=i.filter(t=>t!==e.validator);r.length!==i.length&&(n=!0,t.setValidators(r))}}if(null!==e.asyncValidator){const i=BV(t);if(Array.isArray(i)&&i.length>0){const r=i.filter(t=>t!==e.asyncValidator);r.length!==i.length&&(n=!0,t.setAsyncValidators(r))}}}const i=()=>{};return ZV(e._rawValidators,i),ZV(e._rawAsyncValidators,i),n}function ez(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function nz(t,e){JV(t,e)}function iz(t,e){t._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)})}function rz(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const sz="VALID",oz="INVALID",az="PENDING",lz="DISABLED";function cz(t){return(pz(t)?t.validators:t)||null}function uz(t){return Array.isArray(t)?NV(t):t||null}function hz(t,e){return(pz(e)?e.asyncValidators:t)||null}function dz(t){return Array.isArray(t)?LV(t):t||null}function pz(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class fz{constructor(t,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=uz(this._rawValidators),this._composedAsyncValidatorFn=dz(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===sz}get invalid(){return this.status===oz}get pending(){return this.status==az}get disabled(){return this.status===lz}get enabled(){return this.status!==lz}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=uz(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=dz(t)}addValidators(t){this.setValidators(UV(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(UV(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(HV(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(HV(t,this._rawAsyncValidators))}hasValidator(t){return zV(this._rawValidators,t)}hasAsyncValidator(t){return zV(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=az,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=lz,this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=sz,this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===sz||this.status===az)&&this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?lz:sz}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=az,this._hasOwnPendingAsyncValidator=!0;const e=IV(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(e,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=t;return e.forEach(t=>{i=i instanceof mz?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof bz&&i.at(t)||null}),i}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new Rc,this.statusChanges=new Rc}_calculateStatus(){return this._allControlsDisabled()?lz:this.errors?oz:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(az)?az:this._anyControlsHaveStatus(oz)?oz:sz}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){pz(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class gz extends fz{constructor(t=null,e,n){super(cz(e),hz(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){rz(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){rz(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class mz extends fz{constructor(t,e,n){super(cz(e),hz(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,n={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof gz?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>{const n=this.controls[e];n&&t(n,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,i)=>{n=e(n,t,i)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class bz extends fz{constructor(t,e,n){super(cz(e),hz(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(t){return this.controls[t]}push(t,e={}){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(t,e,n={}){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:n.emitEvent})}removeAt(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t=[],e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof gz?t.value:t.getRawValue())}clear(t={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:t.emitEvent}))}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error(`Cannot find form control at index ${t}`)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}const yz={provide:GV,useExisting:pt(()=>_z)},vz=(()=>Promise.resolve(null))();let _z=(()=>{class t extends GV{constructor(t,e){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Rc,this.form=new mz({},NV(t),LV(e))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){vz.then(()=>{const e=this._findContainer(t.path);t.control=e.registerControl(t.name,t.control),KV(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){vz.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name),rz(this._directives,t)})}addFormGroup(t){vz.then(()=>{const e=this._findContainer(t.path),n=new mz({});nz(n,t),e.registerControl(t.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){vz.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,e){vz.then(()=>{this.form.get(t.path).setValue(e)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,iz(this.form,this._directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10))},t.\u0275dir=se({type:t,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,e){1&t&&fa("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_l([yz]),jo]}),t})(),wz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),t})(),xz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Sz=new oi("NgModelWithFormControlWarning"),Ez={provide:WV,useExisting:pt(()=>Cz)};let Cz=(()=>{class t extends WV{constructor(t,e,n,i){super(),this._ngModelWarningConfig=i,this.update=new Rc,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(e),this.valueAccessor=function(t,e){if(!e)return null;let n,i,r;return Array.isArray(e),e.forEach(t=>{t.constructor===TV?n=t:function(t){return Object.getPrototypeOf(t.constructor)===SV}(t)?i=t:r=t}),r||i||n||null}(0,n)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const e=t.form.previousValue;e&&QV(e,this,!1),KV(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}(function(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)})(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&QV(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10),ea(EV,10),ea(Sz,8))},t.\u0275dir=se({type:t,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[_l([Ez]),jo,ye]}),t._ngModelWarningSentOnce=!1,t})();const Oz={provide:GV,useExisting:pt(()=>Tz)};let Tz=(()=>{class t extends GV{constructor(t,e){super(),this.validators=t,this.asyncValidators=e,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Rc,this._setValidators(t),this._setAsyncValidators(e)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(tz(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const e=this.form.get(t.path);return KV(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){QV(t.control||null,t,!1),rz(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,e){this.form.get(t.path).setValue(e)}onSubmit(t){return this.submitted=!0,iz(this.form,this.directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const e=t.control,n=this.form.get(t.path);e!==n&&(QV(e||null,t),n instanceof gz&&(KV(n,t),t.control=n))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const e=this.form.get(t.path);nz(e,t),e.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const e=this.form.get(t.path);e&&function(t,e){return tz(t,e)}(e,t)&&e.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){JV(this.form,this),this._oldForm&&tz(this._oldForm,this)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10))},t.\u0275dir=se({type:t,selectors:[["","formGroup",""]],hostBindings:function(t,e){1&t&&fa("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_l([Oz]),jo,ye]}),t})(),kz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[xz]]}),t})(),Az=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[kz]}),t})(),Pz=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:Sz,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[kz]}),t})();function Iz(t){return new C(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?U(n):np()).subscribe(e)})}const Mz=["underline"],Dz=["connectionContainer"],Rz=["inputContainer"],Nz=["label"];function Lz(t,e){1&t&&(aa(0),ra(1,"div",14),oa(2,"div",15),oa(3,"div",16),oa(4,"div",17),sa(),ra(5,"div",18),oa(6,"div",15),oa(7,"div",16),oa(8,"div",17),sa(),la())}function jz(t,e){1&t&&(ra(0,"div",19),xa(1,1),sa())}function Fz(t,e){if(1&t&&(aa(0),xa(1,2),ra(2,"span"),Za(3),sa(),la()),2&t){const t=va(2);ws(3),Ja(t._control.placeholder)}}function Bz(t,e){1&t&&xa(0,3,["*ngSwitchCase","true"])}function Vz(t,e){1&t&&(ra(0,"span",23),Za(1," *"),sa())}function zz(t,e){if(1&t){const t=ua();ra(0,"label",20,21),fa("cdkObserveContent",function(){return $e(t),va().updateOutlineGap()}),Jo(2,Fz,4,1,"ng-container",12),Jo(3,Bz,1,0,"ng-content",12),Jo(4,Vz,2,0,"span",22),sa()}if(2&t){const t=va();ja("mat-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-form-field-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-accent","accent"==t.color)("mat-warn","warn"==t.color),na("cdkObserveContentDisabled","outline"!=t.appearance)("id",t._labelId)("ngSwitch",t._hasLabel()),Ko("for",t._control.id)("aria-owns",t._control.id),ws(2),na("ngSwitchCase",!1),ws(1),na("ngSwitchCase",!0),ws(1),na("ngIf",!t.hideRequiredMarker&&t._control.required&&!t._control.disabled)}}function Uz(t,e){1&t&&(ra(0,"div",24),xa(1,4),sa())}function Hz(t,e){if(1&t&&(ra(0,"div",25,26),oa(2,"span",27),sa()),2&t){const t=va();ws(2),ja("mat-accent","accent"==t.color)("mat-warn","warn"==t.color)}}function $z(t,e){1&t&&(ra(0,"div"),xa(1,5),sa()),2&t&&na("@transitionMessages",va()._subscriptAnimationState)}function Gz(t,e){if(1&t&&(ra(0,"div",31),Za(1),sa()),2&t){const t=va(2);na("id",t._hintLabelId),ws(1),Ja(t.hintLabel)}}function Wz(t,e){if(1&t&&(ra(0,"div",28),Jo(1,Gz,2,2,"div",29),xa(2,6),oa(3,"div",30),xa(4,7),sa()),2&t){const t=va();na("@transitionMessages",t._subscriptAnimationState),ws(1),na("ngIf",t.hintLabel)}}const qz=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Xz=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Yz=new oi("MatError"),Kz={transitionMessages:Vg("transitionMessages",[$g("enter",Hg({opacity:1,transform:"translateY(0%)"})),Wg("void => enter",[Hg({opacity:0,transform:"translateY(-5px)"}),zg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let Qz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})();const Zz=new oi("MatHint");let Jz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-label"]]}),t})(),tU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-placeholder"]]}),t})();const eU=new oi("MatPrefix");let nU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","matPrefix",""]],features:[_l([{provide:eU,useExisting:t}])]}),t})();const iU=new oi("MatSuffix");let rU=0;const sU=jy(class{constructor(t){this._elementRef=t}},"primary"),oU=new oi("MAT_FORM_FIELD_DEFAULT_OPTIONS"),aU=new oi("MatFormField");let lU=(()=>{class t extends sU{constructor(t,e,n,i,r,s,o,a){super(t),this._changeDetectorRef=e,this._dir=i,this._defaults=r,this._platform=s,this._ngZone=o,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new P,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+rU++,this._labelId="mat-form-field-label-"+rU++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==a,this.appearance=r&&r.appearance?r.appearance:"legacy",this._hideRequiredMarker=!(!r||null==r.hideRequiredMarker)&&r.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const e=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&e!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=md(t)}_shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}_canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(t){this._explicitFormFieldControl=t}getLabelId(){return this._hasFloatingLabel()?this._labelId:null}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add(`mat-form-field-type-${t.controlType}`),t.stateChanges.pipe(Kd(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(Wd(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Wd(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),Q(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Kd(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Kd(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(Wd(this._destroyed)).subscribe(()=>{"function"==typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this.updateOutlineGap())}):this.updateOutlineGap()})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(t){const e=this._control?this._control.ngControl:null;return e&&e[t]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}_shouldLabelFloat(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,xd(this._label.nativeElement,"transitionend").pipe(Gp(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_getDefaultFloatLabelState(){return this._defaults&&this._defaults.floatLabel||"auto"}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const e=this._hintChildren?this._hintChildren.find(t=>"start"===t.align):null,n=this._hintChildren?this._hintChildren.find(t=>"end"===t.align):null;e?t.push(e.id):this._hintLabel&&t.push(this._hintLabelId),n&&t.push(n.id)}else this._errorChildren&&t.push(...this._errorChildren.map(t=>t.id));this._control.setDescribedByIds(t)}}_validateControlChild(){}updateOutlineGap(){const t=this._label?this._label.nativeElement:null;if(!("outline"===this.appearance&&t&&t.children.length&&t.textContent.trim()&&this._platform.isBrowser))return;if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);let e=0,n=0;const i=this._connectionContainerRef.nativeElement,r=i.querySelectorAll(".mat-form-field-outline-start"),s=i.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const r=i.getBoundingClientRect();if(0===r.width&&0===r.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const s=this._getStartEnd(r),o=t.children,a=this._getStartEnd(o[0].getBoundingClientRect());let l=0;for(let t=0;t0?.75*l+10:0}for(let o=0;o{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny,ig],Ny]}),t})();function uU(t,e=jd){const n=function(t){return t instanceof Date&&!isNaN(+t)}(t)?+t-e.now():Math.abs(t);return t=>t.lift(new hU(n,e))}class hU{constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new dU(t,this.delay,this.scheduler))}}class dU extends v{constructor(t,e,n){super(t),this.delay=e,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(t){const e=t.source,n=e.queue,i=t.scheduler,r=t.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const e=Math.max(0,n[0].time-i.now());this.schedule(t,e)}else this.unsubscribe(),e.active=!1}_schedule(t){this.active=!0,this.destination.add(t.schedule(dU.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new pU(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(sp.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(sp.createComplete()),this.unsubscribe()}}class pU{constructor(t,e){this.time=t,this.notification=e}}const fU=["panel"];function gU(t,e){if(1&t&&(ra(0,"div",0,1),xa(2),sa()),2&t){const t=e.id,n=va();na("id",n.id)("ngClass",n._classList),Ko("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}const mU=["*"];let bU=0;class yU{constructor(t,e){this.source=t,this.option=e}}const vU=Fy(class{}),_U=new oi("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}});let wU=(()=>{class t extends vU{constructor(t,e,n,i){super(),this._changeDetectorRef=t,this._elementRef=e,this._activeOptionChanges=g.EMPTY,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new Rc,this.opened=new Rc,this.closed=new Rc,this.optionActivated=new Rc,this._classList={},this.id="mat-autocomplete-"+bU++,this.inertGroups=(null==i?void 0:i.SAFARI)||!1,this._autoActiveFirstOption=!!n.autoActiveFirstOption}get isOpen(){return this._isOpen&&this.showPanel}get autoActiveFirstOption(){return this._autoActiveFirstOption}set autoActiveFirstOption(t){this._autoActiveFirstOption=md(t)}set classList(t){this._classList=t&&t.length?function(t,e=/\s+/){const n=[];if(null!=t){const i=Array.isArray(t)?t:`${t}`.split(e);for(const t of i){const e=`${t}`.trim();e&&n.push(e)}}return n}(t).reduce((t,e)=>(t[e]=!0,t),{}):{},this._setVisibilityClasses(this._classList),this._elementRef.nativeElement.className=""}ngAfterContentInit(){this._keyManager=new fg(this.options).withWrap(),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._activeOptionChanges.unsubscribe()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._setVisibilityClasses(this._classList),this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){const e=new yU(this,t);this.optionSelected.emit(e)}_getPanelAriaLabelledby(t){return this.ariaLabel?null:this.ariaLabelledby?(t?t+" ":"")+this.ariaLabelledby:t}_setVisibilityClasses(t){t[this._visibleClass]=this.showPanel,t[this._hiddenClass]=!this.showPanel}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(kl),ea(_U),ea(pp))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(qc(sc,7),qc(fU,5)),2&t){let t;Wc(t=Yc())&&(e.template=t.first),Wc(t=Yc())&&(e.panel=t.first)}},inputs:{displayWith:"displayWith",autoActiveFirstOption:"autoActiveFirstOption",classList:["class","classList"],ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],panelWidth:"panelWidth"},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},features:[jo]}),t})(),xU=(()=>{class t extends wU{constructor(){super(...arguments),this._visibleClass="mat-autocomplete-visible",this._hiddenClass="mat-autocomplete-hidden"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,iv,5),Xc(n,av,5)),2&t){let t;Wc(t=Yc())&&(e.optionGroups=t),Wc(t=Yc())&&(e.options=t)}},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[_l([{provide:Jy,useExisting:t}]),jo],ngContentSelectors:mU,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(t,e){1&t&&(wa(),Jo(0,gU,3,4,"ng-template"))},directives:[mh],styles:[".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}\n"],encapsulation:2,changeDetection:0}),t})();const SU=new oi("mat-autocomplete-scroll-strategy"),EU={provide:SU,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}},CU={provide:EV,useExisting:pt(()=>TU),multi:!0};let OU=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u){this._element=t,this._overlay=e,this._viewContainerRef=n,this._zone=i,this._changeDetectorRef=r,this._dir=o,this._formField=a,this._document=l,this._viewportRuler=c,this._defaults=u,this._componentDestroyed=!1,this._autocompleteDisabled=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=g.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new P,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=Iz(()=>this.autocomplete&&this.autocomplete.options?Q(...this.autocomplete.options.map(t=>t.onSelectionChange)):this._zone.onStable.pipe(Gp(1),Qd(()=>this.optionSelections))),this._scrollStrategy=s}get autocompleteDisabled(){return this._autocompleteDisabled}set autocompleteDisabled(t){this._autocompleteDisabled=md(t)}ngAfterViewInit(){const t=this._getWindow();void 0!==t&&this._zone.runOutsideAngular(()=>t.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){const t=this._getWindow();void 0!==t&&t.removeEventListener("blur",this._windowBlurHandler),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._attachOverlay(),this._floatLabel()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this.autocomplete.closed.emit(),this.autocomplete._isOpen=this._overlayAttached=!1,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._componentDestroyed||this._changeDetectorRef.detectChanges())}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Q(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Hd(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Hd(()=>this._overlayAttached)):wd()).pipe(D(t=>t instanceof sv?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Q(xd(this._document,"click"),xd(this._document,"auxclick"),xd(this._document,"touchend")).pipe(Hd(t=>{const e=Ep(t),n=this._formField?this._formField._elementRef.nativeElement:null,i=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&e!==this._element.nativeElement&&(!n||!n.contains(e))&&(!i||!i.contains(e))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(e)}))}writeValue(t){Promise.resolve(null).then(()=>this._setTriggerValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){const e=t.keyCode;if(27===e&&!Qp(t)&&t.preventDefault(),this.activeOption&&13===e&&this.panelOpen)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){const n=this.autocomplete._keyManager.activeItem,i=38===e||40===e;this.panelOpen||9===e?this.autocomplete._keyManager.onKeydown(t):i&&this._canOpen()&&this.openPanel(),(i||this.autocomplete._keyManager.activeItem!==n)&&this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0)}}_handleInput(t){let e=t.target,n=e.value;"number"===e.type&&(n=""==n?null:parseFloat(n)),this._previousValue!==n&&(this._previousValue=n,this._onChange(n),this._canOpen()&&this._document.activeElement===t.target&&this.openPanel())}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_floatLabel(t=!1){this._formField&&"auto"===this._formField.floatLabel&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField.floatLabel="auto",this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){return Q(this._zone.onStable.pipe(Gp(1)),this.autocomplete.options.changes.pipe($f(()=>this._positionStrategy.reapplyLastPosition()),uU(0))).pipe(Qd(()=>{const t=this.panelOpen;return this._resetActiveItem(),this.autocomplete._setVisibility(),this.panelOpen&&(this._overlayRef.updatePosition(),t!==this.panelOpen&&this.autocomplete.opened.emit()),this.panelClosingActions}),Gp(1)).subscribe(t=>this._setValueAndClose(t))}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_setTriggerValue(t){const e=this.autocomplete&&this.autocomplete.displayWith?this.autocomplete.displayWith(t):t,n=null!=e?e:"";this._formField?this._formField._control.value=n:this._element.nativeElement.value=n,this._previousValue=n}_setValueAndClose(t){t&&t.source&&(this._clearPreviousSelectedOption(t.source),this._setTriggerValue(t.source.value),this._onChange(t.source.value),this._element.nativeElement.focus(),this.autocomplete._emitSelectEvent(t.source)),this.closePanel()}_clearPreviousSelectedOption(t){this.autocomplete.options.forEach(e=>{e!==t&&e.selected&&e.deselect()})}_attachOverlay(){var t;let e=this._overlayRef;e?(this._positionStrategy.setOrigin(this._getConnectedElement()),e.updateSize({width:this._getPanelWidth()})):(this._portal=new Lp(this.autocomplete.template,this._viewContainerRef,{id:null===(t=this._formField)||void 0===t?void 0:t.getLabelId()}),e=this._overlay.create(this._getOverlayConfig()),this._overlayRef=e,e.keydownEvents().subscribe(t=>{(27===t.keyCode&&!Qp(t)||38===t.keyCode&&Qp(t,"altKey"))&&(this._closeKeyEventStream.next(),this._resetActiveItem(),t.stopPropagation(),t.preventDefault())}),this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&e&&e.updateSize({width:this._getPanelWidth()})})),e&&!e.hasAttached()&&(e.attach(this._portal),this._closingActionsSubscription=this._subscribeToClosingActions());const n=this.panelOpen;this.autocomplete._setVisibility(),this.autocomplete._isOpen=this._overlayAttached=!0,this.panelOpen&&n!==this.panelOpen&&this.autocomplete.opened.emit()}_getOverlayConfig(){var t;return new af({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir,panelClass:null===(t=this._defaults)||void 0===t?void 0:t.overlayPanelClass})}_getOverlayPosition(){const t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){const e=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],n=this._aboveClass,i=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:n},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:n}];let r;r="above"===this.position?i:"below"===this.position?e:[...e,...i],t.withPositions(r)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){const t=this.autocomplete;t.autoActiveFirstOption?t._keyManager.setFirstItemActive():t._keyManager.setActiveItem(-1)}_canOpen(){const t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this._autocompleteDisabled}_getWindow(){var t;return(null===(t=this._document)||void 0===t?void 0:t.defaultView)||window}_scrollToOption(t){const e=this.autocomplete,n=lv(t,e.options,e.optionGroups);if(0===t&&1===n)e._setScrollTop(0);else if(e.panel){const n=e.options.toArray()[t];if(n){const t=n._getHostElement(),i=cv(t.offsetTop,t.offsetHeight,e._getScrollTop(),e.panel.nativeElement.offsetHeight);e._setScrollTop(i)}}}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(kf),ea(hc),ea(xu),ea(tc),ea(SU),ea(Op,8),ea(aU,9),ea(Yu,8),ea(Ip),ea(_U,8))},t.\u0275dir=se({type:t,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[ye]}),t})(),TU=(()=>{class t extends OU{constructor(){super(...arguments),this._aboveClass="mat-autocomplete-panel-above"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(t,e){1&t&&fa("focusin",function(){return e._handleFocus()})("blur",function(){return e._onTouched()})("input",function(t){return e._handleInput(t)})("keydown",function(t){return e._handleKeydown(t)}),2&t&&Ko("autocomplete",e.autocompleteAttribute)("role",e.autocompleteDisabled?null:"combobox")("aria-autocomplete",e.autocompleteDisabled?null:"list")("aria-activedescendant",e.panelOpen&&e.activeOption?e.activeOption.id:null)("aria-expanded",e.autocompleteDisabled?null:e.panelOpen.toString())("aria-owns",e.autocompleteDisabled||!e.panelOpen||null==e.autocomplete?null:e.autocomplete.id)("aria-haspopup",!e.autocompleteDisabled)},exportAs:["matAutocompleteTrigger"],features:[_l([CU]),jo]}),t})(),kU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[EU],imports:[[Rf,uv,Ny,Rh],Mp,uv,Ny]}),t})();const AU=_p({passive:!0});let PU=(()=>{class t{constructor(t,e){this._platform=t,this._ngZone=e,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return ep;const e=_d(t),n=this._monitoredElements.get(e);if(n)return n.subject;const i=new P,r="cdk-text-field-autofilled",s=t=>{"cdk-text-field-autofill-start"!==t.animationName||e.classList.contains(r)?"cdk-text-field-autofill-end"===t.animationName&&e.classList.contains(r)&&(e.classList.remove(r),this._ngZone.run(()=>i.next({target:t.target,isAutofilled:!1}))):(e.classList.add(r),this._ngZone.run(()=>i.next({target:t.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{e.addEventListener("animationstart",s,AU),e.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(e,{subject:i,unlisten:()=>{e.removeEventListener("animationstart",s,AU)}}),i}stopMonitoring(t){const e=_d(t),n=this._monitoredElements.get(e);n&&(n.unlisten(),n.subject.complete(),e.classList.remove("cdk-text-field-autofill-monitored"),e.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(e))}ngOnDestroy(){this._monitoredElements.forEach((t,e)=>this.stopMonitoring(e))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu))},token:t,providedIn:"root"}),t})(),IU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[fp]]}),t})();const MU=new oi("MAT_INPUT_VALUE_ACCESSOR"),DU=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let RU=0;const NU=Vy(class{constructor(t,e,n,i){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=n,this.ngControl=i}});let LU=(()=>{class t extends NU{constructor(t,e,n,i,r,s,o,a,l,c){super(s,i,r,n),this._elementRef=t,this._platform=e,this._autofillMonitor=a,this._formField=c,this._uid="mat-input-"+RU++,this.focused=!1,this.stateChanges=new P,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._required=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(t=>mp().has(t));const u=this._elementRef.nativeElement,h=u.nodeName.toLowerCase();this._inputValueAccessor=o||u,this._previousNativeValue=this.value,this.id=this.id,e.IOS&&l.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",t=>{const e=t.target;!e.value&&0===e.selectionStart&&0===e.selectionEnd&&(e.setSelectionRange(1,1),e.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===h,this._isTextarea="textarea"===h,this._isInFormField=!!c,this._isNativeSelect&&(this.controlType=u.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=md(t),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(t){this._id=t||this._uid}get required(){return this._required}set required(t){this._required=md(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&mp().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(t){t!==this.value&&(this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=md(t)}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}_focusChanged(t){t!==this.focused&&(this.focused=t,this.stateChanges.next())}_onInput(){}_dirtyCheckPlaceholder(){var t,e;const n=(null===(e=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===e?void 0:e.call(t))?null:this.placeholder;if(n!==this._previousPlaceholder){const t=this._elementRef.nativeElement;this._previousPlaceholder=n,n?t.setAttribute("placeholder",n):t.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){DU.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,e=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&e&&e.label)}return this.focused||!this.empty}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(WV,10),ea(_z,8),ea(Tz,8),ea(zy),ea(MU,10),ea(PU),ea(xu),ea(aU,8))},t.\u0275dir=se({type:t,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._focusChanged(!0)})("blur",function(){return e._focusChanged(!1)})("input",function(){return e._onInput()}),2&t&&(il("disabled",e.disabled)("required",e.required),Ko("id",e.id)("data-placeholder",e.placeholder)("readonly",e.readonly&&!e._isNativeSelect||null)("aria-invalid",e.empty&&e.required?null:e.errorState)("aria-required",e.required),ja("mat-input-server",e._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[_l([{provide:Qz,useExisting:t}]),jo,ye]}),t})(),jU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[zy],imports:[[IU,cU,Ny],IU,cU]}),t})();function FU(...t){const e=t.length;if(0===e)throw new Error("list of properties cannot be empty.");return n=>D(function(t,e){return n=>{let i=n;for(let r=0;rYU),multi:!0};class qU{}const XU=By(jy(Ly(class{constructor(t){this._elementRef=t}}),"accent"));let YU=(()=>{class t extends XU{constructor(t,e,n,i,r,s,o,a){super(t),this._focusMonitor=e,this._changeDetectorRef=n,this._dir=i,this._ngZone=s,this._animationMode=a,this._invert=!1,this._max=100,this._min=0,this._step=1,this._thumbLabel=!1,this._tickInterval=0,this._value=null,this._vertical=!1,this.change=new Rc,this.input=new Rc,this.valueChange=new Rc,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=g.EMPTY,this._pointerDown=t=>{this.disabled||this._isSliding||!KU(t)&&0!==t.button||this._ngZone.run(()=>{this._touchId=KU(t)?function(t,e){for(let n=0;n{if("pointer"===this._isSliding){const e=QU(t,this._touchId);if(e){t.preventDefault();const n=this.value;this._lastPointerEvent=t,this._updateValueFromPosition(e),n!=this.value&&this._emitInputEvent()}}},this._pointerUp=t=>{"pointer"===this._isSliding&&(!KU(t)||"number"!=typeof this._touchId||ZU(t.changedTouches,this._touchId))&&(t.preventDefault(),this._removeGlobalEvents(),this._isSliding=null,this._touchId=void 0,this._valueOnSlideStart!=this.value&&!this.disabled&&this._emitChangeEvent(),this._valueOnSlideStart=this._lastPointerEvent=null)},this._windowBlur=()=>{this._lastPointerEvent&&this._pointerUp(this._lastPointerEvent)},this._document=o,this.tabIndex=parseInt(r)||0,s.runOutsideAngular(()=>{const e=t.nativeElement;e.addEventListener("mousedown",this._pointerDown,GU),e.addEventListener("touchstart",this._pointerDown,GU)})}get invert(){return this._invert}set invert(t){this._invert=md(t)}get max(){return this._max}set max(t){this._max=bd(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=bd(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=bd(t,this._step),this._step%1!=0&&(this._roundToDecimal=this._step.toString().split(".").pop().length),this._changeDetectorRef.markForCheck()}get thumbLabel(){return this._thumbLabel}set thumbLabel(t){this._thumbLabel=md(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?bd(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let e=bd(t,0);this._roundToDecimal&&e!==this.min&&e!==this.max&&(e=parseFloat(e.toFixed(this._roundToDecimal))),this._value=e,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=md(t)}get displayValue(){return this.displayWith?this.displayWith(this.value):this._roundToDecimal&&this.value&&this.value%1!=0?this.value.toFixed(this._roundToDecimal):this.value||0}focus(t){this._focusHostElement(t)}blur(){this._blurHostElement()}get percent(){return this._clamp(this._percent)}_shouldInvertAxis(){return this.vertical?!this.invert:this.invert}_isMinValue(){return 0===this.percent}_getThumbGap(){return this.disabled?7:this._isMinValue()&&!this.thumbLabel?this._isActive?10:7:0}_getTrackBackgroundStyles(){const t=this.vertical?`1, ${1-this.percent}, 1`:1-this.percent+", 1, 1";return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"-":""}${this._getThumbGap()}px) scale3d(${t})`}}_getTrackFillStyles(){const t=this.percent,e=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${e})`,display:0===t?"none":""}}_getTicksContainerStyles(){return{transform:`translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"-":""}${this._tickIntervalPercent/2*100}%)`}}_getTicksStyles(){let t=100*this._tickIntervalPercent,e={backgroundSize:this.vertical?`2px ${t}%`:`${t}% 2px`,transform:`translateZ(0) translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"":"-"}${t/2}%)${this.vertical||"rtl"!=this._getDirection()?"":" rotate(180deg)"}`};if(this._isMinValue()&&this._getThumbGap()){const t=this._shouldInvertAxis();let n;n=this.vertical?t?"Bottom":"Top":t?"Right":"Left",e[`padding${n}`]=`${this._getThumbGap()}px`}return e}_getThumbContainerStyles(){const t=this._shouldInvertAxis();return{transform:`translate${this.vertical?"Y":"X"}(-${100*(("rtl"!=this._getDirection()||this.vertical?t:!t)?this.percent:1-this.percent)}%)`}}_shouldInvertMouseCoords(){const t=this._shouldInvertAxis();return"rtl"!=this._getDirection()||this.vertical?t:!t}_getDirection(){return this._dir&&"rtl"==this._dir.value?"rtl":"ltr"}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{this._isActive=!!t&&"keyboard"!==t,this._changeDetectorRef.detectChanges()}),this._dir&&(this._dirChangeSubscription=this._dir.change.subscribe(()=>{this._changeDetectorRef.markForCheck()}))}ngOnDestroy(){const t=this._elementRef.nativeElement;t.removeEventListener("mousedown",this._pointerDown,GU),t.removeEventListener("touchstart",this._pointerDown,GU),this._lastPointerEvent=null,this._removeGlobalEvents(),this._focusMonitor.stopMonitoring(this._elementRef),this._dirChangeSubscription.unsubscribe()}_onMouseenter(){this.disabled||(this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent())}_onFocus(){this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent()}_onBlur(){this.onTouched()}_onKeydown(t){if(this.disabled||Qp(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const e=this.value;switch(t.keyCode){case 33:this._increment(10);break;case 34:this._increment(-10);break;case 35:this.value=this.max;break;case 36:this.value=this.min;break;case 37:this._increment("rtl"==this._getDirection()?1:-1);break;case 38:this._increment(1);break;case 39:this._increment("rtl"==this._getDirection()?-1:1);break;case 40:this._increment(-1);break;default:return}e!=this.value&&(this._emitInputEvent(),this._emitChangeEvent()),this._isSliding="keyboard",t.preventDefault()}_onKeyup(){"keyboard"===this._isSliding&&(this._isSliding=null)}_getWindow(){return this._document.defaultView||window}_bindGlobalEvents(t){const e=this._document,n=KU(t),i=n?"touchend":"mouseup";e.addEventListener(n?"touchmove":"mousemove",this._pointerMove,GU),e.addEventListener(i,this._pointerUp,GU),n&&e.addEventListener("touchcancel",this._pointerUp,GU);const r=this._getWindow();void 0!==r&&r&&r.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,GU),t.removeEventListener("mouseup",this._pointerUp,GU),t.removeEventListener("touchmove",this._pointerMove,GU),t.removeEventListener("touchend",this._pointerUp,GU),t.removeEventListener("touchcancel",this._pointerUp,GU);const e=this._getWindow();void 0!==e&&e&&e.removeEventListener("blur",this._windowBlur)}_increment(t){this.value=this._clamp((this.value||0)+this.step*t,this.min,this.max)}_updateValueFromPosition(t){if(!this._sliderDimensions)return;let e=this._clamp(((this.vertical?t.y:t.x)-(this.vertical?this._sliderDimensions.top:this._sliderDimensions.left))/(this.vertical?this._sliderDimensions.height:this._sliderDimensions.width));if(this._shouldInvertMouseCoords()&&(e=1-e),0===e)this.value=this.min;else if(1===e)this.value=this.max;else{const t=this._calculateValue(e),n=Math.round((t-this.min)/this.step)*this.step+this.min;this.value=this._clamp(n,this.min,this.max)}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.value),this.valueChange.emit(this.value),this.change.emit(this._createChangeEvent())}_emitInputEvent(){this.input.emit(this._createChangeEvent())}_updateTickIntervalPercent(){if(this.tickInterval&&this._sliderDimensions)if("auto"==this.tickInterval){let t=this.vertical?this._sliderDimensions.height:this._sliderDimensions.width,e=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=e/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let e=new qU;return e.source=this,e.value=t,e}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,e=0,n=1){return Math.max(e,Math.min(t,n))}_getSliderDimensions(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}_focusHostElement(t){this._elementRef.nativeElement.focus(t)}_blurHostElement(){this._elementRef.nativeElement.blur()}writeValue(t){this.value=t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Ig),ea(tc),ea(Op,8),ii("tabindex"),ea(xu),ea(Yu),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-slider"]],viewQuery:function(t,e){if(1&t&&qc($U,5),2&t){let t;Wc(t=Yc())&&(e._sliderWrapper=t.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._onFocus()})("blur",function(){return e._onBlur()})("keydown",function(t){return e._onKeydown(t)})("keyup",function(){return e._onKeyup()})("mouseenter",function(){return e._onMouseenter()})("selectstart",function(t){return t.preventDefault()}),2&t&&(il("tabIndex",e.tabIndex),Ko("aria-disabled",e.disabled)("aria-valuemax",e.max)("aria-valuemin",e.min)("aria-valuenow",e.value)("aria-valuetext",null==e.valueText?e.displayValue:e.valueText)("aria-orientation",e.vertical?"vertical":"horizontal"),ja("mat-slider-disabled",e.disabled)("mat-slider-has-ticks",e.tickInterval)("mat-slider-horizontal",!e.vertical)("mat-slider-axis-inverted",e._shouldInvertAxis())("mat-slider-invert-mouse-coords",e._shouldInvertMouseCoords())("mat-slider-sliding",e._isSliding)("mat-slider-thumb-label-showing",e.thumbLabel)("mat-slider-vertical",e.vertical)("mat-slider-min-value",e._isMinValue())("mat-slider-hide-last-tick",e.disabled||e._isMinValue()&&e._getThumbGap()&&e._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[_l([WU]),jo],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(t,e){1&t&&(ra(0,"div",0,1),ra(2,"div",2),oa(3,"div",3),oa(4,"div",4),sa(),ra(5,"div",5),oa(6,"div",6),sa(),ra(7,"div",7),oa(8,"div",8),oa(9,"div",9),ra(10,"div",10),ra(11,"span",11),Za(12),sa(),sa(),sa(),sa()),2&t&&(ws(3),na("ngStyle",e._getTrackBackgroundStyles()),ws(1),na("ngStyle",e._getTrackFillStyles()),ws(1),na("ngStyle",e._getTicksContainerStyles()),ws(1),na("ngStyle",e._getTicksStyles()),ws(1),na("ngStyle",e._getThumbContainerStyles()),ws(5),Ja(e.displayValue))},directives:[Th],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),t})();function KU(t){return"t"===t.type[0]}function QU(t,e){let n;return n=KU(t)?"number"==typeof e?ZU(t.touches,e)||ZU(t.changedTouches,e):t.touches[0]||t.changedTouches[0]:t,n?{x:n.clientX,y:n.clientY}:void 0}function ZU(t,e){for(let n=0;n{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny],Ny]}),t})();function tH(t,e){}class eH{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.maxWidth="80vw",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.autoFocus=!0,this.restoreFocus=!0,this.closeOnNavigation=!0}}const nH={dialogContainer:Vg("dialogContainer",[$g("void, exit",Hg({opacity:0,transform:"scale(0.7)"})),$g("enter",Hg({transform:"none"})),Wg("* => enter",zg("150ms cubic-bezier(0, 0, 0.2, 1)",Hg({transform:"none",opacity:1}))),Wg("* => void, * => exit",zg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",Hg({opacity:0})))])};let iH=(()=>{class t extends Fp{constructor(t,e,n,i,r,s){super(),this._elementRef=t,this._focusTrapFactory=e,this._changeDetectorRef=n,this._config=r,this._focusMonitor=s,this._animationStateChanged=new Rc,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=t=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(t)),this._ariaLabelledBy=r.ariaLabelledBy||null,this._document=i}_initializeWithAttachedContent(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}attachComponentPortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(t)}_recaptureFocus(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}_trapFocus(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}_restoreFocus(){const t=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&t&&"function"==typeof t.focus){const e=Sp(),n=this._elementRef.nativeElement;(!e||e===this._document.body||e===n||n.contains(e))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_setupFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}_capturePreviouslyFocusedElement(){this._document&&(this._elementFocusedBeforeDialogWasOpened=Sp())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,e=Sp();return t===e||t.contains(e)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(vg),ea(tc),ea(Yu,8),ea(eH),ea(Ig))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&qc(Up,7),2&t){let t;Wc(t=Yc())&&(e._portalOutlet=t.first)}},features:[jo]}),t})(),rH=(()=>{class t extends iH{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:e}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:e}))}_onAnimationStart({toState:t,totalTime:e}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:e}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:e})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,e){1&t&&ga("@dialogContainer.start",function(t){return e._onAnimationStart(t)})("@dialogContainer.done",function(t){return e._onAnimationDone(t)}),2&t&&(il("id",e._id),Ko("role",e._config.role)("aria-labelledby",e._config.ariaLabel?null:e._ariaLabelledBy)("aria-label",e._config.ariaLabel)("aria-describedby",e._config.ariaDescribedBy||null),rl("@dialogContainer",e._state))},features:[jo],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,e){1&t&&Jo(0,tH,0,0,"ng-template",0)},directives:[Up],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[nH.dialogContainer]}}),t})(),sH=0;class oH{constructor(t,e,n="mat-dialog-"+sH++){this._overlayRef=t,this._containerInstance=e,this.id=n,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new P,this._afterClosed=new P,this._beforeClosed=new P,this._state=0,e._id=n,e._animationStateChanged.pipe(Hd(t=>"opened"===t.state),Gp(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),e._animationStateChanged.pipe(Hd(t=>"closed"===t.state),Gp(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),t.keydownEvents().pipe(Hd(t=>27===t.keyCode&&!this.disableClose&&!Qp(t))).subscribe(t=>{t.preventDefault(),aH(this,"keyboard")}),t.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():aH(this,"mouse")})}close(t){this._result=t,this._containerInstance._animationStateChanged.pipe(Hd(t=>"closing"===t.state),Gp(1)).subscribe(e=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),e.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}afterOpened(){return this._afterOpened}afterClosed(){return this._afterClosed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._overlayRef.backdropClick()}keydownEvents(){return this._overlayRef.keydownEvents()}updatePosition(t){let e=this._getPositionStrategy();return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._overlayRef.updatePosition(),this}updateSize(t="",e=""){return this._overlayRef.updateSize({width:t,height:e}),this._overlayRef.updatePosition(),this}addPanelClass(t){return this._overlayRef.addPanelClass(t),this}removePanelClass(t){return this._overlayRef.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function aH(t,e,n){return void 0!==t._containerInstance&&(t._containerInstance._closeInteractionType=e),t.close(n)}const lH=new oi("MatDialogData"),cH=new oi("mat-dialog-default-options"),uH=new oi("mat-dialog-scroll-strategy"),hH={provide:uH,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.block()}};let dH=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l){this._overlay=t,this._injector=e,this._defaultOptions=n,this._parentDialog=i,this._overlayContainer=r,this._dialogRefConstructor=o,this._dialogContainerType=a,this._dialogDataToken=l,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new P,this._afterOpenedAtThisLevel=new P,this._ariaHiddenElements=new Map,this.afterAllClosed=Iz(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Kd(void 0))),this._scrollStrategy=s}get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){const t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}open(t,e){(e=function(t,e){return Object.assign(Object.assign({},e),t)}(e,this._defaultOptions||new eH)).id&&this.getDialogById(e.id);const n=this._createOverlay(e),i=this._attachDialogContainer(n,e),r=this._attachDialogContent(t,i,n,e);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(r),r.afterClosed().subscribe(()=>this._removeOpenDialog(r)),this.afterOpened.next(r),i._initializeWithAttachedContent(),r}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(e=>e.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const e=this._getOverlayConfig(t);return this._overlay.create(e)}_getOverlayConfig(t){const e=new af({positionStrategy:this._overlay.position().global(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,disposeOnNavigation:t.closeOnNavigation});return t.backdropClass&&(e.backdropClass=t.backdropClass),e}_attachDialogContainer(t,e){const n=No.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:eH,useValue:e}]}),i=new Np(this._dialogContainerType,e.viewContainerRef,n,e.componentFactoryResolver);return t.attach(i).instance}_attachDialogContent(t,e,n,i){const r=new this._dialogRefConstructor(n,e,i.id);if(t instanceof sc)e.attachTemplatePortal(new Lp(t,null,{$implicit:i.data,dialogRef:r}));else{const n=this._createInjector(i,r,e),s=e.attachComponentPortal(new Np(t,i.viewContainerRef,n));r.componentInstance=s.instance}return r.updateSize(i.width,i.height).updatePosition(i.position),r}_createInjector(t,e,n){const i=t&&t.viewContainerRef&&t.viewContainerRef.injector,r=[{provide:this._dialogContainerType,useValue:n},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:e}];return t.direction&&(!i||!i.get(Op,null,It.Optional))&&r.push({provide:Op,useValue:{value:t.direction,change:wd()}}),No.create({parent:i||this._injector,providers:r})}_removeOpenDialog(t){const e=this.openDialogs.indexOf(t);e>-1&&(this.openDialogs.splice(e,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const e=t.parentElement.children;for(let n=e.length-1;n>-1;n--){let i=e[n];i!==t&&"SCRIPT"!==i.nodeName&&"STYLE"!==i.nodeName&&!i.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(i,i.getAttribute("aria-hidden")),i.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let e=t.length;for(;e--;)t[e].close()}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(No),ea(void 0),ea(void 0),ea(gf),ea(void 0),ea(ai),ea(ai),ea(oi))},t.\u0275dir=se({type:t}),t})(),pH=(()=>{class t extends dH{constructor(t,e,n,i,r,s,o){super(t,e,i,s,o,r,oH,rH,lH)}}return t.\u0275fac=function(e){return new(e||t)(Ci(kf),Ci(No),Ci(lh,8),Ci(cH,8),Ci(uH),Ci(t,12),Ci(gf))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),fH=0,gH=(()=>{class t{constructor(t,e,n){this._dialogRef=t,this._elementRef=e,this._dialog=n,this.id="mat-dialog-title-"+fH++}ngOnInit(){this._dialogRef||(this._dialogRef=function(t,e){let n=t.nativeElement.parentElement;for(;n&&!n.classList.contains("mat-dialog-container");)n=n.parentElement;return n?e.find(t=>t.id===n.id):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{const t=this._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=this.id)})}}return t.\u0275fac=function(e){return new(e||t)(ea(oH,8),ea(kl),ea(pH))},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,e){2&t&&il("id",e.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),t})(),mH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),t})();let bH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[pH,hH],imports:[[Rf,Hp,Ny],Ny]}),t})();const yH=new oi("CdkAccordion");let vH=0,_H=(()=>{class t{constructor(t,e,n){this.accordion=t,this._changeDetectorRef=e,this._expansionDispatcher=n,this._openCloseAllSubscription=g.EMPTY,this.closed=new Rc,this.opened=new Rc,this.destroyed=new Rc,this.expandedChange=new Rc,this.id="cdk-accordion-child-"+vH++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=n.listen((t,e)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===e&&this.id!==t&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=md(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return t.\u0275fac=function(e){return new(e||t)(ea(yH,12),ea(tc),ea(Ap))},t.\u0275dir=se({type:t,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[_l([{provide:yH,useValue:void 0}])]}),t})(),wH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const xH=["body"];function SH(t,e){}const EH=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],CH=["mat-expansion-panel-header","*","mat-action-row"];function OH(t,e){1&t&&oa(0,"span",2),2&t&&na("@indicatorRotate",va()._getExpandedState())}const TH=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],kH=["mat-panel-title","mat-panel-description","*"],AH=new oi("MAT_ACCORDION"),PH="225ms cubic-bezier(0.4,0.0,0.2,1)",IH={indicatorRotate:Vg("indicatorRotate",[$g("collapsed, void",Hg({transform:"rotate(0deg)"})),$g("expanded",Hg({transform:"rotate(180deg)"})),Wg("expanded <=> collapsed, void => collapsed",zg(PH))]),bodyExpansion:Vg("bodyExpansion",[$g("collapsed, void",Hg({height:"0px",visibility:"hidden"})),$g("expanded",Hg({height:"*",visibility:"visible"})),Wg("expanded <=> collapsed, void => collapsed",zg(PH))])};let MH=(()=>{class t{constructor(t){this._template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["ng-template","matExpansionPanelContent",""]]}),t})(),DH=0;const RH=new oi("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let NH=(()=>{class t extends _H{constructor(t,e,n,i,r,s,o){super(t,e,n),this._viewContainerRef=i,this._animationMode=s,this._hideToggle=!1,this.afterExpand=new Rc,this.afterCollapse=new Rc,this._inputChanges=new P,this._headerId="mat-expansion-panel-header-"+DH++,this._bodyAnimationDone=new P,this.accordion=t,this._document=r,this._bodyAnimationDone.pipe(Rd((t,e)=>t.fromState===e.fromState&&t.toState===e.toState)).subscribe(t=>{"void"!==t.fromState&&("expanded"===t.toState?this.afterExpand.emit():"collapsed"===t.toState&&this.afterCollapse.emit())}),o&&(this.hideToggle=o.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=md(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe(Kd(null),Hd(()=>this.expanded&&!this._portal),Gp(1)).subscribe(()=>{this._portal=new Lp(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,e=this._body.nativeElement;return t===e||e.contains(t)}return!1}}return t.\u0275fac=function(e){return new(e||t)(ea(AH,12),ea(tc),ea(Ap),ea(hc),ea(Yu),ea(Ey,8),ea(RH,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,MH,5),2&t){let t;Wc(t=Yc())&&(e._lazyContent=t.first)}},viewQuery:function(t,e){if(1&t&&qc(xH,5),2&t){let t;Wc(t=Yc())&&(e._body=t.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,e){2&t&&ja("mat-expanded",e.expanded)("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-expansion-panel-spacing",e._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[_l([{provide:AH,useValue:void 0}]),jo,ye],ngContentSelectors:CH,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,e){1&t&&(wa(EH),xa(0),ra(1,"div",0,1),fa("@bodyExpansion.done",function(t){return e._bodyAnimationDone.next(t)}),ra(3,"div",2),xa(4,1),Jo(5,SH,0,0,"ng-template",3),sa(),xa(6,2),sa()),2&t&&(ws(1),na("@bodyExpansion",e._getExpandedState())("id",e.id),Ko("aria-labelledby",e._headerId),ws(4),na("cdkPortalOutlet",e._portal))},directives:[Up],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[IH.bodyExpansion]},changeDetection:0}),t})();class LH{}const jH=By(LH);let FH=(()=>{class t extends jH{constructor(t,e,n,i,r,s,o){super(),this.panel=t,this._element=e,this._focusMonitor=n,this._changeDetectorRef=i,this._animationMode=s,this._parentChangeSubscription=g.EMPTY;const a=t.accordion?t.accordion._stateChanges.pipe(Hd(t=>!(!t.hideToggle&&!t.togglePosition))):ep;this.tabIndex=parseInt(o||"")||0,this._parentChangeSubscription=Q(t.opened,t.closed,a,t._inputChanges.pipe(Hd(t=>!!(t.hideToggle||t.disabled||t.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Hd(()=>t._containsFocus())).subscribe(()=>n.focusVia(e,"program")),r&&(this.expandedHeight=r.expandedHeight,this.collapsedHeight=r.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Qp(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,e){t?this._focusMonitor.focusVia(this._element,t,e):this._element.nativeElement.focus(e)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return t.\u0275fac=function(e){return new(e||t)(ea(NH,1),ea(kl),ea(Ig),ea(tc),ea(RH,8),ea(Ey,8),ii("tabindex"))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,e){1&t&&fa("click",function(){return e._toggle()})("keydown",function(t){return e._keydown(t)}),2&t&&(Ko("id",e.panel._headerId)("tabindex",e.tabIndex)("aria-controls",e._getPanelId())("aria-expanded",e._isExpanded())("aria-disabled",e.panel.disabled),La("height",e._getHeaderHeight()),ja("mat-expanded",e._isExpanded())("mat-expansion-toggle-indicator-after","after"===e._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===e._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[jo],ngContentSelectors:kH,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,e){1&t&&(wa(TH),ra(0,"span",0),xa(1),xa(2,1),xa(3,2),sa(),Jo(4,OH,1,1,"span",1)),2&t&&(ws(4),na("ngIf",e._showToggle()))},directives:[_h],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[IH.indicatorRotate]},changeDetection:0}),t})(),BH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny,wH,Hp]]}),t})();var VH=n(5478);Object.create(Error.prototype);const zH=["*"];var UH=(()=>(function(t){t.LineHighlight="line-highlight",t.LineNumbers="line-numbers"}(UH||(UH={})),UH))();class HH{}const $H=new oi("SECURITY_CONTEXT");let GH=(()=>{class t{constructor(t,e,n,i,r){this.platform=t,this.securityContext=e,this.http=n,this.sanitizer=r,this.initialMarkedOptions={renderer:new VH.Renderer},this.options=i}get options(){return this._options}set options(t){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),t)}get renderer(){return this.options.renderer}set renderer(t){this.options.renderer=t}compile(t,e=!1,n=!1,i=this.options){const r=this.trimIndentation(t),s=e?this.decodeHtml(r):r,o=n?this.renderEmoji(s):s,a=VH.parse(o,i);return this.sanitizer.sanitize(this.securityContext,a)||""}getSource(t){if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(t,{responseType:"text"}).pipe(D(e=>this.handleExtension(t,e)))}highlight(t){if(Lh(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const e=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(e,t=>t.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,e){if(!Lh(this.platform))return t;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return t.replace(/\$([^\s][^$]*?[^\s])\$/gm,(t,n)=>katex.renderToString(n,e))}decodeHtml(t){if(!Lh(this.platform))return t;const e=document.createElement("textarea");return e.innerHTML=t,e.value}handleExtension(t,e){const n=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==n?"```"+n+"\n"+e+"\n```":e}renderEmoji(t){if(!Lh(this.platform))return t;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(t)}trimIndentation(t){if(!t)return"";let e;return t.split("\n").map(t=>{let n=e;return t.length>0&&(n=isNaN(n)?t.search(/\S|$/):Math.min(t.search(/\S|$/),n)),isNaN(e)&&(e=n),n?t.substring(n):t}).join("\n")}}return t.\u0275fac=function(e){return new(e||t)(Ci(ou),Ci($H),Ci(Bv,8),Ci(HH,8),Ci(hd))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),WH=(()=>{class t{constructor(t,e){this.element=t,this.markdownService=e,this.error=new Rc,this.load=new Rc,this.ready=new Rc,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}get emoji(){return this._emoji}set emoji(t){this._emoji=this.coerceBooleanProperty(t)}get katex(){return this._katex}set katex(t){this._katex=this.coerceBooleanProperty(t)}get lineHighlight(){return this._lineHighlight}set lineHighlight(t){this._lineHighlight=this.coerceBooleanProperty(t)}get lineNumbers(){return this._lineNumbers}set lineNumbers(t){this._lineNumbers=this.coerceBooleanProperty(t)}ngOnChanges(){null==this.data?null==this.src||this.handleSrc():this.handleData()}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion()}render(t,e=!1){let n=this.markdownService.compile(t,e,this.emoji);n=this.katex?this.markdownService.renderKatex(n,this.katexOptions):n,this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}coerceBooleanProperty(t){return null!=t&&"false"!=`${String(t)}`}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe(t=>{this.render(t),this.load.emit(t)},t=>this.error.emit(t))}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,UH.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,e){const n=t.querySelectorAll("pre");for(let i=0;i{const r=e[t];if(r){const e=this.toLispCase(t);n.item(i).setAttribute(e,r.toString())}})}toLispCase(t){const e=t.match(/([A-Z])/g);if(!e)return t;let n=t.toString();for(let i=0,r=e.length;i{class t{static forRoot(e){return{ngModule:t,providers:[GH,e&&e.loader||[],e&&e.markedOptions||[],{provide:$H,useValue:e&&null!=e.sanitize?e.sanitize:yr.HTML}]}}static forChild(){return{ngModule:t}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function XH(t,e,n){return n?XH(t,e).pipe(D(t=>d(t)?n(...t):n(t))):new C(n=>{const i=(...t)=>n.next(1===t.length?t[0]:t);let r;try{r=t(i)}catch(s){return void n.error(s)}if(a(e))return()=>e(i,r)})}function YH(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new KH(t,n))}}class KH{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new QH(t,this.observables,this.project))}}class QH extends S_{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const i=e.length;this.values=new Array(i);for(let r=0;r0){const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}class ZH{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new JH(t,this.accumulator,this.seed,this.hasSeed))}}class JH extends v{constructor(t,e,n,i){super(t),this.accumulator=e,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}class t${constructor(t){this.predicate=t}call(t,e){return e.subscribe(new e$(t,this.predicate))}}class e$ extends v{constructor(t,e){super(t),this.predicate=e,this.skipping=!0,this.index=0}_next(t){const e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)}tryCallPredicate(t){try{const e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(e){this.destination.error(e)}}}const n$=["youtubeContainer"];let i$=(()=>{class t{constructor(t,e){this._ngZone=t,this._youtubeContainer=new P,this._destroyed=new P,this._playerChanges=new Uf(void 0),this._videoId=new Uf(void 0),this._height=new Uf(390),this._width=new Uf(640),this._startSeconds=new Uf(void 0),this._endSeconds=new Uf(void 0),this._suggestedQuality=new Uf(void 0),this._playerVars=new Uf(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=Lh(e)}get videoId(){return this._videoId.value}set videoId(t){this._videoId.next(t)}get height(){return this._height.value}set height(t){this._height.next(t||390)}get width(){return this._width.value}set width(t){this._width.next(t||640)}set startSeconds(t){this._startSeconds.next(t)}set endSeconds(t){this._endSeconds.next(t)}set suggestedQuality(t){this._suggestedQuality.next(t)}get playerVars(){return this._playerVars.value}set playerVars(t){this._playerVars.next(t)}ngOnInit(){if(!this._isBrowser)return;let t=wd(!0);if(!window.YT||!window.YT.Player){const e=new P;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>e.next(!0))},t=e.pipe(Gp(1),Kd(!1))}const e=function(t,e,n,i,r,s,o){const a=T_([e,s]).pipe(YH(T_([i,r])),D(([t,e])=>{const[n,i]=t,[r,s]=e;return n?{videoId:n,playerVars:i,width:r,height:s}:void 0}));return T_([t,a,wd(o)]).pipe(function(t){return S(function(...t){let e=null;return"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&d(t[0])&&(t=t[0].slice()),n=>n.lift.call(U([n,...t]),new k_(e))}(t),function(t){return e=>e.lift(new t$(t))}(([t,e])=>!e),D(([t])=>t))}(n),function(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new ZH(t,e,n))}}(r$,void 0),Rd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe($f(t=>{this._playerChanges.next(t)}),W(t=>t?s$(t)?wd(t):new C(e=>{let n=!1,i=!1;const r=t=>{i=!0,n||(t.target.removeEventListener("onReady",r),e.next(t.target))};return t.addEventListener("onReady",r),()=>{n=!0,i||(t=>{s$(t)||t.destroy()})(t)}}).pipe(Gp(1),Kd(void 0)):wd(void 0)),Wd(this._destroyed),rt(new P));e.subscribe(t=>{this._player=t,t&&this._pendingPlayerState&&this._initializePlayer(t,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(t,e,n){T_([t,e,n]).subscribe(([t,e,n])=>t&&t.setSize(e,n))}(e,this._width,this._height),function(t,e){T_([t,e]).subscribe(([t,e])=>t&&e&&t.setPlaybackQuality(e))}(e,this._suggestedQuality),function(t,e,n,i,r,s){const o=T_([n,i]).pipe(D(([t,e])=>({startSeconds:t,endSeconds:e}))),a=o.pipe(o$(t,t=>!!t&&!function(t){const e=t.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(t))),l=e.pipe(o$(t,(t,e)=>!!t&&t.videoId!==e));Q(t.pipe(o$(T_([e,o]),([t,e],n)=>!(!n||t==n.videoId&&!e.startSeconds&&!e.endSeconds))),l,a).pipe(YH(T_([t,e,o,r])),D(([t,e])=>e),Wd(s)).subscribe(([t,e,n,i])=>{!e||!t||(t.videoId=e,t.cueVideoById(Object.assign({videoId:e,suggestedQuality:i},n)))})}(e,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),e.connect()}createEventsBoundInZone(){return{}}ngAfterViewInit(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}ngOnDestroy(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,e){this._player?this._player.seekTo(t,e):this._getPendingState().seek={seconds:t,allowSeekAhead:e}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_initializePlayer(t,e){const{playbackState:n,playbackRate:i,volume:r,muted:s,seek:o}=e;switch(n){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=i&&t.setPlaybackRate(i),null!=r&&t.setVolume(r),null!=s&&(s?t.mute():t.unMute()),null!=o&&t.seekTo(o.seconds,o.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Qd(e=>e?XH(n=>{e.addEventListener(t,n)},n=>{try{e.removeEventListener&&e.removeEventListener(t,n)}catch(i){}}):wd()),t=>new C(e=>t.subscribe({next:t=>this._ngZone.run(()=>e.next(t)),error:t=>e.error(t),complete:()=>e.complete()})),Wd(this._destroyed))}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(ou))},t.\u0275cmp=Jt({type:t,selectors:[["youtube-player"]],viewQuery:function(t,e){if(1&t&&qc(n$,5),2&t){let t;Wc(t=Yc())&&(e.youtubeContainer=t.first)}},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(t,e){1&t&&oa(0,"div",null,0)},encapsulation:2,changeDetection:0}),t})();function r$(t,[e,n,i]){if(t&&n&&t.playerVars!==n.playerVars)t.destroy();else{if(!n)return void(t&&t.destroy());if(t)return t}const r=i.runOutsideAngular(()=>new YT.Player(e,n));return r.videoId=n.videoId,r.playerVars=n.playerVars,r}function s$(t){return"getPlayerStatus"in t}function o$(t,e){return S(YH(t),Hd(([t,n])=>e(n,t)),D(([t])=>t))}let a$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function l$(t){return!0===t}function c$(t){return null==t}function u$(t){return!c$(t)}function h$(t){return Boolean(t)}function d$(t){return c$(t)?t:JSON.parse(JSON.stringify(t))}const p$=t=>{const e=t instanceof Date;if("object"!=typeof t||null===t||e)return t;Object.freeze(t);const n="function"==typeof t,i=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(e=>{i.call(t,e)&&(!n||"caller"!==e&&"callee"!==e&&"arguments"!==e)&&null!==t[e]&&("object"==typeof t[e]||"function"==typeof t[e])&&!Object.isFrozen(t[e])&&p$(t[e])}),t};function f$(t){return u$(t)&&"object"==typeof t&&function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)}const g$="NGXS_DATA_META",m$="NGXS_META",b$="NGXS_ARGUMENT_REGISTRY_META";let y$=(()=>{class t{constructor(t){this.sequence$=new Uf(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function v$(t){return t[g$]}let _$=(()=>{class t{constructor(e,n,i){t.store=e.get(pV),t.ngZone=e.get(xu),t.factory=n,t.context=i,t.computed=e.get(y$)}}return t.store=null,t.computed=null,t.context=null,t.factory=null,t.ngZone=null,t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(wB),Ci(_B))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class w${constructor(){w$.statesCachedMeta.clear()}static createStateContext(t){return _$.context.createStateContext(t)}static ensureMappedState(t){if(c$(_$.factory)||c$(t))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(u$(t.name)?w$.statesCachedMeta.get(t.name):null)||w$.ensureMeta(t)}static getRepositoryByInstance(t){var e;const n=null!==(e=v$(w$.getStateClassByInstance(t)))&&void 0!==e?e:null;if(c$(n))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return n}static getStateClassByInstance(t){return(null!=t?t:{}).constructor}static clearMetaByInstance(t){const e=w$.getRepositoryByInstance(t);e.stateMeta.actions={},e.operations={}}static createPayload(t,e){const n={},i=Array.from(t);for(let r=0;r0?n:null}static createAction(t,e,n){const i=w$.createPayload(e,n);return new(function(t){return class{constructor(t){t&&Object.keys(t).forEach(e=>{this[e]=t[e]})}static get type(){return t}}}(t.type))(i)}static ensureMeta(t){var e;const n=u$(t.name)?null===(e=_$.factory.states)||void 0===e?void 0:e.find(e=>e.name===t.name):null;return u$(n)&&u$(t.name)&&w$.statesCachedMeta.set(t.name,n),n}}w$.statesCachedMeta=new Map,w$.\u0275fac=function(t){return new(t||w$)},w$.\u0275prov=xt({token:w$,factory:w$.\u0275fac}),new lp(1);class x$ extends Error{constructor(t){super(`Child states can only be added to an object. Cannot convert ${u$(null==t?void 0:t.constructor)?t.constructor.name:t} to PlainObject`)}}function S$(t){var e;return null!==(e=t.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function E$(t){var e;const n=S$(t),i=null!==(e=n.children)&&void 0!==e?e:[],r=d$(void 0===n.defaults?{}:n.defaults);if(i.length){if(f$(r))return function(t,e){return e.reduce((t,e)=>{const n=S$(e);if(function(t){const e="string"==typeof t?t.trim():t;return[void 0,null,NaN,"",1/0].includes(e)}(n.name))throw new Error("State name not provided in class");return t[n.name.toString()]=E$(e),t},null!=t?t:{})}(r,i);throw new x$(r)}return r}function C$(t){var e;return null!==(e=t.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function O$(){var t,e;return null!==(e=null===(t=null==_$?void 0:_$.computed)||void 0===t?void 0:t.sequenceValue)&&void 0!==e?e:0}function T$(t){let e=!1;return Dd(t)&&(e=!0),e}function k$(t){return t[b$]}class A$ extends Error{constructor(t,e){super(`An argument with the name '${t}' already exists in the method '${e}'`)}}class P${constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(t){var e;return null!==(e=this.payloadMap.get(t))&&void 0!==e?e:null}getArgumentNameByIndex(t){var e;return null!==(e=this.argumentMap.get(t))&&void 0!==e?e:null}createPayloadType(t,e,n){this.checkDuplicateName(t,e),this.payloadMap.set(n,t),this.payloadMap.set(t,t)}createArgumentName(t,e,n){this.checkDuplicateName(t,e),this.argumentMap.set(n,t),this.argumentMap.set(t,t)}checkDuplicateName(t,e){if(h$(this.argumentMap.has(t))||h$(this.payloadMap.has(t)))throw new A$(t,e)}}function I$(t){return Nu()?p$(t):t}function M$(t){return{enumerable:!0,configurable:!0,get(){const e=v$(t),n=w$.ensureMappedState(e.stateMeta);return w$.createStateContext(n)}}}function D$(t){if(!t)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},t),{getState:()=>Nu()?p$(t.getState()):t.getState(),setState(e){t.setState(e)},patchState(e){t.patchState(e)}})}function R$(){return(t,e,n)=>{!function(t,e){if(!function(t,e){var n;let i=t,r=!1;if(f$(i))for(;null!==i;){if(l$(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(n=Object.getOwnPropertyDescriptor(i,e))||void 0===n?void 0:n.get);break}i=Object.getPrototypeOf(i)}return r}(t,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(t,e);const i=n.get;return n.get=function(...t){const e=function(t){return c$(C$(t))&&Object.defineProperties(t,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),C$(t)}(this),n=null==e?void 0:e.get(i);if(l$(null==n?void 0:n.isObservable))return null==n?void 0:n.value;if(c$(n)||n.sequenceId!==O$()){e.delete(i);const n=i.apply(this,t);return e.set(i,{value:n,sequenceId:O$(),isObservable:T$(n)}),n}return n.value},n}}const N$={cancelUncompleted:!0,insideZone:!1};function L$(t=N$){return(e,n,i)=>{!function(t,e){if(t.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=n.toString();return i.value=function(...e){const n=this;let i=null;const o=w$.getRepositoryByInstance(n),a=o.operations;let l=a[s];const c=o.stateMeta,u=k$(r);if(c$(l)){const e=function(t){var e,n,i;return null!==(i=null===(n=null===(e=(t+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===n?void 0:n.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),n=function(t){const{statePath:e,argumentsNames:n,methodName:i,argumentRegistry:r}=t;let s="";for(let o=0;o{var s;return l$(t.insideZone)?null===(s=_$.ngZone)||void 0===s||s.run(()=>{i=r.apply(n,e)}):i=r.apply(n,e),Dd(i)?wd(null).pipe(D(()=>i)):i};const h=w$.createAction(l,e,u),d=_$.store.dispatch(h);return Dd(i)?function(t,e){return hv([t,e]).pipe(D(t=>t.pop()))}(d,i):i},i}}function j$(t){return(e,n,i)=>{const r=t.trim();if(!r)throw new Error("Payload name should be initialized");(function(t,e){const n=t[e];return c$(k$(n))&&Object.defineProperties(n,{[b$]:{enumerable:!0,configurable:!0,value:new P$}}),k$(n)})(e,n).createPayloadType(r,n,i)}}function F$(){return t=>{const e=function(t){if(function(t){return!h$(t)}(t.hasOwnProperty(m$))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,m$,{value:e})}return function(t){var e;return null===(e=t)||void 0===e?void 0:e[m$]}(t)}(t);if(c$(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(t,e){(function(t){var e;const n=null!==(e=v$(t))&&void 0!==e?e:null;return(c$(n)||(null==n?void 0:n.stateClass)!==t)&&function(t){Object.defineProperty(t,g$,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:t}})}(t),v$(t)}(t)).stateMeta=e}(t,e),function(t,e,n){Object.defineProperties(t.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>d$(n)},context:M$(t)})}(t,e,E$(t)),function(t){var e,n;const i=v$(t),r=null!==(n=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==n?n:null;if(u$(r)){const e=`__${r}__selector`;Object.defineProperties(t.prototype,{[e]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(u$(this[e]))return this[e];if(c$(_$.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[e]=_$.store.select(t).pipe(D(t=>Nu()?p$(t):t),up({refCount:!0,bufferSize:1})),this[e]}}})}}(t)}}let B$=(()=>{class t{constructor(){this.browserStorageEvents$=new P,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var e;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(e=this.ngxsDataDoCheck)||void 0===e||e.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var t;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(t=this.ngxsDataDoCheck)||void 0===t||t.call(this))}markAsDirtyAfterReset(){var t;this.dirty=!0,null===(t=this.ngxsDataAfterReset)||void 0===t||t.call(this)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),V$=(()=>{class t extends B${get snapshot(){return I$(this.getState())}get ctx(){return D$(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$(),aw("design:type",Object),aw("design:paramtypes",[])],t.prototype,"snapshot",null),sw([L$(),ow(0,j$("patchValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"patchState",null),sw([L$(),ow(0,j$("stateValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"setState",null),sw([L$(),aw("design:type",Function),aw("design:paramtypes",[]),aw("design:returntype",void 0)],t.prototype,"reset",null),t})(),z$=(()=>{class t extends B${get snapshot(){return I$(this.getState())}get ctx(){return D$(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$(),aw("design:type",Object),aw("design:paramtypes",[])],t.prototype,"snapshot",null),sw([L$(),ow(0,j$("patchValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"patchState",null),sw([L$(),ow(0,j$("stateValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"setState",null),sw([L$(),aw("design:type",Function),aw("design:paramtypes",[]),aw("design:returntype",void 0)],t.prototype,"reset",null),t})();const U$=new oi("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),H$=new oi("ngx-window",{providedIn:"root",factory:()=>function(t){return Lh(t)?window:null}(Oi(ou))}),$$=new oi("ngx-data-layer",{providedIn:"root",factory:()=>function(t){return t?t.dataLayer=t.dataLayer||[]:null}(Oi(H$))}),G$=new oi("ngx-gtag-fn",{providedIn:"root",factory:()=>function(t,e){return t?t.gtag=t.gtag||function(){e.push(arguments)}:null}(Oi(H$),Oi($$))});let W$=(()=>{class t{constructor(t,e,n){this.settings=t,this._document=e,this._gtag=n}get document(){return this._document}throw(t){(this.settings.enableTracing||Nu())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((t,[e,n])=>Object.defineProperty(t,e,{value:n,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(t=>void 0!==t))}catch(e){this.throw(e)}}event(t,e,n,i,r){try{const s=new Map;e&&s.set("event_category",e),n&&s.set("event_label",n),i&&s.set("value",i),void 0!==r&&s.set("interaction",r);const o=this.toKeyValue(s);o?this.gtag("event",t,o):this.gtag("event",t)}catch(s){this.throw(s)}}pageView(t,e,n,i){try{const r=new Map([["page_path",t]]);e&&r.set("page_title",e),(n||this.document)&&r.set("page_location",n||this.document.location.href),i&&Object.entries(i).map(([t,e])=>r.set(t,e)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(r))}catch(r){this.throw(r)}}appView(t,e,n,i,r){try{const s=new Map([["screen_name",t],["app_name",e]]);n&&s.set("app_id",n),i&&s.set("app_version",i),r&&s.set("app_installer_id",r),this.gtag("event","screen_view",this.toKeyValue(s))}catch(s){this.throw(s)}}set(...t){try{this._gtag("set",...t)}catch(e){this.throw(e)}}exception(t,e){try{const n=new Map;t&&n.set("description",t),e&&n.set("fatal",e),this.toKeyValue(n)?this.gtag("event","exception",this.toKeyValue(n)):this.gtag("event","exception")}catch(n){this.throw(n)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(U$),Ci(Yu),Ci(G$))},t.\u0275prov=xt({factory:function(){return new t(Ci(U$),Ci(Yu),Ci(G$))},token:t,providedIn:"root"}),t})();const q$={provide:tu,multi:!0,useFactory:function(t,e,n){return()=>lw(this,void 0,void 0,function*(){var i;if(!t.trackingCode)return void(Nu()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Nu()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));n||Nu()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),t.uri=t.uri||`https://www.googletagmanager.com/gtag/js?id=${t.trackingCode}`,t.initCommands=null!==(i=null==t?void 0:t.initCommands)&&void 0!==i?i:[],t.initCommands.find(t=>"config"===t.command)||t.initCommands.unshift({command:"config",values:[t.trackingCode]}),t.initCommands.find(t=>"js"===t.command)||t.initCommands.unshift({command:"js",values:[new Date]});for(const n of t.initCommands)e(n.command,...n.values);const r=n.createElement("script");r.async=!0,r.src=t.uri,t.nonce&&r.setAttribute("nonce",t.nonce),n.getElementsByTagName("head")[0].appendChild(r)})},deps:[U$,G$,Yu]};new oi("ngx-google-analytics-routing-settings",{factory:()=>({})});let X$=(()=>{class t{static forRoot(e,n=[],i,r,s){return{ngModule:t,providers:[{provide:U$,useValue:{trackingCode:e,initCommands:n,uri:i,enableTracing:r,nonce:s}},q$]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[]]}),t})(),Y$=(()=>{class t{constructor(){this.consent="not-set",this.consentChange=new lp(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),K$=(()=>{class t{constructor(t,e,{trackingCode:n}){this.window=e,this.subscriptions=new g,this.token=n,this.subscriptions.add(t.consentChange.subscribe(t=>this.toggleGoogleAnalytics("rescinded"===t)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Y$),Ci(H$),Ci(U$))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Q$=new oi("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),Z$=[Y$,K$,(()=>{class t{constructor(t,e){this.key=e,this.subscriptions=new g;try{this.storage=localStorage}catch(n){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(t=>this.saveConsent(t)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,e;const n=null===(e=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===e?void 0:e.call(t,this.key);if(null==n)return"not-set";const i=n.trim().toLowerCase();switch(i){case"given":case"rescinded":return i;default:return"not-set"}}saveConsent(t){var e,n;null===(n=null===(e=this.storage)||void 0===e?void 0:e.setItem)||void 0===n||n.call(e,this.key,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Y$),Ci(Q$))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})()];function J$(t){return Object.entries(t).reduce((t,[e,n])=>(null!=n&&(t[e]=`${n}`),t),{})}let tG=(()=>{class t{static forRoot(e){const{providers:n=[]}=X$.forRoot(e.gaToken,function(t){const{appName:e,projectName:n,developmentMode:i}=t;return[{command:"set",values:[J$({appName:e,projectName:n,developmentMode:i})]}]}(e));return{ngModule:t,providers:n}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[...Z$,{provide:tu,multi:!0,useFactory:()=>()=>{},deps:Z$}],imports:[[X$]]}),t})();const eG=["bodyCanvas"];let nG=(()=>{class t{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Rc,this.nodeDrag=new Rc,this.nodeClick=new Rc,this.nodeHoverStart=new Rc,this.nodeHoverStop=new Rc,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var e;this._scene=t,null===(e=this.bodyUI)||void 0===e||e.setScene(t)}get rotation(){return this._rotation}set rotation(t){var e;this._rotation=t,null===(e=this.bodyUI)||void 0===e||e.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var e;this._rotationX=t,null===(e=this.bodyUI)||void 0===e||e.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var e;this._zoom=t,null===(e=this.bodyUI)||void 0===e||e.setZoom(t)}get target(){return this._target}set target(t){var e;this._target=t,null===(e=this.bodyUI)||void 0===e||e.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,e={x:48,y:48}){if(this.bodyCanvas){const{width:n,height:i}=this.bodyCanvas.nativeElement,r=window.devicePixelRatio,s=Math.min(Math.log2((n-e.x)/r/t.x),Math.log2((i-e.y)/r/t.y));this.zoom=s}}setupBodyUI(){var t;return lw(this,void 0,void 0,function*(){const e=this.bodyCanvas.nativeElement,n=new dB({id:"body-ui",canvas:e,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});e.addEventListener("contextmenu",t=>t.preventDefault()),yield n.initialize(),this.bodyUI=n,window.bodyUI=n,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(t=>this.rotationChange.next(t)),this.bodyUI.nodeDrag$.subscribe(t=>this.nodeDrag.emit(t)),this.bodyUI.nodeClick$.subscribe(t=>this.nodeClick.emit(t)),this.bodyUI.nodeHoverStart$.subscribe(t=>this.nodeHoverStart.emit(t)),this.bodyUI.nodeHoverStop$.subscribe(t=>this.nodeHoverStop.emit(t))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-body-ui"]],viewQuery:function(t,e){if(1&t&&qc(eG,5,kl),2&t){let t;Wc(t=Yc())&&(e.bodyCanvas=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,e){1&t&&oa(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),t})(),iG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})();new oi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const rG=["carouselContainer"],sG=["itemlist"],oG=["itemcontainer"];function aG(t,e){if(1&t&&(ra(0,"div",14),Za(1),sa()),2&t){const t=va().$implicit,e=va();ws(1),Ja(e.occurenceData[t.id]||0)}}function lG(t,e){if(1&t){const t=ua();ra(0,"div",9),fa("click",function(){const e=$e(t).$implicit;return va().selectOrgan(e)}),oa(1,"mat-icon",10),ra(2,"div",11),ra(3,"div",12),Za(4),sa(),Jo(5,aG,2,1,"div",13),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ja("disabled",t.disabled)("selected",n.isSelected(t)),ws(1),Sa("svgIcon",t.src),ws(3),Ja(t.name),ws(1),na("ngIf",void 0!==t.numResults)}}const cG=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}],uG=cG.filter(t=>!0!==t.disabled);let hG=(()=>{class t{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=uG,this.selectedOrgans=[],this.organsChanged=new Rc,this.onLeft=!0,this.onRight=!1,this.step=72}set occurenceData(t){this._occurenceData=t}get occurenceData(){return this._occurenceData}ngAfterViewInit(){const{carouselContainer:t}=this;this.sensor=new HU.ResizeSensor(t.nativeElement,()=>{this.set()})}ngOnChanges(t){"organList"in t&&this.set()}ngOnDestroy(){this.sensor.detach()}get error(){return!(!this.displayErrors||0===this.selectedOrgans.length)}shift(t){const{itemList:e}=this;let n=parseInt(e.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(n="right"===t?n-this.step:n+this.step,e.nativeElement.style.left=n+"px",this.setLeftRight(n))}scroll(t){this.timeoutHandler=setInterval(()=>{this.shift(t)},200)}stopScroll(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}selectOrgan(t){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(t)?this.selectedOrgans.filter(e=>t!==e):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:e,carouselContainer:n}=this,i=parseInt(t.nativeElement.style.left,10)||0;if(t.nativeElement.offsetWidth>=this.organList.length*this.step)t.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(i);const t=this.step*Math.floor(n.nativeElement.offsetWidth/this.step)-64;e.nativeElement.style.width=`${t}px`}}setWidth(){const{itemContainer:t,carouselContainer:e}=this,n=this.step*Math.floor(e.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${n}px`}setLeftRight(t){const{itemContainer:e}=this;this.onLeft=0===t,this.onRight=t<=e.nativeElement.offsetWidth-this.organList.length*this.step}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-organ-selector"]],viewQuery:function(t,e){if(1&t&&(qc(rG,7),qc(sG,7),qc(oG,7)),2&t){let t;Wc(t=Yc())&&(e.carouselContainer=t.first),Wc(t=Yc())&&(e.itemList=t.first),Wc(t=Yc())&&(e.itemContainer=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[ye],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(t,e){1&t&&(ra(0,"div",0,1),ra(2,"mat-icon",2),fa("touchstart",function(){return e.scroll("left")})("touchend",function(){return e.stopScroll()})("click",function(){return e.shift("left")})("mousedown",function(){return e.scroll("left")})("mouseup",function(){return e.stopScroll()}),Za(3,"chevron_left"),sa(),ra(4,"div",3,4),ra(6,"div",5,6),Jo(8,lG,6,7,"div",7),sa(),sa(),ra(9,"mat-icon",8),fa("touchstart",function(){return e.scroll("right")})("touchend",function(){return e.stopScroll()})("click",function(){return e.shift("right")})("mousedown",function(){return e.scroll("right")})("mouseup",function(){return e.stopScroll()}),Za(10,"chevron_right"),sa(),sa()),2&t&&(ja("error",e.error),na("matTooltipDisabled",e.multiselect),ws(2),ja("disabled",e.onLeft),ws(6),na("ngForOf",e.organList),ws(1),ja("disabled",e.onRight))},directives:[ew,p_,yh,_h],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),t})(),dG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,rw]]}),t})(),pG=(()=>{class t{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Rc,this.visibilityToggle=new Rc,this.opacityReset=new Rc}ngOnInit(){this.prevOpacity=this.visible?0:20}reset(){this.prevOpacity=20}changeOpacity(t){this.opacity=parseInt(t,10),this.opacityChange.emit(this.opacity)}toggleVisibility(){const t=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=t,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}resetOpacity(){this.prevOpacity=0,this.opacityReset.emit()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"mat-slider",2),fa("input",function(t){return e.changeOpacity(t.value)}),sa(),ra(3,"span",3),Za(4),sa(),sa(),ra(5,"div",4),ra(6,"mat-icon",5),fa("click",function(){return e.toggleVisibility()}),sa(),ra(7,"mat-icon",6),fa("click",function(){return e.toggleVisibility()}),sa(),ra(8,"mat-icon",7),fa("click",function(){return e.resetOpacity()}),Za(9,"refresh"),sa(),sa(),sa()),2&t&&(ws(2),ja("disabled",!e.visible),na("step",1)("min",0)("max",100)("value",e.opacity),ws(2),tl("",e.opacity,"%"),ws(2),ja("hidden",e.visible),na("matRippleCentered",!0)("matRippleUnbounded",!0),ws(1),ja("hidden",!e.visible),na("matRippleCentered",!0)("matRippleUnbounded",!0),ws(1),na("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[YU,p_,Yy],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})(),fG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,JU,Ky]]}),t})();function gG(t,e){if(1&t&&(ra(0,"div",15),oa(1,"youtube-player",16),sa()),2&t){const t=va(3);ws(1),Sa("videoId",t.videoID)}}function mG(t,e){if(1&t&&(ra(0,"mat-expansion-panel",10),ra(1,"mat-expansion-panel-header"),ra(2,"h2",11),Za(3),sa(),sa(),ra(4,"div",12),oa(5,"markdown",13),Jo(6,gG,2,1,"div",14),sa(),sa()),2&t){const t=va(),e=t.index,n=t.$implicit;na("expanded",0===e),ws(3),Ja(n.title),ws(2),ja("first",0===e),na("data",n.content),ws(1),na("ngIf",0===e)}}function bG(t,e){if(1&t&&(ra(0,"div",8),Jo(1,mG,7,6,"mat-expansion-panel",9),sa()),2&t){const t=e.$implicit;ws(1),na("ngIf",t)}}let yG=(()=>{class t{constructor(t,e){this.dialogRef=t,this.data=e,this.documentationContents=e.content||[],this.infoTitle=e.title||"",this.videoID=e.videoID}ngOnInit(){const t=document.createElement("script");t.src="https://www.youtube.com/iframe_api",document.body.appendChild(t)}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return t.\u0275fac=function(e){return new(e||t)(ea(oH),ea(lH))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),ra(3,"mat-icon",3),fa("click",function(){return e.close()}),Za(4,"clear"),sa(),sa(),ra(5,"div",4),ra(6,"h2",5),Za(7),sa(),ra(8,"mat-dialog-content",6),Jo(9,bG,2,1,"div",7),sa(),sa(),sa(),sa()),2&t&&(ws(7),Ja(e.infoTitle),ws(2),na("ngForOf",e.documentationContents))},directives:[p_,gH,mH,yh,_h,NH,FH,WH,i$],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),t})(),vG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,bH,f_,BH,a$,qH.forRoot({})]]}),t})(),_G=(()=>{class t{constructor(t){this.http=t,this.markdownContent=new Uf([])}readMarkdown(){this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(t=>{const e=this.parseMarkdown(t);this.markdownContent.next(e)})}parseMarkdown(t){const e=[],n=t.split("# ");for(const i of n)if(i.length){const t=i.split("\n\n");e.push({title:t[0],content:t.splice(1).join("\n\n")})}return e}}return t.\u0275fac=function(e){return new(e||t)(Ci(Bv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),wG=(()=>{class t{constructor(t,e){this.dialog=t,this.infoButtonService=e,this.infoTitle="",this.subscriptions=new g,this.subscriptions.add(e.markdownContent.subscribe(t=>{t.length&&this.launchInfoDialog(t)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){this.dialog.open(yG,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:t,videoID:this.videoID}})}onDialogButtonClick(){this.infoButtonService.readMarkdown()}}return t.\u0275fac=function(e){return new(e||t)(ea(pH),ea(_G))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"mat-icon",1),fa("click",function(){return e.onDialogButtonClick()}),Za(2," info "),sa(),sa())},directives:[p_],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),t})(),xG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,vG,f_,Zv]]}),t})(),SG=(()=>{let t=class extends z${constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Hd(t=>null!=t),up(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(FU(...t),Rd(),up(1))}getOption(...t){const e=this.getPathKey(t);if(this.optionCache.has(e))return this.optionCache.get(e);const n=this.config$.pipe(FU(...t),Rd(),up(1));return this.optionCache.set(e,n),n}getPathKey(t){return`${t.length}:${t.join(".")}`}};return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$()],t.prototype,"config$",null),t=sw([F$(),wV({name:"globalConfig",defaults:null})],t),t})();!function(){const t=localStorage.getItem("ALLOW_TELEMETRY");null===t||t.toLowerCase()}();let EG=(()=>{class t{constructor(t,e){t&&function(t,e){xd(t,"mousemove").pipe(function(t,e=jd,n=BU){return i=>i.lift(new VU(t,e,n.leading,n.trailing))}(1e3),D(e=>{const{clientWidth:n,clientHeight:i}=t,{clientX:r,clientY:s}=e;return[r,s,n,i].join("_")})).subscribe(t=>e.event("webpage","mousemove",t))}(t.body,e)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(W$))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function CG(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!0)}),Za(1),sa()}if(2&t){const t=va();ws(1),tl(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function OG(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!1)}),Za(1,"Opt out"),sa()}}let TG=(()=>{class t{constructor(t,e,n){this.consentService=e,this.data=n,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}get allowTelemetry(){return this.consentService.consent}dismiss(){this.data.preClose()}submit(t){this.consentService.setConsent(t?"given":"rescinded"),this.dismiss()}showButton(t){const{allowTelemetry:e}=this;return"not-set"===e||("opt-in"===t?"rescinded"===e:"given"===e)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Y$),ea(F_))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,e){1&t&&(ra(0,"p"),Za(1,"We log usage to improve this service."),sa(),Jo(2,CG,2,1,"button",0),Jo(3,OG,2,0,"button",0)),2&t&&(ws(2),na("ngIf",e.showButton("opt-in")),ws(1),na("ngIf",e.showButton("opt-out")))},directives:[_h,__],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),t})(),kG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_]]}),t})();const AG=new oi("Default theme class"),PG="light-theme",IG="dark-theme";let MG=(()=>{class t{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(e){const{injector:n,location:i}=e;n.get(t).initialize(i,n)}getTheme(){return this.theme}setTheme(t){t!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(t),this.theme=t)}resetTheme(){this.setTheme(this.defaultTheme)}initialize(t,e){this.element=t,this.injector=e,this.applyThemeClass(this.getTheme())}applyThemeClass(t,e="add"){var n;const{element:i,injector:r}=this;if(!t||!i||!r)return;const s=r.get(Il,null);if(!s)return;const o=i.nativeElement,a=null===(n=r.get(gf,null))||void 0===n?void 0:n.getContainerElement(),l="add"===e?"addClass":"removeClass";s[l](o,t),a&&s[l](a,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(AG,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();var DG;const RG={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["assets/kpmp/data/rui_locations.jsonld","assets/sparc/data/rui_locations.jsonld","assets/gtex/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(DG=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==DG?DG:"",useRemoteApi:!0,remoteApiEndpoint:"https://ccf-api.herokuapp.com/v1"},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"},NG=["*",[["mat-toolbar-row"]]],LG=["*","mat-toolbar-row"],jG=jy(class{constructor(t){this._elementRef=t}});let FG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]}),t})(),BG=(()=>{class t extends jG{constructor(t,e,n){super(t),this._platform=e,this._document=n}ngAfterViewInit(){this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(()=>this._checkToolbarMixedModes()))}_checkToolbarMixedModes(){}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(Yu))},t.\u0275cmp=Jt({type:t,selectors:[["mat-toolbar"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,FG,5),2&t){let t;Wc(t=Yc())&&(e._toolbarRows=t)}},hostAttrs:[1,"mat-toolbar"],hostVars:4,hostBindings:function(t,e){2&t&&ja("mat-toolbar-multiple-rows",e._toolbarRows.length>0)("mat-toolbar-single-row",0===e._toolbarRows.length)},inputs:{color:"color"},exportAs:["matToolbar"],features:[jo],ngContentSelectors:LG,decls:2,vars:0,template:function(t,e){1&t&&(wa(NG),xa(0),xa(1,1))},styles:[".cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}\n"],encapsulation:2,changeDetection:0}),t})(),VG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny],Ny]}),t})(),zG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,VG,rw]]}),t})();function UG(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}let HG;function $G(){return HG||(HG=function(t,e){const n=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let t;return new Promise(e=>{const n=()=>indexedDB.databases().finally(e);t=setInterval(n,100),n()}).finally(()=>clearInterval(t))}().then(()=>{const t=indexedDB.open("keyval-store");return t.onupgradeneeded=()=>t.result.createObjectStore(e),UG(t)});return(t,i)=>n.then(n=>i(n.transaction(e,t).objectStore(e)))}(0,"keyval")),HG}function GG(t,e=$G()){return e("readonly",e=>UG(e.get(t)))}var WG=n(71440),qG=n(70698),XG=n(7445),YG=n.n(XG),KG=n(23815),QG=n(31609);const ZG=WG.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},WG.DataFactory),JG={x:ZG("rdf"),type:ZG("rdf")("type")},tW={x:ZG("rdfs"),label:ZG("rdfs")("label"),comment:ZG("rdfs")("comment"),isDefinedBy:ZG("rdfs")("isDefinedBy"),seeAlso:ZG("rdfs")("seeAlso")},eW={x:ZG("entity"),id:ZG("entity")("id"),label:tW.label,description:tW.comment,link:tW.seeAlso,sex:ZG("entity")("sex"),age:ZG("entity")("age"),bmi:ZG("entity")("bmi"),Male:WG.DataFactory.literal("Male"),Female:WG.DataFactory.literal("Female"),consortiumName:ZG("entity")("consortium_name"),providerName:ZG("entity")("provider_name"),providerUUID:ZG("entity")("provider_uuid"),donor:ZG("entity")("has_donor"),sections:ZG("entity")("has_tissue_section"),datasets:ZG("entity")("has_dataset"),sampleType:ZG("entity")("sample_type"),TissueBlock:WG.DataFactory.literal("Tissue Block"),TissueSection:WG.DataFactory.literal("Tissue Section"),NonStandard:WG.DataFactory.literal("Non-standard"),sectionCount:ZG("entity")("section_count"),sectionSize:ZG("entity")("section_size"),sectionUnits:ZG("entity")("section_units"),sectionNumber:ZG("entity")("section_number"),spatialEntity:ZG("entity")("has_spatial_entity"),ontologyTerms:ZG("entity")("has_ontology_term"),technology:ZG("entity")("technology"),thumbnail:ZG("entity")("has_thumbnail")},nW=ZG("ccf"),iW={x:nW,ontologyNode:{label:nW("ccf_preferred_label"),parent:nW("ccf_part_of"),children:nW("ccf_part_of"),rui_rank:nW("ccf_rui_rank"),synonymLabels:WG.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:nW("VHFemale"),Male:nW("VHMale"),BothSexes:nW("VHBothSexes"),FemaleOrgans:nW("VHFemaleOrgans"),MaleOrgans:nW("VHMaleOrgans")},SpatialObjectReference:nW("SpatialObjectReference"),SpatialEntity:nW("SpatialEntity"),SpatialPlacement:nW("SpatialPlacement"),spatialObjectReference:{file:nW("has_object_file"),file_format:nW("has_object_file_format"),file_subpath:nW("has_object_file_subpath")},extractionSet:{label:tW.label,rui_rank:nW("ccf_rui_rank")},spatialEntity:{label:tW.label,comment:tW.comment,creator:ZG("dc")("creator"),creator_first_name:nW("creator_first_name"),creator_last_name:nW("creator_last_name"),creator_orcid:nW("creator_orcid"),creation_date:nW("creation_date"),updated_date:nW("updated_date"),ccf_annotations:nW("ccf_annotation"),representation_of:nW("ccf_representation_of"),reference_organ:nW("anatomical_structure_of"),extraction_set_for:nW("extraction_set_for"),extraction_set:nW("extraction_site_for"),sex:nW("has_sex"),side:nW("has_side"),rui_rank:nW("ccf_rui_rank"),slice_thickness:nW("ccf_slice_thickness"),slice_count:nW("ccf_slice_count"),x_dimension:nW("has_x_dimension"),y_dimension:nW("has_y_dimension"),z_dimension:nW("has_z_dimension"),dimension_units:nW("has_dimension_units"),object:nW("has_object_reference")},spatialPlacement:{source:nW("has_placement_source"),target:nW("has_placement_target"),placement_date:nW("has_placement_date"),x_scaling:nW("has_x_scaling"),y_scaling:nW("has_y_scaling"),z_scaling:nW("has_z_scaling"),scaling_units:nW("has_scaling_units"),x_rotation:nW("has_x_rotation"),y_rotation:nW("has_y_rotation"),z_rotation:nW("has_z_rotation"),w_rotation:nW("has_theta_rotation"),rotation_order:nW("has_rotation_order"),rotation_units:nW("has_rotation_units"),x_translation:nW("has_x_translation"),y_translation:nW("has_y_translation"),z_translation:nW("has_z_translation"),translation_units:nW("has_translation_units")}},rW={x:ZG("uberon")},sW=(ZG("lmha"),{bladder:rW.x("0001255"),body:rW.x("0013702"),brain:rW.x("0000955"),colon:rW.x("0001155"),heart:rW.x("0000948"),kidney:rW.x("0002113"),large_intestine:rW.x("0000059"),left_kidney:rW.x("0004538"),left_lung:rW.x("0002168"),left_ureter:rW.x("0001223"),liver:rW.x("0002107"),lung:rW.x("0002048"),respiratory_system:rW.x("0001004"),lymph_node:rW.x("0000029"),pelvis:rW.x("0001270"),rectum:rW.x("0001052"),right_kidney:rW.x("0004539"),right_lung:rW.x("0002167"),right_ureter:rW.x("0001222"),skin:rW.x("0002097"),small_intestine:rW.x("0002108"),spleen:rW.x("0002106"),thymus:rW.x("0002370"),ureter:rW.x("0000056"),vasculature:rW.x("0002049")});function oW(t){const e={};return Object.entries(t).forEach(([t,n])=>{e[n.id]=t}),e}const aW={spatialObjectReference:oW(iW.spatialObjectReference),spatialEntity:oW(iW.spatialEntity),spatialPlacement:oW(iW.spatialPlacement)};function lW(t,e,n,i){const r={"@id":e,"@type":n};return t.some(t=>{const e=i[t.predicate.id];if(e){const n="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(r,e,n)}return!1},WG.DataFactory.namedNode(e),null,null,null),r}const cW=(0,KG.memoize)(function(t,e){return lW(t,e,"SpatialObjectReference",aW.spatialObjectReference)},(t,e)=>e),uW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"ExtractionSet",aW.spatialEntity);return n.extractionSites=(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.extraction_set,e,null).map(e=>fW(t,e.id)),["rui_rank"]),n},(t,e)=>e),hW=(0,KG.memoize)(function(t,e){return(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.extraction_set_for,e,null).map(e=>uW(t,e.id)),["rui_rank"])},(t,e)=>e),dW=(0,KG.memoize)(function(t,e){return(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.reference_organ,e,null).map(e=>fW(t,e.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(t,e)=>e),pW=(0,KG.memoize)(function(t){const e=[];return t.forEach(n=>{n.subject.id===n.object.id&&e.push(fW(t,n.subject.id))},null,iW.spatialEntity.reference_organ,null,null),(0,KG.sortBy)(e,["rui_rank"])}),fW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"SpatialEntity",aW.spatialEntity);return n.object&&(n.object=cW(t,n.object)),n.ccf_annotations&&(n.ccf_annotations=t.getObjects(e,iW.spatialEntity.ccf_annotations,null).map(t=>t.id)),t.forSubjects(t=>n.entityId=t.id,eW.spatialEntity,e,null),n},(t,e)=>e),gW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"SpatialPlacement",aW.spatialPlacement);return n.source&&(n.source=fW(t,n.source)),n.target&&(n.target=fW(t,n.target)),n},(t,e)=>e),mW=(0,KG.memoize)(function(t,e){const n=t.getObjects(WG.DataFactory.namedNode(e),eW.spatialEntity,null);if(n.length>0)return fW(t,n[0].id)},(t,e)=>e);function bW(t,e){const n=e;let i;switch(n.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[n.x_translation,n.y_translation,n.z_translation].map(t=>t*i),s=[n.x_rotation,n.y_rotation,n.z_rotation].map(NS),o=[n.x_scaling,n.y_scaling,n.z_scaling];return t.translate(r).rotateXYZ(s).scale(o)}class yW{constructor(t){this.db=t,this.createGraph()}createGraph(){this.graph=new qG.DirectedGraph;const t=this.db.store;t.forSubjects(t=>{this.addNode(t.id,"SpatialObjectReference")},JG.type,iW.SpatialObjectReference,null),t.forSubjects(t=>{this.addNode(t.id,"SpatialEntity")},JG.type,iW.SpatialEntity,null);const e={};t.some(t=>(e[t.subject.id]=t.object.id,!1),null,iW.spatialPlacement.source,null,null),t.some(t=>{const n=e[t.subject.id];return n&&this.addEdge(t.subject.id,n,t.object.id,"SpatialPlacement"),!1},null,iW.spatialPlacement.target,null,null)}addNode(t,e){this.graph.mergeNode(t,{type:e})}addEdge(t,e,n,i){this.graph.mergeDirectedEdge(e,n,{type:i,id:t})}getTransformationMatrix(t,e){if(t===e)return new bT(bT.IDENTITY);if(!this.graph.hasNode(t)||!this.graph.hasNode(e))return;const n=this.db.store,i=new bT(bT.IDENTITY),r=YG()(this.graph,t,e);if(r&&r.length>0){r.reverse();let t="";for(const e of r){if(t){const r=this.graph.getEdgeAttribute(e,t,"id");bW(i,gW(n,r))}t=e}return i}}}class vW{constructor(t){this.db=t}getSpatialEntity(t){return fW(this.db.store,t)}getExtractionSets(t){return hW(this.db.store,t)}getExtractionSet(t){return uW(this.db.store,t)}getAnatomicalStructures(t){return dW(this.db.store,t)}getReferenceOrgans(){return pW(this.db.store)}getReferenceBody(t){let e;switch(null==t?void 0:t.sex){case"Male":e=iW.spatial.Male.id;break;case"Female":e=iW.spatial.Female.id;break;case"Both":default:e=iW.spatial.BothSexes.id}return this.getSpatialEntity(e)}getReferenceOrganSets(t){let e=this.getReferenceOrgans();switch(null==t?void 0:t.sex){case"Male":e=e.filter(t=>"Male"===t.sex);break;case"Female":e=e.filter(t=>"Female"===t.sex)}return(null==t?void 0:t.debug)&&(e=e.map(t=>[[t],this.getAnatomicalStructures(t["@id"])]).reduce((t,[e,n])=>t.concat(n.length>0?n:e),[])),e}getReferenceSceneNodes(t){const e=this.getReferenceBody(t);let n=[...this.getReferenceOrganSets(t).map(t=>{const n="http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of;return this.getSceneNode(t,e,{color:[255,255,255,255],opacity:n?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!n})})];return(null==t?void 0:t.debug)&&(n=n.concat([this.getSceneNode(this.getSpatialEntity(iW.x("VHRightKidney").id),e,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHLeftKidney").id),e,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC1").id),e,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC2").id),e,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC3").id),e,{color:[0,255,0,127.5],wireframe:!0})])),n.filter(t=>void 0!==t)}getReferenceOrganScene(t,e){var n,i;const r=null!==(n=void 0!==(null==e?void 0:e.sex))&&void 0!==n&&n,s=this.getReferenceOrgans().filter(n=>n.representation_of===t&&(!r||n.sex===(null==e?void 0:e.sex)));if(s.length>0){const t=s[0],n=this.getSceneNode(t,t,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),r=(null!==(i=this.db.getSpatialEntities(e))&&void 0!==i?i:[]).map(e=>this.getSceneNode(e,t,{color:[255,255,255,229.5]}));return[n].concat(r).filter(t=>void 0!==t)}return[]}getEntitySceneNodes(t){const e=this.getReferenceBody(t);return this.db.getSpatialEntities(t).map(t=>this.getSceneNode(t,e,{color:[255,255,255,229.5]})).filter(t=>void 0!==t)}getSceneNode(t,e,n={}){var i,r,s,o;const a=null===(r=null===(i=null==t?void 0:t.object)||void 0===i?void 0:i.file_format)||void 0===r?void 0:r.startsWith("model/gltf");let l=this.db.graph.getTransformationMatrix(a&&t.object?t.object["@id"]:t["@id"],e["@id"]);if(l){if(a)l=new bT(bT.IDENTITY).rotateX(NS(90)).multiplyLeft(l);else{let e;switch(t.dimension_units){case"centimeter":e=.01;break;case"millimeter":e=.001;break;case"meter":default:e=1}const n=[t.x_dimension,t.y_dimension,t.z_dimension].map(t=>t*e/2);l.scale(n)}return Object.assign({"@id":t["@id"],"@type":"SpatialSceneNode",entityId:t.entityId,ccf_annotations:t.ccf_annotations,representation_of:t.representation_of,reference_organ:t.reference_organ,scenegraph:a?null===(s=t.object)||void 0===s?void 0:s.file:void 0,scenegraphNode:a?null===(o=t.object)||void 0===o?void 0:o.file_subpath:void 0,transformMatrix:l,tooltip:t.label},n)}}getScene(t){return[...this.getReferenceSceneNodes(t),...this.getEntitySceneNodes(t)]}}const _W="https://entity.api.hubmapconsortium.org/entities/",wW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),xW={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},SW={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},EW=function(){const t={};return Object.entries(sW).forEach(([e,n])=>t[e]=n.id),t}(),CW={BL:[EW.body,EW.bladder],RK:[EW.body,EW.kidney,EW.right_kidney],LK:[EW.body,EW.kidney,EW.left_kidney],HT:[EW.body,EW.heart],LI:[EW.body,EW.large_intestine,EW.colon],SI:[EW.body,EW.small_instestine],LL:[EW.body,EW.respiratory_system,EW.lung,EW.left_lung],RL:[EW.body,EW.respiratory_system,EW.lung,EW.right_lung],LY:[EW.body,EW.lymph_node],SP:[EW.body,EW.spleen],TH:[EW.body,EW.thymus],UR:[EW.body,EW.ureter],LV:[EW.body,EW.liver],OT:[EW.body]},OW={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class TW{constructor(t,e="",n="",i){var r,s;if(this.data=t,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const o=this.data.descendants||[],a=(this.data.ancestors||[]).find(t=>"Donor"===t.entity_type);this.donor=this.getDonor(a,n);const l=this.getRuiLocation(t,this.donor);l?this.rui_location=l:this.bad=!0;const c=new Date(t.last_modified_timestamp).toLocaleDateString(),u=SW[t.group_uuid]||t.group_name,h=t.created_by_user_displayname;this["@id"]=_W+t.uuid,this.label=`Registered ${c}, ${h}, ${u}`,this.link=`${n}browse/sample/${t.uuid}`;const d={},p=[];this.sections=p;const f=[];this.datasets=f;for(const v of o.filter(t=>"Sample"===t.entity_type)){const e=this.getSection(v,t,n);d[v.submission_id]=e,p.push(e),e.section_number=null!==(r=e.section_number)&&void 0!==r?r:p.length}for(const v of o)if("Dataset"===v.entity_type){const t=this.getDataset(v,e,n,i),r=(0,KG.get)(v,["ingest_metadata","metadata","tissue_id"]);d[r]?null===(s=d[r].datasets)||void 0===s||s.push(t):f.push(t)}const g=null!=l?l:{},m=`${g.x_dimension} x ${g.y_dimension} x ${g.z_dimension} ${g.dimension_units}`;this.section_count=g.slice_count||p.length;const b=parseFloat((g.slice_thickness||(g.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=b;const y=g.dimension_units||"millimeter";this.section_units=y,this.description=`${m}, ${b} ${y}, ${t.specimen_type}, ${this.section_count} Sections`,p.forEach((t,e)=>{t.description=`${g.x_dimension} x ${g.y_dimension} x ${b} ${y}, ${b} ${y}, ${t.description}`,t.section_number=e+1})}getSection(t,e,n){const i=new Date(t.last_modified_timestamp).toLocaleDateString();return{"@id":_W+t.uuid,"@type":"Sample",label:`Registered ${i}, ${t.created_by_user_displayname}, ${SW[t.group_uuid]||t.group_name}`,description:`${e.specimen_type}`,link:`${n}browse/sample/${t.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(t,e="",n="",i){var r;const s=new Date(t.last_modified_timestamp).toLocaleDateString(),o=SW[t.group_uuid]||t.group_name,a=t.created_by_user_displayname,l=[...t.data_types,(0,KG.get)(t,["ingest_metadata","metadata","assay_type"],"")],c=l.join("|").toLowerCase();let u,h="assets/icons/ico-unknown.svg";return-1!==c.indexOf("10x")?(u="10x",h="assets/icons/ico-bulk-10x.svg"):-1!==c.indexOf("af")?(u="AF",h="assets/icons/ico-spatial-af.svg"):-1!==c.indexOf("codex")?(u="CODEX",h="assets/icons/ico-spatial-codex.svg"):-1!==c.indexOf("imc")?(u="IMC",h="assets/icons/ico-spatial-imc.svg"):-1!==c.indexOf("lc")&&-1===c.indexOf("af")?(u="LC",h="assets/icons/ico-bulk-lc.svg"):u=-1!==c.indexOf("maldi")?"MALDI":-1!==c.indexOf("pas")?"PAS":"OTHER",h=null!==(r=this.getDatasetThumbnail(t,e,i))&&void 0!==r?r:h,{"@id":_W+t.uuid,"@type":"Dataset",label:`Registered ${s}, ${a}, ${o}`,description:`Data/Assay Types: ${l.join(", ")}`,link:`${n}browse/dataset/${t.uuid}`,technology:u,thumbnail:h}}getDatasetThumbnail(t,e,n){if(t.thumbnail_file){const i=t.thumbnail_file;return`${e}/${i.file_uuid}/${i.filename}`+(n?`?token=${n}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===t.group_uuid){const i=(0,KG.get)(t,"metadata.files",[]).filter(t=>/\.(ome\.tif|ome\.tiff)$/.test(t.rel_path)).filter(t=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(t.rel_path)).filter(t=>wW.has(t.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(i=>`${e}/${t.uuid}/${i.rel_path}`+(n?`?token=${n}`:""));if(i.length>0){const t=i[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(wW.has(t))return`assets/thumbnails/TMC-Vanderbilt/DR1/${t}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===t.group_uuid){const e=xW[t.hubmap_id];if(e)return`assets/thumbnails/TMC-Florida/${e}`}}getDonor(t,e){const n=(t.description||"").toLowerCase();let i;n.includes("female")?i="Female":n.includes("male")&&(i="Male");const r=n.match(/age ([0-9]+)/);let s,o;r&&(s=(0,KG.toNumber)(r[1]));for(const u of(0,KG.get)(t,"metadata.organ_donor_data",[]))"Feminine gender"===u.preferred_term||"Female"===u.preferred_term?i="Female":"Masculine gender"===u.preferred_term||"Male"===u.preferred_term?i="Male":"Current chronological age"===u.preferred_term||"Age"===u.preferred_term?s=(0,KG.toNumber)(u.data_value):"Body mass index"===u.preferred_term&&(o=(0,KG.toNumber)(u.data_value));let a="";i&&s&&(a+=`${i}, Age ${s}`,o&&(a+=`, BMI ${o.toFixed(1)}`));const l=new Date(t.last_modified_timestamp).toLocaleDateString(),c=SW[t.group_uuid]||t.group_name;return{"@id":_W+t.uuid,"@type":"Donor",label:a,description:`Entered ${l}, ${t.created_by_user_displayname}, ${c}`,link:`${e}browse/donor/${t.uuid}`,age:s,sex:i,bmi:o,consortium_name:"HuBMAP",provider_name:c,provider_uuid:t.group_uuid,samples:[]}}getRuiLocation(t,e){var n;const i=(t.ancestors||[]).find(t=>"Sample"===t.entity_type&&"organ"===t.specimen_type),r=CW[null==i?void 0:i.organ]||[EW.body];let s,o=t.rui_location;if(o&&("string"==typeof o&&(o=JSON.parse(o)),o.alignment_id?console.log("Detected a deprecated rui_location",t.uuid):o["@id"]&&(s=o)),s){s.ccf_annotations=r.concat(s.ccf_annotations||[]);const t=null!==(n=(0,KG.get)(s,["placement","target"]))&&void 0!==n?n:"";t.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,KG.set)(s,["placement","target"],t.replace("#VHSpleenCC","Male"===e.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===t||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===t)&&(0,KG.set)(s,["placement","target"],"Male"===e.sex?t.replace("#VH","#VHM")+"_Patch":t.replace("#VH","#VHF")+"_Patch")}return s}getTissueBlock(){return(0,KG.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function kW(t,e,n,i,r="",s=""){return lw(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(t).then(t=>t.ok?t.json():void 0).catch(()=>{});else if("search-api"===e){const e={"Content-type":"application/json"};i&&i.length>0&&(e.Authorization=`Bearer ${i}`),o=yield fetch(t,{method:"POST",headers:e,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:{exists:{field:"rui_location"}}})}).then(t=>t.ok?t.json():void 0).catch(()=>{})}if(o)return function(t,e="",n="",i,r=!1){const s={},o=(0,KG.get)(t,"hits.hits",[]).map(t=>(0,KG.get)(t,"_source",{})).map(t=>new TW(t,e,n,i).toJsonLd());for(const l of o){const t=l["@id"];s[t]?s[t].samples.push(l.samples[0]):s[t]=l}const a=Object.values(s);return r&&(function(t){let e=[],n=0;for(const i of t.filter(t=>t.samples.length>1)){const t=i.samples;for(let i=0;it["@id"]===r)&&(t[i].deleteMe=!0,n++)}i.samples=t.filter(t=>!0!==t.deleteMe)}n>0&&console.log(`\u26a0 ${n} sections identified as blocks`)}(a),console.log(a.map(t=>Object.assign({"@context":OW},t)))),{"@context":OW,"@graph":a}}(o,r,s,i);console.warn(`Unable to load ${t} as HuBMAP Data`)})}function AW(t,e,n){var i;const r=new Map,s=new Set;t.some(t=>{var n;return e.has(t.subject.id)&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.donor,null,null);const o=n(s),a=new Set;for(const l of o)for(const t of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(t);return a}function PW(t,e){return n=>t.has(n.id)?e.add(n.id):void 0}const IW={[iW.ontologyNode.label.id]:"label",[iW.ontologyNode.parent.id]:"parent",[iW.ontologyNode.synonymLabels.id]:"synonymLabels"};function MW(t,e){const n=WG.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return t.some(t=>{const e=IW[t.predicate.id];if(e){const n="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;"synonymLabels"===e?i.synonymLabels.push(n):(0,KG.set)(i,e,n)}return!1},n,null,null,null),i.children=t.getSubjects(iW.ontologyNode.children,n,null).map(t=>t.id),i}const DW={[eW.label.id]:"label",[eW.description.id]:"description",[eW.link.id]:"link"},RW=Object.assign(Object.assign({},DW),{[eW.providerName.id]:"providerName"}),NW=Object.assign(Object.assign({},DW),{[eW.technology.id]:"technology",[eW.thumbnail.id]:"thumbnail"}),LW=Object.assign(Object.assign({},DW),{[eW.sampleType.id]:"sampleType",[eW.sectionNumber.id]:"sectionNumber",[eW.datasets.id]:"datasets"}),jW=Object.assign(Object.assign({},DW),{[eW.sampleType.id]:"sampleType",[eW.sectionCount.id]:"sectionCount",[eW.sectionSize.id]:"sectionSize",[eW.sectionUnits.id]:"sectionUnits",[eW.donor.id]:"donor",[eW.spatialEntity.id]:"spatialEntityId",[eW.sections.id]:"sections",[eW.datasets.id]:"datasets"}),FW=(0,KG.memoize)(function(t,e){const n={"@id":e,"@type":"Donor"};return t.some(t=>{const e=RW[t.predicate.id];if(e){const i="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(n,e,i)}return!1},WG.DataFactory.namedNode(e),null,null,null),n},(t,e)=>e);function BW(t,e){const n={"@id":e,"@type":"Dataset"};return t.some(t=>{const e=NW[t.predicate.id];if(e){const i="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(n,e,i)}return!1},WG.DataFactory.namedNode(e),null,null,null),n}const VW=(0,KG.memoize)(function(t,e){const n={"@id":e,"@type":"Sample",sections:[],datasets:[]};return t.some(e=>{const i=jW[e.predicate.id];if(i){const r="Literal"===e.object.termType?(0,QG.fromRdf)(e.object):e.object.id;if("sections"===i){const e=function(t,e){const n={"@id":e,"@type":"Sample",datasets:[]};return t.some(e=>{const i=LW[e.predicate.id];if(i){const r="Literal"===e.object.termType?(0,QG.fromRdf)(e.object):e.object.id;if("datasets"===i){const e=BW(t,r);n[i].push(e)}else(0,KG.set)(n,i,r)}return!1},WG.DataFactory.namedNode(e),null,null,null),n}(t,r);n[i].push(e)}else if("datasets"===i){const e=BW(t,r);n[i].push(e)}else"donor"===i?n[i]=FW(t,r):(0,KG.set)(n,i,r)}return!1},WG.DataFactory.namedNode(e),null,null,null),n},(t,e)=>e),zW={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class UW{constructor(t=zW){this.options=t,this.store=new WG.Store(void 0,{factory:WG.DataFactory}),this.graph=new yW(this),this.scene=new vW(this)}connect(t,e=!1){return lw(this,void 0,void 0,function*(){return t&&(this.options=t),this.initializing||(this.initializing=e?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return lw(this,void 0,void 0,function*(){const t=(new Date).getTime(),e="ccf-database.last_modified",n="ccf-database",i=yield GG(e).catch(()=>{});let r;i&&t-new Date(+i).getTime()>36e5?yield function(t,e=$G()){return e("readwrite",e=>(t.forEach(t=>e.delete(t)),UG(e.transaction)))}([n,e]).catch(()=>{}):r=yield GG(n).catch(()=>{}),r?yield this.deserialize(r):(yield this.doConnect(),function(t,e=$G()){return e("readwrite",e=>(t.forEach(t=>e.put(t[1],t[0])),UG(e.transaction)))}([[n,this.serialize()],[e,""+t]]).catch(()=>{}))})}doConnect(){var t,e;return lw(this,void 0,void 0,function*(){const n=[],i=null!==(e=null===(t=this.options.dataSources)||void 0===t?void 0:t.concat())&&void 0!==e?e:[],r=this.options.ccfOwlUrl;if(r.endsWith(".n3store.json")){const t=yield fetch(r).then(t=>t.text()).catch(()=>console.log("Couldn't locate serialized store."));t&&(this.store=(0,WG.deserializeN3Store)(t,WG.DataFactory))}else(null==r?void 0:r.length)>0&&i.push(r);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?i.push(this.options.hubmapDataUrl):n.push(kW(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(t=>{if(t)return this.addDataSources([t])}))),n.push(this.addDataSources(i)),yield Promise.all(n),yield this.synchronize()})}addDataSources(t,e){return lw(this,void 0,void 0,function*(){const n=null!=e?e:this.store;return yield Promise.all(t.map(t=>lw(this,void 0,void 0,function*(){"string"==typeof t?t.endsWith("jsonld")?yield(0,WG.addJsonLdToStore)(t,n):t.endsWith("n3")?yield(0,WG.addN3ToStore)(t,n):(t.endsWith("rdf")||t.endsWith("owl")||t.endsWith("xml"))&&(yield(0,WG.addRdfXmlToStore)(t,n)):yield(0,WG.addJsonLdToStore)(t,n)}))),this})}synchronize(){return lw(this,void 0,void 0,function*(){return yield new Promise(t=>{setTimeout(t,500)}),this.graph.createGraph(),this})}serialize(){return(0,WG.serializeN3Store)(this.store)}deserialize(t){return lw(this,void 0,void 0,function*(){this.store=(0,WG.deserializeN3Store)(t,WG.DataFactory),this.graph=new yW(this),this.scene=new vW(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(t={}){return function(t,e){var n,i,r,s,o;let a=function(t){const e=new Set;return t.forSubjects(t=>e.add(t.id),eW.spatialEntity,null,null),e}(t);if(a.size>0&&(a=function(t,e,n=!0){const i=new Set;if(t.forSubjects(PW(e,i),eW.spatialEntity,null,null),!n){const t=new Set;return e.forEach(e=>i.has(e)?void 0:t.add(e)),t}return i}(t,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const n=e.sex;a=AW(t,a,e=>function(t,e,n){const i=new Set;return t.forSubjects(PW(e,i),eW.sex,eW[n],null),i}(t,e,n))}if(a.size>0&&(null===(n=e.tmc)||void 0===n?void 0:n.length)>0&&(a=AW(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.literal(r);t.forSubjects(PW(e,i),eW.providerName,n,null)}return i}(t,n,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(t,e,n){var i;const r=new Map,s=new Set,o=new Set;t.some(t=>(e.has(t.subject.id)&&o.add(t.object.id),!1),null,eW.sections,null,null),t.some(t=>{var n;return(e.has(t.subject.id)||o.has(t.subject.id))&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.datasets,null,null);const a=n(s),l=new Set;for(const c of a)for(const t of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(t);return l}(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.literal(r);t.forSubjects(PW(e,i),eW.technology,n,null)}return i}(t,n,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(t,e,n){var i;const r=new Map,s=new Set;t.some(t=>{var n;return e.has(t.subject.id)&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.spatialEntity,null,null);const o=n(s),a=new Set;for(const l of o)for(const t of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(t);return a}(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.namedNode(r);t.forSubjects(PW(e,i),iW.spatialEntity.ccf_annotations,n,null)}return i}(t,n,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,KG.isFinite)(e.ageRange[0])&&(0,KG.isFinite)(e.ageRange[1])){const n=Math.max(...e.ageRange),i=Math.min(...e.ageRange);1===i&&110===n||(a=AW(t,a,e=>function(t,e,n,i){const r=new Set;return t.some(t=>{if(e.has(t.subject.id)){const e=(0,QG.fromRdf)(t.object);e>=n&&e<=i&&r.add(t.subject.id)}return!1},null,eW.age,null,null),r}(t,e,i,n)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,KG.isFinite)(e.bmiRange[0])&&(0,KG.isFinite)(e.bmiRange[1])){const n=Math.max(...e.bmiRange),i=Math.min(...e.bmiRange);13===i&&83===n||(a=AW(t,a,e=>function(t,e,n,i){const r=new Set;return t.some(t=>{if(e.has(t.subject.id)){const e=(0,QG.fromRdf)(t.object);e>=n&&e<=i&&r.add(t.subject.id)}return!1},null,eW.bmi,null,null),r}(t,e,i,n)))}return a}(this.store,t)}get(t){return this.store.getQuads(WG.DataFactory.namedNode(t),null,null,null)}search(t={}){return[...this.getIds(t)].map(t=>this.get(t))}getSpatialEntities(t){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>mW(this.store,t))}getDatasetTechnologyNames(){return lw(this,void 0,void 0,function*(){return function(t){const e=new Set;return t.some(t=>(e.add(t.object.value),!1),null,eW.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return lw(this,void 0,void 0,function*(){return function(t){const e=new Set;return t.some(t=>(e.add(t.object.value),!1),null,eW.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(t){return lw(this,void 0,void 0,function*(){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>VW(this.store,t))})}getAggregateResults(t){return lw(this,void 0,void 0,function*(){return function(t,e){const n=new Set;e.some(e=>(t.has(e.subject.id)&&n.add(e.object.id),!1),null,eW.donor,null,null);const i=new Set;e.some(t=>(n.has(t.subject.id)&&i.add(t.object.id),!1),null,eW.providerUUID,null,null);const r=new Set;e.forSubjects(e=>{t.has(e.id)&&r.add(e.id)},eW.spatialEntity,null,null);const s=new Set;e.some(t=>(r.has(t.subject.id)&&s.add(t.object.id),!1),null,eW.sections,null,null);const o=new Set;return e.some(t=>{const e=t.subject;return(r.has(e.id)||s.has(e.id))&&o.add(t.object.id),!1},null,eW.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:n.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([t,e])=>({label:t,count:e}))}(this.getIds(t),this.store)})}getOntologyTermOccurences(t){return lw(this,void 0,void 0,function*(){return function(t,e){const n=new Map;e.some(e=>(t.has(e.subject.id)&&(n.has(e.object.id)?n.get(e.object.id).push(e.subject.id):n.set(e.object.id,[e.subject.id])),!1),null,eW.spatialEntity,null,null);const i={};return e.some(t=>{var e,r;if(n.has(t.subject.id)){const s=null!==(r=null===(e=n.get(t.subject.id))||void 0===e?void 0:e.length)&&void 0!==r?r:0;i[t.object.id]=s+(i[t.object.id]||0)}return!1},null,iW.spatialEntity.ccf_annotations,null,null),i}(this.getIds(t),this.store)})}getOntologyTreeModel(){return lw(this,void 0,void 0,function*(){return function(t){const e={root:sW.body.id,nodes:{}},n=new Set;t.some(t=>(n.add(t.subject.id),n.add(t.predicate.id),!1),null,iW.ontologyNode.parent,null,null);for(const i of n)e.nodes[i]=MW(t,i);return e}(this.store)})}getReferenceOrgans(){return lw(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(t){return lw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(t)})}getReferenceOrganScene(t,e){return lw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(t,e)})}}const HW=Symbol("Comlink.proxy"),$W=Symbol("Comlink.endpoint"),GW=Symbol("Comlink.releaseProxy"),WW=Symbol("Comlink.thrown"),qW=t=>"object"==typeof t&&null!==t||"function"==typeof t,XW=new Map([["proxy",{canHandle:t=>qW(t)&&t[HW],serialize(t){const{port1:e,port2:n}=new MessageChannel;return YW(t,e),[n,[n]]},deserialize:t=>(t.start(),QW(t))}],["throw",{canHandle:t=>qW(t)&&WW in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}}]]);function YW(t,e=self){e.addEventListener("message",function n(i){if(!i||!i.data)return;const{id:r,type:s,path:o}=Object.assign({path:[]},i.data),a=(i.data.argumentList||[]).map(rq);let l;try{const e=o.slice(0,-1).reduce((t,e)=>t[e],t),n=o.reduce((t,e)=>t[e],t);switch(s){case"GET":l=n;break;case"SET":e[o.slice(-1)[0]]=rq(i.data.value),l=!0;break;case"APPLY":l=n.apply(e,a);break;case"CONSTRUCT":l=function(t){return Object.assign(t,{[HW]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;YW(t,n),l=function(t,e){return nq.set(t,e),t}(e,[e])}break;case"RELEASE":l=void 0;break;default:return}}catch(c){l={value:c,[WW]:0}}Promise.resolve(l).catch(t=>({value:t,[WW]:0})).then(t=>{const[i,o]=iq(t);e.postMessage(Object.assign(Object.assign({},i),{id:r}),o),"RELEASE"===s&&(e.removeEventListener("message",n),KW(e))})}),e.start&&e.start()}function KW(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function QW(t,e){return JW(t,[],e)}function ZW(t){if(t)throw new Error("Proxy has been released and is not useable")}function JW(t,e=[],n=function(){}){let i=!1;const r=new Proxy(n,{get(n,s){if(ZW(i),s===GW)return()=>sq(t,{type:"RELEASE",path:e.map(t=>t.toString())}).then(()=>{KW(t),i=!0});if("then"===s){if(0===e.length)return{then:()=>r};const n=sq(t,{type:"GET",path:e.map(t=>t.toString())}).then(rq);return n.then.bind(n)}return JW(t,[...e,s])},set(n,r,s){ZW(i);const[o,a]=iq(s);return sq(t,{type:"SET",path:[...e,r].map(t=>t.toString()),value:o},a).then(rq)},apply(n,r,s){ZW(i);const o=e[e.length-1];if(o===$W)return sq(t,{type:"ENDPOINT"}).then(rq);if("bind"===o)return JW(t,e.slice(0,-1));const[a,l]=eq(s);return sq(t,{type:"APPLY",path:e.map(t=>t.toString()),argumentList:a},l).then(rq)},construct(n,r){ZW(i);const[s,o]=eq(r);return sq(t,{type:"CONSTRUCT",path:e.map(t=>t.toString()),argumentList:s},o).then(rq)}});return r}function tq(t){return Array.prototype.concat.apply([],t)}function eq(t){const e=t.map(iq);return[e.map(t=>t[0]),tq(e.map(t=>t[1]))]}const nq=new WeakMap;function iq(t){for(const[e,n]of XW)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},nq.get(t)||[]]}function rq(t){switch(t.type){case"HANDLER":return XW.get(t.name).deserialize(t.value);case"RAW":return t.value}}function sq(t,e,n){return new Promise(i=>{const r=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.addEventListener("message",function e(n){!n.data||!n.data.id||n.data.id!==r||(t.removeEventListener("message",e),i(n.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:r},e),n)})}function oq(t,e){return t===e}let aq=(()=>{class t{constructor(t,e){this.locator=e,this.subscriptions=new g,this.dataSource=t.config$.pipe(Hd(t=>Object.keys(t).length>0),D(t=>t),Rd(oq),Qd(t=>function(t,e){return new C(n=>{let i,r;try{i=t()}catch(o){return void n.error(o)}try{r=e(i)}catch(o){return void n.error(o)}const s=(r?U(r):ep).subscribe(n);return()=>{s.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),e=>this.connectDataSource(e.source,t))),up(1))}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Qd(e=>e.getTissueBlockResults(t)),Gp(1))}getDatasetTechnologyNames(){return this.dataSource.pipe(Qd(t=>t.getDatasetTechnologyNames()),Gp(1))}getProviderNames(){return this.dataSource.pipe(Qd(t=>t.getProviderNames()),Gp(1))}getAggregateResults(t){return this.dataSource.pipe(Qd(e=>e.getAggregateResults(t)),Gp(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Qd(e=>e.getOntologyTermOccurences(t)),Gp(1))}getOntologyTreeModel(){return this.dataSource.pipe(Qd(t=>t.getOntologyTreeModel()),Gp(1))}getReferenceOrgans(){return this.dataSource.pipe(Qd(t=>t.getReferenceOrgans()),Gp(1))}getScene(t){return this.dataSource.pipe(Qd(e=>e.getScene(t)),Gp(1))}createDataSource(){let t,e=()=>{};if("undefined"==typeof Worker||RG.disableDbWorker)t=new UW;else{let n;({source:t,worker:n}=this.getWebWorkerDataSource(!0)),e=()=>lw(this,void 0,void 0,function*(){yield t[GW](),n.terminate()})}return{source:t,unsubscribe:e}}connectDataSource(t,e){return lw(this,void 0,void 0,function*(){RG.disableDbWorker&&(yield new Promise(t=>{setTimeout(t,100)}));const n=(new Date).getTime();return yield t.connect(e,!0),RG.production||console.info(`Loaded CCF database in ${((new Date).getTime()-n)/1e3}s`),t})}getWebWorkerDataSource(t=!1){let e;if(t)e=new Worker(n.tu(new URL(n.p+n.u(10),n.b)),{type:void 0});else{const t=this.locator.prepareExternalUrl("0-es2015.worker.js"),n=new Blob([`importScripts('${t}')`],{type:"application/javascript"});e=new Worker(URL.createObjectURL(n),{type:"module"})}return{source:QW(e),worker:e}}}return t.\u0275fac=function(e){return new(e||t)(Ci(SG),Ci(rh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function lq(t,e,n,i){n&&"function"!=typeof n&&(i=n);const r="function"==typeof n?n:void 0,s=new lp(t,e,i);return t=>rt(()=>s,r)(t)}const cq=(t,e)=>JSON.stringify(t)===JSON.stringify(e),uq=t=>t.map(t=>void 0!==t?JSON.parse(JSON.stringify(t)):t),hq={storageStrategy:class extends class{}{constructor(){super(...arguments),this.cachePairs=[]}add(t,e,n){this.cachePairs.push(t)}addMany(t){this.cachePairs=t}updateAtIndex(t,e){Object.assign(this.cachePairs[t],e)}update(t,e){Object.assign(this.cachePairs[t],e)}getAll(){return this.cachePairs}removeAtIndex(t){this.cachePairs.splice(t,1)}remove(t){this.cachePairs.splice(t,1)}removeAll(){this.cachePairs.length=0}},globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},dq=new P;function pq(t={}){return function(e,n,i){const r=t.cacheKey||e.constructor.name+"#"+n,s=i.value;if(i&&i.value){let e=t.storageStrategy?new t.storageStrategy:new hq.storageStrategy;const n=[];t.cacheModifier&&t.cacheModifier.subscribe(t=>e.addMany(t(e.getAll(r,this)),r,this)),Q(dq.asObservable(),t.cacheBusterObserver?t.cacheBusterObserver:np()).subscribe(t=>{e.removeAll(r,this),n.length=0}),t.cacheResolver=t.cacheResolver||hq.cacheResolver||cq,t.cacheHasher=t.cacheHasher||hq.cacheHasher||uq,i.value=function(...i){const o=e.getAll(r,this);let a=t.cacheHasher(i),l=o.find(e=>t.cacheResolver(e.parameters,a));const c=n.find(e=>t.cacheResolver(e.parameters,a));if((t.maxAge||hq.maxAge)&&l&&l.created&&((new Date).getTime()-new Date(l.created).getTime()>(t.maxAge||hq.maxAge)?(e.remove?e.remove(o.indexOf(l),l,r,this):e.removeAtIndex(o.indexOf(l),r,this),l=null):(t.slidingExpiration||hq.slidingExpiration)&&(l.created=new Date,e.update?e.update(o.indexOf(l),l,r,this):e.updateAtIndex(o.indexOf(l),l,r,this))),l){const e=wd(l.response);return t.async?e.pipe(uU(0)):e}if(c)return c.response;{const l=s.call(this,...i).pipe(mv(()=>{const e=n.find(e=>t.cacheResolver(e.parameters,a));n.splice(n.indexOf(e),1)}),$f(n=>{(!t.shouldCacheDecider||t.shouldCacheDecider(n))&&((!(t.maxCacheCount||hq.maxCacheCount)||1===(t.maxCacheCount||hq.maxCacheCount)||(t.maxCacheCount||hq.maxCacheCount)&&(t.maxCacheCount||hq.maxCacheCount)t.map(t=>Object.assign(Object.assign({},t),{transformMatrix:new bT(t.transformMatrix)}))))}doFetch(t,e){const{globalConfig:n,http:i}=this,r=this.filterToParams(e);return n.getOption("remoteApiEndpoint").pipe(D(e=>`${e}/${t}`),Qd(t=>i.get(t,{params:this.withToken(r),responseType:"json"})),up(1))}filterToParams(t={}){return Object.keys(t).sort().reduce((e,n)=>{const i=t[n];return(t=>null==t||""===t||Array.isArray(t)&&0===t.length)(i)?e:e.set(n,(t=>Array.isArray(t)?t.join(","):`${t}`)(i))},new Tv)}withToken(t){const{globalConfig:{snapshot:{hubmapToken:e}}}=this;return e?t.set("token",e):t}}fq.\u0275fac=function(t){return new(t||fq)(Ci(SG),Ci(Bv))},fq.\u0275prov=xt({token:fq,factory:fq.\u0275fac,providedIn:"root"}),sw([pq()],fq.prototype,"getProviderNames",null),sw([pq()],fq.prototype,"getDatasetTechnologyNames",null),sw([pq()],fq.prototype,"getOntologyTreeModel",null),sw([pq()],fq.prototype,"getReferenceOrgans",null),sw([pq()],fq.prototype,"getTissueBlockResults",null),sw([pq()],fq.prototype,"getAggregateResults",null),sw([pq()],fq.prototype,"getOntologyTermOccurences",null),sw([pq()],fq.prototype,"getScene",null);let gq=(()=>{class t{constructor(t,e,n){this.impl$=t.config$.pipe(D(t=>!!t.useRemoteApi&&!!t.remoteApiEndpoint),D(t=>t?n:e),Rd(),up(1))}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getReferenceOrgans(){return this.forwardCall("getReferenceOrgans")}getTissueBlockResults(t){return this.forwardCall("getTissueBlockResults",t)}getAggregateResults(t){return this.forwardCall("getAggregateResults",t)}getOntologyTermOccurences(t){return this.forwardCall("getOntologyTermOccurences",t)}getScene(t){return this.forwardCall("getScene",t)}forwardCall(t,...e){return this.impl$.pipe(Qd(n=>n[t](...e)))}}return t.\u0275fac=function(e){return new(e||t)(Ci(SG),Ci(aq),Ci(fq))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),mq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),bq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:au,useValue:MG.initialize,multi:!0},MG]}),t})(),yq=(()=>{class t{constructor(t,e){this.accessor=t,this.injector=e}static forRoot(e=[]){return{ngModule:t,providers:[w$,_$,y$,...e]}}}return t.\u0275fac=function(e){return new(e||t)(Ci(w$,2),Ci(_$,2))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const vq=(t,e)=>((t,e)=>new Array(e+1).join("0"))(0,e-t.toString().length)+t;class _q{constructor(t,e,n){this.action=t,this.store=e,this.logWriter=n}dispatched(t){const e=VB(this.action),n=function(t){return vq(t.getHours(),2)+":"+vq(t.getMinutes(),2)+":"+vq(t.getSeconds(),2)+"."+vq(t.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${e} @ ${n}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",t)}completed(t){this.logWriter.logGreen("next state",t),this.logWriter.endGroup()}errored(t){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",t),this.logWriter.endGroup()}_hasPayload(t){return this._getNonEmptyProperties(t).length>0}_getNonEmptyProperties(t){return Object.keys(t).map(e=>t[e]).filter(t=>void 0!==t)}}class wq{constructor(t){this.options=t,this.options=this.options||{},this.logger=t.logger||console}startGroup(t){const e=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{e.call(this.logger,t)}catch(n){console.log(t)}}endGroup(){try{this.logger.groupEnd()}catch(t){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(t,e){this.log(t,"color: #9E9E9E; font-weight: bold",e)}logGreen(t,e){this.log(t,"color: #4CAF50; font-weight: bold",e)}logRedish(t,e){this.log(t,"color: #FD8182; font-weight: bold",e)}log(t,e,n){this.isIE()?this.logger.log(t,n):this.logger.log("%c "+t,e,n)}isIE(){const t="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let e=!1;const n=t.indexOf("MSIE "),i=t.indexOf("Trident/");return(n>-1||i>-1)&&(e=!0),e}}const xq=new oi("NGXS_LOGGER_PLUGIN_OPTIONS");let Sq=(()=>{class t{constructor(t,e){this._options=t,this._injector=e}handle(t,e,n){if(this._options.disabled||!this._options.filter(e,t))return n(t,e);this._logWriter=this._logWriter||new wq(this._options),this._store=this._store||this._injector.get(pV);const i=new _q(e,this._store,this._logWriter);return i.dispatched(t),n(t,e).pipe($f(t=>{i.completed(t)}),pv(t=>{throw i.errored(t),t}))}}return t.\u0275fac=function(e){return new(e||t)(Ci(xq),Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Eq=new oi("LOGGER_USER_OPTIONS");function Cq(t){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},t)}let Oq=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[{provide:MB,useClass:Sq,multi:!0},{provide:Eq,useValue:e},{provide:xq,useFactory:Cq,deps:[Eq]}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Tq=new RegExp("[^#a-f\\d]","gi"),kq=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),Aq=["#FF8800","#2979ff","#ffd740","#b92dff","#da326f","#7323e2","#acf32b","#82B1FF","#E040FB","#00E5FF"].map((t,e)=>{const n=function(t,e={}){if("string"!=typeof t||Tq.test(t)||!kq.test(t))throw new TypeError("Expected a valid hex string");let n=1;8===(t=t.replace(/^#/,"")).length&&(n=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(n=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const i=Number.parseInt(t,16),r=i>>16,s=i>>8&255,o=255&i,a="number"==typeof e.alpha?e.alpha:n;return"array"===e.format?[r,s,o,a]:"css"===e.format?`rgb(${r} ${s} ${o}${1===a?"":` / ${Number((100*a).toFixed(2))}%`})`:{red:r,green:s,blue:o,alpha:a}}(t,{format:"array"});return n[3]=255,{color:t,rgba:n,rank:e}});let Pq=class extends z${constructor(){super(...arguments),this.forcedUnassignment=new P,this.forcedUnassignment$=this.forcedUnassignment.asObservable(),this.colorAssignments$=this.state$.pipe(FU("colorAssignments"),Rd()),this.colorAssignmentsList$=this.state$.pipe(FU("colorAssignmentsList"),Rd())}getColor(t){const{colorAssignments:e}=this.snapshot;return e[t]}assignColor(t,e=!1){let{colorAssignments:n,colorAssignmentsList:i,colorsAvailable:r}=this.snapshot;e&&(r=this.snapshot.colorPalette.concat(),i=[],n={});let s=n[t];return s||(r.length>0?s=r[0]:(s=i[i.length-1].color,i=i.slice(0,-1),this.forcedUnassignment.next()),r=r.filter(t=>t.color!==s.color),i=[{color:s,key:t}].concat(i),n=i.reduce((t,e,n)=>(t[e.key]=Object.assign(Object.assign({},e.color),{rank:n}),t),{}),this.ctx.patchState({colorsAvailable:r,colorAssignments:n,colorAssignmentsList:i})),s}unassignColor(t){let{colorAssignments:e,colorAssignmentsList:n,colorsAvailable:i}=this.snapshot;const r=e[t];r&&(i=[r].concat(i),n=n.filter(t=>t.color.color!==r.color),e=n.reduce((t,e,n)=>(t[e.key]=Object.assign(Object.assign({},e.color),{rank:n}),t),{}),this.ctx.patchState({colorsAvailable:i,colorAssignments:e,colorAssignmentsList:n}))}};function Iq(t,e){return n=>n.lift(new Mq(t,e))}Pq.\u0275fac=function(){let t;return function(e){return(t||(t=ei(Pq)))(e||Pq)}}(),Pq.\u0275prov=xt({token:Pq,factory:Pq.\u0275fac}),sw([L$(),ow(0,j$("key")),ow(1,j$("doReset"))],Pq.prototype,"assignColor",null),sw([L$(),ow(0,j$("key"))],Pq.prototype,"unassignColor",null),Pq=sw([F$(),wV({name:"colors",defaults:{colorPalette:Aq.concat(),colorsAvailable:Aq.concat(),colorAssignments:{},colorAssignmentsList:[]}})],Pq);class Mq{constructor(t,e){this.keySelector=t,this.flushes=e}call(t,e){return e.subscribe(new Dq(t,this.keySelector,this.flushes))}}class Dq extends ${constructor(t,e,n){super(t),this.keySelector=e,this.values=new Set,n&&this.add(G(n,new H(this)))}notifyNext(){this.values.clear()}notifyError(t){this._error(t)}_next(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)}_useKeySelector(t){let e;const{destination:n}=this;try{e=this.keySelector(t)}catch(i){return void n.error(i)}this._finalizeNext(e,t)}_finalizeNext(t,e){const{values:n}=this;n.has(t)||(n.add(t),this.destination.next(e))}}const Rq={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"]};var Nq=(()=>(function(t){t.Running="running",t.Completed="completed"}(Nq||(Nq={})),Nq))();function Lq(t){return()=>t.next(Nq.Completed)}function jq(t,e){return n=>n.pipe(Qd(t),$f(e),lq(1),Z())}let Fq=class extends V${constructor(t){super(),this.source=t,this._tissueBlockDataQueryStatus$=new lp(1),this._aggregateDataQueryStatus$=new lp(1),this._termOccurencesDataQueryStatus$=new lp(1),this._sceneDataQueryStatus$=new lp(1),this._technologyFilterQueryStatus$=new lp(1),this._providerFilterQueryStatus$=new lp(1),this.ontologyTermsFullData$=new lp(1),this.filter$=this.state$.pipe(FU("filter")),this.tissueBlockData$=this.filter$.pipe(jq(this.tissueBlockData,Lq(this._tissueBlockDataQueryStatus$))),this.aggregateData$=this.filter$.pipe(jq(this.aggregateData,Lq(this._aggregateDataQueryStatus$))),this.termOccurencesData$=this.filter$.pipe(jq(this.termOccurencesData,Lq(this._termOccurencesDataQueryStatus$))),this.sceneData$=this.filter$.pipe(jq(this.sceneData,Lq(this._sceneDataQueryStatus$))),this.technologyFilterData$=this.filter$.pipe(jq(this.technologyFilterData,Lq(this._technologyFilterQueryStatus$))),this.providerFilterData$=this.filter$.pipe(jq(this.providerFilterData,Lq(this._providerFilterQueryStatus$))),this.tissueBlockDataQueryStatus$=this._tissueBlockDataQueryStatus$.pipe(Iq()),this.aggregateDataQueryStatus$=this._aggregateDataQueryStatus$.pipe(Iq()),this.termOccurencesDataQueryStatus$=this._termOccurencesDataQueryStatus$.pipe(Iq()),this.sceneDataQueryStatus$=this._sceneDataQueryStatus$.pipe(Iq()),this.technologyFilterQueryStatus$=this._technologyFilterQueryStatus$.pipe(Iq()),this.providerFilterQueryStatus$=this._providerFilterQueryStatus$.pipe(Iq()),this.queryStatus$=T_([this.tissueBlockDataQueryStatus$,this.aggregateDataQueryStatus$,this.termOccurencesDataQueryStatus$,this.sceneDataQueryStatus$,this.technologyFilterQueryStatus$,this.providerFilterQueryStatus$]).pipe(D(t=>function(t){return t.every(t=>t===Nq.Completed)}(t)?Nq.Completed:Nq.Running),Iq()),this._tissueBlockDataQueryStatus$.next(Nq.Completed),this._aggregateDataQueryStatus$.next(Nq.Completed),this._termOccurencesDataQueryStatus$.next(Nq.Completed),this._sceneDataQueryStatus$.next(Nq.Completed),this._technologyFilterQueryStatus$.next(Nq.Completed),this._providerFilterQueryStatus$.next(Nq.Completed)}ngxsOnInit(){const{ontologyTermsFullData$:t,termOccurencesData$:e,source:n,snapshot:{filter:i}}=this;i===Rq?e.pipe(Gp(1)).subscribe(t):n.getOntologyTermOccurences().pipe(Gp(1)).subscribe(t)}updateFilter(t){this.patchState({filter:Object.assign(Object.assign({},this.getState().filter),t)})}tissueBlockData(t){return this._tissueBlockDataQueryStatus$.next(Nq.Running),this.source.getTissueBlockResults(t)}aggregateData(t){return this._aggregateDataQueryStatus$.next(Nq.Running),this.source.getAggregateResults(t)}termOccurencesData(t){return this._termOccurencesDataQueryStatus$.next(Nq.Running),this.source.getOntologyTermOccurences(t)}sceneData(t){return this._sceneDataQueryStatus$.next(Nq.Running),this.source.getScene(t)}technologyFilterData(){return this._technologyFilterQueryStatus$.next(Nq.Running),this.source.getDatasetTechnologyNames()}providerFilterData(){return this._providerFilterQueryStatus$.next(Nq.Running),this.source.getProviderNames()}};Fq.\u0275fac=function(t){return new(t||Fq)(Ci(mq))},Fq.\u0275prov=xt({token:Fq,factory:Fq.\u0275fac}),sw([L$(),ow(0,j$("filter"))],Fq.prototype,"updateFilter",null),sw([iB.ak],Fq.prototype,"tissueBlockData",null),sw([iB.ak],Fq.prototype,"aggregateData",null),sw([iB.ak],Fq.prototype,"termOccurencesData",null),sw([iB.ak],Fq.prototype,"sceneData",null),sw([iB.ak],Fq.prototype,"technologyFilterData",null),sw([iB.ak],Fq.prototype,"providerFilterData",null),Fq=sw([F$(),wV({name:"data",defaults:{filter:Rq}})],Fq);const Bq=[{name:"logo",namespace:"app",url:"assets/icons/app/hubmap-logo.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs_bladder.svg"},{name:"bone_marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs_brain.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs_heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs_kidney.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"large_intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs_liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs_lung.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lymph_nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small_intestine",namespace:"app",url:"assets/icons/organs/ico-organs_small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs_spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"vasculature",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"expand_more",namespace:"app",url:"assets/icons/expand_more-24px.svg"},{name:"expand_less",namespace:"app",url:"assets/icons/expand_less-24px.svg"},{name:"filter",url:"assets/icons/filter.svg"}];let Vq=class extends V${constructor(t,e){super(),this.registry=t;for(const{name:n,namespace:i,url:r,html:s}of Bq){const t={name:n,namespace:i,url:r&&e.bypassSecurityTrustResourceUrl(r),html:s&&e.bypassSecurityTrustHtml(s)};this.registerIconImpl(t)}}registerIcon(t){return this.registerIconImpl(t)}registerIconImpl(t){if(!this.registry||!t.url&&!t.html)return!1;const e=this.registry,n=e[this.getMethodName(t)],i=this.getArguments(t);if(!n)return!1;try{return n.apply(e,i),!0}catch(r){return!1}}getMethodName({name:t,namespace:e,url:n}){const i=["addSvgIcon"];return t||i.push("Set"),n||i.push("Literal"),e&&i.push("InNamespace"),i.join("")}getArguments({name:t,namespace:e,url:n,html:i}){return[e,t,null!=n?n:i].filter(t=>!!t)}};Vq.\u0275fac=function(t){return new(t||Vq)(Ci(r_,8),Ci(hd))},Vq.\u0275prov=xt({token:Vq,factory:Vq.\u0275fac}),sw([L$()],Vq.prototype,"registerIcon",null),Vq=sw([F$(),wV({name:"iconRegistry"})],Vq);let zq=class extends z${constructor(t,e){super(),this.dataService=t,this.injector=e,this.listResults$=this.state$.pipe(FU("listResults"),Rd()),this.highlightedNodeId$=this.state$.pipe(FU("highlightedNodeId"),Rd())}setListResults(t){this.ctx.patchState({listResults:t})}selectListResult(t){this.colorAssignments.assignColor(t.tissueBlock.spatialEntityId)}deselectListResult(t){this.colorAssignments.unassignColor(t.tissueBlock.spatialEntityId)}highlightNode(t){this.ctx.patchState({highlightedNodeId:t})}unHighlightNode(){this.ctx.patchState({highlightedNodeId:void 0})}ngxsOnInit(){super.ngxsOnInit(),this.dataState=this.injector.get(Fq),this.colorAssignments=this.injector.get(Pq),T_([this.dataState.tissueBlockData$,this.colorAssignments.colorAssignments$]).pipe(D(([t,e])=>{const n=[],i=[];for(const r of t){const t=e[r.spatialEntityId];t?n.push({selected:!0,color:t.color,tissueBlock:r,rank:t.rank}):i.push({selected:!1,tissueBlock:r})}return(0,KG.sortBy)(n,["rank"]).concat(i)}),$f(t=>this.setListResults(t))).subscribe()}};function Uq(t,e,n){e[n.id]=n,(0,KG.forEach)(n.children,n=>Uq(t,e,t[n]))}function Hq(t,e){const n={"@id":t.root,"@type":"OntologyTreeNode",id:t.root,label:"body",parent:"",children:e,synonymLabels:[]},i=(0,KG.at)(t.nodes,e),r={[n.id]:n};return(0,KG.forEach)(i,t=>t.parent=n.id),(0,KG.forEach)(i,e=>Uq(t.nodes,r,e)),{root:n.id,nodes:r}}zq.\u0275fac=function(t){return new(t||zq)(Ci(mq),Ci(No))},zq.\u0275prov=xt({token:zq,factory:zq.\u0275fac}),sw([L$(),ow(0,j$("listResults"))],zq.prototype,"setListResults",null),zq=sw([F$(),wV({name:"listResults",defaults:{listResults:[]}})],zq);let $q=class extends z${constructor(t){super(),this.dataService=t,this.nodes$=this.state$.pipe(D(t=>Object.values(t.nodes))),this.rootNode$=this.state$.pipe(D(t=>t.nodes[t.root]))}setOntology(t){this.ctx.setState(t)}ngxsOnInit(){super.ngxsOnInit(),this.loadOntology()}loadOntology(){hv([this.dataService.getOntologyTreeModel().pipe(Gp(1)),this.dataService.getReferenceOrgans().pipe(Gp(1))]).subscribe(([t,e])=>{const n=RG.organNodes.concat(),i=(0,KG.partial)(Hq,KG.partial.placeholder,n)(t);this.setOntology(i)})}};$q.\u0275fac=function(t){return new(t||$q)(Ci(mq))},$q.\u0275prov=xt({token:$q,factory:$q.\u0275fac}),sw([L$()],$q.prototype,"setOntology",null),$q=sw([F$(),wV({name:"ontology",defaults:{root:"",nodes:{}}})],$q);const Gq=new Set(["Skin","Heart","Kidney","Spleen"]);let Wq=class extends z${constructor(t,e){super(),this.dataService=t,this.injector=e,this.referenceOrgans$=this.state$.pipe(FU("referenceOrgans"),Rd()),this.selectedReferenceOrgans$=this.state$.pipe(FU("selectedReferenceOrgans"),Rd()),this.scene$=this.state$.pipe(FU("scene"),Rd()),this.highlightedId$=this.state$.pipe(FU("highlightedId"),Rd())}setSelectedReferenceOrgans(t){this.ctx.patchState({selectedReferenceOrgans:t})}setReferenceOrgans(t){this.ctx.patchState({referenceOrgans:t})}setScene(t){this.ctx.patchState({scene:t})}sceneNodeClicked({node:t,ctrlClick:e}){t.representation_of&&"http://purl.org/ccf/latest/ccf.owl#VHFSkin"!==t["@id"]&&t.entityId?this.dataState.updateFilter({ontologyTerms:[t.representation_of]}):t.entityId&&this.colorAssignments.assignColor(t["@id"],!e)}sceneNodeHovered(t){this.listResults.highlightNode(t["@id"])}sceneNodeUnhover(){this.listResults.unHighlightNode()}ngxsOnInit(){super.ngxsOnInit(),this.dataState=this.injector.get(Fq),this.colorAssignments=this.injector.get(Pq),this.listResults=this.injector.get(zq),this.dataService.getReferenceOrgans().pipe(D(t=>{const e=new Set(t.map(t=>t.representation_of));return cG.filter(t=>e.has(t.id)).map(t=>Object.assign(Object.assign({},t),{disabled:!1,numResults:0}))}),Gp(1),$f(t=>{this.setReferenceOrgans(t),this.setSelectedReferenceOrgans(t.filter(t=>Gq.has(t.organ)))})).subscribe(),T_([this.dataState.sceneData$,this.selectedReferenceOrgans$,this.colorAssignments.colorAssignments$,this.dataService.getReferenceOrgans(),this.listResults.highlightedNodeId$]).pipe(D(([t,e,n,i,r])=>{const s=new Set(e.map(t=>t.id)),o=new Set(i.filter(t=>s.has(t.representation_of)).map(t=>t["@id"]));return t.filter(t=>{var e,n;return(null===(n=null===(e=t.ccf_annotations)||void 0===e?void 0:e.some)||void 0===n?void 0:n.call(e,t=>s.has(t)))||t.reference_organ&&o.has(t.reference_organ)}).map(t=>t.entityId&&(Object.prototype.hasOwnProperty.call(n,t["@id"])||r===t["@id"])?Object.assign(Object.assign({},t),{color:r===t["@id"]?[30,136,229,255]:n[t["@id"]].rgba}):t)}),$f(t=>this.setScene(t))).subscribe()}};Wq.\u0275fac=function(t){return new(t||Wq)(Ci(mq),Ci(No))},Wq.\u0275prov=xt({token:Wq,factory:Wq.\u0275fac}),sw([L$(),ow(0,j$("selectedReferenceOrgans"))],Wq.prototype,"setSelectedReferenceOrgans",null),sw([L$(),ow(0,j$("referenceOrgans"))],Wq.prototype,"setReferenceOrgans",null),sw([L$(),ow(0,j$("scene"))],Wq.prototype,"setScene",null),Wq=sw([F$(),wV({name:"scene",defaults:{scene:[],referenceOrgans:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],Wq);const qq=[SG,Pq,Vq,zq,Fq,$q,Wq];let Xq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[yq.forRoot(),_V.forRoot(qq,{developmentMode:!RG.production}),Oq.forRoot({disabled:RG.production})]]}),t})(),Yq=(()=>{class t{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:mq,useExisting:gq}],imports:[[Zv,tG.forRoot({gaToken:RG.googleAnalyticsToken,appName:"eui"}),EG,zG,Xq,bq],zG]}),t})();const Kq=["input"],Qq=function(t){return{enterDuration:t}},Zq=["*"],Jq=new oi("mat-checkbox-default-options",{providedIn:"root",factory:tX});function tX(){return{color:"accent",clickAction:"check-indeterminate"}}let eX=0;const nX=tX(),iX={provide:EV,useExisting:pt(()=>oX),multi:!0};class rX{}const sX=By(jy(Fy(Ly(class{constructor(t){this._elementRef=t}}))));let oX=(()=>{class t extends sX{constructor(t,e,n,i,r,s,o){super(t),this._changeDetectorRef=e,this._focusMonitor=n,this._ngZone=i,this._animationMode=s,this._options=o,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++eX,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Rc,this.indeterminateChange=new Rc,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||nX,this.color=this.defaultColor=this._options.color||nX.color,this.tabIndex=parseInt(r)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=md(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t||Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}ngAfterViewChecked(){}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}get checked(){return this._checked}set checked(t){t!=this.checked&&(this._checked=t,this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){const e=md(t);e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const e=t!=this._indeterminate;this._indeterminate=md(t),e&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(t){this.checked=!!t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_getAriaChecked(){return this.checked?"true":this.indeterminate?"mixed":"false"}_transitionCheckState(t){let e=this._currentCheckState,n=this._elementRef.nativeElement;if(e!==t&&(this._currentAnimationClass.length>0&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(e,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);const t=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{n.classList.remove(t)},1e3)})}}_emitChangeEvent(){const t=new rX;t.source=this,t.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(t),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked}_onInputClick(t){var e;const n=null===(e=this._options)||void 0===e?void 0:e.clickAction;t.stopPropagation(),this.disabled||"noop"===n?!this.disabled&&"noop"===n&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==n&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,e){t?this._focusMonitor.focusVia(this._inputElement,t,e):this._inputElement.nativeElement.focus(e)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,e){if("NoopAnimations"===this._animationMode)return"";let n="";switch(t){case 0:if(1===e)n="unchecked-checked";else{if(3!=e)return"";n="unchecked-indeterminate"}break;case 2:n=1===e?"unchecked-checked":"unchecked-indeterminate";break;case 1:n=2===e?"checked-unchecked":"checked-indeterminate";break;case 3:n=1===e?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${n}`}_syncIndeterminate(t){const e=this._inputElement;e&&(e.nativeElement.indeterminate=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(Ig),ea(xu),ii("tabindex"),ea(Ey,8),ea(Jq,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-checkbox"]],viewQuery:function(t,e){if(1&t&&(qc(Kq,5),qc(Yy,5)),2&t){let t;Wc(t=Yc())&&(e._inputElement=t.first),Wc(t=Yc())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,e){2&t&&(il("id",e.id),Ko("tabindex",null),ja("mat-checkbox-indeterminate",e.indeterminate)("mat-checkbox-checked",e.checked)("mat-checkbox-disabled",e.disabled)("mat-checkbox-label-before","before"==e.labelPosition)("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[_l([iX]),jo],ngContentSelectors:Zq,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(t,e){if(1&t&&(wa(),ra(0,"label",0,1),ra(2,"span",2),ra(3,"input",3,4),fa("change",function(t){return e._onInteractionEvent(t)})("click",function(t){return e._onInputClick(t)}),sa(),ra(5,"span",5),oa(6,"span",6),sa(),oa(7,"span",7),ra(8,"span",8),vn(),ra(9,"svg",9),oa(10,"path",10),sa(),Ve.lFrame.currentNamespace=null,oa(11,"span",11),sa(),sa(),ra(12,"span",12,13),fa("cdkObserveContent",function(){return e._onLabelTextChange()}),ra(14,"span",14),Za(15,"\xa0"),sa(),xa(16),sa(),sa()),2&t){const t=ta(1),n=ta(13);Ko("for",e.inputId),ws(2),ja("mat-checkbox-inner-container-no-side-margin",!n.textContent||!n.textContent.trim()),ws(1),na("id",e.inputId)("required",e.required)("checked",e.checked)("disabled",e.disabled)("tabIndex",e.tabIndex),Ko("value",e.value)("name",e.name)("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby)("aria-checked",e._getAriaChecked())("aria-describedby",e.ariaDescribedby),ws(2),na("matRippleTrigger",t)("matRippleDisabled",e._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Tc(19,Qq,"NoopAnimations"===e._animationMode?0:150))}},directives:[Yy,ng],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),t})(),aX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),lX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Ny,ig,aX],Ny,aX]}),t})(),cX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,lX]]}),t})();const uX=["trigger"],hX=["panel"];function dX(t,e){if(1&t&&(ra(0,"span",8),Za(1),sa()),2&t){const t=va();ws(1),Ja(t.placeholder)}}function pX(t,e){if(1&t&&(ra(0,"span",12),Za(1),sa()),2&t){const t=va(2);ws(1),Ja(t.triggerValue)}}function fX(t,e){1&t&&xa(0,0,["*ngSwitchCase","true"])}function gX(t,e){1&t&&(ra(0,"span",9),Jo(1,pX,2,1,"span",10),Jo(2,fX,1,0,"ng-content",11),sa()),2&t&&(na("ngSwitch",!!va().customTrigger),ws(2),na("ngSwitchCase",!0))}function mX(t,e){if(1&t){const t=ua();ra(0,"div",13),ra(1,"div",14,15),fa("@transformPanel.done",function(e){return $e(t),va()._panelDoneAnimatingStream.next(e.toState)})("keydown",function(e){return $e(t),va()._handleKeydown(e)}),xa(3,1),sa(),sa()}if(2&t){const t=va();na("@transformPanelWrap",void 0),ws(1),nl("mat-select-panel ",t._getPanelTheme(),""),La("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),na("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),Ko("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const bX=[[["mat-select-trigger"]],"*"],yX=["mat-select-trigger","*"],vX={transformPanelWrap:Vg("transformPanelWrap",[Wg("* => void",Xg("@transformPanel",[qg()],{optional:!0}))]),transformPanel:Vg("transformPanel",[$g("void",Hg({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),$g("showing",Hg({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),$g("showing-multiple",Hg({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Wg("void => *",zg("120ms cubic-bezier(0, 0, 0.2, 1)")),Wg("* => void",zg("100ms 25ms linear",Hg({opacity:0})))])};let _X=0;const wX=new oi("mat-select-scroll-strategy"),xX=new oi("MAT_SELECT_CONFIG"),SX={provide:wX,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};class EX{constructor(t,e){this.source=t,this.value=e}}const CX=Fy(By(Ly(Vy(class{constructor(t,e,n,i,r){this._elementRef=t,this._defaultErrorStateMatcher=e,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}})))),OX=new oi("MatSelectTrigger");let TX=(()=>{class t extends CX{constructor(t,e,n,i,r,s,o,a,l,c,u,h,d,p){var f,g,m;super(r,i,o,a,c),this._viewportRuler=t,this._changeDetectorRef=e,this._ngZone=n,this._dir=s,this._parentFormField=l,this._liveAnnouncer=d,this._defaultOptions=p,this._panelOpen=!1,this._compareWith=(t,e)=>t===e,this._uid="mat-select-"+_X++,this._triggerAriaLabelledBy=null,this._destroy=new P,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+_X++,this._panelDoneAnimatingStream=new P,this._overlayPanelClass=(null===(f=this._defaultOptions)||void 0===f?void 0:f.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(m=null===(g=this._defaultOptions)||void 0===g?void 0:g.disableOptionCentering)&&void 0!==m&&m,this.ariaLabel="",this.optionSelectionChanges=Iz(()=>{const t=this.options;return t?t.changes.pipe(Kd(t),Qd(()=>Q(...t.map(t=>t.onSelectionChange)))):this._ngZone.onStable.pipe(Gp(1),Qd(()=>this.optionSelectionChanges))}),this.openedChange=new Rc,this._openedStream=this.openedChange.pipe(Hd(t=>t),D(()=>{})),this._closedStream=this.openedChange.pipe(Hd(t=>!t),D(()=>{})),this.selectionChange=new Rc,this.valueChange=new Rc,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==p?void 0:p.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=p.typeaheadDebounceInterval),this._scrollStrategyFactory=h,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(u)||0,this.id=this.id}get focused(){return this._focused||this._panelOpen}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get required(){return this._required}set required(t){this._required=md(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=md(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=md(t)}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){(t!==this._value||this._multiple&&Array.isArray(t))&&(this.options&&this._setSelectionByValue(t),this._value=t)}get typeaheadDebounceInterval(){return this._typeaheadDebounceInterval}set typeaheadDebounceInterval(t){this._typeaheadDebounceInterval=bd(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new kp(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Rd(),Wd(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(Wd(this._destroy)).subscribe(t=>{t.added.forEach(t=>t.select()),t.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(Kd(null),Wd(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const e=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?e.setAttribute("aria-labelledby",t):e.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}ngOnChanges(t){t.disabled&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}ngOnDestroy(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}writeValue(t){this.value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){const t=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}_isRtl(){return!!this._dir&&"rtl"===this._dir.value}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){const e=t.keyCode,n=40===e||38===e||37===e||39===e,i=13===e||32===e,r=this._keyManager;if(!r.isTyping()&&i&&!Qp(t)||(this.multiple||t.altKey)&&n)t.preventDefault(),this.open();else if(!this.multiple){const e=this.selected;r.onKeydown(t);const n=this.selected;n&&e!==n&&this._liveAnnouncer.announce(n.viewValue,1e4)}}_handleOpenKeydown(t){const e=this._keyManager,n=t.keyCode,i=40===n||38===n,r=e.isTyping();if(i&&t.altKey)t.preventDefault(),this.close();else if(r||13!==n&&32!==n||!e.activeItem||Qp(t))if(!r&&this._multiple&&65===n&&t.ctrlKey){t.preventDefault();const e=this.options.some(t=>!t.disabled&&!t.selected);this.options.forEach(t=>{t.disabled||(e?t.select():t.deselect())})}else{const n=e.activeItemIndex;e.onKeydown(t),this._multiple&&i&&t.shiftKey&&e.activeItem&&e.activeItemIndex!==n&&e.activeItem._selectViaInteraction()}else t.preventDefault(),e.activeItem._selectViaInteraction()}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(Gp(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this._selectionModel.selected.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(t=>this._selectValue(t)),this._sortValues();else{const e=this._selectValue(t);e?this._keyManager.updateActiveItem(e):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const e=this.options.find(e=>{if(this._selectionModel.isSelected(e))return!1;try{return null!=e.value&&this._compareWith(e.value,t)}catch(n){return!1}});return e&&this._selectionModel.select(e),e}_initKeyManager(){this._keyManager=new fg(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(Wd(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(Wd(this._destroy)).subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){const t=Q(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Wd(t)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Q(...this.options.map(t=>t._stateChanges)).pipe(Wd(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,e){const n=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(n!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),e&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),e&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),n!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((e,n)=>this.sortComparator?this.sortComparator(e,n,t):t.indexOf(e)-t.indexOf(n)),this.stateChanges.next()}}_propagateChanges(t){let e=null;e=this.multiple?this.selected.map(t=>t.value):this.selected?this.selected.value:t,this._value=e,this.valueChange.emit(e),this._onChange(e),this.selectionChange.emit(this._getChangeEvent(e)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}_canOpen(){var t;return!this._panelOpen&&!this.disabled&&(null===(t=this.options)||void 0===t?void 0:t.length)>0}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){var t;if(this.ariaLabel)return null;const e=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(e?e+" ":"")+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const e=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let n=(e?e+" ":"")+this._valueId;return this.ariaLabelledby&&(n+=" "+this.ariaLabelledby),n}_panelDoneAnimating(t){this.openedChange.emit(t)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}return t.\u0275fac=function(e){return new(e||t)(ea(Ip),ea(tc),ea(xu),ea(zy),ea(kl),ea(Op,8),ea(_z,8),ea(Tz,8),ea(aU,8),ea(WV,10),ii("tabindex"),ea(wX),ea(kg),ea(xX,8))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(qc(uX,5),qc(hX,5),qc(Mf,5)),2&t){let t;Wc(t=Yc())&&(e.trigger=t.first),Wc(t=Yc())&&(e.panel=t.first),Wc(t=Yc())&&(e._overlayDir=t.first)}},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[jo,ye]}),t})(),kX=(()=>{class t extends TX{constructor(){super(...arguments),this._scrollTop=0,this._triggerFontSize=0,this._transformOrigin="top",this._offsetY=0,this._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}]}_calculateOverlayScroll(t,e,n){const i=this._getItemHeight();return Math.min(Math.max(0,i*t-e+i/2),n)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(Wd(this._destroy)).subscribe(()=>{this.panelOpen&&(this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._changeDetectorRef.markForCheck())})}open(){super._canOpen()&&(super.open(),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(Gp(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const e=lv(t,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===e?0:cv((t+e)*n,n,this.panel.nativeElement.scrollTop,256)}_positioningSettled(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}_panelDoneAnimating(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),super._panelDoneAnimating(t)}_getChangeEvent(t){return new EX(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),e=this._viewportRuler.getViewportSize(),n=this._isRtl(),i=this.multiple?56:32;let r;if(this.multiple)r=40;else if(this.disableOptionCentering)r=16;else{let t=this._selectionModel.selected[0]||this.options.first;r=t&&t.group?32:16}n||(r*=-1);const s=0-(t.left+r-(n?i:0)),o=t.right+r-e.width+(n?0:i);s>0?r+=s+8:o>0&&(r-=o+8),this._overlayDir.offsetX=Math.round(r),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,e,n){const i=this._getItemHeight(),r=(i-this._triggerRect.height)/2,s=Math.floor(256/i);let o;return this.disableOptionCentering?0:(o=0===this._scrollTop?t*i:this._scrollTop===n?(t-(this._getItemCount()-s))*i+(i-(this._getItemCount()*i-256)%i):e-i/2,Math.round(-1*o-r))}_checkOverlayWithinViewport(t){const e=this._getItemHeight(),n=this._viewportRuler.getViewportSize(),i=this._triggerRect.top-8,r=n.height-this._triggerRect.bottom-8,s=Math.abs(this._offsetY),o=Math.min(this._getItemCount()*e,256)-s-this._triggerRect.height;o>r?this._adjustPanelUp(o,r):s>i?this._adjustPanelDown(s,i,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,e){const n=Math.round(t-e);this._scrollTop-=n,this._offsetY-=n,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,e,n){const i=Math.round(t-e);if(this._scrollTop+=i,this._offsetY+=i,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=n)return this._scrollTop=n,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),e=this._getItemCount(),n=Math.min(e*t,256),i=e*t-n;let r;r=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),r+=lv(r,this.options,this.optionGroups);const s=n/2;this._scrollTop=this._calculateOverlayScroll(r,s,i),this._offsetY=this._calculateOverlayOffsetY(r,s,i),this._checkOverlayWithinViewport(i)}_getOriginBasedOnOption(){const t=this._getItemHeight(),e=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-e+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-select"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,OX,5),Xc(n,av,5),Xc(n,iv,5)),2&t){let t;Wc(t=Yc())&&(e.customTrigger=t.first),Wc(t=Yc())&&(e.options=t),Wc(t=Yc())&&(e.optionGroups=t)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,e){1&t&&fa("keydown",function(t){return e._handleKeydown(t)})("focus",function(){return e._onFocus()})("blur",function(){return e._onBlur()}),2&t&&(Ko("id",e.id)("tabindex",e.tabIndex)("aria-controls",e.panelOpen?e.id+"-panel":null)("aria-expanded",e.panelOpen)("aria-label",e.ariaLabel||null)("aria-required",e.required.toString())("aria-disabled",e.disabled.toString())("aria-invalid",e.errorState)("aria-describedby",e._ariaDescribedby||null)("aria-activedescendant",e._getAriaActiveDescendant()),ja("mat-select-disabled",e.disabled)("mat-select-invalid",e.errorState)("mat-select-required",e.required)("mat-select-empty",e.empty)("mat-select-multiple",e.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[_l([{provide:Qz,useExisting:t},{provide:Jy,useExisting:t}]),jo],ngContentSelectors:yX,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(t,e){if(1&t&&(wa(bX),ra(0,"div",0,1),fa("click",function(){return e.toggle()}),ra(3,"div",2),Jo(4,dX,2,1,"span",3),Jo(5,gX,3,2,"span",4),sa(),ra(6,"div",5),oa(7,"div",6),sa(),sa(),Jo(8,mX,4,14,"ng-template",7),fa("backdropClick",function(){return e.close()})("attach",function(){return e._onAttached()})("detach",function(){return e.close()})),2&t){const t=ta(1);Ko("aria-owns",e.panelOpen?e.id+"-panel":null),ws(3),na("ngSwitch",e.empty),Ko("id",e._valueId),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1),ws(3),na("cdkConnectedOverlayPanelClass",e._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",e._scrollStrategy)("cdkConnectedOverlayOrigin",t)("cdkConnectedOverlayOpen",e.panelOpen)("cdkConnectedOverlayPositions",e._positions)("cdkConnectedOverlayMinWidth",null==e._triggerRect?null:e._triggerRect.width)("cdkConnectedOverlayOffsetY",e._offsetY)}},directives:[If,Eh,Ch,Mf,Oh,mh],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[vX.transformPanelWrap,vX.transformPanel]},changeDetection:0}),t})(),AX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[SX],imports:[[Rh,Rf,uv,Ny],Mp,cU,uv,Ny]}),t})(),PX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,cU,AX]]}),t})();var IX=n(25430),MX=n(39053),DX=n(26202);const RX=["tooltipTemplate"],NX=["leftOuterSelectionBar"],LX=["rightOuterSelectionBar"],jX=["fullBar"],FX=["selectionBar"],BX=["minHandle"],VX=["maxHandle"],zX=["floorLabel"],UX=["ceilLabel"],HX=["minHandleLabel"],$X=["maxHandleLabel"],GX=["combinedLabel"],WX=["ticksElement"];function qX(t,e){if(1&t&&oa(0,"ng5-slider-tooltip-wrapper",31),2&t){const t=va().$implicit;na("template",va().tooltipTemplate)("tooltip",t.valueTooltip)("placement",t.valueTooltipPlacement)("content",t.value)}}function XX(t,e){1&t&&oa(0,"span",32),2&t&&na("innerHTML",va().$implicit.legend,vr)}const YX=function(t){return{"ng5-slider-selected":t}};function KX(t,e){if(1&t&&(ra(0,"span",27),oa(1,"ng5-slider-tooltip-wrapper",28),Jo(2,qX,1,4,"ng5-slider-tooltip-wrapper",29),Jo(3,XX,1,1,"span",30),sa()),2&t){const t=e.$implicit,n=va();na("ngClass",Tc(7,YX,t.selected))("ngStyle",t.style),ws(1),na("template",n.tooltipTemplate)("tooltip",t.tooltip)("placement",t.tooltipPlacement),ws(1),na("ngIf",null!=t.value),ws(1),na("ngIf",null!=t.legend)}}function QX(t,e){}function ZX(t,e){1&t&&Jo(0,QX,0,0,"ng-template")}const JX=function(t,e,n){return{tooltip:t,placement:e,content:n}};function tY(t,e){if(1&t&&(aa(0),Jo(1,ZX,1,0,void 0,1),la()),2&t){const t=va();ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",kc(2,JX,t.tooltip,t.placement,t.content))}}function eY(t,e){if(1&t&&(aa(0),ra(1,"div",2),Za(2),sa(),la()),2&t){const t=va();ws(1),Ko("title",t.tooltip)("data-tooltip-placement",t.placement),ws(1),tl(" ",t.content," ")}}const nY={Min:0,Max:1};nY[nY.Min]="Min",nY[nY.Max]="Max";const iY={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};iY[iY.Low]="Low",iY[iY.High]="High",iY[iY.Floor]="Floor",iY[iY.Ceil]="Ceil",iY[iY.TickValue]="TickValue";class rY{constructor(){this.floor=0,this.ceil=null,this.step=1,this.minRange=null,this.maxRange=null,this.pushRange=!1,this.minLimit=null,this.maxLimit=null,this.translate=null,this.combineLabels=null,this.getLegend=null,this.stepsArray=null,this.bindIndexForStepsArray=!1,this.draggableRange=!1,this.draggableRangeOnly=!1,this.showSelectionBar=!1,this.showSelectionBarEnd=!1,this.showSelectionBarFromValue=null,this.showOuterSelectionBars=!1,this.hidePointerLabels=!1,this.hideLimitLabels=!1,this.autoHideLimitLabels=!0,this.readOnly=!1,this.disabled=!1,this.mouseEventsInterval=50,this.touchEventsInterval=50,this.inputEventsInterval=100,this.outputEventsInterval=100,this.showTicks=!1,this.showTicksValues=!1,this.tickStep=null,this.tickValueStep=1,this.ticksArray=null,this.ticksTooltip=null,this.ticksValuesTooltip=null,this.vertical=!1,this.getSelectionBarColor=null,this.getTickColor=null,this.getPointerColor=null,this.keyboardSupport=!0,this.scale=1,this.enforceStep=!0,this.enforceRange=!0,this.noSwitching=!1,this.onlyBindHandles=!1,this.rightToLeft=!1,this.reversedControls=!1,this.boundPointerLabels=!0,this.logScale=!1,this.customValueToPosition=null,this.customPositionToValue=null,this.precisionLimit=12,this.selectionBarGradient=null,this.ariaLabel=null,this.ariaLabelledBy=null,this.ariaLabelHigh=null,this.ariaLabelledByHigh=null,this.handleDimension=null,this.barDimension=null,this.animate=!0}}class sY{}class oY{static isNullOrUndefined(t){return null==t}static linearValueToPosition(t,e,n){return(t-e)/(n-e)}static logValueToPosition(t,e,n){return((t=Math.log(t))-(e=Math.log(e)))/((n=Math.log(n))-e)}static linearPositionToValue(t,e,n){return t*(n-e)+e}static logPositionToValue(t,e,n){return e=Math.log(e),n=Math.log(n),Math.exp(t*(n-e)+e)}static findStepIndex(t,e){const n=e.map(e=>Math.abs(t-e.value));let i=0;for(let r=0;r{r.events.next(t)};return t.addEventListener(e,s,{passive:!0,capture:!1}),r.teardownCallback=()=>{t.removeEventListener(e,s,{passive:!0,capture:!1})},r.eventsSubscription=r.events.pipe(oY.isNullOrUndefined(i)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}detachEventListener(t){oY.isNullOrUndefined(t.eventsSubscription)||(t.eventsSubscription.unsubscribe(),t.eventsSubscription=null),oY.isNullOrUndefined(t.events)||(t.events.complete(),t.events=null),oY.isNullOrUndefined(t.teardownCallback)||(t.teardownCallback(),t.teardownCallback=null)}attachEventListener(t,e,n,i){const r=new cY;return r.eventName=e,r.events=new IX.xQ,r.teardownCallback=this.renderer.listen(t,e,t=>{r.events.next(t)}),r.eventsSubscription=r.events.pipe(oY.isNullOrUndefined(i)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}}let hY=(()=>{class t{constructor(t,e,n){this.elemRef=t,this.renderer=e,this.changeDetectionRef=n,this._position=0,this._dimension=0,this._alwaysHide=!1,this._vertical=!1,this._scale=1,this.opacity=1,this.visibility="visible",this.left="",this.bottom="",this.height="",this.width="",this.eventListeners=[],this.eventListenerHelper=new uY(this.renderer)}get position(){return this._position}get dimension(){return this._dimension}get alwaysHide(){return this._alwaysHide}get vertical(){return this._vertical}get scale(){return this._scale}setAlwaysHide(t){this._alwaysHide=t,this.visibility=t?"hidden":"visible"}hide(){this.opacity=0}show(){this.alwaysHide||(this.opacity=1)}isVisible(){return!this.alwaysHide&&0!==this.opacity}setVertical(t){this._vertical=t,this._vertical?(this.left="",this.width=""):(this.bottom="",this.height="")}setScale(t){this._scale=t}setPosition(t){this._position!==t&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._position=t,this._vertical?this.bottom=Math.round(t)+"px":this.left=Math.round(t)+"px"}calculateDimension(){const t=this.getBoundingClientRect();this._dimension=this.vertical?(t.bottom-t.top)*this.scale:(t.right-t.left)*this.scale}setDimension(t){this._dimension!==t&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._dimension=t,this._vertical?this.height=Math.round(t)+"px":this.width=Math.round(t)+"px"}getBoundingClientRect(){return this.elemRef.nativeElement.getBoundingClientRect()}on(t,e,n){const i=this.eventListenerHelper.attachEventListener(this.elemRef.nativeElement,t,e,n);this.eventListeners.push(i)}onPassive(t,e,n){const i=this.eventListenerHelper.attachPassiveEventListener(this.elemRef.nativeElement,t,e,n);this.eventListeners.push(i)}off(t){let e,n;oY.isNullOrUndefined(t)?(e=[],n=this.eventListeners):(e=this.eventListeners.filter(e=>e.eventName!==t),n=this.eventListeners.filter(e=>e.eventName===t));for(const i of n)this.eventListenerHelper.detachEventListener(i);this.eventListeners=e}isRefDestroyed(){return oY.isNullOrUndefined(this.changeDetectionRef)||this.changeDetectionRef.destroyed}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderElement",""]],hostVars:12,hostBindings:function(t,e){2&t&&La("opacity",e.opacity)("visibility",e.visibility)("left",e.left)("bottom",e.bottom)("height",e.height)("width",e.width)}}),t})(),dY=(()=>{class t extends hY{constructor(t,e,n){super(t,e,n),this.active=!1,this.role="",this.tabindex="",this.ariaOrientation="",this.ariaLabel="",this.ariaLabelledBy="",this.ariaValueNow="",this.ariaValueText="",this.ariaValueMin="",this.ariaValueMax=""}focus(){this.elemRef.nativeElement.focus()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderHandle",""]],hostVars:11,hostBindings:function(t,e){2&t&&(Ko("role",e.role)("tabindex",e.tabindex)("aria-orientation",e.ariaOrientation)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledBy)("aria-valuenow",e.ariaValueNow)("aria-valuetext",e.ariaValueText)("aria-valuemin",e.ariaValueMin)("aria-valuemax",e.ariaValueMax),ja("ng5-slider-active",e.active))},features:[jo]}),t})(),pY=(()=>{class t extends hY{constructor(t,e,n){super(t,e,n),this._value=null}get value(){return this._value}setValue(t){let e=!1;!this.alwaysHide&&(oY.isNullOrUndefined(this.value)||this.value.length!==t.length||this.value.length>0&&0===this.dimension)&&(e=!0),this._value=t,this.elemRef.nativeElement.innerHTML=t,e&&this.calculateDimension()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderLabel",""]],features:[jo]}),t})();class fY{constructor(){this.selected=!1,this.style={},this.tooltip=null,this.tooltipPlacement=null,this.value=null,this.valueTooltip=null,this.valueTooltipPlacement=null,this.legend=null}}class gY{constructor(){this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0}}class mY{static compare(t,e){return!(oY.isNullOrUndefined(t)&&oY.isNullOrUndefined(e)||oY.isNullOrUndefined(t)!==oY.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue}}class bY extends mY{static compare(t,e){return!(oY.isNullOrUndefined(t)&&oY.isNullOrUndefined(e)||oY.isNullOrUndefined(t)!==oY.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue&&t.forceChange===e.forceChange}}const yY={provide:EV,useExisting:pt(()=>vY),multi:!0};let vY=(()=>{class t{constructor(t,e,n,i){this.renderer=t,this.elementRef=e,this.changeDetectionRef=n,this.zone=i,this.value=null,this.valueChange=new Rc,this.highValue=null,this.highValueChange=new Rc,this.options=new rY,this.userChangeStart=new Rc,this.userChange=new Rc,this.userChangeEnd=new Rc,this.initHasRun=!1,this.inputModelChangeSubject=new IX.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new IX.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new rY,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new gY,this.sliderElementVerticalClass=!1,this.sliderElementAnimateClass=!1,this.sliderElementDisabledAttr=null,this.barStyle={},this.minPointerStyle={},this.maxPointerStyle={},this.fullBarTransparentClass=!1,this.selectionBarDraggableClass=!1,this.ticksUnderValuesClass=!1,this.intermediateTicks=!1,this.ticks=[],this.eventListenerHelper=null,this.onMoveEventListener=null,this.onEndEventListener=null,this.resizeObserver=null,this.onTouchedCallback=null,this.onChangeCallback=null,this.eventListenerHelper=new uY(this.renderer)}set manualRefresh(t){this.unsubscribeManualRefresh(),this.manualRefreshSubscription=t.subscribe(()=>{setTimeout(()=>this.calculateViewDimensionsAndDetectChanges())})}set triggerFocus(t){this.unsubscribeTriggerFocus(),this.triggerFocusSubscription=t.subscribe(t=>{this.focusPointer(t)})}get range(){return!oY.isNullOrUndefined(this.value)&&!oY.isNullOrUndefined(this.highValue)}get showTicks(){return this.viewOptions.showTicks}ngOnInit(){this.viewOptions=new rY,Object.assign(this.viewOptions,this.options),this.updateDisabledState(),this.updateVerticalState()}ngAfterViewInit(){this.applyOptions(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval),this.subscribeOutputModelChangeSubject(this.viewOptions.outputEventsInterval),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.updateVerticalState(),this.manageElementsStyle(),this.updateDisabledState(),this.calculateViewDimensions(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.initHandles(),this.manageEventsBindings(),this.subscribeResizeObserver(),this.initHasRun=!0,this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}ngOnChanges(t){oY.isNullOrUndefined(t.options)||this.onChangeOptions(),(!oY.isNullOrUndefined(t.value)||!oY.isNullOrUndefined(t.highValue))&&this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}ngOnDestroy(){this.unbindEvents(),this.unsubscribeResizeObserver(),this.unsubscribeInputModelChangeSubject(),this.unsubscribeOutputModelChangeSubject(),this.unsubscribeManualRefresh(),this.unsubscribeTriggerFocus()}writeValue(t){t instanceof Array?(this.value=t[0],this.highValue=t[1]):this.value=t,this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}registerOnChange(t){this.onChangeCallback=t}registerOnTouched(t){this.onTouchedCallback=t}setDisabledState(t){this.viewOptions.disabled=t,this.updateDisabledState()}onResize(t){this.calculateViewDimensionsAndDetectChanges()}subscribeInputModelChangeSubject(t){this.inputModelChangeSubscription=this.inputModelChangeSubject.pipe((0,MX.distinctUntilChanged)(bY.compare),(0,MX.filter)(t=>!t.forceChange&&!t.internalChange),oY.isNullOrUndefined(t)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.applyInputModelChange(t))}subscribeOutputModelChangeSubject(t){this.outputModelChangeSubscription=this.outputModelChangeSubject.pipe((0,MX.distinctUntilChanged)(bY.compare),oY.isNullOrUndefined(t)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.publishOutputModelChange(t))}subscribeResizeObserver(){aY.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(()=>this.calculateViewDimensionsAndDetectChanges()),this.resizeObserver.observe(this.elementRef.nativeElement))}unsubscribeResizeObserver(){aY.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}unsubscribeOnMove(){oY.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}unsubscribeOnEnd(){oY.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}unsubscribeInputModelChangeSubject(){oY.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}unsubscribeOutputModelChangeSubject(){oY.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}unsubscribeManualRefresh(){oY.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}unsubscribeTriggerFocus(){oY.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}getPointerElement(t){return t===nY.Min?this.minHandleElement:t===nY.Max?this.maxHandleElement:null}getCurrentTrackingValue(){return this.currentTrackingPointer===nY.Min?this.viewLowValue:this.currentTrackingPointer===nY.Max?this.viewHighValue:null}modelValueToViewValue(t){return oY.isNullOrUndefined(t)?NaN:oY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+t:oY.findStepIndex(+t,this.viewOptions.stepsArray)}viewValueToModelValue(t){return oY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?t:this.getStepValue(t)}getStepValue(t){const e=this.viewOptions.stepsArray[t];return oY.isNullOrUndefined(e)?NaN:e.value}applyViewChange(){this.value=this.viewValueToModelValue(this.viewLowValue),this.range&&(this.highValue=this.viewValueToModelValue(this.viewHighValue)),this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,userEventInitiated:!0,forceChange:!1}),this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!0})}applyInputModelChange(t){const e=this.normaliseModelValues(t),n=!mY.compare(t,e);n&&(this.value=e.value,this.highValue=e.highValue),this.viewLowValue=this.modelValueToViewValue(e.value),this.viewHighValue=this.range?this.modelValueToViewValue(e.highValue):null,this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCombinedLabel(),this.outputModelChangeSubject.next({value:e.value,highValue:e.highValue,forceChange:n,userEventInitiated:!1})}publishOutputModelChange(t){const e=()=>{this.valueChange.emit(t.value),this.range&&this.highValueChange.emit(t.highValue),oY.isNullOrUndefined(this.onChangeCallback)||this.onChangeCallback(this.range?[t.value,t.highValue]:t.value),oY.isNullOrUndefined(this.onTouchedCallback)||this.onTouchedCallback(this.range?[t.value,t.highValue]:t.value)};t.userEventInitiated?(e(),this.userChange.emit(this.getChangeContext())):setTimeout(()=>{e()})}normaliseModelValues(t){const e=new mY;if(e.value=t.value,e.highValue=t.highValue,this.viewOptions.enforceStep&&(e.value=this.roundStep(e.value),this.range&&(e.highValue=this.roundStep(e.highValue))),!oY.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return e;if(e.value=lY.clampToRange(e.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(e.highValue=lY.clampToRange(e.highValue,this.viewOptions.floor,this.viewOptions.ceil)),this.range&&t.value>t.highValue)if(this.viewOptions.noSwitching)e.value=e.highValue;else{const n=t.value;e.value=t.highValue,e.highValue=n}return e}renormaliseModelValues(){const t={value:this.value,highValue:this.highValue},e=this.normaliseModelValues(t);mY.compare(e,t)||(this.value=e.value,this.highValue=e.highValue,this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!0,userEventInitiated:!1}))}onChangeOptions(){if(!this.initHasRun)return;const t=this.viewOptions.inputEventsInterval,e=this.viewOptions.outputEventsInterval;this.applyOptions(),t!==this.viewOptions.inputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval)),e!==this.viewOptions.outputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.outputEventsInterval)),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.resetSlider()}applyOptions(){if(this.viewOptions=new rY,Object.assign(this.viewOptions,this.options),this.viewOptions.draggableRange=this.range&&this.viewOptions.draggableRange,this.viewOptions.draggableRangeOnly=this.range&&this.viewOptions.draggableRangeOnly,this.viewOptions.draggableRangeOnly&&(this.viewOptions.draggableRange=!0),this.viewOptions.showTicks=this.viewOptions.showTicks||this.viewOptions.showTicksValues||!oY.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!oY.isNullOrUndefined(this.viewOptions.tickStep)||!oY.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),oY.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),oY.isNullOrUndefined(this.viewOptions.combineLabels)&&(this.viewOptions.combineLabels=(t,e)=>t+" - "+e),this.viewOptions.logScale&&0===this.viewOptions.floor)throw Error("Can't use floor=0 with logarithmic scale")}applyStepsArrayOptions(){this.viewOptions.floor=0,this.viewOptions.ceil=this.viewOptions.stepsArray.length-1,this.viewOptions.step=1,oY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=t=>String(this.viewOptions.bindIndexForStepsArray?this.getStepValue(t):t)),this.viewOptions.getLegend=t=>this.viewOptions.stepsArray[t].legend}applyFloorCeilOptions(){if(oY.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),oY.isNullOrUndefined(this.viewOptions.ceil)||oY.isNullOrUndefined(this.viewOptions.floor))throw Error("floor and ceil options must be supplied");this.viewOptions.ceil=+this.viewOptions.ceil,this.viewOptions.floor=+this.viewOptions.floor,oY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=t=>String(t))}resetSlider(){this.manageElementsStyle(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.unbindEvents(),this.manageEventsBindings(),this.updateDisabledState(),this.calculateViewDimensions(),this.refocusPointerIfNeeded()}focusPointer(t){t!==nY.Min&&t!==nY.Max&&(t=nY.Min),t===nY.Min?this.minHandleElement.focus():this.range&&t===nY.Max&&this.maxHandleElement.focus()}refocusPointerIfNeeded(){oY.isNullOrUndefined(this.currentFocusPointer)||(this.onPointerFocus(this.currentFocusPointer),this.getPointerElement(this.currentFocusPointer).focus())}manageElementsStyle(){this.updateScale(),this.floorLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels),this.ceilLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels);const t=this.viewOptions.showTicksValues&&!this.intermediateTicks;this.minHandleLabelElement.setAlwaysHide(t||this.viewOptions.hidePointerLabels),this.maxHandleLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.combinedLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.selectionBarElement.setAlwaysHide(!this.range&&!this.viewOptions.showSelectionBar),this.leftOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.rightOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.fullBarTransparentClass=this.range&&this.viewOptions.showOuterSelectionBars,this.selectionBarDraggableClass=this.viewOptions.draggableRange&&!this.viewOptions.onlyBindHandles,this.ticksUnderValuesClass=this.intermediateTicks&&this.options.showTicksValues,this.sliderElementVerticalClass!==this.viewOptions.vertical&&(this.updateVerticalState(),setTimeout(()=>{this.resetSlider()})),this.sliderElementAnimateClass!==this.viewOptions.animate&&setTimeout(()=>{this.sliderElementAnimateClass=this.viewOptions.animate})}manageEventsBindings(){this.viewOptions.disabled||this.viewOptions.readOnly?this.unbindEvents():this.bindEvents()}updateDisabledState(){this.sliderElementDisabledAttr=this.viewOptions.disabled?"disabled":null}updateVerticalState(){this.sliderElementVerticalClass=this.viewOptions.vertical;for(const t of this.getAllSliderElements())oY.isNullOrUndefined(t)||t.setVertical(this.viewOptions.vertical)}updateScale(){for(const t of this.getAllSliderElements())t.setScale(this.viewOptions.scale)}getAllSliderElements(){return[this.leftOuterSelectionBarElement,this.rightOuterSelectionBarElement,this.fullBarElement,this.selectionBarElement,this.minHandleElement,this.maxHandleElement,this.floorLabelElement,this.ceilLabelElement,this.minHandleLabelElement,this.maxHandleLabelElement,this.combinedLabelElement,this.ticksElement]}initHandles(){this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.range&&this.updateCombinedLabel(),this.updateTicksScale()}addAccessibility(){this.updateAriaAttributes(),this.minHandleElement.role="slider",this.minHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.viewOptions.vertical&&(this.minHandleElement.ariaOrientation="vertical"),oY.isNullOrUndefined(this.viewOptions.ariaLabel)?oY.isNullOrUndefined(this.viewOptions.ariaLabelledBy)||(this.minHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledBy):this.minHandleElement.ariaLabel=this.viewOptions.ariaLabel,this.range&&(this.maxHandleElement.role="slider",this.maxHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.maxHandleElement.ariaOrientation=this.viewOptions.vertical?"vertical":"horizontal",oY.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?oY.isNullOrUndefined(this.viewOptions.ariaLabelledByHigh)||(this.maxHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledByHigh):this.maxHandleElement.ariaLabel=this.viewOptions.ariaLabelHigh)}updateAriaAttributes(){this.minHandleElement.ariaValueNow=(+this.value).toString(),this.minHandleElement.ariaValueText=this.viewOptions.translate(+this.value,iY.Low),this.minHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.minHandleElement.ariaValueMax=this.viewOptions.ceil.toString(),this.range&&(this.maxHandleElement.ariaValueNow=(+this.highValue).toString(),this.maxHandleElement.ariaValueText=this.viewOptions.translate(+this.highValue,iY.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}calculateViewDimensions(){oY.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);const t=this.minHandleElement.dimension;this.handleHalfDimension=t/2,oY.isNullOrUndefined(this.viewOptions.barDimension)?this.fullBarElement.calculateDimension():this.fullBarElement.setDimension(this.viewOptions.barDimension),this.maxHandlePosition=this.fullBarElement.dimension-t,this.initHasRun&&(this.updateFloorLabel(),this.updateCeilLabel(),this.initHandles())}calculateViewDimensionsAndDetectChanges(){this.calculateViewDimensions(),this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}isRefDestroyed(){return this.changeDetectionRef.destroyed}updateTicksScale(){if(!this.viewOptions.showTicks)return;const t=oY.isNullOrUndefined(this.viewOptions.ticksArray)?this.getTicksArray():this.viewOptions.ticksArray,e=this.viewOptions.vertical?"translateY":"translateX";this.viewOptions.rightToLeft&&t.reverse();const n=t.map(t=>{let n=this.valueToPosition(t);this.viewOptions.vertical&&(n=this.maxHandlePosition-n);const i=e+"("+Math.round(n)+"px)",r=new fY;if(r.selected=this.isTickSelected(t),r.style={"-webkit-transform":i,"-moz-transform":i,"-o-transform":i,"-ms-transform":i,transform:i},r.selected&&!oY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)&&(r.style["background-color"]=this.getSelectionBarColor()),!r.selected&&!oY.isNullOrUndefined(this.viewOptions.getTickColor)&&(r.style["background-color"]=this.getTickColor(t)),oY.isNullOrUndefined(this.viewOptions.ticksTooltip)||(r.tooltip=this.viewOptions.ticksTooltip(t),r.tooltipPlacement=this.viewOptions.vertical?"right":"top"),this.viewOptions.showTicksValues&&t%this.viewOptions.tickValueStep==0&&(r.value=this.getDisplayValue(t,iY.TickValue),oY.isNullOrUndefined(this.viewOptions.ticksValuesTooltip)||(r.valueTooltip=this.viewOptions.ticksValuesTooltip(t),r.valueTooltipPlacement=this.viewOptions.vertical?"right":"top")),!oY.isNullOrUndefined(this.viewOptions.getLegend)){const e=this.viewOptions.getLegend(t);oY.isNullOrUndefined(e)||(r.legend=e)}return r});if(oY.isNullOrUndefined(this.ticks)||this.ticks.length!==n.length)this.ticks=n;else for(let i=0;i=this.viewLowValue)return!0}else if(this.viewOptions.showSelectionBar&&t<=this.viewLowValue)return!0}else{const e=this.viewOptions.showSelectionBarFromValue;if(this.viewLowValue>e&&t>=e&&t<=this.viewLowValue)return!0;if(this.viewLowValue=this.viewLowValue)return!0}return!!(this.range&&t>=this.viewLowValue&&t<=this.viewHighValue)}updateFloorLabel(){this.floorLabelElement.alwaysHide||(this.floorLabelElement.setValue(this.getDisplayValue(this.viewOptions.floor,iY.Floor)),this.floorLabelElement.calculateDimension(),this.floorLabelElement.setPosition(this.viewOptions.rightToLeft?this.fullBarElement.dimension-this.floorLabelElement.dimension:0))}updateCeilLabel(){this.ceilLabelElement.alwaysHide||(this.ceilLabelElement.setValue(this.getDisplayValue(this.viewOptions.ceil,iY.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}updateHandles(t,e){t===nY.Min?this.updateLowHandle(e):t===nY.Max&&this.updateHighHandle(e),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}getHandleLabelPos(t,e){const n=t===nY.Min?this.minHandleLabelElement.dimension:this.maxHandleLabelElement.dimension,i=e-n/2+this.handleHalfDimension,r=this.fullBarElement.dimension-n;return this.viewOptions.boundPointerLabels?this.viewOptions.rightToLeft&&t===nY.Min||!this.viewOptions.rightToLeft&&t===nY.Max?Math.min(i,r):Math.min(Math.max(i,0),r):i}updateLowHandle(t){this.minHandleElement.setPosition(t),this.minHandleLabelElement.setValue(this.getDisplayValue(this.viewLowValue,iY.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(nY.Min,t)),oY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(nY.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateHighHandle(t){this.maxHandleElement.setPosition(t),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,iY.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(nY.Max,t)),oY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(nY.Max)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateFloorAndCeilLabelsVisibility(){if(this.viewOptions.hidePointerLabels)return;let t=!1,e=!1;const n=this.isLabelBelowFloorLabel(this.minHandleLabelElement),i=this.isLabelAboveCeilLabel(this.minHandleLabelElement),r=this.isLabelAboveCeilLabel(this.maxHandleLabelElement),s=this.isLabelBelowFloorLabel(this.combinedLabelElement),o=this.isLabelAboveCeilLabel(this.combinedLabelElement);if(n?(t=!0,this.floorLabelElement.hide()):(t=!1,this.floorLabelElement.show()),i?(e=!0,this.ceilLabelElement.hide()):(e=!1,this.ceilLabelElement.show()),this.range){const i=this.combinedLabelElement.isVisible()?o:r,a=this.combinedLabelElement.isVisible()?s:n;i?this.ceilLabelElement.hide():e||this.ceilLabelElement.show(),a?this.floorLabelElement.hide():t||this.floorLabelElement.show()}}isLabelBelowFloorLabel(t){const e=t.position,n=this.floorLabelElement.position;return this.viewOptions.rightToLeft?e+t.dimension>=n-2:e<=n+this.floorLabelElement.dimension+2}isLabelAboveCeilLabel(t){const e=t.position,n=this.ceilLabelElement.position;return this.viewOptions.rightToLeft?e<=n+this.ceilLabelElement.dimension+2:e+t.dimension>=n-2}updateSelectionBar(){let t=0,e=0;const n=this.viewOptions.rightToLeft?!this.viewOptions.showSelectionBarEnd:this.viewOptions.showSelectionBarEnd,i=this.viewOptions.rightToLeft?this.maxHandleElement.position+this.handleHalfDimension:this.minHandleElement.position+this.handleHalfDimension;if(this.range)e=Math.abs(this.maxHandleElement.position-this.minHandleElement.position),t=i;else if(oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue))n?(e=Math.ceil(Math.abs(this.maxHandlePosition-this.minHandleElement.position)+this.handleHalfDimension),t=Math.floor(this.minHandleElement.position+this.handleHalfDimension)):(e=this.minHandleElement.position+this.handleHalfDimension,t=0);else{const n=this.viewOptions.showSelectionBarFromValue,i=this.valueToPosition(n);(this.viewOptions.rightToLeft?this.viewLowValue<=n:this.viewLowValue>n)?(e=this.minHandleElement.position-i,t=i+this.handleHalfDimension):(e=i-this.minHandleElement.position,t=this.minHandleElement.position+this.handleHalfDimension)}if(this.selectionBarElement.setDimension(e),this.selectionBarElement.setPosition(t),this.range&&this.viewOptions.showOuterSelectionBars&&(this.viewOptions.rightToLeft?(this.rightOuterSelectionBarElement.setDimension(t),this.rightOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.leftOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(t+e)),this.leftOuterSelectionBarElement.setPosition(t+e)):(this.leftOuterSelectionBarElement.setDimension(t),this.leftOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.rightOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(t+e)),this.rightOuterSelectionBarElement.setPosition(t+e))),oY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!oY.isNullOrUndefined(this.viewOptions.selectionBarGradient)){const i=oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue)?0:this.valueToPosition(this.viewOptions.showSelectionBarFromValue),r=i-t>0&&!n||i-t<=0&&n;this.barStyle={backgroundImage:"linear-gradient(to "+(this.viewOptions.vertical?r?"bottom":"top":r?"left":"right")+", "+this.viewOptions.selectionBarGradient.from+" 0%,"+this.viewOptions.selectionBarGradient.to+" 100%)"},this.viewOptions.vertical?(this.barStyle.backgroundPosition="center "+(i+e+t+(r?-this.handleHalfDimension:0))+"px",this.barStyle.backgroundSize="100% "+(this.fullBarElement.dimension-this.handleHalfDimension)+"px"):(this.barStyle.backgroundPosition=i-t+(r?this.handleHalfDimension:0)+"px center",this.barStyle.backgroundSize=this.fullBarElement.dimension-this.handleHalfDimension+"px 100%")}}else{const t=this.getSelectionBarColor();this.barStyle={backgroundColor:t}}}getSelectionBarColor(){return this.range?this.viewOptions.getSelectionBarColor(this.value,this.highValue):this.viewOptions.getSelectionBarColor(this.value)}getPointerColor(t){return this.viewOptions.getPointerColor(t===nY.Max?this.highValue:this.value,t)}getTickColor(t){return this.viewOptions.getTickColor(t)}updateCombinedLabel(){let t=null;if(t=this.viewOptions.rightToLeft?this.minHandleLabelElement.position-this.minHandleLabelElement.dimension-10<=this.maxHandleLabelElement.position:this.minHandleLabelElement.position+this.minHandleLabelElement.dimension+10>=this.maxHandleLabelElement.position,t){const t=this.getDisplayValue(this.viewLowValue,iY.Low),e=this.getDisplayValue(this.viewHighValue,iY.High),n=this.viewOptions.rightToLeft?this.viewOptions.combineLabels(e,t):this.viewOptions.combineLabels(t,e);this.combinedLabelElement.setValue(n);const i=this.viewOptions.boundPointerLabels?Math.min(Math.max(this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2,0),this.fullBarElement.dimension-this.combinedLabelElement.dimension):this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2;this.combinedLabelElement.setPosition(i),this.minHandleLabelElement.hide(),this.maxHandleLabelElement.hide(),this.combinedLabelElement.show()}else this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.maxHandleLabelElement.show(),this.minHandleLabelElement.show(),this.combinedLabelElement.hide();this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}getDisplayValue(t,e){return!oY.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(t=this.getStepValue(t)),this.viewOptions.translate(t,e)}roundStep(t,e){const n=oY.isNullOrUndefined(e)?this.viewOptions.step:e;let i=lY.roundToPrecisionLimit((t-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,lY.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}valueToPosition(t){let e=oY.linearValueToPosition;oY.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(e=oY.logValueToPosition):e=this.viewOptions.customValueToPosition;let n=e(t=lY.clampToRange(t,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return oY.isNullOrUndefined(n)&&(n=0),this.viewOptions.rightToLeft&&(n=1-n),n*this.maxHandlePosition}positionToValue(t){let e=t/this.maxHandlePosition;this.viewOptions.rightToLeft&&(e=1-e);let n=oY.linearPositionToValue;oY.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=oY.logPositionToValue):n=this.viewOptions.customPositionToValue;const i=n(e,this.viewOptions.floor,this.viewOptions.ceil);return oY.isNullOrUndefined(i)?0:i}getEventXY(t,e){if(t instanceof MouseEvent)return this.viewOptions.vertical?t.clientY:t.clientX;let n=0;const i=t.touches;if(!oY.isNullOrUndefined(e))for(let r=0;ri?nY.Max:this.viewOptions.rightToLeft?e>this.minHandleElement.position?nY.Min:nY.Max:ethis.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.on("mousedown",e=>this.onBarStart(nY.Min,t,e,!0,!0)),this.maxHandleElement.on("mousedown",e=>this.onBarStart(nY.Max,t,e,!0,!0))):(this.minHandleElement.on("mousedown",t=>this.onStart(nY.Min,t,!0,!0)),this.range&&this.maxHandleElement.on("mousedown",t=>this.onStart(nY.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0,!0)))),this.viewOptions.onlyBindHandles||this.selectionBarElement.onPassive("touchstart",e=>this.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.onPassive("touchstart",e=>this.onBarStart(nY.Min,t,e,!0,!0)),this.maxHandleElement.onPassive("touchstart",e=>this.onBarStart(nY.Max,t,e,!0,!0))):(this.minHandleElement.onPassive("touchstart",t=>this.onStart(nY.Min,t,!0,!0)),this.range&&this.maxHandleElement.onPassive("touchstart",t=>this.onStart(nY.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.onPassive("touchstart",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.onPassive("touchstart",t=>this.onStart(null,t,!1,!1,!0,!0)))),this.viewOptions.keyboardSupport&&(this.minHandleElement.on("focus",()=>this.onPointerFocus(nY.Min)),this.range&&this.maxHandleElement.on("focus",()=>this.onPointerFocus(nY.Max)))}unbindEvents(){this.unsubscribeOnMove(),this.unsubscribeOnEnd();for(const t of this.getAllSliderElements())oY.isNullOrUndefined(t)||t.off()}onBarStart(t,e,n,i,r,s,o){e?this.onDragStart(t,n,i,r):this.onStart(t,n,i,r,s,o)}onStart(t,e,n,i,r,s){e.stopPropagation(),(!aY.isTouchEvent(e)||!DX.Z.hasSupport)&&e.preventDefault(),this.calculateViewDimensions(),oY.isNullOrUndefined(t)&&(t=this.getNearestHandle(e)),this.currentTrackingPointer=t;const o=this.getPointerElement(t);if(o.active=!0,this.viewOptions.keyboardSupport&&o.focus(),n){this.unsubscribeOnMove();const t=t=>this.dragging.active?this.onDragMove(t):this.onMove(t);this.onMoveEventListener=aY.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchmove",t,this.viewOptions.touchEventsInterval):this.eventListenerHelper.attachEventListener(document,"mousemove",t,this.viewOptions.mouseEventsInterval)}if(i){this.unsubscribeOnEnd();const t=t=>this.onEnd(t);this.onEndEventListener=aY.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchend",t):this.eventListenerHelper.attachEventListener(document,"mouseup",t)}this.userChangeStart.emit(this.getChangeContext()),aY.isTouchEvent(e)&&!oY.isNullOrUndefined(e.changedTouches)&&oY.isNullOrUndefined(this.touchId)&&(this.touchId=e.changedTouches[0].identifier),r&&this.onMove(e,!0),s&&this.onEnd(e)}onMove(t,e){let n=null;if(aY.isTouchEvent(t)){const e=t.changedTouches;for(let t=0;t=this.maxHandlePosition?r=this.viewOptions.rightToLeft?this.viewOptions.floor:this.viewOptions.ceil:(r=this.positionToValue(i),r=e&&!oY.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(r,this.viewOptions.tickStep):this.roundStep(r)),this.positionTrackingHandle(r)}onEnd(t){aY.isTouchEvent(t)&&t.changedTouches[0].identifier!==this.touchId||(this.touchId=null,this.viewOptions.keyboardSupport||(this.minHandleElement.active=!1,this.maxHandleElement.active=!1,this.currentTrackingPointer=null),this.dragging.active=!1,this.unsubscribeOnMove(),this.unsubscribeOnEnd(),this.userChangeEnd.emit(this.getChangeContext()))}onPointerFocus(t){const e=this.getPointerElement(t);e.on("blur",()=>this.onPointerBlur(e)),e.on("keydown",t=>this.onKeyboardEvent(t)),e.on("keyup",()=>this.onKeyUp()),e.active=!0,this.currentTrackingPointer=t,this.currentFocusPointer=t,this.firstKeyDown=!0}onKeyUp(){this.firstKeyDown=!0,this.userChangeEnd.emit(this.getChangeContext())}onPointerBlur(t){t.off("blur"),t.off("keydown"),t.off("keyup"),t.active=!1,oY.isNullOrUndefined(this.touchId)&&(this.currentTrackingPointer=null,this.currentFocusPointer=null)}getKeyActions(t){const e=this.viewOptions.ceil-this.viewOptions.floor;let n=t+this.viewOptions.step,i=t-this.viewOptions.step,r=t+e/10,s=t-e/10;this.viewOptions.reversedControls&&(n=t-this.viewOptions.step,i=t+this.viewOptions.step,r=t-e/10,s=t+e/10);const o={UP:n,DOWN:i,LEFT:i,RIGHT:n,PAGEUP:r,PAGEDOWN:s,HOME:this.viewOptions.reversedControls?this.viewOptions.ceil:this.viewOptions.floor,END:this.viewOptions.reversedControls?this.viewOptions.floor:this.viewOptions.ceil};return this.viewOptions.rightToLeft&&(o.LEFT=n,o.RIGHT=i,this.viewOptions.vertical&&(o.UP=i,o.DOWN=n)),o}onKeyboardEvent(t){const e=this.getCurrentTrackingValue(),n=oY.isNullOrUndefined(t.keyCode)?t.which:t.keyCode,i=this.getKeyActions(e)[{38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"}[n]];if(oY.isNullOrUndefined(i)||oY.isNullOrUndefined(this.currentTrackingPointer))return;t.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));const r=lY.clampToRange(i,this.viewOptions.floor,this.viewOptions.ceil),s=this.roundStep(r);if(this.viewOptions.draggableRangeOnly){const t=this.viewHighValue-this.viewLowValue;let e,n;this.currentTrackingPointer===nY.Min?(e=s,n=s+t,n>this.viewOptions.ceil&&(n=this.viewOptions.ceil,e=n-t)):this.currentTrackingPointer===nY.Max&&(n=s,e=s-t,e=this.maxHandlePosition-n;let a,l;if(e<=i){if(0===r.position)return;a=this.getMinValue(e,!0,!1),l=this.getMaxValue(e,!0,!1)}else if(o){if(s.position===this.maxHandlePosition)return;l=this.getMaxValue(e,!0,!0),a=this.getMinValue(e,!0,!0)}else a=this.getMinValue(e,!1,!1),l=this.getMaxValue(e,!1,!1);this.positionTrackingBar(a,l)}positionTrackingBar(t,e){!oY.isNullOrUndefined(this.viewOptions.minLimit)&&tthis.viewOptions.maxLimit&&(t=lY.roundToPrecisionLimit((e=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=t,this.viewHighValue=e,this.applyViewChange(),this.updateHandles(nY.Min,this.valueToPosition(t)),this.updateHandles(nY.Max,this.valueToPosition(e))}positionTrackingHandle(t){t=this.applyMinMaxLimit(t),this.range&&(this.viewOptions.pushRange?t=this.applyPushRange(t):(this.viewOptions.noSwitching&&(this.currentTrackingPointer===nY.Min&&t>this.viewHighValue?t=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===nY.Max&&tthis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(nY.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=nY.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===nY.Max&&tthis.viewOptions.maxLimit?this.viewOptions.maxLimit:t}applyMinMaxRange(t){const e=Math.abs(t-(this.currentTrackingPointer===nY.Min?this.viewHighValue:this.viewLowValue));if(!oY.isNullOrUndefined(this.viewOptions.minRange)&&ethis.viewOptions.maxRange){if(this.currentTrackingPointer===nY.Min)return lY.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===nY.Max)return lY.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return t}applyPushRange(t){const e=this.currentTrackingPointer===nY.Min?this.viewHighValue-t:t-this.viewLowValue,n=oY.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ei&&(this.currentTrackingPointer===nY.Min?(this.viewHighValue=lY.roundToPrecisionLimit(t+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(nY.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===nY.Max&&(this.viewLowValue=lY.roundToPrecisionLimit(t-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(nY.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),t}getChangeContext(){const t=new sY;return t.pointerType=this.currentTrackingPointer,t.value=+this.value,this.range&&(t.highValue=+this.highValue),t}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl),ea(tc),ea(xu))},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,RX,5),2&t){let t;Wc(t=Yc())&&(e.tooltipTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&(qc(NX,5,hY),qc(LX,5,hY),qc(jX,5,hY),qc(FX,5,hY),qc(BX,5,dY),qc(VX,5,dY),qc(zX,5,pY),qc(UX,5,pY),qc(HX,5,pY),qc($X,5,pY),qc(GX,5,pY),qc(WX,5,hY)),2&t){let t;Wc(t=Yc())&&(e.leftOuterSelectionBarElement=t.first),Wc(t=Yc())&&(e.rightOuterSelectionBarElement=t.first),Wc(t=Yc())&&(e.fullBarElement=t.first),Wc(t=Yc())&&(e.selectionBarElement=t.first),Wc(t=Yc())&&(e.minHandleElement=t.first),Wc(t=Yc())&&(e.maxHandleElement=t.first),Wc(t=Yc())&&(e.floorLabelElement=t.first),Wc(t=Yc())&&(e.ceilLabelElement=t.first),Wc(t=Yc())&&(e.minHandleLabelElement=t.first),Wc(t=Yc())&&(e.maxHandleLabelElement=t.first),Wc(t=Yc())&&(e.combinedLabelElement=t.first),Wc(t=Yc())&&(e.ticksElement=t.first)}},hostAttrs:[1,"ng5-slider"],hostVars:5,hostBindings:function(t,e){1&t&&fa("resize",function(t){return e.onResize(t)},!1,Pr),2&t&&(Ko("disabled",e.sliderElementDisabledAttr),ja("vertical",e.sliderElementVerticalClass)("animate",e.sliderElementAnimateClass))},inputs:{value:"value",highValue:"highValue",options:"options",manualRefresh:"manualRefresh",triggerFocus:"triggerFocus"},outputs:{valueChange:"valueChange",highValueChange:"highValueChange",userChangeStart:"userChangeStart",userChange:"userChange",userChangeEnd:"userChangeEnd"},features:[_l([yY]),ye],decls:29,vars:13,consts:[["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-left-out-selection"],["leftOuterSelectionBar",""],[1,"ng5-slider-span","ng5-slider-bar"],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-right-out-selection"],["rightOuterSelectionBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-full-bar"],["fullBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-selection-bar"],["selectionBar",""],[1,"ng5-slider-span","ng5-slider-bar","ng5-slider-selection",3,"ngStyle"],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-min",3,"ngStyle"],["minHandle",""],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-max",3,"ngStyle"],["maxHandle",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-floor"],["floorLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-ceil"],["ceilLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-value"],["minHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-high"],["maxHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-combined"],["combinedLabel",""],["ng5SliderElement","",1,"ng5-slider-ticks",3,"hidden"],["ticksElement",""],["class","ng5-slider-tick",3,"ngClass","ngStyle",4,"ngFor","ngForOf"],[1,"ng5-slider-tick",3,"ngClass","ngStyle"],[3,"template","tooltip","placement"],["class","ng5-slider-span ng5-slider-tick-value",3,"template","tooltip","placement","content",4,"ngIf"],["class","ng5-slider-span ng5-slider-tick-legend",3,"innerHTML",4,"ngIf"],[1,"ng5-slider-span","ng5-slider-tick-value",3,"template","tooltip","placement","content"],[1,"ng5-slider-span","ng5-slider-tick-legend",3,"innerHTML"]],template:function(t,e){1&t&&(ra(0,"span",0,1),oa(2,"span",2),sa(),ra(3,"span",3,4),oa(5,"span",2),sa(),ra(6,"span",5,6),oa(8,"span",2),sa(),ra(9,"span",7,8),oa(11,"span",9),sa(),oa(12,"span",10,11),oa(14,"span",12,13),oa(16,"span",14,15),oa(18,"span",16,17),oa(20,"span",18,19),oa(22,"span",20,21),oa(24,"span",22,23),ra(26,"span",24,25),Jo(28,KX,4,9,"span",26),sa()),2&t&&(ws(6),ja("ng5-slider-transparent",e.fullBarTransparentClass),ws(3),ja("ng5-slider-draggable",e.selectionBarDraggableClass),ws(2),na("ngStyle",e.barStyle),ws(1),na("ngStyle",e.minPointerStyle),ws(2),La("display",e.range?"inherit":"none"),na("ngStyle",e.maxPointerStyle),ws(12),ja("ng5-slider-ticks-values-under",e.ticksUnderValuesClass),na("hidden",!e.showTicks),ws(2),na("ngForOf",e.ticks))},directives:function(){return[hY,Th,dY,pY,yh,mh,_Y,_h]},styles:[".ng5-slider{display:inline-block;position:relative;height:4px;width:100%;margin:35px 0 15px;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y} .ng5-slider.with-legend{margin-bottom:40px} .ng5-slider[disabled]{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-pointer{cursor:not-allowed;background-color:#d8e0f3} .ng5-slider[disabled] .ng5-slider-draggable{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-selection{background:#8b91a2} .ng5-slider[disabled] .ng5-slider-tick{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-tick.ng5-slider-selected{background:#8b91a2} .ng5-slider .ng5-slider-span{white-space:nowrap;position:absolute;display:inline-block} .ng5-slider .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider .ng5-slider-bar-wrapper{left:0;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:-16px;padding-top:16px;width:100%;height:32px;z-index:1} .ng5-slider .ng5-slider-draggable{cursor:move} .ng5-slider .ng5-slider-bar{left:0;width:100%;height:4px;z-index:1;background:#d8e0f3;border-radius:2px} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-transparent .ng5-slider-bar{background:0 0} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-left-out-selection .ng5-slider-bar{background:#df002d} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-right-out-selection .ng5-slider-bar{background:#03a688} .ng5-slider .ng5-slider-selection{z-index:2;background:#0db9f0;border-radius:2px} .ng5-slider .ng5-slider-pointer{cursor:pointer;width:32px;height:32px;top:-14px;background-color:#0db9f0;z-index:3;border-radius:16px} .ng5-slider .ng5-slider-pointer:after{content:'';width:8px;height:8px;position:absolute;top:12px;left:12px;border-radius:4px;background:#fff} .ng5-slider .ng5-slider-pointer:hover:after{background-color:#fff} .ng5-slider .ng5-slider-pointer.ng5-slider-active{z-index:4} .ng5-slider .ng5-slider-pointer.ng5-slider-active:after{background-color:#451aff} .ng5-slider .ng5-slider-bubble{cursor:default;bottom:16px;padding:1px 3px;color:#55637d;font-size:16px} .ng5-slider .ng5-slider-bubble.ng5-slider-limit{color:#55637d} .ng5-slider .ng5-slider-ticks{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:0;position:absolute;left:0;top:-3px;margin:0;z-index:1;list-style:none} .ng5-slider .ng5-slider-ticks-values-under .ng5-slider-tick-value{top:auto;bottom:-36px} .ng5-slider .ng5-slider-tick{text-align:center;cursor:pointer;width:10px;height:10px;background:#d8e0f3;border-radius:50%;position:absolute;top:0;left:0;margin-left:11px} .ng5-slider .ng5-slider-tick.ng5-slider-selected{background:#0db9f0} .ng5-slider .ng5-slider-tick-value{position:absolute;top:-34px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0)} .ng5-slider .ng5-slider-tick-legend{position:absolute;top:24px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0);max-width:50px;white-space:normal} .ng5-slider.vertical{position:relative;width:4px;height:100%;margin:0 20px;padding:0;vertical-align:baseline;-ms-touch-action:pan-x;touch-action:pan-x} .ng5-slider.vertical .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider.vertical .ng5-slider-bar-wrapper{top:auto;left:0;margin:0 0 0 -16px;padding:0 0 0 16px;height:100%;width:32px} .ng5-slider.vertical .ng5-slider-bar{bottom:0;left:auto;width:4px;height:100%} .ng5-slider.vertical .ng5-slider-pointer{left:-14px!important;top:auto;bottom:0} .ng5-slider.vertical .ng5-slider-bubble{left:16px!important;bottom:0} .ng5-slider.vertical .ng5-slider-ticks{height:100%;width:0;left:-3px;top:0;z-index:1} .ng5-slider.vertical .ng5-slider-tick{vertical-align:middle;margin-left:auto;margin-top:11px} .ng5-slider.vertical .ng5-slider-tick-value{left:24px;top:auto;-webkit-transform:translate(0,-28%);transform:translate(0,-28%)} .ng5-slider.vertical .ng5-slider-tick-legend{top:auto;right:24px;-webkit-transform:translate(0,-28%);transform:translate(0,-28%);max-width:none;white-space:nowrap} .ng5-slider.vertical .ng5-slider-ticks-values-under .ng5-slider-tick-value{bottom:auto;left:auto;right:24px} .ng5-slider *{-webkit-transition:none;transition:none} .ng5-slider.animate .ng5-slider-bar-wrapper{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-selection{-webkit-transition:background-color linear .3s;transition:background-color linear .3s} .ng5-slider.animate .ng5-slider-pointer{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-limit{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-combined{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-tick{-webkit-transition:background-color linear .3s;transition:background-color linear .3s}"]}),t})(),_Y=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider-tooltip-wrapper"]],inputs:{template:"template",tooltip:"tooltip",placement:"placement",content:"content"},decls:2,vars:2,consts:[[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ng5-slider-inner-tooltip"]],template:function(t,e){1&t&&(Jo(0,tY,2,6,"ng-container",0),Jo(1,eY,3,3,"ng-container",0)),2&t&&(na("ngIf",e.template),ws(1),na("ngIf",!e.template))},directives:[_h,kh],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),t})(),wY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})(),xY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Rf,Hp,cU,AX,wY]]}),t})(),SY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,cX,PX,xY,x_,f_]]}),t})(),EY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,SY]]}),t})(),CY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Az,Pz,kU,cU,jU,f_]]}),t})();class OY extends class{constructor(){this.expansionModel=new kp(!0)}toggle(t){this.expansionModel.toggle(this._trackByValue(t))}expand(t){this.expansionModel.select(this._trackByValue(t))}collapse(t){this.expansionModel.deselect(this._trackByValue(t))}isExpanded(t){return this.expansionModel.isSelected(this._trackByValue(t))}toggleDescendants(t){this.expansionModel.isSelected(this._trackByValue(t))?this.collapseDescendants(t):this.expandDescendants(t)}collapseAll(){this.expansionModel.clear()}expandDescendants(t){let e=[t];e.push(...this.getDescendants(t)),this.expansionModel.select(...e.map(t=>this._trackByValue(t)))}collapseDescendants(t){let e=[t];e.push(...this.getDescendants(t)),this.expansionModel.deselect(...e.map(t=>this._trackByValue(t)))}_trackByValue(t){return this.trackBy?this.trackBy(t):t}}{constructor(t,e,n){super(),this.getLevel=t,this.isExpandable=e,this.options=n,this.options&&(this.trackBy=this.options.trackBy)}getDescendants(t){const e=[];for(let n=this.dataNodes.indexOf(t)+1;nthis._trackByValue(t)))}}const TY=new oi("CDK_TREE_NODE_OUTLET_NODE");let kY=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(TY,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeOutlet",""]]}),t})();class AY{constructor(t){this.$implicit=t}}let PY=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:["cdkTreeNodeDefWhen","when"]}}),t})(),IY=(()=>{class t{constructor(t,e){this._differs=t,this._changeDetectorRef=e,this._onDestroy=new P,this._levels=new Map,this.viewChange=new Uf({start:0,end:Number.MAX_VALUE})}get dataSource(){return this._dataSource}set dataSource(t){this._dataSource!==t&&this._switchDataSource(t)}ngOnInit(){this._dataDiffer=this._differs.find([]).create(this.trackBy)}ngOnDestroy(){this._nodeOutlet.viewContainer.clear(),this.viewChange.complete(),this._onDestroy.next(),this._onDestroy.complete(),this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null)}ngAfterContentChecked(){const t=this._nodeDefs.filter(t=>!t.when);this._defaultNodeDef=t[0],this.dataSource&&this._nodeDefs&&!this._dataSubscription&&this._observeRenderChanges()}_switchDataSource(t){this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null),t||this._nodeOutlet.viewContainer.clear(),this._dataSource=t,this._nodeDefs&&this._observeRenderChanges()}_observeRenderChanges(){let t;!function(t){return t&&"function"==typeof t.connect}(this._dataSource)?Dd(this._dataSource)?t=this._dataSource:Array.isArray(this._dataSource)&&(t=wd(this._dataSource)):t=this._dataSource.connect(this),t&&(this._dataSubscription=t.pipe(Wd(this._onDestroy)).subscribe(t=>this.renderNodeChanges(t)))}renderNodeChanges(t,e=this._dataDiffer,n=this._nodeOutlet.viewContainer,i){const r=e.diff(t);!r||(r.forEachOperation((e,r,s)=>{if(null==e.previousIndex)this.insertNode(t[s],s,n,i);else if(null==s)n.remove(r),this._levels.delete(e.item);else{const t=n.get(r);n.move(t,s)}}),this._changeDetectorRef.detectChanges())}_getNodeDef(t,e){return 1===this._nodeDefs.length?this._nodeDefs.first:this._nodeDefs.find(n=>n.when&&n.when(e,t))||this._defaultNodeDef}insertNode(t,e,n,i){const r=this._getNodeDef(t,e),s=new AY(t);s.level=this.treeControl.getLevel?this.treeControl.getLevel(t):void 0!==i&&this._levels.has(i)?this._levels.get(i)+1:0,this._levels.set(t,s.level),(n||this._nodeOutlet.viewContainer).createEmbeddedView(r.template,s,e),MY.mostRecentTreeNode&&(MY.mostRecentTreeNode.data=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(ql),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["cdk-tree"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,PY,5),2&t){let t;Wc(t=Yc())&&(e._nodeDefs=t)}},viewQuery:function(t,e){if(1&t&&qc(kY,7),2&t){let t;Wc(t=Yc())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"cdk-tree"],inputs:{dataSource:"dataSource",treeControl:"treeControl",trackBy:"trackBy"},exportAs:["cdkTree"],decls:1,vars:0,consts:[["cdkTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[kY],encapsulation:2}),t})(),MY=(()=>{class t{constructor(e,n){this._elementRef=e,this._tree=n,this._destroyed=new P,this._dataChanges=new P,t.mostRecentTreeNode=this,this._elementRef.nativeElement.classList.add("cdk-tree-node"),this.role="treeitem"}get role(){return"treeitem"}set role(t){this._elementRef.nativeElement.setAttribute("role",t)}get data(){return this._data}set data(t){t!==this._data&&(this._data=t,this._setRoleFromData(),this._dataChanges.next())}get isExpanded(){return this._tree.treeControl.isExpanded(this._data)}_setExpanded(t){this._isAriaExpanded=t,this._elementRef.nativeElement.setAttribute("aria-expanded",`${t}`)}get level(){return this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._data):this._parentNodeAriaLevel}ngOnInit(){this._parentNodeAriaLevel=function(t){let e=t.parentElement;for(;e&&!DY(e);)e=e.parentElement;return e?e.classList.contains("cdk-nested-tree-node")?bd(e.getAttribute("aria-level")):0:-1}(this._elementRef.nativeElement),this._elementRef.nativeElement.setAttribute("aria-level",`${this.level+1}`)}ngDoCheck(){this.isExpanded!=this._isAriaExpanded&&this._setExpanded(this.isExpanded)}ngOnDestroy(){t.mostRecentTreeNode===this&&(t.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}focus(){this._elementRef.nativeElement.focus()}_setRoleFromData(){this.role="treeitem"}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(IY))},t.\u0275dir=se({type:t,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),t.mostRecentTreeNode=null,t})();function DY(t){const e=t.classList;return!(!(null==e?void 0:e.contains("cdk-nested-tree-node"))&&!(null==e?void 0:e.contains("cdk-tree")))}const RY=/([A-Za-z%]+)$/;let NY=(()=>{class t{constructor(t,e,n,i){this._treeNode=t,this._tree=e,this._element=n,this._dir=i,this._destroyed=new P,this.indentUnits="px",this._indent=40,this._setPadding(),i&&i.change.pipe(Wd(this._destroyed)).subscribe(()=>this._setPadding(!0)),t._dataChanges.subscribe(()=>this._setPadding())}get level(){return this._level}set level(t){this._setLevelInput(t)}get indent(){return this._indent}set indent(t){this._setIndentInput(t)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_paddingIndent(){const t=this._treeNode.data&&this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._treeNode.data):null,e=null==this._level?t:this._level;return"number"==typeof e?`${e*this._indent}${this.indentUnits}`:null}_setPadding(t=!1){const e=this._paddingIndent();if(e!==this._currentPadding||t){const t=this._element.nativeElement,n=this._dir&&"rtl"===this._dir.value?"paddingRight":"paddingLeft",i="paddingLeft"===n?"paddingRight":"paddingLeft";t.style[n]=e||"",t.style[i]="",this._currentPadding=e}}_setLevelInput(t){this._level=bd(t,null),this._setPadding()}_setIndentInput(t){let e=t,n="px";if("string"==typeof t){const i=t.split(RY);e=i[0],n=i[1]||n}this.indentUnits=n,this._indent=bd(e),this._setPadding()}}return t.\u0275fac=function(e){return new(e||t)(ea(MY),ea(IY),ea(kl),ea(Op,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),t})(),LY=(()=>{class t{constructor(t,e){this._tree=t,this._treeNode=e,this._recursive=!1}get recursive(){return this._recursive}set recursive(t){this._recursive=md(t)}_toggle(t){this.recursive?this._tree.treeControl.toggleDescendants(this._treeNode.data):this._tree.treeControl.toggle(this._treeNode.data),t.stopPropagation()}}return t.\u0275fac=function(e){return new(e||t)(ea(IY),ea(MY))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeToggle",""]],hostBindings:function(t,e){1&t&&fa("click",function(t){return e._toggle(t)})},inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]}}),t})(),jY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const FY=By(Ly(MY));let BY=(()=>{class t extends FY{constructor(t,e,n){super(t,e),this.tabIndex=Number(n)||0,t.nativeElement.classList.add("mat-tree-node")}ngOnInit(){super.ngOnInit()}ngDoCheck(){super.ngDoCheck()}ngOnDestroy(){super.ngOnDestroy()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(IY),ii("tabindex"))},t.\u0275dir=se({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[_l([{provide:MY,useExisting:t}]),jo]}),t})(),VY=(()=>{class t extends PY{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodeDef",""]],inputs:{when:["matTreeNodeDefWhen","when"],data:["matTreeNode","data"]},features:[_l([{provide:PY,useExisting:t}]),jo]}),t})(),zY=(()=>{class t extends NY{get level(){return this._level}set level(t){this._setLevelInput(t)}get indent(){return this._indent}set indent(t){this._setIndentInput(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodePadding",""]],inputs:{level:["matTreeNodePadding","level"],indent:["matTreeNodePaddingIndent","indent"]},features:[_l([{provide:NY,useExisting:t}]),jo]}),t})(),UY=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(TY,8))},t.\u0275dir=se({type:t,selectors:[["","matTreeNodeOutlet",""]],features:[_l([{provide:kY,useExisting:t}])]}),t})(),HY=(()=>{class t extends IY{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-tree"]],viewQuery:function(t,e){if(1&t&&qc(UY,7),2&t){let t;Wc(t=Yc())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[_l([{provide:IY,useExisting:t}]),jo],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[UY],styles:[".mat-tree{display:block}.mat-tree-node{display:flex;align-items:center;flex:1;word-wrap:break-word}.mat-nested-tree-node{border-bottom-width:0}\n"],encapsulation:2}),t})(),$Y=(()=>{class t extends LY{get recursive(){return this._recursive}set recursive(t){this._recursive=md(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodeToggle",""]],inputs:{recursive:["matTreeNodeToggleRecursive","recursive"]},features:[_l([{provide:LY,useExisting:t}]),jo]}),t})(),GY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[jY,Ny],Ny]}),t})();class WY{constructor(t,e,n,i){this.transformFunction=t,this.getLevel=e,this.isExpandable=n,this.getChildren=i}_flattenNode(t,e,n,i){const r=this.transformFunction(t,e);if(n.push(r),this.isExpandable(r)){const r=this.getChildren(t);r&&(Array.isArray(r)?this._flattenChildren(r,e,n,i):r.pipe(Gp(1)).subscribe(t=>{this._flattenChildren(t,e,n,i)}))}return n}_flattenChildren(t,e,n,i){t.forEach((r,s)=>{let o=i.slice();o.push(s!=t.length-1),this._flattenNode(r,e+1,n,o)})}flattenNodes(t){let e=[];return t.forEach(t=>this._flattenNode(t,0,e,[])),e}expandFlattenedNodes(t,e){let n=[],i=[];return i[0]=!0,t.forEach(t=>{let r=!0;for(let e=0;e<=this.getLevel(t);e++)r=r&&i[e];r&&n.push(t),this.isExpandable(t)&&(i[this.getLevel(t)+1]=e.isExpanded(t))}),n}}class qY extends class{}{constructor(t,e,n){super(),this._treeControl=t,this._treeFlattener=e,this._flattenedData=new Uf([]),this._expandedData=new Uf([]),this._data=new Uf([]),n&&(this.data=n)}get data(){return this._data.value}set data(t){this._data.next(t),this._flattenedData.next(this._treeFlattener.flattenNodes(this.data)),this._treeControl.dataNodes=this._flattenedData.value}connect(t){return Q(t.viewChange,this._treeControl.expansionModel.changed,this._flattenedData).pipe(D(()=>(this._expandedData.next(this._treeFlattener.expandFlattenedNodes(this._flattenedData.value,this._treeControl)),this._expandedData.value)))}disconnect(){}}let XY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,rw,GY,fG]]}),t})(),YY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,CY,XY]]}),t})(),KY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,CY,XY,YY],CY,XY,YY]}),t})();function QY(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function ZY(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(e).forEach(function(n){void 0===t[n]?t[n]=e[n]:QY(e[n])&&QY(t[n])&&Object.keys(e[n]).length>0&&ZY(t[n],e[n])})}var JY={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function tK(){var t="undefined"!=typeof document?document:{};return ZY(t,JY),t}var eK={document:JY,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(t){return"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0)},cancelAnimationFrame:function(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function nK(){var t="undefined"!=typeof window?window:{};return ZY(t,eK),t}function iK(t){return(iK=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rK(t,e){return(rK=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function sK(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(m){return!1}}function oK(t,e,n){return(oK=sK()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&rK(r,n.prototype),r}).apply(null,arguments)}function aK(t){var e="function"==typeof Map?new Map:void 0;return(aK=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return oK(t,arguments,iK(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),rK(n,t)})(t)}var lK=function(t){function e(e){var n;return function(t){var e=t.__proto__;Object.defineProperty(t,"__proto__",{get:function(){return e},set:function(t){e.__proto__=t}})}(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n=t.call.apply(t,[this].concat(e))||this)),n}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t),e}(aK(Array));function cK(t){void 0===t&&(t=[]);var e=[];return t.forEach(function(t){Array.isArray(t)?e.push.apply(e,cK(t)):e.push(t)}),e}function uK(t,e){return Array.prototype.filter.call(t,e)}function hK(t,e){var n=nK(),i=tK(),r=[];if(!e&&t instanceof lK)return t;if(!t)return new lK(r);if("string"==typeof t){var s=t.trim();if(s.indexOf("<")>=0&&s.indexOf(">")>=0){var o="div";0===s.indexOf("0}).length>0},toggleClass:function(){for(var t=arguments.length,e=new Array(t),n=0;n=0;p-=1){var f=d[p];s&&f.listener===s||s&&f.listener&&f.listener.dom7proxy&&f.listener.dom7proxy===s?(h.removeEventListener(c,f.proxyListener,o),d.splice(p,1)):s||(h.removeEventListener(c,f.proxyListener,o),d.splice(p,1))}}return this},trigger:function(){for(var t=nK(),e=arguments.length,n=new Array(e),i=0;i0}),c.dispatchEvent(u),c.dom7EventData=[],delete c.dom7EventData}}return this},transitionEnd:function(t){var e=this;return t&&e.on("transitionend",function n(i){i.target===this&&(t.call(this,i),e.off("transitionend",n))}),this},outerWidth:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetWidth+parseFloat(e.getPropertyValue("margin-right"))+parseFloat(e.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetHeight+parseFloat(e.getPropertyValue("margin-top"))+parseFloat(e.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},styles:function(){var t=nK();return this[0]?t.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var t=nK(),e=tK(),n=this[0],i=n.getBoundingClientRect(),r=e.body;return{top:i.top+(n===t?t.scrollY:n.scrollTop)-(n.clientTop||r.clientTop||0),left:i.left+(n===t?t.scrollX:n.scrollLeft)-(n.clientLeft||r.clientLeft||0)}}return null},css:function(t,e){var n,i=nK();if(1===arguments.length){if("string"!=typeof t){for(n=0;ne-1)return hK([]);if(t<0){var n=e+t;return hK(n<0?[]:[this[n]])}return hK([this[t]])},append:function(){for(var t,e=tK(),n=0;n=0;n-=1)this[e].insertBefore(r.childNodes[n],this[e].childNodes[0])}else if(t instanceof lK)for(n=0;n0?t?this[0].nextElementSibling&&hK(this[0].nextElementSibling).is(t)?hK([this[0].nextElementSibling]):hK([]):hK(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):hK([])},nextAll:function(t){var e=[],n=this[0];if(!n)return hK([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;t?hK(i).is(t)&&e.push(i):e.push(i),n=i}return hK(e)},prev:function(t){if(this.length>0){var e=this[0];return t?e.previousElementSibling&&hK(e.previousElementSibling).is(t)?hK([e.previousElementSibling]):hK([]):hK(e.previousElementSibling?[e.previousElementSibling]:[])}return hK([])},prevAll:function(t){var e=[],n=this[0];if(!n)return hK([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;t?hK(i).is(t)&&e.push(i):e.push(i),n=i}return hK(e)},parent:function(t){for(var e=[],n=0;n=0,observer:"MutationObserver"in t||"WebkitMutationObserver"in t,passiveListener:function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});t.addEventListener("testPassiveListener",null,n)}catch(i){}return e}(),gestures:"ongesturestart"in t}}()),gK}function OK(t){return void 0===t&&(t={}),mK||(mK=function(t){var e=(void 0===t?{}:t).userAgent,n=CK(),i=nK(),r=i.navigator.platform,s=e||i.navigator.userAgent,o={ios:!1,android:!1},a=i.screen.width,l=i.screen.height,c=s.match(/(Android);?[\s\/]+([\d.]+)?/),u=s.match(/(iPad).*OS\s([\d_]+)/),h=s.match(/(iPod)(.*OS\s([\d_]+))?/),d=!u&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),p="Win32"===r,f="MacIntel"===r;return!u&&f&&n.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(a+"x"+l)>=0&&((u=s.match(/(Version)\/([\d.]+)/))||(u=[0,1,"13_0_0"]),f=!1),c&&!p&&(o.os="android",o.android=!0),(u||d||h)&&(o.os="ios",o.ios=!0),o}(t)),mK}function TK(){return bK||(bK=function(){var t,e=nK();return{isEdge:!!e.navigator.userAgent.match(/Edge/g),isSafari:(t=e.navigator.userAgent.toLowerCase(),t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0),isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),bK}var kK={name:"resize",create:function(){var t=this;SK(t,{resize:{observer:null,createObserver:function(){!t||t.destroyed||!t.initialized||(t.resize.observer=new ResizeObserver(function(e){var n=t.width,i=t.height,r=n,s=i;e.forEach(function(e){var n=e.contentBoxSize,i=e.contentRect,o=e.target;o&&o!==t.el||(r=i?i.width:(n[0]||n).inlineSize,s=i?i.height:(n[0]||n).blockSize)}),(r!==n||s!==i)&&t.resize.resizeHandler()}),t.resize.observer.observe(t.el))},removeObserver:function(){t.resize.observer&&t.resize.observer.unobserve&&t.el&&(t.resize.observer.unobserve(t.el),t.resize.observer=null)},resizeHandler:function(){!t||t.destroyed||!t.initialized||(t.emit("beforeResize"),t.emit("resize"))},orientationChangeHandler:function(){!t||t.destroyed||!t.initialized||t.emit("orientationchange")}}})},on:{init:function(t){var e=nK();t.params.resizeObserver&&void 0!==nK().ResizeObserver?t.resize.createObserver():(e.addEventListener("resize",t.resize.resizeHandler),e.addEventListener("orientationchange",t.resize.orientationChangeHandler))},destroy:function(t){var e=nK();t.resize.removeObserver(),e.removeEventListener("resize",t.resize.resizeHandler),e.removeEventListener("orientationchange",t.resize.orientationChangeHandler)}}};function AK(){return(AK=Object.assign||function(t){for(var e=1;e0)&&(!r.isTouched||!r.isMoved))){s.noSwipingClass&&""!==s.noSwipingClass&&a.target&&a.target.shadowRoot&&t.path&&t.path[0]&&(l=yK(t.path[0]));var c=s.noSwipingSelector?s.noSwipingSelector:"."+s.noSwipingClass;if(s.noSwiping&&(a.target&&a.target.shadowRoot?function(t,e){return void 0===e&&(e=this),function e(n){return n&&n!==tK()&&n!==nK()?(n.assignedSlot&&(n=n.assignedSlot),n.closest(t)||e(n.getRootNode().host)):null}(e)}(c,a.target):l.closest(c)[0]))return void(e.allowClick=!0);if(!s.swipeHandler||l.closest(s.swipeHandler)[0]){o.currentX="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,o.currentY="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY;var u=o.currentX,h=o.currentY,d=s.edgeSwipeDetection||s.iOSEdgeSwipeDetection,p=s.edgeSwipeThreshold||s.iOSEdgeSwipeThreshold;if(d&&(u<=p||u>=i.innerWidth-p)){if("prevent"!==d)return;t.preventDefault()}if(SK(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=u,o.startY=h,r.touchStartTime=_K(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,s.threshold>0&&(r.allowThresholdMove=!1),"touchstart"!==a.type){var f=!0;l.is(r.focusableElements)&&(f=!1),n.activeElement&&yK(n.activeElement).is(r.focusableElements)&&n.activeElement!==l[0]&&n.activeElement.blur(),(s.touchStartForcePreventDefault||f&&e.allowTouchMove&&s.touchStartPreventDefault)&&!l[0].isContentEditable&&a.preventDefault()}e.emit("touchStart",a)}}}}function DK(t){var e=tK(),n=this,i=n.touchEventsData,r=n.params,s=n.touches,o=n.rtlTranslate;if(n.enabled){var a=t;if(a.originalEvent&&(a=a.originalEvent),!i.isTouched)return void(i.startMoving&&i.isScrolling&&n.emit("touchMoveOpposite",a));if(!i.isTouchEvent||"touchmove"===a.type){var l="touchmove"===a.type&&a.targetTouches&&(a.targetTouches[0]||a.changedTouches[0]),c="touchmove"===a.type?l.pageX:a.pageX,u="touchmove"===a.type?l.pageY:a.pageY;if(a.preventedByNestedSwiper)return s.startX=c,void(s.startY=u);if(!n.allowTouchMove)return n.allowClick=!1,void(i.isTouched&&(SK(s,{startX:c,startY:u,currentX:c,currentY:u}),i.touchStartTime=_K()));if(i.isTouchEvent&&r.touchReleaseOnEdges&&!r.loop)if(n.isVertical()){if(us.startY&&n.translate>=n.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(cs.startX&&n.translate>=n.minTranslate())return;if(i.isTouchEvent&&e.activeElement&&a.target===e.activeElement&&yK(a.target).is(i.focusableElements))return i.isMoved=!0,void(n.allowClick=!1);if(i.allowTouchCallbacks&&n.emit("touchMove",a),!(a.targetTouches&&a.targetTouches.length>1)){s.currentX=c,s.currentY=u;var h=s.currentX-s.startX,d=s.currentY-s.startY;if(!(n.params.threshold&&Math.sqrt(Math.pow(h,2)+Math.pow(d,2))=25&&(p=180*Math.atan2(Math.abs(d),Math.abs(h))/Math.PI,i.isScrolling=n.isHorizontal()?p>r.touchAngle:90-p>r.touchAngle)),i.isScrolling&&n.emit("touchMoveOpposite",a),void 0===i.startMoving&&(s.currentX!==s.startX||s.currentY!==s.startY)&&(i.startMoving=!0),i.isScrolling)return void(i.isTouched=!1);if(i.startMoving){n.allowClick=!1,!r.cssMode&&a.cancelable&&a.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&a.stopPropagation(),i.isMoved||(r.loop&&n.loopFix(),i.startTranslate=n.getTranslate(),n.setTransition(0),n.animating&&n.$wrapperEl.trigger("webkitTransitionEnd transitionend"),i.allowMomentumBounce=!1,r.grabCursor&&(!0===n.allowSlideNext||!0===n.allowSlidePrev)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",a)),n.emit("sliderMove",a),i.isMoved=!0;var f=n.isHorizontal()?h:d;s.diff=f,f*=r.touchRatio,o&&(f=-f),n.swipeDirection=f>0?"prev":"next",i.currentTranslate=f+i.startTranslate;var g=!0,m=r.resistanceRatio;if(r.touchReleaseOnEdges&&(m=0),f>0&&i.currentTranslate>n.minTranslate()?(g=!1,r.resistance&&(i.currentTranslate=n.minTranslate()-1+Math.pow(-n.minTranslate()+i.startTranslate+f,m))):f<0&&i.currentTranslatei.startTranslate&&(i.currentTranslate=i.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(f)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,i.currentTranslate=i.startTranslate,void(s.diff=n.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}!r.followFinger||r.cssMode||((r.freeMode||r.watchSlidesProgress||r.watchSlidesVisibility)&&(n.updateActiveIndex(),n.updateSlidesClasses()),r.freeMode&&(0===i.velocities.length&&i.velocities.push({position:s[n.isHorizontal()?"startX":"startY"],time:i.touchStartTime}),i.velocities.push({position:s[n.isHorizontal()?"currentX":"currentY"],time:_K()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function RK(t){var e=this,n=e.touchEventsData,i=e.params,r=e.touches,s=e.rtlTranslate,o=e.$wrapperEl,a=e.slidesGrid,l=e.snapGrid;if(e.enabled){var c=t;if(c.originalEvent&&(c=c.originalEvent),n.allowTouchCallbacks&&e.emit("touchEnd",c),n.allowTouchCallbacks=!1,!n.isTouched)return n.isMoved&&i.grabCursor&&e.setGrabCursor(!1),n.isMoved=!1,void(n.startMoving=!1);i.grabCursor&&n.isMoved&&n.isTouched&&(!0===e.allowSlideNext||!0===e.allowSlidePrev)&&e.setGrabCursor(!1);var u,h=_K(),d=h-n.touchStartTime;if(e.allowClick&&(e.updateClickedSlide(c),e.emit("tap click",c),d<300&&h-n.lastClickTime<300&&e.emit("doubleTap doubleClick",c)),n.lastClickTime=_K(),vK(function(){e.destroyed||(e.allowClick=!0)}),!n.isTouched||!n.isMoved||!e.swipeDirection||0===r.diff||n.currentTranslate===n.startTranslate)return n.isTouched=!1,n.isMoved=!1,void(n.startMoving=!1);if(n.isTouched=!1,n.isMoved=!1,n.startMoving=!1,u=i.followFinger?s?e.translate:-e.translate:-n.currentTranslate,!i.cssMode){if(i.freeMode){if(u<-e.minTranslate())return void e.slideTo(e.activeIndex);if(u>-e.maxTranslate())return void e.slideTo(e.slides.length1){var p=n.velocities.pop(),f=n.velocities.pop(),g=p.time-f.time;e.velocity=(p.position-f.position)/g,e.velocity/=2,Math.abs(e.velocity)150||_K()-p.time>300)&&(e.velocity=0)}else e.velocity=0;e.velocity*=i.freeModeMomentumVelocityRatio,n.velocities.length=0;var m=1e3*i.freeModeMomentumRatio,b=e.translate+e.velocity*m;s&&(b=-b);var y,v,_=!1,w=20*Math.abs(e.velocity)*i.freeModeMomentumBounceRatio;if(be.minTranslate())i.freeModeMomentumBounce?(b-e.minTranslate()>w&&(b=e.minTranslate()+w),y=e.minTranslate(),_=!0,n.allowMomentumBounce=!0):b=e.minTranslate(),i.loop&&i.centeredSlides&&(v=!0);else if(i.freeModeSticky){for(var x,S=0;S-b){x=S;break}b=-(b=Math.abs(l[x]-b)=i.longSwipesMs)&&(e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses()))}for(var O=0,T=e.slidesSizesGrid[0],k=0;k=a[k]&&u=a[k]&&(O=k,T=a[a.length-1]-a[a.length-2])}var P=(u-a[O])/T,I=Oi.longSwipesMs){if(!i.longSwipes)return void e.slideTo(e.activeIndex);"next"===e.swipeDirection&&e.slideTo(P>=i.longSwipesRatio?O+I:O),"prev"===e.swipeDirection&&e.slideTo(P>1-i.longSwipesRatio?O+I:O)}else{if(!i.shortSwipes)return void e.slideTo(e.activeIndex);!e.navigation||c.target!==e.navigation.nextEl&&c.target!==e.navigation.prevEl?("next"===e.swipeDirection&&e.slideTo(O+I),"prev"===e.swipeDirection&&e.slideTo(O)):e.slideTo(c.target===e.navigation.nextEl?O+I:O)}}}}function NK(){var t=this,e=t.params,n=t.el;if(!n||0!==n.offsetWidth){e.breakpoints&&t.setBreakpoint();var i=t.allowSlideNext,r=t.allowSlidePrev,s=t.snapGrid;t.allowSlideNext=!0,t.allowSlidePrev=!0,t.updateSize(),t.updateSlides(),t.updateSlidesClasses(),t.slideTo(("auto"===e.slidesPerView||e.slidesPerView>1)&&t.isEnd&&!t.isBeginning&&!t.params.centeredSlides?t.slides.length-1:t.activeIndex,0,!1,!0),t.autoplay&&t.autoplay.running&&t.autoplay.paused&&t.autoplay.run(),t.allowSlidePrev=r,t.allowSlideNext=i,t.params.watchOverflow&&s!==t.snapGrid&&t.checkOverflow()}}function LK(t){var e=this;!e.enabled||e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation()))}function jK(){var t=this,e=t.wrapperEl,n=t.rtlTranslate;if(t.enabled){t.previousTranslate=t.translate,t.translate=t.isHorizontal()?n?e.scrollWidth-e.offsetWidth-e.scrollLeft:-e.scrollLeft:-e.scrollTop,-0===t.translate&&(t.translate=0),t.updateActiveIndex(),t.updateSlidesClasses();var i=t.maxTranslate()-t.minTranslate();(0===i?0:(t.translate-t.minTranslate())/i)!==t.progress&&t.updateProgress(n?-t.translate:t.translate),t.emit("setTranslate",t.translate,!1)}}var FK=!1;function BK(){}var VK={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!1,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,slidesPerGroupSkip:0,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,loopPreventsSlide:!0,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0,_emitClasses:!1};function zK(t,e){for(var n=0;n=0&&e.eventsAnyListeners.splice(n,1),e},off:function(t,e){var n=this;return n.eventsListeners&&t.split(" ").forEach(function(t){void 0===e?n.eventsListeners[t]=[]:n.eventsListeners[t]&&n.eventsListeners[t].forEach(function(i,r){(i===e||i.__emitterProxy&&i.__emitterProxy===e)&&n.eventsListeners[t].splice(r,1)})}),n},emit:function(){var t=this;if(!t.eventsListeners)return t;for(var e,n,i,r=arguments.length,s=new Array(r),o=0;o=0&&(v=parseFloat(v.replace("%",""))/100*s),t.virtualSize=-v,u.css(o?{marginLeft:"",marginBottom:"",marginTop:""}:{marginRight:"",marginBottom:"",marginTop:""}),i.slidesPerColumn>1&&(S=Math.floor(h/i.slidesPerColumn)===h/t.params.slidesPerColumn?h:Math.ceil(h/i.slidesPerColumn)*i.slidesPerColumn,"auto"!==i.slidesPerView&&"row"===i.slidesPerColumnFill&&(S=Math.max(S,i.slidesPerView*i.slidesPerColumn)));for(var T,k=i.slidesPerColumn,A=S/k,P=Math.floor(h/i.slidesPerColumn),I=0;I1){var D=void 0,R=void 0,N=void 0;if("row"===i.slidesPerColumnFill&&i.slidesPerGroup>1){var L=Math.floor(I/(i.slidesPerGroup*i.slidesPerColumn)),j=I-i.slidesPerColumn*i.slidesPerGroup*L,F=0===L?i.slidesPerGroup:Math.min(Math.ceil((h-L*k*i.slidesPerGroup)/k),i.slidesPerGroup);N=Math.floor(j/F),M.css({"-webkit-box-ordinal-group":D=(R=j-N*F+L*i.slidesPerGroup)+N*S/k,"-moz-box-ordinal-group":D,"-ms-flex-order":D,"-webkit-order":D,order:D})}else"column"===i.slidesPerColumnFill?(N=I-(R=Math.floor(I/k))*k,(R>P||R===P&&N===k-1)&&(N+=1)>=k&&(N=0,R+=1)):R=I-(N=Math.floor(I/A))*A;M.css(e("margin-top"),0!==N?i.spaceBetween&&i.spaceBetween+"px":"")}if("none"!==M.css("display")){if("auto"===i.slidesPerView){var B=getComputedStyle(M[0]),V=M[0].style.transform,z=M[0].style.webkitTransform;if(V&&(M[0].style.transform="none"),z&&(M[0].style.webkitTransform="none"),i.roundLengths)T=t.isHorizontal()?M.outerWidth(!0):M.outerHeight(!0);else{var U=n(B,"width"),H=n(B,"padding-left"),$=n(B,"padding-right"),G=n(B,"margin-left"),W=n(B,"margin-right"),q=B.getPropertyValue("box-sizing");if(q&&"border-box"===q)T=U+G+W;else{var X=M[0];T=U+H+$+G+W+(X.offsetWidth-X.clientWidth)}}V&&(M[0].style.transform=V),z&&(M[0].style.webkitTransform=z),i.roundLengths&&(T=Math.floor(T))}else T=(s-(i.slidesPerView-1)*v)/i.slidesPerView,i.roundLengths&&(T=Math.floor(T)),u[I]&&(u[I].style[e("width")]=T+"px");u[I]&&(u[I].swiperSlideSize=T),f.push(T),i.centeredSlides?(_=_+T/2+w/2+v,0===w&&0!==I&&(_=_-s/2-v),0===I&&(_=_-s/2-v),Math.abs(_)<.001&&(_=0),i.roundLengths&&(_=Math.floor(_)),x%i.slidesPerGroup==0&&d.push(_),p.push(_)):(i.roundLengths&&(_=Math.floor(_)),(x-Math.min(t.params.slidesPerGroupSkip,x))%t.params.slidesPerGroup==0&&d.push(_),p.push(_),_=_+T+v),t.virtualSize+=T+v,w=T,x+=1}}if(t.virtualSize=Math.max(t.virtualSize,s)+m,o&&a&&("slide"===i.effect||"coverflow"===i.effect)&&r.css({width:t.virtualSize+i.spaceBetween+"px"}),i.setWrapperSize&&r.css(((C={})[e("width")]=t.virtualSize+i.spaceBetween+"px",C)),i.slidesPerColumn>1&&(t.virtualSize=(T+i.spaceBetween)*S,t.virtualSize=Math.ceil(t.virtualSize/i.slidesPerColumn)-i.spaceBetween,r.css(((O={})[e("width")]=t.virtualSize+i.spaceBetween+"px",O)),i.centeredSlides)){E=[];for(var Y=0;Y1&&d.push(t.virtualSize-s)}if(0===d.length&&(d=[0]),0!==i.spaceBetween){var J,tt=t.isHorizontal()&&o?"marginLeft":e("marginRight");u.filter(function(t,e){return!i.cssMode||e!==u.length-1}).css(((J={})[tt]=v+"px",J))}if(i.centeredSlides&&i.centeredSlidesBounds){var et=0;f.forEach(function(t){et+=t+(i.spaceBetween?i.spaceBetween:0)});var nt=(et-=i.spaceBetween)-s;d=d.map(function(t){return t<0?-g:t>nt?nt+m:t})}if(i.centerInsufficientSlides){var it=0;if(f.forEach(function(t){it+=t+(i.spaceBetween?i.spaceBetween:0)}),(it-=i.spaceBetween)1)if(n.params.centeredSlides)n.visibleSlides.each(function(t){i.push(t)});else for(e=0;en.slides.length&&!r)break;i.push(o(a))}else i.push(o(n.activeIndex));for(e=0;es?l:s}s&&n.$wrapperEl.css("height",s+"px")},updateSlidesOffset:function(){for(var t=this.slides,e=0;e=0&&c1&&u<=e.size||c<=0&&u>=e.size)&&(e.visibleSlides.push(a),e.visibleSlidesIndexes.push(o),i.eq(o).addClass(n.slideVisibleClass))}a.progress=r?-l:l}e.visibleSlides=yK(e.visibleSlides)}},updateProgress:function(t){var e=this;void 0===t&&(t=e&&e.translate&&e.translate*(e.rtlTranslate?-1:1)||0);var n=e.params,i=e.maxTranslate()-e.minTranslate(),r=e.progress,s=e.isBeginning,o=e.isEnd,a=s,l=o;0===i?(r=0,s=!0,o=!0):(s=(r=(t-e.minTranslate())/i)<=0,o=r>=1),SK(e,{progress:r,isBeginning:s,isEnd:o}),(n.watchSlidesProgress||n.watchSlidesVisibility||n.centeredSlides&&n.autoHeight)&&e.updateSlidesProgress(t),s&&!a&&e.emit("reachBeginning toEdge"),o&&!l&&e.emit("reachEnd toEdge"),(a&&!s||l&&!o)&&e.emit("fromEdge"),e.emit("progress",r)},updateSlidesClasses:function(){var t,e=this,n=e.slides,i=e.params,r=e.$wrapperEl,s=e.activeIndex,o=e.realIndex,a=e.virtual&&i.virtual.enabled;n.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(t=a?e.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+s+'"]'):n.eq(s)).addClass(i.slideActiveClass),i.loop&&(t.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+o+'"]').addClass(i.slideDuplicateActiveClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+o+'"]').addClass(i.slideDuplicateActiveClass));var l=t.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===l.length&&(l=n.eq(0)).addClass(i.slideNextClass);var c=t.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===c.length&&(c=n.eq(-1)).addClass(i.slidePrevClass),i.loop&&(l.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),c.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass)),e.emitSlidesClasses()},updateActiveIndex:function(t){var e,n=this,i=n.rtlTranslate?n.translate:-n.translate,r=n.slidesGrid,s=n.snapGrid,o=n.params,a=n.activeIndex,l=n.realIndex,c=n.snapIndex,u=t;if(void 0===u){for(var h=0;h=r[h]&&i=r[h]&&i=r[h]&&(u=h);o.normalizeSlideIndex&&(u<0||void 0===u)&&(u=0)}if(s.indexOf(i)>=0)e=s.indexOf(i);else{var d=Math.min(o.slidesPerGroupSkip,u);e=d+Math.floor((u-d)/o.slidesPerGroup)}if(e>=s.length&&(e=s.length-1),u!==a){var p=parseInt(n.slides.eq(u).attr("data-swiper-slide-index")||u,10);SK(n,{snapIndex:e,realIndex:p,previousIndex:a,activeIndex:u}),n.emit("activeIndexChange"),n.emit("snapIndexChange"),l!==p&&n.emit("realIndexChange"),(n.initialized||n.params.runCallbacksOnInit)&&n.emit("slideChange")}else e!==c&&(n.snapIndex=e,n.emit("snapIndexChange"))},updateClickedSlide:function(t){var e,n=this,i=n.params,r=yK(t.target).closest("."+i.slideClass)[0],s=!1;if(r)for(var o=0;o6&&(i=i.split(", ").map(function(t){return t.replace(",",".")}).join(", ")),r=new s.WebKitCSSMatrix("none"===i?"":i)):n=(r=o.MozTransform||o.OTransform||o.MsTransform||o.msTransform||o.transform||o.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===e&&(i=s.WebKitCSSMatrix?r.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===e&&(i=s.WebKitCSSMatrix?r.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),i||0}(e.$wrapperEl[0],t);return i&&(s=-s),s||0},setTranslate:function(t,e){var n=this,i=n.rtlTranslate,r=n.params,s=n.$wrapperEl,o=n.wrapperEl,a=n.progress,l=0,c=0;n.isHorizontal()?l=i?-t:t:c=t,r.roundLengths&&(l=Math.floor(l),c=Math.floor(c)),r.cssMode?o[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-l:-c:r.virtualTranslate||s.transform("translate3d("+l+"px, "+c+"px, 0px)"),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?l:c;var u=n.maxTranslate()-n.minTranslate();(0===u?0:(t-n.minTranslate())/u)!==a&&n.updateProgress(t),n.emit("setTranslate",n.translate,e)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(t,e,n,i,r){void 0===t&&(t=0),void 0===e&&(e=this.params.speed),void 0===n&&(n=!0),void 0===i&&(i=!0);var s=this,o=s.params,a=s.wrapperEl;if(s.animating&&o.preventInteractionOnTransition)return!1;var l,c=s.minTranslate(),u=s.maxTranslate();if(s.updateProgress(l=i&&t>c?c:i&&ts?"next":ir?"next":i=c.length&&(m=c.length-1),(d||l.initialSlide||0)===(h||0)&&n&&o.emit("beforeSlideChangeStart");var b,y=-c[m];if(o.updateProgress(y),l.normalizeSlideIndex)for(var v=0;v=w&&_=w&&_=w&&(a=v)}if(o.initialized&&a!==d&&(!o.allowSlideNext&&yo.translate&&y>o.maxTranslate()&&(d||0)!==a))return!1;if(b=a>d?"next":a=t&&(d=t)}),void 0!==d&&(c=o.indexOf(d))<0&&(c=i.activeIndex-1),i.slideTo(c,t,e,n)},slideReset:function(t,e,n){return void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),this.slideTo(this.activeIndex,t,e,n)},slideToClosest:function(t,e,n,i){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),void 0===i&&(i=.5);var r=this,s=r.activeIndex,o=Math.min(r.params.slidesPerGroupSkip,s),a=o+Math.floor((s-o)/r.params.slidesPerGroup),l=r.rtlTranslate?r.translate:-r.translate;if(l>=r.snapGrid[a]){var c=r.snapGrid[a];l-c>(r.snapGrid[a+1]-c)*i&&(s+=r.params.slidesPerGroup)}else{var u=r.snapGrid[a-1];l-u<=(r.snapGrid[a]-u)*i&&(s-=r.params.slidesPerGroup)}return s=Math.max(s,0),s=Math.min(s,r.slidesGrid.length-1),r.slideTo(s,t,e,n)},slideToClickedSlide:function(){var t,e=this,n=e.params,i=e.$wrapperEl,r="auto"===n.slidesPerView?e.slidesPerViewDynamic():n.slidesPerView,s=e.clickedIndex;if(n.loop){if(e.animating)return;t=parseInt(yK(e.clickedSlide).attr("data-swiper-slide-index"),10),n.centeredSlides?se.slides.length-e.loopedSlides+r/2?(e.loopFix(),s=i.children("."+n.slideClass+'[data-swiper-slide-index="'+t+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),vK(function(){e.slideTo(s)})):e.slideTo(s):s>e.slides.length-r?(e.loopFix(),s=i.children("."+n.slideClass+'[data-swiper-slide-index="'+t+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),vK(function(){e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}},loop:{loopCreate:function(){var t=this,e=tK(),n=t.params,i=t.$wrapperEl;i.children("."+n.slideClass+"."+n.slideDuplicateClass).remove();var r=i.children("."+n.slideClass);if(n.loopFillGroupWithBlank){var s=n.slidesPerGroup-r.length%n.slidesPerGroup;if(s!==n.slidesPerGroup){for(var o=0;or.length&&(t.loopedSlides=r.length);var l=[],c=[];r.each(function(e,n){var i=yK(e);n=r.length-t.loopedSlides&&l.push(e),i.attr("data-swiper-slide-index",n)});for(var u=0;u=0;h-=1)i.prepend(yK(l[h].cloneNode(!0)).addClass(n.slideDuplicateClass))},loopFix:function(){var t=this;t.emit("beforeLoopFix");var e,n=t.activeIndex,i=t.slides,r=t.loopedSlides,s=t.allowSlidePrev,o=t.allowSlideNext,a=t.snapGrid,l=t.rtlTranslate;t.allowSlidePrev=!0,t.allowSlideNext=!0;var c=-a[n]-t.getTranslate();n=i.length-r&&(e=-i.length+n+r,t.slideTo(e+=r,0,!1,!0)&&0!==c&&t.setTranslate((l?-t.translate:t.translate)-c)),t.allowSlidePrev=s,t.allowSlideNext=o,t.emit("loopFix")},loopDestroy:function(){var t=this,e=t.params,n=t.slides;t.$wrapperEl.children("."+e.slideClass+"."+e.slideDuplicateClass+",."+e.slideClass+"."+e.slideBlankClass).remove(),n.removeAttr("data-swiper-slide-index")}},grabCursor:{setGrabCursor:function(t){var e=this;if(!(e.support.touch||!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)){var n=e.el;n.style.cursor="move",n.style.cursor=t?"-webkit-grabbing":"-webkit-grab",n.style.cursor=t?"-moz-grabbin":"-moz-grab",n.style.cursor=t?"grabbing":"grab"}},unsetGrabCursor:function(){var t=this;t.support.touch||t.params.watchOverflow&&t.isLocked||t.params.cssMode||(t.el.style.cursor="")}},manipulation:{appendSlide:function(t){var e=this,n=e.$wrapperEl,i=e.params;if(i.loop&&e.loopDestroy(),"object"==typeof t&&"length"in t)for(var r=0;r=o)n.appendSlide(e);else{for(var a=s>t?s+1:s,l=[],c=o-1;c>=t;c-=1){var u=n.slides.eq(c);u.remove(),l.unshift(u)}if("object"==typeof e&&"length"in e){for(var h=0;ht?s+e.length:s}else i.append(e);for(var d=0;d1,d=u.slidesPerColumn>1,p=s.enabled;h&&!d?(o.removeClass(s.containerModifierClass+"multirow "+s.containerModifierClass+"multirow-column"),t.emitContainerClasses()):!h&&d&&(o.addClass(s.containerModifierClass+"multirow"),(u.slidesPerColumnFill&&"column"===u.slidesPerColumnFill||!u.slidesPerColumnFill&&"column"===s.slidesPerColumnFill)&&o.addClass(s.containerModifierClass+"multirow-column"),t.emitContainerClasses());var f=u.direction&&u.direction!==s.direction,g=s.loop&&(u.slidesPerView!==s.slidesPerView||f);f&&n&&t.changeDirection(),SK(t.params,u);var m=t.params.enabled;SK(t,{allowTouchMove:t.params.allowTouchMove,allowSlideNext:t.params.allowSlideNext,allowSlidePrev:t.params.allowSlidePrev}),p&&!m?t.disable():!p&&m&&t.enable(),t.currentBreakpoint=l,t.emit("_beforeBreakpoint",u),g&&n&&(t.loopDestroy(),t.loopCreate(),t.updateSlides(),t.slideTo(e-r+t.loopedSlides,0,!1)),t.emit("breakpoint",u)}}},getBreakpoint:function(t,e,n){if(void 0===e&&(e="window"),t&&("container"!==e||n)){var i=!1,r=nK(),s="window"===e?r.innerHeight:n.clientHeight,o=Object.keys(t).map(function(t){if("string"==typeof t&&0===t.indexOf("@")){var e=parseFloat(t.substr(1));return{value:s*e,point:t}}return{value:t,point:t}});o.sort(function(t,e){return parseInt(t.value,10)-parseInt(e.value,10)});for(var a=0;a0&&e.slidesOffsetBefore+e.spaceBetween*(t.slides.length-1)+t.slides[0].offsetWidth*t.slides.length;t.isLocked=e.slidesOffsetBefore&&e.slidesOffsetAfter&&i?i<=t.size:1===t.snapGrid.length,t.allowSlideNext=!t.isLocked,t.allowSlidePrev=!t.isLocked,n!==t.isLocked&&t.emit(t.isLocked?"lock":"unlock"),n&&n!==t.isLocked&&(t.isEnd=!1,t.navigation&&t.navigation.update())}},classes:{addClasses:function(){var t=this,e=t.classNames,n=t.params,i=t.$el,r=t.device,s=t.support,o=function(t,e){var n=[];return t.forEach(function(t){"object"==typeof t?Object.keys(t).forEach(function(i){t[i]&&n.push(e+i)}):"string"==typeof t&&n.push(e+t)}),n}(["initialized",n.direction,{"pointer-events":s.pointerEvents&&!s.touch},{"free-mode":n.freeMode},{autoheight:n.autoHeight},{rtl:t.rtl},{multirow:n.slidesPerColumn>1},{"multirow-column":n.slidesPerColumn>1&&"column"===n.slidesPerColumnFill},{android:r.android},{ios:r.ios},{"css-mode":n.cssMode}],n.containerModifierClass);e.push.apply(e,o),i.addClass([].concat(e).join(" ")),t.emitContainerClasses()},removeClasses:function(){var t=this;t.$el.removeClass(t.classNames.join(" ")),t.emitContainerClasses()}},images:{loadImage:function(t,e,n,i,r,s){var o,a=nK();function l(){s&&s()}yK(t).parent("picture")[0]||t.complete&&r||!e?l():((o=new a.Image).onload=l,o.onerror=l,i&&(o.sizes=i),n&&(o.srcset=n),e&&(o.src=e))},preloadImages:function(){var t=this;function e(){null==t||!t||t.destroyed||(void 0!==t.imagesLoaded&&(t.imagesLoaded+=1),t.imagesLoaded===t.imagesToLoad.length&&(t.params.updateOnImagesReady&&t.update(),t.emit("imagesReady")))}t.imagesToLoad=t.$el.find("img");for(var n=0;n1){var o=[];return yK(n.el).each(function(e){var i=SK({},n,{el:e});o.push(new t(i))}),o}var a=this;a.__swiper__=!0,a.support=CK(),a.device=OK({userAgent:n.userAgent}),a.browser=TK(),a.eventsListeners={},a.eventsAnyListeners=[],void 0===a.modules&&(a.modules={}),Object.keys(a.modules).forEach(function(t){var e=a.modules[t];if(e.params){var i=Object.keys(e.params)[0],r=e.params[i];if("object"!=typeof r||null===r||(["navigation","pagination","scrollbar"].indexOf(i)>=0&&!0===n[i]&&(n[i]={auto:!0}),!(i in n)||!("enabled"in r)))return;!0===n[i]&&(n[i]={enabled:!0}),"object"==typeof n[i]&&!("enabled"in n[i])&&(n[i].enabled=!0),n[i]||(n[i]={enabled:!1})}});var l,c,u=SK({},VK);return a.useParams(u),a.params=SK({},u,HK,n),a.originalParams=SK({},a.params),a.passedParams=SK({},n),a.params&&a.params.on&&Object.keys(a.params.on).forEach(function(t){a.on(t,a.params.on[t])}),a.params&&a.params.onAny&&a.onAny(a.params.onAny),a.$=yK,SK(a,{enabled:a.params.enabled,el:e,classNames:[],slides:yK(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===a.params.direction},isVertical:function(){return"vertical"===a.params.direction},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEvents:(l=["touchstart","touchmove","touchend","touchcancel"],c=["mousedown","mousemove","mouseup"],a.support.pointerEvents&&(c=["pointerdown","pointermove","pointerup"]),a.touchEventsTouch={start:l[0],move:l[1],end:l[2],cancel:l[3]},a.touchEventsDesktop={start:c[0],move:c[1],end:c[2]},a.support.touch||!a.params.simulateTouch?a.touchEventsTouch:a.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:_K(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.useModules(),a.emit("_swiper"),a.params.init&&a.init(),a}var e=t.prototype;return e.enable=function(){var t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))},e.disable=function(){var t=this;!t.enabled||(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))},e.setProgress=function(t,e){var n=this;t=Math.min(Math.max(t,0),1);var i=n.minTranslate(),r=n.maxTranslate();n.translateTo((r-i)*t+i,void 0===e?0:e),n.updateActiveIndex(),n.updateSlidesClasses()},e.emitContainerClasses=function(){var t=this;if(t.params._emitClasses&&t.el){var e=t.el.className.split(" ").filter(function(e){return 0===e.indexOf("swiper-container")||0===e.indexOf(t.params.containerModifierClass)});t.emit("_containerClasses",e.join(" "))}},e.getSlideClasses=function(t){var e=this;return t.className.split(" ").filter(function(t){return 0===t.indexOf("swiper-slide")||0===t.indexOf(e.params.slideClass)}).join(" ")},e.emitSlidesClasses=function(){var t=this;if(t.params._emitClasses&&t.el){var e=[];t.slides.each(function(n){var i=t.getSlideClasses(n);e.push({slideEl:n,classNames:i}),t.emit("_slideClass",n,i)}),t.emit("_slideClasses",e)}},e.slidesPerViewDynamic=function(){var t=this,e=t.slides,n=t.slidesGrid,i=t.size,r=t.activeIndex,s=1;if(t.params.centeredSlides){for(var o,a=e[r].swiperSlideSize,l=r+1;li&&(o=!0));for(var c=r-1;c>=0;c-=1)e[c]&&!o&&(s+=1,(a+=e[c].swiperSlideSize)>i&&(o=!0))}else for(var u=r+1;u1)&&t.isEnd&&!t.params.centeredSlides?t.slides.length-1:t.activeIndex,0,!1,!0)||i(),n.watchOverflow&&e!==t.snapGrid&&t.checkOverflow(),t.emit("update")}function i(){var e=Math.min(Math.max(t.rtlTranslate?-1*t.translate:t.translate,t.maxTranslate()),t.minTranslate());t.setTranslate(e),t.updateActiveIndex(),t.updateSlidesClasses()}},e.changeDirection=function(t,e){void 0===e&&(e=!0);var n=this,i=n.params.direction;return t||(t="horizontal"===i?"vertical":"horizontal"),t===i||"horizontal"!==t&&"vertical"!==t||(n.$el.removeClass(""+n.params.containerModifierClass+i).addClass(""+n.params.containerModifierClass+t),n.emitContainerClasses(),n.params.direction=t,n.slides.each(function(e){"vertical"===t?e.style.width="":e.style.height=""}),n.emit("changeDirection"),e&&n.update()),n},e.mount=function(t){var e=this;if(e.mounted)return!0;var n=yK(t||e.params.el);if(!(t=n[0]))return!1;t.swiper=e;var i=function(){return"."+(e.params.wrapperClass||"").trim().split(" ").join(".")},r=function(){if(t&&t.shadowRoot&&t.shadowRoot.querySelector){var e=yK(t.shadowRoot.querySelector(i()));return e.children=function(t){return n.children(t)},e}return n.children(i())}();if(0===r.length&&e.params.createElements){var s=tK().createElement("div");r=yK(s),s.className=e.params.wrapperClass,n.append(s),n.children("."+e.params.slideClass).each(function(t){r.append(t)})}return SK(e,{$el:n,el:t,$wrapperEl:r,wrapperEl:r[0],mounted:!0,rtl:"rtl"===t.dir.toLowerCase()||"rtl"===n.css("direction"),rtlTranslate:"horizontal"===e.params.direction&&("rtl"===t.dir.toLowerCase()||"rtl"===n.css("direction")),wrongRTL:"-webkit-box"===r.css("display")}),!0},e.init=function(t){var e=this;return e.initialized||!1===e.mount(t)||(e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.params.loop&&e.loopCreate(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.enabled&&e.setGrabCursor(),e.params.preloadImages&&e.preloadImages(),e.slideTo(e.params.loop?e.params.initialSlide+e.loopedSlides:e.params.initialSlide,0,e.params.runCallbacksOnInit,!1,!0),e.attachEvents(),e.initialized=!0,e.emit("init"),e.emit("afterInit")),e},e.destroy=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0);var n=this,i=n.params,r=n.$el,s=n.$wrapperEl,o=n.slides;return void 0===n.params||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),i.loop&&n.loopDestroy(),e&&(n.removeClasses(),r.removeAttr("style"),s.removeAttr("style"),o&&o.length&&o.removeClass([i.slideVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(function(t){n.off(t)}),!1!==t&&(n.$el[0].swiper=null,function(e){var n=e;Object.keys(n).forEach(function(e){try{n[e]=null}catch(t){}try{delete n[e]}catch(t){}})}(n)),n.destroyed=!0),null},t.extendDefaults=function(t){SK(HK,t)},t.installModule=function(e){t.prototype.modules||(t.prototype.modules={});var n=e.name||Object.keys(t.prototype.modules).length+"_"+_K();t.prototype.modules[n]=e},t.use=function(e){return Array.isArray(e)?(e.forEach(function(e){return t.installModule(e)}),t):(t.installModule(e),t)},function(t,e,n){n&&zK(t,n)}(t,0,[{key:"extendedDefaults",get:function(){return HK}},{key:"defaults",get:function(){return VK}}]),t}();Object.keys(UK).forEach(function(t){Object.keys(UK[t]).forEach(function(e){$K.prototype[e]=UK[t][e]})}),$K.use([kK,IK]);var GK=$K;const WK=["prevElRef"],qK=["nextElRef"],XK=["scrollbarElRef"],YK=["paginationElRef"];function KK(t,e){1&t&&(aa(0),oa(1,"div",6,7),oa(3,"div",8,9),la())}function QK(t,e){1&t&&oa(0,"div",10,11)}function ZK(t,e){1&t&&oa(0,"div",12,13)}function JK(t,e){}function tQ(t,e){1&t&&Jo(0,JK,0,0,"ng-template")}function eQ(t,e){}function nQ(t,e){1&t&&Jo(0,eQ,0,0,"ng-template")}function iQ(t,e){}function rQ(t,e){1&t&&Jo(0,iQ,0,0,"ng-template")}function sQ(t,e){}const oQ=function(t){return{$implicit:t}};function aQ(t,e){if(1&t&&(ra(0,"div",3),Jo(1,sQ,0,0,"ng-template",18),sa()),2&t){const t=va().$implicit;na("ngClass",va(2).zoomContainerClass),ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Tc(3,oQ,t.slideData))}}function lQ(t,e){}function cQ(t,e){if(1&t&&(aa(0),Jo(1,lQ,0,0,"ng-template",18),la()),2&t){const t=va().$implicit;ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Tc(2,oQ,t.slideData))}}function uQ(t,e){if(1&t&&(ra(0,"div",15),Jo(1,aQ,2,5,"div",16),Jo(2,cQ,2,4,"ng-container",17),sa()),2&t){const t=e.$implicit,n=va().key,i=va();(function(t){Ua(qa,Fa,t,!1)})(i.style),na("ngClass",(t.class?t.class+" ":"")+i.slideClass+(""!==n?" "+i.slideDuplicateClass:""))("ngSwitch",t.zoom),Ko("data-swiper-slide-index",t.virtualIndex?t.virtualIndex:t.slideIndex),ws(1),na("ngSwitchCase",!0)}}function hQ(t,e){1&t&&(Jo(0,uQ,3,6,"div",14),Ic(1,"async")),2&t&&na("ngForOf",Mc(1,1,e.loopSlides))}const dQ=[[["","slot","container-start"]],[["","slot","wrapper-start"]],[["","slot","wrapper-end"]],[["","slot","container-end"]]],pQ=function(t){return{loopSlides:t,key:"prepend"}},fQ=function(t){return{loopSlides:t,key:""}},gQ=function(t){return{loopSlides:t,key:"append"}},mQ=["[slot=container-start]","[slot=wrapper-start]","[slot=wrapper-end]","[slot=container-end]"];function bQ(t){return"object"==typeof t&&null!==t&&t.constructor&&"Object"===Object.prototype.toString.call(t).slice(8,-1)}function yQ(t,e,n){return!0===_Q(t)&&e&&!e.el||!("boolean"!=typeof e&&e.el!==(null==n?void 0:n.nativeElement)&&("string"==typeof e.el||"object"==typeof e.el))}function vQ(t,e){const n=["__proto__","constructor","prototype"];Object.keys(e).filter(t=>n.indexOf(t)<0).forEach(n=>{void 0!==t[n]?t[n]&&!e[n]||(bQ(e[n])&&bQ(t[n])&&Object.keys(e[n]).length>0?e[n].__swiper__?t[n]=e[n]:vQ(t[n],e[n]):t[n]=e[n]):t[n]=e[n]})}function _Q(t){return null!=t&&"false"!=`${t}`}const wQ=["pagination","navigation","scrollbar","virtual"];function xQ(t,e={}){return bQ(t)?t:!0===_Q(t)&&e}const SQ=["init","_direction","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_freeModeMomentum","_freeModeMomentumRatio","_freeModeMomentumBounce","_freeModeMomentumBounceRatio","_freeModeMomentumVelocityRatio","_freeModeSticky","_freeModeMinimumVelocity","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","_slidesPerColumn","_slidesPerColumnFill","_slidesPerGroup","_slidesPerGroupSkip","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_watchSlidesVisibility","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_preloadImages","updateOnImagesReady","_loop","_loopAdditionalSlides","_loopedSlides","_loopFillGroupWithBlank","loopPreventsSlide","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","hashNavigation","history","keyboard","lazy","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom"].map(t=>t.replace(/_/,""));function EQ(t={}){const e={on:{}},n={};vQ(e,GK.defaults),vQ(e,GK.extendedDefaults),e._emitClasses=!0;const i={};return Object.keys(t).forEach(r=>{const s=r.replace(/^_/,"");void 0!==t[s]&&(SQ.indexOf(s)>=0?bQ(t[s])?(e[s]={},n[s]={},vQ(e[s],t[s]),vQ(n[s],t[s])):(e[s]=t[s],n[s]=t[s]):i[s]=t[s])}),{params:e,passedParams:n,rest:i}}let CQ=(()=>{class t{constructor(t){this.template=t,this.class="",this.slideData={isActive:!1,isPrev:!1,isNext:!1,isVisible:!1,isDuplicate:!1}}set zoom(t){this._zoom=_Q(t)}get zoom(){return this._zoom}get classNames(){return this._classNames}set classNames(t){this._classNames!==t&&(this._classNames=t,this.slideData={isActive:this._hasClass(["swiper-slide-active","swiper-slide-duplicate-active"]),isVisible:this._hasClass(["swiper-slide-visible"]),isDuplicate:this._hasClass(["swiper-slide-duplicate"]),isPrev:this._hasClass(["swiper-slide-prev","swiper-slide-duplicate-prev"]),isNext:this._hasClass(["swiper-slide-next","swiper-slide-duplicate-next"])})}_hasClass(t){return t.some(t=>this._classNames.indexOf(t)>=0)}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),t})(),OQ=(()=>{class t{constructor(t,e,n,i){this._ngZone=t,this.elementRef=e,this._changeDetectorRef=n,this._platformId=i,this.slideClass="swiper-slide",this.wrapperClass="swiper-wrapper",this.showNavigation=!0,this.showPagination=!0,this.showScrollbar=!0,this.s__beforeBreakpoint=new Rc,this.s__containerClasses=new Rc,this.s__slideClass=new Rc,this.s__swiper=new Rc,this.s_activeIndexChange=new Rc,this.s_afterInit=new Rc,this.s_autoplay=new Rc,this.s_autoplayStart=new Rc,this.s_autoplayStop=new Rc,this.s_beforeDestroy=new Rc,this.s_beforeInit=new Rc,this.s_beforeLoopFix=new Rc,this.s_beforeResize=new Rc,this.s_beforeSlideChangeStart=new Rc,this.s_beforeTransitionStart=new Rc,this.s_breakpoint=new Rc,this.s_changeDirection=new Rc,this.s_click=new Rc,this.s_doubleTap=new Rc,this.s_doubleClick=new Rc,this.s_destroy=new Rc,this.s_fromEdge=new Rc,this.s_hashChange=new Rc,this.s_hashSet=new Rc,this.s_imagesReady=new Rc,this.s_init=new Rc,this.s_keyPress=new Rc,this.s_lazyImageLoad=new Rc,this.s_lazyImageReady=new Rc,this.s_loopFix=new Rc,this.s_momentumBounce=new Rc,this.s_navigationHide=new Rc,this.s_navigationShow=new Rc,this.s_observerUpdate=new Rc,this.s_orientationchange=new Rc,this.s_paginationHide=new Rc,this.s_paginationRender=new Rc,this.s_paginationShow=new Rc,this.s_paginationUpdate=new Rc,this.s_progress=new Rc,this.s_reachBeginning=new Rc,this.s_reachEnd=new Rc,this.s_realIndexChange=new Rc,this.s_resize=new Rc,this.s_scroll=new Rc,this.s_scrollbarDragEnd=new Rc,this.s_scrollbarDragMove=new Rc,this.s_scrollbarDragStart=new Rc,this.s_setTransition=new Rc,this.s_setTranslate=new Rc,this.s_slideChange=new Rc,this.s_slideChangeTransitionEnd=new Rc,this.s_slideChangeTransitionStart=new Rc,this.s_slideNextTransitionEnd=new Rc,this.s_slideNextTransitionStart=new Rc,this.s_slidePrevTransitionEnd=new Rc,this.s_slidePrevTransitionStart=new Rc,this.s_slideResetTransitionStart=new Rc,this.s_slideResetTransitionEnd=new Rc,this.s_sliderMove=new Rc,this.s_sliderFirstMove=new Rc,this.s_slidesLengthChange=new Rc,this.s_slidesGridLengthChange=new Rc,this.s_snapGridLengthChange=new Rc,this.s_snapIndexChange=new Rc,this.s_tap=new Rc,this.s_toEdge=new Rc,this.s_touchEnd=new Rc,this.s_touchMove=new Rc,this.s_touchMoveOpposite=new Rc,this.s_touchStart=new Rc,this.s_transitionEnd=new Rc,this.s_transitionStart=new Rc,this.s_update=new Rc,this.s_zoomChange=new Rc,this.s_swiper=new Rc,this.indexChange=new Rc,this._activeSlides=new P,this.containerClasses="swiper-container",this.slidesChanges=t=>{this.slides=t.map((t,e)=>(t.slideIndex=e,t.classNames=this.slideClass,t)),this.loop&&!this.loopedSlides&&this.calcLoopedSlides(),this.virtual?this.swiperRef&&this.swiperRef.virtual&&this._ngZone.runOutsideAngular(()=>{this.swiperRef.virtual.slides=this.slides,this.swiperRef.virtual.update(!0)}):(this.prependSlides=wd(this.slides.slice(this.slides.length-this.loopedSlides)),this.appendSlides=wd(this.slides.slice(0,this.loopedSlides))),this._changeDetectorRef.detectChanges()},this.style=null,this.updateVirtualSlides=t=>{!this.swiperRef||this.currentVirtualData&&this.currentVirtualData.from===t.from&&this.currentVirtualData.to===t.to&&this.currentVirtualData.offset===t.offset||(this.style=this.swiperRef.isHorizontal()?{[this.swiperRef.rtlTranslate?"right":"left"]:`${t.offset}px`}:{top:`${t.offset}px`},this.currentVirtualData=t,this._activeSlides.next(t.slides),this._ngZone.run(()=>{this._changeDetectorRef.detectChanges()}),this._ngZone.runOutsideAngular(()=>{this.swiperRef.updateSlides(),this.swiperRef.updateProgress(),this.swiperRef.updateSlidesClasses(),this.swiperRef.lazy&&this.swiperRef.params.lazy.enabled&&this.swiperRef.lazy.load(),this.swiperRef.virtual.update(!0)}))}}set navigation(t){var e,n,i;const r="boolean"!=typeof this._navigation?null===(e=this._navigation)||void 0===e?void 0:e.nextEl:null,s="boolean"!=typeof this._navigation?null===(n=this._navigation)||void 0===n?void 0:n.prevEl:null;this._navigation=xQ(t,{nextEl:r||null,prevEl:s||null}),this.showNavigation=!(!0!==_Q(t)||this._navigation&&"boolean"!=typeof this._navigation&&this._navigation.prevEl!==(null===(i=this._prevElRef)||void 0===i?void 0:i.nativeElement)&&(null!==this._navigation.prevEl||null!==this._navigation.nextEl)&&("string"==typeof this._navigation.nextEl||"string"==typeof this._navigation.prevEl||"object"==typeof this._navigation.nextEl||"object"==typeof this._navigation.prevEl))}get navigation(){return this._navigation}set pagination(t){var e;const n="boolean"!=typeof this._pagination?null===(e=this._pagination)||void 0===e?void 0:e.el:null;this._pagination=xQ(t,{el:n||null}),this.showPagination=yQ(t,this._pagination,this._paginationElRef)}get pagination(){return this._pagination}set scrollbar(t){var e;const n="boolean"!=typeof this._scrollbar?null===(e=this._scrollbar)||void 0===e?void 0:e.el:null;this._scrollbar=xQ(t,{el:n||null}),this.showScrollbar=yQ(t,this._scrollbar,this._scrollbarElRef)}get scrollbar(){return this._scrollbar}set virtual(t){this._virtual=xQ(t)}get virtual(){return this._virtual}set index(t){this.setIndex(t)}set config(t){this.updateSwiper(t);const{params:e}=EQ(t);Object.assign(this,e)}set prevElRef(t){this._prevElRef=t,this._setElement(t,this.navigation,"navigation","prevEl")}set nextElRef(t){this._nextElRef=t,this._setElement(t,this.navigation,"navigation","nextEl")}set scrollbarElRef(t){this._scrollbarElRef=t,this._setElement(t,this.scrollbar,"scrollbar")}set paginationElRef(t){this._paginationElRef=t,this._setElement(t,this.pagination,"pagination")}get activeSlides(){return this.virtual?this._activeSlides:wd(this.slides)}get zoomContainerClass(){return"boolean"!=typeof this.zoom?this.zoom.containerClass:"swiper-zoom-container"}_setElement(t,e,n,i="el"){if(!t||!e)return;if(e&&t.nativeElement){if(e[i]===t.nativeElement)return;e[i]=t.nativeElement}const r={};r[n]=!0,this.updateInitSwiper(r)}ngOnInit(){const{params:t}=EQ(this);Object.assign(this,t)}ngAfterViewInit(){this.childrenSlidesInit(),this.initSwiper(),this._changeDetectorRef.detectChanges(),setTimeout(()=>{this.s_swiper.emit(this.swiperRef)})}childrenSlidesInit(){this.slidesChanges(this.slidesEl),this.slidesEl.changes.subscribe(this.slidesChanges)}get isSwiperActive(){return this.swiperRef&&!this.swiperRef.destroyed}initSwiper(){const{params:t}=EQ(this);Object.assign(this,t),this._ngZone.runOutsideAngular(()=>{t.init=!1,t.virtual||(t.observer=!0),t.onAny=(t,...e)=>{const n=this[`s_${t}`];n&&n.emit(...e)},Object.assign(t.on,{_containerClasses(t,e){this.containerClasses=e},_slideClasses:(t,e)=>{e.forEach(({slideEl:t,classNames:e},n)=>{const i=parseInt(t.getAttribute("data-swiper-slide-index"))||n;if(this.virtual){const t=this.slides.find(t=>t.virtualIndex&&t.virtualIndex===i);if(t)return void(t.classNames=e)}this.slides[i]&&(this.slides[i].classNames=e)}),this._changeDetectorRef.detectChanges()}});const e=new GK(t);if(e.loopCreate=()=>{},e.loopDestroy=()=>{},t.loop&&(e.loopedSlides=this.loopedSlides),e.virtual&&e.params.virtual.enabled){e.virtual.slides=this.slides;const t={cache:!1,renderExternal:this.updateVirtualSlides,renderExternalUpdate:!1};vQ(e.params.virtual,t),vQ(e.originalParams.virtual,t)}Lh(this._platformId)&&(this.swiperRef=e.init(this.elementRef.nativeElement),this.swiperRef.virtual&&this.swiperRef.params.virtual.enabled&&this.swiperRef.virtual.update(!0),this._changeDetectorRef.detectChanges(),e.on("slideChange",()=>{this.indexChange.emit(this.swiperRef.realIndex)}))})}ngOnChanges(t){this.updateSwiper(t),this._changeDetectorRef.detectChanges()}updateInitSwiper(t){!t||!this.swiperRef||this.swiperRef.destroyed||this._ngZone.runOutsideAngular(()=>{const{pagination:e,navigation:n,scrollbar:i,thumbs:r}=this.swiperRef;t.pagination&&(this.pagination&&"boolean"!=typeof this.pagination&&this.pagination.el&&e&&!e.el?(this.updateParameter("pagination",this.pagination),e.init(),e.render(),e.update()):(e.destroy(),e.el=null)),t.scrollbar&&(this.scrollbar&&"boolean"!=typeof this.scrollbar&&this.scrollbar.el&&i&&!i.el?(this.updateParameter("scrollbar",this.scrollbar),i.init(),i.updateSize(),i.setTranslate()):(i.destroy(),i.el=null)),t.navigation&&(this.navigation&&"boolean"!=typeof this.navigation&&this.navigation.prevEl&&this.navigation.nextEl&&n&&!n.prevEl&&!n.nextEl?(this.updateParameter("navigation",this.navigation),n.init(),n.update()):n.prevEl&&n.nextEl&&(n.destroy(),n.nextEl=null,n.prevEl=null)),t.thumbs&&this.thumbs&&this.thumbs.swiper&&(this.updateParameter("thumbs",this.thumbs),r.init()&&r.update(!0)),t.controller&&this.controller&&this.controller.control&&(this.swiperRef.controller.control=this.controller.control),this.swiperRef.update()})}updateSwiper(t){this._ngZone.runOutsideAngular(()=>{var e,n;if(!t.config&&t&&this.swiperRef&&!this.swiperRef.destroyed){for(const i in t){if(wQ.indexOf(i)>=0)continue;const r=null!==(n=null===(e=t[i])||void 0===e?void 0:e.currentValue)&&void 0!==n?n:t[i];this.updateParameter(i,r)}t.allowSlideNext&&(this.swiperRef.allowSlideNext=this.allowSlideNext),t.allowSlidePrev&&(this.swiperRef.allowSlidePrev=this.allowSlidePrev),t.direction&&this.swiperRef.changeDirection(this.direction,!1),t.breakpoints&&(this.loop&&!this.loopedSlides&&this.calcLoopedSlides(),this.swiperRef.currentBreakpoint=null,this.swiperRef.setBreakpoint()),(t.thumbs||t.controller)&&this.updateInitSwiper(t),this.swiperRef.update()}})}calcLoopedSlides(){if(!this.loop)return;let t=this.slidesPerView;if(this.breakpoints){const e=GK.prototype.getBreakpoint(this.breakpoints),n=e in this.breakpoints?this.breakpoints[e]:void 0;n&&n.slidesPerView&&(t=n.slidesPerView)}if("auto"===t)return this.loopedSlides=this.slides.length,this.slides.length;let e=this.loopedSlides||t;return e+=this.loopAdditionalSlides,e>this.slides.length&&(e=this.slides.length),this.loopedSlides=e,e}updateParameter(t,e){if(!this.swiperRef||this.swiperRef.destroyed)return;const n=t.replace(/^_/,""),i=bQ(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){const t=this.swiperRef.modules[n].params[n];i?vQ(this.swiperRef.params[n],t):this.swiperRef.params[n]=t}i&&bQ(e)?vQ(this.swiperRef.params[n],e):this.swiperRef.params[n]=e}setIndex(t,e,n){this.isSwiperActive?t!==this.swiperRef.activeIndex&&this._ngZone.runOutsideAngular(()=>{this.loop?this.swiperRef.slideToLoop(t,e,!n):this.swiperRef.slideTo(t,e,!n)}):this.initialSlide=t}ngOnDestroy(){this._ngZone.runOutsideAngular(()=>{var t;null===(t=this.swiperRef)||void 0===t||t.destroy(!0,!1)})}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(kl),ea(tc),ea(ou))},t.\u0275cmp=Jt({type:t,selectors:[["swiper"],["","swiper",""]],contentQueries:function(t,e,n){if(1&t&&Xc(n,CQ,4),2&t){let t;Wc(t=Yc())&&(e.slidesEl=t)}},viewQuery:function(t,e){if(1&t&&(qc(WK,5),qc(qK,5),qc(XK,5),qc(YK,5)),2&t){let t;Wc(t=Yc())&&(e.prevElRef=t.first),Wc(t=Yc())&&(e.nextElRef=t.first),Wc(t=Yc())&&(e.scrollbarElRef=t.first),Wc(t=Yc())&&(e.paginationElRef=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.containerClasses)},inputs:{slideClass:"slideClass",wrapperClass:"wrapperClass",navigation:"navigation",pagination:"pagination",scrollbar:"scrollbar",virtual:"virtual",index:"index",config:"config",loopedSlides:"loopedSlides",initialSlide:"initialSlide",direction:"direction",touchEventsTarget:"touchEventsTarget",speed:"speed",cssMode:"cssMode",updateOnWindowResize:"updateOnWindowResize",resizeObserver:"resizeObserver",nested:"nested",focusableElements:"focusableElements",width:"width",height:"height",preventInteractionOnTransition:"preventInteractionOnTransition",userAgent:"userAgent",url:"url",edgeSwipeDetection:"edgeSwipeDetection",edgeSwipeThreshold:"edgeSwipeThreshold",freeMode:"freeMode",freeModeMomentum:"freeModeMomentum",freeModeMomentumRatio:"freeModeMomentumRatio",freeModeMomentumBounce:"freeModeMomentumBounce",freeModeMomentumBounceRatio:"freeModeMomentumBounceRatio",freeModeMomentumVelocityRatio:"freeModeMomentumVelocityRatio",freeModeSticky:"freeModeSticky",freeModeMinimumVelocity:"freeModeMinimumVelocity",autoHeight:"autoHeight",setWrapperSize:"setWrapperSize",virtualTranslate:"virtualTranslate",effect:"effect",breakpoints:"breakpoints",spaceBetween:"spaceBetween",slidesPerView:"slidesPerView",slidesPerColumn:"slidesPerColumn",slidesPerColumnFill:"slidesPerColumnFill",slidesPerGroup:"slidesPerGroup",slidesPerGroupSkip:"slidesPerGroupSkip",centeredSlides:"centeredSlides",centeredSlidesBounds:"centeredSlidesBounds",slidesOffsetBefore:"slidesOffsetBefore",slidesOffsetAfter:"slidesOffsetAfter",normalizeSlideIndex:"normalizeSlideIndex",centerInsufficientSlides:"centerInsufficientSlides",watchOverflow:"watchOverflow",roundLengths:"roundLengths",touchRatio:"touchRatio",touchAngle:"touchAngle",simulateTouch:"simulateTouch",shortSwipes:"shortSwipes",longSwipes:"longSwipes",longSwipesRatio:"longSwipesRatio",longSwipesMs:"longSwipesMs",followFinger:"followFinger",allowTouchMove:"allowTouchMove",threshold:"threshold",touchMoveStopPropagation:"touchMoveStopPropagation",touchStartPreventDefault:"touchStartPreventDefault",touchStartForcePreventDefault:"touchStartForcePreventDefault",touchReleaseOnEdges:"touchReleaseOnEdges",uniqueNavElements:"uniqueNavElements",resistance:"resistance",resistanceRatio:"resistanceRatio",watchSlidesProgress:"watchSlidesProgress",watchSlidesVisibility:"watchSlidesVisibility",grabCursor:"grabCursor",preventClicks:"preventClicks",preventClicksPropagation:"preventClicksPropagation",slideToClickedSlide:"slideToClickedSlide",preloadImages:"preloadImages",updateOnImagesReady:"updateOnImagesReady",loop:"loop",loopAdditionalSlides:"loopAdditionalSlides",loopFillGroupWithBlank:"loopFillGroupWithBlank",loopPreventsSlide:"loopPreventsSlide",allowSlidePrev:"allowSlidePrev",allowSlideNext:"allowSlideNext",swipeHandler:"swipeHandler",noSwiping:"noSwiping",noSwipingClass:"noSwipingClass",noSwipingSelector:"noSwipingSelector",passiveListeners:"passiveListeners",containerModifierClass:"containerModifierClass",slideBlankClass:"slideBlankClass",slideActiveClass:"slideActiveClass",slideDuplicateActiveClass:"slideDuplicateActiveClass",slideVisibleClass:"slideVisibleClass",slideDuplicateClass:"slideDuplicateClass",slideNextClass:"slideNextClass",slideDuplicateNextClass:"slideDuplicateNextClass",slidePrevClass:"slidePrevClass",slideDuplicatePrevClass:"slideDuplicatePrevClass",runCallbacksOnInit:"runCallbacksOnInit",observeParents:"observeParents",observeSlideChildren:"observeSlideChildren",a11y:"a11y",autoplay:"autoplay",controller:"controller",coverflowEffect:"coverflowEffect",cubeEffect:"cubeEffect",fadeEffect:"fadeEffect",flipEffect:"flipEffect",hashNavigation:"hashNavigation",history:"history",keyboard:"keyboard",lazy:"lazy",mousewheel:"mousewheel",parallax:"parallax",thumbs:"thumbs",zoom:"zoom",class:"class",id:"id"},outputs:{s__beforeBreakpoint:"_beforeBreakpoint",s__containerClasses:"_containerClasses",s__slideClass:"_slideClass",s__swiper:"_swiper",s_activeIndexChange:"activeIndexChange",s_afterInit:"afterInit",s_autoplay:"autoplay",s_autoplayStart:"autoplayStart",s_autoplayStop:"autoplayStop",s_beforeDestroy:"beforeDestroy",s_beforeInit:"beforeInit",s_beforeLoopFix:"beforeLoopFix",s_beforeResize:"beforeResize",s_beforeSlideChangeStart:"beforeSlideChangeStart",s_beforeTransitionStart:"beforeTransitionStart",s_breakpoint:"breakpoint",s_changeDirection:"changeDirection",s_click:"click",s_doubleTap:"doubleTap",s_doubleClick:"doubleClick",s_destroy:"destroy",s_fromEdge:"fromEdge",s_hashChange:"hashChange",s_hashSet:"hashSet",s_imagesReady:"imagesReady",s_init:"init",s_keyPress:"keyPress",s_lazyImageLoad:"lazyImageLoad",s_lazyImageReady:"lazyImageReady",s_loopFix:"loopFix",s_momentumBounce:"momentumBounce",s_navigationHide:"navigationHide",s_navigationShow:"navigationShow",s_observerUpdate:"observerUpdate",s_orientationchange:"orientationchange",s_paginationHide:"paginationHide",s_paginationRender:"paginationRender",s_paginationShow:"paginationShow",s_paginationUpdate:"paginationUpdate",s_progress:"progress",s_reachBeginning:"reachBeginning",s_reachEnd:"reachEnd",s_realIndexChange:"realIndexChange",s_resize:"resize",s_scroll:"scroll",s_scrollbarDragEnd:"scrollbarDragEnd",s_scrollbarDragMove:"scrollbarDragMove",s_scrollbarDragStart:"scrollbarDragStart",s_setTransition:"setTransition",s_setTranslate:"setTranslate",s_slideChange:"slideChange",s_slideChangeTransitionEnd:"slideChangeTransitionEnd",s_slideChangeTransitionStart:"slideChangeTransitionStart",s_slideNextTransitionEnd:"slideNextTransitionEnd",s_slideNextTransitionStart:"slideNextTransitionStart",s_slidePrevTransitionEnd:"slidePrevTransitionEnd",s_slidePrevTransitionStart:"slidePrevTransitionStart",s_slideResetTransitionStart:"slideResetTransitionStart",s_slideResetTransitionEnd:"slideResetTransitionEnd",s_sliderMove:"sliderMove",s_sliderFirstMove:"sliderFirstMove",s_slidesLengthChange:"slidesLengthChange",s_slidesGridLengthChange:"slidesGridLengthChange",s_snapGridLengthChange:"snapGridLengthChange",s_snapIndexChange:"snapIndexChange",s_tap:"tap",s_toEdge:"toEdge",s_touchEnd:"touchEnd",s_touchMove:"touchMove",s_touchMoveOpposite:"touchMoveOpposite",s_touchStart:"touchStart",s_transitionEnd:"transitionEnd",s_transitionStart:"transitionStart",s_update:"update",s_zoomChange:"zoomChange",s_swiper:"swiper",indexChange:"indexChange"},features:[ye],ngContentSelectors:mQ,decls:13,vars:17,consts:[[4,"ngIf"],["class","swiper-scrollbar",4,"ngIf"],["class","swiper-pagination",4,"ngIf"],[3,"ngClass"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["slidesTemplate",""],[1,"swiper-button-prev"],["prevElRef",""],[1,"swiper-button-next"],["nextElRef",""],[1,"swiper-scrollbar"],["scrollbarElRef",""],[1,"swiper-pagination"],["paginationElRef",""],[3,"ngClass","style","ngSwitch",4,"ngFor","ngForOf"],[3,"ngClass","ngSwitch"],[3,"ngClass",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(t,e){if(1&t&&(wa(dQ),xa(0),Jo(1,KK,5,0,"ng-container",0),Jo(2,QK,2,0,"div",1),Jo(3,ZK,2,0,"div",2),ra(4,"div",3),xa(5,1),Jo(6,tQ,1,0,void 0,4),Jo(7,nQ,1,0,void 0,4),Jo(8,rQ,1,0,void 0,4),xa(9,2),sa(),xa(10,3),Jo(11,hQ,2,3,"ng-template",null,5,Jc)),2&t){const t=ta(12);ws(1),na("ngIf",e.navigation&&e.showNavigation),ws(1),na("ngIf",e.scrollbar&&e.showScrollbar),ws(1),na("ngIf",e.pagination&&e.showPagination),ws(1),na("ngClass",e.wrapperClass),Ko("id",e.id),ws(2),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(11,pQ,e.prependSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(13,fQ,e.activeSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(15,gQ,e.appendSlides))}},directives:[_h,mh,kh,yh,Eh,Ch,Oh],pipes:[Dh],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),t})(),TQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})();function kQ(){return(kQ=Object.assign||function(t){for(var e=1;e0&&(n(s,!!t.isBeginning),t.params.watchOverflow&&t.enabled&&s[t.isLocked?"addClass":"removeClass"](e.lockClass)),r&&r.length>0&&(n(r,!!t.isEnd),t.params.watchOverflow&&t.enabled&&r[t.isLocked?"addClass":"removeClass"](e.lockClass))}},onPrevClick:function(t){var e=this;t.preventDefault(),(!e.isBeginning||e.params.loop)&&e.slidePrev()},onNextClick:function(t){var e=this;t.preventDefault(),(!e.isEnd||e.params.loop)&&e.slideNext()},init:function(){var t,e,n=this,i=n.params.navigation;n.params.navigation=function(t,e,n,i){var r=tK();return n&&Object.keys(i).forEach(function(n){if(!e[n]&&!0===e.auto){var s=r.createElement("div");s.className=i[n],t.append(s),e[n]=s}}),e}(n.$el,n.params.navigation,n.params.createElements,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),(i.nextEl||i.prevEl)&&(i.nextEl&&(t=yK(i.nextEl),n.params.uniqueNavElements&&"string"==typeof i.nextEl&&t.length>1&&1===n.$el.find(i.nextEl).length&&(t=n.$el.find(i.nextEl))),i.prevEl&&(e=yK(i.prevEl),n.params.uniqueNavElements&&"string"==typeof i.prevEl&&e.length>1&&1===n.$el.find(i.prevEl).length&&(e=n.$el.find(i.prevEl))),t&&t.length>0&&t.on("click",n.navigation.onNextClick),e&&e.length>0&&e.on("click",n.navigation.onPrevClick),SK(n.navigation,{$nextEl:t,nextEl:t&&t[0],$prevEl:e,prevEl:e&&e[0]}),n.enabled||(t&&t.addClass(i.lockClass),e&&e.addClass(i.lockClass)))},destroy:function(){var t=this,e=t.navigation,n=e.$nextEl,i=e.$prevEl;n&&n.length&&(n.off("click",t.navigation.onNextClick),n.removeClass(t.params.navigation.disabledClass)),i&&i.length&&(i.off("click",t.navigation.onPrevClick),i.removeClass(t.params.navigation.disabledClass))}},PQ={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){EK(this,{navigation:kQ({},AQ)})},on:{init:function(t){t.navigation.init(),t.navigation.update()},toEdge:function(t){t.navigation.update()},fromEdge:function(t){t.navigation.update()},destroy:function(t){t.navigation.destroy()},"enable disable":function(t){var e=t.navigation,n=e.$nextEl,i=e.$prevEl;n&&n[t.enabled?"removeClass":"addClass"](t.params.navigation.lockClass),i&&i[t.enabled?"removeClass":"addClass"](t.params.navigation.lockClass)},click:function(t,e){var n=t.navigation,i=n.$nextEl,r=n.$prevEl,s=e.target;if(t.params.navigation.hideOnClick&&!yK(s).is(r)&&!yK(s).is(i)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===s||t.pagination.el.contains(s)))return;var o;i?o=i.hasClass(t.params.navigation.hiddenClass):r&&(o=r.hasClass(t.params.navigation.hiddenClass)),t.emit(!0===o?"navigationShow":"navigationHide"),i&&i.toggleClass(t.params.navigation.hiddenClass),r&&r.toggleClass(t.params.navigation.hiddenClass)}}}};let IQ=(()=>{class t{constructor(){GK.use([PQ])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,TQ]]}),t})(),MQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})(),DQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,lX,f_,IQ,MQ]]}),t})(),RQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Dp,DQ]]}),t})();const NQ={isolated:!0},LQ=new oi("Message service configuration",{providedIn:"root",factory:()=>NQ});let jQ=(()=>{class t{constructor(t,e,n){this.source=t,this.channel=e,this.messages=n}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Hd(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Hd(e=>e.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Hd(e=>t.includes(e.source)))}nextMessageId(){return t.counter++}}return t.counter=0,t})(),FQ=(()=>{class t{constructor(t,e){this.config=t,this.parent=e,this.channel=new P,this.messages=t.isolated||!e?this.channel.asObservable():U([this.channel,e.messages.pipe(Xp(()=>!this.channel.closed))]).pipe(Y())}ngOnDestroy(){this.channel.complete()}connect(t){return new jQ(t,this.channel,this.messages)}}return t.\u0275fac=function(e){return new(e||t)(Ci(LQ),Ci(t,12))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),BQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:LQ,useValue:NQ}],imports:[[gd,ky,f_]]}),t})();function VQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function zQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function UQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function HQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}const $Q=".mat-progress-spinner{display:block;position:relative;overflow:hidden}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}._mat-animation-noopable.mat-progress-spinner circle{transition:none;animation:none}.cdk-high-contrast-active .mat-progress-spinner circle{stroke:currentColor;stroke:CanvasText}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{animation:mat-progress-spinner-linear-rotate 2000ms linear infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4000ms;animation-timing-function:cubic-bezier(0.35, 0, 0.25, 1);animation-iteration-count:infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{animation:mat-progress-spinner-stroke-rotate-fallback 10000ms cubic-bezier(0.87, 0.03, 0.33, 1) infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition:none;animation:none}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.606171575px;transform:rotate(0)}12.5%{stroke-dashoffset:56.5486677px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.606171575px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.5486677px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.606171575px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.5486677px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.606171575px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.5486677px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0deg)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}\n",GQ=jy(class{constructor(t){this._elementRef=t}},"primary"),WQ=new oi("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}});class qQ extends GQ{constructor(t,e,n,i,r){super(t),this._document=n,this._diameter=100,this._value=0,this._fallbackAnimation=!1,this.mode="determinate";const s=qQ._diameters;this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),s.has(n.head)||s.set(n.head,new Set([100])),this._fallbackAnimation=e.EDGE||e.TRIDENT,this._noopAnimations="NoopAnimations"===i&&!!r&&!r._forceAnimations,r&&(r.diameter&&(this.diameter=r.diameter),r.strokeWidth&&(this.strokeWidth=r.strokeWidth))}get diameter(){return this._diameter}set diameter(t){this._diameter=bd(t),this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()}get strokeWidth(){return this._strokeWidth||this.diameter/10}set strokeWidth(t){this._strokeWidth=bd(t)}get value(){return"determinate"===this.mode?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,bd(t)))}ngOnInit(){const t=this._elementRef.nativeElement;this._styleRoot=xp(t)||this._document.head,this._attachStyleNode(),t.classList.add(`mat-progress-spinner-indeterminate${this._fallbackAnimation?"-fallback":""}-animation`)}_getCircleRadius(){return(this.diameter-10)/2}_getViewBox(){const t=2*this._getCircleRadius()+this.strokeWidth;return`0 0 ${t} ${t}`}_getStrokeCircumference(){return 2*Math.PI*this._getCircleRadius()}_getStrokeDashOffset(){return"determinate"===this.mode?this._getStrokeCircumference()*(100-this._value)/100:this._fallbackAnimation&&"indeterminate"===this.mode?.2*this._getStrokeCircumference():null}_getCircleStrokeWidth(){return this.strokeWidth/this.diameter*100}_attachStyleNode(){const t=this._styleRoot,e=this._diameter,n=qQ._diameters;let i=n.get(t);if(!i||!i.has(e)){const r=this._document.createElement("style");r.setAttribute("mat-spinner-animation",this._spinnerAnimationLabel),r.textContent=this._getAnimationText(),t.appendChild(r),i||(i=new Set,n.set(t,i)),i.add(e)}}_getAnimationText(){const t=this._getStrokeCircumference();return"\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n".replace(/START_VALUE/g,""+.95*t).replace(/END_VALUE/g,""+.2*t).replace(/DIAMETER/g,`${this._spinnerAnimationLabel}`)}_getSpinnerAnimationLabel(){return this.diameter.toString().replace(".","_")}}qQ.\u0275fac=function(t){return new(t||qQ)(ea(kl),ea(pp),ea(Yu,8),ea(Ey,8),ea(WQ))},qQ.\u0275cmp=Jt({type:qQ,selectors:[["mat-progress-spinner"]],hostAttrs:["role","progressbar","tabindex","-1",1,"mat-progress-spinner"],hostVars:10,hostBindings:function(t,e){2&t&&(Ko("aria-valuemin","determinate"===e.mode?0:null)("aria-valuemax","determinate"===e.mode?100:null)("aria-valuenow","determinate"===e.mode?e.value:null)("mode",e.mode),La("width",e.diameter,"px")("height",e.diameter,"px"),ja("_mat-animation-noopable",e._noopAnimations))},inputs:{color:"color",mode:"mode",diameter:"diameter",strokeWidth:"strokeWidth",value:"value"},exportAs:["matProgressSpinner"],features:[jo],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,e){1&t&&(vn(),ra(0,"svg",0),Jo(1,VQ,1,9,"circle",1),Jo(2,zQ,1,7,"circle",2),sa()),2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),na("ngSwitch","indeterminate"===e.mode),Ko("viewBox",e._getViewBox()),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1))},directives:[Eh,Ch],styles:[$Q],encapsulation:2,changeDetection:0}),qQ._diameters=new WeakMap;let XQ=(()=>{class t extends qQ{constructor(t,e,n,i,r){super(t,e,n,i,r),this.mode="indeterminate"}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(Yu,8),ea(Ey,8),ea(WQ))},t.\u0275cmp=Jt({type:t,selectors:[["mat-spinner"]],hostAttrs:["role","progressbar","mode","indeterminate",1,"mat-spinner","mat-progress-spinner"],hostVars:6,hostBindings:function(t,e){2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),ja("_mat-animation-noopable",e._noopAnimations))},inputs:{color:"color"},features:[jo],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,e){1&t&&(vn(),ra(0,"svg",0),Jo(1,UQ,1,9,"circle",1),Jo(2,HQ,1,7,"circle",2),sa()),2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),na("ngSwitch","indeterminate"===e.mode),Ko("viewBox",e._getViewBox()),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1))},directives:[Eh,Ch],styles:[$Q],encapsulation:2,changeDetection:0}),t})(),YQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny,Rh],Ny]}),t})(),KQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,YQ]]}),t})(),QQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,YQ]]}),t})();const ZQ={initialConfig:{},parse:{},rename:{}};class JQ{constructor(t,e){this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},ZQ),e)}addChanges(t){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),t)}applyChanges(t,e={}){void 0===t&&(t=this.storedChanges,this.storedChanges={});const{configState:n,options:{initialConfig:i}}=this,r=n.snapshot,s=Object.assign(Object.assign(Object.assign({},i),r),e);for(const[o,a]of Object.entries(t))this.processChange(o,a,s);n.setConfig(s)}processChange(t,e,n){var i,r;const{options:{parse:s,rename:o}}=this,a=null!==(i=o[t])&&void 0!==i?i:t,l=e.currentValue,c=null!==(r=s[t])&&void 0!==r?r:s[a];if(null==l)delete n[a];else if(c)try{n[a]=c(l)}catch(u){console.warn(`Failed to parse ${t} = ${l}`,u.message)}else n[a]=l}}let tZ=(()=>{class t{constructor(t,e,n={}){this.configState=t,this.cdr=e,this.options=n,this.initialized=!1,this.configManager=new JQ(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return t.\u0275fac=function(t){!function(){throw new Error("invalid")}()},t.\u0275dir=se({type:t,features:[ye]}),t})();const eZ={boolean:t=>"false"!=`${t}`,json:t=>"string"==typeof t?JSON.parse(t):t,function:t=>{if("function"!=typeof t)throw new Error("Expected a javascript function");return t}};let nZ=(()=>{class t{constructor(){this.className="ccf-spinner-overlay",this.active=!1}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spinner-overlay"]],hostVars:4,hostBindings:function(t,e){2&t&&(Ba(e.className),ja("active",e.active))},inputs:{active:"active",text:"text"},decls:3,vars:1,consts:[[1,"content"]],template:function(t,e){1&t&&(oa(0,"mat-spinner"),ra(1,"div",0),Za(2),sa()),2&t&&(ws(2),Ja(e.text))},directives:[XQ],styles:["[_nghost-%COMP%]{display:flex;position:absolute;width:100%;height:100%;z-index:99;flex-direction:column;justify-content:center;align-items:center;pointer-events:none;visibility:hidden;opacity:0;transition:visibility .6s,opacity .4s ease-in-out}[_nghost-%COMP%] mat-spinner[_ngcontent-%COMP%]{margin-bottom:1rem;opacity:0;transition:opacity .3s ease-in-out .3s}.active[_nghost-%COMP%]{pointer-events:auto;visibility:visible;opacity:1}.active[_nghost-%COMP%] mat-spinner[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0}),t})();const iZ=FQ,rZ=["*"];let sZ=(()=>{class t{constructor(t,e){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new g;const n=t.connect(this).getMessages();this.subscriptions.add(n.subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){switch(t.payload.type){case"drawer-containers-changed":return this.drawers=t.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":{const e=t.source.position,{opened:n,width:i,margin:r}=t.payload;return this.updateMargin(e,n,i,r),this.updateFaded(),!0}default:return!1}}updateMargin(t,e,n,i){const r=e?n+i:i;"start"===t?this.leftMargin=r:this.rightMargin=r}updateFaded(){const[t,e]=this.drawers;this.faded=(null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==e?void 0:e.opened)&&(null==e?void 0:e.expanded)}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,e){2&t&&(rl("@fadeInOut",e.faded),Ba(e.className),La("margin-left",e.leftMargin,"px")("margin-right",e.rightMargin,"px"),ja("cff-drawer-content-animations",e.animationsEnabled))},ngContentSelectors:rZ,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 5.5rem);z-index:2;overflow:auto}.cff-drawer-content-animations[_nghost-%COMP%]{transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:margin-left,margin-right}"],data:{animation:[Vg("fadeInOut",[$g("false",Hg({opacity:1})),$g("true",Hg({opacity:0})),Wg("false <=> true",zg("1s"))])]},changeDetection:0}),t})();const oZ=["*"],aZ={params:{width:0,margin:0,margin2:0}};class lZ{constructor(){this.initialized=!1,this.deferred=new Promise(t=>{this.resolve=t})}set(){this.initialized=!0,this.resolve()}wait(){return lw(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let cZ=(()=>{class t{constructor(t,e,n){this.element=n,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Rc(!0),this.expandedChange=new Rc(!0),this.stateChange=new Rc(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new lZ,this.subscriptions=new g,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}get classEnd(){return"end"===this.position}get position(){return this._position}set position(t){this._position=t||"start"}get opened(){return this._opened}set opened(t){this.toggle(md(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(md(t))}get expandedStateObj(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}get measuredWidth(){if(this._measuredWidth>0)return this._measuredWidth;const t=this.element.nativeElement;if(!t)return 0;const e=t.getBoundingClientRect(),n=e.right-e.left;return 0===n?0:(this._measuredWidth=n,n)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const e=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),n=Number(e.slice(0,-2));return this._measuredMargin=n,n}ngAfterViewInit(){this.initialized.set(),setTimeout(()=>this.channel.sendMessage({type:"drawer-initialized"}))}ngOnDestroy(){this.subscriptions.unsubscribe()}open(){this.toggle(!0)}close(){this.toggle(!1)}toggle(t=!this.opened){this.opened!==t&&(t?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=t,this.sendToggle())}openExpanded(){this.toggleExpanded(!0)}closeExpanded(){this.toggleExpanded(!1)}toggleExpanded(t=!this.expanded){this.expanded!==t&&(t?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=t,this.sendToggle())}closeOpenDone(){this.openedChange.emit(this.opened)}expandCollapseDone(){this.expandedChange.emit(this.expanded)}sendToggle(){return lw(this,void 0,void 0,function*(){yield this.initialized.wait(),this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit()})}handleMessage(t){switch(t.payload.type){case"drawer-toggled":return this.syncExpanded(t.source),!0;default:return!1}}syncExpanded(t){(this.expanded||t.expanded)&&(this.expanded&&t.expanded?this.expandedState2=t.expandedState2="half":this.expanded?t.opened?(this.expandedState2="extended",this.width=t.measuredWidth+t.measuredMargin):(this.expandedState2="full",this.margin2=t.measuredMargin):this.opened?(t.expandedState2="extended",t.width=this.measuredWidth+this.measuredMargin):(t.expandedState2="full",t.margin2=this.measuredMargin))}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc),ea(kl))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,e){1&t&&ga("@openClose.done",function(){return e.closeOpenDone()})("@expandCollapse.done",function(){return e.expandCollapseDone()}),2&t&&(rl("@openClose",e.openedState)("@expandCollapse",e.expandedStateObj),Ba(e.className),ja("ccf-drawer-end",e.classEnd)("ccf-drawer-opened",e.opened)("ccf-drawer-expanded",e.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:oZ,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,e){1&t&&(wa(),ra(0,"div",0),xa(1),sa())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%);background-color:#fff}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[Vg("openClose",[$g("open, open-instant",Hg({transform:"none"})),$g("closed",Hg({})),Wg("closed => open-instant",zg(0)),Wg("closed <=> open, open-instant => closed",zg(".5s ease-in-out"))]),Vg("expandCollapse",[$g("collapsed",Hg({})),$g("half",Hg({width:"calc(50% - {{ margin }}px)"}),aZ),$g("extended",Hg({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),aZ),$g("full",Hg({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),aZ),Wg("* <=> *",zg(".5s ease-in-out"))])]},changeDetection:0}),t})();function uZ(t,e){1&t&&(ra(0,"ccf-drawer-content"),xa(1,2),sa())}const hZ=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],dZ=["ccf-drawer","ccf-drawer-content","*"];function pZ(t){throw new Error(`Multiple drawers in position ${t}`)}let fZ=(()=>{class t{constructor(t,e){this.cdr=e,this.className="ccf-drawer-container",this.subscriptions=new g,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}get content(){var t;return null!==(t=this.content1.first)&&void 0!==t?t:this.content2.first}get hasWrappedContent(){return 0!==this.content1.length}ngAfterViewInit(){this.drawers.changes.pipe(Kd(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(Kd(null)).subscribe(()=>{this.channel.sendMessage({type:"content-container-changed",content:this.content}),this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return!0}validateDrawers(){const t=this.drawers.toArray(),e=t.filter(t=>"start"===t.position),n=t.filter(t=>"end"===t.position);return e.length>1&&pZ("start"),n.length>1&&pZ("end"),[e[0],n[0]]}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-container"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,cZ,5),Xc(n,sZ,5)),2&t){let t;Wc(t=Yc())&&(e.drawers=t),Wc(t=Yc())&&(e.content1=t)}},viewQuery:function(t,e){if(1&t&&qc(sZ,5),2&t){let t;Wc(t=Yc())&&(e.content2=t)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},exportAs:["ccfDrawerContainer"],features:[_l([iZ])],ngContentSelectors:dZ,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&(wa(hZ),xa(0),xa(1,1),Jo(2,uZ,2,0,"ccf-drawer-content",0)),2&t&&(ws(2),na("ngIf",!e.hasWrappedContent))},directives:[_h,sZ],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),t})();function gZ(t,e){if(1&t&&(ra(0,"mat-option",6),ra(1,"div"),Za(2),sa(),sa()),2&t){const t=e.$implicit,n=va();na("value",t),ws(1),Ba(n.optionsVisible),ws(1),tl(" ",t," ")}}let mZ=(()=>{class t{constructor(t){this.ga=t,this.selectionChange=new Rc,this.optionsVisible="invisible"}toggleOptions(){this.optionsVisible="visible"===this.optionsVisible?"invisible":"visible"}selectionChanged(t){this.selection=t,this.ga.event("selection_change","dropdown",`${this.label}:${t}`),this.selectionChange.emit(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dropdown"]],inputs:{label:"label",options:"options",selection:"selection"},outputs:{selectionChange:"selectionChange"},decls:7,vars:3,consts:[[1,"ccf-dropdown","wrapper"],[1,"container"],[1,"dropdown-form-field"],[1,"label"],["disableOptionCentering","true","panelClass","option-panel","disableRipple","true",1,"selected-value",3,"value","selectionChange","openedChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"mat-form-field",2),ra(3,"div",3),Za(4),sa(),ra(5,"mat-select",4),fa("selectionChange",function(t){return e.selectionChanged(t.value)})("openedChange",function(){return e.toggleOptions()}),Jo(6,gZ,3,5,"mat-option",5),sa(),sa(),sa(),sa()),2&t&&(ws(4),tl(" ",e.label," "),ws(1),na("value",e.selection),ws(1),na("ngForOf",e.options))},directives:[lU,kX,yh,av],styles:["@-webkit-keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.dropdown-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:1em;padding-right:1em;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{font-size:.875rem;border:none}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix mat-select{font-size:1rem;font-weight:bold}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .option-panel{-webkit-animation:slideInHorizontalDropdown .3s;animation:slideInHorizontalDropdown .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;position:absolute!important;top:1.55rem;max-width:9.5rem} .option-panel .mat-option{border-bottom-width:1px;border-bottom-style:solid;padding-left:1em} .option-panel :last-child{border-bottom:none} .cdk-overlay-pane{min-width:0rem!important}.dropdown-form-field[_ngcontent-%COMP%]{height:3rem;width:100%}.dropdown-form-field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{padding-bottom:.063rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem} .ccf-dropdown .mat-select-arrow-wrapper{transform:translatey(-.5em)}"],changeDetection:0}),t})();const bZ=["popover"];function yZ(t,e){if(1&t){const t=ua();ra(0,"div",7,8),ra(2,"div"),ra(3,"div",9),Za(4),sa(),ra(5,"input",10),fa("keyup",function(e){return $e(t),va().onKeyLow(e)}),sa(),sa(),ra(6,"ng5-slider",11),fa("valueChange",function(e){return $e(t),va().lowValue=e})("highValueChange",function(e){return $e(t),va().highValue=e})("userChangeEnd",function(){return $e(t),va().sliderValueChanged()}),sa(),ra(7,"div"),ra(8,"div",12),Za(9),sa(),ra(10,"input",13),fa("keyup",function(e){return $e(t),va().onKeyHigh(e)}),sa(),sa(),sa()}if(2&t){const t=va();ws(2),nl("label min fade-in ",t.contentsVisible,""),ws(2),tl(" ",t.options.floor,"> "),ws(1),Sa("value",t.lowValue),ws(1),nl("slider fade-in ",t.contentsVisible,""),na("options",t.options)("value",t.lowValue)("highValue",t.highValue),ws(1),nl("label max fade-in ",t.contentsVisible,""),ws(2),tl(" ",t.options.ceil," "),ws(1),Sa("value",t.highValue)}}let vZ=(()=>{class t{constructor(t,e,n){this.element=e,this.ga=n,this.selectionChange=new Rc,this.isSliderOpen=!1,this.contentsVisible="invisible",this.isSliderInitialized=!1;const i=t.position().flexibleConnectedTo(e).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"}]);this.overlayRef=t.create({panelClass:"slider-pane",positionStrategy:i})}get rangeLabel(){const{lowValue:t,highValue:e}=this;return t===e?`${t}`:`${t}-${e}`}ngOnChanges(t){t.valueRange&&this.optionsChanged(),t.selection&&(this.lowValue=Math.min(...this.selection),this.highValue=Math.max(...this.selection))}optionsChanged(){var t,e;this.options={floor:this.valueRange?this.valueRange[0]:0,ceil:this.valueRange?this.valueRange[1]:0,step:1,hideLimitLabels:!0,hidePointerLabels:!0},this.lowValue=null!==(t=this.options.floor)&&void 0!==t?t:0,this.highValue=null!==(e=this.options.ceil)&&void 0!==e?e:0}ngOnDestroy(){this.overlayRef.dispose()}closeSliderPopover(t){var e,n;const{element:i,isSliderOpen:r,popoverElement:s}=this;r&&(i.nativeElement.contains(t)||(null===(n=null===(e=null==s?void 0:s.nativeElement)||void 0===e?void 0:e.contains)||void 0===n?void 0:n.call(e,t))||(this.overlayRef.detach(),this.isSliderInitialized=!1,this.isSliderOpen=!1,this.contentsVisible="invisible"))}toggleSliderPopover(){const{isSliderOpen:t,isSliderInitialized:e}=this;e?(this.overlayRef.detach(),this.isSliderInitialized=!1):!e&&!t&&this.initializeSliderPopover(),this.contentsVisible="visible"===this.contentsVisible?"invisible":"visible",this.isSliderOpen=!t}sliderValueChanged(){const{lowValue:t,highValue:e}=this;this.selection=[t,e],this.ga.event("slider_range_change","dual_slider",`${this.label}:${t}:${e}`),this.selectionChange.emit(this.selection)}initializeSliderPopover(){const{overlayRef:t,popoverPortal:e}=this;t.attach(e),t.updatePosition(),this.isSliderInitialized=!0}onKeyLow(t){const e=Number(t.target.value);"Enter"===t.key&&(e>=Number(this.options.floor)&&e<=Number(this.options.ceil)&&(this.lowValue=e),t.target.value=String(this.lowValue),t.target.blur(),this.sliderValueChanged())}onKeyHigh(t){const e=Number(t.target.value);"Enter"===t.key&&(e>=Number(this.options.floor)&&e<=Number(this.options.ceil)&&(this.highValue=e),t.target.value=String(this.highValue),t.target.blur(),this.sliderValueChanged())}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dual-slider"]],viewQuery:function(t,e){if(1&t&&(qc(Vp,7),qc(bZ,5,kl)),2&t){let t;Wc(t=Yc())&&(e.popoverPortal=t.first),Wc(t=Yc())&&(e.popoverElement=t.first)}},hostBindings:function(t,e){1&t&&fa("click",function(t){return e.closeSliderPopover(t.target)},!1,Ir)("touchstart",function(t){return e.closeSliderPopover(t.target)},!1,Ir)},inputs:{label:"label",valueRange:"valueRange",selection:"selection"},outputs:{selectionChange:"selectionChange"},features:[ye],decls:10,vars:4,consts:[[1,"ccf-slider","wrapper"],[1,"container"],["class","ccf-slider detached",4,"cdk-portal"],[1,"slider-form-field",3,"click"],[1,"slider-labels"],[1,"name-label"],[1,"range-label"],[1,"ccf-slider","detached"],["popover",""],[1,"label","floor"],["type","text",1,"input-low",3,"value","keyup"],[3,"options","value","highValue","valueChange","highValueChange","userChangeEnd"],[1,"label","ceil"],["type","text",1,"input-high",3,"value","keyup"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Jo(2,yZ,11,16,"div",2),ra(3,"mat-form-field",3),fa("click",function(){return e.toggleSliderPopover()}),ra(4,"div",4),ra(5,"span",5),Za(6),sa(),ra(7,"span",6),Za(8),sa(),sa(),oa(9,"mat-select"),sa(),sa(),sa()),2&t&&(ws(3),ja("highlight",e.isSliderOpen),ws(3),Ja(e.label),ws(2),Ja(e.rangeLabel))},directives:[zp,lU,kX,vY],styles:[".slider-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;font-size:.875rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.slider-labels[_ngcontent-%COMP%]{display:flex;flex-direction:column}.slider-labels[_ngcontent-%COMP%] .name-label[_ngcontent-%COMP%]{padding-bottom:.25rem}.slider-labels[_ngcontent-%COMP%] .range-label[_ngcontent-%COMP%]{font-weight:bold} .ccf-slider.wrapper .mat-select-arrow-wrapper{transform:translatey(-1.5em)}@-webkit-keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .slider-pane{position:absolute!important;top:-1px}.ccf-slider.detached[_ngcontent-%COMP%]{-webkit-animation:slideInHorizontalSlider .3s;animation:slideInHorizontalSlider .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;display:flex;justify-content:center;align-items:center;width:0rem;height:4.375rem;padding:.75rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] {visibility:hidden;margin-top:.9375rem;margin-bottom:.9375rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-bar{opacity:.2;height:.15rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-selection{opacity:1}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer{width:1rem;height:1rem;top:-.405rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer:after{display:none}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:2rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.min[_ngcontent-%COMP%]{margin-right:1rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%]{margin-left:1rem;align-items:flex-end}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-align:right}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .floor[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%]{font-size:.875rem}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border:none;width:1.75rem;font-size:1rem;font-weight:bold;padding:0}"]}),t})();function _Z(t,e){if(1&t){const t=ua();ra(0,"div",4),ra(1,"mat-checkbox",5),fa("change",function(e){const n=$e(t).$implicit;return va().filterOnChange(e,n)}),Za(2),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ws(1),na("checked",null==n.selection?null:n.selection.includes(t)),ws(1),tl(" ",t," ")}}let wZ=(()=>{class t{constructor(t){this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new Rc}filterOnChange(t,e){t.checked?(this.selection=[...this.selection,e],this.ga.event("filter_added","filter_checkbox",e)):(this.selection=this.selection.filter(t=>t!==e),this.ga.event("filter_removed","filter_checkbox",e)),this.selectionChange.emit(this.selection)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-checkbox"]],inputs:{label:"label",options:"options",selection:"selection",columns:"columns"},outputs:{selectionChange:"selectionChange"},decls:5,vars:6,consts:[[1,"filter-container"],[1,"filter-label"],[1,"options-container"],["class","option",4,"ngFor","ngForOf"],[1,"option"],[3,"checked","change"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Za(2),sa(),ra(3,"div",2),Jo(4,_Z,3,2,"div",3),sa(),sa()),2&t&&(ws(2),Ja(e.label),ws(1),ja("three",3===e.columns)("four",4===e.columns),ws(1),na("ngForOf",e.options))},directives:[yh,oX],styles:[".mat-checkbox.mat-accent .mat-checkbox-checkmark-path{stroke:#fff!important} .mat-checkbox.mat-accent .mat-checkbox-inner-container{margin-right:1rem}.filter-label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}.options-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap}.options-container.three[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:33%}.options-container.four[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:25%}.option[_ngcontent-%COMP%]{color:#fafafa}"],changeDetection:0}),t})();const xZ=function(){return["Both","Male","Female"]},SZ=function(){return[1,110]},EZ=function(){return[13,83]};let CZ=(()=>{class t{constructor(t){this.ga=t,this.filtersChange=new Rc,this.applyFilters=new Rc}updateFilter(t,e){this.filters=Object.assign(Object.assign({},this.filters),{[e]:t}),this.ga.event("filter_update","filter_content",`${e}:${t}`),this.filtersChange.emit(this.filters)}applyButtonClick(){this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}refreshFilters(){this.filters=Object.assign(Object.assign({},this.filters),{sex:"Both",ageRange:[1,110],bmiRange:[13,83],technologies:[],tmc:[]}),this.ga.event("filters_reset","filter_content"),this.filtersChange.emit(this.filters)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange",applyFilters:"applyFilters"},decls:14,vars:23,consts:[[1,"patient-filters"],["label","Sex",3,"options","selection","selectionChange"],["label","Age",3,"valueRange","selection","selectionChange"],["label","BMI",3,"valueRange","selection","selectionChange"],[1,"filter","assays"],["label","Assay Types",3,"columns","options","selection","selectionChange"],[1,"filter","providers"],["label","Tissue Providers",3,"columns","options","selection","selectionChange"],[1,"button-container"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"ccf-dropdown",1),fa("selectionChange",function(t){return e.updateFilter(t,"sex")}),sa(),ra(2,"ccf-dual-slider",2),fa("selectionChange",function(t){return e.updateFilter(t,"ageRange")}),sa(),ra(3,"ccf-dual-slider",3),fa("selectionChange",function(t){return e.updateFilter(t,"bmiRange")}),sa(),sa(),ra(4,"div",4),ra(5,"ccf-checkbox",5),fa("selectionChange",function(t){return e.updateFilter(t,"technologies")}),sa(),sa(),ra(6,"div",6),ra(7,"ccf-checkbox",7),fa("selectionChange",function(t){return e.updateFilter(t,"tmc")}),sa(),sa(),ra(8,"div",8),ra(9,"button",9),fa("click",function(){return e.applyButtonClick()}),Za(10,"APPLY FILTERS"),sa(),ra(11,"div",10),ra(12,"mat-icon",11),fa("click",function(){return e.refreshFilters()}),Za(13,"refresh"),sa(),sa(),sa()),2&t&&(ja("hidden",e.hidden),ws(1),na("options",Oc(20,xZ))("selection",null==e.filters?null:e.filters.sex),ws(1),na("valueRange",Oc(21,SZ))("selection",null==e.filters?null:e.filters.ageRange),ws(1),na("valueRange",Oc(22,EZ))("selection",null==e.filters?null:e.filters.bmiRange),ws(1),ja("hidden",e.hidden),ws(1),na("columns",4)("options",e.technologyFilters)("selection",null==e.filters?null:e.filters.technologies),ws(1),ja("hidden",e.hidden),ws(1),na("columns",3)("options",e.providerFilters)("selection",null==e.filters?null:e.filters.tmc),ws(1),ja("hidden",e.hidden))},directives:[mZ,vZ,wZ,__,p_],styles:[".filter[_ngcontent-%COMP%]{margin-top:2rem}.filter.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.filter.assays[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{margin-right:0 rem;width:25%}.button-container[_ngcontent-%COMP%]{margin-top:2rem;display:flex;flex-direction:row-reverse;align-items:center}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.refresh-icon[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{cursor:pointer;transition:.6s;transition-property:background}.patient-filters[_ngcontent-%COMP%]{display:flex;width:90%;padding-top:1rem}.patient-filters.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.patient-filters[_ngcontent-%COMP%] ccf-dual-slider[_ngcontent-%COMP%]{margin-left:.5rem;width:33%}.patient-filters[_ngcontent-%COMP%] ccf-dropdown[_ngcontent-%COMP%]{width:33%}"],changeDetection:0}),t})();function OZ(t,e){1&t&&(ra(0,"div"),ra(1,"mat-icon",7),Za(2,"close"),sa(),sa())}function TZ(t,e){1&t&&oa(0,"mat-icon",8)}let kZ=(()=>{class t{constructor(){this.filtersChange=new Rc,this.filtersVisible=!1}toggleFilterVisible(){this.filtersVisible=!this.filtersVisible}removeBox(){this.filtersVisible=!1}applyFilters(t){this.filters=t,this.filtersChange.emit(t),this.removeBox()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange"},decls:8,vars:12,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","hidden","filters","applyFilters"],[1,"icon"],["svgIcon","filter",1,"icon","funnel"]],template:function(t,e){if(1&t&&(ra(0,"div",0),ra(1,"button",1),fa("click",function(){return e.toggleFilterVisible()}),Jo(2,OZ,3,0,"div",2),Jo(3,TZ,1,0,"ng-template",null,3,Jc),sa(),ra(5,"div",4),ra(6,"div",5),ra(7,"ccf-filters-content",6),fa("applyFilters",function(t){return e.applyFilters(t)}),sa(),sa(),sa(),sa()),2&t){const t=ta(4);ja("expanded",e.drawerExpanded),ws(2),na("ngIf",e.filtersVisible)("ngIfElse",t),ws(3),ja("visible",e.filtersVisible)("hidden",!e.filtersVisible),ws(2),na("technologyFilters",e.technologyFilters)("providerFilters",e.providerFilters)("hidden",!e.filtersVisible)("filters",e.filters)}},directives:[_h,CZ,p_],styles:[".filters-popover[_ngcontent-%COMP%]{position:inherit}.filters-popover.expanded[_ngcontent-%COMP%]{position:relative}.filters-popover.expanded[_ngcontent-%COMP%] .popup-container[_ngcontent-%COMP%]{right:inherit}.filters-popover.expanded[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding-left:4em!important}.popup-container[_ngcontent-%COMP%]{position:absolute;z-index:5;top:1.2rem;left:1.48rem;box-shadow:.2rem .2rem 1rem #00000058}.popup-container[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding:1.5rem;position:relative;height:26.5rem}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;height:26.5rem;transition:width .2s ease-in-out;border-width:1px}.popup-container.visible[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:1;transition-delay:.3s;transition-duration:.2s}.popup-container.hidden[_ngcontent-%COMP%]{width:0;height:0;transition:all .2s ease-out;transition-delay:.3s;pointer-events:none}.popup-container.hidden[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out}.show-hide[_ngcontent-%COMP%]{background:none;border:none;z-index:10;position:relative;cursor:pointer;outline:none;padding:.5rem;border-radius:.25rem;transition:.6s}"],changeDetection:0}),t})();class AZ{constructor(t,e){this.original=t,this.level=e,this.visible=!0,this.opacity=20}get label(){return this.original.label}get expandable(){return this.original.children.length>0}static create(t,e){return new AZ(t,e)}}function PZ(t,e){if(1&t){const t=ua();ra(0,"div",5),fa("click",function(e){const n=$e(t).node,i=va();return i.select(e.ctrlKey,n,!0,!i.isSelected(n))}),Za(1),sa()}if(2&t){const t=e.node,n=va();ja("hidden",t.label===(null==n.highlightedNode?null:n.highlightedNode.label))("filtered-out",!n.occurenceData[t.original.id]&&!!n.termData[t.original.id])("unavailable",!n.termData[t.original.id])("selected",n.isSelected(t)),ws(1),Ja("colon"===t.label?"large intestine":t.label)}}function IZ(t,e){1&t&&ca(0)}const MZ=function(t){return{node:t}};function DZ(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",6),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",7),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",8),ra(4,"ccf-opacity-slider",9,10),fa("opacityChange",function(e){const n=$e(t).$implicit;return va().updateOpacity(n,e)})("opacityReset",function(){const e=$e(t).$implicit;return va().resetNode(e)})("visibilityToggle",function(){const e=$e(t).$implicit;return va().toggleVisibility(e)}),sa(),sa(),sa(),oa(6,"div",11),Jo(7,IZ,1,0,"ng-container",12),ra(8,"div",13),Za(9),sa(),sa()}if(2&t){const t=e.$implicit,n=va(),i=ta(2);na("matTreeNodePaddingIndent",n.indent),ws(1),La("display",-1!==t.opacity?"none":"block"),ws(1),La("left",n.getLeftIndent(t.level)),ja("fade",!0!==t.visible),ws(1),La("left",n.getLeftIndent(t.level)),ja("hidden",t.label!==(null==n.highlightedNode?null:n.highlightedNode.label)),ws(1),na("visible",t.visible)("opacity",t.opacity),ws(3),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Tc(18,MZ,t)),ws(1),ja("suborgan",t.level>1),ws(1),Ja(n.occurenceData[t.original.id]||0)}}function RZ(t,e){1&t&&ca(0)}function NZ(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",14),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",7),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",8),ra(4,"ccf-opacity-slider",9,15),fa("opacityChange",function(e){const n=$e(t).$implicit;return va().updateOpacity(n,e)})("opacityReset",function(){const e=$e(t).$implicit;return va().resetNode(e)})("visibilityToggle",function(){const e=$e(t).$implicit;return va().toggleVisibility(e)}),sa(),sa(),sa(),ra(6,"button",16),ra(7,"mat-icon",17),Za(8),sa(),sa(),Jo(9,RZ,1,0,"ng-container",12),ra(10,"div",13),Za(11),sa(),sa()}if(2&t){const t=e.$implicit,n=va(),i=ta(2);na("matTreeNodePaddingIndent",n.indent),ws(1),La("display",-1!==t.opacity?"none":"block"),ws(1),La("left",n.getLeftIndent(t.level)),ja("fade",!0!==t.visible),ws(1),La("left",n.getLeftIndent(t.level)),ja("hidden",t.label!==(null==n.highlightedNode?null:n.highlightedNode.label)),ws(1),na("visible",t.visible)("opacity",t.opacity),ws(2),ja("hidden",t.label===(null==n.highlightedNode?null:n.highlightedNode.label)),Zo("aria-label","Toggle ",t.label,""),ws(2),tl(" ",n.control.isExpanded(t)?"expand_less":"expand_more"," "),ws(1),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Tc(22,MZ,t)),ws(1),ja("suborgan",t.level>1),ws(1),Ja(n.occurenceData[t.original.id]||0)}}const LZ=(0,KG.property)("level"),jZ=(0,KG.property)("expandable");let FZ=(()=>{class t{constructor(t,e){this.cdr=t,this.ga=e,this.atScrollBottom=!1,this.nodeSelected=new Rc,this.nodeChanged=new Rc,this.indent="1.5rem",this.control=new OY(LZ,jZ),this.flattener=new WY(AZ.create,LZ,jZ,KG.invoke.bind(void 0,this,"getChildren")),this.dataSource=new qY(this.control,this.flattener),this._nodes=void 0,this.bodyNode=new AZ({"@id":"http://purl.obolibrary.org/obo/UBERON_0013702","@type":"OntologyTreeNode",id:"http://purl.obolibrary.org/obo/UBERON_0013702",label:"body",parent:"",children:[],synonymLabels:[]},0),this.anySelectionsMade=!1,this.selectedNodes=[]}set nodes(t){var e;this._nodes=t,this.control&&(this.dataSource.data=null!==(e=this._nodes)&&void 0!==e?e:[])}get nodes(){return this._nodes}set getChildren(t){var e;this._getChildren=t,this.dataSource.data=null!==(e=this.nodes)&&void 0!==e?e:[]}get getChildren(){return this._getChildren}set occurenceData(t){this._occurenceData=t||{}}get occurenceData(){return this._occurenceData}set termData(t){this._termData=t||{}}get termData(){return this._termData}ngOnInit(){this.control.dataNodes&&this.control.expand(this.control.dataNodes[0])}ngOnChanges(t){if(t.ontologyFilter){const e=t.ontologyFilter.currentValue;this.selectByIDs((null==e?void 0:e.length)>=0?e:[this.bodyNode.original.id])}}selectByIDs(t){const e=this.control.dataNodes,n=e.filter(e=>t.indexOf(e.original.id)>-1);(null==n?void 0:n.length)>0&&(this.selectedNodes=n,this.ga.event("nodes_selected_by_ids","ontology_tree",n.map(t=>t.label).join(",")),this.control.collapseAll(),this.selectedNodes.forEach(t=>{this.expandAndSelect(t.original,t=>{var n;return null===(n=e.find(e=>e.original.id===t.parent))||void 0===n?void 0:n.original},!0)}))}expandAndSelect(t,e,n=!1){var i;const{cdr:r,control:s}=this,o=new Set;let a=e(t);for(;a;)o.add(a),a=e(a);const l=(0,KG.filter)(s.dataNodes,t=>o.has(t.original)),c=s.dataNodes.find(e=>e.original===t);n||(this.selectedNodes=[],s.collapseAll());for(const u of l)s.expand(u);"body"===t.label&&(null===(i=s.dataNodes)||void 0===i?void 0:i.length)>0&&s.expand(s.dataNodes[0]),this.select(n,c,!1,!0),r.detectChanges()}isInnerNode(t,e){return e.expandable}isSelected(t){return this.selectedNodes.filter(e=>(null==t?void 0:t.original.label)===(null==e?void 0:e.original.label)).length>0}select(t,e,n,i){if(this.anySelectionsMade||(this.selectedNodes=[],this.anySelectionsMade=!0),void 0===e)return this.selectedNodes=[],void this.ga.event("nodes_unselected","ontology_tree");t?i?this.selectedNodes.indexOf(e)<0&&this.selectedNodes.push(e):this.selectedNodes.splice(this.selectedNodes.indexOf(e),1):(this.selectedNodes=[],i&&this.selectedNodes.push(e)),this.ga.event("nodes_selected","ontology_tree",this.selectedNodes.map(t=>t.label).join(",")),n&&this.nodeSelected.emit(this.selectedNodes.map(t=>null==t?void 0:t.original))}mouseOver(t){this.highlightedNode=t}mouseOut(){this.highlightedNode=void 0}updateOpacity(t,e){t.opacity=e,this.ga.event("opacity_update","ontology_tree",t.label,e),this.nodeChanged.emit(t)}resetNode(t){t.opacity=20,t.visible=!0,this.ga.event("node_reset","ontology_tree",t.label),this.nodeChanged.emit(t)}toggleVisibility(t){t.visible=!0!==t.visible,this.ga.event("visibility_update","ontology_tree",t.label,+t.visible),this.nodeChanged.emit(t)}getLeftIndent(t){return-1.5*t+"rem"}onScroll(t){if(!t.target)return;const{clientHeight:e,scrollHeight:n,scrollTop:i}=t.target;this.atScrollBottom=n-i-e<20}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[ye],decls:6,vars:5,consts:[[1,"ccf-ontology-tree",3,"dataSource","treeControl","scroll"],["selectableRegion",""],["class","node leaf-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef"],["class","node inner-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef","matTreeNodeDefWhen"],[1,"scroll-gradient"],[1,"text",3,"click"],["matTreeNodePadding","",1,"node","leaf-node",3,"matTreeNodePaddingIndent","mouseleave"],["svgIcon","app:opacity",1,"icon","opacity",3,"mouseenter"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider1",""],[1,"non-expandable"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"num-results"],["matTreeNodePadding","",1,"node","inner-node",3,"matTreeNodePaddingIndent","mouseleave"],["slider2",""],["mat-icon-button","","matTreeNodeToggle","",1,"toggle"],[1,"icon","font-icon"]],template:function(t,e){1&t&&(ra(0,"mat-tree",0),fa("scroll",function(t){return e.onScroll(t)}),Jo(1,PZ,2,9,"ng-template",null,1,Jc),Jo(3,DZ,10,20,"mat-tree-node",2),Jo(4,NZ,12,24,"mat-tree-node",3),sa(),oa(5,"div",4)),2&t&&(na("dataSource",e.dataSource)("treeControl",e.control),ws(4),na("matTreeNodeDefWhen",e.isInnerNode),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[HY,VY,BY,zY,p_,pG,kh,__,$Y],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;height:100%;width:25.25rem;overflow:auto;overflow-x:hidden}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .toggle[_ngcontent-%COMP%]{z-index:-1;opacity:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .text[_ngcontent-%COMP%]{margin-left:.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]{min-height:0;font-size:1rem;margin-bottom:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:width;position:relative;z-index:1}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{width:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%] ccf-opacity-slider[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider{height:1.5rem;margin-left:1rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box .slider-and-label{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider{height:1.5rem;width:15rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider .mat-slider-wrapper{top:12px}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .opacity-value{width:3rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-right:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node.inner-node[_ngcontent-%COMP%] button.hidden[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{position:relative;min-width:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:normal}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .autocomplete-open[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{border-bottom:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .non-expandable[_ngcontent-%COMP%]{margin-left:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{white-space:nowrap;cursor:pointer;margin-left:1rem;opacity:1;width:50%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:opacity,width}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.hidden[_ngcontent-%COMP%]{opacity:0;width:0%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.unavailable[_ngcontent-%COMP%]{pointer-events:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-left:auto}.scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();class BZ{constructor(t){this.ontologyState=t}get rootNode(){return this.ontologyState.rootNode$}filter(t){return this.ontologyState.nodes$.pipe(D(e=>this.lookup(e,t.toLowerCase())))}lookup(t,e){const n=new Map;return t&&t.forEach(t=>{if(t.label.toLowerCase().includes(e)&&!n.get(t.id))n.set(t.id,{index:this.getIndexOfMatch(t.label,e),displayLabel:this.formatLabel(t.label,e),node:t});else{const i=t.synonymLabels.find(t=>t.toLowerCase().includes(e));i&&!n.get(t.id)&&n.set(t.id,{index:this.getIndexOfMatch(t.label+" ("+i+")",e),displayLabel:this.formatLabel(t.label+" ("+i+")",e),node:t})}}),Array.from(n.values())}getIndexOfMatch(t,e){return t.toLowerCase().indexOf(e)}formatLabel(t,e){const n=this.getIndexOfMatch(t,e);return[t.substr(0,n),t.substr(n,e.length),t.substr(n+e.length,t.length)]}getChildren(t){return(0,KG.at)(this.ontologyState.snapshot.nodes,t.children)}}function VZ(t,e){if(1&t&&(ra(0,"mat-option",8),ra(1,"span",9),Za(2),sa(),ra(3,"span",10),Za(4),sa(),ra(5,"span",11),Za(6),sa(),sa()),2&t){const t=e.$implicit;na("value",t),ws(2),Ja(t.displayLabel[0]),ws(2),Ja(t.displayLabel[1]),ws(2),Ja(t.displayLabel[2])}}BZ.\u0275fac=function(t){return new(t||BZ)(Ci($q))},BZ.\u0275prov=xt({token:BZ,factory:BZ.\u0275fac,providedIn:"root"}),sw([iB.ak],BZ.prototype,"getChildren",null);let zZ=(()=>{class t{constructor(t,e){this.ontologyService=t,this.ga=e,this.selected=new Rc,this.formControl=new gz(""),this.autoCompleteOpen=!1}ngOnInit(){this.filteredResults$=this.formControl.valueChanges.pipe(Hd(t=>"string"==typeof t),Kd(""),Qd(t=>this.ontologyService.filter(t)),D(t=>(0,KG.sortBy)(t,[this.sortBySynonymResult,"index",this.sortLexically])))}displayFormatter(t){var e;return(null!==(e=null==t?void 0:t.displayLabel)&&void 0!==e?e:[]).join("")}sortBySynonymResult(t){return t.displayLabel.join().includes("(")?1:-1}sortLexically(t){return t.node.label.toLowerCase()}onSelect(t){const e=(0,KG.get)(t,["option","value","node"]);e&&(this.ga.event("search","ontology_search",e.id),this.selected.emit(e),this.formControl.reset())}}return t.\u0275fac=function(e){return new(e||t)(ea(BZ),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-search"]],outputs:{selected:"selected"},decls:10,vars:8,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","placeholder","Search ontology terms ...","matInput","",1,"input",3,"formControl","matAutocomplete"],[1,"ccf-ontology-search","detached","autocomplete",3,"displayWith","optionSelected","opened","closed"],["autocomplete",""],[1,"results-container"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"prefix"],[1,"search-term"],[1,"suffix"]],template:function(t,e){if(1&t&&(ra(0,"form",0),ra(1,"mat-form-field",1),ra(2,"mat-icon",2),Za(3,"search"),sa(),oa(4,"input",3),ra(5,"mat-autocomplete",4,5),fa("optionSelected",function(t){return e.onSelect(t)})("opened",function(){return e.autoCompleteOpen=!0})("closed",function(){return e.autoCompleteOpen=!1}),ra(7,"div",6),Jo(8,VZ,7,4,"mat-option",7),Ic(9,"async"),sa(),sa(),sa(),sa()),2&t){const t=ta(6);ja("autocomplete-open",e.autoCompleteOpen),ws(4),na("formControl",e.formControl)("matAutocomplete",t),ws(1),na("displayWith",e.displayFormatter),ws(3),na("ngForOf",Mc(9,6,e.filteredResults$))}},directives:[wz,YV,_z,lU,p_,nU,LU,TV,TU,XV,Cz,xU,yh,av],pipes:[Dh],styles:[".ccf-ontology-search[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem .25rem 0;margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;height:3rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix input{margin-left:.4rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-prefix{top:.5rem;border:none}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0 .25rem;min-width:2.5rem} .ccf-ontology-search.detached{border:.125rem solid;border-top:none;border-radius:0 0 .25rem .25rem;max-height:18rem} .ccf-ontology-search.detached .results-container{width:23.75rem;margin-bottom:1rem;overflow:auto;max-height:15rem;scrollbar-width:thin} .ccf-ontology-search.detached .results-container mat-option{height:1.5rem;width:23.75rem} .ccf-ontology-search.detached .results-container mat-option .search-term{text-decoration:underline}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0;border-bottom:none}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem 0 0;border-bottom:none}"],changeDetection:0}),t})();const UZ=function(t){return[t]};function HZ(t,e){if(1&t){const t=ua();ra(0,"ccf-ontology-tree",2),fa("nodeSelected",function(e){return $e(t),va().ontologySelection.emit(e)}),sa()}if(2&t){const t=e.ngIf,n=va();na("nodes",Tc(5,UZ,t))("getChildren",n.ontologySearchService.getChildren)("occurenceData",n.occurenceData)("termData",n.termData)("ontologyFilter",n.ontologyFilter)}}let $Z=(()=>{class t{constructor(t,e){this.ontologySearchService=t,this.store=e,this.ontologySelection=new Rc}selected(t){const{nodes:e}=this.store.selectSnapshot($q);this.tree.expandAndSelect(t,t=>e[t.parent])}}return t.\u0275fac=function(e){return new(e||t)(ea(BZ),ea(pV))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-selection"]],viewQuery:function(t,e){if(1&t&&qc(FZ,5),2&t){let t;Wc(t=Yc())&&(e.tree=t.first)}},inputs:{occurenceData:"occurenceData",termData:"termData",ontologyFilter:"ontologyFilter"},outputs:{ontologySelection:"ontologySelection"},decls:3,vars:3,consts:[[3,"selected"],["class","tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected"]],template:function(t,e){1&t&&(ra(0,"ccf-ontology-search",0),fa("selected",function(t){return e.selected(t)}),sa(),Jo(1,HZ,1,7,"ccf-ontology-tree",1),Ic(2,"async")),2&t&&(ws(1),na("ngIf",Mc(2,1,e.ontologySearchService.rootNode)))},directives:[zZ,_h,FZ],pipes:[Dh],styles:[""],changeDetection:0}),t})(),GZ=(()=>{class t{constructor(t,e,n){this.drawer=t,this.cdr=n,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new g;const i=e.connect(this);this.subscriptions.add(i.getMessagesFromSource(t).subscribe(t=>{this.handleMessage(t)&&n.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",e="arrow_left";return"end"===this.position&&([t,e]=[e,t]),this.opened?e:t}ngAfterViewInit(){setTimeout(()=>{this.position=this.drawer.position,this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return"drawer-toggled"===t.payload.type&&(this.opened=t.payload.opened,!0)}toggle(){const t=this.drawer,{opened:e,expanded:n}=t;e?n?t.closeExpanded():t.close():t.open()}}return t.\u0275fac=function(e){return new(e||t)(ea(cZ),ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,e){2&t&&(Ba(e.className),ja("ccf-drawer-toggle-button-end",e.classEnd))},decls:2,vars:1,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,e){1&t&&(ra(0,"mat-icon",0),fa("click",function(){return e.toggle()}),Za(1),sa()),2&t&&(ws(1),tl(" ",e.icon,"\n"))},directives:[p_],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;display:flex;align-items:center;transition:.6s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:relative;right:.25rem;transition:all .5s}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}"],changeDetection:0}),t})();function WZ(t,e){1&t&&(ra(0,"div",7),oa(1,"mat-spinner",8),ra(2,"span",3),Za(3,"Loading External Site"),sa(),sa())}function qZ(t,e){if(1&t){const t=ua();ra(0,"iframe",9),fa("load",function(){return $e(t),va().loading=!1}),sa()}2&t&&Ko("src",va().safeUrl,wr)}let XZ=(()=>{class t{constructor(t){this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new Rc,this.loading=!0,this.safeUrl=null}ngOnChanges(t){"url"in t&&this.updateUrl()}updateUrl(){const{sanitizer:t,url:e}=this;this.safeUrl=null,e&&(this.safeUrl=t.bypassSecurityTrustResourceUrl(e),this.loading=!0)}}return t.\u0275fac=function(e){return new(e||t)(ea(hd))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},inputs:{url:"url"},outputs:{closed:"closed"},features:[ye],decls:11,vars:4,consts:[[1,"toolbar"],["mat-flat-button","","target","_blank","rel","noopener noreferrer",1,"launch",3,"href","disabled"],[1,"icon"],[1,"text"],["mat-flat-button","",1,"close",3,"click"],["class","overlay",4,"ngIf"],["class","frame","title","Portal Data Viewer","referrerpolicy","no-referrer",3,"load",4,"ngIf"],[1,"overlay"],[1,"spinner"],["title","Portal Data Viewer","referrerpolicy","no-referrer",1,"frame",3,"load"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"a",1),ra(2,"mat-icon",2),Za(3,"launch"),sa(),ra(4,"span",3),Za(5,"Open in Portal"),sa(),sa(),ra(6,"button",4),fa("click",function(){return e.closed.emit()}),ra(7,"mat-icon",2),Za(8,"clear"),sa(),sa(),sa(),Jo(9,WZ,4,0,"div",5),Jo(10,qZ,1,1,"iframe",6)),2&t&&(ws(1),na("href",e.safeUrl,_r)("disabled",!e.safeUrl),ws(8),na("ngIf",e.loading),ws(1),na("ngIf",e.safeUrl))},directives:[w_,p_,__,_h,XQ],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;width:100%;height:1.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%]{margin-right:3.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch.mat-button-disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.25rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{min-width:0;padding:0;line-height:1.5rem;border-radius:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:1.5rem;bottom:0;left:0;right:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{margin-bottom:.5rem}[_nghost-%COMP%] .frame[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0}),t})();function YZ(t,e){if(1&t&&oa(0,"div",3),2&t){const t=e.index;ja("line-tick-visible",va().tissueSectionExists(t+1))}}const KZ=function(){return[]};let QZ=(()=>{class t{constructor(){this.clsName="ccf-tissue-section-vis"}tissueSectionExists(t){return this.tissueSections.filter(e=>e.sectionNumber===t).length>0}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tissue-section-vis"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{totalTissueSections:"totalTissueSections",tissueSections:"tissueSections"},decls:7,vars:3,consts:[[1,"container"],["class","line-tick",3,"line-tick-visible",4,"ngFor","ngForOf"],[1,"x-axis"],[1,"line-tick"]],template:function(t,e){1&t&&(ra(0,"div"),Za(1,"0"),sa(),ra(2,"div",0),Jo(3,YZ,1,2,"div",1),oa(4,"div",2),sa(),ra(5,"div"),Za(6),sa()),2&t&&(ws(3),na("ngForOf",Oc(2,KZ).constructor(e.totalTissueSections)),ws(3),Ja(e.totalTissueSections))},directives:[yh],styles:["[_nghost-%COMP%]{width:100%;height:2.5rem;padding:.5rem 1rem;display:flex}[_nghost-%COMP%] .container[_ngcontent-%COMP%]{margin-right:.5rem;margin-left:.5rem;flex-grow:1;display:flex;position:relative;justify-content:space-evenly}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .line-tick[_ngcontent-%COMP%]{height:100%;width:1px;z-index:2}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .x-axis[_ngcontent-%COMP%]{width:100%;height:2px;position:absolute;top:calc(50% - 1px);right:0;z-index:1}"],changeDetection:0}),t})();function ZZ(t,e){if(1&t){const t=ua();ra(0,"div",7),ra(1,"div",8),Za(2),sa(),ra(3,"a",9),fa("click",function(){$e(t);const e=va().$implicit;return va().linkClicked.emit(e)}),Za(4," DATA "),ra(5,"mat-icon"),Za(6,"open_in_new"),sa(),sa(),sa()}if(2&t){const t=va().$implicit;ws(1),La("background-image","url("+t.thumbnail+")"),ws(1),tl(" ",t.technology," ")}}function JZ(t,e){1&t&&(aa(0),Jo(1,ZZ,7,3,"ng-template",6),la())}const tJ=(()=>{let t=-1;return()=>(t+=1,t)})();let eJ=(()=>{class t{constructor(){this.className="ccf-thumbnail-carousel",this.linkClicked=new Rc,this.uid=tJ(),this.config={allowTouchMove:!1,slidesOffsetBefore:4,slidesOffsetAfter:4,slidesPerView:"auto",spaceBetween:4,watchOverflow:!0},this.navigation={prevEl:"#"+this.prevButtonId,nextEl:"#"+this.nextButtonId}}get prevButtonId(){return`ccf-thumbnail-carousel-prev-button-${this.uid}`}get nextButtonId(){return`ccf-thumbnail-carousel-next-button-${this.uid}`}itemId(t,e){return e.thumbnail}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-thumbnail-carousel"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},inputs:{data:"data"},outputs:{linkClicked:"linkClicked"},decls:11,vars:6,consts:[[1,"prev"],["mat-icon-button","","disableRipple",""],[1,"swiper",3,"config","navigation"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"next"],[1,"fade"],["swiperSlide",""],[1,"slide"],[1,"thumbnail"],[1,"link",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"button",1),ra(2,"mat-icon"),Za(3,"navigate_before"),sa(),sa(),sa(),ra(4,"swiper",2),Jo(5,JZ,2,0,"ng-container",3),sa(),ra(6,"div",4),ra(7,"button",1),oa(8,"div",5),ra(9,"mat-icon"),Za(10,"navigate_next"),sa(),sa(),sa()),2&t&&(ws(1),Ko("id",e.prevButtonId),ws(3),na("config",e.config)("navigation",e.navigation),ws(1),na("ngForOf",e.data)("ngForTrackBy",e.itemId),ws(2),Ko("id",e.nextButtonId))},directives:[__,p_,OQ,yh,CQ],styles:['[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%]{flex-grow:1;padding-bottom:.3125rem}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%] .swiper-slide{width:3.75rem;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:1.5rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{position:absolute;top:-.625rem;left:-2rem;z-index:10;width:2rem;height:3.125rem;opacity:1;transition:opacity ease-in-out .3s;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%]{cursor:default;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background-size:cover;position:relative;width:calc(100% - 2 * .125rem);height:calc(100% - 2 * .125rem);border-style:solid;border-width:.125rem;border-radius:.25rem;background-origin:padding-box;background-clip:padding-box;font-size:.875rem;font-weight:bold}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-.125rem;left:-.125rem;width:.125rem;height:.125rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;bottom:0;right:0;left:0;opacity:0;transition:opacity ease-in-out .3s;box-shadow:0 2px 4px #0009;font-size:.75rem;line-height:.75rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%], [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:link, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:visited, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:focus, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:active{cursor:pointer;text-decoration:none}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]:hover .link[_ngcontent-%COMP%]{opacity:1}'],changeDetection:0}),t})();function nJ(t,e){if(1&t){const t=ua();ra(0,"mat-icon",14),fa("click",function(){return $e(t),va().toggleExpansion()}),Za(1),sa()}if(2&t){const t=va();ws(1),Ja(t.expanded?"expand_less":"expand_more")}}function iJ(t,e){if(1&t&&oa(0,"ccf-tissue-section-vis",20),2&t){const t=va(2);na("totalTissueSections",t.tissueBlock.sectionCount)("tissueSections",t.tissueBlock.sections)}}function rJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"ccf-thumbnail-carousel",21),fa("linkClicked",function(e){return $e(t),va(2).linkHandler(e.link)}),sa(),la()}if(2&t){const t=va(2);ws(1),na("data",t.tissueBlock.datasets)}}function sJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"ccf-thumbnail-carousel",21),fa("linkClicked",function(e){return $e(t),va(3).linkHandler(e.link)}),sa(),la()}if(2&t){const t=va().$implicit;ws(1),na("data",t.datasets)}}function oJ(t,e){if(1&t){const t=ua();ra(0,"div",22),ra(1,"div",23),ra(2,"mat-icon",24),Za(3,"bubble_chart"),sa(),ra(4,"div",17),ra(5,"div",8),Za(6),sa(),ra(7,"div",8),Za(8),sa(),sa(),ra(9,"div",9),fa("click",function(){const e=$e(t).$implicit;return va(2).linkHandler(e.link)}),ra(10,"div",10),Za(11,"TISSUE SECTION"),sa(),ra(12,"mat-icon",11),Za(13,"open_in_new"),sa(),sa(),sa(),Jo(14,sJ,2,1,"ng-container",13),sa()}if(2&t){const t=e.$implicit;ws(6),Ja(t.label),ws(2),Ja(t.description),ws(6),na("ngIf",t.datasets.length>0)}}function aJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"div",15),ra(2,"div",16),ra(3,"mat-icon",5),Za(4,"bubble_chart"),sa(),ra(5,"div",17),ra(6,"div",8),Za(7),sa(),ra(8,"div",8),Za(9),sa(),sa(),ra(10,"div",9),fa("click",function(){$e(t);const e=va();return e.linkHandler(e.tissueBlock.link)}),ra(11,"div",10),Za(12,"TISSUE BLOCK"),sa(),ra(13,"mat-icon",11),Za(14,"open_in_new"),sa(),sa(),sa(),Jo(15,iJ,1,2,"ccf-tissue-section-vis",18),Jo(16,rJ,2,1,"ng-container",13),sa(),Jo(17,oJ,15,3,"div",19),la()}if(2&t){const t=va();ws(7),Ja(t.tissueBlock.label),ws(2),Ja(t.tissueBlock.description),ws(6),na("ngIf",t.tissueBlock.sections.length>1),ws(1),na("ngIf",t.tissueBlock.datasets.length>0),ws(1),na("ngForOf",t.tissueBlock.sections)}}const lJ=function(t){return{"background-color":t}};let cJ=(()=>{class t{constructor(t){this.ga=t,this.clsName="ccf-donor-card",this.selected=!1,this.expanded=!1,this.highlighted=!1,this.checked=new Rc,this.linkClick=new Rc,this.hoverState=""}handleCheckbox(){this.selected=!this.selected,this.ga.event("selected_toggled","donor_card",this.tissueBlock.label,+this.selected),this.checked.emit(this.selected),this.expanded=!1}toggleExpansion(){this.selected&&(this.expanded=!this.expanded,this.ga.event("expanded_toggled","donor_card",this.tissueBlock.label,+this.expanded))}linkHandler(t){this.ga.event("link_clicked","donor_card",this.tissueBlock.label),this.selected?this.linkClick.emit(t):(this.selected=!0,this.checked.emit(this.selected))}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{tissueBlock:"tissueBlock",selected:"selected",color:"color",expanded:"expanded",highlighted:"highlighted"},outputs:{checked:"checked",linkClick:"linkClick"},decls:19,vars:20,consts:[[1,"main-container"],[1,"checkbox-background",3,"ngStyle","click"],[1,"checkbox",3,"checked"],[1,"hoverable","default-padding","donor","mat-elevation-z2"],[1,"d-flex"],[1,"icon-size","icon-dark","mr-5"],[1,"donor-info"],[1,"title","description"],[1,"description"],[1,"hover-state","mat-elevation-z4",3,"click"],[1,"hover-title"],[1,"icon-size","hover-icon"],["class","icon-size ml-5 selectable",3,"click",4,"ngIf"],[4,"ngIf"],[1,"icon-size","ml-5","selectable",3,"click"],[1,"expanded-view","mat-elevation-z2","align-end"],[1,"info-block","hover-enabled","default-padding"],[1,"text-content"],[3,"totalTissueSections","tissueSections",4,"ngIf"],["class","expanded-view w-80 mat-elevation-z2 align-end",4,"ngFor","ngForOf"],[3,"totalTissueSections","tissueSections"],[1,"mt-05",3,"data","linkClicked"],[1,"expanded-view","w-80","mat-elevation-z2","align-end"],[1,"default-padding","info-block","hover-enabled"],[1,"icon-size","mr-5","icon-light"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),fa("click",function(){return e.handleCheckbox()}),oa(2,"mat-checkbox",2),sa(),ra(3,"div",3),ra(4,"div",4),ra(5,"mat-icon",5),Za(6,"person"),sa(),ra(7,"div",6),ra(8,"div",7),Za(9),sa(),ra(10,"div",8),Za(11),sa(),sa(),sa(),ra(12,"div",9),fa("click",function(){return e.linkHandler(e.tissueBlock.donor.link)}),ra(13,"div",10),Za(14,"DONOR"),sa(),ra(15,"mat-icon",11),Za(16,"open_in_new"),sa(),sa(),Jo(17,nJ,2,1,"mat-icon",12),sa(),sa(),Jo(18,aJ,18,5,"ng-container",13)),2&t&&(ws(1),ja("selected",e.selected)("highlighted",e.highlighted),na("ngStyle",Tc(18,lJ,e.selected?e.color:"transparent")),ws(1),ja("checkselected",e.selected),na("checked",e.selected),ws(1),ja("hover-enabled",e.selected)("expanded",e.expanded)("highlighted",e.highlighted),ws(6),Ja(e.tissueBlock.donor.label),ws(2),Ja(e.tissueBlock.donor.description),ws(6),na("ngIf",e.selected),ws(1),na("ngIf",e.expanded))},directives:[Th,oX,p_,_h,yh,QZ,eJ],styles:["[_nghost-%COMP%]{width:100%}[_nghost-%COMP%] .main-container[_ngcontent-%COMP%]{display:flex;min-height:3rem;width:100%;align-items:center;padding-left:.5rem}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%]{height:2rem;width:2rem;border-radius:50%;margin-right:.5rem;display:flex;justify-content:center;align-items:center;cursor:pointer}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-checked.mat-accent .mat-checkbox-background, [_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-indeterminate.mat-accent[_ngcontent-%COMP%] .mat-checkbox-background[_ngcontent-%COMP%]{background-color:transparent}[_nghost-%COMP%] .checkbox-background.highlighted[_ngcontent-%COMP%] .mat-ripple-element{opacity:.04}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkselected[_ngcontent-%COMP%] .mat-checkbox-frame{border-color:#fff!important}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{margin-left:1.12rem;margin-bottom:.12rem}[_nghost-%COMP%] .align-end[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;width:100%;align-items:center}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]:not(:first-child){margin-top:.5rem}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .donor.highlighted[_ngcontent-%COMP%]{box-shadow:0 6px 2px -2px #0003,0 4px 4px #00000024,0 2px 10px #0000001f}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .hover-state[_ngcontent-%COMP%]{width:19.5rem!important}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .hoverable[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]:hover .hover-state[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%]{transition:opacity .15s ease-in-out;opacity:0;cursor:pointer;position:absolute;height:100%;width:100%;top:0;margin-left:-.5rem;align-items:center;display:flex;justify-content:flex-end;padding-right:1rem;font-size:.75rem}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-title[_ngcontent-%COMP%]{font-weight:lighter}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-icon[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .default-padding[_ngcontent-%COMP%]{padding:.25rem .5rem}[_nghost-%COMP%] .expanded-view[_ngcontent-%COMP%]{margin-top:.25rem;width:85%;margin-bottom:.25rem}[_nghost-%COMP%] .d-flex[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .icon-size[_ngcontent-%COMP%]{height:1.5rem;width:1.5rem;font-size:1.5rem}[_nghost-%COMP%] .selectable[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%]{width:80%!important}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:16rem!important}[_nghost-%COMP%] .ml-5[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .mr-5[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .mt-05[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),t})();function uJ(t,e){if(1&t&&(ra(0,"div",7),ra(1,"div",8),Za(2),sa(),ra(3,"div",9),Za(4),sa(),sa()),2&t){const t=e.$implicit;ws(2),Ja(t.count),ws(2),Ja(t.label)}}function hJ(t,e){if(1&t){const t=ua();ra(0,"div",10),fa("mouseenter",function(){const e=$e(t).$implicit;return va().handleHover(e.tissueBlock.spatialEntityId)})("mouseleave",function(){return $e(t),va().handleUnhover()}),ra(1,"ccf-donor-card",11),fa("checked",function(e){const n=$e(t).$implicit;return va().handleSelection(n,e)})("linkClick",function(e){return $e(t),va().handleLinkClick(e)}),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ws(1),na("tissueBlock",t.tissueBlock)("selected",t.selected)("color",t.color)("highlighted",t.tissueBlock.spatialEntityId===n.highlighted)}}let dJ=(()=>{class t{constructor(t){this.ga=t,this.linkClicked=new Rc,this.listResultSelected=new Rc,this.listResultDeselected=new Rc,this.itemHovered=new Rc,this.itemUnhovered=new Rc,this.atScrollBottom=!1}handleSelection(t,e){this.ga.event("list_result_selected","results_browser",this.resultLabel,+e),e?this.listResultSelected.next(t):this.listResultDeselected.next(t)}handleLinkClick(t){this.linkClicked.emit(t)}onScroll(t){if(!t.target)return;const{clientHeight:e,scrollHeight:n,scrollTop:i}=t.target;this.atScrollBottom=n-i-e<64}handleHover(t){this.itemHovered.emit(t)}handleUnhover(){this.itemUnhovered.emit()}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:5,consts:[[1,"results-browser-container"],[1,"stat-box"],["id","title"],["class","stat-row",4,"ngFor","ngForOf"],[1,"results-browser-list",3,"scroll"],["class","browser-item-container",3,"mouseenter","mouseleave",4,"ngFor","ngForOf"],[1,"scroll-gradient"],[1,"stat-row"],[1,"stat-value"],[1,"stat-label"],[1,"browser-item-container",3,"mouseenter","mouseleave"],[3,"tissueBlock","selected","color","highlighted","checked","linkClick"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),Za(3),sa(),Jo(4,uJ,5,2,"div",3),sa(),ra(5,"div",4),fa("scroll",function(t){return e.onScroll(t)}),Jo(6,hJ,2,4,"div",5),sa(),oa(7,"div",6),sa()),2&t&&(ws(3),Ja(e.resultLabel),ws(1),na("ngForOf",e.aggregateData),ws(2),na("ngForOf",e.listResults),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[yh,cJ],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 7rem);padding:0 1.5rem 1.5rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%]{margin-bottom:1.5rem;line-height:1.25;min-height:7.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] #title[_ngcontent-%COMP%]{font-size:1.25rem;margin-bottom:.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-value[_ngcontent-%COMP%]{margin-right:1rem;width:5.5rem;text-align:right;font-weight:600}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-label[_ngcontent-%COMP%]{font-weight:300}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;overflow-y:scroll;scrollbar-width:thin;padding-right:.5rem;margin-bottom:2rem}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%] .browser-item-container[_ngcontent-%COMP%]{width:100%}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();function pJ(t,e){1&t&&(ra(0,"a",5),Za(1,"LOGIN"),sa()),2&t&&na("href",va().hubmapPortalUrl+"login",_r)}function fJ(t,e){1&t&&(ra(0,"a",5),Za(1,"LOGOUT"),sa()),2&t&&na("href",va().hubmapPortalUrl+"logout",_r)}let gJ=(()=>{class t{constructor(){this.refreshClicked=new Rc,this.downloadClicked=new Rc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-header"]],inputs:{hubmapPortalUrl:"hubmapPortalUrl",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:3,consts:[[1,"ccf-header"],[1,"portal-home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right","svgIcon","app:logo",1,"logo"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"href",4,"ngIf"],["mat-button","","rel","noreferrer noopener","target","_blank",1,"authentication",3,"href"]],template:function(t,e){1&t&&(ra(0,"mat-toolbar",0),ra(1,"a",1),oa(2,"mat-icon",2),sa(),oa(3,"div",3),Jo(4,pJ,2,1,"a",4),Jo(5,fJ,2,1,"a",4),sa()),2&t&&(ws(1),na("href",e.hubmapPortalUrl,_r),ws(3),na("ngIf",!e.loggedIn),ws(1),na("ngIf",e.loggedIn))},directives:[BG,p_,ew,_h,w_],styles:[".ccf-header[_ngcontent-%COMP%]{height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid;display:flex}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%}.ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%]{height:1.5rem}.ccf-header[_ngcontent-%COMP%] .authentication[_ngcontent-%COMP%]{width:8.25rem;border-radius:.125rem;font-weight:500}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{display:flex;align-items:center;transition:color 1s;cursor:pointer;text-decoration:none}.ccf-header[_ngcontent-%COMP%] [_ngcontent-%COMP%]:not(:last-child){margin-right:1.5rem}.ccf-header[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}.ccf-header[_ngcontent-%COMP%] .filter-labels[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;font:400 1rem/1.25rem Inter,sans-serif}"],changeDetection:0}),t})();const mJ=["bodyUI"];function bJ(t,e){if(1&t&&(oa(0,"ccf-header",33),Ic(1,"async")),2&t){const t=va();na("hubmapPortalUrl",Mc(1,2,t.portalUrl$))("loggedIn",t.loggedIn)}}const yJ=function(){return{}},vJ=function(){return{x:2.2,y:2,z:.4}};let _J=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c){this.data=n,this.theming=i,this.scene=r,this.listResultsState=s,this.consentService=o,this.snackbar=a,this.globalConfig=c,this.ontologySelectionLabel="Body",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=RG.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(D(t=>t===Nq.Running)),this.portalUrl$=this.globalConfig.getOption("hubmapPortalUrl"),i.initialize(t,e),l.setRootElement(t),n.tissueBlockData$.subscribe(),n.aggregateData$.subscribe(),n.termOccurencesData$.subscribe(),n.sceneData$.subscribe(),n.filter$.subscribe(),n.technologyFilterData$.subscribe(),n.providerFilterData$.subscribe(),this.ontologyTerms$=n.filter$.pipe(FU("ontologyTerms"))}ngOnInit(){const t=this.snackbar.openFromComponent(TG,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia&&(window.matchMedia("(prefers-color-scheme: dark)").matches&&this.theming.setTheme(IG),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.theming.setTheme(t.matches?IG:PG)}))}reset(t,e,n){t.open(),t.closeExpanded(),e.open(),e.closeExpanded(),n.removeBox(),this.resetView()}resetView(){this.bodyUI.target=[0,0,0],this.bodyUI.rotation=0,this.bodyUI.rotationX=0,this.bodyUI.bounds={x:2.2,y:2,z:.4}}toggleScheme(){this.theming.setTheme(this.theming.getTheme()===PG?IG:PG)}ontologySelected(t){if(t)return this.data.updateFilter({ontologyTerms:t.map(t=>t.id)}),this.ontologySelectionLabel=this.createSelectionLabel(t),void(t[0]&&"body"===t[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[]}),this.ontologySelectionLabel=""}createSelectionLabel(t){if(0===t.length)return"";if(1===t.length)return t[0].label;let e="";return t.forEach((n,i)=>{e+=n.label,inull==t?void 0:t.startsWith(e))?(this.url=t,this.viewerOpen=!!t):(window.open(t,"_blank"),this.closeiFrameViewer())}closeiFrameViewer(){this.viewerOpen=!1}get loggedIn(){var t;return(null!==(t=this.globalConfig.snapshot.hubmapToken)&&void 0!==t?t:"").length>0}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(No),ea(Fq),ea(MG),ea(Wq),ea(zq),ea(Y$),ea(q_),ea(Nf),ea(SG))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-root"]],viewQuery:function(t,e){if(1&t&&qc(mJ,5),2&t){let t;Wc(t=Yc())&&(e.bodyUI=t.first)}},decls:70,vars:77,consts:[[1,"ccf-app","mat-app-background"],["text","Loading CCF Exploration User Interface (EUI)",3,"active"],[3,"hubmapPortalUrl","loggedIn",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","filtersChange"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],[3,"termData","occurenceData","ontologySelection"],["position","end","opened","",1,"right-drawer",3,"stateChange"],["right",""],[1,"portal-view",3,"url","closed"],[1,"drawer-icons"],[1,"drawer-icons-left"],[1,"button",3,"matTooltip","click"],[1,"icon"],[1,"scheme-toggle","button",3,"matTooltip","click"],[1,"button"],["matTooltip","Reset View",1,"refresh","icon",3,"click"],["videoID","YAHJqvD3Q_8","infoTitle","HuBMAP CCF Exploration User Interface","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],[1,"close-button-wrapper"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"hubmapPortalUrl","loggedIn"]],template:function(t,e){if(1&t){const t=ua();ra(0,"div",0),oa(1,"ccf-spinner-overlay",1),Ic(2,"async"),Jo(3,bJ,2,4,"ccf-header",2),Ic(4,"async"),ra(5,"ccf-drawer-container",3),ra(6,"ccf-drawer",4,5),fa("stateChange",function(){return $e(t),ta(11).removeBox()}),ra(8,"div"),ra(9,"div",6),ra(10,"ccf-filters-popover",7,8),fa("filtersChange",function(t){return e.data.updateFilter(t)}),Ic(12,"async"),Ic(13,"async"),Ic(14,"async"),sa(),ra(15,"div",9),ra(16,"div",10),Za(17,"Sex: "),ra(18,"strong"),Za(19),Ic(20,"async"),sa(),sa(),ra(21,"div",11),Za(22,"Age: "),ra(23,"strong"),Za(24),Ic(25,"async"),Ic(26,"async"),sa(),sa(),ra(27,"div",12),Za(28,"BMI: "),ra(29,"strong"),Za(30),Ic(31,"async"),Ic(32,"async"),sa(),sa(),sa(),sa(),ra(33,"ccf-ontology-selection",13),fa("ontologySelection",function(t){return e.ontologySelected(t)}),Ic(34,"async"),Ic(35,"async"),sa(),oa(36,"ccf-drawer-toggle-button"),sa(),sa(),ra(37,"ccf-drawer",14,15),fa("stateChange",function(){return $e(t),ta(11).removeBox()}),ra(39,"ccf-viewer",16),fa("closed",function(){return e.viewerOpen=!1}),sa(),ra(40,"div",17),ra(41,"div",18),ra(42,"button",19),fa("click",function(){$e(t);const e=ta(11),n=ta(38);return e.removeBox(),n.toggleExpanded()}),ra(43,"mat-icon",20),Za(44),sa(),sa(),ra(45,"button",21),fa("click",function(){return e.toggleScheme()}),ra(46,"mat-icon",20),Za(47),sa(),sa(),ra(48,"button",22),ra(49,"mat-icon",23),fa("click",function(){$e(t);const n=ta(7),i=ta(38),r=ta(11);return e.reset(n,i,r)}),Za(50,"refresh "),sa(),sa(),sa(),oa(51,"ccf-info-button",24),sa(),ra(52,"ccf-results-browser",25),fa("listResultSelected",function(t){return e.listResultsState.selectListResult(t)})("listResultDeselected",function(t){return e.listResultsState.deselectListResult(t)})("linkClicked",function(t){return e.openiFrameViewer(t)})("itemHovered",function(t){return e.listResultsState.highlightNode(t)})("itemUnhovered",function(){return e.listResultsState.unHighlightNode()}),Ic(53,"async"),Ic(54,"async"),Ic(55,"async"),sa(),oa(56,"ccf-drawer-toggle-button"),sa(),ra(57,"ccf-drawer-content"),ra(58,"div",26),ra(59,"ccf-organ-selector",27),fa("organsChanged",function(t){return e.scene.setSelectedReferenceOrgans(t)}),Ic(60,"async"),Ic(61,"async"),Ic(62,"async"),sa(),sa(),ra(63,"div",28),ra(64,"div",29),fa("click",function(){return e.organListVisible=!e.organListVisible}),ra(65,"mat-icon",30),Za(66),sa(),sa(),sa(),ra(67,"ccf-body-ui",31,32),fa("nodeClick",function(t){return e.scene.sceneNodeClicked(t)})("nodeHoverStart",function(t){return e.scene.sceneNodeHovered(t)})("nodeHoverStop",function(){return e.scene.sceneNodeUnhover()}),Ic(69,"async"),sa(),sa(),sa(),sa()}if(2&t){const t=ta(38);let n,i,r,s;ws(1),na("active",Mc(2,37,e.spinnerActive$)),ws(2),na("ngIf",!1===Mc(4,39,e.spinnerActive$)),ws(7),na("filters",Mc(12,41,e.data.filter$))("drawerExpanded",t.expanded)("technologyFilters",Mc(13,43,e.data.technologyFilterData$))("providerFilters",Mc(14,45,e.data.providerFilterData$)),ws(9),Ja(null==(n=Mc(20,47,e.data.filter$))?null:n.sex),ws(5),el("",null==(i=Mc(25,49,e.data.filter$))?null:i.ageRange[0],"-",null==(i=Mc(26,51,e.data.filter$))?null:i.ageRange[1],""),ws(6),el("",null==(r=Mc(31,53,e.data.filter$))?null:r.bmiRange[0],"-",null==(r=Mc(32,55,e.data.filter$))?null:r.bmiRange[1],""),ws(3),na("termData",Mc(34,57,e.data.ontologyTermsFullData$))("occurenceData",Mc(35,59,e.data.termOccurencesData$)),ws(6),ja("opened",e.viewerOpen),na("url",e.url),ws(3),na("matTooltip",t.expanded?"Exit Fullscreen":"Enter Fullscreen"),ws(2),Ja(t.expanded?"fullscreen_exit":"fullscreen"),ws(1),na("matTooltip","light-theme"===e.theming.getTheme()?"Enter Dark Mode":"Enter Light Mode"),ws(2),tl("","light-theme"===e.theming.getTheme()?"brightness_2":"brightness_5"," "),ws(5),na("listResults",Mc(53,61,e.listResultsState.listResults$))("aggregateData",Mc(54,63,e.data.aggregateData$))("resultLabel",e.ontologySelectionLabel)("highlighted",Mc(55,65,e.listResultsState.highlightedNodeId$)),ws(6),ja("closed",!e.organListVisible),ws(1),na("multiselect",!0)("occurenceData",null!==(s=Mc(60,67,e.data.termOccurencesData$))&&void 0!==s?s:Oc(75,yJ))("organList",Mc(61,69,e.scene.referenceOrgans$))("selectedOrgans",Mc(62,71,e.scene.selectedReferenceOrgans$)),ws(4),ja("closed",!e.organListVisible),ws(3),tl(" ",e.organListVisible?"arrow_drop_up":"arrow_drop_down"," "),ws(1),ja("expanded-stage",!e.organListVisible),na("scene",Mc(69,73,e.scene.scene$))("bounds",Oc(76,vJ))}},directives:[nZ,_h,fZ,cZ,kZ,$Z,GZ,XZ,ew,p_,wG,dJ,sZ,hG,nG,gJ],pipes:[Dh],styles:[".cdk-overlay-container{position:absolute;font-size:1.2rem}[_nghost-%COMP%]{display:block;position:relative}.ccf-app[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;position:relative;text-align:left}.ccf-app[_ngcontent-%COMP%] ccf-header[_ngcontent-%COMP%]{z-index:99}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{flex-grow:1;height:100%;width:100%;opacity:1;overflow:visible;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{overflow:hidden;margin-bottom:1.5rem;border-radius:.5rem;height:100%;padding-bottom:4rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .organ-selector[_ngcontent-%COMP%]{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:28.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%]{display:flex;padding-left:1.5rem;height:5rem;padding-right:1.5rem;align-items:center;justify-content:space-between}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;padding:.65rem;transition:.6s}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5rem;transition:all .5s ease-in-out}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-4.25rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{transition:all .5s ease-in-out;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem;height:calc(100% - 6rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:100%;padding-bottom:3rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;border-top-right-radius:.5rem;border-top-left-radius:.5rem;height:0}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{display:flex;justify-content:center;height:1.0625rem;width:3rem;align-self:center;border-radius:0 0 .25rem .25rem;cursor:pointer;transition:.6s;position:relative;top:.5rem;z-index:1}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{position:relative;bottom:.2rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%]{padding-left:1.5rem;padding-right:1.5rem;height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%]{height:5rem;display:flex;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:75%;margin-left:1.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%]{font-weight:300}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600!important}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view[_ngcontent-%COMP%]{position:fixed;left:0;top:0;bottom:0;right:425%;height:100%;transform:translate(-425%);width:calc(100% - 28.5rem);transition:transform .5s cubic-bezier(.82,.085,.395,.895)}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view.opened[_ngcontent-%COMP%]{transform:translate(0);transition:width 0s .5s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view[_ngcontent-%COMP%]{width:100vw}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view.opened[_ngcontent-%COMP%]{transition:width 0s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .shaded-toggle[_ngcontent-%COMP%]{box-shadow:-1px 0 4px #212121}[_ngcontent-%COMP%]::-webkit-scrollbar{width:7.5rem}"],changeDetection:0}),t})();function wJ(t,e){1&t&&oa(0,"ccf-root")}function xJ(t){const e=t=>"string"==typeof t,n=t=>Array.isArray(t)&&t.every(e);if("string"==typeof t){const e=eZ.json(t);if(n(e))return e}else if(n(t))return t;throw new Error("Invalid data sources")}let SJ=(()=>{class t extends tZ{constructor(t,e){super(t,e,{initialDelay:10,initialConfig:Object.assign(Object.assign({},RG.dbOptions),globalThis.dbOptions),parse:{dataSources:xJ,useRemoteApi:eZ.boolean}})}}return t.\u0275fac=function(e){return new(e||t)(ea(SG),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-root-wc"]],inputs:{dataSources:"dataSources",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[jo],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&Jo(0,wJ,1,0,"ccf-root",0),2&t&&na("ngIf",e.initialized)},directives:[_h,_J],encapsulation:2,changeDetection:0}),t})(),EJ=(()=>{class t{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(t,e){const n=function(t,e){return e.get(El).resolveComponentFactory(t).inputs}(t,e.injector),i=e.strategyFactory||new Bf(t,e.injector),r=function(t){const e={};return t.forEach(({propName:t,templateName:n})=>{e[function(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}(n)]=t}),e}(n);class s extends zf{constructor(t){super(),this.injector=t}get ngElementStrategy(){if(!this._ngElementStrategy){const t=this._ngElementStrategy=i.create(this.injector||e.injector);n.forEach(({propName:e})=>{if(!this.hasOwnProperty(e))return;const n=this[e];delete this[e],t.setInputValue(e,n)})}return this._ngElementStrategy}attributeChangedCallback(t,e,n,i){this.ngElementStrategy.setInputValue(r[t],n)}connectedCallback(){let t=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),t=!0),this.ngElementStrategy.connect(this),t||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(t=>{const e=function(t,e,n){if("function"!=typeof CustomEvent){const i=t.createEvent("CustomEvent");return i.initCustomEvent(e,!1,!1,n),i}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:n})}(this.ownerDocument,t.name,t.value);this.dispatchEvent(e)})}}return s.observedAttributes=Object.keys(r),n.forEach(({propName:t})=>{Object.defineProperty(s.prototype,t,{get(){return this.ngElementStrategy.getInputValue(t)},set(e){this.ngElementStrategy.setInputValue(t,e)},configurable:!0,enumerable:!0})}),s}(SJ,{injector:this.injector});customElements.define("ccf-eui",t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(No))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:AG,useValue:"light-theme"},{provide:gf,useExisting:Nf}],imports:[[ky,gd,Yq,BQ,EY,KY,f_,xY,RQ,KQ,iG,dG,xG,rw,QQ,kG,G_]]}),t})();RG.production&&function(){if(Ru)throw new Error("Cannot enable prod mode after platform setup.");Du=!1}(),pd().bootstrapModule(EJ).catch(t=>console.error(t))},91052:function(t){function e(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(i,r)}t.exports=function(t){return function(){var n=this,i=arguments;return new Promise(function(r,s){var o=t.apply(n,i);function a(t){e(o,r,s,a,l,"next",t)}function l(t){e(o,r,s,a,l,"throw",t)}a(void 0)})}},t.exports.default=t.exports,t.exports.__esModule=!0},61948:function(t){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},34321:function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},91741:function(t){function e(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}e.keys=function(){return[]},e.resolve=e,e.id=91741,t.exports=e},9521:function(){},49125:function(){},75307:function(){}},function(t){t(t.s=35090)}]); \ No newline at end of file +var oBe=Object.defineProperty,aBe=Object.defineProperties,lBe=Object.getOwnPropertyDescriptors,dT=Object.getOwnPropertySymbols,eX=Object.prototype.hasOwnProperty,tX=Object.prototype.propertyIsEnumerable,Nr=Math.pow,nX=(t,e,n)=>e in t?oBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,bt=(t,e)=>{for(var n in e||(e={}))eX.call(e,n)&&nX(t,n,e[n]);if(dT)for(var n of dT(e))tX.call(e,n)&&nX(t,n,e[n]);return t},ti=(t,e)=>aBe(t,lBe(e)),iX=(t,e)=>{var n={};for(var i in t)eX.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&dT)for(var i of dT(t))e.indexOf(i)<0&&tX.call(t,i)&&(n[i]=t[i]);return n};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{71440:function(t,e,n){var i=n(91052).default;t.exports=function t(e,n,i){function r(o,a){if(!n[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){return r(e[o][1][t]||t)},c,c.exports,t,e,n,i)}return n[o].exports}for(var s=void 0,o=0;o0&&r[r.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0?o-4:o;for(n=0;n>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[u++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l},n.fromByteArray=function(t){for(var e,n=t.length,r=n%3,s=[],o=16383,a=0,l=n-r;al?l:a+o));return 1===r?s.push(i[(e=t[n-1])>>2]+i[e<<4&63]+"=="):2===r&&s.push(i[(e=(t[n-2]<<8)+t[n-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t){return i[t>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}function h(t,e,n){for(var i=[],r=e;r>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}n.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(r>0&&(t.lastNeed=r-1),r):--i=0?(r>0&&(t.lastNeed=r-2),r):--i=0?(r>0&&(2===r?r=0:t.lastNeed=r-3),r):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":4}],6:[function(t,e,n){(function(e){(function(){"use strict";var e=t("base64-js"),i=t("ieee754");n.Buffer=o,n.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function s(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=o.prototype,e}function o(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return a(t,e,n)}function a(t,e,n){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|d(t,e),i=s(n),r=i.write(t,e);return r!==n&&(i=i.slice(0,r)),i}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function d(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(t).length;default:if(r)return i?-1:L(t).length;e=(""+e).toLowerCase(),r=!0}}function p(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return C(this,e,n);case"latin1":case"binary":return O(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function f(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function g(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=o.from(e,i)),o.isBuffer(e))return 0===e.length?-1:m(t,e,n,i,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function m(t,e,n,i,r){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var u=-1;for(s=n;sa&&(n=a-l),s=n;s>=0;s--){for(var h=!0,d=0;dr&&(i=r):i=r;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o>8,r.push(n%256),r.push(i);return r}(e,t.length-n),t,n,i)}function S(t,n,i){return e.fromByteArray(0===n&&i===t.length?t:t.slice(n,i))}function E(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(s=t[r+1]))&&(l=(31&c)<<6|63&s)>127&&(u=l);break;case 3:o=t[r+2],128==(192&(s=t[r+1]))&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=t[r+2],a=t[r+3],128==(192&(s=t[r+1]))&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(i.push((u-=65536)>>>10&1023|55296),u=56320|1023&u),i.push(u),r+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var n="",i=0;ie&&(t+=" ... "),""},o.prototype.compare=function(t,e,n,i,r){if(B(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(e>>>=0),l=Math.min(s,a),c=this.slice(i,r),u=t.slice(e,n),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return y(this,t,e,n);case"ascii":return v(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;ri)&&(n=i);for(var r="",s=e;sn)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,i,r,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function I(t,e,n,i,r,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(t,e,n,r,s){return e=+e,n>>>=0,s||I(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function D(t,e,n,r,s){return e=+e,n>>>=0,s||I(t,0,n,8),i.write(t,e,n,r,52,8),n+8}o.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t],r=1,s=0;++s>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t+--e],r=1;e>0&&(r*=256);)i+=this[t+--e]*r;return i},o.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var i=this[t],r=1,s=0;++s=(r*=128)&&(i-=Math.pow(2,8*e)),i},o.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var i=e,r=1,s=this[t+--i];i>0&&(r*=256);)s+=this[t+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*e)),s},o.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,i){t=+t,e>>>=0,n>>>=0,i||P(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[e]=255&t;++s>>=0,n>>>=0,i||P(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,s=1;for(this[e+r]=255&t;--r>=0&&(s*=256);)this[e+r]=t/s&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,t,e,n,r-1,-r)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var r=Math.pow(2,8*n-1);P(this,t,e,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,n){return M(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return M(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,i){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&0!==i&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--s)t[s+e]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,i),e);return r},o.prototype.fill=function(t,e,n,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var r=t.charCodeAt(0);("utf8"===i&&r<128||"latin1"===i)&&(t=r)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function j(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(t,e,n){"use strict";e.exports=function t(e){return null===e||"object"!=typeof e||null!=e.toJSON?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((e,n,i)=>e+(0===i?"":",")+t(void 0===n||"symbol"==typeof n?null:n),"")+"]":"{"+Object.keys(e).sort().reduce((n,i,r)=>void 0===e[i]||"symbol"==typeof e[i]?n:n+(0===n.length?"":",")+t(i)+":"+t(e[i]),"")+"}"}},{}],8:[function(t,e,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(t,e){return new Promise(function(n,i){function r(n){t.removeListener(e,s),i(n)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}b(t,e,s,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&b(t,"error",e,n)}(t,r,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,n,i){var r,s,o;if(c(n),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]),void 0===o)o=s[e]=n,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(r=u(t))>0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,function(t){console&&console.warn&&console.warn(t)}(a)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=d.bind(i);return r.listener=n,i.wrapFn=r,r}function f(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=r[t];if(void 0===l)return!1;if("function"==typeof l)s(l,this,e);else{var c=l.length,u=m(l,c);for(n=0;n=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},{}],9:[function(t,e,n){n.read=function(t,e,n,i,r){var s,o,a=8*r-i-1,l=(1<>1,u=-7,h=n?r-1:0,d=n?-1:1,p=t[e+h];for(h+=d,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=256*s+t[e+h],h+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+h],h+=d,u-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},n.write=function(t,e,n,i,r,s){var o,a,l,c=8*s-r-1,u=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(a=0,o=u):o+h>=1?(a=(e*l-1)*Math.pow(2,r),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<0;t[n+p]=255&o,p+=f,o/=256,c-=8);t[n+p-f]|=128*g}},{}],10:[function(t,e,n){e.exports="function"==typeof Object.create?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},{}],11:[function(t,e,n){"use strict";const{isArray:r,isObject:s,isString:o}=t("./types"),{asArray:a}=t("./util"),{prependBase:l}=t("./url"),c=t("./JsonLdError"),u=t("./ResolvedContext");function h(t){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:t})}function d({context:t,base:e}){if(!t)return;const n=t["@context"];if(o(n))t["@context"]=l(e,n);else if(r(n))for(let i=0;i10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(e))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:e});let i,l;a.add(e);try{l=yield n(e),i=l.document||null,o(i)&&(i=JSON.parse(i))}catch(u){throw new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:e,cause:u})}if(!s(i))throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:e});return i="@context"in i?{"@context":i["@context"]}:{"@context":{}},l.contextUrl&&(r(i["@context"])||(i["@context"]=[i["@context"]]),i["@context"].push(l.contextUrl)),{context:i,remoteDoc:l}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(t,e,n){"use strict";e.exports=class extends Error{constructor(t="An unspecified JSON-LD error occurred.",e="jsonld.Error",n={}){super(t),this.name=e,this.message=t,this.details=n}}},{}],13:[function(t,e,n){"use strict";e.exports=t=>{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(e,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):t.compact(e,n)},e.expand=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):t.expand(e)},e.flatten=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):t.flatten(e)},e}},{}],14:[function(t,e,n){"use strict";e.exports=t("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(t,e,n){"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(t){const e=this;return e._loader=t,function(){return e.add.apply(e,arguments)}}add(t){var e=this;return i(function*(){let n=e._requests[t];if(n)return Promise.resolve(n);n=e._requests[t]=e._loader(t);try{return yield n}finally{delete e._requests[t]}})()}}},{}],16:[function(t,e,n){"use strict";const i=t("lru-cache");e.exports=class{constructor({document:t}){this.document=t,this.cache=new i({max:10})}getProcessed(t){return this.cache.get(t)}setProcessed(t,e){this.cache.set(t,e)}}},{"lru-cache":33}],17:[function(t,e,n){"use strict";const r=t("./JsonLdError"),{isArray:s,isObject:o,isString:a,isUndefined:l}=t("./types"),{isList:c,isValue:u,isGraph:h,isSimpleGraph:d,isSubjectReference:p}=t("./graphTypes"),{expandIri:f,getContextValue:g,isKeyword:m,process:b,processingMode:y}=t("./context"),{removeBase:v,prependBase:_}=t("./url"),{addValue:w,asArray:x,compareShortestLeast:S}=t("./util"),E={};function C(t,e,n){if("@nest"!==f(t,e,{vocab:!0},n))throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=E,E.compact=function(){var t=i(function*({activeCtx:t,activeProperty:e=null,element:n,options:i={},compactionMap:f=(()=>{})}){if(s(n)){let r=[];for(let s=0;s1&&(T=Array.from(T).sort());const k=t;for(const e of T){const n=E.compactIri({activeCtx:k,iri:e,relativeTo:{vocab:!0}}),r=g(S,n,"@context");l(r)||(t=yield b({activeCtx:t,localCtx:r,options:i,propagate:!1}))}const A=Object.keys(n).sort();for(const l of A){const p=n[l];if("@id"!==l)if("@type"!==l)if("@reverse"!==l)if("@preserve"!==l)if("@index"!==l)if("@graph"!==l&&"@list"!==l&&"@included"!==l&&m(l)){const e=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,e,p)}else{if(!s(p))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const e=E.compactIri({activeCtx:t,iri:l,value:p,relativeTo:{vocab:!0},reverse:v}),n=t.mappings.has(e)?t.mappings.get(e)["@nest"]:null;let r=_;n&&(C(t,n,i),o(_[n])||(_[n]={}),r=_[n]),w(r,e,p,{propertyIsArray:!0})}for(const e of p){const n=E.compactIri({activeCtx:t,iri:l,value:e,relativeTo:{vocab:!0},reverse:v}),r=t.mappings.has(n)?t.mappings.get(n)["@nest"]:null;let p=_;r&&(C(t,r,i),o(_[r])||(_[r]={}),p=_[r]);const m=g(t,n,"@container")||[],b=h(e),y=c(e);let S;y?S=e["@list"]:b&&(S=e["@graph"]);let O=yield E.compact({activeCtx:t,activeProperty:n,element:y||b?S:e,options:i,compactionMap:f});if(y){if(s(O)||(O=[O]),m.includes("@list")){w(p,n,O,{valueIsArray:!0,allowDuplicate:!0});continue}O={[E.compactIri({activeCtx:t,iri:"@list",relativeTo:{vocab:!0}})]:O},"@index"in e&&(O[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"])}if(b)if(m.includes("@graph")&&(m.includes("@id")||m.includes("@index")&&d(e))){let r;p.hasOwnProperty(n)?r=p[n]:p[n]=r={};const s=(m.includes("@id")?e["@id"]:e["@index"])||E.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}});w(r,s,O,{propertyIsArray:!i.compactArrays||m.includes("@set")})}else m.includes("@graph")&&d(e)?(s(O)&&O.length>1&&(O={"@included":O}),w(p,n,O,{propertyIsArray:!i.compactArrays||m.includes("@set")})):(s(O)&&1===O.length&&i.compactArrays&&(O=O[0]),O={[E.compactIri({activeCtx:t,iri:"@graph",relativeTo:{vocab:!0}})]:O},"@id"in e&&(O[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e["@id"]),"@index"in e&&(O[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"]),w(p,n,O,{propertyIsArray:!i.compactArrays||m.includes("@set")}));else if(m.includes("@language")||m.includes("@index")||m.includes("@id")||m.includes("@type")){let r,s;if(p.hasOwnProperty(n)?r=p[n]:p[n]=r={},m.includes("@language"))u(O)&&(O=O["@value"]),s=e["@language"];else if(m.includes("@index")){const i=g(t,n,"@index")||"@index",r=E.compactIri({activeCtx:t,iri:i,relativeTo:{vocab:!0}});if("@index"===i)s=e["@index"],delete O[r];else{let t;if([s,...t]=x(O[i]||[]),a(s))switch(t.length){case 0:delete O[i];break;case 1:O[i]=t[0];break;default:O[i]=t}else s=null}}else if(m.includes("@id")){const e=E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}});s=O[e],delete O[e]}else if(m.includes("@type")){const r=E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}});let o;switch([s,...o]=x(O[r]||[]),o.length){case 0:delete O[r];break;case 1:O[r]=o[0];break;default:O[r]=o}1===Object.keys(O).length&&"@id"in e&&(O=yield E.compact({activeCtx:t,activeProperty:n,element:{"@id":e["@id"]},options:i,compactionMap:f}))}s||(s=E.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}})),w(r,s,O,{propertyIsArray:m.includes("@set")})}else{const t=!i.compactArrays||m.includes("@set")||m.includes("@list")||s(O)&&0===O.length||"@list"===l||"@graph"===l;w(p,n,O,{propertyIsArray:t})}}}else{if((g(t,e,"@container")||[]).includes("@index"))continue;const n=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,p)}else{const n=yield E.compact({activeCtx:t,activeProperty:e,element:p,options:i,compactionMap:f});s(n)&&0===n.length||w(_,l,n)}else{const e=yield E.compact({activeCtx:t,activeProperty:"@reverse",element:p,options:i,compactionMap:f});for(const n in e)if(t.mappings.has(n)&&t.mappings.get(n).reverse){const r=e[n],s=(g(t,n,"@container")||[]).includes("@set")||!i.compactArrays;w(_,n,r,{propertyIsArray:s}),delete e[n]}if(Object.keys(e).length>0){const n=E.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,e)}}else{let e=x(p).map(t=>E.compactIri({activeCtx:S,iri:t,relativeTo:{vocab:!0}}));1===e.length&&(e=e[0]);const n=E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}}),i=(g(t,n,"@container")||[]).includes("@set")&&y(t,1.1)||s(e)&&0===p.length;w(_,n,e,{propertyIsArray:i})}else{let e=x(p).map(e=>E.compactIri({activeCtx:t,iri:e,relativeTo:{vocab:!1},base:i.base}));1===e.length&&(e=e[0]),_[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e}}return _}return n});return function(e){return t.apply(this,arguments)}}(),E.compactIri=({activeCtx:t,iri:e,value:n=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=null})=>{if(null===e)return e;t.isPropertyTermScoped&&t.previousContext&&(t=t.previousContext);const l=t.getInverse();if(m(e)&&e in l&&"@none"in l[e]&&"@type"in l[e]["@none"]&&"@none"in l[e]["@none"]["@type"])return l[e]["@none"]["@type"]["@none"];if(i.vocab&&e in l){const i=t["@language"]||"@none",r=[];o(n)&&"@index"in n&&!("@graph"in n)&&r.push("@index","@index@set"),o(n)&&"@preserve"in n&&(n=n["@preserve"][0]),h(n)?("@index"in n&&r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&r.push("@graph@id","@graph@id@set"),r.push("@graph","@graph@set","@set"),"@index"in n||r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||r.push("@graph@id","@graph@id@set")):o(n)&&!u(n)&&r.push("@id","@id@set","@type","@set@type");let a="@language",l="@null";if(s)a="@type",l="@reverse",r.push("@set");else if(c(n)){"@index"in n||r.push("@list");const t=n["@list"];if(0===t.length)a="@any",l="@none";else{let e=0===t.length?i:null,n=null;for(let i=0;it.includes("_"));t&&a.push(t.replace(/^[^_]+_/,"_"))}a.push("@none");const l=t.inverse[e];for(const o of i){if(!(o in l))continue;const t=l[o][r];for(const e of a)if(e in t)return t[e]}return null}(t,e,n,r,a,l);if(null!==d)return d}if(i.vocab&&"@vocab"in t){const n=t["@vocab"];if(0===e.indexOf(n)&&e!==n){const i=e.substr(n.length);if(!t.mappings.has(i))return i}}let d=null;const p=[];let f=t.fastCurieMap;const g=e.length-1;for(let r=0;r=0;--r){const i=p[r],s=i.terms;for(const r of s){const s=r+":"+e.substr(i.iri.length);t.mappings.get(r)._prefix&&(!t.mappings.has(s)||null===n&&t.mappings.get(s)["@id"]===e)&&(null===d||S(s,d)<0)&&(d=s)}}if(null!==d)return d;for(const[o,c]of t.mappings)if(c&&c._prefix&&e.startsWith(o+":"))throw new r(`Absolute IRI "${e}" confused with prefix "${o}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:t});return i.vocab?e:"@base"in t?t["@base"]?v(_(a,t["@base"]),e):e:v(a,e)},E.compactValue=({activeCtx:t,activeProperty:e,value:n,options:i})=>{if(u(n)){const i=g(t,e,"@type"),r=g(t,e,"@language"),s=g(t,e,"@direction"),o=g(t,e,"@container")||[],l="@index"in n&&!o.includes("@index");if(!l&&"@none"!==i&&(n["@type"]===i||"@language"in n&&n["@language"]===r&&"@direction"in n&&n["@direction"]===s||"@language"in n&&n["@language"]===r||"@direction"in n&&n["@direction"]===s))return n["@value"];const c=Object.keys(n).length,u=1===c||2===c&&"@index"in n&&!l,h="@language"in t,d=a(n["@value"]),p=t.mappings.has(e)&&null===t.mappings.get(e)["@language"];if(u&&"@none"!==i&&(!h||!d||p))return n["@value"];const f={};return l&&(f[E.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?f[E.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:t,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(f[E.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(f[E.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),f[E.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],f}const r=f(t,e,{vocab:!0},i),s=g(t,e,"@type"),o=E.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:"@vocab"===s},base:i.base});return"@id"===s||"@vocab"===s||"@graph"===r?o:{[E.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]:o}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(t,e,n){"use strict";const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF: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:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},{}],19:[function(t,e,n){"use strict";const r=t("./util"),s=t("./JsonLdError"),{isArray:o,isObject:a,isString:l,isUndefined:c}=t("./types"),{isAbsolute:u,isRelative:h,prependBase:d}=t("./url"),{asArray:p,compareShortestLeast:f}=t("./util"),g=new Map,m=/^@[a-zA-Z]+$/,b={};function y(t,e,n,i,r,s){if(null===e||!l(e)||b.isKeyword(e))return e;if(e.match(m))return null;if(i&&i.hasOwnProperty(e)&&!0!==r.get(e)&&b.createTermDefinition({activeCtx:t,localCtx:i,term:e,defined:r,options:s}),(n=n||{}).vocab){const n=t.mappings.get(e);if(null===n)return null;if(a(n)&&"@id"in n)return n["@id"]}const o=e.indexOf(":");if(o>0){const n=e.substr(0,o),a=e.substr(o+1);if("_"===n||0===a.indexOf("//"))return e;i&&i.hasOwnProperty(n)&&b.createTermDefinition({activeCtx:t,localCtx:i,term:n,defined:r,options:s});const l=t.mappings.get(n);if(l&&l._prefix)return l["@id"]+a;if(u(e))return e}if(n.vocab&&"@vocab"in t)return t["@vocab"]+e;if(n.base&&"@base"in t){if(t["@base"])return d(d(s.base,t["@base"]),e)}else if(n.base)return d(s.base,e);return e}function v(t,e){if(!t||"object"!=typeof t||!e||"object"!=typeof e)return t===e;const n=Array.isArray(t);if(n!==Array.isArray(e))return!1;if(n){if(t.length!==e.length)return!1;for(let n=0;n{if(i.has(n)){if(i.get(n))return;throw new s("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:e,term:n})}let h;if(i.set(n,!1),e.hasOwnProperty(n)&&(h=e[n]),"@type"===n&&a(h)&&"@set"===(h["@container"]||"@set")&&b.processingMode(t,1.1)){const t=["@container","@id","@protected"],i=Object.keys(h);if(0===i.length||i.some(e=>!t.includes(e)))throw new s("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n})}else{if(b.isKeyword(n))throw new s("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n});if(n.match(m))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new s("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:e})}const d=t.mappings.get(n);t.mappings.has(n)&&t.mappings.delete(n);let p=!1;if((l(h)||null===h)&&(p=!0,h={"@id":h}),!a(h))throw new s("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:e});const f={};t.mappings.set(n,f),f.reverse=!1;const g=["@container","@id","@language","@reverse","@type"];b.processingMode(t,1.1)&&g.push("@context","@direction","@index","@nest","@prefix","@protected");for(const o in h)if(!g.includes(o))throw new s("Invalid JSON-LD syntax; a term definition must not contain "+o,"jsonld.SyntaxError",{code:"invalid term definition",context:e});const _=n.indexOf(":");if(f._termHasColon=_>0,"@reverse"in h){if("@id"in h)throw new s("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});if("@nest"in h)throw new s("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});const o=h["@reverse"];if(!l(o))throw new s("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(!b.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:o}),void(d?t.mappings.set(n,d):t.mappings.delete(n));const a=y(t,o,{vocab:!0,base:!1},e,i,r);if(!u(a))throw new s("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:e});f["@id"]=a,f.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!l(o))throw new s("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(null===o)f["@id"]=null;else{if(!b.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:o}),void(d?t.mappings.set(n,d):t.mappings.delete(n));if(o!==n){if(o=y(t,o,{vocab:!0,base:!1},e,i,r),!u(o)&&!b.isKeyword(o))throw new s("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:e});if(n.match(/(?::[^:])|\//)&&y(t,n,{vocab:!0,base:!1},e,new Map(i).set(n,!0),r)!==o)throw new s("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});f["@id"]=o,f._prefix=p&&!f._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in f))if(f._termHasColon){const s=n.substr(0,_);if(e.hasOwnProperty(s)&&b.createTermDefinition({activeCtx:t,localCtx:e,term:s,defined:i,options:r}),t.mappings.has(s)){const e=n.substr(_+1);f["@id"]=t.mappings.get(s)["@id"]+e}else f["@id"]=n}else if("@type"===n)f["@id"]=n;else{if(!("@vocab"in t))throw new s("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e,term:n});f["@id"]=t["@vocab"]+n}if((!0===h["@protected"]||!0===i.get("@protected")&&!1!==h["@protected"])&&(t.protected[n]=!0,f.protected=!0),i.set(n,!0),"@type"in h){let n=h["@type"];if(!l(n))throw new s("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if("@json"===n||"@none"===n){if(b.processingMode(t,1))throw new s(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else if("@id"!==n&&"@vocab"!==n){if(n=y(t,n,{vocab:!0,base:!1},e,i,r),!u(n))throw new s("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if(0===n.indexOf("_:"))throw new s("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}f["@type"]=n}if("@container"in h){const n=l(h["@container"])?[h["@container"]]:h["@container"]||[],i=["@list","@set","@index","@language"];let r=!0;const a=n.includes("@set");if(b.processingMode(t,1.1)){if(i.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new s("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:e})}else if(n.includes("@graph")){if(n.some(t=>"@graph"!==t&&"@id"!==t&&"@index"!==t&&"@set"!==t))throw new s("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:e})}else r&=n.length<=(a?2:1);if(n.includes("@type")&&(f["@type"]=f["@type"]||"@id",!["@id","@vocab"].includes(f["@type"])))throw new s("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else r&=!o(h["@container"]),r&=n.length<=1;if(r&=n.every(t=>i.includes(t)),r&=!(a&&n.includes("@list")),!r)throw new s("Invalid JSON-LD syntax; @context @container value must be one of the following: "+i.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:e});if(f.reverse&&!n.every(t=>["@index","@set"].includes(t)))throw new s("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});f["@container"]=n}if("@index"in h){if(!("@container"in h)||!f["@container"].includes("@index"))throw new s(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});if(!l(h["@index"])||0===h["@index"].indexOf("@"))throw new s(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});f["@index"]=h["@index"]}if("@context"in h&&(f["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let t=h["@language"];if(null!==t&&!l(t))throw new s("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:e});null!==t&&(t=t.toLowerCase()),f["@language"]=t}if("@prefix"in h){if(n.match(/:|\//))throw new s("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:e});if(b.isKeyword(f["@id"]))throw new s("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:e});if("boolean"!=typeof h["@prefix"])throw new s("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:e});f._prefix=!0===h["@prefix"]}if("@direction"in h){const t=h["@direction"];if(null!==t&&"ltr"!==t&&"rtl"!==t)throw new s('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:e});f["@direction"]=t}if("@nest"in h){const t=h["@nest"];if(!l(t)||"@nest"!==t&&0===t.indexOf("@"))throw new s("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:e});f["@nest"]=t}const w=f["@id"];if("@context"===w||"@preserve"===w)throw new s("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:e});if(d&&d.protected&&!c&&(t.protected[n]=!0,f.protected=!0,!v(d,f))){const t=r&&r.protectedMode||"error";if("error"===t)throw new s(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:e,term:n});if("warn"===t)return void console.warn("WARNING: protected term redefinition",{term:n});throw new s("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:e,term:n,protectedMode:t})}},b.expandIri=(t,e,n,i)=>y(t,e,n,void 0,void 0,i),b.getInitialContext=t=>{const e=JSON.stringify({processingMode:t.processingMode}),n=g.get(e);if(n)return n;const i={processingMode:t.processingMode,mappings:new Map,inverse:null,getInverse:function(){const t=this;if(t.inverse)return t.inverse;const e=t.inverse={},n=t.fastCurieMap={},i={},r=(t["@language"]||"@none").toLowerCase(),a=t["@direction"],l=t.mappings,c=[...l.keys()].sort(f);for(const s of c){const t=l.get(s);if(null===t)continue;let c=t["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===t["@id"])continue;const u=p(t["@id"]);for(const l of u){let u=e[l];const h=b.isKeyword(l);if(u)!h&&!t._termHasColon&&i[l].push(s);else if(e[l]=u={},!h&&!t._termHasColon){i[l]=[s];const t={iri:l,terms:i[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],o(s,u["@any"],"@none"),t.reverse)o(s,u["@type"],"@reverse");else if("@none"===t["@type"])o(s,u["@any"],"@none"),o(s,u["@language"],"@none"),o(s,u["@type"],"@none");else if("@type"in t)o(s,u["@type"],t["@type"]);else if("@language"in t&&"@direction"in t){const e=t["@language"],n=t["@direction"];o(s,u["@language"],e&&n?`${e}_${n}`.toLowerCase():e?e.toLowerCase():n?`_${n}`:"@null")}else"@language"in t?o(s,u["@language"],(t["@language"]||"@null").toLowerCase()):"@direction"in t?o(s,u["@language"],t["@direction"]?`_${t["@direction"]}`:"@none"):a?(o(s,u["@language"],`_${a}`),o(s,u["@language"],"@none"),o(s,u["@type"],"@none")):(o(s,u["@language"],r),o(s,u["@language"],"@none"),o(s,u["@type"],"@none"))}}for(const o in n)s(n,o,1);return e},clone:function(){const t={};return t.mappings=r.clone(this.mappings),t.clone=this.clone,t.inverse=null,t.getInverse=this.getInverse,t.protected=r.clone(this.protected),this.previousContext&&(t.previousContext=this.previousContext.clone()),t.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(t["@base"]=this["@base"]),"@language"in this&&(t["@language"]=this["@language"]),"@vocab"in this&&(t["@vocab"]=this["@vocab"]),t},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===g.size&&g.clear(),g.set(e,i),i;function s(t,e,n){const i=t[e],r=t[e]={};let o,a;for(const s of i)o=s.iri,a=n>=o.length?"":o[n],a in r?r[a].push(s):r[a]=[s];for(const l in r)""!==l&&s(r,l,n+1)}function o(t,e,n){e.hasOwnProperty(n)||(e[n]=t)}},b.getContextValue=(t,e,n)=>{if(null===e)return"@context"===n?void 0:null;if(t.mappings.has(e)){const i=t.mappings.get(e);if(c(n))return i;if(i.hasOwnProperty(n))return i[n]}return"@language"===n&&n in t||"@direction"===n&&n in t?t[n]:"@context"!==n?null:void 0},b.processingMode=(t,e)=>e.toString()>="1.1"?!t.processingMode||t.processingMode>="json-ld-"+e.toString():"json-ld-1.0"===t.processingMode,b.isKeyword=t=>{if(!l(t)||"@"!==t[0])return!1;switch(t){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}},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(t,e,n){"use strict";const{parseLinkHeader:r,buildHeaders:s}=t("../util"),{LINK_HEADER_CONTEXT:o}=t("../constants"),a=t("../JsonLdError"),l=t("../RequestQueue"),{prependBase:c}=t("../url"),u=/(^|(\r\n))link:/i;function h(t,e,n){const i=new(t=t||XMLHttpRequest);return new Promise((t,r)=>{i.onload=()=>t(i),i.onerror=t=>r(t),i.open("GET",e,!0);for(const e in n)i.setRequestHeader(e,n[e]);i.send()})}e.exports=({secure:t,headers:e={},xhr:n}={headers:{}})=>{return e=s(e),(new l).wrapLoader(d);function d(t){return p.apply(this,arguments)}function p(){return(p=i(function*(i){if(0!==i.indexOf("http:")&&0!==i.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:i});if(t&&0!==i.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:i});let s;try{s=yield h(n,i,e)}catch(m){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:i,cause:m})}if(s.status>=400)throw new a("URL could not be dereferenced: "+s.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:i,httpStatusCode:s.status});let l={contextUrl:null,documentUrl:i,document:s.response},p=null;const f=s.getResponseHeader("Content-Type");let g;if(u.test(s.getAllResponseHeaders())&&(g=s.getResponseHeader("Link")),g&&"application/ld+json"!==f){const t=r(g),e=t[o];if(Array.isArray(e))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:i});e&&(l.contextUrl=e.target),p=t.alternate,p&&"application/ld+json"==p.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(l=yield d(c(i,p.target)))}return l})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(t,e,n){"use strict";const r=t("./JsonLdError"),{isArray:s,isObject:o,isEmptyObject:a,isString:l,isUndefined:c}=t("./types"),{isList:u,isValue:h,isGraph:d,isSubject:p}=t("./graphTypes"),{expandIri:f,getContextValue:g,isKeyword:m,process:b,processingMode:y}=t("./context"),{isAbsolute:v}=t("./url"),{addValue:_,asArray:w,getValues:x,validateTypeValue:S}=t("./util"),E={};e.exports=E;const C=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function O(t){return T.apply(this,arguments)}function T(){return(T=i(function*({activeCtx:t,activeProperty:e,expandedActiveProperty:n,element:i,expandedParent:d,options:x={},insideList:T,typeKey:k,typeScopedContext:I,expansionMap:M}){const D=Object.keys(i).sort(),R=[];let N;const L=i[k]&&"@json"===f(t,s(i[k])?i[k][0]:i[k],{vocab:!0},x);for(const O of D){let k,D=i[O];if("@context"===O)continue;let j=f(t,O,{vocab:!0},x);if((null===j||!v(j)&&!m(j))&&(j=M({unmappedProperty:O,activeCtx:t,activeProperty:e,parent:i,options:x,insideList:T,value:D,expandedParent:d}),void 0===j))continue;if(m(j)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:D});if(j in d&&"@included"!==j&&"@type"!==j)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:j})}if("@id"===j){if(!l(D)){if(!x.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(o(D)){if(!a(D))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}else{if(!s(D))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(!D.every(t=>l(t)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}}_(d,"@id",w(D).map(e=>l(e)?f(t,e,{base:!0},x):e),{propertyIsArray:x.isFrame});continue}if("@type"===j){o(D)&&(D=Object.fromEntries(Object.entries(D).map(([t,e])=>[f(I,t,{vocab:!0}),w(e).map(t=>f(I,t,{base:!0,vocab:!0}))]))),S(D,x.isFrame),_(d,"@type",w(D).map(t=>l(t)?f(I,t,{base:!0,vocab:!0},x):t),{propertyIsArray:x.isFrame});continue}if("@included"===j&&y(t,1.1)){const n=w(yield E.expand({activeCtx:t,activeProperty:e,element:D,options:x,expansionMap:M}));if(!n.every(t=>p(t)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:D});_(d,"@included",n,{propertyIsArray:!0});continue}if("@graph"===j&&!o(D)&&!s(D))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:D});if("@value"===j){N=D,L&&y(t,1.1)?d["@value"]=D:_(d,"@value",D,{propertyIsArray:x.isFrame});continue}if("@language"===j){if(null===D)continue;if(!l(D)&&!x.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:D});D=w(D).map(t=>l(t)?t.toLowerCase():t);for(const t of D)l(t)&&!t.match(C)&&console.warn(`@language must be valid BCP47: ${t}`);_(d,"@language",D,{propertyIsArray:x.isFrame});continue}if("@direction"===j){if(!l(D)&&!x.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:D});D=w(D);for(const t of D)if(l(t)&&"ltr"!==t&&"rtl"!==t)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:D});_(d,"@direction",D,{propertyIsArray:x.isFrame});continue}if("@index"===j){if(!l(D))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:D});_(d,"@index",D);continue}if("@reverse"===j){if(!o(D))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:D});if(k=yield E.expand({activeCtx:t,activeProperty:"@reverse",element:D,options:x,expansionMap:M}),"@reverse"in k)for(const t in k["@reverse"])_(d,t,k["@reverse"][t],{propertyIsArray:!0});let e=d["@reverse"]||null;for(const t in k){if("@reverse"===t)continue;null===e&&(e=d["@reverse"]={}),_(e,t,[],{propertyIsArray:!0});const n=k[t];for(let i=0;i"@id"===t||"@index"===t)&&(k=w(k).map(t=>({"@graph":w(t)}))),F.mappings.has(O)&&F.mappings.get(O).reverse){const t=d["@reverse"]=d["@reverse"]||{};k=w(k);for(let e=0;e"@value"===f(t,e,{vocab:!0},x)))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:n,element:i,expandedParent:d,options:x,insideList:T,typeScopedContext:I,typeKey:k,expansionMap:M})}}})).apply(this,arguments)}function k({activeCtx:t,activeProperty:e,value:n,options:i}){if(null==n)return null;const r=f(t,e,{vocab:!0},i);if("@id"===r)return f(t,n,{base:!0},i);if("@type"===r)return f(t,n,{vocab:!0,base:!0},i);const s=g(t,e,"@type");if(("@id"===s||"@graph"===r)&&l(n))return{"@id":f(t,n,{base:!0},i)};if("@vocab"===s&&l(n))return{"@id":f(t,n,{vocab:!0,base:!0},i)};if(m(r))return n;const o={};if(s&&!["@id","@vocab","@none"].includes(s))o["@type"]=s;else if(l(n)){const n=g(t,e,"@language");null!==n&&(o["@language"]=n);const i=g(t,e,"@direction");null!==i&&(o["@direction"]=i)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),o["@value"]=n,o}function A(t,e,n,i){const o=[],a=Object.keys(e).sort();for(const c of a){const a=f(t,c,{vocab:!0},i);let u=e[c];s(u)||(u=[u]);for(const t of u){if(null===t)continue;if(!l(t))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:e});const i={"@value":t};"@none"!==a&&(i["@language"]=c.toLowerCase()),n&&(i["@direction"]=n),o.push(i)}}return o}function P(t){return I.apply(this,arguments)}function I(){return(I=i(function*({activeCtx:t,options:e,activeProperty:n,value:i,expansionMap:o,asGraph:a,indexKey:l,propertyIndex:u}){const p=[],m=Object.keys(i).sort(),y="@type"===l;for(let v of m){if(y){const n=g(t,v,"@context");c(n)||(t=yield b({activeCtx:t,localCtx:n,propagate:!1,options:e}))}let m,w=i[v];s(w)||(w=[w]),w=yield E.expand({activeCtx:t,activeProperty:n,element:w,options:e,insideList:!1,insideIndex:!0,expansionMap:o}),m=u?"@none"===v?"@none":k({activeCtx:t,activeProperty:l,value:v,options:e}):f(t,v,{vocab:!0},e),"@id"===l?v=f(t,v,{base:!0},e):y&&(v=m);for(let t of w){if(a&&!d(t)&&(t={"@graph":[t]}),"@type"===l)"@none"===m||(t["@type"]=t["@type"]?[v].concat(t["@type"]):[v]);else{if(h(t)&&!["@language","@type","@index"].includes(l))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${l}".`,"jsonld.SyntaxError",{code:"invalid value object",value:t});u?"@none"!==m&&_(t,u,m,{propertyIsArray:!0,prependValue:!0}):"@none"!==m&&!(l in t)&&(t[l]=v)}p.push(t)}}return p})).apply(this,arguments)}E.expand=function(){var t=i(function*({activeCtx:t,activeProperty:e=null,element:n,options:i={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:d=null,expansionMap:p=(()=>{})}){if(null==n)return null;if("@default"===e&&(i=Object.assign({},i,{isFrame:!1})),!s(n)&&!o(n)){if(!u&&(null===e||"@graph"===f(t,e,{vocab:!0},i))){const r=yield p({unmappedValue:n,activeCtx:t,activeProperty:e,options:i,insideList:u});return void 0===r?null:r}return k({activeCtx:t,activeProperty:e,value:n,options:i})}if(s(n)){let r=[];const o=g(t,e,"@container")||[];u=u||o.includes("@list");for(let a=0;a1?e.slice().sort():e:[e];for(const n of s){const e=g(d,n,"@context");c(e)||(t=yield b({activeCtx:t,localCtx:e,options:i,propagate:!1}))}}let A={};yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:m,element:n,expandedParent:A,options:i,insideList:u,typeKey:T,typeScopedContext:d,expansionMap:p}),S=Object.keys(A);let P=S.length;if("@value"in A){if("@type"in A&&("@language"in A||"@direction"in A))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});let s=P-1;if("@type"in A&&(s-=1),"@index"in A&&(s-=1),"@language"in A&&(s-=1),"@direction"in A&&(s-=1),0!==s)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});const o=null===A["@value"]?[]:w(A["@value"]),c=x(A,"@type");if(!y(t,1.1)||!c.includes("@json")||1!==c.length)if(0===o.length){const r=yield p({unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}else{if(!o.every(t=>l(t)||a(t))&&"@language"in A)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:A});if(!c.every(t=>v(t)&&!(l(t)&&0===t.indexOf("_:"))||a(t)))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:A})}}else if("@type"in A&&!s(A["@type"]))A["@type"]=[A["@type"]];else if("@set"in A||"@list"in A){if(P>1&&(2!==P||!("@index"in A)))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:A});"@set"in A&&(A=A["@set"],S=Object.keys(A),P=S.length)}else if(1===P&&"@language"in A){const r=yield p(A,{unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}if(o(A)&&!i.keepFreeFloatingNodes&&!u&&(null===e||"@graph"===m)&&(0===P||"@value"in A||"@list"in A||1===P&&"@id"in A)){const r=yield p({unmappedValue:A,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});A=void 0!==r?r:null}return A});return function(e){return t.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(t,e,n){"use strict";const{isSubjectReference:i}=t("./graphTypes"),{createMergedNodeMap:r}=t("./nodeMap"),s={};e.exports=s,s.flatten=t=>{const e=r(t),n=[],s=Object.keys(e).sort();for(let r=0;r=0;--i){const r=n[i];if(r.graph===e&&r.subject["@id"]===t["@id"])return!0}return!1}function f(t,e,n){const i="@"+n;let r=i in t?t[i][0]:e[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:t});return r}function g(t){if(!s.isArray(t)||1!==t.length||!s.isObject(t[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:t});if("@id"in t[0])for(const e of o.asArray(t[0]["@id"]))if(!s.isObject(e)&&!a.isAbsolute(e)||s.isString(e)&&0===e.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t});if("@type"in t[0])for(const e of o.asArray(t[0]["@type"]))if(!s.isObject(e)&&!a.isAbsolute(e)||s.isString(e)&&0===e.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t})}function m(t,e,n,a){let l=!0,c=!1;for(const u in n){let h=!1;const d=o.getValues(e,u),p=0===o.getValues(n,u).length;if("@id"===u){if(s.isEmptyObject(n["@id"][0]||{})?h=!0:n["@id"].length>=0&&(h=n["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(l=!1,p){if(d.length>0)return!1;h=!0}else if(1===n["@type"].length&&s.isEmptyObject(n["@type"][0]))h=d.length>0;else for(const t of n["@type"])h=!(!s.isObject(t)||!("@default"in t))||h||d.some(e=>e===t);if(!a.requireAll)return h}else{if(i(u))continue;{const e=o.getValues(n,u)[0];let i=!1;if(e&&(g([e]),i="@default"in e),l=!1,0===d.length&&i)continue;if(d.length>0&&p)return!1;if(void 0===e){if(d.length>0)return!1;h=!0}else if(r.isList(e)){const n=e["@list"][0];if(r.isList(d[0])){const e=d[0]["@list"];r.isValue(n)?h=e.some(t=>w(n,t)):(r.isSubject(n)||r.isSubjectReference(n))&&(h=e.some(e=>_(t,n,e,a)))}}else h=r.isValue(e)?d.some(t=>w(e,t)):r.isSubjectReference(e)?d.some(n=>_(t,e,n,a)):!!s.isObject(e)&&d.length>0}}if(!h&&a.requireAll)return!1;c=c||h}return l||c}function b(t,e){const n=t.uniqueEmbeds[t.graph],i=n[e],r=i.parent,a=i.property,l={"@id":e};if(s.isArray(r)){for(let t=0;t{const e=Object.keys(n);for(const i of e)i in n&&s.isObject(n[i].parent)&&n[i].parent["@id"]===t&&(delete n[i],c(i))};c(e)}function y(t,e){if(s.isArray(t))return t.map(t=>y(t,e));if(s.isObject(t)){if("@preserve"in t)return t["@preserve"][0];if(r.isValue(t))return t;if(r.isList(t))return t["@list"]=y(t["@list"],e),t;if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)"@id"===n&&e.bnodesToClear.includes(t[n])?delete t["@id"]:t[n]=y(t[n],e)}return t}function v(t,e,n){s.isObject(t)?o.addValue(t,e,n,{propertyIsArray:!0}):t.push(n)}function _(t,e,n,i){if(!("@id"in n))return!1;const r=t.subjects[n["@id"]];return r&&m(t,r,e,i)}function w(t,e){const n=e["@value"],i=e["@type"],r=e["@language"],o=t["@value"]?s.isArray(t["@value"])?t["@value"]:[t["@value"]]:[],a=t["@type"]?s.isArray(t["@type"])?t["@type"]:[t["@type"]]:[],l=t["@language"]?s.isArray(t["@language"])?t["@language"]:[t["@language"]]:[];return 0===o.length&&0===a.length&&0===l.length||!(!o.includes(n)&&!s.isEmptyObject(o[0])||!(!i&&0===a.length||a.includes(i)||i&&s.isEmptyObject(a[0]))||!(!r&&0===l.length||l.includes(r)||r&&s.isEmptyObject(l[0])))}e.exports=h,h.frameMergedOrDefault=(t,e,n)=>{const i={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},r=new o.IdentifierIssuer("_:b");c(t,i.graphMap,"@default",r),n.merged&&(i.graphMap["@merged"]=u(i.graphMap),i.graph="@merged"),i.subjects=i.graphMap[i.graph];const s=[];return h.frame(i,Object.keys(i.subjects).sort(),e,s),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(i.bnodeMap).filter(t=>1===i.bnodeMap[t].length)),n.link={},y(s,n)},h.frame=(t,e,n,a,c=null)=>{g(n);const u=t.options,y={embed:f(n=n[0],u,"embed"),explicit:f(n,u,"explicit"),requireAll:f(n,u,"requireAll")};t.link.hasOwnProperty(t.graph)||(t.link[t.graph]={});const _=t.link[t.graph],x=function(t,e,n,i){const r={};for(const s of e){const e=t.graphMap[t.graph][s];m(t,e,n,i)&&(r[s]=e)}return r}(t,e,n,y),S=Object.keys(x).sort();for(const g of S){const m=x[g];if(null===c?t.uniqueEmbeds={[t.graph]:{}}:t.uniqueEmbeds[t.graph]=t.uniqueEmbeds[t.graph]||{},"@link"===y.embed&&g in _){v(a,c,_[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&o.addValue(t.bnodeMap,g,S,{propertyIsArray:!0}),_[g]=S,("@first"===y.embed||"@last"===y.embed)&&t.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(t.embedded||!t.uniqueEmbeds[t.graph].hasOwnProperty(g)){if(t.embedded&&("@never"===y.embed||p(m,t.graph,t.subjectStack))){v(a,c,S);continue}if(t.embedded&&("@first"==y.embed||"@once"==y.embed)&&t.uniqueEmbeds[t.graph].hasOwnProperty(g)){v(a,c,S);continue}if("@last"===y.embed&&g in t.uniqueEmbeds[t.graph]&&b(t,g),t.uniqueEmbeds[t.graph][g]={parent:a,property:c},t.subjectStack.push({subject:m,graph:t.graph}),g in t.graphMap){let e=!1,i=null;"@graph"in n?(i=n["@graph"][0],e=!("@merged"===g||"@default"===g),s.isObject(i)||(i={})):(e="@merged"!==t.graph,i={}),e&&h.frame(ti(bt({},t),{graph:g,embedded:!1}),Object.keys(t.graphMap[g]).sort(),[i],S,"@graph")}"@included"in n&&h.frame(ti(bt({},t),{embedded:!1}),e,n["@included"],S,"@included");for(const e of Object.keys(m).sort())if(i(e)){if(S[e]=o.clone(m[e]),"@type"===e)for(const e of m["@type"])0===e.indexOf("_:")&&o.addValue(t.bnodeMap,e,S,{propertyIsArray:!0})}else if(!y.explicit||e in n)for(const i of m[e]){const s=e in n?n[e]:d(y);if(r.isList(i)){const s=n[e]&&n[e][0]&&n[e][0]["@list"]?n[e][0]["@list"]:d(y),a={"@list":[]};v(S,e,a);const l=i["@list"];for(const e of l)r.isSubjectReference(e)?h.frame(ti(bt({},t),{embedded:!0}),[e["@id"]],s,a,"@list"):v(a,"@list",o.clone(e))}else r.isSubjectReference(i)?h.frame(ti(bt({},t),{embedded:!0}),[i["@id"]],s,S,e):w(s[0],i)&&v(S,e,o.clone(i))}for(const t of Object.keys(n).sort()){if("@type"===t){if(!s.isObject(n[t][0])||!("@default"in n[t][0]))continue}else if(i(t))continue;const e=n[t][0]||{};if(!f(e,u,"omitDefault")&&!(t in S)){let n="@null";"@default"in e&&(n=o.clone(e["@default"])),s.isArray(n)||(n=[n]),S[t]=[{"@preserve":n}]}}for(const e of Object.keys(n["@reverse"]||{}).sort()){const i=n["@reverse"][e];for(const n of Object.keys(t.subjects))o.getValues(t.subjects[n],e).some(t=>t["@id"]===g)&&(S["@reverse"]=S["@reverse"]||{},o.addValue(S["@reverse"],e,[],{propertyIsArray:!0}),h.frame(ti(bt({},t),{embedded:!0}),[n],i,S["@reverse"][e],c))}v(a,c,S),t.subjectStack.pop()}}},h.cleanupNull=(t,e)=>{if(s.isArray(t))return t.map(t=>h.cleanupNull(t,e)).filter(t=>t);if("@null"===t)return null;if(s.isObject(t)){if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)t[n]=h.cleanupNull(t[n],e)}return t}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(t,e,n){"use strict";const r=t("./JsonLdError"),s=t("./graphTypes"),o=t("./types"),a=t("./util"),{RDF_LIST:l,RDF_FIRST:c,RDF_REST:u,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:p,XSD_BOOLEAN:f,XSD_DOUBLE:g,XSD_INTEGER:m,XSD_STRING:b}=t("./constants"),y=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,v={};function _(t,e,n){if(t.termType.endsWith("Node"))return{"@id":t.value};const i={"@value":t.value};if(t.language)i["@language"]=t.language;else{let a=t.datatype.value;if(a||(a=b),a===p){a="@json";try{i["@value"]=JSON.parse(i["@value"])}catch(s){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:i["@value"],cause:s})}}if(e){if(a===f)"true"===i["@value"]?i["@value"]=!0:"false"===i["@value"]&&(i["@value"]=!1);else if(o.isNumeric(i["@value"]))if(a===m){const t=parseInt(i["@value"],10);t.toFixed(0)===i["@value"]&&(i["@value"]=t)}else a===g&&(i["@value"]=parseFloat(i["@value"]));[f,m,g,b].includes(a)||(i["@type"]=a)}else if("i18n-datatype"===n&&a.startsWith("https://www.w3.org/ns/i18n#")){const[,t,e]=a.split(/[#_]/);t.length>0&&(i["@language"]=t,t.match(y)||console.warn(`@language must be valid BCP47: ${t}`)),i["@direction"]=e}else a!==b&&(i["@type"]=a)}return i}e.exports=v,v.fromRDF=function(){var t=i(function*(t,{useRdfType:e=!1,useNativeTypes:n=!1,rdfDirection:i=null}){const r={},p={"@default":r},f={};for(const s of t){const t="DefaultGraph"===s.graph.termType?"@default":s.graph.value;t in p||(p[t]={}),"@default"!==t&&!(t in r)&&(r[t]={"@id":t});const o=p[t],l=s.subject.value,c=s.predicate.value,u=s.object;l in o||(o[l]={"@id":l});const g=o[l],m=u.termType.endsWith("Node");if(m&&!(u.value in o)&&(o[u.value]={"@id":u.value}),c===d&&!e&&m){a.addValue(g,"@type",u.value,{propertyIsArray:!0});continue}const b=_(u,n,i);if(a.addValue(g,c,b,{propertyIsArray:!0}),m)if(u.value===h){const t=o[u.value];"usages"in t||(t.usages=[]),t.usages.push({node:g,property:c,value:b})}else f[u.value]=!(u.value in f)&&{node:g,property:c,value:b}}for(const a in p){const t=p[a];if(!(h in t))continue;const e=t[h];if(e.usages){for(let n of e.usages){let e=n.node,i=n.property,r=n.value;const a=[],h=[];let d=Object.keys(e).length;for(;i===u&&o.isObject(f[e["@id"]])&&o.isArray(e[c])&&1===e[c].length&&o.isArray(e[u])&&1===e[u].length&&(3===d||4===d&&o.isArray(e["@type"])&&1===e["@type"].length&&e["@type"][0]===l)&&(a.push(e[c][0]),h.push(e["@id"]),n=f[e["@id"]],e=n.node,i=n.property,r=n.value,d=Object.keys(e).length,s.isBlankNode(e)););delete r["@id"],r["@list"]=a.reverse();for(const n of h)delete t[n]}delete e.usages}}const g=[],m=Object.keys(r).sort();for(const o of m){const t=r[o];if(o in p){const e=t["@graph"]=[],n=p[o],i=Object.keys(n).sort();for(const t of i){const i=n[t];s.isSubjectReference(i)||e.push(i)}}s.isSubjectReference(t)||g.push(t)}return g});return function(e,n){return t.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(t,e,n){"use strict";const i=t("./types"),r={};e.exports=r,r.isSubject=t=>!(!i.isObject(t)||"@value"in t||"@set"in t||"@list"in t)&&(Object.keys(t).length>1||!("@id"in t)),r.isSubjectReference=t=>i.isObject(t)&&1===Object.keys(t).length&&"@id"in t,r.isValue=t=>i.isObject(t)&&"@value"in t,r.isList=t=>i.isObject(t)&&"@list"in t,r.isGraph=t=>i.isObject(t)&&"@graph"in t&&1===Object.keys(t).filter(t=>"@id"!==t&&"@index"!==t).length,r.isSimpleGraph=t=>r.isGraph(t)&&!("@id"in t),r.isBlankNode=t=>!!i.isObject(t)&&("@id"in t?0===t["@id"].indexOf("_:"):0===Object.keys(t).length||!("@value"in t||"@set"in t||"@list"in t))},{"./types":30}],26:[function(t,e,n){const r=t("rdf-canonize"),s=t("./platform"),o=t("./util"),a=t("./ContextResolver"),l=o.IdentifierIssuer,c=t("./JsonLdError"),u=t("lru-cache"),h=t("./NQuads"),{expand:d}=t("./expand"),{flatten:p}=t("./flatten"),{fromRDF:f}=t("./fromRdf"),{toRDF:g}=t("./toRdf"),{frameMergedOrDefault:m,cleanupNull:b}=t("./frame"),{isArray:y,isObject:v,isString:_}=t("./types"),{isSubjectReference:w}=t("./graphTypes"),{expandIri:x,getInitialContext:S,process:E,processingMode:C}=t("./context"),{compact:O,compactIri:T}=t("./compact"),{createNodeMap:k,createMergedNodeMap:A,mergeNodeMaps:P}=t("./nodeMap"),I=function(e){const n={},I=new u({max:100});function M(t,n){var i=n,{documentLoader:r=e.documentLoader}=i,s=iX(i,["documentLoader"]);return Object.assign({},{documentLoader:r},s,t)}return e.compact=function(){var t=i(function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let r;(i=M(i,{base:_(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new l("_:b"),contextResolver:new a({sharedCache:I})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,r=i.skipExpansion?t:yield e.expand(t,i);const s=yield e.processContext(S(i),n,i);let u=yield O({activeCtx:s,element:r,options:i,compactionMap:i.compactionMap});i.compactArrays&&!i.graph&&y(u)?1===u.length?u=u[0]:0===u.length&&(u={}):i.graph&&v(u)&&(u=[u]),v(n)&&"@context"in n&&(n=n["@context"]),n=o.clone(n),y(n)||(n=[n]);const h=n;n=[];for(let e=0;e0)&&n.push(h[e]);const d=n.length>0;if(1===n.length&&(n=n[0]),y(u)){const t=T({activeCtx:s,iri:"@graph",relativeTo:{vocab:!0}}),e=u;u={},d&&(u["@context"]=n),u[t]=e}else if(v(u)&&d){const t=u;u={"@context":n};for(const e in t)u[e]=t[e]}return u});return function(e,n,i){return t.apply(this,arguments)}}(),e.expand=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=M(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:I})})).expansionMap&&(n.expansionMap=void 0);const i={},r=[];if("expandContext"in n){const t=o.clone(n.expandContext);i.expandContext=v(t)&&"@context"in t?t:{"@context":t},r.push(i.expandContext)}let s;if(_(t)){const o=yield e.get(t,n);s=o.documentUrl,i.input=o.document,o.contextUrl&&(i.remoteContext={"@context":o.contextUrl},r.push(i.remoteContext))}else i.input=o.clone(t);"base"in n||(n.base=s||"");let l=S(n);for(const e of r)l=yield E({activeCtx:l,localCtx:e,options:n});let c=yield d({activeCtx:l,element:i.input,options:n,expansionMap:n.expansionMap});return v(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),y(c)||(c=[c]),c});return function(e,n){return t.apply(this,arguments)}}(),e.flatten=function(){var t=i(function*(t,n,i){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,i=M(i,{base:_(t)?t:"",contextResolver:new a({sharedCache:I})});const r=yield e.expand(t,i),s=p(r);return null===n?s:(i.graph=!0,i.skipExpansion=!0,yield e.compact(s,n,i))});return function(e,n,i){return t.apply(this,arguments)}}(),e.frame=function(){var t=i(function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(i=M(i,{base:_(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:I})}),_(n)){const t=yield e.get(n,i);if(n=t.document,t.contextUrl){let e=n["@context"];e?y(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const r=n&&n["@context"]||{},s=yield e.processContext(S(i),r,i);i.hasOwnProperty("omitGraph")||(i.omitGraph=C(s,1.1)),i.hasOwnProperty("pruneBlankNodeIdentifiers")||(i.pruneBlankNodeIdentifiers=C(s,1.1));const o=yield e.expand(t,i),l=bt({},i);l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=yield e.expand(n,l),u=Object.keys(n).map(t=>x(s,t,{vocab:!0}));l.merged=!u.includes("@graph"),l.is11=C(s,1.1);const h=m(o,c,l);l.graph=!i.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let d=yield e.compact(h,r,l);return l.link={},d=b(d,l),d});return function(e,n,i){return t.apply(this,arguments)}}(),e.link=function(){var t=i(function*(t,n,i){const r={};return n&&(r["@context"]=n),r["@embed"]="@link",e.frame(t,r,i)});return function(e,n,i){return t.apply(this,arguments)}}(),e.normalize=e.canonize=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=M(n,{base:_(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:I})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const e=h.parse(t);return r.canonize(e,n)}const i=bt({},n);delete i.format,i.produceGeneralizedRdf=!1;const s=yield e.toRDF(t,i);return r.canonize(s,n)});return function(e,n){return t.apply(this,arguments)}}(),e.fromRDF=function(){var t=i(function*(t,e){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");e=M(e,{format:_(t)?"application/n-quads":void 0});const{format:i}=e;let{rdfParser:r}=e;if(i){if(r=r||n[i],!r)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:i})}else r=()=>t;const s=yield r(t);return f(s,e)});return function(e,n){return t.apply(this,arguments)}}(),e.toRDF=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let i;i=(n=M(n,{base:_(t)?t:"",skipExpansion:!1,contextResolver:new a({sharedCache:I})})).skipExpansion?t:yield e.expand(t,n);const r=g(i,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return h.serialize(r);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return r});return function(e,n){return t.apply(this,arguments)}}(),e.createNodeMap=function(){var t=i(function*(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=M(n,{base:_(t)?t:"",contextResolver:new a({sharedCache:I})});const i=yield e.expand(t,n);return A(i,n)});return function(e,n){return t.apply(this,arguments)}}(),e.merge=function(){var t=i(function*(t,n,i){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,i=M(i,{contextResolver:new a({sharedCache:I})});const r=yield Promise.all(t.map(t=>{const n=bt({},i);return e.expand(t,n)}));let s=!0;"mergeNodes"in i&&(s=i.mergeNodes);const c=i.issuer||new l("_:b"),u={"@default":{}};for(let e=0;ee._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=function(){var t=i(function*(t){throw new c("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:t})});return function(e){return t.apply(this,arguments)}}(),e.get=function(){var t=i(function*(t,n){let i;i="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const r=yield i(t);try{if(!r.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");_(r.document)&&(r.document=JSON.parse(r.document))}catch(s){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:s,remoteDoc:r})}return r});return function(e,n){return t.apply(this,arguments)}}(),e.processContext=function(){var t=i(function*(t,e,n){return n=M(n,{base:"",contextResolver:new a({sharedCache:I})}),null===e?S(n):(e=o.clone(e),v(e)&&"@context"in e||(e={"@context":e}),E({activeCtx:t,localCtx:e,options:n}))});return function(e,n,i){return t.apply(this,arguments)}}(),e.getContextValue=t("./context").getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new c('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(t,e){n[t]=e},e.unregisterRDFParser=function(t){delete n[t]},e.registerRDFParser("application/n-quads",h.parse),e.registerRDFParser("application/nquads",h.parse),e.url=t("./url"),e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=t("./RequestQueue"),e.JsonLdProcessor=t("./JsonLdProcessor")(e),s.setupGlobals(e),s.setupDocumentLoaders(e),e},M=function(){return I(function(){return M()})};I(M),e.exports=M},{"./ContextResolver":11,"./JsonLdError":12,"./JsonLdProcessor":13,"./NQuads":14,"./RequestQueue":15,"./compact":17,"./context":19,"./expand":21,"./flatten":22,"./frame":23,"./fromRdf":24,"./graphTypes":25,"./nodeMap":27,"./platform":28,"./toRdf":29,"./types":30,"./url":31,"./util":32,"lru-cache":33,"rdf-canonize":46}],27:[function(t,e,n){"use strict";const{isKeyword:i}=t("./context"),r=t("./graphTypes"),s=t("./types"),o=t("./util"),a=t("./JsonLdError"),l={};e.exports=l,l.createMergedNodeMap=(t,e)=>{const n=(e=e||{}).issuer||new o.IdentifierIssuer("_:b"),i={"@default":{}};return l.createNodeMap(t,i,"@default",n),l.mergeNodeMaps(i)},l.createNodeMap=(t,e,n,c,u,h)=>{if(s.isArray(t)){for(const i of t)l.createNodeMap(i,e,n,c,void 0,h);return}if(!s.isObject(t))return void(h&&h.push(t));if(r.isValue(t)){if("@type"in t){let e=t["@type"];0===e.indexOf("_:")&&(t["@type"]=e=c.getId(e))}return void(h&&h.push(t))}if(h&&r.isList(t)){const i=[];return l.createNodeMap(t["@list"],e,n,c,u,i),void h.push({"@list":i})}if("@type"in t){const e=t["@type"];for(const t of e)0===t.indexOf("_:")&&c.getId(t)}s.isUndefined(u)&&(u=r.isBlankNode(t)?c.getId(t["@id"]):t["@id"]),h&&h.push({"@id":u});const d=e[n],p=d[u]=d[u]||{};p["@id"]=u;const f=Object.keys(t).sort();for(let s of f){if("@id"===s)continue;if("@reverse"===s){const i={"@id":u},s=t["@reverse"];for(const t in s){const a=s[t];for(const s of a){let a=s["@id"];r.isBlankNode(s)&&(a=c.getId(a)),l.createNodeMap(s,e,n,c,a),o.addValue(d[a],t,i,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===s){u in e||(e[u]={}),l.createNodeMap(t[s],e,u,c);continue}if("@included"===s){l.createNodeMap(t[s],e,n,c);continue}if("@type"!==s&&i(s)){if("@index"===s&&s in p&&(t[s]!==p[s]||t[s]["@id"]!==p[s]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:p});p[s]=t[s];continue}const h=t[s];if(0===s.indexOf("_:")&&(s=c.getId(s)),0!==h.length)for(let t of h)if("@type"===s&&(t=0===t.indexOf("_:")?c.getId(t):t),r.isSubject(t)||r.isSubjectReference(t)){if("@id"in t&&!t["@id"])continue;const i=r.isBlankNode(t)?c.getId(t["@id"]):t["@id"];o.addValue(p,s,{"@id":i},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(t,e,n,c,i)}else if(r.isValue(t))o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1});else if(r.isList(t)){const i=[];l.createNodeMap(t["@list"],e,n,c,u,i),t={"@list":i},o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(t,e,n,c,u),o.addValue(p,s,t,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(p,s,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=t=>{const e={};for(const n of Object.keys(t).sort())for(const r of Object.keys(t[n]).sort()){const s=t[n][r];r in e||(e[r]={"@id":r});const a=e[r];for(const t of Object.keys(s).sort())if(i(t)&&"@type"!==t)a[t]=o.clone(s[t]);else for(const e of s[t])o.addValue(a,t,o.clone(e),{propertyIsArray:!0,allowDuplicate:!1})}return e},l.mergeNodeMaps=t=>{const e=t["@default"],n=Object.keys(t).sort();for(const i of n){if("@default"===i)continue;const n=t[i];let s=e[i];s?"@graph"in s||(s["@graph"]=[]):e[i]=s={"@id":i,"@graph":[]};const o=s["@graph"];for(const t of Object.keys(n).sort()){const e=n[t];r.isSubjectReference(e)||o.push(e)}}return e}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(t,e,n){"use strict";const i=t("./documentLoaders/xhr"),r={};e.exports=r,r.setupDocumentLoaders=function(t){"undefined"!=typeof XMLHttpRequest&&(t.documentLoaders.xhr=i,t.useDocumentLoader("xhr"))},r.setupGlobals=function(t){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(t,e,n){"use strict";const{createNodeMap:i}=t("./nodeMap"),{isKeyword:r}=t("./context"),s=t("./graphTypes"),o=t("canonicalize"),a=t("./types"),l=t("./util"),{RDF_FIRST:c,RDF_REST:u,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:p,RDF_LANGSTRING:f,XSD_BOOLEAN:g,XSD_DOUBLE:m,XSD_INTEGER:b,XSD_STRING:y}=t("./constants"),{isAbsolute:v}=t("./url"),_={};function w(t,e,n,i,s){const o=Object.keys(e).sort();for(const a of o){const o=e[a],l=Object.keys(o).sort();for(let e of l){const l=o[e];if("@type"===e)e=d;else if(r(e))continue;for(const r of l){const o={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!v(a))continue;const l={termType:e.startsWith("_:")?"BlankNode":"NamedNode",value:e};if(!v(e)||"BlankNode"===l.termType&&!s.produceGeneralizedRdf)continue;const c=x(r,i,t,n,s.rdfDirection);c&&t.push({subject:o,predicate:l,object:c,graph:n})}}}}function x(t,e,n,i,r){const l={};if(s.isValue(t)){l.termType="Literal",l.value=void 0,l.datatype={termType:"NamedNode"};let e=t["@value"];const n=t["@type"]||null;"@json"===n?(l.value=o(e),l.datatype.value=p):a.isBoolean(e)?(l.value=e.toString(),l.datatype.value=n||g):a.isDouble(e)||n===m?(a.isDouble(e)||(e=parseFloat(e)),l.value=e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),l.datatype.value=n||m):a.isNumber(e)?(l.value=e.toFixed(0),l.datatype.value=n||b):"i18n-datatype"===r&&"@direction"in t?(l.datatype.value="https://www.w3.org/ns/i18n#"+(t["@language"]||"")+`_${t["@direction"]}`,l.value=e):"@language"in t?(l.value=e,l.datatype.value=n||f,l.language=t["@language"]):(l.value=e,l.datatype.value=n||y)}else if(s.isList(t)){const s=function(t,e,n,i,r){const s={termType:"NamedNode",value:c},o={termType:"NamedNode",value:u},a={termType:"NamedNode",value:h},l=t.pop(),d=l?{termType:"BlankNode",value:e.getId()}:a;let p=d;for(const c of t){const t=x(c,e,n,i,r),a={termType:"BlankNode",value:e.getId()};n.push({subject:p,predicate:s,object:t,graph:i}),n.push({subject:p,predicate:o,object:a,graph:i}),p=a}if(l){const t=x(l,e,n,i,r);n.push({subject:p,predicate:s,object:t,graph:i}),n.push({subject:p,predicate:o,object:a,graph:i})}return d}(t["@list"],e,n,i,r);l.termType=s.termType,l.value=s.value}else{const e=a.isObject(t)?t["@id"]:t;l.termType=e.startsWith("_:")?"BlankNode":"NamedNode",l.value=e}return"NamedNode"!==l.termType||v(l.value)?l:null}e.exports=_,_.toRDF=(t,e)=>{const n=new l.IdentifierIssuer("_:b"),r={"@default":{}};i(t,r,"@default",n);const s=[],o=Object.keys(r).sort();for(const i of o){let t;if("@default"===i)t={termType:"DefaultGraph",value:""};else{if(!v(i))continue;t=i.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},t.value=i}w(s,r[i],t,n,e)}return s}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(t,e,n){"use strict";const i={};e.exports=i,i.isArray=Array.isArray,i.isBoolean=t=>"boolean"==typeof t||"[object Boolean]"===Object.prototype.toString.call(t),i.isDouble=t=>i.isNumber(t)&&(-1!==String(t).indexOf(".")||Math.abs(t)>=1e21),i.isEmptyObject=t=>i.isObject(t)&&0===Object.keys(t).length,i.isNumber=t=>"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t),i.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t),i.isObject=t=>"[object Object]"===Object.prototype.toString.call(t),i.isString=t=>"string"==typeof t||"[object String]"===Object.prototype.toString.call(t),i.isUndefined=t=>void 0===t},{}],31:[function(t,e,n){"use strict";const i=t("./types"),r={};e.exports=r,r.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=(t,e)=>{const n={},i=r.parsers[e||"full"],s=i.regex.exec(t);let o=i.keys.length;for(;o--;)n[i.keys[o]]=void 0===s[o]?null:s[o];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=(t,e)=>{if(null===t||r.isAbsolute(e))return e;(!t||i.isString(t))&&(t=r.parse(t||""));const n=r.parse(e),s={protocol:t.protocol||""};if(null!==n.authority)s.authority=n.authority,s.path=n.path,s.query=n.query;else if(s.authority=t.authority,""===n.path)s.path=t.path,s.query=null!==n.query?n.query:t.query;else{if(0===n.path.indexOf("/"))s.path=n.path;else{let e=t.path;e=e.substr(0,e.lastIndexOf("/")+1),(e.length>0||t.authority)&&"/"!==e.substr(-1)&&(e+="/"),e+=n.path,s.path=e}s.query=n.query}""!==n.path&&(s.path=r.removeDotSegments(s.path));let o=s.protocol;return null!==s.authority&&(o+="//"+s.authority),o+=s.path,null!==s.query&&(o+="?"+s.query),null!==n.fragment&&(o+="#"+n.fragment),""===o&&(o="./"),o},r.removeBase=(t,e)=>{if(null===t)return e;(!t||i.isString(t))&&(t=r.parse(t||""));let n="";if(""!==t.href?n+=(t.protocol||"")+"//"+(t.authority||""):e.indexOf("//")&&(n+="//"),0!==e.indexOf(n))return e;const s=r.parse(e.substr(n.length)),o=t.normalizedPath.split("/"),a=s.normalizedPath.split("/"),l=s.fragment||s.query?0:1;for(;o.length>0&&a.length>l&&o[0]===a[0];)o.shift(),a.shift();let c="";if(o.length>0){o.pop();for(let t=0;t{if(0===t.length)return"";const e=t.split("/"),n=[];for(;e.length>0;){const t=e.shift(),i=0===e.length;"."!==t?".."!==t?n.push(t):(n.pop(),i&&n.push("")):i&&n.push("")}return"/"===t[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const s=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=t=>i.isString(t)&&s.test(t),r.isRelative=t=>i.isString(t)},{"./types":30}],32:[function(t,e,n){"use strict";const i=t("./graphTypes"),r=t("./types"),s=t("rdf-canonize").IdentifierIssuer,o=t("./JsonLdError"),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u={accept:"application/ld+json, application/json"},h={};function d(t,e){if(r.isArray(e))for(let n=0;n{if(Object.keys(t).some(t=>"accept"===t.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+u.accept+'" is supported.');return Object.assign({Accept:u.accept},t)},h.parseLinkHeader=t=>{const e={},n=t.match(a);for(let i=0;i{if(!(r.isString(t)||r.isArray(t)&&t.every(t=>r.isString(t)))){if(e&&r.isObject(t))switch(Object.keys(t).length){case 0:return;case 1:if("@default"in t&&h.asArray(t["@default"]).every(t=>r.isString(t)))return}throw new o('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:t})}},h.hasProperty=(t,e)=>{if(t.hasOwnProperty(e)){const n=t[e];return!r.isArray(n)||n.length>0}return!1},h.hasValue=(t,e,n)=>{if(h.hasProperty(t,e)){let s=t[e];const o=i.isList(s);if(r.isArray(s)||o){o&&(s=s["@list"]);for(let t=0;t{if("propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1),"valueIsArray"in i||(i.valueIsArray=!1),"allowDuplicate"in i||(i.allowDuplicate=!0),"prependValue"in i||(i.prependValue=!1),i.valueIsArray)t[e]=n;else if(r.isArray(n)){0===n.length&&i.propertyIsArray&&!t.hasOwnProperty(e)&&(t[e]=[]),i.prependValue&&(n=n.concat(t[e]),t[e]=[]);for(let r=0;r[].concat(t[e]||[]),h.removeProperty=(t,e)=>{delete t[e]},h.removeValue=(t,e,n,i)=>{"propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1);const r=h.getValues(t,e).filter(t=>!h.compareValues(t,n));0===r.length?h.removeProperty(t,e):t[e]=1!==r.length||i.propertyIsArray?r:r[0]},h.relabelBlankNodes=(t,e)=>d((e=e||{}).issuer||new s("_:b"),t),h.compareValues=(t,e)=>!!(t===e||i.isValue(t)&&i.isValue(e)&&t["@value"]===e["@value"]&&t["@type"]===e["@type"]&&t["@language"]===e["@language"]&&t["@index"]===e["@index"])||!!(r.isObject(t)&&"@id"in t&&r.isObject(e)&&"@id"in e)&&t["@id"]===e["@id"],h.compareShortestLeast=(t,e)=>t.length1;const g=(t,e,n)=>{const i=t[d].get(e);if(i){const e=i.value;if(m(t,e)){if(y(t,i),!t[a])return}else n&&(t[p]&&(i.value.now=Date.now()),t[h].unshiftNode(i));return e.value}},m=(t,e)=>{if(!e||!e.maxAge&&!t[l])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[l]&&n>t[l]},b=t=>{if(t[s]>t[r])for(let e=t[h].tail;t[s]>t[r]&&null!==e;){const n=e.prev;y(t,e),e=n}},y=(t,e)=>{if(e){const n=e.value;t[c]&&t[c](n.key,n.value),t[s]-=n.length,t[d].delete(n.key),t[h].removeNode(e)}};class v{constructor(t,e,n,i,r){this.key=t,this.value=e,this.length=n,this.now=i,this.maxAge=r||0}}const _=(t,e,n,i)=>{let r=n.value;m(t,r)&&(y(t,n),t[a]||(r=void 0)),r&&e.call(i,r.value,r.key,t)};e.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[r]=t.max||1/0;const e=t.length||f;if(this[o]="function"!=typeof e?f:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[l]=t.maxAge||0,this[c]=t.dispose,this[u]=t.noDisposeOnSet||!1,this[p]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[r]=t||1/0,b(this)}get max(){return this[r]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[l]=t,b(this)}get maxAge(){return this[l]}set lengthCalculator(t){"function"!=typeof t&&(t=f),t!==this[o]&&(this[o]=t,this[s]=0,this[h].forEach(t=>{t.length=this[o](t.value,t.key),this[s]+=t.length})),b(this)}get lengthCalculator(){return this[o]}get length(){return this[s]}get itemCount(){return this[h].length}rforEach(t,e){e=e||this;for(let n=this[h].tail;null!==n;){const i=n.prev;_(this,t,n,e),n=i}}forEach(t,e){e=e||this;for(let n=this[h].head;null!==n;){const i=n.next;_(this,t,n,e),n=i}}keys(){return this[h].toArray().map(t=>t.key)}values(){return this[h].toArray().map(t=>t.value)}reset(){this[c]&&this[h]&&this[h].length&&this[h].forEach(t=>this[c](t.key,t.value)),this[d]=new Map,this[h]=new i,this[s]=0}dump(){return this[h].map(t=>!m(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[h]}set(t,e,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const i=n?Date.now():0,a=this[o](e,t);if(this[d].has(t)){if(a>this[r])return y(this,this[d].get(t)),!1;const o=this[d].get(t).value;return this[c]&&(this[u]||this[c](t,o.value)),o.now=i,o.maxAge=n,o.value=e,this[s]+=a-o.length,o.length=a,this.get(t),b(this),!0}const p=new v(t,e,a,i,n);return p.length>this[r]?(this[c]&&this[c](t,e),!1):(this[s]+=p.length,this[h].unshift(p),this[d].set(t,this[h].head),b(this),!0)}has(t){if(!this[d].has(t))return!1;const e=this[d].get(t).value;return!m(this,e)}get(t){return g(this,t,!0)}peek(t){return g(this,t,!1)}pop(){const t=this[h].tail;return t?(y(this,t),t.value):null}del(t){y(this,this[d].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const t=r-e;t>0&&this.set(i.k,i.v,t)}}}prune(){this[d].forEach((t,e)=>g(this,e,!1))}}},{yallist:92}],34:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#",s="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:`${r}decimal`,boolean:`${r}boolean`,double:`${r}double`,integer:`${r}integer`,string:`${r}string`},rdf:{type:`${i}type`,nil:`${i}nil`,first:`${i}first`,rest:`${i}rest`,langString:`${i}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`}}},{}],35:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function t(e,n){if(n=n||d,!e)return n.defaultGraph();switch(e[0]){case"?":return n.variable(e.substr(1));case"_":return n.blankNode(e.substr(2));case'"':if(n===d)return new g(e);if('"'===e[e.length-1])return n.literal(e.substr(1,e.length-2));const i=e.lastIndexOf('"',e.length-1);return n.literal(e.substr(1,i-1),"@"===e[i+1]?e.substr(i+2):n.namedNode(e.substr(i+3)));case"<":const r=h.exec(e);return n.quad(t(w(r[1]),n),t(w(r[2]),n),t(w(r[3]),n),r[4]&&t(w(r[4]),n));default:return n.namedNode(e)}},n.termToId=function t(e){if("string"==typeof e)return e;if(e instanceof p&&"Quad"!==e.termType)return e.id;if(!e)return l.id;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==a.string?`^^${e.datatype.value}`:""}`;case"Quad":return`<<${_(t(e.subject))} ${_(t(e.predicate))} ${_(t(e.object))}${(0,s.isDefaultGraph)(e.graph)?"":` ${t(e.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${e.termType}`)}},n.escapeQuotes=_,n.unescapeQuotes=w,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var i,r=(i=t("./IRIs"))&&i.__esModule?i:{default:i},s=t("./N3Util");const{rdf:o,xsd:a}=r.default;let l,c=0;const u=/^"(.*".*)(?="[^"]*$)/,h=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,d={namedNode:function(t){return new f(t)},blankNode:function(t){return new m(t||"n3-"+c++)},variable:function(t){return new b(t)},literal:function(t,e){if("string"==typeof e)return new g(`"${t}"@${e.toLowerCase()}`);let n=e?e.value:"";return""===n&&("boolean"==typeof t?n=a.boolean:"number"==typeof t&&(Number.isFinite(t)?n=Number.isInteger(t)?a.integer:a.double:(n=a.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),new g(""===n||n===a.string?`"${t}"`:`"${t}"^^${n}`)},defaultGraph:function(){return l},quad:x,triple:x};n.default=d;class p{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof p?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}toJSON(){return{termType:this.termType,value:this.value}}}n.Term=p;class f extends p{get termType(){return"NamedNode"}}n.NamedNode=f;class g extends p{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e`"${e.replace(/"/g,'""')}`)}function w(t){return t.replace(u,(t,e)=>`"${e.replace(/""/g,'"')}`)}function x(t,e,n,i){return new v(t,e,n,i)}n.Triple=n.Quad=v},{"./IRIs":34,"./N3Util":41}],36:[function(t,e,n){(function(e){(function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=s(t("./IRIs")),r=s(t("queue-microtask"));function s(t){return t&&t.__esModule?t:{default:t}}const{xsd:o}=i.default,a=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,l={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},c=/[\x00-\x20<>\\"\{\}\|\^\`]/,u={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},h=/$0^/;n.default=class{constructor(t){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]*)?$/,this._lineMode=!!(t=t||{}).lineMode){this._n3Mode=!1;for(const t in this)!(t in u)&&this[t]instanceof RegExp&&(this[t]=h)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let n=this._input;const i=this._comments;for(;;){let s,a;for(;s=this._newline.exec(n);)i&&(a=this._comment.exec(s[0]))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),n=n.substr(s[0].length,n.length),this._line++;if(!s&&(s=this._whitespace.exec(n))&&(n=n.substr(s[0].length,n.length)),this._endOfFile.test(n))return e&&(i&&(a=this._comment.exec(n))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),t(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;const l=this._line,u=n[0];let h="",d="",p="",f=null,g=0,m=!1;switch(u){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(g=1,h="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){m=!0;break}case"<":if(f=this._unescapedIri.exec(n))h="IRI",d=f[1];else if(f=this._iri.exec(n)){if(d=this._unescape(f[1]),null===d||c.test(d))return r(this);h="IRI"}else n.length>1&&"<"===n[1]?(h="<<",g=2):this._n3Mode&&n.length>1&&"="===n[1]&&(h="inverse",g=2,d=">");break;case">":n.length>1&&">"===n[1]&&(h=">>",g=2);break;case"_":((f=this._blank.exec(n))||e&&(f=this._blank.exec(`${n} `)))&&(h="blank",p="_",d=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(n))d=f[1];else if(({value:d,matchLength:g}=this._parseLiteral(n)),null===d)return r(this);(null!==f||0!==g)&&(h="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(n))d=f[1];else if(({value:d,matchLength:g}=this._parseLiteral(n)),null===d)return r(this);(null!==f||0!==g)&&(h="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(n))&&(h="var",d=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(n))?(h="langcode",d=f[1]):(f=this._keyword.exec(n))&&(h=f[0]);break;case".":if(1===n.length?e:n[1]<"0"||n[1]>"9"){h=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(n)||e&&(f=this._number.exec(`${n} `)))&&(h="literal",d=f[0],p="string"==typeof f[1]?o.double:"string"==typeof f[2]?o.decimal:o.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(n))?h=f[0].toUpperCase():m=!0;break;case"f":case"t":(f=this._boolean.exec(n))?(h="literal",d=f[0],p=o.boolean):m=!0;break;case"a":(f=this._shortPredicates.exec(n))?(h="abbreviation",d="a"):m=!0;break;case"=":this._n3Mode&&n.length>1&&(h="abbreviation",">"!==n[1]?(g=1,d="="):(g=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(g=1,h=u);break;default:m=!0}if(m&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(n))?((f=this._prefixed.exec(n))||e&&(f=this._prefixed.exec(`${n} `)))&&(h="prefixed",p=f[1]||"",d=this._unescape(f[2])):(h="prefix",d=f[1]||"")),"^^"===this._previousMarker)switch(h){case"prefixed":h="type";break;case"IRI":h="typeIRI";break;default:h=""}if(!h)return e||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?r(this):this._input=n;const b={line:l,type:h,value:d,prefix:p};t(null,b),this.previousToken=b,this._previousMarker=h,n=n.substr(g||f[0].length,n.length)}function r(e){t(e._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(t){let e=!1;const n=t.replace(a,(t,n,i,r)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof i){let t=Number.parseInt(i,16);return t<=65535?String.fromCharCode(Number.parseInt(i,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return r in l?l[r]:(e=!0,"")});return e?null:n}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],n=e.length;let i=Math.max(this._literalClosingPos,n);for(;(i=t.indexOf(e,i))>0;){let e=0;for(;"\\"===t[i-e-1];)e++;if(e%2==0){const e=t.substring(n,i),r=e.split(/\r\n|\r|\n/).length-1,s=i+n;if(1===n&&0!==r||3===n&&this._lineMode)break;return this._line+=r,{value:this._unescape(e),matchLength:s}}i++}this._literalClosingPos=t.length-n+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,n){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof n){const t=[];let e;if(this._tokenizeToEnd((n,i)=>n?e=n:t.push(i),!0),e)throw e;return t}(0,r.default)(()=>this._tokenizeToEnd(n,!0))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=e.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(n,!1)))}),t.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(n,!0)}),t.on("error",n)}}}).call(this)}).call(this,t("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(t("./N3Lexer")),r=o(t("./N3DataFactory")),s=o(t("./IRIs"));function o(t){return t&&t.__esModule?t:{default:t}}let a=0;class l{constructor(t){this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&u(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(e),r=/trig/.test(e),s=/triple/.test(e),o=/quad/.test(e),a=this._n3Mode=/n3/.test(e),l=s||o;(this._supportsNamedGraphs=!(n||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||s||a),this._supportsRDFStar=""===e||/star|\*$/.test(e),l&&(this._resolveRelativeIRI=t=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new i.default({lineMode:l,n3:a}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){a=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,n,i,r){const s=this._n3Mode;this._contextStack.push({subject:n,predicate:i,object:r,graph:e,type:t,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const t=this._contextStack.pop(),e=this._n3Mode;this._subject=t.subject,this._predicate=t.predicate,this._object=t.object,this._graph=t.graph,e&&(this._inversePredicate=t.inverse,this._prefixes._=t.blankPrefix,this._quantified=t.quantified)}_readInTopContext(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let n;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);n=this._namedNode(e);break;case"type":case"prefixed":const i=this._prefixes[t.prefix];if(void 0===i)return this._error(`Undefined prefix "${t.prefix}:"`,t);n=this._namedNode(i+t.value);break;case"blank":n=this._blankNode(this._prefixes[t.prefix]+t.value);break;case"var":n=this._variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(t){switch(this._predicate=null,t.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._literal(t.value,this._namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._literal(t.value,this._namedNode(t.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext(),null===this._object?e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,n=null,i=this._readListItem;const r=this._subject,s=this._contextStack,o=s[s.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=e=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==s.length&&"list"===s[s.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":0===t.prefix.length?(this._literalValue=t.value,i=this._readListItemDataTypeOrLang):(e=this._literal(t.value,this._namedNode(t.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===n&&(this._subject=n=this._blankNode()),null===r?null===o.predicate?o.subject=n:o.object=n:this._emit(r,this.RDF_REST,n,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,e,this._graph)}return i}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const n=this._readEntity(t);if(void 0===n)return;e=this._literal(this._literalValue,n),t=null;break;case"langcode":e=this._literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const n=this._completeLiteral(t);if(n)return this._object=n.literal,e&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,n=this._graph;const i=this._subject,r=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,r&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==i){const t=this._predicate,e=this._object;r?this._emit(e,t,i,n):this._emit(i,t,e,n)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,n=e.length&&e[e.length-1];if(n&&"item"===n.type){const t=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,n;const i=this._blankNode();if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=i):(e=this._object,this._object=i),this._emit(e,n,i,this._graph),this._readPath}_readBackwardPath(t){const e=this._blankNode();let n,i;if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(i=this._subject,this._subject=e):(i=this._object,this._object=e),this._emit(e,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,n,i){this._callback(null,this._quad(t,e,n,i||this.DEFAULTGRAPH))}_error(t,e){const n=new Error(`${t} on line ${e.line}.`);n.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let n="",i=-1,r=-1,s=0,o="/";for(;i=r&&(n=n.substr(0,s)),"/"!==o)return`${n}/${t.substr(i+1)}`;s=i+1}}}o=t[++i]}return n+t.substring(s)}parse(t,e,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${a++}_`,this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!e){const e=[];let n;if(this._callback=(t,i)=>{t?n=t:i&&e.push(i)},this._lexer.tokenize(t).every(t=>this._readCallback=this._readCallback(t)),n)throw n;return e}this._callback=e,this._lexer.tokenize(t,(t,e)=>{null!==t?(this._callback(t),this._callback=c):this._readCallback&&(this._readCallback=this._readCallback(e))})}}function c(){}function u(t,e){const n=e.namedNode;t._namedNode=n,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=n(s.default.rdf.first),t.RDF_REST=n(s.default.rdf.rest),t.RDF_NIL=n(s.default.rdf.nil),t.N3_FORALL=n(s.default.r.forAll),t.N3_FORSOME=n(s.default.r.forSome),t.ABBREVIATIONS={a:n(s.default.rdf.type),"=":n(s.default.owl.sameAs),">":n(s.default.log.implies)},t.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=l,u(l.prototype,r.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}(t("./N3DataFactory")),s=t("readable-stream"),o=(i=t("./IRIs"))&&i.__esModule?i:{default:i};function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}class l{constructor(t,e){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,!e&&t&&!t[0]&&(e=t,t=null),this._factory=(e=e||{}).factory||r.default,t&&this.addQuads(t)}get size(){let t=this._size;if(null!==t)return t;t=0;const e=this._graphs;let n,i;for(const r in e)for(const s in n=e[r].subjects)for(const e in i=n[s])t+=Object.keys(i[e]).length;return this._size=t}_addToIndex(t,e,n,i){const r=t[e]||(t[e]={}),s=r[n]||(r[n]={}),o=i in s;return o||(s[i]=null),!o}_removeFromIndex(t,e,n,i){const r=t[e],s=r[n];delete s[i];for(const o in s)return;delete r[n];for(const o in r)return;delete t[e]}_findInIndex(t,e,n,i,s,o,a,l,c,u){let h,d,p;const f=!e+!n+!i>1?Object.keys(this._ids):this._entities;e&&((h=t,t={})[e]=h[e]);for(const g in t){const e=f[g];if(d=t[g]){n&&((h=d,d={})[n]=h[n]);for(const t in d){const n=f[t];if(p=d[t]){const t=i?i in p?[i]:[]:Object.keys(p);for(let i=0;i{n in e||(e[n]=!0,t((0,r.termFromId)(this._entities[n],this._factory)))}}add(t){return this.addQuad(t),this}addQuad(t,e,n,i){e||(i=t.graph,n=t.object,e=t.predicate,t=t.subject),t=(0,r.termToId)(t),e=(0,r.termToId)(e),n=(0,r.termToId)(n),i=(0,r.termToId)(i);let s=this._graphs[i];s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s));const o=this._ids,a=this._entities;t=o[t]||(o[a[++this._id]=t]=this._id),e=o[e]||(o[a[++this._id]=e]=this._id),n=o[n]||(o[a[++this._id]=n]=this._id);const l=this._addToIndex(s.subjects,t,e,n);return this._addToIndex(s.predicates,e,n,t),this._addToIndex(s.objects,n,t,e),this._size=null,l}addQuads(t){for(let e=0;e{this.addQuad(t)}),t}removeQuad(t,e,n,i){e||(i=t.graph,n=t.object,e=t.predicate,t=t.subject),t=(0,r.termToId)(t),e=(0,r.termToId)(e),n=(0,r.termToId)(n),i=(0,r.termToId)(i);const s=this._ids,o=this._graphs;let a,l,c;if(!((t=s[t])&&(e=s[e])&&(n=s[n])&&(a=o[i])&&(l=a.subjects[t])&&(c=l[e])&&n in c))return!1;for(t in this._removeFromIndex(a.subjects,t,e,n),this._removeFromIndex(a.predicates,e,n,t),this._removeFromIndex(a.objects,n,t,e),null!==this._size&&this._size--,a.subjects)return!0;return delete o[i],!0}removeQuads(t){for(let e=0;e{this.removeQuad(t)}),t}removeMatches(t,e,n,i){const r=new s.Readable({objectMode:!0});return r._read=()=>{for(const s of this.getQuads(t,e,n,i))r.push(s);r.push(null)},this.remove(r)}deleteGraph(t){return this.removeMatches(null,null,null,t)}getQuads(t,e,n,i){t=t&&(0,r.termToId)(t),e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=[],o=this._getGraphs(i),a=this._ids;let l,u,h,d;if(c(t)&&!(u=a[t])||c(e)&&!(h=a[e])||c(n)&&!(d=a[n]))return s;for(const r in o)(l=o[r])&&(u?d?this._findInIndex(l.objects,d,u,h,"object","subject","predicate",r,null,s):this._findInIndex(l.subjects,u,h,null,"subject","predicate","object",r,null,s):h?this._findInIndex(l.predicates,h,d,null,"predicate","object","subject",r,null,s):d?this._findInIndex(l.objects,d,null,null,"object","subject","predicate",r,null,s):this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",r,null,s));return s}match(t,e,n,i){return new u(this,t,e,n,i)}countQuads(t,e,n,i){t=t&&(0,r.termToId)(t),e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._getGraphs(i),o=this._ids;let a,l,u,h,d=0;if(c(t)&&!(l=o[t])||c(e)&&!(u=o[e])||c(n)&&!(h=o[n]))return 0;for(const r in s)(a=s[r])&&(d+=t?n?this._countInIndex(a.objects,h,l,u):this._countInIndex(a.subjects,l,u,h):e?this._countInIndex(a.predicates,u,h,l):this._countInIndex(a.objects,h,l,u));return d}forEach(t,e,n,i,r){this.some(e=>(t(e),!1),e,n,i,r)}every(t,e,n,i,r){let s=!1;const o=!this.some(e=>(s=!0,!t(e)),e,n,i,r);return s&&o}some(t,e,n,i,s){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i),s=s&&(0,r.termToId)(s);const o=this._getGraphs(s),a=this._ids;let l,u,h,d;if(c(e)&&!(u=a[e])||c(n)&&!(h=a[n])||c(i)&&!(d=a[i]))return!1;for(const r in o)if(l=o[r])if(u){if(d){if(this._findInIndex(l.objects,d,u,h,"object","subject","predicate",r,t,null))return!0}else if(this._findInIndex(l.subjects,u,h,null,"subject","predicate","object",r,t,null))return!0}else if(h){if(this._findInIndex(l.predicates,h,d,null,"predicate","object","subject",r,t,null))return!0}else if(d){if(this._findInIndex(l.objects,d,null,null,"object","subject","predicate",r,t,null))return!0}else if(this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",r,t,null))return!0;return!1}getSubjects(t,e,n){const i=[];return this.forSubjects(t=>{i.push(t)},t,e,n),i}forSubjects(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.predicates,l,u,t):this._loopByKey1(a.subjects,l,t):u?this._loopByKey0(a.objects,u,t):this._loop(a.subjects,t))}getPredicates(t,e,n){const i=[];return this.forPredicates(t=>{i.push(t)},t,e,n),i}forPredicates(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.objects,u,l,t):this._loopByKey0(a.subjects,l,t):u?this._loopByKey1(a.predicates,u,t):this._loop(a.predicates,t))}getObjects(t,e,n){const i=[];return this.forObjects(t=>{i.push(t)},t,e,n),i}forObjects(t,e,n,i){e=e&&(0,r.termToId)(e),n=n&&(0,r.termToId)(n),i=i&&(0,r.termToId)(i);const s=this._ids,o=this._getGraphs(i);let a,l,u;if(t=this._uniqueEntities(t),!(c(e)&&!(l=s[e])||c(n)&&!(u=s[n])))for(i in o)(a=o[i])&&(l?u?this._loopBy2Keys(a.subjects,l,u,t):this._loopByKey1(a.objects,l,t):u?this._loopByKey0(a.predicates,u,t):this._loop(a.objects,t))}getGraphs(t,e,n){const i=[];return this.forGraphs(t=>{i.push(t)},t,e,n),i}forGraphs(t,e,n,i){for(const r in this._graphs)this.some(e=>(t(e.graph),!0),e,n,i,r)}createBlankNode(t){let e,n;if(t)for(e=t=`_:${t}`,n=1;this._ids[e];)e=t+n++;else do{e="_:b"+this._blankNodeIndex++}while(this._ids[e]);return this._ids[e]=++this._id,this._entities[this._id]=e,this._factory.blankNode(e.substr(2))}extractLists({remove:t=!1,ignoreErrors:e=!1}={}){const n={},i=e?()=>!0:(t,e)=>{throw new Error(`${t.value} ${e}`)},r=this.getQuads(null,o.default.rdf.rest,o.default.rdf.nil,null),s=t?[...r]:[];return r.forEach(e=>{const r=[];let a,l,c=!1;const u=e.graph;let h=e.subject;for(;h&&!c;){const t=this.getQuads(null,null,h,null),e=this.getQuads(h,null,null,null);let n,d=null,p=null,f=null;for(let r=0;r{switch(t){case"data":e=i;break;case"end":n=i}}},(t,e)=>{t&&this.emit("error",t)||e&&this.push(e)},(t,e)=>{this.emit("prefix",t,e)}),this._transform=(t,n,i)=>{e(t),i()},this._flush=t=>{n(),t()}}import(t){return t.on("data",t=>{this.write(t)}),t.on("end",()=>{this.end()}),t.on("error",t=>{this.emit("error",t)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=t("readable-stream"),s=(i=t("./N3Writer"))&&i.__esModule?i:{default:i};n.default=class extends r.Transform{constructor(t){super({encoding:"utf8",writableObjectMode:!0});const e=this._writer=new s.default({write:(t,e,n)=>{this.push(t),n&&n()},end:t=>{this.push(null),t&&t()}},t);this._transform=(t,n,i)=>{e.addQuad(t,i)},this._flush=t=>{e.end(t)}}import(t){return t.on("data",t=>{this.write(t)}),t.on("end",()=>{this.end()}),t.on("error",t=>{this.emit("error",t)}),t.on("prefix",(t,e)=>{this._writer.addPrefix(t,e)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isNamedNode=function(t){return!!t&&"NamedNode"===t.termType},n.isBlankNode=function(t){return!!t&&"BlankNode"===t.termType},n.isLiteral=function(t){return!!t&&"Literal"===t.termType},n.isVariable=function(t){return!!t&&"Variable"===t.termType},n.isDefaultGraph=s,n.inDefaultGraph=function(t){return s(t.graph)},n.prefix=function(t,e){return o({"":t},e)("")},n.prefixes=o;var i,r=(i=t("./N3DataFactory"))&&i.__esModule?i:{default:i};function s(t){return!!t&&"DefaultGraph"===t.termType}function o(t,e){const n=Object.create(null);for(const r in t)i(r,t[r]);function i(t,i){if("string"==typeof i){const r=Object.create(null);n[t]=t=>r[t]||(r[t]=e.namedNode(i+t))}else if(!(t in n))throw new Error(`Unknown prefix: ${t}`);return n[t]}return e=e||r.default,i}},{"./N3DataFactory":35}],42:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,r=(i=t("./IRIs"))&&i.__esModule?i:{default:i},s=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}(t("./N3DataFactory")),o=t("./N3Util");function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}const l=s.default.defaultGraph(),{rdf:c,xsd:u}=r.default,h=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,d=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,p={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class f extends s.Term{equals(){return!1}}function g(t){let e=p[t];return void 0===e&&(1===t.length?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}n.default=class{constructor(t,e){if(this._prefixRegex=/$0^/,t&&"function"!=typeof t.write&&(e=t,t=null),this._lists=(e=e||{}).lists,t)this._outputStream=t,this._endStream=void 0===e.end||!!e.end;else{let t="";this._outputStream={write(e,n,i){t+=e,i&&i()},end:e=>{e&&e(null,t)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(e.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=l,this._baseIRI=e.baseIRI,this._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes))}get _inDefaultGraph(){return l.equals(this._graph)}_write(t,e){this._outputStream.write(t,"utf8",e)}_writeQuad(t,e,n,i,r){try{i.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(l.equals(i)?"":`${this._encodeIriOrBlank(i)} {\n`)),this._graph=i,this._subject=null),t.equals(this._subject)?e.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,r):this._write(`;\n ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=t)} ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r)}catch(s){r&&r(s)}}_writeQuadLine(t,e,n,i,r){delete this._prefixMatch,this._write(this.quadToString(t,e,n,i),r)}quadToString(t,e,n,i){return`${this._encodeSubject(t)} ${this._encodeIriOrBlank(e)} ${this._encodeObject(n)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .\n`:" .\n"}`}quadsToString(t){return t.map(t=>this.quadToString(t.subject,t.predicate,t.object,t.graph)).join("")}_encodeSubject(t){return"Quad"===t.termType?this._encodeQuad(t):this._encodeIriOrBlank(t)}_encodeIriOrBlank(t){if("NamedNode"!==t.termType)return this._lists&&t.value in this._lists&&(t=this.list(this._lists[t.value])),"id"in t?t.id:`_:${t.value}`;let e=t.value;this._baseIRI&&e.startsWith(this._baseIRI)&&(e=e.substr(this._baseIRI.length)),h.test(e)&&(e=e.replace(d,g));const n=this._prefixRegex.exec(e);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:e:`<${e}>`}_encodeLiteral(t){let e=t.value;if(h.test(e)&&(e=e.replace(d,g)),t.language)return`"${e}"@${t.language}`;if(this._lineMode){if(t.datatype.value===u.string)return`"${e}"`}else switch(t.datatype.value){case u.string:return`"${e}"`;case u.boolean:if("true"===e||"false"===e)return e;break;case u.integer:if(/^[+-]?\d+$/.test(e))return e;break;case u.decimal:if(/^[+-]?\d*\.\d+$/.test(e))return e;break;case u.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(e))return e}return`"${e}"^^${this._encodeIriOrBlank(t.datatype)}`}_encodePredicate(t){return t.value===c.type?"a":this._encodeIriOrBlank(t)}_encodeObject(t){switch(t.termType){case"Quad":return this._encodeQuad(t);case"Literal":return this._encodeLiteral(t);default:return this._encodeIriOrBlank(t)}}_encodeQuad({subject:t,predicate:e,object:n,graph:i}){return`<<${this._encodeSubject(t)} ${this._encodePredicate(e)} ${this._encodeObject(n)}${(0,o.isDefaultGraph)(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(t,e,n,i,r){void 0===n?this._writeQuad(t.subject,t.predicate,t.object,t.graph,e):"function"==typeof i?this._writeQuad(t,e,n,l,i):this._writeQuad(t,e,n,i||l,r)}addQuads(t){for(let e=0;e.\n`)}if(n){let t="",e="";for(const n in this._prefixIRIs)t+=t?`|${n}`:n,e+=(e?"|":"")+this._prefixIRIs[n];t=t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${e})[^/]*$|^(${t})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",e)}blank(t,e){let n,i,r=t;switch(void 0===t?r=[]:t.termType?r=[{predicate:t,object:e}]:"length"in t||(r=[t]),i=r.length){case 0:return new f("[]");case 1:if(n=r[0],!(n.object instanceof f))return new f(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let e="[";for(let s=0;s{e=null,t(n,i)});if(this._endStream)try{return this._outputStream.end(e)}catch(n){}e&&e()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"Writer",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"Store",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"StreamParser",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"StreamWriter",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"DataFactory",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"Term",{enumerable:!0,get:function(){return u.Term}}),Object.defineProperty(n,"NamedNode",{enumerable:!0,get:function(){return u.NamedNode}}),Object.defineProperty(n,"Literal",{enumerable:!0,get:function(){return u.Literal}}),Object.defineProperty(n,"BlankNode",{enumerable:!0,get:function(){return u.BlankNode}}),Object.defineProperty(n,"Variable",{enumerable:!0,get:function(){return u.Variable}}),Object.defineProperty(n,"DefaultGraph",{enumerable:!0,get:function(){return u.DefaultGraph}}),Object.defineProperty(n,"Quad",{enumerable:!0,get:function(){return u.Quad}}),Object.defineProperty(n,"Triple",{enumerable:!0,get:function(){return u.Triple}}),Object.defineProperty(n,"termFromId",{enumerable:!0,get:function(){return u.termFromId}}),Object.defineProperty(n,"termToId",{enumerable:!0,get:function(){return u.termToId}}),n.Util=void 0;var i=p(t("./N3Lexer")),r=p(t("./N3Parser")),s=p(t("./N3Writer")),o=p(t("./N3Store")),a=p(t("./N3StreamParser")),l=p(t("./N3StreamWriter")),c=d(t("./N3Util"));n.Util=c;var u=d(t("./N3DataFactory"));function h(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(h=function(t){return t?n:e})(t)}function d(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=h(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,n&&n.set(t,i),i}function p(t){return t&&t.__esModule?t:{default:t}}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(t,e,n){var i,r,s=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(n){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(t){i=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],h=!1,d=-1;function p(){!h||!c||(h=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!h){var t=l(p);h=!0;for(var e=u.length;e;){for(c=u,u=[];++d1)for(var n=1;n(n||(n=Promise.resolve())).then(t).catch(t=>setTimeout(()=>{throw t},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(t,e,n){e.exports=t("./lib")},{"./lib":55}],47:[function(t,e,n){"use strict";e.exports=class t{constructor(t,e=new Map,n=0){this.prefix=t,this._existing=e,this.counter=n}clone(){const{prefix:e,_existing:n,counter:i}=this;return new t(e,new Map(n),i)}getId(t){const e=t&&this._existing.get(t);if(e)return e;const n=this.prefix+this.counter;return this.counter++,t&&this._existing.set(t,n),n}hasId(t){return this._existing.has(t)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(t,e,n){"use strict";t("setimmediate");const r=self.crypto||self.msCrypto;e.exports=class{constructor(t){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error(`Unsupport algorithm "${t}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(t){this._content+=t}digest(){var t=this;return i(function*(){const e=(new TextEncoder).encode(t._content),n=new Uint8Array(yield r.subtle.digest(t.algorithm,e));let i="";for(let t=0;t]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[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_0-9])(?:(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[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_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class t{static parse(t){const e=[],n={},h=t.split(c.eoln);let p=0;for(const f of h){if(p++,c.empty.test(f))continue;const t=f.match(c.quad);if(null===t)throw new Error("N-Quads parse error on line "+p+".");const h={subject:null,predicate:null,object:null,graph:null};if(h.subject=void 0!==t[1]?{termType:s,value:t[1]}:{termType:o,value:t[2]},h.predicate={termType:s,value:t[3]},void 0!==t[4]?h.object={termType:s,value:t[4]}:void 0!==t[5]?h.object={termType:o,value:t[5]}:(h.object={termType:a,value:void 0,datatype:{termType:s}},void 0!==t[7]?h.object.datatype.value=t[7]:void 0!==t[8]?(h.object.datatype.value=i,h.object.language=t[8]):h.object.datatype.value=r,h.object.value=t[6].replace(d,function(t,e,n,i){if(e)switch(e){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(i)throw new Error("Unsupported U escape")})),h.graph=void 0!==t[9]?{termType:s,value:t[9]}:void 0!==t[10]?{termType:o,value:t[10]}:{termType:l,value:""},h.graph.value in n){let t=!0;const i=n[h.graph.value];for(const e of i)if(u(e,h)){t=!1;break}t&&(i.push(h),e.push(h))}else n[h.graph.value]=[h],e.push(h)}return e}static serialize(e){Array.isArray(e)||(e=t.legacyDatasetToQuads(e));const n=[];for(const i of e)n.push(t.serializeQuad(i));return n.sort().join("")}static serializeQuad(t){const e=t.subject,n=t.object,a=t.graph;let l="";return l+=e.termType===s?`<${e.value}>`:`${e.value}`,l+=` <${t.predicate.value}> `,n.termType===s?l+=`<${n.value}>`:n.termType===o?l+=n.value:(l+=`"${c=n.value,c.replace(h,function(t){switch(t){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,n.datatype.value===i?n.language&&(l+=`@${n.language}`):n.datatype.value!==r&&(l+=`^^<${n.datatype.value}>`)),a.termType===s?l+=` <${a.value}>`:a.termType===o&&(l+=` ${a.value}`),l+=" .\n",l;var c}static legacyDatasetToQuads(t){const e=[],n={"blank node":o,IRI:s,literal:a};for(const c in t)t[c].forEach(t=>{const u={};for(const e in t){const o=t[e],l={termType:n[o.type],value:o.value};l.termType===a&&(l.datatype={termType:s},"datatype"in o&&(l.datatype.value=o.datatype),"language"in o?("datatype"in o||(l.datatype.value=i),l.language=o.language):"datatype"in o||(l.datatype.value=r)),u[e]=l}u.graph="@default"===c?{termType:l,value:""}:{termType:c.startsWith("_:")?o:s,value:c},e.push(u)});return e}};const h=/["\\\n\r]/g;const d=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(t,e,n){"use strict";e.exports=class{constructor(t){this.current=t.sort(),this.done=!1,this.dir=new Map;for(let e=0;ei)&&(a&&o>0&&n>t[o-1]||!a&&ot[o+1])&&(i=n,r=o)}if(null===i)this.done=!0;else{const n=e.get(i)?r-1:r+1;t[r]=t[n],t[n]=i;for(const r of t)r>i&&e.set(r,!e.get(r))}return n}}},{}],51:[function(t,e,n){(function(n){(function(){"use strict";const r=t("./IdentifierIssuer"),s=t("./MessageDigest"),o=t("./Permuter"),a=t("./NQuads");function l(t,e){return t.hashe.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){var e=this;return i(function*(){e.quads=t;for(const r of t)e._addBlankNodeQuadInfo({quad:r,component:r.subject}),e._addBlankNodeQuadInfo({quad:r,component:r.object}),e._addBlankNodeQuadInfo({quad:r,component:r.graph});const n=new Map,i=[...e.blankNodeInfo.keys()];let s=0;for(const t of i)++s%100==0&&(yield e._yield()),yield e._hashAndTrackBlankNode({id:t,hashToBlankNodes:n});const o=[...n.keys()].sort(),c=[];for(const t of o){const i=n.get(t);i.length>1?c.push(i):e.canonicalIssuer.getId(i[0])}for(const t of c){const n=[];for(const i of t){if(e.canonicalIssuer.hasId(i))continue;const t=new r("_:b");t.getId(i);const s=yield e.hashNDegreeQuads(i,t);n.push(s)}n.sort(l);for(const t of n){const n=t.issuer.getOldIds();for(const t of n)e.canonicalIssuer.getId(t)}}const u=[];for(const t of e.quads){const n=bt({},t);n.subject=e._useCanonicalId({component:n.subject}),n.object=e._useCanonicalId({component:n.object}),n.graph=e._useCanonicalId({component:n.graph}),u.push(a.serializeQuad(n))}return u.sort(),u.join("")})()}hashFirstDegreeQuads(t){var e=this;return i(function*(){const n=[],i=e.blankNodeInfo.get(t),r=i.quads;for(const s of r){const i={subject:null,predicate:s.predicate,object:null,graph:null};i.subject=e.modifyFirstDegreeComponent(t,s.subject,"subject"),i.object=e.modifyFirstDegreeComponent(t,s.object,"object"),i.graph=e.modifyFirstDegreeComponent(t,s.graph,"graph"),n.push(a.serializeQuad(i))}n.sort();const o=new s(e.hashAlgorithm);for(const t of n)o.update(t);return i.hash=yield o.digest(),i.hash})()}hashRelatedBlankNode(t,e,n,r){var o=this;return i(function*(){let i;i=o.canonicalIssuer.hasId(t)?o.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):o.blankNodeInfo.get(t).hash;const a=new s(o.hashAlgorithm);return a.update(r),"g"!==r&&a.update(o.getRelatedPredicate(e)),a.update(i),a.digest()})()}hashNDegreeQuads(t,e){var n=this;return i(function*(){const i=new s(n.hashAlgorithm),r=yield n.createHashToRelated(t,e),a=[...r.keys()].sort();for(const t of a){i.update(t);let s,a="";const l=new o(r.get(t));let c=0;for(;l.hasNext();){const t=l.next();++c%3==0&&(yield n._yield());let i=e.clone(),r="";const o=[];let u=!1;for(const e of t)if(n.canonicalIssuer.hasId(e)?r+=n.canonicalIssuer.getId(e):(i.hasId(e)||o.push(e),r+=i.getId(e)),0!==a.length&&r>a){u=!0;break}if(!u){for(const t of o){const e=yield n.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==a.length&&r>a){u=!0;break}}u||(0===a.length||r`}createHashToRelated(t,e){var n=this;return i(function*(){const i=new Map,r=n.blankNodeInfo.get(t).quads;let s=0;for(const o of r)++s%100==0&&(yield n._yield()),yield Promise.all([n._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:t,issuer:e,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:t,issuer:e,hashToRelated:i}),n._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:t,issuer:e,hashToRelated:i})]);return i})()}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){var n=this;return i(function*(){const i=yield n.hashFirstDegreeQuads(t),r=e.get(i);r?r.push(t):e.set(i,[t])})()}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:n,id:r,issuer:s,hashToRelated:o}){var a=this;return i(function*(){if("BlankNode"!==e.termType||e.value===r)return;const i=e.value,l=yield a.hashRelatedBlankNode(i,t,s,n),c=o.get(l);c?c.push(i):o.set(l,[i])})()}_useCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}_yield(){return i(function*(){return new Promise(t=>n(t))})()}}}).call(this)}).call(this,t("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(t,e,n){"use strict";const i=t("./IdentifierIssuer"),r=t("./MessageDigest"),s=t("./Permuter"),o=t("./NQuads");function a(t,e){return t.hashe.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){this.quads=t;for(const i of t)this._addBlankNodeQuadInfo({quad:i,component:i.subject}),this._addBlankNodeQuadInfo({quad:i,component:i.object}),this._addBlankNodeQuadInfo({quad:i,component:i.graph});const e=new Map,n=[...this.blankNodeInfo.keys()];for(const i of n)this._hashAndTrackBlankNode({id:i,hashToBlankNodes:e});const r=[...e.keys()].sort(),s=[];for(const i of r){const t=e.get(i);t.length>1?s.push(t):this.canonicalIssuer.getId(t[0])}for(const o of s){const t=[];for(const e of o){if(this.canonicalIssuer.hasId(e))continue;const n=new i("_:b");n.getId(e);const r=this.hashNDegreeQuads(e,n);t.push(r)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const i of this.quads){const t=bt({},i);t.subject=this._useCanonicalId({component:t.subject}),t.object=this._useCanonicalId({component:t.object}),t.graph=this._useCanonicalId({component:t.graph}),l.push(o.serializeQuad(t))}return l.sort(),l.join("")}hashFirstDegreeQuads(t){const e=[],n=this.blankNodeInfo.get(t),i=n.quads;for(const r of i){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(t,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(t,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(t,r.graph,"graph"),e.push(o.serializeQuad(n))}e.sort();const s=new r(this.hashAlgorithm);for(const r of e)s.update(r);return n.hash=s.digest(),n.hash}hashRelatedBlankNode(t,e,n,i){let s;s=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):this.blankNodeInfo.get(t).hash;const o=new r(this.hashAlgorithm);return o.update(i),"g"!==i&&o.update(this.getRelatedPredicate(e)),o.update(s),o.digest()}hashNDegreeQuads(t,e){const n=new r(this.hashAlgorithm),i=this.createHashToRelated(t,e),o=[...i.keys()].sort();for(const r of o){n.update(r);let t,o="";const a=new s(i.get(r));for(;a.hasNext();){const n=a.next();let i=e.clone(),r="";const s=[];let l=!1;for(const t of n)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(i.hasId(t)||s.push(t),r+=i.getId(t)),0!==o.length&&r>o){l=!0;break}if(!l){for(const t of s){const e=this.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==o.length&&r>o){l=!0;break}}l||(0===o.length||r`}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i)this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:t,issuer:e,hashToRelated:n});return n}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){const n=this.hashFirstDegreeQuads(t),i=e.get(n);i?i.push(t):e.set(n,[t])}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:n,id:i,issuer:r,hashToRelated:s}){if("BlankNode"!==e.termType||e.value===i)return;const o=e.value,a=this.hashRelatedBlankNode(o,t,r,n),l=s.get(a);l?l.push(o):s.set(a,[o])}_useCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(t,e,n){"use strict";const r=t("./URDNA2015");e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){var n=this;return i(function*(){const i=new Map,r=n.blankNodeInfo.get(t).quads;let s=0;for(const o of r){let r,a;if("BlankNode"===o.subject.termType&&o.subject.value!==t)a=o.subject.value,r="p";else{if("BlankNode"!==o.object.termType||o.object.value===t)continue;a=o.object.value,r="r"}++s%100==0&&(yield n._yield());const l=yield n.hashRelatedBlankNode(a,o,e,r),c=i.get(l);c?c.push(a):i.set(l,[a])}return i})()}}},{"./URDNA2015":51}],54:[function(t,e,n){"use strict";const i=t("./URDNA2015Sync");e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i){let i,s;if("BlankNode"===r.subject.termType&&r.subject.value!==t)s=r.subject.value,i="p";else{if("BlankNode"!==r.object.termType||r.object.value===t)continue;s=r.object.value,i="r"}const o=this.hashRelatedBlankNode(s,r,e,i),a=n.get(o);a?a.push(s):n.set(o,[s])}return n}}},{"./URDNA2015Sync":52}],55:[function(t,e,n){"use strict";const r=t("./URDNA2015"),s=t("./URGNA2012"),o=t("./URDNA2015Sync"),a=t("./URGNA2012Sync");let l;try{l=t("rdf-canonize-native")}catch(u){}const c={};e.exports=c,c.NQuads=t("./NQuads"),c.IdentifierIssuer=t("./IdentifierIssuer"),c._rdfCanonizeNative=function(t){return t&&(l=t),l},c.canonize=function(){var t=i(function*(t,e){if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),e.useNative){if(!l)throw new Error("rdf-canonize-native not available");return new Promise((n,i)=>l.canonize(t,e,(t,e)=>t?i(t):n(e)))}if("URDNA2015"===e.algorithm)return new r(e).main(t);if("URGNA2012"===e.algorithm)return new s(e).main(t);throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(e,n){return t.apply(this,arguments)}}(),c._canonizeSync=function(t,e){if(Array.isArray(t)||(t=c.NQuads.legacyDatasetToQuads(t)),e.useNative){if(l)return l.canonizeSync(t,e);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===e.algorithm)return new o(e).main(t);if("URGNA2012"===e.algorithm)return new a(e).main(t);throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(t("./lib/BlankNode"),n),r(t("./lib/DataFactory"),n),r(t("./lib/DefaultGraph"),n),r(t("./lib/Literal"),n),r(t("./lib/NamedNode"),n),r(t("./lib/Quad"),n),r(t("./lib/Variable"),n)},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BlankNode=void 0;n.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&"BlankNode"===t.termType&&t.value===this.value}}},{}],58:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DataFactory=void 0;const i=t("./BlankNode"),r=t("./DefaultGraph"),s=t("./Literal"),o=t("./NamedNode"),a=t("./Quad"),l=t("./Variable");let c=0;n.DataFactory=class{constructor(t){this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||`df_${c++}_`}namedNode(t){return new o.NamedNode(t)}blankNode(t){return new i.BlankNode(t||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(t,e){return new s.Literal(t,e)}variable(t){return new l.Variable(t)}defaultGraph(){return r.DefaultGraph.INSTANCE}quad(t,e,n,i){return new a.Quad(t,e,n,i||this.defaultGraph())}fromTerm(t){switch(t.termType){case"NamedNode":return this.namedNode(t.value);case"BlankNode":return this.blankNode(t.value);case"Literal":return t.language?this.literal(t.value,t.language):t.datatype.equals(s.Literal.XSD_STRING)?this.literal(t.value):this.literal(t.value,this.fromTerm(t.datatype));case"Variable":return this.variable(t.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(t.subject),this.fromTerm(t.predicate),this.fromTerm(t.object),this.fromTerm(t.graph))}}fromQuad(t){return this.fromTerm(t)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultGraph=void 0;class i{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&"DefaultGraph"===t.termType}}n.DefaultGraph=i,i.INSTANCE=new i},{}],60:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Literal=void 0;const i=t("./NamedNode");class r{constructor(t,e){this.termType="Literal",this.value=t,"string"==typeof e?(this.language=e,this.datatype=r.RDF_LANGUAGE_STRING):e?(this.language="",this.datatype=e):(this.language="",this.datatype=r.XSD_STRING)}equals(t){return!!t&&"Literal"===t.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}n.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NamedNode=void 0;n.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&"NamedNode"===t.termType&&t.value===this.value}}},{}],62:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Quad=void 0;n.Quad=class{constructor(t,e,n,i){this.termType="Quad",this.value="",this.subject=t,this.predicate=e,this.object=n,this.graph=i}equals(t){return!!t&&("Quad"===t.termType||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},{}],63:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Variable=void 0;n.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&"Variable"===t.termType&&t.value===this.value}}},{}],64:[function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(n,"__esModule",{value:!0}),r(t("./lib/RdfXmlParser"),n)},{"./lib/RdfXmlParser":66}],65:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseError=void 0;class i extends Error{constructor(t,e){const n=t.saxStream._parser;super(t.trackPosition?`Line ${n.line+1} column ${n.column+1}: ${e}`:e)}}n.ParseError=i},{}],66:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ParseType=n.RdfXmlParser=void 0;const i=t("relative-to-absolute-iri"),r=t("sax"),s=t("stream"),o=t("./ParseError"),a=t("rdf-data-factory");class l extends s.Transform{constructor(t){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},t&&(Object.assign(this,t),this.options=t),this.dataFactory||(this.dataFactory=new a.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=r.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(t,e){const n={};let i=!1;for(const s in t.attributes)s.startsWith("xmlns")&&(5===s.length?(i=!0,n[""]=t.attributes[s]):":"===s.charAt(5)&&(i=!0,n[s.substr(6)]=t.attributes[s]));const r=e&&e.ns?e.ns:[l.DEFAULT_NS];return i?r.concat([n]):r}static expandPrefixedTerm(t,e,n){const i=t.indexOf(":");let r,s;i>=0?(r=t.substr(0,i),s=t.substr(i+1)):(r="",s=t);let a=null,l=null;for(let o=e.length-1;o>=0;o--){const t=e[o][r];if(t){a=t;break}l||(l=e[o][""])}if(!a){if(r&&"xmlns"!==r)throw new o.ParseError(n,`The prefix '${r}' in term '${t}' was not bound.`);a=l||""}return{prefix:r,local:s,uri:a}}static isValidIri(t){return l.IRI_REGEX.test(t)}import(t){const e=new s.PassThrough({readableObjectMode:!0});t.on("error",t=>n.emit("error",t)),t.on("data",t=>e.push(t)),t.on("end",()=>e.push(null));const n=e.pipe(new l(this.options));return n}_transform(t,e,n){try{this.saxStream.write(t,e)}catch(i){return n(i)}n()}newParseError(t){return new o.ParseError(this,t)}valueToUri(t,e){return this.uriToNamedNode(i.resolve(t,e.baseIRI))}uriToNamedNode(t){if(!l.isValidIri(t))throw this.newParseError(`Invalid URI: ${t}`);return this.dataFactory.namedNode(t)}validateNcname(t){if(!l.NCNAME_MATCHER.test(t))throw this.newParseError(`Not a valid NCName: ${t}`)}attachSaxListeners(){this.saxStream.on("error",t=>this.emit("error",t)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(t){const e=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let n=c.RESOURCE;if(e&&(e.hadChildren=!0,n=e.childrenParseType),e&&e.childrenStringTags){const n=t.name;let i="";for(const e in t.attributes)i+=` ${e}="${t.attributes[e]}"`;e.childrenStringTags.push(`<${n}${i}>`);const r={childrenStringTags:e.childrenStringTags};return r.childrenStringEmitClosingTag=``,void this.activeTagStack.push(r)}const i={};e?(i.language=e.language,i.baseIRI=e.baseIRI):i.baseIRI=this.baseIRI,this.activeTagStack.push(i),i.ns=l.parseNamespace(t,e),n===c.RESOURCE?this.onTagResource(t,i,e,!e):this.onTagProperty(t,i,e)}onTagResource(t,e,n,r){const s=l.expandPrefixedTerm(t.name,e.ns,this);e.childrenParseType=c.PROPERTY;let o=!0;if(s.uri===l.RDF){if(!r&&l.FORBIDDEN_NODE_ELEMENTS.indexOf(s.local)>=0)throw this.newParseError(`Illegal node element name: ${s.local}`);switch(s.local){case"RDF":e.childrenParseType=c.RESOURCE;case"Description":o=!1}}const a=[],u=[];let h=null,d=!1,p=!1,f=null;for(const c in t.attributes){const r=t.attributes[c],s=l.expandPrefixedTerm(c,e.ns,this);if(n&&s.uri===l.RDF)switch(s.local){case"about":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);h=r;continue;case"ID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);this.validateNcname(r),h="#"+r,d=!0;continue;case"nodeID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${r} and ${h} where found.`);this.validateNcname(r),h=r,p=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":f=r;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(s.uri===l.XML){if("lang"===s.local){e.language=""===r?null:r.toLowerCase();continue}if("base"===s.local){e.baseIRI=i.resolve(r,e.baseIRI);continue}}"xml"!==s.prefix&&s.uri&&(a.push(this.uriToNamedNode(s.uri+s.local)),u.push(r))}if(null!==h&&(e.subject=p?this.dataFactory.blankNode(h):this.valueToUri(h,e),d&&this.claimNodeId(e.subject)),e.subject||(e.subject=this.dataFactory.blankNode()),o){const t=this.uriToNamedNode(s.uri+s.local);this.emitTriple(e.subject,this.dataFactory.namedNode(l.RDF+"type"),t,n?n.reifiedStatementId:null)}if(n){if(n.predicate)if(n.childrenCollectionSubject){const t=this.dataFactory.blankNode();this.emitTriple(n.childrenCollectionSubject,n.childrenCollectionPredicate,t,n.reifiedStatementId),this.emitTriple(t,this.dataFactory.namedNode(l.RDF+"first"),e.subject,e.reifiedStatementId),n.childrenCollectionSubject=t,n.childrenCollectionPredicate=this.dataFactory.namedNode(l.RDF+"rest")}else{this.emitTriple(n.subject,n.predicate,e.subject,n.reifiedStatementId);for(let t=0;t=0)throw this.newParseError(`Illegal property element name: ${i.local}`);e.predicateSubPredicates=[],e.predicateSubObjects=[];let r=!1,s=!1,o=null,a=!0;const u=[],h=[];for(const d in t.attributes){const n=t.attributes[d],i=l.expandPrefixedTerm(d,e.ns,this);if(i.uri===l.RDF)switch(i.local){case"resource":if(o)throw this.newParseError(`Found both rdf:resource (${n}) and rdf:nodeID (${o}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${n})`);e.hadChildren=!0,o=n,a=!1;continue;case"datatype":if(s)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${n}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${n})`);e.datatype=this.valueToUri(n,e);continue;case"nodeID":if(s)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${n}).`);if(e.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${n}).`);if(r)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${n})`);this.validateNcname(n),e.hadChildren=!0,o=n,a=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(s)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(e.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${e.datatype.value})`);if(o)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${o})`);if("Resource"===n){r=!0,e.childrenParseType=c.PROPERTY;const t=this.dataFactory.blankNode();this.emitTriple(e.subject,e.predicate,t,e.reifiedStatementId),e.subject=t,e.predicate=null}else"Collection"===n?(r=!0,e.hadChildren=!0,e.childrenCollectionSubject=e.subject,e.childrenCollectionPredicate=e.predicate,a=!1):"Literal"===n&&(r=!0,e.childrenTagsToString=!0,e.childrenStringTags=[]);continue;case"ID":this.validateNcname(n),e.reifiedStatementId=this.valueToUri("#"+n,e),this.claimNodeId(e.reifiedStatementId);continue}else if(i.uri===l.XML&&"lang"===i.local){e.language=""===n?null:n.toLowerCase();continue}if("xml"!==i.prefix&&"xmlns"!==i.prefix&&i.uri){if(r||e.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${n}`);e.hadChildren=!0,s=!0,u.push(this.uriToNamedNode(i.uri+i.local)),h.push(this.dataFactory.literal(n,e.datatype||e.language))}}if(null!==o){const t=e.subject;e.subject=a?this.dataFactory.blankNode(o):this.valueToUri(o,e),this.emitTriple(t,e.predicate,e.subject,e.reifiedStatementId);for(let n=0;n/g,(t,e,n)=>(this.saxStream._parser.ENTITIES[e]=n,""))}}var c,u;n.RdfXmlParser=l,l.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,l.MIME_TYPE="application/rdf+xml",l.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",l.XML="http://www.w3.org/XML/1998/namespace",l.XMLNS="http://www.w3.org/2000/xmlns/",l.DEFAULT_NS={xml:l.XML},l.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],l.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],l.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,(u=c=n.ParseType||(n.ParseType={}))[u.RESOURCE=0]="RESOURCE",u[u.PROPERTY=1]="PROPERTY"},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,sax:85,stream:87}],67:[function(t,e,n){"use strict";var i={};function r(t,e,n){n||(n=Error);var r=function(t){function n(n,i,r){return t.call(this,function(t,n,i){return"string"==typeof e?e:e(t,n,i)}(n,i,r))||this}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(n,t),n}(n);r.prototype.name=n.name,r.prototype.code=t,i[t]=r}function s(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map(function(t){return String(t)}),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,n){var i,r;if("string"==typeof e&&function(t,e,n){return t.substr(!n||n<0?0:+n,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))r="The ".concat(t," ").concat(i," ").concat(s(e,"type"));else{var o=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";r='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(s(e,"type"))}return r+". Received type ".concat(typeof n)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},{}],68:[function(t,e,n){(function(n){(function(){"use strict";var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};e.exports=c;var r=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(c,r);for(var o=i(s.prototype),a=0;a0)if("string"!=typeof e&&!o.objectMode&&Object.getPrototypeOf(e)!==a.prototype&&(e=function(t){return a.from(t)}(e)),i)o.endEmitted?x(t,new w):T(t,o,e,!0);else if(o.ended)x(t,new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(e=o.decoder.write(e),o.objectMode||0!==e.length?T(t,o,e,!1):M(t,o)):T(t,o,e,!1)}else i||(o.reading=!1,M(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(I,t))}function I(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,j(t)}function M(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(D,t,e))}function D(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){c("readable nexttick read 0"),t.read(0)}function L(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(V,e,t))}function V(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function z(t,e){for(var n=0,i=t.length;n=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):P(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&B(this),null;var i,r=e.needReadable;return c("need readable",r),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&B(this)),null!==i&&this.emit("data",i),i},C.prototype._read=function(t){x(this,new _("_read()"))},C.prototype.pipe=function(t,e){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,c("pipe count=%d opts=%j",r.pipesCount,e);var o=e&&!1===e.end||t===n.stdout||t===n.stderr?m:l;function a(e,n){c("onunpipe"),e===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),t.removeListener("close",f),t.removeListener("finish",g),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",m),i.removeListener("data",d),h=!0,r.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u())}function l(){c("onend"),t.end()}r.endEmitted?n.nextTick(o):i.once("end",o),t.on("unpipe",a);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,j(t))}}(i);t.on("drain",u);var h=!1;function d(e){c("ondata");var n=t.write(e);c("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==z(r.pipes,t))&&!h&&(c("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function p(e){c("onerror",e),m(),t.removeListener("error",p),0===s(t,"error")&&x(t,e)}function f(){t.removeListener("finish",g),m()}function g(){c("onfinish"),t.removeListener("close",f),m()}function m(){c("unpipe"),i.unpipe(t)}return i.on("data",d),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",p),t.once("close",f),t.once("finish",g),t.emit("pipe",i),r.flowing||(c("pipe resume"),i.resume()),t},C.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var i=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s0,!1!==r.flowing&&this.resume()):"readable"===t&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,c("on readable",r.length,r.reading),r.length?P(this):r.reading||n.nextTick(N,this)),i},C.prototype.removeListener=function(t,e){var i=o.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(R,this),i},C.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.nextTick(R,this),e},C.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(L,t,e))}(this,t)),t.paused=!1,this},C.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(t){var e=this,n=this._readableState,i=!1;for(var r in t.on("end",function(){if(c("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(r){c("wrapped data"),n.decoder&&(r=n.decoder.write(r)),n.objectMode&&null==r||!(n.objectMode||r&&r.length)||e.push(r)||(i=!0,t.pause())}),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));for(var s=0;s-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(t,e,n){n(new g("_write()"))},C.prototype._writev=null,C.prototype.end=function(t,e,i){var r=this._writableState;return"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,i){e.ending=!0,M(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i)),e.ended=!0,t.writable=!1}(this,r,i),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){!this._writableState||(this._writableState.destroyed=t)}}),C.prototype.destroy=h.destroy,C.prototype._undestroy=h.undestroy,C.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":67,"./_stream_duplex":68,"./internal/streams/destroy":75,"./internal/streams/state":79,"./internal/streams/stream":80,_process:44,buffer:6,inherits:10,"util-deprecate":90}],73:[function(t,e,n){(function(n){(function(){"use strict";var i;function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=t("./end-of-stream"),o=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function f(t){var e=t[o];if(null!==e){var n=t[d].read();null!==n&&(t[u]=null,t[o]=null,t[a]=null,e(p(n,!1)))}}function g(t){n.nextTick(f,t)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((r(i={get stream(){return this[d]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(e,i){n.nextTick(function(){t[l]?i(t[l]):e(p(void 0,!0))})});var i,r=this[u];if(r)i=new Promise(function(t,e){return function(n,i){t.then(function(){e[c]?n(p(void 0,!0)):e[h](n,i)},i)}}(r,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(p(s,!1));i=new Promise(this[h])}return this[u]=i,i}},Symbol.asyncIterator,function(){return this}),r(i,"return",function(){var t=this;return new Promise(function(e,n){t[d].destroy(null,function(t){t?n(t):e(p(void 0,!0))})})}),i),m);e.exports=function(t){var e,n=Object.create(b,(r(e={},d,{value:t,writable:!0}),r(e,o,{value:null,writable:!0}),r(e,a,{value:null,writable:!0}),r(e,l,{value:null,writable:!0}),r(e,c,{value:t._readableState.endEmitted,writable:!0}),r(e,h,{value:function(t,e){var i=n[d].read();i?(n[u]=null,n[o]=null,n[a]=null,t(p(i,!1))):(n[o]=t,n[a]=e)},writable:!0}),e));return n[u]=null,s(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[a];return null!==e&&(n[u]=null,n[o]=null,n[a]=null,e(t)),void(n[l]=t)}var i=n[o];null!==i&&(n[u]=null,n[o]=null,n[a]=null,i(p(void 0,!0))),n[c]=!0}),t.on("readable",g.bind(null,n)),n}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":76,_process:44}],74:[function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){for(var n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e=o.allocUnsafe(t>>>0),n=this.head,i=0;n;)c(n.data,e,i),i+=n.data.length,n=n.next;return e}},{key:"consume",value:function(t,e){var n;return tr.length?r.length:t;if(i+=s===r.length?r:r.slice(0,t),0==(t-=s)){s===r.length?(++n,this.head=e.next?e.next:this.tail=null):(this.head=e,e.data=r.slice(s));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),n=this.head,i=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var r=n.data,s=t>r.length?r.length:t;if(r.copy(e,e.length-t,0,s),0==(t-=s)){s===r.length?(++i,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=r.slice(s));break}++i}return this.length-=i,e}},{key:l,value:function(t,e){return a(this,function(t){for(var e=1;e0,function(t){r||(r=t),t&&o.forEach(c),!s&&(o.forEach(c),i(r))})});return e.reduce(u)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(t,e,n){"use strict";var i=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,r){var s=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,r,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(r?n:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},{"../../../errors":67}],80:[function(t,e,n){e.exports=t("events").EventEmitter},{events:8}],81:[function(t,e,n){(n=e.exports=t("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=t("./lib/_stream_writable.js"),n.Duplex=t("./lib/_stream_duplex.js"),n.Transform=t("./lib/_stream_transform.js"),n.PassThrough=t("./lib/_stream_passthrough.js"),n.finished=t("./lib/internal/streams/end-of-stream.js"),n.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":68,"./lib/_stream_passthrough.js":69,"./lib/_stream_readable.js":70,"./lib/_stream_transform.js":71,"./lib/_stream_writable.js":72,"./lib/internal/streams/end-of-stream.js":76,"./lib/internal/streams/pipeline.js":78}],82:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}(t("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(t,e,n){"use strict";function i(t){const e=[];let n=0;for(;nt.join("")).join("/")}function r(t,e){let n=e+1;e>=0?"/"===t[e+1]&&"/"===t[e+2]&&(n=e+3):"/"===t[0]&&"/"===t[1]&&(n=2);const r=t.indexOf("/",n);return r<0?t:t.substr(0,r)+i(t.substr(r))}function s(t){return!t||"#"===t||"?"===t||"/"===t}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(t,e){const n=(e=e||"").indexOf("#");if(n>0&&(e=e.substr(0,n)),!t.length){if(e.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);return e}if(t.startsWith("?")){const n=e.indexOf("?");return n>0&&(e=e.substr(0,n)),e+t}if(t.startsWith("#"))return e+t;if(!e.length){const e=t.indexOf(":");if(e<0)throw new Error(`Found invalid relative IRI '${t}' for a missing baseIRI`);return r(t,e)}const s=t.indexOf(":");if(s>=0)return r(t,s);const o=e.indexOf(":");if(o<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);const a=e.substr(0,o+1);if(0===t.indexOf("//"))return a+r(t,s);let l;if(e.indexOf("//",o)===o+1){if(l=e.indexOf("/",o+3),l<0)return e.length>o+3?e+"/"+r(t,s):a+r(t,s)}else if(l=e.indexOf("/",o+1),l<0)return a+r(t,s);if(0===t.indexOf("/"))return e.substr(0,l)+i(t);let c=e.substr(l);const u=c.lastIndexOf("/");return u>=0&&u"===s?(O(e,"onsgmldeclaration",e.sgmlDecl),e.sgmlDecl="",e.state=S.TEXT):(m(s)&&(e.state=S.SGML_DECL_QUOTED),e.sgmlDecl+=s);continue;case S.SGML_DECL_QUOTED:s===e.q&&(e.state=S.SGML_DECL,e.q=""),e.sgmlDecl+=s;continue;case S.DOCTYPE:">"===s?(e.state=S.TEXT,O(e,"ondoctype",e.doctype),e.doctype=!0):(e.doctype+=s,"["===s?e.state=S.DOCTYPE_DTD:m(s)&&(e.state=S.DOCTYPE_QUOTED,e.q=s));continue;case S.DOCTYPE_QUOTED:e.doctype+=s,s===e.q&&(e.q="",e.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:e.doctype+=s,"]"===s?e.state=S.DOCTYPE:m(s)&&(e.state=S.DOCTYPE_DTD_QUOTED,e.q=s);continue;case S.DOCTYPE_DTD_QUOTED:e.doctype+=s,s===e.q&&(e.state=S.DOCTYPE_DTD,e.q="");continue;case S.COMMENT:"-"===s?e.state=S.COMMENT_ENDING:e.comment+=s;continue;case S.COMMENT_ENDING:"-"===s?(e.state=S.COMMENT_ENDED,e.comment=k(e.opt,e.comment),e.comment&&O(e,"oncomment",e.comment),e.comment=""):(e.comment+="-"+s,e.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==s?(I(e,"Malformed comment"),e.comment+="--"+s,e.state=S.COMMENT):e.state=S.TEXT;continue;case S.CDATA:"]"===s?e.state=S.CDATA_ENDING:e.cdata+=s;continue;case S.CDATA_ENDING:"]"===s?e.state=S.CDATA_ENDING_2:(e.cdata+="]"+s,e.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===s?(e.cdata&&O(e,"oncdata",e.cdata),O(e,"onclosecdata"),e.cdata="",e.state=S.TEXT):"]"===s?e.cdata+="]":(e.cdata+="]]"+s,e.state=S.CDATA);continue;case S.PROC_INST:"?"===s?e.state=S.PROC_INST_ENDING:g(s)?e.state=S.PROC_INST_BODY:e.procInstName+=s;continue;case S.PROC_INST_BODY:if(!e.procInstBody&&g(s))continue;"?"===s?e.state=S.PROC_INST_ENDING:e.procInstBody+=s;continue;case S.PROC_INST_ENDING:">"===s?(O(e,"onprocessinginstruction",{name:e.procInstName,body:e.procInstBody}),e.procInstName=e.procInstBody="",e.state=S.TEXT):(e.procInstBody+="?"+s,e.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:y(d,s)?e.tagName+=s:(M(e),">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:(g(s)||I(e,"Invalid character in tag name"),e.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===s?(N(e,!0),L(e)):(I(e,"Forward-slash in opening tag not followed by >"),e.state=S.ATTRIB);continue;case S.ATTRIB:if(g(s))continue;">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:y(h,s)?(e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):I(e,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===s?e.state=S.ATTRIB_VALUE:">"===s?(I(e,"Attribute without value"),e.attribValue=e.attribName,R(e),N(e)):g(s)?e.state=S.ATTRIB_NAME_SAW_WHITE:y(d,s)?e.attribName+=s:I(e,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===s)e.state=S.ATTRIB_VALUE;else{if(g(s))continue;I(e,"Attribute without value"),e.tag.attributes[e.attribName]="",e.attribValue="",O(e,"onattribute",{name:e.attribName,value:""}),e.attribName="",">"===s?N(e):y(h,s)?(e.attribName=s,e.state=S.ATTRIB_NAME):(I(e,"Invalid attribute name"),e.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(g(s))continue;m(s)?(e.q=s,e.state=S.ATTRIB_VALUE_QUOTED):(I(e,"Unquoted attribute value"),e.state=S.ATTRIB_VALUE_UNQUOTED,e.attribValue=s);continue;case S.ATTRIB_VALUE_QUOTED:if(s!==e.q){"&"===s?e.state=S.ATTRIB_VALUE_ENTITY_Q:e.attribValue+=s;continue}R(e),e.q="",e.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:g(s)?e.state=S.ATTRIB:">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:y(h,s)?(I(e,"No whitespace between attributes"),e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):I(e,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!b(s)){"&"===s?e.state=S.ATTRIB_VALUE_ENTITY_U:e.attribValue+=s;continue}R(e),">"===s?N(e):e.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(e.tagName)">"===s?L(e):y(d,s)?e.tagName+=s:e.script?(e.script+=""===s?L(e):I(e,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var a,l;switch(e.state){case S.TEXT_ENTITY:a=S.TEXT,l="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:a=S.ATTRIB_VALUE_QUOTED,l="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:a=S.ATTRIB_VALUE_UNQUOTED,l="attribValue"}";"===s?(e[l]+=j(e),e.entity="",e.state=a):y(e.entity.length?f:p,s)?e.entity+=s:(I(e,"Invalid character in entity name"),e[l]+="&"+e.entity+s,e.entity="",e.state=a);continue;default:throw new Error(e,"Unknown state: "+e.state)}return e.position>=e.bufferCheckPosition&&function(t){for(var e=Math.max(n.MAX_BUFFER_LENGTH,10),i=0,s=0,o=r.length;se)switch(r[s]){case"textNode":T(t);break;case"cdata":O(t,"oncdata",t.cdata),t.cdata="";break;case"script":O(t,"onscript",t.script),t.script="";break;default:A(t,"Max buffer length exceeded: "+r[s])}i=Math.max(i,a)}t.bufferCheckPosition=n.MAX_BUFFER_LENGTH-i+t.position}(e),e},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(t){T(t),""!==t.cdata&&(O(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(O(t,"onscript",t.script),t.script="")}(this)}};try{i=t("stream").Stream}catch(_){i=function(){}}var o=n.EVENTS.filter(function(t){return"error"!==t&&"end"!==t});function a(t,e){if(!(this instanceof a))return new a(t,e);i.apply(this),this._parser=new s(t,e),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(t){n.emit("error",t),n._parser.error=null},this._decoder=null,o.forEach(function(t){Object.defineProperty(n,"on"+t,{get:function(){return n._parser["on"+t]},set:function(e){if(!e)return n.removeAllListeners(t),n._parser["on"+t]=e,e;n.on(t,e)},enumerable:!0,configurable:!1})})}(a.prototype=Object.create(i.prototype,{constructor:{value:a}})).write=function(n){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(n)){if(!this._decoder){var i=t("string_decoder").StringDecoder;this._decoder=new i("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},a.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},a.prototype.on=function(t,e){var n=this;return!n._parser["on"+t]&&-1!==o.indexOf(t)&&(n._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),n.emit.apply(n,e)}),i.prototype.on.call(n,t,e)};var l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",u={xml:l,xmlns:c},h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function m(t){return'"'===t||"'"===t}function b(t){return">"===t||g(t)}function y(t,e){return t.test(e)}function v(t,e){return!y(t,e)}var _,w,x,S=0;for(var E in n.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(t){var e=n.ENTITIES[t],i="number"==typeof e?String.fromCharCode(e):e;n.ENTITIES[t]=i}),n.STATE)n.STATE[n.STATE[E]]=E;function C(t,e,n){t[e]&&t[e](n)}function O(t,e,n){t.textNode&&T(t),C(t,e,n)}function T(t){t.textNode=k(t.opt,t.textNode),t.textNode&&C(t,"ontext",t.textNode),t.textNode=""}function k(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function A(t,e){return T(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,C(t,"onerror",e),t}function P(t){return t.sawRoot&&!t.closedRoot&&I(t,"Unclosed root tag"),t.state!==S.BEGIN&&t.state!==S.BEGIN_WHITESPACE&&t.state!==S.TEXT&&A(t,"Unexpected end"),T(t),t.c="",t.closed=!0,C(t,"onend"),s.call(t,t.strict,t.opt),t}function I(t,e){if("object"!=typeof t||!(t instanceof s))throw new Error("bad call to strictFail");t.strict&&A(t,e)}function M(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,O(t,"onopentagstart",n)}function D(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),i=n[0],r=n[1];return e&&"xmlns"===t&&(i="xmlns",r=""),{prefix:i,local:r}}function R(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=D(t.attribName,!0),n=e.local;if("xmlns"===e.prefix)if("xml"===n&&t.attribValue!==l)I(t,"xml: prefix must be bound to "+l+"\nActual: "+t.attribValue);else if("xmlns"===n&&t.attribValue!==c)I(t,"xmlns: prefix must be bound to "+c+"\nActual: "+t.attribValue);else{var i=t.tag,r=t.tags[t.tags.length-1]||t;i.ns===r.ns&&(i.ns=Object.create(r.ns)),i.ns[n]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,O(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function N(t,e){if(t.opt.xmlns){var n=t.tag,i=D(t.tagName);n.prefix=i.prefix,n.local=i.local,n.uri=n.ns[i.prefix]||"",n.prefix&&!n.uri&&(I(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=i.prefix),n.ns&&(t.tags[t.tags.length-1]||t).ns!==n.ns&&Object.keys(n.ns).forEach(function(e){O(t,"onopennamespace",{prefix:e,uri:n.ns[e]})});for(var r=0,s=t.attribList.length;r",t.tagName="",void(t.state=S.SCRIPT);O(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var i=n;e--&&t.tags[e].name!==i;)I(t,"Unexpected close tag");if(e<0)return I(t,"Unmatched closing tag: "+t.tagName),t.textNode+="",void(t.state=S.TEXT);t.tagName=n;for(var r=t.tags.length;r-- >e;){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,O(t,"onclosetag",t.tagName);var o={};for(var a in s.ns)o[a]=s.ns[a];t.opt.xmlns&&s.ns!==(t.tags[t.tags.length-1]||t).ns&&Object.keys(s.ns).forEach(function(e){O(t,"onclosenamespace",{prefix:e,uri:s.ns[e]})})}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=S.TEXT}function j(t){var e,n=t.entity,i=n.toLowerCase(),r="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[i]?t.ENTITIES[i]:("#"===(n=i).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),r=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),r=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(e)||r.toLowerCase()!==n?(I(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function F(t,e){"<"===e?(t.state=S.OPEN_WAKA,t.startTagPosition=t.position):g(e)||(I(t,"Non-whitespace before first tag."),t.textNode=e,t.state=S.TEXT)}function B(t,e){var n="";return e1114111||w(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?e.push(s):e.push(55296+((s-=65536)>>10),s%1024+56320),(n+1===i||e.length>t)&&(r+=_.apply(null,e),e.length=0)}return r},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:x,configurable:!0,writable:!0}):String.fromCodePoint=x)}(void 0===n?this.sax={}:n)}).call(this)}).call(this,t("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(t,e,n){(function(t,e){(function(){!function(e,n){"use strict";if(!e.setImmediate){var i,r=1,s={},o=!1,a=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick(function(){d(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(c="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(c)&&d(+t.data.slice(c.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),i=function(t){e.postMessage(c+t,"*")}):e.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){d(t.data)},i=function(e){t.port2.postMessage(e)}}():a&&"onreadystatechange"in a.createElement("script")?function(){var t=a.documentElement;i=function(e){var n=a.createElement("script");n.onreadystatechange=function(){d(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():i=function(t){setTimeout(d,0,t)},l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n.setImmediate="function"==typeof e?e:function(t){var e=l++,i=!(arguments.length<2)&&o.call(arguments,1);return a[e]=!0,r(function(){a[e]&&(i?t.apply(null,i):t.call(null),n.clearImmediate(e))}),e},n.clearImmediate="function"==typeof i?i:function(t){delete a[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(t,e,n){(function(t){(function(){function n(e){try{if(!t.localStorage)return!1}catch(i){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(t,e,n){"use strict";e.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},{}],92:[function(t,e,n){"use strict";function i(t){var e=this;if(e instanceof i||(e=new i),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach(function(t){e.push(t)});else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=t(n,i.value,r),i=i.next;return n},i.prototype.reduceReverse=function(t,e){var n,i=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=t(n,i.value,r),i=i.prev;return n},i.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},i.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},i.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new i;if(ethis.length&&(e=this.length);for(var r=0,s=this.head;null!==s&&rthis.length&&(e=this.length);for(var r=this.length,s=this.tail;null!==s&&r>e;r--)s=s.prev;for(;null!==s&&r>t;r--,s=s.prev)n.push(s.value);return n},i.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,s=this.head;null!==s&&i{return(t=n||(n={})).typeOfFunction="function",t.boolTrue=!0,n;var t})();function i(t,e,i){if(!i||typeof i.value!==n.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:n.boolTrue,get:function(){var t=i.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:n.boolTrue,writable:n.boolTrue}),t}}}e.ak=i,e.ZP=i},97266:function(t,e,n){t.exports={ResizeSensor:n(69835),ElementQueries:n(54845)}},54845:function(t,e,n){"use strict";var i,r,s;"undefined"!=typeof window&&window,r=[n(69835)],void 0!==(s="function"==typeof(i=function(t){var e=function(){var e,n={},i=[];function r(t){t||(t=document.documentElement);var e=window.getComputedStyle(t,null).fontSize;return parseFloat(e)||16}function s(t,e){var n=e.split(/\d/),i=n[n.length-1];switch(e=parseFloat(e),i){case"px":return e;case"em":return e*r(t);case"rem":return e*r();case"vw":return e*document.documentElement.clientWidth/100;case"vh":return e*document.documentElement.clientHeight/100;case"vmin":case"vmax":var s=document.documentElement.clientWidth/100,o=document.documentElement.clientHeight/100;return e*(0,Math["vmin"===i?"min":"max"])(s,o);default:return e}}function o(t,e){this.element=t;var i,r,o,a,l,c,u,h,d=["min-width","min-height","max-width","max-height"];this.call=function(){for(i in o=function(t){if(!t.getBoundingClientRect)return{width:t.offsetWidth,height:t.offsetHeight};var e=t.getBoundingClientRect();return{width:Math.round(e.width),height:Math.round(e.height)}}(this.element),c={},n[e])!n[e].hasOwnProperty(i)||(a=s(this.element,(r=n[e][i]).value),l="width"===r.property?o.width:o.height,u="","min"===r.mode&&l>=a&&(u+=r.value),"max"===r.mode&&l<=a&&(u+=r.value),c[h=r.mode+"-"+r.property]||(c[h]=""),u&&-1===(" "+c[h]+" ").indexOf(" "+u+" ")&&(c[h]+=" "+u));for(var t in d)!d.hasOwnProperty(t)||(c[d[t]]?this.element.setAttribute(d[t],c[d[t]].substr(1)):this.element.removeAttribute(d[t]))}}function a(e,n){e.elementQueriesSetupInformation||(e.elementQueriesSetupInformation=new o(e,n)),e.elementQueriesSensor||(e.elementQueriesSensor=new t(e,function(){e.elementQueriesSetupInformation.call()}))}function l(t,r,s,o){if(void 0===n[t]){n[t]=[];var a=i.length;e.innerHTML+="\n"+t+" {animation: 0.1s element-queries;}",e.innerHTML+="\n"+t+" > .resize-sensor {min-width: "+a+"px;}",i.push(t)}n[t].push({mode:r,property:s,value:o})}function c(t){var e;if(document.querySelectorAll&&(e=t?t.querySelectorAll.bind(t):document.querySelectorAll.bind(document)),!e&&"undefined"!=typeof $$&&(e=$$),!e&&"undefined"!=typeof jQuery&&(e=jQuery),!e)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return e}function u(e){var n=[],i=[],r=[],s=0,o=-1,a=[];for(var l in e.children)if(e.children.hasOwnProperty(l)&&e.children[l].tagName&&"img"===e.children[l].tagName.toLowerCase()){n.push(e.children[l]);var c=e.children[l].getAttribute("min-width")||e.children[l].getAttribute("data-min-width"),u=e.children[l].getAttribute("data-src")||e.children[l].getAttribute("url");r.push(u),i.push({minWidth:c}),c?e.children[l].style.display="none":(s=n.length-1,e.children[l].style.display="block")}function h(){var t,l=!1;for(t in n)!n.hasOwnProperty(t)||i[t].minWidth&&e.offsetWidth>i[t].minWidth&&(l=t);if(l||(l=s),o!==l)if(a[l])n[o].style.display="none",n[l].style.display="block",o=l;else{var c=new Image;c.onload=function(){n[l].src=r[l],n[o].style.display="none",n[l].style.display="block",a[l]=!0,o=l},c.src=r[l]}else n[l].src=r[l]}o=s,e.resizeSensorInstance=new t(e,h),h()}var h=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,d=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function p(t){var e,n,i,r;for(t=t.replace(/'/g,'"');null!==(e=h.exec(t));)for(n=e[1]+e[3],i=e[2];null!==(r=d.exec(i));)l(n,r[1],r[2],r[3])}function f(t){var e="";if(t)if("string"==typeof t)(-1!==(t=t.toLowerCase()).indexOf("min-width")||-1!==t.indexOf("max-width"))&&p(t);else for(var n=0,i=t.length;n img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",e.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(e),g=!0);for(var r=0,s=document.styleSheets.length;r0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,console&&console.warn&&console.warn(a)}return t}function O(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function T(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=O.bind(i);return r.listener=n,i.wrapFn=r,r}function k(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=r[t];if(void 0===a)return!1;if("function"==typeof a)v(a,this,e);else{var l=a.length,c=P(a,l);for(n=0;n=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},w.prototype.listeners=function(t){return k(this,t,!0)},w.prototype.rawListeners=function(t){return k(this,t,!1)},w.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):A.call(t,e)},w.prototype.listenerCount=A,w.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]},M.prototype.next=function(){if(this.done)return{done:!0};var t=this._next();return t.done&&(this.done=!0),t},"undefined"!=typeof Symbol&&(M.prototype[Symbol.iterator]=function(){return this}),M.of=function(){var t=arguments,e=t.length,n=0;return new M(function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}})},M.empty=function(){var t=new M(null);return t.done=!0,t},M.is=function(t){return t instanceof M||"object"==typeof t&&null!==t&&"function"==typeof t.next};var D=M,R=function(t,e){for(var n,i=arguments.length>1?e:1/0,r=i!==1/0?new Array(i):[],s=0;;){if(s===i)return r;if((n=t.next()).done)return s!==e?r.slice(0,s):r;r[s++]=n.value}},N=function(t){function n(e,n){var i;return(i=t.call(this)||this).name="GraphError",i.message=e||"",i.data=n||{},i}return e(n,t),n}(o(Error)),L=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N),j=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N),F=function(t){function n(e,i){var r;return(r=t.call(this,e,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(N);function B(t,e){this.key=t,this.attributes=e,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function V(t,e){this.key=t,this.attributes=e,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function z(t,e){this.key=t,this.attributes=e,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function U(t,e,n,i,r,s){this.key=e,this.attributes=s,this.undirected=t,this.source=i,this.target=r,this.generatedKey=n}function H(t,e,n,i,r,s,o){var a,l,c="out",u="in";if(e&&(c=u="undirected"),t.multi){if(void 0===(l=(a=s[c])[r])&&(l=new Set,a[r]=l),l.add(n),i===r&&e)return;void 0===(a=o[u])[i]&&(a[i]=l)}else{if(s[c][r]=n,i===r&&e)return;o[u][i]=n}}function $(t,e,n){var i=t.multi,r=n.source,s=n.target,o=r.key,a=s.key,l=r[e?"undirected":"out"],c=e?"undirected":"in";if(a in l)if(i){var u=l[a];1===u.size?(delete l[a],delete s[c][o]):u.delete(n)}else delete l[a];i||delete s[c][o]}V.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},z.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var G=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes[i]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var r=""+t,s=""+arguments[1];if(!(i=c(this,r,s,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(r,'" - "').concat(s,'").'))}else if(!(i=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&i.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes.hasOwnProperty(i)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+i;if(i=arguments[2],r=arguments[3],!(s=c(this,o,a,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(s=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&s.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return s.attributes[i]=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+i;if(i=arguments[2],r=arguments[3],!(s=c(this,o,a,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(s=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("function"!=typeof r)throw new L("Graph.".concat(e,": updater should be a function."));if("mixed"!==n&&s.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return s.attributes[i]=r(s.attributes[i]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return delete r.attributes[i],this.emit("edgeAttributesUpdated",{key:r.key,type:"remove",attributes:r.attributes,name:i}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(e,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return r.attributes=i,this.emit("edgeAttributesUpdated",{key:r.key,type:"replace",attributes:r.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new F("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new F("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+t,o=""+i;if(i=arguments[2],!(r=c(this,s,o,n)))throw new j("Graph.".concat(e,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else if(!(r=this._edges.get(t=""+t)))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'));if(!h(i))throw new L("Graph.".concat(e,": provided attributes are not a plain object."));if("mixed"!==n&&r.undirected!==("undirected"===n))throw new j("Graph.".concat(e,': could not find the "').concat(t,'" ').concat(n," edge in the graph."));return l(r.attributes,i),this.emit("edgeAttributesUpdated",{key:r.key,type:"merge",attributes:r.attributes,data:i}),this}}}],W=D,q=function(){var t,e=arguments,n=-1;return new W(function i(){if(!t){if(++n>=e.length)return{done:!0};t=e[n]}var r=t.next();return r.done?(t=null,i()):r})},X=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Y(t,e){for(var n in e)t.push(e[n].key)}function K(t,e){for(var n in e)e[n].forEach(function(e){return t.push(e.key)})}function Q(t,e,n){for(var i in t)if(i!==n){var r=t[i];e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey)}}function Z(t,e,n){for(var i in t)i!==n&&t[i].forEach(function(t){return e(t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes,t.undirected,t.generatedKey)})}function J(t,e,n){for(var i in t)if(i!==n){var r=t[i];if(e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected,r.generatedKey))return!0}return!1}function tt(t,e,n){var i,r,s,o,a;for(var l in t)if(l!==n)for(i=t[l].values();!0!==(r=i.next()).done;)if(o=(s=r.value).source,e(s.key,s.attributes,o.key,(a=s.target).key,o.attributes,a.attributes,s.undirected,s.generatedKey))return!0;return!1}function et(t,e){var n=Object.keys(t),i=n.length,r=null,s=0;return new D(function o(){var a;if(r){var l=r.next();if(l.done)return r=null,s++,o();a=l.value}else{if(s>=i)return{done:!0};var c=n[s];if(c===e)return s++,o();if((a=t[c])instanceof Set)return r=a.values(),o();s++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}})}function nt(t,e,n){var i=e[n];i&&t.push(i.key)}function it(t,e,n){var i=e[n];i&&i.forEach(function(e){return t.push(e.key)})}function rt(t,e,n){var i=t[e];if(i){var r=i.source,s=i.target;n(i.key,i.attributes,r.key,s.key,r.attributes,s.attributes,i.undirected,i.generatedKey)}}function st(t,e,n){var i=t[e];i&&i.forEach(function(t){return n(t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes,t.undirected,t.generatedKey)})}function ot(t,e,n){var i=t[e];if(i){var r=i.source,s=i.target;return n(i.key,i.attributes,r.key,s.key,r.attributes,s.attributes,i.undirected,i.generatedKey)}}function at(t,e,n){var i=t[e];if(i){for(var r,s,o=i.values();!0!==(r=o.next()).done;)if(n((s=r.value).key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected,s.generatedKey))return!0;return!1}}function lt(t,e){var n=t[e];if(n instanceof Set){var i=n.values();return new D(function(){var t=i.next();if(t.done)return t;var e=t.value;return{done:!1,value:[e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes]}})}return D.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function ct(t,e){if(0===t.size)return[];if("mixed"===e||e===t.type)return"function"==typeof Array.from?Array.from(t._edges.keys()):R(t._edges.keys(),t._edges.size);for(var n,i,r=new Array("undirected"===e?t.undirectedSize:t.directedSize),s="undirected"===e,o=t._edges.values(),a=0;!0!==(n=o.next()).done;)(i=n.value).undirected===s&&(r[a++]=i.key);return r}function ut(t,e,n){if(0!==t.size)for(var i,r,s="mixed"!==e&&e!==t.type,o="undirected"===e,a=t._edges.values();!0!==(i=a.next()).done;)if(r=i.value,!s||r.undirected===o){var l=r.source,c=r.target;n(r.key,r.attributes,l.key,c.key,l.attributes,c.attributes,r.undirected,r.generatedKey)}}function ht(t,e,n){if(0!==t.size)for(var i,r,s="mixed"!==e&&e!==t.type,o="undirected"===e,a=t._edges.values();!0!==(i=a.next()).done;)if(r=i.value,!s||r.undirected===o){var l=r.source,c=r.target;if(n(r.key,r.attributes,l.key,c.key,l.attributes,c.attributes,r.undirected,r.generatedKey))break}}function dt(t,e){if(0===t.size)return D.empty();var n="mixed"!==e&&e!==t.type,i="undirected"===e,r=t._edges.values();return new D(function(){for(var t,e;;){if((t=r.next()).done)return t;if(e=t.value,!n||e.undirected===i)break}return{value:[e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes],done:!1}})}function pt(t,e,n,i){var r=[],s=t?K:Y;return"undirected"!==e&&("out"!==n&&s(r,i.in),"in"!==n&&s(r,i.out),!n&&i.directedSelfLoops>0&&r.splice(r.lastIndexOf(i.key),1)),"directed"!==e&&s(r,i.undirected),r}function ft(t,e,n,i,r){var s=t?Z:Q;"undirected"!==e&&("out"!==n&&s(i.in,r),"in"!==n&&s(i.out,r,n?null:i.key)),"directed"!==e&&s(i.undirected,r)}function gt(t,e,n,i,r){var s=t?tt:J;"undirected"!==e&&("out"!==n&&s(i.in,r)||"in"!==n&&s(i.out,r,n?null:i.key))||"directed"===e||s(i.undirected,r)}function mt(t,e,n){var i=D.empty();return"undirected"!==t&&("out"!==e&&void 0!==n.in&&(i=q(i,et(n.in))),"in"!==e&&void 0!==n.out&&(i=q(i,et(n.out,e?null:n.key)))),"directed"!==t&&void 0!==n.undirected&&(i=q(i,et(n.undirected))),i}function bt(t,e,n,i,r){var s=e?it:nt,o=[];return"undirected"!==t&&(void 0!==i.in&&"out"!==n&&s(o,i.in,r),void 0!==i.out&&"in"!==n&&s(o,i.out,r),!n&&i.directedSelfLoops>0&&o.splice(o.lastIndexOf(i.key),1)),"directed"!==t&&void 0!==i.undirected&&s(o,i.undirected,r),o}function yt(t,e,n,i,r,s){var o=e?st:rt;"undirected"!==t&&(void 0!==i.in&&"out"!==n&&o(i.in,r,s),i.key!==r&&void 0!==i.out&&"in"!==n&&o(i.out,r,s)),"directed"!==t&&void 0!==i.undirected&&o(i.undirected,r,s)}function vt(t,e,n,i,r,s){var o=e?at:ot;"undirected"!==t&&(void 0!==i.in&&"out"!==n&&o(i.in,r,s)||i.key!==r&&void 0!==i.out&&"in"!==n&&o(i.out,r,s,n?null:i.key))||"directed"===t||void 0===i.undirected||o(i.undirected,r,s)}function _t(t,e,n,i){var r=D.empty();return"undirected"!==t&&(void 0!==n.in&&"out"!==e&&i in n.in&&(r=q(r,lt(n.in,i))),void 0!==n.out&&"in"!==e&&i in n.out&&(r=q(r,lt(n.out,i)))),"directed"!==t&&void 0!==n.undirected&&i in n.undirected&&(r=q(r,lt(n.undirected,i))),r}var wt=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xt(t,e){if(void 0!==e)for(var n in e)t.add(n)}function St(t,e,n){if("mixed"!==t){if("undirected"===t)return Object.keys(n.undirected);if("string"==typeof e)return Object.keys(n[e])}var i=new Set;return"undirected"!==t&&("out"!==e&&xt(i,n.in),"in"!==e&&xt(i,n.out)),"directed"!==t&&xt(i,n.undirected),R(i.values(),i.size)}function Et(t,e,n){for(var i in e){var r=e[i];r instanceof Set&&(r=r.values().next().value);var s=r.source,o=s===t?r.target:s;n(o.key,o.attributes)}}function Ct(t,e,n,i){for(var r in n){var s=n[r];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===e?s.target:o;t.has(a.key)||(t.add(a.key),i(a.key,a.attributes))}}function Ot(t,e,n){for(var i in e){var r=e[i];r instanceof Set&&(r=r.values().next().value);var s=r.source,o=s===t?r.target:s;if(n(o.key,o.attributes))return!0}return!1}function Tt(t,e,n,i){for(var r in n){var s=n[r];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===e?s.target:o;if(!t.has(a.key)&&(t.add(a.key),i(a.key,a.attributes)))return!0}return!1}function kt(t,e){var n=Object.keys(e),i=n.length,r=0;return new D(function(){if(r>=i)return{done:!0};var s=e[n[r++]];s instanceof Set&&(s=s.values().next().value);var o=s.source,a=o===t?s.target:o;return{done:!1,value:[a.key,a.attributes]}})}function At(t,e,n){var i=Object.keys(n),r=i.length,s=0;return new D(function o(){if(s>=r)return{done:!0};var a=n[i[s++]];a instanceof Set&&(a=a.values().next().value);var l=a.source,c=l===e?a.target:l;return t.has(c.key)?o():(t.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function Pt(t,e,n,i,r){var s=t._nodes.get(i);if("undirected"!==e){if("out"!==n&&void 0!==s.in)for(var o in s.in)if(o===r)return!0;if("in"!==n&&void 0!==s.out)for(var a in s.out)if(a===r)return!0}if("directed"!==e&&void 0!==s.undirected)for(var l in s.undirected)if(l===r)return!0;return!1}function It(t,e,n){for(var i,r,s,o,a,l,c,u=e._nodes.values(),h=e.type;!0!==(i=u.next()).done;){if(r=i.value,"undirected"!==h)for(s in o=r.out)if(l=(a=o[s]).target,c=n(r.key,l.key,r.attributes,l.attributes,a.key,a.attributes,a.undirected,a.generatedKey),t&&c)return;if("directed"!==h)for(s in o=r.undirected)if((l=(a=o[s]).target).key!==s&&(l=a.source),c=n(r.key,l.key,r.attributes,l.attributes,a.key,a.attributes,a.undirected,a.generatedKey),t&&c)return}}function Mt(t,e,n){for(var i,r,s,o,a,l,c,u,h,d=e._nodes.values(),p=e.type;!0!==(i=d.next()).done;){if(r=i.value,"undirected"!==p)for(s in l=r.out)for(o=l[s].values();!0!==(a=o.next()).done;)if(u=(c=a.value).target,h=n(r.key,u.key,r.attributes,u.attributes,c.key,c.attributes,c.undirected,c.generatedKey),t&&h)return;if("directed"!==p)for(s in l=r.undirected)for(o=l[s].values();!0!==(a=o.next()).done;)if((u=(c=a.value).target).key!==s&&(u=c.source),h=n(r.key,u.key,r.attributes,u.attributes,c.key,c.attributes,c.undirected,c.generatedKey),t&&h)return}}function Dt(t,e){var n={key:t};return d(e.attributes)||(n.attributes=l({},e.attributes)),n}function Rt(t,e){var n={source:e.source.key,target:e.target.key};return e.generatedKey||(n.key=t),d(e.attributes)||(n.attributes=l({},e.attributes)),e.undirected&&(n.undirected=!0),n}function Nt(t){return h(t)?"key"in t?!("attributes"in t)||h(t.attributes)&&null!==t.attributes?null:"invalid-attributes":"no-key":"not-object"}function Lt(t){return h(t)?"source"in t?"target"in t?!("attributes"in t)||h(t.attributes)&&null!==t.attributes?"undirected"in t&&"boolean"!=typeof t.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var jt=new Set(["directed","undirected","mixed"]),Ft=new Set(["domain","_events","_eventsCount","_maxListeners"]),Bt={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Vt(t,e,n){var i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}function zt(t,e,n,i,r,s,o,a){if(!i&&"undirected"===t.type)throw new F("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===t.type)throw new F("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a&&!h(a))throw new L("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(a,'"'));if(s=""+s,o=""+o,a=a||{},!t.allowSelfLoops&&s===o)throw new F("Graph.".concat(e,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l=t._nodes.get(s),c=t._nodes.get(o);if(!l)throw new j("Graph.".concat(e,': source node "').concat(s,'" not found.'));if(!c)throw new j("Graph.".concat(e,': target node "').concat(o,'" not found.'));var u={key:null,undirected:i,source:s,target:o,attributes:a};if(n&&(r=t._edgeKeyGenerator(u)),t._edges.has(r=""+r))throw new F("Graph.".concat(e,': the "').concat(r,'" edge already exists in the graph.'));if(!t.multi&&(i?void 0!==l.undirected[o]:void 0!==l.out[o]))throw new F("Graph.".concat(e,': an edge linking "').concat(s,'" to "').concat(o,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var d=new U(i,r,n,l,c,a);return t._edges.set(r,d),s===o?i?(l.undirectedSelfLoops++,t._undirectedSelfLoopCount++):(l.directedSelfLoops++,t._directedSelfLoopCount++):i?(l.undirectedDegree++,c.undirectedDegree++):(l.outDegree++,c.inDegree++),H(t,i,d,s,o,l,c),i?t._undirectedSize++:t._directedSize++,u.key=r,t.emit("edgeAdded",u),r}function Ut(t,e,n,i,r,s,o,a,c){if(!i&&"undirected"===t.type)throw new F("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===t.type)throw new F("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a)if(c){if("function"!=typeof a)throw new L("Graph.".concat(e,': invalid updater function. Expecting a function but got "').concat(a,'"'))}else if(!h(a))throw new L("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(a,'"'));var u;if(s=""+s,o=""+o,c&&(u=a,a=void 0),!t.allowSelfLoops&&s===o)throw new F("Graph.".concat(e,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,p,f=t._nodes.get(s),g=t._nodes.get(o);if(!n&&(d=t._edges.get(r))){if(d.source.key!==s||d.target.key!==o||i&&(d.source.key!==o||d.target.key!==s))throw new F("Graph.".concat(e,': inconsistency detected when attempting to merge the "').concat(r,'" edge with "').concat(s,'" source & "').concat(o,'" target vs. ("').concat(d.source.key,'", "').concat(d.target.key,'").'));p=d}if(p||t.multi||!f||(p=i?f.undirected[o]:f.out[o]),p)return(c?u:a)?(c?(p.attributes=u(p.attributes),t.emit("edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})):(l(p.attributes,a),t.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:a})),p.key):p.key;a=a||{},c&&u&&(a=u(a));var m={key:null,undirected:i,source:s,target:o,attributes:a};if(n&&(r=t._edgeKeyGenerator(m)),t._edges.has(r=""+r))throw new F("Graph.".concat(e,': the "').concat(r,'" edge already exists in the graph.'));return f||(f=Vt(t,s,{}),s===o&&(g=f)),g||(g=Vt(t,o,{})),d=new U(i,r,n,f,g,a),t._edges.set(r,d),s===o?i?(f.undirectedSelfLoops++,t._undirectedSelfLoopCount++):(f.directedSelfLoops++,t._directedSelfLoopCount++):i?(f.undirectedDegree++,g.undirectedDegree++):(f.outDegree++,g.inDegree++),H(t,i,d,s,o,f,g),i?t._undirectedSize++:t._directedSize++,m.key=r,t.emit("edgeAdded",m),r}var Ht,$t=function(t){function n(e){var n;if(n=t.call(this)||this,(e=l({},Bt,e)).edgeKeyGenerator&&"function"!=typeof e.edgeKeyGenerator)throw new L("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(e.edgeKeyGenerator,'".'));if("boolean"!=typeof e.multi)throw new L("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(e.multi,'".'));if(!jt.has(e.type))throw new L('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(e.type,'".'));if("boolean"!=typeof e.allowSelfLoops)throw new L("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(e.allowSelfLoops,'".'));var i,r="mixed"===e.type?B:"directed"===e.type?V:z;return p(a(n),"NodeDataClass",r),p(a(n),"_attributes",{}),p(a(n),"_nodes",new Map),p(a(n),"_edges",new Map),p(a(n),"_directedSize",0),p(a(n),"_undirectedSize",0),p(a(n),"_directedSelfLoopCount",0),p(a(n),"_undirectedSelfLoopCount",0),p(a(n),"_edgeKeyGenerator",e.edgeKeyGenerator||(i=0,function(){return i++})),p(a(n),"_options",e),Ft.forEach(function(t){return p(a(n),t,n[t])}),f(a(n),"order",function(){return n._nodes.size}),f(a(n),"size",function(){return n._edges.size}),f(a(n),"directedSize",function(){return n._directedSize}),f(a(n),"undirectedSize",function(){return n._undirectedSize}),f(a(n),"selfLoopCount",function(){return n._directedSelfLoopCount+n._undirectedSelfLoopCount}),f(a(n),"directedSelfLoopCount",function(){return n._directedSelfLoopCount}),f(a(n),"undirectedSelfLoopCount",function(){return n._undirectedSelfLoopCount}),f(a(n),"multi",n._options.multi),f(a(n),"type",n._options.type),f(a(n),"allowSelfLoops",n._options.allowSelfLoops),f(a(n),"implementation",function(){return"graphology"}),n}e(n,t);var i=n.prototype;return i.hasNode=function(t){return this._nodes.has(""+t)},i.hasDirectedEdge=function(t,e){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+t);return!!n&&!n.undirected}if(2===arguments.length){e=""+e;var i=this._nodes.get(t=""+t);if(!i)return!1;var r=i.out[e];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(t,e){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+t);return!!n&&n.undirected}if(2===arguments.length){e=""+e;var i=this._nodes.get(t=""+t);if(!i)return!1;var r=i.undirected[e];return!(!r||this.multi&&!r.size)}throw new L("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(t,e){if(1===arguments.length)return this._edges.has(""+t);if(2===arguments.length){e=""+e;var n=this._nodes.get(t=""+t);if(!n)return!1;var i=void 0!==n.out&&n.out[e];return i||(i=void 0!==n.undirected&&n.undirected[e]),!(!i||this.multi&&!i.size)}throw new L("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(t,e){if("undirected"!==this.type){if(t=""+t,e=""+e,this.multi)throw new F("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(t);if(!n)throw new j('Graph.directedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.directedEdge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.out&&n.out[e]||void 0;return i?i.key:void 0}},i.undirectedEdge=function(t,e){if("directed"!==this.type){if(t=""+t,e=""+e,this.multi)throw new F("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(t);if(!n)throw new j('Graph.undirectedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.undirectedEdge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.undirected&&n.undirected[e]||void 0;return i?i.key:void 0}},i.edge=function(t,e){if(this.multi)throw new F("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e;var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.edge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j('Graph.edge: could not find the "'.concat(e,'" target node in the graph.'));var i=n.out&&n.out[e]||n.undirected&&n.undirected[e]||void 0;if(i)return i.key},i.inDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.inDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.inDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(e?n.directedSelfLoops:0)},i.outDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.outDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.outDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(e?n.directedSelfLoops:0)},i.directedDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.directedDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.directedDegree: could not find the "'.concat(t,'" node in the graph.'));if("undirected"===this.type)return 0;var i=e?n.directedSelfLoops:0;return n.inDegree+i+(n.outDegree+i)},i.undirectedDegree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.undirectedDegree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.undirectedDegree: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:n.undirectedDegree+2*(e?n.undirectedSelfLoops:0)},i.degree=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof e)throw new L('Graph.degree: Expecting a boolean but got "'.concat(e,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.degree: could not find the "'.concat(t,'" node in the graph.'));var i=0,r=0;return"directed"!==this.type&&(e&&(r=n.undirectedSelfLoops),i+=n.undirectedDegree+2*r),"undirected"!==this.type&&(e&&(r=n.directedSelfLoops),i+=n.inDegree+n.outDegree+2*r),i},i.source=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.source: could not find the "'.concat(t,'" edge in the graph.'));return e.source.key},i.target=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.target: could not find the "'.concat(t,'" edge in the graph.'));return e.target.key},i.extremities=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.extremities: could not find the "'.concat(t,'" edge in the graph.'));return[e.source.key,e.target.key]},i.opposite=function(t,e){t=""+t;var n=this._edges.get(e=""+e);if(!n)throw new j('Graph.opposite: could not find the "'.concat(e,'" edge in the graph.'));var i=n.source.key,r=n.target.key;if(t!==i&&t!==r)throw new j('Graph.opposite: the "'.concat(t,'" node is not attached to the "').concat(e,'" edge (').concat(i,", ").concat(r,")."));return t===i?r:i},i.hasExtremity=function(t,e){e=""+e;var n=this._edges.get(t=""+t);if(!n)throw new j('Graph.hasExtremity: could not find the "'.concat(t,'" edge in the graph.'));return n.source.key===e||n.target.key===e},i.isUndirected=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isUndirected: could not find the "'.concat(t,'" edge in the graph.'));return e.undirected},i.isDirected=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isDirected: could not find the "'.concat(t,'" edge in the graph.'));return!e.undirected},i.isSelfLoop=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.isSelfLoop: could not find the "'.concat(t,'" edge in the graph.'));return e.source===e.target},i.hasGeneratedKey=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.hasGeneratedKey: could not find the "'.concat(t,'" edge in the graph.'));return e.generatedKey},i.addNode=function(t,e){return function(t,e,n){if(n&&!h(n))throw new L('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(n=n||{},t._nodes.has(e=""+e))throw new F('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}(this,t,e).key},i.mergeNode=function(t,e){if(e&&!h(e))throw new L('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(e,'"'));e=e||{};var n=this._nodes.get(t=""+t);return n?(e&&(l(n.attributes,e),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:n.attributes,data:e})),t):(n=new this.NodeDataClass(t,e),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:e}),t)},i.updateNode=function(t,e){if(e&&"function"!=typeof e)throw new L('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(e,'"'));var n=this._nodes.get(t=""+t);if(n)return e&&(n.attributes=e(n.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:n.attributes})),t;var i=e?e({}):{};return n=new this.NodeDataClass(t,i),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:i}),t},i.dropNode=function(t){var e=this,n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.dropNode: could not find the "'.concat(t,'" node in the graph.'));this.forEachEdge(t,function(t){e.dropEdge(t)}),this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})},i.dropEdge=function(t){var e;if(arguments.length>1){var n=""+arguments[0],i=""+arguments[1];if(!(e=c(this,n,i,this.type)))throw new j('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(i,'" edge in the graph.'))}else if(!(e=this._edges.get(t=""+t)))throw new j('Graph.dropEdge: could not find the "'.concat(t,'" edge in the graph.'));this._edges.delete(e.key);var r=e.source,s=e.target,o=e.attributes,a=e.undirected;return r===s?a?(r.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(r.directedSelfLoops--,this._directedSelfLoopCount--):a?(r.undirectedDegree--,s.undirectedDegree--):(r.outDegree--,s.inDegree--),$(this,a,e),a?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:t,attributes:o,source:r.key,target:s.key,undirected:a}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(t){return this._attributes[t]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(t){return this._attributes.hasOwnProperty(t)},i.setAttribute=function(t,e){return this._attributes[t]=e,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.updateAttribute=function(t,e){if("function"!=typeof e)throw new L("Graph.updateAttribute: updater should be a function.");return this._attributes[t]=e(this._attributes[t]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.removeAttribute=function(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this},i.replaceAttributes=function(t){if(!h(t))throw new L("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(t){if(!h(t))throw new L("Graph.mergeAttributes: provided attributes are not a plain object.");return l(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this},i.getNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.getNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return n.attributes[e]},i.getNodeAttributes=function(t){var e=this._nodes.get(t=""+t);if(!e)throw new j('Graph.getNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));return e.attributes},i.hasNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return n.attributes.hasOwnProperty(e)},i.setNodeAttribute=function(t,e,n){var i=this._nodes.get(t=""+t);if(!i)throw new j('Graph.setNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return i.attributes[e]=n,this.emit("nodeAttributesUpdated",{key:t,type:"set",attributes:i.attributes,name:e}),this},i.updateNodeAttribute=function(t,e,n){var i=this._nodes.get(t=""+t);if(!i)throw new j('Graph.updateNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));if(arguments.length<3)throw new L("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new L("Graph.updateAttribute: updater should be a function.");var r=i.attributes,s=n(r[e]);return r[e]=s,this.emit("nodeAttributesUpdated",{key:t,type:"set",attributes:i.attributes,name:e}),this},i.removeNodeAttribute=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.hasNodeAttribute: could not find the "'.concat(t,'" node in the graph.'));return delete n.attributes[e],this.emit("nodeAttributesUpdated",{key:t,type:"remove",attributes:n.attributes,name:e}),this},i.replaceNodeAttributes=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.replaceNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));if(!h(e))throw new L("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return n.attributes=e,this.emit("nodeAttributesUpdated",{key:t,type:"replace",attributes:n.attributes}),this},i.mergeNodeAttributes=function(t,e){var n=this._nodes.get(t=""+t);if(!n)throw new j('Graph.mergeNodeAttributes: could not find the "'.concat(t,'" node in the graph.'));if(!h(e))throw new L("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return l(n.attributes,e),this.emit("nodeAttributesUpdated",{key:t,type:"merge",attributes:n.attributes,data:e}),this},i.updateEachNodeAttributes=function(t,e){if("function"!=typeof t)throw new L("Graph.updateEachNodeAttributes: expecting an updater function.");if(e&&!g(e))throw new L("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._nodes.values();!0!==(n=r.next()).done;)(i=n.value).attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:e||null})},i.updateEachEdgeAttributes=function(t,e){if("function"!=typeof t)throw new L("Graph.updateEachEdgeAttributes: expecting an updater function.");if(e&&!g(e))throw new L("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._edges.values();!0!==(n=r.next()).done;)(i=n.value).attributes=t(i.key,i.attributes);this.emit("eachEdgeAttributesUpdated",{hints:e||null})},i.forEach=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?Mt(!1,this,t):It(!1,this,t)},i.forEachUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?Mt(!0,this,t):It(!0,this,t)},i.adjacency=function(){return this.multi?(p=(l=this)._nodes.values(),f=l.type,g="outer",m=null,new D(function t(){var e;if("outer"===g)return!0===(e=p.next()).done?e:(c=e.value,g="directed",t());if("directed"===g)return"undirected"===f?(g="undirected",t()):(h=c.out,u=Object.keys(c.out),d=0,g="inner-directed",t());if("undirected"===g){if("directed"===f)return g="outer",t();h=c.undirected,u=Object.keys(c.undirected),d=0,g="inner-undirected"}if(!m&&d>=u.length)return g="inner-undirected"===g?"outer":"undirected",t();if(!m){var n=u[d++];return m=h[n].values(),t()}if((e=m.next()).done)return m=null,t();var i=e.value,r=i.target;return"inner-undirected"===g&&r.key===c.key&&(r=i.source),{done:!1,value:[c.key,r.key,c.attributes,r.attributes,i.key,i.attributes]}})):(s=(t=this)._nodes.values(),o=t.type,a="outer",new D(function t(){var l;if("outer"===a)return!0===(l=s.next()).done?l:(e=l.value,a="directed",t());if("directed"===a)return"undirected"===o?(a="undirected",t()):(i=e.out,n=Object.keys(e.out),r=0,a="inner-directed",t());if("undirected"===a){if("directed"===o)return a="outer",t();i=e.undirected,n=Object.keys(e.undirected),r=0,a="inner-undirected"}if(r>=n.length)return a="inner-undirected"===a?"outer":"undirected",t();var c=n[r++],u=i[c],h=u.target;return"inner-undirected"===a&&h.key===e.key&&(h=u.source),{done:!1,value:[e.key,h.key,e.attributes,h.attributes,u.key,u.attributes]}}));var t,e,n,i,r,s,o,a,l,c,u,h,d,p,f,g,m},i.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):R(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(t){if("function"!=typeof t)throw new L("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(e,n){t(n,e.attributes)})},i.forEachNodeUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEachNode: expecting a callback.");for(var e,n,i=this._nodes.values();!0!==(e=i.next())&&!t((n=e.value).key,n.attributes););},i.nodeEntries=function(){var t=this._nodes.values();return new D(function(){var e=t.next();if(e.done)return e;var n=e.value;return{value:[n.key,n.attributes],done:!1}})},i.exportNode=function(t){var e=this._nodes.get(t=""+t);if(!e)throw new j('Graph.exportNode: could not find the "'.concat(t,'" node in the graph.'));return Dt(t,e)},i.exportEdge=function(t){var e=this._edges.get(t=""+t);if(!e)throw new j('Graph.exportEdge: could not find the "'.concat(t,'" edge in the graph.'));return Rt(t,e)},i.export=function(){var t=new Array(this._nodes.size),e=0;this._nodes.forEach(function(n,i){t[e++]=Dt(i,n)});var n=new Array(this._edges.size);return e=0,this._edges.forEach(function(t,i){n[e++]=Rt(i,t)}),{attributes:this.getAttributes(),nodes:t,edges:n,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},i.importNode=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Nt(t);if(n){if("not-object"===n)throw new L('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new L("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new L("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var i=t.key,r=t.attributes,s=void 0===r?{}:r;return e?this.mergeNode(i,s):this.addNode(i,s),this},i.importEdge=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Lt(t);if(n){if("not-object"===n)throw new L('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new L("Graph.importEdge: missing souce.");if("no-target"===n)throw new L("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new L("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new L("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var i=t.source,r=t.target,s=t.attributes,o=void 0===s?{}:s,a=t.undirected,l=void 0!==a&&a;return"key"in t?(e?l?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:l?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,t.key,i,r,o):(e?l?this.mergeUndirectedEdge:this.mergeDirectedEdge:l?this.addUndirectedEdge:this.addDirectedEdge).call(this,i,r,o),this},i.import=function(t){var e,n,i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u(t))return this.import(t.export(),r),this;if(!h(t))throw new L("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!h(t.attributes))throw new L("Graph.import: invalid attributes. Expecting a plain object.");r?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new L("Graph.import: invalid nodes. Expecting an array.");for(e=0,n=i.length;en)){var o=new Set;o.add(e.undirected[s]),e.undirected[s]=o,t._nodes.get(s).undirected[n]=o}})),this;var t},i.clearIndex=function(){return this._nodes.forEach(function(t){void 0!==t.in&&(t.in={},t.out={}),void 0!==t.undirected&&(t.undirected={})}),this},i.toJSON=function(){return this.export()},i.toString=function(){return"[object Graph]"},i.inspect=function(){var t=this,e={};this._nodes.forEach(function(t,n){e[n]=t.attributes});var n={},i={};this._edges.forEach(function(e,r){var s=e.undirected?"--":"->",o="",a="(".concat(e.source.key,")").concat(s,"(").concat(e.target.key,")");e.generatedKey?t.multi&&(void 0===i[a]?i[a]=0:i[a]++,o+="".concat(i[a],". ")):o+="[".concat(r,"]: "),n[o+=a]=e.attributes});var r={};for(var s in this)this.hasOwnProperty(s)&&!Ft.has(s)&&"function"!=typeof this[s]&&(r[s]=this[s]);return r.attributes=this._attributes,r.nodes=e,r.edges=n,p(r,"constructor",this.constructor),r},n}(b.exports.EventEmitter);"undefined"!=typeof Symbol&&($t.prototype[Symbol.for("nodejs.util.inspect.custom")]=$t.prototype.inspect),[{name:function(t){return"".concat(t,"Edge")},generateKey:!0},{name:function(t){return"".concat(t,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(t){return"".concat(t,"EdgeWithKey")}},{name:function(t){return"".concat(t,"DirectedEdgeWithKey")},type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(t){["add","merge","update"].forEach(function(e){var n=t.name(e),i="add"===e?zt:Ut;$t.prototype[n]=t.generateKey?function(r,s,o){return i(this,n,!0,"undirected"===(t.type||this.type),null,r,s,o,"update"===e)}:function(r,s,o,a){return i(this,n,!1,"undirected"===(t.type||this.type),r,s,o,a,"update"===e)}})}),"undefined"!=typeof Symbol&&($t.prototype[Symbol.iterator]=$t.prototype.adjacency),Ht=$t,G.forEach(function(t){var e=t.name,n=t.attacher;n(Ht,e("Edge"),"mixed"),n(Ht,e("DirectedEdge"),"directed"),n(Ht,e("UndirectedEdge"),"undirected")}),function(t){X.forEach(function(e){var n,i,r,s;r=(n=e).type,s=n.direction,t.prototype[i=n.name]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return ct(this,r);if(1===arguments.length){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));return pt(this.multi,"mixed"===r?this.type:r,s,n)}if(2===arguments.length){e=""+e;var o=this._nodes.get(t=""+t);if(!o)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(i,': could not find the "').concat(e,'" target node in the graph.'));return bt(r,this.multi,s,o,e)}throw new L("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(t,e,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return ut(this,i,n=t);if(2===arguments.length){n=e;var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));return ft(this.multi,"mixed"===i?this.type:i,r,o,n)}if(3===arguments.length){e=""+e;var a=this._nodes.get(t=""+t);if(!a)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(s,': could not find the "').concat(e,'" target node in the graph.'));return yt(i,this.multi,r,a,e,n)}throw new L("Graph.".concat(s,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(t,e),function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";t.prototype[s]=function(t,e,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return ht(this,i,n=t);if(2===arguments.length){n=e;var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));return gt(this.multi,"mixed"===i?this.type:i,r,o,n)}if(3===arguments.length){e=""+e;var a=this._nodes.get(t=""+t);if(!a)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(s,': could not find the "').concat(e,'" target node in the graph.'));return vt(i,this.multi,r,a,e,n)}throw new L("Graph.".concat(s,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(t,e),function(t,e){var n=e.type,i=e.direction,r=e.name.slice(0,-1)+"Entries";t.prototype[r]=function(t,e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return D.empty();if(!arguments.length)return dt(this,n);if(1===arguments.length){var s=this._nodes.get(t=""+t);if(!s)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));return mt(n,i,s)}if(2===arguments.length){e=""+e;var o=this._nodes.get(t=""+t);if(!o)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new j("Graph.".concat(r,': could not find the "').concat(e,'" target node in the graph.'));return _t(n,i,o,e)}throw new L("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e)})}($t),function(t){wt.forEach(function(e){var n,i,r,s;r=(n=e).type,s=n.direction,t.prototype[i=n.name]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var e=""+arguments[0],n=""+arguments[1];if(!this._nodes.has(e))throw new j("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));if(!this._nodes.has(n))throw new j("Graph.".concat(i,': could not find the "').concat(n,'" node in the graph.'));return Pt(this,r,s,e,n)}if(1===arguments.length){var o=this._nodes.get(t=""+t);if(void 0===o)throw new j("Graph.".concat(i,': could not find the "').concat(t,'" node in the graph.'));return St("mixed"===r?this.type:r,s,o)}throw new L("Graph.".concat(i,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(t,e){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));!function(t,e,n,i){if("mixed"!==t){if("undirected"===t)return Et(n,n.undirected,i);if("string"==typeof e)return Et(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Ct(r,n,n.in,i),"in"!==e&&Ct(r,n,n.out,i)),"directed"!==t&&Ct(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,e)}}}(t,e),function(t,e){var n=e.name,i=e.type,r=e.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1)+"Until";t.prototype[s]=function(t,e){if("mixed"===i||"mixed"===this.type||i===this.type){var n=this._nodes.get(t=""+t);if(void 0===n)throw new j("Graph.".concat(s,': could not find the "').concat(t,'" node in the graph.'));!function(t,e,n,i){if("mixed"!==t){if("undirected"===t)return Ot(n,n.undirected,i);if("string"==typeof e)return Ot(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Tt(r,n,n.in,i)||"in"!==e&&Tt(r,n,n.out,i))||"directed"===t||Tt(r,n,n.undirected,i)}("mixed"===i?this.type:i,r,n,e)}}}(t,e),function(t,e){var n=e.type,i=e.direction,r=e.name.slice(0,-1)+"Entries";t.prototype[r]=function(t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return D.empty();var e=this._nodes.get(t=""+t);if(void 0===e)throw new j("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return kt(n,n.undirected);if("string"==typeof e)return kt(n,n[e])}var i=D.empty(),r=new Set;return"undirected"!==t&&("out"!==e&&(i=q(i,At(r,n,n.in))),"in"!==e&&(i=q(i,At(r,n,n.out)))),"directed"!==t&&(i=q(i,At(r,n,n.undirected))),i}("mixed"===n?this.type:n,i,e)}}(t,e)})}($t);var Gt=function(t){function n(e){var n=l({type:"directed"},e);if("multi"in n&&!1!==n.multi)throw new L("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new L('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),Wt=function(t){function n(e){var n=l({type:"undirected"},e);if("multi"in n&&!1!==n.multi)throw new L("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new L('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),qt=function(t){function n(e){var n=l({multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return t.call(this,n)||this}return e(n,t),n}($t),Xt=function(t){function n(e){var n=l({type:"directed",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new L('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t),Yt=function(t){function n(e){var n=l({type:"undirected",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new L("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new L('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}($t);function Kt(t){t.from=function(e,n){var i=l({},e.options,n),r=new t(i);return r.import(e),r}}return Kt($t),Kt(Gt),Kt(Wt),Kt(qt),Kt(Xt),Kt(Yt),$t.Graph=$t,$t.DirectedGraph=Gt,$t.UndirectedGraph=Wt,$t.MultiGraph=qt,$t.MultiDirectedGraph=Xt,$t.MultiUndirectedGraph=Yt,$t.InvalidArgumentsGraphError=L,$t.NotFoundGraphError=j,$t.UsageGraphError=F,$t}()},11524:function(t,e,n){var i;!function(r,s,o,a){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=s.createElement("div"),h=Math.round,d=Math.abs,p=Date.now;function f(t,e,n){return setTimeout(w(t,n),e)}function g(t,e,n){return!!Array.isArray(t)&&(m(t,n[e],n),!0)}function m(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==a)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=r.console&&(r.console.warn||r.console.log);return s&&s.call(r.console,i,n),t.apply(this,arguments)}}l="function"!=typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n-1}function k(t){return t.trim().split(/\s+/g)}function A(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function M(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),s=0;s1&&!n.firstMultiple?n.firstMultiple=$(e):1===r&&(n.firstMultiple=!1);var s=n.firstInput,o=n.firstMultiple,l=o?o.center:s.center,c=e.center=G(i);e.timeStamp=p(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Y(l,c),e.distance=X(l,c),function(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},s=t.prevInput||{};(1===e.eventType||4===s.eventType)&&(r=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}(n,e),e.offsetDirection=q(e.deltaX,e.deltaY);var u=W(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=d(u.x)>d(u.y)?u.x:u.y,e.scale=o?function(t,e){return X(e[0],e[1],z)/X(t[0],t[1],z)}(o.pointers,i):1,e.rotation=o?function(t,e){return Y(e[1],e[0],z)+Y(t[1],t[0],z)}(o.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,r,s,o=t.lastInterval||e,l=e.timeStamp-o.timeStamp;if(8!=e.eventType&&(l>25||o.velocity===a)){var c=e.deltaX-o.deltaX,u=e.deltaY-o.deltaY,h=W(l,c,u);i=h.x,r=h.y,n=d(h.x)>d(h.y)?h.x:h.y,s=q(c,u),t.lastInterval=e}else n=o.velocity,i=o.velocityX,r=o.velocityY,s=o.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=s}(n,e);var h=t.element;O(e.srcEvent.target,h)&&(h=e.srcEvent.target),e.target=h}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function $(t){for(var e=[],n=0;n=d(e)?t<0?2:4:e<0?8:16}function X(t,e,n){n||(n=V);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function Y(t,e,n){return n||(n=V),180*Math.atan2(e[n[1]]-t[n[1]],e[n[0]]-t[n[0]])/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(R(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},Q="mousedown",Z="mousemove mouseup";function J(){this.evEl=Q,this.evWin=Z,this.pressed=!1,U.apply(this,arguments)}_(J,U,{handler:function(t){var e=K[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:B,srcEvent:t}))}});var tt={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},et={2:F,3:"pen",4:B,5:"kinect"},nt="pointerdown",it="pointermove pointerup pointercancel";function rt(){this.evEl=nt,this.evWin=it,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(nt="MSPointerDown",it="MSPointerMove MSPointerUp MSPointerCancel"),_(rt,U,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=tt[i],s=et[t.pointerType]||t.pointerType,o=s==F,a=A(e,t.pointerId,"pointerId");1&r&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):12&r&&(n=!0),!(a<0)&&(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),n&&e.splice(a,1))}});var st={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ot="touchstart",at="touchstart touchmove touchend touchcancel";function lt(){this.evTarget=ot,this.evWin=at,this.started=!1,U.apply(this,arguments)}function ct(t,e){var n=P(t.touches),i=P(t.changedTouches);return 12&e&&(n=I(n.concat(i),"identifier",!0)),[n,i]}_(lt,U,{handler:function(t){var e=st[t.type];if(1===e&&(this.started=!0),this.started){var n=ct.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:F,srcEvent:t})}}});var ut={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ht="touchstart touchmove touchend touchcancel";function dt(){this.evTarget=ht,this.targetIds={},U.apply(this,arguments)}function pt(t,e){var n=P(t.touches),i=this.targetIds;if(3&e&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,s,o=P(t.changedTouches),a=[],l=this.target;if(s=n.filter(function(t){return O(t.target,l)}),1===e)for(r=0;r-1&&i.splice(t,1)},2500)}}function bt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function i(n){e.manager.emit(n,t)}n<8&&i(e.options.event+kt(n)),i(e.options.event),t.additionalEvent&&i(t.additionalEvent),n>=8&&i(e.options.event+kt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return It.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=At(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(Dt,It,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[xt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){1!==t.scale&&(t.additionalEvent=this.options.event+(t.scale<1?"in":"out")),this._super.emit.call(this,t)}}),_(Rt,Tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!n||12&t.eventType&&!r)this.reset();else if(1&t.eventType)this.reset(),this._timer=f(function(){this.state=8,this.tryEmit()},e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),_(Nt,It,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[xt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Lt,It,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Mt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&d(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=At(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(jt,Tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[wt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance"']/g,W=RegExp($.source),q=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,it=/\s/,rt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,ot=/,? & /,at=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,ft=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,vt=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Ct="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tt="["+_t+"]",kt="["+Ot+"]",At="["+wt+"]",Pt="\\d+",It="["+xt+"]",Mt="["+St+"]",Dt="[^"+_t+Ot+Pt+xt+St+Et+"]",Rt="\\ud83c[\\udffb-\\udfff]",Nt="[^"+_t+"]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Et+"]",Bt="(?:"+Mt+"|"+Dt+")",Vt="(?:"+Ft+"|"+Dt+")",zt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ut="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+At+"|"+Rt+")?",$t="["+Ct+"]?",Gt=$t+Ht+"(?:\\u200d(?:"+[Nt,Lt,jt].join("|")+")"+$t+Ht+")*",Wt="(?:"+[It,Lt,jt].join("|")+")"+Gt,qt="(?:"+[Nt+At+"?",At,Lt,jt,Tt].join("|")+")",Xt=RegExp("['\u2019]","g"),Yt=RegExp(At,"g"),Kt=RegExp(Rt+"(?="+Rt+")|"+qt+Gt,"g"),Qt=RegExp([Ft+"?"+Mt+"+"+zt+"(?="+[kt,Ft,"$"].join("|")+")",Vt+"+"+Ut+"(?="+[kt,Ft+Bt,"$"].join("|")+")",Ft+"?"+Bt+"+"+zt,Ft+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pt,Wt].join("|"),"g"),Zt=RegExp("[\\u200d"+_t+wt+Ct+"]"),Jt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,te=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ee=-1,ne={};ne[M]=ne[D]=ne[R]=ne[N]=ne[L]=ne[j]=ne[F]=ne[B]=ne[V]=!0,ne[f]=ne[g]=ne[P]=ne[m]=ne[I]=ne[b]=ne[y]=ne[v]=ne[w]=ne[x]=ne[S]=ne[C]=ne[O]=ne[T]=ne[A]=!1;var ie={};ie[f]=ie[g]=ie[P]=ie[I]=ie[m]=ie[b]=ie[M]=ie[D]=ie[R]=ie[N]=ie[L]=ie[w]=ie[x]=ie[S]=ie[C]=ie[O]=ie[T]=ie[k]=ie[j]=ie[F]=ie[B]=ie[V]=!0,ie[y]=ie[v]=ie[A]=!1;var re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,oe=parseInt,ae="object"==typeof global&&global&&global.Object===Object&&global,le="object"==typeof self&&self&&self.Object===Object&&self,ce=ae||le||Function("return this")(),ue=e&&!e.nodeType&&e,he=ue&&t&&!t.nodeType&&t,de=he&&he.exports===ue,pe=de&&ae.process,fe=function(){try{return he&&he.require&&he.require("util").types||pe&&pe.binding&&pe.binding("util")}catch(t){}}(),ge=fe&&fe.isArrayBuffer,me=fe&&fe.isDate,be=fe&&fe.isMap,ye=fe&&fe.isRegExp,ve=fe&&fe.isSet,_e=fe&&fe.isTypedArray;function we(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,i){for(var r=-1,s=null==t?0:t.length;++r-1}function ke(t,e,n){for(var i=-1,r=null==t?0:t.length;++i-1;);return n}function Qe(t,e){for(var n=t.length;n--&&je(e,t[n],0)>-1;);return n}function Ze(t,e){for(var n=t.length,i=0;n--;)t[n]===e&&++i;return i}var Je=Ue({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),tn=Ue({"&":"&","<":"<",">":">",'"':""","'":"'"});function en(t){return"\\"+re[t]}function nn(t){return Zt.test(t)}function rn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,i){n[++e]=[i,t]}),n}function sn(t,e){return function(n){return t(e(n))}}function on(t,e){for(var n=-1,i=t.length,r=0,s=[];++n",""":'"',"'":"'"}),dn=function t(e){var n,i=(e=null==e?ce:dn.defaults(ce.Object(),e,dn.pick(ce,te))).Array,it=e.Date,_t=e.Error,wt=e.Function,xt=e.Math,St=e.Object,Et=e.RegExp,Ct=e.String,Ot=e.TypeError,Tt=i.prototype,kt=St.prototype,At=e["__core-js_shared__"],Pt=wt.prototype.toString,It=kt.hasOwnProperty,Mt=0,Dt=(n=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Rt=kt.toString,Nt=Pt.call(St),Lt=ce._,jt=Et("^"+Pt.call(It).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ft=de?e.Buffer:r,Bt=e.Symbol,Vt=e.Uint8Array,zt=Ft?Ft.allocUnsafe:r,Ut=sn(St.getPrototypeOf,St),Ht=St.create,$t=kt.propertyIsEnumerable,Gt=Tt.splice,Wt=Bt?Bt.isConcatSpreadable:r,qt=Bt?Bt.iterator:r,Kt=Bt?Bt.toStringTag:r,Zt=function(){try{var t=os(St,"defineProperty");return t({},"",{}),t}catch(Is){}}(),re=e.clearTimeout!==ce.clearTimeout&&e.clearTimeout,ae=it&&it.now!==ce.Date.now&&it.now,le=e.setTimeout!==ce.setTimeout&&e.setTimeout,ue=xt.ceil,he=xt.floor,pe=St.getOwnPropertySymbols,fe=Ft?Ft.isBuffer:r,Re=e.isFinite,Ue=Tt.join,pn=sn(St.keys,St),fn=xt.max,gn=xt.min,mn=it.now,bn=e.parseInt,yn=xt.random,vn=Tt.reverse,_n=os(e,"DataView"),wn=os(e,"Map"),xn=os(e,"Promise"),Sn=os(e,"Set"),En=os(e,"WeakMap"),Cn=os(St,"create"),On=En&&new En,Tn={},kn=Ns(_n),An=Ns(wn),Pn=Ns(xn),In=Ns(Sn),Mn=Ns(En),Dn=Bt?Bt.prototype:r,Rn=Dn?Dn.valueOf:r,Nn=Dn?Dn.toString:r;function Ln(t){if(Jo(t)&&!Uo(t)&&!(t instanceof Vn)){if(t instanceof Bn)return t;if(It.call(t,"__wrapped__"))return Ls(t)}return new Bn(t)}var jn=function(){function t(){}return function(e){if(!Zo(e))return{};if(Ht)return Ht(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function Fn(){}function Bn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function ri(t,e,n,i,s,o){var a,l=1&e,c=2&e,u=4&e;if(n&&(a=s?n(t,i,s,o):n(t)),a!==r)return a;if(!Zo(t))return t;var h=Uo(t);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&It.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Er(t,a)}else{var d=cs(t),p=d==v||d==_;if(Wo(t))return yr(t,l);if(d==S||d==f||p&&!s){if(a=c||p?{}:hs(t),!l)return c?function(t,e){return Cr(t,ls(t),e)}(t,function(t,e){return t&&Cr(e,Pa(e),t)}(a,t)):function(t,e){return Cr(t,as(t),e)}(t,ti(a,t))}else{if(!ie[d])return s?t:{};a=function(t,e,n){var i=t.constructor;switch(e){case P:return vr(t);case m:case b:return new i(+t);case I:return function(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case M:case D:case R:case N:case L:case j:case F:case B:case V:return _r(t,n);case w:return new i;case x:case T:return new i(t);case C:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new i;case k:return function(t){return Rn?St(Rn.call(t)):{}}(t)}}(t,d,l)}}o||(o=new Gn);var g=o.get(t);if(g)return g;o.set(t,a),ra(t)?t.forEach(function(i){a.add(ri(i,e,n,i,t,o))}):ta(t)&&t.forEach(function(i,r){a.set(r,ri(i,e,n,r,t,o))});var y=h?r:(u?c?Jr:Zr:c?Pa:Aa)(t);return Se(y||t,function(i,r){y&&(i=t[r=i]),Qn(a,r,ri(i,e,n,r,t,o))}),a}function si(t,e,n){var i=n.length;if(null==t)return!i;for(t=St(t);i--;){var s=n[i],o=t[s];if(o===r&&!(s in t)||!(0,e[s])(o))return!1}return!0}function oi(t,e,n){if("function"!=typeof t)throw new Ot(s);return Os(function(){t.apply(r,n)},e)}function ai(t,e,n,i){var r=-1,s=Te,o=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=Ae(e,qe(n))),i?(s=ke,o=!1):e.length>=200&&(s=Ye,o=!1,e=new $n(e));t:for(;++r-1},Un.prototype.set=function(t,e){var n=this.__data__,i=Zn(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new zn,map:new(wn||Un),string:new zn}},Hn.prototype.delete=function(t){var e=rs(this,t).delete(t);return this.size-=e?1:0,e},Hn.prototype.get=function(t){return rs(this,t).get(t)},Hn.prototype.has=function(t){return rs(this,t).has(t)},Hn.prototype.set=function(t,e){var n=rs(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},$n.prototype.add=$n.prototype.push=function(t){return this.__data__.set(t,o),this},$n.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new Un,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Un){var i=n.__data__;if(!wn||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Hn(i)}return n.set(t,e),this.size=n.size,this};var li=kr(mi),ci=kr(bi,!0);function ui(t,e){var n=!0;return li(t,function(t,i,r){return n=!!e(t,i,r)}),n}function hi(t,e,n){for(var i=-1,s=t.length;++i0&&n(a)?e>1?pi(a,e-1,n,i,r):Pe(r,a):i||(r[r.length]=a)}return r}var fi=Ar(),gi=Ar(!0);function mi(t,e){return t&&fi(t,e,Aa)}function bi(t,e){return t&&gi(t,e,Aa)}function yi(t,e){return Oe(e,function(e){return Yo(t[e])})}function vi(t,e){for(var n=0,i=(e=fr(e,t)).length;null!=t&&ne}function Si(t,e){return null!=t&&It.call(t,e)}function Ei(t,e){return null!=t&&e in St(t)}function Ci(t,e,n){for(var s=n?ke:Te,o=t[0].length,a=t.length,l=a,c=i(a),u=1/0,h=[];l--;){var d=t[l];l&&e&&(d=Ae(d,qe(e))),u=gn(d.length,u),c[l]=!n&&(e||o>=120&&d.length>=120)?new $n(l&&d):r}d=t[0];var p=-1,f=c[0];t:for(;++p=a?l:l*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)});i--;)t[i]=t[i].value;return t}(Ri(t,function(t,n,r){return{criteria:Ae(e,function(e){return e(t)}),index:++i,value:t}}))}function Vi(t,e,n){for(var i=-1,r=e.length,s={};++i-1;)a!==t&&Gt.call(a,l,1),Gt.call(t,l,1);return t}function Ui(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==s){var s=r;ps(r)?Gt.call(t,r,1):or(t,r)}}return t}function Hi(t,e){return t+he(yn()*(e-t+1))}function $i(t,e){var n="";if(!t||e<1||e>h)return n;do{e%2&&(n+=t),(e=he(e/2))&&(t+=t)}while(e);return n}function Gi(t,e){return Ts(ws(t,e,el),t+"")}function Wi(t){return qn(Fa(t))}function qi(t,e){var n=Fa(t);return Ps(n,ii(e,0,n.length))}function Xi(t,e,n,i){if(!Zo(t))return t;for(var s=-1,o=(e=fr(e,t)).length,a=o-1,l=t;null!=l&&++ss?0:s+e),(n=n>s?s:n)<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;for(var o=i(s);++r>>1,o=t[s];null!==o&&!oa(o)&&(n?o<=e:o=200){var c=e?null:$r(t);if(c)return an(c);o=!1,r=Ye,l=new $n}else l=e?[]:a;t:for(;++i=i?t:Zi(t,e,n)}var br=re||function(t){return ce.clearTimeout(t)};function yr(t,e){if(e)return t.slice();var n=t.length,i=zt?zt(n):new t.constructor(n);return t.copy(i),i}function vr(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function _r(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function wr(t,e){if(t!==e){var n=t!==r,i=null===t,s=t==t,o=oa(t),a=e!==r,l=null===e,c=e==e,u=oa(e);if(!l&&!u&&!o&&t>e||o&&a&&c&&!l&&!u||i&&a&&c||!n&&c||!s)return 1;if(!i&&!o&&!u&&t1?n[s-1]:r,a=s>2?n[2]:r;for(o=t.length>3&&"function"==typeof o?(s--,o):r,a&&fs(n[0],n[1],a)&&(o=s<3?r:o,s=1),e=St(e);++i-1?s[o?e[a]:a]:r}}function Rr(t){return Qr(function(e){var n=e.length,i=n,o=Bn.prototype.thru;for(t&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new Ot(s);if(o&&!l&&"wrapper"==es(a))var l=new Bn([],!0)}for(i=l?i:n;++i1&&v.reverse(),p&&hl))return!1;var u=o.get(t),h=o.get(e);if(u&&h)return u==e&&h==t;var d=-1,p=!0,f=2&n?new $n:r;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(rt,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Se(p,function(n){var i="_."+n[0];e&n[1]&&!Te(t,i)&&t.push(i)}),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(ot):[]}(i),n)))}function As(t){var e=0,n=0;return function(){var i=mn(),s=16-(i-n);if(n=i,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Ps(t,e){var n=-1,i=t.length,s=i-1;for(e=e===r?i:e;++n1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,no(t,n)});function co(t){var e=Ln(t);return e.__chain__=!0,e}function uo(t,e){return e(t)}var ho=Qr(function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,s=function(e){return ni(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Vn&&ps(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:uo,args:[s],thisArg:r}),new Bn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(r),t})):this.thru(s)}),po=Or(function(t,e,n){It.call(t,n)?++t[n]:ei(t,n,1)}),fo=Dr(Vs),go=Dr(zs);function mo(t,e){return(Uo(t)?Se:li)(t,is(e,3))}function bo(t,e){return(Uo(t)?Ee:ci)(t,is(e,3))}var yo=Or(function(t,e,n){It.call(t,n)?t[n].push(e):ei(t,n,[e])}),vo=Gi(function(t,e,n){var r=-1,s="function"==typeof e,o=$o(t)?i(t.length):[];return li(t,function(t){o[++r]=s?we(e,t,n):Oi(t,e,n)}),o}),_o=Or(function(t,e,n){ei(t,n,e)});function wo(t,e){return(Uo(t)?Ae:Ri)(t,is(e,3))}var xo=Or(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),So=Gi(function(t,e){if(null==t)return[];var n=e.length;return n>1&&fs(t,e[0],e[1])?e=[]:n>2&&fs(e[0],e[1],e[2])&&(e=[e[0]]),Bi(t,pi(e,1),[])}),Eo=ae||function(){return ce.Date.now()};function Co(t,e,n){return e=n?r:e,Wr(t,c,r,r,r,r,e=t&&null==e?t.length:e)}function Oo(t,e){var n;if("function"!=typeof e)throw new Ot(s);return t=da(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var To=Gi(function(t,e,n){var i=1;if(n.length){var r=on(n,ns(To));i|=l}return Wr(t,i,e,n,r)}),ko=Gi(function(t,e,n){var i=3;if(n.length){var r=on(n,ns(ko));i|=l}return Wr(e,i,t,n,r)});function Ao(t,e,n){var i,o,a,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new Ot(s);function g(e){var n=i,s=o;return i=o=r,h=e,l=t.apply(s,n)}function m(t){return h=t,c=Os(y,e),d?g(t):l}function b(t){var n=t-u;return u===r||n>=e||n<0||p&&t-h>=a}function y(){var t=Eo();if(b(t))return v(t);c=Os(y,function(t){var n=e-(t-u);return p?gn(n,a-(t-h)):n}(t))}function v(t){return c=r,f&&i?g(t):(i=o=r,l)}function _(){var t=Eo(),n=b(t);if(i=arguments,o=this,u=t,n){if(c===r)return m(u);if(p)return br(c),c=Os(y,e),g(u)}return c===r&&(c=Os(y,e)),l}return e=fa(e)||0,Zo(n)&&(d=!!n.leading,a=(p="maxWait"in n)?fn(fa(n.maxWait)||0,e):a,f="trailing"in n?!!n.trailing:f),_.cancel=function(){c!==r&&br(c),h=0,i=u=o=c=r},_.flush=function(){return c===r?l:v(Eo())},_}var Po=Gi(function(t,e){return oi(t,1,e)}),Io=Gi(function(t,e,n){return oi(t,fa(e)||0,n)});function Mo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(s);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(Mo.Cache||Hn),n}function Do(t){if("function"!=typeof t)throw new Ot(s);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Mo.Cache=Hn;var Ro=gr(function(t,e){var n=(e=1==e.length&&Uo(e[0])?Ae(e[0],qe(is())):Ae(pi(e,1),qe(is()))).length;return Gi(function(i){for(var r=-1,s=gn(i.length,n);++r=e}),zo=Ti(function(){return arguments}())?Ti:function(t){return Jo(t)&&It.call(t,"callee")&&!$t.call(t,"callee")},Uo=i.isArray,Ho=ge?qe(ge):function(t){return Jo(t)&&wi(t)==P};function $o(t){return null!=t&&Qo(t.length)&&!Yo(t)}function Go(t){return Jo(t)&&$o(t)}var Wo=fe||fl,qo=me?qe(me):function(t){return Jo(t)&&wi(t)==b};function Xo(t){if(!Jo(t))return!1;var e=wi(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!na(t)}function Yo(t){if(!Zo(t))return!1;var e=wi(t);return e==v||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ko(t){return"number"==typeof t&&t==da(t)}function Qo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function Zo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Jo(t){return null!=t&&"object"==typeof t}var ta=be?qe(be):function(t){return Jo(t)&&cs(t)==w};function ea(t){return"number"==typeof t||Jo(t)&&wi(t)==x}function na(t){if(!Jo(t)||wi(t)!=S)return!1;var e=Ut(t);if(null===e)return!0;var n=It.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Nt}var ia=ye?qe(ye):function(t){return Jo(t)&&wi(t)==C},ra=ve?qe(ve):function(t){return Jo(t)&&cs(t)==O};function sa(t){return"string"==typeof t||!Uo(t)&&Jo(t)&&wi(t)==T}function oa(t){return"symbol"==typeof t||Jo(t)&&wi(t)==k}var aa=_e?qe(_e):function(t){return Jo(t)&&Qo(t.length)&&!!ne[wi(t)]},la=zr(Di),ca=zr(function(t,e){return t<=e});function ua(t){if(!t)return[];if($o(t))return sa(t)?cn(t):Er(t);if(qt&&t[qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qt]());var e=cs(t);return(e==w?rn:e==O?an:Fa)(t)}function ha(t){return t?(t=fa(t))===u||t===-u?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function da(t){var e=ha(t),n=e%1;return e==e?n?e-n:e:0}function pa(t){return t?ii(da(t),0,d):0}function fa(t){if("number"==typeof t)return t;if(oa(t))return NaN;if(Zo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Zo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=We(t);var n=pt.test(t);return n||gt.test(t)?oe(t.slice(2),n?2:8):dt.test(t)?NaN:+t}function ga(t){return Cr(t,Pa(t))}function ma(t){return null==t?"":rr(t)}var ba=Tr(function(t,e){if(ys(e)||$o(e))Cr(e,Aa(e),t);else for(var n in e)It.call(e,n)&&Qn(t,n,e[n])}),ya=Tr(function(t,e){Cr(e,Pa(e),t)}),va=Tr(function(t,e,n,i){Cr(e,Pa(e),t,i)}),_a=Tr(function(t,e,n,i){Cr(e,Aa(e),t,i)}),wa=Qr(ni),xa=Gi(function(t,e){t=St(t);var n=-1,i=e.length,s=i>2?e[2]:r;for(s&&fs(e[0],e[1],s)&&(i=1);++n1),e}),Cr(t,Jr(t),n),i&&(n=ri(n,7,Yr));for(var r=e.length;r--;)or(n,e[r]);return n}),Ra=Qr(function(t,e){return null==t?{}:function(t,e){return Vi(t,e,function(e,n){return Ca(t,n)})}(t,e)});function Na(t,e){if(null==t)return{};var n=Ae(Jr(t),function(t){return[t]});return e=is(e),Vi(t,n,function(t,n){return e(t,n[0])})}var La=Gr(Aa),ja=Gr(Pa);function Fa(t){return null==t?[]:Xe(t,Aa(t))}var Ba=Ir(function(t,e,n){return e=e.toLowerCase(),t+(n?Va(e):e)});function Va(t){return Xa(ma(t).toLowerCase())}function za(t){return(t=ma(t))&&t.replace(bt,Je).replace(Yt,"")}var Ua=Ir(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ha=Ir(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),$a=Pr("toLowerCase"),Ga=Ir(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Wa=Ir(function(t,e,n){return t+(n?" ":"")+Xa(e)}),qa=Ir(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Xa=Pr("toUpperCase");function Ya(t,e,n){return t=ma(t),(e=n?r:e)===r?function(t){return Jt.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(at)||[]}(t):t.match(e)||[]}var Ka=Gi(function(t,e){try{return we(t,r,e)}catch(Ms){return Xo(Ms)?Ms:new _t(Ms)}}),Qa=Qr(function(t,e){return Se(e,function(e){e=Rs(e),ei(t,e,To(t[e],t))}),t});function Za(t){return function(){return t}}var Ja=Rr(),tl=Rr(!0);function el(t){return t}function nl(t){return Ii("function"==typeof t?t:ri(t,1))}var il=Gi(function(t,e){return function(n){return Oi(n,t,e)}}),rl=Gi(function(t,e){return function(n){return Oi(t,n,e)}});function sl(t,e,n){var i=Aa(e),r=yi(e,i);null==n&&(!Zo(e)||!r.length&&i.length)&&(n=e,e=t,t=this,r=yi(e,Aa(e)));var s=!(Zo(n)&&"chain"in n&&!n.chain),o=Yo(t);return Se(r,function(n){var i=e[n];t[n]=i,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__),r=n.__actions__=Er(this.__actions__);return r.push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,Pe([this.value()],arguments))})}),t}function ol(){}var al=Fr(Ae),ll=Fr(Ce),cl=Fr(De);function ul(t){return gs(t)?ze(Rs(t)):function(t){return function(e){return vi(e,t)}}(t)}var hl=Vr(),dl=Vr(!0);function pl(){return[]}function fl(){return!1}var gl=jr(function(t,e){return t+e},0),ml=Hr("ceil"),bl=jr(function(t,e){return t/e},1),yl=Hr("floor"),vl=jr(function(t,e){return t*e},1),_l=Hr("round"),wl=jr(function(t,e){return t-e},0);return Ln.after=function(t,e){if("function"!=typeof e)throw new Ot(s);return t=da(t),function(){if(--t<1)return e.apply(this,arguments)}},Ln.ary=Co,Ln.assign=ba,Ln.assignIn=ya,Ln.assignInWith=va,Ln.assignWith=_a,Ln.at=wa,Ln.before=Oo,Ln.bind=To,Ln.bindAll=Qa,Ln.bindKey=ko,Ln.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Uo(t)?t:[t]},Ln.chain=co,Ln.chunk=function(t,e,n){e=(n?fs(t,e,n):e===r)?1:fn(da(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=i(ue(s/e));os?0:s+n),(i=i===r||i>s?s:da(i))<0&&(i+=s),i=n>i?0:pa(i);n>>0)?(t=ma(t))&&("string"==typeof e||null!=e&&!ia(e))&&!(e=rr(e))&&nn(t)?mr(cn(t),0,n):t.split(e,n):[]},Ln.spread=function(t,e){if("function"!=typeof t)throw new Ot(s);return e=null==e?0:fn(da(e),0),Gi(function(n){var i=n[e],r=mr(n,0,e);return i&&Pe(r,i),we(t,this,r)})},Ln.tail=function(t){var e=null==t?0:t.length;return e?Zi(t,1,e):[]},Ln.take=function(t,e,n){return t&&t.length?Zi(t,0,(e=n||e===r?1:da(e))<0?0:e):[]},Ln.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?Zi(t,(e=i-(e=n||e===r?1:da(e)))<0?0:e,i):[]},Ln.takeRightWhile=function(t,e){return t&&t.length?lr(t,is(e,3),!1,!0):[]},Ln.takeWhile=function(t,e){return t&&t.length?lr(t,is(e,3)):[]},Ln.tap=function(t,e){return e(t),t},Ln.throttle=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new Ot(s);return Zo(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Ao(t,e,{leading:i,maxWait:e,trailing:r})},Ln.thru=uo,Ln.toArray=ua,Ln.toPairs=La,Ln.toPairsIn=ja,Ln.toPath=function(t){return Uo(t)?Ae(t,Rs):oa(t)?[t]:Er(Ds(ma(t)))},Ln.toPlainObject=ga,Ln.transform=function(t,e,n){var i=Uo(t),r=i||Wo(t)||aa(t);if(e=is(e,4),null==n){var s=t&&t.constructor;n=r?i?new s:[]:Zo(t)&&Yo(s)?jn(Ut(t)):{}}return(r?Se:mi)(t,function(t,i,r){return e(n,t,i,r)}),n},Ln.unary=function(t){return Co(t,1)},Ln.union=Zs,Ln.unionBy=Js,Ln.unionWith=to,Ln.uniq=function(t){return t&&t.length?sr(t):[]},Ln.uniqBy=function(t,e){return t&&t.length?sr(t,is(e,2)):[]},Ln.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?sr(t,r,e):[]},Ln.unset=function(t,e){return null==t||or(t,e)},Ln.unzip=eo,Ln.unzipWith=no,Ln.update=function(t,e,n){return null==t?t:ar(t,e,pr(n))},Ln.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:ar(t,e,pr(n),i)},Ln.values=Fa,Ln.valuesIn=function(t){return null==t?[]:Xe(t,Pa(t))},Ln.without=io,Ln.words=Ya,Ln.wrap=function(t,e){return No(pr(e),t)},Ln.xor=ro,Ln.xorBy=so,Ln.xorWith=oo,Ln.zip=ao,Ln.zipObject=function(t,e){return hr(t||[],e||[],Qn)},Ln.zipObjectDeep=function(t,e){return hr(t||[],e||[],Xi)},Ln.zipWith=lo,Ln.entries=La,Ln.entriesIn=ja,Ln.extend=ya,Ln.extendWith=va,sl(Ln,Ln),Ln.add=gl,Ln.attempt=Ka,Ln.camelCase=Ba,Ln.capitalize=Va,Ln.ceil=ml,Ln.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=fa(n))==n?n:0),e!==r&&(e=(e=fa(e))==e?e:0),ii(fa(t),e,n)},Ln.clone=function(t){return ri(t,4)},Ln.cloneDeep=function(t){return ri(t,5)},Ln.cloneDeepWith=function(t,e){return ri(t,5,e="function"==typeof e?e:r)},Ln.cloneWith=function(t,e){return ri(t,4,e="function"==typeof e?e:r)},Ln.conformsTo=function(t,e){return null==e||si(t,e,Aa(e))},Ln.deburr=za,Ln.defaultTo=function(t,e){return null==t||t!=t?e:t},Ln.divide=bl,Ln.endsWith=function(t,e,n){t=ma(t),e=rr(e);var i=t.length,s=n=n===r?i:ii(da(n),0,i);return(n-=e.length)>=0&&t.slice(n,s)==e},Ln.eq=Fo,Ln.escape=function(t){return(t=ma(t))&&q.test(t)?t.replace(G,tn):t},Ln.escapeRegExp=function(t){return(t=ma(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Ln.every=function(t,e,n){var i=Uo(t)?Ce:ui;return n&&fs(t,e,n)&&(e=r),i(t,is(e,3))},Ln.find=fo,Ln.findIndex=Vs,Ln.findKey=function(t,e){return Ne(t,is(e,3),mi)},Ln.findLast=go,Ln.findLastIndex=zs,Ln.findLastKey=function(t,e){return Ne(t,is(e,3),bi)},Ln.floor=yl,Ln.forEach=mo,Ln.forEachRight=bo,Ln.forIn=function(t,e){return null==t?t:fi(t,is(e,3),Pa)},Ln.forInRight=function(t,e){return null==t?t:gi(t,is(e,3),Pa)},Ln.forOwn=function(t,e){return t&&mi(t,is(e,3))},Ln.forOwnRight=function(t,e){return t&&bi(t,is(e,3))},Ln.get=Ea,Ln.gt=Bo,Ln.gte=Vo,Ln.has=function(t,e){return null!=t&&us(t,e,Si)},Ln.hasIn=Ca,Ln.head=Hs,Ln.identity=el,Ln.includes=function(t,e,n,i){t=$o(t)?t:Fa(t),n=n&&!i?da(n):0;var r=t.length;return n<0&&(n=fn(r+n,0)),sa(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&je(t,e,n)>-1},Ln.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:da(n);return r<0&&(r=fn(i+r,0)),je(t,e,r)},Ln.inRange=function(t,e,n){return e=ha(e),n===r?(n=e,e=0):n=ha(n),function(t,e,n){return t>=gn(e,n)&&t=-h&&t<=h},Ln.isSet=ra,Ln.isString=sa,Ln.isSymbol=oa,Ln.isTypedArray=aa,Ln.isUndefined=function(t){return t===r},Ln.isWeakMap=function(t){return Jo(t)&&cs(t)==A},Ln.isWeakSet=function(t){return Jo(t)&&"[object WeakSet]"==wi(t)},Ln.join=function(t,e){return null==t?"":Ue.call(t,e)},Ln.kebabCase=Ua,Ln.last=qs,Ln.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var s=i;return n!==r&&(s=(s=da(n))<0?fn(i+s,0):gn(s,i-1)),e==e?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(t,e,s):Le(t,Be,s,!0)},Ln.lowerCase=Ha,Ln.lowerFirst=$a,Ln.lt=la,Ln.lte=ca,Ln.max=function(t){return t&&t.length?hi(t,el,xi):r},Ln.maxBy=function(t,e){return t&&t.length?hi(t,is(e,2),xi):r},Ln.mean=function(t){return Ve(t,el)},Ln.meanBy=function(t,e){return Ve(t,is(e,2))},Ln.min=function(t){return t&&t.length?hi(t,el,Di):r},Ln.minBy=function(t,e){return t&&t.length?hi(t,is(e,2),Di):r},Ln.stubArray=pl,Ln.stubFalse=fl,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=vl,Ln.nth=function(t,e){return t&&t.length?Fi(t,da(e)):r},Ln.noConflict=function(){return ce._===this&&(ce._=Lt),this},Ln.noop=ol,Ln.now=Eo,Ln.pad=function(t,e,n){t=ma(t);var i=(e=da(e))?ln(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return Br(he(r),n)+t+Br(ue(r),n)},Ln.padEnd=function(t,e,n){t=ma(t);var i=(e=da(e))?ln(t):0;return e&&ie){var i=t;t=e,e=i}if(n||t%1||e%1){var s=yn();return gn(t+s*(e-t+se("1e-"+((s+"").length-1))),e)}return Hi(t,e)},Ln.reduce=function(t,e,n){var i=Uo(t)?Ie:He,r=arguments.length<3;return i(t,is(e,4),n,r,li)},Ln.reduceRight=function(t,e,n){var i=Uo(t)?Me:He,r=arguments.length<3;return i(t,is(e,4),n,r,ci)},Ln.repeat=function(t,e,n){return e=(n?fs(t,e,n):e===r)?1:da(e),$i(ma(t),e)},Ln.replace=function(){var t=arguments,e=ma(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Ln.result=function(t,e,n){var i=-1,s=(e=fr(e,t)).length;for(s||(s=1,t=r);++ih)return[];var n=d,i=gn(t,d);e=is(e),t-=d;for(var r=Ge(i,e);++n=o)return t;var l=n-ln(i);if(l<1)return i;var c=a?mr(a,0,l).join(""):t.slice(0,l);if(s===r)return c+i;if(a&&(l+=c.length-l),ia(s)){if(t.slice(l).search(s)){var u,h=c;for(s.global||(s=Et(s.source,ma(ht.exec(s))+"g")),s.lastIndex=0;u=s.exec(h);)var d=u.index;c=c.slice(0,d===r?l:d)}}else if(t.indexOf(rr(s),l)!=l){var p=c.lastIndexOf(s);p>-1&&(c=c.slice(0,p))}return c+i},Ln.unescape=function(t){return(t=ma(t))&&W.test(t)?t.replace($,hn):t},Ln.uniqueId=function(t){var e=++Mt;return ma(t)+e},Ln.upperCase=qa,Ln.upperFirst=Xa,Ln.each=mo,Ln.eachRight=bo,Ln.first=Hs,sl(Ln,function(){var t={};return mi(Ln,function(e,n){It.call(Ln.prototype,n)||(t[n]=e)}),t}(),{chain:!1}),Ln.VERSION="4.17.21",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Ln[t].placeholder=Ln}),Se(["drop","take"],function(t,e){Vn.prototype[t]=function(n){n=n===r?1:fn(da(n),0);var i=this.__filtered__&&!e?new Vn(this):this.clone();return i.__filtered__?i.__takeCount__=gn(n,i.__takeCount__):i.__views__.push({size:gn(n,d),type:t+(i.__dir__<0?"Right":"")}),i},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Se(["filter","map","takeWhile"],function(t,e){var n=e+1,i=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:is(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}}),Se(["head","last"],function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}}),Se(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}}),Vn.prototype.compact=function(){return this.filter(el)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Gi(function(t,e){return"function"==typeof t?new Vn(this):this.map(function(n){return Oi(n,t,e)})}),Vn.prototype.reject=function(t){return this.filter(Do(is(t)))},Vn.prototype.slice=function(t,e){t=da(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=da(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(d)},mi(Vn.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),s=Ln[i?"take"+("last"==e?"Right":""):e],o=i||/^find/.test(e);!s||(Ln.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,l=e instanceof Vn,c=a[0],u=l||Uo(e),h=function(t){var e=s.apply(Ln,Pe([t],a));return i&&d?e[0]:e};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=o&&!d,g=l&&!p;if(!o&&u){e=g?e:new Vn(this);var m=t.apply(e,a);return m.__actions__.push({func:uo,args:[h],thisArg:r}),new Bn(m,d)}return f&&g?t.apply(this,a):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})}),Se(["pop","push","shift","sort","splice","unshift"],function(t){var e=Tt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Ln.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(Uo(r)?r:[],t)}return this[n](function(n){return e.apply(Uo(n)?n:[],t)})}}),mi(Vn.prototype,function(t,e){var n=Ln[e];if(n){var i=n.name+"";It.call(Tn,i)||(Tn[i]=[]),Tn[i].push({name:e,func:n})}}),Tn[Nr(r,2).name]=[{name:"wrapper",func:r}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Er(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Er(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Er(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Uo(t),i=e<0,r=n?t.length:0,s=function(t,e,n){for(var i=-1,r=n.length;++i=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Ln.prototype.plant=function(t){for(var e,n=this;n instanceof Fn;){var i=Ls(n);i.__index__=0,i.__values__=r,e?s.__wrapped__=i:e=i;var s=i;n=n.__wrapped__}return s.__wrapped__=t,e},Ln.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:uo,args:[Qs],thisArg:r}),new Bn(e,this.__chain__)}return this.thru(Qs)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return cr(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,qt&&(Ln.prototype[qt]=function(){return this}),Ln}();ce._=dn,(i=(function(){return dn}).call(e,n,e,t))!==r&&(t.exports=i)}).call(this)},5478:function(t){t.exports=function(){"use strict";function t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i={exports:{}};function r(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}i.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:r,changeDefaults:function(t){i.exports.defaults=t}};var s=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,c={"&":"&","<":"<",">":">",'"':""","'":"'"},u=function(t){return c[t]};var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(t){return t.replace(h,function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""})}var p=/(^|[^\[])\^/g;var f=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var m={},b=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(t,e){m[" "+t]||(m[" "+t]=b.test(t)?t+"/":w(t,"/",!0));var n=-1===(t=m[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(y,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(v,"$1")+e:t+e}function w(t,e,n){var i=t.length;if(0===i)return"";for(var r=0;r1;)1&e&&(n+=t),e>>=1,t+=t;return n+t},P=i.exports.defaults,I=w,M=function(t,e){var n=t.replace(/\|/g,function(t,e,n){for(var i=!1,r=e;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/),i=0;if(n.length>e)n.splice(e);else for(;n.length1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t){var e=this.rules.block.code.exec(t);if(e){var n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:I(n,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map(function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=i.length?t.slice(i.length):t}).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e){var n=e[2].trim();if(/#$/.test(n)){var i=I(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n}}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:M(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){var n,i,r,s,o,a,l,c,u,h=e[0],d=e[2],p=d.length>1,f={type:"list",raw:h,ordered:p,start:p?+d.slice(0,-1):"",loose:!1,items:[]},g=e[0].match(this.rules.block.item),m=!1,b=g.length;r=this.rules.block.listItemStart.exec(g[0]);for(var y=0;yr[1].length:s[1].length>=r[0].length||s[1].length>3){g.splice(y,2,g[y]+(!this.options.pedantic&&s[1].length/i.test(i[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):D(i[0]):i[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=e[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;var i=I(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=R(e[2],"()");if(r>-1){var s=(0===e[0].indexOf("!")?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,s).trim(),e[3]=""}}var o=e[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);l&&(o=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o.slice(1):o.slice(1,-1)),N(e,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:a&&a.replace(this.rules.inline._escapes,"$1")},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=e[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return N(n,i,n[0])}},e.emStrong=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(t);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var s,o,a=i[0].length-1,l=a,c=0,u="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+a);null!=(i=u.exec(e));)if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6]){if(o=s.length,i[3]||i[4]){l+=o;continue}if((i[5]||i[6])&&a%3&&!((a+o)%3)){c+=o;continue}if(!((l-=o)>0))return o=Math.min(o,o+l+c),Math.min(a,o)%2?{type:"em",raw:t.slice(0,a+i.index+o+1),text:t.slice(1,a+i.index+o)}:{type:"strong",raw:t.slice(0,a+i.index+o+1),text:t.slice(2,a+i.index+o-1)}}}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=D(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2]}},e.autolink=function(t,e){var n,i,r=this.rules.inline.autolink.exec(t);if(r)return i="@"===r[2]?"mailto:"+(n=D(this.options.mangle?e(r[1]):r[1])):n=D(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var i,r;if("@"===n[2])r="mailto:"+(i=D(this.options.mangle?e(n[0]):n[0]));else{var s;do{s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(s!==n[0]);i=D(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},e.inlineText=function(t,e,n){var i,r=this.rules.inline.text.exec(t);if(r)return i=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):D(r[0]):r[0]:D(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},t}(),j=O,F=E,B=T,V={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:j,table:j,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};V.def=F(V.def).replace("label",V._label).replace("title",V._title).getRegex(),V.bullet=/(?:[*+-]|\d{1,9}[.)])/,V.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,V.item=F(V.item,"gm").replace(/bull/g,V.bullet).getRegex(),V.listItemStart=F(/^( *)(bull) */).replace("bull",V.bullet).getRegex(),V.list=F(V.list).replace(/bull/g,V.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+V.def.source+")").getRegex(),V._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V._comment=/|$)/,V.html=F(V.html,"i").replace("comment",V._comment).replace("tag",V._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),V.paragraph=F(V._paragraph).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.blockquote=F(V.blockquote).replace("paragraph",V.paragraph).getRegex(),V.normal=B({},V),V.gfm=B({},V.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),V.gfm.nptable=F(V.gfm.nptable).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.gfm.table=F(V.gfm.table).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.pedantic=B({},V.normal,{html:F("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",V._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:j,paragraph:F(V.normal._paragraph).replace("hr",V.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",V.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:j,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};z.punctuation=F(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,z.escapedEmSt=/\\\*|\\_/g,z._comment=F(V._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),z.emStrong.lDelim=F(z.emStrong.lDelim).replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimAst=F(z.emStrong.rDelimAst,"g").replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimUnd=F(z.emStrong.rDelimUnd,"g").replace(/punct/g,z._punctuation).getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,z.autolink=F(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=F(z.tag).replace("comment",z._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=F(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=F(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=F(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=B({},z),z.pedantic=B({},z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:F(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=B({},z.normal,{escape:F(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var K=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||$,this.options.tokenizer=this.options.tokenizer||new H,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:G.normal,inline:W.normal};this.options.pedantic?(e.block=G.pedantic,e.inline=W.pedantic):this.options.gfm&&(e.block=G.gfm,e.inline=this.options.breaks?W.breaks:W.gfm),this.tokenizer.rules=e}e.lex=function(t,n){return new e(n).lex(t)},e.lexInline=function(t,n){return new e(n).inlineTokens(t)};var n=e.prototype;return n.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(t,e,n){var i,r,s,o,a,l,c=this;for(void 0===e&&(e=[]),void 0===n&&(n=!0),this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(n){return!!(i=n.call(c,t,e))&&(t=t.substring(i.raw.length),e.push(i),!0)}))){if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length),i.type&&e.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length),(o=e[e.length-1])&&"paragraph"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.nptable(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),e.push(i);continue}if(i=this.tokenizer.list(t)){for(t=t.substring(i.raw.length),s=i.items.length,r=0;r=0&&(e=Math.min(e,i))}),e<1/0&&e>=0&&(a=t.substring(0,e+1))}(),n&&(i=this.tokenizer.paragraph(a))){o=e[e.length-1],l&&"paragraph"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i),l=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length),(o=e[e.length-1])&&"text"===o.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text):e.push(i);continue}if(t){var u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}throw new Error(u)}}return e},n.inline=function(t){var e,n,i,r,s,o,a=t.length;for(e=0;e0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,l.index)+"["+q("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,l.index)+"["+q("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,l.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(c||(u=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(n){return!!(s=n.call(r,t,e))&&(t=t.substring(s.raw.length),e.push(s),!0)}))){if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.tag(t,n,i)){t=t.substring(s.raw.length),n=s.inLink,i=s.inRawBlock,(o=e[e.length-1])&&"text"===s.type&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,i)),e.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length),o=e[e.length-1],"link"===s.type?(s.tokens=this.inlineTokens(s.text,[],!0,i),e.push(s)):o&&"text"===s.type&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(s=this.tokenizer.emStrong(t,h,u)){t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,i),e.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,i),e.push(s);continue}if(s=this.tokenizer.autolink(t,Y)){t=t.substring(s.raw.length),e.push(s);continue}if(!n&&(s=this.tokenizer.url(t,Y))){t=t.substring(s.raw.length),e.push(s);continue}if(a=t,this.options.extensions&&this.options.extensions.startInline&&function(){var e=1/0,n=t.slice(1),i=void 0;r.options.extensions.startInline.forEach(function(t){"number"==typeof(i=t.call(this,n))&&i>=0&&(e=Math.min(e,i))}),e<1/0&&e>=0&&(a=t.substring(0,e+1))}(),s=this.tokenizer.inlineText(a,i,X)){t=t.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(u=s.raw.slice(-1)),c=!0,(o=e[e.length-1])&&"text"===o.type?(o.raw+=s.raw,o.text+=s.text):e.push(s);continue}if(t){var p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}throw new Error(p)}}return e},function(e,n,i){n&&t(e.prototype,n),i&&t(e,i)}(e,null,[{key:"rules",get:function(){return{block:G,inline:W}}}]),e}(),Q=i.exports.defaults,Z=C,J=x,tt=function(){function t(t){this.options=t||Q}var e=t.prototype;return e.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,i);null!=r&&r!==t&&(n=!0,t=r)}return t=t.replace(/\n$/,"")+"\n",i?'
    '+(n?t:J(t,!0))+"
    \n":"
    "+(n?t:J(t,!0))+"
    \n"},e.blockquote=function(t){return"
    \n"+t+"
    \n"},e.html=function(t){return t},e.heading=function(t,e,n,i){return this.options.headerIds?"'+t+"\n":""+t+"\n"},e.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},e.list=function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"\n"},e.listitem=function(t){return"
  • "+t+"
  • \n"},e.checkbox=function(t){return" "},e.paragraph=function(t){return"

    "+t+"

    \n"},e.table=function(t,e){return e&&(e=""+e+""),"\n\n"+t+"\n"+e+"
    \n"},e.tablerow=function(t){return"\n"+t+"\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"\n"},e.strong=function(t){return""+t+""},e.em=function(t){return""+t+""},e.codespan=function(t){return""+t+""},e.br=function(){return this.options.xhtml?"
    ":"
    "},e.del=function(t){return""+t+""},e.link=function(t,e,n){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return n;var i='"+n+""},e.image=function(t,e,n){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return n;var i=''+n+'":">")},e.text=function(t){return t},t}(),et=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),nt=function(){function t(){this.seen={}}var e=t.prototype;return e.serialize=function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},e.getNextSafeSlug=function(t,e){var n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do{n=t+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=i,this.seen[n]=0),n},e.slug=function(t,e){void 0===e&&(e={});var n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)},t}(),it=tt,rt=et,st=nt,ot=i.exports.defaults,at=S,lt=K,ct=function(){function t(t){this.options=t||ot,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rt,this.slugger=new st}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,i,r,s,o,a,l,c,u,h,d,p,f,g,m,b,y,v,_,w="",x=t.length;for(n=0;n0&&"text"===m.tokens[0].type?(m.tokens[0].text=v+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=v+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:v}):g+=v),g+=this.parse(m.tokens,f),u+=this.renderer.listitem(g,y,b);w+=this.renderer.list(u,d,p);continue;case"html":w+=this.renderer.html(h.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+mt(l.message+"",!0)+"
    ";throw l}}return _t.options=_t.setOptions=function(t){return ft(_t.defaults,t),yt(_t.defaults),_t},_t.getDefaults=bt,_t.defaults=vt,_t.use=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;iAn error occurred:

    "+mt(i.message+"",!0)+"
    ";throw i}},_t.Parser=ct,_t.parser=ct.parse,_t.Renderer=ht,_t.TextRenderer=dt,_t.Lexer=lt,_t.lexer=lt.lex,_t.Tokenizer=ut,_t.Slugger=pt,_t.parse=_t,_t}()},29369:function(t,e,n){var i=n(56284),r=n(67830);function s(){this.clear()}s.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},s.prototype.enqueue=function(t){return this.items.push(t),++this.size},s.prototype.dequeue=function(){if(this.size){var t=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,t}},s.prototype.peek=function(){if(this.size)return this.items[this.offset]},s.prototype.forEach=function(t,e){e=arguments.length>1?e:this;for(var n=this.offset,i=0,r=this.items.length;n=t.length)return{done:!0};var n=t[e];return e++,{value:n,done:!1}})},s.prototype.entries=function(){var t=this.items,e=this.offset,n=0;return new i(function(){if(e>=t.length)return{done:!0};var i=t[e];return e++,{value:[n++,i],done:!1}})},"undefined"!=typeof Symbol&&(s.prototype[Symbol.iterator]=s.prototype.values),s.prototype.toString=function(){return this.toArray().join(",")},s.prototype.toJSON=function(){return this.toArray()},s.prototype.inspect=function(){var t=this.toArray();return Object.defineProperty(t,"constructor",{value:s,enumerable:!1}),t},"undefined"!=typeof Symbol&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(t){var e=new s;return r(t,function(t){e.enqueue(t)}),e},s.of=function(){return s.from(arguments)},t.exports=s},65593:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(72293),o=function(t){function e(){t.apply(this,arguments),this.value=null,this.hasNext=!1,this.hasCompleted=!1}return i(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),s.Subscription.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(r.Subject);e.AsyncSubject=o},73907:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(6594),o=function(t){function e(e){t.call(this),this._value=e}return i(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new s.ObjectUnsubscribedError;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(r.Subject);e.BehaviorSubject=o},36888:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n,i){t.call(this),this.parent=e,this.outerValue=n,this.outerIndex=i,this.index=0}return i(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n(42109).Subscriber);e.InnerSubscriber=r},94429:function(t,e,n){"use strict";var i=n(18705),r=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return i.Observable.of(this.value);case"E":return i.Observable.throw(this.error);case"C":return i.Observable.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();e.Notification=r},18705:function(t,e,n){"use strict";var i=n(80019),r=n(18154),s=n(45783),o=n(10142),a=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var i=this.operator,s=r.toSubscriber(t,e,n);if(i?i.call(s,this.source):s.add(this.source||!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var n=this;if(e||(i.root.Rx&&i.root.Rx.config&&i.root.Rx.config.Promise?e=i.root.Rx.config.Promise:i.root.Promise&&(e=i.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,i){var r;r=n.subscribe(function(e){if(r)try{t(e)}catch(n){i(n),r.unsubscribe()}else t(e)},i,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[s.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;ee&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i},e}(r.Subject);e.ReplaySubject=u;var h=function(t,e){this.time=t,this.value=e}},25430:function(t,e,n){"use strict";var i=n(2369);e.xQ=i.Subject,n(18705),n(24769),n(95914),n(88007),n(3194),n(61898),n(16301),n(23276),n(66593),n(13745),n(57362),n(24518),n(68789),n(30520),n(67370),n(86866),n(11505),n(5031),n(36780),n(17038),n(15718),n(27915),n(90763),n(6846),n(65662),n(6799),n(81854),n(612),n(10838),n(6725),n(8827),n(43511),n(38922),n(25178),n(56937),n(22947),n(82894),n(11206),n(94183),n(16653),n(17930),n(81118),n(50317),n(90674),n(66460),n(79232),n(3945),n(44674),n(73505),n(38749),n(16479),n(22744),n(44475),n(97384),n(8237),n(24937),n(99013),n(84042),n(44436),n(7099),n(6217),n(57476),n(72646),n(91573),n(27387),n(27366),n(88859),n(65425),n(16733),n(23381),n(80404),n(63770),n(53626),n(98851),n(84878),n(26544),n(53582),n(61749),n(34838),n(49681),n(46227),n(56455),n(40881),n(94315),n(92910),n(52442),n(84664),n(61250),n(28310),n(43027),n(18252),n(49571),n(31782),n(9800),n(41854),n(74839),n(1305),n(99144),n(89952),n(85863),n(2865),n(92667),n(22185),n(72919),n(88630),n(75458),n(40780),n(35099),n(57502),n(81676),n(20579),n(71323),n(84950),n(57113),n(95073),n(75654),n(59889),n(96611),n(81845),n(7828),n(4881),n(74568),n(32352),n(50169),n(93543),n(61690),n(15914),n(68583),n(44808),n(49088),n(72293),n(42109),n(65593),n(81959),n(73907),n(51493),n(94429),n(44640),n(11758),n(6594),n(13815),n(84536),n(73390),n(62688),n(24482),n(18353);n(55298);n(10142);n(85522),n(90680),n(97088),n(12948),n(28592),n(72121),n(45783);n(39053)},11965:function(t,e){"use strict";var n=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=Date.now?Date.now:function(){return+new Date},t}();e.Scheduler=n},2369:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(42109),o=n(72293),a=n(6594),l=n(9060),c=n(28592),u=function(t){function e(e){t.call(this,e),this.destination=e}return i(e,t),e}(s.Subscriber);e.SubjectSubscriber=u;var h=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return i(e,t),e.prototype[c.rxSubscriber]=function(){return new u(this)},e.prototype.lift=function(t){var e=new d(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,n=e.length,i=e.slice(),r=0;r=t.length)return void i.complete();i.next(e[n]),t.index=n+1,this.schedule(t)}},e.prototype._subscribe=function(t){var n=this.arrayLike,i=this.scheduler,r=n.length;if(i)return i.schedule(e.dispatch,0,{arrayLike:n,index:0,length:r,subscriber:t});for(var s=0;s1?new e(t,i):1===r?new s.ScalarObservable(t[0],i):new o.EmptyObservable(i)},e.dispatch=function(t){var e=t.array,n=t.index,i=t.subscriber;n>=t.count?i.complete():(i.next(e[n]),!i.closed&&(t.index=n+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.array,i=n.length,r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{array:n,index:0,count:i,subscriber:t});for(var s=0;s1)this.connection=null;else{var n=this.connection,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null}}(o.Subscriber)},34078:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(93658),o=n(84308),a=function(t){function e(e){t.call(this),this.observableFactory=e}return i(e,t),e.create=function(t){return new e(t)},e.prototype._subscribe=function(t){return new l(t,this.observableFactory)},e}(r.Observable);e.DeferObservable=a;var l=function(t){function e(e,n){t.call(this,e),this.factory=n,this.tryDefer()}return i(e,t),e.prototype.tryDefer=function(){try{this._callFactory()}catch(t){this._error(t)}},e.prototype._callFactory=function(){var t=this.factory();t&&this.add(s.subscribeToResult(this,t))},e}(o.OuterSubscriber)},70481:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e){t.call(this),this.scheduler=e}return i(e,t),e.create=function(t){return new e(t)},e.dispatch=function(t){t.subscriber.complete()},e.prototype._subscribe=function(t){var n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{subscriber:t});t.complete()},e}(n(18705).Observable);e.EmptyObservable=r},72210:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this),this.error=e,this.scheduler=n}return i(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){t.subscriber.error(t.error)},e.prototype._subscribe=function(t){var n=this.error,i=this.scheduler;if(t.syncErrorThrowable=!0,i)return i.schedule(e.dispatch,0,{error:n,subscriber:t});t.error(n)},e}(n(18705).Observable);e.ErrorObservable=r},56064:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(70481),o=n(48242),a=n(93658),l=n(84308),c=function(t){function e(e,n){t.call(this),this.sources=e,this.resultSelector=n}return i(e,t),e.create=function(){for(var t=[],n=0;nu?u:e:e}(t)),this.arr=t,this.idx=e,this.len=n}return t.prototype[o.iterator]=function(){return this},t.prototype.next=function(){return this.idx=t.count?i.complete():(i.next(e),!i.closed&&(t.index=n+1,t.start=e+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=0,i=this.start,r=this._count,s=this.scheduler;if(s)return s.schedule(e.dispatch,0,{index:n,count:r,start:i,subscriber:t});for(;;){if(n++>=r){t.complete();break}if(t.next(i++),t.closed)break}},e}(n(18705).Observable);e.RangeObservable=r},80478:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this),this.value=e,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return i(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){var e=t.value,n=t.subscriber;t.done?n.complete():(n.next(e),!n.closed&&(t.done=!0,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.value,i=this.scheduler;if(i)return i.schedule(e.dispatch,0,{done:!1,value:n,subscriber:t});t.next(n),t.closed||t.complete()},e}(n(18705).Observable);e.ScalarObservable=r},82966:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(85522),o=n(39479),a=function(t){function e(e,n,i){void 0===n&&(n=0),void 0===i&&(i=s.asap),t.call(this),this.source=e,this.delayTime=n,this.scheduler=i,(!o.isNumeric(n)||n<0)&&(this.delayTime=0),(!i||"function"!=typeof i.schedule)&&(this.scheduler=s.asap)}return i(e,t),e.create=function(t,n,i){return void 0===n&&(n=0),void 0===i&&(i=s.asap),new e(t,n,i)},e.dispatch=function(t){return this.add(t.source.subscribe(t.subscriber))},e.prototype._subscribe=function(t){return this.scheduler.schedule(e.dispatch,this.delayTime,{source:this.source,subscriber:t})},e}(r.Observable);e.SubscribeOnObservable=a},92870:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(39479),s=n(18705),o=n(90680),a=n(41503),l=n(783),c=function(t){function e(e,n,i){void 0===e&&(e=0),t.call(this),this.period=-1,this.dueTime=0,r.isNumeric(n)?this.period=Number(n)<1?1:Number(n):a.isScheduler(n)&&(i=n),a.isScheduler(i)||(i=o.async),this.scheduler=i,this.dueTime=l.isDate(e)?+e-this.scheduler.now():e}return i(e,t),e.create=function(t,n,i){return void 0===t&&(t=0),new e(t,n,i)},e.dispatch=function(t){var e=t.index,n=t.period,i=t.subscriber;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}},e.prototype._subscribe=function(t){var n=this;return n.scheduler.schedule(e.dispatch,n.dueTime,{index:0,period:n.period,subscriber:t})},e}(s.Observable);e.TimerObservable=c},16196:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(18705),s=n(93658),o=n(84308),a=function(t){function e(e,n){t.call(this),this.resourceFactory=e,this.observableFactory=n}return i(e,t),e.create=function(t,n){return new e(t,n)},e.prototype._subscribe=function(t){var e,n=this.resourceFactory,i=this.observableFactory;try{return e=n(),new l(t,e,i)}catch(r){t.error(r)}},e}(r.Observable);e.UsingObservable=a;var l=function(t){function e(e,n,i){t.call(this,e),this.resource=n,this.observableFactory=i,e.add(n),this.tryUse()}return i(e,t),e.prototype.tryUse=function(){try{var t=this.observableFactory.call(this,this.resource);t&&this.add(s.subscribeToResult(this,t))}catch(e){this._error(e)}},e}(o.OuterSubscriber)},59246:function(t,e,n){"use strict";var i=n(19183);e.bindCallback=i.BoundCallbackObservable.create},65571:function(t,e,n){"use strict";var i=n(78655);e.bindNodeCallback=i.BoundNodeCallbackObservable.create},24669:function(t,e,n){"use strict";var i=n(41503),r=n(48242),s=n(96177),o=n(49134);e.combineLatest=function(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof l&&(n=t.pop()),null===a&&1===t.length&&t[0]instanceof i.Observable?t[0]:o.mergeAll(n)(new r.ArrayObservable(t,a))}},94503:function(t,e,n){"use strict";var i=n(20143);e.never=i.NeverObservable.create},69657:function(t,e,n){"use strict";var i=n(96177);e.of=i.ArrayObservable.of},61395:function(t,e,n){"use strict";var i=n(46243);e.onErrorResumeNext=i.onErrorResumeNextStatic},95425:function(t,e,n){"use strict";var i=n(19770);e.pairs=i.PairsObservable.create},24330:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(48242),s=n(96177),o=n(84308),a=n(93658);e.race=function(){for(var t=[],e=0;e=2&&(o=arguments[1]);var a=Number.POSITIVE_INFINITY;return e>=3&&(a=arguments[2]),s.bufferTime(t,o,a,n)(this)}},92523:function(t,e,n){"use strict";var i=n(15440);e.bufferToggle=function(t,e){return i.bufferToggle(t,e)(this)}},49436:function(t,e,n){"use strict";var i=n(51786);e.bufferWhen=function(t){return i.bufferWhen(t)(this)}},64731:function(t,e,n){"use strict";var i=n(93017);e._catch=function(t){return i.catchError(t)(this)}},92273:function(t,e,n){"use strict";var i=n(17054);e.combineAll=function(t){return i.combineAll(t)(this)}},8709:function(t,e,n){"use strict";var i=n(49134);e.combineLatest=function(){for(var t=[],e=0;e=2?i.reduce(t,e)(this):i.reduce(t)(this)}},12931:function(t,e,n){"use strict";var i=n(15329);e.repeat=function(t){return void 0===t&&(t=-1),i.repeat(t)(this)}},68816:function(t,e,n){"use strict";var i=n(63964);e.repeatWhen=function(t){return i.repeatWhen(t)(this)}},17144:function(t,e,n){"use strict";var i=n(40241);e.retry=function(t){return void 0===t&&(t=-1),i.retry(t)(this)}},82766:function(t,e,n){"use strict";var i=n(23896);e.retryWhen=function(t){return i.retryWhen(t)(this)}},62068:function(t,e,n){"use strict";var i=n(92043);e.sample=function(t){return i.sample(t)(this)}},97013:function(t,e,n){"use strict";var i=n(90680),r=n(71239);e.sampleTime=function(t,e){return void 0===e&&(e=i.async),r.sampleTime(t,e)(this)}},98996:function(t,e,n){"use strict";var i=n(64949);e.scan=function(t,e){return arguments.length>=2?i.scan(t,e)(this):i.scan(t)(this)}},77033:function(t,e,n){"use strict";var i=n(88948);e.sequenceEqual=function(t,e){return i.sequenceEqual(t,e)(this)}},10377:function(t,e,n){"use strict";var i=n(35473);e.share=function(){return i.share()(this)}},71623:function(t,e,n){"use strict";var i=n(62704);e.shareReplay=function(t,e,n){return i.shareReplay(t,e,n)(this)}},91956:function(t,e,n){"use strict";var i=n(92223);e.single=function(t){return i.single(t)(this)}},72355:function(t,e,n){"use strict";var i=n(11189);e.skip=function(t){return i.skip(t)(this)}},69329:function(t,e,n){"use strict";var i=n(73346);e.skipLast=function(t){return i.skipLast(t)(this)}},68481:function(t,e,n){"use strict";var i=n(12928);e.skipUntil=function(t){return i.skipUntil(t)(this)}},587:function(t,e,n){"use strict";var i=n(69415);e.skipWhile=function(t){return i.skipWhile(t)(this)}},49292:function(t,e,n){"use strict";var i=n(30673);e.startWith=function(){for(var t=[],e=0;e0&&this.destination.next(e),t.prototype._complete.call(this)},e}(r.Subscriber),a=function(t){function e(e,n,i){t.call(this,e),this.bufferSize=n,this.startBufferEvery=i,this.buffers=[],this.count=0}return i(e,t),e.prototype._next=function(t){var e=this,n=e.bufferSize,i=e.startBufferEvery,r=e.buffers,s=e.count;this.count++,s%i==0&&r.push([]);for(var o=r.length;o--;){var a=r[o];a.push(t),a.length===n&&(r.splice(o,1),this.destination.next(a))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var i=e.shift();i.length>0&&n.next(i)}t.prototype._complete.call(this)},e}(r.Subscriber)},6489:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(90680),s=n(42109),o=n(41503);e.bufferTime=function(t){var e=arguments.length,n=r.async;o.isScheduler(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var i=null;e>=2&&(i=arguments[1]);var s=Number.POSITIVE_INFINITY;return e>=3&&(s=arguments[2]),function(e){return e.lift(new a(t,i,s,n))}};var a=function(){function t(t,e,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),l=function(){this.buffer=[]},c=function(t){function e(e,n,i,r,s){t.call(this,e),this.bufferTimeSpan=n,this.bufferCreationInterval=i,this.maxBufferSize=r,this.scheduler=s,this.contexts=[];var o=this.openContext();if(this.timespanOnly=null==i||i<0,this.timespanOnly)this.add(o.closeAction=s.schedule(u,n,{subscriber:this,context:o,bufferTimeSpan:n}));else{var a={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:this,scheduler:s};this.add(o.closeAction=s.schedule(d,n,{subscriber:this,context:o})),this.add(s.schedule(h,i,a))}}return i(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,i=n.length,r=0;r0;){var i=e.shift();n.next(i.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan;this.add(t.closeAction=this.scheduler.schedule(u,n,{subscriber:this,context:t,bufferTimeSpan:n}))}},e.prototype.openContext=function(){var t=new l;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(s.Subscriber);function u(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function h(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,i=t.subscriber,r=t.scheduler,s=i.openContext();i.closed||(i.add(s.closeAction=r.schedule(d,n,{subscriber:i,context:s})),this.schedule(t,e))}function d(t){t.subscriber.closeContext(t.context)}},15440:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(72293),s=n(93658),o=n(84308);e.bufferToggle=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.openings,this.closingSelector))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(s.subscribeToResult(this,n))}return i(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,i=0;i0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(n){this._error(n)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.subscription;this.destination.next(t.buffer),e.splice(e.indexOf(t),1),this.remove(n),n.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new r.Subscription,i={buffer:[],subscription:n};e.push(i);var o=s.subscribeToResult(this,t,i);!o||o.closed?this.closeBuffer(i):(o.context=i,this.add(o),n.add(o))},e}(o.OuterSubscriber)},51786:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(72293),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.bufferWhen=function(t){return function(e){return e.lift(new c(t))}};var c=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.closingSelector))},t}(),u=function(t){function e(e,n){t.call(this,e),this.closingSelector=n,this.subscribing=!1,this.openBuffer()}return i(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,i,r){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe()),this.buffer&&this.destination.next(this.buffer),this.buffer=[];var e=s.tryCatch(this.closingSelector)();e===o.errorObject?this.error(o.errorObject.e):(t=new r.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(l.subscribeToResult(this,e)),this.subscribing=!1)},e}(a.OuterSubscriber)},93017:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.catchError=function(t){return function(e){var n=new o(t),i=e.lift(n);return n.caught=i}};var o=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.selector,this.caught))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.selector=n,this.caught=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(i){return void t.prototype.error.call(this,i)}this._unsubscribeAndRecycle(),this.add(s.subscribeToResult(this,n))}},e}(r.OuterSubscriber)},17054:function(t,e,n){"use strict";var i=n(49134);e.combineAll=function(t){return function(e){return e.lift(new i.CombineLatestOperator(t))}}},49134:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(96177),s=n(48242),o=n(84308),a=n(93658),l={};e.combineLatest=function(){for(var t=[],e=0;e0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){var s=Math.max(0,n[0].time-i.now());this.schedule(t,s)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new u(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(a.Notification.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t)},e.prototype._complete=function(){this.scheduleNotification(a.Notification.createComplete())},e}(o.Subscriber),u=function(t,e){this.time=t,this.notification=e}},22944:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(18705),o=n(84308),a=n(93658);e.delayWhen=function(t,e){return e?function(n){return new u(n,e).lift(new l(t))}:function(e){return e.lift(new l(t))}};var l=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.delayDurationSelector))},t}(),c=function(t){function e(e,n){t.call(this,e),this.delayDurationSelector=n,this.completed=!1,this.delayNotifierSubscriptions=[],this.values=[]}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.destination.next(t),this.removeSubscription(r),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){try{var e=this.delayDurationSelector(t);e&&this.tryDelay(e,t)}catch(n){this.destination.error(n)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t),n=null;return-1!==e&&(n=this.values[e],this.delayNotifierSubscriptions.splice(e,1),this.values.splice(e,1)),n},e.prototype.tryDelay=function(t,e){var n=a.subscribeToResult(this,t,e);n&&!n.closed&&(this.add(n),this.delayNotifierSubscriptions.push(n)),this.values.push(e)},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(o.OuterSubscriber),u=function(t){function e(e,n){t.call(this),this.source=e,this.subscriptionDelay=n}return i(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new h(t,this.source))},e}(s.Observable),h=function(t){function e(e,n){t.call(this),this.parent=e,this.source=n,this.sourceSubscribed=!1}return i(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(r.Subscriber)},95591:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.dematerialize=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new o(t))},t}(),o=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(r.Subscriber)},25753:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658),o=n(40317);e.distinct=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.keySelector,this.flushes))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.keySelector=n,this.values=new o.Set,i&&this.add(s.subscribeToResult(this,i))}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(i){return void n.error(i)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(r.OuterSubscriber);e.DistinctSubscriber=l},65608:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(33463),o=n(85814);e.distinctUntilChanged=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.compare,this.keySelector))},t}(),l=function(t){function e(e,n,i){t.call(this,e),this.keySelector=i,this.hasKey=!1,"function"==typeof n&&(this.compare=n)}return i(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e=t;if(this.keySelector&&(e=s.tryCatch(this.keySelector)(t))===o.errorObject)return this.destination.error(o.errorObject.e);var n=!1;if(this.hasKey){if((n=s.tryCatch(this.compare)(this.key,e))===o.errorObject)return this.destination.error(o.errorObject.e)}else this.hasKey=!0;!1===Boolean(n)&&(this.key=e,this.destination.next(t))},e}(r.Subscriber)},8330:function(t,e,n){"use strict";var i=n(65608);e.distinctUntilKeyChanged=function(t,e){return i.distinctUntilChanged(function(n,i){return e?e(n[t],i[t]):n[t]===i[t]})}},29264:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758);e.elementAt=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){if(this.index=t,this.defaultValue=e,t<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.index,this.defaultValue))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.index=n,this.defaultValue=i}return i(e,t),e.prototype._next=function(t){0==this.index--&&(this.destination.next(t),this.destination.complete())},e.prototype._complete=function(){var t=this.destination;this.index>=0&&(void 0!==this.defaultValue?t.next(this.defaultValue):t.error(new s.ArgumentOutOfRangeError)),t.complete()},e}(r.Subscriber)},26285:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.every=function(t,e){return function(n){return n.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.thisArg,this.source))},t}(),o=function(t){function e(e,n,i,r){t.call(this,e),this.predicate=n,this.thisArg=i,this.source=r,this.index=0,this.thisArg=i||this}return i(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(n){return void this.destination.error(n)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(r.Subscriber)},93229:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.exhaust=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){t.call(this,e),this.hasCompleted=!1,this.hasSubscription=!1}return i(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(s.subscribeToResult(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber)},15758:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.exhaustMap=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.resultSelector=i,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}return i(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e=this.index++,n=this.destination;try{var i=this.project(t,e);this.hasSubscription=!0,this.add(s.subscribeToResult(this,i,t,e))}catch(r){n.error(r)}},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyNext=function(t,e,n,i,r){var s=this.destination;this.resultSelector?this.trySelectResult(t,e,n,i):s.next(e)},e.prototype.trySelectResult=function(t,e,n,i){var r=this.resultSelector,s=this.destination;try{var o=r(t,e,n,i);s.next(o)}catch(a){s.error(a)}},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber)},55364:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(33463),s=n(85814),o=n(84308),a=n(93658);e.expand=function(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(i){return i.lift(new l(t,e,n))}};var l=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.concurrent,this.scheduler))},t}();e.ExpandOperator=l;var c=function(t){function e(e,n,i,r){t.call(this,e),this.project=n,this.concurrent=i,this.scheduler=r,this.index=0,this.active=0,this.hasCompleted=!1,i0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(o.OuterSubscriber);e.ExpandSubscriber=c},27015:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.filter=function(t,e){return function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.thisArg))},t}(),o=function(t){function e(e,n,i){t.call(this,e),this.predicate=n,this.thisArg=i,this.count=0}return i(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)},e}(r.Subscriber)},94367:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(72293);e.finalize=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.callback))},t}(),a=function(t){function e(e,n){t.call(this,e),this.add(new s.Subscription(n))}return i(e,t),e}(r.Subscriber)},16700:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.find=function(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new s(t,n,!1,e))}};var s=function(){function t(t,e,n,i){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}();e.FindValueOperator=s;var o=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.source=i,this.yieldIndex=r,this.thisArg=s,this.index=0}return i(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,i=this.index++;try{e.call(n||this,t,i,this.source)&&this.notifyComplete(this.yieldIndex?i:t)}catch(r){this.destination.error(r)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(r.Subscriber);e.FindValueSubscriber=o},86452:function(t,e,n){"use strict";var i=n(16700);e.findIndex=function(t,e){return function(n){return n.lift(new i.FindValueOperator(t,n,!0,e))}}},12309:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.first=function(t,e,n){return function(i){return i.lift(new o(t,e,n,i))}};var o=function(){function t(t,e,n,i){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=i}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),a=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=s,this.index=0,this.hasCompleted=!1,this._emitted=!1}return i(e,t),e.prototype._next=function(t){var e=this.index++;this.predicate?this._tryPredicate(t,e):this._emit(t,e)},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(i){return void this.destination.error(i)}n&&this._emit(t,e)},e.prototype._emit=function(t,e){this.resultSelector?this._tryResultSelector(t,e):this._emitFinal(t)},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(i){return void this.destination.error(i)}this._emitFinal(n)},e.prototype._emitFinal=function(t){var e=this.destination;this._emitted||(this._emitted=!0,e.next(t),e.complete(),this.hasCompleted=!0)},e.prototype._complete=function(){var t=this.destination;this.hasCompleted||void 0===this.defaultValue?this.hasCompleted||t.error(new s.EmptyError):(t.next(this.defaultValue),t.complete())},e}(r.Subscriber)},92577:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(72293),o=n(18705),a=n(2369),l=n(49754),c=n(30764);e.groupBy=function(t,e,n,i){return function(r){return r.lift(new u(t,e,n,i))}};var u=function(){function t(t,e,n,i){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),h=function(t){function e(e,n,i,r,s){t.call(this,e),this.keySelector=n,this.elementSelector=i,this.durationSelector=r,this.subjectSelector=s,this.groups=null,this.attemptedToUnsubscribe=!1,this.count=0}return i(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(n){return void this.error(n)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups="string"==typeof e?new c.FastMap:new l.Map);var i,r=n.get(e);if(this.elementSelector)try{i=this.elementSelector(t)}catch(u){this.error(u)}else i=t;if(!r){r=this.subjectSelector?this.subjectSelector():new a.Subject,n.set(e,r);var s=new p(e,r,this);if(this.destination.next(s),this.durationSelector){var o=void 0;try{o=this.durationSelector(new p(e,r))}catch(u){return void this.error(u)}this.add(o.subscribe(new d(e,r,this)))}}r.closed||r.next(i)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach(function(e,n){e.error(t)}),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach(function(t,e){t.complete()}),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(r.Subscriber),d=function(t){function e(e,n,i){t.call(this,n),this.key=e,this.group=n,this.parent=i}return i(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(r.Subscriber),p=function(t){function e(e,n,i){t.call(this),this.key=e,this.groupSubject=n,this.refCountSubscription=i}return i(e,t),e.prototype._subscribe=function(t){var e=new s.Subscription,n=this.refCountSubscription,i=this.groupSubject;return n&&!n.closed&&e.add(new f(n)),e.add(i.subscribe(t)),e},e}(o.Observable);e.GroupedObservable=p;var f=function(t){function e(e){t.call(this),this.parent=e,e.count++}return i(e,t),e.prototype.unsubscribe=function(){var e=this.parent;!e.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(s.Subscription)},86898:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(68668);e.ignoreElements=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._next=function(t){s.noop()},e}(r.Subscriber)},89121:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.isEmpty=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new o(t))},t}(),o=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(r.Subscriber)},4636:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.last=function(t,e,n){return function(i){return i.lift(new o(t,e,n,i))}};var o=function(){function t(t,e,n,i){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=i}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),a=function(t){function e(e,n,i,r,s){t.call(this,e),this.predicate=n,this.resultSelector=i,this.defaultValue=r,this.source=s,this.hasValue=!1,this.index=0,void 0!==r&&(this.lastValue=r,this.hasValue=!0)}return i(e,t),e.prototype._next=function(t){var e=this.index++;if(this.predicate)this._tryPredicate(t,e);else{if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(i){return void this.destination.error(i)}if(n){if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(i){return void this.destination.error(i)}this.lastValue=n,this.hasValue=!0},e.prototype._complete=function(){var t=this.destination;this.hasValue?(t.next(this.lastValue),t.complete()):t.error(new s.EmptyError)},e}(r.Subscriber)},40119:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.map=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.project,this.thisArg))},t}();e.MapOperator=s;var o=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.count=0,this.thisArg=i||this}return i(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(r.Subscriber)},23491:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.mapTo=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.value))},t}(),o=function(t){function e(e,n){t.call(this,e),this.value=n}return i(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(r.Subscriber)},71177:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(94429);e.materialize=function(){return function(t){return t.lift(new o)}};var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){t.call(this,e)}return i(e,t),e.prototype._next=function(t){this.destination.next(s.Notification.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(s.Notification.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(s.Notification.createComplete()),t.complete()},e}(r.Subscriber)},33499:function(t,e,n){"use strict";var i=n(97369);e.max=function(t){return i.reduce("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}},56098:function(t,e,n){"use strict";var i=n(38781),r=n(38781);e.mergeStatic=r.merge,e.merge=function(){for(var t=[],e=0;e0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(s.OuterSubscriber);e.MergeMapSubscriber=a},6693:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.mergeMapTo=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"number"==typeof e&&(n=e,e=null),function(i){return i.lift(new o(t,e,n))}};var o=function(){function t(t,e,n){void 0===n&&(n=Number.POSITIVE_INFINITY),this.ish=t,this.resultSelector=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.ish,this.resultSelector,this.concurrent))},t}();e.MergeMapToOperator=o;var a=function(t){function e(e,n,i,r){void 0===r&&(r=Number.POSITIVE_INFINITY),t.call(this,e),this.ish=n,this.resultSelector=i,this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(r.OuterSubscriber);e.MergeMapToSubscriber=a},7550:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(33463),s=n(85814),o=n(93658),a=n(84308);e.mergeScan=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(i){return i.lift(new l(t,e,n))}};var l=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.accumulator,this.seed,this.concurrent))},t}();e.MergeScanOperator=l;var c=function(t){function e(e,n,i,r){t.call(this,e),this.accumulator=n,this.acc=i,this.concurrent=r,this.hasValue=!1,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(a.OuterSubscriber);e.MergeScanSubscriber=c},51213:function(t,e,n){"use strict";var i=n(97369);e.min=function(t){return i.reduce("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t=2?function(n){return o.pipe(i.scan(t,e),r.takeLast(1),s.defaultIfEmpty(e))(n)}:function(e){return o.pipe(i.scan(function(e,n,i){return t(e,n,i+1)}),r.takeLast(1))(e)}}},1694:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.refCount=function(){return function(t){return t.lift(new s(t))}};var s=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var i=new o(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r},t}(),o=function(t){function e(e,n){t.call(this,e),this.connectable=n}return i(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}else this.connection=null},e}(r.Subscriber)},15329:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(70481);e.repeat=function(t){return void 0===t&&(t=-1),function(e){return 0===t?new s.EmptyObservable:e.lift(new o(t<0?-1:t-1,e))}};var o=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.count,this.source))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.count=n,this.source=i}return i(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(r.Subscriber)},63964:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.repeatWhen=function(t){return function(e){return e.lift(new c(t))}};var c=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,e))},t}(),u=function(t){function e(e,n,i){t.call(this,e),this.notifier=n,this.source=i,this.sourceIsBeingSubscribedTo=!0}return i(e,t),e.prototype.notifyNext=function(t,e,n,i,r){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this,n=e.notifications,i=e.retries,r=e.retriesSubscription;return this.notifications=null,this.retries=null,this.retriesSubscription=null,t.prototype._unsubscribeAndRecycle.call(this),this.notifications=n,this.retries=i,this.retriesSubscription=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new r.Subject;var e=s.tryCatch(this.notifier)(this.notifications);if(e===o.errorObject)return t.prototype.complete.call(this);this.retries=e,this.retriesSubscription=l.subscribeToResult(this,e)},e}(a.OuterSubscriber)},40241:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.retry=function(t){return void 0===t&&(t=-1),function(e){return e.lift(new s(t,e))}};var s=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.count,this.source))},t}(),o=function(t){function e(e,n,i){t.call(this,e),this.count=n,this.source=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,i=this.count;if(0===i)return t.prototype.error.call(this,e);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(r.Subscriber)},23896:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(33463),o=n(85814),a=n(84308),l=n(93658);e.retryWhen=function(t){return function(e){return e.lift(new c(t,e))}};var c=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,this.source))},t}(),u=function(t){function e(e,n,i){t.call(this,e),this.notifier=n,this.source=i}return i(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,i=this.retries,a=this.retriesSubscription;if(i)this.errors=null,this.retriesSubscription=null;else{if(n=new r.Subject,(i=s.tryCatch(this.notifier)(n))===o.errorObject)return t.prototype.error.call(this,o.errorObject.e);a=l.subscribeToResult(this,i)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=a,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,i,r){var s=this,o=s.errors,a=s.retries,l=s.retriesSubscription;this.errors=null,this.retries=null,this.retriesSubscription=null,this._unsubscribeAndRecycle(),this.errors=o,this.retries=a,this.retriesSubscription=l,this.source.subscribe(this)},e}(a.OuterSubscriber)},92043:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.sample=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new a(t),i=e.subscribe(n);return i.add(s.subscribeToResult(n,this.notifier)),i},t}(),a=function(t){function e(){t.apply(this,arguments),this.hasValue=!1}return i(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,i,r){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(r.OuterSubscriber)},71239:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(90680);e.sampleTime=function(t,e){return void 0===e&&(e=s.async),function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.period,this.scheduler))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.period=n,this.scheduler=i,this.hasValue=!1,this.add(i.schedule(l,n,{subscriber:this,period:n}))}return i(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(r.Subscriber);function l(t){var e=t.period;t.subscriber.notifyNext(),this.schedule(t,e)}},64949:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.scan=function(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.accumulator,this.seed,this.hasSeed))},t}(),o=function(t){function e(e,n,i,r){t.call(this,e),this.accumulator=n,this._seed=i,this.hasSeed=r,this.index=0}return i(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(i){this.destination.error(i)}this.seed=e,this.destination.next(e)},e}(r.Subscriber)},88948:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(33463),o=n(85814);e.sequenceEqual=function(t,e){return function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.compareTo=t,this.comparor=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.compareTo,this.comparor))},t}();e.SequenceEqualOperator=a;var l=function(t){function e(e,n,i){t.call(this,e),this.compareTo=n,this.comparor=i,this._a=[],this._b=[],this._oneComplete=!1,this.add(n.subscribe(new c(e,this)))}return i(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e.prototype.checkValues=function(){for(var t=this,e=t._a,n=t._b,i=t.comparor;e.length>0&&n.length>0;){var r=e.shift(),a=n.shift(),l=!1;i?(l=s.tryCatch(i)(r,a))===o.errorObject&&this.destination.error(o.errorObject.e):l=r===a,l||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e}(r.Subscriber);e.SequenceEqualSubscriber=l;var c=function(t){function e(e,n){t.call(this,e),this.parent=n}return i(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t)},e.prototype._complete=function(){this.parent._complete()},e}(r.Subscriber)},35473:function(t,e,n){"use strict";var i=n(27372),r=n(1694),s=n(2369);function o(){return new s.Subject}e.share=function(){return function(t){return r.refCount()(i.multicast(o)(t))}}},62704:function(t,e,n){"use strict";var i=n(81959);e.shareReplay=function(t,e,n){return function(r){return r.lift(function(t,e,n){var r,s,o=0,a=!1,l=!1;return function(c){o++,(!r||a)&&(a=!1,r=new i.ReplaySubject(t,e,n),s=c.subscribe({next:function(t){r.next(t)},error:function(t){a=!0,r.error(t)},complete:function(){l=!0,r.complete()}}));var u=r.subscribe(this);return function(){o--,u.unsubscribe(),s&&0===o&&l&&s.unsubscribe()}}}(t,e,n))}}},92223:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(44640);e.single=function(t){return function(e){return e.lift(new o(t,e))}};var o=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.source))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.predicate=n,this.source=i,this.seenValue=!1,this.index=0}return i(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(n){this.destination.error(n)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new s.EmptyError)},e}(r.Subscriber)},11189:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109);e.skip=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.total))},t}(),o=function(t){function e(e,n){t.call(this,e),this.total=n,this.count=0}return i(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(r.Subscriber)},73346:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758);e.skipLast=function(t){return function(e){return e.lift(new o(t))}};var o=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(0===this._skipCount?new r.Subscriber(t):new a(t,this._skipCount))},t}(),a=function(t){function e(e,n){t.call(this,e),this._skipCount=n,this._count=0,this._ring=new Array(n)}return i(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n1?new i.ArrayObservable(t,n):new s.EmptyObservable(n),e)}}},10118:function(t,e,n){"use strict";var i=n(82966);e.subscribeOn=function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new r(t,e))}};var r=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new i.SubscribeOnObservable(e,this.delay,this.scheduler).subscribe(t)},t}()},77243:function(t,e,n){"use strict";var i=n(18483),r=n(5027);e.switchAll=function(){return i.switchMap(r.identity)}},18483:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.switchMap=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.project=n,this.resultSelector=i,this.index=0}return i(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var i=this.innerSubscription;i&&i.unsubscribe(),this.add(this.innerSubscription=s.subscribeToResult(this,t,e,n))},e.prototype._complete=function(){var e=this.innerSubscription;(!e||e.closed)&&t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){this.resultSelector?this._tryNotifyNext(t,e,n,i):this.destination.next(e)},e.prototype._tryNotifyNext=function(t,e,n,i){var r;try{r=this.resultSelector(t,e,n,i)}catch(s){return void this.destination.error(s)}this.destination.next(r)},e}(r.OuterSubscriber)},10684:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(84308),s=n(93658);e.switchMapTo=function(t,e){return function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.observable=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.observable,this.resultSelector))},t}(),a=function(t){function e(e,n,i){t.call(this,e),this.inner=n,this.resultSelector=i,this.index=0}return i(e,t),e.prototype._next=function(t){var e=this.innerSubscription;e&&e.unsubscribe(),this.add(this.innerSubscription=s.subscribeToResult(this,this.inner,t,this.index++))},e.prototype._complete=function(){var e=this.innerSubscription;(!e||e.closed)&&t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,i,r){var s=this.destination;this.resultSelector?this.tryResultSelector(t,e,n,i):s.next(e)},e.prototype.tryResultSelector=function(t,e,n,i){var r,s=this.resultSelector,o=this.destination;try{r=s(t,e,n,i)}catch(a){return void o.error(a)}o.next(r)},e}(r.OuterSubscriber)},44396:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758),o=n(70481);e.take=function(t){return function(e){return 0===t?new o.EmptyObservable:e.lift(new a(t))}};var a=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.total))},t}(),l=function(t){function e(e,n){t.call(this,e),this.total=n,this.count=0}return i(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(r.Subscriber)},73935:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(42109),s=n(11758),o=n(70481);e.takeLast=function(t){return function(e){return 0===t?new o.EmptyObservable:e.lift(new a(t))}};var a=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.total))},t}(),l=function(t){function e(e,n){t.call(this,e),this.total=n,this.ring=new Array,this.count=0}return i(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,i=this.count++;e.length0)for(var n=this.count>=this.total?this.total:this.count,i=this.ring,r=0;r0?this.startWindowEvery:this.windowSize,n=this.destination,i=this.windowSize,r=this.windows,o=r.length,a=0;a=0&&l%e==0&&!this.closed&&r.shift().complete(),++this.count%e==0&&!this.closed){var c=new s.Subject;r.push(c),n.next(c)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(r.Subscriber)},42603:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(90680),o=n(42109),a=n(39479),l=n(41503);e.windowTime=function(t){var e=s.async,n=null,i=Number.POSITIVE_INFINITY;return l.isScheduler(arguments[3])&&(e=arguments[3]),l.isScheduler(arguments[2])?e=arguments[2]:a.isNumeric(arguments[2])&&(i=arguments[2]),l.isScheduler(arguments[1])?e=arguments[1]:a.isNumeric(arguments[1])&&(n=arguments[1]),function(r){return r.lift(new c(t,n,i,e))}};var c=function(){function t(t,e,n,i){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),u=function(t){function e(){t.apply(this,arguments),this._numberOfNextedValues=0}return i(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(r.Subject),h=function(t){function e(e,n,i,r,s){t.call(this,e),this.destination=e,this.windowTimeSpan=n,this.windowCreationInterval=i,this.maxWindowSize=r,this.scheduler=s,this.windows=[];var o=this.openWindow();if(null!==i&&i>=0){var a={windowTimeSpan:n,windowCreationInterval:i,subscriber:this,scheduler:s};this.add(s.schedule(f,n,{subscriber:this,window:o,context:null})),this.add(s.schedule(p,i,a))}else this.add(s.schedule(d,n,{subscriber:this,window:o,windowTimeSpan:n}))}return i(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,i=0;i=this.maxWindowSize&&this.closeWindow(r))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new u;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(o.Subscriber);function d(t){var e=t.subscriber,n=t.windowTimeSpan,i=t.window;i&&e.closeWindow(i),t.window=e.openWindow(),this.schedule(t,n)}function p(t){var e=t.windowTimeSpan,n=t.subscriber,i=t.scheduler,r=t.windowCreationInterval,s=n.openWindow(),o=this,a={action:o,subscription:null};a.subscription=i.schedule(f,e,{subscriber:n,window:s,context:a}),o.add(a.subscription),o.schedule(t,r)}function f(t){var e=t.subscriber,n=t.window,i=t.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),e.closeWindow(n)}},59048:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(2369),s=n(72293),o=n(33463),a=n(85814),l=n(84308),c=n(93658);e.windowToggle=function(t,e){return function(n){return n.lift(new u(t,e))}};var u=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.openings,this.closingSelector))},t}(),h=function(t){function e(e,n,i){t.call(this,e),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(this.openSubscription=c.subscribeToResult(this,n,n))}return i(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,i=0;i0){var o=s.indexOf(n);-1!==o&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(r.OuterSubscriber)},9477:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(96177),s=n(48242),o=n(42109),a=n(84308),l=n(93658),c=n(72121);function u(){for(var t=[],e=0;ethis.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),g=function(t){function e(e,n,i){t.call(this,e),this.parent=n,this.observable=i,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return i(e,t),e.prototype[c.iterator]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,n,i,r){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return l.subscribeToResult(this,this.observable,this,e)},e}(a.OuterSubscriber)},33310:function(t,e,n){"use strict";var i=n(9477);e.zipAll=function(t){return function(e){return e.lift(new i.ZipOperator(t))}}},28101:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(e,n){t.call(this)}return i(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(72293).Subscription);e.Action=r},67529:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(12624),s=n(95018),o=function(t){function e(e,n){t.call(this,e,n),this.scheduler=e,this.work=n}return i(e,t),e.prototype.requestAsyncId=function(e,n,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,n,i):(e.actions.push(this),e.scheduled||(e.scheduled=s.AnimationFrame.requestAnimationFrame(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,i);0===e.actions.length&&(s.AnimationFrame.cancelAnimationFrame(n),e.scheduled=void 0)},e}(r.AsyncAction);e.AnimationFrameAction=o},68909:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,i=-1,r=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i0?t.prototype.requestAsyncId.call(this,e,n,i):(e.actions.push(this),e.scheduled||(e.scheduled=r.Immediate.setImmediate(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,i);0===e.actions.length&&(r.Immediate.clearImmediate(n),e.scheduled=void 0)},e}(n(12624).AsyncAction);e.AsapAction=s},25766:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,i=-1,r=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,i):e.flush(this)},e}(n(12624).AsyncAction);e.QueueAction=r},77373:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=function(t){function e(){t.apply(this,arguments)}return i(e,t),e}(n(42704).AsyncScheduler);e.QueueScheduler=r},18353:function(t,e,n){"use strict";var i=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=n(12624),s=function(t){function e(e,n){var i=this;void 0===e&&(e=o),void 0===n&&(n=Number.POSITIVE_INFINITY),t.call(this,e,function(){return i.frame}),this.maxFrames=n,this.frame=0,this.index=-1}return i(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,i=this.maxFrames;(e=n.shift())&&(this.frame=e.delay)<=i&&!(t=e.execute(e.state,e.delay)););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(n(42704).AsyncScheduler);e.VirtualTimeScheduler=s;var o=function(t){function e(e,n,i){void 0===i&&(i=e.index+=1),t.call(this,e,n),this.scheduler=e,this.work=n,this.index=i,this.active=!0,this.index=e.index=i}return i(e,t),e.prototype.schedule=function(n,i){if(void 0===i&&(i=0),!this.id)return t.prototype.schedule.call(this,n,i);this.active=!1;var r=new e(this.scheduler,this.work);return this.add(r),r.schedule(n,i)},e.prototype.requestAsyncId=function(t,n,i){void 0===i&&(i=0),this.delay=t.frame+i;var r=t.actions;return r.push(this),r.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){void 0===n&&(n=0)},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(r.AsyncAction);e.VirtualAction=o},12948:function(t,e,n){"use strict";var i=n(67529),r=n(68909);e.animationFrame=new r.AnimationFrameScheduler(i.AnimationFrameAction)},85522:function(t,e,n){"use strict";var i=n(3496),r=n(25766);e.asap=new r.AsapScheduler(i.AsapAction)},90680:function(t,e,n){"use strict";var i=n(12624),r=n(42704);e.async=new r.AsyncScheduler(i.AsyncAction)},97088:function(t,e,n){"use strict";var i=n(7100),r=n(77373);e.queue=new r.QueueScheduler(i.QueueAction)},72121:function(t,e,n){"use strict";var i=n(80019);function r(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var n=t.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var i=t.Map;if(i)for(var r=Object.getOwnPropertyNames(i.prototype),s=0;s0;)e.shift().setup();t.prototype.flush.call(this);for(var n=this.flushTests.filter(function(t){return t.ready});n.length>0;){var i=n.shift();this.assertDeepEqual(i.actual,i.expected)}},e.parseMarblesAsSubscriptions=function(t){if("string"!=typeof t)return new l.SubscriptionLog(Number.POSITIVE_INFINITY);for(var e=t.length,n=-1,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,s=0;s-1?n:o;break;case"!":if(r!==Number.POSITIVE_INFINITY)throw new Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");r=n>-1?n:o;break;default:throw new Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+a+"'.")}}return r<0?new l.SubscriptionLog(i):new l.SubscriptionLog(i,r)},e.parseMarbles=function(t,e,n,i){if(void 0===i&&(i=!1),-1!==t.indexOf("!"))throw new Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var r=t.length,a=[],l=t.indexOf("^"),c=-1===l?0:l*-this.frameTimeFactor,u="object"!=typeof e?function(t){return t}:function(t){return i&&e[t]instanceof o.ColdObservable?e[t].messages:e[t]},h=-1,d=0;d-1?h:p,notification:f})}return a},e}(c.VirtualTimeScheduler);e.TestScheduler=u},95018:function(t,e,n){"use strict";var i=n(80019),r=function(t){t.requestAnimationFrame?(this.cancelAnimationFrame=t.cancelAnimationFrame.bind(t),this.requestAnimationFrame=t.requestAnimationFrame.bind(t)):t.mozRequestAnimationFrame?(this.cancelAnimationFrame=t.mozCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.mozRequestAnimationFrame.bind(t)):t.webkitRequestAnimationFrame?(this.cancelAnimationFrame=t.webkitCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.webkitRequestAnimationFrame.bind(t)):t.msRequestAnimationFrame?(this.cancelAnimationFrame=t.msCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.msRequestAnimationFrame.bind(t)):t.oRequestAnimationFrame?(this.cancelAnimationFrame=t.oCancelAnimationFrame.bind(t),this.requestAnimationFrame=t.oRequestAnimationFrame.bind(t)):(this.cancelAnimationFrame=t.clearTimeout.bind(t),this.requestAnimationFrame=function(e){return t.setTimeout(e,1e3/60)})};e.RequestAnimationFrameDefinition=r,e.AnimationFrame=new r(i.root)},11758:function(t,e){"use strict";var n=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t){function e(){var e=t.call(this,"argument out of range");this.name=e.name="ArgumentOutOfRangeError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.ArgumentOutOfRangeError=i},44640:function(t,e){"use strict";var n=this&&this.__extends||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t){function e(){var e=t.call(this,"no elements in sequence");this.name=e.name="EmptyError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.EmptyError=i},30764:function(t,e){"use strict";var n=function(){function t(){this.values={}}return t.prototype.delete=function(t){return this.values[t]=null,!0},t.prototype.set=function(t,e){return this.values[t]=e,this},t.prototype.get=function(t){return this.values[t]},t.prototype.forEach=function(t,e){var n=this.values;for(var i in n)n.hasOwnProperty(i)&&null!==n[i]&&t.call(e,n[i],i)},t.prototype.clear=function(){this.values={}},t}();e.FastMap=n},42982:function(t,e,n){"use strict";var i=n(80019),r=function(){function t(t){if(this.root=t,t.setImmediate&&"function"==typeof t.setImmediate)this.setImmediate=t.setImmediate.bind(t),this.clearImmediate=t.clearImmediate.bind(t);else{this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.setImmediate=this.canUseProcessNextTick()?this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.createReadyStateChangeSetImmediate():this.createSetTimeoutSetImmediate();var e=function t(e){delete t.instance.tasksByHandle[e]};e.instance=this,this.clearImmediate=e}}return t.prototype.identify=function(t){return this.root.Object.prototype.toString.call(t)},t.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)},t.prototype.canUseMessageChannel=function(){return Boolean(this.root.MessageChannel)},t.prototype.canUseReadyStateChange=function(){var t=this.root.document;return Boolean(t&&"onreadystatechange"in t.createElement("script"))},t.prototype.canUsePostMessage=function(){var t=this.root;if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}return!1},t.prototype.partiallyApplied=function(t){for(var e=[],n=1;n=0}},1856:function(t,e){"use strict";e.isObject=function(t){return null!=t&&"object"==typeof t}},35130:function(t,e){"use strict";e.isPromise=function(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}},41503:function(t,e){"use strict";e.isScheduler=function(t){return t&&"function"==typeof t.schedule}},68668:function(t,e){"use strict";e.noop=function(){}},67239:function(t,e){"use strict";e.not=function(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}},10142:function(t,e,n){"use strict";var i=n(68668);function r(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:i.noop}e.pipe=function(){for(var t=[],e=0;e=n?{done:!0}:{done:!1,value:t[i++]}})},e.empty=function(){var t=new e(null);return t.done=!0,t},e.is=function(t){return t instanceof e||"object"==typeof t&&null!==t&&"function"==typeof t.next},t.exports=e},97310:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.isMobile=function(){return void 0!==r.window.orientation},e.default=function(t){if(!t&&!(0,s.default)())return"Node";if((0,o.default)(t))return"Electron";var e="undefined"!=typeof navigator?navigator:{},n=t||e.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),a=-1!==n.indexOf("Trident/");return i||a?"IE":r.window.chrome?"Chrome":r.window.safari?"Safari":r.window.mozInnerScreenX?"Firefox":"Unknown"};var r=n(41151),s=i(n(61602)),o=i(n(22344))},41151:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.console=e.process=e.document=e.global=e.window=e.self=void 0;var r=i(n(34321)),s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&process};e.self=s.self||s.window||s.global,e.window=s.window||s.self||s.global,e.global=s.global||s.self||s.window,e.document=s.document||{},e.process=s.process||{};var o=console;e.console=o},84761:function(t,e,n){"use strict";var i=n(61948),r=n(34321);Object.defineProperty(e,"CO",{enumerable:!0,get:function(){return s.global}}),Object.defineProperty(e,"jU",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"qs",{enumerable:!0,get:function(){return a.default}});var s=n(41151),o=c(n(61602)),a=c(n(97310));i(n(22344));function l(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(l=function(t){return t?n:e})(t)}function c(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=l(e);if(n&&n.has(t))return n.get(t);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&Object.prototype.hasOwnProperty.call(t,o)){var a=s?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=t[o]}return i.default=t,n&&n.set(t,i),i}},61602:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,e.isBrowserMainThread=function(){return o()&&"undefined"!=typeof document};var r=i(n(34321)),s=i(n(22344));function o(){return!("object"===("undefined"==typeof process?"undefined":(0,r.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,s.default)()}},22344:function(t,e,n){"use strict";var i=n(61948);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("undefined"!=typeof window&&"object"===(0,r.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,r.default)(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":(0,r.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)};var r=i(n(34321))},86991:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(14180),e),r(n(75103),e),r(n(48965),e),r(n(32595),e),r(n(82417),e),r(n(92451),e),r(n(17735),e)},14180:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BlankNode=void 0,e.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&"BlankNode"===t.termType&&t.value===this.value}}},75103:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataFactory=void 0;const i=n(14180),r=n(48965),s=n(32595),o=n(82417),a=n(92451),l=n(17735);let c=0;e.DataFactory=class{constructor(t){this.blankNodeCounter=0,this.blankNodePrefix=(t=t||{}).blankNodePrefix||`df_${c++}_`}namedNode(t){return new o.NamedNode(t)}blankNode(t){return new i.BlankNode(t||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(t,e){return new s.Literal(t,e)}variable(t){return new l.Variable(t)}defaultGraph(){return r.DefaultGraph.INSTANCE}quad(t,e,n,i){return new a.Quad(t,e,n,i||this.defaultGraph())}fromTerm(t){switch(t.termType){case"NamedNode":return this.namedNode(t.value);case"BlankNode":return this.blankNode(t.value);case"Literal":return t.language?this.literal(t.value,t.language):t.datatype.equals(s.Literal.XSD_STRING)?this.literal(t.value):this.literal(t.value,this.fromTerm(t.datatype));case"Variable":return this.variable(t.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(t.subject),this.fromTerm(t.predicate),this.fromTerm(t.object),this.fromTerm(t.graph))}}fromQuad(t){return this.fromTerm(t)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},48965:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&"DefaultGraph"===t.termType}}e.DefaultGraph=n,n.INSTANCE=new n},32595:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Literal=void 0;const i=n(82417);class r{constructor(t,e){this.termType="Literal",this.value=t,"string"==typeof e?(this.language=e,this.datatype=r.RDF_LANGUAGE_STRING):e?(this.language="",this.datatype=e):(this.language="",this.datatype=r.XSD_STRING)}equals(t){return!!t&&"Literal"===t.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}e.Literal=r,r.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),r.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string")},82417:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NamedNode=void 0,e.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&"NamedNode"===t.termType&&t.value===this.value}}},92451:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Quad=void 0,e.Quad=class{constructor(t,e,n,i){this.termType="Quad",this.value="",this.subject=t,this.predicate=e,this.object=n,this.graph=i}equals(t){return!!t&&("Quad"===t.termType||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},17735:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Variable=void 0,e.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&"Variable"===t.termType&&t.value===this.value}}},31609:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.getSupportedJavaScriptPrimitives=e.getSupportedRdfDatatypes=e.getTermRaw=e.toRdf=e.fromRdf=void 0;const s=n(86991),o=n(9938),a=n(66060);r(n(9938),e),r(n(88871),e),r(n(66060),e);const l=new s.DataFactory,c=new a.Translator;function u(t,e){return c.fromRdf(t,e)}c.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map(t=>l.namedNode(t)),["string"]),c.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map(t=>l.namedNode(t)),["boolean"]),c.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map(t=>l.namedNode(t)),["number"]),c.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map(t=>l.namedNode(t)),["number"]),c.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map(t=>l.namedNode(t)),["object"]),e.fromRdf=u,e.toRdf=function(t,e){return e&&"namedNode"in e&&(e={dataFactory:e}),(e=e||{})&&!e.dataFactory&&(e.dataFactory=l),c.toRdf(t,e)},e.getTermRaw=function(t,e){return"Literal"===t.termType?u(t,e):t.value},e.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},e.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()}},88871:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},66060:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Translator=void 0,e.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,e,n){for(const i of e)this.supportedRdfDatatypes.push(i),this.fromRdfHandlers[i.value]=t;for(const i of n){let e=this.toRdfHandlers[i];e||(this.toRdfHandlers[i]=e=[]),e.push(t)}}fromRdf(t,e){const n=this.fromRdfHandlers[t.datatype.value];return n?n.fromRdf(t,e):t.value}toRdf(t,e){const n=this.toRdfHandlers[typeof t];if(n)for(const i of n){const n=i.toRdf(t,e);if(n)return n}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},80727:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerBoolean=void 0;const i=n(66060);class r{fromRdf(t,e){switch(t.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return e&&i.Translator.incorrectRdfDataType(t),!1}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(t?"true":"false",e||n.namedNode(r.TYPE))}}e.TypeHandlerBoolean=r,r.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},52525:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerDate=void 0;const i=n(66060);class r{fromRdf(t,e){switch(e&&!t.value.match(r.VALIDATORS[t.datatype.value.substr(33,t.datatype.value.length)])&&i.Translator.incorrectRdfDataType(t),t.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(t.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const e=t.value.split("-");return new Date(0,parseInt(e[0],10)-1,parseInt(e[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(t.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(t.value+"-01");default:return new Date(t.value)}}toRdf(t,{datatype:e,dataFactory:n}){if(e=e||n.namedNode(r.TYPES[0]),!(t instanceof Date))return null;const i=t;let s;switch(e.value){case"http://www.w3.org/2001/XMLSchema#gDay":s=String(i.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":s=i.getUTCMonth()+1+"-"+i.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":s=String(i.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":s=i.getUTCFullYear()+"-"+(i.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":s=i.toISOString().replace(/T.*$/,"");break;default:s=i.toISOString()}return n.literal(s,e)}}e.TypeHandlerDate=r,r.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"],r.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]$/}},38554:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberDouble=void 0;const i=n(66060);class r{fromRdf(t,e){const n=parseFloat(t.value);return e&&isNaN(n)&&i.Translator.incorrectRdfDataType(t),n}toRdf(t,{datatype:e,dataFactory:n}){return e=e||n.namedNode(r.TYPES[0]),isNaN(t)?n.literal("NaN",e):isFinite(t)?t%1==0?null:n.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),e):n.literal(t>0?"INF":"-INF",e)}}e.TypeHandlerNumberDouble=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},37750:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberInteger=void 0;const i=n(66060);class r{fromRdf(t,e){const n=parseInt(t.value,10);return e&&(isNaN(n)||t.value.indexOf(".")>=0)&&i.Translator.incorrectRdfDataType(t),n}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(String(t),e||n.namedNode(t<=r.MAX_INT&&t>=r.MIN_INT?r.TYPES[0]:r.TYPES[1]))}}e.TypeHandlerNumberInteger=r,r.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"],r.MAX_INT=2147483647,r.MIN_INT=-2147483648},14608:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerString=void 0;class n{fromRdf(t){return t.value}toRdf(t,{datatype:e,dataFactory:n}){return n.literal(t,e)}}e.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},9938:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(80727),e),r(n(52525),e),r(n(38554),e),r(n(37750),e),r(n(14608),e)},35090:function(t,e,n){"use strict";var i={};n.r(i),n.d(i,{decode:function(){return eL},encode:function(){return iL}});var r={};n.r(r),n.d(r,{decode:function(){return cL},encode:function(){return hL}});var s={};n.r(s),n.d(s,{decode:function(){return dL},encode:function(){return fL}});var o={};function a(t){return"function"==typeof t}n.r(o),n.d(o,{decode:function(){return mL},encode:function(){return yL}});let l=!1;const c={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else l&&console.log("RxJS: Back to a better error behavior. Thank you. <3");l=t},get useDeprecatedSynchronousErrorHandling(){return l}};function u(t){setTimeout(()=>{throw t},0)}const h={closed:!0,next(t){},error(t){if(c.useDeprecatedSynchronousErrorHandling)throw t;u(t)},complete(){}},d=Array.isArray||(t=>t&&"number"==typeof t.length);function p(t){return null!==t&&"object"==typeof t}const f=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();class g{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:e,_ctorUnsubscribe:n,_unsubscribe:i,_subscriptions:r}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,e instanceof g)e.remove(this);else if(null!==e)for(let a=0;at.concat(e instanceof f?e.errors:e),[])}g.EMPTY=((m=new g).closed=!0,m);const y="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class v extends g{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=h;break;case 1:if(!t){this.destination=h;break}if("object"==typeof t){t instanceof v?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new _(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new _(this,t,e,n)}}[y](){return this}static create(t,e,n){const i=new v(t,e,n);return i.syncErrorThrowable=!1,i}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class _ extends v{constructor(t,e,n,i){super(),this._parentSubscriber=t;let r,s=this;a(e)?r=e:e&&(r=e.next,n=e.error,i=e.complete,e!==h&&(s=Object.create(e),a(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=r,this._error=n,this._complete=i}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;c.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=c;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):u(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;u(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);c.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),c.useDeprecatedSynchronousErrorHandling)throw n;u(n)}}__tryOrSetError(t,e,n){if(!c.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(i){return c.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=i,t.syncErrorThrown=!0,!0):(u(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const w="function"==typeof Symbol&&Symbol.observable||"@@observable";function x(t){return t}function S(...t){return E(t)}function E(t){return 0===t.length?x:1===t.length?t[0]:function(e){return t.reduce((t,e)=>e(t),e)}}let C=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:i}=this,r=function(t,e,n){if(t){if(t instanceof v)return t;if(t[y])return t[y]()}return t||e||n?new v(t,e,n):new v(h)}(t,e,n);if(r.add(i?i.call(r,this.source):this.source||c.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),c.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(t){try{return this._subscribe(t)}catch(e){c.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:i}=t;if(e||i)return!1;t=n&&n instanceof v?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=O(e))((e,n)=>{let i;i=this.subscribe(e=>{try{t(e)}catch(r){n(r),i&&i.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[w](){return this}pipe(...t){return 0===t.length?this:E(t)(this)}toPromise(t){return new(t=O(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function O(t){if(t||(t=c.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const T=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class k extends g{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class A extends v{constructor(t){super(t),this.destination=t}}let P=(()=>{class t extends C{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[y](){return new A(this)}lift(t){const e=new I(this,this);return e.operator=t,e}next(t){if(this.closed)throw new T;if(!this.isStopped){const{observers:e}=this,n=e.length,i=e.slice();for(let r=0;rnew I(t,e),t})();class I extends P{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):g.EMPTY}}function M(t){return t&&"function"==typeof t.schedule}function D(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new R(t,e))}}class R{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new N(t,this.project,this.thisArg))}}class N extends v{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}const L=t=>e=>{for(let n=0,i=t.length;nt&&"number"==typeof t.length&&"function"!=typeof t;function B(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const V=t=>{if(t&&"function"==typeof t[w])return(t=>e=>{const n=t[w]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)})(t);if(F(t))return L(t);if(B(t))return(t=>e=>(t.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,u),e))(t);if(t&&"function"==typeof t[j])return(t=>e=>{const n=t[j]();for(;;){let t;try{t=n.next()}catch(i){return e.error(i),e}if(t.done){e.complete();break}if(e.next(t.value),e.closed)break}return"function"==typeof n.return&&e.add(()=>{n.return&&n.return()}),e})(t);{const e=`You provided ${p(t)?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(e)}};function z(t,e){return new C(n=>{const i=new g;let r=0;return i.add(e.schedule(function(){r!==t.length?(n.next(t[r++]),n.closed||i.add(this.schedule())):n.complete()})),i})}function U(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[w]}(t))return function(t,e){return new C(n=>{const i=new g;return i.add(e.schedule(()=>{const r=t[w]();i.add(r.subscribe({next(t){i.add(e.schedule(()=>n.next(t)))},error(t){i.add(e.schedule(()=>n.error(t)))},complete(){i.add(e.schedule(()=>n.complete()))}}))})),i})}(t,e);if(B(t))return function(t,e){return new C(n=>{const i=new g;return i.add(e.schedule(()=>t.then(t=>{i.add(e.schedule(()=>{n.next(t),i.add(e.schedule(()=>n.complete()))}))},t=>{i.add(e.schedule(()=>n.error(t)))}))),i})}(t,e);if(F(t))return z(t,e);if(function(t){return t&&"function"==typeof t[j]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new C(n=>{const i=new g;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=t[j](),i.add(e.schedule(function(){if(n.closed)return;let t,e;try{const n=r.next();t=n.value,e=n.done}catch(i){return void n.error(i)}e?n.complete():(n.next(t),this.schedule())}))})),i})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof C?t:new C(V(t))}class H extends v{constructor(t){super(),this.parent=t}_next(t){this.parent.notifyNext(t)}_error(t){this.parent.notifyError(t),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class $ extends v{notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.destination.complete()}}function G(t,e){if(e.closed)return;if(t instanceof C)return t.subscribe(e);let n;try{n=V(t)(e)}catch(i){e.error(i)}return n}function W(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(W((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))),n)):("number"==typeof e&&(n=e),e=>e.lift(new q(t,n)))}class q{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new X(t,this.project,this.concurrent))}}class X extends ${constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function Y(t=Number.POSITIVE_INFINITY){return W(x,t)}function K(t,e){return e?z(t,e):new C(L(t))}function Q(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return M(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof i&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof C?t[0]:Y(e)(K(t,n))}function Z(){return function(t){return t.lift(new J(t))}}class J{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const i=new tt(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class tt extends v{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,i=t._connection;this.connection=null,i&&(!n||i===n)&&i.unsubscribe()}}class et extends C{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new g,t.add(this.source.subscribe(new it(this.getSubject(),this))),t.closed&&(this._connection=null,t=g.EMPTY)),t}refCount(){return Z()(this)}}const nt=(()=>{const t=et.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class it extends A{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function rt(t,e){return function(n){let i;if(i="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new st(i,e));const r=Object.create(n,nt);return r.source=n,r.subjectFactory=i,r}}class st{constructor(t,e){this.subjectFactory=t,this.selector=e}call(t,e){const{selector:n}=this,i=this.subjectFactory(),r=n(i).subscribe(t);return r.add(e.subscribe(i)),r}}function ot(){return new P}function at(){return t=>Z()(rt(ot)(t))}function lt(t){for(let e in t)if(t[e]===lt)return e;throw Error("Could not find renamed property on target object.")}function ct(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function ut(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(ut).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function ht(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const dt=lt({__forward_ref__:lt});function pt(t){return t.__forward_ref__=pt,t.toString=function(){return ut(this())},t}function ft(t){return gt(t)?t():t}function gt(t){return"function"==typeof t&&t.hasOwnProperty(dt)&&t.__forward_ref__===pt}class mt extends Error{constructor(t,e){super(function(t,e){return`${t?`NG0${t}: `:""}${e}`}(t,e)),this.code=t}}function yt(t){return"string"==typeof t?t:null==t?"":String(t)}function vt(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():yt(t)}function _t(t,e){const n=e?` in ${e}`:"";throw new mt("201",`No provider for ${vt(t)} found${n}`)}function wt(t,e){null==t&&function(t,e,n,i){throw new Error(`ASSERTION ERROR: ${t}`+(null==i?"":` [Expected=> ${n} ${i} ${e} <=Actual]`))}(e,t,null,"!=")}function xt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function St(t){return{providers:t.providers||[],imports:t.imports||[]}}function Et(t){return Ct(t,Tt)||Ct(t,At)}function Ct(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ot(t){return t&&(t.hasOwnProperty(kt)||t.hasOwnProperty(Pt))?t[kt]:null}const Tt=lt({"\u0275prov":lt}),kt=lt({"\u0275inj":lt}),At=lt({ngInjectableDef:lt}),Pt=lt({ngInjectorDef:lt});var It=(()=>((It=It||{})[It.Default=0]="Default",It[It.Host=1]="Host",It[It.Self=2]="Self",It[It.SkipSelf=4]="SkipSelf",It[It.Optional=8]="Optional",It))();let Mt;function Dt(t){const e=Mt;return Mt=t,e}function Rt(t,e,n){const i=Et(t);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&It.Optional?null:void 0!==e?e:void _t(ut(t),"Injector")}function Nt(t){return{toString:t}.toString()}var Lt=(()=>((Lt=Lt||{})[Lt.OnPush=0]="OnPush",Lt[Lt.Default=1]="Default",Lt))(),jt=(()=>((jt=jt||{})[jt.Emulated=0]="Emulated",jt[jt.None=2]="None",jt[jt.ShadowDom=3]="ShadowDom",jt))();const Ft="undefined"!=typeof globalThis&&globalThis,Bt="undefined"!=typeof window&&window,Vt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,zt="undefined"!=typeof global&&global,Ut=Ft||zt||Bt||Vt,Ht={},$t=[],Gt=lt({"\u0275cmp":lt}),Wt=lt({"\u0275dir":lt}),qt=lt({"\u0275pipe":lt}),Xt=lt({"\u0275mod":lt}),Yt=lt({"\u0275loc":lt}),Kt=lt({"\u0275fac":lt}),Qt=lt({__NG_ELEMENT_ID__:lt});let Zt=0;function Jt(t){return Nt(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===Lt.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||$t,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||jt.Emulated,id:"c",styles:t.styles||$t,_:null,setInput:null,schemas:t.schemas||null,tView:null},i=t.directives,r=t.features,s=t.pipes;return n.id+=Zt++,n.inputs=re(t.inputs,e),n.outputs=re(t.outputs),r&&r.forEach(t=>t(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(te):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(ee):null,n})}function te(t){return ae(t)||function(t){return t[Wt]||null}(t)}function ee(t){return function(t){return t[qt]||null}(t)}const ne={};function ie(t){return Nt(()=>{const e={type:t.type,bootstrap:t.bootstrap||$t,declarations:t.declarations||$t,imports:t.imports||$t,exports:t.exports||$t,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&(ne[t.id]=t.type),e})}function re(t,e){if(null==t)return Ht;const n={};for(const i in t)if(t.hasOwnProperty(i)){let r=t[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,e&&(e[r]=s)}return n}const se=Jt;function oe(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,onDestroy:t.type.prototype.ngOnDestroy||null}}function ae(t){return t[Gt]||null}function le(t,e){const n=t[Xt]||null;if(!n&&!0===e)throw new Error(`Type ${ut(t)} does not have '\u0275mod' property.`);return n}function ce(t){return Array.isArray(t)&&"object"==typeof t[1]}function ue(t){return Array.isArray(t)&&!0===t[1]}function he(t){return 0!=(8&t.flags)}function de(t){return 2==(2&t.flags)}function pe(t){return 1==(1&t.flags)}function fe(t){return null!==t.template}function ge(t){return 0!=(512&t[2])}function me(t,e){return t.hasOwnProperty(Kt)?t[Kt]:null}class be{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function ye(){return ve}function ve(t){return t.type.prototype.ngOnChanges&&(t.setInput=we),_e}function _e(){const t=Se(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===Ht)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function we(t,e,n,i){const r=Se(t)||function(t,e){return t[xe]=e}(t,{previous:Ht,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],l=o[a];s[a]=new be(l&&l.currentValue,e,o===Ht),t[i]=e}ye.ngInherit=!0;const xe="__ngSimpleChanges__";function Se(t){return t[xe]||null}const Ee="http://www.w3.org/2000/svg";let Ce;function Oe(){return void 0!==Ce?Ce:"undefined"!=typeof document?document:void 0}function Te(t){return!!t.listen}const ke={createRenderer:(t,e)=>Oe()};function Ae(t){for(;Array.isArray(t);)t=t[0];return t}function Pe(t,e){return Ae(e[t])}function Ie(t,e){return Ae(e[t.index])}function Me(t,e){return t.data[e]}function De(t,e){return t[e]}function Re(t,e){const n=e[t];return ce(n)?n:n[0]}function Ne(t){return 4==(4&t[2])}function Le(t){return 128==(128&t[2])}function je(t,e){return null==e?null:t[e]}function Fe(t){t[18]=0}function Be(t,e){t[5]+=e;let n=t,i=t[3];for(;null!==i&&(1===e&&1===n[5]||-1===e&&0===n[5]);)i[5]+=e,n=i,i=i[3]}const Ve={lFrame:dn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function ze(){return Ve.bindingsEnabled}function Ue(){return Ve.lFrame.lView}function He(){return Ve.lFrame.tView}function $e(t){return Ve.lFrame.contextLView=t,t[8]}function Ge(){let t=We();for(;null!==t&&64===t.type;)t=t.parent;return t}function We(){return Ve.lFrame.currentTNode}function qe(t,e){const n=Ve.lFrame;n.currentTNode=t,n.isParent=e}function Xe(){return Ve.lFrame.isParent}function Ye(){Ve.lFrame.isParent=!1}function Ke(){return Ve.isInCheckNoChangesMode}function Qe(t){Ve.isInCheckNoChangesMode=t}function Ze(){const t=Ve.lFrame;let e=t.bindingRootIndex;return-1===e&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function Je(){return Ve.lFrame.bindingIndex}function tn(){return Ve.lFrame.bindingIndex++}function en(t){const e=Ve.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function nn(t,e){const n=Ve.lFrame;n.bindingIndex=n.bindingRootIndex=t,rn(e)}function rn(t){Ve.lFrame.currentDirectiveIndex=t}function sn(t){const e=Ve.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}function on(){return Ve.lFrame.currentQueryIndex}function an(t){Ve.lFrame.currentQueryIndex=t}function ln(t){const e=t[1];return 2===e.type?e.declTNode:1===e.type?t[6]:null}function cn(t,e,n){if(n&It.SkipSelf){let i=e,r=t;for(;!(i=i.parent,null!==i||n&It.Host||(i=ln(r),null===i||(r=r[15],10&i.type))););if(null===i)return!1;e=i,t=r}const i=Ve.lFrame=hn();return i.currentTNode=e,i.lView=t,!0}function un(t){const e=hn(),n=t[1];Ve.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function hn(){const t=Ve.lFrame,e=null===t?null:t.child;return null===e?dn(t):e}function dn(t){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=e),e}function pn(){const t=Ve.lFrame;return Ve.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const fn=pn;function gn(){const t=pn();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function mn(){return Ve.lFrame.selectedIndex}function bn(t){Ve.lFrame.selectedIndex=t}function yn(){const t=Ve.lFrame;return Me(t.tView,t.selectedIndex)}function vn(){Ve.lFrame.currentNamespace=Ee}function _n(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n=i)break}else e[a]<0&&(t[18]+=65536),(o>11>16&&(3&t[2])===e){t[2]+=2048;try{s.call(o)}finally{}}}else try{s.call(o)}finally{}}class On{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function Tn(t,e,n){const i=Te(t);let r=0;for(;re){o=s-1;break}}}for(;s>16}(t),i=e;for(;n>0;)i=i[15],n--;return i}let Nn=!0;function Ln(t){const e=Nn;return Nn=t,e}let jn=0;function Fn(t,e){const n=Vn(t,e);if(-1!==n)return n;const i=e[1];i.firstCreatePass&&(t.injectorIndex=e.length,Bn(i.data,t),Bn(e,null),Bn(i.blueprint,null));const r=zn(t,e),s=t.injectorIndex;if(Mn(r)){const t=Dn(r),n=Rn(r,e),i=n[1].data;for(let r=0;r<8;r++)e[s+r]=n[t+r]|i[t+r]}return e[s+8]=r,s}function Bn(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Vn(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===e[t.injectorIndex+8]?-1:t.injectorIndex}function zn(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=0,i=null,r=e;for(;null!==r;){const t=r[1],e=t.type;if(i=2===e?t.declTNode:1===e?r[6]:null,null===i)return-1;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return-1}function Un(t,e,n){!function(t,e,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Qt)&&(i=n[Qt]),null==i&&(i=n[Qt]=jn++);const r=255&i;e.data[t+(r>>5)]|=1<=0?255&e:qn:e}(n);if("function"==typeof s){if(!cn(e,t,i))return i&It.Host?Hn(r,n,i):$n(e,n,i,r);try{const t=s(i);if(null!=t||i&It.Optional)return t;_t(n)}finally{fn()}}else if("number"==typeof s){let r=null,o=Vn(t,e),a=-1,l=i&It.Host?e[16][6]:null;for((-1===o||i&It.SkipSelf)&&(a=-1===o?zn(t,e):e[o+8],-1!==a&&Zn(i,!1)?(r=e[1],o=Dn(a),e=Rn(a,e)):o=-1);-1!==o;){const t=e[1];if(Qn(s,o,t.data)){const t=Xn(o,e,n,r,i,l);if(t!==Wn)return t}a=e[o+8],-1!==a&&Zn(i,e[1].data[o+8]===l)&&Qn(s,o,e)?(r=t,o=Dn(a),e=Rn(a,e)):o=-1}}}return $n(e,n,i,r)}const Wn={};function qn(){return new Jn(Ge(),Ue())}function Xn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Yn(a,o,n,null==i?de(a)&&Nn:i!=o&&0!=(3&a.type),r&It.Host&&s===a);return null!==l?Kn(e,o,l,a):Wn}function Yn(t,e,n,i,r){const s=t.providerIndexes,o=e.data,a=1048575&s,l=t.directiveStart,c=s>>20,u=r?a+c:t.directiveEnd;for(let h=i?a:a+c;h=l&&t.type===n)return h}if(r){const t=o[l];if(t&&fe(t)&&t.type===n)return l}return null}function Kn(t,e,n,i){let r=t[n];const s=e.data;if(function(t){return t instanceof On}(r)){const o=r;o.resolving&&function(t,e){throw new mt("200",`Circular dependency in DI detected for ${t}`)}(vt(s[n]));const a=Ln(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Dt(o.injectImpl):null;cn(t,i,It.Default);try{r=t[n]=o.factory(void 0,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&function(t,e,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const i=ve(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,s))}(n,s[n],e)}finally{null!==l&&Dt(l),Ln(a),o.resolving=!1,fn()}}return r}function Qn(t,e,n){return!!(n[e+(t>>5)]&1<{const e=t.prototype.constructor,n=e[Kt]||ni(e),i=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==i;){const t=r[Kt]||ni(r);if(t&&t!==n)return t;r=Object.getPrototypeOf(r)}return t=>new t})}function ni(t){return gt(t)?()=>{const e=ni(ft(t));return e&&e()}:me(t)}function ii(t){return function(t,e){if("class"===e)return t.classes;if("style"===e)return t.styles;const n=t.attrs;if(n){const t=n.length;let i=0;for(;i{const i=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function r(...t){if(this instanceof r)return i.apply(this,t),this;const e=new r(...t);return n.annotation=e,n;function n(t,n,i){const r=t.hasOwnProperty(ri)?t[ri]:Object.defineProperty(t,ri,{value:[]})[ri];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(e),t}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}class oi{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=xt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return`InjectionToken ${this._desc}`}}const ai=Function;function li(t,e){void 0===e&&(e=t);for(let n=0;nArray.isArray(t)?ci(t,e):e(t))}function ui(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function hi(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function di(t,e){const n=[];for(let i=0;i=0?t[1|i]=n:(i=~i,function(t,e,n,i){let r=t.length;if(r==e)t.push(n,i);else if(1===r)t.push(i,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;)t[r]=t[r-2],r--;t[e]=n,t[e+1]=i}}(t,i,e,n)),i}function fi(t,e){const n=gi(t,e);if(n>=0)return t[1|n]}function gi(t,e){return function(t,e,n){let i=0,r=t.length>>n;for(;r!==i;){const s=i+(r-i>>1),o=t[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t.push(n+":"+("string"==typeof i?JSON.stringify(i):ut(i)))}r=`{${t.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${t.replace(vi,"\n ")}`}("\n"+t.message,r,n,i),t.ngTokenPath=r,t[yi]=null,t}const Ii=ki(si("Inject",t=>({token:t})),-1),Mi=ki(si("Optional"),8),Di=ki(si("SkipSelf"),4);let Ri,Ni;function Li(t){var e;return(null===(e=function(){if(void 0===Ri&&(Ri=null,Ut.trustedTypes))try{Ri=Ut.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(t){}return Ri}())||void 0===e?void 0:e.createHTML(t))||t}function ji(){if(void 0===Ni&&(Ni=null,Ut.trustedTypes))try{Ni=Ut.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(m){}return Ni}function Fi(t){var e;return(null===(e=ji())||void 0===e?void 0:e.createHTML(t))||t}function Bi(t){var e;return(null===(e=ji())||void 0===e?void 0:e.createScriptURL(t))||t}class Vi{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class zi extends Vi{getTypeName(){return"HTML"}}class Ui extends Vi{getTypeName(){return"Style"}}class Hi extends Vi{getTypeName(){return"Script"}}class $i extends Vi{getTypeName(){return"URL"}}class Gi extends Vi{getTypeName(){return"ResourceURL"}}function Wi(t){return t instanceof Vi?t.changingThisBreaksApplicationSecurity:t}function qi(t,e){const n=Xi(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===e}function Xi(t){return t instanceof Vi&&t.getTypeName()||null}class Yi{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t=""+t;try{const e=(new window.DOMParser).parseFromString(Li(t),"text/html").body;return null===e?this.inertDocumentHelper.getInertBodyElement(t):(e.removeChild(e.firstChild),e)}catch(e){return null}}}class Ki{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const e=this.inertDocument.createElement("body");t.appendChild(e)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=Li(t),e;const n=this.inertDocument.createElement("body");return n.innerHTML=Li(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(t){const e=t.attributes;for(let i=e.length-1;0Ji(t.trim())).join(", ")}function er(t){const e={};for(const n of t.split(","))e[n]=!0;return e}function nr(...t){const e={};for(const n of t)for(const t in n)n.hasOwnProperty(t)&&(e[t]=!0);return e}const ir=er("area,br,col,hr,img,wbr"),rr=er("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),sr=er("rp,rt"),or=nr(ir,nr(rr,er("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),nr(sr,er("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),nr(sr,rr)),ar=er("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),lr=er("srcset"),cr=nr(ar,lr,er("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),er("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),ur=er("script,style,template");class hr{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let e=t.firstChild,n=!0;for(;e;)if(e.nodeType===Node.ELEMENT_NODE?n=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,n&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);let t=this.checkClobberedElement(e,e.nextSibling);if(t){e=t;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")}startElement(t){const e=t.nodeName.toLowerCase();if(!or.hasOwnProperty(e))return this.sanitizedSomething=!0,!ur.hasOwnProperty(e);this.buf.push("<"),this.buf.push(e);const n=t.attributes;for(let i=0;i"),!0}endElement(t){const e=t.nodeName.toLowerCase();or.hasOwnProperty(e)&&!ir.hasOwnProperty(e)&&(this.buf.push(""))}chars(t){this.buf.push(fr(t))}checkClobberedElement(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`);return e}}const dr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,pr=/([^\#-~ |!])/g;function fr(t){return t.replace(/&/g,"&").replace(dr,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(pr,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let gr;function mr(t,e){let n=null;try{gr=gr||function(t){const e=new Ki(t);return function(){try{return!!(new window.DOMParser).parseFromString(Li(""),"text/html")}catch(t){return!1}}()?new Yi(e):e}(t);let i=e?String(e):"";n=gr.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=gr.getInertBodyElement(i)}while(i!==s);return Li((new hr).sanitizeChildren(br(n)||n))}finally{if(n){const t=br(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function br(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var yr=(()=>((yr=yr||{})[yr.NONE=0]="NONE",yr[yr.HTML=1]="HTML",yr[yr.STYLE=2]="STYLE",yr[yr.SCRIPT=3]="SCRIPT",yr[yr.URL=4]="URL",yr[yr.RESOURCE_URL=5]="RESOURCE_URL",yr))();function vr(t){const e=xr();return e?Fi(e.sanitize(yr.HTML,t)||""):qi(t,"HTML")?Fi(Wi(t)):mr(Oe(),yt(t))}function _r(t){const e=xr();return e?e.sanitize(yr.URL,t)||"":qi(t,"URL")?Wi(t):Ji(yt(t))}function wr(t){const e=xr();if(e)return Bi(e.sanitize(yr.RESOURCE_URL,t)||"");if(qi(t,"ResourceURL"))return Bi(Wi(t));throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)")}function xr(){const t=Ue();return t&&t[12]}const Sr="__ngContext__";function Er(t,e){t[Sr]=e}function Cr(t){const e=function(t){return t[Sr]||null}(t);return e?Array.isArray(e)?e:e.lView:null}function Or(t){return t.ngOriginalError}function Tr(t,...e){t.error(...e)}class kr{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),i=function(t){return t&&t.ngErrorLogger||Tr}(t);i(this._console,"ERROR",t),e&&i(this._console,"ORIGINAL ERROR",e),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?function(t){return t.ngDebugContext}(t)||this._findContext(Or(t)):null}_findOriginalError(t){let e=t&&Or(t);for(;e&&Or(e);)e=Or(e);return e||null}}const Ar=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Ut))();function Pr(t){return t.ownerDocument.defaultView}function Ir(t){return t.ownerDocument}function Mr(t){return t instanceof Function?t():t}var Dr=(()=>((Dr=Dr||{})[Dr.Important=1]="Important",Dr[Dr.DashCase=2]="DashCase",Dr))();function Rr(t,e){return undefined(t,e)}function Lr(t){const e=t[3];return ue(e)?e[3]:e}function jr(t){return Br(t[13])}function Fr(t){return Br(t[4])}function Br(t){for(;null!==t&&!ue(t);)t=t[4];return t}function Vr(t,e,n,i,r){if(null!=i){let s,o=!1;ue(i)?s=i:ce(i)&&(o=!0,i=i[0]);const a=Ae(i);0===t&&null!==n?null==r?Xr(e,n,a):qr(e,n,a,r||null,!0):1===t&&null!==n?qr(e,n,a,r||null,!0):2===t?function(t,e,n){const i=Kr(t,e);i&&function(t,e,n,i){Te(t)?t.removeChild(e,n,i):e.removeChild(n)}(t,i,e,n)}(e,a,o):3===t&&e.destroyNode(a),null!=s&&function(t,e,n,i,r){const s=n[7];s!==Ae(n)&&Vr(e,t,i,s,r);for(let o=10;o0&&(t[n-1][4]=i[4]);const s=hi(t,10+e);!function(t,e){rs(t,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function $r(t,e){if(!(256&e[2])){const n=e[11];Te(n)&&n.destroyNode&&rs(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Gr(t[1],t);for(;e;){let n=null;if(ce(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)ce(e)&&Gr(e[1],e),e=e[3];null===e&&(e=t),ce(e)&&Gr(e[1],e),n=e&&e[4]}e=n}}(e)}}function Gr(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let i=0;i=0?i[r=l]():i[r=-l].unsubscribe(),s+=2}else{const t=i[r=n[s+1]];n[s].call(t)}if(null!==i){for(let t=r+1;ts?"":r[u+1].toLowerCase();const e=8&i?t:null;if(e&&-1!==ls(e,c,0)||2&i&&c!==t){if(fs(i))return!1;o=!0}}}}else{if(!o&&!fs(i)&&!fs(l))return!1;if(o&&fs(l))continue;o=!1,i=l|1&i}}return fs(i)||o}function fs(t){return 0==(1&t)}function gs(t,e,n,i){if(null===e)return-1;let r=0;if(i||!n){let n=!1;for(;r-1)for(n++;n0?'="'+e+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!fs(o)&&(e+=ys(s,r),r=""),i=o,s=s||!fs(i);n++}return""!==r&&(e+=ys(s,r)),e}const _s={};function ws(t){xs(He(),Ue(),mn()+t,Ke())}function xs(t,e,n,i){if(!i)if(3==(3&e[2])){const i=t.preOrderCheckHooks;null!==i&&wn(e,i,n)}else{const i=t.preOrderHooks;null!==i&&xn(e,i,0,n)}bn(n)}function Ss(t,e){return t<<17|e<<2}function Es(t){return t>>17&32767}function Cs(t){return 2|t}function Os(t){return(131068&t)>>2}function Ts(t,e){return-131069&t|e<<2}function ks(t){return 1|t}function As(t,e){const n=t.contentQueries;if(null!==n)for(let i=0;i20&&xs(t,e,20,Ke()),n(i,r)}finally{bn(s)}}function js(t,e,n){if(he(e)){const i=e.directiveEnd;for(let r=e.directiveStart;r0;){const n=t[--e];if("number"==typeof n&&n<0)return n}return 0})(n)!=s&&n.push(s),n.push(i,r,o)}}function qs(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function Xs(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function Ys(t,e,n){if(n){if(e.exportAs)for(let i=0;i0&&ro(n)}}function ro(t){for(let n=jr(t);null!==n;n=Fr(n))for(let t=10;t0&&ro(e)}const e=t[1].components;if(null!==e)for(let n=0;n0&&ro(i)}}function so(t,e){const n=Re(e,t),i=n[1];(function(t,e){for(let n=e.length;nPromise.resolve(null))();function po(t){return t[7]||(t[7]=[])}function fo(t){return t.cleanup||(t.cleanup=[])}function go(t,e,n){return(null===t||fe(t))&&(n=function(t){for(;Array.isArray(t);){if("object"==typeof t[1])return t;t=t[0]}return null}(n[e.index])),n[11]}function mo(t,e){const n=t[9],i=n?n.get(kr,null):null;i&&i.handleError(e)}function bo(t,e,n,i,r){for(let s=0;sthis.processProvider(n,t,e)),ci([t],t=>this.processInjectorType(t,[],r)),this.records.set(_o,Io(void 0,this));const s=this.records.get(xo);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof t?null:ut(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=mi,n=It.Default){this.assertNotDestroyed();const i=Si(this),r=Dt(void 0);try{if(!(n&It.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=function(t){return"function"==typeof t||"object"==typeof t&&t instanceof oi}(t)&&Et(t);e=n&&this.injectableDefInScope(n)?Io(Ao(t),So):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&It.Self?Oo():this.parent).get(t,e=n&It.Optional&&e===mi?null:e)}catch(s){if("NullInjectorError"===s.name){if((s[yi]=s[yi]||[]).unshift(ut(t)),i)throw s;return Pi(s,t,"R3InjectorError",this.source)}throw s}finally{Dt(r),Si(i)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(ut(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=ft(t)))return!1;let i=Ot(t);const r=null==i&&t.ngModule||void 0,s=void 0===r?t:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=Ot(r)),null==i)return!1;if(null!=i.imports&&!o){let t;n.push(s);try{ci(i.imports,i=>{this.processInjectorType(i,e,n)&&(void 0===t&&(t=[]),t.push(i))})}finally{}if(void 0!==t)for(let e=0;ethis.processProvider(t,n,i||$t))}}this.injectorDefTypes.add(s);const a=me(s)||(()=>new s);this.records.set(s,Io(a,So));const l=i.providers;if(null!=l&&!o){const e=t;ci(l,t=>this.processProvider(t,e,l))}return void 0!==r&&void 0!==t.providers}processProvider(t,e,n){let i=Do(t=ft(t))?t:ft(t&&t.provide);const r=function(t,e,n){return Mo(t)?Io(void 0,t.useValue):Io(Po(t),So)}(t);if(Do(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=Io(void 0,So,!0),e.factory=()=>Ti(e.multi),this.records.set(i,e)),i=t,e.multi.push(t)}this.records.set(i,r)}hydrate(t,e){return e.value===So&&(e.value=Eo,e.value=e.factory()),"object"==typeof e.value&&e.value&&function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.ngOnDestroy}(e.value)&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){if(!t.providedIn)return!1;const e=ft(t.providedIn);return"string"==typeof e?"any"===e||e===this.scope:this.injectorDefTypes.has(e)}}function Ao(t){const e=Et(t),n=null!==e?e.factory:me(t);if(null!==n)return n;if(t instanceof oi)throw new Error(`Token ${ut(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=di(e,"?");throw new Error(`Can't resolve all parameters for ${ut(t)}: (${n.join(", ")}).`)}const n=function(t){const e=t&&(t[Tt]||t[At]);if(e){const n=function(t){if(t.hasOwnProperty("name"))return t.name;const e=(""+t).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),e}return null}(t);return null!==n?()=>n.factory(t):()=>new t}(t);throw new Error("unreachable")}function Po(t,e,n){let i;if(Do(t)){const e=ft(t);return me(e)||Ao(e)}if(Mo(t))i=()=>ft(t.useValue);else if(function(t){return!(!t||!t.useFactory)}(t))i=()=>t.useFactory(...Ti(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))i=()=>Ci(ft(t.useExisting));else{const e=ft(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return me(e)||Ao(e);i=()=>new e(...Ti(t.deps))}return i}function Io(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function Mo(t){return null!==t&&"object"==typeof t&&wi in t}function Do(t){return"function"==typeof t}const Ro=function(t,e,n){return function(t,e=null,n=null,i){const r=To(t,e,n,i);return r._resolveInjectorDefTypes(),r}({name:n},e,t,n)};class No{static create(t,e){return Array.isArray(t)?Ro(t,e,""):Ro(t.providers,t.parent,t.name||"")}}function Lo(t,e){_n(Cr(t)[1],Ge())}function jo(t){let e=function(t){return Object.getPrototypeOf(t.prototype).constructor}(t.type),n=!0;const i=[t];for(;e;){let r;if(fe(t))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(n){i.push(r);const e=t;e.inputs=Fo(t.inputs),e.declaredInputs=Fo(t.declaredInputs),e.outputs=Fo(t.outputs);const n=r.hostBindings;n&&zo(t,n);const s=r.viewQuery,o=r.contentQueries;if(s&&Bo(t,s),o&&Vo(t,o),ct(t.inputs,r.inputs),ct(t.declaredInputs,r.declaredInputs),ct(t.outputs,r.outputs),fe(r)&&r.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(r.data.animation)}}const e=r.features;if(e)for(let i=0;i=0;i--){const r=t[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Pn(r.hostAttrs,n=Pn(n,r.hostAttrs))}}(i)}function Fo(t){return t===Ht?{}:t===$t?[]:t}function Bo(t,e){const n=t.viewQuery;t.viewQuery=n?(t,i)=>{e(t,i),n(t,i)}:e}function Vo(t,e){const n=t.contentQueries;t.contentQueries=n?(t,i,r)=>{e(t,i,r),n(t,i,r)}:e}function zo(t,e){const n=t.hostBindings;t.hostBindings=n?(t,i)=>{e(t,i),n(t,i)}:e}No.THROW_IF_NOT_FOUND=mi,No.NULL=new wo,No.\u0275prov=xt({token:No,providedIn:"any",factory:()=>Ci(_o)}),No.__NG_ELEMENT_ID__=-1;let Uo=null;function Ho(){if(!Uo){const t=Ut.Symbol;if(t&&t.iterator)Uo=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;ea(Ae(t[i.index])):i.index;if(Te(n)){let o=null;if(!a&&l&&(o=function(t,e,n,i){const r=t.cleanup;if(null!=r)for(let s=0;sn?t[n]:null}"string"==typeof t&&(s+=2)}return null}(t,e,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,d=!1;else{s=ya(i,e,u,s,!1);const t=n.listen(f,r,s);h.push(s,t),c&&c.push(r,m,g,g+1)}}else s=ya(i,e,u,s,!0),f.addEventListener(r,s,o),h.push(s),c&&c.push(r,m,g,o)}else s=ya(i,e,u,s,!1);const p=i.outputs;let f;if(d&&null!==p&&(f=p[r])){const t=f.length;if(t)for(let n=0;n0;)e=e[15],t--;return e}(t,Ve.lFrame.contextLView))[8]}(t)}function _a(t,e){let n=null;const i=function(t){const e=t.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(t);for(let r=0;r=0}const Ta={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function ka(t){return t.substring(Ta.key,Ta.keyEnd)}function Aa(t){return t.substring(Ta.value,Ta.valueEnd)}function Pa(t,e){const n=Ta.textEnd;return n===e?-1:(e=Ta.keyEnd=function(t,e,n){for(;e32;)e++;return e}(t,Ta.key=e,n),Da(t,e,n))}function Ia(t,e){const n=Ta.textEnd;let i=Ta.key=Da(t,e,n);return n===i?-1:(i=Ta.keyEnd=function(t,e,n){let i;for(;e=65&&(-33&i)<=90||i>=48&&i<=57);)e++;return e}(t,i,n),i=Ra(t,i,n),i=Ta.value=Da(t,i,n),i=Ta.valueEnd=function(t,e,n){let i=-1,r=-1,s=-1,o=e,a=o;for(;o32&&(a=o),s=r,r=i,i=-33&l}return a}(t,i,n),Ra(t,i,n))}function Ma(t){Ta.key=0,Ta.keyEnd=0,Ta.value=0,Ta.valueEnd=0,Ta.textEnd=t.length}function Da(t,e,n){for(;e=0;n=Ia(e,n))qa(t,ka(e),Aa(e))}function Ba(t){Ua(pi,Va,t,!0)}function Va(t,e){for(let n=function(t){return Ma(t),Pa(t,Da(t,0,Ta.textEnd))}(e);n>=0;n=Pa(e,n))pi(t,ka(e),!0)}function za(t,e,n,i){const r=Ue(),s=He(),o=en(2);s.firstUpdatePass&&$a(s,t,o,i),e!==_s&&Xo(r,o,e)&&Xa(s,s.data[mn()],r,r[11],t,r[o+1]=function(t,e){return null==t||("string"==typeof e?t+=e:"object"==typeof t&&(t=ut(Wi(t)))),t}(e,n),i,o)}function Ua(t,e,n,i){const r=He(),s=en(2);r.firstUpdatePass&&$a(r,null,s,i);const o=Ue();if(n!==_s&&Xo(o,s,n)){const a=r.data[mn()];if(Qa(a,i)&&!Ha(r,s)){let t=i?a.classesWithoutHost:a.stylesWithoutHost;null!==t&&(n=ht(t,n||"")),ia(r,a,o,n,i)}else!function(t,e,n,i,r,s,o,a){r===_s&&(r=$t);let l=0,c=0,u=0=t.expandoStartIndex}function $a(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[mn()],o=Ha(t,n);Qa(s,i)&&null===e&&!o&&(e=!1),e=function(t,e,n,i){const r=sn(t);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(n=Wa(n=Ga(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=Ga(r,t,e,n,i),null===s){let n=function(t,e,n){const i=n?e.classBindings:e.styleBindings;if(0!==Os(i))return t[Es(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=Ga(null,t,e,n[1],i),n=Wa(n,e.attrs,i),function(t,e,n,i){t[Es(n?e.classBindings:e.styleBindings)]=i}(t,e,i,n))}else s=function(t,e,n){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(u=!0)}else c=n;if(r)if(0!==l){const e=Es(t[a+1]);t[i+1]=Ss(e,a),0!==e&&(t[e+1]=Ts(t[e+1],i)),t[a+1]=function(t,e){return 131071&t|e<<17}(t[a+1],i)}else t[i+1]=Ss(a,0),0!==a&&(t[a+1]=Ts(t[a+1],i)),a=i;else t[i+1]=Ss(l,0),0===a?a=i:t[l+1]=Ts(t[l+1],i),l=i;u&&(t[i+1]=Cs(t[i+1])),Ca(t,c,i,!0),Ca(t,c,i,!1),function(t,e,n,i,r){const s=r?t.residualClasses:t.residualStyles;null!=s&&"string"==typeof e&&gi(s,e)>=0&&(n[i+1]=ks(n[i+1]))}(e,c,t,i,s),o=Ss(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,n,o,i)}}function Ga(t,e,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a0;){const e=t[r],s=Array.isArray(e),l=s?e[1]:e,c=null===l;let u=n[r+1];u===_s&&(u=c?$t:void 0);let h=c?fi(u,i):l===i?u:void 0;if(s&&!Ka(h)&&(h=fi(e,i)),Ka(h)&&(a=h,o))return a;const d=t[r+1];r=o?Es(d):Os(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=fi(t,i))}return a}function Ka(t){return void 0!==t}function Qa(t,e){return 0!=(t.flags&(e?16:32))}function Za(t,e=""){const n=Ue(),i=He(),r=t+20,s=i.firstCreatePass?Is(i,r,1,e,null):i.data[r],o=n[r]=function(t,e){return Te(t)?t.createText(e):t.createTextNode(e)}(n[11],e);Jr(i,n,o,s),qe(s,!1)}function Ja(t){return tl("",t,""),Ja}function tl(t,e,n){const i=Ue(),r=Qo(i,t,e,n);return r!==_s&&yo(i,mn(),r),tl}function el(t,e,n,i,r){const s=Ue(),o=function(t,e,n,i,r,s){const o=Yo(t,Je(),n,r);return en(2),o?e+yt(n)+i+yt(r)+s:_s}(s,t,e,n,i,r);return o!==_s&&yo(s,mn(),o),el}function nl(t,e,n){Ua(pi,Va,Qo(Ue(),t,e,n),!0)}function il(t,e,n){const i=Ue();return Xo(i,tn(),e)&&$s(He(),yn(),i,t,e,i[11],n,!0),il}function rl(t,e,n){const i=Ue();if(Xo(i,tn(),e)){const r=He(),s=yn();$s(r,s,i,t,e,go(sn(r.data),s,i),n,!0)}return rl}const sl=void 0;var ol=["en",[["a","p"],["AM","PM"],sl],[["AM","PM"],sl,sl],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],sl,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],sl,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",sl,"{1} 'at' {0}",sl],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){const e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];let al={};function ll(t){return t in al||(al[t]=Ut.ng&&Ut.ng.common&&Ut.ng.common.locales&&Ut.ng.common.locales[t]),al[t]}var cl=(()=>((cl=cl||{})[cl.LocaleId=0]="LocaleId",cl[cl.DayPeriodsFormat=1]="DayPeriodsFormat",cl[cl.DayPeriodsStandalone=2]="DayPeriodsStandalone",cl[cl.DaysFormat=3]="DaysFormat",cl[cl.DaysStandalone=4]="DaysStandalone",cl[cl.MonthsFormat=5]="MonthsFormat",cl[cl.MonthsStandalone=6]="MonthsStandalone",cl[cl.Eras=7]="Eras",cl[cl.FirstDayOfWeek=8]="FirstDayOfWeek",cl[cl.WeekendRange=9]="WeekendRange",cl[cl.DateFormat=10]="DateFormat",cl[cl.TimeFormat=11]="TimeFormat",cl[cl.DateTimeFormat=12]="DateTimeFormat",cl[cl.NumberSymbols=13]="NumberSymbols",cl[cl.NumberFormats=14]="NumberFormats",cl[cl.CurrencyCode=15]="CurrencyCode",cl[cl.CurrencySymbol=16]="CurrencySymbol",cl[cl.CurrencyName=17]="CurrencyName",cl[cl.Currencies=18]="Currencies",cl[cl.Directionality=19]="Directionality",cl[cl.PluralCase=20]="PluralCase",cl[cl.ExtraData=21]="ExtraData",cl))();const ul="en-US";let hl=ul;function dl(t){wt(t,"Expected localeId to be defined"),"string"==typeof t&&(hl=t.toLowerCase().replace(/_/g,"-"))}function pl(t,e,n,i,r){if(t=ft(t),Array.isArray(t))for(let s=0;s>20;if(Do(t)||!t.multi){const i=new On(l,r,ea),p=ml(a,e,r?u:u+d,h);-1===p?(Un(Fn(c,o),s,a),fl(s,t,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(i),o.push(i)):(n[p]=i,o[p]=i)}else{const p=ml(a,e,u+d,h),f=ml(a,e,u,u+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Un(Fn(c,o),s,a);const u=function(t,e,n,i,r){const s=new On(t,n,ea);return s.multi=[],s.index=e,s.componentProviders=0,gl(s,r,i&&!n),s}(r?yl:bl,n.length,r,i,l);!r&&m&&(n[f].providerFactory=u),fl(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(u),o.push(u)}else fl(s,t,p>-1?p:f,gl(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function fl(t,e,n,i){const r=Do(e);if(r||function(t){return!!t.useClass}(e)){const s=(e.useClass||e).prototype.ngOnDestroy;if(s){const o=t.destroyHooks||(t.destroyHooks=[]);if(!r&&e.multi){const t=o.indexOf(n);-1===t?o.push(n,[i,s]):o[t+1].push(i,s)}else o.push(n,s)}}}function gl(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function ml(t,e,n,i){for(let r=n;r{n.providersResolver=(n,i)=>function(t,e,n){const i=He();if(i.firstCreatePass){const r=fe(t);pl(n,i.data,i.blueprint,r,!0),pl(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class wl{}const xl="ngComponent";class Sl{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${ut(t)}. Did you add it to @NgModule.entryComponents?`);return e[xl]=t,e}(t)}}class El{}function Cl(...t){}function Ol(t,e){return new kl(Ie(t,e))}El.NULL=new Sl;const Tl=function(){return Ol(Ge(),Ue())};let kl=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=Tl,t})();function Al(t){return t instanceof kl?t.nativeElement:t}class Pl{}let Il=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Ml(),t})();const Ml=function(){const t=Ue(),e=Re(Ge().index,t);return function(t){return t[11]}(ce(e)?e:t)};let Dl=(()=>{class t{}return t.\u0275prov=xt({token:t,providedIn:"root",factory:()=>null}),t})();class Rl{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Nl=new Rl("12.2.5");class Ll{constructor(){}supports(t){return Go(t)}create(t){return new Fl(t)}}const jl=(t,e)=>e;class Fl{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||jl}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,i=0,r=null;for(;e||n;){const s=!n||e&&e.currentIndex{i=this._trackByFn(e,t),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,t,i,e)),Object.is(r.item,t)||this._addIdentityChange(r,t)):(r=this._mismatch(r,t,i,e),s=!0),r=r._next,e++}),this.length=e;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,i){let r;return null===t?r=this._itTail:(r=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,r,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,r,i)):t=this._addAfter(new Bl(e,n),r,i),t}_verifyReinsertion(t,e,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?t=this._reinsertAfter(r,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,r=t._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const i=null===e?this._itHead:e._next;return t._next=i,t._prev=e,null===i?this._itTail=t:i._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new zl),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new zl),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class Bl{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Vl{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class zl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new Vl,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Ul(t,e,n){const i=t.previousIndex;if(null===i)return i;let r=0;return n&&i{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const i=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,i)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new Gl(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class Gl{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function Wl(){return new ql([new Ll])}let ql=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Wl()),deps:[[t,new Di,new Mi]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(t){return t.name||typeof t}(t)}'`)}}return t.\u0275prov=xt({token:t,providedIn:"root",factory:Wl}),t})();function Xl(){return new Yl([new Hl])}let Yl=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Xl()),deps:[[t,new Di,new Mi]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=xt({token:t,providedIn:"root",factory:Xl}),t})();function Kl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(Ae(s)),ue(s))for(let t=10;t-1&&(Hr(t,n),hi(e,n))}this._attachedToViewContainer=!1}$r(this._lView[1],this._lView)}onDestroy(t){Us(this._lView[1],this._lView,null,t)}markForCheck(){ao(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){lo(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){Qe(!0);try{lo(t,e,n)}finally{Qe(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(t,e){rs(t,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class Zl extends Ql{constructor(t){super(t),this._view=t}detectChanges(){co(this._view)}checkNoChanges(){!function(t){Qe(!0);try{co(t)}finally{Qe(!1)}}(this._view)}get context(){return null}}const Jl=function(t){return function(t,e,n){if(de(t)&&!n){const n=Re(t.index,e);return new Ql(n,n)}return 47&t.type?new Ql(e[16],e):null}(Ge(),Ue(),16==(16&t))};let tc=(()=>{class t{}return t.__NG_ELEMENT_ID__=Jl,t})();const ec=[new Hl],nc=new ql([new Ll]),ic=new Yl(ec),rc=function(){return lc(Ge(),Ue())};let sc=(()=>{class t{}return t.__NG_ELEMENT_ID__=rc,t})();const oc=sc,ac=class extends oc{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=Ps(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(e)),Ds(e,n,t),new Ql(n)}};function lc(t,e){return 4&t.type?new ac(e,t,Ol(t,e)):null}class cc{}const uc=function(){return mc(Ge(),Ue())};let hc=(()=>{class t{}return t.__NG_ELEMENT_ID__=uc,t})();const dc=hc,pc=class extends dc{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return Ol(this._hostTNode,this._hostLView)}get injector(){return new Jn(this._hostTNode,this._hostLView)}get parentInjector(){const t=zn(this._hostTNode,this._hostLView);if(Mn(t)){const e=Rn(t,this._hostLView),n=Dn(t);return new Jn(e[1].data[n+8],e)}return new Jn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=fc(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,e,n){const i=t.createEmbeddedView(e||{});return this.insert(i,n),i}createComponent(t,e,n,i,r){const s=n||this.parentInjector;if(!r&&null==t.ngModule&&s){const t=s.get(cc,null);t&&(r=t)}const o=t.create(s,i,void 0,r);return this.insert(o.hostView,e),o}insert(t,e){const n=t._lView,i=n[1];if(function(t){return ue(t[3])}(n)){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],i=new pc(e,e[6],e[3]);i.detach(i.indexOf(t))}}const r=this._adjustIndex(e),s=this._lContainer;!function(t,e,n,i){const r=10+i,s=n.length;i>0&&(n[r-1][4]=e),iAr});class wc extends wl{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=function(t){return t.map(vs).join(",")}(t.selectors),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return vc(this.componentDef.inputs)}get outputs(){return vc(this.componentDef.outputs)}create(t,e,n,i){const r=(i=i||this.ngModule)?function(t,e){return{get:(n,i,r)=>{const s=t.get(n,bc,r);return s!==bc||i===bc?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Pl,ke),o=r.get(Dl,null),a=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(Te(t))return t.selectRootElement(e,n===jt.ShadowDom);let i="string"==typeof e?t.querySelector(e):e;return i.textContent="",i}(a,n,this.componentDef.encapsulation):zr(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?Ee:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),u=this.componentDef.onPush?576:528,h=function(t,e){return{components:[],scheduler:t||Ar,clean:ho,playerHandler:e||null,flags:0}}(),d=zs(0,null,null,1,0,null,null,null,null,null),p=Ps(null,d,h,u,null,null,s,a,o,r);let f,g;un(p);try{const t=function(t,e,n,i,r,s){const o=n[1];n[20]=t;const a=Is(o,20,2,"#host",null),l=a.mergedAttrs=e.hostAttrs;null!==l&&(vo(a,l,!0),null!==t&&(Tn(r,t,l),null!==a.classes&&as(r,t,a.classes),null!==a.styles&&os(r,t,a.styles)));const c=i.createRenderer(t,e),u=Ps(n,Vs(e),null,e.onPush?64:16,n[20],a,i,c,s||null,null);return o.firstCreatePass&&(Un(Fn(a,n),o,e.type),Xs(o,a),Ks(a,n.length,1)),oo(n,u),n[20]=u}(c,this.componentDef,p,s,a);if(c)if(n)Tn(a,c,["ng-version",Nl.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let i=1,r=2;for(;i0&&as(a,c,e.join(" "))}if(g=Me(d,20),void 0!==e){const t=g.projection=[];for(let n=0;nt(o,e)),e.contentQueries){const t=Ge();e.contentQueries(1,o,t.directiveStart)}const a=Ge();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(bn(a.index),Ws(n[1],a,0,a.directiveStart,a.directiveEnd,e),qs(e,o)),o}(t,this.componentDef,p,h,[Lo]),Ds(d,p,null)}finally{gn()}return new xc(this.componentType,f,Ol(g,p),p,g)}}class xc extends class{}{constructor(t,e,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.instance=e,this.hostView=this.changeDetectorRef=new Zl(i),this.componentType=t}get injector(){return new Jn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Sc=new Map;class Ec extends cc{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new yc(this);const n=le(t),i=function(t){return t[Yt]||null}(t);i&&dl(i),this._bootstrapComponents=Mr(n.bootstrap),this._r3Injector=To(t,e,[{provide:cc,useValue:this},{provide:El,useValue:this.componentFactoryResolver}],ut(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=No.THROW_IF_NOT_FOUND,n=It.Default){return t===No||t===cc||t===_o?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Cc extends class{}{constructor(t){super(),this.moduleType=t,null!==le(t)&&function(t){const e=new Set;!function t(n){const i=le(n,!0),r=i.id;null!==r&&(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${ut(e)} vs ${ut(e.name)}`)}(r,Sc.get(r),n),Sc.set(r,n));const s=Mr(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Ec(this.moduleType,t)}}function Oc(t,e,n){const i=Ze()+t,r=Ue();return r[i]===_s?qo(r,i,n?e.call(n):e()):function(t,e){return t[e]}(r,i)}function Tc(t,e,n,i){return Pc(Ue(),Ze(),t,e,n,i)}function kc(t,e,n,i,r,s){return function(t,e,n,i,r,s,o,a){const l=e+n;return function(t,e,n,i,r){const s=Yo(t,e,n,i);return Xo(t,e+2,r)||s}(t,l,r,s,o)?qo(t,l+3,a?i.call(a,r,s,o):i(r,s,o)):Ac(t,l+3)}(Ue(),Ze(),t,e,n,i,r,s)}function Ac(t,e){const n=t[e];return n===_s?void 0:n}function Pc(t,e,n,i,r,s){const o=e+n;return Xo(t,o,r)?qo(t,o+1,s?i.call(s,r):i(r)):Ac(t,o+1)}function Ic(t,e){const n=He();let i;const r=t+20;n.firstCreatePass?(i=function(t,e){if(e)for(let n=e.length-1;n>=0;n--){const i=e[n];if(t===i.name)return i}throw new mt("302",`The pipe '${t}' could not be found!`)}(e,n.pipeRegistry),n.data[r]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(r,i.onDestroy)):i=n.data[r];const s=i.factory||(i.factory=me(i.type)),o=Dt(ea);try{const t=Ln(!1),e=s();return Ln(t),function(t,e,n,i){n>=t.data.length&&(t.data[n]=null,t.blueprint[n]=null),e[n]=i}(n,Ue(),r,e),e}finally{Dt(o)}}function Mc(t,e,n){const i=t+20,r=Ue(),s=De(r,i);return function(t,e){$o.isWrapped(e)&&(e=$o.unwrap(e),t[Je()]=_s);return e}(r,function(t,e){return t[1].data[e].pure}(r,i)?Pc(r,Ze(),e,s.transform,n,s):s.transform(n))}function Dc(t){return e=>{setTimeout(t,void 0,e)}}const Rc=class extends P{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){var i,r,s;let o=t,a=e||(()=>null),l=n;if(t&&"object"==typeof t){const e=t;o=null===(i=e.next)||void 0===i?void 0:i.bind(e),a=null===(r=e.error)||void 0===r?void 0:r.bind(e),l=null===(s=e.complete)||void 0===s?void 0:s.bind(e)}this.__isAsync&&(a=Dc(a),o&&(o=Dc(o)),l&&(l=Dc(l)));const c=super.subscribe({next:o,error:a,complete:l});return t instanceof g&&t.add(c),c}};function Nc(){return this._results[Ho()]()}class Lc{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const e=Ho(),n=Lc.prototype;n[e]||(n[e]=Nc)}get changes(){return this._changes||(this._changes=new Rc)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,e){const n=this;n.dirty=!1;const i=li(t);(this._changesDetected=!function(t,e,n){if(t.length!==e.length)return!1;for(let i=0;i0)i.push(o[t/2]);else{const r=s[t+1],o=e[-n];for(let t=10;t{class t{constructor(t){this.appInits=t,this.resolve=Cl,this.reject=Cl,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n{e.subscribe({complete:t,error:n})});t.push(n)}}Promise.all(t).then(()=>{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(Ci(tu,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const nu=new oi("AppId"),iu={provide:nu,useFactory:function(){return`${ru()}${ru()}${ru()}`},deps:[]};function ru(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const su=new oi("Platform Initializer"),ou=new oi("Platform ID"),au=new oi("appBootstrapListener");let lu=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const cu=new oi("LocaleId"),uu=new oi("DefaultCurrencyCode");class hu{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const du=function(t){return new Cc(t)},pu=du,fu=function(t){return Promise.resolve(du(t))},gu=function(t){const e=du(t),n=Mr(le(t).declarations).reduce((t,e)=>{const n=ae(e);return n&&t.push(new wc(n)),t},[]);return new hu(e,n)},mu=gu,bu=function(t){return Promise.resolve(gu(t))};let yu=(()=>{class t{constructor(){this.compileModuleSync=pu,this.compileModuleAsync=fu,this.compileModuleAndAllComponentsSync=mu,this.compileModuleAndAllComponentsAsync=bu}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const vu=new oi("compilerOptions"),_u=(()=>Promise.resolve(0))();function wu(t){"undefined"==typeof Zone?_u.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class xu{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Rc(!1),this.onMicrotaskEmpty=new Rc(!1),this.onStable=new Rc(!1),this.onError=new Rc(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const i=this;i._nesting=0,i._outer=i._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!n&&e,i.shouldCoalesceRunChangeDetection=n,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function(){let t=Ut.requestAnimationFrame,e=Ut.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=()=>{!function(t){t.isCheckStableRunning||-1!==t.lastRequestAnimationFrameId||(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(Ut,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,Cu(t),t.isCheckStableRunning=!0,Eu(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Cu(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,i,r,s,o,a)=>{try{return Ou(t),n.invokeTask(r,s,o,a)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||t.shouldCoalesceRunChangeDetection)&&e(),Tu(t)}},onInvoke:(n,i,r,s,o,a,l)=>{try{return Ou(t),n.invoke(r,s,o,a,l)}finally{t.shouldCoalesceRunChangeDetection&&e(),Tu(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Cu(t),Eu(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,i,r)=>(e.handleError(i,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}(i)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!xu.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(xu.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,t,Su,Cl,Cl);try{return r.runTask(s,e,n)}finally{r.cancelTask(s)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}const Su={};function Eu(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Cu(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function Ou(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Tu(t){t._nesting--,Eu(t)}class ku{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Rc,this.onMicrotaskEmpty=new Rc,this.onStable=new Rc,this.onError=new Rc}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,i){return t.apply(e,n)}}let Au=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{xu.assertNotInAngularZone(),wu(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())wu(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let i=-1;e&&e>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==i),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})}whenStable(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Pu=(()=>{class t{constructor(){this._applications=new Map,Mu.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return Mu.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Iu{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let Mu=new Iu,Du=!0,Ru=!1;function Nu(){return Ru=!0,Du}let Lu;const ju=new oi("AllowMultipleToken");function Fu(t,e,n=[]){const i=`Platform: ${e}`,r=new oi(i);return(e=[])=>{let s=Bu();if(!s||s.injector.get(ju,!1))if(t)t(n.concat(e).concat({provide:r,useValue:!0}));else{const t=n.concat(e).concat({provide:r,useValue:!0},{provide:xo,useValue:"platform"});!function(t){if(Lu&&!Lu.destroyed&&!Lu.injector.get(ju,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Lu=t.get(Vu);const e=t.get(su,null);e&&e.forEach(t=>t())}(No.create({providers:t,name:i}))}return function(t){const e=Bu();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function Bu(){return Lu&&!Lu.destroyed?Lu:null}let Vu=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new ku:("zone.js"===t?void 0:t)||new xu({enableLongStackTrace:Nu(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),n}(e?e.ngZone:void 0,{ngZoneEventCoalescing:e&&e.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:e&&e.ngZoneRunCoalescing||!1}),i=[{provide:xu,useValue:n}];return n.run(()=>{const r=No.create({providers:i,parent:this.injector,name:t.moduleType.name}),s=t.create(r),o=s.injector.get(kr,null);if(!o)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const t=n.onError.subscribe({next:t=>{o.handleError(t)}});s.onDestroy(()=>{Hu(this._modules,s),t.unsubscribe()})}),function(t,n,i){try{const e=i();return ha(e)?e.catch(e=>{throw n.runOutsideAngular(()=>t.handleError(e)),e}):e}catch(e){throw n.runOutsideAngular(()=>t.handleError(e)),e}}(o,n,()=>{const t=s.injector.get(eu);return t.runInitializers(),t.donePromise.then(()=>(dl(s.injector.get(cu,ul)||ul),this._moduleDoBootstrap(s),s))})})}bootstrapModule(t,e=[]){const n=zu({},e);return function(t,e,n){const i=new Cc(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(Uu);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${ut(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(e)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function zu(t,e){return Array.isArray(e)?e.reduce(zu,t):Object.assign(Object.assign({},t),e)}let Uu=(()=>{class t{constructor(t,e,n,i,r){this._zone=t,this._injector=e,this._exceptionHandler=n,this._componentFactoryResolver=i,this._initStatus=r,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const s=new C(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),o=new C(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{xu.assertNotInAngularZone(),wu(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{xu.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=Q(s,o.pipe(at()))}bootstrap(t,e){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=t instanceof wl?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=function(t){return t.isBoundToModule}(n)?void 0:this._injector.get(cc),r=n.create(No.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Au,null),a=o&&r.injector.get(Pu);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),Hu(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;Hu(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(au,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(No),Ci(kr),Ci(El),Ci(eu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Hu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const $u=Fu(null,"core",[{provide:ou,useValue:"unknown"},{provide:Vu,deps:[No]},{provide:Pu,deps:[]},{provide:lu,deps:[]}]),Gu=[{provide:Uu,useClass:Uu,deps:[xu,No,kr,El,eu]},{provide:_c,deps:[xu],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:eu,useClass:eu,deps:[[new Mi,tu]]},{provide:yu,useClass:yu,deps:[]},iu,{provide:ql,useFactory:function(){return nc},deps:[]},{provide:Yl,useFactory:function(){return ic},deps:[]},{provide:cu,useFactory:function(t){return dl(t=t||"undefined"!=typeof $localize&&$localize.locale||ul),t},deps:[[new Ii(cu),new Mi,new Di]]},{provide:uu,useValue:"USD"}];let Wu=(()=>{class t{constructor(t){}}return t.\u0275fac=function(e){return new(e||t)(Ci(Uu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Gu}),t})(),qu=null;function Xu(){return qu}const Yu=new oi("DocumentToken");let Ku=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:Qu,token:t,providedIn:"platform"}),t})();function Qu(){return Ci(Zu)}let Zu=(()=>{class t extends Ku{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Xu().getBaseHref(this._doc)}onPopState(t){const e=Xu().getGlobalEventTarget(this._doc,"window");return e.addEventListener("popstate",t,!1),()=>e.removeEventListener("popstate",t)}onHashChange(t){const e=Xu().getGlobalEventTarget(this._doc,"window");return e.addEventListener("hashchange",t,!1),()=>e.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){Ju()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){Ju()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:th,token:t,providedIn:"platform"}),t})();function Ju(){return!!window.history.pushState}function th(){return new Zu(Ci(Yu))}function eh(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}function nh(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}function ih(t){return t&&"?"!==t[0]?"?"+t:t}let rh=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:sh,token:t,providedIn:"root"}),t})();function sh(t){const e=Ci(Yu).location;return new ah(Ci(Ku),e&&e.origin||"")}const oh=new oi("appBaseHref");let ah=(()=>{class t extends rh{constructor(t,e){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=e}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return eh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+ih(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+ih(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+ih(i));this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var e,n;null===(n=(e=this._platformLocation).historyGo)||void 0===n||n.call(e,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ku),Ci(oh,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),lh=(()=>{class t{constructor(t,e){this._subject=new Rc,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=nh(uh(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+ih(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,uh(e)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ih(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ih(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var e,n;null===(n=(e=this._platformStrategy).historyGo)||void 0===n||n.call(e,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}))}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}}return t.\u0275fac=function(e){return new(e||t)(Ci(rh),Ci(Ku))},t.normalizeQueryParams=ih,t.joinWithSlash=eh,t.stripTrailingSlash=nh,t.\u0275prov=xt({factory:ch,token:t,providedIn:"root"}),t})();function ch(){return new lh(Ci(rh),Ci(Ku))}function uh(t){return t.replace(/\/index.html$/,"")}var hh=(()=>((hh=hh||{})[hh.Zero=0]="Zero",hh[hh.One=1]="One",hh[hh.Two=2]="Two",hh[hh.Few=3]="Few",hh[hh.Many=4]="Many",hh[hh.Other=5]="Other",hh))();const dh=function(t){return function(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=ll(e);if(n)return n;const i=e.split("-")[0];if(n=ll(i),n)return n;if("en"===i)return ol;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[cl.PluralCase]};class ph{}let fh=(()=>{class t extends ph{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(dh(e||this.locale)(t)){case hh.Zero:return"zero";case hh.One:return"one";case hh.Two:return"two";case hh.Few:return"few";case hh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(Ci(cu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function gh(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[i,r]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(i.trim()===e)return decodeURIComponent(r)}return null}let mh=(()=>{class t{constructor(t,e,n,i){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&(Go(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachChangedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachRemovedItem(t=>{t.previousValue&&this._toggleClass(t.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(t=>{if("string"!=typeof t.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${ut(t.item)}`);this._toggleClass(t.item,!0)}),t.forEachRemovedItem(t=>this._toggleClass(t.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!0)):Object.keys(t).forEach(e=>this._toggleClass(e,!!t[e])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!1)):Object.keys(t).forEach(t=>this._toggleClass(t,!1)))}_toggleClass(t,e){(t=t.trim())&&t.split(/\s+/g).forEach(t=>{e?this._renderer.addClass(this._ngEl.nativeElement,t):this._renderer.removeClass(this._ngEl.nativeElement,t)})}}return t.\u0275fac=function(e){return new(e||t)(ea(ql),ea(Yl),ea(kl),ea(Il))},t.\u0275dir=se({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class bh{constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let yh=(()=>{class t{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const e=this._ngForOf;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${e}' of type '${function(t){return t.name||typeof t}(e)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,i)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new bh(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new vh(t,n);e.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new vh(t,r);e.push(s)}});for(let n=0;n{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(ql))},t.\u0275dir=se({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class vh{constructor(t,e){this.record=t,this.view=e}}let _h=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new wh,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){xh("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){xh("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc))},t.\u0275dir=se({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class wh{constructor(){this.$implicit=null,this.ngIf=null}}function xh(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${ut(e)}'.`)}class Sh{constructor(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()}}let Eh=(()=>{class t{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let e=0;e{class t{constructor(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new Sh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(Eh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Oh=(()=>{class t{constructor(t,e,n){n._addDefault(new Sh(t,e))}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(sc),ea(Eh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchDefault",""]]}),t})(),Th=(()=>{class t{constructor(t,e,n){this._ngEl=t,this._differs=e,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,e){const[n,i]=t.split(".");null!=(e=null!=e&&i?`${e}${i}`:e)?this._renderer.setStyle(this._ngEl.nativeElement,n,e):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(t){t.forEachRemovedItem(t=>this._setStyle(t.key,null)),t.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),t.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Yl),ea(Il))},t.\u0275dir=se({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),kh=(()=>{class t{constructor(t){this._viewContainerRef=t,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(t){if(t.ngTemplateOutlet){const t=this._viewContainerRef;this._viewRef&&t.remove(t.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?t.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&t.ngTemplateOutletContext&&this.ngTemplateOutletContext&&(this._viewRef.context=this.ngTemplateOutletContext)}}return t.\u0275fac=function(e){return new(e||t)(ea(hc))},t.\u0275dir=se({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[ye]}),t})();class Ah{createSubscription(t,e){return t.subscribe({next:e,error:t=>{throw t}})}dispose(t){t.unsubscribe()}onDestroy(t){t.unsubscribe()}}class Ph{createSubscription(t,e){return t.then(e,t=>{throw t})}dispose(t){}onDestroy(t){}}const Ih=new Ph,Mh=new Ah;let Dh=(()=>{class t{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,e=>this._updateLatestValue(t,e))}_selectStrategy(e){if(ha(e))return Ih;if(da(e))return Mh;throw function(t,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${ut(t)}'`)}(t,e)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,e){t===this._obj&&(this._latestValue=e,this._ref.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(ea(tc,16))},t.\u0275pipe=oe({name:"async",type:t,pure:!1}),t})(),Rh=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:ph,useClass:fh}]}),t})();const Nh="browser";function Lh(t){return t===Nh}class jh{}class Fh extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(t){qu||(qu=t)}(new Fh)}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getBaseHref(t){const e=(Vh=Vh||document.querySelector("base"),Vh?Vh.getAttribute("href"):null);return null==e?null:function(t){Bh=Bh||document.createElement("a"),Bh.setAttribute("href",t);const e=Bh.pathname;return"/"===e.charAt(0)?e:`/${e}`}(e)}resetBaseElement(){Vh=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return gh(document.cookie,t)}}let Bh,Vh=null;const zh=new oi("TRANSITION_ID"),Uh=[{provide:tu,useFactory:function(t,e,n){return()=>{n.get(eu).donePromise.then(()=>{const n=Xu(),i=e.querySelectorAll(`style[ng-transition="${t}"]`);for(let t=0;t{const i=t.findTestabilityInTree(e,n);if(null==i)throw new Error("Could not find testability for element.");return i},Ut.getAllAngularTestabilities=()=>t.getAllTestabilities(),Ut.getAllAngularRootElements=()=>t.getAllRootElements(),Ut.frameworkStabilizers||(Ut.frameworkStabilizers=[]),Ut.frameworkStabilizers.push(t=>{const e=Ut.getAllAngularTestabilities();let n=e.length,i=!1;const r=function(e){i=i||e,n--,0==n&&t(i)};e.forEach(function(t){t.whenStable(r)})})}findTestabilityInTree(t,e,n){if(null==e)return null;const i=t.getTestability(e);return null!=i?i:n?Xu().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}let $h=(()=>{class t{build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Gh=new oi("EventManagerPlugins");let Wh=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let i=0;i{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Yh=(()=>{class t extends Xh{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,e,n){t.forEach(t=>{const i=this._doc.createElement("style");i.textContent=t,n.push(e.appendChild(i))})}addHost(t){const e=[];this._addStylesToHost(this._stylesSet,t,e),this._hostNodes.set(t,e)}removeHost(t){const e=this._hostNodes.get(t);e&&e.forEach(Kh),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((e,n)=>{this._addStylesToHost(t,n,e)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(Kh))}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Kh(t){Xu().remove(t)}const Qh={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Zh=/%COMP%/g;function Jh(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let ed=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new nd(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case jt.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new id(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case jt.ShadowDom:return new rd(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=Jh(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(Ci(Wh),Ci(Yh),Ci(nu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class nd{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(Qh[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,i){if(i){e=i+":"+e;const r=Qh[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=Qh[n];i?t.removeAttributeNS(i,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&(Dr.DashCase|Dr.Important)?t.style.setProperty(e,n,i&Dr.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&Dr.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,td(n)):this.eventManager.addEventListener(t,e,td(n))}}class id extends nd{constructor(t,e,n,i){super(t),this.component=n;const r=Jh(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr=function(t){return"_ngcontent-%COMP%".replace(Zh,t)}(i+"-"+n.id),this.hostAttr=function(t){return"_nghost-%COMP%".replace(Zh,t)}(i+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class rd extends nd{constructor(t,e,n,i){super(t),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=Jh(i.id,i.styles,[]);for(let s=0;s{class t extends qh{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const od=["alt","control","meta","shift"],ad={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},ld={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},cd={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let ud=(()=>{class t extends qh{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,i){const r=t.parseEventName(n),s=t.eventCallback(r.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Xu().onAndCancel(e,r.domEventName,s))}static parseEventName(e){const n=e.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=t._normalizeKey(n.pop());let s="";if(od.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),s+=t+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&ld.hasOwnProperty(e)&&(e=ld[e]))}return ad[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),od.forEach(i=>{i!=n&&cd[i](t)&&(e+=i+".")}),e+=n,e}static eventCallback(e,n,i){return r=>{t.getEventFullKey(r)===e&&i.runGuarded(()=>n(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),hd=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return Ci(dd)},token:t,providedIn:"root"}),t})(),dd=(()=>{class t extends hd{constructor(t){super(),this._doc=t}sanitize(t,e){if(null==e)return null;switch(t){case yr.NONE:return e;case yr.HTML:return qi(e,"HTML")?Wi(e):mr(this._doc,String(e)).toString();case yr.STYLE:return qi(e,"Style")?Wi(e):e;case yr.SCRIPT:if(qi(e,"Script"))return Wi(e);throw new Error("unsafe value used in a script context");case yr.URL:return Xi(e),qi(e,"URL")?Wi(e):Ji(String(e));case yr.RESOURCE_URL:if(qi(e,"ResourceURL"))return Wi(e);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function(t){return new zi(t)}(t)}bypassSecurityTrustStyle(t){return function(t){return new Ui(t)}(t)}bypassSecurityTrustScript(t){return function(t){return new Hi(t)}(t)}bypassSecurityTrustUrl(t){return function(t){return new $i(t)}(t)}bypassSecurityTrustResourceUrl(t){return function(t){return new Gi(t)}(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return function(t){return new dd(t.get(Yu))}(Ci(_o))},token:t,providedIn:"root"}),t})();const pd=Fu($u,"browser",[{provide:ou,useValue:Nh},{provide:su,useValue:function(){Fh.makeCurrent(),Hh.init()},multi:!0},{provide:Yu,useFactory:function(){return function(t){Ce=t}(document),document},deps:[]}]),fd=[[],{provide:xo,useValue:"root"},{provide:kr,useFactory:function(){return new kr},deps:[]},{provide:Gh,useClass:sd,multi:!0,deps:[Yu,xu,ou]},{provide:Gh,useClass:ud,multi:!0,deps:[Yu]},[],{provide:ed,useClass:ed,deps:[Wh,Yh,nu]},{provide:Pl,useExisting:ed},{provide:Xh,useExisting:Yh},{provide:Yh,useClass:Yh,deps:[Yu]},{provide:Au,useClass:Au,deps:[xu]},{provide:Wh,useClass:Wh,deps:[Gh,xu]},{provide:jh,useClass:$h,deps:[]},[]];let gd=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:nu,useValue:e.appId},{provide:zh,useExisting:nu},Uh]}}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:fd,imports:[Rh,Wu]}),t})();function md(t){return null!=t&&"false"!=`${t}`}function bd(t,e=0){return function(t){return!isNaN(parseFloat(t))&&!isNaN(Number(t))}(t)?Number(t):e}function yd(t){return Array.isArray(t)?t:[t]}function vd(t){return null==t?"":"string"==typeof t?t:`${t}px`}function _d(t){return t instanceof kl?t.nativeElement:t}function wd(...t){let e=t[t.length-1];return M(e)?(t.pop(),z(t,e)):K(t)}function xd(t,e,n,i){return a(n)&&(i=n,n=void 0),i?xd(t,e,n).pipe(D(t=>d(t)?i(...t):i(t))):new C(i=>{Sd(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Sd(t,e,n,i,r){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const i=t;t.addEventListener(e,n,r),s=()=>i.removeEventListener(e,n,r)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const i=t;t.on(e,n),s=()=>i.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const i=t;t.addListener(e,n),s=()=>i.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let s=0,o=t.length;s{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class Td extends Od{constructor(t,e=Od.now){super(t,()=>Td.delegate&&Td.delegate!==this?Td.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return Td.delegate&&Td.delegate!==this?Td.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}new class extends Td{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,i=-1,r=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++i0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame(()=>t.flush(null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(cancelAnimationFrame(e),t.scheduled=void 0)}});let kd=1;const Ad=Promise.resolve(),Pd={};function Id(t){return t in Pd&&(delete Pd[t],!0)}const Md={setImmediate(t){const e=kd++;return Pd[e]=!0,Ad.then(()=>Id(e)&&t()),e},clearImmediate(t){Id(t)}};new class extends Td{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,i=-1,r=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++i0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=Md.setImmediate(t.flush.bind(t,null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(Md.clearImmediate(e),t.scheduled=void 0)}});function Dd(t){return!!t&&(t instanceof C||"function"==typeof t.lift&&"function"==typeof t.subscribe)}function Rd(t,e){return n=>n.lift(new Nd(t,e))}class Nd{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new Ld(t,this.compare,this.keySelector))}}class Ld extends v{constructor(t,e,n){super(t),this.keySelector=n,this.hasKey=!1,"function"==typeof e&&(this.compare=e)}compare(t,e){return t===e}_next(t){let e;try{const{keySelector:n}=this;e=n?n(t):t}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:t}=this;n=t(this.key,e)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))}}const jd=new Td(Cd);class Fd{constructor(t){this.durationSelector=t}call(t,e){return e.subscribe(new Bd(t,this.durationSelector))}}class Bd extends ${constructor(t,e){super(t),this.durationSelector=e,this.hasValue=!1}_next(t){if(this.value=t,this.hasValue=!0,!this.throttled){let n;try{const{durationSelector:e}=this;n=e(t)}catch(e){return this.destination.error(e)}const i=G(n,new H(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:t,hasValue:e,throttled:n}=this;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),e&&(this.value=void 0,this.hasValue=!1,this.destination.next(t))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function Vd(t){return!d(t)&&t-parseFloat(t)+1>=0}function zd(t){const{index:e,period:n,subscriber:i}=t;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}}function Ud(t,e=jd){return function(t){return function(e){return e.lift(new Fd(t))}}(()=>function(t=0,e,n){let i=-1;return Vd(e)?i=Number(e)<1?1:Number(e):M(e)&&(n=e),M(n)||(n=jd),new C(e=>{const r=Vd(t)?t:+t-n.now();return n.schedule(zd,r,{index:0,period:i,subscriber:e})})}(t,e))}function Hd(t,e){return function(n){return n.lift(new $d(t,e))}}class $d{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new Gd(t,this.predicate,this.thisArg))}}class Gd extends v{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}function Wd(t){return e=>e.lift(new qd(t))}class qd{constructor(t){this.notifier=t}call(t,e){const n=new Xd(t),i=G(this.notifier,new H(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class Xd extends ${constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Yd(...t){return Y(1)(wd(...t))}function Kd(...t){const e=t[t.length-1];return M(e)?(t.pop(),n=>Yd(t,n,e)):e=>Yd(t,e)}function Qd(t,e){return"function"==typeof e?n=>n.pipe(Qd((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new Zd(t))}class Zd{constructor(t){this.project=t}call(t,e){return e.subscribe(new Jd(t,this.project))}}class Jd extends ${constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e)}_innerSub(t){const e=this.innerSubscription;e&&e.unsubscribe();const n=new H(this),i=this.destination;i.add(n),this.innerSubscription=G(t,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:t}=this;(!t||t.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(t){this.destination.next(t)}}const tp=new class extends Td{}(class extends Cd{constructor(t,e){super(t,e),this.scheduler=t,this.work=e}schedule(t,e=0){return e>0?super.schedule(t,e):(this.delay=e,this.state=t,this.scheduler.flush(this),this)}execute(t,e){return e>0||this.closed?super.execute(t,e):this._execute(t,e)}requestAsyncId(t,e,n=0){return null!==n&&n>0||null===n&&this.delay>0?super.requestAsyncId(t,e,n):t.flush(this)}}),ep=new C(t=>t.complete());function np(t){return t?function(t){return new C(e=>t.schedule(()=>e.complete()))}(t):ep}function ip(t,e){return new C(e?n=>e.schedule(rp,0,{error:t,subscriber:n}):e=>e.error(t))}function rp({error:t,subscriber:e}){e.error(t)}class sp{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return wd(this.value);case"E":return ip(this.error);case"C":return np()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new sp("N",t):sp.undefinedValueNotification}static createError(t){return new sp("E",void 0,t)}static createComplete(){return sp.completeNotification}}sp.completeNotification=new sp("C"),sp.undefinedValueNotification=new sp("N",void 0);class op extends v{constructor(t,e,n=0){super(t),this.scheduler=e,this.delay=n}static dispatch(t){const{notification:e,destination:n}=t;e.observe(n),this.unsubscribe()}scheduleMessage(t){this.destination.add(this.scheduler.schedule(op.dispatch,this.delay,new ap(t,this.destination)))}_next(t){this.scheduleMessage(sp.createNext(t))}_error(t){this.scheduleMessage(sp.createError(t)),this.unsubscribe()}_complete(){this.scheduleMessage(sp.createComplete()),this.unsubscribe()}}class ap{constructor(t,e){this.notification=t,this.destination=e}}class lp extends P{constructor(t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n){super(),this.scheduler=n,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=t<1?1:t,this._windowTime=e<1?1:e,e===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(t){if(!this.isStopped){const e=this._events;e.push(t),e.length>this._bufferSize&&e.shift()}super.next(t)}nextTimeWindow(t){this.isStopped||(this._events.push(new cp(this._getNow(),t)),this._trimBufferThenGetEvents()),super.next(t)}_subscribe(t){const e=this._infiniteTimeWindow,n=e?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,r=n.length;let s;if(this.closed)throw new T;if(this.isStopped||this.hasError?s=g.EMPTY:(this.observers.push(t),s=new k(this,t)),i&&t.add(t=new op(t,i)),e)for(let o=0;oe&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i}}class cp{constructor(t,e){this.time=t,this.value=e}}function up(t,e,n){let i;return i=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},t=>t.lift(function({bufferSize:t=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:n,scheduler:i}){let r,s,o=0,a=!1,l=!1;return function(c){let u;o++,!r||a?(a=!1,r=new lp(t,e,i),u=r.subscribe(this),s=c.subscribe({next(t){r.next(t)},error(t){a=!0,r.error(t)},complete(){l=!0,s=void 0,r.complete()}}),l&&(s=void 0)):u=r.subscribe(this),this.add(()=>{o--,u.unsubscribe(),u=void 0,s&&!l&&n&&0===o&&(s.unsubscribe(),s=void 0,r=void 0)})}}(i))}let hp;try{hp="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(m){hp=!1}let dp,pp=(()=>{class t{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Lh(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!hp)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return t.\u0275fac=function(e){return new(e||t)(Ci(ou))},t.\u0275prov=xt({factory:function(){return new t(Ci(ou))},token:t,providedIn:"root"}),t})(),fp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const gp=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function mp(){if(dp)return dp;if("object"!=typeof document||!document)return dp=new Set(gp),dp;let t=document.createElement("input");return dp=new Set(gp.filter(e=>(t.setAttribute("type",e),t.type===e))),dp}let bp,yp,vp;function _p(t){return function(){if(null==bp&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>bp=!0}))}finally{bp=bp||!1}return bp}()?t:!!t.capture}function wp(){if(null==yp){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return yp=!1,yp;if("scrollBehavior"in document.documentElement.style)yp=!0;else{const t=Element.prototype.scrollTo;yp=!!t&&!/\{\s*\[native code\]\s*\}/.test(t.toString())}}return yp}function xp(t){if(function(){if(null==vp){const t="undefined"!=typeof document?document.head:null;vp=!(!t||!t.createShadowRoot&&!t.attachShadow)}return vp}()){const e=t.getRootNode?t.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}function Sp(){let t="undefined"!=typeof document&&document?document.activeElement:null;for(;t&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}function Ep(t){return t.composedPath?t.composedPath()[0]:t.target}const Cp=new oi("cdk-dir-doc",{providedIn:"root",factory:function(){return Oi(Yu)}});let Op=(()=>{class t{constructor(t){if(this.value="ltr",this.change=new Rc,t){const e=t.documentElement?t.documentElement.dir:null,n=(t.body?t.body.dir:null)||e;this.value="ltr"===n||"rtl"===n?n:"ltr"}}ngOnDestroy(){this.change.complete()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Cp,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(Cp,8))},token:t,providedIn:"root"}),t})(),Tp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class kp{constructor(t=!1,e,n=!0){this._multiple=t,this._emitChanges=n,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new P,e&&e.length&&(t?e.forEach(t=>this._markSelected(t)):this._markSelected(e[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...t){this._verifyValueAssignment(t),t.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...t){this._verifyValueAssignment(t),t.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(t){this.isSelected(t)?this.deselect(t):this.select(t)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(t){return this._selection.has(t)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){this.isSelected(t)||(this._multiple||this._unmarkAll(),this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){}}let Ap=(()=>{class t{constructor(){this._listeners=[]}notify(t,e){for(let n of this._listeners)n(t,e)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(e=>t!==e)}}ngOnDestroy(){this._listeners=[]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),Pp=(()=>{class t{constructor(t,e,n){this._ngZone=t,this._platform=e,this._scrolled=new P,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=n}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const e=this.scrollContainers.get(t);e&&(e.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new C(e=>{this._globalSubscription||this._addGlobalListener();const n=t>0?this._scrolled.pipe(Ud(t)).subscribe(e):this._scrolled.subscribe(e);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):wd()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,e)=>this.deregister(e)),this._scrolled.complete()}ancestorScrolled(t,e){const n=this.getAncestorScrollContainers(t);return this.scrolled(e).pipe(Hd(t=>!t||n.indexOf(t)>-1))}getAncestorScrollContainers(t){const e=[];return this.scrollContainers.forEach((n,i)=>{this._scrollableContainsElement(i,t)&&e.push(i)}),e}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,e){let n=_d(e),i=t.getElementRef().nativeElement;do{if(n==i)return!0}while(n=n.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>xd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(pp),Ci(Yu,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(xu),Ci(pp),Ci(Yu,8))},token:t,providedIn:"root"}),t})(),Ip=(()=>{class t{constructor(t,e,n){this._platform=t,this._change=new P,this._changeListener=t=>{this._change.next(t)},this._document=n,e.runOutsideAngular(()=>{if(t.isBrowser){const t=this._getWindow();t.addEventListener("resize",this._changeListener),t.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){const t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:e,height:n}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+n,right:t.left+e,height:n,width:e}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,e=this._getWindow(),n=t.documentElement,i=n.getBoundingClientRect();return{top:-i.top||t.body.scrollTop||e.scrollY||n.scrollTop||0,left:-i.left||t.body.scrollLeft||e.scrollX||n.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(Ud(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu),Ci(Yu,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu),Ci(Yu,8))},token:t,providedIn:"root"}),t})(),Mp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),Dp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Tp,fp,Mp],Tp,Mp]}),t})();class Rp{attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;null!=t&&(this._attachedHost=null,t.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class Np extends Rp{constructor(t,e,n,i){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.componentFactoryResolver=i}}class Lp extends Rp{constructor(t,e,n){super(),this.templateRef=t,this.viewContainerRef=e,this.context=n}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}}class jp extends Rp{constructor(t){super(),this.element=t instanceof kl?t.nativeElement:t}}class Fp{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){return t instanceof Np?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof Lp?(this._attachedPortal=t,this.attachTemplatePortal(t)):this.attachDomPortal&&t instanceof jp?(this._attachedPortal=t,this.attachDomPortal(t)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class Bp extends Fp{constructor(t,e,n,i,r){super(),this.outletElement=t,this._componentFactoryResolver=e,this._appRef=n,this._defaultInjector=i,this.attachDomPortal=t=>{const e=t.element,n=this._document.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=r}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let n;return t.viewContainerRef?(n=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector),this.setDisposeFn(()=>n.destroy())):(n=e.create(t.injector||this._defaultInjector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(n)),this._attachedPortal=t,n}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context);return n.rootNodes.forEach(t=>this.outletElement.appendChild(t)),n.detectChanges(),this.setDisposeFn(()=>{let t=e.indexOf(n);-1!==t&&e.remove(t)}),this._attachedPortal=t,n}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let Vp=(()=>{class t extends Lp{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(ea(sc),ea(hc))},t.\u0275dir=se({type:t,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[jo]}),t})(),zp=(()=>{class t extends Vp{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","cdk-portal",""],["","portal",""]],exportAs:["cdkPortal"],features:[_l([{provide:Vp,useExisting:t}]),jo]}),t})(),Up=(()=>{class t extends Fp{constructor(t,e,n){super(),this._componentFactoryResolver=t,this._viewContainerRef=e,this._isInitialized=!1,this.attached=new Rc,this.attachDomPortal=t=>{const e=t.element,n=this._document.createComment("dom-portal");t.setAttachedHost(this),e.parentNode.insertBefore(n,e),this._getRootNode().appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=n}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedPortal=null,this._attachedRef=null}attachComponentPortal(t){t.setAttachedHost(this);const e=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,n=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),i=e.createComponent(n,e.length,t.injector||e.injector);return e!==this._viewContainerRef&&this._getRootNode().appendChild(i.hostView.rootNodes[0]),super.setDisposeFn(()=>i.destroy()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}attachTemplatePortal(t){t.setAttachedHost(this);const e=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=e,this.attached.emit(e),e}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return t.\u0275fac=function(e){return new(e||t)(ea(El),ea(hc),ea(Yu))},t.\u0275dir=se({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[jo]}),t})(),Hp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const $p=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})();function Gp(t){return e=>0===t?np():e.lift(new Wp(t))}class Wp{constructor(t){if(this.total=t,this.total<0)throw new $p}call(t,e){return e.subscribe(new qp(t,this.total))}}class qp extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}function Xp(t,e=!1){return n=>n.lift(new Yp(t,e))}class Yp{constructor(t,e){this.predicate=t,this.inclusive=e}call(t,e){return e.subscribe(new Kp(t,this.predicate,this.inclusive))}}class Kp extends v{constructor(t,e,n){super(t),this.predicate=e,this.inclusive=n,this.index=0}_next(t){const e=this.destination;let n;try{n=this.predicate(t,this.index++)}catch(i){return void e.error(i)}this.nextOrComplete(t,n)}nextOrComplete(t,e){const n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())}}function Qp(t,...e){return e.length?e.some(e=>t[e]):t.altKey||t.shiftKey||t.ctrlKey||t.metaKey}const Zp=wp();class Jp{constructor(t,e){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=e}attach(){}enable(){if(this._canBeEnabled()){const t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=vd(-this._previousScrollPosition.left),t.style.top=vd(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const t=this._document.documentElement,e=t.style,n=this._document.body.style,i=e.scrollBehavior||"",r=n.scrollBehavior||"";this._isEnabled=!1,e.left=this._previousHTMLStyles.left,e.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Zp&&(e.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Zp&&(e.scrollBehavior=i,n.scrollBehavior=r)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,e=this._viewportRuler.getViewportSize();return t.scrollHeight>e.height||t.scrollWidth>e.width}}class tf{constructor(t,e,n,i){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=n,this._config=i,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(t){this._overlayRef=t}enable(){if(this._scrollSubscription)return;const t=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class ef{enable(){}disable(){}attach(){}}function nf(t,e){return e.some(e=>t.bottome.bottom||t.righte.right)}function rf(t,e){return e.some(e=>t.tope.bottom||t.lefte.right)}class sf{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this._config=i,this._scrollSubscription=null}attach(t){this._overlayRef=t}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:e,height:n}=this._viewportRuler.getViewportSize();nf(t,[{width:e,height:n,bottom:n,right:e,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let of=(()=>{class t{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this.noop=()=>new ef,this.close=t=>new tf(this._scrollDispatcher,this._ngZone,this._viewportRuler,t),this.block=()=>new Jp(this._viewportRuler,this._document),this.reposition=t=>new sf(this._scrollDispatcher,this._viewportRuler,this._ngZone,t),this._document=i}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pp),Ci(Ip),Ci(xu),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Pp),Ci(Ip),Ci(xu),Ci(Yu))},token:t,providedIn:"root"}),t})();class af{constructor(t){if(this.scrollStrategy=new ef,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){const e=Object.keys(t);for(const n of e)void 0!==t[n]&&(this[n]=t[n])}}}class lf{constructor(t,e,n,i,r){this.offsetX=n,this.offsetY=i,this.panelClass=r,this.originX=t.originX,this.originY=t.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY}}class cf{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}}let uf=(()=>{class t{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),0===this._attachedOverlays.length&&this.detach()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})(),hf=(()=>{class t extends uf{constructor(t){super(t),this._keydownListener=t=>{const e=this._attachedOverlays;for(let n=e.length-1;n>-1;n--)if(e[n]._keydownEvents.observers.length>0){e[n]._keydownEvents.next(t);break}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})(),df=(()=>{class t extends uf{constructor(t,e){super(t),this._platform=e,this._cursorStyleIsSet=!1,this._clickListener=t=>{const e=Ep(t),n=this._attachedOverlays.slice();for(let i=n.length-1;i>-1;i--){const r=n[i];if(!(r._outsidePointerEvents.observers.length<1)&&r.hasAttached()){if(r.overlayElement.contains(e))break;r._outsidePointerEvents.next(t)}}}}add(t){if(super.add(t),!this._isAttached){const t=this._document.body;t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=t.style.cursor,t.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu),Ci(pp))},token:t,providedIn:"root"}),t})();const pf="undefined"!=typeof window?window:{},ff=void 0!==pf.__karma__&&!!pf.__karma__||void 0!==pf.jasmine&&!!pf.jasmine||void 0!==pf.jest&&!!pf.jest||void 0!==pf.Mocha&&!!pf.Mocha;let gf=(()=>{class t{constructor(t,e){this._platform=e,this._document=t}ngOnDestroy(){const t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||ff){const e=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let t=0;tthis._backdropClick.next(t),this._keydownEvents=new P,this._outsidePointerEvents=new P,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(t){let e=this._portalOutlet.attach(t);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(Gp(1)).subscribe(()=>{this.hasAttached()&&this.updatePosition()}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){const t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,t&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=Object.assign(Object.assign({},this._config),t),this._updateElementSize()}setDirection(t){this._config=Object.assign(Object.assign({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){const t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const t=this._pane.style;t.width=vd(this._config.width),t.height=vd(this._config.height),t.minWidth=vd(this._config.minWidth),t.minHeight=vd(this._config.minHeight),t.maxWidth=vd(this._config.maxWidth),t.maxHeight=vd(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){const t="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(t)})}):this._backdropElement.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let t=this._backdropElement;if(!t)return;let e,n=()=>{t&&(t.removeEventListener("click",this._backdropClickHandler),t.removeEventListener("transitionend",n),t.parentNode&&t.parentNode.removeChild(t)),this._backdropElement==t&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(t,this._config.backdropClass,!1),clearTimeout(e)};t.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{t.addEventListener("transitionend",n)}),t.style.pointerEvents="none",e=this._ngZone.runOutsideAngular(()=>setTimeout(n,500))}_toggleClasses(t,e,n){const i=t.classList;yd(e).forEach(t=>{t&&(n?i.add(t):i.remove(t))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const t=this._ngZone.onStable.pipe(Wd(Q(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._previousHostParent.removeChild(this._host)),t.unsubscribe())})})}_disposeScrollStrategy(){const t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())}}const bf="cdk-overlay-connected-position-bounding-box",yf=/([A-Za-z%]+)$/;class vf{constructor(t,e,n,i,r){this._viewportRuler=e,this._document=n,this._platform=i,this._overlayContainer=r,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new P,this._resizeSubscription=g.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}get positions(){return this._preferredPositions}attach(t){this._validatePositions(),t.hostElement.classList.add(bf),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();const t=this._originRect,e=this._overlayRect,n=this._viewportRect,i=[];let r;for(let s of this._preferredPositions){let o=this._getOriginPoint(t,s),a=this._getOverlayPoint(o,e,s),l=this._getOverlayFit(a,e,n,s);if(l.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(s,o);this._canFitWithFlexibleDimensions(l,a,n)?i.push({position:s,origin:o,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(o,s)}):(!r||r.overlayFit.visibleAreae&&(e=i,t=n)}return this._isPushed=!1,void this._applyPosition(t.position,t.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(r.position,r.originPoint);this._applyPosition(r.position,r.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&_f(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(bf),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();const t=this._lastPosition||this._preferredPositions[0],e=this._getOriginPoint(this._originRect,t);this._applyPosition(t,e)}}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e){let n,i;if("center"==e.originX)n=t.left+t.width/2;else{const i=this._isRtl()?t.right:t.left,r=this._isRtl()?t.left:t.right;n="start"==e.originX?i:r}return i="center"==e.originY?t.top+t.height/2:"top"==e.originY?t.top:t.bottom,{x:n,y:i}}_getOverlayPoint(t,e,n){let i,r;return i="center"==n.overlayX?-e.width/2:"start"===n.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,r="center"==n.overlayY?-e.height/2:"top"==n.overlayY?0:-e.height,{x:t.x+i,y:t.y+r}}_getOverlayFit(t,e,n,i){const r=xf(e);let{x:s,y:o}=t,a=this._getOffset(i,"x"),l=this._getOffset(i,"y");a&&(s+=a),l&&(o+=l);let c=0-o,u=o+r.height-n.height,h=this._subtractOverflows(r.width,0-s,s+r.width-n.width),d=this._subtractOverflows(r.height,c,u),p=h*d;return{visibleArea:p,isCompletelyWithinViewport:r.width*r.height===p,fitsInViewportVertically:d===r.height,fitsInViewportHorizontally:h==r.width}}_canFitWithFlexibleDimensions(t,e,n){if(this._hasFlexibleDimensions){const i=n.bottom-e.y,r=n.right-e.x,s=wf(this._overlayRef.getConfig().minHeight),o=wf(this._overlayRef.getConfig().minWidth),a=t.fitsInViewportHorizontally||null!=o&&o<=r;return(t.fitsInViewportVertically||null!=s&&s<=i)&&a}return!1}_pushOverlayOnScreen(t,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};const i=xf(e),r=this._viewportRect,s=Math.max(t.x+i.width-r.width,0),o=Math.max(t.y+i.height-r.height,0),a=Math.max(r.top-n.top-t.y,0),l=Math.max(r.left-n.left-t.x,0);let c=0,u=0;return c=i.width<=r.width?l||-s:t.xi&&!this._isInitialRender&&!this._growAfterOpen&&(s=t.y-i/2)}if("end"===e.overlayX&&!i||"start"===e.overlayX&&i)c=n.width-t.x+this._viewportMargin,a=t.x-this._viewportMargin;else if("start"===e.overlayX&&!i||"end"===e.overlayX&&i)l=t.x,a=n.right-t.x;else{const e=Math.min(n.right-t.x+n.left,t.x),i=this._lastBoundingBoxSize.width;a=2*e,l=t.x-e,a>i&&!this._isInitialRender&&!this._growAfterOpen&&(l=t.x-i/2)}return{top:s,left:l,bottom:o,right:c,width:a,height:r}}_setBoundingBoxStyles(t,e){const n=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));const i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{const t=this._overlayRef.getConfig().maxHeight,r=this._overlayRef.getConfig().maxWidth;i.height=vd(n.height),i.top=vd(n.top),i.bottom=vd(n.bottom),i.width=vd(n.width),i.left=vd(n.left),i.right=vd(n.right),i.alignItems="center"===e.overlayX?"center":"end"===e.overlayX?"flex-end":"flex-start",i.justifyContent="center"===e.overlayY?"center":"bottom"===e.overlayY?"flex-end":"flex-start",t&&(i.maxHeight=vd(t)),r&&(i.maxWidth=vd(r))}this._lastBoundingBoxSize=n,_f(this._boundingBox.style,i)}_resetBoundingBoxStyles(){_f(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){_f(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){const n={},i=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(i){const i=this._viewportRuler.getViewportScrollPosition();_f(n,this._getExactOverlayY(e,t,i)),_f(n,this._getExactOverlayX(e,t,i))}else n.position="static";let o="",a=this._getOffset(e,"x"),l=this._getOffset(e,"y");a&&(o+=`translateX(${a}px) `),l&&(o+=`translateY(${l}px)`),n.transform=o.trim(),s.maxHeight&&(i?n.maxHeight=vd(s.maxHeight):r&&(n.maxHeight="")),s.maxWidth&&(i?n.maxWidth=vd(s.maxWidth):r&&(n.maxWidth="")),_f(this._pane.style,n)}_getExactOverlayY(t,e,n){let i={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n));let s=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return r.y-=s,"bottom"===t.overlayY?i.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":i.top=vd(r.y),i}_getExactOverlayX(t,e,n){let i,r={left:"",right:""},s=this._getOverlayPoint(e,this._overlayRect,t);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,n)),i=this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left","right"===i?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=vd(s.x),r}_getScrollVisibility(){const t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(t=>t.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:rf(t,n),isOriginOutsideView:nf(t,n),isOverlayClipped:rf(e,n),isOverlayOutsideView:nf(e,n)}}_subtractOverflows(t,...e){return e.reduce((t,e)=>t-Math.max(e,0),t)}_getNarrowedViewportRect(){const t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+t-this._viewportMargin,bottom:n.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return"x"===e?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&yd(t).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){const t=this._origin;if(t instanceof kl)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();const e=t.width||0,n=t.height||0;return{top:t.y,bottom:t.y+n,left:t.x,right:t.x+e,height:n,width:e}}}function _f(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function wf(t){if("number"!=typeof t&&null!=t){const[e,n]=t.split(yf);return n&&"px"!==n?null:parseFloat(e)}return t||null}function xf(t){return{top:Math.floor(t.top),right:Math.floor(t.right),bottom:Math.floor(t.bottom),left:Math.floor(t.left),width:Math.floor(t.width),height:Math.floor(t.height)}}class Sf{constructor(t,e,n,i,r,s,o){this._preferredPositions=[],this._positionStrategy=new vf(n,i,r,s,o).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(t,e),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(t){this._overlayRef=t,this._positionStrategy.attach(t),this._direction&&(t.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(t){this._positionStrategy.withScrollableContainers(t)}withFallbackPosition(t,e,n,i){const r=new lf(t,e,n,i);return this._preferredPositions.push(r),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(t){return this._overlayRef?this._overlayRef.setDirection(t):this._direction=t,this}withOffsetX(t){return this._positionStrategy.withDefaultOffsetX(t),this}withOffsetY(t){return this._positionStrategy.withDefaultOffsetY(t),this}withLockedPosition(t){return this._positionStrategy.withLockedPosition(t),this}withPositions(t){return this._preferredPositions=t.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(t){return this._positionStrategy.setOrigin(t),this}}const Ef="cdk-global-overlay-wrapper";class Cf{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(t){const e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(Ef),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._rightOffset="",this._leftOffset=t,this._justifyContent="flex-start",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._leftOffset="",this._rightOffset=t,this._justifyContent="flex-end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._justifyContent="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:i,height:r,maxWidth:s,maxHeight:o}=n,a=!("100%"!==i&&"100vw"!==i||s&&"100%"!==s&&"100vw"!==s),l=!("100%"!==r&&"100vh"!==r||o&&"100%"!==o&&"100vh"!==o);t.position=this._cssPosition,t.marginLeft=a?"0":this._leftOffset,t.marginTop=l?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=this._rightOffset,a?e.justifyContent="flex-start":"center"===this._justifyContent?e.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?e.justifyContent="flex-end":"flex-end"===this._justifyContent&&(e.justifyContent="flex-start"):e.justifyContent=this._justifyContent,e.alignItems=l?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(Ef),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}}let Of=(()=>{class t{constructor(t,e,n,i){this._viewportRuler=t,this._document=e,this._platform=n,this._overlayContainer=i}global(){return new Cf}connectedTo(t,e,n){return new Sf(e,n,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new vf(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ip),Ci(Yu),Ci(pp),Ci(gf))},t.\u0275prov=xt({factory:function(){return new t(Ci(Ip),Ci(Yu),Ci(pp),Ci(gf))},token:t,providedIn:"root"}),t})(),Tf=0,kf=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u){this.scrollStrategies=t,this._overlayContainer=e,this._componentFactoryResolver=n,this._positionBuilder=i,this._keyboardDispatcher=r,this._injector=s,this._ngZone=o,this._document=a,this._directionality=l,this._location=c,this._outsideClickDispatcher=u}create(t){const e=this._createHostElement(),n=this._createPaneElement(e),i=this._createPortalOutlet(n),r=new af(t);return r.direction=r.direction||this._directionality.value,new mf(i,e,n,r,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const e=this._document.createElement("div");return e.id="cdk-overlay-"+Tf++,e.classList.add("cdk-overlay-pane"),t.appendChild(e),e}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Uu)),new Bp(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return t.\u0275fac=function(e){return new(e||t)(Ci(of),Ci(gf),Ci(El),Ci(Of),Ci(hf),Ci(No),Ci(xu),Ci(Yu),Ci(Op),Ci(lh),Ci(df))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Af=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],Pf=new oi("cdk-connected-overlay-scroll-strategy");let If=(()=>{class t{constructor(t){this.elementRef=t}}return t.\u0275fac=function(e){return new(e||t)(ea(kl))},t.\u0275dir=se({type:t,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),t})(),Mf=(()=>{class t{constructor(t,e,n,i,r){this._overlay=t,this._dir=r,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=g.EMPTY,this._attachSubscription=g.EMPTY,this._detachSubscription=g.EMPTY,this._positionSubscription=g.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Rc,this.positionChange=new Rc,this.attach=new Rc,this.detach=new Rc,this.overlayKeydown=new Rc,this.overlayOutsideClick=new Rc,this._templatePortal=new Lp(e,n),this._scrollStrategyFactory=i,this.scrollStrategy=this._scrollStrategyFactory()}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}get hasBackdrop(){return this._hasBackdrop}set hasBackdrop(t){this._hasBackdrop=md(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=md(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=md(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=md(t)}get push(){return this._push}set push(t){this._push=md(t)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Af);const t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(t=>{this.overlayKeydown.next(t),27===t.keyCode&&!this.disableClose&&!Qp(t)&&(t.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(t=>{this.overlayOutsideClick.next(t)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),e=new af({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(e.width=this.width),(this.height||0===this.height)&&(e.height=this.height),(this.minWidth||0===this.minWidth)&&(e.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(e.minHeight=this.minHeight),this.backdropClass&&(e.backdropClass=this.backdropClass),this.panelClass&&(e.panelClass=this.panelClass),e}_updatePositionStrategy(t){const e=this.positions.map(t=>({originX:t.originX,originY:t.originY,overlayX:t.overlayX,overlayY:t.overlayY,offsetX:t.offsetX||this.offsetX,offsetY:t.offsetY||this.offsetY,panelClass:t.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(e).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const t=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(t),t}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(Xp(()=>this.positionChange.observers.length>0)).subscribe(t=>{this.positionChange.emit(t),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()}))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(sc),ea(hc),ea(Pf),ea(Op,8))},t.\u0275dir=se({type:t,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[ye]}),t})();const Df={provide:Pf,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};let Rf=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[kf,Df],imports:[[Tp,Hp,Dp],Dp]}),t})(),Nf=(()=>{class t extends gf{constructor(){super(...arguments),this.attached=!1}setRootElement(t){this.attached&&(this.rootElement.nativeElement.removeChild(this._containerElement),this.attached=!1),this.rootElement=t,this.rootElement.nativeElement.style.display="block",this.rootElement.nativeElement.style.position="contents",this.rootElement.nativeElement.style.height="100%",this.appendToRoot()}_createContainer(){super._createContainer(),this.appendToRoot()}appendToRoot(){!this._containerElement||!this.rootElement||(this.rootElement.nativeElement.appendChild(this._containerElement),this.attached=!0)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const Lf={schedule(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)},scheduleBeforeRender(t){if("undefined"==typeof window)return Lf.schedule(t,0);if(void 0===window.requestAnimationFrame)return Lf.schedule(t,16);const e=window.requestAnimationFrame(t);return()=>window.cancelAnimationFrame(e)}};let jf;function Ff(t,e,n){let i=n;return function(t){return!!t&&t.nodeType===Node.ELEMENT_NODE}(t)&&e.some((e,n)=>!("*"===e||!function(t,e){if(!jf){const t=Element.prototype;jf=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE&&jf.call(t,e)}(t,e)||(i=n,0))),i}class Bf{constructor(t,e){this.componentFactory=e.get(El).resolveComponentFactory(t)}create(t){return new Vf(this.componentFactory,t)}}class Vf{constructor(t,e){this.componentFactory=t,this.injector=e,this.eventEmitters=new lp(1),this.events=this.eventEmitters.pipe(Qd(t=>Q(...t))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:t})=>t)),this.ngZone=this.injector.get(xu),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(t){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(t)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=Lf.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(t){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(t):this.componentRef.instance[t])}setInputValue(t,e){this.runInZone(()=>{null!==this.componentRef?function(t,e){return t===e||t!=t&&e!=e}(e,this.getInputValue(t))&&(void 0!==e||!this.unchangedInputs.has(t))||(this.recordInputChange(t,e),this.unchangedInputs.delete(t),this.hasInputChanges=!0,this.componentRef.instance[t]=e,this.scheduleDetectChanges()):this.initialInputValues.set(t,e)})}initializeComponent(t){const e=No.create({providers:[],parent:this.injector}),n=function(t,e){const n=t.childNodes,i=e.map(()=>[]);let r=-1;e.some((t,e)=>"*"===t&&(r=e,!0));for(let s=0,o=n.length;s{this.initialInputValues.has(t)&&this.setInputValue(t,this.initialInputValues.get(t))}),this.initialInputValues.clear()}initializeOutputs(t){const e=this.componentFactory.outputs.map(({propName:e,templateName:n})=>t.instance[e].pipe(D(t=>({name:n,value:t}))));this.eventEmitters.next(e)}callNgOnChanges(t){if(!this.implementsOnChanges||null===this.inputChanges)return;const e=this.inputChanges;this.inputChanges=null,t.instance.ngOnChanges(e)}markViewForCheck(t){this.hasInputChanges&&(this.hasInputChanges=!1,t.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=Lf.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(t,e){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const n=this.inputChanges[t];if(n)return void(n.currentValue=e);const i=this.unchangedInputs.has(t),r=i?void 0:this.getInputValue(t);this.inputChanges[t]=new be(r,e,i)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(t){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(t):t()}}class zf extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}class Uf extends P{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new T;return this._value}next(t){super.next(this._value=t)}}function Hf(){}function $f(t,e,n){return function(i){return i.lift(new Gf(t,e,n))}}class Gf{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new Wf(t,this.nextOrObserver,this.error,this.complete))}}class Wf extends v{constructor(t,e,n,i){super(t),this._tapNext=Hf,this._tapError=Hf,this._tapComplete=Hf,this._tapError=n||Hf,this._tapComplete=i||Hf,a(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||Hf,this._tapError=e.error||Hf,this._tapComplete=e.complete||Hf)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}function qf(t,e=jd){return n=>n.lift(new Xf(t,e))}class Xf{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new Yf(t,this.dueTime,this.scheduler))}}class Yf extends v{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Kf,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Kf(t){t.debouncedNext()}function Qf(t){return e=>e.lift(new Zf(t))}class Zf{constructor(t){this.total=t}call(t,e){return e.subscribe(new Jf(t,this.total))}}class Jf extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){++this.count>this.total&&this.destination.next(t)}}let tg=(()=>{class t{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),eg=(()=>{class t{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,e)=>this._cleanupObserver(e))}observe(t){const e=_d(t);return new C(t=>{const n=this._observeElement(e).subscribe(t);return()=>{n.unsubscribe(),this._unobserveElement(e)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const e=new P,n=this._mutationObserverFactory.create(t=>e.next(t));n&&n.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:n,stream:e,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:e,stream:n}=this._observedElements.get(t);e&&e.disconnect(),n.complete(),this._observedElements.delete(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(tg))},t.\u0275prov=xt({factory:function(){return new t(Ci(tg))},token:t,providedIn:"root"}),t})(),ng=(()=>{class t{constructor(t,e,n){this._contentObserver=t,this._elementRef=e,this._ngZone=n,this.event=new Rc,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=bd(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe(qf(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(eg),ea(kl),ea(xu))},t.\u0275dir=se({type:t,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),t})(),ig=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[tg]}),t})();function rg(t,e){return(t.getAttribute(e)||"").match(/\S+/g)||[]}const sg="cdk-describedby-message-container",og="cdk-describedby-message",ag="cdk-describedby-host";let lg=0;const cg=new Map;let ug=null,hg=(()=>{class t{constructor(t){this._document=t}describe(t,e,n){if(!this._canBeDescribed(t,e))return;const i=dg(e,n);"string"!=typeof e?(pg(e),cg.set(i,{messageElement:e,referenceCount:0})):cg.has(i)||this._createMessageElement(e,n),this._isElementDescribedByMessage(t,i)||this._addMessageReference(t,i)}removeDescription(t,e,n){if(!e||!this._isElementNode(t))return;const i=dg(e,n);if(this._isElementDescribedByMessage(t,i)&&this._removeMessageReference(t,i),"string"==typeof e){const t=cg.get(i);t&&0===t.referenceCount&&this._deleteMessageElement(i)}ug&&0===ug.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${ag}]`);for(let e=0;e0!=t.indexOf(og));t.setAttribute("aria-describedby",e.join(" "))}_addMessageReference(t,e){const n=cg.get(e);(function(t,e,n){const i=rg(t,e);i.some(t=>t.trim()==n.trim())||(i.push(n.trim()),t.setAttribute(e,i.join(" ")))})(t,"aria-describedby",n.messageElement.id),t.setAttribute(ag,""),n.referenceCount++}_removeMessageReference(t,e){const n=cg.get(e);n.referenceCount--,function(t,e,n){const i=rg(t,e).filter(t=>t!=n.trim());i.length?t.setAttribute(e,i.join(" ")):t.removeAttribute(e)}(t,"aria-describedby",n.messageElement.id),t.removeAttribute(ag)}_isElementDescribedByMessage(t,e){const n=rg(t,"aria-describedby"),i=cg.get(e),r=i&&i.messageElement.id;return!!r&&-1!=n.indexOf(r)}_canBeDescribed(t,e){if(!this._isElementNode(t))return!1;if(e&&"object"==typeof e)return!0;const n=null==e?"":`${e}`.trim(),i=t.getAttribute("aria-label");return!(!n||i&&i.trim()===n)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(Yu))},token:t,providedIn:"root"}),t})();function dg(t,e){return"string"==typeof t?`${e||""}/${t}`:t}function pg(t){t.id||(t.id=`${og}-${lg++}`)}class fg extends class{constructor(t){this._items=t,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new P,this._typeaheadSubscription=g.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new P,this.change=new P,t instanceof Lc&&t.changes.subscribe(t=>{if(this._activeItem){const e=t.toArray().indexOf(this._activeItem);e>-1&&e!==this._activeItemIndex&&(this._activeItemIndex=e)}})}skipPredicate(t){return this._skipPredicateFn=t,this}withWrap(t=!0){return this._wrap=t,this}withVerticalOrientation(t=!0){return this._vertical=t,this}withHorizontalOrientation(t){return this._horizontal=t,this}withAllowedModifierKeys(t){return this._allowedModifierKeys=t,this}withTypeAhead(t=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe($f(t=>this._pressedLetters.push(t)),qf(t),Hd(()=>this._pressedLetters.length>0),D(()=>this._pressedLetters.join(""))).subscribe(t=>{const e=this._getItemsArray();for(let n=1;n!t[e]||this._allowedModifierKeys.indexOf(e)>-1);switch(e){case 9:return void this.tabOut.next();case 40:if(this._vertical&&n){this.setNextItemActive();break}return;case 38:if(this._vertical&&n){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&n){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&n){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&n){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&n){this.setLastItemActive();break}return;default:return void((n||Qp(t,"shiftKey"))&&(t.key&&1===t.key.length?this._letterKeyStream.next(t.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))))}this._pressedLetters=[],t.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem}isTyping(){return this._pressedLetters.length>0}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._items.length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(t){const e=this._getItemsArray(),n="number"==typeof t?t:e.indexOf(t),i=e[n];this._activeItem=null==i?null:i,this._activeItemIndex=n}_setActiveItemByDelta(t){this._wrap?this._setActiveInWrapMode(t):this._setActiveInDefaultMode(t)}_setActiveInWrapMode(t){const e=this._getItemsArray();for(let n=1;n<=e.length;n++){const i=(this._activeItemIndex+t*n+e.length)%e.length;if(!this._skipPredicateFn(e[i]))return void this.setActiveItem(i)}}_setActiveInDefaultMode(t){this._setActiveItemByIndex(this._activeItemIndex+t,t)}_setActiveItemByIndex(t,e){const n=this._getItemsArray();if(n[t]){for(;this._skipPredicateFn(n[t]);)if(!n[t+=e])return;this.setActiveItem(t)}}_getItemsArray(){return this._items instanceof Lc?this._items.toArray():this._items}}{setActiveItem(t){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(t),this.activeItem&&this.activeItem.setActiveStyles()}}let gg=(()=>{class t{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(t){return!!(t.offsetWidth||t.offsetHeight||"function"==typeof t.getClientRects&&t.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const e=function(t){try{return t.frameElement}catch(e){return null}}(function(t){return t.ownerDocument&&t.ownerDocument.defaultView||window}(t));if(e&&(-1===bg(e)||!this.isVisible(e)))return!1;let n=t.nodeName.toLowerCase(),i=bg(t);return t.hasAttribute("contenteditable")?-1!==i:!("iframe"===n||"object"===n||this._platform.WEBKIT&&this._platform.IOS&&!function(t){let e=t.nodeName.toLowerCase(),n="input"===e&&t.type;return"text"===n||"password"===n||"select"===e||"textarea"===e}(t))&&("audio"===n?!!t.hasAttribute("controls")&&-1!==i:"video"===n?-1!==i&&(null!==i||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,e){return function(t){return!function(t){return function(t){return"input"==t.nodeName.toLowerCase()}(t)&&"hidden"==t.type}(t)&&(function(t){let e=t.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(t)||function(t){return function(t){return"a"==t.nodeName.toLowerCase()}(t)&&t.hasAttribute("href")}(t)||t.hasAttribute("contenteditable")||mg(t))}(t)&&!this.isDisabled(t)&&((null==e?void 0:e.ignoreVisibility)||this.isVisible(t))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp))},token:t,providedIn:"root"}),t})();function mg(t){if(!t.hasAttribute("tabindex")||void 0===t.tabIndex)return!1;let e=t.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function bg(t){if(!mg(t))return null;const e=parseInt(t.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class yg{constructor(t,e,n,i,r=!1){this._element=t,this._checker=e,this._ngZone=n,this._document=i,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,r||this.attachAnchors()}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}destroy(){const t=this._startAnchor,e=this._endAnchor;t&&(t.removeEventListener("focus",this.startAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),e&&(e.removeEventListener("focus",this.endAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusInitialElement(t)))})}focusFirstTabbableElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusFirstTabbableElement(t)))})}focusLastTabbableElementWhenReady(t){return new Promise(e=>{this._executeOnStable(()=>e(this.focusLastTabbableElement(t)))})}_getRegionBoundary(t){let e=this._element.querySelectorAll(`[cdk-focus-region-${t}], [cdkFocusRegion${t}], [cdk-focus-${t}]`);for(let n=0;n=0;n--){let t=e[n].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(e[n]):null;if(t)return t}return null}_createAnchor(){const t=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,t),t.classList.add("cdk-visually-hidden"),t.classList.add("cdk-focus-trap-anchor"),t.setAttribute("aria-hidden","true"),t}_toggleAnchorTabIndex(t,e){t?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}toggleAnchors(t){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}_executeOnStable(t){this._ngZone.isStable?t():this._ngZone.onStable.pipe(Gp(1)).subscribe(t)}}let vg=(()=>{class t{constructor(t,e,n){this._checker=t,this._ngZone=e,this._document=n}create(t,e=!1){return new yg(t,this._checker,this._ngZone,this._document,e)}}return t.\u0275fac=function(e){return new(e||t)(Ci(gg),Ci(xu),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(gg),Ci(xu),Ci(Yu))},token:t,providedIn:"root"}),t})();function _g(t){return 0===t.offsetX&&0===t.offsetY}function wg(t){const e=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const xg=new oi("cdk-input-modality-detector-options"),Sg={ignoreKeys:[18,17,224,91,16]},Eg=_p({passive:!0,capture:!0});let Cg=(()=>{class t{constructor(t,e,n,i){this._platform=t,this._mostRecentTarget=null,this._modality=new Uf(null),this._lastTouchMs=0,this._onKeydown=t=>{var e,n;(null===(n=null===(e=this._options)||void 0===e?void 0:e.ignoreKeys)||void 0===n?void 0:n.some(e=>e===t.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Ep(t))},this._onMousedown=t=>{Date.now()-this._lastTouchMs<650||(this._modality.next(_g(t)?"keyboard":"mouse"),this._mostRecentTarget=Ep(t))},this._onTouchstart=t=>{wg(t)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Ep(t))},this._options=Object.assign(Object.assign({},Sg),i),this.modalityDetected=this._modality.pipe(Qf(1)),this.modalityChanged=this.modalityDetected.pipe(Rd()),t.isBrowser&&e.runOutsideAngular(()=>{n.addEventListener("keydown",this._onKeydown,Eg),n.addEventListener("mousedown",this._onMousedown,Eg),n.addEventListener("touchstart",this._onTouchstart,Eg)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Eg),document.removeEventListener("mousedown",this._onMousedown,Eg),document.removeEventListener("touchstart",this._onTouchstart,Eg))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu),Ci(Yu),Ci(xg,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu),Ci(Yu),Ci(xg,8))},token:t,providedIn:"root"}),t})();const Og=new oi("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),Tg=new oi("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let kg=(()=>{class t{constructor(t,e,n,i){this._ngZone=e,this._defaultOptions=i,this._document=n,this._liveElement=t||this._createLiveElement()}announce(t,...e){const n=this._defaultOptions;let i,r;return 1===e.length&&"number"==typeof e[0]?r=e[0]:[i,r]=e,this.clear(),clearTimeout(this._previousTimeout),i||(i=n&&n.politeness?n.politeness:"polite"),null==r&&n&&(r=n.duration),this._liveElement.setAttribute("aria-live",i),this._ngZone.runOutsideAngular(()=>new Promise(e=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,e(),"number"==typeof r&&(this._previousTimeout=setTimeout(()=>this.clear(),r))},100)}))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement&&this._liveElement.parentNode&&(this._liveElement.parentNode.removeChild(this._liveElement),this._liveElement=null)}_createLiveElement(){const t="cdk-live-announcer-element",e=this._document.getElementsByClassName(t),n=this._document.createElement("div");for(let i=0;i{class t{constructor(t,e,n,i,r){this._ngZone=t,this._platform=e,this._inputModalityDetector=n,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new P,this._rootNodeFocusAndBlurListener=t=>{const e=Ep(t),n="focus"===t.type?this._onFocus:this._onBlur;for(let i=e;i;i=i.parentElement)n.call(this,t,i)},this._document=i,this._detectionMode=(null==r?void 0:r.detectionMode)||0}monitor(t,e=!1){const n=_d(t);if(!this._platform.isBrowser||1!==n.nodeType)return wd(null);const i=xp(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return e&&(r.checkChildren=!0),r.subject;const s={checkChildren:e,subject:new P,rootNode:i};return this._elementInfo.set(n,s),this._registerGlobalListeners(s),s.subject}stopMonitoring(t){const e=_d(t),n=this._elementInfo.get(e);n&&(n.subject.complete(),this._setClasses(e),this._elementInfo.delete(e),this._removeGlobalListeners(n))}focusVia(t,e,n){const i=_d(t);i===this._getDocument().activeElement?this._getClosestElementsInfo(i).forEach(([t,n])=>this._originChanged(t,e,n)):(this._setOrigin(e),"function"==typeof i.focus&&i.focus(n))}ngOnDestroy(){this._elementInfo.forEach((t,e)=>this.stopMonitoring(e))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,e,n){n?t.classList.add(e):t.classList.remove(e)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,e){this._toggleClass(t,"cdk-focused",!!e),this._toggleClass(t,"cdk-touch-focused","touch"===e),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===e),this._toggleClass(t,"cdk-mouse-focused","mouse"===e),this._toggleClass(t,"cdk-program-focused","program"===e)}_setOrigin(t,e=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&e,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,e){const n=this._elementInfo.get(e),i=Ep(t);!n||!n.checkChildren&&e!==i||this._originChanged(e,this._getFocusOrigin(i),n)}_onBlur(t,e){const n=this._elementInfo.get(e);!n||n.checkChildren&&t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||(this._setClasses(e),this._emitOrigin(n.subject,null))}_emitOrigin(t,e){this._ngZone.run(()=>t.next(e))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const e=t.rootNode,n=this._rootNodeFocusListenerCount.get(e)||0;n||this._ngZone.runOutsideAngular(()=>{e.addEventListener("focus",this._rootNodeFocusAndBlurListener,Pg),e.addEventListener("blur",this._rootNodeFocusAndBlurListener,Pg)}),this._rootNodeFocusListenerCount.set(e,n+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(Wd(this._stopInputModalityDetector)).subscribe(t=>{this._setOrigin(t,!0)}))}_removeGlobalListeners(t){const e=t.rootNode;if(this._rootNodeFocusListenerCount.has(e)){const t=this._rootNodeFocusListenerCount.get(e);t>1?this._rootNodeFocusListenerCount.set(e,t-1):(e.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Pg),e.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Pg),this._rootNodeFocusListenerCount.delete(e))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,e,n){this._setClasses(t,e),this._emitOrigin(n.subject,e),this._lastFocusOrigin=e}_getClosestElementsInfo(t){const e=[];return this._elementInfo.forEach((n,i)=>{(i===t||n.checkChildren&&i.contains(t))&&e.push([i,n])}),e}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(pp),Ci(Cg),Ci(Yu,8),Ci(Ag,8))},t.\u0275prov=xt({factory:function(){return new t(Ci(xu),Ci(pp),Ci(Cg),Ci(Yu,8),Ci(Ag,8))},token:t,providedIn:"root"}),t})();const Mg="cdk-high-contrast-black-on-white",Dg="cdk-high-contrast-white-on-black",Rg="cdk-high-contrast-active";let Ng=(()=>{class t{constructor(t,e){this._platform=t,this._document=e}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const e=this._document.defaultView||window,n=e&&e.getComputedStyle?e.getComputedStyle(t):null,i=(n&&n.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),i){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(Rg),t.remove(Mg),t.remove(Dg),this._hasCheckedHighContrastMode=!0;const e=this.getHighContrastMode();1===e?(t.add(Rg),t.add(Mg)):2===e&&(t.add(Rg),t.add(Dg))}}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(Yu))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(Yu))},token:t,providedIn:"root"}),t})(),Lg=(()=>{class t{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ng))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[fp,ig]]}),t})();const jg=new Rl("12.2.5");class Fg{}const Bg="*";function Vg(t,e){return{type:7,name:t,definitions:e,options:{}}}function zg(t,e=null){return{type:4,styles:e,timings:t}}function Ug(t,e=null){return{type:2,steps:t,options:e}}function Hg(t){return{type:6,styles:t,offset:null}}function $g(t,e,n){return{type:0,name:t,styles:e,options:n}}function Gg(t){return{type:5,steps:t}}function Wg(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function qg(t=null){return{type:9,options:t}}function Xg(t,e,n=null){return{type:11,selector:t,animation:e,options:n}}function Yg(t){Promise.resolve(null).then(t)}class Kg{constructor(t=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Yg(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Qg{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let e=0,n=0,i=0;const r=this.players.length;0==r?Yg(()=>this._onFinish()):this.players.forEach(t=>{t.onDone(()=>{++e==r&&this._onFinish()}),t.onDestroy(()=>{++n==r&&this._onDestroy()}),t.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((t,e)=>Math.max(t,e.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const e=t*this.totalTime;this.players.forEach(t=>{const n=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(n)})}getPosition(){const t=this.players.reduce((t,e)=>null===t||e.totalTime>t.totalTime?e:t,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}function Zg(){return"undefined"!=typeof window&&void 0!==window.document}function Jg(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function tm(t){switch(t.length){case 0:return new Kg;case 1:return t[0];default:return new Qg(t)}}function em(t,e,n,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(t=>{const n=t.offset,i=n==l,u=i&&c||{};Object.keys(t).forEach(n=>{let i=n,a=t[n];if("offset"!==n)switch(i=e.normalizePropertyName(i,o),a){case"!":a=r[n];break;case Bg:a=s[n];break;default:a=e.normalizeStyleValue(n,i,a,o)}u[i]=a}),i||a.push(u),c=u,l=n}),o.length){const t="\n - ";throw new Error(`Unable to animate due to the following errors:${t}${o.join(t)}`)}return a}function nm(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&im(n,"start",t)));break;case"done":t.onDone(()=>i(n&&im(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&im(n,"destroy",t)))}}function im(t,e,n){const i=n.totalTime,r=rm(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,null==i?t.totalTime:i,!!n.disabled),s=t._data;return null!=s&&(r._data=s),r}function rm(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function sm(t,e,n){let i;return t instanceof Map?(i=t.get(e),i||t.set(e,i=n)):(i=t[e],i||(i=t[e]=n)),i}function om(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let am=(t,e)=>!1,lm=(t,e)=>!1,cm=(t,e,n)=>[];const um=Jg();(um||"undefined"!=typeof Element)&&(am=Zg()?(t,e)=>{for(;e&&e!==document.documentElement;){if(e===t)return!0;e=e.parentNode||e.host}return!1}:(t,e)=>t.contains(e),lm=(()=>{if(um||Element.prototype.matches)return(t,e)=>t.matches(e);{const t=Element.prototype,e=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return e?(t,n)=>e.apply(t,[n]):lm}})(),cm=(t,e,n)=>{let i=[];if(n){const n=t.querySelectorAll(e);for(let t=0;t{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=t[n]}),e}let ym=(()=>{class t{validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new Kg(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class vm{}vm.NOOP=new ym;const _m="ng-enter",wm="ng-leave",xm="ng-trigger",Sm=".ng-trigger",Em="ng-animating",Cm=".ng-animating";function Om(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Tm(parseFloat(e[1]),e[2])}function Tm(t,e){switch(e){case"s":return 1e3*t;default:return t}}function km(t,e,n){return t.hasOwnProperty("duration")?t:function(t,e,n){let i,r=0,s="";if("string"==typeof t){const n=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return e.push(`The provided timing value "${t}" is invalid.`),{duration:0,delay:0,easing:""};i=Tm(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=Tm(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=t;if(!n){let n=!1,s=e.length;i<0&&(e.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(e.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&e.splice(s,0,`The provided timing value "${t}" is invalid.`)}return{duration:i,delay:r,easing:s}}(t,e,n)}function Am(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function Pm(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else Am(t,n);return n}function Im(t,e,n){return n?e+":"+n+";":""}function Mm(t){let e="";for(let n=0;n{const r=zm(i);n&&!n.hasOwnProperty(i)&&(n[i]=t.style[r]),t.style[r]=e[i]}),Jg()&&Mm(t))}function Rm(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=zm(e);t.style[n]=""}),Jg()&&Mm(t))}function Nm(t){return Array.isArray(t)?1==t.length?t[0]:Ug(t):t}const Lm=new RegExp("{{\\s*(.+?)\\s*}}","g");function jm(t){let e=[];if("string"==typeof t){let n;for(;n=Lm.exec(t);)e.push(n[1]);Lm.lastIndex=0}return e}function Fm(t,e,n){const i=t.toString(),r=i.replace(Lm,(t,i)=>{let r=e[i];return e.hasOwnProperty(i)||(n.push(`Please provide a value for the animation param ${i}`),r=""),r.toString()});return r==i?t:r}function Bm(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Vm=/-+([a-z0-9])/g;function zm(t){return t.replace(Vm,(...t)=>t[1].toUpperCase())}function Um(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Hm(t,e){return 0===t||0===e}function $m(t,e,n){const i=Object.keys(n);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(t=>{s.hasOwnProperty(t)||o.push(t),s[t]=n[t]}),o.length)for(var r=1;rfunction(t,e,n){if(":"==t[0]){const i=function(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,e)=>parseFloat(e)>parseFloat(t);case":decrement":return(t,e)=>parseFloat(e) *"}}(t,n);if("function"==typeof i)return void e.push(i);t=i}const i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${t}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(Km(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(Km(o,r))}(t,n,e)):n.push(t),n}const Xm=new Set(["true","1"]),Ym=new Set(["false","0"]);function Km(t,e){const n=Xm.has(t)||Ym.has(t),i=Xm.has(e)||Ym.has(e);return(r,s)=>{let o="*"==t||t==r,a="*"==e||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?Xm.has(t):Ym.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?Xm.has(e):Ym.has(e)),o&&a}}const Qm=new RegExp("s*:selfs*,?","g");function Zm(t,e,n){return new Jm(t).build(e,n)}class Jm{constructor(t){this._driver=t}build(t,e){const n=new tb(e);return this._resetContextStyleTimingState(n),Gm(this,Nm(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,i=e.depCount=0;const r=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(t=>{if(this._resetContextStyleTimingState(e),0==t.type){const n=t,i=n.name;i.toString().split(/\s*,\s*/).forEach(t=>{n.name=t,r.push(this.visitState(n,e))}),n.name=i}else if(1==t.type){const r=this.visitTransition(t,e);n+=r.queryCount,i+=r.depCount,s.push(r)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(t,e){const n=this.visitStyle(t.styles,e),i=t.options&&t.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(t=>{if(eb(t)){const e=t;Object.keys(e).forEach(t=>{jm(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Bm(r.values());e.errors.push(`state("${t.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:t.name,style:n,options:i?{params:i}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;const n=Gm(this,Nm(t.animation),e);return{type:1,matchers:qm(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:nb(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>Gm(this,t,e)),options:nb(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=Gm(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:nb(t.options)}}visitAnimate(t,e){const n=function(t,e){let n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return ib(km(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=ib(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||km(i,e),ib(n.duration,n.delay,n.easing)}(t.timings,e.errors);e.currentAnimateTimings=n;let i,r=t.styles?t.styles:Hg({});if(5==r.type)i=this.visitKeyframes(r,e);else{let r=t.styles,s=!1;if(!r){s=!0;const t={};n.easing&&(t.easing=n.easing),r=Hg(t)}e.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,e);o.isEmptyStep=s,i=o}return e.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(t,e){const n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){const n=[];Array.isArray(t.styles)?t.styles.forEach(t=>{"string"==typeof t?t==Bg?n.push(t):e.errors.push(`The provided style string value ${t} is not allowed.`):n.push(t)}):n.push(t.styles);let i=!1,r=null;return n.forEach(t=>{if(eb(t)){const e=t,n=e.easing;if(n&&(r=n,delete e.easing),!i)for(let t in e)if(e[t].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:t.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(t,e){const n=e.currentAnimateTimings;let i=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),t.styles.forEach(t=>{"string"!=typeof t&&Object.keys(t).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void e.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=e.collectedStyles[e.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(e.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),e.options&&function(t,e,n){const i=e.params||{},r=jm(t);r.length&&r.forEach(t=>{i.hasOwnProperty(t)||n.push(`Unable to resolve the local animation param ${t} in the given list of values`)})}(t[n],e.options,e.errors)})})}visitKeyframes(t,e){const n={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const l=t.steps.map(t=>{const n=this._makeStyleAst(t,e);let l=null!=n.offset?n.offset:function(t){if("string"==typeof t)return null;let e=null;if(Array.isArray(t))t.forEach(t=>{if(eb(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(eb(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}return e}(n.styles),c=0;return null!=l&&(i++,c=n.offset=l),o=o||c<0||c>1,s=s||c0&&i{const s=u>0?i==h?1:u*i:r[i],o=s*f;e.currentTime=d+p.delay+o,p.duration=o,this._validateStyleAst(t,e),t.offset=s,n.styles.push(t)}),n}visitReference(t,e){return{type:8,animation:Gm(this,Nm(t.animation),e),options:nb(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:nb(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:nb(t.options)}}visitQuery(t,e){const n=e.currentQuerySelector,i=t.options||{};e.queryCount++,e.currentQuery=t;const[r,s]=function(t){const e=!!t.split(/\s*,\s*/).find(t=>":self"==t);return e&&(t=t.replace(Qm,"")),[t=t.replace(/@\*/g,Sm).replace(/@\w+/g,t=>Sm+"-"+t.substr(1)).replace(/:animating/g,Cm),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,sm(e.collectedStyles,e.currentQuerySelector,{});const o=Gm(this,Nm(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:t.selector,options:nb(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const n="full"===t.timings?{duration:0,delay:0,easing:"full"}:km(t.timings,e.errors,!0);return{type:12,animation:Gm(this,Nm(t.animation),e),timings:n,options:null}}}class tb{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function eb(t){return!Array.isArray(t)&&"object"==typeof t}function nb(t){return t?(t=Am(t)).params&&(t.params=function(t){return t?Am(t):null}(t.params)):t={},t}function ib(t,e,n){return{duration:t,delay:e,easing:n}}function rb(t,e,n,i,r,s,o=null,a=!1){return{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class sb{constructor(){this._map=new Map}consume(t){let e=this._map.get(t);return e?this._map.delete(t):e=[],e}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const ob=new RegExp(":enter","g"),ab=new RegExp(":leave","g");function lb(t,e,n,i,r,s={},o={},a,l,c=[]){return(new cb).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class cb{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new sb;const u=new hb(t,e,l,i,r,c,[]);u.options=a,u.currentTimeline.setStyles([s],null,u.errors,a),Gm(this,n,u);const h=u.timelines.filter(t=>t.containsAnimation());if(h.length&&Object.keys(o).length){const t=h[h.length-1];t.allowOnlyTimelineStyles()||t.setStyles([o],null,u.errors,a)}return h.length?h.map(t=>t.buildKeyframes()):[rb(e,[],[],[],0,0,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){const n=e.subInstructions.consume(e.element);if(n){const i=e.createSubContext(t.options),r=e.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&e.transformIntoNewTimeline(s)}e.previousNode=t}visitAnimateRef(t,e){const n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_visitSubInstructions(t,e,n){let i=e.currentTimeline.currentTime;const r=null!=n.duration?Om(n.duration):null,s=null!=n.delay?Om(n.delay):null;return 0!==r&&t.forEach(t=>{const n=e.appendInstructionToTimeline(t,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(t,e){e.updateOptions(t.options,!0),Gm(this,t.animation,e),e.previousNode=t}visitSequence(t,e){const n=e.subContextCount;let i=e;const r=t.options;if(r&&(r.params||r.delay)&&(i=e.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=ub);const t=Om(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>Gm(this,t,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){const n=[];let i=e.currentTimeline.currentTime;const r=t.options&&t.options.delay?Om(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),Gm(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(t=>e.currentTimeline.mergeTimelineCollectedStyles(t)),e.transformIntoNewTimeline(i),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){const n=t.strValue;return km(e.params?Fm(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){const n=e.currentAnimateTimings=this._visitTiming(t.timings,e),i=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),i.snapshotCurrentStyles());const r=t.style;5==r.type?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){const n=e.currentTimeline,i=e.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(r):n.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){const n=e.currentAnimateTimings,i=e.currentTimeline.duration,r=n.duration,s=e.createSubContext().currentTimeline;s.easing=n.easing,t.styles.forEach(t=>{s.forwardTime((t.offset||0)*r),s.setStyles(t.styles,t.easing,e.errors,e.options),s.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(s),e.transformIntoNewTimeline(i+r),e.previousNode=t}visitQuery(t,e){const n=e.currentTimeline.currentTime,i=t.options||{},r=i.delay?Om(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=ub);let s=n;const o=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{e.currentQueryIndex=i;const o=e.createSubContext(t.options,n);r&&o.delayNextStep(r),n===e.element&&(a=o.currentTimeline),Gm(this,t.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),a&&(e.currentTimeline.mergeTimelineCollectedStyles(a),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){const n=e.parentContext,i=e.currentTimeline,r=t.timings,s=Math.abs(r.duration),o=s*(e.currentQueryTotal-1);let a=s*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const l=e.currentTimeline;a&&l.delayNextStep(a);const c=l.currentTime;Gm(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const ub={};class hb{constructor(t,e,n,i,r,s,o,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=ub,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new db(this._driver,e,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;const n=t;let i=this.options;null!=n.duration&&(i.duration=Om(n.duration)),null!=n.delay&&(i.delay=Om(n.delay));const r=n.params;if(r){let t=i.params;t||(t=this.options.params={}),Object.keys(r).forEach(n=>{(!e||!t.hasOwnProperty(n))&&(t[n]=Fm(r[n],t,this.errors))})}}_copyOptions(){const t={};if(this.options){const e=this.options.params;if(e){const n=t.params={};Object.keys(e).forEach(t=>{n[t]=e[t]})}}return t}createSubContext(t=null,e,n){const i=e||this.element,r=new hb(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=ub,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){const i={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},r=new pb(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,i,t.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,i,r,s){let o=[];if(i&&o.push(this.element),t.length>0){t=(t=t.replace(ob,"."+this._enterClassName)).replace(ab,"."+this._leaveClassName);let e=this._driver.query(this.element,t,1!=n);0!==n&&(e=n<0?e.slice(e.length+n,e.length):e.slice(0,n)),o.push(...e)}return!r&&0==o.length&&s.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),o}}class db{constructor(t,e,n,i){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new db(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||Bg,this._currentKeyframe[t]=Bg}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,i){e&&(this._previousKeyframe.easing=e);const r=i&&i.params||{},s=function(t,e){const n={};let i;return t.forEach(t=>{"*"===t?(i=i||Object.keys(e),i.forEach(t=>{n[t]=Bg})):Pm(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=Fm(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Bg),this._updateStyle(t,e)})}applyStylesToKeyframe(){const t=this._pendingStyles,e=Object.keys(t);0!=e.length&&(this._pendingStyles={},e.forEach(e=>{this._currentKeyframe[e]=t[e]}),Object.keys(this._localTimelineStyles).forEach(t=>{this._currentKeyframe.hasOwnProperty(t)||(this._currentKeyframe[t]=this._localTimelineStyles[t])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(t=>{const e=this._localTimelineStyles[t];this._pendingStyles[t]=e,this._updateStyle(t,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){Object.keys(t._styleSummary).forEach(e=>{const n=this._styleSummary[e],i=t._styleSummary[e];(!n||i.time>n.time)&&this._updateStyle(e,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,e=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=Pm(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Bg&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Bm(t.values()):[],s=e.size?Bm(e.values()):[];if(n){const t=i[0],e=Am(t);t.offset=0,e.offset=1,i=[t,e]}return rb(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class pb extends db{constructor(t,e,n,i,r,s,o=!1){super(t,e,s.delay),this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){const r=[],s=n+e,o=e/s,a=Pm(t[0],!1);a.offset=0,r.push(a);const l=Pm(t[0],!1);l.offset=fb(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=Pm(t[i],!1);o.offset=fb((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return rb(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function fb(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class gb{}class mb extends gb{normalizePropertyName(t,e){return zm(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(bb[e]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const e=n.match(/^[+-]?[\d\.]+([a-z]*)$/);e&&0==e[1].length&&i.push(`Please provide a CSS unit value for ${t}:${n}`)}return s+r}}const bb=(()=>function(t){const e={};return t.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function yb(t,e,n,i,r,s,o,a,l,c,u,h,d){return{type:0,element:t,triggerName:e,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:u,totalTime:h,errors:d}}const vb={};class _b{constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,i){return function(t,e,n,i,r){return t.some(t=>t(e,n,i,r))}(this.ast.matchers,t,e,n,i)}buildStyles(t,e,n){const i=this._stateStyles["*"],r=this._stateStyles[t],s=i?i.buildStyles(e,n):{};return r?r.buildStyles(e,n):s}build(t,e,n,i,r,s,o,a,l,c){const u=[],h=this.ast.options&&this.ast.options.params||vb,d=this.buildStyles(n,o&&o.params||vb,u),p=a&&a.params||vb,f=this.buildStyles(i,p,u),g=new Set,m=new Map,b=new Map,y="void"===i,v={params:Object.assign(Object.assign({},h),p)},_=c?[]:lb(t,e,this.ast.animation,r,s,d,f,v,l,u);let w=0;if(_.forEach(t=>{w=Math.max(t.duration+t.delay,w)}),u.length)return yb(e,this._triggerName,n,i,y,d,f,[],[],m,b,w,u);_.forEach(t=>{const n=t.element,i=sm(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=sm(b,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const x=Bm(g.values());return yb(e,this._triggerName,n,i,y,d,f,_,x,m,b,w)}}class wb{constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){const n={},i=Am(this.defaultParams);return Object.keys(t).forEach(e=>{const n=t[e];null!=n&&(i[e]=n)}),this.styles.styles.forEach(t=>{if("string"!=typeof t){const r=t;Object.keys(r).forEach(t=>{let s=r[t];s.length>1&&(s=Fm(s,i,e));const o=this.normalizer.normalizePropertyName(t,e);s=this.normalizer.normalizeStyleValue(t,o,s,e),n[o]=s})}}),n}}class xb{constructor(t,e,n){this.name=t,this.ast=e,this._normalizer=n,this.transitionFactories=[],this.states={},e.states.forEach(t=>{this.states[t.name]=new wb(t.style,t.options&&t.options.params||{},n)}),Sb(this.states,"true","1"),Sb(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new _b(t,e,this.states))}),this.fallbackTransition=function(t,e,n){return new _b(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[(t,e)=>!0],options:null,queryCount:0,depCount:0},e)}(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,i){return this.transitionFactories.find(r=>r.match(t,e,n,i))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}}function Sb(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const Eb=new sb;class Cb{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(t,e){const n=[],i=Zm(this._driver,e,n);if(n.length)throw new Error(`Unable to build the animation due to the following errors: ${n.join("\n")}`);this._animations[t]=i}_buildPlayer(t,e,n){const i=t.element,r=em(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(i,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){const i=[],r=this._animations[t];let s;const o=new Map;if(r?(s=lb(this._driver,e,r,_m,wm,{},{},n,Eb,i),s.forEach(t=>{const e=sm(o,t.element,{});t.postStyleProps.forEach(t=>e[t]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error(`Unable to create the animation due to the following errors: ${i.join("\n")}`);o.forEach((t,e)=>{Object.keys(t).forEach(n=>{t[n]=this._driver.computeStyle(e,n,Bg)})});const a=tm(s.map(t=>{const e=o.get(t.element);return this._buildPlayer(t,{},e)}));return this._playersById[t]=a,a.onDestroy(()=>this.destroy(t)),this.players.push(a),a}destroy(t){const e=this._getPlayer(t);e.destroy(),delete this._playersById[t];const n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){const e=this._playersById[t];if(!e)throw new Error(`Unable to find the timeline player referenced by ${t}`);return e}listen(t,e,n,i){const r=rm(e,"","","");return nm(this._getPlayer(t),n,r,i),()=>{}}command(t,e,n,i){if("register"==n)return void this.register(t,i[0]);if("create"==n)return void this.create(t,e,i[0]||{});const r=this._getPlayer(t);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(t)}}}const Ob="ng-animate-queued",Tb="ng-animate-disabled",kb=".ng-animate-disabled",Ab=[],Pb={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ib={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Mb="__ng_removed";class Db{constructor(t,e=""){this.namespaceId=e;const n=t&&t.hasOwnProperty("value");if(this.value=function(t){return null!=t?t:null}(n?t.value:t),n){const e=Am(t);delete e.value,this.options=e}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(t){const e=t.params;if(e){const t=this.options.params;Object.keys(e).forEach(n=>{null==t[n]&&(t[n]=e[n])})}}}const Rb="void",Nb=new Db(Rb);class Lb{constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,$b(e,this._hostClassName)}listen(t,e,n,i){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${e}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if(!function(t){return"start"==t||"done"==t}(n))throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${e}" is not supported!`);const r=sm(this._elementListeners,t,[]),s={name:e,phase:n,callback:i};r.push(s);const o=sm(this._engine.statesByElement,t,{});return o.hasOwnProperty(e)||($b(t,xm),$b(t,xm+"-"+e),o[e]=Nb),()=>{this._engine.afterFlush(()=>{const t=r.indexOf(s);t>=0&&r.splice(t,1),this._triggers[e]||delete o[e]})}}register(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)}_getTrigger(t){const e=this._triggers[t];if(!e)throw new Error(`The provided animation trigger "${t}" has not been registered!`);return e}trigger(t,e,n,i=!0){const r=this._getTrigger(e),s=new Fb(this.id,e,t);let o=this._engine.statesByElement.get(t);o||($b(t,xm),$b(t,xm+"-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new Db(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=Nb),l.value!==Rb&&a.value===l.value){if(!function(t,e){const n=Object.keys(t),i=Object.keys(e);if(n.length!=i.length)return!1;for(let r=0;r{Rm(t,n),Dm(t,i)})}return}const c=sm(this._engine.playersByElement,t,[]);c.forEach(t=>{t.namespaceId==this.id&&t.triggerName==e&&t.queued&&t.destroy()});let u=r.matchTransition(a.value,l.value,t,l.params),h=!1;if(!u){if(!i)return;u=r.fallbackTransition,h=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:u,fromState:a,toState:l,player:s,isFallbackTransition:h}),h||($b(t,Ob),s.onStart(()=>{Gb(t,Ob)})),s.onDone(()=>{let e=this.players.indexOf(s);e>=0&&this.players.splice(e,1);const n=this._engine.playersByElement.get(t);if(n){let t=n.indexOf(s);t>=0&&n.splice(t,1)}}),this.players.push(s),c.push(s),s}deregister(t){delete this._triggers[t],this._engine.statesByElement.forEach((e,n)=>{delete e[t]}),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(e=>e.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const e=this._engine.playersByElement.get(t);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){const n=this._engine.driver.query(t,Sm,!0);n.forEach(t=>{if(t[Mb])return;const n=this._engine.fetchNamespacesByElement(t);n.size?n.forEach(n=>n.triggerLeaveAnimation(t,e,!1,!0)):this.clearElementCache(t)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(t=>this.clearElementCache(t)))}triggerLeaveAnimation(t,e,n,i){const r=this._engine.statesByElement.get(t);if(r){const s=[];if(Object.keys(r).forEach(e=>{if(this._triggers[e]){const n=this.trigger(t,e,Rb,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&tm(s).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const e=this._elementListeners.get(t),n=this._engine.statesByElement.get(t);if(e&&n){const i=new Set;e.forEach(e=>{const r=e.name;if(i.has(r))return;i.add(r);const s=this._triggers[r].fallbackTransition,o=n[r]||Nb,a=new Db(Rb),l=new Fb(this.id,r,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:r,transition:s,fromState:o,toState:a,player:l,isFallbackTransition:!0})})}}removeNode(t,e){const n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let i=!1;if(n.totalAnimations){const e=n.players.length?n.playersByQueriedElement.get(t):[];if(e&&e.length)i=!0;else{let e=t;for(;e=e.parentNode;)if(n.statesByElement.get(e)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(t),i)n.markElementAsRemoved(this.id,t,!1,e);else{const i=t[Mb];(!i||i===Pb)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){$b(t,this._hostClassName)}drainQueuedTransitions(t){const e=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(e=>{if(e.name==n.triggerName){const i=rm(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,nm(n.player,e.phase,i,e.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(n)}),this._queue=[],e.sort((t,e)=>{const n=t.transition.ast.depCount,i=e.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(t.element,e.element)?1:-1})}destroy(t){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}elementContainsData(t){let e=!1;return this._elementListeners.has(t)&&(e=!0),e=!!this._queue.find(e=>e.element===t)||e,e}}class jb{constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(t,e)=>{}}_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}get queuedPlayers(){const t=[];return this._namespaceList.forEach(e=>{e.players.forEach(e=>{e.queued&&t.push(e)})}),t}createNamespace(t,e){const n=new Lb(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,e)){this._namespaceList.splice(r+1,0,t),i=!0;break}i||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let i=this._namespaceLookup[t];i&&i.register(e,n)&&this.totalAnimations++}destroy(t,e){if(!t)return;const n=this._fetchNamespace(t);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[t];const e=this._namespaceList.indexOf(n);e>=0&&this._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(()=>n.destroy(e))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const e=new Set,n=this.statesByElement.get(t);if(n){const t=Object.keys(n);for(let i=0;i=0&&this.collectedLeaveElements.splice(t,1)}if(t){const i=this._fetchNamespace(t);i&&i.insertNode(e,n)}i&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),$b(t,Tb)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Gb(t,Tb))}removeNode(t,e,n,i){if(Bb(e)){const r=t?this._fetchNamespace(t):null;if(r?r.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i),n){const n=this.namespacesByHostElement.get(e);n&&n.id!==t&&n.removeNode(e,i)}}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,n,i){this.collectedLeaveElements.push(e),e[Mb]={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return Bb(e)?this._fetchNamespace(t).listen(e,n,i,r):()=>{}}_buildInstruction(t,e,n,i,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,i,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,Sm,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,Cm,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(t){const e=this.playersByElement.get(t);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(t){const e=this.playersByQueriedElement.get(t);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return tm(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t[Mb];if(e&&e.setForRemoval){if(t[Mb]=Pb,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,kb)&&this.markElementAsDisabled(t,!1),this.driver.query(t,kb,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,e)=>this._balanceNamespaceList(t,e)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nt()),this._flushFns=[],this._whenQuietFns.length){const t=this._whenQuietFns;this._whenQuietFns=[],e.length?tm(e).onDone(()=>{t.forEach(t=>t())}):t.forEach(t=>t())}}reportError(t){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${t.join("\n")}`)}_flushAnimations(t,e){const n=new sb,i=[],r=new Map,s=[],o=new Map,a=new Map,l=new Map,c=new Set;this.disabledNodes.forEach(t=>{c.add(t);const e=this.driver.query(t,".ng-animate-queued",!0);for(let n=0;n{const n=_m+f++;p.set(e,n),t.forEach(t=>$b(t,n))});const g=[],m=new Set,b=new Set;for(let P=0;Pm.add(t)):b.add(t))}const y=new Map,v=Ub(h,Array.from(m));v.forEach((t,e)=>{const n=wm+f++;y.set(e,n),t.forEach(t=>$b(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>Gb(t,n))}),v.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>Gb(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const _=[],w=[];for(let P=this._namespaceList.length-1;P>=0;P--)this._namespaceList[P].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(_.push(e),this.collectedEnterElements.length){const t=r[Mb];if(t&&t.setForMove)return void e.destroy()}const c=!u||!this.driver.containsElement(u,r),h=y.get(r),d=p.get(r),f=this._buildInstruction(t,n,d,h,c);if(f.errors&&f.errors.length)w.push(f);else{if(c)return e.onStart(()=>Rm(r,f.fromStyles)),e.onDestroy(()=>Dm(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>Rm(r,f.fromStyles)),e.onDestroy(()=>Dm(r,f.toStyles)),void i.push(e);f.timelines.forEach(t=>t.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:e,element:r}),f.queriedElements.forEach(t=>sm(o,t,[]).push(e)),f.preStyleProps.forEach((t,e)=>{const n=Object.keys(t);if(n.length){let t=a.get(e);t||a.set(e,t=new Set),n.forEach(e=>t.add(e))}}),f.postStyleProps.forEach((t,e)=>{const n=Object.keys(t);let i=l.get(e);i||l.set(e,i=new Set),n.forEach(t=>i.add(t))})}});if(w.length){const t=[];w.forEach(e=>{t.push(`@${e.triggerName} has failed due to:\n`),e.errors.forEach(e=>t.push(`- ${e}\n`))}),_.forEach(t=>t.destroy()),this.reportError(t)}const x=new Map,S=new Map;s.forEach(t=>{const e=t.element;n.has(e)&&(S.set(e,e),this._beforeAnimationBuild(t.player.namespaceId,t.instruction,x))}),i.forEach(t=>{const e=t.element;this._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(t=>{sm(x,e,[]).push(t),t.destroy()})});const E=g.filter(t=>Xb(t,a,l)),C=new Map;zb(C,this.driver,b,l,Bg).forEach(t=>{Xb(t,a,l)&&E.push(t)});const O=new Map;d.forEach((t,e)=>{zb(O,this.driver,new Set(t),a,"!")}),E.forEach(t=>{const e=C.get(t),n=O.get(t);C.set(t,Object.assign(Object.assign({},e),n))});const T=[],k=[],A={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>Dm(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=A;if(S.size>1){let n=e;const i=[];for(;n=n.parentNode;){const e=S.get(n);if(e){t=e;break}i.push(n)}i.forEach(e=>S.set(e,t))}const n=this._buildAnimation(s.namespaceId,o,x,r,O,C);if(s.setRealPlayer(n),t===A)T.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=tm(e)),i.push(s)}}else Rm(e,o.fromStyles),s.onDestroy(()=>Dm(e,o.toStyles)),k.push(s),c.has(e)&&i.push(s)}),k.forEach(t=>{const e=r.get(t.element);if(e&&e.length){const n=tm(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let P=0;P!t.destroyed);i.length?Wb(this,t,i):this.processLeaveNode(t)}return g.length=0,T.forEach(t=>{this.players.push(t),t.onDone(()=>{t.destroy();const e=this.players.indexOf(t);this.players.splice(e,1)}),t.play()}),T}elementContainsData(t,e){let n=!1;const i=e[Mb];return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,i,r){let s=[];if(e){const e=this.playersByQueriedElement.get(t);e&&(s=e)}else{const e=this.playersByElement.get(t);if(e){const t=!r||r==Rb;e.forEach(e=>{e.queued||!t&&e.triggerName!=i||s.push(e)})}}return(n||i)&&(s=s.filter(t=>!(n&&n!=t.namespaceId||i&&i!=t.triggerName))),s}_beforeAnimationBuild(t,e,n){const i=e.element,r=e.isRemovalTransition?void 0:t,s=e.isRemovalTransition?void 0:e.triggerName;for(const o of e.timelines){const t=o.element,a=t!==i,l=sm(n,t,[]);this._getPreviousPlayers(t,a,r,s,e.toState).forEach(t=>{const e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),l.push(t)})}Rm(i,e.fromStyles)}_buildAnimation(t,e,n,i,r,s){const o=e.triggerName,a=e.element,l=[],c=new Set,u=new Set,h=e.timelines.map(e=>{const h=e.element;c.add(h);const d=h[Mb];if(d&&d.removedBeforeQueried)return new Kg(e.duration,e.delay);const p=h!==a,f=function(t){const e=[];return qb(t,e),e}((n.get(h)||Ab).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===h),g=r.get(h),m=s.get(h),b=em(0,this._normalizer,0,e.keyframes,g,m),y=this._buildPlayer(e,b,f);if(e.subTimeline&&i&&u.add(h),p){const e=new Fb(t,o,h);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{sm(this.playersByQueriedElement,t.element,[]).push(t),t.onDone(()=>function(t,e,n){let i;if(t instanceof Map){if(i=t.get(e),i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&t.delete(e)}}else if(i=t[e],i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&delete t[e]}return i}(this.playersByQueriedElement,t.element,t))}),c.forEach(t=>$b(t,Em));const d=tm(h);return d.onDestroy(()=>{c.forEach(t=>Gb(t,Em)),Dm(a,e.toStyles)}),u.forEach(t=>{sm(i,t,[]).push(d)}),d}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new Kg(t.duration,t.delay)}}class Fb{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new Kg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(n=>nm(t,e,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){sm(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const e=this._player;e.triggerCallback&&e.triggerCallback(t)}}function Bb(t){return t&&1===t.nodeType}function Vb(t,e){const n=t.style.display;return t.style.display=null!=e?e:"none",n}function zb(t,e,n,i,r){const s=[];n.forEach(t=>s.push(Vb(t)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(t=>{const n=s[t]=e.computeStyle(i,t,r);(!n||0==n.length)&&(i[Mb]=Ib,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Vb(t,s[a++])),o}function Ub(t,e){const n=new Map;if(t.forEach(t=>n.set(t,[])),0==e.length)return n;const i=new Set(e),r=new Map;function s(t){if(!t)return 1;let e=r.get(t);if(e)return e;const o=t.parentNode;return e=n.has(o)?o:i.has(o)?1:s(o),r.set(t,e),e}return e.forEach(t=>{const e=s(t);1!==e&&n.get(e).push(t)}),n}const Hb="$$classes";function $b(t,e){if(t.classList)t.classList.add(e);else{let n=t[Hb];n||(n=t[Hb]={}),n[e]=!0}}function Gb(t,e){if(t.classList)t.classList.remove(e);else{let n=t[Hb];n&&delete n[e]}}function Wb(t,e,n){tm(n).onDone(()=>t.processLeaveNode(e))}function qb(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class Yb{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new jb(t,e,n),this._timelineEngine=new Cb(t,e,n),this._transitionEngine.onRemovalComplete=(t,e)=>this.onRemovalComplete(t,e)}registerTrigger(t,e,n,i,r){const s=t+"-"+i;let o=this._triggerCache[s];if(!o){const t=[],e=Zm(this._driver,r,t);if(t.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${t.join("\n - ")}`);o=function(t,e,n){return new xb(t,e,n)}(i,e,this._normalizer),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(e,i,o)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,i){this._transitionEngine.insertNode(t,e,n,i)}onRemove(t,e,n,i){this._transitionEngine.removeNode(t,e,i||!1,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,i){if("@"==n.charAt(0)){const[t,r]=om(n);this._timelineEngine.command(t,e,r,i)}else this._transitionEngine.trigger(t,e,n,i)}listen(t,e,n,i,r){if("@"==n.charAt(0)){const[t,i]=om(n);return this._timelineEngine.listen(t,e,i,r)}return this._transitionEngine.listen(t,e,n,i,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function Kb(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=Zb(e[0]),e.length>1&&(i=Zb(e[e.length-1]))):e&&(n=Zb(e)),n||i?new Qb(t,n,i):null}class Qb{constructor(t,e,n){this._element=t,this._startStyles=e,this._endStyles=n,this._state=0;let i=Qb.initialStylesByElement.get(t);i||Qb.initialStylesByElement.set(t,i={}),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&Dm(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Dm(this._element,this._initialStyles),this._endStyles&&(Dm(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Qb.initialStylesByElement.delete(this._element),this._startStyles&&(Rm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Rm(this._element,this._endStyles),this._endStyles=null),Dm(this._element,this._initialStyles),this._state=3)}}function Zb(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){(function(t,e){const n=ly(t,"").trim();let i=0;n.length&&(function(t,e){let n=0;for(let i=0;i=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),oy(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=ly(t,"").split(","),i=sy(n,e);i>=0&&(n.splice(i,1),ay(t,"",n.join(",")))}(this._element,this._name))}}function iy(t,e,n){ay(t,"PlayState",n,ry(t,e))}function ry(t,e){const n=ly(t,"");return n.indexOf(",")>0?sy(n.split(","),e):sy([n],e)}function sy(t,e){for(let n=0;n=0)return n;return-1}function oy(t,e,n){n?t.removeEventListener(ey,e):t.addEventListener(ey,e)}function ay(t,e,n,i){const r=ty+e;if(null!=i){const e=t.style[r];if(e.length){const t=e.split(",");t[i]=n,n=t.join(",")}}t.style[r]=n}function ly(t,e){return t.style[ty+e]||""}class cy{constructor(t,e,n,i,r,s,o,a){this.element=t,this.keyframes=e,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(t=>t()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(t){this._styler.setPosition(t)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new ny(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}beforeDestroy(){this.init();const t={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(t[n]=e?this._finalStyles[n]:Wm(this.element,n))})}this.currentSnapshot=t}}class uy extends Kg{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=bm(e)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(t=>{this._startingStyles[t]=this.element.style[t]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(t=>this.element.style.setProperty(t,this._styles[t])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(t=>{const e=this._startingStyles[t];e?this.element.style.setProperty(t,e):this.element.style.removeProperty(t)}),this._startingStyles=null,super.destroy())}}class hy{constructor(){this._count=0}validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>bm(t));let i=`@keyframes ${e} {\n`,r="";n.forEach(t=>{r=" ";const e=parseFloat(t.offset);i+=`${r}${100*e}% {\n`,r+=" ",Object.keys(t).forEach(e=>{const n=t[e];switch(e){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${e}: ${n};\n`)}}),i+=`${r}}\n`}),i+="}\n";const s=document.createElement("style");return s.textContent=i,s}animate(t,e,n,i,r,s=[],o){const a=s.filter(t=>t instanceof cy),l={};Hm(n,i)&&a.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const c=function(t){let e={};return t&&(Array.isArray(t)?t:[t]).forEach(t=>{Object.keys(t).forEach(n=>{"offset"==n||"easing"==n||(e[n]=t[n])})}),e}(e=$m(t,e,l));if(0==n)return new uy(t,c);const u="gen_css_kf_"+this._count++,h=this.buildKeyframeElement(t,u,e);(function(t){var e;const n=null===(e=t.getRootNode)||void 0===e?void 0:e.call(t);return"undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot?n:document.head})(t).appendChild(h);const d=Kb(t,e),p=new cy(t,e,u,n,i,r,c,d);return p.onDestroy(()=>function(t){t.parentNode.removeChild(t)}(h)),p}}class dy{constructor(t,e,n,i){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(t,e,n){return t.animate(e,n)}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(e=>{"offset"!=e&&(t[e]=this._finished?this._finalKeyframe[e]:Wm(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class py{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(fy().toString()),this._cssKeyframesDriver=new hy}validateStyleProperty(t){return pm(t)}matchesElement(t,e){return fm(t,e)}containsElement(t,e){return gm(t,e)}query(t,e,n){return mm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}overrideWebAnimationsSupport(t){this._isNativeImpl=t}animate(t,e,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const l={},c=s.filter(t=>t instanceof dy);Hm(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const u=Kb(t,e=$m(t,e=e.map(t=>Pm(t,!1)),l));return new dy(t,e,a,u)}}function fy(){return Zg()&&Element.prototype.animate||{}}let gy=(()=>{class t extends Fg{constructor(t,e){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(e.body,{id:"0",encapsulation:jt.None,styles:[],data:{animation:[]}})}build(t){const e=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(t)?Ug(t):t;return yy(this._renderer,null,e,"register",[n]),new my(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pl),Ci(Yu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class my extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new by(this._id,t,e||{},this._renderer)}}class by{constructor(t,e,n,i){this.id=t,this.element=e,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(t,e){return this._renderer.listen(this.element,`@@${this.id}:${t}`,e)}_command(t,...e){return yy(this._renderer,this.element,this.id,t,e)}onDone(t){this._listen("done",t)}onStart(t){this._listen("start",t)}onDestroy(t){this._listen("destroy",t)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(t){this._command("setPosition",t)}getPosition(){var t,e;return null!==(e=null===(t=this._renderer.engine.players[+this.id])||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}}function yy(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const vy="@.disabled";let _y=(()=>{class t{constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),e.onRemovalComplete=(t,e)=>{e&&e.parentNode(t)&&e.removeChild(t.parentNode,t)}}createRenderer(t,e){const n=this.delegate.createRenderer(t,e);if(!(t&&e&&e.data&&e.data.animation)){let t=this._rendererCache.get(n);return t||(t=new wy("",n,this.engine),this._rendererCache.set(n,t)),t}const i=e.id,r=e.id+"-"+this._currentId;this._currentId++,this.engine.register(r,t);const s=e=>{Array.isArray(e)?e.forEach(s):this.engine.registerTrigger(i,r,t,e.name,e)};return e.data.animation.forEach(s),new xy(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){t>=0&&te(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(t=>{const[e,n]=t;e(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([e,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Pl),Ci(Yb),Ci(xu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class wy{constructor(t,e,n){this.namespaceId=t,this.delegate=e,this.engine=n,this.destroyNode=this.delegate.destroyNode?t=>e.destroyNode(t):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,i=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,i)}removeChild(t,e,n){this.engine.onRemove(this.namespaceId,e,this.delegate,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,i){this.delegate.setAttribute(t,e,n,i)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,i){this.delegate.setStyle(t,e,n,i)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){"@"==e.charAt(0)&&e==vy?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.delegate.listen(t,e,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}}class xy extends wy{constructor(t,e,n,i){super(e,n,i),this.factory=t,this.namespaceId=e}setProperty(t,e,n){"@"==e.charAt(0)?"."==e.charAt(1)&&e==vy?this.disableAnimations(t,n=void 0===n||!!n):this.engine.process(this.namespaceId,t,e.substr(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n){if("@"==e.charAt(0)){const i=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(t);let r=e.substr(1),s="";return"@"!=r.charAt(0)&&([r,s]=function(t){const e=t.indexOf(".");return[t.substring(0,e),t.substr(e+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,t=>{this.factory.scheduleListenerCallback(t._data||-1,n,t)})}return this.delegate.listen(t,e,n)}}let Sy=(()=>{class t extends Yb{constructor(t,e,n){super(t.body,e,n)}ngOnDestroy(){this.flush()}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(vm),Ci(gb))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Ey=new oi("AnimationModuleType"),Cy=[{provide:Fg,useClass:gy},{provide:gb,useFactory:function(){return new mb}},{provide:Yb,useClass:Sy},{provide:Pl,useFactory:function(t,e,n){return new _y(t,e,n)},deps:[ed,Yb,xu]}],Oy=[{provide:vm,useFactory:function(){return"function"==typeof fy()?new py:new hy}},{provide:Ey,useValue:"BrowserAnimations"},...Cy],Ty=[{provide:vm,useClass:ym},{provide:Ey,useValue:"NoopAnimations"},...Cy];let ky=(()=>{class t{static withConfig(e){return{ngModule:t,providers:e.disableAnimations?Ty:Oy}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Oy,imports:[gd]}),t})();function Ay(t,e){if(1&t&&oa(0,"mat-pseudo-checkbox",4),2&t){const t=va();na("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function Py(t,e){if(1&t&&(ra(0,"span",5),Za(1),sa()),2&t){const t=va();ws(1),tl("(",t.group.label,")")}}const Iy=["*"],My=new Rl("12.2.5"),Dy=new oi("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Ry,Ny=(()=>{class t{constructor(t,e,n){this._hasDoneGlobalChecks=!1,this._document=n,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=e,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!Nu()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const e=getComputedStyle(t);e&&"none"!==e.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&My.full!==jg.full&&console.warn("The Angular Material version ("+My.full+") does not match the Angular CDK version ("+jg.full+").\nPlease ensure the versions of these two packages exactly match.")}}return t.\u0275fac=function(e){return new(e||t)(Ci(Ng),Ci(Dy,8),Ci(Yu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Tp],Tp]}),t})();function Ly(t){return class extends t{constructor(...t){super(...t),this._disabled=!1}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t)}}}function jy(t,e){return class extends t{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const e=t||this.defaultColor;e!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),e&&this._elementRef.nativeElement.classList.add(`mat-${e}`),this._color=e)}}}function Fy(t){return class extends t{constructor(...t){super(...t),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=md(t)}}}function By(t,e=0){return class extends t{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?bd(t):this.defaultTabIndex}}}function Vy(t){return class extends t{constructor(...t){super(...t),this.stateChanges=new P,this.errorState=!1}updateErrorState(){const t=this.errorState,e=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);e!==t&&(this.errorState=e,this.stateChanges.next())}}}try{Ry="undefined"!=typeof Intl}catch(m){Ry=!1}let zy=(()=>{class t{isErrorState(t,e){return!!(t&&t.invalid&&(t.touched||e&&e.submitted))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return new t},token:t,providedIn:"root"}),t})();class Uy{constructor(t,e,n){this._renderer=t,this.element=e,this.config=n,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const Hy={enterDuration:225,exitDuration:150},$y=_p({passive:!0}),Gy=["mousedown","touchstart"],Wy=["mouseup","mouseleave","touchend","touchcancel"];class qy{constructor(t,e,n,i){this._target=t,this._ngZone=e,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,i.isBrowser&&(this._containerElement=_d(n))}fadeInRipple(t,e,n={}){const i=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),r=Object.assign(Object.assign({},Hy),n.animation);n.centered&&(t=i.left+i.width/2,e=i.top+i.height/2);const s=n.radius||function(t,e,n){const i=Math.max(Math.abs(t-n.left),Math.abs(t-n.right)),r=Math.max(Math.abs(e-n.top),Math.abs(e-n.bottom));return Math.sqrt(i*i+r*r)}(t,e,i),o=t-i.left,a=e-i.top,l=r.enterDuration,c=document.createElement("div");c.classList.add("mat-ripple-element"),c.style.left=o-s+"px",c.style.top=a-s+"px",c.style.height=2*s+"px",c.style.width=2*s+"px",null!=n.color&&(c.style.backgroundColor=n.color),c.style.transitionDuration=`${l}ms`,this._containerElement.appendChild(c),function(t){window.getComputedStyle(t).getPropertyValue("opacity")}(c),c.style.transform="scale(1)";const u=new Uy(this,c,n);return u.state=0,this._activeRipples.add(u),n.persistent||(this._mostRecentTransientRipple=u),this._runTimeoutOutsideZone(()=>{const t=u===this._mostRecentTransientRipple;u.state=1,!n.persistent&&(!t||!this._isPointerDown)&&u.fadeOut()},l),u}fadeOutRipple(t){const e=this._activeRipples.delete(t);if(t===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!e)return;const n=t.element,i=Object.assign(Object.assign({},Hy),t.config.animation);n.style.transitionDuration=`${i.exitDuration}ms`,n.style.opacity="0",t.state=2,this._runTimeoutOutsideZone(()=>{t.state=3,n.parentNode.removeChild(n)},i.exitDuration)}fadeOutAll(){this._activeRipples.forEach(t=>t.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(t=>{t.config.persistent||t.fadeOut()})}setupTriggerEvents(t){const e=_d(t);!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,this._registerEvents(Gy))}handleEvent(t){"mousedown"===t.type?this._onMousedown(t):"touchstart"===t.type?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(Wy),this._pointerUpEventsRegistered=!0)}_onMousedown(t){const e=_g(t),n=this._lastTouchStartEvent&&Date.now(){!t.config.persistent&&(1===t.state||t.config.terminateOnPointerUp&&0===t.state)&&t.fadeOut()}))}_runTimeoutOutsideZone(t,e=0){this._ngZone.runOutsideAngular(()=>setTimeout(t,e))}_registerEvents(t){this._ngZone.runOutsideAngular(()=>{t.forEach(t=>{this._triggerElement.addEventListener(t,this,$y)})})}_removeTriggerEvents(){this._triggerElement&&(Gy.forEach(t=>{this._triggerElement.removeEventListener(t,this,$y)}),this._pointerUpEventsRegistered&&Wy.forEach(t=>{this._triggerElement.removeEventListener(t,this,$y)}))}}const Xy=new oi("mat-ripple-global-options");let Yy=(()=>{class t{constructor(t,e,n,i,r){this._elementRef=t,this._animationMode=r,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=i||{},this._rippleRenderer=new qy(this,e,t,n)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,e=0,n){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,e,Object.assign(Object.assign({},this.rippleConfig),n)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(xu),ea(pp),ea(Xy,8),ea(Ey,8))},t.\u0275dir=se({type:t,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,e){2&t&&ja("mat-ripple-unbounded",e.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),t})(),Ky=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny,fp],Ny]}),t})(),Qy=(()=>{class t{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return t.\u0275fac=function(e){return new(e||t)(ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,e){2&t&&ja("mat-pseudo-checkbox-indeterminate","indeterminate"===e.state)("mat-pseudo-checkbox-checked","checked"===e.state)("mat-pseudo-checkbox-disabled",e.disabled)("_mat-animation-noopable","NoopAnimations"===e._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,e){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),t})(),Zy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny]]}),t})();const Jy=new oi("MAT_OPTION_PARENT_COMPONENT"),tv=Ly(class{});let ev=0,nv=(()=>{class t extends tv{constructor(t){var e;super(),this._labelId="mat-optgroup-label-"+ev++,this._inert=null!==(e=null==t?void 0:t.inertGroups)&&void 0!==e&&e}}return t.\u0275fac=function(e){return new(e||t)(ea(Jy,8))},t.\u0275dir=se({type:t,inputs:{label:"label"},features:[jo]}),t})();const iv=new oi("MatOptgroup");let rv=0;class sv{constructor(t,e=!1){this.source=t,this.isUserInput=e}}let ov=(()=>{class t{constructor(t,e,n,i){this._element=t,this._changeDetectorRef=e,this._parent=n,this.group=i,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+rv++,this.onSelectionChange=new Rc,this._stateChanges=new P}get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(t){this._disabled=md(t)}get disableRipple(){return this._parent&&this._parent.disableRipple}get active(){return this._active}get viewValue(){return(this._getHostElement().textContent||"").trim()}select(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}deselect(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}focus(t,e){const n=this._getHostElement();"function"==typeof n.focus&&n.focus(e)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!Qp(t)&&(this._selectViaInteraction(),t.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getAriaSelected(){return this.selected||!this.multiple&&null}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){const t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue=t,this._stateChanges.next())}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(t=!1){this.onSelectionChange.emit(new sv(this,t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(void 0),ea(nv))},t.\u0275dir=se({type:t,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),t})(),av=(()=>{class t extends ov{constructor(t,e,n,i){super(t,e,n,i)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(Jy,8),ea(iv,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,e){1&t&&fa("click",function(){return e._selectViaInteraction()})("keydown",function(t){return e._handleKeydown(t)}),2&t&&(il("id",e.id),Ko("tabindex",e._getTabIndex())("aria-selected",e._getAriaSelected())("aria-disabled",e.disabled.toString()),ja("mat-selected",e.selected)("mat-option-multiple",e.multiple)("mat-active",e.active)("mat-option-disabled",e.disabled))},exportAs:["matOption"],features:[jo],ngContentSelectors:Iy,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(t,e){1&t&&(wa(),Jo(0,Ay,1,2,"mat-pseudo-checkbox",0),ra(1,"span",1),xa(2),sa(),Jo(3,Py,2,1,"span",2),oa(4,"div",3)),2&t&&(na("ngIf",e.multiple),ws(3),na("ngIf",e.group&&e.group._inert),ws(1),na("matRippleTrigger",e._getHostElement())("matRippleDisabled",e.disabled||e.disableRipple))},directives:[_h,Yy,Qy],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),t})();function lv(t,e,n){if(n.length){let i=e.toArray(),r=n.toArray(),s=0;for(let e=0;en+i?Math.max(0,t-i+e):n}let uv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Rh,Ny,Zy]]}),t})();function hv(...t){if(1===t.length){const e=t[0];if(d(e))return dv(e,null);if(p(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return dv(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return dv(t=1===t.length&&d(t[0])?t[0]:t,null).pipe(D(t=>e(...t)))}return dv(t,null)}function dv(t,e){return new C(n=>{const i=t.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=t},error:t=>n.error(t),complete:()=>{s++,(s===i||!c)&&(o===i&&n.next(e?e.reduce((t,e,n)=>(t[e]=r[n],t),{}):r),n.complete())}}))}})}function pv(t){return function(e){const n=new fv(t),i=e.lift(n);return n.caught=i}}class fv{constructor(t){this.selector=t}call(t,e){return e.subscribe(new gv(t,this.selector,this.caught))}}class gv extends ${constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const i=new H(this);this.add(i);const r=G(n,i);r!==i&&this.add(r)}}}function mv(t){return e=>e.lift(new bv(t))}class bv{constructor(t){this.callback=t}call(t,e){return e.subscribe(new yv(t,this.callback))}}class yv extends v{constructor(t,e){super(t),this.add(new g(e))}}class vv{}class _v{}class wv{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),i=n.toLowerCase(),r=t.slice(e+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const i=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(e,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof wv?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new wv;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof wv?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const i=("a"===t.op?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":const r=t.value;if(r){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===r.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}}class xv{encodeKey(t){return Cv(t)}encodeValue(t){return Cv(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const Sv=/%(\d[a-f0-9])/gi,Ev={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Cv(t){return encodeURIComponent(t).replace(Sv,(t,e)=>{var n;return null!==(n=Ev[e])&&void 0!==n?n:t})}function Ov(t){return`${t}`}class Tv{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new xv,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(t=>{const i=t.indexOf("="),[r,s]=-1==i?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,i)),e.decodeValue(t.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){const e=[];return Object.keys(t).forEach(n=>{const i=t[n];Array.isArray(i)?i.forEach(t=>{e.push({param:n,value:t,op:"a"})}):e.push({param:n,value:i,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Tv({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(Ov(t.value)),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(Ov(t.value));-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}class kv{constructor(){this.map=new Map}set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}keys(){return this.map.keys()}}function Av(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function Pv(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Iv(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Mv{constructor(t,e,n,i){let r;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.context&&(this.context=r.context),r.params&&(this.params=r.params)),this.headers||(this.headers=new wv),this.context||(this.context=new kv),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),l)),t.setParams&&(c=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),c)),new Mv(n,i,s,{params:c,headers:l,context:u,reportProgress:a,responseType:r,withCredentials:o})}}var Dv=(()=>((Dv=Dv||{})[Dv.Sent=0]="Sent",Dv[Dv.UploadProgress=1]="UploadProgress",Dv[Dv.ResponseHeader=2]="ResponseHeader",Dv[Dv.DownloadProgress=3]="DownloadProgress",Dv[Dv.Response=4]="Response",Dv[Dv.User=5]="User",Dv))();class Rv{constructor(t,e=200,n="OK"){this.headers=t.headers||new wv,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class Nv extends Rv{constructor(t={}){super(t),this.type=Dv.ResponseHeader}clone(t={}){return new Nv({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class Lv extends Rv{constructor(t={}){super(t),this.type=Dv.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new Lv({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class jv extends Rv{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function Fv(t,e){return{body:e,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let Bv=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Mv)i=t;else{let r,s;r=n.headers instanceof wv?n.headers:new wv(n.headers),n.params&&(s=n.params instanceof Tv?n.params:new Tv({fromObject:n.params})),i=new Mv(t,e,void 0!==n.body?n.body:null,{headers:r,context:n.context,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const r=wd(i).pipe(function(t,e){return W(t,e,1)}(t=>this.handler.handle(t)));if(t instanceof Mv||"events"===n.observe)return r;const s=r.pipe(Hd(t=>t instanceof Lv));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return s.pipe(D(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return s.pipe(D(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return s.pipe(D(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return s.pipe(D(t=>t.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new Tv).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,Fv(n,e))}post(t,e,n={}){return this.request("POST",t,Fv(n,e))}put(t,e,n={}){return this.request("PUT",t,Fv(n,e))}}return t.\u0275fac=function(e){return new(e||t)(Ci(vv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Vv{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const zv=new oi("HTTP_INTERCEPTORS");let Uv=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Hv=/^\)\]\}',?\n/;let $v=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new C(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const i=t.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const e=1223===n.status?204:n.status,i=n.statusText||"OK",s=new wv(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return r=new Nv({headers:s,status:e,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),l=null;204!==r&&(l=void 0===n.response?n.responseText:n.response),0===r&&(r=l?200:0);let c=r>=200&&r<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(Hv,"");try{l=""!==l?JSON.parse(l):null}catch(u){l=t,c&&(c=!1,l={error:u,text:l})}}c?(e.next(new Lv({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new jv({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new jv({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});e.error(r)};let l=!1;const c=i=>{l||(e.next(s()),l=!0);let r={type:Dv.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===t.responseType&&!!n.responseText&&(r.partialText=n.responseText),e.next(r)},u=t=>{let n={type:Dv.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),n.addEventListener("timeout",a),n.addEventListener("abort",a),t.reportProgress&&(n.addEventListener("progress",c),null!==i&&n.upload&&n.upload.addEventListener("progress",u)),n.send(i),e.next({type:Dv.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("abort",a),n.removeEventListener("load",o),n.removeEventListener("timeout",a),t.reportProgress&&(n.removeEventListener("progress",c),null!==i&&n.upload&&n.upload.removeEventListener("progress",u)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(Ci(jh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Gv=new oi("XSRF_COOKIE_NAME"),Wv=new oi("XSRF_HEADER_NAME");class qv{}let Xv=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=gh(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(ou),Ci(Gv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Yv=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const i=this.tokenService.getToken();return null!==i&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,i)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(qv),Ci(Wv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Kv=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(zv,[]);this.chain=t.reduceRight((t,e)=>new Vv(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(_v),Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Qv=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:Yv,useClass:Uv}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:Gv,useValue:e.cookieName}:[],e.headerName?{provide:Wv,useValue:e.headerName}:[]]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Yv,{provide:zv,useExisting:Yv,multi:!0},{provide:qv,useClass:Xv},{provide:Gv,useValue:"XSRF-TOKEN"},{provide:Wv,useValue:"X-XSRF-TOKEN"}]}),t})(),Zv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Bv,{provide:vv,useClass:Kv},$v,{provide:_v,useExisting:$v}],imports:[[Qv.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();const Jv=["*"];function t_(t){return Error(`Unable to find icon with the name "${t}"`)}function e_(t){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${t}".`)}function n_(t){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${t}".`)}class i_{constructor(t,e,n){this.url=t,this.svgText=e,this.options=n}}let r_=(()=>{class t{constructor(t,e,n,i){this._httpClient=t,this._sanitizer=e,this._errorHandler=i,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=n}addSvgIcon(t,e,n){return this.addSvgIconInNamespace("",t,e,n)}addSvgIconLiteral(t,e,n){return this.addSvgIconLiteralInNamespace("",t,e,n)}addSvgIconInNamespace(t,e,n,i){return this._addSvgIconConfig(t,e,new i_(n,null,i))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,e,n,i){const r=this._sanitizer.sanitize(yr.HTML,n);if(!r)throw n_(n);return this._addSvgIconConfig(t,e,new i_("",r,i))}addSvgIconSet(t,e){return this.addSvgIconSetInNamespace("",t,e)}addSvgIconSetLiteral(t,e){return this.addSvgIconSetLiteralInNamespace("",t,e)}addSvgIconSetInNamespace(t,e,n){return this._addSvgIconSetConfig(t,new i_(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){const i=this._sanitizer.sanitize(yr.HTML,e);if(!i)throw n_(e);return this._addSvgIconSetConfig(t,new i_("",i,n))}registerFontClassAlias(t,e=t){return this._fontCssClassesByAlias.set(t,e),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const e=this._sanitizer.sanitize(yr.RESOURCE_URL,t);if(!e)throw e_(t);const n=this._cachedIconsByUrl.get(e);return n?wd(s_(n)):this._loadSvgIconFromConfig(new i_(t,null)).pipe($f(t=>this._cachedIconsByUrl.set(e,t)),D(t=>s_(t)))}getNamedSvgIcon(t,e=""){const n=o_(e,t);let i=this._svgIconConfigs.get(n);if(i)return this._getSvgFromConfig(i);if(i=this._getIconConfigFromResolvers(e,t),i)return this._svgIconConfigs.set(n,i),this._getSvgFromConfig(i);const r=this._iconSetConfigs.get(e);return r?this._getSvgFromIconSetConfigs(t,r):ip(t_(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?wd(s_(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(D(t=>s_(t)))}_getSvgFromIconSetConfigs(t,e){const n=this._extractIconWithNameFromAnySet(t,e);return n?wd(n):hv(e.filter(t=>!t.svgText).map(t=>this._loadSvgIconSetFromConfig(t).pipe(pv(e=>{const n=`Loading icon set URL: ${this._sanitizer.sanitize(yr.RESOURCE_URL,t.url)} failed: ${e.message}`;return this._errorHandler.handleError(new Error(n)),wd(null)})))).pipe(D(()=>{const n=this._extractIconWithNameFromAnySet(t,e);if(!n)throw t_(t);return n}))}_extractIconWithNameFromAnySet(t,e){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.svgText&&i.svgText.indexOf(t)>-1){const e=this._svgElementFromConfig(i),n=this._extractSvgIconFromSet(e,t,i.options);if(n)return n}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe($f(e=>t.svgText=e),D(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?wd(null):this._fetchIcon(t).pipe($f(e=>t.svgText=e))}_extractSvgIconFromSet(t,e,n){const i=t.querySelector(`[id="${e}"]`);if(!i)return null;const r=i.cloneNode(!0);if(r.removeAttribute("id"),"svg"===r.nodeName.toLowerCase())return this._setSvgAttributes(r,n);if("symbol"===r.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(r),n);const s=this._svgElementFromString("");return s.appendChild(r),this._setSvgAttributes(s,n)}_svgElementFromString(t){const e=this._document.createElement("DIV");e.innerHTML=t;const n=e.querySelector("svg");if(!n)throw Error(" tag not found");return n}_toSvgElement(t){const e=this._svgElementFromString(""),n=t.attributes;for(let i=0;ithis._inProgressUrlFetches.delete(s)),at());return this._inProgressUrlFetches.set(s,a),a}_addSvgIconConfig(t,e,n){return this._svgIconConfigs.set(o_(t,e),n),this}_addSvgIconSetConfig(t,e){const n=this._iconSetConfigs.get(t);return n?n.push(e):this._iconSetConfigs.set(t,[e]),this}_svgElementFromConfig(t){if(!t.svgElement){const e=this._svgElementFromString(t.svgText);this._setSvgAttributes(e,t.options),t.svgElement=e}return t.svgElement}_getIconConfigFromResolvers(t,e){for(let n=0;ne?e.pathname+e.search:""}}}),u_=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],h_=u_.map(t=>`[${t}]`).join(", "),d_=/^url\(['"]?#(.*?)['"]?\)$/;let p_=(()=>{class t extends l_{constructor(t,e,n,i,r){super(t),this._iconRegistry=e,this._location=i,this._errorHandler=r,this._inline=!1,this._currentIconFetch=g.EMPTY,n||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=md(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){const e=this._cleanupFontValue(t);e!==this._fontSet&&(this._fontSet=e,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const e=this._cleanupFontValue(t);e!==this._fontIcon&&(this._fontIcon=e,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const e=t.split(":");switch(e.length){case 1:return["",e[0]];case 2:return e;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const t=this._location.getPathname();t!==this._previousPath&&(this._previousPath=t,this._prependPathToReferences(t))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const e=t.querySelectorAll("style");for(let i=0;i{e.forEach(e=>{n.setAttribute(e.name,`url('${t}#${e.value}')`)})})}_cacheChildrenWithExternalReferences(t){const e=t.querySelectorAll(h_),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let i=0;i{const r=e[i],s=r.getAttribute(t),o=s?s.match(d_):null;if(o){let e=n.get(r);e||(e=[],n.set(r,e)),e.push({name:t,value:o[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[e,n]=this._splitIconName(t);e&&(this._svgNamespace=e),n&&(this._svgName=n),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(n,e).pipe(Gp(1)).subscribe(t=>this._setSvgElement(t),t=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${e}:${n}! ${t.message}`))})}}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(r_),ii("aria-hidden"),ea(c_),ea(kr))},t.\u0275cmp=Jt({type:t,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,e){2&t&&(Ko("data-mat-icon-type",e._usingFontIcon()?"font":"svg")("data-mat-icon-name",e._svgName||e.fontIcon)("data-mat-icon-namespace",e._svgNamespace||e.fontSet),ja("mat-icon-inline",e.inline)("mat-icon-no-color","primary"!==e.color&&"accent"!==e.color&&"warn"!==e.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[jo],ngContentSelectors:Jv,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:[".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0}),t})(),f_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny],Ny]}),t})();const g_=["mat-button",""],m_=["*"],b_=".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n",y_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],v_=jy(Ly(Fy(class{constructor(t){this._elementRef=t}})));let __=(()=>{class t extends v_{constructor(t,e,n){super(t),this._focusMonitor=e,this._animationMode=n,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const i of y_)this._hasHostAttributes(i)&&this._getHostElement().classList.add(i);t.nativeElement.classList.add("mat-button-base"),this.isRoundButton&&(this.color="accent")}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}focus(t,e){t?this._focusMonitor.focusVia(this._getHostElement(),t,e):this._getHostElement().focus(e)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(t=>this._getHostElement().hasAttribute(t))}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Ig),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-icon-button",""],["button","mat-fab",""],["button","mat-mini-fab",""],["button","mat-stroked-button",""],["button","mat-flat-button",""]],viewQuery:function(t,e){if(1&t&&qc(Yy,5),2&t){let t;Wc(t=Yc())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,e){2&t&&(Ko("disabled",e.disabled||null),ja("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-button-disabled",e.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[jo],attrs:g_,ngContentSelectors:m_,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,e){1&t&&(wa(),ra(0,"span",0),xa(1),sa(),oa(2,"span",1),oa(3,"span",2)),2&t&&(ws(2),ja("mat-button-ripple-round",e.isRoundButton||e.isIconButton),na("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",e.isIconButton)("matRippleTrigger",e._getHostElement()))},directives:[Yy],styles:[b_],encapsulation:2,changeDetection:0}),t})(),w_=(()=>{class t extends __{constructor(t,e,n){super(e,t,n)}_haltDisabledEvents(t){this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}}return t.\u0275fac=function(e){return new(e||t)(ea(Ig),ea(kl),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["a","mat-button",""],["a","mat-raised-button",""],["a","mat-icon-button",""],["a","mat-fab",""],["a","mat-mini-fab",""],["a","mat-stroked-button",""],["a","mat-flat-button",""]],hostAttrs:[1,"mat-focus-indicator"],hostVars:7,hostBindings:function(t,e){1&t&&fa("click",function(t){return e._haltDisabledEvents(t)}),2&t&&(Ko("tabindex",e.disabled?-1:e.tabIndex||0)("disabled",e.disabled||null)("aria-disabled",e.disabled.toString()),ja("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-button-disabled",e.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex"},exportAs:["matButton","matAnchor"],features:[jo],attrs:g_,ngContentSelectors:m_,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,e){1&t&&(wa(),ra(0,"span",0),xa(1),sa(),oa(2,"span",1),oa(3,"span",2)),2&t&&(ws(2),ja("mat-button-ripple-round",e.isRoundButton||e.isIconButton),na("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",e.isIconButton)("matRippleTrigger",e._getHostElement()))},directives:[Yy],styles:[b_],encapsulation:2,changeDetection:0}),t})(),x_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Ny],Ny]}),t})();class S_ extends v{notifyNext(t,e,n,i,r){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}class E_ extends v{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function C_(t,e,n,i,r=new E_(t,n,i)){if(!r.closed)return e instanceof C?e.subscribe(r):V(e)(r)}const O_={};function T_(...t){let e,n;return M(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&d(t[0])&&(t=t[0]),K(t,n).lift(new k_(e))}class k_{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new A_(t,this.resultSelector))}}class A_ extends S_{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(O_),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n{class t{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):D_}matchMedia(t){return this._platform.WEBKIT&&function(t){if(!P_.has(t))try{I_||(I_=document.createElement("style"),I_.setAttribute("type","text/css"),document.head.appendChild(I_)),I_.sheet&&(I_.sheet.insertRule(`@media ${t} {.fx-query-test{ }}`,0),P_.add(t))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp))},token:t,providedIn:"root"}),t})();function D_(t){return{matches:"all"===t||""===t,media:t,addListener:()=>{},removeListener:()=>{}}}let R_=(()=>{class t{constructor(t,e){this._mediaMatcher=t,this._zone=e,this._queries=new Map,this._destroySubject=new P}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return N_(yd(t)).some(t=>this._registerQuery(t).mql.matches)}observe(t){let e=T_(N_(yd(t)).map(t=>this._registerQuery(t).observable));return e=Yd(e.pipe(Gp(1)),e.pipe(Qf(1),qf(0))),e.pipe(D(t=>{const e={matches:!1,breakpoints:{}};return t.forEach(({matches:t,query:n})=>{e.matches=e.matches||t,e.breakpoints[n]=t}),e}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const e=this._mediaMatcher.matchMedia(t),n={observable:new C(t=>{const n=e=>this._zone.run(()=>t.next(e));return e.addListener(n),()=>{e.removeListener(n)}}).pipe(Kd(e),D(({matches:e})=>({query:t,matches:e})),Wd(this._destroySubject)),mql:e};return this._queries.set(t,n),n}}return t.\u0275fac=function(e){return new(e||t)(Ci(M_),Ci(xu))},t.\u0275prov=xt({factory:function(){return new t(Ci(M_),Ci(xu))},token:t,providedIn:"root"}),t})();function N_(t){return t.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}function L_(t,e){if(1&t){const t=ua();ra(0,"div",1),ra(1,"button",2),fa("click",function(){return $e(t),va().action()}),Za(2),sa(),sa()}if(2&t){const t=va();ws(2),Ja(t.data.action)}}function j_(t,e){}const F_=new oi("MatSnackBarData");class B_{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const V_=Math.pow(2,31)-1;class z_{constructor(t,e){this._overlayRef=e,this._afterDismissed=new P,this._afterOpened=new P,this._onAction=new P,this._dismissedByAction=!1,this.containerInstance=t,this.onAction().subscribe(()=>this.dismiss()),t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,V_))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}let U_=(()=>{class t{constructor(t,e){this.snackBarRef=t,this.data=e}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return t.\u0275fac=function(e){return new(e||t)(ea(z_),ea(F_))},t.\u0275cmp=Jt({type:t,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,e){1&t&&(ra(0,"span"),Za(1),sa(),Jo(2,L_,3,1,"div",0)),2&t&&(ws(1),Ja(e.data.message),ws(1),na("ngIf",e.hasAction))},directives:[_h,__],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),t})();const H_={snackBarState:Vg("state",[$g("void, hidden",Hg({transform:"scale(0.8)",opacity:0})),$g("visible",Hg({transform:"scale(1)",opacity:1})),Wg("* => visible",zg("150ms cubic-bezier(0, 0, 0.2, 1)")),Wg("* => void, * => hidden",zg("75ms cubic-bezier(0.4, 0.0, 1, 1)",Hg({opacity:0})))])};let $_=(()=>{class t extends Fp{constructor(t,e,n,i,r){super(),this._ngZone=t,this._elementRef=e,this._changeDetectorRef=n,this._platform=i,this.snackBarConfig=r,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new P,this._onExit=new P,this._onEnter=new P,this._animationState="void",this.attachDomPortal=t=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(t)),this._live="assertive"!==r.politeness||r.announcementMessage?"off"===r.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(t)}onAnimationEnd(t){const{fromState:e,toState:n}=t;if(("void"===n&&"void"!==e||"hidden"===n)&&this._completeExit(),"visible"===n){const t=this._onEnter;this._ngZone.run(()=>{t.next(),t.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}ngOnDestroy(){this._destroyed=!0,this._completeExit()}_completeExit(){this._ngZone.onMicrotaskEmpty.pipe(Gp(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,e=this.snackBarConfig.panelClass;e&&(Array.isArray(e)?e.forEach(e=>t.classList.add(e)):t.classList.add(e)),"center"===this.snackBarConfig.horizontalPosition&&t.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&t.classList.add("mat-snack-bar-top")}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),e=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&e){let n=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(n=document.activeElement),t.removeAttribute("aria-hidden"),e.appendChild(t),null==n||n.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(kl),ea(tc),ea(pp),ea(B_))},t.\u0275cmp=Jt({type:t,selectors:[["snack-bar-container"]],viewQuery:function(t,e){if(1&t&&qc(Up,7),2&t){let t;Wc(t=Yc())&&(e._portalOutlet=t.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,e){1&t&&ga("@state.done",function(t){return e.onAnimationEnd(t)}),2&t&&rl("@state",e._animationState)},features:[jo],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,e){1&t&&(ra(0,"div",0),Jo(1,j_,0,0,"ng-template",1),sa(),oa(2,"div")),2&t&&(ws(2),Ko("aria-live",e._live)("role",e._role))},directives:[Up],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[H_.snackBarState]}}),t})(),G_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rf,Hp,Rh,x_,Ny],Ny]}),t})();const W_=new oi("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new B_}});let q_=(()=>{class t{constructor(t,e,n,i,r,s){this._overlay=t,this._live=e,this._injector=n,this._breakpointObserver=i,this._parentSnackBar=r,this._defaultConfig=s,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=U_,this.snackBarContainerComponent=$_,this.handsetCssClass="mat-snack-bar-handset"}get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}openFromComponent(t,e){return this._attach(t,e)}openFromTemplate(t,e){return this._attach(t,e)}open(t,e="",n){const i=Object.assign(Object.assign({},this._defaultConfig),n);return i.data={message:t,action:e},i.announcementMessage===t&&(i.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,i)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,e){const n=No.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:B_,useValue:e}]}),i=new Np(this.snackBarContainerComponent,e.viewContainerRef,n),r=t.attach(i);return r.instance.snackBarConfig=e,r.instance}_attach(t,e){const n=Object.assign(Object.assign(Object.assign({},new B_),this._defaultConfig),e),i=this._createOverlay(n),r=this._attachSnackBarContainer(i,n),s=new z_(r,i);if(t instanceof sc){const e=new Lp(t,null,{$implicit:n.data,snackBarRef:s});s.instance=r.attachTemplatePortal(e)}else{const e=this._createInjector(n,s),i=new Np(t,void 0,e),o=r.attachComponentPortal(i);s.instance=o.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(Wd(i.detachments())).subscribe(t=>{const e=i.overlayElement.classList;t.matches?e.add(this.handsetCssClass):e.remove(this.handsetCssClass)}),n.announcementMessage&&r._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(s,n),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(t,e){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),e.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),e.duration&&e.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(e.duration))}_createOverlay(t){const e=new af;e.direction=t.direction;let n=this._overlay.position().global();const i="rtl"===t.direction,r="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!i||"end"===t.horizontalPosition&&i,s=!r&&"center"!==t.horizontalPosition;return r?n.left("0"):s?n.right("0"):n.centerHorizontally(),"top"===t.verticalPosition?n.top("0"):n.bottom("0"),e.positionStrategy=n,this._overlay.create(e)}_createInjector(t,e){return No.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:z_,useValue:e},{provide:F_,useValue:t.data}]})}}return t.\u0275fac=function(e){return new(e||t)(Ci(kf),Ci(kg),Ci(No),Ci(R_),Ci(t,12),Ci(W_))},t.\u0275prov=xt({factory:function(){return new t(Ci(kf),Ci(kg),Ci(_o),Ci(R_),Ci(t,12),Ci(W_))},token:t,providedIn:G_}),t})();const X_={tooltipState:Vg("state",[$g("initial, void, hidden",Hg({opacity:0,transform:"scale(0)"})),$g("visible",Hg({transform:"scale(1)"})),Wg("* => visible",zg("200ms cubic-bezier(0, 0, 0.2, 1)",Gg([Hg({opacity:0,transform:"scale(0)",offset:0}),Hg({opacity:.5,transform:"scale(0.99)",offset:.5}),Hg({opacity:1,transform:"scale(1)",offset:1})]))),Wg("* => hidden",zg("100ms cubic-bezier(0, 0, 0.2, 1)",Hg({opacity:0})))])},Y_="tooltip-panel",K_=_p({passive:!0}),Q_=new oi("mat-tooltip-scroll-strategy"),Z_={provide:Q_,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition({scrollThrottle:20})}},J_=new oi("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let tw=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u,h){this._overlay=t,this._elementRef=e,this._scrollDispatcher=n,this._viewContainerRef=i,this._ngZone=r,this._platform=s,this._ariaDescriber=o,this._focusMonitor=a,this._dir=c,this._defaultOptions=u,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new P,this._handleKeydown=t=>{this._isTooltipVisible()&&27===t.keyCode&&!Qp(t)&&(t.preventDefault(),t.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=l,this._document=h,u&&(u.position&&(this.position=u.position),u.touchGestures&&(this.touchGestures=u.touchGestures)),c.change.pipe(Wd(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),r.runOutsideAngular(()=>{e.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var e;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(e=this._tooltipInstance)||void 0===e||e.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}get message(){return this._message}set message(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")})}))}get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(Wd(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),t.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(([e,n])=>{t.removeEventListener(e,n,K_)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay){if(this.disabled||!this.message||this._isTooltipVisible()&&!this._tooltipInstance._showTimeoutId&&!this._tooltipInstance._hideTimeoutId)return;const e=this._createOverlay();this._detach(),this._portal=this._portal||new Np(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=e.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(Wd(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}hide(t=this.hideDelay){this._tooltipInstance&&this._tooltipInstance.hide(t)}toggle(){this._isTooltipVisible()?this.hide():this.show()}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(){if(this._overlayRef)return this._overlayRef;const t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),e=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return e.positionChanges.pipe(Wd(this._destroyed)).subscribe(t=>{this._updateCurrentPositionClass(t.connectionPair),this._tooltipInstance&&t.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:e,panelClass:`${this._cssClassPrefix}-${Y_}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Wd(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Wd(this._destroyed)).subscribe(()=>{var t;return null===(t=this._tooltipInstance)||void 0===t?void 0:t._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const e=t.getConfig().positionStrategy,n=this._getOrigin(),i=this._getOverlayPosition();e.withPositions([this._addOffset(Object.assign(Object.assign({},n.main),i.main)),this._addOffset(Object.assign(Object.assign({},n.fallback),i.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,e=this.position;let n;"above"==e||"below"==e?n={originX:"center",originY:"above"==e?"top":"bottom"}:"before"==e||"left"==e&&t||"right"==e&&!t?n={originX:"start",originY:"center"}:("after"==e||"right"==e&&t||"left"==e&&!t)&&(n={originX:"end",originY:"center"});const{x:i,y:r}=this._invertPosition(n.originX,n.originY);return{main:n,fallback:{originX:i,originY:r}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,e=this.position;let n;"above"==e?n={overlayX:"center",overlayY:"bottom"}:"below"==e?n={overlayX:"center",overlayY:"top"}:"before"==e||"left"==e&&t||"right"==e&&!t?n={overlayX:"end",overlayY:"center"}:("after"==e||"right"==e&&t||"left"==e&&!t)&&(n={overlayX:"start",overlayY:"center"});const{x:i,y:r}=this._invertPosition(n.overlayX,n.overlayY);return{main:n,fallback:{overlayX:i,overlayY:r}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(Gp(1),Wd(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,e){return"above"===this.position||"below"===this.position?"top"===e?e="bottom":"bottom"===e&&(e="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){const{overlayY:e,originX:n,originY:i}=t;let r;if(r="center"===e?this._dir&&"rtl"===this._dir.value?"end"===n?"left":"right":"start"===n?"left":"right":"bottom"===e&&"top"===i?"above":"below",r!==this._currentPosition){const t=this._overlayRef;if(t){const e=`${this._cssClassPrefix}-${Y_}-`;t.removePanelClass(e+this._currentPosition),t.addPanelClass(e+r)}this._currentPosition=r}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",()=>{this._setupPointerExitEventsIfNeeded(),this.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",()=>{this._setupPointerExitEventsIfNeeded(),clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>this.show(),500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",()=>this.hide()],["wheel",t=>this._wheelListener(t)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const e=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",e],["touchcancel",e])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([t,e])=>{this._elementRef.nativeElement.addEventListener(t,e,K_)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const e=this._document.elementFromPoint(t.clientX,t.clientY),n=this._elementRef.nativeElement;e!==n&&!n.contains(e)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const e=this._elementRef.nativeElement,n=e.style;("on"===t||"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName)&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),("on"===t||!e.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(Pp),ea(hc),ea(xu),ea(pp),ea(hg),ea(Ig),ea(void 0),ea(Op),ea(void 0),ea(Yu))},t.\u0275dir=se({type:t,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),t})(),ew=(()=>{class t extends tw{constructor(t,e,n,i,r,s,o,a,l,c,u,h){super(t,e,n,i,r,s,o,a,l,c,u,h),this._tooltipComponent=iw}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(Pp),ea(hc),ea(xu),ea(pp),ea(hg),ea(Ig),ea(Q_),ea(Op,8),ea(J_,8),ea(Yu))},t.\u0275dir=se({type:t,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[jo]}),t})(),nw=(()=>{class t{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new P}show(t){clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(()=>{this._visibility="visible",this._showTimeoutId=void 0,this._onShow(),this._markForCheck()},t)}hide(t){clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._visibility="hidden",this._hideTimeoutId=void 0,this._markForCheck()},t)}afterHidden(){return this._onHide}isVisible(){return"visible"===this._visibility}ngOnDestroy(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}_animationStart(){this._closeOnInteraction=!1}_animationDone(t){const e=t.toState;"hidden"===e&&!this.isVisible()&&this._onHide.next(),("visible"===e||"hidden"===e)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return t.\u0275fac=function(e){return new(e||t)(ea(tc))},t.\u0275dir=se({type:t}),t})(),iw=(()=>{class t extends nw{constructor(t,e){super(t),this._breakpointObserver=e,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(R_))},t.\u0275cmp=Jt({type:t,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,e){2&t&&La("zoom","visible"===e._visibility?1:null)},features:[jo],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,e){if(1&t&&(ra(0,"div",0),fa("@state.start",function(){return e._animationStart()})("@state.done",function(t){return e._animationDone(t)}),Ic(1,"async"),Za(2),sa()),2&t){let t;ja("mat-tooltip-handset",null==(t=Mc(1,5,e._isHandset))?null:t.matches),na("ngClass",e.tooltipClass)("@state",e._visibility),ws(2),Ja(e.message)}},directives:[mh],pipes:[Dh],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[X_.tooltipState]},changeDetection:0}),t})(),rw=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Z_],imports:[[Lg,Rh,Rf,Ny],Ny,Mp]}),t})();function sw(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}function ow(t,e){return function(n,i){e(n,i,t)}}function aw(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function lw(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(e){s(e)}}function a(t){try{l(i.throw(t))}catch(e){s(e)}}function l(t){t.done?r(t.value):function(t){return t instanceof n?t:new n(function(e){e(t)})}(t.value).then(o,a)}l((i=i.apply(t,e||[])).next())})}function cw(t){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)}function uw(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||cw()}const hw="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",dw=uw();class pw{constructor(t,e,n="sessionStorage"){this.storage=function(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(t){return null}}(n),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){return this.config={},this.updateConfiguration(t)}updateConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function fw(t,e,n,i=600){const r=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>i&&(n=Math.min(n,i/t.width));const s=t.width*n,o=t.height*n,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const gw={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function mw(t){return"string"==typeof t?gw[t.toUpperCase()]||gw.WHITE:t}function bw(t,e){if(!t)throw new Error(e||"Assertion failed")}const yw={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},vw=yw.window||yw.self||yw.global,_w=yw.process||{};function ww(){let t;if(dw&&vw.performance)t=vw.performance.now();else if(_w.hrtime){const e=_w.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}console;const xw={debug:dw&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Sw={enabled:!0,level:0};function Ew(){}const Cw={},Ow={once:!0};function Tw(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}let kw=(()=>{class t{constructor({id:t}={id:""}){this.id=t,this.VERSION=hw,this._startTs=ww(),this._deltaTs=ww(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new pw("__probe-".concat(this.id,"__"),Sw),this.userData={},this.timeStamp("".concat(this.id," started")),function(t,e=["constructor"]){const n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n);for(const r of i)"function"==typeof t[r]&&(e.find(t=>r===t)||(t[r]=t[r].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((ww()-this._startTs).toPrecision(10))}getDelta(){return Number((ww()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,e){bw(t,e)}warn(t){return this._getLogFunction(0,t,xw.warn,arguments,Ow)}error(t){return this._getLogFunction(0,t,xw.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,xw.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,xw.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,xw.debug||xw.info,arguments,Ow)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||Ew,n&&[n],{tag:Tw(e)}):Ew}image({logLevel:t,priority:e,image:i,message:r="",scale:s=1}){return this._shouldLog(t||e)?dw?function({image:t,message:e="",scale:n=1}){if("string"==typeof t){const i=new Image;return i.onload=()=>{const t=fw(i,e,n);console.log(...t)},i.src=t,Ew}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...fw(t,e,n)),Ew;if("canvas"===i.toLowerCase()){const i=new Image;return i.onload=()=>console.log(...fw(i,e,n)),i.src=t.toDataURL(),Ew}return Ew}({image:i,message:r,scale:s}):function({image:t,message:e="",scale:r=1}){let s=null;try{s=n(75307)}catch(i){}return s?()=>s(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(t=>console.log(t)):Ew}({image:i,message:r,scale:s}):Ew}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,e){this._storage.updateConfiguration({[t]:e})}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||Ew)}group(t,e,n={collapsed:!1}){n=Pw({logLevel:t,message:e,opts:n});const{collapsed:i}=n;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,e,n={}){return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Ew)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Aw(t)}_getLogFunction(t,e,n,i=[],r){if(this._shouldLog(t)){r=Pw({logLevel:t,message:e,args:i,opts:r}),bw(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=ww();const s=r.tag||r.message;if(r.once){if(Cw[s])return Ew;Cw[s]=ww()}return e=function(t,e,n){if("string"==typeof e){const i=n.time?function(t,e=8){const n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(n.total)):"";e=function(t,e,n){return!dw&&"string"==typeof t&&(e&&(e=mw(e),t="\x1b[".concat(e,"m").concat(t,"\x1b[39m")),n&&(e=mw(n),t="\x1b[".concat(n+10,"m").concat(t,"\x1b[49m"))),t}(e=n.time?"".concat(t,": ").concat(i," ").concat(e):"".concat(t,": ").concat(e),n.color,n.background)}return e}(this.id,r.message,r),n.bind(console,e,...r.args)}return Ew}}return t.VERSION=hw,t})();function Aw(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return bw(Number.isFinite(e)&&e>=0),e}function Pw(t){const{logLevel:e,message:n}=t;t.logLevel=Aw(e);const i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==n;);switch(t.args=i,typeof e){case"string":case"function":void 0!==n&&i.unshift(n),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());const r=typeof t.message;return bw("string"===r||"object"===r),Object.assign(t,t.opts)}var Iw=new kw({id:"deck"});const Mw={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Mw,"IDENTITY",{get:()=>Iw.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Dw={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Rw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Nw=new kw({id:"luma.gl"});function Lw(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function jw(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version))}function Fw(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function Bw(t){return Lw(jw(t),"Invalid WebGLRenderingContext"),t}function Vw(t){return Lw(Fw(t),"Requires WebGL2"),t}var zw=n(84761);const Uw={};const Hw=function t(e){const n=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{zw.CO.console&&zw.CO.console.log&&zw.CO.console.log("OESVertexArrayObject emulation library context restored"),e.reset_()},!0),this.reset_()};$w.prototype.VERTEX_ARRAY_BINDING_OES=34229,$w.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;tFw(t)?void 0:0,Yw={3074:t=>Fw(t)?void 0:36064,35723:t=>Fw(t)?void 0:4352,35977:Xw,32937:Xw,36795:(t,e)=>{const n=Fw(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?e(n.GPU_DISJOINT_EXT):0},37445:(t,e)=>{const n=t.getExtension(qw);return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const n=t.getExtension(qw);return e(n&&n.UNMASKED_RENDERER_WEBGL||7937)},34047:(t,e)=>{const n=t.luma.extensions.EXT_texture_filter_anisotropic;return n?e(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:Xw,35071:Xw,37447:Xw,36063:(t,e)=>{if(!Fw(t)){const n=t.getExtension(Ww);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Xw,35374:Xw,35377:Xw,34852:t=>{if(!Fw(t)){const e=t.getExtension(Ww);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(Gw)?2147483647:65535,33001:t=>t.getExtension(Gw)?16777216:65535,33e3:t=>16777216,37157:Xw,35373:Xw,35657:Xw,36183:Xw,37137:Xw,34045:Xw,35978:Xw,35979:Xw,35968:Xw,35376:Xw,35375:Xw,35659:Xw,37154:Xw,35371:Xw,35658:Xw,35076:Xw,35077:Xw,35380:Xw},Kw="ANGLE_instanced_arrays",Qw={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Lw(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[Kw]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){Lw(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Lw(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Lw(!1)},deleteQuery:()=>{Lw(!1)},beginQuery:()=>{Lw(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},Zw={readBuffer:(t,e,n)=>{Fw(t)&&e(n)},getVertexAttrib:(t,e,n,i)=>{const{webgl2:r,ext:s}=function(t,e){return{webgl2:Fw(t),ext:t.getExtension("ANGLE_instanced_arrays")}}(t);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(n,i)},getProgramParameter:(t,e,n,i)=>{if(!Fw(t))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,i)},getInternalformatParameter:(t,e,n,i,r)=>{if(!Fw(t))switch(r){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(n,i,r)},getTexParameter(t,e,n,i){switch(i){case 34046:const{extensions:e}=t.luma,n=e.EXT_texture_filter_anisotropic;i=n&&n.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(n,i)},getParameter:function(t,e,n){const i=Yw[n],r="function"==typeof i?i(t,e,n):i;return void 0!==r?r:e(n)},hint:(t,e,n,i)=>e(n,i)};function Jw(t,{extension:e,target:n,target2:i}){const r=Qw[e];Lw(r);const{meta:s={}}=r,{suffix:o=""}=s,a=t.getExtension(e);for(const l of Object.keys(r)){const e=`${l}${o}`;let s=null;"meta"===l||"function"==typeof t[l]||(a&&"function"==typeof a[e]?s=(...t)=>a[e](...t):"function"==typeof r[l]&&(s=r[l].bind(n))),s&&(n[l]=s,i[l]=s)}}("undefined"!=typeof global?global:window).polyfillContext=function(t){t.luma=t.luma||{};const{luma:e}=t;return e.polyfilled||(function(t){if("function"==typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const n=t.getExtension;t.getExtension=function(e){return n.call(this,e)||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new $w(this)),this.__OESVertexArrayObject))}}(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const n of e)t.luma[n]=t.getExtension(n)}(t),function(t,e){for(const n of Object.getOwnPropertyNames(e))"overrides"!==n&&Jw(t,{extension:n,target:t.luma,target2:t})}(t,Qw),function(t,{target:e,target2:n}){Object.keys(Zw).forEach(i=>{if("function"==typeof Zw[i]){const r=t[i]?t[i].bind(t):()=>{},s=Zw[i].bind(null,t,r);e[i]=s,n[i]=s}})}(t,{target:e,target2:t}),e.polyfilled=!0),t};const tx={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ex=(t,e,n)=>e?t.enable(n):t.disable(n),nx=(t,e,n)=>t.hint(n,e),ix=(t,e,n)=>t.pixelStorei(n,e);function rx(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const sx={3042:ex,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:ex,2885:(t,e)=>t.cullFace(e),2929:ex,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:ex,35723:nx,36006:(t,e)=>{const n=Fw(t)?36009:36160;return t.bindFramebuffer(n,e)},2886:(t,e)=>t.frontFace(e),33170:nx,2849:(t,e)=>t.lineWidth(e),32823:ex,32824:"polygonOffset",10752:"polygonOffset",35977:ex,32938:"sampleCoverage",32939:"sampleCoverage",3089:ex,3088:(t,e)=>t.scissor(...e),2960:ex,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:ix,3317:ix,37440:ix,37441:ix,37443:ix,3330:ix,3332:ix,3331:ix,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:ix,32878:ix,3316:ix,3315:ix,32877:ix,framebuffer:(t,e)=>t.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=rx(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=rx(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=rx(e)?e:[e,e];const[n,i]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=rx(e)&&3===e.length?[...e,...e]:e;const[n,i,r,s,o,a]=e;t.stencilFuncSeparate(1028,n,i,r),t.stencilFuncSeparate(1029,s,o,a)},stencilOp:(t,e)=>{e=rx(e)&&3===e.length?[...e,...e]:e;const[n,i,r,s,o,a]=e;t.stencilOpSeparate(1028,n,i,r),t.stencilOpSeparate(1029,s,o,a)},viewport:(t,e)=>t.viewport(...e)};function ox(t,e,n){return void 0!==e[t]?e[t]:n[t]}const ax={blendEquation:(t,e,n)=>t.blendEquationSeparate(ox(32777,e,n),ox(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(ox(32969,e,n),ox(32968,e,n),ox(32971,e,n),ox(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(ox(32824,e,n),ox(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(ox(32938,e,n),ox(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,ox(2962,e,n),ox(2967,e,n),ox(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,ox(34816,e,n),ox(36003,e,n),ox(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,ox(2964,e,n),ox(2965,e,n),ox(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,ox(34817,e,n),ox(34818,e,n),ox(34819,e,n))},lx={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},blendColor:(t,e,n,i,r)=>t({32773:new Float32Array([e,n,i,r])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,i,r)=>t({32969:e,32968:n,32971:i,32970:r}),clearColor:(t,e,n,i,r)=>t({3106:new Float32Array([e,n,i,r])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,i,r)=>t({3107:[e,n,i,r]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,i,r)=>t({3088:new Int32Array([e,n,i,r])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[1028===e?2968:36005]:n}),stencilFunc:(t,e,n,i)=>t({2962:e,2967:n,2963:i,34816:e,36003:n,36004:i}),stencilFuncSeparate:(t,e,n,i,r)=>t({[1028===e?2962:34816]:n,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(t,e,n,i)=>t({2964:e,2965:n,2966:i,34817:e,34818:n,34819:i}),stencilOpSeparate:(t,e,n,i,r)=>t({[1028===e?2964:34817]:n,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(t,e,n,i,r)=>t({2978:[e,n,i,r]})},cx=(t,e)=>t.isEnabled(e),ux={3042:cx,2884:cx,2929:cx,3024:cx,32823:cx,32926:cx,32928:cx,3089:cx,2960:cx,35977:cx};function hx(t){for(const e in t)return!1;return!0}function dx(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&i&&t.length===e.length){for(let n=0;n{})}={}){this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?function(t,e){if("number"==typeof(e=e||tx)){const n=e,i=ux[n];return i?i(t,n):t.getParameter(n)}const n=Array.isArray(e)?e:Object.keys(e),i={};for(const r of n){const e=ux[r];i[r]=e?e(t,Number(r)):t.getParameter(Number(r))}return i}(t):Object.assign({},tx),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(t={}){this.stateStack.push({})}pop(){Lw(this.stateStack.length>0),yx(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(t){let e,n=!1;const i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const r in t){Lw(void 0!==r);const s=t[r],o=this.cache[r];dx(s,o)||(n=!0,e=o,i&&!(r in i)&&(i[r]=o),this.cache[r]=s)}return{valueChanged:n,oldValue:e}}}function mx(t,e={}){const{enable:n=!0,copyState:i}=e;if(Lw(void 0!==i),!t.state){const e="undefined"!=typeof global?global:window,{polyfillContext:n}=e;n&&n(t),t.state=new gx(t,{copyState:i}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(e(n),t.state.program=n)}}(t);for(const i in lx)fx(t,i,lx[i]);px(t,"getParameter"),px(t,"isEnabled")}return t.state.enable=n,t}function bx(t){Lw(t.state),t.state.pop()}function yx(t,e){if(Lw(jw(t),"setParameters requires a WebGL context"),hx(e))return;const n={};for(const r in e){const i=Number(r),s=sx[r];s&&("string"==typeof s?n[s]=!0:s(t,e[r],i))}const i=t.state&&t.state.cache;if(i)for(const r in n)ax[r](t,e,i)}function vx(t,e,n){if(hx(e))return n(t);const{nocatch:i=!0}=e;let r;if(function(t){t.state||mx(t,{copyState:!1}),t.state.push()}(t),yx(t,e),i)r=n(t),bx(t);else try{r=n(t)}finally{bx(t)}return r}function _x(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:n}=e.canvasSizeInfo;return n?t.drawingBufferWidth/n:1}return 1}function wx(t,e,n=!0){return function(t,e,n,i,r){const s=xx(t[0],e,n);let o=Sx(t[1],e,i,r),a=xx(t[0]+1,e,n);const l=a===n-1?a:a-1;let c;return a=Sx(t[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,_x(t),t.drawingBufferWidth,t.drawingBufferHeight,n)}function xx(t,e,n){return Math.min(Math.round(t*e),n-1)}function Sx(t,e,n,i){return i?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const Ex=(0,zw.jU)(),Cx=Ex&&"undefined"!=typeof document,Ox={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Tx(t={}){Lw(Ex,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},Ox,t);const{width:e,height:n}=t;function i(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let r;t.onError=i;const{canvas:s}=t,o=function({canvas:t,width:e=800,height:n=600,onError:i}){let r;return"string"==typeof t?(Cx&&"complete"===document.readyState||i(`createGLContext called on canvas '${t}' before page was loaded`),r=document.getElementById(t)):t?r=t:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(n)?`${n}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:n,onError:i});return r=function(t,e){const{onError:n}=e;let i=null;const r=t=>i=t.statusMessage||i;t.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||t.getContext("webgl2",e),a=a||t.getContext("experimental-webgl2",e)),s&&(a=a||t.getContext("webgl",e),a=a||t.getContext("experimental-webgl",e)),t.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):n(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,t),r?(r=kx(r,t),function(t){const e=Fw(t)?"WebGL2":"WebGL1",n=function(t){const e=t.getParameter(7936),n=t.getParameter(7937),i=t.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&t.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&t.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:e,rendererMasked:n,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t);Nw.info(1,`${e}${t.debug?" debug":""} context ${n?`(${n.vendor},${n.renderer})`:""}`)()}(r),r):null}function kx(t,e={}){if(!t||t._instrumented)return t;t._version=t._version||function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext?2:1}(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},Ox,e);const{manageState:n,debug:i}=e;return n&&mx(t,{copyState:!1,log:(...t)=>Nw.log(1,...t)()}),Ex&&i&&(zw.CO.makeDebugContext?(t=zw.CO.makeDebugContext(t,e),Nw.level=Math.max(Nw.level,1)):Nw.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function Ax(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}class Px{constructor(t,e){this.name=t,this.type=e,this.sampleSize=1,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ax(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ax()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class Ix{constructor({id:t,stats:e}){this.id=t,this.stats={},this._initializeStats(e),Object.seal(this)}get(t,e="count"){return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach(e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(t=>this._getOrCreate(t))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:n}=t;return this.stats[e]||(this.stats[e]=t instanceof Px?t:new Px(e,n)),this.stats[e]}}const Mx="8.5.7",Dx=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new Ix({id:t})),this.stats.get(t)}};if(zw.CO.luma&&zw.CO.luma.VERSION!==Mx)throw new Error(`luma.gl - multiple VERSIONs detected: ${zw.CO.luma.VERSION} vs 8.5.7`);function Rx(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Nx(t,e){if("string"!=typeof e)return e;const n=Number(e);if(!isNaN(n))return n;const i=t[e=e.replace(/^.*\./,"")];return Rx(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Lx(t,e){e=Number(e);for(const n in t)if(t[n]===e)return`GL.${n}`;return String(e)}zw.CO.luma||((0,zw.jU)()&&Nw.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),zw.CO.luma=zw.CO.luma||{VERSION:Mx,version:Mx,log:Nw,stats:Dx,globals:{modules:{},nodeIO:{}}});const jx={};function Fx(t="id"){return jx[t]=jx[t]||1,`${t}-${jx[t]++}`}function Bx(t){return Rx("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function Vx(t){let e=!0;for(const n in t){e=!1;break}return e}function zx(t,e,n,i){const r=`See luma.gl ${n} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(t);i.forEach(t=>{s.methodName||(s[t]=()=>{throw Nw.removed(`Calling removed method ${e}.${t}: `,r)(),new Error(t)})})}const Ux="Resource subclass must define virtual methods";class Hx{constructor(t,e={}){Bw(t);const{id:n,userData:i={}}=e;this.gl=t,this.gl2=t,this.id=n||Fx(this.constructor.name),this.userData=i,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:t=!1}={}){const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEach(t=>t.delete()),this}bind(t=this.handle){if("function"!=typeof t)return this._bindHandle(t),this;let e;return this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e}unbind(){this.bind(null)}getParameter(t,e={}){Rx(t=Nx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Fw(this.gl);if("webgl2"in n&&!t||"extension"in n&&!this.gl.getExtension(n.extension)){const e=n.webgl1,i="webgl2"in n?n.webgl2:n.webgl1;return t?i:e}}return this._getParameter(t,e)}getParameters(t={}){const{parameters:e,keys:n}=t,i=this.constructor.PARAMETERS||{},r=Fw(this.gl),s={},o=e||Object.keys(i);for(const a of o){const e=i[a];if(e&&(!("webgl2"in e)||r)&&(!("extension"in e)||this.gl.getExtension(e.extension))){const i=n?Lx(this.gl,a):a;s[i]=this.getParameter(a,t),n&&"GLenum"===e.type&&(s[i]=Lx(this.gl,s[i]))}}return s}setParameter(t,e){Rx(t=Nx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Fw(this.gl);if("webgl2"in n&&!t||"extension"in n&&!this.gl.getExtension(n.extension))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(e=Nx(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,n){return zx(this,t,e,n)}initialize(t){}_createHandle(){throw new Error(Ux)}_deleteHandle(){throw new Error(Ux)}_bindHandle(t){throw new Error(Ux)}_getOptsFromHandle(){throw new Error(Ux)}_getParameter(t,e){throw new Error(Ux)}_setParameter(t,e){throw new Error(Ux)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this.constructor.name,e=Dx.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}_removeStats(){const t=this.constructor.name;Dx.get("Resource Counts").get(`${t}s Active`).decrementCount()}_trackAllocatedMemory(t,e=this.constructor.name){const n=Dx.get("Memory Usage");n.get("GPU Memory").addCount(t),n.get(`${e} Memory`).addCount(t),this.byteLength=t}_trackDeallocatedMemory(t=this.constructor.name){const e=Dx.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get(`${t} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function $x(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Gx(t,{clamped:e=!0}={}){switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function Wx({data:t,width:e,height:n}){const i=Math.round(e/2),r=Math.round(n/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Kx.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Kx.getBytesPerVertex(this)}_assign(t={}){return void 0!==(t=qx("Accessor",t,Yx)).type&&(this.type=t.type,(5124===t.type||5125===t.type)&&(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&(this.index="boolean"==typeof t.index?t.index?1:0:t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}const Qx={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},Zx={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Qx},Jx={removedProps:Qx};class tS extends Hx{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(t=this.accessor){return Math.round(this.byteLength/Kx.getBytesPerElement(t))}getVertexCount(t=this.accessor){return Math.round(this.byteLength/Kx.getBytesPerVertex(t))}initialize(t={}){return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=qx("Buffer",t,Zx),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=qx("Buffer",t,Jx))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new Kx(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:n=0,srcOffset:i=0}=t,r=t.byteLength||t.length;Rx(e);const s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==i||void 0!==r?(Vw(this.gl),this.gl.bufferSubData(this.target,n,e,i,r)):this.gl.bufferSubData(s,n,e),this.gl.bindBuffer(s,null),this.debugData=null,this._inferType(e),this}copyData({sourceBuffer:t,readOffset:e=0,writeOffset:n=0,size:i}){const{gl:r}=this;return Vw(r),r.bindBuffer(36662,t.handle),r.bindBuffer(36663,this.handle),r.copyBufferSubData(36662,36663,e,n,i),r.bindBuffer(36662,null),r.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:t=null,srcByteOffset:e=0,dstOffset:n=0,length:i=0}={}){Vw(this.gl);const r=Gx(this.accessor.type||5126,{clamped:!1}),s=this._getAvailableElementCount(e),o=n;let a,l;t?(l=t.length,a=l-o):(a=Math.min(s,i||s),l=o+a);const c=Math.min(s,a);return Rx((i=i||c)<=c),t=t||new r(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,n,i),this.gl.bindBuffer(36662,null),t}bind({target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:n=0,size:i}={}){return 35345===t||35982===t?void 0!==i?this.gl.bindBufferRange(t,e,this.handle,n,i):(Rx(0===n),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind({target:t=this.target,index:e=this.accessor&&this.accessor.index}={}){return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t,e=0,n=t.byteLength+e){Rx(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const i=this._getTarget();this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,this.usage),this.gl.bufferSubData(i,e,t),this.gl.bindBuffer(i,null),this.debugData=t.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n);const r=$x(t);return Rx(r),this.setAccessor(new Kx(this.accessor,{type:r})),this}_setByteLength(t,e=this.usage){Rx(t>=0),this._trackDeallocatedMemory();let n=t;0===t&&(n=new Float32Array(0));const i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,e),this.gl.bindBuffer(i,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/Gx(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new Kx(this.accessor,{type:$x(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return Nw.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return Nw.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return Nw.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return Nw.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Kx(this.accessor,t),this}}const eS={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},nS={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},iS={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},rS=[9729,9728],sS=zw.CO.WebGLBuffer||function(){};class oS extends Hx{static isSupported(t,e={}){const{format:n,linearFiltering:i}=e;let r=!0;return n&&(r=r&&function(t,e){const n=eS[e];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;const i=Fw(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}(t,n),r=r&&(!i||function(t,e){const n=eS[e];switch(n&&n.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}(t,n))),r}constructor(t,e){const{id:n=Fx("texture"),handle:i,target:r}=e;super(t,{id:n,handle:i}),this.target=r,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(t={}){let e=t.data;if(e instanceof Promise)return e.then(e=>this.initialize(Object.assign({},t,{pixels:e,data:e}))),this;const n="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(n&&e.readyStatethis.initialize(t)),this;const{pixels:i=null,format:r=6408,border:s=0,recreate:o=!1,parameters:a={},pixelStore:l={},textureUnit:c}=t;e||(e=i);let{width:u,height:h,dataFormat:d,type:p,compressed:f=!1,mipmaps:g=!0}=t;const{depth:m=0}=t;return({width:u,height:h,compressed:f,dataFormat:d,type:p}=this._deduceParameters({format:r,type:p,dataFormat:d,compressed:f,data:e,width:u,height:h})),this.width=u,this.height=h,this.depth=m,this.format=r,this.type=p,this.dataFormat=d,this.border=s,this.textureUnit=c,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),g&&this._isNPOT()&&(Nw.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),g=!1,this._updateForNPOT(a)),this.mipmaps=g,this.setImageData({data:e,width:u,height:h,depth:m,format:r,type:p,dataFormat:d,border:s,mipmaps:g,parameters:l,compressed:f}),g&&this.generateMipmap(),this.setParameters(a),o&&(this.data=e),n&&(this._video={video:e,parameters:a,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:n}=this._video;if(n===t.currentTime||t.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:n=null,level:i=0,format:r=this.format,border:s=this.border,offset:o=0,parameters:a={}}=t;let{data:l=null,type:c=this.type,width:u=this.width,height:h=this.height,dataFormat:d=this.dataFormat,compressed:p=!1}=t;l||(l=n),({type:c,dataFormat:d,compressed:p,width:u,height:h}=this._deduceParameters({format:r,type:c,dataFormat:d,compressed:p,data:l,width:u,height:h}));const{gl:f}=this;f.bindTexture(this.target,this.handle);let g,m=null;return({data:l,dataType:m}=this._getDataType({data:l,compressed:p})),vx(this.gl,a,()=>{switch(m){case"null":f.texImage2D(e,i,r,u,h,s,d,c,l);break;case"typed-array":f.texImage2D(e,i,r,u,h,s,d,c,l,o);break;case"buffer":g=Vw(f),g.bindBuffer(35052,l.handle||l),g.texImage2D(e,i,r,u,h,s,d,c,o),g.bindBuffer(35052,null);break;case"browser-object":Fw(f)?f.texImage2D(e,i,r,u,h,s,d,c,l):f.texImage2D(e,i,r,d,c,l);break;case"compressed":for(const[t,n]of l.entries())f.compressedTexImage2D(e,t,n.format,n.width,n.height,s,n.data);break;default:Rx(!1,"Unknown image data type")}}),this._trackAllocatedMemory(l&&l.byteLength?l.byteLength:this.width*this.height*(nS[this.dataFormat]||4)*(iS[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:t=this.target,pixels:e=null,data:n=null,x:i=0,y:r=0,width:s=this.width,height:o=this.height,level:a=0,format:l=this.format,type:c=this.type,dataFormat:u=this.dataFormat,compressed:h=!1,offset:d=0,border:p=this.border,parameters:f={}}){if(({type:c,dataFormat:u,compressed:h,width:s,height:o}=this._deduceParameters({format:l,type:c,dataFormat:u,compressed:h,data:n,width:s,height:o})),Rx(0===this.depth,"texSubImage not supported for 3D textures"),n||(n=e),n&&n.data){const t=n;n=t.data,s=t.shape[0],o=t.shape[1]}n instanceof tS&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),vx(this.gl,f,()=>{if(h)this.gl.compressedTexSubImage2D(t,a,i,r,s,o,l,n);else if(null===n)this.gl.texSubImage2D(t,a,i,r,s,o,u,c,null);else if(ArrayBuffer.isView(n))this.gl.texSubImage2D(t,a,i,r,s,o,u,c,n,d);else if(n instanceof sS){const e=Vw(this.gl);e.bindBuffer(35052,n),e.texSubImage2D(t,a,i,r,s,o,u,c,d),e.bindBuffer(35052,null)}else Fw(this.gl)?Vw(this.gl).texSubImage2D(t,a,i,r,s,o,u,c,n):this.gl.texSubImage2D(t,a,i,r,u,c,n)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(t={}){return Nw.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType({data:t,compressed:e=!1}){return e?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof tS?{data:t.handle,dataType:"buffer"}:t instanceof sS?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:n}=t;let{width:i,height:r,dataFormat:s,type:o,compressed:a}=t;const l=eS[e];return s=s||l&&l.dataFormat,o=o||l&&l.types[0],a=a||l&&l.compressed,({width:i,height:r}=this._deduceImageSize(n,i,r)),{dataFormat:s,type:o,compressed:a,width:i,height:r,format:e,data:n}}_deduceImageSize(t,e,n){let i;return i="undefined"!=typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:n}:{width:e>=0?e:1,height:n>=0?n:1},Rx(i,"Could not deduced texture size"),Rx(void 0===e||i.width===e,"Deduced texture width does not match supplied width"),Rx(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Rx(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Fw(this.gl)||!this.width||!this.height||Bx(this.width)&&Bx(this.height))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===rS.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}function aS(t,e){return Rx("string"==typeof t),t=""+t,new Promise((n,i)=>{try{const r=new Image;r.onload=()=>n(r),r.onerror=()=>i(new Error(`Could not load image ${t}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=t}catch(r){i(r)}})}class lS extends oS{static isSupported(t,e){return oS.isSupported(t,e)}constructor(t,e={}){Bw(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:aS(e.data)})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}const cS="EXT_color_buffer_float";var uS={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:cS,bpp:2},33327:{gl2:cS,bpp:4},34842:{gl2:cS,bpp:8},33326:{gl2:cS,bpp:4},33328:{gl2:cS,bpp:8},34836:{gl2:cS,bpp:16},35898:{gl2:cS,bpp:4}};class hS extends Hx{static isSupported(t,{format:e}={format:null}){return!e||function(t,e,n){const i=n[e];if(!i)return!1;const r=Fw(t)&&i.gl2||i.gl1;return"string"==typeof r?t.getExtension(r):r}(t,e,uS)}static getSamplesForFormat(t,{format:e}){return t.getInternalformatParameter(36161,e,32937)}constructor(t,e={}){super(t,e),this.initialize(e),Object.seal(this)}initialize({format:t,width:e=1,height:n=1,samples:i=0}){return Rx(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==i&&Fw(this.gl)?this.gl.renderbufferStorageMultisample(36161,i,t,e,n):this.gl.renderbufferStorage(36161,t,e,n),this.format=t,this.width=e,this.height=n,this.samples=i,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*uS[this.format].bpp),this}resize({width:t,height:e}){return t!==this.width||e!==this.height?this.initialize({width:t,height:e,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}const dS="clear: bad arguments";function pS(t,{framebuffer:e=null,color:n=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;n&&(o|=16384,!0!==n&&(s.clearColor=n)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),Rx(0!==o,dS),vx(t,s,()=>{t.clear(o)})}function fS(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function gS(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var s=t.apply(e,n);function o(t){fS(s,i,r,o,a,"next",t)}function a(t){fS(s,i,r,o,a,"throw",t)}o(void 0)})}}const mS=[34069,34070,34071,34072,34073,34074];let bS=(()=>{class t extends oS{constructor(t,e={}){Bw(t),super(t,Object.assign({},e,{target:34067})),this.initialize(e),Object.seal(this)}initialize(t={}){const{mipmaps:e=!0,parameters:n={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(n)}),this}subImage({face:t,data:e,x:n=0,y:i=0,mipmapLevel:r=0}){return this._subImage({target:t,data:e,x:n,y:i,mipmapLevel:r})}setCubeMapImageData({width:t,height:e,pixels:n,data:i,border:r=0,format:s=6408,type:o=5121}){var a=this;return gS(function*(){const{gl:l}=a,c=n||i,u=yield Promise.all(mS.map(t=>{const e=c[t];return Promise.all(Array.isArray(e)?e:[e])}));a.bind(),mS.forEach((n,i)=>{u[i].length>1&&!1!==a.opts.mipmaps&&Nw.warn(`${a.id} has mipmap and multiple LODs.`)(),u[i].forEach((i,a)=>{t&&e?l.texImage2D(n,a,s,t,e,r,s,o,i):l.texImage2D(n,a,s,s,o,i)})}),a.unbind()})()}setImageDataForFace(t){const{face:e,width:n,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}=t,{gl:c}=this,u=r||s;return this.bind(),u instanceof Promise?u.then(n=>this.setImageDataForFace(Object.assign({},t,{face:e,data:n,pixels:n}))):this.width||this.height?c.texImage2D(e,0,a,n,i,o,a,l,u):c.texImage2D(e,0,a,a,l,u),this}}return t.FACES=mS,t})();class yS extends oS{static isSupported(t){return Fw(t)}constructor(t,e={}){Vw(t),super(t,e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1})),this.initialize(e),Object.seal(this)}setImageData({level:t=0,dataFormat:e=6408,width:n,height:i,depth:r=1,border:s=0,format:o,type:a=5121,offset:l=0,data:c,parameters:u={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),vx(this.gl,u,()=>{ArrayBuffer.isView(c)&&this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,c),c instanceof tS&&(this.gl.bindBuffer(35052,c.handle),this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,l))}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*this.depth*(nS[this.dataFormat]||4)*(iS[this.type]||1),"Texture"),this.loaded=!0,this}}function vS(t,e){const{gl:n,width:i,height:r,id:s}=t;return new SS(n,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:t}}))}function _S(t,e={}){const{sourceX:n=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:u,deleteFramebuffer:h}=function(t){return t instanceof SS?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:vS(t),deleteFramebuffer:!0}}(t);Rx(u);const{gl:d,handle:p,attachments:f}=u;a=a||u.width,l=l||u.height,36064===s&&null===p&&(s=1028),Rx(f[s]),c=c||f[s].type,o=function(t,e,n,i,r){if(t)return t;return new(Gx(e=e||5121,{clamped:!1}))(i*r*function(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Rx(!1),0}}(n))}(o,c,r,a,l),c=c||$x(o);const g=d.bindFramebuffer(36160,p);return d.readPixels(n,i,a,l,r,c,o),d.bindFramebuffer(36160,g||null),h&&u.delete(),o}function wS(t,{sourceAttachment:e=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}={}){let i=_S(t,{sourceAttachment:e}),{width:r,height:s}=t;for(;s>n;)({data:i,width:r,height:s}=Wx({data:i,width:r,height:s}));!function({data:t,width:e,height:n,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&e>=0,"Width and height need to be integers"),this.width=t,this.height=e,n)for(const c in n){const i=n[c];(Array.isArray(i)?i[0]:i).resize({width:t,height:e})}else n=this._createDefaultAttachments(i,r,s,t,e);this.update({clearAttachments:!0,attachments:n,readBuffer:a,drawBuffers:l}),n&&o&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update({attachments:t={},readBuffer:e,drawBuffers:n,clearAttachments:i=!1,resizeAttachments:r=!0}){this.attach(t,{clearAttachments:i,resizeAttachments:r});const{gl:s}=this,o=s.bindFramebuffer(36160,this.handle);return e&&this._setReadBuffer(e),n&&this._setDrawBuffers(n),s.bindFramebuffer(36160,o||null),this}resize(t={}){let{width:e,height:n}=t;if(null===this.handle)return Rx(void 0===e&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),e!==this.width&&n!==this.height&&Nw.log(2,`Resizing framebuffer ${this.id} to ${e}x${n}`)();for(const i in this.attachments)this.attachments[i].resize({width:e,height:n});return this.width=e,this.height=n,this}attach(t,{clearAttachments:e=!1,resizeAttachments:n=!0}={}){const i={};e&&Object.keys(this.attachments).forEach(t=>{i[t]=null}),Object.assign(i,t);const r=this.gl.bindFramebuffer(36160,this.handle);for(const s in i){Rx(void 0!==s,"Misspelled framebuffer binding point?");const t=Number(s),e=i[t];let r=e;if(r)if(r instanceof hS)this._attachRenderbuffer({attachment:t,renderbuffer:r});else if(Array.isArray(e)){const[n,i=0,s=0]=e;r=n,this._attachTexture({attachment:t,texture:n,layer:i,level:s})}else this._attachTexture({attachment:t,texture:r,layer:0,level:0});else this._unattach(t);n&&r&&r.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,r||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter(t=>!this.attachments[t]).forEach(t=>{delete this.attachments[t]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(t){return(SS.STATUS||{})[t]||`Framebuffer error ${t}`}(t));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),n=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),n}clear(t={}){const{color:e,depth:n,stencil:i,drawBuffers:r=[]}=t,s=this.gl.bindFramebuffer(36160,this.handle);return(e||n||i)&&pS(this.gl,{color:e,depth:n,stencil:i}),r.forEach((t,e)=>{!function(t,{framebuffer:e=null,buffer:n=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){Vw(t),vx(t,{framebuffer:e},()=>{switch(n){case 6144:switch(r.constructor){case Int32Array:t.clearBufferiv(n,i,r);break;case Uint32Array:t.clearBufferuiv(n,i,r);break;case Float32Array:default:t.clearBufferfv(n,i,r)}break;case 6145:t.clearBufferfv(6145,0,[r]);break;case 6146:t.clearBufferiv(6146,0,[r]);break;case 34041:const[e,s]=r;t.clearBufferfi(34041,0,e,s);break;default:Rx(!1,dS)}})}(this.gl,{drawBuffer:e,value:t})}),this.gl.bindFramebuffer(36160,s||null),this}readPixels(t={}){return Nw.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(t={}){return Nw.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(t={}){return Nw.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(t={}){return Nw.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(t={}){return Nw.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(t={}){return Nw.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:t=[],x:e=0,y:n=0,width:i,height:r}){const s=Vw(this.gl),o=s.bindFramebuffer(36008,this.handle);return 0===e&&0===n&&void 0===i&&void 0===r?s.invalidateFramebuffer(36008,t):s.invalidateFramebuffer(36008,t,e,n,i,r),s.bindFramebuffer(36008,o),this}getAttachmentParameter(t,e,n){let i=this._getAttachmentParameterFallback(e);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Lx(this.gl,i)),i}getAttachmentParameters(t=36064,e,n=this.constructor.ATTACHMENT_PARAMETERS||[]){const i={};for(const r of n)i[e?Lx(this.gl,r):r]=this.getAttachmentParameter(t,r,e);return i}getParameters(t=!0){const e=Object.keys(this.attachments),n={};for(const i of e){const e=Number(i);n[t?Lx(this.gl,e):e]=this.getAttachmentParameters(e,t)}return n}show(){return"undefined"!=typeof window&&window.open(wS(this),"luma-debug-texture"),this}log(t=0,e=""){if(t>Nw.level||"undefined"==typeof window)return this;e=e||`Framebuffer ${this.id}`;const n=wS(this,{targetMaxHeight:100});return Nw.image({logLevel:t,message:e,image:n},e)(),this}bind({target:t=36160}={}){return this.gl.bindFramebuffer(t,this.handle),this}unbind({target:t=36160}={}){return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,n,i,r){let s=null;return t&&(s=s||{},s[36064]=new lS(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(s[36064])),e&&n?(s=s||{},s[33306]=new hS(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:i,height:111}),this.ownResources.push(s[33306])):e?(s=s||{},s[36096]=new hS(this.gl,{id:`${this.id}-depth`,format:33189,width:i,height:r}),this.ownResources.push(s[36096])):n&&Rx(!1),s}_unattach(t){const e=this.attachments[t];!e||(e instanceof hS?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer({attachment:t=36064,renderbuffer:e}){const{gl:n}=this;n.framebufferRenderbuffer(36160,t,36161,e.handle),this.attachments[t]=e}_attachTexture({attachment:t=36064,texture:e,layer:n,level:i}){const{gl:r}=this;switch(r.bindTexture(e.target,e.handle),e.target){case 35866:case 32879:Vw(r).framebufferTextureLayer(36160,t,e.target,i,n);break;case 34067:const s=function(t){return t<34069?t+34069:t}(n);r.framebufferTexture2D(36160,t,s,e.handle,i);break;case 3553:r.framebufferTexture2D(36160,t,3553,e.handle,i);break;default:Rx(!1,"Illegal texture type")}r.bindTexture(e.target,null),this.attachments[t]=e}_setReadBuffer(t){const e=function(t){return Fw(t)?t:null}(this.gl);e?e.readBuffer(t):Rx(36064===t||1029===t,xS),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,n=Vw(e);if(n)n.drawBuffers(t);else{const n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Rx(1===t.length&&(36064===t[0]||1029===t[0]),xS)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=function(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in ES)void 0===t.luma.caps[e]&&(t.luma.caps[e]=TS(t,e));return t.luma.caps}(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}SS.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var ES={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(t){const e=new lS(t,{format:6408,type:5126,dataFormat:6408}),n=new SS(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=n.getStatus();return e.delete(),n.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function CS(t,e){return OS(t,e)}function OS(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>TS(t,e))}function TS(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const n=ES[e];let i;Rx(n,e);const r=Fw(t)&&n[1]||n[0];if("function"==typeof r)i=r(t);else if(Array.isArray(r)){i=!0;for(const e of r)i=i&&Boolean(t.getExtension(e))}else"string"==typeof r?i=Boolean(t.getExtension(r)):"boolean"==typeof r?i=r:Rx(!1);return i}(t,e)),t.luma.caps[e]||Nw.log(2,`Feature: ${e} not supported`)(),t.luma.caps[e]}class kS{constructor(t,e){this.opts=e,this.source=t}get value(){return this.source.value}getValue(){const t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];const{value:n}=this.source,{size:i}=e;let r=n;if(n&&n.length!==i){r=new Float32Array(i);const t=e.elementOffset||0;for(let e=0;ei&&(r=i);const s=this._pool,o=t.BYTES_PER_ELEMENT*r,a=s.findIndex(t=>t.byteLength>=o);if(a>=0){const e=new t(s.splice(a,1)[0],0,r);return n&&e.fill(0),e}return new t(r)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:n}=t,{byteLength:i}=n,r=e.findIndex(t=>t.byteLength>=i);r<0?e.push(n):(r>0||e.lengththis.props.poolSize&&e.shift()}};Math;const PS=1/180*Math.PI,IS={};function MS(t,{precision:e=IS.precision||4}={}){return t=function(t){return Math.round(t/IS.EPSILON)*IS.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function DS(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function RS(t,e,n){if(DS(t)){n=n||function(t){return t.clone?t.clone():new Array(t.length)}(t);for(let i=0;it*PS,void 0)}(t)}function LS(t,e,n){return RS(t,t=>Math.max(e,Math.min(n,t)))}function jS(t,e,n){return DS(t)?t.map((t,i)=>jS(t,e[i],n)):n*e+(1-n)*t}function FS(t,e,n){const i=IS.EPSILON;n&&(IS.EPSILON=n);try{if(t===e)return!0;if(DS(t)&&DS(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+MS(this[n],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e=0&&t=0&&t0&&(dE.length=t.length,i=dE):i=hE,(e>0||Number.isFinite(n))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,n),r.index=e-1),{iterable:i,objectInfo:r}}function fE(t){return t&&t[Symbol.asyncIterator]}function gE(t,e=(()=>!0)){return Array.isArray(t)?mE(t,e,[]):e(t)?[t]:[]}function mE(t,e,n){let i=-1;for(;++ia)return void e.set(t.subarray(0,a),n);if(e.set(t,n),!s)return;let l=o;for(;lt},spring:{stiffness:.05,damping:.5}};function xE(t,e){return t?(Number.isFinite(t)&&(t={duration:t}),t.type=t.type||"interpolation",bt(bt(bt({},wE[t.type]),e),t)):null}function SE(t,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function EE(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function CE(t){t.push(t.shift())}function OE(t,e){const{doublePrecision:n,settings:i,value:r,size:s}=t,o=n&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function TE({buffer:t,numInstances:e,attribute:n,fromLength:i,fromStartIndices:r,getData:s=(t=>t)}){const o=n.doublePrecision&&n.value instanceof Float64Array?2:1,a=n.size*o,l=n.byteOffset,c=n.startIndices,u=r&&c,h=OE(n,e),d=n.state.constant;if(!u&&i>=h)return;const p=d?n.value:n.getBuffer().getData({srcByteOffset:l});if(n.settings.normalized&&!d){const t=s;s=(e,i)=>n._normalizeConstant(t(e,i))}const f=d?(t,e)=>s(p,e):(t,e)=>s(p.subarray(t,t+a),e),g=t.getData({length:i}),m=new Float32Array(h);(function({source:t,target:e,size:n,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return _E({source:t,target:e,size:n,getData:i}),e;let o=0,a=0;const l=i&&((t,e)=>i(t+a,e)),c=Math.min(r.length,s.length);for(let u=1;u(t+128)/255*2-1);case 5122:return new Float32Array(t).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(t).map(t=>t/255);case 5123:return new Float32Array(t).map(t=>t/65535);default:return t}}_normalizeValue(t,e,n){const{defaultValue:i,size:r}=this.settings;if(Number.isFinite(t))return e[n]=t,e;if(!t)return e[n]=i[0],e;switch(r){case 4:e[n+3]=Number.isFinite(t[3])?t[3]:i[3];case 3:e[n+2]=Number.isFinite(t[2])?t[2]:i[2];case 2:e[n+1]=Number.isFinite(t[1])?t[1]:i[1];case 1:e[n+0]=Number.isFinite(t[0])?t[0]:i[0];break;default:let s=r;for(;--s>=0;)e[n+s]=Number.isFinite(t[s])?t[s]:i[s]}return e}_areValuesEqual(t,e){if(!t||!e)return!1;const{size:n}=this;for(let i=0;it[e])]:t[e],n)}setNeedsUpdate(t=this.id,e){if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){const{startRow:t=0,endRow:n=1/0}=e;this.state.updateRanges=function(t,e){if(t===vE||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return t;const n=[],i=t.length;let r=0;for(let s=0;se[1]?n.push(i):e=[Math.min(i[0],e[0]),Math.max(i[1],e[1])]}return n.splice(r,0,e),n}(this.state.updateRanges,[t,n])}else this.state.updateRanges=vE}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=yE}setNeedsRedraw(t=this.id){this.state.needsRedraw=this.state.needsRedraw||t}update(t){this.setData(t)}allocate(t){const{state:e,settings:n}=this;return!n.noAlloc&&!!n.update&&(super.allocate({numInstances:t,copy:e.updateRanges!==vE}),!0)}updateBuffer({numInstances:t,data:e,props:n,context:i}){if(!this.needsUpdate())return!1;const{state:{updateRanges:r},settings:{update:s,noAlloc:o}}=this;let a=!0;if(s){for(const[o,a]of r)s.call(i,this,{data:e,startRow:o,endRow:a,props:n,numInstances:t});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const n=i*a+l;for(let i=0;ic?l.set(e,f):(t._normalizeValue(e,m.target,0),bE({target:l,source:m.target,start:f,count:n}));f+=n*c}else t._normalizeValue(e,l,f),f+=c}}_validateAttributeUpdaters(){const{settings:t}=this;if(!t.noAlloc&&"function"!=typeof t.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:t}=this,e=Math.min(4,this.size);if(t&&t.length>=e){let n=!0;switch(e){case 4:n=n&&Number.isFinite(t[3]);case 3:n=n&&Number.isFinite(t[2]);case 2:n=n&&Number.isFinite(t[1]);case 1:n=n&&Number.isFinite(t[0]);break;default:n=!1}if(!n)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let AE={};function PE(t){Iw.level>0&&AE[t]&&AE[t].call(...arguments)}function IE(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const ME="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",DE=`#version 300 es\n${ME}`;function RE(t,e){e=Array.isArray(e)?e:[e];const n=t.replace(/^\s+/,"").split(/\s+/),[i,r,s]=n;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function NE(t={}){const{version:e=100,input:n,inputType:i,output:r}=t;if(!n)return 300===e?DE:e>300?`#version ${e}\n${ME}`:"void main() {gl_FragColor = vec4(0);}";const s=function(t,e){switch(e){case"float":return`vec4(${t}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${t}, 0.0, 1.0)`;case"vec3":return`vec4(${t}, 1.0)`;case"vec4":return t;default:return IE(!1),null}}(n,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${n};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${n};\nvoid main() {\n gl_FragColor = ${s};\n}`}class LE extends Hx{static isSupported(t){return Fw(t)}constructor(t,e={}){Vw(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(t={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Vx(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(t={}){return this.bind(()=>{for(const e in t)this.setBuffer(e,t[e])}),this}setBuffer(t,e){const n=this._getVaryingIndex(t),{buffer:i,byteSize:r,byteOffset:s}=this._getBufferParams(e);return n<0?(this.unused[t]=i,Nw.warn(()=>`${this.id} unused varying buffer ${t}`)(),this):(this.buffers[n]=e,this.bindOnUse||this._bindBuffer(n,i,s,r),this)}begin(t=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,n,i;return t instanceof tS?i=t:(i=t.buffer,n=t.byteSize,e=t.byteOffset),(void 0!==e||void 0!==n)&&(e=e||0,n=n||i.byteLength-e),{buffer:i,byteOffset:e,byteSize:n}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:n,byteOffset:i}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,i,n)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e,n=0,i){const r=e&&e.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,t,r,n,i):this.gl.bindBufferBase(35982,t,r),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}class jE{constructor(t,e={}){this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(t={}){const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(t={}){const e=this.bindings[this.currentIndex],{sourceBuffers:n,transformFeedback:i}=e;return{attributes:Object.assign({},n,t.attributes),transformFeedback:i}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],n=t?e[t]:null;return n?n instanceof tS?n:n.buffer:null}getData(t={}){const{varyingName:e}=t,n=this.getBuffer(e);return n?n.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(t={}){this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Rx(Fw(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,n={};if(this.bindings[this.currentIndex]&&Object.assign(n,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const i in this.feedbackMap){const t=this.feedbackMap[i];i in e&&(n[t]=i)}Object.assign(n,t.feedbackBuffers);for(const i in n){const t=n[i];if("string"==typeof t){const r=e[t],{byteLength:s,usage:o,accessor:a}=r;n[i]=this._createNewBuffer(i,{byteLength:s,usage:o,accessor:a})}}return n}_setupBuffers(t={}){const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const n=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:n})}_setupTransformFeedback(t,{model:e}){const{program:n}=e;t.transformFeedback=new LE(this.gl,{program:n,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),n=Object.assign({},t.feedbackBuffers);for(const i in this.feedbackMap){const r=this.feedbackMap[i];e[i]=t.feedbackBuffers[r],n[r]=t.sourceBuffers[i],Rx(n[r]instanceof tS)}return{sourceBuffers:e,feedbackBuffers:n}}_createNewBuffer(t,e){const n=new tS(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}_getNextIndex(){return(this.currentIndex+1)%2}}function FE(t){let e=100;const n=t.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){const t=parseInt(n[1],10);Number.isFinite(t)&&(e=t)}return e}const BE="vs",VE={[BE]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},zE="__LUMA_INJECT_DECLARATIONS__",UE=/void\s+main\s*\([^)]*\)\s*\{\n?/,HE=/}\n?[^{}]*$/,$E=[];function GE(t,e,n,i=!1){const r=e===BE;for(const s in n){const e=n[s];e.sort((t,e)=>t.order-e.order),$E.length=e.length;for(let t=0,n=e.length;tt+i));break;case"vs:#main-end":r&&(t=t.replace(HE,t=>i+t));break;case"fs:#decl":r||(t=t.replace(zE,i));break;case"fs:#main-start":r||(t=t.replace(UE,t=>t+i));break;case"fs:#main-end":r||(t=t.replace(HE,t=>i+t));break;default:t=t.replace(s,t=>t+i)}}return t=t.replace(zE,""),i&&(t=t.replace(/\}\s*$/,t=>t+VE[e])),t}function WE(t){const e={};return IE(Array.isArray(t)&&t.length>1),t.forEach(t=>{for(const n in t)e[n]=e[n]?`${e[n]}\n${t[n]}`:t[n]}),e}const qE={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},XE="transform_uSize_",YE="transform_position";const KE={10241:9728,10240:9728,10242:33071,10243:33071};class QE{constructor(t,e={}){this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(t={}){const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(t={}){const{sourceBuffers:e,sourceTextures:n,framebuffer:i,targetTexture:r}=this.bindings[this.currentIndex],s=Object.assign({},e,t.attributes),o=Object.assign({},t.uniforms),a=Object.assign({},t.parameters);let l=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){s.transform_elementID=this.elementIDBuffer;for(const e in this.samplerTextureMap)o[e]=n[this.samplerTextureMap[e]];this._setSourceTextureParameters();const t=function({sourceTextureMap:t,targetTextureVarying:e,targetTexture:n}){const i={};let r,s;e&&(({width:r,height:s}=n),i[`${XE}${e}`]=[r,s]);for(const o in t)({width:r,height:s}=t[o]),i[`${XE}${o}`]=[r,s];return i}({sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:r});Object.assign(o,t)}return this.hasTargetTexture&&(l=!1,a.viewport=[0,0,i.width,i.height]),{attributes:s,framebuffer:i,uniforms:o,discard:l,parameters:a}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData({packed:t=!1}={}){const{framebuffer:e}=this.bindings[this.currentIndex],n=_S(e);if(!t)return n;const i=n.constructor,r=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return IE(!1),null}}(this.targetTextureType),s=new i(n.length*r/4);let o=0;for(let a=0;a0,this._updateBindings({sourceBuffers:e,sourceTextures:n,targetTexture:r}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}_updateElementIDBuffer(t){if("number"!=typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach((t,e,n)=>{n[e]=e}),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new tS(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:n,sourceTextures:i,targetTexture:r}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,i),Object.assign(t.sourceBuffers,n),r){t.targetTexture=r;const{width:e,height:n}=r,{framebuffer:i}=t;i?(i.update({attachments:{36064:r},resizeAttachments:!1}),i.resize({width:e,height:n})):t.framebuffer=new SS(this.gl,{id:"transform-framebuffer",width:e,height:n,attachments:{36064:r}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const n in e)e[n].setParameters(KE)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);return e[this._swapTexture]=t.targetTexture,{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=function(t,e){Rx(t instanceof lS||t instanceof bS||t instanceof yS);const n=t.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=t;return new n(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(t);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(t={}){const{sourceTextures:e,targetTexture:n}=this.bindings[this.currentIndex],{vs:i,uniforms:r,targetTextureType:s,inject:o,samplerTextureMap:a}=function({vs:t,sourceTextureMap:e,targetTextureVarying:n,targetTexture:i}){let r=Object.keys(e).length,s=null;const o={};let a=t,l={};if(r>0||n){const t=a.split("\n"),c=t.slice();if(t.forEach((t,i,a)=>{if(r>0){const n=function(t,e){const n={},i=function(t){return RE(t,["attribute","in"])}(t);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const e=`// ${t} => Replaced by Transform with a sampler`,{samplerName:i,sizeName:o,uniformDeclerations:a}=function(t){const e=`transform_uSampler_${t}`,n=`${XE}${t}`;return{samplerName:e,sizeName:n,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${n};`}}(s),l=` ${r} ${s} = transform_getInput(${i}, ${o}).${function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return IE(!1),null}}(r)};\n`;return n[i]=s,{updatedLine:e,inject:{"vs:#decl":a,"vs:#main-start":l},samplerTextureMap:n}}return null}(t,e);if(n){const{updatedLine:t,inject:e}=n;c[i]=t,l=WE([l,e]),Object.assign(o,n.samplerTextureMap),r--}}n&&!s&&(s=function(t,e){const n=RE(t,["varying","out"]);return n&&n.name===e?n.type:null}(t,n))}),n){Rx(i);const t=`${XE}${n}`;l=WE([l,{"vs:#decl":`uniform vec2 ${t};\n`,"vs:#main-start":` vec2 ${YE} = transform_getPos(${t});\n gl_Position = vec4(${YE}, 0, 1.);\n`}])}a=c.join("\n")}return{vs:a,targetTextureType:s,inject:l,samplerTextureMap:o}}({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:n}),l=WE([t.inject||{},o]);return this.targetTextureType=s,this.samplerTextureMap=a,{vs:i,fs:t._fs||NE({version:FE(i),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[qE].concat(t.modules||[]):t.modules,uniforms:r,inject:l}}}const ZE={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function JE(t){let e=tC(t);return"object"===e?t?"type"in t?Object.assign({},t,ZE[t.type]):"value"in t?(e=tC(t.value),Object.assign({type:e},t,ZE[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},ZE[e])}function tC(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class eC{constructor({name:t,vs:e,fs:n,dependencies:i=[],uniforms:r,getUniforms:s,deprecations:o=[],defines:a={},inject:l={},vertexShader:c,fragmentShader:u}){IE("string"==typeof t),this.name=t,this.vs=e||c,this.fs=n||u,this.getModuleUniforms=s,this.dependencies=i,this.deprecations=this._parseDeprecationDefinitions(o),this.defines=a,this.injections=function(t){const e={vs:{},fs:{}};for(const n in t){let i=t[n];const r=n.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][n]=i}return e}(l),r&&(this.uniforms=function(t){const e={};for(const n in t){const i=JE(t[n]);e[n]=i}return e}(r))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:IE(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${e}// END MODULE_${this.name}\n\n`}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach(n=>{n.regex.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())})}_parseDeprecationDefinitions(t){return t.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),t}_defaultGetUniforms(t={}){const e={},n=this.uniforms;for(const i in n){const r=n[i];i in t&&!r.private?(r.validate&&IE(r.validate(t[i],r),`${this.name}: invalid ${i}`),e[i]=t[i]):e[i]=r.value}return e}}function nC(t){return function(t){const e={},n={};return iC({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort((t,e)=>n[e]-n[t]).map(t=>e[t])}(rC(t))}function iC({modules:t,level:e,moduleMap:n,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of t)n[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof eC||(IE("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),IE(t.name,"shader module has no name"),(t=new eC(t)).dependencies=rC(t.dependencies)),t))}const sC={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},oC={};function aC(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/Apple/i)||e.match(/Apple/i)?"APPLE":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(sC).forEach(t=>{oC[t]=t});const lC={};function cC(t,e,n={}){const i=sC[e];if(IE(i,e),!function(t={}){const e="undefined"!=typeof window&&window.navigator||{},n=t.userAgent||e.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(e in lC)return lC[e];const r=`#extension GL_${i[0]} : ${n.behavior||"enable"}\nvoid main(void) {}`,s=t.createShader(35633);t.shaderSource(s,r),t.compileShader(s);const o=t.getShaderParameter(s,35713);return t.deleteShader(s),lC[e]=o,o}function uC(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>function(t,e){const n=sC[e];IE(n,e);const i=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&n[1]||n[0],r="string"==typeof i?Boolean(t.getExtension(i)):i;return IE(!1===r||!0===r),r}(t,e))}function hC(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const dC=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],pC=[...dC,[hC("attribute"),"in $1"],[hC("varying"),"out $1"]],fC=[...dC,[hC("varying"),"in $1"]],gC=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],mC=[...gC,[hC("in"),"attribute $1"],[hC("out"),"varying $1"]],bC=[...gC,[hC("in"),"varying $1"]],yC="gl_FragColor",vC=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,_C=/void\s+main\s*\([^)]*\)\s*\{\n?/;function wC(t,e){for(const[n,i]of e)t=t.replace(n,i);return t}const xC=`\n\n${zE}\n\n`,SC={[BE]:"vertex",fs:"fragment"};function EC(t,{id:e,source:n,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){IE("string"==typeof n,"shader source must be a string");const h=i===BE,d=n.split("\n");let p=100,f="",g=n;0===d[0].indexOf("#version ")?(p=300,f=d[0],g=d.slice(1).join("\n")):f=`#version ${p}`;const m={};r.forEach(t=>{Object.assign(m,t.getDefines())}),Object.assign(m,s);let b=c?`${f}\n${function({id:t,source:e,type:n}){return t&&"string"==typeof t&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${t}_${SC[n]}\n\n`:""}({id:e,source:n,type:i})}\n${function({type:t}){return`\n#define SHADER_TYPE_${SC[t].toUpperCase()}\n`}({type:i})}\n${function(t){switch(function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),n=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:aC(n,i),vendor:n,renderer:i,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(t)}\n${function(t,e,n){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return uC(t,oC.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),uC(t,oC.GLSL_DERIVATIVES)&&cC(t,oC.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),uC(t,oC.GLSL_FRAG_DATA)&&cC(t,oC.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),uC(t,oC.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(t)}\n${function(t={}){let e=0,n="";for(const i in t){0===e&&(n+="\n// APPLICATION DEFINES\n"),e++;const r=t[i];(r||Number.isFinite(r))&&(n+=`#define ${i.toUpperCase()} ${t[i]}\n`)}return 0===e&&(n+="\n"),n}(m)}\n${h?"":"precision highp float;\n\n"}\n`:`${f}\n`;const y=function(t){const e={vs:{},fs:{}};return t.forEach(t=>{let n;"string"!=typeof t?(n=t,t=n.hook):n={},t=t.trim();const[i,r]=t.split(":"),s=t.replace(/\(.+/,"");e[i][s]=Object.assign(n,{signature:r})}),e}(o),v={},_={},w={};for(const x in a){const t="string"==typeof a[x]?{injection:a[x],order:0}:a[x],e=x.match(/^(v|f)s:(#)?([\w-]+)$/);if(e){const n=e[3];e[2]?"decl"===n?_[x]=[t]:w[x]=[t]:v[x]=[t]}else w[x]=[t]}for(const x of r){u&&x.checkDeprecations(g,u),b+=x.getModuleSource(i,p);const t=x.injections[i];for(const e in t){const n=e.match(/^(v|f)s:#([\w-]+)$/);if(n){const i="decl"===n[2]?_:w;i[e]=i[e]||[],i[e].push(t[e])}else v[e]=v[e]||[],v[e].push(t[e])}}return b+=xC,b=GE(b,i,_),b+=function(t,e){let n="";for(const i in t){const r=t[i];if(n+=`void ${r.signature} {\n`,r.header&&(n+=` ${r.header}`),e[i]){const t=e[i];t.sort((t,e)=>t.order-e.order);for(const e of t)n+=` ${e.injection}\n`}r.footer&&(n+=` ${r.footer}`),n+="}\n"}return n}(y[i],v),b+=g,b=GE(b,i,w),b=function(t,e,n){switch(e){case 300:return n?wC(t,pC):function(t){const e=(t=wC(t,fC)).match(vC);if(e){const n=e[1];t=t.replace(new RegExp(`\\b${yC}\\b`,"g"),n)}else{const e="fragmentColor";t=t.replace(_C,t=>`out vec4 ${e};\n${t}`).replace(new RegExp(`\\b${yC}\\b`,"g"),e)}return t}(t);case 100:return n?wC(t,mC):function(t){const e=(t=wC(t,bC)).match(vC);if(e){const n=e[1];t=t.replace(vC,"").replace(new RegExp(`\\b${n}\\b`,"g"),yC)}return t}(t);default:throw new Error(`unknown GLSL version ${e}`)}}(b,l?100:p,h),b}function CC(t){return function(e){const n={};for(const i of t){const t=i.getUniforms(e,n);Object.assign(n,t)}return n}}const OC={5126:VC.bind(null,"uniform1fv",MC,1,zC),35664:VC.bind(null,"uniform2fv",MC,2,zC),35665:VC.bind(null,"uniform3fv",MC,3,zC),35666:VC.bind(null,"uniform4fv",MC,4,zC),5124:VC.bind(null,"uniform1iv",DC,1,zC),35667:VC.bind(null,"uniform2iv",DC,2,zC),35668:VC.bind(null,"uniform3iv",DC,3,zC),35669:VC.bind(null,"uniform4iv",DC,4,zC),35670:VC.bind(null,"uniform1iv",DC,1,zC),35671:VC.bind(null,"uniform2iv",DC,2,zC),35672:VC.bind(null,"uniform3iv",DC,3,zC),35673:VC.bind(null,"uniform4iv",DC,4,zC),35674:VC.bind(null,"uniformMatrix2fv",MC,4,UC),35675:VC.bind(null,"uniformMatrix3fv",MC,9,UC),35676:VC.bind(null,"uniformMatrix4fv",MC,16,UC),35678:BC,35680:BC,5125:VC.bind(null,"uniform1uiv",RC,1,zC),36294:VC.bind(null,"uniform2uiv",RC,2,zC),36295:VC.bind(null,"uniform3uiv",RC,3,zC),36296:VC.bind(null,"uniform4uiv",RC,4,zC),35685:VC.bind(null,"uniformMatrix2x3fv",MC,6,UC),35686:VC.bind(null,"uniformMatrix2x4fv",MC,8,UC),35687:VC.bind(null,"uniformMatrix3x2fv",MC,6,UC),35688:VC.bind(null,"uniformMatrix3x4fv",MC,12,UC),35689:VC.bind(null,"uniformMatrix4x2fv",MC,8,UC),35690:VC.bind(null,"uniformMatrix4x3fv",MC,12,UC),35678:BC,35680:BC,35679:BC,35682:BC,36289:BC,36292:BC,36293:BC,36298:BC,36299:BC,36300:BC,36303:BC,36306:BC,36307:BC,36308:BC,36311:BC},TC={},kC={},AC={},PC=[0];function IC(t,e,n,i){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(PC[0]=t,t=PC);const r=t.length;if(r%e&&Nw.warn(`Uniform size should be multiples of ${e}`,t)(),t instanceof n)return t;let s=i[r];s||(s=new n(r),i[r]=s);for(let o=0;o{const r=t!==i;return r&&(e.uniform1i(n,i),t=i),r}}function VC(t,e,n,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,n),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{Rx(s===u,"Uniform length cannot change.");for(let t=0;t{const s=String(i+e);return GC(s,r-s.length)+n+t})}(e);return{shaderName:l,errors:$C(s,c),warnings:$C(o,c)}}(t,this.source,this.shaderType,this.id);throw Nw.error(`GLSL compilation errors in ${e}\n${n}`)(),Nw.warn(`GLSL compilation warnings in ${e}\n${i}`)(),new Error(`GLSL compilation errors in ${e}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class qC extends WC{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class XC extends WC{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const YC=5126,KC=5124,QC=5125,ZC={[YC]:[YC,1,"float"],35664:[YC,2,"vec2"],35665:[YC,3,"vec3"],35666:[YC,4,"vec4"],[KC]:[KC,1,"int"],35667:[KC,2,"ivec2"],35668:[KC,3,"ivec3"],35669:[KC,4,"ivec4"],[QC]:[QC,1,"uint"],36294:[QC,2,"uvec2"],36295:[QC,3,"uvec3"],36296:[QC,4,"uvec4"],35670:[YC,1,"bool"],35671:[YC,2,"bvec2"],35672:[YC,3,"bvec3"],35673:[YC,4,"bvec4"],35674:[YC,8,"mat2"],35685:[YC,8,"mat2x3"],35686:[YC,8,"mat2x4"],35675:[YC,12,"mat3"],35687:[YC,12,"mat3x2"],35688:[YC,12,"mat3x4"],35676:[YC,16,"mat4"],35689:[YC,16,"mat4x2"],35690:[YC,16,"mat4x3"]};function JC(t){const e=ZC[t];if(!e)return null;const[n,i]=e;return{type:n,components:i}}function tO(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=YC}for(const n in ZC){const[i,r,s]=ZC[n];if(i===t&&r===e)return{glType:n,name:s}}return null}class eO{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,n=e.getProgramParameter(t.handle,35721);for(let i=0;i=0&&this._addAttribute(o,n,r,s)}this.attributeInfos.sort((t,e)=>t.location-e.location)}_readVaryingsFromProgram(t){const{gl:e}=t;if(!Fw(e))return;const n=e.getProgramParameter(t.handle,35971);for(let i=0;it.location-e.location)}_addAttribute(t,e,n,i){const{type:r,components:s}=JC(n),o={type:r,size:i*s};this._inferProperties(t,e,o);const a={location:t,name:e,accessor:new Kx(o)};this.attributeInfos.push(a),this.attributeInfosByLocation[t]=a,this.attributeInfosByName[a.name]=a}_inferProperties(t,e,n){/instance/i.test(e)&&(n.divisor=1)}_addVarying(t,e,n,i){const{type:r,components:s}=JC(n),o={location:t,name:e,accessor:new Kx({type:r,size:i*s})};this.varyingInfos.push(o),this.varyingInfosByName[o.name]=o}}const nO=35981,iO=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class rO extends Hx{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Program","v6.0",iO),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(t={}){const{hash:e,vs:n,fs:i,varyings:r,bufferMode:s=nO}=t;return this.hash=e||"",this.vs="string"==typeof n?new qC(this.gl,{id:`${t.id}-vs`,source:n}):n,this.fs="string"==typeof i?new XC(this.gl,{id:`${t.id}-fs`,source:i}):i,Rx(this.vs instanceof qC),Rx(this.fs instanceof XC),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(Vw(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,s)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new eO(this),this.setProps(t)}delete(t={}){return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw({logPriority:t,drawMode:e=4,vertexCount:n,offset:i=0,start:r,end:s,isIndexed:o=!1,indexType:a=5123,instanceCount:l=0,isInstanced:c=l>0,vertexArray:u=null,transformFeedback:h,framebuffer:d,parameters:p={},uniforms:f,samplers:g}){if((f||g)&&(Nw.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(f||{})),Nw.priority>=t){const i=d?d.id:"default",r=`mode=${Lx(this.gl,e)} verts=${n} instances=${l} indexType=${Lx(this.gl,a)} isInstanced=${c} isIndexed=${o} Framebuffer=${i}`;Nw.log(t,r)()}return Rx(u),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===n||c&&0===l||(u.bindForDraw(n,l,()=>{if(void 0!==d&&(p=Object.assign({},p,{framebuffer:d})),h){const t=function(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Rx(!1),0}}(e);h.begin(t)}this._bindTextures(),vx(this.gl,p,()=>{o&&c?this.gl2.drawElementsInstanced(e,n,a,i,l):o&&Fw(this.gl)&&!isNaN(r)&&!isNaN(s)?this.gl2.drawRangeElements(e,r,s,n,a,i):o?this.gl.drawElements(e,n,a,i):c?this.gl2.drawArraysInstanced(e,i,n,l):this.gl.drawArrays(e,i,n)}),h&&h.end()}),0))}setUniforms(t={}){Nw.priority>=2&&function(t,e,n){for(const i in t){const r=t[i];if((!n||Boolean(n[i]))&&!jC(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const e in t){const n=t[e],i=this._uniformSetters[e];if(i){let t=n,r=!1;if(t instanceof SS&&(t=t.texture),t instanceof oS)if(r=this.uniforms[e]!==n,r){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);const n=t,{textureIndex:r}=i;n.bind(r),t=r,this._textureUniforms[e]=n}else t=i.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(i(t)||r)&&FC(this.uniforms,e,n)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const n=this._textureUniforms[e];n.update(),t=t&&n.loaded}return t}_bindTextures(){for(const t in this._textureUniforms)this._textureUniforms[t].bind(this._uniformSetters[t].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),n={};for(const i of e)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new qC({handle:i});break;case 35632:n.fs=new XC({handle:i})}return n}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=Fx(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?`${t}-program`:"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),Nw.time(4,`linkProgram for ${this._getName()}`)(),t.linkProgram(this.handle),Nw.timeEnd(4,`linkProgram for ${this._getName()}`)(),t.debug||Nw.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${t.getProgramInfoLog(this.handle)}`);if(t.validateProgram(this.handle),!t.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${t.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e1)for(let e=0;ee.name===t.name)||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"==typeof t?t:t.name;this._defaultModules=this._defaultModules.filter(t=>t.name!==e),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(t={}){const{vs:e="",fs:n="",defines:i={},inject:r={},varyings:s=[],bufferMode:o=35981,transpileToGLSL100:a=!1}=t,l=this._getModuleList(t.modules),c=this._getHash(e),u=this._getHash(n),h=l.map(t=>this._getHash(t.name)).sort(),d=s.map(t=>this._getHash(t)),p=Object.keys(i).sort(),f=Object.keys(r).sort(),g=[],m=[];for(const y of p)g.push(this._getHash(y)),g.push(this._getHash(i[y]));for(const y of f)m.push(this._getHash(y)),m.push(this._getHash(r[y]));const b=`${c}/${u}D${g.join("/")}M${h.join("/")}I${m.join("/")}V${d.join("/")}H${this.stateHash}B${o}${a?"T":""}`;if(!this._programCache[b]){const t=function(t,e){const{vs:n,fs:i}=e,r=nC(e.modules||[]);return{gl:t,vs:EC(t,Object.assign({},e,{source:n,type:BE,modules:r})),fs:EC(t,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:CC(r)}}(this.gl,{vs:e,fs:n,modules:l,inject:r,defines:i,hookFunctions:this._hookFunctions,transpileToGLSL100:a});this._programCache[b]=new rO(this.gl,{hash:b,vs:t.vs,fs:t.fs,varyings:s,bufferMode:o}),this._getUniforms[b]=t.getUniforms||(t=>{}),this._useCounts[b]=0}return this._useCounts[b]++,this._programCache[b]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(t=[]){const e=new Array(this._defaultModules.length+t.length),n={};let i=0;for(let r=0,s=this._defaultModules.length;r-1)return"Edge";const n=-1!==e.indexOf("MSIE "),i=-1!==e.indexOf("Trident/");return n||i?"IE":vw.chrome?"Chrome":vw.safari?"Safari":vw.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new aO(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return aO.MAX_ATTRIBUTES=aO.MAX_ATTRIBUTES||t.getParameter(34921),aO.MAX_ATTRIBUTES}static setConstant(t,e,n){switch(n.constructor){case Float32Array:aO._setConstantFloatArray(t,e,n);break;case Int32Array:aO._setConstantIntArray(t,e,n);break;case Uint32Array:aO._setConstantUintArray(t,e,n);break;default:Rx(!1)}}constructor(t,e={}){super(t,Object.assign({},e,{id:e.id||e.program&&e.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return aO.getMaxAttributes(this.gl)}initialize(t={}){return this.setProps(t)}setProps(t){return this}setElementBuffer(t=null,e={}){return Rx(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,t?t.handle:null)}),this}setBuffer(t,e,n){if(34963===e.target)return this.setElementBuffer(e,n);const{size:i,type:r,stride:s,offset:o,normalized:a,integer:l,divisor:c}=n,{gl:u,gl2:h}=this;return t=Number(t),this.bind(()=>{u.bindBuffer(34962,e.handle),l?(Rx(Fw(u)),h.vertexAttribIPointer(t,i,r,s,o)):u.vertexAttribPointer(t,i,r,a,s,o),u.enableVertexAttribArray(t),h.vertexAttribDivisor(t,c||0)}),this}enable(t,e=!0){return!e&&0===t&&!aO.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind(()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t))),this}getConstantBuffer(t,e){const n=this._normalizeConstantArrayValue(e),i=n.byteLength*t,r=n.length*t;let s=!this.buffer;if(this.buffer=this.buffer||new tS(this.gl,i),s=s||this.buffer.reallocate(i),s=s||!this._compareConstantArrayValues(n,this.bufferValue),s){const t=function(t,e){return new t(function(t){return(!oO||oO.byteLength{switch(t){case 34373:return this.gl.getVertexAttribOffset(e,t);default:return this.gl.getVertexAttrib(e,t)}})}}const lO=/^(.+)__LOCATION_([0-9]+)$/,cO=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class uO{constructor(t,e={}){this.id=e.id||e.program&&e.program.id,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new aO(t),zx(this,"VertexArray","v6.0",cO),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(t={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind(()=>{for(const e in t)this._setAttribute(e,t[e]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(t=null,e={}){return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e,n={}){if(34963===e.target)return this.setElementBuffer(e,n);const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,e.accessor,n);return i>=0&&(this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,r)),this}setConstant(t,e,n={}){const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},n));return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new tS(this.gl,{accessor:{size:4}});for(let t=0;t{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t{this._setConstantAttributes(t,e),i=n()}),i}_resolveLocationAndAccessor(t,e,n,i){const r={location:-1,accessor:null},{location:s,name:o}=this._getAttributeIndex(t);if(!Number.isFinite(s)||s<0)return this.unused[t]=e,Nw.once(3,()=>`unused value ${t} in ${this.id}`)(),r;const a=this._getAttributeInfo(o||s);if(!a)return r;const l=Kx.resolve(a.accessor,this.accessors[s]||{},n,i),{size:c,type:u}=l;return Rx(Number.isFinite(c)&&Number.isFinite(u)),{location:s,accessor:l}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const n=lO.exec(t),i=n?n[1]:t,r=n?Number(n[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(i)+r,name:i}:{location:-1}}_setAttribute(t,e){if(e instanceof tS)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof tS)this.setBuffer(t,e[0],e[1]);else if(ArrayBuffer.isView(e)||Array.isArray(e))this.setConstant(t,e);else{if(!(e.buffer instanceof tS))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(t,e.buffer,e)}}_setConstantAttributes(t,e){const n=Math.max(0|t,0|e);let i=this.values[0];ArrayBuffer.isView(i)&&this._setConstantAttributeZero(i,n);for(let r=1;r0;if(t.isInstanced=t.isInstanced||s,n instanceof tS){const e=n;if(s){const n=e.getVertexCount(i);t.instanceCount=Math.min(t.instanceCount,n)}else{const n=e.getVertexCount(i);t.vertexCount=Math.min(t.vertexCount,n)}}}setElements(t=null,e={}){return Nw.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}function hO(t,e={}){const{isInteger:n=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){const{maxElts:n=16,size:i=1}=e;let r="[";for(let s=0;s0&&(r+=","+(s%i==0?" ":"")),r+=hO(t[s],e);return`${r}${t.length>n?"...":"]"}`}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return n?"0":"0.";if(n||Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const i=t.toPrecision(2);return i.indexOf(".0")===i.length-2?i.slice(0,-1):i}function dO(t,e,n,i){const{gl:r}=t;if(!e)return{[i]:"null","Format ":"N/A"};let s,o,a,l="NOT PROVIDED",c=1,u=0,h=0;if(n&&(l=n.type,c=n.size,l=String(l).replace("Array",""),s=-1!==l.indexOf("nt")),e instanceof tS){const t=e,{data:d,changed:p}=t.getDebugData();let f;return o=p?"*":"",a=d,h=t.byteLength,u=h/d.BYTES_PER_ELEMENT/c,n?f=`${n.divisor>0?"I ":"P "} ${u} (x${c}=${h} bytes ${Lx(r,l)})`:(s=!0,f=`${h} bytes`),{[i]:`${o}${hO(a,{size:c,isInteger:s})}`,"Format ":f}}return a=e,c=e.length,l=String(e.constructor.name).replace("Array",""),s=-1!==l.indexOf("nt"),{[i]:`${hO(a,{size:c,isInteger:s})} (constant)`,"Format ":`${c}x${l} (constant)`}}function pO(t,e){const{type:n,size:i}=e,r=tO(n,i);return r?`${t} (${r.name})`:t}function fO({header:t="Uniforms",program:e,uniforms:n,undefinedOnly:i=!1}){Rx(e);const r=".*Matrix",s={},o=Object.keys(e._uniformSetters).sort();let a=0;for(const u of o)!u.match(".*_.*")&&!u.match(r)&&gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)u.match(r)&&gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)s[u]||gO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;let l=0;const c={};if(!i)for(const u in n){const e=n[u];s[u]||(l++,c[u]={Type:`NOT USED: ${e}`,[t]:hO(e)})}return{table:s,count:a,unusedTable:c,unusedCount:l}}function gO({table:t,header:e,uniforms:n,uniformName:i,undefinedOnly:r}){const s=n[i],o=function(t){return null!=t}(s);return!(r&&o||(t[i]={[e]:o?hO(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function mO(t){const{type:e,size:n}=t.accessor,i=tO(e,n);return i?`${i.name} ${t.name}`:t.name}const bO={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function yO(t,e){const{attributeMap:n=bO}=e||{};return n&&n[t]||t}function vO(t,e){let n;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Rx(Number.isFinite(e.size),`attribute ${t} needs size`)}const _O=()=>{},wO={};class xO{constructor(t,e={}){const{id:n=Fx("model")}=e;Rx(jw(t)),this.id=n,this.gl=t,this.id=e.id||Fx("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||sO.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},Rx(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:i,modules:r,defines:s,inject:o,varyings:a,bufferMode:l,transpileToGLSL100:c},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return Rx(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return Rx(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,n){const i={};let r=e.indices;for(const s in e.attributes){const n=e.attributes[s],o=yO(s,undefined);if("indices"===s)r=n;else if(n.constant)i[o]=n.value;else{const e=n.value,r=bt({},n);delete r.value,i[o]=[new tS(t,e),r],vO(s,r)}}if(r){const e=r.value||r;Rx(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const n={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new tS(t,{data:e,target:34963}),n]}return i}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(t={}){if(Vx(t))return this;const e={};for(const n in t){const i=t[n];e[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(e),this}setUniforms(t={}){return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return pS(this.program.gl,t),this}draw(t={}){this._checkProgram();const{moduleSettings:e=null,framebuffer:n,uniforms:i={},attributes:r={},transformFeedback:s=this.transformFeedback,parameters:o={},vertexArray:a=this.vertexArray}=t;let l;this.setAttributes(r),this.updateModuleSettings(e),this.setUniforms(i),Nw.priority>=2&&(l=this._logDrawCallStart(2));const c=this.vertexArray.getDrawParams(),{isIndexed:u=c.isIndexed,indexType:h=c.indexType,indexOffset:d=c.indexOffset,vertexArrayInstanced:p=c.isInstanced}=this.props;p&&!this.isInstanced&&Nw.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:f,instanceCount:g}=this,{onBeforeRender:m=_O,onAfterRender:b=_O}=this.props;m(),this.program.setUniforms(this.uniforms);const y=this.program.draw(Object.assign(wO,t,{logPriority:l,uniforms:null,framebuffer:n,parameters:o,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:a,transformFeedback:s,isIndexed:u,indexType:h,isInstanced:f,instanceCount:g,offset:u?d:0}));return b(),Nw.priority>=2&&this._logDrawCallEnd(l,a,n),y}transform(t={}){const{discard:e=!0,feedbackBuffers:n,unbindModels:i=[]}=t;let{parameters:r}=t;n&&this._setFeedbackBuffers(n),e&&(r=Object.assign({},r,{35977:e})),i.forEach(t=>t.vertexArray.unbindBuffers());try{this.draw(Object.assign({},t,{parameters:r}))}finally{i.forEach(t=>t.vertexArray.bindBuffers())}return this}render(t={}){return Nw.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:n,modules:i,inject:r,defines:s,varyings:o,bufferMode:a,transpileToGLSL100:l}=this.programProps;t=this.programManager.get({vs:e,fs:n,modules:i,inject:r,defines:s,varyings:o,bufferMode:a,transpileToGLSL100:l}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Rx(t instanceof rO,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new uO(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof tS&&e.delete()}}_setAnimationProps(t){this.animated&&Rx(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(t={}){if(Vx(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new LE(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:Nw.level<=2})(),t}_logDrawCallEnd(t,e,n,i){if(void 0===t)return;const r=function({vertexArray:t,header:e="Attributes"}){if(!t.configuration)return{};const n={};t.elements&&(n.ELEMENT_ARRAY_BUFFER=dO(t,t.elements,null,e));const i=t.values;for(const r in i){const s=t._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=t.accessors[s.location];a&&(o=`${r}: ${pO(s.name,a)}`),n[o]=dO(t,i[r],a,e)}}return n}({vertexArray:e,header:`${this.id} attributes`,attributes:this._attributes}),{table:s,unusedTable:o,unusedCount:a}=fO({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),{table:l,count:c}=fO({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0});c>0&&Nw.log("MISSING UNIFORMS",Object.keys(l))(),a>0&&Nw.log("UNUSED UNIFORMS",Object.keys(o))();const u=function(t){const e={},n=`Accessors for ${t.id}`;for(const i of t.attributeInfos)i&&(e[`in ${mO(i)}`]={[n]:JSON.stringify(i.accessor)});for(const i of t.varyingInfos)i&&(e[`out ${mO(i)}`]={[n]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);Nw.table(t,r)(),Nw.table(t,s)(),Nw.table(t+1,u)(),i&&i.log({logLevel:2,message:`Rendered to ${i.id}`}),Nw.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class SO{static isSupported(t){return Fw(t)}constructor(t,e={}){this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:n}=this;t&&t.delete(),e&&e.delete(),n&&n.delete()}run(t={}){const{clearRenderTarget:e=!0}=t,n=this._updateDrawOptions(t);e&&n.framebuffer&&n.framebuffer.clear({color:!0}),this.model.transform(n)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)t=t||n.swap();Rx(t,"Nothing to swap")}getBuffer(t=null){return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(t={}){const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e){const e=n.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(t={}){"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)n.update(t)}_initialize(t={}){const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new xO(e,Object.assign({},t,{fs:t.fs||NE({version:FE(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=i.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){return!(Vx(t.feedbackBuffers)&&Vx(t.feedbackMap)&&!(t.varyings&&t.varyings.length>0))})(e)&&(this.bufferTransform=new jE(t,e)),function(t){return!(Vx(t._sourceTextures)&&!t._targetTexture&&!t._targetTextureVarying)}(e)&&(this.textureTransform=new QE(t,e)),Rx(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=Object.assign(e,i.getDrawOptions(e));return e}}function EO(){}const CO={onStart:EO,onUpdate:EO,onInterrupt:EO,onEnd:EO};class OO{constructor(t){this._inProgress=!1,this._handle=null,this.timeline=t,this.settings={}}get inProgress(){return this._inProgress}start(t){this.cancel(),this.settings=bt(bt({},CO),t),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const TO={interpolation:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="interpolation",this.transition=new OO(n),this.attribute=e,this.attributeInTransition=new kE(t,e.settings),this.currentStartIndices=e.startIndices,this.currentLength=0,this.transform=function(t,e){const n=EE(e.size);return new SO(t,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(t,e);const i={byteLength:0,usage:35050};this.buffers=[new tS(t,i),new tS(t,i)]}get inProgress(){return this.transition.inProgress}start(t,e){if(t.duration<=0)return void this.transition.cancel();const{buffers:n,attribute:i}=this;CE(n);const r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)TE(bt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=OE(i,e),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:n[0],aTo:SE(0,i)},feedbackBuffers:{vCurrent:n[1]}})}update(){const t=this.transition.update();if(t){const{time:t,settings:{duration:e,easing:n}}=this.transition,i=n(t/e);this.transform.run({uniforms:{time:i}})}return t}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="spring",this.transition=new OO(n),this.attribute=e,this.attributeInTransition=new kE(t,ti(bt({},e.settings),{normalized:!1})),this.currentStartIndices=e.startIndices,this.currentLength=0,this.texture=function(t){return new lS(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(t),this.framebuffer=function(t,e){return new SS(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(t,this.texture),this.transform=function(t,e,n){const i=EE(e.size);return new SO(t,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(t,e,this.framebuffer);const i={byteLength:0,usage:35050};this.buffers=[new tS(t,i),new tS(t,i),new tS(t,i)]}get inProgress(){return this.transition.inProgress}start(t,e){const{buffers:n,attribute:i}=this,r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)TE(bt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=OE(i,e),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aTo:SE(0,i)}})}update(){const{buffers:t,transform:e,framebuffer:n,transition:i}=this;return!!i.update()&&(e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:i.settings.stiffness,damping:i.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),CE(t),this.attributeInTransition.update({buffer:t[1],value:this.attribute.value}),_S(n)[0]>0||i.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class kO{constructor(t,{id:e,timeline:n}){this.id=e,this.gl=t,this.timeline=n,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=SO.isSupported(t)}finalize(){for(const t in this.transitions)this._removeTransition(t)}update({attributes:t,transitions:e,numInstances:n}){this.numInstances=n||1;for(const i in t){const n=t[i],r=n.getTransitionSetting(e);!r||this._updateAttribute(i,n,r)}for(const i in this.transitions){const n=t[i];(!n||!n.getTransitionSetting(e))&&this._removeTransition(i)}}hasAttribute(t){const e=this.transitions[t];return e&&e.inProgress}getAttributes(){const t={};for(const e in this.transitions){const n=this.transitions[e];n.inProgress&&(t[e]=n.attributeInTransition)}return t}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const e in this.transitions)this.transitions[e].update()&&(this.needsRedraw=!0);const t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].cancel(),delete this.transitions[t]}_updateAttribute(t,e,n){const i=this.transitions[t];let r=!i||i.type!==n.type;if(r){if(!this.isSupported)return void Iw.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();i&&this._removeTransition(t);const s=TO[n.type];s?this.transitions[t]=new s({attribute:e,timeline:this.timeline,gl:this.gl}):(Iw.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}const AO="attributeManager.invalidate";class PO{constructor(t,{id:e="attribute-manager",stats:n,timeline:i}={}){this.id=e,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=n,this.attributeTransitionManager=new kO(t,{id:"".concat(e,"-transitions"),timeline:i}),Object.seal(this)}finalize(){for(const t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(t={clearRedrawFlags:!1}){const e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}setNeedsRedraw(t=!0){return this.needsRedraw=!0,this}add(t,e){this._add(t,e)}addInstanced(t,e){this._add(t,e,{instanced:1})}remove(t){for(let e=0;e{t[n]||(t[n]=[]),t[n].push(e)});this.updateTriggers=t}_invalidateTrigger(t,e){const{attributes:n,updateTriggers:i}=this,r=i[t];return r&&r.forEach(t=>{const i=n[t];i&&i.setNeedsUpdate(i.id,e)}),r}_updateAttribute(t){const{attribute:e,numInstances:n}=t;PE("attribute.updateStart",e),e.allocate(n)&&PE("attribute.allocate",e,n),e.updateBuffer(t)&&(this.needsRedraw=!0,PE("attribute.updateEnd",e,n))}}function IO(t,e,n,i,r){const s=e-t;return(n-e)*r+-s*i+s+e}function MO(t,e){if(Array.isArray(t)){let n=0;for(let i=0;i0}add(t,e,n,i){const{transitions:r}=this;if(r.has(t)){const n=r.get(t),{value:i=n.settings.fromValue}=n;e=i,this.remove(t)}if(!(i=xE(i)))return;const s=DO[i.type];if(!s)return void Iw.error("unsupported transition type '".concat(i.type,"'"))();const o=new s(this.timeline);o.start(ti(bt({},i),{fromValue:e,toValue:n})),r.set(t,o)}remove(t){const{transitions:e}=this;e.has(t)&&(e.get(t).cancel(),e.delete(t))}update(){const t={};for(const[e,n]of this.transitions)n.update(),t[e]=n.value,n.inProgress||this.remove(e);return t}clear(){for(const t of this.transitions.keys())this.remove(t)}}const NO={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:LO}=NO;function jO(t,e){if(!t.transitions)return null;const n={},i=UO(t);for(const r in t.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&BO(t[r],e[r],s)&&(n[r]=!0)}return n}function FO({newProps:t,oldProps:e,ignoreProps:n={},propTypes:i={},triggerName:r="props"}={}){if(e===t)return null;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(t))if(!(s in n)){if(!(s in e))return"".concat(r,".").concat(s," added");const n=BO(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}for(const s of Object.keys(e))if(!(s in n)){if(!(s in t))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(t,s)){const n=BO(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}}return null}function BO(t,e,n){let i=n&&n.equal;return i&&!i(t,e,n)||!i&&(i=t&&e&&t.equals,i&&!i.call(t,e))?"changed deeply":i||e===t?null:"changed shallowly"}function VO(t,e){if(null===e)return"oldProps is null, initial diff";const n=e.extensions,{extensions:i}=t;if(i===n)return!1;if(i.length!==n.length)return!0;for(let r=0;r{for(const r in i)if(!HO(i[r],n[r])){e=t(i),n=i;break}return e}}function GO(t,e){if(!e)return t;const n=bt(bt({},t),e);if("defines"in e&&(n.defines=bt(bt({},t.defines),e.defines)),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some(t=>"project64"===t.name))){const t=n.modules.findIndex(t=>"project32"===t.name);t>=0&&n.modules.splice(t,1)}if("inject"in e)if(t.inject){const i=bt({},t.inject);for(const t in e.inject)i[t]=(i[t]||"")+e.inject[t];n.inject=i}else n.inject=e.inject;return n}function WO(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],g=e[13],m=e[14],b=e[15],y=n*a-i*o,v=n*l-r*o,_=n*c-s*o,w=i*l-r*a,x=i*c-s*a,S=r*c-s*l,E=u*g-h*f,C=u*m-d*f,O=u*b-p*f,T=h*m-d*g,k=h*b-p*g,A=d*b-p*m,P=y*A-v*k+_*T+w*O-x*C+S*E;return P?(t[0]=(a*A-l*k+c*T)*(P=1/P),t[1]=(r*k-i*A-s*T)*P,t[2]=(g*S-m*x+b*w)*P,t[3]=(d*x-h*S-p*w)*P,t[4]=(l*O-o*A-c*C)*P,t[5]=(n*A-r*O+s*C)*P,t[6]=(m*_-f*S-b*v)*P,t[7]=(u*S-d*_+p*v)*P,t[8]=(o*k-a*O+c*E)*P,t[9]=(i*O-n*k-s*E)*P,t[10]=(f*x-g*_+b*y)*P,t[11]=(h*_-u*x-p*y)*P,t[12]=(a*C-o*T-l*E)*P,t[13]=(n*T-i*C+r*E)*P,t[14]=(g*v-f*w-m*y)*P,t[15]=(u*w-h*v+d*y)*P,t):null}function qO(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],b=e[14],y=e[15],v=n[0],_=n[1],w=n[2],x=n[3];return t[0]=v*i+_*a+w*h+x*g,t[1]=v*r+_*l+w*d+x*m,t[2]=v*s+_*c+w*p+x*b,t[3]=v*o+_*u+w*f+x*y,t[4]=(v=n[4])*i+(_=n[5])*a+(w=n[6])*h+(x=n[7])*g,t[5]=v*r+_*l+w*d+x*m,t[6]=v*s+_*c+w*p+x*b,t[7]=v*o+_*u+w*f+x*y,t[8]=(v=n[8])*i+(_=n[9])*a+(w=n[10])*h+(x=n[11])*g,t[9]=v*r+_*l+w*d+x*m,t[10]=v*s+_*c+w*p+x*b,t[11]=v*o+_*u+w*f+x*y,t[12]=(v=n[12])*i+(_=n[13])*a+(w=n[14])*h+(x=n[15])*g,t[13]=v*r+_*l+w*d+x*m,t[14]=v*s+_*c+w*p+x*b,t[15]=v*o+_*u+w*f+x*y,t}function XO(t,e,n){var i,r,s,o,a,l,c,u,h,d,p,f,g=n[0],m=n[1],b=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*b+e[12],t[13]=e[1]*g+e[5]*m+e[9]*b+e[13],t[14]=e[2]*g+e[6]*m+e[10]*b+e[14],t[15]=e[3]*g+e[7]*m+e[11]*b+e[15]):(r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=i=e[0],t[1]=r,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=i*g+a*m+h*b+e[12],t[13]=r*g+l*m+d*b+e[13],t[14]=s*g+c*m+p*b+e[14],t[15]=o*g+u*m+f*b+e[15]),t}function YO(t,e,n){var i=n[0],r=n[1],s=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function KO(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*i,t[5]=o*r+u*i,t[6]=a*r+h*i,t[7]=l*r+d*i,t[8]=c*r-s*i,t[9]=u*r-o*i,t[10]=h*r-a*i,t[11]=d*r-l*i,t}function QO(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*i,t[1]=o*r+u*i,t[2]=a*r+h*i,t[3]=l*r+d*i,t[4]=c*r-s*i,t[5]=u*r-o*i,t[6]=h*r-a*i,t[7]=d*r-l*i,t}function ZO(t,e,n,i,r){var s,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+i)*(s=1/(i-r)),t[14]=2*r*i*s):(t[10]=-1,t[14]=-2*i),t}function JO(t,e){var n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],b=t[15],y=e[0],v=e[1],_=e[2],w=e[3],x=e[4],S=e[5],E=e[6],C=e[7],O=e[8],T=e[9],k=e[10],A=e[11],P=e[12],I=e[13],M=e[14],D=e[15];return Math.abs(n-y)<=WS*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-v)<=WS*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(r-_)<=WS*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(s-w)<=WS*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(o-x)<=WS*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-S)<=WS*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(l-E)<=WS*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-C)<=WS*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(u-O)<=WS*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(h-T)<=WS*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-k)<=WS*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-A)<=WS*Math.max(1,Math.abs(p),Math.abs(A))&&Math.abs(f-P)<=WS*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(g-I)<=WS*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(m-M)<=WS*Math.max(1,Math.abs(m),Math.abs(M))&&Math.abs(b-D)<=WS*Math.max(1,Math.abs(b),Math.abs(D))}function tT(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function eT(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*s+n[12]*o,t[1]=n[1]*i+n[5]*r+n[9]*s+n[13]*o,t[2]=n[2]*i+n[6]*r+n[10]*s+n[14]*o,t[3]=n[3]*i+n[7]*r+n[11]*s+n[15]*o,t}!function(){var t=new qS(4);qS!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();const nT=[0,0,0,0],iT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],rT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],sT=[0,0,0],oT=[0,0,0],aT=$O(function({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(t,e,n){const{viewMatrixUncentered:i,projectionMatrix:r}=t;let{viewMatrix:s,viewProjectionMatrix:o}=t,a=nT,l=nT,c=t.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:d}=lT(t,e,n);return d&&(l=t.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=eT([],l,o),s=i||s,o=qO([],r,s),o=qO([],o,iT)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(t,n,i),u=t.getDistanceScales(),h=[t.width*e,t.height*e],d=t.projectionMatrix.transform([0,0,-t.focalDistance,1])[3]||1,p={project_uCoordinateSystem:n,project_uProjectionMode:t.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:h,project_uDevicePixelRatio:e,project_uFocalDistance:d,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:sT,project_uScale:t.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const e=t.getDistanceScales(c);switch(n){case Mw.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerMeter2;break;case Mw.LNGLAT:case Mw.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerDegree2;break;case Mw.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,e.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,e.unitsPerMeter2[2]]}}return p});function lT(t,e,n=oT){let i,r=n,s=!0;switch(i=e===Mw.LNGLAT_OFFSETS||e===Mw.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case Dw.WEB_MERCATOR:(e===Mw.LNGLAT||e===Mw.CARTESIAN)&&(s=!1);break;case Dw.WEB_MERCATOR_AUTO_OFFSET:e===Mw.LNGLAT?r=i:e===Mw.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case Dw.IDENTITY:r=t.position.map(Math.fround);break;case Dw.GLOBE:s=!1,i=null;break;default:s=!1}return r[2]=r[2]||0,{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}class cT extends VS{get ELEMENTS(){return BS(!1),0}get RANK(){return BS(!1),0}toString(){let t="[";if(IS.printRowMajor){t+="row-major:";for(let e=0;e2*Math.PI)throw Error("radians");const s=n*Math.tan(t/2),o=s*e;return(new bT).ortho({left:-o,right:o,bottom:-s,top:s,near:i,far:r})}perspective({fovy:t,fov:e=45*Math.PI/180,aspect:n=1,near:i=.1,far:r=500}={}){if((t=t||e)>2*Math.PI)throw Error("radians");return ZO(this,t,n,i,r),this.check()}determinant(){return function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],p=t[12],f=t[13],g=t[14],m=t[15];return(e*o-n*s)*(h*m-d*g)-(e*a-i*s)*(u*m-d*f)+(e*l-r*s)*(u*g-h*f)+(n*a-i*o)*(c*m-d*p)-(n*l-r*o)*(c*g-h*p)+(i*l-r*a)*(c*f-u*p)}(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const n=this.getScale(e||[-0,-0,-0]),i=1/n[0],r=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*r,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*r,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const n=this.getScale(e||[-0,-0,-0]),i=1/n[0],r=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*s,t[3]=this[4]*i,t[4]=this[5]*r,t[5]=this[6]*s,t[6]=this[8]*i,t[7]=this[9]*r,t[8]=this[10]*s,t}transpose(){return function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=r,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]}(this,this),this.check()}invert(){return WO(this,this),this.check()}multiplyLeft(t){return qO(this,t,this),this.check()}multiplyRight(t){return qO(this,this,t),this.check()}rotateX(t){return KO(this,this,t),this.check()}rotateY(t){return function(t,e,n){var i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*i,t[1]=o*r-u*i,t[2]=a*r-h*i,t[3]=l*r-d*i,t[8]=s*i+c*r,t[9]=o*i+u*r,t[10]=a*i+h*r,t[11]=l*i+d*r}(this,this,t),this.check()}rotateZ(t){return QO(this,this,t),this.check()}rotateXYZ([t,e,n]){return this.rotateX(t).rotateY(e).rotateZ(n)}rotateAxis(t,e){return function(t,e,n,i){var r,s,o,a,l,c,u,h,d,p,f,g,m,b,y,v,_,w,x,S,E,C,O,T,k=i[0],A=i[1],P=i[2],I=Math.hypot(k,A,P);I=-90&&e<=90,"invalid latitude"),[512*(t*ET+xT)/(2*xT),512*(xT+Math.log(Math.tan(ST+e*ET*.5)))/(2*xT)]}function kT([t,e]){const n=t/512*(2*xT)-xT,i=2*(Math.atan(Math.exp(e/512*(2*xT)-xT))-ST);return[n*CT,i*CT]}function AT({latitude:t,longitude:e,highPrecision:n=!1}){wT(Number.isFinite(t)&&Number.isFinite(e));const i={},r=Math.cos(t*ET),s=512/360,o=s/r,a=512/OT/r;if(i.unitsPerMeter=[a,a,a],i.metersPerUnit=[1/a,1/a,1/a],i.unitsPerDegree=[s,o,a],i.degreesPerUnit=[1/s,1/o,1/a],n){const e=ET*Math.tan(t*ET)/r,n=512/OT*e,l=n/o*a;i.unitsPerDegree2=[0,s*e/2,n],i.unitsPerMeter2=[l,0,l]}return i}function PT(t,e){const[n,i,r]=t,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=AT({longitude:n,latitude:i,highPrecision:!0}),u=TT(t);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=kT(u),d=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],d]:h}function IT({height:t,pitch:e,bearing:n,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return XO(o,o,[0,0,-i]),KO(o,o,-e*ET),QO(o,o,n*ET),YO(o,o,[r/=t,r,r]),s&&XO(o,o,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],s)),o}function MT({width:t,height:e,fovy:n=DT(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(n=DT(i));const a=.5*n*ET,l=RT(n),c=r*ET,u=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:t/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}function DT(t){return 2*Math.atan(.5/t)*CT}function RT(t){return.5/Math.tan(.5*t*ET)}function NT(t,e){const[n,i,r=0]=t;return wT(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),yT(e,[n,i,r,1])}function LT(t,e,n=0){const[i,r,s]=t;if(wT(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return yT(e,[i,r,s,1]);const o=yT(e,[i,r,0,1]),a=yT(e,[i,r,1,1]),l=o[2],c=a[2];return dT([],o,a,l===c?0:((n||0)-l)/(c-l))}function jT({width:t,height:e,bounds:n,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=n;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:wT(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=new zT({width:t,height:e,longitude:0,latitude:0,zoom:0}),d=h.project([a,u]),p=h.project([c,l]),f=[Math.max(Math.abs(p[0]-d[0]),i),Math.max(Math.abs(p[1]-d[1]),i)],g=[t-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];wT(g[0]>0&&g[1]>0);const m=g[0]/f[0],b=g[1]/f[1],y=h.unproject([(p[0]+d[0])/2+(s.right-s.left)/2/m,(p[1]+d[1])/2+(s.bottom-s.top)/2/b]),v=Math.min(r,h.zoom+_T(Math.abs(Math.min(m,b))));return wT(Number.isFinite(v)),{longitude:y[0],latitude:y[1],zoom:v}}const FT=Math.PI/180;function BT(t,e=0){const{width:n,height:i,unproject:r}=t,s={targetZ:e},o=r([0,i],s),a=r([n,i],s);let l,c;return(t.fovy?.5*t.fovy*FT:Math.atan(.5/t.altitude))>(90-t.pitch)*FT-.01?(l=VT(t,0,e),c=VT(t,n,e)):(l=r([0,0],s),c=r([n,0],s)),[o,a,c,l]}function VT(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=yT(i,[e,0,1,1]),s=yT(i,[e,t.height,1,1]),o=kT(dT([],r,s,(n*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return o[2]=n,o}class zT{constructor({width:t,height:e,latitude:n=0,longitude:i=0,zoom:r=0,pitch:s=0,bearing:o=0,altitude:a=null,fovy:l=null,position:c=null,nearZMultiplier:u=.02,farZMultiplier:h=1.01}={width:1,height:1}){t=t||1,e=e||1,null===l&&null===a?l=DT(a=1.5):null===l?l=DT(a):null===a&&(a=RT(l));const d=function(t){return Math.pow(2,t)}(r);a=Math.max(.75,a);const p=AT({longitude:i,latitude:n}),f=TT([i,n]);f[2]=0,c&&function(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}(f,f,function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}([],c,p.unitsPerMeter)),this.projectionMatrix=function({width:t,height:e,pitch:n,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:u}=MT({width:t,height:e,altitude:i,fovy:r,pitch:n,nearZMultiplier:s,farZMultiplier:o});return ZO([],a,l,c,u)}({width:t,height:e,pitch:s,fovy:l,nearZMultiplier:u,farZMultiplier:h}),this.viewMatrix=IT({height:e,scale:d,center:f,pitch:s,bearing:o,altitude:a}),this.width=t,this.height=e,this.scale=d,this.latitude=n,this.longitude=i,this.zoom=r,this.pitch=s,this.bearing=o,this.altitude=a,this.fovy=l,this.center=f,this.meterOffset=c||[0,0,0],this.distanceScales=p,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:t,height:e,projectionMatrix:n,viewMatrix:i}=this,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];qO(r,r,n),qO(r,r,i),this.viewProjectionMatrix=r;const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];YO(s,s,[t/2,-e/2,1]),XO(s,s,[1,-1,0]),qO(s,s,r);const o=WO([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],s);if(!o)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=s,this.pixelUnprojectionMatrix=o}equals(t){return t instanceof zT&&t.width===this.width&&t.height===this.height&&JO(t.projectionMatrix,this.projectionMatrix)&&JO(t.viewMatrix,this.viewMatrix)}project(t,{topLeft:e=!0}={}){const n=NT(this.projectPosition(t),this.pixelProjectionMatrix),[i,r]=n,s=e?r:this.height-r;return 2===t.length?[i,s]:[i,s,n[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,r,s]=t,o=LT([i,e?r:this.height-r,s],this.pixelUnprojectionMatrix,n&&n*this.distanceScales.unitsPerMeter[2]),[a,l,c]=this.unprojectPosition(o);return Number.isFinite(s)?[a,l,c]:Number.isFinite(n)?[a,l,n]:[a,l]}projectPosition(t){const[e,n]=TT(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=kT(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return TT(t)}unprojectFlat(t){return kT(t)}getMapCenterByLngLatPosition({lngLat:t,pos:e}){const n=LT(e,this.pixelUnprojectionMatrix),i=uT([],TT(t),hT([],n));return kT(uT([],this.center,i))}getLocationAtPoint({lngLat:t,pos:e}){return this.getMapCenterByLngLatPosition({lngLat:t,pos:e})}fitBounds(t,e={}){const{width:n,height:i}=this,{longitude:r,latitude:s,zoom:o}=jT(Object.assign({width:n,height:i,bounds:t},e));return new zT({width:n,height:i,longitude:r,latitude:s,zoom:o})}getBounds(t){const e=this.getBoundingRegion(t),n=Math.min(...e.map(t=>t[0])),i=Math.max(...e.map(t=>t[0]));return[[n,Math.min(...e.map(t=>t[1]))],[i,Math.max(...e.map(t=>t[1]))]]}getBoundingRegion(t={}){return BT(this,t.z||0)}}const UT=Math.PI/180,HT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],$T=[0,0,0],GT={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let WT=(()=>{class t{constructor(t={}){const{id:e=null,x:n=0,y:i=0,width:r=1,height:s=1}=t;this.id=e||this.constructor.displayName||"viewport",this.x=n,this.y=i,this.width=r||1,this.height=s||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?Dw.WEB_MERCATOR:Dw.WEB_MERCATOR_AUTO_OFFSET:Dw.IDENTITY}equals(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&FS(e.projectionMatrix,this.projectionMatrix)&&FS(e.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const n=NT(this.projectPosition(t),this.pixelProjectionMatrix),[i,r]=n,s=e?r:this.height-r;return 2===t.length?[i,s]:[i,s,n[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,r,s]=t,o=LT([i,e?r:this.height-r,s],this.pixelUnprojectionMatrix,n&&n*this.distanceScales.unitsPerMeter[2]),[a,l,c]=this.unprojectPosition(o);return Number.isFinite(s)?[a,l,c]:Number.isFinite(n)?[a,l,n]:[a,l]}projectPosition(t){const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?TT(t):t}unprojectFlat(t){return this.isGeospatial?kT(t):t}getBounds(t={}){const e={targetZ:t.z||0},n=this.unproject([0,0],e),i=this.unproject([this.width,0],e),r=this.unproject([0,this.height],e),s=this.unproject([this.width,this.height],e);return[Math.min(n[0],i[0],r[0],s[0]),Math.min(n[1],i[1],r[1],s[1]),Math.max(n[0],i[0],r[0],s[0]),Math.max(n[1],i[1],r[1],s[1])]}getDistanceScales(t=null){return t?AT({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:e,width:n=1,height:i=1}){return t{class t extends WT{constructor(t={}){const{latitude:e=0,longitude:n=0,zoom:i=11,pitch:r=0,bearing:s=0,nearZMultiplier:o=.1,farZMultiplier:a=1.01,orthographic:l=!1,repeat:c=!1,worldOffset:u=0}=t;let{width:h,height:d,altitude:p=1.5}=t;const f=Math.pow(2,i);h=h||1,d=d||1,p=Math.max(.75,p);const{fov:g,aspect:m,focalDistance:b,near:y,far:v}=MT({width:h,height:d,pitch:r,altitude:p,nearZMultiplier:o,farZMultiplier:a});let _=IT({height:d,pitch:r,bearing:s,scale:f,altitude:p});u&&(_=(new bT).translate([512*u,0,0]).multiplyLeft(_)),super(ti(bt({},t),{width:h,height:d,viewMatrix:_,longitude:n,latitude:e,zoom:i,orthographic:l,fovyRadians:g,aspect:m,focalDistance:b,near:y,far:v})),this.latitude=e,this.longitude=n,this.zoom=i,this.pitch=r,this.bearing=s,this.altitude=p,this.orthographic=l,this._subViewports=c?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const e=this.getBounds(),n=Math.floor((e[0]+180)/360),i=Math.ceil((e[2]-180)/360);for(let r=n;r<=i;r++){const e=r?new t(ti(bt({},this),{worldOffset:r})):this;this._subViewports.push(e)}}return this._subViewports}addMetersToLngLat(t,e){return PT(t,e)}panByPosition(t,e){const n=LT(e,this.pixelUnprojectionMatrix),i=uT([],this.projectFlat(t),hT([],n)),r=uT([],this.center,i),[s,o]=this.unprojectFlat(r);return{longitude:s,latitude:o}}getBounds(t={}){const e=BT(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(e,n={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=jT(bt({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:s,latitude:o,zoom:a})}}return t.displayName="WebMercatorViewport",t})();function XT(t,e,n=!1){const i=e.projectPosition(t);if(n&&e instanceof qT){const[n,r,s=0]=t,o=e.getDistanceScales([n,r]);i[2]=s*o.unitsPerMeter[2]}return i}function KT(t,{viewport:e,modelMatrix:n,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=t;switch(n&&([o,a,l]=eT([],[o,a,l,1],n)),i){case Mw.LNGLAT:return XT([o,a,l],e,s);case Mw.LNGLAT_OFFSETS:return XT([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Mw.METER_OFFSETS:return XT(PT(r,[o,a,l]),e,s);case Mw.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const QT={10241:9987,10240:9729,10242:33071,10243:33071},ZT={},JT={boolean:{validate:(t,e)=>!0,equal:(t,e,n)=>Boolean(t)===Boolean(e)},number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},color:{validate:(t,e)=>e.optional&&!t||ik(t)&&(3===t.length||4===t.length),equal:(t,e,n)=>tk(t,e)},accessor:{validate(t,e){const n=rk(t);return"function"===n||n===rk(e.value)},equal:(t,e,n)=>"function"==typeof e||tk(t,e)},array:{validate:(t,e)=>e.optional&&!t||ik(t),equal:(t,e,n)=>n.compare?tk(t,e):t===e},function:{validate:(t,e)=>e.optional&&!t||"function"==typeof t,equal:(t,e,n)=>!n.compare||t===e},data:{transform:(t,e,n)=>{const{dataTransform:i}=n?n.props:{};return i&&t?i(t):t}},image:{transform:(t,e,n)=>function(t,e){const n=t.context&&t.context.gl;if(!n||!e)return null;if(e instanceof lS)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new lS(n,ti(bt({},e),{parameters:bt(bt(bt({},QT),i),t.props.textureParameters)}));return ZT[r.id]=!0,r}(n,t),release:t=>{!function(t){!t||!(t instanceof lS)||ZT[t.id]&&(t.delete(),delete ZT[t.id])}(t)}}};function tk(t,e){if(t===e)return!0;if(!ik(t)||!ik(e))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i{},this.oldProps=yk,this.oldAsyncProps=null}finalize(){for(const t in this.asyncProps){const e=this.asyncProps[t];e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){const e=this.asyncProps[t];return e&&e.resolvedValue}isAsyncPropLoading(t){if(t){const e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(const e in this.asyncProps)if(this.isAsyncPropLoading(e))return!0;return!1}reloadAsyncProp(t,e){this._watchPromise(t,Promise.resolve(e))}setAsyncProps(t){const e=t[mk]||{},n=t[gk]||t,i=t[bk]||{};for(const r in e){const t=e[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t),e[r]=this.getAsyncProp(r)}for(const r in n){const t=n[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t)}}_updateAsyncProp(t,e){if(this._didAsyncInputValueChange(t,e)){if("string"==typeof e){var n;const i=null===(n=this.layer)||void 0===n?void 0:n.props.fetch;i&&(e=i(e,{propName:t,layer:this.layer}))}if(e instanceof Promise)return void this._watchPromise(t,e);if(fE(e))return void this._resolveAsyncIterable(t,e);this._setPropValue(t,e)}}_didAsyncInputValueChange(t,e){const n=this.asyncProps[t];return e!==n.resolvedValue&&e!==n.lastValue&&(n.lastValue=e,!0)}_setPropValue(t,e){const n=this.asyncProps[t];e=this._postProcessValue(n,e),n.resolvedValue=e,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}_setAsyncPropValue(t,e,n){const i=this.asyncProps[t];i&&n>=i.resolvedLoadCount&&void 0!==e&&(this.freezeAsyncOldProps(),i.resolvedValue=e,i.resolvedLoadCount=n,this.onAsyncPropUpdated(t,e))}_watchPromise(t,e){const n=this.asyncProps[t];n.pendingLoadCount++;const i=n.pendingLoadCount;e.then(e=>{var r;e=this._postProcessValue(n,e),this._setAsyncPropValue(t,e,i);const s=null===(r=this.layer)||void 0===r?void 0:r.props.onDataLoad;"data"===t&&s&&s(e,{propName:t,layer:this.layer})}).catch(e=>{var n;null===(n=this.layer)||void 0===n||n.raiseError(e,"loading ".concat(t," of ").concat(this.layer))})}_resolveAsyncIterable(t,e){var n=this;return gS(function*(){var i;"data"!==t&&n._setPropValue(t,e);const r=n.asyncProps[t];r.pendingLoadCount++;const s=r.pendingLoadCount;let o=[],a=0;var l,c=!0,u=!1;try{for(var h,d,p=fk(e);c=(h=yield p.next()).done,d=yield h.value,!c;c=!0){const e=d,{dataTransform:i}=n.component?n.component.props:{};o=i?i(e,o):o.concat(e),Object.defineProperty(o,"__diff",{enumerable:!1,value:[{startRow:a,endRow:o.length}]}),a=o.length,n._setAsyncPropValue(t,o,s)}}catch(g){u=!0,l=g}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(u)throw l}}const f=null===(i=n.layer)||void 0===i?void 0:i.props.onDataLoad;f&&f(o,{propName:t,layer:n.layer})})()}_postProcessValue(t,e){const n=t.type;return n&&(n.release&&n.release(t.resolvedValue,n,this.component),n.transform)?n.transform(e,n,this.component):e}_createAsyncPropData(t,e){if(!this.asyncProps[t]){const n=this.component&&this.component.constructor._propTypes;this.asyncProps[t]={type:n&&n[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:_k,ASYNC_RESOLVED:wk,ASYNC_DEFAULTS:xk}=NO,Sk={};let Ek=0,Ck=(()=>{class t{constructor(){this.props=ck.apply(this,arguments),this.id=this.props.id,this.count=Ek++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:e}=this,n={};for(const i in e[xk])i in e[wk]?n[i]=e[wk][i]:i in e[_k]&&(n[i]=e[_k][i]);return new this.constructor(bt(bt(bt({},e),n),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new vk({})}}return t.componentName="Component",t.defaultProps=Sk,t})();class Ok extends vk{constructor({attributeManager:t,layer:e}){super(e),this.attributeManager=t,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(t){this.component=t}}const Tk=t=>"function"==typeof t,kk=t=>null!==t&&"object"==typeof t,Ak=t=>kk(t)&&t.constructor==={}.constructor,Pk=t=>t&&"function"==typeof t[Symbol.iterator],Ik=t=>t&&"function"==typeof t[Symbol.asyncIterator],Mk=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Dk=t=>"undefined"!=typeof Blob&&t instanceof Blob,Rk=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||kk(t)&&Tk(t.tee)&&Tk(t.cancel)&&Tk(t.getReader))(t)||(t=>kk(t)&&Tk(t.read)&&Tk(t.pipe)&&(t=>"boolean"==typeof t)(t.readable))(t);function Nk(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function Lk(t){var e;return!!t&&(Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions))}function jk(t){var e,n;let i;return Nk(t,"null loader"),Nk(Lk(t),"invalid loader"),Array.isArray(t)&&(i=t[1],t=ti(bt({},t=t[0]),{options:bt(bt({},t.options),i)})),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(n=t)&&void 0!==n&&n.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const Fk={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Bk=Fk.global||Fk.self||Fk.window||{},Vk="object"!=typeof process||"[object process]"!==String(process)||process.browser,zk="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);zk&&parseFloat(zk[1]);const Uk={};function Hk(t){for(const e in Uk)t.startsWith(e)&&(t=t.replace(e,Uk[e]));return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${t}`),t}const $k=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Gk=/^([-\w.]+\/[-\w.+]+)/;function Wk(t){const e=Gk.exec(t);return e?e[1]:t}function qk(t){const e=$k.exec(t);return e?e[1]:""}const Xk=/\?.*/;function Yk(t){if(Mk(t)){const e=Qk(t.url||"");return{url:e,type:Wk(t.headers.get("content-type")||"")||qk(e)}}return Dk(t)?{url:Qk(t.name||""),type:t.type||""}:"string"==typeof t?{url:Qk(t),type:qk(t)}:{url:"",type:""}}function Kk(t){return Mk(t)?t.headers["content-length"]||-1:Dk(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function Qk(t){return t.replace(Xk,"")}function Zk(t){return Jk.apply(this,arguments)}function Jk(){return(Jk=gS(function*(t){if(Mk(t))return t;const e={},n=Kk(t);n>=0&&(e["content-length"]=String(n));const{url:i,type:r}=Yk(t);r&&(e["content-type"]=r);const s=yield rA(t);s&&(e["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t));const o=new Response(t,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function tA(t){return eA.apply(this,arguments)}function eA(){return(eA=gS(function*(t){if(!t.ok){const e=yield nA(t);throw new Error(e)}})).apply(this,arguments)}function nA(t){return iA.apply(this,arguments)}function iA(){return(iA=gS(function*(t){let e=`Failed to fetch resource ${t.url} (${t.status}): `;try{const n=t.headers.get("Content-Type");let i=t.statusText;n.includes("application/json")&&(i+=` ${yield t.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(n){}return e})).apply(this,arguments)}function rA(t){return sA.apply(this,arguments)}function sA(){return(sA=gS(function*(t){if("string"==typeof t)return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const e=t.slice(0,5);return yield new Promise(t=>{const n=new FileReader;n.onload=e=>{var n;return t(null==e||null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsDataURL(e)})}return t instanceof ArrayBuffer?`data:base64,${oA(t.slice(0,5))}`:null})).apply(this,arguments)}function oA(t){let e="";const n=new Uint8Array(t);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const dA={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){cA(this,"console",void 0),this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},pA={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function fA(){Bk.loaders=Bk.loaders||{};const{loaders:t}=Bk;return t._state=t._state||{},t._state}const gA=()=>{const t=fA();return t.globalOptions=t.globalOptions||bt({},dA),t.globalOptions};function mA(t,e,n,i){return n=n||[],function(t,e){yA(t,null,dA,pA,e);for(const n of e)yA(t&&t[n.id]||{},n.id,n.options&&n.options[n.id]||{},n.deprecatedOptions&&n.deprecatedOptions[n.id]||{},e)}(t,n=Array.isArray(n)?n:[n]),function(t,e,n){const i=bt({},t.options||{});return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,n),null===i.log&&(i.log=new hA),_A(i,gA()),_A(i,e),i}(e,t,i)}function bA(t,e){const n=gA(),i=t||n;return"function"==typeof i.fetch?i.fetch:kk(i.fetch)?t=>aA(t,i):null!=e&&e.fetch?null==e?void 0:e.fetch:aA}function yA(t,e,n,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in t){const l=!e&&kk(t[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in n)&&!c&&!u)if(a in i)uA.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const t=vA(a,r);uA.warn(`${s} loader option '${o}${a}' not recognized. ${t}`)()}}}function vA(t,e){const n=t.toLowerCase();let i="";for(const r of e)for(const e in r.options){if(t===e)return`Did you mean '${r.id}.${e}'?`;const s=e.toLowerCase();(n.startsWith(s)||s.startsWith(n))&&(i=i||`Did you mean '${r.id}.${e}'?`)}return i}function _A(t,e){for(const n in e)n in e&&(t[n]=Ak(e[n])&&Ak(t[n])?bt(bt({},t[n]),e[n]):e[n])}function wA(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}function xA(t,e="3.0.12"){return wA(t,"no worker provided"),!(!e||!t.version)}const SA={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},EA=SA.global||SA.self||SA.window||{},CA="object"!=typeof process||"[object process]"!==String(process)||process.browser,OA="function"==typeof importScripts,TA="undefined"!=typeof window&&void 0!==window.orientation,kA="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),AA=(kA&&parseFloat(kA[1]),new Map);function PA(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function IA(t,e=!0,n){const i=n||new Set;if(t)if(MA(t))i.add(t);else if(MA(t.buffer))i.add(t.buffer);else if(!ArrayBuffer.isView(t)&&e&&"object"==typeof t)for(const r in t)IA(t[r],e,i);return void 0===n?Array.from(i):[]}function MA(t){return!!t&&(t instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&t instanceof MessagePort||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)}const DA=()=>{};class RA{static isSupported(){return"undefined"!=typeof Worker}constructor(t){cA(this,"name",void 0),cA(this,"source",void 0),cA(this,"url",void 0),cA(this,"terminated",!1),cA(this,"worker",void 0),cA(this,"onMessage",void 0),cA(this,"onError",void 0),cA(this,"_loadableURL","");const{name:e,source:n,url:i}=t;wA(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=DA,this.onError=t=>console.log(t),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=DA,this.onError=DA,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||IA(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+=`worker ${this.name}. `,t.message&&(e+=`${t.message} in `),t.lineno&&(e+=`:${t.lineno}:${t.colno}`),new Error(e)}_createBrowserWorker(){this._loadableURL=function(t){wA(t.source&&!t.url||!t.source&&t.url);let e=AA.get(t.source||t.url);return e||(t.url&&(e=function(t){return t.startsWith("http")?PA(function(t){return`try {\n importScripts('${t}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(t)):t}(t.url),AA.set(t.url,e)),t.source&&(e=PA(t.source),AA.set(t.source,e))),wA(e),e}({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}}class NA{constructor(t,e){cA(this,"name",void 0),cA(this,"workerThread",void 0),cA(this,"isRunning",void 0),cA(this,"result",void 0),cA(this,"_resolve",void 0),cA(this,"_reject",void 0),this.name=t,this.workerThread=e,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e})}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){wA(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){wA(this.isRunning),this.isRunning=!1,this._reject(t)}}class LA{constructor(t){cA(this,"name","unnamed"),cA(this,"source",void 0),cA(this,"url",void 0),cA(this,"maxConcurrency",1),cA(this,"maxMobileConcurrency",1),cA(this,"onDebug",()=>{}),cA(this,"reuseWorkers",!0),cA(this,"props",{}),cA(this,"jobQueue",[]),cA(this,"idleQueue",[]),cA(this,"count",0),cA(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props=bt(bt({},this.props),t),void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}startJob(t,e=((t,e,n)=>t.done(n)),n=((t,e)=>t.error(e))){var i=this;return gS(function*(){const r=new Promise(r=>(i.jobQueue.push({name:t,onMessage:e,onError:n,onStart:r}),i));return i._startQueuedJob(),yield r})()}_startQueuedJob(){var t=this;return gS(function*(){if(!t.jobQueue.length)return;const e=t._getAvailableWorker();if(!e)return;const n=t.jobQueue.shift();if(n){t.onDebug({message:"Starting job",name:n.name,workerThread:e,backlog:t.jobQueue.length});const i=new NA(n.name,e);e.onMessage=t=>n.onMessage(i,t.type,t.payload),e.onError=t=>n.onError(i,t),n.onStart(i);try{yield i.result}finally{t.returnWorkerToQueue(e)}}})()}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class FA{static isSupported(){return RA.isSupported()}static getWorkerFarm(t={}){return FA._workerFarm=FA._workerFarm||new FA({}),FA._workerFarm.setProps(t),FA._workerFarm}constructor(t){cA(this,"props",void 0),cA(this,"workerPools",new Map),this.props=bt({},jA),this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy()}setProps(t){this.props=bt(bt({},this.props),t);for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:n,url:i}=t;let r=this.workerPools.get(e);return r||(r=new LA({name:e,source:n,url:i}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function BA(t,e={}){const n=`${t.id}-worker.js`;let i=(e[t.id]||{}).workerUrl;if("test"===e._workerType&&(i=`modules/${t.module}/dist/${n}`),!i){let e=t.version;"latest"===e&&(e="latest"),i=`https://unpkg.com/@loaders.gl/${t.module}${e?`@${e}`:""}/dist/${n}`}return wA(i),i}function VA(t,e){return!!FA.isSupported()&&t.worker&&(null==e?void 0:e.worker)}function zA(t,e,n,i,r){return UA.apply(this,arguments)}function UA(){return(UA=gS(function*(t,e,n,i,r){const s=t.id,o=BA(t,n),a=FA.getWorkerFarm(n).getWorkerPool({name:s,url:o});n=JSON.parse(JSON.stringify(n));const l=yield a.startJob("process-on-worker",HA.bind(null,r));return l.postMessage("process",{input:e,options:n}),yield(yield l.result).result})).apply(this,arguments)}function HA(t,e,n,i){return $A.apply(this,arguments)}function $A(){return($A=gS(function*(t,e,n,i){switch(n){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:s,input:o,options:a}=i;try{const n=yield t(o,a);e.postMessage("done",{id:s,result:n})}catch(r){const t=r instanceof Error?r.message:"unknown error";e.postMessage("error",{id:s,error:t})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}})).apply(this,arguments)}cA(FA,"_workerFarm",void 0);var GA=n(9521);function WA(t){if(function(t){return t&&"object"==typeof t&&t.isBuffer}(t)&&(t=function(t){return GA.toArrayBuffer?GA.toArrayBuffer(t):t}(t)),t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"==typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"==typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function qA(...t){const e=t.map(t=>t instanceof ArrayBuffer?new Uint8Array(t):t),n=e.reduce((t,e)=>t+e.byteLength,0),i=new Uint8Array(n);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function XA(t,e,n){const i=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(i).buffer}function YA(t){return KA.apply(this,arguments)}function KA(){return(KA=gS(function*(t){const e=[];var n,i=!0,r=!1;try{for(var s,o,a=fk(t);i=(s=yield a.next()).done,o=yield s.value,!i;i=!0)e.push(o)}catch(l){r=!0,n=l}finally{try{!i&&null!=a.return&&(yield a.return())}finally{if(r)throw n}}return qA(...e)})).apply(this,arguments)}const QA=262144;function ZA(t){this.wrapped=t}function JA(t){return new ZA(t)}function tP(t){var e,n;function i(e,n){try{var s=t[e](n),o=s.value,a=o instanceof ZA;Promise.resolve(a?o.wrapped:o).then(function(t){a?i("return"===e?"return":"next",t):r(s.done?"return":"normal",t)},function(t){i("throw",t)})}catch(l){r("throw",l)}}function r(t,r){switch(t){case"return":e.resolve({value:r,done:!0});break;case"throw":e.reject(r);break;default:e.resolve({value:r,done:!1})}(e=e.next)?i(e.key,e.arg):n=null}this._invoke=function(t,r){return new Promise(function(s,o){var a={key:t,arg:r,resolve:s,reject:o,next:null};n?n=n.next=a:(e=n=a,i(t,r))})},"function"!=typeof t.return&&(this.return=void 0)}function eP(t){return function(){return new tP(t.apply(this,arguments))}}function nP(){return(nP=eP(function*(t,e){const n=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;it&&"object"==typeof t&&t.isBuffer)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const n=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let n=t.buffer;const i=t.byteLength||t.length;return(0!==t.byteOffset||i!==n.byteLength)&&(n=n.slice(t.byteOffset,t.byteOffset+i)),n}throw new Error(aP)}function cP(t,e,n){return uP.apply(this,arguments)}function uP(){return(uP=gS(function*(t,e,n){const i=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||i)return lP(t,e);if(Dk(t)&&(t=yield Zk(t)),Mk(t)){const n=t;return yield tA(n),e.binary?yield n.arrayBuffer():yield n.text()}if(Rk(t)&&(t=oP(t,n)),Pk(t)||Ik(t))return YA(t);throw new Error(aP)})).apply(this,arguments)}function hP(t,e,n=null){if(n)return n;const i=bt({fetch:bA(e,t)},t);return Array.isArray(i.loaders)||(i.loaders=null),i}function dP(t,e){if(!e&&t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...t]:t}return n&&n.length?n:null}const pP=()=>{const t=fA();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function fP(t){const e=pP();t=Array.isArray(t)?t:[t];for(const n of t){const t=jk(n);e.find(e=>t===e)||e.unshift(t)}}const gP=/\.([^.]+)$/;function mP(t){return bP.apply(this,arguments)}function bP(){return(bP=gS(function*(t,e=[],n,i){if(!vP(t))return null;let r=yP(t,e,ti(bt({},n),{nothrow:!0}),i);if(r)return r;if(Dk(t)&&(r=yP(t=yield t.slice(0,10).arrayBuffer(),e,n,i)),!(r||null!=n&&n.nothrow))throw new Error(_P(t));return r})).apply(this,arguments)}function yP(t,e=[],n,i){if(!vP(t))return null;if(e&&!Array.isArray(e))return jk(e);let r=[];e&&(r=r.concat(e)),null!=n&&n.ignoreRegisteredLoaders||r.push(...pP()),function(t){for(const e of t)jk(e)}(r);const s=function(t,e,n,i){const{url:r,type:s}=Yk(t),o=r||(null==i?void 0:i.url);let a=null;return null!=n&&n.mimeType&&(a=wP(e,null==n?void 0:n.mimeType)),a=a||function(t,e){const n=e&&gP.exec(e),i=n&&n[1];return i?function(t,e){e=e.toLowerCase();for(const n of t)for(const t of n.extensions)if(t.toLowerCase()===e)return n;return null}(t,i):null}(e,o),a=a||wP(e,s),a=a||function(t,e){if(!e)return null;for(const n of t)if("string"==typeof e){if(xP(e,n))return n}else if(ArrayBuffer.isView(e)){if(SP(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&SP(e,0,n))return n;return null}(e,t),a=a||wP(e,null==n?void 0:n.fallbackMimeType),a}(t,r,n,i);if(!(s||null!=n&&n.nothrow))throw new Error(_P(t));return s}function vP(t){return!(t instanceof Response&&204===t.status)}function _P(t){const{url:e,type:n}=Yk(t);let i="No valid loader found";return t&&(i+=` data: "${function(t,e=5){return"string"==typeof t?t.slice(0,e):ArrayBuffer.isView(t)?EP(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?EP(t,0,e):""}(t)}", contentType: "${n}"`),e&&(i+=` url: ${e}`),i}function wP(t,e){for(const n of t)if(n.mimeTypes&&n.mimeTypes.includes(e)||e===`application/x.${n.id}`)return n;return null}function xP(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(e=>t.startsWith(e))}function SP(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(i=>function(t,e,n,i){if(i instanceof ArrayBuffer)return function(t,e,n){if(t.byteLength<(n=n||t.byteLength)||e.byteLengtht.equals(e));let RP=new Uint8ClampedArray(0);const NP={data:{type:"data",value:MP,async:!0},dataComparator:null,_dataDiff:{type:"function",value:t=>t&&t.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:n,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=n.context;var a;r=r||n.getLoadOptions(),i=i||n.props.loaders,s&&(r=ti(bt({},r),{fetch:ti(bt({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(t);return!l&&!r&&(o.add({resourceId:t,data:AP(t,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:t,onChange:t=>n.internalState.reloadAsyncProp(e,t),consumerId:n.id,requestId:e}):AP(t,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Mw.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,100*-t],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let LP=(()=>{class t extends Ck{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,e){var n,i,r,s;e&&(t.message="".concat(e,": ").concat(t.message)),(null===(n=(i=this.props).onError)||void 0===n?void 0:n.call(i,t))||null===(r=this.context)||void 0===r||null===(s=r.onError)||void 0===s||s.call(r,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:e}=this.context,n=KT(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,r,s]=NT(n,e.pixelProjectionMatrix);return 2===t.length?[i,r]:[i,r,s]}unproject(t){const{viewport:e}=this.context;return e.unproject(t)}projectPosition(t){return function(t,e){const{viewport:n,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(t){const e=bt({},t);let{coordinateSystem:n}=t;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=t;return n===Mw.DEFAULT&&(n=i.isGeospatial?Mw.LNGLAT:Mw.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=n),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=n,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=lT(n,i,r),h=KT(t,{viewport:n,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}(h,h,n.projectPosition(l||c));return h}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Mw.DEFAULT||t===Mw.LNGLAT||t===Mw.CARTESIAN}onHover(t,e){return!!this.props.onHover&&this.props.onHover(t,e)}onClick(t,e){return!!this.props.onClick&&this.props.onClick(t,e)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,e=[]){return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}decodePickingColor(t){uE(t instanceof Uint8Array);const[e,n,i]=t;return e+256*n+65536*i-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const e of this.props.extensions)t=GO(t,e.getShaders.call(this,e));return t}shouldUpdateState({changeFlags:t}){return t.propsOrDataChanged}updateState({oldProps:t,props:e,changeFlags:n}){const i=this.getAttributeManager();if(n.dataChanged&&i){const{dataChanged:t}=n;if(Array.isArray(t))for(const e of t)i.invalidateAll(e);else i.invalidateAll()}const r=e.highlightedObjectIndex>=0||e.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==r&&i){const{pickingColors:t,instancePickingColors:e}=i.attributes,n=t||e;n&&(r&&n.constant&&(n.constant=!1,i.invalidate(n.id)),!n.value&&!r&&(n.constant=!0,n.value=[0,0,0]))}}finalizeState(){for(const e of this.getModels())e.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const e of this.getModels())e.draw(t)}getPickingInfo({info:t}){const{index:e}=t;return e>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[e]),t}activateViewport(t){const e=this.internalState.viewport;this.internalState.viewport=t,(!e||!DP({oldViewport:e,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",e=""){const n=this.getAttributeManager();!n||("all"===t?n.invalidateAll():n.invalidate(t))}updateAttributes(t){for(const e of this.getModels())this._setModelAttributes(e,t)}_updateAttributes(t){const e=this.getAttributeManager();if(!e)return;const n=this.getNumInstances(t),i=this.getStartIndices(t);e.update({data:t.data,numInstances:n,startIndices:i,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const r=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const e=t.update(),n=Object.create(this.props);for(const t in e)Object.defineProperty(n,t,{value:e[t]});return n}return this.props}calculateInstancePickingColors(t,{numInstances:e}){if(t.constant)return;const n=Math.floor(RP.length/3);if(this.internalState.usesPickingColorCache=!0,nIP&&Iw.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),RP=AS.allocate(RP,e,{size:3,copy:!0,maxCount:Math.max(e,IP)});const t=Math.floor(RP.length/3),i=[];for(let e=n;e{const i={moduleParameters:t,uniforms:e,parameters:n,context:this.context};for(const t of this.props.extensions)t.draw.call(this,i,t);this.draw(i)})}finally{this.props=i}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:e}=this.internalState;for(const i in t)if(t[i]){let n=!1;switch(i){case"dataChanged":Array.isArray(e[i])&&(e[i]=Array.isArray(t[i])?e[i].concat(t[i]):t[i],n=!0);default:e[i]||(e[i]=t[i],n=!0)}n&&PE("layer.changeFlag",this,i,t)}const n=e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged;e.propsOrDataChanged=n,e.somethingChanged=n||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,e){const n=function(t,e){const n=FO({newProps:t,oldProps:e,propTypes:UO(t),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(t,e){if(null===e)return"oldProps is null, initial diff";let n=null;const{dataComparator:i,_dataDiff:r}=t;return i?i(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied"),n&&r&&(n=r(t.data,e.data)||n),n}(t,e);let r=!1;return i||(r=function(t,e){if(null===e)return"oldProps is null, initial diff";if("all"in t.updateTriggers&&zO(t,e,"all"))return{all:!0};const n={};let i=!1;for(const r in t.updateTriggers)"all"!==r&&zO(t,e,r)&&(n[r]=!0,i=n);return i}(t,e)),{dataChanged:i,propsChanged:n,updateTriggersChanged:r,extensionsChanged:VO(t,e),transitionsChanged:jO(t,e)}}(t,e);if(n.updateTriggersChanged)for(const i in n.updateTriggersChanged)n.updateTriggersChanged[i]&&this.invalidateAttribute(i);if(n.transitionsChanged)for(const i in n.transitionsChanged)this.internalState.uniformTransitions.add(i,e[i],t[i],t.transitions[i]);return this.setChangeFlags(n)}validateProps(){!function(t){const e=UO(t);for(const n in e){const i=e[n],{validate:r}=i;if(r&&!r(t[n],i))throw new Error("Invalid prop ".concat(n,": ").concat(t[n]))}}(this.props)}setModuleParameters(t){for(const e of this.getModels())e.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const e={pickingSelectedColor:t.picked?t.color:null},{highlightColor:n}=this.props;t.picked&&"function"==typeof n&&(e.pickingHighlightColor=n(t)),this.setModuleParameters(e),this.setNeedsRedraw()}_updateModules({props:t,oldProps:e},n){const{autoHighlight:i,highlightedObjectIndex:r,highlightColor:s}=t;if(n||e.autoHighlight!==i||e.highlightedObjectIndex!==r||e.highlightColor!==s){const t={};i||(t.pickingSelectedColor=null),Array.isArray(s)&&(t.pickingHighlightColor=s),Number.isInteger(r)&&(t.pickingSelectedColor=r>=0?this.encodePickingColor(r):null),this.setModuleParameters(t)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let e=!1;e=e||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const n=this.getAttributeManager(),i=n&&n.getNeedsRedraw(t);return e=e||i,e}_getAttributeManager(){return new PO(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){uE(!this.internalState&&!this.state),uE(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Ok({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Iw.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new RO(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){PE("layer.matched",this,this===t);const{state:e,internalState:n}=t;this!==t&&(this.internalState=n,this.internalState.layer=this,this.state=e,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return t.layerName="Layer",t.defaultProps=NP,t})(),jP=(()=>{class t extends LP{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:e}=t;return e&&e.__source&&e.__source.parent&&e.__source.parent.id===this.id&&(t.object=e.__source.object,t.index=e.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}getSubLayerClass(t,e){const{_subLayerProps:n}=this.props;return n&&n[t]&&n[t].type||e}getSubLayerRow(t,e,n){return t.__source={parent:this,object:e,index:n},t}getSubLayerAccessor(t){if("function"==typeof t){const e={data:this.props.data,target:[]};return(n,i)=>n&&n.__source?(e.index=n.__source.index,t(n.__source.object,e)):t(n,i)}return t}getSubLayerProps(t={}){const{opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:s,highlightedObjectIndex:o,autoHighlight:a,highlightColor:l,coordinateSystem:c,coordinateOrigin:u,wrapLongitude:h,positionFormat:d,modelMatrix:p,extensions:f,fetch:g,_subLayerProps:m}=this.props,b={opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:s,highlightedObjectIndex:o,autoHighlight:a,highlightColor:l,coordinateSystem:c,coordinateOrigin:u,wrapLongitude:h,positionFormat:d,modelMatrix:p,extensions:f,fetch:g},y=m&&m[t.id],v=y&&y.updateTriggers,_=t.id||"sublayer";if(y){const e=this.constructor._propTypes,n=t.type?t.type._propTypes:{};for(const t in y){const i=n[t]||e[t];i&&"accessor"===i.type&&(y[t]=this.getSubLayerAccessor(y[t]))}}Object.assign(b,t,y),b.id="".concat(this.props.id,"-").concat(_),b.updateTriggers=bt(bt({all:this.props.updateTriggers.all},t.updateTriggers),v);for(const w of f){const t=w.getSubLayerProps.call(this,w);t&&Object.assign(b,t,{updateTriggers:Object.assign(b.updateTriggers,t.updateTriggers)})}return b}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const e=!t||this.needsUpdate();e&&(t=this.renderLayers(),t=gE(t,Boolean),this.internalState.subLayers=t),PE("compositeLayer.renderLayers",this,e,t);for(const n of t)n.parent=this}}return t.layerName="CompositeLayer",t})();const FP=/([0-9]+\.?[0-9]*)(%|px)/;function BP(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=t.match(FP);if(e&&e.length>=3){const t="%"===e[2],n=parseFloat(e[1]);return{position:t?n/100:n,relative:t}}default:throw new Error("Could not parse position string ".concat(t))}}function VP(t,e){return t.relative?Math.round(t.position*e):t.position}function zP(t,e){if(t===e)return!0;if(!t||!e)return!1;for(const n in t){const i=t[n],r=e[n];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&zP(i,r)))return!1}return!0}class UP{constructor(t={}){const{id:e=null,x:n=0,y:i=0,width:r="100%",height:s="100%",projectionMatrix:o=null,fovy:a=50,near:l=.1,far:c=1e3,modelMatrix:u=null,viewportInstance:h=null,type:d=WT}=t;uE(!h||h instanceof WT),this.viewportInstance=h,this.id=e||this.constructor.displayName||"view",this.type=d,this.props=ti(bt({},t),{id:this.id,projectionMatrix:o,fovy:a,near:l,far:c,modelMatrix:u}),this._parseDimensions({x:n,y:i,width:r,height:s}),this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||(this.viewportInstance?t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):zP(this.props,t.props))}makeViewport({width:t,height:e,viewState:n}){if(this.viewportInstance)return this.viewportInstance;n=this.filterViewState(n);const i=this.getDimensions({width:t,height:e});return this._getViewport(n,i)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(t){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e=bt({},t);for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions({width:t,height:e}){return{x:VP(this._x,t),y:VP(this._y,e),width:VP(this._width,t),height:VP(this._height,e)}}_getControllerProps(t){let e=this.props.controller;return e?!0===e?t:("function"==typeof e&&(e={type:e}),bt(bt({},t),e)):null}_getViewport(t,e){const{type:n}=this;return new n(bt(bt(bt({},t),this.props),e))}_parseDimensions({x:t,y:e,width:n,height:i}){this._x=BP(t),this._y=BP(e),this._width=BP(n),this._height=BP(i)}}const HP=()=>{},$P={transitionEasing:t=>t,transitionInterruption:1,onTransitionStart:HP,onTransitionInterrupt:HP,onTransitionEnd:HP};class GP{constructor(t,e={}){this.ControllerState=t,this.props=bt(bt({},$P),e),this.propsInTransition=null,this.transition=new OO(e.timeline),this.onViewStateChange=e.onViewStateChange||HP,this.onStateChange=e.onStateChange||HP,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const n=this.props;if(t=bt(bt({},$P),t),this.props=t,this._shouldIgnoreViewportChange(n,t))return e;if(this._isTransitionEnabled(t)){const{interruption:i,endProps:r}=this.transition.settings,s=bt(bt({},n),2===i?r:this.propsInTransition||n);this._triggerTransition(s,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:n}=t;return(e>0||"auto"===e)&&Boolean(n)}_isUpdateDueToCurrentTransition(t){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const n=new this.ControllerState(t),i=new this.ControllerState(e).shortestPathFrom(n),{transitionInterpolator:r}=e,s=r.getDuration?r.getDuration(t,e):e.transitionDuration;if(0===s)return;const o=e.transitionInterpolator.initializeProps(t,i);this.propsInTransition={},this.duration=s,this.transition.start({duration:s,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startProps:o.start,endProps:o.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),t(e)}}_onTransitionUpdate(t){const{time:e,settings:{interpolator:n,startProps:i,endProps:r,duration:s,easing:o}}=t,a=o(e/s),l=n.interpolateProps(i,r,a);this.propsInTransition=new this.ControllerState(bt(bt({},this.props),l)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const WP=["longitude","latitude","zoom","bearing","pitch"],qP=["longitude","latitude","zoom"];class XP extends class{constructor(t={}){Array.isArray(t)&&(t={compare:t,extract:t,required:t});const{compare:e,extract:n,required:i}=t;this._propsToCompare=e,this._propsToExtract=n,this._requiredProps=i}arePropsEqual(t,e){for(const n of this._propsToCompare||Object.keys(e))if(!(n in t)||!(n in e)||!FS(t[n],e[n]))return!1;return!0}initializeProps(t,e){let n;if(this._propsToExtract){const i={},r={};for(const n of this._propsToExtract)i[n]=t[n],r[n]=e[n];n={start:i,end:r}}else n={start:t,end:e};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}interpolateProps(t,e,n){return e}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){!this._requiredProps||this._requiredProps.forEach(e=>{const n=t[e];uE(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))})}}{constructor(t={}){super((Array.isArray(t)?t:t.transitionProps)||{compare:WP,extract:WP,required:qP}),this.opts=t}initializeProps(t,e){const n=super.initializeProps(t,e),{makeViewport:i,around:r}=this.opts;if(i&&r){const s=i(t),o=i(e),a=s.unproject(r);n.start.around=r,Object.assign(n.end,{around:o.project(a),aroundPosition:a,width:e.width,height:e.height})}return n}interpolateProps(t,e,n){const i={};for(const r of this._propsToExtract)i[r]=jS(t[r]||0,e[r]||0,n);if(e.aroundPosition){const r=this.opts.makeViewport(bt(bt({},e),i));Object.assign(i,r.panByPosition(e.aroundPosition,jS(t.around,e.around,n)))}return i}}const YP={transitionDuration:0},KP={transitionDuration:300,transitionEasing:t=>t,transitionInterruption:1},QP=t=>1-(1-t)*(1-t),ZP=["wheel"],JP=["panstart","panmove","panend"],tI=["pinchstart","pinchmove","pinchend"],eI=["tripanstart","tripanmove","tripanend"],nI=["doubletap"],iI=["keydown"];class rI{constructor(t,e={}){this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new GP(t,ti(bt({},e),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const n=this.linearTransitionProps;this._transition=n&&ti(bt({},KP),{transitionInterpolator:new XP({transitionProps:n})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(e)}get linearTransitionProps(){return null}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.setProps(this.controllerStateProps)}finalize(){for(const t in this._events)this._events[t]&&this.eventManager.off(t,this.handleEvent);this.transitionManager.finalize()}handleEvent(t){const{ControllerState:e}=this;this.controllerState=new e(bt(bt({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const n=this._eventStartBlocked;switch(t.type){case"panstart":return!n&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!n&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!n&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}getCenter(t){const{x:e,y:n}=this.controllerStateProps,{offsetCenter:i}=t;return[i.x-e,i.y-n]}isPointInBounds(t,e){const{width:n,height:i}=this.controllerStateProps;if(e&&e.handled)return!1;const r=t[0]>=0&&t[0]<=n&&t[1]>=0&&t[1]<=i;return r&&e&&e.stopPropagation(),r}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(t){const e=setTimeout(()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)},t);this._eventStartBlocked=e}setProps(t){"onViewStateChange"in t&&(this.onViewStateChange=t.onViewStateChange),"onStateChange"in t&&(this.onStateChange=t.onStateChange),"makeViewport"in t&&(this.makeViewport=t.makeViewport),"dragMode"in t&&(this.dragMode=t.dragMode),this.controllerStateProps=t,"eventManager"in t&&this.eventManager!==t.eventManager&&(this.eventManager=t.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);let{inertia:e}=t;!0===e&&(e=300),this.inertia=e;const{scrollZoom:n=!0,dragPan:i=!0,dragRotate:r=!0,doubleClickZoom:s=!0,touchZoom:o=!0,touchRotate:a=!1,keyboard:l=!0}=t,c=Boolean(this.onViewStateChange);this.toggleEvents(ZP,c&&n),this.toggleEvents(JP,c&&(i||r)),this.toggleEvents(tI,c&&(o||a)),this.toggleEvents(eI,c&&a),this.toggleEvents(nI,c&&s),this.toggleEvents(iI,c&&l),this.scrollZoom=n,this.dragPan=i,this.dragRotate=r,this.doubleClickZoom=s,this.touchZoom=o,this.touchRotate=a,this.keyboard=l}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach(t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))})}updateViewport(t,e={},n={}){const i=bt(bt({},t.getViewportProps()),e),r=this.controllerState!==t;if(this._state=t.getState(),this._setInteractionState(n),r){const t=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:t})}}_onTransition(t){this.onViewStateChange&&(t.interactionState=this._interactionState,this.onViewStateChange(t))}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let n=this.isFunctionKeyPressed(t)||t.rightButton;(this.invertPan||"pan"===this.dragMode)&&(n=!n);const i=this.controllerState[n?"panStart":"rotateStart"]({pos:e});return this._panMove=n,this.updateViewport(i,YP,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),n=this.controllerState.pan({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const n=this.getCenter(t),i=this.controllerState.pan({pos:[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2]}).panEnd();this.updateViewport(i,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),n=this.controllerState.rotate({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const n=this.getCenter(t),i=this.controllerState.rotate({pos:[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2]}).rotateEnd();this.updateViewport(i,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;t.preventDefault();const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const{speed:n=.01,smooth:i=!1}=this.scrollZoom,{delta:r}=t;let s=2/(1+Math.exp(-Math.abs(r*n)));r<0&&0!==s&&(s=1/s);const o=this.controllerState.zoom({pos:e,scale:s});return this.updateViewport(o,ti(bt({},this._getTransitionProps({around:e})),{transitionDuration:i?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.rotateStart({pos:e});return this.updateViewport(n,YP,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate||!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const n=this.controllerState.rotate({pos:e});return this.updateViewport(n,YP,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const n=this.getCenter(t),i=[n[0],n[1]+=t.velocityY*e/2],r=this.controllerState.rotate({pos:i});this.updateViewport(r,ti(bt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(n,YP,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:n}=t,i=this.getCenter(t);e=e.zoom({pos:i,scale:n})}if(this.touchRotate){const{rotation:n}=t;e=e.rotate({deltaAngleX:this._startPinchRotation-n})}return this.updateViewport(e,YP,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e,_lastPinchEvent:n}=this;if(this.touchZoom&&e&&n&&t.scale!==n.scale){const i=this.getCenter(t);let r=this.controllerState.rotateEnd();const s=Math.log2(t.scale),o=(s-Math.log2(n.scale))/(t.deltaTime-n.deltaTime),a=Math.pow(2,s+o*e/2);r=r.zoom({pos:i,scale:a}).zoomEnd(),this.updateViewport(r,ti(bt({},this._getTransitionProps({around:i})),{transitionDuration:e,transitionEasing:QP}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.isFunctionKeyPressed(t),i=this.controllerState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:n,moveSpeed:i,rotateSpeedX:r,rotateSpeedY:s}=this.keyboard,{controllerState:o}=this;let a;const l={};switch(t.srcEvent.code){case"Minus":a=e?o.zoomOut(n).zoomOut(n):o.zoomOut(n),l.isZooming=!0;break;case"Equal":a=e?o.zoomIn(n).zoomIn(n):o.zoomIn(n),l.isZooming=!0;break;case"ArrowLeft":e?(a=o.rotateLeft(r),l.isRotating=!0):(a=o.moveLeft(i),l.isPanning=!0);break;case"ArrowRight":e?(a=o.rotateRight(r),l.isRotating=!0):(a=o.moveRight(i),l.isPanning=!0);break;case"ArrowUp":e?(a=o.rotateUp(s),l.isRotating=!0):(a=o.moveUp(i),l.isPanning=!0);break;case"ArrowDown":e?(a=o.rotateDown(s),l.isRotating=!0):(a=o.moveDown(i),l.isPanning=!0);break;default:return!1}return this.updateViewport(a,this._getTransitionProps(),l),!0}_getTransitionProps(t){const{_transition:e}=this;return e?t?ti(bt({},e),{transitionInterpolator:new XP(ti(bt({},t),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):e:YP}}class sI{constructor(t){this._viewportProps=this._applyConstraints(t)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(t){return this._viewportProps}_applyConstraints(t){return t}}const oI=[0,0,0];class aI extends sI{constructor({makeViewport:t,width:e,height:n,rotationX:i=0,rotationOrbit:r=0,target:s=oI,zoom:o=0,minRotationX:a=-90,maxRotationX:l=90,minZoom:c=-(1/0),maxZoom:u=Infinity,startPanPosition:h,startRotatePos:d,startRotationX:p,startRotationOrbit:f,startZoomPosition:g,startZoom:m}){super({width:e,height:n,rotationX:i,rotationOrbit:r,target:s,zoom:o,minRotationX:a,maxRotationX:l,minZoom:c,maxZoom:u}),this._state={startPanPosition:h,startRotatePos:d,startRotationX:p,startRotationOrbit:f,startZoomPosition:g,startZoom:m},this.makeViewport=t}panStart({pos:t}){return this._getUpdatedState({startPanPosition:this._unproject(t)})}pan({pos:t,startPosition:e}){const n=this._state.startPanPosition||e;if(!n)return this;const i=this.makeViewport(this._viewportProps).panByPosition(n,t);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){const{startRotatePos:i,startRotationX:r,startRotationOrbit:s}=this._state,{width:o,height:a}=this._viewportProps;if(!i||!Number.isFinite(r)||!Number.isFinite(s))return this;let l;if(t){let e=(t[0]-i[0])/o;(r<-90||r>90)&&(e*=-1),l={rotationX:r+(t[1]-i[1])/a*180,rotationOrbit:s+180*e}}else l={rotationX:r+n,rotationOrbit:s+e};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(t){const e=t.getViewportProps(),n=bt({},this._viewportProps),{rotationOrbit:i}=n;return Math.abs(i-e.rotationOrbit)>180&&(n.rotationOrbit=i<0?i+360:i-360),n}zoomStart({pos:t}){return this._getUpdatedState({startZoomPosition:this._unproject(t),startZoom:this._viewportProps.zoom})}zoom({pos:t,startPos:e,scale:n}){const{zoom:i}=this._viewportProps;let{startZoom:r,startZoomPosition:s}=this._state;Number.isFinite(r)||(r=i,s=this._unproject(e)||this._unproject(t));const o=this._calculateNewZoom({scale:n,startZoom:r}),a=this.makeViewport(ti(bt({},this._viewportProps),{zoom:o}));return this._getUpdatedState(bt({zoom:o},a.panByPosition(s,t)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}zoomOut(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}moveLeft(t=50){return this._panFromCenter([-t,0])}moveRight(t=50){return this._panFromCenter([t,0])}moveUp(t=50){return this._panFromCenter([0,-t])}moveDown(t=50){return this._panFromCenter([0,t])}rotateLeft(t=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-t})}rotateRight(t=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+t})}rotateUp(t=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-t})}rotateDown(t=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+t})}_unproject(t){const e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}_calculateNewZoom({scale:t,startZoom:e}){const{maxZoom:n,minZoom:i}=this._viewportProps;return Number.isFinite(e)||(e=this._viewportProps.zoom),LS(e+Math.log2(t),i,n)}_panFromCenter(t){const{width:e,height:n,target:i}=this._viewportProps;return this.pan({startPosition:i,pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new aI(bt(bt(bt({},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i,maxRotationX:r,minRotationX:s,rotationOrbit:o}=t;return t.zoom=LS(i,n,e),t.rotationX=LS(t.rotationX,s,r),(o<-180||o>180)&&(t.rotationOrbit=function(t,e){const n=t%360;return n<0?360+n:n}(o+180)-180),t}}class lI extends rI{constructor(t){super(aI,t)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class cI extends rI{constructor(t){t.dragMode=t.dragMode||"pan",super(aI,t)}_onPanRotate(t){return!1}get linearTransitionProps(){return["target","zoom"]}}const uI=(new bT).lookAt({eye:[0,0,1]});function hI({width:t,height:e,near:n,far:i}){return t=t||1,e=e||1,(new bT).ortho({left:-t/2,right:t/2,bottom:-e/2,top:e/2,near:n,far:i})}class dI extends WT{constructor(t){const{width:e,height:n,near:i=.1,far:r=1e3,zoom:s=0,target:o=[0,0,0],flipY:a=!0}=t,l=Math.pow(2,s);super(ti(bt({},t),{longitude:null,position:o,viewMatrix:uI.clone().scale([l,l*(a?-1:1),l]),projectionMatrix:hI({width:e,height:n,near:i,far:r}),zoom:s}))}panByPosition(t,e){const n=uT([],t,hT([],LT(e,this.pixelUnprojectionMatrix)));return{target:uT([],this.center,n)}}}let pI=(()=>{class t extends UP{constructor(t){super(ti(bt({},t),{type:dI}))}get controller(){return this._getControllerProps({type:cI})}}return t.displayName="OrthographicView",t})();const fI=Math.PI/180;function gI({height:t,fovy:e,orbitAxis:n,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*fI/2),a="Z"===n?[0,0,1]:[0,1,0],l="Z"===n?[0,-o,0]:[0,0,o],c=(new bT).lookAt({eye:l,up:a});c.rotateX(i*fI),"Z"===n?c.rotateZ(r*fI):c.rotateY(r*fI);const u=Math.pow(2,s)/(t||1);return c.scale(u),c}class mI extends WT{constructor(t){const{height:e,fovy:n,orbitAxis:i,target:r=[0,0,0],rotationX:s=0,rotationOrbit:o=0,zoom:a=0}=t;super(ti(bt({},t),{longitude:null,viewMatrix:gI({height:e,fovy:n,orbitAxis:i,rotationX:s,rotationOrbit:o,zoom:a}),fovy:n,position:r,zoom:a})),this.projectedCenter=this.project(this.center)}unproject(t,{topLeft:e=!0}={}){const[n,i,r=this.projectedCenter[2]]=t,s=e?i:this.height-i,[o,a,l]=LT([n,s,r],this.pixelUnprojectionMatrix);return[o,a,l]}panByPosition(t,e){const n=this.project(t);return{target:this.unproject([this.width/2+n[0]-e[0],this.height/2+n[1]-e[1],this.projectedCenter[2]])}}}let bI=(()=>{class t extends UP{constructor(t={}){const{orbitAxis:e="Z"}=t;super(ti(bt({},t),{orbitAxis:e,type:mI}))}get controller(){return this._getControllerProps({type:lI})}}return t.displayName="OrbitView",t})();const yI=[255,255,255],vI=1;let _I=0;class wI{constructor(t={}){const{color:e=yI}=t,{intensity:n=vI}=t;this.id=t.id||"ambient-".concat(_I++),this.color=e,this.intensity=n,this.type="ambient"}}const xI=[255,255,255],SI=1,EI=[0,0,-1];let CI=0;class OI{constructor(t={}){const{color:e=xI}=t,{intensity:n=SI}=t,{direction:i=EI}=t,{_shadow:r=!1}=t;this.id=t.id||"directional-".concat(CI++),this.color=e,this.intensity=n,this.type="directional",this.direction=new nE(i).normalize().toArray(),this.shadow=r}getProjectedLight(){return this}}class TI{constructor(t={}){const{id:e="effect"}=t;this.id=e,this.props=bt({},t)}preRender(){}getModuleParameters(){}cleanup(){}}class kI extends class{constructor(t,e={}){const{id:n="pass"}=e;this.id=n,this.gl=t,this.props=bt({},e)}setProps(t){Object.assign(this.props,t)}render(){}cleanup(){}}{render(t){return yx(this.gl,{framebuffer:t.target}),this._drawLayers(t)}_drawLayers(t){const{viewports:e,views:n,onViewportActive:i,clearCanvas:r=!0}=t;t.pass=t.pass||"unknown";const s=this.gl;r&&function(t){yx(t,{viewport:[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}),t.clear(16640)}(s);const o=[];for(const a of e){const e=a.viewport||a,r=n&&n[e.id];i(e);const l=this._getDrawLayerParams(e,t);t.view=r;const c=e.subViewports||[e];for(const n of c){t.viewport=n;const e=this._drawLayersInViewport(s,t,l);o.push(e)}}return o}_getDrawLayerParams(t,{layers:e,pass:n,layerFilter:i,effects:r,moduleParameters:s}){const o=[],a=AI(),l={viewport:t,isPicking:n.startsWith("picking"),renderPass:n};for(let c=0;cpS(t,e))}const a={totalCount:e.length,visibleCount:0,compositeCount:0,pickableCount:0};yx(t,{viewport:o});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in n){const t=n[l]=n[l]||AI(e[l],e);c=t(r,s),n[a]=t}else Number.isFinite(o)?(c=o+(e[l]||0),n[a]=null):c=t;return s&&c>=t&&(t=c+1),e[a]=c,c};return i}class PI extends kI{constructor(t,e){super(t,e),this.shadowMap=new lS(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new hS(t,{format:33189,width:1,height:1}),this.fbo=new SS(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;vx(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const n=t.viewports[0],i=_x(this.gl),r=n.width*i,s=n.height*i;(r!==e.width||s!==e.height)&&e.resize({width:r,height:s}),super.render(ti(bt({},t),{target:e,pass:"shadow"}))})}shouldDrawLayer(t){return!1!==t.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const II=Object.keys(Mw).map(t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(Mw[t],";")).join(""),MI=Object.keys(Dw).map(t=>"const int PROJECTION_MODE_".concat(t," = ").concat(Dw[t],";")).join("");var DI="".concat(II,"\n").concat(MI,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n");const RI={};var NI={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:DI,getUniforms:function(t=RI){return t.viewport?function({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:i=Mw.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Mw.DEFAULT&&(i=t.isGeospatial?Mw.LNGLAT:Mw.CARTESIAN);const o=aT({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=n||rT,o}(t):{}}};const LI=$O(function({viewport:t,center:e}){return new bT(t.viewProjectionMatrix).invert().transform(e)}),jI=$O(function({viewport:t,shadowMatrices:e}){const n=[],i=t.pixelUnprojectionMatrix,r=t.isGeospatial?void 0:1,s=[[0,0,r],[t.width,0,r],[0,t.height,r],[t.width,t.height,r],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(t=>function(t,e){const[n,i,r]=t,s=LT([n,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(t,i));for(const o of e){const e=o.clone().translate(new nE(t.center).negate()),i=s.map(t=>e.transform(t)),r=(new bT).ortho({left:Math.min(...i.map(t=>t[0])),right:Math.max(...i.map(t=>t[0])),bottom:Math.min(...i.map(t=>t[1])),top:Math.max(...i.map(t=>t[1])),near:Math.min(...i.map(t=>-t[2])),far:Math.max(...i.map(t=>-t[2]))});n.push(r.multiplyRight(o))}return n}),FI=[0,0,0,1],BI=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];var VI={name:"shadow",dependencies:[NI],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(t={},e={})=>{if(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0){const{shadowEnabled:n=!0}=t;return n&&t.shadowMatrices&&t.shadowMatrices.length>0?function(t={},e={}){const n={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||FI,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},i=LI({viewport:t.viewport,center:e.project_uCenter}),r=[],s=jI({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let o=0;o0?t.shadowMaps[o]:t.dummyShadowMap;return n}(t,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}};const zI={color:[255,255,255],intensity:1},UI=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],HI=[0,0,0,200/255];class $I extends TI{constructor(t){super(t),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=HI,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const e in t){const n=t[e];switch(n.type){case"ambient":this.ambientLight=n;break;case"directional":this.directionalLights.push(n);break;case"point":this.pointLights.push(n)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(t,{layers:e,layerFilter:n,viewports:i,onViewportActive:r,views:s}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=sO.getDefaultProgramManager(t),VI&&this.programManager.addDefaultModule(VI)),this.dummyShadowMap||(this.dummyShadowMap=new lS(t,{width:1,height:1}));for(let t=0;te.getProjectedLight({layer:t})),pointLights:this.pointLights.map(e=>e.getProjectedLight({layer:t}))},e}cleanup(){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(VI),this.programManager=null)}_createLightMatrix(){const t=[];for(const e of this.directionalLights){const n=(new bT).lookAt({eye:new nE(e.direction).negate()});t.push(n)}return t}_createShadowPasses(t){for(let e=0;e=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const i of e)this._setChannelTime(i,this.time);const n=this.animations.values();for(const i of n){const{animation:t,channel:e}=i;t.setTime(this.getTime(e))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const n=WI++;return this.animations.set(n,{animation:t,channel:e}),t.setTime(this.getTime(e)),n}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const n=e-t.delay;n>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,n)%t.duration,t.time*=t.rate)}}class XI{constructor(t,e,n){this.id=t,this.context=n,this._loadCount=0,this._subscribers=new Set,this.setData(e)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(t,e){if(t===this._data&&!e)return;this._data=t;const n=++this._loadCount;let i=t;"string"==typeof t&&(i=AP(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then(t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=null,this._content=t)}).catch(t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=t||!0)})):(this.isLoaded=!0,this._error=null,this._content=t);for(const r of this._subscribers)r.onChange(this.getData())}}class YI{constructor({gl:t,protocol:e}){this.protocol=e||"resource://",this._context={gl:t,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return!!t.startsWith(this.protocol)||t in this._resources}add({resourceId:t,data:e,forceUpdate:n=!1,persistent:i=!0}){let r=this._resources[t];r?r.setData(e,n):(r=new XI(t,e,this._context),this._resources[t]=r),r.persistent=i}remove(t){const e=this._resources[t];e&&(e.delete(),delete this._resources[t])}unsubscribe({consumerId:t}){const e=this._consumers[t];if(e){for(const t in e){const n=e[t];n.resource&&n.resource.unsubscribe(n)}delete this._consumers[t],this.prune()}}subscribe({resourceId:t,onChange:e,consumerId:n,requestId:i="default"}){const{_resources:r,protocol:s}=this;t.startsWith(s)&&(r[t=t.replace(s,"")]||this.add({resourceId:t,data:null,persistent:!1}));const o=r[t];if(this._track(n,i,o,e),o)return o.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const t in this._resources)this._resources[t].delete()}_track(t,e,n,i){const r=this._consumers,s=r[t]=r[t]||{},o=s[e]||{};o.resource&&(o.resource.unsubscribe(o),o.resource=null,this.prune()),n&&(s[e]=o,o.onChange=i,o.resource=n,n.subscribe(o))}_prune(){this._pruneRequest=null;for(const t of Object.keys(this._resources)){const e=this._resources[t];!e.persistent&&!e.inUse()&&(e.delete(),delete this._resources[t])}}}const KI=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},NI],QI=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function ZI(t){const e=sO.getDefaultProgramManager(t);for(const n of KI)e.addDefaultModule(n);for(const n of QI)e.addShaderHook(n);return e}const JI=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class tM{constructor(t,{deck:e,stats:n,viewport:i,timeline:r}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new YI({gl:t,protocol:"deck://"}),this.context=ti(bt({},JI),{layerManager:this,gl:t,deck:e,programManager:t&&ZI(t),stats:n||new Ix({id:"deck.gl"}),viewport:i||new WT({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:r||new qI,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const t of this.layers)this._finalizeLayer(t)}needsRedraw(t={clearRedrawFlags:!1}){let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(const n of this.layers){const i=n.getNeedsRedraw(t);e=e||i}return e}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers({layerIds:t=null}={}){return t?this.layers.filter(e=>t.find(t=>0===e.id.indexOf(t))):this.layers}setProps(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}setLayers(t,e){PE("layerManager.setLayers",this,e,t),this.lastRenderedLayers=t,t=gE(t,Boolean);for(const n of t)n.context=this.context;return this._updateLayers(this.layers,t),this}updateLayers(){const t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this.lastRenderedLayers,t)),this._nextLayers=null}activateViewport(t){return PE("layerManager.activateViewport",this,t),t&&(this.context.viewport=t),this}_handleError(t,e,n){n.raiseError(e,"".concat(t," of ").concat(n))}_updateLayers(t,e){const n={};for(const s of t)n[s.id]?Iw.warn("Multiple old layers with same id ".concat(s.id))():n[s.id]=s;const i=[];this._updateSublayersRecursively(e,n,i),this._finalizeOldLayers(n);let r=!1;for(const s of i)if(s.hasUniformTransition()){r=!0;break}this._needsUpdate=r,this.layers=i}_updateSublayersRecursively(t,e,n){for(const r of t){r.context=this.context;const t=e[r.id];null===t&&Iw.warn("Multiple new layers with same id ".concat(r.id))(),e[r.id]=null;let s=null;try{this._debug&&t!==r&&r.validateProps(),t?(this._transferLayerState(t,r),this._updateLayer(r)):this._initializeLayer(r),n.push(r),s=r.isComposite&&r.getSubLayers()}catch(i){this._handleError("matching",i,r)}s&&this._updateSublayersRecursively(s,e,n)}}_finalizeOldLayers(t){for(const e in t){const n=t[e];n&&this._finalizeLayer(n)}}_initializeLayer(t){try{t._initialize(),t.lifecycle="Initialized"}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(t,e){e._transferState(t),e.lifecycle="Matched. State transferred from previous layer",e!==t&&(t.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle="No longer matched. Awaiting garbage collection";try{t._finalize(),t.lifecycle="Finalized! Awaiting garbage collection"}catch(e){this._handleError("finalization",e,t)}}}class eM{constructor(t={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(const t in this.controllers)this.controllers[t]&&this.controllers[t].finalize();this.controllers={}}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(const t in this.controllers){const e=this.controllers[t];e&&e.updateTransition()}}getViewports(t){return t?this._viewports.filter(e=>e.containsPixel(t)):this._viewports}getViews(){const t={};return this.views.forEach(e=>{t[e.id]=e}),t}getView(t){return"string"==typeof t?this.views.find(e=>e.id===t):t}getViewState(t){const e=this.getView(t),n=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(n):n}getViewport(t){return this._viewportMap[t]}unproject(t,e){const n=this.getViewports(),i={x:t[0],y:t[1]};for(let r=n.length-1;r>=0;--r){const s=n[r];if(s.containsPixel(i)){const n=t.slice();return n[0]-=s.x,n[1]-=s.y,s.unproject(n,e)}}return null}setProps(t){"views"in t&&this._setViews(t.views),"viewState"in t&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,e){(t!==this.width||e!==this.height)&&(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}_setViews(t){t=gE(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){t?(!zP(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):Iw.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(t,e){e.viewId=t,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(e)}_createController(t,e){return new(0,e.type)(bt({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>t._getViewport(e,{width:e.width,height:e.height})},e))}_updateController(t,e,n,i){let r=t.controller;return r?(r=ti(bt(bt(bt({},e),t.props),r),{id:t.id,x:n.x,y:n.y,width:n.width,height:n.height}),i?i.setProps(r):i=this._createController(t,r),i):null}_rebuildViewports(){const{width:t,height:e,views:n}=this,i=this.controllers;this._viewports=[],this.controllers={};let r=!1;for(let s=n.length;s--;){const o=n[s],a=this.getViewState(o),l=o.makeViewport({width:t,height:e,viewState:a});let c=i[o.id];o.controller&&!c&&(r=!0),(r||!o.controller)&&c&&(c.finalize(),c=null),this.controllers[o.id]=this._updateController(o,a,l,c),this._viewports.unshift(l)}for(const s in i)i[s]&&!this.controllers[s]&&i[s].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)})}_diffViews(t,e){return t.length!==e.length||t.some((n,i)=>!t[i].equals(e[i]))}}class nM extends sI{constructor({makeViewport:t,width:e,height:n,latitude:i,longitude:r,zoom:s,bearing:o=0,pitch:a=0,altitude:l=1.5,maxZoom:c=20,minZoom:u=0,maxPitch:h=60,minPitch:d=0,startPanLngLat:p,startZoomLngLat:f,startRotatePos:g,startBearing:m,startPitch:b,startZoom:y,normalize:v}={}){uE(Number.isFinite(r)),uE(Number.isFinite(i)),uE(Number.isFinite(s)),super({width:e,height:n,latitude:i,longitude:r,zoom:s,bearing:o,pitch:a,altitude:l,maxZoom:c,minZoom:u,maxPitch:h,minPitch:d,normalize:v}),this._state={startPanLngLat:p,startZoomLngLat:f,startRotatePos:g,startBearing:m,startPitch:b,startZoom:y},this.makeViewport=t}panStart({pos:t}){return this._getUpdatedState({startPanLngLat:this._unproject(t)})}pan({pos:t,startPos:e}){const n=this._state.startPanLngLat||this._unproject(e);if(!n)return this;const i=this.makeViewport(this._viewportProps).panByPosition(n,t);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){const{startRotatePos:i,startBearing:r,startPitch:s}=this._state;if(!i||!Number.isFinite(r)||!Number.isFinite(s))return this;let o;return o=t?this._calculateNewPitchAndBearing(ti(bt({},this._getRotationParams(t,i)),{startBearing:r,startPitch:s})):{bearing:r+e,pitch:s+n},this._getUpdatedState(o)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:t}){return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}zoom({pos:t,startPos:e,scale:n}){let{startZoom:i,startZoomLngLat:r}=this._state;Number.isFinite(i)||(i=this._viewportProps.zoom,r=this._unproject(e)||this._unproject(t));const s=this._calculateNewZoom({scale:n,startZoom:i}),o=this.makeViewport(ti(bt({},this._viewportProps),{zoom:s}));return this._getUpdatedState(bt({zoom:s},o.panByPosition(r,t)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(t=2){return this._zoomFromCenter(t)}zoomOut(t=2){return this._zoomFromCenter(1/t)}moveLeft(t=100){return this._panFromCenter([t,0])}moveRight(t=100){return this._panFromCenter([-t,0])}moveUp(t=100){return this._panFromCenter([0,t])}moveDown(t=100){return this._panFromCenter([0,-t])}rotateLeft(t=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-t})}rotateRight(t=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+t})}rotateUp(t=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+t})}rotateDown(t=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),n=bt({},this._viewportProps),{bearing:i,longitude:r}=n;return Math.abs(i-e.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-e.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}_zoomFromCenter(t){const{width:e,height:n}=this._viewportProps;return this.zoom({pos:[e/2,n/2],scale:t})}_panFromCenter(t){const{width:e,height:n}=this._viewportProps;return this.pan({startPos:[e/2,n/2],pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new this.constructor(bt(bt(bt({makeViewport:this.makeViewport},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i}=t;t.zoom=LS(i,n,e);const{maxPitch:r,minPitch:s,pitch:o}=t;t.pitch=LS(o,s,r);const{normalize:a=!0}=t;return a&&Object.assign(t,function({width:t,height:e,longitude:n,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(n<-180||n>180)&&(n=vT(n+180,360)-180),(o<-180||o>180)&&(o=vT(o+180,360)-180);const a=_T(e/512);if(r<=a)r=a,i=0;else{const t=e/2/Math.pow(2,r),n=kT([0,t])[1];if(ie&&(i=e)}}return{width:t,height:e,longitude:n,latitude:i,zoom:r,pitch:s,bearing:o}}(t)),t}_unproject(t){const e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}_calculateNewZoom({scale:t,startZoom:e}){const{maxZoom:n,minZoom:i}=this._viewportProps;return LS(e+Math.log2(t),i,n)}_calculateNewPitchAndBearing({deltaScaleX:t,deltaScaleY:e,startBearing:n,startPitch:i}){e=LS(e,-1,1);const{minPitch:r,maxPitch:s}=this._viewportProps;let o=i;return e>0?o=i+e*(s-i):e<0&&(o=i-e*(r-i)),{pitch:o,bearing:n+180*t}}_getRotationParams(t,e){const n=t[0]-e[0],i=t[1]-e[1],r=t[1],s=e[1],{width:o,height:a}=this._viewportProps,l=n/o;let c=0;return i>0?Math.abs(a-s)>5&&(c=i/(s-a)*1.2):i<0&&s>5&&(c=1-r/s),c=Math.min(1,Math.max(-1,c)),{deltaScaleX:l,deltaScaleY:c}}}class iM extends rI{constructor(t){t.dragMode=t.dragMode||"pan",super(nM,t)}setProps(t){const e=this.controllerStateProps;super.setProps(t),(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState(bt(bt({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let rM=(()=>{class t extends UP{constructor(t){super(ti(bt({},t),{type:qT}))}get controller(){return this._getControllerProps({type:iM})}}return t.displayName="MapView",t})();const sM=new $I;class oM{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(t){"effects"in t&&(t.effects.length!==this.effects.length||!zP(t.effects,this.effects))&&(this.setEffects(t.effects),this._needsRedraw="effects changed")}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(t=[]){this.cleanup(),this.effects=t,this._createInternalEffects()}cleanup(){for(const t of this.effects)t.cleanup();for(const t of this._internalEffects)t.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(t=>t instanceof $I)||this._internalEffects.push(sM)}}class aM extends kI{}const lM={blendFunc:[1,0,32771,0],blendEquation:32774};class cM extends kI{render(t){t.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(t)):(this.useAlpha=!1,super.render(t))}_drawPickingBuffer({layers:t,layerFilter:e,views:n,viewports:i,onViewportActive:r,pickingFBO:s,deviceRect:{x:o,y:a,width:l,height:c},pass:u="picking",redrawReason:h,pickZ:d}){const p=this.gl;return this.pickZ=d,vx(p,ti(bt({scissorTest:!0,scissor:[o,a,l,c],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},lM),{blend:!d}),()=>{super.render({target:s,layers:t,layerFilter:e,views:n,viewports:i,onViewportActive:r,pass:u,redrawReason:h})})}shouldDrawLayer(t){return t.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(t,e){const n=this.pickZ?{blend:!1}:ti(bt({},lM),{blend:!0,blendColor:[0,0,0,this.useAlpha?(e+1)/255:1]});return bt(bt({},t.props.parameters),n)}}class uM{constructor(t){this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new aM(t),this.pickLayersPass=new cM(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){"layerFilter"in t&&this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in t&&this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(t){const e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;t.layerFilter=this.layerFilter,t.effects=t.effects||[],t.target=t.target||SS.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);const n=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,i=e.render(ti(bt({},t),{target:n}));this._postRender(t.effects,t),this.renderCount++,PE("deckRenderer.renderLayers",this,i,t)}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}finalize(){const{renderBuffers:t}=this;for(const e of t)e.delete();t.length=0}_preRender(t,e){let n=null;for(const i of t)i.preRender(this.gl,e),i.postRender&&(n=i);n&&this._resizeRenderBuffers(),this.lastPostProcessEffect=n}_resizeRenderBuffers(){const{renderBuffers:t}=this;0===t.length&&t.push(new SS(this.gl),new SS(this.gl));for(const e of t)e.resize()}_postRender(t,e){const{renderBuffers:n}=this,i={inputBuffer:n[0],swapBuffer:n[1],target:null};for(const r of t)if(r.postRender){if(r===this.lastPostProcessEffect){i.target=e.target,r.postRender(this.gl,i);break}const t=r.postRender(this.gl,i);i.inputBuffer=t,i.swapBuffer=t===n[0]?n[1]:n[0]}}}const hM={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function dM({pickedColors:t,layers:e,deviceX:n,deviceY:i,deviceRadius:r,deviceRect:s}){if(t){const{x:o,y:a,width:l,height:c}=s;let u=r*r,h=-1,d=0;for(let e=0;eu)d+=4*l;else for(let e=0;e=0){const t=e+o-n,i=t*t+s;i<=u&&(u=i,h=d)}d+=4}}if(h>=0){const n=t[h+3]-1,i=t.slice(h,h+4),r=e[n];if(r){const t=r.decodePickingColor(i),e=Math.floor(h/4/l);return{pickedColor:i,pickedLayer:r,pickedObjectIndex:t,pickedX:o+(h/4-e*l),pickedY:a+e}}Iw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return hM}function pM({pickInfo:t,mode:e,viewports:n,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=t&&t.pickedLayer,c=function(t,e,n){for(let i=t.length-1;i>=0;i--){const r=t[i];if(r.containsPixel(e)&&(!n||n(r)))return r}return t[0]}(n,{x:s,y:o},i&&l&&(t=>i({layer:l,viewport:t,isPicking:!0,renderPass:"picking:".concat(e)}))),u=c&&c.unproject([s-c.x,o-c.y],{targetZ:a});return{color:null,layer:null,viewport:c,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:u,devicePixel:t&&[t.pickedX,t.pickedY],pixelRatio:r}}function fM(t){const{pickInfo:e,lastPickedInfo:n,mode:i,layers:r}=t,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const t=n.index,e=n.layerId,i=o&&o.props.id;if(i!==e||a!==t){if(i!==e){const t=r.find(t=>t.props.id===e);t&&l.unshift(t)}n.layerId=i,n.index=a,n.info=null}}const c=pM(t),u=new Map;return u.set(null,c),l.forEach(t=>{let e=bt({},c);t===o&&(e.color=s,e.index=a,e.picked=!0),e=gM({layer:t,info:e,mode:i}),t===o&&"hover"===i&&(n.info=e),u.set(e.layer.id,e),"hover"===i&&e.layer.updateAutoHighlight(e)}),u}function gM({layer:t,info:e,mode:n}){for(;t&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=t,e=t.getPickingInfo({info:e,mode:n,sourceLayer:i}),t=t.parent}return e}class mM{constructor(t){this.gl=t,this.pickingFBO=null,this.pickLayersPass=new cM(t),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject({x:t,y:e,layers:n,viewports:i},r=this.lastPickedInfo.info){const s=r&&r.layer&&r.layer.id,o=r&&r.viewport&&r.viewport.id,a=s?n.find(t=>t.id===s):null,l=o&&i.find(t=>t.id===o)||i[0],c=l&&l.unproject([t-l.x,e-l.y]),u={x:t,y:e,viewport:l,coordinate:c,layer:a};return a?bt(bt({},r),u):Object.assign(u,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:t}=this;return this.pickingFBO||(this.pickingFBO=new SS(t),SS.isSupported(t,{colorBufferFloat:!0})&&(this.depthFBO=new SS(t),this.depthFBO.attach({36064:new lS(t,{format:Fw(t)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.pickingFBO}_getPickable(t){if(!1===this._pickable)return null;const e=t.filter(t=>t.isPickable()&&!t.isComposite);return e.length>255?(Iw.warn("Too many pickable layers, only picking the first 255")(),e.slice(0,255)):e.length?e:null}_pickClosestObject({layers:t,views:e,viewports:n,x:i,y:r,radius:s=0,depth:o=1,mode:a="query",unproject3D:l,onViewportActive:c}){if(!(t=this._getPickable(t)))return{result:[],emptyInfo:pM({viewports:n,x:i,y:r})};this._resizeBuffer();const u=_x(this.gl),h=wx(this.gl,[i,r],!0),d=[h.x+Math.floor(h.width/2),h.y+Math.floor(h.height/2)],p=Math.round(s*u),{width:f,height:g}=this.pickingFBO,m=this._getPickingRect({deviceX:d[0],deviceY:d[1],deviceRadius:p,deviceWidth:f,deviceHeight:g});let b;const y=[],v={};for(let _=0;_=0){const s=t.slice(i,i+4),o=s.join(",");if(!n.has(o)){const t=e[r];t?n.set(o,{pickedColor:s,pickedLayer:t,pickedObjectIndex:t.decodePickingColor(s)}):Iw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}({pickedColors:this._drawAndSample({layers:t,views:e,viewports:n,onViewportActive:c,deviceRect:{x:d,y:g,width:f.x+f.width-d,height:p-g},pass:"picking:".concat(a),redrawReason:a}),layers:t}),b=new Map,y=Number.isFinite(l);for(let v=0;v=l);v++){const t=m[v];let e={color:t.pickedColor,layer:null,index:t.pickedObjectIndex,picked:!0,x:i,y:r,width:s,height:o,pixelRatio:u};e=gM({layer:t.pickedLayer,info:e,mode:a}),b.has(e.object)||b.set(e.object,e)}return Array.from(b.values())}_drawAndSample({layers:t,views:e,viewports:n,onViewportActive:i,deviceRect:r,pass:s,redrawReason:o,pickZ:a}){if(t.length<1)return null;const l=a?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:t,layerFilter:this.layerFilter,views:e,viewports:n,onViewportActive:i,pickingFBO:l,deviceRect:r,pass:s,redrawReason:o,pickZ:a});const{x:c,y:u,width:h,height:d}=r,p=new(a?Float32Array:Uint8Array)(h*d*4);return _S(l,{sourceX:c,sourceY:u,sourceWidth:h,sourceHeight:d,target:p}),p}_getPickingRect({deviceX:t,deviceY:e,deviceRadius:n,deviceWidth:i,deviceHeight:r}){const s=Math.max(0,t-n),o=Math.max(0,e-n),a=Math.min(i,t+n+1)-s,l=Math.min(r,e+n+1)-o;return a<=0||l<=0?null:{x:s,y:o,width:a,height:l}}}const bM={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class yM{constructor(t){const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,bM),e.appendChild(this.el)),this.isVisible=!1}setTooltip(t,e,n){const i=this.el;if("string"==typeof t)i.innerText=t;else{if(!t)return this.isVisible=!1,void(i.style.display="none");"text"in t&&(i.innerText=t.text),"html"in t&&(i.innerHTML=t.html),"className"in t&&(i.className=t.className),Object.assign(i.style,t.style)}this.isVisible=!0,i.style.display="block",i.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}remove(){this.el&&this.el.remove()}}function vM(t,e){if(!t)throw new Error(e)}const _M={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},wM=_M.global||_M.self||_M.window,xM="object"!=typeof process||"[object process]"!==String(process)||process.browser,SM="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:EM}=(SM&&parseFloat(SM[1]),wM),CM="undefined"!=typeof Image,OM="undefined"!=typeof ImageBitmap,TM=Boolean(EM),kM=!!xM||TM;function AM(t){const e=function(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}(t);if(!e)throw new Error("Not an image");return e}function PM(t){switch(AM(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}const IM=/^data:image\/svg\+xml/,MM=/\.svg((\?|#).*)?$/;function DM(t){return t&&(IM.test(t)||MM.test(t))}function RM(t,e){if(DM(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(e)}`}return NM(t,e)}function NM(t,e){if(DM(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function LM(t,e,n){return jM.apply(this,arguments)}function jM(){return(jM=gS(function*(t,e,n){const i=RM(t,n),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield FM(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function FM(t,e){return BM.apply(this,arguments)}function BM(){return(BM=gS(function*(t,e){const n=new Image;return n.src=t,e.image&&e.image.decode&&n.decode?(yield n.decode(),n):yield new Promise((e,i)=>{try{n.onload=()=>e(n),n.onerror=e=>i(new Error(`Could not load image ${t}: ${e}`))}catch(r){i(r)}})})).apply(this,arguments)}const VM={};let zM=!0;function UM(t,e,n){return HM.apply(this,arguments)}function HM(){return(HM=gS(function*(t,e,n){let i;i=DM(n)?yield LM(t,e,n):NM(t,n);const r=e&&e.imagebitmap;return yield $M(i,r)})).apply(this,arguments)}function $M(t){return GM.apply(this,arguments)}function GM(){return(GM=gS(function*(t,e=null){if((WM(e)||!zM)&&(e=null),e)try{return yield createImageBitmap(t,e)}catch(n){console.warn(n),zM=!1}return yield createImageBitmap(t)})).apply(this,arguments)}function WM(t){for(const e in t||VM)return!1;return!0}const qM=!1,XM=!0;function YM(t){const e=KM(t);return function(t){const e=KM(t);return e.byteLength>=24&&2303741511===e.getUint32(0,qM)?{mimeType:"image/png",width:e.getUint32(16,qM),height:e.getUint32(20,qM)}:null}(e)||function(t){const e=KM(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,qM)&&255===e.getUint8(2)))return null;const{tableMarkers:n,sofMarkers:i}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let r=2;for(;r+9=10&&1195984440===e.getUint32(0,qM)?{mimeType:"image/gif",width:e.getUint16(6,XM),height:e.getUint16(8,XM)}:null}(e)||function(t){const e=KM(t);return e.byteLength>=14&&16973===e.getUint16(0,qM)&&e.getUint32(2,XM)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,XM),height:e.getUint32(22,XM)}:null}(e)}function KM(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}function QM(t,e){const{mimeType:n}=YM(t)||{},{_parseImageNode:i}=wM;return vM(i),i(t,n,e)}function ZM(){return(ZM=gS(function*(t,e,n){const i=((e=e||{}).image||{}).type||"auto",{url:r}=n||{};let s;switch(JM(i)){case"imagebitmap":s=yield UM(t,e,r);break;case"image":s=yield LM(t,e,r);break;case"data":s=yield QM(t,e);break;default:vM(!1)}return"data"===i&&(s=PM(s)),s})).apply(this,arguments)}function JM(t){switch(t){case"auto":case"data":return function(){if(OM)return"imagebitmap";if(CM)return"image";if(kM)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return OM||CM||kM;case"imagebitmap":return OM;case"image":return CM;case"data":return kM;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}const tD={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(t,e,n){return ZM.apply(this,arguments)},tests:[t=>Boolean(YM(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};var eD={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){const e=t[0],n=t[t.length-1];return"{"===e&&"}"===n||"["===e&&"]"===n},parseTextSync:JSON.parse};const nD="8.5.8",iD=zw.CO.deck&&zw.CO.deck.VERSION;if(iD&&iD!==nD)throw new Error("deck.gl - multiple versions detected: ".concat(iD," vs ").concat(nD));iD||(Iw.log(1,"deck.gl ".concat(nD))(),zw.CO.deck=Object.assign(zw.CO.deck||{},{VERSION:nD,version:nD,log:Iw,_registerLoggers:function(t){AE=t}}),fP([eD,[tD,{imagebitmap:{premultiplyAlpha:"none"}}]]));var rD=zw.CO.deck;class sD extends Hx{static isSupported(t,e=[]){const n=Fw(t),i=OS(t,"TIMER_QUERY");let r=n||i;for(const s of e)switch(s){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Rx(!1)}return r}constructor(t,e={}){super(t,e),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:t=!1}={}){return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(t=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise((n,i)=>{const r=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):e++>t?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(r)};requestAnimationFrame(r)}),this._pollingPromise}_createHandle(){return sD.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const oD=(0,zw.jU)()&&"undefined"!=typeof document;let aD=0;class lD{constructor(t={}){const{onCreateContext:e=(t=>Tx(t)),onAddHTML:n=null,onInitialize:i=(()=>{}),onRender:r=(()=>{}),onFinalize:s=(()=>{}),onError:o,gl:a=null,glOptions:l={},debug:c=!1,createFramebuffer:u=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:d=!0,stats:p=Dx.get("animation-loop-"+aD++)}=t;let{useDevicePixels:f=!0}=t;"useDevicePixelRatio"in t&&(Nw.deprecated("useDevicePixelRatio","useDevicePixels")(),f=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:n,onInitialize:i,onRender:r,onFinalize:s,onError:o,gl:a,glOptions:l,debug:c,createFramebuffer:u},this.gl=a,this.needsRedraw=null,this.timeline=null,this.stats=p,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:d,useDevicePixels:f}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return Rx("string"==typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(t={}){if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=sD.isSupported(this.gl,["timers"])?new sD(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())});return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(t=>{this._resolveNextFrame=t})),this._nextFramePromise}toDataURL(){var t=this;return gS(function*(){return t.setNeedsRedraw("toDataURL"),yield t.waitForRender(),t.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...t){return this.props.onCreateContext(...t)}onInitialize(...t){return this.props.onInitialize(...t)}onRender(...t){return this.props.onRender(...t)}onFinalize(...t){return this.props.onFinalize(...t)}getHTMLControlValue(t,e=1){const n=document.getElementById(t);return n?Number(n.value):e}setViewParameters(){return Nw.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=oD?new Promise((t,e)=>{oD&&"complete"===document.readyState?t(document):window.addEventListener("load",()=>{t(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}(t)}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}(t)}_renderFrame(...t){this.display?this.display._renderFrame(...t):this.onRender(...t)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:n}=this._getSizeAndAspect();(t!==this.animationProps.width||e!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),n!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=n,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"==typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!=typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?kx(this.props.gl,t):this.onCreateContext(t),!jw(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(t){yx(t,tx)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const n=this.props.onAddHTML(e);n&&(e.innerHTML=n)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let n=1;const{canvas:i}=this.gl;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:t>0&&e>0&&(n=t/e),{width:t,height:e,aspect:n}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(t,e={}){if(t.canvas)return void function(t,e,n){let i="width"in n?n.width:t.canvas.clientWidth,r="height"in n?n.height:t.canvas.clientHeight;(!i||!r)&&(Nw.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=t.canvas.width||1,r=t.canvas.height||1),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};const s=t.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let n=e;const s=Math.floor(i*n),o=Math.floor(r*n);t.canvas.width=s,t.canvas.height=o,(t.drawingBufferWidth!==s||t.drawingBufferHeight!==o)&&(Nw.warn("Device pixel ratio clamped")(),n=Math.min(t.drawingBufferWidth/i,t.drawingBufferHeight/r),t.canvas.width=Math.floor(i*n),t.canvas.height=Math.floor(r*n)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(t,function(t){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e);const n=t.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in e&&"height"in e&&n.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new SS(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}var cD=n(11524),uD=n.n(cD);const hD={mousedown:1,mousemove:2,mouseup:4};(function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const n=this.store;t.button>0&&"pointerdown"===t.type&&(function(e,n){for(let i=0;i=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(uD().MouseInput);const dD=uD().Manager;var pD=uD();const fD=pD?[[pD.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[pD.Rotate,{enable:!1}],[pD.Pinch,{enable:!1}],[pD.Swipe,{enable:!1}],[pD.Pan,{threshold:0,enable:!1}],[pD.Press,{enable:!1}],[pD.Tap,{event:"doubletap",taps:2,enable:!1}],[pD.Tap,{event:"anytap",enable:!1}],[pD.Tap,{enable:!1}]]:null,gD={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},mD={doubletap:["tap"]},bD={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},yD={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},vD={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},_D={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},wD="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",xD="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let SD=!1;try{const t={get passive(){return SD=!0,!0}};xD.addEventListener("test",t,t),xD.removeEventListener("test",t,t)}catch(m){}const ED=-1!==wD.indexOf("firefox"),{WHEEL_EVENTS:CD}=yD,OD=4.000244140625;class TD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.events=CD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!SD&&{passive:!1}))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){"wheel"===t&&(this.options.enable=e)}handleEvent(t){if(!this.options.enable)return;let e=t.deltaY;xD.WheelEvent&&(ED&&t.deltaMode===xD.WheelEvent.DOM_DELTA_PIXEL&&(e/=xD.devicePixelRatio),t.deltaMode===xD.WheelEvent.DOM_DELTA_LINE&&(e*=40));const n={x:t.clientX,y:t.clientY};0!==e&&e%OD==0&&(e=Math.floor(e/OD)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}_onWheel(t,e,n){this.callback({type:"wheel",center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}const{MOUSE_EVENTS:kD}=yD,AD="pointermove",PD="pointerover",ID="pointerout",MD="pointerleave";class DD{constructor(t,e,n={}){this.element=t,this.callback=e,this.pressed=!1,this.options=Object.assign({enable:!0},n),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=kD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){t===AD&&(this.enableMoveEvent=e),t===PD&&(this.enableOverEvent=e),t===ID&&(this.enableOutEvent=e),t===MD&&(this.enableLeaveEvent=e)}handleEvent(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:PD,srcEvent:t,pointerType:"mouse",target:t.target})}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:ID,srcEvent:t,pointerType:"mouse",target:t.target})}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:MD,srcEvent:t,pointerType:"mouse",target:t.target})}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:AD,srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:RD}=yD,ND="keydown";class LD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=RD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=n.tabIndex||0,t.style.outline="none",this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){t===ND&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}handleEvent(t){const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:ND,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}const jD="contextmenu";class FD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===jD&&(this.options.enable=e)}handleEvent(t){!this.options.enable||this.callback({type:jD,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}const BD={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},VD={srcElement:"root",priority:0};class zD{constructor(t){this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(t,e,n,i=!1,r=!1){const{handlers:s,handlersByElement:o}=this;n&&("object"!=typeof n||n.addEventListener)&&(n={srcElement:n}),n=n?Object.assign({},VD,n):VD;let a=o.get(n.srcElement);a||(a=[],o.set(n.srcElement,a));const l={type:t,handler:e,srcElement:n.srcElement,priority:n.priority};i&&(l.once=!0),r&&(l.passive=!0),s.push(l),this._active=this._active||!l.passive;let c=a.length-1;for(;c>=0&&!(a[c].priority>=l.priority);)c--;a.splice(c+1,0,l)}remove(t,e){const{handlers:n,handlersByElement:i}=this;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.type===t&&s.handler===e){n.splice(r,1);const t=i.get(s.srcElement);t.splice(t.indexOf(s),1),0===t.length&&i.delete(s.srcElement)}}this._active=n.some(t=>!t.passive)}handleEvent(t){if(this.isEmpty())return;const e=this._normalizeEvent(t);let n=t.srcEvent.target;for(;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")}_emit(t,e){const n=this.handlersByElement.get(e);if(n){let e=!1;const i=()=>{t.handled=!0},r=()=>{t.handled=!0,e=!0},s=[];for(let o=0;o{const e=this.manager.get(t);e&&gD[t].forEach(t=>{e.recognizeWith(t)})});for(const n in e.recognizerOptions){const t=this.manager.get(n);if(t){const i=e.recognizerOptions[n];delete i.enable,t.set(i)}}this.wheelInput=new TD(t,this._onOtherEvent,{enable:!1}),this.moveInput=new DD(t,this._onOtherEvent,{enable:!1}),this.keyInput=new LD(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new FD(t,this._onOtherEvent,{enable:!1});for(const[n,i]of this.events)i.isEmpty()||(this._toggleRecognizer(i.recognizerName,!0),this.manager.on(n,i.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,n){this._addEventHandler(t,e,n,!1)}once(t,e,n){this._addEventHandler(t,e,n,!0)}watch(t,e,n){this._addEventHandler(t,e,n,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:n}=this;if(!n)return;const i=n.get(t);if(i&&i.options.enable!==e){i.set({enable:e});const r=mD[t];r&&!this.options.recognizers&&r.forEach(r=>{const s=n.get(r);e?(s.requireFailure(t),i.dropRequireFailure(r)):s.dropRequireFailure(t)})}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,n,i,r){if("string"!=typeof t){n=e;for(const e in t)this._addEventHandler(e,t[e],n,i,r);return}const{manager:s,events:o}=this,a=_D[t]||t;let l=o.get(a);l||(l=new zD(this),o.set(a,l),l.recognizerName=vD[a]||a,s&&s.on(a,l.handleEvent)),l.add(t,e,n,i,r),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:n}=this,i=n.get(_D[t]||t);if(i&&(i.remove(t,e),i.isEmpty())){const{recognizerName:t}=i;let e=!1;for(const i of n.values())if(i.recognizerName===t&&!i.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}_onBasicInput(t){const{srcEvent:e}=t,n=bD[e.type];n&&this.manager.emit(n,t)}_onOtherEvent(t){this.manager.emit(t.type,t)}}function $D(){}const GD={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:$D,onResize:$D,onViewStateChange:$D,onInteractionStateChange:$D,onBeforeRender:$D,onAfterRender:$D,onLoad:$D,onError:(t,e)=>Iw.error(t)(),_onMetrics:null,getCursor:({isDragging:t})=>t?"grabbing":"grab",debug:!1,drawPickingColors:!1};class WD{constructor(t){t=bt(bt({},GD),t),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),t.viewState&&t.initialViewState&&Iw.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,zw.qs)()&&Iw.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new Ix({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&AS.setProps(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&Iw.removed("onLayerHover","onHover")(),"onLayerClick"in t&&Iw.removed("onLayerClick","onClick")(),t.initialViewState&&!zP(this.props.initialViewState,t.initialViewState)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);const e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(t={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);const n=this.viewManager.needsRedraw(t),i=this.layerManager.needsRedraw(t),r=this.effectManager.needsRedraw(t),s=this.deckRenderer.needsRedraw(t);return e=e||n||i||r||s,e}redraw(t){if(!this.layerManager)return;const e=t||this.needsRedraw({clearRedrawFlags:!0});!e||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}getViews(){return this.viewManager.views}getViewports(t){return this.viewManager.getViewports(t)}pickObject(t){const e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}pickObjects(t){return this._pick("pickObjects","pickObjects Time",t)}_addResources(t,e=!1){for(const n in t)this.layerManager.resourceManager.add({resourceId:n,data:t[n],forceUpdate:e})}_removeResources(t){for(const e of t)this.layerManager.resourceManager.remove(e)}_pick(t,e,n){const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(e).timeStart();const r=this.deckPicker[t](bt({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport},n));return i.get(e).timeEnd(),r}_createCanvas(t){let e=t.canvas;return"string"==typeof e&&(e=document.getElementById(e),uE(e)),e||(e=document.createElement("canvas"),e.id=t.id||"deckgl-overlay",(t.parent||document.body).appendChild(e)),Object.assign(e.style,t.style),e}_setCanvasSize(t){if(!this.canvas)return;let{width:e,height:n}=t;(e||0===e)&&(e=Number.isFinite(e)?"".concat(e,"px"):e,this.canvas.style.width=e),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:t,height:e}=this;this.viewManager.setProps({width:t,height:e}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:t}=this;if(!t)return!1;const e=t.clientWidth||t.width,n=t.clientHeight||t.height;return(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,!0)}_createAnimationLoop(t){const{width:e,height:n,gl:i,glOptions:r,debug:s,onError:o,onBeforeRender:a,onAfterRender:l,useDevicePixels:c,autoResizeDrawingBuffer:u}=t;return new lD({width:e,height:n,useDevicePixels:c,autoResizeDrawingBuffer:u,autoResizeViewport:!1,gl:i,onCreateContext:t=>Tx(ti(bt(bt({},r),t),{canvas:this.canvas,debug:s,onContextLost:()=>this._onContextLost()})),onInitialize:t=>this._setGLContext(t.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:a,onAfterRender:l,onError:o})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let t=this.props.views||[new rM({id:"default-view"})];return t=Array.isArray(t)?t:[t],t.length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}_onContextLost(){const{onError:t}=this.props;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}_onPointerMove(t){const{_pickRequest:e}=this;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;{const n=t.offsetCenter;if(!n)return;e.x=n.x,e.y=n.y,e.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t,e.mode="hover"}_pickAndCallback(){const{_pickRequest:t}=this;if(t.event){const{result:e,emptyInfo:n}=this._pick("pickObject","pickObject Time",t);this.interactiveState.isHovering=e.length>0;let i=n,r=!1;for(const s of e)i=s,r=s.layer.onHover(s,t.event);if(!r&&this.props.onHover&&this.props.onHover(i,t.event),this.props.getTooltip){const t=this.props.getTooltip(i);this.tooltip.setTooltip(t,i.x,i.y)}t.event=null}}_updateCursor(){const t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(t){if(this.layerManager)return;this.canvas||(this.canvas=t.canvas,kx(t,{enable:!0,copyState:!0})),this.tooltip=new yM(this.canvas),yx(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new qI;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new HD(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const i in Rw)this.eventManager.on(i,this._onEvent);this.viewManager=new eM({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const n=this.viewManager.getViewports()[0];this.layerManager=new tM(t,{deck:this,stats:this.stats,viewport:n,timeline:e}),this.effectManager=new oM,this.deckRenderer=new uM(t),this.deckPicker=new mM(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:n}=this.layerManager.context;yx(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(bt({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:t,effects:this.effectManager.getEffects()},e)),this.props.onAfterRender({gl:n})}_onRenderFrame(t){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Iw.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){const e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState=ti(bt({},this.viewState),{[t.viewId]:e}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.interactiveState.isDragging=t.isDragging,this.props.onInteractionStateChange(t)}_onEvent(t){const e=Rw[t.type],n=t.offsetCenter;if(!e||!n)return;const i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),{layer:s}=r,o=s&&(s[e.handler]||s.props[e.handler]),a=this.props[e.handler];let l=!1;o&&(l=o.call(s,r,t)),!l&&a&&a(r,t)}_onPointerDown(t){const e=t.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:e.x,y:e.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:t}=this;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();const e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:t,stats:e}=this;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();const n=Dx.get("Memory Usage");t.bufferMemory=n.get("Buffer Memory").count,t.textureMemory=n.get("Texture Memory").count,t.renderbufferMemory=n.get("Renderbuffer Memory").count,t.gpuMemory=n.get("GPU Memory").count}}WD.getPropTypes=function(t){return{id:t.string,width:t.oneOfType([t.number,t.string]),height:t.oneOfType([t.number,t.string]),layers:t.oneOfType([t.object,t.array]),layerFilter:t.func,views:t.oneOfType([t.object,t.array]),viewState:t.object,effects:t.arrayOf(t.instanceOf(TI)),controller:t.oneOfType([t.func,t.bool,t.object]),gl:t.object,glOptions:t.object,parameters:t.object,pickingRadius:t.number,useDevicePixels:t.oneOfType([t.bool,t.number]),touchAction:t.string,eventRecognizerOptions:t.object,onWebGLInitialized:t.func,onResize:t.func,onViewStateChange:t.func,onInteractionStateChange:t.func,onBeforeRender:t.func,onAfterRender:t.func,onLoad:t.func,onError:t.func,debug:t.bool,drawPickingColors:t.bool,_framebuffer:t.object,_animate:t.bool,_pickable:t.bool,_typedArrayManagerProps:t.object}},WD.defaultProps=GD,WD.VERSION=rD.VERSION;var qD={name:"project32",dependencies:[NI],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},XD="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n";const YD={lightSources:{}};function KD({color:t=[0,0,0],intensity:e=1}={}){return t.map(t=>t*e/255)}const QD={name:"lights",vs:XD,fs:XD,getUniforms:function t(e=YD){if("lightSources"in e){const{ambientLight:t,pointLights:n,directionalLights:i}=e.lightSources||{};return t||n&&n.length>0||i&&i.length>0?Object.assign({},function({ambientLight:t,pointLights:e=[],directionalLights:n=[]}){const i={};return i["lighting_uAmbientLight.color"]=t?KD(t):[0,0,0],e.forEach((t,e)=>{i[`lighting_uPointLight[${e}].color`]=KD(t),i[`lighting_uPointLight[${e}].position`]=t.position,i[`lighting_uPointLight[${e}].attenuation`]=t.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,n.forEach((t,e)=>{i[`lighting_uDirectionalLight[${e}].color`]=KD(t),i[`lighting_uDirectionalLight[${e}].direction`]=t.direction}),i.lighting_uDirectionalLightCount=n.length,i}({ambientLight:t,pointLights:n,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const n={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":n.ambientLight=t;break;case"directional":n.directionalLights.push(t);break;case"point":n.pointLights.push(t)}return t({lightSources:n})}return{}},defines:{MAX_LIGHTS:3}};const ZD={};const JD={name:"phong-lighting",dependencies:[QD],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(t=ZD){if(!("material"in t))return{};const{material:e}=t;return e?function(t){const{ambient:e=.35,diffuse:n=.6,shininess:i=32,specularColor:r=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:n,lighting_uShininess:i,lighting_uSpecularColor:r.map(t=>t/255)}}(e):{lighting_uEnabled:!1}}},tR={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};var eR=bt({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(t=tR){const e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){const n=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=n}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){const n=Array.from(t.pickingHighlightColor,t=>t/255);Number.isFinite(n[3])||(n[3]=1),e.picking_uHighlightColor=n}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}});const nR={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class iR{static get DRAW_MODE(){return nR}constructor(t={}){const{id:e=Fx("geometry"),drawMode:n=nR.TRIANGLES,attributes:i={},indices:r=null,vertexCount:s=null}=t;this.id=e,this.drawMode=0|n,this.attributes={},this.userData={},this._setAttributes(i,r),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?bt({indices:this.indices},this.attributes):this.attributes}_print(t){return`Geometry ${this.id} attribute ${t}`}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const n in t){let e=t[n];e=ArrayBuffer.isView(e)?{value:e}:e,Rx(ArrayBuffer.isView(e.value),`${this._print(n)}: must be typed array or object with value as typed array`),("POSITION"===n||"positions"===n)&&!e.size&&(e.size=3),"indices"===n?(Rx(!this.indices),this.indices=e):this.attributes[n]=e}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(t,e){if(e)return e.value.length;let n=1/0;for(const i in t){const e=t[i],{value:r,size:s,constant:o}=e;!o&&r&&s>=1&&(n=Math.min(n,r.length/s))}return Rx(Number.isFinite(n)),n}}const rR=Math.PI/180,sR=new Float32Array(16),oR=new Float32Array(12);function aR(t,e,n){const i=e[0]*rR,r=e[1]*rR,s=e[2]*rR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),d=n[0],p=n[1],f=n[2];t[0]=d*h*u,t[1]=d*l*u,t[2]=d*-a,t[3]=p*(-l*c+h*a*o),t[4]=p*(h*c+l*a*o),t[5]=p*u*o,t[6]=f*(l*o+h*a*c),t[7]=f*(-h*o+l*a*c),t[8]=f*u*c}function lR(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}const cR={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(t,{startRow:e,endRow:n}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,u=Array.isArray(s),h=Array.isArray(r),d=Array.isArray(o),p=c||!l&&Boolean(a(i[0]));t.constant=p?c:h&&u&&d;const f=t.value;if(t.constant){let e;p?(sR.set(a),e=lR(sR)):(e=oR,aR(e,r,s),e.set(o,9)),t.value=new Float32Array(e)}else{let l=e*t.size;const{iterable:g,objectInfo:m}=pE(i,e,n);for(const t of g){let e;m.index++,p?(sR.set(c?a:a(t,m)),e=lR(sR)):(e=oR,aR(e,h?r:r(t,m),u?s:s(t,m)),e.set(d?o:o(t,m),9)),f[l++]=e[0],f[l++]=e[1],f[l++]=e[2],f[l++]=e[3],f[l++]=e[4],f[l++]=e[5],f[l++]=e[6],f[l++]=e[7],f[l++]=e[8],f[l++]=e[9],f[l++]=e[10],f[l++]=e[11]}}}};function uR(t,e){return e===Mw.CARTESIAN||e===Mw.METER_OFFSETS||e===Mw.DEFAULT&&!t.isGeospatial}function hR(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),Iw.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function dR(t,e){if(t.attributes)return hR(t.attributes,e),t instanceof iR?t:new iR(t);if(t.positions||t.POSITION)return hR(t,e),new iR({attributes:t});throw Error("Invalid mesh")}const pR={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let fR=(()=>{class t extends LP{getShaders(){const t=!Fw(this.context.gl),e={};return CS(this.context.gl,"GLSL_DERIVATIVES")&&(e.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[qD,JD,eR],transpileToGLSL100:t,defines:e})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:cR}),this.setState({emptyTexture:new lS(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:e,changeFlags:n}){if(super.updateState({props:t,oldProps:e,changeFlags:n}),t.mesh!==e.mesh||n.extensionsChanged){var i;if(null===(i=this.state.model)||void 0===i||i.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const e=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(e.NORMAL||e.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==e.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:e}=this.context,{sizeScale:n,coordinateSystem:i,_instanced:r}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:n,composeModelMatrix:!r||uR(e,i),flatShading:!this.state.hasNormals}).draw()}getModel(t){const e=new xO(this.context.gl,ti(bt({},this.getShaders()),{id:this.props.id,geometry:dR(t,this.props._useMeshColors),isInstanced:!0})),{texture:n}=this.props,{emptyTexture:i}=this.state;return e.setUniforms({sampler:n||i,hasTexture:Boolean(n)}),e}setTexture(t){const{emptyTexture:e,model:n}=this.state;null==n||n.setUniforms({sampler:t||e,hasTexture:Boolean(t)})}}return t.layerName="SimpleMeshLayer",t.defaultProps=pR,t})();const gR={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[QD]};class mR{constructor(t={}){const{id:e}=t;this.id=e||Fx(this.constructor.name),this.display=!0,this.position=new nE,this.rotation=new nE,this.scale=new nE(1,1,1),this.matrix=new bT,this.userData={},this.props={},this._setScenegraphNodeProps(t)}delete(){}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(t){return Rx(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return Rx(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return Rx(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t,e=!0){e?this.matrix.copy(t):this.matrix=t}setMatrixComponents({position:t,rotation:e,scale:n,update:i=!0}){return t&&this.setPosition(t),e&&this.setRotation(e),n&&this.setScale(n),i&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(n),this}update(t={}){const{position:e,rotation:n,scale:i}=t;return e&&this.setPosition(e),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}getCoordinateUniforms(t,e){Rx(t),e=e||this.matrix;const n=new bT(t).multiplyRight(e),i=n.invert(),r=i.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}class bR extends mR{constructor(t={}){t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;Nw.assert(e.every(t=>t instanceof mR),"every child must an instance of ScenegraphNode"),super(t),this.children=e}add(...t){for(const e of t)Array.isArray(e)?this.add(...e):this.children.push(e);return this}remove(t){const e=this.children,n=e.indexOf(t);return n>-1&&e.splice(n,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(t=>t.delete()),this.removeAll(),super.delete()}traverse(t,{worldMatrix:e=new bT}={}){const n=new bT(e).multiplyRight(this.matrix);for(const i of this.children)i instanceof bR?i.traverse(t,{worldMatrix:n}):t(i,{worldMatrix:n})}}function yR(){var t=new qS(4);return qS!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function vR(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function _R(t,e,n){var i=e[0],r=e[1],s=e[2],o=e[3],a=n[0],l=n[1],c=n[2],u=n[3];return t[0]=i*u+o*a+r*c-s*l,t[1]=r*u+o*l+s*a-i*c,t[2]=s*u+o*c+i*l-r*a,t[3]=o*u-i*a-r*l-s*c,t}var wR=tT,xR=function(){var t=XS(),e=YS(1,0,0),n=YS(0,1,0);return function(i,r,s){var o=KS(r,s);return o<-.999999?(QS(t,e,r),function(t){return Math.hypot(t[0],t[1],t[2])}(t)<1e-6&&QS(t,n,r),function(t,e){var n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s}(t,t),vR(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(QS(t,r,s),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=n*n+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=i*o,t[2]=r*o,t[3]=s*o,t}(i,i))}}();yR(),yR(),function(){var t=new qS(9);qS!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1}();const SR=[0,0,0,1],ER={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},CR={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function OR(t){if(!t._animation){const e=CR[t.componentType],n=ER[t.type],i=n*t.count,{buffer:r,byteOffset:s}=t.bufferView.data,o=new e(r,s+(t.byteOffset||0),i);if(1===n)t._animation=Array.from(o);else{const e=[];for(let t=0;t0)n=Math.sqrt(i+1),t[3]=.5*n,t[0]=(e[5]-e[7])*(n=.5/n),t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),t[r]=.5*n,t[3]=(e[3*s+o]-e[3*o+s])*(n=.5/n),t[s]=(e[3*s+r]+e[3*r+s])*n,t[o]=(e[3*o+r]+e[3*r+o])*n}}(this,t),this.check()}identity(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this),this.check()}fromAxisRotation(t,e){return vR(this,t,e),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=zS(t)}get y(){return this[1]}set y(t){this[1]=zS(t)}get z(){return this[2]}set z(t){this[2]=zS(t)}get w(){return this[3]}set w(t){this[3]=zS(t)}len(){return function(t){return Math.hypot(t[0],t[1],t[2],t[3])}(this)}lengthSquared(){return function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}(this)}dot(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}(this,t)}rotationTo(t,e){return xR(this,t,e),this.check()}add(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return function(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3]}(this,this,t),this.check()}calculateW(){return function(t,e){var n=e[0],i=e[1],r=e[2];t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r))}(this,this),this.check()}conjugate(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this,this),this.check()}invert(){return function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=n*n+i*i+r*r+s*s,a=o?1/o:0;t[0]=-n*a,t[1]=-i*a,t[2]=-r*a,t[3]=s*a}(this,this),this.check()}lerp(t,e,n){return function(t,e,n,i){var r=e[0],s=e[1],o=e[2],a=e[3];t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=o+i*(n[2]-o),t[3]=a+i*(n[3]-a)}(this,t,e,n),this.check()}multiplyRight(t,e){return BS(!e),_R(this,this,t),this.check()}multiplyLeft(t,e){return BS(!e),_R(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+o*a,t[1]=r*l+s*a,t[2]=s*l-r*a,t[3]=o*l-i*a}(this,this,t),this.check()}rotateY(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l-s*a,t[1]=r*l+o*a,t[2]=s*l+i*a,t[3]=o*l-r*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+r*a,t[1]=r*l-i*a,t[2]=s*l+o*a,t[3]=o*l-s*a}(this,this,t),this.check()}scale(t){return wR(this,this,t),this.check()}slerp(t,e,n){switch(arguments.length){case 1:({start:t=SR,target:e,ratio:n}=arguments[0]);break;case 2:[e,n]=arguments,t=this}return function(t,e,n,i){var r,s,o,a,l,c=e[0],u=e[1],h=e[2],d=e[3],p=n[0],f=n[1],g=n[2],m=n[3];(s=c*p+u*f+h*g+d*m)<0&&(s=-s,p=-p,f=-f,g=-g,m=-m),1-s>WS?(r=Math.acos(s),o=Math.sin(r),a=Math.sin((1-i)*r)/o,l=Math.sin(i*r)/o):(a=1-i,l=i),t[0]=a*c+l*p,t[1]=a*u+l*f,t[2]=a*h+l*g,t[3]=a*d+l*m}(this,t,e,n),this.check()}transformVector4(t,e=t){return function(t,e,n){var i=e[0],r=e[1],s=e[2],o=n[0],a=n[1],l=n[2],c=n[3],u=c*i+a*s-l*r,h=c*r+l*i-o*s,d=c*s+o*r-a*i,p=-o*i-a*r-l*s;t[0]=u*c+p*-o+h*-l-d*-a,t[1]=h*c+p*-a+d*-o-u*-l,t[2]=d*c+p*-l+u*-a-h*-o,t[3]=e[3]}(e,t,this),US(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t,e){return this.multiplyLeft(t,e)}multiply(t,e){return this.multiplyRight(t,e)}};class AR{constructor(t){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:t,target:n,path:i})=>{(function(t,{input:e,interpolation:n,output:i},r,s){const o=t%e[e.length-1],a=e.findIndex(t=>t>=o),l=Math.max(0,a-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:Nw.warn(`Bad animation path ${s}`)()}Rx(r[s].length===i[l].length);const c=e[l],u=e[a];switch(n){case"STEP":!function(t,e,n){for(let i=0;ic&&function(t,e,n,i,r){if("rotation"===e){kR.slerp({start:n,target:i,ratio:r});for(let n=0;nc&&function(t,e,{p0:n,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const i=e.name||`Animation-${n}`,r=e.samplers.map(({input:e,interpolation:n="LINEAR",output:i})=>({input:OR(t.accessors[e]),interpolation:n,output:OR(t.accessors[i])})),s=e.channels.map(({sampler:e,target:n})=>({sampler:r[e],target:t.nodes[n.node],path:n.path}));return new AR({name:i,channels:s})})}animate(t){this.setTime(t)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}class IR extends mR{constructor(t,e={}){super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof xO?(this.model=t,this._setModelNodeProps(e)):this.model=new xO(t,e),this.managedResources=e.managedResources||[]}setProps(t){return super.setProps(t),this._setModelNodeProps(t),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(t=>t.delete()),this.managedResources=[]}draw(...t){return this.model.draw(...t)}setUniforms(...t){return this.model.setUniforms(...t),this}setAttributes(...t){return this.model.setAttributes(...t),this}updateModuleSettings(...t){return this.model.updateModuleSettings(...t),this}_setModelNodeProps(t){this.model.setProps(t)}}class MR{constructor(t,{attributes:e,material:n,pbrDebug:i,imageBasedLightingEnvironment:r,lights:s,useTangents:o}){this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},CS(t,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],r&&(this.uniforms.u_DiffuseEnvSampler=r.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=r.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=r.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),i&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(e.NORMAL,"HAS_NORMALS"),this.defineIfPresent(e.TANGENT&&o,"HAS_TANGENTS"),this.defineIfPresent(e.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(r,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(i,"PBR_DEBUG"),n&&this.parseMaterial(n)}defineIfPresent(t,e){t&&(this.defines[e]=1)}parseTexture(t,e,n=null){const i=t.texture.source.image;let r,s={};i.compressed?(r=i,s={[this.gl.TEXTURE_MIN_FILTER]:i.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):r={data:i};const o=new lS(this.gl,bt({id:t.name||t.id,parameters:bt(bt({},t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{}),s),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},r));this.uniforms[e]=o,this.defineIfPresent(n,n),this.generatedTextures.push(o)}parsePbrMetallicRoughness(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:e=1,roughnessFactor:n=1}=t;this.uniforms.u_MetallicRoughnessValues=[e,n]}parseMaterial(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:e=1}=t.normalTexture;this.uniforms.u_NormalScale=e}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:e=1}=t.occlusionTexture;this.uniforms.u_OcclusionStrength=e}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){const{alphaCutoff:e=.5}=t;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=e}else"BLEND"===t.alphaMode&&(Nw.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function DR(t,e){return Fw(t)?`#version 300 es\n${e}`:e}const RR={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},NR={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class LR{constructor(t,e={}){this.gl=t,this.options=Object.assign({},NR,e)}instantiate(t){return this.gltf=t,(t.scenes||[]).map(t=>this.createScene(t))}createAnimator(){return Array.isArray(this.gltf.animations)?new PR(this.gltf):null}createScene(t){const e=(t.nodes||[]).map(t=>this.createNode(t));return new bR({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map(t=>this.createNode(t));t.mesh&&e.push(this.createMesh(t.mesh));const n=new bR({id:t.name||t.id,children:e});if(t.matrix)n.setMatrix(t.matrix);else{if(n.matrix.identity(),t.translation&&n.matrix.translate(t.translation),t.rotation){const e=(new bT).fromQuaternion(t.rotation);n.matrix.multiplyRight(e)}t.scale&&n.matrix.scale(t.scale)}t._node=n}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map((e,n)=>this.createPrimitive(e,n,t)),n=new bR({id:t.name||t.id,children:e});t._mesh=n}return t._mesh}getVertexCount(t){Nw.warn("getVertexCount() not found")()}createPrimitive(t,e,n){return function(t,e){const{id:n,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new MR(t,e);Nw.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(t=>t.buffer));const c=new IR(t,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[gR],defines:a.defines,parameters:a.parameters,vs:DR(t,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:DR(t,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:t.name||`${n.name||n.id}-primitive-${e}`,drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options))}createAttributes(t,e){const n={};return Object.keys(t).forEach(e=>{n[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))}),e&&(n.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),Nw.info(4,"glTF Attributes",{attributes:t,indices:e,generated:n})(),n}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:n}=t;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[e]||(n.lumaBuffers[e]=new tS(this.gl,{id:`from-${n.id}`,data:n.data||t.value,target:e})),n.lumaBuffers[e]}createAccessor(t,e){return new Kx({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:RR[t.type]})}createSampler(t){return t}needsPOT(){return!1}}function jR(t,e,n){if(t.byteLength<=e+n)return"";const i=new DataView(t);let r="";for(let s=0;se[t.name]);return new UR(n,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new UR(e,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof UR){const i=t;e=i.fields,n=HR(HR(new Map,this.metadata),i.metadata)}else e=t;const i=Object.create(null);for(const s of this.fields)i[s.name]=s;for(const s of e)i[s.name]=s;const r=Object.values(i);return new UR(r,n)}}function HR(t,e){return new Map([...t||new Map,...e||new Map])}let $R,GR,WR,qR,XR,YR,KR,QR;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}($R||($R={}));class ZR{static isNull(t){return t&&t.typeId===$R.Null}static isInt(t){return t&&t.typeId===$R.Int}static isFloat(t){return t&&t.typeId===$R.Float}static isBinary(t){return t&&t.typeId===$R.Binary}static isUtf8(t){return t&&t.typeId===$R.Utf8}static isBool(t){return t&&t.typeId===$R.Bool}static isDecimal(t){return t&&t.typeId===$R.Decimal}static isDate(t){return t&&t.typeId===$R.Date}static isTime(t){return t&&t.typeId===$R.Time}static isTimestamp(t){return t&&t.typeId===$R.Timestamp}static isInterval(t){return t&&t.typeId===$R.Interval}static isList(t){return t&&t.typeId===$R.List}static isStruct(t){return t&&t.typeId===$R.Struct}static isUnion(t){return t&&t.typeId===$R.Union}static isFixedSizeBinary(t){return t&&t.typeId===$R.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===$R.FixedSizeList}static isMap(t){return t&&t.typeId===$R.Map}static isDictionary(t){return t&&t.typeId===$R.Dictionary}get typeId(){return $R.NONE}compareTo(t){return this===t}}Symbol,Symbol,GR=Symbol.toStringTag;class JR extends ZR{constructor(t,e){super(),cA(this,"isSigned",void 0),cA(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return $R.Int}get[GR](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class tN extends JR{constructor(){super(!0,8)}}class eN extends JR{constructor(){super(!0,16)}}class nN extends JR{constructor(){super(!0,32)}}class iN extends JR{constructor(){super(!1,8)}}class rN extends JR{constructor(){super(!1,16)}}class sN extends JR{constructor(){super(!1,32)}}WR=Symbol.toStringTag;class oN extends ZR{constructor(t){super(),cA(this,"precision",void 0),this.precision=t}get typeId(){return $R.Float}get[WR](){return"Float"}toString(){return`Float${this.precision}`}}class aN extends oN{constructor(){super(32)}}class lN extends oN{constructor(){super(64)}}Symbol,Symbol,qR=Symbol.toStringTag,XR=Symbol.toStringTag,YR=Symbol.toStringTag,KR=Symbol.toStringTag,QR=Symbol.toStringTag;class cN extends ZR{constructor(t,e){super(),cA(this,"listSize",void 0),cA(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return $R.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[QR](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class uN{constructor(t,e,n=!1,i=new Map){cA(this,"name",void 0),cA(this,"type",void 0),cA(this,"nullable",void 0),cA(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=n,this.metadata=i}get typeId(){return this.type&&this.type.typeId}clone(){return new uN(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function hN(t,e,n){const i=n?dN(n.metadata):void 0,r=function(t){switch(t.constructor){case Int8Array:return new tN;case Uint8Array:return new iN;case Int16Array:return new eN;case Uint16Array:return new rN;case Int32Array:return new nN;case Uint32Array:return new sN;case Float32Array:return new aN;case Float64Array:return new lN;default:throw new Error("array type not supported")}}(e.value);return new uN(t,new cN(e.size,new uN("value",r)),!1,i)}function dN(t){const e=new Map;for(const n in t)e.set(`${n}.string`,JSON.stringify(t[n]));return e}const pN={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},fN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class gN{constructor(t){cA(this,"draco",void 0),cA(this,"decoder",void 0),cA(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){const n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const i=this.decoder.GetEncodedGeometryType(n),r=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(i){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(n,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(n,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e=`DRACO decompression failed: ${t.error_msg()}`;throw new Error(e)}const s=this._getDracoLoaderData(r,i,e),o=this._getMeshData(r,s,e),a=function(t){let e=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;cr?t:r,s=l>s?l:s,o=u>o?u:o}return[[e,n,i],[r,s,o]]}(o.attributes),l=function(t,e,n){const i=dN(e.metadata),r=[],s=function(t){const e={};for(const n in t){const i=t[n];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in t){const e=hN(o,t[o],s[o]);r.push(e)}if(n){const t=hN("indices",n);r.push(t)}return new UR(r,i)}(o.attributes,s,o.indices);return ti(bt({loader:"draco",loaderData:s,header:{vertexCount:r.num_points(),boundingBox:a}},o),{schema:l})}finally{this.draco.destroy(n),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,n){const i=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,n);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:r}}_getDracoAttributes(t,e){const n={};for(let i=0;ithis.decoder[t]).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map(t=>e.min_value(t))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:n=[]}=e,i=t.attribute_type();if(n.map(t=>this.decoder[t]).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}var mN=n(49125);const bN={};function yN(t){return vN.apply(this,arguments)}function vN(){return(vN=gS(function*(t,e=null,n={}){return e&&(t=_N(t,e,n)),bN[t]=bN[t]||wN(t),yield bN[t]})).apply(this,arguments)}function _N(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};return i[t]?i[t]:CA?n.CDN?(wA(n.CDN.startsWith("http")),`${n.CDN}/${e}@3.0.12/dist/libs/${t}`):OA?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}function wN(t){return xN.apply(this,arguments)}function xN(){return(xN=gS(function*(t){return t.endsWith("wasm")?yield(yield fetch(t)).arrayBuffer():CA?OA?importScripts(t):SN(yield(yield fetch(t)).text(),t):mN.requireFromFile&&(yield mN.requireFromFile(t))})).apply(this,arguments)}function SN(t,e){if(!CA)return mN.requireFromString&&mN.requireFromString(t,e);if(OA)return eval.call(EA,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(i){n.text=t}return document.body.appendChild(n),null}const EN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",CN="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",ON="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let TN;function kN(t){return AN.apply(this,arguments)}function AN(){return(AN=gS(function*(t){const e=t.modules||{};return TN=e.draco3d?TN||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):TN||PN(t),yield TN})).apply(this,arguments)}function PN(t){return IN.apply(this,arguments)}function IN(){return(IN=gS(function*(t){let e,n;switch(t.draco&&t.draco.decoderType){case"js":e=yield yN(EN,"draco",t);break;case"wasm":default:[e,n]=yield Promise.all([yield yN(CN,"draco",t),yield yN(ON,"draco",t)])}return e=e||globalThis.DracoDecoderModule,yield MN(e,n)})).apply(this,arguments)}function MN(t,e){const n={};return e&&(n.wasmBinary=e),new Promise(e=>{t(ti(bt({},n),{onModuleLoaded:t=>e({draco:t})}))})}const DN=ti(bt({},zR),{parse:function(t,e){return RN.apply(this,arguments)}});function RN(){return(RN=gS(function*(t,e){const{draco:n}=yield kN(e),i=new gN(n);try{return i.parseSync(t,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function NN(t,e){return Nk(t>=0),Nk(e>0),t+(e-1)&~(e-1)}function LN(t,e,n){let i;return i=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer||t.arrayBuffer,t.byteOffset,t.byteLength),e.set(i,n),n+NN(i.byteLength,4)}const jN=["SCALAR","VEC2","VEC3","VEC4"],FN=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],BN=new Map(FN),VN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zN={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},UN={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function HN(t){return jN[t-1]||jN[0]}function $N(t){const e=BN.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function GN(t,e){const n=UN[t.componentType],i=VN[t.type],r=t.count*i,s=t.count*i*zN[t.componentType];return FR(s>=0&&s<=e.byteLength),{ArrayType:n,length:r,byteLength:s}}const WN={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class qN{constructor(t){cA(this,"gltf",void 0),cA(this,"sourceBuffers",void 0),cA(this,"byteLength",void 0),this.gltf=t||{json:bt({},WN),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){return this.getUsedExtensions().find(e=>e===t)?(this.json.extensions||{})[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(e=>e===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];if(!n)throw new Error(`glTF file error: Could not find ${t}[${e}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);const e=this.gltf.buffers[t.buffer];return FR(e),new Uint8Array(e.arrayBuffer,(t.byteOffset||0)+e.byteOffset,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,{ArrayType:i,length:r}=GN(t,e);return new i(n,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data;return new Uint8Array(n,e.byteOffset||0,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}setObjectExtension(t,e,n){(t.extensions||{})[e]=n}removeObjectExtension(t,e){const n=t.extensions||{},i=n[e];return delete n[e],i}addExtension(t,e={}){return FR(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return FR(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(e=>e===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(e=>e===t)||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:n}=t;this.json.nodes=this.json.nodes||[];const i={mesh:e};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:n,material:i,mode:r=4}=t,s={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(n){const t=this._addIndices(n);s.primitives[0].indices=t}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const n=YM(t),i=e||(null==n?void 0:n.mimeType),r={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;FR(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=NN(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(t,e){const n={bufferView:t,type:HN(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,e={size:3}){const n=this.addBufferView(t);let i={min:e.min,max:e.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:$N(t),count:Math.round(t.length/e.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,n={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const n=this.byteLength,i=new ArrayBuffer(n),r=new Uint8Array(i);let s=0;for(const o of this.sourceBuffers||[])s=LN(o,r,s);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}_removeStringFromArray(t,e){let n=!0;for(;n;){const i=t.indexOf(e);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){const e={};for(const n in t){const i=t[n],r=this._getGltfAttributeName(n),s=this.addBinaryBuffer(i.value,i);e[r]=s}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const n={min:null,max:null};if(t.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*lL(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}function cL(t){return uL.apply(this,arguments)}function uL(){return(uL=gS(function*(t){const e=new qN(t),{json:n}=e;e.removeExtension(QN);for(const i of n.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,QN)})).apply(this,arguments)}function hL(t){const e=new qN(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,QN,{}),e.addExtension(QN))}function dL(t){return pL.apply(this,arguments)}function pL(){return(pL=gS(function*(t){const e=new qN(t),{json:n}=e,i=e.getExtension(KN);i&&(e.json.lights=i.lights,e.removeExtension(KN));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,KN);t&&(r.light=t.light),e.removeObjectExtension(r,KN)}})).apply(this,arguments)}function fL(t){return gL.apply(this,arguments)}function gL(){return(gL=gS(function*(t){const e=new qN(t),{json:n}=e;if(n.lights){const t=e.addExtension(KN);FR(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights)e.addObjectExtension(t.node,KN,t);delete e.json.lights}})).apply(this,arguments)}function mL(t){return bL.apply(this,arguments)}function bL(){return(bL=gS(function*(t){const e=new qN(t),{json:n}=e,i=e.getExtension(ZN);if(i){const t=_L(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,ZN);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=wL(i.technique,e)),e.removeObjectExtension(i,ZN)}e.removeExtension(ZN)}})).apply(this,arguments)}function yL(t,e){return vL.apply(this,arguments)}function vL(){return(vL=gS(function*(t,e){})).apply(this,arguments)}function _L(t,e){const{programs:n=[],shaders:i=[],techniques:r=[]}=t,s=new TextDecoder;return i.forEach(t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=s.decode(e.getTypedArrayForBufferView(t.bufferView))}),n.forEach(t=>{t.fragmentShader=i[t.fragmentShader],t.vertexShader=i[t.vertexShader]}),r.forEach(t=>{t.program=n[t.program]}),r}function wL(t,e){const n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(e=>{t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)}),Object.keys(n).forEach(t=>{"object"==typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))}),n}const xL={KHR_draco_mesh_compression:i,KHR_materials_unlit:r,KHR_lights_punctual:s,KHR_techniques_webgl:o};function SL(t){return EL.apply(this,arguments)}function EL(){return(EL=gS(function*(t,e={},n){for(const r in xL){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield xL[r].decode(t,e,n))}})).apply(this,arguments)}const CL={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},OL={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class TL{constructor(t){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(t,e){this.json=t.json;const n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${n.asset.version}`)}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t){const e=new qN(t),{json:n}=e;for(const i of n.images||[]){const t=e.removeObjectExtension(i,XN);t&&Object.assign(i,t)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(XN)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in CL)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const n=t[e];if(n&&!Array.isArray(n)){t[e]=[];for(const i in n){const r=n[i];r.id=r.id||i;const s=t[e].length;t[e].push(r),this.idToIndexMap[e][i]=s}}}_convertObjectIdsToArrayIndices(t){for(const e in CL)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:n,material:i}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");n&&(e.indices=this._convertIdToIndex(n,"accessor")),i&&(e.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(t=>this._convertIdToIndex(t,"node"))),t.meshes&&(t.meshes=t.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(t,e){t[e]||(console.warn(`gltf v1: json doesn't contain attribute ${e}`),t[e]=[]);for(const n of t[e])for(const t in n){const e=this._convertIdToIndex(n[t],t);n[t]=e}}_convertIdToIndex(t,e){const n=OL[e];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${e} with id ${t}`);return i}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const e of t.materials){e.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const n=e.values&&e.values.tex,i=t.textures.findIndex(t=>t.id===n);-1!==i&&(e.pbrMetallicRoughness.baseColorTexture={index:i})}}}function kL(t,e={}){return(new TL).normalize(t,e)}const AL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},PL={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},IL={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},ML={magFilter:IL.TEXTURE_MAG_FILTER,minFilter:IL.TEXTURE_MIN_FILTER,wrapS:IL.TEXTURE_WRAP_S,wrapT:IL.TEXTURE_WRAP_T},DL={[IL.TEXTURE_MAG_FILTER]:IL.LINEAR,[IL.TEXTURE_MIN_FILTER]:IL.NEAREST_MIPMAP_LINEAR,[IL.TEXTURE_WRAP_S]:IL.REPEAT,[IL.TEXTURE_WRAP_]:IL.REPEAT};class RL{postProcess(t,e={}){const{json:n,buffers:i=[],images:r=[],baseUri:s=""}=t;return FR(n),this.baseUri=s,this.json=n,this.buffers=i,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t,e={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((t,e)=>this._resolveBufferView(t,e))),t.images&&(t.images=t.images.map((t,e)=>this._resolveImage(t,e))),t.samplers&&(t.samplers=t.samplers.map((t,e)=>this._resolveSampler(t,e))),t.textures&&(t.textures=t.textures.map((t,e)=>this._resolveTexture(t,e))),t.accessors&&(t.accessors=t.accessors.map((t,e)=>this._resolveAccessor(t,e))),t.materials&&(t.materials=t.materials.map((t,e)=>this._resolveMaterial(t,e))),t.meshes&&(t.meshes=t.meshes.map((t,e)=>this._resolveMesh(t,e))),t.nodes&&(t.nodes=t.nodes.map((t,e)=>this._resolveNode(t,e))),t.skins&&(t.skins=t.skins.map((t,e)=>this._resolveSkin(t,e))),t.scenes&&(t.scenes=t.scenes.map((t,e)=>this._resolveScene(t,e))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];return n||console.warn(`glTF file error: Could not find ${t}[${e}]`),n}_resolveScene(t,e){return t.id=t.id||`scene-${e}`,t.nodes=(t.nodes||[]).map(t=>this.getNode(t)),t}_resolveNode(t,e){return t.id=t.id||`node-${e}`,t.children&&(t.children=t.children.map(t=>this.getNode(t))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((t,e)=>{const n=this.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t},{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||`skin-${e}`,t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||`mesh-${e}`,t.primitives&&(t.primitives=t.primitives.map(t=>{const e=(t=bt({},t)).attributes;t.attributes={};for(const n in e)t.attributes[n]=this.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t})),t}_resolveMaterial(t,e){if(t.id=t.id||`material-${e}`,t.normalTexture&&(t.normalTexture=bt({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=bt({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=bt({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness=bt({},t.pbrMetallicRoughness);const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture=bt({},e.baseColorTexture),e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture=bt({},e.metallicRoughnessTexture),e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){if(t.id=t.id||`accessor-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=function(t){return PL[t]}(t.componentType),t.components=function(t){return AL[t]}(t.type),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:i}=GN(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset,s=e.arrayBuffer.slice(r,r+i);t.value=new n(s)}return t}_resolveTexture(t,e){return t.id=t.id||`texture-${e}`,t.sampler="sampler"in t?this.getSampler(t.sampler):DL,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||`sampler-${e}`,t.parameters={};for(const n in t){const e=this._enumSamplerParameter(n);void 0!==e&&(t.parameters[e]=t[n])}return t}_enumSamplerParameter(t){return ML[t]}_resolveImage(t,e){t.id=t.id||`image-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const n=this.images[e];return n&&(t.image=n),t}_resolveBufferView(t,e){t.id=t.id||`bufferView-${e}`;const n=t.buffer;t.buffer=this.buffers[n];let i=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(i+=t.byteOffset),t.data=new Uint8Array(this.buffers[n].arrayBuffer,i,t.byteLength),t}_resolveCamera(t,e){return t.id=t.id||`camera-${e}`,t}}function NL(t,e){return(new RL).postProcess(t,e)}const LL=1735152710,jL=!0;function FL(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),s=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(s),NN(i,4)}function BL(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),NN(i,4)}function VL(t,e){return zL.apply(this,arguments)}function zL(){return(zL=gS(function*(t,e,n=0,i,r){var s,o,a,l;UL(t,e,n,i),kL(t,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&t.json.buffers&&(yield HL(t,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const e=GL(t,i,r);c.push(e)}const u=SL(t,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?NL(t,i):t})).apply(this,arguments)}function UL(t,e,n,i){if(i.uri&&(t.baseUri=i.uri),e instanceof ArrayBuffer&&!function(t,e=0,n={}){const i=new DataView(t),{magic:r=LL}=n,s=i.getUint32(e,!1);return s===r||s===LL}(e,n,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)t.json=function(t){try{return JSON.parse(t)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(t,e=5){return"string"==typeof t?t.slice(0,e):ArrayBuffer.isView(t)?jR(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?jR(t,0,e):""}(t)}"`)}}(e);else if(e instanceof ArrayBuffer){const r={};n=function(t,e,n=0,i={}){const r=new DataView(e),s=function(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}(r,n+0),o=r.getUint32(n+4,jL),a=r.getUint32(n+8,jL);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),n+=12,t.version){case 1:return function(t,e,n){Nk(t.header.byteLength>20);const i=e.getUint32(n+0,jL),r=e.getUint32(n+4,jL);return n+=8,Nk(0===r),FL(t,e,n,i),(n+=i)+BL(t,e,n,t.header.byteLength)}(t,r,n);case 2:return function(t,e,n,i){return Nk(t.header.byteLength>20),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,jL),s=e.getUint32(n+4,jL);switch(n+=8,s){case 1313821514:FL(t,e,n,r);break;case 5130562:BL(t,e,n,r);break;case 0:i.strict||FL(t,e,n,r);break;case 1:i.strict||BL(t,e,n,r)}n+=NN(r,4)}}(t,e,n,{}),n+t.header.byteLength}(t,r,n);default:throw new Error(`Invalid GLB version ${t.version}. Only supports v1 and v2.`)}}(r,e,n,i.glb),FR("glTF"===r.type,`Invalid GLB magic string ${r.type}`),t._glb=r,t.json=r.json}else FR(!1,"GLTF: must be ArrayBuffer or string");if(t.buffers=new Array((t.json.buffers||[]).length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}t.images=new Array((t.json.images||[]).length).fill({})}function HL(t,e,n){return $L.apply(this,arguments)}function $L(){return($L=gS(function*(t,e,n){for(let s=0;s{t.traverse(t=>{Object.values(t.model.getUniforms()).forEach(t=>{!1===t.loaded&&e.push(t)})})}),yield ZL(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function ZL(t){return JL.apply(this,arguments)}function JL(){return(JL=gS(function*(t){for(;t();)yield new Promise(t=>requestAnimationFrame(t))})).apply(this,arguments)}const tj=[255,255,255,255],ej={scenegraph:{type:"object",value:null,async:!0},getScene:t=>t&&t.scenes?"object"==typeof t.scene?t.scene:t.scenes[t.scene||0]:t,getAnimator:t=>t&&t.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:tj},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[YL]};let nj=(()=>{class t extends LP{getShaders(){const t=[qD,eR];return"pbr"===this.props._lighting&&t.push(gR),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:tj,transition:!0},instanceModelMatrix:cR})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;e.scenegraph!==n.scenegraph?this._updateScenegraph(e):e._animations!==n._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:e}=this.context;let n=null;if(t.scenegraph instanceof mR)n={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const i=t.scenegraph,r=function(t,e,n){const i=new LR(t,n);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(e,i,this._getModelOptions());n=bt({gltf:i},r),function(t){return QL.apply(this,arguments)}(r).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Iw.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),n=t.scenegraph);const i={layer:this,gl:e},r=t.getScene(n,i),s=t.getAnimator(n,i);r instanceof mR?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,s,t._animations),this.setState({scenegraph:r,animator:s})):null!==r&&Iw.warn("invalid scenegraph:",r)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const e=this.getAttributeManager().getAttributes();t.traverse(t=>{this._setModelAttributes(t.model,e)})}}_applyAnimationsProp(t,e,n){if(!t||!e||!n)return;const i=e.getAnimations();Object.keys(n).sort().forEach(t=>{const e=n[t];if("*"===t)i.forEach(t=>{Object.assign(t,e)});else if(Number.isFinite(Number(t))){const n=Number(t);n>=0&&ne===t);n?Object.assign(n,e):Iw.warn("animation ".concat(t," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof mR&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let e=null;return t&&(e="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:e,modelOptions:bt({isInstanced:!0,transpileToGLSL100:!Fw(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(e=>{this._setModelAttributes(e.model,t)})}draw({moduleParameters:t=null,parameters:e={},context:n}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(n.timeline.getTime()),this.setNeedsRedraw());const{viewport:i}=this.context,{sizeScale:r,sizeMinPixels:s,sizeMaxPixels:o,opacity:a,coordinateSystem:l}=this.props,c=this.getNumInstances();this.state.scenegraph.traverse((n,{worldMatrix:u})=>{n.model.setInstanceCount(c),n.updateModuleSettings(t),n.draw({parameters:e,uniforms:{sizeScale:r,opacity:a,sizeMinPixels:s,sizeMaxPixels:o,composeModelMatrix:uR(i,l),sceneModelMatrix:u,u_Camera:n.model.getUniforms().project_uCameraPosition}})})}}return t.layerName="ScenegraphLayer",t.defaultProps=ej,t})();const ij=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),rj=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),sj=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),oj=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),aj={POSITION:{size:3,value:new Float32Array(rj)},NORMAL:{size:3,value:new Float32Array(sj)},TEXCOORD_0:{size:2,value:new Float32Array(oj)}};class lj extends iR{constructor(t={}){const{id:e=Fx("cube-geometry")}=t;super(ti(bt({},t),{id:e,indices:{size:1,value:new Uint16Array(ij)},attributes:bt(bt({},aj),t.attributes)}))}}class cj{constructor(t=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=t}identity(){const t=this.elements;t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1}setZero(){const t=this.elements;t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0}setTrace(t){const e=this.elements;e[0]=t.x,e[4]=t.y,e[8]=t.z}getTrace(t=new hj){const e=this.elements;return t.x=e[0],t.y=e[4],t.z=e[8],t}vmult(t,e=new hj){const n=this.elements,i=t.x,r=t.y,s=t.z;return e.x=n[0]*i+n[1]*r+n[2]*s,e.y=n[3]*i+n[4]*r+n[5]*s,e.z=n[6]*i+n[7]*r+n[8]*s,e}smult(t){for(let e=0;e0){const t=1/i;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return i}unit(t=new hj){const e=this.x,n=this.y,i=this.z;let r=Math.sqrt(e*e+n*n+i*i);return r>0?(r=1/r,t.x=e*r,t.y=n*r,t.z=i*r):(t.x=1,t.y=0,t.z=0),t}length(){const t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)}lengthSquared(){return this.dot(this)}distanceTo(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return Math.sqrt((r-e)*(r-e)+(s-n)*(s-n)+(o-i)*(o-i))}distanceSquared(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return(r-e)*(r-e)+(s-n)*(s-n)+(o-i)*(o-i)}scale(t,e=new hj){const n=this.y,i=this.z;return e.x=t*this.x,e.y=t*n,e.z=t*i,e}vmul(t,e=new hj){return e.x=t.x*this.x,e.y=t.y*this.y,e.z=t.z*this.z,e}addScaledVector(t,e,n=new hj){return n.x=this.x+t*e.x,n.y=this.y+t*e.y,n.z=this.z+t*e.z,n}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(t=new hj){return t.x=-this.x,t.y=-this.y,t.z=-this.z,t}tangents(t,e){const n=this.length();if(n>0){const i=dj,r=1/n;i.set(this.x*r,this.y*r,this.z*r);const s=pj;Math.abs(i.x)<.9?(s.set(1,0,0),i.cross(s,t)):(s.set(0,1,0),i.cross(s,t)),i.cross(t,e)}else t.set(1,0,0),e.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}lerp(t,e,n){const i=this.x,r=this.y,s=this.z;n.x=i+(t.x-i)*e,n.y=r+(t.y-r)*e,n.z=s+(t.z-s)*e}almostEquals(t,e=1e-6){return!(Math.abs(this.x-t.x)>e||Math.abs(this.y-t.y)>e||Math.abs(this.z-t.z)>e)}almostZero(t=1e-6){return!(Math.abs(this.x)>t||Math.abs(this.y)>t||Math.abs(this.z)>t)}isAntiparallelTo(t,e){return this.negate(fj),fj.almostEquals(t,e)}clone(){return new hj(this.x,this.y,this.z)}}hj.ZERO=void 0,hj.UNIT_X=void 0,hj.UNIT_Y=void 0,hj.UNIT_Z=void 0,hj.ZERO=new hj(0,0,0),hj.UNIT_X=new hj(1,0,0),hj.UNIT_Y=new hj(0,1,0),hj.UNIT_Z=new hj(0,0,1);const dj=new hj,pj=new hj,fj=new hj;class gj{constructor(t={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new hj,this.upperBound=new hj,t.lowerBound&&this.lowerBound.copy(t.lowerBound),t.upperBound&&this.upperBound.copy(t.upperBound)}setFromPoints(t,e,n,i){const r=this.lowerBound,s=this.upperBound,o=n;r.copy(t[0]),o&&o.vmult(r,r),s.copy(r);for(let a=1;as.x&&(s.x=e.x),e.xs.y&&(s.y=e.y),e.ys.z&&(s.z=e.z),e.z=r.x&&e.y<=i.y&&n.y>=r.y&&e.z<=i.z&&n.z>=r.z}getCorners(t,e,n,i,r,s,o,a){const l=this.lowerBound,c=this.upperBound;t.copy(l),e.set(c.x,l.y,l.z),n.set(c.x,c.y,l.z),i.set(l.x,c.y,c.z),r.set(c.x,l.y,c.z),s.set(l.x,c.y,l.z),o.set(l.x,l.y,c.z),a.copy(c)}toLocalFrame(t,e){const n=bj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(let i=0;8!==i;i++){const e=n[i];t.pointToLocal(e,e)}return e.setFromPoints(n)}toWorldFrame(t,e){const n=bj;this.getCorners(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);for(let i=0;8!==i;i++){const e=n[i];t.pointToWorld(e,e)}return e.setFromPoints(n)}overlapsRay(t){const{direction:e,from:n}=t,i=1/e.x,r=1/e.y,s=1/e.z,o=(this.lowerBound.x-n.x)*i,a=(this.upperBound.x-n.x)*i,l=(this.lowerBound.y-n.y)*r,c=(this.upperBound.y-n.y)*r,u=(this.lowerBound.z-n.z)*s,h=(this.upperBound.z-n.z)*s,d=Math.max(Math.max(Math.min(o,a),Math.min(l,c)),Math.min(u,h)),p=Math.min(Math.min(Math.max(o,a),Math.max(l,c)),Math.max(u,h));return!(p<0||d>p)}}const mj=new hj,bj=[new hj,new hj,new hj,new hj,new hj,new hj,new hj,new hj];class yj{constructor(t=0,e=0,n=0,i=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=t,this.y=e,this.z=n,this.w=i}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(t,e){const n=Math.sin(.5*e);return this.x=t.x*n,this.y=t.y*n,this.z=t.z*n,this.w=Math.cos(.5*e),this}toAxisAngle(t=new hj){this.normalize();const e=2*Math.acos(this.w),n=Math.sqrt(1-this.w*this.w);return n<.001?(t.x=this.x,t.y=this.y,t.z=this.z):(t.x=this.x/n,t.y=this.y/n,t.z=this.z/n),[t,e]}setFromVectors(t,e){if(t.isAntiparallelTo(e)){const e=vj;t.tangents(e,_j),this.setFromAxisAngle(e,Math.PI)}else{const n=t.cross(e);this.x=n.x,this.y=n.y,this.z=n.z,this.w=Math.sqrt(Nr(t.length(),2)*Nr(e.length(),2))+t.dot(e),this.normalize()}return this}mult(t,e=new yj){const n=this.x,i=this.y,r=this.z,s=this.w,o=t.x,a=t.y,l=t.z,c=t.w;return e.x=n*c+s*o+i*l-r*a,e.y=i*c+s*a+r*o-n*l,e.z=r*c+s*l+n*a-i*o,e.w=s*c-n*o-i*a-r*l,e}inverse(t=new yj){const e=this.x,n=this.y,i=this.z,r=this.w;this.conjugate(t);const s=1/(e*e+n*n+i*i+r*r);return t.x*=s,t.y*=s,t.z*=s,t.w*=s,t}conjugate(t=new yj){return t.x=-this.x,t.y=-this.y,t.z=-this.z,t.w=this.w,t}normalize(){let t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}normalizeFast(){const t=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}vmult(t,e=new hj){const n=t.x,i=t.y,r=t.z,s=this.x,o=this.y,a=this.z,l=this.w,c=l*n+o*r-a*i,u=l*i+a*n-s*r,h=l*r+s*i-o*n,d=-s*n-o*i-a*r;return e.x=c*l+d*-s+u*-a-h*-o,e.y=u*l+d*-o+h*-s-c*-a,e.z=h*l+d*-a+c*-o-u*-s,e}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}toEuler(t,e="YZX"){let n,i,r;const s=this.x,o=this.y,a=this.z,l=this.w;switch(e){case"YZX":const t=s*o+a*l;if(t>.499&&(n=2*Math.atan2(s,l),i=Math.PI/2,r=0),t<-.499&&(n=-2*Math.atan2(s,l),i=-Math.PI/2,r=0),void 0===n){const e=s*s,c=a*a;n=Math.atan2(2*o*l-2*s*a,1-o*o*2-2*c),i=Math.asin(2*t),r=Math.atan2(2*s*l-2*o*a,1-2*e-2*c)}break;default:throw new Error("Euler order "+e+" not supported yet.")}t.y=n,t.z=i,t.x=r}setFromEuler(t,e,n,i="XYZ"){const r=Math.cos(t/2),s=Math.cos(e/2),o=Math.cos(n/2),a=Math.sin(t/2),l=Math.sin(e/2),c=Math.sin(n/2);return"XYZ"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o-a*l*c):"YXZ"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o+a*l*c):"ZXY"===i?(this.x=a*s*o-r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o-a*l*c):"ZYX"===i?(this.x=a*s*o-r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o+a*l*c):"YZX"===i?(this.x=a*s*o+r*l*c,this.y=r*l*o+a*s*c,this.z=r*s*c-a*l*o,this.w=r*s*o-a*l*c):"XZY"===i&&(this.x=a*s*o-r*l*c,this.y=r*l*o-a*s*c,this.z=r*s*c+a*l*o,this.w=r*s*o+a*l*c),this}clone(){return new yj(this.x,this.y,this.z,this.w)}slerp(t,e,n=new yj){const i=this.x,r=this.y,s=this.z,o=this.w;let a,l,c,u,h,d=t.x,p=t.y,f=t.z,g=t.w;return l=i*d+r*p+s*f+o*g,l<0&&(l=-l,d=-d,p=-p,f=-f,g=-g),1-l>1e-6?(a=Math.acos(l),c=Math.sin(a),u=Math.sin((1-e)*a)/c,h=Math.sin(e*a)/c):(u=1-e,h=e),n.x=u*i+h*d,n.y=u*r+h*p,n.z=u*s+h*f,n.w=u*o+h*g,n}integrate(t,e,n,i=new yj){const r=t.x*n.x,s=t.y*n.y,o=t.z*n.z,a=this.x,l=this.y,c=this.z,u=this.w,h=.5*e;return i.x+=h*(r*u+s*c-o*l),i.y+=h*(s*u+o*a-r*c),i.z+=h*(o*u+r*l-s*a),i.w+=h*(-r*a-s*l-o*c),i}}const vj=new hj,_j=new hj,wj={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let xj=(()=>{class t{constructor(e={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=t.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=!e.collisionResponse||e.collisionResponse,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:1,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,e){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,e,n,i){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return t.idCounter=0,t.types=wj,t})();class Sj{constructor(t={}){this.position=void 0,this.quaternion=void 0,this.position=new hj,this.quaternion=new yj,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}pointToLocal(t,e){return Sj.pointToLocalFrame(this.position,this.quaternion,t,e)}pointToWorld(t,e){return Sj.pointToWorldFrame(this.position,this.quaternion,t,e)}vectorToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e}static pointToLocalFrame(t,e,n,i=new hj){return n.vsub(t,i),e.conjugate(Ej),Ej.vmult(i,i),i}static pointToWorldFrame(t,e,n,i=new hj){return e.vmult(n,i),i.vadd(t,i),i}static vectorToWorldFrame(t,e,n=new hj){return t.vmult(e,n),n}static vectorToLocalFrame(t,e,n,i=new hj){return e.w*=-1,e.vmult(n,i),e.w*=-1,i}}const Ej=new yj;class Cj extends xj{constructor(t={}){const{vertices:e=[],faces:n=[],normals:i=[],axes:r,boundingSphereRadius:s}=t;super({type:xj.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=e,this.faces=n,this.faceNormals=i,0===this.faceNormals.length&&this.computeNormals(),s?this.boundingSphereRadius=s:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=r?r.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const t=this.faces,e=this.vertices,n=this.uniqueEdges;n.length=0;const i=new hj;for(let r=0;r!==t.length;r++){const s=t[r],o=s.length;for(let t=0;t!==o;t++){e[s[t]].vsub(e[s[(t+1)%o]],i),i.normalize();let r=!1;for(let t=0;t!==n.length;t++)if(n[t].almostEquals(i)||n[t].almostEquals(i)){r=!0;break}r||n.push(i.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let t=0;th&&(h=t,u=p)}const d=[];for(let p=0;p=0&&this.clipFaceAgainstHull(s,t,e,d,o,a,l)}findSeparatingAxis(t,e,n,i,r,s,o,a){const l=new hj,c=new hj,u=new hj,h=new hj,d=new hj,p=new hj;let f=Number.MAX_VALUE;const g=this;if(g.uniqueAxes)for(let m=0;m!==g.uniqueAxes.length;m++){n.vmult(g.uniqueAxes[m],l);const o=g.testSepAxis(l,t,e,n,i,r);if(!1===o)return!1;o0&&s.negate(s),!0}testSepAxis(t,e,n,i,r,s){Cj.project(this,t,n,i,Oj),Cj.project(e,t,r,s,Tj);const o=Oj[0],a=Oj[1],l=Tj[0],c=Tj[1];if(o0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?Dj.STATIC:Dj.DYNAMIC,typeof t.type==typeof Dj.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=Dj.AWAKE,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new hj,this.quaternion=new yj,this.initQuaternion=new yj,this.previousQuaternion=new yj,this.interpolatedQuaternion=new yj,t.quaternion&&(this.quaternion.copy(t.quaternion),this.initQuaternion.copy(t.quaternion),this.previousQuaternion.copy(t.quaternion),this.interpolatedQuaternion.copy(t.quaternion)),this.angularVelocity=new hj,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new hj,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new hj,this.invInertia=new hj,this.invInertiaWorld=new cj,this.invMassSolve=0,this.invInertiaSolve=new hj,this.invInertiaWorldSolve=new cj,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new hj(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new hj(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new gj,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new hj,this.isTrigger=Boolean(t.isTrigger),t.shape&&this.addShape(t.shape),this.updateMassProperties()}wakeUp(){const t=this.sleepState;this.sleepState=Dj.AWAKE,this.wakeUpAfterNarrowphase=!1,t===Dj.SLEEPING&&this.dispatchEvent(Dj.wakeupEvent)}sleep(){this.sleepState=Dj.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(t){if(this.allowSleep){const e=this.sleepState,n=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),i=Nr(this.sleepSpeedLimit,2);e===Dj.AWAKE&&ni?this.wakeUp():e===Dj.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(Dj.sleepEvent))}}updateSolveMassProperties(){this.sleepState===Dj.SLEEPING||this.type===Dj.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(t,e=new hj){return t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e}vectorToLocalFrame(t,e=new hj){return this.quaternion.conjugate().vmult(t,e),e}pointToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e.vadd(this.position,e),e}vectorToWorldFrame(t,e=new hj){return this.quaternion.vmult(t,e),e}addShape(t,e,n){const i=new hj,r=new yj;return e&&i.copy(e),n&&r.copy(n),this.shapes.push(t),this.shapeOffsets.push(i),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=this,this}removeShape(t){const e=this.shapes.indexOf(t);return-1===e?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(e,1),this.shapeOffsets.splice(e,1),this.shapeOrientations.splice(e,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=null,this)}updateBoundingRadius(){const t=this.shapes,e=this.shapeOffsets,n=t.length;let i=0;for(let r=0;r!==n;r++){const n=t[r];n.updateBoundingSphereRadius();const s=e[r].length(),o=n.boundingSphereRadius;s+o>i&&(i=s+o)}this.boundingRadius=i}updateAABB(){const t=this.shapes,e=this.shapeOffsets,n=this.shapeOrientations,i=t.length,r=Rj,s=Nj,o=this.quaternion,a=this.aabb,l=Lj;for(let c=0;c!==i;c++){const i=t[c];o.vmult(e[c],r),r.vadd(this.position,r),o.mult(n[c],s),i.calculateWorldAABB(r,s,l.lowerBound,l.upperBound),0===c?a.copy(l):a.extend(l)}this.aabbNeedsUpdate=!1}updateInertiaWorld(t){const e=this.invInertia;if(e.x!==e.y||e.y!==e.z||t){const t=jj,n=Fj;t.setRotationFromQuaternion(this.quaternion),t.transpose(n),t.scale(e,t),t.mmult(n,this.invInertiaWorld)}}applyForce(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;this.sleepState===Dj.SLEEPING&&this.wakeUp();const n=Bj;e.cross(t,n),this.force.vadd(t,this.force),this.torque.vadd(n,this.torque)}applyLocalForce(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;const n=Vj,i=zj;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyForce(n,i)}applyTorque(t){this.type===Dj.DYNAMIC&&(this.sleepState===Dj.SLEEPING&&this.wakeUp(),this.torque.vadd(t,this.torque))}applyImpulse(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;this.sleepState===Dj.SLEEPING&&this.wakeUp();const n=e,i=Uj;i.copy(t),i.scale(this.invMass,i),this.velocity.vadd(i,this.velocity);const r=Hj;n.cross(t,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(t,e=new hj){if(this.type!==Dj.DYNAMIC)return;const n=$j,i=Gj;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyImpulse(n,i)}updateMassProperties(){const t=Wj;this.invMass=this.mass>0?1/this.mass:0;const e=this.inertia,n=this.fixedRotation;this.updateAABB(),t.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),Pj.calculateInertia(t,this.mass,e),this.invInertia.set(e.x>0&&!n?1/e.x:0,e.y>0&&!n?1/e.y:0,e.z>0&&!n?1/e.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(t,e){const n=new hj;return t.vsub(this.position,n),this.angularVelocity.cross(n,e),this.velocity.vadd(e,e),e}integrate(t,e,n){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==Dj.DYNAMIC&&this.type!==Dj.KINEMATIC||this.sleepState===Dj.SLEEPING)return;const i=this.velocity,r=this.angularVelocity,s=this.position,o=this.force,a=this.torque,l=this.quaternion,c=this.invInertiaWorld,u=this.linearFactor,h=this.invMass*t;i.x+=o.x*h*u.x,i.y+=o.y*h*u.y,i.z+=o.z*h*u.z;const d=c.elements,p=this.angularFactor,f=a.x*p.x,g=a.y*p.y,m=a.z*p.z;r.x+=t*(d[0]*f+d[1]*g+d[2]*m),r.y+=t*(d[3]*f+d[4]*g+d[5]*m),r.z+=t*(d[6]*f+d[7]*g+d[8]*m),s.x+=i.x*t,s.y+=i.y*t,s.z+=i.z*t,l.integrate(this.angularVelocity,t,this.angularFactor,l),e&&(n?l.normalizeFast():l.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}Dj.idCounter=0,Dj.COLLIDE_EVENT_NAME="collide",Dj.DYNAMIC=1,Dj.STATIC=2,Dj.KINEMATIC=4,Dj.AWAKE=0,Dj.SLEEPY=1,Dj.SLEEPING=2,Dj.wakeupEvent={type:"wakeup"},Dj.sleepyEvent={type:"sleepy"},Dj.sleepEvent={type:"sleep"};const Rj=new hj,Nj=new yj,Lj=new gj,jj=new cj,Fj=new cj,Bj=new hj,Vj=new hj,zj=new hj,Uj=new hj,Hj=new hj,$j=new hj,Gj=new hj,Wj=new hj;new hj,new hj;class qj{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new hj,this.rayToWorld=new hj,this.hitNormalWorld=new hj,this.hitPointWorld=new hj,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(t,e,n,i,r,s,o){this.rayFromWorld.copy(t),this.rayToWorld.copy(e),this.hitNormalWorld.copy(n),this.hitPointWorld.copy(i),this.shape=r,this.body=s,this.distance=o}}let Xj,Yj,Kj,Qj,Zj,Jj,tF;Xj=xj.types.SPHERE,Yj=xj.types.PLANE,Kj=xj.types.BOX,Qj=xj.types.CYLINDER,Zj=xj.types.CONVEXPOLYHEDRON,Jj=xj.types.HEIGHTFIELD,tF=xj.types.TRIMESH;class eF{get[Xj](){return this._intersectSphere}get[Yj](){return this._intersectPlane}get[Kj](){return this._intersectBox}get[Qj](){return this._intersectConvex}get[Zj](){return this._intersectConvex}get[Jj](){return this._intersectHeightfield}get[tF](){return this._intersectTrimesh}constructor(t=new hj,e=new hj){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=t.clone(),this.to=e.clone(),this.direction=new hj,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=eF.ANY,this.result=new qj,this.hasHit=!1,this.callback=t=>{}}intersectWorld(t,e){return this.mode=e.mode||eF.ANY,this.result=e.result||new qj,this.skipBackfaces=!!e.skipBackfaces,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===e.checkCollisionResponse||e.checkCollisionResponse,e.from&&this.from.copy(e.from),e.to&&this.to.copy(e.to),this.callback=e.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(nF),iF.length=0,t.broadphase.aabbQuery(t,nF,iF),this.intersectBodies(iF),this.hasHit}intersectBody(t,e){e&&(this.result=e,this.updateDirection());const n=this.checkCollisionResponse;if(n&&!t.collisionResponse||0==(this.collisionFilterGroup&t.collisionFilterMask)||0==(t.collisionFilterGroup&this.collisionFilterMask))return;const i=oF,r=aF;for(let s=0,o=t.shapes.length;st.boundingSphereRadius)return;const r=this[t.type];r&&r.call(this,t,e,n,i,t)}_intersectBox(t,e,n,i,r){return this._intersectConvex(t.convexPolyhedronRepresentation,e,n,i,r)}_intersectPlane(t,e,n,i,r){const s=this.from,o=this.to,a=this.direction,l=new hj(0,0,1);e.vmult(l,l);const c=new hj;s.vsub(n,c);const u=c.dot(l);if(o.vsub(n,c),u*c.dot(l)>0||s.distanceTo(o)=0&&t<=1&&(s.lerp(o,t,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1)),this.result.shouldStop)return;e>=0&&e<=1&&(s.lerp(o,e,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1))}}_intersectConvex(t,e,n,i,r,s){const o=yF,a=vF,l=s&&s.faceList||null,c=t.faces,u=t.vertices,h=t.faceNormals,d=this.direction,p=this.from,f=p.distanceTo(this.to),g=l?l.length:c.length,m=this.result;for(let b=0;!m.shouldStop&&bf||this.reportIntersection(o,lF,r,i,t)}}}}_intersectTrimesh(t,e,n,i,r,s){const o=_F,a=OF,l=TF,c=vF,u=wF,h=xF,d=SF,p=CF,f=EF,g=t.indices,m=this.from,b=this.to,y=this.direction;l.position.copy(n),l.quaternion.copy(e),Sj.vectorToLocalFrame(n,e,y,u),Sj.pointToLocalFrame(n,e,m,h),Sj.pointToLocalFrame(n,e,b,d),d.x*=t.scale.x,d.y*=t.scale.y,d.z*=t.scale.z,h.x*=t.scale.x,h.y*=t.scale.y,h.z*=t.scale.z,d.vsub(h,u),u.normalize();const v=h.distanceSquared(d);t.tree.rayQuery(this,l,a);for(let _=0,w=a.length;!this.result.shouldStop&&_!==w;_++){const s=a[_];t.getNormal(s,o),t.getVertex(g[3*s],cF),cF.vsub(h,c);const l=u.dot(o),d=o.dot(c)/l;if(d<0)continue;u.scale(d,lF),lF.vadd(h,lF),t.getVertex(g[3*s+1],uF),t.getVertex(g[3*s+2],hF);const m=lF.distanceSquared(h);!eF.pointInTriangle(lF,uF,cF,hF)&&!eF.pointInTriangle(lF,cF,uF,hF)||m>v||(Sj.vectorToWorldFrame(e,o,f),Sj.pointToWorldFrame(n,e,lF,p),this.reportIntersection(f,p,r,i,s))}a.length=0}reportIntersection(t,e,n,i,r){const s=this.from,o=this.to,a=s.distanceTo(e),l=this.result;if(!(this.skipBackfaces&&t.dot(this.direction)>0))switch(l.hitFaceIndex=void 0!==r?r:-1,this.mode){case eF.ALL:this.hasHit=!0,l.set(s,o,t,e,n,i,a),l.hasHit=!0,this.callback(l);break;case eF.CLOSEST:(a=0&&(u=r*l-s*o)>=0&&c+uDate.now()-t}var iB=n(24517);function rB(t,e,n){e||(e=new bT(bT.IDENTITY));const i=new bT(bT.IDENTITY);if(t.matrix)i.copy(t.matrix);else{if(i.identity(),t.translation&&i.translate(t.translation),t.rotation){const e=new bT(bT.IDENTITY).fromQuaternion(t.rotation);i.multiplyRight(e)}t.scale&&i.scale(t.scale)}const r=new bT(e).multiplyRight(i);if(!1===n(t,r,e))return!1;for(const s of t.nodes||t.children||[])if(!1===rB(s,r,n))return!1;return!0}function sB(){fP([zR,YL])}function oB(t,e){const n=e.nodes.find(e=>e.name===t);if(n){let i=!1;for(const t of e.scenes)i||rB(t,new bT(bT.IDENTITY),(t,e)=>t!==n||(t.matrix=e,t.translation=void 0,t.rotation=void 0,t.scale=void 0,i=!0,!1));return e.scene={id:t,name:t,nodes:[n]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function aB(t,e){return lw(this,void 0,void 0,function*(){const n=t.scenegraph;let i;i=e?e[n]||(e[n]=fetch(n).then(t=>t.blob())):fetch(n);const r=yield CP(i,YL,{DracoLoader:DN,gltf:{decompressMeshes:!0,postProcess:!0}});return oB(t.scenegraphNode,r)})}function lB(t,e){return lw(this,void 0,void 0,function*(){return oB(t,yield e)})}function cB(t,e,n){if(e&&0!==e.length)return new fR(Object.assign({id:t,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Mw.CARTESIAN,data:e,mesh:new lj,wireframe:!1,getTransformMatrix:t=>t.transformMatrix,getColor:t=>t.color||[255,255,255,229.5]},n))}let uB=(()=>{class t extends jP{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),sB()}renderLayers(){const e=this.state,n=e.data.filter(t=>!t.scenegraph&&!t.wireframe&&t.unpickable),i=e.data.filter(t=>!t.scenegraph&&!t.wireframe&&!t.unpickable),r=e.data.filter(t=>!t.scenegraph&&t.wireframe),s=e.data.filter(t=>!!t.scenegraph);e.doCollisions&&function(t){lw(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=t.filter(t=>!t.scenegraph&&!t.wireframe).map(t=>{const e=new bT(t.transformMatrix),n=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return{"@id":t["@id"],name:t.tooltip,entityId:t.entityId,bbox:new gj({lowerBound:new hj(...n.map((t,e)=>Math.min(t,i[e]))),upperBound:new hj(...i.map((t,e)=>Math.max(t,n[e])))})}}),n=[];for(const o of t.filter(t=>!!t.scenegraph)){const t=yield AP(o.scenegraph,YL,{DracoLoader:DN,decompress:!0,postProcess:!0});for(const e of t.scenes)rB(e,new bT(o.transformMatrix),(e,i)=>{if(e.mesh&&e.mesh.primitives&&e.mesh.primitives.length>0)for(const r of e.mesh.primitives)if(r.attributes.POSITION&&r.attributes.POSITION.min){const s=i.transformAsPoint(r.attributes.POSITION.min,[]),a=i.transformAsPoint(r.attributes.POSITION.max,[]);n.push({"@id":o["@id"],name:e.name,entityId:o.entityId,bbox:new gj({lowerBound:new hj(...s.map((t,e)=>Math.min(t,a[e]))),upperBound:new hj(...a.map((t,e)=>Math.max(t,s[e])))}),gltf:t})}return!0})}const i=[],r=[];for(const t of e){const e=[];for(const i of n)t.bbox.overlaps(i.bbox)&&e.push({"@id":i["@id"],name:i.name});e.length>0?i.push({"@id":t.entityId,name:t.name,hits:e}):r.push(t)}console.log({sourceBoxes:e,targetBoxes:n,report:i,sad:r,maxHits:Math.max(...i.map(t=>t.hits.length))});const s=[];for(const t of i){s.push({"Tissue ID":t["@id"],"Tissue Name":t.name,"Hit ID":"","Hit Name":""});for(const e of t.hits)s.push({"Tissue ID":t["@id"],"Tissue Name":t.name,"Hit ID":e["@id"],"Hit Name":e.name})}return console.log(s),i})}(e.data);const o={};for(const a of s)a.scenegraph&&a.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,a.scenegraph)&&(o[a.scenegraph]=aB({scenegraph:a.scenegraph},t.gltfCache));return[cB("cubes",n,{wireframe:!1,pickable:!1}),cB("pickableCubes",i,{wireframe:!1,pickable:!0}),cB("wireframes",r,{wireframe:!0,pickable:!1}),...s.map(t=>{var n;return new nj({id:"models-"+t["@id"],opacity:t.zoomBasedOpacity?e.zoomOpacity:void 0!==t.opacity?t.opacity:1,pickable:!t.unpickable,coordinateSystem:Mw.CARTESIAN,data:[t],scenegraph:t.scenegraphNode?lB(t.scenegraphNode,o[t.scenegraph]):t.scenegraph,_lighting:t._lighting,getTransformMatrix:t.transformMatrix,getColor:null!==(n=t.color)&&void 0!==n?n:[0,255,0,127.5],parameters:{depthMask:!t.zoomBasedOpacity&&(void 0===t.opacity||1===t.opacity)}})})].filter(t=>!!t)}getPickingInfo(t){return t.info}}return t.layerName="BodyUILayer",t.gltfCache={},t})();function hB(t,e=[]){for(const n of t.nodes||t.children||[])e.push(n.name),hB(n,e);return e}let dB=(()=>{class t{constructor(t){var e,n,i,r,s;this.deckProps=t,this.bodyUILayer=new uB({}),this.nodeClickSubject=new P,this.nodeHoverStartSubject=new P,this.nodeHoverStopSubject=new P,this.sceneRotationSubject=new Uf([0,0]),this.nodeDragStartSubject=new P,this.nodeDragSubject=new P,this.nodeDragEndSubject=new P,this.nodeClick$=this.nodeClickSubject.pipe(at()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(at()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(at()),this.sceneRotation$=this.sceneRotationSubject.pipe(at()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(at()),this.nodeDrag$=this.nodeDragSubject.pipe(at()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(at());const o=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new pI({flipY:!1,near:-1e3}):new bI({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:t=>{var e;return null!==(e=this.cursor)&&void 0!==e?e:t.isDragging?"grabbing":"grab"}});t.legacyLighting&&(o.effects=[new $I({ambientLight:new wI({color:[255,255,255],intensity:10})})]),this.deck=new WD(o),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(e=t.minRotationX)&&void 0!==e?e:-15,maxRotationX:null!==(n=t.maxRotationX)&&void 0!==n?n:15,target:null!==(i=t.target)&&void 0!==i?i:[.5,.5,0],rotationX:0,rotationOrbit:null!==(r=t.rotation)&&void 0!==r?r:0,zoom:null!==(s=t.zoom)&&void 0!==s?s:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return lw(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let e=this.bodyUILayer.state.zoomOpacity,n=!1;for(const i of t)i.zoomToOnLoad&&(this.zoomTo(i),n=!0);e=n?.05:e,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,e):this.bodyUILayer.setState({data:t,zoomOpacity:e})}}debugSceneNodeProcessing(t,e){const n="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",i=new bT([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(t,e,n){return lw(this,void 0,void 0,function*(){sB();const n=yield aB({scenegraph:t,scenegraphNode:"VHF_Kidney_L_Low1"}),i={},r=[];for(const s of n.scenes)rB(s,e=new bT(e||bT.IDENTITY),(n,s)=>{const o={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new bT(s),wireframe:!0,node:n};if(r.push({"@id":`GLTF:${o["@id"]}`,"@type":"GLTFNode",scenegraph:t,scenegraphNode:o["@id"],transformMatrix:new bT(e||bT.IDENTITY),tooltip:n.name||n.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:n}),n.mesh&&n.mesh.primitives&&n.mesh.primitives.length>0)for(const t of n.mesh.primitives)if(t.attributes.POSITION&&t.attributes.POSITION.min){const e=s.transformAsPoint(t.attributes.POSITION.min,[]),n=s.transformAsPoint(t.attributes.POSITION.max,[]);o.bbox=new gj({lowerBound:new hj(...e.map((t,e)=>Math.min(t,n[e]))),upperBound:new hj(...n.map((t,n)=>Math.max(t,e[n])))})}return i[o["@id"]]=o,!0});for(const t of Object.values(i).filter(t=>!t.bbox)){for(const e of hB(t.node).map(t=>i[t]).filter(t=>t.bbox))t.bbox?t.bbox.extend(e.bbox):t.bbox=e.bbox.clone();t.bbox||delete i[t["@id"]]}for(const t of Object.values(i)){const e=t.bbox.lowerBound,n=(t.size=t.bbox.upperBound.clone().vsub(e)).clone().vmul(new hj(.5,.5,.5)),i=t.center=e.clone().vadd(n);t.transformMatrix=new bT(bT.IDENTITY).translate(i.toArray()).scale(n.toArray())}for(const t of r)i[t["@id"]]=t;return i})})(n,i).then(r=>{console.log("results",r),console.log("data",t),(t=t.concat(Object.values(r))).push({"@id":"TEST","@type":"TEST",scenegraph:n,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:i,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:e})})}zoomTo(t){const e=new bT(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:e.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:e}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?e!==t.object&&(e&&this.nodeHoverStopSubject.next(e),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):e&&(this.nodeHoverStopSubject.next(e),this.lastHovered=void 0)}_onClick(t,e){var n,i;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(i=null===(n=null==e?void 0:e.srcEvent)||void 0===n?void 0:n.ctrlKey)&&void 0!==i?i:void 0})}_onViewStateChange(t){var e;if(null===(e=t.interactionState)||void 0===e?void 0:e.isZooming){const e=this.bodyUILayer.state,n=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);e.zoomOpacity!==n&&this.bodyUILayer.setState({data:e.data,zoomOpacity:n})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,e){this._dragEvent(t,e,this.nodeDragStartSubject)}_onDrag(t,e){this._dragEvent(t,e,this.nodeDragSubject)}_onDragEnd(t,e){this._dragEvent(t,e,this.nodeDragEndSubject)}_dragEvent(t,e,n){var i;(null===(i=null==t?void 0:t.object)||void 0===i?void 0:i["@id"])&&n.next({node:t.object,info:t,e})}}return sw([iB.ZP],t.prototype,"_onHover",null),sw([iB.ZP],t.prototype,"_onClick",null),sw([iB.ZP],t.prototype,"_onViewStateChange",null),sw([iB.ZP],t.prototype,"_onDragStart",null),sw([iB.ZP],t.prototype,"_onDrag",null),sw([iB.ZP],t.prototype,"_onDragEnd",null),t})();function pB(t,e){return t===e}function fB(t,e,n){if(null===e||null===n||e.length!==n.length)return!1;const i=e.length;for(let r=0;r(t&&t.providers||[]).some(t=>t&&t.provide&&"MockNgModuleResolver"===t.provide.name||!1))});let bB=(()=>{class t{constructor(){this.bootstrap$=new lp(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const yB=new oi("INITIAL_STATE_TOKEN");let vB=(()=>{class t{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return t.value={},t})();const _B=new oi("Internals.StateContextFactory"),wB=new oi("Internals.StateFactory");function xB(t,e){return e?n=>n.pipe(xB((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new SB(t))}class SB{constructor(t){this.project=t}call(t,e){return e.subscribe(new EB(t,this.project))}}class EB extends ${constructor(t,e){super(t),this.project=e,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(t){this.hasSubscription||this.tryNext(t)}tryNext(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this.hasSubscription=!0,this._innerSub(e)}_innerSub(t){const e=new H(this),n=this.destination;n.add(e);const i=G(t,e);i!==e&&n.add(i)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function CB(t=null){return e=>e.lift(new OB(t))}class OB{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new TB(t,this.defaultValue))}}class TB extends v{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}const kB={STATE_NAME:t=>`${t} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(t,e,n)=>`State name '${t}' from ${e} already exists in ${n}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:t=>`'${t}' class should be decorated with @Injectable() right after the @State() decorator`};let AB=(()=>{class t{constructor(t,e){this._ngZone=t,this._platformId=e,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return function(t){return"server"===t}(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return xu.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return xu.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof xu||console.warn(kB.ZONE_WARNING())}}return t.\u0275fac=function(e){return new(e||t)(Ci(xu),Ci(ou))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const PB=new oi("ROOT_STATE_TOKEN"),IB=new oi("FEATURE_STATE_TOKEN"),MB=new oi("NGXS_PLUGINS"),DB=new oi("NG_TEST_MODE"),RB=new oi("NG_DEV_MODE"),NB="NGXS_META",LB="NGXS_OPTIONS_META";let jB=(()=>{class t{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=AB}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class FB{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}}const BB=new oi("NGXS_EXECUTION_STRATEGY");function VB(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}const zB=(t,e,n)=>{t=Object.assign({},t);const i=e.split("."),r=i.length-1;return i.reduce((t,e,i)=>(t[e]=i===r?n:Array.isArray(t[e])?t[e].slice():Object.assign({},t[e]),t&&t[e]),t),t},UB=(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t),HB=t=>t&&"object"==typeof t&&!Array.isArray(t),$B=(t,...e)=>{if(!e.length)return t;const n=e.shift();if(HB(t)&&HB(n))for(const i in n)HB(n[i])?(t[i]||Object.assign(t,{[i]:{}}),$B(t[i],n[i])):Object.assign(t,{[i]:n[i]});return $B(t,...e)};function GB(t){return t[NB]}function WB(t,e){const n=UB(e.currentAppState,t.path),i=UB(e.newAppState,t.path);return new FB(n,i,!t.isInitialised)}function qB(...t){return function(t,e,n=XB){const i=function(t){return t.reduce((t,e)=>(t[VB(e)]=!0,t),{})}(t),r=e&&function(t){return t.reduce((t,e)=>(t[e]=!0,t),{})}(e);return function(t){return t.pipe(function(t,e){return Hd(n=>{const i=VB(n.action);return t[i]&&(!e||e[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function XB(){return D(t=>t.action)}function YB(t){return e=>new C(n=>e.subscribe({next(e){t.leave(()=>n.next(e))},error(e){t.leave(()=>n.error(e))},complete(){t.leave(()=>n.complete())}}))}let KB=(()=>{class t{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(BB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class QB extends P{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(t){if(this._busyPushingNext)this._itemQueue.unshift(t);else{for(this._busyPushingNext=!0,super.next(t);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let ZB=(()=>{class t extends QB{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),JB=(()=>{class t extends C{constructor(t,e){super(n=>{const i=t.pipe(YB(e)).subscribe({next:t=>n.next(t),error:t=>n.error(t),complete:()=>n.complete()});n.add(i)})}}return t.\u0275fac=function(e){return new(e||t)(Ci(ZB),Ci(KB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const tV=t=>(...e)=>t.shift()(...e,(...e)=>tV(t)(...e));let eV=(()=>{class t extends Uf{constructor(){super({})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),nV=(()=>{class t{constructor(t,e){this._parentManager=t,this._pluginHandlers=e,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(t=>t.handle?t.handle.bind(t):t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12),Ci(MB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),iV=(()=>{class t extends P{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),rV=(()=>{class t{constructor(t,e,n,i,r,s){this._injector=t,this._actions=e,this._actionResults=n,this._pluginManager=i,this._stateStream=r,this._ngxsExecutionStrategy=s}dispatch(t){const e=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return e.subscribe({error:t=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(kr),this._errorHandler.handleError(t)}catch(e){}})}),e.pipe(YB(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?wd(this._stateStream.getValue()):hv(t.map(t=>this.dispatchSingle(t))):this.dispatchSingle(t)}dispatchSingle(t){if(!VB(t))return ip(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const e=this._stateStream.getValue();return tV([...this._pluginManager.plugins,(t,n)=>{t!==e&&this._stateStream.next(t);const i=this.getActionResultStream(n);return i.subscribe(t=>this._actions.next(t)),this._actions.next({action:n,status:"DISPATCHED"}),this.createDispatchObservable(i)}])(e,t).pipe(up())}getActionResultStream(t){return this._actionResults.pipe(Hd(e=>e.action===t&&"DISPATCHED"!==e.status),Gp(1),up())}createDispatchObservable(t){return t.pipe(xB(t=>{switch(t.status){case"SUCCESSFUL":return wd(this._stateStream.getValue());case"ERRORED":return ip(t.error);default:return ep}})).pipe(up())}}return t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(ZB),Ci(iV),Ci(nV),Ci(eV),Ci(KB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const sV=t=>{Object.freeze(t);const e="function"==typeof t,n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(function(i){n.call(t,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==t[i]&&("object"==typeof t[i]||"function"==typeof t[i])&&!Object.isFrozen(t[i])&&sV(t[i])}),t};let oV=(()=>{class t{constructor(t,e){this.isDevMode=t,this.isTestMode=e}}return t.\u0275fac=function(e){return new(e||t)(Ci(RB),Ci(DB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),aV=(()=>{class t{constructor(t,e){this._host=t,this._config=e}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(kB.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(kB.INCORRECT_DEVELOPMENT()))}}return t.\u0275fac=function(e){return new(e||t)(Ci(oV),Ci(jB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),lV=(()=>{class t{constructor(t,e,n,i){this._stateStream=t,this._dispatcher=e,this._config=n,i.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:t=>this._stateStream.next(t),dispatch:t=>this._dispatcher.dispatch(t)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:e=>{const n=sV(e);return t.setState(n)},dispatch:e=>t.dispatch(e)}}setStateToTheCurrentWithNew(t){const e=this.getRootStateOperations(),n=e.getState();e.setState(Object.assign({},n,t.defaults))}}return t.\u0275fac=function(e){return new(e||t)(Ci(eV),Ci(rV),Ci(jB),Ci(aV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),cV=(()=>{class t{constructor(t){this._internalStateOperations=t}createStateContext(t){const e=this._internalStateOperations.getRootStateOperations();function n(e){return UB(e,t.path)}function i(n,i){const r=zB(n,t.path,i),s=t.instance;if(s.ngxsOnChanges){const e=WB(t,{currentAppState:n,newAppState:r});s.ngxsOnChanges(e)}return e.setState(r),r}function r(t,e){return i(t,e(n(t)))}return{getState:()=>n(e.getState()),patchState:t=>r(e.getState(),function(t){return e=>{if(Array.isArray(t))throw new Error(kB.PATCHING_ARRAY());if("object"!=typeof t)throw new Error(kB.PATCHING_PRIMITIVE());const n=Object.assign({},e);for(const i in t)n[i]=t[i];return n}}(t)),setState(t){const n=e.getState();return function(t){return"function"==typeof t}(t)?r(n,t):i(n,t)},dispatch:t=>e.dispatch(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(lV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class uV{static stateNameErrorMessage(t){return kB.STATE_NAME(t)}static checkCorrectStateName(t){if(!t)throw new Error(kB.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(t))throw new Error(this.stateNameErrorMessage(t))}static checkStateNameIsUnique(t,e){const n=this.getValidStateMeta(t).name,i=e[n];if(i&&i!==t)throw new Error(kB.STATE_UNIQUE(n,t.name,i.name));return n}static getValidStateMeta(t){const e=GB(t);if(!e)throw new Error(kB.STATE_DECORATOR());return e}}uV.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let hV=(()=>{class t{constructor(t,e,n,i,r,s,o){this._injector=t,this._config=e,this._parentFactory=n,this._actions=i,this._actionResults=r,this._stateContextFactory=s,this._initialState=o,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=gB(()=>{const t=this;function e(e){const n=t.statePaths[e];return n?function(t,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(t){const e=t.slice();return t=>e.reduce((t,e)=>t&&t[e],t)}(t):function(t){const e=t;let n="store."+e[0],i=0;const r=e.length;let s=n;for(;++i(n||(n=e(t)),n?n(...i):void 0))},getSelectorOptions:e=>Object.assign({},t._config.selectorOptions,e||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let e={};return e=Array.isArray(t)?t.slice():function(t){return"object"==typeof t&&null!==t||"function"==typeof t}(t)?Object.assign({},t):void 0===t?{}:t,e}static checkStatesAreValid(t){t.forEach(uV.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(e){t.checkStatesAreValid(e);const{newStates:n}=this.addToStatesMap(e);if(!n.length)return[];const i=function(t){const e=e=>{const n=t.find(t=>t===e);if(!n)throw new Error(`Child state not found: ${e}. \r\nYou may have forgotten to add states to module`);return n[NB].name};return t.reduce((t,n)=>{const{name:i,children:r}=n[NB];return t[i]=(r||[]).map(e),t},{})}(n),r=function(t){const e=[],n={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),n[r]=!0,t[r].forEach(t=>{if(s.indexOf(t)>=0)throw new Error(`Circular dependency '${t}' is required by '${r}': ${s.join(" -> ")}`);n[t]||i(t,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(t).forEach(t=>i(t)),e.reverse()}(i),s=function(t,e={}){const n=(t,e)=>{for(const i in t)if(t.hasOwnProperty(i)&&t[i].indexOf(e)>=0){const e=n(t,i);return null!==e?`${e}.${i}`:i}return null};for(const i in t)if(t.hasOwnProperty(i)){const r=n(t,i);e[i]=r?`${r}.${i}`:i}return e}(i),o=function(t){return t.reduce((t,e)=>(t[e[NB].name]=e,t),{})}(n),a=[];for(const l of r){const e=o[l],n=s[l],i=e[NB];this.addRuntimeInfoToMeta(i,n);const r={name:l,path:n,isInitialised:!1,actions:i.actions,instance:this._injector.get(e),defaults:t.cloneDefaults(i.defaults)};this.hasBeenMountedAndBootstrapped(l,n)||a.push(r),this.states.push(r)}return a}addAndReturnDefaults(t){const e=this.add(t||[]);return{defaults:e.reduce((t,e)=>zB(t,e.path,e.defaults),{}),states:e}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Hd(t=>"DISPATCHED"===t.status),W(({action:t})=>this.invokeActions(this._actions,t).pipe(D(()=>({action:t,status:"SUCCESSFUL"})),CB({action:t,status:"CANCELED"}),pv(e=>wd({action:t,status:"ERRORED",error:e}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,e){const n=VB(e),i=[];for(const s of this.states){const o=s.actions[n];if(o)for(const n of o){const o=this._stateContextFactory.createStateContext(s);try{let r=s.instance[n.fn](o,e);r instanceof Promise&&(r=U(r)),r instanceof C?(r=r.pipe(CB({})),n.options.cancelUncompleted&&(r=r.pipe(Wd(t.pipe(qB(e)))))):r=wd({}).pipe(up()),i.push(r)}catch(r){i.push(ip(r))}}}return i.length||i.push(wd({})),hv(i)}addToStatesMap(t){const e=[],n=this.statesByName;for(const i of t){const t=uV.checkStateNameIsUnique(i,n);!n[t]&&(e.push(i),n[t]=i)}return{newStates:e}}addRuntimeInfoToMeta(t,e){this.statePaths[t.name]=e,t.path=e}hasBeenMountedAndBootstrapped(t,e){const n=void 0!==UB(this._initialState,e);return this.statesByName[t]&&n}}return t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(jB),Ci(t,12),Ci(ZB),Ci(iV),Ci(cV),Ci(yB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),dV=(()=>{class t{constructor(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}ngxsBootstrap(t,e){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Hd(()=>!!e),$f(()=>this.invokeInit(e.states)),W(()=>this.bootstrapper.appBootstrapped$),Hd(t=>!!t)).subscribe(()=>this.invokeBootstrap(e.states))}invokeInit(t){for(const e of t){const t=e.instance;if(t.ngxsOnChanges){const n=WB(e,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});t.ngxsOnChanges(n)}t.ngxsOnInit&&t.ngxsOnInit(this.getStateContext(e)),e.isInitialised=!0}}invokeBootstrap(t){for(const e of t){const t=e.instance;t.ngxsAfterBootstrap&&t.ngxsAfterBootstrap(this.getStateContext(e))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(lV),Ci(cV),Ci(bB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();let pV=(()=>{class t{constructor(t,e,n,i,r,s){this._stateStream=t,this._internalStateOperations=e,this._config=n,this._internalExecutionStrategy=i,this._stateFactory=r,this.initStateStream(s)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const e=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(D(e),pv(t=>{const{suppressErrors:e}=this._config.selectorOptions;return t instanceof TypeError&&e?wd(void 0):ip(t)}),Rd(),YB(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Gp(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(YB(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(t){const e=function(t){return t.NGXS_SELECTOR_META}(t)||GB(t);return e&&e.makeRootSelector||(()=>t)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const e=this._stateStream.value;if(!e||0===Object.keys(e).length){const e=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(e)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(eV),Ci(lV),Ci(jB),Ci(KB),Ci(hV),Ci(yB,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),fV=(()=>{class t{constructor(e,n){t.store=e,t.config=n}ngOnDestroy(){t.store=null,t.config=null}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV),Ci(jB))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t.store=null,t.config=null,t})();class gV{static get type(){return"@@INIT"}}class mV{constructor(t){this.addedStates=t}static get type(){return"@@UPDATE_STATE"}}const bV=new lp(1);let yV=(()=>{class t{constructor(e,n,i,r,s=[],o){!function(){try{const t=window.ng,e=!(t.probe&&t.coreTokens)&&Nu();bV.next(e)}catch(t){bV.next(!1)}finally{bV.complete()}}();const a=e.addAndReturnDefaults(s);n.setStateToTheCurrentWithNew(a),e.connectActionHandlers(),o.ngxsBootstrap(new gV,a)}}return t.\u0275fac=function(e){return new(e||t)(Ci(hV),Ci(lV),Ci(pV),Ci(fV),Ci(PB,8),Ci(dV))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),vV=(()=>{class t{constructor(e,n,i,r=[],s){const o=t.flattenStates(r),a=i.addAndReturnDefaults(o);a.states.length&&(n.setStateToTheCurrentWithNew(a),s.ngxsBootstrap(new mV(a.defaults),a))}static flattenStates(t=[]){return t.reduce((t,e)=>t.concat(e),[])}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV),Ci(lV),Ci(hV),Ci(IB,8),Ci(dV))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class _V{static forRoot(t=[],e={}){return{ngModule:yV,providers:[hV,cV,JB,ZB,bB,aV,oV,dV,rV,iV,lV,KB,pV,eV,fV,nV,...t,..._V.ngxsTokenProviders(t,e)]}}static forFeature(t=[]){return{ngModule:vV,providers:[hV,nV,...t,{provide:IB,multi:!0,useValue:t}]}}static ngxsTokenProviders(t,e){return[{provide:DB,useValue:mB},{provide:RB,useValue:Nu},{provide:BB,useClass:e.executionStrategy||AB},{provide:PB,useValue:t},{provide:_V.ROOT_OPTIONS,useValue:e},{provide:jB,useFactory:_V.ngxsConfigFactory,deps:[_V.ROOT_OPTIONS]},{provide:au,useFactory:_V.appBootstrapListenerFactory,multi:!0,deps:[bB]},{provide:yB,useFactory:_V.getInitialState},{provide:_B,useExisting:cV},{provide:wB,useExisting:hV}]}static ngxsConfigFactory(t){return $B(new jB,t)}static appBootstrapListenerFactory(t){return()=>t.bootstrap()}static getInitialState(){return vB.pop()}}function wV(t){return e=>{!function(t){bV.subscribe(e=>{e&&(t.\u0275prov||console.warn(kB.UNDECORATED_STATE_IN_IVY(t.name)))})}(e);const n=e,i=function(t){if(!t.hasOwnProperty(NB)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,NB,{value:e})}return GB(t)}(n),r=Object.getPrototypeOf(n),s=function(e){return Object.assign({},e[LB]||{},t)}(r);(function(t){const{meta:e,inheritedStateClass:n,optionsWithInheritance:i}=t,{children:r,defaults:s,name:o}=i,a="string"==typeof o?o:o&&o.getName()||null;uV.checkCorrectStateName(a),n.hasOwnProperty(NB)&&(e.actions=Object.assign({},e.actions,(n[NB]||{}).actions)),e.children=r,e.defaults=s,e.name=a})({meta:i,inheritedStateClass:r,optionsWithInheritance:s}),n[LB]=s}}_V.\u0275fac=function(t){return new(t||_V)},_V.\u0275mod=ie({type:_V}),_V.\u0275inj=St({}),_V.ROOT_OPTIONS=new oi("ROOT_OPTIONS");let xV=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}setProperty(t,e){this._renderer.setProperty(this._elementRef.nativeElement,t,e)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl))},t.\u0275dir=se({type:t}),t})(),SV=(()=>{class t extends xV{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,features:[jo]}),t})();const EV=new oi("NgValueAccessor"),CV={provide:EV,useExisting:pt(()=>TV),multi:!0},OV=new oi("CompositionEventMode");let TV=(()=>{class t extends xV{constructor(t,e,n){super(t,e),this._compositionMode=n,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=Xu()?Xu().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl),ea(OV,8))},t.\u0275dir=se({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,e){1&t&&fa("input",function(t){return e._handleInput(t.target.value)})("blur",function(){return e.onTouched()})("compositionstart",function(){return e._compositionStart()})("compositionend",function(t){return e._compositionEnd(t.target.value)})},features:[_l([CV]),jo]}),t})();const kV=new oi("NgValidators"),AV=new oi("NgAsyncValidators");function PV(t){return null!=t}function IV(t){const e=ha(t)?U(t):t;return pa(e),e}function MV(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function DV(t,e){return e.map(e=>e(t))}function RV(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function NV(t){return null!=t?function(t){if(!t)return null;const e=t.filter(PV);return 0==e.length?null:function(t){return MV(DV(t,e))}}(RV(t)):null}function LV(t){return null!=t?function(t){if(!t)return null;const e=t.filter(PV);return 0==e.length?null:function(t){return hv(DV(t,e).map(IV)).pipe(D(MV))}}(RV(t)):null}function jV(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function FV(t){return t._rawValidators}function BV(t){return t._rawAsyncValidators}function VV(t){return t?Array.isArray(t)?t:[t]:[]}function zV(t,e){return Array.isArray(t)?t.includes(e):t===e}function UV(t,e){const n=VV(e);return VV(t).forEach(t=>{zV(n,t)||n.push(t)}),n}function HV(t,e){return VV(e).filter(e=>!zV(t,e))}let $V=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=NV(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=LV(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})(),GV=(()=>{class t extends $V{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,features:[jo]}),t})();class WV extends $V{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class qV{constructor(t){this._cd=t}is(t){var e,n,i;return"submitted"===t?!!(null===(e=this._cd)||void 0===e?void 0:e.submitted):!!(null===(i=null===(n=this._cd)||void 0===n?void 0:n.control)||void 0===i?void 0:i[t])}}let XV=(()=>{class t extends qV{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(WV,2))},t.\u0275dir=se({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,e){2&t&&ja("ng-untouched",e.is("untouched"))("ng-touched",e.is("touched"))("ng-pristine",e.is("pristine"))("ng-dirty",e.is("dirty"))("ng-valid",e.is("valid"))("ng-invalid",e.is("invalid"))("ng-pending",e.is("pending"))},features:[jo]}),t})(),YV=(()=>{class t extends qV{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(GV,10))},t.\u0275dir=se({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(t,e){2&t&&ja("ng-untouched",e.is("untouched"))("ng-touched",e.is("touched"))("ng-pristine",e.is("pristine"))("ng-dirty",e.is("dirty"))("ng-valid",e.is("valid"))("ng-invalid",e.is("invalid"))("ng-pending",e.is("pending"))("ng-submitted",e.is("submitted"))},features:[jo]}),t})();function KV(t,e){JV(t,e),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&ez(t,e)})}(t,e),function(t,e){const n=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&ez(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),function(t,e){if(e.valueAccessor.setDisabledState){const n=t=>{e.valueAccessor.setDisabledState(t)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}(t,e)}function QV(t,e,n=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),tz(t,e),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function ZV(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function JV(t,e){const n=FV(t);null!==e.validator?t.setValidators(jV(n,e.validator)):"function"==typeof n&&t.setValidators([n]);const i=BV(t);null!==e.asyncValidator?t.setAsyncValidators(jV(i,e.asyncValidator)):"function"==typeof i&&t.setAsyncValidators([i]);const r=()=>t.updateValueAndValidity();ZV(e._rawValidators,r),ZV(e._rawAsyncValidators,r)}function tz(t,e){let n=!1;if(null!==t){if(null!==e.validator){const i=FV(t);if(Array.isArray(i)&&i.length>0){const r=i.filter(t=>t!==e.validator);r.length!==i.length&&(n=!0,t.setValidators(r))}}if(null!==e.asyncValidator){const i=BV(t);if(Array.isArray(i)&&i.length>0){const r=i.filter(t=>t!==e.asyncValidator);r.length!==i.length&&(n=!0,t.setAsyncValidators(r))}}}const i=()=>{};return ZV(e._rawValidators,i),ZV(e._rawAsyncValidators,i),n}function ez(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function nz(t,e){JV(t,e)}function iz(t,e){t._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)})}function rz(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const sz="VALID",oz="INVALID",az="PENDING",lz="DISABLED";function cz(t){return(pz(t)?t.validators:t)||null}function uz(t){return Array.isArray(t)?NV(t):t||null}function hz(t,e){return(pz(e)?e.asyncValidators:t)||null}function dz(t){return Array.isArray(t)?LV(t):t||null}function pz(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class fz{constructor(t,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=uz(this._rawValidators),this._composedAsyncValidatorFn=dz(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===sz}get invalid(){return this.status===oz}get pending(){return this.status==az}get disabled(){return this.status===lz}get enabled(){return this.status!==lz}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=uz(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=dz(t)}addValidators(t){this.setValidators(UV(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(UV(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(HV(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(HV(t,this._rawAsyncValidators))}hasValidator(t){return zV(this._rawValidators,t)}hasAsyncValidator(t){return zV(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=az,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=lz,this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=sz,this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===sz||this.status===az)&&this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?lz:sz}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=az,this._hasOwnPendingAsyncValidator=!0;const e=IV(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(e,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=t;return e.forEach(t=>{i=i instanceof mz?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof bz&&i.at(t)||null}),i}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new Rc,this.statusChanges=new Rc}_calculateStatus(){return this._allControlsDisabled()?lz:this.errors?oz:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(az)?az:this._anyControlsHaveStatus(oz)?oz:sz}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){pz(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class gz extends fz{constructor(t=null,e,n){super(cz(e),hz(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){rz(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){rz(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class mz extends fz{constructor(t,e,n){super(cz(e),hz(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,n={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof gz?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>{const n=this.controls[e];n&&t(n,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,i)=>{n=e(n,t,i)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class bz extends fz{constructor(t,e,n){super(cz(e),hz(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(t){return this.controls[t]}push(t,e={}){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(t,e,n={}){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:n.emitEvent})}removeAt(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t=[],e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof gz?t.value:t.getRawValue())}clear(t={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:t.emitEvent}))}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error(`Cannot find form control at index ${t}`)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}const yz={provide:GV,useExisting:pt(()=>_z)},vz=(()=>Promise.resolve(null))();let _z=(()=>{class t extends GV{constructor(t,e){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Rc,this.form=new mz({},NV(t),LV(e))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){vz.then(()=>{const e=this._findContainer(t.path);t.control=e.registerControl(t.name,t.control),KV(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){vz.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name),rz(this._directives,t)})}addFormGroup(t){vz.then(()=>{const e=this._findContainer(t.path),n=new mz({});nz(n,t),e.registerControl(t.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){vz.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,e){vz.then(()=>{this.form.get(t.path).setValue(e)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,iz(this.form,this._directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10))},t.\u0275dir=se({type:t,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,e){1&t&&fa("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_l([yz]),jo]}),t})(),wz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),t})(),xz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Sz=new oi("NgModelWithFormControlWarning"),Ez={provide:WV,useExisting:pt(()=>Cz)};let Cz=(()=>{class t extends WV{constructor(t,e,n,i){super(),this._ngModelWarningConfig=i,this.update=new Rc,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(e),this.valueAccessor=function(t,e){if(!e)return null;let n,i,r;return Array.isArray(e),e.forEach(t=>{t.constructor===TV?n=t:function(t){return Object.getPrototypeOf(t.constructor)===SV}(t)?i=t:r=t}),r||i||n||null}(0,n)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const e=t.form.previousValue;e&&QV(e,this,!1),KV(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}(function(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)})(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&QV(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10),ea(EV,10),ea(Sz,8))},t.\u0275dir=se({type:t,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[_l([Ez]),jo,ye]}),t._ngModelWarningSentOnce=!1,t})();const Oz={provide:GV,useExisting:pt(()=>Tz)};let Tz=(()=>{class t extends GV{constructor(t,e){super(),this.validators=t,this.asyncValidators=e,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Rc,this._setValidators(t),this._setAsyncValidators(e)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(tz(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const e=this.form.get(t.path);return KV(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){QV(t.control||null,t,!1),rz(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,e){this.form.get(t.path).setValue(e)}onSubmit(t){return this.submitted=!0,iz(this.form,this.directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const e=t.control,n=this.form.get(t.path);e!==n&&(QV(e||null,t),n instanceof gz&&(KV(n,t),t.control=n))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const e=this.form.get(t.path);nz(e,t),e.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const e=this.form.get(t.path);e&&function(t,e){return tz(t,e)}(e,t)&&e.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){JV(this.form,this),this._oldForm&&tz(this._oldForm,this)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(ea(kV,10),ea(AV,10))},t.\u0275dir=se({type:t,selectors:[["","formGroup",""]],hostBindings:function(t,e){1&t&&fa("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_l([Oz]),jo,ye]}),t})(),kz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[xz]]}),t})(),Az=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[kz]}),t})(),Pz=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:Sz,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[kz]}),t})();function Iz(t){return new C(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?U(n):np()).subscribe(e)})}const Mz=["underline"],Dz=["connectionContainer"],Rz=["inputContainer"],Nz=["label"];function Lz(t,e){1&t&&(aa(0),ra(1,"div",14),oa(2,"div",15),oa(3,"div",16),oa(4,"div",17),sa(),ra(5,"div",18),oa(6,"div",15),oa(7,"div",16),oa(8,"div",17),sa(),la())}function jz(t,e){1&t&&(ra(0,"div",19),xa(1,1),sa())}function Fz(t,e){if(1&t&&(aa(0),xa(1,2),ra(2,"span"),Za(3),sa(),la()),2&t){const t=va(2);ws(3),Ja(t._control.placeholder)}}function Bz(t,e){1&t&&xa(0,3,["*ngSwitchCase","true"])}function Vz(t,e){1&t&&(ra(0,"span",23),Za(1," *"),sa())}function zz(t,e){if(1&t){const t=ua();ra(0,"label",20,21),fa("cdkObserveContent",function(){return $e(t),va().updateOutlineGap()}),Jo(2,Fz,4,1,"ng-container",12),Jo(3,Bz,1,0,"ng-content",12),Jo(4,Vz,2,0,"span",22),sa()}if(2&t){const t=va();ja("mat-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-form-field-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-accent","accent"==t.color)("mat-warn","warn"==t.color),na("cdkObserveContentDisabled","outline"!=t.appearance)("id",t._labelId)("ngSwitch",t._hasLabel()),Ko("for",t._control.id)("aria-owns",t._control.id),ws(2),na("ngSwitchCase",!1),ws(1),na("ngSwitchCase",!0),ws(1),na("ngIf",!t.hideRequiredMarker&&t._control.required&&!t._control.disabled)}}function Uz(t,e){1&t&&(ra(0,"div",24),xa(1,4),sa())}function Hz(t,e){if(1&t&&(ra(0,"div",25,26),oa(2,"span",27),sa()),2&t){const t=va();ws(2),ja("mat-accent","accent"==t.color)("mat-warn","warn"==t.color)}}function $z(t,e){1&t&&(ra(0,"div"),xa(1,5),sa()),2&t&&na("@transitionMessages",va()._subscriptAnimationState)}function Gz(t,e){if(1&t&&(ra(0,"div",31),Za(1),sa()),2&t){const t=va(2);na("id",t._hintLabelId),ws(1),Ja(t.hintLabel)}}function Wz(t,e){if(1&t&&(ra(0,"div",28),Jo(1,Gz,2,2,"div",29),xa(2,6),oa(3,"div",30),xa(4,7),sa()),2&t){const t=va();na("@transitionMessages",t._subscriptAnimationState),ws(1),na("ngIf",t.hintLabel)}}const qz=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Xz=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Yz=new oi("MatError"),Kz={transitionMessages:Vg("transitionMessages",[$g("enter",Hg({opacity:1,transform:"translateY(0%)"})),Wg("void => enter",[Hg({opacity:0,transform:"translateY(-5px)"}),zg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let Qz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})();const Zz=new oi("MatHint");let Jz=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-label"]]}),t})(),tU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-placeholder"]]}),t})();const eU=new oi("MatPrefix");let nU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","matPrefix",""]],features:[_l([{provide:eU,useExisting:t}])]}),t})();const iU=new oi("MatSuffix");let rU=0;const sU=jy(class{constructor(t){this._elementRef=t}},"primary"),oU=new oi("MAT_FORM_FIELD_DEFAULT_OPTIONS"),aU=new oi("MatFormField");let lU=(()=>{class t extends sU{constructor(t,e,n,i,r,s,o,a){super(t),this._changeDetectorRef=e,this._dir=i,this._defaults=r,this._platform=s,this._ngZone=o,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new P,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+rU++,this._labelId="mat-form-field-label-"+rU++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==a,this.appearance=r&&r.appearance?r.appearance:"legacy",this._hideRequiredMarker=!(!r||null==r.hideRequiredMarker)&&r.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const e=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&e!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=md(t)}_shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}_canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(t){this._explicitFormFieldControl=t}getLabelId(){return this._hasFloatingLabel()?this._labelId:null}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add(`mat-form-field-type-${t.controlType}`),t.stateChanges.pipe(Kd(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(Wd(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Wd(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),Q(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Kd(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Kd(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(Wd(this._destroyed)).subscribe(()=>{"function"==typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this.updateOutlineGap())}):this.updateOutlineGap()})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(t){const e=this._control?this._control.ngControl:null;return e&&e[t]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}_shouldLabelFloat(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,xd(this._label.nativeElement,"transitionend").pipe(Gp(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_getDefaultFloatLabelState(){return this._defaults&&this._defaults.floatLabel||"auto"}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const e=this._hintChildren?this._hintChildren.find(t=>"start"===t.align):null,n=this._hintChildren?this._hintChildren.find(t=>"end"===t.align):null;e?t.push(e.id):this._hintLabel&&t.push(this._hintLabelId),n&&t.push(n.id)}else this._errorChildren&&t.push(...this._errorChildren.map(t=>t.id));this._control.setDescribedByIds(t)}}_validateControlChild(){}updateOutlineGap(){const t=this._label?this._label.nativeElement:null;if(!("outline"===this.appearance&&t&&t.children.length&&t.textContent.trim()&&this._platform.isBrowser))return;if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);let e=0,n=0;const i=this._connectionContainerRef.nativeElement,r=i.querySelectorAll(".mat-form-field-outline-start"),s=i.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const r=i.getBoundingClientRect();if(0===r.width&&0===r.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const s=this._getStartEnd(r),o=t.children,a=this._getStartEnd(o[0].getBoundingClientRect());let l=0;for(let t=0;t0?.75*l+10:0}for(let o=0;o{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny,ig],Ny]}),t})();function uU(t,e=jd){const n=function(t){return t instanceof Date&&!isNaN(+t)}(t)?+t-e.now():Math.abs(t);return t=>t.lift(new hU(n,e))}class hU{constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new dU(t,this.delay,this.scheduler))}}class dU extends v{constructor(t,e,n){super(t),this.delay=e,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(t){const e=t.source,n=e.queue,i=t.scheduler,r=t.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const e=Math.max(0,n[0].time-i.now());this.schedule(t,e)}else this.unsubscribe(),e.active=!1}_schedule(t){this.active=!0,this.destination.add(t.schedule(dU.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new pU(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(sp.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(sp.createComplete()),this.unsubscribe()}}class pU{constructor(t,e){this.time=t,this.notification=e}}const fU=["panel"];function gU(t,e){if(1&t&&(ra(0,"div",0,1),xa(2),sa()),2&t){const t=e.id,n=va();na("id",n.id)("ngClass",n._classList),Ko("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}const mU=["*"];let bU=0;class yU{constructor(t,e){this.source=t,this.option=e}}const vU=Fy(class{}),_U=new oi("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}});let wU=(()=>{class t extends vU{constructor(t,e,n,i){super(),this._changeDetectorRef=t,this._elementRef=e,this._activeOptionChanges=g.EMPTY,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new Rc,this.opened=new Rc,this.closed=new Rc,this.optionActivated=new Rc,this._classList={},this.id="mat-autocomplete-"+bU++,this.inertGroups=(null==i?void 0:i.SAFARI)||!1,this._autoActiveFirstOption=!!n.autoActiveFirstOption}get isOpen(){return this._isOpen&&this.showPanel}get autoActiveFirstOption(){return this._autoActiveFirstOption}set autoActiveFirstOption(t){this._autoActiveFirstOption=md(t)}set classList(t){this._classList=t&&t.length?function(t,e=/\s+/){const n=[];if(null!=t){const i=Array.isArray(t)?t:`${t}`.split(e);for(const t of i){const e=`${t}`.trim();e&&n.push(e)}}return n}(t).reduce((t,e)=>(t[e]=!0,t),{}):{},this._setVisibilityClasses(this._classList),this._elementRef.nativeElement.className=""}ngAfterContentInit(){this._keyManager=new fg(this.options).withWrap(),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._activeOptionChanges.unsubscribe()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._setVisibilityClasses(this._classList),this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){const e=new yU(this,t);this.optionSelected.emit(e)}_getPanelAriaLabelledby(t){return this.ariaLabel?null:this.ariaLabelledby?(t?t+" ":"")+this.ariaLabelledby:t}_setVisibilityClasses(t){t[this._visibleClass]=this.showPanel,t[this._hiddenClass]=!this.showPanel}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(kl),ea(_U),ea(pp))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(qc(sc,7),qc(fU,5)),2&t){let t;Wc(t=Yc())&&(e.template=t.first),Wc(t=Yc())&&(e.panel=t.first)}},inputs:{displayWith:"displayWith",autoActiveFirstOption:"autoActiveFirstOption",classList:["class","classList"],ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],panelWidth:"panelWidth"},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},features:[jo]}),t})(),xU=(()=>{class t extends wU{constructor(){super(...arguments),this._visibleClass="mat-autocomplete-visible",this._hiddenClass="mat-autocomplete-hidden"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,iv,5),Xc(n,av,5)),2&t){let t;Wc(t=Yc())&&(e.optionGroups=t),Wc(t=Yc())&&(e.options=t)}},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[_l([{provide:Jy,useExisting:t}]),jo],ngContentSelectors:mU,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(t,e){1&t&&(wa(),Jo(0,gU,3,4,"ng-template"))},directives:[mh],styles:[".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}\n"],encapsulation:2,changeDetection:0}),t})();const SU=new oi("mat-autocomplete-scroll-strategy"),EU={provide:SU,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}},CU={provide:EV,useExisting:pt(()=>TU),multi:!0};let OU=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c,u){this._element=t,this._overlay=e,this._viewContainerRef=n,this._zone=i,this._changeDetectorRef=r,this._dir=o,this._formField=a,this._document=l,this._viewportRuler=c,this._defaults=u,this._componentDestroyed=!1,this._autocompleteDisabled=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=g.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new P,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=Iz(()=>this.autocomplete&&this.autocomplete.options?Q(...this.autocomplete.options.map(t=>t.onSelectionChange)):this._zone.onStable.pipe(Gp(1),Qd(()=>this.optionSelections))),this._scrollStrategy=s}get autocompleteDisabled(){return this._autocompleteDisabled}set autocompleteDisabled(t){this._autocompleteDisabled=md(t)}ngAfterViewInit(){const t=this._getWindow();void 0!==t&&this._zone.runOutsideAngular(()=>t.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){const t=this._getWindow();void 0!==t&&t.removeEventListener("blur",this._windowBlurHandler),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._attachOverlay(),this._floatLabel()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this.autocomplete.closed.emit(),this.autocomplete._isOpen=this._overlayAttached=!1,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._componentDestroyed||this._changeDetectorRef.detectChanges())}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Q(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Hd(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Hd(()=>this._overlayAttached)):wd()).pipe(D(t=>t instanceof sv?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Q(xd(this._document,"click"),xd(this._document,"auxclick"),xd(this._document,"touchend")).pipe(Hd(t=>{const e=Ep(t),n=this._formField?this._formField._elementRef.nativeElement:null,i=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&e!==this._element.nativeElement&&(!n||!n.contains(e))&&(!i||!i.contains(e))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(e)}))}writeValue(t){Promise.resolve(null).then(()=>this._setTriggerValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){const e=t.keyCode;if(27===e&&!Qp(t)&&t.preventDefault(),this.activeOption&&13===e&&this.panelOpen)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){const n=this.autocomplete._keyManager.activeItem,i=38===e||40===e;this.panelOpen||9===e?this.autocomplete._keyManager.onKeydown(t):i&&this._canOpen()&&this.openPanel(),(i||this.autocomplete._keyManager.activeItem!==n)&&this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0)}}_handleInput(t){let e=t.target,n=e.value;"number"===e.type&&(n=""==n?null:parseFloat(n)),this._previousValue!==n&&(this._previousValue=n,this._onChange(n),this._canOpen()&&this._document.activeElement===t.target&&this.openPanel())}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_floatLabel(t=!1){this._formField&&"auto"===this._formField.floatLabel&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField.floatLabel="auto",this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){return Q(this._zone.onStable.pipe(Gp(1)),this.autocomplete.options.changes.pipe($f(()=>this._positionStrategy.reapplyLastPosition()),uU(0))).pipe(Qd(()=>{const t=this.panelOpen;return this._resetActiveItem(),this.autocomplete._setVisibility(),this.panelOpen&&(this._overlayRef.updatePosition(),t!==this.panelOpen&&this.autocomplete.opened.emit()),this.panelClosingActions}),Gp(1)).subscribe(t=>this._setValueAndClose(t))}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_setTriggerValue(t){const e=this.autocomplete&&this.autocomplete.displayWith?this.autocomplete.displayWith(t):t,n=null!=e?e:"";this._formField?this._formField._control.value=n:this._element.nativeElement.value=n,this._previousValue=n}_setValueAndClose(t){t&&t.source&&(this._clearPreviousSelectedOption(t.source),this._setTriggerValue(t.source.value),this._onChange(t.source.value),this._element.nativeElement.focus(),this.autocomplete._emitSelectEvent(t.source)),this.closePanel()}_clearPreviousSelectedOption(t){this.autocomplete.options.forEach(e=>{e!==t&&e.selected&&e.deselect()})}_attachOverlay(){var t;let e=this._overlayRef;e?(this._positionStrategy.setOrigin(this._getConnectedElement()),e.updateSize({width:this._getPanelWidth()})):(this._portal=new Lp(this.autocomplete.template,this._viewContainerRef,{id:null===(t=this._formField)||void 0===t?void 0:t.getLabelId()}),e=this._overlay.create(this._getOverlayConfig()),this._overlayRef=e,e.keydownEvents().subscribe(t=>{(27===t.keyCode&&!Qp(t)||38===t.keyCode&&Qp(t,"altKey"))&&(this._closeKeyEventStream.next(),this._resetActiveItem(),t.stopPropagation(),t.preventDefault())}),this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&e&&e.updateSize({width:this._getPanelWidth()})})),e&&!e.hasAttached()&&(e.attach(this._portal),this._closingActionsSubscription=this._subscribeToClosingActions());const n=this.panelOpen;this.autocomplete._setVisibility(),this.autocomplete._isOpen=this._overlayAttached=!0,this.panelOpen&&n!==this.panelOpen&&this.autocomplete.opened.emit()}_getOverlayConfig(){var t;return new af({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir,panelClass:null===(t=this._defaults)||void 0===t?void 0:t.overlayPanelClass})}_getOverlayPosition(){const t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){const e=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],n=this._aboveClass,i=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:n},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:n}];let r;r="above"===this.position?i:"below"===this.position?e:[...e,...i],t.withPositions(r)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){const t=this.autocomplete;t.autoActiveFirstOption?t._keyManager.setFirstItemActive():t._keyManager.setActiveItem(-1)}_canOpen(){const t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this._autocompleteDisabled}_getWindow(){var t;return(null===(t=this._document)||void 0===t?void 0:t.defaultView)||window}_scrollToOption(t){const e=this.autocomplete,n=lv(t,e.options,e.optionGroups);if(0===t&&1===n)e._setScrollTop(0);else if(e.panel){const n=e.options.toArray()[t];if(n){const t=n._getHostElement(),i=cv(t.offsetTop,t.offsetHeight,e._getScrollTop(),e.panel.nativeElement.offsetHeight);e._setScrollTop(i)}}}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(kf),ea(hc),ea(xu),ea(tc),ea(SU),ea(Op,8),ea(aU,9),ea(Yu,8),ea(Ip),ea(_U,8))},t.\u0275dir=se({type:t,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[ye]}),t})(),TU=(()=>{class t extends OU{constructor(){super(...arguments),this._aboveClass="mat-autocomplete-panel-above"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(t,e){1&t&&fa("focusin",function(){return e._handleFocus()})("blur",function(){return e._onTouched()})("input",function(t){return e._handleInput(t)})("keydown",function(t){return e._handleKeydown(t)}),2&t&&Ko("autocomplete",e.autocompleteAttribute)("role",e.autocompleteDisabled?null:"combobox")("aria-autocomplete",e.autocompleteDisabled?null:"list")("aria-activedescendant",e.panelOpen&&e.activeOption?e.activeOption.id:null)("aria-expanded",e.autocompleteDisabled?null:e.panelOpen.toString())("aria-owns",e.autocompleteDisabled||!e.panelOpen||null==e.autocomplete?null:e.autocomplete.id)("aria-haspopup",!e.autocompleteDisabled)},exportAs:["matAutocompleteTrigger"],features:[_l([CU]),jo]}),t})(),kU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[EU],imports:[[Rf,uv,Ny,Rh],Mp,uv,Ny]}),t})();const AU=_p({passive:!0});let PU=(()=>{class t{constructor(t,e){this._platform=t,this._ngZone=e,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return ep;const e=_d(t),n=this._monitoredElements.get(e);if(n)return n.subject;const i=new P,r="cdk-text-field-autofilled",s=t=>{"cdk-text-field-autofill-start"!==t.animationName||e.classList.contains(r)?"cdk-text-field-autofill-end"===t.animationName&&e.classList.contains(r)&&(e.classList.remove(r),this._ngZone.run(()=>i.next({target:t.target,isAutofilled:!1}))):(e.classList.add(r),this._ngZone.run(()=>i.next({target:t.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{e.addEventListener("animationstart",s,AU),e.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(e,{subject:i,unlisten:()=>{e.removeEventListener("animationstart",s,AU)}}),i}stopMonitoring(t){const e=_d(t),n=this._monitoredElements.get(e);n&&(n.unlisten(),n.subject.complete(),e.classList.remove("cdk-text-field-autofill-monitored"),e.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(e))}ngOnDestroy(){this._monitoredElements.forEach((t,e)=>this.stopMonitoring(e))}}return t.\u0275fac=function(e){return new(e||t)(Ci(pp),Ci(xu))},t.\u0275prov=xt({factory:function(){return new t(Ci(pp),Ci(xu))},token:t,providedIn:"root"}),t})(),IU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[fp]]}),t})();const MU=new oi("MAT_INPUT_VALUE_ACCESSOR"),DU=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let RU=0;const NU=Vy(class{constructor(t,e,n,i){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=n,this.ngControl=i}});let LU=(()=>{class t extends NU{constructor(t,e,n,i,r,s,o,a,l,c){super(s,i,r,n),this._elementRef=t,this._platform=e,this._autofillMonitor=a,this._formField=c,this._uid="mat-input-"+RU++,this.focused=!1,this.stateChanges=new P,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._required=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(t=>mp().has(t));const u=this._elementRef.nativeElement,h=u.nodeName.toLowerCase();this._inputValueAccessor=o||u,this._previousNativeValue=this.value,this.id=this.id,e.IOS&&l.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",t=>{const e=t.target;!e.value&&0===e.selectionStart&&0===e.selectionEnd&&(e.setSelectionRange(1,1),e.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===h,this._isTextarea="textarea"===h,this._isInFormField=!!c,this._isNativeSelect&&(this.controlType=u.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=md(t),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(t){this._id=t||this._uid}get required(){return this._required}set required(t){this._required=md(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&mp().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(t){t!==this.value&&(this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=md(t)}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}_focusChanged(t){t!==this.focused&&(this.focused=t,this.stateChanges.next())}_onInput(){}_dirtyCheckPlaceholder(){var t,e;const n=(null===(e=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===e?void 0:e.call(t))?null:this.placeholder;if(n!==this._previousPlaceholder){const t=this._elementRef.nativeElement;this._previousPlaceholder=n,n?t.setAttribute("placeholder",n):t.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){DU.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,e=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&e&&e.label)}return this.focused||!this.empty}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(WV,10),ea(_z,8),ea(Tz,8),ea(zy),ea(MU,10),ea(PU),ea(xu),ea(aU,8))},t.\u0275dir=se({type:t,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._focusChanged(!0)})("blur",function(){return e._focusChanged(!1)})("input",function(){return e._onInput()}),2&t&&(il("disabled",e.disabled)("required",e.required),Ko("id",e.id)("data-placeholder",e.placeholder)("readonly",e.readonly&&!e._isNativeSelect||null)("aria-invalid",e.empty&&e.required?null:e.errorState)("aria-required",e.required),ja("mat-input-server",e._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[_l([{provide:Qz,useExisting:t}]),jo,ye]}),t})(),jU=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[zy],imports:[[IU,cU,Ny],IU,cU]}),t})();function FU(...t){const e=t.length;if(0===e)throw new Error("list of properties cannot be empty.");return n=>D(function(t,e){return n=>{let i=n;for(let r=0;rYU),multi:!0};class qU{}const XU=By(jy(Ly(class{constructor(t){this._elementRef=t}}),"accent"));let YU=(()=>{class t extends XU{constructor(t,e,n,i,r,s,o,a){super(t),this._focusMonitor=e,this._changeDetectorRef=n,this._dir=i,this._ngZone=s,this._animationMode=a,this._invert=!1,this._max=100,this._min=0,this._step=1,this._thumbLabel=!1,this._tickInterval=0,this._value=null,this._vertical=!1,this.change=new Rc,this.input=new Rc,this.valueChange=new Rc,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=g.EMPTY,this._pointerDown=t=>{this.disabled||this._isSliding||!KU(t)&&0!==t.button||this._ngZone.run(()=>{this._touchId=KU(t)?function(t,e){for(let n=0;n{if("pointer"===this._isSliding){const e=QU(t,this._touchId);if(e){t.preventDefault();const n=this.value;this._lastPointerEvent=t,this._updateValueFromPosition(e),n!=this.value&&this._emitInputEvent()}}},this._pointerUp=t=>{"pointer"===this._isSliding&&(!KU(t)||"number"!=typeof this._touchId||ZU(t.changedTouches,this._touchId))&&(t.preventDefault(),this._removeGlobalEvents(),this._isSliding=null,this._touchId=void 0,this._valueOnSlideStart!=this.value&&!this.disabled&&this._emitChangeEvent(),this._valueOnSlideStart=this._lastPointerEvent=null)},this._windowBlur=()=>{this._lastPointerEvent&&this._pointerUp(this._lastPointerEvent)},this._document=o,this.tabIndex=parseInt(r)||0,s.runOutsideAngular(()=>{const e=t.nativeElement;e.addEventListener("mousedown",this._pointerDown,GU),e.addEventListener("touchstart",this._pointerDown,GU)})}get invert(){return this._invert}set invert(t){this._invert=md(t)}get max(){return this._max}set max(t){this._max=bd(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=bd(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=bd(t,this._step),this._step%1!=0&&(this._roundToDecimal=this._step.toString().split(".").pop().length),this._changeDetectorRef.markForCheck()}get thumbLabel(){return this._thumbLabel}set thumbLabel(t){this._thumbLabel=md(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?bd(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let e=bd(t,0);this._roundToDecimal&&e!==this.min&&e!==this.max&&(e=parseFloat(e.toFixed(this._roundToDecimal))),this._value=e,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=md(t)}get displayValue(){return this.displayWith?this.displayWith(this.value):this._roundToDecimal&&this.value&&this.value%1!=0?this.value.toFixed(this._roundToDecimal):this.value||0}focus(t){this._focusHostElement(t)}blur(){this._blurHostElement()}get percent(){return this._clamp(this._percent)}_shouldInvertAxis(){return this.vertical?!this.invert:this.invert}_isMinValue(){return 0===this.percent}_getThumbGap(){return this.disabled?7:this._isMinValue()&&!this.thumbLabel?this._isActive?10:7:0}_getTrackBackgroundStyles(){const t=this.vertical?`1, ${1-this.percent}, 1`:1-this.percent+", 1, 1";return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"-":""}${this._getThumbGap()}px) scale3d(${t})`}}_getTrackFillStyles(){const t=this.percent,e=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${e})`,display:0===t?"none":""}}_getTicksContainerStyles(){return{transform:`translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"-":""}${this._tickIntervalPercent/2*100}%)`}}_getTicksStyles(){let t=100*this._tickIntervalPercent,e={backgroundSize:this.vertical?`2px ${t}%`:`${t}% 2px`,transform:`translateZ(0) translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"":"-"}${t/2}%)${this.vertical||"rtl"!=this._getDirection()?"":" rotate(180deg)"}`};if(this._isMinValue()&&this._getThumbGap()){const t=this._shouldInvertAxis();let n;n=this.vertical?t?"Bottom":"Top":t?"Right":"Left",e[`padding${n}`]=`${this._getThumbGap()}px`}return e}_getThumbContainerStyles(){const t=this._shouldInvertAxis();return{transform:`translate${this.vertical?"Y":"X"}(-${100*(("rtl"!=this._getDirection()||this.vertical?t:!t)?this.percent:1-this.percent)}%)`}}_shouldInvertMouseCoords(){const t=this._shouldInvertAxis();return"rtl"!=this._getDirection()||this.vertical?t:!t}_getDirection(){return this._dir&&"rtl"==this._dir.value?"rtl":"ltr"}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{this._isActive=!!t&&"keyboard"!==t,this._changeDetectorRef.detectChanges()}),this._dir&&(this._dirChangeSubscription=this._dir.change.subscribe(()=>{this._changeDetectorRef.markForCheck()}))}ngOnDestroy(){const t=this._elementRef.nativeElement;t.removeEventListener("mousedown",this._pointerDown,GU),t.removeEventListener("touchstart",this._pointerDown,GU),this._lastPointerEvent=null,this._removeGlobalEvents(),this._focusMonitor.stopMonitoring(this._elementRef),this._dirChangeSubscription.unsubscribe()}_onMouseenter(){this.disabled||(this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent())}_onFocus(){this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent()}_onBlur(){this.onTouched()}_onKeydown(t){if(this.disabled||Qp(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const e=this.value;switch(t.keyCode){case 33:this._increment(10);break;case 34:this._increment(-10);break;case 35:this.value=this.max;break;case 36:this.value=this.min;break;case 37:this._increment("rtl"==this._getDirection()?1:-1);break;case 38:this._increment(1);break;case 39:this._increment("rtl"==this._getDirection()?-1:1);break;case 40:this._increment(-1);break;default:return}e!=this.value&&(this._emitInputEvent(),this._emitChangeEvent()),this._isSliding="keyboard",t.preventDefault()}_onKeyup(){"keyboard"===this._isSliding&&(this._isSliding=null)}_getWindow(){return this._document.defaultView||window}_bindGlobalEvents(t){const e=this._document,n=KU(t),i=n?"touchend":"mouseup";e.addEventListener(n?"touchmove":"mousemove",this._pointerMove,GU),e.addEventListener(i,this._pointerUp,GU),n&&e.addEventListener("touchcancel",this._pointerUp,GU);const r=this._getWindow();void 0!==r&&r&&r.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,GU),t.removeEventListener("mouseup",this._pointerUp,GU),t.removeEventListener("touchmove",this._pointerMove,GU),t.removeEventListener("touchend",this._pointerUp,GU),t.removeEventListener("touchcancel",this._pointerUp,GU);const e=this._getWindow();void 0!==e&&e&&e.removeEventListener("blur",this._windowBlur)}_increment(t){this.value=this._clamp((this.value||0)+this.step*t,this.min,this.max)}_updateValueFromPosition(t){if(!this._sliderDimensions)return;let e=this._clamp(((this.vertical?t.y:t.x)-(this.vertical?this._sliderDimensions.top:this._sliderDimensions.left))/(this.vertical?this._sliderDimensions.height:this._sliderDimensions.width));if(this._shouldInvertMouseCoords()&&(e=1-e),0===e)this.value=this.min;else if(1===e)this.value=this.max;else{const t=this._calculateValue(e),n=Math.round((t-this.min)/this.step)*this.step+this.min;this.value=this._clamp(n,this.min,this.max)}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.value),this.valueChange.emit(this.value),this.change.emit(this._createChangeEvent())}_emitInputEvent(){this.input.emit(this._createChangeEvent())}_updateTickIntervalPercent(){if(this.tickInterval&&this._sliderDimensions)if("auto"==this.tickInterval){let t=this.vertical?this._sliderDimensions.height:this._sliderDimensions.width,e=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=e/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let e=new qU;return e.source=this,e.value=t,e}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,e=0,n=1){return Math.max(e,Math.min(t,n))}_getSliderDimensions(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}_focusHostElement(t){this._elementRef.nativeElement.focus(t)}_blurHostElement(){this._elementRef.nativeElement.blur()}writeValue(t){this.value=t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Ig),ea(tc),ea(Op,8),ii("tabindex"),ea(xu),ea(Yu),ea(Ey,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-slider"]],viewQuery:function(t,e){if(1&t&&qc($U,5),2&t){let t;Wc(t=Yc())&&(e._sliderWrapper=t.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._onFocus()})("blur",function(){return e._onBlur()})("keydown",function(t){return e._onKeydown(t)})("keyup",function(){return e._onKeyup()})("mouseenter",function(){return e._onMouseenter()})("selectstart",function(t){return t.preventDefault()}),2&t&&(il("tabIndex",e.tabIndex),Ko("aria-disabled",e.disabled)("aria-valuemax",e.max)("aria-valuemin",e.min)("aria-valuenow",e.value)("aria-valuetext",null==e.valueText?e.displayValue:e.valueText)("aria-orientation",e.vertical?"vertical":"horizontal"),ja("mat-slider-disabled",e.disabled)("mat-slider-has-ticks",e.tickInterval)("mat-slider-horizontal",!e.vertical)("mat-slider-axis-inverted",e._shouldInvertAxis())("mat-slider-invert-mouse-coords",e._shouldInvertMouseCoords())("mat-slider-sliding",e._isSliding)("mat-slider-thumb-label-showing",e.thumbLabel)("mat-slider-vertical",e.vertical)("mat-slider-min-value",e._isMinValue())("mat-slider-hide-last-tick",e.disabled||e._isMinValue()&&e._getThumbGap()&&e._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[_l([WU]),jo],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(t,e){1&t&&(ra(0,"div",0,1),ra(2,"div",2),oa(3,"div",3),oa(4,"div",4),sa(),ra(5,"div",5),oa(6,"div",6),sa(),ra(7,"div",7),oa(8,"div",8),oa(9,"div",9),ra(10,"div",10),ra(11,"span",11),Za(12),sa(),sa(),sa(),sa()),2&t&&(ws(3),na("ngStyle",e._getTrackBackgroundStyles()),ws(1),na("ngStyle",e._getTrackFillStyles()),ws(1),na("ngStyle",e._getTicksContainerStyles()),ws(1),na("ngStyle",e._getTicksStyles()),ws(1),na("ngStyle",e._getThumbContainerStyles()),ws(5),Ja(e.displayValue))},directives:[Th],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),t})();function KU(t){return"t"===t.type[0]}function QU(t,e){let n;return n=KU(t)?"number"==typeof e?ZU(t.touches,e)||ZU(t.changedTouches,e):t.touches[0]||t.changedTouches[0]:t,n?{x:n.clientX,y:n.clientY}:void 0}function ZU(t,e){for(let n=0;n{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny],Ny]}),t})();function tH(t,e){}class eH{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.maxWidth="80vw",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.autoFocus=!0,this.restoreFocus=!0,this.closeOnNavigation=!0}}const nH={dialogContainer:Vg("dialogContainer",[$g("void, exit",Hg({opacity:0,transform:"scale(0.7)"})),$g("enter",Hg({transform:"none"})),Wg("* => enter",zg("150ms cubic-bezier(0, 0, 0.2, 1)",Hg({transform:"none",opacity:1}))),Wg("* => void, * => exit",zg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",Hg({opacity:0})))])};let iH=(()=>{class t extends Fp{constructor(t,e,n,i,r,s){super(),this._elementRef=t,this._focusTrapFactory=e,this._changeDetectorRef=n,this._config=r,this._focusMonitor=s,this._animationStateChanged=new Rc,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=t=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(t)),this._ariaLabelledBy=r.ariaLabelledBy||null,this._document=i}_initializeWithAttachedContent(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}attachComponentPortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(t)}_recaptureFocus(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}_trapFocus(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}_restoreFocus(){const t=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&t&&"function"==typeof t.focus){const e=Sp(),n=this._elementRef.nativeElement;(!e||e===this._document.body||e===n||n.contains(e))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_setupFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}_capturePreviouslyFocusedElement(){this._document&&(this._elementFocusedBeforeDialogWasOpened=Sp())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,e=Sp();return t===e||t.contains(e)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(vg),ea(tc),ea(Yu,8),ea(eH),ea(Ig))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&qc(Up,7),2&t){let t;Wc(t=Yc())&&(e._portalOutlet=t.first)}},features:[jo]}),t})(),rH=(()=>{class t extends iH{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:e}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:e}))}_onAnimationStart({toState:t,totalTime:e}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:e}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:e})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,e){1&t&&ga("@dialogContainer.start",function(t){return e._onAnimationStart(t)})("@dialogContainer.done",function(t){return e._onAnimationDone(t)}),2&t&&(il("id",e._id),Ko("role",e._config.role)("aria-labelledby",e._config.ariaLabel?null:e._ariaLabelledBy)("aria-label",e._config.ariaLabel)("aria-describedby",e._config.ariaDescribedBy||null),rl("@dialogContainer",e._state))},features:[jo],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,e){1&t&&Jo(0,tH,0,0,"ng-template",0)},directives:[Up],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[nH.dialogContainer]}}),t})(),sH=0;class oH{constructor(t,e,n="mat-dialog-"+sH++){this._overlayRef=t,this._containerInstance=e,this.id=n,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new P,this._afterClosed=new P,this._beforeClosed=new P,this._state=0,e._id=n,e._animationStateChanged.pipe(Hd(t=>"opened"===t.state),Gp(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),e._animationStateChanged.pipe(Hd(t=>"closed"===t.state),Gp(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),t.keydownEvents().pipe(Hd(t=>27===t.keyCode&&!this.disableClose&&!Qp(t))).subscribe(t=>{t.preventDefault(),aH(this,"keyboard")}),t.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():aH(this,"mouse")})}close(t){this._result=t,this._containerInstance._animationStateChanged.pipe(Hd(t=>"closing"===t.state),Gp(1)).subscribe(e=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),e.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}afterOpened(){return this._afterOpened}afterClosed(){return this._afterClosed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._overlayRef.backdropClick()}keydownEvents(){return this._overlayRef.keydownEvents()}updatePosition(t){let e=this._getPositionStrategy();return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._overlayRef.updatePosition(),this}updateSize(t="",e=""){return this._overlayRef.updateSize({width:t,height:e}),this._overlayRef.updatePosition(),this}addPanelClass(t){return this._overlayRef.addPanelClass(t),this}removePanelClass(t){return this._overlayRef.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function aH(t,e,n){return void 0!==t._containerInstance&&(t._containerInstance._closeInteractionType=e),t.close(n)}const lH=new oi("MatDialogData"),cH=new oi("mat-dialog-default-options"),uH=new oi("mat-dialog-scroll-strategy"),hH={provide:uH,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.block()}};let dH=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l){this._overlay=t,this._injector=e,this._defaultOptions=n,this._parentDialog=i,this._overlayContainer=r,this._dialogRefConstructor=o,this._dialogContainerType=a,this._dialogDataToken=l,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new P,this._afterOpenedAtThisLevel=new P,this._ariaHiddenElements=new Map,this.afterAllClosed=Iz(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Kd(void 0))),this._scrollStrategy=s}get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){const t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}open(t,e){(e=function(t,e){return Object.assign(Object.assign({},e),t)}(e,this._defaultOptions||new eH)).id&&this.getDialogById(e.id);const n=this._createOverlay(e),i=this._attachDialogContainer(n,e),r=this._attachDialogContent(t,i,n,e);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(r),r.afterClosed().subscribe(()=>this._removeOpenDialog(r)),this.afterOpened.next(r),i._initializeWithAttachedContent(),r}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(e=>e.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const e=this._getOverlayConfig(t);return this._overlay.create(e)}_getOverlayConfig(t){const e=new af({positionStrategy:this._overlay.position().global(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,disposeOnNavigation:t.closeOnNavigation});return t.backdropClass&&(e.backdropClass=t.backdropClass),e}_attachDialogContainer(t,e){const n=No.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:eH,useValue:e}]}),i=new Np(this._dialogContainerType,e.viewContainerRef,n,e.componentFactoryResolver);return t.attach(i).instance}_attachDialogContent(t,e,n,i){const r=new this._dialogRefConstructor(n,e,i.id);if(t instanceof sc)e.attachTemplatePortal(new Lp(t,null,{$implicit:i.data,dialogRef:r}));else{const n=this._createInjector(i,r,e),s=e.attachComponentPortal(new Np(t,i.viewContainerRef,n));r.componentInstance=s.instance}return r.updateSize(i.width,i.height).updatePosition(i.position),r}_createInjector(t,e,n){const i=t&&t.viewContainerRef&&t.viewContainerRef.injector,r=[{provide:this._dialogContainerType,useValue:n},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:e}];return t.direction&&(!i||!i.get(Op,null,It.Optional))&&r.push({provide:Op,useValue:{value:t.direction,change:wd()}}),No.create({parent:i||this._injector,providers:r})}_removeOpenDialog(t){const e=this.openDialogs.indexOf(t);e>-1&&(this.openDialogs.splice(e,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const e=t.parentElement.children;for(let n=e.length-1;n>-1;n--){let i=e[n];i!==t&&"SCRIPT"!==i.nodeName&&"STYLE"!==i.nodeName&&!i.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(i,i.getAttribute("aria-hidden")),i.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let e=t.length;for(;e--;)t[e].close()}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(No),ea(void 0),ea(void 0),ea(gf),ea(void 0),ea(ai),ea(ai),ea(oi))},t.\u0275dir=se({type:t}),t})(),pH=(()=>{class t extends dH{constructor(t,e,n,i,r,s,o){super(t,e,i,s,o,r,oH,rH,lH)}}return t.\u0275fac=function(e){return new(e||t)(Ci(kf),Ci(No),Ci(lh,8),Ci(cH,8),Ci(uH),Ci(t,12),Ci(gf))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),fH=0,gH=(()=>{class t{constructor(t,e,n){this._dialogRef=t,this._elementRef=e,this._dialog=n,this.id="mat-dialog-title-"+fH++}ngOnInit(){this._dialogRef||(this._dialogRef=function(t,e){let n=t.nativeElement.parentElement;for(;n&&!n.classList.contains("mat-dialog-container");)n=n.parentElement;return n?e.find(t=>t.id===n.id):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{const t=this._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=this.id)})}}return t.\u0275fac=function(e){return new(e||t)(ea(oH,8),ea(kl),ea(pH))},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,e){2&t&&il("id",e.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),t})(),mH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),t})();let bH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[pH,hH],imports:[[Rf,Hp,Ny],Ny]}),t})();const yH=new oi("CdkAccordion");let vH=0,_H=(()=>{class t{constructor(t,e,n){this.accordion=t,this._changeDetectorRef=e,this._expansionDispatcher=n,this._openCloseAllSubscription=g.EMPTY,this.closed=new Rc,this.opened=new Rc,this.destroyed=new Rc,this.expandedChange=new Rc,this.id="cdk-accordion-child-"+vH++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=n.listen((t,e)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===e&&this.id!==t&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=md(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=md(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return t.\u0275fac=function(e){return new(e||t)(ea(yH,12),ea(tc),ea(Ap))},t.\u0275dir=se({type:t,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[_l([{provide:yH,useValue:void 0}])]}),t})(),wH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const xH=["body"];function SH(t,e){}const EH=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],CH=["mat-expansion-panel-header","*","mat-action-row"];function OH(t,e){1&t&&oa(0,"span",2),2&t&&na("@indicatorRotate",va()._getExpandedState())}const TH=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],kH=["mat-panel-title","mat-panel-description","*"],AH=new oi("MAT_ACCORDION"),PH="225ms cubic-bezier(0.4,0.0,0.2,1)",IH={indicatorRotate:Vg("indicatorRotate",[$g("collapsed, void",Hg({transform:"rotate(0deg)"})),$g("expanded",Hg({transform:"rotate(180deg)"})),Wg("expanded <=> collapsed, void => collapsed",zg(PH))]),bodyExpansion:Vg("bodyExpansion",[$g("collapsed, void",Hg({height:"0px",visibility:"hidden"})),$g("expanded",Hg({height:"*",visibility:"visible"})),Wg("expanded <=> collapsed, void => collapsed",zg(PH))])};let MH=(()=>{class t{constructor(t){this._template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["ng-template","matExpansionPanelContent",""]]}),t})(),DH=0;const RH=new oi("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let NH=(()=>{class t extends _H{constructor(t,e,n,i,r,s,o){super(t,e,n),this._viewContainerRef=i,this._animationMode=s,this._hideToggle=!1,this.afterExpand=new Rc,this.afterCollapse=new Rc,this._inputChanges=new P,this._headerId="mat-expansion-panel-header-"+DH++,this._bodyAnimationDone=new P,this.accordion=t,this._document=r,this._bodyAnimationDone.pipe(Rd((t,e)=>t.fromState===e.fromState&&t.toState===e.toState)).subscribe(t=>{"void"!==t.fromState&&("expanded"===t.toState?this.afterExpand.emit():"collapsed"===t.toState&&this.afterCollapse.emit())}),o&&(this.hideToggle=o.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=md(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe(Kd(null),Hd(()=>this.expanded&&!this._portal),Gp(1)).subscribe(()=>{this._portal=new Lp(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,e=this._body.nativeElement;return t===e||e.contains(t)}return!1}}return t.\u0275fac=function(e){return new(e||t)(ea(AH,12),ea(tc),ea(Ap),ea(hc),ea(Yu),ea(Ey,8),ea(RH,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,MH,5),2&t){let t;Wc(t=Yc())&&(e._lazyContent=t.first)}},viewQuery:function(t,e){if(1&t&&qc(xH,5),2&t){let t;Wc(t=Yc())&&(e._body=t.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,e){2&t&&ja("mat-expanded",e.expanded)("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-expansion-panel-spacing",e._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[_l([{provide:AH,useValue:void 0}]),jo,ye],ngContentSelectors:CH,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,e){1&t&&(wa(EH),xa(0),ra(1,"div",0,1),fa("@bodyExpansion.done",function(t){return e._bodyAnimationDone.next(t)}),ra(3,"div",2),xa(4,1),Jo(5,SH,0,0,"ng-template",3),sa(),xa(6,2),sa()),2&t&&(ws(1),na("@bodyExpansion",e._getExpandedState())("id",e.id),Ko("aria-labelledby",e._headerId),ws(4),na("cdkPortalOutlet",e._portal))},directives:[Up],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[IH.bodyExpansion]},changeDetection:0}),t})();class LH{}const jH=By(LH);let FH=(()=>{class t extends jH{constructor(t,e,n,i,r,s,o){super(),this.panel=t,this._element=e,this._focusMonitor=n,this._changeDetectorRef=i,this._animationMode=s,this._parentChangeSubscription=g.EMPTY;const a=t.accordion?t.accordion._stateChanges.pipe(Hd(t=>!(!t.hideToggle&&!t.togglePosition))):ep;this.tabIndex=parseInt(o||"")||0,this._parentChangeSubscription=Q(t.opened,t.closed,a,t._inputChanges.pipe(Hd(t=>!!(t.hideToggle||t.disabled||t.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Hd(()=>t._containsFocus())).subscribe(()=>n.focusVia(e,"program")),r&&(this.expandedHeight=r.expandedHeight,this.collapsedHeight=r.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Qp(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,e){t?this._focusMonitor.focusVia(this._element,t,e):this._element.nativeElement.focus(e)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return t.\u0275fac=function(e){return new(e||t)(ea(NH,1),ea(kl),ea(Ig),ea(tc),ea(RH,8),ea(Ey,8),ii("tabindex"))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,e){1&t&&fa("click",function(){return e._toggle()})("keydown",function(t){return e._keydown(t)}),2&t&&(Ko("id",e.panel._headerId)("tabindex",e.tabIndex)("aria-controls",e._getPanelId())("aria-expanded",e._isExpanded())("aria-disabled",e.panel.disabled),La("height",e._getHeaderHeight()),ja("mat-expanded",e._isExpanded())("mat-expansion-toggle-indicator-after","after"===e._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===e._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[jo],ngContentSelectors:kH,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,e){1&t&&(wa(TH),ra(0,"span",0),xa(1),xa(2,1),xa(3,2),sa(),Jo(4,OH,1,1,"span",1)),2&t&&(ws(4),na("ngIf",e._showToggle()))},directives:[_h],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[IH.indicatorRotate]},changeDetection:0}),t})(),BH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Ny,wH,Hp]]}),t})();var VH=n(5478);Object.create(Error.prototype);const zH=["*"];var UH=(()=>(function(t){t.LineHighlight="line-highlight",t.LineNumbers="line-numbers"}(UH||(UH={})),UH))();class HH{}const $H=new oi("SECURITY_CONTEXT");let GH=(()=>{class t{constructor(t,e,n,i,r){this.platform=t,this.securityContext=e,this.http=n,this.sanitizer=r,this.initialMarkedOptions={renderer:new VH.Renderer},this.options=i}get options(){return this._options}set options(t){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),t)}get renderer(){return this.options.renderer}set renderer(t){this.options.renderer=t}compile(t,e=!1,n=!1,i=this.options){const r=this.trimIndentation(t),s=e?this.decodeHtml(r):r,o=n?this.renderEmoji(s):s,a=VH.parse(o,i);return this.sanitizer.sanitize(this.securityContext,a)||""}getSource(t){if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(t,{responseType:"text"}).pipe(D(e=>this.handleExtension(t,e)))}highlight(t){if(Lh(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const e=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(e,t=>t.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,e){if(!Lh(this.platform))return t;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return t.replace(/\$([^\s][^$]*?[^\s])\$/gm,(t,n)=>katex.renderToString(n,e))}decodeHtml(t){if(!Lh(this.platform))return t;const e=document.createElement("textarea");return e.innerHTML=t,e.value}handleExtension(t,e){const n=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==n?"```"+n+"\n"+e+"\n```":e}renderEmoji(t){if(!Lh(this.platform))return t;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(t)}trimIndentation(t){if(!t)return"";let e;return t.split("\n").map(t=>{let n=e;return t.length>0&&(n=isNaN(n)?t.search(/\S|$/):Math.min(t.search(/\S|$/),n)),isNaN(e)&&(e=n),n?t.substring(n):t}).join("\n")}}return t.\u0275fac=function(e){return new(e||t)(Ci(ou),Ci($H),Ci(Bv,8),Ci(HH,8),Ci(hd))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),WH=(()=>{class t{constructor(t,e){this.element=t,this.markdownService=e,this.error=new Rc,this.load=new Rc,this.ready=new Rc,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}get emoji(){return this._emoji}set emoji(t){this._emoji=this.coerceBooleanProperty(t)}get katex(){return this._katex}set katex(t){this._katex=this.coerceBooleanProperty(t)}get lineHighlight(){return this._lineHighlight}set lineHighlight(t){this._lineHighlight=this.coerceBooleanProperty(t)}get lineNumbers(){return this._lineNumbers}set lineNumbers(t){this._lineNumbers=this.coerceBooleanProperty(t)}ngOnChanges(){null==this.data?null==this.src||this.handleSrc():this.handleData()}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion()}render(t,e=!1){let n=this.markdownService.compile(t,e,this.emoji);n=this.katex?this.markdownService.renderKatex(n,this.katexOptions):n,this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}coerceBooleanProperty(t){return null!=t&&"false"!=`${String(t)}`}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe(t=>{this.render(t),this.load.emit(t)},t=>this.error.emit(t))}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,UH.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,e){const n=t.querySelectorAll("pre");for(let i=0;i{const r=e[t];if(r){const e=this.toLispCase(t);n.item(i).setAttribute(e,r.toString())}})}toLispCase(t){const e=t.match(/([A-Z])/g);if(!e)return t;let n=t.toString();for(let i=0,r=e.length;i{class t{static forRoot(e){return{ngModule:t,providers:[GH,e&&e.loader||[],e&&e.markedOptions||[],{provide:$H,useValue:e&&null!=e.sanitize?e.sanitize:yr.HTML}]}}static forChild(){return{ngModule:t}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function XH(t,e,n){return n?XH(t,e).pipe(D(t=>d(t)?n(...t):n(t))):new C(n=>{const i=(...t)=>n.next(1===t.length?t[0]:t);let r;try{r=t(i)}catch(s){return void n.error(s)}if(a(e))return()=>e(i,r)})}function YH(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new KH(t,n))}}class KH{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new QH(t,this.observables,this.project))}}class QH extends S_{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const i=e.length;this.values=new Array(i);for(let r=0;r0){const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}class ZH{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new JH(t,this.accumulator,this.seed,this.hasSeed))}}class JH extends v{constructor(t,e,n,i){super(t),this.accumulator=e,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}class t${constructor(t){this.predicate=t}call(t,e){return e.subscribe(new e$(t,this.predicate))}}class e$ extends v{constructor(t,e){super(t),this.predicate=e,this.skipping=!0,this.index=0}_next(t){const e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)}tryCallPredicate(t){try{const e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(e){this.destination.error(e)}}}const n$=["youtubeContainer"];let i$=(()=>{class t{constructor(t,e){this._ngZone=t,this._youtubeContainer=new P,this._destroyed=new P,this._playerChanges=new Uf(void 0),this._videoId=new Uf(void 0),this._height=new Uf(390),this._width=new Uf(640),this._startSeconds=new Uf(void 0),this._endSeconds=new Uf(void 0),this._suggestedQuality=new Uf(void 0),this._playerVars=new Uf(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=Lh(e)}get videoId(){return this._videoId.value}set videoId(t){this._videoId.next(t)}get height(){return this._height.value}set height(t){this._height.next(t||390)}get width(){return this._width.value}set width(t){this._width.next(t||640)}set startSeconds(t){this._startSeconds.next(t)}set endSeconds(t){this._endSeconds.next(t)}set suggestedQuality(t){this._suggestedQuality.next(t)}get playerVars(){return this._playerVars.value}set playerVars(t){this._playerVars.next(t)}ngOnInit(){if(!this._isBrowser)return;let t=wd(!0);if(!window.YT||!window.YT.Player){const e=new P;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>e.next(!0))},t=e.pipe(Gp(1),Kd(!1))}const e=function(t,e,n,i,r,s,o){const a=T_([e,s]).pipe(YH(T_([i,r])),D(([t,e])=>{const[n,i]=t,[r,s]=e;return n?{videoId:n,playerVars:i,width:r,height:s}:void 0}));return T_([t,a,wd(o)]).pipe(function(t){return S(function(...t){let e=null;return"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&d(t[0])&&(t=t[0].slice()),n=>n.lift.call(U([n,...t]),new k_(e))}(t),function(t){return e=>e.lift(new t$(t))}(([t,e])=>!e),D(([t])=>t))}(n),function(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new ZH(t,e,n))}}(r$,void 0),Rd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe($f(t=>{this._playerChanges.next(t)}),W(t=>t?s$(t)?wd(t):new C(e=>{let n=!1,i=!1;const r=t=>{i=!0,n||(t.target.removeEventListener("onReady",r),e.next(t.target))};return t.addEventListener("onReady",r),()=>{n=!0,i||(t=>{s$(t)||t.destroy()})(t)}}).pipe(Gp(1),Kd(void 0)):wd(void 0)),Wd(this._destroyed),rt(new P));e.subscribe(t=>{this._player=t,t&&this._pendingPlayerState&&this._initializePlayer(t,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(t,e,n){T_([t,e,n]).subscribe(([t,e,n])=>t&&t.setSize(e,n))}(e,this._width,this._height),function(t,e){T_([t,e]).subscribe(([t,e])=>t&&e&&t.setPlaybackQuality(e))}(e,this._suggestedQuality),function(t,e,n,i,r,s){const o=T_([n,i]).pipe(D(([t,e])=>({startSeconds:t,endSeconds:e}))),a=o.pipe(o$(t,t=>!!t&&!function(t){const e=t.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(t))),l=e.pipe(o$(t,(t,e)=>!!t&&t.videoId!==e));Q(t.pipe(o$(T_([e,o]),([t,e],n)=>!(!n||t==n.videoId&&!e.startSeconds&&!e.endSeconds))),l,a).pipe(YH(T_([t,e,o,r])),D(([t,e])=>e),Wd(s)).subscribe(([t,e,n,i])=>{!e||!t||(t.videoId=e,t.cueVideoById(Object.assign({videoId:e,suggestedQuality:i},n)))})}(e,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),e.connect()}createEventsBoundInZone(){return{}}ngAfterViewInit(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}ngOnDestroy(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,e){this._player?this._player.seekTo(t,e):this._getPendingState().seek={seconds:t,allowSeekAhead:e}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_initializePlayer(t,e){const{playbackState:n,playbackRate:i,volume:r,muted:s,seek:o}=e;switch(n){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=i&&t.setPlaybackRate(i),null!=r&&t.setVolume(r),null!=s&&(s?t.mute():t.unMute()),null!=o&&t.seekTo(o.seconds,o.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Qd(e=>e?XH(n=>{e.addEventListener(t,n)},n=>{try{e.removeEventListener&&e.removeEventListener(t,n)}catch(i){}}):wd()),t=>new C(e=>t.subscribe({next:t=>this._ngZone.run(()=>e.next(t)),error:t=>e.error(t),complete:()=>e.complete()})),Wd(this._destroyed))}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(ou))},t.\u0275cmp=Jt({type:t,selectors:[["youtube-player"]],viewQuery:function(t,e){if(1&t&&qc(n$,5),2&t){let t;Wc(t=Yc())&&(e.youtubeContainer=t.first)}},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(t,e){1&t&&oa(0,"div",null,0)},encapsulation:2,changeDetection:0}),t})();function r$(t,[e,n,i]){if(t&&n&&t.playerVars!==n.playerVars)t.destroy();else{if(!n)return void(t&&t.destroy());if(t)return t}const r=i.runOutsideAngular(()=>new YT.Player(e,n));return r.videoId=n.videoId,r.playerVars=n.playerVars,r}function s$(t){return"getPlayerStatus"in t}function o$(t,e){return S(YH(t),Hd(([t,n])=>e(n,t)),D(([t])=>t))}let a$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function l$(t){return!0===t}function c$(t){return null==t}function u$(t){return!c$(t)}function h$(t){return Boolean(t)}function d$(t){return c$(t)?t:JSON.parse(JSON.stringify(t))}const p$=t=>{const e=t instanceof Date;if("object"!=typeof t||null===t||e)return t;Object.freeze(t);const n="function"==typeof t,i=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach(e=>{i.call(t,e)&&(!n||"caller"!==e&&"callee"!==e&&"arguments"!==e)&&null!==t[e]&&("object"==typeof t[e]||"function"==typeof t[e])&&!Object.isFrozen(t[e])&&p$(t[e])}),t};function f$(t){return u$(t)&&"object"==typeof t&&function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)}const g$="NGXS_DATA_META",m$="NGXS_META",b$="NGXS_ARGUMENT_REGISTRY_META";let y$=(()=>{class t{constructor(t){this.sequence$=new Uf(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return t.\u0275fac=function(e){return new(e||t)(Ci(pV,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function v$(t){return t[g$]}let _$=(()=>{class t{constructor(e,n,i){t.store=e.get(pV),t.ngZone=e.get(xu),t.factory=n,t.context=i,t.computed=e.get(y$)}}return t.store=null,t.computed=null,t.context=null,t.factory=null,t.ngZone=null,t.\u0275fac=function(e){return new(e||t)(Ci(No),Ci(wB),Ci(_B))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class w${constructor(){w$.statesCachedMeta.clear()}static createStateContext(t){return _$.context.createStateContext(t)}static ensureMappedState(t){if(c$(_$.factory)||c$(t))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(u$(t.name)?w$.statesCachedMeta.get(t.name):null)||w$.ensureMeta(t)}static getRepositoryByInstance(t){var e;const n=null!==(e=v$(w$.getStateClassByInstance(t)))&&void 0!==e?e:null;if(c$(n))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return n}static getStateClassByInstance(t){return(null!=t?t:{}).constructor}static clearMetaByInstance(t){const e=w$.getRepositoryByInstance(t);e.stateMeta.actions={},e.operations={}}static createPayload(t,e){const n={},i=Array.from(t);for(let r=0;r0?n:null}static createAction(t,e,n){const i=w$.createPayload(e,n);return new(function(t){return class{constructor(t){t&&Object.keys(t).forEach(e=>{this[e]=t[e]})}static get type(){return t}}}(t.type))(i)}static ensureMeta(t){var e;const n=u$(t.name)?null===(e=_$.factory.states)||void 0===e?void 0:e.find(e=>e.name===t.name):null;return u$(n)&&u$(t.name)&&w$.statesCachedMeta.set(t.name,n),n}}w$.statesCachedMeta=new Map,w$.\u0275fac=function(t){return new(t||w$)},w$.\u0275prov=xt({token:w$,factory:w$.\u0275fac}),new lp(1);class x$ extends Error{constructor(t){super(`Child states can only be added to an object. Cannot convert ${u$(null==t?void 0:t.constructor)?t.constructor.name:t} to PlainObject`)}}function S$(t){var e;return null!==(e=t.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function E$(t){var e;const n=S$(t),i=null!==(e=n.children)&&void 0!==e?e:[],r=d$(void 0===n.defaults?{}:n.defaults);if(i.length){if(f$(r))return function(t,e){return e.reduce((t,e)=>{const n=S$(e);if(function(t){const e="string"==typeof t?t.trim():t;return[void 0,null,NaN,"",1/0].includes(e)}(n.name))throw new Error("State name not provided in class");return t[n.name.toString()]=E$(e),t},null!=t?t:{})}(r,i);throw new x$(r)}return r}function C$(t){var e;return null!==(e=t.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function O$(){var t,e;return null!==(e=null===(t=null==_$?void 0:_$.computed)||void 0===t?void 0:t.sequenceValue)&&void 0!==e?e:0}function T$(t){let e=!1;return Dd(t)&&(e=!0),e}function k$(t){return t[b$]}class A$ extends Error{constructor(t,e){super(`An argument with the name '${t}' already exists in the method '${e}'`)}}class P${constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(t){var e;return null!==(e=this.payloadMap.get(t))&&void 0!==e?e:null}getArgumentNameByIndex(t){var e;return null!==(e=this.argumentMap.get(t))&&void 0!==e?e:null}createPayloadType(t,e,n){this.checkDuplicateName(t,e),this.payloadMap.set(n,t),this.payloadMap.set(t,t)}createArgumentName(t,e,n){this.checkDuplicateName(t,e),this.argumentMap.set(n,t),this.argumentMap.set(t,t)}checkDuplicateName(t,e){if(h$(this.argumentMap.has(t))||h$(this.payloadMap.has(t)))throw new A$(t,e)}}function I$(t){return Nu()?p$(t):t}function M$(t){return{enumerable:!0,configurable:!0,get(){const e=v$(t),n=w$.ensureMappedState(e.stateMeta);return w$.createStateContext(n)}}}function D$(t){if(!t)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},t),{getState:()=>Nu()?p$(t.getState()):t.getState(),setState(e){t.setState(e)},patchState(e){t.patchState(e)}})}function R$(){return(t,e,n)=>{!function(t,e){if(!function(t,e){var n;let i=t,r=!1;if(f$(i))for(;null!==i;){if(l$(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(n=Object.getOwnPropertyDescriptor(i,e))||void 0===n?void 0:n.get);break}i=Object.getPrototypeOf(i)}return r}(t,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(t,e);const i=n.get;return n.get=function(...t){const e=function(t){return c$(C$(t))&&Object.defineProperties(t,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),C$(t)}(this),n=null==e?void 0:e.get(i);if(l$(null==n?void 0:n.isObservable))return null==n?void 0:n.value;if(c$(n)||n.sequenceId!==O$()){e.delete(i);const n=i.apply(this,t);return e.set(i,{value:n,sequenceId:O$(),isObservable:T$(n)}),n}return n.value},n}}const N$={cancelUncompleted:!0,insideZone:!1};function L$(t=N$){return(e,n,i)=>{!function(t,e){if(t.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=n.toString();return i.value=function(...e){const n=this;let i=null;const o=w$.getRepositoryByInstance(n),a=o.operations;let l=a[s];const c=o.stateMeta,u=k$(r);if(c$(l)){const e=function(t){var e,n,i;return null!==(i=null===(n=null===(e=(t+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===n?void 0:n.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),n=function(t){const{statePath:e,argumentsNames:n,methodName:i,argumentRegistry:r}=t;let s="";for(let o=0;o{var s;return l$(t.insideZone)?null===(s=_$.ngZone)||void 0===s||s.run(()=>{i=r.apply(n,e)}):i=r.apply(n,e),Dd(i)?wd(null).pipe(D(()=>i)):i};const h=w$.createAction(l,e,u),d=_$.store.dispatch(h);return Dd(i)?function(t,e){return hv([t,e]).pipe(D(t=>t.pop()))}(d,i):i},i}}function j$(t){return(e,n,i)=>{const r=t.trim();if(!r)throw new Error("Payload name should be initialized");(function(t,e){const n=t[e];return c$(k$(n))&&Object.defineProperties(n,{[b$]:{enumerable:!0,configurable:!0,value:new P$}}),k$(n)})(e,n).createPayloadType(r,n,i)}}function F$(){return t=>{const e=function(t){if(function(t){return!h$(t)}(t.hasOwnProperty(m$))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,m$,{value:e})}return function(t){var e;return null===(e=t)||void 0===e?void 0:e[m$]}(t)}(t);if(c$(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(t,e){(function(t){var e;const n=null!==(e=v$(t))&&void 0!==e?e:null;return(c$(n)||(null==n?void 0:n.stateClass)!==t)&&function(t){Object.defineProperty(t,g$,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:t}})}(t),v$(t)}(t)).stateMeta=e}(t,e),function(t,e,n){Object.defineProperties(t.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>d$(n)},context:M$(t)})}(t,e,E$(t)),function(t){var e,n;const i=v$(t),r=null!==(n=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==n?n:null;if(u$(r)){const e=`__${r}__selector`;Object.defineProperties(t.prototype,{[e]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(u$(this[e]))return this[e];if(c$(_$.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[e]=_$.store.select(t).pipe(D(t=>Nu()?p$(t):t),up({refCount:!0,bufferSize:1})),this[e]}}})}}(t)}}let B$=(()=>{class t{constructor(){this.browserStorageEvents$=new P,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var e;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(e=this.ngxsDataDoCheck)||void 0===e||e.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var t;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(t=this.ngxsDataDoCheck)||void 0===t||t.call(this))}markAsDirtyAfterReset(){var t;this.dirty=!0,null===(t=this.ngxsDataAfterReset)||void 0===t||t.call(this)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),V$=(()=>{class t extends B${get snapshot(){return I$(this.getState())}get ctx(){return D$(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$(),aw("design:type",Object),aw("design:paramtypes",[])],t.prototype,"snapshot",null),sw([L$(),ow(0,j$("patchValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"patchState",null),sw([L$(),ow(0,j$("stateValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"setState",null),sw([L$(),aw("design:type",Function),aw("design:paramtypes",[]),aw("design:returntype",void 0)],t.prototype,"reset",null),t})(),z$=(()=>{class t extends B${get snapshot(){return I$(this.getState())}get ctx(){return D$(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$(),aw("design:type",Object),aw("design:paramtypes",[])],t.prototype,"snapshot",null),sw([L$(),ow(0,j$("patchValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"patchState",null),sw([L$(),ow(0,j$("stateValue")),aw("design:type",Function),aw("design:paramtypes",[Object]),aw("design:returntype",void 0)],t.prototype,"setState",null),sw([L$(),aw("design:type",Function),aw("design:paramtypes",[]),aw("design:returntype",void 0)],t.prototype,"reset",null),t})();const U$=new oi("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),H$=new oi("ngx-window",{providedIn:"root",factory:()=>function(t){return Lh(t)?window:null}(Oi(ou))}),$$=new oi("ngx-data-layer",{providedIn:"root",factory:()=>function(t){return t?t.dataLayer=t.dataLayer||[]:null}(Oi(H$))}),G$=new oi("ngx-gtag-fn",{providedIn:"root",factory:()=>function(t,e){return t?t.gtag=t.gtag||function(){e.push(arguments)}:null}(Oi(H$),Oi($$))});let W$=(()=>{class t{constructor(t,e,n){this.settings=t,this._document=e,this._gtag=n}get document(){return this._document}throw(t){(this.settings.enableTracing||Nu())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((t,[e,n])=>Object.defineProperty(t,e,{value:n,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(t=>void 0!==t))}catch(e){this.throw(e)}}event(t,e,n,i,r){try{const s=new Map;e&&s.set("event_category",e),n&&s.set("event_label",n),i&&s.set("value",i),void 0!==r&&s.set("interaction",r);const o=this.toKeyValue(s);o?this.gtag("event",t,o):this.gtag("event",t)}catch(s){this.throw(s)}}pageView(t,e,n,i){try{const r=new Map([["page_path",t]]);e&&r.set("page_title",e),(n||this.document)&&r.set("page_location",n||this.document.location.href),i&&Object.entries(i).map(([t,e])=>r.set(t,e)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(r))}catch(r){this.throw(r)}}appView(t,e,n,i,r){try{const s=new Map([["screen_name",t],["app_name",e]]);n&&s.set("app_id",n),i&&s.set("app_version",i),r&&s.set("app_installer_id",r),this.gtag("event","screen_view",this.toKeyValue(s))}catch(s){this.throw(s)}}set(...t){try{this._gtag("set",...t)}catch(e){this.throw(e)}}exception(t,e){try{const n=new Map;t&&n.set("description",t),e&&n.set("fatal",e),this.toKeyValue(n)?this.gtag("event","exception",this.toKeyValue(n)):this.gtag("event","exception")}catch(n){this.throw(n)}}}return t.\u0275fac=function(e){return new(e||t)(Ci(U$),Ci(Yu),Ci(G$))},t.\u0275prov=xt({factory:function(){return new t(Ci(U$),Ci(Yu),Ci(G$))},token:t,providedIn:"root"}),t})();const q$={provide:tu,multi:!0,useFactory:function(t,e,n){return()=>lw(this,void 0,void 0,function*(){var i;if(!t.trackingCode)return void(Nu()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Nu()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));n||Nu()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),t.uri=t.uri||`https://www.googletagmanager.com/gtag/js?id=${t.trackingCode}`,t.initCommands=null!==(i=null==t?void 0:t.initCommands)&&void 0!==i?i:[],t.initCommands.find(t=>"config"===t.command)||t.initCommands.unshift({command:"config",values:[t.trackingCode]}),t.initCommands.find(t=>"js"===t.command)||t.initCommands.unshift({command:"js",values:[new Date]});for(const n of t.initCommands)e(n.command,...n.values);const r=n.createElement("script");r.async=!0,r.src=t.uri,t.nonce&&r.setAttribute("nonce",t.nonce),n.getElementsByTagName("head")[0].appendChild(r)})},deps:[U$,G$,Yu]};new oi("ngx-google-analytics-routing-settings",{factory:()=>({})});let X$=(()=>{class t{static forRoot(e,n=[],i,r,s){return{ngModule:t,providers:[{provide:U$,useValue:{trackingCode:e,initCommands:n,uri:i,enableTracing:r,nonce:s}},q$]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[]]}),t})(),Y$=(()=>{class t{constructor(){this.consent="not-set",this.consentChange=new lp(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),K$=(()=>{class t{constructor(t,e,{trackingCode:n}){this.window=e,this.subscriptions=new g,this.token=n,this.subscriptions.add(t.consentChange.subscribe(t=>this.toggleGoogleAnalytics("rescinded"===t)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Y$),Ci(H$),Ci(U$))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Q$=new oi("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),Z$=[Y$,K$,(()=>{class t{constructor(t,e){this.key=e,this.subscriptions=new g;try{this.storage=localStorage}catch(n){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(t=>this.saveConsent(t)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,e;const n=null===(e=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===e?void 0:e.call(t,this.key);if(null==n)return"not-set";const i=n.trim().toLowerCase();switch(i){case"given":case"rescinded":return i;default:return"not-set"}}saveConsent(t){var e,n;null===(n=null===(e=this.storage)||void 0===e?void 0:e.setItem)||void 0===n||n.call(e,this.key,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Y$),Ci(Q$))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})()];function J$(t){return Object.entries(t).reduce((t,[e,n])=>(null!=n&&(t[e]=`${n}`),t),{})}let tG=(()=>{class t{static forRoot(e){const{providers:n=[]}=X$.forRoot(e.gaToken,function(t){const{appName:e,projectName:n,developmentMode:i}=t;return[{command:"set",values:[J$({appName:e,projectName:n,developmentMode:i})]}]}(e));return{ngModule:t,providers:n}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[...Z$,{provide:tu,multi:!0,useFactory:()=>()=>{},deps:Z$}],imports:[[X$]]}),t})();const eG=["bodyCanvas"];let nG=(()=>{class t{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Rc,this.nodeDrag=new Rc,this.nodeClick=new Rc,this.nodeHoverStart=new Rc,this.nodeHoverStop=new Rc,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var e;this._scene=t,null===(e=this.bodyUI)||void 0===e||e.setScene(t)}get rotation(){return this._rotation}set rotation(t){var e;this._rotation=t,null===(e=this.bodyUI)||void 0===e||e.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var e;this._rotationX=t,null===(e=this.bodyUI)||void 0===e||e.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var e;this._zoom=t,null===(e=this.bodyUI)||void 0===e||e.setZoom(t)}get target(){return this._target}set target(t){var e;this._target=t,null===(e=this.bodyUI)||void 0===e||e.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,e={x:48,y:48}){if(this.bodyCanvas){const{width:n,height:i}=this.bodyCanvas.nativeElement,r=window.devicePixelRatio,s=Math.min(Math.log2((n-e.x)/r/t.x),Math.log2((i-e.y)/r/t.y));this.zoom=s}}setupBodyUI(){var t;return lw(this,void 0,void 0,function*(){const e=this.bodyCanvas.nativeElement,n=new dB({id:"body-ui",canvas:e,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});e.addEventListener("contextmenu",t=>t.preventDefault()),yield n.initialize(),this.bodyUI=n,window.bodyUI=n,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(t=>this.rotationChange.next(t)),this.bodyUI.nodeDrag$.subscribe(t=>this.nodeDrag.emit(t)),this.bodyUI.nodeClick$.subscribe(t=>this.nodeClick.emit(t)),this.bodyUI.nodeHoverStart$.subscribe(t=>this.nodeHoverStart.emit(t)),this.bodyUI.nodeHoverStop$.subscribe(t=>this.nodeHoverStop.emit(t))]})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-body-ui"]],viewQuery:function(t,e){if(1&t&&qc(eG,5,kl),2&t){let t;Wc(t=Yc())&&(e.bodyCanvas=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,e){1&t&&oa(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),t})(),iG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})();new oi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const rG=["carouselContainer"],sG=["itemlist"],oG=["itemcontainer"];function aG(t,e){if(1&t&&(ra(0,"div",14),Za(1),sa()),2&t){const t=va().$implicit,e=va();ws(1),Ja(e.occurenceData[t.id]||0)}}function lG(t,e){if(1&t){const t=ua();ra(0,"div",9),fa("click",function(){const e=$e(t).$implicit;return va().selectOrgan(e)}),oa(1,"mat-icon",10),ra(2,"div",11),ra(3,"div",12),Za(4),sa(),Jo(5,aG,2,1,"div",13),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ja("disabled",t.disabled)("selected",n.isSelected(t)),ws(1),Sa("svgIcon",t.src),ws(3),Ja(t.name),ws(1),na("ngIf",void 0!==t.numResults)}}const cG=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:large_intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:brain",organ:"Brain",name:"Allen Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph_nodes",organ:"Lymph Node",name:"Lymph Node, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:bone_marrow",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{src:"app:vasculature",organ:"Vasculature",name:"Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}],uG=cG.filter(t=>!0!==t.disabled);let hG=(()=>{class t{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=uG,this.selectedOrgans=[],this.organsChanged=new Rc,this.onLeft=!0,this.onRight=!1,this.step=72}set occurenceData(t){this._occurenceData=t}get occurenceData(){return this._occurenceData}ngAfterViewInit(){const{carouselContainer:t}=this;this.sensor=new HU.ResizeSensor(t.nativeElement,()=>{this.set()})}ngOnChanges(t){"organList"in t&&this.set()}ngOnDestroy(){this.sensor.detach()}get error(){return!(!this.displayErrors||0===this.selectedOrgans.length)}shift(t){const{itemList:e}=this;let n=parseInt(e.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(n="right"===t?n-this.step:n+this.step,e.nativeElement.style.left=n+"px",this.setLeftRight(n))}scroll(t){this.timeoutHandler=setInterval(()=>{this.shift(t)},200)}stopScroll(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}selectOrgan(t){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(t)?this.selectedOrgans.filter(e=>t!==e):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:e,carouselContainer:n}=this,i=parseInt(t.nativeElement.style.left,10)||0;if(t.nativeElement.offsetWidth>=this.organList.length*this.step)t.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(i);const t=this.step*Math.floor(n.nativeElement.offsetWidth/this.step)-64;e.nativeElement.style.width=`${t}px`}}setWidth(){const{itemContainer:t,carouselContainer:e}=this,n=this.step*Math.floor(e.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${n}px`}setLeftRight(t){const{itemContainer:e}=this;this.onLeft=0===t,this.onRight=t<=e.nativeElement.offsetWidth-this.organList.length*this.step}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-organ-selector"]],viewQuery:function(t,e){if(1&t&&(qc(rG,7),qc(sG,7),qc(oG,7)),2&t){let t;Wc(t=Yc())&&(e.carouselContainer=t.first),Wc(t=Yc())&&(e.itemList=t.first),Wc(t=Yc())&&(e.itemContainer=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[ye],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(t,e){1&t&&(ra(0,"div",0,1),ra(2,"mat-icon",2),fa("touchstart",function(){return e.scroll("left")})("touchend",function(){return e.stopScroll()})("click",function(){return e.shift("left")})("mousedown",function(){return e.scroll("left")})("mouseup",function(){return e.stopScroll()}),Za(3,"chevron_left"),sa(),ra(4,"div",3,4),ra(6,"div",5,6),Jo(8,lG,6,7,"div",7),sa(),sa(),ra(9,"mat-icon",8),fa("touchstart",function(){return e.scroll("right")})("touchend",function(){return e.stopScroll()})("click",function(){return e.shift("right")})("mousedown",function(){return e.scroll("right")})("mouseup",function(){return e.stopScroll()}),Za(10,"chevron_right"),sa(),sa()),2&t&&(ja("error",e.error),na("matTooltipDisabled",e.multiselect),ws(2),ja("disabled",e.onLeft),ws(6),na("ngForOf",e.organList),ws(1),ja("disabled",e.onRight))},directives:[ew,p_,yh,_h],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),t})(),dG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,rw]]}),t})(),pG=(()=>{class t{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Rc,this.visibilityToggle=new Rc,this.opacityReset=new Rc}ngOnInit(){this.prevOpacity=this.visible?0:20}reset(){this.prevOpacity=20}changeOpacity(t){this.opacity=parseInt(t,10),this.opacityChange.emit(this.opacity)}toggleVisibility(){const t=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=t,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}resetOpacity(){this.prevOpacity=0,this.opacityReset.emit()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"mat-slider",2),fa("input",function(t){return e.changeOpacity(t.value)}),sa(),ra(3,"span",3),Za(4),sa(),sa(),ra(5,"div",4),ra(6,"mat-icon",5),fa("click",function(){return e.toggleVisibility()}),sa(),ra(7,"mat-icon",6),fa("click",function(){return e.toggleVisibility()}),sa(),ra(8,"mat-icon",7),fa("click",function(){return e.resetOpacity()}),Za(9,"refresh"),sa(),sa(),sa()),2&t&&(ws(2),ja("disabled",!e.visible),na("step",1)("min",0)("max",100)("value",e.opacity),ws(2),tl("",e.opacity,"%"),ws(2),ja("hidden",e.visible),na("matRippleCentered",!0)("matRippleUnbounded",!0),ws(1),ja("hidden",!e.visible),na("matRippleCentered",!0)("matRippleUnbounded",!0),ws(1),na("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[YU,p_,Yy],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})(),fG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,JU,Ky]]}),t})();function gG(t,e){if(1&t&&(ra(0,"div",15),oa(1,"youtube-player",16),sa()),2&t){const t=va(3);ws(1),Sa("videoId",t.videoID)}}function mG(t,e){if(1&t&&(ra(0,"mat-expansion-panel",10),ra(1,"mat-expansion-panel-header"),ra(2,"h2",11),Za(3),sa(),sa(),ra(4,"div",12),oa(5,"markdown",13),Jo(6,gG,2,1,"div",14),sa(),sa()),2&t){const t=va(),e=t.index,n=t.$implicit;na("expanded",0===e),ws(3),Ja(n.title),ws(2),ja("first",0===e),na("data",n.content),ws(1),na("ngIf",0===e)}}function bG(t,e){if(1&t&&(ra(0,"div",8),Jo(1,mG,7,6,"mat-expansion-panel",9),sa()),2&t){const t=e.$implicit;ws(1),na("ngIf",t)}}let yG=(()=>{class t{constructor(t,e){this.dialogRef=t,this.data=e,this.documentationContents=e.content||[],this.infoTitle=e.title||"",this.videoID=e.videoID}ngOnInit(){const t=document.createElement("script");t.src="https://www.youtube.com/iframe_api",document.body.appendChild(t)}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return t.\u0275fac=function(e){return new(e||t)(ea(oH),ea(lH))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),ra(3,"mat-icon",3),fa("click",function(){return e.close()}),Za(4,"clear"),sa(),sa(),ra(5,"div",4),ra(6,"h2",5),Za(7),sa(),ra(8,"mat-dialog-content",6),Jo(9,bG,2,1,"div",7),sa(),sa(),sa(),sa()),2&t&&(ws(7),Ja(e.infoTitle),ws(2),na("ngForOf",e.documentationContents))},directives:[p_,gH,mH,yh,_h,NH,FH,WH,i$],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),t})(),vG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,bH,f_,BH,a$,qH.forRoot({})]]}),t})(),_G=(()=>{class t{constructor(t){this.http=t,this.markdownContent=new Uf([])}readMarkdown(){this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(t=>{const e=this.parseMarkdown(t);this.markdownContent.next(e)})}parseMarkdown(t){const e=[],n=t.split("# ");for(const i of n)if(i.length){const t=i.split("\n\n");e.push({title:t[0],content:t.splice(1).join("\n\n")})}return e}}return t.\u0275fac=function(e){return new(e||t)(Ci(Bv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),wG=(()=>{class t{constructor(t,e){this.dialog=t,this.infoButtonService=e,this.infoTitle="",this.subscriptions=new g,this.subscriptions.add(e.markdownContent.subscribe(t=>{t.length&&this.launchInfoDialog(t)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){this.dialog.open(yG,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:t,videoID:this.videoID}})}onDialogButtonClick(){this.infoButtonService.readMarkdown()}}return t.\u0275fac=function(e){return new(e||t)(ea(pH),ea(_G))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"mat-icon",1),fa("click",function(){return e.onDialogButtonClick()}),Za(2," info "),sa(),sa())},directives:[p_],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),t})(),xG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,vG,f_,Zv]]}),t})(),SG=(()=>{let t=class extends z${constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Hd(t=>null!=t),up(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(FU(...t),Rd(),up(1))}getOption(...t){const e=this.getPathKey(t);if(this.optionCache.has(e))return this.optionCache.get(e);const n=this.config$.pipe(FU(...t),Rd(),up(1));return this.optionCache.set(e,n),n}getPathKey(t){return`${t.length}:${t.join(".")}`}};return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275prov=xt({token:t,factory:t.\u0275fac}),sw([R$()],t.prototype,"config$",null),t=sw([F$(),wV({name:"globalConfig",defaults:null})],t),t})();!function(){const t=localStorage.getItem("ALLOW_TELEMETRY");null===t||t.toLowerCase()}();let EG=(()=>{class t{constructor(t,e){t&&function(t,e){xd(t,"mousemove").pipe(function(t,e=jd,n=BU){return i=>i.lift(new VU(t,e,n.leading,n.trailing))}(1e3),D(e=>{const{clientWidth:n,clientHeight:i}=t,{clientX:r,clientY:s}=e;return[r,s,n,i].join("_")})).subscribe(t=>e.event("webpage","mousemove",t))}(t.body,e)}}return t.\u0275fac=function(e){return new(e||t)(Ci(Yu),Ci(W$))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function CG(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!0)}),Za(1),sa()}if(2&t){const t=va();ws(1),tl(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function OG(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!1)}),Za(1,"Opt out"),sa()}}let TG=(()=>{class t{constructor(t,e,n){this.consentService=e,this.data=n,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}get allowTelemetry(){return this.consentService.consent}dismiss(){this.data.preClose()}submit(t){this.consentService.setConsent(t?"given":"rescinded"),this.dismiss()}showButton(t){const{allowTelemetry:e}=this;return"not-set"===e||("opt-in"===t?"rescinded"===e:"given"===e)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Y$),ea(F_))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,e){1&t&&(ra(0,"p"),Za(1,"We log usage to improve this service."),sa(),Jo(2,CG,2,1,"button",0),Jo(3,OG,2,0,"button",0)),2&t&&(ws(2),na("ngIf",e.showButton("opt-in")),ws(1),na("ngIf",e.showButton("opt-out")))},directives:[_h,__],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),t})(),kG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_]]}),t})();const AG=new oi("Default theme class"),PG="light-theme",IG="dark-theme";let MG=(()=>{class t{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(e){const{injector:n,location:i}=e;n.get(t).initialize(i,n)}getTheme(){return this.theme}setTheme(t){t!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(t),this.theme=t)}resetTheme(){this.setTheme(this.defaultTheme)}initialize(t,e){this.element=t,this.injector=e,this.applyThemeClass(this.getTheme())}applyThemeClass(t,e="add"){var n;const{element:i,injector:r}=this;if(!t||!i||!r)return;const s=r.get(Il,null);if(!s)return;const o=i.nativeElement,a=null===(n=r.get(gf,null))||void 0===n?void 0:n.getContainerElement(),l="add"===e?"addClass":"removeClass";s[l](o,t),a&&s[l](a,t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(AG,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();var DG;const RG={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],organNodes:["http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0002049"],dbOptions:{ccfOwlUrl:"assets/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",dataSources:["assets/kpmp/data/rui_locations.jsonld","assets/sparc/data/rui_locations.jsonld","assets/gtex/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(DG=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==DG?DG:"",useRemoteApi:!0,remoteApiEndpoint:"https://ccf-api.herokuapp.com/v1"},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"},NG=["*",[["mat-toolbar-row"]]],LG=["*","mat-toolbar-row"],jG=jy(class{constructor(t){this._elementRef=t}});let FG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]}),t})(),BG=(()=>{class t extends jG{constructor(t,e,n){super(t),this._platform=e,this._document=n}ngAfterViewInit(){this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(()=>this._checkToolbarMixedModes()))}_checkToolbarMixedModes(){}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(Yu))},t.\u0275cmp=Jt({type:t,selectors:[["mat-toolbar"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,FG,5),2&t){let t;Wc(t=Yc())&&(e._toolbarRows=t)}},hostAttrs:[1,"mat-toolbar"],hostVars:4,hostBindings:function(t,e){2&t&&ja("mat-toolbar-multiple-rows",e._toolbarRows.length>0)("mat-toolbar-single-row",0===e._toolbarRows.length)},inputs:{color:"color"},exportAs:["matToolbar"],features:[jo],ngContentSelectors:LG,decls:2,vars:0,template:function(t,e){1&t&&(wa(NG),xa(0),xa(1,1))},styles:[".cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}\n"],encapsulation:2,changeDetection:0}),t})(),VG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny],Ny]}),t})(),zG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,VG,rw]]}),t})();function UG(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}let HG;function $G(){return HG||(HG=function(t,e){const n=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let t;return new Promise(e=>{const n=()=>indexedDB.databases().finally(e);t=setInterval(n,100),n()}).finally(()=>clearInterval(t))}().then(()=>{const t=indexedDB.open("keyval-store");return t.onupgradeneeded=()=>t.result.createObjectStore(e),UG(t)});return(t,i)=>n.then(n=>i(n.transaction(e,t).objectStore(e)))}(0,"keyval")),HG}function GG(t,e=$G()){return e("readonly",e=>UG(e.get(t)))}var WG=n(71440),qG=n(70698),XG=n(7445),YG=n.n(XG),KG=n(23815),QG=n(31609);const ZG=WG.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},WG.DataFactory),JG={x:ZG("rdf"),type:ZG("rdf")("type")},tW={x:ZG("rdfs"),label:ZG("rdfs")("label"),comment:ZG("rdfs")("comment"),isDefinedBy:ZG("rdfs")("isDefinedBy"),seeAlso:ZG("rdfs")("seeAlso")},eW={x:ZG("entity"),id:ZG("entity")("id"),label:tW.label,description:tW.comment,link:tW.seeAlso,sex:ZG("entity")("sex"),age:ZG("entity")("age"),bmi:ZG("entity")("bmi"),Male:WG.DataFactory.literal("Male"),Female:WG.DataFactory.literal("Female"),consortiumName:ZG("entity")("consortium_name"),providerName:ZG("entity")("provider_name"),providerUUID:ZG("entity")("provider_uuid"),donor:ZG("entity")("has_donor"),sections:ZG("entity")("has_tissue_section"),datasets:ZG("entity")("has_dataset"),sampleType:ZG("entity")("sample_type"),TissueBlock:WG.DataFactory.literal("Tissue Block"),TissueSection:WG.DataFactory.literal("Tissue Section"),NonStandard:WG.DataFactory.literal("Non-standard"),sectionCount:ZG("entity")("section_count"),sectionSize:ZG("entity")("section_size"),sectionUnits:ZG("entity")("section_units"),sectionNumber:ZG("entity")("section_number"),spatialEntity:ZG("entity")("has_spatial_entity"),ontologyTerms:ZG("entity")("has_ontology_term"),technology:ZG("entity")("technology"),thumbnail:ZG("entity")("has_thumbnail")},nW=ZG("ccf"),iW={x:nW,ontologyNode:{label:nW("ccf_preferred_label"),parent:nW("ccf_part_of"),children:nW("ccf_part_of"),rui_rank:nW("ccf_rui_rank"),synonymLabels:WG.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},spatial:{Female:nW("VHFemale"),Male:nW("VHMale"),BothSexes:nW("VHBothSexes"),FemaleOrgans:nW("VHFemaleOrgans"),MaleOrgans:nW("VHMaleOrgans")},SpatialObjectReference:nW("SpatialObjectReference"),SpatialEntity:nW("SpatialEntity"),SpatialPlacement:nW("SpatialPlacement"),spatialObjectReference:{file:nW("has_object_file"),file_format:nW("has_object_file_format"),file_subpath:nW("has_object_file_subpath")},extractionSet:{label:tW.label,rui_rank:nW("ccf_rui_rank")},spatialEntity:{label:tW.label,comment:tW.comment,creator:ZG("dc")("creator"),creator_first_name:nW("creator_first_name"),creator_last_name:nW("creator_last_name"),creator_orcid:nW("creator_orcid"),creation_date:nW("creation_date"),updated_date:nW("updated_date"),ccf_annotations:nW("ccf_annotation"),representation_of:nW("ccf_representation_of"),reference_organ:nW("anatomical_structure_of"),extraction_set_for:nW("extraction_set_for"),extraction_set:nW("extraction_site_for"),sex:nW("has_sex"),side:nW("has_side"),rui_rank:nW("ccf_rui_rank"),slice_thickness:nW("ccf_slice_thickness"),slice_count:nW("ccf_slice_count"),x_dimension:nW("has_x_dimension"),y_dimension:nW("has_y_dimension"),z_dimension:nW("has_z_dimension"),dimension_units:nW("has_dimension_units"),object:nW("has_object_reference")},spatialPlacement:{source:nW("has_placement_source"),target:nW("has_placement_target"),placement_date:nW("has_placement_date"),x_scaling:nW("has_x_scaling"),y_scaling:nW("has_y_scaling"),z_scaling:nW("has_z_scaling"),scaling_units:nW("has_scaling_units"),x_rotation:nW("has_x_rotation"),y_rotation:nW("has_y_rotation"),z_rotation:nW("has_z_rotation"),w_rotation:nW("has_theta_rotation"),rotation_order:nW("has_rotation_order"),rotation_units:nW("has_rotation_units"),x_translation:nW("has_x_translation"),y_translation:nW("has_y_translation"),z_translation:nW("has_z_translation"),translation_units:nW("has_translation_units")}},rW={x:ZG("uberon")},sW=(ZG("lmha"),{bladder:rW.x("0001255"),body:rW.x("0013702"),brain:rW.x("0000955"),colon:rW.x("0001155"),heart:rW.x("0000948"),kidney:rW.x("0002113"),large_intestine:rW.x("0000059"),left_kidney:rW.x("0004538"),left_lung:rW.x("0002168"),left_ureter:rW.x("0001223"),liver:rW.x("0002107"),lung:rW.x("0002048"),respiratory_system:rW.x("0001004"),lymph_node:rW.x("0000029"),pelvis:rW.x("0001270"),rectum:rW.x("0001052"),right_kidney:rW.x("0004539"),right_lung:rW.x("0002167"),right_ureter:rW.x("0001222"),skin:rW.x("0002097"),small_intestine:rW.x("0002108"),spleen:rW.x("0002106"),thymus:rW.x("0002370"),ureter:rW.x("0000056"),vasculature:rW.x("0002049")});function oW(t){const e={};return Object.entries(t).forEach(([t,n])=>{e[n.id]=t}),e}const aW={spatialObjectReference:oW(iW.spatialObjectReference),spatialEntity:oW(iW.spatialEntity),spatialPlacement:oW(iW.spatialPlacement)};function lW(t,e,n,i){const r={"@id":e,"@type":n};return t.some(t=>{const e=i[t.predicate.id];if(e){const n="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(r,e,n)}return!1},WG.DataFactory.namedNode(e),null,null,null),r}const cW=(0,KG.memoize)(function(t,e){return lW(t,e,"SpatialObjectReference",aW.spatialObjectReference)},(t,e)=>e),uW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"ExtractionSet",aW.spatialEntity);return n.extractionSites=(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.extraction_set,e,null).map(e=>fW(t,e.id)),["rui_rank"]),n},(t,e)=>e),hW=(0,KG.memoize)(function(t,e){return(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.extraction_set_for,e,null).map(e=>uW(t,e.id)),["rui_rank"])},(t,e)=>e),dW=(0,KG.memoize)(function(t,e){return(0,KG.sortBy)(t.getSubjects(iW.spatialEntity.reference_organ,e,null).map(e=>fW(t,e.id)).filter(t=>t["@id"]!==e),["rui_rank"])},(t,e)=>e),pW=(0,KG.memoize)(function(t){const e=[];return t.forEach(n=>{n.subject.id===n.object.id&&e.push(fW(t,n.subject.id))},null,iW.spatialEntity.reference_organ,null,null),(0,KG.sortBy)(e,["rui_rank"])}),fW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"SpatialEntity",aW.spatialEntity);return n.object&&(n.object=cW(t,n.object)),n.ccf_annotations&&(n.ccf_annotations=t.getObjects(e,iW.spatialEntity.ccf_annotations,null).map(t=>t.id)),t.forSubjects(t=>n.entityId=t.id,eW.spatialEntity,e,null),n},(t,e)=>e),gW=(0,KG.memoize)(function(t,e){const n=lW(t,e,"SpatialPlacement",aW.spatialPlacement);return n.source&&(n.source=fW(t,n.source)),n.target&&(n.target=fW(t,n.target)),n},(t,e)=>e),mW=(0,KG.memoize)(function(t,e){const n=t.getObjects(WG.DataFactory.namedNode(e),eW.spatialEntity,null);if(n.length>0)return fW(t,n[0].id)},(t,e)=>e);function bW(t,e){const n=e;let i;switch(n.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[n.x_translation,n.y_translation,n.z_translation].map(t=>t*i),s=[n.x_rotation,n.y_rotation,n.z_rotation].map(NS),o=[n.x_scaling,n.y_scaling,n.z_scaling];return t.translate(r).rotateXYZ(s).scale(o)}class yW{constructor(t){this.db=t,this.createGraph()}createGraph(){this.graph=new qG.DirectedGraph;const t=this.db.store;t.forSubjects(t=>{this.addNode(t.id,"SpatialObjectReference")},JG.type,iW.SpatialObjectReference,null),t.forSubjects(t=>{this.addNode(t.id,"SpatialEntity")},JG.type,iW.SpatialEntity,null);const e={};t.some(t=>(e[t.subject.id]=t.object.id,!1),null,iW.spatialPlacement.source,null,null),t.some(t=>{const n=e[t.subject.id];return n&&this.addEdge(t.subject.id,n,t.object.id,"SpatialPlacement"),!1},null,iW.spatialPlacement.target,null,null)}addNode(t,e){this.graph.mergeNode(t,{type:e})}addEdge(t,e,n,i){this.graph.mergeDirectedEdge(e,n,{type:i,id:t})}getTransformationMatrix(t,e){if(t===e)return new bT(bT.IDENTITY);if(!this.graph.hasNode(t)||!this.graph.hasNode(e))return;const n=this.db.store,i=new bT(bT.IDENTITY),r=YG()(this.graph,t,e);if(r&&r.length>0){r.reverse();let t="";for(const e of r){if(t){const r=this.graph.getEdgeAttribute(e,t,"id");bW(i,gW(n,r))}t=e}return i}}}class vW{constructor(t){this.db=t}getSpatialEntity(t){return fW(this.db.store,t)}getExtractionSets(t){return hW(this.db.store,t)}getExtractionSet(t){return uW(this.db.store,t)}getAnatomicalStructures(t){return dW(this.db.store,t)}getReferenceOrgans(){return pW(this.db.store)}getReferenceBody(t){let e;switch(null==t?void 0:t.sex){case"Male":e=iW.spatial.Male.id;break;case"Female":e=iW.spatial.Female.id;break;case"Both":default:e=iW.spatial.BothSexes.id}return this.getSpatialEntity(e)}getReferenceOrganSets(t){let e=this.getReferenceOrgans();switch(null==t?void 0:t.sex){case"Male":e=e.filter(t=>"Male"===t.sex);break;case"Female":e=e.filter(t=>"Female"===t.sex)}return(null==t?void 0:t.debug)&&(e=e.map(t=>[[t],this.getAnatomicalStructures(t["@id"])]).reduce((t,[e,n])=>t.concat(n.length>0?n:e),[])),e}getReferenceSceneNodes(t){const e=this.getReferenceBody(t);let n=[...this.getReferenceOrganSets(t).map(t=>{const n="http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of;return this.getSceneNode(t,e,{color:[255,255,255,255],opacity:n?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!n})})];return(null==t?void 0:t.debug)&&(n=n.concat([this.getSceneNode(this.getSpatialEntity(iW.x("VHRightKidney").id),e,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHLeftKidney").id),e,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC1").id),e,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC2").id),e,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(iW.x("VHSpleenCC3").id),e,{color:[0,255,0,127.5],wireframe:!0})])),n.filter(t=>void 0!==t)}getReferenceOrganScene(t,e){var n,i;const r=null!==(n=void 0!==(null==e?void 0:e.sex))&&void 0!==n&&n,s=this.getReferenceOrgans().filter(n=>n.representation_of===t&&(!r||n.sex===(null==e?void 0:e.sex)));if(s.length>0){const t=s[0],n=this.getSceneNode(t,t,{color:[255,255,255,255],opacity:"http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of?.5:.2,unpickable:!0,_lighting:"pbr"}),r=(null!==(i=this.db.getSpatialEntities(e))&&void 0!==i?i:[]).map(e=>this.getSceneNode(e,t,{color:[255,255,255,229.5]}));return[n].concat(r).filter(t=>void 0!==t)}return[]}getEntitySceneNodes(t){const e=this.getReferenceBody(t);return this.db.getSpatialEntities(t).map(t=>this.getSceneNode(t,e,{color:[255,255,255,229.5]})).filter(t=>void 0!==t)}getSceneNode(t,e,n={}){var i,r,s,o;const a=null===(r=null===(i=null==t?void 0:t.object)||void 0===i?void 0:i.file_format)||void 0===r?void 0:r.startsWith("model/gltf");let l=this.db.graph.getTransformationMatrix(a&&t.object?t.object["@id"]:t["@id"],e["@id"]);if(l){if(a)l=new bT(bT.IDENTITY).rotateX(NS(90)).multiplyLeft(l);else{let e;switch(t.dimension_units){case"centimeter":e=.01;break;case"millimeter":e=.001;break;case"meter":default:e=1}const n=[t.x_dimension,t.y_dimension,t.z_dimension].map(t=>t*e/2);l.scale(n)}return Object.assign({"@id":t["@id"],"@type":"SpatialSceneNode",entityId:t.entityId,ccf_annotations:t.ccf_annotations,representation_of:t.representation_of,reference_organ:t.reference_organ,scenegraph:a?null===(s=t.object)||void 0===s?void 0:s.file:void 0,scenegraphNode:a?null===(o=t.object)||void 0===o?void 0:o.file_subpath:void 0,transformMatrix:l,tooltip:t.label},n)}}getScene(t){return[...this.getReferenceSceneNodes(t),...this.getEntitySceneNodes(t)]}}const _W="https://entity.api.hubmapconsortium.org/entities/",wW=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),xW={"HBM558.SRZG.629":"HBM558.SRZG.629_UFL0002-SP-3-4-1.jpg","HBM562.NTMH.548":"HBM562.NTMH.548_UFL0006-SP-1-2-1.jpg","HBM685.KHRQ.684":"HBM685.KHRQ.684_UFL0008-LY07-1-1.jpg","HBM278.SFQW.627":"HBM278.SFQW.627_UFL0008-LY09-1-1.jpg","HBM427.SMGB.866":"HBM427.SMGB.866_UFL0004-SP-1-4-1.jpg","HBM432.LLCF.677":"HBM432.LLCF.677_UFL0001-SP-2-5-1.jpg","HBM586.ZSVS.996":"HBM586.ZSVS.996_UFL0008-SP-1-1-1.jpg","HBM285.XMBT.542":"HBM285.XMBT.542_UFL0006-TH-1-3-1.jpg","HBM289.BWJW.663":"HBM289.BWJW.663_UFL0006-TH-1-2-1.jpg","HBM255.SRPR.985":"HBM255.SRPR.985_UFL0005-TH-2-2-1.jpg","HBM799.WXHD.535":"HBM799.WXHD.535_UFL0009-LY02-1-1.jpg","HBM294.RZFN.624":"HBM294.RZFN.624_UFL0005-TH-1-1-1.jpg","HBM383.TRQG.424":"HBM383.TRQG.424_UFL0006-SP-1-3-1.jpg","HBM647.MFQB.496":"HBM647.MFQB.496_UFL0001-SP-1-2-1.jpg","HBM237.GGPR.739":"HBM237.GGPR.739_UFL0006-LY01-1-1.jpg","HBM288.TPBD.654":"HBM288.TPBD.654_UFL0003-SP-2-2-1.jpg","HBM974.NDXT.675":"HBM974.NDXT.675_UFL0008-TH-2-2-1.jpg","HBM589.SLVV.423":"HBM589.SLVV.423_UFL0008-LY10-1-1.jpg","HBM794.RLFN.358":"HBM794.RLFN.358_UFL0006-LY03-1-1.jpg","HBM372.BQSR.778":"HBM372.BQSR.778_UFL0007-SP-1-1-1.jpg","HBM499.TKDW.458":"HBM499.TKDW.458_UFL0009-LY03-1-1.jpg","HBM342.PRQB.739":"HBM342.PRQB.739_UFL0003-LY06-1-1.jpg","HBM633.CLVN.674":"HBM633.CLVN.674_UFL0003-SP-3-6-1.jpg","HBM343.JQKM.578":"HBM343.JQKM.578_UFL0009-LY01-1-1.jpg","HBM987.XGTH.368":"HBM987.XGTH.368_UFL0002-SP-2-4-1.jpg","HBM964.CWCP.788":"HBM964.CWCP.788_UFL0006-LY02-2-1.jpg","HBM244.TJLK.223":"HBM244.TJLK.223_UFL0003-SP-1-4-1.jpg","HBM646.FSBQ.966":"HBM646.FSBQ.966_UFL0007-SP-2-2-1.jpg","HBM572.GXSB.234":"HBM572.GXSB.234_UFL0003-SP-3-2-1.jpg","HBM772.TKGJ.794":"HBM772.TKGJ.794_UFL0008-SP-2-1-1.jpg","HBM239.CBWR.263":"HBM239.CBWR.263_UFL0008-SP-1-2-1.jpg","HBM992.NRTT.383":"HBM992.NRTT.383_UFL0006-SP-1-1-1.jpg","HBM283.DQXD.546":"HBM283.DQXD.546_UFL0003-SP-1-2-1.jpg","HBM795.JHND.856":"HBM795.JHND.856_UFL0007-SP-1-2-1.jpg","HBM267.BZKT.867":"HBM267.BZKT.867_UFL0003-SP-2-6-1.jpg","HBM838.DLMJ.782":"HBM838.DLMJ.782_UFL0008-TH-1-1-1.jpg","HBM337.FSXL.564":"HBM337.FSXL.564_UFL0001-SP-3-8-2.jpg","HBM355.JDLK.244":"HBM355.JDLK.244_UFL0004-SP-2-4-1.jpg","HBM599.PSZG.737":"HBM599.PSZG.737_UFL0006-LY02-1-1.jpg"},SW={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},EW=function(){const t={};return Object.entries(sW).forEach(([e,n])=>t[e]=n.id),t}(),CW={BL:[EW.body,EW.bladder],RK:[EW.body,EW.kidney,EW.right_kidney],LK:[EW.body,EW.kidney,EW.left_kidney],HT:[EW.body,EW.heart],LI:[EW.body,EW.large_intestine,EW.colon],SI:[EW.body,EW.small_instestine],LL:[EW.body,EW.respiratory_system,EW.lung,EW.left_lung],RL:[EW.body,EW.respiratory_system,EW.lung,EW.right_lung],LY:[EW.body,EW.lymph_node],SP:[EW.body,EW.spleen],TH:[EW.body,EW.thymus],UR:[EW.body,EW.ureter],LV:[EW.body,EW.liver],OT:[EW.body]},OW={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/latest/ccf.owl#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",label:"rdfs:label",description:"rdfs:comment",link:{"@id":"rdfs:seeAlso","@type":"@id"},samples:{"@reverse":"has_donor"},sections:{"@id":"has_tissue_section","@type":"@id"},datasets:{"@id":"has_dataset","@type":"@id"},rui_location:{"@id":"has_spatial_entity","@type":"@id"},ontologyTerms:{"@id":"has_ontology_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class TW{constructor(t,e="",n="",i){var r,s;if(this.data=t,this.bad=!1,this["@type"]="Sample",this.sample_type="Tissue Block","Sample"!==this.data.entity_type)return void(this.bad=!0);const o=this.data.descendants||[],a=(this.data.ancestors||[]).find(t=>"Donor"===t.entity_type);this.donor=this.getDonor(a,n);const l=this.getRuiLocation(t,this.donor);l?this.rui_location=l:this.bad=!0;const c=new Date(t.last_modified_timestamp).toLocaleDateString(),u=SW[t.group_uuid]||t.group_name,h=t.created_by_user_displayname;this["@id"]=_W+t.uuid,this.label=`Registered ${c}, ${h}, ${u}`,this.link=`${n}browse/sample/${t.uuid}`;const d={},p=[];this.sections=p;const f=[];this.datasets=f;for(const v of o.filter(t=>"Sample"===t.entity_type)){const e=this.getSection(v,t,n);d[v.submission_id]=e,p.push(e),e.section_number=null!==(r=e.section_number)&&void 0!==r?r:p.length}for(const v of o)if("Dataset"===v.entity_type){const t=this.getDataset(v,e,n,i),r=(0,KG.get)(v,["ingest_metadata","metadata","tissue_id"]);d[r]?null===(s=d[r].datasets)||void 0===s||s.push(t):f.push(t)}const g=null!=l?l:{},m=`${g.x_dimension} x ${g.y_dimension} x ${g.z_dimension} ${g.dimension_units}`;this.section_count=g.slice_count||p.length;const b=parseFloat((g.slice_thickness||(g.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=b;const y=g.dimension_units||"millimeter";this.section_units=y,this.description=`${m}, ${b} ${y}, ${t.specimen_type}, ${this.section_count} Sections`,p.forEach((t,e)=>{t.description=`${g.x_dimension} x ${g.y_dimension} x ${b} ${y}, ${b} ${y}, ${t.description}`,t.section_number=e+1})}getSection(t,e,n){const i=new Date(t.last_modified_timestamp).toLocaleDateString();return{"@id":_W+t.uuid,"@type":"Sample",label:`Registered ${i}, ${t.created_by_user_displayname}, ${SW[t.group_uuid]||t.group_name}`,description:`${e.specimen_type}`,link:`${n}browse/sample/${t.uuid}`,sample_type:"Tissue Section",section_number:1,samples:[],datasets:[]}}getDataset(t,e="",n="",i){var r;const s=new Date(t.last_modified_timestamp).toLocaleDateString(),o=SW[t.group_uuid]||t.group_name,a=t.created_by_user_displayname,l=[...t.data_types,(0,KG.get)(t,["ingest_metadata","metadata","assay_type"],"")],c=l.join("|").toLowerCase();let u,h="assets/icons/ico-unknown.svg";return-1!==c.indexOf("10x")?(u="10x",h="assets/icons/ico-bulk-10x.svg"):-1!==c.indexOf("af")?(u="AF",h="assets/icons/ico-spatial-af.svg"):-1!==c.indexOf("codex")?(u="CODEX",h="assets/icons/ico-spatial-codex.svg"):-1!==c.indexOf("imc")?(u="IMC",h="assets/icons/ico-spatial-imc.svg"):-1!==c.indexOf("lc")&&-1===c.indexOf("af")?(u="LC",h="assets/icons/ico-bulk-lc.svg"):u=-1!==c.indexOf("maldi")?"MALDI":-1!==c.indexOf("pas")?"PAS":"OTHER",h=null!==(r=this.getDatasetThumbnail(t,e,i))&&void 0!==r?r:h,{"@id":_W+t.uuid,"@type":"Dataset",label:`Registered ${s}, ${a}, ${o}`,description:`Data/Assay Types: ${l.join(", ")}`,link:`${n}browse/dataset/${t.uuid}`,technology:u,thumbnail:h}}getDatasetThumbnail(t,e,n){if(t.thumbnail_file){const i=t.thumbnail_file;return`${e}/${i.file_uuid}/${i.filename}`+(n?`?token=${n}`:"")}if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===t.group_uuid){const i=(0,KG.get)(t,"metadata.files",[]).filter(t=>/\.(ome\.tif|ome\.tiff)$/.test(t.rel_path)).filter(t=>!/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(t.rel_path)).filter(t=>wW.has(t.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(i=>`${e}/${t.uuid}/${i.rel_path}`+(n?`?token=${n}`:""));if(i.length>0){const t=i[0].split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");if(wW.has(t))return`assets/thumbnails/TMC-Vanderbilt/DR1/${t}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===t.group_uuid){const e=xW[t.hubmap_id];if(e)return`assets/thumbnails/TMC-Florida/${e}`}}getDonor(t,e){const n=(t.description||"").toLowerCase();let i;n.includes("female")?i="Female":n.includes("male")&&(i="Male");const r=n.match(/age ([0-9]+)/);let s,o;r&&(s=(0,KG.toNumber)(r[1]));for(const u of(0,KG.get)(t,"metadata.organ_donor_data",[]))"Feminine gender"===u.preferred_term||"Female"===u.preferred_term?i="Female":"Masculine gender"===u.preferred_term||"Male"===u.preferred_term?i="Male":"Current chronological age"===u.preferred_term||"Age"===u.preferred_term?s=(0,KG.toNumber)(u.data_value):"Body mass index"===u.preferred_term&&(o=(0,KG.toNumber)(u.data_value));let a="";i&&s&&(a+=`${i}, Age ${s}`,o&&(a+=`, BMI ${o.toFixed(1)}`));const l=new Date(t.last_modified_timestamp).toLocaleDateString(),c=SW[t.group_uuid]||t.group_name;return{"@id":_W+t.uuid,"@type":"Donor",label:a,description:`Entered ${l}, ${t.created_by_user_displayname}, ${c}`,link:`${e}browse/donor/${t.uuid}`,age:s,sex:i,bmi:o,consortium_name:"HuBMAP",provider_name:c,provider_uuid:t.group_uuid,samples:[]}}getRuiLocation(t,e){var n;const i=(t.ancestors||[]).find(t=>"Sample"===t.entity_type&&"organ"===t.specimen_type),r=CW[null==i?void 0:i.organ]||[EW.body];let s,o=t.rui_location;if(o&&("string"==typeof o&&(o=JSON.parse(o)),o.alignment_id?console.log("Detected a deprecated rui_location",t.uuid):o["@id"]&&(s=o)),s){s.ccf_annotations=r.concat(s.ccf_annotations||[]);const t=null!==(n=(0,KG.get)(s,["placement","target"]))&&void 0!==n?n:"";t.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")&&(0,KG.set)(s,["placement","target"],t.replace("#VHSpleenCC","Male"===e.sex?"#VHMSpleenCC":"#VHFSpleenCC")),("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===t||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===t)&&(0,KG.set)(s,["placement","target"],"Male"===e.sex?t.replace("#VH","#VHM")+"_Patch":t.replace("#VH","#VHF")+"_Patch")}return s}getTissueBlock(){return(0,KG.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}function kW(t,e,n,i,r="",s=""){return lw(this,void 0,void 0,function*(){let o;if("static"===e)o=yield fetch(t).then(t=>t.ok?t.json():void 0).catch(()=>{});else if("search-api"===e){const e={"Content-type":"application/json"};i&&i.length>0&&(e.Authorization=`Bearer ${i}`),o=yield fetch(t,{method:"POST",headers:e,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","portal_metadata_upload_files","image_file_metadata","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:{exists:{field:"rui_location"}}})}).then(t=>t.ok?t.json():void 0).catch(()=>{})}if(o)return function(t,e="",n="",i,r=!1){const s={},o=(0,KG.get)(t,"hits.hits",[]).map(t=>(0,KG.get)(t,"_source",{})).map(t=>new TW(t,e,n,i).toJsonLd());for(const l of o){const t=l["@id"];s[t]?s[t].samples.push(l.samples[0]):s[t]=l}const a=Object.values(s);return r&&(function(t){let e=[],n=0;for(const i of t.filter(t=>t.samples.length>1)){const t=i.samples;for(let i=0;it["@id"]===r)&&(t[i].deleteMe=!0,n++)}i.samples=t.filter(t=>!0!==t.deleteMe)}n>0&&console.log(`\u26a0 ${n} sections identified as blocks`)}(a),console.log(a.map(t=>Object.assign({"@context":OW},t)))),{"@context":OW,"@graph":a}}(o,r,s,i);console.warn(`Unable to load ${t} as HuBMAP Data`)})}function AW(t,e,n){var i;const r=new Map,s=new Set;t.some(t=>{var n;return e.has(t.subject.id)&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.donor,null,null);const o=n(s),a=new Set;for(const l of o)for(const t of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(t);return a}function PW(t,e){return n=>t.has(n.id)?e.add(n.id):void 0}const IW={[iW.ontologyNode.label.id]:"label",[iW.ontologyNode.parent.id]:"parent",[iW.ontologyNode.synonymLabels.id]:"synonymLabels"};function MW(t,e){const n=WG.DataFactory.namedNode(e),i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""};return t.some(t=>{const e=IW[t.predicate.id];if(e){const n="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;"synonymLabels"===e?i.synonymLabels.push(n):(0,KG.set)(i,e,n)}return!1},n,null,null,null),i.children=t.getSubjects(iW.ontologyNode.children,n,null).map(t=>t.id),i}const DW={[eW.label.id]:"label",[eW.description.id]:"description",[eW.link.id]:"link"},RW=Object.assign(Object.assign({},DW),{[eW.providerName.id]:"providerName"}),NW=Object.assign(Object.assign({},DW),{[eW.technology.id]:"technology",[eW.thumbnail.id]:"thumbnail"}),LW=Object.assign(Object.assign({},DW),{[eW.sampleType.id]:"sampleType",[eW.sectionNumber.id]:"sectionNumber",[eW.datasets.id]:"datasets"}),jW=Object.assign(Object.assign({},DW),{[eW.sampleType.id]:"sampleType",[eW.sectionCount.id]:"sectionCount",[eW.sectionSize.id]:"sectionSize",[eW.sectionUnits.id]:"sectionUnits",[eW.donor.id]:"donor",[eW.spatialEntity.id]:"spatialEntityId",[eW.sections.id]:"sections",[eW.datasets.id]:"datasets"}),FW=(0,KG.memoize)(function(t,e){const n={"@id":e,"@type":"Donor"};return t.some(t=>{const e=RW[t.predicate.id];if(e){const i="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(n,e,i)}return!1},WG.DataFactory.namedNode(e),null,null,null),n},(t,e)=>e);function BW(t,e){const n={"@id":e,"@type":"Dataset"};return t.some(t=>{const e=NW[t.predicate.id];if(e){const i="Literal"===t.object.termType?(0,QG.fromRdf)(t.object):t.object.id;(0,KG.set)(n,e,i)}return!1},WG.DataFactory.namedNode(e),null,null,null),n}const VW=(0,KG.memoize)(function(t,e){const n={"@id":e,"@type":"Sample",sections:[],datasets:[]};return t.some(e=>{const i=jW[e.predicate.id];if(i){const r="Literal"===e.object.termType?(0,QG.fromRdf)(e.object):e.object.id;if("sections"===i){const e=function(t,e){const n={"@id":e,"@type":"Sample",datasets:[]};return t.some(e=>{const i=LW[e.predicate.id];if(i){const r="Literal"===e.object.termType?(0,QG.fromRdf)(e.object):e.object.id;if("datasets"===i){const e=BW(t,r);n[i].push(e)}else(0,KG.set)(n,i,r)}return!1},WG.DataFactory.namedNode(e),null,null,null),n}(t,r);n[i].push(e)}else if("datasets"===i){const e=BW(t,r);n[i].push(e)}else"donor"===i?n[i]=FW(t,r):(0,KG.set)(n,i,r)}return!1},WG.DataFactory.namedNode(e),null,null,null),n},(t,e)=>e),zW={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",dataSources:[],hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"};class UW{constructor(t=zW){this.options=t,this.store=new WG.Store(void 0,{factory:WG.DataFactory}),this.graph=new yW(this),this.scene=new vW(this)}connect(t,e=!1){return lw(this,void 0,void 0,function*(){return t&&(this.options=t),this.initializing||(this.initializing=e?this.cachedConnect():this.doConnect()),yield this.initializing,this.store.size>0})}cachedConnect(){return lw(this,void 0,void 0,function*(){const t=(new Date).getTime(),e="ccf-database.last_modified",n="ccf-database",i=yield GG(e).catch(()=>{});let r;i&&t-new Date(+i).getTime()>36e5?yield function(t,e=$G()){return e("readwrite",e=>(t.forEach(t=>e.delete(t)),UG(e.transaction)))}([n,e]).catch(()=>{}):r=yield GG(n).catch(()=>{}),r?yield this.deserialize(r):(yield this.doConnect(),function(t,e=$G()){return e("readwrite",e=>(t.forEach(t=>e.put(t[1],t[0])),UG(e.transaction)))}([[n,this.serialize()],[e,""+t]]).catch(()=>{}))})}doConnect(){var t,e;return lw(this,void 0,void 0,function*(){const n=[],i=null!==(e=null===(t=this.options.dataSources)||void 0===t?void 0:t.concat())&&void 0!==e?e:[],r=this.options.ccfOwlUrl;if(r.endsWith(".n3store.json")){const t=yield fetch(r).then(t=>t.text()).catch(()=>console.log("Couldn't locate serialized store."));t&&(this.store=(0,WG.deserializeN3Store)(t,WG.DataFactory))}else(null==r?void 0:r.length)>0&&i.push(r);this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?i.push(this.options.hubmapDataUrl):n.push(kW(this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapQuery,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl).then(t=>{if(t)return this.addDataSources([t])}))),n.push(this.addDataSources(i)),yield Promise.all(n),yield this.synchronize()})}addDataSources(t,e){return lw(this,void 0,void 0,function*(){const n=null!=e?e:this.store;return yield Promise.all(t.map(t=>lw(this,void 0,void 0,function*(){"string"==typeof t?t.endsWith("jsonld")?yield(0,WG.addJsonLdToStore)(t,n):t.endsWith("n3")?yield(0,WG.addN3ToStore)(t,n):t.endsWith("rdf")||t.endsWith("owl")||t.endsWith("xml")?yield(0,WG.addRdfXmlToStore)(t,n):yield(0,WG.addJsonLdToStore)(t,n):yield(0,WG.addJsonLdToStore)(t,n)}))),this})}synchronize(){return lw(this,void 0,void 0,function*(){return yield new Promise(t=>{setTimeout(t,500)}),this.graph.createGraph(),this})}serialize(){return(0,WG.serializeN3Store)(this.store)}deserialize(t){return lw(this,void 0,void 0,function*(){this.store=(0,WG.deserializeN3Store)(t,WG.DataFactory),this.graph=new yW(this),this.scene=new vW(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(t={}){return function(t,e){var n,i,r,s,o;let a=function(t){const e=new Set;return t.forSubjects(t=>e.add(t.id),eW.spatialEntity,null,null),e}(t);if(a.size>0&&(a=function(t,e,n=!0){const i=new Set;if(t.forSubjects(PW(e,i),eW.spatialEntity,null,null),!n){const t=new Set;return e.forEach(e=>i.has(e)?void 0:t.add(e)),t}return i}(t,a)),a.size>0&&("Male"===e.sex||"Female"===e.sex)){const n=e.sex;a=AW(t,a,e=>function(t,e,n){const i=new Set;return t.forSubjects(PW(e,i),eW.sex,eW[n],null),i}(t,e,n))}if(a.size>0&&(null===(n=e.tmc)||void 0===n?void 0:n.length)>0&&(a=AW(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.literal(r);t.forSubjects(PW(e,i),eW.providerName,n,null)}return i}(t,n,e.tmc))),a.size>0&&(null===(i=e.technologies)||void 0===i?void 0:i.length)>0&&(a=function(t,e,n){var i;const r=new Map,s=new Set,o=new Set;t.some(t=>(e.has(t.subject.id)&&o.add(t.object.id),!1),null,eW.sections,null,null),t.some(t=>{var n;return(e.has(t.subject.id)||o.has(t.subject.id))&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.datasets,null,null);const a=n(s),l=new Set;for(const c of a)for(const t of null!==(i=r.get(c))&&void 0!==i?i:[])l.add(t);return l}(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.literal(r);t.forSubjects(PW(e,i),eW.technology,n,null)}return i}(t,n,e.technologies))),a.size>0&&(null===(r=e.ontologyTerms)||void 0===r?void 0:r.length)>0&&(a=function(t,e,n){var i;const r=new Map,s=new Set;t.some(t=>{var n;return e.has(t.subject.id)&&(s.add(t.object.id),r.has(t.object.id)?null===(n=r.get(t.object.id))||void 0===n||n.push(t.subject.id):r.set(t.object.id,[t.subject.id])),!1},null,eW.spatialEntity,null,null);const o=n(s),a=new Set;for(const l of o)for(const t of null!==(i=r.get(l))&&void 0!==i?i:[])a.add(t);return a}(t,a,n=>function(t,e,n){const i=new Set;for(const r of n){const n=WG.DataFactory.namedNode(r);t.forSubjects(PW(e,i),iW.spatialEntity.ccf_annotations,n,null)}return i}(t,n,e.ontologyTerms))),a.size>0&&2===(null===(s=e.ageRange)||void 0===s?void 0:s.length)&&(0,KG.isFinite)(e.ageRange[0])&&(0,KG.isFinite)(e.ageRange[1])){const n=Math.max(...e.ageRange),i=Math.min(...e.ageRange);1===i&&110===n||(a=AW(t,a,e=>function(t,e,n,i){const r=new Set;return t.some(t=>{if(e.has(t.subject.id)){const e=(0,QG.fromRdf)(t.object);e>=n&&e<=i&&r.add(t.subject.id)}return!1},null,eW.age,null,null),r}(t,e,i,n)))}if(a.size>0&&2===(null===(o=e.bmiRange)||void 0===o?void 0:o.length)&&(0,KG.isFinite)(e.bmiRange[0])&&(0,KG.isFinite)(e.bmiRange[1])){const n=Math.max(...e.bmiRange),i=Math.min(...e.bmiRange);13===i&&83===n||(a=AW(t,a,e=>function(t,e,n,i){const r=new Set;return t.some(t=>{if(e.has(t.subject.id)){const e=(0,QG.fromRdf)(t.object);e>=n&&e<=i&&r.add(t.subject.id)}return!1},null,eW.bmi,null,null),r}(t,e,i,n)))}return a}(this.store,t)}get(t){return this.store.getQuads(WG.DataFactory.namedNode(t),null,null,null)}search(t={}){return[...this.getIds(t)].map(t=>this.get(t))}getSpatialEntities(t){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>mW(this.store,t))}getDatasetTechnologyNames(){return lw(this,void 0,void 0,function*(){return function(t){const e=new Set;return t.some(t=>(e.add(t.object.value),!1),null,eW.technology,null,null),Array.from(e).sort()}(this.store)})}getProviderNames(){return lw(this,void 0,void 0,function*(){return function(t){const e=new Set;return t.some(t=>(e.add(t.object.value),!1),null,eW.providerName,null,null),Array.from(e).sort()}(this.store)})}getTissueBlockResults(t){return lw(this,void 0,void 0,function*(){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>VW(this.store,t))})}getAggregateResults(t){return lw(this,void 0,void 0,function*(){return function(t,e){const n=new Set;e.some(e=>(t.has(e.subject.id)&&n.add(e.object.id),!1),null,eW.donor,null,null);const i=new Set;e.some(t=>(n.has(t.subject.id)&&i.add(t.object.id),!1),null,eW.providerUUID,null,null);const r=new Set;e.forSubjects(e=>{t.has(e.id)&&r.add(e.id)},eW.spatialEntity,null,null);const s=new Set;e.some(t=>(r.has(t.subject.id)&&s.add(t.object.id),!1),null,eW.sections,null,null);const o=new Set;return e.some(t=>{const e=t.subject;return(r.has(e.id)||s.has(e.id))&&o.add(t.object.id),!1},null,eW.datasets,null,null),Object.entries({"Tissue Data Providers":i.size,Donors:n.size,"Tissue Blocks":r.size,"Tissue Sections":s.size,"Tissue Datasets":o.size}).map(([t,e])=>({label:t,count:e}))}(this.getIds(t),this.store)})}getOntologyTermOccurences(t){return lw(this,void 0,void 0,function*(){return function(t,e){const n=new Map;e.some(e=>(t.has(e.subject.id)&&(n.has(e.object.id)?n.get(e.object.id).push(e.subject.id):n.set(e.object.id,[e.subject.id])),!1),null,eW.spatialEntity,null,null);const i={};return e.some(t=>{var e,r;if(n.has(t.subject.id)){const s=null!==(r=null===(e=n.get(t.subject.id))||void 0===e?void 0:e.length)&&void 0!==r?r:0;i[t.object.id]=s+(i[t.object.id]||0)}return!1},null,iW.spatialEntity.ccf_annotations,null,null),i}(this.getIds(t),this.store)})}getOntologyTreeModel(){return lw(this,void 0,void 0,function*(){return function(t){const e={root:sW.body.id,nodes:{}},n=new Set;t.some(t=>(n.add(t.subject.id),n.add(t.predicate.id),!1),null,iW.ontologyNode.parent,null,null);for(const i of n)e.nodes[i]=MW(t,i);return e}(this.store)})}getReferenceOrgans(){return lw(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(t){return lw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(t)})}getReferenceOrganScene(t,e){return lw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(t,e)})}}const HW=Symbol("Comlink.proxy"),$W=Symbol("Comlink.endpoint"),GW=Symbol("Comlink.releaseProxy"),WW=Symbol("Comlink.thrown"),qW=t=>"object"==typeof t&&null!==t||"function"==typeof t,XW=new Map([["proxy",{canHandle:t=>qW(t)&&t[HW],serialize(t){const{port1:e,port2:n}=new MessageChannel;return YW(t,e),[n,[n]]},deserialize:t=>(t.start(),QW(t))}],["throw",{canHandle:t=>qW(t)&&WW in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}}]]);function YW(t,e=self){e.addEventListener("message",function n(i){if(!i||!i.data)return;const{id:r,type:s,path:o}=Object.assign({path:[]},i.data),a=(i.data.argumentList||[]).map(rq);let l;try{const e=o.slice(0,-1).reduce((t,e)=>t[e],t),n=o.reduce((t,e)=>t[e],t);switch(s){case"GET":l=n;break;case"SET":e[o.slice(-1)[0]]=rq(i.data.value),l=!0;break;case"APPLY":l=n.apply(e,a);break;case"CONSTRUCT":l=function(t){return Object.assign(t,{[HW]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;YW(t,n),l=function(t,e){return nq.set(t,e),t}(e,[e])}break;case"RELEASE":l=void 0;break;default:return}}catch(c){l={value:c,[WW]:0}}Promise.resolve(l).catch(t=>({value:t,[WW]:0})).then(t=>{const[i,o]=iq(t);e.postMessage(Object.assign(Object.assign({},i),{id:r}),o),"RELEASE"===s&&(e.removeEventListener("message",n),KW(e))})}),e.start&&e.start()}function KW(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function QW(t,e){return JW(t,[],e)}function ZW(t){if(t)throw new Error("Proxy has been released and is not useable")}function JW(t,e=[],n=function(){}){let i=!1;const r=new Proxy(n,{get(n,s){if(ZW(i),s===GW)return()=>sq(t,{type:"RELEASE",path:e.map(t=>t.toString())}).then(()=>{KW(t),i=!0});if("then"===s){if(0===e.length)return{then:()=>r};const n=sq(t,{type:"GET",path:e.map(t=>t.toString())}).then(rq);return n.then.bind(n)}return JW(t,[...e,s])},set(n,r,s){ZW(i);const[o,a]=iq(s);return sq(t,{type:"SET",path:[...e,r].map(t=>t.toString()),value:o},a).then(rq)},apply(n,r,s){ZW(i);const o=e[e.length-1];if(o===$W)return sq(t,{type:"ENDPOINT"}).then(rq);if("bind"===o)return JW(t,e.slice(0,-1));const[a,l]=eq(s);return sq(t,{type:"APPLY",path:e.map(t=>t.toString()),argumentList:a},l).then(rq)},construct(n,r){ZW(i);const[s,o]=eq(r);return sq(t,{type:"CONSTRUCT",path:e.map(t=>t.toString()),argumentList:s},o).then(rq)}});return r}function tq(t){return Array.prototype.concat.apply([],t)}function eq(t){const e=t.map(iq);return[e.map(t=>t[0]),tq(e.map(t=>t[1]))]}const nq=new WeakMap;function iq(t){for(const[e,n]of XW)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},nq.get(t)||[]]}function rq(t){switch(t.type){case"HANDLER":return XW.get(t.name).deserialize(t.value);case"RAW":return t.value}}function sq(t,e,n){return new Promise(i=>{const r=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.addEventListener("message",function e(n){!n.data||!n.data.id||n.data.id!==r||(t.removeEventListener("message",e),i(n.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:r},e),n)})}function oq(t,e){return t===e}let aq=(()=>{class t{constructor(t,e){this.locator=e,this.subscriptions=new g,this.dataSource=t.config$.pipe(Hd(t=>Object.keys(t).length>0),D(t=>t),Rd(oq),Qd(t=>function(t,e){return new C(n=>{let i,r;try{i=t()}catch(o){return void n.error(o)}try{r=e(i)}catch(o){return void n.error(o)}const s=(r?U(r):ep).subscribe(n);return()=>{s.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),e=>this.connectDataSource(e.source,t))),up(1))}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Qd(e=>e.getTissueBlockResults(t)),Gp(1))}getDatasetTechnologyNames(){return this.dataSource.pipe(Qd(t=>t.getDatasetTechnologyNames()),Gp(1))}getProviderNames(){return this.dataSource.pipe(Qd(t=>t.getProviderNames()),Gp(1))}getAggregateResults(t){return this.dataSource.pipe(Qd(e=>e.getAggregateResults(t)),Gp(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Qd(e=>e.getOntologyTermOccurences(t)),Gp(1))}getOntologyTreeModel(){return this.dataSource.pipe(Qd(t=>t.getOntologyTreeModel()),Gp(1))}getReferenceOrgans(){return this.dataSource.pipe(Qd(t=>t.getReferenceOrgans()),Gp(1))}getScene(t){return this.dataSource.pipe(Qd(e=>e.getScene(t)),Gp(1))}createDataSource(){let t,e=()=>{};if("undefined"==typeof Worker||RG.disableDbWorker)t=new UW;else{let n;({source:t,worker:n}=this.getWebWorkerDataSource(!0)),e=()=>lw(this,void 0,void 0,function*(){yield t[GW](),n.terminate()})}return{source:t,unsubscribe:e}}connectDataSource(t,e){return lw(this,void 0,void 0,function*(){RG.disableDbWorker&&(yield new Promise(t=>{setTimeout(t,100)}));const n=(new Date).getTime();return yield t.connect(e,!0),RG.production||console.info(`Loaded CCF database in ${((new Date).getTime()-n)/1e3}s`),t})}getWebWorkerDataSource(t=!1){let e;if(t)e=new Worker(n.tu(new URL(n.p+n.u(10),n.b)),{type:void 0});else{const t=this.locator.prepareExternalUrl("0-es2015.worker.js"),n=new Blob([`importScripts('${t}')`],{type:"application/javascript"});e=new Worker(URL.createObjectURL(n),{type:"module"})}return{source:QW(e),worker:e}}}return t.\u0275fac=function(e){return new(e||t)(Ci(SG),Ci(rh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function lq(t,e,n,i){n&&"function"!=typeof n&&(i=n);const r="function"==typeof n?n:void 0,s=new lp(t,e,i);return t=>rt(()=>s,r)(t)}const cq=(t,e)=>JSON.stringify(t)===JSON.stringify(e),uq=t=>t.map(t=>void 0!==t?JSON.parse(JSON.stringify(t)):t),hq={storageStrategy:class extends class{}{constructor(){super(...arguments),this.cachePairs=[]}add(t,e,n){this.cachePairs.push(t)}addMany(t){this.cachePairs=t}updateAtIndex(t,e){Object.assign(this.cachePairs[t],e)}update(t,e){Object.assign(this.cachePairs[t],e)}getAll(){return this.cachePairs}removeAtIndex(t){this.cachePairs.splice(t,1)}remove(t){this.cachePairs.splice(t,1)}removeAll(){this.cachePairs.length=0}},globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},dq=new P;function pq(t={}){return function(e,n,i){const r=t.cacheKey||e.constructor.name+"#"+n,s=i.value;if(i&&i.value){let e=t.storageStrategy?new t.storageStrategy:new hq.storageStrategy;const n=[];t.cacheModifier&&t.cacheModifier.subscribe(t=>e.addMany(t(e.getAll(r,this)),r,this)),Q(dq.asObservable(),t.cacheBusterObserver?t.cacheBusterObserver:np()).subscribe(t=>{e.removeAll(r,this),n.length=0}),t.cacheResolver=t.cacheResolver||hq.cacheResolver||cq,t.cacheHasher=t.cacheHasher||hq.cacheHasher||uq,i.value=function(...i){const o=e.getAll(r,this);let a=t.cacheHasher(i),l=o.find(e=>t.cacheResolver(e.parameters,a));const c=n.find(e=>t.cacheResolver(e.parameters,a));if((t.maxAge||hq.maxAge)&&l&&l.created&&((new Date).getTime()-new Date(l.created).getTime()>(t.maxAge||hq.maxAge)?(e.remove?e.remove(o.indexOf(l),l,r,this):e.removeAtIndex(o.indexOf(l),r,this),l=null):(t.slidingExpiration||hq.slidingExpiration)&&(l.created=new Date,e.update?e.update(o.indexOf(l),l,r,this):e.updateAtIndex(o.indexOf(l),l,r,this))),l){const e=wd(l.response);return t.async?e.pipe(uU(0)):e}if(c)return c.response;{const l=s.call(this,...i).pipe(mv(()=>{const e=n.find(e=>t.cacheResolver(e.parameters,a));n.splice(n.indexOf(e),1)}),$f(n=>{(!t.shouldCacheDecider||t.shouldCacheDecider(n))&&((!(t.maxCacheCount||hq.maxCacheCount)||1===(t.maxCacheCount||hq.maxCacheCount)||(t.maxCacheCount||hq.maxCacheCount)&&(t.maxCacheCount||hq.maxCacheCount)t.map(t=>Object.assign(Object.assign({},t),{transformMatrix:new bT(t.transformMatrix)}))))}doFetch(t,e){const{globalConfig:n,http:i}=this,r=this.filterToParams(e);return n.getOption("remoteApiEndpoint").pipe(D(e=>`${e}/${t}`),Qd(t=>i.get(t,{params:this.withToken(r),responseType:"json"})),up(1))}filterToParams(t={}){return Object.keys(t).sort().reduce((e,n)=>{const i=t[n];return(t=>null==t||""===t||Array.isArray(t)&&0===t.length)(i)?e:e.set(n,(t=>Array.isArray(t)?t.join(","):`${t}`)(i))},new Tv)}withToken(t){const{globalConfig:{snapshot:{hubmapToken:e}}}=this;return e?t.set("token",e):t}}fq.\u0275fac=function(t){return new(t||fq)(Ci(SG),Ci(Bv))},fq.\u0275prov=xt({token:fq,factory:fq.\u0275fac,providedIn:"root"}),sw([pq()],fq.prototype,"getProviderNames",null),sw([pq()],fq.prototype,"getDatasetTechnologyNames",null),sw([pq()],fq.prototype,"getOntologyTreeModel",null),sw([pq()],fq.prototype,"getReferenceOrgans",null),sw([pq()],fq.prototype,"getTissueBlockResults",null),sw([pq()],fq.prototype,"getAggregateResults",null),sw([pq()],fq.prototype,"getOntologyTermOccurences",null),sw([pq()],fq.prototype,"getScene",null);let gq=(()=>{class t{constructor(t,e,n){this.impl$=t.config$.pipe(D(t=>!!t.useRemoteApi&&!!t.remoteApiEndpoint),D(t=>t?n:e),Rd(),up(1))}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getReferenceOrgans(){return this.forwardCall("getReferenceOrgans")}getTissueBlockResults(t){return this.forwardCall("getTissueBlockResults",t)}getAggregateResults(t){return this.forwardCall("getAggregateResults",t)}getOntologyTermOccurences(t){return this.forwardCall("getOntologyTermOccurences",t)}getScene(t){return this.forwardCall("getScene",t)}forwardCall(t,...e){return this.impl$.pipe(Qd(n=>n[t](...e)))}}return t.\u0275fac=function(e){return new(e||t)(Ci(SG),Ci(aq),Ci(fq))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),mq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),bq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:au,useValue:MG.initialize,multi:!0},MG]}),t})(),yq=(()=>{class t{constructor(t,e){this.accessor=t,this.injector=e}static forRoot(e=[]){return{ngModule:t,providers:[w$,_$,y$,...e]}}}return t.\u0275fac=function(e){return new(e||t)(Ci(w$,2),Ci(_$,2))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const vq=(t,e)=>((t,e)=>new Array(e+1).join("0"))(0,e-t.toString().length)+t;class _q{constructor(t,e,n){this.action=t,this.store=e,this.logWriter=n}dispatched(t){const e=VB(this.action),n=function(t){return vq(t.getHours(),2)+":"+vq(t.getMinutes(),2)+":"+vq(t.getSeconds(),2)+"."+vq(t.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${e} @ ${n}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",t)}completed(t){this.logWriter.logGreen("next state",t),this.logWriter.endGroup()}errored(t){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",t),this.logWriter.endGroup()}_hasPayload(t){return this._getNonEmptyProperties(t).length>0}_getNonEmptyProperties(t){return Object.keys(t).map(e=>t[e]).filter(t=>void 0!==t)}}class wq{constructor(t){this.options=t,this.options=this.options||{},this.logger=t.logger||console}startGroup(t){const e=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{e.call(this.logger,t)}catch(n){console.log(t)}}endGroup(){try{this.logger.groupEnd()}catch(t){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(t,e){this.log(t,"color: #9E9E9E; font-weight: bold",e)}logGreen(t,e){this.log(t,"color: #4CAF50; font-weight: bold",e)}logRedish(t,e){this.log(t,"color: #FD8182; font-weight: bold",e)}log(t,e,n){this.isIE()?this.logger.log(t,n):this.logger.log("%c "+t,e,n)}isIE(){const t="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let e=!1;const n=t.indexOf("MSIE "),i=t.indexOf("Trident/");return(n>-1||i>-1)&&(e=!0),e}}const xq=new oi("NGXS_LOGGER_PLUGIN_OPTIONS");let Sq=(()=>{class t{constructor(t,e){this._options=t,this._injector=e}handle(t,e,n){if(this._options.disabled||!this._options.filter(e,t))return n(t,e);this._logWriter=this._logWriter||new wq(this._options),this._store=this._store||this._injector.get(pV);const i=new _q(e,this._store,this._logWriter);return i.dispatched(t),n(t,e).pipe($f(t=>{i.completed(t)}),pv(t=>{throw i.errored(t),t}))}}return t.\u0275fac=function(e){return new(e||t)(Ci(xq),Ci(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Eq=new oi("LOGGER_USER_OPTIONS");function Cq(t){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},t)}let Oq=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[{provide:MB,useClass:Sq,multi:!0},{provide:Eq,useValue:e},{provide:xq,useFactory:Cq,deps:[Eq]}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Tq=new RegExp("[^#a-f\\d]","gi"),kq=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),Aq=["#FF8800","#2979ff","#ffd740","#b92dff","#da326f","#7323e2","#acf32b","#82B1FF","#E040FB","#00E5FF"].map((t,e)=>{const n=function(t,e={}){if("string"!=typeof t||Tq.test(t)||!kq.test(t))throw new TypeError("Expected a valid hex string");let n=1;8===(t=t.replace(/^#/,"")).length&&(n=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(n=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const i=Number.parseInt(t,16),r=i>>16,s=i>>8&255,o=255&i,a="number"==typeof e.alpha?e.alpha:n;return"array"===e.format?[r,s,o,a]:"css"===e.format?`rgb(${r} ${s} ${o}${1===a?"":` / ${Number((100*a).toFixed(2))}%`})`:{red:r,green:s,blue:o,alpha:a}}(t,{format:"array"});return n[3]=255,{color:t,rgba:n,rank:e}});let Pq=class extends z${constructor(){super(...arguments),this.forcedUnassignment=new P,this.forcedUnassignment$=this.forcedUnassignment.asObservable(),this.colorAssignments$=this.state$.pipe(FU("colorAssignments"),Rd()),this.colorAssignmentsList$=this.state$.pipe(FU("colorAssignmentsList"),Rd())}getColor(t){const{colorAssignments:e}=this.snapshot;return e[t]}assignColor(t,e=!1){let{colorAssignments:n,colorAssignmentsList:i,colorsAvailable:r}=this.snapshot;e&&(r=this.snapshot.colorPalette.concat(),i=[],n={});let s=n[t];return s||(r.length>0?s=r[0]:(s=i[i.length-1].color,i=i.slice(0,-1),this.forcedUnassignment.next()),r=r.filter(t=>t.color!==s.color),i=[{color:s,key:t}].concat(i),n=i.reduce((t,e,n)=>(t[e.key]=Object.assign(Object.assign({},e.color),{rank:n}),t),{}),this.ctx.patchState({colorsAvailable:r,colorAssignments:n,colorAssignmentsList:i})),s}unassignColor(t){let{colorAssignments:e,colorAssignmentsList:n,colorsAvailable:i}=this.snapshot;const r=e[t];r&&(i=[r].concat(i),n=n.filter(t=>t.color.color!==r.color),e=n.reduce((t,e,n)=>(t[e.key]=Object.assign(Object.assign({},e.color),{rank:n}),t),{}),this.ctx.patchState({colorsAvailable:i,colorAssignments:e,colorAssignmentsList:n}))}};function Iq(t,e){return n=>n.lift(new Mq(t,e))}Pq.\u0275fac=function(){let t;return function(e){return(t||(t=ei(Pq)))(e||Pq)}}(),Pq.\u0275prov=xt({token:Pq,factory:Pq.\u0275fac}),sw([L$(),ow(0,j$("key")),ow(1,j$("doReset"))],Pq.prototype,"assignColor",null),sw([L$(),ow(0,j$("key"))],Pq.prototype,"unassignColor",null),Pq=sw([F$(),wV({name:"colors",defaults:{colorPalette:Aq.concat(),colorsAvailable:Aq.concat(),colorAssignments:{},colorAssignmentsList:[]}})],Pq);class Mq{constructor(t,e){this.keySelector=t,this.flushes=e}call(t,e){return e.subscribe(new Dq(t,this.keySelector,this.flushes))}}class Dq extends ${constructor(t,e,n){super(t),this.keySelector=e,this.values=new Set,n&&this.add(G(n,new H(this)))}notifyNext(){this.values.clear()}notifyError(t){this._error(t)}_next(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)}_useKeySelector(t){let e;const{destination:n}=this;try{e=this.keySelector(t)}catch(i){return void n.error(i)}this._finalizeNext(e,t)}_finalizeNext(t,e){const{values:n}=this;n.has(t)||(n.add(t),this.destination.next(e))}}const Rq={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"]};var Nq=(()=>(function(t){t.Running="running",t.Completed="completed"}(Nq||(Nq={})),Nq))();function Lq(t){return()=>t.next(Nq.Completed)}function jq(t,e){return n=>n.pipe(Qd(t),$f(e),lq(1),Z())}let Fq=class extends V${constructor(t){super(),this.source=t,this._tissueBlockDataQueryStatus$=new lp(1),this._aggregateDataQueryStatus$=new lp(1),this._termOccurencesDataQueryStatus$=new lp(1),this._sceneDataQueryStatus$=new lp(1),this._technologyFilterQueryStatus$=new lp(1),this._providerFilterQueryStatus$=new lp(1),this.ontologyTermsFullData$=new lp(1),this.filter$=this.state$.pipe(FU("filter")),this.tissueBlockData$=this.filter$.pipe(jq(this.tissueBlockData,Lq(this._tissueBlockDataQueryStatus$))),this.aggregateData$=this.filter$.pipe(jq(this.aggregateData,Lq(this._aggregateDataQueryStatus$))),this.termOccurencesData$=this.filter$.pipe(jq(this.termOccurencesData,Lq(this._termOccurencesDataQueryStatus$))),this.sceneData$=this.filter$.pipe(jq(this.sceneData,Lq(this._sceneDataQueryStatus$))),this.technologyFilterData$=this.filter$.pipe(jq(this.technologyFilterData,Lq(this._technologyFilterQueryStatus$))),this.providerFilterData$=this.filter$.pipe(jq(this.providerFilterData,Lq(this._providerFilterQueryStatus$))),this.tissueBlockDataQueryStatus$=this._tissueBlockDataQueryStatus$.pipe(Iq()),this.aggregateDataQueryStatus$=this._aggregateDataQueryStatus$.pipe(Iq()),this.termOccurencesDataQueryStatus$=this._termOccurencesDataQueryStatus$.pipe(Iq()),this.sceneDataQueryStatus$=this._sceneDataQueryStatus$.pipe(Iq()),this.technologyFilterQueryStatus$=this._technologyFilterQueryStatus$.pipe(Iq()),this.providerFilterQueryStatus$=this._providerFilterQueryStatus$.pipe(Iq()),this.queryStatus$=T_([this.tissueBlockDataQueryStatus$,this.aggregateDataQueryStatus$,this.termOccurencesDataQueryStatus$,this.sceneDataQueryStatus$,this.technologyFilterQueryStatus$,this.providerFilterQueryStatus$]).pipe(D(t=>function(t){return t.every(t=>t===Nq.Completed)}(t)?Nq.Completed:Nq.Running),Iq()),this._tissueBlockDataQueryStatus$.next(Nq.Completed),this._aggregateDataQueryStatus$.next(Nq.Completed),this._termOccurencesDataQueryStatus$.next(Nq.Completed),this._sceneDataQueryStatus$.next(Nq.Completed),this._technologyFilterQueryStatus$.next(Nq.Completed),this._providerFilterQueryStatus$.next(Nq.Completed)}ngxsOnInit(){const{ontologyTermsFullData$:t,termOccurencesData$:e,source:n,snapshot:{filter:i}}=this;i===Rq?e.pipe(Gp(1)).subscribe(t):n.getOntologyTermOccurences().pipe(Gp(1)).subscribe(t)}updateFilter(t){this.patchState({filter:Object.assign(Object.assign({},this.getState().filter),t)})}tissueBlockData(t){return this._tissueBlockDataQueryStatus$.next(Nq.Running),this.source.getTissueBlockResults(t)}aggregateData(t){return this._aggregateDataQueryStatus$.next(Nq.Running),this.source.getAggregateResults(t)}termOccurencesData(t){return this._termOccurencesDataQueryStatus$.next(Nq.Running),this.source.getOntologyTermOccurences(t)}sceneData(t){return this._sceneDataQueryStatus$.next(Nq.Running),this.source.getScene(t)}technologyFilterData(){return this._technologyFilterQueryStatus$.next(Nq.Running),this.source.getDatasetTechnologyNames()}providerFilterData(){return this._providerFilterQueryStatus$.next(Nq.Running),this.source.getProviderNames()}};Fq.\u0275fac=function(t){return new(t||Fq)(Ci(mq))},Fq.\u0275prov=xt({token:Fq,factory:Fq.\u0275fac}),sw([L$(),ow(0,j$("filter"))],Fq.prototype,"updateFilter",null),sw([iB.ak],Fq.prototype,"tissueBlockData",null),sw([iB.ak],Fq.prototype,"aggregateData",null),sw([iB.ak],Fq.prototype,"termOccurencesData",null),sw([iB.ak],Fq.prototype,"sceneData",null),sw([iB.ak],Fq.prototype,"technologyFilterData",null),sw([iB.ak],Fq.prototype,"providerFilterData",null),Fq=sw([F$(),wV({name:"data",defaults:{filter:Rq}})],Fq);const Bq=[{name:"logo",namespace:"app",url:"assets/icons/app/hubmap-logo.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs_bladder.svg"},{name:"bone_marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs_brain.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs_heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs_kidney.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"large_intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs_liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs_lung.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lymph_nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small_intestine",namespace:"app",url:"assets/icons/organs/ico-organs_small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs_spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"vasculature",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"expand_more",namespace:"app",url:"assets/icons/expand_more-24px.svg"},{name:"expand_less",namespace:"app",url:"assets/icons/expand_less-24px.svg"},{name:"filter",url:"assets/icons/filter.svg"}];let Vq=class extends V${constructor(t,e){super(),this.registry=t;for(const{name:n,namespace:i,url:r,html:s}of Bq){const t={name:n,namespace:i,url:r&&e.bypassSecurityTrustResourceUrl(r),html:s&&e.bypassSecurityTrustHtml(s)};this.registerIconImpl(t)}}registerIcon(t){return this.registerIconImpl(t)}registerIconImpl(t){if(!this.registry||!t.url&&!t.html)return!1;const e=this.registry,n=e[this.getMethodName(t)],i=this.getArguments(t);if(!n)return!1;try{return n.apply(e,i),!0}catch(r){return!1}}getMethodName({name:t,namespace:e,url:n}){const i=["addSvgIcon"];return t||i.push("Set"),n||i.push("Literal"),e&&i.push("InNamespace"),i.join("")}getArguments({name:t,namespace:e,url:n,html:i}){return[e,t,null!=n?n:i].filter(t=>!!t)}};Vq.\u0275fac=function(t){return new(t||Vq)(Ci(r_,8),Ci(hd))},Vq.\u0275prov=xt({token:Vq,factory:Vq.\u0275fac}),sw([L$()],Vq.prototype,"registerIcon",null),Vq=sw([F$(),wV({name:"iconRegistry"})],Vq);let zq=class extends z${constructor(t,e){super(),this.dataService=t,this.injector=e,this.listResults$=this.state$.pipe(FU("listResults"),Rd()),this.highlightedNodeId$=this.state$.pipe(FU("highlightedNodeId"),Rd())}setListResults(t){this.ctx.patchState({listResults:t})}selectListResult(t){this.colorAssignments.assignColor(t.tissueBlock.spatialEntityId)}deselectListResult(t){this.colorAssignments.unassignColor(t.tissueBlock.spatialEntityId)}highlightNode(t){this.ctx.patchState({highlightedNodeId:t})}unHighlightNode(){this.ctx.patchState({highlightedNodeId:void 0})}ngxsOnInit(){super.ngxsOnInit(),this.dataState=this.injector.get(Fq),this.colorAssignments=this.injector.get(Pq),T_([this.dataState.tissueBlockData$,this.colorAssignments.colorAssignments$]).pipe(D(([t,e])=>{const n=[],i=[];for(const r of t){const t=e[r.spatialEntityId];t?n.push({selected:!0,color:t.color,tissueBlock:r,rank:t.rank}):i.push({selected:!1,tissueBlock:r})}return(0,KG.sortBy)(n,["rank"]).concat(i)}),$f(t=>this.setListResults(t))).subscribe()}};function Uq(t,e,n){e[n.id]=n,(0,KG.forEach)(n.children,n=>Uq(t,e,t[n]))}function Hq(t,e){const n={"@id":t.root,"@type":"OntologyTreeNode",id:t.root,label:"body",parent:"",children:e,synonymLabels:[]},i=(0,KG.at)(t.nodes,e),r={[n.id]:n};return(0,KG.forEach)(i,t=>t.parent=n.id),(0,KG.forEach)(i,e=>Uq(t.nodes,r,e)),{root:n.id,nodes:r}}zq.\u0275fac=function(t){return new(t||zq)(Ci(mq),Ci(No))},zq.\u0275prov=xt({token:zq,factory:zq.\u0275fac}),sw([L$(),ow(0,j$("listResults"))],zq.prototype,"setListResults",null),zq=sw([F$(),wV({name:"listResults",defaults:{listResults:[]}})],zq);let $q=class extends z${constructor(t){super(),this.dataService=t,this.nodes$=this.state$.pipe(D(t=>Object.values(t.nodes))),this.rootNode$=this.state$.pipe(D(t=>t.nodes[t.root]))}setOntology(t){this.ctx.setState(t)}ngxsOnInit(){super.ngxsOnInit(),this.loadOntology()}loadOntology(){hv([this.dataService.getOntologyTreeModel().pipe(Gp(1)),this.dataService.getReferenceOrgans().pipe(Gp(1))]).subscribe(([t,e])=>{const n=RG.organNodes.concat(),i=(0,KG.partial)(Hq,KG.partial.placeholder,n)(t);this.setOntology(i)})}};$q.\u0275fac=function(t){return new(t||$q)(Ci(mq))},$q.\u0275prov=xt({token:$q,factory:$q.\u0275fac}),sw([L$()],$q.prototype,"setOntology",null),$q=sw([F$(),wV({name:"ontology",defaults:{root:"",nodes:{}}})],$q);const Gq=new Set(["Skin","Heart","Kidney","Spleen"]);let Wq=class extends z${constructor(t,e){super(),this.dataService=t,this.injector=e,this.referenceOrgans$=this.state$.pipe(FU("referenceOrgans"),Rd()),this.selectedReferenceOrgans$=this.state$.pipe(FU("selectedReferenceOrgans"),Rd()),this.scene$=this.state$.pipe(FU("scene"),Rd()),this.highlightedId$=this.state$.pipe(FU("highlightedId"),Rd())}setSelectedReferenceOrgans(t){this.ctx.patchState({selectedReferenceOrgans:t})}setReferenceOrgans(t){this.ctx.patchState({referenceOrgans:t})}setScene(t){this.ctx.patchState({scene:t})}sceneNodeClicked({node:t,ctrlClick:e}){t.representation_of&&"http://purl.org/ccf/latest/ccf.owl#VHFSkin"!==t["@id"]&&t.entityId?this.dataState.updateFilter({ontologyTerms:[t.representation_of]}):t.entityId&&this.colorAssignments.assignColor(t["@id"],!e)}sceneNodeHovered(t){this.listResults.highlightNode(t["@id"])}sceneNodeUnhover(){this.listResults.unHighlightNode()}ngxsOnInit(){super.ngxsOnInit(),this.dataState=this.injector.get(Fq),this.colorAssignments=this.injector.get(Pq),this.listResults=this.injector.get(zq),this.dataService.getReferenceOrgans().pipe(D(t=>{const e=new Set(t.map(t=>t.representation_of));return cG.filter(t=>e.has(t.id)).map(t=>Object.assign(Object.assign({},t),{disabled:!1,numResults:0}))}),Gp(1),$f(t=>{this.setReferenceOrgans(t),this.setSelectedReferenceOrgans(t.filter(t=>Gq.has(t.organ)))})).subscribe(),T_([this.dataState.sceneData$,this.selectedReferenceOrgans$,this.colorAssignments.colorAssignments$,this.dataService.getReferenceOrgans(),this.listResults.highlightedNodeId$]).pipe(D(([t,e,n,i,r])=>{const s=new Set(e.map(t=>t.id)),o=new Set(i.filter(t=>s.has(t.representation_of)).map(t=>t["@id"]));return t.filter(t=>{var e,n;return(null===(n=null===(e=t.ccf_annotations)||void 0===e?void 0:e.some)||void 0===n?void 0:n.call(e,t=>s.has(t)))||t.reference_organ&&o.has(t.reference_organ)}).map(t=>t.entityId&&(Object.prototype.hasOwnProperty.call(n,t["@id"])||r===t["@id"])?Object.assign(Object.assign({},t),{color:r===t["@id"]?[30,136,229,255]:n[t["@id"]].rgba}):t)}),$f(t=>this.setScene(t))).subscribe()}};Wq.\u0275fac=function(t){return new(t||Wq)(Ci(mq),Ci(No))},Wq.\u0275prov=xt({token:Wq,factory:Wq.\u0275fac}),sw([L$(),ow(0,j$("selectedReferenceOrgans"))],Wq.prototype,"setSelectedReferenceOrgans",null),sw([L$(),ow(0,j$("referenceOrgans"))],Wq.prototype,"setReferenceOrgans",null),sw([L$(),ow(0,j$("scene"))],Wq.prototype,"setScene",null),Wq=sw([F$(),wV({name:"scene",defaults:{scene:[],referenceOrgans:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],Wq);const qq=[SG,Pq,Vq,zq,Fq,$q,Wq];let Xq=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[yq.forRoot(),_V.forRoot(qq,{developmentMode:!RG.production}),Oq.forRoot({disabled:RG.production})]]}),t})(),Yq=(()=>{class t{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return t.\u0275fac=function(e){return new(e||t)(Ci(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:mq,useExisting:gq}],imports:[[Zv,tG.forRoot({gaToken:RG.googleAnalyticsToken,appName:"eui"}),EG,zG,Xq,bq],zG]}),t})();const Kq=["input"],Qq=function(t){return{enterDuration:t}},Zq=["*"],Jq=new oi("mat-checkbox-default-options",{providedIn:"root",factory:tX});function tX(){return{color:"accent",clickAction:"check-indeterminate"}}let eX=0;const nX=tX(),iX={provide:EV,useExisting:pt(()=>oX),multi:!0};class rX{}const sX=By(jy(Fy(Ly(class{constructor(t){this._elementRef=t}}))));let oX=(()=>{class t extends sX{constructor(t,e,n,i,r,s,o){super(t),this._changeDetectorRef=e,this._focusMonitor=n,this._ngZone=i,this._animationMode=s,this._options=o,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++eX,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Rc,this.indeterminateChange=new Rc,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||nX,this.color=this.defaultColor=this._options.color||nX.color,this.tabIndex=parseInt(r)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=md(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t||Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}ngAfterViewChecked(){}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}get checked(){return this._checked}set checked(t){t!=this.checked&&(this._checked=t,this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){const e=md(t);e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const e=t!=this._indeterminate;this._indeterminate=md(t),e&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(t){this.checked=!!t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_getAriaChecked(){return this.checked?"true":this.indeterminate?"mixed":"false"}_transitionCheckState(t){let e=this._currentCheckState,n=this._elementRef.nativeElement;if(e!==t&&(this._currentAnimationClass.length>0&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(e,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);const t=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{n.classList.remove(t)},1e3)})}}_emitChangeEvent(){const t=new rX;t.source=this,t.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(t),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked}_onInputClick(t){var e;const n=null===(e=this._options)||void 0===e?void 0:e.clickAction;t.stopPropagation(),this.disabled||"noop"===n?!this.disabled&&"noop"===n&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==n&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,e){t?this._focusMonitor.focusVia(this._inputElement,t,e):this._inputElement.nativeElement.focus(e)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,e){if("NoopAnimations"===this._animationMode)return"";let n="";switch(t){case 0:if(1===e)n="unchecked-checked";else{if(3!=e)return"";n="unchecked-indeterminate"}break;case 2:n=1===e?"unchecked-checked":"unchecked-indeterminate";break;case 1:n=2===e?"checked-unchecked":"checked-indeterminate";break;case 3:n=1===e?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${n}`}_syncIndeterminate(t){const e=this._inputElement;e&&(e.nativeElement.indeterminate=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(tc),ea(Ig),ea(xu),ii("tabindex"),ea(Ey,8),ea(Jq,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-checkbox"]],viewQuery:function(t,e){if(1&t&&(qc(Kq,5),qc(Yy,5)),2&t){let t;Wc(t=Yc())&&(e._inputElement=t.first),Wc(t=Yc())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,e){2&t&&(il("id",e.id),Ko("tabindex",null),ja("mat-checkbox-indeterminate",e.indeterminate)("mat-checkbox-checked",e.checked)("mat-checkbox-disabled",e.disabled)("mat-checkbox-label-before","before"==e.labelPosition)("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[_l([iX]),jo],ngContentSelectors:Zq,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(t,e){if(1&t&&(wa(),ra(0,"label",0,1),ra(2,"span",2),ra(3,"input",3,4),fa("change",function(t){return e._onInteractionEvent(t)})("click",function(t){return e._onInputClick(t)}),sa(),ra(5,"span",5),oa(6,"span",6),sa(),oa(7,"span",7),ra(8,"span",8),vn(),ra(9,"svg",9),oa(10,"path",10),sa(),Ve.lFrame.currentNamespace=null,oa(11,"span",11),sa(),sa(),ra(12,"span",12,13),fa("cdkObserveContent",function(){return e._onLabelTextChange()}),ra(14,"span",14),Za(15,"\xa0"),sa(),xa(16),sa(),sa()),2&t){const t=ta(1),n=ta(13);Ko("for",e.inputId),ws(2),ja("mat-checkbox-inner-container-no-side-margin",!n.textContent||!n.textContent.trim()),ws(1),na("id",e.inputId)("required",e.required)("checked",e.checked)("disabled",e.disabled)("tabIndex",e.tabIndex),Ko("value",e.value)("name",e.name)("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby)("aria-checked",e._getAriaChecked())("aria-describedby",e.ariaDescribedby),ws(2),na("matRippleTrigger",t)("matRippleDisabled",e._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Tc(19,Qq,"NoopAnimations"===e._animationMode?0:150))}},directives:[Yy,ng],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),t})(),aX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),lX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ky,Ny,ig,aX],Ny,aX]}),t})(),cX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,lX]]}),t})();const uX=["trigger"],hX=["panel"];function dX(t,e){if(1&t&&(ra(0,"span",8),Za(1),sa()),2&t){const t=va();ws(1),Ja(t.placeholder)}}function pX(t,e){if(1&t&&(ra(0,"span",12),Za(1),sa()),2&t){const t=va(2);ws(1),Ja(t.triggerValue)}}function fX(t,e){1&t&&xa(0,0,["*ngSwitchCase","true"])}function gX(t,e){1&t&&(ra(0,"span",9),Jo(1,pX,2,1,"span",10),Jo(2,fX,1,0,"ng-content",11),sa()),2&t&&(na("ngSwitch",!!va().customTrigger),ws(2),na("ngSwitchCase",!0))}function mX(t,e){if(1&t){const t=ua();ra(0,"div",13),ra(1,"div",14,15),fa("@transformPanel.done",function(e){return $e(t),va()._panelDoneAnimatingStream.next(e.toState)})("keydown",function(e){return $e(t),va()._handleKeydown(e)}),xa(3,1),sa(),sa()}if(2&t){const t=va();na("@transformPanelWrap",void 0),ws(1),nl("mat-select-panel ",t._getPanelTheme(),""),La("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),na("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),Ko("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const bX=[[["mat-select-trigger"]],"*"],yX=["mat-select-trigger","*"],vX={transformPanelWrap:Vg("transformPanelWrap",[Wg("* => void",Xg("@transformPanel",[qg()],{optional:!0}))]),transformPanel:Vg("transformPanel",[$g("void",Hg({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),$g("showing",Hg({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),$g("showing-multiple",Hg({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Wg("void => *",zg("120ms cubic-bezier(0, 0, 0.2, 1)")),Wg("* => void",zg("100ms 25ms linear",Hg({opacity:0})))])};let _X=0;const wX=new oi("mat-select-scroll-strategy"),xX=new oi("MAT_SELECT_CONFIG"),SX={provide:wX,deps:[kf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};class EX{constructor(t,e){this.source=t,this.value=e}}const CX=Fy(By(Ly(Vy(class{constructor(t,e,n,i,r){this._elementRef=t,this._defaultErrorStateMatcher=e,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}})))),OX=new oi("MatSelectTrigger");let TX=(()=>{class t extends CX{constructor(t,e,n,i,r,s,o,a,l,c,u,h,d,p){var f,g,m;super(r,i,o,a,c),this._viewportRuler=t,this._changeDetectorRef=e,this._ngZone=n,this._dir=s,this._parentFormField=l,this._liveAnnouncer=d,this._defaultOptions=p,this._panelOpen=!1,this._compareWith=(t,e)=>t===e,this._uid="mat-select-"+_X++,this._triggerAriaLabelledBy=null,this._destroy=new P,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+_X++,this._panelDoneAnimatingStream=new P,this._overlayPanelClass=(null===(f=this._defaultOptions)||void 0===f?void 0:f.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(m=null===(g=this._defaultOptions)||void 0===g?void 0:g.disableOptionCentering)&&void 0!==m&&m,this.ariaLabel="",this.optionSelectionChanges=Iz(()=>{const t=this.options;return t?t.changes.pipe(Kd(t),Qd(()=>Q(...t.map(t=>t.onSelectionChange)))):this._ngZone.onStable.pipe(Gp(1),Qd(()=>this.optionSelectionChanges))}),this.openedChange=new Rc,this._openedStream=this.openedChange.pipe(Hd(t=>t),D(()=>{})),this._closedStream=this.openedChange.pipe(Hd(t=>!t),D(()=>{})),this.selectionChange=new Rc,this.valueChange=new Rc,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==p?void 0:p.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=p.typeaheadDebounceInterval),this._scrollStrategyFactory=h,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(u)||0,this.id=this.id}get focused(){return this._focused||this._panelOpen}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get required(){return this._required}set required(t){this._required=md(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=md(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=md(t)}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){(t!==this._value||this._multiple&&Array.isArray(t))&&(this.options&&this._setSelectionByValue(t),this._value=t)}get typeaheadDebounceInterval(){return this._typeaheadDebounceInterval}set typeaheadDebounceInterval(t){this._typeaheadDebounceInterval=bd(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new kp(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Rd(),Wd(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(Wd(this._destroy)).subscribe(t=>{t.added.forEach(t=>t.select()),t.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(Kd(null),Wd(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const e=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?e.setAttribute("aria-labelledby",t):e.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}ngOnChanges(t){t.disabled&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}ngOnDestroy(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}writeValue(t){this.value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){const t=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}_isRtl(){return!!this._dir&&"rtl"===this._dir.value}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){const e=t.keyCode,n=40===e||38===e||37===e||39===e,i=13===e||32===e,r=this._keyManager;if(!r.isTyping()&&i&&!Qp(t)||(this.multiple||t.altKey)&&n)t.preventDefault(),this.open();else if(!this.multiple){const e=this.selected;r.onKeydown(t);const n=this.selected;n&&e!==n&&this._liveAnnouncer.announce(n.viewValue,1e4)}}_handleOpenKeydown(t){const e=this._keyManager,n=t.keyCode,i=40===n||38===n,r=e.isTyping();if(i&&t.altKey)t.preventDefault(),this.close();else if(r||13!==n&&32!==n||!e.activeItem||Qp(t))if(!r&&this._multiple&&65===n&&t.ctrlKey){t.preventDefault();const e=this.options.some(t=>!t.disabled&&!t.selected);this.options.forEach(t=>{t.disabled||(e?t.select():t.deselect())})}else{const n=e.activeItemIndex;e.onKeydown(t),this._multiple&&i&&t.shiftKey&&e.activeItem&&e.activeItemIndex!==n&&e.activeItem._selectViaInteraction()}else t.preventDefault(),e.activeItem._selectViaInteraction()}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(Gp(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this._selectionModel.selected.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(t=>this._selectValue(t)),this._sortValues();else{const e=this._selectValue(t);e?this._keyManager.updateActiveItem(e):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const e=this.options.find(e=>{if(this._selectionModel.isSelected(e))return!1;try{return null!=e.value&&this._compareWith(e.value,t)}catch(n){return!1}});return e&&this._selectionModel.select(e),e}_initKeyManager(){this._keyManager=new fg(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(Wd(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(Wd(this._destroy)).subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){const t=Q(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Wd(t)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Q(...this.options.map(t=>t._stateChanges)).pipe(Wd(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,e){const n=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(n!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),e&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),e&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),n!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((e,n)=>this.sortComparator?this.sortComparator(e,n,t):t.indexOf(e)-t.indexOf(n)),this.stateChanges.next()}}_propagateChanges(t){let e=null;e=this.multiple?this.selected.map(t=>t.value):this.selected?this.selected.value:t,this._value=e,this.valueChange.emit(e),this._onChange(e),this.selectionChange.emit(this._getChangeEvent(e)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}_canOpen(){var t;return!this._panelOpen&&!this.disabled&&(null===(t=this.options)||void 0===t?void 0:t.length)>0}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){var t;if(this.ariaLabel)return null;const e=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(e?e+" ":"")+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const e=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let n=(e?e+" ":"")+this._valueId;return this.ariaLabelledby&&(n+=" "+this.ariaLabelledby),n}_panelDoneAnimating(t){this.openedChange.emit(t)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}return t.\u0275fac=function(e){return new(e||t)(ea(Ip),ea(tc),ea(xu),ea(zy),ea(kl),ea(Op,8),ea(_z,8),ea(Tz,8),ea(aU,8),ea(WV,10),ii("tabindex"),ea(wX),ea(kg),ea(xX,8))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(qc(uX,5),qc(hX,5),qc(Mf,5)),2&t){let t;Wc(t=Yc())&&(e.trigger=t.first),Wc(t=Yc())&&(e.panel=t.first),Wc(t=Yc())&&(e._overlayDir=t.first)}},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[jo,ye]}),t})(),kX=(()=>{class t extends TX{constructor(){super(...arguments),this._scrollTop=0,this._triggerFontSize=0,this._transformOrigin="top",this._offsetY=0,this._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}]}_calculateOverlayScroll(t,e,n){const i=this._getItemHeight();return Math.min(Math.max(0,i*t-e+i/2),n)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(Wd(this._destroy)).subscribe(()=>{this.panelOpen&&(this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._changeDetectorRef.markForCheck())})}open(){super._canOpen()&&(super.open(),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(Gp(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const e=lv(t,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===e?0:cv((t+e)*n,n,this.panel.nativeElement.scrollTop,256)}_positioningSettled(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}_panelDoneAnimating(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),super._panelDoneAnimating(t)}_getChangeEvent(t){return new EX(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),e=this._viewportRuler.getViewportSize(),n=this._isRtl(),i=this.multiple?56:32;let r;if(this.multiple)r=40;else if(this.disableOptionCentering)r=16;else{let t=this._selectionModel.selected[0]||this.options.first;r=t&&t.group?32:16}n||(r*=-1);const s=0-(t.left+r-(n?i:0)),o=t.right+r-e.width+(n?0:i);s>0?r+=s+8:o>0&&(r-=o+8),this._overlayDir.offsetX=Math.round(r),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,e,n){const i=this._getItemHeight(),r=(i-this._triggerRect.height)/2,s=Math.floor(256/i);let o;return this.disableOptionCentering?0:(o=0===this._scrollTop?t*i:this._scrollTop===n?(t-(this._getItemCount()-s))*i+(i-(this._getItemCount()*i-256)%i):e-i/2,Math.round(-1*o-r))}_checkOverlayWithinViewport(t){const e=this._getItemHeight(),n=this._viewportRuler.getViewportSize(),i=this._triggerRect.top-8,r=n.height-this._triggerRect.bottom-8,s=Math.abs(this._offsetY),o=Math.min(this._getItemCount()*e,256)-s-this._triggerRect.height;o>r?this._adjustPanelUp(o,r):s>i?this._adjustPanelDown(s,i,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,e){const n=Math.round(t-e);this._scrollTop-=n,this._offsetY-=n,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,e,n){const i=Math.round(t-e);if(this._scrollTop+=i,this._offsetY+=i,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=n)return this._scrollTop=n,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),e=this._getItemCount(),n=Math.min(e*t,256),i=e*t-n;let r;r=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),r+=lv(r,this.options,this.optionGroups);const s=n/2;this._scrollTop=this._calculateOverlayScroll(r,s,i),this._offsetY=this._calculateOverlayOffsetY(r,s,i),this._checkOverlayWithinViewport(i)}_getOriginBasedOnOption(){const t=this._getItemHeight(),e=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-e+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-select"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,OX,5),Xc(n,av,5),Xc(n,iv,5)),2&t){let t;Wc(t=Yc())&&(e.customTrigger=t.first),Wc(t=Yc())&&(e.options=t),Wc(t=Yc())&&(e.optionGroups=t)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,e){1&t&&fa("keydown",function(t){return e._handleKeydown(t)})("focus",function(){return e._onFocus()})("blur",function(){return e._onBlur()}),2&t&&(Ko("id",e.id)("tabindex",e.tabIndex)("aria-controls",e.panelOpen?e.id+"-panel":null)("aria-expanded",e.panelOpen)("aria-label",e.ariaLabel||null)("aria-required",e.required.toString())("aria-disabled",e.disabled.toString())("aria-invalid",e.errorState)("aria-describedby",e._ariaDescribedby||null)("aria-activedescendant",e._getAriaActiveDescendant()),ja("mat-select-disabled",e.disabled)("mat-select-invalid",e.errorState)("mat-select-required",e.required)("mat-select-empty",e.empty)("mat-select-multiple",e.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[_l([{provide:Qz,useExisting:t},{provide:Jy,useExisting:t}]),jo],ngContentSelectors:yX,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(t,e){if(1&t&&(wa(bX),ra(0,"div",0,1),fa("click",function(){return e.toggle()}),ra(3,"div",2),Jo(4,dX,2,1,"span",3),Jo(5,gX,3,2,"span",4),sa(),ra(6,"div",5),oa(7,"div",6),sa(),sa(),Jo(8,mX,4,14,"ng-template",7),fa("backdropClick",function(){return e.close()})("attach",function(){return e._onAttached()})("detach",function(){return e.close()})),2&t){const t=ta(1);Ko("aria-owns",e.panelOpen?e.id+"-panel":null),ws(3),na("ngSwitch",e.empty),Ko("id",e._valueId),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1),ws(3),na("cdkConnectedOverlayPanelClass",e._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",e._scrollStrategy)("cdkConnectedOverlayOrigin",t)("cdkConnectedOverlayOpen",e.panelOpen)("cdkConnectedOverlayPositions",e._positions)("cdkConnectedOverlayMinWidth",null==e._triggerRect?null:e._triggerRect.width)("cdkConnectedOverlayOffsetY",e._offsetY)}},directives:[If,Eh,Ch,Mf,Oh,mh],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[vX.transformPanelWrap,vX.transformPanel]},changeDetection:0}),t})(),AX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[SX],imports:[[Rh,Rf,uv,Ny],Mp,cU,uv,Ny]}),t})(),PX=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,cU,AX]]}),t})();var IX=n(25430),MX=n(39053),DX=n(26202);const RX=["tooltipTemplate"],NX=["leftOuterSelectionBar"],LX=["rightOuterSelectionBar"],jX=["fullBar"],FX=["selectionBar"],BX=["minHandle"],VX=["maxHandle"],zX=["floorLabel"],UX=["ceilLabel"],HX=["minHandleLabel"],$X=["maxHandleLabel"],GX=["combinedLabel"],WX=["ticksElement"];function qX(t,e){if(1&t&&oa(0,"ng5-slider-tooltip-wrapper",31),2&t){const t=va().$implicit;na("template",va().tooltipTemplate)("tooltip",t.valueTooltip)("placement",t.valueTooltipPlacement)("content",t.value)}}function XX(t,e){1&t&&oa(0,"span",32),2&t&&na("innerHTML",va().$implicit.legend,vr)}const YX=function(t){return{"ng5-slider-selected":t}};function KX(t,e){if(1&t&&(ra(0,"span",27),oa(1,"ng5-slider-tooltip-wrapper",28),Jo(2,qX,1,4,"ng5-slider-tooltip-wrapper",29),Jo(3,XX,1,1,"span",30),sa()),2&t){const t=e.$implicit,n=va();na("ngClass",Tc(7,YX,t.selected))("ngStyle",t.style),ws(1),na("template",n.tooltipTemplate)("tooltip",t.tooltip)("placement",t.tooltipPlacement),ws(1),na("ngIf",null!=t.value),ws(1),na("ngIf",null!=t.legend)}}function QX(t,e){}function ZX(t,e){1&t&&Jo(0,QX,0,0,"ng-template")}const JX=function(t,e,n){return{tooltip:t,placement:e,content:n}};function tY(t,e){if(1&t&&(aa(0),Jo(1,ZX,1,0,void 0,1),la()),2&t){const t=va();ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",kc(2,JX,t.tooltip,t.placement,t.content))}}function eY(t,e){if(1&t&&(aa(0),ra(1,"div",2),Za(2),sa(),la()),2&t){const t=va();ws(1),Ko("title",t.tooltip)("data-tooltip-placement",t.placement),ws(1),tl(" ",t.content," ")}}const nY={Min:0,Max:1};nY[nY.Min]="Min",nY[nY.Max]="Max";const iY={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};iY[iY.Low]="Low",iY[iY.High]="High",iY[iY.Floor]="Floor",iY[iY.Ceil]="Ceil",iY[iY.TickValue]="TickValue";class rY{constructor(){this.floor=0,this.ceil=null,this.step=1,this.minRange=null,this.maxRange=null,this.pushRange=!1,this.minLimit=null,this.maxLimit=null,this.translate=null,this.combineLabels=null,this.getLegend=null,this.stepsArray=null,this.bindIndexForStepsArray=!1,this.draggableRange=!1,this.draggableRangeOnly=!1,this.showSelectionBar=!1,this.showSelectionBarEnd=!1,this.showSelectionBarFromValue=null,this.showOuterSelectionBars=!1,this.hidePointerLabels=!1,this.hideLimitLabels=!1,this.autoHideLimitLabels=!0,this.readOnly=!1,this.disabled=!1,this.mouseEventsInterval=50,this.touchEventsInterval=50,this.inputEventsInterval=100,this.outputEventsInterval=100,this.showTicks=!1,this.showTicksValues=!1,this.tickStep=null,this.tickValueStep=1,this.ticksArray=null,this.ticksTooltip=null,this.ticksValuesTooltip=null,this.vertical=!1,this.getSelectionBarColor=null,this.getTickColor=null,this.getPointerColor=null,this.keyboardSupport=!0,this.scale=1,this.enforceStep=!0,this.enforceRange=!0,this.noSwitching=!1,this.onlyBindHandles=!1,this.rightToLeft=!1,this.reversedControls=!1,this.boundPointerLabels=!0,this.logScale=!1,this.customValueToPosition=null,this.customPositionToValue=null,this.precisionLimit=12,this.selectionBarGradient=null,this.ariaLabel=null,this.ariaLabelledBy=null,this.ariaLabelHigh=null,this.ariaLabelledByHigh=null,this.handleDimension=null,this.barDimension=null,this.animate=!0}}class sY{}class oY{static isNullOrUndefined(t){return null==t}static linearValueToPosition(t,e,n){return(t-e)/(n-e)}static logValueToPosition(t,e,n){return((t=Math.log(t))-(e=Math.log(e)))/((n=Math.log(n))-e)}static linearPositionToValue(t,e,n){return t*(n-e)+e}static logPositionToValue(t,e,n){return e=Math.log(e),n=Math.log(n),Math.exp(t*(n-e)+e)}static findStepIndex(t,e){const n=e.map(e=>Math.abs(t-e.value));let i=0;for(let r=0;r{r.events.next(t)};return t.addEventListener(e,s,{passive:!0,capture:!1}),r.teardownCallback=()=>{t.removeEventListener(e,s,{passive:!0,capture:!1})},r.eventsSubscription=r.events.pipe(oY.isNullOrUndefined(i)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}detachEventListener(t){oY.isNullOrUndefined(t.eventsSubscription)||(t.eventsSubscription.unsubscribe(),t.eventsSubscription=null),oY.isNullOrUndefined(t.events)||(t.events.complete(),t.events=null),oY.isNullOrUndefined(t.teardownCallback)||(t.teardownCallback(),t.teardownCallback=null)}attachEventListener(t,e,n,i){const r=new cY;return r.eventName=e,r.events=new IX.xQ,r.teardownCallback=this.renderer.listen(t,e,t=>{r.events.next(t)}),r.eventsSubscription=r.events.pipe(oY.isNullOrUndefined(i)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}}let hY=(()=>{class t{constructor(t,e,n){this.elemRef=t,this.renderer=e,this.changeDetectionRef=n,this._position=0,this._dimension=0,this._alwaysHide=!1,this._vertical=!1,this._scale=1,this.opacity=1,this.visibility="visible",this.left="",this.bottom="",this.height="",this.width="",this.eventListeners=[],this.eventListenerHelper=new uY(this.renderer)}get position(){return this._position}get dimension(){return this._dimension}get alwaysHide(){return this._alwaysHide}get vertical(){return this._vertical}get scale(){return this._scale}setAlwaysHide(t){this._alwaysHide=t,this.visibility=t?"hidden":"visible"}hide(){this.opacity=0}show(){this.alwaysHide||(this.opacity=1)}isVisible(){return!this.alwaysHide&&0!==this.opacity}setVertical(t){this._vertical=t,this._vertical?(this.left="",this.width=""):(this.bottom="",this.height="")}setScale(t){this._scale=t}setPosition(t){this._position!==t&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._position=t,this._vertical?this.bottom=Math.round(t)+"px":this.left=Math.round(t)+"px"}calculateDimension(){const t=this.getBoundingClientRect();this._dimension=this.vertical?(t.bottom-t.top)*this.scale:(t.right-t.left)*this.scale}setDimension(t){this._dimension!==t&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._dimension=t,this._vertical?this.height=Math.round(t)+"px":this.width=Math.round(t)+"px"}getBoundingClientRect(){return this.elemRef.nativeElement.getBoundingClientRect()}on(t,e,n){const i=this.eventListenerHelper.attachEventListener(this.elemRef.nativeElement,t,e,n);this.eventListeners.push(i)}onPassive(t,e,n){const i=this.eventListenerHelper.attachPassiveEventListener(this.elemRef.nativeElement,t,e,n);this.eventListeners.push(i)}off(t){let e,n;oY.isNullOrUndefined(t)?(e=[],n=this.eventListeners):(e=this.eventListeners.filter(e=>e.eventName!==t),n=this.eventListeners.filter(e=>e.eventName===t));for(const i of n)this.eventListenerHelper.detachEventListener(i);this.eventListeners=e}isRefDestroyed(){return oY.isNullOrUndefined(this.changeDetectionRef)||this.changeDetectionRef.destroyed}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderElement",""]],hostVars:12,hostBindings:function(t,e){2&t&&La("opacity",e.opacity)("visibility",e.visibility)("left",e.left)("bottom",e.bottom)("height",e.height)("width",e.width)}}),t})(),dY=(()=>{class t extends hY{constructor(t,e,n){super(t,e,n),this.active=!1,this.role="",this.tabindex="",this.ariaOrientation="",this.ariaLabel="",this.ariaLabelledBy="",this.ariaValueNow="",this.ariaValueText="",this.ariaValueMin="",this.ariaValueMax=""}focus(){this.elemRef.nativeElement.focus()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderHandle",""]],hostVars:11,hostBindings:function(t,e){2&t&&(Ko("role",e.role)("tabindex",e.tabindex)("aria-orientation",e.ariaOrientation)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledBy)("aria-valuenow",e.ariaValueNow)("aria-valuetext",e.ariaValueText)("aria-valuemin",e.ariaValueMin)("aria-valuemax",e.ariaValueMax),ja("ng5-slider-active",e.active))},features:[jo]}),t})(),pY=(()=>{class t extends hY{constructor(t,e,n){super(t,e,n),this._value=null}get value(){return this._value}setValue(t){let e=!1;!this.alwaysHide&&(oY.isNullOrUndefined(this.value)||this.value.length!==t.length||this.value.length>0&&0===this.dimension)&&(e=!0),this._value=t,this.elemRef.nativeElement.innerHTML=t,e&&this.calculateDimension()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(Il),ea(tc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderLabel",""]],features:[jo]}),t})();class fY{constructor(){this.selected=!1,this.style={},this.tooltip=null,this.tooltipPlacement=null,this.value=null,this.valueTooltip=null,this.valueTooltipPlacement=null,this.legend=null}}class gY{constructor(){this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0}}class mY{static compare(t,e){return!(oY.isNullOrUndefined(t)&&oY.isNullOrUndefined(e)||oY.isNullOrUndefined(t)!==oY.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue}}class bY extends mY{static compare(t,e){return!(oY.isNullOrUndefined(t)&&oY.isNullOrUndefined(e)||oY.isNullOrUndefined(t)!==oY.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue&&t.forceChange===e.forceChange}}const yY={provide:EV,useExisting:pt(()=>vY),multi:!0};let vY=(()=>{class t{constructor(t,e,n,i){this.renderer=t,this.elementRef=e,this.changeDetectionRef=n,this.zone=i,this.value=null,this.valueChange=new Rc,this.highValue=null,this.highValueChange=new Rc,this.options=new rY,this.userChangeStart=new Rc,this.userChange=new Rc,this.userChangeEnd=new Rc,this.initHasRun=!1,this.inputModelChangeSubject=new IX.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new IX.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new rY,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new gY,this.sliderElementVerticalClass=!1,this.sliderElementAnimateClass=!1,this.sliderElementDisabledAttr=null,this.barStyle={},this.minPointerStyle={},this.maxPointerStyle={},this.fullBarTransparentClass=!1,this.selectionBarDraggableClass=!1,this.ticksUnderValuesClass=!1,this.intermediateTicks=!1,this.ticks=[],this.eventListenerHelper=null,this.onMoveEventListener=null,this.onEndEventListener=null,this.resizeObserver=null,this.onTouchedCallback=null,this.onChangeCallback=null,this.eventListenerHelper=new uY(this.renderer)}set manualRefresh(t){this.unsubscribeManualRefresh(),this.manualRefreshSubscription=t.subscribe(()=>{setTimeout(()=>this.calculateViewDimensionsAndDetectChanges())})}set triggerFocus(t){this.unsubscribeTriggerFocus(),this.triggerFocusSubscription=t.subscribe(t=>{this.focusPointer(t)})}get range(){return!oY.isNullOrUndefined(this.value)&&!oY.isNullOrUndefined(this.highValue)}get showTicks(){return this.viewOptions.showTicks}ngOnInit(){this.viewOptions=new rY,Object.assign(this.viewOptions,this.options),this.updateDisabledState(),this.updateVerticalState()}ngAfterViewInit(){this.applyOptions(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval),this.subscribeOutputModelChangeSubject(this.viewOptions.outputEventsInterval),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.updateVerticalState(),this.manageElementsStyle(),this.updateDisabledState(),this.calculateViewDimensions(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.initHandles(),this.manageEventsBindings(),this.subscribeResizeObserver(),this.initHasRun=!0,this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}ngOnChanges(t){oY.isNullOrUndefined(t.options)||this.onChangeOptions(),(!oY.isNullOrUndefined(t.value)||!oY.isNullOrUndefined(t.highValue))&&this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}ngOnDestroy(){this.unbindEvents(),this.unsubscribeResizeObserver(),this.unsubscribeInputModelChangeSubject(),this.unsubscribeOutputModelChangeSubject(),this.unsubscribeManualRefresh(),this.unsubscribeTriggerFocus()}writeValue(t){t instanceof Array?(this.value=t[0],this.highValue=t[1]):this.value=t,this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}registerOnChange(t){this.onChangeCallback=t}registerOnTouched(t){this.onTouchedCallback=t}setDisabledState(t){this.viewOptions.disabled=t,this.updateDisabledState()}onResize(t){this.calculateViewDimensionsAndDetectChanges()}subscribeInputModelChangeSubject(t){this.inputModelChangeSubscription=this.inputModelChangeSubject.pipe((0,MX.distinctUntilChanged)(bY.compare),(0,MX.filter)(t=>!t.forceChange&&!t.internalChange),oY.isNullOrUndefined(t)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.applyInputModelChange(t))}subscribeOutputModelChangeSubject(t){this.outputModelChangeSubscription=this.outputModelChangeSubject.pipe((0,MX.distinctUntilChanged)(bY.compare),oY.isNullOrUndefined(t)?(0,MX.tap)(()=>{}):(0,MX.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.publishOutputModelChange(t))}subscribeResizeObserver(){aY.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(()=>this.calculateViewDimensionsAndDetectChanges()),this.resizeObserver.observe(this.elementRef.nativeElement))}unsubscribeResizeObserver(){aY.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}unsubscribeOnMove(){oY.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}unsubscribeOnEnd(){oY.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}unsubscribeInputModelChangeSubject(){oY.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}unsubscribeOutputModelChangeSubject(){oY.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}unsubscribeManualRefresh(){oY.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}unsubscribeTriggerFocus(){oY.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}getPointerElement(t){return t===nY.Min?this.minHandleElement:t===nY.Max?this.maxHandleElement:null}getCurrentTrackingValue(){return this.currentTrackingPointer===nY.Min?this.viewLowValue:this.currentTrackingPointer===nY.Max?this.viewHighValue:null}modelValueToViewValue(t){return oY.isNullOrUndefined(t)?NaN:oY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+t:oY.findStepIndex(+t,this.viewOptions.stepsArray)}viewValueToModelValue(t){return oY.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?t:this.getStepValue(t)}getStepValue(t){const e=this.viewOptions.stepsArray[t];return oY.isNullOrUndefined(e)?NaN:e.value}applyViewChange(){this.value=this.viewValueToModelValue(this.viewLowValue),this.range&&(this.highValue=this.viewValueToModelValue(this.viewHighValue)),this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,userEventInitiated:!0,forceChange:!1}),this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!0})}applyInputModelChange(t){const e=this.normaliseModelValues(t),n=!mY.compare(t,e);n&&(this.value=e.value,this.highValue=e.highValue),this.viewLowValue=this.modelValueToViewValue(e.value),this.viewHighValue=this.range?this.modelValueToViewValue(e.highValue):null,this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCombinedLabel(),this.outputModelChangeSubject.next({value:e.value,highValue:e.highValue,forceChange:n,userEventInitiated:!1})}publishOutputModelChange(t){const e=()=>{this.valueChange.emit(t.value),this.range&&this.highValueChange.emit(t.highValue),oY.isNullOrUndefined(this.onChangeCallback)||this.onChangeCallback(this.range?[t.value,t.highValue]:t.value),oY.isNullOrUndefined(this.onTouchedCallback)||this.onTouchedCallback(this.range?[t.value,t.highValue]:t.value)};t.userEventInitiated?(e(),this.userChange.emit(this.getChangeContext())):setTimeout(()=>{e()})}normaliseModelValues(t){const e=new mY;if(e.value=t.value,e.highValue=t.highValue,this.viewOptions.enforceStep&&(e.value=this.roundStep(e.value),this.range&&(e.highValue=this.roundStep(e.highValue))),!oY.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return e;if(e.value=lY.clampToRange(e.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(e.highValue=lY.clampToRange(e.highValue,this.viewOptions.floor,this.viewOptions.ceil)),this.range&&t.value>t.highValue)if(this.viewOptions.noSwitching)e.value=e.highValue;else{const n=t.value;e.value=t.highValue,e.highValue=n}return e}renormaliseModelValues(){const t={value:this.value,highValue:this.highValue},e=this.normaliseModelValues(t);mY.compare(e,t)||(this.value=e.value,this.highValue=e.highValue,this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!0,userEventInitiated:!1}))}onChangeOptions(){if(!this.initHasRun)return;const t=this.viewOptions.inputEventsInterval,e=this.viewOptions.outputEventsInterval;this.applyOptions(),t!==this.viewOptions.inputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.inputEventsInterval)),e!==this.viewOptions.outputEventsInterval&&(this.unsubscribeInputModelChangeSubject(),this.subscribeInputModelChangeSubject(this.viewOptions.outputEventsInterval)),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.viewHighValue=this.range?this.modelValueToViewValue(this.highValue):null,this.resetSlider()}applyOptions(){if(this.viewOptions=new rY,Object.assign(this.viewOptions,this.options),this.viewOptions.draggableRange=this.range&&this.viewOptions.draggableRange,this.viewOptions.draggableRangeOnly=this.range&&this.viewOptions.draggableRangeOnly,this.viewOptions.draggableRangeOnly&&(this.viewOptions.draggableRange=!0),this.viewOptions.showTicks=this.viewOptions.showTicks||this.viewOptions.showTicksValues||!oY.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!oY.isNullOrUndefined(this.viewOptions.tickStep)||!oY.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),oY.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),oY.isNullOrUndefined(this.viewOptions.combineLabels)&&(this.viewOptions.combineLabels=(t,e)=>t+" - "+e),this.viewOptions.logScale&&0===this.viewOptions.floor)throw Error("Can't use floor=0 with logarithmic scale")}applyStepsArrayOptions(){this.viewOptions.floor=0,this.viewOptions.ceil=this.viewOptions.stepsArray.length-1,this.viewOptions.step=1,oY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=t=>String(this.viewOptions.bindIndexForStepsArray?this.getStepValue(t):t)),this.viewOptions.getLegend=t=>this.viewOptions.stepsArray[t].legend}applyFloorCeilOptions(){if(oY.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),oY.isNullOrUndefined(this.viewOptions.ceil)||oY.isNullOrUndefined(this.viewOptions.floor))throw Error("floor and ceil options must be supplied");this.viewOptions.ceil=+this.viewOptions.ceil,this.viewOptions.floor=+this.viewOptions.floor,oY.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=t=>String(t))}resetSlider(){this.manageElementsStyle(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.unbindEvents(),this.manageEventsBindings(),this.updateDisabledState(),this.calculateViewDimensions(),this.refocusPointerIfNeeded()}focusPointer(t){t!==nY.Min&&t!==nY.Max&&(t=nY.Min),t===nY.Min?this.minHandleElement.focus():this.range&&t===nY.Max&&this.maxHandleElement.focus()}refocusPointerIfNeeded(){oY.isNullOrUndefined(this.currentFocusPointer)||(this.onPointerFocus(this.currentFocusPointer),this.getPointerElement(this.currentFocusPointer).focus())}manageElementsStyle(){this.updateScale(),this.floorLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels),this.ceilLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels);const t=this.viewOptions.showTicksValues&&!this.intermediateTicks;this.minHandleLabelElement.setAlwaysHide(t||this.viewOptions.hidePointerLabels),this.maxHandleLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.combinedLabelElement.setAlwaysHide(t||!this.range||this.viewOptions.hidePointerLabels),this.selectionBarElement.setAlwaysHide(!this.range&&!this.viewOptions.showSelectionBar),this.leftOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.rightOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.fullBarTransparentClass=this.range&&this.viewOptions.showOuterSelectionBars,this.selectionBarDraggableClass=this.viewOptions.draggableRange&&!this.viewOptions.onlyBindHandles,this.ticksUnderValuesClass=this.intermediateTicks&&this.options.showTicksValues,this.sliderElementVerticalClass!==this.viewOptions.vertical&&(this.updateVerticalState(),setTimeout(()=>{this.resetSlider()})),this.sliderElementAnimateClass!==this.viewOptions.animate&&setTimeout(()=>{this.sliderElementAnimateClass=this.viewOptions.animate})}manageEventsBindings(){this.viewOptions.disabled||this.viewOptions.readOnly?this.unbindEvents():this.bindEvents()}updateDisabledState(){this.sliderElementDisabledAttr=this.viewOptions.disabled?"disabled":null}updateVerticalState(){this.sliderElementVerticalClass=this.viewOptions.vertical;for(const t of this.getAllSliderElements())oY.isNullOrUndefined(t)||t.setVertical(this.viewOptions.vertical)}updateScale(){for(const t of this.getAllSliderElements())t.setScale(this.viewOptions.scale)}getAllSliderElements(){return[this.leftOuterSelectionBarElement,this.rightOuterSelectionBarElement,this.fullBarElement,this.selectionBarElement,this.minHandleElement,this.maxHandleElement,this.floorLabelElement,this.ceilLabelElement,this.minHandleLabelElement,this.maxHandleLabelElement,this.combinedLabelElement,this.ticksElement]}initHandles(){this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.range&&this.updateCombinedLabel(),this.updateTicksScale()}addAccessibility(){this.updateAriaAttributes(),this.minHandleElement.role="slider",this.minHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.viewOptions.vertical&&(this.minHandleElement.ariaOrientation="vertical"),oY.isNullOrUndefined(this.viewOptions.ariaLabel)?oY.isNullOrUndefined(this.viewOptions.ariaLabelledBy)||(this.minHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledBy):this.minHandleElement.ariaLabel=this.viewOptions.ariaLabel,this.range&&(this.maxHandleElement.role="slider",this.maxHandleElement.tabindex=!this.viewOptions.keyboardSupport||this.viewOptions.readOnly||this.viewOptions.disabled?"":"0",this.maxHandleElement.ariaOrientation=this.viewOptions.vertical?"vertical":"horizontal",oY.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?oY.isNullOrUndefined(this.viewOptions.ariaLabelledByHigh)||(this.maxHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledByHigh):this.maxHandleElement.ariaLabel=this.viewOptions.ariaLabelHigh)}updateAriaAttributes(){this.minHandleElement.ariaValueNow=(+this.value).toString(),this.minHandleElement.ariaValueText=this.viewOptions.translate(+this.value,iY.Low),this.minHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.minHandleElement.ariaValueMax=this.viewOptions.ceil.toString(),this.range&&(this.maxHandleElement.ariaValueNow=(+this.highValue).toString(),this.maxHandleElement.ariaValueText=this.viewOptions.translate(+this.highValue,iY.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}calculateViewDimensions(){oY.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);const t=this.minHandleElement.dimension;this.handleHalfDimension=t/2,oY.isNullOrUndefined(this.viewOptions.barDimension)?this.fullBarElement.calculateDimension():this.fullBarElement.setDimension(this.viewOptions.barDimension),this.maxHandlePosition=this.fullBarElement.dimension-t,this.initHasRun&&(this.updateFloorLabel(),this.updateCeilLabel(),this.initHandles())}calculateViewDimensionsAndDetectChanges(){this.calculateViewDimensions(),this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}isRefDestroyed(){return this.changeDetectionRef.destroyed}updateTicksScale(){if(!this.viewOptions.showTicks)return;const t=oY.isNullOrUndefined(this.viewOptions.ticksArray)?this.getTicksArray():this.viewOptions.ticksArray,e=this.viewOptions.vertical?"translateY":"translateX";this.viewOptions.rightToLeft&&t.reverse();const n=t.map(t=>{let n=this.valueToPosition(t);this.viewOptions.vertical&&(n=this.maxHandlePosition-n);const i=e+"("+Math.round(n)+"px)",r=new fY;if(r.selected=this.isTickSelected(t),r.style={"-webkit-transform":i,"-moz-transform":i,"-o-transform":i,"-ms-transform":i,transform:i},r.selected&&!oY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)&&(r.style["background-color"]=this.getSelectionBarColor()),!r.selected&&!oY.isNullOrUndefined(this.viewOptions.getTickColor)&&(r.style["background-color"]=this.getTickColor(t)),oY.isNullOrUndefined(this.viewOptions.ticksTooltip)||(r.tooltip=this.viewOptions.ticksTooltip(t),r.tooltipPlacement=this.viewOptions.vertical?"right":"top"),this.viewOptions.showTicksValues&&t%this.viewOptions.tickValueStep==0&&(r.value=this.getDisplayValue(t,iY.TickValue),oY.isNullOrUndefined(this.viewOptions.ticksValuesTooltip)||(r.valueTooltip=this.viewOptions.ticksValuesTooltip(t),r.valueTooltipPlacement=this.viewOptions.vertical?"right":"top")),!oY.isNullOrUndefined(this.viewOptions.getLegend)){const e=this.viewOptions.getLegend(t);oY.isNullOrUndefined(e)||(r.legend=e)}return r});if(oY.isNullOrUndefined(this.ticks)||this.ticks.length!==n.length)this.ticks=n;else for(let i=0;i=this.viewLowValue)return!0}else if(this.viewOptions.showSelectionBar&&t<=this.viewLowValue)return!0}else{const e=this.viewOptions.showSelectionBarFromValue;if(this.viewLowValue>e&&t>=e&&t<=this.viewLowValue)return!0;if(this.viewLowValue=this.viewLowValue)return!0}return!!(this.range&&t>=this.viewLowValue&&t<=this.viewHighValue)}updateFloorLabel(){this.floorLabelElement.alwaysHide||(this.floorLabelElement.setValue(this.getDisplayValue(this.viewOptions.floor,iY.Floor)),this.floorLabelElement.calculateDimension(),this.floorLabelElement.setPosition(this.viewOptions.rightToLeft?this.fullBarElement.dimension-this.floorLabelElement.dimension:0))}updateCeilLabel(){this.ceilLabelElement.alwaysHide||(this.ceilLabelElement.setValue(this.getDisplayValue(this.viewOptions.ceil,iY.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}updateHandles(t,e){t===nY.Min?this.updateLowHandle(e):t===nY.Max&&this.updateHighHandle(e),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}getHandleLabelPos(t,e){const n=t===nY.Min?this.minHandleLabelElement.dimension:this.maxHandleLabelElement.dimension,i=e-n/2+this.handleHalfDimension,r=this.fullBarElement.dimension-n;return this.viewOptions.boundPointerLabels?this.viewOptions.rightToLeft&&t===nY.Min||!this.viewOptions.rightToLeft&&t===nY.Max?Math.min(i,r):Math.min(Math.max(i,0),r):i}updateLowHandle(t){this.minHandleElement.setPosition(t),this.minHandleLabelElement.setValue(this.getDisplayValue(this.viewLowValue,iY.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(nY.Min,t)),oY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(nY.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateHighHandle(t){this.maxHandleElement.setPosition(t),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,iY.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(nY.Max,t)),oY.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(nY.Max)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateFloorAndCeilLabelsVisibility(){if(this.viewOptions.hidePointerLabels)return;let t=!1,e=!1;const n=this.isLabelBelowFloorLabel(this.minHandleLabelElement),i=this.isLabelAboveCeilLabel(this.minHandleLabelElement),r=this.isLabelAboveCeilLabel(this.maxHandleLabelElement),s=this.isLabelBelowFloorLabel(this.combinedLabelElement),o=this.isLabelAboveCeilLabel(this.combinedLabelElement);if(n?(t=!0,this.floorLabelElement.hide()):(t=!1,this.floorLabelElement.show()),i?(e=!0,this.ceilLabelElement.hide()):(e=!1,this.ceilLabelElement.show()),this.range){const i=this.combinedLabelElement.isVisible()?o:r,a=this.combinedLabelElement.isVisible()?s:n;i?this.ceilLabelElement.hide():e||this.ceilLabelElement.show(),a?this.floorLabelElement.hide():t||this.floorLabelElement.show()}}isLabelBelowFloorLabel(t){const e=t.position,n=this.floorLabelElement.position;return this.viewOptions.rightToLeft?e+t.dimension>=n-2:e<=n+this.floorLabelElement.dimension+2}isLabelAboveCeilLabel(t){const e=t.position,n=this.ceilLabelElement.position;return this.viewOptions.rightToLeft?e<=n+this.ceilLabelElement.dimension+2:e+t.dimension>=n-2}updateSelectionBar(){let t=0,e=0;const n=this.viewOptions.rightToLeft?!this.viewOptions.showSelectionBarEnd:this.viewOptions.showSelectionBarEnd,i=this.viewOptions.rightToLeft?this.maxHandleElement.position+this.handleHalfDimension:this.minHandleElement.position+this.handleHalfDimension;if(this.range)e=Math.abs(this.maxHandleElement.position-this.minHandleElement.position),t=i;else if(oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue))n?(e=Math.ceil(Math.abs(this.maxHandlePosition-this.minHandleElement.position)+this.handleHalfDimension),t=Math.floor(this.minHandleElement.position+this.handleHalfDimension)):(e=this.minHandleElement.position+this.handleHalfDimension,t=0);else{const n=this.viewOptions.showSelectionBarFromValue,i=this.valueToPosition(n);(this.viewOptions.rightToLeft?this.viewLowValue<=n:this.viewLowValue>n)?(e=this.minHandleElement.position-i,t=i+this.handleHalfDimension):(e=i-this.minHandleElement.position,t=this.minHandleElement.position+this.handleHalfDimension)}if(this.selectionBarElement.setDimension(e),this.selectionBarElement.setPosition(t),this.range&&this.viewOptions.showOuterSelectionBars&&(this.viewOptions.rightToLeft?(this.rightOuterSelectionBarElement.setDimension(t),this.rightOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.leftOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(t+e)),this.leftOuterSelectionBarElement.setPosition(t+e)):(this.leftOuterSelectionBarElement.setDimension(t),this.leftOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.rightOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(t+e)),this.rightOuterSelectionBarElement.setPosition(t+e))),oY.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!oY.isNullOrUndefined(this.viewOptions.selectionBarGradient)){const i=oY.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue)?0:this.valueToPosition(this.viewOptions.showSelectionBarFromValue),r=i-t>0&&!n||i-t<=0&&n;this.barStyle={backgroundImage:"linear-gradient(to "+(this.viewOptions.vertical?r?"bottom":"top":r?"left":"right")+", "+this.viewOptions.selectionBarGradient.from+" 0%,"+this.viewOptions.selectionBarGradient.to+" 100%)"},this.viewOptions.vertical?(this.barStyle.backgroundPosition="center "+(i+e+t+(r?-this.handleHalfDimension:0))+"px",this.barStyle.backgroundSize="100% "+(this.fullBarElement.dimension-this.handleHalfDimension)+"px"):(this.barStyle.backgroundPosition=i-t+(r?this.handleHalfDimension:0)+"px center",this.barStyle.backgroundSize=this.fullBarElement.dimension-this.handleHalfDimension+"px 100%")}}else{const t=this.getSelectionBarColor();this.barStyle={backgroundColor:t}}}getSelectionBarColor(){return this.range?this.viewOptions.getSelectionBarColor(this.value,this.highValue):this.viewOptions.getSelectionBarColor(this.value)}getPointerColor(t){return this.viewOptions.getPointerColor(t===nY.Max?this.highValue:this.value,t)}getTickColor(t){return this.viewOptions.getTickColor(t)}updateCombinedLabel(){let t=null;if(t=this.viewOptions.rightToLeft?this.minHandleLabelElement.position-this.minHandleLabelElement.dimension-10<=this.maxHandleLabelElement.position:this.minHandleLabelElement.position+this.minHandleLabelElement.dimension+10>=this.maxHandleLabelElement.position,t){const t=this.getDisplayValue(this.viewLowValue,iY.Low),e=this.getDisplayValue(this.viewHighValue,iY.High),n=this.viewOptions.rightToLeft?this.viewOptions.combineLabels(e,t):this.viewOptions.combineLabels(t,e);this.combinedLabelElement.setValue(n);const i=this.viewOptions.boundPointerLabels?Math.min(Math.max(this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2,0),this.fullBarElement.dimension-this.combinedLabelElement.dimension):this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2;this.combinedLabelElement.setPosition(i),this.minHandleLabelElement.hide(),this.maxHandleLabelElement.hide(),this.combinedLabelElement.show()}else this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.maxHandleLabelElement.show(),this.minHandleLabelElement.show(),this.combinedLabelElement.hide();this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}getDisplayValue(t,e){return!oY.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(t=this.getStepValue(t)),this.viewOptions.translate(t,e)}roundStep(t,e){const n=oY.isNullOrUndefined(e)?this.viewOptions.step:e;let i=lY.roundToPrecisionLimit((t-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,lY.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}valueToPosition(t){let e=oY.linearValueToPosition;oY.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(e=oY.logValueToPosition):e=this.viewOptions.customValueToPosition;let n=e(t=lY.clampToRange(t,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return oY.isNullOrUndefined(n)&&(n=0),this.viewOptions.rightToLeft&&(n=1-n),n*this.maxHandlePosition}positionToValue(t){let e=t/this.maxHandlePosition;this.viewOptions.rightToLeft&&(e=1-e);let n=oY.linearPositionToValue;oY.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=oY.logPositionToValue):n=this.viewOptions.customPositionToValue;const i=n(e,this.viewOptions.floor,this.viewOptions.ceil);return oY.isNullOrUndefined(i)?0:i}getEventXY(t,e){if(t instanceof MouseEvent)return this.viewOptions.vertical?t.clientY:t.clientX;let n=0;const i=t.touches;if(!oY.isNullOrUndefined(e))for(let r=0;ri?nY.Max:this.viewOptions.rightToLeft?e>this.minHandleElement.position?nY.Min:nY.Max:ethis.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.on("mousedown",e=>this.onBarStart(nY.Min,t,e,!0,!0)),this.maxHandleElement.on("mousedown",e=>this.onBarStart(nY.Max,t,e,!0,!0))):(this.minHandleElement.on("mousedown",t=>this.onStart(nY.Min,t,!0,!0)),this.range&&this.maxHandleElement.on("mousedown",t=>this.onStart(nY.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0,!0)))),this.viewOptions.onlyBindHandles||this.selectionBarElement.onPassive("touchstart",e=>this.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.onPassive("touchstart",e=>this.onBarStart(nY.Min,t,e,!0,!0)),this.maxHandleElement.onPassive("touchstart",e=>this.onBarStart(nY.Max,t,e,!0,!0))):(this.minHandleElement.onPassive("touchstart",t=>this.onStart(nY.Min,t,!0,!0)),this.range&&this.maxHandleElement.onPassive("touchstart",t=>this.onStart(nY.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.onPassive("touchstart",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.onPassive("touchstart",t=>this.onStart(null,t,!1,!1,!0,!0)))),this.viewOptions.keyboardSupport&&(this.minHandleElement.on("focus",()=>this.onPointerFocus(nY.Min)),this.range&&this.maxHandleElement.on("focus",()=>this.onPointerFocus(nY.Max)))}unbindEvents(){this.unsubscribeOnMove(),this.unsubscribeOnEnd();for(const t of this.getAllSliderElements())oY.isNullOrUndefined(t)||t.off()}onBarStart(t,e,n,i,r,s,o){e?this.onDragStart(t,n,i,r):this.onStart(t,n,i,r,s,o)}onStart(t,e,n,i,r,s){e.stopPropagation(),(!aY.isTouchEvent(e)||!DX.Z.hasSupport)&&e.preventDefault(),this.calculateViewDimensions(),oY.isNullOrUndefined(t)&&(t=this.getNearestHandle(e)),this.currentTrackingPointer=t;const o=this.getPointerElement(t);if(o.active=!0,this.viewOptions.keyboardSupport&&o.focus(),n){this.unsubscribeOnMove();const t=t=>this.dragging.active?this.onDragMove(t):this.onMove(t);this.onMoveEventListener=aY.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchmove",t,this.viewOptions.touchEventsInterval):this.eventListenerHelper.attachEventListener(document,"mousemove",t,this.viewOptions.mouseEventsInterval)}if(i){this.unsubscribeOnEnd();const t=t=>this.onEnd(t);this.onEndEventListener=aY.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchend",t):this.eventListenerHelper.attachEventListener(document,"mouseup",t)}this.userChangeStart.emit(this.getChangeContext()),aY.isTouchEvent(e)&&!oY.isNullOrUndefined(e.changedTouches)&&oY.isNullOrUndefined(this.touchId)&&(this.touchId=e.changedTouches[0].identifier),r&&this.onMove(e,!0),s&&this.onEnd(e)}onMove(t,e){let n=null;if(aY.isTouchEvent(t)){const e=t.changedTouches;for(let t=0;t=this.maxHandlePosition?r=this.viewOptions.rightToLeft?this.viewOptions.floor:this.viewOptions.ceil:(r=this.positionToValue(i),r=e&&!oY.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(r,this.viewOptions.tickStep):this.roundStep(r)),this.positionTrackingHandle(r)}onEnd(t){aY.isTouchEvent(t)&&t.changedTouches[0].identifier!==this.touchId||(this.touchId=null,this.viewOptions.keyboardSupport||(this.minHandleElement.active=!1,this.maxHandleElement.active=!1,this.currentTrackingPointer=null),this.dragging.active=!1,this.unsubscribeOnMove(),this.unsubscribeOnEnd(),this.userChangeEnd.emit(this.getChangeContext()))}onPointerFocus(t){const e=this.getPointerElement(t);e.on("blur",()=>this.onPointerBlur(e)),e.on("keydown",t=>this.onKeyboardEvent(t)),e.on("keyup",()=>this.onKeyUp()),e.active=!0,this.currentTrackingPointer=t,this.currentFocusPointer=t,this.firstKeyDown=!0}onKeyUp(){this.firstKeyDown=!0,this.userChangeEnd.emit(this.getChangeContext())}onPointerBlur(t){t.off("blur"),t.off("keydown"),t.off("keyup"),t.active=!1,oY.isNullOrUndefined(this.touchId)&&(this.currentTrackingPointer=null,this.currentFocusPointer=null)}getKeyActions(t){const e=this.viewOptions.ceil-this.viewOptions.floor;let n=t+this.viewOptions.step,i=t-this.viewOptions.step,r=t+e/10,s=t-e/10;this.viewOptions.reversedControls&&(n=t-this.viewOptions.step,i=t+this.viewOptions.step,r=t-e/10,s=t+e/10);const o={UP:n,DOWN:i,LEFT:i,RIGHT:n,PAGEUP:r,PAGEDOWN:s,HOME:this.viewOptions.reversedControls?this.viewOptions.ceil:this.viewOptions.floor,END:this.viewOptions.reversedControls?this.viewOptions.floor:this.viewOptions.ceil};return this.viewOptions.rightToLeft&&(o.LEFT=n,o.RIGHT=i,this.viewOptions.vertical&&(o.UP=i,o.DOWN=n)),o}onKeyboardEvent(t){const e=this.getCurrentTrackingValue(),n=oY.isNullOrUndefined(t.keyCode)?t.which:t.keyCode,i=this.getKeyActions(e)[{38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"}[n]];if(oY.isNullOrUndefined(i)||oY.isNullOrUndefined(this.currentTrackingPointer))return;t.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));const r=lY.clampToRange(i,this.viewOptions.floor,this.viewOptions.ceil),s=this.roundStep(r);if(this.viewOptions.draggableRangeOnly){const t=this.viewHighValue-this.viewLowValue;let e,n;this.currentTrackingPointer===nY.Min?(e=s,n=s+t,n>this.viewOptions.ceil&&(n=this.viewOptions.ceil,e=n-t)):this.currentTrackingPointer===nY.Max&&(n=s,e=s-t,e=this.maxHandlePosition-n;let a,l;if(e<=i){if(0===r.position)return;a=this.getMinValue(e,!0,!1),l=this.getMaxValue(e,!0,!1)}else if(o){if(s.position===this.maxHandlePosition)return;l=this.getMaxValue(e,!0,!0),a=this.getMinValue(e,!0,!0)}else a=this.getMinValue(e,!1,!1),l=this.getMaxValue(e,!1,!1);this.positionTrackingBar(a,l)}positionTrackingBar(t,e){!oY.isNullOrUndefined(this.viewOptions.minLimit)&&tthis.viewOptions.maxLimit&&(t=lY.roundToPrecisionLimit((e=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=t,this.viewHighValue=e,this.applyViewChange(),this.updateHandles(nY.Min,this.valueToPosition(t)),this.updateHandles(nY.Max,this.valueToPosition(e))}positionTrackingHandle(t){t=this.applyMinMaxLimit(t),this.range&&(this.viewOptions.pushRange?t=this.applyPushRange(t):(this.viewOptions.noSwitching&&(this.currentTrackingPointer===nY.Min&&t>this.viewHighValue?t=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===nY.Max&&tthis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(nY.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=nY.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===nY.Max&&tthis.viewOptions.maxLimit?this.viewOptions.maxLimit:t}applyMinMaxRange(t){const e=Math.abs(t-(this.currentTrackingPointer===nY.Min?this.viewHighValue:this.viewLowValue));if(!oY.isNullOrUndefined(this.viewOptions.minRange)&&ethis.viewOptions.maxRange){if(this.currentTrackingPointer===nY.Min)return lY.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===nY.Max)return lY.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return t}applyPushRange(t){const e=this.currentTrackingPointer===nY.Min?this.viewHighValue-t:t-this.viewLowValue,n=oY.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ei&&(this.currentTrackingPointer===nY.Min?(this.viewHighValue=lY.roundToPrecisionLimit(t+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(nY.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===nY.Max&&(this.viewLowValue=lY.roundToPrecisionLimit(t-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(nY.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),t}getChangeContext(){const t=new sY;return t.pointerType=this.currentTrackingPointer,t.value=+this.value,this.range&&(t.highValue=+this.highValue),t}}return t.\u0275fac=function(e){return new(e||t)(ea(Il),ea(kl),ea(tc),ea(xu))},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,RX,5),2&t){let t;Wc(t=Yc())&&(e.tooltipTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&(qc(NX,5,hY),qc(LX,5,hY),qc(jX,5,hY),qc(FX,5,hY),qc(BX,5,dY),qc(VX,5,dY),qc(zX,5,pY),qc(UX,5,pY),qc(HX,5,pY),qc($X,5,pY),qc(GX,5,pY),qc(WX,5,hY)),2&t){let t;Wc(t=Yc())&&(e.leftOuterSelectionBarElement=t.first),Wc(t=Yc())&&(e.rightOuterSelectionBarElement=t.first),Wc(t=Yc())&&(e.fullBarElement=t.first),Wc(t=Yc())&&(e.selectionBarElement=t.first),Wc(t=Yc())&&(e.minHandleElement=t.first),Wc(t=Yc())&&(e.maxHandleElement=t.first),Wc(t=Yc())&&(e.floorLabelElement=t.first),Wc(t=Yc())&&(e.ceilLabelElement=t.first),Wc(t=Yc())&&(e.minHandleLabelElement=t.first),Wc(t=Yc())&&(e.maxHandleLabelElement=t.first),Wc(t=Yc())&&(e.combinedLabelElement=t.first),Wc(t=Yc())&&(e.ticksElement=t.first)}},hostAttrs:[1,"ng5-slider"],hostVars:5,hostBindings:function(t,e){1&t&&fa("resize",function(t){return e.onResize(t)},!1,Pr),2&t&&(Ko("disabled",e.sliderElementDisabledAttr),ja("vertical",e.sliderElementVerticalClass)("animate",e.sliderElementAnimateClass))},inputs:{value:"value",highValue:"highValue",options:"options",manualRefresh:"manualRefresh",triggerFocus:"triggerFocus"},outputs:{valueChange:"valueChange",highValueChange:"highValueChange",userChangeStart:"userChangeStart",userChange:"userChange",userChangeEnd:"userChangeEnd"},features:[_l([yY]),ye],decls:29,vars:13,consts:[["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-left-out-selection"],["leftOuterSelectionBar",""],[1,"ng5-slider-span","ng5-slider-bar"],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-right-out-selection"],["rightOuterSelectionBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-full-bar"],["fullBar",""],["ng5SliderElement","",1,"ng5-slider-span","ng5-slider-bar-wrapper","ng5-slider-selection-bar"],["selectionBar",""],[1,"ng5-slider-span","ng5-slider-bar","ng5-slider-selection",3,"ngStyle"],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-min",3,"ngStyle"],["minHandle",""],["ng5SliderHandle","",1,"ng5-slider-span","ng5-slider-pointer","ng5-slider-pointer-max",3,"ngStyle"],["maxHandle",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-floor"],["floorLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-limit","ng5-slider-ceil"],["ceilLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-value"],["minHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-model-high"],["maxHandleLabel",""],["ng5SliderLabel","",1,"ng5-slider-span","ng5-slider-bubble","ng5-slider-combined"],["combinedLabel",""],["ng5SliderElement","",1,"ng5-slider-ticks",3,"hidden"],["ticksElement",""],["class","ng5-slider-tick",3,"ngClass","ngStyle",4,"ngFor","ngForOf"],[1,"ng5-slider-tick",3,"ngClass","ngStyle"],[3,"template","tooltip","placement"],["class","ng5-slider-span ng5-slider-tick-value",3,"template","tooltip","placement","content",4,"ngIf"],["class","ng5-slider-span ng5-slider-tick-legend",3,"innerHTML",4,"ngIf"],[1,"ng5-slider-span","ng5-slider-tick-value",3,"template","tooltip","placement","content"],[1,"ng5-slider-span","ng5-slider-tick-legend",3,"innerHTML"]],template:function(t,e){1&t&&(ra(0,"span",0,1),oa(2,"span",2),sa(),ra(3,"span",3,4),oa(5,"span",2),sa(),ra(6,"span",5,6),oa(8,"span",2),sa(),ra(9,"span",7,8),oa(11,"span",9),sa(),oa(12,"span",10,11),oa(14,"span",12,13),oa(16,"span",14,15),oa(18,"span",16,17),oa(20,"span",18,19),oa(22,"span",20,21),oa(24,"span",22,23),ra(26,"span",24,25),Jo(28,KX,4,9,"span",26),sa()),2&t&&(ws(6),ja("ng5-slider-transparent",e.fullBarTransparentClass),ws(3),ja("ng5-slider-draggable",e.selectionBarDraggableClass),ws(2),na("ngStyle",e.barStyle),ws(1),na("ngStyle",e.minPointerStyle),ws(2),La("display",e.range?"inherit":"none"),na("ngStyle",e.maxPointerStyle),ws(12),ja("ng5-slider-ticks-values-under",e.ticksUnderValuesClass),na("hidden",!e.showTicks),ws(2),na("ngForOf",e.ticks))},directives:function(){return[hY,Th,dY,pY,yh,mh,_Y,_h]},styles:[".ng5-slider{display:inline-block;position:relative;height:4px;width:100%;margin:35px 0 15px;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y} .ng5-slider.with-legend{margin-bottom:40px} .ng5-slider[disabled]{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-pointer{cursor:not-allowed;background-color:#d8e0f3} .ng5-slider[disabled] .ng5-slider-draggable{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-selection{background:#8b91a2} .ng5-slider[disabled] .ng5-slider-tick{cursor:not-allowed} .ng5-slider[disabled] .ng5-slider-tick.ng5-slider-selected{background:#8b91a2} .ng5-slider .ng5-slider-span{white-space:nowrap;position:absolute;display:inline-block} .ng5-slider .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider .ng5-slider-bar-wrapper{left:0;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:-16px;padding-top:16px;width:100%;height:32px;z-index:1} .ng5-slider .ng5-slider-draggable{cursor:move} .ng5-slider .ng5-slider-bar{left:0;width:100%;height:4px;z-index:1;background:#d8e0f3;border-radius:2px} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-transparent .ng5-slider-bar{background:0 0} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-left-out-selection .ng5-slider-bar{background:#df002d} .ng5-slider .ng5-slider-bar-wrapper.ng5-slider-right-out-selection .ng5-slider-bar{background:#03a688} .ng5-slider .ng5-slider-selection{z-index:2;background:#0db9f0;border-radius:2px} .ng5-slider .ng5-slider-pointer{cursor:pointer;width:32px;height:32px;top:-14px;background-color:#0db9f0;z-index:3;border-radius:16px} .ng5-slider .ng5-slider-pointer:after{content:'';width:8px;height:8px;position:absolute;top:12px;left:12px;border-radius:4px;background:#fff} .ng5-slider .ng5-slider-pointer:hover:after{background-color:#fff} .ng5-slider .ng5-slider-pointer.ng5-slider-active{z-index:4} .ng5-slider .ng5-slider-pointer.ng5-slider-active:after{background-color:#451aff} .ng5-slider .ng5-slider-bubble{cursor:default;bottom:16px;padding:1px 3px;color:#55637d;font-size:16px} .ng5-slider .ng5-slider-bubble.ng5-slider-limit{color:#55637d} .ng5-slider .ng5-slider-ticks{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:0;position:absolute;left:0;top:-3px;margin:0;z-index:1;list-style:none} .ng5-slider .ng5-slider-ticks-values-under .ng5-slider-tick-value{top:auto;bottom:-36px} .ng5-slider .ng5-slider-tick{text-align:center;cursor:pointer;width:10px;height:10px;background:#d8e0f3;border-radius:50%;position:absolute;top:0;left:0;margin-left:11px} .ng5-slider .ng5-slider-tick.ng5-slider-selected{background:#0db9f0} .ng5-slider .ng5-slider-tick-value{position:absolute;top:-34px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0)} .ng5-slider .ng5-slider-tick-legend{position:absolute;top:24px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0);max-width:50px;white-space:normal} .ng5-slider.vertical{position:relative;width:4px;height:100%;margin:0 20px;padding:0;vertical-align:baseline;-ms-touch-action:pan-x;touch-action:pan-x} .ng5-slider.vertical .ng5-slider-base{width:100%;height:100%;padding:0} .ng5-slider.vertical .ng5-slider-bar-wrapper{top:auto;left:0;margin:0 0 0 -16px;padding:0 0 0 16px;height:100%;width:32px} .ng5-slider.vertical .ng5-slider-bar{bottom:0;left:auto;width:4px;height:100%} .ng5-slider.vertical .ng5-slider-pointer{left:-14px!important;top:auto;bottom:0} .ng5-slider.vertical .ng5-slider-bubble{left:16px!important;bottom:0} .ng5-slider.vertical .ng5-slider-ticks{height:100%;width:0;left:-3px;top:0;z-index:1} .ng5-slider.vertical .ng5-slider-tick{vertical-align:middle;margin-left:auto;margin-top:11px} .ng5-slider.vertical .ng5-slider-tick-value{left:24px;top:auto;-webkit-transform:translate(0,-28%);transform:translate(0,-28%)} .ng5-slider.vertical .ng5-slider-tick-legend{top:auto;right:24px;-webkit-transform:translate(0,-28%);transform:translate(0,-28%);max-width:none;white-space:nowrap} .ng5-slider.vertical .ng5-slider-ticks-values-under .ng5-slider-tick-value{bottom:auto;left:auto;right:24px} .ng5-slider *{-webkit-transition:none;transition:none} .ng5-slider.animate .ng5-slider-bar-wrapper{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-selection{-webkit-transition:background-color linear .3s;transition:background-color linear .3s} .ng5-slider.animate .ng5-slider-pointer{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble{-webkit-transition:all linear .3s;transition:all linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-limit{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-bubble.ng5-slider-combined{-webkit-transition:opacity linear .3s;transition:opacity linear .3s} .ng5-slider.animate .ng5-slider-tick{-webkit-transition:background-color linear .3s;transition:background-color linear .3s}"]}),t})(),_Y=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider-tooltip-wrapper"]],inputs:{template:"template",tooltip:"tooltip",placement:"placement",content:"content"},decls:2,vars:2,consts:[[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ng5-slider-inner-tooltip"]],template:function(t,e){1&t&&(Jo(0,tY,2,6,"ng-container",0),Jo(1,eY,3,3,"ng-container",0)),2&t&&(na("ngIf",e.template),ws(1),na("ngIf",!e.template))},directives:[_h,kh],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),t})(),wY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})(),xY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Rf,Hp,cU,AX,wY]]}),t})(),SY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,cX,PX,xY,x_,f_]]}),t})(),EY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,f_,SY]]}),t})(),CY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Az,Pz,kU,cU,jU,f_]]}),t})();class OY extends class{constructor(){this.expansionModel=new kp(!0)}toggle(t){this.expansionModel.toggle(this._trackByValue(t))}expand(t){this.expansionModel.select(this._trackByValue(t))}collapse(t){this.expansionModel.deselect(this._trackByValue(t))}isExpanded(t){return this.expansionModel.isSelected(this._trackByValue(t))}toggleDescendants(t){this.expansionModel.isSelected(this._trackByValue(t))?this.collapseDescendants(t):this.expandDescendants(t)}collapseAll(){this.expansionModel.clear()}expandDescendants(t){let e=[t];e.push(...this.getDescendants(t)),this.expansionModel.select(...e.map(t=>this._trackByValue(t)))}collapseDescendants(t){let e=[t];e.push(...this.getDescendants(t)),this.expansionModel.deselect(...e.map(t=>this._trackByValue(t)))}_trackByValue(t){return this.trackBy?this.trackBy(t):t}}{constructor(t,e,n){super(),this.getLevel=t,this.isExpandable=e,this.options=n,this.options&&(this.trackBy=this.options.trackBy)}getDescendants(t){const e=[];for(let n=this.dataNodes.indexOf(t)+1;nthis._trackByValue(t)))}}const TY=new oi("CDK_TREE_NODE_OUTLET_NODE");let kY=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(TY,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeOutlet",""]]}),t})();class AY{constructor(t){this.$implicit=t}}let PY=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:["cdkTreeNodeDefWhen","when"]}}),t})(),IY=(()=>{class t{constructor(t,e){this._differs=t,this._changeDetectorRef=e,this._onDestroy=new P,this._levels=new Map,this.viewChange=new Uf({start:0,end:Number.MAX_VALUE})}get dataSource(){return this._dataSource}set dataSource(t){this._dataSource!==t&&this._switchDataSource(t)}ngOnInit(){this._dataDiffer=this._differs.find([]).create(this.trackBy)}ngOnDestroy(){this._nodeOutlet.viewContainer.clear(),this.viewChange.complete(),this._onDestroy.next(),this._onDestroy.complete(),this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null)}ngAfterContentChecked(){const t=this._nodeDefs.filter(t=>!t.when);this._defaultNodeDef=t[0],this.dataSource&&this._nodeDefs&&!this._dataSubscription&&this._observeRenderChanges()}_switchDataSource(t){this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null),t||this._nodeOutlet.viewContainer.clear(),this._dataSource=t,this._nodeDefs&&this._observeRenderChanges()}_observeRenderChanges(){let t;!function(t){return t&&"function"==typeof t.connect}(this._dataSource)?Dd(this._dataSource)?t=this._dataSource:Array.isArray(this._dataSource)&&(t=wd(this._dataSource)):t=this._dataSource.connect(this),t&&(this._dataSubscription=t.pipe(Wd(this._onDestroy)).subscribe(t=>this.renderNodeChanges(t)))}renderNodeChanges(t,e=this._dataDiffer,n=this._nodeOutlet.viewContainer,i){const r=e.diff(t);!r||(r.forEachOperation((e,r,s)=>{if(null==e.previousIndex)this.insertNode(t[s],s,n,i);else if(null==s)n.remove(r),this._levels.delete(e.item);else{const t=n.get(r);n.move(t,s)}}),this._changeDetectorRef.detectChanges())}_getNodeDef(t,e){return 1===this._nodeDefs.length?this._nodeDefs.first:this._nodeDefs.find(n=>n.when&&n.when(e,t))||this._defaultNodeDef}insertNode(t,e,n,i){const r=this._getNodeDef(t,e),s=new AY(t);s.level=this.treeControl.getLevel?this.treeControl.getLevel(t):void 0!==i&&this._levels.has(i)?this._levels.get(i)+1:0,this._levels.set(t,s.level),(n||this._nodeOutlet.viewContainer).createEmbeddedView(r.template,s,e),MY.mostRecentTreeNode&&(MY.mostRecentTreeNode.data=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(ql),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["cdk-tree"]],contentQueries:function(t,e,n){if(1&t&&Xc(n,PY,5),2&t){let t;Wc(t=Yc())&&(e._nodeDefs=t)}},viewQuery:function(t,e){if(1&t&&qc(kY,7),2&t){let t;Wc(t=Yc())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"cdk-tree"],inputs:{dataSource:"dataSource",treeControl:"treeControl",trackBy:"trackBy"},exportAs:["cdkTree"],decls:1,vars:0,consts:[["cdkTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[kY],encapsulation:2}),t})(),MY=(()=>{class t{constructor(e,n){this._elementRef=e,this._tree=n,this._destroyed=new P,this._dataChanges=new P,t.mostRecentTreeNode=this,this._elementRef.nativeElement.classList.add("cdk-tree-node"),this.role="treeitem"}get role(){return"treeitem"}set role(t){this._elementRef.nativeElement.setAttribute("role",t)}get data(){return this._data}set data(t){t!==this._data&&(this._data=t,this._setRoleFromData(),this._dataChanges.next())}get isExpanded(){return this._tree.treeControl.isExpanded(this._data)}_setExpanded(t){this._isAriaExpanded=t,this._elementRef.nativeElement.setAttribute("aria-expanded",`${t}`)}get level(){return this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._data):this._parentNodeAriaLevel}ngOnInit(){this._parentNodeAriaLevel=function(t){let e=t.parentElement;for(;e&&!DY(e);)e=e.parentElement;return e?e.classList.contains("cdk-nested-tree-node")?bd(e.getAttribute("aria-level")):0:-1}(this._elementRef.nativeElement),this._elementRef.nativeElement.setAttribute("aria-level",`${this.level+1}`)}ngDoCheck(){this.isExpanded!=this._isAriaExpanded&&this._setExpanded(this.isExpanded)}ngOnDestroy(){t.mostRecentTreeNode===this&&(t.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}focus(){this._elementRef.nativeElement.focus()}_setRoleFromData(){this.role="treeitem"}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(IY))},t.\u0275dir=se({type:t,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),t.mostRecentTreeNode=null,t})();function DY(t){const e=t.classList;return!(!(null==e?void 0:e.contains("cdk-nested-tree-node"))&&!(null==e?void 0:e.contains("cdk-tree")))}const RY=/([A-Za-z%]+)$/;let NY=(()=>{class t{constructor(t,e,n,i){this._treeNode=t,this._tree=e,this._element=n,this._dir=i,this._destroyed=new P,this.indentUnits="px",this._indent=40,this._setPadding(),i&&i.change.pipe(Wd(this._destroyed)).subscribe(()=>this._setPadding(!0)),t._dataChanges.subscribe(()=>this._setPadding())}get level(){return this._level}set level(t){this._setLevelInput(t)}get indent(){return this._indent}set indent(t){this._setIndentInput(t)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_paddingIndent(){const t=this._treeNode.data&&this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._treeNode.data):null,e=null==this._level?t:this._level;return"number"==typeof e?`${e*this._indent}${this.indentUnits}`:null}_setPadding(t=!1){const e=this._paddingIndent();if(e!==this._currentPadding||t){const t=this._element.nativeElement,n=this._dir&&"rtl"===this._dir.value?"paddingRight":"paddingLeft",i="paddingLeft"===n?"paddingRight":"paddingLeft";t.style[n]=e||"",t.style[i]="",this._currentPadding=e}}_setLevelInput(t){this._level=bd(t,null),this._setPadding()}_setIndentInput(t){let e=t,n="px";if("string"==typeof t){const i=t.split(RY);e=i[0],n=i[1]||n}this.indentUnits=n,this._indent=bd(e),this._setPadding()}}return t.\u0275fac=function(e){return new(e||t)(ea(MY),ea(IY),ea(kl),ea(Op,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),t})(),LY=(()=>{class t{constructor(t,e){this._tree=t,this._treeNode=e,this._recursive=!1}get recursive(){return this._recursive}set recursive(t){this._recursive=md(t)}_toggle(t){this.recursive?this._tree.treeControl.toggleDescendants(this._treeNode.data):this._tree.treeControl.toggle(this._treeNode.data),t.stopPropagation()}}return t.\u0275fac=function(e){return new(e||t)(ea(IY),ea(MY))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeToggle",""]],hostBindings:function(t,e){1&t&&fa("click",function(t){return e._toggle(t)})},inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]}}),t})(),jY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const FY=By(Ly(MY));let BY=(()=>{class t extends FY{constructor(t,e,n){super(t,e),this.tabIndex=Number(n)||0,t.nativeElement.classList.add("mat-tree-node")}ngOnInit(){super.ngOnInit()}ngDoCheck(){super.ngDoCheck()}ngOnDestroy(){super.ngOnDestroy()}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(IY),ii("tabindex"))},t.\u0275dir=se({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[_l([{provide:MY,useExisting:t}]),jo]}),t})(),VY=(()=>{class t extends PY{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodeDef",""]],inputs:{when:["matTreeNodeDefWhen","when"],data:["matTreeNode","data"]},features:[_l([{provide:PY,useExisting:t}]),jo]}),t})(),zY=(()=>{class t extends NY{get level(){return this._level}set level(t){this._setLevelInput(t)}get indent(){return this._indent}set indent(t){this._setIndentInput(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodePadding",""]],inputs:{level:["matTreeNodePadding","level"],indent:["matTreeNodePaddingIndent","indent"]},features:[_l([{provide:NY,useExisting:t}]),jo]}),t})(),UY=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(hc),ea(TY,8))},t.\u0275dir=se({type:t,selectors:[["","matTreeNodeOutlet",""]],features:[_l([{provide:kY,useExisting:t}])]}),t})(),HY=(()=>{class t extends IY{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275cmp=Jt({type:t,selectors:[["mat-tree"]],viewQuery:function(t,e){if(1&t&&qc(UY,7),2&t){let t;Wc(t=Yc())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[_l([{provide:IY,useExisting:t}]),jo],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[UY],styles:[".mat-tree{display:block}.mat-tree-node{display:flex;align-items:center;flex:1;word-wrap:break-word}.mat-nested-tree-node{border-bottom-width:0}\n"],encapsulation:2}),t})(),$Y=(()=>{class t extends LY{get recursive(){return this._recursive}set recursive(t){this._recursive=md(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["","matTreeNodeToggle",""]],inputs:{recursive:["matTreeNodeToggleRecursive","recursive"]},features:[_l([{provide:LY,useExisting:t}]),jo]}),t})(),GY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[jY,Ny],Ny]}),t})();class WY{constructor(t,e,n,i){this.transformFunction=t,this.getLevel=e,this.isExpandable=n,this.getChildren=i}_flattenNode(t,e,n,i){const r=this.transformFunction(t,e);if(n.push(r),this.isExpandable(r)){const r=this.getChildren(t);r&&(Array.isArray(r)?this._flattenChildren(r,e,n,i):r.pipe(Gp(1)).subscribe(t=>{this._flattenChildren(t,e,n,i)}))}return n}_flattenChildren(t,e,n,i){t.forEach((r,s)=>{let o=i.slice();o.push(s!=t.length-1),this._flattenNode(r,e+1,n,o)})}flattenNodes(t){let e=[];return t.forEach(t=>this._flattenNode(t,0,e,[])),e}expandFlattenedNodes(t,e){let n=[],i=[];return i[0]=!0,t.forEach(t=>{let r=!0;for(let e=0;e<=this.getLevel(t);e++)r=r&&i[e];r&&n.push(t),this.isExpandable(t)&&(i[this.getLevel(t)+1]=e.isExpanded(t))}),n}}class qY extends class{}{constructor(t,e,n){super(),this._treeControl=t,this._treeFlattener=e,this._flattenedData=new Uf([]),this._expandedData=new Uf([]),this._data=new Uf([]),n&&(this.data=n)}get data(){return this._data.value}set data(t){this._data.next(t),this._flattenedData.next(this._treeFlattener.flattenNodes(this.data)),this._treeControl.dataNodes=this._flattenedData.value}connect(t){return Q(t.viewChange,this._treeControl.expansionModel.changed,this._flattenedData).pipe(D(()=>(this._expandedData.next(this._treeFlattener.expandFlattenedNodes(this._flattenedData.value,this._treeControl)),this._expandedData.value)))}disconnect(){}}let XY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,rw,GY,fG]]}),t})(),YY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,CY,XY]]}),t})(),KY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,CY,XY,YY],CY,XY,YY]}),t})();function QY(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function ZY(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(e).forEach(function(n){void 0===t[n]?t[n]=e[n]:QY(e[n])&&QY(t[n])&&Object.keys(e[n]).length>0&&ZY(t[n],e[n])})}var JY={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function tK(){var t="undefined"!=typeof document?document:{};return ZY(t,JY),t}var eK={document:JY,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(t){return"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0)},cancelAnimationFrame:function(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function nK(){var t="undefined"!=typeof window?window:{};return ZY(t,eK),t}function iK(t){return(iK=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rK(t,e){return(rK=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function sK(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(m){return!1}}function oK(t,e,n){return(oK=sK()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&rK(r,n.prototype),r}).apply(null,arguments)}function aK(t){var e="function"==typeof Map?new Map:void 0;return(aK=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return oK(t,arguments,iK(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),rK(n,t)})(t)}var lK=function(t){function e(e){var n;return function(t){var e=t.__proto__;Object.defineProperty(t,"__proto__",{get:function(){return e},set:function(t){e.__proto__=t}})}(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n=t.call.apply(t,[this].concat(e))||this)),n}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t),e}(aK(Array));function cK(t){void 0===t&&(t=[]);var e=[];return t.forEach(function(t){Array.isArray(t)?e.push.apply(e,cK(t)):e.push(t)}),e}function uK(t,e){return Array.prototype.filter.call(t,e)}function hK(t,e){var n=nK(),i=tK(),r=[];if(!e&&t instanceof lK)return t;if(!t)return new lK(r);if("string"==typeof t){var s=t.trim();if(s.indexOf("<")>=0&&s.indexOf(">")>=0){var o="div";0===s.indexOf("0}).length>0},toggleClass:function(){for(var t=arguments.length,e=new Array(t),n=0;n=0;p-=1){var f=d[p];s&&f.listener===s||s&&f.listener&&f.listener.dom7proxy&&f.listener.dom7proxy===s?(h.removeEventListener(c,f.proxyListener,o),d.splice(p,1)):s||(h.removeEventListener(c,f.proxyListener,o),d.splice(p,1))}}return this},trigger:function(){for(var t=nK(),e=arguments.length,n=new Array(e),i=0;i0}),c.dispatchEvent(u),c.dom7EventData=[],delete c.dom7EventData}}return this},transitionEnd:function(t){var e=this;return t&&e.on("transitionend",function n(i){i.target===this&&(t.call(this,i),e.off("transitionend",n))}),this},outerWidth:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetWidth+parseFloat(e.getPropertyValue("margin-right"))+parseFloat(e.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetHeight+parseFloat(e.getPropertyValue("margin-top"))+parseFloat(e.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},styles:function(){var t=nK();return this[0]?t.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var t=nK(),e=tK(),n=this[0],i=n.getBoundingClientRect(),r=e.body;return{top:i.top+(n===t?t.scrollY:n.scrollTop)-(n.clientTop||r.clientTop||0),left:i.left+(n===t?t.scrollX:n.scrollLeft)-(n.clientLeft||r.clientLeft||0)}}return null},css:function(t,e){var n,i=nK();if(1===arguments.length){if("string"!=typeof t){for(n=0;ne-1)return hK([]);if(t<0){var n=e+t;return hK(n<0?[]:[this[n]])}return hK([this[t]])},append:function(){for(var t,e=tK(),n=0;n=0;n-=1)this[e].insertBefore(r.childNodes[n],this[e].childNodes[0])}else if(t instanceof lK)for(n=0;n0?t?this[0].nextElementSibling&&hK(this[0].nextElementSibling).is(t)?hK([this[0].nextElementSibling]):hK([]):hK(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):hK([])},nextAll:function(t){var e=[],n=this[0];if(!n)return hK([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;t?hK(i).is(t)&&e.push(i):e.push(i),n=i}return hK(e)},prev:function(t){if(this.length>0){var e=this[0];return t?e.previousElementSibling&&hK(e.previousElementSibling).is(t)?hK([e.previousElementSibling]):hK([]):hK(e.previousElementSibling?[e.previousElementSibling]:[])}return hK([])},prevAll:function(t){var e=[],n=this[0];if(!n)return hK([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;t?hK(i).is(t)&&e.push(i):e.push(i),n=i}return hK(e)},parent:function(t){for(var e=[],n=0;n=0,observer:"MutationObserver"in t||"WebkitMutationObserver"in t,passiveListener:function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});t.addEventListener("testPassiveListener",null,n)}catch(i){}return e}(),gestures:"ongesturestart"in t}}()),gK}function OK(t){return void 0===t&&(t={}),mK||(mK=function(t){var e=(void 0===t?{}:t).userAgent,n=CK(),i=nK(),r=i.navigator.platform,s=e||i.navigator.userAgent,o={ios:!1,android:!1},a=i.screen.width,l=i.screen.height,c=s.match(/(Android);?[\s\/]+([\d.]+)?/),u=s.match(/(iPad).*OS\s([\d_]+)/),h=s.match(/(iPod)(.*OS\s([\d_]+))?/),d=!u&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),p="Win32"===r,f="MacIntel"===r;return!u&&f&&n.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(a+"x"+l)>=0&&((u=s.match(/(Version)\/([\d.]+)/))||(u=[0,1,"13_0_0"]),f=!1),c&&!p&&(o.os="android",o.android=!0),(u||d||h)&&(o.os="ios",o.ios=!0),o}(t)),mK}function TK(){return bK||(bK=function(){var t,e=nK();return{isEdge:!!e.navigator.userAgent.match(/Edge/g),isSafari:(t=e.navigator.userAgent.toLowerCase(),t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0),isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),bK}var kK={name:"resize",create:function(){var t=this;SK(t,{resize:{observer:null,createObserver:function(){!t||t.destroyed||!t.initialized||(t.resize.observer=new ResizeObserver(function(e){var n=t.width,i=t.height,r=n,s=i;e.forEach(function(e){var n=e.contentBoxSize,i=e.contentRect,o=e.target;o&&o!==t.el||(r=i?i.width:(n[0]||n).inlineSize,s=i?i.height:(n[0]||n).blockSize)}),(r!==n||s!==i)&&t.resize.resizeHandler()}),t.resize.observer.observe(t.el))},removeObserver:function(){t.resize.observer&&t.resize.observer.unobserve&&t.el&&(t.resize.observer.unobserve(t.el),t.resize.observer=null)},resizeHandler:function(){!t||t.destroyed||!t.initialized||(t.emit("beforeResize"),t.emit("resize"))},orientationChangeHandler:function(){!t||t.destroyed||!t.initialized||t.emit("orientationchange")}}})},on:{init:function(t){var e=nK();t.params.resizeObserver&&void 0!==nK().ResizeObserver?t.resize.createObserver():(e.addEventListener("resize",t.resize.resizeHandler),e.addEventListener("orientationchange",t.resize.orientationChangeHandler))},destroy:function(t){var e=nK();t.resize.removeObserver(),e.removeEventListener("resize",t.resize.resizeHandler),e.removeEventListener("orientationchange",t.resize.orientationChangeHandler)}}};function AK(){return(AK=Object.assign||function(t){for(var e=1;e0)&&(!r.isTouched||!r.isMoved))){s.noSwipingClass&&""!==s.noSwipingClass&&a.target&&a.target.shadowRoot&&t.path&&t.path[0]&&(l=yK(t.path[0]));var c=s.noSwipingSelector?s.noSwipingSelector:"."+s.noSwipingClass;if(s.noSwiping&&(a.target&&a.target.shadowRoot?function(t,e){return void 0===e&&(e=this),function e(n){return n&&n!==tK()&&n!==nK()?(n.assignedSlot&&(n=n.assignedSlot),n.closest(t)||e(n.getRootNode().host)):null}(e)}(c,a.target):l.closest(c)[0]))return void(e.allowClick=!0);if(!s.swipeHandler||l.closest(s.swipeHandler)[0]){o.currentX="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,o.currentY="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY;var u=o.currentX,h=o.currentY,d=s.edgeSwipeDetection||s.iOSEdgeSwipeDetection,p=s.edgeSwipeThreshold||s.iOSEdgeSwipeThreshold;if(d&&(u<=p||u>=i.innerWidth-p)){if("prevent"!==d)return;t.preventDefault()}if(SK(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=u,o.startY=h,r.touchStartTime=_K(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,s.threshold>0&&(r.allowThresholdMove=!1),"touchstart"!==a.type){var f=!0;l.is(r.focusableElements)&&(f=!1),n.activeElement&&yK(n.activeElement).is(r.focusableElements)&&n.activeElement!==l[0]&&n.activeElement.blur(),(s.touchStartForcePreventDefault||f&&e.allowTouchMove&&s.touchStartPreventDefault)&&!l[0].isContentEditable&&a.preventDefault()}e.emit("touchStart",a)}}}}function DK(t){var e=tK(),n=this,i=n.touchEventsData,r=n.params,s=n.touches,o=n.rtlTranslate;if(n.enabled){var a=t;if(a.originalEvent&&(a=a.originalEvent),!i.isTouched)return void(i.startMoving&&i.isScrolling&&n.emit("touchMoveOpposite",a));if(!i.isTouchEvent||"touchmove"===a.type){var l="touchmove"===a.type&&a.targetTouches&&(a.targetTouches[0]||a.changedTouches[0]),c="touchmove"===a.type?l.pageX:a.pageX,u="touchmove"===a.type?l.pageY:a.pageY;if(a.preventedByNestedSwiper)return s.startX=c,void(s.startY=u);if(!n.allowTouchMove)return n.allowClick=!1,void(i.isTouched&&(SK(s,{startX:c,startY:u,currentX:c,currentY:u}),i.touchStartTime=_K()));if(i.isTouchEvent&&r.touchReleaseOnEdges&&!r.loop)if(n.isVertical()){if(us.startY&&n.translate>=n.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(cs.startX&&n.translate>=n.minTranslate())return;if(i.isTouchEvent&&e.activeElement&&a.target===e.activeElement&&yK(a.target).is(i.focusableElements))return i.isMoved=!0,void(n.allowClick=!1);if(i.allowTouchCallbacks&&n.emit("touchMove",a),!(a.targetTouches&&a.targetTouches.length>1)){s.currentX=c,s.currentY=u;var h=s.currentX-s.startX,d=s.currentY-s.startY;if(!(n.params.threshold&&Math.sqrt(Math.pow(h,2)+Math.pow(d,2))=25&&(p=180*Math.atan2(Math.abs(d),Math.abs(h))/Math.PI,i.isScrolling=n.isHorizontal()?p>r.touchAngle:90-p>r.touchAngle)),i.isScrolling&&n.emit("touchMoveOpposite",a),void 0===i.startMoving&&(s.currentX!==s.startX||s.currentY!==s.startY)&&(i.startMoving=!0),i.isScrolling)return void(i.isTouched=!1);if(i.startMoving){n.allowClick=!1,!r.cssMode&&a.cancelable&&a.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&a.stopPropagation(),i.isMoved||(r.loop&&n.loopFix(),i.startTranslate=n.getTranslate(),n.setTransition(0),n.animating&&n.$wrapperEl.trigger("webkitTransitionEnd transitionend"),i.allowMomentumBounce=!1,r.grabCursor&&(!0===n.allowSlideNext||!0===n.allowSlidePrev)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",a)),n.emit("sliderMove",a),i.isMoved=!0;var f=n.isHorizontal()?h:d;s.diff=f,f*=r.touchRatio,o&&(f=-f),n.swipeDirection=f>0?"prev":"next",i.currentTranslate=f+i.startTranslate;var g=!0,m=r.resistanceRatio;if(r.touchReleaseOnEdges&&(m=0),f>0&&i.currentTranslate>n.minTranslate()?(g=!1,r.resistance&&(i.currentTranslate=n.minTranslate()-1+Math.pow(-n.minTranslate()+i.startTranslate+f,m))):f<0&&i.currentTranslatei.startTranslate&&(i.currentTranslate=i.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(f)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,i.currentTranslate=i.startTranslate,void(s.diff=n.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}!r.followFinger||r.cssMode||((r.freeMode||r.watchSlidesProgress||r.watchSlidesVisibility)&&(n.updateActiveIndex(),n.updateSlidesClasses()),r.freeMode&&(0===i.velocities.length&&i.velocities.push({position:s[n.isHorizontal()?"startX":"startY"],time:i.touchStartTime}),i.velocities.push({position:s[n.isHorizontal()?"currentX":"currentY"],time:_K()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function RK(t){var e=this,n=e.touchEventsData,i=e.params,r=e.touches,s=e.rtlTranslate,o=e.$wrapperEl,a=e.slidesGrid,l=e.snapGrid;if(e.enabled){var c=t;if(c.originalEvent&&(c=c.originalEvent),n.allowTouchCallbacks&&e.emit("touchEnd",c),n.allowTouchCallbacks=!1,!n.isTouched)return n.isMoved&&i.grabCursor&&e.setGrabCursor(!1),n.isMoved=!1,void(n.startMoving=!1);i.grabCursor&&n.isMoved&&n.isTouched&&(!0===e.allowSlideNext||!0===e.allowSlidePrev)&&e.setGrabCursor(!1);var u,h=_K(),d=h-n.touchStartTime;if(e.allowClick&&(e.updateClickedSlide(c),e.emit("tap click",c),d<300&&h-n.lastClickTime<300&&e.emit("doubleTap doubleClick",c)),n.lastClickTime=_K(),vK(function(){e.destroyed||(e.allowClick=!0)}),!n.isTouched||!n.isMoved||!e.swipeDirection||0===r.diff||n.currentTranslate===n.startTranslate)return n.isTouched=!1,n.isMoved=!1,void(n.startMoving=!1);if(n.isTouched=!1,n.isMoved=!1,n.startMoving=!1,u=i.followFinger?s?e.translate:-e.translate:-n.currentTranslate,!i.cssMode){if(i.freeMode){if(u<-e.minTranslate())return void e.slideTo(e.activeIndex);if(u>-e.maxTranslate())return void e.slideTo(e.slides.length1){var p=n.velocities.pop(),f=n.velocities.pop(),g=p.time-f.time;e.velocity=(p.position-f.position)/g,e.velocity/=2,Math.abs(e.velocity)150||_K()-p.time>300)&&(e.velocity=0)}else e.velocity=0;e.velocity*=i.freeModeMomentumVelocityRatio,n.velocities.length=0;var m=1e3*i.freeModeMomentumRatio,b=e.translate+e.velocity*m;s&&(b=-b);var y,v,_=!1,w=20*Math.abs(e.velocity)*i.freeModeMomentumBounceRatio;if(be.minTranslate())i.freeModeMomentumBounce?(b-e.minTranslate()>w&&(b=e.minTranslate()+w),y=e.minTranslate(),_=!0,n.allowMomentumBounce=!0):b=e.minTranslate(),i.loop&&i.centeredSlides&&(v=!0);else if(i.freeModeSticky){for(var x,S=0;S-b){x=S;break}b=-(b=Math.abs(l[x]-b)=i.longSwipesMs)&&(e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses()))}for(var O=0,T=e.slidesSizesGrid[0],k=0;k=a[k]&&u=a[k]&&(O=k,T=a[a.length-1]-a[a.length-2])}var P=(u-a[O])/T,I=Oi.longSwipesMs){if(!i.longSwipes)return void e.slideTo(e.activeIndex);"next"===e.swipeDirection&&e.slideTo(P>=i.longSwipesRatio?O+I:O),"prev"===e.swipeDirection&&e.slideTo(P>1-i.longSwipesRatio?O+I:O)}else{if(!i.shortSwipes)return void e.slideTo(e.activeIndex);!e.navigation||c.target!==e.navigation.nextEl&&c.target!==e.navigation.prevEl?("next"===e.swipeDirection&&e.slideTo(O+I),"prev"===e.swipeDirection&&e.slideTo(O)):e.slideTo(c.target===e.navigation.nextEl?O+I:O)}}}}function NK(){var t=this,e=t.params,n=t.el;if(!n||0!==n.offsetWidth){e.breakpoints&&t.setBreakpoint();var i=t.allowSlideNext,r=t.allowSlidePrev,s=t.snapGrid;t.allowSlideNext=!0,t.allowSlidePrev=!0,t.updateSize(),t.updateSlides(),t.updateSlidesClasses(),t.slideTo(("auto"===e.slidesPerView||e.slidesPerView>1)&&t.isEnd&&!t.isBeginning&&!t.params.centeredSlides?t.slides.length-1:t.activeIndex,0,!1,!0),t.autoplay&&t.autoplay.running&&t.autoplay.paused&&t.autoplay.run(),t.allowSlidePrev=r,t.allowSlideNext=i,t.params.watchOverflow&&s!==t.snapGrid&&t.checkOverflow()}}function LK(t){var e=this;!e.enabled||e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation()))}function jK(){var t=this,e=t.wrapperEl,n=t.rtlTranslate;if(t.enabled){t.previousTranslate=t.translate,t.translate=t.isHorizontal()?n?e.scrollWidth-e.offsetWidth-e.scrollLeft:-e.scrollLeft:-e.scrollTop,-0===t.translate&&(t.translate=0),t.updateActiveIndex(),t.updateSlidesClasses();var i=t.maxTranslate()-t.minTranslate();(0===i?0:(t.translate-t.minTranslate())/i)!==t.progress&&t.updateProgress(n?-t.translate:t.translate),t.emit("setTranslate",t.translate,!1)}}var FK=!1;function BK(){}var VK={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!1,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,slidesPerGroupSkip:0,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,loopPreventsSlide:!0,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0,_emitClasses:!1};function zK(t,e){for(var n=0;n=0&&e.eventsAnyListeners.splice(n,1),e},off:function(t,e){var n=this;return n.eventsListeners&&t.split(" ").forEach(function(t){void 0===e?n.eventsListeners[t]=[]:n.eventsListeners[t]&&n.eventsListeners[t].forEach(function(i,r){(i===e||i.__emitterProxy&&i.__emitterProxy===e)&&n.eventsListeners[t].splice(r,1)})}),n},emit:function(){var t=this;if(!t.eventsListeners)return t;for(var e,n,i,r=arguments.length,s=new Array(r),o=0;o=0&&(v=parseFloat(v.replace("%",""))/100*s),t.virtualSize=-v,u.css(o?{marginLeft:"",marginBottom:"",marginTop:""}:{marginRight:"",marginBottom:"",marginTop:""}),i.slidesPerColumn>1&&(S=Math.floor(h/i.slidesPerColumn)===h/t.params.slidesPerColumn?h:Math.ceil(h/i.slidesPerColumn)*i.slidesPerColumn,"auto"!==i.slidesPerView&&"row"===i.slidesPerColumnFill&&(S=Math.max(S,i.slidesPerView*i.slidesPerColumn)));for(var T,k=i.slidesPerColumn,A=S/k,P=Math.floor(h/i.slidesPerColumn),I=0;I1){var D=void 0,R=void 0,N=void 0;if("row"===i.slidesPerColumnFill&&i.slidesPerGroup>1){var L=Math.floor(I/(i.slidesPerGroup*i.slidesPerColumn)),j=I-i.slidesPerColumn*i.slidesPerGroup*L,F=0===L?i.slidesPerGroup:Math.min(Math.ceil((h-L*k*i.slidesPerGroup)/k),i.slidesPerGroup);N=Math.floor(j/F),M.css({"-webkit-box-ordinal-group":D=(R=j-N*F+L*i.slidesPerGroup)+N*S/k,"-moz-box-ordinal-group":D,"-ms-flex-order":D,"-webkit-order":D,order:D})}else"column"===i.slidesPerColumnFill?(N=I-(R=Math.floor(I/k))*k,(R>P||R===P&&N===k-1)&&(N+=1)>=k&&(N=0,R+=1)):R=I-(N=Math.floor(I/A))*A;M.css(e("margin-top"),0!==N?i.spaceBetween&&i.spaceBetween+"px":"")}if("none"!==M.css("display")){if("auto"===i.slidesPerView){var B=getComputedStyle(M[0]),V=M[0].style.transform,z=M[0].style.webkitTransform;if(V&&(M[0].style.transform="none"),z&&(M[0].style.webkitTransform="none"),i.roundLengths)T=t.isHorizontal()?M.outerWidth(!0):M.outerHeight(!0);else{var U=n(B,"width"),H=n(B,"padding-left"),$=n(B,"padding-right"),G=n(B,"margin-left"),W=n(B,"margin-right"),q=B.getPropertyValue("box-sizing");if(q&&"border-box"===q)T=U+G+W;else{var X=M[0];T=U+H+$+G+W+(X.offsetWidth-X.clientWidth)}}V&&(M[0].style.transform=V),z&&(M[0].style.webkitTransform=z),i.roundLengths&&(T=Math.floor(T))}else T=(s-(i.slidesPerView-1)*v)/i.slidesPerView,i.roundLengths&&(T=Math.floor(T)),u[I]&&(u[I].style[e("width")]=T+"px");u[I]&&(u[I].swiperSlideSize=T),f.push(T),i.centeredSlides?(_=_+T/2+w/2+v,0===w&&0!==I&&(_=_-s/2-v),0===I&&(_=_-s/2-v),Math.abs(_)<.001&&(_=0),i.roundLengths&&(_=Math.floor(_)),x%i.slidesPerGroup==0&&d.push(_),p.push(_)):(i.roundLengths&&(_=Math.floor(_)),(x-Math.min(t.params.slidesPerGroupSkip,x))%t.params.slidesPerGroup==0&&d.push(_),p.push(_),_=_+T+v),t.virtualSize+=T+v,w=T,x+=1}}if(t.virtualSize=Math.max(t.virtualSize,s)+m,o&&a&&("slide"===i.effect||"coverflow"===i.effect)&&r.css({width:t.virtualSize+i.spaceBetween+"px"}),i.setWrapperSize&&r.css(((C={})[e("width")]=t.virtualSize+i.spaceBetween+"px",C)),i.slidesPerColumn>1&&(t.virtualSize=(T+i.spaceBetween)*S,t.virtualSize=Math.ceil(t.virtualSize/i.slidesPerColumn)-i.spaceBetween,r.css(((O={})[e("width")]=t.virtualSize+i.spaceBetween+"px",O)),i.centeredSlides)){E=[];for(var Y=0;Y1&&d.push(t.virtualSize-s)}if(0===d.length&&(d=[0]),0!==i.spaceBetween){var J,tt=t.isHorizontal()&&o?"marginLeft":e("marginRight");u.filter(function(t,e){return!i.cssMode||e!==u.length-1}).css(((J={})[tt]=v+"px",J))}if(i.centeredSlides&&i.centeredSlidesBounds){var et=0;f.forEach(function(t){et+=t+(i.spaceBetween?i.spaceBetween:0)});var nt=(et-=i.spaceBetween)-s;d=d.map(function(t){return t<0?-g:t>nt?nt+m:t})}if(i.centerInsufficientSlides){var it=0;if(f.forEach(function(t){it+=t+(i.spaceBetween?i.spaceBetween:0)}),(it-=i.spaceBetween)1)if(n.params.centeredSlides)n.visibleSlides.each(function(t){i.push(t)});else for(e=0;en.slides.length&&!r)break;i.push(o(a))}else i.push(o(n.activeIndex));for(e=0;es?l:s}s&&n.$wrapperEl.css("height",s+"px")},updateSlidesOffset:function(){for(var t=this.slides,e=0;e=0&&c1&&u<=e.size||c<=0&&u>=e.size)&&(e.visibleSlides.push(a),e.visibleSlidesIndexes.push(o),i.eq(o).addClass(n.slideVisibleClass))}a.progress=r?-l:l}e.visibleSlides=yK(e.visibleSlides)}},updateProgress:function(t){var e=this;void 0===t&&(t=e&&e.translate&&e.translate*(e.rtlTranslate?-1:1)||0);var n=e.params,i=e.maxTranslate()-e.minTranslate(),r=e.progress,s=e.isBeginning,o=e.isEnd,a=s,l=o;0===i?(r=0,s=!0,o=!0):(s=(r=(t-e.minTranslate())/i)<=0,o=r>=1),SK(e,{progress:r,isBeginning:s,isEnd:o}),(n.watchSlidesProgress||n.watchSlidesVisibility||n.centeredSlides&&n.autoHeight)&&e.updateSlidesProgress(t),s&&!a&&e.emit("reachBeginning toEdge"),o&&!l&&e.emit("reachEnd toEdge"),(a&&!s||l&&!o)&&e.emit("fromEdge"),e.emit("progress",r)},updateSlidesClasses:function(){var t,e=this,n=e.slides,i=e.params,r=e.$wrapperEl,s=e.activeIndex,o=e.realIndex,a=e.virtual&&i.virtual.enabled;n.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(t=a?e.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+s+'"]'):n.eq(s)).addClass(i.slideActiveClass),i.loop&&(t.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+o+'"]').addClass(i.slideDuplicateActiveClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+o+'"]').addClass(i.slideDuplicateActiveClass));var l=t.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===l.length&&(l=n.eq(0)).addClass(i.slideNextClass);var c=t.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===c.length&&(c=n.eq(-1)).addClass(i.slidePrevClass),i.loop&&(l.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),c.hasClass(i.slideDuplicateClass)?r.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):r.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+c.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass)),e.emitSlidesClasses()},updateActiveIndex:function(t){var e,n=this,i=n.rtlTranslate?n.translate:-n.translate,r=n.slidesGrid,s=n.snapGrid,o=n.params,a=n.activeIndex,l=n.realIndex,c=n.snapIndex,u=t;if(void 0===u){for(var h=0;h=r[h]&&i=r[h]&&i=r[h]&&(u=h);o.normalizeSlideIndex&&(u<0||void 0===u)&&(u=0)}if(s.indexOf(i)>=0)e=s.indexOf(i);else{var d=Math.min(o.slidesPerGroupSkip,u);e=d+Math.floor((u-d)/o.slidesPerGroup)}if(e>=s.length&&(e=s.length-1),u!==a){var p=parseInt(n.slides.eq(u).attr("data-swiper-slide-index")||u,10);SK(n,{snapIndex:e,realIndex:p,previousIndex:a,activeIndex:u}),n.emit("activeIndexChange"),n.emit("snapIndexChange"),l!==p&&n.emit("realIndexChange"),(n.initialized||n.params.runCallbacksOnInit)&&n.emit("slideChange")}else e!==c&&(n.snapIndex=e,n.emit("snapIndexChange"))},updateClickedSlide:function(t){var e,n=this,i=n.params,r=yK(t.target).closest("."+i.slideClass)[0],s=!1;if(r)for(var o=0;o6&&(i=i.split(", ").map(function(t){return t.replace(",",".")}).join(", ")),r=new s.WebKitCSSMatrix("none"===i?"":i)):n=(r=o.MozTransform||o.OTransform||o.MsTransform||o.msTransform||o.transform||o.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===e&&(i=s.WebKitCSSMatrix?r.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===e&&(i=s.WebKitCSSMatrix?r.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),i||0}(e.$wrapperEl[0],t);return i&&(s=-s),s||0},setTranslate:function(t,e){var n=this,i=n.rtlTranslate,r=n.params,s=n.$wrapperEl,o=n.wrapperEl,a=n.progress,l=0,c=0;n.isHorizontal()?l=i?-t:t:c=t,r.roundLengths&&(l=Math.floor(l),c=Math.floor(c)),r.cssMode?o[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-l:-c:r.virtualTranslate||s.transform("translate3d("+l+"px, "+c+"px, 0px)"),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?l:c;var u=n.maxTranslate()-n.minTranslate();(0===u?0:(t-n.minTranslate())/u)!==a&&n.updateProgress(t),n.emit("setTranslate",n.translate,e)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(t,e,n,i,r){void 0===t&&(t=0),void 0===e&&(e=this.params.speed),void 0===n&&(n=!0),void 0===i&&(i=!0);var s=this,o=s.params,a=s.wrapperEl;if(s.animating&&o.preventInteractionOnTransition)return!1;var l,c=s.minTranslate(),u=s.maxTranslate();if(s.updateProgress(l=i&&t>c?c:i&&ts?"next":ir?"next":i=c.length&&(m=c.length-1),(d||l.initialSlide||0)===(h||0)&&n&&o.emit("beforeSlideChangeStart");var b,y=-c[m];if(o.updateProgress(y),l.normalizeSlideIndex)for(var v=0;v=w&&_=w&&_=w&&(a=v)}if(o.initialized&&a!==d&&(!o.allowSlideNext&&yo.translate&&y>o.maxTranslate()&&(d||0)!==a))return!1;if(b=a>d?"next":a=t&&(d=t)}),void 0!==d&&(c=o.indexOf(d))<0&&(c=i.activeIndex-1),i.slideTo(c,t,e,n)},slideReset:function(t,e,n){return void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),this.slideTo(this.activeIndex,t,e,n)},slideToClosest:function(t,e,n,i){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),void 0===i&&(i=.5);var r=this,s=r.activeIndex,o=Math.min(r.params.slidesPerGroupSkip,s),a=o+Math.floor((s-o)/r.params.slidesPerGroup),l=r.rtlTranslate?r.translate:-r.translate;if(l>=r.snapGrid[a]){var c=r.snapGrid[a];l-c>(r.snapGrid[a+1]-c)*i&&(s+=r.params.slidesPerGroup)}else{var u=r.snapGrid[a-1];l-u<=(r.snapGrid[a]-u)*i&&(s-=r.params.slidesPerGroup)}return s=Math.max(s,0),s=Math.min(s,r.slidesGrid.length-1),r.slideTo(s,t,e,n)},slideToClickedSlide:function(){var t,e=this,n=e.params,i=e.$wrapperEl,r="auto"===n.slidesPerView?e.slidesPerViewDynamic():n.slidesPerView,s=e.clickedIndex;if(n.loop){if(e.animating)return;t=parseInt(yK(e.clickedSlide).attr("data-swiper-slide-index"),10),n.centeredSlides?se.slides.length-e.loopedSlides+r/2?(e.loopFix(),s=i.children("."+n.slideClass+'[data-swiper-slide-index="'+t+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),vK(function(){e.slideTo(s)})):e.slideTo(s):s>e.slides.length-r?(e.loopFix(),s=i.children("."+n.slideClass+'[data-swiper-slide-index="'+t+'"]:not(.'+n.slideDuplicateClass+")").eq(0).index(),vK(function(){e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}},loop:{loopCreate:function(){var t=this,e=tK(),n=t.params,i=t.$wrapperEl;i.children("."+n.slideClass+"."+n.slideDuplicateClass).remove();var r=i.children("."+n.slideClass);if(n.loopFillGroupWithBlank){var s=n.slidesPerGroup-r.length%n.slidesPerGroup;if(s!==n.slidesPerGroup){for(var o=0;or.length&&(t.loopedSlides=r.length);var l=[],c=[];r.each(function(e,n){var i=yK(e);n=r.length-t.loopedSlides&&l.push(e),i.attr("data-swiper-slide-index",n)});for(var u=0;u=0;h-=1)i.prepend(yK(l[h].cloneNode(!0)).addClass(n.slideDuplicateClass))},loopFix:function(){var t=this;t.emit("beforeLoopFix");var e,n=t.activeIndex,i=t.slides,r=t.loopedSlides,s=t.allowSlidePrev,o=t.allowSlideNext,a=t.snapGrid,l=t.rtlTranslate;t.allowSlidePrev=!0,t.allowSlideNext=!0;var c=-a[n]-t.getTranslate();n=i.length-r&&(e=-i.length+n+r,t.slideTo(e+=r,0,!1,!0)&&0!==c&&t.setTranslate((l?-t.translate:t.translate)-c)),t.allowSlidePrev=s,t.allowSlideNext=o,t.emit("loopFix")},loopDestroy:function(){var t=this,e=t.params,n=t.slides;t.$wrapperEl.children("."+e.slideClass+"."+e.slideDuplicateClass+",."+e.slideClass+"."+e.slideBlankClass).remove(),n.removeAttr("data-swiper-slide-index")}},grabCursor:{setGrabCursor:function(t){var e=this;if(!(e.support.touch||!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)){var n=e.el;n.style.cursor="move",n.style.cursor=t?"-webkit-grabbing":"-webkit-grab",n.style.cursor=t?"-moz-grabbin":"-moz-grab",n.style.cursor=t?"grabbing":"grab"}},unsetGrabCursor:function(){var t=this;t.support.touch||t.params.watchOverflow&&t.isLocked||t.params.cssMode||(t.el.style.cursor="")}},manipulation:{appendSlide:function(t){var e=this,n=e.$wrapperEl,i=e.params;if(i.loop&&e.loopDestroy(),"object"==typeof t&&"length"in t)for(var r=0;r=o)n.appendSlide(e);else{for(var a=s>t?s+1:s,l=[],c=o-1;c>=t;c-=1){var u=n.slides.eq(c);u.remove(),l.unshift(u)}if("object"==typeof e&&"length"in e){for(var h=0;ht?s+e.length:s}else i.append(e);for(var d=0;d1,d=u.slidesPerColumn>1,p=s.enabled;h&&!d?(o.removeClass(s.containerModifierClass+"multirow "+s.containerModifierClass+"multirow-column"),t.emitContainerClasses()):!h&&d&&(o.addClass(s.containerModifierClass+"multirow"),(u.slidesPerColumnFill&&"column"===u.slidesPerColumnFill||!u.slidesPerColumnFill&&"column"===s.slidesPerColumnFill)&&o.addClass(s.containerModifierClass+"multirow-column"),t.emitContainerClasses());var f=u.direction&&u.direction!==s.direction,g=s.loop&&(u.slidesPerView!==s.slidesPerView||f);f&&n&&t.changeDirection(),SK(t.params,u);var m=t.params.enabled;SK(t,{allowTouchMove:t.params.allowTouchMove,allowSlideNext:t.params.allowSlideNext,allowSlidePrev:t.params.allowSlidePrev}),p&&!m?t.disable():!p&&m&&t.enable(),t.currentBreakpoint=l,t.emit("_beforeBreakpoint",u),g&&n&&(t.loopDestroy(),t.loopCreate(),t.updateSlides(),t.slideTo(e-r+t.loopedSlides,0,!1)),t.emit("breakpoint",u)}}},getBreakpoint:function(t,e,n){if(void 0===e&&(e="window"),t&&("container"!==e||n)){var i=!1,r=nK(),s="window"===e?r.innerHeight:n.clientHeight,o=Object.keys(t).map(function(t){if("string"==typeof t&&0===t.indexOf("@")){var e=parseFloat(t.substr(1));return{value:s*e,point:t}}return{value:t,point:t}});o.sort(function(t,e){return parseInt(t.value,10)-parseInt(e.value,10)});for(var a=0;a0&&e.slidesOffsetBefore+e.spaceBetween*(t.slides.length-1)+t.slides[0].offsetWidth*t.slides.length;t.isLocked=e.slidesOffsetBefore&&e.slidesOffsetAfter&&i?i<=t.size:1===t.snapGrid.length,t.allowSlideNext=!t.isLocked,t.allowSlidePrev=!t.isLocked,n!==t.isLocked&&t.emit(t.isLocked?"lock":"unlock"),n&&n!==t.isLocked&&(t.isEnd=!1,t.navigation&&t.navigation.update())}},classes:{addClasses:function(){var t=this,e=t.classNames,n=t.params,i=t.$el,r=t.device,s=t.support,o=function(t,e){var n=[];return t.forEach(function(t){"object"==typeof t?Object.keys(t).forEach(function(i){t[i]&&n.push(e+i)}):"string"==typeof t&&n.push(e+t)}),n}(["initialized",n.direction,{"pointer-events":s.pointerEvents&&!s.touch},{"free-mode":n.freeMode},{autoheight:n.autoHeight},{rtl:t.rtl},{multirow:n.slidesPerColumn>1},{"multirow-column":n.slidesPerColumn>1&&"column"===n.slidesPerColumnFill},{android:r.android},{ios:r.ios},{"css-mode":n.cssMode}],n.containerModifierClass);e.push.apply(e,o),i.addClass([].concat(e).join(" ")),t.emitContainerClasses()},removeClasses:function(){var t=this;t.$el.removeClass(t.classNames.join(" ")),t.emitContainerClasses()}},images:{loadImage:function(t,e,n,i,r,s){var o,a=nK();function l(){s&&s()}yK(t).parent("picture")[0]||t.complete&&r||!e?l():((o=new a.Image).onload=l,o.onerror=l,i&&(o.sizes=i),n&&(o.srcset=n),e&&(o.src=e))},preloadImages:function(){var t=this;function e(){null==t||!t||t.destroyed||(void 0!==t.imagesLoaded&&(t.imagesLoaded+=1),t.imagesLoaded===t.imagesToLoad.length&&(t.params.updateOnImagesReady&&t.update(),t.emit("imagesReady")))}t.imagesToLoad=t.$el.find("img");for(var n=0;n1){var o=[];return yK(n.el).each(function(e){var i=SK({},n,{el:e});o.push(new t(i))}),o}var a=this;a.__swiper__=!0,a.support=CK(),a.device=OK({userAgent:n.userAgent}),a.browser=TK(),a.eventsListeners={},a.eventsAnyListeners=[],void 0===a.modules&&(a.modules={}),Object.keys(a.modules).forEach(function(t){var e=a.modules[t];if(e.params){var i=Object.keys(e.params)[0],r=e.params[i];if("object"!=typeof r||null===r||(["navigation","pagination","scrollbar"].indexOf(i)>=0&&!0===n[i]&&(n[i]={auto:!0}),!(i in n)||!("enabled"in r)))return;!0===n[i]&&(n[i]={enabled:!0}),"object"==typeof n[i]&&!("enabled"in n[i])&&(n[i].enabled=!0),n[i]||(n[i]={enabled:!1})}});var l,c,u=SK({},VK);return a.useParams(u),a.params=SK({},u,HK,n),a.originalParams=SK({},a.params),a.passedParams=SK({},n),a.params&&a.params.on&&Object.keys(a.params.on).forEach(function(t){a.on(t,a.params.on[t])}),a.params&&a.params.onAny&&a.onAny(a.params.onAny),a.$=yK,SK(a,{enabled:a.params.enabled,el:e,classNames:[],slides:yK(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===a.params.direction},isVertical:function(){return"vertical"===a.params.direction},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEvents:(l=["touchstart","touchmove","touchend","touchcancel"],c=["mousedown","mousemove","mouseup"],a.support.pointerEvents&&(c=["pointerdown","pointermove","pointerup"]),a.touchEventsTouch={start:l[0],move:l[1],end:l[2],cancel:l[3]},a.touchEventsDesktop={start:c[0],move:c[1],end:c[2]},a.support.touch||!a.params.simulateTouch?a.touchEventsTouch:a.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:_K(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.useModules(),a.emit("_swiper"),a.params.init&&a.init(),a}var e=t.prototype;return e.enable=function(){var t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))},e.disable=function(){var t=this;!t.enabled||(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))},e.setProgress=function(t,e){var n=this;t=Math.min(Math.max(t,0),1);var i=n.minTranslate(),r=n.maxTranslate();n.translateTo((r-i)*t+i,void 0===e?0:e),n.updateActiveIndex(),n.updateSlidesClasses()},e.emitContainerClasses=function(){var t=this;if(t.params._emitClasses&&t.el){var e=t.el.className.split(" ").filter(function(e){return 0===e.indexOf("swiper-container")||0===e.indexOf(t.params.containerModifierClass)});t.emit("_containerClasses",e.join(" "))}},e.getSlideClasses=function(t){var e=this;return t.className.split(" ").filter(function(t){return 0===t.indexOf("swiper-slide")||0===t.indexOf(e.params.slideClass)}).join(" ")},e.emitSlidesClasses=function(){var t=this;if(t.params._emitClasses&&t.el){var e=[];t.slides.each(function(n){var i=t.getSlideClasses(n);e.push({slideEl:n,classNames:i}),t.emit("_slideClass",n,i)}),t.emit("_slideClasses",e)}},e.slidesPerViewDynamic=function(){var t=this,e=t.slides,n=t.slidesGrid,i=t.size,r=t.activeIndex,s=1;if(t.params.centeredSlides){for(var o,a=e[r].swiperSlideSize,l=r+1;li&&(o=!0));for(var c=r-1;c>=0;c-=1)e[c]&&!o&&(s+=1,(a+=e[c].swiperSlideSize)>i&&(o=!0))}else for(var u=r+1;u1)&&t.isEnd&&!t.params.centeredSlides?t.slides.length-1:t.activeIndex,0,!1,!0)||i(),n.watchOverflow&&e!==t.snapGrid&&t.checkOverflow(),t.emit("update")}function i(){var e=Math.min(Math.max(t.rtlTranslate?-1*t.translate:t.translate,t.maxTranslate()),t.minTranslate());t.setTranslate(e),t.updateActiveIndex(),t.updateSlidesClasses()}},e.changeDirection=function(t,e){void 0===e&&(e=!0);var n=this,i=n.params.direction;return t||(t="horizontal"===i?"vertical":"horizontal"),t===i||"horizontal"!==t&&"vertical"!==t||(n.$el.removeClass(""+n.params.containerModifierClass+i).addClass(""+n.params.containerModifierClass+t),n.emitContainerClasses(),n.params.direction=t,n.slides.each(function(e){"vertical"===t?e.style.width="":e.style.height=""}),n.emit("changeDirection"),e&&n.update()),n},e.mount=function(t){var e=this;if(e.mounted)return!0;var n=yK(t||e.params.el);if(!(t=n[0]))return!1;t.swiper=e;var i=function(){return"."+(e.params.wrapperClass||"").trim().split(" ").join(".")},r=function(){if(t&&t.shadowRoot&&t.shadowRoot.querySelector){var e=yK(t.shadowRoot.querySelector(i()));return e.children=function(t){return n.children(t)},e}return n.children(i())}();if(0===r.length&&e.params.createElements){var s=tK().createElement("div");r=yK(s),s.className=e.params.wrapperClass,n.append(s),n.children("."+e.params.slideClass).each(function(t){r.append(t)})}return SK(e,{$el:n,el:t,$wrapperEl:r,wrapperEl:r[0],mounted:!0,rtl:"rtl"===t.dir.toLowerCase()||"rtl"===n.css("direction"),rtlTranslate:"horizontal"===e.params.direction&&("rtl"===t.dir.toLowerCase()||"rtl"===n.css("direction")),wrongRTL:"-webkit-box"===r.css("display")}),!0},e.init=function(t){var e=this;return e.initialized||!1===e.mount(t)||(e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.params.loop&&e.loopCreate(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.enabled&&e.setGrabCursor(),e.params.preloadImages&&e.preloadImages(),e.slideTo(e.params.loop?e.params.initialSlide+e.loopedSlides:e.params.initialSlide,0,e.params.runCallbacksOnInit,!1,!0),e.attachEvents(),e.initialized=!0,e.emit("init"),e.emit("afterInit")),e},e.destroy=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0);var n=this,i=n.params,r=n.$el,s=n.$wrapperEl,o=n.slides;return void 0===n.params||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),i.loop&&n.loopDestroy(),e&&(n.removeClasses(),r.removeAttr("style"),s.removeAttr("style"),o&&o.length&&o.removeClass([i.slideVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(function(t){n.off(t)}),!1!==t&&(n.$el[0].swiper=null,function(e){var n=e;Object.keys(n).forEach(function(e){try{n[e]=null}catch(t){}try{delete n[e]}catch(t){}})}(n)),n.destroyed=!0),null},t.extendDefaults=function(t){SK(HK,t)},t.installModule=function(e){t.prototype.modules||(t.prototype.modules={});var n=e.name||Object.keys(t.prototype.modules).length+"_"+_K();t.prototype.modules[n]=e},t.use=function(e){return Array.isArray(e)?(e.forEach(function(e){return t.installModule(e)}),t):(t.installModule(e),t)},function(t,e,n){n&&zK(t,n)}(t,0,[{key:"extendedDefaults",get:function(){return HK}},{key:"defaults",get:function(){return VK}}]),t}();Object.keys(UK).forEach(function(t){Object.keys(UK[t]).forEach(function(e){$K.prototype[e]=UK[t][e]})}),$K.use([kK,IK]);var GK=$K;const WK=["prevElRef"],qK=["nextElRef"],XK=["scrollbarElRef"],YK=["paginationElRef"];function KK(t,e){1&t&&(aa(0),oa(1,"div",6,7),oa(3,"div",8,9),la())}function QK(t,e){1&t&&oa(0,"div",10,11)}function ZK(t,e){1&t&&oa(0,"div",12,13)}function JK(t,e){}function tQ(t,e){1&t&&Jo(0,JK,0,0,"ng-template")}function eQ(t,e){}function nQ(t,e){1&t&&Jo(0,eQ,0,0,"ng-template")}function iQ(t,e){}function rQ(t,e){1&t&&Jo(0,iQ,0,0,"ng-template")}function sQ(t,e){}const oQ=function(t){return{$implicit:t}};function aQ(t,e){if(1&t&&(ra(0,"div",3),Jo(1,sQ,0,0,"ng-template",18),sa()),2&t){const t=va().$implicit;na("ngClass",va(2).zoomContainerClass),ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Tc(3,oQ,t.slideData))}}function lQ(t,e){}function cQ(t,e){if(1&t&&(aa(0),Jo(1,lQ,0,0,"ng-template",18),la()),2&t){const t=va().$implicit;ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Tc(2,oQ,t.slideData))}}function uQ(t,e){if(1&t&&(ra(0,"div",15),Jo(1,aQ,2,5,"div",16),Jo(2,cQ,2,4,"ng-container",17),sa()),2&t){const t=e.$implicit,n=va().key,i=va();(function(t){Ua(qa,Fa,t,!1)})(i.style),na("ngClass",(t.class?t.class+" ":"")+i.slideClass+(""!==n?" "+i.slideDuplicateClass:""))("ngSwitch",t.zoom),Ko("data-swiper-slide-index",t.virtualIndex?t.virtualIndex:t.slideIndex),ws(1),na("ngSwitchCase",!0)}}function hQ(t,e){1&t&&(Jo(0,uQ,3,6,"div",14),Ic(1,"async")),2&t&&na("ngForOf",Mc(1,1,e.loopSlides))}const dQ=[[["","slot","container-start"]],[["","slot","wrapper-start"]],[["","slot","wrapper-end"]],[["","slot","container-end"]]],pQ=function(t){return{loopSlides:t,key:"prepend"}},fQ=function(t){return{loopSlides:t,key:""}},gQ=function(t){return{loopSlides:t,key:"append"}},mQ=["[slot=container-start]","[slot=wrapper-start]","[slot=wrapper-end]","[slot=container-end]"];function bQ(t){return"object"==typeof t&&null!==t&&t.constructor&&"Object"===Object.prototype.toString.call(t).slice(8,-1)}function yQ(t,e,n){return!0===_Q(t)&&e&&!e.el||!("boolean"!=typeof e&&e.el!==(null==n?void 0:n.nativeElement)&&("string"==typeof e.el||"object"==typeof e.el))}function vQ(t,e){const n=["__proto__","constructor","prototype"];Object.keys(e).filter(t=>n.indexOf(t)<0).forEach(n=>{void 0!==t[n]?t[n]&&!e[n]||(bQ(e[n])&&bQ(t[n])&&Object.keys(e[n]).length>0?e[n].__swiper__?t[n]=e[n]:vQ(t[n],e[n]):t[n]=e[n]):t[n]=e[n]})}function _Q(t){return null!=t&&"false"!=`${t}`}const wQ=["pagination","navigation","scrollbar","virtual"];function xQ(t,e={}){return bQ(t)?t:!0===_Q(t)&&e}const SQ=["init","_direction","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_freeModeMomentum","_freeModeMomentumRatio","_freeModeMomentumBounce","_freeModeMomentumBounceRatio","_freeModeMomentumVelocityRatio","_freeModeSticky","_freeModeMinimumVelocity","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","_slidesPerColumn","_slidesPerColumnFill","_slidesPerGroup","_slidesPerGroupSkip","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_watchSlidesVisibility","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_preloadImages","updateOnImagesReady","_loop","_loopAdditionalSlides","_loopedSlides","_loopFillGroupWithBlank","loopPreventsSlide","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","hashNavigation","history","keyboard","lazy","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom"].map(t=>t.replace(/_/,""));function EQ(t={}){const e={on:{}},n={};vQ(e,GK.defaults),vQ(e,GK.extendedDefaults),e._emitClasses=!0;const i={};return Object.keys(t).forEach(r=>{const s=r.replace(/^_/,"");void 0!==t[s]&&(SQ.indexOf(s)>=0?bQ(t[s])?(e[s]={},n[s]={},vQ(e[s],t[s]),vQ(n[s],t[s])):(e[s]=t[s],n[s]=t[s]):i[s]=t[s])}),{params:e,passedParams:n,rest:i}}let CQ=(()=>{class t{constructor(t){this.template=t,this.class="",this.slideData={isActive:!1,isPrev:!1,isNext:!1,isVisible:!1,isDuplicate:!1}}set zoom(t){this._zoom=_Q(t)}get zoom(){return this._zoom}get classNames(){return this._classNames}set classNames(t){this._classNames!==t&&(this._classNames=t,this.slideData={isActive:this._hasClass(["swiper-slide-active","swiper-slide-duplicate-active"]),isVisible:this._hasClass(["swiper-slide-visible"]),isDuplicate:this._hasClass(["swiper-slide-duplicate"]),isPrev:this._hasClass(["swiper-slide-prev","swiper-slide-duplicate-prev"]),isNext:this._hasClass(["swiper-slide-next","swiper-slide-duplicate-next"])})}_hasClass(t){return t.some(t=>this._classNames.indexOf(t)>=0)}}return t.\u0275fac=function(e){return new(e||t)(ea(sc))},t.\u0275dir=se({type:t,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),t})(),OQ=(()=>{class t{constructor(t,e,n,i){this._ngZone=t,this.elementRef=e,this._changeDetectorRef=n,this._platformId=i,this.slideClass="swiper-slide",this.wrapperClass="swiper-wrapper",this.showNavigation=!0,this.showPagination=!0,this.showScrollbar=!0,this.s__beforeBreakpoint=new Rc,this.s__containerClasses=new Rc,this.s__slideClass=new Rc,this.s__swiper=new Rc,this.s_activeIndexChange=new Rc,this.s_afterInit=new Rc,this.s_autoplay=new Rc,this.s_autoplayStart=new Rc,this.s_autoplayStop=new Rc,this.s_beforeDestroy=new Rc,this.s_beforeInit=new Rc,this.s_beforeLoopFix=new Rc,this.s_beforeResize=new Rc,this.s_beforeSlideChangeStart=new Rc,this.s_beforeTransitionStart=new Rc,this.s_breakpoint=new Rc,this.s_changeDirection=new Rc,this.s_click=new Rc,this.s_doubleTap=new Rc,this.s_doubleClick=new Rc,this.s_destroy=new Rc,this.s_fromEdge=new Rc,this.s_hashChange=new Rc,this.s_hashSet=new Rc,this.s_imagesReady=new Rc,this.s_init=new Rc,this.s_keyPress=new Rc,this.s_lazyImageLoad=new Rc,this.s_lazyImageReady=new Rc,this.s_loopFix=new Rc,this.s_momentumBounce=new Rc,this.s_navigationHide=new Rc,this.s_navigationShow=new Rc,this.s_observerUpdate=new Rc,this.s_orientationchange=new Rc,this.s_paginationHide=new Rc,this.s_paginationRender=new Rc,this.s_paginationShow=new Rc,this.s_paginationUpdate=new Rc,this.s_progress=new Rc,this.s_reachBeginning=new Rc,this.s_reachEnd=new Rc,this.s_realIndexChange=new Rc,this.s_resize=new Rc,this.s_scroll=new Rc,this.s_scrollbarDragEnd=new Rc,this.s_scrollbarDragMove=new Rc,this.s_scrollbarDragStart=new Rc,this.s_setTransition=new Rc,this.s_setTranslate=new Rc,this.s_slideChange=new Rc,this.s_slideChangeTransitionEnd=new Rc,this.s_slideChangeTransitionStart=new Rc,this.s_slideNextTransitionEnd=new Rc,this.s_slideNextTransitionStart=new Rc,this.s_slidePrevTransitionEnd=new Rc,this.s_slidePrevTransitionStart=new Rc,this.s_slideResetTransitionStart=new Rc,this.s_slideResetTransitionEnd=new Rc,this.s_sliderMove=new Rc,this.s_sliderFirstMove=new Rc,this.s_slidesLengthChange=new Rc,this.s_slidesGridLengthChange=new Rc,this.s_snapGridLengthChange=new Rc,this.s_snapIndexChange=new Rc,this.s_tap=new Rc,this.s_toEdge=new Rc,this.s_touchEnd=new Rc,this.s_touchMove=new Rc,this.s_touchMoveOpposite=new Rc,this.s_touchStart=new Rc,this.s_transitionEnd=new Rc,this.s_transitionStart=new Rc,this.s_update=new Rc,this.s_zoomChange=new Rc,this.s_swiper=new Rc,this.indexChange=new Rc,this._activeSlides=new P,this.containerClasses="swiper-container",this.slidesChanges=t=>{this.slides=t.map((t,e)=>(t.slideIndex=e,t.classNames=this.slideClass,t)),this.loop&&!this.loopedSlides&&this.calcLoopedSlides(),this.virtual?this.swiperRef&&this.swiperRef.virtual&&this._ngZone.runOutsideAngular(()=>{this.swiperRef.virtual.slides=this.slides,this.swiperRef.virtual.update(!0)}):(this.prependSlides=wd(this.slides.slice(this.slides.length-this.loopedSlides)),this.appendSlides=wd(this.slides.slice(0,this.loopedSlides))),this._changeDetectorRef.detectChanges()},this.style=null,this.updateVirtualSlides=t=>{!this.swiperRef||this.currentVirtualData&&this.currentVirtualData.from===t.from&&this.currentVirtualData.to===t.to&&this.currentVirtualData.offset===t.offset||(this.style=this.swiperRef.isHorizontal()?{[this.swiperRef.rtlTranslate?"right":"left"]:`${t.offset}px`}:{top:`${t.offset}px`},this.currentVirtualData=t,this._activeSlides.next(t.slides),this._ngZone.run(()=>{this._changeDetectorRef.detectChanges()}),this._ngZone.runOutsideAngular(()=>{this.swiperRef.updateSlides(),this.swiperRef.updateProgress(),this.swiperRef.updateSlidesClasses(),this.swiperRef.lazy&&this.swiperRef.params.lazy.enabled&&this.swiperRef.lazy.load(),this.swiperRef.virtual.update(!0)}))}}set navigation(t){var e,n,i;const r="boolean"!=typeof this._navigation?null===(e=this._navigation)||void 0===e?void 0:e.nextEl:null,s="boolean"!=typeof this._navigation?null===(n=this._navigation)||void 0===n?void 0:n.prevEl:null;this._navigation=xQ(t,{nextEl:r||null,prevEl:s||null}),this.showNavigation=!(!0!==_Q(t)||this._navigation&&"boolean"!=typeof this._navigation&&this._navigation.prevEl!==(null===(i=this._prevElRef)||void 0===i?void 0:i.nativeElement)&&(null!==this._navigation.prevEl||null!==this._navigation.nextEl)&&("string"==typeof this._navigation.nextEl||"string"==typeof this._navigation.prevEl||"object"==typeof this._navigation.nextEl||"object"==typeof this._navigation.prevEl))}get navigation(){return this._navigation}set pagination(t){var e;const n="boolean"!=typeof this._pagination?null===(e=this._pagination)||void 0===e?void 0:e.el:null;this._pagination=xQ(t,{el:n||null}),this.showPagination=yQ(t,this._pagination,this._paginationElRef)}get pagination(){return this._pagination}set scrollbar(t){var e;const n="boolean"!=typeof this._scrollbar?null===(e=this._scrollbar)||void 0===e?void 0:e.el:null;this._scrollbar=xQ(t,{el:n||null}),this.showScrollbar=yQ(t,this._scrollbar,this._scrollbarElRef)}get scrollbar(){return this._scrollbar}set virtual(t){this._virtual=xQ(t)}get virtual(){return this._virtual}set index(t){this.setIndex(t)}set config(t){this.updateSwiper(t);const{params:e}=EQ(t);Object.assign(this,e)}set prevElRef(t){this._prevElRef=t,this._setElement(t,this.navigation,"navigation","prevEl")}set nextElRef(t){this._nextElRef=t,this._setElement(t,this.navigation,"navigation","nextEl")}set scrollbarElRef(t){this._scrollbarElRef=t,this._setElement(t,this.scrollbar,"scrollbar")}set paginationElRef(t){this._paginationElRef=t,this._setElement(t,this.pagination,"pagination")}get activeSlides(){return this.virtual?this._activeSlides:wd(this.slides)}get zoomContainerClass(){return"boolean"!=typeof this.zoom?this.zoom.containerClass:"swiper-zoom-container"}_setElement(t,e,n,i="el"){if(!t||!e)return;if(e&&t.nativeElement){if(e[i]===t.nativeElement)return;e[i]=t.nativeElement}const r={};r[n]=!0,this.updateInitSwiper(r)}ngOnInit(){const{params:t}=EQ(this);Object.assign(this,t)}ngAfterViewInit(){this.childrenSlidesInit(),this.initSwiper(),this._changeDetectorRef.detectChanges(),setTimeout(()=>{this.s_swiper.emit(this.swiperRef)})}childrenSlidesInit(){this.slidesChanges(this.slidesEl),this.slidesEl.changes.subscribe(this.slidesChanges)}get isSwiperActive(){return this.swiperRef&&!this.swiperRef.destroyed}initSwiper(){const{params:t}=EQ(this);Object.assign(this,t),this._ngZone.runOutsideAngular(()=>{t.init=!1,t.virtual||(t.observer=!0),t.onAny=(t,...e)=>{const n=this[`s_${t}`];n&&n.emit(...e)},Object.assign(t.on,{_containerClasses(t,e){this.containerClasses=e},_slideClasses:(t,e)=>{e.forEach(({slideEl:t,classNames:e},n)=>{const i=parseInt(t.getAttribute("data-swiper-slide-index"))||n;if(this.virtual){const t=this.slides.find(t=>t.virtualIndex&&t.virtualIndex===i);if(t)return void(t.classNames=e)}this.slides[i]&&(this.slides[i].classNames=e)}),this._changeDetectorRef.detectChanges()}});const e=new GK(t);if(e.loopCreate=()=>{},e.loopDestroy=()=>{},t.loop&&(e.loopedSlides=this.loopedSlides),e.virtual&&e.params.virtual.enabled){e.virtual.slides=this.slides;const t={cache:!1,renderExternal:this.updateVirtualSlides,renderExternalUpdate:!1};vQ(e.params.virtual,t),vQ(e.originalParams.virtual,t)}Lh(this._platformId)&&(this.swiperRef=e.init(this.elementRef.nativeElement),this.swiperRef.virtual&&this.swiperRef.params.virtual.enabled&&this.swiperRef.virtual.update(!0),this._changeDetectorRef.detectChanges(),e.on("slideChange",()=>{this.indexChange.emit(this.swiperRef.realIndex)}))})}ngOnChanges(t){this.updateSwiper(t),this._changeDetectorRef.detectChanges()}updateInitSwiper(t){!t||!this.swiperRef||this.swiperRef.destroyed||this._ngZone.runOutsideAngular(()=>{const{pagination:e,navigation:n,scrollbar:i,thumbs:r}=this.swiperRef;t.pagination&&(this.pagination&&"boolean"!=typeof this.pagination&&this.pagination.el&&e&&!e.el?(this.updateParameter("pagination",this.pagination),e.init(),e.render(),e.update()):(e.destroy(),e.el=null)),t.scrollbar&&(this.scrollbar&&"boolean"!=typeof this.scrollbar&&this.scrollbar.el&&i&&!i.el?(this.updateParameter("scrollbar",this.scrollbar),i.init(),i.updateSize(),i.setTranslate()):(i.destroy(),i.el=null)),t.navigation&&(this.navigation&&"boolean"!=typeof this.navigation&&this.navigation.prevEl&&this.navigation.nextEl&&n&&!n.prevEl&&!n.nextEl?(this.updateParameter("navigation",this.navigation),n.init(),n.update()):n.prevEl&&n.nextEl&&(n.destroy(),n.nextEl=null,n.prevEl=null)),t.thumbs&&this.thumbs&&this.thumbs.swiper&&(this.updateParameter("thumbs",this.thumbs),r.init()&&r.update(!0)),t.controller&&this.controller&&this.controller.control&&(this.swiperRef.controller.control=this.controller.control),this.swiperRef.update()})}updateSwiper(t){this._ngZone.runOutsideAngular(()=>{var e,n;if(!t.config&&t&&this.swiperRef&&!this.swiperRef.destroyed){for(const i in t){if(wQ.indexOf(i)>=0)continue;const r=null!==(n=null===(e=t[i])||void 0===e?void 0:e.currentValue)&&void 0!==n?n:t[i];this.updateParameter(i,r)}t.allowSlideNext&&(this.swiperRef.allowSlideNext=this.allowSlideNext),t.allowSlidePrev&&(this.swiperRef.allowSlidePrev=this.allowSlidePrev),t.direction&&this.swiperRef.changeDirection(this.direction,!1),t.breakpoints&&(this.loop&&!this.loopedSlides&&this.calcLoopedSlides(),this.swiperRef.currentBreakpoint=null,this.swiperRef.setBreakpoint()),(t.thumbs||t.controller)&&this.updateInitSwiper(t),this.swiperRef.update()}})}calcLoopedSlides(){if(!this.loop)return;let t=this.slidesPerView;if(this.breakpoints){const e=GK.prototype.getBreakpoint(this.breakpoints),n=e in this.breakpoints?this.breakpoints[e]:void 0;n&&n.slidesPerView&&(t=n.slidesPerView)}if("auto"===t)return this.loopedSlides=this.slides.length,this.slides.length;let e=this.loopedSlides||t;return e+=this.loopAdditionalSlides,e>this.slides.length&&(e=this.slides.length),this.loopedSlides=e,e}updateParameter(t,e){if(!this.swiperRef||this.swiperRef.destroyed)return;const n=t.replace(/^_/,""),i=bQ(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){const t=this.swiperRef.modules[n].params[n];i?vQ(this.swiperRef.params[n],t):this.swiperRef.params[n]=t}i&&bQ(e)?vQ(this.swiperRef.params[n],e):this.swiperRef.params[n]=e}setIndex(t,e,n){this.isSwiperActive?t!==this.swiperRef.activeIndex&&this._ngZone.runOutsideAngular(()=>{this.loop?this.swiperRef.slideToLoop(t,e,!n):this.swiperRef.slideTo(t,e,!n)}):this.initialSlide=t}ngOnDestroy(){this._ngZone.runOutsideAngular(()=>{var t;null===(t=this.swiperRef)||void 0===t||t.destroy(!0,!1)})}}return t.\u0275fac=function(e){return new(e||t)(ea(xu),ea(kl),ea(tc),ea(ou))},t.\u0275cmp=Jt({type:t,selectors:[["swiper"],["","swiper",""]],contentQueries:function(t,e,n){if(1&t&&Xc(n,CQ,4),2&t){let t;Wc(t=Yc())&&(e.slidesEl=t)}},viewQuery:function(t,e){if(1&t&&(qc(WK,5),qc(qK,5),qc(XK,5),qc(YK,5)),2&t){let t;Wc(t=Yc())&&(e.prevElRef=t.first),Wc(t=Yc())&&(e.nextElRef=t.first),Wc(t=Yc())&&(e.scrollbarElRef=t.first),Wc(t=Yc())&&(e.paginationElRef=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.containerClasses)},inputs:{slideClass:"slideClass",wrapperClass:"wrapperClass",navigation:"navigation",pagination:"pagination",scrollbar:"scrollbar",virtual:"virtual",index:"index",config:"config",loopedSlides:"loopedSlides",initialSlide:"initialSlide",direction:"direction",touchEventsTarget:"touchEventsTarget",speed:"speed",cssMode:"cssMode",updateOnWindowResize:"updateOnWindowResize",resizeObserver:"resizeObserver",nested:"nested",focusableElements:"focusableElements",width:"width",height:"height",preventInteractionOnTransition:"preventInteractionOnTransition",userAgent:"userAgent",url:"url",edgeSwipeDetection:"edgeSwipeDetection",edgeSwipeThreshold:"edgeSwipeThreshold",freeMode:"freeMode",freeModeMomentum:"freeModeMomentum",freeModeMomentumRatio:"freeModeMomentumRatio",freeModeMomentumBounce:"freeModeMomentumBounce",freeModeMomentumBounceRatio:"freeModeMomentumBounceRatio",freeModeMomentumVelocityRatio:"freeModeMomentumVelocityRatio",freeModeSticky:"freeModeSticky",freeModeMinimumVelocity:"freeModeMinimumVelocity",autoHeight:"autoHeight",setWrapperSize:"setWrapperSize",virtualTranslate:"virtualTranslate",effect:"effect",breakpoints:"breakpoints",spaceBetween:"spaceBetween",slidesPerView:"slidesPerView",slidesPerColumn:"slidesPerColumn",slidesPerColumnFill:"slidesPerColumnFill",slidesPerGroup:"slidesPerGroup",slidesPerGroupSkip:"slidesPerGroupSkip",centeredSlides:"centeredSlides",centeredSlidesBounds:"centeredSlidesBounds",slidesOffsetBefore:"slidesOffsetBefore",slidesOffsetAfter:"slidesOffsetAfter",normalizeSlideIndex:"normalizeSlideIndex",centerInsufficientSlides:"centerInsufficientSlides",watchOverflow:"watchOverflow",roundLengths:"roundLengths",touchRatio:"touchRatio",touchAngle:"touchAngle",simulateTouch:"simulateTouch",shortSwipes:"shortSwipes",longSwipes:"longSwipes",longSwipesRatio:"longSwipesRatio",longSwipesMs:"longSwipesMs",followFinger:"followFinger",allowTouchMove:"allowTouchMove",threshold:"threshold",touchMoveStopPropagation:"touchMoveStopPropagation",touchStartPreventDefault:"touchStartPreventDefault",touchStartForcePreventDefault:"touchStartForcePreventDefault",touchReleaseOnEdges:"touchReleaseOnEdges",uniqueNavElements:"uniqueNavElements",resistance:"resistance",resistanceRatio:"resistanceRatio",watchSlidesProgress:"watchSlidesProgress",watchSlidesVisibility:"watchSlidesVisibility",grabCursor:"grabCursor",preventClicks:"preventClicks",preventClicksPropagation:"preventClicksPropagation",slideToClickedSlide:"slideToClickedSlide",preloadImages:"preloadImages",updateOnImagesReady:"updateOnImagesReady",loop:"loop",loopAdditionalSlides:"loopAdditionalSlides",loopFillGroupWithBlank:"loopFillGroupWithBlank",loopPreventsSlide:"loopPreventsSlide",allowSlidePrev:"allowSlidePrev",allowSlideNext:"allowSlideNext",swipeHandler:"swipeHandler",noSwiping:"noSwiping",noSwipingClass:"noSwipingClass",noSwipingSelector:"noSwipingSelector",passiveListeners:"passiveListeners",containerModifierClass:"containerModifierClass",slideBlankClass:"slideBlankClass",slideActiveClass:"slideActiveClass",slideDuplicateActiveClass:"slideDuplicateActiveClass",slideVisibleClass:"slideVisibleClass",slideDuplicateClass:"slideDuplicateClass",slideNextClass:"slideNextClass",slideDuplicateNextClass:"slideDuplicateNextClass",slidePrevClass:"slidePrevClass",slideDuplicatePrevClass:"slideDuplicatePrevClass",runCallbacksOnInit:"runCallbacksOnInit",observeParents:"observeParents",observeSlideChildren:"observeSlideChildren",a11y:"a11y",autoplay:"autoplay",controller:"controller",coverflowEffect:"coverflowEffect",cubeEffect:"cubeEffect",fadeEffect:"fadeEffect",flipEffect:"flipEffect",hashNavigation:"hashNavigation",history:"history",keyboard:"keyboard",lazy:"lazy",mousewheel:"mousewheel",parallax:"parallax",thumbs:"thumbs",zoom:"zoom",class:"class",id:"id"},outputs:{s__beforeBreakpoint:"_beforeBreakpoint",s__containerClasses:"_containerClasses",s__slideClass:"_slideClass",s__swiper:"_swiper",s_activeIndexChange:"activeIndexChange",s_afterInit:"afterInit",s_autoplay:"autoplay",s_autoplayStart:"autoplayStart",s_autoplayStop:"autoplayStop",s_beforeDestroy:"beforeDestroy",s_beforeInit:"beforeInit",s_beforeLoopFix:"beforeLoopFix",s_beforeResize:"beforeResize",s_beforeSlideChangeStart:"beforeSlideChangeStart",s_beforeTransitionStart:"beforeTransitionStart",s_breakpoint:"breakpoint",s_changeDirection:"changeDirection",s_click:"click",s_doubleTap:"doubleTap",s_doubleClick:"doubleClick",s_destroy:"destroy",s_fromEdge:"fromEdge",s_hashChange:"hashChange",s_hashSet:"hashSet",s_imagesReady:"imagesReady",s_init:"init",s_keyPress:"keyPress",s_lazyImageLoad:"lazyImageLoad",s_lazyImageReady:"lazyImageReady",s_loopFix:"loopFix",s_momentumBounce:"momentumBounce",s_navigationHide:"navigationHide",s_navigationShow:"navigationShow",s_observerUpdate:"observerUpdate",s_orientationchange:"orientationchange",s_paginationHide:"paginationHide",s_paginationRender:"paginationRender",s_paginationShow:"paginationShow",s_paginationUpdate:"paginationUpdate",s_progress:"progress",s_reachBeginning:"reachBeginning",s_reachEnd:"reachEnd",s_realIndexChange:"realIndexChange",s_resize:"resize",s_scroll:"scroll",s_scrollbarDragEnd:"scrollbarDragEnd",s_scrollbarDragMove:"scrollbarDragMove",s_scrollbarDragStart:"scrollbarDragStart",s_setTransition:"setTransition",s_setTranslate:"setTranslate",s_slideChange:"slideChange",s_slideChangeTransitionEnd:"slideChangeTransitionEnd",s_slideChangeTransitionStart:"slideChangeTransitionStart",s_slideNextTransitionEnd:"slideNextTransitionEnd",s_slideNextTransitionStart:"slideNextTransitionStart",s_slidePrevTransitionEnd:"slidePrevTransitionEnd",s_slidePrevTransitionStart:"slidePrevTransitionStart",s_slideResetTransitionStart:"slideResetTransitionStart",s_slideResetTransitionEnd:"slideResetTransitionEnd",s_sliderMove:"sliderMove",s_sliderFirstMove:"sliderFirstMove",s_slidesLengthChange:"slidesLengthChange",s_slidesGridLengthChange:"slidesGridLengthChange",s_snapGridLengthChange:"snapGridLengthChange",s_snapIndexChange:"snapIndexChange",s_tap:"tap",s_toEdge:"toEdge",s_touchEnd:"touchEnd",s_touchMove:"touchMove",s_touchMoveOpposite:"touchMoveOpposite",s_touchStart:"touchStart",s_transitionEnd:"transitionEnd",s_transitionStart:"transitionStart",s_update:"update",s_zoomChange:"zoomChange",s_swiper:"swiper",indexChange:"indexChange"},features:[ye],ngContentSelectors:mQ,decls:13,vars:17,consts:[[4,"ngIf"],["class","swiper-scrollbar",4,"ngIf"],["class","swiper-pagination",4,"ngIf"],[3,"ngClass"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["slidesTemplate",""],[1,"swiper-button-prev"],["prevElRef",""],[1,"swiper-button-next"],["nextElRef",""],[1,"swiper-scrollbar"],["scrollbarElRef",""],[1,"swiper-pagination"],["paginationElRef",""],[3,"ngClass","style","ngSwitch",4,"ngFor","ngForOf"],[3,"ngClass","ngSwitch"],[3,"ngClass",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(t,e){if(1&t&&(wa(dQ),xa(0),Jo(1,KK,5,0,"ng-container",0),Jo(2,QK,2,0,"div",1),Jo(3,ZK,2,0,"div",2),ra(4,"div",3),xa(5,1),Jo(6,tQ,1,0,void 0,4),Jo(7,nQ,1,0,void 0,4),Jo(8,rQ,1,0,void 0,4),xa(9,2),sa(),xa(10,3),Jo(11,hQ,2,3,"ng-template",null,5,Jc)),2&t){const t=ta(12);ws(1),na("ngIf",e.navigation&&e.showNavigation),ws(1),na("ngIf",e.scrollbar&&e.showScrollbar),ws(1),na("ngIf",e.pagination&&e.showPagination),ws(1),na("ngClass",e.wrapperClass),Ko("id",e.id),ws(2),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(11,pQ,e.prependSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(13,fQ,e.activeSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Tc(15,gQ,e.appendSlides))}},directives:[_h,mh,kh,yh,Eh,Ch,Oh],pipes:[Dh],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),t})(),TQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})();function kQ(){return(kQ=Object.assign||function(t){for(var e=1;e0&&(n(s,!!t.isBeginning),t.params.watchOverflow&&t.enabled&&s[t.isLocked?"addClass":"removeClass"](e.lockClass)),r&&r.length>0&&(n(r,!!t.isEnd),t.params.watchOverflow&&t.enabled&&r[t.isLocked?"addClass":"removeClass"](e.lockClass))}},onPrevClick:function(t){var e=this;t.preventDefault(),(!e.isBeginning||e.params.loop)&&e.slidePrev()},onNextClick:function(t){var e=this;t.preventDefault(),(!e.isEnd||e.params.loop)&&e.slideNext()},init:function(){var t,e,n=this,i=n.params.navigation;n.params.navigation=function(t,e,n,i){var r=tK();return n&&Object.keys(i).forEach(function(n){if(!e[n]&&!0===e.auto){var s=r.createElement("div");s.className=i[n],t.append(s),e[n]=s}}),e}(n.$el,n.params.navigation,n.params.createElements,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),(i.nextEl||i.prevEl)&&(i.nextEl&&(t=yK(i.nextEl),n.params.uniqueNavElements&&"string"==typeof i.nextEl&&t.length>1&&1===n.$el.find(i.nextEl).length&&(t=n.$el.find(i.nextEl))),i.prevEl&&(e=yK(i.prevEl),n.params.uniqueNavElements&&"string"==typeof i.prevEl&&e.length>1&&1===n.$el.find(i.prevEl).length&&(e=n.$el.find(i.prevEl))),t&&t.length>0&&t.on("click",n.navigation.onNextClick),e&&e.length>0&&e.on("click",n.navigation.onPrevClick),SK(n.navigation,{$nextEl:t,nextEl:t&&t[0],$prevEl:e,prevEl:e&&e[0]}),n.enabled||(t&&t.addClass(i.lockClass),e&&e.addClass(i.lockClass)))},destroy:function(){var t=this,e=t.navigation,n=e.$nextEl,i=e.$prevEl;n&&n.length&&(n.off("click",t.navigation.onNextClick),n.removeClass(t.params.navigation.disabledClass)),i&&i.length&&(i.off("click",t.navigation.onPrevClick),i.removeClass(t.params.navigation.disabledClass))}},PQ={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){EK(this,{navigation:kQ({},AQ)})},on:{init:function(t){t.navigation.init(),t.navigation.update()},toEdge:function(t){t.navigation.update()},fromEdge:function(t){t.navigation.update()},destroy:function(t){t.navigation.destroy()},"enable disable":function(t){var e=t.navigation,n=e.$nextEl,i=e.$prevEl;n&&n[t.enabled?"removeClass":"addClass"](t.params.navigation.lockClass),i&&i[t.enabled?"removeClass":"addClass"](t.params.navigation.lockClass)},click:function(t,e){var n=t.navigation,i=n.$nextEl,r=n.$prevEl,s=e.target;if(t.params.navigation.hideOnClick&&!yK(s).is(r)&&!yK(s).is(i)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===s||t.pagination.el.contains(s)))return;var o;i?o=i.hasClass(t.params.navigation.hiddenClass):r&&(o=r.hasClass(t.params.navigation.hiddenClass)),t.emit(!0===o?"navigationShow":"navigationHide"),i&&i.toggleClass(t.params.navigation.hiddenClass),r&&r.toggleClass(t.params.navigation.hiddenClass)}}}};let IQ=(()=>{class t{constructor(){GK.use([PQ])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,TQ]]}),t})(),MQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh]]}),t})(),DQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,lX,f_,IQ,MQ]]}),t})(),RQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,Dp,DQ]]}),t})();const NQ={isolated:!0},LQ=new oi("Message service configuration",{providedIn:"root",factory:()=>NQ});let jQ=(()=>{class t{constructor(t,e,n){this.source=t,this.channel=e,this.messages=n}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Hd(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Hd(e=>e.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Hd(e=>t.includes(e.source)))}nextMessageId(){return t.counter++}}return t.counter=0,t})(),FQ=(()=>{class t{constructor(t,e){this.config=t,this.parent=e,this.channel=new P,this.messages=t.isolated||!e?this.channel.asObservable():U([this.channel,e.messages.pipe(Xp(()=>!this.channel.closed))]).pipe(Y())}ngOnDestroy(){this.channel.complete()}connect(t){return new jQ(t,this.channel,this.messages)}}return t.\u0275fac=function(e){return new(e||t)(Ci(LQ),Ci(t,12))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),BQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:LQ,useValue:NQ}],imports:[[gd,ky,f_]]}),t})();function VQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function zQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function UQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}function HQ(t,e){if(1&t&&(vn(),oa(0,"circle",3)),2&t){const t=va();La("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),Ko("r",t._getCircleRadius())}}const $Q=".mat-progress-spinner{display:block;position:relative;overflow:hidden}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}._mat-animation-noopable.mat-progress-spinner circle{transition:none;animation:none}.cdk-high-contrast-active .mat-progress-spinner circle{stroke:currentColor;stroke:CanvasText}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{animation:mat-progress-spinner-linear-rotate 2000ms linear infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4000ms;animation-timing-function:cubic-bezier(0.35, 0, 0.25, 1);animation-iteration-count:infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{animation:mat-progress-spinner-stroke-rotate-fallback 10000ms cubic-bezier(0.87, 0.03, 0.33, 1) infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition:none;animation:none}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.606171575px;transform:rotate(0)}12.5%{stroke-dashoffset:56.5486677px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.606171575px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.5486677px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.606171575px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.5486677px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.606171575px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.5486677px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0deg)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}\n",GQ=jy(class{constructor(t){this._elementRef=t}},"primary"),WQ=new oi("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}});class qQ extends GQ{constructor(t,e,n,i,r){super(t),this._document=n,this._diameter=100,this._value=0,this._fallbackAnimation=!1,this.mode="determinate";const s=qQ._diameters;this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),s.has(n.head)||s.set(n.head,new Set([100])),this._fallbackAnimation=e.EDGE||e.TRIDENT,this._noopAnimations="NoopAnimations"===i&&!!r&&!r._forceAnimations,r&&(r.diameter&&(this.diameter=r.diameter),r.strokeWidth&&(this.strokeWidth=r.strokeWidth))}get diameter(){return this._diameter}set diameter(t){this._diameter=bd(t),this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()}get strokeWidth(){return this._strokeWidth||this.diameter/10}set strokeWidth(t){this._strokeWidth=bd(t)}get value(){return"determinate"===this.mode?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,bd(t)))}ngOnInit(){const t=this._elementRef.nativeElement;this._styleRoot=xp(t)||this._document.head,this._attachStyleNode(),t.classList.add(`mat-progress-spinner-indeterminate${this._fallbackAnimation?"-fallback":""}-animation`)}_getCircleRadius(){return(this.diameter-10)/2}_getViewBox(){const t=2*this._getCircleRadius()+this.strokeWidth;return`0 0 ${t} ${t}`}_getStrokeCircumference(){return 2*Math.PI*this._getCircleRadius()}_getStrokeDashOffset(){return"determinate"===this.mode?this._getStrokeCircumference()*(100-this._value)/100:this._fallbackAnimation&&"indeterminate"===this.mode?.2*this._getStrokeCircumference():null}_getCircleStrokeWidth(){return this.strokeWidth/this.diameter*100}_attachStyleNode(){const t=this._styleRoot,e=this._diameter,n=qQ._diameters;let i=n.get(t);if(!i||!i.has(e)){const r=this._document.createElement("style");r.setAttribute("mat-spinner-animation",this._spinnerAnimationLabel),r.textContent=this._getAnimationText(),t.appendChild(r),i||(i=new Set,n.set(t,i)),i.add(e)}}_getAnimationText(){const t=this._getStrokeCircumference();return"\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n".replace(/START_VALUE/g,""+.95*t).replace(/END_VALUE/g,""+.2*t).replace(/DIAMETER/g,`${this._spinnerAnimationLabel}`)}_getSpinnerAnimationLabel(){return this.diameter.toString().replace(".","_")}}qQ.\u0275fac=function(t){return new(t||qQ)(ea(kl),ea(pp),ea(Yu,8),ea(Ey,8),ea(WQ))},qQ.\u0275cmp=Jt({type:qQ,selectors:[["mat-progress-spinner"]],hostAttrs:["role","progressbar","tabindex","-1",1,"mat-progress-spinner"],hostVars:10,hostBindings:function(t,e){2&t&&(Ko("aria-valuemin","determinate"===e.mode?0:null)("aria-valuemax","determinate"===e.mode?100:null)("aria-valuenow","determinate"===e.mode?e.value:null)("mode",e.mode),La("width",e.diameter,"px")("height",e.diameter,"px"),ja("_mat-animation-noopable",e._noopAnimations))},inputs:{color:"color",mode:"mode",diameter:"diameter",strokeWidth:"strokeWidth",value:"value"},exportAs:["matProgressSpinner"],features:[jo],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,e){1&t&&(vn(),ra(0,"svg",0),Jo(1,VQ,1,9,"circle",1),Jo(2,zQ,1,7,"circle",2),sa()),2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),na("ngSwitch","indeterminate"===e.mode),Ko("viewBox",e._getViewBox()),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1))},directives:[Eh,Ch],styles:[$Q],encapsulation:2,changeDetection:0}),qQ._diameters=new WeakMap;let XQ=(()=>{class t extends qQ{constructor(t,e,n,i,r){super(t,e,n,i,r),this.mode="indeterminate"}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(pp),ea(Yu,8),ea(Ey,8),ea(WQ))},t.\u0275cmp=Jt({type:t,selectors:[["mat-spinner"]],hostAttrs:["role","progressbar","mode","indeterminate",1,"mat-spinner","mat-progress-spinner"],hostVars:6,hostBindings:function(t,e){2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),ja("_mat-animation-noopable",e._noopAnimations))},inputs:{color:"color"},features:[jo],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,e){1&t&&(vn(),ra(0,"svg",0),Jo(1,UQ,1,9,"circle",1),Jo(2,HQ,1,7,"circle",2),sa()),2&t&&(La("width",e.diameter,"px")("height",e.diameter,"px"),na("ngSwitch","indeterminate"===e.mode),Ko("viewBox",e._getViewBox()),ws(1),na("ngSwitchCase",!0),ws(1),na("ngSwitchCase",!1))},directives:[Eh,Ch],styles:[$Q],encapsulation:2,changeDetection:0}),t})(),YQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Ny,Rh],Ny]}),t})(),KQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,YQ]]}),t})(),QQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Rh,x_,f_,YQ]]}),t})();const ZQ={initialConfig:{},parse:{},rename:{}};class JQ{constructor(t,e){this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},ZQ),e)}addChanges(t){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),t)}applyChanges(t,e={}){void 0===t&&(t=this.storedChanges,this.storedChanges={});const{configState:n,options:{initialConfig:i}}=this,r=n.snapshot,s=Object.assign(Object.assign(Object.assign({},i),r),e);for(const[o,a]of Object.entries(t))this.processChange(o,a,s);n.setConfig(s)}processChange(t,e,n){var i,r;const{options:{parse:s,rename:o}}=this,a=null!==(i=o[t])&&void 0!==i?i:t,l=e.currentValue,c=null!==(r=s[t])&&void 0!==r?r:s[a];if(null==l)delete n[a];else if(c)try{n[a]=c(l)}catch(u){console.warn(`Failed to parse ${t} = ${l}`,u.message)}else n[a]=l}}let tZ=(()=>{class t{constructor(t,e,n={}){this.configState=t,this.cdr=e,this.options=n,this.initialized=!1,this.configManager=new JQ(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return t.\u0275fac=function(t){!function(){throw new Error("invalid")}()},t.\u0275dir=se({type:t,features:[ye]}),t})();const eZ={boolean:t=>"false"!=`${t}`,json:t=>"string"==typeof t?JSON.parse(t):t,function:t=>{if("function"!=typeof t)throw new Error("Expected a javascript function");return t}};let nZ=(()=>{class t{constructor(){this.className="ccf-spinner-overlay",this.active=!1}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spinner-overlay"]],hostVars:4,hostBindings:function(t,e){2&t&&(Ba(e.className),ja("active",e.active))},inputs:{active:"active",text:"text"},decls:3,vars:1,consts:[[1,"content"]],template:function(t,e){1&t&&(oa(0,"mat-spinner"),ra(1,"div",0),Za(2),sa()),2&t&&(ws(2),Ja(e.text))},directives:[XQ],styles:["[_nghost-%COMP%]{display:flex;position:absolute;width:100%;height:100%;z-index:99;flex-direction:column;justify-content:center;align-items:center;pointer-events:none;visibility:hidden;opacity:0;transition:visibility .6s,opacity .4s ease-in-out}[_nghost-%COMP%] mat-spinner[_ngcontent-%COMP%]{margin-bottom:1rem;opacity:0;transition:opacity .3s ease-in-out .3s}.active[_nghost-%COMP%]{pointer-events:auto;visibility:visible;opacity:1}.active[_nghost-%COMP%] mat-spinner[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0}),t})();const iZ=FQ,rZ=["*"];let sZ=(()=>{class t{constructor(t,e){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new g;const n=t.connect(this).getMessages();this.subscriptions.add(n.subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){switch(t.payload.type){case"drawer-containers-changed":return this.drawers=t.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":{const e=t.source.position,{opened:n,width:i,margin:r}=t.payload;return this.updateMargin(e,n,i,r),this.updateFaded(),!0}default:return!1}}updateMargin(t,e,n,i){const r=e?n+i:i;"start"===t?this.leftMargin=r:this.rightMargin=r}updateFaded(){const[t,e]=this.drawers;this.faded=(null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==e?void 0:e.opened)&&(null==e?void 0:e.expanded)}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,e){2&t&&(rl("@fadeInOut",e.faded),Ba(e.className),La("margin-left",e.leftMargin,"px")("margin-right",e.rightMargin,"px"),ja("cff-drawer-content-animations",e.animationsEnabled))},ngContentSelectors:rZ,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 5.5rem);z-index:2;overflow:auto}.cff-drawer-content-animations[_nghost-%COMP%]{transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:margin-left,margin-right}"],data:{animation:[Vg("fadeInOut",[$g("false",Hg({opacity:1})),$g("true",Hg({opacity:0})),Wg("false <=> true",zg("1s"))])]},changeDetection:0}),t})();const oZ=["*"],aZ={params:{width:0,margin:0,margin2:0}};class lZ{constructor(){this.initialized=!1,this.deferred=new Promise(t=>{this.resolve=t})}set(){this.initialized=!0,this.resolve()}wait(){return lw(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let cZ=(()=>{class t{constructor(t,e,n){this.element=n,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Rc(!0),this.expandedChange=new Rc(!0),this.stateChange=new Rc(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new lZ,this.subscriptions=new g,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}get classEnd(){return"end"===this.position}get position(){return this._position}set position(t){this._position=t||"start"}get opened(){return this._opened}set opened(t){this.toggle(md(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(md(t))}get expandedStateObj(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}get measuredWidth(){if(this._measuredWidth>0)return this._measuredWidth;const t=this.element.nativeElement;if(!t)return 0;const e=t.getBoundingClientRect(),n=e.right-e.left;return 0===n?0:(this._measuredWidth=n,n)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const e=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),n=Number(e.slice(0,-2));return this._measuredMargin=n,n}ngAfterViewInit(){this.initialized.set(),setTimeout(()=>this.channel.sendMessage({type:"drawer-initialized"}))}ngOnDestroy(){this.subscriptions.unsubscribe()}open(){this.toggle(!0)}close(){this.toggle(!1)}toggle(t=!this.opened){this.opened!==t&&(t?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=t,this.sendToggle())}openExpanded(){this.toggleExpanded(!0)}closeExpanded(){this.toggleExpanded(!1)}toggleExpanded(t=!this.expanded){this.expanded!==t&&(t?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=t,this.sendToggle())}closeOpenDone(){this.openedChange.emit(this.opened)}expandCollapseDone(){this.expandedChange.emit(this.expanded)}sendToggle(){return lw(this,void 0,void 0,function*(){yield this.initialized.wait(),this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit()})}handleMessage(t){switch(t.payload.type){case"drawer-toggled":return this.syncExpanded(t.source),!0;default:return!1}}syncExpanded(t){(this.expanded||t.expanded)&&(this.expanded&&t.expanded?this.expandedState2=t.expandedState2="half":this.expanded?t.opened?(this.expandedState2="extended",this.width=t.measuredWidth+t.measuredMargin):(this.expandedState2="full",this.margin2=t.measuredMargin):this.opened?(t.expandedState2="extended",t.width=this.measuredWidth+this.measuredMargin):(t.expandedState2="full",t.margin2=this.measuredMargin))}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc),ea(kl))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,e){1&t&&ga("@openClose.done",function(){return e.closeOpenDone()})("@expandCollapse.done",function(){return e.expandCollapseDone()}),2&t&&(rl("@openClose",e.openedState)("@expandCollapse",e.expandedStateObj),Ba(e.className),ja("ccf-drawer-end",e.classEnd)("ccf-drawer-opened",e.opened)("ccf-drawer-expanded",e.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:oZ,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,e){1&t&&(wa(),ra(0,"div",0),xa(1),sa())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%);background-color:#fff}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[Vg("openClose",[$g("open, open-instant",Hg({transform:"none"})),$g("closed",Hg({})),Wg("closed => open-instant",zg(0)),Wg("closed <=> open, open-instant => closed",zg(".5s ease-in-out"))]),Vg("expandCollapse",[$g("collapsed",Hg({})),$g("half",Hg({width:"calc(50% - {{ margin }}px)"}),aZ),$g("extended",Hg({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),aZ),$g("full",Hg({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),aZ),Wg("* <=> *",zg(".5s ease-in-out"))])]},changeDetection:0}),t})();function uZ(t,e){1&t&&(ra(0,"ccf-drawer-content"),xa(1,2),sa())}const hZ=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],dZ=["ccf-drawer","ccf-drawer-content","*"];function pZ(t){throw new Error(`Multiple drawers in position ${t}`)}let fZ=(()=>{class t{constructor(t,e){this.cdr=e,this.className="ccf-drawer-container",this.subscriptions=new g,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(t=>{this.handleMessage(t)&&e.markForCheck()}))}get content(){var t;return null!==(t=this.content1.first)&&void 0!==t?t:this.content2.first}get hasWrappedContent(){return 0!==this.content1.length}ngAfterViewInit(){this.drawers.changes.pipe(Kd(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(Kd(null)).subscribe(()=>{this.channel.sendMessage({type:"content-container-changed",content:this.content}),this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return!0}validateDrawers(){const t=this.drawers.toArray(),e=t.filter(t=>"start"===t.position),n=t.filter(t=>"end"===t.position);return e.length>1&&pZ("start"),n.length>1&&pZ("end"),[e[0],n[0]]}}return t.\u0275fac=function(e){return new(e||t)(ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-container"]],contentQueries:function(t,e,n){if(1&t&&(Xc(n,cZ,5),Xc(n,sZ,5)),2&t){let t;Wc(t=Yc())&&(e.drawers=t),Wc(t=Yc())&&(e.content1=t)}},viewQuery:function(t,e){if(1&t&&qc(sZ,5),2&t){let t;Wc(t=Yc())&&(e.content2=t)}},hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},exportAs:["ccfDrawerContainer"],features:[_l([iZ])],ngContentSelectors:dZ,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&(wa(hZ),xa(0),xa(1,1),Jo(2,uZ,2,0,"ccf-drawer-content",0)),2&t&&(ws(2),na("ngIf",!e.hasWrappedContent))},directives:[_h,sZ],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),t})();function gZ(t,e){if(1&t&&(ra(0,"mat-option",6),ra(1,"div"),Za(2),sa(),sa()),2&t){const t=e.$implicit,n=va();na("value",t),ws(1),Ba(n.optionsVisible),ws(1),tl(" ",t," ")}}let mZ=(()=>{class t{constructor(t){this.ga=t,this.selectionChange=new Rc,this.optionsVisible="invisible"}toggleOptions(){this.optionsVisible="visible"===this.optionsVisible?"invisible":"visible"}selectionChanged(t){this.selection=t,this.ga.event("selection_change","dropdown",`${this.label}:${t}`),this.selectionChange.emit(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dropdown"]],inputs:{label:"label",options:"options",selection:"selection"},outputs:{selectionChange:"selectionChange"},decls:7,vars:3,consts:[[1,"ccf-dropdown","wrapper"],[1,"container"],[1,"dropdown-form-field"],[1,"label"],["disableOptionCentering","true","panelClass","option-panel","disableRipple","true",1,"selected-value",3,"value","selectionChange","openedChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"mat-form-field",2),ra(3,"div",3),Za(4),sa(),ra(5,"mat-select",4),fa("selectionChange",function(t){return e.selectionChanged(t.value)})("openedChange",function(){return e.toggleOptions()}),Jo(6,gZ,3,5,"mat-option",5),sa(),sa(),sa(),sa()),2&t&&(ws(4),tl(" ",e.label," "),ws(1),na("value",e.selection),ws(1),na("ngForOf",e.options))},directives:[lU,kX,yh,av],styles:["@-webkit-keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@keyframes slideInHorizontalDropdown{0%{width:0}to{width:9.85rem}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.dropdown-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:1em;padding-right:1em;height:3rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{font-size:.875rem;border:none}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix mat-select{font-size:1rem;font-weight:bold}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .option-panel{-webkit-animation:slideInHorizontalDropdown .3s;animation:slideInHorizontalDropdown .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;position:absolute!important;top:1.55rem;max-width:9.5rem} .option-panel .mat-option{border-bottom-width:1px;border-bottom-style:solid;padding-left:1em} .option-panel :last-child{border-bottom:none} .cdk-overlay-pane{min-width:0rem!important}.dropdown-form-field[_ngcontent-%COMP%]{height:3rem;width:100%}.dropdown-form-field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{padding-bottom:.063rem}.dropdown-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem} .ccf-dropdown .mat-select-arrow-wrapper{transform:translatey(-.5em)}"],changeDetection:0}),t})();const bZ=["popover"];function yZ(t,e){if(1&t){const t=ua();ra(0,"div",7,8),ra(2,"div"),ra(3,"div",9),Za(4),sa(),ra(5,"input",10),fa("keyup",function(e){return $e(t),va().onKeyLow(e)}),sa(),sa(),ra(6,"ng5-slider",11),fa("valueChange",function(e){return $e(t),va().lowValue=e})("highValueChange",function(e){return $e(t),va().highValue=e})("userChangeEnd",function(){return $e(t),va().sliderValueChanged()}),sa(),ra(7,"div"),ra(8,"div",12),Za(9),sa(),ra(10,"input",13),fa("keyup",function(e){return $e(t),va().onKeyHigh(e)}),sa(),sa(),sa()}if(2&t){const t=va();ws(2),nl("label min fade-in ",t.contentsVisible,""),ws(2),tl(" ",t.options.floor,"> "),ws(1),Sa("value",t.lowValue),ws(1),nl("slider fade-in ",t.contentsVisible,""),na("options",t.options)("value",t.lowValue)("highValue",t.highValue),ws(1),nl("label max fade-in ",t.contentsVisible,""),ws(2),tl(" ",t.options.ceil," "),ws(1),Sa("value",t.highValue)}}let vZ=(()=>{class t{constructor(t,e,n){this.element=e,this.ga=n,this.selectionChange=new Rc,this.isSliderOpen=!1,this.contentsVisible="invisible",this.isSliderInitialized=!1;const i=t.position().flexibleConnectedTo(e).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"}]);this.overlayRef=t.create({panelClass:"slider-pane",positionStrategy:i})}get rangeLabel(){const{lowValue:t,highValue:e}=this;return t===e?`${t}`:`${t}-${e}`}ngOnChanges(t){t.valueRange&&this.optionsChanged(),t.selection&&(this.lowValue=Math.min(...this.selection),this.highValue=Math.max(...this.selection))}optionsChanged(){var t,e;this.options={floor:this.valueRange?this.valueRange[0]:0,ceil:this.valueRange?this.valueRange[1]:0,step:1,hideLimitLabels:!0,hidePointerLabels:!0},this.lowValue=null!==(t=this.options.floor)&&void 0!==t?t:0,this.highValue=null!==(e=this.options.ceil)&&void 0!==e?e:0}ngOnDestroy(){this.overlayRef.dispose()}closeSliderPopover(t){var e,n;const{element:i,isSliderOpen:r,popoverElement:s}=this;r&&(i.nativeElement.contains(t)||(null===(n=null===(e=null==s?void 0:s.nativeElement)||void 0===e?void 0:e.contains)||void 0===n?void 0:n.call(e,t))||(this.overlayRef.detach(),this.isSliderInitialized=!1,this.isSliderOpen=!1,this.contentsVisible="invisible"))}toggleSliderPopover(){const{isSliderOpen:t,isSliderInitialized:e}=this;e?(this.overlayRef.detach(),this.isSliderInitialized=!1):!e&&!t&&this.initializeSliderPopover(),this.contentsVisible="visible"===this.contentsVisible?"invisible":"visible",this.isSliderOpen=!t}sliderValueChanged(){const{lowValue:t,highValue:e}=this;this.selection=[t,e],this.ga.event("slider_range_change","dual_slider",`${this.label}:${t}:${e}`),this.selectionChange.emit(this.selection)}initializeSliderPopover(){const{overlayRef:t,popoverPortal:e}=this;t.attach(e),t.updatePosition(),this.isSliderInitialized=!0}onKeyLow(t){const e=Number(t.target.value);"Enter"===t.key&&(e>=Number(this.options.floor)&&e<=Number(this.options.ceil)&&(this.lowValue=e),t.target.value=String(this.lowValue),t.target.blur(),this.sliderValueChanged())}onKeyHigh(t){const e=Number(t.target.value);"Enter"===t.key&&(e>=Number(this.options.floor)&&e<=Number(this.options.ceil)&&(this.highValue=e),t.target.value=String(this.highValue),t.target.blur(),this.sliderValueChanged())}}return t.\u0275fac=function(e){return new(e||t)(ea(kf),ea(kl),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dual-slider"]],viewQuery:function(t,e){if(1&t&&(qc(Vp,7),qc(bZ,5,kl)),2&t){let t;Wc(t=Yc())&&(e.popoverPortal=t.first),Wc(t=Yc())&&(e.popoverElement=t.first)}},hostBindings:function(t,e){1&t&&fa("click",function(t){return e.closeSliderPopover(t.target)},!1,Ir)("touchstart",function(t){return e.closeSliderPopover(t.target)},!1,Ir)},inputs:{label:"label",valueRange:"valueRange",selection:"selection"},outputs:{selectionChange:"selectionChange"},features:[ye],decls:10,vars:4,consts:[[1,"ccf-slider","wrapper"],[1,"container"],["class","ccf-slider detached",4,"cdk-portal"],[1,"slider-form-field",3,"click"],[1,"slider-labels"],[1,"name-label"],[1,"range-label"],[1,"ccf-slider","detached"],["popover",""],[1,"label","floor"],["type","text",1,"input-low",3,"value","keyup"],[3,"options","value","highValue","valueChange","highValueChange","userChangeEnd"],[1,"label","ceil"],["type","text",1,"input-high",3,"value","keyup"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Jo(2,yZ,11,16,"div",2),ra(3,"mat-form-field",3),fa("click",function(){return e.toggleSliderPopover()}),ra(4,"div",4),ra(5,"span",5),Za(6),sa(),ra(7,"span",6),Za(8),sa(),sa(),oa(9,"mat-select"),sa(),sa(),sa()),2&t&&(ws(3),ja("highlight",e.isSliderOpen),ws(3),Ja(e.label),ws(2),Ja(e.rangeLabel))},directives:[zp,lU,kX,vY],styles:[".slider-form-field[_ngcontent-%COMP%]{width:100%;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-left:.25rem;padding-right:.25rem;height:3rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;font-size:.875rem}.slider-form-field[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{left:0rem;bottom:0rem;transform:none;height:.125rem}.slider-labels[_ngcontent-%COMP%]{display:flex;flex-direction:column}.slider-labels[_ngcontent-%COMP%] .name-label[_ngcontent-%COMP%]{padding-bottom:.25rem}.slider-labels[_ngcontent-%COMP%] .range-label[_ngcontent-%COMP%]{font-weight:bold} .ccf-slider.wrapper .mat-select-arrow-wrapper{transform:translatey(-1.5em)}@-webkit-keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@keyframes slideInHorizontalSlider{0%{width:0}to{width:20em}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.visible[_ngcontent-%COMP%]{-webkit-animation:fadeIn .3s;animation:fadeIn .3s;transition-delay:.275s;-webkit-animation-delay:.275s;animation-delay:.275s}.invisible[_ngcontent-%COMP%]{opacity:0} .slider-pane{position:absolute!important;top:-1px}.ccf-slider.detached[_ngcontent-%COMP%]{-webkit-animation:slideInHorizontalSlider .3s;animation:slideInHorizontalSlider .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;box-shadow:.2rem .2rem 1rem #0000003e;display:flex;justify-content:center;align-items:center;width:0rem;height:4.375rem;padding:.75rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] {visibility:hidden;margin-top:.9375rem;margin-bottom:.9375rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-bar{opacity:.2;height:.15rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-selection{opacity:1}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer{width:1rem;height:1rem;top:-.405rem}.ccf-slider.detached[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .ng5-slider-pointer:after{display:none}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:2rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.min[_ngcontent-%COMP%]{margin-right:1rem}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%]{margin-left:1rem;align-items:flex-end}.ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label.max[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-align:right}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .floor[_ngcontent-%COMP%], .ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] .ceil[_ngcontent-%COMP%]{font-size:.875rem}.ccf-slider.detached[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border:none;width:1.75rem;font-size:1rem;font-weight:bold;padding:0}"]}),t})();function _Z(t,e){if(1&t){const t=ua();ra(0,"div",4),ra(1,"mat-checkbox",5),fa("change",function(e){const n=$e(t).$implicit;return va().filterOnChange(e,n)}),Za(2),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ws(1),na("checked",null==n.selection?null:n.selection.includes(t)),ws(1),tl(" ",t," ")}}let wZ=(()=>{class t{constructor(t){this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new Rc}filterOnChange(t,e){t.checked?(this.selection=[...this.selection,e],this.ga.event("filter_added","filter_checkbox",e)):(this.selection=this.selection.filter(t=>t!==e),this.ga.event("filter_removed","filter_checkbox",e)),this.selectionChange.emit(this.selection)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-checkbox"]],inputs:{label:"label",options:"options",selection:"selection",columns:"columns"},outputs:{selectionChange:"selectionChange"},decls:5,vars:6,consts:[[1,"filter-container"],[1,"filter-label"],[1,"options-container"],["class","option",4,"ngFor","ngForOf"],[1,"option"],[3,"checked","change"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Za(2),sa(),ra(3,"div",2),Jo(4,_Z,3,2,"div",3),sa(),sa()),2&t&&(ws(2),Ja(e.label),ws(1),ja("three",3===e.columns)("four",4===e.columns),ws(1),na("ngForOf",e.options))},directives:[yh,oX],styles:[".mat-checkbox.mat-accent .mat-checkbox-checkmark-path{stroke:#fff!important} .mat-checkbox.mat-accent .mat-checkbox-inner-container{margin-right:1rem}.filter-label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}.options-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap}.options-container.three[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:33%}.options-container.four[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{width:25%}.option[_ngcontent-%COMP%]{color:#fafafa}"],changeDetection:0}),t})();const xZ=function(){return["Both","Male","Female"]},SZ=function(){return[1,110]},EZ=function(){return[13,83]};let CZ=(()=>{class t{constructor(t){this.ga=t,this.filtersChange=new Rc,this.applyFilters=new Rc}updateFilter(t,e){this.filters=Object.assign(Object.assign({},this.filters),{[e]:t}),this.ga.event("filter_update","filter_content",`${e}:${t}`),this.filtersChange.emit(this.filters)}applyButtonClick(){this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}refreshFilters(){this.filters=Object.assign(Object.assign({},this.filters),{sex:"Both",ageRange:[1,110],bmiRange:[13,83],technologies:[],tmc:[]}),this.ga.event("filters_reset","filter_content"),this.filtersChange.emit(this.filters)}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange",applyFilters:"applyFilters"},decls:14,vars:23,consts:[[1,"patient-filters"],["label","Sex",3,"options","selection","selectionChange"],["label","Age",3,"valueRange","selection","selectionChange"],["label","BMI",3,"valueRange","selection","selectionChange"],[1,"filter","assays"],["label","Assay Types",3,"columns","options","selection","selectionChange"],[1,"filter","providers"],["label","Tissue Providers",3,"columns","options","selection","selectionChange"],[1,"button-container"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"ccf-dropdown",1),fa("selectionChange",function(t){return e.updateFilter(t,"sex")}),sa(),ra(2,"ccf-dual-slider",2),fa("selectionChange",function(t){return e.updateFilter(t,"ageRange")}),sa(),ra(3,"ccf-dual-slider",3),fa("selectionChange",function(t){return e.updateFilter(t,"bmiRange")}),sa(),sa(),ra(4,"div",4),ra(5,"ccf-checkbox",5),fa("selectionChange",function(t){return e.updateFilter(t,"technologies")}),sa(),sa(),ra(6,"div",6),ra(7,"ccf-checkbox",7),fa("selectionChange",function(t){return e.updateFilter(t,"tmc")}),sa(),sa(),ra(8,"div",8),ra(9,"button",9),fa("click",function(){return e.applyButtonClick()}),Za(10,"APPLY FILTERS"),sa(),ra(11,"div",10),ra(12,"mat-icon",11),fa("click",function(){return e.refreshFilters()}),Za(13,"refresh"),sa(),sa(),sa()),2&t&&(ja("hidden",e.hidden),ws(1),na("options",Oc(20,xZ))("selection",null==e.filters?null:e.filters.sex),ws(1),na("valueRange",Oc(21,SZ))("selection",null==e.filters?null:e.filters.ageRange),ws(1),na("valueRange",Oc(22,EZ))("selection",null==e.filters?null:e.filters.bmiRange),ws(1),ja("hidden",e.hidden),ws(1),na("columns",4)("options",e.technologyFilters)("selection",null==e.filters?null:e.filters.technologies),ws(1),ja("hidden",e.hidden),ws(1),na("columns",3)("options",e.providerFilters)("selection",null==e.filters?null:e.filters.tmc),ws(1),ja("hidden",e.hidden))},directives:[mZ,vZ,wZ,__,p_],styles:[".filter[_ngcontent-%COMP%]{margin-top:2rem}.filter.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.filter.assays[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{margin-right:0 rem;width:25%}.button-container[_ngcontent-%COMP%]{margin-top:2rem;display:flex;flex-direction:row-reverse;align-items:center}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.refresh-icon[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{cursor:pointer;transition:.6s;transition-property:background}.patient-filters[_ngcontent-%COMP%]{display:flex;width:90%;padding-top:1rem}.patient-filters.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.patient-filters[_ngcontent-%COMP%] ccf-dual-slider[_ngcontent-%COMP%]{margin-left:.5rem;width:33%}.patient-filters[_ngcontent-%COMP%] ccf-dropdown[_ngcontent-%COMP%]{width:33%}"],changeDetection:0}),t})();function OZ(t,e){1&t&&(ra(0,"div"),ra(1,"mat-icon",7),Za(2,"close"),sa(),sa())}function TZ(t,e){1&t&&oa(0,"mat-icon",8)}let kZ=(()=>{class t{constructor(){this.filtersChange=new Rc,this.filtersVisible=!1}toggleFilterVisible(){this.filtersVisible=!this.filtersVisible}removeBox(){this.filtersVisible=!1}applyFilters(t){this.filters=t,this.filtersChange.emit(t),this.removeBox()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters"},outputs:{filtersChange:"filtersChange"},decls:8,vars:12,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","hidden","filters","applyFilters"],[1,"icon"],["svgIcon","filter",1,"icon","funnel"]],template:function(t,e){if(1&t&&(ra(0,"div",0),ra(1,"button",1),fa("click",function(){return e.toggleFilterVisible()}),Jo(2,OZ,3,0,"div",2),Jo(3,TZ,1,0,"ng-template",null,3,Jc),sa(),ra(5,"div",4),ra(6,"div",5),ra(7,"ccf-filters-content",6),fa("applyFilters",function(t){return e.applyFilters(t)}),sa(),sa(),sa(),sa()),2&t){const t=ta(4);ja("expanded",e.drawerExpanded),ws(2),na("ngIf",e.filtersVisible)("ngIfElse",t),ws(3),ja("visible",e.filtersVisible)("hidden",!e.filtersVisible),ws(2),na("technologyFilters",e.technologyFilters)("providerFilters",e.providerFilters)("hidden",!e.filtersVisible)("filters",e.filters)}},directives:[_h,CZ,p_],styles:[".filters-popover[_ngcontent-%COMP%]{position:inherit}.filters-popover.expanded[_ngcontent-%COMP%]{position:relative}.filters-popover.expanded[_ngcontent-%COMP%] .popup-container[_ngcontent-%COMP%]{right:inherit}.filters-popover.expanded[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding-left:4em!important}.popup-container[_ngcontent-%COMP%]{position:absolute;z-index:5;top:1.2rem;left:1.48rem;box-shadow:.2rem .2rem 1rem #00000058}.popup-container[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{padding:1.5rem;position:relative;height:26.5rem}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;height:26.5rem;transition:width .2s ease-in-out;border-width:1px}.popup-container.visible[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:1;transition-delay:.3s;transition-duration:.2s}.popup-container.hidden[_ngcontent-%COMP%]{width:0;height:0;transition:all .2s ease-out;transition-delay:.3s;pointer-events:none}.popup-container.hidden[_ngcontent-%COMP%] .popup-body[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out}.show-hide[_ngcontent-%COMP%]{background:none;border:none;z-index:10;position:relative;cursor:pointer;outline:none;padding:.5rem;border-radius:.25rem;transition:.6s}"],changeDetection:0}),t})();class AZ{constructor(t,e){this.original=t,this.level=e,this.visible=!0,this.opacity=20}get label(){return this.original.label}get expandable(){return this.original.children.length>0}static create(t,e){return new AZ(t,e)}}function PZ(t,e){if(1&t){const t=ua();ra(0,"div",5),fa("click",function(e){const n=$e(t).node,i=va();return i.select(e.ctrlKey,n,!0,!i.isSelected(n))}),Za(1),sa()}if(2&t){const t=e.node,n=va();ja("hidden",t.label===(null==n.highlightedNode?null:n.highlightedNode.label))("filtered-out",!n.occurenceData[t.original.id]&&!!n.termData[t.original.id])("unavailable",!n.termData[t.original.id])("selected",n.isSelected(t)),ws(1),Ja("colon"===t.label?"large intestine":t.label)}}function IZ(t,e){1&t&&ca(0)}const MZ=function(t){return{node:t}};function DZ(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",6),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",7),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",8),ra(4,"ccf-opacity-slider",9,10),fa("opacityChange",function(e){const n=$e(t).$implicit;return va().updateOpacity(n,e)})("opacityReset",function(){const e=$e(t).$implicit;return va().resetNode(e)})("visibilityToggle",function(){const e=$e(t).$implicit;return va().toggleVisibility(e)}),sa(),sa(),sa(),oa(6,"div",11),Jo(7,IZ,1,0,"ng-container",12),ra(8,"div",13),Za(9),sa(),sa()}if(2&t){const t=e.$implicit,n=va(),i=ta(2);na("matTreeNodePaddingIndent",n.indent),ws(1),La("display",-1!==t.opacity?"none":"block"),ws(1),La("left",n.getLeftIndent(t.level)),ja("fade",!0!==t.visible),ws(1),La("left",n.getLeftIndent(t.level)),ja("hidden",t.label!==(null==n.highlightedNode?null:n.highlightedNode.label)),ws(1),na("visible",t.visible)("opacity",t.opacity),ws(3),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Tc(18,MZ,t)),ws(1),ja("suborgan",t.level>1),ws(1),Ja(n.occurenceData[t.original.id]||0)}}function RZ(t,e){1&t&&ca(0)}function NZ(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",14),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",7),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",8),ra(4,"ccf-opacity-slider",9,15),fa("opacityChange",function(e){const n=$e(t).$implicit;return va().updateOpacity(n,e)})("opacityReset",function(){const e=$e(t).$implicit;return va().resetNode(e)})("visibilityToggle",function(){const e=$e(t).$implicit;return va().toggleVisibility(e)}),sa(),sa(),sa(),ra(6,"button",16),ra(7,"mat-icon",17),Za(8),sa(),sa(),Jo(9,RZ,1,0,"ng-container",12),ra(10,"div",13),Za(11),sa(),sa()}if(2&t){const t=e.$implicit,n=va(),i=ta(2);na("matTreeNodePaddingIndent",n.indent),ws(1),La("display",-1!==t.opacity?"none":"block"),ws(1),La("left",n.getLeftIndent(t.level)),ja("fade",!0!==t.visible),ws(1),La("left",n.getLeftIndent(t.level)),ja("hidden",t.label!==(null==n.highlightedNode?null:n.highlightedNode.label)),ws(1),na("visible",t.visible)("opacity",t.opacity),ws(2),ja("hidden",t.label===(null==n.highlightedNode?null:n.highlightedNode.label)),Zo("aria-label","Toggle ",t.label,""),ws(2),tl(" ",n.control.isExpanded(t)?"expand_less":"expand_more"," "),ws(1),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Tc(22,MZ,t)),ws(1),ja("suborgan",t.level>1),ws(1),Ja(n.occurenceData[t.original.id]||0)}}const LZ=(0,KG.property)("level"),jZ=(0,KG.property)("expandable");let FZ=(()=>{class t{constructor(t,e){this.cdr=t,this.ga=e,this.atScrollBottom=!1,this.nodeSelected=new Rc,this.nodeChanged=new Rc,this.indent="1.5rem",this.control=new OY(LZ,jZ),this.flattener=new WY(AZ.create,LZ,jZ,KG.invoke.bind(void 0,this,"getChildren")),this.dataSource=new qY(this.control,this.flattener),this._nodes=void 0,this.bodyNode=new AZ({"@id":"http://purl.obolibrary.org/obo/UBERON_0013702","@type":"OntologyTreeNode",id:"http://purl.obolibrary.org/obo/UBERON_0013702",label:"body",parent:"",children:[],synonymLabels:[]},0),this.anySelectionsMade=!1,this.selectedNodes=[]}set nodes(t){var e;this._nodes=t,this.control&&(this.dataSource.data=null!==(e=this._nodes)&&void 0!==e?e:[])}get nodes(){return this._nodes}set getChildren(t){var e;this._getChildren=t,this.dataSource.data=null!==(e=this.nodes)&&void 0!==e?e:[]}get getChildren(){return this._getChildren}set occurenceData(t){this._occurenceData=t||{}}get occurenceData(){return this._occurenceData}set termData(t){this._termData=t||{}}get termData(){return this._termData}ngOnInit(){this.control.dataNodes&&this.control.expand(this.control.dataNodes[0])}ngOnChanges(t){if(t.ontologyFilter){const e=t.ontologyFilter.currentValue;this.selectByIDs((null==e?void 0:e.length)>=0?e:[this.bodyNode.original.id])}}selectByIDs(t){const e=this.control.dataNodes,n=e.filter(e=>t.indexOf(e.original.id)>-1);(null==n?void 0:n.length)>0&&(this.selectedNodes=n,this.ga.event("nodes_selected_by_ids","ontology_tree",n.map(t=>t.label).join(",")),this.control.collapseAll(),this.selectedNodes.forEach(t=>{this.expandAndSelect(t.original,t=>{var n;return null===(n=e.find(e=>e.original.id===t.parent))||void 0===n?void 0:n.original},!0)}))}expandAndSelect(t,e,n=!1){var i;const{cdr:r,control:s}=this,o=new Set;let a=e(t);for(;a;)o.add(a),a=e(a);const l=(0,KG.filter)(s.dataNodes,t=>o.has(t.original)),c=s.dataNodes.find(e=>e.original===t);n||(this.selectedNodes=[],s.collapseAll());for(const u of l)s.expand(u);"body"===t.label&&(null===(i=s.dataNodes)||void 0===i?void 0:i.length)>0&&s.expand(s.dataNodes[0]),this.select(n,c,!1,!0),r.detectChanges()}isInnerNode(t,e){return e.expandable}isSelected(t){return this.selectedNodes.filter(e=>(null==t?void 0:t.original.label)===(null==e?void 0:e.original.label)).length>0}select(t,e,n,i){if(this.anySelectionsMade||(this.selectedNodes=[],this.anySelectionsMade=!0),void 0===e)return this.selectedNodes=[],void this.ga.event("nodes_unselected","ontology_tree");t?i?this.selectedNodes.indexOf(e)<0&&this.selectedNodes.push(e):this.selectedNodes.splice(this.selectedNodes.indexOf(e),1):(this.selectedNodes=[],i&&this.selectedNodes.push(e)),this.ga.event("nodes_selected","ontology_tree",this.selectedNodes.map(t=>t.label).join(",")),n&&this.nodeSelected.emit(this.selectedNodes.map(t=>null==t?void 0:t.original))}mouseOver(t){this.highlightedNode=t}mouseOut(){this.highlightedNode=void 0}updateOpacity(t,e){t.opacity=e,this.ga.event("opacity_update","ontology_tree",t.label,e),this.nodeChanged.emit(t)}resetNode(t){t.opacity=20,t.visible=!0,this.ga.event("node_reset","ontology_tree",t.label),this.nodeChanged.emit(t)}toggleVisibility(t){t.visible=!0!==t.visible,this.ga.event("visibility_update","ontology_tree",t.label,+t.visible),this.nodeChanged.emit(t)}getLeftIndent(t){return-1.5*t+"rem"}onScroll(t){if(!t.target)return;const{clientHeight:e,scrollHeight:n,scrollTop:i}=t.target;this.atScrollBottom=n-i-e<20}}return t.\u0275fac=function(e){return new(e||t)(ea(tc),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[ye],decls:6,vars:5,consts:[[1,"ccf-ontology-tree",3,"dataSource","treeControl","scroll"],["selectableRegion",""],["class","node leaf-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef"],["class","node inner-node","matTreeNodePadding","",3,"matTreeNodePaddingIndent","mouseleave",4,"matTreeNodeDef","matTreeNodeDefWhen"],[1,"scroll-gradient"],[1,"text",3,"click"],["matTreeNodePadding","",1,"node","leaf-node",3,"matTreeNodePaddingIndent","mouseleave"],["svgIcon","app:opacity",1,"icon","opacity",3,"mouseenter"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider1",""],[1,"non-expandable"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"num-results"],["matTreeNodePadding","",1,"node","inner-node",3,"matTreeNodePaddingIndent","mouseleave"],["slider2",""],["mat-icon-button","","matTreeNodeToggle","",1,"toggle"],[1,"icon","font-icon"]],template:function(t,e){1&t&&(ra(0,"mat-tree",0),fa("scroll",function(t){return e.onScroll(t)}),Jo(1,PZ,2,9,"ng-template",null,1,Jc),Jo(3,DZ,10,20,"mat-tree-node",2),Jo(4,NZ,12,24,"mat-tree-node",3),sa(),oa(5,"div",4)),2&t&&(na("dataSource",e.dataSource)("treeControl",e.control),ws(4),na("matTreeNodeDefWhen",e.isInnerNode),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[HY,VY,BY,zY,p_,pG,kh,__,$Y],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;height:100%;width:25.25rem;overflow:auto;overflow-x:hidden}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .toggle[_ngcontent-%COMP%]{z-index:-1;opacity:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]:first-of-type .text[_ngcontent-%COMP%]{margin-left:.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%]{min-height:0;font-size:1rem;margin-bottom:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:width;position:relative;z-index:1}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{width:0}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%] ccf-opacity-slider[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider{height:1.5rem;margin-left:1rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .slider-box .slider-and-label{width:100%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider{height:1.5rem;width:15rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .mat-slider .mat-slider-wrapper{top:12px}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] ccf-opacity-slider .opacity-value{width:3rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-right:.25rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node.inner-node[_ngcontent-%COMP%] button.hidden[_ngcontent-%COMP%]{display:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{position:relative;min-width:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:normal}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .autocomplete-open[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{border-bottom:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .non-expandable[_ngcontent-%COMP%]{margin-left:1.5rem}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{white-space:nowrap;cursor:pointer;margin-left:1rem;opacity:1;width:50%;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:opacity,width}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.hidden[_ngcontent-%COMP%]{opacity:0;width:0%}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .text.unavailable[_ngcontent-%COMP%]{pointer-events:none}.ccf-ontology-tree[_ngcontent-%COMP%] .node[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{margin-left:auto}.scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();class BZ{constructor(t){this.ontologyState=t}get rootNode(){return this.ontologyState.rootNode$}filter(t){return this.ontologyState.nodes$.pipe(D(e=>this.lookup(e,t.toLowerCase())))}lookup(t,e){const n=new Map;return t&&t.forEach(t=>{if(t.label.toLowerCase().includes(e)&&!n.get(t.id))n.set(t.id,{index:this.getIndexOfMatch(t.label,e),displayLabel:this.formatLabel(t.label,e),node:t});else{const i=t.synonymLabels.find(t=>t.toLowerCase().includes(e));i&&!n.get(t.id)&&n.set(t.id,{index:this.getIndexOfMatch(t.label+" ("+i+")",e),displayLabel:this.formatLabel(t.label+" ("+i+")",e),node:t})}}),Array.from(n.values())}getIndexOfMatch(t,e){return t.toLowerCase().indexOf(e)}formatLabel(t,e){const n=this.getIndexOfMatch(t,e);return[t.substr(0,n),t.substr(n,e.length),t.substr(n+e.length,t.length)]}getChildren(t){return(0,KG.at)(this.ontologyState.snapshot.nodes,t.children)}}function VZ(t,e){if(1&t&&(ra(0,"mat-option",8),ra(1,"span",9),Za(2),sa(),ra(3,"span",10),Za(4),sa(),ra(5,"span",11),Za(6),sa(),sa()),2&t){const t=e.$implicit;na("value",t),ws(2),Ja(t.displayLabel[0]),ws(2),Ja(t.displayLabel[1]),ws(2),Ja(t.displayLabel[2])}}BZ.\u0275fac=function(t){return new(t||BZ)(Ci($q))},BZ.\u0275prov=xt({token:BZ,factory:BZ.\u0275fac,providedIn:"root"}),sw([iB.ak],BZ.prototype,"getChildren",null);let zZ=(()=>{class t{constructor(t,e){this.ontologyService=t,this.ga=e,this.selected=new Rc,this.formControl=new gz(""),this.autoCompleteOpen=!1}ngOnInit(){this.filteredResults$=this.formControl.valueChanges.pipe(Hd(t=>"string"==typeof t),Kd(""),Qd(t=>this.ontologyService.filter(t)),D(t=>(0,KG.sortBy)(t,[this.sortBySynonymResult,"index",this.sortLexically])))}displayFormatter(t){var e;return(null!==(e=null==t?void 0:t.displayLabel)&&void 0!==e?e:[]).join("")}sortBySynonymResult(t){return t.displayLabel.join().includes("(")?1:-1}sortLexically(t){return t.node.label.toLowerCase()}onSelect(t){const e=(0,KG.get)(t,["option","value","node"]);e&&(this.ga.event("search","ontology_search",e.id),this.selected.emit(e),this.formControl.reset())}}return t.\u0275fac=function(e){return new(e||t)(ea(BZ),ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-search"]],outputs:{selected:"selected"},decls:10,vars:8,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","placeholder","Search ontology terms ...","matInput","",1,"input",3,"formControl","matAutocomplete"],[1,"ccf-ontology-search","detached","autocomplete",3,"displayWith","optionSelected","opened","closed"],["autocomplete",""],[1,"results-container"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"prefix"],[1,"search-term"],[1,"suffix"]],template:function(t,e){if(1&t&&(ra(0,"form",0),ra(1,"mat-form-field",1),ra(2,"mat-icon",2),Za(3,"search"),sa(),oa(4,"input",3),ra(5,"mat-autocomplete",4,5),fa("optionSelected",function(t){return e.onSelect(t)})("opened",function(){return e.autoCompleteOpen=!0})("closed",function(){return e.autoCompleteOpen=!1}),ra(7,"div",6),Jo(8,VZ,7,4,"mat-option",7),Ic(9,"async"),sa(),sa(),sa(),sa()),2&t){const t=ta(6);ja("autocomplete-open",e.autoCompleteOpen),ws(4),na("formControl",e.formControl)("matAutocomplete",t),ws(1),na("displayWith",e.displayFormatter),ws(3),na("ngForOf",Mc(9,6,e.filteredResults$))}},directives:[wz,YV,_z,lU,p_,nU,LU,TV,TU,XV,Cz,xU,yh,av],pipes:[Dh],styles:[".ccf-ontology-search[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:100%}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem .25rem 0;margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{border:none;height:3rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix input{margin-left:.4rem}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-prefix{top:.5rem;border:none}.ccf-ontology-search[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0 .25rem;min-width:2.5rem} .ccf-ontology-search.detached{border:.125rem solid;border-top:none;border-radius:0 0 .25rem .25rem;max-height:18rem} .ccf-ontology-search.detached .results-container{width:23.75rem;margin-bottom:1rem;overflow:auto;max-height:15rem;scrollbar-width:thin} .ccf-ontology-search.detached .results-container mat-option{height:1.5rem;width:23.75rem} .ccf-ontology-search.detached .results-container mat-option .search-term{text-decoration:underline}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:.25rem 0 0;border-bottom:none}.autocomplete-open[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 .25rem 0 0;border-bottom:none}"],changeDetection:0}),t})();const UZ=function(t){return[t]};function HZ(t,e){if(1&t){const t=ua();ra(0,"ccf-ontology-tree",2),fa("nodeSelected",function(e){return $e(t),va().ontologySelection.emit(e)}),sa()}if(2&t){const t=e.ngIf,n=va();na("nodes",Tc(5,UZ,t))("getChildren",n.ontologySearchService.getChildren)("occurenceData",n.occurenceData)("termData",n.termData)("ontologyFilter",n.ontologyFilter)}}let $Z=(()=>{class t{constructor(t,e){this.ontologySearchService=t,this.store=e,this.ontologySelection=new Rc}selected(t){const{nodes:e}=this.store.selectSnapshot($q);this.tree.expandAndSelect(t,t=>e[t.parent])}}return t.\u0275fac=function(e){return new(e||t)(ea(BZ),ea(pV))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-selection"]],viewQuery:function(t,e){if(1&t&&qc(FZ,5),2&t){let t;Wc(t=Yc())&&(e.tree=t.first)}},inputs:{occurenceData:"occurenceData",termData:"termData",ontologyFilter:"ontologyFilter"},outputs:{ontologySelection:"ontologySelection"},decls:3,vars:3,consts:[[3,"selected"],["class","tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","getChildren","occurenceData","termData","ontologyFilter","nodeSelected"]],template:function(t,e){1&t&&(ra(0,"ccf-ontology-search",0),fa("selected",function(t){return e.selected(t)}),sa(),Jo(1,HZ,1,7,"ccf-ontology-tree",1),Ic(2,"async")),2&t&&(ws(1),na("ngIf",Mc(2,1,e.ontologySearchService.rootNode)))},directives:[zZ,_h,FZ],pipes:[Dh],styles:[""],changeDetection:0}),t})(),GZ=(()=>{class t{constructor(t,e,n){this.drawer=t,this.cdr=n,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new g;const i=e.connect(this);this.subscriptions.add(i.getMessagesFromSource(t).subscribe(t=>{this.handleMessage(t)&&n.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",e="arrow_left";return"end"===this.position&&([t,e]=[e,t]),this.opened?e:t}ngAfterViewInit(){setTimeout(()=>{this.position=this.drawer.position,this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return"drawer-toggled"===t.payload.type&&(this.opened=t.payload.opened,!0)}toggle(){const t=this.drawer,{opened:e,expanded:n}=t;e?n?t.closeExpanded():t.close():t.open()}}return t.\u0275fac=function(e){return new(e||t)(ea(cZ),ea(iZ),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,e){2&t&&(Ba(e.className),ja("ccf-drawer-toggle-button-end",e.classEnd))},decls:2,vars:1,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,e){1&t&&(ra(0,"mat-icon",0),fa("click",function(){return e.toggle()}),Za(1),sa()),2&t&&(ws(1),tl(" ",e.icon,"\n"))},directives:[p_],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;display:flex;align-items:center;transition:.6s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:relative;right:.25rem;transition:all .5s}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}"],changeDetection:0}),t})();function WZ(t,e){1&t&&(ra(0,"div",7),oa(1,"mat-spinner",8),ra(2,"span",3),Za(3,"Loading External Site"),sa(),sa())}function qZ(t,e){if(1&t){const t=ua();ra(0,"iframe",9),fa("load",function(){return $e(t),va().loading=!1}),sa()}2&t&&Ko("src",va().safeUrl,wr)}let XZ=(()=>{class t{constructor(t){this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new Rc,this.loading=!0,this.safeUrl=null}ngOnChanges(t){"url"in t&&this.updateUrl()}updateUrl(){const{sanitizer:t,url:e}=this;this.safeUrl=null,e&&(this.safeUrl=t.bypassSecurityTrustResourceUrl(e),this.loading=!0)}}return t.\u0275fac=function(e){return new(e||t)(ea(hd))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},inputs:{url:"url"},outputs:{closed:"closed"},features:[ye],decls:11,vars:4,consts:[[1,"toolbar"],["mat-flat-button","","target","_blank","rel","noopener noreferrer",1,"launch",3,"href","disabled"],[1,"icon"],[1,"text"],["mat-flat-button","",1,"close",3,"click"],["class","overlay",4,"ngIf"],["class","frame","title","Portal Data Viewer","referrerpolicy","no-referrer",3,"load",4,"ngIf"],[1,"overlay"],[1,"spinner"],["title","Portal Data Viewer","referrerpolicy","no-referrer",1,"frame",3,"load"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"a",1),ra(2,"mat-icon",2),Za(3,"launch"),sa(),ra(4,"span",3),Za(5,"Open in Portal"),sa(),sa(),ra(6,"button",4),fa("click",function(){return e.closed.emit()}),ra(7,"mat-icon",2),Za(8,"clear"),sa(),sa(),sa(),Jo(9,WZ,4,0,"div",5),Jo(10,qZ,1,1,"iframe",6)),2&t&&(ws(1),na("href",e.safeUrl,_r)("disabled",!e.safeUrl),ws(8),na("ngIf",e.loading),ws(1),na("ngIf",e.safeUrl))},directives:[w_,p_,__,_h,XQ],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;width:100%;height:1.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%]{margin-right:3.5rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch.mat-button-disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .launch[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.25rem}[_nghost-%COMP%] .toolbar[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{min-width:0;padding:0;line-height:1.5rem;border-radius:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:1.5rem;bottom:0;left:0;right:0}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{margin-bottom:.5rem}[_nghost-%COMP%] .frame[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0}),t})();function YZ(t,e){if(1&t&&oa(0,"div",3),2&t){const t=e.index;ja("line-tick-visible",va().tissueSectionExists(t+1))}}const KZ=function(){return[]};let QZ=(()=>{class t{constructor(){this.clsName="ccf-tissue-section-vis"}tissueSectionExists(t){return this.tissueSections.filter(e=>e.sectionNumber===t).length>0}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tissue-section-vis"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{totalTissueSections:"totalTissueSections",tissueSections:"tissueSections"},decls:7,vars:3,consts:[[1,"container"],["class","line-tick",3,"line-tick-visible",4,"ngFor","ngForOf"],[1,"x-axis"],[1,"line-tick"]],template:function(t,e){1&t&&(ra(0,"div"),Za(1,"0"),sa(),ra(2,"div",0),Jo(3,YZ,1,2,"div",1),oa(4,"div",2),sa(),ra(5,"div"),Za(6),sa()),2&t&&(ws(3),na("ngForOf",Oc(2,KZ).constructor(e.totalTissueSections)),ws(3),Ja(e.totalTissueSections))},directives:[yh],styles:["[_nghost-%COMP%]{width:100%;height:2.5rem;padding:.5rem 1rem;display:flex}[_nghost-%COMP%] .container[_ngcontent-%COMP%]{margin-right:.5rem;margin-left:.5rem;flex-grow:1;display:flex;position:relative;justify-content:space-evenly}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .line-tick[_ngcontent-%COMP%]{height:100%;width:1px;z-index:2}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .x-axis[_ngcontent-%COMP%]{width:100%;height:2px;position:absolute;top:calc(50% - 1px);right:0;z-index:1}"],changeDetection:0}),t})();function ZZ(t,e){if(1&t){const t=ua();ra(0,"div",7),ra(1,"div",8),Za(2),sa(),ra(3,"a",9),fa("click",function(){$e(t);const e=va().$implicit;return va().linkClicked.emit(e)}),Za(4," DATA "),ra(5,"mat-icon"),Za(6,"open_in_new"),sa(),sa(),sa()}if(2&t){const t=va().$implicit;ws(1),La("background-image","url("+t.thumbnail+")"),ws(1),tl(" ",t.technology," ")}}function JZ(t,e){1&t&&(aa(0),Jo(1,ZZ,7,3,"ng-template",6),la())}const tJ=(()=>{let t=-1;return()=>(t+=1,t)})();let eJ=(()=>{class t{constructor(){this.className="ccf-thumbnail-carousel",this.linkClicked=new Rc,this.uid=tJ(),this.config={allowTouchMove:!1,slidesOffsetBefore:4,slidesOffsetAfter:4,slidesPerView:"auto",spaceBetween:4,watchOverflow:!0},this.navigation={prevEl:"#"+this.prevButtonId,nextEl:"#"+this.nextButtonId}}get prevButtonId(){return`ccf-thumbnail-carousel-prev-button-${this.uid}`}get nextButtonId(){return`ccf-thumbnail-carousel-next-button-${this.uid}`}itemId(t,e){return e.thumbnail}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-thumbnail-carousel"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.className)},inputs:{data:"data"},outputs:{linkClicked:"linkClicked"},decls:11,vars:6,consts:[[1,"prev"],["mat-icon-button","","disableRipple",""],[1,"swiper",3,"config","navigation"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"next"],[1,"fade"],["swiperSlide",""],[1,"slide"],[1,"thumbnail"],[1,"link",3,"click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"button",1),ra(2,"mat-icon"),Za(3,"navigate_before"),sa(),sa(),sa(),ra(4,"swiper",2),Jo(5,JZ,2,0,"ng-container",3),sa(),ra(6,"div",4),ra(7,"button",1),oa(8,"div",5),ra(9,"mat-icon"),Za(10,"navigate_next"),sa(),sa(),sa()),2&t&&(ws(1),Ko("id",e.prevButtonId),ws(3),na("config",e.config)("navigation",e.navigation),ws(1),na("ngForOf",e.data)("ngForTrackBy",e.itemId),ws(2),Ko("id",e.nextButtonId))},directives:[__,p_,OQ,yh,CQ],styles:['[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%]{flex-grow:1;padding-bottom:.3125rem}[_nghost-%COMP%] .swiper[_ngcontent-%COMP%] .swiper-slide{width:3.75rem;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.8125rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;line-height:1.5rem}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{position:absolute;top:-.625rem;left:-2rem;z-index:10;width:2rem;height:3.125rem;opacity:1;transition:opacity ease-in-out .3s;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%]{cursor:default;pointer-events:none}[_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .prev[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-disabled[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%], [_nghost-%COMP%] .next[_ngcontent-%COMP%] .swiper-button-lock[_ngcontent-%COMP%] .fade[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background-size:cover;position:relative;width:calc(100% - 2 * .125rem);height:calc(100% - 2 * .125rem);border-style:solid;border-width:.125rem;border-radius:.25rem;background-origin:padding-box;background-clip:padding-box;font-size:.875rem;font-weight:bold}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-.125rem;left:-.125rem;width:.125rem;height:.125rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;bottom:0;right:0;left:0;opacity:0;transition:opacity ease-in-out .3s;box-shadow:0 2px 4px #0009;font-size:.75rem;line-height:.75rem}[_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%], [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:link, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:visited, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:focus, [_nghost-%COMP%] .slide[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:active{cursor:pointer;text-decoration:none}[_nghost-%COMP%] .slide[_ngcontent-%COMP%]:hover .link[_ngcontent-%COMP%]{opacity:1}'],changeDetection:0}),t})();function nJ(t,e){if(1&t){const t=ua();ra(0,"mat-icon",14),fa("click",function(){return $e(t),va().toggleExpansion()}),Za(1),sa()}if(2&t){const t=va();ws(1),Ja(t.expanded?"expand_less":"expand_more")}}function iJ(t,e){if(1&t&&oa(0,"ccf-tissue-section-vis",20),2&t){const t=va(2);na("totalTissueSections",t.tissueBlock.sectionCount)("tissueSections",t.tissueBlock.sections)}}function rJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"ccf-thumbnail-carousel",21),fa("linkClicked",function(e){return $e(t),va(2).linkHandler(e.link)}),sa(),la()}if(2&t){const t=va(2);ws(1),na("data",t.tissueBlock.datasets)}}function sJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"ccf-thumbnail-carousel",21),fa("linkClicked",function(e){return $e(t),va(3).linkHandler(e.link)}),sa(),la()}if(2&t){const t=va().$implicit;ws(1),na("data",t.datasets)}}function oJ(t,e){if(1&t){const t=ua();ra(0,"div",22),ra(1,"div",23),ra(2,"mat-icon",24),Za(3,"bubble_chart"),sa(),ra(4,"div",17),ra(5,"div",8),Za(6),sa(),ra(7,"div",8),Za(8),sa(),sa(),ra(9,"div",9),fa("click",function(){const e=$e(t).$implicit;return va(2).linkHandler(e.link)}),ra(10,"div",10),Za(11,"TISSUE SECTION"),sa(),ra(12,"mat-icon",11),Za(13,"open_in_new"),sa(),sa(),sa(),Jo(14,sJ,2,1,"ng-container",13),sa()}if(2&t){const t=e.$implicit;ws(6),Ja(t.label),ws(2),Ja(t.description),ws(6),na("ngIf",t.datasets.length>0)}}function aJ(t,e){if(1&t){const t=ua();aa(0),ra(1,"div",15),ra(2,"div",16),ra(3,"mat-icon",5),Za(4,"bubble_chart"),sa(),ra(5,"div",17),ra(6,"div",8),Za(7),sa(),ra(8,"div",8),Za(9),sa(),sa(),ra(10,"div",9),fa("click",function(){$e(t);const e=va();return e.linkHandler(e.tissueBlock.link)}),ra(11,"div",10),Za(12,"TISSUE BLOCK"),sa(),ra(13,"mat-icon",11),Za(14,"open_in_new"),sa(),sa(),sa(),Jo(15,iJ,1,2,"ccf-tissue-section-vis",18),Jo(16,rJ,2,1,"ng-container",13),sa(),Jo(17,oJ,15,3,"div",19),la()}if(2&t){const t=va();ws(7),Ja(t.tissueBlock.label),ws(2),Ja(t.tissueBlock.description),ws(6),na("ngIf",t.tissueBlock.sections.length>1),ws(1),na("ngIf",t.tissueBlock.datasets.length>0),ws(1),na("ngForOf",t.tissueBlock.sections)}}const lJ=function(t){return{"background-color":t}};let cJ=(()=>{class t{constructor(t){this.ga=t,this.clsName="ccf-donor-card",this.selected=!1,this.expanded=!1,this.highlighted=!1,this.checked=new Rc,this.linkClick=new Rc,this.hoverState=""}handleCheckbox(){this.selected=!this.selected,this.ga.event("selected_toggled","donor_card",this.tissueBlock.label,+this.selected),this.checked.emit(this.selected),this.expanded=!1}toggleExpansion(){this.selected&&(this.expanded=!this.expanded,this.ga.event("expanded_toggled","donor_card",this.tissueBlock.label,+this.expanded))}linkHandler(t){this.ga.event("link_clicked","donor_card",this.tissueBlock.label),this.selected?this.linkClick.emit(t):(this.selected=!0,this.checked.emit(this.selected))}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(t,e){2&t&&Ba(e.clsName)},inputs:{tissueBlock:"tissueBlock",selected:"selected",color:"color",expanded:"expanded",highlighted:"highlighted"},outputs:{checked:"checked",linkClick:"linkClick"},decls:19,vars:20,consts:[[1,"main-container"],[1,"checkbox-background",3,"ngStyle","click"],[1,"checkbox",3,"checked"],[1,"hoverable","default-padding","donor","mat-elevation-z2"],[1,"d-flex"],[1,"icon-size","icon-dark","mr-5"],[1,"donor-info"],[1,"title","description"],[1,"description"],[1,"hover-state","mat-elevation-z4",3,"click"],[1,"hover-title"],[1,"icon-size","hover-icon"],["class","icon-size ml-5 selectable",3,"click",4,"ngIf"],[4,"ngIf"],[1,"icon-size","ml-5","selectable",3,"click"],[1,"expanded-view","mat-elevation-z2","align-end"],[1,"info-block","hover-enabled","default-padding"],[1,"text-content"],[3,"totalTissueSections","tissueSections",4,"ngIf"],["class","expanded-view w-80 mat-elevation-z2 align-end",4,"ngFor","ngForOf"],[3,"totalTissueSections","tissueSections"],[1,"mt-05",3,"data","linkClicked"],[1,"expanded-view","w-80","mat-elevation-z2","align-end"],[1,"default-padding","info-block","hover-enabled"],[1,"icon-size","mr-5","icon-light"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),fa("click",function(){return e.handleCheckbox()}),oa(2,"mat-checkbox",2),sa(),ra(3,"div",3),ra(4,"div",4),ra(5,"mat-icon",5),Za(6,"person"),sa(),ra(7,"div",6),ra(8,"div",7),Za(9),sa(),ra(10,"div",8),Za(11),sa(),sa(),sa(),ra(12,"div",9),fa("click",function(){return e.linkHandler(e.tissueBlock.donor.link)}),ra(13,"div",10),Za(14,"DONOR"),sa(),ra(15,"mat-icon",11),Za(16,"open_in_new"),sa(),sa(),Jo(17,nJ,2,1,"mat-icon",12),sa(),sa(),Jo(18,aJ,18,5,"ng-container",13)),2&t&&(ws(1),ja("selected",e.selected)("highlighted",e.highlighted),na("ngStyle",Tc(18,lJ,e.selected?e.color:"transparent")),ws(1),ja("checkselected",e.selected),na("checked",e.selected),ws(1),ja("hover-enabled",e.selected)("expanded",e.expanded)("highlighted",e.highlighted),ws(6),Ja(e.tissueBlock.donor.label),ws(2),Ja(e.tissueBlock.donor.description),ws(6),na("ngIf",e.selected),ws(1),na("ngIf",e.expanded))},directives:[Th,oX,p_,_h,yh,QZ,eJ],styles:["[_nghost-%COMP%]{width:100%}[_nghost-%COMP%] .main-container[_ngcontent-%COMP%]{display:flex;min-height:3rem;width:100%;align-items:center;padding-left:.5rem}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%]{height:2rem;width:2rem;border-radius:50%;margin-right:.5rem;display:flex;justify-content:center;align-items:center;cursor:pointer}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-checked.mat-accent .mat-checkbox-background, [_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .mat-checkbox-indeterminate.mat-accent[_ngcontent-%COMP%] .mat-checkbox-background[_ngcontent-%COMP%]{background-color:transparent}[_nghost-%COMP%] .checkbox-background.highlighted[_ngcontent-%COMP%] .mat-ripple-element{opacity:.04}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkselected[_ngcontent-%COMP%] .mat-checkbox-frame{border-color:#fff!important}[_nghost-%COMP%] .checkbox-background[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{margin-left:1.12rem;margin-bottom:.12rem}[_nghost-%COMP%] .align-end[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;width:100%;align-items:center}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%]:not(:first-child){margin-top:.5rem}[_nghost-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .donor.highlighted[_ngcontent-%COMP%]{box-shadow:0 6px 2px -2px #0003,0 4px 4px #00000024,0 2px 10px #0000001f}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .hover-state[_ngcontent-%COMP%]{width:19.5rem!important}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .hoverable[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .hover-enabled[_ngcontent-%COMP%]:hover .hover-state[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%]{transition:opacity .15s ease-in-out;opacity:0;cursor:pointer;position:absolute;height:100%;width:100%;top:0;margin-left:-.5rem;align-items:center;display:flex;justify-content:flex-end;padding-right:1rem;font-size:.75rem}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-title[_ngcontent-%COMP%]{font-weight:lighter}[_nghost-%COMP%] .hover-state[_ngcontent-%COMP%] .hover-icon[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .default-padding[_ngcontent-%COMP%]{padding:.25rem .5rem}[_nghost-%COMP%] .expanded-view[_ngcontent-%COMP%]{margin-top:.25rem;width:85%;margin-bottom:.25rem}[_nghost-%COMP%] .d-flex[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .icon-size[_ngcontent-%COMP%]{height:1.5rem;width:1.5rem;font-size:1.5rem}[_nghost-%COMP%] .selectable[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%]{width:80%!important}[_nghost-%COMP%] .w-80[_ngcontent-%COMP%] .info-block[_ngcontent-%COMP%] .text-content[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:16rem!important}[_nghost-%COMP%] .ml-5[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .mr-5[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .mt-05[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),t})();function uJ(t,e){if(1&t&&(ra(0,"div",7),ra(1,"div",8),Za(2),sa(),ra(3,"div",9),Za(4),sa(),sa()),2&t){const t=e.$implicit;ws(2),Ja(t.count),ws(2),Ja(t.label)}}function hJ(t,e){if(1&t){const t=ua();ra(0,"div",10),fa("mouseenter",function(){const e=$e(t).$implicit;return va().handleHover(e.tissueBlock.spatialEntityId)})("mouseleave",function(){return $e(t),va().handleUnhover()}),ra(1,"ccf-donor-card",11),fa("checked",function(e){const n=$e(t).$implicit;return va().handleSelection(n,e)})("linkClick",function(e){return $e(t),va().handleLinkClick(e)}),sa(),sa()}if(2&t){const t=e.$implicit,n=va();ws(1),na("tissueBlock",t.tissueBlock)("selected",t.selected)("color",t.color)("highlighted",t.tissueBlock.spatialEntityId===n.highlighted)}}let dJ=(()=>{class t{constructor(t){this.ga=t,this.linkClicked=new Rc,this.listResultSelected=new Rc,this.listResultDeselected=new Rc,this.itemHovered=new Rc,this.itemUnhovered=new Rc,this.atScrollBottom=!1}handleSelection(t,e){this.ga.event("list_result_selected","results_browser",this.resultLabel,+e),e?this.listResultSelected.next(t):this.listResultDeselected.next(t)}handleLinkClick(t){this.linkClicked.emit(t)}onScroll(t){if(!t.target)return;const{clientHeight:e,scrollHeight:n,scrollTop:i}=t.target;this.atScrollBottom=n-i-e<64}handleHover(t){this.itemHovered.emit(t)}handleUnhover(){this.itemUnhovered.emit()}}return t.\u0275fac=function(e){return new(e||t)(ea(W$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:5,consts:[[1,"results-browser-container"],[1,"stat-box"],["id","title"],["class","stat-row",4,"ngFor","ngForOf"],[1,"results-browser-list",3,"scroll"],["class","browser-item-container",3,"mouseenter","mouseleave",4,"ngFor","ngForOf"],[1,"scroll-gradient"],[1,"stat-row"],[1,"stat-value"],[1,"stat-label"],[1,"browser-item-container",3,"mouseenter","mouseleave"],[3,"tissueBlock","selected","color","highlighted","checked","linkClick"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),Za(3),sa(),Jo(4,uJ,5,2,"div",3),sa(),ra(5,"div",4),fa("scroll",function(t){return e.onScroll(t)}),Jo(6,hJ,2,4,"div",5),sa(),oa(7,"div",6),sa()),2&t&&(ws(3),Ja(e.resultLabel),ws(1),na("ngForOf",e.aggregateData),ws(2),na("ngForOf",e.listResults),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[yh,cJ],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 7rem);padding:0 1.5rem 1.5rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%]{margin-bottom:1.5rem;line-height:1.25;min-height:7.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] #title[_ngcontent-%COMP%]{font-size:1.25rem;margin-bottom:.75rem}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-value[_ngcontent-%COMP%]{margin-right:1rem;width:5.5rem;text-align:right;font-weight:600}.results-browser-container[_ngcontent-%COMP%] .stat-box[_ngcontent-%COMP%] .stat-row[_ngcontent-%COMP%] .stat-label[_ngcontent-%COMP%]{font-weight:300}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;overflow-y:scroll;scrollbar-width:thin;padding-right:.5rem;margin-bottom:2rem}.results-browser-container[_ngcontent-%COMP%] .results-browser-list[_ngcontent-%COMP%] .browser-item-container[_ngcontent-%COMP%]{width:100%}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient[_ngcontent-%COMP%]{position:absolute;height:9rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();function pJ(t,e){1&t&&(ra(0,"a",5),Za(1,"LOGIN"),sa()),2&t&&na("href",va().hubmapPortalUrl+"login",_r)}function fJ(t,e){1&t&&(ra(0,"a",5),Za(1,"LOGOUT"),sa()),2&t&&na("href",va().hubmapPortalUrl+"logout",_r)}let gJ=(()=>{class t{constructor(){this.refreshClicked=new Rc,this.downloadClicked=new Rc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-header"]],inputs:{hubmapPortalUrl:"hubmapPortalUrl",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:3,consts:[[1,"ccf-header"],[1,"portal-home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right","svgIcon","app:logo",1,"logo"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"href",4,"ngIf"],["mat-button","","rel","noreferrer noopener","target","_blank",1,"authentication",3,"href"]],template:function(t,e){1&t&&(ra(0,"mat-toolbar",0),ra(1,"a",1),oa(2,"mat-icon",2),sa(),oa(3,"div",3),Jo(4,pJ,2,1,"a",4),Jo(5,fJ,2,1,"a",4),sa()),2&t&&(ws(1),na("href",e.hubmapPortalUrl,_r),ws(3),na("ngIf",!e.loggedIn),ws(1),na("ngIf",e.loggedIn))},directives:[BG,p_,ew,_h,w_],styles:[".ccf-header[_ngcontent-%COMP%]{height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid;display:flex}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%}.ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%]{height:1.5rem}.ccf-header[_ngcontent-%COMP%] .authentication[_ngcontent-%COMP%]{width:8.25rem;border-radius:.125rem;font-weight:500}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .download[_ngcontent-%COMP%], .ccf-header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{display:flex;align-items:center;transition:color 1s;cursor:pointer;text-decoration:none}.ccf-header[_ngcontent-%COMP%] [_ngcontent-%COMP%]:not(:last-child){margin-right:1.5rem}.ccf-header[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}.ccf-header[_ngcontent-%COMP%] .filter-labels[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;font:400 1rem/1.25rem Inter,sans-serif}"],changeDetection:0}),t})();const mJ=["bodyUI"];function bJ(t,e){if(1&t&&(oa(0,"ccf-header",33),Ic(1,"async")),2&t){const t=va();na("hubmapPortalUrl",Mc(1,2,t.portalUrl$))("loggedIn",t.loggedIn)}}const yJ=function(){return{}},vJ=function(){return{x:2.2,y:2,z:.4}};let _J=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c){this.data=n,this.theming=i,this.scene=r,this.listResultsState=s,this.consentService=o,this.snackbar=a,this.globalConfig=c,this.ontologySelectionLabel="Body",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=RG.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(D(t=>t===Nq.Running)),this.portalUrl$=this.globalConfig.getOption("hubmapPortalUrl"),i.initialize(t,e),l.setRootElement(t),n.tissueBlockData$.subscribe(),n.aggregateData$.subscribe(),n.termOccurencesData$.subscribe(),n.sceneData$.subscribe(),n.filter$.subscribe(),n.technologyFilterData$.subscribe(),n.providerFilterData$.subscribe(),this.ontologyTerms$=n.filter$.pipe(FU("ontologyTerms"))}ngOnInit(){const t=this.snackbar.openFromComponent(TG,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia&&(window.matchMedia("(prefers-color-scheme: dark)").matches&&this.theming.setTheme(IG),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.theming.setTheme(t.matches?IG:PG)}))}reset(t,e,n){t.open(),t.closeExpanded(),e.open(),e.closeExpanded(),n.removeBox(),this.resetView()}resetView(){this.bodyUI.target=[0,0,0],this.bodyUI.rotation=0,this.bodyUI.rotationX=0,this.bodyUI.bounds={x:2.2,y:2,z:.4}}toggleScheme(){this.theming.setTheme(this.theming.getTheme()===PG?IG:PG)}ontologySelected(t){if(t)return this.data.updateFilter({ontologyTerms:t.map(t=>t.id)}),this.ontologySelectionLabel=this.createSelectionLabel(t),void(t[0]&&"body"===t[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[]}),this.ontologySelectionLabel=""}createSelectionLabel(t){if(0===t.length)return"";if(1===t.length)return t[0].label;let e="";return t.forEach((n,i)=>{e+=n.label,inull==t?void 0:t.startsWith(e))?(this.url=t,this.viewerOpen=!!t):(window.open(t,"_blank"),this.closeiFrameViewer())}closeiFrameViewer(){this.viewerOpen=!1}get loggedIn(){var t;return(null!==(t=this.globalConfig.snapshot.hubmapToken)&&void 0!==t?t:"").length>0}}return t.\u0275fac=function(e){return new(e||t)(ea(kl),ea(No),ea(Fq),ea(MG),ea(Wq),ea(zq),ea(Y$),ea(q_),ea(Nf),ea(SG))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-root"]],viewQuery:function(t,e){if(1&t&&qc(mJ,5),2&t){let t;Wc(t=Yc())&&(e.bodyUI=t.first)}},decls:70,vars:77,consts:[[1,"ccf-app","mat-app-background"],["text","Loading CCF Exploration User Interface (EUI)",3,"active"],[3,"hubmapPortalUrl","loggedIn",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","filtersChange"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],[3,"termData","occurenceData","ontologySelection"],["position","end","opened","",1,"right-drawer",3,"stateChange"],["right",""],[1,"portal-view",3,"url","closed"],[1,"drawer-icons"],[1,"drawer-icons-left"],[1,"button",3,"matTooltip","click"],[1,"icon"],[1,"scheme-toggle","button",3,"matTooltip","click"],[1,"button"],["matTooltip","Reset View",1,"refresh","icon",3,"click"],["videoID","YAHJqvD3Q_8","infoTitle","HuBMAP CCF Exploration User Interface","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],[1,"close-button-wrapper"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"hubmapPortalUrl","loggedIn"]],template:function(t,e){if(1&t){const t=ua();ra(0,"div",0),oa(1,"ccf-spinner-overlay",1),Ic(2,"async"),Jo(3,bJ,2,4,"ccf-header",2),Ic(4,"async"),ra(5,"ccf-drawer-container",3),ra(6,"ccf-drawer",4,5),fa("stateChange",function(){return $e(t),ta(11).removeBox()}),ra(8,"div"),ra(9,"div",6),ra(10,"ccf-filters-popover",7,8),fa("filtersChange",function(t){return e.data.updateFilter(t)}),Ic(12,"async"),Ic(13,"async"),Ic(14,"async"),sa(),ra(15,"div",9),ra(16,"div",10),Za(17,"Sex: "),ra(18,"strong"),Za(19),Ic(20,"async"),sa(),sa(),ra(21,"div",11),Za(22,"Age: "),ra(23,"strong"),Za(24),Ic(25,"async"),Ic(26,"async"),sa(),sa(),ra(27,"div",12),Za(28,"BMI: "),ra(29,"strong"),Za(30),Ic(31,"async"),Ic(32,"async"),sa(),sa(),sa(),sa(),ra(33,"ccf-ontology-selection",13),fa("ontologySelection",function(t){return e.ontologySelected(t)}),Ic(34,"async"),Ic(35,"async"),sa(),oa(36,"ccf-drawer-toggle-button"),sa(),sa(),ra(37,"ccf-drawer",14,15),fa("stateChange",function(){return $e(t),ta(11).removeBox()}),ra(39,"ccf-viewer",16),fa("closed",function(){return e.viewerOpen=!1}),sa(),ra(40,"div",17),ra(41,"div",18),ra(42,"button",19),fa("click",function(){$e(t);const e=ta(11),n=ta(38);return e.removeBox(),n.toggleExpanded()}),ra(43,"mat-icon",20),Za(44),sa(),sa(),ra(45,"button",21),fa("click",function(){return e.toggleScheme()}),ra(46,"mat-icon",20),Za(47),sa(),sa(),ra(48,"button",22),ra(49,"mat-icon",23),fa("click",function(){$e(t);const n=ta(7),i=ta(38),r=ta(11);return e.reset(n,i,r)}),Za(50,"refresh "),sa(),sa(),sa(),oa(51,"ccf-info-button",24),sa(),ra(52,"ccf-results-browser",25),fa("listResultSelected",function(t){return e.listResultsState.selectListResult(t)})("listResultDeselected",function(t){return e.listResultsState.deselectListResult(t)})("linkClicked",function(t){return e.openiFrameViewer(t)})("itemHovered",function(t){return e.listResultsState.highlightNode(t)})("itemUnhovered",function(){return e.listResultsState.unHighlightNode()}),Ic(53,"async"),Ic(54,"async"),Ic(55,"async"),sa(),oa(56,"ccf-drawer-toggle-button"),sa(),ra(57,"ccf-drawer-content"),ra(58,"div",26),ra(59,"ccf-organ-selector",27),fa("organsChanged",function(t){return e.scene.setSelectedReferenceOrgans(t)}),Ic(60,"async"),Ic(61,"async"),Ic(62,"async"),sa(),sa(),ra(63,"div",28),ra(64,"div",29),fa("click",function(){return e.organListVisible=!e.organListVisible}),ra(65,"mat-icon",30),Za(66),sa(),sa(),sa(),ra(67,"ccf-body-ui",31,32),fa("nodeClick",function(t){return e.scene.sceneNodeClicked(t)})("nodeHoverStart",function(t){return e.scene.sceneNodeHovered(t)})("nodeHoverStop",function(){return e.scene.sceneNodeUnhover()}),Ic(69,"async"),sa(),sa(),sa(),sa()}if(2&t){const t=ta(38);let n,i,r,s;ws(1),na("active",Mc(2,37,e.spinnerActive$)),ws(2),na("ngIf",!1===Mc(4,39,e.spinnerActive$)),ws(7),na("filters",Mc(12,41,e.data.filter$))("drawerExpanded",t.expanded)("technologyFilters",Mc(13,43,e.data.technologyFilterData$))("providerFilters",Mc(14,45,e.data.providerFilterData$)),ws(9),Ja(null==(n=Mc(20,47,e.data.filter$))?null:n.sex),ws(5),el("",null==(i=Mc(25,49,e.data.filter$))?null:i.ageRange[0],"-",null==(i=Mc(26,51,e.data.filter$))?null:i.ageRange[1],""),ws(6),el("",null==(r=Mc(31,53,e.data.filter$))?null:r.bmiRange[0],"-",null==(r=Mc(32,55,e.data.filter$))?null:r.bmiRange[1],""),ws(3),na("termData",Mc(34,57,e.data.ontologyTermsFullData$))("occurenceData",Mc(35,59,e.data.termOccurencesData$)),ws(6),ja("opened",e.viewerOpen),na("url",e.url),ws(3),na("matTooltip",t.expanded?"Exit Fullscreen":"Enter Fullscreen"),ws(2),Ja(t.expanded?"fullscreen_exit":"fullscreen"),ws(1),na("matTooltip","light-theme"===e.theming.getTheme()?"Enter Dark Mode":"Enter Light Mode"),ws(2),tl("","light-theme"===e.theming.getTheme()?"brightness_2":"brightness_5"," "),ws(5),na("listResults",Mc(53,61,e.listResultsState.listResults$))("aggregateData",Mc(54,63,e.data.aggregateData$))("resultLabel",e.ontologySelectionLabel)("highlighted",Mc(55,65,e.listResultsState.highlightedNodeId$)),ws(6),ja("closed",!e.organListVisible),ws(1),na("multiselect",!0)("occurenceData",null!==(s=Mc(60,67,e.data.termOccurencesData$))&&void 0!==s?s:Oc(75,yJ))("organList",Mc(61,69,e.scene.referenceOrgans$))("selectedOrgans",Mc(62,71,e.scene.selectedReferenceOrgans$)),ws(4),ja("closed",!e.organListVisible),ws(3),tl(" ",e.organListVisible?"arrow_drop_up":"arrow_drop_down"," "),ws(1),ja("expanded-stage",!e.organListVisible),na("scene",Mc(69,73,e.scene.scene$))("bounds",Oc(76,vJ))}},directives:[nZ,_h,fZ,cZ,kZ,$Z,GZ,XZ,ew,p_,wG,dJ,sZ,hG,nG,gJ],pipes:[Dh],styles:[".cdk-overlay-container{position:absolute;font-size:1.2rem}[_nghost-%COMP%]{display:block;position:relative}.ccf-app[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;position:relative;text-align:left}.ccf-app[_ngcontent-%COMP%] ccf-header[_ngcontent-%COMP%]{z-index:99}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{flex-grow:1;height:100%;width:100%;opacity:1;overflow:visible;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{overflow:hidden;margin-bottom:1.5rem;border-radius:.5rem;height:100%;padding-bottom:4rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .organ-selector[_ngcontent-%COMP%]{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:28.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%]{display:flex;padding-left:1.5rem;height:5rem;padding-right:1.5rem;align-items:center;justify-content:space-between}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%] .drawer-icons[_ngcontent-%COMP%] .drawer-icons-left[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;padding:.65rem;transition:.6s}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5rem;transition:all .5s ease-in-out}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-4.25rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{transition:all .5s ease-in-out;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem;height:calc(100% - 6rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:100%;padding-bottom:3rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;border-top-right-radius:.5rem;border-top-left-radius:.5rem;height:0}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{display:flex;justify-content:center;height:1.0625rem;width:3rem;align-self:center;border-radius:0 0 .25rem .25rem;cursor:pointer;transition:.6s;position:relative;top:.5rem;z-index:1}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{position:relative;bottom:.2rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%]{padding-left:1.5rem;padding-right:1.5rem;height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{height:100%}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%]{height:5rem;display:flex;align-items:center}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:75%;margin-left:1.5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%]{font-weight:300}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .filter-data[_ngcontent-%COMP%] .filter-text[_ngcontent-%COMP%] .filter-tag[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600!important}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view[_ngcontent-%COMP%]{position:fixed;left:0;top:0;bottom:0;right:425%;height:100%;transform:translate(-425%);width:calc(100% - 28.5rem);transition:transform .5s cubic-bezier(.82,.085,.395,.895)}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .portal-view.opened[_ngcontent-%COMP%]{transform:translate(0);transition:width 0s .5s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view[_ngcontent-%COMP%]{width:100vw}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%]:not(.ccf-drawer-opened) .portal-view.opened[_ngcontent-%COMP%]{transition:width 0s}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .shaded-toggle[_ngcontent-%COMP%]{box-shadow:-1px 0 4px #212121}[_ngcontent-%COMP%]::-webkit-scrollbar{width:7.5rem}"],changeDetection:0}),t})();function wJ(t,e){1&t&&oa(0,"ccf-root")}function xJ(t){const e=t=>"string"==typeof t,n=t=>Array.isArray(t)&&t.every(e);if("string"==typeof t){const e=eZ.json(t);if(n(e))return e}else if(n(t))return t;throw new Error("Invalid data sources")}let SJ=(()=>{class t extends tZ{constructor(t,e){super(t,e,{initialDelay:10,initialConfig:Object.assign(Object.assign({},RG.dbOptions),globalThis.dbOptions),parse:{dataSources:xJ,useRemoteApi:eZ.boolean}})}}return t.\u0275fac=function(e){return new(e||t)(ea(SG),ea(tc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-root-wc"]],inputs:{dataSources:"dataSources",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[jo],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&Jo(0,wJ,1,0,"ccf-root",0),2&t&&na("ngIf",e.initialized)},directives:[_h,_J],encapsulation:2,changeDetection:0}),t})(),EJ=(()=>{class t{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(t,e){const n=function(t,e){return e.get(El).resolveComponentFactory(t).inputs}(t,e.injector),i=e.strategyFactory||new Bf(t,e.injector),r=function(t){const e={};return t.forEach(({propName:t,templateName:n})=>{e[function(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}(n)]=t}),e}(n);class s extends zf{constructor(t){super(),this.injector=t}get ngElementStrategy(){if(!this._ngElementStrategy){const t=this._ngElementStrategy=i.create(this.injector||e.injector);n.forEach(({propName:e})=>{if(!this.hasOwnProperty(e))return;const n=this[e];delete this[e],t.setInputValue(e,n)})}return this._ngElementStrategy}attributeChangedCallback(t,e,n,i){this.ngElementStrategy.setInputValue(r[t],n)}connectedCallback(){let t=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),t=!0),this.ngElementStrategy.connect(this),t||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(t=>{const e=function(t,e,n){if("function"!=typeof CustomEvent){const i=t.createEvent("CustomEvent");return i.initCustomEvent(e,!1,!1,n),i}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:n})}(this.ownerDocument,t.name,t.value);this.dispatchEvent(e)})}}return s.observedAttributes=Object.keys(r),n.forEach(({propName:t})=>{Object.defineProperty(s.prototype,t,{get(){return this.ngElementStrategy.getInputValue(t)},set(e){this.ngElementStrategy.setInputValue(t,e)},configurable:!0,enumerable:!0})}),s}(SJ,{injector:this.injector});customElements.define("ccf-eui",t)}}return t.\u0275fac=function(e){return new(e||t)(Ci(No))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:AG,useValue:"light-theme"},{provide:gf,useExisting:Nf}],imports:[[ky,gd,Yq,BQ,EY,KY,f_,xY,RQ,KQ,iG,dG,xG,rw,QQ,kG,G_]]}),t})();RG.production&&function(){if(Ru)throw new Error("Cannot enable prod mode after platform setup.");Du=!1}(),pd().bootstrapModule(EJ).catch(t=>console.error(t))},91052:function(t){function e(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(i,r)}t.exports=function(t){return function(){var n=this,i=arguments;return new Promise(function(r,s){var o=t.apply(n,i);function a(t){e(o,r,s,a,l,"next",t)}function l(t){e(o,r,s,a,l,"throw",t)}a(void 0)})}},t.exports.default=t.exports,t.exports.__esModule=!0},61948:function(t){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},34321:function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},91741:function(t){function e(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}e.keys=function(){return[]},e.resolve=e,e.id=91741,t.exports=e},9521:function(){},49125:function(){},75307:function(){}},function(t){t(t.s=35090)}]); \ No newline at end of file